From e34439bcefb264b5abe62edfce36a9a515fa0047 Mon Sep 17 00:00:00 2001 From: support Date: Mon, 14 Nov 2022 17:40:02 +0000 Subject: [PATCH] Built motion from commit 31b7cbf0.|2.6.22 --- apidoc/api_project.js | 2 +- apidoc/api_project.json | 2 +- server/api/action/action.attributes.js | 2 +- server/api/action/action.controller.js | 2 +- server/api/action/action.model.js | 2 +- server/api/action/action.rpc.js | 2 +- server/api/action/index.js | 2 +- .../analyticCustomReport.attributes.js | 2 +- .../analyticCustomReport.controller.js | 2 +- .../analyticCustomReport.model.js | 2 +- .../analyticCustomReport.rpc.js | 2 +- server/api/analyticCustomReport/index.js | 2 +- .../analyticDefaultReport.attributes.js | 2 +- .../analyticDefaultReport.controller.js | 2 +- .../analyticDefaultReport.model.js | 2 +- .../analyticDefaultReport.rpc.js | 2 +- server/api/analyticDefaultReport/index.js | 2 +- .../analyticExtractedReport.attributes.js | 2 +- .../analyticExtractedReport.controller.js | 2 +- .../analyticExtractedReport.model.js | 2 +- .../analyticExtractedReport.rpc.js | 2 +- server/api/analyticExtractedReport/index.js | 2 +- .../analyticFieldReport.attributes.js | 2 +- .../analyticFieldReport.controller.js | 2 +- .../analyticFieldReport.model.js | 2 +- .../analyticFieldReport/analyticFieldReport.rpc.js | 2 +- server/api/analyticFieldReport/index.js | 2 +- .../analyticMetric/analyticMetric.attributes.js | 2 +- .../analyticMetric/analyticMetric.controller.js | 2 +- server/api/analyticMetric/analyticMetric.model.js | 2 +- server/api/analyticMetric/analyticMetric.rpc.js | 2 +- server/api/analyticMetric/index.js | 2 +- .../analyticTreeReport.attributes.js | 2 +- .../analyticTreeReport.controller.js | 2 +- .../analyticTreeReport/analyticTreeReport.model.js | 2 +- .../analyticTreeReport/analyticTreeReport.rpc.js | 2 +- server/api/analyticTreeReport/index.js | 2 +- server/api/attachment/attachment.attributes.js | 2 +- server/api/attachment/attachment.controller.js | 2 +- server/api/attachment/attachment.model.js | 2 +- server/api/attachment/attachment.rpc.js | 2 +- server/api/attachment/index.js | 2 +- .../authActiveDirectory.controller.js | 2 +- server/api/authActiveDirectory/index.js | 2 +- server/api/authGoogle/authGoogle.controller.js | 2 +- server/api/authGoogle/index.js | 2 +- server/api/authLocal/authLocal.controller.js | 2 +- server/api/authLocal/index.js | 2 +- server/api/automation/automation.attributes.js | 2 +- server/api/automation/automation.controller.js | 2 +- server/api/automation/automation.model.js | 2 +- server/api/automation/automation.rpc.js | 2 +- server/api/automation/index.js | 2 +- server/api/campaign/campaign.attributes.js | 2 +- server/api/campaign/campaign.controller.js | 2 +- server/api/campaign/campaign.model.js | 2 +- server/api/campaign/campaign.rpc.js | 2 +- server/api/campaign/index.js | 2 +- server/api/cannedAnswer/cannedAnswer.attributes.js | 2 +- server/api/cannedAnswer/cannedAnswer.controller.js | 2 +- server/api/cannedAnswer/cannedAnswer.model.js | 2 +- server/api/cannedAnswer/cannedAnswer.rpc.js | 2 +- server/api/cannedAnswer/index.js | 2 +- server/api/cdr/cdr.attributes.js | 2 +- server/api/cdr/cdr.controller.js | 2 +- server/api/cdr/cdr.model.js | 2 +- server/api/cdr/cdr.rpc.js | 2 +- server/api/cdr/index.js | 2 +- .../chatApplication/chatApplication.attributes.js | 2 +- .../chatApplication/chatApplication.controller.js | 2 +- .../api/chatApplication/chatApplication.model.js | 2 +- server/api/chatApplication/chatApplication.rpc.js | 2 +- server/api/chatApplication/index.js | 2 +- server/api/chatGroup/chatGroup.attributes.js | 2 +- server/api/chatGroup/chatGroup.controller.js | 2 +- server/api/chatGroup/chatGroup.events.js | 2 +- server/api/chatGroup/chatGroup.model.js | 2 +- server/api/chatGroup/chatGroup.rpc.js | 2 +- server/api/chatGroup/chatGroup.socket.js | 2 +- server/api/chatGroup/index.js | 2 +- .../chatInteraction/chatInteraction.attributes.js | 2 +- .../chatInteraction/chatInteraction.controller.js | 2 +- .../api/chatInteraction/chatInteraction.events.js | 2 +- .../api/chatInteraction/chatInteraction.model.js | 2 +- server/api/chatInteraction/chatInteraction.rpc.js | 2 +- .../api/chatInteraction/chatInteraction.socket.js | 2 +- server/api/chatInteraction/index.js | 2 +- .../chatInternalMessage.attributes.js | 2 +- .../chatInternalMessage.controller.js | 2 +- .../chatInternalMessage.events.js | 2 +- .../chatInternalMessage.model.js | 2 +- .../chatInternalMessage/chatInternalMessage.rpc.js | 2 +- .../chatInternalMessage.socket.js | 2 +- server/api/chatInternalMessage/index.js | 2 +- server/api/chatMessage/chatMessage.attributes.js | 2 +- server/api/chatMessage/chatMessage.controller.js | 2 +- server/api/chatMessage/chatMessage.events.js | 2 +- server/api/chatMessage/chatMessage.model.js | 2 +- server/api/chatMessage/chatMessage.rpc.js | 2 +- server/api/chatMessage/chatMessage.socket.js | 2 +- server/api/chatMessage/index.js | 2 +- .../chatOfflineMessage.attributes.js | 2 +- .../chatOfflineMessage.controller.js | 2 +- .../chatOfflineMessage.events.js | 2 +- .../chatOfflineMessage/chatOfflineMessage.model.js | 2 +- .../chatOfflineMessage/chatOfflineMessage.rpc.js | 2 +- server/api/chatOfflineMessage/index.js | 2 +- .../chatProactiveAction.attributes.js | 2 +- .../chatProactiveAction.controller.js | 2 +- .../chatProactiveAction.model.js | 2 +- .../chatProactiveAction/chatProactiveAction.rpc.js | 2 +- server/api/chatProactiveAction/index.js | 2 +- server/api/chatQueue/chatQueue.attributes.js | 2 +- server/api/chatQueue/chatQueue.controller.js | 2 +- server/api/chatQueue/chatQueue.events.js | 2 +- server/api/chatQueue/chatQueue.model.js | 2 +- server/api/chatQueue/chatQueue.rpc.js | 2 +- server/api/chatQueue/chatQueue.socket.js | 2 +- server/api/chatQueue/index.js | 2 +- .../chatQueueReport/chatQueueReport.attributes.js | 2 +- .../chatQueueReport/chatQueueReport.controller.js | 2 +- .../api/chatQueueReport/chatQueueReport.model.js | 2 +- server/api/chatQueueReport/chatQueueReport.rpc.js | 2 +- server/api/chatQueueReport/index.js | 2 +- .../chatTransferReport.attributes.js | 2 +- .../chatTransferReport.controller.js | 2 +- .../chatTransferReport/chatTransferReport.model.js | 2 +- .../chatTransferReport/chatTransferReport.rpc.js | 2 +- server/api/chatTransferReport/index.js | 2 +- server/api/chatWebsite/chatWebsite.attributes.js | 2 +- server/api/chatWebsite/chatWebsite.controller.js | 2 +- server/api/chatWebsite/chatWebsite.events.js | 2 +- server/api/chatWebsite/chatWebsite.model.js | 2 +- server/api/chatWebsite/chatWebsite.rpc.js | 2 +- server/api/chatWebsite/chatWebsite.socket.js | 2 +- server/api/chatWebsite/index.js | 2 +- server/api/client-side-logs.js | 2 +- .../api/cloudProvider/cloudProvider.attributes.js | 2 +- .../api/cloudProvider/cloudProvider.controller.js | 2 +- server/api/cloudProvider/cloudProvider.model.js | 2 +- server/api/cloudProvider/cloudProvider.oauth.js | 2 +- server/api/cloudProvider/cloudProvider.rpc.js | 2 +- server/api/cloudProvider/index.js | 2 +- server/api/cmCompany/cmCompany.attributes.js | 2 +- server/api/cmCompany/cmCompany.controller.js | 2 +- server/api/cmCompany/cmCompany.model.js | 2 +- server/api/cmCompany/cmCompany.rpc.js | 2 +- server/api/cmCompany/index.js | 2 +- server/api/cmContact/cmContact.attributes.js | 2 +- server/api/cmContact/cmContact.controller.js | 2 +- server/api/cmContact/cmContact.events.js | 2 +- server/api/cmContact/cmContact.model.js | 2 +- server/api/cmContact/cmContact.rpc.js | 2 +- server/api/cmContact/cmContact.socket.js | 2 +- server/api/cmContact/index.js | 2 +- .../cmContactHasItem.attributes.js | 2 +- .../cmContactHasItem.controller.js | 2 +- .../api/cmContactHasItem/cmContactHasItem.model.js | 2 +- .../api/cmContactHasItem/cmContactHasItem.rpc.js | 2 +- server/api/cmContactHasItem/index.js | 2 +- .../api/cmCustomField/cmCustomField.attributes.js | 2 +- .../api/cmCustomField/cmCustomField.controller.js | 2 +- server/api/cmCustomField/cmCustomField.model.js | 2 +- server/api/cmCustomField/cmCustomField.rpc.js | 2 +- server/api/cmCustomField/index.js | 2 +- server/api/cmHopper/cmHopper.attributes.js | 2 +- server/api/cmHopper/cmHopper.controller.js | 2 +- server/api/cmHopper/cmHopper.model.js | 2 +- server/api/cmHopper/cmHopper.rpc.js | 2 +- server/api/cmHopper/index.js | 2 +- .../cmHopperAdditionalPhone.attributes.js | 2 +- .../cmHopperAdditionalPhone.controller.js | 2 +- .../cmHopperAdditionalPhone.model.js | 2 +- .../cmHopperAdditionalPhone.rpc.js | 2 +- server/api/cmHopperAdditionalPhone/index.js | 2 +- .../api/cmHopperBlack/cmHopperBlack.attributes.js | 2 +- .../api/cmHopperBlack/cmHopperBlack.controller.js | 2 +- server/api/cmHopperBlack/cmHopperBlack.model.js | 2 +- server/api/cmHopperBlack/cmHopperBlack.rpc.js | 2 +- server/api/cmHopperBlack/index.js | 2 +- .../api/cmHopperFinal/cmHopperFinal.attributes.js | 2 +- .../api/cmHopperFinal/cmHopperFinal.controller.js | 2 +- server/api/cmHopperFinal/cmHopperFinal.model.js | 2 +- server/api/cmHopperFinal/cmHopperFinal.rpc.js | 2 +- server/api/cmHopperFinal/index.js | 2 +- .../cmHopperHistory/cmHopperHistory.attributes.js | 2 +- .../cmHopperHistory/cmHopperHistory.controller.js | 2 +- .../api/cmHopperHistory/cmHopperHistory.model.js | 2 +- server/api/cmHopperHistory/cmHopperHistory.rpc.js | 2 +- server/api/cmHopperHistory/index.js | 2 +- server/api/cmList/cmList.attributes.js | 2 +- server/api/cmList/cmList.controller.js | 2 +- server/api/cmList/cmList.events.js | 2 +- server/api/cmList/cmList.model.js | 2 +- server/api/cmList/cmList.rpc.js | 2 +- server/api/cmList/cmList.socket.js | 2 +- server/api/cmList/index.js | 2 +- server/api/condition/condition.attributes.js | 2 +- server/api/condition/condition.controller.js | 2 +- server/api/condition/condition.model.js | 2 +- server/api/condition/condition.rpc.js | 2 +- server/api/condition/index.js | 2 +- .../contactItemType/contactItemType.attributes.js | 2 +- .../contactItemType/contactItemType.controller.js | 2 +- .../api/contactItemType/contactItemType.model.js | 2 +- server/api/contactItemType/contactItemType.rpc.js | 2 +- server/api/contactItemType/index.js | 2 +- server/api/dashboard/dashboard.attributes.js | 2 +- server/api/dashboard/dashboard.controller.js | 2 +- server/api/dashboard/dashboard.events.js | 2 +- server/api/dashboard/dashboard.model.js | 2 +- server/api/dashboard/dashboard.rpc.js | 2 +- server/api/dashboard/dashboard.socket.js | 2 +- server/api/dashboard/index.js | 2 +- .../api/dashboardItem/dashboardItem.attributes.js | 2 +- .../api/dashboardItem/dashboardItem.controller.js | 2 +- server/api/dashboardItem/dashboardItem.events.js | 2 +- server/api/dashboardItem/dashboardItem.model.js | 2 +- server/api/dashboardItem/dashboardItem.rpc.js | 2 +- server/api/dashboardItem/dashboardItem.socket.js | 2 +- server/api/dashboardItem/index.js | 2 +- server/api/disposition/disposition.attributes.js | 2 +- server/api/disposition/disposition.controller.js | 2 +- server/api/disposition/disposition.model.js | 2 +- server/api/disposition/disposition.rpc.js | 2 +- server/api/disposition/index.js | 2 +- server/api/faxAccount/faxAccount.attributes.js | 2 +- server/api/faxAccount/faxAccount.controller.js | 2 +- server/api/faxAccount/faxAccount.events.js | 2 +- server/api/faxAccount/faxAccount.model.js | 2 +- server/api/faxAccount/faxAccount.rpc.js | 2 +- server/api/faxAccount/faxAccount.socket.js | 2 +- server/api/faxAccount/index.js | 2 +- .../faxApplication/faxApplication.attributes.js | 2 +- .../faxApplication/faxApplication.controller.js | 2 +- server/api/faxApplication/faxApplication.model.js | 2 +- server/api/faxApplication/faxApplication.rpc.js | 2 +- server/api/faxApplication/index.js | 2 +- .../faxInteraction/faxInteraction.attributes.js | 2 +- .../faxInteraction/faxInteraction.controller.js | 2 +- server/api/faxInteraction/faxInteraction.events.js | 2 +- server/api/faxInteraction/faxInteraction.model.js | 2 +- server/api/faxInteraction/faxInteraction.rpc.js | 2 +- server/api/faxInteraction/faxInteraction.socket.js | 2 +- server/api/faxInteraction/index.js | 2 +- server/api/faxMessage/faxMessage.attributes.js | 2 +- server/api/faxMessage/faxMessage.controller.js | 2 +- server/api/faxMessage/faxMessage.events.js | 2 +- server/api/faxMessage/faxMessage.model.js | 2 +- server/api/faxMessage/faxMessage.rpc.js | 2 +- server/api/faxMessage/faxMessage.socket.js | 2 +- server/api/faxMessage/index.js | 2 +- server/api/faxQueue/faxQueue.attributes.js | 2 +- server/api/faxQueue/faxQueue.controller.js | 2 +- server/api/faxQueue/faxQueue.events.js | 2 +- server/api/faxQueue/faxQueue.model.js | 2 +- server/api/faxQueue/faxQueue.rpc.js | 2 +- server/api/faxQueue/faxQueue.socket.js | 2 +- server/api/faxQueue/index.js | 2 +- .../faxQueueReport/faxQueueReport.attributes.js | 2 +- .../faxQueueReport/faxQueueReport.controller.js | 2 +- server/api/faxQueueReport/faxQueueReport.model.js | 2 +- server/api/faxQueueReport/faxQueueReport.rpc.js | 2 +- server/api/faxQueueReport/index.js | 2 +- .../faxTransferReport.attributes.js | 2 +- .../faxTransferReport.controller.js | 2 +- .../faxTransferReport/faxTransferReport.model.js | 2 +- .../api/faxTransferReport/faxTransferReport.rpc.js | 2 +- server/api/faxTransferReport/index.js | 2 +- server/api/intDeskAccount/index.js | 2 +- .../intDeskAccount/intDeskAccount.attributes.js | 2 +- .../intDeskAccount/intDeskAccount.controller.js | 2 +- server/api/intDeskAccount/intDeskAccount.model.js | 2 +- server/api/intDeskAccount/intDeskAccount.rpc.js | 2 +- server/api/intDeskConfiguration/index.js | 2 +- .../intDeskConfiguration.attributes.js | 2 +- .../intDeskConfiguration.controller.js | 2 +- .../intDeskConfiguration.model.js | 2 +- .../intDeskConfiguration.rpc.js | 2 +- server/api/intDeskField/index.js | 2 +- server/api/intDeskField/intDeskField.attributes.js | 2 +- server/api/intDeskField/intDeskField.controller.js | 2 +- server/api/intDeskField/intDeskField.model.js | 2 +- server/api/intDeskField/intDeskField.rpc.js | 2 +- server/api/intDynamics365Account/index.js | 2 +- .../intDynamics365Account.attributes.js | 2 +- .../intDynamics365Account.controller.js | 2 +- .../intDynamics365Account.model.js | 2 +- .../intDynamics365Account.rpc.js | 2 +- server/api/intDynamics365Configuration/index.js | 2 +- .../intDynamics365Configuration.attributes.js | 2 +- .../intDynamics365Configuration.controller.js | 2 +- .../intDynamics365Configuration.model.js | 2 +- .../intDynamics365Configuration.rpc.js | 2 +- server/api/intDynamics365Field/index.js | 2 +- .../intDynamics365Field.attributes.js | 2 +- .../intDynamics365Field.controller.js | 2 +- .../intDynamics365Field.model.js | 2 +- .../intDynamics365Field/intDynamics365Field.rpc.js | 2 +- server/api/intFreshdeskAccount/index.js | 2 +- .../intFreshdeskAccount.attributes.js | 2 +- .../intFreshdeskAccount.controller.js | 2 +- .../intFreshdeskAccount.model.js | 2 +- .../intFreshdeskAccount/intFreshdeskAccount.rpc.js | 2 +- server/api/intFreshdeskConfiguration/index.js | 2 +- .../intFreshdeskConfiguration.attributes.js | 2 +- .../intFreshdeskConfiguration.controller.js | 2 +- .../intFreshdeskConfiguration.model.js | 2 +- .../intFreshdeskConfiguration.rpc.js | 2 +- server/api/intFreshdeskField/index.js | 2 +- .../intFreshdeskField.attributes.js | 2 +- .../intFreshdeskField.controller.js | 2 +- .../intFreshdeskField/intFreshdeskField.model.js | 2 +- .../api/intFreshdeskField/intFreshdeskField.rpc.js | 2 +- server/api/intFreshsalesAccount/index.js | 2 +- .../intFreshsalesAccount.attributes.js | 2 +- .../intFreshsalesAccount.controller.js | 2 +- .../intFreshsalesAccount.model.js | 2 +- .../intFreshsalesAccount.rpc.js | 2 +- server/api/intFreshsalesConfiguration/index.js | 2 +- .../intFreshsalesConfiguration.attributes.js | 2 +- .../intFreshsalesConfiguration.controller.js | 2 +- .../intFreshsalesConfiguration.model.js | 2 +- .../intFreshsalesConfiguration.rpc.js | 2 +- server/api/intFreshsalesField/index.js | 2 +- .../intFreshsalesField.attributes.js | 2 +- .../intFreshsalesField.controller.js | 2 +- .../intFreshsalesField/intFreshsalesField.model.js | 2 +- .../intFreshsalesField/intFreshsalesField.rpc.js | 2 +- server/api/intSalesforceAccount/index.js | 2 +- .../intSalesforceAccount.attributes.js | 2 +- .../intSalesforceAccount.controller.js | 2 +- .../intSalesforceAccount.model.js | 2 +- .../intSalesforceAccount.rpc.js | 2 +- server/api/intSalesforceConfiguration/index.js | 2 +- .../intSalesforceConfiguration.attributes.js | 2 +- .../intSalesforceConfiguration.controller.js | 2 +- .../intSalesforceConfiguration.model.js | 2 +- .../intSalesforceConfiguration.rpc.js | 2 +- server/api/intSalesforceField/index.js | 2 +- .../intSalesforceField.attributes.js | 2 +- .../intSalesforceField.controller.js | 2 +- .../intSalesforceField/intSalesforceField.model.js | 2 +- .../intSalesforceField/intSalesforceField.rpc.js | 2 +- server/api/intServicenowAccount/index.js | 2 +- .../intServicenowAccount.attributes.js | 2 +- .../intServicenowAccount.controller.js | 2 +- .../intServicenowAccount.model.js | 2 +- .../intServicenowAccount.rpc.js | 2 +- server/api/intServicenowConfiguration/index.js | 2 +- .../intServicenowConfiguration.attributes.js | 2 +- .../intServicenowConfiguration.controller.js | 2 +- .../intServicenowConfiguration.model.js | 2 +- .../intServicenowConfiguration.rpc.js | 2 +- server/api/intServicenowField/index.js | 2 +- .../intServicenowField.attributes.js | 2 +- .../intServicenowField.controller.js | 2 +- .../intServicenowField/intServicenowField.model.js | 2 +- .../intServicenowField/intServicenowField.rpc.js | 2 +- server/api/intSugarcrmAccount/index.js | 2 +- .../intSugarcrmAccount.attributes.js | 2 +- .../intSugarcrmAccount.controller.js | 2 +- .../intSugarcrmAccount/intSugarcrmAccount.model.js | 2 +- .../intSugarcrmAccount/intSugarcrmAccount.rpc.js | 2 +- server/api/intSugarcrmConfiguration/index.js | 2 +- .../intSugarcrmConfiguration.attributes.js | 2 +- .../intSugarcrmConfiguration.controller.js | 2 +- .../intSugarcrmConfiguration.model.js | 2 +- .../intSugarcrmConfiguration.rpc.js | 2 +- server/api/intSugarcrmField/index.js | 2 +- .../intSugarcrmField.attributes.js | 2 +- .../intSugarcrmField.controller.js | 2 +- .../api/intSugarcrmField/intSugarcrmField.model.js | 2 +- .../api/intSugarcrmField/intSugarcrmField.rpc.js | 2 +- server/api/intVtigerAccount/index.js | 2 +- .../intVtigerAccount.attributes.js | 2 +- .../intVtigerAccount.controller.js | 2 +- .../api/intVtigerAccount/intVtigerAccount.model.js | 2 +- .../api/intVtigerAccount/intVtigerAccount.rpc.js | 2 +- server/api/intVtigerConfiguration/index.js | 2 +- .../intVtigerConfiguration.attributes.js | 2 +- .../intVtigerConfiguration.controller.js | 2 +- .../intVtigerConfiguration.model.js | 2 +- .../intVtigerConfiguration.rpc.js | 2 +- server/api/intVtigerField/index.js | 2 +- .../intVtigerField/intVtigerField.attributes.js | 2 +- .../intVtigerField/intVtigerField.controller.js | 2 +- server/api/intVtigerField/intVtigerField.model.js | 2 +- server/api/intVtigerField/intVtigerField.rpc.js | 2 +- server/api/intZendeskAccount/index.js | 2 +- .../intZendeskAccount.attributes.js | 2 +- .../intZendeskAccount.controller.js | 2 +- .../intZendeskAccount/intZendeskAccount.model.js | 2 +- .../api/intZendeskAccount/intZendeskAccount.rpc.js | 2 +- server/api/intZendeskConfiguration/index.js | 2 +- .../intZendeskConfiguration.attributes.js | 2 +- .../intZendeskConfiguration.controller.js | 2 +- .../intZendeskConfiguration.model.js | 2 +- .../intZendeskConfiguration.rpc.js | 2 +- server/api/intZendeskField/index.js | 2 +- .../intZendeskField/intZendeskField.attributes.js | 2 +- .../intZendeskField/intZendeskField.controller.js | 2 +- .../api/intZendeskField/intZendeskField.model.js | 2 +- server/api/intZendeskField/intZendeskField.rpc.js | 2 +- server/api/intZohoAccount/index.js | 2 +- .../intZohoAccount/intZohoAccount.attributes.js | 2 +- .../intZohoAccount/intZohoAccount.controller.js | 2 +- server/api/intZohoAccount/intZohoAccount.model.js | 2 +- server/api/intZohoAccount/intZohoAccount.rpc.js | 2 +- server/api/intZohoConfiguration/index.js | 2 +- .../intZohoConfiguration.attributes.js | 2 +- .../intZohoConfiguration.controller.js | 2 +- .../intZohoConfiguration.model.js | 2 +- .../intZohoConfiguration.rpc.js | 2 +- server/api/intZohoField/index.js | 2 +- server/api/intZohoField/intZohoField.attributes.js | 2 +- server/api/intZohoField/intZohoField.controller.js | 2 +- server/api/intZohoField/intZohoField.model.js | 2 +- server/api/intZohoField/intZohoField.rpc.js | 2 +- server/api/integration/index.js | 2 +- server/api/integration/integration.attributes.js | 2 +- server/api/integration/integration.controller.js | 2 +- server/api/integration/integration.model.js | 2 +- server/api/integration/integration.rpc.js | 2 +- server/api/integrationReport/index.js | 2 +- .../integrationReport.attributes.js | 2 +- .../integrationReport.controller.js | 2 +- .../integrationReport/integrationReport.model.js | 2 +- .../api/integrationReport/integrationReport.rpc.js | 2 +- server/api/interval/index.js | 2 +- server/api/interval/interval.attributes.js | 2 +- server/api/interval/interval.controller.js | 2 +- server/api/interval/interval.model.js | 2 +- server/api/interval/interval.rpc.js | 2 +- server/api/jira/index.js | 2 +- server/api/jira/jira.controller.js | 2 +- server/api/jscriptyAnswerReport/index.js | 2 +- .../jscriptyAnswerReport.attributes.js | 2 +- .../jscriptyAnswerReport.controller.js | 2 +- .../jscriptyAnswerReport.model.js | 2 +- .../jscriptyAnswerReport.rpc.js | 2 +- server/api/jscriptyProject/index.js | 2 +- .../jscriptyProject/jscriptyProject.attributes.js | 2 +- .../jscriptyProject/jscriptyProject.controller.js | 2 +- .../api/jscriptyProject/jscriptyProject.model.js | 2 +- server/api/jscriptyProject/jscriptyProject.rpc.js | 2 +- server/api/jscriptyQuestionReport/index.js | 2 +- .../jscriptyQuestionReport.attributes.js | 2 +- .../jscriptyQuestionReport.controller.js | 2 +- .../jscriptyQuestionReport.model.js | 2 +- .../jscriptyQuestionReport.rpc.js | 2 +- server/api/jscriptySessionReport/index.js | 2 +- .../jscriptySessionReport.attributes.js | 2 +- .../jscriptySessionReport.controller.js | 2 +- .../jscriptySessionReport.model.js | 2 +- .../jscriptySessionReport.rpc.js | 2 +- server/api/license/index.js | 2 +- server/api/license/license.attributes.js | 2 +- server/api/license/license.controller.js | 2 +- server/api/license/license.model.js | 2 +- server/api/license/license.rpc.js | 2 +- server/api/mailAccount/index.js | 2 +- server/api/mailAccount/mailAccount.attributes.js | 2 +- server/api/mailAccount/mailAccount.controller.js | 2 +- server/api/mailAccount/mailAccount.events.js | 2 +- server/api/mailAccount/mailAccount.model.js | 2 +- server/api/mailAccount/mailAccount.rpc.js | 2 +- server/api/mailAccount/mailAccount.socket.js | 2 +- server/api/mailApplication/index.js | 2 +- .../mailApplication/mailApplication.attributes.js | 2 +- .../mailApplication/mailApplication.controller.js | 2 +- .../api/mailApplication/mailApplication.model.js | 2 +- server/api/mailApplication/mailApplication.rpc.js | 2 +- server/api/mailInteraction/index.js | 2 +- .../mailInteraction/mailInteraction.attributes.js | 2 +- .../mailInteraction/mailInteraction.controller.js | 2 +- .../api/mailInteraction/mailInteraction.events.js | 2 +- .../api/mailInteraction/mailInteraction.model.js | 2 +- server/api/mailInteraction/mailInteraction.rpc.js | 2 +- .../api/mailInteraction/mailInteraction.socket.js | 2 +- server/api/mailMessage/index.js | 2 +- server/api/mailMessage/mailMessage.attributes.js | 2 +- server/api/mailMessage/mailMessage.controller.js | 2 +- server/api/mailMessage/mailMessage.events.js | 2 +- server/api/mailMessage/mailMessage.model.js | 2 +- server/api/mailMessage/mailMessage.rpc.js | 2 +- server/api/mailMessage/mailMessage.socket.js | 2 +- server/api/mailQueue/index.js | 2 +- server/api/mailQueue/mailQueue.attributes.js | 2 +- server/api/mailQueue/mailQueue.controller.js | 2 +- server/api/mailQueue/mailQueue.events.js | 2 +- server/api/mailQueue/mailQueue.model.js | 2 +- server/api/mailQueue/mailQueue.rpc.js | 2 +- server/api/mailQueue/mailQueue.socket.js | 2 +- server/api/mailQueueReport/index.js | 2 +- .../mailQueueReport/mailQueueReport.attributes.js | 2 +- .../mailQueueReport/mailQueueReport.controller.js | 2 +- .../api/mailQueueReport/mailQueueReport.model.js | 2 +- server/api/mailQueueReport/mailQueueReport.rpc.js | 2 +- server/api/mailServerIn/index.js | 2 +- server/api/mailServerIn/mailServerIn.attributes.js | 2 +- server/api/mailServerIn/mailServerIn.model.js | 2 +- server/api/mailServerIn/mailServerIn.rpc.js | 2 +- server/api/mailServerOut/index.js | 2 +- .../api/mailServerOut/mailServerOut.attributes.js | 2 +- .../api/mailServerOut/mailServerOut.controller.js | 2 +- server/api/mailServerOut/mailServerOut.model.js | 2 +- server/api/mailServerOut/mailServerOut.rpc.js | 2 +- server/api/mailSubstatus/index.js | 2 +- .../api/mailSubstatus/mailSubstatus.attributes.js | 2 +- .../api/mailSubstatus/mailSubstatus.controller.js | 2 +- server/api/mailSubstatus/mailSubstatus.events.js | 2 +- server/api/mailSubstatus/mailSubstatus.model.js | 2 +- server/api/mailSubstatus/mailSubstatus.rpc.js | 2 +- server/api/mailTransferReport/index.js | 2 +- .../mailTransferReport.attributes.js | 2 +- .../mailTransferReport.controller.js | 2 +- .../mailTransferReport/mailTransferReport.model.js | 2 +- .../mailTransferReport/mailTransferReport.rpc.js | 2 +- server/api/memberReport/index.js | 2 +- server/api/memberReport/memberReport.attributes.js | 2 +- server/api/memberReport/memberReport.controller.js | 2 +- server/api/memberReport/memberReport.model.js | 2 +- server/api/memberReport/memberReport.rpc.js | 2 +- server/api/migration/index.js | 2 +- server/api/migration/migration.attributes.js | 2 +- server/api/migration/migration.controller.js | 2 +- server/api/migration/migration.model.js | 2 +- server/api/migration/migration.rpc.js | 2 +- server/api/network/index.js | 2 +- server/api/network/network.attributes.js | 2 +- server/api/network/network.controller.js | 2 +- server/api/network/network.model.js | 2 +- server/api/network/network.rpc.js | 2 +- server/api/openchannelAccount/index.js | 2 +- .../openchannelAccount.attributes.js | 2 +- .../openchannelAccount.controller.js | 2 +- .../openchannelAccount.events.js | 2 +- .../openchannelAccount/openchannelAccount.model.js | 2 +- .../openchannelAccount/openchannelAccount.rpc.js | 2 +- .../openchannelAccount.socket.js | 2 +- server/api/openchannelApplication/index.js | 2 +- .../openchannelApplication.attributes.js | 2 +- .../openchannelApplication.controller.js | 2 +- .../openchannelApplication.model.js | 2 +- .../openchannelApplication.rpc.js | 2 +- server/api/openchannelInteraction/index.js | 2 +- .../openchannelInteraction.attributes.js | 2 +- .../openchannelInteraction.controller.js | 2 +- .../openchannelInteraction.events.js | 2 +- .../openchannelInteraction.model.js | 2 +- .../openchannelInteraction.rpc.js | 2 +- .../openchannelInteraction.socket.js | 2 +- server/api/openchannelMessage/index.js | 2 +- .../openchannelMessage.attributes.js | 2 +- .../openchannelMessage.controller.js | 2 +- .../openchannelMessage.events.js | 2 +- .../openchannelMessage/openchannelMessage.model.js | 2 +- .../openchannelMessage/openchannelMessage.rpc.js | 2 +- .../openchannelMessage.socket.js | 2 +- server/api/openchannelQueue/index.js | 2 +- .../openchannelQueue.attributes.js | 2 +- .../openchannelQueue.controller.js | 2 +- .../openchannelQueue/openchannelQueue.events.js | 2 +- .../api/openchannelQueue/openchannelQueue.model.js | 2 +- .../api/openchannelQueue/openchannelQueue.rpc.js | 2 +- .../openchannelQueue/openchannelQueue.socket.js | 2 +- server/api/openchannelQueueReport/index.js | 2 +- .../openchannelQueueReport.attributes.js | 2 +- .../openchannelQueueReport.controller.js | 2 +- .../openchannelQueueReport.model.js | 2 +- .../openchannelQueueReport.rpc.js | 2 +- server/api/openchannelTransferReport/index.js | 2 +- .../openchannelTransferReport.attributes.js | 2 +- .../openchannelTransferReport.controller.js | 2 +- .../openchannelTransferReport.model.js | 2 +- .../openchannelTransferReport.rpc.js | 2 +- server/api/pause/index.js | 2 +- server/api/pause/pause.attributes.js | 2 +- server/api/pause/pause.controller.js | 2 +- server/api/pause/pause.model.js | 2 +- server/api/pause/pause.rpc.js | 2 +- server/api/plugin/index.js | 2 +- server/api/plugin/plugin.attributes.js | 2 +- server/api/plugin/plugin.controller.js | 2 +- server/api/plugin/plugin.events.js | 2 +- server/api/plugin/plugin.model.js | 2 +- server/api/plugin/plugin.rpc.js | 2 +- server/api/plugin/plugin.socket.js | 2 +- server/api/pm2/index.js | 2 +- server/api/pm2/pm2.controller.js | 2 +- server/api/realtime/index.js | 2 +- server/api/realtime/realtime.controller.js | 2 +- server/api/reportAgentPreview/index.js | 2 +- .../reportAgentPreview.attributes.js | 2 +- .../reportAgentPreview/reportAgentPreview.model.js | 2 +- .../reportAgentPreview/reportAgentPreview.rpc.js | 2 +- server/api/rpc/index.js | 2 +- server/api/rpc/rpc.controller.js | 2 +- server/api/schedule/index.js | 2 +- server/api/schedule/schedule.attributes.js | 2 +- server/api/schedule/schedule.controller.js | 2 +- server/api/schedule/schedule.model.js | 2 +- server/api/schedule/schedule.rpc.js | 2 +- server/api/screenRecording/index.js | 2 +- .../screenRecording/screenRecording.attributes.js | 2 +- .../screenRecording/screenRecording.controller.js | 2 +- .../api/screenRecording/screenRecording.model.js | 2 +- server/api/screenRecording/screenRecording.rpc.js | 2 +- server/api/setting/index.js | 2 +- server/api/setting/setting.attributes.js | 2 +- server/api/setting/setting.controller.js | 2 +- server/api/setting/setting.model.js | 2 +- server/api/setting/setting.rpc.js | 2 +- server/api/smsAccount/index.js | 2 +- server/api/smsAccount/smsAccount.attributes.js | 2 +- server/api/smsAccount/smsAccount.controller.js | 2 +- server/api/smsAccount/smsAccount.events.js | 2 +- server/api/smsAccount/smsAccount.model.js | 2 +- server/api/smsAccount/smsAccount.rpc.js | 2 +- server/api/smsAccount/smsAccount.socket.js | 2 +- server/api/smsApplication/index.js | 2 +- .../smsApplication/smsApplication.attributes.js | 2 +- .../smsApplication/smsApplication.controller.js | 2 +- server/api/smsApplication/smsApplication.model.js | 2 +- server/api/smsApplication/smsApplication.rpc.js | 2 +- server/api/smsInteraction/index.js | 2 +- .../smsInteraction/smsInteraction.attributes.js | 2 +- .../smsInteraction/smsInteraction.controller.js | 2 +- server/api/smsInteraction/smsInteraction.events.js | 2 +- server/api/smsInteraction/smsInteraction.model.js | 2 +- server/api/smsInteraction/smsInteraction.rpc.js | 2 +- server/api/smsInteraction/smsInteraction.socket.js | 2 +- server/api/smsMessage/index.js | 2 +- server/api/smsMessage/smsMessage.attributes.js | 2 +- server/api/smsMessage/smsMessage.controller.js | 2 +- server/api/smsMessage/smsMessage.events.js | 2 +- server/api/smsMessage/smsMessage.model.js | 2 +- server/api/smsMessage/smsMessage.rpc.js | 2 +- server/api/smsMessage/smsMessage.socket.js | 2 +- server/api/smsQueue/index.js | 2 +- server/api/smsQueue/smsQueue.attributes.js | 2 +- server/api/smsQueue/smsQueue.controller.js | 2 +- server/api/smsQueue/smsQueue.events.js | 2 +- server/api/smsQueue/smsQueue.model.js | 2 +- server/api/smsQueue/smsQueue.rpc.js | 2 +- server/api/smsQueue/smsQueue.socket.js | 2 +- server/api/smsQueueReport/index.js | 2 +- .../smsQueueReport/smsQueueReport.attributes.js | 2 +- .../smsQueueReport/smsQueueReport.controller.js | 2 +- server/api/smsQueueReport/smsQueueReport.model.js | 2 +- server/api/smsQueueReport/smsQueueReport.rpc.js | 2 +- server/api/smsTransferReport/index.js | 2 +- .../smsTransferReport.attributes.js | 2 +- .../smsTransferReport.controller.js | 2 +- .../smsTransferReport/smsTransferReport.model.js | 2 +- .../api/smsTransferReport/smsTransferReport.rpc.js | 2 +- server/api/sound/index.js | 2 +- server/api/sound/sound.attributes.js | 2 +- server/api/sound/sound.controller.js | 2 +- server/api/sound/sound.model.js | 2 +- server/api/sound/sound.rpc.js | 2 +- server/api/squareMessage/index.js | 2 +- .../api/squareMessage/squareMessage.attributes.js | 2 +- .../api/squareMessage/squareMessage.controller.js | 2 +- server/api/squareMessage/squareMessage.model.js | 2 +- server/api/squareMessage/squareMessage.rpc.js | 2 +- server/api/squareOdbc/index.js | 2 +- server/api/squareOdbc/squareOdbc.attributes.js | 2 +- server/api/squareOdbc/squareOdbc.controller.js | 2 +- server/api/squareOdbc/squareOdbc.model.js | 2 +- server/api/squareOdbc/squareOdbc.rpc.js | 2 +- server/api/squareProject/index.js | 2 +- .../api/squareProject/squareProject.attributes.js | 2 +- .../api/squareProject/squareProject.controller.js | 2 +- server/api/squareProject/squareProject.events.js | 2 +- server/api/squareProject/squareProject.model.js | 2 +- server/api/squareProject/squareProject.rpc.js | 2 +- server/api/squareProject/squareProject.socket.js | 2 +- server/api/squareRecording/index.js | 2 +- .../squareRecording/squareRecording.attributes.js | 2 +- .../squareRecording/squareRecording.controller.js | 2 +- .../api/squareRecording/squareRecording.model.js | 2 +- server/api/squareRecording/squareRecording.rpc.js | 2 +- server/api/squareReport/index.js | 2 +- server/api/squareReport/squareReport.attributes.js | 2 +- server/api/squareReport/squareReport.controller.js | 2 +- server/api/squareReport/squareReport.model.js | 2 +- server/api/squareReport/squareReport.rpc.js | 2 +- server/api/squareReportDetail/index.js | 2 +- .../squareReportDetail.attributes.js | 2 +- .../squareReportDetail.controller.js | 2 +- .../squareReportDetail/squareReportDetail.model.js | 2 +- .../squareReportDetail/squareReportDetail.rpc.js | 2 +- server/api/system/index.js | 2 +- server/api/system/system.controller.js | 2 +- server/api/tag/index.js | 2 +- server/api/tag/tag.attributes.js | 2 +- server/api/tag/tag.controller.js | 2 +- server/api/tag/tag.model.js | 2 +- server/api/tag/tag.rpc.js | 2 +- server/api/team/index.js | 2 +- server/api/team/team.attributes.js | 2 +- server/api/team/team.controller.js | 2 +- server/api/team/team.events.js | 2 +- server/api/team/team.model.js | 2 +- server/api/team/team.rpc.js | 2 +- server/api/team/team.socket.js | 2 +- .../teamVoicePrefix/teamVoicePrefix.attributes.js | 2 +- .../api/teamVoicePrefix/teamVoicePrefix.model.js | 2 +- server/api/teamVoiceQueue/index.js | 2 +- .../teamVoiceQueue/teamVoiceQueue.attributes.js | 2 +- server/api/teamVoiceQueue/teamVoiceQueue.model.js | 2 +- server/api/teamVoiceQueue/teamVoiceQueue.rpc.js | 2 +- server/api/template/index.js | 2 +- server/api/template/template.attributes.js | 2 +- server/api/template/template.controller.js | 2 +- server/api/template/template.model.js | 2 +- server/api/template/template.rpc.js | 2 +- server/api/trigger/index.js | 2 +- server/api/trigger/trigger.attributes.js | 2 +- server/api/trigger/trigger.controller.js | 2 +- server/api/trigger/trigger.model.js | 2 +- server/api/trigger/trigger.rpc.js | 2 +- server/api/trunk/index.js | 2 +- server/api/trunk/trunk.attributes.js | 2 +- server/api/trunk/trunk.controller.js | 2 +- server/api/trunk/trunk.model.js | 2 +- server/api/trunk/trunk.rpc.js | 2 +- server/api/user-setting/index.js | 2 +- server/api/user-setting/user-setting.attributes.js | 2 +- server/api/user-setting/user-setting.controller.js | 2 +- server/api/user-setting/user-setting.events.js | 2 +- server/api/user-setting/user-setting.model.js | 2 +- server/api/user-setting/user-setting.socket.js | 2 +- server/api/user/index.js | 2 +- server/api/user/user.attributes.js | 2 +- server/api/user/user.controller.js | 2 +- server/api/user/user.events.js | 2 +- server/api/user/user.model.js | 2 +- server/api/user/user.rpc.js | 2 +- server/api/user/user.socket.js | 2 +- server/api/userChatQueue/index.js | 2 +- .../api/userChatQueue/userChatQueue.attributes.js | 2 +- server/api/userChatQueue/userChatQueue.model.js | 2 +- server/api/userChatQueue/userChatQueue.rpc.js | 2 +- server/api/userFaxQueue/index.js | 2 +- server/api/userFaxQueue/userFaxQueue.attributes.js | 2 +- server/api/userFaxQueue/userFaxQueue.model.js | 2 +- server/api/userFaxQueue/userFaxQueue.rpc.js | 2 +- server/api/userMailQueue/index.js | 2 +- .../api/userMailQueue/userMailQueue.attributes.js | 2 +- server/api/userMailQueue/userMailQueue.model.js | 2 +- server/api/userMailQueue/userMailQueue.rpc.js | 2 +- server/api/userNotification/index.js | 2 +- .../userNotification.attributes.js | 2 +- .../userNotification.controller.js | 2 +- .../userNotification/userNotification.events.js | 2 +- .../api/userNotification/userNotification.model.js | 2 +- .../api/userNotification/userNotification.rpc.js | 2 +- .../userNotification/userNotification.socket.js | 2 +- server/api/userOpenchannelQueue/index.js | 2 +- .../userOpenchannelQueue.attributes.js | 2 +- .../userOpenchannelQueue.model.js | 2 +- .../userOpenchannelQueue.rpc.js | 2 +- server/api/userProfile/index.js | 2 +- server/api/userProfile/userProfile.attributes.js | 2 +- server/api/userProfile/userProfile.controller.js | 2 +- server/api/userProfile/userProfile.events.js | 2 +- server/api/userProfile/userProfile.model.js | 2 +- server/api/userProfile/userProfile.rpc.js | 2 +- server/api/userProfile/userProfile.socket.js | 2 +- server/api/userProfileResource/index.js | 2 +- .../userProfileResource.attributes.js | 2 +- .../userProfileResource.controller.js | 2 +- .../userProfileResource.model.js | 2 +- .../userProfileResource/userProfileResource.rpc.js | 2 +- server/api/userProfileSection/index.js | 2 +- .../userProfileSection.attributes.js | 2 +- .../userProfileSection.controller.js | 2 +- .../userProfileSection/userProfileSection.model.js | 2 +- .../userProfileSection/userProfileSection.rpc.js | 2 +- server/api/userSmsQueue/index.js | 2 +- server/api/userSmsQueue/userSmsQueue.attributes.js | 2 +- server/api/userSmsQueue/userSmsQueue.model.js | 2 +- server/api/userSmsQueue/userSmsQueue.rpc.js | 2 +- .../userVoicePrefix/userVoicePrefix.attributes.js | 2 +- .../api/userVoicePrefix/userVoicePrefix.model.js | 2 +- server/api/userVoiceQueue/index.js | 2 +- .../userVoiceQueue/userVoiceQueue.attributes.js | 2 +- server/api/userVoiceQueue/userVoiceQueue.model.js | 2 +- server/api/userVoiceQueue/userVoiceQueue.rpc.js | 2 +- server/api/userVoiceQueueRt/index.js | 2 +- .../userVoiceQueueRt.attributes.js | 2 +- .../userVoiceQueueRt/userVoiceQueueRt.events.js | 2 +- .../api/userVoiceQueueRt/userVoiceQueueRt.model.js | 2 +- .../api/userVoiceQueueRt/userVoiceQueueRt.rpc.js | 2 +- .../userVoiceQueueRt/userVoiceQueueRt.socket.js | 2 +- server/api/userWhatsappQueue/index.js | 2 +- .../userWhatsappQueue.attributes.js | 2 +- .../userWhatsappQueue/userWhatsappQueue.model.js | 2 +- .../api/userWhatsappQueue/userWhatsappQueue.rpc.js | 2 +- server/api/variable/index.js | 2 +- server/api/variable/variable.attributes.js | 2 +- server/api/variable/variable.controller.js | 2 +- server/api/variable/variable.model.js | 2 +- server/api/variable/variable.rpc.js | 2 +- server/api/version/index.js | 2 +- server/api/version/version.controller.js | 2 +- server/api/voiceAgentReport/index.js | 2 +- .../voiceAgentReport.attributes.js | 2 +- .../voiceAgentReport.controller.js | 2 +- .../api/voiceAgentReport/voiceAgentReport.model.js | 2 +- .../api/voiceAgentReport/voiceAgentReport.rpc.js | 2 +- server/api/voiceCallReport/index.js | 2 +- .../voiceCallReport/voiceCallReport.attributes.js | 2 +- .../voiceCallReport/voiceCallReport.controller.js | 2 +- .../api/voiceCallReport/voiceCallReport.model.js | 2 +- server/api/voiceCallReport/voiceCallReport.rpc.js | 2 +- server/api/voiceChanSpy/index.js | 2 +- server/api/voiceChanSpy/voiceChanSpy.attributes.js | 2 +- server/api/voiceChanSpy/voiceChanSpy.controller.js | 2 +- server/api/voiceChanSpy/voiceChanSpy.model.js | 2 +- server/api/voiceChanSpy/voiceChanSpy.rpc.js | 2 +- server/api/voiceContext/index.js | 2 +- server/api/voiceContext/voiceContext.attributes.js | 2 +- server/api/voiceContext/voiceContext.controller.js | 2 +- server/api/voiceContext/voiceContext.model.js | 2 +- server/api/voiceContext/voiceContext.rpc.js | 2 +- server/api/voiceDialReport/index.js | 2 +- .../voiceDialReport/voiceDialReport.attributes.js | 2 +- .../voiceDialReport/voiceDialReport.controller.js | 2 +- .../api/voiceDialReport/voiceDialReport.model.js | 2 +- server/api/voiceDialReport/voiceDialReport.rpc.js | 2 +- server/api/voiceExtension/index.js | 2 +- .../voiceExtension/voiceExtension.attributes.js | 2 +- .../voiceExtension/voiceExtension.controller.js | 2 +- server/api/voiceExtension/voiceExtension.events.js | 2 +- server/api/voiceExtension/voiceExtension.model.js | 2 +- server/api/voiceExtension/voiceExtension.rpc.js | 2 +- server/api/voiceExtension/voiceExtension.socket.js | 2 +- server/api/voiceMail/index.js | 2 +- server/api/voiceMail/voiceMail.attributes.js | 2 +- server/api/voiceMail/voiceMail.controller.js | 2 +- server/api/voiceMail/voiceMail.model.js | 2 +- server/api/voiceMail/voiceMail.rpc.js | 2 +- server/api/voiceMailMessage/index.js | 2 +- .../voiceMailMessage.attributes.js | 2 +- .../voiceMailMessage.controller.js | 2 +- .../api/voiceMailMessage/voiceMailMessage.model.js | 2 +- .../api/voiceMailMessage/voiceMailMessage.rpc.js | 2 +- server/api/voiceMusicOnHold/index.js | 2 +- .../voiceMusicOnHold.attributes.js | 2 +- .../voiceMusicOnHold.controller.js | 2 +- .../api/voiceMusicOnHold/voiceMusicOnHold.model.js | 2 +- .../api/voiceMusicOnHold/voiceMusicOnHold.rpc.js | 2 +- server/api/voicePrefix/index.js | 2 +- server/api/voicePrefix/voicePrefix.attributes.js | 2 +- server/api/voicePrefix/voicePrefix.controller.js | 2 +- server/api/voicePrefix/voicePrefix.events.js | 2 +- server/api/voicePrefix/voicePrefix.model.js | 2 +- server/api/voicePrefix/voicePrefix.rpc.js | 2 +- server/api/voicePrefix/voicePrefix.socket.js | 2 +- server/api/voiceQueue/index.js | 2 +- server/api/voiceQueue/voiceQueue.attributes.js | 2 +- server/api/voiceQueue/voiceQueue.controller.js | 2 +- server/api/voiceQueue/voiceQueue.events.js | 2 +- server/api/voiceQueue/voiceQueue.model.js | 2 +- server/api/voiceQueue/voiceQueue.rpc.js | 2 +- server/api/voiceQueue/voiceQueue.socket.js | 2 +- server/api/voiceQueueReport/index.js | 2 +- .../voiceQueueReport.attributes.js | 2 +- .../voiceQueueReport.controller.js | 2 +- .../voiceQueueReport/voiceQueueReport.events.js | 2 +- .../api/voiceQueueReport/voiceQueueReport.model.js | 2 +- .../api/voiceQueueReport/voiceQueueReport.rpc.js | 2 +- .../voiceQueueReport/voiceQueueReport.socket.js | 2 +- server/api/voiceQueuesLog/index.js | 2 +- .../voiceQueuesLog/voiceQueuesLog.attributes.js | 2 +- .../voiceQueuesLog/voiceQueuesLog.controller.js | 2 +- server/api/voiceQueuesLog/voiceQueuesLog.model.js | 2 +- server/api/voiceQueuesLog/voiceQueuesLog.rpc.js | 2 +- server/api/voiceRecording/index.js | 2 +- .../voiceRecording/voiceRecording.attributes.js | 2 +- .../voiceRecording/voiceRecording.controller.js | 2 +- server/api/voiceRecording/voiceRecording.model.js | 2 +- server/api/voiceRecording/voiceRecording.rpc.js | 2 +- server/api/voiceTransferReport/index.js | 2 +- .../voiceTransferReport.attributes.js | 2 +- .../voiceTransferReport.controller.js | 2 +- .../voiceTransferReport.model.js | 2 +- .../voiceTransferReport/voiceTransferReport.rpc.js | 2 +- server/api/webbar/index.js | 2 +- server/api/webbar/webbar.controller.js | 2 +- server/api/whatsappAccount/index.js | 2 +- .../whatsappAccount/whatsappAccount.attributes.js | 2 +- .../whatsappAccount/whatsappAccount.controller.js | 2 +- .../api/whatsappAccount/whatsappAccount.events.js | 2 +- .../api/whatsappAccount/whatsappAccount.model.js | 2 +- server/api/whatsappAccount/whatsappAccount.rpc.js | 2 +- .../api/whatsappAccount/whatsappAccount.socket.js | 2 +- server/api/whatsappApplication/index.js | 2 +- .../whatsappApplication.attributes.js | 2 +- .../whatsappApplication.controller.js | 2 +- .../whatsappApplication.model.js | 2 +- .../whatsappApplication/whatsappApplication.rpc.js | 2 +- server/api/whatsappInteraction/index.js | 2 +- .../whatsappInteraction.attributes.js | 2 +- .../whatsappInteraction.controller.js | 2 +- .../whatsappInteraction.events.js | 2 +- .../whatsappInteraction.model.js | 2 +- .../whatsappInteraction/whatsappInteraction.rpc.js | 2 +- .../whatsappInteraction.socket.js | 2 +- server/api/whatsappMessage/index.js | 2 +- .../whatsappMessage/whatsappMessage.attributes.js | 2 +- .../whatsappMessage/whatsappMessage.controller.js | 2 +- .../api/whatsappMessage/whatsappMessage.events.js | 2 +- .../api/whatsappMessage/whatsappMessage.model.js | 2 +- server/api/whatsappMessage/whatsappMessage.rpc.js | 2 +- .../api/whatsappMessage/whatsappMessage.socket.js | 2 +- server/api/whatsappQueue/index.js | 2 +- .../api/whatsappQueue/whatsappQueue.attributes.js | 2 +- .../api/whatsappQueue/whatsappQueue.controller.js | 2 +- server/api/whatsappQueue/whatsappQueue.events.js | 2 +- server/api/whatsappQueue/whatsappQueue.model.js | 2 +- server/api/whatsappQueue/whatsappQueue.rpc.js | 2 +- server/api/whatsappQueue/whatsappQueue.socket.js | 2 +- server/api/whatsappQueueReport/index.js | 2 +- .../whatsappQueueReport.attributes.js | 2 +- .../whatsappQueueReport.controller.js | 2 +- .../whatsappQueueReport.model.js | 2 +- .../whatsappQueueReport/whatsappQueueReport.rpc.js | 2 +- server/api/whatsappTransferReport/index.js | 2 +- .../whatsappTransferReport.attributes.js | 2 +- .../whatsappTransferReport.controller.js | 2 +- .../whatsappTransferReport.model.js | 2 +- .../whatsappTransferReport.rpc.js | 2 +- server/app.js | 2 +- server/components/auth/service.js | 2 +- server/components/contacts/index.js | 2 +- server/components/contacts/sql-utils.js | 2 +- server/components/encryptor/index.js | 2 +- server/components/export/csv.js | 2 +- server/components/export/pdf.js | 2 +- server/components/export/xlsx.js | 2 +- server/components/extensions/rewrite.js | 2 +- server/components/import/cm/csv.js | 2 +- server/components/import/cm/csv2.js | 2 +- server/components/import/cm/csvUpdates.js | 2 +- server/components/integrations/configuration.js | 2 +- server/components/interaction/service.js | 2 +- server/components/interaction/sql-utils.js | 2 +- .../components/interaction/update-interaction.js | 2 +- server/components/interaction/utils.js | 2 +- server/components/license/service.js | 2 +- server/components/parsers/advancedSearch.js | 2 +- server/components/parsers/qs.js | 2 +- server/components/realtime/agents.js | 2 +- server/components/realtime/queues.js | 2 +- server/config/express.js | 2 +- server/config/license/hardware.js | 2 +- server/config/license/index.js | 2 +- server/config/license/util.js | 2 +- server/config/local.env.js | 2 +- server/config/logger.js | 2 +- server/config/pm2/config.js | 2 +- server/config/pm2/index.js | 2 +- server/config/schedule/chat.js | 2 +- server/config/schedule/cloud-provider.js | 2 +- server/config/schedule/index.js | 2 +- server/config/schedule/transcribe.js | 2 +- server/config/schedule/whatsapp.js | 2 +- server/config/seedContact.js | 2 +- server/config/seedUsers.js | 2 +- server/config/socketio.js | 2 +- server/config/triggers/index.js | 2 +- server/config/utils.js | 2 +- server/errors/api.js | 2 +- server/errors/index.js | 2 +- server/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 568995e..36005d0 100644 --- a/apidoc/api_project.js +++ b/apidoc/api_project.js @@ -17,7 +17,7 @@ define({ "apidoc": "0.3.0", "generator": { "name": "apidoc", - "time": "2022-11-14T16:08:43.510Z", + "time": "2022-11-14T17:31:48.139Z", "url": "http://apidocjs.com", "version": "0.24.0" } diff --git a/apidoc/api_project.json b/apidoc/api_project.json index 8e04d4b..eac5841 100644 --- a/apidoc/api_project.json +++ b/apidoc/api_project.json @@ -17,7 +17,7 @@ "apidoc": "0.3.0", "generator": { "name": "apidoc", - "time": "2022-11-14T16:08:43.510Z", + "time": "2022-11-14T17:31:48.139Z", "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 2b7913e..57b26bb 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 _0x0b6b=['contactManager[autoCreate(0=No,1=Yes)],\x20urlForward[URL],\x20script[type],\x20integration[AccountId],\x20motionbar[TemplateId,URL,WinAppPath],\x20browser[TemplateId,URL]','contactManager[searchFields],\x20script[script],\x20integration[ConfigurationId],\x20motionbar[NULL,eventVariables(0=No,1=Yes),WinAppArguments],\x20browser[NULL,eventVariables(0=No,1=Yes)]','browser[location(0=NewTab,1=NewWindow,2=MotionTab)],\x20contactManager[autoCreateField]','urlForward[timeout],\x20browser[windowWidth],\x20contactManager[ignoreDialerContactId]','urlForward[headers],\x20browser[wsindowHeight]','TEXT','urlForward[body]','sequelize','getDataValue','action','STRING','contactManager','jscripty','browser','bot','script','Allowed\x20values:\x20contactManager,\x20integration,\x20motionbar,\x20jscripty,\x20urlForward,\x20browser,\x20bot,\x20script','jscripty[ProjectId],\x20browser[type(0=Popup,1=CTI\x20URL)],\x20contactManager[ListId],\x20urlForward[type(GET,POST,PUT,DELETE)],\x20script[info],\x20integration[intName(desk,dynamics365,freshdesk,freshsales,salesforce,sugarcrm,vtiger,zendesk,zoho)],\x20motionbar[type(0=Popup,1=CTI\x20URL,2=WinApp)]'];(function(_0x187ee1,_0x3fd1e6){var _0x388160=function(_0x542dd2){while(--_0x542dd2){_0x187ee1['push'](_0x187ee1['shift']());}};_0x388160(++_0x3fd1e6);}(_0x0b6b,0xdf));var _0xb0b6=function(_0x47cfa0,_0x176b87){_0x47cfa0=_0x47cfa0-0x0;var _0x386b1d=_0x0b6b[_0x47cfa0];return _0x386b1d;};'use strict';var Sequelize=require(_0xb0b6('0x0'));module['exports']={'name':{'type':Sequelize['VIRTUAL'],'get':function(_0x39cde9){return this[_0xb0b6('0x1')](_0xb0b6('0x2'));}},'action':{'type':Sequelize[_0xb0b6('0x3')],'allowNull':![],'validate':{'isIn':{'args':[[_0xb0b6('0x4'),'integration','motionbar',_0xb0b6('0x5'),'urlForward',_0xb0b6('0x6'),_0xb0b6('0x7'),_0xb0b6('0x8')]],'msg':'Allowed\x20values:\x20contactManager,\x20integration,\x20motionbar,\x20jscripty,\x20urlForward,\x20browser,\x20bot,\x20script'}},'comment':_0xb0b6('0x9')},'data1':{'type':Sequelize[_0xb0b6('0x3')](0x1000),'comment':_0xb0b6('0xa')},'data2':{'type':Sequelize[_0xb0b6('0x3')](0x1000),'comment':_0xb0b6('0xb')},'data3':{'type':Sequelize[_0xb0b6('0x3')](0x1000),'comment':_0xb0b6('0xc')},'data4':{'type':Sequelize[_0xb0b6('0x3')](0x1000),'comments':_0xb0b6('0xd')},'data5':{'type':Sequelize[_0xb0b6('0x3')](0x1000),'comments':_0xb0b6('0xe')},'data6':{'type':Sequelize[_0xb0b6('0x3')],'comments':_0xb0b6('0xf')},'data7':{'type':Sequelize[_0xb0b6('0x10')],'comments':_0xb0b6('0x11')}}; \ No newline at end of file +var _0xe49a=['bot','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]','urlForward[timeout],\x20browser[windowWidth],\x20contactManager[ignoreDialerContactId]','TEXT','urlForward[body]','exports','VIRTUAL','getDataValue','action','STRING','contactManager','motionbar','jscripty','urlForward'];(function(_0x394569,_0x48ee10){var _0x1fa462=function(_0x3b1314){while(--_0x3b1314){_0x394569['push'](_0x394569['shift']());}};_0x1fa462(++_0x48ee10);}(_0xe49a,0xd7));var _0xae49=function(_0x1e9d0e,_0x27c280){_0x1e9d0e=_0x1e9d0e-0x0;var _0x22b95e=_0xe49a[_0x1e9d0e];return _0x22b95e;};'use strict';var Sequelize=require('sequelize');module[_0xae49('0x0')]={'name':{'type':Sequelize[_0xae49('0x1')],'get':function(_0x30615e){return this[_0xae49('0x2')](_0xae49('0x3'));}},'action':{'type':Sequelize[_0xae49('0x4')],'allowNull':![],'validate':{'isIn':{'args':[[_0xae49('0x5'),'integration',_0xae49('0x6'),_0xae49('0x7'),_0xae49('0x8'),'browser',_0xae49('0x9'),'script']],'msg':_0xae49('0xa')}},'comment':_0xae49('0xa')},'data1':{'type':Sequelize[_0xae49('0x4')](0x1000),'comment':_0xae49('0xb')},'data2':{'type':Sequelize[_0xae49('0x4')](0x1000),'comment':_0xae49('0xc')},'data3':{'type':Sequelize[_0xae49('0x4')](0x1000),'comment':'contactManager[searchFields],\x20script[script],\x20integration[ConfigurationId],\x20motionbar[NULL,eventVariables(0=No,1=Yes),WinAppArguments],\x20browser[NULL,eventVariables(0=No,1=Yes)]'},'data4':{'type':Sequelize[_0xae49('0x4')](0x1000),'comments':'browser[location(0=NewTab,1=NewWindow,2=MotionTab)],\x20contactManager[autoCreateField]'},'data5':{'type':Sequelize[_0xae49('0x4')](0x1000),'comments':_0xae49('0xd')},'data6':{'type':Sequelize[_0xae49('0x4')],'comments':'urlForward[headers],\x20browser[wsindowHeight]'},'data7':{'type':Sequelize[_0xae49('0xe')],'comments':_0xae49('0xf')}}; \ No newline at end of file diff --git a/server/api/action/action.controller.js b/server/api/action/action.controller.js index 9bef570..ddd1c38 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 _0xa028=['json','undefined','limit','count','Content-Range','apply','save','then','destroy','name','send','update','body','Action','find','catch','params','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','lodash','squel','crypto','to-csv','querystring','papaparse','ioredis','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end'];(function(_0x800105,_0x28370d){var _0x18a7e0=function(_0x2e3f28){while(--_0x2e3f28){_0x800105['push'](_0x800105['shift']());}};_0x18a7e0(++_0x28370d);}(_0xa028,0x98));var _0x8a02=function(_0x46a4d5,_0x43e654){_0x46a4d5=_0x46a4d5-0x0;var _0x20ae52=_0xa028[_0x46a4d5];return _0x20ae52;};'use strict';var emlformat=require(_0x8a02('0x0'));var rimraf=require(_0x8a02('0x1'));var zipdir=require(_0x8a02('0x2'));var jsonpatch=require(_0x8a02('0x3'));var rp=require(_0x8a02('0x4'));var moment=require(_0x8a02('0x5'));var BPromise=require(_0x8a02('0x6'));var Mustache=require(_0x8a02('0x7'));var util=require(_0x8a02('0x8'));var path=require(_0x8a02('0x9'));var sox=require(_0x8a02('0xa'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x8a02('0xb'));var squel=require(_0x8a02('0xc'));var crypto=require(_0x8a02('0xd'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0x8a02('0xe'));var querystring=require(_0x8a02('0xf'));var Papa=require(_0x8a02('0x10'));var Redis=require(_0x8a02('0x11'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0x8a02('0x12'));var hardwareService=require(_0x8a02('0x13'));var logger=require(_0x8a02('0x14'))(_0x8a02('0x15'));var utils=require('../../config/utils');var config=require(_0x8a02('0x16'));var licenseUtil=require(_0x8a02('0x17'));var db=require(_0x8a02('0x18'))['db'];function respondWithStatusCode(_0x4913b9,_0x1d8094){_0x1d8094=_0x1d8094||0xcc;return function(_0x29a15d){if(_0x29a15d){return _0x4913b9[_0x8a02('0x19')](_0x1d8094);}return _0x4913b9[_0x8a02('0x1a')](_0x1d8094)[_0x8a02('0x1b')]();};}function respondWithResult(_0xcb7a2d,_0x5f59d7){_0x5f59d7=_0x5f59d7||0xc8;return function(_0x2dd0fd){if(_0x2dd0fd){return _0xcb7a2d[_0x8a02('0x1a')](_0x5f59d7)[_0x8a02('0x1c')](_0x2dd0fd);}};}function respondWithFilteredResult(_0x415898,_0x40827d){return function(_0x250145){if(_0x250145){var _0x1cfa37=typeof _0x40827d['offset']===_0x8a02('0x1d')&&typeof _0x40827d[_0x8a02('0x1e')]==='undefined';var _0x3ef007=_0x250145[_0x8a02('0x1f')];var _0x13b031=_0x1cfa37?0x0:_0x40827d['offset'];var _0x301103=_0x1cfa37?_0x250145[_0x8a02('0x1f')]:_0x40827d['offset']+_0x40827d['limit'];var _0x30264b;if(_0x301103>=_0x3ef007){_0x301103=_0x3ef007;_0x30264b=0xc8;}else{_0x30264b=0xce;}_0x415898[_0x8a02('0x1a')](_0x30264b);return _0x415898['set'](_0x8a02('0x20'),_0x13b031+'-'+_0x301103+'/'+_0x3ef007)[_0x8a02('0x1c')](_0x250145);}return null;};}function patchUpdates(_0x4af8bb){return function(_0x4bfa2c){try{jsonpatch[_0x8a02('0x21')](_0x4bfa2c,_0x4af8bb,!![]);}catch(_0x379c7c){return BPromise['reject'](_0x379c7c);}return _0x4bfa2c[_0x8a02('0x22')]();};}function saveUpdates(_0x3332d1,_0x3be87e){return function(_0x222e9f){if(_0x222e9f){return _0x222e9f['update'](_0x3332d1)[_0x8a02('0x23')](function(_0x37f00a){return _0x37f00a;});}return null;};}function removeEntity(_0x43146e,_0x3e6ad0){return function(_0x1b9154){if(_0x1b9154){return _0x1b9154[_0x8a02('0x24')]()[_0x8a02('0x23')](function(){_0x43146e[_0x8a02('0x1a')](0xcc)[_0x8a02('0x1b')]();});}};}function handleEntityNotFound(_0x4dbc9d,_0xb9c5bd){return function(_0x531e47){if(!_0x531e47){_0x4dbc9d[_0x8a02('0x19')](0x194);}return _0x531e47;};}function handleError(_0x200424,_0x323543){_0x323543=_0x323543||0x1f4;return function(_0x3b7cd2){logger['error'](_0x3b7cd2['stack']);if(_0x3b7cd2[_0x8a02('0x25')]){delete _0x3b7cd2[_0x8a02('0x25')];}_0x200424['status'](_0x323543)[_0x8a02('0x26')](_0x3b7cd2);};}exports[_0x8a02('0x27')]=function(_0x58bb6b,_0x5e2d63){if(_0x58bb6b[_0x8a02('0x28')]['id']){delete _0x58bb6b[_0x8a02('0x28')]['id'];}return db[_0x8a02('0x29')][_0x8a02('0x2a')]({'where':{'id':_0x58bb6b['params']['id']}})['then'](handleEntityNotFound(_0x5e2d63,null))[_0x8a02('0x23')](saveUpdates(_0x58bb6b[_0x8a02('0x28')],null))['then'](respondWithResult(_0x5e2d63,null))[_0x8a02('0x2b')](handleError(_0x5e2d63,null));};exports[_0x8a02('0x24')]=function(_0x495094,_0x46cf83){return db[_0x8a02('0x29')][_0x8a02('0x2a')]({'where':{'id':_0x495094[_0x8a02('0x2c')]['id']}})[_0x8a02('0x23')](handleEntityNotFound(_0x46cf83,null))['then'](removeEntity(_0x46cf83,null))[_0x8a02('0x2b')](handleError(_0x46cf83,null));}; \ No newline at end of file +var _0xde5e=['sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','save','update','destroy','then','error','stack','name','body','Action','find','catch','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','util','path','sox','ejs','fs-extra','lodash','desk.js','to-csv','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb'];(function(_0x441fda,_0x340f73){var _0x32f5da=function(_0x169632){while(--_0x169632){_0x441fda['push'](_0x441fda['shift']());}};_0x32f5da(++_0x340f73);}(_0xde5e,0x1b4));var _0xede5=function(_0x2fcd70,_0x1c7259){_0x2fcd70=_0x2fcd70-0x0;var _0x218793=_0xde5e[_0x2fcd70];return _0x218793;};'use strict';var emlformat=require(_0xede5('0x0'));var rimraf=require(_0xede5('0x1'));var zipdir=require(_0xede5('0x2'));var jsonpatch=require(_0xede5('0x3'));var rp=require(_0xede5('0x4'));var moment=require(_0xede5('0x5'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0xede5('0x6'));var path=require(_0xede5('0x7'));var sox=require(_0xede5('0x8'));var csv=require('to-csv');var ejs=require(_0xede5('0x9'));var fs=require('fs');var fs_extra=require(_0xede5('0xa'));var _=require(_0xede5('0xb'));var squel=require('squel');var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0xede5('0xc'));var toCsv=require(_0xede5('0xd'));var querystring=require('querystring');var Papa=require(_0xede5('0xe'));var Redis=require(_0xede5('0xf'));var authService=require(_0xede5('0x10'));var qs=require('../../components/parsers/qs');var as=require(_0xede5('0x11'));var hardwareService=require(_0xede5('0x12'));var logger=require(_0xede5('0x13'))(_0xede5('0x14'));var utils=require(_0xede5('0x15'));var config=require(_0xede5('0x16'));var licenseUtil=require('../../config/license/util');var db=require(_0xede5('0x17'))['db'];function respondWithStatusCode(_0x28a686,_0x37c456){_0x37c456=_0x37c456||0xcc;return function(_0x1f3aea){if(_0x1f3aea){return _0x28a686[_0xede5('0x18')](_0x37c456);}return _0x28a686[_0xede5('0x19')](_0x37c456)[_0xede5('0x1a')]();};}function respondWithResult(_0x54e474,_0x245dcb){_0x245dcb=_0x245dcb||0xc8;return function(_0x4a919f){if(_0x4a919f){return _0x54e474[_0xede5('0x19')](_0x245dcb)[_0xede5('0x1b')](_0x4a919f);}};}function respondWithFilteredResult(_0x369c77,_0xa312e4){return function(_0x16ff1d){if(_0x16ff1d){var _0xdbc53f=typeof _0xa312e4[_0xede5('0x1c')]===_0xede5('0x1d')&&typeof _0xa312e4[_0xede5('0x1e')]===_0xede5('0x1d');var _0x57db50=_0x16ff1d[_0xede5('0x1f')];var _0x1d01a6=_0xdbc53f?0x0:_0xa312e4['offset'];var _0x52f1ee=_0xdbc53f?_0x16ff1d[_0xede5('0x1f')]:_0xa312e4[_0xede5('0x1c')]+_0xa312e4['limit'];var _0x10e903;if(_0x52f1ee>=_0x57db50){_0x52f1ee=_0x57db50;_0x10e903=0xc8;}else{_0x10e903=0xce;}_0x369c77[_0xede5('0x19')](_0x10e903);return _0x369c77[_0xede5('0x20')](_0xede5('0x21'),_0x1d01a6+'-'+_0x52f1ee+'/'+_0x57db50)[_0xede5('0x1b')](_0x16ff1d);}return null;};}function patchUpdates(_0x14d04e){return function(_0x52e8fa){try{jsonpatch[_0xede5('0x22')](_0x52e8fa,_0x14d04e,!![]);}catch(_0x28b0e2){return BPromise['reject'](_0x28b0e2);}return _0x52e8fa[_0xede5('0x23')]();};}function saveUpdates(_0x3ab9f6,_0x4d8461){return function(_0x524cfe){if(_0x524cfe){return _0x524cfe[_0xede5('0x24')](_0x3ab9f6)['then'](function(_0x4b775c){return _0x4b775c;});}return null;};}function removeEntity(_0x5084b1,_0x3b0d4a){return function(_0xe592c4){if(_0xe592c4){return _0xe592c4[_0xede5('0x25')]()[_0xede5('0x26')](function(){_0x5084b1[_0xede5('0x19')](0xcc)[_0xede5('0x1a')]();});}};}function handleEntityNotFound(_0x21111d,_0x1d41cc){return function(_0x3c1c48){if(!_0x3c1c48){_0x21111d[_0xede5('0x18')](0x194);}return _0x3c1c48;};}function handleError(_0x4baeac,_0xa144a5){_0xa144a5=_0xa144a5||0x1f4;return function(_0x327c2c){logger[_0xede5('0x27')](_0x327c2c[_0xede5('0x28')]);if(_0x327c2c[_0xede5('0x29')]){delete _0x327c2c[_0xede5('0x29')];}_0x4baeac[_0xede5('0x19')](_0xa144a5)['send'](_0x327c2c);};}exports[_0xede5('0x24')]=function(_0x2098a7,_0x4a488e){if(_0x2098a7[_0xede5('0x2a')]['id']){delete _0x2098a7[_0xede5('0x2a')]['id'];}return db[_0xede5('0x2b')][_0xede5('0x2c')]({'where':{'id':_0x2098a7['params']['id']}})[_0xede5('0x26')](handleEntityNotFound(_0x4a488e,null))['then'](saveUpdates(_0x2098a7[_0xede5('0x2a')],null))[_0xede5('0x26')](respondWithResult(_0x4a488e,null))[_0xede5('0x2d')](handleError(_0x4a488e,null));};exports[_0xede5('0x25')]=function(_0x7b920e,_0x526186){return db[_0xede5('0x2b')][_0xede5('0x2c')]({'where':{'id':_0x7b920e['params']['id']}})[_0xede5('0x26')](handleEntityNotFound(_0x526186,null))[_0xede5('0x26')](removeEntity(_0x526186,null))['catch'](handleError(_0x526186,null));}; \ No newline at end of file diff --git a/server/api/action/action.model.js b/server/api/action/action.model.js index dc4d402..f7ccf5b 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 _0x3ffc=['api','moment','bluebird','request-promise','path','rimraf','../../config/environment','exports','define','Action','tools_actions','util','../../config/logger'];(function(_0x1f83ef,_0x257b1f){var _0x52a3bc=function(_0x4776aa){while(--_0x4776aa){_0x1f83ef['push'](_0x1f83ef['shift']());}};_0x52a3bc(++_0x257b1f);}(_0x3ffc,0x80));var _0xc3ff=function(_0x380016,_0x178dd6){_0x380016=_0x380016-0x0;var _0x5c7ac0=_0x3ffc[_0x380016];return _0x5c7ac0;};'use strict';var _=require('lodash');var util=require(_0xc3ff('0x0'));var logger=require(_0xc3ff('0x1'))(_0xc3ff('0x2'));var moment=require(_0xc3ff('0x3'));var BPromise=require(_0xc3ff('0x4'));var rp=require(_0xc3ff('0x5'));var fs=require('fs');var path=require(_0xc3ff('0x6'));var rimraf=require(_0xc3ff('0x7'));var config=require(_0xc3ff('0x8'));var attributes=require('./action.attributes');module[_0xc3ff('0x9')]=function(_0x2905c9,_0x112932){return _0x2905c9[_0xc3ff('0xa')](_0xc3ff('0xb'),attributes,{'tableName':_0xc3ff('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x117e=['util','../../config/logger','api','bluebird','request-promise','path','rimraf','define','Action','tools_actions','lodash'];(function(_0xf7a332,_0x39e120){var _0x5758a7=function(_0x3b53c7){while(--_0x3b53c7){_0xf7a332['push'](_0xf7a332['shift']());}};_0x5758a7(++_0x39e120);}(_0x117e,0xc5));var _0xe117=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0x117e[_0x321bb2];return _0x9c12ed;};'use strict';var _=require(_0xe117('0x0'));var util=require(_0xe117('0x1'));var logger=require(_0xe117('0x2'))(_0xe117('0x3'));var moment=require('moment');var BPromise=require(_0xe117('0x4'));var rp=require(_0xe117('0x5'));var fs=require('fs');var path=require(_0xe117('0x6'));var rimraf=require(_0xe117('0x7'));var config=require('../../config/environment');var attributes=require('./action.attributes');module['exports']=function(_0x2eb08d,_0x80a325){return _0x2eb08d[_0xe117('0x8')](_0xe117('0x9'),attributes,{'tableName':_0xe117('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/action/action.rpc.js b/server/api/action/action.rpc.js index b14fc41..96a805e 100644 --- a/server/api/action/action.rpc.js +++ b/server/api/action/action.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xe14b=['../../config/environment','jayson/promise','client','http','then','info','Action,\x20%s,\x20%s','Action,\x20%s,\x20%s,\x20%s','request\x20sent','error','code','message','result','catch','lodash','util','randomstring','ioredis','../../config/utils'];(function(_0x5f2b52,_0xbe16c6){var _0xb63ca5=function(_0x4a7237){while(--_0x4a7237){_0x5f2b52['push'](_0x5f2b52['shift']());}};_0xb63ca5(++_0xbe16c6);}(_0xe14b,0x93));var _0xbe14=function(_0x510970,_0x914eed){_0x510970=_0x510970-0x0;var _0x390831=_0xe14b[_0x510970];return _0x390831;};'use strict';var _=require(_0xbe14('0x0'));var util=require(_0xbe14('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0xbe14('0x2'));var fs=require('fs');var Redis=require(_0xbe14('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0xbe14('0x4'));var logger=require('../../config/logger')('rpc');var config=require(_0xbe14('0x5'));var jayson=require(_0xbe14('0x6'));var client=jayson[_0xbe14('0x7')][_0xbe14('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x1d9ade,_0x39387e,_0x196fca){return new BPromise(function(_0x566ae7,_0x50f909){return client['request'](_0x1d9ade,_0x196fca)[_0xbe14('0x9')](function(_0x6fceff){logger[_0xbe14('0xa')](_0xbe14('0xb'),_0x39387e,'request\x20sent');logger['debug'](_0xbe14('0xc'),_0x39387e,_0xbe14('0xd'),JSON['stringify'](_0x6fceff));if(_0x6fceff[_0xbe14('0xe')]){if(_0x6fceff[_0xbe14('0xe')][_0xbe14('0xf')]===0x1f4){logger[_0xbe14('0xe')](_0xbe14('0xb'),_0x39387e,_0x6fceff[_0xbe14('0xe')][_0xbe14('0x10')]);return _0x50f909(_0x6fceff[_0xbe14('0xe')][_0xbe14('0x10')]);}logger[_0xbe14('0xe')](_0xbe14('0xb'),_0x39387e,_0x6fceff[_0xbe14('0xe')][_0xbe14('0x10')]);return _0x566ae7(_0x6fceff['error']['message']);}else{logger[_0xbe14('0xa')](_0xbe14('0xb'),_0x39387e,_0xbe14('0xd'));_0x566ae7(_0x6fceff[_0xbe14('0x11')]['message']);}})[_0xbe14('0x12')](function(_0xe9c3ec){logger[_0xbe14('0xe')](_0xbe14('0xb'),_0x39387e,_0xe9c3ec);_0x50f909(_0xe9c3ec);});});} \ No newline at end of file +var _0x7217=['stringify','error','code','message','result','catch','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','rpc','../../config/environment','jayson/promise','client','http','request','then','info','Action,\x20%s,\x20%s','debug','Action,\x20%s,\x20%s,\x20%s','request\x20sent'];(function(_0x2fc012,_0x503e5b){var _0x2891f9=function(_0x295f5e){while(--_0x295f5e){_0x2fc012['push'](_0x2fc012['shift']());}};_0x2891f9(++_0x503e5b);}(_0x7217,0x19e));var _0x7721=function(_0x28947d,_0x4cc9c6){_0x28947d=_0x28947d-0x0;var _0x12d2ee=_0x7217[_0x28947d];return _0x12d2ee;};'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')]('Action,\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']('Action,\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 diff --git a/server/api/action/index.js b/server/api/action/index.js index e3efa8d..a7093c9 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 _0x0083=['../../components/auth/service','../../components/interaction/service','./action.controller','/:id','isAuthenticated','update','delete','destroy','exports','multer','path','connect-timeout','fs-extra'];(function(_0x43e00a,_0x2712e7){var _0x56f729=function(_0x40301b){while(--_0x40301b){_0x43e00a['push'](_0x43e00a['shift']());}};_0x56f729(++_0x2712e7);}(_0x0083,0xe6));var _0x3008=function(_0x44f3c0,_0x1d7c35){_0x44f3c0=_0x44f3c0-0x0;var _0x4cae07=_0x0083[_0x44f3c0];return _0x4cae07;};'use strict';var multer=require(_0x3008('0x0'));var util=require('util');var path=require(_0x3008('0x1'));var timeout=require(_0x3008('0x2'));var express=require('express');var router=express['Router']();var fs_extra=require(_0x3008('0x3'));var auth=require(_0x3008('0x4'));var interaction=require(_0x3008('0x5'));var config=require('../../config/environment');var controller=require(_0x3008('0x6'));router['put'](_0x3008('0x7'),auth[_0x3008('0x8')](),controller[_0x3008('0x9')]);router[_0x3008('0xa')](_0x3008('0x7'),auth[_0x3008('0x8')](),controller[_0x3008('0xb')]);module[_0x3008('0xc')]=router; \ No newline at end of file +var _0x1d57=['../../components/auth/service','../../components/interaction/service','../../config/environment','./action.controller','put','/:id','isAuthenticated','update','destroy','exports','multer','util','path','connect-timeout'];(function(_0x3e0be8,_0xf37d6f){var _0x32d6c2=function(_0x4f89af){while(--_0x4f89af){_0x3e0be8['push'](_0x3e0be8['shift']());}};_0x32d6c2(++_0xf37d6f);}(_0x1d57,0x168));var _0x71d5=function(_0x2efa92,_0x2557f6){_0x2efa92=_0x2efa92-0x0;var _0x32704b=_0x1d57[_0x2efa92];return _0x32704b;};'use strict';var multer=require(_0x71d5('0x0'));var util=require(_0x71d5('0x1'));var path=require(_0x71d5('0x2'));var timeout=require(_0x71d5('0x3'));var express=require('express');var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0x71d5('0x4'));var interaction=require(_0x71d5('0x5'));var config=require(_0x71d5('0x6'));var controller=require(_0x71d5('0x7'));router[_0x71d5('0x8')](_0x71d5('0x9'),auth[_0x71d5('0xa')](),controller[_0x71d5('0xb')]);router['delete'](_0x71d5('0x9'),auth[_0x71d5('0xa')](),controller[_0x71d5('0xc')]);module[_0x71d5('0xd')]=router; \ No newline at end of file diff --git a/server/api/analyticCustomReport/analyticCustomReport.attributes.js b/server/api/analyticCustomReport/analyticCustomReport.attributes.js index 2fda148..620ca3b 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 _0x8ef6=['STRING','TEXT','sequelize','exports'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0x8ef6,0xf2));var _0x68ef=function(_0x400faf,_0x294d75){_0x400faf=_0x400faf-0x0;var _0x48adeb=_0x8ef6[_0x400faf];return _0x48adeb;};'use strict';var Sequelize=require(_0x68ef('0x0'));module[_0x68ef('0x1')]={'name':{'type':Sequelize[_0x68ef('0x2')],'allowNull':![]},'description':{'type':Sequelize[_0x68ef('0x2')]},'parent':{'type':Sequelize[_0x68ef('0x2')]},'table':{'type':Sequelize[_0x68ef('0x2')]},'conditions':{'type':Sequelize[_0x68ef('0x3')]},'joins':{'type':Sequelize['TEXT']}}; \ No newline at end of file +var _0x7da7=['TEXT','sequelize','exports','STRING'];(function(_0x2dafbe,_0x5d04de){var _0x58a45a=function(_0x50ac96){while(--_0x50ac96){_0x2dafbe['push'](_0x2dafbe['shift']());}};_0x58a45a(++_0x5d04de);}(_0x7da7,0x10d));var _0x77da=function(_0x546aaf,_0x1ed138){_0x546aaf=_0x546aaf-0x0;var _0x1cbf6d=_0x7da7[_0x546aaf];return _0x1cbf6d;};'use strict';var Sequelize=require(_0x77da('0x0'));module[_0x77da('0x1')]={'name':{'type':Sequelize[_0x77da('0x2')],'allowNull':![]},'description':{'type':Sequelize['STRING']},'parent':{'type':Sequelize['STRING']},'table':{'type':Sequelize[_0x77da('0x2')]},'conditions':{'type':Sequelize[_0x77da('0x3')]},'joins':{'type':Sequelize['TEXT']}}; \ No newline at end of file diff --git a/server/api/analyticCustomReport/analyticCustomReport.controller.js b/server/api/analyticCustomReport/analyticCustomReport.controller.js index bc9951b..0519e34 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 _0x0f11=['UserProfileSection','CustomReports','params','preview','join','right_join','cross_join','COUNT(%s)','COUNT(DISTINCT\x20%s)','MAX(%s)','MIN(%s)','AVG(%s)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)','SEC_TO_TIME(%s)','DATE(%s)','HOUR(%s)','ROUND(%s)','UNIX_TIMESTAMP(%s)','IS\x20NULL','IS\x20EMPTY','rules','operator','group','field','condition','getFields','Sequelize','ValidationErrorItem','keyBy','select','table','MetricId','metric','function','format','replace','groupBy','orderBy','DESC','alias','joins','parse','type','includes','parentKey','foreignTable','%s.%s\x20=\x20%s.%s','foreignKey','conditions','clone','Limited\x20Query:','toString','sequelize','QueryTypes','left_join','SUM(%s)','GROUP_CONCAT(%s)','IS\x20NOT\x20NULL','value','from','output','web','%s-%s.%s','randomstring','generate','csv','AnalyticExtractedReport','cdr','startDate','endDate','Run\x20Query:','child_process','fork','../../components/export/','../../files/reports','savename','countTable','SELECT','runReport','AnalyticMetric','debug','eml-format','zip-dir','fast-json-patch','request-promise','moment','mustache','util','path','sox','to-csv','ejs','lodash','crypto','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','Content-Range','apply','save','update','then','destroy','get','UserProfileResource','error','stack','name','send','index','map','AnalyticCustomReport','fieldName','key','model','query','keys','filters','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','includeAll','include','findAll','rows','catch','rawAttributes','length','options','find','create','body','Unable\x20to\x20retrieve\x20the\x20current\x20user','Reports'];(function(_0x81e097,_0x31d5fe){var _0x57ff74=function(_0x4ff0b9){while(--_0x4ff0b9){_0x81e097['push'](_0x81e097['shift']());}};_0x57ff74(++_0x31d5fe);}(_0x0f11,0x190));var _0x10f1=function(_0x3949f5,_0x16aa2f){_0x3949f5=_0x3949f5-0x0;var _0x461064=_0x0f11[_0x3949f5];return _0x461064;};'use strict';var emlformat=require(_0x10f1('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x10f1('0x1'));var jsonpatch=require(_0x10f1('0x2'));var rp=require(_0x10f1('0x3'));var moment=require(_0x10f1('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x10f1('0x5'));var util=require(_0x10f1('0x6'));var path=require(_0x10f1('0x7'));var sox=require(_0x10f1('0x8'));var csv=require(_0x10f1('0x9'));var ejs=require(_0x10f1('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x10f1('0xb'));var squel=require('squel');var crypto=require(_0x10f1('0xc'));var jsforce=require(_0x10f1('0xd'));var deskjs=require('desk.js');var toCsv=require(_0x10f1('0x9'));var querystring=require(_0x10f1('0xe'));var Papa=require(_0x10f1('0xf'));var Redis=require(_0x10f1('0x10'));var authService=require(_0x10f1('0x11'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0x10f1('0x12'))(_0x10f1('0x13'));var utils=require(_0x10f1('0x14'));var config=require(_0x10f1('0x15'));var licenseUtil=require(_0x10f1('0x16'));var db=require(_0x10f1('0x17'))['db'];var dbH=require(_0x10f1('0x17'))['dbH'];function respondWithStatusCode(_0x250d38,_0x386399){_0x386399=_0x386399||0xcc;return function(_0x916371){if(_0x916371){return _0x250d38[_0x10f1('0x18')](_0x386399);}return _0x250d38[_0x10f1('0x19')](_0x386399)[_0x10f1('0x1a')]();};}function respondWithResult(_0x43786a,_0x24b3e4){_0x24b3e4=_0x24b3e4||0xc8;return function(_0x2cbc11){if(_0x2cbc11){return _0x43786a[_0x10f1('0x19')](_0x24b3e4)[_0x10f1('0x1b')](_0x2cbc11);}};}function respondWithFilteredResult(_0x3e2233,_0x3644f7){return function(_0x58807e){if(_0x58807e){var _0x75e63e=typeof _0x3644f7[_0x10f1('0x1c')]===_0x10f1('0x1d')&&typeof _0x3644f7[_0x10f1('0x1e')]===_0x10f1('0x1d');var _0x8fb161=_0x58807e['count'];var _0x4f1bec=_0x75e63e?0x0:_0x3644f7[_0x10f1('0x1c')];var _0x47e645=_0x75e63e?_0x58807e[_0x10f1('0x1f')]:_0x3644f7[_0x10f1('0x1c')]+_0x3644f7[_0x10f1('0x1e')];var _0x30ca68;if(_0x47e645>=_0x8fb161){_0x47e645=_0x8fb161;_0x30ca68=0xc8;}else{_0x30ca68=0xce;}_0x3e2233[_0x10f1('0x19')](_0x30ca68);return _0x3e2233['set'](_0x10f1('0x20'),_0x4f1bec+'-'+_0x47e645+'/'+_0x8fb161)['json'](_0x58807e);}return null;};}function patchUpdates(_0x208e0c){return function(_0x5ae34){try{jsonpatch[_0x10f1('0x21')](_0x5ae34,_0x208e0c,!![]);}catch(_0x1856cc){return BPromise['reject'](_0x1856cc);}return _0x5ae34[_0x10f1('0x22')]();};}function saveUpdates(_0x5a2194,_0x36c74b){return function(_0x2c7367){if(_0x2c7367){return _0x2c7367[_0x10f1('0x23')](_0x5a2194)[_0x10f1('0x24')](function(_0x196b3b){return _0x196b3b;});}return null;};}function removeEntity(_0x2802f4,_0x45efe4){return function(_0x519b39){if(_0x519b39){return _0x519b39[_0x10f1('0x25')]()[_0x10f1('0x24')](function(){var _0x269987=_0x519b39[_0x10f1('0x26')]({'plain':!![]});var _0x54ef8b='CustomReports';return db[_0x10f1('0x27')][_0x10f1('0x25')]({'where':{'type':_0x54ef8b,'resourceId':_0x269987['id']}})[_0x10f1('0x24')](function(){return _0x519b39;});})[_0x10f1('0x24')](function(){_0x2802f4['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x2140b7,_0x590c39){return function(_0x260729){if(!_0x260729){_0x2140b7[_0x10f1('0x18')](0x194);}return _0x260729;};}function handleError(_0x4bc5d6,_0x3816f9){_0x3816f9=_0x3816f9||0x1f4;return function(_0x4604ef){logger[_0x10f1('0x28')](_0x4604ef[_0x10f1('0x29')]);if(_0x4604ef['name']){delete _0x4604ef[_0x10f1('0x2a')];}_0x4bc5d6['status'](_0x3816f9)[_0x10f1('0x2b')](_0x4604ef);};}exports[_0x10f1('0x2c')]=function(_0x13fd45,_0x3ffa2d){var _0x19adb2={},_0x42f890={},_0x2cbd71={'count':0x0,'rows':[]};var _0x257761=_[_0x10f1('0x2d')](db[_0x10f1('0x2e')]['rawAttributes'],function(_0x525f8e){return{'name':_0x525f8e[_0x10f1('0x2f')],'type':_0x525f8e['type'][_0x10f1('0x30')]};});_0x42f890[_0x10f1('0x31')]=_['map'](_0x257761,_0x10f1('0x2a'));_0x42f890[_0x10f1('0x32')]=_[_0x10f1('0x33')](_0x13fd45[_0x10f1('0x32')]);_0x42f890[_0x10f1('0x34')]=_[_0x10f1('0x35')](_0x42f890[_0x10f1('0x31')],_0x42f890[_0x10f1('0x32')]);_0x19adb2[_0x10f1('0x36')]=_['intersection'](_0x42f890[_0x10f1('0x31')],qs[_0x10f1('0x37')](_0x13fd45[_0x10f1('0x32')]['fields']));_0x19adb2[_0x10f1('0x36')]=_0x19adb2[_0x10f1('0x36')]['length']?_0x19adb2[_0x10f1('0x36')]:_0x42f890[_0x10f1('0x31')];if(!_0x13fd45[_0x10f1('0x32')][_0x10f1('0x38')](_0x10f1('0x39'))){_0x19adb2[_0x10f1('0x1e')]=qs[_0x10f1('0x1e')](_0x13fd45[_0x10f1('0x32')][_0x10f1('0x1e')]);_0x19adb2[_0x10f1('0x1c')]=qs[_0x10f1('0x1c')](_0x13fd45[_0x10f1('0x32')][_0x10f1('0x1c')]);}_0x19adb2[_0x10f1('0x3a')]=qs[_0x10f1('0x3b')](_0x13fd45['query'][_0x10f1('0x3b')]);_0x19adb2[_0x10f1('0x3c')]=qs[_0x10f1('0x34')](_[_0x10f1('0x3d')](_0x13fd45[_0x10f1('0x32')],_0x42f890['filters']),_0x257761);if(_0x13fd45[_0x10f1('0x32')][_0x10f1('0x3e')]){_0x19adb2['where']=_[_0x10f1('0x3f')](_0x19adb2[_0x10f1('0x3c')],{'$or':_['map'](_0x257761,function(_0x3be423){if(_0x3be423['type']!=='VIRTUAL'){var _0x1b66cc={};_0x1b66cc[_0x3be423['name']]={'$like':'%'+_0x13fd45['query'][_0x10f1('0x3e')]+'%'};return _0x1b66cc;}})});}_0x19adb2=_[_0x10f1('0x3f')]({},_0x19adb2,_0x13fd45['options']);var _0x27994b={'where':_0x19adb2['where']};return db['AnalyticCustomReport'][_0x10f1('0x1f')](_0x27994b)['then'](function(_0x207f52){_0x2cbd71['count']=_0x207f52;if(_0x13fd45[_0x10f1('0x32')][_0x10f1('0x40')]){_0x19adb2[_0x10f1('0x41')]=[{'all':!![]}];}return db['AnalyticCustomReport'][_0x10f1('0x42')](_0x19adb2);})['then'](function(_0x1531de){_0x2cbd71[_0x10f1('0x43')]=_0x1531de;return _0x2cbd71;})[_0x10f1('0x24')](respondWithFilteredResult(_0x3ffa2d,_0x19adb2))[_0x10f1('0x44')](handleError(_0x3ffa2d,null));};exports['show']=function(_0x333107,_0x22ebfa){var _0x31bfc6={'raw':![],'where':{'id':_0x333107['params']['id']}},_0x592795={};_0x592795[_0x10f1('0x31')]=_[_0x10f1('0x33')](db[_0x10f1('0x2e')][_0x10f1('0x45')]);_0x592795[_0x10f1('0x32')]=_['keys'](_0x333107[_0x10f1('0x32')]);_0x592795[_0x10f1('0x34')]=_['intersection'](_0x592795[_0x10f1('0x31')],_0x592795['query']);_0x31bfc6[_0x10f1('0x36')]=_[_0x10f1('0x35')](_0x592795['model'],qs[_0x10f1('0x37')](_0x333107['query'][_0x10f1('0x37')]));_0x31bfc6['attributes']=_0x31bfc6['attributes'][_0x10f1('0x46')]?_0x31bfc6[_0x10f1('0x36')]:_0x592795[_0x10f1('0x31')];if(_0x333107[_0x10f1('0x32')][_0x10f1('0x40')]){_0x31bfc6[_0x10f1('0x41')]=[{'all':!![]}];}_0x31bfc6=_['merge']({},_0x31bfc6,_0x333107[_0x10f1('0x47')]);return db['AnalyticCustomReport'][_0x10f1('0x48')](_0x31bfc6)['then'](handleEntityNotFound(_0x22ebfa,null))[_0x10f1('0x24')](respondWithResult(_0x22ebfa,null))['catch'](handleError(_0x22ebfa,null));};exports[_0x10f1('0x49')]=function(_0x2f2ecb,_0x4754e0){return db[_0x10f1('0x2e')][_0x10f1('0x49')](_0x2f2ecb[_0x10f1('0x4a')],{})[_0x10f1('0x24')](function(_0x45e674){var _0x58c4c6=_0x2f2ecb['user'][_0x10f1('0x26')]({'plain':!![]});if(!_0x58c4c6)throw new Error(_0x10f1('0x4b'));if(_0x58c4c6['role']==='user'){var _0x2e0344=_0x45e674[_0x10f1('0x26')]({'plain':!![]});var _0x220cfd=_0x10f1('0x4c');return db[_0x10f1('0x4d')]['find']({'where':{'name':_0x220cfd,'userProfileId':_0x58c4c6['userProfileId']},'raw':!![]})[_0x10f1('0x24')](function(_0x1ad16d){if(_0x1ad16d&&_0x1ad16d['autoAssociation']===0x0){return db[_0x10f1('0x27')]['create']({'name':_0x2e0344['name'],'resourceId':_0x2e0344['id'],'type':_0x10f1('0x4e'),'sectionId':_0x1ad16d['id']},{})[_0x10f1('0x24')](function(){return _0x45e674;});}else{return _0x45e674;}})[_0x10f1('0x44')](function(_0x1f6bf1){logger[_0x10f1('0x28')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x1f6bf1);throw _0x1f6bf1;});}return _0x45e674;})[_0x10f1('0x24')](respondWithResult(_0x4754e0,0xc9))[_0x10f1('0x44')](handleError(_0x4754e0,null));};exports['update']=function(_0x159d0f,_0x5b88b1){if(_0x159d0f['body']['id']){delete _0x159d0f[_0x10f1('0x4a')]['id'];}return db['AnalyticCustomReport'][_0x10f1('0x48')]({'where':{'id':_0x159d0f[_0x10f1('0x4f')]['id']}})[_0x10f1('0x24')](handleEntityNotFound(_0x5b88b1,null))[_0x10f1('0x24')](saveUpdates(_0x159d0f['body'],null))[_0x10f1('0x24')](respondWithResult(_0x5b88b1,null))[_0x10f1('0x44')](handleError(_0x5b88b1,null));};exports['destroy']=function(_0x5b2681,_0x4ea7fd){return db['AnalyticCustomReport'][_0x10f1('0x48')]({'where':{'id':_0x5b2681['params']['id']}})[_0x10f1('0x24')](handleEntityNotFound(_0x4ea7fd,null))['then'](removeEntity(_0x4ea7fd,null))[_0x10f1('0x44')](handleError(_0x4ea7fd,null));};exports[_0x10f1('0x50')]=function(_0x4e0840,_0x1dffeb){var _0x1c9fa7=0xa;var _0x4de6ae=[_0x10f1('0x51'),'left_join',_0x10f1('0x52'),_0x10f1('0x53')];var _0x342b43={'SUM':'SUM(%s)','COUNT':_0x10f1('0x54'),'COUNT DISTINCT':_0x10f1('0x55'),'MAX':_0x10f1('0x56'),'MIN':_0x10f1('0x57'),'AVG':_0x10f1('0x58'),'GROUP_CONCAT':'GROUP_CONCAT(%s)','GROUP_CONCAT ASC':_0x10f1('0x59'),'GROUP_CONCAT DESC':_0x10f1('0x5a')};var _0x14a350={'SEC_TO_TIME':_0x10f1('0x5b'),'DATE':_0x10f1('0x5c'),'HOUR':_0x10f1('0x5d'),'ROUND':_0x10f1('0x5e'),'UNIX_TIMESTAMP':_0x10f1('0x5f')};var _0x13b6ed=function(_0x5a1fdc){return!_['includes']([_0x10f1('0x60'),'IS\x20NOT\x20NULL',_0x10f1('0x61'),'IS\x20NOT\x20EMPTY'],_0x5a1fdc);};var _0x495feb=function(_0x450882){if(!_0x450882||!_0x450882['rules'][_0x10f1('0x46')]){return'';}for(var _0x5508ba='(',_0x28dbab=0x0;_0x28dbab<_0x450882[_0x10f1('0x62')][_0x10f1('0x46')];_0x28dbab+=0x1){_0x28dbab>0x0&&(_0x5508ba+='\x20'+_0x450882[_0x10f1('0x63')]+'\x20');_0x5508ba+=_0x450882[_0x10f1('0x62')][_0x28dbab]['group']?_0x495feb(_0x450882[_0x10f1('0x62')][_0x28dbab][_0x10f1('0x64')]):_0x450882[_0x10f1('0x62')][_0x28dbab][_0x10f1('0x65')]+'\x20'+_0x450882['rules'][_0x28dbab][_0x10f1('0x66')]+(_0x13b6ed(_0x450882['rules'][_0x28dbab]['condition'])?'\x20'+_0x450882[_0x10f1('0x62')][_0x28dbab]['value']:'');}return _0x5508ba+')';};var _0x38db3b={'where':{'id':_0x4e0840['params']['id']}},_0xd3e66,_0x220b71,_0x3511ca,_0x45a0e7,_0x2a7917;_0x38db3b=_[_0x10f1('0x3f')]({},_0x38db3b,_0x4e0840[_0x10f1('0x47')]);return db[_0x10f1('0x2e')][_0x10f1('0x48')](_0x38db3b)[_0x10f1('0x24')](function(_0x3e3405){if(_0x3e3405){_0xd3e66=_0x3e3405;return _0x3e3405[_0x10f1('0x67')]();}return null;})[_0x10f1('0x24')](function(_0xc87a0e){if(_0xc87a0e){if(!_0xc87a0e[_0x10f1('0x46')]){throw new db[(_0x10f1('0x68'))][(_0x10f1('0x69'))]('Please\x20insert\x20at\x20least\x20one\x20field',0x193);}_0x220b71=_0xc87a0e;return db['AnalyticMetric'][_0x10f1('0x42')]({'raw':!![]});}return null;})['then'](function(_0x58eead){if(_0x58eead){_0x3511ca=_[_0x10f1('0x6a')](_0x58eead,'id');var _0x455fae;var _0x123047=squel[_0x10f1('0x6b')]();_0x123047['from'](_0xd3e66[_0x10f1('0x6c')]);for(var _0x253a00=0x0;_0x253a00<_0x220b71['length'];_0x253a00+=0x1){_0x455fae=_0x220b71[_0x253a00][_0x10f1('0x6d')]?_0x3511ca[_0x220b71[_0x253a00][_0x10f1('0x6d')]][_0x10f1('0x6e')]:_0x220b71[_0x253a00]['field'];_0x455fae=_0x220b71[_0x253a00]['function']?_['replace'](_0x342b43[_0x220b71[_0x253a00][_0x10f1('0x6f')]],'%s',_0x455fae):_0x455fae;_0x455fae=_0x220b71[_0x253a00][_0x10f1('0x70')]?_[_0x10f1('0x71')](_0x14a350[_0x220b71[_0x253a00][_0x10f1('0x70')]],'%s',_0x455fae):_0x455fae;if(_0x220b71[_0x253a00][_0x10f1('0x72')]){_0x123047[_0x10f1('0x64')](_0x455fae);}_0x220b71[_0x253a00][_0x10f1('0x73')]&&_0x123047[_0x10f1('0x3a')](_0x455fae,_0x220b71[_0x253a00][_0x10f1('0x73')]===_0x10f1('0x74')?![]:!![]);_0x123047[_0x10f1('0x65')](_0x455fae,_0x220b71[_0x253a00][_0x10f1('0x75')]||_0x455fae);}if(_0xd3e66[_0x10f1('0x76')]){_0xd3e66['joins']=JSON[_0x10f1('0x77')](_0xd3e66[_0x10f1('0x76')]);for(var _0x4a5ad4=0x0;_0x4a5ad4<_0xd3e66[_0x10f1('0x76')][_0x10f1('0x46')];_0x4a5ad4+=0x1){if(_0xd3e66[_0x10f1('0x76')][_0x4a5ad4][_0x10f1('0x78')]&&_[_0x10f1('0x79')](_0x4de6ae,_0xd3e66[_0x10f1('0x76')][_0x4a5ad4]['type'])&&_0xd3e66[_0x10f1('0x76')][_0x4a5ad4][_0x10f1('0x7a')]&&_0xd3e66[_0x10f1('0x76')][_0x4a5ad4][_0x10f1('0x7b')]&&_0xd3e66['joins'][_0x4a5ad4]['foreignKey']){_0x123047[_0xd3e66[_0x10f1('0x76')][_0x4a5ad4][_0x10f1('0x78')]](_0xd3e66[_0x10f1('0x76')][_0x4a5ad4][_0x10f1('0x7b')],null,util[_0x10f1('0x70')](_0x10f1('0x7c'),_0xd3e66[_0x10f1('0x6c')],_0xd3e66[_0x10f1('0x76')][_0x4a5ad4]['parentKey'],_0xd3e66['joins'][_0x4a5ad4][_0x10f1('0x7b')],_0xd3e66['joins'][_0x4a5ad4][_0x10f1('0x7d')]));}}}if(_0xd3e66[_0x10f1('0x7e')]){_0xd3e66['conditions']=JSON[_0x10f1('0x77')](_0xd3e66[_0x10f1('0x7e')]);_0x123047[_0x10f1('0x3c')](_0x495feb(_0xd3e66[_0x10f1('0x7e')][_0x10f1('0x64')]));}_0x2a7917=_0x123047[_0x10f1('0x7f')]();_0x123047[_0x10f1('0x1e')](_0x1c9fa7);_0x123047[_0x10f1('0x1c')](0x0);logger['debug'](_0x10f1('0x80'),_0x123047['toString']());return dbH['sequelize'][_0x10f1('0x32')](_0x123047[_0x10f1('0x81')](),{'type':dbH[_0x10f1('0x82')][_0x10f1('0x83')]['SELECT']});}})[_0x10f1('0x24')](respondWithResult(_0x1dffeb,null))[_0x10f1('0x44')](handleError(_0x1dffeb,null));};function runReport(_0x1c6623,_0x2a3959,_0x391641){var _0x41ba49=_0x2a3959[_0x10f1('0x2a')];var _0x2d0f7e=0xa;var _0x9f61f3=[_0x10f1('0x51'),_0x10f1('0x84'),_0x10f1('0x52'),_0x10f1('0x53')];var _0x826f2a={'SUM':_0x10f1('0x85'),'COUNT':_0x10f1('0x54'),'COUNT DISTINCT':_0x10f1('0x55'),'MAX':_0x10f1('0x56'),'MIN':_0x10f1('0x57'),'AVG':_0x10f1('0x58'),'GROUP_CONCAT':_0x10f1('0x86'),'GROUP_CONCAT ASC':_0x10f1('0x59'),'GROUP_CONCAT DESC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)'};var _0x47d3d7={'SEC_TO_TIME':_0x10f1('0x5b'),'DATE':'DATE(%s)','HOUR':'HOUR(%s)','ROUND':'ROUND(%s)','UNIX_TIMESTAMP':_0x10f1('0x5f')};var _0x494b56=function(_0x3a5c68){return!_[_0x10f1('0x79')](['IS\x20NULL',_0x10f1('0x87'),_0x10f1('0x61'),'IS\x20NOT\x20EMPTY'],_0x3a5c68);};var _0x2f7fa9=function(_0x155f1a){if(!_0x155f1a||!_0x155f1a[_0x10f1('0x62')][_0x10f1('0x46')]){return'';}for(var _0x156d46='(',_0xb52d90=0x0;_0xb52d90<_0x155f1a[_0x10f1('0x62')][_0x10f1('0x46')];_0xb52d90+=0x1){_0xb52d90>0x0&&(_0x156d46+='\x20'+_0x155f1a[_0x10f1('0x63')]+'\x20');_0x156d46+=_0x155f1a[_0x10f1('0x62')][_0xb52d90][_0x10f1('0x64')]?_0x2f7fa9(_0x155f1a['rules'][_0xb52d90][_0x10f1('0x64')]):_0x155f1a[_0x10f1('0x62')][_0xb52d90]['field']+'\x20'+_0x155f1a['rules'][_0xb52d90]['condition']+(_0x494b56(_0x155f1a[_0x10f1('0x62')][_0xb52d90][_0x10f1('0x66')])?'\x20'+_0x155f1a[_0x10f1('0x62')][_0xb52d90][_0x10f1('0x88')]:'');}return _0x156d46+')';};var _0x5aff39={'where':{'id':_0x1c6623['id']}},_0x18f125,_0x1aa710,_0xe3c8bb,_0x539897,_0x33c915;_0x5aff39=_[_0x10f1('0x3f')]({},_0x5aff39,_0x391641);return db[_0x10f1('0x2e')][_0x10f1('0x48')](_0x5aff39)[_0x10f1('0x24')](function(_0x1af974){if(_0x1af974){_0x18f125=_0x1af974;return _0x1af974['getFields']();}return null;})[_0x10f1('0x24')](function(_0x3ddb4c){if(_0x3ddb4c){if(!_0x3ddb4c[_0x10f1('0x46')]){throw new db[(_0x10f1('0x68'))][(_0x10f1('0x69'))]('Please\x20insert\x20at\x20least\x20one\x20field',0x193);}_0x1aa710=_0x3ddb4c;return db['AnalyticMetric'][_0x10f1('0x42')]({'raw':!![]});}return null;})['then'](function(_0x30bf24){if(_0x30bf24){_0xe3c8bb=_['keyBy'](_0x30bf24,'id');var _0x3f9f45;var _0x568c3=squel[_0x10f1('0x6b')]();_0x568c3[_0x10f1('0x89')](_0x18f125[_0x10f1('0x6c')]);for(var _0x494656=0x0;_0x494656<_0x1aa710[_0x10f1('0x46')];_0x494656+=0x1){_0x3f9f45=_0x1aa710[_0x494656][_0x10f1('0x6d')]?_0xe3c8bb[_0x1aa710[_0x494656][_0x10f1('0x6d')]][_0x10f1('0x6e')]:_0x1aa710[_0x494656][_0x10f1('0x65')];_0x3f9f45=_0x1aa710[_0x494656][_0x10f1('0x6f')]?_[_0x10f1('0x71')](_0x826f2a[_0x1aa710[_0x494656][_0x10f1('0x6f')]],'%s',_0x3f9f45):_0x3f9f45;_0x3f9f45=_0x1aa710[_0x494656][_0x10f1('0x70')]?_[_0x10f1('0x71')](_0x47d3d7[_0x1aa710[_0x494656][_0x10f1('0x70')]],'%s',_0x3f9f45):_0x3f9f45;if(_0x1aa710[_0x494656][_0x10f1('0x72')]){_0x568c3[_0x10f1('0x64')](_0x3f9f45);}_0x1aa710[_0x494656][_0x10f1('0x73')]&&_0x568c3[_0x10f1('0x3a')](_0x3f9f45,_0x1aa710[_0x494656][_0x10f1('0x73')]===_0x10f1('0x74')?![]:!![]);_0x568c3[_0x10f1('0x65')](_0x3f9f45,_0x1aa710[_0x494656]['alias']||_0x3f9f45);}if(_0x18f125[_0x10f1('0x76')]){_0x18f125[_0x10f1('0x76')]=JSON[_0x10f1('0x77')](_0x18f125[_0x10f1('0x76')]);for(var _0x252f58=0x0;_0x252f58<_0x18f125[_0x10f1('0x76')][_0x10f1('0x46')];_0x252f58+=0x1){if(_0x18f125[_0x10f1('0x76')][_0x252f58]['type']&&_['includes'](_0x9f61f3,_0x18f125[_0x10f1('0x76')][_0x252f58][_0x10f1('0x78')])&&_0x18f125[_0x10f1('0x76')][_0x252f58][_0x10f1('0x7a')]&&_0x18f125[_0x10f1('0x76')][_0x252f58][_0x10f1('0x7b')]&&_0x18f125[_0x10f1('0x76')][_0x252f58]['foreignKey']){_0x568c3[_0x18f125[_0x10f1('0x76')][_0x252f58][_0x10f1('0x78')]](_0x18f125[_0x10f1('0x76')][_0x252f58][_0x10f1('0x7b')],null,util[_0x10f1('0x70')](_0x10f1('0x7c'),_0x18f125[_0x10f1('0x6c')],_0x18f125[_0x10f1('0x76')][_0x252f58][_0x10f1('0x7a')],_0x18f125['joins'][_0x252f58][_0x10f1('0x7b')],_0x18f125['joins'][_0x252f58][_0x10f1('0x7d')]));}}}if(_0x18f125[_0x10f1('0x7e')]){_0x18f125[_0x10f1('0x7e')]=JSON[_0x10f1('0x77')](_0x18f125[_0x10f1('0x7e')]);_0x568c3[_0x10f1('0x3c')](_0x2f7fa9(_0x18f125[_0x10f1('0x7e')][_0x10f1('0x64')]));}_0x33c915=_0x568c3['clone']();_0x568c3[_0x10f1('0x1e')](_0x2d0f7e);_0x568c3['offset'](0x0);return;}})[_0x10f1('0x24')](function(){if(_0x2a3959[_0x10f1('0x8a')]===_0x10f1('0x8b')){return null;}var _0x2498f2=_['merge'](_0x2a3959,{'name':_0x2a3959['fullPath']||_0x2a3959[_0x10f1('0x2a')]||_0x18f125[_0x10f1('0x2a')],'basename':_0x41ba49,'savename':util[_0x10f1('0x70')](_0x10f1('0x8c'),_0x2a3959[_0x10f1('0x2a')]||_0x18f125[_0x10f1('0x2a')],require(_0x10f1('0x8d'))[_0x10f1('0x8e')](0x4),_0x2a3959[_0x10f1('0x8a')]||_0x10f1('0x8f')),'reportId':_0x18f125['id'],'reportType':'custom'});return db[_0x10f1('0x90')][_0x10f1('0x49')](_0x2498f2,{'raw':!![]});})[_0x10f1('0x24')](function(_0x2ce375){if(_0x18f125['table']===_0x10f1('0x91')){_0x33c915[_0x10f1('0x3c')](_0x18f125[_0x10f1('0x6c')]+'.calldate\x20BETWEEN\x20?\x20AND\x20?',_0x2a3959[_0x10f1('0x92')],_0x2a3959[_0x10f1('0x93')]);}else{_0x33c915[_0x10f1('0x3c')](_0x18f125[_0x10f1('0x6c')]+'.createdAt\x20BETWEEN\x20?\x20AND\x20?',_0x2a3959['startDate'],_0x2a3959[_0x10f1('0x93')]);}if(_0x2ce375){logger['info'](_0x10f1('0x94'),_0x33c915[_0x10f1('0x81')]());require(_0x10f1('0x95'))[_0x10f1('0x96')](path[_0x10f1('0x51')](__dirname,_0x10f1('0x97'),_0x2ce375[_0x10f1('0x8a')]),[_0x2ce375['id'],_0x33c915['toString'](),path[_0x10f1('0x51')](__dirname,_0x10f1('0x98'),_0x2ce375[_0x10f1('0x99')]),_0x41ba49]);return _0x2ce375;}else{var _0x397ded=squel[_0x10f1('0x6b')]();_0x397ded[_0x10f1('0x89')]('('+_0x33c915[_0x10f1('0x81')]()+')',_0x10f1('0x9a'));_0x397ded['field']('COUNT(*)',_0x10f1('0x1f'));_0x33c915[_0x10f1('0x1e')](_0x2a3959[_0x10f1('0x1e')]||_0x2d0f7e);_0x33c915[_0x10f1('0x1c')](_0x2a3959[_0x10f1('0x1c')]||0x0);return dbH[_0x10f1('0x82')][_0x10f1('0x32')](_0x397ded[_0x10f1('0x81')](),{'type':dbH['sequelize'][_0x10f1('0x83')][_0x10f1('0x9b')]})['then'](function(_0x2735e7){if(!_0x2735e7[_0x10f1('0x46')]){_0x539897=0x0;}else{_0x539897=_0x2735e7[0x0]['count']||0x0;}return dbH[_0x10f1('0x82')]['query'](_0x33c915[_0x10f1('0x81')](),{'type':dbH[_0x10f1('0x82')]['QueryTypes'][_0x10f1('0x9b')]});})['then'](function(_0x58fd95){return{'rows':_0x58fd95||[],'count':_0x539897};});}});}exports['run']=function(_0x5b742b,_0x2e2384){return runReport(_0x5b742b[_0x10f1('0x4f')],_0x5b742b['query'],_0x5b742b[_0x10f1('0x47')])[_0x10f1('0x24')](respondWithResult(_0x2e2384,null))[_0x10f1('0x44')](handleError(_0x2e2384,null));};exports[_0x10f1('0x9c')]=runReport;exports['query']=function(_0x3d68ff,_0x3f4753){var _0x1d7a2e=0xa;var _0x53e175=['join',_0x10f1('0x84'),'right_join',_0x10f1('0x53')];var _0x623979={'SUM':_0x10f1('0x85'),'COUNT':_0x10f1('0x54'),'COUNT DISTINCT':_0x10f1('0x55'),'MAX':_0x10f1('0x56'),'MIN':_0x10f1('0x57'),'AVG':_0x10f1('0x58'),'GROUP_CONCAT':_0x10f1('0x86'),'GROUP_CONCAT ASC':_0x10f1('0x59'),'GROUP_CONCAT DESC':_0x10f1('0x5a')};var _0x5572a2={'SEC_TO_TIME':_0x10f1('0x5b'),'DATE':_0x10f1('0x5c'),'HOUR':_0x10f1('0x5d'),'ROUND':'ROUND(%s)','UNIX_TIMESTAMP':_0x10f1('0x5f')};var _0x5551bb=function(_0x5682b7){return!_[_0x10f1('0x79')]([_0x10f1('0x60'),_0x10f1('0x87'),_0x10f1('0x61'),'IS\x20NOT\x20EMPTY'],_0x5682b7);};var _0x480a05=function(_0x2b937d){if(!_0x2b937d||!_0x2b937d[_0x10f1('0x62')][_0x10f1('0x46')]){return'';}for(var _0x1cc86a='(',_0x25e8ac=0x0;_0x25e8ac<_0x2b937d['rules']['length'];_0x25e8ac+=0x1){_0x25e8ac>0x0&&(_0x1cc86a+='\x20'+_0x2b937d[_0x10f1('0x63')]+'\x20');_0x1cc86a+=_0x2b937d['rules'][_0x25e8ac][_0x10f1('0x64')]?_0x480a05(_0x2b937d['rules'][_0x25e8ac][_0x10f1('0x64')]):_0x2b937d[_0x10f1('0x62')][_0x25e8ac]['field']+'\x20'+_0x2b937d[_0x10f1('0x62')][_0x25e8ac][_0x10f1('0x66')]+(_0x5551bb(_0x2b937d[_0x10f1('0x62')][_0x25e8ac][_0x10f1('0x66')])?'\x20'+_0x2b937d[_0x10f1('0x62')][_0x25e8ac][_0x10f1('0x88')]:'');}return _0x1cc86a+')';};var _0x4f3159={'where':{'id':_0x3d68ff[_0x10f1('0x4f')]['id']}},_0x17312d,_0x5ca0d5,_0xdb48a6,_0x3b63d6,_0x4bc056;_0x4f3159=_[_0x10f1('0x3f')]({},_0x4f3159,_0x3d68ff[_0x10f1('0x47')]);return db[_0x10f1('0x2e')]['find'](_0x4f3159)[_0x10f1('0x24')](function(_0x1a8fb4){if(_0x1a8fb4){_0x17312d=_0x1a8fb4;return _0x1a8fb4[_0x10f1('0x67')]();}return null;})[_0x10f1('0x24')](function(_0x200b47){if(_0x200b47){if(!_0x200b47['length']){throw new db[(_0x10f1('0x68'))]['ValidationErrorItem']('Please\x20insert\x20at\x20least\x20one\x20field',0x193);}_0x5ca0d5=_0x200b47;return db[_0x10f1('0x9d')][_0x10f1('0x42')]({'raw':!![]});}return null;})[_0x10f1('0x24')](function(_0x2a7455){if(_0x2a7455){_0xdb48a6=_['keyBy'](_0x2a7455,'id');var _0x4697e3;var _0x4a410f=squel[_0x10f1('0x6b')]();_0x4a410f['from'](_0x17312d[_0x10f1('0x6c')]);for(var _0x2c5f52=0x0;_0x2c5f52<_0x5ca0d5['length'];_0x2c5f52+=0x1){_0x4697e3=_0x5ca0d5[_0x2c5f52]['MetricId']?_0xdb48a6[_0x5ca0d5[_0x2c5f52]['MetricId']][_0x10f1('0x6e')]:_0x5ca0d5[_0x2c5f52][_0x10f1('0x65')];_0x4697e3=_0x5ca0d5[_0x2c5f52]['function']?_[_0x10f1('0x71')](_0x623979[_0x5ca0d5[_0x2c5f52][_0x10f1('0x6f')]],'%s',_0x4697e3):_0x4697e3;_0x4697e3=_0x5ca0d5[_0x2c5f52]['format']?_[_0x10f1('0x71')](_0x5572a2[_0x5ca0d5[_0x2c5f52]['format']],'%s',_0x4697e3):_0x4697e3;if(_0x5ca0d5[_0x2c5f52][_0x10f1('0x72')]){_0x4a410f[_0x10f1('0x64')](_0x4697e3);}_0x5ca0d5[_0x2c5f52]['orderBy']&&_0x4a410f[_0x10f1('0x3a')](_0x4697e3,_0x5ca0d5[_0x2c5f52][_0x10f1('0x73')]==='DESC'?![]:!![]);_0x4a410f['field'](_0x4697e3,_0x5ca0d5[_0x2c5f52][_0x10f1('0x75')]||_0x4697e3);}if(_0x17312d[_0x10f1('0x76')]){_0x17312d[_0x10f1('0x76')]=JSON[_0x10f1('0x77')](_0x17312d[_0x10f1('0x76')]);for(var _0x19a36e=0x0;_0x19a36e<_0x17312d[_0x10f1('0x76')][_0x10f1('0x46')];_0x19a36e+=0x1){if(_0x17312d[_0x10f1('0x76')][_0x19a36e]['type']&&_[_0x10f1('0x79')](_0x53e175,_0x17312d['joins'][_0x19a36e][_0x10f1('0x78')])&&_0x17312d[_0x10f1('0x76')][_0x19a36e][_0x10f1('0x7a')]&&_0x17312d['joins'][_0x19a36e][_0x10f1('0x7b')]&&_0x17312d['joins'][_0x19a36e]['foreignKey']){_0x4a410f[_0x17312d[_0x10f1('0x76')][_0x19a36e]['type']](_0x17312d['joins'][_0x19a36e]['foreignTable'],null,util[_0x10f1('0x70')](_0x10f1('0x7c'),_0x17312d['table'],_0x17312d[_0x10f1('0x76')][_0x19a36e][_0x10f1('0x7a')],_0x17312d['joins'][_0x19a36e][_0x10f1('0x7b')],_0x17312d['joins'][_0x19a36e][_0x10f1('0x7d')]));}}}if(_0x17312d['conditions']){_0x17312d[_0x10f1('0x7e')]=JSON[_0x10f1('0x77')](_0x17312d[_0x10f1('0x7e')]);_0x4a410f[_0x10f1('0x3c')](_0x480a05(_0x17312d['conditions'][_0x10f1('0x64')]));}_0x4bc056=_0x4a410f[_0x10f1('0x7f')]();_0x4a410f['limit'](_0x1d7a2e);_0x4a410f[_0x10f1('0x1c')](0x0);logger[_0x10f1('0x9e')](_0x10f1('0x80'),_0x4a410f['toString']());return dbH[_0x10f1('0x82')][_0x10f1('0x32')](_0x4a410f[_0x10f1('0x81')](),{'type':dbH[_0x10f1('0x82')][_0x10f1('0x83')][_0x10f1('0x9b')]});}})['then'](function(){return{'sql':_0x4bc056['toString']()};})[_0x10f1('0x24')](respondWithResult(_0x3f4753,null))[_0x10f1('0x44')](handleError(_0x3f4753,null));}; \ No newline at end of file +var _0x1f8e=['fast-json-patch','request-promise','mustache','util','sox','fs-extra','lodash','squel','crypto','desk.js','to-csv','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/license/util','../../mysqldb','dbH','status','end','json','offset','undefined','count','limit','Content-Range','apply','save','update','destroy','get','CustomReports','UserProfileResource','then','sendStatus','error','stack','name','send','index','map','AnalyticCustomReport','type','key','model','keys','query','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','include','findAll','catch','show','rawAttributes','create','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','Reports','UserProfileSection','userProfileId','autoAssociation','body','params','find','preview','left_join','cross_join','SUM(%s)','COUNT(DISTINCT\x20%s)','MAX(%s)','MIN(%s)','AVG(%s)','GROUP_CONCAT(%s)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)','SEC_TO_TIME(%s)','DATE(%s)','HOUR(%s)','ROUND(%s)','UNIX_TIMESTAMP(%s)','IS\x20NULL','IS\x20NOT\x20NULL','IS\x20NOT\x20EMPTY','rules','field','condition','value','getFields','Sequelize','ValidationErrorItem','Please\x20insert\x20at\x20least\x20one\x20field','AnalyticMetric','select','from','MetricId','metric','function','replace','format','groupBy','group','orderBy','DESC','alias','parse','joins','includes','parentKey','foreignTable','%s.%s\x20=\x20%s.%s','table','foreignKey','conditions','debug','Limited\x20Query:','toString','QueryTypes','join','right_join','COUNT(%s)','keyBy','clone','output','web','fullPath','%s-%s.%s','randomstring','csv','custom','cdr','.calldate\x20BETWEEN\x20?\x20AND\x20?','startDate','endDate','.createdAt\x20BETWEEN\x20?\x20AND\x20?','info','Run\x20Query:','child_process','../../components/export/','../../files/reports','savename','countTable','COUNT(*)','sequelize','SELECT','run','runReport','operator','eml-format','rimraf','zip-dir'];(function(_0x4e1a49,_0x4da738){var _0x136aae=function(_0x3ffd93){while(--_0x3ffd93){_0x4e1a49['push'](_0x4e1a49['shift']());}};_0x136aae(++_0x4da738);}(_0x1f8e,0xa4));var _0xe1f8=function(_0x8dc04d,_0xaa7559){_0x8dc04d=_0x8dc04d-0x0;var _0x2f5f28=_0x1f8e[_0x8dc04d];return _0x2f5f28;};'use strict';var emlformat=require(_0xe1f8('0x0'));var rimraf=require(_0xe1f8('0x1'));var zipdir=require(_0xe1f8('0x2'));var jsonpatch=require(_0xe1f8('0x3'));var rp=require(_0xe1f8('0x4'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0xe1f8('0x5'));var util=require(_0xe1f8('0x6'));var path=require('path');var sox=require(_0xe1f8('0x7'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xe1f8('0x8'));var _=require(_0xe1f8('0x9'));var squel=require(_0xe1f8('0xa'));var crypto=require(_0xe1f8('0xb'));var jsforce=require('jsforce');var deskjs=require(_0xe1f8('0xc'));var toCsv=require(_0xe1f8('0xd'));var querystring=require(_0xe1f8('0xe'));var Papa=require('papaparse');var Redis=require(_0xe1f8('0xf'));var authService=require(_0xe1f8('0x10'));var qs=require(_0xe1f8('0x11'));var as=require(_0xe1f8('0x12'));var hardwareService=require(_0xe1f8('0x13'));var logger=require('../../config/logger')(_0xe1f8('0x14'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0xe1f8('0x15'));var db=require(_0xe1f8('0x16'))['db'];var dbH=require(_0xe1f8('0x16'))[_0xe1f8('0x17')];function respondWithStatusCode(_0x22dde1,_0x428190){_0x428190=_0x428190||0xcc;return function(_0x3b6315){if(_0x3b6315){return _0x22dde1['sendStatus'](_0x428190);}return _0x22dde1[_0xe1f8('0x18')](_0x428190)[_0xe1f8('0x19')]();};}function respondWithResult(_0x4b412d,_0x40d1e5){_0x40d1e5=_0x40d1e5||0xc8;return function(_0x4bd286){if(_0x4bd286){return _0x4b412d[_0xe1f8('0x18')](_0x40d1e5)[_0xe1f8('0x1a')](_0x4bd286);}};}function respondWithFilteredResult(_0x268af8,_0x6ecea6){return function(_0x3a6665){if(_0x3a6665){var _0x2d3897=typeof _0x6ecea6[_0xe1f8('0x1b')]===_0xe1f8('0x1c')&&typeof _0x6ecea6['limit']===_0xe1f8('0x1c');var _0x5a0459=_0x3a6665['count'];var _0x4e6b36=_0x2d3897?0x0:_0x6ecea6[_0xe1f8('0x1b')];var _0x521560=_0x2d3897?_0x3a6665[_0xe1f8('0x1d')]:_0x6ecea6[_0xe1f8('0x1b')]+_0x6ecea6[_0xe1f8('0x1e')];var _0x317e78;if(_0x521560>=_0x5a0459){_0x521560=_0x5a0459;_0x317e78=0xc8;}else{_0x317e78=0xce;}_0x268af8[_0xe1f8('0x18')](_0x317e78);return _0x268af8['set'](_0xe1f8('0x1f'),_0x4e6b36+'-'+_0x521560+'/'+_0x5a0459)[_0xe1f8('0x1a')](_0x3a6665);}return null;};}function patchUpdates(_0x3f9f04){return function(_0x1db213){try{jsonpatch[_0xe1f8('0x20')](_0x1db213,_0x3f9f04,!![]);}catch(_0x370f87){return BPromise['reject'](_0x370f87);}return _0x1db213[_0xe1f8('0x21')]();};}function saveUpdates(_0x53d833,_0x3c3e6b){return function(_0x11aabe){if(_0x11aabe){return _0x11aabe[_0xe1f8('0x22')](_0x53d833)['then'](function(_0x19b1f5){return _0x19b1f5;});}return null;};}function removeEntity(_0x363038,_0x1af427){return function(_0x54a1ba){if(_0x54a1ba){return _0x54a1ba[_0xe1f8('0x23')]()['then'](function(){var _0x23aa38=_0x54a1ba[_0xe1f8('0x24')]({'plain':!![]});var _0x23a1ed=_0xe1f8('0x25');return db[_0xe1f8('0x26')][_0xe1f8('0x23')]({'where':{'type':_0x23a1ed,'resourceId':_0x23aa38['id']}})[_0xe1f8('0x27')](function(){return _0x54a1ba;});})['then'](function(){_0x363038[_0xe1f8('0x18')](0xcc)['end']();});}};}function handleEntityNotFound(_0x59b51d,_0x1ed3a5){return function(_0x30384d){if(!_0x30384d){_0x59b51d[_0xe1f8('0x28')](0x194);}return _0x30384d;};}function handleError(_0x5192c1,_0x5eaf8f){_0x5eaf8f=_0x5eaf8f||0x1f4;return function(_0x21c25b){logger[_0xe1f8('0x29')](_0x21c25b[_0xe1f8('0x2a')]);if(_0x21c25b[_0xe1f8('0x2b')]){delete _0x21c25b[_0xe1f8('0x2b')];}_0x5192c1[_0xe1f8('0x18')](_0x5eaf8f)[_0xe1f8('0x2c')](_0x21c25b);};}exports[_0xe1f8('0x2d')]=function(_0x2da123,_0x208002){var _0xc3c3f7={},_0x125574={},_0x458eed={'count':0x0,'rows':[]};var _0x4580e4=_[_0xe1f8('0x2e')](db[_0xe1f8('0x2f')]['rawAttributes'],function(_0xccb147){return{'name':_0xccb147['fieldName'],'type':_0xccb147[_0xe1f8('0x30')][_0xe1f8('0x31')]};});_0x125574[_0xe1f8('0x32')]=_[_0xe1f8('0x2e')](_0x4580e4,_0xe1f8('0x2b'));_0x125574['query']=_[_0xe1f8('0x33')](_0x2da123[_0xe1f8('0x34')]);_0x125574[_0xe1f8('0x35')]=_[_0xe1f8('0x36')](_0x125574[_0xe1f8('0x32')],_0x125574[_0xe1f8('0x34')]);_0xc3c3f7['attributes']=_[_0xe1f8('0x36')](_0x125574[_0xe1f8('0x32')],qs[_0xe1f8('0x37')](_0x2da123['query'][_0xe1f8('0x37')]));_0xc3c3f7['attributes']=_0xc3c3f7[_0xe1f8('0x38')][_0xe1f8('0x39')]?_0xc3c3f7['attributes']:_0x125574[_0xe1f8('0x32')];if(!_0x2da123[_0xe1f8('0x34')][_0xe1f8('0x3a')](_0xe1f8('0x3b'))){_0xc3c3f7[_0xe1f8('0x1e')]=qs[_0xe1f8('0x1e')](_0x2da123[_0xe1f8('0x34')][_0xe1f8('0x1e')]);_0xc3c3f7[_0xe1f8('0x1b')]=qs['offset'](_0x2da123[_0xe1f8('0x34')][_0xe1f8('0x1b')]);}_0xc3c3f7[_0xe1f8('0x3c')]=qs[_0xe1f8('0x3d')](_0x2da123[_0xe1f8('0x34')][_0xe1f8('0x3d')]);_0xc3c3f7[_0xe1f8('0x3e')]=qs[_0xe1f8('0x35')](_[_0xe1f8('0x3f')](_0x2da123['query'],_0x125574[_0xe1f8('0x35')]),_0x4580e4);if(_0x2da123[_0xe1f8('0x34')][_0xe1f8('0x40')]){_0xc3c3f7['where']=_[_0xe1f8('0x41')](_0xc3c3f7[_0xe1f8('0x3e')],{'$or':_[_0xe1f8('0x2e')](_0x4580e4,function(_0x3394bf){if(_0x3394bf[_0xe1f8('0x30')]!==_0xe1f8('0x42')){var _0x12ed6e={};_0x12ed6e[_0x3394bf[_0xe1f8('0x2b')]]={'$like':'%'+_0x2da123[_0xe1f8('0x34')]['filter']+'%'};return _0x12ed6e;}})});}_0xc3c3f7=_['merge']({},_0xc3c3f7,_0x2da123[_0xe1f8('0x43')]);var _0x5e63f3={'where':_0xc3c3f7[_0xe1f8('0x3e')]};return db[_0xe1f8('0x2f')][_0xe1f8('0x1d')](_0x5e63f3)[_0xe1f8('0x27')](function(_0x5e573c){_0x458eed[_0xe1f8('0x1d')]=_0x5e573c;if(_0x2da123['query'][_0xe1f8('0x44')]){_0xc3c3f7[_0xe1f8('0x45')]=[{'all':!![]}];}return db['AnalyticCustomReport'][_0xe1f8('0x46')](_0xc3c3f7);})[_0xe1f8('0x27')](function(_0x4e148d){_0x458eed['rows']=_0x4e148d;return _0x458eed;})[_0xe1f8('0x27')](respondWithFilteredResult(_0x208002,_0xc3c3f7))[_0xe1f8('0x47')](handleError(_0x208002,null));};exports[_0xe1f8('0x48')]=function(_0x15d4c7,_0x140401){var _0x12dab1={'raw':![],'where':{'id':_0x15d4c7['params']['id']}},_0x12a0c3={};_0x12a0c3[_0xe1f8('0x32')]=_['keys'](db[_0xe1f8('0x2f')][_0xe1f8('0x49')]);_0x12a0c3['query']=_['keys'](_0x15d4c7[_0xe1f8('0x34')]);_0x12a0c3[_0xe1f8('0x35')]=_[_0xe1f8('0x36')](_0x12a0c3[_0xe1f8('0x32')],_0x12a0c3[_0xe1f8('0x34')]);_0x12dab1[_0xe1f8('0x38')]=_[_0xe1f8('0x36')](_0x12a0c3[_0xe1f8('0x32')],qs[_0xe1f8('0x37')](_0x15d4c7[_0xe1f8('0x34')][_0xe1f8('0x37')]));_0x12dab1[_0xe1f8('0x38')]=_0x12dab1[_0xe1f8('0x38')][_0xe1f8('0x39')]?_0x12dab1['attributes']:_0x12a0c3[_0xe1f8('0x32')];if(_0x15d4c7[_0xe1f8('0x34')][_0xe1f8('0x44')]){_0x12dab1[_0xe1f8('0x45')]=[{'all':!![]}];}_0x12dab1=_[_0xe1f8('0x41')]({},_0x12dab1,_0x15d4c7[_0xe1f8('0x43')]);return db[_0xe1f8('0x2f')]['find'](_0x12dab1)['then'](handleEntityNotFound(_0x140401,null))[_0xe1f8('0x27')](respondWithResult(_0x140401,null))['catch'](handleError(_0x140401,null));};exports[_0xe1f8('0x4a')]=function(_0x299455,_0x1bd49f){return db[_0xe1f8('0x2f')][_0xe1f8('0x4a')](_0x299455['body'],{})[_0xe1f8('0x27')](function(_0x461a65){var _0x12ff3d=_0x299455['user'][_0xe1f8('0x24')]({'plain':!![]});if(!_0x12ff3d)throw new Error(_0xe1f8('0x4b'));if(_0x12ff3d[_0xe1f8('0x4c')]==='user'){var _0x2c6a14=_0x461a65['get']({'plain':!![]});var _0x1242fc=_0xe1f8('0x4d');return db[_0xe1f8('0x4e')]['find']({'where':{'name':_0x1242fc,'userProfileId':_0x12ff3d[_0xe1f8('0x4f')]},'raw':!![]})[_0xe1f8('0x27')](function(_0x43dddf){if(_0x43dddf&&_0x43dddf[_0xe1f8('0x50')]===0x0){return db[_0xe1f8('0x26')][_0xe1f8('0x4a')]({'name':_0x2c6a14[_0xe1f8('0x2b')],'resourceId':_0x2c6a14['id'],'type':_0xe1f8('0x25'),'sectionId':_0x43dddf['id']},{})[_0xe1f8('0x27')](function(){return _0x461a65;});}else{return _0x461a65;}})[_0xe1f8('0x47')](function(_0x4471ef){logger[_0xe1f8('0x29')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x4471ef);throw _0x4471ef;});}return _0x461a65;})[_0xe1f8('0x27')](respondWithResult(_0x1bd49f,0xc9))[_0xe1f8('0x47')](handleError(_0x1bd49f,null));};exports[_0xe1f8('0x22')]=function(_0x167317,_0x2849a1){if(_0x167317[_0xe1f8('0x51')]['id']){delete _0x167317['body']['id'];}return db[_0xe1f8('0x2f')]['find']({'where':{'id':_0x167317[_0xe1f8('0x52')]['id']}})[_0xe1f8('0x27')](handleEntityNotFound(_0x2849a1,null))[_0xe1f8('0x27')](saveUpdates(_0x167317['body'],null))[_0xe1f8('0x27')](respondWithResult(_0x2849a1,null))[_0xe1f8('0x47')](handleError(_0x2849a1,null));};exports[_0xe1f8('0x23')]=function(_0x4bc09c,_0x4696e2){return db[_0xe1f8('0x2f')][_0xe1f8('0x53')]({'where':{'id':_0x4bc09c[_0xe1f8('0x52')]['id']}})['then'](handleEntityNotFound(_0x4696e2,null))[_0xe1f8('0x27')](removeEntity(_0x4696e2,null))[_0xe1f8('0x47')](handleError(_0x4696e2,null));};exports[_0xe1f8('0x54')]=function(_0x5e5f0a,_0x328406){var _0x489cd7=0xa;var _0x5a08a8=['join',_0xe1f8('0x55'),'right_join',_0xe1f8('0x56')];var _0x1ec90b={'SUM':_0xe1f8('0x57'),'COUNT':'COUNT(%s)','COUNT DISTINCT':_0xe1f8('0x58'),'MAX':_0xe1f8('0x59'),'MIN':_0xe1f8('0x5a'),'AVG':_0xe1f8('0x5b'),'GROUP_CONCAT':_0xe1f8('0x5c'),'GROUP_CONCAT ASC':_0xe1f8('0x5d'),'GROUP_CONCAT DESC':_0xe1f8('0x5e')};var _0x5598dd={'SEC_TO_TIME':_0xe1f8('0x5f'),'DATE':_0xe1f8('0x60'),'HOUR':_0xe1f8('0x61'),'ROUND':_0xe1f8('0x62'),'UNIX_TIMESTAMP':_0xe1f8('0x63')};var _0xc06ae9=function(_0x4682a6){return!_['includes']([_0xe1f8('0x64'),_0xe1f8('0x65'),'IS\x20EMPTY',_0xe1f8('0x66')],_0x4682a6);};var _0x42abe0=function(_0x5096db){if(!_0x5096db||!_0x5096db[_0xe1f8('0x67')]['length']){return'';}for(var _0x18c12c='(',_0xfcb39d=0x0;_0xfcb39d<_0x5096db['rules'][_0xe1f8('0x39')];_0xfcb39d+=0x1){_0xfcb39d>0x0&&(_0x18c12c+='\x20'+_0x5096db['operator']+'\x20');_0x18c12c+=_0x5096db[_0xe1f8('0x67')][_0xfcb39d]['group']?_0x42abe0(_0x5096db['rules'][_0xfcb39d]['group']):_0x5096db['rules'][_0xfcb39d][_0xe1f8('0x68')]+'\x20'+_0x5096db[_0xe1f8('0x67')][_0xfcb39d][_0xe1f8('0x69')]+(_0xc06ae9(_0x5096db[_0xe1f8('0x67')][_0xfcb39d][_0xe1f8('0x69')])?'\x20'+_0x5096db[_0xe1f8('0x67')][_0xfcb39d][_0xe1f8('0x6a')]:'');}return _0x18c12c+')';};var _0x100c3e={'where':{'id':_0x5e5f0a[_0xe1f8('0x52')]['id']}},_0x31ffcc,_0x5d88e1,_0x54b396,_0x282fe8,_0x344f6f;_0x100c3e=_['merge']({},_0x100c3e,_0x5e5f0a['options']);return db[_0xe1f8('0x2f')]['find'](_0x100c3e)['then'](function(_0x3c934f){if(_0x3c934f){_0x31ffcc=_0x3c934f;return _0x3c934f[_0xe1f8('0x6b')]();}return null;})['then'](function(_0x486baf){if(_0x486baf){if(!_0x486baf[_0xe1f8('0x39')]){throw new db[(_0xe1f8('0x6c'))][(_0xe1f8('0x6d'))](_0xe1f8('0x6e'),0x193);}_0x5d88e1=_0x486baf;return db[_0xe1f8('0x6f')][_0xe1f8('0x46')]({'raw':!![]});}return null;})[_0xe1f8('0x27')](function(_0x2bd192){if(_0x2bd192){_0x54b396=_['keyBy'](_0x2bd192,'id');var _0xefc37;var _0x5a0234=squel[_0xe1f8('0x70')]();_0x5a0234[_0xe1f8('0x71')](_0x31ffcc['table']);for(var _0x3b0c55=0x0;_0x3b0c55<_0x5d88e1['length'];_0x3b0c55+=0x1){_0xefc37=_0x5d88e1[_0x3b0c55][_0xe1f8('0x72')]?_0x54b396[_0x5d88e1[_0x3b0c55][_0xe1f8('0x72')]][_0xe1f8('0x73')]:_0x5d88e1[_0x3b0c55][_0xe1f8('0x68')];_0xefc37=_0x5d88e1[_0x3b0c55][_0xe1f8('0x74')]?_[_0xe1f8('0x75')](_0x1ec90b[_0x5d88e1[_0x3b0c55][_0xe1f8('0x74')]],'%s',_0xefc37):_0xefc37;_0xefc37=_0x5d88e1[_0x3b0c55][_0xe1f8('0x76')]?_[_0xe1f8('0x75')](_0x5598dd[_0x5d88e1[_0x3b0c55][_0xe1f8('0x76')]],'%s',_0xefc37):_0xefc37;if(_0x5d88e1[_0x3b0c55][_0xe1f8('0x77')]){_0x5a0234[_0xe1f8('0x78')](_0xefc37);}_0x5d88e1[_0x3b0c55][_0xe1f8('0x79')]&&_0x5a0234[_0xe1f8('0x3c')](_0xefc37,_0x5d88e1[_0x3b0c55][_0xe1f8('0x79')]===_0xe1f8('0x7a')?![]:!![]);_0x5a0234[_0xe1f8('0x68')](_0xefc37,_0x5d88e1[_0x3b0c55][_0xe1f8('0x7b')]||_0xefc37);}if(_0x31ffcc['joins']){_0x31ffcc['joins']=JSON[_0xe1f8('0x7c')](_0x31ffcc[_0xe1f8('0x7d')]);for(var _0x110954=0x0;_0x110954<_0x31ffcc[_0xe1f8('0x7d')][_0xe1f8('0x39')];_0x110954+=0x1){if(_0x31ffcc['joins'][_0x110954][_0xe1f8('0x30')]&&_[_0xe1f8('0x7e')](_0x5a08a8,_0x31ffcc[_0xe1f8('0x7d')][_0x110954]['type'])&&_0x31ffcc[_0xe1f8('0x7d')][_0x110954][_0xe1f8('0x7f')]&&_0x31ffcc[_0xe1f8('0x7d')][_0x110954][_0xe1f8('0x80')]&&_0x31ffcc[_0xe1f8('0x7d')][_0x110954]['foreignKey']){_0x5a0234[_0x31ffcc[_0xe1f8('0x7d')][_0x110954][_0xe1f8('0x30')]](_0x31ffcc['joins'][_0x110954][_0xe1f8('0x80')],null,util['format'](_0xe1f8('0x81'),_0x31ffcc[_0xe1f8('0x82')],_0x31ffcc[_0xe1f8('0x7d')][_0x110954][_0xe1f8('0x7f')],_0x31ffcc[_0xe1f8('0x7d')][_0x110954][_0xe1f8('0x80')],_0x31ffcc[_0xe1f8('0x7d')][_0x110954][_0xe1f8('0x83')]));}}}if(_0x31ffcc[_0xe1f8('0x84')]){_0x31ffcc[_0xe1f8('0x84')]=JSON['parse'](_0x31ffcc['conditions']);_0x5a0234[_0xe1f8('0x3e')](_0x42abe0(_0x31ffcc[_0xe1f8('0x84')][_0xe1f8('0x78')]));}_0x344f6f=_0x5a0234['clone']();_0x5a0234[_0xe1f8('0x1e')](_0x489cd7);_0x5a0234[_0xe1f8('0x1b')](0x0);logger[_0xe1f8('0x85')](_0xe1f8('0x86'),_0x5a0234['toString']());return dbH['sequelize'][_0xe1f8('0x34')](_0x5a0234[_0xe1f8('0x87')](),{'type':dbH['sequelize'][_0xe1f8('0x88')]['SELECT']});}})[_0xe1f8('0x27')](respondWithResult(_0x328406,null))['catch'](handleError(_0x328406,null));};function runReport(_0x33b227,_0x2d9835,_0x1e210e){var _0x24d735=_0x2d9835[_0xe1f8('0x2b')];var _0x4207d9=0xa;var _0x3eb678=[_0xe1f8('0x89'),_0xe1f8('0x55'),_0xe1f8('0x8a'),_0xe1f8('0x56')];var _0xf89459={'SUM':'SUM(%s)','COUNT':_0xe1f8('0x8b'),'COUNT DISTINCT':'COUNT(DISTINCT\x20%s)','MAX':'MAX(%s)','MIN':'MIN(%s)','AVG':'AVG(%s)','GROUP_CONCAT':'GROUP_CONCAT(%s)','GROUP_CONCAT ASC':_0xe1f8('0x5d'),'GROUP_CONCAT DESC':_0xe1f8('0x5e')};var _0x21d0f2={'SEC_TO_TIME':_0xe1f8('0x5f'),'DATE':_0xe1f8('0x60'),'HOUR':_0xe1f8('0x61'),'ROUND':'ROUND(%s)','UNIX_TIMESTAMP':_0xe1f8('0x63')};var _0x4e7a74=function(_0x11a821){return!_[_0xe1f8('0x7e')]([_0xe1f8('0x64'),_0xe1f8('0x65'),'IS\x20EMPTY',_0xe1f8('0x66')],_0x11a821);};var _0x1e58a=function(_0x3776ea){if(!_0x3776ea||!_0x3776ea['rules'][_0xe1f8('0x39')]){return'';}for(var _0x46d5b3='(',_0x31585d=0x0;_0x31585d<_0x3776ea['rules']['length'];_0x31585d+=0x1){_0x31585d>0x0&&(_0x46d5b3+='\x20'+_0x3776ea['operator']+'\x20');_0x46d5b3+=_0x3776ea['rules'][_0x31585d]['group']?_0x1e58a(_0x3776ea[_0xe1f8('0x67')][_0x31585d][_0xe1f8('0x78')]):_0x3776ea[_0xe1f8('0x67')][_0x31585d][_0xe1f8('0x68')]+'\x20'+_0x3776ea['rules'][_0x31585d]['condition']+(_0x4e7a74(_0x3776ea['rules'][_0x31585d][_0xe1f8('0x69')])?'\x20'+_0x3776ea['rules'][_0x31585d]['value']:'');}return _0x46d5b3+')';};var _0x14ac46={'where':{'id':_0x33b227['id']}},_0x126f21,_0x5a503e,_0x465d63,_0x169774,_0x50ded7;_0x14ac46=_['merge']({},_0x14ac46,_0x1e210e);return db['AnalyticCustomReport']['find'](_0x14ac46)[_0xe1f8('0x27')](function(_0x5593){if(_0x5593){_0x126f21=_0x5593;return _0x5593[_0xe1f8('0x6b')]();}return null;})[_0xe1f8('0x27')](function(_0x206cd8){if(_0x206cd8){if(!_0x206cd8['length']){throw new db[(_0xe1f8('0x6c'))]['ValidationErrorItem'](_0xe1f8('0x6e'),0x193);}_0x5a503e=_0x206cd8;return db['AnalyticMetric'][_0xe1f8('0x46')]({'raw':!![]});}return null;})[_0xe1f8('0x27')](function(_0x521d82){if(_0x521d82){_0x465d63=_[_0xe1f8('0x8c')](_0x521d82,'id');var _0x4ba0a0;var _0x4025dc=squel[_0xe1f8('0x70')]();_0x4025dc['from'](_0x126f21['table']);for(var _0x3539c5=0x0;_0x3539c5<_0x5a503e['length'];_0x3539c5+=0x1){_0x4ba0a0=_0x5a503e[_0x3539c5][_0xe1f8('0x72')]?_0x465d63[_0x5a503e[_0x3539c5][_0xe1f8('0x72')]][_0xe1f8('0x73')]:_0x5a503e[_0x3539c5][_0xe1f8('0x68')];_0x4ba0a0=_0x5a503e[_0x3539c5][_0xe1f8('0x74')]?_[_0xe1f8('0x75')](_0xf89459[_0x5a503e[_0x3539c5]['function']],'%s',_0x4ba0a0):_0x4ba0a0;_0x4ba0a0=_0x5a503e[_0x3539c5][_0xe1f8('0x76')]?_['replace'](_0x21d0f2[_0x5a503e[_0x3539c5][_0xe1f8('0x76')]],'%s',_0x4ba0a0):_0x4ba0a0;if(_0x5a503e[_0x3539c5][_0xe1f8('0x77')]){_0x4025dc[_0xe1f8('0x78')](_0x4ba0a0);}_0x5a503e[_0x3539c5][_0xe1f8('0x79')]&&_0x4025dc['order'](_0x4ba0a0,_0x5a503e[_0x3539c5]['orderBy']===_0xe1f8('0x7a')?![]:!![]);_0x4025dc['field'](_0x4ba0a0,_0x5a503e[_0x3539c5][_0xe1f8('0x7b')]||_0x4ba0a0);}if(_0x126f21[_0xe1f8('0x7d')]){_0x126f21[_0xe1f8('0x7d')]=JSON['parse'](_0x126f21[_0xe1f8('0x7d')]);for(var _0x508eff=0x0;_0x508eff<_0x126f21['joins']['length'];_0x508eff+=0x1){if(_0x126f21['joins'][_0x508eff]['type']&&_[_0xe1f8('0x7e')](_0x3eb678,_0x126f21[_0xe1f8('0x7d')][_0x508eff][_0xe1f8('0x30')])&&_0x126f21['joins'][_0x508eff][_0xe1f8('0x7f')]&&_0x126f21[_0xe1f8('0x7d')][_0x508eff]['foreignTable']&&_0x126f21[_0xe1f8('0x7d')][_0x508eff][_0xe1f8('0x83')]){_0x4025dc[_0x126f21[_0xe1f8('0x7d')][_0x508eff]['type']](_0x126f21[_0xe1f8('0x7d')][_0x508eff]['foreignTable'],null,util[_0xe1f8('0x76')](_0xe1f8('0x81'),_0x126f21[_0xe1f8('0x82')],_0x126f21[_0xe1f8('0x7d')][_0x508eff][_0xe1f8('0x7f')],_0x126f21[_0xe1f8('0x7d')][_0x508eff][_0xe1f8('0x80')],_0x126f21[_0xe1f8('0x7d')][_0x508eff][_0xe1f8('0x83')]));}}}if(_0x126f21['conditions']){_0x126f21[_0xe1f8('0x84')]=JSON[_0xe1f8('0x7c')](_0x126f21['conditions']);_0x4025dc['where'](_0x1e58a(_0x126f21[_0xe1f8('0x84')][_0xe1f8('0x78')]));}_0x50ded7=_0x4025dc[_0xe1f8('0x8d')]();_0x4025dc[_0xe1f8('0x1e')](_0x4207d9);_0x4025dc[_0xe1f8('0x1b')](0x0);return;}})[_0xe1f8('0x27')](function(){if(_0x2d9835[_0xe1f8('0x8e')]===_0xe1f8('0x8f')){return null;}var _0x2df4f3=_['merge'](_0x2d9835,{'name':_0x2d9835[_0xe1f8('0x90')]||_0x2d9835['name']||_0x126f21[_0xe1f8('0x2b')],'basename':_0x24d735,'savename':util[_0xe1f8('0x76')](_0xe1f8('0x91'),_0x2d9835[_0xe1f8('0x2b')]||_0x126f21[_0xe1f8('0x2b')],require(_0xe1f8('0x92'))['generate'](0x4),_0x2d9835[_0xe1f8('0x8e')]||_0xe1f8('0x93')),'reportId':_0x126f21['id'],'reportType':_0xe1f8('0x94')});return db['AnalyticExtractedReport'][_0xe1f8('0x4a')](_0x2df4f3,{'raw':!![]});})[_0xe1f8('0x27')](function(_0x490fdb){if(_0x126f21[_0xe1f8('0x82')]===_0xe1f8('0x95')){_0x50ded7[_0xe1f8('0x3e')](_0x126f21[_0xe1f8('0x82')]+_0xe1f8('0x96'),_0x2d9835[_0xe1f8('0x97')],_0x2d9835[_0xe1f8('0x98')]);}else{_0x50ded7['where'](_0x126f21[_0xe1f8('0x82')]+_0xe1f8('0x99'),_0x2d9835[_0xe1f8('0x97')],_0x2d9835[_0xe1f8('0x98')]);}if(_0x490fdb){logger[_0xe1f8('0x9a')](_0xe1f8('0x9b'),_0x50ded7[_0xe1f8('0x87')]());require(_0xe1f8('0x9c'))['fork'](path['join'](__dirname,_0xe1f8('0x9d'),_0x490fdb['output']),[_0x490fdb['id'],_0x50ded7[_0xe1f8('0x87')](),path[_0xe1f8('0x89')](__dirname,_0xe1f8('0x9e'),_0x490fdb[_0xe1f8('0x9f')]),_0x24d735]);return _0x490fdb;}else{var _0x55cb5a=squel[_0xe1f8('0x70')]();_0x55cb5a[_0xe1f8('0x71')]('('+_0x50ded7[_0xe1f8('0x87')]()+')',_0xe1f8('0xa0'));_0x55cb5a['field'](_0xe1f8('0xa1'),_0xe1f8('0x1d'));_0x50ded7[_0xe1f8('0x1e')](_0x2d9835[_0xe1f8('0x1e')]||_0x4207d9);_0x50ded7[_0xe1f8('0x1b')](_0x2d9835['offset']||0x0);return dbH[_0xe1f8('0xa2')][_0xe1f8('0x34')](_0x55cb5a[_0xe1f8('0x87')](),{'type':dbH[_0xe1f8('0xa2')][_0xe1f8('0x88')][_0xe1f8('0xa3')]})[_0xe1f8('0x27')](function(_0x2153e1){if(!_0x2153e1[_0xe1f8('0x39')]){_0x169774=0x0;}else{_0x169774=_0x2153e1[0x0][_0xe1f8('0x1d')]||0x0;}return dbH[_0xe1f8('0xa2')][_0xe1f8('0x34')](_0x50ded7[_0xe1f8('0x87')](),{'type':dbH[_0xe1f8('0xa2')]['QueryTypes'][_0xe1f8('0xa3')]});})['then'](function(_0x5ef1e3){return{'rows':_0x5ef1e3||[],'count':_0x169774};});}});}exports[_0xe1f8('0xa4')]=function(_0x7e275,_0x1e053e){return runReport(_0x7e275[_0xe1f8('0x52')],_0x7e275[_0xe1f8('0x34')],_0x7e275[_0xe1f8('0x43')])['then'](respondWithResult(_0x1e053e,null))[_0xe1f8('0x47')](handleError(_0x1e053e,null));};exports[_0xe1f8('0xa5')]=runReport;exports[_0xe1f8('0x34')]=function(_0x83f2e8,_0x4e368b){var _0x26f9ed=0xa;var _0x604292=['join','left_join',_0xe1f8('0x8a'),'cross_join'];var _0x39b21c={'SUM':_0xe1f8('0x57'),'COUNT':_0xe1f8('0x8b'),'COUNT DISTINCT':'COUNT(DISTINCT\x20%s)','MAX':_0xe1f8('0x59'),'MIN':_0xe1f8('0x5a'),'AVG':_0xe1f8('0x5b'),'GROUP_CONCAT':_0xe1f8('0x5c'),'GROUP_CONCAT ASC':_0xe1f8('0x5d'),'GROUP_CONCAT DESC':_0xe1f8('0x5e')};var _0x389360={'SEC_TO_TIME':_0xe1f8('0x5f'),'DATE':'DATE(%s)','HOUR':'HOUR(%s)','ROUND':_0xe1f8('0x62'),'UNIX_TIMESTAMP':_0xe1f8('0x63')};var _0x56fce3=function(_0x1d852e){return!_['includes']([_0xe1f8('0x64'),_0xe1f8('0x65'),'IS\x20EMPTY',_0xe1f8('0x66')],_0x1d852e);};var _0x6774f2=function(_0x58e0bb){if(!_0x58e0bb||!_0x58e0bb['rules'][_0xe1f8('0x39')]){return'';}for(var _0x358eb3='(',_0x25d169=0x0;_0x25d169<_0x58e0bb[_0xe1f8('0x67')][_0xe1f8('0x39')];_0x25d169+=0x1){_0x25d169>0x0&&(_0x358eb3+='\x20'+_0x58e0bb[_0xe1f8('0xa6')]+'\x20');_0x358eb3+=_0x58e0bb['rules'][_0x25d169][_0xe1f8('0x78')]?_0x6774f2(_0x58e0bb['rules'][_0x25d169]['group']):_0x58e0bb[_0xe1f8('0x67')][_0x25d169][_0xe1f8('0x68')]+'\x20'+_0x58e0bb[_0xe1f8('0x67')][_0x25d169][_0xe1f8('0x69')]+(_0x56fce3(_0x58e0bb[_0xe1f8('0x67')][_0x25d169][_0xe1f8('0x69')])?'\x20'+_0x58e0bb[_0xe1f8('0x67')][_0x25d169]['value']:'');}return _0x358eb3+')';};var _0x274f4c={'where':{'id':_0x83f2e8[_0xe1f8('0x52')]['id']}},_0x5d45db,_0x1e48a4,_0x403bb2,_0x4ba515,_0x9405cd;_0x274f4c=_[_0xe1f8('0x41')]({},_0x274f4c,_0x83f2e8['options']);return db[_0xe1f8('0x2f')][_0xe1f8('0x53')](_0x274f4c)[_0xe1f8('0x27')](function(_0x13e96c){if(_0x13e96c){_0x5d45db=_0x13e96c;return _0x13e96c[_0xe1f8('0x6b')]();}return null;})[_0xe1f8('0x27')](function(_0x24f89a){if(_0x24f89a){if(!_0x24f89a['length']){throw new db[(_0xe1f8('0x6c'))][(_0xe1f8('0x6d'))](_0xe1f8('0x6e'),0x193);}_0x1e48a4=_0x24f89a;return db['AnalyticMetric'][_0xe1f8('0x46')]({'raw':!![]});}return null;})[_0xe1f8('0x27')](function(_0x2f8a4d){if(_0x2f8a4d){_0x403bb2=_[_0xe1f8('0x8c')](_0x2f8a4d,'id');var _0x14a27a;var _0x2a6ee6=squel[_0xe1f8('0x70')]();_0x2a6ee6['from'](_0x5d45db[_0xe1f8('0x82')]);for(var _0x324d75=0x0;_0x324d75<_0x1e48a4[_0xe1f8('0x39')];_0x324d75+=0x1){_0x14a27a=_0x1e48a4[_0x324d75][_0xe1f8('0x72')]?_0x403bb2[_0x1e48a4[_0x324d75][_0xe1f8('0x72')]][_0xe1f8('0x73')]:_0x1e48a4[_0x324d75][_0xe1f8('0x68')];_0x14a27a=_0x1e48a4[_0x324d75]['function']?_[_0xe1f8('0x75')](_0x39b21c[_0x1e48a4[_0x324d75][_0xe1f8('0x74')]],'%s',_0x14a27a):_0x14a27a;_0x14a27a=_0x1e48a4[_0x324d75][_0xe1f8('0x76')]?_['replace'](_0x389360[_0x1e48a4[_0x324d75]['format']],'%s',_0x14a27a):_0x14a27a;if(_0x1e48a4[_0x324d75][_0xe1f8('0x77')]){_0x2a6ee6['group'](_0x14a27a);}_0x1e48a4[_0x324d75][_0xe1f8('0x79')]&&_0x2a6ee6[_0xe1f8('0x3c')](_0x14a27a,_0x1e48a4[_0x324d75]['orderBy']==='DESC'?![]:!![]);_0x2a6ee6[_0xe1f8('0x68')](_0x14a27a,_0x1e48a4[_0x324d75]['alias']||_0x14a27a);}if(_0x5d45db[_0xe1f8('0x7d')]){_0x5d45db[_0xe1f8('0x7d')]=JSON[_0xe1f8('0x7c')](_0x5d45db[_0xe1f8('0x7d')]);for(var _0x1296a4=0x0;_0x1296a4<_0x5d45db[_0xe1f8('0x7d')][_0xe1f8('0x39')];_0x1296a4+=0x1){if(_0x5d45db['joins'][_0x1296a4][_0xe1f8('0x30')]&&_['includes'](_0x604292,_0x5d45db[_0xe1f8('0x7d')][_0x1296a4][_0xe1f8('0x30')])&&_0x5d45db['joins'][_0x1296a4][_0xe1f8('0x7f')]&&_0x5d45db[_0xe1f8('0x7d')][_0x1296a4][_0xe1f8('0x80')]&&_0x5d45db['joins'][_0x1296a4]['foreignKey']){_0x2a6ee6[_0x5d45db[_0xe1f8('0x7d')][_0x1296a4]['type']](_0x5d45db['joins'][_0x1296a4][_0xe1f8('0x80')],null,util['format'](_0xe1f8('0x81'),_0x5d45db[_0xe1f8('0x82')],_0x5d45db['joins'][_0x1296a4][_0xe1f8('0x7f')],_0x5d45db[_0xe1f8('0x7d')][_0x1296a4][_0xe1f8('0x80')],_0x5d45db['joins'][_0x1296a4][_0xe1f8('0x83')]));}}}if(_0x5d45db[_0xe1f8('0x84')]){_0x5d45db[_0xe1f8('0x84')]=JSON[_0xe1f8('0x7c')](_0x5d45db[_0xe1f8('0x84')]);_0x2a6ee6[_0xe1f8('0x3e')](_0x6774f2(_0x5d45db[_0xe1f8('0x84')][_0xe1f8('0x78')]));}_0x9405cd=_0x2a6ee6['clone']();_0x2a6ee6[_0xe1f8('0x1e')](_0x26f9ed);_0x2a6ee6[_0xe1f8('0x1b')](0x0);logger[_0xe1f8('0x85')]('Limited\x20Query:',_0x2a6ee6[_0xe1f8('0x87')]());return dbH['sequelize'][_0xe1f8('0x34')](_0x2a6ee6[_0xe1f8('0x87')](),{'type':dbH[_0xe1f8('0xa2')][_0xe1f8('0x88')][_0xe1f8('0xa3')]});}})['then'](function(){return{'sql':_0x9405cd[_0xe1f8('0x87')]()};})[_0xe1f8('0x27')](respondWithResult(_0x4e368b,null))[_0xe1f8('0x47')](handleError(_0x4e368b,null));}; \ No newline at end of file diff --git a/server/api/analyticCustomReport/analyticCustomReport.model.js b/server/api/analyticCustomReport/analyticCustomReport.model.js index 9376dfa..883b5da 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 _0x4871=['../../config/logger','api','moment','bluebird','request-promise','path','../../config/environment','./analyticCustomReport.attributes','exports','AnalyticCustomReport','analytics_custom_reports','util'];(function(_0x44278,_0x1bd66f){var _0x2d97f9=function(_0x18a1a3){while(--_0x18a1a3){_0x44278['push'](_0x44278['shift']());}};_0x2d97f9(++_0x1bd66f);}(_0x4871,0x1c7));var _0x1487=function(_0x1afc76,_0x5ad4e4){_0x1afc76=_0x1afc76-0x0;var _0x3317f0=_0x4871[_0x1afc76];return _0x3317f0;};'use strict';var _=require('lodash');var util=require(_0x1487('0x0'));var logger=require(_0x1487('0x1'))(_0x1487('0x2'));var moment=require(_0x1487('0x3'));var BPromise=require(_0x1487('0x4'));var rp=require(_0x1487('0x5'));var fs=require('fs');var path=require(_0x1487('0x6'));var rimraf=require('rimraf');var config=require(_0x1487('0x7'));var attributes=require(_0x1487('0x8'));module[_0x1487('0x9')]=function(_0x491e88,_0x3fd4fc){return _0x491e88['define'](_0x1487('0xa'),attributes,{'tableName':_0x1487('0xb'),'paranoid':!![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x3175=['AnalyticCustomReport','util','api','moment','bluebird','request-promise','rimraf','../../config/environment','./analyticCustomReport.attributes','exports','define'];(function(_0x5f281d,_0x189164){var _0x1b0a70=function(_0x59e016){while(--_0x59e016){_0x5f281d['push'](_0x5f281d['shift']());}};_0x1b0a70(++_0x189164);}(_0x3175,0x64));var _0x5317=function(_0x271537,_0x8b7b3b){_0x271537=_0x271537-0x0;var _0x19dc22=_0x3175[_0x271537];return _0x19dc22;};'use strict';var _=require('lodash');var util=require(_0x5317('0x0'));var logger=require('../../config/logger')(_0x5317('0x1'));var moment=require(_0x5317('0x2'));var BPromise=require(_0x5317('0x3'));var rp=require(_0x5317('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0x5317('0x5'));var config=require(_0x5317('0x6'));var attributes=require(_0x5317('0x7'));module[_0x5317('0x8')]=function(_0x475c17,_0xf35aa2){return _0x475c17[_0x5317('0x9')](_0x5317('0xa'),attributes,{'tableName':'analytics_custom_reports','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 a46be8d..58420f0 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 _0xfd34=['then','info','AnalyticCustomReport,\x20%s,\x20%s','request\x20sent','debug','AnalyticCustomReport,\x20%s,\x20%s,\x20%s','error','code','message','catch','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','request'];(function(_0xaf910b,_0x30f2ad){var _0x219c23=function(_0x550725){while(--_0x550725){_0xaf910b['push'](_0xaf910b['shift']());}};_0x219c23(++_0x30f2ad);}(_0xfd34,0x1d8));var _0x4fd3=function(_0x377a6e,_0x59b99d){_0x377a6e=_0x377a6e-0x0;var _0x37f751=_0xfd34[_0x377a6e];return _0x37f751;};'use strict';var _=require(_0x4fd3('0x0'));var util=require(_0x4fd3('0x1'));var moment=require('moment');var BPromise=require(_0x4fd3('0x2'));var rs=require(_0x4fd3('0x3'));var fs=require('fs');var Redis=require(_0x4fd3('0x4'));var db=require(_0x4fd3('0x5'))['db'];var utils=require(_0x4fd3('0x6'));var logger=require(_0x4fd3('0x7'))(_0x4fd3('0x8'));var config=require('../../config/environment');var jayson=require(_0x4fd3('0x9'));var client=jayson[_0x4fd3('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x4d5305,_0x350112,_0x2ee466){return new BPromise(function(_0x2bba5d,_0x57991d){return client[_0x4fd3('0xb')](_0x4d5305,_0x2ee466)[_0x4fd3('0xc')](function(_0x15890a){logger[_0x4fd3('0xd')](_0x4fd3('0xe'),_0x350112,_0x4fd3('0xf'));logger[_0x4fd3('0x10')](_0x4fd3('0x11'),_0x350112,_0x4fd3('0xf'),JSON['stringify'](_0x15890a));if(_0x15890a[_0x4fd3('0x12')]){if(_0x15890a[_0x4fd3('0x12')][_0x4fd3('0x13')]===0x1f4){logger[_0x4fd3('0x12')](_0x4fd3('0xe'),_0x350112,_0x15890a['error'][_0x4fd3('0x14')]);return _0x57991d(_0x15890a['error']['message']);}logger[_0x4fd3('0x12')](_0x4fd3('0xe'),_0x350112,_0x15890a['error'][_0x4fd3('0x14')]);return _0x2bba5d(_0x15890a[_0x4fd3('0x12')][_0x4fd3('0x14')]);}else{logger[_0x4fd3('0xd')]('AnalyticCustomReport,\x20%s,\x20%s',_0x350112,_0x4fd3('0xf'));_0x2bba5d(_0x15890a['result'][_0x4fd3('0x14')]);}})[_0x4fd3('0x15')](function(_0x130d8a){logger[_0x4fd3('0x12')](_0x4fd3('0xe'),_0x350112,_0x130d8a);_0x57991d(_0x130d8a);});});} \ No newline at end of file +var _0xd323=['code','message','result','lodash','util','bluebird','ioredis','../../config/utils','../../config/logger','../../config/environment','jayson/promise','http','then','info','AnalyticCustomReport,\x20%s,\x20%s','request\x20sent','debug','AnalyticCustomReport,\x20%s,\x20%s,\x20%s','stringify','error'];(function(_0x11d3d8,_0x536d6e){var _0x192a7c=function(_0x3ef387){while(--_0x3ef387){_0x11d3d8['push'](_0x11d3d8['shift']());}};_0x192a7c(++_0x536d6e);}(_0xd323,0x107));var _0x3d32=function(_0x5b644e,_0x2e5e07){_0x5b644e=_0x5b644e-0x0;var _0x49c6bf=_0xd323[_0x5b644e];return _0x49c6bf;};'use strict';var _=require(_0x3d32('0x0'));var util=require(_0x3d32('0x1'));var moment=require('moment');var BPromise=require(_0x3d32('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x3d32('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x3d32('0x4'));var logger=require(_0x3d32('0x5'))('rpc');var config=require(_0x3d32('0x6'));var jayson=require(_0x3d32('0x7'));var client=jayson['client'][_0x3d32('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x572872,_0x48962f,_0x4e4222){return new BPromise(function(_0x312d44,_0x7e2abc){return client['request'](_0x572872,_0x4e4222)[_0x3d32('0x9')](function(_0x10665b){logger[_0x3d32('0xa')](_0x3d32('0xb'),_0x48962f,_0x3d32('0xc'));logger[_0x3d32('0xd')](_0x3d32('0xe'),_0x48962f,_0x3d32('0xc'),JSON[_0x3d32('0xf')](_0x10665b));if(_0x10665b[_0x3d32('0x10')]){if(_0x10665b['error'][_0x3d32('0x11')]===0x1f4){logger['error']('AnalyticCustomReport,\x20%s,\x20%s',_0x48962f,_0x10665b['error'][_0x3d32('0x12')]);return _0x7e2abc(_0x10665b[_0x3d32('0x10')][_0x3d32('0x12')]);}logger['error']('AnalyticCustomReport,\x20%s,\x20%s',_0x48962f,_0x10665b[_0x3d32('0x10')][_0x3d32('0x12')]);return _0x312d44(_0x10665b['error'][_0x3d32('0x12')]);}else{logger[_0x3d32('0xa')]('AnalyticCustomReport,\x20%s,\x20%s',_0x48962f,_0x3d32('0xc'));_0x312d44(_0x10665b[_0x3d32('0x13')][_0x3d32('0x12')]);}})['catch'](function(_0x55b4df){logger[_0x3d32('0x10')](_0x3d32('0xb'),_0x48962f,_0x55b4df);_0x7e2abc(_0x55b4df);});});} \ No newline at end of file diff --git a/server/api/analyticCustomReport/index.js b/server/api/analyticCustomReport/index.js index 25204a0..54c44bd 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 _0x7dc6=['index','show','/:id/preview','preview','/:id/run','run','/:id/query','query','post','create','put','update','delete','/:id','destroy','exports','multer','util','path','express','Router','../../components/auth/service','../../components/interaction/service','./analyticCustomReport.controller','get','isAuthenticated'];(function(_0x5f4552,_0xd26590){var _0x13f878=function(_0x30bf96){while(--_0x30bf96){_0x5f4552['push'](_0x5f4552['shift']());}};_0x13f878(++_0xd26590);}(_0x7dc6,0x148));var _0x67dc=function(_0x23f9da,_0x29e580){_0x23f9da=_0x23f9da-0x0;var _0x304147=_0x7dc6[_0x23f9da];return _0x304147;};'use strict';var multer=require(_0x67dc('0x0'));var util=require(_0x67dc('0x1'));var path=require(_0x67dc('0x2'));var timeout=require('connect-timeout');var express=require(_0x67dc('0x3'));var router=express[_0x67dc('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0x67dc('0x5'));var interaction=require(_0x67dc('0x6'));var config=require('../../config/environment');var controller=require(_0x67dc('0x7'));router[_0x67dc('0x8')]('/',auth[_0x67dc('0x9')](),controller[_0x67dc('0xa')]);router['get']('/:id',auth['isAuthenticated'](),controller[_0x67dc('0xb')]);router[_0x67dc('0x8')](_0x67dc('0xc'),auth['isAuthenticated'](),controller[_0x67dc('0xd')]);router[_0x67dc('0x8')](_0x67dc('0xe'),auth[_0x67dc('0x9')](),controller[_0x67dc('0xf')]);router[_0x67dc('0x8')](_0x67dc('0x10'),auth[_0x67dc('0x9')](),controller[_0x67dc('0x11')]);router[_0x67dc('0x12')]('/',auth[_0x67dc('0x9')](),controller[_0x67dc('0x13')]);router[_0x67dc('0x14')]('/:id',auth['isAuthenticated'](),controller[_0x67dc('0x15')]);router[_0x67dc('0x16')](_0x67dc('0x17'),auth['isAuthenticated'](),controller[_0x67dc('0x18')]);module[_0x67dc('0x19')]=router; \ No newline at end of file +var _0xc572=['index','/:id','show','/:id/preview','preview','get','/:id/run','/:id/query','query','post','create','update','delete','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../config/environment','isAuthenticated'];(function(_0x18c064,_0x4db1da){var _0x2a99a3=function(_0xaaf892){while(--_0xaaf892){_0x18c064['push'](_0x18c064['shift']());}};_0x2a99a3(++_0x4db1da);}(_0xc572,0x17d));var _0x2c57=function(_0x4da3a9,_0xfba33c){_0x4da3a9=_0x4da3a9-0x0;var _0x32950c=_0xc572[_0x4da3a9];return _0x32950c;};'use strict';var multer=require(_0x2c57('0x0'));var util=require(_0x2c57('0x1'));var path=require(_0x2c57('0x2'));var timeout=require(_0x2c57('0x3'));var express=require(_0x2c57('0x4'));var router=express[_0x2c57('0x5')]();var fs_extra=require(_0x2c57('0x6'));var auth=require(_0x2c57('0x7'));var interaction=require('../../components/interaction/service');var config=require(_0x2c57('0x8'));var controller=require('./analyticCustomReport.controller');router['get']('/',auth[_0x2c57('0x9')](),controller[_0x2c57('0xa')]);router['get'](_0x2c57('0xb'),auth['isAuthenticated'](),controller[_0x2c57('0xc')]);router['get'](_0x2c57('0xd'),auth['isAuthenticated'](),controller[_0x2c57('0xe')]);router[_0x2c57('0xf')](_0x2c57('0x10'),auth[_0x2c57('0x9')](),controller['run']);router[_0x2c57('0xf')](_0x2c57('0x11'),auth[_0x2c57('0x9')](),controller[_0x2c57('0x12')]);router[_0x2c57('0x13')]('/',auth[_0x2c57('0x9')](),controller[_0x2c57('0x14')]);router['put'](_0x2c57('0xb'),auth[_0x2c57('0x9')](),controller[_0x2c57('0x15')]);router[_0x2c57('0x16')](_0x2c57('0xb'),auth[_0x2c57('0x9')](),controller['destroy']);module['exports']=router; \ No newline at end of file diff --git a/server/api/analyticDefaultReport/analyticDefaultReport.attributes.js b/server/api/analyticDefaultReport/analyticDefaultReport.attributes.js index ce19ec9..131dc31 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 _0x687b=['STRING','TEXT','sequelize','exports'];(function(_0x2716c6,_0x38dd17){var _0x518dc2=function(_0x36e9e9){while(--_0x36e9e9){_0x2716c6['push'](_0x2716c6['shift']());}};_0x518dc2(++_0x38dd17);}(_0x687b,0x14a));var _0xb687=function(_0x30994d,_0x2cc269){_0x30994d=_0x30994d-0x0;var _0x4554df=_0x687b[_0x30994d];return _0x4554df;};'use strict';var Sequelize=require(_0xb687('0x0'));module[_0xb687('0x1')]={'name':{'type':Sequelize[_0xb687('0x2')],'allowNull':![]},'description':{'type':Sequelize[_0xb687('0x2')]},'parent':{'type':Sequelize['STRING']},'table':{'type':Sequelize['STRING']},'conditions':{'type':Sequelize[_0xb687('0x3')]},'joins':{'type':Sequelize[_0xb687('0x3')]}}; \ No newline at end of file +var _0x24ca=['sequelize','STRING','TEXT'];(function(_0x2f1172,_0x5f5b26){var _0x58e374=function(_0x1a61fa){while(--_0x1a61fa){_0x2f1172['push'](_0x2f1172['shift']());}};_0x58e374(++_0x5f5b26);}(_0x24ca,0x1bc));var _0xa24c=function(_0x3e0b8f,_0x1cddeb){_0x3e0b8f=_0x3e0b8f-0x0;var _0x22f742=_0x24ca[_0x3e0b8f];return _0x22f742;};'use strict';var Sequelize=require(_0xa24c('0x0'));module['exports']={'name':{'type':Sequelize[_0xa24c('0x1')],'allowNull':![]},'description':{'type':Sequelize[_0xa24c('0x1')]},'parent':{'type':Sequelize[_0xa24c('0x1')]},'table':{'type':Sequelize['STRING']},'conditions':{'type':Sequelize[_0xa24c('0x2')]},'joins':{'type':Sequelize[_0xa24c('0x2')]}}; \ No newline at end of file diff --git a/server/api/analyticDefaultReport/analyticDefaultReport.controller.js b/server/api/analyticDefaultReport/analyticDefaultReport.controller.js index b880bc2..09c3797 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 _0xe2fe=['set','Content-Range','apply','reject','save','then','destroy','get','DefaultReports','UserProfileResource','sendStatus','error','name','send','index','AnalyticDefaultReport','rawAttributes','fieldName','map','keys','query','filters','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','options','include','findAll','rows','catch','show','params','includeAll','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','Reports','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','preview','join','right_join','cross_join','SUM(%s)','COUNT(%s)','MAX(%s)','MIN(%s)','AVG(%s)','GROUP_CONCAT(%s)','HOUR(%s)','UNIX_TIMESTAMP(%s)','includes','IS\x20NULL','IS\x20NOT\x20NULL','rules','operator','group','field','condition','value','Sequelize','ValidationErrorItem','Please\x20insert\x20at\x20least\x20one\x20field','AnalyticMetric','keyBy','select','from','MetricId','metric','function','replace','groupBy','orderBy','alias','joins','parse','type','foreignTable','%s.%s\x20=\x20%s.%s','table','parentKey','conditions','clone','debug','Limited\x20Query:','toString','sequelize','QueryTypes','SELECT','left_join','SEC_TO_TIME(%s)','ROUND(%s)','IS\x20EMPTY','getFields','format','foreignKey','web','%s-%s.%s','randomstring','generate','output','default','AnalyticExtractedReport','cdr','.calldate\x20BETWEEN\x20?\x20AND\x20?','startDate','endDate','info','Run\x20Query:','child_process','../../components/export/','savename','countTable','COUNT(*)','run','runReport','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)','IS\x20NOT\x20EMPTY','eml-format','fast-json-patch','moment','bluebird','mustache','util','path','to-csv','ejs','lodash','squel','jsforce','querystring','ioredis','../../components/auth/service','api','../../mysqldb','dbH','status','json','offset','limit','undefined','count'];(function(_0x17bb19,_0x22872e){var _0x582be9=function(_0x10e563){while(--_0x10e563){_0x17bb19['push'](_0x17bb19['shift']());}};_0x582be9(++_0x22872e);}(_0xe2fe,0x86));var _0xee2f=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xe2fe[_0x3dd15e];return _0x231fd0;};'use strict';var emlformat=require(_0xee2f('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0xee2f('0x1'));var rp=require('request-promise');var moment=require(_0xee2f('0x2'));var BPromise=require(_0xee2f('0x3'));var Mustache=require(_0xee2f('0x4'));var util=require(_0xee2f('0x5'));var path=require(_0xee2f('0x6'));var sox=require('sox');var csv=require(_0xee2f('0x7'));var ejs=require(_0xee2f('0x8'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xee2f('0x9'));var squel=require(_0xee2f('0xa'));var crypto=require('crypto');var jsforce=require(_0xee2f('0xb'));var deskjs=require('desk.js');var toCsv=require(_0xee2f('0x7'));var querystring=require(_0xee2f('0xc'));var Papa=require('papaparse');var Redis=require(_0xee2f('0xd'));var authService=require(_0xee2f('0xe'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0xee2f('0xf'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0xee2f('0x10'))['db'];var dbH=require(_0xee2f('0x10'))[_0xee2f('0x11')];function respondWithStatusCode(_0x100449,_0x131874){_0x131874=_0x131874||0xcc;return function(_0x3ab91f){if(_0x3ab91f){return _0x100449['sendStatus'](_0x131874);}return _0x100449[_0xee2f('0x12')](_0x131874)['end']();};}function respondWithResult(_0x36db10,_0x271c1d){_0x271c1d=_0x271c1d||0xc8;return function(_0x48b30c){if(_0x48b30c){return _0x36db10[_0xee2f('0x12')](_0x271c1d)[_0xee2f('0x13')](_0x48b30c);}};}function respondWithFilteredResult(_0x28b614,_0x1bbf7d){return function(_0x390c2c){if(_0x390c2c){var _0x58f42a=typeof _0x1bbf7d[_0xee2f('0x14')]==='undefined'&&typeof _0x1bbf7d[_0xee2f('0x15')]===_0xee2f('0x16');var _0x502eb6=_0x390c2c['count'];var _0x40b5bc=_0x58f42a?0x0:_0x1bbf7d['offset'];var _0x69db88=_0x58f42a?_0x390c2c[_0xee2f('0x17')]:_0x1bbf7d[_0xee2f('0x14')]+_0x1bbf7d['limit'];var _0x35e1a4;if(_0x69db88>=_0x502eb6){_0x69db88=_0x502eb6;_0x35e1a4=0xc8;}else{_0x35e1a4=0xce;}_0x28b614[_0xee2f('0x12')](_0x35e1a4);return _0x28b614[_0xee2f('0x18')](_0xee2f('0x19'),_0x40b5bc+'-'+_0x69db88+'/'+_0x502eb6)[_0xee2f('0x13')](_0x390c2c);}return null;};}function patchUpdates(_0x5d36d4){return function(_0x5e73ad){try{jsonpatch[_0xee2f('0x1a')](_0x5e73ad,_0x5d36d4,!![]);}catch(_0x3a1852){return BPromise[_0xee2f('0x1b')](_0x3a1852);}return _0x5e73ad[_0xee2f('0x1c')]();};}function saveUpdates(_0x472e3b,_0xf278cc){return function(_0x39a39c){if(_0x39a39c){return _0x39a39c['update'](_0x472e3b)[_0xee2f('0x1d')](function(_0x2c47c5){return _0x2c47c5;});}return null;};}function removeEntity(_0x15ceda,_0x70e308){return function(_0x820101){if(_0x820101){return _0x820101[_0xee2f('0x1e')]()[_0xee2f('0x1d')](function(){var _0x13013f=_0x820101[_0xee2f('0x1f')]({'plain':!![]});var _0x1e394f=_0xee2f('0x20');return db[_0xee2f('0x21')][_0xee2f('0x1e')]({'where':{'type':_0x1e394f,'resourceId':_0x13013f['id']}})[_0xee2f('0x1d')](function(){return _0x820101;});})['then'](function(){_0x15ceda['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x18bdbb,_0x18ff19){return function(_0x2cb0cb){if(!_0x2cb0cb){_0x18bdbb[_0xee2f('0x22')](0x194);}return _0x2cb0cb;};}function handleError(_0x892a4e,_0x3737fd){_0x3737fd=_0x3737fd||0x1f4;return function(_0x4d8398){logger[_0xee2f('0x23')](_0x4d8398['stack']);if(_0x4d8398[_0xee2f('0x24')]){delete _0x4d8398[_0xee2f('0x24')];}_0x892a4e[_0xee2f('0x12')](_0x3737fd)[_0xee2f('0x25')](_0x4d8398);};}exports[_0xee2f('0x26')]=function(_0x47d5a6,_0x310c0b){var _0xd16e35={},_0x56706e={},_0x4ee0e1={'count':0x0,'rows':[]};var _0xd1aaac=_['map'](db[_0xee2f('0x27')][_0xee2f('0x28')],function(_0x53d9b7){return{'name':_0x53d9b7[_0xee2f('0x29')],'type':_0x53d9b7['type']['key']};});_0x56706e['model']=_[_0xee2f('0x2a')](_0xd1aaac,_0xee2f('0x24'));_0x56706e['query']=_[_0xee2f('0x2b')](_0x47d5a6[_0xee2f('0x2c')]);_0x56706e[_0xee2f('0x2d')]=_[_0xee2f('0x2e')](_0x56706e[_0xee2f('0x2f')],_0x56706e['query']);_0xd16e35[_0xee2f('0x30')]=_['intersection'](_0x56706e[_0xee2f('0x2f')],qs[_0xee2f('0x31')](_0x47d5a6[_0xee2f('0x2c')]['fields']));_0xd16e35[_0xee2f('0x30')]=_0xd16e35['attributes'][_0xee2f('0x32')]?_0xd16e35['attributes']:_0x56706e[_0xee2f('0x2f')];if(!_0x47d5a6[_0xee2f('0x2c')][_0xee2f('0x33')](_0xee2f('0x34'))){_0xd16e35[_0xee2f('0x15')]=qs[_0xee2f('0x15')](_0x47d5a6[_0xee2f('0x2c')][_0xee2f('0x15')]);_0xd16e35[_0xee2f('0x14')]=qs[_0xee2f('0x14')](_0x47d5a6[_0xee2f('0x2c')]['offset']);}_0xd16e35[_0xee2f('0x35')]=qs['sort'](_0x47d5a6[_0xee2f('0x2c')][_0xee2f('0x36')]);_0xd16e35[_0xee2f('0x37')]=qs[_0xee2f('0x2d')](_[_0xee2f('0x38')](_0x47d5a6[_0xee2f('0x2c')],_0x56706e[_0xee2f('0x2d')]),_0xd1aaac);if(_0x47d5a6[_0xee2f('0x2c')]['filter']){_0xd16e35['where']=_['merge'](_0xd16e35[_0xee2f('0x37')],{'$or':_['map'](_0xd1aaac,function(_0x4501c4){if(_0x4501c4['type']!=='VIRTUAL'){var _0x5027a6={};_0x5027a6[_0x4501c4['name']]={'$like':'%'+_0x47d5a6[_0xee2f('0x2c')][_0xee2f('0x39')]+'%'};return _0x5027a6;}})});}_0xd16e35=_[_0xee2f('0x3a')]({},_0xd16e35,_0x47d5a6[_0xee2f('0x3b')]);var _0x4823a7={'where':_0xd16e35['where']};return db[_0xee2f('0x27')]['count'](_0x4823a7)['then'](function(_0x8204dc){_0x4ee0e1[_0xee2f('0x17')]=_0x8204dc;if(_0x47d5a6[_0xee2f('0x2c')]['includeAll']){_0xd16e35[_0xee2f('0x3c')]=[{'all':!![]}];}return db[_0xee2f('0x27')][_0xee2f('0x3d')](_0xd16e35);})['then'](function(_0x5896f6){_0x4ee0e1[_0xee2f('0x3e')]=_0x5896f6;return _0x4ee0e1;})[_0xee2f('0x1d')](respondWithFilteredResult(_0x310c0b,_0xd16e35))[_0xee2f('0x3f')](handleError(_0x310c0b,null));};exports[_0xee2f('0x40')]=function(_0x541fa0,_0x20697e){var _0x1df63d={'raw':!![],'where':{'id':_0x541fa0[_0xee2f('0x41')]['id']}},_0x242e91={};_0x242e91[_0xee2f('0x2f')]=_[_0xee2f('0x2b')](db[_0xee2f('0x27')][_0xee2f('0x28')]);_0x242e91[_0xee2f('0x2c')]=_[_0xee2f('0x2b')](_0x541fa0['query']);_0x242e91['filters']=_['intersection'](_0x242e91['model'],_0x242e91[_0xee2f('0x2c')]);_0x1df63d[_0xee2f('0x30')]=_[_0xee2f('0x2e')](_0x242e91[_0xee2f('0x2f')],qs[_0xee2f('0x31')](_0x541fa0['query'][_0xee2f('0x31')]));_0x1df63d[_0xee2f('0x30')]=_0x1df63d[_0xee2f('0x30')][_0xee2f('0x32')]?_0x1df63d['attributes']:_0x242e91['model'];if(_0x541fa0['query'][_0xee2f('0x42')]){_0x1df63d['include']=[{'all':!![]}];}_0x1df63d=_['merge']({},_0x1df63d,_0x541fa0['options']);return db['AnalyticDefaultReport'][_0xee2f('0x43')](_0x1df63d)[_0xee2f('0x1d')](handleEntityNotFound(_0x20697e,null))[_0xee2f('0x1d')](respondWithResult(_0x20697e,null))['catch'](handleError(_0x20697e,null));};exports[_0xee2f('0x44')]=function(_0x57f65d,_0x3d95b8){return db[_0xee2f('0x27')][_0xee2f('0x44')](_0x57f65d[_0xee2f('0x45')],{})[_0xee2f('0x1d')](function(_0x4978eb){var _0x533ad0=_0x57f65d[_0xee2f('0x46')]['get']({'plain':!![]});if(!_0x533ad0)throw new Error(_0xee2f('0x47'));if(_0x533ad0[_0xee2f('0x48')]===_0xee2f('0x46')){var _0x88e683=_0x4978eb['get']({'plain':!![]});var _0x5df503=_0xee2f('0x49');return db[_0xee2f('0x4a')][_0xee2f('0x43')]({'where':{'name':_0x5df503,'userProfileId':_0x533ad0[_0xee2f('0x4b')]},'raw':!![]})[_0xee2f('0x1d')](function(_0x2a450f){if(_0x2a450f&&_0x2a450f[_0xee2f('0x4c')]===0x0){return db[_0xee2f('0x21')][_0xee2f('0x44')]({'name':_0x88e683[_0xee2f('0x24')],'resourceId':_0x88e683['id'],'type':_0xee2f('0x20'),'sectionId':_0x2a450f['id']},{})[_0xee2f('0x1d')](function(){return _0x4978eb;});}else{return _0x4978eb;}})['catch'](function(_0x34cb51){logger[_0xee2f('0x23')](_0xee2f('0x4d'),_0x34cb51);throw _0x34cb51;});}return _0x4978eb;})[_0xee2f('0x1d')](respondWithResult(_0x3d95b8,0xc9))['catch'](handleError(_0x3d95b8,null));};exports[_0xee2f('0x4e')]=function(_0xb3bf3f,_0x3a476f){if(_0xb3bf3f[_0xee2f('0x45')]['id']){delete _0xb3bf3f[_0xee2f('0x45')]['id'];}return db['AnalyticDefaultReport'][_0xee2f('0x43')]({'where':{'id':_0xb3bf3f['params']['id']}})['then'](handleEntityNotFound(_0x3a476f,null))[_0xee2f('0x1d')](saveUpdates(_0xb3bf3f[_0xee2f('0x45')],null))[_0xee2f('0x1d')](respondWithResult(_0x3a476f,null))[_0xee2f('0x3f')](handleError(_0x3a476f,null));};exports[_0xee2f('0x1e')]=function(_0x101e09,_0x20aaca){return db['AnalyticDefaultReport'][_0xee2f('0x43')]({'where':{'id':_0x101e09[_0xee2f('0x41')]['id']}})[_0xee2f('0x1d')](handleEntityNotFound(_0x20aaca,null))[_0xee2f('0x1d')](removeEntity(_0x20aaca,null))[_0xee2f('0x3f')](handleError(_0x20aaca,null));};exports[_0xee2f('0x4f')]=function(_0xcba6fc,_0x2b9636){var _0x1373a1=0xa;var _0x5d6c40=[_0xee2f('0x50'),'left_join',_0xee2f('0x51'),_0xee2f('0x52')];var _0x1dbbf2={'SUM':_0xee2f('0x53'),'COUNT':_0xee2f('0x54'),'COUNT DISTINCT':'COUNT(DISTINCT\x20%s)','MAX':_0xee2f('0x55'),'MIN':_0xee2f('0x56'),'AVG':_0xee2f('0x57'),'GROUP_CONCAT':_0xee2f('0x58'),'GROUP_CONCAT ASC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','GROUP_CONCAT DESC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)'};var _0x4fb159={'SEC_TO_TIME':'SEC_TO_TIME(%s)','DATE':'DATE(%s)','HOUR':_0xee2f('0x59'),'ROUND':'ROUND(%s)','UNIX_TIMESTAMP':_0xee2f('0x5a')};var _0x1421da=function(_0xd967e9){return!_[_0xee2f('0x5b')]([_0xee2f('0x5c'),_0xee2f('0x5d'),'IS\x20EMPTY','IS\x20NOT\x20EMPTY'],_0xd967e9);};var _0x1708c5=function(_0x58e464){if(!_0x58e464||!_0x58e464[_0xee2f('0x5e')]['length']){return'';}for(var _0x7167f9='(',_0x59af84=0x0;_0x59af84<_0x58e464[_0xee2f('0x5e')][_0xee2f('0x32')];_0x59af84+=0x1){_0x59af84>0x0&&(_0x7167f9+='\x20'+_0x58e464[_0xee2f('0x5f')]+'\x20');_0x7167f9+=_0x58e464['rules'][_0x59af84][_0xee2f('0x60')]?_0x1708c5(_0x58e464[_0xee2f('0x5e')][_0x59af84][_0xee2f('0x60')]):_0x58e464[_0xee2f('0x5e')][_0x59af84][_0xee2f('0x61')]+'\x20'+_0x58e464[_0xee2f('0x5e')][_0x59af84][_0xee2f('0x62')]+(_0x1421da(_0x58e464['rules'][_0x59af84][_0xee2f('0x62')])?'\x20'+_0x58e464[_0xee2f('0x5e')][_0x59af84][_0xee2f('0x63')]:'');}return _0x7167f9+')';};var _0x353bd9={'where':{'id':_0xcba6fc[_0xee2f('0x41')]['id']}},_0x5280c7,_0x3c9d47,_0x8ccc9d,_0x15c7ff,_0x191af8;_0x353bd9=_[_0xee2f('0x3a')]({},_0x353bd9,_0xcba6fc['options']);return db[_0xee2f('0x27')][_0xee2f('0x43')](_0x353bd9)['then'](function(_0x9252e3){if(_0x9252e3){_0x5280c7=_0x9252e3;return _0x9252e3['getFields']();}return null;})[_0xee2f('0x1d')](function(_0x4ed7c9){if(_0x4ed7c9){if(!_0x4ed7c9['length']){throw new db[(_0xee2f('0x64'))][(_0xee2f('0x65'))](_0xee2f('0x66'),0x193);}_0x3c9d47=_0x4ed7c9;return db[_0xee2f('0x67')][_0xee2f('0x3d')]({'raw':!![]});}return null;})['then'](function(_0x238e7d){if(_0x238e7d){_0x8ccc9d=_[_0xee2f('0x68')](_0x238e7d,'id');var _0x42fae8;var _0x5d4fe8=squel[_0xee2f('0x69')]();_0x5d4fe8[_0xee2f('0x6a')](_0x5280c7['table']);for(var _0x1f1c55=0x0;_0x1f1c55<_0x3c9d47[_0xee2f('0x32')];_0x1f1c55+=0x1){_0x42fae8=_0x3c9d47[_0x1f1c55][_0xee2f('0x6b')]?_0x8ccc9d[_0x3c9d47[_0x1f1c55][_0xee2f('0x6b')]][_0xee2f('0x6c')]:_0x3c9d47[_0x1f1c55][_0xee2f('0x61')];_0x42fae8=_0x3c9d47[_0x1f1c55][_0xee2f('0x6d')]?_[_0xee2f('0x6e')](_0x1dbbf2[_0x3c9d47[_0x1f1c55][_0xee2f('0x6d')]],'%s',_0x42fae8):_0x42fae8;_0x42fae8=_0x3c9d47[_0x1f1c55]['format']?_['replace'](_0x4fb159[_0x3c9d47[_0x1f1c55]['format']],'%s',_0x42fae8):_0x42fae8;if(_0x3c9d47[_0x1f1c55][_0xee2f('0x6f')]){_0x5d4fe8[_0xee2f('0x60')](_0x42fae8);}_0x3c9d47[_0x1f1c55][_0xee2f('0x70')]&&_0x5d4fe8[_0xee2f('0x35')](_0x42fae8,_0x3c9d47[_0x1f1c55][_0xee2f('0x70')]==='DESC'?![]:!![]);_0x5d4fe8[_0xee2f('0x61')](_0x42fae8,_0x3c9d47[_0x1f1c55][_0xee2f('0x71')]||_0x42fae8);}if(_0x5280c7['joins']){_0x5280c7[_0xee2f('0x72')]=JSON[_0xee2f('0x73')](_0x5280c7[_0xee2f('0x72')]);for(var _0x5a7b6c=0x0;_0x5a7b6c<_0x5280c7[_0xee2f('0x72')]['length'];_0x5a7b6c+=0x1){if(_0x5280c7[_0xee2f('0x72')][_0x5a7b6c][_0xee2f('0x74')]&&_['includes'](_0x5d6c40,_0x5280c7[_0xee2f('0x72')][_0x5a7b6c][_0xee2f('0x74')])&&_0x5280c7['joins'][_0x5a7b6c]['parentKey']&&_0x5280c7['joins'][_0x5a7b6c][_0xee2f('0x75')]&&_0x5280c7['joins'][_0x5a7b6c]['foreignKey']){_0x5d4fe8[_0x5280c7[_0xee2f('0x72')][_0x5a7b6c][_0xee2f('0x74')]](_0x5280c7['joins'][_0x5a7b6c][_0xee2f('0x75')],null,util['format'](_0xee2f('0x76'),_0x5280c7[_0xee2f('0x77')],_0x5280c7[_0xee2f('0x72')][_0x5a7b6c][_0xee2f('0x78')],_0x5280c7[_0xee2f('0x72')][_0x5a7b6c][_0xee2f('0x75')],_0x5280c7[_0xee2f('0x72')][_0x5a7b6c]['foreignKey']));}}}if(_0x5280c7[_0xee2f('0x79')]){_0x5280c7[_0xee2f('0x79')]=JSON[_0xee2f('0x73')](_0x5280c7[_0xee2f('0x79')]);_0x5d4fe8[_0xee2f('0x37')](_0x1708c5(_0x5280c7['conditions'][_0xee2f('0x60')]));}_0x191af8=_0x5d4fe8[_0xee2f('0x7a')]();_0x5d4fe8[_0xee2f('0x15')](_0x1373a1);_0x5d4fe8[_0xee2f('0x14')](0x0);logger[_0xee2f('0x7b')](_0xee2f('0x7c'),_0x5d4fe8['toString']());return dbH['sequelize'][_0xee2f('0x2c')](_0x5d4fe8[_0xee2f('0x7d')](),{'type':dbH[_0xee2f('0x7e')][_0xee2f('0x7f')][_0xee2f('0x80')]});}})[_0xee2f('0x1d')](respondWithResult(_0x2b9636,null))[_0xee2f('0x3f')](handleError(_0x2b9636,null));};function runReport(_0x58c49e,_0x5b7b55,_0x2ad26d){var _0x27eabc=_0x5b7b55[_0xee2f('0x24')];var _0xc92046=0xa;var _0x38ee46=[_0xee2f('0x50'),_0xee2f('0x81'),_0xee2f('0x51'),_0xee2f('0x52')];var _0x21ac2d={'SUM':_0xee2f('0x53'),'COUNT':_0xee2f('0x54'),'COUNT DISTINCT':'COUNT(DISTINCT\x20%s)','MAX':'MAX(%s)','MIN':_0xee2f('0x56'),'AVG':'AVG(%s)','GROUP_CONCAT':'GROUP_CONCAT(%s)','GROUP_CONCAT ASC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','GROUP_CONCAT DESC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)'};var _0x2ea31f={'SEC_TO_TIME':_0xee2f('0x82'),'DATE':'DATE(%s)','HOUR':'HOUR(%s)','ROUND':_0xee2f('0x83'),'UNIX_TIMESTAMP':_0xee2f('0x5a')};var _0x18e191=function(_0x4fad8f){return!_['includes']([_0xee2f('0x5c'),_0xee2f('0x5d'),_0xee2f('0x84'),'IS\x20NOT\x20EMPTY'],_0x4fad8f);};var _0xd7c8f8=function(_0x4b0611){if(!_0x4b0611||!_0x4b0611[_0xee2f('0x5e')]['length']){return'';}for(var _0x378fc9='(',_0x25a3b9=0x0;_0x25a3b9<_0x4b0611[_0xee2f('0x5e')]['length'];_0x25a3b9+=0x1){_0x25a3b9>0x0&&(_0x378fc9+='\x20'+_0x4b0611['operator']+'\x20');_0x378fc9+=_0x4b0611[_0xee2f('0x5e')][_0x25a3b9][_0xee2f('0x60')]?_0xd7c8f8(_0x4b0611[_0xee2f('0x5e')][_0x25a3b9]['group']):_0x4b0611[_0xee2f('0x5e')][_0x25a3b9][_0xee2f('0x61')]+'\x20'+_0x4b0611[_0xee2f('0x5e')][_0x25a3b9][_0xee2f('0x62')]+(_0x18e191(_0x4b0611[_0xee2f('0x5e')][_0x25a3b9][_0xee2f('0x62')])?'\x20'+_0x4b0611[_0xee2f('0x5e')][_0x25a3b9][_0xee2f('0x63')]:'');}return _0x378fc9+')';};var _0x449656={'where':{'id':_0x58c49e['id']}},_0x1db0b5,_0x9f06f9,_0x659080,_0x28bde7,_0x214f94;_0x449656=_['merge']({},_0x449656,_0x2ad26d);return db[_0xee2f('0x27')][_0xee2f('0x43')](_0x449656)[_0xee2f('0x1d')](function(_0x2f5ed7){if(_0x2f5ed7){_0x1db0b5=_0x2f5ed7;return _0x2f5ed7[_0xee2f('0x85')]();}return null;})[_0xee2f('0x1d')](function(_0x34cd09){if(_0x34cd09){if(!_0x34cd09[_0xee2f('0x32')]){throw new db[(_0xee2f('0x64'))][(_0xee2f('0x65'))](_0xee2f('0x66'),0x193);}_0x9f06f9=_0x34cd09;return db['AnalyticMetric'][_0xee2f('0x3d')]({'raw':!![]});}return null;})[_0xee2f('0x1d')](function(_0x1422e9){if(_0x1422e9){_0x659080=_[_0xee2f('0x68')](_0x1422e9,'id');var _0x53d769;var _0x15ca4e=squel[_0xee2f('0x69')]();_0x15ca4e[_0xee2f('0x6a')](_0x1db0b5['table']);for(var _0x4f02aa=0x0;_0x4f02aa<_0x9f06f9[_0xee2f('0x32')];_0x4f02aa+=0x1){_0x53d769=_0x9f06f9[_0x4f02aa]['MetricId']?_0x659080[_0x9f06f9[_0x4f02aa]['MetricId']]['metric']:_0x9f06f9[_0x4f02aa][_0xee2f('0x61')];_0x53d769=_0x9f06f9[_0x4f02aa][_0xee2f('0x6d')]?_[_0xee2f('0x6e')](_0x21ac2d[_0x9f06f9[_0x4f02aa][_0xee2f('0x6d')]],'%s',_0x53d769):_0x53d769;_0x53d769=_0x9f06f9[_0x4f02aa]['format']?_[_0xee2f('0x6e')](_0x2ea31f[_0x9f06f9[_0x4f02aa][_0xee2f('0x86')]],'%s',_0x53d769):_0x53d769;if(_0x9f06f9[_0x4f02aa][_0xee2f('0x6f')]){_0x15ca4e['group'](_0x53d769);}_0x9f06f9[_0x4f02aa][_0xee2f('0x70')]&&_0x15ca4e['order'](_0x53d769,_0x9f06f9[_0x4f02aa][_0xee2f('0x70')]==='DESC'?![]:!![]);_0x15ca4e['field'](_0x53d769,_0x9f06f9[_0x4f02aa][_0xee2f('0x71')]||_0x53d769);}if(_0x1db0b5['joins']){_0x1db0b5[_0xee2f('0x72')]=JSON['parse'](_0x1db0b5['joins']);for(var _0x149d7f=0x0;_0x149d7f<_0x1db0b5[_0xee2f('0x72')]['length'];_0x149d7f+=0x1){if(_0x1db0b5[_0xee2f('0x72')][_0x149d7f][_0xee2f('0x74')]&&_['includes'](_0x38ee46,_0x1db0b5['joins'][_0x149d7f][_0xee2f('0x74')])&&_0x1db0b5[_0xee2f('0x72')][_0x149d7f]['parentKey']&&_0x1db0b5[_0xee2f('0x72')][_0x149d7f][_0xee2f('0x75')]&&_0x1db0b5[_0xee2f('0x72')][_0x149d7f][_0xee2f('0x87')]){_0x15ca4e[_0x1db0b5[_0xee2f('0x72')][_0x149d7f]['type']](_0x1db0b5['joins'][_0x149d7f]['foreignTable'],null,util[_0xee2f('0x86')](_0xee2f('0x76'),_0x1db0b5[_0xee2f('0x77')],_0x1db0b5[_0xee2f('0x72')][_0x149d7f][_0xee2f('0x78')],_0x1db0b5[_0xee2f('0x72')][_0x149d7f][_0xee2f('0x75')],_0x1db0b5[_0xee2f('0x72')][_0x149d7f][_0xee2f('0x87')]));}}}if(_0x1db0b5[_0xee2f('0x79')]){_0x1db0b5[_0xee2f('0x79')]=JSON[_0xee2f('0x73')](_0x1db0b5[_0xee2f('0x79')]);_0x15ca4e[_0xee2f('0x37')](_0xd7c8f8(_0x1db0b5[_0xee2f('0x79')][_0xee2f('0x60')]));}_0x214f94=_0x15ca4e['clone']();_0x15ca4e['limit'](_0xc92046);_0x15ca4e[_0xee2f('0x14')](0x0);return;}})[_0xee2f('0x1d')](function(){if(_0x5b7b55['output']===_0xee2f('0x88')){return null;}var _0x444c39=_[_0xee2f('0x3a')](_0x5b7b55,{'name':_0x5b7b55['fullPath']||_0x5b7b55[_0xee2f('0x24')]||_0x1db0b5[_0xee2f('0x24')],'basename':_0x27eabc,'savename':util[_0xee2f('0x86')](_0xee2f('0x89'),_0x5b7b55[_0xee2f('0x24')]||_0x1db0b5[_0xee2f('0x24')],require(_0xee2f('0x8a'))[_0xee2f('0x8b')](0x4),_0x5b7b55[_0xee2f('0x8c')]||'csv'),'reportId':_0x1db0b5['id'],'reportType':_0xee2f('0x8d')});return db[_0xee2f('0x8e')][_0xee2f('0x44')](_0x444c39,{'raw':!![]});})[_0xee2f('0x1d')](function(_0xe7e196){if(_0x1db0b5[_0xee2f('0x77')]===_0xee2f('0x8f')){_0x214f94[_0xee2f('0x37')](_0x1db0b5['table']+_0xee2f('0x90'),_0x5b7b55[_0xee2f('0x91')],_0x5b7b55['endDate']);}else{_0x214f94[_0xee2f('0x37')](_0x1db0b5['table']+'.createdAt\x20BETWEEN\x20?\x20AND\x20?',_0x5b7b55[_0xee2f('0x91')],_0x5b7b55[_0xee2f('0x92')]);}if(_0xe7e196){logger[_0xee2f('0x93')](_0xee2f('0x94'),_0x214f94[_0xee2f('0x7d')]());require(_0xee2f('0x95'))['fork'](path[_0xee2f('0x50')](__dirname,_0xee2f('0x96'),_0xe7e196['output']),[_0xe7e196['id'],_0x214f94[_0xee2f('0x7d')](),path[_0xee2f('0x50')](__dirname,'../../files/reports',_0xe7e196[_0xee2f('0x97')]),_0x27eabc]);return _0xe7e196;}else{var _0x26dd6c=squel[_0xee2f('0x69')]();_0x26dd6c[_0xee2f('0x6a')]('('+_0x214f94[_0xee2f('0x7d')]()+')',_0xee2f('0x98'));_0x26dd6c[_0xee2f('0x61')](_0xee2f('0x99'),_0xee2f('0x17'));_0x214f94[_0xee2f('0x15')](_0x5b7b55[_0xee2f('0x15')]||_0xc92046);_0x214f94[_0xee2f('0x14')](_0x5b7b55['offset']||0x0);return dbH[_0xee2f('0x7e')]['query'](_0x26dd6c['toString'](),{'type':dbH['sequelize'][_0xee2f('0x7f')]['SELECT']})[_0xee2f('0x1d')](function(_0x472f83){if(!_0x472f83[_0xee2f('0x32')]){_0x28bde7=0x0;}else{_0x28bde7=_0x472f83[0x0]['count']||0x0;}return dbH[_0xee2f('0x7e')][_0xee2f('0x2c')](_0x214f94['toString'](),{'type':dbH[_0xee2f('0x7e')][_0xee2f('0x7f')][_0xee2f('0x80')]});})[_0xee2f('0x1d')](function(_0x121a34){return{'rows':_0x121a34||[],'count':_0x28bde7};});}});}exports[_0xee2f('0x9a')]=function(_0x3d8c56,_0x5c8550){return runReport(_0x3d8c56[_0xee2f('0x41')],_0x3d8c56[_0xee2f('0x2c')],_0x3d8c56['options'])[_0xee2f('0x1d')](respondWithResult(_0x5c8550,null))[_0xee2f('0x3f')](handleError(_0x5c8550,null));};exports[_0xee2f('0x9b')]=runReport;exports['query']=function(_0x40fa57,_0x1fafcc){var _0x1163f1=0xa;var _0x162014=[_0xee2f('0x50'),_0xee2f('0x81'),'right_join',_0xee2f('0x52')];var _0xb93091={'SUM':_0xee2f('0x53'),'COUNT':'COUNT(%s)','COUNT DISTINCT':'COUNT(DISTINCT\x20%s)','MAX':_0xee2f('0x55'),'MIN':'MIN(%s)','AVG':_0xee2f('0x57'),'GROUP_CONCAT':_0xee2f('0x58'),'GROUP_CONCAT ASC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','GROUP_CONCAT DESC':_0xee2f('0x9c')};var _0x39922f={'SEC_TO_TIME':'SEC_TO_TIME(%s)','DATE':'DATE(%s)','HOUR':_0xee2f('0x59'),'ROUND':_0xee2f('0x83'),'UNIX_TIMESTAMP':'UNIX_TIMESTAMP(%s)'};var _0x1c9f70=function(_0xa93dc9){return!_[_0xee2f('0x5b')]([_0xee2f('0x5c'),'IS\x20NOT\x20NULL',_0xee2f('0x84'),_0xee2f('0x9d')],_0xa93dc9);};var _0x44b06b=function(_0x541ac7){if(!_0x541ac7||!_0x541ac7[_0xee2f('0x5e')][_0xee2f('0x32')]){return'';}for(var _0xa89897='(',_0x2def5c=0x0;_0x2def5c<_0x541ac7['rules']['length'];_0x2def5c+=0x1){_0x2def5c>0x0&&(_0xa89897+='\x20'+_0x541ac7[_0xee2f('0x5f')]+'\x20');_0xa89897+=_0x541ac7[_0xee2f('0x5e')][_0x2def5c][_0xee2f('0x60')]?_0x44b06b(_0x541ac7['rules'][_0x2def5c][_0xee2f('0x60')]):_0x541ac7[_0xee2f('0x5e')][_0x2def5c]['field']+'\x20'+_0x541ac7[_0xee2f('0x5e')][_0x2def5c][_0xee2f('0x62')]+(_0x1c9f70(_0x541ac7[_0xee2f('0x5e')][_0x2def5c][_0xee2f('0x62')])?'\x20'+_0x541ac7[_0xee2f('0x5e')][_0x2def5c][_0xee2f('0x63')]:'');}return _0xa89897+')';};var _0x3f9188={'where':{'id':_0x40fa57['params']['id']}},_0x236b63,_0x4ad336,_0x3370de,_0x3c8c20,_0xc9228;_0x3f9188=_[_0xee2f('0x3a')]({},_0x3f9188,_0x40fa57[_0xee2f('0x3b')]);return db[_0xee2f('0x27')][_0xee2f('0x43')](_0x3f9188)[_0xee2f('0x1d')](function(_0xa0dfdd){if(_0xa0dfdd){_0x236b63=_0xa0dfdd;return _0xa0dfdd[_0xee2f('0x85')]();}return null;})[_0xee2f('0x1d')](function(_0x298dfa){if(_0x298dfa){if(!_0x298dfa[_0xee2f('0x32')]){throw new db[(_0xee2f('0x64'))][(_0xee2f('0x65'))]('Please\x20insert\x20at\x20least\x20one\x20field',0x193);}_0x4ad336=_0x298dfa;return db[_0xee2f('0x67')]['findAll']({'raw':!![]});}return null;})[_0xee2f('0x1d')](function(_0x35a1c9){if(_0x35a1c9){_0x3370de=_['keyBy'](_0x35a1c9,'id');var _0x464e9e;var _0x738f35=squel[_0xee2f('0x69')]();_0x738f35[_0xee2f('0x6a')](_0x236b63[_0xee2f('0x77')]);for(var _0xe24a8a=0x0;_0xe24a8a<_0x4ad336['length'];_0xe24a8a+=0x1){_0x464e9e=_0x4ad336[_0xe24a8a][_0xee2f('0x6b')]?_0x3370de[_0x4ad336[_0xe24a8a][_0xee2f('0x6b')]][_0xee2f('0x6c')]:_0x4ad336[_0xe24a8a][_0xee2f('0x61')];_0x464e9e=_0x4ad336[_0xe24a8a][_0xee2f('0x6d')]?_[_0xee2f('0x6e')](_0xb93091[_0x4ad336[_0xe24a8a][_0xee2f('0x6d')]],'%s',_0x464e9e):_0x464e9e;_0x464e9e=_0x4ad336[_0xe24a8a][_0xee2f('0x86')]?_[_0xee2f('0x6e')](_0x39922f[_0x4ad336[_0xe24a8a][_0xee2f('0x86')]],'%s',_0x464e9e):_0x464e9e;if(_0x4ad336[_0xe24a8a]['groupBy']){_0x738f35[_0xee2f('0x60')](_0x464e9e);}_0x4ad336[_0xe24a8a][_0xee2f('0x70')]&&_0x738f35[_0xee2f('0x35')](_0x464e9e,_0x4ad336[_0xe24a8a]['orderBy']==='DESC'?![]:!![]);_0x738f35[_0xee2f('0x61')](_0x464e9e,_0x4ad336[_0xe24a8a][_0xee2f('0x71')]||_0x464e9e);}if(_0x236b63[_0xee2f('0x72')]){_0x236b63[_0xee2f('0x72')]=JSON[_0xee2f('0x73')](_0x236b63['joins']);for(var _0x1cee16=0x0;_0x1cee16<_0x236b63[_0xee2f('0x72')]['length'];_0x1cee16+=0x1){if(_0x236b63[_0xee2f('0x72')][_0x1cee16][_0xee2f('0x74')]&&_[_0xee2f('0x5b')](_0x162014,_0x236b63[_0xee2f('0x72')][_0x1cee16][_0xee2f('0x74')])&&_0x236b63[_0xee2f('0x72')][_0x1cee16]['parentKey']&&_0x236b63[_0xee2f('0x72')][_0x1cee16][_0xee2f('0x75')]&&_0x236b63[_0xee2f('0x72')][_0x1cee16][_0xee2f('0x87')]){_0x738f35[_0x236b63[_0xee2f('0x72')][_0x1cee16][_0xee2f('0x74')]](_0x236b63[_0xee2f('0x72')][_0x1cee16][_0xee2f('0x75')],null,util[_0xee2f('0x86')](_0xee2f('0x76'),_0x236b63[_0xee2f('0x77')],_0x236b63['joins'][_0x1cee16][_0xee2f('0x78')],_0x236b63[_0xee2f('0x72')][_0x1cee16][_0xee2f('0x75')],_0x236b63[_0xee2f('0x72')][_0x1cee16][_0xee2f('0x87')]));}}}if(_0x236b63[_0xee2f('0x79')]){_0x236b63['conditions']=JSON[_0xee2f('0x73')](_0x236b63[_0xee2f('0x79')]);_0x738f35[_0xee2f('0x37')](_0x44b06b(_0x236b63[_0xee2f('0x79')]['group']));}_0xc9228=_0x738f35[_0xee2f('0x7a')]();_0x738f35[_0xee2f('0x15')](_0x1163f1);_0x738f35[_0xee2f('0x14')](0x0);logger[_0xee2f('0x7b')](_0xee2f('0x7c'),_0x738f35[_0xee2f('0x7d')]());return dbH[_0xee2f('0x7e')][_0xee2f('0x2c')](_0x738f35['toString'](),{'type':dbH['sequelize'][_0xee2f('0x7f')][_0xee2f('0x80')]});}})[_0xee2f('0x1d')](function(){return{'sql':_0xc9228['toString']()};})[_0xee2f('0x1d')](respondWithResult(_0x1fafcc,null))['catch'](handleError(_0x1fafcc,null));}; \ No newline at end of file +var _0x6d38=['Run\x20Query:','child_process','fork','../../components/export/','../../files/reports','savename','select','countTable','COUNT(*)','sequelize','run','SEC_TO_TIME(%s)','rimraf','zip-dir','fast-json-patch','bluebird','util','path','sox','ejs','fs-extra','lodash','squel','desk.js','to-csv','querystring','../../components/auth/service','../../components/parsers/qs','../../config/logger','api','../../config/environment','../../mysqldb','dbH','sendStatus','status','json','offset','undefined','limit','count','Content-Range','save','update','then','get','destroy','error','stack','name','send','index','map','rawAttributes','type','key','model','query','filters','intersection','attributes','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','include','AnalyticDefaultReport','findAll','rows','show','keys','fields','find','catch','create','body','user','role','Reports','autoAssociation','UserProfileResource','DefaultReports','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','params','preview','join','right_join','cross_join','SUM(%s)','COUNT(%s)','MAX(%s)','MIN(%s)','AVG(%s)','GROUP_CONCAT(%s)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)','DATE(%s)','HOUR(%s)','ROUND(%s)','UNIX_TIMESTAMP(%s)','includes','IS\x20EMPTY','rules','operator','group','field','condition','value','getFields','ValidationErrorItem','AnalyticMetric','keyBy','from','table','MetricId','metric','function','replace','format','groupBy','orderBy','alias','joins','parse','parentKey','foreignTable','foreignKey','conditions','clone','debug','toString','QueryTypes','SELECT','left_join','COUNT(DISTINCT\x20%s)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','IS\x20NULL','IS\x20NOT\x20NULL','IS\x20NOT\x20EMPTY','Sequelize','Please\x20insert\x20at\x20least\x20one\x20field','DESC','%s.%s\x20=\x20%s.%s','output','web','fullPath','randomstring','generate','csv','default','AnalyticExtractedReport','cdr','startDate','endDate','info'];(function(_0x167cc1,_0x56ef5a){var _0x10bc4b=function(_0xd6a255){while(--_0xd6a255){_0x167cc1['push'](_0x167cc1['shift']());}};_0x10bc4b(++_0x56ef5a);}(_0x6d38,0x1ef));var _0x86d3=function(_0x122096,_0x60c295){_0x122096=_0x122096-0x0;var _0x3d1966=_0x6d38[_0x122096];return _0x3d1966;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x86d3('0x0'));var zipdir=require(_0x86d3('0x1'));var jsonpatch=require(_0x86d3('0x2'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0x86d3('0x3'));var Mustache=require('mustache');var util=require(_0x86d3('0x4'));var path=require(_0x86d3('0x5'));var sox=require(_0x86d3('0x6'));var csv=require('to-csv');var ejs=require(_0x86d3('0x7'));var fs=require('fs');var fs_extra=require(_0x86d3('0x8'));var _=require(_0x86d3('0x9'));var squel=require(_0x86d3('0xa'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x86d3('0xb'));var toCsv=require(_0x86d3('0xc'));var querystring=require(_0x86d3('0xd'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0x86d3('0xe'));var qs=require(_0x86d3('0xf'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0x86d3('0x10'))(_0x86d3('0x11'));var utils=require('../../config/utils');var config=require(_0x86d3('0x12'));var licenseUtil=require('../../config/license/util');var db=require(_0x86d3('0x13'))['db'];var dbH=require(_0x86d3('0x13'))[_0x86d3('0x14')];function respondWithStatusCode(_0x26d64c,_0xe1b3d7){_0xe1b3d7=_0xe1b3d7||0xcc;return function(_0x1b8d0a){if(_0x1b8d0a){return _0x26d64c[_0x86d3('0x15')](_0xe1b3d7);}return _0x26d64c[_0x86d3('0x16')](_0xe1b3d7)['end']();};}function respondWithResult(_0x1c1ba8,_0x1f35cf){_0x1f35cf=_0x1f35cf||0xc8;return function(_0x356e7d){if(_0x356e7d){return _0x1c1ba8[_0x86d3('0x16')](_0x1f35cf)[_0x86d3('0x17')](_0x356e7d);}};}function respondWithFilteredResult(_0x34fb3b,_0x1ff008){return function(_0x44436d){if(_0x44436d){var _0x53b437=typeof _0x1ff008[_0x86d3('0x18')]===_0x86d3('0x19')&&typeof _0x1ff008[_0x86d3('0x1a')]===_0x86d3('0x19');var _0x46feec=_0x44436d[_0x86d3('0x1b')];var _0x33e459=_0x53b437?0x0:_0x1ff008[_0x86d3('0x18')];var _0x9b76f2=_0x53b437?_0x44436d['count']:_0x1ff008[_0x86d3('0x18')]+_0x1ff008['limit'];var _0x6ced9e;if(_0x9b76f2>=_0x46feec){_0x9b76f2=_0x46feec;_0x6ced9e=0xc8;}else{_0x6ced9e=0xce;}_0x34fb3b['status'](_0x6ced9e);return _0x34fb3b['set'](_0x86d3('0x1c'),_0x33e459+'-'+_0x9b76f2+'/'+_0x46feec)[_0x86d3('0x17')](_0x44436d);}return null;};}function patchUpdates(_0x988066){return function(_0x1720ae){try{jsonpatch['apply'](_0x1720ae,_0x988066,!![]);}catch(_0x2901de){return BPromise['reject'](_0x2901de);}return _0x1720ae[_0x86d3('0x1d')]();};}function saveUpdates(_0x3fdf67,_0x1ce849){return function(_0x5b990d){if(_0x5b990d){return _0x5b990d[_0x86d3('0x1e')](_0x3fdf67)[_0x86d3('0x1f')](function(_0x1fa4ac){return _0x1fa4ac;});}return null;};}function removeEntity(_0x4bf5b8,_0x58ba51){return function(_0x26262a){if(_0x26262a){return _0x26262a['destroy']()[_0x86d3('0x1f')](function(){var _0x1bea5e=_0x26262a[_0x86d3('0x20')]({'plain':!![]});var _0x3c5fe4='DefaultReports';return db['UserProfileResource'][_0x86d3('0x21')]({'where':{'type':_0x3c5fe4,'resourceId':_0x1bea5e['id']}})[_0x86d3('0x1f')](function(){return _0x26262a;});})['then'](function(){_0x4bf5b8[_0x86d3('0x16')](0xcc)['end']();});}};}function handleEntityNotFound(_0x42413c,_0x41e2f0){return function(_0x287b96){if(!_0x287b96){_0x42413c[_0x86d3('0x15')](0x194);}return _0x287b96;};}function handleError(_0x11a6fd,_0x14c9ff){_0x14c9ff=_0x14c9ff||0x1f4;return function(_0x1f203e){logger[_0x86d3('0x22')](_0x1f203e[_0x86d3('0x23')]);if(_0x1f203e[_0x86d3('0x24')]){delete _0x1f203e[_0x86d3('0x24')];}_0x11a6fd[_0x86d3('0x16')](_0x14c9ff)[_0x86d3('0x25')](_0x1f203e);};}exports[_0x86d3('0x26')]=function(_0x5b09f6,_0x120a0c){var _0x403be3={},_0x2bda35={},_0x31cefe={'count':0x0,'rows':[]};var _0x7709f0=_[_0x86d3('0x27')](db['AnalyticDefaultReport'][_0x86d3('0x28')],function(_0x5c71df){return{'name':_0x5c71df['fieldName'],'type':_0x5c71df[_0x86d3('0x29')][_0x86d3('0x2a')]};});_0x2bda35[_0x86d3('0x2b')]=_['map'](_0x7709f0,_0x86d3('0x24'));_0x2bda35[_0x86d3('0x2c')]=_['keys'](_0x5b09f6[_0x86d3('0x2c')]);_0x2bda35[_0x86d3('0x2d')]=_[_0x86d3('0x2e')](_0x2bda35[_0x86d3('0x2b')],_0x2bda35[_0x86d3('0x2c')]);_0x403be3[_0x86d3('0x2f')]=_[_0x86d3('0x2e')](_0x2bda35[_0x86d3('0x2b')],qs['fields'](_0x5b09f6['query']['fields']));_0x403be3[_0x86d3('0x2f')]=_0x403be3['attributes'][_0x86d3('0x30')]?_0x403be3['attributes']:_0x2bda35[_0x86d3('0x2b')];if(!_0x5b09f6[_0x86d3('0x2c')][_0x86d3('0x31')](_0x86d3('0x32'))){_0x403be3[_0x86d3('0x1a')]=qs[_0x86d3('0x1a')](_0x5b09f6[_0x86d3('0x2c')]['limit']);_0x403be3[_0x86d3('0x18')]=qs[_0x86d3('0x18')](_0x5b09f6['query'][_0x86d3('0x18')]);}_0x403be3[_0x86d3('0x33')]=qs[_0x86d3('0x34')](_0x5b09f6[_0x86d3('0x2c')]['sort']);_0x403be3[_0x86d3('0x35')]=qs[_0x86d3('0x2d')](_[_0x86d3('0x36')](_0x5b09f6['query'],_0x2bda35[_0x86d3('0x2d')]),_0x7709f0);if(_0x5b09f6[_0x86d3('0x2c')][_0x86d3('0x37')]){_0x403be3[_0x86d3('0x35')]=_[_0x86d3('0x38')](_0x403be3[_0x86d3('0x35')],{'$or':_[_0x86d3('0x27')](_0x7709f0,function(_0x436065){if(_0x436065['type']!==_0x86d3('0x39')){var _0x470978={};_0x470978[_0x436065[_0x86d3('0x24')]]={'$like':'%'+_0x5b09f6[_0x86d3('0x2c')]['filter']+'%'};return _0x470978;}})});}_0x403be3=_[_0x86d3('0x38')]({},_0x403be3,_0x5b09f6[_0x86d3('0x3a')]);var _0x6f72be={'where':_0x403be3[_0x86d3('0x35')]};return db['AnalyticDefaultReport']['count'](_0x6f72be)[_0x86d3('0x1f')](function(_0x4f422b){_0x31cefe['count']=_0x4f422b;if(_0x5b09f6[_0x86d3('0x2c')][_0x86d3('0x3b')]){_0x403be3[_0x86d3('0x3c')]=[{'all':!![]}];}return db[_0x86d3('0x3d')][_0x86d3('0x3e')](_0x403be3);})['then'](function(_0x2a5f6c){_0x31cefe[_0x86d3('0x3f')]=_0x2a5f6c;return _0x31cefe;})[_0x86d3('0x1f')](respondWithFilteredResult(_0x120a0c,_0x403be3))['catch'](handleError(_0x120a0c,null));};exports[_0x86d3('0x40')]=function(_0x810d10,_0x5dfae8){var _0x369f68={'raw':!![],'where':{'id':_0x810d10['params']['id']}},_0xcf6c9e={};_0xcf6c9e['model']=_['keys'](db[_0x86d3('0x3d')][_0x86d3('0x28')]);_0xcf6c9e[_0x86d3('0x2c')]=_[_0x86d3('0x41')](_0x810d10[_0x86d3('0x2c')]);_0xcf6c9e[_0x86d3('0x2d')]=_['intersection'](_0xcf6c9e[_0x86d3('0x2b')],_0xcf6c9e[_0x86d3('0x2c')]);_0x369f68['attributes']=_[_0x86d3('0x2e')](_0xcf6c9e[_0x86d3('0x2b')],qs[_0x86d3('0x42')](_0x810d10[_0x86d3('0x2c')][_0x86d3('0x42')]));_0x369f68[_0x86d3('0x2f')]=_0x369f68['attributes'][_0x86d3('0x30')]?_0x369f68[_0x86d3('0x2f')]:_0xcf6c9e['model'];if(_0x810d10[_0x86d3('0x2c')][_0x86d3('0x3b')]){_0x369f68[_0x86d3('0x3c')]=[{'all':!![]}];}_0x369f68=_[_0x86d3('0x38')]({},_0x369f68,_0x810d10[_0x86d3('0x3a')]);return db['AnalyticDefaultReport'][_0x86d3('0x43')](_0x369f68)[_0x86d3('0x1f')](handleEntityNotFound(_0x5dfae8,null))[_0x86d3('0x1f')](respondWithResult(_0x5dfae8,null))[_0x86d3('0x44')](handleError(_0x5dfae8,null));};exports[_0x86d3('0x45')]=function(_0x7af7b3,_0x1a4345){return db[_0x86d3('0x3d')][_0x86d3('0x45')](_0x7af7b3[_0x86d3('0x46')],{})[_0x86d3('0x1f')](function(_0x1236ea){var _0x4ea940=_0x7af7b3[_0x86d3('0x47')][_0x86d3('0x20')]({'plain':!![]});if(!_0x4ea940)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x4ea940[_0x86d3('0x48')]===_0x86d3('0x47')){var _0x197047=_0x1236ea[_0x86d3('0x20')]({'plain':!![]});var _0x1dcff0=_0x86d3('0x49');return db['UserProfileSection']['find']({'where':{'name':_0x1dcff0,'userProfileId':_0x4ea940['userProfileId']},'raw':!![]})['then'](function(_0x159253){if(_0x159253&&_0x159253[_0x86d3('0x4a')]===0x0){return db[_0x86d3('0x4b')][_0x86d3('0x45')]({'name':_0x197047[_0x86d3('0x24')],'resourceId':_0x197047['id'],'type':_0x86d3('0x4c'),'sectionId':_0x159253['id']},{})[_0x86d3('0x1f')](function(){return _0x1236ea;});}else{return _0x1236ea;}})['catch'](function(_0x2afb07){logger[_0x86d3('0x22')](_0x86d3('0x4d'),_0x2afb07);throw _0x2afb07;});}return _0x1236ea;})[_0x86d3('0x1f')](respondWithResult(_0x1a4345,0xc9))[_0x86d3('0x44')](handleError(_0x1a4345,null));};exports[_0x86d3('0x1e')]=function(_0x34935f,_0x4c8828){if(_0x34935f[_0x86d3('0x46')]['id']){delete _0x34935f['body']['id'];}return db[_0x86d3('0x3d')][_0x86d3('0x43')]({'where':{'id':_0x34935f[_0x86d3('0x4e')]['id']}})[_0x86d3('0x1f')](handleEntityNotFound(_0x4c8828,null))[_0x86d3('0x1f')](saveUpdates(_0x34935f['body'],null))[_0x86d3('0x1f')](respondWithResult(_0x4c8828,null))[_0x86d3('0x44')](handleError(_0x4c8828,null));};exports[_0x86d3('0x21')]=function(_0x4e10d9,_0x4ad164){return db['AnalyticDefaultReport'][_0x86d3('0x43')]({'where':{'id':_0x4e10d9['params']['id']}})[_0x86d3('0x1f')](handleEntityNotFound(_0x4ad164,null))[_0x86d3('0x1f')](removeEntity(_0x4ad164,null))[_0x86d3('0x44')](handleError(_0x4ad164,null));};exports[_0x86d3('0x4f')]=function(_0x5963bb,_0x4cd835){var _0x551806=0xa;var _0x28655a=[_0x86d3('0x50'),'left_join',_0x86d3('0x51'),_0x86d3('0x52')];var _0xa085b2={'SUM':_0x86d3('0x53'),'COUNT':_0x86d3('0x54'),'COUNT DISTINCT':'COUNT(DISTINCT\x20%s)','MAX':_0x86d3('0x55'),'MIN':_0x86d3('0x56'),'AVG':_0x86d3('0x57'),'GROUP_CONCAT':_0x86d3('0x58'),'GROUP_CONCAT ASC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','GROUP_CONCAT DESC':_0x86d3('0x59')};var _0x41fad7={'SEC_TO_TIME':'SEC_TO_TIME(%s)','DATE':_0x86d3('0x5a'),'HOUR':_0x86d3('0x5b'),'ROUND':_0x86d3('0x5c'),'UNIX_TIMESTAMP':_0x86d3('0x5d')};var _0x4598d4=function(_0x4029a4){return!_[_0x86d3('0x5e')](['IS\x20NULL','IS\x20NOT\x20NULL',_0x86d3('0x5f'),'IS\x20NOT\x20EMPTY'],_0x4029a4);};var _0x528ca8=function(_0x58e4b6){if(!_0x58e4b6||!_0x58e4b6[_0x86d3('0x60')]['length']){return'';}for(var _0x254ac3='(',_0x5f2ed6=0x0;_0x5f2ed6<_0x58e4b6[_0x86d3('0x60')][_0x86d3('0x30')];_0x5f2ed6+=0x1){_0x5f2ed6>0x0&&(_0x254ac3+='\x20'+_0x58e4b6[_0x86d3('0x61')]+'\x20');_0x254ac3+=_0x58e4b6['rules'][_0x5f2ed6]['group']?_0x528ca8(_0x58e4b6[_0x86d3('0x60')][_0x5f2ed6][_0x86d3('0x62')]):_0x58e4b6[_0x86d3('0x60')][_0x5f2ed6][_0x86d3('0x63')]+'\x20'+_0x58e4b6[_0x86d3('0x60')][_0x5f2ed6][_0x86d3('0x64')]+(_0x4598d4(_0x58e4b6[_0x86d3('0x60')][_0x5f2ed6][_0x86d3('0x64')])?'\x20'+_0x58e4b6[_0x86d3('0x60')][_0x5f2ed6][_0x86d3('0x65')]:'');}return _0x254ac3+')';};var _0x1e3479={'where':{'id':_0x5963bb[_0x86d3('0x4e')]['id']}},_0x265beb,_0xfaf168,_0xf0dbbb,_0x3f978c,_0x5e1835;_0x1e3479=_[_0x86d3('0x38')]({},_0x1e3479,_0x5963bb['options']);return db[_0x86d3('0x3d')][_0x86d3('0x43')](_0x1e3479)[_0x86d3('0x1f')](function(_0x52dc99){if(_0x52dc99){_0x265beb=_0x52dc99;return _0x52dc99[_0x86d3('0x66')]();}return null;})[_0x86d3('0x1f')](function(_0x45e8d9){if(_0x45e8d9){if(!_0x45e8d9[_0x86d3('0x30')]){throw new db['Sequelize'][(_0x86d3('0x67'))]('Please\x20insert\x20at\x20least\x20one\x20field',0x193);}_0xfaf168=_0x45e8d9;return db[_0x86d3('0x68')][_0x86d3('0x3e')]({'raw':!![]});}return null;})[_0x86d3('0x1f')](function(_0x2d4bc1){if(_0x2d4bc1){_0xf0dbbb=_[_0x86d3('0x69')](_0x2d4bc1,'id');var _0x56fd96;var _0x3cc1d8=squel['select']();_0x3cc1d8[_0x86d3('0x6a')](_0x265beb[_0x86d3('0x6b')]);for(var _0x5866fe=0x0;_0x5866fe<_0xfaf168[_0x86d3('0x30')];_0x5866fe+=0x1){_0x56fd96=_0xfaf168[_0x5866fe][_0x86d3('0x6c')]?_0xf0dbbb[_0xfaf168[_0x5866fe][_0x86d3('0x6c')]][_0x86d3('0x6d')]:_0xfaf168[_0x5866fe][_0x86d3('0x63')];_0x56fd96=_0xfaf168[_0x5866fe][_0x86d3('0x6e')]?_[_0x86d3('0x6f')](_0xa085b2[_0xfaf168[_0x5866fe]['function']],'%s',_0x56fd96):_0x56fd96;_0x56fd96=_0xfaf168[_0x5866fe][_0x86d3('0x70')]?_[_0x86d3('0x6f')](_0x41fad7[_0xfaf168[_0x5866fe][_0x86d3('0x70')]],'%s',_0x56fd96):_0x56fd96;if(_0xfaf168[_0x5866fe][_0x86d3('0x71')]){_0x3cc1d8[_0x86d3('0x62')](_0x56fd96);}_0xfaf168[_0x5866fe]['orderBy']&&_0x3cc1d8[_0x86d3('0x33')](_0x56fd96,_0xfaf168[_0x5866fe][_0x86d3('0x72')]==='DESC'?![]:!![]);_0x3cc1d8[_0x86d3('0x63')](_0x56fd96,_0xfaf168[_0x5866fe][_0x86d3('0x73')]||_0x56fd96);}if(_0x265beb[_0x86d3('0x74')]){_0x265beb[_0x86d3('0x74')]=JSON[_0x86d3('0x75')](_0x265beb[_0x86d3('0x74')]);for(var _0x1bf5ba=0x0;_0x1bf5ba<_0x265beb[_0x86d3('0x74')][_0x86d3('0x30')];_0x1bf5ba+=0x1){if(_0x265beb[_0x86d3('0x74')][_0x1bf5ba][_0x86d3('0x29')]&&_[_0x86d3('0x5e')](_0x28655a,_0x265beb[_0x86d3('0x74')][_0x1bf5ba][_0x86d3('0x29')])&&_0x265beb['joins'][_0x1bf5ba][_0x86d3('0x76')]&&_0x265beb[_0x86d3('0x74')][_0x1bf5ba][_0x86d3('0x77')]&&_0x265beb[_0x86d3('0x74')][_0x1bf5ba]['foreignKey']){_0x3cc1d8[_0x265beb[_0x86d3('0x74')][_0x1bf5ba][_0x86d3('0x29')]](_0x265beb[_0x86d3('0x74')][_0x1bf5ba][_0x86d3('0x77')],null,util['format']('%s.%s\x20=\x20%s.%s',_0x265beb[_0x86d3('0x6b')],_0x265beb['joins'][_0x1bf5ba][_0x86d3('0x76')],_0x265beb['joins'][_0x1bf5ba]['foreignTable'],_0x265beb[_0x86d3('0x74')][_0x1bf5ba][_0x86d3('0x78')]));}}}if(_0x265beb[_0x86d3('0x79')]){_0x265beb[_0x86d3('0x79')]=JSON[_0x86d3('0x75')](_0x265beb['conditions']);_0x3cc1d8[_0x86d3('0x35')](_0x528ca8(_0x265beb[_0x86d3('0x79')]['group']));}_0x5e1835=_0x3cc1d8[_0x86d3('0x7a')]();_0x3cc1d8[_0x86d3('0x1a')](_0x551806);_0x3cc1d8['offset'](0x0);logger[_0x86d3('0x7b')]('Limited\x20Query:',_0x3cc1d8[_0x86d3('0x7c')]());return dbH['sequelize']['query'](_0x3cc1d8[_0x86d3('0x7c')](),{'type':dbH['sequelize'][_0x86d3('0x7d')][_0x86d3('0x7e')]});}})[_0x86d3('0x1f')](respondWithResult(_0x4cd835,null))[_0x86d3('0x44')](handleError(_0x4cd835,null));};function runReport(_0x3193d5,_0x3a1acc,_0x268c93){var _0x3b989c=_0x3a1acc['name'];var _0x245b39=0xa;var _0x158f56=[_0x86d3('0x50'),_0x86d3('0x7f'),_0x86d3('0x51'),'cross_join'];var _0x3d8b35={'SUM':_0x86d3('0x53'),'COUNT':_0x86d3('0x54'),'COUNT DISTINCT':_0x86d3('0x80'),'MAX':_0x86d3('0x55'),'MIN':_0x86d3('0x56'),'AVG':_0x86d3('0x57'),'GROUP_CONCAT':'GROUP_CONCAT(%s)','GROUP_CONCAT ASC':_0x86d3('0x81'),'GROUP_CONCAT DESC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)'};var _0xca2e0={'SEC_TO_TIME':'SEC_TO_TIME(%s)','DATE':'DATE(%s)','HOUR':_0x86d3('0x5b'),'ROUND':_0x86d3('0x5c'),'UNIX_TIMESTAMP':'UNIX_TIMESTAMP(%s)'};var _0x1b503a=function(_0x24410c){return!_[_0x86d3('0x5e')]([_0x86d3('0x82'),_0x86d3('0x83'),_0x86d3('0x5f'),_0x86d3('0x84')],_0x24410c);};var _0x5f4a38=function(_0x593b85){if(!_0x593b85||!_0x593b85[_0x86d3('0x60')][_0x86d3('0x30')]){return'';}for(var _0x3fac94='(',_0x28d98e=0x0;_0x28d98e<_0x593b85[_0x86d3('0x60')][_0x86d3('0x30')];_0x28d98e+=0x1){_0x28d98e>0x0&&(_0x3fac94+='\x20'+_0x593b85['operator']+'\x20');_0x3fac94+=_0x593b85[_0x86d3('0x60')][_0x28d98e][_0x86d3('0x62')]?_0x5f4a38(_0x593b85[_0x86d3('0x60')][_0x28d98e][_0x86d3('0x62')]):_0x593b85[_0x86d3('0x60')][_0x28d98e][_0x86d3('0x63')]+'\x20'+_0x593b85[_0x86d3('0x60')][_0x28d98e][_0x86d3('0x64')]+(_0x1b503a(_0x593b85[_0x86d3('0x60')][_0x28d98e]['condition'])?'\x20'+_0x593b85[_0x86d3('0x60')][_0x28d98e][_0x86d3('0x65')]:'');}return _0x3fac94+')';};var _0x4b871b={'where':{'id':_0x3193d5['id']}},_0x584a57,_0x36ee46,_0x1cbc3a,_0x682a6d,_0x5004cd;_0x4b871b=_[_0x86d3('0x38')]({},_0x4b871b,_0x268c93);return db[_0x86d3('0x3d')][_0x86d3('0x43')](_0x4b871b)[_0x86d3('0x1f')](function(_0x3d3e7f){if(_0x3d3e7f){_0x584a57=_0x3d3e7f;return _0x3d3e7f['getFields']();}return null;})[_0x86d3('0x1f')](function(_0x1aaf08){if(_0x1aaf08){if(!_0x1aaf08['length']){throw new db[(_0x86d3('0x85'))][(_0x86d3('0x67'))](_0x86d3('0x86'),0x193);}_0x36ee46=_0x1aaf08;return db[_0x86d3('0x68')]['findAll']({'raw':!![]});}return null;})[_0x86d3('0x1f')](function(_0x2896e1){if(_0x2896e1){_0x1cbc3a=_[_0x86d3('0x69')](_0x2896e1,'id');var _0x18295c;var _0x44af1c=squel['select']();_0x44af1c[_0x86d3('0x6a')](_0x584a57[_0x86d3('0x6b')]);for(var _0x3582a2=0x0;_0x3582a2<_0x36ee46[_0x86d3('0x30')];_0x3582a2+=0x1){_0x18295c=_0x36ee46[_0x3582a2][_0x86d3('0x6c')]?_0x1cbc3a[_0x36ee46[_0x3582a2][_0x86d3('0x6c')]][_0x86d3('0x6d')]:_0x36ee46[_0x3582a2][_0x86d3('0x63')];_0x18295c=_0x36ee46[_0x3582a2][_0x86d3('0x6e')]?_[_0x86d3('0x6f')](_0x3d8b35[_0x36ee46[_0x3582a2]['function']],'%s',_0x18295c):_0x18295c;_0x18295c=_0x36ee46[_0x3582a2]['format']?_[_0x86d3('0x6f')](_0xca2e0[_0x36ee46[_0x3582a2][_0x86d3('0x70')]],'%s',_0x18295c):_0x18295c;if(_0x36ee46[_0x3582a2]['groupBy']){_0x44af1c[_0x86d3('0x62')](_0x18295c);}_0x36ee46[_0x3582a2][_0x86d3('0x72')]&&_0x44af1c[_0x86d3('0x33')](_0x18295c,_0x36ee46[_0x3582a2][_0x86d3('0x72')]===_0x86d3('0x87')?![]:!![]);_0x44af1c[_0x86d3('0x63')](_0x18295c,_0x36ee46[_0x3582a2][_0x86d3('0x73')]||_0x18295c);}if(_0x584a57[_0x86d3('0x74')]){_0x584a57[_0x86d3('0x74')]=JSON['parse'](_0x584a57['joins']);for(var _0x48a6d7=0x0;_0x48a6d7<_0x584a57['joins'][_0x86d3('0x30')];_0x48a6d7+=0x1){if(_0x584a57[_0x86d3('0x74')][_0x48a6d7][_0x86d3('0x29')]&&_[_0x86d3('0x5e')](_0x158f56,_0x584a57[_0x86d3('0x74')][_0x48a6d7][_0x86d3('0x29')])&&_0x584a57[_0x86d3('0x74')][_0x48a6d7]['parentKey']&&_0x584a57[_0x86d3('0x74')][_0x48a6d7][_0x86d3('0x77')]&&_0x584a57[_0x86d3('0x74')][_0x48a6d7][_0x86d3('0x78')]){_0x44af1c[_0x584a57['joins'][_0x48a6d7][_0x86d3('0x29')]](_0x584a57['joins'][_0x48a6d7][_0x86d3('0x77')],null,util[_0x86d3('0x70')](_0x86d3('0x88'),_0x584a57[_0x86d3('0x6b')],_0x584a57[_0x86d3('0x74')][_0x48a6d7]['parentKey'],_0x584a57['joins'][_0x48a6d7][_0x86d3('0x77')],_0x584a57['joins'][_0x48a6d7][_0x86d3('0x78')]));}}}if(_0x584a57['conditions']){_0x584a57[_0x86d3('0x79')]=JSON['parse'](_0x584a57['conditions']);_0x44af1c[_0x86d3('0x35')](_0x5f4a38(_0x584a57[_0x86d3('0x79')][_0x86d3('0x62')]));}_0x5004cd=_0x44af1c[_0x86d3('0x7a')]();_0x44af1c[_0x86d3('0x1a')](_0x245b39);_0x44af1c[_0x86d3('0x18')](0x0);return;}})[_0x86d3('0x1f')](function(){if(_0x3a1acc[_0x86d3('0x89')]===_0x86d3('0x8a')){return null;}var _0x120a85=_[_0x86d3('0x38')](_0x3a1acc,{'name':_0x3a1acc[_0x86d3('0x8b')]||_0x3a1acc[_0x86d3('0x24')]||_0x584a57[_0x86d3('0x24')],'basename':_0x3b989c,'savename':util[_0x86d3('0x70')]('%s-%s.%s',_0x3a1acc['name']||_0x584a57['name'],require(_0x86d3('0x8c'))[_0x86d3('0x8d')](0x4),_0x3a1acc[_0x86d3('0x89')]||_0x86d3('0x8e')),'reportId':_0x584a57['id'],'reportType':_0x86d3('0x8f')});return db[_0x86d3('0x90')][_0x86d3('0x45')](_0x120a85,{'raw':!![]});})[_0x86d3('0x1f')](function(_0x10e23d){if(_0x584a57[_0x86d3('0x6b')]===_0x86d3('0x91')){_0x5004cd['where'](_0x584a57[_0x86d3('0x6b')]+'.calldate\x20BETWEEN\x20?\x20AND\x20?',_0x3a1acc[_0x86d3('0x92')],_0x3a1acc[_0x86d3('0x93')]);}else{_0x5004cd[_0x86d3('0x35')](_0x584a57[_0x86d3('0x6b')]+'.createdAt\x20BETWEEN\x20?\x20AND\x20?',_0x3a1acc[_0x86d3('0x92')],_0x3a1acc[_0x86d3('0x93')]);}if(_0x10e23d){logger[_0x86d3('0x94')](_0x86d3('0x95'),_0x5004cd[_0x86d3('0x7c')]());require(_0x86d3('0x96'))[_0x86d3('0x97')](path[_0x86d3('0x50')](__dirname,_0x86d3('0x98'),_0x10e23d[_0x86d3('0x89')]),[_0x10e23d['id'],_0x5004cd[_0x86d3('0x7c')](),path[_0x86d3('0x50')](__dirname,_0x86d3('0x99'),_0x10e23d[_0x86d3('0x9a')]),_0x3b989c]);return _0x10e23d;}else{var _0x428b11=squel[_0x86d3('0x9b')]();_0x428b11[_0x86d3('0x6a')]('('+_0x5004cd['toString']()+')',_0x86d3('0x9c'));_0x428b11[_0x86d3('0x63')](_0x86d3('0x9d'),_0x86d3('0x1b'));_0x5004cd['limit'](_0x3a1acc[_0x86d3('0x1a')]||_0x245b39);_0x5004cd['offset'](_0x3a1acc['offset']||0x0);return dbH[_0x86d3('0x9e')][_0x86d3('0x2c')](_0x428b11[_0x86d3('0x7c')](),{'type':dbH[_0x86d3('0x9e')][_0x86d3('0x7d')][_0x86d3('0x7e')]})[_0x86d3('0x1f')](function(_0x4777f1){if(!_0x4777f1['length']){_0x682a6d=0x0;}else{_0x682a6d=_0x4777f1[0x0]['count']||0x0;}return dbH['sequelize'][_0x86d3('0x2c')](_0x5004cd[_0x86d3('0x7c')](),{'type':dbH[_0x86d3('0x9e')]['QueryTypes'][_0x86d3('0x7e')]});})['then'](function(_0x435b8e){return{'rows':_0x435b8e||[],'count':_0x682a6d};});}});}exports[_0x86d3('0x9f')]=function(_0x73b8e6,_0x2c98e1){return runReport(_0x73b8e6['params'],_0x73b8e6[_0x86d3('0x2c')],_0x73b8e6[_0x86d3('0x3a')])[_0x86d3('0x1f')](respondWithResult(_0x2c98e1,null))['catch'](handleError(_0x2c98e1,null));};exports['runReport']=runReport;exports['query']=function(_0x458997,_0x1e3559){var _0x49a101=0xa;var _0x38d724=['join',_0x86d3('0x7f'),_0x86d3('0x51'),_0x86d3('0x52')];var _0x56ff91={'SUM':_0x86d3('0x53'),'COUNT':_0x86d3('0x54'),'COUNT DISTINCT':_0x86d3('0x80'),'MAX':_0x86d3('0x55'),'MIN':_0x86d3('0x56'),'AVG':'AVG(%s)','GROUP_CONCAT':_0x86d3('0x58'),'GROUP_CONCAT ASC':_0x86d3('0x81'),'GROUP_CONCAT DESC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)'};var _0x1f347e={'SEC_TO_TIME':_0x86d3('0xa0'),'DATE':'DATE(%s)','HOUR':_0x86d3('0x5b'),'ROUND':'ROUND(%s)','UNIX_TIMESTAMP':'UNIX_TIMESTAMP(%s)'};var _0x45b210=function(_0x144e43){return!_[_0x86d3('0x5e')]([_0x86d3('0x82'),_0x86d3('0x83'),_0x86d3('0x5f'),_0x86d3('0x84')],_0x144e43);};var _0xdc7c21=function(_0x2e0397){if(!_0x2e0397||!_0x2e0397[_0x86d3('0x60')][_0x86d3('0x30')]){return'';}for(var _0x2cc617='(',_0x25339c=0x0;_0x25339c<_0x2e0397['rules'][_0x86d3('0x30')];_0x25339c+=0x1){_0x25339c>0x0&&(_0x2cc617+='\x20'+_0x2e0397[_0x86d3('0x61')]+'\x20');_0x2cc617+=_0x2e0397[_0x86d3('0x60')][_0x25339c][_0x86d3('0x62')]?_0xdc7c21(_0x2e0397[_0x86d3('0x60')][_0x25339c][_0x86d3('0x62')]):_0x2e0397['rules'][_0x25339c][_0x86d3('0x63')]+'\x20'+_0x2e0397['rules'][_0x25339c][_0x86d3('0x64')]+(_0x45b210(_0x2e0397[_0x86d3('0x60')][_0x25339c]['condition'])?'\x20'+_0x2e0397['rules'][_0x25339c][_0x86d3('0x65')]:'');}return _0x2cc617+')';};var _0x2c0070={'where':{'id':_0x458997[_0x86d3('0x4e')]['id']}},_0x31d436,_0x56e713,_0x525559,_0x3b9e1e,_0x1d8d7c;_0x2c0070=_['merge']({},_0x2c0070,_0x458997[_0x86d3('0x3a')]);return db[_0x86d3('0x3d')][_0x86d3('0x43')](_0x2c0070)[_0x86d3('0x1f')](function(_0x1f80be){if(_0x1f80be){_0x31d436=_0x1f80be;return _0x1f80be[_0x86d3('0x66')]();}return null;})[_0x86d3('0x1f')](function(_0x3dddbe){if(_0x3dddbe){if(!_0x3dddbe[_0x86d3('0x30')]){throw new db[(_0x86d3('0x85'))][(_0x86d3('0x67'))]('Please\x20insert\x20at\x20least\x20one\x20field',0x193);}_0x56e713=_0x3dddbe;return db[_0x86d3('0x68')]['findAll']({'raw':!![]});}return null;})['then'](function(_0x1d7e83){if(_0x1d7e83){_0x525559=_[_0x86d3('0x69')](_0x1d7e83,'id');var _0x5d9385;var _0x49a499=squel[_0x86d3('0x9b')]();_0x49a499[_0x86d3('0x6a')](_0x31d436[_0x86d3('0x6b')]);for(var _0x33e0a5=0x0;_0x33e0a5<_0x56e713['length'];_0x33e0a5+=0x1){_0x5d9385=_0x56e713[_0x33e0a5][_0x86d3('0x6c')]?_0x525559[_0x56e713[_0x33e0a5][_0x86d3('0x6c')]][_0x86d3('0x6d')]:_0x56e713[_0x33e0a5][_0x86d3('0x63')];_0x5d9385=_0x56e713[_0x33e0a5][_0x86d3('0x6e')]?_['replace'](_0x56ff91[_0x56e713[_0x33e0a5][_0x86d3('0x6e')]],'%s',_0x5d9385):_0x5d9385;_0x5d9385=_0x56e713[_0x33e0a5][_0x86d3('0x70')]?_[_0x86d3('0x6f')](_0x1f347e[_0x56e713[_0x33e0a5]['format']],'%s',_0x5d9385):_0x5d9385;if(_0x56e713[_0x33e0a5][_0x86d3('0x71')]){_0x49a499['group'](_0x5d9385);}_0x56e713[_0x33e0a5][_0x86d3('0x72')]&&_0x49a499[_0x86d3('0x33')](_0x5d9385,_0x56e713[_0x33e0a5]['orderBy']===_0x86d3('0x87')?![]:!![]);_0x49a499[_0x86d3('0x63')](_0x5d9385,_0x56e713[_0x33e0a5][_0x86d3('0x73')]||_0x5d9385);}if(_0x31d436[_0x86d3('0x74')]){_0x31d436[_0x86d3('0x74')]=JSON[_0x86d3('0x75')](_0x31d436['joins']);for(var _0x10af91=0x0;_0x10af91<_0x31d436['joins'][_0x86d3('0x30')];_0x10af91+=0x1){if(_0x31d436[_0x86d3('0x74')][_0x10af91][_0x86d3('0x29')]&&_[_0x86d3('0x5e')](_0x38d724,_0x31d436['joins'][_0x10af91][_0x86d3('0x29')])&&_0x31d436[_0x86d3('0x74')][_0x10af91][_0x86d3('0x76')]&&_0x31d436[_0x86d3('0x74')][_0x10af91][_0x86d3('0x77')]&&_0x31d436[_0x86d3('0x74')][_0x10af91]['foreignKey']){_0x49a499[_0x31d436[_0x86d3('0x74')][_0x10af91][_0x86d3('0x29')]](_0x31d436['joins'][_0x10af91]['foreignTable'],null,util[_0x86d3('0x70')]('%s.%s\x20=\x20%s.%s',_0x31d436['table'],_0x31d436[_0x86d3('0x74')][_0x10af91][_0x86d3('0x76')],_0x31d436[_0x86d3('0x74')][_0x10af91]['foreignTable'],_0x31d436[_0x86d3('0x74')][_0x10af91][_0x86d3('0x78')]));}}}if(_0x31d436[_0x86d3('0x79')]){_0x31d436[_0x86d3('0x79')]=JSON[_0x86d3('0x75')](_0x31d436['conditions']);_0x49a499[_0x86d3('0x35')](_0xdc7c21(_0x31d436[_0x86d3('0x79')]['group']));}_0x1d8d7c=_0x49a499['clone']();_0x49a499['limit'](_0x49a101);_0x49a499[_0x86d3('0x18')](0x0);logger['debug']('Limited\x20Query:',_0x49a499[_0x86d3('0x7c')]());return dbH[_0x86d3('0x9e')]['query'](_0x49a499['toString'](),{'type':dbH[_0x86d3('0x9e')][_0x86d3('0x7d')][_0x86d3('0x7e')]});}})['then'](function(){return{'sql':_0x1d8d7c[_0x86d3('0x7c')]()};})[_0x86d3('0x1f')](respondWithResult(_0x1e3559,null))[_0x86d3('0x44')](handleError(_0x1e3559,null));}; \ No newline at end of file diff --git a/server/api/analyticDefaultReport/analyticDefaultReport.model.js b/server/api/analyticDefaultReport/analyticDefaultReport.model.js index 5ae6a4f..2b668b1 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 _0x6026=['lodash','util','../../config/logger','api','moment','bluebird','request-promise','rimraf','../../config/environment','./analyticDefaultReport.attributes','exports','AnalyticDefaultReport','analytics_default_reports'];(function(_0x3db464,_0x53fd4e){var _0x81faa2=function(_0x98fc91){while(--_0x98fc91){_0x3db464['push'](_0x3db464['shift']());}};_0x81faa2(++_0x53fd4e);}(_0x6026,0xb6));var _0x6602=function(_0x523ff7,_0x1c1d24){_0x523ff7=_0x523ff7-0x0;var _0x34d888=_0x6026[_0x523ff7];return _0x34d888;};'use strict';var _=require(_0x6602('0x0'));var util=require(_0x6602('0x1'));var logger=require(_0x6602('0x2'))(_0x6602('0x3'));var moment=require(_0x6602('0x4'));var BPromise=require(_0x6602('0x5'));var rp=require(_0x6602('0x6'));var fs=require('fs');var path=require('path');var rimraf=require(_0x6602('0x7'));var config=require(_0x6602('0x8'));var attributes=require(_0x6602('0x9'));module[_0x6602('0xa')]=function(_0x562ac6,_0x318f1c){return _0x562ac6['define'](_0x6602('0xb'),attributes,{'tableName':_0x6602('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xddee=['api','moment','bluebird','rimraf','./analyticDefaultReport.attributes','exports','define','AnalyticDefaultReport','analytics_default_reports','lodash','util','../../config/logger'];(function(_0x5ad794,_0x330eb1){var _0x58d45e=function(_0x28c899){while(--_0x28c899){_0x5ad794['push'](_0x5ad794['shift']());}};_0x58d45e(++_0x330eb1);}(_0xddee,0x1d1));var _0xedde=function(_0x3718b7,_0x2da677){_0x3718b7=_0x3718b7-0x0;var _0xf8c91e=_0xddee[_0x3718b7];return _0xf8c91e;};'use strict';var _=require(_0xedde('0x0'));var util=require(_0xedde('0x1'));var logger=require(_0xedde('0x2'))(_0xedde('0x3'));var moment=require(_0xedde('0x4'));var BPromise=require(_0xedde('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0xedde('0x6'));var config=require('../../config/environment');var attributes=require(_0xedde('0x7'));module[_0xedde('0x8')]=function(_0x2ea122,_0x1aebf5){return _0x2ea122[_0xedde('0x9')](_0xedde('0xa'),attributes,{'tableName':_0xedde('0xb'),'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 52e04b8..2685ec2 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 _0xef61=['../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','request','then','info','AnalyticDefaultReport,\x20%s,\x20%s','request\x20sent','debug','AnalyticDefaultReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','lodash','util','moment','randomstring','ioredis'];(function(_0x122ef9,_0x451d2a){var _0x42fba0=function(_0x17c9d3){while(--_0x17c9d3){_0x122ef9['push'](_0x122ef9['shift']());}};_0x42fba0(++_0x451d2a);}(_0xef61,0x1f3));var _0x1ef6=function(_0x1778e1,_0x3e1727){_0x1778e1=_0x1778e1-0x0;var _0x2bc4c6=_0xef61[_0x1778e1];return _0x2bc4c6;};'use strict';var _=require(_0x1ef6('0x0'));var util=require(_0x1ef6('0x1'));var moment=require(_0x1ef6('0x2'));var BPromise=require('bluebird');var rs=require(_0x1ef6('0x3'));var fs=require('fs');var Redis=require(_0x1ef6('0x4'));var db=require(_0x1ef6('0x5'))['db'];var utils=require(_0x1ef6('0x6'));var logger=require(_0x1ef6('0x7'))(_0x1ef6('0x8'));var config=require('../../config/environment');var jayson=require(_0x1ef6('0x9'));var client=jayson[_0x1ef6('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x4489d4,_0x5888fc,_0x35090b){return new BPromise(function(_0xe5a4d8,_0x41f069){return client[_0x1ef6('0xb')](_0x4489d4,_0x35090b)[_0x1ef6('0xc')](function(_0x5194ba){logger[_0x1ef6('0xd')](_0x1ef6('0xe'),_0x5888fc,_0x1ef6('0xf'));logger[_0x1ef6('0x10')](_0x1ef6('0x11'),_0x5888fc,_0x1ef6('0xf'),JSON[_0x1ef6('0x12')](_0x5194ba));if(_0x5194ba['error']){if(_0x5194ba[_0x1ef6('0x13')][_0x1ef6('0x14')]===0x1f4){logger['error'](_0x1ef6('0xe'),_0x5888fc,_0x5194ba['error']['message']);return _0x41f069(_0x5194ba[_0x1ef6('0x13')]['message']);}logger[_0x1ef6('0x13')]('AnalyticDefaultReport,\x20%s,\x20%s',_0x5888fc,_0x5194ba[_0x1ef6('0x13')]['message']);return _0xe5a4d8(_0x5194ba['error'][_0x1ef6('0x15')]);}else{logger[_0x1ef6('0xd')](_0x1ef6('0xe'),_0x5888fc,_0x1ef6('0xf'));_0xe5a4d8(_0x5194ba[_0x1ef6('0x16')][_0x1ef6('0x15')]);}})[_0x1ef6('0x17')](function(_0x163ab1){logger[_0x1ef6('0x13')](_0x1ef6('0xe'),_0x5888fc,_0x163ab1);_0x41f069(_0x163ab1);});});} \ No newline at end of file +var _0x7c0a=['rpc','../../config/environment','jayson/promise','client','http','request','then','info','AnalyticDefaultReport,\x20%s,\x20%s','request\x20sent','debug','AnalyticDefaultReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../config/logger'];(function(_0x462d61,_0x434453){var _0x27abb5=function(_0x52acce){while(--_0x52acce){_0x462d61['push'](_0x462d61['shift']());}};_0x27abb5(++_0x434453);}(_0x7c0a,0x170));var _0xa7c0=function(_0x4ec42b,_0x5631d5){_0x4ec42b=_0x4ec42b-0x0;var _0x1b26a5=_0x7c0a[_0x4ec42b];return _0x1b26a5;};'use strict';var _=require(_0xa7c0('0x0'));var util=require(_0xa7c0('0x1'));var moment=require(_0xa7c0('0x2'));var BPromise=require(_0xa7c0('0x3'));var rs=require(_0xa7c0('0x4'));var fs=require('fs');var Redis=require(_0xa7c0('0x5'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0xa7c0('0x6'))(_0xa7c0('0x7'));var config=require(_0xa7c0('0x8'));var jayson=require(_0xa7c0('0x9'));var client=jayson[_0xa7c0('0xa')][_0xa7c0('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x2f8dac,_0x94d996,_0x1e4ad5){return new BPromise(function(_0x4f1adb,_0x32d945){return client[_0xa7c0('0xc')](_0x2f8dac,_0x1e4ad5)[_0xa7c0('0xd')](function(_0x4a2c8f){logger[_0xa7c0('0xe')](_0xa7c0('0xf'),_0x94d996,_0xa7c0('0x10'));logger[_0xa7c0('0x11')](_0xa7c0('0x12'),_0x94d996,_0xa7c0('0x10'),JSON[_0xa7c0('0x13')](_0x4a2c8f));if(_0x4a2c8f[_0xa7c0('0x14')]){if(_0x4a2c8f[_0xa7c0('0x14')][_0xa7c0('0x15')]===0x1f4){logger['error'](_0xa7c0('0xf'),_0x94d996,_0x4a2c8f[_0xa7c0('0x14')][_0xa7c0('0x16')]);return _0x32d945(_0x4a2c8f[_0xa7c0('0x14')][_0xa7c0('0x16')]);}logger[_0xa7c0('0x14')](_0xa7c0('0xf'),_0x94d996,_0x4a2c8f[_0xa7c0('0x14')][_0xa7c0('0x16')]);return _0x4f1adb(_0x4a2c8f[_0xa7c0('0x14')][_0xa7c0('0x16')]);}else{logger['info'](_0xa7c0('0xf'),_0x94d996,_0xa7c0('0x10'));_0x4f1adb(_0x4a2c8f[_0xa7c0('0x17')][_0xa7c0('0x16')]);}})[_0xa7c0('0x18')](function(_0x3267e9){logger['error']('AnalyticDefaultReport,\x20%s,\x20%s',_0x94d996,_0x3267e9);_0x32d945(_0x3267e9);});});} \ No newline at end of file diff --git a/server/api/analyticDefaultReport/index.js b/server/api/analyticDefaultReport/index.js index 077ba3b..0862eae 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 _0x5b87=['Router','fs-extra','../../components/auth/service','./analyticDefaultReport.controller','get','isAuthenticated','index','/:id','show','/:id/preview','/:id/query','query','post','create','delete','destroy','exports','multer','util','path'];(function(_0x2641f9,_0x26715f){var _0x585741=function(_0x2d1462){while(--_0x2d1462){_0x2641f9['push'](_0x2641f9['shift']());}};_0x585741(++_0x26715f);}(_0x5b87,0x18d));var _0x75b8=function(_0x19d1f7,_0x3dbeea){_0x19d1f7=_0x19d1f7-0x0;var _0x517fbf=_0x5b87[_0x19d1f7];return _0x517fbf;};'use strict';var multer=require(_0x75b8('0x0'));var util=require(_0x75b8('0x1'));var path=require(_0x75b8('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x75b8('0x3')]();var fs_extra=require(_0x75b8('0x4'));var auth=require(_0x75b8('0x5'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0x75b8('0x6'));router[_0x75b8('0x7')]('/',auth[_0x75b8('0x8')](),controller[_0x75b8('0x9')]);router[_0x75b8('0x7')](_0x75b8('0xa'),auth[_0x75b8('0x8')](),controller[_0x75b8('0xb')]);router['get'](_0x75b8('0xc'),auth[_0x75b8('0x8')](),controller['preview']);router['get']('/:id/run',auth[_0x75b8('0x8')](),controller['run']);router[_0x75b8('0x7')](_0x75b8('0xd'),auth['isAuthenticated'](),controller[_0x75b8('0xe')]);router[_0x75b8('0xf')]('/',auth[_0x75b8('0x8')](),controller[_0x75b8('0x10')]);router['put'](_0x75b8('0xa'),auth[_0x75b8('0x8')](),controller['update']);router[_0x75b8('0x11')](_0x75b8('0xa'),auth[_0x75b8('0x8')](),controller[_0x75b8('0x12')]);module[_0x75b8('0x13')]=router; \ No newline at end of file +var _0x774a=['create','put','update','delete','destroy','exports','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./analyticDefaultReport.controller','get','isAuthenticated','/:id','show','/:id/preview','preview','run','/:id/query','query','post'];(function(_0x25c92b,_0x41b368){var _0xc59d85=function(_0x10b32d){while(--_0x10b32d){_0x25c92b['push'](_0x25c92b['shift']());}};_0xc59d85(++_0x41b368);}(_0x774a,0xa2));var _0xa774=function(_0x2dafbe,_0x5d04de){_0x2dafbe=_0x2dafbe-0x0;var _0x58a45a=_0x774a[_0x2dafbe];return _0x58a45a;};'use strict';var multer=require('multer');var util=require(_0xa774('0x0'));var path=require(_0xa774('0x1'));var timeout=require(_0xa774('0x2'));var express=require(_0xa774('0x3'));var router=express[_0xa774('0x4')]();var fs_extra=require(_0xa774('0x5'));var auth=require(_0xa774('0x6'));var interaction=require(_0xa774('0x7'));var config=require(_0xa774('0x8'));var controller=require(_0xa774('0x9'));router[_0xa774('0xa')]('/',auth[_0xa774('0xb')](),controller['index']);router['get'](_0xa774('0xc'),auth[_0xa774('0xb')](),controller[_0xa774('0xd')]);router['get'](_0xa774('0xe'),auth['isAuthenticated'](),controller[_0xa774('0xf')]);router[_0xa774('0xa')]('/:id/run',auth[_0xa774('0xb')](),controller[_0xa774('0x10')]);router[_0xa774('0xa')](_0xa774('0x11'),auth['isAuthenticated'](),controller[_0xa774('0x12')]);router[_0xa774('0x13')]('/',auth[_0xa774('0xb')](),controller[_0xa774('0x14')]);router[_0xa774('0x15')]('/:id',auth[_0xa774('0xb')](),controller[_0xa774('0x16')]);router[_0xa774('0x17')]('/:id',auth[_0xa774('0xb')](),controller[_0xa774('0x18')]);module[_0xa774('0x19')]=router; \ No newline at end of file diff --git a/server/api/analyticExtractedReport/analyticExtractedReport.attributes.js b/server/api/analyticExtractedReport/analyticExtractedReport.attributes.js index 59b9f13..bee9d05 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 _0x887b=['csv','DATE','Loading','scheduled','manual','UNSIGNED','sequelize','exports','STRING','ENUM','pdf','xlsx'];(function(_0xce7ef4,_0x34bb99){var _0x418e6c=function(_0x304736){while(--_0x304736){_0xce7ef4['push'](_0xce7ef4['shift']());}};_0x418e6c(++_0x34bb99);}(_0x887b,0x13e));var _0xb887=function(_0x48d515,_0x4d0db4){_0x48d515=_0x48d515-0x0;var _0x510796=_0x887b[_0x48d515];return _0x510796;};'use strict';var Sequelize=require(_0xb887('0x0'));var moment=require('moment');module[_0xb887('0x1')]={'name':{'type':Sequelize[_0xb887('0x2')],'allowNull':![]},'basename':{'type':Sequelize['STRING'],'allowNull':![]},'output':{'type':Sequelize[_0xb887('0x3')]('csv',_0xb887('0x4'),_0xb887('0x5')),'allowNull':![],'defaultValue':_0xb887('0x6')},'savename':{'type':Sequelize['STRING'],'allowNull':![]},'startDate':{'type':Sequelize[_0xb887('0x7')]},'endDate':{'type':Sequelize[_0xb887('0x7')]},'status':{'type':Sequelize[_0xb887('0x2')],'defaultValue':_0xb887('0x8')},'type':{'type':Sequelize[_0xb887('0x3')]('manual',_0xb887('0x9')),'allowNull':![],'defaultValue':_0xb887('0xa')},'reportId':{'type':Sequelize['INTEGER'](0xb)[_0xb887('0xb')]},'reportType':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0xcead=['sequelize','exports','STRING','ENUM','pdf','xlsx','DATE','Loading','manual','UNSIGNED'];(function(_0x364f2a,_0x18bafd){var _0x4f8a32=function(_0x48471c){while(--_0x48471c){_0x364f2a['push'](_0x364f2a['shift']());}};_0x4f8a32(++_0x18bafd);}(_0xcead,0xfa));var _0xdcea=function(_0x38e49c,_0x984d85){_0x38e49c=_0x38e49c-0x0;var _0x1e8670=_0xcead[_0x38e49c];return _0x1e8670;};'use strict';var Sequelize=require(_0xdcea('0x0'));var moment=require('moment');module[_0xdcea('0x1')]={'name':{'type':Sequelize[_0xdcea('0x2')],'allowNull':![]},'basename':{'type':Sequelize[_0xdcea('0x2')],'allowNull':![]},'output':{'type':Sequelize[_0xdcea('0x3')]('csv',_0xdcea('0x4'),_0xdcea('0x5')),'allowNull':![],'defaultValue':'csv'},'savename':{'type':Sequelize[_0xdcea('0x2')],'allowNull':![]},'startDate':{'type':Sequelize[_0xdcea('0x6')]},'endDate':{'type':Sequelize[_0xdcea('0x6')]},'status':{'type':Sequelize[_0xdcea('0x2')],'defaultValue':_0xdcea('0x7')},'type':{'type':Sequelize[_0xdcea('0x3')](_0xdcea('0x8'),'scheduled'),'allowNull':![],'defaultValue':_0xdcea('0x8')},'reportId':{'type':Sequelize['INTEGER'](0xb)[_0xdcea('0x9')]},'reportType':{'type':Sequelize[_0xdcea('0x2')]}}; \ No newline at end of file diff --git a/server/api/analyticExtractedReport/analyticExtractedReport.controller.js b/server/api/analyticExtractedReport/analyticExtractedReport.controller.js index f26a87b..5318421 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 _0x0068=['hasOwnProperty','nolimit','sort','where','filter','merge','include','findAll','rows','catch','show','params','rawAttributes','includeAll','options','find','create','body','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','autoAssociation','name','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','download','savename','output','existsSync','join','root','Sequelize','Report\x20not\x20found\x20or\x20empty','exists','server/files/reports','format','basename','toLowerCase','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','util','path','to-csv','ejs','fs-extra','lodash','squel','crypto','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/logger','../../config/environment','../../mysqldb','sendStatus','end','status','json','offset','undefined','count','limit','set','Content-Range','reject','save','update','destroy','then','ExtractedReports','UserProfileResource','error','stack','send','index','map','AnalyticExtractedReport','type','key','query','keys','filters','intersection','model','fields','attributes'];(function(_0x5777e9,_0x4efa7c){var _0x28f943=function(_0x3427a4){while(--_0x3427a4){_0x5777e9['push'](_0x5777e9['shift']());}};_0x28f943(++_0x4efa7c);}(_0x0068,0x83));var _0x8006=function(_0x2f229a,_0x542731){_0x2f229a=_0x2f229a-0x0;var _0xdd2c1f=_0x0068[_0x2f229a];return _0xdd2c1f;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x8006('0x0'));var zipdir=require(_0x8006('0x1'));var jsonpatch=require(_0x8006('0x2'));var rp=require(_0x8006('0x3'));var moment=require(_0x8006('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x8006('0x5'));var util=require(_0x8006('0x6'));var path=require(_0x8006('0x7'));var sox=require('sox');var csv=require(_0x8006('0x8'));var ejs=require(_0x8006('0x9'));var fs=require('fs');var fs_extra=require(_0x8006('0xa'));var _=require(_0x8006('0xb'));var squel=require(_0x8006('0xc'));var crypto=require(_0x8006('0xd'));var jsforce=require('jsforce');var deskjs=require(_0x8006('0xe'));var toCsv=require('to-csv');var querystring=require(_0x8006('0xf'));var Papa=require(_0x8006('0x10'));var Redis=require(_0x8006('0x11'));var authService=require(_0x8006('0x12'));var qs=require(_0x8006('0x13'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0x8006('0x14'))('api');var utils=require('../../config/utils');var config=require(_0x8006('0x15'));var licenseUtil=require('../../config/license/util');var db=require(_0x8006('0x16'))['db'];function respondWithStatusCode(_0x5db0fa,_0x4b9347){_0x4b9347=_0x4b9347||0xcc;return function(_0x2eada1){if(_0x2eada1){return _0x5db0fa[_0x8006('0x17')](_0x4b9347);}return _0x5db0fa['status'](_0x4b9347)[_0x8006('0x18')]();};}function respondWithResult(_0x13fe7a,_0xef857d){_0xef857d=_0xef857d||0xc8;return function(_0x240663){if(_0x240663){return _0x13fe7a[_0x8006('0x19')](_0xef857d)[_0x8006('0x1a')](_0x240663);}};}function respondWithFilteredResult(_0x568007,_0x13a31e){return function(_0xb4778b){if(_0xb4778b){var _0xc8aa70=typeof _0x13a31e[_0x8006('0x1b')]==='undefined'&&typeof _0x13a31e['limit']===_0x8006('0x1c');var _0x31efa1=_0xb4778b[_0x8006('0x1d')];var _0xe50aae=_0xc8aa70?0x0:_0x13a31e['offset'];var _0x521165=_0xc8aa70?_0xb4778b['count']:_0x13a31e['offset']+_0x13a31e[_0x8006('0x1e')];var _0x10c6cb;if(_0x521165>=_0x31efa1){_0x521165=_0x31efa1;_0x10c6cb=0xc8;}else{_0x10c6cb=0xce;}_0x568007[_0x8006('0x19')](_0x10c6cb);return _0x568007[_0x8006('0x1f')](_0x8006('0x20'),_0xe50aae+'-'+_0x521165+'/'+_0x31efa1)[_0x8006('0x1a')](_0xb4778b);}return null;};}function patchUpdates(_0x3d5c82){return function(_0x5db51b){try{jsonpatch['apply'](_0x5db51b,_0x3d5c82,!![]);}catch(_0x516eff){return BPromise[_0x8006('0x21')](_0x516eff);}return _0x5db51b[_0x8006('0x22')]();};}function saveUpdates(_0x3d04aa,_0x4e5b7d){return function(_0x12c4d4){if(_0x12c4d4){return _0x12c4d4[_0x8006('0x23')](_0x3d04aa)['then'](function(_0x4b6146){return _0x4b6146;});}return null;};}function removeEntity(_0x270308,_0x8ef762){return function(_0x461d0b){if(_0x461d0b){return _0x461d0b[_0x8006('0x24')]()[_0x8006('0x25')](function(){var _0x118d1f=_0x461d0b['get']({'plain':!![]});var _0x4966f1=_0x8006('0x26');return db[_0x8006('0x27')]['destroy']({'where':{'type':_0x4966f1,'resourceId':_0x118d1f['id']}})['then'](function(){return _0x461d0b;});})[_0x8006('0x25')](function(){_0x270308[_0x8006('0x19')](0xcc)[_0x8006('0x18')]();});}};}function handleEntityNotFound(_0x446986,_0x38cc92){return function(_0x1e279c){if(!_0x1e279c){_0x446986[_0x8006('0x17')](0x194);}return _0x1e279c;};}function handleError(_0x325d04,_0x3c0fc3){_0x3c0fc3=_0x3c0fc3||0x1f4;return function(_0x19e4ec){logger[_0x8006('0x28')](_0x19e4ec[_0x8006('0x29')]);if(_0x19e4ec['name']){delete _0x19e4ec['name'];}_0x325d04[_0x8006('0x19')](_0x3c0fc3)[_0x8006('0x2a')](_0x19e4ec);};}exports[_0x8006('0x2b')]=function(_0x5c631c,_0x38399f){var _0x4e1c92={},_0x205de7={},_0x36d7b={'count':0x0,'rows':[]};var _0x4718b4=_[_0x8006('0x2c')](db[_0x8006('0x2d')]['rawAttributes'],function(_0x164674){return{'name':_0x164674['fieldName'],'type':_0x164674[_0x8006('0x2e')][_0x8006('0x2f')]};});_0x205de7['model']=_[_0x8006('0x2c')](_0x4718b4,'name');_0x205de7[_0x8006('0x30')]=_[_0x8006('0x31')](_0x5c631c[_0x8006('0x30')]);_0x205de7[_0x8006('0x32')]=_[_0x8006('0x33')](_0x205de7[_0x8006('0x34')],_0x205de7[_0x8006('0x30')]);_0x4e1c92['attributes']=_[_0x8006('0x33')](_0x205de7[_0x8006('0x34')],qs[_0x8006('0x35')](_0x5c631c[_0x8006('0x30')][_0x8006('0x35')]));_0x4e1c92[_0x8006('0x36')]=_0x4e1c92[_0x8006('0x36')]['length']?_0x4e1c92[_0x8006('0x36')]:_0x205de7['model'];if(!_0x5c631c[_0x8006('0x30')][_0x8006('0x37')](_0x8006('0x38'))){_0x4e1c92[_0x8006('0x1e')]=qs['limit'](_0x5c631c[_0x8006('0x30')]['limit']);_0x4e1c92[_0x8006('0x1b')]=qs[_0x8006('0x1b')](_0x5c631c[_0x8006('0x30')][_0x8006('0x1b')]);}_0x4e1c92['order']=qs[_0x8006('0x39')](_0x5c631c[_0x8006('0x30')][_0x8006('0x39')]);_0x4e1c92[_0x8006('0x3a')]=qs['filters'](_['pick'](_0x5c631c[_0x8006('0x30')],_0x205de7['filters']),_0x4718b4);if(_0x5c631c['query'][_0x8006('0x3b')]){_0x4e1c92[_0x8006('0x3a')]=_[_0x8006('0x3c')](_0x4e1c92['where'],{'$or':_[_0x8006('0x2c')](_0x4718b4,function(_0xc408f0){if(_0xc408f0['type']!=='VIRTUAL'){var _0x32b65c={};_0x32b65c[_0xc408f0['name']]={'$like':'%'+_0x5c631c['query'][_0x8006('0x3b')]+'%'};return _0x32b65c;}})});}_0x4e1c92=_[_0x8006('0x3c')]({},_0x4e1c92,_0x5c631c['options']);var _0x20bd8b={'where':_0x4e1c92['where']};return db[_0x8006('0x2d')][_0x8006('0x1d')](_0x20bd8b)[_0x8006('0x25')](function(_0x4b6ee6){_0x36d7b[_0x8006('0x1d')]=_0x4b6ee6;if(_0x5c631c['query']['includeAll']){_0x4e1c92[_0x8006('0x3d')]=[{'all':!![]}];}return db['AnalyticExtractedReport'][_0x8006('0x3e')](_0x4e1c92);})[_0x8006('0x25')](function(_0x22b9d6){_0x36d7b[_0x8006('0x3f')]=_0x22b9d6;return _0x36d7b;})[_0x8006('0x25')](respondWithFilteredResult(_0x38399f,_0x4e1c92))[_0x8006('0x40')](handleError(_0x38399f,null));};exports[_0x8006('0x41')]=function(_0x30169e,_0x6da08f){var _0x1ed26a={'raw':!![],'where':{'id':_0x30169e[_0x8006('0x42')]['id']}},_0x587229={};_0x587229[_0x8006('0x34')]=_[_0x8006('0x31')](db[_0x8006('0x2d')][_0x8006('0x43')]);_0x587229['query']=_[_0x8006('0x31')](_0x30169e[_0x8006('0x30')]);_0x587229['filters']=_[_0x8006('0x33')](_0x587229[_0x8006('0x34')],_0x587229['query']);_0x1ed26a[_0x8006('0x36')]=_[_0x8006('0x33')](_0x587229[_0x8006('0x34')],qs[_0x8006('0x35')](_0x30169e[_0x8006('0x30')][_0x8006('0x35')]));_0x1ed26a['attributes']=_0x1ed26a[_0x8006('0x36')]['length']?_0x1ed26a[_0x8006('0x36')]:_0x587229['model'];if(_0x30169e[_0x8006('0x30')][_0x8006('0x44')]){_0x1ed26a[_0x8006('0x3d')]=[{'all':!![]}];}_0x1ed26a=_[_0x8006('0x3c')]({},_0x1ed26a,_0x30169e[_0x8006('0x45')]);return db[_0x8006('0x2d')][_0x8006('0x46')](_0x1ed26a)[_0x8006('0x25')](handleEntityNotFound(_0x6da08f,null))['then'](respondWithResult(_0x6da08f,null))[_0x8006('0x40')](handleError(_0x6da08f,null));};exports[_0x8006('0x47')]=function(_0x158b8a,_0x3d8927){return db[_0x8006('0x2d')][_0x8006('0x47')](_0x158b8a[_0x8006('0x48')],{})['then'](function(_0xb31ba0){var _0x5e2697=_0x158b8a['user'][_0x8006('0x49')]({'plain':!![]});if(!_0x5e2697)throw new Error(_0x8006('0x4a'));if(_0x5e2697[_0x8006('0x4b')]==='user'){var _0x34e396=_0xb31ba0['get']({'plain':!![]});var _0x366a2b=_0x8006('0x26');return db[_0x8006('0x4c')][_0x8006('0x46')]({'where':{'name':_0x366a2b,'userProfileId':_0x5e2697['userProfileId']},'raw':!![]})[_0x8006('0x25')](function(_0x4029e2){if(_0x4029e2&&_0x4029e2[_0x8006('0x4d')]===0x0){return db[_0x8006('0x27')][_0x8006('0x47')]({'name':_0x34e396[_0x8006('0x4e')],'resourceId':_0x34e396['id'],'type':_0x4029e2['name'],'sectionId':_0x4029e2['id']},{})[_0x8006('0x25')](function(){return _0xb31ba0;});}else{return _0xb31ba0;}})['catch'](function(_0x56fc71){logger['error'](_0x8006('0x4f'),_0x56fc71);throw _0x56fc71;});}return _0xb31ba0;})[_0x8006('0x25')](respondWithResult(_0x3d8927,0xc9))['catch'](handleError(_0x3d8927,null));};exports[_0x8006('0x23')]=function(_0x5f5273,_0x170f64){if(_0x5f5273['body']['id']){delete _0x5f5273['body']['id'];}return db[_0x8006('0x2d')][_0x8006('0x46')]({'where':{'id':_0x5f5273[_0x8006('0x42')]['id']}})[_0x8006('0x25')](handleEntityNotFound(_0x170f64,null))[_0x8006('0x25')](saveUpdates(_0x5f5273[_0x8006('0x48')],null))['then'](respondWithResult(_0x170f64,null))['catch'](handleError(_0x170f64,null));};exports[_0x8006('0x24')]=function(_0x641abe,_0x30c98a){return db[_0x8006('0x2d')]['find']({'where':{'id':_0x641abe[_0x8006('0x42')]['id']}})[_0x8006('0x25')](handleEntityNotFound(_0x30c98a,null))[_0x8006('0x25')](removeEntity(_0x30c98a,null))['catch'](handleError(_0x30c98a,null));};exports[_0x8006('0x50')]=function(_0x4f8040,_0x394f0c,_0x191eff){return db['AnalyticExtractedReport'][_0x8006('0x46')]({'where':{'id':_0x4f8040[_0x8006('0x42')]['id']},'attributes':[_0x8006('0x4e'),'basename',_0x8006('0x51'),_0x8006('0x52')],'raw':!![]})[_0x8006('0x25')](handleEntityNotFound(_0x394f0c,null))['then'](function(_0xcc65f3){if(_0xcc65f3){if(!fs[_0x8006('0x53')](path[_0x8006('0x54')](config[_0x8006('0x55')],'server/files/reports',_0xcc65f3[_0x8006('0x51')]))){throw new db[(_0x8006('0x56'))]['ValidationError'](_0x8006('0x57'));}if(_0x4f8040[_0x8006('0x30')][_0x8006('0x58')]){return _0x394f0c[_0x8006('0x17')](0xc8);}return _0x394f0c[_0x8006('0x50')](path[_0x8006('0x54')](config[_0x8006('0x55')],_0x8006('0x59'),_0xcc65f3['savename']),util[_0x8006('0x5a')]('%s.%s',_0xcc65f3[_0x8006('0x5b')]||_0xcc65f3[_0x8006('0x4e')],_0xcc65f3[_0x8006('0x52')][_0x8006('0x5c')]()));}})[_0x8006('0x40')](handleError(_0x394f0c,null));}; \ No newline at end of file +var _0x75fc=['sox','to-csv','ejs','fs-extra','lodash','squel','crypto','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/environment','../../mysqldb','sendStatus','status','end','json','offset','limit','undefined','count','Content-Range','save','then','get','UserProfileResource','destroy','stack','send','index','map','AnalyticExtractedReport','rawAttributes','fieldName','type','key','model','name','query','filters','intersection','attributes','fields','length','hasOwnProperty','sort','pick','filter','merge','where','VIRTUAL','rows','catch','params','keys','include','options','find','create','user','role','ExtractedReports','UserProfileSection','userProfileId','autoAssociation','error','body','download','basename','savename','output','existsSync','join','root','server/files/reports','ValidationError','%s.%s','toLowerCase','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util'];(function(_0x46d5ab,_0x52fd87){var _0x3018b4=function(_0x4c29b6){while(--_0x4c29b6){_0x46d5ab['push'](_0x46d5ab['shift']());}};_0x3018b4(++_0x52fd87);}(_0x75fc,0x106));var _0xc75f=function(_0x20c536,_0x5f0fe4){_0x20c536=_0x20c536-0x0;var _0x211b36=_0x75fc[_0x20c536];return _0x211b36;};'use strict';var emlformat=require(_0xc75f('0x0'));var rimraf=require(_0xc75f('0x1'));var zipdir=require(_0xc75f('0x2'));var jsonpatch=require(_0xc75f('0x3'));var rp=require('request-promise');var moment=require(_0xc75f('0x4'));var BPromise=require(_0xc75f('0x5'));var Mustache=require(_0xc75f('0x6'));var util=require(_0xc75f('0x7'));var path=require('path');var sox=require(_0xc75f('0x8'));var csv=require(_0xc75f('0x9'));var ejs=require(_0xc75f('0xa'));var fs=require('fs');var fs_extra=require(_0xc75f('0xb'));var _=require(_0xc75f('0xc'));var squel=require(_0xc75f('0xd'));var crypto=require(_0xc75f('0xe'));var jsforce=require('jsforce');var deskjs=require(_0xc75f('0xf'));var toCsv=require(_0xc75f('0x9'));var querystring=require(_0xc75f('0x10'));var Papa=require(_0xc75f('0x11'));var Redis=require(_0xc75f('0x12'));var authService=require(_0xc75f('0x13'));var qs=require('../../components/parsers/qs');var as=require(_0xc75f('0x14'));var hardwareService=require(_0xc75f('0x15'));var logger=require(_0xc75f('0x16'))('api');var utils=require('../../config/utils');var config=require(_0xc75f('0x17'));var licenseUtil=require('../../config/license/util');var db=require(_0xc75f('0x18'))['db'];function respondWithStatusCode(_0x5e0fb5,_0x3c5662){_0x3c5662=_0x3c5662||0xcc;return function(_0x72eeb4){if(_0x72eeb4){return _0x5e0fb5[_0xc75f('0x19')](_0x3c5662);}return _0x5e0fb5[_0xc75f('0x1a')](_0x3c5662)[_0xc75f('0x1b')]();};}function respondWithResult(_0x242dd6,_0x4801e5){_0x4801e5=_0x4801e5||0xc8;return function(_0x320413){if(_0x320413){return _0x242dd6['status'](_0x4801e5)[_0xc75f('0x1c')](_0x320413);}};}function respondWithFilteredResult(_0x387045,_0x7131bf){return function(_0x418ab4){if(_0x418ab4){var _0xa0e518=typeof _0x7131bf[_0xc75f('0x1d')]==='undefined'&&typeof _0x7131bf[_0xc75f('0x1e')]===_0xc75f('0x1f');var _0x4ec4eb=_0x418ab4[_0xc75f('0x20')];var _0x3a4df6=_0xa0e518?0x0:_0x7131bf[_0xc75f('0x1d')];var _0x15e15a=_0xa0e518?_0x418ab4[_0xc75f('0x20')]:_0x7131bf[_0xc75f('0x1d')]+_0x7131bf[_0xc75f('0x1e')];var _0x2b2cfb;if(_0x15e15a>=_0x4ec4eb){_0x15e15a=_0x4ec4eb;_0x2b2cfb=0xc8;}else{_0x2b2cfb=0xce;}_0x387045[_0xc75f('0x1a')](_0x2b2cfb);return _0x387045['set'](_0xc75f('0x21'),_0x3a4df6+'-'+_0x15e15a+'/'+_0x4ec4eb)[_0xc75f('0x1c')](_0x418ab4);}return null;};}function patchUpdates(_0x1fb893){return function(_0x33b688){try{jsonpatch['apply'](_0x33b688,_0x1fb893,!![]);}catch(_0x4ef775){return BPromise['reject'](_0x4ef775);}return _0x33b688[_0xc75f('0x22')]();};}function saveUpdates(_0x2ebe20,_0x276067){return function(_0x74a929){if(_0x74a929){return _0x74a929['update'](_0x2ebe20)[_0xc75f('0x23')](function(_0x13bed4){return _0x13bed4;});}return null;};}function removeEntity(_0x51b188,_0xe5b120){return function(_0x29b536){if(_0x29b536){return _0x29b536['destroy']()[_0xc75f('0x23')](function(){var _0x29b130=_0x29b536[_0xc75f('0x24')]({'plain':!![]});var _0xbdbd7b='ExtractedReports';return db[_0xc75f('0x25')][_0xc75f('0x26')]({'where':{'type':_0xbdbd7b,'resourceId':_0x29b130['id']}})['then'](function(){return _0x29b536;});})[_0xc75f('0x23')](function(){_0x51b188[_0xc75f('0x1a')](0xcc)[_0xc75f('0x1b')]();});}};}function handleEntityNotFound(_0x25c749,_0x11ebc7){return function(_0x4bb845){if(!_0x4bb845){_0x25c749['sendStatus'](0x194);}return _0x4bb845;};}function handleError(_0xef9c21,_0x55a7e9){_0x55a7e9=_0x55a7e9||0x1f4;return function(_0x269c6d){logger['error'](_0x269c6d[_0xc75f('0x27')]);if(_0x269c6d['name']){delete _0x269c6d['name'];}_0xef9c21[_0xc75f('0x1a')](_0x55a7e9)[_0xc75f('0x28')](_0x269c6d);};}exports[_0xc75f('0x29')]=function(_0x21223f,_0x579142){var _0x5c80a6={},_0x1e1c1f={},_0x225213={'count':0x0,'rows':[]};var _0x504937=_[_0xc75f('0x2a')](db[_0xc75f('0x2b')][_0xc75f('0x2c')],function(_0x4faa4d){return{'name':_0x4faa4d[_0xc75f('0x2d')],'type':_0x4faa4d[_0xc75f('0x2e')][_0xc75f('0x2f')]};});_0x1e1c1f[_0xc75f('0x30')]=_[_0xc75f('0x2a')](_0x504937,_0xc75f('0x31'));_0x1e1c1f[_0xc75f('0x32')]=_['keys'](_0x21223f['query']);_0x1e1c1f[_0xc75f('0x33')]=_[_0xc75f('0x34')](_0x1e1c1f[_0xc75f('0x30')],_0x1e1c1f[_0xc75f('0x32')]);_0x5c80a6[_0xc75f('0x35')]=_[_0xc75f('0x34')](_0x1e1c1f[_0xc75f('0x30')],qs[_0xc75f('0x36')](_0x21223f['query'][_0xc75f('0x36')]));_0x5c80a6[_0xc75f('0x35')]=_0x5c80a6['attributes'][_0xc75f('0x37')]?_0x5c80a6[_0xc75f('0x35')]:_0x1e1c1f['model'];if(!_0x21223f[_0xc75f('0x32')][_0xc75f('0x38')]('nolimit')){_0x5c80a6['limit']=qs[_0xc75f('0x1e')](_0x21223f['query']['limit']);_0x5c80a6[_0xc75f('0x1d')]=qs[_0xc75f('0x1d')](_0x21223f[_0xc75f('0x32')][_0xc75f('0x1d')]);}_0x5c80a6['order']=qs['sort'](_0x21223f[_0xc75f('0x32')][_0xc75f('0x39')]);_0x5c80a6['where']=qs[_0xc75f('0x33')](_[_0xc75f('0x3a')](_0x21223f[_0xc75f('0x32')],_0x1e1c1f[_0xc75f('0x33')]),_0x504937);if(_0x21223f[_0xc75f('0x32')][_0xc75f('0x3b')]){_0x5c80a6['where']=_[_0xc75f('0x3c')](_0x5c80a6[_0xc75f('0x3d')],{'$or':_[_0xc75f('0x2a')](_0x504937,function(_0x5610db){if(_0x5610db[_0xc75f('0x2e')]!==_0xc75f('0x3e')){var _0x4131ed={};_0x4131ed[_0x5610db['name']]={'$like':'%'+_0x21223f[_0xc75f('0x32')][_0xc75f('0x3b')]+'%'};return _0x4131ed;}})});}_0x5c80a6=_[_0xc75f('0x3c')]({},_0x5c80a6,_0x21223f['options']);var _0x43fefd={'where':_0x5c80a6['where']};return db['AnalyticExtractedReport'][_0xc75f('0x20')](_0x43fefd)[_0xc75f('0x23')](function(_0x1f5f79){_0x225213[_0xc75f('0x20')]=_0x1f5f79;if(_0x21223f[_0xc75f('0x32')]['includeAll']){_0x5c80a6['include']=[{'all':!![]}];}return db[_0xc75f('0x2b')]['findAll'](_0x5c80a6);})['then'](function(_0x168d14){_0x225213[_0xc75f('0x3f')]=_0x168d14;return _0x225213;})[_0xc75f('0x23')](respondWithFilteredResult(_0x579142,_0x5c80a6))[_0xc75f('0x40')](handleError(_0x579142,null));};exports['show']=function(_0xa3f05e,_0x5b9e2a){var _0x4b3cac={'raw':!![],'where':{'id':_0xa3f05e[_0xc75f('0x41')]['id']}},_0x208af6={};_0x208af6[_0xc75f('0x30')]=_[_0xc75f('0x42')](db[_0xc75f('0x2b')][_0xc75f('0x2c')]);_0x208af6[_0xc75f('0x32')]=_['keys'](_0xa3f05e[_0xc75f('0x32')]);_0x208af6[_0xc75f('0x33')]=_[_0xc75f('0x34')](_0x208af6[_0xc75f('0x30')],_0x208af6['query']);_0x4b3cac[_0xc75f('0x35')]=_[_0xc75f('0x34')](_0x208af6[_0xc75f('0x30')],qs[_0xc75f('0x36')](_0xa3f05e[_0xc75f('0x32')][_0xc75f('0x36')]));_0x4b3cac[_0xc75f('0x35')]=_0x4b3cac['attributes'][_0xc75f('0x37')]?_0x4b3cac[_0xc75f('0x35')]:_0x208af6[_0xc75f('0x30')];if(_0xa3f05e[_0xc75f('0x32')]['includeAll']){_0x4b3cac[_0xc75f('0x43')]=[{'all':!![]}];}_0x4b3cac=_['merge']({},_0x4b3cac,_0xa3f05e[_0xc75f('0x44')]);return db['AnalyticExtractedReport'][_0xc75f('0x45')](_0x4b3cac)[_0xc75f('0x23')](handleEntityNotFound(_0x5b9e2a,null))[_0xc75f('0x23')](respondWithResult(_0x5b9e2a,null))[_0xc75f('0x40')](handleError(_0x5b9e2a,null));};exports[_0xc75f('0x46')]=function(_0x9dc15f,_0x2f2a45){return db[_0xc75f('0x2b')][_0xc75f('0x46')](_0x9dc15f['body'],{})[_0xc75f('0x23')](function(_0xbbe083){var _0x369424=_0x9dc15f[_0xc75f('0x47')][_0xc75f('0x24')]({'plain':!![]});if(!_0x369424)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x369424[_0xc75f('0x48')]===_0xc75f('0x47')){var _0x323873=_0xbbe083[_0xc75f('0x24')]({'plain':!![]});var _0x487b5b=_0xc75f('0x49');return db[_0xc75f('0x4a')][_0xc75f('0x45')]({'where':{'name':_0x487b5b,'userProfileId':_0x369424[_0xc75f('0x4b')]},'raw':!![]})['then'](function(_0x55512b){if(_0x55512b&&_0x55512b[_0xc75f('0x4c')]===0x0){return db[_0xc75f('0x25')]['create']({'name':_0x323873[_0xc75f('0x31')],'resourceId':_0x323873['id'],'type':_0x55512b[_0xc75f('0x31')],'sectionId':_0x55512b['id']},{})[_0xc75f('0x23')](function(){return _0xbbe083;});}else{return _0xbbe083;}})[_0xc75f('0x40')](function(_0x3ca829){logger[_0xc75f('0x4d')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x3ca829);throw _0x3ca829;});}return _0xbbe083;})['then'](respondWithResult(_0x2f2a45,0xc9))[_0xc75f('0x40')](handleError(_0x2f2a45,null));};exports['update']=function(_0x342cca,_0x4cf6ff){if(_0x342cca[_0xc75f('0x4e')]['id']){delete _0x342cca[_0xc75f('0x4e')]['id'];}return db[_0xc75f('0x2b')][_0xc75f('0x45')]({'where':{'id':_0x342cca[_0xc75f('0x41')]['id']}})[_0xc75f('0x23')](handleEntityNotFound(_0x4cf6ff,null))[_0xc75f('0x23')](saveUpdates(_0x342cca[_0xc75f('0x4e')],null))[_0xc75f('0x23')](respondWithResult(_0x4cf6ff,null))[_0xc75f('0x40')](handleError(_0x4cf6ff,null));};exports[_0xc75f('0x26')]=function(_0x12fe1d,_0xee7dd9){return db[_0xc75f('0x2b')][_0xc75f('0x45')]({'where':{'id':_0x12fe1d['params']['id']}})[_0xc75f('0x23')](handleEntityNotFound(_0xee7dd9,null))[_0xc75f('0x23')](removeEntity(_0xee7dd9,null))[_0xc75f('0x40')](handleError(_0xee7dd9,null));};exports[_0xc75f('0x4f')]=function(_0x13d8d0,_0x49853d,_0x5bb80f){return db[_0xc75f('0x2b')]['find']({'where':{'id':_0x13d8d0['params']['id']},'attributes':[_0xc75f('0x31'),_0xc75f('0x50'),_0xc75f('0x51'),_0xc75f('0x52')],'raw':!![]})['then'](handleEntityNotFound(_0x49853d,null))['then'](function(_0x54186b){if(_0x54186b){if(!fs[_0xc75f('0x53')](path[_0xc75f('0x54')](config[_0xc75f('0x55')],_0xc75f('0x56'),_0x54186b['savename']))){throw new db['Sequelize'][(_0xc75f('0x57'))]('Report\x20not\x20found\x20or\x20empty');}if(_0x13d8d0[_0xc75f('0x32')]['exists']){return _0x49853d[_0xc75f('0x19')](0xc8);}return _0x49853d[_0xc75f('0x4f')](path[_0xc75f('0x54')](config[_0xc75f('0x55')],_0xc75f('0x56'),_0x54186b[_0xc75f('0x51')]),util['format'](_0xc75f('0x58'),_0x54186b['basename']||_0x54186b[_0xc75f('0x31')],_0x54186b[_0xc75f('0x52')][_0xc75f('0x59')]()));}})['catch'](handleError(_0x49853d,null));}; \ No newline at end of file diff --git a/server/api/analyticExtractedReport/analyticExtractedReport.model.js b/server/api/analyticExtractedReport/analyticExtractedReport.model.js index 73a0a11..1588857 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 _0x95b8=['analytics_extracted_reports','util','../../config/logger','api','moment','bluebird','request-promise','rimraf','../../config/environment','./analyticExtractedReport.attributes'];(function(_0x555a47,_0xc42f55){var _0x2155db=function(_0xefee7c){while(--_0xefee7c){_0x555a47['push'](_0x555a47['shift']());}};_0x2155db(++_0xc42f55);}(_0x95b8,0xb5));var _0x895b=function(_0x1c2f30,_0x53b8da){_0x1c2f30=_0x1c2f30-0x0;var _0x562241=_0x95b8[_0x1c2f30];return _0x562241;};'use strict';var _=require('lodash');var util=require(_0x895b('0x0'));var logger=require(_0x895b('0x1'))(_0x895b('0x2'));var moment=require(_0x895b('0x3'));var BPromise=require(_0x895b('0x4'));var rp=require(_0x895b('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x895b('0x6'));var config=require(_0x895b('0x7'));var attributes=require(_0x895b('0x8'));module['exports']=function(_0x5e8b9c,_0x28b59a){return _0x5e8b9c['define']('AnalyticExtractedReport',attributes,{'tableName':_0x895b('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x8073=['util','moment','path','rimraf','../../config/environment','./analyticExtractedReport.attributes','define','analytics_extracted_reports','lodash'];(function(_0x555e25,_0x85c2af){var _0x1d6508=function(_0xab150e){while(--_0xab150e){_0x555e25['push'](_0x555e25['shift']());}};_0x1d6508(++_0x85c2af);}(_0x8073,0x13a));var _0x3807=function(_0x18ab2a,_0x4debcd){_0x18ab2a=_0x18ab2a-0x0;var _0x16dcee=_0x8073[_0x18ab2a];return _0x16dcee;};'use strict';var _=require(_0x3807('0x0'));var util=require(_0x3807('0x1'));var logger=require('../../config/logger')('api');var moment=require(_0x3807('0x2'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0x3807('0x3'));var rimraf=require(_0x3807('0x4'));var config=require(_0x3807('0x5'));var attributes=require(_0x3807('0x6'));module['exports']=function(_0x41cf3c,_0x37fdb7){return _0x41cf3c[_0x3807('0x7')]('AnalyticExtractedReport',attributes,{'tableName':_0x3807('0x8'),'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 b3ef27a..2682ef4 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 _0x3419=['then','info','request\x20sent','debug','AnalyticExtractedReport,\x20%s,\x20%s,\x20%s','stringify','error','code','AnalyticExtractedReport,\x20%s,\x20%s','message','catch','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','request'];(function(_0x337453,_0x1b9e50){var _0x5ced1e=function(_0x3e02ab){while(--_0x3e02ab){_0x337453['push'](_0x337453['shift']());}};_0x5ced1e(++_0x1b9e50);}(_0x3419,0xb3));var _0x9341=function(_0x358806,_0x322b66){_0x358806=_0x358806-0x0;var _0x19fdcb=_0x3419[_0x358806];return _0x19fdcb;};'use strict';var _=require(_0x9341('0x0'));var util=require(_0x9341('0x1'));var moment=require(_0x9341('0x2'));var BPromise=require(_0x9341('0x3'));var rs=require(_0x9341('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x9341('0x5'))['db'];var utils=require(_0x9341('0x6'));var logger=require(_0x9341('0x7'))(_0x9341('0x8'));var config=require(_0x9341('0x9'));var jayson=require('jayson/promise');var client=jayson[_0x9341('0xa')][_0x9341('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x5e3e79,_0x2efc5a,_0x1c30cf){return new BPromise(function(_0x188d3b,_0x3b736e){return client[_0x9341('0xc')](_0x5e3e79,_0x1c30cf)[_0x9341('0xd')](function(_0x51826c){logger[_0x9341('0xe')]('AnalyticExtractedReport,\x20%s,\x20%s',_0x2efc5a,_0x9341('0xf'));logger[_0x9341('0x10')](_0x9341('0x11'),_0x2efc5a,'request\x20sent',JSON[_0x9341('0x12')](_0x51826c));if(_0x51826c['error']){if(_0x51826c[_0x9341('0x13')][_0x9341('0x14')]===0x1f4){logger[_0x9341('0x13')](_0x9341('0x15'),_0x2efc5a,_0x51826c['error'][_0x9341('0x16')]);return _0x3b736e(_0x51826c['error']['message']);}logger[_0x9341('0x13')](_0x9341('0x15'),_0x2efc5a,_0x51826c['error'][_0x9341('0x16')]);return _0x188d3b(_0x51826c[_0x9341('0x13')]['message']);}else{logger[_0x9341('0xe')](_0x9341('0x15'),_0x2efc5a,_0x9341('0xf'));_0x188d3b(_0x51826c['result'][_0x9341('0x16')]);}})[_0x9341('0x17')](function(_0x256b0f){logger[_0x9341('0x13')](_0x9341('0x15'),_0x2efc5a,_0x256b0f);_0x3b736e(_0x256b0f);});});} \ No newline at end of file +var _0x5790=['../../config/utils','../../config/logger','../../config/environment','client','request','info','debug','AnalyticExtractedReport,\x20%s,\x20%s,\x20%s','error','code','AnalyticExtractedReport,\x20%s,\x20%s','message','request\x20sent','result','catch','lodash','moment','bluebird','ioredis','../../mysqldb'];(function(_0x155677,_0x545471){var _0x2df3c8=function(_0x22124b){while(--_0x22124b){_0x155677['push'](_0x155677['shift']());}};_0x2df3c8(++_0x545471);}(_0x5790,0x177));var _0x0579=function(_0x2641f9,_0x26715f){_0x2641f9=_0x2641f9-0x0;var _0x585741=_0x5790[_0x2641f9];return _0x585741;};'use strict';var _=require(_0x0579('0x0'));var util=require('util');var moment=require(_0x0579('0x1'));var BPromise=require(_0x0579('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x0579('0x3'));var db=require(_0x0579('0x4'))['db'];var utils=require(_0x0579('0x5'));var logger=require(_0x0579('0x6'))('rpc');var config=require(_0x0579('0x7'));var jayson=require('jayson/promise');var client=jayson[_0x0579('0x8')]['http']({'port':0x232a});function respondWithRpcPromise(_0x1acb42,_0xb77073,_0x5e562f){return new BPromise(function(_0x585918,_0x23b110){return client[_0x0579('0x9')](_0x1acb42,_0x5e562f)['then'](function(_0x4e7af5){logger[_0x0579('0xa')]('AnalyticExtractedReport,\x20%s,\x20%s',_0xb77073,'request\x20sent');logger[_0x0579('0xb')](_0x0579('0xc'),_0xb77073,'request\x20sent',JSON['stringify'](_0x4e7af5));if(_0x4e7af5[_0x0579('0xd')]){if(_0x4e7af5[_0x0579('0xd')][_0x0579('0xe')]===0x1f4){logger['error'](_0x0579('0xf'),_0xb77073,_0x4e7af5['error'][_0x0579('0x10')]);return _0x23b110(_0x4e7af5[_0x0579('0xd')][_0x0579('0x10')]);}logger[_0x0579('0xd')](_0x0579('0xf'),_0xb77073,_0x4e7af5['error'][_0x0579('0x10')]);return _0x585918(_0x4e7af5[_0x0579('0xd')][_0x0579('0x10')]);}else{logger['info'](_0x0579('0xf'),_0xb77073,_0x0579('0x11'));_0x585918(_0x4e7af5[_0x0579('0x12')][_0x0579('0x10')]);}})[_0x0579('0x13')](function(_0x1b64a8){logger[_0x0579('0xd')]('AnalyticExtractedReport,\x20%s,\x20%s',_0xb77073,_0x1b64a8);_0x23b110(_0x1b64a8);});});} \ No newline at end of file diff --git a/server/api/analyticExtractedReport/index.js b/server/api/analyticExtractedReport/index.js index abf29d6..13ba1bd 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 _0x53b0=['isAuthenticated','/:id','show','/:id/download','download','create','put','update','delete','destroy','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./analyticExtractedReport.controller','get'];(function(_0x47b58b,_0x41a189){var _0x46bebe=function(_0x22bbfa){while(--_0x22bbfa){_0x47b58b['push'](_0x47b58b['shift']());}};_0x46bebe(++_0x41a189);}(_0x53b0,0xf1));var _0x053b=function(_0x374939,_0x187929){_0x374939=_0x374939-0x0;var _0x4d2308=_0x53b0[_0x374939];return _0x4d2308;};'use strict';var multer=require('multer');var util=require(_0x053b('0x0'));var path=require(_0x053b('0x1'));var timeout=require(_0x053b('0x2'));var express=require(_0x053b('0x3'));var router=express[_0x053b('0x4')]();var fs_extra=require(_0x053b('0x5'));var auth=require(_0x053b('0x6'));var interaction=require(_0x053b('0x7'));var config=require(_0x053b('0x8'));var controller=require(_0x053b('0x9'));router[_0x053b('0xa')]('/',auth[_0x053b('0xb')](),controller['index']);router[_0x053b('0xa')](_0x053b('0xc'),auth[_0x053b('0xb')](),controller[_0x053b('0xd')]);router[_0x053b('0xa')](_0x053b('0xe'),auth[_0x053b('0xb')](),controller[_0x053b('0xf')]);router['post']('/',auth[_0x053b('0xb')](),controller[_0x053b('0x10')]);router[_0x053b('0x11')](_0x053b('0xc'),auth[_0x053b('0xb')](),controller[_0x053b('0x12')]);router[_0x053b('0x13')](_0x053b('0xc'),auth[_0x053b('0xb')](),controller[_0x053b('0x14')]);module['exports']=router; \ No newline at end of file +var _0xf8ae=['connect-timeout','Router','../../components/auth/service','../../config/environment','./analyticExtractedReport.controller','get','isAuthenticated','index','show','/:id/download','download','post','create','put','/:id','update','delete','exports','multer','path'];(function(_0x334f52,_0x4e308d){var _0x47fd1f=function(_0x22aa15){while(--_0x22aa15){_0x334f52['push'](_0x334f52['shift']());}};_0x47fd1f(++_0x4e308d);}(_0xf8ae,0x1ca));var _0xef8a=function(_0x3fc75a,_0x1a125c){_0x3fc75a=_0x3fc75a-0x0;var _0x1d3083=_0xf8ae[_0x3fc75a];return _0x1d3083;};'use strict';var multer=require(_0xef8a('0x0'));var util=require('util');var path=require(_0xef8a('0x1'));var timeout=require(_0xef8a('0x2'));var express=require('express');var router=express[_0xef8a('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0xef8a('0x4'));var interaction=require('../../components/interaction/service');var config=require(_0xef8a('0x5'));var controller=require(_0xef8a('0x6'));router[_0xef8a('0x7')]('/',auth[_0xef8a('0x8')](),controller[_0xef8a('0x9')]);router[_0xef8a('0x7')]('/:id',auth['isAuthenticated'](),controller[_0xef8a('0xa')]);router[_0xef8a('0x7')](_0xef8a('0xb'),auth['isAuthenticated'](),controller[_0xef8a('0xc')]);router[_0xef8a('0xd')]('/',auth[_0xef8a('0x8')](),controller[_0xef8a('0xe')]);router[_0xef8a('0xf')](_0xef8a('0x10'),auth[_0xef8a('0x8')](),controller[_0xef8a('0x11')]);router[_0xef8a('0x12')]('/:id',auth[_0xef8a('0x8')](),controller['destroy']);module[_0xef8a('0x13')]=router; \ No newline at end of file diff --git a/server/api/analyticFieldReport/analyticFieldReport.attributes.js b/server/api/analyticFieldReport/analyticFieldReport.attributes.js index ec49dd0..7047db6 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 _0x2207=['STRING','BOOLEAN','sequelize','TEXT'];(function(_0x59caeb,_0x73021e){var _0x3dbc19=function(_0x1826b8){while(--_0x1826b8){_0x59caeb['push'](_0x59caeb['shift']());}};_0x3dbc19(++_0x73021e);}(_0x2207,0xd2));var _0x7220=function(_0x577d63,_0x21cf6d){_0x577d63=_0x577d63-0x0;var _0x7bb968=_0x2207[_0x577d63];return _0x7bb968;};'use strict';var Sequelize=require(_0x7220('0x0'));module['exports']={'field':{'type':Sequelize[_0x7220('0x1')]},'alias':{'type':Sequelize[_0x7220('0x2')]},'function':{'type':Sequelize['STRING']},'format':{'type':Sequelize[_0x7220('0x2')]},'groupBy':{'type':Sequelize[_0x7220('0x3')],'defaultValue':![]},'orderBy':{'type':Sequelize['STRING']},'custom':{'type':Sequelize[_0x7220('0x3')],'defaultValue':![]}}; \ No newline at end of file +var _0x1fce=['BOOLEAN','sequelize','STRING'];(function(_0x290fae,_0x33377d){var _0xda0df5=function(_0x29e6eb){while(--_0x29e6eb){_0x290fae['push'](_0x290fae['shift']());}};_0xda0df5(++_0x33377d);}(_0x1fce,0x1ed));var _0xe1fc=function(_0x86b219,_0x43038f){_0x86b219=_0x86b219-0x0;var _0x1f320c=_0x1fce[_0x86b219];return _0x1f320c;};'use strict';var Sequelize=require(_0xe1fc('0x0'));module['exports']={'field':{'type':Sequelize['TEXT']},'alias':{'type':Sequelize[_0xe1fc('0x1')]},'function':{'type':Sequelize[_0xe1fc('0x1')]},'format':{'type':Sequelize[_0xe1fc('0x1')]},'groupBy':{'type':Sequelize[_0xe1fc('0x2')],'defaultValue':![]},'orderBy':{'type':Sequelize[_0xe1fc('0x1')]},'custom':{'type':Sequelize[_0xe1fc('0x2')],'defaultValue':![]}}; \ No newline at end of file diff --git a/server/api/analyticFieldReport/analyticFieldReport.controller.js b/server/api/analyticFieldReport/analyticFieldReport.controller.js index 628bbde..51163cb 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 _0x2d44=['model','query','keys','intersection','attributes','fields','length','nolimit','order','sort','where','filters','pick','filter','merge','VIRTUAL','options','AnalyticFieldReport','include','findAll','catch','show','params','rawAttributes','includeAll','find','create','body','bulkCreate','bulkDestroy','ids','addFields','AnalyticCustomReport','findOne','transaction','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','jsforce','querystring','papaparse','ioredis','../../components/parsers/qs','api','../../config/utils','../../config/environment','../../config/license/util','sendStatus','status','end','offset','undefined','limit','count','Content-Range','json','reject','update','then','destroy','error','stack','name','map','type','key'];(function(_0x4cd1e6,_0xb176a8){var _0xd24a00=function(_0x4d63a1){while(--_0x4d63a1){_0x4cd1e6['push'](_0x4cd1e6['shift']());}};_0xd24a00(++_0xb176a8);}(_0x2d44,0x71));var _0x42d4=function(_0x5164f6,_0x14d9cf){_0x5164f6=_0x5164f6-0x0;var _0x25430c=_0x2d44[_0x5164f6];return _0x25430c;};'use strict';var emlformat=require(_0x42d4('0x0'));var rimraf=require(_0x42d4('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x42d4('0x2'));var rp=require(_0x42d4('0x3'));var moment=require(_0x42d4('0x4'));var BPromise=require(_0x42d4('0x5'));var Mustache=require(_0x42d4('0x6'));var util=require(_0x42d4('0x7'));var path=require(_0x42d4('0x8'));var sox=require(_0x42d4('0x9'));var csv=require(_0x42d4('0xa'));var ejs=require(_0x42d4('0xb'));var fs=require('fs');var fs_extra=require(_0x42d4('0xc'));var _=require(_0x42d4('0xd'));var squel=require(_0x42d4('0xe'));var crypto=require('crypto');var jsforce=require(_0x42d4('0xf'));var deskjs=require('desk.js');var toCsv=require(_0x42d4('0xa'));var querystring=require(_0x42d4('0x10'));var Papa=require(_0x42d4('0x11'));var Redis=require(_0x42d4('0x12'));var authService=require('../../components/auth/service');var qs=require(_0x42d4('0x13'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x42d4('0x14'));var utils=require(_0x42d4('0x15'));var config=require(_0x42d4('0x16'));var licenseUtil=require(_0x42d4('0x17'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x7433ab,_0x4780d0){_0x4780d0=_0x4780d0||0xcc;return function(_0x36d01a){if(_0x36d01a){return _0x7433ab[_0x42d4('0x18')](_0x4780d0);}return _0x7433ab[_0x42d4('0x19')](_0x4780d0)[_0x42d4('0x1a')]();};}function respondWithResult(_0x4ff667,_0x37d275){_0x37d275=_0x37d275||0xc8;return function(_0x4d2f02){if(_0x4d2f02){return _0x4ff667[_0x42d4('0x19')](_0x37d275)['json'](_0x4d2f02);}};}function respondWithFilteredResult(_0x51efa1,_0x1b1447){return function(_0x25e62f){if(_0x25e62f){var _0x178e00=typeof _0x1b1447[_0x42d4('0x1b')]===_0x42d4('0x1c')&&typeof _0x1b1447[_0x42d4('0x1d')]===_0x42d4('0x1c');var _0xca6d=_0x25e62f[_0x42d4('0x1e')];var _0x5a047c=_0x178e00?0x0:_0x1b1447[_0x42d4('0x1b')];var _0x55b084=_0x178e00?_0x25e62f[_0x42d4('0x1e')]:_0x1b1447[_0x42d4('0x1b')]+_0x1b1447['limit'];var _0x15a87c;if(_0x55b084>=_0xca6d){_0x55b084=_0xca6d;_0x15a87c=0xc8;}else{_0x15a87c=0xce;}_0x51efa1['status'](_0x15a87c);return _0x51efa1['set'](_0x42d4('0x1f'),_0x5a047c+'-'+_0x55b084+'/'+_0xca6d)[_0x42d4('0x20')](_0x25e62f);}return null;};}function patchUpdates(_0x56a655){return function(_0xda1e88){try{jsonpatch['apply'](_0xda1e88,_0x56a655,!![]);}catch(_0x1942bc){return BPromise[_0x42d4('0x21')](_0x1942bc);}return _0xda1e88['save']();};}function saveUpdates(_0x2c6419,_0x1b0b63){return function(_0x4c9eb4){if(_0x4c9eb4){return _0x4c9eb4[_0x42d4('0x22')](_0x2c6419)[_0x42d4('0x23')](function(_0x530b5e){return _0x530b5e;});}return null;};}function removeEntity(_0x2be8f7,_0x5e9f04){return function(_0xd8ee4){if(_0xd8ee4){return _0xd8ee4[_0x42d4('0x24')]()[_0x42d4('0x23')](function(){_0x2be8f7[_0x42d4('0x19')](0xcc)[_0x42d4('0x1a')]();});}};}function handleEntityNotFound(_0x306e7f,_0x28ee87){return function(_0x3a2c55){if(!_0x3a2c55){_0x306e7f['sendStatus'](0x194);}return _0x3a2c55;};}function handleError(_0x431390,_0x42d0d7){_0x42d0d7=_0x42d0d7||0x1f4;return function(_0x357a12){logger[_0x42d4('0x25')](_0x357a12[_0x42d4('0x26')]);if(_0x357a12[_0x42d4('0x27')]){delete _0x357a12[_0x42d4('0x27')];}_0x431390[_0x42d4('0x19')](_0x42d0d7)['send'](_0x357a12);};}exports['index']=function(_0x3372cb,_0x13eea3){var _0x471059={},_0x49342f={},_0x20c982={'count':0x0,'rows':[]};var _0x5d6eb3=_[_0x42d4('0x28')](db['AnalyticFieldReport']['rawAttributes'],function(_0x2c6273){return{'name':_0x2c6273['fieldName'],'type':_0x2c6273[_0x42d4('0x29')][_0x42d4('0x2a')]};});_0x49342f[_0x42d4('0x2b')]=_[_0x42d4('0x28')](_0x5d6eb3,_0x42d4('0x27'));_0x49342f[_0x42d4('0x2c')]=_[_0x42d4('0x2d')](_0x3372cb[_0x42d4('0x2c')]);_0x49342f['filters']=_[_0x42d4('0x2e')](_0x49342f[_0x42d4('0x2b')],_0x49342f[_0x42d4('0x2c')]);_0x471059[_0x42d4('0x2f')]=_[_0x42d4('0x2e')](_0x49342f[_0x42d4('0x2b')],qs[_0x42d4('0x30')](_0x3372cb[_0x42d4('0x2c')]['fields']));_0x471059[_0x42d4('0x2f')]=_0x471059[_0x42d4('0x2f')][_0x42d4('0x31')]?_0x471059['attributes']:_0x49342f['model'];if(!_0x3372cb[_0x42d4('0x2c')]['hasOwnProperty'](_0x42d4('0x32'))){_0x471059[_0x42d4('0x1d')]=qs[_0x42d4('0x1d')](_0x3372cb[_0x42d4('0x2c')]['limit']);_0x471059[_0x42d4('0x1b')]=qs['offset'](_0x3372cb['query'][_0x42d4('0x1b')]);}_0x471059[_0x42d4('0x33')]=qs[_0x42d4('0x34')](_0x3372cb[_0x42d4('0x2c')][_0x42d4('0x34')]);_0x471059[_0x42d4('0x35')]=qs[_0x42d4('0x36')](_[_0x42d4('0x37')](_0x3372cb['query'],_0x49342f[_0x42d4('0x36')]),_0x5d6eb3);if(_0x3372cb['query'][_0x42d4('0x38')]){_0x471059[_0x42d4('0x35')]=_[_0x42d4('0x39')](_0x471059['where'],{'$or':_[_0x42d4('0x28')](_0x5d6eb3,function(_0x481752){if(_0x481752['type']!==_0x42d4('0x3a')){var _0x2a0411={};_0x2a0411[_0x481752['name']]={'$like':'%'+_0x3372cb['query'][_0x42d4('0x38')]+'%'};return _0x2a0411;}})});}_0x471059=_[_0x42d4('0x39')]({},_0x471059,_0x3372cb[_0x42d4('0x3b')]);var _0x36a87a={'where':_0x471059[_0x42d4('0x35')]};return db[_0x42d4('0x3c')][_0x42d4('0x1e')](_0x36a87a)[_0x42d4('0x23')](function(_0x425788){_0x20c982['count']=_0x425788;if(_0x3372cb[_0x42d4('0x2c')]['includeAll']){_0x471059[_0x42d4('0x3d')]=[{'all':!![]}];}return db[_0x42d4('0x3c')][_0x42d4('0x3e')](_0x471059);})['then'](function(_0x257c31){_0x20c982['rows']=_0x257c31;return _0x20c982;})['then'](respondWithFilteredResult(_0x13eea3,_0x471059))[_0x42d4('0x3f')](handleError(_0x13eea3,null));};exports[_0x42d4('0x40')]=function(_0x27650a,_0x23dd48){var _0x5838c2={'raw':![],'where':{'id':_0x27650a[_0x42d4('0x41')]['id']}},_0x31b883={};_0x31b883[_0x42d4('0x2b')]=_['keys'](db[_0x42d4('0x3c')][_0x42d4('0x42')]);_0x31b883[_0x42d4('0x2c')]=_['keys'](_0x27650a[_0x42d4('0x2c')]);_0x31b883['filters']=_[_0x42d4('0x2e')](_0x31b883[_0x42d4('0x2b')],_0x31b883[_0x42d4('0x2c')]);_0x5838c2[_0x42d4('0x2f')]=_[_0x42d4('0x2e')](_0x31b883[_0x42d4('0x2b')],qs[_0x42d4('0x30')](_0x27650a[_0x42d4('0x2c')][_0x42d4('0x30')]));_0x5838c2[_0x42d4('0x2f')]=_0x5838c2[_0x42d4('0x2f')]['length']?_0x5838c2[_0x42d4('0x2f')]:_0x31b883[_0x42d4('0x2b')];if(_0x27650a[_0x42d4('0x2c')][_0x42d4('0x43')]){_0x5838c2[_0x42d4('0x3d')]=[{'all':!![]}];}_0x5838c2=_[_0x42d4('0x39')]({},_0x5838c2,_0x27650a['options']);return db[_0x42d4('0x3c')][_0x42d4('0x44')](_0x5838c2)[_0x42d4('0x23')](handleEntityNotFound(_0x23dd48,null))[_0x42d4('0x23')](respondWithResult(_0x23dd48,null))[_0x42d4('0x3f')](handleError(_0x23dd48,null));};exports[_0x42d4('0x45')]=function(_0x216ab0,_0x2f4a02){return db[_0x42d4('0x3c')][_0x42d4('0x45')](_0x216ab0[_0x42d4('0x46')],{})[_0x42d4('0x23')](respondWithResult(_0x2f4a02,0xc9))[_0x42d4('0x3f')](handleError(_0x2f4a02,null));};exports[_0x42d4('0x47')]=function(_0x3b255a,_0x45b011){return db[_0x42d4('0x3c')]['bulkCreate'](_0x3b255a[_0x42d4('0x46')],{'raw':![],'individualHooks':!![]})[_0x42d4('0x23')](respondWithResult(_0x45b011,0xc9))['catch'](handleError(_0x45b011,null));};exports[_0x42d4('0x22')]=function(_0x2dc6d8,_0x4bbd32){if(_0x2dc6d8[_0x42d4('0x46')]['id']){delete _0x2dc6d8[_0x42d4('0x46')]['id'];}return db[_0x42d4('0x3c')][_0x42d4('0x44')]({'where':{'id':_0x2dc6d8['params']['id']}})[_0x42d4('0x23')](handleEntityNotFound(_0x4bbd32,null))[_0x42d4('0x23')](saveUpdates(_0x2dc6d8[_0x42d4('0x46')],null))['then'](respondWithResult(_0x4bbd32,null))[_0x42d4('0x3f')](handleError(_0x4bbd32,null));};exports[_0x42d4('0x24')]=function(_0x2fecae,_0x5a452d){return db[_0x42d4('0x3c')][_0x42d4('0x44')]({'where':{'id':_0x2fecae[_0x42d4('0x41')]['id']}})['then'](handleEntityNotFound(_0x5a452d,null))['then'](removeEntity(_0x5a452d,null))[_0x42d4('0x3f')](handleError(_0x5a452d,null));};exports[_0x42d4('0x48')]=function(_0x3d0a5b,_0x20a188){return db[_0x42d4('0x3c')][_0x42d4('0x24')]({'where':{'id':_0x3d0a5b['query'][_0x42d4('0x49')]||[]},'raw':![],'individualHooks':!![]})[_0x42d4('0x23')](respondWithResult(_0x20a188,0xcc))[_0x42d4('0x3f')](handleError(_0x20a188,null));};exports[_0x42d4('0x4a')]=function(_0x55dc31,_0x39cfd4,_0x51d5d){return db[_0x42d4('0x4b')][_0x42d4('0x4c')]({'where':{'id':_0x55dc31[_0x42d4('0x41')]['id']}})[_0x42d4('0x23')](handleEntityNotFound(_0x39cfd4,null))[_0x42d4('0x23')](function(_0x31026c){if(_0x31026c){return db['sequelize'][_0x42d4('0x4d')](function(_0x152c3d){return db['AnalyticFieldReport'][_0x42d4('0x24')]({'where':{'CustomReportId':_0x55dc31[_0x42d4('0x41')]['id']},'transaction':_0x152c3d})[_0x42d4('0x23')](function(_0x3902ee){var _0x4ac7f2=_[_0x42d4('0x28')](_0x55dc31[_0x42d4('0x46')],function(_0x4c6be2){delete _0x4c6be2['id'];_0x4c6be2['CustomReportId']=_0x55dc31[_0x42d4('0x41')]['id'];return _0x4c6be2;});return db[_0x42d4('0x3c')][_0x42d4('0x47')](_0x4ac7f2,{'transaction':_0x152c3d});});})['then'](function(){return db[_0x42d4('0x3c')][_0x42d4('0x3e')]({'where':{'CustomReportId':_0x55dc31[_0x42d4('0x41')]['id']}});});}})[_0x42d4('0x23')](respondWithResult(_0x39cfd4,null))[_0x42d4('0x3f')](handleError(_0x39cfd4,null));}; \ No newline at end of file +var _0x4604=['../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../mysqldb','status','end','offset','undefined','limit','count','Content-Range','json','apply','reject','save','update','then','destroy','sendStatus','error','stack','name','send','map','rawAttributes','type','key','model','query','keys','filters','intersection','fields','attributes','length','hasOwnProperty','order','sort','where','pick','filter','merge','VIRTUAL','options','AnalyticFieldReport','include','findAll','rows','show','includeAll','find','create','body','catch','bulkCreate','params','bulkDestroy','ids','AnalyticCustomReport','sequelize','transaction','CustomReportId','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','util','path','to-csv','ejs','fs-extra','lodash','crypto','desk.js','querystring','papaparse','ioredis'];(function(_0xb65e77,_0x238c3d){var _0x38134b=function(_0x39da21){while(--_0x39da21){_0xb65e77['push'](_0xb65e77['shift']());}};_0x38134b(++_0x238c3d);}(_0x4604,0x1e1));var _0x4460=function(_0x1dc249,_0x20af7b){_0x1dc249=_0x1dc249-0x0;var _0x387aea=_0x4604[_0x1dc249];return _0x387aea;};'use strict';var emlformat=require(_0x4460('0x0'));var rimraf=require(_0x4460('0x1'));var zipdir=require(_0x4460('0x2'));var jsonpatch=require(_0x4460('0x3'));var rp=require(_0x4460('0x4'));var moment=require(_0x4460('0x5'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0x4460('0x6'));var path=require(_0x4460('0x7'));var sox=require('sox');var csv=require(_0x4460('0x8'));var ejs=require(_0x4460('0x9'));var fs=require('fs');var fs_extra=require(_0x4460('0xa'));var _=require(_0x4460('0xb'));var squel=require('squel');var crypto=require(_0x4460('0xc'));var jsforce=require('jsforce');var deskjs=require(_0x4460('0xd'));var toCsv=require(_0x4460('0x8'));var querystring=require(_0x4460('0xe'));var Papa=require(_0x4460('0xf'));var Redis=require(_0x4460('0x10'));var authService=require(_0x4460('0x11'));var qs=require(_0x4460('0x12'));var as=require(_0x4460('0x13'));var hardwareService=require(_0x4460('0x14'));var logger=require(_0x4460('0x15'))('api');var utils=require(_0x4460('0x16'));var config=require(_0x4460('0x17'));var licenseUtil=require('../../config/license/util');var db=require(_0x4460('0x18'))['db'];function respondWithStatusCode(_0x5c1e91,_0x5f147a){_0x5f147a=_0x5f147a||0xcc;return function(_0x17d796){if(_0x17d796){return _0x5c1e91['sendStatus'](_0x5f147a);}return _0x5c1e91[_0x4460('0x19')](_0x5f147a)[_0x4460('0x1a')]();};}function respondWithResult(_0x221524,_0x4430af){_0x4430af=_0x4430af||0xc8;return function(_0x48a784){if(_0x48a784){return _0x221524['status'](_0x4430af)['json'](_0x48a784);}};}function respondWithFilteredResult(_0x530956,_0x1d3026){return function(_0x28268d){if(_0x28268d){var _0x40d197=typeof _0x1d3026[_0x4460('0x1b')]===_0x4460('0x1c')&&typeof _0x1d3026[_0x4460('0x1d')]===_0x4460('0x1c');var _0x5049ff=_0x28268d['count'];var _0x10c8f0=_0x40d197?0x0:_0x1d3026['offset'];var _0x497c76=_0x40d197?_0x28268d[_0x4460('0x1e')]:_0x1d3026[_0x4460('0x1b')]+_0x1d3026['limit'];var _0x38731b;if(_0x497c76>=_0x5049ff){_0x497c76=_0x5049ff;_0x38731b=0xc8;}else{_0x38731b=0xce;}_0x530956[_0x4460('0x19')](_0x38731b);return _0x530956['set'](_0x4460('0x1f'),_0x10c8f0+'-'+_0x497c76+'/'+_0x5049ff)[_0x4460('0x20')](_0x28268d);}return null;};}function patchUpdates(_0x1f70b2){return function(_0xdc03f6){try{jsonpatch[_0x4460('0x21')](_0xdc03f6,_0x1f70b2,!![]);}catch(_0x39abc9){return BPromise[_0x4460('0x22')](_0x39abc9);}return _0xdc03f6[_0x4460('0x23')]();};}function saveUpdates(_0x3df33d,_0x4d9085){return function(_0x1f24f8){if(_0x1f24f8){return _0x1f24f8[_0x4460('0x24')](_0x3df33d)[_0x4460('0x25')](function(_0x4e6bc8){return _0x4e6bc8;});}return null;};}function removeEntity(_0x33d652,_0x4f4ecc){return function(_0x299097){if(_0x299097){return _0x299097[_0x4460('0x26')]()[_0x4460('0x25')](function(){_0x33d652[_0x4460('0x19')](0xcc)[_0x4460('0x1a')]();});}};}function handleEntityNotFound(_0x13d8d9,_0x4e7398){return function(_0x59fb8c){if(!_0x59fb8c){_0x13d8d9[_0x4460('0x27')](0x194);}return _0x59fb8c;};}function handleError(_0x5d67c6,_0x4934e8){_0x4934e8=_0x4934e8||0x1f4;return function(_0x2b55ef){logger[_0x4460('0x28')](_0x2b55ef[_0x4460('0x29')]);if(_0x2b55ef[_0x4460('0x2a')]){delete _0x2b55ef[_0x4460('0x2a')];}_0x5d67c6[_0x4460('0x19')](_0x4934e8)[_0x4460('0x2b')](_0x2b55ef);};}exports['index']=function(_0x4559d1,_0x3db75c){var _0x1fb691={},_0x3ad0a4={},_0x1fc19b={'count':0x0,'rows':[]};var _0x3cdfd0=_[_0x4460('0x2c')](db['AnalyticFieldReport'][_0x4460('0x2d')],function(_0x1fb79e){return{'name':_0x1fb79e['fieldName'],'type':_0x1fb79e[_0x4460('0x2e')][_0x4460('0x2f')]};});_0x3ad0a4[_0x4460('0x30')]=_['map'](_0x3cdfd0,_0x4460('0x2a'));_0x3ad0a4[_0x4460('0x31')]=_[_0x4460('0x32')](_0x4559d1['query']);_0x3ad0a4[_0x4460('0x33')]=_['intersection'](_0x3ad0a4[_0x4460('0x30')],_0x3ad0a4['query']);_0x1fb691['attributes']=_[_0x4460('0x34')](_0x3ad0a4['model'],qs[_0x4460('0x35')](_0x4559d1[_0x4460('0x31')][_0x4460('0x35')]));_0x1fb691[_0x4460('0x36')]=_0x1fb691['attributes'][_0x4460('0x37')]?_0x1fb691[_0x4460('0x36')]:_0x3ad0a4[_0x4460('0x30')];if(!_0x4559d1['query'][_0x4460('0x38')]('nolimit')){_0x1fb691[_0x4460('0x1d')]=qs[_0x4460('0x1d')](_0x4559d1[_0x4460('0x31')][_0x4460('0x1d')]);_0x1fb691[_0x4460('0x1b')]=qs['offset'](_0x4559d1[_0x4460('0x31')][_0x4460('0x1b')]);}_0x1fb691[_0x4460('0x39')]=qs[_0x4460('0x3a')](_0x4559d1[_0x4460('0x31')][_0x4460('0x3a')]);_0x1fb691[_0x4460('0x3b')]=qs[_0x4460('0x33')](_[_0x4460('0x3c')](_0x4559d1[_0x4460('0x31')],_0x3ad0a4[_0x4460('0x33')]),_0x3cdfd0);if(_0x4559d1[_0x4460('0x31')][_0x4460('0x3d')]){_0x1fb691[_0x4460('0x3b')]=_[_0x4460('0x3e')](_0x1fb691[_0x4460('0x3b')],{'$or':_['map'](_0x3cdfd0,function(_0x268b6e){if(_0x268b6e[_0x4460('0x2e')]!==_0x4460('0x3f')){var _0x241c03={};_0x241c03[_0x268b6e['name']]={'$like':'%'+_0x4559d1['query'][_0x4460('0x3d')]+'%'};return _0x241c03;}})});}_0x1fb691=_['merge']({},_0x1fb691,_0x4559d1[_0x4460('0x40')]);var _0x771904={'where':_0x1fb691[_0x4460('0x3b')]};return db[_0x4460('0x41')]['count'](_0x771904)[_0x4460('0x25')](function(_0x4f558b){_0x1fc19b[_0x4460('0x1e')]=_0x4f558b;if(_0x4559d1[_0x4460('0x31')]['includeAll']){_0x1fb691[_0x4460('0x42')]=[{'all':!![]}];}return db[_0x4460('0x41')][_0x4460('0x43')](_0x1fb691);})['then'](function(_0x1c3ff6){_0x1fc19b[_0x4460('0x44')]=_0x1c3ff6;return _0x1fc19b;})[_0x4460('0x25')](respondWithFilteredResult(_0x3db75c,_0x1fb691))['catch'](handleError(_0x3db75c,null));};exports[_0x4460('0x45')]=function(_0x1a703f,_0xe3f842){var _0xc24a06={'raw':![],'where':{'id':_0x1a703f['params']['id']}},_0x4b8966={};_0x4b8966['model']=_['keys'](db[_0x4460('0x41')][_0x4460('0x2d')]);_0x4b8966[_0x4460('0x31')]=_[_0x4460('0x32')](_0x1a703f[_0x4460('0x31')]);_0x4b8966[_0x4460('0x33')]=_['intersection'](_0x4b8966['model'],_0x4b8966[_0x4460('0x31')]);_0xc24a06[_0x4460('0x36')]=_['intersection'](_0x4b8966[_0x4460('0x30')],qs[_0x4460('0x35')](_0x1a703f['query'][_0x4460('0x35')]));_0xc24a06[_0x4460('0x36')]=_0xc24a06[_0x4460('0x36')]['length']?_0xc24a06[_0x4460('0x36')]:_0x4b8966[_0x4460('0x30')];if(_0x1a703f[_0x4460('0x31')][_0x4460('0x46')]){_0xc24a06['include']=[{'all':!![]}];}_0xc24a06=_['merge']({},_0xc24a06,_0x1a703f[_0x4460('0x40')]);return db['AnalyticFieldReport'][_0x4460('0x47')](_0xc24a06)[_0x4460('0x25')](handleEntityNotFound(_0xe3f842,null))[_0x4460('0x25')](respondWithResult(_0xe3f842,null))['catch'](handleError(_0xe3f842,null));};exports[_0x4460('0x48')]=function(_0x45f05d,_0x1ca472){return db[_0x4460('0x41')][_0x4460('0x48')](_0x45f05d[_0x4460('0x49')],{})[_0x4460('0x25')](respondWithResult(_0x1ca472,0xc9))[_0x4460('0x4a')](handleError(_0x1ca472,null));};exports[_0x4460('0x4b')]=function(_0x4bf1d2,_0x29cf8b){return db['AnalyticFieldReport'][_0x4460('0x4b')](_0x4bf1d2[_0x4460('0x49')],{'raw':![],'individualHooks':!![]})[_0x4460('0x25')](respondWithResult(_0x29cf8b,0xc9))['catch'](handleError(_0x29cf8b,null));};exports[_0x4460('0x24')]=function(_0x2b648e,_0x4ffd99){if(_0x2b648e[_0x4460('0x49')]['id']){delete _0x2b648e[_0x4460('0x49')]['id'];}return db['AnalyticFieldReport']['find']({'where':{'id':_0x2b648e[_0x4460('0x4c')]['id']}})[_0x4460('0x25')](handleEntityNotFound(_0x4ffd99,null))[_0x4460('0x25')](saveUpdates(_0x2b648e[_0x4460('0x49')],null))[_0x4460('0x25')](respondWithResult(_0x4ffd99,null))[_0x4460('0x4a')](handleError(_0x4ffd99,null));};exports[_0x4460('0x26')]=function(_0xd945d7,_0x11e6a4){return db[_0x4460('0x41')]['find']({'where':{'id':_0xd945d7[_0x4460('0x4c')]['id']}})[_0x4460('0x25')](handleEntityNotFound(_0x11e6a4,null))[_0x4460('0x25')](removeEntity(_0x11e6a4,null))['catch'](handleError(_0x11e6a4,null));};exports[_0x4460('0x4d')]=function(_0x471ddc,_0x20244f){return db['AnalyticFieldReport'][_0x4460('0x26')]({'where':{'id':_0x471ddc['query'][_0x4460('0x4e')]||[]},'raw':![],'individualHooks':!![]})[_0x4460('0x25')](respondWithResult(_0x20244f,0xcc))[_0x4460('0x4a')](handleError(_0x20244f,null));};exports['addFields']=function(_0x43e68a,_0x42f748,_0x29ffa4){return db[_0x4460('0x4f')]['findOne']({'where':{'id':_0x43e68a[_0x4460('0x4c')]['id']}})[_0x4460('0x25')](handleEntityNotFound(_0x42f748,null))[_0x4460('0x25')](function(_0x2b5ef0){if(_0x2b5ef0){return db[_0x4460('0x50')][_0x4460('0x51')](function(_0x22c431){return db['AnalyticFieldReport'][_0x4460('0x26')]({'where':{'CustomReportId':_0x43e68a[_0x4460('0x4c')]['id']},'transaction':_0x22c431})[_0x4460('0x25')](function(_0x4ad88b){var _0x5d7432=_[_0x4460('0x2c')](_0x43e68a[_0x4460('0x49')],function(_0x3186b5){delete _0x3186b5['id'];_0x3186b5[_0x4460('0x52')]=_0x43e68a[_0x4460('0x4c')]['id'];return _0x3186b5;});return db[_0x4460('0x41')]['bulkCreate'](_0x5d7432,{'transaction':_0x22c431});});})[_0x4460('0x25')](function(){return db['AnalyticFieldReport']['findAll']({'where':{'CustomReportId':_0x43e68a[_0x4460('0x4c')]['id']}});});}})[_0x4460('0x25')](respondWithResult(_0x42f748,null))[_0x4460('0x4a')](handleError(_0x42f748,null));}; \ No newline at end of file diff --git a/server/api/analyticFieldReport/analyticFieldReport.model.js b/server/api/analyticFieldReport/analyticFieldReport.model.js index 186953c..7fcafa9 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 _0xaf09=['util','api','path','rimraf','../../config/environment','./analyticFieldReport.attributes','exports','define','AnalyticFieldReport','analytics_report_fields','lodash'];(function(_0xb7a342,_0x4f1de8){var _0x13a2bd=function(_0x2aea8f){while(--_0x2aea8f){_0xb7a342['push'](_0xb7a342['shift']());}};_0x13a2bd(++_0x4f1de8);}(_0xaf09,0x1c2));var _0x9af0=function(_0xa1e3e3,_0x29fe0e){_0xa1e3e3=_0xa1e3e3-0x0;var _0xc980e9=_0xaf09[_0xa1e3e3];return _0xc980e9;};'use strict';var _=require(_0x9af0('0x0'));var util=require(_0x9af0('0x1'));var logger=require('../../config/logger')(_0x9af0('0x2'));var moment=require('moment');var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0x9af0('0x3'));var rimraf=require(_0x9af0('0x4'));var config=require(_0x9af0('0x5'));var attributes=require(_0x9af0('0x6'));module[_0x9af0('0x7')]=function(_0x9dde94,_0x3f92f4){return _0x9dde94[_0x9af0('0x8')](_0x9af0('0x9'),attributes,{'tableName':_0x9af0('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xb571=['./analyticFieldReport.attributes','define','AnalyticFieldReport','analytics_report_fields','lodash','util','../../config/logger','api','moment','request-promise','path','rimraf','../../config/environment'];(function(_0x4d54db,_0x2d8ea0){var _0x2dcba7=function(_0x4894c5){while(--_0x4894c5){_0x4d54db['push'](_0x4d54db['shift']());}};_0x2dcba7(++_0x2d8ea0);}(_0xb571,0x1a4));var _0x1b57=function(_0x508af9,_0x448c27){_0x508af9=_0x508af9-0x0;var _0x1e13bb=_0xb571[_0x508af9];return _0x1e13bb;};'use strict';var _=require(_0x1b57('0x0'));var util=require(_0x1b57('0x1'));var logger=require(_0x1b57('0x2'))(_0x1b57('0x3'));var moment=require(_0x1b57('0x4'));var BPromise=require('bluebird');var rp=require(_0x1b57('0x5'));var fs=require('fs');var path=require(_0x1b57('0x6'));var rimraf=require(_0x1b57('0x7'));var config=require(_0x1b57('0x8'));var attributes=require(_0x1b57('0x9'));module['exports']=function(_0x572bb4,_0x2b2f02){return _0x572bb4[_0x1b57('0xa')](_0x1b57('0xb'),attributes,{'tableName':_0x1b57('0xc'),'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 0413507..679cecf 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 _0xaa31=['http','request','then','info','request\x20sent','AnalyticFieldReport,\x20%s,\x20%s,\x20%s','stringify','error','code','AnalyticFieldReport,\x20%s,\x20%s','message','catch','lodash','util','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client'];(function(_0x3ef280,_0x271105){var _0x5e00da=function(_0x1dd8d8){while(--_0x1dd8d8){_0x3ef280['push'](_0x3ef280['shift']());}};_0x5e00da(++_0x271105);}(_0xaa31,0xa6));var _0x1aa3=function(_0x580647,_0x43d2c3){_0x580647=_0x580647-0x0;var _0x5f0792=_0xaa31[_0x580647];return _0x5f0792;};'use strict';var _=require(_0x1aa3('0x0'));var util=require(_0x1aa3('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0x1aa3('0x2'));var fs=require('fs');var Redis=require(_0x1aa3('0x3'));var db=require(_0x1aa3('0x4'))['db'];var utils=require(_0x1aa3('0x5'));var logger=require(_0x1aa3('0x6'))('rpc');var config=require(_0x1aa3('0x7'));var jayson=require(_0x1aa3('0x8'));var client=jayson[_0x1aa3('0x9')][_0x1aa3('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x894ef3,_0x50ac59,_0x1b2fc4){return new BPromise(function(_0x33a59c,_0x4d4fe5){return client[_0x1aa3('0xb')](_0x894ef3,_0x1b2fc4)[_0x1aa3('0xc')](function(_0x52ad43){logger[_0x1aa3('0xd')]('AnalyticFieldReport,\x20%s,\x20%s',_0x50ac59,_0x1aa3('0xe'));logger['debug'](_0x1aa3('0xf'),_0x50ac59,'request\x20sent',JSON[_0x1aa3('0x10')](_0x52ad43));if(_0x52ad43[_0x1aa3('0x11')]){if(_0x52ad43[_0x1aa3('0x11')][_0x1aa3('0x12')]===0x1f4){logger[_0x1aa3('0x11')](_0x1aa3('0x13'),_0x50ac59,_0x52ad43[_0x1aa3('0x11')][_0x1aa3('0x14')]);return _0x4d4fe5(_0x52ad43[_0x1aa3('0x11')][_0x1aa3('0x14')]);}logger[_0x1aa3('0x11')](_0x1aa3('0x13'),_0x50ac59,_0x52ad43[_0x1aa3('0x11')][_0x1aa3('0x14')]);return _0x33a59c(_0x52ad43[_0x1aa3('0x11')][_0x1aa3('0x14')]);}else{logger[_0x1aa3('0xd')]('AnalyticFieldReport,\x20%s,\x20%s',_0x50ac59,_0x1aa3('0xe'));_0x33a59c(_0x52ad43['result']['message']);}})[_0x1aa3('0x15')](function(_0x55b58a){logger[_0x1aa3('0x11')](_0x1aa3('0x13'),_0x50ac59,_0x55b58a);_0x4d4fe5(_0x55b58a);});});} \ No newline at end of file +var _0x7072=['randomstring','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','info','AnalyticFieldReport,\x20%s,\x20%s','request\x20sent','debug','error','message','catch','lodash','util'];(function(_0x1591b0,_0x31909f){var _0x29c8de=function(_0x2f629f){while(--_0x2f629f){_0x1591b0['push'](_0x1591b0['shift']());}};_0x29c8de(++_0x31909f);}(_0x7072,0xfa));var _0x2707=function(_0x3d42d8,_0x4cffaa){_0x3d42d8=_0x3d42d8-0x0;var _0x27fc41=_0x7072[_0x3d42d8];return _0x27fc41;};'use strict';var _=require(_0x2707('0x0'));var util=require(_0x2707('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0x2707('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0x2707('0x3'));var logger=require(_0x2707('0x4'))(_0x2707('0x5'));var config=require(_0x2707('0x6'));var jayson=require(_0x2707('0x7'));var client=jayson[_0x2707('0x8')][_0x2707('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x552c90,_0x74ab45,_0x52c870){return new BPromise(function(_0x528e61,_0x3c1ce8){return client[_0x2707('0xa')](_0x552c90,_0x52c870)['then'](function(_0x42f423){logger[_0x2707('0xb')](_0x2707('0xc'),_0x74ab45,_0x2707('0xd'));logger[_0x2707('0xe')]('AnalyticFieldReport,\x20%s,\x20%s,\x20%s',_0x74ab45,_0x2707('0xd'),JSON['stringify'](_0x42f423));if(_0x42f423[_0x2707('0xf')]){if(_0x42f423[_0x2707('0xf')]['code']===0x1f4){logger[_0x2707('0xf')](_0x2707('0xc'),_0x74ab45,_0x42f423['error'][_0x2707('0x10')]);return _0x3c1ce8(_0x42f423[_0x2707('0xf')][_0x2707('0x10')]);}logger[_0x2707('0xf')](_0x2707('0xc'),_0x74ab45,_0x42f423[_0x2707('0xf')][_0x2707('0x10')]);return _0x528e61(_0x42f423[_0x2707('0xf')]['message']);}else{logger[_0x2707('0xb')](_0x2707('0xc'),_0x74ab45,'request\x20sent');_0x528e61(_0x42f423['result']['message']);}})[_0x2707('0x11')](function(_0x4af124){logger[_0x2707('0xf')](_0x2707('0xc'),_0x74ab45,_0x4af124);_0x3c1ce8(_0x4af124);});});} \ No newline at end of file diff --git a/server/api/analyticFieldReport/index.js b/server/api/analyticFieldReport/index.js index e9c2e49..eabe7be 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(_0x152e24,_0x1b80ed){var _0x3308c6=function(_0x2b5678){while(--_0x2b5678){_0x152e24['push'](_0x152e24['shift']());}};_0x3308c6(++_0x1b80ed);}(_0xa9e0,0x123));var _0x0a9e=function(_0x4fc9e6,_0xc51915){_0x4fc9e6=_0x4fc9e6-0x0;var _0x551d28=_0xa9e0[_0x4fc9e6];return _0x551d28;};'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(_0x2b4443,_0x51cce5){var _0x3f8fa3=function(_0x1f84d8){while(--_0x1f84d8){_0x2b4443['push'](_0x2b4443['shift']());}};_0x3f8fa3(++_0x51cce5);}(_0xa9e0,0x123));var _0x0a9e=function(_0xf50820,_0x56f041){_0xf50820=_0xf50820-0x0;var _0x2a9b10=_0xa9e0[_0xf50820];return _0x2a9b10;};'use strict';var multer=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var path=require(_0x0a9e('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x0a9e('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x0a9e('0x4'));var interaction=require(_0x0a9e('0x5'));var config=require(_0x0a9e('0x6'));var controller=require(_0x0a9e('0x7'));router[_0x0a9e('0x8')]('/',auth['isAuthenticated'](),controller[_0x0a9e('0x9')]);router[_0x0a9e('0x8')](_0x0a9e('0xa'),auth['isAuthenticated'](),controller['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 7ea8a4d..d7d4511 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 _0xf4eb=['sequelize','TEXT'];(function(_0x2fcadc,_0x1dc842){var _0x23d314=function(_0x4d5969){while(--_0x4d5969){_0x2fcadc['push'](_0x2fcadc['shift']());}};_0x23d314(++_0x1dc842);}(_0xf4eb,0xec));var _0xbf4e=function(_0x4ae17c,_0x538498){_0x4ae17c=_0x4ae17c-0x0;var _0x5d10bb=_0xf4eb[_0x4ae17c];return _0x5d10bb;};'use strict';var Sequelize=require(_0xbf4e('0x0'));module['exports']={'name':{'type':Sequelize['STRING'],'allowNull':![],'unique':'name'},'table':{'type':Sequelize['STRING']},'metric':{'type':Sequelize[_0xbf4e('0x1')]},'description':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0x5397=['TEXT','exports','STRING','name'];(function(_0x43f9a2,_0xe39a02){var _0x52c242=function(_0x5cf019){while(--_0x5cf019){_0x43f9a2['push'](_0x43f9a2['shift']());}};_0x52c242(++_0xe39a02);}(_0x5397,0x105));var _0x7539=function(_0x271b1c,_0x35036b){_0x271b1c=_0x271b1c-0x0;var _0x4b2c4d=_0x5397[_0x271b1c];return _0x4b2c4d;};'use strict';var Sequelize=require('sequelize');module[_0x7539('0x0')]={'name':{'type':Sequelize[_0x7539('0x1')],'allowNull':![],'unique':_0x7539('0x2')},'table':{'type':Sequelize[_0x7539('0x1')]},'metric':{'type':Sequelize[_0x7539('0x3')]},'description':{'type':Sequelize[_0x7539('0x1')]}}; \ No newline at end of file diff --git a/server/api/analyticMetric/analyticMetric.controller.js b/server/api/analyticMetric/analyticMetric.controller.js index 7c2279b..f42adfb 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 _0x5fc3=['user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','find','userProfileId','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','path','sox','to-csv','lodash','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/environment','../../config/license/util','sendStatus','status','end','offset','undefined','limit','count','Content-Range','json','apply','reject','save','update','then','destroy','get','Metrics','error','stack','name','send','index','map','AnalyticMetric','rawAttributes','fieldName','type','key','model','keys','filters','intersection','query','attributes','fields','length','hasOwnProperty','sort','pick','filter','where','VIRTUAL','options','includeAll','include','findAll','catch','show','params','merge','create','body'];(function(_0x1d25ed,_0x2c84aa){var _0x383c67=function(_0x8134ea){while(--_0x8134ea){_0x1d25ed['push'](_0x1d25ed['shift']());}};_0x383c67(++_0x2c84aa);}(_0x5fc3,0xa8));var _0x35fc=function(_0x102977,_0x3a99a6){_0x102977=_0x102977-0x0;var _0x15c466=_0x5fc3[_0x102977];return _0x15c466;};'use strict';var emlformat=require(_0x35fc('0x0'));var rimraf=require(_0x35fc('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x35fc('0x2'));var rp=require(_0x35fc('0x3'));var moment=require(_0x35fc('0x4'));var BPromise=require(_0x35fc('0x5'));var Mustache=require(_0x35fc('0x6'));var util=require('util');var path=require(_0x35fc('0x7'));var sox=require(_0x35fc('0x8'));var csv=require(_0x35fc('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x35fc('0xa'));var squel=require('squel');var crypto=require(_0x35fc('0xb'));var jsforce=require(_0x35fc('0xc'));var deskjs=require(_0x35fc('0xd'));var toCsv=require(_0x35fc('0x9'));var querystring=require(_0x35fc('0xe'));var Papa=require(_0x35fc('0xf'));var Redis=require(_0x35fc('0x10'));var authService=require('../../components/auth/service');var qs=require(_0x35fc('0x11'));var as=require(_0x35fc('0x12'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x35fc('0x13'))(_0x35fc('0x14'));var utils=require('../../config/utils');var config=require(_0x35fc('0x15'));var licenseUtil=require(_0x35fc('0x16'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x4cbe74,_0x409357){_0x409357=_0x409357||0xcc;return function(_0x5d462a){if(_0x5d462a){return _0x4cbe74[_0x35fc('0x17')](_0x409357);}return _0x4cbe74[_0x35fc('0x18')](_0x409357)[_0x35fc('0x19')]();};}function respondWithResult(_0x29730f,_0x38d9f2){_0x38d9f2=_0x38d9f2||0xc8;return function(_0x5cfe94){if(_0x5cfe94){return _0x29730f['status'](_0x38d9f2)['json'](_0x5cfe94);}};}function respondWithFilteredResult(_0x558364,_0x398b67){return function(_0x229d56){if(_0x229d56){var _0x53b898=typeof _0x398b67[_0x35fc('0x1a')]===_0x35fc('0x1b')&&typeof _0x398b67[_0x35fc('0x1c')]==='undefined';var _0x26ba54=_0x229d56[_0x35fc('0x1d')];var _0x553677=_0x53b898?0x0:_0x398b67[_0x35fc('0x1a')];var _0x363e47=_0x53b898?_0x229d56[_0x35fc('0x1d')]:_0x398b67['offset']+_0x398b67[_0x35fc('0x1c')];var _0x3c58ea;if(_0x363e47>=_0x26ba54){_0x363e47=_0x26ba54;_0x3c58ea=0xc8;}else{_0x3c58ea=0xce;}_0x558364[_0x35fc('0x18')](_0x3c58ea);return _0x558364['set'](_0x35fc('0x1e'),_0x553677+'-'+_0x363e47+'/'+_0x26ba54)[_0x35fc('0x1f')](_0x229d56);}return null;};}function patchUpdates(_0x3229d1){return function(_0x251a1f){try{jsonpatch[_0x35fc('0x20')](_0x251a1f,_0x3229d1,!![]);}catch(_0x21f1a9){return BPromise[_0x35fc('0x21')](_0x21f1a9);}return _0x251a1f[_0x35fc('0x22')]();};}function saveUpdates(_0x2405e8,_0x427eae){return function(_0x5bd2b8){if(_0x5bd2b8){return _0x5bd2b8[_0x35fc('0x23')](_0x2405e8)[_0x35fc('0x24')](function(_0x257719){return _0x257719;});}return null;};}function removeEntity(_0x2d8183,_0x3b4743){return function(_0x55e9e7){if(_0x55e9e7){return _0x55e9e7[_0x35fc('0x25')]()[_0x35fc('0x24')](function(){var _0x561bf8=_0x55e9e7[_0x35fc('0x26')]({'plain':!![]});var _0x5a93df=_0x35fc('0x27');return db['UserProfileResource'][_0x35fc('0x25')]({'where':{'type':_0x5a93df,'resourceId':_0x561bf8['id']}})['then'](function(){return _0x55e9e7;});})[_0x35fc('0x24')](function(){_0x2d8183[_0x35fc('0x18')](0xcc)['end']();});}};}function handleEntityNotFound(_0x519264,_0x47774c){return function(_0x58edb6){if(!_0x58edb6){_0x519264[_0x35fc('0x17')](0x194);}return _0x58edb6;};}function handleError(_0x1a5d92,_0x57001c){_0x57001c=_0x57001c||0x1f4;return function(_0x26b7cb){logger[_0x35fc('0x28')](_0x26b7cb[_0x35fc('0x29')]);if(_0x26b7cb[_0x35fc('0x2a')]){delete _0x26b7cb[_0x35fc('0x2a')];}_0x1a5d92[_0x35fc('0x18')](_0x57001c)[_0x35fc('0x2b')](_0x26b7cb);};}exports[_0x35fc('0x2c')]=function(_0x54aedc,_0x1cd1ae){var _0x220931={},_0x22af18={},_0x52acc5={'count':0x0,'rows':[]};var _0xe79f52=_[_0x35fc('0x2d')](db[_0x35fc('0x2e')][_0x35fc('0x2f')],function(_0xd8a4ca){return{'name':_0xd8a4ca[_0x35fc('0x30')],'type':_0xd8a4ca[_0x35fc('0x31')][_0x35fc('0x32')]};});_0x22af18[_0x35fc('0x33')]=_[_0x35fc('0x2d')](_0xe79f52,'name');_0x22af18['query']=_[_0x35fc('0x34')](_0x54aedc['query']);_0x22af18[_0x35fc('0x35')]=_[_0x35fc('0x36')](_0x22af18[_0x35fc('0x33')],_0x22af18[_0x35fc('0x37')]);_0x220931[_0x35fc('0x38')]=_[_0x35fc('0x36')](_0x22af18['model'],qs[_0x35fc('0x39')](_0x54aedc[_0x35fc('0x37')][_0x35fc('0x39')]));_0x220931[_0x35fc('0x38')]=_0x220931[_0x35fc('0x38')][_0x35fc('0x3a')]?_0x220931['attributes']:_0x22af18[_0x35fc('0x33')];if(!_0x54aedc[_0x35fc('0x37')][_0x35fc('0x3b')]('nolimit')){_0x220931[_0x35fc('0x1c')]=qs['limit'](_0x54aedc[_0x35fc('0x37')][_0x35fc('0x1c')]);_0x220931[_0x35fc('0x1a')]=qs[_0x35fc('0x1a')](_0x54aedc['query']['offset']);}_0x220931['order']=qs[_0x35fc('0x3c')](_0x54aedc['query'][_0x35fc('0x3c')]);_0x220931['where']=qs[_0x35fc('0x35')](_[_0x35fc('0x3d')](_0x54aedc[_0x35fc('0x37')],_0x22af18[_0x35fc('0x35')]),_0xe79f52);if(_0x54aedc[_0x35fc('0x37')][_0x35fc('0x3e')]){_0x220931[_0x35fc('0x3f')]=_['merge'](_0x220931[_0x35fc('0x3f')],{'$or':_[_0x35fc('0x2d')](_0xe79f52,function(_0x4e0ce3){if(_0x4e0ce3[_0x35fc('0x31')]!==_0x35fc('0x40')){var _0x1aac67={};_0x1aac67[_0x4e0ce3[_0x35fc('0x2a')]]={'$like':'%'+_0x54aedc[_0x35fc('0x37')][_0x35fc('0x3e')]+'%'};return _0x1aac67;}})});}_0x220931=_['merge']({},_0x220931,_0x54aedc[_0x35fc('0x41')]);var _0x267858={'where':_0x220931[_0x35fc('0x3f')]};return db['AnalyticMetric'][_0x35fc('0x1d')](_0x267858)[_0x35fc('0x24')](function(_0x596919){_0x52acc5[_0x35fc('0x1d')]=_0x596919;if(_0x54aedc[_0x35fc('0x37')][_0x35fc('0x42')]){_0x220931[_0x35fc('0x43')]=[{'all':!![]}];}return db[_0x35fc('0x2e')][_0x35fc('0x44')](_0x220931);})[_0x35fc('0x24')](function(_0x3ec51f){_0x52acc5['rows']=_0x3ec51f;return _0x52acc5;})['then'](respondWithFilteredResult(_0x1cd1ae,_0x220931))[_0x35fc('0x45')](handleError(_0x1cd1ae,null));};exports[_0x35fc('0x46')]=function(_0x4fdc6d,_0x5c2e5c){var _0x4ff202={'raw':!![],'where':{'id':_0x4fdc6d[_0x35fc('0x47')]['id']}},_0x79677d={};_0x79677d['model']=_[_0x35fc('0x34')](db[_0x35fc('0x2e')][_0x35fc('0x2f')]);_0x79677d[_0x35fc('0x37')]=_['keys'](_0x4fdc6d['query']);_0x79677d['filters']=_['intersection'](_0x79677d['model'],_0x79677d[_0x35fc('0x37')]);_0x4ff202[_0x35fc('0x38')]=_['intersection'](_0x79677d[_0x35fc('0x33')],qs['fields'](_0x4fdc6d[_0x35fc('0x37')][_0x35fc('0x39')]));_0x4ff202[_0x35fc('0x38')]=_0x4ff202[_0x35fc('0x38')][_0x35fc('0x3a')]?_0x4ff202['attributes']:_0x79677d[_0x35fc('0x33')];if(_0x4fdc6d[_0x35fc('0x37')]['includeAll']){_0x4ff202[_0x35fc('0x43')]=[{'all':!![]}];}_0x4ff202=_[_0x35fc('0x48')]({},_0x4ff202,_0x4fdc6d[_0x35fc('0x41')]);return db[_0x35fc('0x2e')]['find'](_0x4ff202)[_0x35fc('0x24')](handleEntityNotFound(_0x5c2e5c,null))['then'](respondWithResult(_0x5c2e5c,null))['catch'](handleError(_0x5c2e5c,null));};exports[_0x35fc('0x49')]=function(_0x9db7e8,_0x18dc78){return db[_0x35fc('0x2e')][_0x35fc('0x49')](_0x9db7e8[_0x35fc('0x4a')],{})[_0x35fc('0x24')](function(_0x16afa6){var _0x4f555f=_0x9db7e8[_0x35fc('0x4b')][_0x35fc('0x26')]({'plain':!![]});if(!_0x4f555f)throw new Error(_0x35fc('0x4c'));if(_0x4f555f[_0x35fc('0x4d')]===_0x35fc('0x4b')){var _0x1e3221=_0x16afa6[_0x35fc('0x26')]({'plain':!![]});var _0x347a4a=_0x35fc('0x27');return db[_0x35fc('0x4e')][_0x35fc('0x4f')]({'where':{'name':_0x347a4a,'userProfileId':_0x4f555f[_0x35fc('0x50')]},'raw':!![]})[_0x35fc('0x24')](function(_0x3146e2){if(_0x3146e2&&_0x3146e2['autoAssociation']===0x0){return db['UserProfileResource'][_0x35fc('0x49')]({'name':_0x1e3221[_0x35fc('0x2a')],'resourceId':_0x1e3221['id'],'type':_0x3146e2[_0x35fc('0x2a')],'sectionId':_0x3146e2['id']},{})[_0x35fc('0x24')](function(){return _0x16afa6;});}else{return _0x16afa6;}})[_0x35fc('0x45')](function(_0x3e6494){logger['error']('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x3e6494);throw _0x3e6494;});}return _0x16afa6;})[_0x35fc('0x24')](respondWithResult(_0x18dc78,0xc9))[_0x35fc('0x45')](handleError(_0x18dc78,null));};exports[_0x35fc('0x23')]=function(_0x38bc78,_0x5b2595){if(_0x38bc78[_0x35fc('0x4a')]['id']){delete _0x38bc78[_0x35fc('0x4a')]['id'];}return db['AnalyticMetric'][_0x35fc('0x4f')]({'where':{'id':_0x38bc78[_0x35fc('0x47')]['id']}})['then'](handleEntityNotFound(_0x5b2595,null))[_0x35fc('0x24')](saveUpdates(_0x38bc78[_0x35fc('0x4a')],null))[_0x35fc('0x24')](respondWithResult(_0x5b2595,null))[_0x35fc('0x45')](handleError(_0x5b2595,null));};exports['destroy']=function(_0x4de34b,_0x502a15){return db[_0x35fc('0x2e')][_0x35fc('0x4f')]({'where':{'id':_0x4de34b['params']['id']}})[_0x35fc('0x24')](handleEntityNotFound(_0x502a15,null))[_0x35fc('0x24')](removeEntity(_0x502a15,null))[_0x35fc('0x45')](handleError(_0x502a15,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(_0x2b3cc0,_0xc89f07){var _0x4980e8=function(_0x4c2e65){while(--_0x4c2e65){_0x2b3cc0['push'](_0x2b3cc0['shift']());}};_0x4980e8(++_0xc89f07);}(_0x8ef6,0xf2));var _0x68ef=function(_0x37781c,_0x4bdab6){_0x37781c=_0x37781c-0x0;var _0x512f11=_0x8ef6[_0x37781c];return _0x512f11;};'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 226309a..d1b8ab0 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 _0x84e7=['./analyticMetric.attributes','exports','define','analytics_metrics','util','../../config/logger','moment','bluebird','path','rimraf','../../config/environment'];(function(_0x57486e,_0x32283b){var _0x5f110b=function(_0xa18fc3){while(--_0xa18fc3){_0x57486e['push'](_0x57486e['shift']());}};_0x5f110b(++_0x32283b);}(_0x84e7,0x122));var _0x784e=function(_0x362283,_0x457235){_0x362283=_0x362283-0x0;var _0x31783c=_0x84e7[_0x362283];return _0x31783c;};'use strict';var _=require('lodash');var util=require(_0x784e('0x0'));var logger=require(_0x784e('0x1'))('api');var moment=require(_0x784e('0x2'));var BPromise=require(_0x784e('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x784e('0x4'));var rimraf=require(_0x784e('0x5'));var config=require(_0x784e('0x6'));var attributes=require(_0x784e('0x7'));module[_0x784e('0x8')]=function(_0x133296,_0x48ed22){return _0x133296[_0x784e('0x9')]('AnalyticMetric',attributes,{'tableName':_0x784e('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x79bf=['rimraf','../../config/environment','./analyticMetric.attributes','exports','define','AnalyticMetric','util','api','bluebird','request-promise','path'];(function(_0x2ab000,_0x46ab3d){var _0x28fb73=function(_0x189f24){while(--_0x189f24){_0x2ab000['push'](_0x2ab000['shift']());}};_0x28fb73(++_0x46ab3d);}(_0x79bf,0x1df));var _0xf79b=function(_0x41f33c,_0xdba0f5){_0x41f33c=_0x41f33c-0x0;var _0x3e8ee3=_0x79bf[_0x41f33c];return _0x3e8ee3;};'use strict';var _=require('lodash');var util=require(_0xf79b('0x0'));var logger=require('../../config/logger')(_0xf79b('0x1'));var moment=require('moment');var BPromise=require(_0xf79b('0x2'));var rp=require(_0xf79b('0x3'));var fs=require('fs');var path=require(_0xf79b('0x4'));var rimraf=require(_0xf79b('0x5'));var config=require(_0xf79b('0x6'));var attributes=require(_0xf79b('0x7'));module[_0xf79b('0x8')]=function(_0x5de87a,_0x377b85){return _0x5de87a[_0xf79b('0x9')](_0xf79b('0xa'),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 ca6ef11..7ceffed 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 _0xdeeb=['jayson/promise','client','http','request','info','AnalyticMetric,\x20%s,\x20%s','request\x20sent','debug','AnalyticMetric,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger'];(function(_0x44ae0b,_0x3e9865){var _0x69232a=function(_0x5ae588){while(--_0x5ae588){_0x44ae0b['push'](_0x44ae0b['shift']());}};_0x69232a(++_0x3e9865);}(_0xdeeb,0xbe));var _0xbdee=function(_0x55821d,_0x27a22e){_0x55821d=_0x55821d-0x0;var _0x58ea8a=_0xdeeb[_0x55821d];return _0x58ea8a;};'use strict';var _=require(_0xbdee('0x0'));var util=require(_0xbdee('0x1'));var moment=require(_0xbdee('0x2'));var BPromise=require(_0xbdee('0x3'));var rs=require(_0xbdee('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xbdee('0x5'))['db'];var utils=require(_0xbdee('0x6'));var logger=require(_0xbdee('0x7'))('rpc');var config=require('../../config/environment');var jayson=require(_0xbdee('0x8'));var client=jayson[_0xbdee('0x9')][_0xbdee('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x5095e6,_0x52b812,_0x22b166){return new BPromise(function(_0x42a449,_0x300144){return client[_0xbdee('0xb')](_0x5095e6,_0x22b166)['then'](function(_0x2521c9){logger[_0xbdee('0xc')](_0xbdee('0xd'),_0x52b812,_0xbdee('0xe'));logger[_0xbdee('0xf')](_0xbdee('0x10'),_0x52b812,'request\x20sent',JSON['stringify'](_0x2521c9));if(_0x2521c9['error']){if(_0x2521c9[_0xbdee('0x11')][_0xbdee('0x12')]===0x1f4){logger[_0xbdee('0x11')](_0xbdee('0xd'),_0x52b812,_0x2521c9['error'][_0xbdee('0x13')]);return _0x300144(_0x2521c9['error']['message']);}logger[_0xbdee('0x11')](_0xbdee('0xd'),_0x52b812,_0x2521c9['error']['message']);return _0x42a449(_0x2521c9[_0xbdee('0x11')][_0xbdee('0x13')]);}else{logger[_0xbdee('0xc')]('AnalyticMetric,\x20%s,\x20%s',_0x52b812,'request\x20sent');_0x42a449(_0x2521c9[_0xbdee('0x14')]['message']);}})[_0xbdee('0x15')](function(_0x487900){logger[_0xbdee('0x11')](_0xbdee('0xd'),_0x52b812,_0x487900);_0x300144(_0x487900);});});} \ No newline at end of file +var _0x7701=['jayson/promise','client','http','request','AnalyticMetric,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','info','result','catch','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment'];(function(_0x3f3c56,_0x568017){var _0x4810a1=function(_0x1a25ed){while(--_0x1a25ed){_0x3f3c56['push'](_0x3f3c56['shift']());}};_0x4810a1(++_0x568017);}(_0x7701,0x1ab));var _0x1770=function(_0x1f0d91,_0x24b032){_0x1f0d91=_0x1f0d91-0x0;var _0xafee7a=_0x7701[_0x1f0d91];return _0xafee7a;};'use strict';var _=require(_0x1770('0x0'));var util=require(_0x1770('0x1'));var moment=require(_0x1770('0x2'));var BPromise=require(_0x1770('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x1770('0x4'));var db=require(_0x1770('0x5'))['db'];var utils=require(_0x1770('0x6'));var logger=require(_0x1770('0x7'))(_0x1770('0x8'));var config=require(_0x1770('0x9'));var jayson=require(_0x1770('0xa'));var client=jayson[_0x1770('0xb')][_0x1770('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x2b3f23,_0xe9eb5a,_0x1d0496){return new BPromise(function(_0x1ef1bc,_0x4e4bab){return client[_0x1770('0xd')](_0x2b3f23,_0x1d0496)['then'](function(_0x34b6d4){logger['info'](_0x1770('0xe'),_0xe9eb5a,_0x1770('0xf'));logger['debug']('AnalyticMetric,\x20%s,\x20%s,\x20%s',_0xe9eb5a,'request\x20sent',JSON[_0x1770('0x10')](_0x34b6d4));if(_0x34b6d4[_0x1770('0x11')]){if(_0x34b6d4[_0x1770('0x11')][_0x1770('0x12')]===0x1f4){logger[_0x1770('0x11')]('AnalyticMetric,\x20%s,\x20%s',_0xe9eb5a,_0x34b6d4[_0x1770('0x11')][_0x1770('0x13')]);return _0x4e4bab(_0x34b6d4[_0x1770('0x11')][_0x1770('0x13')]);}logger['error'](_0x1770('0xe'),_0xe9eb5a,_0x34b6d4[_0x1770('0x11')][_0x1770('0x13')]);return _0x1ef1bc(_0x34b6d4['error'][_0x1770('0x13')]);}else{logger[_0x1770('0x14')](_0x1770('0xe'),_0xe9eb5a,_0x1770('0xf'));_0x1ef1bc(_0x34b6d4[_0x1770('0x15')][_0x1770('0x13')]);}})[_0x1770('0x16')](function(_0xa89808){logger['error'](_0x1770('0xe'),_0xe9eb5a,_0xa89808);_0x4e4bab(_0xa89808);});});} \ No newline at end of file diff --git a/server/api/analyticMetric/index.js b/server/api/analyticMetric/index.js index 37e15af..ae1a011 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 _0x3eea=['get','isAuthenticated','/:id','show','put','update','delete','destroy','multer','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./analyticMetric.controller'];(function(_0x1aa549,_0x16e983){var _0x50f812=function(_0x334076){while(--_0x334076){_0x1aa549['push'](_0x1aa549['shift']());}};_0x50f812(++_0x16e983);}(_0x3eea,0x1ca));var _0xa3ee=function(_0xb19f9f,_0x52479a){_0xb19f9f=_0xb19f9f-0x0;var _0x28d54b=_0x3eea[_0xb19f9f];return _0x28d54b;};'use strict';var multer=require(_0xa3ee('0x0'));var util=require('util');var path=require(_0xa3ee('0x1'));var timeout=require(_0xa3ee('0x2'));var express=require(_0xa3ee('0x3'));var router=express[_0xa3ee('0x4')]();var fs_extra=require(_0xa3ee('0x5'));var auth=require(_0xa3ee('0x6'));var interaction=require(_0xa3ee('0x7'));var config=require(_0xa3ee('0x8'));var controller=require(_0xa3ee('0x9'));router[_0xa3ee('0xa')]('/',auth[_0xa3ee('0xb')](),controller['index']);router['get'](_0xa3ee('0xc'),auth['isAuthenticated'](),controller[_0xa3ee('0xd')]);router['post']('/',auth[_0xa3ee('0xb')](),controller['create']);router[_0xa3ee('0xe')]('/:id',auth[_0xa3ee('0xb')](),controller[_0xa3ee('0xf')]);router[_0xa3ee('0x10')]('/:id',auth[_0xa3ee('0xb')](),controller[_0xa3ee('0x11')]);module['exports']=router; \ No newline at end of file +var _0xbbbd=['destroy','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./analyticMetric.controller','get','index','/:id','isAuthenticated','show','post','create','put','update'];(function(_0x8de54f,_0x271987){var _0x14cba4=function(_0x58ed41){while(--_0x58ed41){_0x8de54f['push'](_0x8de54f['shift']());}};_0x14cba4(++_0x271987);}(_0xbbbd,0x86));var _0xdbbb=function(_0x58e469,_0x95ee3e){_0x58e469=_0x58e469-0x0;var _0x4c01c5=_0xbbbd[_0x58e469];return _0x4c01c5;};'use strict';var multer=require(_0xdbbb('0x0'));var util=require(_0xdbbb('0x1'));var path=require(_0xdbbb('0x2'));var timeout=require(_0xdbbb('0x3'));var express=require(_0xdbbb('0x4'));var router=express[_0xdbbb('0x5')]();var fs_extra=require(_0xdbbb('0x6'));var auth=require(_0xdbbb('0x7'));var interaction=require(_0xdbbb('0x8'));var config=require(_0xdbbb('0x9'));var controller=require(_0xdbbb('0xa'));router[_0xdbbb('0xb')]('/',auth['isAuthenticated'](),controller[_0xdbbb('0xc')]);router[_0xdbbb('0xb')](_0xdbbb('0xd'),auth[_0xdbbb('0xe')](),controller[_0xdbbb('0xf')]);router[_0xdbbb('0x10')]('/',auth[_0xdbbb('0xe')](),controller[_0xdbbb('0x11')]);router[_0xdbbb('0x12')](_0xdbbb('0xd'),auth['isAuthenticated'](),controller[_0xdbbb('0x13')]);router['delete'](_0xdbbb('0xd'),auth['isAuthenticated'](),controller[_0xdbbb('0x14')]);module[_0xdbbb('0x15')]=router; \ No newline at end of file diff --git a/server/api/analyticTreeReport/analyticTreeReport.attributes.js b/server/api/analyticTreeReport/analyticTreeReport.attributes.js index 2c06c36..2b1703d 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 _0x0b10=['exports','TEXT','sequelize'];(function(_0x192ba7,_0x3aca74){var _0x5aa8bb=function(_0x23e4cd){while(--_0x23e4cd){_0x192ba7['push'](_0x192ba7['shift']());}};_0x5aa8bb(++_0x3aca74);}(_0x0b10,0x10d));var _0x00b1=function(_0x35f92c,_0x32d602){_0x35f92c=_0x35f92c-0x0;var _0x4fbc8e=_0x0b10[_0x35f92c];return _0x4fbc8e;};'use strict';var Sequelize=require(_0x00b1('0x0'));module[_0x00b1('0x1')]={'tree':{'type':Sequelize[_0x00b1('0x2')],'allowNull':![]}}; \ No newline at end of file +var _0xcc48=['exports','TEXT','sequelize'];(function(_0x478ed9,_0x31cf62){var _0x1158a7=function(_0x5ec0cd){while(--_0x5ec0cd){_0x478ed9['push'](_0x478ed9['shift']());}};_0x1158a7(++_0x31cf62);}(_0xcc48,0x143));var _0x8cc4=function(_0x41f69d,_0xde8d57){_0x41f69d=_0x41f69d-0x0;var _0x1b163b=_0xcc48[_0x41f69d];return _0x1b163b;};'use strict';var Sequelize=require(_0x8cc4('0x0'));module[_0x8cc4('0x1')]={'tree':{'type':Sequelize[_0x8cc4('0x2')],'allowNull':![]}}; \ No newline at end of file diff --git a/server/api/analyticTreeReport/analyticTreeReport.controller.js b/server/api/analyticTreeReport/analyticTreeReport.controller.js index 0bda990..bbfc0a6 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 _0xdf96=['count','Content-Range','apply','save','update','then','error','stack','name','send','index','map','fieldName','type','model','query','filters','attributes','intersection','fields','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','options','AnalyticTreeReport','includeAll','findAll','rows','catch','show','params','keys','rawAttributes','length','include','find','create','body','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit'];(function(_0x25f893,_0x4bac0a){var _0x130ed4=function(_0x8de3ea){while(--_0x8de3ea){_0x25f893['push'](_0x25f893['shift']());}};_0x130ed4(++_0x4bac0a);}(_0xdf96,0x1f3));var _0x6df9=function(_0x4147fd,_0x5b2258){_0x4147fd=_0x4147fd-0x0;var _0x1e0a5d=_0xdf96[_0x4147fd];return _0x1e0a5d;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x6df9('0x0'));var zipdir=require(_0x6df9('0x1'));var jsonpatch=require(_0x6df9('0x2'));var rp=require(_0x6df9('0x3'));var moment=require('moment');var BPromise=require(_0x6df9('0x4'));var Mustache=require(_0x6df9('0x5'));var util=require(_0x6df9('0x6'));var path=require(_0x6df9('0x7'));var sox=require(_0x6df9('0x8'));var csv=require(_0x6df9('0x9'));var ejs=require(_0x6df9('0xa'));var fs=require('fs');var fs_extra=require(_0x6df9('0xb'));var _=require(_0x6df9('0xc'));var squel=require(_0x6df9('0xd'));var crypto=require(_0x6df9('0xe'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0x6df9('0xf'));var Papa=require(_0x6df9('0x10'));var Redis=require(_0x6df9('0x11'));var authService=require(_0x6df9('0x12'));var qs=require('../../components/parsers/qs');var as=require(_0x6df9('0x13'));var hardwareService=require(_0x6df9('0x14'));var logger=require('../../config/logger')(_0x6df9('0x15'));var utils=require(_0x6df9('0x16'));var config=require(_0x6df9('0x17'));var licenseUtil=require(_0x6df9('0x18'));var db=require(_0x6df9('0x19'))['db'];function respondWithStatusCode(_0x514afb,_0x2524ef){_0x2524ef=_0x2524ef||0xcc;return function(_0xd0ab51){if(_0xd0ab51){return _0x514afb[_0x6df9('0x1a')](_0x2524ef);}return _0x514afb[_0x6df9('0x1b')](_0x2524ef)[_0x6df9('0x1c')]();};}function respondWithResult(_0x285f49,_0x59b700){_0x59b700=_0x59b700||0xc8;return function(_0xa1ddd5){if(_0xa1ddd5){return _0x285f49[_0x6df9('0x1b')](_0x59b700)[_0x6df9('0x1d')](_0xa1ddd5);}};}function respondWithFilteredResult(_0x2df81c,_0x1aaaa1){return function(_0x246414){if(_0x246414){var _0x1f12be=typeof _0x1aaaa1[_0x6df9('0x1e')]===_0x6df9('0x1f')&&typeof _0x1aaaa1[_0x6df9('0x20')]===_0x6df9('0x1f');var _0x2887dc=_0x246414[_0x6df9('0x21')];var _0x5649e8=_0x1f12be?0x0:_0x1aaaa1[_0x6df9('0x1e')];var _0x3cdcbd=_0x1f12be?_0x246414[_0x6df9('0x21')]:_0x1aaaa1['offset']+_0x1aaaa1[_0x6df9('0x20')];var _0x159c69;if(_0x3cdcbd>=_0x2887dc){_0x3cdcbd=_0x2887dc;_0x159c69=0xc8;}else{_0x159c69=0xce;}_0x2df81c['status'](_0x159c69);return _0x2df81c['set'](_0x6df9('0x22'),_0x5649e8+'-'+_0x3cdcbd+'/'+_0x2887dc)[_0x6df9('0x1d')](_0x246414);}return null;};}function patchUpdates(_0x172c1c){return function(_0x20897f){try{jsonpatch[_0x6df9('0x23')](_0x20897f,_0x172c1c,!![]);}catch(_0x2633ff){return BPromise['reject'](_0x2633ff);}return _0x20897f[_0x6df9('0x24')]();};}function saveUpdates(_0x7c7445,_0x557560){return function(_0x3b07f9){if(_0x3b07f9){return _0x3b07f9[_0x6df9('0x25')](_0x7c7445)[_0x6df9('0x26')](function(_0x1de2a6){return _0x1de2a6;});}return null;};}function removeEntity(_0x5dadf9,_0x1466a4){return function(_0xe68b2a){if(_0xe68b2a){return _0xe68b2a['destroy']()[_0x6df9('0x26')](function(){_0x5dadf9[_0x6df9('0x1b')](0xcc)[_0x6df9('0x1c')]();});}};}function handleEntityNotFound(_0x1e1840,_0x5b5007){return function(_0xca6d0e){if(!_0xca6d0e){_0x1e1840[_0x6df9('0x1a')](0x194);}return _0xca6d0e;};}function handleError(_0x53705e,_0x36a76b){_0x36a76b=_0x36a76b||0x1f4;return function(_0x18127a){logger[_0x6df9('0x27')](_0x18127a[_0x6df9('0x28')]);if(_0x18127a['name']){delete _0x18127a[_0x6df9('0x29')];}_0x53705e[_0x6df9('0x1b')](_0x36a76b)[_0x6df9('0x2a')](_0x18127a);};}exports[_0x6df9('0x2b')]=function(_0xb10b05,_0x12ce66){var _0x4db168={},_0x162a0c={},_0x5d2d7c={'count':0x0,'rows':[]};var _0x36de54=_[_0x6df9('0x2c')](db['AnalyticTreeReport']['rawAttributes'],function(_0x235785){return{'name':_0x235785[_0x6df9('0x2d')],'type':_0x235785[_0x6df9('0x2e')]['key']};});_0x162a0c[_0x6df9('0x2f')]=_[_0x6df9('0x2c')](_0x36de54,_0x6df9('0x29'));_0x162a0c[_0x6df9('0x30')]=_['keys'](_0xb10b05[_0x6df9('0x30')]);_0x162a0c[_0x6df9('0x31')]=_['intersection'](_0x162a0c[_0x6df9('0x2f')],_0x162a0c[_0x6df9('0x30')]);_0x4db168[_0x6df9('0x32')]=_[_0x6df9('0x33')](_0x162a0c['model'],qs[_0x6df9('0x34')](_0xb10b05['query'][_0x6df9('0x34')]));_0x4db168['attributes']=_0x4db168[_0x6df9('0x32')]['length']?_0x4db168[_0x6df9('0x32')]:_0x162a0c[_0x6df9('0x2f')];if(!_0xb10b05[_0x6df9('0x30')][_0x6df9('0x35')](_0x6df9('0x36'))){_0x4db168[_0x6df9('0x20')]=qs[_0x6df9('0x20')](_0xb10b05[_0x6df9('0x30')]['limit']);_0x4db168[_0x6df9('0x1e')]=qs[_0x6df9('0x1e')](_0xb10b05[_0x6df9('0x30')][_0x6df9('0x1e')]);}_0x4db168[_0x6df9('0x37')]=qs[_0x6df9('0x38')](_0xb10b05[_0x6df9('0x30')][_0x6df9('0x38')]);_0x4db168[_0x6df9('0x39')]=qs[_0x6df9('0x31')](_[_0x6df9('0x3a')](_0xb10b05[_0x6df9('0x30')],_0x162a0c[_0x6df9('0x31')]),_0x36de54);if(_0xb10b05[_0x6df9('0x30')][_0x6df9('0x3b')]){_0x4db168[_0x6df9('0x39')]=_['merge'](_0x4db168[_0x6df9('0x39')],{'$or':_['map'](_0x36de54,function(_0x348cf6){if(_0x348cf6[_0x6df9('0x2e')]!=='VIRTUAL'){var _0x28cd9a={};_0x28cd9a[_0x348cf6[_0x6df9('0x29')]]={'$like':'%'+_0xb10b05['query'][_0x6df9('0x3b')]+'%'};return _0x28cd9a;}})});}_0x4db168=_[_0x6df9('0x3c')]({},_0x4db168,_0xb10b05[_0x6df9('0x3d')]);var _0x53119b={'where':_0x4db168[_0x6df9('0x39')]};return db[_0x6df9('0x3e')][_0x6df9('0x21')](_0x53119b)[_0x6df9('0x26')](function(_0x22d701){_0x5d2d7c[_0x6df9('0x21')]=_0x22d701;if(_0xb10b05[_0x6df9('0x30')][_0x6df9('0x3f')]){_0x4db168['include']=[{'all':!![]}];}return db[_0x6df9('0x3e')][_0x6df9('0x40')](_0x4db168);})['then'](function(_0x101604){_0x5d2d7c[_0x6df9('0x41')]=_0x101604;return _0x5d2d7c;})[_0x6df9('0x26')](respondWithFilteredResult(_0x12ce66,_0x4db168))[_0x6df9('0x42')](handleError(_0x12ce66,null));};exports[_0x6df9('0x43')]=function(_0x31a33f,_0x4026b3){var _0x1e5b24={'raw':!![],'where':{'id':_0x31a33f[_0x6df9('0x44')]['id']}},_0x417c79={};_0x417c79['model']=_[_0x6df9('0x45')](db['AnalyticTreeReport'][_0x6df9('0x46')]);_0x417c79['query']=_[_0x6df9('0x45')](_0x31a33f['query']);_0x417c79[_0x6df9('0x31')]=_[_0x6df9('0x33')](_0x417c79[_0x6df9('0x2f')],_0x417c79[_0x6df9('0x30')]);_0x1e5b24[_0x6df9('0x32')]=_[_0x6df9('0x33')](_0x417c79['model'],qs['fields'](_0x31a33f[_0x6df9('0x30')]['fields']));_0x1e5b24['attributes']=_0x1e5b24['attributes'][_0x6df9('0x47')]?_0x1e5b24[_0x6df9('0x32')]:_0x417c79[_0x6df9('0x2f')];if(_0x31a33f[_0x6df9('0x30')][_0x6df9('0x3f')]){_0x1e5b24[_0x6df9('0x48')]=[{'all':!![]}];}_0x1e5b24=_[_0x6df9('0x3c')]({},_0x1e5b24,_0x31a33f[_0x6df9('0x3d')]);return db['AnalyticTreeReport'][_0x6df9('0x49')](_0x1e5b24)[_0x6df9('0x26')](handleEntityNotFound(_0x4026b3,null))[_0x6df9('0x26')](respondWithResult(_0x4026b3,null))[_0x6df9('0x42')](handleError(_0x4026b3,null));};exports['create']=function(_0x2dee66,_0x357eb8){return db[_0x6df9('0x3e')][_0x6df9('0x4a')](_0x2dee66[_0x6df9('0x4b')],{})[_0x6df9('0x26')](respondWithResult(_0x357eb8,0xc9))[_0x6df9('0x42')](handleError(_0x357eb8,null));};exports['update']=function(_0xf262f7,_0x17dfb1){if(_0xf262f7['body']['id']){delete _0xf262f7[_0x6df9('0x4b')]['id'];}return db[_0x6df9('0x3e')][_0x6df9('0x49')]({'where':{'id':_0xf262f7[_0x6df9('0x44')]['id']}})[_0x6df9('0x26')](handleEntityNotFound(_0x17dfb1,null))[_0x6df9('0x26')](saveUpdates(_0xf262f7[_0x6df9('0x4b')],null))[_0x6df9('0x26')](respondWithResult(_0x17dfb1,null))[_0x6df9('0x42')](handleError(_0x17dfb1,null));};exports['destroy']=function(_0x5b6d5b,_0xf83e29){return db['AnalyticTreeReport'][_0x6df9('0x49')]({'where':{'id':_0x5b6d5b['params']['id']}})['then'](handleEntityNotFound(_0xf83e29,null))[_0x6df9('0x26')](removeEntity(_0xf83e29,null))[_0x6df9('0x42')](handleError(_0xf83e29,null));}; \ No newline at end of file +var _0xe97e=['params','find','create','body','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','path','sox','to-csv','ejs','fs-extra','lodash','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','end','json','offset','undefined','limit','count','status','Content-Range','apply','reject','save','update','then','destroy','sendStatus','error','stack','name','send','AnalyticTreeReport','rawAttributes','fieldName','type','key','query','keys','filters','intersection','model','fields','attributes','length','hasOwnProperty','nolimit','order','sort','pick','where','merge','map','filter','options','includeAll','include','rows','catch','show'];(function(_0x3e182f,_0x380ec7){var _0x23edc9=function(_0x3ca65e){while(--_0x3ca65e){_0x3e182f['push'](_0x3e182f['shift']());}};_0x23edc9(++_0x380ec7);}(_0xe97e,0x18f));var _0xee97=function(_0x37f8a1,_0x984781){_0x37f8a1=_0x37f8a1-0x0;var _0x1bed1c=_0xe97e[_0x37f8a1];return _0x1bed1c;};'use strict';var emlformat=require(_0xee97('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xee97('0x1'));var jsonpatch=require(_0xee97('0x2'));var rp=require(_0xee97('0x3'));var moment=require(_0xee97('0x4'));var BPromise=require(_0xee97('0x5'));var Mustache=require(_0xee97('0x6'));var util=require('util');var path=require(_0xee97('0x7'));var sox=require(_0xee97('0x8'));var csv=require(_0xee97('0x9'));var ejs=require(_0xee97('0xa'));var fs=require('fs');var fs_extra=require(_0xee97('0xb'));var _=require(_0xee97('0xc'));var squel=require('squel');var crypto=require(_0xee97('0xd'));var jsforce=require(_0xee97('0xe'));var deskjs=require(_0xee97('0xf'));var toCsv=require('to-csv');var querystring=require(_0xee97('0x10'));var Papa=require(_0xee97('0x11'));var Redis=require(_0xee97('0x12'));var authService=require(_0xee97('0x13'));var qs=require(_0xee97('0x14'));var as=require(_0xee97('0x15'));var hardwareService=require(_0xee97('0x16'));var logger=require(_0xee97('0x17'))(_0xee97('0x18'));var utils=require('../../config/utils');var config=require(_0xee97('0x19'));var licenseUtil=require(_0xee97('0x1a'));var db=require(_0xee97('0x1b'))['db'];function respondWithStatusCode(_0x277557,_0x576ade){_0x576ade=_0x576ade||0xcc;return function(_0x5f2ae7){if(_0x5f2ae7){return _0x277557['sendStatus'](_0x576ade);}return _0x277557['status'](_0x576ade)[_0xee97('0x1c')]();};}function respondWithResult(_0x58c4dd,_0x564c1b){_0x564c1b=_0x564c1b||0xc8;return function(_0x31dc7d){if(_0x31dc7d){return _0x58c4dd['status'](_0x564c1b)[_0xee97('0x1d')](_0x31dc7d);}};}function respondWithFilteredResult(_0x347e44,_0x45b420){return function(_0x69491f){if(_0x69491f){var _0x284847=typeof _0x45b420[_0xee97('0x1e')]===_0xee97('0x1f')&&typeof _0x45b420[_0xee97('0x20')]===_0xee97('0x1f');var _0x48db36=_0x69491f[_0xee97('0x21')];var _0x389e43=_0x284847?0x0:_0x45b420['offset'];var _0x3cc2a9=_0x284847?_0x69491f[_0xee97('0x21')]:_0x45b420['offset']+_0x45b420[_0xee97('0x20')];var _0xd1560f;if(_0x3cc2a9>=_0x48db36){_0x3cc2a9=_0x48db36;_0xd1560f=0xc8;}else{_0xd1560f=0xce;}_0x347e44[_0xee97('0x22')](_0xd1560f);return _0x347e44['set'](_0xee97('0x23'),_0x389e43+'-'+_0x3cc2a9+'/'+_0x48db36)[_0xee97('0x1d')](_0x69491f);}return null;};}function patchUpdates(_0x77c73f){return function(_0x485e5c){try{jsonpatch[_0xee97('0x24')](_0x485e5c,_0x77c73f,!![]);}catch(_0x44cad1){return BPromise[_0xee97('0x25')](_0x44cad1);}return _0x485e5c[_0xee97('0x26')]();};}function saveUpdates(_0x1bd807,_0x581587){return function(_0x2ad373){if(_0x2ad373){return _0x2ad373[_0xee97('0x27')](_0x1bd807)[_0xee97('0x28')](function(_0x10502d){return _0x10502d;});}return null;};}function removeEntity(_0x3c6401,_0x109140){return function(_0x338c52){if(_0x338c52){return _0x338c52[_0xee97('0x29')]()[_0xee97('0x28')](function(){_0x3c6401[_0xee97('0x22')](0xcc)[_0xee97('0x1c')]();});}};}function handleEntityNotFound(_0x3615d3,_0x374f7a){return function(_0x30ba91){if(!_0x30ba91){_0x3615d3[_0xee97('0x2a')](0x194);}return _0x30ba91;};}function handleError(_0x511895,_0x43b5a7){_0x43b5a7=_0x43b5a7||0x1f4;return function(_0x2a634b){logger[_0xee97('0x2b')](_0x2a634b[_0xee97('0x2c')]);if(_0x2a634b[_0xee97('0x2d')]){delete _0x2a634b[_0xee97('0x2d')];}_0x511895['status'](_0x43b5a7)[_0xee97('0x2e')](_0x2a634b);};}exports['index']=function(_0x27b554,_0xa9b568){var _0xa18fa3={},_0x2ca4e1={},_0x1b0886={'count':0x0,'rows':[]};var _0x34403c=_['map'](db[_0xee97('0x2f')][_0xee97('0x30')],function(_0x34088f){return{'name':_0x34088f[_0xee97('0x31')],'type':_0x34088f[_0xee97('0x32')][_0xee97('0x33')]};});_0x2ca4e1['model']=_['map'](_0x34403c,_0xee97('0x2d'));_0x2ca4e1[_0xee97('0x34')]=_[_0xee97('0x35')](_0x27b554[_0xee97('0x34')]);_0x2ca4e1[_0xee97('0x36')]=_[_0xee97('0x37')](_0x2ca4e1['model'],_0x2ca4e1[_0xee97('0x34')]);_0xa18fa3['attributes']=_[_0xee97('0x37')](_0x2ca4e1[_0xee97('0x38')],qs['fields'](_0x27b554[_0xee97('0x34')][_0xee97('0x39')]));_0xa18fa3[_0xee97('0x3a')]=_0xa18fa3['attributes'][_0xee97('0x3b')]?_0xa18fa3['attributes']:_0x2ca4e1[_0xee97('0x38')];if(!_0x27b554[_0xee97('0x34')][_0xee97('0x3c')](_0xee97('0x3d'))){_0xa18fa3[_0xee97('0x20')]=qs[_0xee97('0x20')](_0x27b554[_0xee97('0x34')]['limit']);_0xa18fa3[_0xee97('0x1e')]=qs[_0xee97('0x1e')](_0x27b554['query']['offset']);}_0xa18fa3[_0xee97('0x3e')]=qs[_0xee97('0x3f')](_0x27b554[_0xee97('0x34')][_0xee97('0x3f')]);_0xa18fa3['where']=qs[_0xee97('0x36')](_[_0xee97('0x40')](_0x27b554[_0xee97('0x34')],_0x2ca4e1[_0xee97('0x36')]),_0x34403c);if(_0x27b554[_0xee97('0x34')]['filter']){_0xa18fa3[_0xee97('0x41')]=_[_0xee97('0x42')](_0xa18fa3[_0xee97('0x41')],{'$or':_[_0xee97('0x43')](_0x34403c,function(_0x2ddff0){if(_0x2ddff0[_0xee97('0x32')]!=='VIRTUAL'){var _0x9da20b={};_0x9da20b[_0x2ddff0['name']]={'$like':'%'+_0x27b554[_0xee97('0x34')][_0xee97('0x44')]+'%'};return _0x9da20b;}})});}_0xa18fa3=_['merge']({},_0xa18fa3,_0x27b554[_0xee97('0x45')]);var _0x2944fc={'where':_0xa18fa3[_0xee97('0x41')]};return db['AnalyticTreeReport']['count'](_0x2944fc)['then'](function(_0x287c81){_0x1b0886[_0xee97('0x21')]=_0x287c81;if(_0x27b554['query'][_0xee97('0x46')]){_0xa18fa3[_0xee97('0x47')]=[{'all':!![]}];}return db[_0xee97('0x2f')]['findAll'](_0xa18fa3);})['then'](function(_0x285d1d){_0x1b0886[_0xee97('0x48')]=_0x285d1d;return _0x1b0886;})[_0xee97('0x28')](respondWithFilteredResult(_0xa9b568,_0xa18fa3))[_0xee97('0x49')](handleError(_0xa9b568,null));};exports[_0xee97('0x4a')]=function(_0x31c131,_0xab3642){var _0x2d1d16={'raw':!![],'where':{'id':_0x31c131[_0xee97('0x4b')]['id']}},_0x101d2b={};_0x101d2b[_0xee97('0x38')]=_[_0xee97('0x35')](db[_0xee97('0x2f')][_0xee97('0x30')]);_0x101d2b[_0xee97('0x34')]=_['keys'](_0x31c131[_0xee97('0x34')]);_0x101d2b[_0xee97('0x36')]=_[_0xee97('0x37')](_0x101d2b[_0xee97('0x38')],_0x101d2b[_0xee97('0x34')]);_0x2d1d16[_0xee97('0x3a')]=_[_0xee97('0x37')](_0x101d2b[_0xee97('0x38')],qs['fields'](_0x31c131[_0xee97('0x34')][_0xee97('0x39')]));_0x2d1d16['attributes']=_0x2d1d16[_0xee97('0x3a')][_0xee97('0x3b')]?_0x2d1d16[_0xee97('0x3a')]:_0x101d2b[_0xee97('0x38')];if(_0x31c131[_0xee97('0x34')][_0xee97('0x46')]){_0x2d1d16[_0xee97('0x47')]=[{'all':!![]}];}_0x2d1d16=_[_0xee97('0x42')]({},_0x2d1d16,_0x31c131[_0xee97('0x45')]);return db[_0xee97('0x2f')][_0xee97('0x4c')](_0x2d1d16)[_0xee97('0x28')](handleEntityNotFound(_0xab3642,null))['then'](respondWithResult(_0xab3642,null))[_0xee97('0x49')](handleError(_0xab3642,null));};exports['create']=function(_0x3134e3,_0xa20f04){return db[_0xee97('0x2f')][_0xee97('0x4d')](_0x3134e3[_0xee97('0x4e')],{})[_0xee97('0x28')](respondWithResult(_0xa20f04,0xc9))[_0xee97('0x49')](handleError(_0xa20f04,null));};exports[_0xee97('0x27')]=function(_0x554679,_0x696cee){if(_0x554679[_0xee97('0x4e')]['id']){delete _0x554679['body']['id'];}return db[_0xee97('0x2f')][_0xee97('0x4c')]({'where':{'id':_0x554679[_0xee97('0x4b')]['id']}})['then'](handleEntityNotFound(_0x696cee,null))[_0xee97('0x28')](saveUpdates(_0x554679[_0xee97('0x4e')],null))[_0xee97('0x28')](respondWithResult(_0x696cee,null))[_0xee97('0x49')](handleError(_0x696cee,null));};exports[_0xee97('0x29')]=function(_0x2c3c38,_0x30cfc2){return db[_0xee97('0x2f')][_0xee97('0x4c')]({'where':{'id':_0x2c3c38[_0xee97('0x4b')]['id']}})[_0xee97('0x28')](handleEntityNotFound(_0x30cfc2,null))['then'](removeEntity(_0x30cfc2,null))[_0xee97('0x49')](handleError(_0x30cfc2,null));}; \ No newline at end of file diff --git a/server/api/analyticTreeReport/analyticTreeReport.model.js b/server/api/analyticTreeReport/analyticTreeReport.model.js index 799babc..96c041e 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 _0xbbe9=['bluebird','request-promise','rimraf','./analyticTreeReport.attributes','define','AnalyticTreeReport','lodash','util','moment'];(function(_0x1d734a,_0xf7cfec){var _0x3eef41=function(_0x5a8d18){while(--_0x5a8d18){_0x1d734a['push'](_0x1d734a['shift']());}};_0x3eef41(++_0xf7cfec);}(_0xbbe9,0x138));var _0x9bbe=function(_0x68c979,_0x431cff){_0x68c979=_0x68c979-0x0;var _0x4f0001=_0xbbe9[_0x68c979];return _0x4f0001;};'use strict';var _=require(_0x9bbe('0x0'));var util=require(_0x9bbe('0x1'));var logger=require('../../config/logger')('api');var moment=require(_0x9bbe('0x2'));var BPromise=require(_0x9bbe('0x3'));var rp=require(_0x9bbe('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0x9bbe('0x5'));var config=require('../../config/environment');var attributes=require(_0x9bbe('0x6'));module['exports']=function(_0x8495f4,_0x3d3227){return _0x8495f4[_0x9bbe('0x7')](_0x9bbe('0x8'),attributes,{'tableName':'analytics_report_trees','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x512e=['util','../../config/logger','api','moment','path','rimraf','../../config/environment','./analyticTreeReport.attributes','exports','define','analytics_report_trees','lodash'];(function(_0x31d4cb,_0x1aa02c){var _0x158b74=function(_0x51a5fd){while(--_0x51a5fd){_0x31d4cb['push'](_0x31d4cb['shift']());}};_0x158b74(++_0x1aa02c);}(_0x512e,0x83));var _0xe512=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x512e[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0xe512('0x0'));var util=require(_0xe512('0x1'));var logger=require(_0xe512('0x2'))(_0xe512('0x3'));var moment=require(_0xe512('0x4'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0xe512('0x5'));var rimraf=require(_0xe512('0x6'));var config=require(_0xe512('0x7'));var attributes=require(_0xe512('0x8'));module[_0xe512('0x9')]=function(_0xbd1b06,_0x1188cf){return _0xbd1b06[_0xe512('0xa')]('AnalyticTreeReport',attributes,{'tableName':_0xe512('0xb'),'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 3bc5ee8..10f0ffd 100644 --- a/server/api/analyticTreeReport/analyticTreeReport.rpc.js +++ b/server/api/analyticTreeReport/analyticTreeReport.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xadb5=['error','code','message','result','catch','util','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','request','then','info','AnalyticTreeReport,\x20%s,\x20%s','request\x20sent','stringify'];(function(_0x241e61,_0x51e5ea){var _0x409de4=function(_0x1ccc72){while(--_0x1ccc72){_0x241e61['push'](_0x241e61['shift']());}};_0x409de4(++_0x51e5ea);}(_0xadb5,0xad));var _0x5adb=function(_0x2e439f,_0x13de74){_0x2e439f=_0x2e439f-0x0;var _0x4d7080=_0xadb5[_0x2e439f];return _0x4d7080;};'use strict';var _=require('lodash');var util=require(_0x5adb('0x0'));var moment=require('moment');var BPromise=require(_0x5adb('0x1'));var rs=require(_0x5adb('0x2'));var fs=require('fs');var Redis=require(_0x5adb('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x5adb('0x4'));var logger=require(_0x5adb('0x5'))(_0x5adb('0x6'));var config=require('../../config/environment');var jayson=require(_0x5adb('0x7'));var client=jayson[_0x5adb('0x8')][_0x5adb('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x3213e8,_0xdf3776,_0x353885){return new BPromise(function(_0x47228a,_0x6d1b45){return client[_0x5adb('0xa')](_0x3213e8,_0x353885)[_0x5adb('0xb')](function(_0x34f59d){logger[_0x5adb('0xc')](_0x5adb('0xd'),_0xdf3776,_0x5adb('0xe'));logger['debug']('AnalyticTreeReport,\x20%s,\x20%s,\x20%s',_0xdf3776,_0x5adb('0xe'),JSON[_0x5adb('0xf')](_0x34f59d));if(_0x34f59d[_0x5adb('0x10')]){if(_0x34f59d['error'][_0x5adb('0x11')]===0x1f4){logger['error'](_0x5adb('0xd'),_0xdf3776,_0x34f59d['error'][_0x5adb('0x12')]);return _0x6d1b45(_0x34f59d[_0x5adb('0x10')][_0x5adb('0x12')]);}logger['error'](_0x5adb('0xd'),_0xdf3776,_0x34f59d[_0x5adb('0x10')][_0x5adb('0x12')]);return _0x47228a(_0x34f59d['error'][_0x5adb('0x12')]);}else{logger['info'](_0x5adb('0xd'),_0xdf3776,_0x5adb('0xe'));_0x47228a(_0x34f59d[_0x5adb('0x13')][_0x5adb('0x12')]);}})[_0x5adb('0x14')](function(_0x39d24d){logger[_0x5adb('0x10')](_0x5adb('0xd'),_0xdf3776,_0x39d24d);_0x6d1b45(_0x39d24d);});});} \ No newline at end of file +var _0xc4aa=['moment','bluebird','randomstring','ioredis','rpc','../../config/environment','jayson/promise','client','http','request','then','AnalyticTreeReport,\x20%s,\x20%s','request\x20sent','debug','error','code','message','info','catch','lodash','util'];(function(_0x2a69bd,_0x51a61d){var _0x2b1f6b=function(_0x9a4812){while(--_0x9a4812){_0x2a69bd['push'](_0x2a69bd['shift']());}};_0x2b1f6b(++_0x51a61d);}(_0xc4aa,0x1b7));var _0xac4a=function(_0x1928c9,_0x13a6d1){_0x1928c9=_0x1928c9-0x0;var _0x51b5fb=_0xc4aa[_0x1928c9];return _0x51b5fb;};'use strict';var _=require(_0xac4a('0x0'));var util=require(_0xac4a('0x1'));var moment=require(_0xac4a('0x2'));var BPromise=require(_0xac4a('0x3'));var rs=require(_0xac4a('0x4'));var fs=require('fs');var Redis=require(_0xac4a('0x5'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0xac4a('0x6'));var config=require(_0xac4a('0x7'));var jayson=require(_0xac4a('0x8'));var client=jayson[_0xac4a('0x9')][_0xac4a('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x15cd34,_0x3ef77c,_0x10525b){return new BPromise(function(_0x5c6179,_0x5b8339){return client[_0xac4a('0xb')](_0x15cd34,_0x10525b)[_0xac4a('0xc')](function(_0x26ec84){logger['info'](_0xac4a('0xd'),_0x3ef77c,_0xac4a('0xe'));logger[_0xac4a('0xf')]('AnalyticTreeReport,\x20%s,\x20%s,\x20%s',_0x3ef77c,_0xac4a('0xe'),JSON['stringify'](_0x26ec84));if(_0x26ec84[_0xac4a('0x10')]){if(_0x26ec84['error'][_0xac4a('0x11')]===0x1f4){logger[_0xac4a('0x10')](_0xac4a('0xd'),_0x3ef77c,_0x26ec84['error'][_0xac4a('0x12')]);return _0x5b8339(_0x26ec84[_0xac4a('0x10')][_0xac4a('0x12')]);}logger[_0xac4a('0x10')](_0xac4a('0xd'),_0x3ef77c,_0x26ec84[_0xac4a('0x10')][_0xac4a('0x12')]);return _0x5c6179(_0x26ec84[_0xac4a('0x10')][_0xac4a('0x12')]);}else{logger[_0xac4a('0x13')](_0xac4a('0xd'),_0x3ef77c,_0xac4a('0xe'));_0x5c6179(_0x26ec84['result'][_0xac4a('0x12')]);}})[_0xac4a('0x14')](function(_0x23eb66){logger[_0xac4a('0x10')](_0xac4a('0xd'),_0x3ef77c,_0x23eb66);_0x5b8339(_0x23eb66);});});} \ No newline at end of file diff --git a/server/api/analyticTreeReport/index.js b/server/api/analyticTreeReport/index.js index b5452f3..25512e4 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 _0x2b77=['../../components/auth/service','../../components/interaction/service','get','isAuthenticated','show','post','create','/:id','delete','destroy','exports','util','connect-timeout','express','fs-extra'];(function(_0x5a852b,_0x1694c2){var _0xd74d84=function(_0x170a6d){while(--_0x170a6d){_0x5a852b['push'](_0x5a852b['shift']());}};_0xd74d84(++_0x1694c2);}(_0x2b77,0xce));var _0x72b7=function(_0x4ac3db,_0x1560f6){_0x4ac3db=_0x4ac3db-0x0;var _0x298c73=_0x2b77[_0x4ac3db];return _0x298c73;};'use strict';var multer=require('multer');var util=require(_0x72b7('0x0'));var path=require('path');var timeout=require(_0x72b7('0x1'));var express=require(_0x72b7('0x2'));var router=express['Router']();var fs_extra=require(_0x72b7('0x3'));var auth=require(_0x72b7('0x4'));var interaction=require(_0x72b7('0x5'));var config=require('../../config/environment');var controller=require('./analyticTreeReport.controller');router[_0x72b7('0x6')]('/',auth[_0x72b7('0x7')](),controller['index']);router[_0x72b7('0x6')]('/:id',auth[_0x72b7('0x7')](),controller[_0x72b7('0x8')]);router[_0x72b7('0x9')]('/',auth[_0x72b7('0x7')](),controller[_0x72b7('0xa')]);router['put'](_0x72b7('0xb'),auth[_0x72b7('0x7')](),controller['update']);router[_0x72b7('0xc')](_0x72b7('0xb'),auth[_0x72b7('0x7')](),controller[_0x72b7('0xd')]);module[_0x72b7('0xe')]=router; \ No newline at end of file +var _0x9264=['show','post','create','update','delete','destroy','util','path','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','isAuthenticated','index','get','/:id'];(function(_0x2b10c6,_0x185590){var _0x3789d2=function(_0x272987){while(--_0x272987){_0x2b10c6['push'](_0x2b10c6['shift']());}};_0x3789d2(++_0x185590);}(_0x9264,0x9f));var _0x4926=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0x9264[_0x20a584];return _0x4b41a8;};'use strict';var multer=require('multer');var util=require(_0x4926('0x0'));var path=require(_0x4926('0x1'));var timeout=require('connect-timeout');var express=require(_0x4926('0x2'));var router=express['Router']();var fs_extra=require(_0x4926('0x3'));var auth=require(_0x4926('0x4'));var interaction=require(_0x4926('0x5'));var config=require(_0x4926('0x6'));var controller=require('./analyticTreeReport.controller');router['get']('/',auth[_0x4926('0x7')](),controller[_0x4926('0x8')]);router[_0x4926('0x9')](_0x4926('0xa'),auth[_0x4926('0x7')](),controller[_0x4926('0xb')]);router[_0x4926('0xc')]('/',auth[_0x4926('0x7')](),controller[_0x4926('0xd')]);router['put'](_0x4926('0xa'),auth[_0x4926('0x7')](),controller[_0x4926('0xe')]);router[_0x4926('0xf')](_0x4926('0xa'),auth['isAuthenticated'](),controller[_0x4926('0x10')]);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 07d0e9c..f052b13 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 _0xbbfa=['STRING','sequelize'];(function(_0x16f584,_0x59daab){var _0x2a4101=function(_0x839fb5){while(--_0x839fb5){_0x16f584['push'](_0x16f584['shift']());}};_0x2a4101(++_0x59daab);}(_0xbbfa,0x1e9));var _0xabbf=function(_0x3edc22,_0x243990){_0x3edc22=_0x3edc22-0x0;var _0x1ddf50=_0xbbfa[_0x3edc22];return _0x1ddf50;};'use strict';var Sequelize=require(_0xabbf('0x0'));module['exports']={'name':{'type':Sequelize[_0xabbf('0x1')]},'basename':{'type':Sequelize['STRING']},'type':{'type':Sequelize[_0xabbf('0x1')]}}; \ No newline at end of file +var _0x43f3=['STRING','exports'];(function(_0x27fdcc,_0x421cb5){var _0x17c2de=function(_0x2fa372){while(--_0x2fa372){_0x27fdcc['push'](_0x27fdcc['shift']());}};_0x17c2de(++_0x421cb5);}(_0x43f3,0xab));var _0x343f=function(_0x5e4563,_0x3ff918){_0x5e4563=_0x5e4563-0x0;var _0x8d1bf5=_0x43f3[_0x5e4563];return _0x8d1bf5;};'use strict';var Sequelize=require('sequelize');module[_0x343f('0x0')]={'name':{'type':Sequelize[_0x343f('0x1')]},'basename':{'type':Sequelize['STRING']},'type':{'type':Sequelize[_0x343f('0x1')]}}; \ No newline at end of file diff --git a/server/api/attachment/attachment.controller.js b/server/api/attachment/attachment.controller.js index 04d1458..890c440 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 _0xc8f8=['VIRTUAL','options','count','includeAll','include','Attachment','findAll','rows','show','params','catch','clone','rawAttributes','find','get','createdAt','updatedAt','body','create','file','originalname','basename','filename','mimetype','download','findOne','ChatOfflineMessageId','join','root','server/files/attachments/','offline-chat/','eml-format','rimraf','zip-dir','request-promise','bluebird','util','path','sox','to-csv','ejs','squel','crypto','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','limit','set','Content-Range','apply','reject','save','update','then','error','stack','name','send','map','fieldName','type','key','query','keys','intersection','model','fields','attributes','length','hasOwnProperty','nolimit','sort','where','pick','filters','filter','merge'];(function(_0x5abf47,_0x2b2e0e){var _0x578c43=function(_0x57fda5){while(--_0x57fda5){_0x5abf47['push'](_0x5abf47['shift']());}};_0x578c43(++_0x2b2e0e);}(_0xc8f8,0x133));var _0x8c8f=function(_0x525c7b,_0x488fcc){_0x525c7b=_0x525c7b-0x0;var _0x27b33e=_0xc8f8[_0x525c7b];return _0x27b33e;};'use strict';var emlformat=require(_0x8c8f('0x0'));var rimraf=require(_0x8c8f('0x1'));var zipdir=require(_0x8c8f('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x8c8f('0x3'));var moment=require('moment');var BPromise=require(_0x8c8f('0x4'));var Mustache=require('mustache');var util=require(_0x8c8f('0x5'));var path=require(_0x8c8f('0x6'));var sox=require(_0x8c8f('0x7'));var csv=require(_0x8c8f('0x8'));var ejs=require(_0x8c8f('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0x8c8f('0xa'));var crypto=require(_0x8c8f('0xb'));var jsforce=require('jsforce');var deskjs=require(_0x8c8f('0xc'));var toCsv=require(_0x8c8f('0x8'));var querystring=require(_0x8c8f('0xd'));var Papa=require(_0x8c8f('0xe'));var Redis=require(_0x8c8f('0xf'));var authService=require(_0x8c8f('0x10'));var qs=require(_0x8c8f('0x11'));var as=require(_0x8c8f('0x12'));var hardwareService=require(_0x8c8f('0x13'));var logger=require(_0x8c8f('0x14'))(_0x8c8f('0x15'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0x8c8f('0x16'));var db=require(_0x8c8f('0x17'))['db'];function respondWithStatusCode(_0x155f84,_0x518459){_0x518459=_0x518459||0xcc;return function(_0x120f38){if(_0x120f38){return _0x155f84[_0x8c8f('0x18')](_0x518459);}return _0x155f84[_0x8c8f('0x19')](_0x518459)[_0x8c8f('0x1a')]();};}function respondWithResult(_0x47f4c6,_0x187495){_0x187495=_0x187495||0xc8;return function(_0x2192c7){if(_0x2192c7){return _0x47f4c6[_0x8c8f('0x19')](_0x187495)[_0x8c8f('0x1b')](_0x2192c7);}};}function respondWithFilteredResult(_0x5e44b8,_0x284869){return function(_0x1f0515){if(_0x1f0515){var _0x57d887=typeof _0x284869[_0x8c8f('0x1c')]===_0x8c8f('0x1d')&&typeof _0x284869[_0x8c8f('0x1e')]===_0x8c8f('0x1d');var _0x2f227f=_0x1f0515['count'];var _0x6d472c=_0x57d887?0x0:_0x284869['offset'];var _0x45b4a5=_0x57d887?_0x1f0515['count']:_0x284869[_0x8c8f('0x1c')]+_0x284869[_0x8c8f('0x1e')];var _0x541936;if(_0x45b4a5>=_0x2f227f){_0x45b4a5=_0x2f227f;_0x541936=0xc8;}else{_0x541936=0xce;}_0x5e44b8[_0x8c8f('0x19')](_0x541936);return _0x5e44b8[_0x8c8f('0x1f')](_0x8c8f('0x20'),_0x6d472c+'-'+_0x45b4a5+'/'+_0x2f227f)['json'](_0x1f0515);}return null;};}function patchUpdates(_0x4793d4){return function(_0x54c72d){try{jsonpatch[_0x8c8f('0x21')](_0x54c72d,_0x4793d4,!![]);}catch(_0x3ebc6c){return BPromise[_0x8c8f('0x22')](_0x3ebc6c);}return _0x54c72d[_0x8c8f('0x23')]();};}function saveUpdates(_0x515253,_0x4e719d){return function(_0x121470){if(_0x121470){return _0x121470[_0x8c8f('0x24')](_0x515253)['then'](function(_0x578c26){return _0x578c26;});}return null;};}function removeEntity(_0x4c8bc9,_0x35cc9b){return function(_0x1f22ec){if(_0x1f22ec){return _0x1f22ec['destroy']()[_0x8c8f('0x25')](function(){_0x4c8bc9[_0x8c8f('0x19')](0xcc)[_0x8c8f('0x1a')]();});}};}function handleEntityNotFound(_0x49bbcc,_0x1ccd79){return function(_0x3afab7){if(!_0x3afab7){_0x49bbcc[_0x8c8f('0x18')](0x194);}return _0x3afab7;};}function handleError(_0x2119f6,_0x592395){_0x592395=_0x592395||0x1f4;return function(_0x124638){logger[_0x8c8f('0x26')](_0x124638[_0x8c8f('0x27')]);if(_0x124638[_0x8c8f('0x28')]){delete _0x124638[_0x8c8f('0x28')];}_0x2119f6[_0x8c8f('0x19')](_0x592395)[_0x8c8f('0x29')](_0x124638);};}exports['index']=function(_0x2e8527,_0x45d3cf){var _0x48d009={},_0x1b264b={},_0x34eaaf={'count':0x0,'rows':[]};var _0xf9913a=_[_0x8c8f('0x2a')](db['Attachment']['rawAttributes'],function(_0x4fe226){return{'name':_0x4fe226[_0x8c8f('0x2b')],'type':_0x4fe226[_0x8c8f('0x2c')][_0x8c8f('0x2d')]};});_0x1b264b['model']=_['map'](_0xf9913a,'name');_0x1b264b[_0x8c8f('0x2e')]=_[_0x8c8f('0x2f')](_0x2e8527[_0x8c8f('0x2e')]);_0x1b264b['filters']=_[_0x8c8f('0x30')](_0x1b264b[_0x8c8f('0x31')],_0x1b264b[_0x8c8f('0x2e')]);_0x48d009['attributes']=_['intersection'](_0x1b264b[_0x8c8f('0x31')],qs[_0x8c8f('0x32')](_0x2e8527[_0x8c8f('0x2e')]['fields']));_0x48d009[_0x8c8f('0x33')]=_0x48d009[_0x8c8f('0x33')][_0x8c8f('0x34')]?_0x48d009[_0x8c8f('0x33')]:_0x1b264b[_0x8c8f('0x31')];if(!_0x2e8527[_0x8c8f('0x2e')][_0x8c8f('0x35')](_0x8c8f('0x36'))){_0x48d009[_0x8c8f('0x1e')]=qs[_0x8c8f('0x1e')](_0x2e8527[_0x8c8f('0x2e')][_0x8c8f('0x1e')]);_0x48d009[_0x8c8f('0x1c')]=qs[_0x8c8f('0x1c')](_0x2e8527[_0x8c8f('0x2e')][_0x8c8f('0x1c')]);}_0x48d009['order']=qs['sort'](_0x2e8527[_0x8c8f('0x2e')][_0x8c8f('0x37')]);_0x48d009[_0x8c8f('0x38')]=qs['filters'](_[_0x8c8f('0x39')](_0x2e8527['query'],_0x1b264b[_0x8c8f('0x3a')]),_0xf9913a);if(_0x2e8527[_0x8c8f('0x2e')][_0x8c8f('0x3b')]){_0x48d009[_0x8c8f('0x38')]=_[_0x8c8f('0x3c')](_0x48d009[_0x8c8f('0x38')],{'$or':_['map'](_0xf9913a,function(_0x25e97f){if(_0x25e97f[_0x8c8f('0x2c')]!==_0x8c8f('0x3d')){var _0x1179e3={};_0x1179e3[_0x25e97f['name']]={'$like':'%'+_0x2e8527[_0x8c8f('0x2e')][_0x8c8f('0x3b')]+'%'};return _0x1179e3;}})});}_0x48d009=_[_0x8c8f('0x3c')]({},_0x48d009,_0x2e8527[_0x8c8f('0x3e')]);var _0x3ed4ac={'where':_0x48d009[_0x8c8f('0x38')]};return db['Attachment'][_0x8c8f('0x3f')](_0x3ed4ac)[_0x8c8f('0x25')](function(_0x3271bb){_0x34eaaf[_0x8c8f('0x3f')]=_0x3271bb;if(_0x2e8527[_0x8c8f('0x2e')][_0x8c8f('0x40')]){_0x48d009[_0x8c8f('0x41')]=[{'all':!![]}];}return db[_0x8c8f('0x42')][_0x8c8f('0x43')](_0x48d009);})[_0x8c8f('0x25')](function(_0x1e74d9){_0x34eaaf[_0x8c8f('0x44')]=_0x1e74d9;return _0x34eaaf;})[_0x8c8f('0x25')](respondWithFilteredResult(_0x45d3cf,_0x48d009))['catch'](handleError(_0x45d3cf,null));};exports[_0x8c8f('0x45')]=function(_0x312a5a,_0x10ed2a){var _0x444e14={'raw':!![],'where':{'id':_0x312a5a[_0x8c8f('0x46')]['id']}},_0x11ea86={};_0x11ea86['model']=_[_0x8c8f('0x2f')](db[_0x8c8f('0x42')]['rawAttributes']);_0x11ea86['query']=_['keys'](_0x312a5a[_0x8c8f('0x2e')]);_0x11ea86[_0x8c8f('0x3a')]=_['intersection'](_0x11ea86['model'],_0x11ea86[_0x8c8f('0x2e')]);_0x444e14[_0x8c8f('0x33')]=_[_0x8c8f('0x30')](_0x11ea86[_0x8c8f('0x31')],qs[_0x8c8f('0x32')](_0x312a5a[_0x8c8f('0x2e')][_0x8c8f('0x32')]));_0x444e14[_0x8c8f('0x33')]=_0x444e14[_0x8c8f('0x33')][_0x8c8f('0x34')]?_0x444e14['attributes']:_0x11ea86['model'];if(_0x312a5a[_0x8c8f('0x2e')]['includeAll']){_0x444e14['include']=[{'all':!![]}];}_0x444e14=_[_0x8c8f('0x3c')]({},_0x444e14,_0x312a5a['options']);return db['Attachment']['find'](_0x444e14)[_0x8c8f('0x25')](handleEntityNotFound(_0x10ed2a,null))[_0x8c8f('0x25')](respondWithResult(_0x10ed2a,null))[_0x8c8f('0x47')](handleError(_0x10ed2a,null));};exports[_0x8c8f('0x48')]=function(_0x4aa69f,_0x19479d){var _0xab9c0d={'where':{'id':_0x4aa69f['params']['id']}},_0x3f2e5b={};_0x3f2e5b['model']=_[_0x8c8f('0x2f')](db[_0x8c8f('0x42')][_0x8c8f('0x49')]);_0xab9c0d[_0x8c8f('0x33')]=_[_0x8c8f('0x30')](_0x3f2e5b[_0x8c8f('0x31')],qs[_0x8c8f('0x32')](_0x4aa69f[_0x8c8f('0x2e')]['fields']));_0xab9c0d[_0x8c8f('0x33')]=_0xab9c0d[_0x8c8f('0x33')][_0x8c8f('0x34')]?_0xab9c0d[_0x8c8f('0x33')]:_0x3f2e5b[_0x8c8f('0x31')];if(_0x4aa69f['query'][_0x8c8f('0x40')]){_0xab9c0d[_0x8c8f('0x41')]=[{'all':!![]}];}_0xab9c0d=_[_0x8c8f('0x3c')]({},_0xab9c0d,_0x4aa69f[_0x8c8f('0x3e')]);return db[_0x8c8f('0x42')][_0x8c8f('0x4a')](_0xab9c0d)['then'](handleEntityNotFound(_0x19479d,null))[_0x8c8f('0x25')](function(_0x249927){if(_0x249927){var _0x4c1184=_0x249927[_0x8c8f('0x4b')]({'plain':!![]});_0x4c1184=qs['omit'](_0x4c1184,['id',_0x8c8f('0x4c'),_0x8c8f('0x4d')]);_0x4aa69f[_0x8c8f('0x4e')]=_['omit'](_0x4aa69f[_0x8c8f('0x4e')],['id',_0x8c8f('0x4c'),'updatedAt']);return db[_0x8c8f('0x42')][_0x8c8f('0x4f')](_[_0x8c8f('0x3c')](_0x4c1184,_0x4aa69f[_0x8c8f('0x4e')]),{'include':_0x4aa69f[_0x8c8f('0x2e')]['includeAll']?[{'all':!![]}]:undefined});}})[_0x8c8f('0x25')](respondWithResult(_0x19479d,0xc9))[_0x8c8f('0x47')](handleError(_0x19479d,null));};exports[_0x8c8f('0x24')]=function(_0x2b39b4,_0x5614ef){if(_0x2b39b4[_0x8c8f('0x4e')]['id']){delete _0x2b39b4[_0x8c8f('0x4e')]['id'];}return db[_0x8c8f('0x42')][_0x8c8f('0x4a')]({'where':{'id':_0x2b39b4[_0x8c8f('0x46')]['id']}})[_0x8c8f('0x25')](handleEntityNotFound(_0x5614ef,null))[_0x8c8f('0x25')](saveUpdates(_0x2b39b4[_0x8c8f('0x4e')],null))['then'](respondWithResult(_0x5614ef,null))[_0x8c8f('0x47')](handleError(_0x5614ef,null));};exports['destroy']=function(_0x431a7d,_0x668925){return db[_0x8c8f('0x42')]['find']({'where':{'id':_0x431a7d[_0x8c8f('0x46')]['id']}})['then'](handleEntityNotFound(_0x668925,null))[_0x8c8f('0x25')](removeEntity(_0x668925,null))[_0x8c8f('0x47')](handleError(_0x668925,null));};exports[_0x8c8f('0x4f')]=function(_0xe9ee7d,_0x3b73ae,_0x1f5647){_0xe9ee7d[_0x8c8f('0x4e')][_0x8c8f('0x28')]=_0xe9ee7d[_0x8c8f('0x50')][_0x8c8f('0x51')];_0xe9ee7d['body'][_0x8c8f('0x52')]=_0xe9ee7d[_0x8c8f('0x50')][_0x8c8f('0x53')];_0xe9ee7d[_0x8c8f('0x4e')][_0x8c8f('0x2c')]=_0xe9ee7d[_0x8c8f('0x50')][_0x8c8f('0x54')];return db[_0x8c8f('0x42')][_0x8c8f('0x4f')](_0xe9ee7d[_0x8c8f('0x4e')])[_0x8c8f('0x25')](respondWithResult(_0x3b73ae,0xc9))[_0x8c8f('0x47')](handleError(_0x3b73ae,null));};exports[_0x8c8f('0x55')]=function(_0x2ef680,_0x598f33,_0x5f545a){return db[_0x8c8f('0x42')][_0x8c8f('0x56')]({'where':{'id':_0x2ef680[_0x8c8f('0x46')]['id']},'raw':!![]})['then'](handleEntityNotFound(_0x598f33,null))[_0x8c8f('0x25')](function(_0x1296f7){if(_0x1296f7){var _0x3f7622=_0x1296f7[_0x8c8f('0x57')]!==null;var _0x126d6d=path[_0x8c8f('0x58')](config[_0x8c8f('0x59')],_0x8c8f('0x5a'));if(_0x3f7622){_0x126d6d=path[_0x8c8f('0x58')](_0x126d6d,_0x8c8f('0x5b'));}var _0xc46de1=path[_0x8c8f('0x58')](_0x126d6d,_0x1296f7[_0x8c8f('0x52')]);return _0x598f33['download'](_0xc46de1);}})[_0x8c8f('0x47')](handleError(_0x598f33,null));}; \ No newline at end of file +var _0x3330=['crypto','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','destroy','then','end','error','stack','name','send','rawAttributes','fieldName','key','model','query','keys','filters','intersection','attributes','fields','hasOwnProperty','order','sort','pick','where','merge','map','VIRTUAL','options','includeAll','include','rows','show','params','Attachment','length','find','catch','clone','omit','createdAt','updatedAt','body','create','file','originalname','filename','mimetype','findOne','ChatOfflineMessageId','join','server/files/attachments/','offline-chat/','basename','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','sox','to-csv','ejs','lodash','squel'];(function(_0x3b5250,_0x7a0b2c){var _0xc844a1=function(_0x2fbc98){while(--_0x2fbc98){_0x3b5250['push'](_0x3b5250['shift']());}};_0xc844a1(++_0x7a0b2c);}(_0x3330,0x15e));var _0x0333=function(_0x37bd26,_0x5ad346){_0x37bd26=_0x37bd26-0x0;var _0xe83dc4=_0x3330[_0x37bd26];return _0xe83dc4;};'use strict';var emlformat=require(_0x0333('0x0'));var rimraf=require(_0x0333('0x1'));var zipdir=require(_0x0333('0x2'));var jsonpatch=require(_0x0333('0x3'));var rp=require(_0x0333('0x4'));var moment=require(_0x0333('0x5'));var BPromise=require(_0x0333('0x6'));var Mustache=require(_0x0333('0x7'));var util=require(_0x0333('0x8'));var path=require('path');var sox=require(_0x0333('0x9'));var csv=require(_0x0333('0xa'));var ejs=require(_0x0333('0xb'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x0333('0xc'));var squel=require(_0x0333('0xd'));var crypto=require(_0x0333('0xe'));var jsforce=require(_0x0333('0xf'));var deskjs=require(_0x0333('0x10'));var toCsv=require(_0x0333('0xa'));var querystring=require(_0x0333('0x11'));var Papa=require(_0x0333('0x12'));var Redis=require('ioredis');var authService=require(_0x0333('0x13'));var qs=require(_0x0333('0x14'));var as=require(_0x0333('0x15'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x0333('0x16'))(_0x0333('0x17'));var utils=require(_0x0333('0x18'));var config=require('../../config/environment');var licenseUtil=require(_0x0333('0x19'));var db=require(_0x0333('0x1a'))['db'];function respondWithStatusCode(_0x96ce4e,_0x475403){_0x475403=_0x475403||0xcc;return function(_0x96d72c){if(_0x96d72c){return _0x96ce4e[_0x0333('0x1b')](_0x475403);}return _0x96ce4e[_0x0333('0x1c')](_0x475403)['end']();};}function respondWithResult(_0xd964fc,_0x4ed6e5){_0x4ed6e5=_0x4ed6e5||0xc8;return function(_0x5f594b){if(_0x5f594b){return _0xd964fc[_0x0333('0x1c')](_0x4ed6e5)[_0x0333('0x1d')](_0x5f594b);}};}function respondWithFilteredResult(_0x2843ef,_0x40891b){return function(_0x37b7e5){if(_0x37b7e5){var _0x40d37f=typeof _0x40891b[_0x0333('0x1e')]===_0x0333('0x1f')&&typeof _0x40891b[_0x0333('0x20')]===_0x0333('0x1f');var _0x20cac7=_0x37b7e5[_0x0333('0x21')];var _0x3a960d=_0x40d37f?0x0:_0x40891b[_0x0333('0x1e')];var _0x146ce1=_0x40d37f?_0x37b7e5[_0x0333('0x21')]:_0x40891b[_0x0333('0x1e')]+_0x40891b[_0x0333('0x20')];var _0x24dba8;if(_0x146ce1>=_0x20cac7){_0x146ce1=_0x20cac7;_0x24dba8=0xc8;}else{_0x24dba8=0xce;}_0x2843ef[_0x0333('0x1c')](_0x24dba8);return _0x2843ef[_0x0333('0x22')](_0x0333('0x23'),_0x3a960d+'-'+_0x146ce1+'/'+_0x20cac7)['json'](_0x37b7e5);}return null;};}function patchUpdates(_0x4272f6){return function(_0x377d12){try{jsonpatch[_0x0333('0x24')](_0x377d12,_0x4272f6,!![]);}catch(_0x5060f6){return BPromise[_0x0333('0x25')](_0x5060f6);}return _0x377d12[_0x0333('0x26')]();};}function saveUpdates(_0x266e36,_0x5eb746){return function(_0x3bd106){if(_0x3bd106){return _0x3bd106[_0x0333('0x27')](_0x266e36)['then'](function(_0x29e5e4){return _0x29e5e4;});}return null;};}function removeEntity(_0x14b5d0,_0x46e6d4){return function(_0x523d69){if(_0x523d69){return _0x523d69[_0x0333('0x28')]()[_0x0333('0x29')](function(){_0x14b5d0[_0x0333('0x1c')](0xcc)[_0x0333('0x2a')]();});}};}function handleEntityNotFound(_0x30620e,_0xce99ed){return function(_0x237092){if(!_0x237092){_0x30620e[_0x0333('0x1b')](0x194);}return _0x237092;};}function handleError(_0x8d3733,_0x24a01e){_0x24a01e=_0x24a01e||0x1f4;return function(_0x362ade){logger[_0x0333('0x2b')](_0x362ade[_0x0333('0x2c')]);if(_0x362ade[_0x0333('0x2d')]){delete _0x362ade[_0x0333('0x2d')];}_0x8d3733['status'](_0x24a01e)[_0x0333('0x2e')](_0x362ade);};}exports['index']=function(_0x1d88e2,_0x38e81a){var _0x30d2be={},_0x3e1edc={},_0x50c2ce={'count':0x0,'rows':[]};var _0x39883d=_['map'](db['Attachment'][_0x0333('0x2f')],function(_0x21de6d){return{'name':_0x21de6d[_0x0333('0x30')],'type':_0x21de6d['type'][_0x0333('0x31')]};});_0x3e1edc[_0x0333('0x32')]=_['map'](_0x39883d,'name');_0x3e1edc[_0x0333('0x33')]=_[_0x0333('0x34')](_0x1d88e2[_0x0333('0x33')]);_0x3e1edc[_0x0333('0x35')]=_[_0x0333('0x36')](_0x3e1edc[_0x0333('0x32')],_0x3e1edc['query']);_0x30d2be[_0x0333('0x37')]=_[_0x0333('0x36')](_0x3e1edc[_0x0333('0x32')],qs[_0x0333('0x38')](_0x1d88e2[_0x0333('0x33')][_0x0333('0x38')]));_0x30d2be[_0x0333('0x37')]=_0x30d2be[_0x0333('0x37')]['length']?_0x30d2be['attributes']:_0x3e1edc[_0x0333('0x32')];if(!_0x1d88e2[_0x0333('0x33')][_0x0333('0x39')]('nolimit')){_0x30d2be['limit']=qs['limit'](_0x1d88e2[_0x0333('0x33')]['limit']);_0x30d2be[_0x0333('0x1e')]=qs[_0x0333('0x1e')](_0x1d88e2[_0x0333('0x33')]['offset']);}_0x30d2be[_0x0333('0x3a')]=qs[_0x0333('0x3b')](_0x1d88e2[_0x0333('0x33')][_0x0333('0x3b')]);_0x30d2be['where']=qs[_0x0333('0x35')](_[_0x0333('0x3c')](_0x1d88e2[_0x0333('0x33')],_0x3e1edc[_0x0333('0x35')]),_0x39883d);if(_0x1d88e2[_0x0333('0x33')]['filter']){_0x30d2be[_0x0333('0x3d')]=_[_0x0333('0x3e')](_0x30d2be[_0x0333('0x3d')],{'$or':_[_0x0333('0x3f')](_0x39883d,function(_0x3dc779){if(_0x3dc779['type']!==_0x0333('0x40')){var _0x3b7070={};_0x3b7070[_0x3dc779['name']]={'$like':'%'+_0x1d88e2['query']['filter']+'%'};return _0x3b7070;}})});}_0x30d2be=_['merge']({},_0x30d2be,_0x1d88e2[_0x0333('0x41')]);var _0x22e549={'where':_0x30d2be['where']};return db['Attachment'][_0x0333('0x21')](_0x22e549)['then'](function(_0x263d42){_0x50c2ce[_0x0333('0x21')]=_0x263d42;if(_0x1d88e2['query'][_0x0333('0x42')]){_0x30d2be[_0x0333('0x43')]=[{'all':!![]}];}return db['Attachment']['findAll'](_0x30d2be);})[_0x0333('0x29')](function(_0x3fb479){_0x50c2ce[_0x0333('0x44')]=_0x3fb479;return _0x50c2ce;})[_0x0333('0x29')](respondWithFilteredResult(_0x38e81a,_0x30d2be))['catch'](handleError(_0x38e81a,null));};exports[_0x0333('0x45')]=function(_0x45a5bc,_0x135ce8){var _0x2b4df9={'raw':!![],'where':{'id':_0x45a5bc[_0x0333('0x46')]['id']}},_0x5b58f8={};_0x5b58f8[_0x0333('0x32')]=_[_0x0333('0x34')](db[_0x0333('0x47')]['rawAttributes']);_0x5b58f8[_0x0333('0x33')]=_[_0x0333('0x34')](_0x45a5bc[_0x0333('0x33')]);_0x5b58f8[_0x0333('0x35')]=_[_0x0333('0x36')](_0x5b58f8[_0x0333('0x32')],_0x5b58f8[_0x0333('0x33')]);_0x2b4df9[_0x0333('0x37')]=_[_0x0333('0x36')](_0x5b58f8[_0x0333('0x32')],qs[_0x0333('0x38')](_0x45a5bc[_0x0333('0x33')]['fields']));_0x2b4df9['attributes']=_0x2b4df9['attributes'][_0x0333('0x48')]?_0x2b4df9[_0x0333('0x37')]:_0x5b58f8[_0x0333('0x32')];if(_0x45a5bc['query'][_0x0333('0x42')]){_0x2b4df9['include']=[{'all':!![]}];}_0x2b4df9=_[_0x0333('0x3e')]({},_0x2b4df9,_0x45a5bc[_0x0333('0x41')]);return db[_0x0333('0x47')][_0x0333('0x49')](_0x2b4df9)[_0x0333('0x29')](handleEntityNotFound(_0x135ce8,null))[_0x0333('0x29')](respondWithResult(_0x135ce8,null))[_0x0333('0x4a')](handleError(_0x135ce8,null));};exports[_0x0333('0x4b')]=function(_0x11f436,_0x3a6a6e){var _0x16e370={'where':{'id':_0x11f436[_0x0333('0x46')]['id']}},_0x35a956={};_0x35a956[_0x0333('0x32')]=_[_0x0333('0x34')](db[_0x0333('0x47')][_0x0333('0x2f')]);_0x16e370[_0x0333('0x37')]=_[_0x0333('0x36')](_0x35a956[_0x0333('0x32')],qs['fields'](_0x11f436[_0x0333('0x33')]['fields']));_0x16e370[_0x0333('0x37')]=_0x16e370[_0x0333('0x37')]['length']?_0x16e370['attributes']:_0x35a956[_0x0333('0x32')];if(_0x11f436[_0x0333('0x33')][_0x0333('0x42')]){_0x16e370['include']=[{'all':!![]}];}_0x16e370=_[_0x0333('0x3e')]({},_0x16e370,_0x11f436[_0x0333('0x41')]);return db[_0x0333('0x47')]['find'](_0x16e370)[_0x0333('0x29')](handleEntityNotFound(_0x3a6a6e,null))['then'](function(_0x532fbe){if(_0x532fbe){var _0x2d9782=_0x532fbe['get']({'plain':!![]});_0x2d9782=qs[_0x0333('0x4c')](_0x2d9782,['id',_0x0333('0x4d'),_0x0333('0x4e')]);_0x11f436[_0x0333('0x4f')]=_[_0x0333('0x4c')](_0x11f436[_0x0333('0x4f')],['id','createdAt',_0x0333('0x4e')]);return db[_0x0333('0x47')][_0x0333('0x50')](_[_0x0333('0x3e')](_0x2d9782,_0x11f436[_0x0333('0x4f')]),{'include':_0x11f436[_0x0333('0x33')][_0x0333('0x42')]?[{'all':!![]}]:undefined});}})[_0x0333('0x29')](respondWithResult(_0x3a6a6e,0xc9))['catch'](handleError(_0x3a6a6e,null));};exports['update']=function(_0x4d696e,_0x47c3a4){if(_0x4d696e['body']['id']){delete _0x4d696e['body']['id'];}return db['Attachment'][_0x0333('0x49')]({'where':{'id':_0x4d696e['params']['id']}})[_0x0333('0x29')](handleEntityNotFound(_0x47c3a4,null))['then'](saveUpdates(_0x4d696e[_0x0333('0x4f')],null))[_0x0333('0x29')](respondWithResult(_0x47c3a4,null))[_0x0333('0x4a')](handleError(_0x47c3a4,null));};exports[_0x0333('0x28')]=function(_0x200d62,_0x4692dd){return db[_0x0333('0x47')][_0x0333('0x49')]({'where':{'id':_0x200d62[_0x0333('0x46')]['id']}})[_0x0333('0x29')](handleEntityNotFound(_0x4692dd,null))[_0x0333('0x29')](removeEntity(_0x4692dd,null))[_0x0333('0x4a')](handleError(_0x4692dd,null));};exports[_0x0333('0x50')]=function(_0x4a03f3,_0x379f67,_0x17428b){_0x4a03f3[_0x0333('0x4f')]['name']=_0x4a03f3[_0x0333('0x51')][_0x0333('0x52')];_0x4a03f3[_0x0333('0x4f')]['basename']=_0x4a03f3['file'][_0x0333('0x53')];_0x4a03f3[_0x0333('0x4f')]['type']=_0x4a03f3['file'][_0x0333('0x54')];return db['Attachment'][_0x0333('0x50')](_0x4a03f3['body'])[_0x0333('0x29')](respondWithResult(_0x379f67,0xc9))[_0x0333('0x4a')](handleError(_0x379f67,null));};exports['download']=function(_0x213b59,_0xbd8564,_0x3ee526){return db['Attachment'][_0x0333('0x55')]({'where':{'id':_0x213b59[_0x0333('0x46')]['id']},'raw':!![]})[_0x0333('0x29')](handleEntityNotFound(_0xbd8564,null))[_0x0333('0x29')](function(_0x103d1c){if(_0x103d1c){var _0x35782b=_0x103d1c[_0x0333('0x56')]!==null;var _0x5c7b35=path[_0x0333('0x57')](config['root'],_0x0333('0x58'));if(_0x35782b){_0x5c7b35=path[_0x0333('0x57')](_0x5c7b35,_0x0333('0x59'));}var _0x505769=path[_0x0333('0x57')](_0x5c7b35,_0x103d1c[_0x0333('0x5a')]);return _0xbd8564['download'](_0x505769);}})[_0x0333('0x4a')](handleError(_0xbd8564,null));}; \ No newline at end of file diff --git a/server/api/attachment/attachment.model.js b/server/api/attachment/attachment.model.js index ef9b729..bef3d79 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 _0x52f6=['Attachment','util','api','moment','bluebird','request-promise','path','./attachment.attributes'];(function(_0x337d38,_0x5cb203){var _0x502d8b=function(_0x24247c){while(--_0x24247c){_0x337d38['push'](_0x337d38['shift']());}};_0x502d8b(++_0x5cb203);}(_0x52f6,0x81));var _0x652f=function(_0x4704fc,_0x1f93c8){_0x4704fc=_0x4704fc-0x0;var _0x316e4b=_0x52f6[_0x4704fc];return _0x316e4b;};'use strict';var _=require('lodash');var util=require(_0x652f('0x0'));var logger=require('../../config/logger')(_0x652f('0x1'));var moment=require(_0x652f('0x2'));var BPromise=require(_0x652f('0x3'));var rp=require(_0x652f('0x4'));var fs=require('fs');var path=require(_0x652f('0x5'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0x652f('0x6'));module['exports']=function(_0x3fe9e8,_0x4815fb){return _0x3fe9e8['define'](_0x652f('0x7'),attributes,{'tableName':'attachments','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x02eb=['lodash','util','../../config/logger','api','bluebird','request-promise','rimraf','exports','define','attachments'];(function(_0x5c12d9,_0x441d5f){var _0x47acaf=function(_0x177f26){while(--_0x177f26){_0x5c12d9['push'](_0x5c12d9['shift']());}};_0x47acaf(++_0x441d5f);}(_0x02eb,0x10e));var _0xb02e=function(_0x27d8ef,_0x221f86){_0x27d8ef=_0x27d8ef-0x0;var _0x2da5a5=_0x02eb[_0x27d8ef];return _0x2da5a5;};'use strict';var _=require(_0xb02e('0x0'));var util=require(_0xb02e('0x1'));var logger=require(_0xb02e('0x2'))(_0xb02e('0x3'));var moment=require('moment');var BPromise=require(_0xb02e('0x4'));var rp=require(_0xb02e('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0xb02e('0x6'));var config=require('../../config/environment');var attributes=require('./attachment.attributes');module[_0xb02e('0x7')]=function(_0x3510cd,_0xe56dbc){return _0x3510cd[_0xb02e('0x8')]('Attachment',attributes,{'tableName':_0xb02e('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/attachment/attachment.rpc.js b/server/api/attachment/attachment.rpc.js index e74279b..bfd8205 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 _0x136c=['message','catch','CreateAttachment','Attachment','body','options','raw','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','info','Attachment,\x20%s,\x20%s','request\x20sent','debug','Attachment,\x20%s,\x20%s,\x20%s','stringify','error'];(function(_0x298d89,_0x3c2d9c){var _0x5b1861=function(_0xb85cd9){while(--_0xb85cd9){_0x298d89['push'](_0x298d89['shift']());}};_0x5b1861(++_0x3c2d9c);}(_0x136c,0x1d2));var _0xc136=function(_0x3612eb,_0x4d1079){_0x3612eb=_0x3612eb-0x0;var _0x341b04=_0x136c[_0x3612eb];return _0x341b04;};'use strict';var _=require(_0xc136('0x0'));var util=require(_0xc136('0x1'));var moment=require('moment');var BPromise=require(_0xc136('0x2'));var rs=require(_0xc136('0x3'));var fs=require('fs');var Redis=require(_0xc136('0x4'));var db=require(_0xc136('0x5'))['db'];var utils=require(_0xc136('0x6'));var logger=require(_0xc136('0x7'))(_0xc136('0x8'));var config=require(_0xc136('0x9'));var jayson=require(_0xc136('0xa'));var client=jayson['client'][_0xc136('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x594112,_0x361a52,_0x3993f2){return new BPromise(function(_0x1804c1,_0x500376){return client[_0xc136('0xc')](_0x594112,_0x3993f2)['then'](function(_0x1ea07d){logger[_0xc136('0xd')](_0xc136('0xe'),_0x361a52,_0xc136('0xf'));logger[_0xc136('0x10')](_0xc136('0x11'),_0x361a52,_0xc136('0xf'),JSON[_0xc136('0x12')](_0x1ea07d));if(_0x1ea07d[_0xc136('0x13')]){if(_0x1ea07d['error']['code']===0x1f4){logger[_0xc136('0x13')]('Attachment,\x20%s,\x20%s',_0x361a52,_0x1ea07d[_0xc136('0x13')][_0xc136('0x14')]);return _0x500376(_0x1ea07d[_0xc136('0x13')]['message']);}logger['error'](_0xc136('0xe'),_0x361a52,_0x1ea07d[_0xc136('0x13')][_0xc136('0x14')]);return _0x1804c1(_0x1ea07d['error']['message']);}else{logger[_0xc136('0xd')](_0xc136('0xe'),_0x361a52,'request\x20sent');_0x1804c1(_0x1ea07d['result']['message']);}})[_0xc136('0x15')](function(_0x3daf55){logger[_0xc136('0x13')](_0xc136('0xe'),_0x361a52,_0x3daf55);_0x500376(_0x3daf55);});});}exports[_0xc136('0x16')]=function(_0x1ccf5f){var _0x59503b=this;return new Promise(function(_0x5df9b7,_0x4d56cb){return db[_0xc136('0x17')]['create'](_0x1ccf5f[_0xc136('0x18')],{'raw':_0x1ccf5f[_0xc136('0x19')]?_0x1ccf5f[_0xc136('0x19')][_0xc136('0x1a')]===undefined?!![]:![]:!![]})['then'](function(_0x2b8527){logger[_0xc136('0xd')]('CreateAttachment',_0x1ccf5f);logger[_0xc136('0x10')]('CreateAttachment',_0x1ccf5f,JSON['stringify'](_0x2b8527));_0x5df9b7(_0x2b8527);})[_0xc136('0x15')](function(_0x1a350a){logger['error'](_0xc136('0x16'),_0x1a350a[_0xc136('0x14')],_0x1ccf5f);_0x4d56cb(_0x59503b[_0xc136('0x13')](0x1f4,_0x1a350a[_0xc136('0x14')]));});});}; \ No newline at end of file +var _0xf72b=['ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','request','Attachment,\x20%s,\x20%s','request\x20sent','Attachment,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result','CreateAttachment','Attachment','create','body','options','raw','debug','catch','lodash','moment','randomstring'];(function(_0x56916d,_0x37b935){var _0x2b7f1f=function(_0x206eb1){while(--_0x206eb1){_0x56916d['push'](_0x56916d['shift']());}};_0x2b7f1f(++_0x37b935);}(_0xf72b,0x1d9));var _0xbf72=function(_0x5d12d,_0x5f1cc9){_0x5d12d=_0x5d12d-0x0;var _0x3f39eb=_0xf72b[_0x5d12d];return _0x3f39eb;};'use strict';var _=require(_0xbf72('0x0'));var util=require('util');var moment=require(_0xbf72('0x1'));var BPromise=require('bluebird');var rs=require(_0xbf72('0x2'));var fs=require('fs');var Redis=require(_0xbf72('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0xbf72('0x4'));var logger=require(_0xbf72('0x5'))(_0xbf72('0x6'));var config=require(_0xbf72('0x7'));var jayson=require(_0xbf72('0x8'));var client=jayson[_0xbf72('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x41c11d,_0xc0842b,_0x119807){return new BPromise(function(_0xd0402c,_0xdd6177){return client[_0xbf72('0xa')](_0x41c11d,_0x119807)['then'](function(_0x455891){logger['info'](_0xbf72('0xb'),_0xc0842b,_0xbf72('0xc'));logger['debug'](_0xbf72('0xd'),_0xc0842b,_0xbf72('0xc'),JSON[_0xbf72('0xe')](_0x455891));if(_0x455891[_0xbf72('0xf')]){if(_0x455891[_0xbf72('0xf')][_0xbf72('0x10')]===0x1f4){logger[_0xbf72('0xf')](_0xbf72('0xb'),_0xc0842b,_0x455891['error'][_0xbf72('0x11')]);return _0xdd6177(_0x455891[_0xbf72('0xf')][_0xbf72('0x11')]);}logger['error'](_0xbf72('0xb'),_0xc0842b,_0x455891['error']['message']);return _0xd0402c(_0x455891['error'][_0xbf72('0x11')]);}else{logger[_0xbf72('0x12')](_0xbf72('0xb'),_0xc0842b,_0xbf72('0xc'));_0xd0402c(_0x455891[_0xbf72('0x13')][_0xbf72('0x11')]);}})['catch'](function(_0x266ce2){logger[_0xbf72('0xf')](_0xbf72('0xb'),_0xc0842b,_0x266ce2);_0xdd6177(_0x266ce2);});});}exports[_0xbf72('0x14')]=function(_0x27dadc){var _0x5b5fc9=this;return new Promise(function(_0x51d4c9,_0x1b8d73){return db[_0xbf72('0x15')][_0xbf72('0x16')](_0x27dadc[_0xbf72('0x17')],{'raw':_0x27dadc[_0xbf72('0x18')]?_0x27dadc[_0xbf72('0x18')][_0xbf72('0x19')]===undefined?!![]:![]:!![]})['then'](function(_0x2aecae){logger[_0xbf72('0x12')](_0xbf72('0x14'),_0x27dadc);logger[_0xbf72('0x1a')](_0xbf72('0x14'),_0x27dadc,JSON['stringify'](_0x2aecae));_0x51d4c9(_0x2aecae);})[_0xbf72('0x1b')](function(_0x1de926){logger['error'](_0xbf72('0x14'),_0x1de926[_0xbf72('0x11')],_0x27dadc);_0x1b8d73(_0x5b5fc9[_0xbf72('0xf')](0x1f4,_0x1de926['message']));});});}; \ No newline at end of file diff --git a/server/api/attachment/index.js b/server/api/attachment/index.js index d94d6ef..403362c 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(_0x50d3d9,_0x28334b){var _0x4d859f=function(_0x27b9f3){while(--_0x27b9f3){_0x50d3d9['push'](_0x50d3d9['shift']());}};_0x4d859f(++_0x28334b);}(_0xadb5,0xad));var _0x5adb=function(_0x3bddf4,_0x216ace){_0x3bddf4=_0x3bddf4-0x0;var _0xe1dc58=_0xadb5[_0x3bddf4];return _0xe1dc58;};'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 _0xb10b=['originalname','replace','single','file','create','put','/:id','update','destroy','exports','multer','path','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./attachment.controller','get','index','isAuthenticated','show','/:id/download','download','post','/:id/clone','diskStorage','join','server/files/attachments/','format','%s-%s'];(function(_0x34fdb7,_0x56d785){var _0x4646e1=function(_0x5f5ce8){while(--_0x5f5ce8){_0x34fdb7['push'](_0x34fdb7['shift']());}};_0x4646e1(++_0x56d785);}(_0xb10b,0x12a));var _0xbb10=function(_0x231dda,_0x5b04cc){_0x231dda=_0x231dda-0x0;var _0x3f88cb=_0xb10b[_0x231dda];return _0x3f88cb;};'use strict';var multer=require(_0xbb10('0x0'));var util=require('util');var path=require(_0xbb10('0x1'));var timeout=require(_0xbb10('0x2'));var express=require(_0xbb10('0x3'));var router=express['Router']();var fs_extra=require(_0xbb10('0x4'));var auth=require(_0xbb10('0x5'));var interaction=require(_0xbb10('0x6'));var config=require(_0xbb10('0x7'));var controller=require(_0xbb10('0x8'));router[_0xbb10('0x9')]('/',auth['isAuthenticated'](),controller[_0xbb10('0xa')]);router[_0xbb10('0x9')]('/:id',auth[_0xbb10('0xb')](),controller[_0xbb10('0xc')]);router[_0xbb10('0x9')](_0xbb10('0xd'),auth[_0xbb10('0xb')](),controller[_0xbb10('0xe')]);router[_0xbb10('0xf')](_0xbb10('0x10'),auth['isAuthenticated'](),controller['clone']);var upload=multer({'storage':multer[_0xbb10('0x11')]({'destination':function(_0x118a74,_0xce64f3,_0x5e136d){_0x5e136d(null,path[_0xbb10('0x12')](config['root'],_0xbb10('0x13')));},'filename':function(_0x916a32,_0x285009,_0x193a27){_0x193a27(null,util[_0xbb10('0x14')](_0xbb10('0x15'),Date['now'](),_0x285009[_0xbb10('0x16')][_0xbb10('0x17')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-')));}})});router[_0xbb10('0xf')]('/',upload[_0xbb10('0x18')](_0xbb10('0x19')),controller[_0xbb10('0x1a')]);router[_0xbb10('0x1b')](_0xbb10('0x1c'),auth[_0xbb10('0xb')](),controller[_0xbb10('0x1d')]);router['delete'](_0xbb10('0x1c'),auth[_0xbb10('0xb')](),controller[_0xbb10('0x1e')]);module[_0xbb10('0x1f')]=router; \ No newline at end of file diff --git a/server/api/authActiveDirectory/authActiveDirectory.controller.js b/server/api/authActiveDirectory/authActiveDirectory.controller.js index 216e9da..de93545 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 _0x1224=['baseDN','url','domain','authenticate','error','Error\x20authenticate\x20%s:\x20%s','inspect','Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.','Error\x20authenticate\x20%s:\x20Wrong\x20credentials','Setting','adSsoEnabled','blockDuration','then','Error\x20authenticate\x20%s:\x20Active\x20Directory\x20not\x20enabled','password','salt','role','disabled','blocked','blockedAt','online','admin','agent','name','add','minutes','clearBlockUser','getLicense','send','login','ad-login','Something\x20went\x20wrong,\x20please\x20try\x20again.','signToken','use','passport','passport-local','Strategy','moment','activedirectory2','bluebird','../../mysqldb','../../components/auth/service','../../config/utils','../../config/logger','api','activedirectory','undefined'];(function(_0x54db5e,_0x34b433){var _0x48e565=function(_0x342849){while(--_0x342849){_0x54db5e['push'](_0x54db5e['shift']());}};_0x48e565(++_0x34b433);}(_0x1224,0x10d));var _0x4122=function(_0x52db3f,_0x37ab5f){_0x52db3f=_0x52db3f-0x0;var _0x41b731=_0x1224[_0x52db3f];return _0x41b731;};'use strict';var passport=require(_0x4122('0x0'));var LocalStrategy=require(_0x4122('0x1'))[_0x4122('0x2')];var moment=require(_0x4122('0x3'));var ActiveDirectory=require(_0x4122('0x4'));var BPromise=require(_0x4122('0x5'));var util=require('util');var db=require(_0x4122('0x6'))['db'];var authService=require(_0x4122('0x7'));var utils=require(_0x4122('0x8'));var config=require('../../config/environment');var logger=require(_0x4122('0x9'))(_0x4122('0xa'));function isActiveDirectoryConfigured(_0xc6dfaf){var _0x40b5e4=![];if(typeof _0xc6dfaf[_0x4122('0xb')]!==_0x4122('0xc')){_0x40b5e4=_0xc6dfaf[_0x4122('0xb')][_0x4122('0xd')]&&_0xc6dfaf[_0x4122('0xb')][_0x4122('0xe')]&&_0xc6dfaf[_0x4122('0xb')][_0x4122('0xf')];}return _0x40b5e4;}function adAuthenticate(_0x251ade,_0x35160c,_0x1d229f){return new BPromise(function(_0x201538,_0x1c22f7){try{var _0x2d3fa6=new ActiveDirectory(_0x251ade);_0x2d3fa6[_0x4122('0x10')](_0x35160c,_0x1d229f,function(_0x955280,_0x12dc57){if(_0x955280){logger[_0x4122('0x11')](_0x4122('0x12'),_0x35160c,util[_0x4122('0x13')](_0x955280,{'showHidden':![],'depth':null}));_0x1c22f7(_0x4122('0x14'));}else if(!_0x12dc57){logger[_0x4122('0x11')](_0x4122('0x15'),_0x35160c);_0x1c22f7(_0x4122('0x14'));}else{_0x201538(_0x12dc57);}});}catch(_0x421ee3){_0x1c22f7(_0x421ee3);}});}function ActiveDirectoryAuthenticate(_0x1a701e,_0x3a88fe,_0x47ae9b,_0x4761a0){var _0x3c674e,_0x192e77;if(!isActiveDirectoryConfigured(config)){logger[_0x4122('0x11')]('Error\x20authenticate\x20%s:\x20Active\x20Directory\x20not\x20configured',_0x3a88fe);return _0x4761a0(null,![],{'message':_0x4122('0x14')});}return db[_0x4122('0x16')]['findOne']({'where':{'id':0x1},'attributes':[_0x4122('0x17'),_0x4122('0x18')],'raw':!![]})[_0x4122('0x19')](function(_0x4636ae){_0x3c674e=_0x4636ae;if(!_0x3c674e[_0x4122('0x17')]){logger[_0x4122('0x11')](_0x4122('0x1a'),_0x3a88fe);throw new Error('Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.');}return _0x1a701e['findOne']({'attributes':['id','name',_0x4122('0x1b'),_0x4122('0x1c'),_0x4122('0x1d'),_0x4122('0x1e'),_0x4122('0x1f'),_0x4122('0x20'),_0x4122('0x21')],'where':{'name':_0x3a88fe,'role':{'$or':[_0x4122('0x22'),'user',_0x4122('0x23')]},'adSsoEnabled':!![]}});})['then'](function(_0x4f949a){if(!_0x4f949a||_0x4f949a&&_0x4f949a['name']!==_0x3a88fe){throw new Error(_0x4122('0x14'));}_0x192e77=_0x4f949a;var _0x13a08c=_0x192e77[_0x4122('0x24')]+'@'+config['activedirectory'][_0x4122('0xf')];return adAuthenticate(config[_0x4122('0xb')],_0x13a08c,_0x47ae9b);})['then'](function(_0x4a5711){if(_0x192e77[_0x4122('0x1e')]){throw new Error('Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.');}if(_0x3c674e['blockDuration']>0x0){if(_0x192e77['blocked']){if(moment(_0x192e77[_0x4122('0x20')])[_0x4122('0x25')](_0x3c674e[_0x4122('0x18')],_0x4122('0x26'))>moment()){throw new Error(_0x4122('0x14'));}return utils[_0x4122('0x27')](_0x192e77,0x0,![],null)[_0x4122('0x19')](function(){return utils[_0x4122('0x28')](_0x192e77);})[_0x4122('0x19')](function(){return _0x4761a0(null,_0x192e77);});}else{return utils[_0x4122('0x28')](_0x192e77)[_0x4122('0x19')](function(){return _0x4761a0(null,_0x192e77);});}}else{return utils[_0x4122('0x28')](_0x192e77)[_0x4122('0x19')](function(){return _0x4761a0(null,_0x192e77);});}})['catch'](function(_0x2e5bc2){return _0x4761a0(null,![],_0x2e5bc2);});}function handleError(_0x43c51c,_0x79c85,_0x31f141){return _0x43c51c['status'](_0x79c85||0x1f4)[_0x4122('0x29')]({'message':_0x31f141?_0x31f141['message']||_0x31f141:''});}exports[_0x4122('0x2a')]=function(_0x431430,_0x3a9633,_0xd8634b){passport[_0x4122('0x10')](_0x4122('0x2b'),function(_0xb98ce8,_0x427e8a,_0x57c0a7){var _0x17968f=_0xb98ce8||_0x57c0a7;if(_0x17968f){return handleError(_0x3a9633,0x191,_0x17968f);}if(!_0x427e8a){return handleError(_0x3a9633,0x194,{'message':_0x4122('0x2c')});}else{var _0x5770bd={'payload':{'id':_0x427e8a['id'],'role':_0x427e8a[_0x4122('0x1d')]},'options':{'expiresIn':0x15180}};return authService[_0x4122('0x2d')](_0x5770bd)[_0x4122('0x19')](function(_0x1876f8){_0x3a9633['json']({'id':_0x427e8a['id'],'token':_0x1876f8,'statusCall':'','isAlreadyLogged':_0x427e8a[_0x4122('0x21')]});});}})(_0x431430,_0x3a9633,_0xd8634b);};passport[_0x4122('0x2e')]('ad-login',new LocalStrategy({'usernameField':'name','passwordField':_0x4122('0x1b')},function(_0x591ea8,_0x2359ef,_0x1081e3){return ActiveDirectoryAuthenticate(db['User'],_0x591ea8,_0x2359ef,_0x1081e3);})); \ No newline at end of file +var _0x08d3=['salt','role','blocked','online','admin','user','then','name','disabled','add','minutes','clearBlockUser','getLicense','send','message','login','authenticate','ad-login','signToken','json','use','User','passport','passport-local','moment','activedirectory2','bluebird','util','../../mysqldb','../../components/auth/service','../../config/utils','../../config/logger','api','activedirectory','undefined','baseDN','url','domain','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','Error\x20authenticate\x20%s:\x20Active\x20Directory\x20not\x20configured','Setting','findOne','blockDuration','adSsoEnabled','Error\x20authenticate\x20%s:\x20Active\x20Directory\x20not\x20enabled','password'];(function(_0x546c92,_0x165c9f){var _0x55ca41=function(_0x23f5b5){while(--_0x23f5b5){_0x546c92['push'](_0x546c92['shift']());}};_0x55ca41(++_0x165c9f);}(_0x08d3,0x174));var _0x308d=function(_0x80e4a1,_0x349085){_0x80e4a1=_0x80e4a1-0x0;var _0x5fcf64=_0x08d3[_0x80e4a1];return _0x5fcf64;};'use strict';var passport=require(_0x308d('0x0'));var LocalStrategy=require(_0x308d('0x1'))['Strategy'];var moment=require(_0x308d('0x2'));var ActiveDirectory=require(_0x308d('0x3'));var BPromise=require(_0x308d('0x4'));var util=require(_0x308d('0x5'));var db=require(_0x308d('0x6'))['db'];var authService=require(_0x308d('0x7'));var utils=require(_0x308d('0x8'));var config=require('../../config/environment');var logger=require(_0x308d('0x9'))(_0x308d('0xa'));function isActiveDirectoryConfigured(_0x54296f){var _0x4a5b0c=![];if(typeof _0x54296f[_0x308d('0xb')]!==_0x308d('0xc')){_0x4a5b0c=_0x54296f[_0x308d('0xb')][_0x308d('0xd')]&&_0x54296f[_0x308d('0xb')][_0x308d('0xe')]&&_0x54296f[_0x308d('0xb')][_0x308d('0xf')];}return _0x4a5b0c;}function adAuthenticate(_0x1262d0,_0x270aee,_0x1d0407){return new BPromise(function(_0x514e4d,_0x5cb2d4){try{var _0x16baaf=new ActiveDirectory(_0x1262d0);_0x16baaf['authenticate'](_0x270aee,_0x1d0407,function(_0x4fb890,_0x2a6342){if(_0x4fb890){logger['error'](_0x308d('0x10'),_0x270aee,util[_0x308d('0x11')](_0x4fb890,{'showHidden':![],'depth':null}));_0x5cb2d4(_0x308d('0x12'));}else if(!_0x2a6342){logger[_0x308d('0x13')](_0x308d('0x14'),_0x270aee);_0x5cb2d4(_0x308d('0x12'));}else{_0x514e4d(_0x2a6342);}});}catch(_0x4ed539){_0x5cb2d4(_0x4ed539);}});}function ActiveDirectoryAuthenticate(_0xceff3,_0x27176c,_0x15103d,_0x35ce2f){var _0x39fe04,_0x4b9833;if(!isActiveDirectoryConfigured(config)){logger[_0x308d('0x13')](_0x308d('0x15'),_0x27176c);return _0x35ce2f(null,![],{'message':_0x308d('0x12')});}return db[_0x308d('0x16')][_0x308d('0x17')]({'where':{'id':0x1},'attributes':['adSsoEnabled',_0x308d('0x18')],'raw':!![]})['then'](function(_0x364179){_0x39fe04=_0x364179;if(!_0x39fe04[_0x308d('0x19')]){logger[_0x308d('0x13')](_0x308d('0x1a'),_0x27176c);throw new Error(_0x308d('0x12'));}return _0xceff3[_0x308d('0x17')]({'attributes':['id','name',_0x308d('0x1b'),_0x308d('0x1c'),_0x308d('0x1d'),'disabled',_0x308d('0x1e'),'blockedAt',_0x308d('0x1f')],'where':{'name':_0x27176c,'role':{'$or':[_0x308d('0x20'),_0x308d('0x21'),'agent']},'adSsoEnabled':!![]}});})[_0x308d('0x22')](function(_0xde675){if(!_0xde675||_0xde675&&_0xde675[_0x308d('0x23')]!==_0x27176c){throw new Error(_0x308d('0x12'));}_0x4b9833=_0xde675;var _0x2efcb2=_0x4b9833[_0x308d('0x23')]+'@'+config[_0x308d('0xb')][_0x308d('0xf')];return adAuthenticate(config['activedirectory'],_0x2efcb2,_0x15103d);})[_0x308d('0x22')](function(_0x4a5085){if(_0x4b9833[_0x308d('0x24')]){throw new Error(_0x308d('0x12'));}if(_0x39fe04['blockDuration']>0x0){if(_0x4b9833[_0x308d('0x1e')]){if(moment(_0x4b9833['blockedAt'])[_0x308d('0x25')](_0x39fe04[_0x308d('0x18')],_0x308d('0x26'))>moment()){throw new Error(_0x308d('0x12'));}return utils[_0x308d('0x27')](_0x4b9833,0x0,![],null)[_0x308d('0x22')](function(){return utils['getLicense'](_0x4b9833);})[_0x308d('0x22')](function(){return _0x35ce2f(null,_0x4b9833);});}else{return utils[_0x308d('0x28')](_0x4b9833)['then'](function(){return _0x35ce2f(null,_0x4b9833);});}}else{return utils[_0x308d('0x28')](_0x4b9833)[_0x308d('0x22')](function(){return _0x35ce2f(null,_0x4b9833);});}})['catch'](function(_0x414c80){return _0x35ce2f(null,![],_0x414c80);});}function handleError(_0x3cc683,_0x2a5c13,_0x4028ee){return _0x3cc683['status'](_0x2a5c13||0x1f4)[_0x308d('0x29')]({'message':_0x4028ee?_0x4028ee[_0x308d('0x2a')]||_0x4028ee:''});}exports[_0x308d('0x2b')]=function(_0x1ed97b,_0x59a3f6,_0x4894b7){passport[_0x308d('0x2c')](_0x308d('0x2d'),function(_0x19e782,_0x374dfd,_0x3f2bfe){var _0x4ff58f=_0x19e782||_0x3f2bfe;if(_0x4ff58f){return handleError(_0x59a3f6,0x191,_0x4ff58f);}if(!_0x374dfd){return handleError(_0x59a3f6,0x194,{'message':'Something\x20went\x20wrong,\x20please\x20try\x20again.'});}else{var _0xeee284={'payload':{'id':_0x374dfd['id'],'role':_0x374dfd[_0x308d('0x1d')]},'options':{'expiresIn':0x15180}};return authService[_0x308d('0x2e')](_0xeee284)[_0x308d('0x22')](function(_0x64bc50){_0x59a3f6[_0x308d('0x2f')]({'id':_0x374dfd['id'],'token':_0x64bc50,'statusCall':'','isAlreadyLogged':_0x374dfd[_0x308d('0x1f')]});});}})(_0x1ed97b,_0x59a3f6,_0x4894b7);};passport[_0x308d('0x30')](_0x308d('0x2d'),new LocalStrategy({'usernameField':_0x308d('0x23'),'passwordField':_0x308d('0x1b')},function(_0x5261d9,_0x15604e,_0x4dee79){return ActiveDirectoryAuthenticate(db[_0x308d('0x31')],_0x5261d9,_0x15604e,_0x4dee79);})); \ No newline at end of file diff --git a/server/api/authActiveDirectory/index.js b/server/api/authActiveDirectory/index.js index 4d261df..52eeea1 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 _0x7f67=['post','express','Router','./authActiveDirectory.controller'];(function(_0x33f85b,_0x1fbeb1){var _0x4c0b81=function(_0x31a582){while(--_0x31a582){_0x33f85b['push'](_0x33f85b['shift']());}};_0x4c0b81(++_0x1fbeb1);}(_0x7f67,0x1b1));var _0x77f6=function(_0x2f5ac5,_0x1ee939){_0x2f5ac5=_0x2f5ac5-0x0;var _0x37c9a8=_0x7f67[_0x2f5ac5];return _0x37c9a8;};'use strict';var express=require(_0x77f6('0x0'));var router=express[_0x77f6('0x1')]();var controller=require(_0x77f6('0x2'));router[_0x77f6('0x3')]('/',controller['login']);module['exports']=router; \ No newline at end of file +var _0x1b01=['express','Router','post','exports'];(function(_0x528f72,_0x492b6b){var _0x5f0c4d=function(_0x497811){while(--_0x497811){_0x528f72['push'](_0x528f72['shift']());}};_0x5f0c4d(++_0x492b6b);}(_0x1b01,0x18c));var _0x11b0=function(_0x39a414,_0x20ce11){_0x39a414=_0x39a414-0x0;var _0x52103c=_0x1b01[_0x39a414];return _0x52103c;};'use strict';var express=require(_0x11b0('0x0'));var router=express[_0x11b0('0x1')]();var controller=require('./authActiveDirectory.controller');router[_0x11b0('0x2')]('/',controller['login']);module[_0x11b0('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 5412d63..402feb2 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(_0x577032,_0x23e546){var _0x491213=function(_0x34a2c4){while(--_0x34a2c4){_0x577032['push'](_0x577032['shift']());}};_0x491213(++_0x23e546);}(_0x9957,0x93));var _0x7995=function(_0x5ddb1c,_0x5ea4df){_0x5ddb1c=_0x5ddb1c-0x0;var _0x354adc=_0x9957[_0x5ddb1c];return _0x354adc;};'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(_0x299214,_0x2bab88){var _0x4d89c1=function(_0x34a13b){while(--_0x34a13b){_0x299214['push'](_0x299214['shift']());}};_0x4d89c1(++_0x2bab88);}(_0x9957,0x93));var _0x7995=function(_0x6c993a,_0x5ea3ab){_0x6c993a=_0x6c993a-0x0;var _0x27f547=_0x9957[_0x6c993a];return _0x27f547;};'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 6a9b253..b8255ba 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 _0x487d=['login','/callback','isMiddleware','exports','express','passport','Router','../../components/auth/service','get'];(function(_0x199116,_0x2bbb4a){var _0x58a22f=function(_0x4fc1b3){while(--_0x4fc1b3){_0x199116['push'](_0x199116['shift']());}};_0x58a22f(++_0x2bbb4a);}(_0x487d,0x1b4));var _0xd487=function(_0x4aba15,_0x4e90aa){_0x4aba15=_0x4aba15-0x0;var _0x1c8122=_0x487d[_0x4aba15];return _0x1c8122;};'use strict';var express=require(_0xd487('0x0'));var passport=require(_0xd487('0x1'));var router=express[_0xd487('0x2')]();var controller=require('./authGoogle.controller');var userController=require('../user/user.controller.js');var authService=require(_0xd487('0x3'));router[_0xd487('0x4')]('/',controller[_0xd487('0x5')]);router[_0xd487('0x4')](_0xd487('0x6'),controller['callback'],authService[_0xd487('0x7')],userController[_0xd487('0x5')],authService['setTokenCookie']);module[_0xd487('0x8')]=router; \ No newline at end of file +var _0xa5d0=['isMiddleware','login','exports','express','Router','./authGoogle.controller','../user/user.controller.js','get','/callback','callback'];(function(_0x459a0a,_0x25c46f){var _0x4ab46c=function(_0x451a6a){while(--_0x451a6a){_0x459a0a['push'](_0x459a0a['shift']());}};_0x4ab46c(++_0x25c46f);}(_0xa5d0,0xd5));var _0x0a5d=function(_0x5c3c0b,_0x4ee35e){_0x5c3c0b=_0x5c3c0b-0x0;var _0x52ecd2=_0xa5d0[_0x5c3c0b];return _0x52ecd2;};'use strict';var express=require(_0x0a5d('0x0'));var passport=require('passport');var router=express[_0x0a5d('0x1')]();var controller=require(_0x0a5d('0x2'));var userController=require(_0x0a5d('0x3'));var authService=require('../../components/auth/service');router[_0x0a5d('0x4')]('/',controller['login']);router[_0x0a5d('0x4')](_0x0a5d('0x5'),controller[_0x0a5d('0x6')],authService[_0x0a5d('0x7')],userController[_0x0a5d('0x8')],authService['setTokenCookie']);module[_0x0a5d('0x9')]=router; \ No newline at end of file diff --git a/server/api/authLocal/authLocal.controller.js b/server/api/authLocal/authLocal.controller.js index 3ee6763..356076b 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 _0x5984=['https://','headers','If\x20you\x20did\x20not\x20request\x20this,\x20please\x20ignore\x20this\x20email\x20and\x20your\x20password\x20will\x20remain\x20unchanged.\x0a','reset','User','now','passwordHistoryLimit','securePassword','validatePasswordPattern','enforcePasswordHistory','previousPasswords','validatePasswordHistory','Password\x20reset!','use','util','passport','passport-local','Strategy','jayson/promise','lodash','randomstring','moment','../../mysqldb','../../config/utils','client','http','allowedLoginAttempts','blockDuration','then','findOne','name','password','role','blockedAt','loginAttempts','admin','user','agent','Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.','authenticate','blocked','add','minutes','clearBlockUser','disabled','getLicense','catch','email','Smtp','CloudProvider','Unable\x20to\x20find\x20a\x20configured\x20SMTP\x20service!','merge','format','\x22%s\x22\x20<%s>','request','SendMail','error','SendMail\x20error:\x20%s.\x20Please\x20contact\x20your\x20Administrator!','stringify','status','send','message','login','local-login','Something\x20went\x20wrong,\x20please\x20try\x20again.','signToken','json','online','forgot','body','Email\x20parameter\x20is\x20missing','generate','trim','Setting','find','This\x20email\x20is\x20not\x20registered.','The\x20user\x20is\x20disabled.\x20Please\x20contact\x20the\x20administrator.','The\x20user\x20is\x20blocked.\x20Please\x20contact\x20the\x20administrator.','resetPasswordToken','resetPasswordExpires','save','xCally\x20Motion\x20Password\x20Reset','You\x20are\x20receiving\x20this\x20because\x20you\x20(or\x20someone\x20else)\x20have\x20requested\x20the\x20reset\x20of\x20the\x20password\x20for\x20your\x20account.\x0a\x0a','Please\x20click\x20on\x20the\x20following\x20link,\x20or\x20paste\x20this\x20into\x20your\x20browser\x20to\x20complete\x20the\x20process:\x0a\x0a'];(function(_0xb1d61d,_0x39d9c2){var _0xbaca6=function(_0x1e5299){while(--_0x1e5299){_0xb1d61d['push'](_0xb1d61d['shift']());}};_0xbaca6(++_0x39d9c2);}(_0x5984,0x15e));var _0x4598=function(_0x508ac6,_0x4d9a97){_0x508ac6=_0x508ac6-0x0;var _0x25d22a=_0x5984[_0x508ac6];return _0x25d22a;};'use strict';var util=require(_0x4598('0x0'));var passport=require(_0x4598('0x1'));var LocalStrategy=require(_0x4598('0x2'))[_0x4598('0x3')];var jayson=require(_0x4598('0x4'));var _=require(_0x4598('0x5'));var rs=require(_0x4598('0x6'));var moment=require(_0x4598('0x7'));var db=require(_0x4598('0x8'))['db'];var authService=require('../../components/auth/service');var utils=require(_0x4598('0x9'));var client=jayson[_0x4598('0xa')][_0x4598('0xb')]({'port':0x232b});function localAuthenticate(_0x2a22ff,_0x12eb8e,_0x20210f,_0x12be1c){var _0x245db1,_0x234d9b;return db['Setting']['findOne']({'where':{'id':0x1},'attributes':[_0x4598('0xc'),_0x4598('0xd')],'raw':!![]})[_0x4598('0xe')](function(_0x1bc36a){_0x245db1=_0x1bc36a;return _0x2a22ff[_0x4598('0xf')]({'attributes':['id',_0x4598('0x10'),_0x4598('0x11'),'salt',_0x4598('0x12'),'disabled','blocked',_0x4598('0x13'),_0x4598('0x14')],'where':{'name':_0x12eb8e,'role':{'$or':[_0x4598('0x15'),_0x4598('0x16'),_0x4598('0x17')]}}});})[_0x4598('0xe')](function(_0x1200f7){if(!_0x1200f7||_0x1200f7&&_0x1200f7['name']!==_0x12eb8e){throw new Error(_0x4598('0x18'));}else{_0x234d9b=_0x1200f7;return _0x234d9b;}})[_0x4598('0xe')](function(){_0x234d9b[_0x4598('0x19')](_0x20210f,function(_0x11806f,_0x2e5b1b){var _0x552f4a=_0x234d9b[_0x4598('0x14')]+0x1;if(_0x11806f){return _0x12be1c(_0x11806f);}else if(!_0x2e5b1b){if(_0x234d9b['disabled']){return _0x12be1c(null,![],{'message':_0x4598('0x18')});}else if(_0x245db1['allowedLoginAttempts']>0x0){if(_0x234d9b[_0x4598('0x1a')]){if(_0x245db1[_0x4598('0xd')]>0x0){if(moment(_0x234d9b[_0x4598('0x13')])[_0x4598('0x1b')](_0x245db1[_0x4598('0xd')],_0x4598('0x1c'))>moment()){return _0x12be1c(null,![],{'message':'Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'});}else{return utils[_0x4598('0x1d')](_0x234d9b,_0x552f4a,![],null)[_0x4598('0xe')](function(){return _0x12be1c(null,![],{'message':_0x4598('0x18')});});}}else{return _0x12be1c(null,![],{'message':_0x4598('0x18')});}}else{if(_0x552f4a>=_0x245db1['allowedLoginAttempts']){return utils['clearBlockUser'](_0x234d9b,0x0,!![],moment())[_0x4598('0xe')](function(){return _0x12be1c(null,![],{'message':_0x4598('0x18')});});}else{return utils[_0x4598('0x1d')](_0x234d9b,_0x552f4a,![],null)['then'](function(){return _0x12be1c(null,![],{'message':'Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'});});}}}else{return _0x12be1c(null,![],{'message':'Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'});}}else{if(_0x234d9b[_0x4598('0x1e')]){return _0x12be1c(null,![],{'message':_0x4598('0x18')});}else if(_0x245db1[_0x4598('0xc')]>0x0){if(_0x234d9b[_0x4598('0x1a')]){if(_0x245db1[_0x4598('0xd')]>0x0){if(moment(_0x234d9b[_0x4598('0x13')])[_0x4598('0x1b')](_0x245db1[_0x4598('0xd')],_0x4598('0x1c'))>moment()){return _0x12be1c(null,![],{'message':'Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'});}else{return utils['clearBlockUser'](_0x234d9b,0x0,![],null)['then'](function(){return utils[_0x4598('0x1f')](_0x234d9b);})[_0x4598('0xe')](function(){return _0x12be1c(null,_0x234d9b);});}}else{return _0x12be1c(null,![],{'message':_0x4598('0x18')});}}else{return utils[_0x4598('0x1d')](_0x234d9b,0x0,![],null)[_0x4598('0xe')](function(){return utils['getLicense'](_0x234d9b);})[_0x4598('0xe')](function(){return _0x12be1c(null,_0x234d9b);})['catch'](function(_0x3d0492){return _0x12be1c(null,![],_0x3d0492);});}}else{if(_0x234d9b[_0x4598('0x1a')]){return _0x12be1c(null,![],{'message':'Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'});}else{return utils[_0x4598('0x1f')](_0x234d9b)['then'](function(){return _0x12be1c(null,_0x234d9b);});}}}});})[_0x4598('0x20')](function(_0xd5cf0f){return _0x12be1c(null,![],_0xd5cf0f);});}function sendServiceMail(_0x40a3f8){return db['MailAccount']['find']({'where':{'service':!![]},'attributes':['id',_0x4598('0x10'),_0x4598('0x21')],'include':[{'model':db['MailServerOut'],'as':_0x4598('0x22'),'include':[{'model':db[_0x4598('0x23')],'as':_0x4598('0x23')}]}]})[_0x4598('0xe')](function(_0x1a4e7f){if(!_0x1a4e7f){throw new Error(_0x4598('0x24'));}var _0x3acf9d=_0x1a4e7f['getSmtpOptions']();var _0x2101be={'account':_0x3acf9d,'message':_[_0x4598('0x25')]({'from':util[_0x4598('0x26')](_0x4598('0x27'),_0x1a4e7f[_0x4598('0x10')],_0x1a4e7f[_0x4598('0x21')]||_0x1a4e7f['Smtp'][_0x4598('0x16')])},_0x40a3f8)};return client[_0x4598('0x28')](_0x4598('0x29'),_0x2101be);})['then'](function(_0x318240){if(_0x318240[_0x4598('0x2a')]){throw new Error(util[_0x4598('0x26')](_0x4598('0x2b'),_0x318240[_0x4598('0x2a')]['message']||JSON[_0x4598('0x2c')](_0x318240[_0x4598('0x2a')])));}return!![];});}function handleError(_0x52d32e,_0x2c46f9,_0x1b0e27){return _0x52d32e[_0x4598('0x2d')](_0x2c46f9||0x1f4)[_0x4598('0x2e')]({'message':_0x1b0e27?_0x1b0e27[_0x4598('0x2f')]||_0x1b0e27:''});}exports[_0x4598('0x30')]=function(_0xeae30c,_0x1dcbf7,_0x54c696){passport['authenticate'](_0x4598('0x31'),function(_0x3bc226,_0x59552a,_0x197ab4){var _0x398bd7=_0x3bc226||_0x197ab4;if(_0x398bd7){return handleError(_0x1dcbf7,0x191,_0x398bd7);}if(!_0x59552a){return handleError(_0x1dcbf7,0x194,{'message':_0x4598('0x32')});}else{var _0x2927cc={'payload':{'id':_0x59552a['id'],'role':_0x59552a[_0x4598('0x12')]},'options':{'expiresIn':0x15180}};return authService[_0x4598('0x33')](_0x2927cc)['then'](function(_0xa15a9f){_0x1dcbf7[_0x4598('0x34')]({'id':_0x59552a['id'],'token':_0xa15a9f,'statusCall':'','isAlreadyLogged':_0x59552a[_0x4598('0x35')]});});}})(_0xeae30c,_0x1dcbf7,_0x54c696);};exports[_0x4598('0x36')]=function(_0x1d8089,_0x3960e5){if(!_0x1d8089[_0x4598('0x37')][_0x4598('0x21')]){return handleError(_0x3960e5,0x1f4,{'message':_0x4598('0x38')});}var _0x53a64b=rs[_0x4598('0x39')]();_0x1d8089[_0x4598('0x37')][_0x4598('0x21')]=_0x1d8089[_0x4598('0x37')][_0x4598('0x21')][_0x4598('0x3a')]()['toLowerCase']();var _0x50ad75;return db[_0x4598('0x3b')][_0x4598('0xf')]({'where':{'id':0x1},'attributes':['allowedLoginAttempts',_0x4598('0xd')],'raw':!![]})[_0x4598('0xe')](function(_0x353b4a){_0x50ad75=_0x353b4a;return db['User'][_0x4598('0x3c')]({'where':{'email':_0x1d8089[_0x4598('0x37')][_0x4598('0x21')]}});})[_0x4598('0xe')](function(_0x4a0e4b){if(!_0x4a0e4b){throw new Error(_0x4598('0x3d'));}if(_0x4a0e4b[_0x4598('0x1e')]){throw new Error(_0x4598('0x3e'));}if(_0x4a0e4b[_0x4598('0x1a')]){if(moment(_0x4a0e4b[_0x4598('0x13')])['add'](_0x50ad75[_0x4598('0xd')],'minutes')>moment()){throw new Error(_0x4598('0x3f'));}else{_0x4a0e4b['blocked']=![];_0x4a0e4b['blockedAt']=null;}}_0x4a0e4b[_0x4598('0x40')]=_0x53a64b;_0x4a0e4b[_0x4598('0x41')]=Date['now']()+0x36ee80;return _0x4a0e4b[_0x4598('0x42')]();})[_0x4598('0xe')](function(){return sendServiceMail({'to':_0x1d8089[_0x4598('0x37')]['email'],'subject':_0x4598('0x43'),'text':_0x4598('0x44')+_0x4598('0x45')+_0x4598('0x46')+_0x1d8089[_0x4598('0x47')]['host']+'/reset/'+_0x53a64b+'\x0a\x0a'+_0x4598('0x48')});})['then'](function(){_0x3960e5[_0x4598('0x2d')](0xc8)[_0x4598('0x2e')]({'message':'Reset\x20Email\x20sent!'});})['catch'](function(_0x43b7a7){return handleError(_0x3960e5,0x1f4,_0x43b7a7);});};exports[_0x4598('0x49')]=function(_0x612221,_0x125c55){return db[_0x4598('0x4a')][_0x4598('0x3c')]({'where':{'resetPasswordToken':_0x612221['params']['token'],'resetPasswordExpires':{'$gt':Date[_0x4598('0x4b')]()}}})[_0x4598('0xe')](function(_0x407173){if(!_0x407173){throw new Error('Password\x20reset\x20token\x20is\x20invalid\x20or\x20has\x20expired.');}return db['Setting'][_0x4598('0xf')]({'attributes':['id','securePassword','enforcePasswordHistory',_0x4598('0x4c')]})[_0x4598('0xe')](function(_0xaa5d95){if(_0xaa5d95[_0x4598('0x4d')])authService[_0x4598('0x4e')](_0x612221['body'][_0x4598('0x11')]);if(!_0xaa5d95[_0x4598('0x4f')]||!_0x407173[_0x4598('0x50')])return _0x407173;authService[_0x4598('0x51')](_0x612221[_0x4598('0x37')][_0x4598('0x11')],_0x407173[_0x4598('0x50')],_0xaa5d95['passwordHistoryLimit']);return _0x407173;})[_0x4598('0xe')](function(){_0x407173[_0x4598('0x11')]=_0x612221[_0x4598('0x37')][_0x4598('0x11')];_0x407173[_0x4598('0x40')]=null;_0x407173[_0x4598('0x41')]=null;return _0x407173['save']();});})['then'](function(){_0x125c55[_0x4598('0x2d')](0xc8)['send']({'message':_0x4598('0x52')});})[_0x4598('0x20')](function(_0x2526a8){return handleError(_0x125c55,0x1f4,_0x2526a8);});};passport[_0x4598('0x53')](_0x4598('0x31'),new LocalStrategy({'usernameField':'name','passwordField':_0x4598('0x11')},function(_0x2422c5,_0x2de51d,_0x4d8f40){return localAuthenticate(db[_0x4598('0x4a')],_0x2422c5,_0x2de51d,_0x4d8f40);})); \ No newline at end of file +var _0x7ced=['findOne','allowedLoginAttempts','then','password','role','loginAttempts','user','name','disabled','blocked','blockDuration','blockedAt','add','minutes','Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.','clearBlockUser','getLicense','find','email','Smtp','CloudProvider','Unable\x20to\x20find\x20a\x20configured\x20SMTP\x20service!','merge','format','\x22%s\x22\x20<%s>','SendMail','error','SendMail\x20error:\x20%s.\x20Please\x20contact\x20your\x20Administrator!','message','stringify','send','login','authenticate','local-login','Something\x20went\x20wrong,\x20please\x20try\x20again.','json','online','forgot','Email\x20parameter\x20is\x20missing','generate','body','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','Please\x20click\x20on\x20the\x20following\x20link,\x20or\x20paste\x20this\x20into\x20your\x20browser\x20to\x20complete\x20the\x20process:\x0a\x0a','https://','headers','/reset/','status','Reset\x20Email\x20sent!','reset','params','token','enforcePasswordHistory','passwordHistoryLimit','securePassword','previousPasswords','Password\x20reset!','catch','util','passport','passport-local','randomstring','moment','../../mysqldb','../../config/utils','client','Setting'];(function(_0x21c590,_0x279a39){var _0x3497c8=function(_0x42a6ab){while(--_0x42a6ab){_0x21c590['push'](_0x21c590['shift']());}};_0x3497c8(++_0x279a39);}(_0x7ced,0x91));var _0xd7ce=function(_0x10a12a,_0xee7529){_0x10a12a=_0x10a12a-0x0;var _0x1905af=_0x7ced[_0x10a12a];return _0x1905af;};'use strict';var util=require(_0xd7ce('0x0'));var passport=require(_0xd7ce('0x1'));var LocalStrategy=require(_0xd7ce('0x2'))['Strategy'];var jayson=require('jayson/promise');var _=require('lodash');var rs=require(_0xd7ce('0x3'));var moment=require(_0xd7ce('0x4'));var db=require(_0xd7ce('0x5'))['db'];var authService=require('../../components/auth/service');var utils=require(_0xd7ce('0x6'));var client=jayson[_0xd7ce('0x7')]['http']({'port':0x232b});function localAuthenticate(_0x1d989c,_0x321f63,_0x41a24a,_0x2e6cd6){var _0x3e5fa5,_0x3f923a;return db[_0xd7ce('0x8')][_0xd7ce('0x9')]({'where':{'id':0x1},'attributes':[_0xd7ce('0xa'),'blockDuration'],'raw':!![]})[_0xd7ce('0xb')](function(_0x2a1304){_0x3e5fa5=_0x2a1304;return _0x1d989c[_0xd7ce('0x9')]({'attributes':['id','name',_0xd7ce('0xc'),'salt',_0xd7ce('0xd'),'disabled','blocked','blockedAt',_0xd7ce('0xe')],'where':{'name':_0x321f63,'role':{'$or':['admin',_0xd7ce('0xf'),'agent']}}});})[_0xd7ce('0xb')](function(_0x5169c2){if(!_0x5169c2||_0x5169c2&&_0x5169c2[_0xd7ce('0x10')]!==_0x321f63){throw new Error('Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.');}else{_0x3f923a=_0x5169c2;return _0x3f923a;}})[_0xd7ce('0xb')](function(){_0x3f923a['authenticate'](_0x41a24a,function(_0x5b5b29,_0xa0de1f){var _0x47bc8c=_0x3f923a['loginAttempts']+0x1;if(_0x5b5b29){return _0x2e6cd6(_0x5b5b29);}else if(!_0xa0de1f){if(_0x3f923a[_0xd7ce('0x11')]){return _0x2e6cd6(null,![],{'message':'Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'});}else if(_0x3e5fa5[_0xd7ce('0xa')]>0x0){if(_0x3f923a[_0xd7ce('0x12')]){if(_0x3e5fa5[_0xd7ce('0x13')]>0x0){if(moment(_0x3f923a[_0xd7ce('0x14')])[_0xd7ce('0x15')](_0x3e5fa5[_0xd7ce('0x13')],_0xd7ce('0x16'))>moment()){return _0x2e6cd6(null,![],{'message':_0xd7ce('0x17')});}else{return utils[_0xd7ce('0x18')](_0x3f923a,_0x47bc8c,![],null)['then'](function(){return _0x2e6cd6(null,![],{'message':'Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'});});}}else{return _0x2e6cd6(null,![],{'message':_0xd7ce('0x17')});}}else{if(_0x47bc8c>=_0x3e5fa5[_0xd7ce('0xa')]){return utils['clearBlockUser'](_0x3f923a,0x0,!![],moment())[_0xd7ce('0xb')](function(){return _0x2e6cd6(null,![],{'message':_0xd7ce('0x17')});});}else{return utils[_0xd7ce('0x18')](_0x3f923a,_0x47bc8c,![],null)[_0xd7ce('0xb')](function(){return _0x2e6cd6(null,![],{'message':'Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'});});}}}else{return _0x2e6cd6(null,![],{'message':_0xd7ce('0x17')});}}else{if(_0x3f923a[_0xd7ce('0x11')]){return _0x2e6cd6(null,![],{'message':_0xd7ce('0x17')});}else if(_0x3e5fa5[_0xd7ce('0xa')]>0x0){if(_0x3f923a[_0xd7ce('0x12')]){if(_0x3e5fa5[_0xd7ce('0x13')]>0x0){if(moment(_0x3f923a[_0xd7ce('0x14')])[_0xd7ce('0x15')](_0x3e5fa5[_0xd7ce('0x13')],_0xd7ce('0x16'))>moment()){return _0x2e6cd6(null,![],{'message':'Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'});}else{return utils['clearBlockUser'](_0x3f923a,0x0,![],null)[_0xd7ce('0xb')](function(){return utils[_0xd7ce('0x19')](_0x3f923a);})[_0xd7ce('0xb')](function(){return _0x2e6cd6(null,_0x3f923a);});}}else{return _0x2e6cd6(null,![],{'message':_0xd7ce('0x17')});}}else{return utils[_0xd7ce('0x18')](_0x3f923a,0x0,![],null)[_0xd7ce('0xb')](function(){return utils[_0xd7ce('0x19')](_0x3f923a);})[_0xd7ce('0xb')](function(){return _0x2e6cd6(null,_0x3f923a);})['catch'](function(_0xbc0ca8){return _0x2e6cd6(null,![],_0xbc0ca8);});}}else{if(_0x3f923a['blocked']){return _0x2e6cd6(null,![],{'message':_0xd7ce('0x17')});}else{return utils[_0xd7ce('0x19')](_0x3f923a)[_0xd7ce('0xb')](function(){return _0x2e6cd6(null,_0x3f923a);});}}}});})['catch'](function(_0x33ef23){return _0x2e6cd6(null,![],_0x33ef23);});}function sendServiceMail(_0x19872c){return db['MailAccount'][_0xd7ce('0x1a')]({'where':{'service':!![]},'attributes':['id',_0xd7ce('0x10'),_0xd7ce('0x1b')],'include':[{'model':db['MailServerOut'],'as':_0xd7ce('0x1c'),'include':[{'model':db[_0xd7ce('0x1d')],'as':_0xd7ce('0x1d')}]}]})[_0xd7ce('0xb')](function(_0xf905c5){if(!_0xf905c5){throw new Error(_0xd7ce('0x1e'));}var _0x2fd534=_0xf905c5['getSmtpOptions']();var _0x315ef6={'account':_0x2fd534,'message':_[_0xd7ce('0x1f')]({'from':util[_0xd7ce('0x20')](_0xd7ce('0x21'),_0xf905c5['name'],_0xf905c5[_0xd7ce('0x1b')]||_0xf905c5[_0xd7ce('0x1c')]['user'])},_0x19872c)};return client['request'](_0xd7ce('0x22'),_0x315ef6);})[_0xd7ce('0xb')](function(_0x2f66a4){if(_0x2f66a4[_0xd7ce('0x23')]){throw new Error(util[_0xd7ce('0x20')](_0xd7ce('0x24'),_0x2f66a4[_0xd7ce('0x23')][_0xd7ce('0x25')]||JSON[_0xd7ce('0x26')](_0x2f66a4['error'])));}return!![];});}function handleError(_0x5b676b,_0x2b00b9,_0x63d3aa){return _0x5b676b['status'](_0x2b00b9||0x1f4)[_0xd7ce('0x27')]({'message':_0x63d3aa?_0x63d3aa[_0xd7ce('0x25')]||_0x63d3aa:''});}exports[_0xd7ce('0x28')]=function(_0xcd4ad5,_0x425ea7,_0xb6db28){passport[_0xd7ce('0x29')](_0xd7ce('0x2a'),function(_0x1d041f,_0x44d0d4,_0x3aac25){var _0x8b6d77=_0x1d041f||_0x3aac25;if(_0x8b6d77){return handleError(_0x425ea7,0x191,_0x8b6d77);}if(!_0x44d0d4){return handleError(_0x425ea7,0x194,{'message':_0xd7ce('0x2b')});}else{var _0x30b6b4={'payload':{'id':_0x44d0d4['id'],'role':_0x44d0d4[_0xd7ce('0xd')]},'options':{'expiresIn':0x15180}};return authService['signToken'](_0x30b6b4)[_0xd7ce('0xb')](function(_0x5895ca){_0x425ea7[_0xd7ce('0x2c')]({'id':_0x44d0d4['id'],'token':_0x5895ca,'statusCall':'','isAlreadyLogged':_0x44d0d4[_0xd7ce('0x2d')]});});}})(_0xcd4ad5,_0x425ea7,_0xb6db28);};exports[_0xd7ce('0x2e')]=function(_0x4a9077,_0x136089){if(!_0x4a9077['body']['email']){return handleError(_0x136089,0x1f4,{'message':_0xd7ce('0x2f')});}var _0x42d6ac=rs[_0xd7ce('0x30')]();_0x4a9077['body'][_0xd7ce('0x1b')]=_0x4a9077[_0xd7ce('0x31')][_0xd7ce('0x1b')][_0xd7ce('0x32')]()[_0xd7ce('0x33')]();var _0x1f7205;return db['Setting'][_0xd7ce('0x9')]({'where':{'id':0x1},'attributes':['allowedLoginAttempts',_0xd7ce('0x13')],'raw':!![]})['then'](function(_0x426676){_0x1f7205=_0x426676;return db[_0xd7ce('0x34')][_0xd7ce('0x1a')]({'where':{'email':_0x4a9077['body'][_0xd7ce('0x1b')]}});})['then'](function(_0x50029b){if(!_0x50029b){throw new Error(_0xd7ce('0x35'));}if(_0x50029b[_0xd7ce('0x11')]){throw new Error(_0xd7ce('0x36'));}if(_0x50029b['blocked']){if(moment(_0x50029b[_0xd7ce('0x14')])[_0xd7ce('0x15')](_0x1f7205[_0xd7ce('0x13')],_0xd7ce('0x16'))>moment()){throw new Error(_0xd7ce('0x37'));}else{_0x50029b['blocked']=![];_0x50029b[_0xd7ce('0x14')]=null;}}_0x50029b[_0xd7ce('0x38')]=_0x42d6ac;_0x50029b[_0xd7ce('0x39')]=Date[_0xd7ce('0x3a')]()+0x36ee80;return _0x50029b[_0xd7ce('0x3b')]();})[_0xd7ce('0xb')](function(){return sendServiceMail({'to':_0x4a9077[_0xd7ce('0x31')][_0xd7ce('0x1b')],'subject':_0xd7ce('0x3c'),'text':_0xd7ce('0x3d')+_0xd7ce('0x3e')+_0xd7ce('0x3f')+_0x4a9077[_0xd7ce('0x40')]['host']+_0xd7ce('0x41')+_0x42d6ac+'\x0a\x0a'+'If\x20you\x20did\x20not\x20request\x20this,\x20please\x20ignore\x20this\x20email\x20and\x20your\x20password\x20will\x20remain\x20unchanged.\x0a'});})[_0xd7ce('0xb')](function(){_0x136089[_0xd7ce('0x42')](0xc8)[_0xd7ce('0x27')]({'message':_0xd7ce('0x43')});})['catch'](function(_0x170602){return handleError(_0x136089,0x1f4,_0x170602);});};exports[_0xd7ce('0x44')]=function(_0x1d5eeb,_0x4afa0c){return db[_0xd7ce('0x34')][_0xd7ce('0x1a')]({'where':{'resetPasswordToken':_0x1d5eeb[_0xd7ce('0x45')][_0xd7ce('0x46')],'resetPasswordExpires':{'$gt':Date[_0xd7ce('0x3a')]()}}})[_0xd7ce('0xb')](function(_0x2dd9e0){if(!_0x2dd9e0){throw new Error('Password\x20reset\x20token\x20is\x20invalid\x20or\x20has\x20expired.');}return db[_0xd7ce('0x8')][_0xd7ce('0x9')]({'attributes':['id','securePassword',_0xd7ce('0x47'),_0xd7ce('0x48')]})[_0xd7ce('0xb')](function(_0x43ed18){if(_0x43ed18[_0xd7ce('0x49')])authService['validatePasswordPattern'](_0x1d5eeb[_0xd7ce('0x31')][_0xd7ce('0xc')]);if(!_0x43ed18[_0xd7ce('0x47')]||!_0x2dd9e0[_0xd7ce('0x4a')])return _0x2dd9e0;authService['validatePasswordHistory'](_0x1d5eeb['body'][_0xd7ce('0xc')],_0x2dd9e0[_0xd7ce('0x4a')],_0x43ed18[_0xd7ce('0x48')]);return _0x2dd9e0;})['then'](function(){_0x2dd9e0[_0xd7ce('0xc')]=_0x1d5eeb['body'][_0xd7ce('0xc')];_0x2dd9e0[_0xd7ce('0x38')]=null;_0x2dd9e0[_0xd7ce('0x39')]=null;return _0x2dd9e0[_0xd7ce('0x3b')]();});})['then'](function(){_0x4afa0c['status'](0xc8)['send']({'message':_0xd7ce('0x4b')});})[_0xd7ce('0x4c')](function(_0x14376b){return handleError(_0x4afa0c,0x1f4,_0x14376b);});};passport['use'](_0xd7ce('0x2a'),new LocalStrategy({'usernameField':_0xd7ce('0x10'),'passwordField':'password'},function(_0x2bc4eb,_0x58ca59,_0x347969){return localAuthenticate(db[_0xd7ce('0x34')],_0x2bc4eb,_0x58ca59,_0x347969);})); \ No newline at end of file diff --git a/server/api/authLocal/index.js b/server/api/authLocal/index.js index 23b7763..dc129ec 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 _0xd2fb=['/reset/:token','exports','./authLocal.controller','post','login'];(function(_0x43f7e0,_0x1f0ca7){var _0x1d3cf6=function(_0x529623){while(--_0x529623){_0x43f7e0['push'](_0x43f7e0['shift']());}};_0x1d3cf6(++_0x1f0ca7);}(_0xd2fb,0x101));var _0xbd2f=function(_0x5a060d,_0x6723fd){_0x5a060d=_0x5a060d-0x0;var _0x534966=_0xd2fb[_0x5a060d];return _0x534966;};'use strict';var express=require('express');var router=express['Router']();var controller=require(_0xbd2f('0x0'));router[_0xbd2f('0x1')]('/',controller[_0xbd2f('0x2')]);router[_0xbd2f('0x1')]('/forgot',controller['forgot']);router[_0xbd2f('0x1')](_0xbd2f('0x3'),controller['reset']);module[_0xbd2f('0x4')]=router; \ No newline at end of file +var _0xf826=['/reset/:token','reset','exports','express','Router','./authLocal.controller','post'];(function(_0x33990e,_0x27b1f4){var _0x366423=function(_0x488cf4){while(--_0x488cf4){_0x33990e['push'](_0x33990e['shift']());}};_0x366423(++_0x27b1f4);}(_0xf826,0x1ed));var _0x6f82=function(_0x3d3fe5,_0x2fcf2b){_0x3d3fe5=_0x3d3fe5-0x0;var _0xb4ce88=_0xf826[_0x3d3fe5];return _0xb4ce88;};'use strict';var express=require(_0x6f82('0x0'));var router=express[_0x6f82('0x1')]();var controller=require(_0x6f82('0x2'));router['post']('/',controller['login']);router[_0x6f82('0x3')]('/forgot',controller['forgot']);router[_0x6f82('0x3')](_0x6f82('0x4'),controller[_0x6f82('0x5')]);module[_0x6f82('0x6')]=router; \ No newline at end of file diff --git a/server/api/automation/automation.attributes.js b/server/api/automation/automation.attributes.js index d2be4ef..f8812a8 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 _0x6f35=['BOOLEAN','INTEGER','sequelize','STRING'];(function(_0x39d8b8,_0x2b9b4b){var _0x13f7a0=function(_0x358c49){while(--_0x358c49){_0x39d8b8['push'](_0x39d8b8['shift']());}};_0x13f7a0(++_0x2b9b4b);}(_0x6f35,0x1be));var _0x56f3=function(_0x43e885,_0x25c816){_0x43e885=_0x43e885-0x0;var _0xc86170=_0x6f35[_0x43e885];return _0xc86170;};'use strict';var Sequelize=require(_0x56f3('0x0'));module['exports']={'name':{'type':Sequelize[_0x56f3('0x1')],'allowNull':![]},'channel':{'type':Sequelize[_0x56f3('0x1')]},'description':{'type':Sequelize[_0x56f3('0x1')]},'status':{'type':Sequelize[_0x56f3('0x2')],'defaultValue':![]},'timeout':{'type':Sequelize[_0x56f3('0x3')],'defaultValue':0xa}}; \ No newline at end of file +var _0x3146=['INTEGER','sequelize','exports','STRING','BOOLEAN'];(function(_0x219889,_0x351078){var _0x5c7234=function(_0x322f4f){while(--_0x322f4f){_0x219889['push'](_0x219889['shift']());}};_0x5c7234(++_0x351078);}(_0x3146,0xba));var _0x6314=function(_0x559cd4,_0x593dab){_0x559cd4=_0x559cd4-0x0;var _0x308b81=_0x3146[_0x559cd4];return _0x308b81;};'use strict';var Sequelize=require(_0x6314('0x0'));module[_0x6314('0x1')]={'name':{'type':Sequelize[_0x6314('0x2')],'allowNull':![]},'channel':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0x6314('0x2')]},'status':{'type':Sequelize[_0x6314('0x3')],'defaultValue':![]},'timeout':{'type':Sequelize[_0x6314('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 995a7ad..39fd2e2 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 _0xdad8=['Automation','then','includeAll','findAll','rows','catch','show','include','options','find','create','body','addConditions','params','omit','ids','getConditions','findOne','Condition','order','nolimit','Action','addActions','getActions','eml-format','rimraf','fast-json-patch','moment','bluebird','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','papaparse','ioredis','../../config/license/hardware','../../config/logger','../../config/environment','../../config/license/util','../../mysqldb','status','end','json','offset','undefined','limit','count','Content-Range','reject','save','update','destroy','stack','name','send','index','map','rawAttributes','fieldName','type','key','model','query','keys','intersection','attributes','fields','length','hasOwnProperty','sort','filters','pick','filter','where','merge'];(function(_0x770c67,_0x1ea22b){var _0x2bdbbe=function(_0xbab638){while(--_0xbab638){_0x770c67['push'](_0x770c67['shift']());}};_0x2bdbbe(++_0x1ea22b);}(_0xdad8,0x1b2));var _0x8dad=function(_0x1ce559,_0xc71110){_0x1ce559=_0x1ce559-0x0;var _0x18e671=_0xdad8[_0x1ce559];return _0x18e671;};'use strict';var emlformat=require(_0x8dad('0x0'));var rimraf=require(_0x8dad('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x8dad('0x2'));var rp=require('request-promise');var moment=require(_0x8dad('0x3'));var BPromise=require(_0x8dad('0x4'));var Mustache=require('mustache');var util=require(_0x8dad('0x5'));var path=require(_0x8dad('0x6'));var sox=require(_0x8dad('0x7'));var csv=require(_0x8dad('0x8'));var ejs=require(_0x8dad('0x9'));var fs=require('fs');var fs_extra=require(_0x8dad('0xa'));var _=require(_0x8dad('0xb'));var squel=require(_0x8dad('0xc'));var crypto=require(_0x8dad('0xd'));var jsforce=require(_0x8dad('0xe'));var deskjs=require(_0x8dad('0xf'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x8dad('0x10'));var Redis=require(_0x8dad('0x11'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x8dad('0x12'));var logger=require(_0x8dad('0x13'))('api');var utils=require('../../config/utils');var config=require(_0x8dad('0x14'));var licenseUtil=require(_0x8dad('0x15'));var db=require(_0x8dad('0x16'))['db'];function respondWithStatusCode(_0xe75e60,_0x3b69b7){_0x3b69b7=_0x3b69b7||0xcc;return function(_0x53d698){if(_0x53d698){return _0xe75e60['sendStatus'](_0x3b69b7);}return _0xe75e60[_0x8dad('0x17')](_0x3b69b7)[_0x8dad('0x18')]();};}function respondWithResult(_0x3175a5,_0x446146){_0x446146=_0x446146||0xc8;return function(_0xe3452e){if(_0xe3452e){return _0x3175a5[_0x8dad('0x17')](_0x446146)[_0x8dad('0x19')](_0xe3452e);}};}function respondWithFilteredResult(_0x24d720,_0x2f86cf){return function(_0x4fc10b){if(_0x4fc10b){var _0x56599b=typeof _0x2f86cf[_0x8dad('0x1a')]===_0x8dad('0x1b')&&typeof _0x2f86cf[_0x8dad('0x1c')]===_0x8dad('0x1b');var _0x1de77c=_0x4fc10b[_0x8dad('0x1d')];var _0x37d572=_0x56599b?0x0:_0x2f86cf[_0x8dad('0x1a')];var _0x631a75=_0x56599b?_0x4fc10b[_0x8dad('0x1d')]:_0x2f86cf[_0x8dad('0x1a')]+_0x2f86cf['limit'];var _0x5c1e78;if(_0x631a75>=_0x1de77c){_0x631a75=_0x1de77c;_0x5c1e78=0xc8;}else{_0x5c1e78=0xce;}_0x24d720[_0x8dad('0x17')](_0x5c1e78);return _0x24d720['set'](_0x8dad('0x1e'),_0x37d572+'-'+_0x631a75+'/'+_0x1de77c)['json'](_0x4fc10b);}return null;};}function patchUpdates(_0x42f807){return function(_0x50bb46){try{jsonpatch['apply'](_0x50bb46,_0x42f807,!![]);}catch(_0x5ac6d6){return BPromise[_0x8dad('0x1f')](_0x5ac6d6);}return _0x50bb46[_0x8dad('0x20')]();};}function saveUpdates(_0x595a96,_0x3519a2){return function(_0x508584){if(_0x508584){return _0x508584[_0x8dad('0x21')](_0x595a96)['then'](function(_0x546851){return _0x546851;});}return null;};}function removeEntity(_0x8a3191,_0x3ae81d){return function(_0x466fa9){if(_0x466fa9){return _0x466fa9[_0x8dad('0x22')]()['then'](function(){_0x8a3191[_0x8dad('0x17')](0xcc)[_0x8dad('0x18')]();});}};}function handleEntityNotFound(_0x5b7881,_0x31275e){return function(_0x1ae933){if(!_0x1ae933){_0x5b7881['sendStatus'](0x194);}return _0x1ae933;};}function handleError(_0x2907c8,_0x11baef){_0x11baef=_0x11baef||0x1f4;return function(_0x45e0d6){logger['error'](_0x45e0d6[_0x8dad('0x23')]);if(_0x45e0d6['name']){delete _0x45e0d6[_0x8dad('0x24')];}_0x2907c8[_0x8dad('0x17')](_0x11baef)[_0x8dad('0x25')](_0x45e0d6);};}exports[_0x8dad('0x26')]=function(_0x2d9321,_0x217633){var _0x5ef2fa={},_0x4835cf={},_0x1e39fa={'count':0x0,'rows':[]};var _0x5788fd=_[_0x8dad('0x27')](db['Automation'][_0x8dad('0x28')],function(_0x2480ac){return{'name':_0x2480ac[_0x8dad('0x29')],'type':_0x2480ac[_0x8dad('0x2a')][_0x8dad('0x2b')]};});_0x4835cf[_0x8dad('0x2c')]=_[_0x8dad('0x27')](_0x5788fd,_0x8dad('0x24'));_0x4835cf[_0x8dad('0x2d')]=_[_0x8dad('0x2e')](_0x2d9321[_0x8dad('0x2d')]);_0x4835cf['filters']=_[_0x8dad('0x2f')](_0x4835cf[_0x8dad('0x2c')],_0x4835cf[_0x8dad('0x2d')]);_0x5ef2fa[_0x8dad('0x30')]=_[_0x8dad('0x2f')](_0x4835cf['model'],qs[_0x8dad('0x31')](_0x2d9321[_0x8dad('0x2d')][_0x8dad('0x31')]));_0x5ef2fa['attributes']=_0x5ef2fa[_0x8dad('0x30')][_0x8dad('0x32')]?_0x5ef2fa['attributes']:_0x4835cf[_0x8dad('0x2c')];if(!_0x2d9321['query'][_0x8dad('0x33')]('nolimit')){_0x5ef2fa[_0x8dad('0x1c')]=qs[_0x8dad('0x1c')](_0x2d9321[_0x8dad('0x2d')][_0x8dad('0x1c')]);_0x5ef2fa[_0x8dad('0x1a')]=qs['offset'](_0x2d9321[_0x8dad('0x2d')]['offset']);}_0x5ef2fa['order']=qs[_0x8dad('0x34')](_0x2d9321['query']['sort']);_0x5ef2fa['where']=qs[_0x8dad('0x35')](_[_0x8dad('0x36')](_0x2d9321['query'],_0x4835cf[_0x8dad('0x35')]),_0x5788fd);if(_0x2d9321[_0x8dad('0x2d')][_0x8dad('0x37')]){_0x5ef2fa[_0x8dad('0x38')]=_[_0x8dad('0x39')](_0x5ef2fa[_0x8dad('0x38')],{'$or':_[_0x8dad('0x27')](_0x5788fd,function(_0x401c6a){if(_0x401c6a[_0x8dad('0x2a')]!=='VIRTUAL'){var _0x14379c={};_0x14379c[_0x401c6a[_0x8dad('0x24')]]={'$like':'%'+_0x2d9321['query'][_0x8dad('0x37')]+'%'};return _0x14379c;}})});}_0x5ef2fa=_['merge']({},_0x5ef2fa,_0x2d9321['options']);var _0x4b4641={'where':_0x5ef2fa[_0x8dad('0x38')]};return db[_0x8dad('0x3a')]['count'](_0x4b4641)[_0x8dad('0x3b')](function(_0xaf1cd6){_0x1e39fa[_0x8dad('0x1d')]=_0xaf1cd6;if(_0x2d9321[_0x8dad('0x2d')][_0x8dad('0x3c')]){_0x5ef2fa['include']=[{'all':!![]}];}return db[_0x8dad('0x3a')][_0x8dad('0x3d')](_0x5ef2fa);})['then'](function(_0x3074f4){_0x1e39fa[_0x8dad('0x3e')]=_0x3074f4;return _0x1e39fa;})[_0x8dad('0x3b')](respondWithFilteredResult(_0x217633,_0x5ef2fa))[_0x8dad('0x3f')](handleError(_0x217633,null));};exports[_0x8dad('0x40')]=function(_0x407ccd,_0x37cce5){var _0x4b01c5={'raw':![],'where':{'id':_0x407ccd['params']['id']}},_0x6f851={};_0x6f851[_0x8dad('0x2c')]=_[_0x8dad('0x2e')](db[_0x8dad('0x3a')][_0x8dad('0x28')]);_0x6f851[_0x8dad('0x2d')]=_[_0x8dad('0x2e')](_0x407ccd[_0x8dad('0x2d')]);_0x6f851[_0x8dad('0x35')]=_[_0x8dad('0x2f')](_0x6f851[_0x8dad('0x2c')],_0x6f851[_0x8dad('0x2d')]);_0x4b01c5[_0x8dad('0x30')]=_['intersection'](_0x6f851[_0x8dad('0x2c')],qs['fields'](_0x407ccd[_0x8dad('0x2d')][_0x8dad('0x31')]));_0x4b01c5[_0x8dad('0x30')]=_0x4b01c5[_0x8dad('0x30')][_0x8dad('0x32')]?_0x4b01c5[_0x8dad('0x30')]:_0x6f851[_0x8dad('0x2c')];if(_0x407ccd[_0x8dad('0x2d')][_0x8dad('0x3c')]){_0x4b01c5[_0x8dad('0x41')]=[{'all':!![]}];}_0x4b01c5=_[_0x8dad('0x39')]({},_0x4b01c5,_0x407ccd[_0x8dad('0x42')]);return db[_0x8dad('0x3a')][_0x8dad('0x43')](_0x4b01c5)[_0x8dad('0x3b')](handleEntityNotFound(_0x37cce5,null))['then'](respondWithResult(_0x37cce5,null))[_0x8dad('0x3f')](handleError(_0x37cce5,null));};exports[_0x8dad('0x44')]=function(_0x4195cb,_0x210f47){return db[_0x8dad('0x3a')][_0x8dad('0x44')](_0x4195cb[_0x8dad('0x45')],{})[_0x8dad('0x3b')](respondWithResult(_0x210f47,0xc9))[_0x8dad('0x3f')](handleError(_0x210f47,null));};exports[_0x8dad('0x21')]=function(_0x55c9d4,_0x48aa9d){if(_0x55c9d4[_0x8dad('0x45')]['id']){delete _0x55c9d4['body']['id'];}return db[_0x8dad('0x3a')][_0x8dad('0x43')]({'where':{'id':_0x55c9d4['params']['id']}})[_0x8dad('0x3b')](handleEntityNotFound(_0x48aa9d,null))['then'](saveUpdates(_0x55c9d4[_0x8dad('0x45')],null))[_0x8dad('0x3b')](respondWithResult(_0x48aa9d,null))[_0x8dad('0x3f')](handleError(_0x48aa9d,null));};exports[_0x8dad('0x22')]=function(_0x352ce5,_0x409707){return db['Automation'][_0x8dad('0x43')]({'where':{'id':_0x352ce5['params']['id']}})[_0x8dad('0x3b')](handleEntityNotFound(_0x409707,null))[_0x8dad('0x3b')](removeEntity(_0x409707,null))[_0x8dad('0x3f')](handleError(_0x409707,null));};exports[_0x8dad('0x46')]=function(_0x512a27,_0x6cba36,_0x58521f){return db['Condition'][_0x8dad('0x43')]({'where':{'id':_0x512a27[_0x8dad('0x47')]['id']}})[_0x8dad('0x3b')](handleEntityNotFound(_0x6cba36,null))['then'](function(_0x5aac05){if(_0x5aac05){return _0x5aac05[_0x8dad('0x46')](_0x512a27[_0x8dad('0x45')]['ids'],_[_0x8dad('0x48')](_0x512a27['body'],[_0x8dad('0x49'),'id'])||{});}})['then'](respondWithResult(_0x6cba36,null))[_0x8dad('0x3f')](handleError(_0x6cba36,null));};exports[_0x8dad('0x4a')]=function(_0x3d7257,_0x472347,_0x10230c){var _0x4e55df={};var _0x112b81={};var _0xe595f6;var _0x2e4dc7;return db[_0x8dad('0x3a')][_0x8dad('0x4b')]({'where':{'id':_0x3d7257['params']['id']}})[_0x8dad('0x3b')](handleEntityNotFound(_0x472347,null))['then'](function(_0x5c8219){if(_0x5c8219){_0xe595f6=_0x5c8219;_0x112b81[_0x8dad('0x2c')]=_[_0x8dad('0x2e')](db[_0x8dad('0x4c')][_0x8dad('0x28')]);_0x112b81['query']=_[_0x8dad('0x2e')](_0x3d7257[_0x8dad('0x2d')]);_0x112b81['filters']=_[_0x8dad('0x2f')](_0x112b81['model'],_0x112b81[_0x8dad('0x2d')]);_0x4e55df['attributes']=_[_0x8dad('0x2f')](_0x112b81[_0x8dad('0x2c')],qs[_0x8dad('0x31')](_0x3d7257[_0x8dad('0x2d')][_0x8dad('0x31')]));_0x4e55df[_0x8dad('0x30')]=_0x4e55df['attributes'][_0x8dad('0x32')]?_0x4e55df[_0x8dad('0x30')]:_0x112b81['model'];_0x4e55df[_0x8dad('0x4d')]=qs['sort'](_0x3d7257[_0x8dad('0x2d')]['sort']);_0x4e55df['where']=qs['filters'](_[_0x8dad('0x36')](_0x3d7257['query'],_0x112b81[_0x8dad('0x35')]));if(_0x3d7257[_0x8dad('0x2d')][_0x8dad('0x37')]){_0x4e55df[_0x8dad('0x38')]=_['merge'](_0x4e55df[_0x8dad('0x38')],{'$or':_[_0x8dad('0x27')](_0x4e55df[_0x8dad('0x30')],function(_0x1deb83){var _0x322c5b={};_0x322c5b[_0x1deb83]={'$like':'%'+_0x3d7257[_0x8dad('0x2d')]['filter']+'%'};return _0x322c5b;})});}_0x4e55df=_['merge']({},_0x4e55df,_0x3d7257[_0x8dad('0x42')]);return _0xe595f6[_0x8dad('0x4a')](_0x4e55df);}})[_0x8dad('0x3b')](function(_0x4b33b0){if(_0x4b33b0){_0x2e4dc7=_0x4b33b0[_0x8dad('0x32')];if(!_0x3d7257[_0x8dad('0x2d')][_0x8dad('0x33')](_0x8dad('0x4e'))){_0x4e55df[_0x8dad('0x1c')]=qs[_0x8dad('0x1c')](_0x3d7257['query'][_0x8dad('0x1c')]);_0x4e55df[_0x8dad('0x1a')]=qs[_0x8dad('0x1a')](_0x3d7257[_0x8dad('0x2d')]['offset']);}return _0xe595f6[_0x8dad('0x4a')](_0x4e55df);}})[_0x8dad('0x3b')](function(_0x2c9e43){if(_0x2c9e43){return _0x2c9e43?{'count':_0x2e4dc7,'rows':_0x2c9e43}:null;}})[_0x8dad('0x3b')](respondWithResult(_0x472347,null))['catch'](handleError(_0x472347,null));};exports['addActions']=function(_0x22fbb5,_0x1f2932,_0x2973c4){return db[_0x8dad('0x4f')]['find']({'where':{'id':_0x22fbb5[_0x8dad('0x47')]['id']}})['then'](handleEntityNotFound(_0x1f2932,null))[_0x8dad('0x3b')](function(_0x5ef534){if(_0x5ef534){return _0x5ef534[_0x8dad('0x50')](_0x22fbb5['body'][_0x8dad('0x49')],_[_0x8dad('0x48')](_0x22fbb5[_0x8dad('0x45')],['ids','id'])||{});}})[_0x8dad('0x3b')](respondWithResult(_0x1f2932,null))['catch'](handleError(_0x1f2932,null));};exports[_0x8dad('0x51')]=function(_0x18126a,_0x544478,_0x17840c){var _0x4e4fcf={};var _0x3e02fe={};var _0x20ace8;var _0x40cb0a;return db[_0x8dad('0x3a')]['findOne']({'where':{'id':_0x18126a[_0x8dad('0x47')]['id']}})[_0x8dad('0x3b')](handleEntityNotFound(_0x544478,null))[_0x8dad('0x3b')](function(_0x27d6e7){if(_0x27d6e7){_0x20ace8=_0x27d6e7;_0x3e02fe[_0x8dad('0x2c')]=_[_0x8dad('0x2e')](db[_0x8dad('0x4f')][_0x8dad('0x28')]);_0x3e02fe[_0x8dad('0x2d')]=_[_0x8dad('0x2e')](_0x18126a[_0x8dad('0x2d')]);_0x3e02fe[_0x8dad('0x35')]=_[_0x8dad('0x2f')](_0x3e02fe['model'],_0x3e02fe[_0x8dad('0x2d')]);_0x4e4fcf[_0x8dad('0x30')]=_['intersection'](_0x3e02fe[_0x8dad('0x2c')],qs[_0x8dad('0x31')](_0x18126a[_0x8dad('0x2d')][_0x8dad('0x31')]));_0x4e4fcf[_0x8dad('0x30')]=_0x4e4fcf[_0x8dad('0x30')][_0x8dad('0x32')]?_0x4e4fcf[_0x8dad('0x30')]:_0x3e02fe['model'];_0x4e4fcf[_0x8dad('0x4d')]=qs[_0x8dad('0x34')](_0x18126a[_0x8dad('0x2d')][_0x8dad('0x34')]);_0x4e4fcf[_0x8dad('0x38')]=qs['filters'](_[_0x8dad('0x36')](_0x18126a[_0x8dad('0x2d')],_0x3e02fe[_0x8dad('0x35')]));if(_0x18126a[_0x8dad('0x2d')]['filter']){_0x4e4fcf['where']=_[_0x8dad('0x39')](_0x4e4fcf[_0x8dad('0x38')],{'$or':_[_0x8dad('0x27')](_0x4e4fcf[_0x8dad('0x30')],function(_0x542668){var _0x5e6311={};_0x5e6311[_0x542668]={'$like':'%'+_0x18126a['query']['filter']+'%'};return _0x5e6311;})});}_0x4e4fcf=_[_0x8dad('0x39')]({},_0x4e4fcf,_0x18126a[_0x8dad('0x42')]);return _0x20ace8[_0x8dad('0x51')](_0x4e4fcf);}})[_0x8dad('0x3b')](function(_0x512258){if(_0x512258){_0x40cb0a=_0x512258['length'];if(!_0x18126a['query'][_0x8dad('0x33')]('nolimit')){_0x4e4fcf[_0x8dad('0x1c')]=qs['limit'](_0x18126a[_0x8dad('0x2d')][_0x8dad('0x1c')]);_0x4e4fcf[_0x8dad('0x1a')]=qs[_0x8dad('0x1a')](_0x18126a[_0x8dad('0x2d')][_0x8dad('0x1a')]);}return _0x20ace8[_0x8dad('0x51')](_0x4e4fcf);}})[_0x8dad('0x3b')](function(_0x58d0ec){if(_0x58d0ec){return _0x58d0ec?{'count':_0x40cb0a,'rows':_0x58d0ec}:null;}})['then'](respondWithResult(_0x544478,null))[_0x8dad('0x3f')](handleError(_0x544478,null));}; \ No newline at end of file +var _0x2e06=['status','json','offset','undefined','limit','count','set','Content-Range','apply','save','update','then','destroy','sendStatus','stack','name','send','index','Automation','rawAttributes','fieldName','type','key','keys','filters','query','attributes','model','fields','length','order','sort','pick','filter','map','VIRTUAL','options','where','includeAll','include','rows','catch','params','intersection','find','create','body','addConditions','Condition','ids','getConditions','merge','hasOwnProperty','addActions','Action','omit','getActions','nolimit','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','to-csv','ejs','fs-extra','squel','crypto','desk.js','papaparse','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/license/util','../../mysqldb'];(function(_0x2f45ea,_0x15c656){var _0x485a84=function(_0x4a1fe3){while(--_0x4a1fe3){_0x2f45ea['push'](_0x2f45ea['shift']());}};_0x485a84(++_0x15c656);}(_0x2e06,0x127));var _0x62e0=function(_0x1dd96b,_0x16b165){_0x1dd96b=_0x1dd96b-0x0;var _0x30acac=_0x2e06[_0x1dd96b];return _0x30acac;};'use strict';var emlformat=require(_0x62e0('0x0'));var rimraf=require(_0x62e0('0x1'));var zipdir=require(_0x62e0('0x2'));var jsonpatch=require(_0x62e0('0x3'));var rp=require(_0x62e0('0x4'));var moment=require(_0x62e0('0x5'));var BPromise=require(_0x62e0('0x6'));var Mustache=require(_0x62e0('0x7'));var util=require('util');var path=require('path');var sox=require('sox');var csv=require(_0x62e0('0x8'));var ejs=require(_0x62e0('0x9'));var fs=require('fs');var fs_extra=require(_0x62e0('0xa'));var _=require('lodash');var squel=require(_0x62e0('0xb'));var crypto=require(_0x62e0('0xc'));var jsforce=require('jsforce');var deskjs=require(_0x62e0('0xd'));var toCsv=require(_0x62e0('0x8'));var querystring=require('querystring');var Papa=require(_0x62e0('0xe'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0x62e0('0xf'));var hardwareService=require(_0x62e0('0x10'));var logger=require(_0x62e0('0x11'))('api');var utils=require(_0x62e0('0x12'));var config=require('../../config/environment');var licenseUtil=require(_0x62e0('0x13'));var db=require(_0x62e0('0x14'))['db'];function respondWithStatusCode(_0x279156,_0x36cb03){_0x36cb03=_0x36cb03||0xcc;return function(_0x3f806b){if(_0x3f806b){return _0x279156['sendStatus'](_0x36cb03);}return _0x279156[_0x62e0('0x15')](_0x36cb03)['end']();};}function respondWithResult(_0x58cc05,_0x4c875c){_0x4c875c=_0x4c875c||0xc8;return function(_0x183884){if(_0x183884){return _0x58cc05['status'](_0x4c875c)[_0x62e0('0x16')](_0x183884);}};}function respondWithFilteredResult(_0x53f130,_0x2b2865){return function(_0x4d32f2){if(_0x4d32f2){var _0x36f743=typeof _0x2b2865[_0x62e0('0x17')]===_0x62e0('0x18')&&typeof _0x2b2865[_0x62e0('0x19')]===_0x62e0('0x18');var _0x49ff16=_0x4d32f2[_0x62e0('0x1a')];var _0x1aef15=_0x36f743?0x0:_0x2b2865[_0x62e0('0x17')];var _0x5dc1b0=_0x36f743?_0x4d32f2['count']:_0x2b2865['offset']+_0x2b2865[_0x62e0('0x19')];var _0x26cc8c;if(_0x5dc1b0>=_0x49ff16){_0x5dc1b0=_0x49ff16;_0x26cc8c=0xc8;}else{_0x26cc8c=0xce;}_0x53f130['status'](_0x26cc8c);return _0x53f130[_0x62e0('0x1b')](_0x62e0('0x1c'),_0x1aef15+'-'+_0x5dc1b0+'/'+_0x49ff16)['json'](_0x4d32f2);}return null;};}function patchUpdates(_0x135de0){return function(_0x242b4a){try{jsonpatch[_0x62e0('0x1d')](_0x242b4a,_0x135de0,!![]);}catch(_0x2aa39a){return BPromise['reject'](_0x2aa39a);}return _0x242b4a[_0x62e0('0x1e')]();};}function saveUpdates(_0xafa809,_0x9f6c8d){return function(_0x4e5641){if(_0x4e5641){return _0x4e5641[_0x62e0('0x1f')](_0xafa809)[_0x62e0('0x20')](function(_0x3dcf77){return _0x3dcf77;});}return null;};}function removeEntity(_0x1efbc3,_0x1ec951){return function(_0x70f221){if(_0x70f221){return _0x70f221[_0x62e0('0x21')]()[_0x62e0('0x20')](function(){_0x1efbc3[_0x62e0('0x15')](0xcc)['end']();});}};}function handleEntityNotFound(_0x4d1156,_0x367649){return function(_0x19a33a){if(!_0x19a33a){_0x4d1156[_0x62e0('0x22')](0x194);}return _0x19a33a;};}function handleError(_0x30d478,_0x344569){_0x344569=_0x344569||0x1f4;return function(_0x18183c){logger['error'](_0x18183c[_0x62e0('0x23')]);if(_0x18183c[_0x62e0('0x24')]){delete _0x18183c[_0x62e0('0x24')];}_0x30d478['status'](_0x344569)[_0x62e0('0x25')](_0x18183c);};}exports[_0x62e0('0x26')]=function(_0x15ffbc,_0x44d745){var _0xdcddaf={},_0x64e8de={},_0x5275bf={'count':0x0,'rows':[]};var _0x2d4016=_['map'](db[_0x62e0('0x27')][_0x62e0('0x28')],function(_0x5d8f9e){return{'name':_0x5d8f9e[_0x62e0('0x29')],'type':_0x5d8f9e[_0x62e0('0x2a')][_0x62e0('0x2b')]};});_0x64e8de['model']=_['map'](_0x2d4016,_0x62e0('0x24'));_0x64e8de['query']=_[_0x62e0('0x2c')](_0x15ffbc['query']);_0x64e8de[_0x62e0('0x2d')]=_['intersection'](_0x64e8de['model'],_0x64e8de[_0x62e0('0x2e')]);_0xdcddaf[_0x62e0('0x2f')]=_['intersection'](_0x64e8de[_0x62e0('0x30')],qs['fields'](_0x15ffbc[_0x62e0('0x2e')][_0x62e0('0x31')]));_0xdcddaf[_0x62e0('0x2f')]=_0xdcddaf[_0x62e0('0x2f')][_0x62e0('0x32')]?_0xdcddaf[_0x62e0('0x2f')]:_0x64e8de[_0x62e0('0x30')];if(!_0x15ffbc[_0x62e0('0x2e')]['hasOwnProperty']('nolimit')){_0xdcddaf[_0x62e0('0x19')]=qs['limit'](_0x15ffbc[_0x62e0('0x2e')][_0x62e0('0x19')]);_0xdcddaf[_0x62e0('0x17')]=qs[_0x62e0('0x17')](_0x15ffbc[_0x62e0('0x2e')][_0x62e0('0x17')]);}_0xdcddaf[_0x62e0('0x33')]=qs[_0x62e0('0x34')](_0x15ffbc['query'][_0x62e0('0x34')]);_0xdcddaf['where']=qs[_0x62e0('0x2d')](_[_0x62e0('0x35')](_0x15ffbc[_0x62e0('0x2e')],_0x64e8de['filters']),_0x2d4016);if(_0x15ffbc[_0x62e0('0x2e')][_0x62e0('0x36')]){_0xdcddaf['where']=_['merge'](_0xdcddaf['where'],{'$or':_[_0x62e0('0x37')](_0x2d4016,function(_0x519ae5){if(_0x519ae5['type']!==_0x62e0('0x38')){var _0x5dcd03={};_0x5dcd03[_0x519ae5['name']]={'$like':'%'+_0x15ffbc['query']['filter']+'%'};return _0x5dcd03;}})});}_0xdcddaf=_['merge']({},_0xdcddaf,_0x15ffbc[_0x62e0('0x39')]);var _0x11ac98={'where':_0xdcddaf[_0x62e0('0x3a')]};return db[_0x62e0('0x27')][_0x62e0('0x1a')](_0x11ac98)[_0x62e0('0x20')](function(_0x50e61a){_0x5275bf[_0x62e0('0x1a')]=_0x50e61a;if(_0x15ffbc[_0x62e0('0x2e')][_0x62e0('0x3b')]){_0xdcddaf[_0x62e0('0x3c')]=[{'all':!![]}];}return db[_0x62e0('0x27')]['findAll'](_0xdcddaf);})[_0x62e0('0x20')](function(_0x1d7c05){_0x5275bf[_0x62e0('0x3d')]=_0x1d7c05;return _0x5275bf;})['then'](respondWithFilteredResult(_0x44d745,_0xdcddaf))[_0x62e0('0x3e')](handleError(_0x44d745,null));};exports['show']=function(_0x450968,_0x39085c){var _0x34bb7a={'raw':![],'where':{'id':_0x450968[_0x62e0('0x3f')]['id']}},_0x557155={};_0x557155[_0x62e0('0x30')]=_[_0x62e0('0x2c')](db[_0x62e0('0x27')][_0x62e0('0x28')]);_0x557155[_0x62e0('0x2e')]=_[_0x62e0('0x2c')](_0x450968[_0x62e0('0x2e')]);_0x557155[_0x62e0('0x2d')]=_[_0x62e0('0x40')](_0x557155[_0x62e0('0x30')],_0x557155[_0x62e0('0x2e')]);_0x34bb7a[_0x62e0('0x2f')]=_[_0x62e0('0x40')](_0x557155[_0x62e0('0x30')],qs[_0x62e0('0x31')](_0x450968[_0x62e0('0x2e')][_0x62e0('0x31')]));_0x34bb7a[_0x62e0('0x2f')]=_0x34bb7a['attributes']['length']?_0x34bb7a[_0x62e0('0x2f')]:_0x557155['model'];if(_0x450968[_0x62e0('0x2e')]['includeAll']){_0x34bb7a['include']=[{'all':!![]}];}_0x34bb7a=_['merge']({},_0x34bb7a,_0x450968[_0x62e0('0x39')]);return db[_0x62e0('0x27')][_0x62e0('0x41')](_0x34bb7a)[_0x62e0('0x20')](handleEntityNotFound(_0x39085c,null))[_0x62e0('0x20')](respondWithResult(_0x39085c,null))['catch'](handleError(_0x39085c,null));};exports[_0x62e0('0x42')]=function(_0x495763,_0x394fab){return db[_0x62e0('0x27')][_0x62e0('0x42')](_0x495763[_0x62e0('0x43')],{})[_0x62e0('0x20')](respondWithResult(_0x394fab,0xc9))['catch'](handleError(_0x394fab,null));};exports['update']=function(_0x1d5b2f,_0x29ef0e){if(_0x1d5b2f['body']['id']){delete _0x1d5b2f[_0x62e0('0x43')]['id'];}return db['Automation']['find']({'where':{'id':_0x1d5b2f[_0x62e0('0x3f')]['id']}})['then'](handleEntityNotFound(_0x29ef0e,null))[_0x62e0('0x20')](saveUpdates(_0x1d5b2f[_0x62e0('0x43')],null))[_0x62e0('0x20')](respondWithResult(_0x29ef0e,null))[_0x62e0('0x3e')](handleError(_0x29ef0e,null));};exports['destroy']=function(_0x3727cb,_0x3dac7c){return db['Automation'][_0x62e0('0x41')]({'where':{'id':_0x3727cb['params']['id']}})[_0x62e0('0x20')](handleEntityNotFound(_0x3dac7c,null))['then'](removeEntity(_0x3dac7c,null))[_0x62e0('0x3e')](handleError(_0x3dac7c,null));};exports[_0x62e0('0x44')]=function(_0x1ae8b0,_0x32db4a,_0x4afed4){return db[_0x62e0('0x45')][_0x62e0('0x41')]({'where':{'id':_0x1ae8b0[_0x62e0('0x3f')]['id']}})[_0x62e0('0x20')](handleEntityNotFound(_0x32db4a,null))[_0x62e0('0x20')](function(_0x29a07e){if(_0x29a07e){return _0x29a07e[_0x62e0('0x44')](_0x1ae8b0[_0x62e0('0x43')][_0x62e0('0x46')],_['omit'](_0x1ae8b0[_0x62e0('0x43')],['ids','id'])||{});}})[_0x62e0('0x20')](respondWithResult(_0x32db4a,null))[_0x62e0('0x3e')](handleError(_0x32db4a,null));};exports[_0x62e0('0x47')]=function(_0x3b311c,_0x4441e9,_0x347fd6){var _0x5cf187={};var _0x1d9317={};var _0xc606d5;var _0x390cd;return db['Automation']['findOne']({'where':{'id':_0x3b311c['params']['id']}})[_0x62e0('0x20')](handleEntityNotFound(_0x4441e9,null))[_0x62e0('0x20')](function(_0x1ade4e){if(_0x1ade4e){_0xc606d5=_0x1ade4e;_0x1d9317[_0x62e0('0x30')]=_[_0x62e0('0x2c')](db[_0x62e0('0x45')][_0x62e0('0x28')]);_0x1d9317[_0x62e0('0x2e')]=_['keys'](_0x3b311c[_0x62e0('0x2e')]);_0x1d9317['filters']=_[_0x62e0('0x40')](_0x1d9317[_0x62e0('0x30')],_0x1d9317[_0x62e0('0x2e')]);_0x5cf187[_0x62e0('0x2f')]=_[_0x62e0('0x40')](_0x1d9317[_0x62e0('0x30')],qs[_0x62e0('0x31')](_0x3b311c[_0x62e0('0x2e')]['fields']));_0x5cf187[_0x62e0('0x2f')]=_0x5cf187['attributes'][_0x62e0('0x32')]?_0x5cf187[_0x62e0('0x2f')]:_0x1d9317[_0x62e0('0x30')];_0x5cf187[_0x62e0('0x33')]=qs[_0x62e0('0x34')](_0x3b311c[_0x62e0('0x2e')][_0x62e0('0x34')]);_0x5cf187[_0x62e0('0x3a')]=qs[_0x62e0('0x2d')](_['pick'](_0x3b311c[_0x62e0('0x2e')],_0x1d9317['filters']));if(_0x3b311c[_0x62e0('0x2e')][_0x62e0('0x36')]){_0x5cf187['where']=_['merge'](_0x5cf187['where'],{'$or':_['map'](_0x5cf187[_0x62e0('0x2f')],function(_0x3e42eb){var _0xfda66c={};_0xfda66c[_0x3e42eb]={'$like':'%'+_0x3b311c['query']['filter']+'%'};return _0xfda66c;})});}_0x5cf187=_[_0x62e0('0x48')]({},_0x5cf187,_0x3b311c[_0x62e0('0x39')]);return _0xc606d5[_0x62e0('0x47')](_0x5cf187);}})['then'](function(_0x3780f5){if(_0x3780f5){_0x390cd=_0x3780f5[_0x62e0('0x32')];if(!_0x3b311c['query'][_0x62e0('0x49')]('nolimit')){_0x5cf187[_0x62e0('0x19')]=qs[_0x62e0('0x19')](_0x3b311c[_0x62e0('0x2e')][_0x62e0('0x19')]);_0x5cf187[_0x62e0('0x17')]=qs[_0x62e0('0x17')](_0x3b311c[_0x62e0('0x2e')][_0x62e0('0x17')]);}return _0xc606d5[_0x62e0('0x47')](_0x5cf187);}})[_0x62e0('0x20')](function(_0x1b36ac){if(_0x1b36ac){return _0x1b36ac?{'count':_0x390cd,'rows':_0x1b36ac}:null;}})[_0x62e0('0x20')](respondWithResult(_0x4441e9,null))[_0x62e0('0x3e')](handleError(_0x4441e9,null));};exports[_0x62e0('0x4a')]=function(_0x4e9a64,_0xca96c9,_0x402cf9){return db[_0x62e0('0x4b')][_0x62e0('0x41')]({'where':{'id':_0x4e9a64[_0x62e0('0x3f')]['id']}})[_0x62e0('0x20')](handleEntityNotFound(_0xca96c9,null))['then'](function(_0x2e24b5){if(_0x2e24b5){return _0x2e24b5[_0x62e0('0x4a')](_0x4e9a64[_0x62e0('0x43')][_0x62e0('0x46')],_[_0x62e0('0x4c')](_0x4e9a64[_0x62e0('0x43')],[_0x62e0('0x46'),'id'])||{});}})[_0x62e0('0x20')](respondWithResult(_0xca96c9,null))[_0x62e0('0x3e')](handleError(_0xca96c9,null));};exports[_0x62e0('0x4d')]=function(_0x519712,_0xab07da,_0x44242b){var _0x40dc72={};var _0xfff876={};var _0xa08766;var _0x49851d;return db[_0x62e0('0x27')]['findOne']({'where':{'id':_0x519712['params']['id']}})[_0x62e0('0x20')](handleEntityNotFound(_0xab07da,null))[_0x62e0('0x20')](function(_0x494c65){if(_0x494c65){_0xa08766=_0x494c65;_0xfff876[_0x62e0('0x30')]=_[_0x62e0('0x2c')](db['Action'][_0x62e0('0x28')]);_0xfff876[_0x62e0('0x2e')]=_['keys'](_0x519712[_0x62e0('0x2e')]);_0xfff876[_0x62e0('0x2d')]=_['intersection'](_0xfff876[_0x62e0('0x30')],_0xfff876[_0x62e0('0x2e')]);_0x40dc72[_0x62e0('0x2f')]=_[_0x62e0('0x40')](_0xfff876[_0x62e0('0x30')],qs[_0x62e0('0x31')](_0x519712[_0x62e0('0x2e')][_0x62e0('0x31')]));_0x40dc72[_0x62e0('0x2f')]=_0x40dc72['attributes'][_0x62e0('0x32')]?_0x40dc72[_0x62e0('0x2f')]:_0xfff876[_0x62e0('0x30')];_0x40dc72[_0x62e0('0x33')]=qs['sort'](_0x519712[_0x62e0('0x2e')][_0x62e0('0x34')]);_0x40dc72[_0x62e0('0x3a')]=qs[_0x62e0('0x2d')](_[_0x62e0('0x35')](_0x519712['query'],_0xfff876['filters']));if(_0x519712[_0x62e0('0x2e')][_0x62e0('0x36')]){_0x40dc72[_0x62e0('0x3a')]=_[_0x62e0('0x48')](_0x40dc72[_0x62e0('0x3a')],{'$or':_[_0x62e0('0x37')](_0x40dc72[_0x62e0('0x2f')],function(_0x1c3d04){var _0x4da5a6={};_0x4da5a6[_0x1c3d04]={'$like':'%'+_0x519712[_0x62e0('0x2e')][_0x62e0('0x36')]+'%'};return _0x4da5a6;})});}_0x40dc72=_[_0x62e0('0x48')]({},_0x40dc72,_0x519712[_0x62e0('0x39')]);return _0xa08766['getActions'](_0x40dc72);}})['then'](function(_0x18d49b){if(_0x18d49b){_0x49851d=_0x18d49b[_0x62e0('0x32')];if(!_0x519712[_0x62e0('0x2e')][_0x62e0('0x49')](_0x62e0('0x4e'))){_0x40dc72[_0x62e0('0x19')]=qs[_0x62e0('0x19')](_0x519712[_0x62e0('0x2e')]['limit']);_0x40dc72['offset']=qs['offset'](_0x519712[_0x62e0('0x2e')][_0x62e0('0x17')]);}return _0xa08766[_0x62e0('0x4d')](_0x40dc72);}})[_0x62e0('0x20')](function(_0x208418){if(_0x208418){return _0x208418?{'count':_0x49851d,'rows':_0x208418}:null;}})['then'](respondWithResult(_0xab07da,null))[_0x62e0('0x3e')](handleError(_0xab07da,null));}; \ No newline at end of file diff --git a/server/api/automation/automation.model.js b/server/api/automation/automation.model.js index 3e1ba5b..56ba86d 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 _0x88d8=['rimraf','./automation.attributes','exports','Automation','tools_automations','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path'];(function(_0x24bdf6,_0x3ccdf6){var _0x4bba55=function(_0x153765){while(--_0x153765){_0x24bdf6['push'](_0x24bdf6['shift']());}};_0x4bba55(++_0x3ccdf6);}(_0x88d8,0x1e6));var _0x888d=function(_0x3d248e,_0xb9500e){_0x3d248e=_0x3d248e-0x0;var _0x292c43=_0x88d8[_0x3d248e];return _0x292c43;};'use strict';var _=require(_0x888d('0x0'));var util=require(_0x888d('0x1'));var logger=require(_0x888d('0x2'))(_0x888d('0x3'));var moment=require(_0x888d('0x4'));var BPromise=require(_0x888d('0x5'));var rp=require(_0x888d('0x6'));var fs=require('fs');var path=require(_0x888d('0x7'));var rimraf=require(_0x888d('0x8'));var config=require('../../config/environment');var attributes=require(_0x888d('0x9'));module[_0x888d('0xa')]=function(_0x9c661d,_0x1d93cf){return _0x9c661d['define'](_0x888d('0xb'),attributes,{'tableName':_0x888d('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x5519=['exports','define','Automation','tools_automations','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf'];(function(_0x5e2b5c,_0x36a0d5){var _0x18ea5a=function(_0x4f4455){while(--_0x4f4455){_0x5e2b5c['push'](_0x5e2b5c['shift']());}};_0x18ea5a(++_0x36a0d5);}(_0x5519,0x18a));var _0x9551=function(_0x3256bc,_0x957b5c){_0x3256bc=_0x3256bc-0x0;var _0x51f4b7=_0x5519[_0x3256bc];return _0x51f4b7;};'use strict';var _=require(_0x9551('0x0'));var util=require(_0x9551('0x1'));var logger=require(_0x9551('0x2'))(_0x9551('0x3'));var moment=require(_0x9551('0x4'));var BPromise=require(_0x9551('0x5'));var rp=require(_0x9551('0x6'));var fs=require('fs');var path=require(_0x9551('0x7'));var rimraf=require(_0x9551('0x8'));var config=require('../../config/environment');var attributes=require('./automation.attributes');module[_0x9551('0x9')]=function(_0x287358,_0x44ae32){return _0x287358[_0x9551('0xa')](_0x9551('0xb'),attributes,{'tableName':_0x9551('0xc'),'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 8b47045..dfbc7eb 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 _0x3c85=['../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','then','debug','stringify','error','code','message','Automation,\x20%s,\x20%s','info','request\x20sent','result','catch','lodash','util','moment','bluebird'];(function(_0x1b3a5c,_0x2f9d5f){var _0x2ae8cb=function(_0x549ab8){while(--_0x549ab8){_0x1b3a5c['push'](_0x1b3a5c['shift']());}};_0x2ae8cb(++_0x2f9d5f);}(_0x3c85,0x1a0));var _0x53c8=function(_0x27a2bf,_0x18d0cf){_0x27a2bf=_0x27a2bf-0x0;var _0x53a201=_0x3c85[_0x27a2bf];return _0x53a201;};'use strict';var _=require(_0x53c8('0x0'));var util=require(_0x53c8('0x1'));var moment=require(_0x53c8('0x2'));var BPromise=require(_0x53c8('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x53c8('0x4'))['db'];var utils=require(_0x53c8('0x5'));var logger=require(_0x53c8('0x6'))('rpc');var config=require(_0x53c8('0x7'));var jayson=require(_0x53c8('0x8'));var client=jayson[_0x53c8('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x5271ad,_0x4bc6ae,_0x4bb757){return new BPromise(function(_0x7d5c2a,_0x4de781){return client['request'](_0x5271ad,_0x4bb757)[_0x53c8('0xa')](function(_0x19504c){logger['info']('Automation,\x20%s,\x20%s',_0x4bc6ae,'request\x20sent');logger[_0x53c8('0xb')]('Automation,\x20%s,\x20%s,\x20%s',_0x4bc6ae,'request\x20sent',JSON[_0x53c8('0xc')](_0x19504c));if(_0x19504c[_0x53c8('0xd')]){if(_0x19504c[_0x53c8('0xd')][_0x53c8('0xe')]===0x1f4){logger[_0x53c8('0xd')]('Automation,\x20%s,\x20%s',_0x4bc6ae,_0x19504c[_0x53c8('0xd')][_0x53c8('0xf')]);return _0x4de781(_0x19504c[_0x53c8('0xd')]['message']);}logger[_0x53c8('0xd')](_0x53c8('0x10'),_0x4bc6ae,_0x19504c['error'][_0x53c8('0xf')]);return _0x7d5c2a(_0x19504c[_0x53c8('0xd')][_0x53c8('0xf')]);}else{logger[_0x53c8('0x11')](_0x53c8('0x10'),_0x4bc6ae,_0x53c8('0x12'));_0x7d5c2a(_0x19504c[_0x53c8('0x13')][_0x53c8('0xf')]);}})[_0x53c8('0x14')](function(_0x8a7c46){logger[_0x53c8('0xd')](_0x53c8('0x10'),_0x4bc6ae,_0x8a7c46);_0x4de781(_0x8a7c46);});});} \ No newline at end of file +var _0x4c99=['debug','stringify','error','code','message','result','lodash','moment','../../mysqldb','../../config/utils','rpc','../../config/environment','client','request','then','info','Automation,\x20%s,\x20%s','request\x20sent'];(function(_0x5008cb,_0xa1d455){var _0x401a0c=function(_0x5e940a){while(--_0x5e940a){_0x5008cb['push'](_0x5008cb['shift']());}};_0x401a0c(++_0xa1d455);}(_0x4c99,0x1ec));var _0x94c9=function(_0x5d6456,_0x58ecc7){_0x5d6456=_0x5d6456-0x0;var _0x4d66c1=_0x4c99[_0x5d6456];return _0x4d66c1;};'use strict';var _=require(_0x94c9('0x0'));var util=require('util');var moment=require(_0x94c9('0x1'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x94c9('0x2'))['db'];var utils=require(_0x94c9('0x3'));var logger=require('../../config/logger')(_0x94c9('0x4'));var config=require(_0x94c9('0x5'));var jayson=require('jayson/promise');var client=jayson[_0x94c9('0x6')]['http']({'port':0x232a});function respondWithRpcPromise(_0x4ebd2b,_0x49b85b,_0x23d961){return new BPromise(function(_0x4403ba,_0x3a1743){return client[_0x94c9('0x7')](_0x4ebd2b,_0x23d961)[_0x94c9('0x8')](function(_0x1c0983){logger[_0x94c9('0x9')](_0x94c9('0xa'),_0x49b85b,_0x94c9('0xb'));logger[_0x94c9('0xc')]('Automation,\x20%s,\x20%s,\x20%s',_0x49b85b,_0x94c9('0xb'),JSON[_0x94c9('0xd')](_0x1c0983));if(_0x1c0983[_0x94c9('0xe')]){if(_0x1c0983['error'][_0x94c9('0xf')]===0x1f4){logger[_0x94c9('0xe')](_0x94c9('0xa'),_0x49b85b,_0x1c0983[_0x94c9('0xe')][_0x94c9('0x10')]);return _0x3a1743(_0x1c0983[_0x94c9('0xe')][_0x94c9('0x10')]);}logger[_0x94c9('0xe')]('Automation,\x20%s,\x20%s',_0x49b85b,_0x1c0983['error']['message']);return _0x4403ba(_0x1c0983[_0x94c9('0xe')][_0x94c9('0x10')]);}else{logger['info'](_0x94c9('0xa'),_0x49b85b,_0x94c9('0xb'));_0x4403ba(_0x1c0983[_0x94c9('0x11')]['message']);}})['catch'](function(_0x447937){logger[_0x94c9('0xe')](_0x94c9('0xa'),_0x49b85b,_0x447937);_0x3a1743(_0x447937);});});} \ No newline at end of file diff --git a/server/api/automation/index.js b/server/api/automation/index.js index 0c32ca8..ffd9b84 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 _0x94ca=['isAuthenticated','/:id','show','/:id/actions','getActions','post','create','/:id/conditions','addActions','put','update','delete','destroy','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./automation.controller','get'];(function(_0x53b7ff,_0x280fa1){var _0x5f0222=function(_0x357f47){while(--_0x357f47){_0x53b7ff['push'](_0x53b7ff['shift']());}};_0x5f0222(++_0x280fa1);}(_0x94ca,0xde));var _0xa94c=function(_0x5d4dd7,_0x38229c){_0x5d4dd7=_0x5d4dd7-0x0;var _0x2ce0ad=_0x94ca[_0x5d4dd7];return _0x2ce0ad;};'use strict';var multer=require(_0xa94c('0x0'));var util=require(_0xa94c('0x1'));var path=require(_0xa94c('0x2'));var timeout=require(_0xa94c('0x3'));var express=require(_0xa94c('0x4'));var router=express[_0xa94c('0x5')]();var fs_extra=require(_0xa94c('0x6'));var auth=require(_0xa94c('0x7'));var interaction=require(_0xa94c('0x8'));var config=require(_0xa94c('0x9'));var controller=require(_0xa94c('0xa'));router[_0xa94c('0xb')]('/',auth[_0xa94c('0xc')](),controller['index']);router[_0xa94c('0xb')](_0xa94c('0xd'),auth[_0xa94c('0xc')](),controller[_0xa94c('0xe')]);router['get']('/:id/conditions',auth['isAuthenticated'](),controller['getConditions']);router[_0xa94c('0xb')](_0xa94c('0xf'),auth['isAuthenticated'](),controller[_0xa94c('0x10')]);router[_0xa94c('0x11')]('/',auth[_0xa94c('0xc')](),controller[_0xa94c('0x12')]);router[_0xa94c('0x11')](_0xa94c('0x13'),auth['isAuthenticated'](),controller['addConditions']);router['post'](_0xa94c('0xf'),auth[_0xa94c('0xc')](),controller[_0xa94c('0x14')]);router[_0xa94c('0x15')](_0xa94c('0xd'),auth[_0xa94c('0xc')](),controller[_0xa94c('0x16')]);router[_0xa94c('0x17')](_0xa94c('0xd'),auth['isAuthenticated'](),controller[_0xa94c('0x18')]);module[_0xa94c('0x19')]=router; \ No newline at end of file +var _0x170f=['getActions','create','post','addConditions','/:id/actions','addActions','update','destroy','exports','multer','util','path','connect-timeout','express','../../components/auth/service','./automation.controller','get','isAuthenticated','index','/:id','show','/:id/conditions','getConditions'];(function(_0x294b80,_0x1cc4b6){var _0x4ce9da=function(_0x4d09ab){while(--_0x4d09ab){_0x294b80['push'](_0x294b80['shift']());}};_0x4ce9da(++_0x1cc4b6);}(_0x170f,0x65));var _0xf170=function(_0x133277,_0xb1d6b2){_0x133277=_0x133277-0x0;var _0x5b4a22=_0x170f[_0x133277];return _0x5b4a22;};'use strict';var multer=require(_0xf170('0x0'));var util=require(_0xf170('0x1'));var path=require(_0xf170('0x2'));var timeout=require(_0xf170('0x3'));var express=require(_0xf170('0x4'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0xf170('0x5'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0xf170('0x6'));router[_0xf170('0x7')]('/',auth[_0xf170('0x8')](),controller[_0xf170('0x9')]);router[_0xf170('0x7')](_0xf170('0xa'),auth[_0xf170('0x8')](),controller[_0xf170('0xb')]);router[_0xf170('0x7')](_0xf170('0xc'),auth[_0xf170('0x8')](),controller[_0xf170('0xd')]);router[_0xf170('0x7')]('/:id/actions',auth['isAuthenticated'](),controller[_0xf170('0xe')]);router['post']('/',auth['isAuthenticated'](),controller[_0xf170('0xf')]);router[_0xf170('0x10')](_0xf170('0xc'),auth[_0xf170('0x8')](),controller[_0xf170('0x11')]);router['post'](_0xf170('0x12'),auth[_0xf170('0x8')](),controller[_0xf170('0x13')]);router['put'](_0xf170('0xa'),auth[_0xf170('0x8')](),controller[_0xf170('0x14')]);router['delete']('/:id',auth[_0xf170('0x8')](),controller[_0xf170('0x15')]);module[_0xf170('0x16')]=router; \ No newline at end of file diff --git a/server/api/campaign/campaign.attributes.js b/server/api/campaign/campaign.attributes.js index 9e110ab..9cf0535 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 _0xf1d3=['onlyIfOpen','Active/Disactive\x20AMD','#AMD\x20Initial\x20Silence','#AMD\x20Greeting','#AMD\x20After\x20Greeting\x20Silence','#AMD\x20Total\x20Analysis\x20Time','#AMD\x20Min\x20Word\x20Length','#AMD\x20Between\x20Words\x20Silence','#AMD\x20Maximum\x20Number\x20Of\x20Words','#AMD\x20Silence\x20Threshold\x20(min:0,\x20max:32767)','#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)','NoSuchNumber\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Drop\x20Retry\x20(min:1,\x20max:999)','#Abandoned\x20Retry\x20(min:1,\x20max:999)','Abandoned\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','Machine\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#AgentReject\x20Retry\x20(min:1,\x20max:999)','AgentReject\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','sequelize','exports','STRING','name','ENUM','ivr','BOOLEAN','Active/Disactive\x20Campaign','INTEGER','UNSIGNED','Max\x20200\x20calls.','#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'];(function(_0x1b5312,_0x778b7e){var _0x2daba5=function(_0x41aeb4){while(--_0x41aeb4){_0x1b5312['push'](_0x1b5312['shift']());}};_0x2daba5(++_0x778b7e);}(_0xf1d3,0xee));var _0x3f1d=function(_0x42a3af,_0xb48a6c){_0x42a3af=_0x42a3af-0x0;var _0x46cc92=_0xf1d3[_0x42a3af];return _0x46cc92;};'use strict';var Sequelize=require(_0x3f1d('0x0'));module[_0x3f1d('0x1')]={'name':{'type':Sequelize[_0x3f1d('0x2')],'unique':_0x3f1d('0x3'),'allowNull':![],'validate':{'is':/[A-Za-z0-9._\\+*!-]+/,'notEmpty':!![]}},'type':{'type':Sequelize[_0x3f1d('0x4')](_0x3f1d('0x5')),'allowNull':![],'defaultValue':_0x3f1d('0x5')},'description':{'type':Sequelize[_0x3f1d('0x2')]},'active':{'type':Sequelize[_0x3f1d('0x6')],'defaultValue':0x0,'comment':_0x3f1d('0x7')},'limitCalls':{'type':Sequelize[_0x3f1d('0x8')](0x4)[_0x3f1d('0x9')],'defaultValue':0x1e,'validate':{'min':0x1,'max':0xc8},'comment':_0x3f1d('0xa')},'dialOriginateCallerIdName':{'type':Sequelize['STRING']},'dialOriginateCallerIdNumber':{'type':Sequelize[_0x3f1d('0x2')]},'dialOriginateTimeout':{'type':Sequelize[_0x3f1d('0x8')](0x3)[_0x3f1d('0x9')],'defaultValue':0x1e,'validate':{'min':0x1,'max':0x3e7},'comment':'Originate\x20Timeout\x20Seconds\x20(min:1,\x20max:999)'},'dialCongestionMaxRetry':{'type':Sequelize['INTEGER'](0x3)[_0x3f1d('0x9')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x3f1d('0xb')},'dialCongestionRetryFrequency':{'type':Sequelize[_0x3f1d('0x8')](0x5)[_0x3f1d('0x9')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x3f1d('0xc')},'dialBusyMaxRetry':{'type':Sequelize['INTEGER'](0x3)[_0x3f1d('0x9')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x3f1d('0xd')},'dialBusyRetryFrequency':{'type':Sequelize[_0x3f1d('0x8')](0x5)[_0x3f1d('0x9')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x3f1d('0xe')},'dialNoAnswerMaxRetry':{'type':Sequelize['INTEGER'](0x3)[_0x3f1d('0x9')],'defaultValue':0x3,'comment':_0x3f1d('0xf')},'dialNoAnswerRetryFrequency':{'type':Sequelize[_0x3f1d('0x8')](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x3f1d('0x10')},'dialGlobalMaxRetry':{'type':Sequelize[_0x3f1d('0x8')](0x3)[_0x3f1d('0x9')],'validate':{'min':0x1,'max':0x3e7},'defaultValue':0x4,'comment':_0x3f1d('0x11')},'dialTimezone':{'type':Sequelize[_0x3f1d('0x2')],'defaultValue':null},'dialGlobalInterval':{'type':Sequelize[_0x3f1d('0x2')],'defaultValue':_0x3f1d('0x12')},'dialCheckDuplicateType':{'type':Sequelize[_0x3f1d('0x4')](_0x3f1d('0x13'),'never',_0x3f1d('0x14')),'defaultValue':'always'},'dialAMDActive':{'type':Sequelize[_0x3f1d('0x6')],'defaultValue':0x0,'comment':_0x3f1d('0x15')},'dialAMDInitialSilence':{'type':Sequelize[_0x3f1d('0x8')](0x9)[_0x3f1d('0x9')],'defaultValue':0x9c4,'validate':{'min':0x0},'comment':_0x3f1d('0x16')},'dialAMDGreeting':{'type':Sequelize['INTEGER'](0x9)[_0x3f1d('0x9')],'defaultValue':0x5dc,'validate':{'min':0x0},'comment':_0x3f1d('0x17')},'dialAMDAfterGreetingSilence':{'type':Sequelize['INTEGER'](0x9)['UNSIGNED'],'defaultValue':0x320,'validate':{'min':0x0},'comment':_0x3f1d('0x18')},'dialAMDTotalAnalysisTime':{'type':Sequelize[_0x3f1d('0x8')](0x9)['UNSIGNED'],'defaultValue':0x1388,'validate':{'min':0x0},'comment':_0x3f1d('0x19')},'dialAMDMinWordLength':{'type':Sequelize[_0x3f1d('0x8')](0x9)[_0x3f1d('0x9')],'defaultValue':0x64,'validate':{'min':0x0},'comment':_0x3f1d('0x1a')},'dialAMDBetweenWordsSilence':{'type':Sequelize[_0x3f1d('0x8')](0x9)[_0x3f1d('0x9')],'defaultValue':0x32,'validate':{'min':0x0},'comment':_0x3f1d('0x1b')},'dialAMDMaximumNumberOfWords':{'type':Sequelize['INTEGER'](0x9)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x0},'comment':_0x3f1d('0x1c')},'dialAMDSilenceThreshold':{'type':Sequelize[_0x3f1d('0x8')](0x5)[_0x3f1d('0x9')],'validate':{'min':0x0,'max':0x7fff},'defaultValue':0x100,'comment':_0x3f1d('0x1d')},'dialAMDMaximumWordLength':{'type':Sequelize[_0x3f1d('0x8')](0x9)[_0x3f1d('0x9')],'defaultValue':0x1388,'validate':{'min':0x0},'comment':_0x3f1d('0x1e')},'dialOrderByScheduledAt':{'type':Sequelize[_0x3f1d('0x4')](_0x3f1d('0x1f'),_0x3f1d('0x20')),'defaultValue':_0x3f1d('0x1f')},'dialPrefix':{'type':Sequelize['STRING'],'defaultValue':null},'dialRandomLastDigitCallerIdNumber':{'type':Sequelize[_0x3f1d('0x8')](0x3)[_0x3f1d('0x9')],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':_0x3f1d('0x21')},'dialCutDigit':{'type':Sequelize[_0x3f1d('0x8')](0x3)['UNSIGNED'],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':_0x3f1d('0x22')},'dialNoSuchNumberMaxRetry':{'type':Sequelize[_0x3f1d('0x8')](0x3)[_0x3f1d('0x9')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x3f1d('0x23')},'dialNoSuchNumberRetryFrequency':{'type':Sequelize[_0x3f1d('0x8')](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x3f1d('0x24')},'dialDropMaxRetry':{'type':Sequelize['INTEGER'](0x3)[_0x3f1d('0x9')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x3f1d('0x25')},'dialDropRetryFrequency':{'type':Sequelize[_0x3f1d('0x8')](0x5)[_0x3f1d('0x9')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':'Drop\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'},'dialAbandonedMaxRetry':{'type':Sequelize['INTEGER'](0x3)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x3f1d('0x26')},'dialAbandonedRetryFrequency':{'type':Sequelize[_0x3f1d('0x8')](0x5)[_0x3f1d('0x9')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x3f1d('0x27')},'dialMachineMaxRetry':{'type':Sequelize[_0x3f1d('0x8')](0x3)[_0x3f1d('0x9')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':'#Machine\x20Retry\x20(min:1,\x20max:999)'},'dialMachineRetryFrequency':{'type':Sequelize[_0x3f1d('0x8')](0x5)[_0x3f1d('0x9')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x3f1d('0x28')},'dialAgentRejectMaxRetry':{'type':Sequelize[_0x3f1d('0x8')](0x3)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x3f1d('0x29')},'dialAgentRejectRetryFrequency':{'type':Sequelize[_0x3f1d('0x8')](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x3f1d('0x2a')}}; \ No newline at end of file +var _0x45c8=['#Global\x20Max\x20Retry\x20(min:1,\x20max:999)','07:00-22:00,*,*,*','onlyIfOpen','always','#AMD\x20Initial\x20Silence','#AMD\x20Greeting','#AMD\x20After\x20Greeting\x20Silence','#AMD\x20Total\x20Analysis\x20Time','#AMD\x20Min\x20Word\x20Length','#AMD\x20Between\x20Words\x20Silence','#AMD\x20Maximum\x20Number\x20Of\x20Words','#AMD\x20Silence\x20Threshold\x20(min:0,\x20max:32767)','#AMD\x20Maximum\x20Word\x20Length','ASC','DESC','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)','#Abandoned\x20Retry\x20(min:1,\x20max:999)','Abandoned\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Machine\x20Retry\x20(min:1,\x20max:999)','Machine\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#AgentReject\x20Retry\x20(min:1,\x20max:999)','AgentReject\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','sequelize','exports','STRING','name','ENUM','ivr','BOOLEAN','INTEGER','UNSIGNED','Congestion\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Busy\x20Retry\x20(min:1,\x20max:999)','#NoAnswer\x20Retry\x20(min:1,\x20max:999)','NoAnswer\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'];(function(_0x42cae3,_0x453195){var _0x843de=function(_0x74c3e5){while(--_0x74c3e5){_0x42cae3['push'](_0x42cae3['shift']());}};_0x843de(++_0x453195);}(_0x45c8,0x8b));var _0x845c=function(_0x1c4423,_0x4e005b){_0x1c4423=_0x1c4423-0x0;var _0x4d9cf3=_0x45c8[_0x1c4423];return _0x4d9cf3;};'use strict';var Sequelize=require(_0x845c('0x0'));module[_0x845c('0x1')]={'name':{'type':Sequelize[_0x845c('0x2')],'unique':_0x845c('0x3'),'allowNull':![],'validate':{'is':/[A-Za-z0-9._\\+*!-]+/,'notEmpty':!![]}},'type':{'type':Sequelize[_0x845c('0x4')](_0x845c('0x5')),'allowNull':![],'defaultValue':_0x845c('0x5')},'description':{'type':Sequelize['STRING']},'active':{'type':Sequelize[_0x845c('0x6')],'defaultValue':0x0,'comment':'Active/Disactive\x20Campaign'},'limitCalls':{'type':Sequelize[_0x845c('0x7')](0x4)['UNSIGNED'],'defaultValue':0x1e,'validate':{'min':0x1,'max':0xc8},'comment':'Max\x20200\x20calls.'},'dialOriginateCallerIdName':{'type':Sequelize[_0x845c('0x2')]},'dialOriginateCallerIdNumber':{'type':Sequelize[_0x845c('0x2')]},'dialOriginateTimeout':{'type':Sequelize[_0x845c('0x7')](0x3)[_0x845c('0x8')],'defaultValue':0x1e,'validate':{'min':0x1,'max':0x3e7},'comment':'Originate\x20Timeout\x20Seconds\x20(min:1,\x20max:999)'},'dialCongestionMaxRetry':{'type':Sequelize[_0x845c('0x7')](0x3)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':'#Congestion\x20Retry\x20(min:1,\x20max:999)'},'dialCongestionRetryFrequency':{'type':Sequelize['INTEGER'](0x5)[_0x845c('0x8')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x845c('0x9')},'dialBusyMaxRetry':{'type':Sequelize[_0x845c('0x7')](0x3)[_0x845c('0x8')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x845c('0xa')},'dialBusyRetryFrequency':{'type':Sequelize[_0x845c('0x7')](0x5)[_0x845c('0x8')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':'Busy\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'},'dialNoAnswerMaxRetry':{'type':Sequelize[_0x845c('0x7')](0x3)['UNSIGNED'],'defaultValue':0x3,'comment':_0x845c('0xb')},'dialNoAnswerRetryFrequency':{'type':Sequelize[_0x845c('0x7')](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x845c('0xc')},'dialGlobalMaxRetry':{'type':Sequelize['INTEGER'](0x3)[_0x845c('0x8')],'validate':{'min':0x1,'max':0x3e7},'defaultValue':0x4,'comment':_0x845c('0xd')},'dialTimezone':{'type':Sequelize['STRING'],'defaultValue':null},'dialGlobalInterval':{'type':Sequelize[_0x845c('0x2')],'defaultValue':_0x845c('0xe')},'dialCheckDuplicateType':{'type':Sequelize[_0x845c('0x4')]('always','never',_0x845c('0xf')),'defaultValue':_0x845c('0x10')},'dialAMDActive':{'type':Sequelize[_0x845c('0x6')],'defaultValue':0x0,'comment':'Active/Disactive\x20AMD'},'dialAMDInitialSilence':{'type':Sequelize['INTEGER'](0x9)[_0x845c('0x8')],'defaultValue':0x9c4,'validate':{'min':0x0},'comment':_0x845c('0x11')},'dialAMDGreeting':{'type':Sequelize[_0x845c('0x7')](0x9)[_0x845c('0x8')],'defaultValue':0x5dc,'validate':{'min':0x0},'comment':_0x845c('0x12')},'dialAMDAfterGreetingSilence':{'type':Sequelize['INTEGER'](0x9)['UNSIGNED'],'defaultValue':0x320,'validate':{'min':0x0},'comment':_0x845c('0x13')},'dialAMDTotalAnalysisTime':{'type':Sequelize[_0x845c('0x7')](0x9)[_0x845c('0x8')],'defaultValue':0x1388,'validate':{'min':0x0},'comment':_0x845c('0x14')},'dialAMDMinWordLength':{'type':Sequelize[_0x845c('0x7')](0x9)['UNSIGNED'],'defaultValue':0x64,'validate':{'min':0x0},'comment':_0x845c('0x15')},'dialAMDBetweenWordsSilence':{'type':Sequelize[_0x845c('0x7')](0x9)[_0x845c('0x8')],'defaultValue':0x32,'validate':{'min':0x0},'comment':_0x845c('0x16')},'dialAMDMaximumNumberOfWords':{'type':Sequelize['INTEGER'](0x9)[_0x845c('0x8')],'defaultValue':0x3,'validate':{'min':0x0},'comment':_0x845c('0x17')},'dialAMDSilenceThreshold':{'type':Sequelize[_0x845c('0x7')](0x5)[_0x845c('0x8')],'validate':{'min':0x0,'max':0x7fff},'defaultValue':0x100,'comment':_0x845c('0x18')},'dialAMDMaximumWordLength':{'type':Sequelize[_0x845c('0x7')](0x9)['UNSIGNED'],'defaultValue':0x1388,'validate':{'min':0x0},'comment':_0x845c('0x19')},'dialOrderByScheduledAt':{'type':Sequelize[_0x845c('0x4')]('DESC',_0x845c('0x1a')),'defaultValue':_0x845c('0x1b')},'dialPrefix':{'type':Sequelize[_0x845c('0x2')],'defaultValue':null},'dialRandomLastDigitCallerIdNumber':{'type':Sequelize[_0x845c('0x7')](0x3)[_0x845c('0x8')],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':_0x845c('0x1c')},'dialCutDigit':{'type':Sequelize[_0x845c('0x7')](0x3)['UNSIGNED'],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':_0x845c('0x1d')},'dialNoSuchNumberMaxRetry':{'type':Sequelize[_0x845c('0x7')](0x3)[_0x845c('0x8')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x845c('0x1e')},'dialNoSuchNumberRetryFrequency':{'type':Sequelize['INTEGER'](0x5)[_0x845c('0x8')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x845c('0x1f')},'dialDropMaxRetry':{'type':Sequelize[_0x845c('0x7')](0x3)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':'#Drop\x20Retry\x20(min:1,\x20max:999)'},'dialDropRetryFrequency':{'type':Sequelize[_0x845c('0x7')](0x5)[_0x845c('0x8')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':'Drop\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'},'dialAbandonedMaxRetry':{'type':Sequelize[_0x845c('0x7')](0x3)[_0x845c('0x8')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x845c('0x20')},'dialAbandonedRetryFrequency':{'type':Sequelize[_0x845c('0x7')](0x5)[_0x845c('0x8')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x845c('0x21')},'dialMachineMaxRetry':{'type':Sequelize[_0x845c('0x7')](0x3)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x845c('0x22')},'dialMachineRetryFrequency':{'type':Sequelize[_0x845c('0x7')](0x5)[_0x845c('0x8')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x845c('0x23')},'dialAgentRejectMaxRetry':{'type':Sequelize[_0x845c('0x7')](0x3)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x845c('0x24')},'dialAgentRejectRetryFrequency':{'type':Sequelize[_0x845c('0x7')](0x5)[_0x845c('0x8')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x845c('0x25')}}; \ No newline at end of file diff --git a/server/api/campaign/campaign.controller.js b/server/api/campaign/campaign.controller.js index b99d27b..779a215 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 _0x3c2c=['show','keys','options','find','catch','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','userProfileId','clone','params','rawAttributes','omit','createdAt','updatedAt','UserProfileSection','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','getHoppers','CmHopper','order','CampaignId','findOne','CmHopperHistory','CmHopperFinal','getHopperBlacks','CmHopperBlack','getLists','CmList','addLists','YYYY-MM-DD\x20HH:mm:ss','ids','dialCheckDuplicateType','always','insert','into','cm_hopper','fromQuery','phone','scheduledAt','ListId','field','NOW()','ContactId','CmListId','toString','from','cm_contacts','deletedAt\x20IS\x20NULL','ListId\x20=\x20?','phone\x20IS\x20NOT\x20NULL','phone\x20NOT\x20IN\x20(?)','select','COALESCE(calleridnum,\x27\x27)','CampaignId\x20=\x20?','COALESCE(phone,\x27\x27)','cmHopperId','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','rimraf','zip-dir','fast-json-patch','bluebird','mustache','util','path','to-csv','ejs','fs-extra','lodash','squel','querystring','ioredis','../../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','reject','save','update','destroy','get','IvrCampaigns','UserProfileResource','then','error','stack','name','index','Campaign','fieldName','type','query','intersection','attributes','model','fields','length','hasOwnProperty','nolimit','sort','where','filters','pick','filter','map','VIRTUAL','merge','includeAll','include','findAll','rows'];(function(_0x388653,_0x57c50b){var _0x347f05=function(_0x523b9d){while(--_0x523b9d){_0x388653['push'](_0x388653['shift']());}};_0x347f05(++_0x57c50b);}(_0x3c2c,0x160));var _0xc3c2=function(_0x367a96,_0x4ab6e5){_0x367a96=_0x367a96-0x0;var _0x5ec123=_0x3c2c[_0x367a96];return _0x5ec123;};'use strict';var emlformat=require(_0xc3c2('0x0'));var rimraf=require(_0xc3c2('0x1'));var zipdir=require(_0xc3c2('0x2'));var jsonpatch=require(_0xc3c2('0x3'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0xc3c2('0x4'));var Mustache=require(_0xc3c2('0x5'));var util=require(_0xc3c2('0x6'));var path=require(_0xc3c2('0x7'));var sox=require('sox');var csv=require(_0xc3c2('0x8'));var ejs=require(_0xc3c2('0x9'));var fs=require('fs');var fs_extra=require(_0xc3c2('0xa'));var _=require(_0xc3c2('0xb'));var squel=require(_0xc3c2('0xc'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0xc3c2('0x8'));var querystring=require(_0xc3c2('0xd'));var Papa=require('papaparse');var Redis=require(_0xc3c2('0xe'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0xc3c2('0xf'));var hardwareService=require(_0xc3c2('0x10'));var logger=require(_0xc3c2('0x11'))('api');var utils=require(_0xc3c2('0x12'));var config=require(_0xc3c2('0x13'));var licenseUtil=require(_0xc3c2('0x14'));var db=require(_0xc3c2('0x15'))['db'];function respondWithStatusCode(_0x578ac4,_0x3920e7){_0x3920e7=_0x3920e7||0xcc;return function(_0x1befad){if(_0x1befad){return _0x578ac4['sendStatus'](_0x3920e7);}return _0x578ac4[_0xc3c2('0x16')](_0x3920e7)['end']();};}function respondWithResult(_0x25b091,_0x4d7d11){_0x4d7d11=_0x4d7d11||0xc8;return function(_0x154071){if(_0x154071){return _0x25b091['status'](_0x4d7d11)[_0xc3c2('0x17')](_0x154071);}};}function respondWithFilteredResult(_0xf5d9a,_0x56bc61){return function(_0x1c2987){if(_0x1c2987){var _0x36f10f=typeof _0x56bc61[_0xc3c2('0x18')]===_0xc3c2('0x19')&&typeof _0x56bc61[_0xc3c2('0x1a')]===_0xc3c2('0x19');var _0x57b7b3=_0x1c2987['count'];var _0x4c0f2d=_0x36f10f?0x0:_0x56bc61[_0xc3c2('0x18')];var _0x3e26e1=_0x36f10f?_0x1c2987[_0xc3c2('0x1b')]:_0x56bc61[_0xc3c2('0x18')]+_0x56bc61[_0xc3c2('0x1a')];var _0x5c9d2c;if(_0x3e26e1>=_0x57b7b3){_0x3e26e1=_0x57b7b3;_0x5c9d2c=0xc8;}else{_0x5c9d2c=0xce;}_0xf5d9a['status'](_0x5c9d2c);return _0xf5d9a[_0xc3c2('0x1c')](_0xc3c2('0x1d'),_0x4c0f2d+'-'+_0x3e26e1+'/'+_0x57b7b3)[_0xc3c2('0x17')](_0x1c2987);}return null;};}function patchUpdates(_0x5e925e){return function(_0x42feba){try{jsonpatch['apply'](_0x42feba,_0x5e925e,!![]);}catch(_0x2e9c78){return BPromise[_0xc3c2('0x1e')](_0x2e9c78);}return _0x42feba[_0xc3c2('0x1f')]();};}function saveUpdates(_0x57458a,_0x2ca609){return function(_0x340c75){if(_0x340c75){return _0x340c75[_0xc3c2('0x20')](_0x57458a)['then'](function(_0x3db978){return _0x3db978;});}return null;};}function removeEntity(_0x3287a3,_0x6ad7af){return function(_0x5d7789){if(_0x5d7789){return _0x5d7789[_0xc3c2('0x21')]()['then'](function(){var _0x323daf=_0x5d7789[_0xc3c2('0x22')]({'plain':!![]});var _0x26aacc=_0xc3c2('0x23');return db[_0xc3c2('0x24')][_0xc3c2('0x21')]({'where':{'type':_0x26aacc,'resourceId':_0x323daf['id']}})[_0xc3c2('0x25')](function(){return _0x5d7789;});})['then'](function(){_0x3287a3['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x1b2786,_0x140106){return function(_0x2aca0d){if(!_0x2aca0d){_0x1b2786['sendStatus'](0x194);}return _0x2aca0d;};}function handleError(_0x43548f,_0x1fd93f){_0x1fd93f=_0x1fd93f||0x1f4;return function(_0x2dc9ec){logger[_0xc3c2('0x26')](_0x2dc9ec[_0xc3c2('0x27')]);if(_0x2dc9ec[_0xc3c2('0x28')]){delete _0x2dc9ec[_0xc3c2('0x28')];}_0x43548f[_0xc3c2('0x16')](_0x1fd93f)['send'](_0x2dc9ec);};}exports[_0xc3c2('0x29')]=function(_0x45f56c,_0x165154){var _0x3aebab={},_0x236132={},_0x322852={'count':0x0,'rows':[]};var _0x562b91=_['map'](db[_0xc3c2('0x2a')]['rawAttributes'],function(_0x27c3bd){return{'name':_0x27c3bd[_0xc3c2('0x2b')],'type':_0x27c3bd[_0xc3c2('0x2c')]['key']};});_0x236132['model']=_['map'](_0x562b91,'name');_0x236132[_0xc3c2('0x2d')]=_['keys'](_0x45f56c[_0xc3c2('0x2d')]);_0x236132['filters']=_[_0xc3c2('0x2e')](_0x236132['model'],_0x236132['query']);_0x3aebab[_0xc3c2('0x2f')]=_[_0xc3c2('0x2e')](_0x236132[_0xc3c2('0x30')],qs[_0xc3c2('0x31')](_0x45f56c[_0xc3c2('0x2d')][_0xc3c2('0x31')]));_0x3aebab[_0xc3c2('0x2f')]=_0x3aebab[_0xc3c2('0x2f')][_0xc3c2('0x32')]?_0x3aebab['attributes']:_0x236132['model'];if(!_0x45f56c[_0xc3c2('0x2d')][_0xc3c2('0x33')](_0xc3c2('0x34'))){_0x3aebab[_0xc3c2('0x1a')]=qs[_0xc3c2('0x1a')](_0x45f56c[_0xc3c2('0x2d')]['limit']);_0x3aebab[_0xc3c2('0x18')]=qs['offset'](_0x45f56c[_0xc3c2('0x2d')][_0xc3c2('0x18')]);}_0x3aebab['order']=qs[_0xc3c2('0x35')](_0x45f56c[_0xc3c2('0x2d')]['sort']);_0x3aebab[_0xc3c2('0x36')]=qs[_0xc3c2('0x37')](_[_0xc3c2('0x38')](_0x45f56c[_0xc3c2('0x2d')],_0x236132[_0xc3c2('0x37')]),_0x562b91);if(_0x45f56c[_0xc3c2('0x2d')][_0xc3c2('0x39')]){_0x3aebab[_0xc3c2('0x36')]=_['merge'](_0x3aebab[_0xc3c2('0x36')],{'$or':_[_0xc3c2('0x3a')](_0x562b91,function(_0x279e25){if(_0x279e25[_0xc3c2('0x2c')]!==_0xc3c2('0x3b')){var _0x97039a={};_0x97039a[_0x279e25[_0xc3c2('0x28')]]={'$like':'%'+_0x45f56c[_0xc3c2('0x2d')][_0xc3c2('0x39')]+'%'};return _0x97039a;}})});}_0x3aebab=_[_0xc3c2('0x3c')]({},_0x3aebab,_0x45f56c['options']);var _0x3e6d42={'where':_0x3aebab[_0xc3c2('0x36')]};return db['Campaign'][_0xc3c2('0x1b')](_0x3e6d42)[_0xc3c2('0x25')](function(_0x49f1f1){_0x322852[_0xc3c2('0x1b')]=_0x49f1f1;if(_0x45f56c['query'][_0xc3c2('0x3d')]){_0x3aebab[_0xc3c2('0x3e')]=[{'all':!![]}];}return db[_0xc3c2('0x2a')][_0xc3c2('0x3f')](_0x3aebab);})[_0xc3c2('0x25')](function(_0x2ef1db){_0x322852[_0xc3c2('0x40')]=_0x2ef1db;return _0x322852;})[_0xc3c2('0x25')](respondWithFilteredResult(_0x165154,_0x3aebab))['catch'](handleError(_0x165154,null));};exports[_0xc3c2('0x41')]=function(_0xf39a12,_0x29811c){var _0x464ada={'raw':![],'where':{'id':_0xf39a12['params']['id']}},_0x5e9efc={};_0x5e9efc['model']=_[_0xc3c2('0x42')](db[_0xc3c2('0x2a')]['rawAttributes']);_0x5e9efc[_0xc3c2('0x2d')]=_['keys'](_0xf39a12[_0xc3c2('0x2d')]);_0x5e9efc['filters']=_[_0xc3c2('0x2e')](_0x5e9efc[_0xc3c2('0x30')],_0x5e9efc[_0xc3c2('0x2d')]);_0x464ada[_0xc3c2('0x2f')]=_[_0xc3c2('0x2e')](_0x5e9efc['model'],qs['fields'](_0xf39a12[_0xc3c2('0x2d')][_0xc3c2('0x31')]));_0x464ada[_0xc3c2('0x2f')]=_0x464ada[_0xc3c2('0x2f')][_0xc3c2('0x32')]?_0x464ada[_0xc3c2('0x2f')]:_0x5e9efc[_0xc3c2('0x30')];if(_0xf39a12[_0xc3c2('0x2d')][_0xc3c2('0x3d')]){_0x464ada[_0xc3c2('0x3e')]=[{'all':!![]}];}_0x464ada=_[_0xc3c2('0x3c')]({},_0x464ada,_0xf39a12[_0xc3c2('0x43')]);return db[_0xc3c2('0x2a')][_0xc3c2('0x44')](_0x464ada)['then'](handleEntityNotFound(_0x29811c,null))[_0xc3c2('0x25')](respondWithResult(_0x29811c,null))[_0xc3c2('0x45')](handleError(_0x29811c,null));};exports[_0xc3c2('0x46')]=function(_0x444d41,_0x2321a3){return db[_0xc3c2('0x2a')][_0xc3c2('0x46')](_0x444d41[_0xc3c2('0x47')],{})[_0xc3c2('0x25')](function(_0x373e7e){var _0x103d1f=_0x444d41[_0xc3c2('0x48')]['get']({'plain':!![]});if(!_0x103d1f)throw new Error(_0xc3c2('0x49'));if(_0x103d1f['role']===_0xc3c2('0x48')){var _0x34cae8=_0x373e7e[_0xc3c2('0x22')]({'plain':!![]});var _0x1d0e9f=_0xc3c2('0x23');return db['UserProfileSection'][_0xc3c2('0x44')]({'where':{'name':_0x1d0e9f,'userProfileId':_0x103d1f[_0xc3c2('0x4a')]},'raw':!![]})[_0xc3c2('0x25')](function(_0x179bf6){if(_0x179bf6&&_0x179bf6['autoAssociation']===0x0){return db[_0xc3c2('0x24')]['create']({'name':_0x34cae8[_0xc3c2('0x28')],'resourceId':_0x34cae8['id'],'type':_0x179bf6[_0xc3c2('0x28')],'sectionId':_0x179bf6['id']},{})[_0xc3c2('0x25')](function(){return _0x373e7e;});}else{return _0x373e7e;}})[_0xc3c2('0x45')](function(_0x27235b){logger[_0xc3c2('0x26')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x27235b);throw _0x27235b;});}return _0x373e7e;})[_0xc3c2('0x25')](respondWithResult(_0x2321a3,0xc9))[_0xc3c2('0x45')](handleError(_0x2321a3,null));};exports[_0xc3c2('0x4b')]=function(_0x2aa1e8,_0x1eab23){var _0x3322ae={'where':{'id':_0x2aa1e8[_0xc3c2('0x4c')]['id']}},_0x3b4917={};_0x3b4917[_0xc3c2('0x30')]=_[_0xc3c2('0x42')](db[_0xc3c2('0x2a')][_0xc3c2('0x4d')]);_0x3322ae[_0xc3c2('0x2f')]=_[_0xc3c2('0x2e')](_0x3b4917['model'],qs[_0xc3c2('0x31')](_0x2aa1e8['query'][_0xc3c2('0x31')]));_0x3322ae['attributes']=_0x3322ae[_0xc3c2('0x2f')][_0xc3c2('0x32')]?_0x3322ae[_0xc3c2('0x2f')]:_0x3b4917['model'];if(_0x2aa1e8[_0xc3c2('0x2d')][_0xc3c2('0x3d')]){_0x3322ae[_0xc3c2('0x3e')]=[{'all':!![]}];}_0x3322ae=_[_0xc3c2('0x3c')]({},_0x3322ae,_0x2aa1e8[_0xc3c2('0x43')]);return db[_0xc3c2('0x2a')][_0xc3c2('0x44')](_0x3322ae)['then'](handleEntityNotFound(_0x1eab23,null))[_0xc3c2('0x25')](function(_0x7053dd){if(_0x7053dd){var _0x86ab8e=_0x7053dd[_0xc3c2('0x22')]({'plain':!![]});_0x86ab8e=qs[_0xc3c2('0x4e')](_0x86ab8e,['id',_0xc3c2('0x4f'),_0xc3c2('0x50')]);_0x2aa1e8[_0xc3c2('0x47')]=_[_0xc3c2('0x4e')](_0x2aa1e8['body'],['id',_0xc3c2('0x4f'),_0xc3c2('0x50')]);return db[_0xc3c2('0x2a')][_0xc3c2('0x46')](_[_0xc3c2('0x3c')](_0x86ab8e,_0x2aa1e8[_0xc3c2('0x47')]),{'include':_0x2aa1e8[_0xc3c2('0x2d')][_0xc3c2('0x3d')]?[{'all':!![]}]:undefined})[_0xc3c2('0x25')](function(_0x5c3bf0){var _0x574bd6=_0x2aa1e8[_0xc3c2('0x48')][_0xc3c2('0x22')]({'plain':!![]});if(!_0x574bd6)throw new Error(_0xc3c2('0x49'));if(_0x574bd6['role']===_0xc3c2('0x48')){var _0x3ac527=_0x5c3bf0[_0xc3c2('0x22')]({'plain':!![]});var _0x2e6501=_0xc3c2('0x23');return db[_0xc3c2('0x51')][_0xc3c2('0x44')]({'where':{'name':_0x2e6501,'userProfileId':_0x574bd6[_0xc3c2('0x4a')]},'raw':!![]})[_0xc3c2('0x25')](function(_0x17cb5d){if(_0x17cb5d&&_0x17cb5d[_0xc3c2('0x52')]===0x0){return db[_0xc3c2('0x24')][_0xc3c2('0x46')]({'name':_0x3ac527[_0xc3c2('0x28')],'resourceId':_0x3ac527['id'],'type':_0x17cb5d[_0xc3c2('0x28')],'sectionId':_0x17cb5d['id']},{})[_0xc3c2('0x25')](function(){return _0x5c3bf0;});}else{return _0x5c3bf0;}})['catch'](function(_0x620174){logger[_0xc3c2('0x26')](_0xc3c2('0x53'),_0x620174);throw _0x620174;});}return _0x5c3bf0;});}})[_0xc3c2('0x25')](respondWithResult(_0x1eab23,0xc9))[_0xc3c2('0x45')](handleError(_0x1eab23,null));};exports['update']=function(_0x2e7dee,_0x6a62e2){if(_0x2e7dee[_0xc3c2('0x47')]['id']){delete _0x2e7dee[_0xc3c2('0x47')]['id'];}return db[_0xc3c2('0x2a')][_0xc3c2('0x44')]({'where':{'id':_0x2e7dee['params']['id']}})[_0xc3c2('0x25')](handleEntityNotFound(_0x6a62e2,null))['then'](saveUpdates(_0x2e7dee[_0xc3c2('0x47')],null))[_0xc3c2('0x25')](respondWithResult(_0x6a62e2,null))[_0xc3c2('0x45')](handleError(_0x6a62e2,null));};exports['destroy']=function(_0x2c682b,_0x21ad73){return db['Campaign'][_0xc3c2('0x44')]({'where':{'id':_0x2c682b[_0xc3c2('0x4c')]['id']}})[_0xc3c2('0x25')](handleEntityNotFound(_0x21ad73,null))[_0xc3c2('0x25')](removeEntity(_0x21ad73,null))[_0xc3c2('0x45')](handleError(_0x21ad73,null));};exports[_0xc3c2('0x54')]=function(_0xd40b83,_0x518b2d,_0x5adc95){var _0x726a70={'raw':!![],'where':{}};var _0x3757a7={};var _0x36eef2={'count':0x0,'rows':[]};return db[_0xc3c2('0x2a')]['findOne']({'where':{'id':_0xd40b83['params']['id']}})[_0xc3c2('0x25')](handleEntityNotFound(_0x518b2d,null))[_0xc3c2('0x25')](function(_0x242b90){if(_0x242b90){_0x3757a7[_0xc3c2('0x30')]=_['keys'](db[_0xc3c2('0x55')][_0xc3c2('0x4d')]);_0x3757a7[_0xc3c2('0x2d')]=_[_0xc3c2('0x42')](_0xd40b83[_0xc3c2('0x2d')]);_0x3757a7[_0xc3c2('0x37')]=_[_0xc3c2('0x2e')](_0x3757a7[_0xc3c2('0x30')],_0x3757a7[_0xc3c2('0x2d')]);_0x726a70[_0xc3c2('0x2f')]=_[_0xc3c2('0x2e')](_0x3757a7['model'],qs['fields'](_0xd40b83['query'][_0xc3c2('0x31')]));_0x726a70[_0xc3c2('0x2f')]=_0x726a70[_0xc3c2('0x2f')][_0xc3c2('0x32')]?_0x726a70[_0xc3c2('0x2f')]:_0x3757a7['model'];if(!_0xd40b83[_0xc3c2('0x2d')][_0xc3c2('0x33')](_0xc3c2('0x34'))){_0x726a70[_0xc3c2('0x1a')]=qs[_0xc3c2('0x1a')](_0xd40b83[_0xc3c2('0x2d')][_0xc3c2('0x1a')]);_0x726a70['offset']=qs[_0xc3c2('0x18')](_0xd40b83[_0xc3c2('0x2d')][_0xc3c2('0x18')]);}_0x726a70[_0xc3c2('0x56')]=qs[_0xc3c2('0x35')](_0xd40b83[_0xc3c2('0x2d')]['sort']);_0x726a70[_0xc3c2('0x36')]=qs[_0xc3c2('0x37')](_[_0xc3c2('0x38')](_0xd40b83[_0xc3c2('0x2d')],_0x3757a7['filters']));_0x726a70['where'][_0xc3c2('0x57')]=_0x242b90['id'];if(_0xd40b83['query'][_0xc3c2('0x39')]){_0x726a70[_0xc3c2('0x36')]=_[_0xc3c2('0x3c')](_0x726a70['where'],{'$or':_[_0xc3c2('0x3a')](_0x726a70[_0xc3c2('0x2f')],function(_0x41d067){var _0x1cfef6={};_0x1cfef6[_0x41d067]={'$like':'%'+_0xd40b83[_0xc3c2('0x2d')]['filter']+'%'};return _0x1cfef6;})});}_0x726a70=_[_0xc3c2('0x3c')]({},_0x726a70,_0xd40b83[_0xc3c2('0x43')]);return db[_0xc3c2('0x55')][_0xc3c2('0x1b')]({'where':_0x726a70[_0xc3c2('0x36')]})[_0xc3c2('0x25')](function(_0x2354b1){_0x36eef2[_0xc3c2('0x1b')]=_0x2354b1;if(_0xd40b83[_0xc3c2('0x2d')][_0xc3c2('0x3d')]){_0x726a70[_0xc3c2('0x3e')]=[{'all':!![]}];}return db['CmHopper']['findAll'](_0x726a70);})[_0xc3c2('0x25')](function(_0x30295a){_0x36eef2['rows']=_0x30295a;return _0x36eef2;});}})['then'](respondWithFilteredResult(_0x518b2d,_0x726a70))['catch'](handleError(_0x518b2d,null));};exports['getHopperHistories']=function(_0xb7a647,_0x2923d3,_0x1578f4){var _0x414316={'raw':!![],'where':{}};var _0x5d9a18={};var _0x3bb66b={'count':0x0,'rows':[]};return db[_0xc3c2('0x2a')][_0xc3c2('0x58')]({'where':{'id':_0xb7a647[_0xc3c2('0x4c')]['id']}})[_0xc3c2('0x25')](handleEntityNotFound(_0x2923d3,null))[_0xc3c2('0x25')](function(_0x5a7445){if(_0x5a7445){_0x5d9a18[_0xc3c2('0x30')]=_['keys'](db[_0xc3c2('0x59')]['rawAttributes']);_0x5d9a18[_0xc3c2('0x2d')]=_[_0xc3c2('0x42')](_0xb7a647[_0xc3c2('0x2d')]);_0x5d9a18['filters']=_[_0xc3c2('0x2e')](_0x5d9a18[_0xc3c2('0x30')],_0x5d9a18['query']);_0x414316[_0xc3c2('0x2f')]=_[_0xc3c2('0x2e')](_0x5d9a18[_0xc3c2('0x30')],qs[_0xc3c2('0x31')](_0xb7a647[_0xc3c2('0x2d')][_0xc3c2('0x31')]));_0x414316[_0xc3c2('0x2f')]=_0x414316[_0xc3c2('0x2f')][_0xc3c2('0x32')]?_0x414316['attributes']:_0x5d9a18[_0xc3c2('0x30')];if(!_0xb7a647['query']['hasOwnProperty'](_0xc3c2('0x34'))){_0x414316[_0xc3c2('0x1a')]=qs['limit'](_0xb7a647[_0xc3c2('0x2d')][_0xc3c2('0x1a')]);_0x414316[_0xc3c2('0x18')]=qs[_0xc3c2('0x18')](_0xb7a647[_0xc3c2('0x2d')]['offset']);}_0x414316[_0xc3c2('0x56')]=qs[_0xc3c2('0x35')](_0xb7a647[_0xc3c2('0x2d')]['sort']);_0x414316['where']=qs[_0xc3c2('0x37')](_[_0xc3c2('0x38')](_0xb7a647[_0xc3c2('0x2d')],_0x5d9a18['filters']));_0x414316[_0xc3c2('0x36')][_0xc3c2('0x57')]=_0x5a7445['id'];if(_0xb7a647['query'][_0xc3c2('0x39')]){_0x414316[_0xc3c2('0x36')]=_[_0xc3c2('0x3c')](_0x414316[_0xc3c2('0x36')],{'$or':_['map'](_0x414316[_0xc3c2('0x2f')],function(_0x2af851){var _0x2b9a83={};_0x2b9a83[_0x2af851]={'$like':'%'+_0xb7a647[_0xc3c2('0x2d')][_0xc3c2('0x39')]+'%'};return _0x2b9a83;})});}_0x414316=_[_0xc3c2('0x3c')]({},_0x414316,_0xb7a647[_0xc3c2('0x43')]);return db[_0xc3c2('0x59')][_0xc3c2('0x1b')]({'where':_0x414316[_0xc3c2('0x36')]})['then'](function(_0x22ff10){_0x3bb66b[_0xc3c2('0x1b')]=_0x22ff10;if(_0xb7a647[_0xc3c2('0x2d')][_0xc3c2('0x3d')]){_0x414316[_0xc3c2('0x3e')]=[{'all':!![]}];}return db[_0xc3c2('0x59')][_0xc3c2('0x3f')](_0x414316);})[_0xc3c2('0x25')](function(_0x4b3b35){_0x3bb66b[_0xc3c2('0x40')]=_0x4b3b35;return _0x3bb66b;});}})['then'](respondWithFilteredResult(_0x2923d3,_0x414316))['catch'](handleError(_0x2923d3,null));};exports['getHopperFinals']=function(_0x562e94,_0x585e4e,_0x35599c){var _0x1a1f3e={'raw':!![],'where':{}};var _0x5f0ac3={};var _0x293d95={'count':0x0,'rows':[]};return db[_0xc3c2('0x2a')][_0xc3c2('0x58')]({'where':{'id':_0x562e94['params']['id']}})[_0xc3c2('0x25')](handleEntityNotFound(_0x585e4e,null))[_0xc3c2('0x25')](function(_0x47df2a){if(_0x47df2a){_0x5f0ac3[_0xc3c2('0x30')]=_[_0xc3c2('0x42')](db[_0xc3c2('0x5a')][_0xc3c2('0x4d')]);_0x5f0ac3[_0xc3c2('0x2d')]=_[_0xc3c2('0x42')](_0x562e94['query']);_0x5f0ac3['filters']=_[_0xc3c2('0x2e')](_0x5f0ac3['model'],_0x5f0ac3['query']);_0x1a1f3e[_0xc3c2('0x2f')]=_[_0xc3c2('0x2e')](_0x5f0ac3['model'],qs['fields'](_0x562e94[_0xc3c2('0x2d')][_0xc3c2('0x31')]));_0x1a1f3e[_0xc3c2('0x2f')]=_0x1a1f3e[_0xc3c2('0x2f')][_0xc3c2('0x32')]?_0x1a1f3e[_0xc3c2('0x2f')]:_0x5f0ac3[_0xc3c2('0x30')];if(!_0x562e94[_0xc3c2('0x2d')][_0xc3c2('0x33')](_0xc3c2('0x34'))){_0x1a1f3e[_0xc3c2('0x1a')]=qs[_0xc3c2('0x1a')](_0x562e94[_0xc3c2('0x2d')][_0xc3c2('0x1a')]);_0x1a1f3e['offset']=qs[_0xc3c2('0x18')](_0x562e94[_0xc3c2('0x2d')][_0xc3c2('0x18')]);}_0x1a1f3e[_0xc3c2('0x56')]=qs[_0xc3c2('0x35')](_0x562e94[_0xc3c2('0x2d')]['sort']);_0x1a1f3e[_0xc3c2('0x36')]=qs[_0xc3c2('0x37')](_[_0xc3c2('0x38')](_0x562e94['query'],_0x5f0ac3['filters']));_0x1a1f3e['where'][_0xc3c2('0x57')]=_0x47df2a['id'];if(_0x562e94[_0xc3c2('0x2d')][_0xc3c2('0x39')]){_0x1a1f3e[_0xc3c2('0x36')]=_[_0xc3c2('0x3c')](_0x1a1f3e['where'],{'$or':_[_0xc3c2('0x3a')](_0x1a1f3e[_0xc3c2('0x2f')],function(_0x4ebb55){var _0x272786={};_0x272786[_0x4ebb55]={'$like':'%'+_0x562e94['query'][_0xc3c2('0x39')]+'%'};return _0x272786;})});}_0x1a1f3e=_[_0xc3c2('0x3c')]({},_0x1a1f3e,_0x562e94[_0xc3c2('0x43')]);return db[_0xc3c2('0x5a')][_0xc3c2('0x1b')]({'where':_0x1a1f3e['where']})[_0xc3c2('0x25')](function(_0x4817c6){_0x293d95['count']=_0x4817c6;if(_0x562e94['query']['includeAll']){_0x1a1f3e[_0xc3c2('0x3e')]=[{'all':!![]}];}return db[_0xc3c2('0x5a')][_0xc3c2('0x3f')](_0x1a1f3e);})[_0xc3c2('0x25')](function(_0x5c860d){_0x293d95[_0xc3c2('0x40')]=_0x5c860d;return _0x293d95;});}})['then'](respondWithFilteredResult(_0x585e4e,_0x1a1f3e))[_0xc3c2('0x45')](handleError(_0x585e4e,null));};exports[_0xc3c2('0x5b')]=function(_0x2da00d,_0x437b1f,_0x14d7eb){var _0xfe3d8a={'raw':!![],'where':{}};var _0x2f1e32={};var _0x20a93d={'count':0x0,'rows':[]};return db[_0xc3c2('0x2a')][_0xc3c2('0x58')]({'where':{'id':_0x2da00d['params']['id']}})[_0xc3c2('0x25')](handleEntityNotFound(_0x437b1f,null))[_0xc3c2('0x25')](function(_0x285062){if(_0x285062){_0x2f1e32[_0xc3c2('0x30')]=_[_0xc3c2('0x42')](db[_0xc3c2('0x5c')][_0xc3c2('0x4d')]);_0x2f1e32['query']=_[_0xc3c2('0x42')](_0x2da00d['query']);_0x2f1e32[_0xc3c2('0x37')]=_['intersection'](_0x2f1e32[_0xc3c2('0x30')],_0x2f1e32[_0xc3c2('0x2d')]);_0xfe3d8a[_0xc3c2('0x2f')]=_['intersection'](_0x2f1e32['model'],qs[_0xc3c2('0x31')](_0x2da00d[_0xc3c2('0x2d')]['fields']));_0xfe3d8a[_0xc3c2('0x2f')]=_0xfe3d8a['attributes'][_0xc3c2('0x32')]?_0xfe3d8a[_0xc3c2('0x2f')]:_0x2f1e32[_0xc3c2('0x30')];if(!_0x2da00d['query'][_0xc3c2('0x33')](_0xc3c2('0x34'))){_0xfe3d8a[_0xc3c2('0x1a')]=qs[_0xc3c2('0x1a')](_0x2da00d[_0xc3c2('0x2d')][_0xc3c2('0x1a')]);_0xfe3d8a[_0xc3c2('0x18')]=qs[_0xc3c2('0x18')](_0x2da00d[_0xc3c2('0x2d')][_0xc3c2('0x18')]);}_0xfe3d8a['order']=qs[_0xc3c2('0x35')](_0x2da00d[_0xc3c2('0x2d')][_0xc3c2('0x35')]);_0xfe3d8a[_0xc3c2('0x36')]=qs[_0xc3c2('0x37')](_[_0xc3c2('0x38')](_0x2da00d[_0xc3c2('0x2d')],_0x2f1e32[_0xc3c2('0x37')]));_0xfe3d8a[_0xc3c2('0x36')]['CampaignId']=_0x285062['id'];if(_0x2da00d['query'][_0xc3c2('0x39')]){_0xfe3d8a[_0xc3c2('0x36')]=_[_0xc3c2('0x3c')](_0xfe3d8a[_0xc3c2('0x36')],{'$or':_[_0xc3c2('0x3a')](_0xfe3d8a[_0xc3c2('0x2f')],function(_0x1d5c76){var _0x5e5b6d={};_0x5e5b6d[_0x1d5c76]={'$like':'%'+_0x2da00d[_0xc3c2('0x2d')]['filter']+'%'};return _0x5e5b6d;})});}_0xfe3d8a=_['merge']({},_0xfe3d8a,_0x2da00d[_0xc3c2('0x43')]);return db[_0xc3c2('0x5c')][_0xc3c2('0x1b')]({'where':_0xfe3d8a[_0xc3c2('0x36')]})[_0xc3c2('0x25')](function(_0x989caa){_0x20a93d[_0xc3c2('0x1b')]=_0x989caa;if(_0x2da00d[_0xc3c2('0x2d')]['includeAll']){_0xfe3d8a[_0xc3c2('0x3e')]=[{'all':!![]}];}return db[_0xc3c2('0x5c')][_0xc3c2('0x3f')](_0xfe3d8a);})[_0xc3c2('0x25')](function(_0xfd6db2){_0x20a93d['rows']=_0xfd6db2;return _0x20a93d;});}})[_0xc3c2('0x25')](respondWithFilteredResult(_0x437b1f,_0xfe3d8a))['catch'](handleError(_0x437b1f,null));};exports[_0xc3c2('0x5d')]=function(_0x17266a,_0x392306,_0x5e5690){var _0x3a758b={};var _0x50a83a={};var _0x42ec22;var _0x2eb265;return db[_0xc3c2('0x2a')][_0xc3c2('0x58')]({'where':{'id':_0x17266a[_0xc3c2('0x4c')]['id']}})[_0xc3c2('0x25')](handleEntityNotFound(_0x392306,null))[_0xc3c2('0x25')](function(_0x4ecb63){if(_0x4ecb63){_0x42ec22=_0x4ecb63;_0x50a83a['model']=_[_0xc3c2('0x42')](db[_0xc3c2('0x5e')][_0xc3c2('0x4d')]);_0x50a83a[_0xc3c2('0x2d')]=_[_0xc3c2('0x42')](_0x17266a[_0xc3c2('0x2d')]);_0x50a83a[_0xc3c2('0x37')]=_[_0xc3c2('0x2e')](_0x50a83a[_0xc3c2('0x30')],_0x50a83a[_0xc3c2('0x2d')]);_0x3a758b['attributes']=_[_0xc3c2('0x2e')](_0x50a83a['model'],qs[_0xc3c2('0x31')](_0x17266a[_0xc3c2('0x2d')][_0xc3c2('0x31')]));_0x3a758b[_0xc3c2('0x2f')]=_0x3a758b['attributes'][_0xc3c2('0x32')]?_0x3a758b['attributes']:_0x50a83a[_0xc3c2('0x30')];_0x3a758b[_0xc3c2('0x56')]=qs[_0xc3c2('0x35')](_0x17266a[_0xc3c2('0x2d')][_0xc3c2('0x35')]);_0x3a758b[_0xc3c2('0x36')]=qs[_0xc3c2('0x37')](_[_0xc3c2('0x38')](_0x17266a['query'],_0x50a83a[_0xc3c2('0x37')]));if(_0x17266a[_0xc3c2('0x2d')][_0xc3c2('0x39')]){_0x3a758b[_0xc3c2('0x36')]=_[_0xc3c2('0x3c')](_0x3a758b['where'],{'$or':_[_0xc3c2('0x3a')](_0x3a758b[_0xc3c2('0x2f')],function(_0x44a5ba){var _0x29527a={};_0x29527a[_0x44a5ba]={'$like':'%'+_0x17266a[_0xc3c2('0x2d')][_0xc3c2('0x39')]+'%'};return _0x29527a;})});}_0x3a758b=_[_0xc3c2('0x3c')]({},_0x3a758b,_0x17266a[_0xc3c2('0x43')]);return _0x42ec22[_0xc3c2('0x5d')](_0x3a758b);}})[_0xc3c2('0x25')](function(_0x4efe4e){if(_0x4efe4e){_0x2eb265=_0x4efe4e[_0xc3c2('0x32')];if(!_0x17266a[_0xc3c2('0x2d')][_0xc3c2('0x33')](_0xc3c2('0x34'))){_0x3a758b[_0xc3c2('0x1a')]=qs['limit'](_0x17266a[_0xc3c2('0x2d')][_0xc3c2('0x1a')]);_0x3a758b['offset']=qs[_0xc3c2('0x18')](_0x17266a[_0xc3c2('0x2d')][_0xc3c2('0x18')]);}return _0x42ec22[_0xc3c2('0x5d')](_0x3a758b);}})[_0xc3c2('0x25')](function(_0x2d133c){if(_0x2d133c){return _0x2d133c?{'count':_0x2eb265,'rows':_0x2d133c}:null;}})['then'](respondWithResult(_0x392306,null))[_0xc3c2('0x45')](handleError(_0x392306,null));};exports[_0xc3c2('0x5f')]=function(_0x277324,_0x501b00,_0x2f2486){var _0x38508,_0x1d729b;var _0x13e363=[];var _0x25f9be=moment()['format'](_0xc3c2('0x60'));return db[_0xc3c2('0x2a')]['find']({'where':{'id':_0x277324['params']['id']}})[_0xc3c2('0x25')](handleEntityNotFound(_0x501b00,null))[_0xc3c2('0x25')](function(_0x302be4){if(_0x302be4){_0x1d729b=_0x302be4;return _0x302be4[_0xc3c2('0x5f')](_0x277324[_0xc3c2('0x47')][_0xc3c2('0x61')],_[_0xc3c2('0x4e')](_0x277324[_0xc3c2('0x47')],[_0xc3c2('0x61'),'id'])||{});}return null;})['spread'](function(_0x2a6c1f){var _0x3ee015;var _0x1630d6;_0x38508=_0x2a6c1f||[];var _0x50c925=[];if(_0x2a6c1f){for(var _0x32f37f=0x0;_0x32f37f<_0x2a6c1f[_0xc3c2('0x32')];_0x32f37f+=0x1){var _0x285c85=_0x2a6c1f[_0x32f37f][_0xc3c2('0x22')]({'plain':!![]});_0x1d729b[_0xc3c2('0x62')]=_0x277324[_0xc3c2('0x47')][_0xc3c2('0x62')]?_0x277324[_0xc3c2('0x47')][_0xc3c2('0x62')]:_0x1d729b[_0xc3c2('0x62')];switch(_0x1d729b[_0xc3c2('0x62')]){case _0xc3c2('0x63'):_0x3ee015=squel[_0xc3c2('0x64')]()[_0xc3c2('0x65')](_0xc3c2('0x66'))[_0xc3c2('0x67')]([_0xc3c2('0x68'),_0xc3c2('0x69'),'ContactId',_0xc3c2('0x6a'),_0xc3c2('0x57'),'createdAt',_0xc3c2('0x50')],squel['select']()[_0xc3c2('0x6b')](_0xc3c2('0x68'),_0xc3c2('0x68'))['field'](_0xc3c2('0x6c'),_0xc3c2('0x69'))[_0xc3c2('0x6b')]('id',_0xc3c2('0x6d'))[_0xc3c2('0x6b')](_0x285c85[_0xc3c2('0x6e')]['toString'](),'ListId')[_0xc3c2('0x6b')](_0x277324[_0xc3c2('0x4c')]['id'][_0xc3c2('0x6f')](),_0xc3c2('0x57'))[_0xc3c2('0x6b')]('\x27'+_0x25f9be+'\x27',_0xc3c2('0x4f'))[_0xc3c2('0x6b')]('\x27'+_0x25f9be+'\x27',_0xc3c2('0x50'))[_0xc3c2('0x70')](_0xc3c2('0x71'))[_0xc3c2('0x36')](_0xc3c2('0x72'))[_0xc3c2('0x36')](_0xc3c2('0x73'),_0x285c85[_0xc3c2('0x6e')][_0xc3c2('0x6f')]())[_0xc3c2('0x36')](_0xc3c2('0x74'))[_0xc3c2('0x36')](_0xc3c2('0x75'),squel[_0xc3c2('0x76')]()[_0xc3c2('0x6b')](_0xc3c2('0x77'))[_0xc3c2('0x70')]('cm_hopper_final')['where'](_0xc3c2('0x78'),_0x277324[_0xc3c2('0x4c')]['id'][_0xc3c2('0x6f')]()))['where'](_0xc3c2('0x75'),squel[_0xc3c2('0x76')]()[_0xc3c2('0x6b')](_0xc3c2('0x79'))['from']('cm_hopper')[_0xc3c2('0x36')](_0xc3c2('0x78'),_0x277324[_0xc3c2('0x4c')]['id'][_0xc3c2('0x6f')]())))[_0xc3c2('0x6f')]();break;case'onlyIfOpen':_0x3ee015=squel[_0xc3c2('0x64')]()[_0xc3c2('0x65')]('cm_hopper')[_0xc3c2('0x67')]([_0xc3c2('0x68'),_0xc3c2('0x69'),'ContactId','ListId',_0xc3c2('0x57'),_0xc3c2('0x4f'),_0xc3c2('0x50')],squel[_0xc3c2('0x76')]()['field'](_0xc3c2('0x68'),_0xc3c2('0x68'))[_0xc3c2('0x6b')](_0xc3c2('0x6c'),_0xc3c2('0x69'))[_0xc3c2('0x6b')]('id',_0xc3c2('0x6d'))[_0xc3c2('0x6b')](_0x285c85['CmListId'][_0xc3c2('0x6f')](),_0xc3c2('0x6a'))[_0xc3c2('0x6b')](_0x277324['params']['id'][_0xc3c2('0x6f')](),'CampaignId')[_0xc3c2('0x6b')]('\x27'+_0x25f9be+'\x27','createdAt')[_0xc3c2('0x6b')]('\x27'+_0x25f9be+'\x27','updatedAt')[_0xc3c2('0x70')](_0xc3c2('0x71'))[_0xc3c2('0x36')](_0xc3c2('0x72'))[_0xc3c2('0x36')](_0xc3c2('0x73'),_0x285c85[_0xc3c2('0x6e')]['toString']())[_0xc3c2('0x36')]('phone\x20IS\x20NOT\x20NULL')[_0xc3c2('0x36')](_0xc3c2('0x75'),squel['select']()[_0xc3c2('0x6b')](_0xc3c2('0x79'))[_0xc3c2('0x70')](_0xc3c2('0x66'))[_0xc3c2('0x36')](_0xc3c2('0x78'),_0x277324[_0xc3c2('0x4c')]['id'][_0xc3c2('0x6f')]())))['toString']();break;default:_0x3ee015=squel['insert']()[_0xc3c2('0x65')](_0xc3c2('0x66'))[_0xc3c2('0x67')]([_0xc3c2('0x68'),_0xc3c2('0x69'),_0xc3c2('0x6d'),_0xc3c2('0x6a'),_0xc3c2('0x57'),_0xc3c2('0x4f'),_0xc3c2('0x50')],squel['select']()[_0xc3c2('0x6b')](_0xc3c2('0x68'),_0xc3c2('0x68'))[_0xc3c2('0x6b')]('NOW()','scheduledAt')[_0xc3c2('0x6b')]('id',_0xc3c2('0x6d'))[_0xc3c2('0x6b')](_0x285c85['CmListId'][_0xc3c2('0x6f')](),_0xc3c2('0x6a'))['field'](_0x277324[_0xc3c2('0x4c')]['id'][_0xc3c2('0x6f')](),_0xc3c2('0x57'))['field']('\x27'+_0x25f9be+'\x27',_0xc3c2('0x4f'))[_0xc3c2('0x6b')]('\x27'+_0x25f9be+'\x27',_0xc3c2('0x50'))[_0xc3c2('0x70')]('cm_contacts')[_0xc3c2('0x36')](_0xc3c2('0x72'))[_0xc3c2('0x36')](_0xc3c2('0x73'),_0x285c85[_0xc3c2('0x6e')][_0xc3c2('0x6f')]())[_0xc3c2('0x36')](_0xc3c2('0x74')))['toString']();}_0x1630d6=squel[_0xc3c2('0x64')]()[_0xc3c2('0x65')]('cm_hopper_additional_phones')['fromQuery']([_0xc3c2('0x7a'),_0xc3c2('0x69'),'phone','OrderBy',_0xc3c2('0x4f'),_0xc3c2('0x50')],squel[_0xc3c2('0x76')]()[_0xc3c2('0x6b')](_0xc3c2('0x7b'),'id')[_0xc3c2('0x6b')]('NOW()',_0xc3c2('0x69'))[_0xc3c2('0x6b')](_0xc3c2('0x7c'),_0xc3c2('0x68'))[_0xc3c2('0x6b')](_0xc3c2('0x7d'),'OrderBy')[_0xc3c2('0x6b')]('\x27'+_0x25f9be+'\x27',_0xc3c2('0x4f'))['field']('\x27'+_0x25f9be+'\x27',_0xc3c2('0x50'))[_0xc3c2('0x70')](_0xc3c2('0x7e'),'ci')['join'](_0xc3c2('0x66'),'h',_0xc3c2('0x7f'))[_0xc3c2('0x36')]('h.ListId\x20=\x20?',_0x285c85['CmListId'][_0xc3c2('0x6f')]())[_0xc3c2('0x36')](_0xc3c2('0x80'),_0x277324['params']['id'][_0xc3c2('0x6f')]())[_0xc3c2('0x36')](_0xc3c2('0x81'),_0x25f9be))[_0xc3c2('0x6f')]();_0x50c925[_0xc3c2('0x82')](db['sequelize'][_0xc3c2('0x2d')](_0x3ee015));_0x13e363[_0xc3c2('0x82')](db[_0xc3c2('0x83')][_0xc3c2('0x2d')](_0x1630d6));}return BPromise[_0xc3c2('0x84')](_0x50c925);}})['then'](function(){return BPromise['all'](_0x13e363);})['then'](function(){return _0x38508;})[_0xc3c2('0x25')](respondWithResult(_0x501b00,null))[_0xc3c2('0x45')](handleError(_0x501b00,null));};exports['removeLists']=function(_0x3aca93,_0x4ce05e,_0x9d07af){return db[_0xc3c2('0x2a')]['find']({'where':{'id':_0x3aca93[_0xc3c2('0x4c')]['id']}})['then'](handleEntityNotFound(_0x4ce05e,null))[_0xc3c2('0x25')](function(_0x592d2b){if(_0x592d2b){return _0x592d2b[_0xc3c2('0x85')](_0x3aca93[_0xc3c2('0x2d')][_0xc3c2('0x61')]);}})[_0xc3c2('0x25')](function(_0x277714){if(_0x277714){return db[_0xc3c2('0x55')][_0xc3c2('0x21')]({'where':{'ListId':_0x3aca93['query']['ids'],'CampaignId':_0x3aca93['params']['id']}})[_0xc3c2('0x25')](function(){return _0x277714;});}})[_0xc3c2('0x25')](respondWithStatusCode(_0x4ce05e,null))[_0xc3c2('0x45')](handleError(_0x4ce05e,null));};exports[_0xc3c2('0x86')]=function(_0x36d216,_0x2ba4c1,_0x1cc0e0){var _0xfe4659={};var _0x16836f={};var _0x282c83;var _0xec0903;return db[_0xc3c2('0x2a')][_0xc3c2('0x58')]({'where':{'id':_0x36d216[_0xc3c2('0x4c')]['id']}})[_0xc3c2('0x25')](handleEntityNotFound(_0x2ba4c1,null))[_0xc3c2('0x25')](function(_0x2efb8d){if(_0x2efb8d){_0x282c83=_0x2efb8d;_0x16836f[_0xc3c2('0x30')]=_[_0xc3c2('0x42')](db['CmList'][_0xc3c2('0x4d')]);_0x16836f['query']=_[_0xc3c2('0x42')](_0x36d216[_0xc3c2('0x2d')]);_0x16836f[_0xc3c2('0x37')]=_['intersection'](_0x16836f[_0xc3c2('0x30')],_0x16836f[_0xc3c2('0x2d')]);_0xfe4659['attributes']=_[_0xc3c2('0x2e')](_0x16836f[_0xc3c2('0x30')],qs[_0xc3c2('0x31')](_0x36d216[_0xc3c2('0x2d')][_0xc3c2('0x31')]));_0xfe4659[_0xc3c2('0x2f')]=_0xfe4659['attributes'][_0xc3c2('0x32')]?_0xfe4659['attributes']:_0x16836f[_0xc3c2('0x30')];_0xfe4659[_0xc3c2('0x56')]=qs['sort'](_0x36d216[_0xc3c2('0x2d')]['sort']);_0xfe4659[_0xc3c2('0x36')]=qs[_0xc3c2('0x37')](_['pick'](_0x36d216[_0xc3c2('0x2d')],_0x16836f['filters']));if(_0x36d216[_0xc3c2('0x2d')][_0xc3c2('0x39')]){_0xfe4659['where']=_[_0xc3c2('0x3c')](_0xfe4659[_0xc3c2('0x36')],{'$or':_[_0xc3c2('0x3a')](_0xfe4659[_0xc3c2('0x2f')],function(_0x4263bd){var _0x4befa9={};_0x4befa9[_0x4263bd]={'$like':'%'+_0x36d216['query'][_0xc3c2('0x39')]+'%'};return _0x4befa9;})});}_0xfe4659=_['merge']({},_0xfe4659,_0x36d216['options']);return _0x282c83[_0xc3c2('0x86')](_0xfe4659);}})[_0xc3c2('0x25')](function(_0x101950){if(_0x101950){_0xec0903=_0x101950['length'];if(!_0x36d216['query'][_0xc3c2('0x33')]('nolimit')){_0xfe4659[_0xc3c2('0x1a')]=qs[_0xc3c2('0x1a')](_0x36d216[_0xc3c2('0x2d')][_0xc3c2('0x1a')]);_0xfe4659['offset']=qs[_0xc3c2('0x18')](_0x36d216[_0xc3c2('0x2d')]['offset']);}return _0x282c83[_0xc3c2('0x86')](_0xfe4659);}})[_0xc3c2('0x25')](function(_0x3d023e){if(_0x3d023e){return _0x3d023e?{'count':_0xec0903,'rows':_0x3d023e}:null;}})['then'](respondWithResult(_0x2ba4c1,null))['catch'](handleError(_0x2ba4c1,null));};exports[_0xc3c2('0x87')]=function(_0x10b4d2,_0x1c58cc,_0x39c3db){var _0x288ef4,_0x1c7d72;var _0xa9fbaf=[];var _0x5ac5b7=moment()['format'](_0xc3c2('0x60'));return db['Campaign']['find']({'where':{'id':_0x10b4d2[_0xc3c2('0x4c')]['id']}})[_0xc3c2('0x25')](handleEntityNotFound(_0x1c58cc,null))[_0xc3c2('0x25')](function(_0x2916be){if(_0x2916be){_0x1c7d72=_0x2916be;return _0x2916be['addBlackLists'](_0x10b4d2[_0xc3c2('0x47')]['ids'],_[_0xc3c2('0x4e')](_0x10b4d2[_0xc3c2('0x47')],['ids','id'])||{});}return null;})[_0xc3c2('0x88')](function(_0x2842b9){var _0xb4599e;var _0x122f63;_0x288ef4=_0x2842b9||[];var _0x284c51=[];if(_0x2842b9){for(var _0x2c36ee=0x0;_0x2c36ee<_0x2842b9[_0xc3c2('0x32')];_0x2c36ee+=0x1){var _0x12c252=_0x2842b9[_0x2c36ee][_0xc3c2('0x22')]({'plain':!![]});_0xb4599e=squel[_0xc3c2('0x64')]()[_0xc3c2('0x65')](_0xc3c2('0x89'))[_0xc3c2('0x67')]([_0xc3c2('0x68'),_0xc3c2('0x6d'),_0xc3c2('0x6a'),_0xc3c2('0x57'),_0xc3c2('0x4f'),_0xc3c2('0x50')],squel[_0xc3c2('0x76')]()[_0xc3c2('0x6b')](_0xc3c2('0x68'),_0xc3c2('0x68'))[_0xc3c2('0x6b')]('id',_0xc3c2('0x6d'))[_0xc3c2('0x6b')](_0x12c252['CmListId'][_0xc3c2('0x6f')](),_0xc3c2('0x6a'))[_0xc3c2('0x6b')](_0x10b4d2[_0xc3c2('0x4c')]['id'][_0xc3c2('0x6f')](),_0xc3c2('0x57'))[_0xc3c2('0x6b')](_0xc3c2('0x6c'),_0xc3c2('0x4f'))[_0xc3c2('0x6b')](_0xc3c2('0x6c'),'updatedAt')[_0xc3c2('0x70')](_0xc3c2('0x71'))['where'](_0xc3c2('0x72'))[_0xc3c2('0x36')](_0xc3c2('0x73'),_0x12c252['CmListId'][_0xc3c2('0x6f')]())[_0xc3c2('0x36')](_0xc3c2('0x74')))['toString']();_0x284c51[_0xc3c2('0x82')](db[_0xc3c2('0x83')][_0xc3c2('0x2d')](_0xb4599e));}return BPromise[_0xc3c2('0x84')](_0x284c51);}})['then'](function(){return _0x288ef4;})[_0xc3c2('0x25')](respondWithResult(_0x1c58cc,null))['catch'](handleError(_0x1c58cc,null));};exports['removeBlackLists']=function(_0xecc24b,_0x5a15a7,_0x4953a2){return db[_0xc3c2('0x2a')][_0xc3c2('0x44')]({'where':{'id':_0xecc24b['params']['id']}})[_0xc3c2('0x25')](handleEntityNotFound(_0x5a15a7,null))[_0xc3c2('0x25')](function(_0x1d4e24){if(_0x1d4e24){return _0x1d4e24[_0xc3c2('0x8a')](_0xecc24b[_0xc3c2('0x2d')][_0xc3c2('0x61')]);}})[_0xc3c2('0x25')](function(_0x2dea89){if(_0x2dea89){return db[_0xc3c2('0x5c')][_0xc3c2('0x21')]({'where':{'ListId':_0xecc24b['query'][_0xc3c2('0x61')],'CampaignId':_0xecc24b[_0xc3c2('0x4c')]['id']}})[_0xc3c2('0x25')](function(){return _0x2dea89;});}})[_0xc3c2('0x25')](respondWithStatusCode(_0x5a15a7,null))[_0xc3c2('0x45')](handleError(_0x5a15a7,null));}; \ No newline at end of file +var _0xcdd0=['YYYY-MM-DD\x20HH:mm:ss','ids','spread','dialCheckDuplicateType','insert','fromQuery','phone','scheduledAt','ContactId','ListId','field','NOW()','toString','updatedAt','from','cm_contacts','deletedAt\x20IS\x20NULL','ListId\x20=\x20?','select','cm_hopper_final','CampaignId\x20=\x20?','phone\x20NOT\x20IN\x20(?)','COALESCE(phone,\x27\x27)','onlyIfOpen','cm_hopper','CmListId','phone\x20IS\x20NOT\x20NULL','into','cm_hopper_additional_phones','cmHopperId','h.id','ci.item','ci.OrderBY','join','h.ContactId\x20=\x20ci.CmContactId','h.ListId\x20=\x20?','sequelize','push','all','removeLists','getBlackLists','CmList','addBlackLists','cm_hopper_black','removeBlackLists','rimraf','zip-dir','fast-json-patch','request-promise','mustache','util','path','sox','to-csv','ejs','fs-extra','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','count','set','Content-Range','apply','reject','save','then','destroy','UserProfileResource','error','stack','name','send','index','map','Campaign','rawAttributes','type','key','query','keys','filters','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','limit','sort','pick','filter','where','merge','options','includeAll','findAll','rows','show','params','include','catch','create','user','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','IvrCampaigns','UserProfileSection','find','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','omit','createdAt','body','getHoppers','order','CampaignId','CmHopper','getHopperHistories','findOne','CmHopperHistory','CmHopperFinal','getHopperBlacks','CmHopperBlack','getLists','addLists','format'];(function(_0x3b799e,_0x2a8101){var _0x16894c=function(_0x35db8f){while(--_0x35db8f){_0x3b799e['push'](_0x3b799e['shift']());}};_0x16894c(++_0x2a8101);}(_0xcdd0,0xbd));var _0x0cdd=function(_0x2160a9,_0x3cbd9e){_0x2160a9=_0x2160a9-0x0;var _0xa88cf7=_0xcdd0[_0x2160a9];return _0xa88cf7;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x0cdd('0x0'));var zipdir=require(_0x0cdd('0x1'));var jsonpatch=require(_0x0cdd('0x2'));var rp=require(_0x0cdd('0x3'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0x0cdd('0x4'));var util=require(_0x0cdd('0x5'));var path=require(_0x0cdd('0x6'));var sox=require(_0x0cdd('0x7'));var csv=require(_0x0cdd('0x8'));var ejs=require(_0x0cdd('0x9'));var fs=require('fs');var fs_extra=require(_0x0cdd('0xa'));var _=require('lodash');var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0x0cdd('0xb'));var deskjs=require(_0x0cdd('0xc'));var toCsv=require(_0x0cdd('0x8'));var querystring=require(_0x0cdd('0xd'));var Papa=require(_0x0cdd('0xe'));var Redis=require(_0x0cdd('0xf'));var authService=require(_0x0cdd('0x10'));var qs=require(_0x0cdd('0x11'));var as=require(_0x0cdd('0x12'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x0cdd('0x13'));var utils=require(_0x0cdd('0x14'));var config=require(_0x0cdd('0x15'));var licenseUtil=require(_0x0cdd('0x16'));var db=require(_0x0cdd('0x17'))['db'];function respondWithStatusCode(_0x95134f,_0x5b73cf){_0x5b73cf=_0x5b73cf||0xcc;return function(_0x202d66){if(_0x202d66){return _0x95134f[_0x0cdd('0x18')](_0x5b73cf);}return _0x95134f[_0x0cdd('0x19')](_0x5b73cf)[_0x0cdd('0x1a')]();};}function respondWithResult(_0x294eb9,_0x2ee25a){_0x2ee25a=_0x2ee25a||0xc8;return function(_0x3b650e){if(_0x3b650e){return _0x294eb9[_0x0cdd('0x19')](_0x2ee25a)[_0x0cdd('0x1b')](_0x3b650e);}};}function respondWithFilteredResult(_0xd5cd92,_0x46d3f8){return function(_0x4eccdf){if(_0x4eccdf){var _0x58b910=typeof _0x46d3f8[_0x0cdd('0x1c')]==='undefined'&&typeof _0x46d3f8['limit']==='undefined';var _0x16c598=_0x4eccdf[_0x0cdd('0x1d')];var _0xa32aa6=_0x58b910?0x0:_0x46d3f8[_0x0cdd('0x1c')];var _0x172eac=_0x58b910?_0x4eccdf[_0x0cdd('0x1d')]:_0x46d3f8[_0x0cdd('0x1c')]+_0x46d3f8['limit'];var _0x1c0d45;if(_0x172eac>=_0x16c598){_0x172eac=_0x16c598;_0x1c0d45=0xc8;}else{_0x1c0d45=0xce;}_0xd5cd92['status'](_0x1c0d45);return _0xd5cd92[_0x0cdd('0x1e')](_0x0cdd('0x1f'),_0xa32aa6+'-'+_0x172eac+'/'+_0x16c598)[_0x0cdd('0x1b')](_0x4eccdf);}return null;};}function patchUpdates(_0x439013){return function(_0x3cc52a){try{jsonpatch[_0x0cdd('0x20')](_0x3cc52a,_0x439013,!![]);}catch(_0x5e636b){return BPromise[_0x0cdd('0x21')](_0x5e636b);}return _0x3cc52a[_0x0cdd('0x22')]();};}function saveUpdates(_0x301d64,_0x5eb5ad){return function(_0x55c89d){if(_0x55c89d){return _0x55c89d['update'](_0x301d64)[_0x0cdd('0x23')](function(_0x2bcb58){return _0x2bcb58;});}return null;};}function removeEntity(_0x338aef,_0x1785c6){return function(_0x233e44){if(_0x233e44){return _0x233e44[_0x0cdd('0x24')]()[_0x0cdd('0x23')](function(){var _0x122bcb=_0x233e44['get']({'plain':!![]});var _0x59a0a6='IvrCampaigns';return db[_0x0cdd('0x25')][_0x0cdd('0x24')]({'where':{'type':_0x59a0a6,'resourceId':_0x122bcb['id']}})['then'](function(){return _0x233e44;});})['then'](function(){_0x338aef['status'](0xcc)[_0x0cdd('0x1a')]();});}};}function handleEntityNotFound(_0x39c489,_0x3185b8){return function(_0x34534d){if(!_0x34534d){_0x39c489['sendStatus'](0x194);}return _0x34534d;};}function handleError(_0x3021ed,_0x4aa2d0){_0x4aa2d0=_0x4aa2d0||0x1f4;return function(_0x21ad5e){logger[_0x0cdd('0x26')](_0x21ad5e[_0x0cdd('0x27')]);if(_0x21ad5e[_0x0cdd('0x28')]){delete _0x21ad5e[_0x0cdd('0x28')];}_0x3021ed['status'](_0x4aa2d0)[_0x0cdd('0x29')](_0x21ad5e);};}exports[_0x0cdd('0x2a')]=function(_0x2b6296,_0x10e09c){var _0x3c6ffd={},_0x52ce64={},_0x47300f={'count':0x0,'rows':[]};var _0x551bc4=_[_0x0cdd('0x2b')](db[_0x0cdd('0x2c')][_0x0cdd('0x2d')],function(_0x31cd52){return{'name':_0x31cd52['fieldName'],'type':_0x31cd52[_0x0cdd('0x2e')][_0x0cdd('0x2f')]};});_0x52ce64['model']=_[_0x0cdd('0x2b')](_0x551bc4,_0x0cdd('0x28'));_0x52ce64[_0x0cdd('0x30')]=_[_0x0cdd('0x31')](_0x2b6296[_0x0cdd('0x30')]);_0x52ce64[_0x0cdd('0x32')]=_[_0x0cdd('0x33')](_0x52ce64[_0x0cdd('0x34')],_0x52ce64[_0x0cdd('0x30')]);_0x3c6ffd[_0x0cdd('0x35')]=_[_0x0cdd('0x33')](_0x52ce64[_0x0cdd('0x34')],qs['fields'](_0x2b6296[_0x0cdd('0x30')][_0x0cdd('0x36')]));_0x3c6ffd[_0x0cdd('0x35')]=_0x3c6ffd['attributes'][_0x0cdd('0x37')]?_0x3c6ffd['attributes']:_0x52ce64['model'];if(!_0x2b6296[_0x0cdd('0x30')][_0x0cdd('0x38')](_0x0cdd('0x39'))){_0x3c6ffd[_0x0cdd('0x3a')]=qs['limit'](_0x2b6296['query']['limit']);_0x3c6ffd['offset']=qs[_0x0cdd('0x1c')](_0x2b6296[_0x0cdd('0x30')][_0x0cdd('0x1c')]);}_0x3c6ffd['order']=qs[_0x0cdd('0x3b')](_0x2b6296[_0x0cdd('0x30')]['sort']);_0x3c6ffd['where']=qs[_0x0cdd('0x32')](_[_0x0cdd('0x3c')](_0x2b6296[_0x0cdd('0x30')],_0x52ce64[_0x0cdd('0x32')]),_0x551bc4);if(_0x2b6296[_0x0cdd('0x30')][_0x0cdd('0x3d')]){_0x3c6ffd[_0x0cdd('0x3e')]=_[_0x0cdd('0x3f')](_0x3c6ffd[_0x0cdd('0x3e')],{'$or':_[_0x0cdd('0x2b')](_0x551bc4,function(_0x9b8ad1){if(_0x9b8ad1['type']!=='VIRTUAL'){var _0x9dc920={};_0x9dc920[_0x9b8ad1[_0x0cdd('0x28')]]={'$like':'%'+_0x2b6296['query'][_0x0cdd('0x3d')]+'%'};return _0x9dc920;}})});}_0x3c6ffd=_[_0x0cdd('0x3f')]({},_0x3c6ffd,_0x2b6296[_0x0cdd('0x40')]);var _0xc30df1={'where':_0x3c6ffd[_0x0cdd('0x3e')]};return db[_0x0cdd('0x2c')]['count'](_0xc30df1)[_0x0cdd('0x23')](function(_0x185079){_0x47300f[_0x0cdd('0x1d')]=_0x185079;if(_0x2b6296[_0x0cdd('0x30')][_0x0cdd('0x41')]){_0x3c6ffd['include']=[{'all':!![]}];}return db['Campaign'][_0x0cdd('0x42')](_0x3c6ffd);})[_0x0cdd('0x23')](function(_0x12fceb){_0x47300f[_0x0cdd('0x43')]=_0x12fceb;return _0x47300f;})[_0x0cdd('0x23')](respondWithFilteredResult(_0x10e09c,_0x3c6ffd))['catch'](handleError(_0x10e09c,null));};exports[_0x0cdd('0x44')]=function(_0x21fc5d,_0x49288e){var _0xe433b={'raw':![],'where':{'id':_0x21fc5d[_0x0cdd('0x45')]['id']}},_0x52aba3={};_0x52aba3[_0x0cdd('0x34')]=_[_0x0cdd('0x31')](db[_0x0cdd('0x2c')]['rawAttributes']);_0x52aba3[_0x0cdd('0x30')]=_['keys'](_0x21fc5d['query']);_0x52aba3[_0x0cdd('0x32')]=_['intersection'](_0x52aba3['model'],_0x52aba3[_0x0cdd('0x30')]);_0xe433b[_0x0cdd('0x35')]=_[_0x0cdd('0x33')](_0x52aba3[_0x0cdd('0x34')],qs[_0x0cdd('0x36')](_0x21fc5d[_0x0cdd('0x30')][_0x0cdd('0x36')]));_0xe433b[_0x0cdd('0x35')]=_0xe433b[_0x0cdd('0x35')][_0x0cdd('0x37')]?_0xe433b[_0x0cdd('0x35')]:_0x52aba3[_0x0cdd('0x34')];if(_0x21fc5d[_0x0cdd('0x30')]['includeAll']){_0xe433b[_0x0cdd('0x46')]=[{'all':!![]}];}_0xe433b=_[_0x0cdd('0x3f')]({},_0xe433b,_0x21fc5d['options']);return db['Campaign']['find'](_0xe433b)[_0x0cdd('0x23')](handleEntityNotFound(_0x49288e,null))[_0x0cdd('0x23')](respondWithResult(_0x49288e,null))[_0x0cdd('0x47')](handleError(_0x49288e,null));};exports[_0x0cdd('0x48')]=function(_0x298204,_0x6d0518){return db[_0x0cdd('0x2c')][_0x0cdd('0x48')](_0x298204['body'],{})[_0x0cdd('0x23')](function(_0x4bd513){var _0x333678=_0x298204[_0x0cdd('0x49')][_0x0cdd('0x4a')]({'plain':!![]});if(!_0x333678)throw new Error(_0x0cdd('0x4b'));if(_0x333678[_0x0cdd('0x4c')]===_0x0cdd('0x49')){var _0x2b403a=_0x4bd513[_0x0cdd('0x4a')]({'plain':!![]});var _0x50523b=_0x0cdd('0x4d');return db[_0x0cdd('0x4e')][_0x0cdd('0x4f')]({'where':{'name':_0x50523b,'userProfileId':_0x333678[_0x0cdd('0x50')]},'raw':!![]})[_0x0cdd('0x23')](function(_0x1e514b){if(_0x1e514b&&_0x1e514b[_0x0cdd('0x51')]===0x0){return db['UserProfileResource'][_0x0cdd('0x48')]({'name':_0x2b403a['name'],'resourceId':_0x2b403a['id'],'type':_0x1e514b[_0x0cdd('0x28')],'sectionId':_0x1e514b['id']},{})[_0x0cdd('0x23')](function(){return _0x4bd513;});}else{return _0x4bd513;}})['catch'](function(_0x17c507){logger[_0x0cdd('0x26')](_0x0cdd('0x52'),_0x17c507);throw _0x17c507;});}return _0x4bd513;})[_0x0cdd('0x23')](respondWithResult(_0x6d0518,0xc9))['catch'](handleError(_0x6d0518,null));};exports['clone']=function(_0x24f4ea,_0xf80dc3){var _0x50c27c={'where':{'id':_0x24f4ea[_0x0cdd('0x45')]['id']}},_0x969106={};_0x969106[_0x0cdd('0x34')]=_[_0x0cdd('0x31')](db[_0x0cdd('0x2c')][_0x0cdd('0x2d')]);_0x50c27c['attributes']=_[_0x0cdd('0x33')](_0x969106[_0x0cdd('0x34')],qs[_0x0cdd('0x36')](_0x24f4ea['query'][_0x0cdd('0x36')]));_0x50c27c[_0x0cdd('0x35')]=_0x50c27c[_0x0cdd('0x35')][_0x0cdd('0x37')]?_0x50c27c[_0x0cdd('0x35')]:_0x969106['model'];if(_0x24f4ea[_0x0cdd('0x30')][_0x0cdd('0x41')]){_0x50c27c[_0x0cdd('0x46')]=[{'all':!![]}];}_0x50c27c=_[_0x0cdd('0x3f')]({},_0x50c27c,_0x24f4ea[_0x0cdd('0x40')]);return db[_0x0cdd('0x2c')][_0x0cdd('0x4f')](_0x50c27c)['then'](handleEntityNotFound(_0xf80dc3,null))[_0x0cdd('0x23')](function(_0x21efd4){if(_0x21efd4){var _0x1abf36=_0x21efd4[_0x0cdd('0x4a')]({'plain':!![]});_0x1abf36=qs[_0x0cdd('0x53')](_0x1abf36,['id',_0x0cdd('0x54'),'updatedAt']);_0x24f4ea[_0x0cdd('0x55')]=_[_0x0cdd('0x53')](_0x24f4ea['body'],['id',_0x0cdd('0x54'),'updatedAt']);return db['Campaign'][_0x0cdd('0x48')](_[_0x0cdd('0x3f')](_0x1abf36,_0x24f4ea[_0x0cdd('0x55')]),{'include':_0x24f4ea[_0x0cdd('0x30')]['includeAll']?[{'all':!![]}]:undefined})['then'](function(_0x397cbb){var _0x4ac127=_0x24f4ea[_0x0cdd('0x49')]['get']({'plain':!![]});if(!_0x4ac127)throw new Error(_0x0cdd('0x4b'));if(_0x4ac127[_0x0cdd('0x4c')]==='user'){var _0x568139=_0x397cbb[_0x0cdd('0x4a')]({'plain':!![]});var _0x232838='IvrCampaigns';return db[_0x0cdd('0x4e')][_0x0cdd('0x4f')]({'where':{'name':_0x232838,'userProfileId':_0x4ac127[_0x0cdd('0x50')]},'raw':!![]})[_0x0cdd('0x23')](function(_0x55db32){if(_0x55db32&&_0x55db32[_0x0cdd('0x51')]===0x0){return db[_0x0cdd('0x25')][_0x0cdd('0x48')]({'name':_0x568139[_0x0cdd('0x28')],'resourceId':_0x568139['id'],'type':_0x55db32[_0x0cdd('0x28')],'sectionId':_0x55db32['id']},{})['then'](function(){return _0x397cbb;});}else{return _0x397cbb;}})[_0x0cdd('0x47')](function(_0x41aee0){logger[_0x0cdd('0x26')](_0x0cdd('0x52'),_0x41aee0);throw _0x41aee0;});}return _0x397cbb;});}})[_0x0cdd('0x23')](respondWithResult(_0xf80dc3,0xc9))[_0x0cdd('0x47')](handleError(_0xf80dc3,null));};exports['update']=function(_0x4cea31,_0x283ff0){if(_0x4cea31[_0x0cdd('0x55')]['id']){delete _0x4cea31[_0x0cdd('0x55')]['id'];}return db[_0x0cdd('0x2c')]['find']({'where':{'id':_0x4cea31[_0x0cdd('0x45')]['id']}})[_0x0cdd('0x23')](handleEntityNotFound(_0x283ff0,null))[_0x0cdd('0x23')](saveUpdates(_0x4cea31[_0x0cdd('0x55')],null))[_0x0cdd('0x23')](respondWithResult(_0x283ff0,null))['catch'](handleError(_0x283ff0,null));};exports['destroy']=function(_0x2fa508,_0x59f8a1){return db[_0x0cdd('0x2c')][_0x0cdd('0x4f')]({'where':{'id':_0x2fa508[_0x0cdd('0x45')]['id']}})[_0x0cdd('0x23')](handleEntityNotFound(_0x59f8a1,null))[_0x0cdd('0x23')](removeEntity(_0x59f8a1,null))[_0x0cdd('0x47')](handleError(_0x59f8a1,null));};exports[_0x0cdd('0x56')]=function(_0x59a9d9,_0x3ff6d5,_0x501571){var _0x1400df={'raw':!![],'where':{}};var _0x2ae116={};var _0x4714ce={'count':0x0,'rows':[]};return db[_0x0cdd('0x2c')]['findOne']({'where':{'id':_0x59a9d9[_0x0cdd('0x45')]['id']}})[_0x0cdd('0x23')](handleEntityNotFound(_0x3ff6d5,null))['then'](function(_0x1bbd4f){if(_0x1bbd4f){_0x2ae116[_0x0cdd('0x34')]=_[_0x0cdd('0x31')](db['CmHopper'][_0x0cdd('0x2d')]);_0x2ae116[_0x0cdd('0x30')]=_[_0x0cdd('0x31')](_0x59a9d9[_0x0cdd('0x30')]);_0x2ae116[_0x0cdd('0x32')]=_[_0x0cdd('0x33')](_0x2ae116[_0x0cdd('0x34')],_0x2ae116[_0x0cdd('0x30')]);_0x1400df[_0x0cdd('0x35')]=_[_0x0cdd('0x33')](_0x2ae116[_0x0cdd('0x34')],qs[_0x0cdd('0x36')](_0x59a9d9[_0x0cdd('0x30')][_0x0cdd('0x36')]));_0x1400df[_0x0cdd('0x35')]=_0x1400df[_0x0cdd('0x35')]['length']?_0x1400df[_0x0cdd('0x35')]:_0x2ae116[_0x0cdd('0x34')];if(!_0x59a9d9[_0x0cdd('0x30')][_0x0cdd('0x38')](_0x0cdd('0x39'))){_0x1400df[_0x0cdd('0x3a')]=qs[_0x0cdd('0x3a')](_0x59a9d9[_0x0cdd('0x30')][_0x0cdd('0x3a')]);_0x1400df[_0x0cdd('0x1c')]=qs['offset'](_0x59a9d9[_0x0cdd('0x30')]['offset']);}_0x1400df[_0x0cdd('0x57')]=qs[_0x0cdd('0x3b')](_0x59a9d9[_0x0cdd('0x30')][_0x0cdd('0x3b')]);_0x1400df[_0x0cdd('0x3e')]=qs['filters'](_[_0x0cdd('0x3c')](_0x59a9d9[_0x0cdd('0x30')],_0x2ae116['filters']));_0x1400df[_0x0cdd('0x3e')][_0x0cdd('0x58')]=_0x1bbd4f['id'];if(_0x59a9d9[_0x0cdd('0x30')][_0x0cdd('0x3d')]){_0x1400df['where']=_['merge'](_0x1400df['where'],{'$or':_['map'](_0x1400df['attributes'],function(_0x2cd38c){var _0x40890a={};_0x40890a[_0x2cd38c]={'$like':'%'+_0x59a9d9[_0x0cdd('0x30')][_0x0cdd('0x3d')]+'%'};return _0x40890a;})});}_0x1400df=_[_0x0cdd('0x3f')]({},_0x1400df,_0x59a9d9['options']);return db[_0x0cdd('0x59')][_0x0cdd('0x1d')]({'where':_0x1400df['where']})[_0x0cdd('0x23')](function(_0x29321c){_0x4714ce['count']=_0x29321c;if(_0x59a9d9[_0x0cdd('0x30')][_0x0cdd('0x41')]){_0x1400df['include']=[{'all':!![]}];}return db[_0x0cdd('0x59')][_0x0cdd('0x42')](_0x1400df);})['then'](function(_0x2261c8){_0x4714ce[_0x0cdd('0x43')]=_0x2261c8;return _0x4714ce;});}})[_0x0cdd('0x23')](respondWithFilteredResult(_0x3ff6d5,_0x1400df))['catch'](handleError(_0x3ff6d5,null));};exports[_0x0cdd('0x5a')]=function(_0x368727,_0x500307,_0x58b1c9){var _0x3b51b5={'raw':!![],'where':{}};var _0x2c3aa1={};var _0x273500={'count':0x0,'rows':[]};return db['Campaign'][_0x0cdd('0x5b')]({'where':{'id':_0x368727['params']['id']}})['then'](handleEntityNotFound(_0x500307,null))['then'](function(_0xf0831f){if(_0xf0831f){_0x2c3aa1['model']=_[_0x0cdd('0x31')](db[_0x0cdd('0x5c')][_0x0cdd('0x2d')]);_0x2c3aa1['query']=_[_0x0cdd('0x31')](_0x368727[_0x0cdd('0x30')]);_0x2c3aa1[_0x0cdd('0x32')]=_[_0x0cdd('0x33')](_0x2c3aa1[_0x0cdd('0x34')],_0x2c3aa1['query']);_0x3b51b5[_0x0cdd('0x35')]=_[_0x0cdd('0x33')](_0x2c3aa1[_0x0cdd('0x34')],qs[_0x0cdd('0x36')](_0x368727[_0x0cdd('0x30')]['fields']));_0x3b51b5[_0x0cdd('0x35')]=_0x3b51b5[_0x0cdd('0x35')][_0x0cdd('0x37')]?_0x3b51b5[_0x0cdd('0x35')]:_0x2c3aa1[_0x0cdd('0x34')];if(!_0x368727[_0x0cdd('0x30')][_0x0cdd('0x38')](_0x0cdd('0x39'))){_0x3b51b5[_0x0cdd('0x3a')]=qs[_0x0cdd('0x3a')](_0x368727[_0x0cdd('0x30')][_0x0cdd('0x3a')]);_0x3b51b5[_0x0cdd('0x1c')]=qs[_0x0cdd('0x1c')](_0x368727[_0x0cdd('0x30')][_0x0cdd('0x1c')]);}_0x3b51b5[_0x0cdd('0x57')]=qs['sort'](_0x368727[_0x0cdd('0x30')][_0x0cdd('0x3b')]);_0x3b51b5[_0x0cdd('0x3e')]=qs[_0x0cdd('0x32')](_[_0x0cdd('0x3c')](_0x368727[_0x0cdd('0x30')],_0x2c3aa1[_0x0cdd('0x32')]));_0x3b51b5[_0x0cdd('0x3e')][_0x0cdd('0x58')]=_0xf0831f['id'];if(_0x368727[_0x0cdd('0x30')][_0x0cdd('0x3d')]){_0x3b51b5[_0x0cdd('0x3e')]=_['merge'](_0x3b51b5['where'],{'$or':_['map'](_0x3b51b5['attributes'],function(_0x40e058){var _0x492b5b={};_0x492b5b[_0x40e058]={'$like':'%'+_0x368727[_0x0cdd('0x30')][_0x0cdd('0x3d')]+'%'};return _0x492b5b;})});}_0x3b51b5=_[_0x0cdd('0x3f')]({},_0x3b51b5,_0x368727[_0x0cdd('0x40')]);return db[_0x0cdd('0x5c')][_0x0cdd('0x1d')]({'where':_0x3b51b5[_0x0cdd('0x3e')]})[_0x0cdd('0x23')](function(_0x4474a0){_0x273500[_0x0cdd('0x1d')]=_0x4474a0;if(_0x368727[_0x0cdd('0x30')][_0x0cdd('0x41')]){_0x3b51b5[_0x0cdd('0x46')]=[{'all':!![]}];}return db[_0x0cdd('0x5c')]['findAll'](_0x3b51b5);})[_0x0cdd('0x23')](function(_0xb8fbd5){_0x273500[_0x0cdd('0x43')]=_0xb8fbd5;return _0x273500;});}})[_0x0cdd('0x23')](respondWithFilteredResult(_0x500307,_0x3b51b5))['catch'](handleError(_0x500307,null));};exports['getHopperFinals']=function(_0x3404c4,_0x1cbc4b,_0xdf601){var _0x489db8={'raw':!![],'where':{}};var _0x1e8ac4={};var _0x2b9e1b={'count':0x0,'rows':[]};return db[_0x0cdd('0x2c')][_0x0cdd('0x5b')]({'where':{'id':_0x3404c4[_0x0cdd('0x45')]['id']}})[_0x0cdd('0x23')](handleEntityNotFound(_0x1cbc4b,null))[_0x0cdd('0x23')](function(_0x2eb491){if(_0x2eb491){_0x1e8ac4[_0x0cdd('0x34')]=_['keys'](db[_0x0cdd('0x5d')][_0x0cdd('0x2d')]);_0x1e8ac4[_0x0cdd('0x30')]=_['keys'](_0x3404c4['query']);_0x1e8ac4[_0x0cdd('0x32')]=_[_0x0cdd('0x33')](_0x1e8ac4['model'],_0x1e8ac4['query']);_0x489db8[_0x0cdd('0x35')]=_[_0x0cdd('0x33')](_0x1e8ac4[_0x0cdd('0x34')],qs[_0x0cdd('0x36')](_0x3404c4[_0x0cdd('0x30')][_0x0cdd('0x36')]));_0x489db8[_0x0cdd('0x35')]=_0x489db8[_0x0cdd('0x35')][_0x0cdd('0x37')]?_0x489db8[_0x0cdd('0x35')]:_0x1e8ac4[_0x0cdd('0x34')];if(!_0x3404c4[_0x0cdd('0x30')][_0x0cdd('0x38')](_0x0cdd('0x39'))){_0x489db8[_0x0cdd('0x3a')]=qs[_0x0cdd('0x3a')](_0x3404c4[_0x0cdd('0x30')]['limit']);_0x489db8[_0x0cdd('0x1c')]=qs['offset'](_0x3404c4[_0x0cdd('0x30')][_0x0cdd('0x1c')]);}_0x489db8['order']=qs[_0x0cdd('0x3b')](_0x3404c4[_0x0cdd('0x30')][_0x0cdd('0x3b')]);_0x489db8[_0x0cdd('0x3e')]=qs[_0x0cdd('0x32')](_[_0x0cdd('0x3c')](_0x3404c4[_0x0cdd('0x30')],_0x1e8ac4['filters']));_0x489db8[_0x0cdd('0x3e')][_0x0cdd('0x58')]=_0x2eb491['id'];if(_0x3404c4[_0x0cdd('0x30')][_0x0cdd('0x3d')]){_0x489db8['where']=_[_0x0cdd('0x3f')](_0x489db8[_0x0cdd('0x3e')],{'$or':_['map'](_0x489db8[_0x0cdd('0x35')],function(_0x119713){var _0x22d1db={};_0x22d1db[_0x119713]={'$like':'%'+_0x3404c4[_0x0cdd('0x30')][_0x0cdd('0x3d')]+'%'};return _0x22d1db;})});}_0x489db8=_[_0x0cdd('0x3f')]({},_0x489db8,_0x3404c4[_0x0cdd('0x40')]);return db[_0x0cdd('0x5d')]['count']({'where':_0x489db8['where']})[_0x0cdd('0x23')](function(_0x1dd709){_0x2b9e1b[_0x0cdd('0x1d')]=_0x1dd709;if(_0x3404c4['query']['includeAll']){_0x489db8['include']=[{'all':!![]}];}return db['CmHopperFinal'][_0x0cdd('0x42')](_0x489db8);})['then'](function(_0x107539){_0x2b9e1b[_0x0cdd('0x43')]=_0x107539;return _0x2b9e1b;});}})[_0x0cdd('0x23')](respondWithFilteredResult(_0x1cbc4b,_0x489db8))[_0x0cdd('0x47')](handleError(_0x1cbc4b,null));};exports[_0x0cdd('0x5e')]=function(_0x2a3dbe,_0x1d9dfe,_0x3f32c5){var _0x4f2a88={'raw':!![],'where':{}};var _0x348c2a={};var _0x14356e={'count':0x0,'rows':[]};return db[_0x0cdd('0x2c')]['findOne']({'where':{'id':_0x2a3dbe[_0x0cdd('0x45')]['id']}})[_0x0cdd('0x23')](handleEntityNotFound(_0x1d9dfe,null))['then'](function(_0x336485){if(_0x336485){_0x348c2a[_0x0cdd('0x34')]=_['keys'](db['CmHopperBlack'][_0x0cdd('0x2d')]);_0x348c2a[_0x0cdd('0x30')]=_['keys'](_0x2a3dbe[_0x0cdd('0x30')]);_0x348c2a[_0x0cdd('0x32')]=_[_0x0cdd('0x33')](_0x348c2a[_0x0cdd('0x34')],_0x348c2a['query']);_0x4f2a88[_0x0cdd('0x35')]=_[_0x0cdd('0x33')](_0x348c2a[_0x0cdd('0x34')],qs[_0x0cdd('0x36')](_0x2a3dbe[_0x0cdd('0x30')][_0x0cdd('0x36')]));_0x4f2a88['attributes']=_0x4f2a88[_0x0cdd('0x35')][_0x0cdd('0x37')]?_0x4f2a88[_0x0cdd('0x35')]:_0x348c2a[_0x0cdd('0x34')];if(!_0x2a3dbe[_0x0cdd('0x30')]['hasOwnProperty'](_0x0cdd('0x39'))){_0x4f2a88[_0x0cdd('0x3a')]=qs[_0x0cdd('0x3a')](_0x2a3dbe[_0x0cdd('0x30')]['limit']);_0x4f2a88['offset']=qs[_0x0cdd('0x1c')](_0x2a3dbe[_0x0cdd('0x30')][_0x0cdd('0x1c')]);}_0x4f2a88[_0x0cdd('0x57')]=qs[_0x0cdd('0x3b')](_0x2a3dbe['query'][_0x0cdd('0x3b')]);_0x4f2a88[_0x0cdd('0x3e')]=qs[_0x0cdd('0x32')](_[_0x0cdd('0x3c')](_0x2a3dbe[_0x0cdd('0x30')],_0x348c2a[_0x0cdd('0x32')]));_0x4f2a88[_0x0cdd('0x3e')][_0x0cdd('0x58')]=_0x336485['id'];if(_0x2a3dbe['query'][_0x0cdd('0x3d')]){_0x4f2a88[_0x0cdd('0x3e')]=_[_0x0cdd('0x3f')](_0x4f2a88['where'],{'$or':_[_0x0cdd('0x2b')](_0x4f2a88[_0x0cdd('0x35')],function(_0xb9f501){var _0x42105c={};_0x42105c[_0xb9f501]={'$like':'%'+_0x2a3dbe[_0x0cdd('0x30')]['filter']+'%'};return _0x42105c;})});}_0x4f2a88=_[_0x0cdd('0x3f')]({},_0x4f2a88,_0x2a3dbe[_0x0cdd('0x40')]);return db['CmHopperBlack'][_0x0cdd('0x1d')]({'where':_0x4f2a88['where']})[_0x0cdd('0x23')](function(_0x49a842){_0x14356e[_0x0cdd('0x1d')]=_0x49a842;if(_0x2a3dbe['query'][_0x0cdd('0x41')]){_0x4f2a88[_0x0cdd('0x46')]=[{'all':!![]}];}return db[_0x0cdd('0x5f')][_0x0cdd('0x42')](_0x4f2a88);})[_0x0cdd('0x23')](function(_0x1cd0f1){_0x14356e[_0x0cdd('0x43')]=_0x1cd0f1;return _0x14356e;});}})['then'](respondWithFilteredResult(_0x1d9dfe,_0x4f2a88))[_0x0cdd('0x47')](handleError(_0x1d9dfe,null));};exports[_0x0cdd('0x60')]=function(_0x32a5ba,_0x52827c,_0x3c56b9){var _0x408053={};var _0x500e81={};var _0x5bf1dd;var _0x583400;return db['Campaign'][_0x0cdd('0x5b')]({'where':{'id':_0x32a5ba[_0x0cdd('0x45')]['id']}})[_0x0cdd('0x23')](handleEntityNotFound(_0x52827c,null))[_0x0cdd('0x23')](function(_0x37f99d){if(_0x37f99d){_0x5bf1dd=_0x37f99d;_0x500e81['model']=_[_0x0cdd('0x31')](db['CmList'][_0x0cdd('0x2d')]);_0x500e81[_0x0cdd('0x30')]=_['keys'](_0x32a5ba['query']);_0x500e81[_0x0cdd('0x32')]=_[_0x0cdd('0x33')](_0x500e81[_0x0cdd('0x34')],_0x500e81[_0x0cdd('0x30')]);_0x408053['attributes']=_[_0x0cdd('0x33')](_0x500e81['model'],qs[_0x0cdd('0x36')](_0x32a5ba[_0x0cdd('0x30')][_0x0cdd('0x36')]));_0x408053[_0x0cdd('0x35')]=_0x408053[_0x0cdd('0x35')][_0x0cdd('0x37')]?_0x408053[_0x0cdd('0x35')]:_0x500e81['model'];_0x408053['order']=qs[_0x0cdd('0x3b')](_0x32a5ba[_0x0cdd('0x30')][_0x0cdd('0x3b')]);_0x408053[_0x0cdd('0x3e')]=qs['filters'](_['pick'](_0x32a5ba['query'],_0x500e81[_0x0cdd('0x32')]));if(_0x32a5ba[_0x0cdd('0x30')]['filter']){_0x408053[_0x0cdd('0x3e')]=_[_0x0cdd('0x3f')](_0x408053[_0x0cdd('0x3e')],{'$or':_[_0x0cdd('0x2b')](_0x408053[_0x0cdd('0x35')],function(_0x533f9c){var _0x23f917={};_0x23f917[_0x533f9c]={'$like':'%'+_0x32a5ba[_0x0cdd('0x30')]['filter']+'%'};return _0x23f917;})});}_0x408053=_[_0x0cdd('0x3f')]({},_0x408053,_0x32a5ba[_0x0cdd('0x40')]);return _0x5bf1dd['getLists'](_0x408053);}})['then'](function(_0x2b7e8c){if(_0x2b7e8c){_0x583400=_0x2b7e8c[_0x0cdd('0x37')];if(!_0x32a5ba[_0x0cdd('0x30')][_0x0cdd('0x38')]('nolimit')){_0x408053[_0x0cdd('0x3a')]=qs[_0x0cdd('0x3a')](_0x32a5ba['query']['limit']);_0x408053[_0x0cdd('0x1c')]=qs[_0x0cdd('0x1c')](_0x32a5ba[_0x0cdd('0x30')][_0x0cdd('0x1c')]);}return _0x5bf1dd[_0x0cdd('0x60')](_0x408053);}})[_0x0cdd('0x23')](function(_0x22a07f){if(_0x22a07f){return _0x22a07f?{'count':_0x583400,'rows':_0x22a07f}:null;}})[_0x0cdd('0x23')](respondWithResult(_0x52827c,null))[_0x0cdd('0x47')](handleError(_0x52827c,null));};exports[_0x0cdd('0x61')]=function(_0x16bdbc,_0x40fe28,_0x400ddd){var _0x1ce7e9,_0x1489d1;var _0x145a37=[];var _0x16b34c=moment()[_0x0cdd('0x62')](_0x0cdd('0x63'));return db[_0x0cdd('0x2c')][_0x0cdd('0x4f')]({'where':{'id':_0x16bdbc[_0x0cdd('0x45')]['id']}})['then'](handleEntityNotFound(_0x40fe28,null))[_0x0cdd('0x23')](function(_0x302c72){if(_0x302c72){_0x1489d1=_0x302c72;return _0x302c72['addLists'](_0x16bdbc[_0x0cdd('0x55')][_0x0cdd('0x64')],_[_0x0cdd('0x53')](_0x16bdbc[_0x0cdd('0x55')],[_0x0cdd('0x64'),'id'])||{});}return null;})[_0x0cdd('0x65')](function(_0x24774e){var _0xcc1e71;var _0x26a433;_0x1ce7e9=_0x24774e||[];var _0x33c125=[];if(_0x24774e){for(var _0x2adfda=0x0;_0x2adfda<_0x24774e['length'];_0x2adfda+=0x1){var _0x4d5176=_0x24774e[_0x2adfda][_0x0cdd('0x4a')]({'plain':!![]});_0x1489d1['dialCheckDuplicateType']=_0x16bdbc[_0x0cdd('0x55')][_0x0cdd('0x66')]?_0x16bdbc[_0x0cdd('0x55')]['dialCheckDuplicateType']:_0x1489d1['dialCheckDuplicateType'];switch(_0x1489d1[_0x0cdd('0x66')]){case'always':_0xcc1e71=squel[_0x0cdd('0x67')]()['into']('cm_hopper')[_0x0cdd('0x68')]([_0x0cdd('0x69'),_0x0cdd('0x6a'),_0x0cdd('0x6b'),_0x0cdd('0x6c'),_0x0cdd('0x58'),'createdAt','updatedAt'],squel['select']()[_0x0cdd('0x6d')](_0x0cdd('0x69'),'phone')[_0x0cdd('0x6d')](_0x0cdd('0x6e'),_0x0cdd('0x6a'))[_0x0cdd('0x6d')]('id',_0x0cdd('0x6b'))[_0x0cdd('0x6d')](_0x4d5176['CmListId'][_0x0cdd('0x6f')](),_0x0cdd('0x6c'))[_0x0cdd('0x6d')](_0x16bdbc['params']['id'][_0x0cdd('0x6f')](),_0x0cdd('0x58'))[_0x0cdd('0x6d')]('\x27'+_0x16b34c+'\x27',_0x0cdd('0x54'))['field']('\x27'+_0x16b34c+'\x27',_0x0cdd('0x70'))[_0x0cdd('0x71')](_0x0cdd('0x72'))[_0x0cdd('0x3e')](_0x0cdd('0x73'))[_0x0cdd('0x3e')](_0x0cdd('0x74'),_0x4d5176['CmListId'][_0x0cdd('0x6f')]())['where']('phone\x20IS\x20NOT\x20NULL')[_0x0cdd('0x3e')]('phone\x20NOT\x20IN\x20(?)',squel[_0x0cdd('0x75')]()[_0x0cdd('0x6d')]('COALESCE(calleridnum,\x27\x27)')['from'](_0x0cdd('0x76'))[_0x0cdd('0x3e')](_0x0cdd('0x77'),_0x16bdbc[_0x0cdd('0x45')]['id'][_0x0cdd('0x6f')]()))[_0x0cdd('0x3e')](_0x0cdd('0x78'),squel[_0x0cdd('0x75')]()[_0x0cdd('0x6d')](_0x0cdd('0x79'))[_0x0cdd('0x71')]('cm_hopper')[_0x0cdd('0x3e')](_0x0cdd('0x77'),_0x16bdbc[_0x0cdd('0x45')]['id']['toString']())))[_0x0cdd('0x6f')]();break;case _0x0cdd('0x7a'):_0xcc1e71=squel[_0x0cdd('0x67')]()['into'](_0x0cdd('0x7b'))[_0x0cdd('0x68')](['phone',_0x0cdd('0x6a'),'ContactId',_0x0cdd('0x6c'),'CampaignId','createdAt',_0x0cdd('0x70')],squel[_0x0cdd('0x75')]()[_0x0cdd('0x6d')](_0x0cdd('0x69'),_0x0cdd('0x69'))[_0x0cdd('0x6d')](_0x0cdd('0x6e'),'scheduledAt')['field']('id','ContactId')[_0x0cdd('0x6d')](_0x4d5176[_0x0cdd('0x7c')][_0x0cdd('0x6f')](),_0x0cdd('0x6c'))['field'](_0x16bdbc[_0x0cdd('0x45')]['id'][_0x0cdd('0x6f')](),'CampaignId')[_0x0cdd('0x6d')]('\x27'+_0x16b34c+'\x27',_0x0cdd('0x54'))[_0x0cdd('0x6d')]('\x27'+_0x16b34c+'\x27',_0x0cdd('0x70'))['from'](_0x0cdd('0x72'))[_0x0cdd('0x3e')]('deletedAt\x20IS\x20NULL')[_0x0cdd('0x3e')](_0x0cdd('0x74'),_0x4d5176['CmListId'][_0x0cdd('0x6f')]())['where'](_0x0cdd('0x7d'))['where']('phone\x20NOT\x20IN\x20(?)',squel[_0x0cdd('0x75')]()['field'](_0x0cdd('0x79'))[_0x0cdd('0x71')](_0x0cdd('0x7b'))[_0x0cdd('0x3e')](_0x0cdd('0x77'),_0x16bdbc[_0x0cdd('0x45')]['id'][_0x0cdd('0x6f')]())))[_0x0cdd('0x6f')]();break;default:_0xcc1e71=squel[_0x0cdd('0x67')]()[_0x0cdd('0x7e')](_0x0cdd('0x7b'))[_0x0cdd('0x68')]([_0x0cdd('0x69'),_0x0cdd('0x6a'),_0x0cdd('0x6b'),_0x0cdd('0x6c'),_0x0cdd('0x58'),_0x0cdd('0x54'),_0x0cdd('0x70')],squel[_0x0cdd('0x75')]()[_0x0cdd('0x6d')]('phone','phone')[_0x0cdd('0x6d')]('NOW()',_0x0cdd('0x6a'))['field']('id','ContactId')[_0x0cdd('0x6d')](_0x4d5176[_0x0cdd('0x7c')][_0x0cdd('0x6f')](),'ListId')['field'](_0x16bdbc[_0x0cdd('0x45')]['id'][_0x0cdd('0x6f')](),'CampaignId')[_0x0cdd('0x6d')]('\x27'+_0x16b34c+'\x27',_0x0cdd('0x54'))['field']('\x27'+_0x16b34c+'\x27','updatedAt')[_0x0cdd('0x71')]('cm_contacts')['where']('deletedAt\x20IS\x20NULL')[_0x0cdd('0x3e')](_0x0cdd('0x74'),_0x4d5176[_0x0cdd('0x7c')]['toString']())[_0x0cdd('0x3e')](_0x0cdd('0x7d')))[_0x0cdd('0x6f')]();}_0x26a433=squel[_0x0cdd('0x67')]()['into'](_0x0cdd('0x7f'))[_0x0cdd('0x68')]([_0x0cdd('0x80'),_0x0cdd('0x6a'),_0x0cdd('0x69'),'OrderBy',_0x0cdd('0x54'),_0x0cdd('0x70')],squel[_0x0cdd('0x75')]()['field'](_0x0cdd('0x81'),'id')[_0x0cdd('0x6d')](_0x0cdd('0x6e'),_0x0cdd('0x6a'))[_0x0cdd('0x6d')](_0x0cdd('0x82'),_0x0cdd('0x69'))[_0x0cdd('0x6d')](_0x0cdd('0x83'),'OrderBy')[_0x0cdd('0x6d')]('\x27'+_0x16b34c+'\x27',_0x0cdd('0x54'))[_0x0cdd('0x6d')]('\x27'+_0x16b34c+'\x27',_0x0cdd('0x70'))[_0x0cdd('0x71')]('cm_contact_has_items','ci')[_0x0cdd('0x84')]('cm_hopper','h',_0x0cdd('0x85'))[_0x0cdd('0x3e')](_0x0cdd('0x86'),_0x4d5176[_0x0cdd('0x7c')]['toString']())[_0x0cdd('0x3e')]('h.CampaignId=?',_0x16bdbc['params']['id'][_0x0cdd('0x6f')]())[_0x0cdd('0x3e')]('h.createdAt\x20=\x20?',_0x16b34c))[_0x0cdd('0x6f')]();_0x33c125['push'](db[_0x0cdd('0x87')]['query'](_0xcc1e71));_0x145a37[_0x0cdd('0x88')](db[_0x0cdd('0x87')]['query'](_0x26a433));}return BPromise[_0x0cdd('0x89')](_0x33c125);}})[_0x0cdd('0x23')](function(){return BPromise[_0x0cdd('0x89')](_0x145a37);})[_0x0cdd('0x23')](function(){return _0x1ce7e9;})[_0x0cdd('0x23')](respondWithResult(_0x40fe28,null))['catch'](handleError(_0x40fe28,null));};exports['removeLists']=function(_0x25e938,_0x34e5de,_0x14d8ff){return db[_0x0cdd('0x2c')][_0x0cdd('0x4f')]({'where':{'id':_0x25e938[_0x0cdd('0x45')]['id']}})[_0x0cdd('0x23')](handleEntityNotFound(_0x34e5de,null))[_0x0cdd('0x23')](function(_0x41cf8c){if(_0x41cf8c){return _0x41cf8c[_0x0cdd('0x8a')](_0x25e938[_0x0cdd('0x30')]['ids']);}})[_0x0cdd('0x23')](function(_0x195028){if(_0x195028){return db['CmHopper'][_0x0cdd('0x24')]({'where':{'ListId':_0x25e938[_0x0cdd('0x30')][_0x0cdd('0x64')],'CampaignId':_0x25e938[_0x0cdd('0x45')]['id']}})[_0x0cdd('0x23')](function(){return _0x195028;});}})['then'](respondWithStatusCode(_0x34e5de,null))[_0x0cdd('0x47')](handleError(_0x34e5de,null));};exports[_0x0cdd('0x8b')]=function(_0x29e115,_0x128eb5,_0x4a87e3){var _0x50f533={};var _0x2e88d0={};var _0x116dab;var _0x35efc3;return db[_0x0cdd('0x2c')][_0x0cdd('0x5b')]({'where':{'id':_0x29e115['params']['id']}})['then'](handleEntityNotFound(_0x128eb5,null))[_0x0cdd('0x23')](function(_0x417e90){if(_0x417e90){_0x116dab=_0x417e90;_0x2e88d0['model']=_[_0x0cdd('0x31')](db[_0x0cdd('0x8c')][_0x0cdd('0x2d')]);_0x2e88d0['query']=_[_0x0cdd('0x31')](_0x29e115[_0x0cdd('0x30')]);_0x2e88d0[_0x0cdd('0x32')]=_[_0x0cdd('0x33')](_0x2e88d0[_0x0cdd('0x34')],_0x2e88d0[_0x0cdd('0x30')]);_0x50f533[_0x0cdd('0x35')]=_[_0x0cdd('0x33')](_0x2e88d0[_0x0cdd('0x34')],qs[_0x0cdd('0x36')](_0x29e115[_0x0cdd('0x30')][_0x0cdd('0x36')]));_0x50f533[_0x0cdd('0x35')]=_0x50f533[_0x0cdd('0x35')][_0x0cdd('0x37')]?_0x50f533[_0x0cdd('0x35')]:_0x2e88d0[_0x0cdd('0x34')];_0x50f533['order']=qs[_0x0cdd('0x3b')](_0x29e115['query'][_0x0cdd('0x3b')]);_0x50f533['where']=qs[_0x0cdd('0x32')](_[_0x0cdd('0x3c')](_0x29e115[_0x0cdd('0x30')],_0x2e88d0['filters']));if(_0x29e115[_0x0cdd('0x30')]['filter']){_0x50f533[_0x0cdd('0x3e')]=_['merge'](_0x50f533[_0x0cdd('0x3e')],{'$or':_[_0x0cdd('0x2b')](_0x50f533[_0x0cdd('0x35')],function(_0x55a995){var _0x4b1ee8={};_0x4b1ee8[_0x55a995]={'$like':'%'+_0x29e115['query'][_0x0cdd('0x3d')]+'%'};return _0x4b1ee8;})});}_0x50f533=_[_0x0cdd('0x3f')]({},_0x50f533,_0x29e115['options']);return _0x116dab[_0x0cdd('0x8b')](_0x50f533);}})[_0x0cdd('0x23')](function(_0x5ed3cd){if(_0x5ed3cd){_0x35efc3=_0x5ed3cd[_0x0cdd('0x37')];if(!_0x29e115[_0x0cdd('0x30')]['hasOwnProperty'](_0x0cdd('0x39'))){_0x50f533['limit']=qs[_0x0cdd('0x3a')](_0x29e115[_0x0cdd('0x30')][_0x0cdd('0x3a')]);_0x50f533[_0x0cdd('0x1c')]=qs['offset'](_0x29e115[_0x0cdd('0x30')][_0x0cdd('0x1c')]);}return _0x116dab['getBlackLists'](_0x50f533);}})[_0x0cdd('0x23')](function(_0x1d16c0){if(_0x1d16c0){return _0x1d16c0?{'count':_0x35efc3,'rows':_0x1d16c0}:null;}})[_0x0cdd('0x23')](respondWithResult(_0x128eb5,null))[_0x0cdd('0x47')](handleError(_0x128eb5,null));};exports['addBlackLists']=function(_0x21243b,_0x1721d1,_0x5f3400){var _0x23b09c,_0x3bef54;var _0x43c1c6=[];var _0x2ef1f0=moment()[_0x0cdd('0x62')](_0x0cdd('0x63'));return db[_0x0cdd('0x2c')][_0x0cdd('0x4f')]({'where':{'id':_0x21243b[_0x0cdd('0x45')]['id']}})[_0x0cdd('0x23')](handleEntityNotFound(_0x1721d1,null))[_0x0cdd('0x23')](function(_0x5a2051){if(_0x5a2051){_0x3bef54=_0x5a2051;return _0x5a2051[_0x0cdd('0x8d')](_0x21243b[_0x0cdd('0x55')][_0x0cdd('0x64')],_[_0x0cdd('0x53')](_0x21243b[_0x0cdd('0x55')],[_0x0cdd('0x64'),'id'])||{});}return null;})[_0x0cdd('0x65')](function(_0x2a2e97){var _0x33f481;var _0x3c8baf;_0x23b09c=_0x2a2e97||[];var _0x32635e=[];if(_0x2a2e97){for(var _0x5099e6=0x0;_0x5099e6<_0x2a2e97[_0x0cdd('0x37')];_0x5099e6+=0x1){var _0x257157=_0x2a2e97[_0x5099e6][_0x0cdd('0x4a')]({'plain':!![]});_0x33f481=squel[_0x0cdd('0x67')]()['into'](_0x0cdd('0x8e'))[_0x0cdd('0x68')]([_0x0cdd('0x69'),_0x0cdd('0x6b'),_0x0cdd('0x6c'),_0x0cdd('0x58'),_0x0cdd('0x54'),_0x0cdd('0x70')],squel['select']()[_0x0cdd('0x6d')]('phone',_0x0cdd('0x69'))[_0x0cdd('0x6d')]('id',_0x0cdd('0x6b'))[_0x0cdd('0x6d')](_0x257157[_0x0cdd('0x7c')][_0x0cdd('0x6f')](),_0x0cdd('0x6c'))[_0x0cdd('0x6d')](_0x21243b['params']['id']['toString'](),_0x0cdd('0x58'))[_0x0cdd('0x6d')](_0x0cdd('0x6e'),'createdAt')['field'](_0x0cdd('0x6e'),'updatedAt')['from'](_0x0cdd('0x72'))[_0x0cdd('0x3e')](_0x0cdd('0x73'))[_0x0cdd('0x3e')]('ListId\x20=\x20?',_0x257157[_0x0cdd('0x7c')]['toString']())[_0x0cdd('0x3e')](_0x0cdd('0x7d')))['toString']();_0x32635e[_0x0cdd('0x88')](db[_0x0cdd('0x87')][_0x0cdd('0x30')](_0x33f481));}return BPromise['all'](_0x32635e);}})[_0x0cdd('0x23')](function(){return _0x23b09c;})[_0x0cdd('0x23')](respondWithResult(_0x1721d1,null))[_0x0cdd('0x47')](handleError(_0x1721d1,null));};exports[_0x0cdd('0x8f')]=function(_0x1d8c69,_0x393229,_0x229f4b){return db[_0x0cdd('0x2c')][_0x0cdd('0x4f')]({'where':{'id':_0x1d8c69['params']['id']}})[_0x0cdd('0x23')](handleEntityNotFound(_0x393229,null))[_0x0cdd('0x23')](function(_0x21ee1b){if(_0x21ee1b){return _0x21ee1b[_0x0cdd('0x8f')](_0x1d8c69[_0x0cdd('0x30')][_0x0cdd('0x64')]);}})[_0x0cdd('0x23')](function(_0x12a86a){if(_0x12a86a){return db[_0x0cdd('0x5f')][_0x0cdd('0x24')]({'where':{'ListId':_0x1d8c69[_0x0cdd('0x30')]['ids'],'CampaignId':_0x1d8c69[_0x0cdd('0x45')]['id']}})[_0x0cdd('0x23')](function(){return _0x12a86a;});}})[_0x0cdd('0x23')](respondWithStatusCode(_0x393229,null))[_0x0cdd('0x47')](handleError(_0x393229,null));}; \ No newline at end of file diff --git a/server/api/campaign/campaign.model.js b/server/api/campaign/campaign.model.js index 514f79d..65cd236 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(_0xfa9f42,_0x3b9207){var _0x4f51db=function(_0x4a1a1e){while(--_0x4a1a1e){_0xfa9f42['push'](_0xfa9f42['shift']());}};_0x4f51db(++_0x3b9207);}(_0x7a54,0x106));var _0x47a5=function(_0x39589a,_0x4364a7){_0x39589a=_0x39589a-0x0;var _0x20b419=_0x7a54[_0x39589a];return _0x20b419;};'use strict';var _=require(_0x47a5('0x0'));var util=require(_0x47a5('0x1'));var logger=require(_0x47a5('0x2'))('api');var moment=require(_0x47a5('0x3'));var BPromise=require(_0x47a5('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x47a5('0x5'));var rimraf=require(_0x47a5('0x6'));var config=require(_0x47a5('0x7'));var attributes=require(_0x47a5('0x8'));module[_0x47a5('0x9')]=function(_0x545a97,_0x3d5629){return _0x545a97['define'](_0x47a5('0xa'),attributes,{'tableName':_0x47a5('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x9957=['exports','define','Campaign','lodash','util','../../config/logger','api','bluebird','request-promise','path','rimraf','./campaign.attributes'];(function(_0x40a045,_0x516f0e){var _0x1a687c=function(_0x48c9fe){while(--_0x48c9fe){_0x40a045['push'](_0x40a045['shift']());}};_0x1a687c(++_0x516f0e);}(_0x9957,0x93));var _0x7995=function(_0x2f5ac5,_0x1ee939){_0x2f5ac5=_0x2f5ac5-0x0;var _0x37c9a8=_0x9957[_0x2f5ac5];return _0x37c9a8;};'use strict';var _=require(_0x7995('0x0'));var util=require(_0x7995('0x1'));var logger=require(_0x7995('0x2'))(_0x7995('0x3'));var moment=require('moment');var BPromise=require(_0x7995('0x4'));var rp=require(_0x7995('0x5'));var fs=require('fs');var path=require(_0x7995('0x6'));var rimraf=require(_0x7995('0x7'));var config=require('../../config/environment');var attributes=require(_0x7995('0x8'));module[_0x7995('0x9')]=function(_0x137b6b,_0x219534){return _0x137b6b[_0x7995('0xa')](_0x7995('0xb'),attributes,{'tableName':'campaigns','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/campaign/campaign.rpc.js b/server/api/campaign/campaign.rpc.js index 32fb510..7973900 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 _0xd136=['catch','GetCampaign','Campaign','findAll','options','raw','where','attributes','limit','map','include','model','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','request','then','request\x20sent','debug','Campaign,\x20%s,\x20%s,\x20%s','error','code','Campaign,\x20%s,\x20%s','message','info','result'];(function(_0x4d95db,_0x28b7e9){var _0x1cc484=function(_0x42c09c){while(--_0x42c09c){_0x4d95db['push'](_0x4d95db['shift']());}};_0x1cc484(++_0x28b7e9);}(_0xd136,0x94));var _0x6d13=function(_0x476b00,_0xcdd1e1){_0x476b00=_0x476b00-0x0;var _0x3d4fb1=_0xd136[_0x476b00];return _0x3d4fb1;};'use strict';var _=require('lodash');var util=require(_0x6d13('0x0'));var moment=require(_0x6d13('0x1'));var BPromise=require('bluebird');var rs=require(_0x6d13('0x2'));var fs=require('fs');var Redis=require(_0x6d13('0x3'));var db=require(_0x6d13('0x4'))['db'];var utils=require(_0x6d13('0x5'));var logger=require(_0x6d13('0x6'))(_0x6d13('0x7'));var config=require(_0x6d13('0x8'));var jayson=require(_0x6d13('0x9'));var client=jayson[_0x6d13('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x335482,_0xdf6760,_0x4c563a){return new BPromise(function(_0x598021,_0x1af16f){return client[_0x6d13('0xb')](_0x335482,_0x4c563a)[_0x6d13('0xc')](function(_0x2216d7){logger['info']('Campaign,\x20%s,\x20%s',_0xdf6760,_0x6d13('0xd'));logger[_0x6d13('0xe')](_0x6d13('0xf'),_0xdf6760,'request\x20sent',JSON['stringify'](_0x2216d7));if(_0x2216d7[_0x6d13('0x10')]){if(_0x2216d7[_0x6d13('0x10')][_0x6d13('0x11')]===0x1f4){logger['error'](_0x6d13('0x12'),_0xdf6760,_0x2216d7[_0x6d13('0x10')][_0x6d13('0x13')]);return _0x1af16f(_0x2216d7[_0x6d13('0x10')]['message']);}logger['error']('Campaign,\x20%s,\x20%s',_0xdf6760,_0x2216d7[_0x6d13('0x10')][_0x6d13('0x13')]);return _0x598021(_0x2216d7[_0x6d13('0x10')][_0x6d13('0x13')]);}else{logger[_0x6d13('0x14')]('Campaign,\x20%s,\x20%s',_0xdf6760,_0x6d13('0xd'));_0x598021(_0x2216d7[_0x6d13('0x15')][_0x6d13('0x13')]);}})[_0x6d13('0x16')](function(_0x348cab){logger[_0x6d13('0x10')](_0x6d13('0x12'),_0xdf6760,_0x348cab);_0x1af16f(_0x348cab);});});}exports[_0x6d13('0x17')]=function(_0xc6c2b){var _0x5bcac4=this;return new Promise(function(_0x276fdd,_0x269f27){return db[_0x6d13('0x18')][_0x6d13('0x19')]({'raw':_0xc6c2b[_0x6d13('0x1a')]?_0xc6c2b[_0x6d13('0x1a')][_0x6d13('0x1b')]===undefined?!![]:![]:!![],'where':_0xc6c2b[_0x6d13('0x1a')]?_0xc6c2b[_0x6d13('0x1a')][_0x6d13('0x1c')]||null:null,'attributes':_0xc6c2b[_0x6d13('0x1a')]?_0xc6c2b[_0x6d13('0x1a')][_0x6d13('0x1d')]||null:null,'limit':_0xc6c2b[_0x6d13('0x1a')]?_0xc6c2b[_0x6d13('0x1a')][_0x6d13('0x1e')]||null:null,'include':_0xc6c2b['options']?_0xc6c2b[_0x6d13('0x1a')]['include']?_[_0x6d13('0x1f')](_0xc6c2b[_0x6d13('0x1a')][_0x6d13('0x20')],function(_0x5bbc9d){return{'model':db[_0x5bbc9d[_0x6d13('0x21')]],'as':_0x5bbc9d['as'],'attributes':_0x5bbc9d[_0x6d13('0x1d')],'include':_0x5bbc9d[_0x6d13('0x20')]?_[_0x6d13('0x1f')](_0x5bbc9d[_0x6d13('0x20')],function(_0x361432){return{'model':db[_0x361432[_0x6d13('0x21')]],'as':_0x361432['as'],'attributes':_0x361432[_0x6d13('0x1d')],'include':_0x361432['include']?_[_0x6d13('0x1f')](_0x361432['include'],function(_0x4c8526){return{'model':db[_0x4c8526[_0x6d13('0x21')]],'as':_0x4c8526['as'],'attributes':_0x4c8526['attributes']};}):[]};}):[]};}):[]:[]})[_0x6d13('0xc')](function(_0x2618e5){logger[_0x6d13('0x14')]('GetCampaign',_0xc6c2b);logger[_0x6d13('0xe')](_0x6d13('0x17'),_0xc6c2b,JSON['stringify'](_0x2618e5));_0x276fdd(_0x2618e5);})[_0x6d13('0x16')](function(_0x1eda96){logger[_0x6d13('0x10')](_0x6d13('0x17'),_0x1eda96[_0x6d13('0x13')],_0xc6c2b);_0x269f27(_0x5bcac4[_0x6d13('0x10')](0x1f4,_0x1eda96[_0x6d13('0x13')]));});});}; \ No newline at end of file +var _0xf194=['GetCampaign','Campaign','findAll','options','raw','where','limit','include','map','model','attributes','stringify','catch','lodash','util','moment','bluebird','ioredis','rpc','../../config/environment','jayson/promise','http','request','then','info','Campaign,\x20%s,\x20%s','request\x20sent','debug','Campaign,\x20%s,\x20%s,\x20%s','code','error','message','result'];(function(_0x2ee238,_0x10bb44){var _0x498e84=function(_0x11617b){while(--_0x11617b){_0x2ee238['push'](_0x2ee238['shift']());}};_0x498e84(++_0x10bb44);}(_0xf194,0x91));var _0x4f19=function(_0x5bb3d4,_0xcf248f){_0x5bb3d4=_0x5bb3d4-0x0;var _0x265ff1=_0xf194[_0x5bb3d4];return _0x265ff1;};'use strict';var _=require(_0x4f19('0x0'));var util=require(_0x4f19('0x1'));var moment=require(_0x4f19('0x2'));var BPromise=require(_0x4f19('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x4f19('0x4'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0x4f19('0x5'));var config=require(_0x4f19('0x6'));var jayson=require(_0x4f19('0x7'));var client=jayson['client'][_0x4f19('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x45c88a,_0x514d93,_0x4b023f){return new BPromise(function(_0x265d15,_0x116780){return client[_0x4f19('0x9')](_0x45c88a,_0x4b023f)[_0x4f19('0xa')](function(_0x4aaf89){logger[_0x4f19('0xb')](_0x4f19('0xc'),_0x514d93,_0x4f19('0xd'));logger[_0x4f19('0xe')](_0x4f19('0xf'),_0x514d93,_0x4f19('0xd'),JSON['stringify'](_0x4aaf89));if(_0x4aaf89['error']){if(_0x4aaf89['error'][_0x4f19('0x10')]===0x1f4){logger[_0x4f19('0x11')]('Campaign,\x20%s,\x20%s',_0x514d93,_0x4aaf89[_0x4f19('0x11')][_0x4f19('0x12')]);return _0x116780(_0x4aaf89[_0x4f19('0x11')][_0x4f19('0x12')]);}logger['error'](_0x4f19('0xc'),_0x514d93,_0x4aaf89[_0x4f19('0x11')]['message']);return _0x265d15(_0x4aaf89[_0x4f19('0x11')][_0x4f19('0x12')]);}else{logger['info'](_0x4f19('0xc'),_0x514d93,'request\x20sent');_0x265d15(_0x4aaf89[_0x4f19('0x13')][_0x4f19('0x12')]);}})['catch'](function(_0x4d8021){logger[_0x4f19('0x11')](_0x4f19('0xc'),_0x514d93,_0x4d8021);_0x116780(_0x4d8021);});});}exports[_0x4f19('0x14')]=function(_0x576eef){var _0x1d9bf3=this;return new Promise(function(_0x205fee,_0x1b4d79){return db[_0x4f19('0x15')][_0x4f19('0x16')]({'raw':_0x576eef['options']?_0x576eef[_0x4f19('0x17')][_0x4f19('0x18')]===undefined?!![]:![]:!![],'where':_0x576eef['options']?_0x576eef[_0x4f19('0x17')][_0x4f19('0x19')]||null:null,'attributes':_0x576eef[_0x4f19('0x17')]?_0x576eef[_0x4f19('0x17')]['attributes']||null:null,'limit':_0x576eef[_0x4f19('0x17')]?_0x576eef[_0x4f19('0x17')][_0x4f19('0x1a')]||null:null,'include':_0x576eef[_0x4f19('0x17')]?_0x576eef[_0x4f19('0x17')][_0x4f19('0x1b')]?_[_0x4f19('0x1c')](_0x576eef[_0x4f19('0x17')][_0x4f19('0x1b')],function(_0x10e164){return{'model':db[_0x10e164[_0x4f19('0x1d')]],'as':_0x10e164['as'],'attributes':_0x10e164[_0x4f19('0x1e')],'include':_0x10e164[_0x4f19('0x1b')]?_[_0x4f19('0x1c')](_0x10e164[_0x4f19('0x1b')],function(_0x39cb12){return{'model':db[_0x39cb12[_0x4f19('0x1d')]],'as':_0x39cb12['as'],'attributes':_0x39cb12[_0x4f19('0x1e')],'include':_0x39cb12[_0x4f19('0x1b')]?_['map'](_0x39cb12[_0x4f19('0x1b')],function(_0x5218c6){return{'model':db[_0x5218c6[_0x4f19('0x1d')]],'as':_0x5218c6['as'],'attributes':_0x5218c6['attributes']};}):[]};}):[]};}):[]:[]})[_0x4f19('0xa')](function(_0x5321a8){logger[_0x4f19('0xb')](_0x4f19('0x14'),_0x576eef);logger[_0x4f19('0xe')]('GetCampaign',_0x576eef,JSON[_0x4f19('0x1f')](_0x5321a8));_0x205fee(_0x5321a8);})[_0x4f19('0x20')](function(_0x2175ff){logger[_0x4f19('0x11')](_0x4f19('0x14'),_0x2175ff['message'],_0x576eef);_0x1b4d79(_0x1d9bf3[_0x4f19('0x11')](0x1f4,_0x2175ff[_0x4f19('0x12')]));});});}; \ No newline at end of file diff --git a/server/api/campaign/index.js b/server/api/campaign/index.js index a97d891..f607ecb 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 _0x2463=['removeLists','removeBlackLists','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../config/environment','isAuthenticated','index','get','/:id','show','/:id/hoppers','getHoppers','/:id/hopper_histories','getHopperHistories','/:id/hopper_finals','getHopperFinals','/:id/hopper_black','getHopperBlacks','/:id/blacklists','getBlackLists','post','create','/:id/clone','clone','/:id/lists','addBlackLists','put','update','delete'];(function(_0x36a63c,_0x3d5e94){var _0x35e7a1=function(_0x24dd9a){while(--_0x24dd9a){_0x36a63c['push'](_0x36a63c['shift']());}};_0x35e7a1(++_0x3d5e94);}(_0x2463,0xf7));var _0x3246=function(_0x2a7b44,_0x3786f2){_0x2a7b44=_0x2a7b44-0x0;var _0x1af209=_0x2463[_0x2a7b44];return _0x1af209;};'use strict';var multer=require(_0x3246('0x0'));var util=require(_0x3246('0x1'));var path=require(_0x3246('0x2'));var timeout=require(_0x3246('0x3'));var express=require(_0x3246('0x4'));var router=express[_0x3246('0x5')]();var fs_extra=require(_0x3246('0x6'));var auth=require(_0x3246('0x7'));var interaction=require('../../components/interaction/service');var config=require(_0x3246('0x8'));var controller=require('./campaign.controller');router['get']('/',auth[_0x3246('0x9')](),controller[_0x3246('0xa')]);router[_0x3246('0xb')](_0x3246('0xc'),auth['isAuthenticated'](),controller[_0x3246('0xd')]);router[_0x3246('0xb')](_0x3246('0xe'),auth[_0x3246('0x9')](),controller[_0x3246('0xf')]);router['get'](_0x3246('0x10'),auth[_0x3246('0x9')](),controller[_0x3246('0x11')]);router[_0x3246('0xb')](_0x3246('0x12'),auth[_0x3246('0x9')](),controller[_0x3246('0x13')]);router['get'](_0x3246('0x14'),auth['isAuthenticated'](),controller[_0x3246('0x15')]);router[_0x3246('0xb')]('/:id/lists',auth[_0x3246('0x9')](),controller['getLists']);router[_0x3246('0xb')](_0x3246('0x16'),auth[_0x3246('0x9')](),controller[_0x3246('0x17')]);router[_0x3246('0x18')]('/',auth['isAuthenticated'](),controller[_0x3246('0x19')]);router[_0x3246('0x18')](_0x3246('0x1a'),auth[_0x3246('0x9')](),controller[_0x3246('0x1b')]);router[_0x3246('0x18')](_0x3246('0x1c'),auth[_0x3246('0x9')](),controller['addLists']);router['post'](_0x3246('0x16'),auth['isAuthenticated'](),controller[_0x3246('0x1d')]);router[_0x3246('0x1e')](_0x3246('0xc'),auth[_0x3246('0x9')](),controller[_0x3246('0x1f')]);router[_0x3246('0x20')]('/:id',auth[_0x3246('0x9')](),controller['destroy']);router[_0x3246('0x20')](_0x3246('0x1c'),auth['isAuthenticated'](),controller[_0x3246('0x21')]);router[_0x3246('0x20')]('/:id/blacklists',auth[_0x3246('0x9')](),controller[_0x3246('0x22')]);module['exports']=router; \ No newline at end of file +var _0xd84b=['getHopperBlacks','/:id/lists','getLists','/:id/blacklists','getBlackLists','post','create','/:id/clone','addLists','addBlackLists','put','/:id','delete','removeLists','removeBlackLists','util','path','connect-timeout','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','isAuthenticated','index','get','/:id/hoppers','getHopperHistories','/:id/hopper_finals','getHopperFinals','/:id/hopper_black'];(function(_0x58c813,_0x9c9426){var _0x160ea1=function(_0x33e835){while(--_0x33e835){_0x58c813['push'](_0x58c813['shift']());}};_0x160ea1(++_0x9c9426);}(_0xd84b,0x177));var _0xbd84=function(_0x397bff,_0x491e14){_0x397bff=_0x397bff-0x0;var _0x3bc5a4=_0xd84b[_0x397bff];return _0x3bc5a4;};'use strict';var multer=require('multer');var util=require(_0xbd84('0x0'));var path=require(_0xbd84('0x1'));var timeout=require(_0xbd84('0x2'));var express=require('express');var router=express['Router']();var fs_extra=require(_0xbd84('0x3'));var auth=require(_0xbd84('0x4'));var interaction=require(_0xbd84('0x5'));var config=require(_0xbd84('0x6'));var controller=require('./campaign.controller');router['get']('/',auth[_0xbd84('0x7')](),controller[_0xbd84('0x8')]);router[_0xbd84('0x9')]('/:id',auth['isAuthenticated'](),controller['show']);router['get'](_0xbd84('0xa'),auth['isAuthenticated'](),controller['getHoppers']);router['get']('/:id/hopper_histories',auth['isAuthenticated'](),controller[_0xbd84('0xb')]);router[_0xbd84('0x9')](_0xbd84('0xc'),auth[_0xbd84('0x7')](),controller[_0xbd84('0xd')]);router['get'](_0xbd84('0xe'),auth[_0xbd84('0x7')](),controller[_0xbd84('0xf')]);router[_0xbd84('0x9')](_0xbd84('0x10'),auth['isAuthenticated'](),controller[_0xbd84('0x11')]);router['get'](_0xbd84('0x12'),auth[_0xbd84('0x7')](),controller[_0xbd84('0x13')]);router[_0xbd84('0x14')]('/',auth[_0xbd84('0x7')](),controller[_0xbd84('0x15')]);router['post'](_0xbd84('0x16'),auth[_0xbd84('0x7')](),controller['clone']);router[_0xbd84('0x14')](_0xbd84('0x10'),auth[_0xbd84('0x7')](),controller[_0xbd84('0x17')]);router[_0xbd84('0x14')](_0xbd84('0x12'),auth['isAuthenticated'](),controller[_0xbd84('0x18')]);router[_0xbd84('0x19')](_0xbd84('0x1a'),auth[_0xbd84('0x7')](),controller['update']);router[_0xbd84('0x1b')](_0xbd84('0x1a'),auth[_0xbd84('0x7')](),controller['destroy']);router[_0xbd84('0x1b')](_0xbd84('0x10'),auth[_0xbd84('0x7')](),controller[_0xbd84('0x1c')]);router[_0xbd84('0x1b')]('/:id/blacklists',auth[_0xbd84('0x7')](),controller[_0xbd84('0x1d')]);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 6d96d9c..43e3340 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 _0xf0d9=['exports','TEXT','STRING','VIRTUAL','getDataValue','sequelize'];(function(_0x44122d,_0x33ed22){var _0xa43d5e=function(_0x35c1a6){while(--_0x35c1a6){_0x44122d['push'](_0x44122d['shift']());}};_0xa43d5e(++_0x33ed22);}(_0xf0d9,0x11f));var _0x9f0d=function(_0x19c136,_0x382348){_0x19c136=_0x19c136-0x0;var _0x58bdb6=_0xf0d9[_0x19c136];return _0x58bdb6;};'use strict';var Sequelize=require(_0x9f0d('0x0'));module[_0x9f0d('0x1')]={'key':{'type':Sequelize['STRING'],'allowNull':![]},'value':{'type':Sequelize[_0x9f0d('0x2')],'length':'medium','allowNull':![]},'description':{'type':Sequelize[_0x9f0d('0x3')]},'name':{'type':Sequelize[_0x9f0d('0x4')],'get':function(){return this[_0x9f0d('0x5')]('key');}}}; \ No newline at end of file +var _0x9827=['STRING','medium','VIRTUAL','key','exports'];(function(_0x3e6771,_0x39e419){var _0x1b96d9=function(_0x3010d7){while(--_0x3010d7){_0x3e6771['push'](_0x3e6771['shift']());}};_0x1b96d9(++_0x39e419);}(_0x9827,0x8b));var _0x7982=function(_0x57f100,_0xa53aca){_0x57f100=_0x57f100-0x0;var _0x4cac01=_0x9827[_0x57f100];return _0x4cac01;};'use strict';var Sequelize=require('sequelize');module[_0x7982('0x0')]={'key':{'type':Sequelize[_0x7982('0x1')],'allowNull':![]},'value':{'type':Sequelize['TEXT'],'length':_0x7982('0x2'),'allowNull':![]},'description':{'type':Sequelize[_0x7982('0x1')]},'name':{'type':Sequelize[_0x7982('0x3')],'get':function(){return this['getDataValue'](_0x7982('0x4'));}}}; \ No newline at end of file diff --git a/server/api/cannedAnswer/cannedAnswer.controller.js b/server/api/cannedAnswer/cannedAnswer.controller.js index a8c70fc..2d1a97e 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 _0x18b1=['UserProfileResource','then','error','stack','name','send','index','map','CannedAnswer','fieldName','type','key','model','query','keys','intersection','fields','attributes','hasOwnProperty','nolimit','order','sort','filters','where','merge','filter','options','includeAll','include','findAll','catch','show','length','find','body','params','MailAccountId','SmsAccountId','OpenchannelAccountId','ChatWebsiteId','Sequelize','The\x20inserted\x20key\x20already\x20exists.','create','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','user','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','rimraf','fast-json-patch','request-promise','bluebird','mustache','util','path','sox','to-csv','ejs','lodash','squel','crypto','jsforce','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','end','status','json','offset','limit','undefined','count','set','Content-Range','reject','update','destroy','get','CannedAnswers'];(function(_0x3b58c9,_0x1b86e6){var _0x2eac7a=function(_0x4b1212){while(--_0x4b1212){_0x3b58c9['push'](_0x3b58c9['shift']());}};_0x2eac7a(++_0x1b86e6);}(_0x18b1,0xe1));var _0x118b=function(_0x135904,_0x1e252b){_0x135904=_0x135904-0x0;var _0x1ce7d5=_0x18b1[_0x135904];return _0x1ce7d5;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x118b('0x0'));var zipdir=require('zip-dir');var jsonpatch=require(_0x118b('0x1'));var rp=require(_0x118b('0x2'));var moment=require('moment');var BPromise=require(_0x118b('0x3'));var Mustache=require(_0x118b('0x4'));var util=require(_0x118b('0x5'));var path=require(_0x118b('0x6'));var sox=require(_0x118b('0x7'));var csv=require(_0x118b('0x8'));var ejs=require(_0x118b('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x118b('0xa'));var squel=require(_0x118b('0xb'));var crypto=require(_0x118b('0xc'));var jsforce=require(_0x118b('0xd'));var deskjs=require('desk.js');var toCsv=require(_0x118b('0x8'));var querystring=require('querystring');var Papa=require(_0x118b('0xe'));var Redis=require(_0x118b('0xf'));var authService=require(_0x118b('0x10'));var qs=require(_0x118b('0x11'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x118b('0x12'));var logger=require(_0x118b('0x13'))(_0x118b('0x14'));var utils=require('../../config/utils');var config=require(_0x118b('0x15'));var licenseUtil=require(_0x118b('0x16'));var db=require(_0x118b('0x17'))['db'];function respondWithStatusCode(_0x23e06d,_0x34db35){_0x34db35=_0x34db35||0xcc;return function(_0x4c3afb){if(_0x4c3afb){return _0x23e06d[_0x118b('0x18')](_0x34db35);}return _0x23e06d['status'](_0x34db35)[_0x118b('0x19')]();};}function respondWithResult(_0x5e07e9,_0x42431a){_0x42431a=_0x42431a||0xc8;return function(_0xf54f81){if(_0xf54f81){return _0x5e07e9[_0x118b('0x1a')](_0x42431a)[_0x118b('0x1b')](_0xf54f81);}};}function respondWithFilteredResult(_0x241f2a,_0x3eb1de){return function(_0x3de26b){if(_0x3de26b){var _0x183070=typeof _0x3eb1de[_0x118b('0x1c')]==='undefined'&&typeof _0x3eb1de[_0x118b('0x1d')]===_0x118b('0x1e');var _0x31552e=_0x3de26b[_0x118b('0x1f')];var _0x426ff1=_0x183070?0x0:_0x3eb1de['offset'];var _0x53c920=_0x183070?_0x3de26b[_0x118b('0x1f')]:_0x3eb1de[_0x118b('0x1c')]+_0x3eb1de[_0x118b('0x1d')];var _0x489b28;if(_0x53c920>=_0x31552e){_0x53c920=_0x31552e;_0x489b28=0xc8;}else{_0x489b28=0xce;}_0x241f2a[_0x118b('0x1a')](_0x489b28);return _0x241f2a[_0x118b('0x20')](_0x118b('0x21'),_0x426ff1+'-'+_0x53c920+'/'+_0x31552e)[_0x118b('0x1b')](_0x3de26b);}return null;};}function patchUpdates(_0x1c6027){return function(_0x5bb31a){try{jsonpatch['apply'](_0x5bb31a,_0x1c6027,!![]);}catch(_0x5e0815){return BPromise[_0x118b('0x22')](_0x5e0815);}return _0x5bb31a['save']();};}function saveUpdates(_0x4f9f79,_0x132f39){return function(_0x32128a){if(_0x32128a){return _0x32128a[_0x118b('0x23')](_0x4f9f79)['then'](function(_0x2a2ac1){return _0x2a2ac1;});}return null;};}function removeEntity(_0x489db0,_0xc13140){return function(_0x41a3ff){if(_0x41a3ff){return _0x41a3ff[_0x118b('0x24')]()['then'](function(){var _0x2dc0da=_0x41a3ff[_0x118b('0x25')]({'plain':!![]});var _0x1ab8c4=_0x118b('0x26');return db[_0x118b('0x27')][_0x118b('0x24')]({'where':{'type':_0x1ab8c4,'resourceId':_0x2dc0da['id']}})[_0x118b('0x28')](function(){return _0x41a3ff;});})[_0x118b('0x28')](function(){_0x489db0[_0x118b('0x1a')](0xcc)[_0x118b('0x19')]();});}};}function handleEntityNotFound(_0x5bb2fa,_0x525c58){return function(_0x56ff49){if(!_0x56ff49){_0x5bb2fa[_0x118b('0x18')](0x194);}return _0x56ff49;};}function handleError(_0x1eba46,_0x4f05c2){_0x4f05c2=_0x4f05c2||0x1f4;return function(_0x2829fc){logger[_0x118b('0x29')](_0x2829fc[_0x118b('0x2a')]);if(_0x2829fc[_0x118b('0x2b')]){delete _0x2829fc[_0x118b('0x2b')];}_0x1eba46[_0x118b('0x1a')](_0x4f05c2)[_0x118b('0x2c')](_0x2829fc);};}exports[_0x118b('0x2d')]=function(_0x519bf7,_0x25ab33){var _0x3f0b70={},_0x2f9bc3={},_0x45a7c4={'count':0x0,'rows':[]};var _0x6cdf22=_[_0x118b('0x2e')](db[_0x118b('0x2f')]['rawAttributes'],function(_0x36d733){return{'name':_0x36d733[_0x118b('0x30')],'type':_0x36d733[_0x118b('0x31')][_0x118b('0x32')]};});_0x2f9bc3[_0x118b('0x33')]=_[_0x118b('0x2e')](_0x6cdf22,_0x118b('0x2b'));_0x2f9bc3[_0x118b('0x34')]=_[_0x118b('0x35')](_0x519bf7[_0x118b('0x34')]);_0x2f9bc3['filters']=_[_0x118b('0x36')](_0x2f9bc3[_0x118b('0x33')],_0x2f9bc3['query']);_0x3f0b70['attributes']=_[_0x118b('0x36')](_0x2f9bc3['model'],qs[_0x118b('0x37')](_0x519bf7[_0x118b('0x34')]['fields']));_0x3f0b70[_0x118b('0x38')]=_0x3f0b70[_0x118b('0x38')]['length']?_0x3f0b70[_0x118b('0x38')]:_0x2f9bc3[_0x118b('0x33')];if(!_0x519bf7[_0x118b('0x34')][_0x118b('0x39')](_0x118b('0x3a'))){_0x3f0b70[_0x118b('0x1d')]=qs[_0x118b('0x1d')](_0x519bf7[_0x118b('0x34')][_0x118b('0x1d')]);_0x3f0b70[_0x118b('0x1c')]=qs[_0x118b('0x1c')](_0x519bf7[_0x118b('0x34')][_0x118b('0x1c')]);}_0x3f0b70[_0x118b('0x3b')]=qs[_0x118b('0x3c')](_0x519bf7[_0x118b('0x34')][_0x118b('0x3c')]);_0x3f0b70['where']=qs[_0x118b('0x3d')](_['pick'](_0x519bf7[_0x118b('0x34')],_0x2f9bc3['filters']),_0x6cdf22);if(_0x519bf7[_0x118b('0x34')]['filter']){_0x3f0b70[_0x118b('0x3e')]=_[_0x118b('0x3f')](_0x3f0b70[_0x118b('0x3e')],{'$or':[{'key':{'$like':'%'+_0x519bf7[_0x118b('0x34')][_0x118b('0x40')]+'%'}},{'value':{'$like':'%'+_0x519bf7[_0x118b('0x34')][_0x118b('0x40')]+'%'}}]});}_0x3f0b70=_[_0x118b('0x3f')]({},_0x3f0b70,_0x519bf7[_0x118b('0x41')]);var _0x4ea7c0={'where':_0x3f0b70[_0x118b('0x3e')]};return db['CannedAnswer'][_0x118b('0x1f')](_0x4ea7c0)[_0x118b('0x28')](function(_0x5b21b6){_0x45a7c4[_0x118b('0x1f')]=_0x5b21b6;if(_0x519bf7[_0x118b('0x34')][_0x118b('0x42')]){_0x3f0b70[_0x118b('0x43')]=[{'all':!![]}];}return db[_0x118b('0x2f')][_0x118b('0x44')](_0x3f0b70);})[_0x118b('0x28')](function(_0x48be9f){_0x45a7c4['rows']=_0x48be9f;return _0x45a7c4;})[_0x118b('0x28')](respondWithFilteredResult(_0x25ab33,_0x3f0b70))[_0x118b('0x45')](handleError(_0x25ab33,null));};exports[_0x118b('0x46')]=function(_0xcdd457,_0x40ce5d){var _0x5504cf={'raw':!![],'where':{'id':_0xcdd457['params']['id']}},_0x27161f={};_0x27161f['model']=_['keys'](db[_0x118b('0x2f')]['rawAttributes']);_0x27161f[_0x118b('0x34')]=_[_0x118b('0x35')](_0xcdd457[_0x118b('0x34')]);_0x27161f['filters']=_[_0x118b('0x36')](_0x27161f[_0x118b('0x33')],_0x27161f[_0x118b('0x34')]);_0x5504cf['attributes']=_['intersection'](_0x27161f['model'],qs['fields'](_0xcdd457[_0x118b('0x34')][_0x118b('0x37')]));_0x5504cf[_0x118b('0x38')]=_0x5504cf[_0x118b('0x38')][_0x118b('0x47')]?_0x5504cf['attributes']:_0x27161f[_0x118b('0x33')];if(_0xcdd457['query'][_0x118b('0x42')]){_0x5504cf[_0x118b('0x43')]=[{'all':!![]}];}_0x5504cf=_[_0x118b('0x3f')]({},_0x5504cf,_0xcdd457['options']);return db[_0x118b('0x2f')][_0x118b('0x48')](_0x5504cf)[_0x118b('0x28')](handleEntityNotFound(_0x40ce5d,null))[_0x118b('0x28')](respondWithResult(_0x40ce5d,null))[_0x118b('0x45')](handleError(_0x40ce5d,null));};exports[_0x118b('0x23')]=function(_0x220580,_0x177103){if(_0x220580[_0x118b('0x49')]['id']){delete _0x220580[_0x118b('0x49')]['id'];}return db['CannedAnswer'][_0x118b('0x48')]({'where':{'id':_0x220580[_0x118b('0x4a')]['id']}})['then'](handleEntityNotFound(_0x177103,null))['then'](saveUpdates(_0x220580[_0x118b('0x49')],null))[_0x118b('0x28')](respondWithResult(_0x177103,null))[_0x118b('0x45')](handleError(_0x177103,null));};exports[_0x118b('0x24')]=function(_0x25fd80,_0x1b864c){return db['CannedAnswer'][_0x118b('0x48')]({'where':{'id':_0x25fd80[_0x118b('0x4a')]['id']}})[_0x118b('0x28')](handleEntityNotFound(_0x1b864c,null))['then'](removeEntity(_0x1b864c,null))[_0x118b('0x45')](handleError(_0x1b864c,null));};exports['create']=function(_0x5f3fdd,_0x21a5dd){var _0x31e891={'key':_0x5f3fdd[_0x118b('0x49')][_0x118b('0x32')]};if(_0x5f3fdd[_0x118b('0x49')][_0x118b('0x4b')]){_0x31e891[_0x118b('0x4b')]=_0x5f3fdd['body'][_0x118b('0x4b')];}else if(_0x5f3fdd[_0x118b('0x49')][_0x118b('0x4c')]){_0x31e891['SmsAccountId']=_0x5f3fdd[_0x118b('0x49')]['SmsAccountId'];}else if(_0x5f3fdd[_0x118b('0x49')][_0x118b('0x4d')]){_0x31e891['OpenchannelAccountId']=_0x5f3fdd[_0x118b('0x49')][_0x118b('0x4d')];}else if(_0x5f3fdd[_0x118b('0x49')][_0x118b('0x4e')]){_0x31e891['ChatWebsiteId']=_0x5f3fdd[_0x118b('0x49')][_0x118b('0x4e')];}return db['CannedAnswer'][_0x118b('0x48')]({'where':_0x31e891})[_0x118b('0x28')](function(_0x50a31e){if(_0x50a31e){throw new db[(_0x118b('0x4f'))]['ValidationError'](_0x118b('0x50'));}return db['CannedAnswer'][_0x118b('0x51')](_0x5f3fdd['body']);})[_0x118b('0x28')](function(_0x136128){var _0x27687e=_0x5f3fdd['user'][_0x118b('0x25')]({'plain':!![]});if(!_0x27687e)throw new Error(_0x118b('0x52'));if(_0x27687e[_0x118b('0x53')]===_0x118b('0x54')){var _0x23c210=_0x136128[_0x118b('0x25')]({'plain':!![]});return db['UserProfileSection'][_0x118b('0x48')]({'where':{'name':'CannedAnswers','userProfileId':_0x27687e[_0x118b('0x55')]},'raw':!![]})[_0x118b('0x28')](function(_0x2b8684){if(_0x2b8684&&_0x2b8684[_0x118b('0x56')]===0x0){return db[_0x118b('0x27')]['create']({'name':_0x23c210[_0x118b('0x2b')],'resourceId':_0x23c210['id'],'type':_0x2b8684['name'],'sectionId':_0x2b8684['id']},{})['then'](function(){return _0x136128;});}else{return _0x136128;}})['catch'](function(_0x49d377){logger[_0x118b('0x29')](_0x118b('0x57'),_0x49d377);throw _0x49d377;});}return _0x136128;})['then'](respondWithResult(_0x21a5dd,0xc9))[_0x118b('0x45')](handleError(_0x21a5dd,null));}; \ No newline at end of file +var _0x7786=['get','UserProfileResource','status','stack','name','send','index','map','rawAttributes','type','key','model','query','keys','filters','attributes','intersection','fields','hasOwnProperty','order','sort','where','merge','filter','options','CannedAnswer','includeAll','include','findAll','rows','show','find','catch','body','params','create','MailAccountId','SmsAccountId','OpenchannelAccountId','ChatWebsiteId','ValidationError','The\x20inserted\x20key\x20already\x20exists.','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','CannedAnswers','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','path','sox','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','to-csv','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','end','offset','undefined','limit','count','set','Content-Range','json','apply','reject','update','then','destroy'];(function(_0x297ea8,_0x515202){var _0x1188bd=function(_0x29fba7){while(--_0x29fba7){_0x297ea8['push'](_0x297ea8['shift']());}};_0x1188bd(++_0x515202);}(_0x7786,0x1a2));var _0x6778=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x7786[_0x3dd15e];return _0x231fd0;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x6778('0x0'));var zipdir=require(_0x6778('0x1'));var jsonpatch=require(_0x6778('0x2'));var rp=require('request-promise');var moment=require(_0x6778('0x3'));var BPromise=require(_0x6778('0x4'));var Mustache=require(_0x6778('0x5'));var util=require(_0x6778('0x6'));var path=require(_0x6778('0x7'));var sox=require(_0x6778('0x8'));var csv=require('to-csv');var ejs=require(_0x6778('0x9'));var fs=require('fs');var fs_extra=require(_0x6778('0xa'));var _=require(_0x6778('0xb'));var squel=require(_0x6778('0xc'));var crypto=require(_0x6778('0xd'));var jsforce=require(_0x6778('0xe'));var deskjs=require(_0x6778('0xf'));var toCsv=require(_0x6778('0x10'));var querystring=require('querystring');var Papa=require(_0x6778('0x11'));var Redis=require(_0x6778('0x12'));var authService=require(_0x6778('0x13'));var qs=require(_0x6778('0x14'));var as=require(_0x6778('0x15'));var hardwareService=require(_0x6778('0x16'));var logger=require('../../config/logger')(_0x6778('0x17'));var utils=require(_0x6778('0x18'));var config=require(_0x6778('0x19'));var licenseUtil=require(_0x6778('0x1a'));var db=require(_0x6778('0x1b'))['db'];function respondWithStatusCode(_0x2b8cdd,_0x5b9231){_0x5b9231=_0x5b9231||0xcc;return function(_0x117442){if(_0x117442){return _0x2b8cdd[_0x6778('0x1c')](_0x5b9231);}return _0x2b8cdd['status'](_0x5b9231)[_0x6778('0x1d')]();};}function respondWithResult(_0x19ce58,_0x32f4a3){_0x32f4a3=_0x32f4a3||0xc8;return function(_0x35e0e4){if(_0x35e0e4){return _0x19ce58['status'](_0x32f4a3)['json'](_0x35e0e4);}};}function respondWithFilteredResult(_0x323e0f,_0x5a01fa){return function(_0x230941){if(_0x230941){var _0x1cd7cb=typeof _0x5a01fa[_0x6778('0x1e')]===_0x6778('0x1f')&&typeof _0x5a01fa[_0x6778('0x20')]===_0x6778('0x1f');var _0x5a541b=_0x230941[_0x6778('0x21')];var _0x2c2b21=_0x1cd7cb?0x0:_0x5a01fa[_0x6778('0x1e')];var _0x3a7992=_0x1cd7cb?_0x230941[_0x6778('0x21')]:_0x5a01fa[_0x6778('0x1e')]+_0x5a01fa[_0x6778('0x20')];var _0x51fc36;if(_0x3a7992>=_0x5a541b){_0x3a7992=_0x5a541b;_0x51fc36=0xc8;}else{_0x51fc36=0xce;}_0x323e0f['status'](_0x51fc36);return _0x323e0f[_0x6778('0x22')](_0x6778('0x23'),_0x2c2b21+'-'+_0x3a7992+'/'+_0x5a541b)[_0x6778('0x24')](_0x230941);}return null;};}function patchUpdates(_0x3551fa){return function(_0x1e78e6){try{jsonpatch[_0x6778('0x25')](_0x1e78e6,_0x3551fa,!![]);}catch(_0xaabc41){return BPromise[_0x6778('0x26')](_0xaabc41);}return _0x1e78e6['save']();};}function saveUpdates(_0x5a77af,_0x4b67ba){return function(_0x11365f){if(_0x11365f){return _0x11365f[_0x6778('0x27')](_0x5a77af)[_0x6778('0x28')](function(_0x58d37e){return _0x58d37e;});}return null;};}function removeEntity(_0x413757,_0x4a159c){return function(_0x209116){if(_0x209116){return _0x209116[_0x6778('0x29')]()[_0x6778('0x28')](function(){var _0x3b0b17=_0x209116[_0x6778('0x2a')]({'plain':!![]});var _0x581882='CannedAnswers';return db[_0x6778('0x2b')][_0x6778('0x29')]({'where':{'type':_0x581882,'resourceId':_0x3b0b17['id']}})['then'](function(){return _0x209116;});})['then'](function(){_0x413757[_0x6778('0x2c')](0xcc)[_0x6778('0x1d')]();});}};}function handleEntityNotFound(_0x1634f1,_0x22fd9c){return function(_0xa94392){if(!_0xa94392){_0x1634f1[_0x6778('0x1c')](0x194);}return _0xa94392;};}function handleError(_0x3c3fae,_0x3e3894){_0x3e3894=_0x3e3894||0x1f4;return function(_0x313a13){logger['error'](_0x313a13[_0x6778('0x2d')]);if(_0x313a13[_0x6778('0x2e')]){delete _0x313a13[_0x6778('0x2e')];}_0x3c3fae[_0x6778('0x2c')](_0x3e3894)[_0x6778('0x2f')](_0x313a13);};}exports[_0x6778('0x30')]=function(_0x2523ae,_0xe1aabc){var _0x3def72={},_0x5120a3={},_0x5be15c={'count':0x0,'rows':[]};var _0x2c78f3=_[_0x6778('0x31')](db['CannedAnswer'][_0x6778('0x32')],function(_0x553f45){return{'name':_0x553f45['fieldName'],'type':_0x553f45[_0x6778('0x33')][_0x6778('0x34')]};});_0x5120a3[_0x6778('0x35')]=_[_0x6778('0x31')](_0x2c78f3,_0x6778('0x2e'));_0x5120a3[_0x6778('0x36')]=_[_0x6778('0x37')](_0x2523ae[_0x6778('0x36')]);_0x5120a3[_0x6778('0x38')]=_['intersection'](_0x5120a3[_0x6778('0x35')],_0x5120a3[_0x6778('0x36')]);_0x3def72[_0x6778('0x39')]=_[_0x6778('0x3a')](_0x5120a3[_0x6778('0x35')],qs[_0x6778('0x3b')](_0x2523ae['query'][_0x6778('0x3b')]));_0x3def72['attributes']=_0x3def72[_0x6778('0x39')]['length']?_0x3def72['attributes']:_0x5120a3[_0x6778('0x35')];if(!_0x2523ae[_0x6778('0x36')][_0x6778('0x3c')]('nolimit')){_0x3def72[_0x6778('0x20')]=qs['limit'](_0x2523ae[_0x6778('0x36')][_0x6778('0x20')]);_0x3def72[_0x6778('0x1e')]=qs[_0x6778('0x1e')](_0x2523ae[_0x6778('0x36')]['offset']);}_0x3def72[_0x6778('0x3d')]=qs[_0x6778('0x3e')](_0x2523ae[_0x6778('0x36')][_0x6778('0x3e')]);_0x3def72[_0x6778('0x3f')]=qs[_0x6778('0x38')](_['pick'](_0x2523ae[_0x6778('0x36')],_0x5120a3[_0x6778('0x38')]),_0x2c78f3);if(_0x2523ae[_0x6778('0x36')]['filter']){_0x3def72[_0x6778('0x3f')]=_[_0x6778('0x40')](_0x3def72[_0x6778('0x3f')],{'$or':[{'key':{'$like':'%'+_0x2523ae[_0x6778('0x36')][_0x6778('0x41')]+'%'}},{'value':{'$like':'%'+_0x2523ae[_0x6778('0x36')][_0x6778('0x41')]+'%'}}]});}_0x3def72=_[_0x6778('0x40')]({},_0x3def72,_0x2523ae[_0x6778('0x42')]);var _0xcf3a05={'where':_0x3def72[_0x6778('0x3f')]};return db[_0x6778('0x43')][_0x6778('0x21')](_0xcf3a05)[_0x6778('0x28')](function(_0x302f8b){_0x5be15c['count']=_0x302f8b;if(_0x2523ae[_0x6778('0x36')][_0x6778('0x44')]){_0x3def72[_0x6778('0x45')]=[{'all':!![]}];}return db[_0x6778('0x43')][_0x6778('0x46')](_0x3def72);})[_0x6778('0x28')](function(_0x25db4d){_0x5be15c[_0x6778('0x47')]=_0x25db4d;return _0x5be15c;})[_0x6778('0x28')](respondWithFilteredResult(_0xe1aabc,_0x3def72))['catch'](handleError(_0xe1aabc,null));};exports[_0x6778('0x48')]=function(_0x2b51ce,_0x3fb3f3){var _0x2b6970={'raw':!![],'where':{'id':_0x2b51ce['params']['id']}},_0x176131={};_0x176131[_0x6778('0x35')]=_['keys'](db['CannedAnswer'][_0x6778('0x32')]);_0x176131[_0x6778('0x36')]=_[_0x6778('0x37')](_0x2b51ce[_0x6778('0x36')]);_0x176131[_0x6778('0x38')]=_[_0x6778('0x3a')](_0x176131[_0x6778('0x35')],_0x176131[_0x6778('0x36')]);_0x2b6970[_0x6778('0x39')]=_[_0x6778('0x3a')](_0x176131[_0x6778('0x35')],qs[_0x6778('0x3b')](_0x2b51ce[_0x6778('0x36')]['fields']));_0x2b6970[_0x6778('0x39')]=_0x2b6970[_0x6778('0x39')]['length']?_0x2b6970['attributes']:_0x176131[_0x6778('0x35')];if(_0x2b51ce[_0x6778('0x36')][_0x6778('0x44')]){_0x2b6970[_0x6778('0x45')]=[{'all':!![]}];}_0x2b6970=_[_0x6778('0x40')]({},_0x2b6970,_0x2b51ce[_0x6778('0x42')]);return db[_0x6778('0x43')][_0x6778('0x49')](_0x2b6970)[_0x6778('0x28')](handleEntityNotFound(_0x3fb3f3,null))[_0x6778('0x28')](respondWithResult(_0x3fb3f3,null))[_0x6778('0x4a')](handleError(_0x3fb3f3,null));};exports[_0x6778('0x27')]=function(_0x54d45a,_0x4cdb2e){if(_0x54d45a[_0x6778('0x4b')]['id']){delete _0x54d45a['body']['id'];}return db[_0x6778('0x43')][_0x6778('0x49')]({'where':{'id':_0x54d45a[_0x6778('0x4c')]['id']}})[_0x6778('0x28')](handleEntityNotFound(_0x4cdb2e,null))[_0x6778('0x28')](saveUpdates(_0x54d45a[_0x6778('0x4b')],null))[_0x6778('0x28')](respondWithResult(_0x4cdb2e,null))[_0x6778('0x4a')](handleError(_0x4cdb2e,null));};exports[_0x6778('0x29')]=function(_0x53fd59,_0x1165c8){return db['CannedAnswer']['find']({'where':{'id':_0x53fd59[_0x6778('0x4c')]['id']}})['then'](handleEntityNotFound(_0x1165c8,null))['then'](removeEntity(_0x1165c8,null))[_0x6778('0x4a')](handleError(_0x1165c8,null));};exports[_0x6778('0x4d')]=function(_0x453de9,_0x15f587){var _0x4f2c61={'key':_0x453de9[_0x6778('0x4b')][_0x6778('0x34')]};if(_0x453de9[_0x6778('0x4b')]['MailAccountId']){_0x4f2c61[_0x6778('0x4e')]=_0x453de9[_0x6778('0x4b')][_0x6778('0x4e')];}else if(_0x453de9[_0x6778('0x4b')][_0x6778('0x4f')]){_0x4f2c61[_0x6778('0x4f')]=_0x453de9[_0x6778('0x4b')][_0x6778('0x4f')];}else if(_0x453de9[_0x6778('0x4b')][_0x6778('0x50')]){_0x4f2c61['OpenchannelAccountId']=_0x453de9[_0x6778('0x4b')]['OpenchannelAccountId'];}else if(_0x453de9[_0x6778('0x4b')][_0x6778('0x51')]){_0x4f2c61['ChatWebsiteId']=_0x453de9[_0x6778('0x4b')][_0x6778('0x51')];}return db[_0x6778('0x43')]['find']({'where':_0x4f2c61})[_0x6778('0x28')](function(_0x5c19d7){if(_0x5c19d7){throw new db['Sequelize'][(_0x6778('0x52'))](_0x6778('0x53'));}return db[_0x6778('0x43')]['create'](_0x453de9[_0x6778('0x4b')]);})[_0x6778('0x28')](function(_0x3ba249){var _0x3651db=_0x453de9[_0x6778('0x54')][_0x6778('0x2a')]({'plain':!![]});if(!_0x3651db)throw new Error(_0x6778('0x55'));if(_0x3651db[_0x6778('0x56')]==='user'){var _0x224e66=_0x3ba249[_0x6778('0x2a')]({'plain':!![]});return db[_0x6778('0x57')][_0x6778('0x49')]({'where':{'name':_0x6778('0x58'),'userProfileId':_0x3651db[_0x6778('0x59')]},'raw':!![]})['then'](function(_0x34298c){if(_0x34298c&&_0x34298c[_0x6778('0x5a')]===0x0){return db[_0x6778('0x2b')][_0x6778('0x4d')]({'name':_0x224e66[_0x6778('0x2e')],'resourceId':_0x224e66['id'],'type':_0x34298c[_0x6778('0x2e')],'sectionId':_0x34298c['id']},{})[_0x6778('0x28')](function(){return _0x3ba249;});}else{return _0x3ba249;}})[_0x6778('0x4a')](function(_0x48ccb7){logger['error'](_0x6778('0x5b'),_0x48ccb7);throw _0x48ccb7;});}return _0x3ba249;})['then'](respondWithResult(_0x15f587,0xc9))['catch'](handleError(_0x15f587,null));}; \ No newline at end of file diff --git a/server/api/cannedAnswer/cannedAnswer.model.js b/server/api/cannedAnswer/cannedAnswer.model.js index 65c2232..9a35d6b 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 _0x6212=['CannedAnswer','tools_canned_answers','utf8mb4','utf8mb4_unicode_ci','util','../../config/logger','api','bluebird','request-promise','path','rimraf','../../config/environment','./cannedAnswer.attributes','exports'];(function(_0x5ec171,_0x1bc5ac){var _0x1daffc=function(_0x4cd205){while(--_0x4cd205){_0x5ec171['push'](_0x5ec171['shift']());}};_0x1daffc(++_0x1bc5ac);}(_0x6212,0x1d2));var _0x2621=function(_0x87e314,_0x1529d2){_0x87e314=_0x87e314-0x0;var _0x4f9fb6=_0x6212[_0x87e314];return _0x4f9fb6;};'use strict';var _=require('lodash');var util=require(_0x2621('0x0'));var logger=require(_0x2621('0x1'))(_0x2621('0x2'));var moment=require('moment');var BPromise=require(_0x2621('0x3'));var rp=require(_0x2621('0x4'));var fs=require('fs');var path=require(_0x2621('0x5'));var rimraf=require(_0x2621('0x6'));var config=require(_0x2621('0x7'));var attributes=require(_0x2621('0x8'));module[_0x2621('0x9')]=function(_0x36216b,_0x1d4bea){return _0x36216b['define'](_0x2621('0xa'),attributes,{'tableName':_0x2621('0xb'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x2621('0xc'),'collate':_0x2621('0xd')});}; \ No newline at end of file +var _0xd22c=['../../config/environment','./cannedAnswer.attributes','exports','define','CannedAnswer','utf8mb4','lodash','util','../../config/logger','api','request-promise','rimraf'];(function(_0x3d2a62,_0x678757){var _0x58596b=function(_0x6f094e){while(--_0x6f094e){_0x3d2a62['push'](_0x3d2a62['shift']());}};_0x58596b(++_0x678757);}(_0xd22c,0x1c2));var _0xcd22=function(_0x1e23b8,_0x4690f9){_0x1e23b8=_0x1e23b8-0x0;var _0x11f0f3=_0xd22c[_0x1e23b8];return _0x11f0f3;};'use strict';var _=require(_0xcd22('0x0'));var util=require(_0xcd22('0x1'));var logger=require(_0xcd22('0x2'))(_0xcd22('0x3'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0xcd22('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0xcd22('0x5'));var config=require(_0xcd22('0x6'));var attributes=require(_0xcd22('0x7'));module[_0xcd22('0x8')]=function(_0x45c55e,_0x2a4c68){return _0x45c55e[_0xcd22('0x9')](_0xcd22('0xa'),attributes,{'tableName':'tools_canned_answers','paranoid':![],'indexes':[],'timestamps':!![],'charset':_0xcd22('0xb'),'collate':'utf8mb4_unicode_ci'});}; \ No newline at end of file diff --git a/server/api/cannedAnswer/cannedAnswer.rpc.js b/server/api/cannedAnswer/cannedAnswer.rpc.js index df37b8d..5350136 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(_0x5950a4,_0x3a8648){var _0x224b20=function(_0x56af52){while(--_0x56af52){_0x5950a4['push'](_0x5950a4['shift']());}};_0x224b20(++_0x3a8648);}(_0xa9e0,0x123));var _0x0a9e=function(_0x4b7b62,_0x4920a9){_0x4b7b62=_0x4b7b62-0x0;var _0x2280df=_0xa9e0[_0x4b7b62];return _0x2280df;};'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(_0x1af26e,_0x182af8){var _0x158f7e=function(_0x302bc1){while(--_0x302bc1){_0x1af26e['push'](_0x1af26e['shift']());}};_0x158f7e(++_0x182af8);}(_0xa9e0,0x123));var _0x0a9e=function(_0x4243a3,_0x447337){_0x4243a3=_0x4243a3-0x0;var _0x1b2a33=_0xa9e0[_0x4243a3];return _0x1b2a33;};'use strict';var _=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var 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 47d5743..1c9e9a3 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 _0xcc9d=['create','/:id','update','destroy','exports','multer','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','index','isAuthenticated','post'];(function(_0x3c755a,_0x1e220d){var _0x1a7177=function(_0x1bd88e){while(--_0x1bd88e){_0x3c755a['push'](_0x3c755a['shift']());}};_0x1a7177(++_0x1e220d);}(_0xcc9d,0x6b));var _0xdcc9=function(_0x564c60,_0x25afdc){_0x564c60=_0x564c60-0x0;var _0x484d84=_0xcc9d[_0x564c60];return _0x484d84;};'use strict';var multer=require(_0xdcc9('0x0'));var util=require('util');var path=require('path');var timeout=require(_0xdcc9('0x1'));var express=require(_0xdcc9('0x2'));var router=express[_0xdcc9('0x3')]();var fs_extra=require(_0xdcc9('0x4'));var auth=require(_0xdcc9('0x5'));var interaction=require(_0xdcc9('0x6'));var config=require(_0xdcc9('0x7'));var controller=require('./cannedAnswer.controller');router[_0xdcc9('0x8')]('/',auth['isAuthenticated'](),controller[_0xdcc9('0x9')]);router[_0xdcc9('0x8')]('/:id',auth[_0xdcc9('0xa')](),controller['show']);router[_0xdcc9('0xb')]('/',auth[_0xdcc9('0xa')](),controller[_0xdcc9('0xc')]);router['put'](_0xdcc9('0xd'),auth[_0xdcc9('0xa')](),controller[_0xdcc9('0xe')]);router['delete'](_0xdcc9('0xd'),auth[_0xdcc9('0xa')](),controller[_0xdcc9('0xf')]);module[_0xdcc9('0x10')]=router; \ No newline at end of file +var _0x5c4e=['destroy','exports','multer','util','connect-timeout','Router','../../config/environment','./cannedAnswer.controller','get','isAuthenticated','index','/:id','post','create','put','update','delete'];(function(_0x5c36ed,_0x4f3eb1){var _0x3cfb22=function(_0x53eaf0){while(--_0x53eaf0){_0x5c36ed['push'](_0x5c36ed['shift']());}};_0x3cfb22(++_0x4f3eb1);}(_0x5c4e,0x178));var _0xe5c4=function(_0x333f13,_0x387cb9){_0x333f13=_0x333f13-0x0;var _0x98b818=_0x5c4e[_0x333f13];return _0x98b818;};'use strict';var multer=require(_0xe5c4('0x0'));var util=require(_0xe5c4('0x1'));var path=require('path');var timeout=require(_0xe5c4('0x2'));var express=require('express');var router=express[_0xe5c4('0x3')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0xe5c4('0x4'));var controller=require(_0xe5c4('0x5'));router[_0xe5c4('0x6')]('/',auth[_0xe5c4('0x7')](),controller[_0xe5c4('0x8')]);router[_0xe5c4('0x6')](_0xe5c4('0x9'),auth[_0xe5c4('0x7')](),controller['show']);router[_0xe5c4('0xa')]('/',auth[_0xe5c4('0x7')](),controller[_0xe5c4('0xb')]);router[_0xe5c4('0xc')](_0xe5c4('0x9'),auth['isAuthenticated'](),controller[_0xe5c4('0xd')]);router[_0xe5c4('0xe')](_0xe5c4('0x9'),auth[_0xe5c4('0x7')](),controller[_0xe5c4('0xf')]);module[_0xe5c4('0x10')]=router; \ No newline at end of file diff --git a/server/api/cdr/cdr.attributes.js b/server/api/cdr/cdr.attributes.js index 4486f63..0fafc37 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 _0xf0e8=['exports','1970-01-01\x2000:00:01','STRING','INTEGER','sequelize'];(function(_0x3ebf20,_0x45fa5d){var _0x5d4975=function(_0x4de4fb){while(--_0x4de4fb){_0x3ebf20['push'](_0x3ebf20['shift']());}};_0x5d4975(++_0x45fa5d);}(_0xf0e8,0x81));var _0x8f0e=function(_0x57b54c,_0x54ce0d){_0x57b54c=_0x57b54c-0x0;var _0x59cc19=_0xf0e8[_0x57b54c];return _0x59cc19;};'use strict';var Sequelize=require(_0x8f0e('0x0'));module[_0x8f0e('0x1')]={'calldate':{'type':Sequelize['DATE'],'allowNull':![],'defaultValue':_0x8f0e('0x2')},'clid':{'type':Sequelize['STRING']},'src':{'type':Sequelize[_0x8f0e('0x3')]},'dst':{'type':Sequelize[_0x8f0e('0x3')]},'dcontext':{'type':Sequelize['STRING']},'channel':{'type':Sequelize[_0x8f0e('0x3')]},'dstchannel':{'type':Sequelize[_0x8f0e('0x3')]},'lastapp':{'type':Sequelize[_0x8f0e('0x3')]},'lastdata':{'type':Sequelize[_0x8f0e('0x3')]},'duration':{'type':Sequelize[_0x8f0e('0x4')],'allowNull':![],'defaultValue':0x0},'billsec':{'type':Sequelize['INTEGER'],'allowNull':![],'defaultValue':0x0},'disposition':{'type':Sequelize['STRING']},'amaflags':{'type':Sequelize[_0x8f0e('0x4')],'allowNull':![],'defaultValue':0x0},'accountcode':{'type':Sequelize[_0x8f0e('0x3')]},'userfield':{'type':Sequelize['STRING']},'uniqueid':{'type':Sequelize[_0x8f0e('0x3')]},'linkedid':{'type':Sequelize[_0x8f0e('0x3')]},'sequence':{'type':Sequelize[_0x8f0e('0x3')]},'peeraccount':{'type':Sequelize['STRING']},'type':{'type':Sequelize['STRING']},'tag':{'type':Sequelize[_0x8f0e('0x3')]}}; \ No newline at end of file +var _0x13f7=['STRING','INTEGER','sequelize','exports','DATE','1970-01-01\x2000:00:01'];(function(_0x158c10,_0x24266c){var _0x51c9d9=function(_0x26ae21){while(--_0x26ae21){_0x158c10['push'](_0x158c10['shift']());}};_0x51c9d9(++_0x24266c);}(_0x13f7,0x164));var _0x713f=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0x13f7[_0x321bb2];return _0x9c12ed;};'use strict';var Sequelize=require(_0x713f('0x0'));module[_0x713f('0x1')]={'calldate':{'type':Sequelize[_0x713f('0x2')],'allowNull':![],'defaultValue':_0x713f('0x3')},'clid':{'type':Sequelize['STRING']},'src':{'type':Sequelize[_0x713f('0x4')]},'dst':{'type':Sequelize['STRING']},'dcontext':{'type':Sequelize[_0x713f('0x4')]},'channel':{'type':Sequelize[_0x713f('0x4')]},'dstchannel':{'type':Sequelize[_0x713f('0x4')]},'lastapp':{'type':Sequelize['STRING']},'lastdata':{'type':Sequelize['STRING']},'duration':{'type':Sequelize['INTEGER'],'allowNull':![],'defaultValue':0x0},'billsec':{'type':Sequelize[_0x713f('0x5')],'allowNull':![],'defaultValue':0x0},'disposition':{'type':Sequelize[_0x713f('0x4')]},'amaflags':{'type':Sequelize['INTEGER'],'allowNull':![],'defaultValue':0x0},'accountcode':{'type':Sequelize['STRING']},'userfield':{'type':Sequelize[_0x713f('0x4')]},'uniqueid':{'type':Sequelize['STRING']},'linkedid':{'type':Sequelize[_0x713f('0x4')]},'sequence':{'type':Sequelize[_0x713f('0x4')]},'peeraccount':{'type':Sequelize[_0x713f('0x4')]},'type':{'type':Sequelize[_0x713f('0x4')]},'tag':{'type':Sequelize[_0x713f('0x4')]}}; \ No newline at end of file diff --git a/server/api/cdr/cdr.controller.js b/server/api/cdr/cdr.controller.js index f81bf55..010fa42 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 _0xf987=['attributes','intersection','fields','length','hasOwnProperty','nolimit','offset','order','sort','where','pick','filter','merge','VIRTUAL','options','then','findAll','catch','show','params','find','create','body','describe','zip-dir','fast-json-patch','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','json','limit','undefined','count','Content-Range','apply','reject','save','update','destroy','error','stack','name','index','map','Cdr','rawAttributes','fieldName','type','model','keys','filters','query'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xf987,0x18a));var _0x7f98=function(_0x4df542,_0x3fbbb3){_0x4df542=_0x4df542-0x0;var _0x5d6a7d=_0xf987[_0x4df542];return _0x5d6a7d;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0x7f98('0x0'));var jsonpatch=require(_0x7f98('0x1'));var rp=require('request-promise');var moment=require(_0x7f98('0x2'));var BPromise=require(_0x7f98('0x3'));var Mustache=require(_0x7f98('0x4'));var util=require(_0x7f98('0x5'));var path=require(_0x7f98('0x6'));var sox=require(_0x7f98('0x7'));var csv=require(_0x7f98('0x8'));var ejs=require(_0x7f98('0x9'));var fs=require('fs');var fs_extra=require(_0x7f98('0xa'));var _=require(_0x7f98('0xb'));var squel=require(_0x7f98('0xc'));var crypto=require(_0x7f98('0xd'));var jsforce=require('jsforce');var deskjs=require(_0x7f98('0xe'));var toCsv=require(_0x7f98('0x8'));var querystring=require(_0x7f98('0xf'));var Papa=require(_0x7f98('0x10'));var Redis=require(_0x7f98('0x11'));var authService=require('../../components/auth/service');var qs=require(_0x7f98('0x12'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0x7f98('0x13'))(_0x7f98('0x14'));var utils=require(_0x7f98('0x15'));var config=require(_0x7f98('0x16'));var licenseUtil=require('../../config/license/util');var db=require(_0x7f98('0x17'))['db'];function respondWithStatusCode(_0x4c4ae9,_0x9c2633){_0x9c2633=_0x9c2633||0xcc;return function(_0x2c26d8){if(_0x2c26d8){return _0x4c4ae9[_0x7f98('0x18')](_0x9c2633);}return _0x4c4ae9[_0x7f98('0x19')](_0x9c2633)[_0x7f98('0x1a')]();};}function respondWithResult(_0x11b1f8,_0x33108e){_0x33108e=_0x33108e||0xc8;return function(_0x3044d4){if(_0x3044d4){return _0x11b1f8[_0x7f98('0x19')](_0x33108e)[_0x7f98('0x1b')](_0x3044d4);}};}function respondWithFilteredResult(_0x2d366a,_0x1fa829){return function(_0x5e3bb5){if(_0x5e3bb5){var _0xcab406=typeof _0x1fa829['offset']==='undefined'&&typeof _0x1fa829[_0x7f98('0x1c')]===_0x7f98('0x1d');var _0x585a1a=_0x5e3bb5['count'];var _0x5f27dd=_0xcab406?0x0:_0x1fa829['offset'];var _0x111385=_0xcab406?_0x5e3bb5[_0x7f98('0x1e')]:_0x1fa829['offset']+_0x1fa829['limit'];var _0x4f3ac0;if(_0x111385>=_0x585a1a){_0x111385=_0x585a1a;_0x4f3ac0=0xc8;}else{_0x4f3ac0=0xce;}_0x2d366a[_0x7f98('0x19')](_0x4f3ac0);return _0x2d366a['set'](_0x7f98('0x1f'),_0x5f27dd+'-'+_0x111385+'/'+_0x585a1a)[_0x7f98('0x1b')](_0x5e3bb5);}return null;};}function patchUpdates(_0x3e78e2){return function(_0x446dd5){try{jsonpatch[_0x7f98('0x20')](_0x446dd5,_0x3e78e2,!![]);}catch(_0x1f2e6c){return BPromise[_0x7f98('0x21')](_0x1f2e6c);}return _0x446dd5[_0x7f98('0x22')]();};}function saveUpdates(_0x20ad36,_0x53c1ef){return function(_0x55189b){if(_0x55189b){return _0x55189b[_0x7f98('0x23')](_0x20ad36)['then'](function(_0xf39ff1){return _0xf39ff1;});}return null;};}function removeEntity(_0x2d9e09,_0x51eca3){return function(_0x417ad4){if(_0x417ad4){return _0x417ad4[_0x7f98('0x24')]()['then'](function(){_0x2d9e09[_0x7f98('0x19')](0xcc)[_0x7f98('0x1a')]();});}};}function handleEntityNotFound(_0x1d6bdb,_0x1a5788){return function(_0x3e1cd5){if(!_0x3e1cd5){_0x1d6bdb[_0x7f98('0x18')](0x194);}return _0x3e1cd5;};}function handleError(_0x2b58d0,_0x8b27a4){_0x8b27a4=_0x8b27a4||0x1f4;return function(_0x1d086f){logger[_0x7f98('0x25')](_0x1d086f[_0x7f98('0x26')]);if(_0x1d086f[_0x7f98('0x27')]){delete _0x1d086f[_0x7f98('0x27')];}_0x2b58d0['status'](_0x8b27a4)['send'](_0x1d086f);};}exports[_0x7f98('0x28')]=function(_0x2122f4,_0x186519){var _0x1dd8d5={},_0xc8f69f={},_0x16a8cb={'count':0x0,'rows':[]};var _0x20ff8d=_[_0x7f98('0x29')](db[_0x7f98('0x2a')][_0x7f98('0x2b')],function(_0x544bae){return{'name':_0x544bae[_0x7f98('0x2c')],'type':_0x544bae[_0x7f98('0x2d')]['key']};});_0xc8f69f[_0x7f98('0x2e')]=_[_0x7f98('0x29')](_0x20ff8d,_0x7f98('0x27'));_0xc8f69f['query']=_[_0x7f98('0x2f')](_0x2122f4['query']);_0xc8f69f[_0x7f98('0x30')]=_['intersection'](_0xc8f69f[_0x7f98('0x2e')],_0xc8f69f[_0x7f98('0x31')]);_0x1dd8d5[_0x7f98('0x32')]=_[_0x7f98('0x33')](_0xc8f69f[_0x7f98('0x2e')],qs[_0x7f98('0x34')](_0x2122f4[_0x7f98('0x31')]['fields']));_0x1dd8d5['attributes']=_0x1dd8d5[_0x7f98('0x32')][_0x7f98('0x35')]?_0x1dd8d5[_0x7f98('0x32')]:_0xc8f69f[_0x7f98('0x2e')];if(!_0x2122f4[_0x7f98('0x31')][_0x7f98('0x36')](_0x7f98('0x37'))){_0x1dd8d5['limit']=qs['limit'](_0x2122f4[_0x7f98('0x31')]['limit']);_0x1dd8d5[_0x7f98('0x38')]=qs['offset'](_0x2122f4[_0x7f98('0x31')][_0x7f98('0x38')]);}_0x1dd8d5[_0x7f98('0x39')]=qs[_0x7f98('0x3a')](_0x2122f4[_0x7f98('0x31')][_0x7f98('0x3a')]);_0x1dd8d5[_0x7f98('0x3b')]=qs[_0x7f98('0x30')](_[_0x7f98('0x3c')](_0x2122f4[_0x7f98('0x31')],_0xc8f69f[_0x7f98('0x30')]),_0x20ff8d);if(_0x2122f4[_0x7f98('0x31')][_0x7f98('0x3d')]){_0x1dd8d5[_0x7f98('0x3b')]=_[_0x7f98('0x3e')](_0x1dd8d5[_0x7f98('0x3b')],{'$or':_[_0x7f98('0x29')](_0x20ff8d,function(_0x45f280){if(_0x45f280[_0x7f98('0x2d')]!==_0x7f98('0x3f')){var _0x1b82cc={};_0x1b82cc[_0x45f280[_0x7f98('0x27')]]={'$like':'%'+_0x2122f4[_0x7f98('0x31')]['filter']+'%'};return _0x1b82cc;}})});}_0x1dd8d5=_[_0x7f98('0x3e')]({},_0x1dd8d5,_0x2122f4[_0x7f98('0x40')]);var _0x57a855={'where':_0x1dd8d5[_0x7f98('0x3b')]};return db['Cdr']['count'](_0x57a855)[_0x7f98('0x41')](function(_0x24bbdc){_0x16a8cb['count']=_0x24bbdc;if(_0x2122f4[_0x7f98('0x31')]['includeAll']){_0x1dd8d5['include']=[{'all':!![]}];}return db['Cdr'][_0x7f98('0x42')](_0x1dd8d5);})['then'](function(_0x2ab479){_0x16a8cb['rows']=_0x2ab479;return _0x16a8cb;})[_0x7f98('0x41')](respondWithFilteredResult(_0x186519,_0x1dd8d5))[_0x7f98('0x43')](handleError(_0x186519,null));};exports[_0x7f98('0x44')]=function(_0x1d53eb,_0x48ede9){var _0x55a8cc={'raw':!![],'where':{'id':_0x1d53eb[_0x7f98('0x45')]['id']}},_0x5b8fef={};_0x5b8fef[_0x7f98('0x2e')]=_['keys'](db['Cdr'][_0x7f98('0x2b')]);_0x5b8fef[_0x7f98('0x31')]=_[_0x7f98('0x2f')](_0x1d53eb[_0x7f98('0x31')]);_0x5b8fef[_0x7f98('0x30')]=_[_0x7f98('0x33')](_0x5b8fef['model'],_0x5b8fef[_0x7f98('0x31')]);_0x55a8cc[_0x7f98('0x32')]=_[_0x7f98('0x33')](_0x5b8fef[_0x7f98('0x2e')],qs[_0x7f98('0x34')](_0x1d53eb[_0x7f98('0x31')][_0x7f98('0x34')]));_0x55a8cc[_0x7f98('0x32')]=_0x55a8cc[_0x7f98('0x32')][_0x7f98('0x35')]?_0x55a8cc[_0x7f98('0x32')]:_0x5b8fef[_0x7f98('0x2e')];if(_0x1d53eb['query']['includeAll']){_0x55a8cc['include']=[{'all':!![]}];}_0x55a8cc=_[_0x7f98('0x3e')]({},_0x55a8cc,_0x1d53eb[_0x7f98('0x40')]);return db['Cdr'][_0x7f98('0x46')](_0x55a8cc)[_0x7f98('0x41')](handleEntityNotFound(_0x48ede9,null))[_0x7f98('0x41')](respondWithResult(_0x48ede9,null))[_0x7f98('0x43')](handleError(_0x48ede9,null));};exports[_0x7f98('0x47')]=function(_0x83db32,_0x157723){return db[_0x7f98('0x2a')][_0x7f98('0x47')](_0x83db32['body'],{})[_0x7f98('0x41')](respondWithResult(_0x157723,0xc9))[_0x7f98('0x43')](handleError(_0x157723,null));};exports[_0x7f98('0x23')]=function(_0x32e242,_0x3396a7){if(_0x32e242['body']['id']){delete _0x32e242[_0x7f98('0x48')]['id'];}return db[_0x7f98('0x2a')]['find']({'where':{'id':_0x32e242[_0x7f98('0x45')]['id']}})[_0x7f98('0x41')](handleEntityNotFound(_0x3396a7,null))[_0x7f98('0x41')](saveUpdates(_0x32e242[_0x7f98('0x48')],null))['then'](respondWithResult(_0x3396a7,null))[_0x7f98('0x43')](handleError(_0x3396a7,null));};exports['destroy']=function(_0x513c2f,_0x3467ad){return db[_0x7f98('0x2a')][_0x7f98('0x46')]({'where':{'id':_0x513c2f[_0x7f98('0x45')]['id']}})[_0x7f98('0x41')](handleEntityNotFound(_0x3467ad,null))[_0x7f98('0x41')](removeEntity(_0x3467ad,null))[_0x7f98('0x43')](handleError(_0x3467ad,null));};exports[_0x7f98('0x49')]=function(_0x3b268d,_0x203a53){return db['Cdr'][_0x7f98('0x49')]()[_0x7f98('0x41')](respondWithResult(_0x203a53,null))[_0x7f98('0x43')](handleError(_0x203a53,null));}; \ No newline at end of file +var _0xcb81=['save','then','destroy','error','stack','name','send','index','Cdr','rawAttributes','type','key','model','map','keys','query','filters','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','where','filter','merge','VIRTUAL','options','includeAll','include','findAll','rows','catch','find','create','body','update','params','describe','eml-format','rimraf','fast-json-patch','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','../../config/environment','../../mysqldb','sendStatus','end','status','json','undefined','limit','count','offset','set','Content-Range','apply','reject'];(function(_0x35981a,_0x186a81){var _0x324a1e=function(_0x1b0318){while(--_0x1b0318){_0x35981a['push'](_0x35981a['shift']());}};_0x324a1e(++_0x186a81);}(_0xcb81,0x154));var _0x1cb8=function(_0x1bc762,_0x523eb3){_0x1bc762=_0x1bc762-0x0;var _0x40f70c=_0xcb81[_0x1bc762];return _0x40f70c;};'use strict';var emlformat=require(_0x1cb8('0x0'));var rimraf=require(_0x1cb8('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x1cb8('0x2'));var rp=require('request-promise');var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0x1cb8('0x3'));var util=require(_0x1cb8('0x4'));var path=require(_0x1cb8('0x5'));var sox=require(_0x1cb8('0x6'));var csv=require(_0x1cb8('0x7'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x1cb8('0x8'));var _=require(_0x1cb8('0x9'));var squel=require('squel');var crypto=require(_0x1cb8('0xa'));var jsforce=require(_0x1cb8('0xb'));var deskjs=require(_0x1cb8('0xc'));var toCsv=require('to-csv');var querystring=require(_0x1cb8('0xd'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0x1cb8('0xe'));var qs=require(_0x1cb8('0xf'));var as=require(_0x1cb8('0x10'));var hardwareService=require(_0x1cb8('0x11'));var logger=require(_0x1cb8('0x12'))(_0x1cb8('0x13'));var utils=require(_0x1cb8('0x14'));var config=require(_0x1cb8('0x15'));var licenseUtil=require('../../config/license/util');var db=require(_0x1cb8('0x16'))['db'];function respondWithStatusCode(_0x1ffe94,_0x1938ee){_0x1938ee=_0x1938ee||0xcc;return function(_0x299eea){if(_0x299eea){return _0x1ffe94[_0x1cb8('0x17')](_0x1938ee);}return _0x1ffe94['status'](_0x1938ee)[_0x1cb8('0x18')]();};}function respondWithResult(_0x2c600,_0xcb6ad1){_0xcb6ad1=_0xcb6ad1||0xc8;return function(_0x14d84d){if(_0x14d84d){return _0x2c600[_0x1cb8('0x19')](_0xcb6ad1)[_0x1cb8('0x1a')](_0x14d84d);}};}function respondWithFilteredResult(_0x339ad0,_0x243930){return function(_0x5af4a3){if(_0x5af4a3){var _0x17a95d=typeof _0x243930['offset']===_0x1cb8('0x1b')&&typeof _0x243930[_0x1cb8('0x1c')]===_0x1cb8('0x1b');var _0x46abd0=_0x5af4a3[_0x1cb8('0x1d')];var _0x308088=_0x17a95d?0x0:_0x243930[_0x1cb8('0x1e')];var _0x9f0adb=_0x17a95d?_0x5af4a3[_0x1cb8('0x1d')]:_0x243930[_0x1cb8('0x1e')]+_0x243930[_0x1cb8('0x1c')];var _0x3cda27;if(_0x9f0adb>=_0x46abd0){_0x9f0adb=_0x46abd0;_0x3cda27=0xc8;}else{_0x3cda27=0xce;}_0x339ad0['status'](_0x3cda27);return _0x339ad0[_0x1cb8('0x1f')](_0x1cb8('0x20'),_0x308088+'-'+_0x9f0adb+'/'+_0x46abd0)[_0x1cb8('0x1a')](_0x5af4a3);}return null;};}function patchUpdates(_0x3d1682){return function(_0x4abf3a){try{jsonpatch[_0x1cb8('0x21')](_0x4abf3a,_0x3d1682,!![]);}catch(_0x4f9220){return BPromise[_0x1cb8('0x22')](_0x4f9220);}return _0x4abf3a[_0x1cb8('0x23')]();};}function saveUpdates(_0x40b914,_0x38ff3a){return function(_0x559916){if(_0x559916){return _0x559916['update'](_0x40b914)[_0x1cb8('0x24')](function(_0x4040be){return _0x4040be;});}return null;};}function removeEntity(_0x22dafe,_0x44a00d){return function(_0x2473b8){if(_0x2473b8){return _0x2473b8[_0x1cb8('0x25')]()[_0x1cb8('0x24')](function(){_0x22dafe['status'](0xcc)[_0x1cb8('0x18')]();});}};}function handleEntityNotFound(_0x4554d5,_0x35c890){return function(_0xeeb21d){if(!_0xeeb21d){_0x4554d5[_0x1cb8('0x17')](0x194);}return _0xeeb21d;};}function handleError(_0x41ab56,_0x4ca3be){_0x4ca3be=_0x4ca3be||0x1f4;return function(_0x1ec995){logger[_0x1cb8('0x26')](_0x1ec995[_0x1cb8('0x27')]);if(_0x1ec995[_0x1cb8('0x28')]){delete _0x1ec995[_0x1cb8('0x28')];}_0x41ab56['status'](_0x4ca3be)[_0x1cb8('0x29')](_0x1ec995);};}exports[_0x1cb8('0x2a')]=function(_0x3a8b53,_0x21c17a){var _0x4fda96={},_0x2a79e0={},_0x2ba8c8={'count':0x0,'rows':[]};var _0x3a6a67=_['map'](db[_0x1cb8('0x2b')][_0x1cb8('0x2c')],function(_0x17abe1){return{'name':_0x17abe1['fieldName'],'type':_0x17abe1[_0x1cb8('0x2d')][_0x1cb8('0x2e')]};});_0x2a79e0[_0x1cb8('0x2f')]=_[_0x1cb8('0x30')](_0x3a6a67,_0x1cb8('0x28'));_0x2a79e0['query']=_[_0x1cb8('0x31')](_0x3a8b53[_0x1cb8('0x32')]);_0x2a79e0[_0x1cb8('0x33')]=_[_0x1cb8('0x34')](_0x2a79e0[_0x1cb8('0x2f')],_0x2a79e0[_0x1cb8('0x32')]);_0x4fda96[_0x1cb8('0x35')]=_[_0x1cb8('0x34')](_0x2a79e0[_0x1cb8('0x2f')],qs['fields'](_0x3a8b53['query'][_0x1cb8('0x36')]));_0x4fda96[_0x1cb8('0x35')]=_0x4fda96[_0x1cb8('0x35')]['length']?_0x4fda96['attributes']:_0x2a79e0[_0x1cb8('0x2f')];if(!_0x3a8b53[_0x1cb8('0x32')][_0x1cb8('0x37')](_0x1cb8('0x38'))){_0x4fda96[_0x1cb8('0x1c')]=qs[_0x1cb8('0x1c')](_0x3a8b53[_0x1cb8('0x32')][_0x1cb8('0x1c')]);_0x4fda96['offset']=qs[_0x1cb8('0x1e')](_0x3a8b53[_0x1cb8('0x32')][_0x1cb8('0x1e')]);}_0x4fda96[_0x1cb8('0x39')]=qs[_0x1cb8('0x3a')](_0x3a8b53[_0x1cb8('0x32')][_0x1cb8('0x3a')]);_0x4fda96[_0x1cb8('0x3b')]=qs[_0x1cb8('0x33')](_['pick'](_0x3a8b53[_0x1cb8('0x32')],_0x2a79e0[_0x1cb8('0x33')]),_0x3a6a67);if(_0x3a8b53['query'][_0x1cb8('0x3c')]){_0x4fda96[_0x1cb8('0x3b')]=_[_0x1cb8('0x3d')](_0x4fda96[_0x1cb8('0x3b')],{'$or':_[_0x1cb8('0x30')](_0x3a6a67,function(_0x5dc4c0){if(_0x5dc4c0[_0x1cb8('0x2d')]!==_0x1cb8('0x3e')){var _0x2989c6={};_0x2989c6[_0x5dc4c0['name']]={'$like':'%'+_0x3a8b53['query']['filter']+'%'};return _0x2989c6;}})});}_0x4fda96=_[_0x1cb8('0x3d')]({},_0x4fda96,_0x3a8b53[_0x1cb8('0x3f')]);var _0x328f7e={'where':_0x4fda96[_0x1cb8('0x3b')]};return db['Cdr']['count'](_0x328f7e)[_0x1cb8('0x24')](function(_0x25f0a3){_0x2ba8c8[_0x1cb8('0x1d')]=_0x25f0a3;if(_0x3a8b53[_0x1cb8('0x32')][_0x1cb8('0x40')]){_0x4fda96[_0x1cb8('0x41')]=[{'all':!![]}];}return db[_0x1cb8('0x2b')][_0x1cb8('0x42')](_0x4fda96);})['then'](function(_0x2044d1){_0x2ba8c8[_0x1cb8('0x43')]=_0x2044d1;return _0x2ba8c8;})[_0x1cb8('0x24')](respondWithFilteredResult(_0x21c17a,_0x4fda96))[_0x1cb8('0x44')](handleError(_0x21c17a,null));};exports['show']=function(_0x156298,_0x47c18a){var _0x2060a6={'raw':!![],'where':{'id':_0x156298['params']['id']}},_0x37230e={};_0x37230e[_0x1cb8('0x2f')]=_[_0x1cb8('0x31')](db[_0x1cb8('0x2b')]['rawAttributes']);_0x37230e['query']=_[_0x1cb8('0x31')](_0x156298['query']);_0x37230e[_0x1cb8('0x33')]=_[_0x1cb8('0x34')](_0x37230e[_0x1cb8('0x2f')],_0x37230e[_0x1cb8('0x32')]);_0x2060a6[_0x1cb8('0x35')]=_[_0x1cb8('0x34')](_0x37230e[_0x1cb8('0x2f')],qs['fields'](_0x156298[_0x1cb8('0x32')][_0x1cb8('0x36')]));_0x2060a6[_0x1cb8('0x35')]=_0x2060a6[_0x1cb8('0x35')]['length']?_0x2060a6[_0x1cb8('0x35')]:_0x37230e[_0x1cb8('0x2f')];if(_0x156298[_0x1cb8('0x32')][_0x1cb8('0x40')]){_0x2060a6[_0x1cb8('0x41')]=[{'all':!![]}];}_0x2060a6=_['merge']({},_0x2060a6,_0x156298[_0x1cb8('0x3f')]);return db[_0x1cb8('0x2b')][_0x1cb8('0x45')](_0x2060a6)[_0x1cb8('0x24')](handleEntityNotFound(_0x47c18a,null))[_0x1cb8('0x24')](respondWithResult(_0x47c18a,null))['catch'](handleError(_0x47c18a,null));};exports[_0x1cb8('0x46')]=function(_0x3a4ec4,_0x5598b1){return db[_0x1cb8('0x2b')][_0x1cb8('0x46')](_0x3a4ec4[_0x1cb8('0x47')],{})[_0x1cb8('0x24')](respondWithResult(_0x5598b1,0xc9))[_0x1cb8('0x44')](handleError(_0x5598b1,null));};exports[_0x1cb8('0x48')]=function(_0x3b063c,_0x219541){if(_0x3b063c[_0x1cb8('0x47')]['id']){delete _0x3b063c[_0x1cb8('0x47')]['id'];}return db[_0x1cb8('0x2b')][_0x1cb8('0x45')]({'where':{'id':_0x3b063c[_0x1cb8('0x49')]['id']}})[_0x1cb8('0x24')](handleEntityNotFound(_0x219541,null))['then'](saveUpdates(_0x3b063c[_0x1cb8('0x47')],null))[_0x1cb8('0x24')](respondWithResult(_0x219541,null))[_0x1cb8('0x44')](handleError(_0x219541,null));};exports[_0x1cb8('0x25')]=function(_0x21aba7,_0x15f0ba){return db[_0x1cb8('0x2b')]['find']({'where':{'id':_0x21aba7[_0x1cb8('0x49')]['id']}})[_0x1cb8('0x24')](handleEntityNotFound(_0x15f0ba,null))[_0x1cb8('0x24')](removeEntity(_0x15f0ba,null))['catch'](handleError(_0x15f0ba,null));};exports['describe']=function(_0x1c12aa,_0x42cc81){return db[_0x1cb8('0x2b')][_0x1cb8('0x4a')]()[_0x1cb8('0x24')](respondWithResult(_0x42cc81,null))['catch'](handleError(_0x42cc81,null));}; \ No newline at end of file diff --git a/server/api/cdr/cdr.model.js b/server/api/cdr/cdr.model.js index 5f2ed42..65d93e6 100644 --- a/server/api/cdr/cdr.model.js +++ b/server/api/cdr/cdr.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x9957=['dst','src','uniqueid','lodash','util','../../config/logger','api','bluebird','request-promise','path','rimraf','./cdr.attributes','exports','define','Cdr','accountcode','calldate','disposition'];(function(_0x35355c,_0x5b3c4a){var _0x2a4b23=function(_0x1fe2b9){while(--_0x1fe2b9){_0x35355c['push'](_0x35355c['shift']());}};_0x2a4b23(++_0x5b3c4a);}(_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 logger=require(_0x7995('0x2'))(_0x7995('0x3'));var moment=require('moment');var BPromise=require(_0x7995('0x4'));var rp=require(_0x7995('0x5'));var fs=require('fs');var path=require(_0x7995('0x6'));var rimraf=require(_0x7995('0x7'));var config=require('../../config/environment');var attributes=require(_0x7995('0x8'));module[_0x7995('0x9')]=function(_0x137b6b,_0x219534){return _0x137b6b[_0x7995('0xa')](_0x7995('0xb'),attributes,{'tableName':'cdr','paranoid':![],'indexes':[{'name':_0x7995('0xc'),'fields':[_0x7995('0xc')]},{'name':'calldate','fields':[_0x7995('0xd')]},{'name':_0x7995('0xe'),'fields':[_0x7995('0xe')]},{'name':_0x7995('0xf'),'fields':[_0x7995('0xf')]},{'name':_0x7995('0x10'),'fields':[_0x7995('0x10')]},{'name':'uniqueid','fields':[_0x7995('0x11')]}],'timestamps':![]});}; \ No newline at end of file +var _0x7a54=['Cdr','cdr','accountcode','disposition','dst','src','uniqueid','lodash','util','../../config/logger','moment','bluebird','path','rimraf','../../config/environment','./cdr.attributes','exports'];(function(_0x1eaded,_0x4faf87){var _0x415399=function(_0xa28503){while(--_0xa28503){_0x1eaded['push'](_0x1eaded['shift']());}};_0x415399(++_0x4faf87);}(_0x7a54,0x106));var _0x47a5=function(_0x3e7f2d,_0x1e8956){_0x3e7f2d=_0x3e7f2d-0x0;var _0x3077f2=_0x7a54[_0x3e7f2d];return _0x3077f2;};'use strict';var _=require(_0x47a5('0x0'));var util=require(_0x47a5('0x1'));var logger=require(_0x47a5('0x2'))('api');var moment=require(_0x47a5('0x3'));var BPromise=require(_0x47a5('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x47a5('0x5'));var rimraf=require(_0x47a5('0x6'));var config=require(_0x47a5('0x7'));var attributes=require(_0x47a5('0x8'));module[_0x47a5('0x9')]=function(_0x545a97,_0x3d5629){return _0x545a97['define'](_0x47a5('0xa'),attributes,{'tableName':_0x47a5('0xb'),'paranoid':![],'indexes':[{'name':'accountcode','fields':[_0x47a5('0xc')]},{'name':'calldate','fields':['calldate']},{'name':'disposition','fields':[_0x47a5('0xd')]},{'name':_0x47a5('0xe'),'fields':['dst']},{'name':_0x47a5('0xf'),'fields':['src']},{'name':'uniqueid','fields':[_0x47a5('0x10')]}],'timestamps':![]});}; \ No newline at end of file diff --git a/server/api/cdr/cdr.rpc.js b/server/api/cdr/cdr.rpc.js index ff57d51..b5f1498 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 _0xafb8=['client','http','request','info','Cdr,\x20%s,\x20%s','request\x20sent','debug','error','message','catch','lodash','moment','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise'];(function(_0x1e175d,_0x41ff45){var _0x3a3ce5=function(_0x186001){while(--_0x186001){_0x1e175d['push'](_0x1e175d['shift']());}};_0x3a3ce5(++_0x41ff45);}(_0xafb8,0x14d));var _0x8afb=function(_0x49988a,_0x5d4fef){_0x49988a=_0x49988a-0x0;var _0x399902=_0xafb8[_0x49988a];return _0x399902;};'use strict';var _=require(_0x8afb('0x0'));var util=require('util');var moment=require(_0x8afb('0x1'));var BPromise=require('bluebird');var rs=require(_0x8afb('0x2'));var fs=require('fs');var Redis=require(_0x8afb('0x3'));var db=require(_0x8afb('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0x8afb('0x5'))(_0x8afb('0x6'));var config=require(_0x8afb('0x7'));var jayson=require(_0x8afb('0x8'));var client=jayson[_0x8afb('0x9')][_0x8afb('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x549d46,_0x6a0b51,_0x5c27bc){return new BPromise(function(_0x28f063,_0x1c7091){return client[_0x8afb('0xb')](_0x549d46,_0x5c27bc)['then'](function(_0x4e7030){logger[_0x8afb('0xc')](_0x8afb('0xd'),_0x6a0b51,_0x8afb('0xe'));logger[_0x8afb('0xf')]('Cdr,\x20%s,\x20%s,\x20%s',_0x6a0b51,_0x8afb('0xe'),JSON['stringify'](_0x4e7030));if(_0x4e7030['error']){if(_0x4e7030[_0x8afb('0x10')]['code']===0x1f4){logger['error'](_0x8afb('0xd'),_0x6a0b51,_0x4e7030[_0x8afb('0x10')]['message']);return _0x1c7091(_0x4e7030[_0x8afb('0x10')]['message']);}logger['error'](_0x8afb('0xd'),_0x6a0b51,_0x4e7030[_0x8afb('0x10')]['message']);return _0x28f063(_0x4e7030[_0x8afb('0x10')][_0x8afb('0x11')]);}else{logger[_0x8afb('0xc')]('Cdr,\x20%s,\x20%s',_0x6a0b51,'request\x20sent');_0x28f063(_0x4e7030['result'][_0x8afb('0x11')]);}})[_0x8afb('0x12')](function(_0xd8d3b1){logger[_0x8afb('0x10')]('Cdr,\x20%s,\x20%s',_0x6a0b51,_0xd8d3b1);_0x1c7091(_0xd8d3b1);});});} \ No newline at end of file +var _0x8035=['jayson/promise','client','request','then','info','request\x20sent','debug','Cdr,\x20%s,\x20%s,\x20%s','stringify','error','code','Cdr,\x20%s,\x20%s','message','result','catch','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment'];(function(_0xcff500,_0x5a4796){var _0x5df3d0=function(_0x372fb3){while(--_0x372fb3){_0xcff500['push'](_0xcff500['shift']());}};_0x5df3d0(++_0x5a4796);}(_0x8035,0x1a7));var _0x5803=function(_0x515283,_0x813dea){_0x515283=_0x515283-0x0;var _0x38f836=_0x8035[_0x515283];return _0x38f836;};'use strict';var _=require(_0x5803('0x0'));var util=require('util');var moment=require(_0x5803('0x1'));var BPromise=require(_0x5803('0x2'));var rs=require(_0x5803('0x3'));var fs=require('fs');var Redis=require(_0x5803('0x4'));var db=require(_0x5803('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0x5803('0x6'))(_0x5803('0x7'));var config=require(_0x5803('0x8'));var jayson=require(_0x5803('0x9'));var client=jayson[_0x5803('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x53b2c6,_0x1534ba,_0x35d286){return new BPromise(function(_0x2121d8,_0x53caa9){return client[_0x5803('0xb')](_0x53b2c6,_0x35d286)[_0x5803('0xc')](function(_0x4636e4){logger[_0x5803('0xd')]('Cdr,\x20%s,\x20%s',_0x1534ba,_0x5803('0xe'));logger[_0x5803('0xf')](_0x5803('0x10'),_0x1534ba,_0x5803('0xe'),JSON[_0x5803('0x11')](_0x4636e4));if(_0x4636e4['error']){if(_0x4636e4[_0x5803('0x12')][_0x5803('0x13')]===0x1f4){logger[_0x5803('0x12')](_0x5803('0x14'),_0x1534ba,_0x4636e4[_0x5803('0x12')]['message']);return _0x53caa9(_0x4636e4[_0x5803('0x12')][_0x5803('0x15')]);}logger[_0x5803('0x12')](_0x5803('0x14'),_0x1534ba,_0x4636e4[_0x5803('0x12')]['message']);return _0x2121d8(_0x4636e4['error'][_0x5803('0x15')]);}else{logger[_0x5803('0xd')](_0x5803('0x14'),_0x1534ba,_0x5803('0xe'));_0x2121d8(_0x4636e4[_0x5803('0x16')][_0x5803('0x15')]);}})[_0x5803('0x17')](function(_0x455007){logger[_0x5803('0x12')](_0x5803('0x14'),_0x1534ba,_0x455007);_0x53caa9(_0x455007);});});} \ No newline at end of file diff --git a/server/api/cdr/index.js b/server/api/cdr/index.js index 60c645b..1660184 100644 --- a/server/api/cdr/index.js +++ b/server/api/cdr/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xd8b0=['destroy','exports','multer','util','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','isAuthenticated','index','get','describe','/:id','show','post','create','put','update'];(function(_0x4e8022,_0x53229d){var _0xf5e73f=function(_0x3a1309){while(--_0x3a1309){_0x4e8022['push'](_0x4e8022['shift']());}};_0xf5e73f(++_0x53229d);}(_0xd8b0,0xad));var _0x0d8b=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0xd8b0[_0x20a584];return _0x4b41a8;};'use strict';var multer=require(_0x0d8b('0x0'));var util=require(_0x0d8b('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require('express');var router=express[_0x0d8b('0x2')]();var fs_extra=require(_0x0d8b('0x3'));var auth=require(_0x0d8b('0x4'));var interaction=require(_0x0d8b('0x5'));var config=require(_0x0d8b('0x6'));var controller=require('./cdr.controller');router['get']('/',auth[_0x0d8b('0x7')](),controller[_0x0d8b('0x8')]);router[_0x0d8b('0x9')]('/describe',auth[_0x0d8b('0x7')](),controller[_0x0d8b('0xa')]);router['get'](_0x0d8b('0xb'),auth[_0x0d8b('0x7')](),controller[_0x0d8b('0xc')]);router[_0x0d8b('0xd')]('/',auth[_0x0d8b('0x7')](),controller[_0x0d8b('0xe')]);router[_0x0d8b('0xf')](_0x0d8b('0xb'),auth['isAuthenticated'](),controller[_0x0d8b('0x10')]);router['delete'](_0x0d8b('0xb'),auth[_0x0d8b('0x7')](),controller[_0x0d8b('0x11')]);module[_0x0d8b('0x12')]=router; \ No newline at end of file +var _0xa9e0=['isAuthenticated','create','put','/:id','destroy','exports','multer','util','path','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./cdr.controller','get','index','/describe','show','post'];(function(_0x17406a,_0x1e2320){var _0x1501ff=function(_0x4b075a){while(--_0x4b075a){_0x17406a['push'](_0x17406a['shift']());}};_0x1501ff(++_0x1e2320);}(_0xa9e0,0x123));var _0x0a9e=function(_0x40ac5e,_0x2de228){_0x40ac5e=_0x40ac5e-0x0;var _0x2839d6=_0xa9e0[_0x40ac5e];return _0x2839d6;};'use strict';var multer=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var path=require(_0x0a9e('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x0a9e('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x0a9e('0x4'));var interaction=require(_0x0a9e('0x5'));var config=require(_0x0a9e('0x6'));var controller=require(_0x0a9e('0x7'));router[_0x0a9e('0x8')]('/',auth['isAuthenticated'](),controller[_0x0a9e('0x9')]);router[_0x0a9e('0x8')](_0x0a9e('0xa'),auth['isAuthenticated'](),controller['describe']);router[_0x0a9e('0x8')]('/:id',auth['isAuthenticated'](),controller[_0x0a9e('0xb')]);router[_0x0a9e('0xc')]('/',auth[_0x0a9e('0xd')](),controller[_0x0a9e('0xe')]);router[_0x0a9e('0xf')](_0x0a9e('0x10'),auth['isAuthenticated'](),controller['update']);router['delete']('/:id',auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x11')]);module[_0x0a9e('0x12')]=router; \ No newline at end of file diff --git a/server/api/chatApplication/chatApplication.attributes.js b/server/api/chatApplication/chatApplication.attributes.js index f5b987e..260893e 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 _0xd9fa=['exports','INTEGER','noop','TEXT','STRING','*,*,*,*','sequelize'];(function(_0x403dbf,_0x2dde4e){var _0x1a68af=function(_0x3addbd){while(--_0x3addbd){_0x403dbf['push'](_0x403dbf['shift']());}};_0x1a68af(++_0x2dde4e);}(_0xd9fa,0xa0));var _0xad9f=function(_0x4ff786,_0x5190fc){_0x4ff786=_0x4ff786-0x0;var _0x55d81a=_0xd9fa[_0x4ff786];return _0x55d81a;};'use strict';var Sequelize=require(_0xad9f('0x0'));module[_0xad9f('0x1')]={'priority':{'type':Sequelize[_0xad9f('0x2')],'allowNull':![]},'app':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':_0xad9f('0x3')},'appdata':{'type':Sequelize[_0xad9f('0x4')]()},'description':{'type':Sequelize[_0xad9f('0x5')]},'interval':{'type':Sequelize[_0xad9f('0x5')],'defaultValue':_0xad9f('0x6')}}; \ No newline at end of file +var _0x69f7=['TEXT','sequelize','INTEGER','STRING'];(function(_0x12d6c2,_0x409bc8){var _0x1c9825=function(_0x569f66){while(--_0x569f66){_0x12d6c2['push'](_0x12d6c2['shift']());}};_0x1c9825(++_0x409bc8);}(_0x69f7,0x81));var _0x769f=function(_0x30021d,_0x1d92e6){_0x30021d=_0x30021d-0x0;var _0x47fa07=_0x69f7[_0x30021d];return _0x47fa07;};'use strict';var Sequelize=require(_0x769f('0x0'));module['exports']={'priority':{'type':Sequelize[_0x769f('0x1')],'allowNull':![]},'app':{'type':Sequelize[_0x769f('0x2')],'allowNull':![],'defaultValue':'noop'},'appdata':{'type':Sequelize[_0x769f('0x3')]()},'description':{'type':Sequelize['STRING']},'interval':{'type':Sequelize['STRING'],'defaultValue':'*,*,*,*'}}; \ No newline at end of file diff --git a/server/api/chatApplication/chatApplication.controller.js b/server/api/chatApplication/chatApplication.controller.js index ad13ef3..8351c01 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 _0xefe2=['count','limit','status','set','Content-Range','apply','reject','save','update','destroy','then','end','error','stack','name','send','show','params','model','keys','ChatApplication','rawAttributes','query','filters','intersection','attributes','fields','length','includeAll','include','options','catch','body','find','eml-format','rimraf','fast-json-patch','request-promise','bluebird','util','path','sox','to-csv','ejs','lodash','squel','crypto','jsforce','querystring','papaparse','../../components/parsers/qs','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','json','offset','undefined'];(function(_0x565c49,_0x54acd0){var _0x20ca34=function(_0x42f7e1){while(--_0x42f7e1){_0x565c49['push'](_0x565c49['shift']());}};_0x20ca34(++_0x54acd0);}(_0xefe2,0xd9));var _0x2efe=function(_0x15a25a,_0x19c429){_0x15a25a=_0x15a25a-0x0;var _0x1d25f8=_0xefe2[_0x15a25a];return _0x1d25f8;};'use strict';var emlformat=require(_0x2efe('0x0'));var rimraf=require(_0x2efe('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x2efe('0x2'));var rp=require(_0x2efe('0x3'));var moment=require('moment');var BPromise=require(_0x2efe('0x4'));var Mustache=require('mustache');var util=require(_0x2efe('0x5'));var path=require(_0x2efe('0x6'));var sox=require(_0x2efe('0x7'));var csv=require(_0x2efe('0x8'));var ejs=require(_0x2efe('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x2efe('0xa'));var squel=require(_0x2efe('0xb'));var crypto=require(_0x2efe('0xc'));var jsforce=require(_0x2efe('0xd'));var deskjs=require('desk.js');var toCsv=require(_0x2efe('0x8'));var querystring=require(_0x2efe('0xe'));var Papa=require(_0x2efe('0xf'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0x2efe('0x10'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0x2efe('0x11'))(_0x2efe('0x12'));var utils=require(_0x2efe('0x13'));var config=require(_0x2efe('0x14'));var licenseUtil=require(_0x2efe('0x15'));var db=require(_0x2efe('0x16'))['db'];function respondWithStatusCode(_0x39a93b,_0x250023){_0x250023=_0x250023||0xcc;return function(_0x41039a){if(_0x41039a){return _0x39a93b[_0x2efe('0x17')](_0x250023);}return _0x39a93b['status'](_0x250023)['end']();};}function respondWithResult(_0x28681f,_0x1d9e5c){_0x1d9e5c=_0x1d9e5c||0xc8;return function(_0x562753){if(_0x562753){return _0x28681f['status'](_0x1d9e5c)[_0x2efe('0x18')](_0x562753);}};}function respondWithFilteredResult(_0x5195c8,_0x235af3){return function(_0x3b8b31){if(_0x3b8b31){var _0x51cbf3=typeof _0x235af3[_0x2efe('0x19')]===_0x2efe('0x1a')&&typeof _0x235af3['limit']===_0x2efe('0x1a');var _0x499c70=_0x3b8b31['count'];var _0xefd47=_0x51cbf3?0x0:_0x235af3[_0x2efe('0x19')];var _0x16acde=_0x51cbf3?_0x3b8b31[_0x2efe('0x1b')]:_0x235af3[_0x2efe('0x19')]+_0x235af3[_0x2efe('0x1c')];var _0x3017a7;if(_0x16acde>=_0x499c70){_0x16acde=_0x499c70;_0x3017a7=0xc8;}else{_0x3017a7=0xce;}_0x5195c8[_0x2efe('0x1d')](_0x3017a7);return _0x5195c8[_0x2efe('0x1e')](_0x2efe('0x1f'),_0xefd47+'-'+_0x16acde+'/'+_0x499c70)[_0x2efe('0x18')](_0x3b8b31);}return null;};}function patchUpdates(_0x6962df){return function(_0x491958){try{jsonpatch[_0x2efe('0x20')](_0x491958,_0x6962df,!![]);}catch(_0x538f39){return BPromise[_0x2efe('0x21')](_0x538f39);}return _0x491958[_0x2efe('0x22')]();};}function saveUpdates(_0x30ed16,_0x4ebeb6){return function(_0x131169){if(_0x131169){return _0x131169[_0x2efe('0x23')](_0x30ed16)['then'](function(_0x1c4a8d){return _0x1c4a8d;});}return null;};}function removeEntity(_0x368d08,_0xc24859){return function(_0x319b7f){if(_0x319b7f){return _0x319b7f[_0x2efe('0x24')]()[_0x2efe('0x25')](function(){_0x368d08[_0x2efe('0x1d')](0xcc)[_0x2efe('0x26')]();});}};}function handleEntityNotFound(_0x3d4449,_0x301cf2){return function(_0x1beaad){if(!_0x1beaad){_0x3d4449[_0x2efe('0x17')](0x194);}return _0x1beaad;};}function handleError(_0x3059c7,_0x255330){_0x255330=_0x255330||0x1f4;return function(_0x4c5118){logger[_0x2efe('0x27')](_0x4c5118[_0x2efe('0x28')]);if(_0x4c5118[_0x2efe('0x29')]){delete _0x4c5118[_0x2efe('0x29')];}_0x3059c7[_0x2efe('0x1d')](_0x255330)[_0x2efe('0x2a')](_0x4c5118);};}exports[_0x2efe('0x2b')]=function(_0xa11a23,_0x4039cb){var _0x33124f={'raw':!![],'where':{'id':_0xa11a23[_0x2efe('0x2c')]['id']}},_0x56b011={};_0x56b011[_0x2efe('0x2d')]=_[_0x2efe('0x2e')](db[_0x2efe('0x2f')][_0x2efe('0x30')]);_0x56b011['query']=_[_0x2efe('0x2e')](_0xa11a23[_0x2efe('0x31')]);_0x56b011[_0x2efe('0x32')]=_[_0x2efe('0x33')](_0x56b011[_0x2efe('0x2d')],_0x56b011[_0x2efe('0x31')]);_0x33124f[_0x2efe('0x34')]=_[_0x2efe('0x33')](_0x56b011[_0x2efe('0x2d')],qs[_0x2efe('0x35')](_0xa11a23['query'][_0x2efe('0x35')]));_0x33124f[_0x2efe('0x34')]=_0x33124f[_0x2efe('0x34')][_0x2efe('0x36')]?_0x33124f[_0x2efe('0x34')]:_0x56b011[_0x2efe('0x2d')];if(_0xa11a23[_0x2efe('0x31')][_0x2efe('0x37')]){_0x33124f[_0x2efe('0x38')]=[{'all':!![]}];}_0x33124f=_['merge']({},_0x33124f,_0xa11a23[_0x2efe('0x39')]);return db[_0x2efe('0x2f')]['find'](_0x33124f)['then'](handleEntityNotFound(_0x4039cb,null))['then'](respondWithResult(_0x4039cb,null))[_0x2efe('0x3a')](handleError(_0x4039cb,null));};exports[_0x2efe('0x23')]=function(_0x38e44f,_0x5a8ba4){if(_0x38e44f[_0x2efe('0x3b')]['id']){delete _0x38e44f[_0x2efe('0x3b')]['id'];}return db[_0x2efe('0x2f')]['find']({'where':{'id':_0x38e44f['params']['id']}})[_0x2efe('0x25')](handleEntityNotFound(_0x5a8ba4,null))['then'](saveUpdates(_0x38e44f[_0x2efe('0x3b')],null))[_0x2efe('0x25')](respondWithResult(_0x5a8ba4,null))[_0x2efe('0x3a')](handleError(_0x5a8ba4,null));};exports['destroy']=function(_0xd3ce22,_0x2ec0cd){return db[_0x2efe('0x2f')][_0x2efe('0x3c')]({'where':{'id':_0xd3ce22[_0x2efe('0x2c')]['id']}})[_0x2efe('0x25')](handleEntityNotFound(_0x2ec0cd,null))[_0x2efe('0x25')](removeEntity(_0x2ec0cd,null))['catch'](handleError(_0x2ec0cd,null));}; \ No newline at end of file +var _0x2697=['fast-json-patch','request-promise','moment','mustache','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','papaparse','ioredis','../../components/parsers/qs','../../config/license/hardware','api','../../config/environment','../../config/license/util','../../mysqldb','status','end','json','offset','limit','undefined','count','set','Content-Range','apply','reject','update','then','destroy','sendStatus','error','stack','name','send','params','model','keys','rawAttributes','query','intersection','fields','attributes','includeAll','merge','options','ChatApplication','find','catch','body','rimraf','zip-dir'];(function(_0x501510,_0x61caa9){var _0x1e6ee5=function(_0x32845b){while(--_0x32845b){_0x501510['push'](_0x501510['shift']());}};_0x1e6ee5(++_0x61caa9);}(_0x2697,0x120));var _0x7269=function(_0x954b3a,_0x10a7c1){_0x954b3a=_0x954b3a-0x0;var _0x3a313e=_0x2697[_0x954b3a];return _0x3a313e;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x7269('0x0'));var zipdir=require(_0x7269('0x1'));var jsonpatch=require(_0x7269('0x2'));var rp=require(_0x7269('0x3'));var moment=require(_0x7269('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x7269('0x5'));var util=require('util');var path=require(_0x7269('0x6'));var sox=require(_0x7269('0x7'));var csv=require(_0x7269('0x8'));var ejs=require(_0x7269('0x9'));var fs=require('fs');var fs_extra=require(_0x7269('0xa'));var _=require(_0x7269('0xb'));var squel=require(_0x7269('0xc'));var crypto=require(_0x7269('0xd'));var jsforce=require(_0x7269('0xe'));var deskjs=require(_0x7269('0xf'));var toCsv=require(_0x7269('0x8'));var querystring=require('querystring');var Papa=require(_0x7269('0x10'));var Redis=require(_0x7269('0x11'));var authService=require('../../components/auth/service');var qs=require(_0x7269('0x12'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x7269('0x13'));var logger=require('../../config/logger')(_0x7269('0x14'));var utils=require('../../config/utils');var config=require(_0x7269('0x15'));var licenseUtil=require(_0x7269('0x16'));var db=require(_0x7269('0x17'))['db'];function respondWithStatusCode(_0x4c115b,_0x29a0ca){_0x29a0ca=_0x29a0ca||0xcc;return function(_0x2c5957){if(_0x2c5957){return _0x4c115b['sendStatus'](_0x29a0ca);}return _0x4c115b[_0x7269('0x18')](_0x29a0ca)[_0x7269('0x19')]();};}function respondWithResult(_0x43c239,_0x4a0355){_0x4a0355=_0x4a0355||0xc8;return function(_0x2ba8ec){if(_0x2ba8ec){return _0x43c239[_0x7269('0x18')](_0x4a0355)[_0x7269('0x1a')](_0x2ba8ec);}};}function respondWithFilteredResult(_0x2c28f8,_0x26547f){return function(_0x44e266){if(_0x44e266){var _0x880b51=typeof _0x26547f[_0x7269('0x1b')]==='undefined'&&typeof _0x26547f[_0x7269('0x1c')]===_0x7269('0x1d');var _0x188eae=_0x44e266[_0x7269('0x1e')];var _0x5812c4=_0x880b51?0x0:_0x26547f['offset'];var _0x4db022=_0x880b51?_0x44e266[_0x7269('0x1e')]:_0x26547f[_0x7269('0x1b')]+_0x26547f[_0x7269('0x1c')];var _0x466750;if(_0x4db022>=_0x188eae){_0x4db022=_0x188eae;_0x466750=0xc8;}else{_0x466750=0xce;}_0x2c28f8[_0x7269('0x18')](_0x466750);return _0x2c28f8[_0x7269('0x1f')](_0x7269('0x20'),_0x5812c4+'-'+_0x4db022+'/'+_0x188eae)['json'](_0x44e266);}return null;};}function patchUpdates(_0x4f0d05){return function(_0x534f81){try{jsonpatch[_0x7269('0x21')](_0x534f81,_0x4f0d05,!![]);}catch(_0x5cca84){return BPromise[_0x7269('0x22')](_0x5cca84);}return _0x534f81['save']();};}function saveUpdates(_0x2a5a5c,_0x8ce025){return function(_0x55e40d){if(_0x55e40d){return _0x55e40d[_0x7269('0x23')](_0x2a5a5c)[_0x7269('0x24')](function(_0x51dbd1){return _0x51dbd1;});}return null;};}function removeEntity(_0x509e9,_0x293af6){return function(_0xbb82d0){if(_0xbb82d0){return _0xbb82d0[_0x7269('0x25')]()['then'](function(){_0x509e9[_0x7269('0x18')](0xcc)[_0x7269('0x19')]();});}};}function handleEntityNotFound(_0x3e0221,_0x2e6c02){return function(_0x3392ec){if(!_0x3392ec){_0x3e0221[_0x7269('0x26')](0x194);}return _0x3392ec;};}function handleError(_0x4c6810,_0x198b59){_0x198b59=_0x198b59||0x1f4;return function(_0x3afb72){logger[_0x7269('0x27')](_0x3afb72[_0x7269('0x28')]);if(_0x3afb72[_0x7269('0x29')]){delete _0x3afb72['name'];}_0x4c6810[_0x7269('0x18')](_0x198b59)[_0x7269('0x2a')](_0x3afb72);};}exports['show']=function(_0x1ad87c,_0x492e73){var _0x124c07={'raw':!![],'where':{'id':_0x1ad87c[_0x7269('0x2b')]['id']}},_0x3988c8={};_0x3988c8[_0x7269('0x2c')]=_[_0x7269('0x2d')](db['ChatApplication'][_0x7269('0x2e')]);_0x3988c8[_0x7269('0x2f')]=_[_0x7269('0x2d')](_0x1ad87c[_0x7269('0x2f')]);_0x3988c8['filters']=_[_0x7269('0x30')](_0x3988c8[_0x7269('0x2c')],_0x3988c8['query']);_0x124c07['attributes']=_[_0x7269('0x30')](_0x3988c8[_0x7269('0x2c')],qs[_0x7269('0x31')](_0x1ad87c[_0x7269('0x2f')][_0x7269('0x31')]));_0x124c07[_0x7269('0x32')]=_0x124c07['attributes']['length']?_0x124c07[_0x7269('0x32')]:_0x3988c8[_0x7269('0x2c')];if(_0x1ad87c['query'][_0x7269('0x33')]){_0x124c07['include']=[{'all':!![]}];}_0x124c07=_[_0x7269('0x34')]({},_0x124c07,_0x1ad87c[_0x7269('0x35')]);return db[_0x7269('0x36')][_0x7269('0x37')](_0x124c07)[_0x7269('0x24')](handleEntityNotFound(_0x492e73,null))[_0x7269('0x24')](respondWithResult(_0x492e73,null))[_0x7269('0x38')](handleError(_0x492e73,null));};exports['update']=function(_0x1eef52,_0xb433a0){if(_0x1eef52['body']['id']){delete _0x1eef52[_0x7269('0x39')]['id'];}return db[_0x7269('0x36')][_0x7269('0x37')]({'where':{'id':_0x1eef52['params']['id']}})[_0x7269('0x24')](handleEntityNotFound(_0xb433a0,null))[_0x7269('0x24')](saveUpdates(_0x1eef52[_0x7269('0x39')],null))[_0x7269('0x24')](respondWithResult(_0xb433a0,null))['catch'](handleError(_0xb433a0,null));};exports[_0x7269('0x25')]=function(_0xe5d1b9,_0x757c1c){return db[_0x7269('0x36')][_0x7269('0x37')]({'where':{'id':_0xe5d1b9['params']['id']}})[_0x7269('0x24')](handleEntityNotFound(_0x757c1c,null))[_0x7269('0x24')](removeEntity(_0x757c1c,null))[_0x7269('0x38')](handleError(_0x757c1c,null));}; \ No newline at end of file diff --git a/server/api/chatApplication/chatApplication.model.js b/server/api/chatApplication/chatApplication.model.js index 97d5aab..d311bc0 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 _0x1749=['moment','bluebird','../../config/environment','./chatApplication.attributes','exports','ChatApplication','chat_applications','utf8mb4','lodash','util','api'];(function(_0x5d9da9,_0x45d649){var _0x4af7b0=function(_0xd0b0bd){while(--_0xd0b0bd){_0x5d9da9['push'](_0x5d9da9['shift']());}};_0x4af7b0(++_0x45d649);}(_0x1749,0xfa));var _0x9174=function(_0x56e5a0,_0x3e3041){_0x56e5a0=_0x56e5a0-0x0;var _0x57239d=_0x1749[_0x56e5a0];return _0x57239d;};'use strict';var _=require(_0x9174('0x0'));var util=require(_0x9174('0x1'));var logger=require('../../config/logger')(_0x9174('0x2'));var moment=require(_0x9174('0x3'));var BPromise=require(_0x9174('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0x9174('0x5'));var attributes=require(_0x9174('0x6'));module[_0x9174('0x7')]=function(_0x17b580,_0x56d115){return _0x17b580['define'](_0x9174('0x8'),attributes,{'tableName':_0x9174('0x9'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x9174('0xa'),'collate':'utf8mb4_unicode_ci'});}; \ No newline at end of file +var _0x7722=['moment','bluebird','request-promise','path','rimraf','../../config/environment','./chatApplication.attributes','exports','ChatApplication','chat_applications','utf8mb4_unicode_ci','lodash','util','../../config/logger'];(function(_0x1d8daa,_0x396046){var _0x31d230=function(_0x4f0970){while(--_0x4f0970){_0x1d8daa['push'](_0x1d8daa['shift']());}};_0x31d230(++_0x396046);}(_0x7722,0xdd));var _0x2772=function(_0x5ccea9,_0x4ae2b9){_0x5ccea9=_0x5ccea9-0x0;var _0x39bf51=_0x7722[_0x5ccea9];return _0x39bf51;};'use strict';var _=require(_0x2772('0x0'));var util=require(_0x2772('0x1'));var logger=require(_0x2772('0x2'))('api');var moment=require(_0x2772('0x3'));var BPromise=require(_0x2772('0x4'));var rp=require(_0x2772('0x5'));var fs=require('fs');var path=require(_0x2772('0x6'));var rimraf=require(_0x2772('0x7'));var config=require(_0x2772('0x8'));var attributes=require(_0x2772('0x9'));module[_0x2772('0xa')]=function(_0x4012c8,_0x375b5a){return _0x4012c8['define'](_0x2772('0xb'),attributes,{'tableName':_0x2772('0xc'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':'utf8mb4','collate':_0x2772('0xd')});}; \ No newline at end of file diff --git a/server/api/chatApplication/chatApplication.rpc.js b/server/api/chatApplication/chatApplication.rpc.js index 050da00..75e25be 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 _0x6527=['util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','request','then','info','ChatApplication,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','catch','lodash'];(function(_0x17dcd1,_0x3b7ccb){var _0x12af77=function(_0x5c3bac){while(--_0x5c3bac){_0x17dcd1['push'](_0x17dcd1['shift']());}};_0x12af77(++_0x3b7ccb);}(_0x6527,0x113));var _0x7652=function(_0x3792f2,_0x43b3d2){_0x3792f2=_0x3792f2-0x0;var _0x50c888=_0x6527[_0x3792f2];return _0x50c888;};'use strict';var _=require(_0x7652('0x0'));var util=require(_0x7652('0x1'));var moment=require(_0x7652('0x2'));var BPromise=require('bluebird');var rs=require(_0x7652('0x3'));var fs=require('fs');var Redis=require(_0x7652('0x4'));var db=require(_0x7652('0x5'))['db'];var utils=require(_0x7652('0x6'));var logger=require(_0x7652('0x7'))(_0x7652('0x8'));var config=require(_0x7652('0x9'));var jayson=require('jayson/promise');var client=jayson[_0x7652('0xa')][_0x7652('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x2a1466,_0x45f3b3,_0x379c8b){return new BPromise(function(_0x2d4b2a,_0x5ba24c){return client[_0x7652('0xc')](_0x2a1466,_0x379c8b)[_0x7652('0xd')](function(_0x3a4aa6){logger[_0x7652('0xe')](_0x7652('0xf'),_0x45f3b3,_0x7652('0x10'));logger[_0x7652('0x11')]('ChatApplication,\x20%s,\x20%s,\x20%s',_0x45f3b3,'request\x20sent',JSON[_0x7652('0x12')](_0x3a4aa6));if(_0x3a4aa6[_0x7652('0x13')]){if(_0x3a4aa6[_0x7652('0x13')][_0x7652('0x14')]===0x1f4){logger[_0x7652('0x13')](_0x7652('0xf'),_0x45f3b3,_0x3a4aa6[_0x7652('0x13')][_0x7652('0x15')]);return _0x5ba24c(_0x3a4aa6[_0x7652('0x13')]['message']);}logger[_0x7652('0x13')](_0x7652('0xf'),_0x45f3b3,_0x3a4aa6[_0x7652('0x13')][_0x7652('0x15')]);return _0x2d4b2a(_0x3a4aa6[_0x7652('0x13')][_0x7652('0x15')]);}else{logger[_0x7652('0xe')](_0x7652('0xf'),_0x45f3b3,'request\x20sent');_0x2d4b2a(_0x3a4aa6['result']['message']);}})[_0x7652('0x16')](function(_0x10e495){logger[_0x7652('0x13')](_0x7652('0xf'),_0x45f3b3,_0x10e495);_0x5ba24c(_0x10e495);});});} \ No newline at end of file +var _0xde3f=['bluebird','../../mysqldb','rpc','../../config/environment','jayson/promise','request','then','info','ChatApplication,\x20%s,\x20%s','request\x20sent','debug','ChatApplication,\x20%s,\x20%s,\x20%s','stringify','error','code','message','lodash','moment'];(function(_0x705fb2,_0x2710e2){var _0x408061=function(_0x23523f){while(--_0x23523f){_0x705fb2['push'](_0x705fb2['shift']());}};_0x408061(++_0x2710e2);}(_0xde3f,0xe8));var _0xfde3=function(_0x618414,_0x1a7a60){_0x618414=_0x618414-0x0;var _0x21c19a=_0xde3f[_0x618414];return _0x21c19a;};'use strict';var _=require(_0xfde3('0x0'));var util=require('util');var moment=require(_0xfde3('0x1'));var BPromise=require(_0xfde3('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0xfde3('0x3'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0xfde3('0x4'));var config=require(_0xfde3('0x5'));var jayson=require(_0xfde3('0x6'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0xc9f057,_0x525341,_0x4fdf2f){return new BPromise(function(_0x31f5ef,_0x598b44){return client[_0xfde3('0x7')](_0xc9f057,_0x4fdf2f)[_0xfde3('0x8')](function(_0x55615e){logger[_0xfde3('0x9')](_0xfde3('0xa'),_0x525341,_0xfde3('0xb'));logger[_0xfde3('0xc')](_0xfde3('0xd'),_0x525341,_0xfde3('0xb'),JSON[_0xfde3('0xe')](_0x55615e));if(_0x55615e[_0xfde3('0xf')]){if(_0x55615e[_0xfde3('0xf')][_0xfde3('0x10')]===0x1f4){logger[_0xfde3('0xf')](_0xfde3('0xa'),_0x525341,_0x55615e[_0xfde3('0xf')][_0xfde3('0x11')]);return _0x598b44(_0x55615e[_0xfde3('0xf')]['message']);}logger[_0xfde3('0xf')]('ChatApplication,\x20%s,\x20%s',_0x525341,_0x55615e[_0xfde3('0xf')]['message']);return _0x31f5ef(_0x55615e[_0xfde3('0xf')]['message']);}else{logger[_0xfde3('0x9')](_0xfde3('0xa'),_0x525341,_0xfde3('0xb'));_0x31f5ef(_0x55615e['result'][_0xfde3('0x11')]);}})['catch'](function(_0x5eee0d){logger[_0xfde3('0xf')](_0xfde3('0xa'),_0x525341,_0x5eee0d);_0x598b44(_0x5eee0d);});});} \ No newline at end of file diff --git a/server/api/chatApplication/index.js b/server/api/chatApplication/index.js index 6eacfcc..260715b 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 _0x93d4=['put','update','delete','destroy','multer','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','/:id','isAuthenticated','show'];(function(_0x2641f9,_0x26715f){var _0x585741=function(_0x2d1462){while(--_0x2d1462){_0x2641f9['push'](_0x2641f9['shift']());}};_0x585741(++_0x26715f);}(_0x93d4,0x17e));var _0x493d=function(_0x240663,_0x3f3566){_0x240663=_0x240663-0x0;var _0x773b8c=_0x93d4[_0x240663];return _0x773b8c;};'use strict';var multer=require(_0x493d('0x0'));var util=require('util');var path=require('path');var timeout=require(_0x493d('0x1'));var express=require(_0x493d('0x2'));var router=express[_0x493d('0x3')]();var fs_extra=require(_0x493d('0x4'));var auth=require(_0x493d('0x5'));var interaction=require(_0x493d('0x6'));var config=require('../../config/environment');var controller=require('./chatApplication.controller');router['get'](_0x493d('0x7'),auth[_0x493d('0x8')](),controller[_0x493d('0x9')]);router[_0x493d('0xa')](_0x493d('0x7'),auth['isAuthenticated'](),controller[_0x493d('0xb')]);router[_0x493d('0xc')]('/:id',auth[_0x493d('0x8')](),controller[_0x493d('0xd')]);module['exports']=router; \ No newline at end of file +var _0x164e=['destroy','exports','multer','path','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','./chatApplication.controller','get','isAuthenticated','show','put','update','delete','/:id'];(function(_0xa4fd97,_0x3a8348){var _0x4173c3=function(_0x4c042b){while(--_0x4c042b){_0xa4fd97['push'](_0xa4fd97['shift']());}};_0x4173c3(++_0x3a8348);}(_0x164e,0x8a));var _0xe164=function(_0x2c61d4,_0x11477e){_0x2c61d4=_0x2c61d4-0x0;var _0x444ef0=_0x164e[_0x2c61d4];return _0x444ef0;};'use strict';var multer=require(_0xe164('0x0'));var util=require('util');var path=require(_0xe164('0x1'));var timeout=require(_0xe164('0x2'));var express=require(_0xe164('0x3'));var router=express['Router']();var fs_extra=require(_0xe164('0x4'));var auth=require(_0xe164('0x5'));var interaction=require(_0xe164('0x6'));var config=require('../../config/environment');var controller=require(_0xe164('0x7'));router[_0xe164('0x8')]('/:id',auth[_0xe164('0x9')](),controller[_0xe164('0xa')]);router[_0xe164('0xb')]('/:id',auth[_0xe164('0x9')](),controller[_0xe164('0xc')]);router[_0xe164('0xd')](_0xe164('0xe'),auth['isAuthenticated'](),controller[_0xe164('0xf')]);module[_0xe164('0x10')]=router; \ No newline at end of file diff --git a/server/api/chatGroup/chatGroup.attributes.js b/server/api/chatGroup/chatGroup.attributes.js index 6aabb1a..87b0d74 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 _0xf8cc=['exports','BOOLEAN','sequelize'];(function(_0x5a7593,_0x22207a){var _0x25b556=function(_0x155a73){while(--_0x155a73){_0x5a7593['push'](_0x5a7593['shift']());}};_0x25b556(++_0x22207a);}(_0xf8cc,0x173));var _0xcf8c=function(_0x388ccc,_0x2a24fd){_0x388ccc=_0x388ccc-0x0;var _0x570c20=_0xf8cc[_0x388ccc];return _0x570c20;};'use strict';var Sequelize=require(_0xcf8c('0x0'));module[_0xcf8c('0x1')]={'name':{'type':Sequelize['STRING'],'allowNull':![]},'description':{'type':Sequelize['STRING']},'write':{'type':Sequelize[_0xcf8c('0x2')],'defaultValue':!![]}}; \ No newline at end of file +var _0xf295=['BOOLEAN','sequelize','exports','STRING'];(function(_0x1397ff,_0x47ff82){var _0x5dab40=function(_0x3690d9){while(--_0x3690d9){_0x1397ff['push'](_0x1397ff['shift']());}};_0x5dab40(++_0x47ff82);}(_0xf295,0x1bd));var _0x5f29=function(_0x3597e2,_0x2ca09c){_0x3597e2=_0x3597e2-0x0;var _0x2e91de=_0xf295[_0x3597e2];return _0x2e91de;};'use strict';var Sequelize=require(_0x5f29('0x0'));module[_0x5f29('0x1')]={'name':{'type':Sequelize[_0x5f29('0x2')],'allowNull':![]},'description':{'type':Sequelize[_0x5f29('0x2')]},'write':{'type':Sequelize[_0x5f29('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 b6ad9c9..691373a 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 _0x764b=['type','VIRTUAL','includeAll','include','catch','show','params','options','create','body','find','destroy','describe','getUnread','ChatInternalMessage','user','toInteger','addMembers','ids','omit','getMembers','User','nolimit','removeMembers','addMessage','getMessages','findOne','$gte','split','format','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','sox','to-csv','ejs','squel','crypto','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/license/util','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./chatGroup.socket','sendStatus','status','json','offset','undefined','count','limit','set','Content-Range','reject','save','update','then','error','name','index','map','ChatGroup','rawAttributes','fieldName','key','query','keys','filters','intersection','attributes','model','fields','length','hasOwnProperty','order','sort','pick','filter','merge','where'];(function(_0x3e2c12,_0x908854){var _0x24a416=function(_0x1773f8){while(--_0x1773f8){_0x3e2c12['push'](_0x3e2c12['shift']());}};_0x24a416(++_0x908854);}(_0x764b,0x7a));var _0xb764=function(_0x122ef9,_0x451d2a){_0x122ef9=_0x122ef9-0x0;var _0x42fba0=_0x764b[_0x122ef9];return _0x42fba0;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xb764('0x0'));var zipdir=require('zip-dir');var jsonpatch=require(_0xb764('0x1'));var rp=require(_0xb764('0x2'));var moment=require(_0xb764('0x3'));var BPromise=require(_0xb764('0x4'));var Mustache=require(_0xb764('0x5'));var util=require('util');var path=require('path');var sox=require(_0xb764('0x6'));var csv=require(_0xb764('0x7'));var ejs=require(_0xb764('0x8'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0xb764('0x9'));var crypto=require(_0xb764('0xa'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0xb764('0xb'));var Papa=require('papaparse');var Redis=require(_0xb764('0xc'));var authService=require(_0xb764('0xd'));var qs=require(_0xb764('0xe'));var as=require(_0xb764('0xf'));var hardwareService=require(_0xb764('0x10'));var logger=require(_0xb764('0x11'))(_0xb764('0x12'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0xb764('0x13'));var db=require(_0xb764('0x14'))['db'];config[_0xb764('0x15')]=_[_0xb764('0x16')](config[_0xb764('0x15')],{'host':_0xb764('0x17'),'port':0x18eb});var socket=require(_0xb764('0x18'))(new Redis(config[_0xb764('0x15')]));require(_0xb764('0x19'))['register'](socket);function respondWithStatusCode(_0x399675,_0x5d8b1f){_0x5d8b1f=_0x5d8b1f||0xcc;return function(_0xac3055){if(_0xac3055){return _0x399675[_0xb764('0x1a')](_0x5d8b1f);}return _0x399675[_0xb764('0x1b')](_0x5d8b1f)['end']();};}function respondWithResult(_0x2f6224,_0xa1565b){_0xa1565b=_0xa1565b||0xc8;return function(_0x152b46){if(_0x152b46){return _0x2f6224[_0xb764('0x1b')](_0xa1565b)[_0xb764('0x1c')](_0x152b46);}};}function respondWithFilteredResult(_0xa17894,_0x435d21){return function(_0x925be1){if(_0x925be1){var _0x7ae6a8=typeof _0x435d21[_0xb764('0x1d')]===_0xb764('0x1e')&&typeof _0x435d21['limit']===_0xb764('0x1e');var _0x65598b=_0x925be1[_0xb764('0x1f')];var _0x569c3b=_0x7ae6a8?0x0:_0x435d21[_0xb764('0x1d')];var _0x32f274=_0x7ae6a8?_0x925be1[_0xb764('0x1f')]:_0x435d21[_0xb764('0x1d')]+_0x435d21[_0xb764('0x20')];var _0x571d9d;if(_0x32f274>=_0x65598b){_0x32f274=_0x65598b;_0x571d9d=0xc8;}else{_0x571d9d=0xce;}_0xa17894[_0xb764('0x1b')](_0x571d9d);return _0xa17894[_0xb764('0x21')](_0xb764('0x22'),_0x569c3b+'-'+_0x32f274+'/'+_0x65598b)[_0xb764('0x1c')](_0x925be1);}return null;};}function patchUpdates(_0x1f196a){return function(_0xc69d19){try{jsonpatch['apply'](_0xc69d19,_0x1f196a,!![]);}catch(_0x4e40d8){return BPromise[_0xb764('0x23')](_0x4e40d8);}return _0xc69d19[_0xb764('0x24')]();};}function saveUpdates(_0x47ad4e,_0x394e4e){return function(_0x2ecaf0){if(_0x2ecaf0){return _0x2ecaf0[_0xb764('0x25')](_0x47ad4e)[_0xb764('0x26')](function(_0x46cd72){return _0x46cd72;});}return null;};}function removeEntity(_0x1a1826,_0x1a0578){return function(_0x4edb9d){if(_0x4edb9d){return _0x4edb9d['destroy']()[_0xb764('0x26')](function(){_0x1a1826[_0xb764('0x1b')](0xcc)['end']();});}};}function handleEntityNotFound(_0x5491db,_0x35f4e0){return function(_0x16d05b){if(!_0x16d05b){_0x5491db[_0xb764('0x1a')](0x194);}return _0x16d05b;};}function handleError(_0x3e3661,_0x33b0fc){_0x33b0fc=_0x33b0fc||0x1f4;return function(_0x3b8773){logger[_0xb764('0x27')](_0x3b8773['stack']);if(_0x3b8773[_0xb764('0x28')]){delete _0x3b8773[_0xb764('0x28')];}_0x3e3661[_0xb764('0x1b')](_0x33b0fc)['send'](_0x3b8773);};}exports[_0xb764('0x29')]=function(_0x5594cf,_0x4a6003){var _0x5c7ac8={},_0x5ba4c8={},_0x5e4ba5={'count':0x0,'rows':[]};var _0x36955d=_[_0xb764('0x2a')](db[_0xb764('0x2b')][_0xb764('0x2c')],function(_0xba1d98){return{'name':_0xba1d98[_0xb764('0x2d')],'type':_0xba1d98['type'][_0xb764('0x2e')]};});_0x5ba4c8['model']=_[_0xb764('0x2a')](_0x36955d,_0xb764('0x28'));_0x5ba4c8[_0xb764('0x2f')]=_[_0xb764('0x30')](_0x5594cf[_0xb764('0x2f')]);_0x5ba4c8[_0xb764('0x31')]=_[_0xb764('0x32')](_0x5ba4c8['model'],_0x5ba4c8[_0xb764('0x2f')]);_0x5c7ac8[_0xb764('0x33')]=_[_0xb764('0x32')](_0x5ba4c8[_0xb764('0x34')],qs[_0xb764('0x35')](_0x5594cf[_0xb764('0x2f')]['fields']));_0x5c7ac8[_0xb764('0x33')]=_0x5c7ac8[_0xb764('0x33')][_0xb764('0x36')]?_0x5c7ac8[_0xb764('0x33')]:_0x5ba4c8[_0xb764('0x34')];if(!_0x5594cf[_0xb764('0x2f')][_0xb764('0x37')]('nolimit')){_0x5c7ac8[_0xb764('0x20')]=qs[_0xb764('0x20')](_0x5594cf[_0xb764('0x2f')]['limit']);_0x5c7ac8['offset']=qs[_0xb764('0x1d')](_0x5594cf[_0xb764('0x2f')][_0xb764('0x1d')]);}_0x5c7ac8[_0xb764('0x38')]=qs[_0xb764('0x39')](_0x5594cf[_0xb764('0x2f')]['sort']);_0x5c7ac8['where']=qs['filters'](_[_0xb764('0x3a')](_0x5594cf[_0xb764('0x2f')],_0x5ba4c8[_0xb764('0x31')]),_0x36955d);if(_0x5594cf[_0xb764('0x2f')][_0xb764('0x3b')]){_0x5c7ac8['where']=_[_0xb764('0x3c')](_0x5c7ac8[_0xb764('0x3d')],{'$or':_[_0xb764('0x2a')](_0x36955d,function(_0x1ceed1){if(_0x1ceed1[_0xb764('0x3e')]!==_0xb764('0x3f')){var _0x878a8d={};_0x878a8d[_0x1ceed1[_0xb764('0x28')]]={'$like':'%'+_0x5594cf['query'][_0xb764('0x3b')]+'%'};return _0x878a8d;}})});}_0x5c7ac8=_['merge']({},_0x5c7ac8,_0x5594cf['options']);var _0x19856e={'where':_0x5c7ac8[_0xb764('0x3d')]};return db[_0xb764('0x2b')][_0xb764('0x1f')](_0x19856e)[_0xb764('0x26')](function(_0x520773){_0x5e4ba5[_0xb764('0x1f')]=_0x520773;if(_0x5594cf[_0xb764('0x2f')][_0xb764('0x40')]){_0x5c7ac8[_0xb764('0x41')]=[{'all':!![]}];}return db['ChatGroup']['findAll'](_0x5c7ac8);})[_0xb764('0x26')](function(_0x5e57ca){_0x5e4ba5['rows']=_0x5e57ca;return _0x5e4ba5;})[_0xb764('0x26')](respondWithFilteredResult(_0x4a6003,_0x5c7ac8))[_0xb764('0x42')](handleError(_0x4a6003,null));};exports[_0xb764('0x43')]=function(_0x4766d2,_0x5bcbb1){var _0x1b34ae={'raw':!![],'where':{'id':_0x4766d2[_0xb764('0x44')]['id']}},_0x4ff8cc={};_0x4ff8cc[_0xb764('0x34')]=_[_0xb764('0x30')](db['ChatGroup'][_0xb764('0x2c')]);_0x4ff8cc[_0xb764('0x2f')]=_[_0xb764('0x30')](_0x4766d2[_0xb764('0x2f')]);_0x4ff8cc['filters']=_[_0xb764('0x32')](_0x4ff8cc[_0xb764('0x34')],_0x4ff8cc[_0xb764('0x2f')]);_0x1b34ae[_0xb764('0x33')]=_['intersection'](_0x4ff8cc['model'],qs[_0xb764('0x35')](_0x4766d2[_0xb764('0x2f')][_0xb764('0x35')]));_0x1b34ae[_0xb764('0x33')]=_0x1b34ae['attributes'][_0xb764('0x36')]?_0x1b34ae['attributes']:_0x4ff8cc[_0xb764('0x34')];if(_0x4766d2[_0xb764('0x2f')][_0xb764('0x40')]){_0x1b34ae['include']=[{'all':!![]}];}_0x1b34ae=_[_0xb764('0x3c')]({},_0x1b34ae,_0x4766d2[_0xb764('0x45')]);return db[_0xb764('0x2b')]['find'](_0x1b34ae)[_0xb764('0x26')](handleEntityNotFound(_0x5bcbb1,null))['then'](respondWithResult(_0x5bcbb1,null))[_0xb764('0x42')](handleError(_0x5bcbb1,null));};exports[_0xb764('0x46')]=function(_0x18068f,_0x2bc80d){return db[_0xb764('0x2b')][_0xb764('0x46')](_0x18068f[_0xb764('0x47')],{})[_0xb764('0x26')](respondWithResult(_0x2bc80d,0xc9))[_0xb764('0x42')](handleError(_0x2bc80d,null));};exports['update']=function(_0x1c1982,_0x259e8b){if(_0x1c1982[_0xb764('0x47')]['id']){delete _0x1c1982['body']['id'];}return db['ChatGroup'][_0xb764('0x48')]({'where':{'id':_0x1c1982['params']['id']}})[_0xb764('0x26')](handleEntityNotFound(_0x259e8b,null))['then'](saveUpdates(_0x1c1982[_0xb764('0x47')],null))[_0xb764('0x26')](respondWithResult(_0x259e8b,null))[_0xb764('0x42')](handleError(_0x259e8b,null));};exports[_0xb764('0x49')]=function(_0x5c794c,_0x569835){return db[_0xb764('0x2b')][_0xb764('0x48')]({'where':{'id':_0x5c794c[_0xb764('0x44')]['id']}})['then'](handleEntityNotFound(_0x569835,null))['then'](removeEntity(_0x569835,null))[_0xb764('0x42')](handleError(_0x569835,null));};exports[_0xb764('0x4a')]=function(_0x2fd9b5,_0x24da2f){return db[_0xb764('0x2b')][_0xb764('0x4a')]()['then'](respondWithResult(_0x24da2f,null))[_0xb764('0x42')](handleError(_0x24da2f,null));};exports[_0xb764('0x4b')]=function(_0x2b8f5b,_0xca6200,_0x43b6a4){return db[_0xb764('0x4c')][_0xb764('0x1f')]({'where':{'ChatGroupId':_0x2b8f5b['params']['id'],'ToId':_0x2b8f5b[_0xb764('0x4d')]['id'],'read':![]}})['then'](function(_0x4117c6){return{'id':_[_0xb764('0x4e')](_0x2b8f5b[_0xb764('0x44')]['id']),'count':_0x4117c6};})[_0xb764('0x26')](respondWithResult(_0xca6200,null))[_0xb764('0x42')](handleError(_0xca6200,null));};exports[_0xb764('0x4f')]=function(_0x43d097,_0x5499a6,_0x2afbb3){return db[_0xb764('0x2b')]['find']({'where':{'id':_0x43d097['params']['id']}})['then'](handleEntityNotFound(_0x5499a6,null))[_0xb764('0x26')](function(_0x3696fb){if(_0x3696fb){return _0x3696fb['addMembers'](_0x43d097[_0xb764('0x47')][_0xb764('0x50')],_[_0xb764('0x51')](_0x43d097[_0xb764('0x47')],['ids','id'])||{});}})['then'](respondWithResult(_0x5499a6,null))[_0xb764('0x42')](handleError(_0x5499a6,null));};exports[_0xb764('0x52')]=function(_0x41ab8c,_0x4990a3,_0x5c6a9a){var _0xc7adf8={};var _0x37316e={};var _0x39dbae;var _0xd4880;return db[_0xb764('0x2b')]['findOne']({'where':{'id':_0x41ab8c[_0xb764('0x44')]['id']}})['then'](handleEntityNotFound(_0x4990a3,null))['then'](function(_0x53b9b2){if(_0x53b9b2){_0x39dbae=_0x53b9b2;_0x37316e[_0xb764('0x34')]=_[_0xb764('0x30')](db[_0xb764('0x53')][_0xb764('0x2c')]);_0x37316e[_0xb764('0x2f')]=_[_0xb764('0x30')](_0x41ab8c[_0xb764('0x2f')]);_0x37316e[_0xb764('0x31')]=_['intersection'](_0x37316e[_0xb764('0x34')],_0x37316e[_0xb764('0x2f')]);_0xc7adf8[_0xb764('0x33')]=_[_0xb764('0x32')](_0x37316e['model'],qs[_0xb764('0x35')](_0x41ab8c[_0xb764('0x2f')][_0xb764('0x35')]));_0xc7adf8[_0xb764('0x33')]=_0xc7adf8['attributes'][_0xb764('0x36')]?_0xc7adf8[_0xb764('0x33')]:_0x37316e['model'];_0xc7adf8[_0xb764('0x38')]=qs[_0xb764('0x39')](_0x41ab8c['query'][_0xb764('0x39')]);_0xc7adf8[_0xb764('0x3d')]=qs[_0xb764('0x31')](_[_0xb764('0x3a')](_0x41ab8c[_0xb764('0x2f')],_0x37316e[_0xb764('0x31')]));if(_0x41ab8c[_0xb764('0x2f')]['filter']){_0xc7adf8[_0xb764('0x3d')]=_[_0xb764('0x3c')](_0xc7adf8[_0xb764('0x3d')],{'$or':_[_0xb764('0x2a')](_0xc7adf8[_0xb764('0x33')],function(_0x4a2619){var _0x4f8a87={};_0x4f8a87[_0x4a2619]={'$like':'%'+_0x41ab8c[_0xb764('0x2f')]['filter']+'%'};return _0x4f8a87;})});}_0xc7adf8=_[_0xb764('0x3c')]({},_0xc7adf8,_0x41ab8c[_0xb764('0x45')]);return _0x39dbae[_0xb764('0x52')](_0xc7adf8);}})[_0xb764('0x26')](function(_0x3280c4){if(_0x3280c4){_0xd4880=_0x3280c4[_0xb764('0x36')];if(!_0x41ab8c[_0xb764('0x2f')][_0xb764('0x37')](_0xb764('0x54'))){_0xc7adf8['limit']=qs[_0xb764('0x20')](_0x41ab8c[_0xb764('0x2f')][_0xb764('0x20')]);_0xc7adf8['offset']=qs[_0xb764('0x1d')](_0x41ab8c['query'][_0xb764('0x1d')]);}return _0x39dbae[_0xb764('0x52')](_0xc7adf8);}})[_0xb764('0x26')](function(_0x147ed9){if(_0x147ed9){return _0x147ed9?{'count':_0xd4880,'rows':_0x147ed9}:null;}})['then'](respondWithResult(_0x4990a3,null))['catch'](handleError(_0x4990a3,null));};exports[_0xb764('0x55')]=function(_0x52842c,_0x197561,_0x36ac18){return db['ChatGroup'][_0xb764('0x48')]({'where':{'id':_0x52842c[_0xb764('0x44')]['id']}})[_0xb764('0x26')](handleEntityNotFound(_0x197561,null))[_0xb764('0x26')](function(_0x85e345){if(_0x85e345){return _0x85e345[_0xb764('0x55')](_0x52842c[_0xb764('0x2f')][_0xb764('0x50')]);}})[_0xb764('0x26')](respondWithStatusCode(_0x197561,null))[_0xb764('0x42')](handleError(_0x197561,null));};exports[_0xb764('0x56')]=function(_0x5f25e0,_0x5c2758,_0x4d0ec6){if(_0x5f25e0[_0xb764('0x47')]['id']){delete _0x5f25e0['body']['id'];}return db[_0xb764('0x2b')][_0xb764('0x48')]({'where':{'id':_0x5f25e0[_0xb764('0x44')]['id']}})[_0xb764('0x26')](handleEntityNotFound(_0x5c2758,null))[_0xb764('0x26')](function(_0x3e0e7e){if(_0x3e0e7e){_0x5f25e0[_0xb764('0x47')]['ChatGroupId']=_0x3e0e7e['id'];return db[_0xb764('0x4c')][_0xb764('0x46')](_0x5f25e0['body']);}})[_0xb764('0x26')](respondWithResult(_0x5c2758,null))['catch'](handleError(_0x5c2758,null));};exports[_0xb764('0x57')]=function(_0x3c586b,_0x545aae,_0x5d31f7){var _0x1506ad={};var _0x25b142={};var _0x587cf3;var _0xecad54;return db[_0xb764('0x2b')][_0xb764('0x58')]({'where':{'id':_0x3c586b[_0xb764('0x44')]['id']}})['then'](handleEntityNotFound(_0x545aae,null))[_0xb764('0x26')](function(_0x319c2f){if(_0x319c2f){_0x587cf3=_0x319c2f;_0x25b142[_0xb764('0x34')]=_[_0xb764('0x30')](db[_0xb764('0x4c')][_0xb764('0x2c')]);_0x25b142[_0xb764('0x2f')]=_[_0xb764('0x30')](_0x3c586b[_0xb764('0x2f')]);_0x25b142[_0xb764('0x31')]=_[_0xb764('0x32')](_0x25b142[_0xb764('0x34')],_0x25b142[_0xb764('0x2f')]);_0x1506ad[_0xb764('0x33')]=_[_0xb764('0x32')](_0x25b142[_0xb764('0x34')],qs[_0xb764('0x35')](_0x3c586b[_0xb764('0x2f')]['fields']));_0x1506ad[_0xb764('0x33')]=_0x1506ad[_0xb764('0x33')][_0xb764('0x36')]?_0x1506ad[_0xb764('0x33')]:_0x25b142[_0xb764('0x34')];_0x1506ad[_0xb764('0x38')]=qs[_0xb764('0x39')](_0x3c586b[_0xb764('0x2f')][_0xb764('0x39')]);_0x1506ad[_0xb764('0x3d')]=qs[_0xb764('0x31')](_['pick'](_0x3c586b[_0xb764('0x2f')],_0x25b142['filters']));if(_0x3c586b[_0xb764('0x2f')][_0xb764('0x3b')]){_0x1506ad[_0xb764('0x3d')]=_[_0xb764('0x3c')](_0x1506ad[_0xb764('0x3d')],{'$or':_[_0xb764('0x2a')](_0x1506ad[_0xb764('0x33')],function(_0x18324b){var _0x5195c6={};_0x5195c6[_0x18324b]={'$like':'%'+_0x3c586b['query'][_0xb764('0x3b')]+'%'};return _0x5195c6;})});}if(_0x3c586b[_0xb764('0x2f')]['$gte']){var _0x40f18c=_0x3c586b['query'][_0xb764('0x59')][_0xb764('0x5a')](',');var _0x35889a={};_0x35889a[_0x40f18c[0x0]]={'$gte':moment(_0x40f18c[0x1])[_0xb764('0x5b')]('YYYY-MM-DD\x20HH:mm:ss')};_0x1506ad[_0xb764('0x3d')]=_[_0xb764('0x3c')](_0x1506ad[_0xb764('0x3d')],_0x35889a);}_0x1506ad=_[_0xb764('0x3c')]({},_0x1506ad,_0x3c586b['options']);return _0x587cf3[_0xb764('0x57')](_0x1506ad);}})['then'](function(_0x4ba66a){if(_0x4ba66a){_0xecad54=_0x4ba66a[_0xb764('0x36')];if(!_0x3c586b['query'][_0xb764('0x37')](_0xb764('0x54'))){_0x1506ad['limit']=qs[_0xb764('0x20')](_0x3c586b['query'][_0xb764('0x20')]);_0x1506ad[_0xb764('0x1d')]=qs['offset'](_0x3c586b[_0xb764('0x2f')][_0xb764('0x1d')]);}return _0x587cf3[_0xb764('0x57')](_0x1506ad);}})[_0xb764('0x26')](function(_0xac812a){if(_0xac812a){return _0xac812a?{'count':_0xecad54,'rows':_0xac812a}:null;}})[_0xb764('0x26')](respondWithResult(_0x545aae,null))['catch'](handleError(_0x545aae,null));}; \ No newline at end of file +var _0x1c36=['where','merge','VIRTUAL','filter','ChatGroup','catch','show','params','includeAll','include','options','create','body','find','describe','ChatInternalMessage','toInteger','ids','getMembers','findOne','User','hasOwnProperty','removeMembers','addMessage','ChatGroupId','getMessages','$gte','split','format','eml-format','rimraf','zip-dir','request-promise','moment','mustache','util','sox','fs-extra','lodash','squel','jsforce','desk.js','to-csv','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/license/util','../../mysqldb','redis','localhost','socket.io-emitter','./chatGroup.socket','sendStatus','status','end','offset','undefined','limit','count','json','apply','reject','save','destroy','then','error','stack','name','send','index','map','rawAttributes','fieldName','type','model','query','keys','filters','intersection','attributes','fields','length','nolimit','order','sort','pick'];(function(_0x2d7f0e,_0x3e6fbd){var _0x110b07=function(_0x557b00){while(--_0x557b00){_0x2d7f0e['push'](_0x2d7f0e['shift']());}};_0x110b07(++_0x3e6fbd);}(_0x1c36,0xd1));var _0x61c3=function(_0x1b2ff7,_0x12a034){_0x1b2ff7=_0x1b2ff7-0x0;var _0x31656a=_0x1c36[_0x1b2ff7];return _0x31656a;};'use strict';var emlformat=require(_0x61c3('0x0'));var rimraf=require(_0x61c3('0x1'));var zipdir=require(_0x61c3('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x61c3('0x3'));var moment=require(_0x61c3('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x61c3('0x5'));var util=require(_0x61c3('0x6'));var path=require('path');var sox=require(_0x61c3('0x7'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x61c3('0x8'));var _=require(_0x61c3('0x9'));var squel=require(_0x61c3('0xa'));var crypto=require('crypto');var jsforce=require(_0x61c3('0xb'));var deskjs=require(_0x61c3('0xc'));var toCsv=require(_0x61c3('0xd'));var querystring=require(_0x61c3('0xe'));var Papa=require('papaparse');var Redis=require(_0x61c3('0xf'));var authService=require(_0x61c3('0x10'));var qs=require(_0x61c3('0x11'));var as=require(_0x61c3('0x12'));var hardwareService=require(_0x61c3('0x13'));var logger=require(_0x61c3('0x14'))('api');var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0x61c3('0x15'));var db=require(_0x61c3('0x16'))['db'];config[_0x61c3('0x17')]=_['defaults'](config[_0x61c3('0x17')],{'host':_0x61c3('0x18'),'port':0x18eb});var socket=require(_0x61c3('0x19'))(new Redis(config[_0x61c3('0x17')]));require(_0x61c3('0x1a'))['register'](socket);function respondWithStatusCode(_0x21a6d4,_0x56485e){_0x56485e=_0x56485e||0xcc;return function(_0x3c2d29){if(_0x3c2d29){return _0x21a6d4[_0x61c3('0x1b')](_0x56485e);}return _0x21a6d4[_0x61c3('0x1c')](_0x56485e)[_0x61c3('0x1d')]();};}function respondWithResult(_0x339bd2,_0x18aca6){_0x18aca6=_0x18aca6||0xc8;return function(_0x3bb437){if(_0x3bb437){return _0x339bd2[_0x61c3('0x1c')](_0x18aca6)['json'](_0x3bb437);}};}function respondWithFilteredResult(_0x144e45,_0x41f765){return function(_0xe2e017){if(_0xe2e017){var _0x14b840=typeof _0x41f765[_0x61c3('0x1e')]===_0x61c3('0x1f')&&typeof _0x41f765[_0x61c3('0x20')]===_0x61c3('0x1f');var _0x310d96=_0xe2e017[_0x61c3('0x21')];var _0x2ee3d0=_0x14b840?0x0:_0x41f765[_0x61c3('0x1e')];var _0x397824=_0x14b840?_0xe2e017[_0x61c3('0x21')]:_0x41f765[_0x61c3('0x1e')]+_0x41f765[_0x61c3('0x20')];var _0x369c7e;if(_0x397824>=_0x310d96){_0x397824=_0x310d96;_0x369c7e=0xc8;}else{_0x369c7e=0xce;}_0x144e45['status'](_0x369c7e);return _0x144e45['set']('Content-Range',_0x2ee3d0+'-'+_0x397824+'/'+_0x310d96)[_0x61c3('0x22')](_0xe2e017);}return null;};}function patchUpdates(_0x322c80){return function(_0x4a2554){try{jsonpatch[_0x61c3('0x23')](_0x4a2554,_0x322c80,!![]);}catch(_0x5d053c){return BPromise[_0x61c3('0x24')](_0x5d053c);}return _0x4a2554[_0x61c3('0x25')]();};}function saveUpdates(_0x49d59e,_0x2d2f82){return function(_0x37661f){if(_0x37661f){return _0x37661f['update'](_0x49d59e)['then'](function(_0x189466){return _0x189466;});}return null;};}function removeEntity(_0x17bf71,_0x41c241){return function(_0x1764dc){if(_0x1764dc){return _0x1764dc[_0x61c3('0x26')]()[_0x61c3('0x27')](function(){_0x17bf71['status'](0xcc)[_0x61c3('0x1d')]();});}};}function handleEntityNotFound(_0x549e68,_0xbc0c8c){return function(_0x16bf11){if(!_0x16bf11){_0x549e68[_0x61c3('0x1b')](0x194);}return _0x16bf11;};}function handleError(_0xd1a7dd,_0x254bbc){_0x254bbc=_0x254bbc||0x1f4;return function(_0x52f70f){logger[_0x61c3('0x28')](_0x52f70f[_0x61c3('0x29')]);if(_0x52f70f[_0x61c3('0x2a')]){delete _0x52f70f['name'];}_0xd1a7dd['status'](_0x254bbc)[_0x61c3('0x2b')](_0x52f70f);};}exports[_0x61c3('0x2c')]=function(_0x5539ac,_0x18d8a6){var _0x3cb72a={},_0x253beb={},_0x364dfb={'count':0x0,'rows':[]};var _0x437377=_[_0x61c3('0x2d')](db['ChatGroup'][_0x61c3('0x2e')],function(_0x1b833e){return{'name':_0x1b833e[_0x61c3('0x2f')],'type':_0x1b833e[_0x61c3('0x30')]['key']};});_0x253beb[_0x61c3('0x31')]=_[_0x61c3('0x2d')](_0x437377,_0x61c3('0x2a'));_0x253beb[_0x61c3('0x32')]=_[_0x61c3('0x33')](_0x5539ac[_0x61c3('0x32')]);_0x253beb[_0x61c3('0x34')]=_[_0x61c3('0x35')](_0x253beb[_0x61c3('0x31')],_0x253beb[_0x61c3('0x32')]);_0x3cb72a[_0x61c3('0x36')]=_[_0x61c3('0x35')](_0x253beb['model'],qs[_0x61c3('0x37')](_0x5539ac[_0x61c3('0x32')]['fields']));_0x3cb72a[_0x61c3('0x36')]=_0x3cb72a[_0x61c3('0x36')][_0x61c3('0x38')]?_0x3cb72a['attributes']:_0x253beb[_0x61c3('0x31')];if(!_0x5539ac[_0x61c3('0x32')]['hasOwnProperty'](_0x61c3('0x39'))){_0x3cb72a['limit']=qs['limit'](_0x5539ac['query']['limit']);_0x3cb72a[_0x61c3('0x1e')]=qs['offset'](_0x5539ac[_0x61c3('0x32')]['offset']);}_0x3cb72a[_0x61c3('0x3a')]=qs['sort'](_0x5539ac[_0x61c3('0x32')][_0x61c3('0x3b')]);_0x3cb72a['where']=qs[_0x61c3('0x34')](_[_0x61c3('0x3c')](_0x5539ac[_0x61c3('0x32')],_0x253beb[_0x61c3('0x34')]),_0x437377);if(_0x5539ac[_0x61c3('0x32')]['filter']){_0x3cb72a[_0x61c3('0x3d')]=_[_0x61c3('0x3e')](_0x3cb72a[_0x61c3('0x3d')],{'$or':_[_0x61c3('0x2d')](_0x437377,function(_0x3c3674){if(_0x3c3674[_0x61c3('0x30')]!==_0x61c3('0x3f')){var _0x28c887={};_0x28c887[_0x3c3674['name']]={'$like':'%'+_0x5539ac[_0x61c3('0x32')][_0x61c3('0x40')]+'%'};return _0x28c887;}})});}_0x3cb72a=_[_0x61c3('0x3e')]({},_0x3cb72a,_0x5539ac['options']);var _0x357def={'where':_0x3cb72a[_0x61c3('0x3d')]};return db[_0x61c3('0x41')][_0x61c3('0x21')](_0x357def)[_0x61c3('0x27')](function(_0x4a3c41){_0x364dfb[_0x61c3('0x21')]=_0x4a3c41;if(_0x5539ac[_0x61c3('0x32')]['includeAll']){_0x3cb72a['include']=[{'all':!![]}];}return db['ChatGroup']['findAll'](_0x3cb72a);})[_0x61c3('0x27')](function(_0x14da30){_0x364dfb['rows']=_0x14da30;return _0x364dfb;})[_0x61c3('0x27')](respondWithFilteredResult(_0x18d8a6,_0x3cb72a))[_0x61c3('0x42')](handleError(_0x18d8a6,null));};exports[_0x61c3('0x43')]=function(_0x36673f,_0x505d5d){var _0x3cd749={'raw':!![],'where':{'id':_0x36673f[_0x61c3('0x44')]['id']}},_0x44ab4c={};_0x44ab4c[_0x61c3('0x31')]=_[_0x61c3('0x33')](db['ChatGroup'][_0x61c3('0x2e')]);_0x44ab4c[_0x61c3('0x32')]=_['keys'](_0x36673f[_0x61c3('0x32')]);_0x44ab4c[_0x61c3('0x34')]=_[_0x61c3('0x35')](_0x44ab4c[_0x61c3('0x31')],_0x44ab4c[_0x61c3('0x32')]);_0x3cd749[_0x61c3('0x36')]=_['intersection'](_0x44ab4c[_0x61c3('0x31')],qs[_0x61c3('0x37')](_0x36673f[_0x61c3('0x32')][_0x61c3('0x37')]));_0x3cd749[_0x61c3('0x36')]=_0x3cd749[_0x61c3('0x36')][_0x61c3('0x38')]?_0x3cd749[_0x61c3('0x36')]:_0x44ab4c[_0x61c3('0x31')];if(_0x36673f['query'][_0x61c3('0x45')]){_0x3cd749[_0x61c3('0x46')]=[{'all':!![]}];}_0x3cd749=_['merge']({},_0x3cd749,_0x36673f[_0x61c3('0x47')]);return db[_0x61c3('0x41')]['find'](_0x3cd749)['then'](handleEntityNotFound(_0x505d5d,null))[_0x61c3('0x27')](respondWithResult(_0x505d5d,null))[_0x61c3('0x42')](handleError(_0x505d5d,null));};exports[_0x61c3('0x48')]=function(_0xf582fe,_0x212d07){return db[_0x61c3('0x41')]['create'](_0xf582fe[_0x61c3('0x49')],{})[_0x61c3('0x27')](respondWithResult(_0x212d07,0xc9))[_0x61c3('0x42')](handleError(_0x212d07,null));};exports['update']=function(_0x4b4bf1,_0x4748a4){if(_0x4b4bf1[_0x61c3('0x49')]['id']){delete _0x4b4bf1[_0x61c3('0x49')]['id'];}return db['ChatGroup']['find']({'where':{'id':_0x4b4bf1[_0x61c3('0x44')]['id']}})[_0x61c3('0x27')](handleEntityNotFound(_0x4748a4,null))[_0x61c3('0x27')](saveUpdates(_0x4b4bf1[_0x61c3('0x49')],null))[_0x61c3('0x27')](respondWithResult(_0x4748a4,null))[_0x61c3('0x42')](handleError(_0x4748a4,null));};exports['destroy']=function(_0x5bc383,_0xc165c){return db['ChatGroup'][_0x61c3('0x4a')]({'where':{'id':_0x5bc383[_0x61c3('0x44')]['id']}})[_0x61c3('0x27')](handleEntityNotFound(_0xc165c,null))[_0x61c3('0x27')](removeEntity(_0xc165c,null))[_0x61c3('0x42')](handleError(_0xc165c,null));};exports[_0x61c3('0x4b')]=function(_0x505ef2,_0x6916d8){return db[_0x61c3('0x41')][_0x61c3('0x4b')]()[_0x61c3('0x27')](respondWithResult(_0x6916d8,null))['catch'](handleError(_0x6916d8,null));};exports['getUnread']=function(_0x40043f,_0x2ca0f1,_0x3322a2){return db[_0x61c3('0x4c')][_0x61c3('0x21')]({'where':{'ChatGroupId':_0x40043f[_0x61c3('0x44')]['id'],'ToId':_0x40043f['user']['id'],'read':![]}})[_0x61c3('0x27')](function(_0x328043){return{'id':_[_0x61c3('0x4d')](_0x40043f[_0x61c3('0x44')]['id']),'count':_0x328043};})['then'](respondWithResult(_0x2ca0f1,null))[_0x61c3('0x42')](handleError(_0x2ca0f1,null));};exports['addMembers']=function(_0x1065cc,_0x16efbb,_0xb43ce3){return db[_0x61c3('0x41')][_0x61c3('0x4a')]({'where':{'id':_0x1065cc[_0x61c3('0x44')]['id']}})[_0x61c3('0x27')](handleEntityNotFound(_0x16efbb,null))[_0x61c3('0x27')](function(_0x37f1a1){if(_0x37f1a1){return _0x37f1a1['addMembers'](_0x1065cc[_0x61c3('0x49')][_0x61c3('0x4e')],_['omit'](_0x1065cc['body'],[_0x61c3('0x4e'),'id'])||{});}})[_0x61c3('0x27')](respondWithResult(_0x16efbb,null))['catch'](handleError(_0x16efbb,null));};exports[_0x61c3('0x4f')]=function(_0x44a674,_0x1b43d3,_0xb524d0){var _0xd6fb23={};var _0x26978a={};var _0x501347;var _0x2db1eb;return db['ChatGroup'][_0x61c3('0x50')]({'where':{'id':_0x44a674[_0x61c3('0x44')]['id']}})[_0x61c3('0x27')](handleEntityNotFound(_0x1b43d3,null))[_0x61c3('0x27')](function(_0x2a6f85){if(_0x2a6f85){_0x501347=_0x2a6f85;_0x26978a[_0x61c3('0x31')]=_[_0x61c3('0x33')](db[_0x61c3('0x51')][_0x61c3('0x2e')]);_0x26978a['query']=_[_0x61c3('0x33')](_0x44a674['query']);_0x26978a[_0x61c3('0x34')]=_[_0x61c3('0x35')](_0x26978a[_0x61c3('0x31')],_0x26978a[_0x61c3('0x32')]);_0xd6fb23[_0x61c3('0x36')]=_[_0x61c3('0x35')](_0x26978a[_0x61c3('0x31')],qs[_0x61c3('0x37')](_0x44a674[_0x61c3('0x32')][_0x61c3('0x37')]));_0xd6fb23[_0x61c3('0x36')]=_0xd6fb23[_0x61c3('0x36')][_0x61c3('0x38')]?_0xd6fb23[_0x61c3('0x36')]:_0x26978a[_0x61c3('0x31')];_0xd6fb23[_0x61c3('0x3a')]=qs['sort'](_0x44a674[_0x61c3('0x32')]['sort']);_0xd6fb23['where']=qs[_0x61c3('0x34')](_[_0x61c3('0x3c')](_0x44a674[_0x61c3('0x32')],_0x26978a[_0x61c3('0x34')]));if(_0x44a674['query'][_0x61c3('0x40')]){_0xd6fb23['where']=_[_0x61c3('0x3e')](_0xd6fb23[_0x61c3('0x3d')],{'$or':_['map'](_0xd6fb23['attributes'],function(_0x59552e){var _0x14bd61={};_0x14bd61[_0x59552e]={'$like':'%'+_0x44a674[_0x61c3('0x32')][_0x61c3('0x40')]+'%'};return _0x14bd61;})});}_0xd6fb23=_[_0x61c3('0x3e')]({},_0xd6fb23,_0x44a674[_0x61c3('0x47')]);return _0x501347[_0x61c3('0x4f')](_0xd6fb23);}})[_0x61c3('0x27')](function(_0x10fb0c){if(_0x10fb0c){_0x2db1eb=_0x10fb0c[_0x61c3('0x38')];if(!_0x44a674[_0x61c3('0x32')][_0x61c3('0x52')](_0x61c3('0x39'))){_0xd6fb23[_0x61c3('0x20')]=qs[_0x61c3('0x20')](_0x44a674[_0x61c3('0x32')][_0x61c3('0x20')]);_0xd6fb23[_0x61c3('0x1e')]=qs[_0x61c3('0x1e')](_0x44a674['query'][_0x61c3('0x1e')]);}return _0x501347['getMembers'](_0xd6fb23);}})[_0x61c3('0x27')](function(_0x5d03ac){if(_0x5d03ac){return _0x5d03ac?{'count':_0x2db1eb,'rows':_0x5d03ac}:null;}})[_0x61c3('0x27')](respondWithResult(_0x1b43d3,null))[_0x61c3('0x42')](handleError(_0x1b43d3,null));};exports[_0x61c3('0x53')]=function(_0x40eaf0,_0x2b0cfd,_0x13aca9){return db[_0x61c3('0x41')][_0x61c3('0x4a')]({'where':{'id':_0x40eaf0['params']['id']}})['then'](handleEntityNotFound(_0x2b0cfd,null))[_0x61c3('0x27')](function(_0x36e260){if(_0x36e260){return _0x36e260['removeMembers'](_0x40eaf0[_0x61c3('0x32')][_0x61c3('0x4e')]);}})[_0x61c3('0x27')](respondWithStatusCode(_0x2b0cfd,null))[_0x61c3('0x42')](handleError(_0x2b0cfd,null));};exports[_0x61c3('0x54')]=function(_0x3b61ad,_0x32b7a0,_0x5b887f){if(_0x3b61ad[_0x61c3('0x49')]['id']){delete _0x3b61ad[_0x61c3('0x49')]['id'];}return db[_0x61c3('0x41')][_0x61c3('0x4a')]({'where':{'id':_0x3b61ad[_0x61c3('0x44')]['id']}})[_0x61c3('0x27')](handleEntityNotFound(_0x32b7a0,null))[_0x61c3('0x27')](function(_0x4dc2be){if(_0x4dc2be){_0x3b61ad['body'][_0x61c3('0x55')]=_0x4dc2be['id'];return db[_0x61c3('0x4c')]['create'](_0x3b61ad[_0x61c3('0x49')]);}})[_0x61c3('0x27')](respondWithResult(_0x32b7a0,null))[_0x61c3('0x42')](handleError(_0x32b7a0,null));};exports[_0x61c3('0x56')]=function(_0x52d5bd,_0xc8084a,_0x50e047){var _0x51ad8f={};var _0x1d627c={};var _0x33647e;var _0x182f1c;return db['ChatGroup']['findOne']({'where':{'id':_0x52d5bd['params']['id']}})[_0x61c3('0x27')](handleEntityNotFound(_0xc8084a,null))[_0x61c3('0x27')](function(_0x5157e2){if(_0x5157e2){_0x33647e=_0x5157e2;_0x1d627c[_0x61c3('0x31')]=_['keys'](db[_0x61c3('0x4c')][_0x61c3('0x2e')]);_0x1d627c[_0x61c3('0x32')]=_['keys'](_0x52d5bd['query']);_0x1d627c['filters']=_[_0x61c3('0x35')](_0x1d627c[_0x61c3('0x31')],_0x1d627c['query']);_0x51ad8f[_0x61c3('0x36')]=_[_0x61c3('0x35')](_0x1d627c[_0x61c3('0x31')],qs['fields'](_0x52d5bd[_0x61c3('0x32')][_0x61c3('0x37')]));_0x51ad8f[_0x61c3('0x36')]=_0x51ad8f[_0x61c3('0x36')][_0x61c3('0x38')]?_0x51ad8f[_0x61c3('0x36')]:_0x1d627c[_0x61c3('0x31')];_0x51ad8f[_0x61c3('0x3a')]=qs[_0x61c3('0x3b')](_0x52d5bd['query'][_0x61c3('0x3b')]);_0x51ad8f[_0x61c3('0x3d')]=qs[_0x61c3('0x34')](_['pick'](_0x52d5bd['query'],_0x1d627c[_0x61c3('0x34')]));if(_0x52d5bd[_0x61c3('0x32')][_0x61c3('0x40')]){_0x51ad8f[_0x61c3('0x3d')]=_[_0x61c3('0x3e')](_0x51ad8f[_0x61c3('0x3d')],{'$or':_['map'](_0x51ad8f['attributes'],function(_0x2d2fba){var _0x31b409={};_0x31b409[_0x2d2fba]={'$like':'%'+_0x52d5bd[_0x61c3('0x32')][_0x61c3('0x40')]+'%'};return _0x31b409;})});}if(_0x52d5bd[_0x61c3('0x32')][_0x61c3('0x57')]){var _0x847838=_0x52d5bd['query'][_0x61c3('0x57')][_0x61c3('0x58')](',');var _0x789812={};_0x789812[_0x847838[0x0]]={'$gte':moment(_0x847838[0x1])[_0x61c3('0x59')]('YYYY-MM-DD\x20HH:mm:ss')};_0x51ad8f[_0x61c3('0x3d')]=_[_0x61c3('0x3e')](_0x51ad8f[_0x61c3('0x3d')],_0x789812);}_0x51ad8f=_[_0x61c3('0x3e')]({},_0x51ad8f,_0x52d5bd[_0x61c3('0x47')]);return _0x33647e[_0x61c3('0x56')](_0x51ad8f);}})[_0x61c3('0x27')](function(_0x1482b4){if(_0x1482b4){_0x182f1c=_0x1482b4[_0x61c3('0x38')];if(!_0x52d5bd['query'][_0x61c3('0x52')](_0x61c3('0x39'))){_0x51ad8f[_0x61c3('0x20')]=qs[_0x61c3('0x20')](_0x52d5bd[_0x61c3('0x32')][_0x61c3('0x20')]);_0x51ad8f[_0x61c3('0x1e')]=qs['offset'](_0x52d5bd[_0x61c3('0x32')][_0x61c3('0x1e')]);}return _0x33647e[_0x61c3('0x56')](_0x51ad8f);}})['then'](function(_0x1cb19d){if(_0x1cb19d){return _0x1cb19d?{'count':_0x182f1c,'rows':_0x1cb19d}:null;}})[_0x61c3('0x27')](respondWithResult(_0xc8084a,null))['catch'](handleError(_0xc8084a,null));}; \ No newline at end of file diff --git a/server/api/chatGroup/chatGroup.events.js b/server/api/chatGroup/chatGroup.events.js index 282fca5..53853b5 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 _0xfba2=['exports','../../mysqldb','setMaxListeners','save','update','emit','hasOwnProperty','hook'];(function(_0x3272b0,_0x51ed45){var _0x4daf85=function(_0x45f540){while(--_0x45f540){_0x3272b0['push'](_0x3272b0['shift']());}};_0x4daf85(++_0x51ed45);}(_0xfba2,0xf9));var _0x2fba=function(_0x183609,_0x520ef4){_0x183609=_0x183609-0x0;var _0x47c03c=_0xfba2[_0x183609];return _0x47c03c;};'use strict';var EventEmitter=require('events');var ChatGroup=require(_0x2fba('0x0'))['db']['ChatGroup'];var ChatGroupEvents=new EventEmitter();ChatGroupEvents[_0x2fba('0x1')](0x0);var events={'afterCreate':_0x2fba('0x2'),'afterUpdate':_0x2fba('0x3'),'afterDestroy':'remove'};function emitEvent(_0x2db851){return function(_0x3eef22,_0x233e9c,_0x16c6ed){ChatGroupEvents[_0x2fba('0x4')](_0x2db851+':'+_0x3eef22['id'],_0x3eef22);ChatGroupEvents['emit'](_0x2db851,_0x3eef22);_0x16c6ed(null);};}for(var e in events){if(events[_0x2fba('0x5')](e)){var event=events[e];ChatGroup[_0x2fba('0x6')](e,emitEvent(event));}}module[_0x2fba('0x7')]=ChatGroupEvents; \ No newline at end of file +var _0x04cc=['hasOwnProperty','hook','events','../../mysqldb','ChatGroup','setMaxListeners','update','emit'];(function(_0x261ad5,_0x303863){var _0x4b4177=function(_0x3cf99d){while(--_0x3cf99d){_0x261ad5['push'](_0x261ad5['shift']());}};_0x4b4177(++_0x303863);}(_0x04cc,0x11a));var _0xc04c=function(_0xcd81b8,_0x18d9fd){_0xcd81b8=_0xcd81b8-0x0;var _0xc3ae18=_0x04cc[_0xcd81b8];return _0xc3ae18;};'use strict';var EventEmitter=require(_0xc04c('0x0'));var ChatGroup=require(_0xc04c('0x1'))['db'][_0xc04c('0x2')];var ChatGroupEvents=new EventEmitter();ChatGroupEvents[_0xc04c('0x3')](0x0);var events={'afterCreate':'save','afterUpdate':_0xc04c('0x4'),'afterDestroy':'remove'};function emitEvent(_0x4cca40){return function(_0x138028,_0x2fefd7,_0x153c93){ChatGroupEvents[_0xc04c('0x5')](_0x4cca40+':'+_0x138028['id'],_0x138028);ChatGroupEvents[_0xc04c('0x5')](_0x4cca40,_0x138028);_0x153c93(null);};}for(var e in events){if(events[_0xc04c('0x6')](e)){var event=events[e];ChatGroup[_0xc04c('0x7')](e,emitEvent(event));}}module['exports']=ChatGroupEvents; \ No newline at end of file diff --git a/server/api/chatGroup/chatGroup.model.js b/server/api/chatGroup/chatGroup.model.js index bdd90d5..ea06e16 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 _0xf378=['path','rimraf','../../config/environment','./chatGroup.attributes','define','ChatGroup','chat_groups','lodash','util','api','bluebird','request-promise'];(function(_0x59ee6f,_0x450239){var _0x4c0979=function(_0x565e92){while(--_0x565e92){_0x59ee6f['push'](_0x59ee6f['shift']());}};_0x4c0979(++_0x450239);}(_0xf378,0x1e7));var _0x8f37=function(_0xa148b7,_0x2f3eb2){_0xa148b7=_0xa148b7-0x0;var _0x51efd3=_0xf378[_0xa148b7];return _0x51efd3;};'use strict';var _=require(_0x8f37('0x0'));var util=require(_0x8f37('0x1'));var logger=require('../../config/logger')(_0x8f37('0x2'));var moment=require('moment');var BPromise=require(_0x8f37('0x3'));var rp=require(_0x8f37('0x4'));var fs=require('fs');var path=require(_0x8f37('0x5'));var rimraf=require(_0x8f37('0x6'));var config=require(_0x8f37('0x7'));var attributes=require(_0x8f37('0x8'));module['exports']=function(_0x35b62d,_0x27f80f){return _0x35b62d[_0x8f37('0x9')](_0x8f37('0xa'),attributes,{'tableName':_0x8f37('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x5bce=['rimraf','../../config/environment','./chatGroup.attributes','exports','define','chat_groups','lodash','util','../../config/logger','api','bluebird','request-promise'];(function(_0x2968ae,_0x3b3cc6){var _0x30f95a=function(_0xf13d7){while(--_0xf13d7){_0x2968ae['push'](_0x2968ae['shift']());}};_0x30f95a(++_0x3b3cc6);}(_0x5bce,0x126));var _0xe5bc=function(_0xd1a252,_0x16396f){_0xd1a252=_0xd1a252-0x0;var _0x560ee1=_0x5bce[_0xd1a252];return _0x560ee1;};'use strict';var _=require(_0xe5bc('0x0'));var util=require(_0xe5bc('0x1'));var logger=require(_0xe5bc('0x2'))(_0xe5bc('0x3'));var moment=require('moment');var BPromise=require(_0xe5bc('0x4'));var rp=require(_0xe5bc('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0xe5bc('0x6'));var config=require(_0xe5bc('0x7'));var attributes=require(_0xe5bc('0x8'));module[_0xe5bc('0x9')]=function(_0x6a212f,_0x5ceab5){return _0x6a212f[_0xe5bc('0xa')]('ChatGroup',attributes,{'tableName':_0xe5bc('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/chatGroup/chatGroup.rpc.js b/server/api/chatGroup/chatGroup.rpc.js index eeb7bf9..5f7ab95 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 _0xc4f5=['message','result','catch','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','redis','defaults','localhost','register','request','info','request\x20sent','debug','ChatGroup,\x20%s,\x20%s,\x20%s','stringify','code','error','ChatGroup,\x20%s,\x20%s'];(function(_0x12003a,_0x563c09){var _0x3400c4=function(_0x508a71){while(--_0x508a71){_0x12003a['push'](_0x12003a['shift']());}};_0x3400c4(++_0x563c09);}(_0xc4f5,0xa5));var _0x5c4f=function(_0x207d2f,_0x44400f){_0x207d2f=_0x207d2f-0x0;var _0x3c3498=_0xc4f5[_0x207d2f];return _0x3c3498;};'use strict';var _=require('lodash');var util=require(_0x5c4f('0x0'));var moment=require(_0x5c4f('0x1'));var BPromise=require(_0x5c4f('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x5c4f('0x3'));var db=require(_0x5c4f('0x4'))['db'];var utils=require(_0x5c4f('0x5'));var logger=require(_0x5c4f('0x6'))(_0x5c4f('0x7'));var config=require('../../config/environment');var jayson=require(_0x5c4f('0x8'));var client=jayson[_0x5c4f('0x9')][_0x5c4f('0xa')]({'port':0x232a});config[_0x5c4f('0xb')]=_[_0x5c4f('0xc')](config['redis'],{'host':_0x5c4f('0xd'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x5c4f('0xb')]));require('./chatGroup.socket')[_0x5c4f('0xe')](socket);function respondWithRpcPromise(_0x458348,_0x19623c,_0x56535a){return new BPromise(function(_0x249955,_0x2a9bf9){return client[_0x5c4f('0xf')](_0x458348,_0x56535a)['then'](function(_0x255e5d){logger[_0x5c4f('0x10')]('ChatGroup,\x20%s,\x20%s',_0x19623c,_0x5c4f('0x11'));logger[_0x5c4f('0x12')](_0x5c4f('0x13'),_0x19623c,_0x5c4f('0x11'),JSON[_0x5c4f('0x14')](_0x255e5d));if(_0x255e5d['error']){if(_0x255e5d['error'][_0x5c4f('0x15')]===0x1f4){logger[_0x5c4f('0x16')](_0x5c4f('0x17'),_0x19623c,_0x255e5d[_0x5c4f('0x16')][_0x5c4f('0x18')]);return _0x2a9bf9(_0x255e5d['error']['message']);}logger[_0x5c4f('0x16')]('ChatGroup,\x20%s,\x20%s',_0x19623c,_0x255e5d['error'][_0x5c4f('0x18')]);return _0x249955(_0x255e5d['error'][_0x5c4f('0x18')]);}else{logger[_0x5c4f('0x10')](_0x5c4f('0x17'),_0x19623c,_0x5c4f('0x11'));_0x249955(_0x255e5d[_0x5c4f('0x19')][_0x5c4f('0x18')]);}})[_0x5c4f('0x1a')](function(_0x3ec0ff){logger[_0x5c4f('0x16')]('ChatGroup,\x20%s,\x20%s',_0x19623c,_0x3ec0ff);_0x2a9bf9(_0x3ec0ff);});});} \ No newline at end of file +var _0x0a34=['./chatGroup.socket','register','request','info','request\x20sent','debug','stringify','error','code','ChatGroup,\x20%s,\x20%s','message','result','lodash','util','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','redis','defaults','socket.io-emitter'];(function(_0x3ff94d,_0x512668){var _0x1f2fdf=function(_0x440f5c){while(--_0x440f5c){_0x3ff94d['push'](_0x3ff94d['shift']());}};_0x1f2fdf(++_0x512668);}(_0x0a34,0x12a));var _0x40a3=function(_0x4a7631,_0x2c85b9){_0x4a7631=_0x4a7631-0x0;var _0x1a5a6f=_0x0a34[_0x4a7631];return _0x1a5a6f;};'use strict';var _=require(_0x40a3('0x0'));var util=require(_0x40a3('0x1'));var moment=require('moment');var BPromise=require(_0x40a3('0x2'));var rs=require(_0x40a3('0x3'));var fs=require('fs');var Redis=require(_0x40a3('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x40a3('0x5'));var logger=require(_0x40a3('0x6'))(_0x40a3('0x7'));var config=require('../../config/environment');var jayson=require(_0x40a3('0x8'));var client=jayson[_0x40a3('0x9')][_0x40a3('0xa')]({'port':0x232a});config[_0x40a3('0xb')]=_[_0x40a3('0xc')](config[_0x40a3('0xb')],{'host':'localhost','port':0x18eb});var socket=require(_0x40a3('0xd'))(new Redis(config[_0x40a3('0xb')]));require(_0x40a3('0xe'))[_0x40a3('0xf')](socket);function respondWithRpcPromise(_0x519e1b,_0x2edb15,_0x4f3c10){return new BPromise(function(_0x643d61,_0x236dc8){return client[_0x40a3('0x10')](_0x519e1b,_0x4f3c10)['then'](function(_0x1ee5f8){logger[_0x40a3('0x11')]('ChatGroup,\x20%s,\x20%s',_0x2edb15,_0x40a3('0x12'));logger[_0x40a3('0x13')]('ChatGroup,\x20%s,\x20%s,\x20%s',_0x2edb15,_0x40a3('0x12'),JSON[_0x40a3('0x14')](_0x1ee5f8));if(_0x1ee5f8['error']){if(_0x1ee5f8[_0x40a3('0x15')][_0x40a3('0x16')]===0x1f4){logger[_0x40a3('0x15')](_0x40a3('0x17'),_0x2edb15,_0x1ee5f8['error']['message']);return _0x236dc8(_0x1ee5f8['error'][_0x40a3('0x18')]);}logger[_0x40a3('0x15')](_0x40a3('0x17'),_0x2edb15,_0x1ee5f8['error'][_0x40a3('0x18')]);return _0x643d61(_0x1ee5f8[_0x40a3('0x15')]['message']);}else{logger[_0x40a3('0x11')](_0x40a3('0x17'),_0x2edb15,_0x40a3('0x12'));_0x643d61(_0x1ee5f8[_0x40a3('0x19')][_0x40a3('0x18')]);}})['catch'](function(_0x1e4194){logger[_0x40a3('0x15')](_0x40a3('0x17'),_0x2edb15,_0x1e4194);_0x236dc8(_0x1e4194);});});} \ No newline at end of file diff --git a/server/api/chatGroup/chatGroup.socket.js b/server/api/chatGroup/chatGroup.socket.js index 49e365a..d6b822c 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 _0x6dcb=['register','./chatGroup.events','emit'];(function(_0x421c11,_0xcf7560){var _0x317709=function(_0x5c8c71){while(--_0x5c8c71){_0x421c11['push'](_0x421c11['shift']());}};_0x317709(++_0xcf7560);}(_0x6dcb,0x76));var _0xb6dc=function(_0x52041f,_0x2fe7d5){_0x52041f=_0x52041f-0x0;var _0x2cd5bf=_0x6dcb[_0x52041f];return _0x2cd5bf;};'use strict';var ChatGroupEvents=require(_0xb6dc('0x0'));var events=['save','remove','update'];function createListener(_0x4d8b87,_0xbe5682){return function(_0x5be2f7){_0xbe5682[_0xb6dc('0x1')](_0x4d8b87,_0x5be2f7);};}function removeListener(_0x1a8123,_0x4c14eb){return function(){ChatGroupEvents['removeListener'](_0x1a8123,_0x4c14eb);};}exports[_0xb6dc('0x2')]=function(_0x1c5e74){for(var _0x1f5571=0x0,_0x1a2e63=events['length'];_0x1f5571<_0x1a2e63;_0x1f5571++){var _0x408d20=events[_0x1f5571];var _0x31200f=createListener('chatGroup:'+_0x408d20,_0x1c5e74);ChatGroupEvents['on'](_0x408d20,_0x31200f);}}; \ No newline at end of file +var _0x18f1=['./chatGroup.events','remove','update','emit','register','chatGroup:'];(function(_0x20ef64,_0x4a8fe9){var _0x3707d8=function(_0x5b9a88){while(--_0x5b9a88){_0x20ef64['push'](_0x20ef64['shift']());}};_0x3707d8(++_0x4a8fe9);}(_0x18f1,0x10e));var _0x118f=function(_0x2c91e9,_0x2fb965){_0x2c91e9=_0x2c91e9-0x0;var _0x13f0ff=_0x18f1[_0x2c91e9];return _0x13f0ff;};'use strict';var ChatGroupEvents=require(_0x118f('0x0'));var events=['save',_0x118f('0x1'),_0x118f('0x2')];function createListener(_0x516e8d,_0x59c40d){return function(_0x16e411){_0x59c40d[_0x118f('0x3')](_0x516e8d,_0x16e411);};}function removeListener(_0x7c6d2f,_0x32a4b8){return function(){ChatGroupEvents['removeListener'](_0x7c6d2f,_0x32a4b8);};}exports[_0x118f('0x4')]=function(_0xed3abe){for(var _0x1e4249=0x0,_0x4cd8e3=events['length'];_0x1e4249<_0x4cd8e3;_0x1e4249++){var _0xc2be2f=events[_0x1e4249];var _0x589751=createListener(_0x118f('0x5')+_0xc2be2f,_0xed3abe);ChatGroupEvents['on'](_0xc2be2f,_0x589751);}}; \ No newline at end of file diff --git a/server/api/chatGroup/index.js b/server/api/chatGroup/index.js index d9d26fc..992aa53 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 _0x7b56=['destroy','util','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./chatGroup.controller','isAuthenticated','index','get','/describe','show','/:id/unread','getUnread','getMembers','/:id/messages','getMessages','post','create','/:id/members','addMembers','addMessage','put','/:id','update','delete'];(function(_0x48d732,_0x202a72){var _0x221c79=function(_0x423c1e){while(--_0x423c1e){_0x48d732['push'](_0x48d732['shift']());}};_0x221c79(++_0x202a72);}(_0x7b56,0x92));var _0x67b5=function(_0x2413cc,_0x1d2eb7){_0x2413cc=_0x2413cc-0x0;var _0xf20ecf=_0x7b56[_0x2413cc];return _0xf20ecf;};'use strict';var multer=require('multer');var util=require(_0x67b5('0x0'));var path=require('path');var timeout=require(_0x67b5('0x1'));var express=require(_0x67b5('0x2'));var router=express[_0x67b5('0x3')]();var fs_extra=require(_0x67b5('0x4'));var auth=require(_0x67b5('0x5'));var interaction=require(_0x67b5('0x6'));var config=require(_0x67b5('0x7'));var controller=require(_0x67b5('0x8'));router['get']('/',auth[_0x67b5('0x9')](),controller[_0x67b5('0xa')]);router[_0x67b5('0xb')](_0x67b5('0xc'),auth['isAuthenticated'](),controller['describe']);router[_0x67b5('0xb')]('/:id',auth['isAuthenticated'](),controller[_0x67b5('0xd')]);router['get'](_0x67b5('0xe'),auth[_0x67b5('0x9')](),controller[_0x67b5('0xf')]);router[_0x67b5('0xb')]('/:id/members',auth[_0x67b5('0x9')](),controller[_0x67b5('0x10')]);router[_0x67b5('0xb')](_0x67b5('0x11'),auth[_0x67b5('0x9')](),controller[_0x67b5('0x12')]);router[_0x67b5('0x13')]('/',auth['isAuthenticated'](),controller[_0x67b5('0x14')]);router[_0x67b5('0x13')](_0x67b5('0x15'),auth[_0x67b5('0x9')](),controller[_0x67b5('0x16')]);router[_0x67b5('0x13')](_0x67b5('0x11'),auth['isAuthenticated'](),controller[_0x67b5('0x17')]);router[_0x67b5('0x18')](_0x67b5('0x19'),auth[_0x67b5('0x9')](),controller[_0x67b5('0x1a')]);router[_0x67b5('0x1b')]('/:id',auth[_0x67b5('0x9')](),controller[_0x67b5('0x1c')]);router[_0x67b5('0x1b')](_0x67b5('0x15'),auth[_0x67b5('0x9')](),controller['removeMembers']);module['exports']=router; \ No newline at end of file +var _0xc642=['util','connect-timeout','express','Router','../../components/auth/service','../../config/environment','./chatGroup.controller','get','index','/describe','isAuthenticated','describe','/:id','show','/:id/unread','getUnread','/:id/members','getMembers','/:id/messages','post','create','put','delete','destroy'];(function(_0x33278c,_0x12ceae){var _0xbb0f18=function(_0x38485b){while(--_0x38485b){_0x33278c['push'](_0x33278c['shift']());}};_0xbb0f18(++_0x12ceae);}(_0xc642,0xd8));var _0x2c64=function(_0xbca1b1,_0x33f0ce){_0xbca1b1=_0xbca1b1-0x0;var _0x4e1686=_0xc642[_0xbca1b1];return _0x4e1686;};'use strict';var multer=require('multer');var util=require(_0x2c64('0x0'));var path=require('path');var timeout=require(_0x2c64('0x1'));var express=require(_0x2c64('0x2'));var router=express[_0x2c64('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x2c64('0x4'));var interaction=require('../../components/interaction/service');var config=require(_0x2c64('0x5'));var controller=require(_0x2c64('0x6'));router[_0x2c64('0x7')]('/',auth['isAuthenticated'](),controller[_0x2c64('0x8')]);router['get'](_0x2c64('0x9'),auth[_0x2c64('0xa')](),controller[_0x2c64('0xb')]);router[_0x2c64('0x7')](_0x2c64('0xc'),auth[_0x2c64('0xa')](),controller[_0x2c64('0xd')]);router[_0x2c64('0x7')](_0x2c64('0xe'),auth[_0x2c64('0xa')](),controller[_0x2c64('0xf')]);router['get'](_0x2c64('0x10'),auth['isAuthenticated'](),controller[_0x2c64('0x11')]);router[_0x2c64('0x7')](_0x2c64('0x12'),auth[_0x2c64('0xa')](),controller['getMessages']);router[_0x2c64('0x13')]('/',auth[_0x2c64('0xa')](),controller[_0x2c64('0x14')]);router[_0x2c64('0x13')](_0x2c64('0x10'),auth[_0x2c64('0xa')](),controller['addMembers']);router['post']('/:id/messages',auth['isAuthenticated'](),controller['addMessage']);router[_0x2c64('0x15')](_0x2c64('0xc'),auth[_0x2c64('0xa')](),controller['update']);router[_0x2c64('0x16')](_0x2c64('0xc'),auth[_0x2c64('0xa')](),controller[_0x2c64('0x17')]);router[_0x2c64('0x16')](_0x2c64('0x10'),auth[_0x2c64('0xa')](),controller['removeMembers']);module['exports']=router; \ No newline at end of file diff --git a/server/api/chatInteraction/chatInteraction.attributes.js b/server/api/chatInteraction/chatInteraction.attributes.js index c7c2d8c..853b7c0 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 _0xb195=['out','INTEGER','exports','BOOLEAN','star','TEXT','STRING','DATE','long'];(function(_0x320b7f,_0x326601){var _0x5a67a1=function(_0x3db391){while(--_0x3db391){_0x320b7f['push'](_0x320b7f['shift']());}};_0x5a67a1(++_0x326601);}(_0xb195,0x1cd));var _0x5b19=function(_0x11005e,_0x20c3d2){_0x11005e=_0x11005e-0x0;var _0x29338f=_0xb195[_0x11005e];return _0x29338f;};'use strict';var Sequelize=require('sequelize');module[_0x5b19('0x0')]={'closed':{'type':Sequelize[_0x5b19('0x1')],'defaultValue':![]},'ratingValue':{'type':Sequelize['INTEGER']},'ratingType':{'type':Sequelize['ENUM'](_0x5b19('0x2'),'thumb'),'defaultValue':_0x5b19('0x2')},'ratingMessage':{'type':Sequelize[_0x5b19('0x3')]},'pathTranscript':{'type':Sequelize['TEXT']},'mailTranscript':{'type':Sequelize[_0x5b19('0x4')],'validate':{'isEmail':!![]}},'closedAt':{'type':Sequelize[_0x5b19('0x5')]},'disposition':{'type':Sequelize[_0x5b19('0x4')]},'secondDisposition':{'type':Sequelize['STRING']},'thirdDisposition':{'type':Sequelize[_0x5b19('0x4')]},'note':{'type':Sequelize[_0x5b19('0x4')]},'browserName':{'type':Sequelize[_0x5b19('0x4')]},'browserVersion':{'type':Sequelize[_0x5b19('0x4')]},'osName':{'type':Sequelize[_0x5b19('0x4')]},'osVersion':{'type':Sequelize[_0x5b19('0x4')]},'deviceModel':{'type':Sequelize[_0x5b19('0x4')]},'deviceVendor':{'type':Sequelize[_0x5b19('0x4')]},'deviceType':{'type':Sequelize[_0x5b19('0x4')]},'referer':{'type':Sequelize['TEXT']},'customerIp':{'type':Sequelize[_0x5b19('0x4')]},'formData':{'type':Sequelize[_0x5b19('0x3')](_0x5b19('0x6'))},'read1stAt':{'type':Sequelize[_0x5b19('0x5')]},'lastMsgAt':{'type':Sequelize['DATE']},'lastMsgDirection':{'type':Sequelize['ENUM']('in',_0x5b19('0x7')),'defaultValue':'in','allowNull':![]},'closeReason':{'type':Sequelize[_0x5b19('0x4')]},'customerPort':{'type':Sequelize[_0x5b19('0x4')]},'vidaooSessionId':{'type':Sequelize[_0x5b19('0x3')]},'autoreplyExecuted':{'type':Sequelize[_0x5b19('0x1')],'defaultValue':![]},'queueId':{'type':Sequelize[_0x5b19('0x8')]}}; \ No newline at end of file +var _0x8bf1=['STRING','long','DATE','BOOLEAN','INTEGER','ENUM','star','thumb','TEXT'];(function(_0x49b504,_0x556bec){var _0x5d2b0e=function(_0x2d27a4){while(--_0x2d27a4){_0x49b504['push'](_0x49b504['shift']());}};_0x5d2b0e(++_0x556bec);}(_0x8bf1,0x113));var _0x18bf=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x8bf1[_0x3dd15e];return _0x231fd0;};'use strict';var Sequelize=require('sequelize');module['exports']={'closed':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'ratingValue':{'type':Sequelize['INTEGER']},'ratingType':{'type':Sequelize[_0x18bf('0x0')](_0x18bf('0x1'),_0x18bf('0x2')),'defaultValue':'star'},'ratingMessage':{'type':Sequelize[_0x18bf('0x3')]},'pathTranscript':{'type':Sequelize[_0x18bf('0x3')]},'mailTranscript':{'type':Sequelize[_0x18bf('0x4')],'validate':{'isEmail':!![]}},'closedAt':{'type':Sequelize['DATE']},'disposition':{'type':Sequelize['STRING']},'secondDisposition':{'type':Sequelize[_0x18bf('0x4')]},'thirdDisposition':{'type':Sequelize[_0x18bf('0x4')]},'note':{'type':Sequelize[_0x18bf('0x4')]},'browserName':{'type':Sequelize['STRING']},'browserVersion':{'type':Sequelize['STRING']},'osName':{'type':Sequelize[_0x18bf('0x4')]},'osVersion':{'type':Sequelize[_0x18bf('0x4')]},'deviceModel':{'type':Sequelize[_0x18bf('0x4')]},'deviceVendor':{'type':Sequelize[_0x18bf('0x4')]},'deviceType':{'type':Sequelize[_0x18bf('0x4')]},'referer':{'type':Sequelize[_0x18bf('0x3')]},'customerIp':{'type':Sequelize[_0x18bf('0x4')]},'formData':{'type':Sequelize[_0x18bf('0x3')](_0x18bf('0x5'))},'read1stAt':{'type':Sequelize[_0x18bf('0x6')]},'lastMsgAt':{'type':Sequelize['DATE']},'lastMsgDirection':{'type':Sequelize[_0x18bf('0x0')]('in','out'),'defaultValue':'in','allowNull':![]},'closeReason':{'type':Sequelize[_0x18bf('0x4')]},'customerPort':{'type':Sequelize[_0x18bf('0x4')]},'vidaooSessionId':{'type':Sequelize[_0x18bf('0x3')]},'autoreplyExecuted':{'type':Sequelize[_0x18bf('0x7')],'defaultValue':![]},'queueId':{'type':Sequelize[_0x18bf('0x8')]}}; \ No newline at end of file diff --git a/server/api/chatInteraction/chatInteraction.controller.js b/server/api/chatInteraction/chatInteraction.controller.js index 54d373e..65e8327 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 _0x833b=['UserId','ValidationError','Interaction\x20already\x20assigned','closed','disposition','AbandonInteraction','attachmentUpload','file','originalname','basename','filename','mimetype','Attachment','attachmentDownload','attachId','ChatOfflineMessageId','join','root','offline-chat/','download','close','mailTranscript','server/files/chat/upload/','now','pathTranscript','Messages','User','CmContact','format','agentAlias','customer','%s%d','ContactId','agentIdentifier','website_alias','System','agent_alias','agent_fullname','[%s]\x20%s:\x20%s\x0a','createdAt','secret','appendFileSync','MailServerOut','Smtp','CloudProvider','SendMail','sendMail','\x22%s\x22\x20<%s>','addMessage','ids','omit','getMessages','keys','hasOwnProperty','order','sort','where','ChatInteractionId','filter','merge','$gte','split','YYYY-MM-DD\x20HH:mm:ss','rows','nolimit','pick','alias','setTags','spread','color','emit','chatInteractionTags:save','removeTags','unix','files','tmp','server','attachments','transcript-%d-%s.zip','push','Contact','lastName','read','Account','get','mkdirSync','Chat','Owner','N.A.','toString','closedAt','browserName','osName','referer','customerPort','tail','createReadStream','createWriteStream','direction','firstName','renderFile','downloadInteraction.ejs','transcript-','.pdf','createPdfFromHTML','err','unlinkSync','rimraf','zip-dir','moment','util','path','ejs','lodash','ioredis','../../components/interaction/service','../../components/parsers/qs','../../components/export/pdf','api','../../config/environment','../../mysqldb','redis','defaults','register','jayson/promise','client','http','then','ChatInteraction,\x20%s,\x20%s','debug','ChatInteraction,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','message','info','result','end','status','json','offset','undefined','limit','count','Content-Range','update','destroy','stack','contact','agent','interaction','index','map','ChatInteraction','rawAttributes','fieldName','type','key','findAll','chat','user','catch','show','params','model','query','filters','intersection','attributes','fields','length','includeAll','include','options','find','create','body','describe','createVidaooSession','ChatWebsite','findOne','ChatWebsiteId','vidaooApiKey','vidaooEscalation','vidaooTopic','vidaooMetadata','name','fullname','email','account','POST','https://api-vidaoo.xcally.com/api/v1/meetings','isNull','vidaooNote','follow','parse','metadata','Sequelize','Error\x20in\x20Vidaoo\x20configuration','out','ChatMessage','Unable\x20to\x20create\x20Vidaoo\x20session','updateAttributes','customUpdate','abandon','abandonInteraction,\x20%s,\x20%s,\x20%s','entity\x20not\x20found','sendStatus'];(function(_0x465e7c,_0x118e7b){var _0x3535f9=function(_0x8d182f){while(--_0x8d182f){_0x465e7c['push'](_0x465e7c['shift']());}};_0x3535f9(++_0x118e7b);}(_0x833b,0x13b));var _0xb833=function(_0x59ee6f,_0x450239){_0x59ee6f=_0x59ee6f-0x0;var _0x4c0979=_0x833b[_0x59ee6f];return _0x4c0979;};'use strict';var rimraf=require(_0xb833('0x0'));var zipdir=require(_0xb833('0x1'));var rp=require('request-promise');var moment=require(_0xb833('0x2'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0xb833('0x3'));var path=require(_0xb833('0x4'));var ejs=require(_0xb833('0x5'));var fs=require('fs');var _=require(_0xb833('0x6'));var Redis=require(_0xb833('0x7'));var interaction=require(_0xb833('0x8'));var qs=require(_0xb833('0x9'));var pdf=require(_0xb833('0xa'));var logger=require('../../config/logger')(_0xb833('0xb'));var config=require(_0xb833('0xc'));var db=require(_0xb833('0xd'))['db'];config[_0xb833('0xe')]=_[_0xb833('0xf')](config['redis'],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xb833('0xe')]));require('./chatInteraction.socket')[_0xb833('0x10')](socket);var jayson=require(_0xb833('0x11'));var client=jayson[_0xb833('0x12')][_0xb833('0x13')]({'port':0x232b});var client9004=jayson[_0xb833('0x12')][_0xb833('0x13')]({'port':0x232c});function respondWithRpcPromise(_0x4fac43,_0x51c6d4,_0x58cc25,_0x59a9d8){return new BPromise(function(_0xf4e4fa,_0x55f294){var _0x4db74c=_0x59a9d8||client;return _0x4db74c['request'](_0x4fac43,_0x58cc25)[_0xb833('0x14')](function(_0x1995e){logger['info'](_0xb833('0x15'),_0x51c6d4,'request\x20sent');logger[_0xb833('0x16')](_0xb833('0x17'),_0x51c6d4,_0xb833('0x18'),JSON[_0xb833('0x19')](_0x1995e));if(_0x1995e[_0xb833('0x1a')]){if(_0x1995e[_0xb833('0x1a')]['code']===0x1f4){logger[_0xb833('0x1a')](_0xb833('0x15'),_0x51c6d4,_0x1995e[_0xb833('0x1a')][_0xb833('0x1b')]);return _0x55f294(_0x1995e['error']['message']);}logger[_0xb833('0x1a')](_0xb833('0x15'),_0x51c6d4,_0x1995e[_0xb833('0x1a')][_0xb833('0x1b')]);return _0xf4e4fa(_0x1995e['error'][_0xb833('0x1b')]);}else{logger[_0xb833('0x1c')](_0xb833('0x15'),_0x51c6d4,'request\x20sent');_0xf4e4fa(_0x1995e[_0xb833('0x1d')][_0xb833('0x1b')]);}})['catch'](function(_0x3c1bc4){logger['error'](_0xb833('0x15'),_0x51c6d4,_0x3c1bc4);_0x55f294(_0x3c1bc4);});});}function respondWithStatusCode(_0x8ebb75,_0x4ac515){_0x4ac515=_0x4ac515||0xcc;return function(_0x16c871){if(_0x16c871){return _0x8ebb75['sendStatus'](_0x4ac515);}return _0x8ebb75['status'](_0x4ac515)[_0xb833('0x1e')]();};}function respondWithResult(_0x2fb6d8,_0x4dcf0d){_0x4dcf0d=_0x4dcf0d||0xc8;return function(_0x5ef3a0){if(_0x5ef3a0){return _0x2fb6d8[_0xb833('0x1f')](_0x4dcf0d)[_0xb833('0x20')](_0x5ef3a0);}};}function respondWithFilteredResult(_0xf2a9c9,_0x51aa19){return function(_0x4c827f){if(_0x4c827f){var _0x1fa532=typeof _0x51aa19[_0xb833('0x21')]===_0xb833('0x22')&&typeof _0x51aa19[_0xb833('0x23')]===_0xb833('0x22');var _0x1acd4a=_0x4c827f['count'];var _0x28e5ae=_0x1fa532?0x0:_0x51aa19[_0xb833('0x21')];var _0x31f5c4=_0x1fa532?_0x4c827f[_0xb833('0x24')]:_0x51aa19[_0xb833('0x21')]+_0x51aa19[_0xb833('0x23')];var _0x515ec5;if(_0x31f5c4>=_0x1acd4a){_0x31f5c4=_0x1acd4a;_0x515ec5=0xc8;}else{_0x515ec5=0xce;}_0xf2a9c9[_0xb833('0x1f')](_0x515ec5);return _0xf2a9c9['set'](_0xb833('0x25'),_0x28e5ae+'-'+_0x31f5c4+'/'+_0x1acd4a)[_0xb833('0x20')](_0x4c827f);}return null;};}function saveUpdates(_0x12be8e){return function(_0x42a89b){if(_0x42a89b){return _0x42a89b[_0xb833('0x26')](_0x12be8e)[_0xb833('0x14')](function(_0x310b66){return _0x310b66;});}return null;};}function removeEntity(_0xbd2c75){return function(_0x56da9d){if(_0x56da9d){return _0x56da9d[_0xb833('0x27')]()[_0xb833('0x14')](function(){_0xbd2c75[_0xb833('0x1f')](0xcc)[_0xb833('0x1e')]();});}};}function handleEntityNotFound(_0x470ed6){return function(_0x7d023c){if(!_0x7d023c){_0x470ed6['sendStatus'](0x194);}return _0x7d023c;};}function handleError(_0x1201cf,_0x2bee99){_0x2bee99=_0x2bee99||0x1f4;return function(_0x1e6b2c){logger[_0xb833('0x1a')](_0x1e6b2c[_0xb833('0x28')]);if(_0x1e6b2c['name']){delete _0x1e6b2c['name'];}_0x1201cf[_0xb833('0x1f')](_0x2bee99)['send'](_0x1e6b2c);};}function getMustacheRender(_0x7cc2b9,_0x16acca){return Mustache['render'](_0x7cc2b9,_['merge'](_0x16acca['body'],{'contact':_0x16acca[_0xb833('0x29')],'message':_0x16acca['message'],'agent':_0x16acca[_0xb833('0x2a')],'interaction':_0x16acca[_0xb833('0x2b')],'account':_0x16acca['account']}))||'';}exports[_0xb833('0x2c')]=function(_0x34d610,_0x4dfb66){var _0x1bee57={};var _0x44d976=_[_0xb833('0x2d')](db[_0xb833('0x2e')][_0xb833('0x2f')],function(_0x307bc1){return{'name':_0x307bc1[_0xb833('0x30')],'type':_0x307bc1[_0xb833('0x31')][_0xb833('0x32')]};});_0x1bee57=qs['getOptions'](_0x44d976,_0x34d610);return interaction[_0xb833('0x33')](_0xb833('0x34'),_0x34d610['query'],_0x34d610[_0xb833('0x35')],_0x1bee57,_0x44d976)[_0xb833('0x14')](respondWithFilteredResult(_0x4dfb66,_0x1bee57))[_0xb833('0x36')](handleError(_0x4dfb66,null));};exports[_0xb833('0x37')]=function(_0x44121e,_0x114d02){var _0x558157={'raw':![],'where':{'id':_0x44121e[_0xb833('0x38')]['id']}},_0x7b4612={};_0x7b4612[_0xb833('0x39')]=_['keys'](db['ChatInteraction'][_0xb833('0x2f')]);_0x7b4612[_0xb833('0x3a')]=_['keys'](_0x44121e[_0xb833('0x3a')]);_0x7b4612[_0xb833('0x3b')]=_[_0xb833('0x3c')](_0x7b4612[_0xb833('0x39')],_0x7b4612[_0xb833('0x3a')]);_0x558157[_0xb833('0x3d')]=_[_0xb833('0x3c')](_0x7b4612['model'],qs[_0xb833('0x3e')](_0x44121e[_0xb833('0x3a')][_0xb833('0x3e')]));_0x558157[_0xb833('0x3d')]=_0x558157[_0xb833('0x3d')][_0xb833('0x3f')]?_0x558157[_0xb833('0x3d')]:_0x7b4612[_0xb833('0x39')];if(_0x44121e[_0xb833('0x3a')][_0xb833('0x40')]){_0x558157[_0xb833('0x41')]=[{'all':!![]}];}_0x558157=_['merge']({},_0x558157,_0x44121e[_0xb833('0x42')]);return db['ChatInteraction'][_0xb833('0x43')](_0x558157)[_0xb833('0x14')](handleEntityNotFound(_0x114d02,null))[_0xb833('0x14')](respondWithResult(_0x114d02,null))[_0xb833('0x36')](handleError(_0x114d02,null));};exports[_0xb833('0x44')]=function(_0x2b21cd,_0x47b5f4){return db[_0xb833('0x2e')][_0xb833('0x44')](_0x2b21cd['body'],{})[_0xb833('0x14')](respondWithResult(_0x47b5f4,0xc9))[_0xb833('0x36')](handleError(_0x47b5f4,null));};exports[_0xb833('0x26')]=function(_0x16eefa,_0xa4ba08){if(_0x16eefa['body']['id']){delete _0x16eefa[_0xb833('0x45')]['id'];}return db[_0xb833('0x2e')]['find']({'where':{'id':_0x16eefa[_0xb833('0x38')]['id']}})[_0xb833('0x14')](handleEntityNotFound(_0xa4ba08,null))['then'](saveUpdates(_0x16eefa[_0xb833('0x45')],null))[_0xb833('0x14')](respondWithResult(_0xa4ba08,null))['catch'](handleError(_0xa4ba08,null));};exports[_0xb833('0x27')]=function(_0x1501ff,_0x619b97){return db['ChatInteraction'][_0xb833('0x43')]({'where':{'id':_0x1501ff['params']['id']}})[_0xb833('0x14')](handleEntityNotFound(_0x619b97,null))[_0xb833('0x14')](removeEntity(_0x619b97,null))['catch'](handleError(_0x619b97,null));};exports[_0xb833('0x46')]=function(_0x34463c,_0x3f158f){return db[_0xb833('0x2e')][_0xb833('0x46')]()[_0xb833('0x14')](respondWithResult(_0x3f158f,null))['catch'](handleError(_0x3f158f,null));};exports[_0xb833('0x47')]=function(_0x3c1231,_0x2bf41f){var _0x3c2ba1=_0x3c1231[_0xb833('0x38')]['id'];var _0xeb7726;var _0x3984a9;var _0x261215;return db[_0xb833('0x2e')]['findOne']({'where':{'id':_0x3c2ba1}})[_0xb833('0x14')](function(_0x5749e2){_0xeb7726=_0x5749e2;return db[_0xb833('0x48')][_0xb833('0x49')]({'where':{'id':_0x5749e2[_0xb833('0x4a')]},'attributes':['id',_0xb833('0x4b'),_0xb833('0x4c'),_0xb833('0x4d'),'vidaooNote',_0xb833('0x4e')],'raw':!![]});})[_0xb833('0x14')](function(_0x2fedd6){if(_0x2fedd6&&_0x2fedd6[_0xb833('0x4b')]&&_0x2fedd6[_0xb833('0x4c')]){_0x3984a9=_0x2fedd6;var _0x18aa17={'interaction':{'id':_0x3c2ba1},'agent':{'id':_0x3c1231[_0xb833('0x35')]['id'],'name':_0x3c1231[_0xb833('0x35')][_0xb833('0x4f')],'fullname':_0x3c1231['user'][_0xb833('0x50')],'email':_0x3c1231[_0xb833('0x35')][_0xb833('0x51')]},'contact':_0x3c1231['body']['contact'],'account':_0x3c1231['body'][_0xb833('0x52')]};var _0x397179={'rejectUnauthorized':![],'method':_0xb833('0x53'),'url':_0xb833('0x54'),'headers':{'X-APIKEY':_0x2fedd6[_0xb833('0x4b')]},'body':{'duration':null,'scheduledAt':null,'participants':[_0x3c1231[_0xb833('0x35')][_0xb833('0x51')]],'buttons':null,'topic':_0x3984a9[_0xb833('0x4d')],'note':_[_0xb833('0x55')](_0x3984a9[_0xb833('0x56')])?null:getMustacheRender(_0x3984a9['vidaooNote'],_0x18aa17),'metadata':null},'redirect':_0xb833('0x57'),'json':!![]};try{if(!_[_0xb833('0x55')](_0x3984a9[_0xb833('0x4e')])){var _0x599691=getMustacheRender(_0x3984a9[_0xb833('0x4e')],_0x18aa17);var _0x10d90e=JSON[_0xb833('0x58')](_0x599691);_0x397179[_0xb833('0x45')][_0xb833('0x59')]=_0x10d90e;}}catch(_0x302d8c){throw new db[(_0xb833('0x5a'))]['ValidationError']('Error\x20in\x20conversion\x20vidaooMetadata');}return rp(_0x397179);}else{throw new db[(_0xb833('0x5a'))]['ValidationError'](_0xb833('0x5b'));}})[_0xb833('0x14')](function(_0x205658){_0x261215=_0x205658;if(_0x261215['id']){var _0x3d05e1={'body':_0x261215['join_url'],'ChatWebsiteId':_0x3984a9['id'],'ChatInteractionId':_0xeb7726['id'],'direction':_0xb833('0x5c'),'UserId':_0x3c1231[_0xb833('0x35')]['id']};return db[_0xb833('0x5d')][_0xb833('0x44')](_0x3d05e1,{});}else{throw new db['Sequelize']['ValidationError'](_0xb833('0x5e'));}})[_0xb833('0x14')](function(){return _0xeb7726[_0xb833('0x5f')]({'vidaooSessionId':_0x261215['id']});})[_0xb833('0x14')](respondWithResult(_0x2bf41f,null))[_0xb833('0x36')](handleError(_0x2bf41f,null));};exports[_0xb833('0x60')]=function(_0x508b0e,_0x3e5f1e){if(_0x508b0e[_0xb833('0x45')]['id']){delete _0x508b0e[_0xb833('0x45')]['id'];}return db[_0xb833('0x2e')][_0xb833('0x43')]({'where':{'id':_0x508b0e[_0xb833('0x38')]['id']},'include':[{'model':db['CmContact'],'as':'Contact'}]})[_0xb833('0x14')](handleEntityNotFound(_0x3e5f1e,null))[_0xb833('0x14')](saveUpdates(_0x508b0e['body'],null))[_0xb833('0x14')](respondWithResult(_0x3e5f1e,null))[_0xb833('0x36')](handleError(_0x3e5f1e,null));};exports[_0xb833('0x61')]=function(_0x16272d,_0x51faea){if(_0x16272d[_0xb833('0x45')]['id']){delete _0x16272d[_0xb833('0x45')]['id'];}return db[_0xb833('0x2e')][_0xb833('0x43')]({'where':{'id':_0x16272d['params']['id']}})[_0xb833('0x14')](function(_0x46a993){if(!_0x46a993){logger['error'](_0xb833('0x62'),_0xb833('0x61'),0x194,_0xb833('0x63'));_0x51faea[_0xb833('0x64')](0x194);}else{if(_0x46a993[_0xb833('0x65')]){throw new db['Sequelize'][(_0xb833('0x66'))](_0xb833('0x67'));}}return _0x46a993;})[_0xb833('0x14')](function(_0x3c81f3){if(_0x3c81f3){return _0x3c81f3[_0xb833('0x26')]({'closed':_0x16272d[_0xb833('0x45')][_0xb833('0x68')],'disposition':_0x16272d[_0xb833('0x45')][_0xb833('0x69')]})[_0xb833('0x14')](function(_0x342d32){return _0x342d32;});}})[_0xb833('0x14')](function(){return respondWithRpcPromise(_0xb833('0x6a'),_0xb833('0x61'),_0x16272d[_0xb833('0x45')],client9004);})[_0xb833('0x14')](respondWithResult(_0x51faea,null))[_0xb833('0x36')](handleError(_0x51faea,null));};exports[_0xb833('0x6b')]=function(_0x4edeac,_0x5e0bc1){_0x4edeac[_0xb833('0x45')][_0xb833('0x4f')]=_0x4edeac[_0xb833('0x6c')][_0xb833('0x6d')];_0x4edeac['body'][_0xb833('0x6e')]=_0x4edeac['file'][_0xb833('0x6f')];_0x4edeac['body'][_0xb833('0x31')]=_0x4edeac['file'][_0xb833('0x70')];return db[_0xb833('0x71')][_0xb833('0x44')](_0x4edeac['body'])[_0xb833('0x14')](respondWithResult(_0x5e0bc1,0xc9))['catch'](handleError(_0x5e0bc1,null));};exports[_0xb833('0x72')]=function(_0x452cc5,_0x36aa23){return db['ChatInteraction'][_0xb833('0x49')]({'where':{'id':_0x452cc5['params']['id']},'raw':!![]})[_0xb833('0x14')](handleEntityNotFound(_0x36aa23,null))[_0xb833('0x14')](function(_0x323748){if(_0x323748){if(_0x323748['closed']){return _0x36aa23[_0xb833('0x1f')](0x193)[_0xb833('0x20')]({'status':0x193,'message':'Unauthorized'});}return db[_0xb833('0x71')][_0xb833('0x49')]({'where':{'id':_0x452cc5[_0xb833('0x3a')][_0xb833('0x73')]},'raw':!![]})['then'](handleEntityNotFound(_0x36aa23,null));}})['then'](function(_0x5bd92d){if(_0x5bd92d){var _0x4503e6=_0x5bd92d[_0xb833('0x74')]!==null;var _0x4c7eaf=path[_0xb833('0x75')](config[_0xb833('0x76')],'server/files/attachments/');if(_0x4503e6){_0x4c7eaf=path[_0xb833('0x75')](_0x4c7eaf,_0xb833('0x77'));}var _0xc1d8e=path[_0xb833('0x75')](_0x4c7eaf,_0x5bd92d[_0xb833('0x6e')]);return _0x36aa23[_0xb833('0x78')](_0xc1d8e);}})[_0xb833('0x36')](handleError(_0x36aa23,null));};exports[_0xb833('0x79')]=function(_0x1693e0,_0x36e3ed){var _0x4235d7=null;var _0x12457c=null;var _0x44cb1f=null;if(_0x1693e0[_0xb833('0x45')]['id']){delete _0x1693e0[_0xb833('0x45')]['id'];}if(_0x1693e0[_0xb833('0x45')][_0xb833('0x7a')]){_0x44cb1f=path[_0xb833('0x75')](config[_0xb833('0x76')],_0xb833('0x7b'),util['format']('transcript-%s.txt',Date[_0xb833('0x7c')]()));_0x1693e0[_0xb833('0x45')][_0xb833('0x7d')]=_0x44cb1f;}return db[_0xb833('0x2e')][_0xb833('0x43')]({'where':{'id':_0x1693e0['params']['id']},'include':[{'model':db[_0xb833('0x5d')],'as':_0xb833('0x7e'),'include':[{'model':db['User'],'as':_0xb833('0x7f')}]}]})[_0xb833('0x14')](handleEntityNotFound(_0x36e3ed,null))[_0xb833('0x14')](saveUpdates(_0x1693e0[_0xb833('0x45')],null))[_0xb833('0x14')](function(_0x277c68){if(_0x277c68){_0x4235d7=_0x277c68;return db[_0xb833('0x48')][_0xb833('0x43')]({'where':{'id':_0x4235d7[_0xb833('0x4a')]}});}})['then'](function(_0x5cc510){if(_0x5cc510){_0x12457c=_0x5cc510;return db[_0xb833('0x80')][_0xb833('0x43')]({'where':{'id':_0x4235d7['ContactId']}});}})[_0xb833('0x14')](function(_0x59574f){if(_0x59574f){if(_0x44cb1f){var _0x1dc431=null;for(var _0x5313f9=0x1;_0x5313f9<_0x4235d7[_0xb833('0x7e')][_0xb833('0x3f')];++_0x5313f9){_0x1dc431=_0x4235d7['Messages'][_0x5313f9];var _0x103457=_0x1dc431['UserId']?util[_0xb833('0x81')]('%s%d',_0x12457c[_0xb833('0x82')],_0x1dc431[_0xb833('0x65')]):'System';var _0x428e71=_0x1693e0[_0xb833('0x45')][_0xb833('0x83')]||util[_0xb833('0x81')](_0xb833('0x84'),'Visitor',_0x1dc431[_0xb833('0x85')]);switch(_0x12457c[_0xb833('0x86')]){case _0xb833('0x87'):_0x103457=_0x1dc431['UserId']?util[_0xb833('0x81')](_0xb833('0x84'),_0x12457c['agentAlias'],_0x1dc431[_0xb833('0x65')]):_0xb833('0x88');break;case _0xb833('0x89'):_0x103457=_0x1dc431[_0xb833('0x65')]?_0x1dc431[_0xb833('0x7f')]['alias']||_0x1dc431[_0xb833('0x7f')][_0xb833('0x50')]:_0xb833('0x88');break;case _0xb833('0x8a'):_0x103457=_0x1dc431[_0xb833('0x65')]?_0x1dc431[_0xb833('0x7f')]['fullname']:'System';break;default:_0x103457=_0x1dc431[_0xb833('0x65')]?util[_0xb833('0x81')]('%s%d',_0x12457c[_0xb833('0x82')],_0x1dc431[_0xb833('0x65')]):_0xb833('0x88');}var _0x13d8eb=util[_0xb833('0x81')](_0xb833('0x8b'),moment(_0x1dc431[_0xb833('0x8c')])[_0xb833('0x81')]('MM/DD/YYYY\x20HH:mm:ss'),_0x1dc431['direction']==='in'?_0x428e71:_0x103457,_0x1dc431[_0xb833('0x45')]);if(!_0x1dc431[_0xb833('0x8d')]){fs[_0xb833('0x8e')](_0x44cb1f,_0x13d8eb);}}return db['MailAccount']['findOne']({'where':{'service':!![]},'include':[{'model':db[_0xb833('0x8f')],'as':_0xb833('0x90'),'raw':!![],'include':[{'model':db[_0xb833('0x91')],'as':'CloudProvider','raw':!![]}]}]});}}})[_0xb833('0x14')](function(_0x105f25){if(!_0x105f25||!_0x105f25[_0xb833('0x90')]||!_0x1693e0['body'])return _0x4235d7;var _0x4fd304=_0x105f25['getSmtpOptions']();return respondWithRpcPromise(_0xb833('0x92'),_0xb833('0x93'),{'account':_0x4fd304,'message':{'from':util[_0xb833('0x81')](_0xb833('0x94'),_0x105f25['name'],_0x105f25['email']||_0x105f25['Smtp'][_0xb833('0x35')]),'to':_0x1693e0[_0xb833('0x45')][_0xb833('0x7a')],'subject':'Mail\x20Transcript','text':util[_0xb833('0x81')]('Hi\x20%s,\x20attached\x20you\x20can\x20find\x20your\x20transcript\x20file.\x20\x0a\x0aRegards.\x20\x0a\x0a',_0x1693e0['body'][_0xb833('0x7a')]),'attachments':[{'path':_0x44cb1f}]}})[_0xb833('0x14')](function(){return _0x4235d7;})[_0xb833('0x36')](function(_0x46f45f){logger[_0xb833('0x1a')](_0x46f45f);});})[_0xb833('0x14')](respondWithStatusCode(_0x36e3ed,0xc8))[_0xb833('0x36')](handleError(_0x36e3ed,null));};exports[_0xb833('0x95')]=function(_0x927fc,_0x1f2d53){return db[_0xb833('0x5d')]['find']({'where':{'id':_0x927fc['params']['id']}})[_0xb833('0x14')](handleEntityNotFound(_0x1f2d53,null))[_0xb833('0x14')](function(_0x2c7e5b){if(_0x2c7e5b){return _0x2c7e5b['addMessage'](_0x927fc[_0xb833('0x45')][_0xb833('0x96')],_[_0xb833('0x97')](_0x927fc[_0xb833('0x45')],[_0xb833('0x96'),'id'])||{});}})['then'](respondWithResult(_0x1f2d53,null))[_0xb833('0x36')](handleError(_0x1f2d53,null));};exports[_0xb833('0x98')]=function(_0xd8d92b,_0x57c252){var _0x101360={'raw':![],'where':{}};var _0x1b9730={};var _0x170e79={'count':0x0,'rows':[]};return db[_0xb833('0x2e')][_0xb833('0x49')]({'where':{'id':_0xd8d92b['params']['id']}})[_0xb833('0x14')](handleEntityNotFound(_0x57c252,null))[_0xb833('0x14')](function(_0x33df35){if(_0x33df35){_0x1b9730[_0xb833('0x39')]=_[_0xb833('0x99')](db[_0xb833('0x5d')][_0xb833('0x2f')]);_0x1b9730['query']=_[_0xb833('0x99')](_0xd8d92b[_0xb833('0x3a')]);_0x1b9730[_0xb833('0x3b')]=_[_0xb833('0x3c')](_0x1b9730['model'],_0x1b9730[_0xb833('0x3a')]);_0x101360[_0xb833('0x3d')]=_[_0xb833('0x3c')](_0x1b9730[_0xb833('0x39')],qs[_0xb833('0x3e')](_0xd8d92b[_0xb833('0x3a')][_0xb833('0x3e')]));_0x101360[_0xb833('0x3d')]=_0x101360[_0xb833('0x3d')][_0xb833('0x3f')]?_0x101360[_0xb833('0x3d')]:_0x1b9730[_0xb833('0x39')];if(!_0xd8d92b['query'][_0xb833('0x9a')]('nolimit')){_0x101360[_0xb833('0x23')]=qs[_0xb833('0x23')](_0xd8d92b['query'][_0xb833('0x23')]);_0x101360[_0xb833('0x21')]=qs['offset'](_0xd8d92b[_0xb833('0x3a')]['offset']);}_0x101360[_0xb833('0x9b')]=qs[_0xb833('0x9c')](_0xd8d92b[_0xb833('0x3a')][_0xb833('0x9c')]);_0x101360[_0xb833('0x9d')]=qs[_0xb833('0x3b')](_['pick'](_0xd8d92b[_0xb833('0x3a')],_0x1b9730[_0xb833('0x3b')]));_0x101360[_0xb833('0x9d')][_0xb833('0x9e')]=_0x33df35['id'];if(_0xd8d92b[_0xb833('0x3a')][_0xb833('0x9f')]){_0x101360[_0xb833('0x9d')]=_[_0xb833('0xa0')](_0x101360['where'],{'$or':_[_0xb833('0x2d')](_0x101360['attributes'],function(_0x262f89){var _0x18ec5c={};_0x18ec5c[_0x262f89]={'$like':'%'+_0xd8d92b[_0xb833('0x3a')][_0xb833('0x9f')]+'%'};return _0x18ec5c;})});}if(_0xd8d92b[_0xb833('0x3a')]['$gte']){var _0x576f25=_0xd8d92b[_0xb833('0x3a')][_0xb833('0xa1')][_0xb833('0xa2')](',');var _0x4e04f6={};_0x4e04f6[_0x576f25[0x0]]={'$gte':moment(_0x576f25[0x1])[_0xb833('0x81')](_0xb833('0xa3'))};_0x101360[_0xb833('0x9d')]=_[_0xb833('0xa0')](_0x101360[_0xb833('0x9d')],_0x4e04f6);}_0x101360=_[_0xb833('0xa0')]({},_0x101360,_0xd8d92b['options']);return db[_0xb833('0x5d')][_0xb833('0x24')]({'where':_0x101360[_0xb833('0x9d')]})[_0xb833('0x14')](function(_0x3d41a6){_0x170e79[_0xb833('0x24')]=_0x3d41a6;if(_0xd8d92b[_0xb833('0x3a')][_0xb833('0x40')]){_0x101360['include']=[{'all':!![]}];}return db[_0xb833('0x5d')][_0xb833('0x33')](_0x101360);})[_0xb833('0x14')](function(_0x26858a){_0x170e79[_0xb833('0xa4')]=_0x26858a;return _0x170e79;});}})[_0xb833('0x14')](respondWithFilteredResult(_0x57c252,_0x101360))[_0xb833('0x36')](handleError(_0x57c252,null));};exports['getMyMessages']=function(_0x4c9e9e,_0x41d48f){var _0x18c603={'where':{}},_0x21f27a={},_0x4daa4d={'count':0x0,'rows':[]};return db[_0xb833('0x2e')][_0xb833('0x49')]({'where':{'id':_0x4c9e9e[_0xb833('0x38')]['id']}})[_0xb833('0x14')](handleEntityNotFound(_0x41d48f,null))[_0xb833('0x14')](function(_0x4f04c4){if(_0x4f04c4){_0x21f27a[_0xb833('0x39')]=_[_0xb833('0x99')](db[_0xb833('0x5d')][_0xb833('0x2f')]);_0x21f27a[_0xb833('0x3a')]=_[_0xb833('0x99')](_0x4c9e9e['query']);_0x21f27a[_0xb833('0x3b')]=_[_0xb833('0x3c')](_0x21f27a[_0xb833('0x39')],_0x21f27a[_0xb833('0x3a')]);_0x18c603['attributes']=_[_0xb833('0x3c')](_0x21f27a[_0xb833('0x39')],qs[_0xb833('0x3e')](_0x4c9e9e[_0xb833('0x3a')]['fields']));_0x18c603[_0xb833('0x3d')]=_0x18c603[_0xb833('0x3d')]['length']?_0x18c603['attributes']:_0x21f27a[_0xb833('0x39')];if(!_0x4c9e9e[_0xb833('0x3a')][_0xb833('0x9a')](_0xb833('0xa5'))){_0x18c603[_0xb833('0x23')]=qs[_0xb833('0x23')](_0x4c9e9e[_0xb833('0x3a')][_0xb833('0x23')]);_0x18c603['offset']=qs['offset'](_0x4c9e9e[_0xb833('0x3a')][_0xb833('0x21')]);}_0x18c603[_0xb833('0x9b')]=qs[_0xb833('0x9c')](_0x4c9e9e[_0xb833('0x3a')][_0xb833('0x9c')]);_0x18c603[_0xb833('0x9d')]=qs[_0xb833('0x3b')](_[_0xb833('0xa6')](_0x4c9e9e[_0xb833('0x3a')],_0x21f27a[_0xb833('0x3b')]));_0x18c603[_0xb833('0x9d')][_0xb833('0x9e')]=_0x4f04c4['id'];if(_0x4c9e9e[_0xb833('0x3a')][_0xb833('0x9f')]){_0x18c603[_0xb833('0x9d')]=_[_0xb833('0xa0')](_0x18c603['where'],{'$or':_[_0xb833('0x2d')](_0x18c603[_0xb833('0x3d')],function(_0x323512){var _0x51d0a5={};_0x51d0a5[_0x323512]={'$like':'%'+_0x4c9e9e[_0xb833('0x3a')][_0xb833('0x9f')]+'%'};return _0x51d0a5;})});}_0x18c603['where']['secret']=![];if(_0x4c9e9e[_0xb833('0x3a')]['id']){_0x18c603['where']['id']={'$gt':_0x4c9e9e[_0xb833('0x3a')]['id']};}_0x18c603=_['merge']({},_0x18c603,_0x4c9e9e[_0xb833('0x42')]);return db['ChatMessage']['count']({'where':_0x18c603['where']})[_0xb833('0x14')](function(_0x2bd17f){_0x4daa4d[_0xb833('0x24')]=_0x2bd17f;_0x18c603[_0xb833('0x41')]=[];if(_0x4c9e9e['query']['includeAgent']){_0x18c603['include']['push']({'model':db[_0xb833('0x7f')],'as':_0xb833('0x7f'),'attributes':['id',_0xb833('0x50'),_0xb833('0xa7')]});}if(_0x4c9e9e[_0xb833('0x3a')][_0xb833('0x40')]){_0x18c603[_0xb833('0x41')]=[{'all':!![]}];}return db[_0xb833('0x5d')]['findAll'](_0x18c603);})[_0xb833('0x14')](function(_0x39f7b7){_0x4daa4d[_0xb833('0xa4')]=_0x39f7b7;return _0x4daa4d;});}})[_0xb833('0x14')](respondWithFilteredResult(_0x41d48f,_0x18c603))[_0xb833('0x36')](handleError(_0x41d48f,null));};exports['addTags']=function(_0x148a72,_0x4a1ff4){return db[_0xb833('0x2e')][_0xb833('0x43')]({'where':{'id':_0x148a72[_0xb833('0x38')]['id']}})[_0xb833('0x14')](handleEntityNotFound(_0x4a1ff4,null))[_0xb833('0x14')](function(_0x1b6c1e){if(_0x1b6c1e){return _0x1b6c1e[_0xb833('0xa8')](_0x148a72[_0xb833('0x45')][_0xb833('0x96')],_[_0xb833('0x97')](_0x148a72[_0xb833('0x45')],[_0xb833('0x96'),'id'])||{})[_0xb833('0xa9')](function(){return db['Tag'][_0xb833('0x33')]({'attributes':['id',_0xb833('0x4f'),_0xb833('0xaa')],'where':{'id':_0x148a72[_0xb833('0x45')][_0xb833('0x96')]}});})[_0xb833('0x14')](function(_0x4c692c){socket[_0xb833('0xab')](_0xb833('0xac'),{'id':Number(_0x148a72[_0xb833('0x38')]['id']),'tags':_0x4c692c||[]});return{'id':Number(_0x148a72[_0xb833('0x38')]['id']),'tags':_0x4c692c||[]};});}})[_0xb833('0x14')](respondWithResult(_0x4a1ff4,null))['catch'](handleError(_0x4a1ff4,null));};exports['removeTags']=function(_0x3a39fe,_0x50993b){return db[_0xb833('0x2e')]['find']({'where':{'id':_0x3a39fe['params']['id']}})[_0xb833('0x14')](handleEntityNotFound(_0x50993b,null))[_0xb833('0x14')](function(_0x1102e9){if(_0x1102e9){return _0x1102e9[_0xb833('0xad')](_0x3a39fe['query'][_0xb833('0x96')]);}})[_0xb833('0x14')](respondWithStatusCode(_0x50993b,null))['catch'](handleError(_0x50993b,null));};exports['download']=function(_0x22c6ce,_0x1c98d0){var _0xb4f9f=moment()[_0xb833('0xae')]()['toString']();var _0x34401c=path[_0xb833('0x75')](config[_0xb833('0x76')],'server',_0xb833('0xaf'),_0xb833('0xb0'));var _0x1c003f=path['join'](config[_0xb833('0x76')],_0xb833('0xb1'),_0xb833('0xaf'),_0xb833('0xb2'));var _0x55fa01=path['join'](_0x34401c,_0xb4f9f);var _0x28d324=util[_0xb833('0x81')](_0xb833('0xb3'),_0x22c6ce[_0xb833('0x38')]['id'],_0xb4f9f);var _0x402462=path['join'](_0x34401c,_0x28d324);var _0x4ba028=[];_0x4ba028['push']({'model':db['User'],'as':'User','attributes':['id',_0xb833('0x50')],'raw':!![]});_0x4ba028[_0xb833('0xb4')]({'model':db[_0xb833('0x80')],'as':_0xb833('0xb5'),'attributes':['id','firstName',_0xb833('0xb6')],'raw':!![]});if(_0x22c6ce[_0xb833('0x3a')]['attachments']){_0x4ba028[_0xb833('0xb4')]({'model':db[_0xb833('0x71')],'as':_0xb833('0x71'),'raw':!![]});}var _0xaa6ace=[{'model':db['ChatMessage'],'as':'Messages','attributes':['id',_0xb833('0x45'),'createdAt','direction',_0xb833('0x8d'),_0xb833('0xb7')],'include':_0x4ba028}];_0xaa6ace[_0xb833('0xb4')]({'model':db['ChatWebsite'],'as':_0xb833('0xb8'),'attributes':['id','name']});_0xaa6ace[_0xb833('0xb4')]({'model':db[_0xb833('0x7f')],'as':'Owner','attributes':['id',_0xb833('0x50')]});return db[_0xb833('0x2e')][_0xb833('0x43')]({'where':{'id':_0x22c6ce[_0xb833('0x38')]['id']},'include':_0xaa6ace})[_0xb833('0x14')](handleEntityNotFound(_0x1c98d0,null))[_0xb833('0x14')](function(_0x5c4fd6){if(_0x5c4fd6){var _0x57b908=_0x5c4fd6[_0xb833('0xb9')]({'plain':!![]});fs[_0xb833('0xba')](_0x55fa01);var _0x568d9c={'channel':_0xb833('0xbb'),'account':_0x57b908[_0xb833('0xb8')][_0xb833('0x4f')],'agent':_0x57b908[_0xb833('0xbc')]?_0x57b908['Owner'][_0xb833('0x50')]:_0xb833('0xbd'),'createdAt':moment(_0x57b908[_0xb833('0x8c')])[_0xb833('0x81')](_0xb833('0xa3'))[_0xb833('0xbe')](),'closedAt':_0x57b908[_0xb833('0x68')]?moment(_0x57b908[_0xb833('0xbf')])[_0xb833('0x81')]('YYYY-MM-DD\x20HH:mm:ss')[_0xb833('0xbe')]():'','disposition':_0x57b908[_0xb833('0x69')],'chatInfo':{'browser':_0x57b908[_0xb833('0xc0')],'os':_0x57b908[_0xb833('0xc1')],'referer':_0x57b908[_0xb833('0xc2')],'customerIp':_0x57b908['customerIp'],'customerPort':_0x57b908['customerPort']?_0x57b908[_0xb833('0xc3')]:_0xb833('0xbd')},'messages':_(_0x57b908[_0xb833('0x7e')])[_0xb833('0xc4')]()['filter']({'secret':![]})['map'](function(_0x36a7f9){if(_0x36a7f9[_0xb833('0x71')]){var _0x389d01=path['join'](_0x1c003f,_0x36a7f9[_0xb833('0x71')][_0xb833('0x6e')]);if(fs['existsSync'](_0x389d01)){fs[_0xb833('0xc5')](_0x389d01)['pipe'](fs[_0xb833('0xc6')](path[_0xb833('0x75')](_0x55fa01,_0x36a7f9['Attachment']['basename'])));}}return{'date':moment(_0x36a7f9[_0xb833('0x8c')])[_0xb833('0x81')]('YYYY-MM-DD\x20HH:mm:ss')[_0xb833('0xbe')](),'sender':_0x36a7f9[_0xb833('0xc7')]===_0xb833('0x5c')?_0x36a7f9[_0xb833('0x7f')]?_0x36a7f9['User']['fullname']:_0xb833('0x88'):_0x36a7f9[_0xb833('0xb5')][_0xb833('0xc8')]+(_0x36a7f9['Contact'][_0xb833('0xb6')]?'\x20'+_0x36a7f9['Contact'][_0xb833('0xb6')]:''),'body':_0x36a7f9[_0xb833('0x71')]?_0x36a7f9[_0xb833('0x71')][_0xb833('0x6e')]:_0x36a7f9[_0xb833('0x45')],'direction':_0x36a7f9['direction']===_0xb833('0x5c')?'A':'C','secret':_0x36a7f9['secret'],'read':_0x36a7f9[_0xb833('0xb7')],'attachment':_0x36a7f9[_0xb833('0x71')]};})['value']()};return ejs[_0xb833('0xc9')](path[_0xb833('0x75')](config[_0xb833('0x76')],_0xb833('0xb1'),'views',_0xb833('0xca')),{'interaction':_0x568d9c})['then'](function(_0x2e9b8e){var _0x4fc710=path['join'](_0x55fa01,_0xb833('0xcb')+_0x57b908['id']+'-'+_0xb4f9f+_0xb833('0xcc'));var _0x309125={'path':_0x4fc710,'channel':_0xb833('0xbb'),'interactionId':_0x57b908['id']};return pdf[_0xb833('0xcd')](_0x2e9b8e,_0x309125);})[_0xb833('0x14')](function(){return new Promise(function(_0x553313,_0x2a9e9f){zipdir(_0x55fa01,{'saveTo':_0x402462},function(_0x39f6b7,_0x22beb7){if(_0x39f6b7)return _0x2a9e9f(_0x39f6b7);return _0x553313(_0x22beb7);});})[_0xb833('0x14')](function(){return new BPromise(function(_0x42da58,_0x2e7c18){rimraf(_0x55fa01,function(_0x1b2d2c){if(_0x1b2d2c)_0x2e7c18(_0x1b2d2c);return _0x42da58();});});})[_0xb833('0x14')](function(){return _0x1c98d0[_0xb833('0x78')](_0x402462,_0x28d324,function(_0x235be5){if(_0x235be5){logger[_0xb833('0x1a')](_0xb833('0xce'),_0x235be5);}else{fs[_0xb833('0xcf')](_0x402462);}});});});}else{return _0x1c98d0[_0xb833('0x64')](0xc8);}})[_0xb833('0x36')](handleError(_0x1c98d0,null));}; \ No newline at end of file +var _0x7dac=['message','ChatInteraction,\x20%s,\x20%s','result','sendStatus','status','json','offset','undefined','limit','Content-Range','update','end','stack','name','send','render','contact','agent','index','ChatInteraction','type','key','getOptions','findAll','chat','query','user','show','params','model','rawAttributes','keys','filters','attributes','intersection','fields','includeAll','merge','options','find','catch','create','body','destroy','describe','findOne','ChatWebsiteId','vidaooApiKey','vidaooEscalation','vidaooTopic','vidaooNote','vidaooMetadata','fullname','email','POST','https://api-vidaoo.xcally.com/api/v1/meetings','isNull','follow','parse','metadata','Sequelize','ValidationError','Error\x20in\x20conversion\x20vidaooMetadata','out','ChatMessage','Unable\x20to\x20create\x20Vidaoo\x20session','updateAttributes','CmContact','Contact','abandon','abandonInteraction,\x20%s,\x20%s,\x20%s','UserId','Interaction\x20already\x20assigned','closed','disposition','AbandonInteraction','attachmentUpload','file','basename','mimetype','Attachment','Unauthorized','attachId','ChatOfflineMessageId','join','root','server/files/attachments/','offline-chat/','download','close','mailTranscript','server/files/chat/upload/','format','transcript-%s.txt','pathTranscript','Messages','User','ContactId','%s%d','agentAlias','System','customer','Visitor','agentIdentifier','website_alias','agent_alias','alias','agent_fullname','[%s]\x20%s:\x20%s\x0a','createdAt','MM/DD/YYYY\x20HH:mm:ss','direction','secret','MailServerOut','CloudProvider','Smtp','getSmtpOptions','SendMail','sendMail','\x22%s\x22\x20<%s>','addMessage','ids','omit','getMessages','length','nolimit','order','sort','where','pick','ChatInteractionId','filter','$gte','split','YYYY-MM-DD\x20HH:mm:ss','count','include','getMyMessages','hasOwnProperty','includeAgent','rows','addTags','spread','color','emit','chatInteractionTags:save','removeTags','toString','server','files','tmp','attachments','transcript-%d-%s.zip','push','firstName','Account','Owner','get','mkdirSync','Chat','N.A.','closedAt','browserName','osName','referer','customerIp','customerPort','tail','map','existsSync','createReadStream','createWriteStream','lastName','read','value','renderFile','views','downloadInteraction.ejs','transcript-','.pdf','createPdfFromHTML','rimraf','zip-dir','request-promise','moment','bluebird','mustache','util','path','ejs','lodash','ioredis','../../components/interaction/service','../../components/parsers/qs','../../components/export/pdf','../../config/logger','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./chatInteraction.socket','jayson/promise','client','http','request','then','info','request\x20sent','debug','ChatInteraction,\x20%s,\x20%s,\x20%s','stringify','error','code'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x7dac,0xb5));var _0xc7da=function(_0x4a9fb1,_0x273043){_0x4a9fb1=_0x4a9fb1-0x0;var _0x348672=_0x7dac[_0x4a9fb1];return _0x348672;};'use strict';var rimraf=require(_0xc7da('0x0'));var zipdir=require(_0xc7da('0x1'));var rp=require(_0xc7da('0x2'));var moment=require(_0xc7da('0x3'));var BPromise=require(_0xc7da('0x4'));var Mustache=require(_0xc7da('0x5'));var util=require(_0xc7da('0x6'));var path=require(_0xc7da('0x7'));var ejs=require(_0xc7da('0x8'));var fs=require('fs');var _=require(_0xc7da('0x9'));var Redis=require(_0xc7da('0xa'));var interaction=require(_0xc7da('0xb'));var qs=require(_0xc7da('0xc'));var pdf=require(_0xc7da('0xd'));var logger=require(_0xc7da('0xe'))('api');var config=require('../../config/environment');var db=require(_0xc7da('0xf'))['db'];config[_0xc7da('0x10')]=_[_0xc7da('0x11')](config['redis'],{'host':_0xc7da('0x12'),'port':0x18eb});var socket=require(_0xc7da('0x13'))(new Redis(config['redis']));require(_0xc7da('0x14'))['register'](socket);var jayson=require(_0xc7da('0x15'));var client=jayson[_0xc7da('0x16')][_0xc7da('0x17')]({'port':0x232b});var client9004=jayson['client'][_0xc7da('0x17')]({'port':0x232c});function respondWithRpcPromise(_0x14bc81,_0x27d552,_0xa66451,_0x3aca5c){return new BPromise(function(_0x17cb00,_0x3f97b8){var _0x55d847=_0x3aca5c||client;return _0x55d847[_0xc7da('0x18')](_0x14bc81,_0xa66451)[_0xc7da('0x19')](function(_0x3e6fd6){logger[_0xc7da('0x1a')]('ChatInteraction,\x20%s,\x20%s',_0x27d552,_0xc7da('0x1b'));logger[_0xc7da('0x1c')](_0xc7da('0x1d'),_0x27d552,'request\x20sent',JSON[_0xc7da('0x1e')](_0x3e6fd6));if(_0x3e6fd6[_0xc7da('0x1f')]){if(_0x3e6fd6[_0xc7da('0x1f')][_0xc7da('0x20')]===0x1f4){logger[_0xc7da('0x1f')]('ChatInteraction,\x20%s,\x20%s',_0x27d552,_0x3e6fd6[_0xc7da('0x1f')][_0xc7da('0x21')]);return _0x3f97b8(_0x3e6fd6[_0xc7da('0x1f')][_0xc7da('0x21')]);}logger[_0xc7da('0x1f')](_0xc7da('0x22'),_0x27d552,_0x3e6fd6[_0xc7da('0x1f')][_0xc7da('0x21')]);return _0x17cb00(_0x3e6fd6[_0xc7da('0x1f')]['message']);}else{logger[_0xc7da('0x1a')](_0xc7da('0x22'),_0x27d552,_0xc7da('0x1b'));_0x17cb00(_0x3e6fd6[_0xc7da('0x23')][_0xc7da('0x21')]);}})['catch'](function(_0x4b015a){logger[_0xc7da('0x1f')](_0xc7da('0x22'),_0x27d552,_0x4b015a);_0x3f97b8(_0x4b015a);});});}function respondWithStatusCode(_0x1868a2,_0x4ab0f3){_0x4ab0f3=_0x4ab0f3||0xcc;return function(_0x21e920){if(_0x21e920){return _0x1868a2[_0xc7da('0x24')](_0x4ab0f3);}return _0x1868a2[_0xc7da('0x25')](_0x4ab0f3)['end']();};}function respondWithResult(_0xe59a2e,_0x534527){_0x534527=_0x534527||0xc8;return function(_0x3b1345){if(_0x3b1345){return _0xe59a2e[_0xc7da('0x25')](_0x534527)[_0xc7da('0x26')](_0x3b1345);}};}function respondWithFilteredResult(_0x3963a6,_0x48040b){return function(_0xb8f15b){if(_0xb8f15b){var _0x1b0eea=typeof _0x48040b[_0xc7da('0x27')]===_0xc7da('0x28')&&typeof _0x48040b[_0xc7da('0x29')]===_0xc7da('0x28');var _0x57bb7f=_0xb8f15b['count'];var _0x5e28ff=_0x1b0eea?0x0:_0x48040b[_0xc7da('0x27')];var _0x3f6d2c=_0x1b0eea?_0xb8f15b['count']:_0x48040b['offset']+_0x48040b[_0xc7da('0x29')];var _0x14c53a;if(_0x3f6d2c>=_0x57bb7f){_0x3f6d2c=_0x57bb7f;_0x14c53a=0xc8;}else{_0x14c53a=0xce;}_0x3963a6[_0xc7da('0x25')](_0x14c53a);return _0x3963a6['set'](_0xc7da('0x2a'),_0x5e28ff+'-'+_0x3f6d2c+'/'+_0x57bb7f)[_0xc7da('0x26')](_0xb8f15b);}return null;};}function saveUpdates(_0x2da160){return function(_0x54219c){if(_0x54219c){return _0x54219c[_0xc7da('0x2b')](_0x2da160)[_0xc7da('0x19')](function(_0x34cd41){return _0x34cd41;});}return null;};}function removeEntity(_0x4db19e){return function(_0xd8cf69){if(_0xd8cf69){return _0xd8cf69['destroy']()[_0xc7da('0x19')](function(){_0x4db19e['status'](0xcc)[_0xc7da('0x2c')]();});}};}function handleEntityNotFound(_0x36f8ce){return function(_0x28d6cd){if(!_0x28d6cd){_0x36f8ce[_0xc7da('0x24')](0x194);}return _0x28d6cd;};}function handleError(_0x59d64d,_0x22dbfe){_0x22dbfe=_0x22dbfe||0x1f4;return function(_0x4c6018){logger[_0xc7da('0x1f')](_0x4c6018[_0xc7da('0x2d')]);if(_0x4c6018[_0xc7da('0x2e')]){delete _0x4c6018[_0xc7da('0x2e')];}_0x59d64d[_0xc7da('0x25')](_0x22dbfe)[_0xc7da('0x2f')](_0x4c6018);};}function getMustacheRender(_0x3a2c38,_0x446a9b){return Mustache[_0xc7da('0x30')](_0x3a2c38,_['merge'](_0x446a9b['body'],{'contact':_0x446a9b[_0xc7da('0x31')],'message':_0x446a9b['message'],'agent':_0x446a9b[_0xc7da('0x32')],'interaction':_0x446a9b['interaction'],'account':_0x446a9b['account']}))||'';}exports[_0xc7da('0x33')]=function(_0x1cc676,_0xc137f8){var _0x1f1339={};var _0xfebdc5=_['map'](db[_0xc7da('0x34')]['rawAttributes'],function(_0x3859eb){return{'name':_0x3859eb['fieldName'],'type':_0x3859eb[_0xc7da('0x35')][_0xc7da('0x36')]};});_0x1f1339=qs[_0xc7da('0x37')](_0xfebdc5,_0x1cc676);return interaction[_0xc7da('0x38')](_0xc7da('0x39'),_0x1cc676[_0xc7da('0x3a')],_0x1cc676[_0xc7da('0x3b')],_0x1f1339,_0xfebdc5)['then'](respondWithFilteredResult(_0xc137f8,_0x1f1339))['catch'](handleError(_0xc137f8,null));};exports[_0xc7da('0x3c')]=function(_0x3d3ab2,_0x411038){var _0x1689d3={'raw':![],'where':{'id':_0x3d3ab2[_0xc7da('0x3d')]['id']}},_0x48c2ca={};_0x48c2ca[_0xc7da('0x3e')]=_['keys'](db[_0xc7da('0x34')][_0xc7da('0x3f')]);_0x48c2ca[_0xc7da('0x3a')]=_[_0xc7da('0x40')](_0x3d3ab2['query']);_0x48c2ca[_0xc7da('0x41')]=_['intersection'](_0x48c2ca[_0xc7da('0x3e')],_0x48c2ca[_0xc7da('0x3a')]);_0x1689d3[_0xc7da('0x42')]=_[_0xc7da('0x43')](_0x48c2ca[_0xc7da('0x3e')],qs[_0xc7da('0x44')](_0x3d3ab2[_0xc7da('0x3a')][_0xc7da('0x44')]));_0x1689d3[_0xc7da('0x42')]=_0x1689d3['attributes']['length']?_0x1689d3[_0xc7da('0x42')]:_0x48c2ca[_0xc7da('0x3e')];if(_0x3d3ab2['query'][_0xc7da('0x45')]){_0x1689d3['include']=[{'all':!![]}];}_0x1689d3=_[_0xc7da('0x46')]({},_0x1689d3,_0x3d3ab2[_0xc7da('0x47')]);return db[_0xc7da('0x34')][_0xc7da('0x48')](_0x1689d3)[_0xc7da('0x19')](handleEntityNotFound(_0x411038,null))[_0xc7da('0x19')](respondWithResult(_0x411038,null))[_0xc7da('0x49')](handleError(_0x411038,null));};exports['create']=function(_0xd983bb,_0x3afa2e){return db[_0xc7da('0x34')][_0xc7da('0x4a')](_0xd983bb[_0xc7da('0x4b')],{})[_0xc7da('0x19')](respondWithResult(_0x3afa2e,0xc9))[_0xc7da('0x49')](handleError(_0x3afa2e,null));};exports[_0xc7da('0x2b')]=function(_0x49553d,_0x2a15c1){if(_0x49553d[_0xc7da('0x4b')]['id']){delete _0x49553d[_0xc7da('0x4b')]['id'];}return db[_0xc7da('0x34')][_0xc7da('0x48')]({'where':{'id':_0x49553d['params']['id']}})[_0xc7da('0x19')](handleEntityNotFound(_0x2a15c1,null))['then'](saveUpdates(_0x49553d['body'],null))['then'](respondWithResult(_0x2a15c1,null))[_0xc7da('0x49')](handleError(_0x2a15c1,null));};exports[_0xc7da('0x4c')]=function(_0x121815,_0x462dac){return db[_0xc7da('0x34')][_0xc7da('0x48')]({'where':{'id':_0x121815[_0xc7da('0x3d')]['id']}})['then'](handleEntityNotFound(_0x462dac,null))[_0xc7da('0x19')](removeEntity(_0x462dac,null))[_0xc7da('0x49')](handleError(_0x462dac,null));};exports[_0xc7da('0x4d')]=function(_0x14896d,_0x11bbb2){return db[_0xc7da('0x34')]['describe']()[_0xc7da('0x19')](respondWithResult(_0x11bbb2,null))[_0xc7da('0x49')](handleError(_0x11bbb2,null));};exports['createVidaooSession']=function(_0x386884,_0x1f4d97){var _0x21fdfd=_0x386884[_0xc7da('0x3d')]['id'];var _0x18279a;var _0x30dab5;var _0x5bcc09;return db[_0xc7da('0x34')][_0xc7da('0x4e')]({'where':{'id':_0x21fdfd}})[_0xc7da('0x19')](function(_0x2dda3c){_0x18279a=_0x2dda3c;return db['ChatWebsite'][_0xc7da('0x4e')]({'where':{'id':_0x2dda3c[_0xc7da('0x4f')]},'attributes':['id',_0xc7da('0x50'),_0xc7da('0x51'),_0xc7da('0x52'),_0xc7da('0x53'),_0xc7da('0x54')],'raw':!![]});})[_0xc7da('0x19')](function(_0x12cdd1){if(_0x12cdd1&&_0x12cdd1[_0xc7da('0x50')]&&_0x12cdd1[_0xc7da('0x51')]){_0x30dab5=_0x12cdd1;var _0x508976={'interaction':{'id':_0x21fdfd},'agent':{'id':_0x386884[_0xc7da('0x3b')]['id'],'name':_0x386884[_0xc7da('0x3b')]['name'],'fullname':_0x386884['user'][_0xc7da('0x55')],'email':_0x386884['user'][_0xc7da('0x56')]},'contact':_0x386884[_0xc7da('0x4b')][_0xc7da('0x31')],'account':_0x386884[_0xc7da('0x4b')]['account']};var _0xee6ad3={'rejectUnauthorized':![],'method':_0xc7da('0x57'),'url':_0xc7da('0x58'),'headers':{'X-APIKEY':_0x12cdd1['vidaooApiKey']},'body':{'duration':null,'scheduledAt':null,'participants':[_0x386884[_0xc7da('0x3b')]['email']],'buttons':null,'topic':_0x30dab5[_0xc7da('0x52')],'note':_[_0xc7da('0x59')](_0x30dab5[_0xc7da('0x53')])?null:getMustacheRender(_0x30dab5[_0xc7da('0x53')],_0x508976),'metadata':null},'redirect':_0xc7da('0x5a'),'json':!![]};try{if(!_['isNull'](_0x30dab5[_0xc7da('0x54')])){var _0x302297=getMustacheRender(_0x30dab5[_0xc7da('0x54')],_0x508976);var _0x2f43ae=JSON[_0xc7da('0x5b')](_0x302297);_0xee6ad3[_0xc7da('0x4b')][_0xc7da('0x5c')]=_0x2f43ae;}}catch(_0x55235d){throw new db[(_0xc7da('0x5d'))][(_0xc7da('0x5e'))](_0xc7da('0x5f'));}return rp(_0xee6ad3);}else{throw new db[(_0xc7da('0x5d'))]['ValidationError']('Error\x20in\x20Vidaoo\x20configuration');}})[_0xc7da('0x19')](function(_0x9bebfd){_0x5bcc09=_0x9bebfd;if(_0x5bcc09['id']){var _0x4eea29={'body':_0x5bcc09['join_url'],'ChatWebsiteId':_0x30dab5['id'],'ChatInteractionId':_0x18279a['id'],'direction':_0xc7da('0x60'),'UserId':_0x386884[_0xc7da('0x3b')]['id']};return db[_0xc7da('0x61')]['create'](_0x4eea29,{});}else{throw new db[(_0xc7da('0x5d'))][(_0xc7da('0x5e'))](_0xc7da('0x62'));}})['then'](function(){return _0x18279a[_0xc7da('0x63')]({'vidaooSessionId':_0x5bcc09['id']});})[_0xc7da('0x19')](respondWithResult(_0x1f4d97,null))[_0xc7da('0x49')](handleError(_0x1f4d97,null));};exports['customUpdate']=function(_0x369742,_0x2080e1){if(_0x369742['body']['id']){delete _0x369742[_0xc7da('0x4b')]['id'];}return db['ChatInteraction'][_0xc7da('0x48')]({'where':{'id':_0x369742['params']['id']},'include':[{'model':db[_0xc7da('0x64')],'as':_0xc7da('0x65')}]})[_0xc7da('0x19')](handleEntityNotFound(_0x2080e1,null))['then'](saveUpdates(_0x369742['body'],null))['then'](respondWithResult(_0x2080e1,null))[_0xc7da('0x49')](handleError(_0x2080e1,null));};exports[_0xc7da('0x66')]=function(_0x1472a0,_0x5b9b5d){if(_0x1472a0[_0xc7da('0x4b')]['id']){delete _0x1472a0[_0xc7da('0x4b')]['id'];}return db['ChatInteraction'][_0xc7da('0x48')]({'where':{'id':_0x1472a0['params']['id']}})['then'](function(_0x479500){if(!_0x479500){logger[_0xc7da('0x1f')](_0xc7da('0x67'),_0xc7da('0x66'),0x194,'entity\x20not\x20found');_0x5b9b5d[_0xc7da('0x24')](0x194);}else{if(_0x479500[_0xc7da('0x68')]){throw new db['Sequelize'][(_0xc7da('0x5e'))](_0xc7da('0x69'));}}return _0x479500;})['then'](function(_0x39bce0){if(_0x39bce0){return _0x39bce0[_0xc7da('0x2b')]({'closed':_0x1472a0[_0xc7da('0x4b')][_0xc7da('0x6a')],'disposition':_0x1472a0[_0xc7da('0x4b')][_0xc7da('0x6b')]})[_0xc7da('0x19')](function(_0x1dccd1){return _0x1dccd1;});}})['then'](function(){return respondWithRpcPromise(_0xc7da('0x6c'),_0xc7da('0x66'),_0x1472a0[_0xc7da('0x4b')],client9004);})['then'](respondWithResult(_0x5b9b5d,null))['catch'](handleError(_0x5b9b5d,null));};exports[_0xc7da('0x6d')]=function(_0x2b8401,_0x821732){_0x2b8401[_0xc7da('0x4b')][_0xc7da('0x2e')]=_0x2b8401[_0xc7da('0x6e')]['originalname'];_0x2b8401[_0xc7da('0x4b')][_0xc7da('0x6f')]=_0x2b8401[_0xc7da('0x6e')]['filename'];_0x2b8401['body']['type']=_0x2b8401[_0xc7da('0x6e')][_0xc7da('0x70')];return db[_0xc7da('0x71')][_0xc7da('0x4a')](_0x2b8401[_0xc7da('0x4b')])[_0xc7da('0x19')](respondWithResult(_0x821732,0xc9))[_0xc7da('0x49')](handleError(_0x821732,null));};exports['attachmentDownload']=function(_0x195e34,_0x359a41){return db[_0xc7da('0x34')][_0xc7da('0x4e')]({'where':{'id':_0x195e34[_0xc7da('0x3d')]['id']},'raw':!![]})[_0xc7da('0x19')](handleEntityNotFound(_0x359a41,null))[_0xc7da('0x19')](function(_0x1e6a2c){if(_0x1e6a2c){if(_0x1e6a2c[_0xc7da('0x6a')]){return _0x359a41['status'](0x193)[_0xc7da('0x26')]({'status':0x193,'message':_0xc7da('0x72')});}return db[_0xc7da('0x71')][_0xc7da('0x4e')]({'where':{'id':_0x195e34[_0xc7da('0x3a')][_0xc7da('0x73')]},'raw':!![]})['then'](handleEntityNotFound(_0x359a41,null));}})['then'](function(_0x50912d){if(_0x50912d){var _0x1bc30a=_0x50912d[_0xc7da('0x74')]!==null;var _0x560eb9=path[_0xc7da('0x75')](config[_0xc7da('0x76')],_0xc7da('0x77'));if(_0x1bc30a){_0x560eb9=path['join'](_0x560eb9,_0xc7da('0x78'));}var _0x1a8c65=path[_0xc7da('0x75')](_0x560eb9,_0x50912d['basename']);return _0x359a41[_0xc7da('0x79')](_0x1a8c65);}})[_0xc7da('0x49')](handleError(_0x359a41,null));};exports[_0xc7da('0x7a')]=function(_0x44f9cb,_0x59f1fa){var _0x27db20=null;var _0x1931ae=null;var _0x3f316e=null;if(_0x44f9cb[_0xc7da('0x4b')]['id']){delete _0x44f9cb['body']['id'];}if(_0x44f9cb[_0xc7da('0x4b')][_0xc7da('0x7b')]){_0x3f316e=path[_0xc7da('0x75')](config[_0xc7da('0x76')],_0xc7da('0x7c'),util[_0xc7da('0x7d')](_0xc7da('0x7e'),Date['now']()));_0x44f9cb[_0xc7da('0x4b')][_0xc7da('0x7f')]=_0x3f316e;}return db[_0xc7da('0x34')]['find']({'where':{'id':_0x44f9cb[_0xc7da('0x3d')]['id']},'include':[{'model':db[_0xc7da('0x61')],'as':_0xc7da('0x80'),'include':[{'model':db[_0xc7da('0x81')],'as':_0xc7da('0x81')}]}]})['then'](handleEntityNotFound(_0x59f1fa,null))[_0xc7da('0x19')](saveUpdates(_0x44f9cb[_0xc7da('0x4b')],null))[_0xc7da('0x19')](function(_0x32b290){if(_0x32b290){_0x27db20=_0x32b290;return db['ChatWebsite'][_0xc7da('0x48')]({'where':{'id':_0x27db20['ChatWebsiteId']}});}})[_0xc7da('0x19')](function(_0x691643){if(_0x691643){_0x1931ae=_0x691643;return db[_0xc7da('0x64')][_0xc7da('0x48')]({'where':{'id':_0x27db20[_0xc7da('0x82')]}});}})['then'](function(_0x449832){if(_0x449832){if(_0x3f316e){var _0x3e9884=null;for(var _0xea0ea9=0x1;_0xea0ea9<_0x27db20[_0xc7da('0x80')]['length'];++_0xea0ea9){_0x3e9884=_0x27db20[_0xc7da('0x80')][_0xea0ea9];var _0x25cda0=_0x3e9884[_0xc7da('0x68')]?util['format'](_0xc7da('0x83'),_0x1931ae[_0xc7da('0x84')],_0x3e9884[_0xc7da('0x68')]):_0xc7da('0x85');var _0x2b2ca7=_0x44f9cb['body'][_0xc7da('0x86')]||util[_0xc7da('0x7d')]('%s%d',_0xc7da('0x87'),_0x3e9884[_0xc7da('0x82')]);switch(_0x1931ae[_0xc7da('0x88')]){case _0xc7da('0x89'):_0x25cda0=_0x3e9884['UserId']?util[_0xc7da('0x7d')](_0xc7da('0x83'),_0x1931ae[_0xc7da('0x84')],_0x3e9884[_0xc7da('0x68')]):_0xc7da('0x85');break;case _0xc7da('0x8a'):_0x25cda0=_0x3e9884[_0xc7da('0x68')]?_0x3e9884[_0xc7da('0x81')][_0xc7da('0x8b')]||_0x3e9884[_0xc7da('0x81')]['fullname']:'System';break;case _0xc7da('0x8c'):_0x25cda0=_0x3e9884[_0xc7da('0x68')]?_0x3e9884[_0xc7da('0x81')][_0xc7da('0x55')]:_0xc7da('0x85');break;default:_0x25cda0=_0x3e9884[_0xc7da('0x68')]?util[_0xc7da('0x7d')](_0xc7da('0x83'),_0x1931ae[_0xc7da('0x84')],_0x3e9884[_0xc7da('0x68')]):'System';}var _0x9ccc70=util['format'](_0xc7da('0x8d'),moment(_0x3e9884[_0xc7da('0x8e')])['format'](_0xc7da('0x8f')),_0x3e9884[_0xc7da('0x90')]==='in'?_0x2b2ca7:_0x25cda0,_0x3e9884[_0xc7da('0x4b')]);if(!_0x3e9884[_0xc7da('0x91')]){fs['appendFileSync'](_0x3f316e,_0x9ccc70);}}return db['MailAccount'][_0xc7da('0x4e')]({'where':{'service':!![]},'include':[{'model':db[_0xc7da('0x92')],'as':'Smtp','raw':!![],'include':[{'model':db[_0xc7da('0x93')],'as':'CloudProvider','raw':!![]}]}]});}}})['then'](function(_0x4f0822){if(!_0x4f0822||!_0x4f0822[_0xc7da('0x94')]||!_0x44f9cb['body'])return _0x27db20;var _0x1ab678=_0x4f0822[_0xc7da('0x95')]();return respondWithRpcPromise(_0xc7da('0x96'),_0xc7da('0x97'),{'account':_0x1ab678,'message':{'from':util[_0xc7da('0x7d')](_0xc7da('0x98'),_0x4f0822[_0xc7da('0x2e')],_0x4f0822[_0xc7da('0x56')]||_0x4f0822[_0xc7da('0x94')][_0xc7da('0x3b')]),'to':_0x44f9cb[_0xc7da('0x4b')]['mailTranscript'],'subject':'Mail\x20Transcript','text':util['format']('Hi\x20%s,\x20attached\x20you\x20can\x20find\x20your\x20transcript\x20file.\x20\x0a\x0aRegards.\x20\x0a\x0a',_0x44f9cb[_0xc7da('0x4b')]['mailTranscript']),'attachments':[{'path':_0x3f316e}]}})[_0xc7da('0x19')](function(){return _0x27db20;})[_0xc7da('0x49')](function(_0x4be84f){logger['error'](_0x4be84f);});})[_0xc7da('0x19')](respondWithStatusCode(_0x59f1fa,0xc8))[_0xc7da('0x49')](handleError(_0x59f1fa,null));};exports[_0xc7da('0x99')]=function(_0x251de9,_0x324abd){return db['ChatMessage'][_0xc7da('0x48')]({'where':{'id':_0x251de9[_0xc7da('0x3d')]['id']}})[_0xc7da('0x19')](handleEntityNotFound(_0x324abd,null))['then'](function(_0x5a9789){if(_0x5a9789){return _0x5a9789[_0xc7da('0x99')](_0x251de9[_0xc7da('0x4b')][_0xc7da('0x9a')],_[_0xc7da('0x9b')](_0x251de9[_0xc7da('0x4b')],[_0xc7da('0x9a'),'id'])||{});}})[_0xc7da('0x19')](respondWithResult(_0x324abd,null))[_0xc7da('0x49')](handleError(_0x324abd,null));};exports[_0xc7da('0x9c')]=function(_0x432534,_0x112e43){var _0x190ace={'raw':![],'where':{}};var _0x23c278={};var _0x11e2bf={'count':0x0,'rows':[]};return db[_0xc7da('0x34')][_0xc7da('0x4e')]({'where':{'id':_0x432534['params']['id']}})[_0xc7da('0x19')](handleEntityNotFound(_0x112e43,null))['then'](function(_0x47c392){if(_0x47c392){_0x23c278[_0xc7da('0x3e')]=_[_0xc7da('0x40')](db['ChatMessage']['rawAttributes']);_0x23c278[_0xc7da('0x3a')]=_['keys'](_0x432534[_0xc7da('0x3a')]);_0x23c278['filters']=_[_0xc7da('0x43')](_0x23c278[_0xc7da('0x3e')],_0x23c278['query']);_0x190ace['attributes']=_[_0xc7da('0x43')](_0x23c278[_0xc7da('0x3e')],qs['fields'](_0x432534[_0xc7da('0x3a')][_0xc7da('0x44')]));_0x190ace['attributes']=_0x190ace[_0xc7da('0x42')][_0xc7da('0x9d')]?_0x190ace[_0xc7da('0x42')]:_0x23c278[_0xc7da('0x3e')];if(!_0x432534[_0xc7da('0x3a')]['hasOwnProperty'](_0xc7da('0x9e'))){_0x190ace['limit']=qs[_0xc7da('0x29')](_0x432534[_0xc7da('0x3a')][_0xc7da('0x29')]);_0x190ace[_0xc7da('0x27')]=qs[_0xc7da('0x27')](_0x432534[_0xc7da('0x3a')][_0xc7da('0x27')]);}_0x190ace[_0xc7da('0x9f')]=qs[_0xc7da('0xa0')](_0x432534[_0xc7da('0x3a')][_0xc7da('0xa0')]);_0x190ace[_0xc7da('0xa1')]=qs[_0xc7da('0x41')](_[_0xc7da('0xa2')](_0x432534[_0xc7da('0x3a')],_0x23c278[_0xc7da('0x41')]));_0x190ace[_0xc7da('0xa1')][_0xc7da('0xa3')]=_0x47c392['id'];if(_0x432534[_0xc7da('0x3a')][_0xc7da('0xa4')]){_0x190ace['where']=_[_0xc7da('0x46')](_0x190ace[_0xc7da('0xa1')],{'$or':_['map'](_0x190ace[_0xc7da('0x42')],function(_0x2d255c){var _0x26b50c={};_0x26b50c[_0x2d255c]={'$like':'%'+_0x432534[_0xc7da('0x3a')][_0xc7da('0xa4')]+'%'};return _0x26b50c;})});}if(_0x432534['query'][_0xc7da('0xa5')]){var _0x1e961a=_0x432534[_0xc7da('0x3a')][_0xc7da('0xa5')][_0xc7da('0xa6')](',');var _0x24fb3f={};_0x24fb3f[_0x1e961a[0x0]]={'$gte':moment(_0x1e961a[0x1])[_0xc7da('0x7d')](_0xc7da('0xa7'))};_0x190ace[_0xc7da('0xa1')]=_[_0xc7da('0x46')](_0x190ace[_0xc7da('0xa1')],_0x24fb3f);}_0x190ace=_[_0xc7da('0x46')]({},_0x190ace,_0x432534['options']);return db['ChatMessage'][_0xc7da('0xa8')]({'where':_0x190ace['where']})[_0xc7da('0x19')](function(_0x1ba919){_0x11e2bf[_0xc7da('0xa8')]=_0x1ba919;if(_0x432534[_0xc7da('0x3a')]['includeAll']){_0x190ace[_0xc7da('0xa9')]=[{'all':!![]}];}return db[_0xc7da('0x61')][_0xc7da('0x38')](_0x190ace);})[_0xc7da('0x19')](function(_0x5c0539){_0x11e2bf['rows']=_0x5c0539;return _0x11e2bf;});}})[_0xc7da('0x19')](respondWithFilteredResult(_0x112e43,_0x190ace))[_0xc7da('0x49')](handleError(_0x112e43,null));};exports[_0xc7da('0xaa')]=function(_0x3230d6,_0x55c6ab){var _0x21aa2e={'where':{}},_0x3cda6c={},_0x3ee2bf={'count':0x0,'rows':[]};return db[_0xc7da('0x34')]['findOne']({'where':{'id':_0x3230d6['params']['id']}})[_0xc7da('0x19')](handleEntityNotFound(_0x55c6ab,null))[_0xc7da('0x19')](function(_0x58b18a){if(_0x58b18a){_0x3cda6c[_0xc7da('0x3e')]=_[_0xc7da('0x40')](db[_0xc7da('0x61')][_0xc7da('0x3f')]);_0x3cda6c[_0xc7da('0x3a')]=_[_0xc7da('0x40')](_0x3230d6[_0xc7da('0x3a')]);_0x3cda6c[_0xc7da('0x41')]=_[_0xc7da('0x43')](_0x3cda6c[_0xc7da('0x3e')],_0x3cda6c[_0xc7da('0x3a')]);_0x21aa2e['attributes']=_[_0xc7da('0x43')](_0x3cda6c[_0xc7da('0x3e')],qs[_0xc7da('0x44')](_0x3230d6['query'][_0xc7da('0x44')]));_0x21aa2e['attributes']=_0x21aa2e[_0xc7da('0x42')][_0xc7da('0x9d')]?_0x21aa2e[_0xc7da('0x42')]:_0x3cda6c['model'];if(!_0x3230d6['query'][_0xc7da('0xab')](_0xc7da('0x9e'))){_0x21aa2e[_0xc7da('0x29')]=qs[_0xc7da('0x29')](_0x3230d6['query'][_0xc7da('0x29')]);_0x21aa2e[_0xc7da('0x27')]=qs['offset'](_0x3230d6[_0xc7da('0x3a')][_0xc7da('0x27')]);}_0x21aa2e['order']=qs['sort'](_0x3230d6[_0xc7da('0x3a')][_0xc7da('0xa0')]);_0x21aa2e[_0xc7da('0xa1')]=qs[_0xc7da('0x41')](_['pick'](_0x3230d6['query'],_0x3cda6c[_0xc7da('0x41')]));_0x21aa2e['where']['ChatInteractionId']=_0x58b18a['id'];if(_0x3230d6['query'][_0xc7da('0xa4')]){_0x21aa2e['where']=_['merge'](_0x21aa2e[_0xc7da('0xa1')],{'$or':_['map'](_0x21aa2e[_0xc7da('0x42')],function(_0x3dcf0e){var _0x1220d6={};_0x1220d6[_0x3dcf0e]={'$like':'%'+_0x3230d6[_0xc7da('0x3a')]['filter']+'%'};return _0x1220d6;})});}_0x21aa2e[_0xc7da('0xa1')]['secret']=![];if(_0x3230d6[_0xc7da('0x3a')]['id']){_0x21aa2e['where']['id']={'$gt':_0x3230d6[_0xc7da('0x3a')]['id']};}_0x21aa2e=_[_0xc7da('0x46')]({},_0x21aa2e,_0x3230d6[_0xc7da('0x47')]);return db[_0xc7da('0x61')][_0xc7da('0xa8')]({'where':_0x21aa2e['where']})['then'](function(_0x610b9e){_0x3ee2bf[_0xc7da('0xa8')]=_0x610b9e;_0x21aa2e['include']=[];if(_0x3230d6['query'][_0xc7da('0xac')]){_0x21aa2e[_0xc7da('0xa9')]['push']({'model':db[_0xc7da('0x81')],'as':_0xc7da('0x81'),'attributes':['id',_0xc7da('0x55'),_0xc7da('0x8b')]});}if(_0x3230d6[_0xc7da('0x3a')][_0xc7da('0x45')]){_0x21aa2e[_0xc7da('0xa9')]=[{'all':!![]}];}return db[_0xc7da('0x61')][_0xc7da('0x38')](_0x21aa2e);})[_0xc7da('0x19')](function(_0x2dcc5e){_0x3ee2bf[_0xc7da('0xad')]=_0x2dcc5e;return _0x3ee2bf;});}})['then'](respondWithFilteredResult(_0x55c6ab,_0x21aa2e))[_0xc7da('0x49')](handleError(_0x55c6ab,null));};exports[_0xc7da('0xae')]=function(_0x317d42,_0x2a80e7){return db['ChatInteraction']['find']({'where':{'id':_0x317d42[_0xc7da('0x3d')]['id']}})[_0xc7da('0x19')](handleEntityNotFound(_0x2a80e7,null))[_0xc7da('0x19')](function(_0xba3ff6){if(_0xba3ff6){return _0xba3ff6['setTags'](_0x317d42['body'][_0xc7da('0x9a')],_['omit'](_0x317d42[_0xc7da('0x4b')],[_0xc7da('0x9a'),'id'])||{})[_0xc7da('0xaf')](function(){return db['Tag']['findAll']({'attributes':['id',_0xc7da('0x2e'),_0xc7da('0xb0')],'where':{'id':_0x317d42['body'][_0xc7da('0x9a')]}});})[_0xc7da('0x19')](function(_0x4ba565){socket[_0xc7da('0xb1')](_0xc7da('0xb2'),{'id':Number(_0x317d42[_0xc7da('0x3d')]['id']),'tags':_0x4ba565||[]});return{'id':Number(_0x317d42[_0xc7da('0x3d')]['id']),'tags':_0x4ba565||[]};});}})[_0xc7da('0x19')](respondWithResult(_0x2a80e7,null))[_0xc7da('0x49')](handleError(_0x2a80e7,null));};exports[_0xc7da('0xb3')]=function(_0x4c0b72,_0x57bed8){return db[_0xc7da('0x34')]['find']({'where':{'id':_0x4c0b72[_0xc7da('0x3d')]['id']}})[_0xc7da('0x19')](handleEntityNotFound(_0x57bed8,null))['then'](function(_0x257677){if(_0x257677){return _0x257677[_0xc7da('0xb3')](_0x4c0b72[_0xc7da('0x3a')]['ids']);}})[_0xc7da('0x19')](respondWithStatusCode(_0x57bed8,null))[_0xc7da('0x49')](handleError(_0x57bed8,null));};exports[_0xc7da('0x79')]=function(_0x55dde7,_0x29e215){var _0x2d111e=moment()['unix']()[_0xc7da('0xb4')]();var _0x576018=path[_0xc7da('0x75')](config['root'],_0xc7da('0xb5'),_0xc7da('0xb6'),_0xc7da('0xb7'));var _0x585e64=path[_0xc7da('0x75')](config[_0xc7da('0x76')],_0xc7da('0xb5'),'files',_0xc7da('0xb8'));var _0xc2c57a=path[_0xc7da('0x75')](_0x576018,_0x2d111e);var _0xf2fae2=util['format'](_0xc7da('0xb9'),_0x55dde7[_0xc7da('0x3d')]['id'],_0x2d111e);var _0xa4f690=path['join'](_0x576018,_0xf2fae2);var _0xf7fd63=[];_0xf7fd63[_0xc7da('0xba')]({'model':db[_0xc7da('0x81')],'as':_0xc7da('0x81'),'attributes':['id',_0xc7da('0x55')],'raw':!![]});_0xf7fd63[_0xc7da('0xba')]({'model':db['CmContact'],'as':_0xc7da('0x65'),'attributes':['id',_0xc7da('0xbb'),'lastName'],'raw':!![]});if(_0x55dde7[_0xc7da('0x3a')][_0xc7da('0xb8')]){_0xf7fd63[_0xc7da('0xba')]({'model':db['Attachment'],'as':_0xc7da('0x71'),'raw':!![]});}var _0x3efa84=[{'model':db[_0xc7da('0x61')],'as':'Messages','attributes':['id',_0xc7da('0x4b'),'createdAt',_0xc7da('0x90'),_0xc7da('0x91'),'read'],'include':_0xf7fd63}];_0x3efa84[_0xc7da('0xba')]({'model':db['ChatWebsite'],'as':_0xc7da('0xbc'),'attributes':['id',_0xc7da('0x2e')]});_0x3efa84[_0xc7da('0xba')]({'model':db['User'],'as':_0xc7da('0xbd'),'attributes':['id',_0xc7da('0x55')]});return db['ChatInteraction'][_0xc7da('0x48')]({'where':{'id':_0x55dde7['params']['id']},'include':_0x3efa84})['then'](handleEntityNotFound(_0x29e215,null))['then'](function(_0x30292a){if(_0x30292a){var _0x219472=_0x30292a[_0xc7da('0xbe')]({'plain':!![]});fs[_0xc7da('0xbf')](_0xc2c57a);var _0x32206f={'channel':_0xc7da('0xc0'),'account':_0x219472[_0xc7da('0xbc')]['name'],'agent':_0x219472[_0xc7da('0xbd')]?_0x219472['Owner'][_0xc7da('0x55')]:_0xc7da('0xc1'),'createdAt':moment(_0x219472[_0xc7da('0x8e')])[_0xc7da('0x7d')]('YYYY-MM-DD\x20HH:mm:ss')[_0xc7da('0xb4')](),'closedAt':_0x219472[_0xc7da('0x6a')]?moment(_0x219472[_0xc7da('0xc2')])['format']('YYYY-MM-DD\x20HH:mm:ss')[_0xc7da('0xb4')]():'','disposition':_0x219472[_0xc7da('0x6b')],'chatInfo':{'browser':_0x219472[_0xc7da('0xc3')],'os':_0x219472[_0xc7da('0xc4')],'referer':_0x219472[_0xc7da('0xc5')],'customerIp':_0x219472[_0xc7da('0xc6')],'customerPort':_0x219472[_0xc7da('0xc7')]?_0x219472[_0xc7da('0xc7')]:_0xc7da('0xc1')},'messages':_(_0x219472[_0xc7da('0x80')])[_0xc7da('0xc8')]()[_0xc7da('0xa4')]({'secret':![]})[_0xc7da('0xc9')](function(_0x1217b2){if(_0x1217b2[_0xc7da('0x71')]){var _0x57beb3=path[_0xc7da('0x75')](_0x585e64,_0x1217b2[_0xc7da('0x71')][_0xc7da('0x6f')]);if(fs[_0xc7da('0xca')](_0x57beb3)){fs[_0xc7da('0xcb')](_0x57beb3)['pipe'](fs[_0xc7da('0xcc')](path[_0xc7da('0x75')](_0xc2c57a,_0x1217b2['Attachment'][_0xc7da('0x6f')])));}}return{'date':moment(_0x1217b2[_0xc7da('0x8e')])['format'](_0xc7da('0xa7'))[_0xc7da('0xb4')](),'sender':_0x1217b2['direction']===_0xc7da('0x60')?_0x1217b2['User']?_0x1217b2[_0xc7da('0x81')]['fullname']:'System':_0x1217b2[_0xc7da('0x65')][_0xc7da('0xbb')]+(_0x1217b2[_0xc7da('0x65')][_0xc7da('0xcd')]?'\x20'+_0x1217b2['Contact']['lastName']:''),'body':_0x1217b2[_0xc7da('0x71')]?_0x1217b2[_0xc7da('0x71')][_0xc7da('0x6f')]:_0x1217b2[_0xc7da('0x4b')],'direction':_0x1217b2[_0xc7da('0x90')]===_0xc7da('0x60')?'A':'C','secret':_0x1217b2['secret'],'read':_0x1217b2[_0xc7da('0xce')],'attachment':_0x1217b2[_0xc7da('0x71')]};})[_0xc7da('0xcf')]()};return ejs[_0xc7da('0xd0')](path[_0xc7da('0x75')](config[_0xc7da('0x76')],'server',_0xc7da('0xd1'),_0xc7da('0xd2')),{'interaction':_0x32206f})[_0xc7da('0x19')](function(_0x46b37c){var _0x19e2f9=path['join'](_0xc2c57a,_0xc7da('0xd3')+_0x219472['id']+'-'+_0x2d111e+_0xc7da('0xd4'));var _0x38ae37={'path':_0x19e2f9,'channel':'Chat','interactionId':_0x219472['id']};return pdf[_0xc7da('0xd5')](_0x46b37c,_0x38ae37);})[_0xc7da('0x19')](function(){return new Promise(function(_0x37832b,_0x1d8921){zipdir(_0xc2c57a,{'saveTo':_0xa4f690},function(_0x52b876,_0x507f43){if(_0x52b876)return _0x1d8921(_0x52b876);return _0x37832b(_0x507f43);});})[_0xc7da('0x19')](function(){return new BPromise(function(_0x2a20cd,_0x3877d7){rimraf(_0xc2c57a,function(_0x130bf5){if(_0x130bf5)_0x3877d7(_0x130bf5);return _0x2a20cd();});});})[_0xc7da('0x19')](function(){return _0x29e215['download'](_0xa4f690,_0xf2fae2,function(_0x31e812){if(_0x31e812){logger[_0xc7da('0x1f')]('err',_0x31e812);}else{fs['unlinkSync'](_0xa4f690);}});});});}else{return _0x29e215[_0xc7da('0x24')](0xc8);}})[_0xc7da('0x49')](handleError(_0x29e215,null));}; \ No newline at end of file diff --git a/server/api/chatInteraction/chatInteraction.events.js b/server/api/chatInteraction/chatInteraction.events.js index 440b0c6..2e46a7e 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 _0x6d12=['events','../../mysqldb','ChatMessage','setMaxListeners','save','update','remove','getUsers','then','setDataValue','Users','findAll','unreadMessages','emit','catch','hasOwnProperty','hook'];(function(_0x32912e,_0x43f6f4){var _0xe6fbe4=function(_0x48edce){while(--_0x48edce){_0x32912e['push'](_0x32912e['shift']());}};_0xe6fbe4(++_0x43f6f4);}(_0x6d12,0xbb));var _0x26d1=function(_0x3372fa,_0x50fbc3){_0x3372fa=_0x3372fa-0x0;var _0x4d436c=_0x6d12[_0x3372fa];return _0x4d436c;};'use strict';var EventEmitter=require(_0x26d1('0x0'));var ChatInteraction=require('../../mysqldb')['db']['ChatInteraction'];var ChatMessage=require(_0x26d1('0x1'))['db'][_0x26d1('0x2')];var ChatInteractionEvents=new EventEmitter();ChatInteractionEvents[_0x26d1('0x3')](0x0);var events={'afterCreate':_0x26d1('0x4'),'afterUpdate':_0x26d1('0x5'),'afterDestroy':_0x26d1('0x6')};function emitEvent(_0x271a8c){return function(_0x311958,_0x4960f4,_0x1cc715){_0x311958[_0x26d1('0x7')]({'attributes':['id'],'raw':!![]})[_0x26d1('0x8')](function(_0x2112c6){_0x311958[_0x26d1('0x9')](_0x26d1('0xa'),_0x2112c6['map'](function(_0x1f82dd){return{'id':_0x1f82dd['id']};}));return ChatMessage[_0x26d1('0xb')]({'where':{'ChatInteractionId':_0x311958['id'],'direction':'in','read':![]},'raw':!![]});})[_0x26d1('0x8')](function(_0x2ea1ae){_0x311958[_0x26d1('0x9')](_0x26d1('0xc'),_0x2ea1ae['length']);ChatInteractionEvents[_0x26d1('0xd')](_0x271a8c+':'+_0x311958['id'],_0x311958);ChatInteractionEvents[_0x26d1('0xd')](_0x271a8c,_0x311958);_0x1cc715(null);})[_0x26d1('0xe')](_0x1cc715(null));};}for(var e in events){if(events[_0x26d1('0xf')](e)){var event=events[e];ChatInteraction[_0x26d1('0x10')](e,emitEvent(event));}}module['exports']=ChatInteractionEvents; \ No newline at end of file +var _0xdf04=['Users','map','unreadMessages','length','emit','hook','exports','events','../../mysqldb','ChatInteraction','ChatMessage','setMaxListeners','update','remove','then','setDataValue'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xdf04,0x107));var _0x4df0=function(_0x50a59f,_0xf6e6c2){_0x50a59f=_0x50a59f-0x0;var _0x10eb56=_0xdf04[_0x50a59f];return _0x10eb56;};'use strict';var EventEmitter=require(_0x4df0('0x0'));var ChatInteraction=require(_0x4df0('0x1'))['db'][_0x4df0('0x2')];var ChatMessage=require(_0x4df0('0x1'))['db'][_0x4df0('0x3')];var ChatInteractionEvents=new EventEmitter();ChatInteractionEvents[_0x4df0('0x4')](0x0);var events={'afterCreate':'save','afterUpdate':_0x4df0('0x5'),'afterDestroy':_0x4df0('0x6')};function emitEvent(_0xbbb1a2){return function(_0x4c0cf8,_0x5d11d7,_0x18427d){_0x4c0cf8['getUsers']({'attributes':['id'],'raw':!![]})[_0x4df0('0x7')](function(_0x2b7619){_0x4c0cf8[_0x4df0('0x8')](_0x4df0('0x9'),_0x2b7619[_0x4df0('0xa')](function(_0x525abb){return{'id':_0x525abb['id']};}));return ChatMessage['findAll']({'where':{'ChatInteractionId':_0x4c0cf8['id'],'direction':'in','read':![]},'raw':!![]});})[_0x4df0('0x7')](function(_0x1298e6){_0x4c0cf8['setDataValue'](_0x4df0('0xb'),_0x1298e6[_0x4df0('0xc')]);ChatInteractionEvents['emit'](_0xbbb1a2+':'+_0x4c0cf8['id'],_0x4c0cf8);ChatInteractionEvents[_0x4df0('0xd')](_0xbbb1a2,_0x4c0cf8);_0x18427d(null);})['catch'](_0x18427d(null));};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];ChatInteraction[_0x4df0('0xe')](e,emitEvent(event));}}module[_0x4df0('0xf')]=ChatInteractionEvents; \ No newline at end of file diff --git a/server/api/chatInteraction/chatInteraction.model.js b/server/api/chatInteraction/chatInteraction.model.js index eb1fa6f..98fb6d1 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 _0x3eb9=['ChatInteraction','chat_interactions','changed','closedAt','format','YYYY-MM-DD\x20HH:mm:ss','utf8mb4','lodash','../../config/logger','api','moment','request-promise','rimraf','../../config/environment','./chatInteraction.attributes','exports'];(function(_0xfa8892,_0x48ed5d){var _0x4edc80=function(_0xd29b50){while(--_0xd29b50){_0xfa8892['push'](_0xfa8892['shift']());}};_0x4edc80(++_0x48ed5d);}(_0x3eb9,0x197));var _0x93eb=function(_0x3d6785,_0x492ea3){_0x3d6785=_0x3d6785-0x0;var _0x39a624=_0x3eb9[_0x3d6785];return _0x39a624;};'use strict';var _=require(_0x93eb('0x0'));var util=require('util');var logger=require(_0x93eb('0x1'))(_0x93eb('0x2'));var moment=require(_0x93eb('0x3'));var BPromise=require('bluebird');var rp=require(_0x93eb('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0x93eb('0x5'));var config=require(_0x93eb('0x6'));var attributes=require(_0x93eb('0x7'));module[_0x93eb('0x8')]=function(_0x16ccdc,_0x2b4f45){return _0x16ccdc['define'](_0x93eb('0x9'),attributes,{'tableName':_0x93eb('0xa'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x3b3df1,_0x2d7b64,_0x4a7cf5){if(_0x3b3df1[_0x93eb('0xb')]('closed')){_0x3b3df1[_0x93eb('0xc')]=moment()[_0x93eb('0xd')](_0x93eb('0xe'));}_0x4a7cf5(null,_0x3b3df1);}},'charset':_0x93eb('0xf'),'collate':'utf8mb4_unicode_ci'});}; \ No newline at end of file +var _0x4534=['./chatInteraction.attributes','exports','ChatInteraction','chat_interactions','closed','closedAt','utf8mb4','utf8mb4_unicode_ci','lodash','util','../../config/logger','api','bluebird','path','rimraf'];(function(_0x1c8c28,_0x3ee093){var _0x1f59b4=function(_0x29bcc0){while(--_0x29bcc0){_0x1c8c28['push'](_0x1c8c28['shift']());}};_0x1f59b4(++_0x3ee093);}(_0x4534,0x152));var _0x4453=function(_0x36ff10,_0x357f31){_0x36ff10=_0x36ff10-0x0;var _0x5f30ee=_0x4534[_0x36ff10];return _0x5f30ee;};'use strict';var _=require(_0x4453('0x0'));var util=require(_0x4453('0x1'));var logger=require(_0x4453('0x2'))(_0x4453('0x3'));var moment=require('moment');var BPromise=require(_0x4453('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x4453('0x5'));var rimraf=require(_0x4453('0x6'));var config=require('../../config/environment');var attributes=require(_0x4453('0x7'));module[_0x4453('0x8')]=function(_0x21b6be,_0x4f4b7d){return _0x21b6be['define'](_0x4453('0x9'),attributes,{'tableName':_0x4453('0xa'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x681a2c,_0x5b22d1,_0x53a25c){if(_0x681a2c['changed'](_0x4453('0xb'))){_0x681a2c[_0x4453('0xc')]=moment()['format']('YYYY-MM-DD\x20HH:mm:ss');}_0x53a25c(null,_0x681a2c);}},'charset':_0x4453('0xd'),'collate':_0x4453('0xe')});}; \ No newline at end of file diff --git a/server/api/chatInteraction/chatInteraction.rpc.js b/server/api/chatInteraction/chatInteraction.rpc.js index 2a2e5e0..e3cddf9 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 _0x2a40=['error','code','message','result','catch','update','body','options','raw','where','attributes','limit','UpdateChatInteraction','AddTagsToChatInteraction','ChatInteraction','addTags','ids','spread','AddTags','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','redis','localhost','socket.io-emitter','register','request','then','info','ChatInteraction,\x20%s,\x20%s','request\x20sent','debug','ChatInteraction,\x20%s,\x20%s,\x20%s','stringify'];(function(_0x572165,_0x6a45cc){var _0x8c8709=function(_0x43faab){while(--_0x43faab){_0x572165['push'](_0x572165['shift']());}};_0x8c8709(++_0x6a45cc);}(_0x2a40,0x1d6));var _0x02a4=function(_0x5a7dd3,_0x26b7cf){_0x5a7dd3=_0x5a7dd3-0x0;var _0x2f4d07=_0x2a40[_0x5a7dd3];return _0x2f4d07;};'use strict';var _=require(_0x02a4('0x0'));var util=require(_0x02a4('0x1'));var moment=require(_0x02a4('0x2'));var BPromise=require('bluebird');var rs=require(_0x02a4('0x3'));var fs=require('fs');var Redis=require(_0x02a4('0x4'));var db=require(_0x02a4('0x5'))['db'];var utils=require(_0x02a4('0x6'));var logger=require(_0x02a4('0x7'))(_0x02a4('0x8'));var config=require('../../config/environment');var jayson=require(_0x02a4('0x9'));var client=jayson['client']['http']({'port':0x232a});config['redis']=_['defaults'](config[_0x02a4('0xa')],{'host':_0x02a4('0xb'),'port':0x18eb});var socket=require(_0x02a4('0xc'))(new Redis(config[_0x02a4('0xa')]));require('./chatInteraction.socket')[_0x02a4('0xd')](socket);function respondWithRpcPromise(_0x1a0185,_0x4c486a,_0x516f01){return new BPromise(function(_0x259d8e,_0x73bc99){return client[_0x02a4('0xe')](_0x1a0185,_0x516f01)[_0x02a4('0xf')](function(_0x2be699){logger[_0x02a4('0x10')](_0x02a4('0x11'),_0x4c486a,_0x02a4('0x12'));logger[_0x02a4('0x13')](_0x02a4('0x14'),_0x4c486a,_0x02a4('0x12'),JSON[_0x02a4('0x15')](_0x2be699));if(_0x2be699[_0x02a4('0x16')]){if(_0x2be699[_0x02a4('0x16')][_0x02a4('0x17')]===0x1f4){logger[_0x02a4('0x16')](_0x02a4('0x11'),_0x4c486a,_0x2be699['error'][_0x02a4('0x18')]);return _0x73bc99(_0x2be699[_0x02a4('0x16')][_0x02a4('0x18')]);}logger[_0x02a4('0x16')](_0x02a4('0x11'),_0x4c486a,_0x2be699[_0x02a4('0x16')][_0x02a4('0x18')]);return _0x259d8e(_0x2be699[_0x02a4('0x16')][_0x02a4('0x18')]);}else{logger['info'](_0x02a4('0x11'),_0x4c486a,_0x02a4('0x12'));_0x259d8e(_0x2be699[_0x02a4('0x19')]['message']);}})[_0x02a4('0x1a')](function(_0x423284){logger[_0x02a4('0x16')]('ChatInteraction,\x20%s,\x20%s',_0x4c486a,_0x423284);_0x73bc99(_0x423284);});});}exports['UpdateChatInteraction']=function(_0x492bec){var _0x408995=this;return new Promise(function(_0x5ee12d,_0x3a3ec5){return db['ChatInteraction'][_0x02a4('0x1b')](_0x492bec[_0x02a4('0x1c')],{'raw':_0x492bec[_0x02a4('0x1d')]?_0x492bec['options'][_0x02a4('0x1e')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x492bec[_0x02a4('0x1d')]?_0x492bec[_0x02a4('0x1d')][_0x02a4('0x1f')]||null:null,'attributes':_0x492bec[_0x02a4('0x1d')]?_0x492bec[_0x02a4('0x1d')][_0x02a4('0x20')]||null:null,'limit':_0x492bec[_0x02a4('0x1d')]?_0x492bec['options'][_0x02a4('0x21')]||null:null})['then'](function(_0x306f2a){logger[_0x02a4('0x10')](_0x02a4('0x22'),_0x492bec);logger['debug']('UpdateChatInteraction',_0x492bec,JSON[_0x02a4('0x15')](_0x306f2a));_0x5ee12d(_0x306f2a);})[_0x02a4('0x1a')](function(_0x17eca6){logger['error'](_0x02a4('0x22'),_0x17eca6[_0x02a4('0x18')],_0x492bec);_0x3a3ec5(_0x408995['error'](0x1f4,_0x17eca6[_0x02a4('0x18')]));});});};exports[_0x02a4('0x23')]=function(_0x51ca9a){return new Promise(function(_0x4f931b,_0x5ba28c){return db[_0x02a4('0x24')]['find']({'where':_0x51ca9a['options']?_0x51ca9a[_0x02a4('0x1d')]['where']||null:null})[_0x02a4('0xf')](function(_0x327f03){if(_0x327f03){return _0x327f03[_0x02a4('0x25')](_0x51ca9a[_0x02a4('0x1c')][_0x02a4('0x26')],_['omit'](_0x51ca9a['body'],[_0x02a4('0x26'),'id'])||{});}})[_0x02a4('0x27')](function(_0x4bdcaa){logger[_0x02a4('0x10')](_0x02a4('0x28'),_0x51ca9a);logger[_0x02a4('0x13')]('AddTags',_0x51ca9a,JSON[_0x02a4('0x15')](_0x4bdcaa));_0x4f931b(_0x4bdcaa);})[_0x02a4('0x1a')](function(_0x36f46f){logger[_0x02a4('0x16')]('AddTags',_0x36f46f[_0x02a4('0x18')],_0x51ca9a);_0x5ba28c(_this[_0x02a4('0x16')](0x1f4,_0x36f46f[_0x02a4('0x18')]));});});}; \ No newline at end of file +var _0x450a=['AddTagsToChatInteraction','addTags','ids','omit','spread','AddTags','lodash','util','bluebird','randomstring','ioredis','../../config/logger','jayson/promise','client','http','redis','defaults','localhost','register','request','info','ChatInteraction,\x20%s,\x20%s','request\x20sent','debug','ChatInteraction,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','ChatInteraction','update','body','options','raw','where','limit','then','UpdateChatInteraction','catch'];(function(_0x14adac,_0x424cee){var _0x3b9cc6=function(_0x1c61b5){while(--_0x1c61b5){_0x14adac['push'](_0x14adac['shift']());}};_0x3b9cc6(++_0x424cee);}(_0x450a,0xce));var _0xa450=function(_0x4b369d,_0x265eb8){_0x4b369d=_0x4b369d-0x0;var _0x571a98=_0x450a[_0x4b369d];return _0x571a98;};'use strict';var _=require(_0xa450('0x0'));var util=require(_0xa450('0x1'));var moment=require('moment');var BPromise=require(_0xa450('0x2'));var rs=require(_0xa450('0x3'));var fs=require('fs');var Redis=require(_0xa450('0x4'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0xa450('0x5'))('rpc');var config=require('../../config/environment');var jayson=require(_0xa450('0x6'));var client=jayson[_0xa450('0x7')][_0xa450('0x8')]({'port':0x232a});config[_0xa450('0x9')]=_[_0xa450('0xa')](config[_0xa450('0x9')],{'host':_0xa450('0xb'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xa450('0x9')]));require('./chatInteraction.socket')[_0xa450('0xc')](socket);function respondWithRpcPromise(_0x22b131,_0x3124f4,_0x5a56e3){return new BPromise(function(_0x264880,_0x2aa1d0){return client[_0xa450('0xd')](_0x22b131,_0x5a56e3)['then'](function(_0x17479f){logger[_0xa450('0xe')](_0xa450('0xf'),_0x3124f4,_0xa450('0x10'));logger[_0xa450('0x11')](_0xa450('0x12'),_0x3124f4,_0xa450('0x10'),JSON[_0xa450('0x13')](_0x17479f));if(_0x17479f[_0xa450('0x14')]){if(_0x17479f[_0xa450('0x14')][_0xa450('0x15')]===0x1f4){logger[_0xa450('0x14')](_0xa450('0xf'),_0x3124f4,_0x17479f[_0xa450('0x14')]['message']);return _0x2aa1d0(_0x17479f['error'][_0xa450('0x16')]);}logger[_0xa450('0x14')]('ChatInteraction,\x20%s,\x20%s',_0x3124f4,_0x17479f['error'][_0xa450('0x16')]);return _0x264880(_0x17479f[_0xa450('0x14')]['message']);}else{logger[_0xa450('0xe')](_0xa450('0xf'),_0x3124f4,_0xa450('0x10'));_0x264880(_0x17479f[_0xa450('0x17')]['message']);}})['catch'](function(_0x3918f7){logger[_0xa450('0x14')](_0xa450('0xf'),_0x3124f4,_0x3918f7);_0x2aa1d0(_0x3918f7);});});}exports['UpdateChatInteraction']=function(_0xe1f23d){var _0x1599ad=this;return new Promise(function(_0x86d500,_0xe2d52){return db[_0xa450('0x18')][_0xa450('0x19')](_0xe1f23d[_0xa450('0x1a')],{'raw':_0xe1f23d[_0xa450('0x1b')]?_0xe1f23d['options'][_0xa450('0x1c')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0xe1f23d[_0xa450('0x1b')]?_0xe1f23d['options'][_0xa450('0x1d')]||null:null,'attributes':_0xe1f23d[_0xa450('0x1b')]?_0xe1f23d[_0xa450('0x1b')]['attributes']||null:null,'limit':_0xe1f23d[_0xa450('0x1b')]?_0xe1f23d[_0xa450('0x1b')][_0xa450('0x1e')]||null:null})[_0xa450('0x1f')](function(_0x54b4a1){logger[_0xa450('0xe')](_0xa450('0x20'),_0xe1f23d);logger[_0xa450('0x11')](_0xa450('0x20'),_0xe1f23d,JSON[_0xa450('0x13')](_0x54b4a1));_0x86d500(_0x54b4a1);})[_0xa450('0x21')](function(_0x544262){logger[_0xa450('0x14')](_0xa450('0x20'),_0x544262[_0xa450('0x16')],_0xe1f23d);_0xe2d52(_0x1599ad[_0xa450('0x14')](0x1f4,_0x544262[_0xa450('0x16')]));});});};exports[_0xa450('0x22')]=function(_0x200fd6){return new Promise(function(_0x72651b,_0x3fad94){return db['ChatInteraction']['find']({'where':_0x200fd6['options']?_0x200fd6[_0xa450('0x1b')][_0xa450('0x1d')]||null:null})[_0xa450('0x1f')](function(_0x1ad6e7){if(_0x1ad6e7){return _0x1ad6e7[_0xa450('0x23')](_0x200fd6[_0xa450('0x1a')][_0xa450('0x24')],_[_0xa450('0x25')](_0x200fd6[_0xa450('0x1a')],[_0xa450('0x24'),'id'])||{});}})[_0xa450('0x26')](function(_0x3c8253){logger['info']('AddTags',_0x200fd6);logger[_0xa450('0x11')](_0xa450('0x27'),_0x200fd6,JSON[_0xa450('0x13')](_0x3c8253));_0x72651b(_0x3c8253);})[_0xa450('0x21')](function(_0x6b86df){logger['error'](_0xa450('0x27'),_0x6b86df[_0xa450('0x16')],_0x200fd6);_0x3fad94(_this[_0xa450('0x14')](0x1f4,_0x6b86df[_0xa450('0x16')]));});});}; \ No newline at end of file diff --git a/server/api/chatInteraction/chatInteraction.socket.js b/server/api/chatInteraction/chatInteraction.socket.js index d5b436e..d1b066e 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 _0x144c=['update','emit','register','chatInteraction:','./chatInteraction.events','save','remove'];(function(_0x58a9d2,_0x31d558){var _0x41fc0b=function(_0x4c399d){while(--_0x4c399d){_0x58a9d2['push'](_0x58a9d2['shift']());}};_0x41fc0b(++_0x31d558);}(_0x144c,0x66));var _0xc144=function(_0x1ebeea,_0x2f54f4){_0x1ebeea=_0x1ebeea-0x0;var _0x576465=_0x144c[_0x1ebeea];return _0x576465;};'use strict';var ChatInteractionEvents=require(_0xc144('0x0'));var events=[_0xc144('0x1'),_0xc144('0x2'),_0xc144('0x3')];function createListener(_0x36847b,_0x48c3e6){return function(_0x225b1b){_0x48c3e6[_0xc144('0x4')](_0x36847b,_0x225b1b);};}function removeListener(_0x4c856b,_0x4f7f8e){return function(){ChatInteractionEvents['removeListener'](_0x4c856b,_0x4f7f8e);};}exports[_0xc144('0x5')]=function(_0x496d94){for(var _0x10c90d=0x0,_0x21b73a=events['length'];_0x10c90d<_0x21b73a;_0x10c90d++){var _0x56e042=events[_0x10c90d];var _0x2cee30=createListener(_0xc144('0x6')+_0x56e042,_0x496d94);ChatInteractionEvents['on'](_0x56e042,_0x2cee30);}}; \ No newline at end of file +var _0x1f27=['length','chatInteraction:','./chatInteraction.events','save','remove','update','emit','removeListener','register'];(function(_0x3d9971,_0x1772d0){var _0x43a588=function(_0x368bdc){while(--_0x368bdc){_0x3d9971['push'](_0x3d9971['shift']());}};_0x43a588(++_0x1772d0);}(_0x1f27,0x13d));var _0x71f2=function(_0x1059cf,_0x37dd9e){_0x1059cf=_0x1059cf-0x0;var _0x282d92=_0x1f27[_0x1059cf];return _0x282d92;};'use strict';var ChatInteractionEvents=require(_0x71f2('0x0'));var events=[_0x71f2('0x1'),_0x71f2('0x2'),_0x71f2('0x3')];function createListener(_0x1a9f3b,_0x494861){return function(_0x5166d7){_0x494861[_0x71f2('0x4')](_0x1a9f3b,_0x5166d7);};}function removeListener(_0x481dc7,_0x4aef68){return function(){ChatInteractionEvents[_0x71f2('0x5')](_0x481dc7,_0x4aef68);};}exports[_0x71f2('0x6')]=function(_0xd0b66){for(var _0x4411d1=0x0,_0x5c41f8=events[_0x71f2('0x7')];_0x4411d1<_0x5c41f8;_0x4411d1++){var _0x1e0b72=events[_0x4411d1];var _0x4656c3=createListener(_0x71f2('0x8')+_0x1e0b72,_0xd0b66);ChatInteractionEvents['on'](_0x1e0b72,_0x4656c3);}}; \ No newline at end of file diff --git a/server/api/chatInteraction/index.js b/server/api/chatInteraction/index.js index b8ee81d..4aad010 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 _0xa9c9=['path','express','Router','fs-extra','../../components/interaction/service','./chatInteraction.controller','get','isAuthenticated','index','/describe','/:id','isChatInteractionAuthorized','show','attachmentDownload','getMessages','/:id/my_messages','getMyMessages','download','post','diskStorage','root','server/files/attachments/','format','now','originalname','single','file','attachmentUpload','/:id/messages','addMessage','/:id/tags','tracked','chat','chatinteraction:addtags','addTags','put','update','/:id/custom_update','customUpdate','/:id/abandon','abandon','/:id/close','close','delete','chatinteraction:destroy','destroy','removeTags','exports'];(function(_0x4e0d05,_0x1252ef){var _0x568b50=function(_0x5f3071){while(--_0x5f3071){_0x4e0d05['push'](_0x4e0d05['shift']());}};_0x568b50(++_0x1252ef);}(_0xa9c9,0xf0));var _0x9a9c=function(_0x1203f,_0x554bbc){_0x1203f=_0x1203f-0x0;var _0x365f0a=_0xa9c9[_0x1203f];return _0x365f0a;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x9a9c('0x0'));var timeout=require('connect-timeout');var express=require(_0x9a9c('0x1'));var router=express[_0x9a9c('0x2')]();var fs_extra=require(_0x9a9c('0x3'));var auth=require('../../components/auth/service');var interaction=require(_0x9a9c('0x4'));var config=require('../../config/environment');var controller=require(_0x9a9c('0x5'));router[_0x9a9c('0x6')]('/',auth[_0x9a9c('0x7')](),controller[_0x9a9c('0x8')]);router[_0x9a9c('0x6')](_0x9a9c('0x9'),auth[_0x9a9c('0x7')](),controller['describe']);router[_0x9a9c('0x6')](_0x9a9c('0xa'),auth[_0x9a9c('0xb')](),controller[_0x9a9c('0xc')]);router[_0x9a9c('0x6')]('/:id/attachment_download',auth[_0x9a9c('0xb')](),controller[_0x9a9c('0xd')]);router['get']('/:id/messages',auth[_0x9a9c('0x7')](),controller[_0x9a9c('0xe')]);router[_0x9a9c('0x6')](_0x9a9c('0xf'),auth[_0x9a9c('0xb')](),controller[_0x9a9c('0x10')]);router['get']('/:id/download',auth['isAuthenticated'](),controller[_0x9a9c('0x11')]);router[_0x9a9c('0x12')]('/',auth[_0x9a9c('0x7')](),controller['create']);router['post']('/:id/vidaoo',auth[_0x9a9c('0x7')](),controller['createVidaooSession']);var upload=multer({'storage':multer[_0x9a9c('0x13')]({'destination':function(_0x209506,_0x590742,_0x57f65e){_0x57f65e(null,path['join'](config[_0x9a9c('0x14')],_0x9a9c('0x15')));},'filename':function(_0x2dbb24,_0x97b6b8,_0x1c652d){_0x1c652d(null,util[_0x9a9c('0x16')]('%s-%s',Date[_0x9a9c('0x17')](),_0x97b6b8[_0x9a9c('0x18')]['replace'](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-')));}})});router[_0x9a9c('0x12')]('/:id/attachment_upload',upload[_0x9a9c('0x19')](_0x9a9c('0x1a')),controller[_0x9a9c('0x1b')]);router['post'](_0x9a9c('0x1c'),auth['isChatInteractionAuthorized'](),controller[_0x9a9c('0x1d')]);router[_0x9a9c('0x12')](_0x9a9c('0x1e'),auth['isAuthenticated'](),interaction[_0x9a9c('0x1f')](_0x9a9c('0x20'),_0x9a9c('0x21')),controller[_0x9a9c('0x22')]);router[_0x9a9c('0x23')](_0x9a9c('0xa'),auth[_0x9a9c('0x7')](),interaction[_0x9a9c('0x1f')](_0x9a9c('0x20'),'chatinteraction:update'),controller[_0x9a9c('0x24')]);router[_0x9a9c('0x23')](_0x9a9c('0x25'),controller[_0x9a9c('0x26')]);router[_0x9a9c('0x23')](_0x9a9c('0x27'),auth[_0x9a9c('0xb')](),controller[_0x9a9c('0x28')]);router[_0x9a9c('0x23')](_0x9a9c('0x29'),controller[_0x9a9c('0x2a')]);router[_0x9a9c('0x2b')](_0x9a9c('0xa'),auth[_0x9a9c('0x7')](),interaction[_0x9a9c('0x1f')](_0x9a9c('0x20'),_0x9a9c('0x2c')),controller[_0x9a9c('0x2d')]);router[_0x9a9c('0x2b')]('/:id/tags',auth[_0x9a9c('0x7')](),controller[_0x9a9c('0x2e')]);module[_0x9a9c('0x2f')]=router; \ No newline at end of file +var _0x5caf=['path','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./chatInteraction.controller','get','isAuthenticated','index','describe','isChatInteractionAuthorized','show','/:id/attachment_download','attachmentDownload','/:id/messages','/:id/my_messages','getMyMessages','/:id/download','download','post','create','/:id/vidaoo','createVidaooSession','diskStorage','join','server/files/attachments/','format','%s-%s','originalname','replace','file','/:id/tags','tracked','chatinteraction:addtags','addTags','put','/:id','chatinteraction:update','update','/:id/custom_update','/:id/abandon','abandon','/:id/close','delete','chat','destroy','removeTags','exports','multer','util'];(function(_0x342700,_0x569f75){var _0x53406f=function(_0x3b3c32){while(--_0x3b3c32){_0x342700['push'](_0x342700['shift']());}};_0x53406f(++_0x569f75);}(_0x5caf,0x163));var _0xf5ca=function(_0x49004d,_0x156224){_0x49004d=_0x49004d-0x0;var _0x5cf353=_0x5caf[_0x49004d];return _0x5cf353;};'use strict';var multer=require(_0xf5ca('0x0'));var util=require(_0xf5ca('0x1'));var path=require(_0xf5ca('0x2'));var timeout=require('connect-timeout');var express=require(_0xf5ca('0x3'));var router=express['Router']();var fs_extra=require(_0xf5ca('0x4'));var auth=require(_0xf5ca('0x5'));var interaction=require(_0xf5ca('0x6'));var config=require(_0xf5ca('0x7'));var controller=require(_0xf5ca('0x8'));router[_0xf5ca('0x9')]('/',auth[_0xf5ca('0xa')](),controller[_0xf5ca('0xb')]);router[_0xf5ca('0x9')]('/describe',auth['isAuthenticated'](),controller[_0xf5ca('0xc')]);router['get']('/:id',auth[_0xf5ca('0xd')](),controller[_0xf5ca('0xe')]);router[_0xf5ca('0x9')](_0xf5ca('0xf'),auth['isChatInteractionAuthorized'](),controller[_0xf5ca('0x10')]);router[_0xf5ca('0x9')](_0xf5ca('0x11'),auth['isAuthenticated'](),controller['getMessages']);router['get'](_0xf5ca('0x12'),auth[_0xf5ca('0xd')](),controller[_0xf5ca('0x13')]);router[_0xf5ca('0x9')](_0xf5ca('0x14'),auth['isAuthenticated'](),controller[_0xf5ca('0x15')]);router[_0xf5ca('0x16')]('/',auth[_0xf5ca('0xa')](),controller[_0xf5ca('0x17')]);router['post'](_0xf5ca('0x18'),auth['isAuthenticated'](),controller[_0xf5ca('0x19')]);var upload=multer({'storage':multer[_0xf5ca('0x1a')]({'destination':function(_0x41353e,_0x4a7b96,_0x5753fc){_0x5753fc(null,path[_0xf5ca('0x1b')](config['root'],_0xf5ca('0x1c')));},'filename':function(_0x4b39d5,_0x3cb26a,_0x47c9b8){_0x47c9b8(null,util[_0xf5ca('0x1d')](_0xf5ca('0x1e'),Date['now'](),_0x3cb26a[_0xf5ca('0x1f')][_0xf5ca('0x20')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-')));}})});router[_0xf5ca('0x16')]('/:id/attachment_upload',upload['single'](_0xf5ca('0x21')),controller['attachmentUpload']);router[_0xf5ca('0x16')](_0xf5ca('0x11'),auth[_0xf5ca('0xd')](),controller['addMessage']);router['post'](_0xf5ca('0x22'),auth[_0xf5ca('0xa')](),interaction[_0xf5ca('0x23')]('chat',_0xf5ca('0x24')),controller[_0xf5ca('0x25')]);router[_0xf5ca('0x26')](_0xf5ca('0x27'),auth[_0xf5ca('0xa')](),interaction[_0xf5ca('0x23')]('chat',_0xf5ca('0x28')),controller[_0xf5ca('0x29')]);router[_0xf5ca('0x26')](_0xf5ca('0x2a'),controller['customUpdate']);router[_0xf5ca('0x26')](_0xf5ca('0x2b'),auth[_0xf5ca('0xd')](),controller[_0xf5ca('0x2c')]);router[_0xf5ca('0x26')](_0xf5ca('0x2d'),controller['close']);router[_0xf5ca('0x2e')](_0xf5ca('0x27'),auth['isAuthenticated'](),interaction[_0xf5ca('0x23')](_0xf5ca('0x2f'),'chatinteraction:destroy'),controller[_0xf5ca('0x30')]);router['delete'](_0xf5ca('0x22'),auth[_0xf5ca('0xa')](),controller[_0xf5ca('0x31')]);module[_0xf5ca('0x32')]=router; \ No newline at end of file diff --git a/server/api/chatInternalMessage/chatInternalMessage.attributes.js b/server/api/chatInternalMessage/chatInternalMessage.attributes.js index db8a341..7ce68d5 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 _0x2c2e=['exports','TEXT','INTEGER','sequelize'];(function(_0x14553f,_0x3be5af){var _0x2623c0=function(_0x2df415){while(--_0x2df415){_0x14553f['push'](_0x14553f['shift']());}};_0x2623c0(++_0x3be5af);}(_0x2c2e,0x19f));var _0xe2c2=function(_0x3e3182,_0x596abc){_0x3e3182=_0x3e3182-0x0;var _0xb33c81=_0x2c2e[_0x3e3182];return _0xb33c81;};'use strict';var Sequelize=require(_0xe2c2('0x0'));module[_0xe2c2('0x1')]={'body':{'type':Sequelize[_0xe2c2('0x2')]('medium'),'allowNull':![]},'read':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'ChatInternalMessageId':{'type':Sequelize[_0xe2c2('0x3')]}}; \ No newline at end of file +var _0xcee7=['medium','INTEGER','exports','TEXT'];(function(_0x220f10,_0x48e69b){var _0x448dd4=function(_0x2b1458){while(--_0x2b1458){_0x220f10['push'](_0x220f10['shift']());}};_0x448dd4(++_0x48e69b);}(_0xcee7,0x166));var _0x7cee=function(_0xfc2d89,_0x400d05){_0xfc2d89=_0xfc2d89-0x0;var _0xbcf47f=_0xcee7[_0xfc2d89];return _0xbcf47f;};'use strict';var Sequelize=require('sequelize');module[_0x7cee('0x0')]={'body':{'type':Sequelize[_0x7cee('0x1')](_0x7cee('0x2')),'allowNull':![]},'read':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'ChatInternalMessageId':{'type':Sequelize[_0x7cee('0x3')]}}; \ No newline at end of file diff --git a/server/api/chatInternalMessage/chatInternalMessage.controller.js b/server/api/chatInternalMessage/chatInternalMessage.controller.js index 2bf5533..71000b6 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 _0xcf4b=['lastMessageAt','createdAt','lastMessage','YYYY-MM-DD\x20HH:mm:ss','getUsers','User','admin','userpic','internal','lastLoginAt','allowmessenger','showWebBar','VoiceQueue','VoiceQueues','Unable\x20to\x20retrieve\x20the\x20current\x20user','user','Agents','autoAssociation','UserProfileResource','isEmpty','role','agent','push','FromId','ToId','read','-createdAt','all','eml-format','zip-dir','fast-json-patch','request-promise','mustache','util','path','sox','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','papaparse','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','localhost','./chatInternalMessage.socket','register','sendStatus','end','status','json','offset','undefined','limit','count','set','apply','reject','destroy','then','error','stack','name','send','index','map','ChatInternalMessage','rawAttributes','fieldName','model','query','keys','filters','intersection','fields','attributes','length','hasOwnProperty','sort','where','pick','filter','merge','type','VIRTUAL','options','includeAll','include','findAll','rows','params','find','create','body','catch','update','describe','messages'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xcf4b,0xf2));var _0xbcf4=function(_0x49f2f6,_0x11fa68){_0x49f2f6=_0x49f2f6-0x0;var _0x2e957a=_0xcf4b[_0x49f2f6];return _0x2e957a;};'use strict';var emlformat=require(_0xbcf4('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xbcf4('0x1'));var jsonpatch=require(_0xbcf4('0x2'));var rp=require(_0xbcf4('0x3'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0xbcf4('0x4'));var util=require(_0xbcf4('0x5'));var path=require(_0xbcf4('0x6'));var sox=require(_0xbcf4('0x7'));var csv=require(_0xbcf4('0x8'));var ejs=require(_0xbcf4('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xbcf4('0xa'));var squel=require(_0xbcf4('0xb'));var crypto=require(_0xbcf4('0xc'));var jsforce=require(_0xbcf4('0xd'));var deskjs=require(_0xbcf4('0xe'));var toCsv=require(_0xbcf4('0x8'));var querystring=require('querystring');var Papa=require(_0xbcf4('0xf'));var Redis=require('ioredis');var authService=require(_0xbcf4('0x10'));var qs=require(_0xbcf4('0x11'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xbcf4('0x12'));var logger=require('../../config/logger')(_0xbcf4('0x13'));var utils=require(_0xbcf4('0x14'));var config=require(_0xbcf4('0x15'));var licenseUtil=require(_0xbcf4('0x16'));var db=require(_0xbcf4('0x17'))['db'];config[_0xbcf4('0x18')]=_['defaults'](config[_0xbcf4('0x18')],{'host':_0xbcf4('0x19'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xbcf4('0x18')]));require(_0xbcf4('0x1a'))[_0xbcf4('0x1b')](socket);function respondWithStatusCode(_0x4dcfdf,_0x388372){_0x388372=_0x388372||0xcc;return function(_0x1ef87c){if(_0x1ef87c){return _0x4dcfdf[_0xbcf4('0x1c')](_0x388372);}return _0x4dcfdf['status'](_0x388372)[_0xbcf4('0x1d')]();};}function respondWithResult(_0x1bfc5f,_0x327641){_0x327641=_0x327641||0xc8;return function(_0x353bf6){if(_0x353bf6){return _0x1bfc5f[_0xbcf4('0x1e')](_0x327641)[_0xbcf4('0x1f')](_0x353bf6);}};}function respondWithFilteredResult(_0x4b36ac,_0x22927d){return function(_0x54d04a){if(_0x54d04a){var _0x5b91c7=typeof _0x22927d[_0xbcf4('0x20')]===_0xbcf4('0x21')&&typeof _0x22927d[_0xbcf4('0x22')]==='undefined';var _0x326366=_0x54d04a[_0xbcf4('0x23')];var _0x40bd14=_0x5b91c7?0x0:_0x22927d[_0xbcf4('0x20')];var _0x33466e=_0x5b91c7?_0x54d04a['count']:_0x22927d[_0xbcf4('0x20')]+_0x22927d[_0xbcf4('0x22')];var _0xf73431;if(_0x33466e>=_0x326366){_0x33466e=_0x326366;_0xf73431=0xc8;}else{_0xf73431=0xce;}_0x4b36ac[_0xbcf4('0x1e')](_0xf73431);return _0x4b36ac[_0xbcf4('0x24')]('Content-Range',_0x40bd14+'-'+_0x33466e+'/'+_0x326366)[_0xbcf4('0x1f')](_0x54d04a);}return null;};}function patchUpdates(_0x1e868a){return function(_0x1bb23b){try{jsonpatch[_0xbcf4('0x25')](_0x1bb23b,_0x1e868a,!![]);}catch(_0x70b57){return BPromise[_0xbcf4('0x26')](_0x70b57);}return _0x1bb23b['save']();};}function saveUpdates(_0x6953f1,_0x1fdf05){return function(_0x235d90){if(_0x235d90){return _0x235d90['update'](_0x6953f1)['then'](function(_0x3be6b1){return _0x3be6b1;});}return null;};}function removeEntity(_0xab2b94,_0x20e3db){return function(_0x21cee0){if(_0x21cee0){return _0x21cee0[_0xbcf4('0x27')]()[_0xbcf4('0x28')](function(){_0xab2b94[_0xbcf4('0x1e')](0xcc)[_0xbcf4('0x1d')]();});}};}function handleEntityNotFound(_0x39c894,_0x694325){return function(_0x350ba0){if(!_0x350ba0){_0x39c894['sendStatus'](0x194);}return _0x350ba0;};}function handleError(_0x23b770,_0x52d980){_0x52d980=_0x52d980||0x1f4;return function(_0x4e2196){logger[_0xbcf4('0x29')](_0x4e2196[_0xbcf4('0x2a')]);if(_0x4e2196[_0xbcf4('0x2b')]){delete _0x4e2196[_0xbcf4('0x2b')];}_0x23b770['status'](_0x52d980)[_0xbcf4('0x2c')](_0x4e2196);};}exports[_0xbcf4('0x2d')]=function(_0x357845,_0x506cf9){var _0x3be774={},_0xfae094={},_0x2441c6={'count':0x0,'rows':[]};var _0x3c8caf=_[_0xbcf4('0x2e')](db[_0xbcf4('0x2f')][_0xbcf4('0x30')],function(_0x37cc3a){return{'name':_0x37cc3a[_0xbcf4('0x31')],'type':_0x37cc3a['type']['key']};});_0xfae094[_0xbcf4('0x32')]=_[_0xbcf4('0x2e')](_0x3c8caf,_0xbcf4('0x2b'));_0xfae094[_0xbcf4('0x33')]=_[_0xbcf4('0x34')](_0x357845[_0xbcf4('0x33')]);_0xfae094[_0xbcf4('0x35')]=_[_0xbcf4('0x36')](_0xfae094['model'],_0xfae094['query']);_0x3be774['attributes']=_['intersection'](_0xfae094[_0xbcf4('0x32')],qs[_0xbcf4('0x37')](_0x357845[_0xbcf4('0x33')][_0xbcf4('0x37')]));_0x3be774[_0xbcf4('0x38')]=_0x3be774['attributes'][_0xbcf4('0x39')]?_0x3be774[_0xbcf4('0x38')]:_0xfae094[_0xbcf4('0x32')];if(!_0x357845['query'][_0xbcf4('0x3a')]('nolimit')){_0x3be774[_0xbcf4('0x22')]=qs[_0xbcf4('0x22')](_0x357845[_0xbcf4('0x33')]['limit']);_0x3be774['offset']=qs[_0xbcf4('0x20')](_0x357845[_0xbcf4('0x33')][_0xbcf4('0x20')]);}_0x3be774['order']=qs[_0xbcf4('0x3b')](_0x357845[_0xbcf4('0x33')][_0xbcf4('0x3b')]);_0x3be774[_0xbcf4('0x3c')]=qs['filters'](_[_0xbcf4('0x3d')](_0x357845['query'],_0xfae094[_0xbcf4('0x35')]),_0x3c8caf);if(_0x357845['query'][_0xbcf4('0x3e')]){_0x3be774[_0xbcf4('0x3c')]=_[_0xbcf4('0x3f')](_0x3be774['where'],{'$or':_[_0xbcf4('0x2e')](_0x3c8caf,function(_0x1ad149){if(_0x1ad149[_0xbcf4('0x40')]!==_0xbcf4('0x41')){var _0x4ab24b={};_0x4ab24b[_0x1ad149['name']]={'$like':'%'+_0x357845['query']['filter']+'%'};return _0x4ab24b;}})});}_0x3be774=_[_0xbcf4('0x3f')]({},_0x3be774,_0x357845[_0xbcf4('0x42')]);var _0x581ac1={'where':_0x3be774[_0xbcf4('0x3c')]};return db['ChatInternalMessage'][_0xbcf4('0x23')](_0x581ac1)[_0xbcf4('0x28')](function(_0x391513){_0x2441c6[_0xbcf4('0x23')]=_0x391513;if(_0x357845[_0xbcf4('0x33')][_0xbcf4('0x43')]){_0x3be774[_0xbcf4('0x44')]=[{'all':!![]}];}return db[_0xbcf4('0x2f')][_0xbcf4('0x45')](_0x3be774);})['then'](function(_0x19b095){_0x2441c6[_0xbcf4('0x46')]=_0x19b095;return _0x2441c6;})[_0xbcf4('0x28')](respondWithFilteredResult(_0x506cf9,_0x3be774))['catch'](handleError(_0x506cf9,null));};exports['show']=function(_0x5c4632,_0x2511d9){var _0x197ad1={'raw':!![],'where':{'id':_0x5c4632[_0xbcf4('0x47')]['id']}},_0x911221={};_0x911221[_0xbcf4('0x32')]=_[_0xbcf4('0x34')](db[_0xbcf4('0x2f')][_0xbcf4('0x30')]);_0x911221['query']=_[_0xbcf4('0x34')](_0x5c4632[_0xbcf4('0x33')]);_0x911221['filters']=_[_0xbcf4('0x36')](_0x911221[_0xbcf4('0x32')],_0x911221[_0xbcf4('0x33')]);_0x197ad1['attributes']=_[_0xbcf4('0x36')](_0x911221['model'],qs[_0xbcf4('0x37')](_0x5c4632['query'][_0xbcf4('0x37')]));_0x197ad1['attributes']=_0x197ad1[_0xbcf4('0x38')][_0xbcf4('0x39')]?_0x197ad1[_0xbcf4('0x38')]:_0x911221['model'];if(_0x5c4632[_0xbcf4('0x33')][_0xbcf4('0x43')]){_0x197ad1[_0xbcf4('0x44')]=[{'all':!![]}];}_0x197ad1=_[_0xbcf4('0x3f')]({},_0x197ad1,_0x5c4632[_0xbcf4('0x42')]);return db[_0xbcf4('0x2f')][_0xbcf4('0x48')](_0x197ad1)[_0xbcf4('0x28')](handleEntityNotFound(_0x2511d9,null))[_0xbcf4('0x28')](respondWithResult(_0x2511d9,null))['catch'](handleError(_0x2511d9,null));};exports[_0xbcf4('0x49')]=function(_0x55e4e7,_0x3faf63){return db[_0xbcf4('0x2f')]['create'](_0x55e4e7[_0xbcf4('0x4a')],{})[_0xbcf4('0x28')](respondWithResult(_0x3faf63,0xc9))[_0xbcf4('0x4b')](handleError(_0x3faf63,null));};exports[_0xbcf4('0x4c')]=function(_0x1d3bd4,_0x2ca44f){if(_0x1d3bd4['body']['id']){delete _0x1d3bd4[_0xbcf4('0x4a')]['id'];}return db[_0xbcf4('0x2f')][_0xbcf4('0x48')]({'where':{'id':_0x1d3bd4[_0xbcf4('0x47')]['id']}})['then'](handleEntityNotFound(_0x2ca44f,null))[_0xbcf4('0x28')](saveUpdates(_0x1d3bd4[_0xbcf4('0x4a')],null))[_0xbcf4('0x28')](respondWithResult(_0x2ca44f,null))[_0xbcf4('0x4b')](handleError(_0x2ca44f,null));};exports[_0xbcf4('0x27')]=function(_0x13907e,_0x2a8cdb){return db[_0xbcf4('0x2f')][_0xbcf4('0x48')]({'where':{'id':_0x13907e[_0xbcf4('0x47')]['id']}})['then'](handleEntityNotFound(_0x2a8cdb,null))[_0xbcf4('0x28')](removeEntity(_0x2a8cdb,null))[_0xbcf4('0x4b')](handleError(_0x2a8cdb,null));};exports[_0xbcf4('0x4d')]=function(_0x47d60a,_0x5db843){return db[_0xbcf4('0x2f')][_0xbcf4('0x4d')]()[_0xbcf4('0x28')](respondWithResult(_0x5db843,null))[_0xbcf4('0x4b')](handleError(_0x5db843,null));};function wrapUser(_0x56414e){return function(_0x804572){var _0x490478=_0x56414e['get']({'plain':!![]});_0x490478[_0xbcf4('0x4e')]=[];if(_0x804572){_0x490478[_0xbcf4('0x4f')]=_0x804572[_0xbcf4('0x50')];_0x490478[_0xbcf4('0x51')]=_0x804572;}else{_0x490478[_0xbcf4('0x4f')]=moment(0x0)['format'](_0xbcf4('0x52'));_0x490478[_0xbcf4('0x51')]={};}return _0x490478;};}exports[_0xbcf4('0x53')]=function(_0x11a81d,_0x20830e,_0xa288a){var _0x50fff5=[];return db[_0xbcf4('0x54')]['findAll']({'where':{'role':['agent',_0xbcf4('0x55'),'user']},'attributes':['id','fullname',_0xbcf4('0x2b'),'role',_0xbcf4('0x56'),_0xbcf4('0x57'),'online',_0xbcf4('0x58'),_0xbcf4('0x59'),_0xbcf4('0x5a')],'order':qs[_0xbcf4('0x3b')]('-online'),'include':[{'model':db[_0xbcf4('0x5b')],'as':_0xbcf4('0x5c'),'attributes':['id',_0xbcf4('0x2b'),_0xbcf4('0x40')],'through':{'attributes':[]}}]})[_0xbcf4('0x28')](function(_0x1c92d5){if(_0x1c92d5){var _0x356e42=_0x11a81d['user']['get']({'plain':!![]});if(!_0x356e42)throw new Error(_0xbcf4('0x5d'));if(_0x356e42['role']===_0xbcf4('0x5e')){return db['UserProfileSection'][_0xbcf4('0x48')]({'where':{'name':_0xbcf4('0x5f'),'userProfileId':_0x356e42['userProfileId']},'raw':!![]})['then'](function(_0x5ea491){if(_0x5ea491){if(_0x5ea491[_0xbcf4('0x60')]===0x0){return db[_0xbcf4('0x61')][_0xbcf4('0x45')]({'where':{'sectionId':_0x5ea491['id']},'raw':!![]})[_0xbcf4('0x28')](function(_0x58a283){var _0x5689ed=[];if(_[_0xbcf4('0x62')](_0x58a283)){_0x5689ed=_[_0xbcf4('0x3e')](_0x1c92d5,function(_0x49bf05){if(_0x49bf05[_0xbcf4('0x63')]!==_0xbcf4('0x64')){return _0x49bf05;}});return _0x5689ed;}else{for(var _0x54192d=0x0;_0x54192d<_0x1c92d5[_0xbcf4('0x39')];_0x54192d++){var _0x2b7a05=_0x1c92d5[_0x54192d];if(_0x2b7a05[_0xbcf4('0x63')]===_0xbcf4('0x64')){var _0x2f9e1a=_[_0xbcf4('0x48')](_0x58a283,function(_0x1fb15e){return _0x1fb15e['resourceId']===_0x2b7a05['id'];});if(_0x2f9e1a)_0x5689ed[_0xbcf4('0x65')](_0x2b7a05);}else{_0x5689ed['push'](_0x2b7a05);}}return _0x5689ed;}});}else{return _0x1c92d5;}}else{var _0x2ce064=_[_0xbcf4('0x3e')](_0x1c92d5,function(_0x5e7086){if(_0x5e7086[_0xbcf4('0x63')]!==_0xbcf4('0x64')){return _0x5e7086;}});return _0x2ce064;}});}else{return _0x1c92d5;}}})[_0xbcf4('0x28')](function(_0x50dac5){var _0x23a8af=[];if(_0x50dac5){_0x50fff5=_0x50dac5;for(var _0x310a0f=0x0;_0x310a0f<_0x50dac5['length'];_0x310a0f+=0x1){_0x50fff5[_0x310a0f][_0xbcf4('0x4e')]=[];_0x23a8af[_0xbcf4('0x65')](db[_0xbcf4('0x2f')][_0xbcf4('0x48')]({'where':{'FromId':[_0x11a81d['user']['id'],_0x50dac5[_0x310a0f]['id']],'ToId':[_0x11a81d[_0xbcf4('0x5e')]['id'],_0x50dac5[_0x310a0f]['id']],'ChatGroupId':null},'attributes':['id',_0xbcf4('0x50'),_0xbcf4('0x66'),_0xbcf4('0x67'),_0xbcf4('0x68'),_0xbcf4('0x4a')],'order':qs['sort'](_0xbcf4('0x69')),'limit':0x1,'offset':0x0,'raw':!![]})[_0xbcf4('0x28')](wrapUser(_0x50dac5[_0x310a0f])));}return BPromise[_0xbcf4('0x6a')](_0x23a8af);}return[];})[_0xbcf4('0x28')](function(_0x439107){return{'rows':_0x439107,'count':_0x439107[_0xbcf4('0x39')]};})[_0xbcf4('0x28')](respondWithResult(_0x20830e,null))[_0xbcf4('0x4b')](handleError(_0x20830e,null));}; \ No newline at end of file +var _0xeca9=['../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','localhost','socket.io-emitter','./chatInternalMessage.socket','register','sendStatus','status','json','offset','undefined','limit','count','set','reject','save','update','destroy','end','error','stack','name','send','map','ChatInternalMessage','rawAttributes','fieldName','model','query','filters','attributes','intersection','fields','hasOwnProperty','nolimit','order','sort','where','pick','merge','type','options','includeAll','include','findAll','then','show','keys','length','find','catch','create','body','params','describe','messages','lastMessageAt','createdAt','lastMessage','format','YYYY-MM-DD\x20HH:mm:ss','User','agent','admin','user','fullname','role','userpic','internal','online','lastLoginAt','allowmessenger','-online','VoiceQueue','VoiceQueues','get','UserProfileSection','Agents','userProfileId','autoAssociation','UserProfileResource','isEmpty','resourceId','filter','ToId','read','-createdAt','eml-format','rimraf','fast-json-patch','moment','bluebird','mustache','util','sox','to-csv','ejs','jsforce','ioredis','../../components/auth/service'];(function(_0x4cf9db,_0x3638b5){var _0x4367e0=function(_0x3bc705){while(--_0x3bc705){_0x4cf9db['push'](_0x4cf9db['shift']());}};_0x4367e0(++_0x3638b5);}(_0xeca9,0x1a3));var _0x9eca=function(_0x563406,_0x5495e1){_0x563406=_0x563406-0x0;var _0x5e90f7=_0xeca9[_0x563406];return _0x5e90f7;};'use strict';var emlformat=require(_0x9eca('0x0'));var rimraf=require(_0x9eca('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x9eca('0x2'));var rp=require('request-promise');var moment=require(_0x9eca('0x3'));var BPromise=require(_0x9eca('0x4'));var Mustache=require(_0x9eca('0x5'));var util=require(_0x9eca('0x6'));var path=require('path');var sox=require(_0x9eca('0x7'));var csv=require(_0x9eca('0x8'));var ejs=require(_0x9eca('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0x9eca('0xa'));var deskjs=require('desk.js');var toCsv=require(_0x9eca('0x8'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x9eca('0xb'));var authService=require(_0x9eca('0xc'));var qs=require(_0x9eca('0xd'));var as=require(_0x9eca('0xe'));var hardwareService=require(_0x9eca('0xf'));var logger=require(_0x9eca('0x10'))(_0x9eca('0x11'));var utils=require(_0x9eca('0x12'));var config=require(_0x9eca('0x13'));var licenseUtil=require(_0x9eca('0x14'));var db=require(_0x9eca('0x15'))['db'];config[_0x9eca('0x16')]=_['defaults'](config[_0x9eca('0x16')],{'host':_0x9eca('0x17'),'port':0x18eb});var socket=require(_0x9eca('0x18'))(new Redis(config[_0x9eca('0x16')]));require(_0x9eca('0x19'))[_0x9eca('0x1a')](socket);function respondWithStatusCode(_0x3888bc,_0x22f777){_0x22f777=_0x22f777||0xcc;return function(_0x155aba){if(_0x155aba){return _0x3888bc[_0x9eca('0x1b')](_0x22f777);}return _0x3888bc[_0x9eca('0x1c')](_0x22f777)['end']();};}function respondWithResult(_0x59d978,_0x1ddb40){_0x1ddb40=_0x1ddb40||0xc8;return function(_0x38da00){if(_0x38da00){return _0x59d978[_0x9eca('0x1c')](_0x1ddb40)[_0x9eca('0x1d')](_0x38da00);}};}function respondWithFilteredResult(_0xee2011,_0x58fb2d){return function(_0x551204){if(_0x551204){var _0x152b5c=typeof _0x58fb2d[_0x9eca('0x1e')]===_0x9eca('0x1f')&&typeof _0x58fb2d[_0x9eca('0x20')]===_0x9eca('0x1f');var _0x284789=_0x551204[_0x9eca('0x21')];var _0x214984=_0x152b5c?0x0:_0x58fb2d[_0x9eca('0x1e')];var _0x307b7b=_0x152b5c?_0x551204['count']:_0x58fb2d['offset']+_0x58fb2d[_0x9eca('0x20')];var _0x531f72;if(_0x307b7b>=_0x284789){_0x307b7b=_0x284789;_0x531f72=0xc8;}else{_0x531f72=0xce;}_0xee2011[_0x9eca('0x1c')](_0x531f72);return _0xee2011[_0x9eca('0x22')]('Content-Range',_0x214984+'-'+_0x307b7b+'/'+_0x284789)['json'](_0x551204);}return null;};}function patchUpdates(_0x5e0988){return function(_0x3a90b7){try{jsonpatch['apply'](_0x3a90b7,_0x5e0988,!![]);}catch(_0x41d2bc){return BPromise[_0x9eca('0x23')](_0x41d2bc);}return _0x3a90b7[_0x9eca('0x24')]();};}function saveUpdates(_0x1624eb,_0x15e78b){return function(_0x401dfa){if(_0x401dfa){return _0x401dfa[_0x9eca('0x25')](_0x1624eb)['then'](function(_0xef6aac){return _0xef6aac;});}return null;};}function removeEntity(_0x1cd3ae,_0x19b409){return function(_0x3772bf){if(_0x3772bf){return _0x3772bf[_0x9eca('0x26')]()['then'](function(){_0x1cd3ae[_0x9eca('0x1c')](0xcc)[_0x9eca('0x27')]();});}};}function handleEntityNotFound(_0x4364c7,_0x1538c){return function(_0x48a7f4){if(!_0x48a7f4){_0x4364c7['sendStatus'](0x194);}return _0x48a7f4;};}function handleError(_0x1ffba1,_0x23d856){_0x23d856=_0x23d856||0x1f4;return function(_0x4f0458){logger[_0x9eca('0x28')](_0x4f0458[_0x9eca('0x29')]);if(_0x4f0458[_0x9eca('0x2a')]){delete _0x4f0458['name'];}_0x1ffba1[_0x9eca('0x1c')](_0x23d856)[_0x9eca('0x2b')](_0x4f0458);};}exports['index']=function(_0x2a130a,_0x274343){var _0x4cf5d4={},_0x16a6f5={},_0x4323b5={'count':0x0,'rows':[]};var _0xe061fe=_[_0x9eca('0x2c')](db[_0x9eca('0x2d')][_0x9eca('0x2e')],function(_0x40974c){return{'name':_0x40974c[_0x9eca('0x2f')],'type':_0x40974c['type']['key']};});_0x16a6f5[_0x9eca('0x30')]=_['map'](_0xe061fe,_0x9eca('0x2a'));_0x16a6f5[_0x9eca('0x31')]=_['keys'](_0x2a130a[_0x9eca('0x31')]);_0x16a6f5[_0x9eca('0x32')]=_['intersection'](_0x16a6f5[_0x9eca('0x30')],_0x16a6f5[_0x9eca('0x31')]);_0x4cf5d4[_0x9eca('0x33')]=_[_0x9eca('0x34')](_0x16a6f5[_0x9eca('0x30')],qs[_0x9eca('0x35')](_0x2a130a[_0x9eca('0x31')][_0x9eca('0x35')]));_0x4cf5d4[_0x9eca('0x33')]=_0x4cf5d4[_0x9eca('0x33')]['length']?_0x4cf5d4['attributes']:_0x16a6f5['model'];if(!_0x2a130a[_0x9eca('0x31')][_0x9eca('0x36')](_0x9eca('0x37'))){_0x4cf5d4['limit']=qs[_0x9eca('0x20')](_0x2a130a[_0x9eca('0x31')][_0x9eca('0x20')]);_0x4cf5d4[_0x9eca('0x1e')]=qs['offset'](_0x2a130a[_0x9eca('0x31')]['offset']);}_0x4cf5d4[_0x9eca('0x38')]=qs[_0x9eca('0x39')](_0x2a130a[_0x9eca('0x31')][_0x9eca('0x39')]);_0x4cf5d4[_0x9eca('0x3a')]=qs[_0x9eca('0x32')](_[_0x9eca('0x3b')](_0x2a130a[_0x9eca('0x31')],_0x16a6f5[_0x9eca('0x32')]),_0xe061fe);if(_0x2a130a[_0x9eca('0x31')]['filter']){_0x4cf5d4[_0x9eca('0x3a')]=_[_0x9eca('0x3c')](_0x4cf5d4[_0x9eca('0x3a')],{'$or':_[_0x9eca('0x2c')](_0xe061fe,function(_0x5abfe4){if(_0x5abfe4[_0x9eca('0x3d')]!=='VIRTUAL'){var _0x3b4c90={};_0x3b4c90[_0x5abfe4[_0x9eca('0x2a')]]={'$like':'%'+_0x2a130a[_0x9eca('0x31')]['filter']+'%'};return _0x3b4c90;}})});}_0x4cf5d4=_[_0x9eca('0x3c')]({},_0x4cf5d4,_0x2a130a[_0x9eca('0x3e')]);var _0x569b8a={'where':_0x4cf5d4[_0x9eca('0x3a')]};return db[_0x9eca('0x2d')]['count'](_0x569b8a)['then'](function(_0x37ebca){_0x4323b5[_0x9eca('0x21')]=_0x37ebca;if(_0x2a130a['query'][_0x9eca('0x3f')]){_0x4cf5d4[_0x9eca('0x40')]=[{'all':!![]}];}return db[_0x9eca('0x2d')][_0x9eca('0x41')](_0x4cf5d4);})['then'](function(_0x29c7e8){_0x4323b5['rows']=_0x29c7e8;return _0x4323b5;})[_0x9eca('0x42')](respondWithFilteredResult(_0x274343,_0x4cf5d4))['catch'](handleError(_0x274343,null));};exports[_0x9eca('0x43')]=function(_0x57ac75,_0x2baf48){var _0x2cc9d0={'raw':!![],'where':{'id':_0x57ac75['params']['id']}},_0x4fe32b={};_0x4fe32b[_0x9eca('0x30')]=_[_0x9eca('0x44')](db[_0x9eca('0x2d')][_0x9eca('0x2e')]);_0x4fe32b['query']=_[_0x9eca('0x44')](_0x57ac75['query']);_0x4fe32b[_0x9eca('0x32')]=_[_0x9eca('0x34')](_0x4fe32b[_0x9eca('0x30')],_0x4fe32b[_0x9eca('0x31')]);_0x2cc9d0[_0x9eca('0x33')]=_[_0x9eca('0x34')](_0x4fe32b[_0x9eca('0x30')],qs[_0x9eca('0x35')](_0x57ac75[_0x9eca('0x31')][_0x9eca('0x35')]));_0x2cc9d0[_0x9eca('0x33')]=_0x2cc9d0[_0x9eca('0x33')][_0x9eca('0x45')]?_0x2cc9d0[_0x9eca('0x33')]:_0x4fe32b['model'];if(_0x57ac75[_0x9eca('0x31')][_0x9eca('0x3f')]){_0x2cc9d0[_0x9eca('0x40')]=[{'all':!![]}];}_0x2cc9d0=_['merge']({},_0x2cc9d0,_0x57ac75[_0x9eca('0x3e')]);return db[_0x9eca('0x2d')][_0x9eca('0x46')](_0x2cc9d0)[_0x9eca('0x42')](handleEntityNotFound(_0x2baf48,null))[_0x9eca('0x42')](respondWithResult(_0x2baf48,null))[_0x9eca('0x47')](handleError(_0x2baf48,null));};exports[_0x9eca('0x48')]=function(_0x40dadf,_0x3316bf){return db[_0x9eca('0x2d')][_0x9eca('0x48')](_0x40dadf[_0x9eca('0x49')],{})[_0x9eca('0x42')](respondWithResult(_0x3316bf,0xc9))[_0x9eca('0x47')](handleError(_0x3316bf,null));};exports['update']=function(_0x3f6c4c,_0x4de9b5){if(_0x3f6c4c[_0x9eca('0x49')]['id']){delete _0x3f6c4c[_0x9eca('0x49')]['id'];}return db[_0x9eca('0x2d')][_0x9eca('0x46')]({'where':{'id':_0x3f6c4c[_0x9eca('0x4a')]['id']}})[_0x9eca('0x42')](handleEntityNotFound(_0x4de9b5,null))['then'](saveUpdates(_0x3f6c4c['body'],null))[_0x9eca('0x42')](respondWithResult(_0x4de9b5,null))['catch'](handleError(_0x4de9b5,null));};exports['destroy']=function(_0x2ad793,_0x1203c8){return db[_0x9eca('0x2d')][_0x9eca('0x46')]({'where':{'id':_0x2ad793[_0x9eca('0x4a')]['id']}})['then'](handleEntityNotFound(_0x1203c8,null))[_0x9eca('0x42')](removeEntity(_0x1203c8,null))[_0x9eca('0x47')](handleError(_0x1203c8,null));};exports[_0x9eca('0x4b')]=function(_0x588ed7,_0xf3cf7e){return db[_0x9eca('0x2d')][_0x9eca('0x4b')]()[_0x9eca('0x42')](respondWithResult(_0xf3cf7e,null))[_0x9eca('0x47')](handleError(_0xf3cf7e,null));};function wrapUser(_0x17fd7d){return function(_0x376a19){var _0x63705e=_0x17fd7d['get']({'plain':!![]});_0x63705e[_0x9eca('0x4c')]=[];if(_0x376a19){_0x63705e[_0x9eca('0x4d')]=_0x376a19[_0x9eca('0x4e')];_0x63705e[_0x9eca('0x4f')]=_0x376a19;}else{_0x63705e['lastMessageAt']=moment(0x0)[_0x9eca('0x50')](_0x9eca('0x51'));_0x63705e[_0x9eca('0x4f')]={};}return _0x63705e;};}exports['getUsers']=function(_0x41dd93,_0x36a388,_0x45aae3){var _0x2ce0e3=[];return db[_0x9eca('0x52')][_0x9eca('0x41')]({'where':{'role':[_0x9eca('0x53'),_0x9eca('0x54'),_0x9eca('0x55')]},'attributes':['id',_0x9eca('0x56'),'name',_0x9eca('0x57'),_0x9eca('0x58'),_0x9eca('0x59'),_0x9eca('0x5a'),_0x9eca('0x5b'),_0x9eca('0x5c'),'showWebBar'],'order':qs[_0x9eca('0x39')](_0x9eca('0x5d')),'include':[{'model':db[_0x9eca('0x5e')],'as':_0x9eca('0x5f'),'attributes':['id','name',_0x9eca('0x3d')],'through':{'attributes':[]}}]})[_0x9eca('0x42')](function(_0x25dbb5){if(_0x25dbb5){var _0x46320e=_0x41dd93[_0x9eca('0x55')][_0x9eca('0x60')]({'plain':!![]});if(!_0x46320e)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x46320e[_0x9eca('0x57')]===_0x9eca('0x55')){return db[_0x9eca('0x61')]['find']({'where':{'name':_0x9eca('0x62'),'userProfileId':_0x46320e[_0x9eca('0x63')]},'raw':!![]})[_0x9eca('0x42')](function(_0x30317e){if(_0x30317e){if(_0x30317e[_0x9eca('0x64')]===0x0){return db[_0x9eca('0x65')][_0x9eca('0x41')]({'where':{'sectionId':_0x30317e['id']},'raw':!![]})[_0x9eca('0x42')](function(_0x3cdf26){var _0x5151a9=[];if(_[_0x9eca('0x66')](_0x3cdf26)){_0x5151a9=_['filter'](_0x25dbb5,function(_0x373f4e){if(_0x373f4e[_0x9eca('0x57')]!==_0x9eca('0x53')){return _0x373f4e;}});return _0x5151a9;}else{for(var _0x4e9734=0x0;_0x4e9734<_0x25dbb5['length'];_0x4e9734++){var _0x5845d1=_0x25dbb5[_0x4e9734];if(_0x5845d1[_0x9eca('0x57')]===_0x9eca('0x53')){var _0x227304=_[_0x9eca('0x46')](_0x3cdf26,function(_0x220db1){return _0x220db1[_0x9eca('0x67')]===_0x5845d1['id'];});if(_0x227304)_0x5151a9['push'](_0x5845d1);}else{_0x5151a9['push'](_0x5845d1);}}return _0x5151a9;}});}else{return _0x25dbb5;}}else{var _0x465dc5=_[_0x9eca('0x68')](_0x25dbb5,function(_0x1dc53d){if(_0x1dc53d[_0x9eca('0x57')]!==_0x9eca('0x53')){return _0x1dc53d;}});return _0x465dc5;}});}else{return _0x25dbb5;}}})['then'](function(_0x29d89f){var _0x530715=[];if(_0x29d89f){_0x2ce0e3=_0x29d89f;for(var _0x5c65b2=0x0;_0x5c65b2<_0x29d89f[_0x9eca('0x45')];_0x5c65b2+=0x1){_0x2ce0e3[_0x5c65b2][_0x9eca('0x4c')]=[];_0x530715['push'](db[_0x9eca('0x2d')][_0x9eca('0x46')]({'where':{'FromId':[_0x41dd93[_0x9eca('0x55')]['id'],_0x29d89f[_0x5c65b2]['id']],'ToId':[_0x41dd93[_0x9eca('0x55')]['id'],_0x29d89f[_0x5c65b2]['id']],'ChatGroupId':null},'attributes':['id','createdAt','FromId',_0x9eca('0x69'),_0x9eca('0x6a'),_0x9eca('0x49')],'order':qs['sort'](_0x9eca('0x6b')),'limit':0x1,'offset':0x0,'raw':!![]})['then'](wrapUser(_0x29d89f[_0x5c65b2])));}return BPromise['all'](_0x530715);}return[];})[_0x9eca('0x42')](function(_0x4fec9b){return{'rows':_0x4fec9b,'count':_0x4fec9b[_0x9eca('0x45')]};})[_0x9eca('0x42')](respondWithResult(_0x36a388,null))[_0x9eca('0x47')](handleError(_0x36a388,null));}; \ No newline at end of file diff --git a/server/api/chatInternalMessage/chatInternalMessage.events.js b/server/api/chatInternalMessage/chatInternalMessage.events.js index 10ce2b6..dbcf10a 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 _0xe810=['../../mysqldb','ChatInternalMessage','setMaxListeners','update','remove','emit','hasOwnProperty','hook'];(function(_0x4500df,_0xaaf3ca){var _0x4e3018=function(_0x45a11a){while(--_0x45a11a){_0x4500df['push'](_0x4500df['shift']());}};_0x4e3018(++_0xaaf3ca);}(_0xe810,0xf0));var _0x0e81=function(_0x1e159e,_0x426d76){_0x1e159e=_0x1e159e-0x0;var _0x107cd7=_0xe810[_0x1e159e];return _0x107cd7;};'use strict';var EventEmitter=require('events');var ChatInternalMessage=require(_0x0e81('0x0'))['db'][_0x0e81('0x1')];var ChatInternalMessageEvents=new EventEmitter();ChatInternalMessageEvents[_0x0e81('0x2')](0x0);var events={'afterCreate':'save','afterUpdate':_0x0e81('0x3'),'afterDestroy':_0x0e81('0x4')};function emitEvent(_0x4cd910){return function(_0x144a4f,_0x2b5477,_0x320ae0){ChatInternalMessageEvents[_0x0e81('0x5')](_0x4cd910+':'+_0x144a4f['id'],_0x144a4f);ChatInternalMessageEvents[_0x0e81('0x5')](_0x4cd910,_0x144a4f);_0x320ae0(null);};}for(var e in events){if(events[_0x0e81('0x6')](e)){var event=events[e];ChatInternalMessage[_0x0e81('0x7')](e,emitEvent(event));}}module['exports']=ChatInternalMessageEvents; \ No newline at end of file +var _0x342c=['update','remove','emit','hook','exports','events','../../mysqldb','setMaxListeners','save'];(function(_0x354a41,_0x46dcc0){var _0x2feeb8=function(_0x46d3d1){while(--_0x46d3d1){_0x354a41['push'](_0x354a41['shift']());}};_0x2feeb8(++_0x46dcc0);}(_0x342c,0x149));var _0xc342=function(_0x832c1a,_0x1700c8){_0x832c1a=_0x832c1a-0x0;var _0x5a8c69=_0x342c[_0x832c1a];return _0x5a8c69;};'use strict';var EventEmitter=require(_0xc342('0x0'));var ChatInternalMessage=require(_0xc342('0x1'))['db']['ChatInternalMessage'];var ChatInternalMessageEvents=new EventEmitter();ChatInternalMessageEvents[_0xc342('0x2')](0x0);var events={'afterCreate':_0xc342('0x3'),'afterUpdate':_0xc342('0x4'),'afterDestroy':_0xc342('0x5')};function emitEvent(_0x795b47){return function(_0x5553d2,_0x34c579,_0x22480a){ChatInternalMessageEvents[_0xc342('0x6')](_0x795b47+':'+_0x5553d2['id'],_0x5553d2);ChatInternalMessageEvents[_0xc342('0x6')](_0x795b47,_0x5553d2);_0x22480a(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];ChatInternalMessage[_0xc342('0x7')](e,emitEvent(event));}}module[_0xc342('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 6165588..5e77629 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 _0x66ad=['rimraf','../../config/environment','./chatInternalMessage.attributes','define','ChatInternalMessage','chat_internal_messages','utf8mb4_unicode_ci','lodash','util','api','bluebird','request-promise','path'];(function(_0x113e32,_0x5339f0){var _0x4ff939=function(_0x2be9ca){while(--_0x2be9ca){_0x113e32['push'](_0x113e32['shift']());}};_0x4ff939(++_0x5339f0);}(_0x66ad,0x166));var _0xd66a=function(_0x4bbcc1,_0x289c0c){_0x4bbcc1=_0x4bbcc1-0x0;var _0x546f80=_0x66ad[_0x4bbcc1];return _0x546f80;};'use strict';var _=require(_0xd66a('0x0'));var util=require(_0xd66a('0x1'));var logger=require('../../config/logger')(_0xd66a('0x2'));var moment=require('moment');var BPromise=require(_0xd66a('0x3'));var rp=require(_0xd66a('0x4'));var fs=require('fs');var path=require(_0xd66a('0x5'));var rimraf=require(_0xd66a('0x6'));var config=require(_0xd66a('0x7'));var attributes=require(_0xd66a('0x8'));module['exports']=function(_0x543f7e,_0x19346c){return _0x543f7e[_0xd66a('0x9')](_0xd66a('0xa'),attributes,{'tableName':_0xd66a('0xb'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':'utf8mb4','collate':_0xd66a('0xc')});}; \ No newline at end of file +var _0xad94=['moment','bluebird','request-promise','path','rimraf','./chatInternalMessage.attributes','exports','define','ChatInternalMessage','utf8mb4_unicode_ci','lodash','api'];(function(_0x582e57,_0x85fded){var _0xfef0e6=function(_0x4b78be){while(--_0x4b78be){_0x582e57['push'](_0x582e57['shift']());}};_0xfef0e6(++_0x85fded);}(_0xad94,0x106));var _0x4ad9=function(_0x268872,_0x39b972){_0x268872=_0x268872-0x0;var _0x293bb8=_0xad94[_0x268872];return _0x293bb8;};'use strict';var _=require(_0x4ad9('0x0'));var util=require('util');var logger=require('../../config/logger')(_0x4ad9('0x1'));var moment=require(_0x4ad9('0x2'));var BPromise=require(_0x4ad9('0x3'));var rp=require(_0x4ad9('0x4'));var fs=require('fs');var path=require(_0x4ad9('0x5'));var rimraf=require(_0x4ad9('0x6'));var config=require('../../config/environment');var attributes=require(_0x4ad9('0x7'));module[_0x4ad9('0x8')]=function(_0x24b8ef,_0x5dc12b){return _0x24b8ef[_0x4ad9('0x9')](_0x4ad9('0xa'),attributes,{'tableName':'chat_internal_messages','paranoid':![],'indexes':[],'timestamps':!![],'charset':'utf8mb4','collate':_0x4ad9('0xb')});}; \ No newline at end of file diff --git a/server/api/chatInternalMessage/chatInternalMessage.rpc.js b/server/api/chatInternalMessage/chatInternalMessage.rpc.js index 602140e..4473bd1 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 _0x0261=['request\x20sent','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','redis','defaults','localhost','socket.io-emitter','register','request','then','info','ChatInternalMessage,\x20%s,\x20%s','debug','ChatInternalMessage,\x20%s,\x20%s,\x20%s','error','message'];(function(_0x46d8b2,_0x3829c4){var _0x1a351f=function(_0x279ce5){while(--_0x279ce5){_0x46d8b2['push'](_0x46d8b2['shift']());}};_0x1a351f(++_0x3829c4);}(_0x0261,0x11b));var _0x1026=function(_0x28a5ad,_0x520afa){_0x28a5ad=_0x28a5ad-0x0;var _0x176b8a=_0x0261[_0x28a5ad];return _0x176b8a;};'use strict';var _=require(_0x1026('0x0'));var util=require(_0x1026('0x1'));var moment=require(_0x1026('0x2'));var BPromise=require(_0x1026('0x3'));var rs=require(_0x1026('0x4'));var fs=require('fs');var Redis=require(_0x1026('0x5'));var db=require(_0x1026('0x6'))['db'];var utils=require(_0x1026('0x7'));var logger=require(_0x1026('0x8'))(_0x1026('0x9'));var config=require(_0x1026('0xa'));var jayson=require(_0x1026('0xb'));var client=jayson['client']['http']({'port':0x232a});config[_0x1026('0xc')]=_[_0x1026('0xd')](config['redis'],{'host':_0x1026('0xe'),'port':0x18eb});var socket=require(_0x1026('0xf'))(new Redis(config[_0x1026('0xc')]));require('./chatInternalMessage.socket')[_0x1026('0x10')](socket);function respondWithRpcPromise(_0x2341e7,_0xf417a8,_0x32e84b){return new BPromise(function(_0x1f3b9d,_0xf8d029){return client[_0x1026('0x11')](_0x2341e7,_0x32e84b)[_0x1026('0x12')](function(_0x51413f){logger[_0x1026('0x13')](_0x1026('0x14'),_0xf417a8,'request\x20sent');logger[_0x1026('0x15')](_0x1026('0x16'),_0xf417a8,'request\x20sent',JSON['stringify'](_0x51413f));if(_0x51413f[_0x1026('0x17')]){if(_0x51413f['error']['code']===0x1f4){logger['error'](_0x1026('0x14'),_0xf417a8,_0x51413f[_0x1026('0x17')][_0x1026('0x18')]);return _0xf8d029(_0x51413f['error'][_0x1026('0x18')]);}logger[_0x1026('0x17')](_0x1026('0x14'),_0xf417a8,_0x51413f[_0x1026('0x17')]['message']);return _0x1f3b9d(_0x51413f[_0x1026('0x17')][_0x1026('0x18')]);}else{logger['info'](_0x1026('0x14'),_0xf417a8,_0x1026('0x19'));_0x1f3b9d(_0x51413f[_0x1026('0x1a')][_0x1026('0x18')]);}})[_0x1026('0x1b')](function(_0x360119){logger['error']('ChatInternalMessage,\x20%s,\x20%s',_0xf417a8,_0x360119);_0xf8d029(_0x360119);});});} \ No newline at end of file +var _0x6782=['then','info','ChatInternalMessage,\x20%s,\x20%s','request\x20sent','debug','ChatInternalMessage,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','lodash','util','moment','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','redis','defaults','socket.io-emitter','./chatInternalMessage.socket','register','request'];(function(_0x4553ad,_0x34e51d){var _0x51c34a=function(_0x3e4660){while(--_0x3e4660){_0x4553ad['push'](_0x4553ad['shift']());}};_0x51c34a(++_0x34e51d);}(_0x6782,0x1f1));var _0x2678=function(_0x2905ea,_0x4a7421){_0x2905ea=_0x2905ea-0x0;var _0x463239=_0x6782[_0x2905ea];return _0x463239;};'use strict';var _=require(_0x2678('0x0'));var util=require(_0x2678('0x1'));var moment=require(_0x2678('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x2678('0x3'));var db=require(_0x2678('0x4'))['db'];var utils=require(_0x2678('0x5'));var logger=require(_0x2678('0x6'))(_0x2678('0x7'));var config=require('../../config/environment');var jayson=require(_0x2678('0x8'));var client=jayson[_0x2678('0x9')]['http']({'port':0x232a});config[_0x2678('0xa')]=_[_0x2678('0xb')](config[_0x2678('0xa')],{'host':'localhost','port':0x18eb});var socket=require(_0x2678('0xc'))(new Redis(config[_0x2678('0xa')]));require(_0x2678('0xd'))[_0x2678('0xe')](socket);function respondWithRpcPromise(_0x56e311,_0xfc6469,_0x1e9060){return new BPromise(function(_0x26ea00,_0x418761){return client[_0x2678('0xf')](_0x56e311,_0x1e9060)[_0x2678('0x10')](function(_0x6add4){logger[_0x2678('0x11')](_0x2678('0x12'),_0xfc6469,_0x2678('0x13'));logger[_0x2678('0x14')](_0x2678('0x15'),_0xfc6469,_0x2678('0x13'),JSON[_0x2678('0x16')](_0x6add4));if(_0x6add4[_0x2678('0x17')]){if(_0x6add4[_0x2678('0x17')][_0x2678('0x18')]===0x1f4){logger[_0x2678('0x17')](_0x2678('0x12'),_0xfc6469,_0x6add4['error'][_0x2678('0x19')]);return _0x418761(_0x6add4[_0x2678('0x17')][_0x2678('0x19')]);}logger[_0x2678('0x17')](_0x2678('0x12'),_0xfc6469,_0x6add4[_0x2678('0x17')][_0x2678('0x19')]);return _0x26ea00(_0x6add4[_0x2678('0x17')][_0x2678('0x19')]);}else{logger[_0x2678('0x11')]('ChatInternalMessage,\x20%s,\x20%s',_0xfc6469,_0x2678('0x13'));_0x26ea00(_0x6add4[_0x2678('0x1a')][_0x2678('0x19')]);}})['catch'](function(_0x36a34d){logger[_0x2678('0x17')]('ChatInternalMessage,\x20%s,\x20%s',_0xfc6469,_0x36a34d);_0x418761(_0x36a34d);});});} \ No newline at end of file diff --git a/server/api/chatInternalMessage/chatInternalMessage.socket.js b/server/api/chatInternalMessage/chatInternalMessage.socket.js index 79a9828..1a42621 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 _0x679c=['removeListener','register','length','chatInternalMessage:','./chatInternalMessage.events','save','remove'];(function(_0x275222,_0x7635fe){var _0x14a885=function(_0x269f87){while(--_0x269f87){_0x275222['push'](_0x275222['shift']());}};_0x14a885(++_0x7635fe);}(_0x679c,0xd6));var _0xc679=function(_0xd0cffa,_0x558124){_0xd0cffa=_0xd0cffa-0x0;var _0x5087ab=_0x679c[_0xd0cffa];return _0x5087ab;};'use strict';var ChatInternalMessageEvents=require(_0xc679('0x0'));var events=[_0xc679('0x1'),_0xc679('0x2'),'update'];function createListener(_0x5b0437,_0x4671a2){return function(_0x1f86b7){_0x4671a2['emit'](_0x5b0437,_0x1f86b7);};}function removeListener(_0xb2a879,_0x24c542){return function(){ChatInternalMessageEvents[_0xc679('0x3')](_0xb2a879,_0x24c542);};}exports[_0xc679('0x4')]=function(_0x1a35ee){for(var _0x1fc7c7=0x0,_0x1fee26=events[_0xc679('0x5')];_0x1fc7c7<_0x1fee26;_0x1fc7c7++){var _0x1de1ec=events[_0x1fc7c7];var _0x4827b0=createListener(_0xc679('0x6')+_0x1de1ec,_0x1a35ee);ChatInternalMessageEvents['on'](_0x1de1ec,_0x4827b0);}}; \ No newline at end of file +var _0x6d38=['./chatInternalMessage.events','save','remove','update','emit','removeListener','length','chatInternalMessage:'];(function(_0x51601a,_0x25779c){var _0x5bfa7f=function(_0x47a1b1){while(--_0x47a1b1){_0x51601a['push'](_0x51601a['shift']());}};_0x5bfa7f(++_0x25779c);}(_0x6d38,0x88));var _0x86d3=function(_0x580576,_0x2f107d){_0x580576=_0x580576-0x0;var _0x3f55a0=_0x6d38[_0x580576];return _0x3f55a0;};'use strict';var ChatInternalMessageEvents=require(_0x86d3('0x0'));var events=[_0x86d3('0x1'),_0x86d3('0x2'),_0x86d3('0x3')];function createListener(_0x12ccea,_0x37742c){return function(_0x221099){_0x37742c[_0x86d3('0x4')](_0x12ccea,_0x221099);};}function removeListener(_0x3322cb,_0x2d0bc5){return function(){ChatInternalMessageEvents[_0x86d3('0x5')](_0x3322cb,_0x2d0bc5);};}exports['register']=function(_0x41462f){for(var _0x3cb9ed=0x0,_0x2dfdbf=events[_0x86d3('0x6')];_0x3cb9ed<_0x2dfdbf;_0x3cb9ed++){var _0x1e097a=events[_0x3cb9ed];var _0x4d2cfd=createListener(_0x86d3('0x7')+_0x1e097a,_0x41462f);ChatInternalMessageEvents['on'](_0x1e097a,_0x4d2cfd);}}; \ No newline at end of file diff --git a/server/api/chatInternalMessage/index.js b/server/api/chatInternalMessage/index.js index 583a75a..ff653e4 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 _0xe2f2=['connect-timeout','express','fs-extra','../../components/interaction/service','../../config/environment','./chatInternalMessage.controller','get','isAuthenticated','index','/describe','describe','/:id','show','update','destroy','exports','multer','util','path'];(function(_0x3a728e,_0x1b4c9d){var _0xd248b9=function(_0x15ae84){while(--_0x15ae84){_0x3a728e['push'](_0x3a728e['shift']());}};_0xd248b9(++_0x1b4c9d);}(_0xe2f2,0x95));var _0x2e2f=function(_0x134110,_0x4a8602){_0x134110=_0x134110-0x0;var _0x3f2e97=_0xe2f2[_0x134110];return _0x3f2e97;};'use strict';var multer=require(_0x2e2f('0x0'));var util=require(_0x2e2f('0x1'));var path=require(_0x2e2f('0x2'));var timeout=require(_0x2e2f('0x3'));var express=require(_0x2e2f('0x4'));var router=express['Router']();var fs_extra=require(_0x2e2f('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0x2e2f('0x6'));var config=require(_0x2e2f('0x7'));var controller=require(_0x2e2f('0x8'));router[_0x2e2f('0x9')]('/',auth[_0x2e2f('0xa')](),controller[_0x2e2f('0xb')]);router[_0x2e2f('0x9')](_0x2e2f('0xc'),auth[_0x2e2f('0xa')](),controller[_0x2e2f('0xd')]);router[_0x2e2f('0x9')]('/users',auth[_0x2e2f('0xa')](),controller['getUsers']);router['get'](_0x2e2f('0xe'),auth[_0x2e2f('0xa')](),controller[_0x2e2f('0xf')]);router['post']('/',auth[_0x2e2f('0xa')](),controller['create']);router['put'](_0x2e2f('0xe'),controller[_0x2e2f('0x10')]);router['delete'](_0x2e2f('0xe'),auth[_0x2e2f('0xa')](),controller[_0x2e2f('0x11')]);module[_0x2e2f('0x12')]=router; \ No newline at end of file +var _0xde31=['getUsers','/:id','post','create','update','delete','destroy','exports','multer','connect-timeout','express','Router','fs-extra','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','describe','/users'];(function(_0x5ed775,_0x4c8334){var _0x2e66ad=function(_0x9388a0){while(--_0x9388a0){_0x5ed775['push'](_0x5ed775['shift']());}};_0x2e66ad(++_0x4c8334);}(_0xde31,0x1d4));var _0x1de3=function(_0x996bc8,_0x291e01){_0x996bc8=_0x996bc8-0x0;var _0x20b0ea=_0xde31[_0x996bc8];return _0x20b0ea;};'use strict';var multer=require(_0x1de3('0x0'));var util=require('util');var path=require('path');var timeout=require(_0x1de3('0x1'));var express=require(_0x1de3('0x2'));var router=express[_0x1de3('0x3')]();var fs_extra=require(_0x1de3('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0x1de3('0x5'));var config=require(_0x1de3('0x6'));var controller=require('./chatInternalMessage.controller');router[_0x1de3('0x7')]('/',auth[_0x1de3('0x8')](),controller[_0x1de3('0x9')]);router[_0x1de3('0x7')]('/describe',auth[_0x1de3('0x8')](),controller[_0x1de3('0xa')]);router[_0x1de3('0x7')](_0x1de3('0xb'),auth[_0x1de3('0x8')](),controller[_0x1de3('0xc')]);router['get'](_0x1de3('0xd'),auth[_0x1de3('0x8')](),controller['show']);router[_0x1de3('0xe')]('/',auth[_0x1de3('0x8')](),controller[_0x1de3('0xf')]);router['put']('/:id',controller[_0x1de3('0x10')]);router[_0x1de3('0x11')](_0x1de3('0xd'),auth[_0x1de3('0x8')](),controller[_0x1de3('0x12')]);module[_0x1de3('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 708d518..2992a20 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 _0x676c=['out','DATE','sequelize','exports','TEXT','BOOLEAN','ENUM'];(function(_0x41c77b,_0x224480){var _0x3f36e0=function(_0x3650d0){while(--_0x3650d0){_0x41c77b['push'](_0x41c77b['shift']());}};_0x3f36e0(++_0x224480);}(_0x676c,0x198));var _0xc676=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x676c[_0x3dd15e];return _0x231fd0;};'use strict';var Sequelize=require(_0xc676('0x0'));module[_0xc676('0x1')]={'body':{'type':Sequelize[_0xc676('0x2')]('medium'),'allowNull':![]},'read':{'type':Sequelize[_0xc676('0x3')],'defaultValue':![]},'secret':{'type':Sequelize[_0xc676('0x3')],'defaultValue':![]},'direction':{'type':Sequelize[_0xc676('0x4')]('in',_0xc676('0x5')),'defaultValue':_0xc676('0x5'),'allowNull':![]},'readAt':{'type':Sequelize[_0xc676('0x6')]},'providerName':{'type':Sequelize['STRING']},'providerResponse':{'type':Sequelize[_0xc676('0x2')]}}; \ No newline at end of file +var _0x0490=['DATE','STRING','TEXT','exports','ENUM','out'];(function(_0xc8ee55,_0x50114a){var _0x3fc930=function(_0x2ebe6c){while(--_0x2ebe6c){_0xc8ee55['push'](_0xc8ee55['shift']());}};_0x3fc930(++_0x50114a);}(_0x0490,0x147));var _0x0049=function(_0x2c7c1f,_0x28967e){_0x2c7c1f=_0x2c7c1f-0x0;var _0x14dee4=_0x0490[_0x2c7c1f];return _0x14dee4;};'use strict';var Sequelize=require('sequelize');module[_0x0049('0x0')]={'body':{'type':Sequelize['TEXT']('medium'),'allowNull':![]},'read':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'secret':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'direction':{'type':Sequelize[_0x0049('0x1')]('in',_0x0049('0x2')),'defaultValue':_0x0049('0x2'),'allowNull':![]},'readAt':{'type':Sequelize[_0x0049('0x3')]},'providerName':{'type':Sequelize[_0x0049('0x4')]},'providerResponse':{'type':Sequelize[_0x0049('0x5')]}}; \ No newline at end of file diff --git a/server/api/chatMessage/chatMessage.controller.js b/server/api/chatMessage/chatMessage.controller.js index 306f7ce..c95f34f 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 _0xfd93=['event','EventManager','acceptmessage','formData','ChatInteraction','RejectMessage','sequelize','Sequelize','email','rejectmessage','eml-format','zip-dir','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','lodash','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/license/util','../../mysqldb','redis','localhost','./chatMessage.socket','register','client','http','request','then','ChatMessage,\x20%s,\x20%s','request\x20sent','ChatMessage,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result','catch','status','end','json','undefined','offset','count','limit','apply','reject','save','destroy','sendStatus','stack','name','index','map','ChatMessage','rawAttributes','type','key','model','query','keys','intersection','attributes','length','order','sort','filters','pick','filter','where','merge','VIRTUAL','options','include','findAll','rows','params','fields','find','create','body','update','../../config/logger','chat-interactions','accept','chat','readAt','YYYY-MM-DD\x20HH:mm:ss','UserId','user','agent','ChatInteractionId','isNil','read1stAt','format','interaction','get','[CHATMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','role','null','AcceptMessage','acceptMessage','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','ContactId','QueryTypes','SELECT','contact','User','fullname','internal','manual','interface','SIP/%s','channel','motionChannel'];(function(_0x8398e5,_0x3389f9){var _0x57c8a7=function(_0x154f13){while(--_0x154f13){_0x8398e5['push'](_0x8398e5['shift']());}};_0x57c8a7(++_0x3389f9);}(_0xfd93,0x8d));var _0x3fd9=function(_0x34c4e1,_0x310387){_0x34c4e1=_0x34c4e1-0x0;var _0x5a11ef=_0xfd93[_0x34c4e1];return _0x5a11ef;};'use strict';var emlformat=require(_0x3fd9('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x3fd9('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0x3fd9('0x2'));var moment=require(_0x3fd9('0x3'));var BPromise=require(_0x3fd9('0x4'));var Mustache=require(_0x3fd9('0x5'));var util=require(_0x3fd9('0x6'));var path=require(_0x3fd9('0x7'));var sox=require(_0x3fd9('0x8'));var csv=require(_0x3fd9('0x9'));var ejs=require(_0x3fd9('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x3fd9('0xb'));var squel=require('squel');var crypto=require(_0x3fd9('0xc'));var jsforce=require(_0x3fd9('0xd'));var deskjs=require(_0x3fd9('0xe'));var toCsv=require(_0x3fd9('0x9'));var querystring=require(_0x3fd9('0xf'));var Papa=require(_0x3fd9('0x10'));var Redis=require(_0x3fd9('0x11'));var authService=require(_0x3fd9('0x12'));var qs=require(_0x3fd9('0x13'));var as=require(_0x3fd9('0x14'));var hardwareService=require(_0x3fd9('0x15'));var logger=require('../../config/logger')(_0x3fd9('0x16'));var utils=require(_0x3fd9('0x17'));var config=require('../../config/environment');var licenseUtil=require(_0x3fd9('0x18'));var db=require(_0x3fd9('0x19'))['db'];config[_0x3fd9('0x1a')]=_['defaults'](config['redis'],{'host':_0x3fd9('0x1b'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x3fd9('0x1a')]));require(_0x3fd9('0x1c'))[_0x3fd9('0x1d')](socket);var jayson=require('jayson/promise');var client=jayson[_0x3fd9('0x1e')][_0x3fd9('0x1f')]({'port':0x232c});var client9002=jayson[_0x3fd9('0x1e')][_0x3fd9('0x1f')]({'port':0x232a});function respondWithRpcPromise(_0x577bd1,_0x51f405,_0x35c3ab,_0x4f28e5){return new BPromise(function(_0x410c7c,_0x3f7f4a){var _0x20e71d=_0x4f28e5||client;return _0x20e71d[_0x3fd9('0x20')](_0x577bd1,_0x35c3ab)[_0x3fd9('0x21')](function(_0x3b3022){logger['info'](_0x3fd9('0x22'),_0x51f405,_0x3fd9('0x23'));logger['debug'](_0x3fd9('0x24'),_0x51f405,'request\x20sent',JSON[_0x3fd9('0x25')](_0x3b3022));if(_0x3b3022[_0x3fd9('0x26')]){if(_0x3b3022[_0x3fd9('0x26')][_0x3fd9('0x27')]===0x1f4){logger[_0x3fd9('0x26')]('ChatMessage,\x20%s,\x20%s',_0x51f405,_0x3b3022[_0x3fd9('0x26')][_0x3fd9('0x28')]);return _0x3f7f4a(_0x3b3022[_0x3fd9('0x26')][_0x3fd9('0x28')]);}logger[_0x3fd9('0x26')]('ChatMessage,\x20%s,\x20%s',_0x51f405,_0x3b3022[_0x3fd9('0x26')]['message']);return _0x410c7c(_0x3b3022['error'][_0x3fd9('0x28')]);}else{logger[_0x3fd9('0x29')](_0x3fd9('0x22'),_0x51f405,_0x3fd9('0x23'));_0x410c7c(_0x3b3022[_0x3fd9('0x2a')]['message']);}})[_0x3fd9('0x2b')](function(_0x5c03cb){logger['error']('ChatMessage,\x20%s,\x20%s',_0x51f405,_0x5c03cb);_0x3f7f4a(_0x5c03cb);});});}function respondWithStatusCode(_0x1084bc,_0x5eb868){_0x5eb868=_0x5eb868||0xcc;return function(_0x3f3713){if(_0x3f3713){return _0x1084bc['sendStatus'](_0x5eb868);}return _0x1084bc[_0x3fd9('0x2c')](_0x5eb868)[_0x3fd9('0x2d')]();};}function respondWithResult(_0x49b39c,_0x1271d2){_0x1271d2=_0x1271d2||0xc8;return function(_0x7b650d){if(_0x7b650d){return _0x49b39c[_0x3fd9('0x2c')](_0x1271d2)[_0x3fd9('0x2e')](_0x7b650d);}};}function respondWithFilteredResult(_0x4e34e0,_0x35ecca){return function(_0x38bc47){if(_0x38bc47){var _0x425bd2=typeof _0x35ecca['offset']==='undefined'&&typeof _0x35ecca['limit']===_0x3fd9('0x2f');var _0x5d5553=_0x38bc47['count'];var _0x3cc10e=_0x425bd2?0x0:_0x35ecca[_0x3fd9('0x30')];var _0x18ddd2=_0x425bd2?_0x38bc47[_0x3fd9('0x31')]:_0x35ecca[_0x3fd9('0x30')]+_0x35ecca[_0x3fd9('0x32')];var _0x3ede52;if(_0x18ddd2>=_0x5d5553){_0x18ddd2=_0x5d5553;_0x3ede52=0xc8;}else{_0x3ede52=0xce;}_0x4e34e0[_0x3fd9('0x2c')](_0x3ede52);return _0x4e34e0['set']('Content-Range',_0x3cc10e+'-'+_0x18ddd2+'/'+_0x5d5553)['json'](_0x38bc47);}return null;};}function patchUpdates(_0x16e6ef){return function(_0x300d45){try{jsonpatch[_0x3fd9('0x33')](_0x300d45,_0x16e6ef,!![]);}catch(_0x48cc7c){return BPromise[_0x3fd9('0x34')](_0x48cc7c);}return _0x300d45[_0x3fd9('0x35')]();};}function saveUpdates(_0x1a2e7b,_0x48e015){return function(_0x3b9515){if(_0x3b9515){return _0x3b9515['update'](_0x1a2e7b)[_0x3fd9('0x21')](function(_0x255df0){return _0x255df0;});}return null;};}function removeEntity(_0x2fcaa8,_0x4c3b09){return function(_0x665d){if(_0x665d){return _0x665d[_0x3fd9('0x36')]()['then'](function(){_0x2fcaa8['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x58872c,_0x545c53){return function(_0x2df126){if(!_0x2df126){_0x58872c[_0x3fd9('0x37')](0x194);}return _0x2df126;};}function handleError(_0x1beade,_0x5c9502){_0x5c9502=_0x5c9502||0x1f4;return function(_0x48215c){logger[_0x3fd9('0x26')](_0x48215c[_0x3fd9('0x38')]);if(_0x48215c[_0x3fd9('0x39')]){delete _0x48215c[_0x3fd9('0x39')];}_0x1beade[_0x3fd9('0x2c')](_0x5c9502)['send'](_0x48215c);};}exports[_0x3fd9('0x3a')]=function(_0x5b764a,_0x442d8c){var _0x57dd32={},_0x5c2397={},_0x57f06a={'count':0x0,'rows':[]};var _0x45c5b1=_[_0x3fd9('0x3b')](db[_0x3fd9('0x3c')][_0x3fd9('0x3d')],function(_0x1122fd){return{'name':_0x1122fd['fieldName'],'type':_0x1122fd[_0x3fd9('0x3e')][_0x3fd9('0x3f')]};});_0x5c2397[_0x3fd9('0x40')]=_['map'](_0x45c5b1,_0x3fd9('0x39'));_0x5c2397[_0x3fd9('0x41')]=_[_0x3fd9('0x42')](_0x5b764a[_0x3fd9('0x41')]);_0x5c2397['filters']=_[_0x3fd9('0x43')](_0x5c2397[_0x3fd9('0x40')],_0x5c2397['query']);_0x57dd32[_0x3fd9('0x44')]=_[_0x3fd9('0x43')](_0x5c2397['model'],qs['fields'](_0x5b764a['query']['fields']));_0x57dd32[_0x3fd9('0x44')]=_0x57dd32[_0x3fd9('0x44')][_0x3fd9('0x45')]?_0x57dd32['attributes']:_0x5c2397[_0x3fd9('0x40')];if(!_0x5b764a[_0x3fd9('0x41')]['hasOwnProperty']('nolimit')){_0x57dd32[_0x3fd9('0x32')]=qs['limit'](_0x5b764a['query']['limit']);_0x57dd32[_0x3fd9('0x30')]=qs[_0x3fd9('0x30')](_0x5b764a[_0x3fd9('0x41')]['offset']);}_0x57dd32[_0x3fd9('0x46')]=qs['sort'](_0x5b764a[_0x3fd9('0x41')][_0x3fd9('0x47')]);_0x57dd32['where']=qs[_0x3fd9('0x48')](_[_0x3fd9('0x49')](_0x5b764a['query'],_0x5c2397[_0x3fd9('0x48')]),_0x45c5b1);if(_0x5b764a[_0x3fd9('0x41')][_0x3fd9('0x4a')]){_0x57dd32[_0x3fd9('0x4b')]=_[_0x3fd9('0x4c')](_0x57dd32[_0x3fd9('0x4b')],{'$or':_[_0x3fd9('0x3b')](_0x45c5b1,function(_0x77244){if(_0x77244[_0x3fd9('0x3e')]!==_0x3fd9('0x4d')){var _0x2a508b={};_0x2a508b[_0x77244[_0x3fd9('0x39')]]={'$like':'%'+_0x5b764a[_0x3fd9('0x41')]['filter']+'%'};return _0x2a508b;}})});}_0x57dd32=_['merge']({},_0x57dd32,_0x5b764a[_0x3fd9('0x4e')]);var _0x149df7={'where':_0x57dd32[_0x3fd9('0x4b')]};return db[_0x3fd9('0x3c')]['count'](_0x149df7)[_0x3fd9('0x21')](function(_0x5d438d){_0x57f06a[_0x3fd9('0x31')]=_0x5d438d;if(_0x5b764a[_0x3fd9('0x41')]['includeAll']){_0x57dd32[_0x3fd9('0x4f')]=[{'all':!![]}];}return db['ChatMessage'][_0x3fd9('0x50')](_0x57dd32);})['then'](function(_0x5a1057){_0x57f06a[_0x3fd9('0x51')]=_0x5a1057;return _0x57f06a;})[_0x3fd9('0x21')](respondWithFilteredResult(_0x442d8c,_0x57dd32))[_0x3fd9('0x2b')](handleError(_0x442d8c,null));};exports['show']=function(_0x1de0b6,_0x1df822){var _0x2e637e={'raw':!![],'where':{'id':_0x1de0b6[_0x3fd9('0x52')]['id']}},_0x2d239e={};_0x2d239e[_0x3fd9('0x40')]=_[_0x3fd9('0x42')](db[_0x3fd9('0x3c')][_0x3fd9('0x3d')]);_0x2d239e[_0x3fd9('0x41')]=_[_0x3fd9('0x42')](_0x1de0b6[_0x3fd9('0x41')]);_0x2d239e[_0x3fd9('0x48')]=_[_0x3fd9('0x43')](_0x2d239e[_0x3fd9('0x40')],_0x2d239e['query']);_0x2e637e['attributes']=_[_0x3fd9('0x43')](_0x2d239e[_0x3fd9('0x40')],qs[_0x3fd9('0x53')](_0x1de0b6[_0x3fd9('0x41')]['fields']));_0x2e637e[_0x3fd9('0x44')]=_0x2e637e[_0x3fd9('0x44')][_0x3fd9('0x45')]?_0x2e637e[_0x3fd9('0x44')]:_0x2d239e[_0x3fd9('0x40')];if(_0x1de0b6[_0x3fd9('0x41')]['includeAll']){_0x2e637e[_0x3fd9('0x4f')]=[{'all':!![]}];}_0x2e637e=_['merge']({},_0x2e637e,_0x1de0b6[_0x3fd9('0x4e')]);return db['ChatMessage'][_0x3fd9('0x54')](_0x2e637e)[_0x3fd9('0x21')](handleEntityNotFound(_0x1df822,null))['then'](respondWithResult(_0x1df822,null))[_0x3fd9('0x2b')](handleError(_0x1df822,null));};exports[_0x3fd9('0x55')]=function(_0x5c66a1,_0x24cd6c){return db[_0x3fd9('0x3c')][_0x3fd9('0x55')](_0x5c66a1[_0x3fd9('0x56')],{})[_0x3fd9('0x21')](respondWithResult(_0x24cd6c,0xc9))[_0x3fd9('0x2b')](handleError(_0x24cd6c,null));};exports[_0x3fd9('0x57')]=function(_0x173c47,_0x567bc4){if(_0x173c47[_0x3fd9('0x56')]['id']){delete _0x173c47[_0x3fd9('0x56')]['id'];}return db['ChatMessage']['find']({'where':{'id':_0x173c47['params']['id']}})[_0x3fd9('0x21')](handleEntityNotFound(_0x567bc4,null))[_0x3fd9('0x21')](saveUpdates(_0x173c47[_0x3fd9('0x56')],null))['then'](respondWithResult(_0x567bc4,null))[_0x3fd9('0x2b')](handleError(_0x567bc4,null));};exports['destroy']=function(_0x35c9e7,_0x14beb9){return db[_0x3fd9('0x3c')][_0x3fd9('0x54')]({'where':{'id':_0x35c9e7[_0x3fd9('0x52')]['id']}})[_0x3fd9('0x21')](handleEntityNotFound(_0x14beb9,null))[_0x3fd9('0x21')](removeEntity(_0x14beb9,null))[_0x3fd9('0x2b')](handleError(_0x14beb9,null));};exports['describe']=function(_0x5eb4d0,_0x3f171b){return db[_0x3fd9('0x3c')]['describe']()[_0x3fd9('0x21')](respondWithResult(_0x3f171b,null))[_0x3fd9('0x2b')](handleError(_0x3f171b,null));};var interaction_log=require(_0x3fd9('0x58'))(_0x3fd9('0x59'));exports[_0x3fd9('0x5a')]=function(_0x47877e,_0xa80d57,_0x2f8449){var _0x19d316={'agent':{},'channel':_0x3fd9('0x5b')};if(_0x47877e['body']['id']){delete _0x47877e[_0x3fd9('0x56')]['id'];}_0x47877e[_0x3fd9('0x56')]['read']=!![];_0x47877e['body'][_0x3fd9('0x5c')]=moment()['format'](_0x3fd9('0x5d'));_0x47877e[_0x3fd9('0x56')][_0x3fd9('0x5e')]=_0x47877e[_0x3fd9('0x56')][_0x3fd9('0x5e')]||_0x47877e[_0x3fd9('0x5f')]['id'];_0x19d316[_0x3fd9('0x60')]['id']=_0x47877e[_0x3fd9('0x56')][_0x3fd9('0x5e')];return db[_0x3fd9('0x3c')][_0x3fd9('0x54')]({'where':{'id':_0x47877e[_0x3fd9('0x52')]['id'],'UserId':null}})['then'](handleEntityNotFound(_0xa80d57,null))['then'](saveUpdates(_0x47877e[_0x3fd9('0x56')],null))[_0x3fd9('0x21')](function(_0x1395e1){if(_0x1395e1){_0x19d316['message']=_0x1395e1['get']({'plain':!![]});return db['ChatInteraction'][_0x3fd9('0x54')]({'where':{'id':_0x1395e1[_0x3fd9('0x61')]}});}return null;})['then'](handleEntityNotFound(_0xa80d57,null))[_0x3fd9('0x21')](function(_0x499445){if(_0x499445){return _0x499445[_0x3fd9('0x57')]({'UserId':_0x47877e[_0x3fd9('0x56')]['UserId'],'read1stAt':_[_0x3fd9('0x62')](_0x499445[_0x3fd9('0x63')])?moment()[_0x3fd9('0x64')](_0x3fd9('0x5d')):undefined});}return null;})[_0x3fd9('0x21')](function(_0xdac03f){if(_0xdac03f){_0x19d316[_0x3fd9('0x65')]=_0xdac03f[_0x3fd9('0x66')]({'plain':!![]});interaction_log[_0x3fd9('0x29')](_0x3fd9('0x67'),_0x47877e[_0x3fd9('0x5f')]['id'],_0x47877e[_0x3fd9('0x5f')]['name'],_0x47877e[_0x3fd9('0x5f')][_0x3fd9('0x68')],_0x19d316['interaction']['id'],_0x47877e['body']?JSON['stringify'](_0x47877e['body']):_0x3fd9('0x69'));return respondWithRpcPromise(_0x3fd9('0x6a'),_0x3fd9('0x6b'),_0x19d316);}return null;})[_0x3fd9('0x21')](function(_0x4b51f9){var _0x4350cc=_0x3fd9('0x6c')+_0x4b51f9['message'][_0x3fd9('0x6d')];return db['sequelize'][_0x3fd9('0x41')](_0x4350cc,{'type':db['Sequelize'][_0x3fd9('0x6e')][_0x3fd9('0x6f')],'raw':!![]})[_0x3fd9('0x21')](function(_0xb3cdf6){return _0xb3cdf6;});})[_0x3fd9('0x21')](function(_0x403233){if(_0x403233){_0x19d316['message'][_0x3fd9('0x70')]=_0x403233[0x0];if(!_0x47877e[_0x3fd9('0x56')][_0x3fd9('0x5e')])return;return db[_0x3fd9('0x71')]['find']({'where':{'id':_0x47877e[_0x3fd9('0x56')][_0x3fd9('0x5e')],'role':_0x3fd9('0x60')},'attributes':['id','name',_0x3fd9('0x72'),'email',_0x3fd9('0x73')],'raw':!![]});}return null;})[_0x3fd9('0x21')](function(_0x26bd3b){if(!_0x26bd3b)return null;_0x19d316[_0x3fd9('0x28')][_0x3fd9('0x60')]=_0x26bd3b;return _0x19d316;})[_0x3fd9('0x21')](function(_0x465cdb){if(_0x465cdb){if(_0x47877e[_0x3fd9('0x56')][_0x3fd9('0x74')]){_0x19d316[_0x3fd9('0x28')][_0x3fd9('0x75')]=util['format'](_0x3fd9('0x76'),_0x47877e[_0x3fd9('0x5f')][_0x3fd9('0x39')]);_0x19d316[_0x3fd9('0x28')]['channel']=_0x19d316[_0x3fd9('0x77')];_0x19d316[_0x3fd9('0x28')][_0x3fd9('0x78')]=_0x19d316['channel'];_0x19d316[_0x3fd9('0x28')][_0x3fd9('0x79')]=_0x3fd9('0x5a');return respondWithRpcPromise(_0x3fd9('0x7a'),_0x3fd9('0x7a'),{'event':_0x3fd9('0x7b'),'message':_[_0x3fd9('0x4c')](_0x19d316[_0x3fd9('0x28')],JSON['parse'](_0x19d316[_0x3fd9('0x65')][_0x3fd9('0x7c')]))},client9002)[_0x3fd9('0x21')](function(){return _0x19d316;});}return _0x19d316;}return null;})[_0x3fd9('0x21')](respondWithResult(_0xa80d57,null))['catch'](handleError(_0xa80d57,null));};var interaction_log=require(_0x3fd9('0x58'))(_0x3fd9('0x59'));exports[_0x3fd9('0x34')]=function(_0x8138c0,_0x1e14bb,_0x598cf4){var _0x56e414={'agent':{},'channel':_0x3fd9('0x5b')};if(_0x8138c0['body']['id']){delete _0x8138c0['body']['id'];}_0x8138c0[_0x3fd9('0x56')]['UserId']=_0x8138c0['body'][_0x3fd9('0x5e')]||_0x8138c0['user']['id'];_0x56e414[_0x3fd9('0x60')]['id']=_0x8138c0[_0x3fd9('0x56')][_0x3fd9('0x5e')];return db[_0x3fd9('0x3c')][_0x3fd9('0x54')]({'where':{'id':_0x8138c0['params']['id'],'UserId':null}})[_0x3fd9('0x21')](handleEntityNotFound(_0x1e14bb,null))[_0x3fd9('0x21')](function(_0x3f382e){if(_0x3f382e){_0x56e414[_0x3fd9('0x28')]=_0x3f382e[_0x3fd9('0x66')]({'plain':!![]});return db[_0x3fd9('0x7d')]['find']({'where':{'id':_0x3f382e[_0x3fd9('0x61')]}});}return null;})[_0x3fd9('0x21')](handleEntityNotFound(_0x1e14bb,null))[_0x3fd9('0x21')](function(_0x52610c){if(_0x52610c){_0x56e414[_0x3fd9('0x65')]=_0x52610c[_0x3fd9('0x66')]({'plain':!![]});interaction_log[_0x3fd9('0x29')]('[CHATMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s',_0x8138c0[_0x3fd9('0x5f')]['id'],_0x8138c0[_0x3fd9('0x5f')][_0x3fd9('0x39')],_0x8138c0[_0x3fd9('0x5f')][_0x3fd9('0x68')],_0x56e414[_0x3fd9('0x65')]['id'],_0x8138c0['body']?JSON[_0x3fd9('0x25')](_0x8138c0[_0x3fd9('0x56')]):'null');return respondWithRpcPromise(_0x3fd9('0x7e'),'rejectMessage',_0x56e414);}return null;})[_0x3fd9('0x21')](function(_0x362fbc){var _0x3b765f='SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20'+_0x362fbc[_0x3fd9('0x28')][_0x3fd9('0x6d')];return db[_0x3fd9('0x7f')][_0x3fd9('0x41')](_0x3b765f,{'type':db[_0x3fd9('0x80')][_0x3fd9('0x6e')][_0x3fd9('0x6f')],'raw':!![]})[_0x3fd9('0x21')](function(_0x161375){return _0x161375;});})[_0x3fd9('0x21')](function(_0x1ffdfc){if(_0x1ffdfc){_0x56e414[_0x3fd9('0x28')]['contact']=_0x1ffdfc[0x0];if(!_0x8138c0[_0x3fd9('0x56')][_0x3fd9('0x5e')])return;return db[_0x3fd9('0x71')][_0x3fd9('0x54')]({'where':{'id':_0x8138c0['body']['UserId'],'role':_0x3fd9('0x60')},'attributes':['id',_0x3fd9('0x39'),_0x3fd9('0x72'),_0x3fd9('0x81'),_0x3fd9('0x73')],'raw':!![]});}return null;})[_0x3fd9('0x21')](function(_0xd39bbf){if(!_0xd39bbf)return null;_0x56e414['message']['agent']=_0xd39bbf;return _0x56e414;})[_0x3fd9('0x21')](function(_0x168f04){if(_0x168f04){_0x168f04[_0x3fd9('0x28')][_0x3fd9('0x75')]=util[_0x3fd9('0x64')](_0x3fd9('0x76'),_0x8138c0[_0x3fd9('0x5f')][_0x3fd9('0x39')]);_0x168f04[_0x3fd9('0x28')][_0x3fd9('0x77')]=_0x56e414[_0x3fd9('0x77')];_0x168f04[_0x3fd9('0x28')]['motionChannel']=_0x56e414['channel'];_0x168f04[_0x3fd9('0x28')][_0x3fd9('0x79')]=_0x3fd9('0x34');respondWithRpcPromise(_0x3fd9('0x7a'),'EventManager',{'event':_0x3fd9('0x82'),'message':_[_0x3fd9('0x4c')](_0x56e414[_0x3fd9('0x28')],JSON['parse'](_0x56e414[_0x3fd9('0x65')][_0x3fd9('0x7c')]))},client9002);return _0x56e414;}return null;})[_0x3fd9('0x21')](respondWithResult(_0x1e14bb,null))['catch'](handleError(_0x1e14bb,null));}; \ No newline at end of file +var _0xd005=['chat-interactions','accept','chat','read','readAt','format','UserId','user','agent','get','ChatInteraction','ChatInteractionId','isNil','read1stAt','YYYY-MM-DD\x20HH:mm:ss','interaction','role','null','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','User','fullname','email','manual','SIP/%s','channel','event','EventManager','acceptmessage','parse','reject','[CHATMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','rejectMessage','Sequelize','QueryTypes','SELECT','contact','internal','interface','motionChannel','formData','rimraf','zip-dir','request-promise','moment','bluebird','mustache','util','sox','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','redis','defaults','localhost','jayson/promise','client','http','request','then','info','ChatMessage,\x20%s,\x20%s','request\x20sent','debug','ChatMessage,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','sendStatus','status','end','json','offset','undefined','count','limit','Content-Range','apply','save','update','destroy','stack','name','index','map','rawAttributes','fieldName','key','model','keys','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','where','pick','filter','merge','type','VIRTUAL','options','ChatMessage','include','findAll','show','params','includeAll','find','create','body','describe'];(function(_0x26a838,_0xb7a034){var _0x410b59=function(_0x160734){while(--_0x160734){_0x26a838['push'](_0x26a838['shift']());}};_0x410b59(++_0xb7a034);}(_0xd005,0x1ba));var _0x5d00=function(_0x4b369d,_0x265eb8){_0x4b369d=_0x4b369d-0x0;var _0x571a98=_0xd005[_0x4b369d];return _0x571a98;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x5d00('0x0'));var zipdir=require(_0x5d00('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0x5d00('0x2'));var moment=require(_0x5d00('0x3'));var BPromise=require(_0x5d00('0x4'));var Mustache=require(_0x5d00('0x5'));var util=require(_0x5d00('0x6'));var path=require('path');var sox=require(_0x5d00('0x7'));var csv=require(_0x5d00('0x8'));var ejs=require(_0x5d00('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x5d00('0xa'));var squel=require(_0x5d00('0xb'));var crypto=require(_0x5d00('0xc'));var jsforce=require(_0x5d00('0xd'));var deskjs=require(_0x5d00('0xe'));var toCsv=require(_0x5d00('0x8'));var querystring=require(_0x5d00('0xf'));var Papa=require(_0x5d00('0x10'));var Redis=require(_0x5d00('0x11'));var authService=require(_0x5d00('0x12'));var qs=require(_0x5d00('0x13'));var as=require(_0x5d00('0x14'));var hardwareService=require(_0x5d00('0x15'));var logger=require(_0x5d00('0x16'))(_0x5d00('0x17'));var utils=require(_0x5d00('0x18'));var config=require(_0x5d00('0x19'));var licenseUtil=require(_0x5d00('0x1a'));var db=require('../../mysqldb')['db'];config[_0x5d00('0x1b')]=_[_0x5d00('0x1c')](config[_0x5d00('0x1b')],{'host':_0x5d00('0x1d'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x5d00('0x1b')]));require('./chatMessage.socket')['register'](socket);var jayson=require(_0x5d00('0x1e'));var client=jayson[_0x5d00('0x1f')][_0x5d00('0x20')]({'port':0x232c});var client9002=jayson['client'][_0x5d00('0x20')]({'port':0x232a});function respondWithRpcPromise(_0x22d915,_0x542b95,_0x3bf5a5,_0x3b0cfb){return new BPromise(function(_0x4480d,_0x3cb1cb){var _0x153813=_0x3b0cfb||client;return _0x153813[_0x5d00('0x21')](_0x22d915,_0x3bf5a5)[_0x5d00('0x22')](function(_0x20aa2e){logger[_0x5d00('0x23')](_0x5d00('0x24'),_0x542b95,_0x5d00('0x25'));logger[_0x5d00('0x26')](_0x5d00('0x27'),_0x542b95,_0x5d00('0x25'),JSON[_0x5d00('0x28')](_0x20aa2e));if(_0x20aa2e[_0x5d00('0x29')]){if(_0x20aa2e[_0x5d00('0x29')][_0x5d00('0x2a')]===0x1f4){logger[_0x5d00('0x29')]('ChatMessage,\x20%s,\x20%s',_0x542b95,_0x20aa2e[_0x5d00('0x29')]['message']);return _0x3cb1cb(_0x20aa2e[_0x5d00('0x29')]['message']);}logger['error'](_0x5d00('0x24'),_0x542b95,_0x20aa2e[_0x5d00('0x29')][_0x5d00('0x2b')]);return _0x4480d(_0x20aa2e['error']['message']);}else{logger[_0x5d00('0x23')](_0x5d00('0x24'),_0x542b95,_0x5d00('0x25'));_0x4480d(_0x20aa2e[_0x5d00('0x2c')][_0x5d00('0x2b')]);}})[_0x5d00('0x2d')](function(_0x1060a2){logger['error'](_0x5d00('0x24'),_0x542b95,_0x1060a2);_0x3cb1cb(_0x1060a2);});});}function respondWithStatusCode(_0x431eea,_0x13c832){_0x13c832=_0x13c832||0xcc;return function(_0x288eca){if(_0x288eca){return _0x431eea[_0x5d00('0x2e')](_0x13c832);}return _0x431eea[_0x5d00('0x2f')](_0x13c832)[_0x5d00('0x30')]();};}function respondWithResult(_0x4acbaa,_0x363db2){_0x363db2=_0x363db2||0xc8;return function(_0x3a51c9){if(_0x3a51c9){return _0x4acbaa[_0x5d00('0x2f')](_0x363db2)[_0x5d00('0x31')](_0x3a51c9);}};}function respondWithFilteredResult(_0x2790d9,_0x56ad95){return function(_0x5f24fa){if(_0x5f24fa){var _0x1f927e=typeof _0x56ad95[_0x5d00('0x32')]===_0x5d00('0x33')&&typeof _0x56ad95['limit']===_0x5d00('0x33');var _0x1a54e5=_0x5f24fa[_0x5d00('0x34')];var _0x1bcb33=_0x1f927e?0x0:_0x56ad95[_0x5d00('0x32')];var _0x4f53fe=_0x1f927e?_0x5f24fa[_0x5d00('0x34')]:_0x56ad95[_0x5d00('0x32')]+_0x56ad95[_0x5d00('0x35')];var _0x1ecd1d;if(_0x4f53fe>=_0x1a54e5){_0x4f53fe=_0x1a54e5;_0x1ecd1d=0xc8;}else{_0x1ecd1d=0xce;}_0x2790d9[_0x5d00('0x2f')](_0x1ecd1d);return _0x2790d9['set'](_0x5d00('0x36'),_0x1bcb33+'-'+_0x4f53fe+'/'+_0x1a54e5)['json'](_0x5f24fa);}return null;};}function patchUpdates(_0x218111){return function(_0x338122){try{jsonpatch[_0x5d00('0x37')](_0x338122,_0x218111,!![]);}catch(_0x294208){return BPromise['reject'](_0x294208);}return _0x338122[_0x5d00('0x38')]();};}function saveUpdates(_0x2cf57e,_0x3ed031){return function(_0x20d8cf){if(_0x20d8cf){return _0x20d8cf[_0x5d00('0x39')](_0x2cf57e)['then'](function(_0x3af7f3){return _0x3af7f3;});}return null;};}function removeEntity(_0x41ba96,_0x2da6bc){return function(_0x2e06ef){if(_0x2e06ef){return _0x2e06ef[_0x5d00('0x3a')]()[_0x5d00('0x22')](function(){_0x41ba96[_0x5d00('0x2f')](0xcc)[_0x5d00('0x30')]();});}};}function handleEntityNotFound(_0x4ace15,_0x27141a){return function(_0x1b28f7){if(!_0x1b28f7){_0x4ace15['sendStatus'](0x194);}return _0x1b28f7;};}function handleError(_0x10681f,_0x4ca259){_0x4ca259=_0x4ca259||0x1f4;return function(_0x3d03b6){logger[_0x5d00('0x29')](_0x3d03b6[_0x5d00('0x3b')]);if(_0x3d03b6[_0x5d00('0x3c')]){delete _0x3d03b6[_0x5d00('0x3c')];}_0x10681f[_0x5d00('0x2f')](_0x4ca259)['send'](_0x3d03b6);};}exports[_0x5d00('0x3d')]=function(_0x407459,_0x56ec06){var _0x4e2e77={},_0x48909b={},_0x177be9={'count':0x0,'rows':[]};var _0x54735c=_[_0x5d00('0x3e')](db['ChatMessage'][_0x5d00('0x3f')],function(_0x53dd7c){return{'name':_0x53dd7c[_0x5d00('0x40')],'type':_0x53dd7c['type'][_0x5d00('0x41')]};});_0x48909b[_0x5d00('0x42')]=_[_0x5d00('0x3e')](_0x54735c,'name');_0x48909b['query']=_[_0x5d00('0x43')](_0x407459[_0x5d00('0x44')]);_0x48909b[_0x5d00('0x45')]=_[_0x5d00('0x46')](_0x48909b[_0x5d00('0x42')],_0x48909b[_0x5d00('0x44')]);_0x4e2e77[_0x5d00('0x47')]=_[_0x5d00('0x46')](_0x48909b[_0x5d00('0x42')],qs[_0x5d00('0x48')](_0x407459['query']['fields']));_0x4e2e77[_0x5d00('0x47')]=_0x4e2e77[_0x5d00('0x47')][_0x5d00('0x49')]?_0x4e2e77[_0x5d00('0x47')]:_0x48909b[_0x5d00('0x42')];if(!_0x407459[_0x5d00('0x44')][_0x5d00('0x4a')](_0x5d00('0x4b'))){_0x4e2e77['limit']=qs[_0x5d00('0x35')](_0x407459[_0x5d00('0x44')]['limit']);_0x4e2e77[_0x5d00('0x32')]=qs[_0x5d00('0x32')](_0x407459[_0x5d00('0x44')][_0x5d00('0x32')]);}_0x4e2e77[_0x5d00('0x4c')]=qs['sort'](_0x407459[_0x5d00('0x44')]['sort']);_0x4e2e77[_0x5d00('0x4d')]=qs[_0x5d00('0x45')](_[_0x5d00('0x4e')](_0x407459[_0x5d00('0x44')],_0x48909b[_0x5d00('0x45')]),_0x54735c);if(_0x407459[_0x5d00('0x44')][_0x5d00('0x4f')]){_0x4e2e77[_0x5d00('0x4d')]=_[_0x5d00('0x50')](_0x4e2e77[_0x5d00('0x4d')],{'$or':_['map'](_0x54735c,function(_0x17f176){if(_0x17f176[_0x5d00('0x51')]!==_0x5d00('0x52')){var _0x5f401b={};_0x5f401b[_0x17f176[_0x5d00('0x3c')]]={'$like':'%'+_0x407459['query'][_0x5d00('0x4f')]+'%'};return _0x5f401b;}})});}_0x4e2e77=_['merge']({},_0x4e2e77,_0x407459[_0x5d00('0x53')]);var _0x179514={'where':_0x4e2e77[_0x5d00('0x4d')]};return db[_0x5d00('0x54')][_0x5d00('0x34')](_0x179514)['then'](function(_0x2e6e87){_0x177be9[_0x5d00('0x34')]=_0x2e6e87;if(_0x407459[_0x5d00('0x44')]['includeAll']){_0x4e2e77[_0x5d00('0x55')]=[{'all':!![]}];}return db[_0x5d00('0x54')][_0x5d00('0x56')](_0x4e2e77);})[_0x5d00('0x22')](function(_0x3106a9){_0x177be9['rows']=_0x3106a9;return _0x177be9;})['then'](respondWithFilteredResult(_0x56ec06,_0x4e2e77))[_0x5d00('0x2d')](handleError(_0x56ec06,null));};exports[_0x5d00('0x57')]=function(_0x157b56,_0x503510){var _0x5e619a={'raw':!![],'where':{'id':_0x157b56[_0x5d00('0x58')]['id']}},_0x349af0={};_0x349af0[_0x5d00('0x42')]=_[_0x5d00('0x43')](db['ChatMessage']['rawAttributes']);_0x349af0['query']=_[_0x5d00('0x43')](_0x157b56[_0x5d00('0x44')]);_0x349af0[_0x5d00('0x45')]=_['intersection'](_0x349af0[_0x5d00('0x42')],_0x349af0[_0x5d00('0x44')]);_0x5e619a[_0x5d00('0x47')]=_['intersection'](_0x349af0[_0x5d00('0x42')],qs['fields'](_0x157b56[_0x5d00('0x44')][_0x5d00('0x48')]));_0x5e619a[_0x5d00('0x47')]=_0x5e619a['attributes'][_0x5d00('0x49')]?_0x5e619a[_0x5d00('0x47')]:_0x349af0['model'];if(_0x157b56[_0x5d00('0x44')][_0x5d00('0x59')]){_0x5e619a[_0x5d00('0x55')]=[{'all':!![]}];}_0x5e619a=_['merge']({},_0x5e619a,_0x157b56['options']);return db[_0x5d00('0x54')][_0x5d00('0x5a')](_0x5e619a)['then'](handleEntityNotFound(_0x503510,null))[_0x5d00('0x22')](respondWithResult(_0x503510,null))[_0x5d00('0x2d')](handleError(_0x503510,null));};exports['create']=function(_0x447ee9,_0x304bfa){return db[_0x5d00('0x54')][_0x5d00('0x5b')](_0x447ee9[_0x5d00('0x5c')],{})[_0x5d00('0x22')](respondWithResult(_0x304bfa,0xc9))['catch'](handleError(_0x304bfa,null));};exports[_0x5d00('0x39')]=function(_0x321644,_0x2af2a1){if(_0x321644[_0x5d00('0x5c')]['id']){delete _0x321644[_0x5d00('0x5c')]['id'];}return db['ChatMessage'][_0x5d00('0x5a')]({'where':{'id':_0x321644[_0x5d00('0x58')]['id']}})[_0x5d00('0x22')](handleEntityNotFound(_0x2af2a1,null))[_0x5d00('0x22')](saveUpdates(_0x321644[_0x5d00('0x5c')],null))[_0x5d00('0x22')](respondWithResult(_0x2af2a1,null))['catch'](handleError(_0x2af2a1,null));};exports[_0x5d00('0x3a')]=function(_0x5e9a73,_0x107f56){return db[_0x5d00('0x54')][_0x5d00('0x5a')]({'where':{'id':_0x5e9a73[_0x5d00('0x58')]['id']}})[_0x5d00('0x22')](handleEntityNotFound(_0x107f56,null))[_0x5d00('0x22')](removeEntity(_0x107f56,null))[_0x5d00('0x2d')](handleError(_0x107f56,null));};exports['describe']=function(_0x50d59a,_0x561a04){return db[_0x5d00('0x54')][_0x5d00('0x5d')]()['then'](respondWithResult(_0x561a04,null))['catch'](handleError(_0x561a04,null));};var interaction_log=require('../../config/logger')(_0x5d00('0x5e'));exports[_0x5d00('0x5f')]=function(_0x21bfb5,_0x2ca54e,_0x296547){var _0x2342bb={'agent':{},'channel':_0x5d00('0x60')};if(_0x21bfb5['body']['id']){delete _0x21bfb5[_0x5d00('0x5c')]['id'];}_0x21bfb5[_0x5d00('0x5c')][_0x5d00('0x61')]=!![];_0x21bfb5[_0x5d00('0x5c')][_0x5d00('0x62')]=moment()[_0x5d00('0x63')]('YYYY-MM-DD\x20HH:mm:ss');_0x21bfb5[_0x5d00('0x5c')][_0x5d00('0x64')]=_0x21bfb5[_0x5d00('0x5c')][_0x5d00('0x64')]||_0x21bfb5[_0x5d00('0x65')]['id'];_0x2342bb[_0x5d00('0x66')]['id']=_0x21bfb5['body'][_0x5d00('0x64')];return db['ChatMessage']['find']({'where':{'id':_0x21bfb5[_0x5d00('0x58')]['id'],'UserId':null}})[_0x5d00('0x22')](handleEntityNotFound(_0x2ca54e,null))[_0x5d00('0x22')](saveUpdates(_0x21bfb5[_0x5d00('0x5c')],null))['then'](function(_0x4086fd){if(_0x4086fd){_0x2342bb[_0x5d00('0x2b')]=_0x4086fd[_0x5d00('0x67')]({'plain':!![]});return db[_0x5d00('0x68')][_0x5d00('0x5a')]({'where':{'id':_0x4086fd[_0x5d00('0x69')]}});}return null;})[_0x5d00('0x22')](handleEntityNotFound(_0x2ca54e,null))[_0x5d00('0x22')](function(_0x13220b){if(_0x13220b){return _0x13220b['update']({'UserId':_0x21bfb5[_0x5d00('0x5c')][_0x5d00('0x64')],'read1stAt':_[_0x5d00('0x6a')](_0x13220b[_0x5d00('0x6b')])?moment()[_0x5d00('0x63')](_0x5d00('0x6c')):undefined});}return null;})['then'](function(_0x58a919){if(_0x58a919){_0x2342bb[_0x5d00('0x6d')]=_0x58a919[_0x5d00('0x67')]({'plain':!![]});interaction_log['info']('[CHATMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s',_0x21bfb5[_0x5d00('0x65')]['id'],_0x21bfb5[_0x5d00('0x65')]['name'],_0x21bfb5[_0x5d00('0x65')][_0x5d00('0x6e')],_0x2342bb['interaction']['id'],_0x21bfb5[_0x5d00('0x5c')]?JSON[_0x5d00('0x28')](_0x21bfb5[_0x5d00('0x5c')]):_0x5d00('0x6f'));return respondWithRpcPromise('AcceptMessage','acceptMessage',_0x2342bb);}return null;})[_0x5d00('0x22')](function(_0x531093){var _0x280293=_0x5d00('0x70')+_0x531093[_0x5d00('0x2b')]['ContactId'];return db['sequelize'][_0x5d00('0x44')](_0x280293,{'type':db['Sequelize']['QueryTypes']['SELECT'],'raw':!![]})[_0x5d00('0x22')](function(_0x52e8bd){return _0x52e8bd;});})[_0x5d00('0x22')](function(_0x378805){if(_0x378805){_0x2342bb[_0x5d00('0x2b')]['contact']=_0x378805[0x0];if(!_0x21bfb5[_0x5d00('0x5c')][_0x5d00('0x64')])return;return db[_0x5d00('0x71')][_0x5d00('0x5a')]({'where':{'id':_0x21bfb5[_0x5d00('0x5c')]['UserId'],'role':_0x5d00('0x66')},'attributes':['id',_0x5d00('0x3c'),_0x5d00('0x72'),_0x5d00('0x73'),'internal'],'raw':!![]});}return null;})[_0x5d00('0x22')](function(_0x2a3ebc){if(!_0x2a3ebc)return null;_0x2342bb[_0x5d00('0x2b')][_0x5d00('0x66')]=_0x2a3ebc;return _0x2342bb;})[_0x5d00('0x22')](function(_0x4caf8c){if(_0x4caf8c){if(_0x21bfb5['body'][_0x5d00('0x74')]){_0x2342bb[_0x5d00('0x2b')]['interface']=util[_0x5d00('0x63')](_0x5d00('0x75'),_0x21bfb5[_0x5d00('0x65')][_0x5d00('0x3c')]);_0x2342bb['message'][_0x5d00('0x76')]=_0x2342bb[_0x5d00('0x76')];_0x2342bb[_0x5d00('0x2b')]['motionChannel']=_0x2342bb['channel'];_0x2342bb[_0x5d00('0x2b')][_0x5d00('0x77')]='accept';return respondWithRpcPromise(_0x5d00('0x78'),_0x5d00('0x78'),{'event':_0x5d00('0x79'),'message':_[_0x5d00('0x50')](_0x2342bb[_0x5d00('0x2b')],JSON[_0x5d00('0x7a')](_0x2342bb['interaction']['formData']))},client9002)['then'](function(){return _0x2342bb;});}return _0x2342bb;}return null;})['then'](respondWithResult(_0x2ca54e,null))['catch'](handleError(_0x2ca54e,null));};var interaction_log=require(_0x5d00('0x16'))(_0x5d00('0x5e'));exports[_0x5d00('0x7b')]=function(_0x18312d,_0x41e060,_0xab47f){var _0x24f147={'agent':{},'channel':_0x5d00('0x60')};if(_0x18312d['body']['id']){delete _0x18312d[_0x5d00('0x5c')]['id'];}_0x18312d[_0x5d00('0x5c')][_0x5d00('0x64')]=_0x18312d[_0x5d00('0x5c')]['UserId']||_0x18312d[_0x5d00('0x65')]['id'];_0x24f147['agent']['id']=_0x18312d[_0x5d00('0x5c')][_0x5d00('0x64')];return db['ChatMessage'][_0x5d00('0x5a')]({'where':{'id':_0x18312d['params']['id'],'UserId':null}})[_0x5d00('0x22')](handleEntityNotFound(_0x41e060,null))[_0x5d00('0x22')](function(_0x590a1d){if(_0x590a1d){_0x24f147[_0x5d00('0x2b')]=_0x590a1d[_0x5d00('0x67')]({'plain':!![]});return db['ChatInteraction'][_0x5d00('0x5a')]({'where':{'id':_0x590a1d[_0x5d00('0x69')]}});}return null;})[_0x5d00('0x22')](handleEntityNotFound(_0x41e060,null))[_0x5d00('0x22')](function(_0x3dfe5d){if(_0x3dfe5d){_0x24f147['interaction']=_0x3dfe5d[_0x5d00('0x67')]({'plain':!![]});interaction_log['info'](_0x5d00('0x7c'),_0x18312d[_0x5d00('0x65')]['id'],_0x18312d[_0x5d00('0x65')][_0x5d00('0x3c')],_0x18312d[_0x5d00('0x65')][_0x5d00('0x6e')],_0x24f147[_0x5d00('0x6d')]['id'],_0x18312d[_0x5d00('0x5c')]?JSON[_0x5d00('0x28')](_0x18312d['body']):_0x5d00('0x6f'));return respondWithRpcPromise('RejectMessage',_0x5d00('0x7d'),_0x24f147);}return null;})['then'](function(_0x4cb660){var _0x49e9af=_0x5d00('0x70')+_0x4cb660[_0x5d00('0x2b')]['ContactId'];return db['sequelize']['query'](_0x49e9af,{'type':db[_0x5d00('0x7e')][_0x5d00('0x7f')][_0x5d00('0x80')],'raw':!![]})[_0x5d00('0x22')](function(_0x5571c4){return _0x5571c4;});})['then'](function(_0x54f26b){if(_0x54f26b){_0x24f147[_0x5d00('0x2b')][_0x5d00('0x81')]=_0x54f26b[0x0];if(!_0x18312d[_0x5d00('0x5c')]['UserId'])return;return db[_0x5d00('0x71')][_0x5d00('0x5a')]({'where':{'id':_0x18312d[_0x5d00('0x5c')][_0x5d00('0x64')],'role':_0x5d00('0x66')},'attributes':['id',_0x5d00('0x3c'),'fullname',_0x5d00('0x73'),_0x5d00('0x82')],'raw':!![]});}return null;})[_0x5d00('0x22')](function(_0x4db316){if(!_0x4db316)return null;_0x24f147[_0x5d00('0x2b')][_0x5d00('0x66')]=_0x4db316;return _0x24f147;})[_0x5d00('0x22')](function(_0x1cffcb){if(_0x1cffcb){_0x1cffcb['message'][_0x5d00('0x83')]=util[_0x5d00('0x63')](_0x5d00('0x75'),_0x18312d['user']['name']);_0x1cffcb[_0x5d00('0x2b')][_0x5d00('0x76')]=_0x24f147[_0x5d00('0x76')];_0x1cffcb[_0x5d00('0x2b')][_0x5d00('0x84')]=_0x24f147[_0x5d00('0x76')];_0x1cffcb['message']['event']=_0x5d00('0x7b');respondWithRpcPromise('EventManager',_0x5d00('0x78'),{'event':'rejectmessage','message':_['merge'](_0x24f147[_0x5d00('0x2b')],JSON[_0x5d00('0x7a')](_0x24f147[_0x5d00('0x6d')][_0x5d00('0x85')]))},client9002);return _0x24f147;}return null;})[_0x5d00('0x22')](respondWithResult(_0x41e060,null))['catch'](handleError(_0x41e060,null));}; \ No newline at end of file diff --git a/server/api/chatMessage/chatMessage.events.js b/server/api/chatMessage/chatMessage.events.js index 369ad83..1f2b8a4 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 _0x37cd=['ChatMessage','setMaxListeners','save','update','remove','emit','hook','exports','../../mysqldb'];(function(_0x3ec1da,_0x1e36f5){var _0x472358=function(_0x1d41b1){while(--_0x1d41b1){_0x3ec1da['push'](_0x3ec1da['shift']());}};_0x472358(++_0x1e36f5);}(_0x37cd,0xa1));var _0xd37c=function(_0x432682,_0x253044){_0x432682=_0x432682-0x0;var _0x463d05=_0x37cd[_0x432682];return _0x463d05;};'use strict';var EventEmitter=require('events');var ChatMessage=require(_0xd37c('0x0'))['db'][_0xd37c('0x1')];var ChatMessageEvents=new EventEmitter();ChatMessageEvents[_0xd37c('0x2')](0x0);var events={'afterCreate':_0xd37c('0x3'),'afterUpdate':_0xd37c('0x4'),'afterDestroy':_0xd37c('0x5')};function emitEvent(_0x1188c6){return function(_0x273751,_0x99e193,_0x43f800){ChatMessageEvents[_0xd37c('0x6')](_0x1188c6+':'+_0x273751['id'],_0x273751);ChatMessageEvents[_0xd37c('0x6')](_0x1188c6,_0x273751);_0x43f800(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];ChatMessage[_0xd37c('0x7')](e,emitEvent(event));}}module[_0xd37c('0x8')]=ChatMessageEvents; \ No newline at end of file +var _0x5a8c=['emit','hook','exports','events','ChatMessage','setMaxListeners','save','update'];(function(_0x40fddd,_0x23dba6){var _0x409963=function(_0x1ed338){while(--_0x1ed338){_0x40fddd['push'](_0x40fddd['shift']());}};_0x409963(++_0x23dba6);}(_0x5a8c,0x123));var _0xc5a8=function(_0x37b83f,_0x29a8f7){_0x37b83f=_0x37b83f-0x0;var _0x1fbac1=_0x5a8c[_0x37b83f];return _0x1fbac1;};'use strict';var EventEmitter=require(_0xc5a8('0x0'));var ChatMessage=require('../../mysqldb')['db'][_0xc5a8('0x1')];var ChatMessageEvents=new EventEmitter();ChatMessageEvents[_0xc5a8('0x2')](0x0);var events={'afterCreate':_0xc5a8('0x3'),'afterUpdate':_0xc5a8('0x4'),'afterDestroy':'remove'};function emitEvent(_0x198537){return function(_0x19ecc4,_0x337a2c,_0x3a23c2){ChatMessageEvents[_0xc5a8('0x5')](_0x198537+':'+_0x19ecc4['id'],_0x19ecc4);ChatMessageEvents['emit'](_0x198537,_0x19ecc4);_0x3a23c2(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];ChatMessage[_0xc5a8('0x6')](e,emitEvent(event));}}module[_0xc5a8('0x7')]=ChatMessageEvents; \ No newline at end of file diff --git a/server/api/chatMessage/chatMessage.model.js b/server/api/chatMessage/chatMessage.model.js index b0d5a7e..d19607f 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 _0x10ef=['catch','utf8mb4','utf8mb4_unicode_ci','lodash','util','api','moment','request-promise','path','rimraf','../../config/environment','exports','ChatMessage','chat_messages','fti_chat_messages','body','FULLTEXT','models','direction','toLowerCase','out','secret','isNil','UserId','findOne','ChatInteractionId','update','createdAt'];(function(_0x560684,_0x4fe7fd){var _0x51ec93=function(_0x2e88b4){while(--_0x2e88b4){_0x560684['push'](_0x560684['shift']());}};_0x51ec93(++_0x4fe7fd);}(_0x10ef,0xc7));var _0xf10e=function(_0x4c1bdc,_0x177e19){_0x4c1bdc=_0x4c1bdc-0x0;var _0x2a27b3=_0x10ef[_0x4c1bdc];return _0x2a27b3;};'use strict';var _=require(_0xf10e('0x0'));var util=require(_0xf10e('0x1'));var logger=require('../../config/logger')(_0xf10e('0x2'));var moment=require(_0xf10e('0x3'));var BPromise=require('bluebird');var rp=require(_0xf10e('0x4'));var fs=require('fs');var path=require(_0xf10e('0x5'));var rimraf=require(_0xf10e('0x6'));var config=require(_0xf10e('0x7'));var attributes=require('./chatMessage.attributes');module[_0xf10e('0x8')]=function(_0x237694,_0x4e030c){return _0x237694['define'](_0xf10e('0x9'),attributes,{'tableName':_0xf10e('0xa'),'paranoid':![],'indexes':[{'name':_0xf10e('0xb'),'fields':[_0xf10e('0xc')],'type':_0xf10e('0xd')}],'timestamps':!![],'hooks':{'afterCreate':function(_0x314d54,_0x43a54d,_0x344e06){var _0x450514=_0x237694[_0xf10e('0xe')];var _0xece515=_0x314d54['get']({'plain':!![]});if(_0xece515[_0xf10e('0xf')]['toLowerCase']()==='in'||_0xece515['direction'][_0xf10e('0x10')]()===_0xf10e('0x11')&&!_0xece515[_0xf10e('0x12')]&&!_[_0xf10e('0x13')](_0xece515[_0xf10e('0x14')])){_0x450514['ChatInteraction'][_0xf10e('0x15')]({'where':{'id':_0xece515[_0xf10e('0x16')]}})['then'](function(_0x2ddb55){if(_0x2ddb55){_0x2ddb55[_0xf10e('0x17')]({'lastMsgAt':_0xece515[_0xf10e('0x18')],'lastMsgDirection':_0xece515[_0xf10e('0xf')][_0xf10e('0x10')]()});}})[_0xf10e('0x19')](function(_0x15a5b6){console['error'](_0x15a5b6);});}_0x344e06();}},'charset':_0xf10e('0x1a'),'collate':_0xf10e('0x1b')});}; \ No newline at end of file +var _0x711b=['define','ChatMessage','chat_messages','fti_chat_messages','body','FULLTEXT','get','toLowerCase','direction','out','isNil','UserId','findOne','ChatInteractionId','then','update','catch','utf8mb4_unicode_ci','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./chatMessage.attributes','exports'];(function(_0x4af241,_0x4539e7){var _0xbb1404=function(_0x44bf13){while(--_0x44bf13){_0x4af241['push'](_0x4af241['shift']());}};_0xbb1404(++_0x4539e7);}(_0x711b,0x13e));var _0xb711=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x711b[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0xb711('0x0'));var util=require(_0xb711('0x1'));var logger=require(_0xb711('0x2'))(_0xb711('0x3'));var moment=require(_0xb711('0x4'));var BPromise=require(_0xb711('0x5'));var rp=require(_0xb711('0x6'));var fs=require('fs');var path=require(_0xb711('0x7'));var rimraf=require(_0xb711('0x8'));var config=require(_0xb711('0x9'));var attributes=require(_0xb711('0xa'));module[_0xb711('0xb')]=function(_0x2f3dd6,_0x2db365){return _0x2f3dd6[_0xb711('0xc')](_0xb711('0xd'),attributes,{'tableName':_0xb711('0xe'),'paranoid':![],'indexes':[{'name':_0xb711('0xf'),'fields':[_0xb711('0x10')],'type':_0xb711('0x11')}],'timestamps':!![],'hooks':{'afterCreate':function(_0x37ee57,_0x5bda6e,_0x1ca89){var _0x31c4a4=_0x2f3dd6['models'];var _0x3a0d46=_0x37ee57[_0xb711('0x12')]({'plain':!![]});if(_0x3a0d46['direction'][_0xb711('0x13')]()==='in'||_0x3a0d46[_0xb711('0x14')][_0xb711('0x13')]()===_0xb711('0x15')&&!_0x3a0d46['secret']&&!_[_0xb711('0x16')](_0x3a0d46[_0xb711('0x17')])){_0x31c4a4['ChatInteraction'][_0xb711('0x18')]({'where':{'id':_0x3a0d46[_0xb711('0x19')]}})[_0xb711('0x1a')](function(_0x452981){if(_0x452981){_0x452981[_0xb711('0x1b')]({'lastMsgAt':_0x3a0d46['createdAt'],'lastMsgDirection':_0x3a0d46[_0xb711('0x14')]['toLowerCase']()});}})[_0xb711('0x1c')](function(_0x5af63d){console['error'](_0x5af63d);});}_0x1ca89();}},'charset':'utf8mb4','collate':_0xb711('0x1d')});}; \ No newline at end of file diff --git a/server/api/chatMessage/chatMessage.rpc.js b/server/api/chatMessage/chatMessage.rpc.js index 9da6c3a..c264b21 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 _0xaf32=['../../mysqldb','rpc','jayson/promise','client','defaults','redis','./chatMessage.socket','register','request','info','ChatMessage,\x20%s,\x20%s','request\x20sent','debug','error','code','message','CreateChatMessage','ChatMessage','create','options','raw','then','catch','lodash','util','moment','bluebird','ioredis'];(function(_0x44b3f6,_0x2f0b79){var _0x4a6207=function(_0x5835fb){while(--_0x5835fb){_0x44b3f6['push'](_0x44b3f6['shift']());}};_0x4a6207(++_0x2f0b79);}(_0xaf32,0x14b));var _0x2af3=function(_0x5ed928,_0x2dbbdc){_0x5ed928=_0x5ed928-0x0;var _0x2effcc=_0xaf32[_0x5ed928];return _0x2effcc;};'use strict';var _=require(_0x2af3('0x0'));var util=require(_0x2af3('0x1'));var moment=require(_0x2af3('0x2'));var BPromise=require(_0x2af3('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x2af3('0x4'));var db=require(_0x2af3('0x5'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0x2af3('0x6'));var config=require('../../config/environment');var jayson=require(_0x2af3('0x7'));var client=jayson[_0x2af3('0x8')]['http']({'port':0x232a});config['redis']=_[_0x2af3('0x9')](config[_0x2af3('0xa')],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require(_0x2af3('0xb'))[_0x2af3('0xc')](socket);function respondWithRpcPromise(_0xb4cf42,_0x207f11,_0xd29472){return new BPromise(function(_0x558e70,_0x10c727){return client[_0x2af3('0xd')](_0xb4cf42,_0xd29472)['then'](function(_0x4d0a5e){logger[_0x2af3('0xe')](_0x2af3('0xf'),_0x207f11,_0x2af3('0x10'));logger[_0x2af3('0x11')]('ChatMessage,\x20%s,\x20%s,\x20%s',_0x207f11,'request\x20sent',JSON['stringify'](_0x4d0a5e));if(_0x4d0a5e[_0x2af3('0x12')]){if(_0x4d0a5e[_0x2af3('0x12')][_0x2af3('0x13')]===0x1f4){logger[_0x2af3('0x12')](_0x2af3('0xf'),_0x207f11,_0x4d0a5e[_0x2af3('0x12')][_0x2af3('0x14')]);return _0x10c727(_0x4d0a5e[_0x2af3('0x12')]['message']);}logger['error'](_0x2af3('0xf'),_0x207f11,_0x4d0a5e[_0x2af3('0x12')][_0x2af3('0x14')]);return _0x558e70(_0x4d0a5e[_0x2af3('0x12')][_0x2af3('0x14')]);}else{logger[_0x2af3('0xe')](_0x2af3('0xf'),_0x207f11,'request\x20sent');_0x558e70(_0x4d0a5e['result'][_0x2af3('0x14')]);}})['catch'](function(_0x45c56e){logger['error'](_0x2af3('0xf'),_0x207f11,_0x45c56e);_0x10c727(_0x45c56e);});});}exports[_0x2af3('0x15')]=function(_0x4393f3){var _0x612d2f=this;return new Promise(function(_0x565db1,_0xe551e6){return db[_0x2af3('0x16')][_0x2af3('0x17')](_0x4393f3['body'],{'raw':_0x4393f3[_0x2af3('0x18')]?_0x4393f3[_0x2af3('0x18')][_0x2af3('0x19')]===undefined?!![]:![]:!![]})[_0x2af3('0x1a')](function(_0x3039f9){logger[_0x2af3('0xe')](_0x2af3('0x15'),_0x4393f3);logger[_0x2af3('0x11')](_0x2af3('0x15'),_0x4393f3,JSON['stringify'](_0x3039f9));_0x565db1(_0x3039f9);})[_0x2af3('0x1b')](function(_0x341791){logger[_0x2af3('0x12')](_0x2af3('0x15'),_0x341791[_0x2af3('0x14')],_0x4393f3);_0xe551e6(_0x612d2f[_0x2af3('0x12')](0x1f4,_0x341791[_0x2af3('0x14')]));});});}; \ No newline at end of file +var _0xfd87=['http','defaults','redis','localhost','socket.io-emitter','register','request','info','ChatMessage,\x20%s,\x20%s','debug','ChatMessage,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','catch','CreateChatMessage','ChatMessage','create','body','options','then','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client'];(function(_0x435fa1,_0x58550a){var _0x845f9f=function(_0x89867e){while(--_0x89867e){_0x435fa1['push'](_0x435fa1['shift']());}};_0x845f9f(++_0x58550a);}(_0xfd87,0x80));var _0x7fd8=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xfd87[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0x7fd8('0x0'));var util=require(_0x7fd8('0x1'));var moment=require(_0x7fd8('0x2'));var BPromise=require(_0x7fd8('0x3'));var rs=require(_0x7fd8('0x4'));var fs=require('fs');var Redis=require(_0x7fd8('0x5'));var db=require(_0x7fd8('0x6'))['db'];var utils=require(_0x7fd8('0x7'));var logger=require(_0x7fd8('0x8'))(_0x7fd8('0x9'));var config=require(_0x7fd8('0xa'));var jayson=require('jayson/promise');var client=jayson[_0x7fd8('0xb')][_0x7fd8('0xc')]({'port':0x232a});config['redis']=_[_0x7fd8('0xd')](config[_0x7fd8('0xe')],{'host':_0x7fd8('0xf'),'port':0x18eb});var socket=require(_0x7fd8('0x10'))(new Redis(config[_0x7fd8('0xe')]));require('./chatMessage.socket')[_0x7fd8('0x11')](socket);function respondWithRpcPromise(_0x18e3ea,_0x1b8863,_0x596d03){return new BPromise(function(_0x5486fc,_0x4948d0){return client[_0x7fd8('0x12')](_0x18e3ea,_0x596d03)['then'](function(_0x4749df){logger[_0x7fd8('0x13')](_0x7fd8('0x14'),_0x1b8863,'request\x20sent');logger[_0x7fd8('0x15')](_0x7fd8('0x16'),_0x1b8863,_0x7fd8('0x17'),JSON[_0x7fd8('0x18')](_0x4749df));if(_0x4749df[_0x7fd8('0x19')]){if(_0x4749df['error'][_0x7fd8('0x1a')]===0x1f4){logger[_0x7fd8('0x19')](_0x7fd8('0x14'),_0x1b8863,_0x4749df[_0x7fd8('0x19')][_0x7fd8('0x1b')]);return _0x4948d0(_0x4749df[_0x7fd8('0x19')][_0x7fd8('0x1b')]);}logger[_0x7fd8('0x19')](_0x7fd8('0x14'),_0x1b8863,_0x4749df[_0x7fd8('0x19')][_0x7fd8('0x1b')]);return _0x5486fc(_0x4749df['error']['message']);}else{logger['info'](_0x7fd8('0x14'),_0x1b8863,_0x7fd8('0x17'));_0x5486fc(_0x4749df['result'][_0x7fd8('0x1b')]);}})[_0x7fd8('0x1c')](function(_0x40b134){logger[_0x7fd8('0x19')](_0x7fd8('0x14'),_0x1b8863,_0x40b134);_0x4948d0(_0x40b134);});});}exports[_0x7fd8('0x1d')]=function(_0x2edf31){var _0x4539b6=this;return new Promise(function(_0x4b5d0a,_0x34bc09){return db[_0x7fd8('0x1e')][_0x7fd8('0x1f')](_0x2edf31[_0x7fd8('0x20')],{'raw':_0x2edf31[_0x7fd8('0x21')]?_0x2edf31[_0x7fd8('0x21')]['raw']===undefined?!![]:![]:!![]})[_0x7fd8('0x22')](function(_0x1d26d4){logger[_0x7fd8('0x13')](_0x7fd8('0x1d'),_0x2edf31);logger['debug'](_0x7fd8('0x1d'),_0x2edf31,JSON[_0x7fd8('0x18')](_0x1d26d4));_0x4b5d0a(_0x1d26d4);})[_0x7fd8('0x1c')](function(_0x33ab3d){logger[_0x7fd8('0x19')]('CreateChatMessage',_0x33ab3d['message'],_0x2edf31);_0x34bc09(_0x4539b6[_0x7fd8('0x19')](0x1f4,_0x33ab3d[_0x7fd8('0x1b')]));});});}; \ No newline at end of file diff --git a/server/api/chatMessage/chatMessage.socket.js b/server/api/chatMessage/chatMessage.socket.js index dfdfd93..871aeed 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 _0x1696=['length','chatMessage:','./chatMessage.events','remove','update','emit','removeListener'];(function(_0x117f4c,_0x36a9b1){var _0x2b24e9=function(_0x31761b){while(--_0x31761b){_0x117f4c['push'](_0x117f4c['shift']());}};_0x2b24e9(++_0x36a9b1);}(_0x1696,0x79));var _0x6169=function(_0x2b5c1e,_0x5ee7eb){_0x2b5c1e=_0x2b5c1e-0x0;var _0x30a4d1=_0x1696[_0x2b5c1e];return _0x30a4d1;};'use strict';var ChatMessageEvents=require(_0x6169('0x0'));var events=['save',_0x6169('0x1'),_0x6169('0x2')];function createListener(_0x1c5bac,_0xab8597){return function(_0x20d57e){_0xab8597[_0x6169('0x3')](_0x1c5bac,_0x20d57e);};}function removeListener(_0x357aaf,_0x10d0ab){return function(){ChatMessageEvents[_0x6169('0x4')](_0x357aaf,_0x10d0ab);};}exports['register']=function(_0x3569ff){for(var _0x128cf1=0x0,_0x277459=events[_0x6169('0x5')];_0x128cf1<_0x277459;_0x128cf1++){var _0x289333=events[_0x128cf1];var _0x2a1658=createListener(_0x6169('0x6')+_0x289333,_0x3569ff);ChatMessageEvents['on'](_0x289333,_0x2a1658);}}; \ No newline at end of file +var _0x448b=['emit','removeListener','register','length','chatMessage:','./chatMessage.events','save','remove','update'];(function(_0x1e6805,_0x31a414){var _0x5d12aa=function(_0x4767db){while(--_0x4767db){_0x1e6805['push'](_0x1e6805['shift']());}};_0x5d12aa(++_0x31a414);}(_0x448b,0x125));var _0xb448=function(_0x2c4639,_0x45b465){_0x2c4639=_0x2c4639-0x0;var _0x1a2ad0=_0x448b[_0x2c4639];return _0x1a2ad0;};'use strict';var ChatMessageEvents=require(_0xb448('0x0'));var events=[_0xb448('0x1'),_0xb448('0x2'),_0xb448('0x3')];function createListener(_0x422fa2,_0x51583a){return function(_0x5bf7db){_0x51583a[_0xb448('0x4')](_0x422fa2,_0x5bf7db);};}function removeListener(_0x32bcae,_0x172a89){return function(){ChatMessageEvents[_0xb448('0x5')](_0x32bcae,_0x172a89);};}exports[_0xb448('0x6')]=function(_0x276466){for(var _0x3670cb=0x0,_0x5993ad=events[_0xb448('0x7')];_0x3670cb<_0x5993ad;_0x3670cb++){var _0x2f6f82=events[_0x3670cb];var _0x2c2bdd=createListener(_0xb448('0x8')+_0x2f6f82,_0x276466);ChatMessageEvents['on'](_0x2f6f82,_0x2c2bdd);}}; \ No newline at end of file diff --git a/server/api/chatMessage/index.js b/server/api/chatMessage/index.js index 182d813..2ce9a8a 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 _0xa011=['/:id','tracked','chat','chatmessage:create','put','update','/:id/accept','accept','/:id/reject','reject','delete','destroy','multer','util','connect-timeout','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./chatMessage.controller','get','isAuthenticated','index','/describe','describe'];(function(_0x2de020,_0x252df0){var _0x182b7c=function(_0xcbcdaa){while(--_0xcbcdaa){_0x2de020['push'](_0x2de020['shift']());}};_0x182b7c(++_0x252df0);}(_0xa011,0xbb));var _0x1a01=function(_0x469d85,_0x3ffa0c){_0x469d85=_0x469d85-0x0;var _0x1e75c9=_0xa011[_0x469d85];return _0x1e75c9;};'use strict';var multer=require(_0x1a01('0x0'));var util=require(_0x1a01('0x1'));var path=require('path');var timeout=require(_0x1a01('0x2'));var express=require('express');var router=express[_0x1a01('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x1a01('0x4'));var interaction=require(_0x1a01('0x5'));var config=require(_0x1a01('0x6'));var controller=require(_0x1a01('0x7'));router[_0x1a01('0x8')]('/',auth[_0x1a01('0x9')](),controller[_0x1a01('0xa')]);router[_0x1a01('0x8')](_0x1a01('0xb'),auth[_0x1a01('0x9')](),controller[_0x1a01('0xc')]);router[_0x1a01('0x8')](_0x1a01('0xd'),auth[_0x1a01('0x9')](),controller['show']);router['post']('/',auth['isAuthenticated'](),interaction[_0x1a01('0xe')](_0x1a01('0xf'),_0x1a01('0x10')),controller['create']);router[_0x1a01('0x11')](_0x1a01('0xd'),controller[_0x1a01('0x12')]);router[_0x1a01('0x11')](_0x1a01('0x13'),auth[_0x1a01('0x9')](),controller[_0x1a01('0x14')]);router[_0x1a01('0x11')](_0x1a01('0x15'),auth['isAuthenticated'](),controller[_0x1a01('0x16')]);router[_0x1a01('0x17')]('/:id',auth[_0x1a01('0x9')](),controller[_0x1a01('0x18')]);module['exports']=router; \ No newline at end of file +var _0x9721=['multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../config/environment','./chatMessage.controller','get','index','/describe','isAuthenticated','/:id','show','post','tracked','chat','create','put','update','/:id/accept','/:id/reject','reject','delete','destroy','exports'];(function(_0x12857b,_0x1aaa6a){var _0x47d98d=function(_0x1f4768){while(--_0x1f4768){_0x12857b['push'](_0x12857b['shift']());}};_0x47d98d(++_0x1aaa6a);}(_0x9721,0x134));var _0x1972=function(_0x5c78fa,_0x3983d4){_0x5c78fa=_0x5c78fa-0x0;var _0x4e45a5=_0x9721[_0x5c78fa];return _0x4e45a5;};'use strict';var multer=require(_0x1972('0x0'));var util=require(_0x1972('0x1'));var path=require(_0x1972('0x2'));var timeout=require(_0x1972('0x3'));var express=require(_0x1972('0x4'));var router=express[_0x1972('0x5')]();var fs_extra=require(_0x1972('0x6'));var auth=require(_0x1972('0x7'));var interaction=require('../../components/interaction/service');var config=require(_0x1972('0x8'));var controller=require(_0x1972('0x9'));router[_0x1972('0xa')]('/',auth['isAuthenticated'](),controller[_0x1972('0xb')]);router[_0x1972('0xa')](_0x1972('0xc'),auth[_0x1972('0xd')](),controller['describe']);router[_0x1972('0xa')](_0x1972('0xe'),auth[_0x1972('0xd')](),controller[_0x1972('0xf')]);router[_0x1972('0x10')]('/',auth['isAuthenticated'](),interaction[_0x1972('0x11')](_0x1972('0x12'),'chatmessage:create'),controller[_0x1972('0x13')]);router[_0x1972('0x14')](_0x1972('0xe'),controller[_0x1972('0x15')]);router[_0x1972('0x14')](_0x1972('0x16'),auth['isAuthenticated'](),controller['accept']);router[_0x1972('0x14')](_0x1972('0x17'),auth[_0x1972('0xd')](),controller[_0x1972('0x18')]);router[_0x1972('0x19')](_0x1972('0xe'),auth[_0x1972('0xd')](),controller[_0x1972('0x1a')]);module[_0x1972('0x1b')]=router; \ No newline at end of file diff --git a/server/api/chatOfflineMessage/chatOfflineMessage.attributes.js b/server/api/chatOfflineMessage/chatOfflineMessage.attributes.js index a07c752..07fb91f 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 _0xadb5=['medium','TEXT','exports'];(function(_0x30a07b,_0x210a9){var _0x14bf47=function(_0x38ba28){while(--_0x38ba28){_0x30a07b['push'](_0x30a07b['shift']());}};_0x14bf47(++_0x210a9);}(_0xadb5,0xad));var _0x5adb=function(_0x5636e9,_0x4342f5){_0x5636e9=_0x5636e9-0x0;var _0x1bb2dd=_0xadb5[_0x5636e9];return _0x1bb2dd;};'use strict';var Sequelize=require('sequelize');module[_0x5adb('0x0')]={'body':{'type':Sequelize['TEXT'](_0x5adb('0x1')),'allowNull':![]},'plainBody':{'type':Sequelize[_0x5adb('0x2')](_0x5adb('0x1')),'allowNull':![]}}; \ No newline at end of file +var _0x2032=['medium','exports','TEXT'];(function(_0x3c6a3b,_0x362ae6){var _0x1c474e=function(_0x2d5cb6){while(--_0x2d5cb6){_0x3c6a3b['push'](_0x3c6a3b['shift']());}};_0x1c474e(++_0x362ae6);}(_0x2032,0xd9));var _0x2203=function(_0x5329f2,_0x5352fa){_0x5329f2=_0x5329f2-0x0;var _0x38620d=_0x2032[_0x5329f2];return _0x38620d;};'use strict';var Sequelize=require('sequelize');module[_0x2203('0x0')]={'body':{'type':Sequelize[_0x2203('0x1')](_0x2203('0x2')),'allowNull':![]},'plainBody':{'type':Sequelize['TEXT'](_0x2203('0x2')),'allowNull':![]}}; \ No newline at end of file diff --git a/server/api/chatOfflineMessage/chatOfflineMessage.controller.js b/server/api/chatOfflineMessage/chatOfflineMessage.controller.js index a7c8aa3..0780252 100644 --- a/server/api/chatOfflineMessage/chatOfflineMessage.controller.js +++ b/server/api/chatOfflineMessage/chatOfflineMessage.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x7a54=['filter','VIRTUAL','includeAll','include','findAll','rows','show','params','length','merge','options','find','catch','body','Attachment','join','server','attachments','offline-chat','basename','remove','describe','eml-format','rimraf','zip-dir','request-promise','moment','mustache','util','path','sox','to-csv','fs-extra','squel','crypto','desk.js','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','count','limit','set','Content-Range','reject','save','update','then','destroy','error','stack','name','send','index','ChatOfflineMessage','fieldName','type','model','map','query','filters','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','where','pick'];(function(_0x297fd3,_0x115406){var _0x2af381=function(_0x1dd31b){while(--_0x1dd31b){_0x297fd3['push'](_0x297fd3['shift']());}};_0x2af381(++_0x115406);}(_0x7a54,0x106));var _0x47a5=function(_0x41cfbd,_0xef5664){_0x41cfbd=_0x41cfbd-0x0;var _0x745d03=_0x7a54[_0x41cfbd];return _0x745d03;};'use strict';var emlformat=require(_0x47a5('0x0'));var rimraf=require(_0x47a5('0x1'));var zipdir=require(_0x47a5('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x47a5('0x3'));var moment=require(_0x47a5('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x47a5('0x5'));var util=require(_0x47a5('0x6'));var path=require(_0x47a5('0x7'));var sox=require(_0x47a5('0x8'));var csv=require(_0x47a5('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x47a5('0xa'));var _=require('lodash');var squel=require(_0x47a5('0xb'));var crypto=require(_0x47a5('0xc'));var jsforce=require('jsforce');var deskjs=require(_0x47a5('0xd'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x47a5('0xe'));var authService=require(_0x47a5('0xf'));var qs=require('../../components/parsers/qs');var as=require(_0x47a5('0x10'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x47a5('0x11'));var utils=require(_0x47a5('0x12'));var config=require(_0x47a5('0x13'));var licenseUtil=require(_0x47a5('0x14'));var db=require(_0x47a5('0x15'))['db'];function respondWithStatusCode(_0xd308b8,_0x1eae59){_0x1eae59=_0x1eae59||0xcc;return function(_0x5beb89){if(_0x5beb89){return _0xd308b8[_0x47a5('0x16')](_0x1eae59);}return _0xd308b8[_0x47a5('0x17')](_0x1eae59)[_0x47a5('0x18')]();};}function respondWithResult(_0x711793,_0x139f25){_0x139f25=_0x139f25||0xc8;return function(_0x620ee9){if(_0x620ee9){return _0x711793[_0x47a5('0x17')](_0x139f25)[_0x47a5('0x19')](_0x620ee9);}};}function respondWithFilteredResult(_0x4e99a8,_0x362359){return function(_0x11faf5){if(_0x11faf5){var _0x3b001e=typeof _0x362359[_0x47a5('0x1a')]===_0x47a5('0x1b')&&typeof _0x362359['limit']==='undefined';var _0x138bc0=_0x11faf5['count'];var _0x5247fd=_0x3b001e?0x0:_0x362359[_0x47a5('0x1a')];var _0xaf70a6=_0x3b001e?_0x11faf5[_0x47a5('0x1c')]:_0x362359[_0x47a5('0x1a')]+_0x362359[_0x47a5('0x1d')];var _0x12b98e;if(_0xaf70a6>=_0x138bc0){_0xaf70a6=_0x138bc0;_0x12b98e=0xc8;}else{_0x12b98e=0xce;}_0x4e99a8[_0x47a5('0x17')](_0x12b98e);return _0x4e99a8[_0x47a5('0x1e')](_0x47a5('0x1f'),_0x5247fd+'-'+_0xaf70a6+'/'+_0x138bc0)['json'](_0x11faf5);}return null;};}function patchUpdates(_0x1570bc){return function(_0xf160ba){try{jsonpatch['apply'](_0xf160ba,_0x1570bc,!![]);}catch(_0x2b0360){return BPromise[_0x47a5('0x20')](_0x2b0360);}return _0xf160ba[_0x47a5('0x21')]();};}function saveUpdates(_0x4c5910,_0xb8ae6c){return function(_0x2f142b){if(_0x2f142b){return _0x2f142b[_0x47a5('0x22')](_0x4c5910)[_0x47a5('0x23')](function(_0x5ef1b1){return _0x5ef1b1;});}return null;};}function removeEntity(_0xe2dea9,_0x385687){return function(_0x513981){if(_0x513981){return _0x513981[_0x47a5('0x24')]()[_0x47a5('0x23')](function(){_0xe2dea9[_0x47a5('0x17')](0xcc)[_0x47a5('0x18')]();});}};}function handleEntityNotFound(_0x3abd6a,_0x50bf17){return function(_0x53078a){if(!_0x53078a){_0x3abd6a[_0x47a5('0x16')](0x194);}return _0x53078a;};}function handleError(_0x5686db,_0x1ea9c8){_0x1ea9c8=_0x1ea9c8||0x1f4;return function(_0x5b6c4e){logger[_0x47a5('0x25')](_0x5b6c4e[_0x47a5('0x26')]);if(_0x5b6c4e[_0x47a5('0x27')]){delete _0x5b6c4e[_0x47a5('0x27')];}_0x5686db[_0x47a5('0x17')](_0x1ea9c8)[_0x47a5('0x28')](_0x5b6c4e);};}exports[_0x47a5('0x29')]=function(_0x136b14,_0x16631f){var _0x361bfa={},_0x1127f8={},_0x11a4fa={'count':0x0,'rows':[]};var _0x3ad507=_['map'](db[_0x47a5('0x2a')]['rawAttributes'],function(_0x2ef875){return{'name':_0x2ef875[_0x47a5('0x2b')],'type':_0x2ef875[_0x47a5('0x2c')]['key']};});_0x1127f8[_0x47a5('0x2d')]=_[_0x47a5('0x2e')](_0x3ad507,_0x47a5('0x27'));_0x1127f8[_0x47a5('0x2f')]=_['keys'](_0x136b14['query']);_0x1127f8[_0x47a5('0x30')]=_[_0x47a5('0x31')](_0x1127f8['model'],_0x1127f8['query']);_0x361bfa[_0x47a5('0x32')]=_[_0x47a5('0x31')](_0x1127f8['model'],qs[_0x47a5('0x33')](_0x136b14['query'][_0x47a5('0x33')]));_0x361bfa[_0x47a5('0x32')]=_0x361bfa['attributes']['length']?_0x361bfa[_0x47a5('0x32')]:_0x1127f8['model'];if(!_0x136b14[_0x47a5('0x2f')][_0x47a5('0x34')](_0x47a5('0x35'))){_0x361bfa['limit']=qs[_0x47a5('0x1d')](_0x136b14['query']['limit']);_0x361bfa[_0x47a5('0x1a')]=qs['offset'](_0x136b14[_0x47a5('0x2f')]['offset']);}_0x361bfa[_0x47a5('0x36')]=qs[_0x47a5('0x37')](_0x136b14[_0x47a5('0x2f')][_0x47a5('0x37')]);_0x361bfa[_0x47a5('0x38')]=qs[_0x47a5('0x30')](_[_0x47a5('0x39')](_0x136b14[_0x47a5('0x2f')],_0x1127f8[_0x47a5('0x30')]),_0x3ad507);if(_0x136b14['query'][_0x47a5('0x3a')]){_0x361bfa[_0x47a5('0x38')]=_['merge'](_0x361bfa[_0x47a5('0x38')],{'$or':_[_0x47a5('0x2e')](_0x3ad507,function(_0x1d4348){if(_0x1d4348['type']!==_0x47a5('0x3b')){var _0x10f660={};_0x10f660[_0x1d4348['name']]={'$like':'%'+_0x136b14[_0x47a5('0x2f')][_0x47a5('0x3a')]+'%'};return _0x10f660;}})});}_0x361bfa=_['merge']({},_0x361bfa,_0x136b14['options']);var _0x5ebd8c={'where':_0x361bfa[_0x47a5('0x38')]};return db['ChatOfflineMessage'][_0x47a5('0x1c')](_0x5ebd8c)[_0x47a5('0x23')](function(_0x301a85){_0x11a4fa[_0x47a5('0x1c')]=_0x301a85;if(_0x136b14[_0x47a5('0x2f')][_0x47a5('0x3c')]){_0x361bfa[_0x47a5('0x3d')]=[{'all':!![]}];}return db[_0x47a5('0x2a')][_0x47a5('0x3e')](_0x361bfa);})[_0x47a5('0x23')](function(_0x280500){_0x11a4fa[_0x47a5('0x3f')]=_0x280500;return _0x11a4fa;})[_0x47a5('0x23')](respondWithFilteredResult(_0x16631f,_0x361bfa))['catch'](handleError(_0x16631f,null));};exports[_0x47a5('0x40')]=function(_0x1c36fa,_0x331474){var _0x23bd8d={'raw':!![],'where':{'id':_0x1c36fa[_0x47a5('0x41')]['id']}},_0x586f4f={};_0x586f4f['model']=_['keys'](db['ChatOfflineMessage']['rawAttributes']);_0x586f4f[_0x47a5('0x2f')]=_['keys'](_0x1c36fa[_0x47a5('0x2f')]);_0x586f4f[_0x47a5('0x30')]=_[_0x47a5('0x31')](_0x586f4f['model'],_0x586f4f[_0x47a5('0x2f')]);_0x23bd8d[_0x47a5('0x32')]=_['intersection'](_0x586f4f['model'],qs[_0x47a5('0x33')](_0x1c36fa['query'][_0x47a5('0x33')]));_0x23bd8d[_0x47a5('0x32')]=_0x23bd8d[_0x47a5('0x32')][_0x47a5('0x42')]?_0x23bd8d[_0x47a5('0x32')]:_0x586f4f[_0x47a5('0x2d')];if(_0x1c36fa[_0x47a5('0x2f')][_0x47a5('0x3c')]){_0x23bd8d[_0x47a5('0x3d')]=[{'all':!![]}];}_0x23bd8d=_[_0x47a5('0x43')]({},_0x23bd8d,_0x1c36fa[_0x47a5('0x44')]);return db[_0x47a5('0x2a')][_0x47a5('0x45')](_0x23bd8d)[_0x47a5('0x23')](handleEntityNotFound(_0x331474,null))[_0x47a5('0x23')](respondWithResult(_0x331474,null))[_0x47a5('0x46')](handleError(_0x331474,null));};exports['create']=function(_0x2d38de,_0x23bb04){return db['ChatOfflineMessage']['create'](_0x2d38de[_0x47a5('0x47')],{})['then'](respondWithResult(_0x23bb04,0xc9))[_0x47a5('0x46')](handleError(_0x23bb04,null));};exports[_0x47a5('0x22')]=function(_0x54c35f,_0x4f62d3){if(_0x54c35f[_0x47a5('0x47')]['id']){delete _0x54c35f['body']['id'];}return db[_0x47a5('0x2a')][_0x47a5('0x45')]({'where':{'id':_0x54c35f[_0x47a5('0x41')]['id']}})[_0x47a5('0x23')](handleEntityNotFound(_0x4f62d3,null))[_0x47a5('0x23')](saveUpdates(_0x54c35f[_0x47a5('0x47')],null))[_0x47a5('0x23')](respondWithResult(_0x4f62d3,null))['catch'](handleError(_0x4f62d3,null));};exports['destroy']=function(_0x2dd1db,_0x411230){return db[_0x47a5('0x48')][_0x47a5('0x3e')]({'where':{'ChatOfflineMessageId':_0x2dd1db[_0x47a5('0x41')]['id']},'raw':!![]})[_0x47a5('0x23')](function(_0x249de5){_0x249de5['forEach'](function(_0x45cca5){var _0x1c9a62=path[_0x47a5('0x49')](config['root'],_0x47a5('0x4a'),'files',_0x47a5('0x4b'),_0x47a5('0x4c'),_0x45cca5[_0x47a5('0x4d')]);var _0xf03bd5=fs['existsSync'](_0x1c9a62);if(_0xf03bd5)fs_extra[_0x47a5('0x4e')](_0x1c9a62);});})[_0x47a5('0x23')](function(){return db[_0x47a5('0x2a')][_0x47a5('0x45')]({'where':{'id':_0x2dd1db[_0x47a5('0x41')]['id']},'individualHooks':!![]});})[_0x47a5('0x23')](handleEntityNotFound(_0x411230,null))[_0x47a5('0x23')](removeEntity(_0x411230,null))['catch'](handleError(_0x411230,null));};exports[_0x47a5('0x4f')]=function(_0x43721b,_0x187d7e){return db[_0x47a5('0x2a')][_0x47a5('0x4f')]()[_0x47a5('0x23')](respondWithResult(_0x187d7e,null))['catch'](handleError(_0x187d7e,null));}; \ No newline at end of file +var _0x9957=['sendStatus','status','json','undefined','count','offset','limit','set','Content-Range','reject','save','then','destroy','error','name','send','index','fieldName','type','key','model','map','keys','filters','intersection','query','attributes','fields','length','hasOwnProperty','nolimit','sort','where','filter','merge','VIRTUAL','options','ChatOfflineMessage','findAll','rows','show','rawAttributes','includeAll','include','find','create','catch','body','params','Attachment','forEach','join','root','server','files','attachments','basename','existsSync','remove','describe','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','sox','to-csv','ejs','fs-extra','lodash','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/license/util','../../mysqldb'];(function(_0x5186d9,_0x238db6){var _0x4f0d11=function(_0x4f107f){while(--_0x4f107f){_0x5186d9['push'](_0x5186d9['shift']());}};_0x4f0d11(++_0x238db6);}(_0x9957,0x93));var _0x7995=function(_0x6c993a,_0x5ea3ab){_0x6c993a=_0x6c993a-0x0;var _0x27f547=_0x9957[_0x6c993a];return _0x27f547;};'use strict';var emlformat=require(_0x7995('0x0'));var rimraf=require(_0x7995('0x1'));var zipdir=require(_0x7995('0x2'));var jsonpatch=require(_0x7995('0x3'));var rp=require('request-promise');var moment=require(_0x7995('0x4'));var BPromise=require(_0x7995('0x5'));var Mustache=require(_0x7995('0x6'));var util=require(_0x7995('0x7'));var path=require('path');var sox=require(_0x7995('0x8'));var csv=require(_0x7995('0x9'));var ejs=require(_0x7995('0xa'));var fs=require('fs');var fs_extra=require(_0x7995('0xb'));var _=require(_0x7995('0xc'));var squel=require(_0x7995('0xd'));var crypto=require('crypto');var jsforce=require(_0x7995('0xe'));var deskjs=require(_0x7995('0xf'));var toCsv=require('to-csv');var querystring=require(_0x7995('0x10'));var Papa=require(_0x7995('0x11'));var Redis=require(_0x7995('0x12'));var authService=require(_0x7995('0x13'));var qs=require(_0x7995('0x14'));var as=require(_0x7995('0x15'));var hardwareService=require(_0x7995('0x16'));var logger=require('../../config/logger')(_0x7995('0x17'));var utils=require(_0x7995('0x18'));var config=require('../../config/environment');var licenseUtil=require(_0x7995('0x19'));var db=require(_0x7995('0x1a'))['db'];function respondWithStatusCode(_0x19a27e,_0x385f00){_0x385f00=_0x385f00||0xcc;return function(_0x281576){if(_0x281576){return _0x19a27e[_0x7995('0x1b')](_0x385f00);}return _0x19a27e[_0x7995('0x1c')](_0x385f00)['end']();};}function respondWithResult(_0x58f5ad,_0x2b4e94){_0x2b4e94=_0x2b4e94||0xc8;return function(_0x2233dd){if(_0x2233dd){return _0x58f5ad[_0x7995('0x1c')](_0x2b4e94)[_0x7995('0x1d')](_0x2233dd);}};}function respondWithFilteredResult(_0x3f1d3e,_0x1a5310){return function(_0x2202ce){if(_0x2202ce){var _0x41cbf0=typeof _0x1a5310['offset']===_0x7995('0x1e')&&typeof _0x1a5310['limit']===_0x7995('0x1e');var _0x37f297=_0x2202ce[_0x7995('0x1f')];var _0x291317=_0x41cbf0?0x0:_0x1a5310[_0x7995('0x20')];var _0x37a7d4=_0x41cbf0?_0x2202ce['count']:_0x1a5310['offset']+_0x1a5310[_0x7995('0x21')];var _0x5e6f90;if(_0x37a7d4>=_0x37f297){_0x37a7d4=_0x37f297;_0x5e6f90=0xc8;}else{_0x5e6f90=0xce;}_0x3f1d3e['status'](_0x5e6f90);return _0x3f1d3e[_0x7995('0x22')](_0x7995('0x23'),_0x291317+'-'+_0x37a7d4+'/'+_0x37f297)['json'](_0x2202ce);}return null;};}function patchUpdates(_0x3a9b54){return function(_0x51f276){try{jsonpatch['apply'](_0x51f276,_0x3a9b54,!![]);}catch(_0x3e4c54){return BPromise[_0x7995('0x24')](_0x3e4c54);}return _0x51f276[_0x7995('0x25')]();};}function saveUpdates(_0x1a8568,_0x460924){return function(_0x1c278a){if(_0x1c278a){return _0x1c278a['update'](_0x1a8568)[_0x7995('0x26')](function(_0x46ee4b){return _0x46ee4b;});}return null;};}function removeEntity(_0x204507,_0x285437){return function(_0x563799){if(_0x563799){return _0x563799[_0x7995('0x27')]()[_0x7995('0x26')](function(){_0x204507[_0x7995('0x1c')](0xcc)['end']();});}};}function handleEntityNotFound(_0x39df42,_0x34e70c){return function(_0x401dc3){if(!_0x401dc3){_0x39df42[_0x7995('0x1b')](0x194);}return _0x401dc3;};}function handleError(_0x3a3fcf,_0x2a307e){_0x2a307e=_0x2a307e||0x1f4;return function(_0x56691a){logger[_0x7995('0x28')](_0x56691a['stack']);if(_0x56691a[_0x7995('0x29')]){delete _0x56691a[_0x7995('0x29')];}_0x3a3fcf[_0x7995('0x1c')](_0x2a307e)[_0x7995('0x2a')](_0x56691a);};}exports[_0x7995('0x2b')]=function(_0x4b6f99,_0x9b2a15){var _0x514445={},_0x456a28={},_0x3250e0={'count':0x0,'rows':[]};var _0x4253e5=_['map'](db['ChatOfflineMessage']['rawAttributes'],function(_0x3573be){return{'name':_0x3573be[_0x7995('0x2c')],'type':_0x3573be[_0x7995('0x2d')][_0x7995('0x2e')]};});_0x456a28[_0x7995('0x2f')]=_[_0x7995('0x30')](_0x4253e5,'name');_0x456a28['query']=_[_0x7995('0x31')](_0x4b6f99['query']);_0x456a28[_0x7995('0x32')]=_[_0x7995('0x33')](_0x456a28[_0x7995('0x2f')],_0x456a28[_0x7995('0x34')]);_0x514445[_0x7995('0x35')]=_['intersection'](_0x456a28[_0x7995('0x2f')],qs[_0x7995('0x36')](_0x4b6f99['query']['fields']));_0x514445['attributes']=_0x514445[_0x7995('0x35')][_0x7995('0x37')]?_0x514445['attributes']:_0x456a28[_0x7995('0x2f')];if(!_0x4b6f99['query'][_0x7995('0x38')](_0x7995('0x39'))){_0x514445[_0x7995('0x21')]=qs['limit'](_0x4b6f99['query'][_0x7995('0x21')]);_0x514445['offset']=qs['offset'](_0x4b6f99[_0x7995('0x34')][_0x7995('0x20')]);}_0x514445['order']=qs[_0x7995('0x3a')](_0x4b6f99[_0x7995('0x34')][_0x7995('0x3a')]);_0x514445[_0x7995('0x3b')]=qs[_0x7995('0x32')](_['pick'](_0x4b6f99[_0x7995('0x34')],_0x456a28[_0x7995('0x32')]),_0x4253e5);if(_0x4b6f99[_0x7995('0x34')][_0x7995('0x3c')]){_0x514445['where']=_[_0x7995('0x3d')](_0x514445[_0x7995('0x3b')],{'$or':_[_0x7995('0x30')](_0x4253e5,function(_0xe5ea43){if(_0xe5ea43[_0x7995('0x2d')]!==_0x7995('0x3e')){var _0x5688a1={};_0x5688a1[_0xe5ea43[_0x7995('0x29')]]={'$like':'%'+_0x4b6f99[_0x7995('0x34')][_0x7995('0x3c')]+'%'};return _0x5688a1;}})});}_0x514445=_[_0x7995('0x3d')]({},_0x514445,_0x4b6f99[_0x7995('0x3f')]);var _0x298fc2={'where':_0x514445[_0x7995('0x3b')]};return db[_0x7995('0x40')][_0x7995('0x1f')](_0x298fc2)[_0x7995('0x26')](function(_0x6fe77b){_0x3250e0[_0x7995('0x1f')]=_0x6fe77b;if(_0x4b6f99[_0x7995('0x34')]['includeAll']){_0x514445['include']=[{'all':!![]}];}return db[_0x7995('0x40')][_0x7995('0x41')](_0x514445);})['then'](function(_0x4b0855){_0x3250e0[_0x7995('0x42')]=_0x4b0855;return _0x3250e0;})['then'](respondWithFilteredResult(_0x9b2a15,_0x514445))['catch'](handleError(_0x9b2a15,null));};exports[_0x7995('0x43')]=function(_0x36e28b,_0x35c8ff){var _0x576b96={'raw':!![],'where':{'id':_0x36e28b['params']['id']}},_0x46ac4f={};_0x46ac4f[_0x7995('0x2f')]=_['keys'](db['ChatOfflineMessage'][_0x7995('0x44')]);_0x46ac4f[_0x7995('0x34')]=_[_0x7995('0x31')](_0x36e28b[_0x7995('0x34')]);_0x46ac4f['filters']=_[_0x7995('0x33')](_0x46ac4f[_0x7995('0x2f')],_0x46ac4f[_0x7995('0x34')]);_0x576b96[_0x7995('0x35')]=_['intersection'](_0x46ac4f['model'],qs[_0x7995('0x36')](_0x36e28b['query'][_0x7995('0x36')]));_0x576b96['attributes']=_0x576b96[_0x7995('0x35')]['length']?_0x576b96[_0x7995('0x35')]:_0x46ac4f[_0x7995('0x2f')];if(_0x36e28b['query'][_0x7995('0x45')]){_0x576b96[_0x7995('0x46')]=[{'all':!![]}];}_0x576b96=_[_0x7995('0x3d')]({},_0x576b96,_0x36e28b[_0x7995('0x3f')]);return db['ChatOfflineMessage'][_0x7995('0x47')](_0x576b96)[_0x7995('0x26')](handleEntityNotFound(_0x35c8ff,null))[_0x7995('0x26')](respondWithResult(_0x35c8ff,null))['catch'](handleError(_0x35c8ff,null));};exports[_0x7995('0x48')]=function(_0x44f516,_0x511567){return db[_0x7995('0x40')][_0x7995('0x48')](_0x44f516['body'],{})[_0x7995('0x26')](respondWithResult(_0x511567,0xc9))[_0x7995('0x49')](handleError(_0x511567,null));};exports['update']=function(_0x3d1dbb,_0x5843ba){if(_0x3d1dbb[_0x7995('0x4a')]['id']){delete _0x3d1dbb[_0x7995('0x4a')]['id'];}return db[_0x7995('0x40')][_0x7995('0x47')]({'where':{'id':_0x3d1dbb[_0x7995('0x4b')]['id']}})[_0x7995('0x26')](handleEntityNotFound(_0x5843ba,null))[_0x7995('0x26')](saveUpdates(_0x3d1dbb['body'],null))[_0x7995('0x26')](respondWithResult(_0x5843ba,null))[_0x7995('0x49')](handleError(_0x5843ba,null));};exports[_0x7995('0x27')]=function(_0x4ffc8a,_0x19da63){return db[_0x7995('0x4c')][_0x7995('0x41')]({'where':{'ChatOfflineMessageId':_0x4ffc8a['params']['id']},'raw':!![]})['then'](function(_0x5a592e){_0x5a592e[_0x7995('0x4d')](function(_0x1fd1ca){var _0x4cf5db=path[_0x7995('0x4e')](config[_0x7995('0x4f')],_0x7995('0x50'),_0x7995('0x51'),_0x7995('0x52'),'offline-chat',_0x1fd1ca[_0x7995('0x53')]);var _0x4ab09f=fs[_0x7995('0x54')](_0x4cf5db);if(_0x4ab09f)fs_extra[_0x7995('0x55')](_0x4cf5db);});})[_0x7995('0x26')](function(){return db['ChatOfflineMessage']['find']({'where':{'id':_0x4ffc8a['params']['id']},'individualHooks':!![]});})['then'](handleEntityNotFound(_0x19da63,null))[_0x7995('0x26')](removeEntity(_0x19da63,null))[_0x7995('0x49')](handleError(_0x19da63,null));};exports[_0x7995('0x56')]=function(_0x150261,_0x1d957e){return db[_0x7995('0x40')][_0x7995('0x56')]()[_0x7995('0x26')](respondWithResult(_0x1d957e,null))[_0x7995('0x49')](handleError(_0x1d957e,null));}; \ No newline at end of file diff --git a/server/api/chatOfflineMessage/chatOfflineMessage.events.js b/server/api/chatOfflineMessage/chatOfflineMessage.events.js index 92220ce..4237ddd 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 _0xaf99=['ChatOfflineMessage','setMaxListeners','save','update','remove','emit','hook','exports','../../mysqldb'];(function(_0x2763f2,_0x416af8){var _0x3ef471=function(_0x288aa2){while(--_0x288aa2){_0x2763f2['push'](_0x2763f2['shift']());}};_0x3ef471(++_0x416af8);}(_0xaf99,0x13a));var _0x9af9=function(_0x301615,_0x1fde35){_0x301615=_0x301615-0x0;var _0x47514b=_0xaf99[_0x301615];return _0x47514b;};'use strict';var EventEmitter=require('events');var ChatOfflineMessage=require(_0x9af9('0x0'))['db'][_0x9af9('0x1')];var ChatOfflineMessageEvents=new EventEmitter();ChatOfflineMessageEvents[_0x9af9('0x2')](0x0);var events={'afterCreate':_0x9af9('0x3'),'afterUpdate':_0x9af9('0x4'),'afterDestroy':_0x9af9('0x5')};function emitEvent(_0x322bf2){return function(_0x4fa322,_0x231cf3,_0x33abc1){ChatOfflineMessageEvents['emit'](_0x322bf2+':'+_0x4fa322['id'],_0x4fa322);ChatOfflineMessageEvents[_0x9af9('0x6')](_0x322bf2,_0x4fa322);_0x33abc1(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];ChatOfflineMessage[_0x9af9('0x7')](e,emitEvent(event));}}module[_0x9af9('0x8')]=ChatOfflineMessageEvents; \ No newline at end of file +var _0x56c6=['ChatOfflineMessage','setMaxListeners','update','emit','exports'];(function(_0xee9ad0,_0x449b6c){var _0x127aad=function(_0x4610a9){while(--_0x4610a9){_0xee9ad0['push'](_0xee9ad0['shift']());}};_0x127aad(++_0x449b6c);}(_0x56c6,0x140));var _0x656c=function(_0x422905,_0x3bce3a){_0x422905=_0x422905-0x0;var _0x33dc6c=_0x56c6[_0x422905];return _0x33dc6c;};'use strict';var EventEmitter=require('events');var ChatOfflineMessage=require('../../mysqldb')['db'][_0x656c('0x0')];var ChatOfflineMessageEvents=new EventEmitter();ChatOfflineMessageEvents[_0x656c('0x1')](0x0);var events={'afterCreate':'save','afterUpdate':_0x656c('0x2'),'afterDestroy':'remove'};function emitEvent(_0x5d6e79){return function(_0x38548e,_0x3e377c,_0x5bae78){ChatOfflineMessageEvents[_0x656c('0x3')](_0x5d6e79+':'+_0x38548e['id'],_0x38548e);ChatOfflineMessageEvents[_0x656c('0x3')](_0x5d6e79,_0x38548e);_0x5bae78(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];ChatOfflineMessage['hook'](e,emitEvent(event));}}module[_0x656c('0x4')]=ChatOfflineMessageEvents; \ No newline at end of file diff --git a/server/api/chatOfflineMessage/chatOfflineMessage.model.js b/server/api/chatOfflineMessage/chatOfflineMessage.model.js index fa40f46..167de90 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 _0x79a3=['exports','ChatOfflineMessage','chat_offline_messages','utf8mb4','utf8mb4_unicode_ci','./chatOfflineMessage.attributes'];(function(_0x559293,_0xd7dce1){var _0x2506c3=function(_0x153eac){while(--_0x153eac){_0x559293['push'](_0x559293['shift']());}};_0x2506c3(++_0xd7dce1);}(_0x79a3,0x179));var _0x379a=function(_0x4dd268,_0x4484c3){_0x4dd268=_0x4dd268-0x0;var _0x5db527=_0x79a3[_0x4dd268];return _0x5db527;};'use strict';var attributes=require(_0x379a('0x0'));module[_0x379a('0x1')]=function(_0x4dc1e8){return _0x4dc1e8['define'](_0x379a('0x2'),attributes,{'tableName':_0x379a('0x3'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x379a('0x4'),'collate':_0x379a('0x5')});}; \ No newline at end of file +var _0xe2a0=['exports','define','ChatOfflineMessage','chat_offline_messages'];(function(_0x264888,_0x2c24e6){var _0x4b7b48=function(_0x2ccd24){while(--_0x2ccd24){_0x264888['push'](_0x264888['shift']());}};_0x4b7b48(++_0x2c24e6);}(_0xe2a0,0xdc));var _0x0e2a=function(_0x3f5af6,_0x58e357){_0x3f5af6=_0x3f5af6-0x0;var _0x74fcb7=_0xe2a0[_0x3f5af6];return _0x74fcb7;};'use strict';var attributes=require('./chatOfflineMessage.attributes');module[_0x0e2a('0x0')]=function(_0x126773){return _0x126773[_0x0e2a('0x1')](_0x0e2a('0x2'),attributes,{'tableName':_0x0e2a('0x3'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':'utf8mb4','collate':'utf8mb4_unicode_ci'});}; \ No newline at end of file diff --git a/server/api/chatOfflineMessage/chatOfflineMessage.rpc.js b/server/api/chatOfflineMessage/chatOfflineMessage.rpc.js index 18397dd..c420936 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 _0xae3c=['../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','http','request','then','info','ChatOfflineMessage,\x20%s,\x20%s','debug','ChatOfflineMessage,\x20%s,\x20%s,\x20%s','stringify','error','code','message','request\x20sent','catch','lodash','moment','randomstring','ioredis'];(function(_0x2641f9,_0x26715f){var _0x585741=function(_0x2d1462){while(--_0x2d1462){_0x2641f9['push'](_0x2641f9['shift']());}};_0x585741(++_0x26715f);}(_0xae3c,0x104));var _0xcae3=function(_0x1562a2,_0x2e4655){_0x1562a2=_0x1562a2-0x0;var _0x39a636=_0xae3c[_0x1562a2];return _0x39a636;};'use strict';var _=require(_0xcae3('0x0'));var util=require('util');var moment=require(_0xcae3('0x1'));var BPromise=require('bluebird');var rs=require(_0xcae3('0x2'));var fs=require('fs');var Redis=require(_0xcae3('0x3'));var db=require(_0xcae3('0x4'))['db'];var utils=require(_0xcae3('0x5'));var logger=require('../../config/logger')(_0xcae3('0x6'));var config=require(_0xcae3('0x7'));var jayson=require(_0xcae3('0x8'));var client=jayson['client'][_0xcae3('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x50ba90,_0x348197,_0x25fed8){return new BPromise(function(_0x2dad94,_0x451f66){return client[_0xcae3('0xa')](_0x50ba90,_0x25fed8)[_0xcae3('0xb')](function(_0x16892f){logger[_0xcae3('0xc')](_0xcae3('0xd'),_0x348197,'request\x20sent');logger[_0xcae3('0xe')](_0xcae3('0xf'),_0x348197,'request\x20sent',JSON[_0xcae3('0x10')](_0x16892f));if(_0x16892f[_0xcae3('0x11')]){if(_0x16892f['error'][_0xcae3('0x12')]===0x1f4){logger['error']('ChatOfflineMessage,\x20%s,\x20%s',_0x348197,_0x16892f['error']['message']);return _0x451f66(_0x16892f[_0xcae3('0x11')][_0xcae3('0x13')]);}logger[_0xcae3('0x11')](_0xcae3('0xd'),_0x348197,_0x16892f[_0xcae3('0x11')][_0xcae3('0x13')]);return _0x2dad94(_0x16892f[_0xcae3('0x11')][_0xcae3('0x13')]);}else{logger['info'](_0xcae3('0xd'),_0x348197,_0xcae3('0x14'));_0x2dad94(_0x16892f['result'][_0xcae3('0x13')]);}})[_0xcae3('0x15')](function(_0x2ee41d){logger[_0xcae3('0x11')](_0xcae3('0xd'),_0x348197,_0x2ee41d);_0x451f66(_0x2ee41d);});});} \ No newline at end of file +var _0xc4ea=['then','info','request\x20sent','debug','ChatOfflineMessage,\x20%s,\x20%s,\x20%s','stringify','error','code','ChatOfflineMessage,\x20%s,\x20%s','message','result','catch','util','moment','bluebird','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','request'];(function(_0x407abd,_0x235ea6){var _0x32fd94=function(_0x3d9c7d){while(--_0x3d9c7d){_0x407abd['push'](_0x407abd['shift']());}};_0x32fd94(++_0x235ea6);}(_0xc4ea,0x1ef));var _0xac4e=function(_0x343529,_0x1df32f){_0x343529=_0x343529-0x0;var _0x342ecf=_0xc4ea[_0x343529];return _0x342ecf;};'use strict';var _=require('lodash');var util=require(_0xac4e('0x0'));var moment=require(_0xac4e('0x1'));var BPromise=require(_0xac4e('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0xac4e('0x3'))['db'];var utils=require(_0xac4e('0x4'));var logger=require(_0xac4e('0x5'))(_0xac4e('0x6'));var config=require(_0xac4e('0x7'));var jayson=require('jayson/promise');var client=jayson[_0xac4e('0x8')][_0xac4e('0x9')]({'port':0x232a});function respondWithRpcPromise(_0xd2ada1,_0x2ee5d4,_0x287030){return new BPromise(function(_0x336798,_0x7f1340){return client[_0xac4e('0xa')](_0xd2ada1,_0x287030)[_0xac4e('0xb')](function(_0x191130){logger[_0xac4e('0xc')]('ChatOfflineMessage,\x20%s,\x20%s',_0x2ee5d4,_0xac4e('0xd'));logger[_0xac4e('0xe')](_0xac4e('0xf'),_0x2ee5d4,_0xac4e('0xd'),JSON[_0xac4e('0x10')](_0x191130));if(_0x191130[_0xac4e('0x11')]){if(_0x191130[_0xac4e('0x11')][_0xac4e('0x12')]===0x1f4){logger[_0xac4e('0x11')](_0xac4e('0x13'),_0x2ee5d4,_0x191130[_0xac4e('0x11')][_0xac4e('0x14')]);return _0x7f1340(_0x191130[_0xac4e('0x11')][_0xac4e('0x14')]);}logger['error'](_0xac4e('0x13'),_0x2ee5d4,_0x191130['error'][_0xac4e('0x14')]);return _0x336798(_0x191130[_0xac4e('0x11')]['message']);}else{logger[_0xac4e('0xc')](_0xac4e('0x13'),_0x2ee5d4,_0xac4e('0xd'));_0x336798(_0x191130[_0xac4e('0x15')]['message']);}})[_0xac4e('0x16')](function(_0x31becd){logger[_0xac4e('0x11')](_0xac4e('0x13'),_0x2ee5d4,_0x31becd);_0x7f1340(_0x31becd);});});} \ No newline at end of file diff --git a/server/api/chatOfflineMessage/index.js b/server/api/chatOfflineMessage/index.js index d8b09ea..fe1f211 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 _0xc38c=['connect-timeout','Router','../../components/interaction/service','../../config/environment','./chatOfflineMessage.controller','get','index','/describe','isAuthenticated','/:id','show','post','create','put','update','destroy','exports','multer','util','path'];(function(_0x356894,_0x48e229){var _0xe80b45=function(_0xbbe43c){while(--_0xbbe43c){_0x356894['push'](_0x356894['shift']());}};_0xe80b45(++_0x48e229);}(_0xc38c,0xb1));var _0xcc38=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xc38c[_0x3dd15e];return _0x231fd0;};'use strict';var multer=require(_0xcc38('0x0'));var util=require(_0xcc38('0x1'));var path=require(_0xcc38('0x2'));var timeout=require(_0xcc38('0x3'));var express=require('express');var router=express[_0xcc38('0x4')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0xcc38('0x5'));var config=require(_0xcc38('0x6'));var controller=require(_0xcc38('0x7'));router[_0xcc38('0x8')]('/',auth['isAuthenticated'](),controller[_0xcc38('0x9')]);router[_0xcc38('0x8')](_0xcc38('0xa'),auth[_0xcc38('0xb')](),controller['describe']);router[_0xcc38('0x8')](_0xcc38('0xc'),auth[_0xcc38('0xb')](),controller[_0xcc38('0xd')]);router[_0xcc38('0xe')]('/',auth[_0xcc38('0xb')](),controller[_0xcc38('0xf')]);router[_0xcc38('0x10')]('/:id',auth[_0xcc38('0xb')](),controller[_0xcc38('0x11')]);router['delete'](_0xcc38('0xc'),auth[_0xcc38('0xb')](),controller[_0xcc38('0x12')]);module[_0xcc38('0x13')]=router; \ No newline at end of file +var _0x81f5=['../../components/auth/service','../../components/interaction/service','../../config/environment','./chatOfflineMessage.controller','isAuthenticated','describe','get','/:id','create','put','update','delete','destroy','multer','util','path','connect-timeout','express','fs-extra'];(function(_0x34750b,_0x34aae5){var _0x244258=function(_0x503bf2){while(--_0x503bf2){_0x34750b['push'](_0x34750b['shift']());}};_0x244258(++_0x34aae5);}(_0x81f5,0xa5));var _0x581f=function(_0x491a7f,_0x28bb80){_0x491a7f=_0x491a7f-0x0;var _0x3d8f44=_0x81f5[_0x491a7f];return _0x3d8f44;};'use strict';var multer=require(_0x581f('0x0'));var util=require(_0x581f('0x1'));var path=require(_0x581f('0x2'));var timeout=require(_0x581f('0x3'));var express=require(_0x581f('0x4'));var router=express['Router']();var fs_extra=require(_0x581f('0x5'));var auth=require(_0x581f('0x6'));var interaction=require(_0x581f('0x7'));var config=require(_0x581f('0x8'));var controller=require(_0x581f('0x9'));router['get']('/',auth[_0x581f('0xa')](),controller['index']);router['get']('/describe',auth[_0x581f('0xa')](),controller[_0x581f('0xb')]);router[_0x581f('0xc')](_0x581f('0xd'),auth[_0x581f('0xa')](),controller['show']);router['post']('/',auth[_0x581f('0xa')](),controller[_0x581f('0xe')]);router[_0x581f('0xf')](_0x581f('0xd'),auth['isAuthenticated'](),controller[_0x581f('0x10')]);router[_0x581f('0x11')](_0x581f('0xd'),auth[_0x581f('0xa')](),controller[_0x581f('0x12')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/chatProactiveAction/chatProactiveAction.attributes.js b/server/api/chatProactiveAction/chatProactiveAction.attributes.js index 4a4ced8..d2014c2 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 _0x2220=['mouseOver','timeout','INTEGER','exports','STRING','ENUM'];(function(_0x596d6e,_0x4a048d){var _0x10d2c3=function(_0x2255ef){while(--_0x2255ef){_0x596d6e['push'](_0x596d6e['shift']());}};_0x10d2c3(++_0x4a048d);}(_0x2220,0x1a7));var _0x0222=function(_0x4b2863,_0x494899){_0x4b2863=_0x4b2863-0x0;var _0x567d67=_0x2220[_0x4b2863];return _0x567d67;};'use strict';var Sequelize=require('sequelize');module[_0x0222('0x0')]={'name':{'type':Sequelize[_0x0222('0x1')],'allowNull':![]},'type':{'type':Sequelize[_0x0222('0x2')](_0x0222('0x3'),_0x0222('0x4')),'defaultValue':_0x0222('0x3')},'selector':{'type':Sequelize[_0x0222('0x1')]},'timeout':{'type':Sequelize[_0x0222('0x5')]}}; \ No newline at end of file +var _0x95f3=['exports','STRING','mouseOver','timeout','INTEGER','sequelize'];(function(_0x3dc68d,_0x1c1951){var _0xdf7f94=function(_0x339428){while(--_0x339428){_0x3dc68d['push'](_0x3dc68d['shift']());}};_0xdf7f94(++_0x1c1951);}(_0x95f3,0xc5));var _0x395f=function(_0x296dd7,_0x3237ac){_0x296dd7=_0x296dd7-0x0;var _0x330720=_0x95f3[_0x296dd7];return _0x330720;};'use strict';var Sequelize=require(_0x395f('0x0'));module[_0x395f('0x1')]={'name':{'type':Sequelize[_0x395f('0x2')],'allowNull':![]},'type':{'type':Sequelize['ENUM'](_0x395f('0x3'),_0x395f('0x4')),'defaultValue':_0x395f('0x3')},'selector':{'type':Sequelize[_0x395f('0x2')]},'timeout':{'type':Sequelize[_0x395f('0x5')]}}; \ No newline at end of file diff --git a/server/api/chatProactiveAction/chatProactiveAction.controller.js b/server/api/chatProactiveAction/chatProactiveAction.controller.js index c96ea59..9d9cb54 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 _0x90b5=['undefined','count','set','apply','reject','then','error','stack','name','send','show','model','ChatProactiveAction','rawAttributes','query','keys','filters','attributes','intersection','fields','includeAll','include','catch','create','body','params','destroy','find','eml-format','zip-dir','fast-json-patch','request-promise','moment','util','path','to-csv','ejs','fs-extra','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset'];(function(_0x3ae164,_0x2e6692){var _0x9f36f5=function(_0x19016c){while(--_0x19016c){_0x3ae164['push'](_0x3ae164['shift']());}};_0x9f36f5(++_0x2e6692);}(_0x90b5,0x139));var _0x590b=function(_0x3366b0,_0x42688c){_0x3366b0=_0x3366b0-0x0;var _0x378ff7=_0x90b5[_0x3366b0];return _0x378ff7;};'use strict';var emlformat=require(_0x590b('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x590b('0x1'));var jsonpatch=require(_0x590b('0x2'));var rp=require(_0x590b('0x3'));var moment=require(_0x590b('0x4'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0x590b('0x5'));var path=require(_0x590b('0x6'));var sox=require('sox');var csv=require(_0x590b('0x7'));var ejs=require(_0x590b('0x8'));var fs=require('fs');var fs_extra=require(_0x590b('0x9'));var _=require('lodash');var squel=require(_0x590b('0xa'));var crypto=require(_0x590b('0xb'));var jsforce=require(_0x590b('0xc'));var deskjs=require(_0x590b('0xd'));var toCsv=require(_0x590b('0x7'));var querystring=require(_0x590b('0xe'));var Papa=require(_0x590b('0xf'));var Redis=require(_0x590b('0x10'));var authService=require(_0x590b('0x11'));var qs=require('../../components/parsers/qs');var as=require(_0x590b('0x12'));var hardwareService=require(_0x590b('0x13'));var logger=require('../../config/logger')(_0x590b('0x14'));var utils=require('../../config/utils');var config=require(_0x590b('0x15'));var licenseUtil=require(_0x590b('0x16'));var db=require(_0x590b('0x17'))['db'];function respondWithStatusCode(_0x477069,_0x527487){_0x527487=_0x527487||0xcc;return function(_0xb0ca22){if(_0xb0ca22){return _0x477069[_0x590b('0x18')](_0x527487);}return _0x477069[_0x590b('0x19')](_0x527487)[_0x590b('0x1a')]();};}function respondWithResult(_0x2e85b1,_0x6ad7e7){_0x6ad7e7=_0x6ad7e7||0xc8;return function(_0x45ac04){if(_0x45ac04){return _0x2e85b1[_0x590b('0x19')](_0x6ad7e7)[_0x590b('0x1b')](_0x45ac04);}};}function respondWithFilteredResult(_0x1fbc84,_0x3fc5ca){return function(_0x260f47){if(_0x260f47){var _0x3e4723=typeof _0x3fc5ca[_0x590b('0x1c')]===_0x590b('0x1d')&&typeof _0x3fc5ca['limit']===_0x590b('0x1d');var _0x530e24=_0x260f47[_0x590b('0x1e')];var _0x115309=_0x3e4723?0x0:_0x3fc5ca[_0x590b('0x1c')];var _0x53337c=_0x3e4723?_0x260f47['count']:_0x3fc5ca[_0x590b('0x1c')]+_0x3fc5ca['limit'];var _0x21e771;if(_0x53337c>=_0x530e24){_0x53337c=_0x530e24;_0x21e771=0xc8;}else{_0x21e771=0xce;}_0x1fbc84[_0x590b('0x19')](_0x21e771);return _0x1fbc84[_0x590b('0x1f')]('Content-Range',_0x115309+'-'+_0x53337c+'/'+_0x530e24)[_0x590b('0x1b')](_0x260f47);}return null;};}function patchUpdates(_0x8ab843){return function(_0x2b8ea0){try{jsonpatch[_0x590b('0x20')](_0x2b8ea0,_0x8ab843,!![]);}catch(_0x4990ba){return BPromise[_0x590b('0x21')](_0x4990ba);}return _0x2b8ea0['save']();};}function saveUpdates(_0x10a339,_0x30dc9f){return function(_0x5bdaba){if(_0x5bdaba){return _0x5bdaba['update'](_0x10a339)[_0x590b('0x22')](function(_0x2bcfca){return _0x2bcfca;});}return null;};}function removeEntity(_0x52bdad,_0x21638c){return function(_0x1045d5){if(_0x1045d5){return _0x1045d5['destroy']()['then'](function(){_0x52bdad[_0x590b('0x19')](0xcc)['end']();});}};}function handleEntityNotFound(_0x39fead,_0x520095){return function(_0x4d3ff9){if(!_0x4d3ff9){_0x39fead[_0x590b('0x18')](0x194);}return _0x4d3ff9;};}function handleError(_0x20571b,_0x5cf6b6){_0x5cf6b6=_0x5cf6b6||0x1f4;return function(_0x1febcd){logger[_0x590b('0x23')](_0x1febcd[_0x590b('0x24')]);if(_0x1febcd[_0x590b('0x25')]){delete _0x1febcd[_0x590b('0x25')];}_0x20571b['status'](_0x5cf6b6)[_0x590b('0x26')](_0x1febcd);};}exports[_0x590b('0x27')]=function(_0x333af8,_0x38a64a){var _0x1ee769={'raw':!![],'where':{'id':_0x333af8['params']['id']}},_0x3b881f={};_0x3b881f[_0x590b('0x28')]=_['keys'](db[_0x590b('0x29')][_0x590b('0x2a')]);_0x3b881f[_0x590b('0x2b')]=_[_0x590b('0x2c')](_0x333af8['query']);_0x3b881f[_0x590b('0x2d')]=_['intersection'](_0x3b881f[_0x590b('0x28')],_0x3b881f[_0x590b('0x2b')]);_0x1ee769[_0x590b('0x2e')]=_[_0x590b('0x2f')](_0x3b881f[_0x590b('0x28')],qs['fields'](_0x333af8[_0x590b('0x2b')][_0x590b('0x30')]));_0x1ee769[_0x590b('0x2e')]=_0x1ee769[_0x590b('0x2e')]['length']?_0x1ee769['attributes']:_0x3b881f[_0x590b('0x28')];if(_0x333af8[_0x590b('0x2b')][_0x590b('0x31')]){_0x1ee769[_0x590b('0x32')]=[{'all':!![]}];}_0x1ee769=_['merge']({},_0x1ee769,_0x333af8['options']);return db[_0x590b('0x29')]['find'](_0x1ee769)[_0x590b('0x22')](handleEntityNotFound(_0x38a64a,null))[_0x590b('0x22')](respondWithResult(_0x38a64a,null))[_0x590b('0x33')](handleError(_0x38a64a,null));};exports[_0x590b('0x34')]=function(_0x35dcaf,_0x294688){return db[_0x590b('0x29')][_0x590b('0x34')](_0x35dcaf[_0x590b('0x35')],{})[_0x590b('0x22')](respondWithResult(_0x294688,0xc9))['catch'](handleError(_0x294688,null));};exports['update']=function(_0x322940,_0x446db1){if(_0x322940[_0x590b('0x35')]['id']){delete _0x322940[_0x590b('0x35')]['id'];}return db[_0x590b('0x29')]['find']({'where':{'id':_0x322940[_0x590b('0x36')]['id']}})[_0x590b('0x22')](handleEntityNotFound(_0x446db1,null))[_0x590b('0x22')](saveUpdates(_0x322940[_0x590b('0x35')],null))[_0x590b('0x22')](respondWithResult(_0x446db1,null))['catch'](handleError(_0x446db1,null));};exports[_0x590b('0x37')]=function(_0x2fd86b,_0x4e3f84){return db['ChatProactiveAction'][_0x590b('0x38')]({'where':{'id':_0x2fd86b['params']['id']}})[_0x590b('0x22')](handleEntityNotFound(_0x4e3f84,null))[_0x590b('0x22')](removeEntity(_0x4e3f84,null))[_0x590b('0x33')](handleError(_0x4e3f84,null));}; \ No newline at end of file +var _0xc9b0=['zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','json','offset','limit','undefined','count','set','Content-Range','apply','reject','save','update','destroy','error','stack','send','show','model','keys','ChatProactiveAction','rawAttributes','query','filters','intersection','attributes','fields','length','includeAll','include','merge','options','find','then','catch','create','body','params','eml-format','rimraf'];(function(_0x593e47,_0x174bab){var _0x35d0f4=function(_0x1c6838){while(--_0x1c6838){_0x593e47['push'](_0x593e47['shift']());}};_0x35d0f4(++_0x174bab);}(_0xc9b0,0x143));var _0x0c9b=function(_0x57e477,_0x130900){_0x57e477=_0x57e477-0x0;var _0x3f4244=_0xc9b0[_0x57e477];return _0x3f4244;};'use strict';var emlformat=require(_0x0c9b('0x0'));var rimraf=require(_0x0c9b('0x1'));var zipdir=require(_0x0c9b('0x2'));var jsonpatch=require(_0x0c9b('0x3'));var rp=require(_0x0c9b('0x4'));var moment=require(_0x0c9b('0x5'));var BPromise=require(_0x0c9b('0x6'));var Mustache=require(_0x0c9b('0x7'));var util=require('util');var path=require('path');var sox=require(_0x0c9b('0x8'));var csv=require(_0x0c9b('0x9'));var ejs=require(_0x0c9b('0xa'));var fs=require('fs');var fs_extra=require(_0x0c9b('0xb'));var _=require(_0x0c9b('0xc'));var squel=require(_0x0c9b('0xd'));var crypto=require(_0x0c9b('0xe'));var jsforce=require(_0x0c9b('0xf'));var deskjs=require(_0x0c9b('0x10'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x0c9b('0x11'));var authService=require(_0x0c9b('0x12'));var qs=require(_0x0c9b('0x13'));var as=require(_0x0c9b('0x14'));var hardwareService=require(_0x0c9b('0x15'));var logger=require(_0x0c9b('0x16'))('api');var utils=require(_0x0c9b('0x17'));var config=require(_0x0c9b('0x18'));var licenseUtil=require('../../config/license/util');var db=require(_0x0c9b('0x19'))['db'];function respondWithStatusCode(_0x4acc77,_0x273644){_0x273644=_0x273644||0xcc;return function(_0xe55deb){if(_0xe55deb){return _0x4acc77[_0x0c9b('0x1a')](_0x273644);}return _0x4acc77[_0x0c9b('0x1b')](_0x273644)[_0x0c9b('0x1c')]();};}function respondWithResult(_0x2bc058,_0x291aeb){_0x291aeb=_0x291aeb||0xc8;return function(_0x41603d){if(_0x41603d){return _0x2bc058[_0x0c9b('0x1b')](_0x291aeb)[_0x0c9b('0x1d')](_0x41603d);}};}function respondWithFilteredResult(_0x4daf5e,_0x5967a6){return function(_0x518486){if(_0x518486){var _0x3ac356=typeof _0x5967a6[_0x0c9b('0x1e')]==='undefined'&&typeof _0x5967a6[_0x0c9b('0x1f')]===_0x0c9b('0x20');var _0x3279cd=_0x518486[_0x0c9b('0x21')];var _0x2b2f65=_0x3ac356?0x0:_0x5967a6[_0x0c9b('0x1e')];var _0x39218d=_0x3ac356?_0x518486['count']:_0x5967a6['offset']+_0x5967a6[_0x0c9b('0x1f')];var _0x49d499;if(_0x39218d>=_0x3279cd){_0x39218d=_0x3279cd;_0x49d499=0xc8;}else{_0x49d499=0xce;}_0x4daf5e[_0x0c9b('0x1b')](_0x49d499);return _0x4daf5e[_0x0c9b('0x22')](_0x0c9b('0x23'),_0x2b2f65+'-'+_0x39218d+'/'+_0x3279cd)[_0x0c9b('0x1d')](_0x518486);}return null;};}function patchUpdates(_0x1bf9f1){return function(_0x3d335c){try{jsonpatch[_0x0c9b('0x24')](_0x3d335c,_0x1bf9f1,!![]);}catch(_0x2269d4){return BPromise[_0x0c9b('0x25')](_0x2269d4);}return _0x3d335c[_0x0c9b('0x26')]();};}function saveUpdates(_0x4cc5cc,_0x19f6e2){return function(_0x3dfd64){if(_0x3dfd64){return _0x3dfd64[_0x0c9b('0x27')](_0x4cc5cc)['then'](function(_0x428a74){return _0x428a74;});}return null;};}function removeEntity(_0x37ee51,_0x2409c6){return function(_0x5c83c8){if(_0x5c83c8){return _0x5c83c8[_0x0c9b('0x28')]()['then'](function(){_0x37ee51[_0x0c9b('0x1b')](0xcc)[_0x0c9b('0x1c')]();});}};}function handleEntityNotFound(_0x2d1ce5,_0x1824d2){return function(_0xd0733f){if(!_0xd0733f){_0x2d1ce5[_0x0c9b('0x1a')](0x194);}return _0xd0733f;};}function handleError(_0x29e457,_0x21748a){_0x21748a=_0x21748a||0x1f4;return function(_0x476c59){logger[_0x0c9b('0x29')](_0x476c59[_0x0c9b('0x2a')]);if(_0x476c59['name']){delete _0x476c59['name'];}_0x29e457[_0x0c9b('0x1b')](_0x21748a)[_0x0c9b('0x2b')](_0x476c59);};}exports[_0x0c9b('0x2c')]=function(_0x2c9f63,_0x4ca17d){var _0x361d03={'raw':!![],'where':{'id':_0x2c9f63['params']['id']}},_0x1391d1={};_0x1391d1[_0x0c9b('0x2d')]=_[_0x0c9b('0x2e')](db[_0x0c9b('0x2f')][_0x0c9b('0x30')]);_0x1391d1[_0x0c9b('0x31')]=_[_0x0c9b('0x2e')](_0x2c9f63['query']);_0x1391d1[_0x0c9b('0x32')]=_[_0x0c9b('0x33')](_0x1391d1['model'],_0x1391d1[_0x0c9b('0x31')]);_0x361d03[_0x0c9b('0x34')]=_[_0x0c9b('0x33')](_0x1391d1[_0x0c9b('0x2d')],qs[_0x0c9b('0x35')](_0x2c9f63[_0x0c9b('0x31')][_0x0c9b('0x35')]));_0x361d03[_0x0c9b('0x34')]=_0x361d03[_0x0c9b('0x34')][_0x0c9b('0x36')]?_0x361d03[_0x0c9b('0x34')]:_0x1391d1['model'];if(_0x2c9f63['query'][_0x0c9b('0x37')]){_0x361d03[_0x0c9b('0x38')]=[{'all':!![]}];}_0x361d03=_[_0x0c9b('0x39')]({},_0x361d03,_0x2c9f63[_0x0c9b('0x3a')]);return db[_0x0c9b('0x2f')][_0x0c9b('0x3b')](_0x361d03)[_0x0c9b('0x3c')](handleEntityNotFound(_0x4ca17d,null))[_0x0c9b('0x3c')](respondWithResult(_0x4ca17d,null))[_0x0c9b('0x3d')](handleError(_0x4ca17d,null));};exports[_0x0c9b('0x3e')]=function(_0x535ab7,_0x1a4513){return db['ChatProactiveAction'][_0x0c9b('0x3e')](_0x535ab7[_0x0c9b('0x3f')],{})[_0x0c9b('0x3c')](respondWithResult(_0x1a4513,0xc9))[_0x0c9b('0x3d')](handleError(_0x1a4513,null));};exports[_0x0c9b('0x27')]=function(_0x5b300a,_0x430db5){if(_0x5b300a['body']['id']){delete _0x5b300a['body']['id'];}return db[_0x0c9b('0x2f')]['find']({'where':{'id':_0x5b300a[_0x0c9b('0x40')]['id']}})[_0x0c9b('0x3c')](handleEntityNotFound(_0x430db5,null))[_0x0c9b('0x3c')](saveUpdates(_0x5b300a[_0x0c9b('0x3f')],null))[_0x0c9b('0x3c')](respondWithResult(_0x430db5,null))[_0x0c9b('0x3d')](handleError(_0x430db5,null));};exports[_0x0c9b('0x28')]=function(_0xa12618,_0x26e3ef){return db[_0x0c9b('0x2f')][_0x0c9b('0x3b')]({'where':{'id':_0xa12618[_0x0c9b('0x40')]['id']}})['then'](handleEntityNotFound(_0x26e3ef,null))[_0x0c9b('0x3c')](removeEntity(_0x26e3ef,null))[_0x0c9b('0x3d')](handleError(_0x26e3ef,null));}; \ No newline at end of file diff --git a/server/api/chatProactiveAction/chatProactiveAction.model.js b/server/api/chatProactiveAction/chatProactiveAction.model.js index 5f3da73..78916e0 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 _0xa38c=['util','../../config/logger','path','rimraf','./chatProactiveAction.attributes','define','ChatProactiveAction','chat_proactive_actions'];(function(_0x5b9db8,_0x398711){var _0x34c35f=function(_0x3bd297){while(--_0x3bd297){_0x5b9db8['push'](_0x5b9db8['shift']());}};_0x34c35f(++_0x398711);}(_0xa38c,0x178));var _0xca38=function(_0x521da0,_0x4986a4){_0x521da0=_0x521da0-0x0;var _0x159674=_0xa38c[_0x521da0];return _0x159674;};'use strict';var _=require('lodash');var util=require(_0xca38('0x0'));var logger=require(_0xca38('0x1'))('api');var moment=require('moment');var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0xca38('0x2'));var rimraf=require(_0xca38('0x3'));var config=require('../../config/environment');var attributes=require(_0xca38('0x4'));module['exports']=function(_0xfa6388,_0x598179){return _0xfa6388[_0xca38('0x5')](_0xca38('0x6'),attributes,{'tableName':_0xca38('0x7'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x4cfb=['util','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./chatProactiveAction.attributes','exports','define'];(function(_0x497b1e,_0x586379){var _0x3f72e1=function(_0x4c227d){while(--_0x4c227d){_0x497b1e['push'](_0x497b1e['shift']());}};_0x3f72e1(++_0x586379);}(_0x4cfb,0x8f));var _0xb4cf=function(_0x432682,_0x253044){_0x432682=_0x432682-0x0;var _0x463d05=_0x4cfb[_0x432682];return _0x463d05;};'use strict';var _=require('lodash');var util=require(_0xb4cf('0x0'));var logger=require('../../config/logger')(_0xb4cf('0x1'));var moment=require(_0xb4cf('0x2'));var BPromise=require(_0xb4cf('0x3'));var rp=require(_0xb4cf('0x4'));var fs=require('fs');var path=require(_0xb4cf('0x5'));var rimraf=require(_0xb4cf('0x6'));var config=require(_0xb4cf('0x7'));var attributes=require(_0xb4cf('0x8'));module[_0xb4cf('0x9')]=function(_0x254dc8,_0x42abac){return _0x254dc8[_0xb4cf('0xa')]('ChatProactiveAction',attributes,{'tableName':'chat_proactive_actions','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/chatProactiveAction/chatProactiveAction.rpc.js b/server/api/chatProactiveAction/chatProactiveAction.rpc.js index 69552ba..fa46d2a 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 _0x9f1f=['ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','info','request\x20sent','debug','ChatProactiveAction,\x20%s,\x20%s,\x20%s','error','code','ChatProactiveAction,\x20%s,\x20%s','message','catch','lodash','util','moment','bluebird','randomstring'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x9f1f,0x10f));var _0xf9f1=function(_0x231e16,_0x67347b){_0x231e16=_0x231e16-0x0;var _0x570a7c=_0x9f1f[_0x231e16];return _0x570a7c;};'use strict';var _=require(_0xf9f1('0x0'));var util=require(_0xf9f1('0x1'));var moment=require(_0xf9f1('0x2'));var BPromise=require(_0xf9f1('0x3'));var rs=require(_0xf9f1('0x4'));var fs=require('fs');var Redis=require(_0xf9f1('0x5'));var db=require(_0xf9f1('0x6'))['db'];var utils=require('../../config/utils');var logger=require(_0xf9f1('0x7'))(_0xf9f1('0x8'));var config=require(_0xf9f1('0x9'));var jayson=require(_0xf9f1('0xa'));var client=jayson[_0xf9f1('0xb')][_0xf9f1('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x463dec,_0x21d791,_0x40ade2){return new BPromise(function(_0x1260f3,_0x134010){return client[_0xf9f1('0xd')](_0x463dec,_0x40ade2)['then'](function(_0x13cba5){logger[_0xf9f1('0xe')]('ChatProactiveAction,\x20%s,\x20%s',_0x21d791,_0xf9f1('0xf'));logger[_0xf9f1('0x10')](_0xf9f1('0x11'),_0x21d791,_0xf9f1('0xf'),JSON['stringify'](_0x13cba5));if(_0x13cba5['error']){if(_0x13cba5[_0xf9f1('0x12')][_0xf9f1('0x13')]===0x1f4){logger['error'](_0xf9f1('0x14'),_0x21d791,_0x13cba5[_0xf9f1('0x12')][_0xf9f1('0x15')]);return _0x134010(_0x13cba5['error'][_0xf9f1('0x15')]);}logger[_0xf9f1('0x12')]('ChatProactiveAction,\x20%s,\x20%s',_0x21d791,_0x13cba5[_0xf9f1('0x12')][_0xf9f1('0x15')]);return _0x1260f3(_0x13cba5[_0xf9f1('0x12')][_0xf9f1('0x15')]);}else{logger[_0xf9f1('0xe')](_0xf9f1('0x14'),_0x21d791,_0xf9f1('0xf'));_0x1260f3(_0x13cba5['result']['message']);}})[_0xf9f1('0x16')](function(_0x6d801b){logger['error'](_0xf9f1('0x14'),_0x21d791,_0x6d801b);_0x134010(_0x6d801b);});});} \ No newline at end of file +var _0xf79a=['ChatProactiveAction,\x20%s,\x20%s','message','info','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','request','then','request\x20sent','debug','stringify','error','code'];(function(_0x4939d0,_0x4f259e){var _0x2e1ad2=function(_0x397882){while(--_0x397882){_0x4939d0['push'](_0x4939d0['shift']());}};_0x2e1ad2(++_0x4f259e);}(_0xf79a,0x1e6));var _0xaf79=function(_0x5b7138,_0x492643){_0x5b7138=_0x5b7138-0x0;var _0x3f0ca5=_0xf79a[_0x5b7138];return _0x3f0ca5;};'use strict';var _=require(_0xaf79('0x0'));var util=require(_0xaf79('0x1'));var moment=require(_0xaf79('0x2'));var BPromise=require(_0xaf79('0x3'));var rs=require(_0xaf79('0x4'));var fs=require('fs');var Redis=require(_0xaf79('0x5'));var db=require(_0xaf79('0x6'))['db'];var utils=require(_0xaf79('0x7'));var logger=require(_0xaf79('0x8'))(_0xaf79('0x9'));var config=require('../../config/environment');var jayson=require(_0xaf79('0xa'));var client=jayson[_0xaf79('0xb')][_0xaf79('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x554077,_0x5c8c63,_0x24bfa2){return new BPromise(function(_0x46edf1,_0x1b875c){return client[_0xaf79('0xd')](_0x554077,_0x24bfa2)[_0xaf79('0xe')](function(_0x23b9e7){logger['info']('ChatProactiveAction,\x20%s,\x20%s',_0x5c8c63,_0xaf79('0xf'));logger[_0xaf79('0x10')]('ChatProactiveAction,\x20%s,\x20%s,\x20%s',_0x5c8c63,'request\x20sent',JSON[_0xaf79('0x11')](_0x23b9e7));if(_0x23b9e7[_0xaf79('0x12')]){if(_0x23b9e7[_0xaf79('0x12')][_0xaf79('0x13')]===0x1f4){logger[_0xaf79('0x12')](_0xaf79('0x14'),_0x5c8c63,_0x23b9e7[_0xaf79('0x12')][_0xaf79('0x15')]);return _0x1b875c(_0x23b9e7[_0xaf79('0x12')][_0xaf79('0x15')]);}logger[_0xaf79('0x12')](_0xaf79('0x14'),_0x5c8c63,_0x23b9e7[_0xaf79('0x12')][_0xaf79('0x15')]);return _0x46edf1(_0x23b9e7[_0xaf79('0x12')][_0xaf79('0x15')]);}else{logger[_0xaf79('0x16')](_0xaf79('0x14'),_0x5c8c63,'request\x20sent');_0x46edf1(_0x23b9e7['result']['message']);}})['catch'](function(_0x440e11){logger[_0xaf79('0x12')](_0xaf79('0x14'),_0x5c8c63,_0x440e11);_0x1b875c(_0x440e11);});});} \ No newline at end of file diff --git a/server/api/chatProactiveAction/index.js b/server/api/chatProactiveAction/index.js index d36aae1..9b72212 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 _0xeec6=['multer','util','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./chatProactiveAction.controller','/:id','isAuthenticated','post','create','put','update','delete','exports'];(function(_0x3f09a9,_0x2a1758){var _0x854a6d=function(_0x3eff89){while(--_0x3eff89){_0x3f09a9['push'](_0x3f09a9['shift']());}};_0x854a6d(++_0x2a1758);}(_0xeec6,0x1c2));var _0x6eec=function(_0x387603,_0x5a2d1){_0x387603=_0x387603-0x0;var _0x55ea9e=_0xeec6[_0x387603];return _0x55ea9e;};'use strict';var multer=require(_0x6eec('0x0'));var util=require(_0x6eec('0x1'));var path=require(_0x6eec('0x2'));var timeout=require(_0x6eec('0x3'));var express=require('express');var router=express[_0x6eec('0x4')]();var fs_extra=require(_0x6eec('0x5'));var auth=require(_0x6eec('0x6'));var interaction=require(_0x6eec('0x7'));var config=require(_0x6eec('0x8'));var controller=require(_0x6eec('0x9'));router['get'](_0x6eec('0xa'),auth[_0x6eec('0xb')](),controller['show']);router[_0x6eec('0xc')]('/',auth[_0x6eec('0xb')](),controller[_0x6eec('0xd')]);router[_0x6eec('0xe')]('/:id',auth[_0x6eec('0xb')](),controller[_0x6eec('0xf')]);router[_0x6eec('0x10')]('/:id',auth['isAuthenticated'](),controller['destroy']);module[_0x6eec('0x11')]=router; \ No newline at end of file +var _0xb4c7=['update','delete','destroy','exports','multer','util','path','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./chatProactiveAction.controller','/:id','isAuthenticated','show','create'];(function(_0x24f31b,_0x44b8f3){var _0x488401=function(_0x204caf){while(--_0x204caf){_0x24f31b['push'](_0x24f31b['shift']());}};_0x488401(++_0x44b8f3);}(_0xb4c7,0x1ea));var _0x7b4c=function(_0x3f6e54,_0x53da3a){_0x3f6e54=_0x3f6e54-0x0;var _0x48522d=_0xb4c7[_0x3f6e54];return _0x48522d;};'use strict';var multer=require(_0x7b4c('0x0'));var util=require(_0x7b4c('0x1'));var path=require(_0x7b4c('0x2'));var timeout=require(_0x7b4c('0x3'));var express=require(_0x7b4c('0x4'));var router=express['Router']();var fs_extra=require(_0x7b4c('0x5'));var auth=require(_0x7b4c('0x6'));var interaction=require(_0x7b4c('0x7'));var config=require(_0x7b4c('0x8'));var controller=require(_0x7b4c('0x9'));router['get'](_0x7b4c('0xa'),auth[_0x7b4c('0xb')](),controller[_0x7b4c('0xc')]);router['post']('/',auth[_0x7b4c('0xb')](),controller[_0x7b4c('0xd')]);router['put'](_0x7b4c('0xa'),auth[_0x7b4c('0xb')](),controller[_0x7b4c('0xe')]);router[_0x7b4c('0xf')](_0x7b4c('0xa'),auth[_0x7b4c('0xb')](),controller[_0x7b4c('0x10')]);module[_0x7b4c('0x11')]=router; \ No newline at end of file diff --git a/server/api/chatQueue/chatQueue.attributes.js b/server/api/chatQueue/chatQueue.attributes.js index f7333f0..e26a534 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 _0xfaf6=['roundrobin','sequelize','exports','STRING','name','ENUM','beepall'];(function(_0x3bf83f,_0x181cac){var _0x22c4a9=function(_0xb3ff0d){while(--_0xb3ff0d){_0x3bf83f['push'](_0x3bf83f['shift']());}};_0x22c4a9(++_0x181cac);}(_0xfaf6,0x13c));var _0x6faf=function(_0xffabed,_0x558f46){_0xffabed=_0xffabed-0x0;var _0x121681=_0xfaf6[_0xffabed];return _0x121681;};'use strict';var Sequelize=require(_0x6faf('0x0'));module[_0x6faf('0x1')]={'name':{'type':Sequelize[_0x6faf('0x2')],'unique':_0x6faf('0x3'),'allowNull':![],'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize[_0x6faf('0x2')]},'timeout':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize[_0x6faf('0x4')]('rrmemory',_0x6faf('0x5'),_0x6faf('0x6'))}}; \ No newline at end of file +var _0x1307=['STRING','INTEGER','ENUM','rrmemory','beepall','sequelize','exports'];(function(_0x49b207,_0x408ade){var _0x2dc8fa=function(_0x150975){while(--_0x150975){_0x49b207['push'](_0x49b207['shift']());}};_0x2dc8fa(++_0x408ade);}(_0x1307,0x1da));var _0x7130=function(_0x3e44fa,_0x75ed2a){_0x3e44fa=_0x3e44fa-0x0;var _0x2a0aba=_0x1307[_0x3e44fa];return _0x2a0aba;};'use strict';var Sequelize=require(_0x7130('0x0'));module[_0x7130('0x1')]={'name':{'type':Sequelize[_0x7130('0x2')],'unique':'name','allowNull':![],'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize[_0x7130('0x2')]},'timeout':{'type':Sequelize[_0x7130('0x3')],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize[_0x7130('0x4')](_0x7130('0x5'),_0x7130('0x6'),'roundrobin')}}; \ No newline at end of file diff --git a/server/api/chatQueue/chatQueue.controller.js b/server/api/chatQueue/chatQueue.controller.js index b6922c1..78e928d 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 _0x00d1=['error','stack','name','send','index','map','rawAttributes','fieldName','type','key','where','ChatQueue','include','query','catch','show','model','keys','filters','attributes','fields','length','merge','options','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','params','destroy','describe','getMembers','findOne','UserChatQueue','intersection','hasOwnProperty','nolimit','sort','pick','findAll','findAndCountAll','agent','updatedAt','createdAt','format','%s/%s','chatPause','getTeams','Team','order','filter','addTeams','ids','User','Agents','online','voicePause','interface','flatMap','sequelize','transaction','each','findOrCreate','emit','userChatQueue:save','removeTeams','select','field','tq.TeamId','from','team_has_chat_queues','join','user_has_teams','ut.TeamId\x20=\x20tq.TeamId','ChatQueueId\x20=\x20?','ut.UserId\x20=\x20?','push','toString','QueryTypes','every','TeamId','includes','all','union','compact','value','isEmpty','removeAgents','spread','isArray','userChatQueue:remove','getAgents','util','squel','ioredis','../../components/parsers/qs','../../config/logger','../../config/environment','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./chatQueue.socket','register','sendStatus','status','json','offset','undefined','count','limit','set','Content-Range','update','then','get','ChatQueues','UserProfileResource'];(function(_0x5b27da,_0x4a6532){var _0x3254f4=function(_0x4194c6){while(--_0x4194c6){_0x5b27da['push'](_0x5b27da['shift']());}};_0x3254f4(++_0x4a6532);}(_0x00d1,0x159));var _0x100d=function(_0x10d3c2,_0x1f5142){_0x10d3c2=_0x10d3c2-0x0;var _0x4208aa=_0x00d1[_0x10d3c2];return _0x4208aa;};'use strict';var BPromise=require('bluebird');var util=require(_0x100d('0x0'));var _=require('lodash');var squel=require(_0x100d('0x1'));var Redis=require(_0x100d('0x2'));var qs=require(_0x100d('0x3'));var logger=require(_0x100d('0x4'))('api');var config=require(_0x100d('0x5'));var db=require(_0x100d('0x6'))['db'];config[_0x100d('0x7')]=_[_0x100d('0x8')](config[_0x100d('0x7')],{'host':_0x100d('0x9'),'port':0x18eb});var socket=require(_0x100d('0xa'))(new Redis(config[_0x100d('0x7')]));require(_0x100d('0xb'))[_0x100d('0xc')](socket);function respondWithStatusCode(_0x57fa11,_0x53e1f0){_0x53e1f0=_0x53e1f0||0xcc;return function(_0x76f1cc){if(_0x76f1cc){return _0x57fa11[_0x100d('0xd')](_0x53e1f0);}return _0x57fa11[_0x100d('0xe')](_0x53e1f0)['end']();};}function respondWithResult(_0x514806,_0x18d6ff){_0x18d6ff=_0x18d6ff||0xc8;return function(_0x12fec7){if(_0x12fec7){return _0x514806[_0x100d('0xe')](_0x18d6ff)[_0x100d('0xf')](_0x12fec7);}};}function respondWithFilteredResult(_0xd615a6,_0x5347ad){return function(_0x1311b7){if(_0x1311b7){var _0x2ecafd=typeof _0x5347ad[_0x100d('0x10')]===_0x100d('0x11')&&typeof _0x5347ad['limit']==='undefined';var _0x173442=_0x1311b7[_0x100d('0x12')];var _0x330a20=_0x2ecafd?0x0:_0x5347ad['offset'];var _0x30d1bd=_0x2ecafd?_0x1311b7['count']:_0x5347ad[_0x100d('0x10')]+_0x5347ad[_0x100d('0x13')];var _0x2209a2;if(_0x30d1bd>=_0x173442){_0x30d1bd=_0x173442;_0x2209a2=0xc8;}else{_0x2209a2=0xce;}_0xd615a6[_0x100d('0xe')](_0x2209a2);return _0xd615a6[_0x100d('0x14')](_0x100d('0x15'),_0x330a20+'-'+_0x30d1bd+'/'+_0x173442)[_0x100d('0xf')](_0x1311b7);}return null;};}function saveUpdates(_0x285736){return function(_0x317cfb){if(_0x317cfb){return _0x317cfb[_0x100d('0x16')](_0x285736)[_0x100d('0x17')](function(_0x56c525){return _0x56c525;});}return null;};}function removeEntity(_0x8ac2b){return function(_0x5af288){if(_0x5af288){return _0x5af288['destroy']()[_0x100d('0x17')](function(){var _0x53e040=_0x5af288[_0x100d('0x18')]({'plain':!![]});var _0x4accf6=_0x100d('0x19');return db[_0x100d('0x1a')]['destroy']({'where':{'type':_0x4accf6,'resourceId':_0x53e040['id']}})[_0x100d('0x17')](function(){return _0x5af288;});})[_0x100d('0x17')](function(){_0x8ac2b['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x16190a){return function(_0x40a740){if(!_0x40a740){_0x16190a[_0x100d('0xd')](0x194);}return _0x40a740;};}function handleError(_0x13cdf4,_0x198e11){_0x198e11=_0x198e11||0x1f4;return function(_0x29b6ff){logger[_0x100d('0x1b')](_0x29b6ff[_0x100d('0x1c')]);if(_0x29b6ff[_0x100d('0x1d')]){delete _0x29b6ff[_0x100d('0x1d')];}_0x13cdf4['status'](_0x198e11)[_0x100d('0x1e')](_0x29b6ff);};}exports[_0x100d('0x1f')]=function(_0x42d30a,_0x421556){var _0x46c99a={};var _0x124a87={'count':0x0,'rows':[]};var _0x272d4a=_[_0x100d('0x20')](db['ChatQueue'][_0x100d('0x21')],function(_0x13f276){return{'name':_0x13f276[_0x100d('0x22')],'type':_0x13f276[_0x100d('0x23')][_0x100d('0x24')]};});_0x46c99a=qs['getOptions'](_0x272d4a,_0x42d30a);var _0x1420a5={'where':_0x46c99a[_0x100d('0x25')]};return db[_0x100d('0x26')][_0x100d('0x12')](_0x1420a5)['then'](function(_0x4e4fa0){_0x124a87[_0x100d('0x12')]=_0x4e4fa0;_0x46c99a['include']=qs[_0x100d('0x27')](_0x42d30a[_0x100d('0x28')]);return db[_0x100d('0x26')]['findAll'](_0x46c99a);})[_0x100d('0x17')](function(_0x2f5dda){_0x124a87['rows']=_0x2f5dda;return _0x124a87;})[_0x100d('0x17')](respondWithFilteredResult(_0x421556,_0x46c99a))[_0x100d('0x29')](handleError(_0x421556,null));};exports[_0x100d('0x2a')]=function(_0x351323,_0x12eebc){var _0x3beeba={'raw':!![],'where':{'id':_0x351323['params']['id']}},_0xbb9ffc={};_0xbb9ffc[_0x100d('0x2b')]=_[_0x100d('0x2c')](db['ChatQueue'][_0x100d('0x21')]);_0xbb9ffc[_0x100d('0x28')]=_[_0x100d('0x2c')](_0x351323[_0x100d('0x28')]);_0xbb9ffc[_0x100d('0x2d')]=_['intersection'](_0xbb9ffc[_0x100d('0x2b')],_0xbb9ffc[_0x100d('0x28')]);_0x3beeba[_0x100d('0x2e')]=_['intersection'](_0xbb9ffc['model'],qs[_0x100d('0x2f')](_0x351323[_0x100d('0x28')][_0x100d('0x2f')]));_0x3beeba[_0x100d('0x2e')]=_0x3beeba[_0x100d('0x2e')][_0x100d('0x30')]?_0x3beeba[_0x100d('0x2e')]:_0xbb9ffc['model'];if(_0x351323[_0x100d('0x28')]['includeAll']){_0x3beeba['include']=[{'all':!![]}];}_0x3beeba=_[_0x100d('0x31')]({},_0x3beeba,_0x351323[_0x100d('0x32')]);return db[_0x100d('0x26')][_0x100d('0x33')](_0x3beeba)[_0x100d('0x17')](handleEntityNotFound(_0x12eebc,null))[_0x100d('0x17')](respondWithResult(_0x12eebc,null))[_0x100d('0x29')](handleError(_0x12eebc,null));};exports[_0x100d('0x34')]=function(_0x49eeb0,_0x146ba0){return db[_0x100d('0x26')][_0x100d('0x34')](_0x49eeb0[_0x100d('0x35')],{})[_0x100d('0x17')](function(_0x55706e){var _0x252ef7=_0x49eeb0[_0x100d('0x36')][_0x100d('0x18')]({'plain':!![]});if(!_0x252ef7)throw new Error(_0x100d('0x37'));if(_0x252ef7[_0x100d('0x38')]===_0x100d('0x36')){var _0x1f58a7=_0x55706e[_0x100d('0x18')]({'plain':!![]});var _0x19020b=_0x100d('0x19');return db[_0x100d('0x39')][_0x100d('0x33')]({'where':{'name':_0x19020b,'userProfileId':_0x252ef7['userProfileId']},'raw':!![]})['then'](function(_0x48fdee){if(_0x48fdee&&_0x48fdee[_0x100d('0x3a')]===0x0){return db['UserProfileResource'][_0x100d('0x34')]({'name':_0x1f58a7['name'],'resourceId':_0x1f58a7['id'],'type':_0x48fdee['name'],'sectionId':_0x48fdee['id']},{})[_0x100d('0x17')](function(){return _0x55706e;});}else{return _0x55706e;}})['catch'](function(_0x45ec25){logger[_0x100d('0x1b')](_0x100d('0x3b'),_0x45ec25);throw _0x45ec25;});}return _0x55706e;})['then'](respondWithResult(_0x146ba0,0xc9))['catch'](handleError(_0x146ba0,null));};exports[_0x100d('0x16')]=function(_0x489b37,_0x7e9b4b){if(_0x489b37[_0x100d('0x35')]['id']){delete _0x489b37[_0x100d('0x35')]['id'];}return db[_0x100d('0x26')][_0x100d('0x33')]({'where':{'id':_0x489b37[_0x100d('0x3c')]['id']}})[_0x100d('0x17')](handleEntityNotFound(_0x7e9b4b,null))['then'](saveUpdates(_0x489b37[_0x100d('0x35')],null))[_0x100d('0x17')](respondWithResult(_0x7e9b4b,null))[_0x100d('0x29')](handleError(_0x7e9b4b,null));};exports[_0x100d('0x3d')]=function(_0x3af043,_0x20c97d){return db[_0x100d('0x26')][_0x100d('0x33')]({'where':{'id':_0x3af043[_0x100d('0x3c')]['id']}})[_0x100d('0x17')](handleEntityNotFound(_0x20c97d,null))[_0x100d('0x17')](removeEntity(_0x20c97d,null))[_0x100d('0x29')](handleError(_0x20c97d,null));};exports[_0x100d('0x3e')]=function(_0x29f829,_0x5b8864){return db[_0x100d('0x26')]['describe']()[_0x100d('0x17')](respondWithResult(_0x5b8864,null))[_0x100d('0x29')](handleError(_0x5b8864,null));};exports[_0x100d('0x3f')]=function(_0x1d4d0d,_0x1b7797){var _0x2d55fc={'raw':!![],'where':{}},_0x5e7145={},_0x4d8989;return db[_0x100d('0x26')][_0x100d('0x40')]({'where':{'id':_0x1d4d0d[_0x100d('0x3c')]['id']}})[_0x100d('0x17')](handleEntityNotFound(_0x1b7797,null))[_0x100d('0x17')](function(_0x57ac38){if(_0x57ac38){_0x4d8989=_0x57ac38[_0x100d('0x18')]({'plain':!![]});_0x5e7145[_0x100d('0x2b')]=_[_0x100d('0x2c')](db[_0x100d('0x41')]['rawAttributes']);_0x5e7145[_0x100d('0x28')]=_[_0x100d('0x2c')](_0x1d4d0d[_0x100d('0x28')]);_0x5e7145[_0x100d('0x2d')]=_['intersection'](_0x5e7145[_0x100d('0x2b')],_0x5e7145[_0x100d('0x28')]);_0x2d55fc[_0x100d('0x2e')]=_[_0x100d('0x42')](_0x5e7145['model'],qs[_0x100d('0x2f')](_0x1d4d0d['query'][_0x100d('0x2f')]));_0x2d55fc[_0x100d('0x2e')]=_0x2d55fc[_0x100d('0x2e')]['length']?_0x2d55fc[_0x100d('0x2e')]:_0x5e7145[_0x100d('0x2b')];if(!_0x1d4d0d[_0x100d('0x28')][_0x100d('0x43')](_0x100d('0x44'))){_0x2d55fc[_0x100d('0x13')]=qs['limit'](_0x1d4d0d[_0x100d('0x28')][_0x100d('0x13')]);_0x2d55fc[_0x100d('0x10')]=qs['offset'](_0x1d4d0d['query'][_0x100d('0x10')]);}_0x2d55fc['order']=qs['sort'](_0x1d4d0d['query'][_0x100d('0x45')]);_0x2d55fc[_0x100d('0x25')]=qs[_0x100d('0x2d')](_[_0x100d('0x46')](_0x1d4d0d[_0x100d('0x28')],_0x5e7145[_0x100d('0x2d')]));_0x2d55fc[_0x100d('0x25')]['ChatQueueId']=_0x57ac38['id'];if(_0x1d4d0d['query']['filter']){_0x2d55fc[_0x100d('0x25')]=_[_0x100d('0x31')](_0x2d55fc[_0x100d('0x25')],{'$or':_['map'](_0x2d55fc['attributes'],function(_0x5b4f83){var _0xbea6a={};_0xbea6a[_0x5b4f83]={'$like':'%'+_0x1d4d0d['query']['filter']+'%'};return _0xbea6a;})});}_0x2d55fc=_['merge']({},_0x2d55fc,_0x1d4d0d['options']);return db[_0x100d('0x41')][_0x100d('0x47')](_0x2d55fc);}})['then'](function(_0x219b51){if(_0x219b51){return db['User'][_0x100d('0x48')]({'where':{'id':_[_0x100d('0x20')](_0x219b51,'UserId'),'role':_0x100d('0x49')},'attributes':['id',_0x100d('0x1d'),'chatPause',_0x100d('0x4a'),_0x100d('0x4b')]});}})[_0x100d('0x17')](function(_0x7f0f42){if(_0x7f0f42){return{'count':_0x7f0f42[_0x100d('0x12')],'rows':_[_0x100d('0x20')](_0x7f0f42['rows'],function(_0x435c8c){return{'membername':_0x435c8c[_0x100d('0x1d')],'UserId':_0x435c8c['id'],'queue_name':_0x4d8989[_0x100d('0x1d')],'ChatQueueId':_0x4d8989['id'],'interface':util[_0x100d('0x4c')](_0x100d('0x4d'),'SIP',_0x435c8c[_0x100d('0x1d')]),'penalty':0x0,'paused':_0x435c8c[_0x100d('0x4e')],'createdAt':_0x435c8c[_0x100d('0x4b')],'updatedAt':_0x435c8c[_0x100d('0x4a')]};})};}else{return{'count':0x0,'rows':[]};}})[_0x100d('0x17')](respondWithFilteredResult(_0x1b7797,_0x2d55fc))[_0x100d('0x29')](handleError(_0x1b7797,null));};exports[_0x100d('0x4f')]=function(_0x41c09,_0x2f263c){var _0xca14c2={};var _0x5c9392={};var _0x46e15e;var _0x327516;return db[_0x100d('0x26')][_0x100d('0x40')]({'where':{'id':_0x41c09['params']['id']}})['then'](handleEntityNotFound(_0x2f263c,null))[_0x100d('0x17')](function(_0x24f4bf){if(_0x24f4bf){_0x46e15e=_0x24f4bf;_0x5c9392[_0x100d('0x2b')]=_[_0x100d('0x2c')](db[_0x100d('0x50')]['rawAttributes']);_0x5c9392[_0x100d('0x28')]=_[_0x100d('0x2c')](_0x41c09[_0x100d('0x28')]);_0x5c9392[_0x100d('0x2d')]=_[_0x100d('0x42')](_0x5c9392[_0x100d('0x2b')],_0x5c9392['query']);_0xca14c2[_0x100d('0x2e')]=_[_0x100d('0x42')](_0x5c9392['model'],qs[_0x100d('0x2f')](_0x41c09['query'][_0x100d('0x2f')]));_0xca14c2[_0x100d('0x2e')]=_0xca14c2[_0x100d('0x2e')][_0x100d('0x30')]?_0xca14c2['attributes']:_0x5c9392[_0x100d('0x2b')];_0xca14c2[_0x100d('0x51')]=qs['sort'](_0x41c09[_0x100d('0x28')][_0x100d('0x45')]);_0xca14c2[_0x100d('0x25')]=qs['filters'](_[_0x100d('0x46')](_0x41c09[_0x100d('0x28')],_0x5c9392['filters']));if(_0x41c09[_0x100d('0x28')]['filter']){_0xca14c2[_0x100d('0x25')]=_[_0x100d('0x31')](_0xca14c2['where'],{'$or':_[_0x100d('0x20')](_0xca14c2[_0x100d('0x2e')],function(_0x16c06e){var _0x4aa6fd={};_0x4aa6fd[_0x16c06e]={'$like':'%'+_0x41c09[_0x100d('0x28')][_0x100d('0x52')]+'%'};return _0x4aa6fd;})});}_0xca14c2=_[_0x100d('0x31')]({},_0xca14c2,_0x41c09['options']);return _0x46e15e[_0x100d('0x4f')](_0xca14c2);}})[_0x100d('0x17')](function(_0x1f32e5){if(_0x1f32e5){_0x327516=_0x1f32e5['length'];if(!_0x41c09[_0x100d('0x28')][_0x100d('0x43')](_0x100d('0x44'))){_0xca14c2[_0x100d('0x13')]=qs[_0x100d('0x13')](_0x41c09[_0x100d('0x28')][_0x100d('0x13')]);_0xca14c2[_0x100d('0x10')]=qs[_0x100d('0x10')](_0x41c09[_0x100d('0x28')]['offset']);}return _0x46e15e[_0x100d('0x4f')](_0xca14c2);}})['then'](function(_0x3ba4bb){if(_0x3ba4bb){return _0x3ba4bb?{'count':_0x327516,'rows':_0x3ba4bb}:null;}})[_0x100d('0x17')](respondWithResult(_0x2f263c,null))[_0x100d('0x29')](handleError(_0x2f263c,null));};exports[_0x100d('0x53')]=function(_0x1cb245,_0x4be416){var _0x532cb0=_0x1cb245[_0x100d('0x35')][_0x100d('0x54')];return db[_0x100d('0x50')][_0x100d('0x47')]({'where':{'id':_0x532cb0},'attributes':['id'],'include':[{'model':db[_0x100d('0x55')],'as':_0x100d('0x56'),'attributes':['id','name',_0x100d('0x57'),_0x100d('0x58'),_0x100d('0x59')],'raw':!![]}]})[_0x100d('0x17')](function(_0x1b9fc2){if(_0x1b9fc2){var _0x30cf4d=_[_0x100d('0x5a')](_0x1b9fc2,function(_0x184d9a){var _0x128188=_0x184d9a[_0x100d('0x18')]({'plain':!![]});return _0x128188[_0x100d('0x56')];});return db[_0x100d('0x26')]['find']({'where':{'id':_0x1cb245[_0x100d('0x3c')]['id']}})['then'](function(_0x3b6538){return db[_0x100d('0x5b')][_0x100d('0x5c')](function(_0x1cb89e){return _0x3b6538['addTeams'](_0x532cb0,{'transaction':_0x1cb89e})[_0x100d('0x17')](function(){return BPromise[_0x100d('0x5d')](_0x30cf4d,function(_0x497879){return db['UserChatQueue'][_0x100d('0x5e')]({'where':{'UserId':_0x497879['id'],'ChatQueueId':_0x1cb245[_0x100d('0x3c')]['id']},'transaction':_0x1cb89e});});})[_0x100d('0x17')](function(){_0x30cf4d['forEach'](function(_0xbbd082){socket[_0x100d('0x5f')](_0x100d('0x60'),{'UserId':_0xbbd082['id'],'ChatQueueId':_0x3b6538['id']});});});});});}})['then'](respondWithStatusCode(_0x4be416,null))['catch'](handleError(_0x4be416,null));};exports[_0x100d('0x61')]=function(_0x47e775,_0x422c32){return db[_0x100d('0x50')]['findAll']({'where':{'id':_0x47e775[_0x100d('0x28')]['ids']},'attributes':['id'],'include':[{'model':db['User'],'as':_0x100d('0x56'),'attributes':['id'],'raw':!![]}]})[_0x100d('0x17')](handleEntityNotFound(_0x422c32,null))[_0x100d('0x17')](function(_0x398737){var _0x305632=_[_0x100d('0x20')](_0x398737,'id');var _0x4e70de=[];var _0x32b6fb=[];var _0x17f5fa=squel[_0x100d('0x62')]();_0x17f5fa[_0x100d('0x63')](_0x100d('0x64'))[_0x100d('0x65')](_0x100d('0x66'),'tq')[_0x100d('0x67')](_0x100d('0x68'),'ut',_0x100d('0x69'))[_0x100d('0x25')](_0x100d('0x6a'),_0x47e775[_0x100d('0x3c')]['id']);for(var _0x346d61=0x0;_0x346d61<_0x398737[_0x100d('0x30')];_0x346d61+=0x1){let _0x1a2c73=_0x398737[_0x346d61];for(var _0x598b82=0x0;_0x598b82<_0x1a2c73[_0x100d('0x56')][_0x100d('0x30')];_0x598b82+=0x1){let _0x2ffbd8=_0x1a2c73[_0x100d('0x56')][_0x598b82];var _0x8514=_0x17f5fa['clone']();_0x8514[_0x100d('0x25')](_0x100d('0x6b'),_0x2ffbd8['id']);_0x32b6fb[_0x100d('0x6c')](db[_0x100d('0x5b')][_0x100d('0x28')](_0x8514[_0x100d('0x6d')](),{'type':db[_0x100d('0x5b')][_0x100d('0x6e')]['SELECT']})['then'](function(_0x5bb744){if(_0x5bb744['length']===0x1){return _0x2ffbd8['id'];}else{var _0xd25fde=_[_0x100d('0x6f')](_[_0x100d('0x20')](_0x5bb744,_0x100d('0x70')),function(_0x37f22b){return _[_0x100d('0x71')](_0x305632,_0x37f22b);});if(_0xd25fde){return _0x2ffbd8['id'];}}}));}}return BPromise[_0x100d('0x72')](_0x32b6fb)['then'](function(_0x2c20bd){_0x4e70de=_(_0x4e70de)[_0x100d('0x73')](_0x2c20bd)[_0x100d('0x74')]()[_0x100d('0x75')]();return db['ChatQueue'][_0x100d('0x33')]({'where':{'id':_0x47e775['params']['id']}})[_0x100d('0x17')](function(_0x41fed3){return db[_0x100d('0x5b')][_0x100d('0x5c')](function(_0x2a06a0){return _0x41fed3[_0x100d('0x61')](_0x47e775[_0x100d('0x28')][_0x100d('0x54')],{'transaction':_0x2a06a0})[_0x100d('0x17')](function(){if(!_[_0x100d('0x76')](_0x4e70de)){return _0x41fed3[_0x100d('0x77')](_0x4e70de,{'transaction':_0x2a06a0});}})[_0x100d('0x17')](function(){_0x4e70de['forEach'](function(_0x1f2170){socket['emit']('userChatQueue:remove',{'UserId':_0x1f2170,'ChatQueueId':_0x41fed3['id']});});});});});});})['then'](respondWithStatusCode(_0x422c32,null))[_0x100d('0x29')](handleError(_0x422c32,null));};exports['addAgents']=function(_0x58f4f6,_0x44489b){return db['ChatQueue'][_0x100d('0x33')]({'where':{'id':_0x58f4f6[_0x100d('0x3c')]['id']}})[_0x100d('0x17')](handleEntityNotFound(_0x44489b,null))['then'](function(_0x3dc6e5){if(_0x3dc6e5){return _0x3dc6e5['addAgents'](_0x58f4f6[_0x100d('0x35')][_0x100d('0x54')],_['omit'](_0x58f4f6[_0x100d('0x35')],[_0x100d('0x54'),'id'])||{})[_0x100d('0x78')](function(_0x23b5fd){for(var _0x406494=0x0;_0x406494<_0x58f4f6[_0x100d('0x35')]['ids']['length'];_0x406494+=0x1){socket[_0x100d('0x5f')](_0x100d('0x60'),{'UserId':Number(_0x58f4f6[_0x100d('0x35')][_0x100d('0x54')][_0x406494]),'ChatQueueId':Number(_0x58f4f6[_0x100d('0x3c')]['id'])});}return _0x23b5fd;});}})[_0x100d('0x17')](respondWithResult(_0x44489b,null))[_0x100d('0x29')](handleError(_0x44489b,null));};exports[_0x100d('0x77')]=function(_0x286890,_0x3e36d2){return db[_0x100d('0x26')][_0x100d('0x33')]({'where':{'id':_0x286890[_0x100d('0x3c')]['id']}})[_0x100d('0x17')](handleEntityNotFound(_0x3e36d2,null))[_0x100d('0x17')](function(_0xbd87ac){if(_0xbd87ac){return _0xbd87ac['removeAgents'](_0x286890['query'][_0x100d('0x54')])[_0x100d('0x17')](function(){if(_[_0x100d('0x79')](_0x286890['query'][_0x100d('0x54')])){for(var _0x4460c2=0x0;_0x4460c2<_0x286890[_0x100d('0x28')][_0x100d('0x54')]['length'];_0x4460c2+=0x1){socket[_0x100d('0x5f')]('userChatQueue:remove',{'UserId':Number(_0x286890[_0x100d('0x28')][_0x100d('0x54')][_0x4460c2]),'ChatQueueId':Number(_0x286890['params']['id'])});}}else{socket[_0x100d('0x5f')](_0x100d('0x7a'),{'UserId':Number(_0x286890[_0x100d('0x28')][_0x100d('0x54')]),'ChatQueueId':Number(_0x286890['params']['id'])});}});}})[_0x100d('0x17')](respondWithStatusCode(_0x3e36d2,null))[_0x100d('0x29')](handleError(_0x3e36d2,null));};exports['getAgents']=function(_0x1ecb7f,_0x10f477){var _0x497459={};var _0x2e2082={};var _0xfa9061;var _0x48b7ae;return db[_0x100d('0x26')][_0x100d('0x40')]({'where':{'id':_0x1ecb7f[_0x100d('0x3c')]['id']}})[_0x100d('0x17')](handleEntityNotFound(_0x10f477,null))[_0x100d('0x17')](function(_0x1e7ede){if(_0x1e7ede){_0xfa9061=_0x1e7ede;_0x2e2082[_0x100d('0x2b')]=_['keys'](db[_0x100d('0x55')][_0x100d('0x21')]);_0x2e2082[_0x100d('0x28')]=_[_0x100d('0x2c')](_0x1ecb7f[_0x100d('0x28')]);_0x2e2082['filters']=_[_0x100d('0x42')](_0x2e2082[_0x100d('0x2b')],_0x2e2082[_0x100d('0x28')]);_0x497459['attributes']=_['intersection'](_0x2e2082[_0x100d('0x2b')],qs['fields'](_0x1ecb7f[_0x100d('0x28')][_0x100d('0x2f')]));_0x497459['attributes']=_0x497459[_0x100d('0x2e')]['length']?_0x497459[_0x100d('0x2e')]:_0x2e2082[_0x100d('0x2b')];_0x497459[_0x100d('0x51')]=qs[_0x100d('0x45')](_0x1ecb7f[_0x100d('0x28')][_0x100d('0x45')]);_0x497459[_0x100d('0x25')]=qs['filters'](_[_0x100d('0x46')](_0x1ecb7f['query'],_0x2e2082[_0x100d('0x2d')]));if(_0x1ecb7f['query'][_0x100d('0x52')]){_0x497459[_0x100d('0x25')]=_[_0x100d('0x31')](_0x497459[_0x100d('0x25')],{'$or':_[_0x100d('0x20')](_0x497459['attributes'],function(_0x4590fc){var _0x56191b={};_0x56191b[_0x4590fc]={'$like':'%'+_0x1ecb7f['query']['filter']+'%'};return _0x56191b;})});}_0x497459=_[_0x100d('0x31')]({},_0x497459,_0x1ecb7f[_0x100d('0x32')]);return _0xfa9061['getAgents'](_0x497459);}})[_0x100d('0x17')](function(_0x430018){if(_0x430018){_0x48b7ae=_0x430018[_0x100d('0x30')];if(!_0x1ecb7f[_0x100d('0x28')][_0x100d('0x43')]('nolimit')){_0x497459[_0x100d('0x13')]=qs['limit'](_0x1ecb7f['query']['limit']);_0x497459[_0x100d('0x10')]=qs[_0x100d('0x10')](_0x1ecb7f[_0x100d('0x28')][_0x100d('0x10')]);}return _0xfa9061[_0x100d('0x7b')](_0x497459);}})[_0x100d('0x17')](function(_0x3106cd){if(_0x3106cd){return _0x3106cd?{'count':_0x48b7ae,'rows':_0x3106cd}:null;}})[_0x100d('0x17')](respondWithResult(_0x10f477,null))[_0x100d('0x29')](handleError(_0x10f477,null));}; \ No newline at end of file +var _0xdc87=['getTeams','Team','hasOwnProperty','nolimit','addTeams','ids','online','voicePause','interface','flatMap','Agents','sequelize','transaction','findOrCreate','forEach','emit','userChatQueue:save','removeTeams','select','field','tq.TeamId','from','user_has_teams','ut.TeamId\x20=\x20tq.TeamId','clone','ut.UserId\x20=\x20?','push','QueryTypes','every','TeamId','all','union','compact','value','isEmpty','addAgents','omit','spread','removeAgents','isArray','userChatQueue:remove','getAgents','findOne','options','util','lodash','ioredis','../../components/parsers/qs','../../config/environment','redis','defaults','socket.io-emitter','./chatQueue.socket','register','sendStatus','end','status','json','offset','undefined','count','limit','set','update','then','get','ChatQueues','error','stack','name','send','ChatQueue','rawAttributes','fieldName','type','key','getOptions','where','include','query','findAll','rows','catch','show','params','model','keys','filters','intersection','attributes','fields','length','merge','find','create','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','autoAssociation','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','destroy','describe','UserChatQueue','order','sort','pick','ChatQueueId','filter','map','User','findAndCountAll','agent','chatPause','updatedAt','createdAt','format','%s/%s','SIP'];(function(_0x20e9f6,_0x289e34){var _0x436892=function(_0x183951){while(--_0x183951){_0x20e9f6['push'](_0x20e9f6['shift']());}};_0x436892(++_0x289e34);}(_0xdc87,0x11e));var _0x7dc8=function(_0x6c993a,_0x5ea3ab){_0x6c993a=_0x6c993a-0x0;var _0x27f547=_0xdc87[_0x6c993a];return _0x27f547;};'use strict';var BPromise=require('bluebird');var util=require(_0x7dc8('0x0'));var _=require(_0x7dc8('0x1'));var squel=require('squel');var Redis=require(_0x7dc8('0x2'));var qs=require(_0x7dc8('0x3'));var logger=require('../../config/logger')('api');var config=require(_0x7dc8('0x4'));var db=require('../../mysqldb')['db'];config[_0x7dc8('0x5')]=_[_0x7dc8('0x6')](config[_0x7dc8('0x5')],{'host':'localhost','port':0x18eb});var socket=require(_0x7dc8('0x7'))(new Redis(config[_0x7dc8('0x5')]));require(_0x7dc8('0x8'))[_0x7dc8('0x9')](socket);function respondWithStatusCode(_0x514404,_0x3f5540){_0x3f5540=_0x3f5540||0xcc;return function(_0x56d9aa){if(_0x56d9aa){return _0x514404[_0x7dc8('0xa')](_0x3f5540);}return _0x514404['status'](_0x3f5540)[_0x7dc8('0xb')]();};}function respondWithResult(_0x2b3595,_0xbc38b){_0xbc38b=_0xbc38b||0xc8;return function(_0x3f1639){if(_0x3f1639){return _0x2b3595[_0x7dc8('0xc')](_0xbc38b)[_0x7dc8('0xd')](_0x3f1639);}};}function respondWithFilteredResult(_0x96446b,_0x238a12){return function(_0xa5d1a9){if(_0xa5d1a9){var _0x5f5dc7=typeof _0x238a12[_0x7dc8('0xe')]===_0x7dc8('0xf')&&typeof _0x238a12['limit']===_0x7dc8('0xf');var _0x3b5a8e=_0xa5d1a9[_0x7dc8('0x10')];var _0x3693c9=_0x5f5dc7?0x0:_0x238a12['offset'];var _0x36befa=_0x5f5dc7?_0xa5d1a9[_0x7dc8('0x10')]:_0x238a12[_0x7dc8('0xe')]+_0x238a12[_0x7dc8('0x11')];var _0x3f08b6;if(_0x36befa>=_0x3b5a8e){_0x36befa=_0x3b5a8e;_0x3f08b6=0xc8;}else{_0x3f08b6=0xce;}_0x96446b['status'](_0x3f08b6);return _0x96446b[_0x7dc8('0x12')]('Content-Range',_0x3693c9+'-'+_0x36befa+'/'+_0x3b5a8e)[_0x7dc8('0xd')](_0xa5d1a9);}return null;};}function saveUpdates(_0x213850){return function(_0x1c826d){if(_0x1c826d){return _0x1c826d[_0x7dc8('0x13')](_0x213850)[_0x7dc8('0x14')](function(_0x165b5d){return _0x165b5d;});}return null;};}function removeEntity(_0x231377){return function(_0x5e39b5){if(_0x5e39b5){return _0x5e39b5['destroy']()[_0x7dc8('0x14')](function(){var _0x582f31=_0x5e39b5[_0x7dc8('0x15')]({'plain':!![]});var _0x47ed71=_0x7dc8('0x16');return db['UserProfileResource']['destroy']({'where':{'type':_0x47ed71,'resourceId':_0x582f31['id']}})[_0x7dc8('0x14')](function(){return _0x5e39b5;});})[_0x7dc8('0x14')](function(){_0x231377['status'](0xcc)[_0x7dc8('0xb')]();});}};}function handleEntityNotFound(_0xe3538c){return function(_0x421f8b){if(!_0x421f8b){_0xe3538c['sendStatus'](0x194);}return _0x421f8b;};}function handleError(_0x3e453d,_0x314d9f){_0x314d9f=_0x314d9f||0x1f4;return function(_0x265568){logger[_0x7dc8('0x17')](_0x265568[_0x7dc8('0x18')]);if(_0x265568[_0x7dc8('0x19')]){delete _0x265568['name'];}_0x3e453d[_0x7dc8('0xc')](_0x314d9f)[_0x7dc8('0x1a')](_0x265568);};}exports['index']=function(_0x1ab35f,_0x360e96){var _0xa1c580={};var _0x4f2aa5={'count':0x0,'rows':[]};var _0x13a8c1=_['map'](db[_0x7dc8('0x1b')][_0x7dc8('0x1c')],function(_0x3b7847){return{'name':_0x3b7847[_0x7dc8('0x1d')],'type':_0x3b7847[_0x7dc8('0x1e')][_0x7dc8('0x1f')]};});_0xa1c580=qs[_0x7dc8('0x20')](_0x13a8c1,_0x1ab35f);var _0x459238={'where':_0xa1c580[_0x7dc8('0x21')]};return db[_0x7dc8('0x1b')]['count'](_0x459238)[_0x7dc8('0x14')](function(_0x509e80){_0x4f2aa5[_0x7dc8('0x10')]=_0x509e80;_0xa1c580[_0x7dc8('0x22')]=qs[_0x7dc8('0x22')](_0x1ab35f[_0x7dc8('0x23')]);return db[_0x7dc8('0x1b')][_0x7dc8('0x24')](_0xa1c580);})[_0x7dc8('0x14')](function(_0x3c5586){_0x4f2aa5[_0x7dc8('0x25')]=_0x3c5586;return _0x4f2aa5;})[_0x7dc8('0x14')](respondWithFilteredResult(_0x360e96,_0xa1c580))[_0x7dc8('0x26')](handleError(_0x360e96,null));};exports[_0x7dc8('0x27')]=function(_0x583da1,_0x1c8d3b){var _0x26eccf={'raw':!![],'where':{'id':_0x583da1[_0x7dc8('0x28')]['id']}},_0x39aa14={};_0x39aa14[_0x7dc8('0x29')]=_[_0x7dc8('0x2a')](db['ChatQueue']['rawAttributes']);_0x39aa14[_0x7dc8('0x23')]=_[_0x7dc8('0x2a')](_0x583da1['query']);_0x39aa14[_0x7dc8('0x2b')]=_[_0x7dc8('0x2c')](_0x39aa14[_0x7dc8('0x29')],_0x39aa14[_0x7dc8('0x23')]);_0x26eccf[_0x7dc8('0x2d')]=_['intersection'](_0x39aa14[_0x7dc8('0x29')],qs[_0x7dc8('0x2e')](_0x583da1['query']['fields']));_0x26eccf[_0x7dc8('0x2d')]=_0x26eccf[_0x7dc8('0x2d')][_0x7dc8('0x2f')]?_0x26eccf[_0x7dc8('0x2d')]:_0x39aa14[_0x7dc8('0x29')];if(_0x583da1[_0x7dc8('0x23')]['includeAll']){_0x26eccf[_0x7dc8('0x22')]=[{'all':!![]}];}_0x26eccf=_[_0x7dc8('0x30')]({},_0x26eccf,_0x583da1['options']);return db[_0x7dc8('0x1b')][_0x7dc8('0x31')](_0x26eccf)[_0x7dc8('0x14')](handleEntityNotFound(_0x1c8d3b,null))['then'](respondWithResult(_0x1c8d3b,null))['catch'](handleError(_0x1c8d3b,null));};exports['create']=function(_0x2241bc,_0x2181e5){return db[_0x7dc8('0x1b')][_0x7dc8('0x32')](_0x2241bc['body'],{})[_0x7dc8('0x14')](function(_0x2fc407){var _0x18762=_0x2241bc['user'][_0x7dc8('0x15')]({'plain':!![]});if(!_0x18762)throw new Error(_0x7dc8('0x33'));if(_0x18762[_0x7dc8('0x34')]==='user'){var _0x19aed2=_0x2fc407['get']({'plain':!![]});var _0x9f90d8='ChatQueues';return db[_0x7dc8('0x35')][_0x7dc8('0x31')]({'where':{'name':_0x9f90d8,'userProfileId':_0x18762[_0x7dc8('0x36')]},'raw':!![]})['then'](function(_0x46e5be){if(_0x46e5be&&_0x46e5be[_0x7dc8('0x37')]===0x0){return db[_0x7dc8('0x38')]['create']({'name':_0x19aed2[_0x7dc8('0x19')],'resourceId':_0x19aed2['id'],'type':_0x46e5be[_0x7dc8('0x19')],'sectionId':_0x46e5be['id']},{})['then'](function(){return _0x2fc407;});}else{return _0x2fc407;}})[_0x7dc8('0x26')](function(_0x103465){logger['error'](_0x7dc8('0x39'),_0x103465);throw _0x103465;});}return _0x2fc407;})[_0x7dc8('0x14')](respondWithResult(_0x2181e5,0xc9))[_0x7dc8('0x26')](handleError(_0x2181e5,null));};exports['update']=function(_0x4c2cff,_0x4b6674){if(_0x4c2cff[_0x7dc8('0x3a')]['id']){delete _0x4c2cff[_0x7dc8('0x3a')]['id'];}return db[_0x7dc8('0x1b')][_0x7dc8('0x31')]({'where':{'id':_0x4c2cff[_0x7dc8('0x28')]['id']}})[_0x7dc8('0x14')](handleEntityNotFound(_0x4b6674,null))[_0x7dc8('0x14')](saveUpdates(_0x4c2cff[_0x7dc8('0x3a')],null))[_0x7dc8('0x14')](respondWithResult(_0x4b6674,null))[_0x7dc8('0x26')](handleError(_0x4b6674,null));};exports[_0x7dc8('0x3b')]=function(_0x233d39,_0x30c895){return db[_0x7dc8('0x1b')]['find']({'where':{'id':_0x233d39[_0x7dc8('0x28')]['id']}})[_0x7dc8('0x14')](handleEntityNotFound(_0x30c895,null))[_0x7dc8('0x14')](removeEntity(_0x30c895,null))[_0x7dc8('0x26')](handleError(_0x30c895,null));};exports[_0x7dc8('0x3c')]=function(_0x521467,_0xaa09a6){return db[_0x7dc8('0x1b')][_0x7dc8('0x3c')]()[_0x7dc8('0x14')](respondWithResult(_0xaa09a6,null))['catch'](handleError(_0xaa09a6,null));};exports['getMembers']=function(_0x53bbda,_0x5893b9){var _0x4839df={'raw':!![],'where':{}},_0x11bedd={},_0x2b9e26;return db[_0x7dc8('0x1b')]['findOne']({'where':{'id':_0x53bbda['params']['id']}})[_0x7dc8('0x14')](handleEntityNotFound(_0x5893b9,null))[_0x7dc8('0x14')](function(_0x4ba011){if(_0x4ba011){_0x2b9e26=_0x4ba011[_0x7dc8('0x15')]({'plain':!![]});_0x11bedd[_0x7dc8('0x29')]=_[_0x7dc8('0x2a')](db[_0x7dc8('0x3d')][_0x7dc8('0x1c')]);_0x11bedd['query']=_[_0x7dc8('0x2a')](_0x53bbda[_0x7dc8('0x23')]);_0x11bedd[_0x7dc8('0x2b')]=_[_0x7dc8('0x2c')](_0x11bedd['model'],_0x11bedd[_0x7dc8('0x23')]);_0x4839df[_0x7dc8('0x2d')]=_[_0x7dc8('0x2c')](_0x11bedd[_0x7dc8('0x29')],qs[_0x7dc8('0x2e')](_0x53bbda[_0x7dc8('0x23')][_0x7dc8('0x2e')]));_0x4839df['attributes']=_0x4839df['attributes'][_0x7dc8('0x2f')]?_0x4839df[_0x7dc8('0x2d')]:_0x11bedd[_0x7dc8('0x29')];if(!_0x53bbda[_0x7dc8('0x23')]['hasOwnProperty']('nolimit')){_0x4839df[_0x7dc8('0x11')]=qs['limit'](_0x53bbda[_0x7dc8('0x23')][_0x7dc8('0x11')]);_0x4839df[_0x7dc8('0xe')]=qs[_0x7dc8('0xe')](_0x53bbda[_0x7dc8('0x23')]['offset']);}_0x4839df[_0x7dc8('0x3e')]=qs[_0x7dc8('0x3f')](_0x53bbda[_0x7dc8('0x23')][_0x7dc8('0x3f')]);_0x4839df[_0x7dc8('0x21')]=qs[_0x7dc8('0x2b')](_[_0x7dc8('0x40')](_0x53bbda[_0x7dc8('0x23')],_0x11bedd[_0x7dc8('0x2b')]));_0x4839df['where'][_0x7dc8('0x41')]=_0x4ba011['id'];if(_0x53bbda['query'][_0x7dc8('0x42')]){_0x4839df[_0x7dc8('0x21')]=_['merge'](_0x4839df['where'],{'$or':_[_0x7dc8('0x43')](_0x4839df[_0x7dc8('0x2d')],function(_0x166490){var _0x26d8b8={};_0x26d8b8[_0x166490]={'$like':'%'+_0x53bbda[_0x7dc8('0x23')][_0x7dc8('0x42')]+'%'};return _0x26d8b8;})});}_0x4839df=_['merge']({},_0x4839df,_0x53bbda['options']);return db[_0x7dc8('0x3d')][_0x7dc8('0x24')](_0x4839df);}})['then'](function(_0x28f066){if(_0x28f066){return db[_0x7dc8('0x44')][_0x7dc8('0x45')]({'where':{'id':_[_0x7dc8('0x43')](_0x28f066,'UserId'),'role':_0x7dc8('0x46')},'attributes':['id',_0x7dc8('0x19'),_0x7dc8('0x47'),_0x7dc8('0x48'),_0x7dc8('0x49')]});}})['then'](function(_0x10a11e){if(_0x10a11e){return{'count':_0x10a11e[_0x7dc8('0x10')],'rows':_[_0x7dc8('0x43')](_0x10a11e[_0x7dc8('0x25')],function(_0x5f3370){return{'membername':_0x5f3370[_0x7dc8('0x19')],'UserId':_0x5f3370['id'],'queue_name':_0x2b9e26['name'],'ChatQueueId':_0x2b9e26['id'],'interface':util[_0x7dc8('0x4a')](_0x7dc8('0x4b'),_0x7dc8('0x4c'),_0x5f3370['name']),'penalty':0x0,'paused':_0x5f3370[_0x7dc8('0x47')],'createdAt':_0x5f3370[_0x7dc8('0x49')],'updatedAt':_0x5f3370[_0x7dc8('0x48')]};})};}else{return{'count':0x0,'rows':[]};}})[_0x7dc8('0x14')](respondWithFilteredResult(_0x5893b9,_0x4839df))[_0x7dc8('0x26')](handleError(_0x5893b9,null));};exports[_0x7dc8('0x4d')]=function(_0x595209,_0x1a522b){var _0x330a9a={};var _0xdea2b4={};var _0xdd5e1c;var _0x3766ce;return db[_0x7dc8('0x1b')]['findOne']({'where':{'id':_0x595209[_0x7dc8('0x28')]['id']}})[_0x7dc8('0x14')](handleEntityNotFound(_0x1a522b,null))[_0x7dc8('0x14')](function(_0x371d74){if(_0x371d74){_0xdd5e1c=_0x371d74;_0xdea2b4[_0x7dc8('0x29')]=_[_0x7dc8('0x2a')](db[_0x7dc8('0x4e')]['rawAttributes']);_0xdea2b4['query']=_[_0x7dc8('0x2a')](_0x595209[_0x7dc8('0x23')]);_0xdea2b4[_0x7dc8('0x2b')]=_[_0x7dc8('0x2c')](_0xdea2b4[_0x7dc8('0x29')],_0xdea2b4[_0x7dc8('0x23')]);_0x330a9a[_0x7dc8('0x2d')]=_['intersection'](_0xdea2b4[_0x7dc8('0x29')],qs[_0x7dc8('0x2e')](_0x595209['query']['fields']));_0x330a9a[_0x7dc8('0x2d')]=_0x330a9a[_0x7dc8('0x2d')][_0x7dc8('0x2f')]?_0x330a9a[_0x7dc8('0x2d')]:_0xdea2b4[_0x7dc8('0x29')];_0x330a9a[_0x7dc8('0x3e')]=qs[_0x7dc8('0x3f')](_0x595209[_0x7dc8('0x23')][_0x7dc8('0x3f')]);_0x330a9a[_0x7dc8('0x21')]=qs['filters'](_[_0x7dc8('0x40')](_0x595209[_0x7dc8('0x23')],_0xdea2b4[_0x7dc8('0x2b')]));if(_0x595209[_0x7dc8('0x23')][_0x7dc8('0x42')]){_0x330a9a[_0x7dc8('0x21')]=_[_0x7dc8('0x30')](_0x330a9a[_0x7dc8('0x21')],{'$or':_[_0x7dc8('0x43')](_0x330a9a[_0x7dc8('0x2d')],function(_0x402a8a){var _0x59455f={};_0x59455f[_0x402a8a]={'$like':'%'+_0x595209['query']['filter']+'%'};return _0x59455f;})});}_0x330a9a=_[_0x7dc8('0x30')]({},_0x330a9a,_0x595209['options']);return _0xdd5e1c[_0x7dc8('0x4d')](_0x330a9a);}})['then'](function(_0x4825b6){if(_0x4825b6){_0x3766ce=_0x4825b6[_0x7dc8('0x2f')];if(!_0x595209[_0x7dc8('0x23')][_0x7dc8('0x4f')](_0x7dc8('0x50'))){_0x330a9a[_0x7dc8('0x11')]=qs['limit'](_0x595209[_0x7dc8('0x23')][_0x7dc8('0x11')]);_0x330a9a[_0x7dc8('0xe')]=qs[_0x7dc8('0xe')](_0x595209[_0x7dc8('0x23')][_0x7dc8('0xe')]);}return _0xdd5e1c['getTeams'](_0x330a9a);}})[_0x7dc8('0x14')](function(_0x4df750){if(_0x4df750){return _0x4df750?{'count':_0x3766ce,'rows':_0x4df750}:null;}})[_0x7dc8('0x14')](respondWithResult(_0x1a522b,null))[_0x7dc8('0x26')](handleError(_0x1a522b,null));};exports[_0x7dc8('0x51')]=function(_0x2057ee,_0xdfacd5){var _0x52e30f=_0x2057ee[_0x7dc8('0x3a')][_0x7dc8('0x52')];return db[_0x7dc8('0x4e')][_0x7dc8('0x24')]({'where':{'id':_0x52e30f},'attributes':['id'],'include':[{'model':db['User'],'as':'Agents','attributes':['id',_0x7dc8('0x19'),_0x7dc8('0x53'),_0x7dc8('0x54'),_0x7dc8('0x55')],'raw':!![]}]})[_0x7dc8('0x14')](function(_0x203dec){if(_0x203dec){var _0x4c9ae7=_[_0x7dc8('0x56')](_0x203dec,function(_0x3bffcd){var _0x50aef1=_0x3bffcd[_0x7dc8('0x15')]({'plain':!![]});return _0x50aef1[_0x7dc8('0x57')];});return db['ChatQueue'][_0x7dc8('0x31')]({'where':{'id':_0x2057ee[_0x7dc8('0x28')]['id']}})[_0x7dc8('0x14')](function(_0x336ea1){return db[_0x7dc8('0x58')][_0x7dc8('0x59')](function(_0x5a2ffe){return _0x336ea1['addTeams'](_0x52e30f,{'transaction':_0x5a2ffe})[_0x7dc8('0x14')](function(){return BPromise['each'](_0x4c9ae7,function(_0x46a17f){return db[_0x7dc8('0x3d')][_0x7dc8('0x5a')]({'where':{'UserId':_0x46a17f['id'],'ChatQueueId':_0x2057ee['params']['id']},'transaction':_0x5a2ffe});});})[_0x7dc8('0x14')](function(){_0x4c9ae7[_0x7dc8('0x5b')](function(_0x512eca){socket[_0x7dc8('0x5c')](_0x7dc8('0x5d'),{'UserId':_0x512eca['id'],'ChatQueueId':_0x336ea1['id']});});});});});}})[_0x7dc8('0x14')](respondWithStatusCode(_0xdfacd5,null))[_0x7dc8('0x26')](handleError(_0xdfacd5,null));};exports[_0x7dc8('0x5e')]=function(_0x434fa5,_0xaa660a){return db[_0x7dc8('0x4e')][_0x7dc8('0x24')]({'where':{'id':_0x434fa5[_0x7dc8('0x23')]['ids']},'attributes':['id'],'include':[{'model':db[_0x7dc8('0x44')],'as':_0x7dc8('0x57'),'attributes':['id'],'raw':!![]}]})['then'](handleEntityNotFound(_0xaa660a,null))[_0x7dc8('0x14')](function(_0x3550de){var _0x201229=_[_0x7dc8('0x43')](_0x3550de,'id');var _0x2dbe7c=[];var _0x575f74=[];var _0x213703=squel[_0x7dc8('0x5f')]();_0x213703[_0x7dc8('0x60')](_0x7dc8('0x61'))[_0x7dc8('0x62')]('team_has_chat_queues','tq')['join'](_0x7dc8('0x63'),'ut',_0x7dc8('0x64'))[_0x7dc8('0x21')]('ChatQueueId\x20=\x20?',_0x434fa5['params']['id']);for(var _0x4b596a=0x0;_0x4b596a<_0x3550de[_0x7dc8('0x2f')];_0x4b596a+=0x1){let _0xac82a5=_0x3550de[_0x4b596a];for(var _0x399fd2=0x0;_0x399fd2<_0xac82a5['Agents'][_0x7dc8('0x2f')];_0x399fd2+=0x1){let _0x28881=_0xac82a5[_0x7dc8('0x57')][_0x399fd2];var _0x20fc5a=_0x213703[_0x7dc8('0x65')]();_0x20fc5a[_0x7dc8('0x21')](_0x7dc8('0x66'),_0x28881['id']);_0x575f74[_0x7dc8('0x67')](db[_0x7dc8('0x58')][_0x7dc8('0x23')](_0x20fc5a['toString'](),{'type':db[_0x7dc8('0x58')][_0x7dc8('0x68')]['SELECT']})[_0x7dc8('0x14')](function(_0x1b28d8){if(_0x1b28d8[_0x7dc8('0x2f')]===0x1){return _0x28881['id'];}else{var _0x2b8542=_[_0x7dc8('0x69')](_[_0x7dc8('0x43')](_0x1b28d8,_0x7dc8('0x6a')),function(_0x42444f){return _['includes'](_0x201229,_0x42444f);});if(_0x2b8542){return _0x28881['id'];}}}));}}return BPromise[_0x7dc8('0x6b')](_0x575f74)[_0x7dc8('0x14')](function(_0x3bf546){_0x2dbe7c=_(_0x2dbe7c)[_0x7dc8('0x6c')](_0x3bf546)[_0x7dc8('0x6d')]()[_0x7dc8('0x6e')]();return db['ChatQueue']['find']({'where':{'id':_0x434fa5[_0x7dc8('0x28')]['id']}})['then'](function(_0x36e0a6){return db['sequelize'][_0x7dc8('0x59')](function(_0x49f6a5){return _0x36e0a6['removeTeams'](_0x434fa5[_0x7dc8('0x23')][_0x7dc8('0x52')],{'transaction':_0x49f6a5})[_0x7dc8('0x14')](function(){if(!_[_0x7dc8('0x6f')](_0x2dbe7c)){return _0x36e0a6['removeAgents'](_0x2dbe7c,{'transaction':_0x49f6a5});}})[_0x7dc8('0x14')](function(){_0x2dbe7c[_0x7dc8('0x5b')](function(_0xd37a7d){socket[_0x7dc8('0x5c')]('userChatQueue:remove',{'UserId':_0xd37a7d,'ChatQueueId':_0x36e0a6['id']});});});});});});})[_0x7dc8('0x14')](respondWithStatusCode(_0xaa660a,null))[_0x7dc8('0x26')](handleError(_0xaa660a,null));};exports['addAgents']=function(_0x3e910c,_0x4031d7){return db[_0x7dc8('0x1b')][_0x7dc8('0x31')]({'where':{'id':_0x3e910c[_0x7dc8('0x28')]['id']}})[_0x7dc8('0x14')](handleEntityNotFound(_0x4031d7,null))[_0x7dc8('0x14')](function(_0x379ec1){if(_0x379ec1){return _0x379ec1[_0x7dc8('0x70')](_0x3e910c[_0x7dc8('0x3a')]['ids'],_[_0x7dc8('0x71')](_0x3e910c[_0x7dc8('0x3a')],['ids','id'])||{})[_0x7dc8('0x72')](function(_0x6ecf37){for(var _0x538ab8=0x0;_0x538ab8<_0x3e910c[_0x7dc8('0x3a')][_0x7dc8('0x52')]['length'];_0x538ab8+=0x1){socket[_0x7dc8('0x5c')](_0x7dc8('0x5d'),{'UserId':Number(_0x3e910c[_0x7dc8('0x3a')][_0x7dc8('0x52')][_0x538ab8]),'ChatQueueId':Number(_0x3e910c['params']['id'])});}return _0x6ecf37;});}})[_0x7dc8('0x14')](respondWithResult(_0x4031d7,null))[_0x7dc8('0x26')](handleError(_0x4031d7,null));};exports[_0x7dc8('0x73')]=function(_0x5800ee,_0x2e8dbb){return db[_0x7dc8('0x1b')][_0x7dc8('0x31')]({'where':{'id':_0x5800ee['params']['id']}})[_0x7dc8('0x14')](handleEntityNotFound(_0x2e8dbb,null))[_0x7dc8('0x14')](function(_0x46bfac){if(_0x46bfac){return _0x46bfac[_0x7dc8('0x73')](_0x5800ee[_0x7dc8('0x23')][_0x7dc8('0x52')])[_0x7dc8('0x14')](function(){if(_[_0x7dc8('0x74')](_0x5800ee['query'][_0x7dc8('0x52')])){for(var _0x227374=0x0;_0x227374<_0x5800ee[_0x7dc8('0x23')][_0x7dc8('0x52')][_0x7dc8('0x2f')];_0x227374+=0x1){socket[_0x7dc8('0x5c')](_0x7dc8('0x75'),{'UserId':Number(_0x5800ee[_0x7dc8('0x23')]['ids'][_0x227374]),'ChatQueueId':Number(_0x5800ee[_0x7dc8('0x28')]['id'])});}}else{socket[_0x7dc8('0x5c')](_0x7dc8('0x75'),{'UserId':Number(_0x5800ee[_0x7dc8('0x23')][_0x7dc8('0x52')]),'ChatQueueId':Number(_0x5800ee['params']['id'])});}});}})[_0x7dc8('0x14')](respondWithStatusCode(_0x2e8dbb,null))[_0x7dc8('0x26')](handleError(_0x2e8dbb,null));};exports[_0x7dc8('0x76')]=function(_0xb011ea,_0x29b7c6){var _0x4fdc3e={};var _0xd66a4d={};var _0x1b3e09;var _0x5fbce4;return db[_0x7dc8('0x1b')][_0x7dc8('0x77')]({'where':{'id':_0xb011ea['params']['id']}})[_0x7dc8('0x14')](handleEntityNotFound(_0x29b7c6,null))['then'](function(_0x5afcd9){if(_0x5afcd9){_0x1b3e09=_0x5afcd9;_0xd66a4d[_0x7dc8('0x29')]=_[_0x7dc8('0x2a')](db[_0x7dc8('0x44')]['rawAttributes']);_0xd66a4d[_0x7dc8('0x23')]=_['keys'](_0xb011ea[_0x7dc8('0x23')]);_0xd66a4d[_0x7dc8('0x2b')]=_[_0x7dc8('0x2c')](_0xd66a4d[_0x7dc8('0x29')],_0xd66a4d[_0x7dc8('0x23')]);_0x4fdc3e['attributes']=_[_0x7dc8('0x2c')](_0xd66a4d[_0x7dc8('0x29')],qs['fields'](_0xb011ea['query'][_0x7dc8('0x2e')]));_0x4fdc3e[_0x7dc8('0x2d')]=_0x4fdc3e[_0x7dc8('0x2d')][_0x7dc8('0x2f')]?_0x4fdc3e[_0x7dc8('0x2d')]:_0xd66a4d[_0x7dc8('0x29')];_0x4fdc3e[_0x7dc8('0x3e')]=qs[_0x7dc8('0x3f')](_0xb011ea[_0x7dc8('0x23')][_0x7dc8('0x3f')]);_0x4fdc3e[_0x7dc8('0x21')]=qs['filters'](_[_0x7dc8('0x40')](_0xb011ea[_0x7dc8('0x23')],_0xd66a4d[_0x7dc8('0x2b')]));if(_0xb011ea[_0x7dc8('0x23')]['filter']){_0x4fdc3e[_0x7dc8('0x21')]=_[_0x7dc8('0x30')](_0x4fdc3e[_0x7dc8('0x21')],{'$or':_[_0x7dc8('0x43')](_0x4fdc3e[_0x7dc8('0x2d')],function(_0x433dda){var _0x253567={};_0x253567[_0x433dda]={'$like':'%'+_0xb011ea['query'][_0x7dc8('0x42')]+'%'};return _0x253567;})});}_0x4fdc3e=_[_0x7dc8('0x30')]({},_0x4fdc3e,_0xb011ea[_0x7dc8('0x78')]);return _0x1b3e09[_0x7dc8('0x76')](_0x4fdc3e);}})[_0x7dc8('0x14')](function(_0x58d15f){if(_0x58d15f){_0x5fbce4=_0x58d15f[_0x7dc8('0x2f')];if(!_0xb011ea[_0x7dc8('0x23')][_0x7dc8('0x4f')]('nolimit')){_0x4fdc3e[_0x7dc8('0x11')]=qs['limit'](_0xb011ea[_0x7dc8('0x23')][_0x7dc8('0x11')]);_0x4fdc3e['offset']=qs[_0x7dc8('0xe')](_0xb011ea[_0x7dc8('0x23')][_0x7dc8('0xe')]);}return _0x1b3e09['getAgents'](_0x4fdc3e);}})[_0x7dc8('0x14')](function(_0x27de8d){if(_0x27de8d){return _0x27de8d?{'count':_0x5fbce4,'rows':_0x27de8d}:null;}})[_0x7dc8('0x14')](respondWithResult(_0x29b7c6,null))['catch'](handleError(_0x29b7c6,null));}; \ No newline at end of file diff --git a/server/api/chatQueue/chatQueue.events.js b/server/api/chatQueue/chatQueue.events.js index a933d86..d717a7d 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 _0x1c7d=['hasOwnProperty','hook','exports','events','../../mysqldb','ChatQueue','setMaxListeners','save','update','remove','emit'];(function(_0x3e7a7c,_0xdb5829){var _0x12a920=function(_0x58d313){while(--_0x58d313){_0x3e7a7c['push'](_0x3e7a7c['shift']());}};_0x12a920(++_0xdb5829);}(_0x1c7d,0x19a));var _0xd1c7=function(_0x16ace0,_0x5a64c8){_0x16ace0=_0x16ace0-0x0;var _0x2748d8=_0x1c7d[_0x16ace0];return _0x2748d8;};'use strict';var EventEmitter=require(_0xd1c7('0x0'));var ChatQueue=require(_0xd1c7('0x1'))['db'][_0xd1c7('0x2')];var ChatQueueEvents=new EventEmitter();ChatQueueEvents[_0xd1c7('0x3')](0x0);var events={'afterCreate':_0xd1c7('0x4'),'afterUpdate':_0xd1c7('0x5'),'afterDestroy':_0xd1c7('0x6')};function emitEvent(_0x54e009){return function(_0x3c7750,_0x1aa460,_0x555693){ChatQueueEvents[_0xd1c7('0x7')](_0x54e009+':'+_0x3c7750['id'],_0x3c7750);ChatQueueEvents[_0xd1c7('0x7')](_0x54e009,_0x3c7750);_0x555693(null);};}for(var e in events){if(events[_0xd1c7('0x8')](e)){var event=events[e];ChatQueue[_0xd1c7('0x9')](e,emitEvent(event));}}module[_0xd1c7('0xa')]=ChatQueueEvents; \ No newline at end of file +var _0x7f70=['remove','emit','hasOwnProperty','hook','exports','events','../../mysqldb','ChatQueue','save','update'];(function(_0xb4d783,_0x53cc7e){var _0x14adba=function(_0x1718f2){while(--_0x1718f2){_0xb4d783['push'](_0xb4d783['shift']());}};_0x14adba(++_0x53cc7e);}(_0x7f70,0x11d));var _0x07f7=function(_0x47e8fd,_0x148b93){_0x47e8fd=_0x47e8fd-0x0;var _0x14970b=_0x7f70[_0x47e8fd];return _0x14970b;};'use strict';var EventEmitter=require(_0x07f7('0x0'));var ChatQueue=require(_0x07f7('0x1'))['db'][_0x07f7('0x2')];var ChatQueueEvents=new EventEmitter();ChatQueueEvents['setMaxListeners'](0x0);var events={'afterCreate':_0x07f7('0x3'),'afterUpdate':_0x07f7('0x4'),'afterDestroy':_0x07f7('0x5')};function emitEvent(_0x135cc8){return function(_0x3b551f,_0x2b6b04,_0x4ec5ad){ChatQueueEvents[_0x07f7('0x6')](_0x135cc8+':'+_0x3b551f['id'],_0x3b551f);ChatQueueEvents[_0x07f7('0x6')](_0x135cc8,_0x3b551f);_0x4ec5ad(null);};}for(var e in events){if(events[_0x07f7('0x7')](e)){var event=events[e];ChatQueue[_0x07f7('0x8')](e,emitEvent(event));}}module[_0x07f7('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 cdd963c..50c26c9 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 _0xec25=['./chatQueue.attributes','define','ChatQueue','chat_queues','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf'];(function(_0x4565bf,_0x5ad9d6){var _0x5610ba=function(_0x170988){while(--_0x170988){_0x4565bf['push'](_0x4565bf['shift']());}};_0x5610ba(++_0x5ad9d6);}(_0xec25,0x190));var _0x5ec2=function(_0x1c4c3d,_0x219522){_0x1c4c3d=_0x1c4c3d-0x0;var _0x5833ce=_0xec25[_0x1c4c3d];return _0x5833ce;};'use strict';var _=require('lodash');var util=require(_0x5ec2('0x0'));var logger=require(_0x5ec2('0x1'))(_0x5ec2('0x2'));var moment=require(_0x5ec2('0x3'));var BPromise=require(_0x5ec2('0x4'));var rp=require(_0x5ec2('0x5'));var fs=require('fs');var path=require(_0x5ec2('0x6'));var rimraf=require(_0x5ec2('0x7'));var config=require('../../config/environment');var attributes=require(_0x5ec2('0x8'));module['exports']=function(_0x59a2a2,_0x28d87d){return _0x59a2a2[_0x5ec2('0x9')](_0x5ec2('0xa'),attributes,{'tableName':_0x5ec2('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xd2e4=['api','bluebird','path','../../config/environment','./chatQueue.attributes','exports','ChatQueue','chat_queues','lodash','../../config/logger'];(function(_0x1cc94c,_0x25b7b0){var _0x17ec55=function(_0x3eee9a){while(--_0x3eee9a){_0x1cc94c['push'](_0x1cc94c['shift']());}};_0x17ec55(++_0x25b7b0);}(_0xd2e4,0x80));var _0x4d2e=function(_0x3aabcb,_0x43aea4){_0x3aabcb=_0x3aabcb-0x0;var _0x1dea82=_0xd2e4[_0x3aabcb];return _0x1dea82;};'use strict';var _=require(_0x4d2e('0x0'));var util=require('util');var logger=require(_0x4d2e('0x1'))(_0x4d2e('0x2'));var moment=require('moment');var BPromise=require(_0x4d2e('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x4d2e('0x4'));var rimraf=require('rimraf');var config=require(_0x4d2e('0x5'));var attributes=require(_0x4d2e('0x6'));module[_0x4d2e('0x7')]=function(_0x3c88f8,_0x4d35eb){return _0x3c88f8['define'](_0x4d2e('0x8'),attributes,{'tableName':_0x4d2e('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 09d6d73..1e13c95 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 _0x3aee=['register','request','then','info','ChatQueue,\x20%s,\x20%s','ChatQueue,\x20%s,\x20%s,\x20%s','request\x20sent','error','message','GetChatQueue','ChatQueue','findAll','options','raw','where','attributes','limit','include','map','model','debug','stringify','catch','ShowChatQueue','find','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','jayson/promise','client','http','redis','defaults','socket.io-emitter','./chatQueue.socket'];(function(_0x22f9ac,_0x175405){var _0x4007bd=function(_0x593b50){while(--_0x593b50){_0x22f9ac['push'](_0x22f9ac['shift']());}};_0x4007bd(++_0x175405);}(_0x3aee,0x131));var _0xe3ae=function(_0x4c3ffe,_0x457374){_0x4c3ffe=_0x4c3ffe-0x0;var _0x28d3eb=_0x3aee[_0x4c3ffe];return _0x28d3eb;};'use strict';var _=require(_0xe3ae('0x0'));var util=require(_0xe3ae('0x1'));var moment=require('moment');var BPromise=require(_0xe3ae('0x2'));var rs=require(_0xe3ae('0x3'));var fs=require('fs');var Redis=require(_0xe3ae('0x4'));var db=require(_0xe3ae('0x5'))['db'];var utils=require(_0xe3ae('0x6'));var logger=require(_0xe3ae('0x7'))('rpc');var config=require('../../config/environment');var jayson=require(_0xe3ae('0x8'));var client=jayson[_0xe3ae('0x9')][_0xe3ae('0xa')]({'port':0x232a});config[_0xe3ae('0xb')]=_[_0xe3ae('0xc')](config[_0xe3ae('0xb')],{'host':'localhost','port':0x18eb});var socket=require(_0xe3ae('0xd'))(new Redis(config['redis']));require(_0xe3ae('0xe'))[_0xe3ae('0xf')](socket);function respondWithRpcPromise(_0x239b6c,_0x5caa0c,_0x546247){return new BPromise(function(_0x5da465,_0x31b80b){return client[_0xe3ae('0x10')](_0x239b6c,_0x546247)[_0xe3ae('0x11')](function(_0x40171b){logger[_0xe3ae('0x12')](_0xe3ae('0x13'),_0x5caa0c,'request\x20sent');logger['debug'](_0xe3ae('0x14'),_0x5caa0c,_0xe3ae('0x15'),JSON['stringify'](_0x40171b));if(_0x40171b['error']){if(_0x40171b[_0xe3ae('0x16')]['code']===0x1f4){logger[_0xe3ae('0x16')](_0xe3ae('0x13'),_0x5caa0c,_0x40171b[_0xe3ae('0x16')][_0xe3ae('0x17')]);return _0x31b80b(_0x40171b[_0xe3ae('0x16')]['message']);}logger[_0xe3ae('0x16')](_0xe3ae('0x13'),_0x5caa0c,_0x40171b['error'][_0xe3ae('0x17')]);return _0x5da465(_0x40171b[_0xe3ae('0x16')][_0xe3ae('0x17')]);}else{logger['info'](_0xe3ae('0x13'),_0x5caa0c,_0xe3ae('0x15'));_0x5da465(_0x40171b['result'][_0xe3ae('0x17')]);}})['catch'](function(_0x3522c0){logger[_0xe3ae('0x16')](_0xe3ae('0x13'),_0x5caa0c,_0x3522c0);_0x31b80b(_0x3522c0);});});}exports[_0xe3ae('0x18')]=function(_0x2272c0){var _0x280266=this;return new Promise(function(_0x5dba66,_0x48743e){return db[_0xe3ae('0x19')][_0xe3ae('0x1a')]({'raw':_0x2272c0[_0xe3ae('0x1b')]?_0x2272c0['options'][_0xe3ae('0x1c')]===undefined?!![]:![]:!![],'where':_0x2272c0[_0xe3ae('0x1b')]?_0x2272c0[_0xe3ae('0x1b')][_0xe3ae('0x1d')]||null:null,'attributes':_0x2272c0[_0xe3ae('0x1b')]?_0x2272c0[_0xe3ae('0x1b')][_0xe3ae('0x1e')]||null:null,'limit':_0x2272c0[_0xe3ae('0x1b')]?_0x2272c0[_0xe3ae('0x1b')][_0xe3ae('0x1f')]||null:null,'include':_0x2272c0['options']?_0x2272c0[_0xe3ae('0x1b')][_0xe3ae('0x20')]?_[_0xe3ae('0x21')](_0x2272c0['options'][_0xe3ae('0x20')],function(_0x2eaeed){return{'model':db[_0x2eaeed[_0xe3ae('0x22')]],'as':_0x2eaeed['as'],'attributes':_0x2eaeed[_0xe3ae('0x1e')],'include':_0x2eaeed['include']?_[_0xe3ae('0x21')](_0x2eaeed[_0xe3ae('0x20')],function(_0x437a51){return{'model':db[_0x437a51[_0xe3ae('0x22')]],'as':_0x437a51['as'],'attributes':_0x437a51['attributes'],'include':_0x437a51['include']?_[_0xe3ae('0x21')](_0x437a51[_0xe3ae('0x20')],function(_0x2ed03a){return{'model':db[_0x2ed03a['model']],'as':_0x2ed03a['as'],'attributes':_0x2ed03a[_0xe3ae('0x1e')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x3d4f53){logger['info'](_0xe3ae('0x18'),_0x2272c0);logger[_0xe3ae('0x23')](_0xe3ae('0x18'),_0x2272c0,JSON[_0xe3ae('0x24')](_0x3d4f53));_0x5dba66(_0x3d4f53);})[_0xe3ae('0x25')](function(_0x99520e){logger[_0xe3ae('0x16')](_0xe3ae('0x18'),_0x99520e[_0xe3ae('0x17')],_0x2272c0);_0x48743e(_0x280266[_0xe3ae('0x16')](0x1f4,_0x99520e[_0xe3ae('0x17')]));});});};exports[_0xe3ae('0x26')]=function(_0x2e2147){var _0x265f8e=this;return new Promise(function(_0x4c71fc,_0xabf9f7){return db[_0xe3ae('0x19')][_0xe3ae('0x27')]({'raw':_0x2e2147['options']?_0x2e2147['options'][_0xe3ae('0x1c')]===undefined?!![]:![]:!![],'where':_0x2e2147['options']?_0x2e2147[_0xe3ae('0x1b')][_0xe3ae('0x1d')]||null:null,'attributes':_0x2e2147[_0xe3ae('0x1b')]?_0x2e2147['options'][_0xe3ae('0x1e')]||null:null,'include':_0x2e2147[_0xe3ae('0x1b')]?_0x2e2147[_0xe3ae('0x1b')][_0xe3ae('0x20')]?_[_0xe3ae('0x21')](_0x2e2147[_0xe3ae('0x1b')]['include'],function(_0x269f4a){return{'model':db[_0x269f4a[_0xe3ae('0x22')]],'as':_0x269f4a['as'],'attributes':_0x269f4a[_0xe3ae('0x1e')],'include':_0x269f4a[_0xe3ae('0x20')]?_[_0xe3ae('0x21')](_0x269f4a['include'],function(_0x5b474f){return{'model':db[_0x5b474f[_0xe3ae('0x22')]],'as':_0x5b474f['as'],'attributes':_0x5b474f[_0xe3ae('0x1e')],'include':_0x5b474f[_0xe3ae('0x20')]?_[_0xe3ae('0x21')](_0x5b474f[_0xe3ae('0x20')],function(_0x1ed112){return{'model':db[_0x1ed112[_0xe3ae('0x22')]],'as':_0x1ed112['as'],'attributes':_0x1ed112[_0xe3ae('0x1e')]};}):[]};}):[]};}):[]:[]})[_0xe3ae('0x11')](function(_0x4ad4aa){logger[_0xe3ae('0x12')]('ShowChatQueue',_0x2e2147);logger[_0xe3ae('0x23')](_0xe3ae('0x26'),_0x2e2147,JSON[_0xe3ae('0x24')](_0x4ad4aa));_0x4c71fc(_0x4ad4aa);})[_0xe3ae('0x25')](function(_0x255235){logger[_0xe3ae('0x16')](_0xe3ae('0x26'),_0x255235['message'],_0x2e2147);_0xabf9f7(_0x265f8e[_0xe3ae('0x16')](0x1f4,_0x255235[_0xe3ae('0x17')]));});});}; \ No newline at end of file +var _0x5689=['map','model','attributes','GetChatQueue','debug','find','then','ShowChatQueue','lodash','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/environment','jayson/promise','http','redis','defaults','localhost','./chatQueue.socket','register','info','ChatQueue,\x20%s,\x20%s','request\x20sent','stringify','code','error','message','result','catch','ChatQueue','raw','options','where','include'];(function(_0x48c612,_0x432076){var _0x5f0583=function(_0x2ebc92){while(--_0x2ebc92){_0x48c612['push'](_0x48c612['shift']());}};_0x5f0583(++_0x432076);}(_0x5689,0xe0));var _0x9568=function(_0x3fe624,_0x23859d){_0x3fe624=_0x3fe624-0x0;var _0x4458bf=_0x5689[_0x3fe624];return _0x4458bf;};'use strict';var _=require(_0x9568('0x0'));var util=require('util');var moment=require(_0x9568('0x1'));var BPromise=require(_0x9568('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x9568('0x3'));var db=require(_0x9568('0x4'))['db'];var utils=require(_0x9568('0x5'));var logger=require('../../config/logger')('rpc');var config=require(_0x9568('0x6'));var jayson=require(_0x9568('0x7'));var client=jayson['client'][_0x9568('0x8')]({'port':0x232a});config[_0x9568('0x9')]=_[_0x9568('0xa')](config[_0x9568('0x9')],{'host':_0x9568('0xb'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x9568('0x9')]));require(_0x9568('0xc'))[_0x9568('0xd')](socket);function respondWithRpcPromise(_0x353549,_0xdd1dc5,_0x99e8e1){return new BPromise(function(_0x2961b5,_0x2d8313){return client['request'](_0x353549,_0x99e8e1)['then'](function(_0x58d460){logger[_0x9568('0xe')](_0x9568('0xf'),_0xdd1dc5,_0x9568('0x10'));logger['debug']('ChatQueue,\x20%s,\x20%s,\x20%s',_0xdd1dc5,_0x9568('0x10'),JSON[_0x9568('0x11')](_0x58d460));if(_0x58d460['error']){if(_0x58d460['error'][_0x9568('0x12')]===0x1f4){logger[_0x9568('0x13')](_0x9568('0xf'),_0xdd1dc5,_0x58d460['error'][_0x9568('0x14')]);return _0x2d8313(_0x58d460[_0x9568('0x13')][_0x9568('0x14')]);}logger[_0x9568('0x13')](_0x9568('0xf'),_0xdd1dc5,_0x58d460[_0x9568('0x13')]['message']);return _0x2961b5(_0x58d460['error'][_0x9568('0x14')]);}else{logger[_0x9568('0xe')](_0x9568('0xf'),_0xdd1dc5,_0x9568('0x10'));_0x2961b5(_0x58d460[_0x9568('0x15')][_0x9568('0x14')]);}})[_0x9568('0x16')](function(_0x2fa79e){logger[_0x9568('0x13')]('ChatQueue,\x20%s,\x20%s',_0xdd1dc5,_0x2fa79e);_0x2d8313(_0x2fa79e);});});}exports['GetChatQueue']=function(_0x39ece0){var _0x34ddf8=this;return new Promise(function(_0x41de83,_0x3b4d7b){return db[_0x9568('0x17')]['findAll']({'raw':_0x39ece0['options']?_0x39ece0['options'][_0x9568('0x18')]===undefined?!![]:![]:!![],'where':_0x39ece0[_0x9568('0x19')]?_0x39ece0[_0x9568('0x19')][_0x9568('0x1a')]||null:null,'attributes':_0x39ece0[_0x9568('0x19')]?_0x39ece0['options']['attributes']||null:null,'limit':_0x39ece0[_0x9568('0x19')]?_0x39ece0[_0x9568('0x19')]['limit']||null:null,'include':_0x39ece0[_0x9568('0x19')]?_0x39ece0[_0x9568('0x19')][_0x9568('0x1b')]?_[_0x9568('0x1c')](_0x39ece0[_0x9568('0x19')][_0x9568('0x1b')],function(_0x1d9215){return{'model':db[_0x1d9215[_0x9568('0x1d')]],'as':_0x1d9215['as'],'attributes':_0x1d9215[_0x9568('0x1e')],'include':_0x1d9215[_0x9568('0x1b')]?_['map'](_0x1d9215['include'],function(_0x18ca96){return{'model':db[_0x18ca96['model']],'as':_0x18ca96['as'],'attributes':_0x18ca96['attributes'],'include':_0x18ca96[_0x9568('0x1b')]?_[_0x9568('0x1c')](_0x18ca96[_0x9568('0x1b')],function(_0x1ff335){return{'model':db[_0x1ff335['model']],'as':_0x1ff335['as'],'attributes':_0x1ff335[_0x9568('0x1e')]};}):[]};}):[]};}):[]:[]})['then'](function(_0xc9f03){logger[_0x9568('0xe')](_0x9568('0x1f'),_0x39ece0);logger[_0x9568('0x20')]('GetChatQueue',_0x39ece0,JSON[_0x9568('0x11')](_0xc9f03));_0x41de83(_0xc9f03);})['catch'](function(_0x50bec3){logger[_0x9568('0x13')](_0x9568('0x1f'),_0x50bec3[_0x9568('0x14')],_0x39ece0);_0x3b4d7b(_0x34ddf8[_0x9568('0x13')](0x1f4,_0x50bec3[_0x9568('0x14')]));});});};exports['ShowChatQueue']=function(_0x42154c){var _0x338d27=this;return new Promise(function(_0x47d8a4,_0x2e1bd6){return db[_0x9568('0x17')][_0x9568('0x21')]({'raw':_0x42154c[_0x9568('0x19')]?_0x42154c[_0x9568('0x19')][_0x9568('0x18')]===undefined?!![]:![]:!![],'where':_0x42154c[_0x9568('0x19')]?_0x42154c[_0x9568('0x19')]['where']||null:null,'attributes':_0x42154c[_0x9568('0x19')]?_0x42154c['options']['attributes']||null:null,'include':_0x42154c['options']?_0x42154c['options'][_0x9568('0x1b')]?_[_0x9568('0x1c')](_0x42154c['options'][_0x9568('0x1b')],function(_0x1f218a){return{'model':db[_0x1f218a[_0x9568('0x1d')]],'as':_0x1f218a['as'],'attributes':_0x1f218a[_0x9568('0x1e')],'include':_0x1f218a[_0x9568('0x1b')]?_[_0x9568('0x1c')](_0x1f218a[_0x9568('0x1b')],function(_0x116997){return{'model':db[_0x116997[_0x9568('0x1d')]],'as':_0x116997['as'],'attributes':_0x116997['attributes'],'include':_0x116997['include']?_[_0x9568('0x1c')](_0x116997[_0x9568('0x1b')],function(_0x2166d6){return{'model':db[_0x2166d6[_0x9568('0x1d')]],'as':_0x2166d6['as'],'attributes':_0x2166d6[_0x9568('0x1e')]};}):[]};}):[]};}):[]:[]})[_0x9568('0x22')](function(_0x18b816){logger[_0x9568('0xe')]('ShowChatQueue',_0x42154c);logger['debug'](_0x9568('0x23'),_0x42154c,JSON[_0x9568('0x11')](_0x18b816));_0x47d8a4(_0x18b816);})[_0x9568('0x16')](function(_0x262a5e){logger['error'](_0x9568('0x23'),_0x262a5e[_0x9568('0x14')],_0x42154c);_0x2e1bd6(_0x338d27[_0x9568('0x13')](0x1f4,_0x262a5e[_0x9568('0x14')]));});});}; \ No newline at end of file diff --git a/server/api/chatQueue/chatQueue.socket.js b/server/api/chatQueue/chatQueue.socket.js index ac5e6db..86a34a4 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 _0xcb99=['chatQueue:','./chatQueue.events','remove','emit','removeListener','length'];(function(_0x3da233,_0x3d5810){var _0xbba6b7=function(_0x4142fa){while(--_0x4142fa){_0x3da233['push'](_0x3da233['shift']());}};_0xbba6b7(++_0x3d5810);}(_0xcb99,0x8b));var _0x9cb9=function(_0x1671c7,_0x36f775){_0x1671c7=_0x1671c7-0x0;var _0x160b76=_0xcb99[_0x1671c7];return _0x160b76;};'use strict';var ChatQueueEvents=require(_0x9cb9('0x0'));var events=['save',_0x9cb9('0x1'),'update'];function createListener(_0x480364,_0x3a2f21){return function(_0x1308a8){_0x3a2f21[_0x9cb9('0x2')](_0x480364,_0x1308a8);};}function removeListener(_0x51f2ee,_0x167735){return function(){ChatQueueEvents[_0x9cb9('0x3')](_0x51f2ee,_0x167735);};}exports['register']=function(_0x214b72){for(var _0x509cfc=0x0,_0x2ed26a=events[_0x9cb9('0x4')];_0x509cfc<_0x2ed26a;_0x509cfc++){var _0x1bf9b7=events[_0x509cfc];var _0x1dd62f=createListener(_0x9cb9('0x5')+_0x1bf9b7,_0x214b72);ChatQueueEvents['on'](_0x1bf9b7,_0x1dd62f);}}; \ No newline at end of file +var _0xf3cd=['remove','update','emit','register','length','chatQueue:','./chatQueue.events','save'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xf3cd,0xfe));var _0xdf3c=function(_0x27031e,_0x1eb8cd){_0x27031e=_0x27031e-0x0;var _0xfd46b3=_0xf3cd[_0x27031e];return _0xfd46b3;};'use strict';var ChatQueueEvents=require(_0xdf3c('0x0'));var events=[_0xdf3c('0x1'),_0xdf3c('0x2'),_0xdf3c('0x3')];function createListener(_0x1839ec,_0x433a7f){return function(_0x54db05){_0x433a7f[_0xdf3c('0x4')](_0x1839ec,_0x54db05);};}function removeListener(_0x71b446,_0x9f71cb){return function(){ChatQueueEvents['removeListener'](_0x71b446,_0x9f71cb);};}exports[_0xdf3c('0x5')]=function(_0x17d42a){for(var _0x1313d5=0x0,_0x1f0601=events[_0xdf3c('0x6')];_0x1313d5<_0x1f0601;_0x1313d5++){var _0x28edae=events[_0x1313d5];var _0x52c073=createListener(_0xdf3c('0x7')+_0x28edae,_0x17d42a);ChatQueueEvents['on'](_0x28edae,_0x52c073);}}; \ No newline at end of file diff --git a/server/api/chatQueue/index.js b/server/api/chatQueue/index.js index 21f6b8b..833d298 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(_0x501f4d,_0x51b9d9){var _0x199d85=function(_0x4c8370){while(--_0x4c8370){_0x501f4d['push'](_0x501f4d['shift']());}};_0x199d85(++_0x51b9d9);}(_0x55ca,0x126));var _0xa55c=function(_0x38b3cb,_0x4ad7b3){_0x38b3cb=_0x38b3cb-0x0;var _0x5a9a84=_0x55ca[_0x38b3cb];return _0x5a9a84;};'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 _0x5fc3=['update','delete','destroy','removeTeams','removeAgents','exports','multer','util','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../config/environment','./chatQueue.controller','get','isAuthenticated','describe','/:id','show','getMembers','/:id/teams','/:id/users','post','create','addTeams','put'];(function(_0x334841,_0x2bbc4c){var _0x5beb4b=function(_0x4bea72){while(--_0x4bea72){_0x334841['push'](_0x334841['shift']());}};_0x5beb4b(++_0x2bbc4c);}(_0x5fc3,0xa8));var _0x35fc=function(_0x2d6197,_0x82ebfb){_0x2d6197=_0x2d6197-0x0;var _0x4d0e75=_0x5fc3[_0x2d6197];return _0x4d0e75;};'use strict';var multer=require(_0x35fc('0x0'));var util=require(_0x35fc('0x1'));var path=require('path');var timeout=require(_0x35fc('0x2'));var express=require(_0x35fc('0x3'));var router=express[_0x35fc('0x4')]();var fs_extra=require(_0x35fc('0x5'));var auth=require(_0x35fc('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0x35fc('0x7'));var controller=require(_0x35fc('0x8'));router[_0x35fc('0x9')]('/',auth['isAuthenticated'](),controller['index']);router[_0x35fc('0x9')]('/describe',auth[_0x35fc('0xa')](),controller[_0x35fc('0xb')]);router[_0x35fc('0x9')](_0x35fc('0xc'),auth[_0x35fc('0xa')](),controller[_0x35fc('0xd')]);router[_0x35fc('0x9')]('/:id/members',auth[_0x35fc('0xa')](),controller[_0x35fc('0xe')]);router['get'](_0x35fc('0xf'),auth[_0x35fc('0xa')](),controller['getTeams']);router[_0x35fc('0x9')](_0x35fc('0x10'),auth['isAuthenticated'](),controller['getAgents']);router[_0x35fc('0x11')]('/',auth['isAuthenticated'](),controller[_0x35fc('0x12')]);router[_0x35fc('0x11')](_0x35fc('0xf'),auth[_0x35fc('0xa')](),controller[_0x35fc('0x13')]);router['post']('/:id/users',auth['isAuthenticated'](),controller['addAgents']);router[_0x35fc('0x14')](_0x35fc('0xc'),auth[_0x35fc('0xa')](),controller[_0x35fc('0x15')]);router[_0x35fc('0x16')](_0x35fc('0xc'),auth['isAuthenticated'](),controller[_0x35fc('0x17')]);router[_0x35fc('0x16')]('/:id/teams',auth[_0x35fc('0xa')](),controller[_0x35fc('0x18')]);router[_0x35fc('0x16')]('/:id/users',auth[_0x35fc('0xa')](),controller[_0x35fc('0x19')]);module[_0x35fc('0x1a')]=router; \ No newline at end of file diff --git a/server/api/chatQueueReport/chatQueueReport.attributes.js b/server/api/chatQueueReport/chatQueueReport.attributes.js index 25107f0..0cd7327 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 _0xe588=['DATE','moment','sequelize','STRING'];(function(_0x576554,_0x9c1a31){var _0x354a86=function(_0xaddcca){while(--_0xaddcca){_0x576554['push'](_0x576554['shift']());}};_0x354a86(++_0x9c1a31);}(_0xe588,0xe1));var _0x8e58=function(_0x5224c5,_0x18ef01){_0x5224c5=_0x5224c5-0x0;var _0x1935cf=_0xe588[_0x5224c5];return _0x1935cf;};'use strict';var moment=require(_0x8e58('0x0'));var Sequelize=require(_0x8e58('0x1'));module['exports']={'uniqueid':{'type':Sequelize['STRING'],'allowNull':![]},'from':{'type':Sequelize[_0x8e58('0x2')]},'joinAt':{'type':Sequelize[_0x8e58('0x3')]},'leaveAt':{'type':Sequelize['DATE']},'acceptAt':{'type':Sequelize[_0x8e58('0x3')]},'exitAt':{'type':Sequelize['DATE']},'reason':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0x4be5=['STRING','DATE','moment','sequelize','exports'];(function(_0x8dc04d,_0xaa7559){var _0x2f5f28=function(_0xdd2d1d){while(--_0xdd2d1d){_0x8dc04d['push'](_0x8dc04d['shift']());}};_0x2f5f28(++_0xaa7559);}(_0x4be5,0xca));var _0x54be=function(_0x46aff0,_0x122890){_0x46aff0=_0x46aff0-0x0;var _0x9d78cf=_0x4be5[_0x46aff0];return _0x9d78cf;};'use strict';var moment=require(_0x54be('0x0'));var Sequelize=require(_0x54be('0x1'));module[_0x54be('0x2')]={'uniqueid':{'type':Sequelize[_0x54be('0x3')],'allowNull':![]},'from':{'type':Sequelize[_0x54be('0x3')]},'joinAt':{'type':Sequelize['DATE']},'leaveAt':{'type':Sequelize[_0x54be('0x4')]},'acceptAt':{'type':Sequelize[_0x54be('0x4')]},'exitAt':{'type':Sequelize[_0x54be('0x4')]},'reason':{'type':Sequelize['STRING']}}; \ No newline at end of file diff --git a/server/api/chatQueueReport/chatQueueReport.controller.js b/server/api/chatQueueReport/chatQueueReport.controller.js index a8dc854..09b3e90 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 _0xdded=['zip-dir','fast-json-patch','request-promise','moment','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','../../components/auth/service','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','limit','undefined','count','Content-Range','apply','update','then','destroy','error','name','send','index','map','ChatQueueReport','rawAttributes','fieldName','type','key','model','query','keys','intersection','fields','attributes','hasOwnProperty','nolimit','order','sort','filters','pick','filter','where','VIRTUAL','include','findAll','catch','show','params','length','includeAll','merge','options','find','create','body','describe','eml-format','rimraf'];(function(_0x1945b3,_0x59902a){var _0x5de191=function(_0x3d986b){while(--_0x3d986b){_0x1945b3['push'](_0x1945b3['shift']());}};_0x5de191(++_0x59902a);}(_0xdded,0x17a));var _0xddde=function(_0x442153,_0x4872a3){_0x442153=_0x442153-0x0;var _0x34df53=_0xdded[_0x442153];return _0x34df53;};'use strict';var emlformat=require(_0xddde('0x0'));var rimraf=require(_0xddde('0x1'));var zipdir=require(_0xddde('0x2'));var jsonpatch=require(_0xddde('0x3'));var rp=require(_0xddde('0x4'));var moment=require(_0xddde('0x5'));var BPromise=require('bluebird');var Mustache=require(_0xddde('0x6'));var util=require(_0xddde('0x7'));var path=require(_0xddde('0x8'));var sox=require(_0xddde('0x9'));var csv=require(_0xddde('0xa'));var ejs=require(_0xddde('0xb'));var fs=require('fs');var fs_extra=require(_0xddde('0xc'));var _=require(_0xddde('0xd'));var squel=require(_0xddde('0xe'));var crypto=require(_0xddde('0xf'));var jsforce=require(_0xddde('0x10'));var deskjs=require('desk.js');var toCsv=require(_0xddde('0xa'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0xddde('0x11'));var qs=require('../../components/parsers/qs');var as=require(_0xddde('0x12'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xddde('0x13'))(_0xddde('0x14'));var utils=require(_0xddde('0x15'));var config=require(_0xddde('0x16'));var licenseUtil=require(_0xddde('0x17'));var db=require(_0xddde('0x18'))['db'];function respondWithStatusCode(_0x25fadc,_0x35172e){_0x35172e=_0x35172e||0xcc;return function(_0x57e121){if(_0x57e121){return _0x25fadc[_0xddde('0x19')](_0x35172e);}return _0x25fadc[_0xddde('0x1a')](_0x35172e)[_0xddde('0x1b')]();};}function respondWithResult(_0x860ff4,_0x7cbcee){_0x7cbcee=_0x7cbcee||0xc8;return function(_0x31c111){if(_0x31c111){return _0x860ff4['status'](_0x7cbcee)[_0xddde('0x1c')](_0x31c111);}};}function respondWithFilteredResult(_0xbe1df5,_0x3698d4){return function(_0x48f602){if(_0x48f602){var _0x5de7ce=typeof _0x3698d4[_0xddde('0x1d')]==='undefined'&&typeof _0x3698d4[_0xddde('0x1e')]===_0xddde('0x1f');var _0x338fa7=_0x48f602[_0xddde('0x20')];var _0x2f0e58=_0x5de7ce?0x0:_0x3698d4['offset'];var _0x249f19=_0x5de7ce?_0x48f602[_0xddde('0x20')]:_0x3698d4['offset']+_0x3698d4[_0xddde('0x1e')];var _0x1185f9;if(_0x249f19>=_0x338fa7){_0x249f19=_0x338fa7;_0x1185f9=0xc8;}else{_0x1185f9=0xce;}_0xbe1df5['status'](_0x1185f9);return _0xbe1df5['set'](_0xddde('0x21'),_0x2f0e58+'-'+_0x249f19+'/'+_0x338fa7)['json'](_0x48f602);}return null;};}function patchUpdates(_0x1ef35a){return function(_0x5175bd){try{jsonpatch[_0xddde('0x22')](_0x5175bd,_0x1ef35a,!![]);}catch(_0xea045b){return BPromise['reject'](_0xea045b);}return _0x5175bd['save']();};}function saveUpdates(_0x3cfd91,_0x107bca){return function(_0x97bb0f){if(_0x97bb0f){return _0x97bb0f[_0xddde('0x23')](_0x3cfd91)[_0xddde('0x24')](function(_0xa663e4){return _0xa663e4;});}return null;};}function removeEntity(_0x3bc4bf,_0x56a33a){return function(_0x59320f){if(_0x59320f){return _0x59320f[_0xddde('0x25')]()[_0xddde('0x24')](function(){_0x3bc4bf[_0xddde('0x1a')](0xcc)[_0xddde('0x1b')]();});}};}function handleEntityNotFound(_0xdb57ef,_0x533332){return function(_0x394da0){if(!_0x394da0){_0xdb57ef[_0xddde('0x19')](0x194);}return _0x394da0;};}function handleError(_0x4ca351,_0x4bd409){_0x4bd409=_0x4bd409||0x1f4;return function(_0xa60e85){logger[_0xddde('0x26')](_0xa60e85['stack']);if(_0xa60e85[_0xddde('0x27')]){delete _0xa60e85[_0xddde('0x27')];}_0x4ca351['status'](_0x4bd409)[_0xddde('0x28')](_0xa60e85);};}exports[_0xddde('0x29')]=function(_0x2dd131,_0x32be0f){var _0x477d44={},_0xb5d4b6={},_0x450bac={'count':0x0,'rows':[]};var _0x7c0c18=_[_0xddde('0x2a')](db[_0xddde('0x2b')][_0xddde('0x2c')],function(_0x1ff3e2){return{'name':_0x1ff3e2[_0xddde('0x2d')],'type':_0x1ff3e2[_0xddde('0x2e')][_0xddde('0x2f')]};});_0xb5d4b6[_0xddde('0x30')]=_[_0xddde('0x2a')](_0x7c0c18,_0xddde('0x27'));_0xb5d4b6[_0xddde('0x31')]=_[_0xddde('0x32')](_0x2dd131['query']);_0xb5d4b6['filters']=_[_0xddde('0x33')](_0xb5d4b6[_0xddde('0x30')],_0xb5d4b6[_0xddde('0x31')]);_0x477d44['attributes']=_['intersection'](_0xb5d4b6[_0xddde('0x30')],qs[_0xddde('0x34')](_0x2dd131[_0xddde('0x31')][_0xddde('0x34')]));_0x477d44['attributes']=_0x477d44[_0xddde('0x35')]['length']?_0x477d44[_0xddde('0x35')]:_0xb5d4b6[_0xddde('0x30')];if(!_0x2dd131[_0xddde('0x31')][_0xddde('0x36')](_0xddde('0x37'))){_0x477d44[_0xddde('0x1e')]=qs[_0xddde('0x1e')](_0x2dd131[_0xddde('0x31')][_0xddde('0x1e')]);_0x477d44[_0xddde('0x1d')]=qs[_0xddde('0x1d')](_0x2dd131[_0xddde('0x31')]['offset']);}_0x477d44[_0xddde('0x38')]=qs[_0xddde('0x39')](_0x2dd131['query']['sort']);_0x477d44['where']=qs[_0xddde('0x3a')](_[_0xddde('0x3b')](_0x2dd131[_0xddde('0x31')],_0xb5d4b6[_0xddde('0x3a')]),_0x7c0c18);if(_0x2dd131[_0xddde('0x31')][_0xddde('0x3c')]){_0x477d44[_0xddde('0x3d')]=_['merge'](_0x477d44['where'],{'$or':_[_0xddde('0x2a')](_0x7c0c18,function(_0x5595a7){if(_0x5595a7[_0xddde('0x2e')]!==_0xddde('0x3e')){var _0x4c356a={};_0x4c356a[_0x5595a7[_0xddde('0x27')]]={'$like':'%'+_0x2dd131[_0xddde('0x31')][_0xddde('0x3c')]+'%'};return _0x4c356a;}})});}_0x477d44=_['merge']({},_0x477d44,_0x2dd131['options']);var _0x434868={'where':_0x477d44['where']};return db[_0xddde('0x2b')][_0xddde('0x20')](_0x434868)[_0xddde('0x24')](function(_0x216b12){_0x450bac[_0xddde('0x20')]=_0x216b12;if(_0x2dd131[_0xddde('0x31')]['includeAll']){_0x477d44[_0xddde('0x3f')]=[{'all':!![]}];}return db[_0xddde('0x2b')][_0xddde('0x40')](_0x477d44);})[_0xddde('0x24')](function(_0x10d9d3){_0x450bac['rows']=_0x10d9d3;return _0x450bac;})[_0xddde('0x24')](respondWithFilteredResult(_0x32be0f,_0x477d44))[_0xddde('0x41')](handleError(_0x32be0f,null));};exports[_0xddde('0x42')]=function(_0x3a52b5,_0x21b469){var _0xb0c016={'raw':!![],'where':{'id':_0x3a52b5[_0xddde('0x43')]['id']}},_0x6cbadb={};_0x6cbadb[_0xddde('0x30')]=_['keys'](db[_0xddde('0x2b')]['rawAttributes']);_0x6cbadb[_0xddde('0x31')]=_[_0xddde('0x32')](_0x3a52b5['query']);_0x6cbadb[_0xddde('0x3a')]=_[_0xddde('0x33')](_0x6cbadb[_0xddde('0x30')],_0x6cbadb['query']);_0xb0c016['attributes']=_['intersection'](_0x6cbadb[_0xddde('0x30')],qs[_0xddde('0x34')](_0x3a52b5[_0xddde('0x31')][_0xddde('0x34')]));_0xb0c016['attributes']=_0xb0c016[_0xddde('0x35')][_0xddde('0x44')]?_0xb0c016[_0xddde('0x35')]:_0x6cbadb['model'];if(_0x3a52b5[_0xddde('0x31')][_0xddde('0x45')]){_0xb0c016[_0xddde('0x3f')]=[{'all':!![]}];}_0xb0c016=_[_0xddde('0x46')]({},_0xb0c016,_0x3a52b5[_0xddde('0x47')]);return db['ChatQueueReport'][_0xddde('0x48')](_0xb0c016)['then'](handleEntityNotFound(_0x21b469,null))[_0xddde('0x24')](respondWithResult(_0x21b469,null))['catch'](handleError(_0x21b469,null));};exports[_0xddde('0x49')]=function(_0x3c3c6c,_0x1db505){return db[_0xddde('0x2b')][_0xddde('0x49')](_0x3c3c6c[_0xddde('0x4a')],{})[_0xddde('0x24')](respondWithResult(_0x1db505,0xc9))[_0xddde('0x41')](handleError(_0x1db505,null));};exports['update']=function(_0x3ad9b6,_0x1b4a00){if(_0x3ad9b6[_0xddde('0x4a')]['id']){delete _0x3ad9b6[_0xddde('0x4a')]['id'];}return db[_0xddde('0x2b')][_0xddde('0x48')]({'where':{'id':_0x3ad9b6['params']['id']}})[_0xddde('0x24')](handleEntityNotFound(_0x1b4a00,null))[_0xddde('0x24')](saveUpdates(_0x3ad9b6[_0xddde('0x4a')],null))[_0xddde('0x24')](respondWithResult(_0x1b4a00,null))[_0xddde('0x41')](handleError(_0x1b4a00,null));};exports['destroy']=function(_0x2a8537,_0x42a325){return db[_0xddde('0x2b')][_0xddde('0x48')]({'where':{'id':_0x2a8537[_0xddde('0x43')]['id']}})[_0xddde('0x24')](handleEntityNotFound(_0x42a325,null))[_0xddde('0x24')](removeEntity(_0x42a325,null))[_0xddde('0x41')](handleError(_0x42a325,null));};exports[_0xddde('0x4b')]=function(_0xff548d,_0x43fcf6){return db[_0xddde('0x2b')][_0xddde('0x4b')]()[_0xddde('0x24')](respondWithResult(_0x43fcf6,null))[_0xddde('0x41')](handleError(_0x43fcf6,null));}; \ No newline at end of file +var _0xb94c=['path','sox','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','json','offset','undefined','limit','count','set','Content-Range','apply','reject','then','destroy','end','error','stack','name','send','index','ChatQueueReport','fieldName','model','map','keys','query','filters','intersection','attributes','fields','length','order','sort','where','pick','filter','type','VIRTUAL','merge','options','includeAll','include','findAll','catch','show','params','rawAttributes','find','create','body','eml-format','rimraf','fast-json-patch','request-promise','bluebird','util'];(function(_0x14c00f,_0x11b192){var _0x19fbda=function(_0xf9caa4){while(--_0xf9caa4){_0x14c00f['push'](_0x14c00f['shift']());}};_0x19fbda(++_0x11b192);}(_0xb94c,0x176));var _0xcb94=function(_0x5bc1f4,_0x1a793f){_0x5bc1f4=_0x5bc1f4-0x0;var _0x5cd8ce=_0xb94c[_0x5bc1f4];return _0x5cd8ce;};'use strict';var emlformat=require(_0xcb94('0x0'));var rimraf=require(_0xcb94('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xcb94('0x2'));var rp=require(_0xcb94('0x3'));var moment=require('moment');var BPromise=require(_0xcb94('0x4'));var Mustache=require('mustache');var util=require(_0xcb94('0x5'));var path=require(_0xcb94('0x6'));var sox=require(_0xcb94('0x7'));var csv=require(_0xcb94('0x8'));var ejs=require(_0xcb94('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xcb94('0xa'));var squel=require(_0xcb94('0xb'));var crypto=require(_0xcb94('0xc'));var jsforce=require(_0xcb94('0xd'));var deskjs=require(_0xcb94('0xe'));var toCsv=require('to-csv');var querystring=require(_0xcb94('0xf'));var Papa=require(_0xcb94('0x10'));var Redis=require(_0xcb94('0x11'));var authService=require(_0xcb94('0x12'));var qs=require('../../components/parsers/qs');var as=require(_0xcb94('0x13'));var hardwareService=require(_0xcb94('0x14'));var logger=require(_0xcb94('0x15'))(_0xcb94('0x16'));var utils=require(_0xcb94('0x17'));var config=require(_0xcb94('0x18'));var licenseUtil=require(_0xcb94('0x19'));var db=require(_0xcb94('0x1a'))['db'];function respondWithStatusCode(_0x4328b2,_0x250511){_0x250511=_0x250511||0xcc;return function(_0x4cc359){if(_0x4cc359){return _0x4328b2[_0xcb94('0x1b')](_0x250511);}return _0x4328b2[_0xcb94('0x1c')](_0x250511)['end']();};}function respondWithResult(_0x5c63c9,_0x481618){_0x481618=_0x481618||0xc8;return function(_0x4bea1b){if(_0x4bea1b){return _0x5c63c9[_0xcb94('0x1c')](_0x481618)[_0xcb94('0x1d')](_0x4bea1b);}};}function respondWithFilteredResult(_0x62d472,_0x523d52){return function(_0x27cd73){if(_0x27cd73){var _0x566267=typeof _0x523d52[_0xcb94('0x1e')]===_0xcb94('0x1f')&&typeof _0x523d52[_0xcb94('0x20')]===_0xcb94('0x1f');var _0x7d23a7=_0x27cd73['count'];var _0x3c2f6f=_0x566267?0x0:_0x523d52['offset'];var _0x5db5e1=_0x566267?_0x27cd73[_0xcb94('0x21')]:_0x523d52[_0xcb94('0x1e')]+_0x523d52[_0xcb94('0x20')];var _0x173078;if(_0x5db5e1>=_0x7d23a7){_0x5db5e1=_0x7d23a7;_0x173078=0xc8;}else{_0x173078=0xce;}_0x62d472[_0xcb94('0x1c')](_0x173078);return _0x62d472[_0xcb94('0x22')](_0xcb94('0x23'),_0x3c2f6f+'-'+_0x5db5e1+'/'+_0x7d23a7)[_0xcb94('0x1d')](_0x27cd73);}return null;};}function patchUpdates(_0x1d4dc6){return function(_0x3876b4){try{jsonpatch[_0xcb94('0x24')](_0x3876b4,_0x1d4dc6,!![]);}catch(_0x5e9844){return BPromise[_0xcb94('0x25')](_0x5e9844);}return _0x3876b4['save']();};}function saveUpdates(_0x3beda0,_0x1c7a73){return function(_0x2235f4){if(_0x2235f4){return _0x2235f4['update'](_0x3beda0)[_0xcb94('0x26')](function(_0x23309f){return _0x23309f;});}return null;};}function removeEntity(_0x1054d4,_0x212ada){return function(_0x494b01){if(_0x494b01){return _0x494b01[_0xcb94('0x27')]()[_0xcb94('0x26')](function(){_0x1054d4[_0xcb94('0x1c')](0xcc)[_0xcb94('0x28')]();});}};}function handleEntityNotFound(_0x58df93,_0x45a4f8){return function(_0x2ff850){if(!_0x2ff850){_0x58df93[_0xcb94('0x1b')](0x194);}return _0x2ff850;};}function handleError(_0x496b02,_0x4ecfa2){_0x4ecfa2=_0x4ecfa2||0x1f4;return function(_0x24a06d){logger[_0xcb94('0x29')](_0x24a06d[_0xcb94('0x2a')]);if(_0x24a06d[_0xcb94('0x2b')]){delete _0x24a06d[_0xcb94('0x2b')];}_0x496b02[_0xcb94('0x1c')](_0x4ecfa2)[_0xcb94('0x2c')](_0x24a06d);};}exports[_0xcb94('0x2d')]=function(_0x2ed2e5,_0x5a3faa){var _0x442690={},_0x2e0b01={},_0x371227={'count':0x0,'rows':[]};var _0x13cec3=_['map'](db[_0xcb94('0x2e')]['rawAttributes'],function(_0x1c1c25){return{'name':_0x1c1c25[_0xcb94('0x2f')],'type':_0x1c1c25['type']['key']};});_0x2e0b01[_0xcb94('0x30')]=_[_0xcb94('0x31')](_0x13cec3,_0xcb94('0x2b'));_0x2e0b01['query']=_[_0xcb94('0x32')](_0x2ed2e5[_0xcb94('0x33')]);_0x2e0b01[_0xcb94('0x34')]=_[_0xcb94('0x35')](_0x2e0b01[_0xcb94('0x30')],_0x2e0b01['query']);_0x442690[_0xcb94('0x36')]=_[_0xcb94('0x35')](_0x2e0b01[_0xcb94('0x30')],qs[_0xcb94('0x37')](_0x2ed2e5[_0xcb94('0x33')][_0xcb94('0x37')]));_0x442690[_0xcb94('0x36')]=_0x442690['attributes'][_0xcb94('0x38')]?_0x442690[_0xcb94('0x36')]:_0x2e0b01[_0xcb94('0x30')];if(!_0x2ed2e5[_0xcb94('0x33')]['hasOwnProperty']('nolimit')){_0x442690[_0xcb94('0x20')]=qs[_0xcb94('0x20')](_0x2ed2e5[_0xcb94('0x33')][_0xcb94('0x20')]);_0x442690[_0xcb94('0x1e')]=qs[_0xcb94('0x1e')](_0x2ed2e5[_0xcb94('0x33')][_0xcb94('0x1e')]);}_0x442690[_0xcb94('0x39')]=qs[_0xcb94('0x3a')](_0x2ed2e5[_0xcb94('0x33')]['sort']);_0x442690[_0xcb94('0x3b')]=qs[_0xcb94('0x34')](_[_0xcb94('0x3c')](_0x2ed2e5[_0xcb94('0x33')],_0x2e0b01['filters']),_0x13cec3);if(_0x2ed2e5[_0xcb94('0x33')][_0xcb94('0x3d')]){_0x442690['where']=_['merge'](_0x442690[_0xcb94('0x3b')],{'$or':_[_0xcb94('0x31')](_0x13cec3,function(_0x1e979a){if(_0x1e979a[_0xcb94('0x3e')]!==_0xcb94('0x3f')){var _0x10fe0a={};_0x10fe0a[_0x1e979a['name']]={'$like':'%'+_0x2ed2e5[_0xcb94('0x33')]['filter']+'%'};return _0x10fe0a;}})});}_0x442690=_[_0xcb94('0x40')]({},_0x442690,_0x2ed2e5[_0xcb94('0x41')]);var _0x1e6148={'where':_0x442690[_0xcb94('0x3b')]};return db[_0xcb94('0x2e')][_0xcb94('0x21')](_0x1e6148)[_0xcb94('0x26')](function(_0x16375b){_0x371227['count']=_0x16375b;if(_0x2ed2e5[_0xcb94('0x33')][_0xcb94('0x42')]){_0x442690[_0xcb94('0x43')]=[{'all':!![]}];}return db[_0xcb94('0x2e')][_0xcb94('0x44')](_0x442690);})[_0xcb94('0x26')](function(_0x2d971d){_0x371227['rows']=_0x2d971d;return _0x371227;})[_0xcb94('0x26')](respondWithFilteredResult(_0x5a3faa,_0x442690))[_0xcb94('0x45')](handleError(_0x5a3faa,null));};exports[_0xcb94('0x46')]=function(_0x5dfddf,_0x5ebcbe){var _0x19075a={'raw':!![],'where':{'id':_0x5dfddf[_0xcb94('0x47')]['id']}},_0x45d510={};_0x45d510[_0xcb94('0x30')]=_[_0xcb94('0x32')](db['ChatQueueReport'][_0xcb94('0x48')]);_0x45d510['query']=_[_0xcb94('0x32')](_0x5dfddf[_0xcb94('0x33')]);_0x45d510[_0xcb94('0x34')]=_[_0xcb94('0x35')](_0x45d510['model'],_0x45d510[_0xcb94('0x33')]);_0x19075a['attributes']=_['intersection'](_0x45d510['model'],qs[_0xcb94('0x37')](_0x5dfddf['query'][_0xcb94('0x37')]));_0x19075a[_0xcb94('0x36')]=_0x19075a[_0xcb94('0x36')][_0xcb94('0x38')]?_0x19075a[_0xcb94('0x36')]:_0x45d510[_0xcb94('0x30')];if(_0x5dfddf[_0xcb94('0x33')][_0xcb94('0x42')]){_0x19075a[_0xcb94('0x43')]=[{'all':!![]}];}_0x19075a=_[_0xcb94('0x40')]({},_0x19075a,_0x5dfddf[_0xcb94('0x41')]);return db[_0xcb94('0x2e')][_0xcb94('0x49')](_0x19075a)[_0xcb94('0x26')](handleEntityNotFound(_0x5ebcbe,null))['then'](respondWithResult(_0x5ebcbe,null))['catch'](handleError(_0x5ebcbe,null));};exports[_0xcb94('0x4a')]=function(_0x2484e0,_0x34159c){return db[_0xcb94('0x2e')][_0xcb94('0x4a')](_0x2484e0[_0xcb94('0x4b')],{})[_0xcb94('0x26')](respondWithResult(_0x34159c,0xc9))['catch'](handleError(_0x34159c,null));};exports['update']=function(_0x3fd63c,_0x15fd4f){if(_0x3fd63c['body']['id']){delete _0x3fd63c[_0xcb94('0x4b')]['id'];}return db[_0xcb94('0x2e')]['find']({'where':{'id':_0x3fd63c[_0xcb94('0x47')]['id']}})['then'](handleEntityNotFound(_0x15fd4f,null))[_0xcb94('0x26')](saveUpdates(_0x3fd63c[_0xcb94('0x4b')],null))[_0xcb94('0x26')](respondWithResult(_0x15fd4f,null))['catch'](handleError(_0x15fd4f,null));};exports[_0xcb94('0x27')]=function(_0x19e855,_0x13e6b6){return db[_0xcb94('0x2e')]['find']({'where':{'id':_0x19e855[_0xcb94('0x47')]['id']}})['then'](handleEntityNotFound(_0x13e6b6,null))[_0xcb94('0x26')](removeEntity(_0x13e6b6,null))[_0xcb94('0x45')](handleError(_0x13e6b6,null));};exports['describe']=function(_0x32e045,_0x12ff92){return db['ChatQueueReport']['describe']()['then'](respondWithResult(_0x12ff92,null))[_0xcb94('0x45')](handleError(_0x12ff92,null));}; \ No newline at end of file diff --git a/server/api/chatQueueReport/chatQueueReport.model.js b/server/api/chatQueueReport/chatQueueReport.model.js index 99466c9..2eea2a7 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 _0xb7e7=['../../config/logger','moment','request-promise','rimraf','../../config/environment','./chatQueueReport.attributes','define','ChatQueueReport','uniqueid','lodash'];(function(_0x1bf713,_0x2a079b){var _0x4b2b7b=function(_0x25f828){while(--_0x25f828){_0x1bf713['push'](_0x1bf713['shift']());}};_0x4b2b7b(++_0x2a079b);}(_0xb7e7,0x121));var _0x7b7e=function(_0x4d8ed9,_0x2ae284){_0x4d8ed9=_0x4d8ed9-0x0;var _0x1e2140=_0xb7e7[_0x4d8ed9];return _0x1e2140;};'use strict';var _=require(_0x7b7e('0x0'));var util=require('util');var logger=require(_0x7b7e('0x1'))('api');var moment=require(_0x7b7e('0x2'));var BPromise=require('bluebird');var rp=require(_0x7b7e('0x3'));var fs=require('fs');var path=require('path');var rimraf=require(_0x7b7e('0x4'));var config=require(_0x7b7e('0x5'));var attributes=require(_0x7b7e('0x6'));module['exports']=function(_0x53ed64,_0x333fa4){return _0x53ed64[_0x7b7e('0x7')](_0x7b7e('0x8'),attributes,{'tableName':'report_chat_queue','paranoid':![],'indexes':[{'name':_0x7b7e('0x9'),'fields':[_0x7b7e('0x9')]}],'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(_0x667081,_0x1d02b8){var _0x1c1e88=function(_0x4231c2){while(--_0x4231c2){_0x667081['push'](_0x667081['shift']());}};_0x1c1e88(++_0x1d02b8);}(_0xe706,0xa3));var _0x6e70=function(_0x5e4e54,_0x22683c){_0x5e4e54=_0x5e4e54-0x0;var _0x20b557=_0xe706[_0x5e4e54];return _0x20b557;};'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 10fef0d..8c17354 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 _0x18ff=['catch','update','raw','attributes','limit','UpdateChatQueueReport','lodash','util','moment','bluebird','randomstring','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','ChatQueueReport,\x20%s,\x20%s','request\x20sent','debug','ChatQueueReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','CreateChatQueueReport','ChatQueueReport','body','options','info'];(function(_0x4ea4df,_0x260f0c){var _0x2fe919=function(_0x2d078e){while(--_0x2d078e){_0x4ea4df['push'](_0x4ea4df['shift']());}};_0x2fe919(++_0x260f0c);}(_0x18ff,0x69));var _0xf18f=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0x18ff[_0x14add3];return _0x4a174f;};'use strict';var _=require(_0xf18f('0x0'));var util=require(_0xf18f('0x1'));var moment=require(_0xf18f('0x2'));var BPromise=require(_0xf18f('0x3'));var rs=require(_0xf18f('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0xf18f('0x5'));var logger=require(_0xf18f('0x6'))(_0xf18f('0x7'));var config=require(_0xf18f('0x8'));var jayson=require(_0xf18f('0x9'));var client=jayson[_0xf18f('0xa')][_0xf18f('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x38db48,_0x3845fc,_0x58aef3){return new BPromise(function(_0x693240,_0x19c2b1){return client[_0xf18f('0xc')](_0x38db48,_0x58aef3)[_0xf18f('0xd')](function(_0x4b0b28){logger['info'](_0xf18f('0xe'),_0x3845fc,_0xf18f('0xf'));logger[_0xf18f('0x10')](_0xf18f('0x11'),_0x3845fc,_0xf18f('0xf'),JSON[_0xf18f('0x12')](_0x4b0b28));if(_0x4b0b28['error']){if(_0x4b0b28[_0xf18f('0x13')][_0xf18f('0x14')]===0x1f4){logger[_0xf18f('0x13')](_0xf18f('0xe'),_0x3845fc,_0x4b0b28[_0xf18f('0x13')][_0xf18f('0x15')]);return _0x19c2b1(_0x4b0b28[_0xf18f('0x13')][_0xf18f('0x15')]);}logger[_0xf18f('0x13')](_0xf18f('0xe'),_0x3845fc,_0x4b0b28['error'][_0xf18f('0x15')]);return _0x693240(_0x4b0b28[_0xf18f('0x13')][_0xf18f('0x15')]);}else{logger['info'](_0xf18f('0xe'),_0x3845fc,'request\x20sent');_0x693240(_0x4b0b28['result']['message']);}})['catch'](function(_0x456951){logger[_0xf18f('0x13')](_0xf18f('0xe'),_0x3845fc,_0x456951);_0x19c2b1(_0x456951);});});}exports[_0xf18f('0x16')]=function(_0x185d89){var _0x55a1d4=this;return new Promise(function(_0xbd27b4,_0xeea782){return db[_0xf18f('0x17')]['create'](_0x185d89[_0xf18f('0x18')],{'raw':_0x185d89[_0xf18f('0x19')]?_0x185d89[_0xf18f('0x19')]['raw']===undefined?!![]:![]:!![]})['then'](function(_0x3ffbf0){logger[_0xf18f('0x1a')](_0xf18f('0x16'),_0x185d89);logger['debug'](_0xf18f('0x16'),_0x185d89,JSON['stringify'](_0x3ffbf0));_0xbd27b4(_0x3ffbf0);})[_0xf18f('0x1b')](function(_0x3591d0){logger[_0xf18f('0x13')](_0xf18f('0x16'),_0x3591d0[_0xf18f('0x15')],_0x185d89);_0xeea782(_0x55a1d4[_0xf18f('0x13')](0x1f4,_0x3591d0[_0xf18f('0x15')]));});});};exports['UpdateChatQueueReport']=function(_0x200995){var _0x30407b=this;return new Promise(function(_0x50f122,_0x1ded5e){return db[_0xf18f('0x17')][_0xf18f('0x1c')](_0x200995[_0xf18f('0x18')],{'raw':_0x200995[_0xf18f('0x19')]?_0x200995[_0xf18f('0x19')][_0xf18f('0x1d')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x200995['options']?_0x200995[_0xf18f('0x19')]['where']||null:null,'attributes':_0x200995[_0xf18f('0x19')]?_0x200995[_0xf18f('0x19')][_0xf18f('0x1e')]||null:null,'limit':_0x200995[_0xf18f('0x19')]?_0x200995['options'][_0xf18f('0x1f')]||null:null})[_0xf18f('0xd')](function(_0x39037a){logger['info'](_0xf18f('0x20'),_0x200995);logger['debug'](_0xf18f('0x20'),_0x200995,JSON[_0xf18f('0x12')](_0x39037a));_0x50f122(_0x39037a);})[_0xf18f('0x1b')](function(_0x265324){logger['error']('UpdateChatQueueReport',_0x265324[_0xf18f('0x15')],_0x200995);_0x1ded5e(_0x30407b[_0xf18f('0x13')](0x1f4,_0x265324['message']));});});}; \ No newline at end of file +var _0xd30a=['UpdateChatQueueReport','update','where','attributes','limit','lodash','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','request','then','ChatQueueReport,\x20%s,\x20%s','request\x20sent','ChatQueueReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result','catch','CreateChatQueueReport','ChatQueueReport','body','options','raw','debug'];(function(_0x172431,_0x566928){var _0x7c3f28=function(_0x2798f2){while(--_0x2798f2){_0x172431['push'](_0x172431['shift']());}};_0x7c3f28(++_0x566928);}(_0xd30a,0x19d));var _0xad30=function(_0x494d1f,_0x3f72ff){_0x494d1f=_0x494d1f-0x0;var _0x457b6e=_0xd30a[_0x494d1f];return _0x457b6e;};'use strict';var _=require(_0xad30('0x0'));var util=require('util');var moment=require(_0xad30('0x1'));var BPromise=require(_0xad30('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xad30('0x3'));var db=require(_0xad30('0x4'))['db'];var utils=require(_0xad30('0x5'));var logger=require(_0xad30('0x6'))(_0xad30('0x7'));var config=require(_0xad30('0x8'));var jayson=require(_0xad30('0x9'));var client=jayson[_0xad30('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x3dc0,_0x2e99d4,_0x1493da){return new BPromise(function(_0x20ac8b,_0x53e6fe){return client[_0xad30('0xb')](_0x3dc0,_0x1493da)[_0xad30('0xc')](function(_0x384583){logger['info'](_0xad30('0xd'),_0x2e99d4,_0xad30('0xe'));logger['debug'](_0xad30('0xf'),_0x2e99d4,_0xad30('0xe'),JSON[_0xad30('0x10')](_0x384583));if(_0x384583[_0xad30('0x11')]){if(_0x384583[_0xad30('0x11')][_0xad30('0x12')]===0x1f4){logger[_0xad30('0x11')](_0xad30('0xd'),_0x2e99d4,_0x384583[_0xad30('0x11')][_0xad30('0x13')]);return _0x53e6fe(_0x384583['error'][_0xad30('0x13')]);}logger[_0xad30('0x11')]('ChatQueueReport,\x20%s,\x20%s',_0x2e99d4,_0x384583[_0xad30('0x11')][_0xad30('0x13')]);return _0x20ac8b(_0x384583[_0xad30('0x11')]['message']);}else{logger[_0xad30('0x14')](_0xad30('0xd'),_0x2e99d4,_0xad30('0xe'));_0x20ac8b(_0x384583[_0xad30('0x15')][_0xad30('0x13')]);}})[_0xad30('0x16')](function(_0x2a6d9c){logger[_0xad30('0x11')](_0xad30('0xd'),_0x2e99d4,_0x2a6d9c);_0x53e6fe(_0x2a6d9c);});});}exports[_0xad30('0x17')]=function(_0x19a0cc){var _0x16cb53=this;return new Promise(function(_0x842841,_0x5068eb){return db[_0xad30('0x18')]['create'](_0x19a0cc[_0xad30('0x19')],{'raw':_0x19a0cc[_0xad30('0x1a')]?_0x19a0cc['options'][_0xad30('0x1b')]===undefined?!![]:![]:!![]})[_0xad30('0xc')](function(_0x312704){logger[_0xad30('0x14')]('CreateChatQueueReport',_0x19a0cc);logger[_0xad30('0x1c')](_0xad30('0x17'),_0x19a0cc,JSON[_0xad30('0x10')](_0x312704));_0x842841(_0x312704);})[_0xad30('0x16')](function(_0x12ec56){logger['error'](_0xad30('0x17'),_0x12ec56[_0xad30('0x13')],_0x19a0cc);_0x5068eb(_0x16cb53[_0xad30('0x11')](0x1f4,_0x12ec56[_0xad30('0x13')]));});});};exports[_0xad30('0x1d')]=function(_0x63c85d){var _0x4b395d=this;return new Promise(function(_0x4d11ae,_0x55207e){return db['ChatQueueReport'][_0xad30('0x1e')](_0x63c85d[_0xad30('0x19')],{'raw':_0x63c85d[_0xad30('0x1a')]?_0x63c85d[_0xad30('0x1a')][_0xad30('0x1b')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x63c85d['options']?_0x63c85d[_0xad30('0x1a')][_0xad30('0x1f')]||null:null,'attributes':_0x63c85d['options']?_0x63c85d[_0xad30('0x1a')][_0xad30('0x20')]||null:null,'limit':_0x63c85d[_0xad30('0x1a')]?_0x63c85d[_0xad30('0x1a')][_0xad30('0x21')]||null:null})[_0xad30('0xc')](function(_0x59ba1f){logger['info'](_0xad30('0x1d'),_0x63c85d);logger['debug'](_0xad30('0x1d'),_0x63c85d,JSON[_0xad30('0x10')](_0x59ba1f));_0x4d11ae(_0x59ba1f);})[_0xad30('0x16')](function(_0x2ca5fe){logger[_0xad30('0x11')]('UpdateChatQueueReport',_0x2ca5fe[_0xad30('0x13')],_0x63c85d);_0x55207e(_0x4b395d[_0xad30('0x11')](0x1f4,_0x2ca5fe[_0xad30('0x13')]));});});}; \ No newline at end of file diff --git a/server/api/chatQueueReport/index.js b/server/api/chatQueueReport/index.js index a89e316..f350fc1 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 _0x2f85=['destroy','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../config/environment','./chatQueueReport.controller','get','isAuthenticated','index','/describe','describe','/:id','delete'];(function(_0x23e7c1,_0x35110c){var _0x1add43=function(_0x238918){while(--_0x238918){_0x23e7c1['push'](_0x23e7c1['shift']());}};_0x1add43(++_0x35110c);}(_0x2f85,0x16b));var _0x52f8=function(_0x101334,_0xdb3758){_0x101334=_0x101334-0x0;var _0x387e22=_0x2f85[_0x101334];return _0x387e22;};'use strict';var multer=require(_0x52f8('0x0'));var util=require(_0x52f8('0x1'));var path=require(_0x52f8('0x2'));var timeout=require(_0x52f8('0x3'));var express=require(_0x52f8('0x4'));var router=express[_0x52f8('0x5')]();var fs_extra=require(_0x52f8('0x6'));var auth=require(_0x52f8('0x7'));var interaction=require('../../components/interaction/service');var config=require(_0x52f8('0x8'));var controller=require(_0x52f8('0x9'));router[_0x52f8('0xa')]('/',auth[_0x52f8('0xb')](),controller[_0x52f8('0xc')]);router['get'](_0x52f8('0xd'),auth[_0x52f8('0xb')](),controller[_0x52f8('0xe')]);router[_0x52f8('0xa')](_0x52f8('0xf'),auth[_0x52f8('0xb')](),controller['show']);router['post']('/',auth[_0x52f8('0xb')](),controller['create']);router['put'](_0x52f8('0xf'),auth[_0x52f8('0xb')](),controller['update']);router[_0x52f8('0x10')](_0x52f8('0xf'),auth[_0x52f8('0xb')](),controller[_0x52f8('0x11')]);module[_0x52f8('0x12')]=router; \ No newline at end of file +var _0x1159=['show','post','put','update','delete','destroy','exports','multer','path','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./chatQueueReport.controller','get','isAuthenticated','index','/:id'];(function(_0x112623,_0x20d95b){var _0x4d1f24=function(_0x5ae06d){while(--_0x5ae06d){_0x112623['push'](_0x112623['shift']());}};_0x4d1f24(++_0x20d95b);}(_0x1159,0x197));var _0x9115=function(_0x564a6f,_0x79483a){_0x564a6f=_0x564a6f-0x0;var _0x11ad39=_0x1159[_0x564a6f];return _0x11ad39;};'use strict';var multer=require(_0x9115('0x0'));var util=require('util');var path=require(_0x9115('0x1'));var timeout=require('connect-timeout');var express=require(_0x9115('0x2'));var router=express[_0x9115('0x3')]();var fs_extra=require(_0x9115('0x4'));var auth=require(_0x9115('0x5'));var interaction=require(_0x9115('0x6'));var config=require(_0x9115('0x7'));var controller=require(_0x9115('0x8'));router[_0x9115('0x9')]('/',auth[_0x9115('0xa')](),controller[_0x9115('0xb')]);router['get']('/describe',auth['isAuthenticated'](),controller['describe']);router[_0x9115('0x9')](_0x9115('0xc'),auth[_0x9115('0xa')](),controller[_0x9115('0xd')]);router[_0x9115('0xe')]('/',auth[_0x9115('0xa')](),controller['create']);router[_0x9115('0xf')](_0x9115('0xc'),auth['isAuthenticated'](),controller[_0x9115('0x10')]);router[_0x9115('0x11')]('/:id',auth['isAuthenticated'](),controller[_0x9115('0x12')]);module[_0x9115('0x13')]=router; \ No newline at end of file diff --git a/server/api/chatTransferReport/chatTransferReport.attributes.js b/server/api/chatTransferReport/chatTransferReport.attributes.js index 8d4929f..9686d7e 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 _0x34e8=['queue','DATE','NOW','moment','sequelize','exports','STRING','account','agent'];(function(_0x18b4d3,_0x1cc71){var _0x665332=function(_0x27e3d9){while(--_0x27e3d9){_0x18b4d3['push'](_0x18b4d3['shift']());}};_0x665332(++_0x1cc71);}(_0x34e8,0x12c));var _0x834e=function(_0x2e7574,_0x32c435){_0x2e7574=_0x2e7574-0x0;var _0x4d78b6=_0x34e8[_0x2e7574];return _0x4d78b6;};'use strict';var moment=require(_0x834e('0x0'));var Sequelize=require(_0x834e('0x1'));module[_0x834e('0x2')]={'uniqueid':{'type':Sequelize[_0x834e('0x3')],'allowNull':![]},'type':{'type':Sequelize['ENUM'](_0x834e('0x4'),_0x834e('0x5'),_0x834e('0x6')),'allowNull':![],'defaultValue':_0x834e('0x6')},'transferredAt':{'type':Sequelize[_0x834e('0x7')],'allowNull':![],'defaultValue':Sequelize[_0x834e('0x8')]}}; \ No newline at end of file +var _0x9c44=['ENUM','account','agent','queue','NOW','exports','STRING'];(function(_0x29cf89,_0x10ce1f){var _0x34ac61=function(_0x5b29c2){while(--_0x5b29c2){_0x29cf89['push'](_0x29cf89['shift']());}};_0x34ac61(++_0x10ce1f);}(_0x9c44,0x178));var _0x49c4=function(_0x1035c1,_0x2d8583){_0x1035c1=_0x1035c1-0x0;var _0x308d67=_0x9c44[_0x1035c1];return _0x308d67;};'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/chatTransferReport/chatTransferReport.controller.js b/server/api/chatTransferReport/chatTransferReport.controller.js index ce56b5e..c128927 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 _0x173c=['then','error','name','send','index','ChatTransferReport','rawAttributes','key','map','query','keys','intersection','attributes','model','fields','length','order','sort','where','filters','pick','filter','merge','type','VIRTUAL','options','include','findAll','catch','show','includeAll','find','create','body','params','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','util','path','sox','to-csv','lodash','squel','jsforce','desk.js','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','sendStatus','end','status','offset','undefined','count','limit','set','Content-Range','apply','reject','save','update','destroy'];(function(_0x203dca,_0x306207){var _0x50965f=function(_0x25264c){while(--_0x25264c){_0x203dca['push'](_0x203dca['shift']());}};_0x50965f(++_0x306207);}(_0x173c,0xf2));var _0xc173=function(_0xa38202,_0xbdbc76){_0xa38202=_0xa38202-0x0;var _0x14bbbe=_0x173c[_0xa38202];return _0x14bbbe;};'use strict';var emlformat=require(_0xc173('0x0'));var rimraf=require(_0xc173('0x1'));var zipdir=require(_0xc173('0x2'));var jsonpatch=require(_0xc173('0x3'));var rp=require(_0xc173('0x4'));var moment=require(_0xc173('0x5'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0xc173('0x6'));var path=require(_0xc173('0x7'));var sox=require(_0xc173('0x8'));var csv=require(_0xc173('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xc173('0xa'));var squel=require(_0xc173('0xb'));var crypto=require('crypto');var jsforce=require(_0xc173('0xc'));var deskjs=require(_0xc173('0xd'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require('papaparse');var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0xc173('0xe'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xc173('0xf'));var logger=require(_0xc173('0x10'))(_0xc173('0x11'));var utils=require('../../config/utils');var config=require(_0xc173('0x12'));var licenseUtil=require(_0xc173('0x13'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x1fa88d,_0x46508b){_0x46508b=_0x46508b||0xcc;return function(_0x42478f){if(_0x42478f){return _0x1fa88d[_0xc173('0x14')](_0x46508b);}return _0x1fa88d['status'](_0x46508b)[_0xc173('0x15')]();};}function respondWithResult(_0x16c0c1,_0xdd68a1){_0xdd68a1=_0xdd68a1||0xc8;return function(_0x4b93cb){if(_0x4b93cb){return _0x16c0c1[_0xc173('0x16')](_0xdd68a1)['json'](_0x4b93cb);}};}function respondWithFilteredResult(_0x2b30a9,_0x35dd76){return function(_0x5f10be){if(_0x5f10be){var _0x242654=typeof _0x35dd76[_0xc173('0x17')]==='undefined'&&typeof _0x35dd76['limit']===_0xc173('0x18');var _0x346a06=_0x5f10be[_0xc173('0x19')];var _0xef9457=_0x242654?0x0:_0x35dd76['offset'];var _0x90fa04=_0x242654?_0x5f10be[_0xc173('0x19')]:_0x35dd76[_0xc173('0x17')]+_0x35dd76[_0xc173('0x1a')];var _0x4b95bd;if(_0x90fa04>=_0x346a06){_0x90fa04=_0x346a06;_0x4b95bd=0xc8;}else{_0x4b95bd=0xce;}_0x2b30a9['status'](_0x4b95bd);return _0x2b30a9[_0xc173('0x1b')](_0xc173('0x1c'),_0xef9457+'-'+_0x90fa04+'/'+_0x346a06)['json'](_0x5f10be);}return null;};}function patchUpdates(_0xdca518){return function(_0x522c0a){try{jsonpatch[_0xc173('0x1d')](_0x522c0a,_0xdca518,!![]);}catch(_0x273395){return BPromise[_0xc173('0x1e')](_0x273395);}return _0x522c0a[_0xc173('0x1f')]();};}function saveUpdates(_0x4100ee,_0x167bfa){return function(_0x27bd26){if(_0x27bd26){return _0x27bd26[_0xc173('0x20')](_0x4100ee)['then'](function(_0x32092f){return _0x32092f;});}return null;};}function removeEntity(_0x3db74a,_0x162b3d){return function(_0x726143){if(_0x726143){return _0x726143[_0xc173('0x21')]()[_0xc173('0x22')](function(){_0x3db74a[_0xc173('0x16')](0xcc)[_0xc173('0x15')]();});}};}function handleEntityNotFound(_0x26fa07,_0xabcd70){return function(_0x830a55){if(!_0x830a55){_0x26fa07[_0xc173('0x14')](0x194);}return _0x830a55;};}function handleError(_0x1f090d,_0x19322b){_0x19322b=_0x19322b||0x1f4;return function(_0x423b00){logger[_0xc173('0x23')](_0x423b00['stack']);if(_0x423b00[_0xc173('0x24')]){delete _0x423b00[_0xc173('0x24')];}_0x1f090d[_0xc173('0x16')](_0x19322b)[_0xc173('0x25')](_0x423b00);};}exports[_0xc173('0x26')]=function(_0x2967c4,_0x21c74f){var _0x58f2e6={},_0x4be7d7={},_0x287074={'count':0x0,'rows':[]};var _0x5b3657=_['map'](db[_0xc173('0x27')][_0xc173('0x28')],function(_0x5985f8){return{'name':_0x5985f8['fieldName'],'type':_0x5985f8['type'][_0xc173('0x29')]};});_0x4be7d7['model']=_[_0xc173('0x2a')](_0x5b3657,'name');_0x4be7d7[_0xc173('0x2b')]=_[_0xc173('0x2c')](_0x2967c4['query']);_0x4be7d7['filters']=_[_0xc173('0x2d')](_0x4be7d7['model'],_0x4be7d7['query']);_0x58f2e6[_0xc173('0x2e')]=_[_0xc173('0x2d')](_0x4be7d7[_0xc173('0x2f')],qs[_0xc173('0x30')](_0x2967c4[_0xc173('0x2b')][_0xc173('0x30')]));_0x58f2e6[_0xc173('0x2e')]=_0x58f2e6[_0xc173('0x2e')][_0xc173('0x31')]?_0x58f2e6[_0xc173('0x2e')]:_0x4be7d7['model'];if(!_0x2967c4['query']['hasOwnProperty']('nolimit')){_0x58f2e6['limit']=qs[_0xc173('0x1a')](_0x2967c4['query']['limit']);_0x58f2e6['offset']=qs[_0xc173('0x17')](_0x2967c4[_0xc173('0x2b')][_0xc173('0x17')]);}_0x58f2e6[_0xc173('0x32')]=qs[_0xc173('0x33')](_0x2967c4['query']['sort']);_0x58f2e6[_0xc173('0x34')]=qs[_0xc173('0x35')](_[_0xc173('0x36')](_0x2967c4[_0xc173('0x2b')],_0x4be7d7[_0xc173('0x35')]),_0x5b3657);if(_0x2967c4['query'][_0xc173('0x37')]){_0x58f2e6[_0xc173('0x34')]=_[_0xc173('0x38')](_0x58f2e6[_0xc173('0x34')],{'$or':_[_0xc173('0x2a')](_0x5b3657,function(_0x5765fc){if(_0x5765fc[_0xc173('0x39')]!==_0xc173('0x3a')){var _0x3c1251={};_0x3c1251[_0x5765fc['name']]={'$like':'%'+_0x2967c4[_0xc173('0x2b')][_0xc173('0x37')]+'%'};return _0x3c1251;}})});}_0x58f2e6=_[_0xc173('0x38')]({},_0x58f2e6,_0x2967c4[_0xc173('0x3b')]);var _0x4cd902={'where':_0x58f2e6[_0xc173('0x34')]};return db[_0xc173('0x27')][_0xc173('0x19')](_0x4cd902)[_0xc173('0x22')](function(_0x5527d7){_0x287074[_0xc173('0x19')]=_0x5527d7;if(_0x2967c4[_0xc173('0x2b')]['includeAll']){_0x58f2e6[_0xc173('0x3c')]=[{'all':!![]}];}return db[_0xc173('0x27')][_0xc173('0x3d')](_0x58f2e6);})[_0xc173('0x22')](function(_0xe65d52){_0x287074['rows']=_0xe65d52;return _0x287074;})[_0xc173('0x22')](respondWithFilteredResult(_0x21c74f,_0x58f2e6))[_0xc173('0x3e')](handleError(_0x21c74f,null));};exports[_0xc173('0x3f')]=function(_0x2ba334,_0x12c768){var _0x2f40a6={'raw':!![],'where':{'id':_0x2ba334['params']['id']}},_0x56639a={};_0x56639a[_0xc173('0x2f')]=_[_0xc173('0x2c')](db[_0xc173('0x27')][_0xc173('0x28')]);_0x56639a[_0xc173('0x2b')]=_[_0xc173('0x2c')](_0x2ba334[_0xc173('0x2b')]);_0x56639a['filters']=_[_0xc173('0x2d')](_0x56639a['model'],_0x56639a[_0xc173('0x2b')]);_0x2f40a6['attributes']=_['intersection'](_0x56639a[_0xc173('0x2f')],qs[_0xc173('0x30')](_0x2ba334['query'][_0xc173('0x30')]));_0x2f40a6[_0xc173('0x2e')]=_0x2f40a6['attributes']['length']?_0x2f40a6[_0xc173('0x2e')]:_0x56639a[_0xc173('0x2f')];if(_0x2ba334[_0xc173('0x2b')][_0xc173('0x40')]){_0x2f40a6[_0xc173('0x3c')]=[{'all':!![]}];}_0x2f40a6=_[_0xc173('0x38')]({},_0x2f40a6,_0x2ba334['options']);return db[_0xc173('0x27')][_0xc173('0x41')](_0x2f40a6)['then'](handleEntityNotFound(_0x12c768,null))[_0xc173('0x22')](respondWithResult(_0x12c768,null))[_0xc173('0x3e')](handleError(_0x12c768,null));};exports[_0xc173('0x42')]=function(_0x2fa315,_0x136318){return db['ChatTransferReport']['create'](_0x2fa315[_0xc173('0x43')],{})[_0xc173('0x22')](respondWithResult(_0x136318,0xc9))[_0xc173('0x3e')](handleError(_0x136318,null));};exports[_0xc173('0x20')]=function(_0x25c62a,_0x437700){if(_0x25c62a[_0xc173('0x43')]['id']){delete _0x25c62a['body']['id'];}return db[_0xc173('0x27')]['find']({'where':{'id':_0x25c62a[_0xc173('0x44')]['id']}})[_0xc173('0x22')](handleEntityNotFound(_0x437700,null))[_0xc173('0x22')](saveUpdates(_0x25c62a[_0xc173('0x43')],null))[_0xc173('0x22')](respondWithResult(_0x437700,null))['catch'](handleError(_0x437700,null));};exports[_0xc173('0x21')]=function(_0x4bd68d,_0x372ffe){return db[_0xc173('0x27')]['find']({'where':{'id':_0x4bd68d[_0xc173('0x44')]['id']}})[_0xc173('0x22')](handleEntityNotFound(_0x372ffe,null))[_0xc173('0x22')](removeEntity(_0x372ffe,null))[_0xc173('0x3e')](handleError(_0x372ffe,null));};exports['describe']=function(_0x10911c,_0x12a383){return db['ChatTransferReport']['describe']()[_0xc173('0x22')](respondWithResult(_0x12a383,null))['catch'](handleError(_0x12a383,null));}; \ No newline at end of file +var _0x0fbc=['length','hasOwnProperty','nolimit','order','sort','where','filters','merge','VIRTUAL','options','ChatTransferReport','include','findAll','rows','catch','show','params','fields','includeAll','find','create','body','describe','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','sendStatus','status','end','json','offset','limit','count','set','Content-Range','update','destroy','then','stack','name','send','map','rawAttributes','model','query','keys','intersection','attributes'];(function(_0x11155f,_0x57b687){var _0xd07e48=function(_0x592615){while(--_0x592615){_0x11155f['push'](_0x11155f['shift']());}};_0xd07e48(++_0x57b687);}(_0x0fbc,0x9f));var _0xc0fb=function(_0x736eb,_0x345088){_0x736eb=_0x736eb-0x0;var _0x30ea13=_0x0fbc[_0x736eb];return _0x30ea13;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0xc0fb('0x0'));var rp=require(_0xc0fb('0x1'));var moment=require(_0xc0fb('0x2'));var BPromise=require(_0xc0fb('0x3'));var Mustache=require(_0xc0fb('0x4'));var util=require(_0xc0fb('0x5'));var path=require(_0xc0fb('0x6'));var sox=require(_0xc0fb('0x7'));var csv=require(_0xc0fb('0x8'));var ejs=require(_0xc0fb('0x9'));var fs=require('fs');var fs_extra=require(_0xc0fb('0xa'));var _=require(_0xc0fb('0xb'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0xc0fb('0xc'));var deskjs=require(_0xc0fb('0xd'));var toCsv=require(_0xc0fb('0x8'));var querystring=require(_0xc0fb('0xe'));var Papa=require(_0xc0fb('0xf'));var Redis=require('ioredis');var authService=require(_0xc0fb('0x10'));var qs=require(_0xc0fb('0x11'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xc0fb('0x12'));var logger=require(_0xc0fb('0x13'))(_0xc0fb('0x14'));var utils=require(_0xc0fb('0x15'));var config=require(_0xc0fb('0x16'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x1dc17b,_0x40a685){_0x40a685=_0x40a685||0xcc;return function(_0x214895){if(_0x214895){return _0x1dc17b[_0xc0fb('0x17')](_0x40a685);}return _0x1dc17b[_0xc0fb('0x18')](_0x40a685)[_0xc0fb('0x19')]();};}function respondWithResult(_0x1ef4af,_0x510837){_0x510837=_0x510837||0xc8;return function(_0x3b1ad8){if(_0x3b1ad8){return _0x1ef4af[_0xc0fb('0x18')](_0x510837)[_0xc0fb('0x1a')](_0x3b1ad8);}};}function respondWithFilteredResult(_0x1bc117,_0x4de262){return function(_0xd55e17){if(_0xd55e17){var _0x2afa1c=typeof _0x4de262[_0xc0fb('0x1b')]==='undefined'&&typeof _0x4de262[_0xc0fb('0x1c')]==='undefined';var _0x387222=_0xd55e17['count'];var _0x4130bd=_0x2afa1c?0x0:_0x4de262['offset'];var _0x152c8a=_0x2afa1c?_0xd55e17[_0xc0fb('0x1d')]:_0x4de262['offset']+_0x4de262['limit'];var _0x4a9693;if(_0x152c8a>=_0x387222){_0x152c8a=_0x387222;_0x4a9693=0xc8;}else{_0x4a9693=0xce;}_0x1bc117[_0xc0fb('0x18')](_0x4a9693);return _0x1bc117[_0xc0fb('0x1e')](_0xc0fb('0x1f'),_0x4130bd+'-'+_0x152c8a+'/'+_0x387222)[_0xc0fb('0x1a')](_0xd55e17);}return null;};}function patchUpdates(_0x24dd02){return function(_0x3eabc1){try{jsonpatch['apply'](_0x3eabc1,_0x24dd02,!![]);}catch(_0x31413a){return BPromise['reject'](_0x31413a);}return _0x3eabc1['save']();};}function saveUpdates(_0x2d1972,_0x352424){return function(_0x9c3e5a){if(_0x9c3e5a){return _0x9c3e5a[_0xc0fb('0x20')](_0x2d1972)['then'](function(_0x42c309){return _0x42c309;});}return null;};}function removeEntity(_0x3d340b,_0x302118){return function(_0x5527ac){if(_0x5527ac){return _0x5527ac[_0xc0fb('0x21')]()[_0xc0fb('0x22')](function(){_0x3d340b[_0xc0fb('0x18')](0xcc)[_0xc0fb('0x19')]();});}};}function handleEntityNotFound(_0x4a4521,_0x47f77a){return function(_0x4c38a4){if(!_0x4c38a4){_0x4a4521['sendStatus'](0x194);}return _0x4c38a4;};}function handleError(_0x454ce9,_0x425040){_0x425040=_0x425040||0x1f4;return function(_0x46e781){logger['error'](_0x46e781[_0xc0fb('0x23')]);if(_0x46e781[_0xc0fb('0x24')]){delete _0x46e781['name'];}_0x454ce9[_0xc0fb('0x18')](_0x425040)[_0xc0fb('0x25')](_0x46e781);};}exports['index']=function(_0x1fde53,_0x18c003){var _0x325cf4={},_0x5a5d23={},_0x5f2502={'count':0x0,'rows':[]};var _0x35ef94=_[_0xc0fb('0x26')](db['ChatTransferReport'][_0xc0fb('0x27')],function(_0x27fe03){return{'name':_0x27fe03['fieldName'],'type':_0x27fe03['type']['key']};});_0x5a5d23[_0xc0fb('0x28')]=_[_0xc0fb('0x26')](_0x35ef94,_0xc0fb('0x24'));_0x5a5d23[_0xc0fb('0x29')]=_[_0xc0fb('0x2a')](_0x1fde53[_0xc0fb('0x29')]);_0x5a5d23['filters']=_[_0xc0fb('0x2b')](_0x5a5d23['model'],_0x5a5d23[_0xc0fb('0x29')]);_0x325cf4[_0xc0fb('0x2c')]=_['intersection'](_0x5a5d23['model'],qs['fields'](_0x1fde53['query']['fields']));_0x325cf4[_0xc0fb('0x2c')]=_0x325cf4[_0xc0fb('0x2c')][_0xc0fb('0x2d')]?_0x325cf4[_0xc0fb('0x2c')]:_0x5a5d23[_0xc0fb('0x28')];if(!_0x1fde53[_0xc0fb('0x29')][_0xc0fb('0x2e')](_0xc0fb('0x2f'))){_0x325cf4[_0xc0fb('0x1c')]=qs['limit'](_0x1fde53[_0xc0fb('0x29')][_0xc0fb('0x1c')]);_0x325cf4['offset']=qs['offset'](_0x1fde53['query']['offset']);}_0x325cf4[_0xc0fb('0x30')]=qs[_0xc0fb('0x31')](_0x1fde53['query'][_0xc0fb('0x31')]);_0x325cf4[_0xc0fb('0x32')]=qs[_0xc0fb('0x33')](_['pick'](_0x1fde53[_0xc0fb('0x29')],_0x5a5d23[_0xc0fb('0x33')]),_0x35ef94);if(_0x1fde53[_0xc0fb('0x29')]['filter']){_0x325cf4['where']=_[_0xc0fb('0x34')](_0x325cf4[_0xc0fb('0x32')],{'$or':_[_0xc0fb('0x26')](_0x35ef94,function(_0xda9779){if(_0xda9779['type']!==_0xc0fb('0x35')){var _0xc15c13={};_0xc15c13[_0xda9779[_0xc0fb('0x24')]]={'$like':'%'+_0x1fde53[_0xc0fb('0x29')]['filter']+'%'};return _0xc15c13;}})});}_0x325cf4=_[_0xc0fb('0x34')]({},_0x325cf4,_0x1fde53[_0xc0fb('0x36')]);var _0x299101={'where':_0x325cf4[_0xc0fb('0x32')]};return db[_0xc0fb('0x37')][_0xc0fb('0x1d')](_0x299101)[_0xc0fb('0x22')](function(_0x9e8ab5){_0x5f2502[_0xc0fb('0x1d')]=_0x9e8ab5;if(_0x1fde53[_0xc0fb('0x29')]['includeAll']){_0x325cf4[_0xc0fb('0x38')]=[{'all':!![]}];}return db[_0xc0fb('0x37')][_0xc0fb('0x39')](_0x325cf4);})[_0xc0fb('0x22')](function(_0x15c3ac){_0x5f2502[_0xc0fb('0x3a')]=_0x15c3ac;return _0x5f2502;})[_0xc0fb('0x22')](respondWithFilteredResult(_0x18c003,_0x325cf4))[_0xc0fb('0x3b')](handleError(_0x18c003,null));};exports[_0xc0fb('0x3c')]=function(_0x5b5ede,_0x5ed983){var _0xeda33a={'raw':!![],'where':{'id':_0x5b5ede[_0xc0fb('0x3d')]['id']}},_0x5e8543={};_0x5e8543[_0xc0fb('0x28')]=_[_0xc0fb('0x2a')](db[_0xc0fb('0x37')][_0xc0fb('0x27')]);_0x5e8543[_0xc0fb('0x29')]=_[_0xc0fb('0x2a')](_0x5b5ede['query']);_0x5e8543[_0xc0fb('0x33')]=_[_0xc0fb('0x2b')](_0x5e8543['model'],_0x5e8543[_0xc0fb('0x29')]);_0xeda33a[_0xc0fb('0x2c')]=_[_0xc0fb('0x2b')](_0x5e8543[_0xc0fb('0x28')],qs[_0xc0fb('0x3e')](_0x5b5ede['query'][_0xc0fb('0x3e')]));_0xeda33a[_0xc0fb('0x2c')]=_0xeda33a['attributes'][_0xc0fb('0x2d')]?_0xeda33a['attributes']:_0x5e8543['model'];if(_0x5b5ede['query'][_0xc0fb('0x3f')]){_0xeda33a[_0xc0fb('0x38')]=[{'all':!![]}];}_0xeda33a=_[_0xc0fb('0x34')]({},_0xeda33a,_0x5b5ede[_0xc0fb('0x36')]);return db[_0xc0fb('0x37')][_0xc0fb('0x40')](_0xeda33a)[_0xc0fb('0x22')](handleEntityNotFound(_0x5ed983,null))[_0xc0fb('0x22')](respondWithResult(_0x5ed983,null))[_0xc0fb('0x3b')](handleError(_0x5ed983,null));};exports[_0xc0fb('0x41')]=function(_0x18f58f,_0x5ca259){return db[_0xc0fb('0x37')][_0xc0fb('0x41')](_0x18f58f[_0xc0fb('0x42')],{})[_0xc0fb('0x22')](respondWithResult(_0x5ca259,0xc9))[_0xc0fb('0x3b')](handleError(_0x5ca259,null));};exports[_0xc0fb('0x20')]=function(_0xdc4068,_0x3ac632){if(_0xdc4068['body']['id']){delete _0xdc4068['body']['id'];}return db[_0xc0fb('0x37')][_0xc0fb('0x40')]({'where':{'id':_0xdc4068[_0xc0fb('0x3d')]['id']}})[_0xc0fb('0x22')](handleEntityNotFound(_0x3ac632,null))[_0xc0fb('0x22')](saveUpdates(_0xdc4068[_0xc0fb('0x42')],null))['then'](respondWithResult(_0x3ac632,null))[_0xc0fb('0x3b')](handleError(_0x3ac632,null));};exports[_0xc0fb('0x21')]=function(_0x159e43,_0xe7cb93){return db['ChatTransferReport']['find']({'where':{'id':_0x159e43[_0xc0fb('0x3d')]['id']}})['then'](handleEntityNotFound(_0xe7cb93,null))['then'](removeEntity(_0xe7cb93,null))[_0xc0fb('0x3b')](handleError(_0xe7cb93,null));};exports[_0xc0fb('0x43')]=function(_0x16d1e8,_0x5dfd5b){return db[_0xc0fb('0x37')][_0xc0fb('0x43')]()['then'](respondWithResult(_0x5dfd5b,null))[_0xc0fb('0x3b')](handleError(_0x5dfd5b,null));}; \ No newline at end of file diff --git a/server/api/chatTransferReport/chatTransferReport.model.js b/server/api/chatTransferReport/chatTransferReport.model.js index cd616ff..c2f0648 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 _0x1739=['lodash','util','../../config/logger','bluebird','path','rimraf','../../config/environment','define','ChatTransferReport','report_chat_transfer','uniqueid'];(function(_0x501510,_0x61caa9){var _0x1e6ee5=function(_0x32845b){while(--_0x32845b){_0x501510['push'](_0x501510['shift']());}};_0x1e6ee5(++_0x61caa9);}(_0x1739,0x1ad));var _0x9173=function(_0x25e281,_0x8e0974){_0x25e281=_0x25e281-0x0;var _0x38457d=_0x1739[_0x25e281];return _0x38457d;};'use strict';var _=require(_0x9173('0x0'));var util=require(_0x9173('0x1'));var logger=require(_0x9173('0x2'))('api');var moment=require('moment');var BPromise=require(_0x9173('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x9173('0x4'));var rimraf=require(_0x9173('0x5'));var config=require(_0x9173('0x6'));var attributes=require('./chatTransferReport.attributes');module['exports']=function(_0x42baee,_0x1eac26){return _0x42baee[_0x9173('0x7')](_0x9173('0x8'),attributes,{'tableName':_0x9173('0x9'),'paranoid':![],'indexes':[{'name':_0x9173('0xa'),'fields':['uniqueid']}],'timestamps':!![]});}; \ No newline at end of file +var _0xa99f=['exports','define','ChatTransferReport','report_chat_transfer','uniqueid','lodash','api','moment','request-promise','path','rimraf'];(function(_0x55fc43,_0x1b3456){var _0x4dbc18=function(_0x4e1ab8){while(--_0x4e1ab8){_0x55fc43['push'](_0x55fc43['shift']());}};_0x4dbc18(++_0x1b3456);}(_0xa99f,0x68));var _0xfa99=function(_0x44eac7,_0x4485f6){_0x44eac7=_0x44eac7-0x0;var _0x580104=_0xa99f[_0x44eac7];return _0x580104;};'use strict';var _=require(_0xfa99('0x0'));var util=require('util');var logger=require('../../config/logger')(_0xfa99('0x1'));var moment=require(_0xfa99('0x2'));var BPromise=require('bluebird');var rp=require(_0xfa99('0x3'));var fs=require('fs');var path=require(_0xfa99('0x4'));var rimraf=require(_0xfa99('0x5'));var config=require('../../config/environment');var attributes=require('./chatTransferReport.attributes');module[_0xfa99('0x6')]=function(_0x22cac7,_0x238c05){return _0x22cac7[_0xfa99('0x7')](_0xfa99('0x8'),attributes,{'tableName':_0xfa99('0x9'),'paranoid':![],'indexes':[{'name':_0xfa99('0xa'),'fields':[_0xfa99('0xa')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/chatTransferReport/chatTransferReport.rpc.js b/server/api/chatTransferReport/chatTransferReport.rpc.js index 5d31152..886d33b 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 _0x0841=['ChatTransferReport,\x20%s,\x20%s,\x20%s','stringify','error','code','ChatTransferReport,\x20%s,\x20%s','message','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','client','http','then','info','request\x20sent','debug'];(function(_0x10d4e8,_0x296816){var _0x87ed99=function(_0x10eea3){while(--_0x10eea3){_0x10d4e8['push'](_0x10d4e8['shift']());}};_0x87ed99(++_0x296816);}(_0x0841,0x1d4));var _0x1084=function(_0x5d4b62,_0x37771c){_0x5d4b62=_0x5d4b62-0x0;var _0x488b98=_0x0841[_0x5d4b62];return _0x488b98;};'use strict';var _=require(_0x1084('0x0'));var util=require(_0x1084('0x1'));var moment=require(_0x1084('0x2'));var BPromise=require(_0x1084('0x3'));var rs=require(_0x1084('0x4'));var fs=require('fs');var Redis=require(_0x1084('0x5'));var db=require(_0x1084('0x6'))['db'];var utils=require('../../config/utils');var logger=require(_0x1084('0x7'))(_0x1084('0x8'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x1084('0x9')][_0x1084('0xa')]({'port':0x232a});function respondWithRpcPromise(_0xeb35e8,_0x51a00c,_0x120b5c){return new BPromise(function(_0x3a525d,_0x3b7f57){return client['request'](_0xeb35e8,_0x120b5c)[_0x1084('0xb')](function(_0x548442){logger[_0x1084('0xc')]('ChatTransferReport,\x20%s,\x20%s',_0x51a00c,_0x1084('0xd'));logger[_0x1084('0xe')](_0x1084('0xf'),_0x51a00c,_0x1084('0xd'),JSON[_0x1084('0x10')](_0x548442));if(_0x548442[_0x1084('0x11')]){if(_0x548442[_0x1084('0x11')][_0x1084('0x12')]===0x1f4){logger[_0x1084('0x11')](_0x1084('0x13'),_0x51a00c,_0x548442[_0x1084('0x11')]['message']);return _0x3b7f57(_0x548442[_0x1084('0x11')][_0x1084('0x14')]);}logger['error'](_0x1084('0x13'),_0x51a00c,_0x548442['error']['message']);return _0x3a525d(_0x548442[_0x1084('0x11')]['message']);}else{logger[_0x1084('0xc')](_0x1084('0x13'),_0x51a00c,_0x1084('0xd'));_0x3a525d(_0x548442[_0x1084('0x15')][_0x1084('0x14')]);}})[_0x1084('0x16')](function(_0xd69ddc){logger[_0x1084('0x11')](_0x1084('0x13'),_0x51a00c,_0xd69ddc);_0x3b7f57(_0xd69ddc);});});} \ No newline at end of file +var _0xecac=['ChatTransferReport,\x20%s,\x20%s,\x20%s','stringify','error','message','request\x20sent','result','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','rpc','../../config/environment','client','http','then','info','ChatTransferReport,\x20%s,\x20%s','debug'];(function(_0x43d0fa,_0x3250a5){var _0xbcf70d=function(_0x7fd3ec){while(--_0x7fd3ec){_0x43d0fa['push'](_0x43d0fa['shift']());}};_0xbcf70d(++_0x3250a5);}(_0xecac,0x10a));var _0xceca=function(_0x199f46,_0x1dd2c0){_0x199f46=_0x199f46-0x0;var _0x3c5a31=_0xecac[_0x199f46];return _0x3c5a31;};'use strict';var _=require('lodash');var util=require(_0xceca('0x0'));var moment=require(_0xceca('0x1'));var BPromise=require(_0xceca('0x2'));var rs=require(_0xceca('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xceca('0x4'))['db'];var utils=require(_0xceca('0x5'));var logger=require('../../config/logger')(_0xceca('0x6'));var config=require(_0xceca('0x7'));var jayson=require('jayson/promise');var client=jayson[_0xceca('0x8')][_0xceca('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x248678,_0x2925c0,_0x50da2b){return new BPromise(function(_0x3fa5d5,_0x52c1ce){return client['request'](_0x248678,_0x50da2b)[_0xceca('0xa')](function(_0xa80e0e){logger[_0xceca('0xb')](_0xceca('0xc'),_0x2925c0,'request\x20sent');logger[_0xceca('0xd')](_0xceca('0xe'),_0x2925c0,'request\x20sent',JSON[_0xceca('0xf')](_0xa80e0e));if(_0xa80e0e[_0xceca('0x10')]){if(_0xa80e0e[_0xceca('0x10')]['code']===0x1f4){logger[_0xceca('0x10')]('ChatTransferReport,\x20%s,\x20%s',_0x2925c0,_0xa80e0e['error']['message']);return _0x52c1ce(_0xa80e0e[_0xceca('0x10')]['message']);}logger['error'](_0xceca('0xc'),_0x2925c0,_0xa80e0e[_0xceca('0x10')][_0xceca('0x11')]);return _0x3fa5d5(_0xa80e0e['error'][_0xceca('0x11')]);}else{logger['info']('ChatTransferReport,\x20%s,\x20%s',_0x2925c0,_0xceca('0x12'));_0x3fa5d5(_0xa80e0e[_0xceca('0x13')][_0xceca('0x11')]);}})['catch'](function(_0x51b7e4){logger[_0xceca('0x10')](_0xceca('0xc'),_0x2925c0,_0x51b7e4);_0x52c1ce(_0x51b7e4);});});} \ No newline at end of file diff --git a/server/api/chatTransferReport/index.js b/server/api/chatTransferReport/index.js index 3ef0d1e..a34d6ea 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 _0xaa43=['post','create','put','delete','multer','util','path','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./chatTransferReport.controller','get','isAuthenticated','index','/describe','/:id'];(function(_0x122ef9,_0x451d2a){var _0x42fba0=function(_0x17c9d3){while(--_0x17c9d3){_0x122ef9['push'](_0x122ef9['shift']());}};_0x42fba0(++_0x451d2a);}(_0xaa43,0x147));var _0x3aa4=function(_0x55d5d0,_0x535f2f){_0x55d5d0=_0x55d5d0-0x0;var _0x45ee76=_0xaa43[_0x55d5d0];return _0x45ee76;};'use strict';var multer=require(_0x3aa4('0x0'));var util=require(_0x3aa4('0x1'));var path=require(_0x3aa4('0x2'));var timeout=require('connect-timeout');var express=require(_0x3aa4('0x3'));var router=express[_0x3aa4('0x4')]();var fs_extra=require(_0x3aa4('0x5'));var auth=require(_0x3aa4('0x6'));var interaction=require(_0x3aa4('0x7'));var config=require(_0x3aa4('0x8'));var controller=require(_0x3aa4('0x9'));router[_0x3aa4('0xa')]('/',auth[_0x3aa4('0xb')](),controller[_0x3aa4('0xc')]);router[_0x3aa4('0xa')](_0x3aa4('0xd'),auth[_0x3aa4('0xb')](),controller['describe']);router[_0x3aa4('0xa')](_0x3aa4('0xe'),auth[_0x3aa4('0xb')](),controller['show']);router[_0x3aa4('0xf')]('/',auth['isAuthenticated'](),controller[_0x3aa4('0x10')]);router[_0x3aa4('0x11')](_0x3aa4('0xe'),auth[_0x3aa4('0xb')](),controller['update']);router[_0x3aa4('0x12')](_0x3aa4('0xe'),auth[_0x3aa4('0xb')](),controller['destroy']);module['exports']=router; \ No newline at end of file +var _0x2abe=['get','isAuthenticated','index','post','create','put','/:id','update','destroy','exports','multer','util','path','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment'];(function(_0x234ae1,_0x42bdd6){var _0x227ba0=function(_0x1f6531){while(--_0x1f6531){_0x234ae1['push'](_0x234ae1['shift']());}};_0x227ba0(++_0x42bdd6);}(_0x2abe,0x1e5));var _0xe2ab=function(_0x5d2803,_0xf375bd){_0x5d2803=_0x5d2803-0x0;var _0xdcad2c=_0x2abe[_0x5d2803];return _0xdcad2c;};'use strict';var multer=require(_0xe2ab('0x0'));var util=require(_0xe2ab('0x1'));var path=require(_0xe2ab('0x2'));var timeout=require('connect-timeout');var express=require(_0xe2ab('0x3'));var router=express[_0xe2ab('0x4')]();var fs_extra=require(_0xe2ab('0x5'));var auth=require(_0xe2ab('0x6'));var interaction=require(_0xe2ab('0x7'));var config=require(_0xe2ab('0x8'));var controller=require('./chatTransferReport.controller');router[_0xe2ab('0x9')]('/',auth[_0xe2ab('0xa')](),controller[_0xe2ab('0xb')]);router[_0xe2ab('0x9')]('/describe',auth[_0xe2ab('0xa')](),controller['describe']);router[_0xe2ab('0x9')]('/:id',auth[_0xe2ab('0xa')](),controller['show']);router[_0xe2ab('0xc')]('/',auth['isAuthenticated'](),controller[_0xe2ab('0xd')]);router[_0xe2ab('0xe')](_0xe2ab('0xf'),auth[_0xe2ab('0xa')](),controller[_0xe2ab('0x10')]);router['delete'](_0xe2ab('0xf'),auth['isAuthenticated'](),controller[_0xe2ab('0x11')]);module[_0xe2ab('0x12')]=router; \ No newline at end of file diff --git a/server/api/chatWebsite/chatWebsite.attributes.js b/server/api/chatWebsite/chatWebsite.attributes.js index 0ecda53..48d0a60 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 _0xe34d=['getDataValue','onlineForm','parse','setDataValue','stringify','Comments','Leave\x20your\x20comments','offlineForm','generate','All\x20of\x20our\x20agents\x20are\x20busy\x20at\x20this\x20time.\x20Your\x20chat\x20is\x20very\x20important\x20to\x20us.','Please\x20hold\x20and\x20we\x20will\x20answer\x20your\x20request\x20as\x20soon\x20as\x20possible.','New\x20offline\x20message\x20from\x20websiteName','You\x20received\x20a\x20new\x20offline\x20message\x20from\x20websiteName.\x20Here\x20you\x20can\x20find\x20the\x20details\x20of\x20the\x20request:','Account:\x20{{account.name}}
{{#queue}}Queue:\x20{{queue.name}}
{{/queue}}From\x20:\x20{{from}}','website_alias','bottom_right','CHAT','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','email','Agent','#011F6A','#ffffff','ENUM','rounded','squared','We\x20are\x20here!','Chat','Send','Contact\x20us','INTEGER','TEXT','Do\x20you\x20want\x20to\x20close\x20the\x20interaction?','Form\x20properly\x20submitted','Form\x20submission\x20error','Note','Type\x20a\x20message','Skip','BOOLEAN','Feedback','star','thumb','input','name','text'];(function(_0x57b54c,_0x54ce0d){var _0x59cc19=function(_0xa33bc6){while(--_0xa33bc6){_0x57b54c['push'](_0x57b54c['shift']());}};_0x59cc19(++_0x54ce0d);}(_0xe34d,0x7f));var _0xde34=function(_0x51ad6b,_0x3d3f9d){_0x51ad6b=_0x51ad6b-0x0;var _0x18e62d=_0xe34d[_0x51ad6b];return _0x18e62d;};'use strict';var Sequelize=require('sequelize');var rs=require(_0xde34('0x0'));module[_0xde34('0x1')]={'name':{'type':Sequelize[_0xde34('0x2')],'allowNull':![]},'address':{'type':Sequelize['STRING'],'allowNull':![],'unique':'address'},'description':{'type':Sequelize[_0xde34('0x2')]},'mapKey':{'type':Sequelize[_0xde34('0x2')],'defaultValue':_0xde34('0x3')},'mapKeyOffline':{'type':Sequelize[_0xde34('0x2')],'defaultValue':_0xde34('0x3')},'key':{'type':Sequelize[_0xde34('0x2')],'allowNull':![]},'agentAlias':{'type':Sequelize[_0xde34('0x2')],'defaultValue':_0xde34('0x4')},'customerAlias':{'type':Sequelize[_0xde34('0x2')],'defaultValue':'Me'},'color':{'type':Sequelize[_0xde34('0x2')],'allowNull':![],'defaultValue':_0xde34('0x5'),'validate':{'notEmpty':!![]}},'color_button':{'type':Sequelize[_0xde34('0x2')],'allowNull':![],'defaultValue':_0xde34('0x5'),'validate':{'notEmpty':!![]}},'textColor':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':_0xde34('0x6'),'validate':{'notEmpty':!![]}},'textButtonColor':{'type':Sequelize[_0xde34('0x2')],'allowNull':![],'defaultValue':'#ffffff','validate':{'notEmpty':!![]}},'fontSize':{'type':Sequelize['INTEGER'],'defaultValue':0xf},'remote':{'type':Sequelize['STRING']},'animation':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'header_shape':{'type':Sequelize[_0xde34('0x7')](_0xde34('0x8'),_0xde34('0x9')),'defaultValue':_0xde34('0x8')},'header_online':{'type':Sequelize[_0xde34('0x2')],'defaultValue':_0xde34('0xa')},'start_chat_button':{'type':Sequelize['STRING'],'defaultValue':_0xde34('0xb')},'offline_chat_button':{'type':Sequelize[_0xde34('0x2')],'defaultValue':_0xde34('0xc')},'header_offline':{'type':Sequelize['STRING'],'defaultValue':_0xde34('0xd')},'download_transcript':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'timeout':{'type':Sequelize[_0xde34('0xe')],'defaultValue':0x0},'whiteLabel':{'type':Sequelize[_0xde34('0x2')],'defaultValue':'Powered\x20by\x20xCALLY'},'defaultWhiteLabel':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'sitepic':{'type':Sequelize[_0xde34('0xf')]},'closingQuestion':{'type':Sequelize[_0xde34('0x2')],'defaultValue':_0xde34('0x10')},'formSubmitSuccessMessage':{'type':Sequelize[_0xde34('0x2')],'defaultValue':_0xde34('0x11')},'formSubmitFailureMessage':{'type':Sequelize['STRING'],'defaultValue':_0xde34('0x12')},'noteTitle':{'type':Sequelize[_0xde34('0x2')],'defaultValue':_0xde34('0x13')},'placeholderMessage':{'type':Sequelize['STRING'],'defaultValue':_0xde34('0x14')},'closingMessage':{'type':Sequelize['STRING'],'defaultValue':'Thanks\x20you\x20for\x20your\x20time!'},'closingMessageButton':{'type':Sequelize[_0xde34('0x2')],'defaultValue':_0xde34('0xc')},'skipMessageButton':{'type':Sequelize[_0xde34('0x2')],'defaultValue':_0xde34('0x15')},'conditionAgreement':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'enableRating':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'enableFeedback':{'type':Sequelize[_0xde34('0x16')],'defaultValue':![]},'enableSendButton':{'type':Sequelize[_0xde34('0x16')],'defaultValue':![]},'feedbackTitle':{'type':Sequelize[_0xde34('0x2')],'defaultValue':_0xde34('0x17')},'ratingType':{'type':Sequelize[_0xde34('0x7')](_0xde34('0x18'),_0xde34('0x19')),'defaultValue':_0xde34('0x18')},'ratingStarsNumber':{'type':Sequelize[_0xde34('0xe')],'defaultValue':0x5},'onlineForm':{'type':Sequelize[_0xde34('0xf')],'defaultValue':function(){return JSON['stringify']({'items':[{'type':_0xde34('0x1a'),'variable':null,'config':{'placeholder':_0xde34('0x1b'),'type':_0xde34('0x1c'),'required':!![]},'props':{'title':'name','helpText':''}},{'type':_0xde34('0x1a'),'props':{'title':'email','helpText':''},'config':{'required':!![],'placeholder':'email','type':_0xde34('0x3')},'variable':null}],'fromKey':0x1});},'get':function(){return this[_0xde34('0x1d')](_0xde34('0x1e'))?JSON[_0xde34('0x1f')](this[_0xde34('0x1d')](_0xde34('0x1e'))):{};},'set':function(_0x2f60e2){return this[_0xde34('0x20')](_0xde34('0x1e'),JSON[_0xde34('0x21')](_0x2f60e2));}},'offlineForm':{'type':Sequelize['TEXT'],'defaultValue':function(){return JSON['stringify']({'items':[{'type':_0xde34('0x1a'),'props':{'title':'email','helpText':''},'config':{'required':!![],'placeholder':_0xde34('0x3'),'type':_0xde34('0x3')},'variable':null},{'type':'textarea','config':{'placeholder':_0xde34('0x22')},'props':{'title':_0xde34('0x22'),'helpText':_0xde34('0x23')}}],'fromKey':0x0});},'get':function(){return this[_0xde34('0x1d')](_0xde34('0x24'))?JSON[_0xde34('0x1f')](this[_0xde34('0x1d')]('offlineForm')):{};},'set':function(_0x1baae7){return this[_0xde34('0x20')](_0xde34('0x24'),JSON['stringify'](_0x1baae7));}},'token':{'type':Sequelize[_0xde34('0x2')],'defaultValue':function(){return rs[_0xde34('0x25')]();}},'autoclose':{'type':Sequelize[_0xde34('0x16')],'defaultValue':!![]},'enableCustomerWriting':{'type':Sequelize[_0xde34('0x16')],'defaultValue':![]},'forwardTranscript':{'type':Sequelize[_0xde34('0x16')],'defaultValue':![]},'forwardTranscriptMessage':{'type':Sequelize[_0xde34('0x2')]},'forwardOffline':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'forwardOfflineAddress':{'type':Sequelize[_0xde34('0x2')]},'waitingTitle':{'type':Sequelize[_0xde34('0x2')],'defaultValue':_0xde34('0x26')},'waitingMessage':{'type':Sequelize[_0xde34('0x2')],'defaultValue':_0xde34('0x27')},'offlineMessageSubject':{'type':Sequelize[_0xde34('0x2')],'defaultValue':_0xde34('0x28')},'offlineMessageBody':{'type':Sequelize[_0xde34('0x2')],'defaultValue':_0xde34('0x29')},'enableUnmanagedNote':{'type':Sequelize[_0xde34('0x16')],'defaultValue':!![]},'unmanagedMessage':{'type':Sequelize['STRING'],'defaultValue':'Your\x20request\x20has\x20not\x20been\x20processed.'},'skipUnmanaged':{'type':Sequelize[_0xde34('0x2')],'defaultValue':'Skip'},'sendUnmanaged':{'type':Sequelize['STRING'],'defaultValue':_0xde34('0xc')},'enableCustomerAttachment':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'enableCustomerCheckmarks':{'type':Sequelize[_0xde34('0x16')],'defaultValue':![]},'agentAvatar':{'type':Sequelize[_0xde34('0xf')]},'showAgentAvatar':{'type':Sequelize[_0xde34('0x16')],'defaultValue':![]},'timezone':{'type':Sequelize['STRING']},'notificationTemplate':{'type':Sequelize[_0xde34('0xf')],'defaultValue':function(){return _0xde34('0x2a');}},'notificationSound':{'type':Sequelize[_0xde34('0x16')],'defaultValue':!![]},'notificationShake':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'hideWhenOffline':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'agentIdentifier':{'type':Sequelize[_0xde34('0x2')],'defaultValue':_0xde34('0x2b')},'waitForTheAssignedAgent':{'type':Sequelize[_0xde34('0xe')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'waitForTheAssignedQueue':{'type':Sequelize[_0xde34('0xe')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'alignment':{'type':Sequelize[_0xde34('0x2')],'defaultValue':_0xde34('0x2c')},'verticalAlignment':{'type':Sequelize[_0xde34('0xe')],'defaultValue':0x1e},'labelText':{'type':Sequelize[_0xde34('0x2')],'defaultValue':_0xde34('0x2d')},'messagesAlignment':{'type':Sequelize[_0xde34('0x2')],'defaultValue':'alternate'},'defaultTitle':{'type':Sequelize[_0xde34('0x2')]},'customerAvatar':{'type':Sequelize[_0xde34('0xf')]},'showCustomerAvatar':{'type':Sequelize[_0xde34('0x16')],'defaultValue':![]},'messageFontSize':{'type':Sequelize[_0xde34('0xe')],'defaultValue':0xc},'backgroundColor':{'type':Sequelize[_0xde34('0x2')],'allowNull':![],'defaultValue':'#fafafa','validate':{'notEmpty':!![]}},'queueTransfer':{'type':Sequelize[_0xde34('0x16')],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize[_0xde34('0xe')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize[_0xde34('0xe')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'systemAlias':{'type':Sequelize['STRING'],'defaultValue':_0xde34('0x2e')},'systemAvatar':{'type':Sequelize[_0xde34('0xf')]},'mandatoryDispositionPauseId':{'type':Sequelize[_0xde34('0xe')],'comment':_0xde34('0x2f')},'mandatoryDisposition':{'type':Sequelize[_0xde34('0x16')],'defaultValue':![],'comment':'Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','set':function(_0x19152d){if(!_0x19152d)this[_0xde34('0x20')](_0xde34('0x30'),null);this[_0xde34('0x20')](_0xde34('0x31'),_0x19152d);}},'vidaooEscalation':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'vidaooApiKey':{'type':Sequelize[_0xde34('0x2')]},'vidaooTopic':{'type':Sequelize[_0xde34('0x2')],'allowNull':![],'defaultValue':_0xde34('0x32')},'vidaooNote':{'type':Sequelize[_0xde34('0x2')],'defaultValue':function(){return _0xde34('0x33');}},'vidaooMetadata':{'type':Sequelize['TEXT'],'defaultValue':null},'openNewInteraction':{'type':Sequelize[_0xde34('0x16')],'defaultValue':![],'allowNull':!![]},'subjectOffline':{'type':Sequelize['TEXT']}}; \ No newline at end of file +var _0x1809=['Send','Contact\x20us','Powered\x20by\x20xCALLY','TEXT','Do\x20you\x20want\x20to\x20close\x20the\x20interaction?','Form\x20properly\x20submitted','Form\x20submission\x20error','Note','Type\x20a\x20message','Skip','ENUM','star','thumb','stringify','input','name','text','getDataValue','onlineForm','parse','setDataValue','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}}','CHAT','alternate','#fafafa','System','Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','mandatoryDispositionPauseId','mandatoryDisposition','Generated\x20by\x20XCALLY\x20Motion','Meeting\x20generated\x20for\x20interaction\x20#{{interaction.id}}\x20by\x20{{agent.name}}','sequelize','exports','STRING','address','email','Agent','#011F6A','#ffffff','INTEGER','BOOLEAN','rounded','We\x20are\x20here!'];(function(_0x103d03,_0x2f4bfe){var _0x44f909=function(_0x32fffe){while(--_0x32fffe){_0x103d03['push'](_0x103d03['shift']());}};_0x44f909(++_0x2f4bfe);}(_0x1809,0xfd));var _0x9180=function(_0x261bd8,_0x344415){_0x261bd8=_0x261bd8-0x0;var _0x5a1415=_0x1809[_0x261bd8];return _0x5a1415;};'use strict';var Sequelize=require(_0x9180('0x0'));var rs=require('randomstring');module[_0x9180('0x1')]={'name':{'type':Sequelize[_0x9180('0x2')],'allowNull':![]},'address':{'type':Sequelize[_0x9180('0x2')],'allowNull':![],'unique':_0x9180('0x3')},'description':{'type':Sequelize[_0x9180('0x2')]},'mapKey':{'type':Sequelize['STRING'],'defaultValue':_0x9180('0x4')},'mapKeyOffline':{'type':Sequelize[_0x9180('0x2')],'defaultValue':_0x9180('0x4')},'key':{'type':Sequelize[_0x9180('0x2')],'allowNull':![]},'agentAlias':{'type':Sequelize[_0x9180('0x2')],'defaultValue':_0x9180('0x5')},'customerAlias':{'type':Sequelize['STRING'],'defaultValue':'Me'},'color':{'type':Sequelize[_0x9180('0x2')],'allowNull':![],'defaultValue':_0x9180('0x6'),'validate':{'notEmpty':!![]}},'color_button':{'type':Sequelize[_0x9180('0x2')],'allowNull':![],'defaultValue':_0x9180('0x6'),'validate':{'notEmpty':!![]}},'textColor':{'type':Sequelize[_0x9180('0x2')],'allowNull':![],'defaultValue':_0x9180('0x7'),'validate':{'notEmpty':!![]}},'textButtonColor':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':_0x9180('0x7'),'validate':{'notEmpty':!![]}},'fontSize':{'type':Sequelize[_0x9180('0x8')],'defaultValue':0xf},'remote':{'type':Sequelize['STRING']},'animation':{'type':Sequelize[_0x9180('0x9')],'defaultValue':!![]},'header_shape':{'type':Sequelize['ENUM'](_0x9180('0xa'),'squared'),'defaultValue':'rounded'},'header_online':{'type':Sequelize[_0x9180('0x2')],'defaultValue':_0x9180('0xb')},'start_chat_button':{'type':Sequelize['STRING'],'defaultValue':'Chat'},'offline_chat_button':{'type':Sequelize[_0x9180('0x2')],'defaultValue':_0x9180('0xc')},'header_offline':{'type':Sequelize['STRING'],'defaultValue':_0x9180('0xd')},'download_transcript':{'type':Sequelize[_0x9180('0x9')],'defaultValue':!![]},'timeout':{'type':Sequelize[_0x9180('0x8')],'defaultValue':0x0},'whiteLabel':{'type':Sequelize[_0x9180('0x2')],'defaultValue':_0x9180('0xe')},'defaultWhiteLabel':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'sitepic':{'type':Sequelize[_0x9180('0xf')]},'closingQuestion':{'type':Sequelize[_0x9180('0x2')],'defaultValue':_0x9180('0x10')},'formSubmitSuccessMessage':{'type':Sequelize[_0x9180('0x2')],'defaultValue':_0x9180('0x11')},'formSubmitFailureMessage':{'type':Sequelize[_0x9180('0x2')],'defaultValue':_0x9180('0x12')},'noteTitle':{'type':Sequelize[_0x9180('0x2')],'defaultValue':_0x9180('0x13')},'placeholderMessage':{'type':Sequelize[_0x9180('0x2')],'defaultValue':_0x9180('0x14')},'closingMessage':{'type':Sequelize[_0x9180('0x2')],'defaultValue':'Thanks\x20you\x20for\x20your\x20time!'},'closingMessageButton':{'type':Sequelize[_0x9180('0x2')],'defaultValue':_0x9180('0xc')},'skipMessageButton':{'type':Sequelize[_0x9180('0x2')],'defaultValue':_0x9180('0x15')},'conditionAgreement':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'enableRating':{'type':Sequelize[_0x9180('0x9')],'defaultValue':![]},'enableFeedback':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'enableSendButton':{'type':Sequelize[_0x9180('0x9')],'defaultValue':![]},'feedbackTitle':{'type':Sequelize[_0x9180('0x2')],'defaultValue':'Feedback'},'ratingType':{'type':Sequelize[_0x9180('0x16')](_0x9180('0x17'),_0x9180('0x18')),'defaultValue':_0x9180('0x17')},'ratingStarsNumber':{'type':Sequelize[_0x9180('0x8')],'defaultValue':0x5},'onlineForm':{'type':Sequelize[_0x9180('0xf')],'defaultValue':function(){return JSON[_0x9180('0x19')]({'items':[{'type':_0x9180('0x1a'),'variable':null,'config':{'placeholder':_0x9180('0x1b'),'type':_0x9180('0x1c'),'required':!![]},'props':{'title':'name','helpText':''}},{'type':_0x9180('0x1a'),'props':{'title':_0x9180('0x4'),'helpText':''},'config':{'required':!![],'placeholder':_0x9180('0x4'),'type':_0x9180('0x4')},'variable':null}],'fromKey':0x1});},'get':function(){return this[_0x9180('0x1d')](_0x9180('0x1e'))?JSON[_0x9180('0x1f')](this[_0x9180('0x1d')](_0x9180('0x1e'))):{};},'set':function(_0x1c2958){return this[_0x9180('0x20')](_0x9180('0x1e'),JSON[_0x9180('0x19')](_0x1c2958));}},'offlineForm':{'type':Sequelize[_0x9180('0xf')],'defaultValue':function(){return JSON['stringify']({'items':[{'type':_0x9180('0x1a'),'props':{'title':_0x9180('0x4'),'helpText':''},'config':{'required':!![],'placeholder':_0x9180('0x4'),'type':_0x9180('0x4')},'variable':null},{'type':_0x9180('0x21'),'config':{'placeholder':_0x9180('0x22')},'props':{'title':_0x9180('0x22'),'helpText':_0x9180('0x23')}}],'fromKey':0x0});},'get':function(){return this[_0x9180('0x1d')](_0x9180('0x24'))?JSON[_0x9180('0x1f')](this[_0x9180('0x1d')]('offlineForm')):{};},'set':function(_0x74549c){return this[_0x9180('0x20')](_0x9180('0x24'),JSON['stringify'](_0x74549c));}},'token':{'type':Sequelize[_0x9180('0x2')],'defaultValue':function(){return rs[_0x9180('0x25')]();}},'autoclose':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'enableCustomerWriting':{'type':Sequelize[_0x9180('0x9')],'defaultValue':![]},'forwardTranscript':{'type':Sequelize[_0x9180('0x9')],'defaultValue':![]},'forwardTranscriptMessage':{'type':Sequelize['STRING']},'forwardOffline':{'type':Sequelize[_0x9180('0x9')],'defaultValue':![]},'forwardOfflineAddress':{'type':Sequelize['STRING']},'waitingTitle':{'type':Sequelize[_0x9180('0x2')],'defaultValue':_0x9180('0x26')},'waitingMessage':{'type':Sequelize['STRING'],'defaultValue':_0x9180('0x27')},'offlineMessageSubject':{'type':Sequelize['STRING'],'defaultValue':_0x9180('0x28')},'offlineMessageBody':{'type':Sequelize[_0x9180('0x2')],'defaultValue':_0x9180('0x29')},'enableUnmanagedNote':{'type':Sequelize[_0x9180('0x9')],'defaultValue':!![]},'unmanagedMessage':{'type':Sequelize[_0x9180('0x2')],'defaultValue':_0x9180('0x2a')},'skipUnmanaged':{'type':Sequelize[_0x9180('0x2')],'defaultValue':'Skip'},'sendUnmanaged':{'type':Sequelize[_0x9180('0x2')],'defaultValue':_0x9180('0xc')},'enableCustomerAttachment':{'type':Sequelize[_0x9180('0x9')],'defaultValue':![]},'enableCustomerCheckmarks':{'type':Sequelize[_0x9180('0x9')],'defaultValue':![]},'agentAvatar':{'type':Sequelize['TEXT']},'showAgentAvatar':{'type':Sequelize[_0x9180('0x9')],'defaultValue':![]},'timezone':{'type':Sequelize[_0x9180('0x2')]},'notificationTemplate':{'type':Sequelize[_0x9180('0xf')],'defaultValue':function(){return _0x9180('0x2b');}},'notificationSound':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'notificationShake':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'hideWhenOffline':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'agentIdentifier':{'type':Sequelize[_0x9180('0x2')],'defaultValue':'website_alias'},'waitForTheAssignedAgent':{'type':Sequelize[_0x9180('0x8')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'waitForTheAssignedQueue':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'alignment':{'type':Sequelize[_0x9180('0x2')],'defaultValue':'bottom_right'},'verticalAlignment':{'type':Sequelize['INTEGER'],'defaultValue':0x1e},'labelText':{'type':Sequelize[_0x9180('0x2')],'defaultValue':_0x9180('0x2c')},'messagesAlignment':{'type':Sequelize['STRING'],'defaultValue':_0x9180('0x2d')},'defaultTitle':{'type':Sequelize['STRING']},'customerAvatar':{'type':Sequelize[_0x9180('0xf')]},'showCustomerAvatar':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'messageFontSize':{'type':Sequelize['INTEGER'],'defaultValue':0xc},'backgroundColor':{'type':Sequelize[_0x9180('0x2')],'allowNull':![],'defaultValue':_0x9180('0x2e'),'validate':{'notEmpty':!![]}},'queueTransfer':{'type':Sequelize[_0x9180('0x9')],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize[_0x9180('0x8')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize[_0x9180('0x9')],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize[_0x9180('0x8')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'systemAlias':{'type':Sequelize[_0x9180('0x2')],'defaultValue':_0x9180('0x2f')},'systemAvatar':{'type':Sequelize[_0x9180('0xf')]},'mandatoryDispositionPauseId':{'type':Sequelize['INTEGER'],'comment':'Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled'},'mandatoryDisposition':{'type':Sequelize[_0x9180('0x9')],'defaultValue':![],'comment':_0x9180('0x30'),'set':function(_0xe7f3b6){if(!_0xe7f3b6)this[_0x9180('0x20')](_0x9180('0x31'),null);this[_0x9180('0x20')](_0x9180('0x32'),_0xe7f3b6);}},'vidaooEscalation':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'vidaooApiKey':{'type':Sequelize[_0x9180('0x2')]},'vidaooTopic':{'type':Sequelize[_0x9180('0x2')],'allowNull':![],'defaultValue':_0x9180('0x33')},'vidaooNote':{'type':Sequelize[_0x9180('0x2')],'defaultValue':function(){return _0x9180('0x34');}},'vidaooMetadata':{'type':Sequelize[_0x9180('0xf')],'defaultValue':null},'openNewInteraction':{'type':Sequelize[_0x9180('0x9')],'defaultValue':![],'allowNull':!![]},'subjectOffline':{'type':Sequelize['TEXT']}}; \ No newline at end of file diff --git a/server/api/chatWebsite/chatWebsite.controller.js b/server/api/chatWebsite/chatWebsite.controller.js index 7ab53bf..b2e3156 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 _0x1b7e=['query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','merge','VIRTUAL','filter','ChatWebsite','includeAll','findAll','rows','show','params','Pause','options','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','describe','addDisposition','ChatWebsiteId','Disposition','getDispositions','findOne','removeDispositions','ids','addAnswer','CannedAnswer','getAnswers','include','removeAnswers','sitepic','file','addAvatar','agentAvatar','filename','addCustomerAvatar','customerAvatar','addSystemAvatar','systemAvatar','getLogo','join','root','server/files/images/logos/default_logo.svg','../../config/license/util','getLicense','isNil','server/files/images/logos/','download','getAvatar','server/files/images/avatars/','getCustomerAvatar','server/files/images/avatars/customer_avatar.png','showCustomerAvatar','server/files/images/avatars/system_avatar.png','notify','Sequelize','ValidationError','no\x20available\x20attributes','createdAt','updatedAt','difference','CompanyId','from','mapKey','mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','includes','CmList','CmContact','DESC','Applications','Chat\x20Website\x20with\x20id\x20%s\x20not\x20found','spread','List','list','applications','orderBy','priority','asc','account','Contacts','defaults','ListId','threadId','ChatInteraction','ContactId','interaction','contact','messageId','created','autoclose','push','close','unmanaged','*,*,*,*','ChatMessage','UserId','User','agent','waitForTheAssignedAgent','forcedOwnership','ChatQueue','queueId','unshift','queue','Start','startRouting','EventManager','offline','files','from\x20is\x20mandatory','body\x20is\x20mandatory\x20and\x20not\x20empty','mapKeyOffline','mapKeyOffline\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','MailAccount','findOrCreate','readFileSync','server/files/templates/chatOfflineMessage.ejs','utf8','render','toPairs','offlineMessageBody','ChatOfflineMessage','fromString','originalname','mimetype','server','attachments','offline-chat','basename','openNewInteraction','sequelize','transaction','Attachment','MailServerOut','Smtp','CloudProvider','forwardOffline','forwardOfflineAddress','getSmtpOptions','\x22%s\x22\x20<%s>','offlineMessageSubject','MailAccountId','subjectOffline','toPairsIn','mapValues','email','Chat','NotifyMailAccount','notifyMail','Could\x20not\x20remove\x20attachment\x20file','addInteraction','omit','getInteractions','rawAttributes','Contact','Owner','fullname','internal','Tag','color','tag','getProactiveActions','custom','increment','URL','address','3.5.0','remote','headers','x-real-ip','connection','remoteAddress','replace','alignment','verticalAlignment','textColor','textButtonColor','color_button','backgroundColor','IntervalId','addApplications','Transaction','ISOLATION_LEVELS','READ_COMMITTED','ChatApplication','bulkCreate','findAndCountAll','json','getApplications','addProactiveActions','chatProactiveAction','online','false','offlineForm','items','fromKey','getOfflineMessages','Attachments','addAgents','emit','userChatWebsite:save','removeAgents','userChatWebsite:remove','getAgents','mustache','util','ejs','fs-extra','querystring','html-to-text','jayson/promise','../../components/parsers/qs','../../config/logger','api','../../config/environment','../../errors/api','APINotFoundError','handleError','../../mysqldb','redis','localhost','socket.io-emitter','register','client','http','request','then','ChatWebsite,\x20%s,\x20%s','request\x20sent','debug','ChatWebsite,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result','end','offset','undefined','limit','count','set','update','destroy','ChatWebsites','status','sendStatus','stack','name','send','Command','getSnippet','timezone','format','interval','iftime\x20%s','indexOf','true','OFFLINE','No\x20timezone','catch','[%s][INTERVAL][%s]\x20%s\x20%s\x20(%s)','map','Interval','Intervals','get','all','some','setUA','user-agent','getResult','cf-connecting-ip','x-forwarded-for','first','split','firstName','lastName','x-real-port','browser','version','%s\x20%s','unknown','device','model','vendor','type','index','mandatoryDispositionPause','fieldName','key'];(function(_0xa7a45d,_0x425715){var _0x1a098e=function(_0x36ab29){while(--_0x36ab29){_0xa7a45d['push'](_0xa7a45d['shift']());}};_0x1a098e(++_0x425715);}(_0x1b7e,0xdd));var _0xe1b7=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x1b7e[_0x3dd15e];return _0x231fd0;};'use strict';var Mustache=require(_0xe1b7('0x0'));var util=require(_0xe1b7('0x1'));var path=require('path');var ejs=require(_0xe1b7('0x2'));var fs=require('fs');var fs_extra=require(_0xe1b7('0x3'));var _=require('lodash');var querystring=require(_0xe1b7('0x4'));var htmlToText=require(_0xe1b7('0x5'));var Redis=require('ioredis');var jayson=require(_0xe1b7('0x6'));var url=require('url');var qs=require(_0xe1b7('0x7'));var logger=require(_0xe1b7('0x8'))(_0xe1b7('0x9'));var config=require(_0xe1b7('0xa'));var APIOutOfIntervalError=require(_0xe1b7('0xb'))['APIOutOfIntervalError'];var APINotFoundError=require(_0xe1b7('0xb'))[_0xe1b7('0xc')];var APIHandleError=require('../../errors/api')[_0xe1b7('0xd')];var db=require(_0xe1b7('0xe'))['db'];config[_0xe1b7('0xf')]=_['defaults'](config[_0xe1b7('0xf')],{'host':_0xe1b7('0x10'),'port':0x18eb});var socket=require(_0xe1b7('0x11'))(new Redis(config[_0xe1b7('0xf')]));require('./chatWebsite.socket')[_0xe1b7('0x12')](socket);var client=jayson[_0xe1b7('0x13')][_0xe1b7('0x14')]({'port':0x232c});var client9002=jayson[_0xe1b7('0x13')][_0xe1b7('0x14')]({'port':0x232a});var client9003=jayson[_0xe1b7('0x13')]['http']({'port':0x232b});var client9001=jayson[_0xe1b7('0x13')][_0xe1b7('0x14')]({'port':0x2329});function respondWithRpcPromise(_0x1ddfea,_0x2b61a1,_0x539b0d,_0x33a1bc){return new Promise(function(_0x123a20,_0x35efee){var _0x3503de=_0x33a1bc||client;return _0x3503de[_0xe1b7('0x15')](_0x1ddfea,_0x539b0d)[_0xe1b7('0x16')](function(_0x7a7fac){logger['info'](_0xe1b7('0x17'),_0x2b61a1,_0xe1b7('0x18'));logger[_0xe1b7('0x19')](_0xe1b7('0x1a'),_0x2b61a1,'request\x20sent',JSON[_0xe1b7('0x1b')](_0x7a7fac));if(_0x7a7fac['error']){if(_0x7a7fac[_0xe1b7('0x1c')][_0xe1b7('0x1d')]===0x1f4){logger['error'](_0xe1b7('0x17'),_0x2b61a1,_0x7a7fac[_0xe1b7('0x1c')]['message']);return _0x35efee(_0x7a7fac[_0xe1b7('0x1c')][_0xe1b7('0x1e')]);}logger['error'](_0xe1b7('0x17'),_0x2b61a1,_0x7a7fac[_0xe1b7('0x1c')][_0xe1b7('0x1e')]);return _0x123a20(_0x7a7fac['error']['message']);}else{logger[_0xe1b7('0x1f')](_0xe1b7('0x17'),_0x2b61a1,'request\x20sent');_0x123a20(_0x7a7fac[_0xe1b7('0x20')]['message']);}})['catch'](function(_0x40a221){logger[_0xe1b7('0x1c')]('ChatWebsite,\x20%s,\x20%s',_0x2b61a1,_0x40a221);_0x35efee(_0x40a221);});});}function respondWithStatusCode(_0x19d6da,_0x523eed){_0x523eed=_0x523eed||0xcc;return function(_0x44d6db){if(_0x44d6db){return _0x19d6da['sendStatus'](_0x523eed);}return _0x19d6da['status'](_0x523eed)[_0xe1b7('0x21')]();};}function respondWithResult(_0x220470,_0x23aa7f){_0x23aa7f=_0x23aa7f||0xc8;return function(_0x4127ba){if(_0x4127ba){return _0x220470['status'](_0x23aa7f)['json'](_0x4127ba);}};}function respondWithFilteredResult(_0x15e6d5,_0xfabd3){return function(_0x54292e){if(_0x54292e){var _0x16e0f2=typeof _0xfabd3[_0xe1b7('0x22')]===_0xe1b7('0x23')&&typeof _0xfabd3[_0xe1b7('0x24')]==='undefined';var _0x20603d=_0x54292e[_0xe1b7('0x25')];var _0x15023c=_0x16e0f2?0x0:_0xfabd3[_0xe1b7('0x22')];var _0x5b378f=_0x16e0f2?_0x54292e[_0xe1b7('0x25')]:_0xfabd3['offset']+_0xfabd3['limit'];var _0x118249;if(_0x5b378f>=_0x20603d){_0x5b378f=_0x20603d;_0x118249=0xc8;}else{_0x118249=0xce;}_0x15e6d5['status'](_0x118249);return _0x15e6d5[_0xe1b7('0x26')]('Content-Range',_0x15023c+'-'+_0x5b378f+'/'+_0x20603d)['json'](_0x54292e);}return null;};}function saveUpdates(_0x380c02){return function(_0x49a691){if(_0x49a691){return _0x49a691[_0xe1b7('0x27')](_0x380c02)['then'](function(_0x1d9758){return _0x1d9758;});}return null;};}function removeEntity(_0x341a71){return function(_0x2f5dc5){if(_0x2f5dc5){return _0x2f5dc5[_0xe1b7('0x28')]()[_0xe1b7('0x16')](function(){var _0x8f37b=_0x2f5dc5['get']({'plain':!![]});var _0x3047f3=_0xe1b7('0x29');return db['UserProfileResource'][_0xe1b7('0x28')]({'where':{'type':_0x3047f3,'resourceId':_0x8f37b['id']}})['then'](function(){return _0x2f5dc5;});})[_0xe1b7('0x16')](function(){_0x341a71[_0xe1b7('0x2a')](0xcc)[_0xe1b7('0x21')]();});}};}function handleEntityNotFound(_0x307341){return function(_0x23747e){if(!_0x23747e){_0x307341[_0xe1b7('0x2b')](0x194);}return _0x23747e;};}function handleError(_0x14b1b7,_0x5aea70){_0x5aea70=_0x5aea70||0x1f4;return function(_0x1b0e0d){logger[_0xe1b7('0x1c')](_0x1b0e0d[_0xe1b7('0x2c')]);if(_0x1b0e0d[_0xe1b7('0x2d')]){delete _0x1b0e0d[_0xe1b7('0x2d')];}_0x14b1b7['status'](_0x5aea70)[_0xe1b7('0x2e')](_0x1b0e0d);};}function iftimePromise(_0x315a92,_0x30cdbd){return respondWithRpcPromise(_0xe1b7('0x2f'),_0xe1b7('0x30'),{'command':_0x30cdbd[_0xe1b7('0x31')]?util[_0xe1b7('0x32')]('iftime\x20%s,%s',_0x315a92[_0xe1b7('0x33')],_0x30cdbd[_0xe1b7('0x31')]):util['format'](_0xe1b7('0x34'),_0x315a92['interval'])},client9002)[_0xe1b7('0x16')](function(_0x41890e){var _0x3f525e=_0x41890e&&_0x41890e[_0xe1b7('0x35')](_0xe1b7('0x36'))>=0x0?!![]:![];logger['info']('[%s][INTERVAL][%s]\x20%s\x20%s\x20(%s)',_0x30cdbd['id'],_0x315a92['id'],_0x315a92[_0xe1b7('0x33')],_0x3f525e?'ONLINE':_0xe1b7('0x37'),_0x30cdbd[_0xe1b7('0x31')]?_0x30cdbd[_0xe1b7('0x31')]:_0xe1b7('0x38'));return _0x3f525e;})[_0xe1b7('0x39')](function(_0x7bc07c){logger[_0xe1b7('0x1c')](_0xe1b7('0x3a'),_0x30cdbd['id'],_0x315a92['id'],_0x315a92[_0xe1b7('0x33')],util['inspect'](_0x7bc07c,{'showHidden':![],'depth':null}),_0x30cdbd[_0xe1b7('0x31')]?_0x30cdbd[_0xe1b7('0x31')]:_0xe1b7('0x38'));return![];});}function checkWebsiteIntervals(_0x4c34cc){var _0x141aeb=_[_0xe1b7('0x3b')](_0x4c34cc[_0xe1b7('0x3c')][_0xe1b7('0x3d')],function(_0x13d9f6){var _0x452ddc=_0x13d9f6[_0xe1b7('0x3e')]({'plain':!![]});return iftimePromise(_0x452ddc,_0x4c34cc);});return Promise[_0xe1b7('0x3f')](_0x141aeb)[_0xe1b7('0x16')](function(_0x242e7f){return _[_0xe1b7('0x40')](_0x242e7f);});}function createInteractionObject(_0xf14551,_0x481164,_0x513bac,_0x3499d9){var _0x61f05e=require('user-agent-parser');var _0x587d31=new _0x61f05e();var _0x13b942=_0x587d31[_0xe1b7('0x41')](_0x513bac[_0xe1b7('0x42')])[_0xe1b7('0x43')]();var _0x50d745=_0x481164['customerIp'];if(_0x513bac[_0xe1b7('0x44')]){_0x50d745=_0x513bac[_0xe1b7('0x44')];}else if(_0x513bac[_0xe1b7('0x45')]){_0x50d745=_[_0xe1b7('0x46')](_0x513bac[_0xe1b7('0x45')][_0xe1b7('0x47')](','));}return{'ContactId':_0x3499d9['id'],'ChatWebsiteId':_0xf14551,'from':(_0x3499d9[_0xe1b7('0x48')]||'')+'\x20'+(_0x3499d9[_0xe1b7('0x49')]||''),'customerIp':_0x50d745,'customerPort':_0x513bac['x-real-port']?_0x513bac[_0xe1b7('0x4a')]:null,'referer':_0x481164['referer'],'browserName':_0x13b942[_0xe1b7('0x4b')][_0xe1b7('0x2d')]&&_0x13b942['browser'][_0xe1b7('0x4c')]?util[_0xe1b7('0x32')](_0xe1b7('0x4d'),_0x13b942[_0xe1b7('0x4b')]['name'],_0x13b942[_0xe1b7('0x4b')][_0xe1b7('0x4c')]):'unknown','browserVersion':_0x13b942[_0xe1b7('0x4b')][_0xe1b7('0x4c')]||_0xe1b7('0x4e'),'osName':util['format']('%s\x20%s',_0x13b942['os']['name'],_0x13b942['os'][_0xe1b7('0x4c')]),'osVersion':_0x13b942['os'][_0xe1b7('0x4c')],'deviceModel':_0x13b942[_0xe1b7('0x4f')][_0xe1b7('0x50')]&&_0x13b942[_0xe1b7('0x4f')][_0xe1b7('0x51')]?util[_0xe1b7('0x32')]('%s\x20%s\x20%s',_0x13b942['device']['model'],_0x13b942[_0xe1b7('0x4f')][_0xe1b7('0x51')],_0x13b942[_0xe1b7('0x4f')]['type']):null,'deviceVendor':_0x13b942[_0xe1b7('0x4f')][_0xe1b7('0x51')],'deviceType':_0x13b942[_0xe1b7('0x4f')][_0xe1b7('0x52')],'formData':JSON[_0xe1b7('0x1b')](_0x481164)};}exports[_0xe1b7('0x53')]=function(_0x454a81,_0x48a814){var _0x59ad47={'include':[{'model':db['Pause'],'as':_0xe1b7('0x54')}]},_0x390474={},_0x11622e={'count':0x0,'rows':[]};var _0x8bff73=_['map'](db['ChatWebsite']['rawAttributes'],function(_0x3032d2){return{'name':_0x3032d2[_0xe1b7('0x55')],'type':_0x3032d2[_0xe1b7('0x52')][_0xe1b7('0x56')]};});_0x390474[_0xe1b7('0x50')]=_[_0xe1b7('0x3b')](_0x8bff73,_0xe1b7('0x2d'));_0x390474[_0xe1b7('0x57')]=_[_0xe1b7('0x58')](_0x454a81['query']);_0x390474[_0xe1b7('0x59')]=_[_0xe1b7('0x5a')](_0x390474['model'],_0x390474['query']);_0x59ad47[_0xe1b7('0x5b')]=_[_0xe1b7('0x5a')](_0x390474[_0xe1b7('0x50')],qs[_0xe1b7('0x5c')](_0x454a81[_0xe1b7('0x57')]['fields']));_0x59ad47[_0xe1b7('0x5b')]=_0x59ad47[_0xe1b7('0x5b')][_0xe1b7('0x5d')]?_0x59ad47[_0xe1b7('0x5b')]:_0x390474[_0xe1b7('0x50')];if(!_0x454a81[_0xe1b7('0x57')][_0xe1b7('0x5e')](_0xe1b7('0x5f'))){_0x59ad47[_0xe1b7('0x24')]=qs[_0xe1b7('0x24')](_0x454a81[_0xe1b7('0x57')][_0xe1b7('0x24')]);_0x59ad47[_0xe1b7('0x22')]=qs[_0xe1b7('0x22')](_0x454a81[_0xe1b7('0x57')]['offset']);}_0x59ad47[_0xe1b7('0x60')]=qs[_0xe1b7('0x61')](_0x454a81[_0xe1b7('0x57')][_0xe1b7('0x61')]);_0x59ad47[_0xe1b7('0x62')]=qs[_0xe1b7('0x59')](_[_0xe1b7('0x63')](_0x454a81['query'],_0x390474[_0xe1b7('0x59')]),_0x8bff73);if(_0x454a81[_0xe1b7('0x57')]['filter']){_0x59ad47[_0xe1b7('0x62')]=_[_0xe1b7('0x64')](_0x59ad47[_0xe1b7('0x62')],{'$or':_[_0xe1b7('0x3b')](_0x8bff73,function(_0x129c32){if(_0x129c32[_0xe1b7('0x52')]!==_0xe1b7('0x65')){var _0x3e33a5={};_0x3e33a5[_0x129c32[_0xe1b7('0x2d')]]={'$like':'%'+_0x454a81[_0xe1b7('0x57')][_0xe1b7('0x66')]+'%'};return _0x3e33a5;}})});}_0x59ad47=_[_0xe1b7('0x64')]({},_0x59ad47,_0x454a81['options']);var _0x208d07={'where':_0x59ad47[_0xe1b7('0x62')]};return db[_0xe1b7('0x67')][_0xe1b7('0x25')](_0x208d07)[_0xe1b7('0x16')](function(_0x16c144){_0x11622e[_0xe1b7('0x25')]=_0x16c144;if(_0x454a81[_0xe1b7('0x57')][_0xe1b7('0x68')]){_0x59ad47['include']=[{'all':!![]}];}return db[_0xe1b7('0x67')][_0xe1b7('0x69')](_0x59ad47);})[_0xe1b7('0x16')](function(_0x36000b){_0x11622e[_0xe1b7('0x6a')]=_0x36000b;return _0x11622e;})[_0xe1b7('0x16')](respondWithFilteredResult(_0x48a814,_0x59ad47))[_0xe1b7('0x39')](handleError(_0x48a814,null));};exports[_0xe1b7('0x6b')]=function(_0x14bb1f,_0x558700){var _0x36164a={'raw':![],'where':{'id':_0x14bb1f[_0xe1b7('0x6c')]['id']},'include':[{'model':db[_0xe1b7('0x6d')],'as':_0xe1b7('0x54')}]},_0x2330e0={};_0x2330e0[_0xe1b7('0x50')]=_[_0xe1b7('0x58')](db['ChatWebsite']['rawAttributes']);_0x2330e0[_0xe1b7('0x57')]=_[_0xe1b7('0x58')](_0x14bb1f[_0xe1b7('0x57')]);_0x2330e0[_0xe1b7('0x59')]=_[_0xe1b7('0x5a')](_0x2330e0[_0xe1b7('0x50')],_0x2330e0[_0xe1b7('0x57')]);_0x36164a[_0xe1b7('0x5b')]=_[_0xe1b7('0x5a')](_0x2330e0[_0xe1b7('0x50')],qs['fields'](_0x14bb1f['query'][_0xe1b7('0x5c')]));_0x36164a[_0xe1b7('0x5b')]=_0x36164a[_0xe1b7('0x5b')]['length']?_0x36164a[_0xe1b7('0x5b')]:_0x2330e0[_0xe1b7('0x50')];if(_0x14bb1f['query']['includeAll']){_0x36164a['include']=[{'all':!![]}];}_0x36164a=_[_0xe1b7('0x64')]({},_0x36164a,_0x14bb1f[_0xe1b7('0x6e')]);return db[_0xe1b7('0x67')][_0xe1b7('0x6f')](_0x36164a)[_0xe1b7('0x16')](handleEntityNotFound(_0x558700,null))[_0xe1b7('0x16')](respondWithResult(_0x558700,null))['catch'](handleError(_0x558700,null));};exports[_0xe1b7('0x70')]=function(_0x49bdee,_0x5d46e7){return db[_0xe1b7('0x67')]['create'](_0x49bdee[_0xe1b7('0x71')],{})[_0xe1b7('0x16')](function(_0x40c6b6){var _0x256756=_0x49bdee[_0xe1b7('0x72')]['get']({'plain':!![]});if(!_0x256756)throw new Error(_0xe1b7('0x73'));if(_0x256756[_0xe1b7('0x74')]===_0xe1b7('0x72')){var _0x30aa9a=_0x40c6b6['get']({'plain':!![]});var _0x304029=_0xe1b7('0x29');return db[_0xe1b7('0x75')]['find']({'where':{'name':_0x304029,'userProfileId':_0x256756[_0xe1b7('0x76')]},'raw':!![]})[_0xe1b7('0x16')](function(_0x4ef496){if(_0x4ef496&&_0x4ef496['autoAssociation']===0x0){return db[_0xe1b7('0x77')]['create']({'name':_0x30aa9a[_0xe1b7('0x2d')],'resourceId':_0x30aa9a['id'],'type':_0x4ef496['name'],'sectionId':_0x4ef496['id']},{})['then'](function(){return _0x40c6b6;});}else{return _0x40c6b6;}})[_0xe1b7('0x39')](function(_0x2433d9){logger[_0xe1b7('0x1c')](_0xe1b7('0x78'),_0x2433d9);throw _0x2433d9;});}return _0x40c6b6;})['then'](respondWithResult(_0x5d46e7,0xc9))[_0xe1b7('0x39')](handleError(_0x5d46e7,null));};exports[_0xe1b7('0x27')]=function(_0x1d042b,_0xda6070){if(_0x1d042b['body']['id']){delete _0x1d042b['body']['id'];}return db[_0xe1b7('0x67')]['find']({'where':{'id':_0x1d042b[_0xe1b7('0x6c')]['id']},'include':[{'model':db['Pause'],'as':'mandatoryDispositionPause'}]})['then'](handleEntityNotFound(_0xda6070,null))[_0xe1b7('0x16')](saveUpdates(_0x1d042b['body'],null))[_0xe1b7('0x16')](respondWithResult(_0xda6070,null))['catch'](handleError(_0xda6070,null));};exports[_0xe1b7('0x28')]=function(_0x5994b0,_0x18a244){return db[_0xe1b7('0x67')]['find']({'where':{'id':_0x5994b0[_0xe1b7('0x6c')]['id']}})['then'](handleEntityNotFound(_0x18a244,null))[_0xe1b7('0x16')](removeEntity(_0x18a244,null))[_0xe1b7('0x39')](handleError(_0x18a244,null));};exports['describe']=function(_0x289d3b,_0x47bf4b){return db[_0xe1b7('0x67')][_0xe1b7('0x79')]()[_0xe1b7('0x16')](respondWithResult(_0x47bf4b,null))['catch'](handleError(_0x47bf4b,null));};exports[_0xe1b7('0x7a')]=function(_0x252313,_0x3400e0){if(_0x252313['body']['id']){delete _0x252313[_0xe1b7('0x71')]['id'];}return db['ChatWebsite'][_0xe1b7('0x6f')]({'where':{'id':_0x252313[_0xe1b7('0x6c')]['id']}})[_0xe1b7('0x16')](handleEntityNotFound(_0x3400e0,null))[_0xe1b7('0x16')](function(_0x3f6e95){if(_0x3f6e95){_0x252313['body'][_0xe1b7('0x7b')]=_0x3f6e95['id'];return db[_0xe1b7('0x7c')][_0xe1b7('0x70')](_0x252313['body']);}})['then'](respondWithResult(_0x3400e0,null))['catch'](handleError(_0x3400e0,null));};exports[_0xe1b7('0x7d')]=function(_0x189c4c,_0x1be615){var _0x1d048a={'raw':![],'where':{}};var _0x1feeeb={};var _0x427960={'count':0x0,'rows':[]};return db['ChatWebsite'][_0xe1b7('0x7e')]({'where':{'id':_0x189c4c[_0xe1b7('0x6c')]['id']}})[_0xe1b7('0x16')](handleEntityNotFound(_0x1be615,null))[_0xe1b7('0x16')](function(_0xab7e38){if(_0xab7e38){_0x1feeeb[_0xe1b7('0x50')]=_['keys'](db['Disposition']['rawAttributes']);_0x1feeeb['query']=_[_0xe1b7('0x58')](_0x189c4c[_0xe1b7('0x57')]);_0x1feeeb[_0xe1b7('0x59')]=_[_0xe1b7('0x5a')](_0x1feeeb[_0xe1b7('0x50')],_0x1feeeb[_0xe1b7('0x57')]);_0x1d048a[_0xe1b7('0x5b')]=_[_0xe1b7('0x5a')](_0x1feeeb[_0xe1b7('0x50')],qs[_0xe1b7('0x5c')](_0x189c4c[_0xe1b7('0x57')][_0xe1b7('0x5c')]));_0x1d048a['attributes']=_0x1d048a['attributes'][_0xe1b7('0x5d')]?_0x1d048a[_0xe1b7('0x5b')]:_0x1feeeb[_0xe1b7('0x50')];if(!_0x189c4c[_0xe1b7('0x57')][_0xe1b7('0x5e')](_0xe1b7('0x5f'))){_0x1d048a['limit']=qs[_0xe1b7('0x24')](_0x189c4c[_0xe1b7('0x57')][_0xe1b7('0x24')]);_0x1d048a[_0xe1b7('0x22')]=qs[_0xe1b7('0x22')](_0x189c4c['query'][_0xe1b7('0x22')]);}_0x1d048a['order']=qs[_0xe1b7('0x61')](_0x189c4c[_0xe1b7('0x57')][_0xe1b7('0x61')]);_0x1d048a['where']=qs['filters'](_['pick'](_0x189c4c[_0xe1b7('0x57')],_0x1feeeb[_0xe1b7('0x59')]));_0x1d048a[_0xe1b7('0x62')][_0xe1b7('0x7b')]=_0xab7e38['id'];if(_0x189c4c[_0xe1b7('0x57')][_0xe1b7('0x66')]){_0x1d048a[_0xe1b7('0x62')]=_[_0xe1b7('0x64')](_0x1d048a['where'],{'$or':_[_0xe1b7('0x3b')](_0x1d048a[_0xe1b7('0x5b')],function(_0x5d2d9c){var _0x3b28fc={};_0x3b28fc[_0x5d2d9c]={'$like':'%'+_0x189c4c[_0xe1b7('0x57')]['filter']+'%'};return _0x3b28fc;})});}_0x1d048a=_[_0xe1b7('0x64')]({},_0x1d048a,_0x189c4c['options']);return db[_0xe1b7('0x7c')][_0xe1b7('0x25')]({'where':_0x1d048a['where']})[_0xe1b7('0x16')](function(_0x38f083){_0x427960[_0xe1b7('0x25')]=_0x38f083;if(_0x189c4c[_0xe1b7('0x57')][_0xe1b7('0x68')]){_0x1d048a['include']=[{'all':!![]}];}return db[_0xe1b7('0x7c')][_0xe1b7('0x69')](_0x1d048a);})['then'](function(_0x9eeafc){_0x427960[_0xe1b7('0x6a')]=_0x9eeafc;return _0x427960;});}})[_0xe1b7('0x16')](respondWithFilteredResult(_0x1be615,_0x1d048a))['catch'](handleError(_0x1be615,null));};exports[_0xe1b7('0x7f')]=function(_0x4db887,_0x27ec63){return db[_0xe1b7('0x67')][_0xe1b7('0x6f')]({'where':{'id':_0x4db887[_0xe1b7('0x6c')]['id']}})[_0xe1b7('0x16')](handleEntityNotFound(_0x27ec63,null))['then'](function(_0x17677c){if(_0x17677c){return _0x17677c['removeDispositions'](_0x4db887['query'][_0xe1b7('0x80')]);}})['then'](respondWithStatusCode(_0x27ec63,null))[_0xe1b7('0x39')](handleError(_0x27ec63,null));};exports[_0xe1b7('0x81')]=function(_0x1223f4,_0x29296f){if(_0x1223f4[_0xe1b7('0x71')]['id']){delete _0x1223f4['body']['id'];}return db[_0xe1b7('0x67')]['find']({'where':{'id':_0x1223f4['params']['id']}})[_0xe1b7('0x16')](handleEntityNotFound(_0x29296f,null))['then'](function(_0x4f4337){if(_0x4f4337){_0x1223f4[_0xe1b7('0x71')][_0xe1b7('0x7b')]=_0x4f4337['id'];return db[_0xe1b7('0x82')][_0xe1b7('0x70')](_0x1223f4[_0xe1b7('0x71')]);}})[_0xe1b7('0x16')](respondWithResult(_0x29296f,null))[_0xe1b7('0x39')](handleError(_0x29296f,null));};exports[_0xe1b7('0x83')]=function(_0xf6d3d1,_0x57dc09){var _0x53de05={'raw':![],'where':{}};var _0x39d4c0={};var _0x3a354d={'count':0x0,'rows':[]};return db[_0xe1b7('0x67')][_0xe1b7('0x7e')]({'where':{'id':_0xf6d3d1[_0xe1b7('0x6c')]['id']}})[_0xe1b7('0x16')](handleEntityNotFound(_0x57dc09,null))[_0xe1b7('0x16')](function(_0x5cf646){if(_0x5cf646){_0x39d4c0[_0xe1b7('0x50')]=_[_0xe1b7('0x58')](db[_0xe1b7('0x82')]['rawAttributes']);_0x39d4c0[_0xe1b7('0x57')]=_[_0xe1b7('0x58')](_0xf6d3d1[_0xe1b7('0x57')]);_0x39d4c0['filters']=_[_0xe1b7('0x5a')](_0x39d4c0['model'],_0x39d4c0[_0xe1b7('0x57')]);_0x53de05[_0xe1b7('0x5b')]=_[_0xe1b7('0x5a')](_0x39d4c0[_0xe1b7('0x50')],qs[_0xe1b7('0x5c')](_0xf6d3d1[_0xe1b7('0x57')][_0xe1b7('0x5c')]));_0x53de05['attributes']=_0x53de05[_0xe1b7('0x5b')][_0xe1b7('0x5d')]?_0x53de05[_0xe1b7('0x5b')]:_0x39d4c0['model'];if(!_0xf6d3d1[_0xe1b7('0x57')][_0xe1b7('0x5e')](_0xe1b7('0x5f'))){_0x53de05[_0xe1b7('0x24')]=qs[_0xe1b7('0x24')](_0xf6d3d1[_0xe1b7('0x57')][_0xe1b7('0x24')]);_0x53de05[_0xe1b7('0x22')]=qs[_0xe1b7('0x22')](_0xf6d3d1[_0xe1b7('0x57')][_0xe1b7('0x22')]);}_0x53de05[_0xe1b7('0x60')]=qs[_0xe1b7('0x61')](_0xf6d3d1[_0xe1b7('0x57')]['sort']);_0x53de05[_0xe1b7('0x62')]=qs[_0xe1b7('0x59')](_['pick'](_0xf6d3d1[_0xe1b7('0x57')],_0x39d4c0[_0xe1b7('0x59')]));_0x53de05[_0xe1b7('0x62')][_0xe1b7('0x7b')]=_0x5cf646['id'];if(_0xf6d3d1['query']['filter']){_0x53de05[_0xe1b7('0x62')]=_[_0xe1b7('0x64')](_0x53de05[_0xe1b7('0x62')],{'$or':_[_0xe1b7('0x3b')](_0x53de05[_0xe1b7('0x5b')],function(_0x7955ca){var _0x910a80={};_0x910a80[_0x7955ca]={'$like':'%'+_0xf6d3d1[_0xe1b7('0x57')]['filter']+'%'};return _0x910a80;})});}_0x53de05=_[_0xe1b7('0x64')]({},_0x53de05,_0xf6d3d1[_0xe1b7('0x6e')]);return db[_0xe1b7('0x82')][_0xe1b7('0x25')]({'where':_0x53de05[_0xe1b7('0x62')]})[_0xe1b7('0x16')](function(_0x3705ce){_0x3a354d['count']=_0x3705ce;if(_0xf6d3d1[_0xe1b7('0x57')][_0xe1b7('0x68')]){_0x53de05[_0xe1b7('0x84')]=[{'all':!![]}];}return db['CannedAnswer'][_0xe1b7('0x69')](_0x53de05);})[_0xe1b7('0x16')](function(_0xb9ac00){_0x3a354d[_0xe1b7('0x6a')]=_0xb9ac00;return _0x3a354d;});}})[_0xe1b7('0x16')](respondWithFilteredResult(_0x57dc09,_0x53de05))[_0xe1b7('0x39')](handleError(_0x57dc09,null));};exports[_0xe1b7('0x85')]=function(_0x2c430e,_0x307680){return db[_0xe1b7('0x67')][_0xe1b7('0x6f')]({'where':{'id':_0x2c430e[_0xe1b7('0x6c')]['id']}})[_0xe1b7('0x16')](handleEntityNotFound(_0x307680,null))[_0xe1b7('0x16')](function(_0x4996a4){if(_0x4996a4){return _0x4996a4[_0xe1b7('0x85')](_0x2c430e[_0xe1b7('0x57')][_0xe1b7('0x80')]);}})[_0xe1b7('0x16')](respondWithStatusCode(_0x307680,null))[_0xe1b7('0x39')](handleError(_0x307680,null));};exports['addLogo']=function(_0x2797dc,_0x4c12d7){_0x2797dc[_0xe1b7('0x71')][_0xe1b7('0x86')]=_0x2797dc[_0xe1b7('0x87')]['filename'];return db[_0xe1b7('0x67')][_0xe1b7('0x6f')]({'where':{'id':_0x2797dc['params']['id']}})[_0xe1b7('0x16')](handleEntityNotFound(_0x4c12d7,null))[_0xe1b7('0x16')](saveUpdates(_0x2797dc[_0xe1b7('0x71')],null))[_0xe1b7('0x16')](respondWithResult(_0x4c12d7,null))[_0xe1b7('0x39')](handleError(_0x4c12d7,null));};exports[_0xe1b7('0x88')]=function(_0x333417,_0x2ca4f3){_0x333417['body'][_0xe1b7('0x89')]=_0x333417['file'][_0xe1b7('0x8a')];return db[_0xe1b7('0x67')][_0xe1b7('0x6f')]({'where':{'id':_0x333417[_0xe1b7('0x6c')]['id']}})[_0xe1b7('0x16')](handleEntityNotFound(_0x2ca4f3,null))[_0xe1b7('0x16')](saveUpdates(_0x333417['body'],null))['then'](respondWithResult(_0x2ca4f3,null))['catch'](handleError(_0x2ca4f3,null));};exports[_0xe1b7('0x8b')]=function(_0x1ec5dc,_0x138283){_0x1ec5dc[_0xe1b7('0x71')][_0xe1b7('0x8c')]=_0x1ec5dc[_0xe1b7('0x87')][_0xe1b7('0x8a')];return db[_0xe1b7('0x67')][_0xe1b7('0x6f')]({'where':{'id':_0x1ec5dc[_0xe1b7('0x6c')]['id']}})[_0xe1b7('0x16')](handleEntityNotFound(_0x138283,null))[_0xe1b7('0x16')](saveUpdates(_0x1ec5dc[_0xe1b7('0x71')],null))[_0xe1b7('0x16')](respondWithResult(_0x138283,null))[_0xe1b7('0x39')](handleError(_0x138283,null));};exports[_0xe1b7('0x8d')]=function(_0xcd19ca,_0x111a53){_0xcd19ca['body'][_0xe1b7('0x8e')]=_0xcd19ca[_0xe1b7('0x87')][_0xe1b7('0x8a')];return db[_0xe1b7('0x67')][_0xe1b7('0x6f')]({'where':{'id':_0xcd19ca[_0xe1b7('0x6c')]['id']}})[_0xe1b7('0x16')](handleEntityNotFound(_0x111a53,null))['then'](saveUpdates(_0xcd19ca[_0xe1b7('0x71')],null))[_0xe1b7('0x16')](respondWithResult(_0x111a53,null))['catch'](handleError(_0x111a53,null));};exports[_0xe1b7('0x8f')]=function(_0x5cebf3,_0x121489){var _0x4eba3a=path[_0xe1b7('0x90')](config[_0xe1b7('0x91')],_0xe1b7('0x92'));var _0x5ae8d8={'where':{'id':_0x5cebf3['params']['id']},'attributes':['id',_0xe1b7('0x86')],'raw':!![]};var _0x119d8f=![];return require(_0xe1b7('0x93'))[_0xe1b7('0x94')]()[_0xe1b7('0x16')](function(_0x416d5f){if(_0x416d5f){_0x119d8f=_0x416d5f['custom'];}})[_0xe1b7('0x16')](function(){return db[_0xe1b7('0x67')][_0xe1b7('0x6f')](_0x5ae8d8);})[_0xe1b7('0x16')](handleEntityNotFound(_0x121489,null))[_0xe1b7('0x16')](function(_0x38dbed){if(_0x38dbed){if(!_[_0xe1b7('0x95')](_0x38dbed[_0xe1b7('0x86')])){if(fs['existsSync'](path[_0xe1b7('0x90')](config[_0xe1b7('0x91')],_0xe1b7('0x96'),_0x38dbed[_0xe1b7('0x86')]))&&_0x119d8f){_0x4eba3a=path[_0xe1b7('0x90')](config['root'],_0xe1b7('0x96'),_0x38dbed['sitepic']);}}return _0x121489[_0xe1b7('0x97')](_0x4eba3a);}})[_0xe1b7('0x39')](handleError(_0x121489,null));};exports[_0xe1b7('0x98')]=function(_0x601521,_0x21da19){var _0x1a1068=path['join'](config[_0xe1b7('0x91')],'server/files/images/avatars/default_avatar.png');var _0x5590b7={'where':{'id':_0x601521['params']['id']},'attributes':['id',_0xe1b7('0x89')],'raw':!![]};return db[_0xe1b7('0x67')][_0xe1b7('0x6f')](_0x5590b7)[_0xe1b7('0x16')](handleEntityNotFound(_0x21da19,null))[_0xe1b7('0x16')](function(_0x102743){if(_0x102743){if(!_[_0xe1b7('0x95')](_0x102743[_0xe1b7('0x89')])){if(fs['existsSync'](path[_0xe1b7('0x90')](config[_0xe1b7('0x91')],'server/files/images/avatars/',_0x102743[_0xe1b7('0x89')]))){_0x1a1068=path['join'](config[_0xe1b7('0x91')],_0xe1b7('0x99'),_0x102743[_0xe1b7('0x89')]);}}return _0x21da19[_0xe1b7('0x97')](_0x1a1068);}})[_0xe1b7('0x39')](handleError(_0x21da19,null));};exports[_0xe1b7('0x9a')]=function(_0x541de2,_0x276700){var _0x963bcd=path[_0xe1b7('0x90')](config[_0xe1b7('0x91')],_0xe1b7('0x9b'));var _0x16ef6c={'where':{'id':_0x541de2[_0xe1b7('0x6c')]['id']},'attributes':['id','customerAvatar',_0xe1b7('0x9c')],'raw':!![]};return db[_0xe1b7('0x67')]['find'](_0x16ef6c)[_0xe1b7('0x16')](handleEntityNotFound(_0x276700,null))[_0xe1b7('0x16')](function(_0x168302){if(_0x168302){if(!_[_0xe1b7('0x95')](_0x168302[_0xe1b7('0x8c')])){if(fs['existsSync'](path[_0xe1b7('0x90')](config[_0xe1b7('0x91')],_0xe1b7('0x99'),_0x168302[_0xe1b7('0x8c')]))&&_0x168302['showCustomerAvatar']){_0x963bcd=path[_0xe1b7('0x90')](config[_0xe1b7('0x91')],_0xe1b7('0x99'),_0x168302[_0xe1b7('0x8c')]);}}return _0x276700[_0xe1b7('0x97')](_0x963bcd);}})['catch'](handleError(_0x276700,null));};exports['getSystemAvatar']=function(_0x3a4457,_0xfe11c3){var _0xbf4499=path['join'](config[_0xe1b7('0x91')],_0xe1b7('0x9d'));var _0xccbfb5={'where':{'id':_0x3a4457[_0xe1b7('0x6c')]['id']},'attributes':['id',_0xe1b7('0x8e')],'raw':!![]};return db[_0xe1b7('0x67')][_0xe1b7('0x6f')](_0xccbfb5)['then'](handleEntityNotFound(_0xfe11c3,null))[_0xe1b7('0x16')](function(_0x26669e){if(_0x26669e){if(!_['isNil'](_0x26669e[_0xe1b7('0x8e')])){if(fs['existsSync'](path['join'](config[_0xe1b7('0x91')],'server/files/images/avatars/',_0x26669e[_0xe1b7('0x8e')]))){_0xbf4499=path[_0xe1b7('0x90')](config[_0xe1b7('0x91')],_0xe1b7('0x99'),_0x26669e['systemAvatar']);}}return _0xfe11c3['download'](_0xbf4499);}})[_0xe1b7('0x39')](handleError(_0xfe11c3,null));};exports[_0xe1b7('0x9e')]=function(_0x38fad5,_0x13ea41){var _0x3f1dea={'body':_0x38fad5[_0xe1b7('0x71')],'channel':'chat'};var _0x1401ed=[];var _0x5a9fb8=[];var _0x412769={};var _0x2d5ae2=![];return db['CmContact'][_0xe1b7('0x79')]()[_0xe1b7('0x16')](function(_0x5b5ef3){if(!_0x5b5ef3){throw new db[(_0xe1b7('0x9f'))][(_0xe1b7('0xa0'))](_0xe1b7('0xa1'));}_0x1401ed=_['difference'](_[_0xe1b7('0x58')](_0x5b5ef3),[_0xe1b7('0xa2'),_0xe1b7('0xa3')]);_0x5a9fb8=_[_0xe1b7('0xa4')](_[_0xe1b7('0x58')](_0x5b5ef3),[_0xe1b7('0xa2'),_0xe1b7('0xa3'),_0xe1b7('0xa5'),'ListId']);if(_0x38fad5[_0xe1b7('0x71')]['id']){delete _0x38fad5['body']['id'];}if(_[_0xe1b7('0x95')](_0x38fad5[_0xe1b7('0x71')][_0xe1b7('0xa6')])){throw new db[(_0xe1b7('0x9f'))][(_0xe1b7('0xa0'))]('from\x20is\x20mandatory');}if(_[_0xe1b7('0x95')](_0x38fad5[_0xe1b7('0x71')][_0xe1b7('0x71')])||_0x38fad5['body'][_0xe1b7('0x71')]===''){throw new db[(_0xe1b7('0x9f'))][(_0xe1b7('0xa0'))]('body\x20is\x20mandatory\x20and\x20not\x20empty');}if(_['isNil'](_0x38fad5[_0xe1b7('0x71')][_0xe1b7('0xa7')])){throw new db[(_0xe1b7('0x9f'))]['ValidationError'](_0xe1b7('0xa8')+_0x5a9fb8);}if(!_[_0xe1b7('0xa9')](_0x5a9fb8,_0x38fad5[_0xe1b7('0x71')][_0xe1b7('0xa7')])){throw new db[(_0xe1b7('0x9f'))][(_0xe1b7('0xa0'))]('mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20'+_0x5a9fb8);}_0x412769[_0x38fad5[_0xe1b7('0x71')][_0xe1b7('0xa7')]]=_0x38fad5[_0xe1b7('0x71')][_0xe1b7('0xa6')];})[_0xe1b7('0x16')](function(){return db[_0xe1b7('0x67')][_0xe1b7('0x6f')]({'where':{'id':_0x38fad5[_0xe1b7('0x6c')]['id']},'include':[{'model':db[_0xe1b7('0xaa')],'as':'List','include':[{'model':db[_0xe1b7('0xab')],'as':'Contacts','where':_0x412769,'limit':0x1,'order':[['updatedAt',_0xe1b7('0xac')]]}]},{'model':db['ChatApplication'],'as':_0xe1b7('0xad')},{'model':db[_0xe1b7('0x3c')],'as':'Interval','include':[{'model':db[_0xe1b7('0x3c')],'as':'Intervals','attributes':['id','interval'],'raw':!![]}]}]});})['then'](function(_0xf6245f){if(!_0xf6245f)throw new APINotFoundError(util['format'](_0xe1b7('0xae'),_0x38fad5[_0xe1b7('0x6c')]['id']));if(!_0xf6245f['Interval']||!_0xf6245f['Interval'][_0xe1b7('0x3d')])return[_0xf6245f,!![]];return[_0xf6245f,checkWebsiteIntervals(_0xf6245f)];})[_0xe1b7('0xaf')](function(_0x5a3236,_0x3af5d0){if(!_0x3af5d0)throw new APIOutOfIntervalError();if(!_0x5a3236[_0xe1b7('0xb0')])return;_0x3f1dea['account']=_0x5a3236;_0x3f1dea[_0xe1b7('0xb1')]=_0x5a3236[_0xe1b7('0xb0')];_0x3f1dea[_0xe1b7('0xb2')]=_[_0xe1b7('0xb3')](_0x5a3236[_0xe1b7('0xad')],[_0xe1b7('0xb4')],[_0xe1b7('0xb5')]);if(_0x3f1dea['account'][_0xe1b7('0xad')]){delete _0x3f1dea['account'][_0xe1b7('0xad')];}if(_0x3f1dea[_0xe1b7('0xb6')][_0xe1b7('0xb0')]&&_0x3f1dea[_0xe1b7('0xb6')][_0xe1b7('0xb0')][_0xe1b7('0xb7')]['length']){return _0x3f1dea[_0xe1b7('0xb6')][_0xe1b7('0xb0')][_0xe1b7('0xb7')][0x0];}var _0x5037dd=_[_0xe1b7('0xb8')](_0x38fad5[_0xe1b7('0x71')],{'firstName':_0x38fad5[_0xe1b7('0x71')][_0xe1b7('0xa6')],'ListId':_0x5a3236[_0xe1b7('0xb9')]});_0x5037dd[_0x38fad5[_0xe1b7('0x71')]['mapKey']]=_0x38fad5[_0xe1b7('0x71')]['from'];return db[_0xe1b7('0xab')][_0xe1b7('0x70')](_0x5037dd,{'fields':_0x1401ed,'raw':!![]});})[_0xe1b7('0x16')](function(_0x1a5558){_0x3f1dea['contact']=_0x1a5558;var _0x4c80b5=createInteractionObject(_0x38fad5[_0xe1b7('0x6c')]['id'],_0x38fad5[_0xe1b7('0x71')],_0x38fad5['headers'],_0x1a5558);var _0x43255d={'ChatWebsiteId':_0x38fad5[_0xe1b7('0x6c')]['id'],'closed':![]};if(_0x38fad5['body'][_0xe1b7('0xba')]){_0x43255d[_0xe1b7('0xba')]=_0x38fad5[_0xe1b7('0x71')][_0xe1b7('0xba')];return db[_0xe1b7('0xbb')][_0xe1b7('0x6f')]({'where':_0x43255d})[_0xe1b7('0x16')](function(_0x108855){if(_0x108855){_0x2d5ae2=!![];return _0x108855;}_0x4c80b5[_0xe1b7('0xba')]=_0x38fad5['body']['threadId'];_0x4c80b5['externalUrl']=_0x38fad5[_0xe1b7('0x71')]['externalUrl'];return db[_0xe1b7('0xbb')][_0xe1b7('0x70')](_0x4c80b5);});}_0x43255d[_0xe1b7('0xbc')]=_0x1a5558['id'];if(_0x38fad5['body'][_0xe1b7('0xbd')]&&_0x38fad5[_0xe1b7('0x71')][_0xe1b7('0xbd')]['id']){_0x43255d['id']=_0x38fad5[_0xe1b7('0x71')][_0xe1b7('0xbd')]['id'];return db['ChatInteraction'][_0xe1b7('0x6f')]({'where':_0x43255d})[_0xe1b7('0x16')](function(_0x505d54){if(_0x505d54){_0x2d5ae2=!![];return _0x505d54;}return db[_0xe1b7('0xbb')][_0xe1b7('0x70')](_0x4c80b5);});}return db['ChatInteraction'][_0xe1b7('0x70')](_0x4c80b5);})['then'](function(_0x1aba69){if(!_0x2d5ae2)return _0x1aba69;var _0x44464d={'from':(_0x3f1dea[_0xe1b7('0xbe')][_0xe1b7('0x48')]||'')+'\x20'+(_0x3f1dea[_0xe1b7('0xbe')][_0xe1b7('0x49')]||'')};if(_0x38fad5[_0xe1b7('0x71')]['threadId']&&_0x38fad5[_0xe1b7('0x71')]['messageId']&&_0x38fad5[_0xe1b7('0x71')][_0xe1b7('0xba')]!=_0x38fad5[_0xe1b7('0x71')][_0xe1b7('0xbf')]){_0x44464d[_0xe1b7('0xba')]=_0x38fad5['body']['messageId'];}return _0x1aba69[_0xe1b7('0x27')](_0x44464d);})[_0xe1b7('0x16')](function(_0x29b789){_0x3f1dea[_0xe1b7('0xbd')]=_0x29b789['get']({'plain':!![]});_0x3f1dea[_0xe1b7('0xbd')][_0xe1b7('0xc0')]=!_0x2d5ae2;if(_0x3f1dea['interaction'][_0xe1b7('0xc0')]){if(_0x3f1dea[_0xe1b7('0xb6')][_0xe1b7('0xc1')]){_0x3f1dea[_0xe1b7('0xb2')][_0xe1b7('0xc2')]({'id':0x0,'priority':_0x3f1dea[_0xe1b7('0xb2')]['length']+0x1,'app':_0xe1b7('0xc3'),'appdata':_0xe1b7('0xc4'),'interval':_0xe1b7('0xc5')});}}return db[_0xe1b7('0xc6')][_0xe1b7('0x70')]({'body':_0x38fad5[_0xe1b7('0x71')][_0xe1b7('0x71')],'ChatWebsiteId':_0x38fad5[_0xe1b7('0x6c')]['id'],'ChatInteractionId':_0x29b789['id'],'direction':'in','ContactId':_0x3f1dea['contact']['id'],'AttachmentId':_0x38fad5[_0xe1b7('0x71')]['AttachmentId']});})['then'](function(_0x166825){_0x3f1dea[_0xe1b7('0x1e')]=_0x166825;if(!_0x3f1dea[_0xe1b7('0xbd')][_0xe1b7('0xc7')]){return;}return db[_0xe1b7('0xc8')]['find']({'attributes':['id','name'],'where':{'id':_0x3f1dea[_0xe1b7('0xbd')][_0xe1b7('0xc7')]}});})[_0xe1b7('0x16')](function(_0x14a5f2){if(_0x14a5f2){_0x3f1dea['applications']['unshift']({'id':0x0,'priority':0x0,'app':_0xe1b7('0xc9'),'appdata':_0x14a5f2[_0xe1b7('0x2d')]+','+(_0x3f1dea['account'][_0xe1b7('0xca')]||0xa),'interval':'*,*,*,*'});_0x3f1dea[_0xe1b7('0xcb')]=!![];}if(!_0x3f1dea[_0xe1b7('0xbd')]['queueId']){return;}return db[_0xe1b7('0xcc')][_0xe1b7('0x6f')]({'attributes':['id',_0xe1b7('0x2d')],'where':{'id':_0x3f1dea['interaction'][_0xe1b7('0xcd')]}});})[_0xe1b7('0x16')](function(_0x4404c7){if(_0x4404c7){_0x3f1dea['applications'][_0xe1b7('0xce')]({'id':0x0,'priority':0x1,'app':_0xe1b7('0xcf'),'appdata':_0x4404c7['name']+','+(_0x3f1dea[_0xe1b7('0xb6')]['waitForTheAssignedQueue']||0x12c),'interval':_0xe1b7('0xc5')});}return respondWithRpcPromise(_0xe1b7('0xd0'),_0xe1b7('0xd1'),_0x3f1dea);})['then'](function(_0x100a1e){respondWithRpcPromise('EventManager',_0xe1b7('0xd2'),{'event':_0xe1b7('0x9e'),'message':_0x100a1e},client9002);return _0x100a1e;})['then'](respondWithResult(_0x13ea41,null))[_0xe1b7('0x39')](APIHandleError(_0x13ea41));};exports[_0xe1b7('0xd3')]=function(_0x31acc2,_0x3a171c){var _0x106b95,_0x7172d8,_0x4b3ea7;var _0x358321=[];var _0x5d2392={};var _0xdae68a=_0x31acc2[_0xe1b7('0xd4')]||[];var _0xd497c5=[];var _0x5a3379;return db[_0xe1b7('0xab')][_0xe1b7('0x79')]()[_0xe1b7('0x16')](function(_0x56273f){if(!_0x56273f){throw new db['Sequelize'][(_0xe1b7('0xa0'))]('no\x20available\x20attributes');}_0x358321=_[_0xe1b7('0xa4')](_[_0xe1b7('0x58')](_0x56273f),['createdAt',_0xe1b7('0xa3'),_0xe1b7('0xa5'),_0xe1b7('0xb9')]);if(_0x31acc2[_0xe1b7('0x71')]['id']){delete _0x31acc2['body']['id'];}if(_['isNil'](_0x31acc2[_0xe1b7('0x71')][_0xe1b7('0xa6')])){throw _0x3a171c[_0xe1b7('0x2a')](0x1f4)[_0xe1b7('0x2e')](new db[(_0xe1b7('0x9f'))][(_0xe1b7('0xa0'))](_0xe1b7('0xd5')));}if(_[_0xe1b7('0x95')](_0x31acc2[_0xe1b7('0x71')][_0xe1b7('0x71')])||_0x31acc2[_0xe1b7('0x71')][_0xe1b7('0x71')]===''){throw _0x3a171c[_0xe1b7('0x2a')](0x1f4)['send'](new db[(_0xe1b7('0x9f'))][(_0xe1b7('0xa0'))](_0xe1b7('0xd6')));}if(_['isNil'](_0x31acc2[_0xe1b7('0x71')][_0xe1b7('0xd7')])){throw _0x3a171c[_0xe1b7('0x2a')](0x1f4)['send'](new db['Sequelize'][(_0xe1b7('0xa0'))]('mapKeyOffline\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20'+_0x358321));}if(!_[_0xe1b7('0xa9')](_0x358321,_0x31acc2[_0xe1b7('0x71')][_0xe1b7('0xd7')])){throw _0x3a171c[_0xe1b7('0x2a')](0x1f4)[_0xe1b7('0x2e')](new db['Sequelize'][(_0xe1b7('0xa0'))](_0xe1b7('0xd8')+_0x358321));}_0x5d2392[_0x31acc2[_0xe1b7('0x71')][_0xe1b7('0xd7')]]=_0x31acc2[_0xe1b7('0x71')][_0xe1b7('0xa6')];})[_0xe1b7('0x16')](function(){return db['ChatWebsite'][_0xe1b7('0x6f')]({'where':{'id':_0x31acc2[_0xe1b7('0x6c')]['id']},'include':[{'model':db['CmList'],'as':_0xe1b7('0xb0')},{'model':db[_0xe1b7('0xd9')],'as':_0xe1b7('0xd9')}]});})['then'](handleEntityNotFound(_0x3a171c,null))['then'](function(_0x1505c4){if(_0x1505c4&&_0x1505c4[_0xe1b7('0xb0')]){_0x7172d8=_0x1505c4;var _0x258492=_[_0xe1b7('0xb8')](_0x31acc2[_0xe1b7('0x71')],{'firstName':_0x31acc2['body'][_0xe1b7('0xa6')],'phone':_0x31acc2[_0xe1b7('0x71')][_0xe1b7('0xa6')],'ListId':_0x1505c4[_0xe1b7('0xb9')]});_0x258492[_0x31acc2['body'][_0xe1b7('0xd7')]]=_0x31acc2[_0xe1b7('0x71')][_0xe1b7('0xa6')];return db[_0xe1b7('0xab')][_0xe1b7('0xda')]({'where':_0x5d2392,'defaults':_0x258492});}})[_0xe1b7('0xaf')](function(_0x2fa721){if(_0x2fa721){_0x4b3ea7=_0x2fa721;var _0x3a3840=fs[_0xe1b7('0xdb')](path[_0xe1b7('0x90')](config[_0xe1b7('0x91')],_0xe1b7('0xdc')),_0xe1b7('0xdd'));var _0x22331f=ejs[_0xe1b7('0xde')](_0x3a3840,{'body':_[_0xe1b7('0xdf')](_0x31acc2['body']['body']),'bodyTitle':_0x7172d8[_0xe1b7('0xe0')]});return db[_0xe1b7('0xe1')][_0xe1b7('0x70')]({'body':_0x22331f,'plainBody':htmlToText[_0xe1b7('0xe2')](_0x22331f),'ContactId':_0x2fa721['id'],'ChatWebsiteId':_0x7172d8['id']});}})['then'](function(_0x32a90c){_0x5a3379=_0x32a90c;if(_0xdae68a[_0xe1b7('0x5d')]){var _0x29ad35=_0xdae68a[_0xe1b7('0x3b')](function(_0x55eb1d){return{'name':_0x55eb1d[_0xe1b7('0xe3')],'basename':_0x55eb1d['filename'],'type':_0x55eb1d[_0xe1b7('0xe4')],'ChatOfflineMessageId':_0x32a90c['id']};});_0xd497c5=_0x29ad35[_0xe1b7('0x3b')](_0x40310c=>{var _0x41140f={'filename':_0x40310c[_0xe1b7('0x2d')],'path':path[_0xe1b7('0x90')](config['root'],_0xe1b7('0xe5'),_0xe1b7('0xd4'),_0xe1b7('0xe6'),_0xe1b7('0xe7'),_0x40310c[_0xe1b7('0xe8')])};return _0x41140f;});if(!_0x7172d8[_0xe1b7('0xe9')]){return db[_0xe1b7('0xea')][_0xe1b7('0xeb')](function(_0x1b7cb9){return db[_0xe1b7('0xec')]['bulkCreate'](_0x29ad35,{'transaction':_0x1b7cb9});});}}})[_0xe1b7('0x16')](function(){if(_0x5a3379){_0x106b95=_0x5a3379;return db[_0xe1b7('0xd9')][_0xe1b7('0x7e')]({'where':{'service':!![]},'include':[{'model':db[_0xe1b7('0xed')],'as':_0xe1b7('0xee'),'raw':!![],'include':[{'model':db['CloudProvider'],'as':_0xe1b7('0xef'),'raw':!![]}]}]});}})[_0xe1b7('0x16')](function(_0x2249d1){if(_0x2249d1&&_0x2249d1[_0xe1b7('0xee')]&&_0x7172d8[_0xe1b7('0xf0')]&&_0x7172d8[_0xe1b7('0xf1')]){var _0x485509=_0x2249d1[_0xe1b7('0xf2')]();return respondWithRpcPromise('SendMail','sendMail',{'account':_0x485509,'message':{'from':util[_0xe1b7('0x32')](_0xe1b7('0xf3'),_0x2249d1[_0xe1b7('0x2d')],_0x2249d1['email']||_0x2249d1['Smtp']['user']),'to':_0x7172d8[_0xe1b7('0xf1')],'subject':_0x7172d8[_0xe1b7('0xf4')],'html':_0x106b95[_0xe1b7('0x71')],'attachments':_0xd497c5}},client9003)['then'](function(){return _0x106b95;})['catch'](function(_0x4b7785){logger['error'](_0x4b7785);});}})[_0xe1b7('0x16')](function(){if(_0x7172d8&&_0x7172d8[_0xe1b7('0xe9')]&&_0x7172d8[_0xe1b7('0xf5')]){var _0x323f23=[];if(_0xdae68a[_0xe1b7('0x5d')]){_0x323f23=_0xdae68a[_0xe1b7('0x3b')](function(_0x2cb17e){return{'name':_0x2cb17e[_0xe1b7('0xe3')],'basename':_0x2cb17e[_0xe1b7('0x8a')],'type':_0x2cb17e[_0xe1b7('0xe4')],'ChatOfflineMessageId':_0x5a3379['id']};});}var _0xf9b6b2;if(!_[_0xe1b7('0x95')](_0x7172d8[_0xe1b7('0xf6')])){var _0x5b09e7=_['map'](_0x31acc2['body'],function(_0x53d914){return _0x53d914;});var _0xdb89cb=_[_0xe1b7('0xf7')](_0x5b09e7)[0x0];var _0xcd8bf8=_[_0xe1b7('0xf8')](_0xdb89cb,function(_0x24ff53){return _0x24ff53;});_0xf9b6b2=_0xcd8bf8[0x1][_0x7172d8['subjectOffline']];}var _0x212041={'from':_0x4b3ea7[_0xe1b7('0xf9')],'firstName':_0x4b3ea7[_0xe1b7('0x48')],'lastName':_0x4b3ea7['lastName'],'mapKey':_0xe1b7('0xf9'),'message':{'from':_0x4b3ea7['email'],'to':_0x7172d8[_0xe1b7('0xd9')][_0xe1b7('0xf9')],'cc':'','subject':_[_0xe1b7('0x95')](_0xf9b6b2)?_0x7172d8[_0xe1b7('0xf4')]:_0xf9b6b2,'messageId':'','sentAt':new Date(),'attach':_0x323f23['length'],'attachments':_0x323f23,'originChannel':_0xe1b7('0xfa'),'ChatWebsiteId':_0x7172d8['id'],'ChatOfflineMessageId':_0x106b95['id'],'originTo':_0x7172d8[_0xe1b7('0xd9')][_0xe1b7('0xf9')]},'body':_0x106b95[_0xe1b7('0x71')]};var _0x5693c8={'account':{'id':_0x7172d8[_0xe1b7('0xf5')]},'body':_0x212041,'log':_0xe1b7('0xfb')};return respondWithRpcPromise(_0xe1b7('0xfb'),_0xe1b7('0xfc'),_0x5693c8,client9001)[_0xe1b7('0x16')](function(){return _0x106b95;})[_0xe1b7('0x39')](function(_0x238830){logger[_0xe1b7('0x1c')](_0x238830);});}return;})[_0xe1b7('0x16')](function(){if(_0x106b95){return _0x106b95;}})[_0xe1b7('0x16')](respondWithResult(_0x3a171c,null))[_0xe1b7('0x39')](function(){for(var _0x2c5ba3 of _0xdae68a){var _0x27cadf=path['join'](config['root'],_0xe1b7('0xe5'),_0xe1b7('0xd4'),_0xe1b7('0xe6'),_0xe1b7('0xe7'),_0x2c5ba3[_0xe1b7('0x8a')]);fs_extra['remove'](_0x27cadf)[_0xe1b7('0x39')](function(_0x5bf10a){logger[_0xe1b7('0x1c')](_0xe1b7('0xfd'),_0x27cadf,_0x5bf10a);});}});};exports['addInteraction']=function(_0x5244ab,_0x5c36c6){return db[_0xe1b7('0xbb')][_0xe1b7('0x6f')]({'where':{'id':_0x5244ab[_0xe1b7('0x6c')]['id']}})[_0xe1b7('0x16')](handleEntityNotFound(_0x5c36c6,null))['then'](function(_0x297d08){if(_0x297d08){return _0x297d08[_0xe1b7('0xfe')](_0x5244ab[_0xe1b7('0x71')][_0xe1b7('0x80')],_[_0xe1b7('0xff')](_0x5244ab['body'],[_0xe1b7('0x80'),'id'])||{});}})[_0xe1b7('0x16')](respondWithResult(_0x5c36c6,null))[_0xe1b7('0x39')](handleError(_0x5c36c6,null));};exports[_0xe1b7('0x100')]=function(_0x4261e6,_0x277c51){var _0xd4af02={'raw':![],'where':{}};var _0x182da6={};var _0x3f7fc9={'count':0x0,'rows':[]};return db[_0xe1b7('0x67')]['findOne']({'where':{'id':_0x4261e6[_0xe1b7('0x6c')]['id']}})[_0xe1b7('0x16')](handleEntityNotFound(_0x277c51,null))['then'](function(_0x407ad6){if(_0x407ad6){_0x182da6[_0xe1b7('0x50')]=_[_0xe1b7('0x58')](db[_0xe1b7('0xbb')][_0xe1b7('0x101')]);_0x182da6['query']=_[_0xe1b7('0x58')](_0x4261e6[_0xe1b7('0x57')]);_0x182da6['filters']=_[_0xe1b7('0x5a')](_0x182da6[_0xe1b7('0x50')],_0x182da6[_0xe1b7('0x57')]);_0xd4af02[_0xe1b7('0x5b')]=_[_0xe1b7('0x5a')](_0x182da6['model'],qs['fields'](_0x4261e6['query'][_0xe1b7('0x5c')]));_0xd4af02[_0xe1b7('0x5b')]=_0xd4af02[_0xe1b7('0x5b')][_0xe1b7('0x5d')]?_0xd4af02['attributes']:_0x182da6[_0xe1b7('0x50')];if(!_0x4261e6[_0xe1b7('0x57')][_0xe1b7('0x5e')](_0xe1b7('0x5f'))){_0xd4af02[_0xe1b7('0x24')]=qs[_0xe1b7('0x24')](_0x4261e6['query']['limit']);_0xd4af02[_0xe1b7('0x22')]=qs[_0xe1b7('0x22')](_0x4261e6[_0xe1b7('0x57')][_0xe1b7('0x22')]);}_0xd4af02[_0xe1b7('0x60')]=qs['sort'](_0x4261e6['query'][_0xe1b7('0x61')]);_0xd4af02[_0xe1b7('0x62')]=qs[_0xe1b7('0x59')](_[_0xe1b7('0x63')](_0x4261e6['query'],_0x182da6[_0xe1b7('0x59')]));_0xd4af02[_0xe1b7('0x62')][_0xe1b7('0x7b')]=_0x407ad6['id'];if(_0x4261e6[_0xe1b7('0x57')][_0xe1b7('0x66')]){_0xd4af02['where']=_['merge'](_0xd4af02['where'],{'$or':_['map'](_0xd4af02[_0xe1b7('0x5b')],function(_0x20f956){var _0x9029f9={};_0x9029f9[_0x20f956]={'$like':'%'+_0x4261e6[_0xe1b7('0x57')][_0xe1b7('0x66')]+'%'};return _0x9029f9;})});}_0xd4af02=_[_0xe1b7('0x64')]({},_0xd4af02,_0x4261e6[_0xe1b7('0x6e')]);return db['ChatInteraction'][_0xe1b7('0x25')]({'where':_0xd4af02[_0xe1b7('0x62')]})[_0xe1b7('0x16')](function(_0x66bb42){_0x3f7fc9[_0xe1b7('0x25')]=_0x66bb42;if(_0x4261e6['query']['includeAll']){_0xd4af02[_0xe1b7('0x84')]=[{'model':db[_0xe1b7('0xab')],'as':_0xe1b7('0x102'),'required':![]},{'model':db['User'],'as':_0xe1b7('0x103'),'attributes':[_0xe1b7('0x2d'),_0xe1b7('0x104'),_0xe1b7('0x105')],'required':![]},{'model':db[_0xe1b7('0x106')],'as':'Tags','attributes':['id',_0xe1b7('0x2d'),_0xe1b7('0x107')],'where':_0x4261e6[_0xe1b7('0x57')][_0xe1b7('0x108')]?{'id':_0x4261e6[_0xe1b7('0x57')][_0xe1b7('0x108')]}:undefined,'required':_0x4261e6[_0xe1b7('0x57')]['tag']?!![]:![]}];}return db[_0xe1b7('0xbb')][_0xe1b7('0x69')](_0xd4af02);})['then'](function(_0x330b11){_0x3f7fc9[_0xe1b7('0x6a')]=_0x330b11;return _0x3f7fc9;});}})[_0xe1b7('0x16')](respondWithFilteredResult(_0x277c51,_0xd4af02))[_0xe1b7('0x39')](handleError(_0x277c51,null));};exports[_0xe1b7('0x30')]=function(_0x1b1074,_0x1b88c5){var _0x726939=0x0;var _0x5f080a=0x0;var _0x3dc41d=![];var _0x5709d4;var _0xe35b42;return db['ChatWebsite'][_0xe1b7('0x6f')]({'where':{'id':_0x1b1074['params']['id']},'include':[{'model':db['Interval'],'as':_0xe1b7('0x3c'),'include':[{'model':db[_0xe1b7('0x3c')],'as':'Intervals','attributes':['id',_0xe1b7('0x33')]}]}]})[_0xe1b7('0x16')](handleEntityNotFound(_0x1b88c5,null))[_0xe1b7('0x16')](function(_0x9d5e85){if(_0x9d5e85){_0x5709d4=_0x9d5e85;return _0x9d5e85[_0xe1b7('0x109')]({'raw':!![]});}})[_0xe1b7('0x16')](function(_0x310c62){if(_0x5709d4){if(_0x310c62){_0xe35b42=_0x310c62;}}return require(_0xe1b7('0x93'))[_0xe1b7('0x94')]();})[_0xe1b7('0x16')](function(_0x38c10e){if(_0x38c10e){_0x5f080a=_0x38c10e['virtual'];_0x3dc41d=_0x38c10e[_0xe1b7('0x10a')];}})['then'](function(){return db[_0xe1b7('0xbb')][_0xe1b7('0x25')]({'where':{'closed':![]}});})[_0xe1b7('0x16')](function(_0x4f5507){_0x726939=_0x4f5507;if(_0x5f080a&&_0x4f5507>_0x5f080a){return db['License'][_0xe1b7('0x7e')]({'where':{'id':0x1}})[_0xe1b7('0x16')](function(_0x43cfa3){if(_0x43cfa3){_0x43cfa3[_0xe1b7('0x10b')]('chatLicenseExceeded');}});}})[_0xe1b7('0x16')](function(){if(!_0x5709d4[_0xe1b7('0x3c')]||!_0x5709d4[_0xe1b7('0x3c')][_0xe1b7('0x3d')])return!![];return checkWebsiteIntervals(_0x5709d4);})[_0xe1b7('0x16')](function(_0x25f11a){var _0x356132=fs[_0xe1b7('0xdb')](path[_0xe1b7('0x90')](config[_0xe1b7('0x91')],'server/files/chat/iframe.ejs'),_0xe1b7('0xdd'));var _0x1ce31b=new url[(_0xe1b7('0x10c'))](_0x5709d4[_0xe1b7('0x10d')])['origin'];var _0x39de60=_0xe1b7('0x10e');var _0x366d80=![];var _0x9d1e4a={'chatVersion':_0x39de60,'chatWebsiteAddressOrigin':_0x1ce31b,'remote':_0x5709d4[_0xe1b7('0x10f')],'query':querystring[_0xe1b7('0x1b')](_[_0xe1b7('0x64')](_0x5709d4[_0xe1b7('0x3e')]({'plain':!![]}),{'customerIp':_0x1b1074['headers'][_0xe1b7('0x45')]||_0x1b1074[_0xe1b7('0x110')][_0xe1b7('0x111')]||_0x1b1074[_0xe1b7('0x112')][_0xe1b7('0x113')]||_0x1b1074['ip'],'referer':_0x1b1074['headers']['referer'],'openedInteractions':_0x726939,'maxInteractions':_0x5f080a,'virtual':_0x3dc41d['virtual'],'online':_0x25f11a,'custom':_0x3dc41d}))[_0xe1b7('0x114')](/'/g,'\x5c\x27')};_0x1b88c5[_0xe1b7('0x2e')](ejs[_0xe1b7('0xde')](Mustache['render'](_0x356132,_0x9d1e4a),{'proactiveActions':_0xe35b42,'alignment':_0x5709d4[_0xe1b7('0x115')],'verticalAlignment':_0x5709d4[_0xe1b7('0x116')],'div_color':_0x5709d4[_0xe1b7('0x107')],'labelText':_0x5709d4['labelText'],'text_color':_0x5709d4[_0xe1b7('0x117')],'text_button_color':_0x5709d4[_0xe1b7('0x118')],'button_color':_0x5709d4[_0xe1b7('0x119')],'background_color':_0x5709d4[_0xe1b7('0x11a')],'hideWhenOffline':_0x5709d4['hideWhenOffline'],'intervalId':_0x5709d4[_0xe1b7('0x11b')],'isDevelopment':_0x366d80,'chatVersion':_0x39de60}));})[_0xe1b7('0x39')](handleError(_0x1b88c5,null));};exports[_0xe1b7('0x11c')]=function(_0x5235ef,_0x46f37f){var _0x16c12d=_0x5235ef['params']['id'];var _0x1a5aed=_0x5235ef['body'];var _0x1702b6=0xc8;var _0x4d4643=null;return db['sequelize']['transaction']({'isolationLevel':db[_0xe1b7('0xea')][_0xe1b7('0x11d')][_0xe1b7('0x11e')][_0xe1b7('0x11f')]},function(_0x38e539){return db[_0xe1b7('0x67')][_0xe1b7('0x7e')]({'where':{'id':_0x16c12d},'transaction':_0x38e539})[_0xe1b7('0x16')](function(_0x35478f){if(_0x35478f){return db[_0xe1b7('0x120')][_0xe1b7('0x28')]({'where':{'ChatWebsiteId':_0x16c12d},'transaction':_0x38e539})[_0xe1b7('0x16')](function(){var _0x23c608=_['map'](_0x1a5aed,function(_0x447935){_0x447935[_0xe1b7('0x7b')]=_0x16c12d;return _0x447935;});return db[_0xe1b7('0x120')][_0xe1b7('0x121')](_0x23c608,{'transaction':_0x38e539});});}else{_0x1702b6=0x194;_0x4d4643=[];}});})[_0xe1b7('0x16')](function(){if(_0x1702b6!==0x194){return db[_0xe1b7('0x120')][_0xe1b7('0x122')]({'where':{'ChatWebsiteId':_0x16c12d},'order':'priority'})[_0xe1b7('0x16')](function(_0x2068ef){_0x4d4643=_0x2068ef;});}})[_0xe1b7('0x39')](function(_0x3d255e){_0x1702b6=0x1f4;logger['error'](_0x3d255e[_0xe1b7('0x2c')]);if(_0x3d255e[_0xe1b7('0x2d')]){delete _0x3d255e[_0xe1b7('0x2d')];}_0x4d4643=_0x3d255e;})['finally'](function(){if(_0x4d4643===null){_0x46f37f[_0xe1b7('0x2b')](_0x1702b6);}else{if(_0x1702b6===0x1f4){_0x46f37f['status'](_0x1702b6)[_0xe1b7('0x2e')](_0x4d4643);}else{_0x46f37f[_0xe1b7('0x2a')](_0x1702b6)[_0xe1b7('0x123')](_0x4d4643);}}});};exports['getApplications']=function(_0x3bb29a,_0x53686c){var _0x3ba2ec={};var _0x1af5c4={};var _0x37af7f;var _0x386287;return db[_0xe1b7('0x67')]['findOne']({'where':{'id':_0x3bb29a[_0xe1b7('0x6c')]['id']}})[_0xe1b7('0x16')](handleEntityNotFound(_0x53686c,null))[_0xe1b7('0x16')](function(_0x4c9a23){if(_0x4c9a23){_0x37af7f=_0x4c9a23;_0x1af5c4['model']=_[_0xe1b7('0x58')](db[_0xe1b7('0x120')][_0xe1b7('0x101')]);_0x1af5c4[_0xe1b7('0x57')]=_['keys'](_0x3bb29a[_0xe1b7('0x57')]);_0x1af5c4['filters']=_[_0xe1b7('0x5a')](_0x1af5c4['model'],_0x1af5c4[_0xe1b7('0x57')]);_0x3ba2ec['attributes']=_[_0xe1b7('0x5a')](_0x1af5c4[_0xe1b7('0x50')],qs[_0xe1b7('0x5c')](_0x3bb29a[_0xe1b7('0x57')]['fields']));_0x3ba2ec[_0xe1b7('0x5b')]=_0x3ba2ec['attributes'][_0xe1b7('0x5d')]?_0x3ba2ec['attributes']:_0x1af5c4['model'];_0x3ba2ec['order']=qs['sort'](_0x3bb29a[_0xe1b7('0x57')][_0xe1b7('0x61')]);_0x3ba2ec['where']=qs[_0xe1b7('0x59')](_[_0xe1b7('0x63')](_0x3bb29a[_0xe1b7('0x57')],_0x1af5c4[_0xe1b7('0x59')]));if(_0x3bb29a[_0xe1b7('0x57')][_0xe1b7('0x66')]){_0x3ba2ec[_0xe1b7('0x62')]=_[_0xe1b7('0x64')](_0x3ba2ec[_0xe1b7('0x62')],{'$or':_[_0xe1b7('0x3b')](_0x3ba2ec[_0xe1b7('0x5b')],function(_0x6b8cdb){var _0xbb94ee={};_0xbb94ee[_0x6b8cdb]={'$like':'%'+_0x3bb29a[_0xe1b7('0x57')][_0xe1b7('0x66')]+'%'};return _0xbb94ee;})});}_0x3ba2ec=_[_0xe1b7('0x64')]({},_0x3ba2ec,_0x3bb29a[_0xe1b7('0x6e')]);return _0x37af7f[_0xe1b7('0x124')](_0x3ba2ec);}})[_0xe1b7('0x16')](function(_0x1f1546){if(_0x1f1546){_0x386287=_0x1f1546['length'];if(!_0x3bb29a['query'][_0xe1b7('0x5e')](_0xe1b7('0x5f'))){_0x3ba2ec[_0xe1b7('0x24')]=qs[_0xe1b7('0x24')](_0x3bb29a[_0xe1b7('0x57')][_0xe1b7('0x24')]);_0x3ba2ec[_0xe1b7('0x22')]=qs['offset'](_0x3bb29a[_0xe1b7('0x57')][_0xe1b7('0x22')]);}return _0x37af7f[_0xe1b7('0x124')](_0x3ba2ec);}})[_0xe1b7('0x16')](function(_0x3b9eb3){if(_0x3b9eb3){return _0x3b9eb3?{'count':_0x386287,'rows':_0x3b9eb3}:null;}})[_0xe1b7('0x16')](respondWithResult(_0x53686c,null))[_0xe1b7('0x39')](handleError(_0x53686c,null));};exports[_0xe1b7('0x125')]=function(_0x38e548,_0x55e1e4){return db[_0xe1b7('0x126')]['find']({'where':{'id':_0x38e548[_0xe1b7('0x6c')]['id']}})[_0xe1b7('0x16')](handleEntityNotFound(_0x55e1e4,null))[_0xe1b7('0x16')](function(_0x3b8c9d){if(_0x3b8c9d){return _0x3b8c9d['addProactiveActions'](_0x38e548[_0xe1b7('0x71')][_0xe1b7('0x80')],_[_0xe1b7('0xff')](_0x38e548[_0xe1b7('0x71')],['ids','id'])||{});}})[_0xe1b7('0x16')](respondWithResult(_0x55e1e4,null))['catch'](handleError(_0x55e1e4,null));};exports[_0xe1b7('0x109')]=function(_0x5dacf4,_0x4f6507){var _0x570df7={};var _0x45a2b9={};var _0x4d3529;var _0x279a99;return db[_0xe1b7('0x67')][_0xe1b7('0x7e')]({'where':{'id':_0x5dacf4[_0xe1b7('0x6c')]['id']}})[_0xe1b7('0x16')](handleEntityNotFound(_0x4f6507,null))[_0xe1b7('0x16')](function(_0x297309){if(_0x297309){_0x4d3529=_0x297309;_0x45a2b9['model']=_[_0xe1b7('0x58')](db['ChatProactiveAction']['rawAttributes']);_0x45a2b9[_0xe1b7('0x57')]=_[_0xe1b7('0x58')](_0x5dacf4[_0xe1b7('0x57')]);_0x45a2b9[_0xe1b7('0x59')]=_[_0xe1b7('0x5a')](_0x45a2b9[_0xe1b7('0x50')],_0x45a2b9[_0xe1b7('0x57')]);_0x570df7[_0xe1b7('0x5b')]=_[_0xe1b7('0x5a')](_0x45a2b9[_0xe1b7('0x50')],qs[_0xe1b7('0x5c')](_0x5dacf4['query'][_0xe1b7('0x5c')]));_0x570df7[_0xe1b7('0x5b')]=_0x570df7['attributes']['length']?_0x570df7['attributes']:_0x45a2b9['model'];_0x570df7[_0xe1b7('0x60')]=qs[_0xe1b7('0x61')](_0x5dacf4[_0xe1b7('0x57')]['sort']);_0x570df7[_0xe1b7('0x62')]=qs[_0xe1b7('0x59')](_[_0xe1b7('0x63')](_0x5dacf4[_0xe1b7('0x57')],_0x45a2b9[_0xe1b7('0x59')]));if(_0x5dacf4[_0xe1b7('0x57')]['filter']){_0x570df7[_0xe1b7('0x62')]=_['merge'](_0x570df7[_0xe1b7('0x62')],{'$or':_['map'](_0x570df7[_0xe1b7('0x5b')],function(_0x12592f){var _0x28f803={};_0x28f803[_0x12592f]={'$like':'%'+_0x5dacf4[_0xe1b7('0x57')][_0xe1b7('0x66')]+'%'};return _0x28f803;})});}_0x570df7=_['merge']({},_0x570df7,_0x5dacf4[_0xe1b7('0x6e')]);return _0x4d3529[_0xe1b7('0x109')](_0x570df7);}})[_0xe1b7('0x16')](function(_0xdbefb9){if(_0xdbefb9){_0x279a99=_0xdbefb9[_0xe1b7('0x5d')];if(!_0x5dacf4[_0xe1b7('0x57')][_0xe1b7('0x5e')]('nolimit')){_0x570df7[_0xe1b7('0x24')]=qs[_0xe1b7('0x24')](_0x5dacf4[_0xe1b7('0x57')][_0xe1b7('0x24')]);_0x570df7[_0xe1b7('0x22')]=qs[_0xe1b7('0x22')](_0x5dacf4[_0xe1b7('0x57')][_0xe1b7('0x22')]);}return _0x4d3529[_0xe1b7('0x109')](_0x570df7);}})[_0xe1b7('0x16')](function(_0x12b21d){if(_0x12b21d){return _0x12b21d?{'count':_0x279a99,'rows':_0x12b21d}:null;}})['then'](respondWithResult(_0x4f6507,null))[_0xe1b7('0x39')](handleError(_0x4f6507,null));};exports['getFields']=function(_0x286ed3,_0x5eb516){var _0x5b4c67=_0x286ed3[_0xe1b7('0x57')][_0xe1b7('0x127')]===_0xe1b7('0x128')?_0xe1b7('0x129'):'onlineForm';return db[_0xe1b7('0x67')]['find']({'attributes':['id',_0x5b4c67],'where':{'id':_0x286ed3[_0xe1b7('0x6c')]['id']}})[_0xe1b7('0x16')](handleEntityNotFound(_0x5eb516,null))['then'](function(_0x4ca197){if(_0x4ca197){var _0xd5e9a0=_0x4ca197[_0x5b4c67];var _0x4389bd=_0xd5e9a0&&_0xd5e9a0[_0xe1b7('0x12a')]?_0xd5e9a0['items']:[];_0x5eb516[_0xe1b7('0x2e')]({'fromKey':_[_0xe1b7('0x95')](_0xd5e9a0[_0xe1b7('0x12b')])?undefined:_0xd5e9a0[_0xe1b7('0x12b')],'count':_0x4389bd[_0xe1b7('0x5d')],'rows':_0x4389bd});}})[_0xe1b7('0x39')](handleError(_0x5eb516,null));};exports[_0xe1b7('0x12c')]=function(_0xf99fbf,_0x3a6ca6){var _0x19f14c={'raw':![],'where':{}};var _0x5092e1={};var _0x114cd7={'count':0x0,'rows':[]};return db[_0xe1b7('0x67')][_0xe1b7('0x7e')]({'where':{'id':_0xf99fbf[_0xe1b7('0x6c')]['id']}})[_0xe1b7('0x16')](handleEntityNotFound(_0x3a6ca6,null))[_0xe1b7('0x16')](function(_0xbac304){if(_0xbac304){_0x5092e1['model']=_[_0xe1b7('0x58')](db[_0xe1b7('0xe1')][_0xe1b7('0x101')]);_0x5092e1[_0xe1b7('0x57')]=_[_0xe1b7('0x58')](_0xf99fbf['query']);_0x5092e1[_0xe1b7('0x59')]=_['intersection'](_0x5092e1[_0xe1b7('0x50')],_0x5092e1[_0xe1b7('0x57')]);_0x19f14c[_0xe1b7('0x5b')]=_[_0xe1b7('0x5a')](_0x5092e1[_0xe1b7('0x50')],qs[_0xe1b7('0x5c')](_0xf99fbf[_0xe1b7('0x57')][_0xe1b7('0x5c')]));_0x19f14c[_0xe1b7('0x5b')]=_0x19f14c[_0xe1b7('0x5b')]['length']?_0x19f14c['attributes']:_0x5092e1['model'];if(!_0xf99fbf['query']['hasOwnProperty'](_0xe1b7('0x5f'))){_0x19f14c['limit']=qs[_0xe1b7('0x24')](_0xf99fbf['query'][_0xe1b7('0x24')]);_0x19f14c['offset']=qs[_0xe1b7('0x22')](_0xf99fbf[_0xe1b7('0x57')][_0xe1b7('0x22')]);}_0x19f14c[_0xe1b7('0x60')]=qs[_0xe1b7('0x61')](_0xf99fbf[_0xe1b7('0x57')][_0xe1b7('0x61')]);_0x19f14c['where']=qs[_0xe1b7('0x59')](_[_0xe1b7('0x63')](_0xf99fbf[_0xe1b7('0x57')],_0x5092e1[_0xe1b7('0x59')]));_0x19f14c['where']['ChatWebsiteId']=_0xbac304['id'];if(_0xf99fbf[_0xe1b7('0x57')][_0xe1b7('0x66')]){_0x19f14c[_0xe1b7('0x62')]=_[_0xe1b7('0x64')](_0x19f14c['where'],{'$or':_[_0xe1b7('0x3b')](_0x19f14c['attributes'],function(_0x5de66f){var _0x6c0c0d={};_0x6c0c0d[_0x5de66f]={'$like':'%'+_0xf99fbf[_0xe1b7('0x57')][_0xe1b7('0x66')]+'%'};return _0x6c0c0d;})});}_0x19f14c=_[_0xe1b7('0x64')]({},_0x19f14c,_0xf99fbf[_0xe1b7('0x6e')]);return db[_0xe1b7('0xe1')][_0xe1b7('0x25')]({'where':_0x19f14c[_0xe1b7('0x62')]})['then'](function(_0x1139b2){_0x114cd7[_0xe1b7('0x25')]=_0x1139b2;if(_0xf99fbf[_0xe1b7('0x57')][_0xe1b7('0x68')]){_0x19f14c[_0xe1b7('0x84')]=[{'all':!![]}];}else{_0x19f14c['include']=[{'model':db[_0xe1b7('0xab')],'as':_0xe1b7('0x102'),'required':![]},{'model':db[_0xe1b7('0xec')],'as':_0xe1b7('0x12d'),'required':![]}];}return db[_0xe1b7('0xe1')][_0xe1b7('0x69')](_0x19f14c);})[_0xe1b7('0x16')](function(_0x529dc7){_0x114cd7[_0xe1b7('0x6a')]=_0x529dc7;return _0x114cd7;});}})[_0xe1b7('0x16')](respondWithFilteredResult(_0x3a6ca6,_0x19f14c))[_0xe1b7('0x39')](handleError(_0x3a6ca6,null));};exports[_0xe1b7('0x12e')]=function(_0x364231,_0x5e93e4){return db[_0xe1b7('0x67')]['find']({'where':{'id':_0x364231[_0xe1b7('0x6c')]['id']}})[_0xe1b7('0x16')](handleEntityNotFound(_0x5e93e4,null))[_0xe1b7('0x16')](function(_0x50f762){if(_0x50f762){return _0x50f762[_0xe1b7('0x12e')](_0x364231[_0xe1b7('0x71')]['ids'],_[_0xe1b7('0xff')](_0x364231[_0xe1b7('0x71')],[_0xe1b7('0x80'),'id'])||{})[_0xe1b7('0xaf')](function(_0x58b828){for(var _0x48e162=0x0;_0x48e162<_0x364231[_0xe1b7('0x71')]['ids'][_0xe1b7('0x5d')];_0x48e162+=0x1){socket[_0xe1b7('0x12f')](_0xe1b7('0x130'),{'UserId':Number(_0x364231[_0xe1b7('0x71')][_0xe1b7('0x80')][_0x48e162]),'ChatWebsiteId':Number(_0x364231['params']['id'])});}return _0x58b828;});}})['then'](respondWithResult(_0x5e93e4,null))[_0xe1b7('0x39')](handleError(_0x5e93e4,null));};exports['removeAgents']=function(_0x1d331a,_0x3cf0fe){return db[_0xe1b7('0x67')]['find']({'where':{'id':_0x1d331a[_0xe1b7('0x6c')]['id']}})['then'](handleEntityNotFound(_0x3cf0fe,null))[_0xe1b7('0x16')](function(_0x1da2e3){if(_0x1da2e3){return _0x1da2e3[_0xe1b7('0x131')](_0x1d331a[_0xe1b7('0x57')][_0xe1b7('0x80')])['then'](function(){if(_['isArray'](_0x1d331a[_0xe1b7('0x57')][_0xe1b7('0x80')])){for(var _0x3cf1bf=0x0;_0x3cf1bf<_0x1d331a[_0xe1b7('0x57')][_0xe1b7('0x80')][_0xe1b7('0x5d')];_0x3cf1bf+=0x1){socket['emit'](_0xe1b7('0x132'),{'UserId':Number(_0x1d331a['query'][_0xe1b7('0x80')][_0x3cf1bf]),'ChatWebsiteId':Number(_0x1d331a[_0xe1b7('0x6c')]['id'])});}}else{socket[_0xe1b7('0x12f')]('userChatWebsite:remove',{'UserId':Number(_0x1d331a[_0xe1b7('0x57')][_0xe1b7('0x80')]),'ChatWebsiteId':Number(_0x1d331a[_0xe1b7('0x6c')]['id'])});}});}})[_0xe1b7('0x16')](respondWithStatusCode(_0x3cf0fe,null))['catch'](handleError(_0x3cf0fe,null));};exports[_0xe1b7('0x133')]=function(_0x415457,_0x5b431c){var _0x4206bf={};var _0x407b79={};var _0x3fa647;var _0x4996bb;return db[_0xe1b7('0x67')][_0xe1b7('0x7e')]({'where':{'id':_0x415457[_0xe1b7('0x6c')]['id']}})['then'](handleEntityNotFound(_0x5b431c,null))[_0xe1b7('0x16')](function(_0x47ec87){if(_0x47ec87){_0x3fa647=_0x47ec87;_0x407b79['model']=_['keys'](db[_0xe1b7('0xc8')][_0xe1b7('0x101')]);_0x407b79[_0xe1b7('0x57')]=_['keys'](_0x415457[_0xe1b7('0x57')]);_0x407b79[_0xe1b7('0x59')]=_[_0xe1b7('0x5a')](_0x407b79[_0xe1b7('0x50')],_0x407b79['query']);_0x4206bf[_0xe1b7('0x5b')]=_[_0xe1b7('0x5a')](_0x407b79[_0xe1b7('0x50')],qs['fields'](_0x415457['query']['fields']));_0x4206bf[_0xe1b7('0x5b')]=_0x4206bf[_0xe1b7('0x5b')][_0xe1b7('0x5d')]?_0x4206bf['attributes']:_0x407b79[_0xe1b7('0x50')];_0x4206bf['order']=qs[_0xe1b7('0x61')](_0x415457['query'][_0xe1b7('0x61')]);_0x4206bf[_0xe1b7('0x62')]=qs[_0xe1b7('0x59')](_[_0xe1b7('0x63')](_0x415457['query'],_0x407b79[_0xe1b7('0x59')]));if(_0x415457[_0xe1b7('0x57')][_0xe1b7('0x66')]){_0x4206bf[_0xe1b7('0x62')]=_['merge'](_0x4206bf[_0xe1b7('0x62')],{'$or':_[_0xe1b7('0x3b')](_0x4206bf[_0xe1b7('0x5b')],function(_0x3a9d37){var _0x405ed3={};_0x405ed3[_0x3a9d37]={'$like':'%'+_0x415457[_0xe1b7('0x57')]['filter']+'%'};return _0x405ed3;})});}_0x4206bf=_[_0xe1b7('0x64')]({},_0x4206bf,_0x415457[_0xe1b7('0x6e')]);return _0x3fa647[_0xe1b7('0x133')](_0x4206bf);}})[_0xe1b7('0x16')](function(_0x2301e8){if(_0x2301e8){_0x4996bb=_0x2301e8['length'];if(!_0x415457['query'][_0xe1b7('0x5e')](_0xe1b7('0x5f'))){_0x4206bf['limit']=qs[_0xe1b7('0x24')](_0x415457[_0xe1b7('0x57')][_0xe1b7('0x24')]);_0x4206bf[_0xe1b7('0x22')]=qs['offset'](_0x415457['query']['offset']);}return _0x3fa647[_0xe1b7('0x133')](_0x4206bf);}})[_0xe1b7('0x16')](function(_0x74b700){if(_0x74b700){return _0x74b700?{'count':_0x4996bb,'rows':_0x74b700}:null;}})[_0xe1b7('0x16')](respondWithResult(_0x5b431c,null))['catch'](handleError(_0x5b431c,null));}; \ No newline at end of file +var _0xc89d=['chat','CmContact','Sequelize','ValidationError','no\x20available\x20attributes','difference','updatedAt','createdAt','ListId','from','from\x20is\x20mandatory','mapKey','mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','includes','mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','CmList','List','DESC','ChatApplication','Applications','Chat\x20Website\x20with\x20id\x20%s\x20not\x20found','spread','account','list','applications','orderBy','priority','asc','Contacts','contact','threadId','ChatInteraction','externalUrl','ContactId','interaction','messageId','created','autoclose','push','close','unmanaged','*,*,*,*','ChatMessage','UserId','User','unshift','agent','waitForTheAssignedAgent','ChatQueue','queueId','queue','waitForTheAssignedQueue','Start','startRouting','EventManager','offline','files','CompanyId','body\x20is\x20mandatory\x20and\x20not\x20empty','mapKeyOffline','mapKeyOffline\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','mapKeyOffline\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','MailAccount','server/files/templates/chatOfflineMessage.ejs','utf8','toPairs','offlineMessageBody','fromString','originalname','mimetype','server','attachments','offline-chat','basename','openNewInteraction','sequelize','transaction','Attachment','bulkCreate','findOne','Smtp','CloudProvider','forwardOffline','forwardOfflineAddress','getSmtpOptions','SendMail','sendMail','email','user','offlineMessageSubject','MailAccountId','subjectOffline','toPairsIn','mapValues','Chat','NotifyMailAccount','notifyMail','remove','Could\x20not\x20remove\x20attachment\x20file','omit','getInteractions','Contact','fullname','internal','Tag','Tags','color','tag','getProactiveActions','../../config/license/util','getLicense','virtual','License','chatLicenseExceeded','readFileSync','URL','origin','remote','headers','connection','referer','replace','render','verticalAlignment','labelText','textColor','textButtonColor','color_button','IntervalId','addApplications','Transaction','ISOLATION_LEVELS','findAndCountAll','getApplications','addProactiveActions','chatProactiveAction','ChatProactiveAction','getFields','online','false','onlineForm','items','fromKey','getOfflineMessages','ChatOfflineMessage','Attachments','addAgents','emit','removeAgents','isArray','getAgents','mustache','util','path','fs-extra','lodash','querystring','html-to-text','jayson/promise','url','../../components/parsers/qs','../../config/logger','api','../../errors/api','APIOutOfIntervalError','APINotFoundError','handleError','../../mysqldb','redis','defaults','socket.io-emitter','./chatWebsite.socket','register','client','http','info','ChatWebsite,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','result','catch','sendStatus','status','end','json','offset','undefined','limit','count','set','update','then','get','ChatWebsites','UserProfileResource','destroy','stack','name','send','Command','getSnippet','timezone','format','iftime\x20%s,%s','interval','iftime\x20%s','true','[%s][INTERVAL][%s]\x20%s\x20%s\x20(%s)','OFFLINE','No\x20timezone','map','Interval','Intervals','all','setUA','user-agent','getResult','customerIp','cf-connecting-ip','first','x-forwarded-for','firstName','lastName','x-real-port','browser','version','%s\x20%s','unknown','device','model','%s\x20%s\x20%s','vendor','type','rawAttributes','fieldName','key','query','filters','attributes','intersection','fields','length','order','sort','where','pick','filter','VIRTUAL','merge','options','ChatWebsite','includeAll','include','findAll','rows','show','Pause','mandatoryDispositionPause','keys','create','body','Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileSection','find','autoAssociation','describe','addDisposition','params','ChatWebsiteId','Disposition','hasOwnProperty','nolimit','removeDispositions','ids','CannedAnswer','removeAnswers','addLogo','filename','agentAvatar','file','addCustomerAvatar','systemAvatar','join','root','server/files/images/logos/default_logo.svg','sitepic','custom','isNil','existsSync','server/files/images/logos/','download','getAvatar','server/files/images/avatars/default_avatar.png','server/files/images/avatars/','getCustomerAvatar','server/files/images/avatars/customer_avatar.png','customerAvatar','showCustomerAvatar','getSystemAvatar','server/files/images/avatars/system_avatar.png','notify'];(function(_0x2976e7,_0x499872){var _0x55f650=function(_0x59a123){while(--_0x59a123){_0x2976e7['push'](_0x2976e7['shift']());}};_0x55f650(++_0x499872);}(_0xc89d,0x1c8));var _0xdc89=function(_0x22bad8,_0x5b5324){_0x22bad8=_0x22bad8-0x0;var _0x3795ea=_0xc89d[_0x22bad8];return _0x3795ea;};'use strict';var Mustache=require(_0xdc89('0x0'));var util=require(_0xdc89('0x1'));var path=require(_0xdc89('0x2'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xdc89('0x3'));var _=require(_0xdc89('0x4'));var querystring=require(_0xdc89('0x5'));var htmlToText=require(_0xdc89('0x6'));var Redis=require('ioredis');var jayson=require(_0xdc89('0x7'));var url=require(_0xdc89('0x8'));var qs=require(_0xdc89('0x9'));var logger=require(_0xdc89('0xa'))(_0xdc89('0xb'));var config=require('../../config/environment');var APIOutOfIntervalError=require(_0xdc89('0xc'))[_0xdc89('0xd')];var APINotFoundError=require('../../errors/api')[_0xdc89('0xe')];var APIHandleError=require('../../errors/api')[_0xdc89('0xf')];var db=require(_0xdc89('0x10'))['db'];config[_0xdc89('0x11')]=_[_0xdc89('0x12')](config[_0xdc89('0x11')],{'host':'localhost','port':0x18eb});var socket=require(_0xdc89('0x13'))(new Redis(config[_0xdc89('0x11')]));require(_0xdc89('0x14'))[_0xdc89('0x15')](socket);var client=jayson[_0xdc89('0x16')]['http']({'port':0x232c});var client9002=jayson[_0xdc89('0x16')][_0xdc89('0x17')]({'port':0x232a});var client9003=jayson[_0xdc89('0x16')]['http']({'port':0x232b});var client9001=jayson['client'][_0xdc89('0x17')]({'port':0x2329});function respondWithRpcPromise(_0x4251ee,_0x554fbb,_0x5e38c9,_0x15547c){return new Promise(function(_0x11886c,_0x2adfdb){var _0x488aa1=_0x15547c||client;return _0x488aa1['request'](_0x4251ee,_0x5e38c9)['then'](function(_0x527acd){logger[_0xdc89('0x18')](_0xdc89('0x19'),_0x554fbb,_0xdc89('0x1a'));logger[_0xdc89('0x1b')]('ChatWebsite,\x20%s,\x20%s,\x20%s',_0x554fbb,_0xdc89('0x1a'),JSON[_0xdc89('0x1c')](_0x527acd));if(_0x527acd[_0xdc89('0x1d')]){if(_0x527acd[_0xdc89('0x1d')][_0xdc89('0x1e')]===0x1f4){logger[_0xdc89('0x1d')](_0xdc89('0x19'),_0x554fbb,_0x527acd[_0xdc89('0x1d')]['message']);return _0x2adfdb(_0x527acd[_0xdc89('0x1d')][_0xdc89('0x1f')]);}logger[_0xdc89('0x1d')]('ChatWebsite,\x20%s,\x20%s',_0x554fbb,_0x527acd['error'][_0xdc89('0x1f')]);return _0x11886c(_0x527acd[_0xdc89('0x1d')][_0xdc89('0x1f')]);}else{logger[_0xdc89('0x18')](_0xdc89('0x19'),_0x554fbb,_0xdc89('0x1a'));_0x11886c(_0x527acd[_0xdc89('0x20')][_0xdc89('0x1f')]);}})[_0xdc89('0x21')](function(_0x803832){logger[_0xdc89('0x1d')](_0xdc89('0x19'),_0x554fbb,_0x803832);_0x2adfdb(_0x803832);});});}function respondWithStatusCode(_0x3ff598,_0x5f0a54){_0x5f0a54=_0x5f0a54||0xcc;return function(_0x266e2c){if(_0x266e2c){return _0x3ff598[_0xdc89('0x22')](_0x5f0a54);}return _0x3ff598[_0xdc89('0x23')](_0x5f0a54)[_0xdc89('0x24')]();};}function respondWithResult(_0x4e1915,_0x5cb4fe){_0x5cb4fe=_0x5cb4fe||0xc8;return function(_0x3560b3){if(_0x3560b3){return _0x4e1915[_0xdc89('0x23')](_0x5cb4fe)[_0xdc89('0x25')](_0x3560b3);}};}function respondWithFilteredResult(_0x1dc9f6,_0x13989b){return function(_0x33dec8){if(_0x33dec8){var _0x43ec25=typeof _0x13989b[_0xdc89('0x26')]===_0xdc89('0x27')&&typeof _0x13989b[_0xdc89('0x28')]===_0xdc89('0x27');var _0x434377=_0x33dec8['count'];var _0xede4a6=_0x43ec25?0x0:_0x13989b[_0xdc89('0x26')];var _0x4f9b98=_0x43ec25?_0x33dec8[_0xdc89('0x29')]:_0x13989b[_0xdc89('0x26')]+_0x13989b[_0xdc89('0x28')];var _0x39b22f;if(_0x4f9b98>=_0x434377){_0x4f9b98=_0x434377;_0x39b22f=0xc8;}else{_0x39b22f=0xce;}_0x1dc9f6[_0xdc89('0x23')](_0x39b22f);return _0x1dc9f6[_0xdc89('0x2a')]('Content-Range',_0xede4a6+'-'+_0x4f9b98+'/'+_0x434377)[_0xdc89('0x25')](_0x33dec8);}return null;};}function saveUpdates(_0x58120c){return function(_0x4c4dc6){if(_0x4c4dc6){return _0x4c4dc6[_0xdc89('0x2b')](_0x58120c)[_0xdc89('0x2c')](function(_0x3f9f12){return _0x3f9f12;});}return null;};}function removeEntity(_0x3e30e4){return function(_0x181595){if(_0x181595){return _0x181595['destroy']()[_0xdc89('0x2c')](function(){var _0x22d41e=_0x181595[_0xdc89('0x2d')]({'plain':!![]});var _0x4cb71d=_0xdc89('0x2e');return db[_0xdc89('0x2f')][_0xdc89('0x30')]({'where':{'type':_0x4cb71d,'resourceId':_0x22d41e['id']}})[_0xdc89('0x2c')](function(){return _0x181595;});})['then'](function(){_0x3e30e4[_0xdc89('0x23')](0xcc)[_0xdc89('0x24')]();});}};}function handleEntityNotFound(_0xe3e091){return function(_0x2a0def){if(!_0x2a0def){_0xe3e091[_0xdc89('0x22')](0x194);}return _0x2a0def;};}function handleError(_0x38a708,_0x13eef0){_0x13eef0=_0x13eef0||0x1f4;return function(_0x5d7540){logger[_0xdc89('0x1d')](_0x5d7540[_0xdc89('0x31')]);if(_0x5d7540['name']){delete _0x5d7540[_0xdc89('0x32')];}_0x38a708['status'](_0x13eef0)[_0xdc89('0x33')](_0x5d7540);};}function iftimePromise(_0x12e9cf,_0x191493){return respondWithRpcPromise(_0xdc89('0x34'),_0xdc89('0x35'),{'command':_0x191493[_0xdc89('0x36')]?util[_0xdc89('0x37')](_0xdc89('0x38'),_0x12e9cf[_0xdc89('0x39')],_0x191493['timezone']):util[_0xdc89('0x37')](_0xdc89('0x3a'),_0x12e9cf[_0xdc89('0x39')])},client9002)['then'](function(_0x22f9b0){var _0x4391e7=_0x22f9b0&&_0x22f9b0['indexOf'](_0xdc89('0x3b'))>=0x0?!![]:![];logger[_0xdc89('0x18')](_0xdc89('0x3c'),_0x191493['id'],_0x12e9cf['id'],_0x12e9cf[_0xdc89('0x39')],_0x4391e7?'ONLINE':_0xdc89('0x3d'),_0x191493['timezone']?_0x191493['timezone']:_0xdc89('0x3e'));return _0x4391e7;})[_0xdc89('0x21')](function(_0x2e4a03){logger[_0xdc89('0x1d')]('[%s][INTERVAL][%s]\x20%s\x20%s\x20(%s)',_0x191493['id'],_0x12e9cf['id'],_0x12e9cf[_0xdc89('0x39')],util['inspect'](_0x2e4a03,{'showHidden':![],'depth':null}),_0x191493[_0xdc89('0x36')]?_0x191493[_0xdc89('0x36')]:_0xdc89('0x3e'));return![];});}function checkWebsiteIntervals(_0xe0973f){var _0x9183c9=_[_0xdc89('0x3f')](_0xe0973f[_0xdc89('0x40')][_0xdc89('0x41')],function(_0x122641){var _0x5d661b=_0x122641[_0xdc89('0x2d')]({'plain':!![]});return iftimePromise(_0x5d661b,_0xe0973f);});return Promise[_0xdc89('0x42')](_0x9183c9)[_0xdc89('0x2c')](function(_0x4aabcb){return _['some'](_0x4aabcb);});}function createInteractionObject(_0x4a6172,_0x221962,_0x42f264,_0xb614d7){var _0x41be1f=require('user-agent-parser');var _0x412113=new _0x41be1f();var _0x7c651b=_0x412113[_0xdc89('0x43')](_0x42f264[_0xdc89('0x44')])[_0xdc89('0x45')]();var _0x49a719=_0x221962[_0xdc89('0x46')];if(_0x42f264[_0xdc89('0x47')]){_0x49a719=_0x42f264[_0xdc89('0x47')];}else if(_0x42f264['x-forwarded-for']){_0x49a719=_[_0xdc89('0x48')](_0x42f264[_0xdc89('0x49')]['split'](','));}return{'ContactId':_0xb614d7['id'],'ChatWebsiteId':_0x4a6172,'from':(_0xb614d7[_0xdc89('0x4a')]||'')+'\x20'+(_0xb614d7[_0xdc89('0x4b')]||''),'customerIp':_0x49a719,'customerPort':_0x42f264[_0xdc89('0x4c')]?_0x42f264[_0xdc89('0x4c')]:null,'referer':_0x221962['referer'],'browserName':_0x7c651b[_0xdc89('0x4d')][_0xdc89('0x32')]&&_0x7c651b[_0xdc89('0x4d')][_0xdc89('0x4e')]?util['format'](_0xdc89('0x4f'),_0x7c651b[_0xdc89('0x4d')][_0xdc89('0x32')],_0x7c651b[_0xdc89('0x4d')]['version']):_0xdc89('0x50'),'browserVersion':_0x7c651b[_0xdc89('0x4d')][_0xdc89('0x4e')]||_0xdc89('0x50'),'osName':util[_0xdc89('0x37')](_0xdc89('0x4f'),_0x7c651b['os'][_0xdc89('0x32')],_0x7c651b['os'][_0xdc89('0x4e')]),'osVersion':_0x7c651b['os'][_0xdc89('0x4e')],'deviceModel':_0x7c651b[_0xdc89('0x51')][_0xdc89('0x52')]&&_0x7c651b['device']['vendor']?util[_0xdc89('0x37')](_0xdc89('0x53'),_0x7c651b[_0xdc89('0x51')][_0xdc89('0x52')],_0x7c651b[_0xdc89('0x51')][_0xdc89('0x54')],_0x7c651b[_0xdc89('0x51')][_0xdc89('0x55')]):null,'deviceVendor':_0x7c651b[_0xdc89('0x51')]['vendor'],'deviceType':_0x7c651b[_0xdc89('0x51')][_0xdc89('0x55')],'formData':JSON[_0xdc89('0x1c')](_0x221962)};}exports['index']=function(_0x18e5f7,_0x1318f9){var _0x48dc8f={'include':[{'model':db['Pause'],'as':'mandatoryDispositionPause'}]},_0x5883e4={},_0x261c0b={'count':0x0,'rows':[]};var _0x241cb8=_[_0xdc89('0x3f')](db['ChatWebsite'][_0xdc89('0x56')],function(_0x29d0c0){return{'name':_0x29d0c0[_0xdc89('0x57')],'type':_0x29d0c0[_0xdc89('0x55')][_0xdc89('0x58')]};});_0x5883e4[_0xdc89('0x52')]=_['map'](_0x241cb8,'name');_0x5883e4[_0xdc89('0x59')]=_['keys'](_0x18e5f7[_0xdc89('0x59')]);_0x5883e4[_0xdc89('0x5a')]=_['intersection'](_0x5883e4['model'],_0x5883e4[_0xdc89('0x59')]);_0x48dc8f[_0xdc89('0x5b')]=_[_0xdc89('0x5c')](_0x5883e4[_0xdc89('0x52')],qs['fields'](_0x18e5f7['query'][_0xdc89('0x5d')]));_0x48dc8f[_0xdc89('0x5b')]=_0x48dc8f['attributes'][_0xdc89('0x5e')]?_0x48dc8f['attributes']:_0x5883e4[_0xdc89('0x52')];if(!_0x18e5f7[_0xdc89('0x59')]['hasOwnProperty']('nolimit')){_0x48dc8f['limit']=qs[_0xdc89('0x28')](_0x18e5f7[_0xdc89('0x59')]['limit']);_0x48dc8f['offset']=qs[_0xdc89('0x26')](_0x18e5f7[_0xdc89('0x59')][_0xdc89('0x26')]);}_0x48dc8f[_0xdc89('0x5f')]=qs[_0xdc89('0x60')](_0x18e5f7[_0xdc89('0x59')][_0xdc89('0x60')]);_0x48dc8f[_0xdc89('0x61')]=qs[_0xdc89('0x5a')](_[_0xdc89('0x62')](_0x18e5f7[_0xdc89('0x59')],_0x5883e4['filters']),_0x241cb8);if(_0x18e5f7[_0xdc89('0x59')][_0xdc89('0x63')]){_0x48dc8f[_0xdc89('0x61')]=_['merge'](_0x48dc8f['where'],{'$or':_[_0xdc89('0x3f')](_0x241cb8,function(_0x436462){if(_0x436462[_0xdc89('0x55')]!==_0xdc89('0x64')){var _0x545296={};_0x545296[_0x436462[_0xdc89('0x32')]]={'$like':'%'+_0x18e5f7[_0xdc89('0x59')]['filter']+'%'};return _0x545296;}})});}_0x48dc8f=_[_0xdc89('0x65')]({},_0x48dc8f,_0x18e5f7[_0xdc89('0x66')]);var _0x49536c={'where':_0x48dc8f[_0xdc89('0x61')]};return db[_0xdc89('0x67')][_0xdc89('0x29')](_0x49536c)[_0xdc89('0x2c')](function(_0x3e2ee8){_0x261c0b[_0xdc89('0x29')]=_0x3e2ee8;if(_0x18e5f7[_0xdc89('0x59')][_0xdc89('0x68')]){_0x48dc8f[_0xdc89('0x69')]=[{'all':!![]}];}return db[_0xdc89('0x67')][_0xdc89('0x6a')](_0x48dc8f);})[_0xdc89('0x2c')](function(_0x309dc4){_0x261c0b[_0xdc89('0x6b')]=_0x309dc4;return _0x261c0b;})[_0xdc89('0x2c')](respondWithFilteredResult(_0x1318f9,_0x48dc8f))[_0xdc89('0x21')](handleError(_0x1318f9,null));};exports[_0xdc89('0x6c')]=function(_0x1bc317,_0x589d52){var _0x36738c={'raw':![],'where':{'id':_0x1bc317['params']['id']},'include':[{'model':db[_0xdc89('0x6d')],'as':_0xdc89('0x6e')}]},_0xd93ece={};_0xd93ece[_0xdc89('0x52')]=_[_0xdc89('0x6f')](db[_0xdc89('0x67')]['rawAttributes']);_0xd93ece['query']=_[_0xdc89('0x6f')](_0x1bc317[_0xdc89('0x59')]);_0xd93ece['filters']=_[_0xdc89('0x5c')](_0xd93ece[_0xdc89('0x52')],_0xd93ece[_0xdc89('0x59')]);_0x36738c[_0xdc89('0x5b')]=_[_0xdc89('0x5c')](_0xd93ece['model'],qs['fields'](_0x1bc317[_0xdc89('0x59')][_0xdc89('0x5d')]));_0x36738c[_0xdc89('0x5b')]=_0x36738c[_0xdc89('0x5b')][_0xdc89('0x5e')]?_0x36738c[_0xdc89('0x5b')]:_0xd93ece[_0xdc89('0x52')];if(_0x1bc317[_0xdc89('0x59')]['includeAll']){_0x36738c[_0xdc89('0x69')]=[{'all':!![]}];}_0x36738c=_['merge']({},_0x36738c,_0x1bc317[_0xdc89('0x66')]);return db[_0xdc89('0x67')]['find'](_0x36738c)['then'](handleEntityNotFound(_0x589d52,null))['then'](respondWithResult(_0x589d52,null))[_0xdc89('0x21')](handleError(_0x589d52,null));};exports[_0xdc89('0x70')]=function(_0x3e3797,_0x594b28){return db['ChatWebsite'][_0xdc89('0x70')](_0x3e3797[_0xdc89('0x71')],{})[_0xdc89('0x2c')](function(_0x46f329){var _0x4be8c2=_0x3e3797['user'][_0xdc89('0x2d')]({'plain':!![]});if(!_0x4be8c2)throw new Error(_0xdc89('0x72'));if(_0x4be8c2['role']==='user'){var _0x21b07d=_0x46f329[_0xdc89('0x2d')]({'plain':!![]});var _0x281ad6='ChatWebsites';return db[_0xdc89('0x73')][_0xdc89('0x74')]({'where':{'name':_0x281ad6,'userProfileId':_0x4be8c2['userProfileId']},'raw':!![]})['then'](function(_0x5377c9){if(_0x5377c9&&_0x5377c9[_0xdc89('0x75')]===0x0){return db[_0xdc89('0x2f')][_0xdc89('0x70')]({'name':_0x21b07d[_0xdc89('0x32')],'resourceId':_0x21b07d['id'],'type':_0x5377c9[_0xdc89('0x32')],'sectionId':_0x5377c9['id']},{})['then'](function(){return _0x46f329;});}else{return _0x46f329;}})[_0xdc89('0x21')](function(_0x29df5b){logger[_0xdc89('0x1d')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x29df5b);throw _0x29df5b;});}return _0x46f329;})[_0xdc89('0x2c')](respondWithResult(_0x594b28,0xc9))[_0xdc89('0x21')](handleError(_0x594b28,null));};exports[_0xdc89('0x2b')]=function(_0x2c6357,_0x3843a8){if(_0x2c6357[_0xdc89('0x71')]['id']){delete _0x2c6357[_0xdc89('0x71')]['id'];}return db['ChatWebsite']['find']({'where':{'id':_0x2c6357['params']['id']},'include':[{'model':db[_0xdc89('0x6d')],'as':_0xdc89('0x6e')}]})['then'](handleEntityNotFound(_0x3843a8,null))[_0xdc89('0x2c')](saveUpdates(_0x2c6357[_0xdc89('0x71')],null))['then'](respondWithResult(_0x3843a8,null))[_0xdc89('0x21')](handleError(_0x3843a8,null));};exports[_0xdc89('0x30')]=function(_0x405fd8,_0x9a6199){return db[_0xdc89('0x67')][_0xdc89('0x74')]({'where':{'id':_0x405fd8['params']['id']}})[_0xdc89('0x2c')](handleEntityNotFound(_0x9a6199,null))[_0xdc89('0x2c')](removeEntity(_0x9a6199,null))[_0xdc89('0x21')](handleError(_0x9a6199,null));};exports[_0xdc89('0x76')]=function(_0x4c3592,_0x42e5f3){return db[_0xdc89('0x67')][_0xdc89('0x76')]()['then'](respondWithResult(_0x42e5f3,null))[_0xdc89('0x21')](handleError(_0x42e5f3,null));};exports[_0xdc89('0x77')]=function(_0x194adf,_0x2fe15e){if(_0x194adf[_0xdc89('0x71')]['id']){delete _0x194adf[_0xdc89('0x71')]['id'];}return db[_0xdc89('0x67')][_0xdc89('0x74')]({'where':{'id':_0x194adf[_0xdc89('0x78')]['id']}})[_0xdc89('0x2c')](handleEntityNotFound(_0x2fe15e,null))[_0xdc89('0x2c')](function(_0x316618){if(_0x316618){_0x194adf[_0xdc89('0x71')][_0xdc89('0x79')]=_0x316618['id'];return db[_0xdc89('0x7a')][_0xdc89('0x70')](_0x194adf[_0xdc89('0x71')]);}})[_0xdc89('0x2c')](respondWithResult(_0x2fe15e,null))[_0xdc89('0x21')](handleError(_0x2fe15e,null));};exports['getDispositions']=function(_0x755f91,_0x43cf07){var _0x2a9179={'raw':![],'where':{}};var _0x168fb6={};var _0x31964b={'count':0x0,'rows':[]};return db[_0xdc89('0x67')]['findOne']({'where':{'id':_0x755f91[_0xdc89('0x78')]['id']}})[_0xdc89('0x2c')](handleEntityNotFound(_0x43cf07,null))[_0xdc89('0x2c')](function(_0x4f3f7d){if(_0x4f3f7d){_0x168fb6[_0xdc89('0x52')]=_[_0xdc89('0x6f')](db[_0xdc89('0x7a')]['rawAttributes']);_0x168fb6[_0xdc89('0x59')]=_['keys'](_0x755f91[_0xdc89('0x59')]);_0x168fb6[_0xdc89('0x5a')]=_[_0xdc89('0x5c')](_0x168fb6[_0xdc89('0x52')],_0x168fb6[_0xdc89('0x59')]);_0x2a9179[_0xdc89('0x5b')]=_[_0xdc89('0x5c')](_0x168fb6['model'],qs[_0xdc89('0x5d')](_0x755f91['query'][_0xdc89('0x5d')]));_0x2a9179['attributes']=_0x2a9179[_0xdc89('0x5b')]['length']?_0x2a9179[_0xdc89('0x5b')]:_0x168fb6[_0xdc89('0x52')];if(!_0x755f91[_0xdc89('0x59')][_0xdc89('0x7b')](_0xdc89('0x7c'))){_0x2a9179[_0xdc89('0x28')]=qs[_0xdc89('0x28')](_0x755f91[_0xdc89('0x59')][_0xdc89('0x28')]);_0x2a9179[_0xdc89('0x26')]=qs['offset'](_0x755f91[_0xdc89('0x59')][_0xdc89('0x26')]);}_0x2a9179[_0xdc89('0x5f')]=qs['sort'](_0x755f91['query'][_0xdc89('0x60')]);_0x2a9179[_0xdc89('0x61')]=qs[_0xdc89('0x5a')](_[_0xdc89('0x62')](_0x755f91['query'],_0x168fb6['filters']));_0x2a9179['where']['ChatWebsiteId']=_0x4f3f7d['id'];if(_0x755f91[_0xdc89('0x59')]['filter']){_0x2a9179['where']=_[_0xdc89('0x65')](_0x2a9179[_0xdc89('0x61')],{'$or':_[_0xdc89('0x3f')](_0x2a9179[_0xdc89('0x5b')],function(_0x5e2287){var _0x2947c2={};_0x2947c2[_0x5e2287]={'$like':'%'+_0x755f91[_0xdc89('0x59')][_0xdc89('0x63')]+'%'};return _0x2947c2;})});}_0x2a9179=_[_0xdc89('0x65')]({},_0x2a9179,_0x755f91[_0xdc89('0x66')]);return db[_0xdc89('0x7a')][_0xdc89('0x29')]({'where':_0x2a9179[_0xdc89('0x61')]})[_0xdc89('0x2c')](function(_0x3e779b){_0x31964b[_0xdc89('0x29')]=_0x3e779b;if(_0x755f91[_0xdc89('0x59')][_0xdc89('0x68')]){_0x2a9179[_0xdc89('0x69')]=[{'all':!![]}];}return db[_0xdc89('0x7a')][_0xdc89('0x6a')](_0x2a9179);})['then'](function(_0x17ebac){_0x31964b[_0xdc89('0x6b')]=_0x17ebac;return _0x31964b;});}})['then'](respondWithFilteredResult(_0x43cf07,_0x2a9179))[_0xdc89('0x21')](handleError(_0x43cf07,null));};exports[_0xdc89('0x7d')]=function(_0x11a1c5,_0x3bcebd){return db[_0xdc89('0x67')]['find']({'where':{'id':_0x11a1c5[_0xdc89('0x78')]['id']}})['then'](handleEntityNotFound(_0x3bcebd,null))[_0xdc89('0x2c')](function(_0x3f124c){if(_0x3f124c){return _0x3f124c[_0xdc89('0x7d')](_0x11a1c5[_0xdc89('0x59')][_0xdc89('0x7e')]);}})[_0xdc89('0x2c')](respondWithStatusCode(_0x3bcebd,null))[_0xdc89('0x21')](handleError(_0x3bcebd,null));};exports['addAnswer']=function(_0x385a26,_0x151d74){if(_0x385a26[_0xdc89('0x71')]['id']){delete _0x385a26[_0xdc89('0x71')]['id'];}return db[_0xdc89('0x67')]['find']({'where':{'id':_0x385a26[_0xdc89('0x78')]['id']}})[_0xdc89('0x2c')](handleEntityNotFound(_0x151d74,null))[_0xdc89('0x2c')](function(_0xe3ca04){if(_0xe3ca04){_0x385a26[_0xdc89('0x71')][_0xdc89('0x79')]=_0xe3ca04['id'];return db['CannedAnswer'][_0xdc89('0x70')](_0x385a26[_0xdc89('0x71')]);}})[_0xdc89('0x2c')](respondWithResult(_0x151d74,null))[_0xdc89('0x21')](handleError(_0x151d74,null));};exports['getAnswers']=function(_0xb25558,_0x18cccc){var _0x248a57={'raw':![],'where':{}};var _0x300396={};var _0x1bc1d2={'count':0x0,'rows':[]};return db['ChatWebsite']['findOne']({'where':{'id':_0xb25558[_0xdc89('0x78')]['id']}})[_0xdc89('0x2c')](handleEntityNotFound(_0x18cccc,null))[_0xdc89('0x2c')](function(_0x535ead){if(_0x535ead){_0x300396['model']=_[_0xdc89('0x6f')](db['CannedAnswer'][_0xdc89('0x56')]);_0x300396[_0xdc89('0x59')]=_[_0xdc89('0x6f')](_0xb25558[_0xdc89('0x59')]);_0x300396['filters']=_[_0xdc89('0x5c')](_0x300396[_0xdc89('0x52')],_0x300396[_0xdc89('0x59')]);_0x248a57[_0xdc89('0x5b')]=_[_0xdc89('0x5c')](_0x300396['model'],qs['fields'](_0xb25558['query']['fields']));_0x248a57['attributes']=_0x248a57['attributes'][_0xdc89('0x5e')]?_0x248a57[_0xdc89('0x5b')]:_0x300396[_0xdc89('0x52')];if(!_0xb25558[_0xdc89('0x59')][_0xdc89('0x7b')](_0xdc89('0x7c'))){_0x248a57[_0xdc89('0x28')]=qs[_0xdc89('0x28')](_0xb25558[_0xdc89('0x59')][_0xdc89('0x28')]);_0x248a57['offset']=qs[_0xdc89('0x26')](_0xb25558[_0xdc89('0x59')][_0xdc89('0x26')]);}_0x248a57[_0xdc89('0x5f')]=qs[_0xdc89('0x60')](_0xb25558[_0xdc89('0x59')][_0xdc89('0x60')]);_0x248a57[_0xdc89('0x61')]=qs[_0xdc89('0x5a')](_[_0xdc89('0x62')](_0xb25558[_0xdc89('0x59')],_0x300396[_0xdc89('0x5a')]));_0x248a57[_0xdc89('0x61')]['ChatWebsiteId']=_0x535ead['id'];if(_0xb25558['query'][_0xdc89('0x63')]){_0x248a57[_0xdc89('0x61')]=_[_0xdc89('0x65')](_0x248a57['where'],{'$or':_[_0xdc89('0x3f')](_0x248a57[_0xdc89('0x5b')],function(_0x59f967){var _0x5811a8={};_0x5811a8[_0x59f967]={'$like':'%'+_0xb25558[_0xdc89('0x59')][_0xdc89('0x63')]+'%'};return _0x5811a8;})});}_0x248a57=_['merge']({},_0x248a57,_0xb25558[_0xdc89('0x66')]);return db[_0xdc89('0x7f')][_0xdc89('0x29')]({'where':_0x248a57[_0xdc89('0x61')]})['then'](function(_0x227adc){_0x1bc1d2[_0xdc89('0x29')]=_0x227adc;if(_0xb25558[_0xdc89('0x59')][_0xdc89('0x68')]){_0x248a57[_0xdc89('0x69')]=[{'all':!![]}];}return db[_0xdc89('0x7f')][_0xdc89('0x6a')](_0x248a57);})[_0xdc89('0x2c')](function(_0x26075f){_0x1bc1d2[_0xdc89('0x6b')]=_0x26075f;return _0x1bc1d2;});}})[_0xdc89('0x2c')](respondWithFilteredResult(_0x18cccc,_0x248a57))['catch'](handleError(_0x18cccc,null));};exports[_0xdc89('0x80')]=function(_0xd45528,_0x344077){return db['ChatWebsite']['find']({'where':{'id':_0xd45528['params']['id']}})[_0xdc89('0x2c')](handleEntityNotFound(_0x344077,null))[_0xdc89('0x2c')](function(_0x450043){if(_0x450043){return _0x450043['removeAnswers'](_0xd45528[_0xdc89('0x59')][_0xdc89('0x7e')]);}})['then'](respondWithStatusCode(_0x344077,null))[_0xdc89('0x21')](handleError(_0x344077,null));};exports[_0xdc89('0x81')]=function(_0x48ddb9,_0x5f33c4){_0x48ddb9[_0xdc89('0x71')]['sitepic']=_0x48ddb9['file'][_0xdc89('0x82')];return db[_0xdc89('0x67')][_0xdc89('0x74')]({'where':{'id':_0x48ddb9['params']['id']}})[_0xdc89('0x2c')](handleEntityNotFound(_0x5f33c4,null))[_0xdc89('0x2c')](saveUpdates(_0x48ddb9[_0xdc89('0x71')],null))[_0xdc89('0x2c')](respondWithResult(_0x5f33c4,null))[_0xdc89('0x21')](handleError(_0x5f33c4,null));};exports['addAvatar']=function(_0xdf1de3,_0x24423a){_0xdf1de3['body'][_0xdc89('0x83')]=_0xdf1de3[_0xdc89('0x84')][_0xdc89('0x82')];return db[_0xdc89('0x67')]['find']({'where':{'id':_0xdf1de3[_0xdc89('0x78')]['id']}})[_0xdc89('0x2c')](handleEntityNotFound(_0x24423a,null))['then'](saveUpdates(_0xdf1de3[_0xdc89('0x71')],null))['then'](respondWithResult(_0x24423a,null))['catch'](handleError(_0x24423a,null));};exports[_0xdc89('0x85')]=function(_0x536466,_0x22f624){_0x536466[_0xdc89('0x71')]['customerAvatar']=_0x536466[_0xdc89('0x84')][_0xdc89('0x82')];return db[_0xdc89('0x67')][_0xdc89('0x74')]({'where':{'id':_0x536466['params']['id']}})['then'](handleEntityNotFound(_0x22f624,null))[_0xdc89('0x2c')](saveUpdates(_0x536466[_0xdc89('0x71')],null))[_0xdc89('0x2c')](respondWithResult(_0x22f624,null))[_0xdc89('0x21')](handleError(_0x22f624,null));};exports['addSystemAvatar']=function(_0xbe96f4,_0x95e305){_0xbe96f4[_0xdc89('0x71')][_0xdc89('0x86')]=_0xbe96f4['file'][_0xdc89('0x82')];return db[_0xdc89('0x67')]['find']({'where':{'id':_0xbe96f4[_0xdc89('0x78')]['id']}})[_0xdc89('0x2c')](handleEntityNotFound(_0x95e305,null))[_0xdc89('0x2c')](saveUpdates(_0xbe96f4[_0xdc89('0x71')],null))[_0xdc89('0x2c')](respondWithResult(_0x95e305,null))[_0xdc89('0x21')](handleError(_0x95e305,null));};exports['getLogo']=function(_0x11e8c8,_0x50aa87){var _0xab7eef=path[_0xdc89('0x87')](config[_0xdc89('0x88')],_0xdc89('0x89'));var _0xc1e32f={'where':{'id':_0x11e8c8[_0xdc89('0x78')]['id']},'attributes':['id',_0xdc89('0x8a')],'raw':!![]};var _0x48e662=![];return require('../../config/license/util')['getLicense']()[_0xdc89('0x2c')](function(_0x39d62d){if(_0x39d62d){_0x48e662=_0x39d62d[_0xdc89('0x8b')];}})[_0xdc89('0x2c')](function(){return db['ChatWebsite']['find'](_0xc1e32f);})['then'](handleEntityNotFound(_0x50aa87,null))[_0xdc89('0x2c')](function(_0x241c5c){if(_0x241c5c){if(!_[_0xdc89('0x8c')](_0x241c5c[_0xdc89('0x8a')])){if(fs[_0xdc89('0x8d')](path[_0xdc89('0x87')](config[_0xdc89('0x88')],_0xdc89('0x8e'),_0x241c5c['sitepic']))&&_0x48e662){_0xab7eef=path[_0xdc89('0x87')](config[_0xdc89('0x88')],'server/files/images/logos/',_0x241c5c['sitepic']);}}return _0x50aa87[_0xdc89('0x8f')](_0xab7eef);}})['catch'](handleError(_0x50aa87,null));};exports[_0xdc89('0x90')]=function(_0x1f7a6b,_0x3408e0){var _0x13dfa3=path[_0xdc89('0x87')](config[_0xdc89('0x88')],_0xdc89('0x91'));var _0x416e50={'where':{'id':_0x1f7a6b[_0xdc89('0x78')]['id']},'attributes':['id',_0xdc89('0x83')],'raw':!![]};return db[_0xdc89('0x67')][_0xdc89('0x74')](_0x416e50)[_0xdc89('0x2c')](handleEntityNotFound(_0x3408e0,null))[_0xdc89('0x2c')](function(_0xc905ad){if(_0xc905ad){if(!_[_0xdc89('0x8c')](_0xc905ad['agentAvatar'])){if(fs[_0xdc89('0x8d')](path[_0xdc89('0x87')](config['root'],_0xdc89('0x92'),_0xc905ad[_0xdc89('0x83')]))){_0x13dfa3=path['join'](config[_0xdc89('0x88')],'server/files/images/avatars/',_0xc905ad[_0xdc89('0x83')]);}}return _0x3408e0[_0xdc89('0x8f')](_0x13dfa3);}})['catch'](handleError(_0x3408e0,null));};exports[_0xdc89('0x93')]=function(_0x49585a,_0x424ded){var _0x19a08d=path['join'](config[_0xdc89('0x88')],_0xdc89('0x94'));var _0x52f5f2={'where':{'id':_0x49585a[_0xdc89('0x78')]['id']},'attributes':['id',_0xdc89('0x95'),_0xdc89('0x96')],'raw':!![]};return db[_0xdc89('0x67')]['find'](_0x52f5f2)[_0xdc89('0x2c')](handleEntityNotFound(_0x424ded,null))[_0xdc89('0x2c')](function(_0x464a1e){if(_0x464a1e){if(!_['isNil'](_0x464a1e[_0xdc89('0x95')])){if(fs[_0xdc89('0x8d')](path[_0xdc89('0x87')](config[_0xdc89('0x88')],_0xdc89('0x92'),_0x464a1e['customerAvatar']))&&_0x464a1e['showCustomerAvatar']){_0x19a08d=path['join'](config[_0xdc89('0x88')],_0xdc89('0x92'),_0x464a1e[_0xdc89('0x95')]);}}return _0x424ded[_0xdc89('0x8f')](_0x19a08d);}})['catch'](handleError(_0x424ded,null));};exports[_0xdc89('0x97')]=function(_0x5942bc,_0x83ad04){var _0x40938b=path['join'](config['root'],_0xdc89('0x98'));var _0x3c19ac={'where':{'id':_0x5942bc[_0xdc89('0x78')]['id']},'attributes':['id',_0xdc89('0x86')],'raw':!![]};return db['ChatWebsite']['find'](_0x3c19ac)['then'](handleEntityNotFound(_0x83ad04,null))['then'](function(_0x322f35){if(_0x322f35){if(!_[_0xdc89('0x8c')](_0x322f35['systemAvatar'])){if(fs[_0xdc89('0x8d')](path[_0xdc89('0x87')](config[_0xdc89('0x88')],_0xdc89('0x92'),_0x322f35['systemAvatar']))){_0x40938b=path[_0xdc89('0x87')](config[_0xdc89('0x88')],_0xdc89('0x92'),_0x322f35[_0xdc89('0x86')]);}}return _0x83ad04[_0xdc89('0x8f')](_0x40938b);}})[_0xdc89('0x21')](handleError(_0x83ad04,null));};exports[_0xdc89('0x99')]=function(_0xb2e1f4,_0x7496f){var _0x20ae1f={'body':_0xb2e1f4[_0xdc89('0x71')],'channel':_0xdc89('0x9a')};var _0x4b2800=[];var _0x59a187=[];var _0x237df4={};var _0x1d4a23=![];return db[_0xdc89('0x9b')][_0xdc89('0x76')]()[_0xdc89('0x2c')](function(_0x7fc1b){if(!_0x7fc1b){throw new db[(_0xdc89('0x9c'))][(_0xdc89('0x9d'))](_0xdc89('0x9e'));}_0x4b2800=_[_0xdc89('0x9f')](_[_0xdc89('0x6f')](_0x7fc1b),['createdAt',_0xdc89('0xa0')]);_0x59a187=_[_0xdc89('0x9f')](_[_0xdc89('0x6f')](_0x7fc1b),[_0xdc89('0xa1'),_0xdc89('0xa0'),'CompanyId',_0xdc89('0xa2')]);if(_0xb2e1f4['body']['id']){delete _0xb2e1f4['body']['id'];}if(_[_0xdc89('0x8c')](_0xb2e1f4['body'][_0xdc89('0xa3')])){throw new db[(_0xdc89('0x9c'))]['ValidationError'](_0xdc89('0xa4'));}if(_['isNil'](_0xb2e1f4[_0xdc89('0x71')]['body'])||_0xb2e1f4[_0xdc89('0x71')][_0xdc89('0x71')]===''){throw new db[(_0xdc89('0x9c'))][(_0xdc89('0x9d'))]('body\x20is\x20mandatory\x20and\x20not\x20empty');}if(_[_0xdc89('0x8c')](_0xb2e1f4['body'][_0xdc89('0xa5')])){throw new db[(_0xdc89('0x9c'))]['ValidationError'](_0xdc89('0xa6')+_0x59a187);}if(!_[_0xdc89('0xa7')](_0x59a187,_0xb2e1f4['body'][_0xdc89('0xa5')])){throw new db['Sequelize']['ValidationError'](_0xdc89('0xa8')+_0x59a187);}_0x237df4[_0xb2e1f4['body'][_0xdc89('0xa5')]]=_0xb2e1f4[_0xdc89('0x71')][_0xdc89('0xa3')];})[_0xdc89('0x2c')](function(){return db[_0xdc89('0x67')][_0xdc89('0x74')]({'where':{'id':_0xb2e1f4[_0xdc89('0x78')]['id']},'include':[{'model':db[_0xdc89('0xa9')],'as':_0xdc89('0xaa'),'include':[{'model':db['CmContact'],'as':'Contacts','where':_0x237df4,'limit':0x1,'order':[[_0xdc89('0xa0'),_0xdc89('0xab')]]}]},{'model':db[_0xdc89('0xac')],'as':_0xdc89('0xad')},{'model':db[_0xdc89('0x40')],'as':_0xdc89('0x40'),'include':[{'model':db[_0xdc89('0x40')],'as':_0xdc89('0x41'),'attributes':['id','interval'],'raw':!![]}]}]});})[_0xdc89('0x2c')](function(_0xefa5df){if(!_0xefa5df)throw new APINotFoundError(util['format'](_0xdc89('0xae'),_0xb2e1f4[_0xdc89('0x78')]['id']));if(!_0xefa5df[_0xdc89('0x40')]||!_0xefa5df[_0xdc89('0x40')]['Intervals'])return[_0xefa5df,!![]];return[_0xefa5df,checkWebsiteIntervals(_0xefa5df)];})[_0xdc89('0xaf')](function(_0x17eb87,_0x2c73f3){if(!_0x2c73f3)throw new APIOutOfIntervalError();if(!_0x17eb87[_0xdc89('0xaa')])return;_0x20ae1f[_0xdc89('0xb0')]=_0x17eb87;_0x20ae1f[_0xdc89('0xb1')]=_0x17eb87[_0xdc89('0xaa')];_0x20ae1f[_0xdc89('0xb2')]=_[_0xdc89('0xb3')](_0x17eb87['Applications'],[_0xdc89('0xb4')],[_0xdc89('0xb5')]);if(_0x20ae1f[_0xdc89('0xb0')][_0xdc89('0xad')]){delete _0x20ae1f[_0xdc89('0xb0')][_0xdc89('0xad')];}if(_0x20ae1f[_0xdc89('0xb0')][_0xdc89('0xaa')]&&_0x20ae1f[_0xdc89('0xb0')]['List'][_0xdc89('0xb6')]['length']){return _0x20ae1f['account'][_0xdc89('0xaa')][_0xdc89('0xb6')][0x0];}var _0x2294df=_[_0xdc89('0x12')](_0xb2e1f4[_0xdc89('0x71')],{'firstName':_0xb2e1f4['body'][_0xdc89('0xa3')],'ListId':_0x17eb87[_0xdc89('0xa2')]});_0x2294df[_0xb2e1f4[_0xdc89('0x71')][_0xdc89('0xa5')]]=_0xb2e1f4[_0xdc89('0x71')][_0xdc89('0xa3')];return db['CmContact']['create'](_0x2294df,{'fields':_0x4b2800,'raw':!![]});})[_0xdc89('0x2c')](function(_0x1a6309){_0x20ae1f[_0xdc89('0xb7')]=_0x1a6309;var _0x196c9f=createInteractionObject(_0xb2e1f4[_0xdc89('0x78')]['id'],_0xb2e1f4[_0xdc89('0x71')],_0xb2e1f4['headers'],_0x1a6309);var _0x5802b2={'ChatWebsiteId':_0xb2e1f4['params']['id'],'closed':![]};if(_0xb2e1f4['body'][_0xdc89('0xb8')]){_0x5802b2[_0xdc89('0xb8')]=_0xb2e1f4[_0xdc89('0x71')]['threadId'];return db[_0xdc89('0xb9')][_0xdc89('0x74')]({'where':_0x5802b2})[_0xdc89('0x2c')](function(_0x5e2832){if(_0x5e2832){_0x1d4a23=!![];return _0x5e2832;}_0x196c9f[_0xdc89('0xb8')]=_0xb2e1f4[_0xdc89('0x71')][_0xdc89('0xb8')];_0x196c9f[_0xdc89('0xba')]=_0xb2e1f4['body'][_0xdc89('0xba')];return db[_0xdc89('0xb9')][_0xdc89('0x70')](_0x196c9f);});}_0x5802b2[_0xdc89('0xbb')]=_0x1a6309['id'];if(_0xb2e1f4['body']['interaction']&&_0xb2e1f4[_0xdc89('0x71')][_0xdc89('0xbc')]['id']){_0x5802b2['id']=_0xb2e1f4['body'][_0xdc89('0xbc')]['id'];return db['ChatInteraction'][_0xdc89('0x74')]({'where':_0x5802b2})[_0xdc89('0x2c')](function(_0x496932){if(_0x496932){_0x1d4a23=!![];return _0x496932;}return db[_0xdc89('0xb9')]['create'](_0x196c9f);});}return db[_0xdc89('0xb9')][_0xdc89('0x70')](_0x196c9f);})[_0xdc89('0x2c')](function(_0x3623dc){if(!_0x1d4a23)return _0x3623dc;var _0x1f7039={'from':(_0x20ae1f['contact'][_0xdc89('0x4a')]||'')+'\x20'+(_0x20ae1f[_0xdc89('0xb7')][_0xdc89('0x4b')]||'')};if(_0xb2e1f4['body'][_0xdc89('0xb8')]&&_0xb2e1f4[_0xdc89('0x71')]['messageId']&&_0xb2e1f4[_0xdc89('0x71')][_0xdc89('0xb8')]!=_0xb2e1f4[_0xdc89('0x71')][_0xdc89('0xbd')]){_0x1f7039[_0xdc89('0xb8')]=_0xb2e1f4[_0xdc89('0x71')]['messageId'];}return _0x3623dc[_0xdc89('0x2b')](_0x1f7039);})[_0xdc89('0x2c')](function(_0x564bfb){_0x20ae1f[_0xdc89('0xbc')]=_0x564bfb['get']({'plain':!![]});_0x20ae1f[_0xdc89('0xbc')][_0xdc89('0xbe')]=!_0x1d4a23;if(_0x20ae1f[_0xdc89('0xbc')][_0xdc89('0xbe')]){if(_0x20ae1f[_0xdc89('0xb0')][_0xdc89('0xbf')]){_0x20ae1f[_0xdc89('0xb2')][_0xdc89('0xc0')]({'id':0x0,'priority':_0x20ae1f[_0xdc89('0xb2')][_0xdc89('0x5e')]+0x1,'app':_0xdc89('0xc1'),'appdata':_0xdc89('0xc2'),'interval':_0xdc89('0xc3')});}}return db[_0xdc89('0xc4')]['create']({'body':_0xb2e1f4['body']['body'],'ChatWebsiteId':_0xb2e1f4[_0xdc89('0x78')]['id'],'ChatInteractionId':_0x564bfb['id'],'direction':'in','ContactId':_0x20ae1f[_0xdc89('0xb7')]['id'],'AttachmentId':_0xb2e1f4[_0xdc89('0x71')]['AttachmentId']});})[_0xdc89('0x2c')](function(_0x563f31){_0x20ae1f[_0xdc89('0x1f')]=_0x563f31;if(!_0x20ae1f[_0xdc89('0xbc')][_0xdc89('0xc5')]){return;}return db[_0xdc89('0xc6')]['find']({'attributes':['id',_0xdc89('0x32')],'where':{'id':_0x20ae1f[_0xdc89('0xbc')][_0xdc89('0xc5')]}});})[_0xdc89('0x2c')](function(_0x57183e){if(_0x57183e){_0x20ae1f[_0xdc89('0xb2')][_0xdc89('0xc7')]({'id':0x0,'priority':0x0,'app':_0xdc89('0xc8'),'appdata':_0x57183e['name']+','+(_0x20ae1f['account'][_0xdc89('0xc9')]||0xa),'interval':_0xdc89('0xc3')});_0x20ae1f['forcedOwnership']=!![];}if(!_0x20ae1f[_0xdc89('0xbc')]['queueId']){return;}return db[_0xdc89('0xca')][_0xdc89('0x74')]({'attributes':['id','name'],'where':{'id':_0x20ae1f[_0xdc89('0xbc')][_0xdc89('0xcb')]}});})[_0xdc89('0x2c')](function(_0x1ffe6a){if(_0x1ffe6a){_0x20ae1f[_0xdc89('0xb2')][_0xdc89('0xc7')]({'id':0x0,'priority':0x1,'app':_0xdc89('0xcc'),'appdata':_0x1ffe6a[_0xdc89('0x32')]+','+(_0x20ae1f[_0xdc89('0xb0')][_0xdc89('0xcd')]||0x12c),'interval':'*,*,*,*'});}return respondWithRpcPromise(_0xdc89('0xce'),_0xdc89('0xcf'),_0x20ae1f);})['then'](function(_0x3af2e7){respondWithRpcPromise('EventManager',_0xdc89('0xd0'),{'event':_0xdc89('0x99'),'message':_0x3af2e7},client9002);return _0x3af2e7;})[_0xdc89('0x2c')](respondWithResult(_0x7496f,null))['catch'](APIHandleError(_0x7496f));};exports[_0xdc89('0xd1')]=function(_0x115de4,_0x751eb2){var _0x588765,_0x1e81b2,_0x36f592;var _0x549b1a=[];var _0x4a47a1={};var _0xba05ec=_0x115de4[_0xdc89('0xd2')]||[];var _0x5c84e6=[];var _0x435c93;return db[_0xdc89('0x9b')][_0xdc89('0x76')]()[_0xdc89('0x2c')](function(_0x311f47){if(!_0x311f47){throw new db[(_0xdc89('0x9c'))][(_0xdc89('0x9d'))](_0xdc89('0x9e'));}_0x549b1a=_[_0xdc89('0x9f')](_[_0xdc89('0x6f')](_0x311f47),[_0xdc89('0xa1'),_0xdc89('0xa0'),_0xdc89('0xd3'),_0xdc89('0xa2')]);if(_0x115de4['body']['id']){delete _0x115de4[_0xdc89('0x71')]['id'];}if(_['isNil'](_0x115de4[_0xdc89('0x71')][_0xdc89('0xa3')])){throw _0x751eb2[_0xdc89('0x23')](0x1f4)[_0xdc89('0x33')](new db[(_0xdc89('0x9c'))]['ValidationError'](_0xdc89('0xa4')));}if(_['isNil'](_0x115de4[_0xdc89('0x71')][_0xdc89('0x71')])||_0x115de4[_0xdc89('0x71')][_0xdc89('0x71')]===''){throw _0x751eb2[_0xdc89('0x23')](0x1f4)[_0xdc89('0x33')](new db['Sequelize'][(_0xdc89('0x9d'))](_0xdc89('0xd4')));}if(_[_0xdc89('0x8c')](_0x115de4[_0xdc89('0x71')][_0xdc89('0xd5')])){throw _0x751eb2[_0xdc89('0x23')](0x1f4)[_0xdc89('0x33')](new db[(_0xdc89('0x9c'))]['ValidationError'](_0xdc89('0xd6')+_0x549b1a));}if(!_[_0xdc89('0xa7')](_0x549b1a,_0x115de4[_0xdc89('0x71')][_0xdc89('0xd5')])){throw _0x751eb2['status'](0x1f4)[_0xdc89('0x33')](new db[(_0xdc89('0x9c'))][(_0xdc89('0x9d'))](_0xdc89('0xd7')+_0x549b1a));}_0x4a47a1[_0x115de4[_0xdc89('0x71')][_0xdc89('0xd5')]]=_0x115de4[_0xdc89('0x71')][_0xdc89('0xa3')];})[_0xdc89('0x2c')](function(){return db[_0xdc89('0x67')]['find']({'where':{'id':_0x115de4[_0xdc89('0x78')]['id']},'include':[{'model':db[_0xdc89('0xa9')],'as':_0xdc89('0xaa')},{'model':db[_0xdc89('0xd8')],'as':_0xdc89('0xd8')}]});})['then'](handleEntityNotFound(_0x751eb2,null))[_0xdc89('0x2c')](function(_0x40b9d1){if(_0x40b9d1&&_0x40b9d1[_0xdc89('0xaa')]){_0x1e81b2=_0x40b9d1;var _0x5a2e23=_['defaults'](_0x115de4[_0xdc89('0x71')],{'firstName':_0x115de4['body'][_0xdc89('0xa3')],'phone':_0x115de4[_0xdc89('0x71')][_0xdc89('0xa3')],'ListId':_0x40b9d1[_0xdc89('0xa2')]});_0x5a2e23[_0x115de4[_0xdc89('0x71')][_0xdc89('0xd5')]]=_0x115de4[_0xdc89('0x71')][_0xdc89('0xa3')];return db[_0xdc89('0x9b')]['findOrCreate']({'where':_0x4a47a1,'defaults':_0x5a2e23});}})[_0xdc89('0xaf')](function(_0x2cb239){if(_0x2cb239){_0x36f592=_0x2cb239;var _0x3eb991=fs['readFileSync'](path[_0xdc89('0x87')](config[_0xdc89('0x88')],_0xdc89('0xd9')),_0xdc89('0xda'));var _0x2783c5=ejs['render'](_0x3eb991,{'body':_[_0xdc89('0xdb')](_0x115de4['body']['body']),'bodyTitle':_0x1e81b2[_0xdc89('0xdc')]});return db['ChatOfflineMessage']['create']({'body':_0x2783c5,'plainBody':htmlToText[_0xdc89('0xdd')](_0x2783c5),'ContactId':_0x2cb239['id'],'ChatWebsiteId':_0x1e81b2['id']});}})[_0xdc89('0x2c')](function(_0x5b3ffb){_0x435c93=_0x5b3ffb;if(_0xba05ec[_0xdc89('0x5e')]){var _0x12a212=_0xba05ec['map'](function(_0xe17e61){return{'name':_0xe17e61[_0xdc89('0xde')],'basename':_0xe17e61[_0xdc89('0x82')],'type':_0xe17e61[_0xdc89('0xdf')],'ChatOfflineMessageId':_0x5b3ffb['id']};});_0x5c84e6=_0x12a212['map'](_0x1f265b=>{var _0x151929={'filename':_0x1f265b['name'],'path':path[_0xdc89('0x87')](config[_0xdc89('0x88')],_0xdc89('0xe0'),_0xdc89('0xd2'),_0xdc89('0xe1'),_0xdc89('0xe2'),_0x1f265b[_0xdc89('0xe3')])};return _0x151929;});if(!_0x1e81b2[_0xdc89('0xe4')]){return db[_0xdc89('0xe5')][_0xdc89('0xe6')](function(_0x18ec49){return db[_0xdc89('0xe7')][_0xdc89('0xe8')](_0x12a212,{'transaction':_0x18ec49});});}}})['then'](function(){if(_0x435c93){_0x588765=_0x435c93;return db[_0xdc89('0xd8')][_0xdc89('0xe9')]({'where':{'service':!![]},'include':[{'model':db['MailServerOut'],'as':_0xdc89('0xea'),'raw':!![],'include':[{'model':db[_0xdc89('0xeb')],'as':'CloudProvider','raw':!![]}]}]});}})[_0xdc89('0x2c')](function(_0x38759d){if(_0x38759d&&_0x38759d[_0xdc89('0xea')]&&_0x1e81b2[_0xdc89('0xec')]&&_0x1e81b2[_0xdc89('0xed')]){var _0x2be7b9=_0x38759d[_0xdc89('0xee')]();return respondWithRpcPromise(_0xdc89('0xef'),_0xdc89('0xf0'),{'account':_0x2be7b9,'message':{'from':util['format']('\x22%s\x22\x20<%s>',_0x38759d[_0xdc89('0x32')],_0x38759d[_0xdc89('0xf1')]||_0x38759d[_0xdc89('0xea')][_0xdc89('0xf2')]),'to':_0x1e81b2[_0xdc89('0xed')],'subject':_0x1e81b2[_0xdc89('0xf3')],'html':_0x588765[_0xdc89('0x71')],'attachments':_0x5c84e6}},client9003)[_0xdc89('0x2c')](function(){return _0x588765;})[_0xdc89('0x21')](function(_0x10011c){logger[_0xdc89('0x1d')](_0x10011c);});}})[_0xdc89('0x2c')](function(){if(_0x1e81b2&&_0x1e81b2[_0xdc89('0xe4')]&&_0x1e81b2[_0xdc89('0xf4')]){var _0x26ce90=[];if(_0xba05ec[_0xdc89('0x5e')]){_0x26ce90=_0xba05ec[_0xdc89('0x3f')](function(_0x4943db){return{'name':_0x4943db[_0xdc89('0xde')],'basename':_0x4943db['filename'],'type':_0x4943db[_0xdc89('0xdf')],'ChatOfflineMessageId':_0x435c93['id']};});}var _0x4f1429;if(!_[_0xdc89('0x8c')](_0x1e81b2[_0xdc89('0xf5')])){var _0x6a8f0e=_[_0xdc89('0x3f')](_0x115de4['body'],function(_0x5dc15a){return _0x5dc15a;});var _0xd7a96d=_[_0xdc89('0xf6')](_0x6a8f0e)[0x0];var _0x11bf62=_[_0xdc89('0xf7')](_0xd7a96d,function(_0x4fc97c){return _0x4fc97c;});_0x4f1429=_0x11bf62[0x1][_0x1e81b2[_0xdc89('0xf5')]];}var _0x3203c0={'from':_0x36f592[_0xdc89('0xf1')],'firstName':_0x36f592[_0xdc89('0x4a')],'lastName':_0x36f592[_0xdc89('0x4b')],'mapKey':_0xdc89('0xf1'),'message':{'from':_0x36f592['email'],'to':_0x1e81b2[_0xdc89('0xd8')][_0xdc89('0xf1')],'cc':'','subject':_[_0xdc89('0x8c')](_0x4f1429)?_0x1e81b2[_0xdc89('0xf3')]:_0x4f1429,'messageId':'','sentAt':new Date(),'attach':_0x26ce90['length'],'attachments':_0x26ce90,'originChannel':_0xdc89('0xf8'),'ChatWebsiteId':_0x1e81b2['id'],'ChatOfflineMessageId':_0x588765['id'],'originTo':_0x1e81b2['MailAccount'][_0xdc89('0xf1')]},'body':_0x588765['body']};var _0x92f1fa={'account':{'id':_0x1e81b2[_0xdc89('0xf4')]},'body':_0x3203c0,'log':_0xdc89('0xf9')};return respondWithRpcPromise(_0xdc89('0xf9'),_0xdc89('0xfa'),_0x92f1fa,client9001)[_0xdc89('0x2c')](function(){return _0x588765;})[_0xdc89('0x21')](function(_0x3a946b){logger[_0xdc89('0x1d')](_0x3a946b);});}return;})[_0xdc89('0x2c')](function(){if(_0x588765){return _0x588765;}})[_0xdc89('0x2c')](respondWithResult(_0x751eb2,null))[_0xdc89('0x21')](function(){for(var _0x31b83e of _0xba05ec){var _0x2ee6fd=path['join'](config['root'],_0xdc89('0xe0'),_0xdc89('0xd2'),_0xdc89('0xe1'),_0xdc89('0xe2'),_0x31b83e[_0xdc89('0x82')]);fs_extra[_0xdc89('0xfb')](_0x2ee6fd)[_0xdc89('0x21')](function(_0x2b51aa){logger['error'](_0xdc89('0xfc'),_0x2ee6fd,_0x2b51aa);});}});};exports['addInteraction']=function(_0x2664fe,_0x2701fc){return db[_0xdc89('0xb9')]['find']({'where':{'id':_0x2664fe[_0xdc89('0x78')]['id']}})[_0xdc89('0x2c')](handleEntityNotFound(_0x2701fc,null))[_0xdc89('0x2c')](function(_0x5ddb5e){if(_0x5ddb5e){return _0x5ddb5e['addInteraction'](_0x2664fe[_0xdc89('0x71')]['ids'],_[_0xdc89('0xfd')](_0x2664fe[_0xdc89('0x71')],[_0xdc89('0x7e'),'id'])||{});}})[_0xdc89('0x2c')](respondWithResult(_0x2701fc,null))[_0xdc89('0x21')](handleError(_0x2701fc,null));};exports[_0xdc89('0xfe')]=function(_0x3e7e4e,_0xb848c5){var _0x4a7522={'raw':![],'where':{}};var _0x3e55dc={};var _0x4eef13={'count':0x0,'rows':[]};return db['ChatWebsite']['findOne']({'where':{'id':_0x3e7e4e['params']['id']}})[_0xdc89('0x2c')](handleEntityNotFound(_0xb848c5,null))[_0xdc89('0x2c')](function(_0x3cde96){if(_0x3cde96){_0x3e55dc[_0xdc89('0x52')]=_[_0xdc89('0x6f')](db['ChatInteraction'][_0xdc89('0x56')]);_0x3e55dc[_0xdc89('0x59')]=_['keys'](_0x3e7e4e[_0xdc89('0x59')]);_0x3e55dc[_0xdc89('0x5a')]=_[_0xdc89('0x5c')](_0x3e55dc[_0xdc89('0x52')],_0x3e55dc[_0xdc89('0x59')]);_0x4a7522[_0xdc89('0x5b')]=_[_0xdc89('0x5c')](_0x3e55dc['model'],qs['fields'](_0x3e7e4e[_0xdc89('0x59')][_0xdc89('0x5d')]));_0x4a7522[_0xdc89('0x5b')]=_0x4a7522[_0xdc89('0x5b')]['length']?_0x4a7522[_0xdc89('0x5b')]:_0x3e55dc[_0xdc89('0x52')];if(!_0x3e7e4e[_0xdc89('0x59')]['hasOwnProperty'](_0xdc89('0x7c'))){_0x4a7522['limit']=qs['limit'](_0x3e7e4e[_0xdc89('0x59')][_0xdc89('0x28')]);_0x4a7522[_0xdc89('0x26')]=qs[_0xdc89('0x26')](_0x3e7e4e[_0xdc89('0x59')][_0xdc89('0x26')]);}_0x4a7522[_0xdc89('0x5f')]=qs[_0xdc89('0x60')](_0x3e7e4e[_0xdc89('0x59')][_0xdc89('0x60')]);_0x4a7522['where']=qs['filters'](_[_0xdc89('0x62')](_0x3e7e4e[_0xdc89('0x59')],_0x3e55dc[_0xdc89('0x5a')]));_0x4a7522['where']['ChatWebsiteId']=_0x3cde96['id'];if(_0x3e7e4e[_0xdc89('0x59')][_0xdc89('0x63')]){_0x4a7522[_0xdc89('0x61')]=_[_0xdc89('0x65')](_0x4a7522[_0xdc89('0x61')],{'$or':_[_0xdc89('0x3f')](_0x4a7522[_0xdc89('0x5b')],function(_0x18e774){var _0x589a4d={};_0x589a4d[_0x18e774]={'$like':'%'+_0x3e7e4e['query'][_0xdc89('0x63')]+'%'};return _0x589a4d;})});}_0x4a7522=_[_0xdc89('0x65')]({},_0x4a7522,_0x3e7e4e[_0xdc89('0x66')]);return db[_0xdc89('0xb9')][_0xdc89('0x29')]({'where':_0x4a7522[_0xdc89('0x61')]})[_0xdc89('0x2c')](function(_0x201e28){_0x4eef13['count']=_0x201e28;if(_0x3e7e4e[_0xdc89('0x59')]['includeAll']){_0x4a7522['include']=[{'model':db['CmContact'],'as':_0xdc89('0xff'),'required':![]},{'model':db[_0xdc89('0xc6')],'as':'Owner','attributes':[_0xdc89('0x32'),_0xdc89('0x100'),_0xdc89('0x101')],'required':![]},{'model':db[_0xdc89('0x102')],'as':_0xdc89('0x103'),'attributes':['id',_0xdc89('0x32'),_0xdc89('0x104')],'where':_0x3e7e4e['query'][_0xdc89('0x105')]?{'id':_0x3e7e4e[_0xdc89('0x59')]['tag']}:undefined,'required':_0x3e7e4e[_0xdc89('0x59')][_0xdc89('0x105')]?!![]:![]}];}return db[_0xdc89('0xb9')]['findAll'](_0x4a7522);})[_0xdc89('0x2c')](function(_0x2d57d7){_0x4eef13['rows']=_0x2d57d7;return _0x4eef13;});}})[_0xdc89('0x2c')](respondWithFilteredResult(_0xb848c5,_0x4a7522))['catch'](handleError(_0xb848c5,null));};exports[_0xdc89('0x35')]=function(_0x2d596b,_0x9ecad1){var _0x1a98cc=0x0;var _0x598c55=0x0;var _0x212419=![];var _0x193d37;var _0x40c712;return db[_0xdc89('0x67')][_0xdc89('0x74')]({'where':{'id':_0x2d596b[_0xdc89('0x78')]['id']},'include':[{'model':db[_0xdc89('0x40')],'as':_0xdc89('0x40'),'include':[{'model':db[_0xdc89('0x40')],'as':_0xdc89('0x41'),'attributes':['id',_0xdc89('0x39')]}]}]})[_0xdc89('0x2c')](handleEntityNotFound(_0x9ecad1,null))[_0xdc89('0x2c')](function(_0x116da1){if(_0x116da1){_0x193d37=_0x116da1;return _0x116da1[_0xdc89('0x106')]({'raw':!![]});}})['then'](function(_0x1fe7ce){if(_0x193d37){if(_0x1fe7ce){_0x40c712=_0x1fe7ce;}}return require(_0xdc89('0x107'))[_0xdc89('0x108')]();})[_0xdc89('0x2c')](function(_0xefc1b8){if(_0xefc1b8){_0x598c55=_0xefc1b8[_0xdc89('0x109')];_0x212419=_0xefc1b8[_0xdc89('0x8b')];}})[_0xdc89('0x2c')](function(){return db[_0xdc89('0xb9')][_0xdc89('0x29')]({'where':{'closed':![]}});})[_0xdc89('0x2c')](function(_0x36964b){_0x1a98cc=_0x36964b;if(_0x598c55&&_0x36964b>_0x598c55){return db[_0xdc89('0x10a')][_0xdc89('0xe9')]({'where':{'id':0x1}})[_0xdc89('0x2c')](function(_0x11d50f){if(_0x11d50f){_0x11d50f['increment'](_0xdc89('0x10b'));}});}})[_0xdc89('0x2c')](function(){if(!_0x193d37['Interval']||!_0x193d37[_0xdc89('0x40')][_0xdc89('0x41')])return!![];return checkWebsiteIntervals(_0x193d37);})[_0xdc89('0x2c')](function(_0x8c3cab){var _0x1b54d6=fs[_0xdc89('0x10c')](path[_0xdc89('0x87')](config[_0xdc89('0x88')],'server/files/chat/iframe.ejs'),_0xdc89('0xda'));var _0x110919=new url[(_0xdc89('0x10d'))](_0x193d37['address'])[_0xdc89('0x10e')];var _0x18c1b0='3.5.0';var _0x59842e=![];var _0x28d861={'chatVersion':_0x18c1b0,'chatWebsiteAddressOrigin':_0x110919,'remote':_0x193d37[_0xdc89('0x10f')],'query':querystring[_0xdc89('0x1c')](_[_0xdc89('0x65')](_0x193d37[_0xdc89('0x2d')]({'plain':!![]}),{'customerIp':_0x2d596b[_0xdc89('0x110')][_0xdc89('0x49')]||_0x2d596b[_0xdc89('0x110')]['x-real-ip']||_0x2d596b[_0xdc89('0x111')]['remoteAddress']||_0x2d596b['ip'],'referer':_0x2d596b[_0xdc89('0x110')][_0xdc89('0x112')],'openedInteractions':_0x1a98cc,'maxInteractions':_0x598c55,'virtual':_0x212419[_0xdc89('0x109')],'online':_0x8c3cab,'custom':_0x212419}))[_0xdc89('0x113')](/'/g,'\x5c\x27')};_0x9ecad1[_0xdc89('0x33')](ejs[_0xdc89('0x114')](Mustache[_0xdc89('0x114')](_0x1b54d6,_0x28d861),{'proactiveActions':_0x40c712,'alignment':_0x193d37['alignment'],'verticalAlignment':_0x193d37[_0xdc89('0x115')],'div_color':_0x193d37[_0xdc89('0x104')],'labelText':_0x193d37[_0xdc89('0x116')],'text_color':_0x193d37[_0xdc89('0x117')],'text_button_color':_0x193d37[_0xdc89('0x118')],'button_color':_0x193d37[_0xdc89('0x119')],'background_color':_0x193d37['backgroundColor'],'hideWhenOffline':_0x193d37['hideWhenOffline'],'intervalId':_0x193d37[_0xdc89('0x11a')],'isDevelopment':_0x59842e,'chatVersion':_0x18c1b0}));})[_0xdc89('0x21')](handleError(_0x9ecad1,null));};exports[_0xdc89('0x11b')]=function(_0x369780,_0x5a426c){var _0x594d08=_0x369780[_0xdc89('0x78')]['id'];var _0x52a1c9=_0x369780[_0xdc89('0x71')];var _0x1fbb39=0xc8;var _0x1aa31c=null;return db['sequelize']['transaction']({'isolationLevel':db['sequelize'][_0xdc89('0x11c')][_0xdc89('0x11d')]['READ_COMMITTED']},function(_0x11b4e7){return db[_0xdc89('0x67')][_0xdc89('0xe9')]({'where':{'id':_0x594d08},'transaction':_0x11b4e7})[_0xdc89('0x2c')](function(_0x2682ed){if(_0x2682ed){return db['ChatApplication'][_0xdc89('0x30')]({'where':{'ChatWebsiteId':_0x594d08},'transaction':_0x11b4e7})[_0xdc89('0x2c')](function(){var _0x141cb3=_[_0xdc89('0x3f')](_0x52a1c9,function(_0x2c954e){_0x2c954e[_0xdc89('0x79')]=_0x594d08;return _0x2c954e;});return db[_0xdc89('0xac')][_0xdc89('0xe8')](_0x141cb3,{'transaction':_0x11b4e7});});}else{_0x1fbb39=0x194;_0x1aa31c=[];}});})[_0xdc89('0x2c')](function(){if(_0x1fbb39!==0x194){return db[_0xdc89('0xac')][_0xdc89('0x11e')]({'where':{'ChatWebsiteId':_0x594d08},'order':_0xdc89('0xb4')})[_0xdc89('0x2c')](function(_0x27d712){_0x1aa31c=_0x27d712;});}})[_0xdc89('0x21')](function(_0x5743c7){_0x1fbb39=0x1f4;logger['error'](_0x5743c7[_0xdc89('0x31')]);if(_0x5743c7[_0xdc89('0x32')]){delete _0x5743c7[_0xdc89('0x32')];}_0x1aa31c=_0x5743c7;})['finally'](function(){if(_0x1aa31c===null){_0x5a426c['sendStatus'](_0x1fbb39);}else{if(_0x1fbb39===0x1f4){_0x5a426c[_0xdc89('0x23')](_0x1fbb39)[_0xdc89('0x33')](_0x1aa31c);}else{_0x5a426c[_0xdc89('0x23')](_0x1fbb39)['json'](_0x1aa31c);}}});};exports[_0xdc89('0x11f')]=function(_0x1981de,_0x385cfe){var _0x55a397={};var _0x5b0c90={};var _0xfabcce;var _0x2b1a64;return db[_0xdc89('0x67')][_0xdc89('0xe9')]({'where':{'id':_0x1981de[_0xdc89('0x78')]['id']}})[_0xdc89('0x2c')](handleEntityNotFound(_0x385cfe,null))[_0xdc89('0x2c')](function(_0x40638d){if(_0x40638d){_0xfabcce=_0x40638d;_0x5b0c90[_0xdc89('0x52')]=_[_0xdc89('0x6f')](db[_0xdc89('0xac')][_0xdc89('0x56')]);_0x5b0c90[_0xdc89('0x59')]=_[_0xdc89('0x6f')](_0x1981de[_0xdc89('0x59')]);_0x5b0c90[_0xdc89('0x5a')]=_[_0xdc89('0x5c')](_0x5b0c90[_0xdc89('0x52')],_0x5b0c90['query']);_0x55a397[_0xdc89('0x5b')]=_['intersection'](_0x5b0c90[_0xdc89('0x52')],qs[_0xdc89('0x5d')](_0x1981de['query']['fields']));_0x55a397[_0xdc89('0x5b')]=_0x55a397[_0xdc89('0x5b')][_0xdc89('0x5e')]?_0x55a397[_0xdc89('0x5b')]:_0x5b0c90['model'];_0x55a397['order']=qs[_0xdc89('0x60')](_0x1981de[_0xdc89('0x59')][_0xdc89('0x60')]);_0x55a397[_0xdc89('0x61')]=qs[_0xdc89('0x5a')](_[_0xdc89('0x62')](_0x1981de[_0xdc89('0x59')],_0x5b0c90[_0xdc89('0x5a')]));if(_0x1981de['query'][_0xdc89('0x63')]){_0x55a397[_0xdc89('0x61')]=_[_0xdc89('0x65')](_0x55a397[_0xdc89('0x61')],{'$or':_[_0xdc89('0x3f')](_0x55a397[_0xdc89('0x5b')],function(_0x24b7fe){var _0x534c6f={};_0x534c6f[_0x24b7fe]={'$like':'%'+_0x1981de['query'][_0xdc89('0x63')]+'%'};return _0x534c6f;})});}_0x55a397=_[_0xdc89('0x65')]({},_0x55a397,_0x1981de[_0xdc89('0x66')]);return _0xfabcce[_0xdc89('0x11f')](_0x55a397);}})[_0xdc89('0x2c')](function(_0x27c5f5){if(_0x27c5f5){_0x2b1a64=_0x27c5f5[_0xdc89('0x5e')];if(!_0x1981de[_0xdc89('0x59')][_0xdc89('0x7b')](_0xdc89('0x7c'))){_0x55a397[_0xdc89('0x28')]=qs[_0xdc89('0x28')](_0x1981de[_0xdc89('0x59')]['limit']);_0x55a397[_0xdc89('0x26')]=qs[_0xdc89('0x26')](_0x1981de[_0xdc89('0x59')][_0xdc89('0x26')]);}return _0xfabcce[_0xdc89('0x11f')](_0x55a397);}})['then'](function(_0x1eb553){if(_0x1eb553){return _0x1eb553?{'count':_0x2b1a64,'rows':_0x1eb553}:null;}})['then'](respondWithResult(_0x385cfe,null))[_0xdc89('0x21')](handleError(_0x385cfe,null));};exports[_0xdc89('0x120')]=function(_0x463129,_0x219d35){return db[_0xdc89('0x121')][_0xdc89('0x74')]({'where':{'id':_0x463129[_0xdc89('0x78')]['id']}})[_0xdc89('0x2c')](handleEntityNotFound(_0x219d35,null))[_0xdc89('0x2c')](function(_0x3513fd){if(_0x3513fd){return _0x3513fd['addProactiveActions'](_0x463129[_0xdc89('0x71')]['ids'],_[_0xdc89('0xfd')](_0x463129['body'],[_0xdc89('0x7e'),'id'])||{});}})['then'](respondWithResult(_0x219d35,null))['catch'](handleError(_0x219d35,null));};exports['getProactiveActions']=function(_0x1784bb,_0x49de0c){var _0x46b293={};var _0x53ea11={};var _0x439033;var _0x24621d;return db[_0xdc89('0x67')][_0xdc89('0xe9')]({'where':{'id':_0x1784bb[_0xdc89('0x78')]['id']}})[_0xdc89('0x2c')](handleEntityNotFound(_0x49de0c,null))[_0xdc89('0x2c')](function(_0x22e004){if(_0x22e004){_0x439033=_0x22e004;_0x53ea11[_0xdc89('0x52')]=_[_0xdc89('0x6f')](db[_0xdc89('0x122')][_0xdc89('0x56')]);_0x53ea11[_0xdc89('0x59')]=_['keys'](_0x1784bb[_0xdc89('0x59')]);_0x53ea11[_0xdc89('0x5a')]=_[_0xdc89('0x5c')](_0x53ea11[_0xdc89('0x52')],_0x53ea11[_0xdc89('0x59')]);_0x46b293[_0xdc89('0x5b')]=_[_0xdc89('0x5c')](_0x53ea11[_0xdc89('0x52')],qs[_0xdc89('0x5d')](_0x1784bb['query']['fields']));_0x46b293['attributes']=_0x46b293[_0xdc89('0x5b')][_0xdc89('0x5e')]?_0x46b293[_0xdc89('0x5b')]:_0x53ea11[_0xdc89('0x52')];_0x46b293['order']=qs[_0xdc89('0x60')](_0x1784bb['query'][_0xdc89('0x60')]);_0x46b293['where']=qs[_0xdc89('0x5a')](_[_0xdc89('0x62')](_0x1784bb[_0xdc89('0x59')],_0x53ea11[_0xdc89('0x5a')]));if(_0x1784bb[_0xdc89('0x59')][_0xdc89('0x63')]){_0x46b293[_0xdc89('0x61')]=_[_0xdc89('0x65')](_0x46b293[_0xdc89('0x61')],{'$or':_[_0xdc89('0x3f')](_0x46b293[_0xdc89('0x5b')],function(_0x30ab10){var _0x4033e2={};_0x4033e2[_0x30ab10]={'$like':'%'+_0x1784bb[_0xdc89('0x59')][_0xdc89('0x63')]+'%'};return _0x4033e2;})});}_0x46b293=_[_0xdc89('0x65')]({},_0x46b293,_0x1784bb['options']);return _0x439033['getProactiveActions'](_0x46b293);}})[_0xdc89('0x2c')](function(_0xccb7c7){if(_0xccb7c7){_0x24621d=_0xccb7c7[_0xdc89('0x5e')];if(!_0x1784bb[_0xdc89('0x59')][_0xdc89('0x7b')]('nolimit')){_0x46b293['limit']=qs['limit'](_0x1784bb[_0xdc89('0x59')][_0xdc89('0x28')]);_0x46b293[_0xdc89('0x26')]=qs[_0xdc89('0x26')](_0x1784bb[_0xdc89('0x59')][_0xdc89('0x26')]);}return _0x439033['getProactiveActions'](_0x46b293);}})[_0xdc89('0x2c')](function(_0x48bdd7){if(_0x48bdd7){return _0x48bdd7?{'count':_0x24621d,'rows':_0x48bdd7}:null;}})[_0xdc89('0x2c')](respondWithResult(_0x49de0c,null))[_0xdc89('0x21')](handleError(_0x49de0c,null));};exports[_0xdc89('0x123')]=function(_0x2a9d0e,_0xc866e4){var _0x1922c5=_0x2a9d0e[_0xdc89('0x59')][_0xdc89('0x124')]===_0xdc89('0x125')?'offlineForm':_0xdc89('0x126');return db[_0xdc89('0x67')]['find']({'attributes':['id',_0x1922c5],'where':{'id':_0x2a9d0e[_0xdc89('0x78')]['id']}})[_0xdc89('0x2c')](handleEntityNotFound(_0xc866e4,null))[_0xdc89('0x2c')](function(_0x53bf0f){if(_0x53bf0f){var _0x25ab9d=_0x53bf0f[_0x1922c5];var _0xdf59c4=_0x25ab9d&&_0x25ab9d[_0xdc89('0x127')]?_0x25ab9d[_0xdc89('0x127')]:[];_0xc866e4[_0xdc89('0x33')]({'fromKey':_['isNil'](_0x25ab9d[_0xdc89('0x128')])?undefined:_0x25ab9d[_0xdc89('0x128')],'count':_0xdf59c4['length'],'rows':_0xdf59c4});}})[_0xdc89('0x21')](handleError(_0xc866e4,null));};exports[_0xdc89('0x129')]=function(_0x246303,_0x3de5ba){var _0x1eacc0={'raw':![],'where':{}};var _0x2161ab={};var _0x21001e={'count':0x0,'rows':[]};return db['ChatWebsite'][_0xdc89('0xe9')]({'where':{'id':_0x246303[_0xdc89('0x78')]['id']}})['then'](handleEntityNotFound(_0x3de5ba,null))[_0xdc89('0x2c')](function(_0x2ac8f7){if(_0x2ac8f7){_0x2161ab[_0xdc89('0x52')]=_['keys'](db[_0xdc89('0x12a')][_0xdc89('0x56')]);_0x2161ab[_0xdc89('0x59')]=_[_0xdc89('0x6f')](_0x246303[_0xdc89('0x59')]);_0x2161ab[_0xdc89('0x5a')]=_[_0xdc89('0x5c')](_0x2161ab['model'],_0x2161ab[_0xdc89('0x59')]);_0x1eacc0[_0xdc89('0x5b')]=_['intersection'](_0x2161ab[_0xdc89('0x52')],qs[_0xdc89('0x5d')](_0x246303[_0xdc89('0x59')][_0xdc89('0x5d')]));_0x1eacc0[_0xdc89('0x5b')]=_0x1eacc0[_0xdc89('0x5b')][_0xdc89('0x5e')]?_0x1eacc0[_0xdc89('0x5b')]:_0x2161ab[_0xdc89('0x52')];if(!_0x246303['query']['hasOwnProperty'](_0xdc89('0x7c'))){_0x1eacc0[_0xdc89('0x28')]=qs['limit'](_0x246303[_0xdc89('0x59')][_0xdc89('0x28')]);_0x1eacc0[_0xdc89('0x26')]=qs[_0xdc89('0x26')](_0x246303[_0xdc89('0x59')][_0xdc89('0x26')]);}_0x1eacc0[_0xdc89('0x5f')]=qs[_0xdc89('0x60')](_0x246303[_0xdc89('0x59')][_0xdc89('0x60')]);_0x1eacc0['where']=qs[_0xdc89('0x5a')](_['pick'](_0x246303[_0xdc89('0x59')],_0x2161ab[_0xdc89('0x5a')]));_0x1eacc0[_0xdc89('0x61')][_0xdc89('0x79')]=_0x2ac8f7['id'];if(_0x246303[_0xdc89('0x59')][_0xdc89('0x63')]){_0x1eacc0[_0xdc89('0x61')]=_[_0xdc89('0x65')](_0x1eacc0[_0xdc89('0x61')],{'$or':_[_0xdc89('0x3f')](_0x1eacc0[_0xdc89('0x5b')],function(_0x37944c){var _0x20c986={};_0x20c986[_0x37944c]={'$like':'%'+_0x246303['query'][_0xdc89('0x63')]+'%'};return _0x20c986;})});}_0x1eacc0=_[_0xdc89('0x65')]({},_0x1eacc0,_0x246303[_0xdc89('0x66')]);return db[_0xdc89('0x12a')][_0xdc89('0x29')]({'where':_0x1eacc0[_0xdc89('0x61')]})[_0xdc89('0x2c')](function(_0x442b36){_0x21001e[_0xdc89('0x29')]=_0x442b36;if(_0x246303[_0xdc89('0x59')]['includeAll']){_0x1eacc0[_0xdc89('0x69')]=[{'all':!![]}];}else{_0x1eacc0[_0xdc89('0x69')]=[{'model':db[_0xdc89('0x9b')],'as':_0xdc89('0xff'),'required':![]},{'model':db[_0xdc89('0xe7')],'as':_0xdc89('0x12b'),'required':![]}];}return db[_0xdc89('0x12a')][_0xdc89('0x6a')](_0x1eacc0);})[_0xdc89('0x2c')](function(_0x23b700){_0x21001e['rows']=_0x23b700;return _0x21001e;});}})['then'](respondWithFilteredResult(_0x3de5ba,_0x1eacc0))['catch'](handleError(_0x3de5ba,null));};exports[_0xdc89('0x12c')]=function(_0x30e2b7,_0x2873fc){return db['ChatWebsite'][_0xdc89('0x74')]({'where':{'id':_0x30e2b7[_0xdc89('0x78')]['id']}})[_0xdc89('0x2c')](handleEntityNotFound(_0x2873fc,null))[_0xdc89('0x2c')](function(_0x236bb8){if(_0x236bb8){return _0x236bb8[_0xdc89('0x12c')](_0x30e2b7['body'][_0xdc89('0x7e')],_['omit'](_0x30e2b7[_0xdc89('0x71')],[_0xdc89('0x7e'),'id'])||{})[_0xdc89('0xaf')](function(_0x1c62e9){for(var _0x3ec46a=0x0;_0x3ec46a<_0x30e2b7['body']['ids'][_0xdc89('0x5e')];_0x3ec46a+=0x1){socket[_0xdc89('0x12d')]('userChatWebsite:save',{'UserId':Number(_0x30e2b7[_0xdc89('0x71')][_0xdc89('0x7e')][_0x3ec46a]),'ChatWebsiteId':Number(_0x30e2b7['params']['id'])});}return _0x1c62e9;});}})[_0xdc89('0x2c')](respondWithResult(_0x2873fc,null))[_0xdc89('0x21')](handleError(_0x2873fc,null));};exports[_0xdc89('0x12e')]=function(_0x415473,_0x38adbe){return db[_0xdc89('0x67')][_0xdc89('0x74')]({'where':{'id':_0x415473[_0xdc89('0x78')]['id']}})[_0xdc89('0x2c')](handleEntityNotFound(_0x38adbe,null))[_0xdc89('0x2c')](function(_0x196456){if(_0x196456){return _0x196456['removeAgents'](_0x415473[_0xdc89('0x59')][_0xdc89('0x7e')])[_0xdc89('0x2c')](function(){if(_[_0xdc89('0x12f')](_0x415473[_0xdc89('0x59')]['ids'])){for(var _0x85ba0e=0x0;_0x85ba0e<_0x415473['query']['ids']['length'];_0x85ba0e+=0x1){socket[_0xdc89('0x12d')]('userChatWebsite:remove',{'UserId':Number(_0x415473[_0xdc89('0x59')][_0xdc89('0x7e')][_0x85ba0e]),'ChatWebsiteId':Number(_0x415473[_0xdc89('0x78')]['id'])});}}else{socket[_0xdc89('0x12d')]('userChatWebsite:remove',{'UserId':Number(_0x415473[_0xdc89('0x59')][_0xdc89('0x7e')]),'ChatWebsiteId':Number(_0x415473[_0xdc89('0x78')]['id'])});}});}})[_0xdc89('0x2c')](respondWithStatusCode(_0x38adbe,null))[_0xdc89('0x21')](handleError(_0x38adbe,null));};exports[_0xdc89('0x130')]=function(_0x39d34a,_0x2f6061){var _0x28bb7c={};var _0x33ff57={};var _0x2a3cef;var _0x10a9a9;return db[_0xdc89('0x67')][_0xdc89('0xe9')]({'where':{'id':_0x39d34a[_0xdc89('0x78')]['id']}})[_0xdc89('0x2c')](handleEntityNotFound(_0x2f6061,null))[_0xdc89('0x2c')](function(_0x188695){if(_0x188695){_0x2a3cef=_0x188695;_0x33ff57['model']=_[_0xdc89('0x6f')](db['User'][_0xdc89('0x56')]);_0x33ff57[_0xdc89('0x59')]=_[_0xdc89('0x6f')](_0x39d34a[_0xdc89('0x59')]);_0x33ff57[_0xdc89('0x5a')]=_[_0xdc89('0x5c')](_0x33ff57[_0xdc89('0x52')],_0x33ff57[_0xdc89('0x59')]);_0x28bb7c[_0xdc89('0x5b')]=_[_0xdc89('0x5c')](_0x33ff57[_0xdc89('0x52')],qs[_0xdc89('0x5d')](_0x39d34a['query'][_0xdc89('0x5d')]));_0x28bb7c['attributes']=_0x28bb7c[_0xdc89('0x5b')][_0xdc89('0x5e')]?_0x28bb7c[_0xdc89('0x5b')]:_0x33ff57[_0xdc89('0x52')];_0x28bb7c[_0xdc89('0x5f')]=qs['sort'](_0x39d34a[_0xdc89('0x59')][_0xdc89('0x60')]);_0x28bb7c[_0xdc89('0x61')]=qs[_0xdc89('0x5a')](_['pick'](_0x39d34a[_0xdc89('0x59')],_0x33ff57[_0xdc89('0x5a')]));if(_0x39d34a[_0xdc89('0x59')]['filter']){_0x28bb7c['where']=_[_0xdc89('0x65')](_0x28bb7c[_0xdc89('0x61')],{'$or':_[_0xdc89('0x3f')](_0x28bb7c[_0xdc89('0x5b')],function(_0x1608ed){var _0x21f326={};_0x21f326[_0x1608ed]={'$like':'%'+_0x39d34a[_0xdc89('0x59')][_0xdc89('0x63')]+'%'};return _0x21f326;})});}_0x28bb7c=_[_0xdc89('0x65')]({},_0x28bb7c,_0x39d34a[_0xdc89('0x66')]);return _0x2a3cef[_0xdc89('0x130')](_0x28bb7c);}})[_0xdc89('0x2c')](function(_0x5c48ba){if(_0x5c48ba){_0x10a9a9=_0x5c48ba[_0xdc89('0x5e')];if(!_0x39d34a[_0xdc89('0x59')][_0xdc89('0x7b')](_0xdc89('0x7c'))){_0x28bb7c[_0xdc89('0x28')]=qs[_0xdc89('0x28')](_0x39d34a[_0xdc89('0x59')][_0xdc89('0x28')]);_0x28bb7c['offset']=qs['offset'](_0x39d34a[_0xdc89('0x59')]['offset']);}return _0x2a3cef['getAgents'](_0x28bb7c);}})[_0xdc89('0x2c')](function(_0x16dd35){if(_0x16dd35){return _0x16dd35?{'count':_0x10a9a9,'rows':_0x16dd35}:null;}})['then'](respondWithResult(_0x2f6061,null))[_0xdc89('0x21')](handleError(_0x2f6061,null));}; \ No newline at end of file diff --git a/server/api/chatWebsite/chatWebsite.events.js b/server/api/chatWebsite/chatWebsite.events.js index be93514..d93c067 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 _0x9330=['events','setMaxListeners','remove','emit','hook','exports'];(function(_0x15bb39,_0x42bd41){var _0x88fadc=function(_0x177f6c){while(--_0x177f6c){_0x15bb39['push'](_0x15bb39['shift']());}};_0x88fadc(++_0x42bd41);}(_0x9330,0x14a));var _0x0933=function(_0x4da138,_0x1f4f4e){_0x4da138=_0x4da138-0x0;var _0x36f041=_0x9330[_0x4da138];return _0x36f041;};'use strict';var EventEmitter=require(_0x0933('0x0'));var ChatWebsite=require('../../mysqldb')['db']['ChatWebsite'];var ChatWebsiteEvents=new EventEmitter();ChatWebsiteEvents[_0x0933('0x1')](0x0);var events={'afterCreate':'save','afterUpdate':'update','afterDestroy':_0x0933('0x2')};function emitEvent(_0x18cf92){return function(_0x39ad54,_0x2964c7,_0x2462a4){ChatWebsiteEvents[_0x0933('0x3')](_0x18cf92+':'+_0x39ad54['id'],_0x39ad54);ChatWebsiteEvents[_0x0933('0x3')](_0x18cf92,_0x39ad54);_0x2462a4(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];ChatWebsite[_0x0933('0x4')](e,emitEvent(event));}}module[_0x0933('0x5')]=ChatWebsiteEvents; \ No newline at end of file +var _0xb18e=['hook','ChatWebsite','save','remove','emit','hasOwnProperty'];(function(_0x36a21a,_0x5ecf4b){var _0x34762d=function(_0x3c26d5){while(--_0x3c26d5){_0x36a21a['push'](_0x36a21a['shift']());}};_0x34762d(++_0x5ecf4b);}(_0xb18e,0x181));var _0xeb18=function(_0x133fe4,_0x1f473b){_0x133fe4=_0x133fe4-0x0;var _0x4c4017=_0xb18e[_0x133fe4];return _0x4c4017;};'use strict';var EventEmitter=require('events');var ChatWebsite=require('../../mysqldb')['db'][_0xeb18('0x0')];var ChatWebsiteEvents=new EventEmitter();ChatWebsiteEvents['setMaxListeners'](0x0);var events={'afterCreate':_0xeb18('0x1'),'afterUpdate':'update','afterDestroy':_0xeb18('0x2')};function emitEvent(_0x1bf23e){return function(_0x5d5ff9,_0x125c34,_0x27c8d1){ChatWebsiteEvents[_0xeb18('0x3')](_0x1bf23e+':'+_0x5d5ff9['id'],_0x5d5ff9);ChatWebsiteEvents[_0xeb18('0x3')](_0x1bf23e,_0x5d5ff9);_0x27c8d1(null);};}for(var e in events){if(events[_0xeb18('0x4')](e)){var event=events[e];ChatWebsite[_0xeb18('0x5')](e,emitEvent(event));}}module['exports']=ChatWebsiteEvents; \ No newline at end of file diff --git a/server/api/chatWebsite/chatWebsite.model.js b/server/api/chatWebsite/chatWebsite.model.js index d5032a4..cbd426e 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 _0xace5=['../../config/logger','api','bluebird','path','rimraf','../../config/environment','./chatWebsite.attributes','define','ChatWebsite','lodash','util'];(function(_0x4fde08,_0x463a36){var _0x12e725=function(_0x2670c5){while(--_0x2670c5){_0x4fde08['push'](_0x4fde08['shift']());}};_0x12e725(++_0x463a36);}(_0xace5,0x111));var _0x5ace=function(_0x150f14,_0x1ff699){_0x150f14=_0x150f14-0x0;var _0xea1655=_0xace5[_0x150f14];return _0xea1655;};'use strict';var _=require(_0x5ace('0x0'));var util=require(_0x5ace('0x1'));var logger=require(_0x5ace('0x2'))(_0x5ace('0x3'));var moment=require('moment');var BPromise=require(_0x5ace('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x5ace('0x5'));var rimraf=require(_0x5ace('0x6'));var config=require(_0x5ace('0x7'));var attributes=require(_0x5ace('0x8'));module['exports']=function(_0x27fb14,_0x2e8ab6){return _0x27fb14[_0x5ace('0x9')](_0x5ace('0xa'),attributes,{'tableName':'chat_websites','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x115c=['ChatWebsite','chat_websites','util','../../config/logger','bluebird','request-promise','path','rimraf','../../config/environment','./chatWebsite.attributes','define'];(function(_0x1c6f10,_0x5eed05){var _0x5a9683=function(_0x1ea102){while(--_0x1ea102){_0x1c6f10['push'](_0x1c6f10['shift']());}};_0x5a9683(++_0x5eed05);}(_0x115c,0xf4));var _0xc115=function(_0x25e05d,_0x3f760a){_0x25e05d=_0x25e05d-0x0;var _0x444730=_0x115c[_0x25e05d];return _0x444730;};'use strict';var _=require('lodash');var util=require(_0xc115('0x0'));var logger=require(_0xc115('0x1'))('api');var moment=require('moment');var BPromise=require(_0xc115('0x2'));var rp=require(_0xc115('0x3'));var fs=require('fs');var path=require(_0xc115('0x4'));var rimraf=require(_0xc115('0x5'));var config=require(_0xc115('0x6'));var attributes=require(_0xc115('0x7'));module['exports']=function(_0x4de975,_0x5d5cbc){return _0x4de975[_0xc115('0x8')](_0xc115('0x9'),attributes,{'tableName':_0xc115('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/chatWebsite/chatWebsite.rpc.js b/server/api/chatWebsite/chatWebsite.rpc.js index 4b98e0e..ceec0ca 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 _0xe6d7=['stringify','error','code','message','request\x20sent','catch','lodash','moment','bluebird','ioredis','../../config/logger','../../config/environment','jayson/promise','client','redis','defaults','socket.io-emitter','./chatWebsite.socket','register','then','info','ChatWebsite,\x20%s,\x20%s','debug','ChatWebsite,\x20%s,\x20%s,\x20%s'];(function(_0x6c993a,_0x5ea3ab){var _0x27f547=function(_0x22df20){while(--_0x22df20){_0x6c993a['push'](_0x6c993a['shift']());}};_0x27f547(++_0x5ea3ab);}(_0xe6d7,0xf6));var _0x7e6d=function(_0x137459,_0x19eea2){_0x137459=_0x137459-0x0;var _0x2031d2=_0xe6d7[_0x137459];return _0x2031d2;};'use strict';var _=require(_0x7e6d('0x0'));var util=require('util');var moment=require(_0x7e6d('0x1'));var BPromise=require(_0x7e6d('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x7e6d('0x3'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0x7e6d('0x4'))('rpc');var config=require(_0x7e6d('0x5'));var jayson=require(_0x7e6d('0x6'));var client=jayson[_0x7e6d('0x7')]['http']({'port':0x232a});config[_0x7e6d('0x8')]=_[_0x7e6d('0x9')](config['redis'],{'host':'localhost','port':0x18eb});var socket=require(_0x7e6d('0xa'))(new Redis(config[_0x7e6d('0x8')]));require(_0x7e6d('0xb'))[_0x7e6d('0xc')](socket);function respondWithRpcPromise(_0x427967,_0x586ff4,_0x5ce04f){return new BPromise(function(_0x66aa3b,_0x2e55fa){return client['request'](_0x427967,_0x5ce04f)[_0x7e6d('0xd')](function(_0xf3e3a0){logger[_0x7e6d('0xe')](_0x7e6d('0xf'),_0x586ff4,'request\x20sent');logger[_0x7e6d('0x10')](_0x7e6d('0x11'),_0x586ff4,'request\x20sent',JSON[_0x7e6d('0x12')](_0xf3e3a0));if(_0xf3e3a0[_0x7e6d('0x13')]){if(_0xf3e3a0[_0x7e6d('0x13')][_0x7e6d('0x14')]===0x1f4){logger[_0x7e6d('0x13')](_0x7e6d('0xf'),_0x586ff4,_0xf3e3a0[_0x7e6d('0x13')][_0x7e6d('0x15')]);return _0x2e55fa(_0xf3e3a0['error']['message']);}logger[_0x7e6d('0x13')](_0x7e6d('0xf'),_0x586ff4,_0xf3e3a0[_0x7e6d('0x13')][_0x7e6d('0x15')]);return _0x66aa3b(_0xf3e3a0[_0x7e6d('0x13')]['message']);}else{logger[_0x7e6d('0xe')]('ChatWebsite,\x20%s,\x20%s',_0x586ff4,_0x7e6d('0x16'));_0x66aa3b(_0xf3e3a0['result'][_0x7e6d('0x15')]);}})[_0x7e6d('0x17')](function(_0x280705){logger[_0x7e6d('0x13')](_0x7e6d('0xf'),_0x586ff4,_0x280705);_0x2e55fa(_0x280705);});});} \ No newline at end of file +var _0x5a3a=['../../config/environment','jayson/promise','client','http','redis','defaults','localhost','socket.io-emitter','./chatWebsite.socket','request','then','info','ChatWebsite,\x20%s,\x20%s','request\x20sent','debug','ChatWebsite,\x20%s,\x20%s,\x20%s','stringify','code','error','message','result','catch','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc'];(function(_0x4af3eb,_0x48cca9){var _0x96ebba=function(_0x23e683){while(--_0x23e683){_0x4af3eb['push'](_0x4af3eb['shift']());}};_0x96ebba(++_0x48cca9);}(_0x5a3a,0x16b));var _0xa5a3=function(_0x1da102,_0x59b250){_0x1da102=_0x1da102-0x0;var _0x537fe0=_0x5a3a[_0x1da102];return _0x537fe0;};'use strict';var _=require(_0xa5a3('0x0'));var util=require(_0xa5a3('0x1'));var moment=require('moment');var BPromise=require(_0xa5a3('0x2'));var rs=require(_0xa5a3('0x3'));var fs=require('fs');var Redis=require(_0xa5a3('0x4'));var db=require(_0xa5a3('0x5'))['db'];var utils=require(_0xa5a3('0x6'));var logger=require(_0xa5a3('0x7'))(_0xa5a3('0x8'));var config=require(_0xa5a3('0x9'));var jayson=require(_0xa5a3('0xa'));var client=jayson[_0xa5a3('0xb')][_0xa5a3('0xc')]({'port':0x232a});config[_0xa5a3('0xd')]=_[_0xa5a3('0xe')](config['redis'],{'host':_0xa5a3('0xf'),'port':0x18eb});var socket=require(_0xa5a3('0x10'))(new Redis(config[_0xa5a3('0xd')]));require(_0xa5a3('0x11'))['register'](socket);function respondWithRpcPromise(_0x4b0b69,_0x1a72f7,_0x13cae6){return new BPromise(function(_0x359784,_0x4e7d15){return client[_0xa5a3('0x12')](_0x4b0b69,_0x13cae6)[_0xa5a3('0x13')](function(_0x4a9683){logger[_0xa5a3('0x14')](_0xa5a3('0x15'),_0x1a72f7,_0xa5a3('0x16'));logger[_0xa5a3('0x17')](_0xa5a3('0x18'),_0x1a72f7,'request\x20sent',JSON[_0xa5a3('0x19')](_0x4a9683));if(_0x4a9683['error']){if(_0x4a9683['error'][_0xa5a3('0x1a')]===0x1f4){logger[_0xa5a3('0x1b')](_0xa5a3('0x15'),_0x1a72f7,_0x4a9683['error'][_0xa5a3('0x1c')]);return _0x4e7d15(_0x4a9683[_0xa5a3('0x1b')]['message']);}logger[_0xa5a3('0x1b')](_0xa5a3('0x15'),_0x1a72f7,_0x4a9683['error'][_0xa5a3('0x1c')]);return _0x359784(_0x4a9683[_0xa5a3('0x1b')][_0xa5a3('0x1c')]);}else{logger[_0xa5a3('0x14')](_0xa5a3('0x15'),_0x1a72f7,_0xa5a3('0x16'));_0x359784(_0x4a9683[_0xa5a3('0x1d')][_0xa5a3('0x1c')]);}})[_0xa5a3('0x1e')](function(_0x7c81d6){logger[_0xa5a3('0x1b')]('ChatWebsite,\x20%s,\x20%s',_0x1a72f7,_0x7c81d6);_0x4e7d15(_0x7c81d6);});});} \ No newline at end of file diff --git a/server/api/chatWebsite/chatWebsite.socket.js b/server/api/chatWebsite/chatWebsite.socket.js index 5dc9c44..aadd116 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 _0xb7c8=['remove','update','removeListener','register','length','chatWebsite:','save'];(function(_0x263714,_0x399b37){var _0x1cd43d=function(_0x2f2d3a){while(--_0x2f2d3a){_0x263714['push'](_0x263714['shift']());}};_0x1cd43d(++_0x399b37);}(_0xb7c8,0xae));var _0x8b7c=function(_0xa4e726,_0x415201){_0xa4e726=_0xa4e726-0x0;var _0x4cfe2f=_0xb7c8[_0xa4e726];return _0x4cfe2f;};'use strict';var ChatWebsiteEvents=require('./chatWebsite.events');var events=[_0x8b7c('0x0'),_0x8b7c('0x1'),_0x8b7c('0x2')];function createListener(_0x599498,_0x1b332c){return function(_0x963abe){_0x1b332c['emit'](_0x599498,_0x963abe);};}function removeListener(_0x4e1f5c,_0x4d6ee6){return function(){ChatWebsiteEvents[_0x8b7c('0x3')](_0x4e1f5c,_0x4d6ee6);};}exports[_0x8b7c('0x4')]=function(_0x293859){for(var _0x554883=0x0,_0x2fa975=events[_0x8b7c('0x5')];_0x554883<_0x2fa975;_0x554883++){var _0x34b79e=events[_0x554883];var _0x38cc82=createListener(_0x8b7c('0x6')+_0x34b79e,_0x293859);ChatWebsiteEvents['on'](_0x34b79e,_0x38cc82);}}; \ No newline at end of file +var _0x4d00=['register','length','remove','removeListener'];(function(_0x27d958,_0x29ef87){var _0x53e63e=function(_0x4130ec){while(--_0x4130ec){_0x27d958['push'](_0x27d958['shift']());}};_0x53e63e(++_0x29ef87);}(_0x4d00,0x122));var _0x04d0=function(_0x3bd13f,_0x1ba1c0){_0x3bd13f=_0x3bd13f-0x0;var _0x443f4b=_0x4d00[_0x3bd13f];return _0x443f4b;};'use strict';var ChatWebsiteEvents=require('./chatWebsite.events');var events=['save',_0x04d0('0x0'),'update'];function createListener(_0x142193,_0x3ec7a3){return function(_0x4975b0){_0x3ec7a3['emit'](_0x142193,_0x4975b0);};}function removeListener(_0x2efdf,_0x543777){return function(){ChatWebsiteEvents[_0x04d0('0x1')](_0x2efdf,_0x543777);};}exports[_0x04d0('0x2')]=function(_0x55369b){for(var _0x6f947a=0x0,_0x1b3f63=events[_0x04d0('0x3')];_0x6f947a<_0x1b3f63;_0x6f947a++){var _0x2983b1=events[_0x6f947a];var _0x391aeb=createListener('chatWebsite:'+_0x2983b1,_0x55369b);ChatWebsiteEvents['on'](_0x2983b1,_0x391aeb);}}; \ No newline at end of file diff --git a/server/api/chatWebsite/index.js b/server/api/chatWebsite/index.js index 584a9f8..ff6ca77 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 _0x4d77=['exports','util','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/describe','describe','/:id','show','/:id/dispositions','getDispositions','/:id/canned_answers','getAnswers','/:id/logo','getLogo','/:id/avatar','getAvatar','/:id/customer_avatar','getCustomerAvatar','/:id/system_avatar','getSystemAvatar','/:id/interactions','getInteractions','/:id/snippet','getSnippet','/:id/applications','getApplications','getProactiveActions','getFields','/:id/offline_messages','/:id/users','getAgents','post','create','addDisposition','addAnswer','diskStorage','join','root','server/files/images/logos/','format','%s-%s','now','originalname','single','addLogo','server/files/images/avatars/','file','addAvatar','addCustomerAvatar','/:id/notify','notify','server/files','attachments','offline-chat','ensureDir','replace','/:id/offline','any','/:id/proactive_actions','addProactiveActions','update','destroy','removeDispositions','removeAnswers','delete','removeAgents'];(function(_0x501510,_0x61caa9){var _0x1e6ee5=function(_0x32845b){while(--_0x32845b){_0x501510['push'](_0x501510['shift']());}};_0x1e6ee5(++_0x61caa9);}(_0x4d77,0xdf));var _0x74d7=function(_0x13d453,_0x16e7d2){_0x13d453=_0x13d453-0x0;var _0x2a4f7a=_0x4d77[_0x13d453];return _0x2a4f7a;};'use strict';var multer=require('multer');var util=require(_0x74d7('0x0'));var path=require('path');var timeout=require(_0x74d7('0x1'));var express=require(_0x74d7('0x2'));var router=express[_0x74d7('0x3')]();var fs_extra=require(_0x74d7('0x4'));var auth=require(_0x74d7('0x5'));var interaction=require(_0x74d7('0x6'));var config=require(_0x74d7('0x7'));var controller=require('./chatWebsite.controller');router[_0x74d7('0x8')]('/',auth[_0x74d7('0x9')](),controller[_0x74d7('0xa')]);router[_0x74d7('0x8')](_0x74d7('0xb'),auth[_0x74d7('0x9')](),controller[_0x74d7('0xc')]);router[_0x74d7('0x8')](_0x74d7('0xd'),auth['isAuthenticated'](),controller[_0x74d7('0xe')]);router[_0x74d7('0x8')](_0x74d7('0xf'),auth[_0x74d7('0x9')](),controller[_0x74d7('0x10')]);router[_0x74d7('0x8')](_0x74d7('0x11'),auth[_0x74d7('0x9')](),controller[_0x74d7('0x12')]);router[_0x74d7('0x8')](_0x74d7('0x13'),controller[_0x74d7('0x14')]);router[_0x74d7('0x8')](_0x74d7('0x15'),controller[_0x74d7('0x16')]);router[_0x74d7('0x8')](_0x74d7('0x17'),controller[_0x74d7('0x18')]);router[_0x74d7('0x8')](_0x74d7('0x19'),controller[_0x74d7('0x1a')]);router[_0x74d7('0x8')](_0x74d7('0x1b'),auth['isAuthenticated'](),controller[_0x74d7('0x1c')]);router[_0x74d7('0x8')](_0x74d7('0x1d'),controller[_0x74d7('0x1e')]);router['get'](_0x74d7('0x1f'),auth[_0x74d7('0x9')](),controller[_0x74d7('0x20')]);router[_0x74d7('0x8')]('/:id/proactive_actions',auth[_0x74d7('0x9')](),controller[_0x74d7('0x21')]);router[_0x74d7('0x8')]('/:id/fields',controller[_0x74d7('0x22')]);router[_0x74d7('0x8')](_0x74d7('0x23'),auth[_0x74d7('0x9')](),controller['getOfflineMessages']);router['get'](_0x74d7('0x24'),auth[_0x74d7('0x9')](),controller[_0x74d7('0x25')]);router[_0x74d7('0x26')]('/',auth['isAuthenticated'](),controller[_0x74d7('0x27')]);router[_0x74d7('0x26')](_0x74d7('0xf'),auth[_0x74d7('0x9')](),controller[_0x74d7('0x28')]);router[_0x74d7('0x26')](_0x74d7('0x11'),auth[_0x74d7('0x9')](),controller[_0x74d7('0x29')]);var upload=multer({'storage':multer[_0x74d7('0x2a')]({'destination':function(_0x4ac15f,_0x2ed67f,_0x31af24){_0x31af24(null,path[_0x74d7('0x2b')](config[_0x74d7('0x2c')],_0x74d7('0x2d')));},'filename':function(_0x19170f,_0x14c3cd,_0x18aad3){_0x18aad3(null,util[_0x74d7('0x2e')](_0x74d7('0x2f'),Date[_0x74d7('0x30')](),_0x14c3cd[_0x74d7('0x31')]));}})});router[_0x74d7('0x26')](_0x74d7('0x13'),upload[_0x74d7('0x32')]('file'),controller[_0x74d7('0x33')]);var upload=multer({'storage':multer[_0x74d7('0x2a')]({'destination':function(_0x213aa3,_0x3924a4,_0x3d958f){_0x3d958f(null,path[_0x74d7('0x2b')](config[_0x74d7('0x2c')],_0x74d7('0x34')));},'filename':function(_0x34d5d3,_0x39fbf1,_0x512c78){_0x512c78(null,util['format'](_0x74d7('0x2f'),Date[_0x74d7('0x30')](),_0x39fbf1[_0x74d7('0x31')]));}})});router[_0x74d7('0x26')]('/:id/avatar',upload[_0x74d7('0x32')](_0x74d7('0x35')),controller[_0x74d7('0x36')]);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0x19846d,_0x1b571c,_0x4ad428){_0x4ad428(null,path[_0x74d7('0x2b')](config[_0x74d7('0x2c')],_0x74d7('0x34')));},'filename':function(_0x1188da,_0x3caee6,_0x274f39){_0x274f39(null,util[_0x74d7('0x2e')]('%s-%s',Date[_0x74d7('0x30')](),_0x3caee6[_0x74d7('0x31')]));}})});router[_0x74d7('0x26')]('/:id/customer_avatar',upload[_0x74d7('0x32')](_0x74d7('0x35')),controller[_0x74d7('0x37')]);var upload=multer({'storage':multer[_0x74d7('0x2a')]({'destination':function(_0x3f0576,_0x41a28e,_0x53a942){_0x53a942(null,path[_0x74d7('0x2b')](config[_0x74d7('0x2c')],_0x74d7('0x34')));},'filename':function(_0x2de36f,_0x919205,_0x256621){_0x256621(null,util[_0x74d7('0x2e')]('%s-%s',Date[_0x74d7('0x30')](),_0x919205['originalname']));}})});router[_0x74d7('0x26')](_0x74d7('0x19'),upload[_0x74d7('0x32')]('file'),controller['addSystemAvatar']);router[_0x74d7('0x26')](_0x74d7('0x38'),controller[_0x74d7('0x39')]);const offlineUploadMulter=multer({'storage':multer[_0x74d7('0x2a')]({'destination':function(_0x1d8596,_0x1ee70d,_0x3e94ff){const _0x1cf608=path[_0x74d7('0x2b')](config[_0x74d7('0x2c')],_0x74d7('0x3a'),_0x74d7('0x3b'),_0x74d7('0x3c'));fs_extra[_0x74d7('0x3d')](_0x1cf608,function(){_0x3e94ff(null,_0x1cf608);});},'filename':function(_0x146ca9,_0x1fc11d,_0x18b57e){const _0x7d5cd2=_0x1fc11d[_0x74d7('0x31')][_0x74d7('0x3e')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-');const _0xcd303c=path['extname'](_0x7d5cd2);const _0x532560=Date[_0x74d7('0x30')]()+'-'+_0x7d5cd2[_0x74d7('0x3e')](_0xcd303c,'')+_0xcd303c;_0x18b57e(null,_0x532560);}})});router[_0x74d7('0x26')](_0x74d7('0x3f'),offlineUploadMulter[_0x74d7('0x40')](),controller['offline']);router[_0x74d7('0x26')](_0x74d7('0x1b'),auth[_0x74d7('0x9')](),controller['addInteraction']);router[_0x74d7('0x26')](_0x74d7('0x1f'),auth[_0x74d7('0x9')](),controller['addApplications']);router[_0x74d7('0x26')](_0x74d7('0x41'),auth[_0x74d7('0x9')](),controller[_0x74d7('0x42')]);router['post']('/:id/users',auth[_0x74d7('0x9')](),controller['addAgents']);router['put'](_0x74d7('0xd'),auth[_0x74d7('0x9')](),controller[_0x74d7('0x43')]);router['delete'](_0x74d7('0xd'),auth[_0x74d7('0x9')](),controller[_0x74d7('0x44')]);router['delete'](_0x74d7('0xf'),auth[_0x74d7('0x9')](),controller[_0x74d7('0x45')]);router['delete'](_0x74d7('0x11'),auth[_0x74d7('0x9')](),controller[_0x74d7('0x46')]);router[_0x74d7('0x47')](_0x74d7('0x24'),auth[_0x74d7('0x9')](),controller[_0x74d7('0x48')]);module[_0x74d7('0x49')]=router; \ No newline at end of file +var _0xf740=['/:id/proactive_actions','getProactiveActions','/:id/fields','getFields','/:id/offline_messages','getOfflineMessages','getAgents','create','post','/:id/dispositions','addDisposition','addAnswer','diskStorage','server/files/images/logos/','format','%s-%s','now','originalname','/:id/logo','single','file','join','root','addAvatar','addCustomerAvatar','server/files/images/avatars/','addSystemAvatar','/:id/notify','notify','server/files','offline-chat','ensureDir','replace','extname','/:id/offline','any','offline','addInteraction','/:id/applications','addApplications','addProactiveActions','/:id/users','put','update','delete','removeDispositions','removeAnswers','removeAgents','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../config/environment','./chatWebsite.controller','get','isAuthenticated','/describe','describe','/:id','show','/:id/canned_answers','getAnswers','getLogo','/:id/avatar','/:id/customer_avatar','getCustomerAvatar','/:id/system_avatar','getSystemAvatar','/:id/interactions','getInteractions','/:id/snippet','getSnippet','getApplications'];(function(_0x3bfb21,_0x37932e){var _0xce3257=function(_0x2d8814){while(--_0x2d8814){_0x3bfb21['push'](_0x3bfb21['shift']());}};_0xce3257(++_0x37932e);}(_0xf740,0x11b));var _0x0f74=function(_0x65d12e,_0x4b0a30){_0x65d12e=_0x65d12e-0x0;var _0x4274e0=_0xf740[_0x65d12e];return _0x4274e0;};'use strict';var multer=require(_0x0f74('0x0'));var util=require(_0x0f74('0x1'));var path=require(_0x0f74('0x2'));var timeout=require(_0x0f74('0x3'));var express=require(_0x0f74('0x4'));var router=express[_0x0f74('0x5')]();var fs_extra=require(_0x0f74('0x6'));var auth=require(_0x0f74('0x7'));var interaction=require('../../components/interaction/service');var config=require(_0x0f74('0x8'));var controller=require(_0x0f74('0x9'));router[_0x0f74('0xa')]('/',auth[_0x0f74('0xb')](),controller['index']);router[_0x0f74('0xa')](_0x0f74('0xc'),auth['isAuthenticated'](),controller[_0x0f74('0xd')]);router[_0x0f74('0xa')](_0x0f74('0xe'),auth[_0x0f74('0xb')](),controller[_0x0f74('0xf')]);router['get']('/:id/dispositions',auth[_0x0f74('0xb')](),controller['getDispositions']);router['get'](_0x0f74('0x10'),auth[_0x0f74('0xb')](),controller[_0x0f74('0x11')]);router[_0x0f74('0xa')]('/:id/logo',controller[_0x0f74('0x12')]);router['get'](_0x0f74('0x13'),controller['getAvatar']);router['get'](_0x0f74('0x14'),controller[_0x0f74('0x15')]);router[_0x0f74('0xa')](_0x0f74('0x16'),controller[_0x0f74('0x17')]);router[_0x0f74('0xa')](_0x0f74('0x18'),auth[_0x0f74('0xb')](),controller[_0x0f74('0x19')]);router['get'](_0x0f74('0x1a'),controller[_0x0f74('0x1b')]);router[_0x0f74('0xa')]('/:id/applications',auth['isAuthenticated'](),controller[_0x0f74('0x1c')]);router[_0x0f74('0xa')](_0x0f74('0x1d'),auth[_0x0f74('0xb')](),controller[_0x0f74('0x1e')]);router[_0x0f74('0xa')](_0x0f74('0x1f'),controller[_0x0f74('0x20')]);router[_0x0f74('0xa')](_0x0f74('0x21'),auth[_0x0f74('0xb')](),controller[_0x0f74('0x22')]);router['get']('/:id/users',auth['isAuthenticated'](),controller[_0x0f74('0x23')]);router['post']('/',auth[_0x0f74('0xb')](),controller[_0x0f74('0x24')]);router[_0x0f74('0x25')](_0x0f74('0x26'),auth[_0x0f74('0xb')](),controller[_0x0f74('0x27')]);router[_0x0f74('0x25')](_0x0f74('0x10'),auth[_0x0f74('0xb')](),controller[_0x0f74('0x28')]);var upload=multer({'storage':multer[_0x0f74('0x29')]({'destination':function(_0x5d6fb0,_0x3a9eb9,_0x493790){_0x493790(null,path['join'](config['root'],_0x0f74('0x2a')));},'filename':function(_0x19890e,_0x5b21c7,_0x37407c){_0x37407c(null,util[_0x0f74('0x2b')](_0x0f74('0x2c'),Date[_0x0f74('0x2d')](),_0x5b21c7[_0x0f74('0x2e')]));}})});router[_0x0f74('0x25')](_0x0f74('0x2f'),upload[_0x0f74('0x30')](_0x0f74('0x31')),controller['addLogo']);var upload=multer({'storage':multer[_0x0f74('0x29')]({'destination':function(_0x50ef29,_0x42d473,_0x100ae1){_0x100ae1(null,path[_0x0f74('0x32')](config[_0x0f74('0x33')],'server/files/images/avatars/'));},'filename':function(_0x158337,_0x1aef3c,_0x43f33d){_0x43f33d(null,util[_0x0f74('0x2b')]('%s-%s',Date[_0x0f74('0x2d')](),_0x1aef3c[_0x0f74('0x2e')]));}})});router[_0x0f74('0x25')](_0x0f74('0x13'),upload[_0x0f74('0x30')](_0x0f74('0x31')),controller[_0x0f74('0x34')]);var upload=multer({'storage':multer[_0x0f74('0x29')]({'destination':function(_0xdd42a2,_0x1ed1d9,_0x3cf790){_0x3cf790(null,path['join'](config[_0x0f74('0x33')],'server/files/images/avatars/'));},'filename':function(_0x3aeae9,_0x39f081,_0x4a2333){_0x4a2333(null,util[_0x0f74('0x2b')](_0x0f74('0x2c'),Date[_0x0f74('0x2d')](),_0x39f081[_0x0f74('0x2e')]));}})});router[_0x0f74('0x25')](_0x0f74('0x14'),upload[_0x0f74('0x30')](_0x0f74('0x31')),controller[_0x0f74('0x35')]);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0x3567d0,_0x31dbe2,_0x3a927b){_0x3a927b(null,path[_0x0f74('0x32')](config[_0x0f74('0x33')],_0x0f74('0x36')));},'filename':function(_0x48df35,_0xcccb52,_0x4df0fe){_0x4df0fe(null,util[_0x0f74('0x2b')](_0x0f74('0x2c'),Date[_0x0f74('0x2d')](),_0xcccb52['originalname']));}})});router[_0x0f74('0x25')](_0x0f74('0x16'),upload[_0x0f74('0x30')](_0x0f74('0x31')),controller[_0x0f74('0x37')]);router[_0x0f74('0x25')](_0x0f74('0x38'),controller[_0x0f74('0x39')]);const offlineUploadMulter=multer({'storage':multer[_0x0f74('0x29')]({'destination':function(_0xf243f8,_0xdfb0c0,_0x438eb8){const _0x1a6257=path['join'](config[_0x0f74('0x33')],_0x0f74('0x3a'),'attachments',_0x0f74('0x3b'));fs_extra[_0x0f74('0x3c')](_0x1a6257,function(){_0x438eb8(null,_0x1a6257);});},'filename':function(_0x4efe09,_0x18b61b,_0x397237){const _0x445e57=_0x18b61b['originalname'][_0x0f74('0x3d')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-');const _0x4e9bfb=path[_0x0f74('0x3e')](_0x445e57);const _0x318af4=Date[_0x0f74('0x2d')]()+'-'+_0x445e57[_0x0f74('0x3d')](_0x4e9bfb,'')+_0x4e9bfb;_0x397237(null,_0x318af4);}})});router['post'](_0x0f74('0x3f'),offlineUploadMulter[_0x0f74('0x40')](),controller[_0x0f74('0x41')]);router[_0x0f74('0x25')](_0x0f74('0x18'),auth['isAuthenticated'](),controller[_0x0f74('0x42')]);router[_0x0f74('0x25')](_0x0f74('0x43'),auth[_0x0f74('0xb')](),controller[_0x0f74('0x44')]);router[_0x0f74('0x25')](_0x0f74('0x1d'),auth[_0x0f74('0xb')](),controller[_0x0f74('0x45')]);router[_0x0f74('0x25')](_0x0f74('0x46'),auth[_0x0f74('0xb')](),controller['addAgents']);router[_0x0f74('0x47')](_0x0f74('0xe'),auth[_0x0f74('0xb')](),controller[_0x0f74('0x48')]);router[_0x0f74('0x49')]('/:id',auth[_0x0f74('0xb')](),controller['destroy']);router['delete'](_0x0f74('0x26'),auth[_0x0f74('0xb')](),controller[_0x0f74('0x4a')]);router[_0x0f74('0x49')]('/:id/canned_answers',auth[_0x0f74('0xb')](),controller[_0x0f74('0x4b')]);router[_0x0f74('0x49')](_0x0f74('0x46'),auth[_0x0f74('0xb')](),controller[_0x0f74('0x4c')]);module[_0x0f74('0x4d')]=router; \ No newline at end of file diff --git a/server/api/client-side-logs.js b/server/api/client-side-logs.js index 8df4db0..833c288 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 _0x7b58=['app','get','client-side-logger','Client-Side\x20logger\x20not\x20found!','expressEndpoint','/client-logs','isAuthenticated','exports','../components/auth/service','Router','env'];(function(_0x49e175,_0x1f0e25){var _0x250bb6=function(_0x3c2685){while(--_0x3c2685){_0x49e175['push'](_0x49e175['shift']());}};_0x250bb6(++_0x1f0e25);}(_0x7b58,0xad));var _0x87b5=function(_0x173d97,_0x1028d6){_0x173d97=_0x173d97-0x0;var _0x2ebce0=_0x7b58[_0x173d97];return _0x2ebce0;};var beaverLogger=require('beaver-logger/server');var express=require('express');var auth=require(_0x87b5('0x0'));var config=require('../config/environment');var router=express[_0x87b5('0x1')]();var isProduction=config[_0x87b5('0x2')]==='production'||![];function clientSideLogs(_0x482111,_0x2b2801,_0xed3e5c){var _0x514a7b=_0x482111[_0x87b5('0x3')][_0x87b5('0x4')](_0x87b5('0x5'));if(!_0x514a7b){throw new Error(_0x87b5('0x6'));}return beaverLogger[_0x87b5('0x7')]({'uri':_0x87b5('0x8'),'logger':_0x514a7b,'enableCors':!isProduction})(_0x482111,_0x2b2801,_0xed3e5c);}router['use'](auth[_0x87b5('0x9')](),clientSideLogs);module[_0x87b5('0xa')]=router; \ No newline at end of file +var _0x4c9c=['get','client-side-logger','Client-Side\x20logger\x20not\x20found!','expressEndpoint','/client-logs','use','isAuthenticated','exports','beaver-logger/server','express','../config/environment','Router','env','production','app'];(function(_0x4cbd73,_0x20e7b6){var _0x3291ea=function(_0x4fe00f){while(--_0x4fe00f){_0x4cbd73['push'](_0x4cbd73['shift']());}};_0x3291ea(++_0x20e7b6);}(_0x4c9c,0x1ac));var _0xc4c9=function(_0x437560,_0xc5d67f){_0x437560=_0x437560-0x0;var _0x278361=_0x4c9c[_0x437560];return _0x278361;};var beaverLogger=require(_0xc4c9('0x0'));var express=require(_0xc4c9('0x1'));var auth=require('../components/auth/service');var config=require(_0xc4c9('0x2'));var router=express[_0xc4c9('0x3')]();var isProduction=config[_0xc4c9('0x4')]===_0xc4c9('0x5')||![];function clientSideLogs(_0x3e0fe6,_0x1f9e3e,_0x8717b){var _0x39b5a5=_0x3e0fe6[_0xc4c9('0x6')][_0xc4c9('0x7')](_0xc4c9('0x8'));if(!_0x39b5a5){throw new Error(_0xc4c9('0x9'));}return beaverLogger[_0xc4c9('0xa')]({'uri':_0xc4c9('0xb'),'logger':_0x39b5a5,'enableCors':!isProduction})(_0x3e0fe6,_0x1f9e3e,_0x8717b);}router[_0xc4c9('0xc')](auth[_0xc4c9('0xd')](),clientSideLogs);module[_0xc4c9('0xe')]=router; \ No newline at end of file diff --git a/server/api/cloudProvider/cloudProvider.attributes.js b/server/api/cloudProvider/cloudProvider.attributes.js index bdbd455..1b8ae52 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 _0xd613=['exports','ENUM','AmazonAWS','Google','MicrosoftAzure','Outlook365','Dynamics365','STRING','MicrosoftAzure\x20=>\x20client_id','MicrosoftAzure\x20=>\x20client_secret','MicrosoftAzure\x20=>\x20redirect_uri','MicrosoftAzure\x20=>\x20access_token','TEXT','MicrosoftAzure\x20=>\x20refresh_token','MicrosoftAzure\x20=>\x20Dynamics365\x20=>\x20remote_uri','sequelize'];(function(_0x545e05,_0x27180e){var _0x26d054=function(_0x304906){while(--_0x304906){_0x545e05['push'](_0x545e05['shift']());}};_0x26d054(++_0x27180e);}(_0xd613,0x1bf));var _0x3d61=function(_0x1559b7,_0x4b703d){_0x1559b7=_0x1559b7-0x0;var _0x38982e=_0xd613[_0x1559b7];return _0x38982e;};'use strict';var Sequelize=require(_0x3d61('0x0'));module[_0x3d61('0x1')]={'name':{'type':Sequelize['STRING'],'allowNull':![],'validate':{'notEmpty':!![]}},'service':{'type':Sequelize[_0x3d61('0x2')](_0x3d61('0x3'),_0x3d61('0x4'),_0x3d61('0x5')),'allowNull':![],'validate':{'notEmpty':!![]}},'type':{'type':Sequelize[_0x3d61('0x2')](_0x3d61('0x6'),_0x3d61('0x7'))},'data1':{'type':Sequelize[_0x3d61('0x8')],'comment':_0x3d61('0x9')},'data2':{'type':Sequelize[_0x3d61('0x8')],'comment':'MicrosoftAzure\x20=>\x20tenant'},'data3':{'type':Sequelize['STRING'],'comment':_0x3d61('0xa')},'data4':{'type':Sequelize[_0x3d61('0x8')],'comment':_0x3d61('0xb')},'data5':{'type':Sequelize['TEXT'],'comment':_0x3d61('0xc')},'data6':{'type':Sequelize[_0x3d61('0xd')],'comment':_0x3d61('0xe')},'data7':{'type':Sequelize[_0x3d61('0xd')],'comment':_0x3d61('0xf')}}; \ No newline at end of file +var _0x42d0=['sequelize','exports','STRING','ENUM','AmazonAWS','Google','Dynamics365','MicrosoftAzure\x20=>\x20client_id','MicrosoftAzure\x20=>\x20client_secret','TEXT','MicrosoftAzure\x20=>\x20access_token'];(function(_0x2b1ac5,_0x43e347){var _0x224a7a=function(_0x1e936d){while(--_0x1e936d){_0x2b1ac5['push'](_0x2b1ac5['shift']());}};_0x224a7a(++_0x43e347);}(_0x42d0,0x79));var _0x042d=function(_0x1e9e56,_0x34a74a){_0x1e9e56=_0x1e9e56-0x0;var _0x5d5e2e=_0x42d0[_0x1e9e56];return _0x5d5e2e;};'use strict';var Sequelize=require(_0x042d('0x0'));module[_0x042d('0x1')]={'name':{'type':Sequelize[_0x042d('0x2')],'allowNull':![],'validate':{'notEmpty':!![]}},'service':{'type':Sequelize[_0x042d('0x3')](_0x042d('0x4'),_0x042d('0x5'),'MicrosoftAzure'),'allowNull':![],'validate':{'notEmpty':!![]}},'type':{'type':Sequelize[_0x042d('0x3')]('Outlook365',_0x042d('0x6'))},'data1':{'type':Sequelize['STRING'],'comment':_0x042d('0x7')},'data2':{'type':Sequelize[_0x042d('0x2')],'comment':'MicrosoftAzure\x20=>\x20tenant'},'data3':{'type':Sequelize[_0x042d('0x2')],'comment':_0x042d('0x8')},'data4':{'type':Sequelize[_0x042d('0x2')],'comment':'MicrosoftAzure\x20=>\x20redirect_uri'},'data5':{'type':Sequelize[_0x042d('0x9')],'comment':_0x042d('0xa')},'data6':{'type':Sequelize['TEXT'],'comment':'MicrosoftAzure\x20=>\x20refresh_token'},'data7':{'type':Sequelize[_0x042d('0x9')],'comment':'MicrosoftAzure\x20=>\x20Dynamics365\x20=>\x20remote_uri'}}; \ No newline at end of file diff --git a/server/api/cloudProvider/cloudProvider.controller.js b/server/api/cloudProvider/cloudProvider.controller.js index fd4ccff..285a459 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 _0xde20=['stack','name','send','padEnd','index','map','CloudProvider','rawAttributes','fieldName','type','key','model','query','keys','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','include','findAll','rows','service','MicrosoftAzure','data3','params','filters','length','find','decryptString','create','body','Name\x20parameter\x20not\x20specified','includes','Invalid\x20service\x20parameter.\x20Allowed\x20values:\x20','encryptString','catch','findOne','user','oauth2MicrosoftCallback','state','Invalid\x20state\x20parameter','parse','base64','ascii','id_token','Unable\x20to\x20validate\x20id_token','del','getOauth2MicrosoftAccessToken','code','data5','access_token','data6','startRefreshInterval','emit','microsoftAuthorization:success','microsoftAuthorization:error','message','Authentication\x20failed\x20for\x20cloud\x20provider\x20#%s,\x20err:%s','stringify','lodash','ioredis','../../components/parsers/qs','../../components/encryptor','../../config/logger','api','./cloudProvider.oauth','redis','localhost','socket.io-emitter','end','json','limit','undefined','count','offset','status','set','Content-Range','update','then','destroy','sendStatus','error'];(function(_0x173441,_0x26b0d9){var _0x2423a8=function(_0x4d96c2){while(--_0x4d96c2){_0x173441['push'](_0x173441['shift']());}};_0x2423a8(++_0x26b0d9);}(_0xde20,0x1b9));var _0x0de2=function(_0x40e2e4,_0x5972b6){_0x40e2e4=_0x40e2e4-0x0;var _0x5a6cbf=_0xde20[_0x40e2e4];return _0x5a6cbf;};'use strict';var _=require(_0x0de2('0x0'));var Redis=require(_0x0de2('0x1'));var qs=require(_0x0de2('0x2'));var encryptor=require(_0x0de2('0x3'));var config=require('../../config/environment');var logger=require(_0x0de2('0x4'))(_0x0de2('0x5'));var db=require('../../mysqldb')['db'];var oauth=require(_0x0de2('0x6'));config[_0x0de2('0x7')]=_['defaults'](config[_0x0de2('0x7')],{'host':_0x0de2('0x8'),'port':0x18eb});var socket=require(_0x0de2('0x9'))(new Redis(config[_0x0de2('0x7')]));var redis=new Redis(config[_0x0de2('0x7')]);function respondWithStatusCode(_0xf237dd,_0x27542d){_0x27542d=_0x27542d||0xcc;return function(_0x4d03db){if(_0x4d03db){return _0xf237dd['sendStatus'](_0x27542d);}return _0xf237dd['status'](_0x27542d)[_0x0de2('0xa')]();};}function respondWithResult(_0x312c6a,_0x17e718){_0x17e718=_0x17e718||0xc8;return function(_0x4655c5){if(_0x4655c5){return _0x312c6a['status'](_0x17e718)[_0x0de2('0xb')](_0x4655c5);}};}function respondWithFilteredResult(_0x3d35c0,_0x1c97df){return function(_0x348f56){if(_0x348f56){var _0x78ab2b=typeof _0x1c97df['offset']==='undefined'&&typeof _0x1c97df[_0x0de2('0xc')]===_0x0de2('0xd');var _0x14ca41=_0x348f56[_0x0de2('0xe')];var _0xb918b1=_0x78ab2b?0x0:_0x1c97df[_0x0de2('0xf')];var _0x7bb60a=_0x78ab2b?_0x348f56['count']:_0x1c97df[_0x0de2('0xf')]+_0x1c97df['limit'];var _0x5d3847;if(_0x7bb60a>=_0x14ca41){_0x7bb60a=_0x14ca41;_0x5d3847=0xc8;}else{_0x5d3847=0xce;}_0x3d35c0[_0x0de2('0x10')](_0x5d3847);return _0x3d35c0[_0x0de2('0x11')](_0x0de2('0x12'),_0xb918b1+'-'+_0x7bb60a+'/'+_0x14ca41)['json'](_0x348f56);}return null;};}function saveUpdates(_0x4c825a){return function(_0x4c25ad){if(_0x4c25ad){return _0x4c25ad[_0x0de2('0x13')](_0x4c825a)[_0x0de2('0x14')](function(_0xea63d1){return _0xea63d1;});}return null;};}function removeEntity(_0x58734e){return function(_0x4f7629){if(_0x4f7629){return _0x4f7629[_0x0de2('0x15')]()[_0x0de2('0x14')](function(){_0x58734e[_0x0de2('0x10')](0xcc)['end']();});}};}function handleEntityNotFound(_0x16b89f){return function(_0x41996a){if(!_0x41996a){_0x16b89f[_0x0de2('0x16')](0x194);}return _0x41996a;};}function handleError(_0xffe8c5,_0x56ba88){_0x56ba88=_0x56ba88||0x1f4;return function(_0x46c6d6){logger[_0x0de2('0x17')](_0x46c6d6[_0x0de2('0x18')]);if(_0x46c6d6[_0x0de2('0x19')]){delete _0x46c6d6[_0x0de2('0x19')];}_0xffe8c5[_0x0de2('0x10')](_0x56ba88)[_0x0de2('0x1a')](_0x46c6d6);};}function maskClientSecret(_0x56bea4){return _[_0x0de2('0x1b')](_0x56bea4['slice'](0x0,0x3),0x14,'*');}exports[_0x0de2('0x1c')]=function(_0x51269c,_0x41eefb){var _0x5ef794={},_0x19c2b9={},_0x4bee92={'count':0x0,'rows':[]};var _0x3f8b04=_[_0x0de2('0x1d')](db[_0x0de2('0x1e')][_0x0de2('0x1f')],function(_0x4f4d60){return{'name':_0x4f4d60[_0x0de2('0x20')],'type':_0x4f4d60[_0x0de2('0x21')][_0x0de2('0x22')]};});_0x19c2b9[_0x0de2('0x23')]=_['map'](_0x3f8b04,'name');_0x19c2b9[_0x0de2('0x24')]=_[_0x0de2('0x25')](_0x51269c[_0x0de2('0x24')]);_0x19c2b9['filters']=_[_0x0de2('0x26')](_0x19c2b9[_0x0de2('0x23')],_0x19c2b9[_0x0de2('0x24')]);_0x5ef794[_0x0de2('0x27')]=_[_0x0de2('0x26')](_0x19c2b9[_0x0de2('0x23')],qs['fields'](_0x51269c['query'][_0x0de2('0x28')]));_0x5ef794[_0x0de2('0x27')]=_0x5ef794[_0x0de2('0x27')]['length']?_0x5ef794[_0x0de2('0x27')]:_0x19c2b9['model'];if(!_0x51269c['query'][_0x0de2('0x29')](_0x0de2('0x2a'))){_0x5ef794[_0x0de2('0xc')]=qs['limit'](_0x51269c[_0x0de2('0x24')][_0x0de2('0xc')]);_0x5ef794[_0x0de2('0xf')]=qs[_0x0de2('0xf')](_0x51269c[_0x0de2('0x24')][_0x0de2('0xf')]);}_0x5ef794[_0x0de2('0x2b')]=qs[_0x0de2('0x2c')](_0x51269c[_0x0de2('0x24')][_0x0de2('0x2c')]);_0x5ef794[_0x0de2('0x2d')]=qs['filters'](_[_0x0de2('0x2e')](_0x51269c[_0x0de2('0x24')],_0x19c2b9['filters']),_0x3f8b04);if(_0x51269c[_0x0de2('0x24')][_0x0de2('0x2f')]){_0x5ef794['where']=_[_0x0de2('0x30')](_0x5ef794[_0x0de2('0x2d')],{'$or':_[_0x0de2('0x1d')](_0x3f8b04,function(_0xa0eba6){if(_0xa0eba6[_0x0de2('0x21')]!==_0x0de2('0x31')){var _0x39f2d5={};_0x39f2d5[_0xa0eba6[_0x0de2('0x19')]]={'$like':'%'+_0x51269c[_0x0de2('0x24')][_0x0de2('0x2f')]+'%'};return _0x39f2d5;}})});}_0x5ef794=_[_0x0de2('0x30')]({},_0x5ef794,_0x51269c[_0x0de2('0x32')]);var _0x45433e={'where':_0x5ef794[_0x0de2('0x2d')]};return db[_0x0de2('0x1e')]['count'](_0x45433e)[_0x0de2('0x14')](function(_0x178d52){_0x4bee92[_0x0de2('0xe')]=_0x178d52;if(_0x51269c[_0x0de2('0x24')][_0x0de2('0x33')]){_0x5ef794[_0x0de2('0x34')]=[{'all':!![]}];}return db[_0x0de2('0x1e')][_0x0de2('0x35')](_0x5ef794);})['then'](function(_0x598623){_0x4bee92[_0x0de2('0x36')]=_['map'](_0x598623,function(_0xb30d09){if(_0xb30d09[_0x0de2('0x37')]===_0x0de2('0x38')){var _0x4ad92c=encryptor['decryptString'](_0xb30d09[_0x0de2('0x39')]);_0xb30d09[_0x0de2('0x39')]=maskClientSecret(_0x4ad92c);}return _0xb30d09;});return _0x4bee92;})[_0x0de2('0x14')](respondWithFilteredResult(_0x41eefb,_0x5ef794))['catch'](handleError(_0x41eefb,null));};exports['show']=function(_0x2f24fa,_0x4d6d6d){var _0x438bda={'raw':!![],'where':{'id':_0x2f24fa[_0x0de2('0x3a')]['id']}},_0x53ca0f={};_0x53ca0f[_0x0de2('0x23')]=_[_0x0de2('0x25')](db[_0x0de2('0x1e')][_0x0de2('0x1f')]);_0x53ca0f[_0x0de2('0x24')]=_['keys'](_0x2f24fa[_0x0de2('0x24')]);_0x53ca0f[_0x0de2('0x3b')]=_[_0x0de2('0x26')](_0x53ca0f[_0x0de2('0x23')],_0x53ca0f[_0x0de2('0x24')]);_0x438bda[_0x0de2('0x27')]=_[_0x0de2('0x26')](_0x53ca0f[_0x0de2('0x23')],qs[_0x0de2('0x28')](_0x2f24fa[_0x0de2('0x24')][_0x0de2('0x28')]));_0x438bda[_0x0de2('0x27')]=_0x438bda[_0x0de2('0x27')][_0x0de2('0x3c')]?_0x438bda[_0x0de2('0x27')]:_0x53ca0f[_0x0de2('0x23')];if(_0x2f24fa[_0x0de2('0x24')][_0x0de2('0x33')]){_0x438bda[_0x0de2('0x34')]=[{'all':!![]}];}_0x438bda=_[_0x0de2('0x30')]({},_0x438bda,_0x2f24fa[_0x0de2('0x32')]);return db[_0x0de2('0x1e')][_0x0de2('0x3d')](_0x438bda)['then'](handleEntityNotFound(_0x4d6d6d,null))[_0x0de2('0x14')](function(_0x113b72){if(_0x113b72[_0x0de2('0x37')]===_0x0de2('0x38')){var _0x2d3c5b=encryptor[_0x0de2('0x3e')](_0x113b72['data3']);_0x113b72[_0x0de2('0x39')]=maskClientSecret(_0x2d3c5b);}return _0x113b72;})[_0x0de2('0x14')](respondWithResult(_0x4d6d6d,null))['catch'](handleError(_0x4d6d6d,null));};exports[_0x0de2('0x3f')]=function(_0x3cb169,_0x3af158){if(!_0x3cb169[_0x0de2('0x40')][_0x0de2('0x19')])throw new Error(_0x0de2('0x41'));if(!_0x3cb169['body'][_0x0de2('0x37')])throw new Error('Service\x20parameter\x20not\x20specified');var _0x36432c=db[_0x0de2('0x1e')][_0x0de2('0x1f')][_0x0de2('0x37')]['values'];if(!_0x36432c[_0x0de2('0x42')](_0x3cb169[_0x0de2('0x40')][_0x0de2('0x37')]))throw new Error(_0x0de2('0x43')+_0x36432c['join'](',\x20'));if(_0x3cb169[_0x0de2('0x40')][_0x0de2('0x37')]===_0x0de2('0x38')&&_0x3cb169[_0x0de2('0x40')]['data3']){_0x3cb169['body']['data3']=encryptor[_0x0de2('0x44')](_0x3cb169[_0x0de2('0x40')][_0x0de2('0x39')]);}return db[_0x0de2('0x1e')][_0x0de2('0x3f')](_0x3cb169['body'],{})[_0x0de2('0x14')](respondWithResult(_0x3af158,0xc9))['catch'](handleError(_0x3af158,null));};exports[_0x0de2('0x13')]=function(_0x2bfed3,_0x46e8e0){if(_0x2bfed3[_0x0de2('0x40')]['id']){delete _0x2bfed3[_0x0de2('0x40')]['id'];}return db[_0x0de2('0x1e')][_0x0de2('0x3d')]({'where':{'id':_0x2bfed3['params']['id']}})['then'](handleEntityNotFound(_0x46e8e0,null))[_0x0de2('0x14')](function(_0x3c10b9){if(_0x3c10b9['service']==='MicrosoftAzure'&&_0x2bfed3['body'][_0x0de2('0x39')]){_0x2bfed3[_0x0de2('0x40')][_0x0de2('0x39')]=encryptor['encryptString'](_0x2bfed3[_0x0de2('0x40')]['data3']);}return _0x3c10b9;})[_0x0de2('0x14')](saveUpdates(_0x2bfed3['body'],null))[_0x0de2('0x14')](respondWithResult(_0x46e8e0,null))['catch'](handleError(_0x46e8e0,null));};exports[_0x0de2('0x15')]=function(_0x435428,_0x2259b1){return db[_0x0de2('0x1e')]['find']({'where':{'id':_0x435428['params']['id']}})['then'](handleEntityNotFound(_0x2259b1,null))[_0x0de2('0x14')](removeEntity(_0x2259b1,null))[_0x0de2('0x45')](handleError(_0x2259b1,null));};exports['oauth2MicrosoftAuthorize']=function(_0x569d5f,_0x2a19e1){return db['CloudProvider'][_0x0de2('0x46')]({'where':{'id':_0x569d5f[_0x0de2('0x3a')]['id']},'raw':!![]})['then'](function(_0x10bb1d){if(!_0x10bb1d)return _0x2a19e1['sendStatus'](0x194);return{'url':oauth['generateMicrosoftAuthorizationUrl'](_0x10bb1d,_0x569d5f[_0x0de2('0x47')]['id'])};})[_0x0de2('0x14')](respondWithResult(_0x2a19e1,null))[_0x0de2('0x45')](handleError(_0x2a19e1,null));};exports[_0x0de2('0x48')]=function(_0x4010fe,_0x2a06cf){var _0x280cd2=_0x4010fe[_0x0de2('0x40')];var _0x50f874;var _0x23a729;if(_0x280cd2['error'])throw _0x280cd2;redis['get'](_0x280cd2[_0x0de2('0x49')])[_0x0de2('0x14')](function(_0x1035a2){if(!_0x1035a2)throw new Error(_0x0de2('0x4a'));_0x50f874=JSON[_0x0de2('0x4b')](_0x1035a2);var _0x4f93c7=Buffer['from'](_0x280cd2[_0x0de2('0x49')],_0x0de2('0x4c'))['toString'](_0x0de2('0x4d'));_0x23a729=JSON[_0x0de2('0x4b')](_0x4f93c7);if(!oauth['isValidIdToken'](_0x280cd2[_0x0de2('0x4e')],_0x50f874['oauth2Claims']))throw new Error(_0x0de2('0x4f'));redis[_0x0de2('0x50')](_0x280cd2['state']);return oauth[_0x0de2('0x51')](_0x280cd2[_0x0de2('0x52')],_0x50f874);})[_0x0de2('0x14')](function(_0x387346){_0x50f874[_0x0de2('0x53')]=_0x387346[_0x0de2('0x54')];_0x50f874[_0x0de2('0x55')]=_0x387346['refresh_token'];return db[_0x0de2('0x1e')][_0x0de2('0x13')]({'data5':_0x50f874[_0x0de2('0x53')],'data6':_0x50f874[_0x0de2('0x55')]},{'where':{'id':_0x50f874['id']}});})[_0x0de2('0x14')](function(){oauth[_0x0de2('0x56')](_0x50f874);socket[_0x0de2('0x57')](_0x0de2('0x58'),{'id':_0x23a729['id']});return;})[_0x0de2('0x14')](respondWithStatusCode(_0x2a06cf,null))[_0x0de2('0x45')](function(_0x33b537){if(_0x23a729){socket[_0x0de2('0x57')](_0x0de2('0x59'),{'id':_0x23a729['id']});}if(!_0x50f874){logger[_0x0de2('0x17')]('Invalid\x20authentication\x20state\x20parameter',_0x33b537);return _0x2a06cf['status'](0x1f4)[_0x0de2('0x1a')](_0x33b537[_0x0de2('0x5a')]);}logger[_0x0de2('0x17')](_0x0de2('0x5b'),_0x50f874['id'],JSON[_0x0de2('0x5c')](_0x33b537));});}; \ No newline at end of file +var _0x43c3=['values','includes','Invalid\x20service\x20parameter.\x20Allowed\x20values:\x20','join','encryptString','create','generateMicrosoftAuthorizationUrl','oauth2MicrosoftCallback','error','get','Invalid\x20state\x20parameter','parse','from','state','base64','toString','ascii','isValidIdToken','id_token','oauth2Claims','Unable\x20to\x20validate\x20id_token','del','code','data5','data6','refresh_token','startRefreshInterval','emit','microsoftAuthorization:success','Invalid\x20authentication\x20state\x20parameter','Authentication\x20failed\x20for\x20cloud\x20provider\x20#%s,\x20err:%s','stringify','ioredis','../../components/parsers/qs','../../components/encryptor','../../config/environment','api','../../mysqldb','./cloudProvider.oauth','redis','socket.io-emitter','end','status','offset','undefined','limit','count','set','Content-Range','json','update','destroy','then','sendStatus','stack','name','send','padEnd','slice','CloudProvider','rawAttributes','fieldName','key','map','query','keys','filters','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','type','options','includeAll','include','rows','service','MicrosoftAzure','decryptString','data3','params','find','catch','body','Name\x20parameter\x20not\x20specified','Service\x20parameter\x20not\x20specified'];(function(_0x5c3d11,_0x589686){var _0x31e455=function(_0x251512){while(--_0x251512){_0x5c3d11['push'](_0x5c3d11['shift']());}};_0x31e455(++_0x589686);}(_0x43c3,0x13d));var _0x343c=function(_0x20c205,_0x3227cd){_0x20c205=_0x20c205-0x0;var _0x467a04=_0x43c3[_0x20c205];return _0x467a04;};'use strict';var _=require('lodash');var Redis=require(_0x343c('0x0'));var qs=require(_0x343c('0x1'));var encryptor=require(_0x343c('0x2'));var config=require(_0x343c('0x3'));var logger=require('../../config/logger')(_0x343c('0x4'));var db=require(_0x343c('0x5'))['db'];var oauth=require(_0x343c('0x6'));config[_0x343c('0x7')]=_['defaults'](config[_0x343c('0x7')],{'host':'localhost','port':0x18eb});var socket=require(_0x343c('0x8'))(new Redis(config[_0x343c('0x7')]));var redis=new Redis(config[_0x343c('0x7')]);function respondWithStatusCode(_0x1ce3e1,_0x17cdb9){_0x17cdb9=_0x17cdb9||0xcc;return function(_0x491440){if(_0x491440){return _0x1ce3e1['sendStatus'](_0x17cdb9);}return _0x1ce3e1['status'](_0x17cdb9)[_0x343c('0x9')]();};}function respondWithResult(_0x153ad4,_0x270ba8){_0x270ba8=_0x270ba8||0xc8;return function(_0x2fd9d7){if(_0x2fd9d7){return _0x153ad4[_0x343c('0xa')](_0x270ba8)['json'](_0x2fd9d7);}};}function respondWithFilteredResult(_0x2bc98d,_0x17a435){return function(_0x239b0f){if(_0x239b0f){var _0x5918bc=typeof _0x17a435[_0x343c('0xb')]===_0x343c('0xc')&&typeof _0x17a435[_0x343c('0xd')]===_0x343c('0xc');var _0x1b3af9=_0x239b0f[_0x343c('0xe')];var _0x2ec499=_0x5918bc?0x0:_0x17a435[_0x343c('0xb')];var _0x4921b6=_0x5918bc?_0x239b0f[_0x343c('0xe')]:_0x17a435[_0x343c('0xb')]+_0x17a435[_0x343c('0xd')];var _0x5d01a0;if(_0x4921b6>=_0x1b3af9){_0x4921b6=_0x1b3af9;_0x5d01a0=0xc8;}else{_0x5d01a0=0xce;}_0x2bc98d[_0x343c('0xa')](_0x5d01a0);return _0x2bc98d[_0x343c('0xf')](_0x343c('0x10'),_0x2ec499+'-'+_0x4921b6+'/'+_0x1b3af9)[_0x343c('0x11')](_0x239b0f);}return null;};}function saveUpdates(_0x49741f){return function(_0xa2ac6b){if(_0xa2ac6b){return _0xa2ac6b[_0x343c('0x12')](_0x49741f)['then'](function(_0x5658dc){return _0x5658dc;});}return null;};}function removeEntity(_0xa38cf0){return function(_0x4fd9fe){if(_0x4fd9fe){return _0x4fd9fe[_0x343c('0x13')]()[_0x343c('0x14')](function(){_0xa38cf0[_0x343c('0xa')](0xcc)[_0x343c('0x9')]();});}};}function handleEntityNotFound(_0x3c4209){return function(_0x1fd25a){if(!_0x1fd25a){_0x3c4209[_0x343c('0x15')](0x194);}return _0x1fd25a;};}function handleError(_0x356b84,_0xda759f){_0xda759f=_0xda759f||0x1f4;return function(_0x2d3d43){logger['error'](_0x2d3d43[_0x343c('0x16')]);if(_0x2d3d43[_0x343c('0x17')]){delete _0x2d3d43[_0x343c('0x17')];}_0x356b84['status'](_0xda759f)[_0x343c('0x18')](_0x2d3d43);};}function maskClientSecret(_0x491468){return _[_0x343c('0x19')](_0x491468[_0x343c('0x1a')](0x0,0x3),0x14,'*');}exports['index']=function(_0x1fbf0a,_0xdb0a45){var _0x4d026f={},_0x11f8cf={},_0x15eae7={'count':0x0,'rows':[]};var _0x47a16b=_['map'](db[_0x343c('0x1b')][_0x343c('0x1c')],function(_0x10b614){return{'name':_0x10b614[_0x343c('0x1d')],'type':_0x10b614['type'][_0x343c('0x1e')]};});_0x11f8cf['model']=_[_0x343c('0x1f')](_0x47a16b,'name');_0x11f8cf[_0x343c('0x20')]=_[_0x343c('0x21')](_0x1fbf0a[_0x343c('0x20')]);_0x11f8cf[_0x343c('0x22')]=_[_0x343c('0x23')](_0x11f8cf[_0x343c('0x24')],_0x11f8cf[_0x343c('0x20')]);_0x4d026f[_0x343c('0x25')]=_[_0x343c('0x23')](_0x11f8cf['model'],qs['fields'](_0x1fbf0a[_0x343c('0x20')][_0x343c('0x26')]));_0x4d026f[_0x343c('0x25')]=_0x4d026f[_0x343c('0x25')][_0x343c('0x27')]?_0x4d026f[_0x343c('0x25')]:_0x11f8cf[_0x343c('0x24')];if(!_0x1fbf0a['query'][_0x343c('0x28')](_0x343c('0x29'))){_0x4d026f['limit']=qs[_0x343c('0xd')](_0x1fbf0a[_0x343c('0x20')][_0x343c('0xd')]);_0x4d026f[_0x343c('0xb')]=qs[_0x343c('0xb')](_0x1fbf0a[_0x343c('0x20')][_0x343c('0xb')]);}_0x4d026f[_0x343c('0x2a')]=qs[_0x343c('0x2b')](_0x1fbf0a[_0x343c('0x20')][_0x343c('0x2b')]);_0x4d026f[_0x343c('0x2c')]=qs[_0x343c('0x22')](_[_0x343c('0x2d')](_0x1fbf0a[_0x343c('0x20')],_0x11f8cf[_0x343c('0x22')]),_0x47a16b);if(_0x1fbf0a[_0x343c('0x20')][_0x343c('0x2e')]){_0x4d026f[_0x343c('0x2c')]=_[_0x343c('0x2f')](_0x4d026f['where'],{'$or':_[_0x343c('0x1f')](_0x47a16b,function(_0x17213b){if(_0x17213b[_0x343c('0x30')]!=='VIRTUAL'){var _0x429a64={};_0x429a64[_0x17213b[_0x343c('0x17')]]={'$like':'%'+_0x1fbf0a[_0x343c('0x20')]['filter']+'%'};return _0x429a64;}})});}_0x4d026f=_[_0x343c('0x2f')]({},_0x4d026f,_0x1fbf0a[_0x343c('0x31')]);var _0x57c454={'where':_0x4d026f[_0x343c('0x2c')]};return db[_0x343c('0x1b')][_0x343c('0xe')](_0x57c454)[_0x343c('0x14')](function(_0x2990c4){_0x15eae7['count']=_0x2990c4;if(_0x1fbf0a[_0x343c('0x20')][_0x343c('0x32')]){_0x4d026f[_0x343c('0x33')]=[{'all':!![]}];}return db['CloudProvider']['findAll'](_0x4d026f);})[_0x343c('0x14')](function(_0x3e3d4f){_0x15eae7[_0x343c('0x34')]=_[_0x343c('0x1f')](_0x3e3d4f,function(_0x182c3d){if(_0x182c3d[_0x343c('0x35')]===_0x343c('0x36')){var _0x1f17ac=encryptor[_0x343c('0x37')](_0x182c3d[_0x343c('0x38')]);_0x182c3d['data3']=maskClientSecret(_0x1f17ac);}return _0x182c3d;});return _0x15eae7;})['then'](respondWithFilteredResult(_0xdb0a45,_0x4d026f))['catch'](handleError(_0xdb0a45,null));};exports['show']=function(_0x4f4eba,_0x3b05aa){var _0x41bc84={'raw':!![],'where':{'id':_0x4f4eba[_0x343c('0x39')]['id']}},_0xb50344={};_0xb50344[_0x343c('0x24')]=_[_0x343c('0x21')](db[_0x343c('0x1b')][_0x343c('0x1c')]);_0xb50344[_0x343c('0x20')]=_[_0x343c('0x21')](_0x4f4eba[_0x343c('0x20')]);_0xb50344[_0x343c('0x22')]=_[_0x343c('0x23')](_0xb50344[_0x343c('0x24')],_0xb50344[_0x343c('0x20')]);_0x41bc84[_0x343c('0x25')]=_[_0x343c('0x23')](_0xb50344[_0x343c('0x24')],qs[_0x343c('0x26')](_0x4f4eba[_0x343c('0x20')]['fields']));_0x41bc84[_0x343c('0x25')]=_0x41bc84['attributes'][_0x343c('0x27')]?_0x41bc84[_0x343c('0x25')]:_0xb50344[_0x343c('0x24')];if(_0x4f4eba[_0x343c('0x20')][_0x343c('0x32')]){_0x41bc84[_0x343c('0x33')]=[{'all':!![]}];}_0x41bc84=_[_0x343c('0x2f')]({},_0x41bc84,_0x4f4eba[_0x343c('0x31')]);return db[_0x343c('0x1b')][_0x343c('0x3a')](_0x41bc84)[_0x343c('0x14')](handleEntityNotFound(_0x3b05aa,null))['then'](function(_0x47b03a){if(_0x47b03a[_0x343c('0x35')]==='MicrosoftAzure'){var _0x2858c8=encryptor[_0x343c('0x37')](_0x47b03a[_0x343c('0x38')]);_0x47b03a['data3']=maskClientSecret(_0x2858c8);}return _0x47b03a;})[_0x343c('0x14')](respondWithResult(_0x3b05aa,null))[_0x343c('0x3b')](handleError(_0x3b05aa,null));};exports['create']=function(_0xde0c2,_0x2aecdc){if(!_0xde0c2[_0x343c('0x3c')][_0x343c('0x17')])throw new Error(_0x343c('0x3d'));if(!_0xde0c2['body']['service'])throw new Error(_0x343c('0x3e'));var _0x1f396c=db[_0x343c('0x1b')][_0x343c('0x1c')][_0x343c('0x35')][_0x343c('0x3f')];if(!_0x1f396c[_0x343c('0x40')](_0xde0c2[_0x343c('0x3c')]['service']))throw new Error(_0x343c('0x41')+_0x1f396c[_0x343c('0x42')](',\x20'));if(_0xde0c2[_0x343c('0x3c')][_0x343c('0x35')]==='MicrosoftAzure'&&_0xde0c2[_0x343c('0x3c')][_0x343c('0x38')]){_0xde0c2[_0x343c('0x3c')][_0x343c('0x38')]=encryptor[_0x343c('0x43')](_0xde0c2[_0x343c('0x3c')][_0x343c('0x38')]);}return db[_0x343c('0x1b')][_0x343c('0x44')](_0xde0c2[_0x343c('0x3c')],{})[_0x343c('0x14')](respondWithResult(_0x2aecdc,0xc9))[_0x343c('0x3b')](handleError(_0x2aecdc,null));};exports[_0x343c('0x12')]=function(_0x24b47a,_0xf48894){if(_0x24b47a[_0x343c('0x3c')]['id']){delete _0x24b47a['body']['id'];}return db[_0x343c('0x1b')][_0x343c('0x3a')]({'where':{'id':_0x24b47a[_0x343c('0x39')]['id']}})[_0x343c('0x14')](handleEntityNotFound(_0xf48894,null))[_0x343c('0x14')](function(_0x209291){if(_0x209291[_0x343c('0x35')]===_0x343c('0x36')&&_0x24b47a['body'][_0x343c('0x38')]){_0x24b47a['body']['data3']=encryptor[_0x343c('0x43')](_0x24b47a[_0x343c('0x3c')][_0x343c('0x38')]);}return _0x209291;})[_0x343c('0x14')](saveUpdates(_0x24b47a[_0x343c('0x3c')],null))[_0x343c('0x14')](respondWithResult(_0xf48894,null))['catch'](handleError(_0xf48894,null));};exports[_0x343c('0x13')]=function(_0x504afc,_0x19bc6a){return db[_0x343c('0x1b')][_0x343c('0x3a')]({'where':{'id':_0x504afc['params']['id']}})[_0x343c('0x14')](handleEntityNotFound(_0x19bc6a,null))['then'](removeEntity(_0x19bc6a,null))['catch'](handleError(_0x19bc6a,null));};exports['oauth2MicrosoftAuthorize']=function(_0x3818fa,_0xecc99b){return db[_0x343c('0x1b')]['findOne']({'where':{'id':_0x3818fa['params']['id']},'raw':!![]})['then'](function(_0x2728e5){if(!_0x2728e5)return _0xecc99b[_0x343c('0x15')](0x194);return{'url':oauth[_0x343c('0x45')](_0x2728e5,_0x3818fa['user']['id'])};})[_0x343c('0x14')](respondWithResult(_0xecc99b,null))[_0x343c('0x3b')](handleError(_0xecc99b,null));};exports[_0x343c('0x46')]=function(_0x33d265,_0x53a1f4){var _0x19e48e=_0x33d265[_0x343c('0x3c')];var _0x167a07;var _0x2f0ca5;if(_0x19e48e[_0x343c('0x47')])throw _0x19e48e;redis[_0x343c('0x48')](_0x19e48e['state'])[_0x343c('0x14')](function(_0x4117ee){if(!_0x4117ee)throw new Error(_0x343c('0x49'));_0x167a07=JSON[_0x343c('0x4a')](_0x4117ee);var _0xa5c628=Buffer[_0x343c('0x4b')](_0x19e48e[_0x343c('0x4c')],_0x343c('0x4d'))[_0x343c('0x4e')](_0x343c('0x4f'));_0x2f0ca5=JSON[_0x343c('0x4a')](_0xa5c628);if(!oauth[_0x343c('0x50')](_0x19e48e[_0x343c('0x51')],_0x167a07[_0x343c('0x52')]))throw new Error(_0x343c('0x53'));redis[_0x343c('0x54')](_0x19e48e[_0x343c('0x4c')]);return oauth['getOauth2MicrosoftAccessToken'](_0x19e48e[_0x343c('0x55')],_0x167a07);})[_0x343c('0x14')](function(_0xb1f659){_0x167a07[_0x343c('0x56')]=_0xb1f659['access_token'];_0x167a07[_0x343c('0x57')]=_0xb1f659[_0x343c('0x58')];return db[_0x343c('0x1b')][_0x343c('0x12')]({'data5':_0x167a07[_0x343c('0x56')],'data6':_0x167a07[_0x343c('0x57')]},{'where':{'id':_0x167a07['id']}});})[_0x343c('0x14')](function(){oauth[_0x343c('0x59')](_0x167a07);socket[_0x343c('0x5a')](_0x343c('0x5b'),{'id':_0x2f0ca5['id']});return;})[_0x343c('0x14')](respondWithStatusCode(_0x53a1f4,null))[_0x343c('0x3b')](function(_0x5d4cf6){if(_0x2f0ca5){socket[_0x343c('0x5a')]('microsoftAuthorization:error',{'id':_0x2f0ca5['id']});}if(!_0x167a07){logger[_0x343c('0x47')](_0x343c('0x5c'),_0x5d4cf6);return _0x53a1f4[_0x343c('0xa')](0x1f4)[_0x343c('0x18')](_0x5d4cf6['message']);}logger[_0x343c('0x47')](_0x343c('0x5d'),_0x167a07['id'],JSON[_0x343c('0x5e')](_0x5d4cf6));});}; \ No newline at end of file diff --git a/server/api/cloudProvider/cloudProvider.model.js b/server/api/cloudProvider/cloudProvider.model.js index 84a8a18..ad84835 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 _0xb306=['./cloudProvider.attributes','exports','define','CloudProvider','cloud_providers','lodash','util','api','request-promise','path','rimraf','../../config/environment'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xb306,0xdd));var _0x6b30=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xb306[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0x6b30('0x0'));var util=require(_0x6b30('0x1'));var logger=require('../../config/logger')(_0x6b30('0x2'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0x6b30('0x3'));var fs=require('fs');var path=require(_0x6b30('0x4'));var rimraf=require(_0x6b30('0x5'));var config=require(_0x6b30('0x6'));var attributes=require(_0x6b30('0x7'));module[_0x6b30('0x8')]=function(_0x7a8649,_0x2469b4){return _0x7a8649[_0x6b30('0x9')](_0x6b30('0xa'),attributes,{'tableName':_0x6b30('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xae14=['request-promise','rimraf','../../config/environment','./cloudProvider.attributes','exports','define','cloud_providers','util','../../config/logger','api','moment','bluebird'];(function(_0x54b5cd,_0x4c304a){var _0x354c1c=function(_0x4d354e){while(--_0x4d354e){_0x54b5cd['push'](_0x54b5cd['shift']());}};_0x354c1c(++_0x4c304a);}(_0xae14,0x7f));var _0x4ae1=function(_0x1d3a78,_0x4805b7){_0x1d3a78=_0x1d3a78-0x0;var _0x44483c=_0xae14[_0x1d3a78];return _0x44483c;};'use strict';var _=require('lodash');var util=require(_0x4ae1('0x0'));var logger=require(_0x4ae1('0x1'))(_0x4ae1('0x2'));var moment=require(_0x4ae1('0x3'));var BPromise=require(_0x4ae1('0x4'));var rp=require(_0x4ae1('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x4ae1('0x6'));var config=require(_0x4ae1('0x7'));var attributes=require(_0x4ae1('0x8'));module[_0x4ae1('0x9')]=function(_0x242a89,_0x41f57f){return _0x242a89[_0x4ae1('0xa')]('CloudProvider',attributes,{'tableName':_0x4ae1('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/cloudProvider/cloudProvider.oauth.js b/server/api/cloudProvider/cloudProvider.oauth.js index 177ebd7..0c7f748 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 _0xb31f=['then','CloudProvider','findOne','refresh_token','data6','decryptString','POST','data5','access_token','catch','error','authorization_code','bind','intervals','findAll','all','inspect','[CLOUD_PROVIDER]\x20Error\x20while\x20refreshing\x20the\x20tokens\x20after\x20service\x20restart\x20error:%s','crypto','jsonwebtoken','moment','ioredis','request-promise','../../components/encryptor','../../config/logger','api','../../config/schedule/cloud-provider','../../mysqldb','redis','defaults','localhost','https://login.microsoftonline.com/{TENANT_ID}/oauth2/v2.0','openid','profile','email','offline_access','https://outlook.office365.com/IMAP.AccessAsUser.All','https://outlook.office.com/POP.AccessAsUser.All','https://outlook.office.com/SMTP.Send','/authorize','/token','map','type','push','/.default','join','Outlook365','Dynamics365','data7','replace','{TENANT_ID}','data2','code','id_token','stringify','toString','base64','randomBytes','hex','data1','response_type','redirect_uri','data4','response_mode','form_post','scope','state','nonce','prompt','login','key','oauth2Claims','oauth2/','decode','payload','iss','aud','audience','isAfter','unix','resolve'];(function(_0xd637a3,_0x19b904){var _0x180a84=function(_0x2fc05a){while(--_0x2fc05a){_0xd637a3['push'](_0xd637a3['shift']());}};_0x180a84(++_0x19b904);}(_0xb31f,0x105));var _0xfb31=function(_0x43d11d,_0xccff91){_0x43d11d=_0x43d11d-0x0;var _0x38cd08=_0xb31f[_0x43d11d];return _0x38cd08;};'use strict';var _=require('lodash');var crypto=require(_0xfb31('0x0'));var jwt=require(_0xfb31('0x1'));var moment=require(_0xfb31('0x2'));var Redis=require(_0xfb31('0x3'));var rp=require(_0xfb31('0x4'));var util=require('util');var encryptor=require(_0xfb31('0x5'));var config=require('../../config/environment');var logger=require(_0xfb31('0x6'))(_0xfb31('0x7'));var schedule=require(_0xfb31('0x8'));var db=require(_0xfb31('0x9'))['db'];config[_0xfb31('0xa')]=_[_0xfb31('0xb')](config[_0xfb31('0xa')],{'host':_0xfb31('0xc'),'port':0x18eb});var redis=new Redis(config['redis']);var MICROSOFT_AUTH_URL=_0xfb31('0xd');var AZURE_AUTH_SCOPES={'Outlook365':[_0xfb31('0xe'),_0xfb31('0xf'),_0xfb31('0x10'),_0xfb31('0x11'),_0xfb31('0x12'),_0xfb31('0x13'),_0xfb31('0x14')],'Dynamics365':[_0xfb31('0xe'),_0xfb31('0x11')]};var MICROSOFT_AUTH_ENDPOINT=_0xfb31('0x15');var MICROSOFT_TOKEN_ENDPOINT=_0xfb31('0x16');var OAUTH_REFRESH_INTERVAL=0xfa;function getAuthorizationScopes(_0x13392e){var _0x569fec=_[_0xfb31('0x17')](AZURE_AUTH_SCOPES[_0x13392e[_0xfb31('0x18')]]);if(_0x13392e[_0xfb31('0x18')]==='Dynamics365')_0x569fec[_0xfb31('0x19')](_0x13392e['data7']+_0xfb31('0x1a'));return _0x569fec[_0xfb31('0x1b')]('\x20');}function getAccessTokenScope(_0x36c730){if(_0x36c730[_0xfb31('0x18')]===_0xfb31('0x1c'))return _0xfb31('0x12');if(_0x36c730[_0xfb31('0x18')]===_0xfb31('0x1d'))return _0x36c730[_0xfb31('0x1e')]+'/.default';}function generateMicrosoftAuthorizationUrl(_0x36b72b,_0x5673ac){var _0x10634f=MICROSOFT_AUTH_URL[_0xfb31('0x1f')](_0xfb31('0x20'),_0x36b72b[_0xfb31('0x21')]);var _0x28c9cd=[_0xfb31('0x22'),_0xfb31('0x23')];var _0x5128d8=Buffer['from'](JSON[_0xfb31('0x24')]({'id':_0x5673ac}))[_0xfb31('0x25')](_0xfb31('0x26'));var _0x3a70f9=crypto[_0xfb31('0x27')](0x10)[_0xfb31('0x25')](_0xfb31('0x28'));var _0x27361b=getAuthorizationScopes(_0x36b72b);var _0x39e7c4=[{'key':'client_id','value':_0x36b72b[_0xfb31('0x29')]},{'key':_0xfb31('0x2a'),'value':encodeURIComponent(_0x28c9cd['join']('\x20'))},{'key':_0xfb31('0x2b'),'value':_0x36b72b[_0xfb31('0x2c')]},{'key':_0xfb31('0x2d'),'value':_0xfb31('0x2e')},{'key':_0xfb31('0x2f'),'value':encodeURIComponent(_0x27361b)},{'key':_0xfb31('0x30'),'value':_0x5128d8},{'key':_0xfb31('0x31'),'value':_0x3a70f9},{'key':_0xfb31('0x32'),'value':_0xfb31('0x33')}];var _0x163d17=_0x10634f+MICROSOFT_AUTH_ENDPOINT+'?'+_[_0xfb31('0x17')](_0x39e7c4,function(_0x4c086e){return _0x4c086e[_0xfb31('0x34')]+'='+_0x4c086e['value'];})[_0xfb31('0x1b')]('&');_0x36b72b[_0xfb31('0x35')]={'issuer':_0x10634f[_0xfb31('0x1f')](_0xfb31('0x36'),''),'audience':_0x36b72b['data1'],'state':_0x5128d8,'nonce':_0x3a70f9};redis['set'](_0x5128d8,JSON[_0xfb31('0x24')](_0x36b72b));return _0x163d17;}function isValidIdToken(_0x459902,_0x263003){try{var _0x575bd3=jwt[_0xfb31('0x37')](_0x459902,{'complete':!![]});var _0x38767e=_0x575bd3[_0xfb31('0x38')];if(_0x38767e[_0xfb31('0x39')]!==_0x263003['issuer'])return![];if(_0x38767e[_0xfb31('0x3a')]!==_0x263003[_0xfb31('0x3b')])return![];if(_0x38767e[_0xfb31('0x31')]!==_0x263003['nonce'])return![];if(moment()[_0xfb31('0x3c')](moment[_0xfb31('0x3d')](_0x38767e['exp'])))return![];return!![];}catch(_0x3f290c){throw _0x3f290c;}}function refreshOauth2MicrosoftAccessToken(_0x4b6a15){return Promise[_0xfb31('0x3e')]()[_0xfb31('0x3f')](function(){if(_0x4b6a15['data3'])return _0x4b6a15;return db[_0xfb31('0x40')][_0xfb31('0x41')]({'where':{'id':_0x4b6a15['id']},'raw':!![]});})[_0xfb31('0x3f')](function(_0x18d06d){var _0x2641bb={'grant_type':_0xfb31('0x42'),'refresh_token':_0x18d06d[_0xfb31('0x43')],'scope':getAccessTokenScope(_0x18d06d),'redirect_uri':_0x18d06d[_0xfb31('0x2c')],'client_id':_0x18d06d[_0xfb31('0x29')],'client_secret':encryptor[_0xfb31('0x44')](_0x18d06d['data3'])};var _0x19ba88={'method':_0xfb31('0x45'),'uri':MICROSOFT_AUTH_URL[_0xfb31('0x1f')](_0xfb31('0x20'),_0x18d06d[_0xfb31('0x21')])+MICROSOFT_TOKEN_ENDPOINT,'form':_0x2641bb,'json':!![]};return rp(_0x19ba88);})['then'](function(_0x350ea3){_0x4b6a15[_0xfb31('0x46')]=_0x350ea3[_0xfb31('0x47')];_0x4b6a15['data6']=_0x350ea3['refresh_token'];return db[_0xfb31('0x40')]['update']({'data5':_0x4b6a15[_0xfb31('0x46')],'data6':_0x4b6a15[_0xfb31('0x43')]},{'where':{'id':_0x4b6a15['id']}});})[_0xfb31('0x3f')](function(){return _0x4b6a15;})[_0xfb31('0x48')](function(_0xfb4e94){logger[_0xfb31('0x49')]('Failed\x20to\x20refresh\x20access\x20token\x20for\x20cloud\x20provider\x20#%s,\x20-\x20err:%s',_0x4b6a15['id'],_0xfb4e94);});}function getOauth2MicrosoftAccessToken(_0x4270c9,_0x5d4828){var _0x2eccdd={'grant_type':_0xfb31('0x4a'),'code':_0x4270c9,'scope':getAccessTokenScope(_0x5d4828),'redirect_uri':_0x5d4828[_0xfb31('0x2c')],'client_id':_0x5d4828[_0xfb31('0x29')],'client_secret':encryptor['decryptString'](_0x5d4828['data3'])};var _0x761657={'method':_0xfb31('0x45'),'uri':MICROSOFT_AUTH_URL[_0xfb31('0x1f')]('{TENANT_ID}',_0x5d4828[_0xfb31('0x21')])+MICROSOFT_TOKEN_ENDPOINT,'form':_0x2eccdd,'json':!![]};return rp(_0x761657);}function startRefreshInterval(_0x4c38b2){var _0x4faac6=schedule['intervals'];if(_0x4faac6[_0x4c38b2['id']])clearInterval(_0x4faac6[_0x4c38b2['id']]);_0x4faac6[_0x4c38b2['id']]=setInterval(refreshOauth2MicrosoftAccessToken[_0xfb31('0x4b')](this,{'id':_0x4c38b2['id']}),OAUTH_REFRESH_INTERVAL*0x3e8);schedule[_0xfb31('0x4c')]=_0x4faac6;}function startAllRefreshIntervals(){return db['CloudProvider'][_0xfb31('0x4d')]({'where':{'data6':{'$ne':null}},'raw':!![]})['then'](function(_0x46b4f9){var _0x37fba4=_0x46b4f9['map'](function(_0x47d533){return refreshOauth2MicrosoftAccessToken(_0x47d533)[_0xfb31('0x3f')](function(_0x42f9d5){startRefreshInterval(_0x42f9d5);});});return Promise[_0xfb31('0x4e')](_0x37fba4);})[_0xfb31('0x48')](function(_0x2ab622){var _0x58b175=_0x2ab622?util[_0xfb31('0x4f')](_0x2ab622,{'showHidden':![],'depth':null}):'';logger['error'](_0xfb31('0x50'),_0x58b175);});}module['exports']={'generateMicrosoftAuthorizationUrl':generateMicrosoftAuthorizationUrl,'getOauth2MicrosoftAccessToken':getOauth2MicrosoftAccessToken,'isValidIdToken':isValidIdToken,'startAllRefreshIntervals':startAllRefreshIntervals,'refreshOauth2MicrosoftAccessToken':refreshOauth2MicrosoftAccessToken,'startRefreshInterval':startRefreshInterval}; \ No newline at end of file +var _0x4808=['code','id_token','from','stringify','toString','base64','hex','client_id','data1','response_type','join','redirect_uri','data4','response_mode','state','nonce','prompt','login','value','oauth2Claims','oauth2/','decode','payload','iss','issuer','aud','audience','isAfter','unix','exp','resolve','data3','CloudProvider','findOne','then','refresh_token','data6','POST','data5','access_token','update','catch','error','Failed\x20to\x20refresh\x20access\x20token\x20for\x20cloud\x20provider\x20#%s,\x20-\x20err:%s','decryptString','intervals','bind','all','inspect','[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','../../config/schedule/cloud-provider','redis','defaults','openid','profile','offline_access','https://outlook.office.com/POP.AccessAsUser.All','https://outlook.office.com/SMTP.Send','/authorize','map','type','Dynamics365','data7','/.default','replace','{TENANT_ID}','data2'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0x4808,0x167));var _0x8480=function(_0x1e7b16,_0x4607a1){_0x1e7b16=_0x1e7b16-0x0;var _0x37fadc=_0x4808[_0x1e7b16];return _0x37fadc;};'use strict';var _=require(_0x8480('0x0'));var crypto=require(_0x8480('0x1'));var jwt=require(_0x8480('0x2'));var moment=require(_0x8480('0x3'));var Redis=require(_0x8480('0x4'));var rp=require(_0x8480('0x5'));var util=require('util');var encryptor=require(_0x8480('0x6'));var config=require(_0x8480('0x7'));var logger=require(_0x8480('0x8'))('api');var schedule=require(_0x8480('0x9'));var db=require('../../mysqldb')['db'];config[_0x8480('0xa')]=_[_0x8480('0xb')](config['redis'],{'host':'localhost','port':0x18eb});var redis=new Redis(config[_0x8480('0xa')]);var MICROSOFT_AUTH_URL='https://login.microsoftonline.com/{TENANT_ID}/oauth2/v2.0';var AZURE_AUTH_SCOPES={'Outlook365':[_0x8480('0xc'),_0x8480('0xd'),'email',_0x8480('0xe'),'https://outlook.office365.com/IMAP.AccessAsUser.All',_0x8480('0xf'),_0x8480('0x10')],'Dynamics365':[_0x8480('0xc'),_0x8480('0xe')]};var MICROSOFT_AUTH_ENDPOINT=_0x8480('0x11');var MICROSOFT_TOKEN_ENDPOINT='/token';var OAUTH_REFRESH_INTERVAL=0xfa;function getAuthorizationScopes(_0x483962){var _0x3fe24e=_[_0x8480('0x12')](AZURE_AUTH_SCOPES[_0x483962[_0x8480('0x13')]]);if(_0x483962[_0x8480('0x13')]===_0x8480('0x14'))_0x3fe24e['push'](_0x483962[_0x8480('0x15')]+_0x8480('0x16'));return _0x3fe24e['join']('\x20');}function getAccessTokenScope(_0x27c88e){if(_0x27c88e['type']==='Outlook365')return'https://outlook.office365.com/IMAP.AccessAsUser.All';if(_0x27c88e[_0x8480('0x13')]===_0x8480('0x14'))return _0x27c88e[_0x8480('0x15')]+_0x8480('0x16');}function generateMicrosoftAuthorizationUrl(_0x5790d3,_0x555bdd){var _0x1e8bbb=MICROSOFT_AUTH_URL[_0x8480('0x17')](_0x8480('0x18'),_0x5790d3[_0x8480('0x19')]);var _0x1a4dc3=[_0x8480('0x1a'),_0x8480('0x1b')];var _0x3a75b4=Buffer[_0x8480('0x1c')](JSON[_0x8480('0x1d')]({'id':_0x555bdd}))[_0x8480('0x1e')](_0x8480('0x1f'));var _0x44576a=crypto['randomBytes'](0x10)['toString'](_0x8480('0x20'));var _0xcc572c=getAuthorizationScopes(_0x5790d3);var _0x2b868a=[{'key':_0x8480('0x21'),'value':_0x5790d3[_0x8480('0x22')]},{'key':_0x8480('0x23'),'value':encodeURIComponent(_0x1a4dc3[_0x8480('0x24')]('\x20'))},{'key':_0x8480('0x25'),'value':_0x5790d3[_0x8480('0x26')]},{'key':_0x8480('0x27'),'value':'form_post'},{'key':'scope','value':encodeURIComponent(_0xcc572c)},{'key':_0x8480('0x28'),'value':_0x3a75b4},{'key':_0x8480('0x29'),'value':_0x44576a},{'key':_0x8480('0x2a'),'value':_0x8480('0x2b')}];var _0x2b14ad=_0x1e8bbb+MICROSOFT_AUTH_ENDPOINT+'?'+_[_0x8480('0x12')](_0x2b868a,function(_0x14697a){return _0x14697a['key']+'='+_0x14697a[_0x8480('0x2c')];})[_0x8480('0x24')]('&');_0x5790d3[_0x8480('0x2d')]={'issuer':_0x1e8bbb[_0x8480('0x17')](_0x8480('0x2e'),''),'audience':_0x5790d3['data1'],'state':_0x3a75b4,'nonce':_0x44576a};redis['set'](_0x3a75b4,JSON[_0x8480('0x1d')](_0x5790d3));return _0x2b14ad;}function isValidIdToken(_0x3738c1,_0x151822){try{var _0x5d9015=jwt[_0x8480('0x2f')](_0x3738c1,{'complete':!![]});var _0x54365e=_0x5d9015[_0x8480('0x30')];if(_0x54365e[_0x8480('0x31')]!==_0x151822[_0x8480('0x32')])return![];if(_0x54365e[_0x8480('0x33')]!==_0x151822[_0x8480('0x34')])return![];if(_0x54365e['nonce']!==_0x151822[_0x8480('0x29')])return![];if(moment()[_0x8480('0x35')](moment[_0x8480('0x36')](_0x54365e[_0x8480('0x37')])))return![];return!![];}catch(_0x36a045){throw _0x36a045;}}function refreshOauth2MicrosoftAccessToken(_0x1163f0){return Promise[_0x8480('0x38')]()['then'](function(){if(_0x1163f0[_0x8480('0x39')])return _0x1163f0;return db[_0x8480('0x3a')][_0x8480('0x3b')]({'where':{'id':_0x1163f0['id']},'raw':!![]});})[_0x8480('0x3c')](function(_0x55a36c){var _0x1f6ec0={'grant_type':_0x8480('0x3d'),'refresh_token':_0x55a36c[_0x8480('0x3e')],'scope':getAccessTokenScope(_0x55a36c),'redirect_uri':_0x55a36c['data4'],'client_id':_0x55a36c[_0x8480('0x22')],'client_secret':encryptor['decryptString'](_0x55a36c[_0x8480('0x39')])};var _0x3d1101={'method':_0x8480('0x3f'),'uri':MICROSOFT_AUTH_URL[_0x8480('0x17')](_0x8480('0x18'),_0x55a36c[_0x8480('0x19')])+MICROSOFT_TOKEN_ENDPOINT,'form':_0x1f6ec0,'json':!![]};return rp(_0x3d1101);})['then'](function(_0x4961b2){_0x1163f0[_0x8480('0x40')]=_0x4961b2[_0x8480('0x41')];_0x1163f0[_0x8480('0x3e')]=_0x4961b2[_0x8480('0x3d')];return db[_0x8480('0x3a')][_0x8480('0x42')]({'data5':_0x1163f0[_0x8480('0x40')],'data6':_0x1163f0[_0x8480('0x3e')]},{'where':{'id':_0x1163f0['id']}});})[_0x8480('0x3c')](function(){return _0x1163f0;})[_0x8480('0x43')](function(_0x44ad3b){logger[_0x8480('0x44')](_0x8480('0x45'),_0x1163f0['id'],_0x44ad3b);});}function getOauth2MicrosoftAccessToken(_0x48a91c,_0x414a54){var _0xedd72d={'grant_type':'authorization_code','code':_0x48a91c,'scope':getAccessTokenScope(_0x414a54),'redirect_uri':_0x414a54[_0x8480('0x26')],'client_id':_0x414a54['data1'],'client_secret':encryptor[_0x8480('0x46')](_0x414a54[_0x8480('0x39')])};var _0x1673c4={'method':_0x8480('0x3f'),'uri':MICROSOFT_AUTH_URL['replace'](_0x8480('0x18'),_0x414a54[_0x8480('0x19')])+MICROSOFT_TOKEN_ENDPOINT,'form':_0xedd72d,'json':!![]};return rp(_0x1673c4);}function startRefreshInterval(_0x53efc3){var _0x2b14c7=schedule[_0x8480('0x47')];if(_0x2b14c7[_0x53efc3['id']])clearInterval(_0x2b14c7[_0x53efc3['id']]);_0x2b14c7[_0x53efc3['id']]=setInterval(refreshOauth2MicrosoftAccessToken[_0x8480('0x48')](this,{'id':_0x53efc3['id']}),OAUTH_REFRESH_INTERVAL*0x3e8);schedule[_0x8480('0x47')]=_0x2b14c7;}function startAllRefreshIntervals(){return db[_0x8480('0x3a')]['findAll']({'where':{'data6':{'$ne':null}},'raw':!![]})[_0x8480('0x3c')](function(_0x37ad92){var _0x50ef45=_0x37ad92[_0x8480('0x12')](function(_0x9e9286){return refreshOauth2MicrosoftAccessToken(_0x9e9286)['then'](function(_0x392b9b){startRefreshInterval(_0x392b9b);});});return Promise[_0x8480('0x49')](_0x50ef45);})['catch'](function(_0xa196f4){var _0x298eb7=_0xa196f4?util[_0x8480('0x4a')](_0xa196f4,{'showHidden':![],'depth':null}):'';logger[_0x8480('0x44')](_0x8480('0x4b'),_0x298eb7);});}module[_0x8480('0x4c')]={'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 59f7d84..77da47f 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 _0x2fc9=['stringify','error','message','info','result','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','request','then','CloudProvider,\x20%s,\x20%s','request\x20sent','debug'];(function(_0x3634cf,_0x351d9d){var _0x4d454e=function(_0x51bda7){while(--_0x51bda7){_0x3634cf['push'](_0x3634cf['shift']());}};_0x4d454e(++_0x351d9d);}(_0x2fc9,0xc2));var _0x92fc=function(_0x29d94e,_0xf386d6){_0x29d94e=_0x29d94e-0x0;var _0x106237=_0x2fc9[_0x29d94e];return _0x106237;};'use strict';var _=require('lodash');var util=require(_0x92fc('0x0'));var moment=require(_0x92fc('0x1'));var BPromise=require(_0x92fc('0x2'));var rs=require(_0x92fc('0x3'));var fs=require('fs');var Redis=require(_0x92fc('0x4'));var db=require(_0x92fc('0x5'))['db'];var utils=require(_0x92fc('0x6'));var logger=require(_0x92fc('0x7'))(_0x92fc('0x8'));var config=require(_0x92fc('0x9'));var jayson=require(_0x92fc('0xa'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x5c79a5,_0x340518,_0x13787c){return new BPromise(function(_0xa640a5,_0x3b656e){return client[_0x92fc('0xb')](_0x5c79a5,_0x13787c)[_0x92fc('0xc')](function(_0x2805f4){logger['info'](_0x92fc('0xd'),_0x340518,_0x92fc('0xe'));logger[_0x92fc('0xf')]('CloudProvider,\x20%s,\x20%s,\x20%s',_0x340518,_0x92fc('0xe'),JSON[_0x92fc('0x10')](_0x2805f4));if(_0x2805f4[_0x92fc('0x11')]){if(_0x2805f4['error']['code']===0x1f4){logger[_0x92fc('0x11')](_0x92fc('0xd'),_0x340518,_0x2805f4['error'][_0x92fc('0x12')]);return _0x3b656e(_0x2805f4[_0x92fc('0x11')][_0x92fc('0x12')]);}logger[_0x92fc('0x11')](_0x92fc('0xd'),_0x340518,_0x2805f4['error'][_0x92fc('0x12')]);return _0xa640a5(_0x2805f4[_0x92fc('0x11')][_0x92fc('0x12')]);}else{logger[_0x92fc('0x13')]('CloudProvider,\x20%s,\x20%s',_0x340518,'request\x20sent');_0xa640a5(_0x2805f4[_0x92fc('0x14')][_0x92fc('0x12')]);}})['catch'](function(_0x3370c9){logger[_0x92fc('0x11')](_0x92fc('0xd'),_0x340518,_0x3370c9);_0x3b656e(_0x3370c9);});});} \ No newline at end of file +var _0x8212=['message','result','catch','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','request','then','info','CloudProvider,\x20%s,\x20%s','request\x20sent','debug','stringify','error'];(function(_0x576f72,_0x3779e7){var _0x29878d=function(_0x36d076){while(--_0x36d076){_0x576f72['push'](_0x576f72['shift']());}};_0x29878d(++_0x3779e7);}(_0x8212,0xb3));var _0x2821=function(_0x509a17,_0x497b29){_0x509a17=_0x509a17-0x0;var _0x2e4919=_0x8212[_0x509a17];return _0x2e4919;};'use strict';var _=require(_0x2821('0x0'));var util=require(_0x2821('0x1'));var moment=require('moment');var BPromise=require(_0x2821('0x2'));var rs=require(_0x2821('0x3'));var fs=require('fs');var Redis=require(_0x2821('0x4'));var db=require(_0x2821('0x5'))['db'];var utils=require(_0x2821('0x6'));var logger=require(_0x2821('0x7'))(_0x2821('0x8'));var config=require(_0x2821('0x9'));var jayson=require('jayson/promise');var client=jayson[_0x2821('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x376c57,_0x1dc078,_0x4ea6d5){return new BPromise(function(_0x3644aa,_0x201069){return client[_0x2821('0xb')](_0x376c57,_0x4ea6d5)[_0x2821('0xc')](function(_0x16003f){logger[_0x2821('0xd')](_0x2821('0xe'),_0x1dc078,_0x2821('0xf'));logger[_0x2821('0x10')]('CloudProvider,\x20%s,\x20%s,\x20%s',_0x1dc078,_0x2821('0xf'),JSON[_0x2821('0x11')](_0x16003f));if(_0x16003f[_0x2821('0x12')]){if(_0x16003f['error']['code']===0x1f4){logger['error']('CloudProvider,\x20%s,\x20%s',_0x1dc078,_0x16003f[_0x2821('0x12')][_0x2821('0x13')]);return _0x201069(_0x16003f[_0x2821('0x12')][_0x2821('0x13')]);}logger[_0x2821('0x12')](_0x2821('0xe'),_0x1dc078,_0x16003f['error'][_0x2821('0x13')]);return _0x3644aa(_0x16003f['error']['message']);}else{logger[_0x2821('0xd')](_0x2821('0xe'),_0x1dc078,_0x2821('0xf'));_0x3644aa(_0x16003f[_0x2821('0x14')]['message']);}})[_0x2821('0x15')](function(_0x5c2aa7){logger[_0x2821('0x12')](_0x2821('0xe'),_0x1dc078,_0x5c2aa7);_0x201069(_0x5c2aa7);});});} \ No newline at end of file diff --git a/server/api/cloudProvider/index.js b/server/api/cloudProvider/index.js index bad0cd0..7f684ca 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(_0x5933fb,_0x9115ad){var _0x44d988=function(_0x295228){while(--_0x295228){_0x5933fb['push'](_0x5933fb['shift']());}};_0x44d988(++_0x9115ad);}(_0x1261,0x144));var _0x1126=function(_0x4ede04,_0x58132b){_0x4ede04=_0x4ede04-0x0;var _0x49ccfc=_0x1261[_0x4ede04];return _0x49ccfc;};'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 _0x5f66=['index','post','/:id','update','delete','/:id/oauth2/microsoft/authorize/','oauth2MicrosoftAuthorize','oauth2MicrosoftCallback','Router','./cloudProvider.controller','get','isAuthenticated'];(function(_0x369a13,_0x5ade8d){var _0x2786b7=function(_0x365f0f){while(--_0x365f0f){_0x369a13['push'](_0x369a13['shift']());}};_0x2786b7(++_0x5ade8d);}(_0x5f66,0x1a0));var _0x65f6=function(_0x278e3c,_0x1c9cfd){_0x278e3c=_0x278e3c-0x0;var _0x3e2d9b=_0x5f66[_0x278e3c];return _0x3e2d9b;};'use strict';var express=require('express');var router=express[_0x65f6('0x0')]();var auth=require('../../components/auth/service');var controller=require(_0x65f6('0x1'));router[_0x65f6('0x2')]('/',auth[_0x65f6('0x3')](),controller[_0x65f6('0x4')]);router[_0x65f6('0x2')]('/:id',auth[_0x65f6('0x3')](),controller['show']);router[_0x65f6('0x5')]('/',auth[_0x65f6('0x3')](),controller['create']);router['put'](_0x65f6('0x6'),auth[_0x65f6('0x3')](),controller[_0x65f6('0x7')]);router[_0x65f6('0x8')](_0x65f6('0x6'),auth[_0x65f6('0x3')](),controller['destroy']);router['get'](_0x65f6('0x9'),auth[_0x65f6('0x3')](),controller[_0x65f6('0xa')]);router[_0x65f6('0x5')]('/oauth2/microsoft/callback',controller[_0x65f6('0xb')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/cmCompany/cmCompany.attributes.js b/server/api/cmCompany/cmCompany.attributes.js index 118dafc..b5ad4ef 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 _0x6f1d=['STRING','name','exports'];(function(_0x3e5c78,_0x5a56f8){var _0x46a3dc=function(_0x2eaab9){while(--_0x2eaab9){_0x3e5c78['push'](_0x3e5c78['shift']());}};_0x46a3dc(++_0x5a56f8);}(_0x6f1d,0x1b2));var _0xd6f1=function(_0x3af9e8,_0x13f64f){_0x3af9e8=_0x3af9e8-0x0;var _0x10e3ef=_0x6f1d[_0x3af9e8];return _0x10e3ef;};'use strict';var Sequelize=require('sequelize');module[_0xd6f1('0x0')]={'name':{'type':Sequelize[_0xd6f1('0x1')],'unique':_0xd6f1('0x2'),'allowNull':![],'validate':{'notEmpty':!![]}},'vat':{'type':Sequelize[_0xd6f1('0x1')]},'companyId':{'type':Sequelize[_0xd6f1('0x1')]},'website':{'type':Sequelize[_0xd6f1('0x1')]},'phone':{'type':Sequelize[_0xd6f1('0x1')]},'fax':{'type':Sequelize['STRING']},'type':{'type':Sequelize[_0xd6f1('0x1')]},'street':{'type':Sequelize[_0xd6f1('0x1')]},'postalCode':{'type':Sequelize[_0xd6f1('0x1')]},'city':{'type':Sequelize[_0xd6f1('0x1')]},'country':{'type':Sequelize[_0xd6f1('0x1')]},'email':{'type':Sequelize[_0xd6f1('0x1')],'validate':{'isEmail':!![]}},'emailDomain':{'type':Sequelize[_0xd6f1('0x1')]},'sStreet':{'type':Sequelize[_0xd6f1('0x1')]},'sPostalCode':{'type':Sequelize[_0xd6f1('0x1')]},'sCity':{'type':Sequelize[_0xd6f1('0x1')]},'sCountry':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0xd6f1('0x1')]}}; \ No newline at end of file +var _0xbece=['sequelize','exports','STRING','name'];(function(_0x5948bf,_0xa1cbab){var _0x1c5b91=function(_0x13e99a){while(--_0x13e99a){_0x5948bf['push'](_0x5948bf['shift']());}};_0x1c5b91(++_0xa1cbab);}(_0xbece,0x148));var _0xebec=function(_0x40a045,_0x516f0e){_0x40a045=_0x40a045-0x0;var _0x1a687c=_0xbece[_0x40a045];return _0x1a687c;};'use strict';var Sequelize=require(_0xebec('0x0'));module[_0xebec('0x1')]={'name':{'type':Sequelize[_0xebec('0x2')],'unique':_0xebec('0x3'),'allowNull':![],'validate':{'notEmpty':!![]}},'vat':{'type':Sequelize[_0xebec('0x2')]},'companyId':{'type':Sequelize[_0xebec('0x2')]},'website':{'type':Sequelize[_0xebec('0x2')]},'phone':{'type':Sequelize['STRING']},'fax':{'type':Sequelize[_0xebec('0x2')]},'type':{'type':Sequelize[_0xebec('0x2')]},'street':{'type':Sequelize[_0xebec('0x2')]},'postalCode':{'type':Sequelize[_0xebec('0x2')]},'city':{'type':Sequelize[_0xebec('0x2')]},'country':{'type':Sequelize[_0xebec('0x2')]},'email':{'type':Sequelize[_0xebec('0x2')],'validate':{'isEmail':!![]}},'emailDomain':{'type':Sequelize[_0xebec('0x2')]},'sStreet':{'type':Sequelize['STRING']},'sPostalCode':{'type':Sequelize['STRING']},'sCity':{'type':Sequelize[_0xebec('0x2')]},'sCountry':{'type':Sequelize[_0xebec('0x2')]},'description':{'type':Sequelize[_0xebec('0x2')]}}; \ No newline at end of file diff --git a/server/api/cmCompany/cmCompany.controller.js b/server/api/cmCompany/cmCompany.controller.js index b20dcf1..8d84ae2 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 _0x07f2=['undefined','limit','count','Content-Range','apply','reject','save','update','then','destroy','Companies','end','sendStatus','error','stack','name','send','index','CmCompany','describe','model','query','filters','intersection','attributes','fields','length','hasOwnProperty','order','sort','where','pick','filter','merge','map','include','findAll','rows','catch','show','params','rawAttributes','includeAll','options','create','body','user','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','find','userProfileId','autoAssociation','UserProfileResource','addContacts','CmContact','ids','omit','getContacts','keys','nolimit','eml-format','fast-json-patch','request-promise','moment','bluebird','util','path','sox','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','status','json','offset'];(function(_0x2289b5,_0x334692){var _0x402acd=function(_0xb59519){while(--_0xb59519){_0x2289b5['push'](_0x2289b5['shift']());}};_0x402acd(++_0x334692);}(_0x07f2,0xf6));var _0x207f=function(_0x490203,_0x3802b0){_0x490203=_0x490203-0x0;var _0x389396=_0x07f2[_0x490203];return _0x389396;};'use strict';var emlformat=require(_0x207f('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0x207f('0x1'));var rp=require(_0x207f('0x2'));var moment=require(_0x207f('0x3'));var BPromise=require(_0x207f('0x4'));var Mustache=require('mustache');var util=require(_0x207f('0x5'));var path=require(_0x207f('0x6'));var sox=require(_0x207f('0x7'));var csv=require('to-csv');var ejs=require(_0x207f('0x8'));var fs=require('fs');var fs_extra=require(_0x207f('0x9'));var _=require(_0x207f('0xa'));var squel=require(_0x207f('0xb'));var crypto=require(_0x207f('0xc'));var jsforce=require(_0x207f('0xd'));var deskjs=require(_0x207f('0xe'));var toCsv=require(_0x207f('0xf'));var querystring=require(_0x207f('0x10'));var Papa=require(_0x207f('0x11'));var Redis=require(_0x207f('0x12'));var authService=require('../../components/auth/service');var qs=require(_0x207f('0x13'));var as=require(_0x207f('0x14'));var hardwareService=require(_0x207f('0x15'));var logger=require('../../config/logger')(_0x207f('0x16'));var utils=require(_0x207f('0x17'));var config=require(_0x207f('0x18'));var licenseUtil=require(_0x207f('0x19'));var db=require(_0x207f('0x1a'))['db'];function respondWithStatusCode(_0x417e9a,_0x277da0){_0x277da0=_0x277da0||0xcc;return function(_0x102536){if(_0x102536){return _0x417e9a['sendStatus'](_0x277da0);}return _0x417e9a[_0x207f('0x1b')](_0x277da0)['end']();};}function respondWithResult(_0x12d340,_0x46068d){_0x46068d=_0x46068d||0xc8;return function(_0x496a24){if(_0x496a24){return _0x12d340[_0x207f('0x1b')](_0x46068d)[_0x207f('0x1c')](_0x496a24);}};}function respondWithFilteredResult(_0x3a71e2,_0x3651d4){return function(_0x413b95){if(_0x413b95){var _0x407a42=typeof _0x3651d4[_0x207f('0x1d')]===_0x207f('0x1e')&&typeof _0x3651d4[_0x207f('0x1f')]===_0x207f('0x1e');var _0x33ae51=_0x413b95[_0x207f('0x20')];var _0x2c501b=_0x407a42?0x0:_0x3651d4[_0x207f('0x1d')];var _0x14a4a7=_0x407a42?_0x413b95[_0x207f('0x20')]:_0x3651d4[_0x207f('0x1d')]+_0x3651d4[_0x207f('0x1f')];var _0x4cd195;if(_0x14a4a7>=_0x33ae51){_0x14a4a7=_0x33ae51;_0x4cd195=0xc8;}else{_0x4cd195=0xce;}_0x3a71e2[_0x207f('0x1b')](_0x4cd195);return _0x3a71e2['set'](_0x207f('0x21'),_0x2c501b+'-'+_0x14a4a7+'/'+_0x33ae51)[_0x207f('0x1c')](_0x413b95);}return null;};}function patchUpdates(_0x1f2f38){return function(_0x6b0bce){try{jsonpatch[_0x207f('0x22')](_0x6b0bce,_0x1f2f38,!![]);}catch(_0x33e586){return BPromise[_0x207f('0x23')](_0x33e586);}return _0x6b0bce[_0x207f('0x24')]();};}function saveUpdates(_0x3f470e,_0x11ce37){return function(_0x231208){if(_0x231208){return _0x231208[_0x207f('0x25')](_0x3f470e)[_0x207f('0x26')](function(_0x5eee6f){return _0x5eee6f;});}return null;};}function removeEntity(_0x342058,_0x374f6a){return function(_0x250dc2){if(_0x250dc2){return _0x250dc2[_0x207f('0x27')]()[_0x207f('0x26')](function(){var _0x38e32e=_0x250dc2['get']({'plain':!![]});var _0x5379bb=_0x207f('0x28');return db['UserProfileResource'][_0x207f('0x27')]({'where':{'type':_0x5379bb,'resourceId':_0x38e32e['id']}})[_0x207f('0x26')](function(){return _0x250dc2;});})['then'](function(){_0x342058[_0x207f('0x1b')](0xcc)[_0x207f('0x29')]();});}};}function handleEntityNotFound(_0x1bd16e,_0x324103){return function(_0x248f64){if(!_0x248f64){_0x1bd16e[_0x207f('0x2a')](0x194);}return _0x248f64;};}function handleError(_0x1766f7,_0x19b0d6){_0x19b0d6=_0x19b0d6||0x1f4;return function(_0x57bfd8){logger[_0x207f('0x2b')](_0x57bfd8[_0x207f('0x2c')]);if(_0x57bfd8[_0x207f('0x2d')]){delete _0x57bfd8['name'];}_0x1766f7['status'](_0x19b0d6)[_0x207f('0x2e')](_0x57bfd8);};}exports[_0x207f('0x2f')]=function(_0x32e16,_0xe50398){var _0x173c4e={},_0x2badb4={},_0x1b5eaa={'count':0x0,'rows':[]};return db[_0x207f('0x30')][_0x207f('0x31')]()[_0x207f('0x26')](function(_0x122c4d){_0x2badb4[_0x207f('0x32')]=_['keys'](_0x122c4d);_0x2badb4[_0x207f('0x33')]=_['keys'](_0x32e16[_0x207f('0x33')]);_0x2badb4[_0x207f('0x34')]=_[_0x207f('0x35')](_0x2badb4[_0x207f('0x32')],_0x2badb4[_0x207f('0x33')]);_0x173c4e[_0x207f('0x36')]=_['intersection'](_0x2badb4['model'],qs[_0x207f('0x37')](_0x32e16[_0x207f('0x33')][_0x207f('0x37')]));_0x173c4e[_0x207f('0x36')]=_0x173c4e[_0x207f('0x36')][_0x207f('0x38')]?_0x173c4e['attributes']:_0x2badb4[_0x207f('0x32')];if(!_0x32e16[_0x207f('0x33')][_0x207f('0x39')]('nolimit')){_0x173c4e['limit']=qs[_0x207f('0x1f')](_0x32e16[_0x207f('0x33')][_0x207f('0x1f')]);_0x173c4e[_0x207f('0x1d')]=qs['offset'](_0x32e16['query'][_0x207f('0x1d')]);}_0x173c4e[_0x207f('0x3a')]=qs[_0x207f('0x3b')](_0x32e16['query'][_0x207f('0x3b')]);_0x173c4e[_0x207f('0x3c')]=qs[_0x207f('0x34')](_[_0x207f('0x3d')](_0x32e16[_0x207f('0x33')],_0x2badb4[_0x207f('0x34')]),_0x122c4d);if(_0x32e16[_0x207f('0x33')][_0x207f('0x3e')]){_0x173c4e[_0x207f('0x3c')]=_[_0x207f('0x3f')](_0x173c4e[_0x207f('0x3c')],{'$or':_[_0x207f('0x40')](_0x173c4e[_0x207f('0x36')],function(_0x30a2d4){var _0x5b6532={};_0x5b6532[_0x30a2d4]={'$like':'%'+_0x32e16[_0x207f('0x33')][_0x207f('0x3e')]+'%'};return _0x5b6532;})});}_0x173c4e=_['merge']({},_0x173c4e,_0x32e16['options']);var _0x339f11={'where':_0x173c4e[_0x207f('0x3c')]};return db[_0x207f('0x30')][_0x207f('0x20')](_0x339f11)['then'](function(_0x16fe22){_0x1b5eaa[_0x207f('0x20')]=_0x16fe22;if(_0x32e16['query']['includeAll']){_0x173c4e[_0x207f('0x41')]=[{'all':!![]}];}return db[_0x207f('0x30')][_0x207f('0x42')](_0x173c4e);})[_0x207f('0x26')](function(_0x5744be){_0x1b5eaa[_0x207f('0x43')]=_0x5744be;return _0x1b5eaa;})['then'](respondWithFilteredResult(_0xe50398,_0x173c4e))['catch'](handleError(_0xe50398,null));})[_0x207f('0x44')](handleError(_0xe50398,null));};exports[_0x207f('0x45')]=function(_0x2fab82,_0x1b45a4){var _0x15d63a={'raw':![],'where':{'id':_0x2fab82[_0x207f('0x46')]['id']}},_0x98ce1e={};_0x98ce1e[_0x207f('0x32')]=_['keys'](db['CmCompany'][_0x207f('0x47')]);_0x98ce1e[_0x207f('0x33')]=_['keys'](_0x2fab82[_0x207f('0x33')]);_0x98ce1e['filters']=_[_0x207f('0x35')](_0x98ce1e[_0x207f('0x32')],_0x98ce1e[_0x207f('0x33')]);_0x15d63a[_0x207f('0x36')]=_['intersection'](_0x98ce1e['model'],qs[_0x207f('0x37')](_0x2fab82['query'][_0x207f('0x37')]));_0x15d63a[_0x207f('0x36')]=_0x15d63a[_0x207f('0x36')]['length']?_0x15d63a['attributes']:_0x98ce1e[_0x207f('0x32')];if(_0x2fab82[_0x207f('0x33')][_0x207f('0x48')]){_0x15d63a['include']=[{'all':!![]}];}_0x15d63a=_[_0x207f('0x3f')]({},_0x15d63a,_0x2fab82[_0x207f('0x49')]);return db[_0x207f('0x30')]['find'](_0x15d63a)[_0x207f('0x26')](handleEntityNotFound(_0x1b45a4,null))[_0x207f('0x26')](respondWithResult(_0x1b45a4,null))['catch'](handleError(_0x1b45a4,null));};exports[_0x207f('0x4a')]=function(_0x14f5f1,_0x3efae8){return db['CmCompany'][_0x207f('0x4a')](_0x14f5f1[_0x207f('0x4b')],{})[_0x207f('0x26')](function(_0x370d7c){var _0x59bce4=_0x14f5f1[_0x207f('0x4c')][_0x207f('0x4d')]({'plain':!![]});if(!_0x59bce4)throw new Error(_0x207f('0x4e'));if(_0x59bce4[_0x207f('0x4f')]==='user'){var _0x45f411=_0x370d7c[_0x207f('0x4d')]({'plain':!![]});var _0x473500=_0x207f('0x28');return db[_0x207f('0x50')][_0x207f('0x51')]({'where':{'name':_0x473500,'userProfileId':_0x59bce4[_0x207f('0x52')]},'raw':!![]})[_0x207f('0x26')](function(_0x1d9f83){if(_0x1d9f83&&_0x1d9f83[_0x207f('0x53')]===0x0){return db[_0x207f('0x54')][_0x207f('0x4a')]({'name':_0x45f411[_0x207f('0x2d')],'resourceId':_0x45f411['id'],'type':_0x1d9f83[_0x207f('0x2d')],'sectionId':_0x1d9f83['id']},{})[_0x207f('0x26')](function(){return _0x370d7c;});}else{return _0x370d7c;}})[_0x207f('0x44')](function(_0x2c16f0){logger[_0x207f('0x2b')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x2c16f0);throw _0x2c16f0;});}return _0x370d7c;})[_0x207f('0x26')](respondWithResult(_0x3efae8,0xc9))[_0x207f('0x44')](handleError(_0x3efae8,null));};exports[_0x207f('0x25')]=function(_0x51f6a4,_0x33f98f){if(_0x51f6a4[_0x207f('0x4b')]['id']){delete _0x51f6a4[_0x207f('0x4b')]['id'];}return db[_0x207f('0x30')][_0x207f('0x51')]({'where':{'id':_0x51f6a4[_0x207f('0x46')]['id']}})['then'](handleEntityNotFound(_0x33f98f,null))[_0x207f('0x26')](saveUpdates(_0x51f6a4[_0x207f('0x4b')],null))[_0x207f('0x26')](respondWithResult(_0x33f98f,null))[_0x207f('0x44')](handleError(_0x33f98f,null));};exports[_0x207f('0x27')]=function(_0x5c3ed3,_0x142c13){return db[_0x207f('0x30')][_0x207f('0x51')]({'where':{'id':_0x5c3ed3[_0x207f('0x46')]['id']}})[_0x207f('0x26')](handleEntityNotFound(_0x142c13,null))[_0x207f('0x26')](removeEntity(_0x142c13,null))[_0x207f('0x44')](handleError(_0x142c13,null));};exports['describe']=function(_0xfee89e,_0x1b17ec){return db[_0x207f('0x30')][_0x207f('0x31')]()[_0x207f('0x26')](respondWithResult(_0x1b17ec,null))[_0x207f('0x44')](handleError(_0x1b17ec,null));};exports[_0x207f('0x55')]=function(_0x264223,_0x12cc9c,_0x39ae78){return db[_0x207f('0x56')]['find']({'where':{'id':_0x264223['params']['id']}})[_0x207f('0x26')](handleEntityNotFound(_0x12cc9c,null))[_0x207f('0x26')](function(_0x3168eb){if(_0x3168eb){return _0x3168eb['addContacts'](_0x264223[_0x207f('0x4b')][_0x207f('0x57')],_[_0x207f('0x58')](_0x264223['body'],[_0x207f('0x57'),'id'])||{});}})[_0x207f('0x26')](respondWithResult(_0x12cc9c,null))['catch'](handleError(_0x12cc9c,null));};exports[_0x207f('0x59')]=function(_0x1aa5f5,_0xbcade,_0x1c0a13){var _0x406fc8={};var _0x17580c={};var _0x28e53f;var _0x35a3df;return db[_0x207f('0x30')]['findOne']({'where':{'id':_0x1aa5f5[_0x207f('0x46')]['id']}})['then'](handleEntityNotFound(_0xbcade,null))[_0x207f('0x26')](function(_0x3f6750){if(_0x3f6750){_0x28e53f=_0x3f6750;_0x17580c['model']=_['keys'](db[_0x207f('0x56')][_0x207f('0x47')]);_0x17580c['query']=_[_0x207f('0x5a')](_0x1aa5f5[_0x207f('0x33')]);_0x17580c[_0x207f('0x34')]=_[_0x207f('0x35')](_0x17580c[_0x207f('0x32')],_0x17580c['query']);_0x406fc8[_0x207f('0x36')]=_[_0x207f('0x35')](_0x17580c['model'],qs['fields'](_0x1aa5f5[_0x207f('0x33')][_0x207f('0x37')]));_0x406fc8[_0x207f('0x36')]=_0x406fc8[_0x207f('0x36')][_0x207f('0x38')]?_0x406fc8[_0x207f('0x36')]:_0x17580c[_0x207f('0x32')];_0x406fc8['order']=qs[_0x207f('0x3b')](_0x1aa5f5[_0x207f('0x33')][_0x207f('0x3b')]);_0x406fc8['where']=qs[_0x207f('0x34')](_[_0x207f('0x3d')](_0x1aa5f5[_0x207f('0x33')],_0x17580c[_0x207f('0x34')]));if(_0x1aa5f5[_0x207f('0x33')][_0x207f('0x3e')]){_0x406fc8[_0x207f('0x3c')]=_[_0x207f('0x3f')](_0x406fc8[_0x207f('0x3c')],{'$or':_[_0x207f('0x40')](_0x406fc8[_0x207f('0x36')],function(_0x482425){var _0x2b9358={};_0x2b9358[_0x482425]={'$like':'%'+_0x1aa5f5['query'][_0x207f('0x3e')]+'%'};return _0x2b9358;})});}_0x406fc8=_['merge']({},_0x406fc8,_0x1aa5f5[_0x207f('0x49')]);return _0x28e53f[_0x207f('0x59')](_0x406fc8);}})['then'](function(_0x2456bf){if(_0x2456bf){_0x35a3df=_0x2456bf[_0x207f('0x38')];if(!_0x1aa5f5['query'][_0x207f('0x39')](_0x207f('0x5b'))){_0x406fc8[_0x207f('0x1f')]=qs['limit'](_0x1aa5f5[_0x207f('0x33')][_0x207f('0x1f')]);_0x406fc8[_0x207f('0x1d')]=qs[_0x207f('0x1d')](_0x1aa5f5[_0x207f('0x33')]['offset']);}return _0x28e53f[_0x207f('0x59')](_0x406fc8);}})[_0x207f('0x26')](function(_0x40109a){if(_0x40109a){return _0x40109a?{'count':_0x35a3df,'rows':_0x40109a}:null;}})['then'](respondWithResult(_0xbcade,null))[_0x207f('0x44')](handleError(_0xbcade,null));}; \ No newline at end of file +var _0x3ebd=['params','rawAttributes','includeAll','find','create','body','role','user','UserProfileSection','userProfileId','autoAssociation','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','destroy','addContacts','CmContact','ids','omit','getContacts','findOne','order','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','path','sox','to-csv','fs-extra','squel','crypto','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','end','json','undefined','limit','offset','count','set','Content-Range','apply','reject','save','then','get','Companies','UserProfileResource','status','stack','name','send','CmCompany','describe','model','keys','query','intersection','attributes','fields','length','hasOwnProperty','nolimit','sort','where','filters','pick','filter','merge','map','options','include','findAll','rows','catch','show'];(function(_0x200548,_0x4ea126){var _0x3c599a=function(_0x3f3b15){while(--_0x3f3b15){_0x200548['push'](_0x200548['shift']());}};_0x3c599a(++_0x4ea126);}(_0x3ebd,0x1cd));var _0xd3eb=function(_0x5a0171,_0x56f731){_0x5a0171=_0x5a0171-0x0;var _0x3f50ae=_0x3ebd[_0x5a0171];return _0x3f50ae;};'use strict';var emlformat=require(_0xd3eb('0x0'));var rimraf=require(_0xd3eb('0x1'));var zipdir=require(_0xd3eb('0x2'));var jsonpatch=require(_0xd3eb('0x3'));var rp=require(_0xd3eb('0x4'));var moment=require('moment');var BPromise=require(_0xd3eb('0x5'));var Mustache=require(_0xd3eb('0x6'));var util=require(_0xd3eb('0x7'));var path=require(_0xd3eb('0x8'));var sox=require(_0xd3eb('0x9'));var csv=require(_0xd3eb('0xa'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xd3eb('0xb'));var _=require('lodash');var squel=require(_0xd3eb('0xc'));var crypto=require(_0xd3eb('0xd'));var jsforce=require('jsforce');var deskjs=require(_0xd3eb('0xe'));var toCsv=require('to-csv');var querystring=require(_0xd3eb('0xf'));var Papa=require(_0xd3eb('0x10'));var Redis=require(_0xd3eb('0x11'));var authService=require(_0xd3eb('0x12'));var qs=require('../../components/parsers/qs');var as=require(_0xd3eb('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')('api');var utils=require('../../config/utils');var config=require(_0xd3eb('0x14'));var licenseUtil=require(_0xd3eb('0x15'));var db=require(_0xd3eb('0x16'))['db'];function respondWithStatusCode(_0x3e7998,_0x10fece){_0x10fece=_0x10fece||0xcc;return function(_0x16924f){if(_0x16924f){return _0x3e7998[_0xd3eb('0x17')](_0x10fece);}return _0x3e7998['status'](_0x10fece)[_0xd3eb('0x18')]();};}function respondWithResult(_0x1939bd,_0x1822d7){_0x1822d7=_0x1822d7||0xc8;return function(_0x23e2a){if(_0x23e2a){return _0x1939bd['status'](_0x1822d7)[_0xd3eb('0x19')](_0x23e2a);}};}function respondWithFilteredResult(_0x5b3963,_0x45f5e6){return function(_0x44bee1){if(_0x44bee1){var _0x4d1d42=typeof _0x45f5e6['offset']===_0xd3eb('0x1a')&&typeof _0x45f5e6[_0xd3eb('0x1b')]===_0xd3eb('0x1a');var _0x494cbb=_0x44bee1['count'];var _0x38d672=_0x4d1d42?0x0:_0x45f5e6[_0xd3eb('0x1c')];var _0x466964=_0x4d1d42?_0x44bee1[_0xd3eb('0x1d')]:_0x45f5e6['offset']+_0x45f5e6[_0xd3eb('0x1b')];var _0x5b2675;if(_0x466964>=_0x494cbb){_0x466964=_0x494cbb;_0x5b2675=0xc8;}else{_0x5b2675=0xce;}_0x5b3963['status'](_0x5b2675);return _0x5b3963[_0xd3eb('0x1e')](_0xd3eb('0x1f'),_0x38d672+'-'+_0x466964+'/'+_0x494cbb)[_0xd3eb('0x19')](_0x44bee1);}return null;};}function patchUpdates(_0xd3266f){return function(_0x4d93dc){try{jsonpatch[_0xd3eb('0x20')](_0x4d93dc,_0xd3266f,!![]);}catch(_0x124645){return BPromise[_0xd3eb('0x21')](_0x124645);}return _0x4d93dc[_0xd3eb('0x22')]();};}function saveUpdates(_0x5d4f9a,_0x3a9703){return function(_0x466547){if(_0x466547){return _0x466547['update'](_0x5d4f9a)[_0xd3eb('0x23')](function(_0x281263){return _0x281263;});}return null;};}function removeEntity(_0x1383e,_0x564d61){return function(_0x5e7e7c){if(_0x5e7e7c){return _0x5e7e7c['destroy']()[_0xd3eb('0x23')](function(){var _0xce5e94=_0x5e7e7c[_0xd3eb('0x24')]({'plain':!![]});var _0x180ff8=_0xd3eb('0x25');return db[_0xd3eb('0x26')]['destroy']({'where':{'type':_0x180ff8,'resourceId':_0xce5e94['id']}})[_0xd3eb('0x23')](function(){return _0x5e7e7c;});})['then'](function(){_0x1383e[_0xd3eb('0x27')](0xcc)[_0xd3eb('0x18')]();});}};}function handleEntityNotFound(_0x48b1c7,_0x4aefce){return function(_0x47f089){if(!_0x47f089){_0x48b1c7[_0xd3eb('0x17')](0x194);}return _0x47f089;};}function handleError(_0x4e3dbb,_0x5e82ac){_0x5e82ac=_0x5e82ac||0x1f4;return function(_0x5a0f0d){logger['error'](_0x5a0f0d[_0xd3eb('0x28')]);if(_0x5a0f0d[_0xd3eb('0x29')]){delete _0x5a0f0d[_0xd3eb('0x29')];}_0x4e3dbb[_0xd3eb('0x27')](_0x5e82ac)[_0xd3eb('0x2a')](_0x5a0f0d);};}exports['index']=function(_0x2318e3,_0x19b802){var _0x28543d={},_0x498d24={},_0x49beed={'count':0x0,'rows':[]};return db[_0xd3eb('0x2b')][_0xd3eb('0x2c')]()[_0xd3eb('0x23')](function(_0x5c05ef){_0x498d24[_0xd3eb('0x2d')]=_[_0xd3eb('0x2e')](_0x5c05ef);_0x498d24[_0xd3eb('0x2f')]=_[_0xd3eb('0x2e')](_0x2318e3[_0xd3eb('0x2f')]);_0x498d24['filters']=_[_0xd3eb('0x30')](_0x498d24[_0xd3eb('0x2d')],_0x498d24[_0xd3eb('0x2f')]);_0x28543d[_0xd3eb('0x31')]=_[_0xd3eb('0x30')](_0x498d24['model'],qs[_0xd3eb('0x32')](_0x2318e3[_0xd3eb('0x2f')][_0xd3eb('0x32')]));_0x28543d[_0xd3eb('0x31')]=_0x28543d[_0xd3eb('0x31')][_0xd3eb('0x33')]?_0x28543d['attributes']:_0x498d24['model'];if(!_0x2318e3[_0xd3eb('0x2f')][_0xd3eb('0x34')](_0xd3eb('0x35'))){_0x28543d[_0xd3eb('0x1b')]=qs[_0xd3eb('0x1b')](_0x2318e3[_0xd3eb('0x2f')]['limit']);_0x28543d[_0xd3eb('0x1c')]=qs['offset'](_0x2318e3[_0xd3eb('0x2f')][_0xd3eb('0x1c')]);}_0x28543d['order']=qs['sort'](_0x2318e3['query'][_0xd3eb('0x36')]);_0x28543d[_0xd3eb('0x37')]=qs[_0xd3eb('0x38')](_[_0xd3eb('0x39')](_0x2318e3['query'],_0x498d24['filters']),_0x5c05ef);if(_0x2318e3[_0xd3eb('0x2f')][_0xd3eb('0x3a')]){_0x28543d[_0xd3eb('0x37')]=_[_0xd3eb('0x3b')](_0x28543d[_0xd3eb('0x37')],{'$or':_[_0xd3eb('0x3c')](_0x28543d[_0xd3eb('0x31')],function(_0x11d439){var _0x2b09ab={};_0x2b09ab[_0x11d439]={'$like':'%'+_0x2318e3[_0xd3eb('0x2f')]['filter']+'%'};return _0x2b09ab;})});}_0x28543d=_[_0xd3eb('0x3b')]({},_0x28543d,_0x2318e3[_0xd3eb('0x3d')]);var _0x293dc1={'where':_0x28543d[_0xd3eb('0x37')]};return db[_0xd3eb('0x2b')][_0xd3eb('0x1d')](_0x293dc1)[_0xd3eb('0x23')](function(_0x21b8f6){_0x49beed[_0xd3eb('0x1d')]=_0x21b8f6;if(_0x2318e3[_0xd3eb('0x2f')]['includeAll']){_0x28543d[_0xd3eb('0x3e')]=[{'all':!![]}];}return db[_0xd3eb('0x2b')][_0xd3eb('0x3f')](_0x28543d);})[_0xd3eb('0x23')](function(_0x3bca19){_0x49beed[_0xd3eb('0x40')]=_0x3bca19;return _0x49beed;})[_0xd3eb('0x23')](respondWithFilteredResult(_0x19b802,_0x28543d))[_0xd3eb('0x41')](handleError(_0x19b802,null));})['catch'](handleError(_0x19b802,null));};exports[_0xd3eb('0x42')]=function(_0x1ed6a2,_0x15fc21){var _0xab2bd1={'raw':![],'where':{'id':_0x1ed6a2[_0xd3eb('0x43')]['id']}},_0x4b056f={};_0x4b056f['model']=_[_0xd3eb('0x2e')](db[_0xd3eb('0x2b')][_0xd3eb('0x44')]);_0x4b056f[_0xd3eb('0x2f')]=_['keys'](_0x1ed6a2['query']);_0x4b056f[_0xd3eb('0x38')]=_[_0xd3eb('0x30')](_0x4b056f['model'],_0x4b056f['query']);_0xab2bd1[_0xd3eb('0x31')]=_[_0xd3eb('0x30')](_0x4b056f[_0xd3eb('0x2d')],qs['fields'](_0x1ed6a2[_0xd3eb('0x2f')][_0xd3eb('0x32')]));_0xab2bd1[_0xd3eb('0x31')]=_0xab2bd1['attributes'][_0xd3eb('0x33')]?_0xab2bd1['attributes']:_0x4b056f['model'];if(_0x1ed6a2[_0xd3eb('0x2f')][_0xd3eb('0x45')]){_0xab2bd1[_0xd3eb('0x3e')]=[{'all':!![]}];}_0xab2bd1=_[_0xd3eb('0x3b')]({},_0xab2bd1,_0x1ed6a2[_0xd3eb('0x3d')]);return db[_0xd3eb('0x2b')][_0xd3eb('0x46')](_0xab2bd1)[_0xd3eb('0x23')](handleEntityNotFound(_0x15fc21,null))['then'](respondWithResult(_0x15fc21,null))[_0xd3eb('0x41')](handleError(_0x15fc21,null));};exports[_0xd3eb('0x47')]=function(_0x55b3bb,_0xaaf246){return db[_0xd3eb('0x2b')][_0xd3eb('0x47')](_0x55b3bb[_0xd3eb('0x48')],{})['then'](function(_0xe3ddb5){var _0x1ce681=_0x55b3bb['user'][_0xd3eb('0x24')]({'plain':!![]});if(!_0x1ce681)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x1ce681[_0xd3eb('0x49')]===_0xd3eb('0x4a')){var _0x265c8=_0xe3ddb5[_0xd3eb('0x24')]({'plain':!![]});var _0x5bb80c=_0xd3eb('0x25');return db[_0xd3eb('0x4b')][_0xd3eb('0x46')]({'where':{'name':_0x5bb80c,'userProfileId':_0x1ce681[_0xd3eb('0x4c')]},'raw':!![]})[_0xd3eb('0x23')](function(_0x304634){if(_0x304634&&_0x304634[_0xd3eb('0x4d')]===0x0){return db[_0xd3eb('0x26')][_0xd3eb('0x47')]({'name':_0x265c8[_0xd3eb('0x29')],'resourceId':_0x265c8['id'],'type':_0x304634[_0xd3eb('0x29')],'sectionId':_0x304634['id']},{})['then'](function(){return _0xe3ddb5;});}else{return _0xe3ddb5;}})[_0xd3eb('0x41')](function(_0x987c3d){logger[_0xd3eb('0x4e')](_0xd3eb('0x4f'),_0x987c3d);throw _0x987c3d;});}return _0xe3ddb5;})['then'](respondWithResult(_0xaaf246,0xc9))[_0xd3eb('0x41')](handleError(_0xaaf246,null));};exports['update']=function(_0x5274de,_0x40bb8a){if(_0x5274de[_0xd3eb('0x48')]['id']){delete _0x5274de['body']['id'];}return db[_0xd3eb('0x2b')][_0xd3eb('0x46')]({'where':{'id':_0x5274de['params']['id']}})['then'](handleEntityNotFound(_0x40bb8a,null))[_0xd3eb('0x23')](saveUpdates(_0x5274de['body'],null))['then'](respondWithResult(_0x40bb8a,null))[_0xd3eb('0x41')](handleError(_0x40bb8a,null));};exports[_0xd3eb('0x50')]=function(_0x24d32d,_0x3b431d){return db[_0xd3eb('0x2b')][_0xd3eb('0x46')]({'where':{'id':_0x24d32d[_0xd3eb('0x43')]['id']}})[_0xd3eb('0x23')](handleEntityNotFound(_0x3b431d,null))[_0xd3eb('0x23')](removeEntity(_0x3b431d,null))[_0xd3eb('0x41')](handleError(_0x3b431d,null));};exports[_0xd3eb('0x2c')]=function(_0x192f7d,_0x3b6ac8){return db['CmCompany'][_0xd3eb('0x2c')]()[_0xd3eb('0x23')](respondWithResult(_0x3b6ac8,null))[_0xd3eb('0x41')](handleError(_0x3b6ac8,null));};exports[_0xd3eb('0x51')]=function(_0x50021a,_0x135b4a,_0x393d89){return db[_0xd3eb('0x52')][_0xd3eb('0x46')]({'where':{'id':_0x50021a[_0xd3eb('0x43')]['id']}})['then'](handleEntityNotFound(_0x135b4a,null))[_0xd3eb('0x23')](function(_0x126fb0){if(_0x126fb0){return _0x126fb0[_0xd3eb('0x51')](_0x50021a[_0xd3eb('0x48')][_0xd3eb('0x53')],_[_0xd3eb('0x54')](_0x50021a[_0xd3eb('0x48')],['ids','id'])||{});}})['then'](respondWithResult(_0x135b4a,null))[_0xd3eb('0x41')](handleError(_0x135b4a,null));};exports[_0xd3eb('0x55')]=function(_0x3ca54d,_0x20363e,_0x39efd0){var _0x5162d9={};var _0x3e1fd7={};var _0x51fb1c;var _0xf03d77;return db[_0xd3eb('0x2b')][_0xd3eb('0x56')]({'where':{'id':_0x3ca54d[_0xd3eb('0x43')]['id']}})[_0xd3eb('0x23')](handleEntityNotFound(_0x20363e,null))[_0xd3eb('0x23')](function(_0x2b713c){if(_0x2b713c){_0x51fb1c=_0x2b713c;_0x3e1fd7[_0xd3eb('0x2d')]=_[_0xd3eb('0x2e')](db['CmContact'][_0xd3eb('0x44')]);_0x3e1fd7[_0xd3eb('0x2f')]=_[_0xd3eb('0x2e')](_0x3ca54d[_0xd3eb('0x2f')]);_0x3e1fd7[_0xd3eb('0x38')]=_[_0xd3eb('0x30')](_0x3e1fd7[_0xd3eb('0x2d')],_0x3e1fd7[_0xd3eb('0x2f')]);_0x5162d9[_0xd3eb('0x31')]=_[_0xd3eb('0x30')](_0x3e1fd7[_0xd3eb('0x2d')],qs[_0xd3eb('0x32')](_0x3ca54d['query'][_0xd3eb('0x32')]));_0x5162d9['attributes']=_0x5162d9[_0xd3eb('0x31')][_0xd3eb('0x33')]?_0x5162d9[_0xd3eb('0x31')]:_0x3e1fd7['model'];_0x5162d9[_0xd3eb('0x57')]=qs[_0xd3eb('0x36')](_0x3ca54d[_0xd3eb('0x2f')][_0xd3eb('0x36')]);_0x5162d9[_0xd3eb('0x37')]=qs[_0xd3eb('0x38')](_[_0xd3eb('0x39')](_0x3ca54d['query'],_0x3e1fd7[_0xd3eb('0x38')]));if(_0x3ca54d['query']['filter']){_0x5162d9[_0xd3eb('0x37')]=_[_0xd3eb('0x3b')](_0x5162d9[_0xd3eb('0x37')],{'$or':_[_0xd3eb('0x3c')](_0x5162d9['attributes'],function(_0x509123){var _0x5e45a7={};_0x5e45a7[_0x509123]={'$like':'%'+_0x3ca54d[_0xd3eb('0x2f')]['filter']+'%'};return _0x5e45a7;})});}_0x5162d9=_[_0xd3eb('0x3b')]({},_0x5162d9,_0x3ca54d[_0xd3eb('0x3d')]);return _0x51fb1c[_0xd3eb('0x55')](_0x5162d9);}})[_0xd3eb('0x23')](function(_0x68f514){if(_0x68f514){_0xf03d77=_0x68f514['length'];if(!_0x3ca54d[_0xd3eb('0x2f')]['hasOwnProperty'](_0xd3eb('0x35'))){_0x5162d9[_0xd3eb('0x1b')]=qs[_0xd3eb('0x1b')](_0x3ca54d[_0xd3eb('0x2f')][_0xd3eb('0x1b')]);_0x5162d9[_0xd3eb('0x1c')]=qs['offset'](_0x3ca54d[_0xd3eb('0x2f')][_0xd3eb('0x1c')]);}return _0x51fb1c[_0xd3eb('0x55')](_0x5162d9);}})[_0xd3eb('0x23')](function(_0x46c216){if(_0x46c216){return _0x46c216?{'count':_0xf03d77,'rows':_0x46c216}:null;}})[_0xd3eb('0x23')](respondWithResult(_0x20363e,null))[_0xd3eb('0x41')](handleError(_0x20363e,null));}; \ No newline at end of file diff --git a/server/api/cmCompany/cmCompany.model.js b/server/api/cmCompany/cmCompany.model.js index af2c68d..a011659 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 _0xcca1=['path','define','lodash','util','moment'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xcca1,0x133));var _0x1cca=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0xcca1[_0x321bb2];return _0x9c12ed;};'use strict';var _=require(_0x1cca('0x0'));var util=require(_0x1cca('0x1'));var logger=require('../../config/logger')('api');var moment=require(_0x1cca('0x2'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0x1cca('0x3'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require('./cmCompany.attributes');module['exports']=function(_0x50d1dc,_0x36b8f3){return _0x50d1dc[_0x1cca('0x4')]('CmCompany',attributes,{'tableName':'cm_companies','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x1ee1=['api','moment','bluebird','path','rimraf','../../config/environment','./cmCompany.attributes','exports','../../config/logger'];(function(_0x1ff1e8,_0x1c36c6){var _0x148dcb=function(_0x7f3a33){while(--_0x7f3a33){_0x1ff1e8['push'](_0x1ff1e8['shift']());}};_0x148dcb(++_0x1c36c6);}(_0x1ee1,0x86));var _0x11ee=function(_0x162e5d,_0x41904d){_0x162e5d=_0x162e5d-0x0;var _0x4992d2=_0x1ee1[_0x162e5d];return _0x4992d2;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x11ee('0x0'))(_0x11ee('0x1'));var moment=require(_0x11ee('0x2'));var BPromise=require(_0x11ee('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x11ee('0x4'));var rimraf=require(_0x11ee('0x5'));var config=require(_0x11ee('0x6'));var attributes=require(_0x11ee('0x7'));module[_0x11ee('0x8')]=function(_0x39037c,_0x5c374c){return _0x39037c['define']('CmCompany',attributes,{'tableName':'cm_companies','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/cmCompany/cmCompany.rpc.js b/server/api/cmCompany/cmCompany.rpc.js index d861261..f8a1669 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 _0x1dba=['../../mysqldb','../../config/logger','rpc','client','request','then','CmCompany,\x20%s,\x20%s','CmCompany,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','lodash','util','moment','bluebird','ioredis'];(function(_0x1a6def,_0x29fa12){var _0x1019f9=function(_0x22ce66){while(--_0x22ce66){_0x1a6def['push'](_0x1a6def['shift']());}};_0x1019f9(++_0x29fa12);}(_0x1dba,0x73));var _0xa1db=function(_0x580f92,_0x21547d){_0x580f92=_0x580f92-0x0;var _0x164e6d=_0x1dba[_0x580f92];return _0x164e6d;};'use strict';var _=require(_0xa1db('0x0'));var util=require(_0xa1db('0x1'));var moment=require(_0xa1db('0x2'));var BPromise=require(_0xa1db('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xa1db('0x4'));var db=require(_0xa1db('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0xa1db('0x6'))(_0xa1db('0x7'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0xa1db('0x8')]['http']({'port':0x232a});function respondWithRpcPromise(_0x4ca999,_0x557523,_0xbe3833){return new BPromise(function(_0x21f5eb,_0x9ec007){return client[_0xa1db('0x9')](_0x4ca999,_0xbe3833)[_0xa1db('0xa')](function(_0x1bde60){logger['info'](_0xa1db('0xb'),_0x557523,'request\x20sent');logger['debug'](_0xa1db('0xc'),_0x557523,_0xa1db('0xd'),JSON[_0xa1db('0xe')](_0x1bde60));if(_0x1bde60[_0xa1db('0xf')]){if(_0x1bde60[_0xa1db('0xf')][_0xa1db('0x10')]===0x1f4){logger[_0xa1db('0xf')](_0xa1db('0xb'),_0x557523,_0x1bde60[_0xa1db('0xf')][_0xa1db('0x11')]);return _0x9ec007(_0x1bde60[_0xa1db('0xf')]['message']);}logger[_0xa1db('0xf')]('CmCompany,\x20%s,\x20%s',_0x557523,_0x1bde60[_0xa1db('0xf')]['message']);return _0x21f5eb(_0x1bde60[_0xa1db('0xf')][_0xa1db('0x11')]);}else{logger['info'](_0xa1db('0xb'),_0x557523,_0xa1db('0xd'));_0x21f5eb(_0x1bde60[_0xa1db('0x12')]['message']);}})[_0xa1db('0x13')](function(_0x5e2bf3){logger[_0xa1db('0xf')](_0xa1db('0xb'),_0x557523,_0x5e2bf3);_0x9ec007(_0x5e2bf3);});});} \ No newline at end of file +var _0xe32f=['debug','CmCompany,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','request','then','info','CmCompany,\x20%s,\x20%s','request\x20sent'];(function(_0x4a8bad,_0x4bfb2f){var _0x30cf32=function(_0x557b3a){while(--_0x557b3a){_0x4a8bad['push'](_0x4a8bad['shift']());}};_0x30cf32(++_0x4bfb2f);}(_0xe32f,0x97));var _0xfe32=function(_0x4c9b28,_0x160338){_0x4c9b28=_0x4c9b28-0x0;var _0xef0eff=_0xe32f[_0x4c9b28];return _0xef0eff;};'use strict';var _=require(_0xfe32('0x0'));var util=require(_0xfe32('0x1'));var moment=require(_0xfe32('0x2'));var BPromise=require(_0xfe32('0x3'));var rs=require(_0xfe32('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xfe32('0x5'))['db'];var utils=require(_0xfe32('0x6'));var logger=require(_0xfe32('0x7'))(_0xfe32('0x8'));var config=require(_0xfe32('0x9'));var jayson=require('jayson/promise');var client=jayson[_0xfe32('0xa')][_0xfe32('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x459d88,_0x16fe8e,_0x42a4f1){return new BPromise(function(_0x98df23,_0xe620bd){return client[_0xfe32('0xc')](_0x459d88,_0x42a4f1)[_0xfe32('0xd')](function(_0x1c09b7){logger[_0xfe32('0xe')](_0xfe32('0xf'),_0x16fe8e,_0xfe32('0x10'));logger[_0xfe32('0x11')](_0xfe32('0x12'),_0x16fe8e,'request\x20sent',JSON[_0xfe32('0x13')](_0x1c09b7));if(_0x1c09b7[_0xfe32('0x14')]){if(_0x1c09b7[_0xfe32('0x14')]['code']===0x1f4){logger[_0xfe32('0x14')](_0xfe32('0xf'),_0x16fe8e,_0x1c09b7[_0xfe32('0x14')][_0xfe32('0x15')]);return _0xe620bd(_0x1c09b7[_0xfe32('0x14')][_0xfe32('0x15')]);}logger['error']('CmCompany,\x20%s,\x20%s',_0x16fe8e,_0x1c09b7['error'][_0xfe32('0x15')]);return _0x98df23(_0x1c09b7[_0xfe32('0x14')][_0xfe32('0x15')]);}else{logger[_0xfe32('0xe')](_0xfe32('0xf'),_0x16fe8e,_0xfe32('0x10'));_0x98df23(_0x1c09b7[_0xfe32('0x16')][_0xfe32('0x15')]);}})[_0xfe32('0x17')](function(_0x2f8d0e){logger['error'](_0xfe32('0xf'),_0x16fe8e,_0x2f8d0e);_0xe620bd(_0x2f8d0e);});});} \ No newline at end of file diff --git a/server/api/cmCompany/index.js b/server/api/cmCompany/index.js index 38a85c5..76ff474 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 _0x515a=['path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../config/environment','./cmCompany.controller','get','index','/describe','isAuthenticated','describe','/:id','show','/:id/contacts','getContacts','post','create','put','update','delete'];(function(_0x346737,_0x3e6081){var _0x1ade2e=function(_0x15e50e){while(--_0x15e50e){_0x346737['push'](_0x346737['shift']());}};_0x1ade2e(++_0x3e6081);}(_0x515a,0x14a));var _0xa515=function(_0x1562e5,_0x97e4c9){_0x1562e5=_0x1562e5-0x0;var _0x126806=_0x515a[_0x1562e5];return _0x126806;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0xa515('0x0'));var timeout=require(_0xa515('0x1'));var express=require(_0xa515('0x2'));var router=express[_0xa515('0x3')]();var fs_extra=require(_0xa515('0x4'));var auth=require(_0xa515('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0xa515('0x6'));var controller=require(_0xa515('0x7'));router[_0xa515('0x8')]('/',auth['isAuthenticated'](),controller[_0xa515('0x9')]);router[_0xa515('0x8')](_0xa515('0xa'),auth[_0xa515('0xb')](),controller[_0xa515('0xc')]);router[_0xa515('0x8')](_0xa515('0xd'),auth['isAuthenticated'](),controller[_0xa515('0xe')]);router[_0xa515('0x8')](_0xa515('0xf'),auth[_0xa515('0xb')](),controller[_0xa515('0x10')]);router[_0xa515('0x11')]('/',auth[_0xa515('0xb')](),controller[_0xa515('0x12')]);router[_0xa515('0x11')](_0xa515('0xf'),auth[_0xa515('0xb')](),controller['addContacts']);router[_0xa515('0x13')](_0xa515('0xd'),auth['isAuthenticated'](),controller[_0xa515('0x14')]);router[_0xa515('0x15')](_0xa515('0xd'),auth[_0xa515('0xb')](),controller['destroy']);module['exports']=router; \ No newline at end of file +var _0x9439=['addContacts','update','destroy','exports','util','path','connect-timeout','express','Router','fs-extra','../../config/environment','get','index','/describe','/:id','isAuthenticated','show','/:id/contacts','getContacts','post','create'];(function(_0x3bd12a,_0x1b025e){var _0x244fb5=function(_0x5e914b){while(--_0x5e914b){_0x3bd12a['push'](_0x3bd12a['shift']());}};_0x244fb5(++_0x1b025e);}(_0x9439,0x82));var _0x9943=function(_0x456e61,_0x575a88){_0x456e61=_0x456e61-0x0;var _0x17ff10=_0x9439[_0x456e61];return _0x17ff10;};'use strict';var multer=require('multer');var util=require(_0x9943('0x0'));var path=require(_0x9943('0x1'));var timeout=require(_0x9943('0x2'));var express=require(_0x9943('0x3'));var router=express[_0x9943('0x4')]();var fs_extra=require(_0x9943('0x5'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0x9943('0x6'));var controller=require('./cmCompany.controller');router[_0x9943('0x7')]('/',auth['isAuthenticated'](),controller[_0x9943('0x8')]);router['get'](_0x9943('0x9'),auth['isAuthenticated'](),controller['describe']);router[_0x9943('0x7')](_0x9943('0xa'),auth[_0x9943('0xb')](),controller[_0x9943('0xc')]);router[_0x9943('0x7')](_0x9943('0xd'),auth[_0x9943('0xb')](),controller[_0x9943('0xe')]);router[_0x9943('0xf')]('/',auth[_0x9943('0xb')](),controller[_0x9943('0x10')]);router['post'](_0x9943('0xd'),auth[_0x9943('0xb')](),controller[_0x9943('0x11')]);router['put'](_0x9943('0xa'),auth[_0x9943('0xb')](),controller[_0x9943('0x12')]);router['delete']('/:id',auth[_0x9943('0xb')](),controller[_0x9943('0x13')]);module[_0x9943('0x14')]=router; \ No newline at end of file diff --git a/server/api/cmContact/cmContact.attributes.js b/server/api/cmContact/cmContact.attributes.js index b9f7ce0..798dfb0 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 _0x776d=['NOW','exports','STRING','TEXT','INTEGER','UNSIGNED'];(function(_0x57b54c,_0x54ce0d){var _0x59cc19=function(_0xa33bc6){while(--_0xa33bc6){_0x57b54c['push'](_0x57b54c['shift']());}};_0x59cc19(++_0x54ce0d);}(_0x776d,0x1c3));var _0xd776=function(_0x4dca0a,_0x899da1){_0x4dca0a=_0x4dca0a-0x0;var _0x4161bc=_0x776d[_0x4dca0a];return _0x4161bc;};'use strict';var _=require('lodash');var Sequelize=require('sequelize');module[_0xd776('0x0')]={'firstName':{'type':Sequelize[_0xd776('0x1')],'allowNull':![]},'lastName':{'type':Sequelize[_0xd776('0x1')]},'street':{'type':Sequelize['STRING']},'postalCode':{'type':Sequelize[_0xd776('0x1')]},'city':{'type':Sequelize['STRING']},'country':{'type':Sequelize[_0xd776('0x1')]},'dateOfBirth':{'type':Sequelize[_0xd776('0x1')]},'description':{'type':Sequelize[_0xd776('0x2')]},'phone':{'type':Sequelize['STRING']},'mobile':{'type':Sequelize[_0xd776('0x1')]},'fax':{'type':Sequelize[_0xd776('0x1')]},'email':{'type':Sequelize[_0xd776('0x1')]},'url':{'type':Sequelize['STRING']},'facebook':{'type':Sequelize[_0xd776('0x1')]},'fb_data':{'type':Sequelize[_0xd776('0x1')]},'twitter':{'type':Sequelize[_0xd776('0x1')]},'skype':{'type':Sequelize[_0xd776('0x1')]},'teams':{'type':Sequelize[_0xd776('0x1')]},'viber':{'type':Sequelize[_0xd776('0x1')]},'line':{'type':Sequelize[_0xd776('0x1')]},'wechat':{'type':Sequelize[_0xd776('0x1')]},'telegram':{'type':Sequelize[_0xd776('0x1')]},'UserId':{'type':Sequelize[_0xd776('0x3')]},'AdditionalPhones':{'type':Sequelize[_0xd776('0x1')]},'priority':{'type':Sequelize[_0xd776('0x3')](0x2)[_0xd776('0x4')],'defaultValue':0x2,'validate':{'min':0x0,'max':0x4}},'scheduledat':{'type':Sequelize['DATE'],'defaultValue':Sequelize[_0xd776('0x5')]},'dialTimezone':{'type':Sequelize['STRING']},'utcOffset':{'type':Sequelize[_0xd776('0x3')]}}; \ No newline at end of file +var _0x5455=['lodash','sequelize','exports','STRING','INTEGER','NOW'];(function(_0x4a4437,_0x36702a){var _0x4eb03c=function(_0x3a4e6b){while(--_0x3a4e6b){_0x4a4437['push'](_0x4a4437['shift']());}};_0x4eb03c(++_0x36702a);}(_0x5455,0x1b0));var _0x5545=function(_0x19950b,_0x53d0d7){_0x19950b=_0x19950b-0x0;var _0x3c6b41=_0x5455[_0x19950b];return _0x3c6b41;};'use strict';var _=require(_0x5545('0x0'));var Sequelize=require(_0x5545('0x1'));module[_0x5545('0x2')]={'firstName':{'type':Sequelize['STRING'],'allowNull':![]},'lastName':{'type':Sequelize['STRING']},'street':{'type':Sequelize['STRING']},'postalCode':{'type':Sequelize[_0x5545('0x3')]},'city':{'type':Sequelize[_0x5545('0x3')]},'country':{'type':Sequelize['STRING']},'dateOfBirth':{'type':Sequelize[_0x5545('0x3')]},'description':{'type':Sequelize['TEXT']},'phone':{'type':Sequelize[_0x5545('0x3')]},'mobile':{'type':Sequelize['STRING']},'fax':{'type':Sequelize['STRING']},'email':{'type':Sequelize[_0x5545('0x3')]},'url':{'type':Sequelize['STRING']},'facebook':{'type':Sequelize[_0x5545('0x3')]},'fb_data':{'type':Sequelize[_0x5545('0x3')]},'twitter':{'type':Sequelize[_0x5545('0x3')]},'skype':{'type':Sequelize['STRING']},'teams':{'type':Sequelize[_0x5545('0x3')]},'viber':{'type':Sequelize['STRING']},'line':{'type':Sequelize[_0x5545('0x3')]},'wechat':{'type':Sequelize[_0x5545('0x3')]},'telegram':{'type':Sequelize[_0x5545('0x3')]},'UserId':{'type':Sequelize[_0x5545('0x4')]},'AdditionalPhones':{'type':Sequelize['STRING']},'priority':{'type':Sequelize[_0x5545('0x4')](0x2)['UNSIGNED'],'defaultValue':0x2,'validate':{'min':0x0,'max':0x4}},'scheduledat':{'type':Sequelize['DATE'],'defaultValue':Sequelize[_0x5545('0x5')]},'dialTimezone':{'type':Sequelize[_0x5545('0x3')]},'utcOffset':{'type':Sequelize[_0x5545('0x4')]}}; \ No newline at end of file diff --git a/server/api/cmContact/cmContact.controller.js b/server/api/cmContact/cmContact.controller.js index fb7d65b..7f5db31 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 _0x1475=['offset','undefined','count','limit','set','update','destroy','sendStatus','stack','name','index','getOptions','findAll','query','user','then','catch','CmContact','find','params','describe','tags','keys','length','cf_','columnName','displayName','analytics','CmCustomField','alias','custom','values','info','Custom\x20field\x20%s\x20not\x20found\x20on\x20cm_contacts\x20table','body','get','isArray','join','[CmContact][merge]\x20to\x20%s\x20from\x20%s','from','CmHopper','[CmContact][merge][destroy][CmHopper],\x20%s','[CmContact][merge][destroy][CmHopperBlack],\x20%s','ChatInteraction','MailInteraction','MailMessage','SmsMessage','FaxInteraction','OpenchannelInteraction','OpenchannelMessage','CmHopperHistory','ReportAgentPreview','VoiceCallReport','ChatQueueReport','FaxQueueReport','MailQueueReport','OpenchannelQueueReport','SmsQueueReport','JscriptySessionReport','WhatsappMessage','WhatsappQueueReport','create','dialTimezone','isNil','timezones','additionalPhones','bulkCreate','each','duplicates','where','$or','ListId','findOrCreate','spread','hasOwnProperty','push','contact','all','Tag','Tags','color','tag','ContactItemType','ItemType','sequelize','Phones.OrderBy','omit','map','format','cf_%d','utcOffset','pickBy','startsWith','table','cm_contacts','setFields','toParam','phone','getTags','findOne','model','rawAttributes','filters','intersection','fields','attributes','order','sort','pick','merge','filter','options','setTags','ids','CmContactHasItem','OrderBy','items','item_types','ItemTypeId','description','PHONE','CmHopperAdditionalPhone','item','literal','`ItemType`.OrderBy','CmHopperId','getAdditionalPhones','fromContactId','CmContactId','toContactId','rescheduleAdditionalPhones','hopperId','getHoppers','nolimit','ContactId','includeAll','include','rows','getHopperHistories','getHopperFinals','CmHopperFinal','getJscriptySessions','uploadCsv','No\x20ListId\x20specified','No\x20association\x20keys\x20specified!','binding_values','binding_keys','split','zipObject','No\x20phone\x20column\x20specified','server/files/tmp','file','filename','chmodSync','0777','child_process','fork','../../components/import/cm/csv','CompanyId','socket_timestamp','File\x20uploaded\x20correctly!','pid','upload','parse','import','User','agent','binding','firstName','No\x20firstName\x20column\x20specified','Unable\x20to\x20synchronize\x20socket,\x20no\x20timestamp\x20passed','stringify','message','start\x20child\x20process\x20correctly!','importUpdates','../../components/import/cm/csvUpdates','exit','error\x20child\x20process','getJourney','mail','chat','sms','openchannel','fax','whatsapp','-createdAt','resolve','channel','includes','Invalid\x20channel','toLowerCase','range','isValid','Invalid\x20date\x20for\x20range\x20to\x20filter','Invalid\x20createdAt\x20filter','voice','uniqueid','type','source','destination','callerid','endtime','duration','note','createdAt','userDisposition','userSecondDisposition','userThirdDisposition','UserId','fullname','DESC','findAndCountAll','startCase','Website','Account','closed','closedAt','disposition','secondDisposition','thirdDisposition','key','Owner','customerIp','customerPort','deviceModel','osName','ratingMessage','ratingType','ratingValue','referer','subject','substatus','externalUrl','threadId','Interaction','flatten','sortBy','reverse','value','slice','moment','bluebird','path','squel','papaparse','ioredis','../../components/contacts','../../config/logger','../../config/environment','../../config/environment/shared','../../mysqldb','redis','defaults','socket.io-emitter','./cmContact.socket','register','status','json'];(function(_0x14fad0,_0x278d75){var _0x5c665f=function(_0xe43a83){while(--_0xe43a83){_0x14fad0['push'](_0x14fad0['shift']());}};_0x5c665f(++_0x278d75);}(_0x1475,0xf0));var _0x5147=function(_0x3c4062,_0x3767fc){_0x3c4062=_0x3c4062-0x0;var _0x3f5bf3=_0x1475[_0x3c4062];return _0x3f5bf3;};'use strict';var moment=require(_0x5147('0x0'));var BPromise=require(_0x5147('0x1'));var util=require('util');var path=require(_0x5147('0x2'));var fs=require('fs');var _=require('lodash');var squel=require(_0x5147('0x3'));var Papa=require(_0x5147('0x4'));var Redis=require(_0x5147('0x5'));var contacts=require(_0x5147('0x6'));var qs=require('../../components/parsers/qs');var logger=require(_0x5147('0x7'))('api');var config=require(_0x5147('0x8'));var shared=require(_0x5147('0x9'));var db=require(_0x5147('0xa'))['db'];config[_0x5147('0xb')]=_[_0x5147('0xc')](config[_0x5147('0xb')],{'host':'localhost','port':0x18eb});var socket=require(_0x5147('0xd'))(new Redis(config['redis']));require(_0x5147('0xe'))[_0x5147('0xf')](socket);function respondWithResult(_0x27e5fb,_0x4c7ec5){_0x4c7ec5=_0x4c7ec5||0xc8;return function(_0x4f69e8){if(_0x4f69e8){return _0x27e5fb[_0x5147('0x10')](_0x4c7ec5)[_0x5147('0x11')](_0x4f69e8);}};}function respondWithFilteredResult(_0xe7c1d8,_0x3e9cf5){return function(_0x5bfc63){if(_0x5bfc63){var _0x3809b5=typeof _0x3e9cf5[_0x5147('0x12')]===_0x5147('0x13')&&typeof _0x3e9cf5['limit']===_0x5147('0x13');var _0x11d154=_0x5bfc63[_0x5147('0x14')];var _0xbb4189=_0x3809b5?0x0:_0x3e9cf5[_0x5147('0x12')];var _0xfb8184=_0x3809b5?_0x5bfc63['count']:_0x3e9cf5[_0x5147('0x12')]+_0x3e9cf5[_0x5147('0x15')];var _0x5a7544;if(_0xfb8184>=_0x11d154){_0xfb8184=_0x11d154;_0x5a7544=0xc8;}else{_0x5a7544=0xce;}_0xe7c1d8[_0x5147('0x10')](_0x5a7544);return _0xe7c1d8[_0x5147('0x16')]('Content-Range',_0xbb4189+'-'+_0xfb8184+'/'+_0x11d154)[_0x5147('0x11')](_0x5bfc63);}return null;};}function saveUpdates(_0x5ab30e){return function(_0x4b1762){if(_0x4b1762){return _0x4b1762[_0x5147('0x17')](_0x5ab30e)['then'](function(_0x2a2a5c){return _0x2a2a5c;});}return null;};}function removeEntity(_0x6925de){return function(_0x349181){if(_0x349181){return _0x349181[_0x5147('0x18')]()['then'](function(){_0x6925de[_0x5147('0x10')](0xcc)['end']();});}};}function handleEntityNotFound(_0x907b6f){return function(_0x433598){if(!_0x433598){_0x907b6f[_0x5147('0x19')](0x194);}return _0x433598;};}function handleError(_0x546d80,_0x38f89c){_0x38f89c=_0x38f89c||0x1f4;return function(_0x3e928e){logger['error'](_0x3e928e[_0x5147('0x1a')]);if(_0x3e928e[_0x5147('0x1b')]){delete _0x3e928e['name'];}_0x546d80[_0x5147('0x10')](_0x38f89c)['send'](_0x3e928e);};}exports[_0x5147('0x1c')]=function(_0x36c636,_0x494728){var _0x357b68={};return contacts['describe']()['then'](function(_0x51140d){_0x357b68=qs[_0x5147('0x1d')](_0x51140d,_0x36c636);return contacts[_0x5147('0x1e')](_0x36c636[_0x5147('0x1f')],_0x36c636[_0x5147('0x20')],_0x357b68,_0x51140d);})[_0x5147('0x21')](respondWithFilteredResult(_0x494728,_0x357b68))[_0x5147('0x22')](handleError(_0x494728,null));};exports[_0x5147('0x18')]=function(_0x1d4c4f,_0x151be0){return db[_0x5147('0x23')][_0x5147('0x24')]({'where':{'id':_0x1d4c4f[_0x5147('0x25')]['id']}})[_0x5147('0x21')](handleEntityNotFound(_0x151be0,null))['then'](removeEntity(_0x151be0,null))[_0x5147('0x22')](handleError(_0x151be0,null));};exports['describe']=function(_0x4dbc25,_0x469a5c){return db[_0x5147('0x23')][_0x5147('0x26')]()[_0x5147('0x21')](function(_0x110b6f){delete _0x110b6f[_0x5147('0x27')];for(var _0x1a772f=0x0;_0x1a772f0x0){return new Promise(function(_0x48263b){var _0x593975=[];for(var _0x5137d2=0x0;_0x5137d2<_0x368273[_0x5147('0x29')];_0x5137d2++){_0x593975[_0x5147('0x5d')](insertAdditionalPhones(_0x368273[_0x5137d2][_0x5147('0x5e')],_0x368273[_0x5137d2][_0x5147('0x53')]));}Promise[_0x5147('0x5f')](_0x593975)[_0x5147('0x21')](function(){_0x48263b(0x1);});})[_0x5147('0x21')](function(){return{'success':_0x8b3975,'failure':_0x42af47,'duplicates':_0x49bb30};});}else{return{'success':_0x8b3975,'failure':_0x42af47,'duplicates':_0x49bb30};}}})[_0x5147('0x21')](respondWithResult(_0x45e0e3,0xc9))[_0x5147('0x22')](handleError(_0x45e0e3,null));};exports['show']=function(_0xc9a3bb,_0x3c12a2){var _0x5cda11;return db[_0x5147('0x23')][_0x5147('0x26')]()['then'](function(_0x587141){return db[_0x5147('0x23')][_0x5147('0x24')]({'where':{'id':_0xc9a3bb[_0x5147('0x25')]['id']},'include':[{'model':db[_0x5147('0x60')],'as':_0x5147('0x61'),'attributes':['id','name',_0x5147('0x62')],'required':_0xc9a3bb[_0x5147('0x1f')][_0x5147('0x63')]?!![]:![]},{'model':db['CmContactHasItem'],'as':'Phones','where':{'CmContactId':_0xc9a3bb['params']['id']},'required':![],'include':[{'model':db[_0x5147('0x64')],'as':_0x5147('0x65')}]}],'order':[db[_0x5147('0x66')]['literal'](_0x5147('0x67'))],'attributes':_['keys'](_0x587141)});})[_0x5147('0x21')](function(_0x2e341d){if(!_['isNil'](_0x2e341d)){_0x5cda11=_0x2e341d['get']({'plain':!![]});var _0x58fbf5={'where':{'$and':[{'ListId':{'$ne':null}}]}};if(_0x2e341d&&_0x2e341d[_0x5147('0x59')]){if(_0x2e341d[_0x5147('0x59')]){_0x58fbf5[_0x5147('0x57')]['$and'][_0x5147('0x5d')]({'ListId':{'$ne':_0x2e341d[_0x5147('0x59')]}});}}return db[_0x5147('0x2e')][_0x5147('0x1e')](_0x58fbf5);}})[_0x5147('0x21')](function(_0x4bda7e){if(!_[_0x5147('0x51')](_0x4bda7e)){return _[_0x5147('0x68')](_0x5cda11,_[_0x5147('0x69')](_0x4bda7e,function(_0x292f09){return util[_0x5147('0x6a')](_0x5147('0x6b'),_0x292f09['id']);}));}})[_0x5147('0x21')](handleEntityNotFound(_0x3c12a2,null))[_0x5147('0x21')](respondWithResult(_0x3c12a2,null))[_0x5147('0x22')](handleError(_0x3c12a2,null));};exports[_0x5147('0x17')]=function(_0xff918a,_0x9e01a){var _0x5f2519;if(_0xff918a[_0x5147('0x34')]['id']){delete _0xff918a[_0x5147('0x34')]['id'];}if(!_[_0x5147('0x51')](_0xff918a[_0x5147('0x34')][_0x5147('0x50')])){var _0x26af21=_0xff918a[_0x5147('0x34')][_0x5147('0x50')];if(!_['isNil'](shared[_0x5147('0x52')][_0x26af21]))_0xff918a[_0x5147('0x34')][_0x5147('0x6c')]=shared['timezones'][_0x26af21][_0x5147('0x6c')];}return db[_0x5147('0x23')]['find']({'where':{'id':_0xff918a[_0x5147('0x25')]['id']}})[_0x5147('0x21')](handleEntityNotFound(_0x9e01a,null))[_0x5147('0x21')](saveUpdates(_0xff918a['body'],null))[_0x5147('0x21')](function(_0x38b199){_0x5f2519=_0x38b199;var _0x1e063b={'where':{'$and':[{'ListId':{'$ne':null}}]}};if(_0x38b199&&_0x38b199[_0x5147('0x59')]){if(_0x38b199[_0x5147('0x59')]){_0x1e063b['where']['$and'][_0x5147('0x5d')]({'ListId':{'$ne':_0x38b199[_0x5147('0x59')]}});}}return db[_0x5147('0x2e')][_0x5147('0x1e')](_0x1e063b);})[_0x5147('0x21')](function(_0x31fadb){if(_0x31fadb){return _[_0x5147('0x68')](_[_0x5147('0x6d')](_0xff918a[_0x5147('0x34')],function(_0x11916d,_0x20c7ff){return _[_0x5147('0x6e')](_0x20c7ff,'cf_');}),_['map'](_0x31fadb,function(_0x484597){return util['format']('cf_%d',_0x484597['id']);}));}})['then'](function(_0x2766ca){if(_0x2766ca&&!_['isEmpty'](_0x2766ca)){var _0x5010db=squel['update']()[_0x5147('0x6f')](_0x5147('0x70'))[_0x5147('0x71')](_0x2766ca)[_0x5147('0x57')]('id\x20=\x20?',_0xff918a[_0x5147('0x25')]['id'])[_0x5147('0x72')]();return db[_0x5147('0x66')][_0x5147('0x1f')](_0x5010db['text'],{'replacements':_0x5010db[_0x5147('0x31')]});}})[_0x5147('0x21')](function(){if(_0xff918a[_0x5147('0x34')][_0x5147('0x73')]&&_0x5f2519){return db[_0x5147('0x3a')][_0x5147('0x17')]({'phone':_0xff918a[_0x5147('0x34')]['phone'],'OrderBy':0x0},{'where':{'ContactId':_0x5f2519['id']}});}})[_0x5147('0x21')](function(){return _0x5f2519;})['then'](respondWithResult(_0x9e01a,null))['catch'](handleError(_0x9e01a,null));};exports[_0x5147('0x74')]=function(_0x58a5cd,_0x531e20){var _0x9c81a7={};var _0x1395d5={};var _0x199a59;var _0x171078;return db['CmContact'][_0x5147('0x75')]({'where':{'id':_0x58a5cd['params']['id']}})[_0x5147('0x21')](handleEntityNotFound(_0x531e20,null))[_0x5147('0x21')](function(_0x149524){if(_0x149524){_0x199a59=_0x149524;_0x1395d5[_0x5147('0x76')]=_[_0x5147('0x28')](db[_0x5147('0x60')][_0x5147('0x77')]);_0x1395d5[_0x5147('0x1f')]=_[_0x5147('0x28')](_0x58a5cd[_0x5147('0x1f')]);_0x1395d5[_0x5147('0x78')]=_[_0x5147('0x79')](_0x1395d5[_0x5147('0x76')],_0x1395d5[_0x5147('0x1f')]);_0x9c81a7['attributes']=_['intersection'](_0x1395d5[_0x5147('0x76')],qs[_0x5147('0x7a')](_0x58a5cd[_0x5147('0x1f')]['fields']));_0x9c81a7[_0x5147('0x7b')]=_0x9c81a7[_0x5147('0x7b')][_0x5147('0x29')]?_0x9c81a7[_0x5147('0x7b')]:_0x1395d5[_0x5147('0x76')];_0x9c81a7[_0x5147('0x7c')]=qs['sort'](_0x58a5cd[_0x5147('0x1f')][_0x5147('0x7d')]);_0x9c81a7[_0x5147('0x57')]=qs[_0x5147('0x78')](_[_0x5147('0x7e')](_0x58a5cd[_0x5147('0x1f')],_0x1395d5[_0x5147('0x78')]));if(_0x58a5cd[_0x5147('0x1f')]['filter']){_0x9c81a7['where']=_[_0x5147('0x7f')](_0x9c81a7[_0x5147('0x57')],{'$or':_['map'](_0x9c81a7[_0x5147('0x7b')],function(_0x33e1d){var _0x3bafff={};_0x3bafff[_0x33e1d]={'$like':'%'+_0x58a5cd['query'][_0x5147('0x80')]+'%'};return _0x3bafff;})});}_0x9c81a7=_[_0x5147('0x7f')]({},_0x9c81a7,_0x58a5cd[_0x5147('0x81')]);return _0x199a59[_0x5147('0x74')](_0x9c81a7);}})[_0x5147('0x21')](function(_0x1f9a9a){if(_0x1f9a9a){_0x171078=_0x1f9a9a[_0x5147('0x29')];if(!_0x58a5cd[_0x5147('0x1f')][_0x5147('0x5c')]('nolimit')){_0x9c81a7[_0x5147('0x15')]=qs[_0x5147('0x15')](_0x58a5cd[_0x5147('0x1f')][_0x5147('0x15')]);_0x9c81a7[_0x5147('0x12')]=qs[_0x5147('0x12')](_0x58a5cd[_0x5147('0x1f')][_0x5147('0x12')]);}return _0x199a59[_0x5147('0x74')](_0x9c81a7);}})[_0x5147('0x21')](function(_0x3fabba){if(_0x3fabba){return _0x3fabba?{'count':_0x171078,'rows':_0x3fabba}:null;}})['then'](respondWithResult(_0x531e20,null))['catch'](handleError(_0x531e20,null));};exports[_0x5147('0x82')]=function(_0x2941f7,_0x18edd9){if(_0x2941f7[_0x5147('0x34')]['id']){delete _0x2941f7[_0x5147('0x34')]['id'];}return db[_0x5147('0x23')][_0x5147('0x75')]({'where':{'id':_0x2941f7[_0x5147('0x25')]['id']}})['then'](handleEntityNotFound(_0x18edd9,null))['then'](function(_0x1ecfd8){if(_0x1ecfd8){return _0x1ecfd8['setTags'](_0x2941f7['body'][_0x5147('0x83')]||[]);}return null;})['then'](respondWithResult(_0x18edd9,null))[_0x5147('0x22')](handleError(_0x18edd9,null));};exports['setAdditionalPhones']=function(_0x1c374f,_0x1926af){var _0x213526=[];_0x213526[_0x5147('0x5d')](addAdditionalPhones(_0x1c374f[_0x5147('0x34')]));Promise[_0x5147('0x5f')](_0x213526)[_0x5147('0x21')](function(){_0x213526=[];_0x213526['push'](deleteCmHopperPhones(_0x1c374f[_0x5147('0x34')]['id']));_0x213526[_0x5147('0x5d')](addCmHopperPhones(_0x1c374f[_0x5147('0x34')]['id']));Promise['all'](_0x213526)[_0x5147('0x21')](function(){return[0x1];})['then'](respondWithResult(_0x1926af,null));});};function addAdditionalPhones(_0x32fbba){var _0x5872ae;return new Promise(function(_0x425112){return db[_0x5147('0x84')][_0x5147('0x18')]({'where':{'CmContactId':_0x32fbba['id']}})['then'](function(){db[_0x5147('0x64')]['findAll']({'raw':!![],'attributes':['id',_0x5147('0x85')]})['then'](function(_0x1b2761){var _0x399a24=[];for(var _0x5a771e=0x0;_0x5a771e<_0x32fbba[_0x5147('0x86')]['length'];_0x5a771e++){var _0x3ec04a=_0x32fbba[_0x5147('0x87')]?_[_0x5147('0x51')](_0x32fbba['item_types'][_0x5a771e])?'':_0x32fbba['item_types'][_0x5a771e]:_0x32fbba[_0x5147('0x86')][_0x5a771e]['ItemTypeId']?_0x32fbba[_0x5147('0x86')][_0x5a771e][_0x5147('0x88')]:'';var _0x34859f=_[_0x5147('0x51')](_0x32fbba['items'][_0x5a771e][_0x5147('0x89')])?'':_0x32fbba[_0x5147('0x86')][_0x5a771e][_0x5147('0x89')];var _0x3eb4ba=_0x3ec04a+':'+_0x32fbba['items'][_0x5a771e][_0x5147('0x73')]+'§'+_0x34859f;if(_[_0x5147('0x51')](_0x5872ae))_0x5872ae=_0x3eb4ba;else _0x5872ae+=';'+_0x3eb4ba;var _0x263377=null;var _0x46a5bd=null;if(_0x32fbba[_0x5147('0x87')]){if(!_['isNil'](_0x32fbba['item_types'][_0x5a771e])){_0x46a5bd=_[_0x5147('0x24')](_0x1b2761,function(_0x504236){return _0x504236['id']===_0x32fbba[_0x5147('0x87')][_0x5a771e];});if(!_['isNil'](_0x46a5bd)){_0x263377=_0x46a5bd['OrderBy'];}}}else{if(!_['isNil'](_0x32fbba['items'][_0x5a771e])){_0x46a5bd=_[_0x5147('0x24')](_0x1b2761,function(_0x283796){return _0x283796['id']===_0x32fbba[_0x5147('0x86')][_0x5a771e][_0x5147('0x88')];});if(!_[_0x5147('0x51')](_0x46a5bd)){_0x263377=_0x5a771e;}}}if(_[_0x5147('0x51')](_0x263377)){_0x263377=0x64;}_0x399a24[_0x5147('0x5d')](addAdditionalPhone(_0x32fbba['id'],_0x32fbba['items'][_0x5a771e][_0x5147('0x73')],_0x32fbba[_0x5147('0x87')]?_[_0x5147('0x51')](_0x32fbba[_0x5147('0x87')][_0x5a771e])?null:_0x32fbba[_0x5147('0x87')][_0x5a771e]:_0x32fbba['items'][_0x5a771e][_0x5147('0x88')]?_0x32fbba[_0x5147('0x86')][_0x5a771e][_0x5147('0x88')]:null,_0x263377,_0x34859f));}Promise['all'](_0x399a24)[_0x5147('0x21')](function(){db[_0x5147('0x23')]['update']({'AdditionalPhones':_0x5872ae},{'where':{'id':_0x32fbba['id']}})[_0x5147('0x21')](function(){_0x425112(0x1);});});});});});}function addAdditionalPhone(_0x26173a,_0x3f1d83,_0x3634e2,_0x38ca7b,_0x5d3b94){return db[_0x5147('0x84')][_0x5147('0x24')]({'where':{'CmContactId':_0x26173a,'item':_0x3f1d83}})[_0x5147('0x21')](function(_0x4c504b){if(_0x4c504b)logger[_0x5147('0x32')]('contact\x20phone\x20exists',_0x4c504b);else{db[_0x5147('0x84')]['create']({'CmContactId':_0x26173a,'item':_0x3f1d83,'ItemTypeId':_0x3634e2,'OrderBy':_0x38ca7b,'ItemClass':_0x5147('0x8a'),'description':_0x5d3b94});}});}function deleteCmHopperPhones(_0x21803e){return new Promise(function(_0x327a50){return db['CmHopper'][_0x5147('0x1e')]({'raw':!![],'attributes':['id'],'where':{'ContactId':_0x21803e}})['then'](function(_0x2efbed){db[_0x5147('0x8b')]['destroy']({'where':{'CmHopperId':{'$in':_[_0x5147('0x69')](_0x2efbed,'id')}}});})['then'](function(){_0x327a50(0x1);});});}function addCmHopperPhones(_0x36f40a){return new Promise(function(_0x37163e){return db[_0x5147('0x3a')][_0x5147('0x1e')]({'raw':!![],'attributes':['id'],'where':{'ContactId':_0x36f40a}})[_0x5147('0x21')](function(_0x307823){var _0x39bfda=[];_[_0x5147('0x69')](_0x307823,function(_0x3fd950){_0x39bfda[_0x5147('0x5d')](createCmHopperPhone(_0x36f40a,_0x3fd950['id']));});Promise['all'](_0x39bfda)[_0x5147('0x21')](function(){_0x37163e(0x1);});});});}function createCmHopperPhone(_0x33eafa,_0x4f2ff7){return new Promise(function(_0x66ce63){db[_0x5147('0x84')][_0x5147('0x1e')]({'raw':!![],'attributes':[_0x5147('0x8c'),_0x5147('0x85')],'where':{'CmContactId':_0x33eafa,'ItemClass':'PHONE'},'include':[{'model':db[_0x5147('0x64')],'attributes':[_0x5147('0x85')],'as':'ItemType'}],'order':[_0x5147('0x85'),db[_0x5147('0x66')][_0x5147('0x8d')](_0x5147('0x8e'))]})[_0x5147('0x21')](function(_0x2df0ae){var _0x183027=0x1;var _0x17c3f3=_[_0x5147('0x69')](_0x2df0ae,function(_0x383751){_0x383751[_0x5147('0x8f')]=_0x4f2ff7;_0x383751['phone']=_0x383751[_0x5147('0x8c')];_0x383751[_0x5147('0x85')]=_0x183027;delete _0x383751['ItemType.OrderBy'];_0x183027=_0x183027+0x1;return _0x383751;});return db[_0x5147('0x8b')][_0x5147('0x54')](_0x17c3f3,{});})[_0x5147('0x21')](function(){_0x66ce63(0x1);});});}function insertAdditionalPhones(_0x21555c,_0x58189d){return new Promise(function(_0x3d1a66){var _0x2b9eb0=[];for(var _0x523dda=0x0;_0x523dda<_0x58189d[_0x5147('0x29')];_0x523dda++){var _0x730c37=_0x58189d[_0x523dda];_0x2b9eb0[_0x5147('0x5d')](parseContactItemType(_0x730c37));}Promise[_0x5147('0x5f')](_0x2b9eb0)['then'](function(){var _0x339e43={'id':_0x21555c['id'],'items':_0x58189d};return addAdditionalPhones(_0x339e43)[_0x5147('0x21')](function(){return addCmHopperPhones(_0x21555c['id']);});})[_0x5147('0x21')](function(){_0x3d1a66(_0x21555c);});});}function parseContactItemType(_0x2aa832){return new Promise(function(_0x38bbd1){if(_0x2aa832[_0x5147('0x5c')](_0x5147('0x88'))){_0x38bbd1(_0x2aa832);}else{return db[_0x5147('0x64')][_0x5147('0x24')]({'where':{'name':_0x2aa832['ItemType']}})[_0x5147('0x21')](function(_0x3e777d){if(_['isNil'](_0x3e777d))_0x2aa832[_0x5147('0x88')]=null;else _0x2aa832[_0x5147('0x88')]=_0x3e777d['id'];_0x38bbd1(_0x2aa832);});}});}exports[_0x5147('0x90')]=function(_0x46cd1,_0x18a3f6){return db[_0x5147('0x84')]['findAll']({'raw':!![],'where':{'CmContactId':_0x46cd1[_0x5147('0x25')]['id'],'ItemClass':_0x5147('0x8a')},'include':[{'model':db[_0x5147('0x64')],'as':_0x5147('0x65')}],'order':[['OrderBy'],[db['sequelize']['literal']('`ItemType`.OrderBy')]]})[_0x5147('0x21')](function(_0x2c181a){return _0x2c181a;})[_0x5147('0x21')](respondWithResult(_0x18a3f6,null))[_0x5147('0x22')](handleError(_0x18a3f6,null));};exports['duplicateAdditionalPhones']=function(_0x2d00e1,_0x3b202f){return db[_0x5147('0x84')][_0x5147('0x1e')]({'raw':!![],'where':{'CmContactId':_0x2d00e1['body'][_0x5147('0x91')]}})[_0x5147('0x21')](function(_0x4b8c50){var _0x476793=_[_0x5147('0x69')](_0x4b8c50,function(_0x543bc2){_0x543bc2[_0x5147('0x92')]=_0x2d00e1[_0x5147('0x34')][_0x5147('0x93')];return _0x543bc2;});return db['CmContactHasItem'][_0x5147('0x54')](_0x476793,{});})[_0x5147('0x21')](function(){return addCmHopperPhones(_0x2d00e1[_0x5147('0x34')][_0x5147('0x93')]);})[_0x5147('0x21')](function(){return['ok'];})['then'](respondWithResult(_0x3b202f,null))[_0x5147('0x22')](handleError(_0x3b202f,null));};exports[_0x5147('0x94')]=function(_0x977998,_0x145b56){var _0x503701=[];_0x503701['push'](createCmHopperPhone(_0x977998['body']['id'],_0x977998[_0x5147('0x34')][_0x5147('0x95')]));Promise[_0x5147('0x5f')](_0x503701)[_0x5147('0x21')](function(){return[0x1];})[_0x5147('0x21')](respondWithResult(_0x145b56,null));};exports[_0x5147('0x96')]=function(_0x21a2d4,_0x36cadb){var _0x19749f={'raw':![],'where':{}};var _0x408817={};var _0x352e51={'count':0x0,'rows':[]};return db[_0x5147('0x23')][_0x5147('0x75')]({'where':{'id':_0x21a2d4['params']['id']}})[_0x5147('0x21')](handleEntityNotFound(_0x36cadb,null))[_0x5147('0x21')](function(_0x553e0a){if(_0x553e0a){_0x408817[_0x5147('0x76')]=_[_0x5147('0x28')](db[_0x5147('0x3a')][_0x5147('0x77')]);_0x408817['query']=_[_0x5147('0x28')](_0x21a2d4[_0x5147('0x1f')]);_0x408817[_0x5147('0x78')]=_[_0x5147('0x79')](_0x408817[_0x5147('0x76')],_0x408817[_0x5147('0x1f')]);_0x19749f[_0x5147('0x7b')]=_[_0x5147('0x79')](_0x408817['model'],qs[_0x5147('0x7a')](_0x21a2d4[_0x5147('0x1f')][_0x5147('0x7a')]));_0x19749f['attributes']=_0x19749f['attributes'][_0x5147('0x29')]?_0x19749f[_0x5147('0x7b')]:_0x408817[_0x5147('0x76')];if(!_0x21a2d4['query']['hasOwnProperty'](_0x5147('0x97'))){_0x19749f[_0x5147('0x15')]=qs[_0x5147('0x15')](_0x21a2d4[_0x5147('0x1f')][_0x5147('0x15')]);_0x19749f['offset']=qs[_0x5147('0x12')](_0x21a2d4['query'][_0x5147('0x12')]);}_0x19749f['order']=qs[_0x5147('0x7d')](_0x21a2d4['query'][_0x5147('0x7d')]);_0x19749f[_0x5147('0x57')]=qs[_0x5147('0x78')](_['pick'](_0x21a2d4[_0x5147('0x1f')],_0x408817[_0x5147('0x78')]));_0x19749f['where'][_0x5147('0x98')]=_0x553e0a['id'];if(_0x21a2d4['query'][_0x5147('0x80')]){_0x19749f['where']=_[_0x5147('0x7f')](_0x19749f[_0x5147('0x57')],{'$or':_['map'](_0x19749f['attributes'],function(_0x32d686){var _0x3041ff={};_0x3041ff[_0x32d686]={'$like':'%'+_0x21a2d4['query']['filter']+'%'};return _0x3041ff;})});}_0x19749f=_[_0x5147('0x7f')]({},_0x19749f,_0x21a2d4[_0x5147('0x81')]);return db[_0x5147('0x3a')][_0x5147('0x14')]({'where':_0x19749f['where']})['then'](function(_0x36434a){_0x352e51[_0x5147('0x14')]=_0x36434a;if(_0x21a2d4[_0x5147('0x1f')][_0x5147('0x99')]){_0x19749f[_0x5147('0x9a')]=[{'all':!![]}];}return db[_0x5147('0x3a')][_0x5147('0x1e')](_0x19749f);})['then'](function(_0x584555){_0x352e51[_0x5147('0x9b')]=_0x584555;return _0x352e51;});}})['then'](respondWithFilteredResult(_0x36cadb,_0x19749f))['catch'](handleError(_0x36cadb,null));};exports[_0x5147('0x9c')]=function(_0x25e635,_0x4c117d){var _0x5bda7c={'raw':!![],'where':{}};var _0xbeb6f7={};var _0x534ede={'count':0x0,'rows':[]};return db['CmContact'][_0x5147('0x75')]({'where':{'id':_0x25e635[_0x5147('0x25')]['id']}})[_0x5147('0x21')](handleEntityNotFound(_0x4c117d,null))[_0x5147('0x21')](function(_0x5cff05){if(_0x5cff05){_0xbeb6f7[_0x5147('0x76')]=_[_0x5147('0x28')](db[_0x5147('0x44')][_0x5147('0x77')]);_0xbeb6f7[_0x5147('0x1f')]=_[_0x5147('0x28')](_0x25e635[_0x5147('0x1f')]);_0xbeb6f7[_0x5147('0x78')]=_[_0x5147('0x79')](_0xbeb6f7['model'],_0xbeb6f7[_0x5147('0x1f')]);_0x5bda7c[_0x5147('0x7b')]=_[_0x5147('0x79')](_0xbeb6f7[_0x5147('0x76')],qs[_0x5147('0x7a')](_0x25e635[_0x5147('0x1f')]['fields']));_0x5bda7c[_0x5147('0x7b')]=_0x5bda7c[_0x5147('0x7b')][_0x5147('0x29')]?_0x5bda7c['attributes']:_0xbeb6f7['model'];if(!_0x25e635[_0x5147('0x1f')]['hasOwnProperty']('nolimit')){_0x5bda7c[_0x5147('0x15')]=qs[_0x5147('0x15')](_0x25e635['query'][_0x5147('0x15')]);_0x5bda7c[_0x5147('0x12')]=qs[_0x5147('0x12')](_0x25e635[_0x5147('0x1f')]['offset']);}_0x5bda7c[_0x5147('0x7c')]=qs[_0x5147('0x7d')](_0x25e635['query'][_0x5147('0x7d')]);_0x5bda7c[_0x5147('0x57')]=qs[_0x5147('0x78')](_['pick'](_0x25e635[_0x5147('0x1f')],_0xbeb6f7[_0x5147('0x78')]));_0x5bda7c['where'][_0x5147('0x98')]=_0x5cff05['id'];if(_0x25e635['query']['filter']){_0x5bda7c[_0x5147('0x57')]=_[_0x5147('0x7f')](_0x5bda7c['where'],{'$or':_['map'](_0x5bda7c[_0x5147('0x7b')],function(_0x40e792){var _0x154b67={};_0x154b67[_0x40e792]={'$like':'%'+_0x25e635[_0x5147('0x1f')][_0x5147('0x80')]+'%'};return _0x154b67;})});}_0x5bda7c=_[_0x5147('0x7f')]({},_0x5bda7c,_0x25e635['options']);return db['CmHopperHistory']['count']({'where':_0x5bda7c[_0x5147('0x57')]})[_0x5147('0x21')](function(_0x3dc189){_0x534ede[_0x5147('0x14')]=_0x3dc189;if(_0x25e635['query'][_0x5147('0x99')]){_0x5bda7c['include']=[{'all':!![]}];}return db[_0x5147('0x44')][_0x5147('0x1e')](_0x5bda7c);})[_0x5147('0x21')](function(_0x2d8e90){_0x534ede[_0x5147('0x9b')]=_0x2d8e90;return _0x534ede;});}})['then'](respondWithFilteredResult(_0x4c117d,_0x5bda7c))[_0x5147('0x22')](handleError(_0x4c117d,null));};exports[_0x5147('0x9d')]=function(_0x3099c8,_0x1b0236){var _0x1c6365={'raw':!![],'where':{}};var _0x476ef6={};var _0x554f97={'count':0x0,'rows':[]};return db[_0x5147('0x23')][_0x5147('0x75')]({'where':{'id':_0x3099c8['params']['id']}})[_0x5147('0x21')](handleEntityNotFound(_0x1b0236,null))['then'](function(_0x44416a){if(_0x44416a){_0x476ef6[_0x5147('0x76')]=_[_0x5147('0x28')](db['CmHopperFinal'][_0x5147('0x77')]);_0x476ef6[_0x5147('0x1f')]=_[_0x5147('0x28')](_0x3099c8[_0x5147('0x1f')]);_0x476ef6[_0x5147('0x78')]=_[_0x5147('0x79')](_0x476ef6[_0x5147('0x76')],_0x476ef6['query']);_0x1c6365[_0x5147('0x7b')]=_[_0x5147('0x79')](_0x476ef6[_0x5147('0x76')],qs['fields'](_0x3099c8[_0x5147('0x1f')][_0x5147('0x7a')]));_0x1c6365['attributes']=_0x1c6365[_0x5147('0x7b')][_0x5147('0x29')]?_0x1c6365[_0x5147('0x7b')]:_0x476ef6[_0x5147('0x76')];if(!_0x3099c8[_0x5147('0x1f')][_0x5147('0x5c')](_0x5147('0x97'))){_0x1c6365[_0x5147('0x15')]=qs[_0x5147('0x15')](_0x3099c8[_0x5147('0x1f')][_0x5147('0x15')]);_0x1c6365[_0x5147('0x12')]=qs[_0x5147('0x12')](_0x3099c8[_0x5147('0x1f')][_0x5147('0x12')]);}_0x1c6365[_0x5147('0x7c')]=qs['sort'](_0x3099c8[_0x5147('0x1f')][_0x5147('0x7d')]);_0x1c6365['where']=qs['filters'](_['pick'](_0x3099c8['query'],_0x476ef6['filters']));_0x1c6365[_0x5147('0x57')][_0x5147('0x98')]=_0x44416a['id'];if(_0x3099c8[_0x5147('0x1f')][_0x5147('0x80')]){_0x1c6365[_0x5147('0x57')]=_[_0x5147('0x7f')](_0x1c6365[_0x5147('0x57')],{'$or':_[_0x5147('0x69')](_0x1c6365['attributes'],function(_0x358a35){var _0x438ddf={};_0x438ddf[_0x358a35]={'$like':'%'+_0x3099c8['query'][_0x5147('0x80')]+'%'};return _0x438ddf;})});}_0x1c6365=_['merge']({},_0x1c6365,_0x3099c8['options']);return db[_0x5147('0x9e')]['count']({'where':_0x1c6365['where']})[_0x5147('0x21')](function(_0x3c66c9){_0x554f97[_0x5147('0x14')]=_0x3c66c9;if(_0x3099c8[_0x5147('0x1f')][_0x5147('0x99')]){_0x1c6365[_0x5147('0x9a')]=[{'all':!![]}];}return db[_0x5147('0x9e')][_0x5147('0x1e')](_0x1c6365);})[_0x5147('0x21')](function(_0x1fd64c){_0x554f97[_0x5147('0x9b')]=_0x1fd64c;return _0x554f97;});}})[_0x5147('0x21')](respondWithFilteredResult(_0x1b0236,_0x1c6365))[_0x5147('0x22')](handleError(_0x1b0236,null));};exports[_0x5147('0x9f')]=function(_0x31e3e7,_0x3a3363){var _0x4eb5a6={'raw':!![],'where':{}};var _0x24e79b={};var _0x1294c8={'count':0x0,'rows':[]};return db[_0x5147('0x23')]['findOne']({'where':{'id':_0x31e3e7[_0x5147('0x25')]['id']}})['then'](handleEntityNotFound(_0x3a3363,null))['then'](function(_0x597327){if(_0x597327){_0x24e79b[_0x5147('0x76')]=_['keys'](db[_0x5147('0x4c')][_0x5147('0x77')]);_0x24e79b['query']=_['keys'](_0x31e3e7[_0x5147('0x1f')]);_0x24e79b[_0x5147('0x78')]=_['intersection'](_0x24e79b[_0x5147('0x76')],_0x24e79b[_0x5147('0x1f')]);_0x4eb5a6[_0x5147('0x7b')]=_[_0x5147('0x79')](_0x24e79b[_0x5147('0x76')],qs['fields'](_0x31e3e7[_0x5147('0x1f')][_0x5147('0x7a')]));_0x4eb5a6[_0x5147('0x7b')]=_0x4eb5a6[_0x5147('0x7b')][_0x5147('0x29')]?_0x4eb5a6[_0x5147('0x7b')]:_0x24e79b[_0x5147('0x76')];if(!_0x31e3e7[_0x5147('0x1f')][_0x5147('0x5c')](_0x5147('0x97'))){_0x4eb5a6['limit']=qs[_0x5147('0x15')](_0x31e3e7[_0x5147('0x1f')][_0x5147('0x15')]);_0x4eb5a6[_0x5147('0x12')]=qs[_0x5147('0x12')](_0x31e3e7[_0x5147('0x1f')][_0x5147('0x12')]);}_0x4eb5a6['order']=qs['sort'](_0x31e3e7[_0x5147('0x1f')]['sort']);_0x4eb5a6[_0x5147('0x57')]=qs[_0x5147('0x78')](_['pick'](_0x31e3e7[_0x5147('0x1f')],_0x24e79b['filters']));_0x4eb5a6[_0x5147('0x57')][_0x5147('0x98')]=_0x597327['id'];if(_0x31e3e7['query'][_0x5147('0x80')]){_0x4eb5a6[_0x5147('0x57')]=_['merge'](_0x4eb5a6['where'],{'$or':_[_0x5147('0x69')](_0x4eb5a6[_0x5147('0x7b')],function(_0x309848){var _0x2baa78={};_0x2baa78[_0x309848]={'$like':'%'+_0x31e3e7['query'][_0x5147('0x80')]+'%'};return _0x2baa78;})});}_0x4eb5a6=_[_0x5147('0x7f')]({},_0x4eb5a6,_0x31e3e7['options']);return db[_0x5147('0x4c')]['count']({'where':_0x4eb5a6[_0x5147('0x57')]})[_0x5147('0x21')](function(_0x163f4c){_0x1294c8['count']=_0x163f4c;if(_0x31e3e7[_0x5147('0x1f')][_0x5147('0x99')]){_0x4eb5a6[_0x5147('0x9a')]=[{'all':!![]}];}return db[_0x5147('0x4c')]['findAll'](_0x4eb5a6);})[_0x5147('0x21')](function(_0x5ede8f){_0x1294c8[_0x5147('0x9b')]=_0x5ede8f;return _0x1294c8;});}})[_0x5147('0x21')](respondWithFilteredResult(_0x3a3363,_0x4eb5a6))[_0x5147('0x22')](handleError(_0x3a3363,null));};exports[_0x5147('0xa0')]=function(_0x11c8e3,_0x5c757d){try{if(!_0x11c8e3['body']['ListId']){throw new Error(_0x5147('0xa1'));}if(!_0x11c8e3[_0x5147('0x34')]['binding_keys']){throw new Error(_0x5147('0xa2'));}if(!_0x11c8e3[_0x5147('0x34')][_0x5147('0xa3')]){throw new Error('No\x20association\x20values\x20specified!');}if(!_0x11c8e3[_0x5147('0x34')]['socket_timestamp']){throw new Error('Unable\x20to\x20synchronize\x20socket,\x20no\x20timestamp\x20passed');}var _0x34a261=_0x11c8e3['body'][_0x5147('0xa4')][_0x5147('0xa5')](',');var _0x2f06f5=_0x11c8e3[_0x5147('0x34')][_0x5147('0xa3')][_0x5147('0xa5')](',');if(!_0x34a261[_0x5147('0x29')]||!_0x2f06f5[_0x5147('0x29')]||_0x34a261[_0x5147('0x29')]!==_0x2f06f5[_0x5147('0x29')]){throw new Error('Incorrect\x20binding\x20parameters\x20passed!');}_0x11c8e3[_0x5147('0x34')][_0x5147('0x7a')]=_[_0x5147('0xa6')](_0x34a261,_0x2f06f5);if(!_0x11c8e3['body'][_0x5147('0x7a')][_0x5147('0x73')]){throw new Error(_0x5147('0xa7'));}if(!_0x11c8e3[_0x5147('0x34')][_0x5147('0x7a')]['firstName']){throw new Error('No\x20firstName\x20column\x20specified');}var _0x485313=path[_0x5147('0x37')](config['root'],_0x5147('0xa8'),_0x11c8e3[_0x5147('0xa9')][_0x5147('0xaa')]);fs[_0x5147('0xab')](_0x485313,parseInt(_0x5147('0xac'),0x8));var _0x16444b=require(_0x5147('0xad'))[_0x5147('0xae')](path[_0x5147('0x37')](__dirname,_0x5147('0xaf')),[_0x485313,_0x11c8e3[_0x5147('0x34')][_0x5147('0xa4')],_0x11c8e3['body'][_0x5147('0xa3')],_0x11c8e3[_0x5147('0x34')]['ListId'],_0x11c8e3[_0x5147('0x34')][_0x5147('0xb0')],_0x11c8e3[_0x5147('0x34')][_0x5147('0x56')],_0x11c8e3[_0x5147('0x34')][_0x5147('0xb1')]]);return _0x5c757d[_0x5147('0x10')](0xc8)[_0x5147('0x11')]({'message':_0x5147('0xb2'),'pid':_0x16444b[_0x5147('0xb3')]});}catch(_0x262071){return _0x5c757d[_0x5147('0x10')](0x1f4)['send'](_0x262071);}};exports[_0x5147('0xb4')]=function(_0x499c72,_0x44aa0f){var _0x1c3e16=fs['createReadStream'](_0x499c72[_0x5147('0xa9')]['path']);Papa[_0x5147('0xb5')](_0x1c3e16,{'header':!![],'skipEmptyLines':!![],'preview':0x1,'complete':function(_0x59ed08){return _0x44aa0f[_0x5147('0x10')](0xc8)[_0x5147('0x11')]({'file':_0x499c72[_0x5147('0xa9')],'fields':_0x59ed08['meta'][_0x5147('0x7a')]});}});};exports[_0x5147('0xb6')]=function(_0xdb2097,_0xfa9751){return db[_0x5147('0xb7')][_0x5147('0x1e')]({'raw':!![],'attributes':['id'],'where':{'role':_0x5147('0xb8')}})[_0x5147('0x21')](function(_0x47e0ae){var _0x24c44b=![];if(!_0xdb2097['body']['ListId']){throw new Error('No\x20ListId\x20specified');}if(!_0xdb2097[_0x5147('0x34')][_0x5147('0xb9')]['phone']){throw new Error('No\x20phone\x20column\x20specified');}if(!_0xdb2097[_0x5147('0x34')][_0x5147('0xb9')][_0x5147('0xba')]){throw new Error(_0x5147('0xbb'));}if(!_0xdb2097[_0x5147('0x34')]['socket_timestamp']){throw new Error(_0x5147('0xbc'));}var _0x3ad927=require(_0x5147('0xad'))[_0x5147('0xae')](path[_0x5147('0x37')](__dirname,'../../components/import/cm/csv2'),[_0xdb2097[_0x5147('0x25')]['id'],JSON[_0x5147('0xbd')](_0xdb2097['body']),JSON[_0x5147('0xbd')](_0x47e0ae)]);_0x3ad927['on'](_0x5147('0xbe'),function(){_0x24c44b=!![];return _0xfa9751[_0x5147('0x10')](0xc8)[_0x5147('0x11')]({'message':_0x5147('0xbf'),'pid':_0x3ad927['pid']});});_0x3ad927['on']('exit',function(_0x28c0a7){if(_0x28c0a7&&!_0x24c44b){return _0xfa9751[_0x5147('0x10')](0x1f4)[_0x5147('0x11')]({'message':'error\x20child\x20process','pid':_0x3ad927[_0x5147('0xb3')]});}});})[_0x5147('0x22')](handleError(_0xfa9751,null));};exports[_0x5147('0xc0')]=function(_0x2372ae,_0x9af50){return db['User'][_0x5147('0x1e')]({'raw':!![],'attributes':['id'],'where':{'role':_0x5147('0xb8')}})['then'](function(_0x507688){var _0x42f6d8=![];if(!_0x2372ae[_0x5147('0x34')][_0x5147('0x59')]){throw new Error('No\x20ListId\x20specified');}if(!_0x2372ae['body'][_0x5147('0xb9')][_0x5147('0x73')]){throw new Error(_0x5147('0xa7'));}if(!_0x2372ae['body'][_0x5147('0xb9')]['firstName']){throw new Error(_0x5147('0xbb'));}if(!_0x2372ae[_0x5147('0x34')][_0x5147('0xb1')]){throw new Error(_0x5147('0xbc'));}var _0x2c81b8=require('child_process')[_0x5147('0xae')](path[_0x5147('0x37')](__dirname,_0x5147('0xc1')),[_0x2372ae['params']['id'],JSON[_0x5147('0xbd')](_0x2372ae[_0x5147('0x34')]),JSON[_0x5147('0xbd')](_0x507688)]);_0x2c81b8['on'](_0x5147('0xbe'),function(){_0x42f6d8=!![];return _0x9af50['status'](0xc8)[_0x5147('0x11')]({'message':_0x5147('0xbf'),'pid':_0x2c81b8['pid']});});_0x2c81b8['on'](_0x5147('0xc2'),function(_0x8e4162){if(_0x8e4162&&!_0x42f6d8){return _0x9af50[_0x5147('0x10')](0x1f4)[_0x5147('0x11')]({'message':_0x5147('0xc3'),'pid':_0x2c81b8[_0x5147('0xb3')]});}});})['catch'](handleError(_0x9af50,null));};exports[_0x5147('0xc4')]=function(_0x2ec73f,_0x569cbf){var _0x5d8cae=[_0x5147('0xc5'),_0x5147('0xc6'),_0x5147('0xc7'),_0x5147('0xc8'),_0x5147('0xc9'),_0x5147('0xca'),'voice'];var _0x36f3d5={'offset':0x0,'order':qs[_0x5147('0x7d')](_0x5147('0xcb'))},_0x56f53a={'count':0x0,'rows':[]};Promise[_0x5147('0xcc')]()[_0x5147('0x21')](function(){if(_0x2ec73f[_0x5147('0x1f')][_0x5147('0xcd')]){if(!_[_0x5147('0xce')](_0x5d8cae,_0x2ec73f['query']['channel']['toLowerCase']())){throw new Error(_0x5147('0xcf'));}_0x5d8cae=[_0x2ec73f[_0x5147('0x1f')][_0x5147('0xcd')][_0x5147('0xd0')]()];}if(_0x2ec73f[_0x5147('0x1f')]['range']){try{var _0x4f5e9e=JSON['parse'](_0x2ec73f[_0x5147('0x1f')][_0x5147('0xd1')]);if(!moment(_0x4f5e9e['from'])[_0x5147('0xd2')]()){throw new Error('Invalid\x20date\x20for\x20range\x20from\x20filter');}if(!moment(_0x4f5e9e['to'])[_0x5147('0xd2')]()){throw new Error(_0x5147('0xd3'));}}catch(_0x321b4a){throw new Error(_0x5147('0xd4'));}}if(!_0x2ec73f[_0x5147('0x1f')]['hasOwnProperty'](_0x5147('0x97'))){_0x36f3d5[_0x5147('0x15')]=qs[_0x5147('0x15')](_0x2ec73f[_0x5147('0x1f')]['limit']||0xa);_0x36f3d5[_0x5147('0x12')]=qs['offset'](_0x2ec73f['query'][_0x5147('0x12')]);}var _0x8efb26=_0x5d8cae[_0x5147('0x69')](function(_0x408be2){if(_0x408be2===_0x5147('0xd5')){var _0x2bb744={'attributes':['id',_0x5147('0xd6'),_0x5147('0xd7'),_0x5147('0xd8'),_0x5147('0xd9'),_0x5147('0xda'),'starttime',_0x5147('0xdb'),_0x5147('0xdc'),_0x5147('0xdd'),_0x5147('0xde'),_0x5147('0xdf'),_0x5147('0xe0'),_0x5147('0xe1'),_0x5147('0xe2')],'where':{'ContactId':_0x2ec73f[_0x5147('0x25')]['id']},'include':[{'model':db[_0x5147('0xb7')],'as':'User','attributes':['id',_0x5147('0x1b'),_0x5147('0xe3'),_0x5147('0x2f')]}],'order':[[_0x5147('0xde'),_0x5147('0xe4')]]};if(_0x2ec73f[_0x5147('0x1f')][_0x5147('0xd1')]){_0x2bb744['where']['createdAt']={'$gte':_0x4f5e9e['from'],'$lte':_0x4f5e9e['to']};}return db['VoiceCallReport'][_0x5147('0xe5')](_0x2bb744)[_0x5147('0x21')](function(_0x3b409b){_0x56f53a[_0x5147('0x14')]+=_0x3b409b[_0x5147('0x14')];return _[_0x5147('0x69')](_0x3b409b[_0x5147('0x9b')],function(_0x184656){var _0x10cb48=_0x184656['get']({'plain':!![]});_0x10cb48[_0x5147('0xcd')]=_0x408be2;if(_0x10cb48['User']){_0x10cb48['User']={'id':_0x10cb48[_0x5147('0xb7')]['id'],'name':_0x10cb48[_0x5147('0xb7')][_0x5147('0x1b')],'fullname':_0x10cb48[_0x5147('0xb7')][_0x5147('0xe3')],'alias':_0x10cb48['User']['alias']};}return _0x10cb48;});});}else{var _0x5a489c=_[_0x5147('0xe6')](_0x408be2)+(_0x408be2===_0x5147('0xc6')?_0x5147('0xe7'):_0x5147('0xe8'));var _0x2a93ef={'attributes':['id',_0x5147('0xe9'),_0x5147('0xea'),'createdAt',_0x5147('0xdd'),_0x5147('0xeb'),_0x5147('0xec'),_0x5147('0xed'),_0x5147('0xe2'),_0x5a489c+'Id'],'where':{'ContactId':_0x2ec73f[_0x5147('0x25')]['id']},'include':[{'model':db[_0x5a489c],'as':'Account','attributes':['id',_0x5147('0x1b'),_0x5147('0xee')]},{'model':db[_0x5147('0xb7')],'as':_0x5147('0xef'),'attributes':['id',_0x5147('0x1b'),_0x5147('0xe3')]},{'model':db['Tag'],'as':'Tags','attributes':['id',_0x5147('0x1b'),_0x5147('0x62')],'through':{'attributes':[]}}],'order':[[_0x5147('0xde'),_0x5147('0xe4')]]};if(_0x2ec73f[_0x5147('0x1f')]['range']){_0x2a93ef['where'][_0x5147('0xde')]={'$gte':_0x4f5e9e[_0x5147('0x39')],'$lte':_0x4f5e9e['to']};}switch(_0x408be2){case _0x5147('0xc6'):_0x2a93ef[_0x5147('0x7b')][_0x5147('0x5d')]('browserName',_0x5147('0xf0'),_0x5147('0xf1'),_0x5147('0xf2'),_0x5147('0xf3'),_0x5147('0xf4'),_0x5147('0xf5'),_0x5147('0xf6'),_0x5147('0xf7'));break;case _0x5147('0xc5'):_0x2a93ef[_0x5147('0x7b')][_0x5147('0x5d')](_0x5147('0xf8'),_0x5147('0xf9'));break;case _0x5147('0xc8'):_0x2a93ef['attributes'][_0x5147('0x5d')](_0x5147('0xfa'),_0x5147('0xfb'));break;}return db[_[_0x5147('0xe6')](_0x408be2)+_0x5147('0xfc')][_0x5147('0xe5')](_0x2a93ef)['then'](function(_0x4d7442){_0x56f53a[_0x5147('0x14')]+=_0x4d7442[_0x5147('0x14')];return _['map'](_0x4d7442[_0x5147('0x9b')],function(_0xfb9bd0){var _0x43d3fe=_0xfb9bd0['get']({'plain':!![]});_0x43d3fe[_0x5147('0xcd')]=_0x408be2;if(_0x43d3fe['Owner']){_0x43d3fe[_0x5147('0xef')]={'id':_0x43d3fe[_0x5147('0xef')]['id'],'name':_0x43d3fe[_0x5147('0xef')][_0x5147('0x1b')],'fullname':_0x43d3fe[_0x5147('0xef')][_0x5147('0xe3')]};}return _0x43d3fe;});});}});return Promise[_0x5147('0x5f')](_0x8efb26);})[_0x5147('0x21')](function(_0x1abb52){return _(_0x1abb52)[_0x5147('0xfd')]()[_0x5147('0xfe')](_0x5147('0xde'))[_0x5147('0xff')]()[_0x5147('0x100')]();})[_0x5147('0x21')](function(_0x45b581){_0x56f53a[_0x5147('0x9b')]=_0x36f3d5[_0x5147('0x15')]?_0x45b581[_0x5147('0x101')](_0x36f3d5[_0x5147('0x12')],_0x36f3d5[_0x5147('0x12')]+_0x36f3d5[_0x5147('0x15')]):_0x45b581;return _0x56f53a;})[_0x5147('0x21')](respondWithFilteredResult(_0x569cbf,_0x36f3d5))['catch'](handleError(_0x569cbf,null));}; \ No newline at end of file +var _0xc11f=['VoiceCallReport','ChatQueueReport','FaxQueueReport','MailQueueReport','OpenchannelQueueReport','WhatsappMessage','create','isNil','dialTimezone','timezones','utcOffset','additionalPhones','each','duplicates','where','$or','push','findOrCreate','hasOwnProperty','contact','all','Tag','Tags','Phones','ContactItemType','sequelize','literal','Phones.OrderBy','ListId','omit','map','format','cf_%d','pickBy','isEmpty','table','cm_contacts','setFields','toParam','text','phone','CmHopper','getTags','findOne','rawAttributes','filters','intersection','attributes','fields','model','order','sort','pick','filter','merge','options','nolimit','limit','setTags','ids','setAdditionalPhones','OrderBy','items','item_types','ItemTypeId','description','find','contact\x20phone\x20exists','PHONE','CmHopperAdditionalPhone','item','ItemType','`ItemType`.OrderBy','CmHopperId','ItemType.OrderBy','bulkCreate','duplicateAdditionalPhones','fromContactId','CmContactId','toContactId','rescheduleAdditionalPhones','hopperId','count','getHopperHistories','ContactId','includeAll','include','rows','getJscriptySessions','JscriptySessionReport','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','No\x20phone\x20column\x20specified','firstName','No\x20firstName\x20column\x20specified','root','server/files/tmp','chmodSync','0777','child_process','CompanyId','File\x20uploaded\x20correctly!','pid','upload','createReadStream','file','parse','meta','import','User','agent','binding','fork','stringify','message','start\x20child\x20process\x20correctly!','exit','error\x20child\x20process','importUpdates','../../components/import/cm/csvUpdates','mail','openchannel','fax','whatsapp','voice','includes','toLowerCase','Invalid\x20channel','channel','range','isValid','Invalid\x20date\x20for\x20range\x20to\x20filter','uniqueid','source','destination','callerid','starttime','endtime','userDisposition','userSecondDisposition','userThirdDisposition','UserId','fullname','createdAt','startCase','Website','closed','closedAt','disposition','secondDisposition','thirdDisposition','Account','key','color','DESC','chat','browserName','customerIp','customerPort','osName','ratingMessage','substatus','threadId','Interaction','Owner','flatten','sortBy','reverse','slice','bluebird','util','path','lodash','squel','papaparse','ioredis','../../components/contacts','../../components/parsers/qs','../../config/logger','api','../../config/environment','../../mysqldb','redis','localhost','./cmContact.socket','status','json','undefined','offset','set','update','destroy','then','end','sendStatus','error','stack','name','index','describe','getOptions','findAll','catch','CmContact','params','tags','keys','length','startsWith','cf_','displayName','query','analytics','CmCustomField','columnName','alias','custom','values','info','Custom\x20field\x20%s\x20not\x20found\x20on\x20cm_contacts\x20table','forEach','body','from','get','mergeWith','isArray','join','[CmContact][merge]\x20to\x20%s\x20from\x20%s','CmHopperBlack','[CmContact][merge][destroy][CmHopperBlack],\x20%s','ChatInteraction','ChatMessage','ChatOfflineMessage','MailInteraction','SmsMessage','FaxInteraction','FaxMessage','OpenchannelInteraction','OpenchannelMessage','CmContactHasItem','CmHopperFinal','CmHopperHistory'];(function(_0x6e138f,_0x90ce1e){var _0x31d1f9=function(_0x5468da){while(--_0x5468da){_0x6e138f['push'](_0x6e138f['shift']());}};_0x31d1f9(++_0x90ce1e);}(_0xc11f,0x1ad));var _0xfc11=function(_0x3dc656,_0xe58956){_0x3dc656=_0x3dc656-0x0;var _0xe396fb=_0xc11f[_0x3dc656];return _0xe396fb;};'use strict';var moment=require('moment');var BPromise=require(_0xfc11('0x0'));var util=require(_0xfc11('0x1'));var path=require(_0xfc11('0x2'));var fs=require('fs');var _=require(_0xfc11('0x3'));var squel=require(_0xfc11('0x4'));var Papa=require(_0xfc11('0x5'));var Redis=require(_0xfc11('0x6'));var contacts=require(_0xfc11('0x7'));var qs=require(_0xfc11('0x8'));var logger=require(_0xfc11('0x9'))(_0xfc11('0xa'));var config=require(_0xfc11('0xb'));var shared=require('../../config/environment/shared');var db=require(_0xfc11('0xc'))['db'];config[_0xfc11('0xd')]=_['defaults'](config[_0xfc11('0xd')],{'host':_0xfc11('0xe'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xfc11('0xd')]));require(_0xfc11('0xf'))['register'](socket);function respondWithResult(_0x37e9e3,_0x10ad6e){_0x10ad6e=_0x10ad6e||0xc8;return function(_0x596184){if(_0x596184){return _0x37e9e3[_0xfc11('0x10')](_0x10ad6e)[_0xfc11('0x11')](_0x596184);}};}function respondWithFilteredResult(_0x3097a7,_0x1ec8bd){return function(_0x5a0fe7){if(_0x5a0fe7){var _0x196771=typeof _0x1ec8bd['offset']==='undefined'&&typeof _0x1ec8bd['limit']===_0xfc11('0x12');var _0x16a180=_0x5a0fe7['count'];var _0x51c281=_0x196771?0x0:_0x1ec8bd[_0xfc11('0x13')];var _0x3a85c5=_0x196771?_0x5a0fe7['count']:_0x1ec8bd[_0xfc11('0x13')]+_0x1ec8bd['limit'];var _0x3885be;if(_0x3a85c5>=_0x16a180){_0x3a85c5=_0x16a180;_0x3885be=0xc8;}else{_0x3885be=0xce;}_0x3097a7['status'](_0x3885be);return _0x3097a7[_0xfc11('0x14')]('Content-Range',_0x51c281+'-'+_0x3a85c5+'/'+_0x16a180)[_0xfc11('0x11')](_0x5a0fe7);}return null;};}function saveUpdates(_0x4fb403){return function(_0x51c44e){if(_0x51c44e){return _0x51c44e[_0xfc11('0x15')](_0x4fb403)['then'](function(_0x83a7bf){return _0x83a7bf;});}return null;};}function removeEntity(_0x5d1b98){return function(_0x3aaa10){if(_0x3aaa10){return _0x3aaa10[_0xfc11('0x16')]()[_0xfc11('0x17')](function(){_0x5d1b98[_0xfc11('0x10')](0xcc)[_0xfc11('0x18')]();});}};}function handleEntityNotFound(_0x20ea24){return function(_0x2c816d){if(!_0x2c816d){_0x20ea24[_0xfc11('0x19')](0x194);}return _0x2c816d;};}function handleError(_0xda8ad7,_0xa52af4){_0xa52af4=_0xa52af4||0x1f4;return function(_0x4ba387){logger[_0xfc11('0x1a')](_0x4ba387[_0xfc11('0x1b')]);if(_0x4ba387[_0xfc11('0x1c')]){delete _0x4ba387[_0xfc11('0x1c')];}_0xda8ad7['status'](_0xa52af4)['send'](_0x4ba387);};}exports[_0xfc11('0x1d')]=function(_0x3c5cb0,_0x11623f){var _0x5b8da2={};return contacts[_0xfc11('0x1e')]()[_0xfc11('0x17')](function(_0x23da28){_0x5b8da2=qs[_0xfc11('0x1f')](_0x23da28,_0x3c5cb0);return contacts[_0xfc11('0x20')](_0x3c5cb0['query'],_0x3c5cb0['user'],_0x5b8da2,_0x23da28);})[_0xfc11('0x17')](respondWithFilteredResult(_0x11623f,_0x5b8da2))[_0xfc11('0x21')](handleError(_0x11623f,null));};exports[_0xfc11('0x16')]=function(_0x26c0c2,_0x389835){return db[_0xfc11('0x22')]['find']({'where':{'id':_0x26c0c2[_0xfc11('0x23')]['id']}})[_0xfc11('0x17')](handleEntityNotFound(_0x389835,null))[_0xfc11('0x17')](removeEntity(_0x389835,null))[_0xfc11('0x21')](handleError(_0x389835,null));};exports[_0xfc11('0x1e')]=function(_0x5c59f5,_0x59c1bb){return db[_0xfc11('0x22')][_0xfc11('0x1e')]()[_0xfc11('0x17')](function(_0x4e1666){delete _0x4e1666[_0xfc11('0x24')];for(var _0x4f67c8=0x0;_0x4f67c80x0){return new Promise(function(_0x39a8ad){var _0x136ad6=[];for(var _0x52f473=0x0;_0x52f473<_0x5da0a7['length'];_0x52f473++){_0x136ad6['push'](insertAdditionalPhones(_0x5da0a7[_0x52f473][_0xfc11('0x5c')],_0x5da0a7[_0x52f473][_0xfc11('0x54')]));}Promise[_0xfc11('0x5d')](_0x136ad6)[_0xfc11('0x17')](function(){_0x39a8ad(0x1);});})[_0xfc11('0x17')](function(){return{'success':_0xce81e,'failure':_0x315fa1,'duplicates':_0x1ba8ab};});}else{return{'success':_0xce81e,'failure':_0x315fa1,'duplicates':_0x1ba8ab};}}})[_0xfc11('0x17')](respondWithResult(_0x4af39b,0xc9))[_0xfc11('0x21')](handleError(_0x4af39b,null));};exports['show']=function(_0x3ec750,_0x2d11d9){var _0x266c39;return db[_0xfc11('0x22')][_0xfc11('0x1e')]()[_0xfc11('0x17')](function(_0x2b322c){return db[_0xfc11('0x22')]['find']({'where':{'id':_0x3ec750[_0xfc11('0x23')]['id']},'include':[{'model':db[_0xfc11('0x5e')],'as':_0xfc11('0x5f'),'attributes':['id',_0xfc11('0x1c'),'color'],'required':_0x3ec750['query']['tag']?!![]:![]},{'model':db[_0xfc11('0x46')],'as':_0xfc11('0x60'),'where':{'CmContactId':_0x3ec750[_0xfc11('0x23')]['id']},'required':![],'include':[{'model':db[_0xfc11('0x61')],'as':'ItemType'}]}],'order':[db[_0xfc11('0x62')][_0xfc11('0x63')](_0xfc11('0x64'))],'attributes':_[_0xfc11('0x25')](_0x2b322c)});})[_0xfc11('0x17')](function(_0x474fc8){if(!_[_0xfc11('0x50')](_0x474fc8)){_0x266c39=_0x474fc8['get']({'plain':!![]});var _0x4a22a4={'where':{'$and':[{'ListId':{'$ne':null}}]}};if(_0x474fc8&&_0x474fc8[_0xfc11('0x65')]){if(_0x474fc8[_0xfc11('0x65')]){_0x4a22a4[_0xfc11('0x57')]['$and'][_0xfc11('0x59')]({'ListId':{'$ne':_0x474fc8['ListId']}});}}return db['CmCustomField'][_0xfc11('0x20')](_0x4a22a4);}})[_0xfc11('0x17')](function(_0x2f8230){if(!_['isNil'](_0x2f8230)){return _[_0xfc11('0x66')](_0x266c39,_[_0xfc11('0x67')](_0x2f8230,function(_0x56394d){return util[_0xfc11('0x68')](_0xfc11('0x69'),_0x56394d['id']);}));}})[_0xfc11('0x17')](handleEntityNotFound(_0x2d11d9,null))[_0xfc11('0x17')](respondWithResult(_0x2d11d9,null))[_0xfc11('0x21')](handleError(_0x2d11d9,null));};exports[_0xfc11('0x15')]=function(_0x1cb5e4,_0xa3d6f5){var _0x592ff7;if(_0x1cb5e4[_0xfc11('0x34')]['id']){delete _0x1cb5e4['body']['id'];}if(!_[_0xfc11('0x50')](_0x1cb5e4[_0xfc11('0x34')]['dialTimezone'])){var _0x2b796d=_0x1cb5e4[_0xfc11('0x34')][_0xfc11('0x51')];if(!_['isNil'](shared[_0xfc11('0x52')][_0x2b796d]))_0x1cb5e4[_0xfc11('0x34')][_0xfc11('0x53')]=shared['timezones'][_0x2b796d]['utcOffset'];}return db['CmContact']['find']({'where':{'id':_0x1cb5e4[_0xfc11('0x23')]['id']}})[_0xfc11('0x17')](handleEntityNotFound(_0xa3d6f5,null))[_0xfc11('0x17')](saveUpdates(_0x1cb5e4[_0xfc11('0x34')],null))['then'](function(_0xe34886){_0x592ff7=_0xe34886;var _0x4e83fb={'where':{'$and':[{'ListId':{'$ne':null}}]}};if(_0xe34886&&_0xe34886[_0xfc11('0x65')]){if(_0xe34886[_0xfc11('0x65')]){_0x4e83fb[_0xfc11('0x57')]['$and'][_0xfc11('0x59')]({'ListId':{'$ne':_0xe34886[_0xfc11('0x65')]}});}}return db[_0xfc11('0x2c')][_0xfc11('0x20')](_0x4e83fb);})['then'](function(_0x4408b7){if(_0x4408b7){return _[_0xfc11('0x66')](_[_0xfc11('0x6a')](_0x1cb5e4[_0xfc11('0x34')],function(_0x27ef63,_0x2e0977){return _[_0xfc11('0x27')](_0x2e0977,_0xfc11('0x28'));}),_[_0xfc11('0x67')](_0x4408b7,function(_0x34878b){return util['format'](_0xfc11('0x69'),_0x34878b['id']);}));}})[_0xfc11('0x17')](function(_0x25a72a){if(_0x25a72a&&!_[_0xfc11('0x6b')](_0x25a72a)){var _0x50183b=squel[_0xfc11('0x15')]()[_0xfc11('0x6c')](_0xfc11('0x6d'))[_0xfc11('0x6e')](_0x25a72a)[_0xfc11('0x57')]('id\x20=\x20?',_0x1cb5e4[_0xfc11('0x23')]['id'])[_0xfc11('0x6f')]();return db[_0xfc11('0x62')][_0xfc11('0x2a')](_0x50183b[_0xfc11('0x70')],{'replacements':_0x50183b['values']});}})['then'](function(){if(_0x1cb5e4['body'][_0xfc11('0x71')]&&_0x592ff7){return db[_0xfc11('0x72')][_0xfc11('0x15')]({'phone':_0x1cb5e4[_0xfc11('0x34')][_0xfc11('0x71')],'OrderBy':0x0},{'where':{'ContactId':_0x592ff7['id']}});}})[_0xfc11('0x17')](function(){return _0x592ff7;})['then'](respondWithResult(_0xa3d6f5,null))[_0xfc11('0x21')](handleError(_0xa3d6f5,null));};exports[_0xfc11('0x73')]=function(_0x9940,_0x1593d6){var _0x576113={};var _0x3fa5db={};var _0xc6fa9f;var _0x1388d4;return db['CmContact'][_0xfc11('0x74')]({'where':{'id':_0x9940['params']['id']}})[_0xfc11('0x17')](handleEntityNotFound(_0x1593d6,null))[_0xfc11('0x17')](function(_0x2fecb2){if(_0x2fecb2){_0xc6fa9f=_0x2fecb2;_0x3fa5db['model']=_[_0xfc11('0x25')](db[_0xfc11('0x5e')][_0xfc11('0x75')]);_0x3fa5db[_0xfc11('0x2a')]=_['keys'](_0x9940['query']);_0x3fa5db[_0xfc11('0x76')]=_[_0xfc11('0x77')](_0x3fa5db['model'],_0x3fa5db[_0xfc11('0x2a')]);_0x576113[_0xfc11('0x78')]=_[_0xfc11('0x77')](_0x3fa5db['model'],qs[_0xfc11('0x79')](_0x9940[_0xfc11('0x2a')][_0xfc11('0x79')]));_0x576113['attributes']=_0x576113['attributes'][_0xfc11('0x26')]?_0x576113['attributes']:_0x3fa5db[_0xfc11('0x7a')];_0x576113[_0xfc11('0x7b')]=qs['sort'](_0x9940['query'][_0xfc11('0x7c')]);_0x576113[_0xfc11('0x57')]=qs[_0xfc11('0x76')](_[_0xfc11('0x7d')](_0x9940[_0xfc11('0x2a')],_0x3fa5db[_0xfc11('0x76')]));if(_0x9940[_0xfc11('0x2a')][_0xfc11('0x7e')]){_0x576113['where']=_[_0xfc11('0x7f')](_0x576113[_0xfc11('0x57')],{'$or':_[_0xfc11('0x67')](_0x576113[_0xfc11('0x78')],function(_0x37531b){var _0x1aabae={};_0x1aabae[_0x37531b]={'$like':'%'+_0x9940[_0xfc11('0x2a')][_0xfc11('0x7e')]+'%'};return _0x1aabae;})});}_0x576113=_[_0xfc11('0x7f')]({},_0x576113,_0x9940[_0xfc11('0x80')]);return _0xc6fa9f[_0xfc11('0x73')](_0x576113);}})['then'](function(_0x1f0008){if(_0x1f0008){_0x1388d4=_0x1f0008[_0xfc11('0x26')];if(!_0x9940['query'][_0xfc11('0x5b')](_0xfc11('0x81'))){_0x576113['limit']=qs['limit'](_0x9940[_0xfc11('0x2a')][_0xfc11('0x82')]);_0x576113[_0xfc11('0x13')]=qs['offset'](_0x9940[_0xfc11('0x2a')]['offset']);}return _0xc6fa9f[_0xfc11('0x73')](_0x576113);}})[_0xfc11('0x17')](function(_0x38aae6){if(_0x38aae6){return _0x38aae6?{'count':_0x1388d4,'rows':_0x38aae6}:null;}})[_0xfc11('0x17')](respondWithResult(_0x1593d6,null))['catch'](handleError(_0x1593d6,null));};exports[_0xfc11('0x83')]=function(_0x5f56fa,_0x3c77c9){if(_0x5f56fa[_0xfc11('0x34')]['id']){delete _0x5f56fa[_0xfc11('0x34')]['id'];}return db[_0xfc11('0x22')][_0xfc11('0x74')]({'where':{'id':_0x5f56fa['params']['id']}})['then'](handleEntityNotFound(_0x3c77c9,null))['then'](function(_0x1303c2){if(_0x1303c2){return _0x1303c2[_0xfc11('0x83')](_0x5f56fa['body'][_0xfc11('0x84')]||[]);}return null;})[_0xfc11('0x17')](respondWithResult(_0x3c77c9,null))[_0xfc11('0x21')](handleError(_0x3c77c9,null));};exports[_0xfc11('0x85')]=function(_0x461a99,_0x4cc485){var _0x5944f6=[];_0x5944f6['push'](addAdditionalPhones(_0x461a99[_0xfc11('0x34')]));Promise[_0xfc11('0x5d')](_0x5944f6)['then'](function(){_0x5944f6=[];_0x5944f6['push'](deleteCmHopperPhones(_0x461a99[_0xfc11('0x34')]['id']));_0x5944f6[_0xfc11('0x59')](addCmHopperPhones(_0x461a99[_0xfc11('0x34')]['id']));Promise[_0xfc11('0x5d')](_0x5944f6)[_0xfc11('0x17')](function(){return[0x1];})['then'](respondWithResult(_0x4cc485,null));});};function addAdditionalPhones(_0x4e589d){var _0x2fbdd4;return new Promise(function(_0x407128){return db[_0xfc11('0x46')][_0xfc11('0x16')]({'where':{'CmContactId':_0x4e589d['id']}})[_0xfc11('0x17')](function(){db['ContactItemType'][_0xfc11('0x20')]({'raw':!![],'attributes':['id',_0xfc11('0x86')]})[_0xfc11('0x17')](function(_0x583ca0){var _0x2222bf=[];for(var _0x13127c=0x0;_0x13127c<_0x4e589d[_0xfc11('0x87')][_0xfc11('0x26')];_0x13127c++){var _0x261880=_0x4e589d['item_types']?_[_0xfc11('0x50')](_0x4e589d[_0xfc11('0x88')][_0x13127c])?'':_0x4e589d[_0xfc11('0x88')][_0x13127c]:_0x4e589d['items'][_0x13127c][_0xfc11('0x89')]?_0x4e589d[_0xfc11('0x87')][_0x13127c][_0xfc11('0x89')]:'';var _0x4f90a7=_[_0xfc11('0x50')](_0x4e589d[_0xfc11('0x87')][_0x13127c][_0xfc11('0x8a')])?'':_0x4e589d[_0xfc11('0x87')][_0x13127c]['description'];var _0x1245ab=_0x261880+':'+_0x4e589d['items'][_0x13127c][_0xfc11('0x71')]+'§'+_0x4f90a7;if(_[_0xfc11('0x50')](_0x2fbdd4))_0x2fbdd4=_0x1245ab;else _0x2fbdd4+=';'+_0x1245ab;var _0xdc775b=null;var _0x4a2489=null;if(_0x4e589d[_0xfc11('0x88')]){if(!_[_0xfc11('0x50')](_0x4e589d[_0xfc11('0x88')][_0x13127c])){_0x4a2489=_[_0xfc11('0x8b')](_0x583ca0,function(_0x196b26){return _0x196b26['id']===_0x4e589d[_0xfc11('0x88')][_0x13127c];});if(!_[_0xfc11('0x50')](_0x4a2489)){_0xdc775b=_0x4a2489[_0xfc11('0x86')];}}}else{if(!_[_0xfc11('0x50')](_0x4e589d[_0xfc11('0x87')][_0x13127c])){_0x4a2489=_[_0xfc11('0x8b')](_0x583ca0,function(_0x10543e){return _0x10543e['id']===_0x4e589d['items'][_0x13127c][_0xfc11('0x89')];});if(!_['isNil'](_0x4a2489)){_0xdc775b=_0x13127c;}}}if(_[_0xfc11('0x50')](_0xdc775b)){_0xdc775b=0x64;}_0x2222bf[_0xfc11('0x59')](addAdditionalPhone(_0x4e589d['id'],_0x4e589d['items'][_0x13127c][_0xfc11('0x71')],_0x4e589d['item_types']?_[_0xfc11('0x50')](_0x4e589d[_0xfc11('0x88')][_0x13127c])?null:_0x4e589d[_0xfc11('0x88')][_0x13127c]:_0x4e589d[_0xfc11('0x87')][_0x13127c][_0xfc11('0x89')]?_0x4e589d[_0xfc11('0x87')][_0x13127c][_0xfc11('0x89')]:null,_0xdc775b,_0x4f90a7));}Promise[_0xfc11('0x5d')](_0x2222bf)[_0xfc11('0x17')](function(){db['CmContact'][_0xfc11('0x15')]({'AdditionalPhones':_0x2fbdd4},{'where':{'id':_0x4e589d['id']}})[_0xfc11('0x17')](function(){_0x407128(0x1);});});});});});}function addAdditionalPhone(_0x29eb2c,_0x17daf4,_0xe2a747,_0x31c0a1,_0x50bb72){return db['CmContactHasItem'][_0xfc11('0x8b')]({'where':{'CmContactId':_0x29eb2c,'item':_0x17daf4}})[_0xfc11('0x17')](function(_0xcf4943){if(_0xcf4943)logger['info'](_0xfc11('0x8c'),_0xcf4943);else{db[_0xfc11('0x46')][_0xfc11('0x4f')]({'CmContactId':_0x29eb2c,'item':_0x17daf4,'ItemTypeId':_0xe2a747,'OrderBy':_0x31c0a1,'ItemClass':_0xfc11('0x8d'),'description':_0x50bb72});}});}function deleteCmHopperPhones(_0x41f24d){return new Promise(function(_0x4599e1){return db[_0xfc11('0x72')]['findAll']({'raw':!![],'attributes':['id'],'where':{'ContactId':_0x41f24d}})[_0xfc11('0x17')](function(_0x1b2316){db[_0xfc11('0x8e')][_0xfc11('0x16')]({'where':{'CmHopperId':{'$in':_[_0xfc11('0x67')](_0x1b2316,'id')}}});})['then'](function(){_0x4599e1(0x1);});});}function addCmHopperPhones(_0x473240){return new Promise(function(_0x2cc51d){return db[_0xfc11('0x72')][_0xfc11('0x20')]({'raw':!![],'attributes':['id'],'where':{'ContactId':_0x473240}})['then'](function(_0x238a58){var _0x38ba2b=[];_[_0xfc11('0x67')](_0x238a58,function(_0xe6aca1){_0x38ba2b[_0xfc11('0x59')](createCmHopperPhone(_0x473240,_0xe6aca1['id']));});Promise[_0xfc11('0x5d')](_0x38ba2b)[_0xfc11('0x17')](function(){_0x2cc51d(0x1);});});});}function createCmHopperPhone(_0x3c8853,_0x3b3c2){return new Promise(function(_0x19c61c){db[_0xfc11('0x46')][_0xfc11('0x20')]({'raw':!![],'attributes':[_0xfc11('0x8f'),_0xfc11('0x86')],'where':{'CmContactId':_0x3c8853,'ItemClass':_0xfc11('0x8d')},'include':[{'model':db[_0xfc11('0x61')],'attributes':[_0xfc11('0x86')],'as':_0xfc11('0x90')}],'order':[_0xfc11('0x86'),db[_0xfc11('0x62')]['literal'](_0xfc11('0x91'))]})['then'](function(_0x37b81d){var _0xb5b6e=0x1;var _0x48cf64=_['map'](_0x37b81d,function(_0x432f7e){_0x432f7e[_0xfc11('0x92')]=_0x3b3c2;_0x432f7e[_0xfc11('0x71')]=_0x432f7e['item'];_0x432f7e[_0xfc11('0x86')]=_0xb5b6e;delete _0x432f7e[_0xfc11('0x93')];_0xb5b6e=_0xb5b6e+0x1;return _0x432f7e;});return db['CmHopperAdditionalPhone'][_0xfc11('0x94')](_0x48cf64,{});})[_0xfc11('0x17')](function(){_0x19c61c(0x1);});});}function insertAdditionalPhones(_0x158369,_0x4aeca5){return new Promise(function(_0x1b1eca){var _0x5c21fb=[];for(var _0x2b138e=0x0;_0x2b138e<_0x4aeca5['length'];_0x2b138e++){var _0x1cdce7=_0x4aeca5[_0x2b138e];_0x5c21fb['push'](parseContactItemType(_0x1cdce7));}Promise[_0xfc11('0x5d')](_0x5c21fb)[_0xfc11('0x17')](function(){var _0x3f87c0={'id':_0x158369['id'],'items':_0x4aeca5};return addAdditionalPhones(_0x3f87c0)['then'](function(){return addCmHopperPhones(_0x158369['id']);});})[_0xfc11('0x17')](function(){_0x1b1eca(_0x158369);});});}function parseContactItemType(_0x275f15){return new Promise(function(_0x348615){if(_0x275f15[_0xfc11('0x5b')](_0xfc11('0x89'))){_0x348615(_0x275f15);}else{return db['ContactItemType'][_0xfc11('0x8b')]({'where':{'name':_0x275f15[_0xfc11('0x90')]}})[_0xfc11('0x17')](function(_0x21f792){if(_[_0xfc11('0x50')](_0x21f792))_0x275f15['ItemTypeId']=null;else _0x275f15[_0xfc11('0x89')]=_0x21f792['id'];_0x348615(_0x275f15);});}});}exports['getAdditionalPhones']=function(_0x49025b,_0x930b54){return db[_0xfc11('0x46')]['findAll']({'raw':!![],'where':{'CmContactId':_0x49025b['params']['id'],'ItemClass':_0xfc11('0x8d')},'include':[{'model':db[_0xfc11('0x61')],'as':_0xfc11('0x90')}],'order':[[_0xfc11('0x86')],[db['sequelize'][_0xfc11('0x63')](_0xfc11('0x91'))]]})[_0xfc11('0x17')](function(_0x316ef6){return _0x316ef6;})['then'](respondWithResult(_0x930b54,null))['catch'](handleError(_0x930b54,null));};exports[_0xfc11('0x95')]=function(_0x168a52,_0x8bcae6){return db[_0xfc11('0x46')]['findAll']({'raw':!![],'where':{'CmContactId':_0x168a52[_0xfc11('0x34')][_0xfc11('0x96')]}})[_0xfc11('0x17')](function(_0x105e40){var _0x1e7b5c=_[_0xfc11('0x67')](_0x105e40,function(_0x5e98a7){_0x5e98a7[_0xfc11('0x97')]=_0x168a52[_0xfc11('0x34')][_0xfc11('0x98')];return _0x5e98a7;});return db['CmContactHasItem'][_0xfc11('0x94')](_0x1e7b5c,{});})[_0xfc11('0x17')](function(){return addCmHopperPhones(_0x168a52['body'][_0xfc11('0x98')]);})['then'](function(){return['ok'];})[_0xfc11('0x17')](respondWithResult(_0x8bcae6,null))[_0xfc11('0x21')](handleError(_0x8bcae6,null));};exports[_0xfc11('0x99')]=function(_0x3daa53,_0x29bd30){var _0x5701da=[];_0x5701da[_0xfc11('0x59')](createCmHopperPhone(_0x3daa53[_0xfc11('0x34')]['id'],_0x3daa53[_0xfc11('0x34')][_0xfc11('0x9a')]));Promise[_0xfc11('0x5d')](_0x5701da)[_0xfc11('0x17')](function(){return[0x1];})[_0xfc11('0x17')](respondWithResult(_0x29bd30,null));};exports['getHoppers']=function(_0x18a2f4,_0x3e39b5){var _0x18df84={'raw':![],'where':{}};var _0x461a7d={};var _0x1a36da={'count':0x0,'rows':[]};return db[_0xfc11('0x22')][_0xfc11('0x74')]({'where':{'id':_0x18a2f4[_0xfc11('0x23')]['id']}})[_0xfc11('0x17')](handleEntityNotFound(_0x3e39b5,null))[_0xfc11('0x17')](function(_0x1f0f61){if(_0x1f0f61){_0x461a7d[_0xfc11('0x7a')]=_[_0xfc11('0x25')](db[_0xfc11('0x72')][_0xfc11('0x75')]);_0x461a7d[_0xfc11('0x2a')]=_[_0xfc11('0x25')](_0x18a2f4[_0xfc11('0x2a')]);_0x461a7d[_0xfc11('0x76')]=_[_0xfc11('0x77')](_0x461a7d[_0xfc11('0x7a')],_0x461a7d[_0xfc11('0x2a')]);_0x18df84[_0xfc11('0x78')]=_[_0xfc11('0x77')](_0x461a7d[_0xfc11('0x7a')],qs[_0xfc11('0x79')](_0x18a2f4[_0xfc11('0x2a')]['fields']));_0x18df84[_0xfc11('0x78')]=_0x18df84[_0xfc11('0x78')][_0xfc11('0x26')]?_0x18df84[_0xfc11('0x78')]:_0x461a7d[_0xfc11('0x7a')];if(!_0x18a2f4[_0xfc11('0x2a')]['hasOwnProperty'](_0xfc11('0x81'))){_0x18df84[_0xfc11('0x82')]=qs[_0xfc11('0x82')](_0x18a2f4[_0xfc11('0x2a')]['limit']);_0x18df84['offset']=qs[_0xfc11('0x13')](_0x18a2f4['query']['offset']);}_0x18df84[_0xfc11('0x7b')]=qs['sort'](_0x18a2f4[_0xfc11('0x2a')][_0xfc11('0x7c')]);_0x18df84['where']=qs[_0xfc11('0x76')](_['pick'](_0x18a2f4[_0xfc11('0x2a')],_0x461a7d['filters']));_0x18df84['where']['ContactId']=_0x1f0f61['id'];if(_0x18a2f4[_0xfc11('0x2a')][_0xfc11('0x7e')]){_0x18df84[_0xfc11('0x57')]=_[_0xfc11('0x7f')](_0x18df84[_0xfc11('0x57')],{'$or':_[_0xfc11('0x67')](_0x18df84[_0xfc11('0x78')],function(_0x38722e){var _0x1db8a6={};_0x1db8a6[_0x38722e]={'$like':'%'+_0x18a2f4[_0xfc11('0x2a')]['filter']+'%'};return _0x1db8a6;})});}_0x18df84=_[_0xfc11('0x7f')]({},_0x18df84,_0x18a2f4['options']);return db[_0xfc11('0x72')][_0xfc11('0x9b')]({'where':_0x18df84['where']})[_0xfc11('0x17')](function(_0x5f299f){_0x1a36da[_0xfc11('0x9b')]=_0x5f299f;if(_0x18a2f4[_0xfc11('0x2a')]['includeAll']){_0x18df84['include']=[{'all':!![]}];}return db[_0xfc11('0x72')][_0xfc11('0x20')](_0x18df84);})[_0xfc11('0x17')](function(_0x48e55b){_0x1a36da['rows']=_0x48e55b;return _0x1a36da;});}})[_0xfc11('0x17')](respondWithFilteredResult(_0x3e39b5,_0x18df84))[_0xfc11('0x21')](handleError(_0x3e39b5,null));};exports[_0xfc11('0x9c')]=function(_0x126d23,_0xf982b7){var _0x4c9d9b={'raw':!![],'where':{}};var _0x5095d8={};var _0x1e5780={'count':0x0,'rows':[]};return db[_0xfc11('0x22')][_0xfc11('0x74')]({'where':{'id':_0x126d23[_0xfc11('0x23')]['id']}})['then'](handleEntityNotFound(_0xf982b7,null))[_0xfc11('0x17')](function(_0x3975c4){if(_0x3975c4){_0x5095d8['model']=_['keys'](db[_0xfc11('0x48')][_0xfc11('0x75')]);_0x5095d8[_0xfc11('0x2a')]=_[_0xfc11('0x25')](_0x126d23[_0xfc11('0x2a')]);_0x5095d8['filters']=_[_0xfc11('0x77')](_0x5095d8[_0xfc11('0x7a')],_0x5095d8['query']);_0x4c9d9b[_0xfc11('0x78')]=_[_0xfc11('0x77')](_0x5095d8['model'],qs[_0xfc11('0x79')](_0x126d23[_0xfc11('0x2a')]['fields']));_0x4c9d9b[_0xfc11('0x78')]=_0x4c9d9b[_0xfc11('0x78')][_0xfc11('0x26')]?_0x4c9d9b[_0xfc11('0x78')]:_0x5095d8['model'];if(!_0x126d23[_0xfc11('0x2a')][_0xfc11('0x5b')](_0xfc11('0x81'))){_0x4c9d9b[_0xfc11('0x82')]=qs[_0xfc11('0x82')](_0x126d23[_0xfc11('0x2a')]['limit']);_0x4c9d9b[_0xfc11('0x13')]=qs['offset'](_0x126d23[_0xfc11('0x2a')]['offset']);}_0x4c9d9b[_0xfc11('0x7b')]=qs[_0xfc11('0x7c')](_0x126d23[_0xfc11('0x2a')][_0xfc11('0x7c')]);_0x4c9d9b[_0xfc11('0x57')]=qs['filters'](_[_0xfc11('0x7d')](_0x126d23[_0xfc11('0x2a')],_0x5095d8['filters']));_0x4c9d9b['where'][_0xfc11('0x9d')]=_0x3975c4['id'];if(_0x126d23[_0xfc11('0x2a')][_0xfc11('0x7e')]){_0x4c9d9b[_0xfc11('0x57')]=_['merge'](_0x4c9d9b[_0xfc11('0x57')],{'$or':_[_0xfc11('0x67')](_0x4c9d9b[_0xfc11('0x78')],function(_0x1959f0){var _0x5180a8={};_0x5180a8[_0x1959f0]={'$like':'%'+_0x126d23[_0xfc11('0x2a')][_0xfc11('0x7e')]+'%'};return _0x5180a8;})});}_0x4c9d9b=_['merge']({},_0x4c9d9b,_0x126d23['options']);return db[_0xfc11('0x48')][_0xfc11('0x9b')]({'where':_0x4c9d9b['where']})[_0xfc11('0x17')](function(_0x46f85e){_0x1e5780[_0xfc11('0x9b')]=_0x46f85e;if(_0x126d23[_0xfc11('0x2a')][_0xfc11('0x9e')]){_0x4c9d9b[_0xfc11('0x9f')]=[{'all':!![]}];}return db[_0xfc11('0x48')]['findAll'](_0x4c9d9b);})['then'](function(_0x53292e){_0x1e5780[_0xfc11('0xa0')]=_0x53292e;return _0x1e5780;});}})[_0xfc11('0x17')](respondWithFilteredResult(_0xf982b7,_0x4c9d9b))[_0xfc11('0x21')](handleError(_0xf982b7,null));};exports['getHopperFinals']=function(_0x2b222e,_0x405d55){var _0x57b620={'raw':!![],'where':{}};var _0x1bae9c={};var _0xddd4c3={'count':0x0,'rows':[]};return db['CmContact'][_0xfc11('0x74')]({'where':{'id':_0x2b222e[_0xfc11('0x23')]['id']}})[_0xfc11('0x17')](handleEntityNotFound(_0x405d55,null))[_0xfc11('0x17')](function(_0xb5612d){if(_0xb5612d){_0x1bae9c[_0xfc11('0x7a')]=_[_0xfc11('0x25')](db[_0xfc11('0x47')]['rawAttributes']);_0x1bae9c[_0xfc11('0x2a')]=_['keys'](_0x2b222e['query']);_0x1bae9c[_0xfc11('0x76')]=_['intersection'](_0x1bae9c[_0xfc11('0x7a')],_0x1bae9c[_0xfc11('0x2a')]);_0x57b620['attributes']=_['intersection'](_0x1bae9c['model'],qs['fields'](_0x2b222e[_0xfc11('0x2a')][_0xfc11('0x79')]));_0x57b620[_0xfc11('0x78')]=_0x57b620['attributes'][_0xfc11('0x26')]?_0x57b620[_0xfc11('0x78')]:_0x1bae9c[_0xfc11('0x7a')];if(!_0x2b222e[_0xfc11('0x2a')]['hasOwnProperty'](_0xfc11('0x81'))){_0x57b620['limit']=qs[_0xfc11('0x82')](_0x2b222e['query'][_0xfc11('0x82')]);_0x57b620[_0xfc11('0x13')]=qs['offset'](_0x2b222e['query']['offset']);}_0x57b620[_0xfc11('0x7b')]=qs[_0xfc11('0x7c')](_0x2b222e[_0xfc11('0x2a')][_0xfc11('0x7c')]);_0x57b620['where']=qs['filters'](_[_0xfc11('0x7d')](_0x2b222e[_0xfc11('0x2a')],_0x1bae9c[_0xfc11('0x76')]));_0x57b620['where']['ContactId']=_0xb5612d['id'];if(_0x2b222e[_0xfc11('0x2a')]['filter']){_0x57b620[_0xfc11('0x57')]=_[_0xfc11('0x7f')](_0x57b620[_0xfc11('0x57')],{'$or':_['map'](_0x57b620[_0xfc11('0x78')],function(_0x551f34){var _0xb59039={};_0xb59039[_0x551f34]={'$like':'%'+_0x2b222e[_0xfc11('0x2a')][_0xfc11('0x7e')]+'%'};return _0xb59039;})});}_0x57b620=_[_0xfc11('0x7f')]({},_0x57b620,_0x2b222e[_0xfc11('0x80')]);return db[_0xfc11('0x47')][_0xfc11('0x9b')]({'where':_0x57b620[_0xfc11('0x57')]})[_0xfc11('0x17')](function(_0x4f049c){_0xddd4c3[_0xfc11('0x9b')]=_0x4f049c;if(_0x2b222e[_0xfc11('0x2a')]['includeAll']){_0x57b620['include']=[{'all':!![]}];}return db[_0xfc11('0x47')][_0xfc11('0x20')](_0x57b620);})[_0xfc11('0x17')](function(_0x4ff78b){_0xddd4c3[_0xfc11('0xa0')]=_0x4ff78b;return _0xddd4c3;});}})['then'](respondWithFilteredResult(_0x405d55,_0x57b620))[_0xfc11('0x21')](handleError(_0x405d55,null));};exports[_0xfc11('0xa1')]=function(_0x10a721,_0x5dc9ff){var _0x2d714c={'raw':!![],'where':{}};var _0x3b5ee1={};var _0x4e53f5={'count':0x0,'rows':[]};return db['CmContact'][_0xfc11('0x74')]({'where':{'id':_0x10a721[_0xfc11('0x23')]['id']}})[_0xfc11('0x17')](handleEntityNotFound(_0x5dc9ff,null))['then'](function(_0x44eb76){if(_0x44eb76){_0x3b5ee1[_0xfc11('0x7a')]=_[_0xfc11('0x25')](db[_0xfc11('0xa2')][_0xfc11('0x75')]);_0x3b5ee1[_0xfc11('0x2a')]=_[_0xfc11('0x25')](_0x10a721['query']);_0x3b5ee1[_0xfc11('0x76')]=_['intersection'](_0x3b5ee1[_0xfc11('0x7a')],_0x3b5ee1[_0xfc11('0x2a')]);_0x2d714c[_0xfc11('0x78')]=_['intersection'](_0x3b5ee1[_0xfc11('0x7a')],qs[_0xfc11('0x79')](_0x10a721[_0xfc11('0x2a')][_0xfc11('0x79')]));_0x2d714c[_0xfc11('0x78')]=_0x2d714c[_0xfc11('0x78')][_0xfc11('0x26')]?_0x2d714c[_0xfc11('0x78')]:_0x3b5ee1[_0xfc11('0x7a')];if(!_0x10a721['query'][_0xfc11('0x5b')]('nolimit')){_0x2d714c[_0xfc11('0x82')]=qs[_0xfc11('0x82')](_0x10a721[_0xfc11('0x2a')][_0xfc11('0x82')]);_0x2d714c[_0xfc11('0x13')]=qs[_0xfc11('0x13')](_0x10a721[_0xfc11('0x2a')][_0xfc11('0x13')]);}_0x2d714c[_0xfc11('0x7b')]=qs['sort'](_0x10a721['query'][_0xfc11('0x7c')]);_0x2d714c['where']=qs[_0xfc11('0x76')](_['pick'](_0x10a721[_0xfc11('0x2a')],_0x3b5ee1[_0xfc11('0x76')]));_0x2d714c[_0xfc11('0x57')]['ContactId']=_0x44eb76['id'];if(_0x10a721[_0xfc11('0x2a')][_0xfc11('0x7e')]){_0x2d714c[_0xfc11('0x57')]=_['merge'](_0x2d714c[_0xfc11('0x57')],{'$or':_['map'](_0x2d714c[_0xfc11('0x78')],function(_0x32109f){var _0x3c0df2={};_0x3c0df2[_0x32109f]={'$like':'%'+_0x10a721['query'][_0xfc11('0x7e')]+'%'};return _0x3c0df2;})});}_0x2d714c=_[_0xfc11('0x7f')]({},_0x2d714c,_0x10a721[_0xfc11('0x80')]);return db[_0xfc11('0xa2')]['count']({'where':_0x2d714c[_0xfc11('0x57')]})[_0xfc11('0x17')](function(_0x51e58f){_0x4e53f5[_0xfc11('0x9b')]=_0x51e58f;if(_0x10a721[_0xfc11('0x2a')][_0xfc11('0x9e')]){_0x2d714c[_0xfc11('0x9f')]=[{'all':!![]}];}return db[_0xfc11('0xa2')][_0xfc11('0x20')](_0x2d714c);})[_0xfc11('0x17')](function(_0x2ee1ef){_0x4e53f5[_0xfc11('0xa0')]=_0x2ee1ef;return _0x4e53f5;});}})[_0xfc11('0x17')](respondWithFilteredResult(_0x5dc9ff,_0x2d714c))['catch'](handleError(_0x5dc9ff,null));};exports[_0xfc11('0xa3')]=function(_0x2cdc9b,_0xb3d8d2){try{if(!_0x2cdc9b[_0xfc11('0x34')][_0xfc11('0x65')]){throw new Error(_0xfc11('0xa4'));}if(!_0x2cdc9b['body'][_0xfc11('0xa5')]){throw new Error(_0xfc11('0xa6'));}if(!_0x2cdc9b[_0xfc11('0x34')][_0xfc11('0xa7')]){throw new Error(_0xfc11('0xa8'));}if(!_0x2cdc9b[_0xfc11('0x34')][_0xfc11('0xa9')]){throw new Error(_0xfc11('0xaa'));}var _0x2da108=_0x2cdc9b[_0xfc11('0x34')][_0xfc11('0xa5')][_0xfc11('0xab')](',');var _0x29ba3c=_0x2cdc9b[_0xfc11('0x34')][_0xfc11('0xa7')]['split'](',');if(!_0x2da108[_0xfc11('0x26')]||!_0x29ba3c['length']||_0x2da108[_0xfc11('0x26')]!==_0x29ba3c[_0xfc11('0x26')]){throw new Error(_0xfc11('0xac'));}_0x2cdc9b[_0xfc11('0x34')][_0xfc11('0x79')]=_[_0xfc11('0xad')](_0x2da108,_0x29ba3c);if(!_0x2cdc9b[_0xfc11('0x34')][_0xfc11('0x79')][_0xfc11('0x71')]){throw new Error(_0xfc11('0xae'));}if(!_0x2cdc9b[_0xfc11('0x34')][_0xfc11('0x79')][_0xfc11('0xaf')]){throw new Error(_0xfc11('0xb0'));}var _0xac7452=path[_0xfc11('0x39')](config[_0xfc11('0xb1')],_0xfc11('0xb2'),_0x2cdc9b['file']['filename']);fs[_0xfc11('0xb3')](_0xac7452,parseInt(_0xfc11('0xb4'),0x8));var _0x282d09=require(_0xfc11('0xb5'))['fork'](path[_0xfc11('0x39')](__dirname,'../../components/import/cm/csv'),[_0xac7452,_0x2cdc9b['body'][_0xfc11('0xa5')],_0x2cdc9b[_0xfc11('0x34')][_0xfc11('0xa7')],_0x2cdc9b[_0xfc11('0x34')][_0xfc11('0x65')],_0x2cdc9b[_0xfc11('0x34')][_0xfc11('0xb6')],_0x2cdc9b[_0xfc11('0x34')][_0xfc11('0x56')],_0x2cdc9b[_0xfc11('0x34')][_0xfc11('0xa9')]]);return _0xb3d8d2[_0xfc11('0x10')](0xc8)[_0xfc11('0x11')]({'message':_0xfc11('0xb7'),'pid':_0x282d09[_0xfc11('0xb8')]});}catch(_0x4d8d0a){return _0xb3d8d2[_0xfc11('0x10')](0x1f4)['send'](_0x4d8d0a);}};exports[_0xfc11('0xb9')]=function(_0x1fe69a,_0x503caf){var _0x59340b=fs[_0xfc11('0xba')](_0x1fe69a[_0xfc11('0xbb')][_0xfc11('0x2')]);Papa[_0xfc11('0xbc')](_0x59340b,{'header':!![],'skipEmptyLines':!![],'preview':0x1,'complete':function(_0x11697f){return _0x503caf[_0xfc11('0x10')](0xc8)[_0xfc11('0x11')]({'file':_0x1fe69a[_0xfc11('0xbb')],'fields':_0x11697f[_0xfc11('0xbd')]['fields']});}});};exports[_0xfc11('0xbe')]=function(_0x32b4b1,_0x2cd1a0){return db[_0xfc11('0xbf')]['findAll']({'raw':!![],'attributes':['id'],'where':{'role':_0xfc11('0xc0')}})['then'](function(_0x2b1d81){var _0x58497a=![];if(!_0x32b4b1['body']['ListId']){throw new Error(_0xfc11('0xa4'));}if(!_0x32b4b1[_0xfc11('0x34')][_0xfc11('0xc1')][_0xfc11('0x71')]){throw new Error(_0xfc11('0xae'));}if(!_0x32b4b1[_0xfc11('0x34')][_0xfc11('0xc1')]['firstName']){throw new Error('No\x20firstName\x20column\x20specified');}if(!_0x32b4b1['body'][_0xfc11('0xa9')]){throw new Error(_0xfc11('0xaa'));}var _0x26cf9c=require('child_process')[_0xfc11('0xc2')](path[_0xfc11('0x39')](__dirname,'../../components/import/cm/csv2'),[_0x32b4b1[_0xfc11('0x23')]['id'],JSON[_0xfc11('0xc3')](_0x32b4b1['body']),JSON[_0xfc11('0xc3')](_0x2b1d81)]);_0x26cf9c['on'](_0xfc11('0xc4'),function(){_0x58497a=!![];return _0x2cd1a0['status'](0xc8)[_0xfc11('0x11')]({'message':_0xfc11('0xc5'),'pid':_0x26cf9c[_0xfc11('0xb8')]});});_0x26cf9c['on'](_0xfc11('0xc6'),function(_0x1a2d1b){if(_0x1a2d1b&&!_0x58497a){return _0x2cd1a0[_0xfc11('0x10')](0x1f4)[_0xfc11('0x11')]({'message':_0xfc11('0xc7'),'pid':_0x26cf9c[_0xfc11('0xb8')]});}});})[_0xfc11('0x21')](handleError(_0x2cd1a0,null));};exports[_0xfc11('0xc8')]=function(_0x4ef366,_0x44c26c){return db[_0xfc11('0xbf')]['findAll']({'raw':!![],'attributes':['id'],'where':{'role':_0xfc11('0xc0')}})['then'](function(_0x4ffc0c){var _0x469365=![];if(!_0x4ef366[_0xfc11('0x34')][_0xfc11('0x65')]){throw new Error('No\x20ListId\x20specified');}if(!_0x4ef366[_0xfc11('0x34')][_0xfc11('0xc1')][_0xfc11('0x71')]){throw new Error(_0xfc11('0xae'));}if(!_0x4ef366[_0xfc11('0x34')][_0xfc11('0xc1')][_0xfc11('0xaf')]){throw new Error(_0xfc11('0xb0'));}if(!_0x4ef366[_0xfc11('0x34')]['socket_timestamp']){throw new Error(_0xfc11('0xaa'));}var _0x3e3b33=require(_0xfc11('0xb5'))[_0xfc11('0xc2')](path[_0xfc11('0x39')](__dirname,_0xfc11('0xc9')),[_0x4ef366['params']['id'],JSON[_0xfc11('0xc3')](_0x4ef366[_0xfc11('0x34')]),JSON[_0xfc11('0xc3')](_0x4ffc0c)]);_0x3e3b33['on'](_0xfc11('0xc4'),function(){_0x469365=!![];return _0x44c26c[_0xfc11('0x10')](0xc8)[_0xfc11('0x11')]({'message':_0xfc11('0xc5'),'pid':_0x3e3b33[_0xfc11('0xb8')]});});_0x3e3b33['on']('exit',function(_0x2414e3){if(_0x2414e3&&!_0x469365){return _0x44c26c[_0xfc11('0x10')](0x1f4)[_0xfc11('0x11')]({'message':_0xfc11('0xc7'),'pid':_0x3e3b33[_0xfc11('0xb8')]});}});})[_0xfc11('0x21')](handleError(_0x44c26c,null));};exports['getJourney']=function(_0x230063,_0x2137ca){var _0x5cae4b=[_0xfc11('0xca'),'chat','sms',_0xfc11('0xcb'),_0xfc11('0xcc'),_0xfc11('0xcd'),_0xfc11('0xce')];var _0x51b4b1={'offset':0x0,'order':qs['sort']('-createdAt')},_0x1097c8={'count':0x0,'rows':[]};Promise['resolve']()[_0xfc11('0x17')](function(){if(_0x230063[_0xfc11('0x2a')]['channel']){if(!_[_0xfc11('0xcf')](_0x5cae4b,_0x230063[_0xfc11('0x2a')]['channel'][_0xfc11('0xd0')]())){throw new Error(_0xfc11('0xd1'));}_0x5cae4b=[_0x230063['query'][_0xfc11('0xd2')][_0xfc11('0xd0')]()];}if(_0x230063[_0xfc11('0x2a')][_0xfc11('0xd3')]){try{var _0x2c8e84=JSON[_0xfc11('0xbc')](_0x230063[_0xfc11('0x2a')][_0xfc11('0xd3')]);if(!moment(_0x2c8e84[_0xfc11('0x35')])[_0xfc11('0xd4')]()){throw new Error('Invalid\x20date\x20for\x20range\x20from\x20filter');}if(!moment(_0x2c8e84['to'])[_0xfc11('0xd4')]()){throw new Error(_0xfc11('0xd5'));}}catch(_0x497746){throw new Error('Invalid\x20createdAt\x20filter');}}if(!_0x230063[_0xfc11('0x2a')][_0xfc11('0x5b')](_0xfc11('0x81'))){_0x51b4b1[_0xfc11('0x82')]=qs[_0xfc11('0x82')](_0x230063[_0xfc11('0x2a')][_0xfc11('0x82')]||0xa);_0x51b4b1['offset']=qs['offset'](_0x230063[_0xfc11('0x2a')][_0xfc11('0x13')]);}var _0x5841bb=_0x5cae4b['map'](function(_0x5d6df2){if(_0x5d6df2===_0xfc11('0xce')){var _0x423010={'attributes':['id',_0xfc11('0xd6'),'type',_0xfc11('0xd7'),_0xfc11('0xd8'),_0xfc11('0xd9'),_0xfc11('0xda'),_0xfc11('0xdb'),'duration','note','createdAt',_0xfc11('0xdc'),_0xfc11('0xdd'),_0xfc11('0xde'),_0xfc11('0xdf')],'where':{'ContactId':_0x230063['params']['id']},'include':[{'model':db['User'],'as':_0xfc11('0xbf'),'attributes':['id','name',_0xfc11('0xe0'),_0xfc11('0x2e')]}],'order':[[_0xfc11('0xe1'),'DESC']]};if(_0x230063['query'][_0xfc11('0xd3')]){_0x423010[_0xfc11('0x57')][_0xfc11('0xe1')]={'$gte':_0x2c8e84[_0xfc11('0x35')],'$lte':_0x2c8e84['to']};}return db[_0xfc11('0x49')]['findAndCountAll'](_0x423010)[_0xfc11('0x17')](function(_0x78287a){_0x1097c8[_0xfc11('0x9b')]+=_0x78287a[_0xfc11('0x9b')];return _[_0xfc11('0x67')](_0x78287a[_0xfc11('0xa0')],function(_0xdeabe8){var _0x491c0e=_0xdeabe8[_0xfc11('0x36')]({'plain':!![]});_0x491c0e[_0xfc11('0xd2')]=_0x5d6df2;if(_0x491c0e[_0xfc11('0xbf')]){_0x491c0e['User']={'id':_0x491c0e['User']['id'],'name':_0x491c0e[_0xfc11('0xbf')][_0xfc11('0x1c')],'fullname':_0x491c0e[_0xfc11('0xbf')][_0xfc11('0xe0')],'alias':_0x491c0e[_0xfc11('0xbf')][_0xfc11('0x2e')]};}return _0x491c0e;});});}else{var _0x52d967=_[_0xfc11('0xe2')](_0x5d6df2)+(_0x5d6df2==='chat'?_0xfc11('0xe3'):'Account');var _0x21c04d={'attributes':['id',_0xfc11('0xe4'),_0xfc11('0xe5'),_0xfc11('0xe1'),'note',_0xfc11('0xe6'),_0xfc11('0xe7'),_0xfc11('0xe8'),_0xfc11('0xdf'),_0x52d967+'Id'],'where':{'ContactId':_0x230063[_0xfc11('0x23')]['id']},'include':[{'model':db[_0x52d967],'as':_0xfc11('0xe9'),'attributes':['id','name',_0xfc11('0xea')]},{'model':db[_0xfc11('0xbf')],'as':'Owner','attributes':['id',_0xfc11('0x1c'),'fullname']},{'model':db[_0xfc11('0x5e')],'as':'Tags','attributes':['id','name',_0xfc11('0xeb')],'through':{'attributes':[]}}],'order':[[_0xfc11('0xe1'),_0xfc11('0xec')]]};if(_0x230063[_0xfc11('0x2a')][_0xfc11('0xd3')]){_0x21c04d[_0xfc11('0x57')][_0xfc11('0xe1')]={'$gte':_0x2c8e84[_0xfc11('0x35')],'$lte':_0x2c8e84['to']};}switch(_0x5d6df2){case _0xfc11('0xed'):_0x21c04d[_0xfc11('0x78')][_0xfc11('0x59')](_0xfc11('0xee'),_0xfc11('0xef'),_0xfc11('0xf0'),'deviceModel',_0xfc11('0xf1'),_0xfc11('0xf2'),'ratingType','ratingValue','referer');break;case _0xfc11('0xca'):_0x21c04d[_0xfc11('0x78')][_0xfc11('0x59')]('subject',_0xfc11('0xf3'));break;case _0xfc11('0xcb'):_0x21c04d['attributes'][_0xfc11('0x59')]('externalUrl',_0xfc11('0xf4'));break;}return db[_[_0xfc11('0xe2')](_0x5d6df2)+_0xfc11('0xf5')]['findAndCountAll'](_0x21c04d)[_0xfc11('0x17')](function(_0x2f0472){_0x1097c8[_0xfc11('0x9b')]+=_0x2f0472[_0xfc11('0x9b')];return _['map'](_0x2f0472['rows'],function(_0x571e70){var _0x106d50=_0x571e70[_0xfc11('0x36')]({'plain':!![]});_0x106d50[_0xfc11('0xd2')]=_0x5d6df2;if(_0x106d50[_0xfc11('0xf6')]){_0x106d50[_0xfc11('0xf6')]={'id':_0x106d50['Owner']['id'],'name':_0x106d50[_0xfc11('0xf6')][_0xfc11('0x1c')],'fullname':_0x106d50['Owner'][_0xfc11('0xe0')]};}return _0x106d50;});});}});return Promise[_0xfc11('0x5d')](_0x5841bb);})[_0xfc11('0x17')](function(_0x9c1fbf){return _(_0x9c1fbf)[_0xfc11('0xf7')]()[_0xfc11('0xf8')](_0xfc11('0xe1'))[_0xfc11('0xf9')]()['value']();})[_0xfc11('0x17')](function(_0x128cfb){_0x1097c8['rows']=_0x51b4b1[_0xfc11('0x82')]?_0x128cfb[_0xfc11('0xfa')](_0x51b4b1[_0xfc11('0x13')],_0x51b4b1[_0xfc11('0x13')]+_0x51b4b1['limit']):_0x128cfb;return _0x1097c8;})[_0xfc11('0x17')](respondWithFilteredResult(_0x2137ca,_0x51b4b1))[_0xfc11('0x21')](handleError(_0x2137ca,null));}; \ No newline at end of file diff --git a/server/api/cmContact/cmContact.events.js b/server/api/cmContact/cmContact.events.js index e90e51b..d15fefc 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 _0x5783=['update','emit','hasOwnProperty','hook','exports','../../mysqldb','CmContact','setMaxListeners','save'];(function(_0x99868f,_0xbdb8e7){var _0x27a71b=function(_0x41feca){while(--_0x41feca){_0x99868f['push'](_0x99868f['shift']());}};_0x27a71b(++_0xbdb8e7);}(_0x5783,0x10a));var _0x3578=function(_0x5f025f,_0x420828){_0x5f025f=_0x5f025f-0x0;var _0x5c1c62=_0x5783[_0x5f025f];return _0x5c1c62;};'use strict';var EventEmitter=require('events');var CmContact=require(_0x3578('0x0'))['db'][_0x3578('0x1')];var CmContactEvents=new EventEmitter();CmContactEvents[_0x3578('0x2')](0x0);var events={'afterCreate':_0x3578('0x3'),'afterUpdate':_0x3578('0x4'),'afterDestroy':'remove'};function emitEvent(_0x4261bf){return function(_0x29a184,_0x318363,_0x176d08){CmContactEvents['emit'](_0x4261bf+':'+_0x29a184['id'],_0x29a184);CmContactEvents[_0x3578('0x5')](_0x4261bf,_0x29a184);_0x176d08(null);};}for(var e in events){if(events[_0x3578('0x6')](e)){var event=events[e];CmContact[_0x3578('0x7')](e,emitEvent(event));}}module[_0x3578('0x8')]=CmContactEvents; \ No newline at end of file +var _0xa74a=['remove','emit','hook','exports','events','../../mysqldb','setMaxListeners'];(function(_0x48344c,_0x54a262){var _0x1ca70e=function(_0x2f3697){while(--_0x2f3697){_0x48344c['push'](_0x48344c['shift']());}};_0x1ca70e(++_0x54a262);}(_0xa74a,0x1d2));var _0xaa74=function(_0x29c02a,_0x5f1741){_0x29c02a=_0x29c02a-0x0;var _0x269c11=_0xa74a[_0x29c02a];return _0x269c11;};'use strict';var EventEmitter=require(_0xaa74('0x0'));var CmContact=require(_0xaa74('0x1'))['db']['CmContact'];var CmContactEvents=new EventEmitter();CmContactEvents[_0xaa74('0x2')](0x0);var events={'afterCreate':'save','afterUpdate':'update','afterDestroy':_0xaa74('0x3')};function emitEvent(_0x5826df){return function(_0x450112,_0x2adb70,_0x1f7800){CmContactEvents[_0xaa74('0x4')](_0x5826df+':'+_0x450112['id'],_0x450112);CmContactEvents[_0xaa74('0x4')](_0x5826df,_0x450112);_0x1f7800(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];CmContact[_0xaa74('0x5')](e,emitEvent(event));}}module[_0xaa74('0x6')]=CmContactEvents; \ No newline at end of file diff --git a/server/api/cmContact/cmContact.model.js b/server/api/cmContact/cmContact.model.js index d8f3c0b..aa31d59 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 _0xe2be=['error','cmContact','inspect','scheduledat','YYYY-MM-DD\x20HH:mm:ss','isNil','dialTimezone','VoiceQueue','findOne','utcOffset','add','format','then','ret','CmHopper','\x20contact\x20not\x20insert\x20in\x20hopper,\x20check\x20duplicate\x20onlyIfOpen,\x20exist\x20in\x20hopper\x20VoiceQueue\x20','create','priority','callbackUniqueid','catch','cmContact,\x20afterCreate\x20','\x20contact\x20not\x20insert\x20in\x20hopper,\x20check\x20duplicate\x20always,\x20exist\x20in\x20hopper\x20VoiceQueue\x20','\x20contact\x20not\x20insert\x20in\x20hopper,\x20check\x20duplicate\x20always,\x20exist\x20in\x20hopperFinal\x20VoiceQueue\x20','ListId','afterCreate','Campaign','timezones','minutes','\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','cmContact,\x20afterCreate,\x20','\x20contact\x20not\x20insert\x20in\x20hopper,\x20check\x20duplicate\x20always,\x20exist\x20in\x20hopperFinal\x20Campaign\x20','findAll','outbound','dialCheckDuplicateType','CmList','Lists','onlyIfOpen','BlackLists','cmContact,\x20%s,\x20%s','message','length','models','isEmpty','destroy','ContactId','VoiceQueueId','CampaignId','push','all','info','[CmContact][afterDestroy][Succesfull]','[CmContact][afterDestroy][Error]','lodash','util','../../config/logger','api','bluebird','request-promise','./cmContact.attributes','define','CmContact','cm_contacts','phone','firstName','lastName','mobile','fax','email','utf8mb4','get'];(function(_0x9b26d6,_0x58533f){var _0x56d6e9=function(_0x5ebd89){while(--_0x5ebd89){_0x9b26d6['push'](_0x9b26d6['shift']());}};_0x56d6e9(++_0x58533f);}(_0xe2be,0x7e));var _0xee2b=function(_0x1eda20,_0x1149f4){_0x1eda20=_0x1eda20-0x0;var _0x31b953=_0xe2be[_0x1eda20];return _0x31b953;};'use strict';var _=require(_0xee2b('0x0'));var util=require(_0xee2b('0x1'));var logger=require(_0xee2b('0x2'))(_0xee2b('0x3'));var moment=require('moment');var BPromise=require(_0xee2b('0x4'));var rp=require(_0xee2b('0x5'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require('../../config/environment');var shared=require('../../config/environment/shared');var attributes=require(_0xee2b('0x6'));module['exports']=function(_0x2a58be,_0x2c6afd){return _0x2a58be[_0xee2b('0x7')](_0xee2b('0x8'),attributes,{'tableName':_0xee2b('0x9'),'paranoid':!![],'indexes':[{'name':_0xee2b('0xa'),'fields':[_0xee2b('0xa')]},{'name':'fti_cm_contacts','fields':[_0xee2b('0xb'),_0xee2b('0xc'),_0xee2b('0xa'),_0xee2b('0xd'),_0xee2b('0xe'),_0xee2b('0xf')],'type':'FULLTEXT'}],'timestamps':!![],'charset':_0xee2b('0x10'),'collate':'utf8mb4_unicode_ci','hooks':{'afterCreate':function(_0x56f9a9,_0x35e1bc,_0x4ee06c){var _0xb3d00=_0x2a58be['models'];var _0x4837ed=_0x56f9a9[_0xee2b('0x11')]({'plain':!![]});function _0x54e9e4(){return function(_0x35565a){logger[_0xee2b('0x12')](_0xee2b('0x13'),'afterCreate',util[_0xee2b('0x14')](_0x35565a,{'showHidden':![],'depth':null}));};}function _0x526672(_0xe1744a,_0x591c20){var _0x31c02e=_0x591c20[_0xee2b('0x15')]?_0x591c20[_0xee2b('0x15')]:moment()['format'](_0xee2b('0x16'));return new BPromise(function(_0x5a9cd5,_0x411956){if(_[_0xee2b('0x17')](_0x591c20[_0xee2b('0x18')])){_0x5a9cd5({'ret':_0x31c02e});}else{_0xb3d00[_0xee2b('0x19')][_0xee2b('0x1a')]({'where':{'id':_0xe1744a['id']}})['then'](function(_0x397efc){if(!_['isNil'](_0x397efc)){var _0x231809=_0x397efc[_0xee2b('0x18')];if(!_[_0xee2b('0x17')](_0x231809)){var _0x5017ea=shared['timezones'];var _0x5b681a=_0x5017ea[_0x231809];var _0x360974=_0x5017ea[_0x591c20[_0xee2b('0x18')]];if(!_[_0xee2b('0x17')](_0x5b681a)&&!_['isNil'](_0x360974)){var _0x3aae3f=_0x5b681a['utcOffset']-_0x360974[_0xee2b('0x1b')];_0x31c02e=_0x591c20['scheduledat']?_0x591c20['scheduledat']:moment();var _0x50dc29=moment(_0x31c02e)[_0xee2b('0x1c')](_0x3aae3f,'minutes');_0x5a9cd5({'ret':_0x50dc29[_0xee2b('0x1d')](_0xee2b('0x16'))});}else _0x5a9cd5({'ret':_0x31c02e});}else _0x5a9cd5({'ret':_0x31c02e});}else{_0x5a9cd5({'ret':_0x31c02e});}});}});return 0xa;}var _0x2f8bbb=function(_0x5257b4){return new BPromise(function(_0x56c51e,_0x342b70){_0x526672(_0x5257b4,_0x4837ed)[_0xee2b('0x1e')](function(_0x5545b0){_0x4837ed[_0xee2b('0x15')]=_0x5545b0[_0xee2b('0x1f')];_0xb3d00[_0xee2b('0x20')][_0xee2b('0x1a')]({'where':{'phone':_0x4837ed[_0xee2b('0xa')],'VoiceQueueId':_0x5257b4['id']}})[_0xee2b('0x1e')](function(_0x4ca697){if(!_[_0xee2b('0x17')](_0x4ca697)){throw new Error('cmContact,\x20afterCreate\x20'+_0x4837ed[_0xee2b('0xa')]+_0xee2b('0x21')+_0x5257b4['id']);}return _0xb3d00[_0xee2b('0x20')][_0xee2b('0x22')]({'phone':_0x4837ed['phone'],'ContactId':_0x4837ed['id'],'ListId':_0x4837ed['ListId'],'priority':_0x4837ed['priority']?_0x4837ed[_0xee2b('0x23')]:0x2,'scheduledat':_0x4837ed['scheduledat']?_0x4837ed[_0xee2b('0x15')]:moment()[_0xee2b('0x1d')](_0xee2b('0x16')),'callback':_0x4837ed[_0xee2b('0x24')]?!![]:![],'callbackuniqueid':_0x4837ed['callbackUniqueid']?_0x4837ed[_0xee2b('0x24')]:undefined,'callbackat':_0x4837ed['callbackUniqueid']?moment()[_0xee2b('0x1d')](_0xee2b('0x16')):undefined,'VoiceQueueId':_0x5257b4['id']});})[_0xee2b('0x25')](function(_0x34169a){_0x342b70(_0x34169a);});});});};var _0x5db987=function(_0x39ab51){return new BPromise(function(_0x55db1a,_0x2d95e5){_0x526672(_0x39ab51,_0x4837ed)[_0xee2b('0x1e')](function(_0x227822){_0x4837ed[_0xee2b('0x15')]=_0x227822['ret'];_0xb3d00[_0xee2b('0x20')]['findOne']({'where':{'phone':_0x4837ed[_0xee2b('0xa')],'VoiceQueueId':_0x39ab51['id']}})[_0xee2b('0x1e')](function(_0x4a29ef){if(!_[_0xee2b('0x17')](_0x4a29ef)){throw new Error(_0xee2b('0x26')+_0x4837ed[_0xee2b('0xa')]+_0xee2b('0x27')+_0x39ab51['id']);}return _0xb3d00['CmHopperFinal'][_0xee2b('0x1a')]({'where':{'calleridnum':_0x4837ed['phone'],'VoiceQueueId':_0x39ab51['id']}});})['then'](function(_0x688235){if(!_[_0xee2b('0x17')](_0x688235)){throw new Error('cmContact,\x20afterCreate,\x20'+_0x4837ed[_0xee2b('0xa')]+_0xee2b('0x28')+_0x39ab51['id']);}return _0xb3d00[_0xee2b('0x20')][_0xee2b('0x22')]({'phone':_0x4837ed[_0xee2b('0xa')],'ContactId':_0x4837ed['id'],'ListId':_0x4837ed[_0xee2b('0x29')],'priority':_0x4837ed[_0xee2b('0x23')]?_0x4837ed[_0xee2b('0x23')]:0x2,'scheduledat':_0x4837ed[_0xee2b('0x15')]?_0x4837ed['scheduledat']:moment()[_0xee2b('0x1d')](_0xee2b('0x16')),'callback':_0x4837ed['callbackUniqueid']?!![]:![],'callbackuniqueid':_0x4837ed[_0xee2b('0x24')]?_0x4837ed[_0xee2b('0x24')]:undefined,'callbackat':_0x4837ed[_0xee2b('0x24')]?moment()[_0xee2b('0x1d')](_0xee2b('0x16')):undefined,'VoiceQueueId':_0x39ab51['id']});})[_0xee2b('0x25')](function(_0x10956d){_0x2d95e5(_0x10956d);});});});};function _0x665187(){return function(_0x4427d4){logger[_0xee2b('0x12')](_0xee2b('0x13'),_0xee2b('0x2a'),util['inspect'](_0x4427d4,{'showHidden':![],'depth':null}));};}function _0x2aa99c(_0x16ec81,_0x5f21d0){var _0x2ec057=_0x5f21d0[_0xee2b('0x15')]?_0x5f21d0[_0xee2b('0x15')]:moment()[_0xee2b('0x1d')](_0xee2b('0x16'));return new BPromise(function(_0x14b863,_0x24be28){if(_['isNil'](_0x5f21d0[_0xee2b('0x18')])){_0x14b863({'ret':_0x2ec057});}else{_0xb3d00[_0xee2b('0x2b')][_0xee2b('0x1a')]({'where':{'id':_0x16ec81['id']}})[_0xee2b('0x1e')](function(_0x4a6670){if(!_[_0xee2b('0x17')](_0x4a6670)){var _0x2382d7=_0x4a6670['dialTimezone'];if(!_['isNil'](_0x2382d7)){var _0x58a2b4=shared[_0xee2b('0x2c')];var _0x414e37=_0x58a2b4[_0x2382d7];var _0x58560c=_0x58a2b4[_0x5f21d0[_0xee2b('0x18')]];if(!_[_0xee2b('0x17')](_0x414e37)&&!_[_0xee2b('0x17')](_0x58560c)){var _0x2c96f7=_0x414e37[_0xee2b('0x1b')]-_0x58560c[_0xee2b('0x1b')];_0x2ec057=_0x5f21d0[_0xee2b('0x15')]?_0x5f21d0[_0xee2b('0x15')]:moment();var _0x4dc02a=moment(_0x2ec057)[_0xee2b('0x1c')](_0x2c96f7,_0xee2b('0x2d'));_0x14b863({'ret':_0x4dc02a[_0xee2b('0x1d')](_0xee2b('0x16'))});}else _0x14b863({'ret':_0x2ec057});}else _0x14b863({'ret':_0x2ec057});}else{_0x14b863({'ret':_0x2ec057});}});}});return 0xa;}var _0x3a39fe=function(_0x64e797){return new BPromise(function(_0x19fc55,_0x54724a){_0x2aa99c(_0x64e797,_0x4837ed)['then'](function(_0x5be343){_0x4837ed[_0xee2b('0x15')]=_0x5be343['ret'];_0xb3d00[_0xee2b('0x20')][_0xee2b('0x1a')]({'where':{'phone':_0x4837ed['phone'],'CampaignId':_0x64e797['id']}})[_0xee2b('0x1e')](function(_0xf9db44){if(!_[_0xee2b('0x17')](_0xf9db44)){throw new Error(_0xee2b('0x26')+_0x4837ed[_0xee2b('0xa')]+_0xee2b('0x2e')+_0x64e797['id']);}return _0xb3d00[_0xee2b('0x20')][_0xee2b('0x22')]({'phone':_0x4837ed[_0xee2b('0xa')],'ContactId':_0x4837ed['id'],'ListId':_0x4837ed[_0xee2b('0x29')],'priority':_0x4837ed[_0xee2b('0x23')]?_0x4837ed[_0xee2b('0x23')]:0x2,'scheduledat':_0x4837ed[_0xee2b('0x15')]?_0x4837ed[_0xee2b('0x15')]:moment()[_0xee2b('0x1d')](_0xee2b('0x16')),'callback':_0x4837ed[_0xee2b('0x24')]?!![]:![],'callbackuniqueid':_0x4837ed['callbackUniqueid']?_0x4837ed[_0xee2b('0x24')]:undefined,'callbackat':_0x4837ed[_0xee2b('0x24')]?moment()[_0xee2b('0x1d')](_0xee2b('0x16')):undefined,'CampaignId':_0x64e797['id']});})[_0xee2b('0x25')](function(_0x4f83ae){_0x54724a(_0x4f83ae);});});});};var _0x53d040=function(_0x172e24){return new BPromise(function(_0x1f54be,_0x5ae0f9){_0x2aa99c(_0x172e24,_0x4837ed)[_0xee2b('0x1e')](function(_0x1ed19b){_0x4837ed[_0xee2b('0x15')]=_0x1ed19b[_0xee2b('0x1f')];_0xb3d00[_0xee2b('0x20')]['findOne']({'where':{'phone':_0x4837ed['phone'],'CampaignId':_0x172e24['id']}})[_0xee2b('0x1e')](function(_0x1422da){if(!_[_0xee2b('0x17')](_0x1422da)){throw new Error('cmContact,\x20afterCreate\x20'+_0x4837ed['phone']+_0xee2b('0x2f')+_0x172e24['id']);}return _0xb3d00[_0xee2b('0x30')]['findOne']({'where':{'calleridnum':_0x4837ed[_0xee2b('0xa')],'CampaignId':_0x172e24['id']}});})[_0xee2b('0x1e')](function(_0x407d59){if(!_[_0xee2b('0x17')](_0x407d59)){throw new Error(_0xee2b('0x31')+_0x4837ed[_0xee2b('0xa')]+_0xee2b('0x32')+_0x172e24['id']);}return _0xb3d00[_0xee2b('0x20')]['create']({'phone':_0x4837ed['phone'],'ContactId':_0x4837ed['id'],'ListId':_0x4837ed[_0xee2b('0x29')],'priority':_0x4837ed[_0xee2b('0x23')]?_0x4837ed[_0xee2b('0x23')]:0x2,'scheduledat':_0x4837ed[_0xee2b('0x15')]?_0x4837ed[_0xee2b('0x15')]:moment()['format'](_0xee2b('0x16')),'callback':_0x4837ed[_0xee2b('0x24')]?!![]:![],'callbackuniqueid':_0x4837ed['callbackUniqueid']?_0x4837ed['callbackUniqueid']:undefined,'callbackat':_0x4837ed['callbackUniqueid']?moment()[_0xee2b('0x1d')](_0xee2b('0x16')):undefined,'CampaignId':_0x172e24['id']});})['catch'](function(_0x303efa){_0x5ae0f9(_0x303efa);});});});};if(_0x4837ed[_0xee2b('0x29')]){_0xb3d00[_0xee2b('0x19')][_0xee2b('0x33')]({'where':{'type':_0xee2b('0x34')},'attributes':['id',_0xee2b('0x35'),_0xee2b('0x18')],'include':[{'model':_0xb3d00[_0xee2b('0x36')],'as':_0xee2b('0x37'),'where':{'id':_0x4837ed['ListId']}}]})['then'](function(_0xa5a38b){if(_0xa5a38b){var _0x20a7d8=[];for(var _0x3a0ff2=0x0,_0x401502;_0x3a0ff2<_0xa5a38b['length'];_0x3a0ff2+=0x1){_0x401502=_0xa5a38b[_0x3a0ff2][_0xee2b('0x11')]({'plain':!![]});switch(_0x401502[_0xee2b('0x35')]){case'always':_0x5db987(_0x401502)['catch'](_0x54e9e4());break;case _0xee2b('0x38'):_0x2f8bbb(_0x401502)[_0xee2b('0x25')](_0x54e9e4());break;default:_0x2aa99c(_0x401502,_0x4837ed)[_0xee2b('0x1e')](function(_0x42087c){_0x4837ed[_0xee2b('0x15')]=_0x42087c[_0xee2b('0x1f')];_0xb3d00['CmHopper'][_0xee2b('0x22')]({'phone':_0x4837ed['phone'],'ContactId':_0x4837ed['id'],'ListId':_0x4837ed[_0xee2b('0x29')],'scheduledat':_0x4837ed[_0xee2b('0x15')]?_0x4837ed['scheduledat']:moment()[_0xee2b('0x1d')](_0xee2b('0x16')),'priority':_0x4837ed['priority']?_0x4837ed[_0xee2b('0x23')]:0x2,'callback':_0x4837ed['callbackUniqueid']?!![]:![],'callbackuniqueid':_0x4837ed['callbackUniqueid']?_0x4837ed[_0xee2b('0x24')]:undefined,'callbackat':_0x4837ed[_0xee2b('0x24')]?moment()[_0xee2b('0x1d')](_0xee2b('0x16')):undefined,'VoiceQueueId':_0x401502['id']})[_0xee2b('0x25')](_0x54e9e4());});}}}})[_0xee2b('0x1e')](function(){return _0xb3d00['VoiceQueue']['findAll']({'where':{'type':_0xee2b('0x34')},'attributes':['id'],'include':[{'model':_0xb3d00[_0xee2b('0x36')],'as':_0xee2b('0x39'),'where':{'id':_0x4837ed[_0xee2b('0x29')]}}]})[_0xee2b('0x1e')](function(_0x20b28a){if(_0x20b28a){var _0x1448df=[];for(var _0x1da935=0x0,_0x1050dd;_0x1da935<_0x20b28a['length'];_0x1da935+=0x1){_0x1050dd=_0x20b28a[_0x1da935][_0xee2b('0x11')]({'plain':!![]});_0xb3d00['CmHopperBlack'][_0xee2b('0x22')]({'phone':_0x4837ed[_0xee2b('0xa')],'ContactId':_0x4837ed['id'],'ListId':_0x4837ed[_0xee2b('0x29')],'VoiceQueueId':_0x1050dd['id']})['catch'](function(_0xfa9d55){logger['error'](_0xee2b('0x3a'),'afterCreate',_0xfa9d55[_0xee2b('0x3b')]);});}}});})[_0xee2b('0x1e')](function(){return _0xb3d00[_0xee2b('0x2b')][_0xee2b('0x33')]({'attributes':['id',_0xee2b('0x35'),_0xee2b('0x18')],'include':[{'model':_0xb3d00['CmList'],'as':_0xee2b('0x37'),'where':{'id':_0x4837ed['ListId']}}]})[_0xee2b('0x1e')](function(_0x42cc88){if(_0x42cc88){var _0x1c6a92=[];for(var _0x53fabb=0x0,_0x118c57;_0x53fabb<_0x42cc88[_0xee2b('0x3c')];_0x53fabb+=0x1){_0x118c57=_0x42cc88[_0x53fabb]['get']({'plain':!![]});switch(_0x118c57['dialCheckDuplicateType']){case'always':_0x53d040(_0x118c57)[_0xee2b('0x25')](_0x665187());break;case _0xee2b('0x38'):_0x3a39fe(_0x118c57)['catch'](_0x665187());break;default:_0xb3d00[_0xee2b('0x20')][_0xee2b('0x22')]({'phone':_0x4837ed[_0xee2b('0xa')],'ContactId':_0x4837ed['id'],'ListId':_0x4837ed[_0xee2b('0x29')],'scheduledat':_0x4837ed[_0xee2b('0x15')]?_0x4837ed[_0xee2b('0x15')]:moment()[_0xee2b('0x1d')](_0xee2b('0x16')),'priority':_0x4837ed[_0xee2b('0x23')]?_0x4837ed[_0xee2b('0x23')]:0x2,'callback':_0x4837ed[_0xee2b('0x24')]?!![]:![],'callbackuniqueid':_0x4837ed[_0xee2b('0x24')]?_0x4837ed[_0xee2b('0x24')]:undefined,'callbackat':_0x4837ed[_0xee2b('0x24')]?moment()[_0xee2b('0x1d')](_0xee2b('0x16')):undefined,'CampaignId':_0x118c57['id']})[_0xee2b('0x25')](_0x665187());}}}});})[_0xee2b('0x1e')](function(){return _0xb3d00[_0xee2b('0x2b')][_0xee2b('0x33')]({'attributes':['id'],'include':[{'model':_0xb3d00[_0xee2b('0x36')],'as':_0xee2b('0x39'),'where':{'id':_0x4837ed[_0xee2b('0x29')]}}]})[_0xee2b('0x1e')](function(_0x2fba3c){if(_0x2fba3c){var _0x117e32=[];for(var _0x3537e0=0x0,_0x1c137e;_0x3537e0<_0x2fba3c[_0xee2b('0x3c')];_0x3537e0+=0x1){_0x1c137e=_0x2fba3c[_0x3537e0][_0xee2b('0x11')]({'plain':!![]});_0xb3d00['CmHopperBlack'][_0xee2b('0x22')]({'phone':_0x4837ed[_0xee2b('0xa')],'ContactId':_0x4837ed['id'],'ListId':_0x4837ed[_0xee2b('0x29')],'CampaignId':_0x1c137e['id']})[_0xee2b('0x25')](function(_0x5490da){logger[_0xee2b('0x12')](_0xee2b('0x3a'),_0xee2b('0x2a'),_0x5490da[_0xee2b('0x3b')]);});}}});})[_0xee2b('0x1e')](function(){_0x4ee06c();})[_0xee2b('0x25')](function(_0x40f1ec){logger['error'](_0xee2b('0x3a'),'afterCreate',_0x40f1ec[_0xee2b('0x3b')]);_0x4ee06c(_0x40f1ec);});}else{_0x4ee06c(new Error('List\x20not\x20found'));}},'afterDestroy':function(_0x1157df,_0x3e1ea1,_0x4c64b7){var _0x5074b0=_0x2a58be[_0xee2b('0x3d')];var _0x1e0015=_0x1157df[_0xee2b('0x11')]({'plain':!![]});return _0x5074b0[_0xee2b('0x20')][_0xee2b('0x33')]({'raw':!![],'where':{'ListId':_0x1e0015['ListId'],'ContactId':_0x1e0015['id']}})[_0xee2b('0x1e')](function(_0x5ed8fe){if(!_[_0xee2b('0x3e')](_0x5ed8fe)){var _0x12f4c6=[];for(var _0x2818cf=0x0;_0x2818cf<_0x5ed8fe[_0xee2b('0x3c')];_0x2818cf+=0x1){var _0xe16431=_0x5074b0[_0xee2b('0x20')][_0xee2b('0x3f')]({'where':{'ListId':_0x5ed8fe[_0x2818cf][_0xee2b('0x29')],'ContactId':_0x5ed8fe[_0x2818cf][_0xee2b('0x40')],'VoiceQueueId':_0x5ed8fe[_0x2818cf][_0xee2b('0x41')],'CampaignId':_0x5ed8fe[_0x2818cf][_0xee2b('0x42')]}});_0x12f4c6[_0xee2b('0x43')](_0xe16431);}return BPromise[_0xee2b('0x44')](_0x12f4c6);}})[_0xee2b('0x1e')](function(_0x4659ce){logger[_0xee2b('0x45')](_0xee2b('0x46'),util[_0xee2b('0x14')](_0x4659ce,{'showHidden':![],'depth':null}));_0x4c64b7();})[_0xee2b('0x25')](function(_0x3b81d8){logger[_0xee2b('0x12')](_0xee2b('0x47'),util[_0xee2b('0x14')](_0x3b81d8,{'showHidden':![],'depth':null}));_0x4c64b7(_0x3b81d8);});}}});}; \ No newline at end of file +var _0xfebe=['mobile','fax','email','FULLTEXT','utf8mb4','utf8mb4_unicode_ci','models','error','cmContact','afterCreate','inspect','scheduledat','format','YYYY-MM-DD\x20HH:mm:ss','then','isNil','timezones','dialTimezone','utcOffset','add','minutes','ret','CmHopper','cmContact,\x20afterCreate\x20','create','ListId','priority','callbackUniqueid','catch','findOne','\x20contact\x20not\x20insert\x20in\x20hopper,\x20check\x20duplicate\x20always,\x20exist\x20in\x20hopper\x20VoiceQueue\x20','CmHopperFinal','\x20contact\x20not\x20insert\x20in\x20hopper,\x20check\x20duplicate\x20always,\x20exist\x20in\x20hopperFinal\x20VoiceQueue\x20','\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','get','always','VoiceQueue','findAll','BlackLists','cmContact,\x20%s,\x20%s','message','Campaign','Lists','length','onlyIfOpen','CmHopperBlack','List\x20not\x20found','isEmpty','destroy','ContactId','CampaignId','push','all','info','[CmContact][afterDestroy][Succesfull]','[CmContact][afterDestroy][Error]','lodash','util','../../config/logger','moment','bluebird','request-promise','rimraf','../../config/environment','../../config/environment/shared','CmContact','cm_contacts','phone','fti_cm_contacts','firstName','lastName'];(function(_0x44760c,_0x7759e5){var _0x7137d1=function(_0x483880){while(--_0x483880){_0x44760c['push'](_0x44760c['shift']());}};_0x7137d1(++_0x7759e5);}(_0xfebe,0x1b9));var _0xefeb=function(_0x2fa488,_0x408715){_0x2fa488=_0x2fa488-0x0;var _0x1ec0a9=_0xfebe[_0x2fa488];return _0x1ec0a9;};'use strict';var _=require(_0xefeb('0x0'));var util=require(_0xefeb('0x1'));var logger=require(_0xefeb('0x2'))('api');var moment=require(_0xefeb('0x3'));var BPromise=require(_0xefeb('0x4'));var rp=require(_0xefeb('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0xefeb('0x6'));var config=require(_0xefeb('0x7'));var shared=require(_0xefeb('0x8'));var attributes=require('./cmContact.attributes');module['exports']=function(_0x45fcfa,_0x1bf27c){return _0x45fcfa['define'](_0xefeb('0x9'),attributes,{'tableName':_0xefeb('0xa'),'paranoid':!![],'indexes':[{'name':'phone','fields':[_0xefeb('0xb')]},{'name':_0xefeb('0xc'),'fields':[_0xefeb('0xd'),_0xefeb('0xe'),_0xefeb('0xb'),_0xefeb('0xf'),_0xefeb('0x10'),_0xefeb('0x11')],'type':_0xefeb('0x12')}],'timestamps':!![],'charset':_0xefeb('0x13'),'collate':_0xefeb('0x14'),'hooks':{'afterCreate':function(_0x3aee23,_0x393b84,_0x2d52d){var _0xdcb3e6=_0x45fcfa[_0xefeb('0x15')];var _0x599afb=_0x3aee23['get']({'plain':!![]});function _0x17a247(){return function(_0x85eb69){logger[_0xefeb('0x16')](_0xefeb('0x17'),_0xefeb('0x18'),util[_0xefeb('0x19')](_0x85eb69,{'showHidden':![],'depth':null}));};}function _0x15ab82(_0x3f6cbc,_0x481722){var _0x2c6b55=_0x481722[_0xefeb('0x1a')]?_0x481722[_0xefeb('0x1a')]:moment()[_0xefeb('0x1b')](_0xefeb('0x1c'));return new BPromise(function(_0x3a6ff0,_0x4efd64){if(_['isNil'](_0x481722['dialTimezone'])){_0x3a6ff0({'ret':_0x2c6b55});}else{_0xdcb3e6['VoiceQueue']['findOne']({'where':{'id':_0x3f6cbc['id']}})[_0xefeb('0x1d')](function(_0x1891cd){if(!_['isNil'](_0x1891cd)){var _0x439e72=_0x1891cd['dialTimezone'];if(!_[_0xefeb('0x1e')](_0x439e72)){var _0x3dc1eb=shared[_0xefeb('0x1f')];var _0x423a47=_0x3dc1eb[_0x439e72];var _0x15cb9f=_0x3dc1eb[_0x481722[_0xefeb('0x20')]];if(!_[_0xefeb('0x1e')](_0x423a47)&&!_[_0xefeb('0x1e')](_0x15cb9f)){var _0x400d27=_0x423a47[_0xefeb('0x21')]-_0x15cb9f[_0xefeb('0x21')];_0x2c6b55=_0x481722['scheduledat']?_0x481722[_0xefeb('0x1a')]:moment();var _0x42ac87=moment(_0x2c6b55)[_0xefeb('0x22')](_0x400d27,_0xefeb('0x23'));_0x3a6ff0({'ret':_0x42ac87[_0xefeb('0x1b')](_0xefeb('0x1c'))});}else _0x3a6ff0({'ret':_0x2c6b55});}else _0x3a6ff0({'ret':_0x2c6b55});}else{_0x3a6ff0({'ret':_0x2c6b55});}});}});return 0xa;}var _0x310793=function(_0x308c83){return new BPromise(function(_0x3fe6c3,_0x3fc5f0){_0x15ab82(_0x308c83,_0x599afb)[_0xefeb('0x1d')](function(_0x7e4961){_0x599afb[_0xefeb('0x1a')]=_0x7e4961[_0xefeb('0x24')];_0xdcb3e6[_0xefeb('0x25')]['findOne']({'where':{'phone':_0x599afb['phone'],'VoiceQueueId':_0x308c83['id']}})['then'](function(_0x4cad4c){if(!_[_0xefeb('0x1e')](_0x4cad4c)){throw new Error(_0xefeb('0x26')+_0x599afb[_0xefeb('0xb')]+'\x20contact\x20not\x20insert\x20in\x20hopper,\x20check\x20duplicate\x20onlyIfOpen,\x20exist\x20in\x20hopper\x20VoiceQueue\x20'+_0x308c83['id']);}return _0xdcb3e6[_0xefeb('0x25')][_0xefeb('0x27')]({'phone':_0x599afb[_0xefeb('0xb')],'ContactId':_0x599afb['id'],'ListId':_0x599afb[_0xefeb('0x28')],'priority':_0x599afb[_0xefeb('0x29')]?_0x599afb[_0xefeb('0x29')]:0x2,'scheduledat':_0x599afb[_0xefeb('0x1a')]?_0x599afb['scheduledat']:moment()[_0xefeb('0x1b')](_0xefeb('0x1c')),'callback':_0x599afb[_0xefeb('0x2a')]?!![]:![],'callbackuniqueid':_0x599afb[_0xefeb('0x2a')]?_0x599afb['callbackUniqueid']:undefined,'callbackat':_0x599afb[_0xefeb('0x2a')]?moment()['format'](_0xefeb('0x1c')):undefined,'VoiceQueueId':_0x308c83['id']});})[_0xefeb('0x2b')](function(_0x3e1575){_0x3fc5f0(_0x3e1575);});});});};var _0x550dec=function(_0x454773){return new BPromise(function(_0x160237,_0x4eca96){_0x15ab82(_0x454773,_0x599afb)['then'](function(_0x12482f){_0x599afb['scheduledat']=_0x12482f['ret'];_0xdcb3e6['CmHopper'][_0xefeb('0x2c')]({'where':{'phone':_0x599afb[_0xefeb('0xb')],'VoiceQueueId':_0x454773['id']}})[_0xefeb('0x1d')](function(_0x1a86c2){if(!_[_0xefeb('0x1e')](_0x1a86c2)){throw new Error(_0xefeb('0x26')+_0x599afb['phone']+_0xefeb('0x2d')+_0x454773['id']);}return _0xdcb3e6[_0xefeb('0x2e')][_0xefeb('0x2c')]({'where':{'calleridnum':_0x599afb[_0xefeb('0xb')],'VoiceQueueId':_0x454773['id']}});})[_0xefeb('0x1d')](function(_0x4fc4d0){if(!_[_0xefeb('0x1e')](_0x4fc4d0)){throw new Error('cmContact,\x20afterCreate,\x20'+_0x599afb[_0xefeb('0xb')]+_0xefeb('0x2f')+_0x454773['id']);}return _0xdcb3e6['CmHopper'][_0xefeb('0x27')]({'phone':_0x599afb[_0xefeb('0xb')],'ContactId':_0x599afb['id'],'ListId':_0x599afb[_0xefeb('0x28')],'priority':_0x599afb[_0xefeb('0x29')]?_0x599afb[_0xefeb('0x29')]:0x2,'scheduledat':_0x599afb['scheduledat']?_0x599afb[_0xefeb('0x1a')]:moment()[_0xefeb('0x1b')](_0xefeb('0x1c')),'callback':_0x599afb[_0xefeb('0x2a')]?!![]:![],'callbackuniqueid':_0x599afb['callbackUniqueid']?_0x599afb[_0xefeb('0x2a')]:undefined,'callbackat':_0x599afb[_0xefeb('0x2a')]?moment()[_0xefeb('0x1b')](_0xefeb('0x1c')):undefined,'VoiceQueueId':_0x454773['id']});})[_0xefeb('0x2b')](function(_0xf7c458){_0x4eca96(_0xf7c458);});});});};function _0x167e91(){return function(_0x10bfd8){logger[_0xefeb('0x16')](_0xefeb('0x17'),_0xefeb('0x18'),util[_0xefeb('0x19')](_0x10bfd8,{'showHidden':![],'depth':null}));};}function _0x3e0e14(_0x3787a2,_0x10272f){var _0x4e5732=_0x10272f['scheduledat']?_0x10272f[_0xefeb('0x1a')]:moment()[_0xefeb('0x1b')](_0xefeb('0x1c'));return new BPromise(function(_0x5b492e,_0x98bcce){if(_[_0xefeb('0x1e')](_0x10272f[_0xefeb('0x20')])){_0x5b492e({'ret':_0x4e5732});}else{_0xdcb3e6['Campaign'][_0xefeb('0x2c')]({'where':{'id':_0x3787a2['id']}})[_0xefeb('0x1d')](function(_0x311318){if(!_[_0xefeb('0x1e')](_0x311318)){var _0x11192f=_0x311318[_0xefeb('0x20')];if(!_['isNil'](_0x11192f)){var _0x21f196=shared[_0xefeb('0x1f')];var _0x462370=_0x21f196[_0x11192f];var _0x6d2e09=_0x21f196[_0x10272f[_0xefeb('0x20')]];if(!_[_0xefeb('0x1e')](_0x462370)&&!_[_0xefeb('0x1e')](_0x6d2e09)){var _0xf7b7a6=_0x462370[_0xefeb('0x21')]-_0x6d2e09['utcOffset'];_0x4e5732=_0x10272f[_0xefeb('0x1a')]?_0x10272f[_0xefeb('0x1a')]:moment();var _0x287813=moment(_0x4e5732)[_0xefeb('0x22')](_0xf7b7a6,'minutes');_0x5b492e({'ret':_0x287813[_0xefeb('0x1b')](_0xefeb('0x1c'))});}else _0x5b492e({'ret':_0x4e5732});}else _0x5b492e({'ret':_0x4e5732});}else{_0x5b492e({'ret':_0x4e5732});}});}});return 0xa;}var _0x41dd5d=function(_0x181f51){return new BPromise(function(_0x94a5e0,_0x20330c){_0x3e0e14(_0x181f51,_0x599afb)[_0xefeb('0x1d')](function(_0x3e2560){_0x599afb['scheduledat']=_0x3e2560['ret'];_0xdcb3e6[_0xefeb('0x25')]['findOne']({'where':{'phone':_0x599afb[_0xefeb('0xb')],'CampaignId':_0x181f51['id']}})['then'](function(_0x3f8d91){if(!_[_0xefeb('0x1e')](_0x3f8d91)){throw new Error(_0xefeb('0x26')+_0x599afb['phone']+'\x20contact\x20not\x20insert\x20in\x20hopper,\x20check\x20duplicate\x20onlyIfOpen,\x20exist\x20in\x20hopper\x20Campaign\x20'+_0x181f51['id']);}return _0xdcb3e6[_0xefeb('0x25')][_0xefeb('0x27')]({'phone':_0x599afb['phone'],'ContactId':_0x599afb['id'],'ListId':_0x599afb[_0xefeb('0x28')],'priority':_0x599afb[_0xefeb('0x29')]?_0x599afb['priority']:0x2,'scheduledat':_0x599afb[_0xefeb('0x1a')]?_0x599afb[_0xefeb('0x1a')]:moment()[_0xefeb('0x1b')](_0xefeb('0x1c')),'callback':_0x599afb['callbackUniqueid']?!![]:![],'callbackuniqueid':_0x599afb[_0xefeb('0x2a')]?_0x599afb[_0xefeb('0x2a')]:undefined,'callbackat':_0x599afb[_0xefeb('0x2a')]?moment()['format']('YYYY-MM-DD\x20HH:mm:ss'):undefined,'CampaignId':_0x181f51['id']});})[_0xefeb('0x2b')](function(_0x1f2127){_0x20330c(_0x1f2127);});});});};var _0x199499=function(_0x12066c){return new BPromise(function(_0x487bcf,_0x325e47){_0x3e0e14(_0x12066c,_0x599afb)[_0xefeb('0x1d')](function(_0x35f5d1){_0x599afb['scheduledat']=_0x35f5d1['ret'];_0xdcb3e6[_0xefeb('0x25')]['findOne']({'where':{'phone':_0x599afb['phone'],'CampaignId':_0x12066c['id']}})[_0xefeb('0x1d')](function(_0x5aff8c){if(!_[_0xefeb('0x1e')](_0x5aff8c)){throw new Error(_0xefeb('0x26')+_0x599afb['phone']+_0xefeb('0x30')+_0x12066c['id']);}return _0xdcb3e6[_0xefeb('0x2e')][_0xefeb('0x2c')]({'where':{'calleridnum':_0x599afb[_0xefeb('0xb')],'CampaignId':_0x12066c['id']}});})[_0xefeb('0x1d')](function(_0x330b0e){if(!_[_0xefeb('0x1e')](_0x330b0e)){throw new Error(_0xefeb('0x31')+_0x599afb['phone']+_0xefeb('0x32')+_0x12066c['id']);}return _0xdcb3e6[_0xefeb('0x25')]['create']({'phone':_0x599afb[_0xefeb('0xb')],'ContactId':_0x599afb['id'],'ListId':_0x599afb[_0xefeb('0x28')],'priority':_0x599afb[_0xefeb('0x29')]?_0x599afb[_0xefeb('0x29')]:0x2,'scheduledat':_0x599afb[_0xefeb('0x1a')]?_0x599afb[_0xefeb('0x1a')]:moment()['format'](_0xefeb('0x1c')),'callback':_0x599afb[_0xefeb('0x2a')]?!![]:![],'callbackuniqueid':_0x599afb[_0xefeb('0x2a')]?_0x599afb['callbackUniqueid']:undefined,'callbackat':_0x599afb['callbackUniqueid']?moment()[_0xefeb('0x1b')](_0xefeb('0x1c')):undefined,'CampaignId':_0x12066c['id']});})[_0xefeb('0x2b')](function(_0xffe2d1){_0x325e47(_0xffe2d1);});});});};if(_0x599afb[_0xefeb('0x28')]){_0xdcb3e6['VoiceQueue']['findAll']({'where':{'type':_0xefeb('0x33')},'attributes':['id',_0xefeb('0x34'),'dialTimezone'],'include':[{'model':_0xdcb3e6[_0xefeb('0x35')],'as':'Lists','where':{'id':_0x599afb['ListId']}}]})[_0xefeb('0x1d')](function(_0x39703b){if(_0x39703b){var _0x4e5f1e=[];for(var _0x58ea8d=0x0,_0x2593fb;_0x58ea8d<_0x39703b['length'];_0x58ea8d+=0x1){_0x2593fb=_0x39703b[_0x58ea8d][_0xefeb('0x36')]({'plain':!![]});switch(_0x2593fb[_0xefeb('0x34')]){case _0xefeb('0x37'):_0x550dec(_0x2593fb)['catch'](_0x17a247());break;case'onlyIfOpen':_0x310793(_0x2593fb)[_0xefeb('0x2b')](_0x17a247());break;default:_0x3e0e14(_0x2593fb,_0x599afb)['then'](function(_0x4984f9){_0x599afb[_0xefeb('0x1a')]=_0x4984f9[_0xefeb('0x24')];_0xdcb3e6['CmHopper'][_0xefeb('0x27')]({'phone':_0x599afb[_0xefeb('0xb')],'ContactId':_0x599afb['id'],'ListId':_0x599afb[_0xefeb('0x28')],'scheduledat':_0x599afb[_0xefeb('0x1a')]?_0x599afb[_0xefeb('0x1a')]:moment()[_0xefeb('0x1b')](_0xefeb('0x1c')),'priority':_0x599afb['priority']?_0x599afb[_0xefeb('0x29')]:0x2,'callback':_0x599afb[_0xefeb('0x2a')]?!![]:![],'callbackuniqueid':_0x599afb['callbackUniqueid']?_0x599afb[_0xefeb('0x2a')]:undefined,'callbackat':_0x599afb[_0xefeb('0x2a')]?moment()[_0xefeb('0x1b')](_0xefeb('0x1c')):undefined,'VoiceQueueId':_0x2593fb['id']})[_0xefeb('0x2b')](_0x17a247());});}}}})['then'](function(){return _0xdcb3e6[_0xefeb('0x38')][_0xefeb('0x39')]({'where':{'type':'outbound'},'attributes':['id'],'include':[{'model':_0xdcb3e6[_0xefeb('0x35')],'as':_0xefeb('0x3a'),'where':{'id':_0x599afb[_0xefeb('0x28')]}}]})[_0xefeb('0x1d')](function(_0x250e5f){if(_0x250e5f){var _0x3abea3=[];for(var _0x42b38a=0x0,_0x573b0e;_0x42b38a<_0x250e5f['length'];_0x42b38a+=0x1){_0x573b0e=_0x250e5f[_0x42b38a][_0xefeb('0x36')]({'plain':!![]});_0xdcb3e6['CmHopperBlack'][_0xefeb('0x27')]({'phone':_0x599afb[_0xefeb('0xb')],'ContactId':_0x599afb['id'],'ListId':_0x599afb[_0xefeb('0x28')],'VoiceQueueId':_0x573b0e['id']})['catch'](function(_0x4f3419){logger[_0xefeb('0x16')](_0xefeb('0x3b'),_0xefeb('0x18'),_0x4f3419[_0xefeb('0x3c')]);});}}});})[_0xefeb('0x1d')](function(){return _0xdcb3e6[_0xefeb('0x3d')]['findAll']({'attributes':['id',_0xefeb('0x34'),_0xefeb('0x20')],'include':[{'model':_0xdcb3e6[_0xefeb('0x35')],'as':_0xefeb('0x3e'),'where':{'id':_0x599afb[_0xefeb('0x28')]}}]})['then'](function(_0x11d2c9){if(_0x11d2c9){var _0x541606=[];for(var _0x27db50=0x0,_0x434723;_0x27db50<_0x11d2c9[_0xefeb('0x3f')];_0x27db50+=0x1){_0x434723=_0x11d2c9[_0x27db50]['get']({'plain':!![]});switch(_0x434723[_0xefeb('0x34')]){case'always':_0x199499(_0x434723)[_0xefeb('0x2b')](_0x167e91());break;case _0xefeb('0x40'):_0x41dd5d(_0x434723)[_0xefeb('0x2b')](_0x167e91());break;default:_0xdcb3e6[_0xefeb('0x25')][_0xefeb('0x27')]({'phone':_0x599afb[_0xefeb('0xb')],'ContactId':_0x599afb['id'],'ListId':_0x599afb['ListId'],'scheduledat':_0x599afb[_0xefeb('0x1a')]?_0x599afb['scheduledat']:moment()[_0xefeb('0x1b')]('YYYY-MM-DD\x20HH:mm:ss'),'priority':_0x599afb[_0xefeb('0x29')]?_0x599afb[_0xefeb('0x29')]:0x2,'callback':_0x599afb[_0xefeb('0x2a')]?!![]:![],'callbackuniqueid':_0x599afb['callbackUniqueid']?_0x599afb[_0xefeb('0x2a')]:undefined,'callbackat':_0x599afb['callbackUniqueid']?moment()[_0xefeb('0x1b')](_0xefeb('0x1c')):undefined,'CampaignId':_0x434723['id']})[_0xefeb('0x2b')](_0x167e91());}}}});})[_0xefeb('0x1d')](function(){return _0xdcb3e6['Campaign']['findAll']({'attributes':['id'],'include':[{'model':_0xdcb3e6['CmList'],'as':_0xefeb('0x3a'),'where':{'id':_0x599afb[_0xefeb('0x28')]}}]})[_0xefeb('0x1d')](function(_0x3f74de){if(_0x3f74de){var _0x37fe6b=[];for(var _0x4cc615=0x0,_0x2527eb;_0x4cc615<_0x3f74de[_0xefeb('0x3f')];_0x4cc615+=0x1){_0x2527eb=_0x3f74de[_0x4cc615][_0xefeb('0x36')]({'plain':!![]});_0xdcb3e6[_0xefeb('0x41')][_0xefeb('0x27')]({'phone':_0x599afb[_0xefeb('0xb')],'ContactId':_0x599afb['id'],'ListId':_0x599afb[_0xefeb('0x28')],'CampaignId':_0x2527eb['id']})[_0xefeb('0x2b')](function(_0x1c4cf4){logger[_0xefeb('0x16')](_0xefeb('0x3b'),_0xefeb('0x18'),_0x1c4cf4['message']);});}}});})[_0xefeb('0x1d')](function(){_0x2d52d();})['catch'](function(_0x334a9a){logger[_0xefeb('0x16')](_0xefeb('0x3b'),_0xefeb('0x18'),_0x334a9a['message']);_0x2d52d(_0x334a9a);});}else{_0x2d52d(new Error(_0xefeb('0x42')));}},'afterDestroy':function(_0x45f4e8,_0x47193a,_0x179468){var _0x94e8aa=_0x45fcfa[_0xefeb('0x15')];var _0x1ce9b3=_0x45f4e8['get']({'plain':!![]});return _0x94e8aa[_0xefeb('0x25')][_0xefeb('0x39')]({'raw':!![],'where':{'ListId':_0x1ce9b3[_0xefeb('0x28')],'ContactId':_0x1ce9b3['id']}})['then'](function(_0x567b53){if(!_[_0xefeb('0x43')](_0x567b53)){var _0x364a81=[];for(var _0x5670ec=0x0;_0x5670ec<_0x567b53[_0xefeb('0x3f')];_0x5670ec+=0x1){var _0x1932fd=_0x94e8aa[_0xefeb('0x25')][_0xefeb('0x44')]({'where':{'ListId':_0x567b53[_0x5670ec][_0xefeb('0x28')],'ContactId':_0x567b53[_0x5670ec][_0xefeb('0x45')],'VoiceQueueId':_0x567b53[_0x5670ec]['VoiceQueueId'],'CampaignId':_0x567b53[_0x5670ec][_0xefeb('0x46')]}});_0x364a81[_0xefeb('0x47')](_0x1932fd);}return BPromise[_0xefeb('0x48')](_0x364a81);}})[_0xefeb('0x1d')](function(_0x3336f1){logger[_0xefeb('0x49')](_0xefeb('0x4a'),util[_0xefeb('0x19')](_0x3336f1,{'showHidden':![],'depth':null}));_0x179468();})[_0xefeb('0x2b')](function(_0x385073){logger[_0xefeb('0x16')](_0xefeb('0x4b'),util[_0xefeb('0x19')](_0x385073,{'showHidden':![],'depth':null}));_0x179468(_0x385073);});}}});}; \ No newline at end of file diff --git a/server/api/cmContact/cmContact.rpc.js b/server/api/cmContact/cmContact.rpc.js index 27120e7..f93ba3e 100644 --- a/server/api/cmContact/cmContact.rpc.js +++ b/server/api/cmContact/cmContact.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xa9e0=['phone','ListId','Contact','CmContactId','create','body','keys','length','startsWith','update','table','cm_contacts','id\x20=\x20?','sequelize','query','CreateCmContact','lodash','util','moment','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','redis','localhost','./cmContact.socket','register','info','CmContact,\x20%s,\x20%s','request\x20sent','debug','CmContact,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','GetCmContact','CmContact','findAll','options','where','limit','include','map','model','attributes','then','stringify','CmContactHasItem','find'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xa9e0,0x123));var _0x0a9e=function(_0x484e36,_0x4482d8){_0x484e36=_0x484e36-0x0;var _0xafc85d=_0xa9e0[_0x484e36];return _0xafc85d;};'use strict';var _=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var moment=require(_0x0a9e('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x0a9e('0x3'));var squel=require('squel');var db=require(_0x0a9e('0x4'))['db'];var utils=require(_0x0a9e('0x5'));var logger=require(_0x0a9e('0x6'))(_0x0a9e('0x7'));var config=require(_0x0a9e('0x8'));var jayson=require('jayson/promise');var client=jayson[_0x0a9e('0x9')][_0x0a9e('0xa')]({'port':0x232a});config[_0x0a9e('0xb')]=_['defaults'](config['redis'],{'host':_0x0a9e('0xc'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require(_0x0a9e('0xd'))[_0x0a9e('0xe')](socket);function respondWithRpcPromise(_0x307b3e,_0x3ab53f,_0xfeb75b){return new BPromise(function(_0xbd1168,_0x4a4c56){return client['request'](_0x307b3e,_0xfeb75b)['then'](function(_0x4cfe67){logger[_0x0a9e('0xf')](_0x0a9e('0x10'),_0x3ab53f,_0x0a9e('0x11'));logger[_0x0a9e('0x12')](_0x0a9e('0x13'),_0x3ab53f,_0x0a9e('0x11'),JSON['stringify'](_0x4cfe67));if(_0x4cfe67[_0x0a9e('0x14')]){if(_0x4cfe67[_0x0a9e('0x14')][_0x0a9e('0x15')]===0x1f4){logger[_0x0a9e('0x14')](_0x0a9e('0x10'),_0x3ab53f,_0x4cfe67[_0x0a9e('0x14')]['message']);return _0x4a4c56(_0x4cfe67[_0x0a9e('0x14')]['message']);}logger[_0x0a9e('0x14')]('CmContact,\x20%s,\x20%s',_0x3ab53f,_0x4cfe67[_0x0a9e('0x14')][_0x0a9e('0x16')]);return _0xbd1168(_0x4cfe67['error'][_0x0a9e('0x16')]);}else{logger['info'](_0x0a9e('0x10'),_0x3ab53f,_0x0a9e('0x11'));_0xbd1168(_0x4cfe67[_0x0a9e('0x17')][_0x0a9e('0x16')]);}})[_0x0a9e('0x18')](function(_0x2eb11f){logger[_0x0a9e('0x14')](_0x0a9e('0x10'),_0x3ab53f,_0x2eb11f);_0x4a4c56(_0x2eb11f);});});}exports[_0x0a9e('0x19')]=function(_0x112016){var _0x1c696a=this;return new Promise(function(_0x105080,_0x4bb1e3){return db[_0x0a9e('0x1a')][_0x0a9e('0x1b')]({'raw':_0x112016['options']?_0x112016[_0x0a9e('0x1c')]['raw']===undefined?!![]:![]:!![],'where':_0x112016['options']?_0x112016[_0x0a9e('0x1c')][_0x0a9e('0x1d')]||null:null,'attributes':_0x112016[_0x0a9e('0x1c')]?_0x112016[_0x0a9e('0x1c')]['attributes']||null:null,'limit':_0x112016[_0x0a9e('0x1c')]?_0x112016[_0x0a9e('0x1c')][_0x0a9e('0x1e')]||null:null,'include':_0x112016[_0x0a9e('0x1c')]?_0x112016[_0x0a9e('0x1c')][_0x0a9e('0x1f')]?_[_0x0a9e('0x20')](_0x112016['options']['include'],function(_0x197ec0){return{'model':db[_0x197ec0[_0x0a9e('0x21')]],'as':_0x197ec0['as'],'attributes':_0x197ec0[_0x0a9e('0x22')],'include':_0x197ec0[_0x0a9e('0x1f')]?_['map'](_0x197ec0[_0x0a9e('0x1f')],function(_0x479bc4){return{'model':db[_0x479bc4[_0x0a9e('0x21')]],'as':_0x479bc4['as'],'attributes':_0x479bc4['attributes'],'include':_0x479bc4[_0x0a9e('0x1f')]?_[_0x0a9e('0x20')](_0x479bc4[_0x0a9e('0x1f')],function(_0x14433c){return{'model':db[_0x14433c[_0x0a9e('0x21')]],'as':_0x14433c['as'],'attributes':_0x14433c[_0x0a9e('0x22')]};}):[]};}):[]};}):[]:[]})[_0x0a9e('0x23')](function(_0x14de77){logger['info'](_0x0a9e('0x19'),_0x112016);logger[_0x0a9e('0x12')](_0x0a9e('0x19'),_0x112016,JSON[_0x0a9e('0x24')](_0x14de77));if(_0x14de77['length']==0x0){return db[_0x0a9e('0x25')][_0x0a9e('0x26')]({'raw':!![],'where':{'item':_0x112016[_0x0a9e('0x1c')][_0x0a9e('0x27')]},'include':[{'model':db[_0x0a9e('0x1a')],'where':{'ListId':_0x112016[_0x0a9e('0x1c')][_0x0a9e('0x1d')][_0x0a9e('0x28')],'deletedAt':{'$eq':null}},'as':_0x0a9e('0x29')}]})['then'](function(_0x426950){if(_['isNil'](_0x426950)){_0x105080(_0x14de77);}else{var _0x2407f9=_0x426950[_0x0a9e('0x2a')];return db[_0x0a9e('0x1a')][_0x0a9e('0x1b')]({'raw':!![],'where':{'id':_0x2407f9},'attributes':_0x112016[_0x0a9e('0x1c')]?_0x112016['options'][_0x0a9e('0x22')]||null:null})[_0x0a9e('0x23')](function(_0x40cb85){_0x105080(_0x40cb85);});}});}else{_0x105080(_0x14de77);}})[_0x0a9e('0x18')](function(_0x2b45ea){logger[_0x0a9e('0x14')](_0x0a9e('0x19'),_0x2b45ea[_0x0a9e('0x16')],_0x112016);_0x4bb1e3(_0x1c696a['error'](0x1f4,_0x2b45ea[_0x0a9e('0x16')]));});});};exports['CreateCmContact']=function(_0x2cc7a0){var _0x14b13f=this;return new Promise(function(_0x2b7e7f,_0x3f3d41){return db['CmContact'][_0x0a9e('0x2b')](_0x2cc7a0[_0x0a9e('0x2c')],{'raw':_0x2cc7a0[_0x0a9e('0x1c')]?_0x2cc7a0[_0x0a9e('0x1c')]['raw']===undefined?!![]:![]:!![]})['then'](function(_0x1e8694){var _0x5640eb;for(var _0x24936a=0x0;_0x24936a{}\s\\|]/g,'-');_0x59181e(null,util[_0x0a9e('0x26')]('%s-%s%s',path[_0x0a9e('0x27')](_0x5ea472['originalname'],path[_0x0a9e('0x28')](_0x5ea472['originalname'])),Date[_0x0a9e('0x29')](),path[_0x0a9e('0x28')](_0x5ea472[_0x0a9e('0x24')])));}})});router[_0x0a9e('0x18')](_0x0a9e('0x2a'),upload[_0x0a9e('0x2b')](_0x0a9e('0x2c')),controller[_0x0a9e('0x2d')]);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0x3652a7,_0x468813,_0x2b1f27){_0x2b1f27(null,path[_0x0a9e('0x21')](config['root'],_0x0a9e('0x23')));},'filename':function(_0x40e7a3,_0x1843b2,_0x824a4f){_0x1843b2[_0x0a9e('0x24')]=_0x1843b2[_0x0a9e('0x24')][_0x0a9e('0x25')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-');_0x824a4f(null,util[_0x0a9e('0x26')](_0x0a9e('0x2e'),path['basename'](_0x1843b2[_0x0a9e('0x24')],path['extname'](_0x1843b2[_0x0a9e('0x24')])),Date[_0x0a9e('0x29')](),path[_0x0a9e('0x28')](_0x1843b2[_0x0a9e('0x24')])));}})});router[_0x0a9e('0x18')]('/upload',upload[_0x0a9e('0x2b')](_0x0a9e('0x2c')),controller[_0x0a9e('0x2f')]);router[_0x0a9e('0x18')](_0x0a9e('0x30'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x31')]);router[_0x0a9e('0x18')]('/uploadUpdates/:id',auth[_0x0a9e('0xd')](),controller['importUpdates']);router[_0x0a9e('0x32')](_0x0a9e('0x33'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x34')]);router['delete'](_0x0a9e('0x33'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x35')]);module[_0x0a9e('0x36')]=router; \ No newline at end of file +var _0xa9e0=['basename','extname','now','/csv','single','file','uploadCsv','%s-%s%s','upload','/upload/:id','import','put','/:id','update','destroy','exports','multer','util','path','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./cmContact.controller','get','index','/describe','show','/:id/tags','isAuthenticated','getTags','/:id/hoppers','getHoppers','/:id/hopper_histories','/:id/hopper_finals','getHopperFinals','/:id/jscripty_sessions','getJscriptySessions','/:id/journey','getJourney','post','create','/create_many','bulkCreate','setTags','setAdditionalPhones','/:id/duplicateAdditionalPhones','/:id/rescheduleAdditionalPhones','rescheduleAdditionalPhones','join','root','server/files/tmp','originalname','replace','format'];(function(_0x98c112,_0x432dec){var _0x8219a8=function(_0x5bf35c){while(--_0x5bf35c){_0x98c112['push'](_0x98c112['shift']());}};_0x8219a8(++_0x432dec);}(_0xa9e0,0x123));var _0x0a9e=function(_0x3b5250,_0x7a0b2c){_0x3b5250=_0x3b5250-0x0;var _0xc844a1=_0xa9e0[_0x3b5250];return _0xc844a1;};'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 3f27c91..8f791ce 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 _0x222f=['sequelize','exports','INTEGER','STRING','PHONE'];(function(_0x2dafbe,_0x5d04de){var _0x58a45a=function(_0x50ac96){while(--_0x50ac96){_0x2dafbe['push'](_0x2dafbe['shift']());}};_0x58a45a(++_0x5d04de);}(_0x222f,0x1a4));var _0xf222=function(_0x3d7f0e,_0x104d69){_0x3d7f0e=_0x3d7f0e-0x0;var _0x3e45dd=_0x222f[_0x3d7f0e];return _0x3e45dd;};'use strict';var Sequelize=require(_0xf222('0x0'));module[_0xf222('0x1')]={'CmContactId':{'type':Sequelize[_0xf222('0x2')],'primaryKey':!![]},'item':{'type':Sequelize[_0xf222('0x3')],'defaultValue':'','primaryKey':!![]},'ItemTypeId':{'type':Sequelize['INTEGER'],'defaultValue':null},'ItemClass':{'type':Sequelize['STRING'],'defaultValue':_0xf222('0x4')},'OrderBy':{'type':Sequelize[_0xf222('0x2')],'defaultValue':null},'description':{'type':Sequelize[_0xf222('0x3')],'defaultValue':null}}; \ No newline at end of file +var _0x4746=['STRING','PHONE','INTEGER','sequelize','exports'];(function(_0x121897,_0x16baac){var _0x478785=function(_0x27759c){while(--_0x27759c){_0x121897['push'](_0x121897['shift']());}};_0x478785(++_0x16baac);}(_0x4746,0xc6));var _0x6474=function(_0x3ea6a1,_0x26e82b){_0x3ea6a1=_0x3ea6a1-0x0;var _0xb463ee=_0x4746[_0x3ea6a1];return _0xb463ee;};'use strict';var Sequelize=require(_0x6474('0x0'));module[_0x6474('0x1')]={'CmContactId':{'type':Sequelize['INTEGER'],'primaryKey':!![]},'item':{'type':Sequelize[_0x6474('0x2')],'defaultValue':'','primaryKey':!![]},'ItemTypeId':{'type':Sequelize['INTEGER'],'defaultValue':null},'ItemClass':{'type':Sequelize[_0x6474('0x2')],'defaultValue':_0x6474('0x3')},'OrderBy':{'type':Sequelize[_0x6474('0x4')],'defaultValue':null},'description':{'type':Sequelize[_0x6474('0x2')],'defaultValue':null}}; \ No newline at end of file diff --git a/server/api/cmContactHasItem/cmContactHasItem.controller.js b/server/api/cmContactHasItem/cmContactHasItem.controller.js index 22fcc22..b2397eb 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 _0x1e02=['eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','sendStatus','end','status','offset','undefined','limit','count','set','json','apply','reject','save','update','then','destroy','get','CmContactHasItems','UserProfileResource','error','stack','name','send','index','map','CmContactHasItem','rawAttributes','fieldName','type','key','model','query','keys','filters','attributes','intersection','fields','hasOwnProperty','nolimit','order','sort','pick','filter','where','merge','VIRTUAL','includeAll','findAll','catch','show','length','include','options','find','create','body','role','user','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','params'];(function(_0x93872e,_0x37f470){var _0x4a6ff1=function(_0x2e6117){while(--_0x2e6117){_0x93872e['push'](_0x93872e['shift']());}};_0x4a6ff1(++_0x37f470);}(_0x1e02,0x1b3));var _0x21e0=function(_0x2cec0c,_0x12c5c9){_0x2cec0c=_0x2cec0c-0x0;var _0x15fa2a=_0x1e02[_0x2cec0c];return _0x15fa2a;};'use strict';var emlformat=require(_0x21e0('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x21e0('0x1'));var jsonpatch=require(_0x21e0('0x2'));var rp=require(_0x21e0('0x3'));var moment=require(_0x21e0('0x4'));var BPromise=require(_0x21e0('0x5'));var Mustache=require('mustache');var util=require(_0x21e0('0x6'));var path=require(_0x21e0('0x7'));var sox=require(_0x21e0('0x8'));var csv=require(_0x21e0('0x9'));var ejs=require(_0x21e0('0xa'));var fs=require('fs');var fs_extra=require(_0x21e0('0xb'));var _=require(_0x21e0('0xc'));var squel=require(_0x21e0('0xd'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x21e0('0xe'));var toCsv=require(_0x21e0('0x9'));var querystring=require(_0x21e0('0xf'));var Papa=require(_0x21e0('0x10'));var Redis=require(_0x21e0('0x11'));var authService=require(_0x21e0('0x12'));var qs=require(_0x21e0('0x13'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x21e0('0x14'));var logger=require(_0x21e0('0x15'))(_0x21e0('0x16'));var utils=require('../../config/utils');var config=require(_0x21e0('0x17'));var licenseUtil=require(_0x21e0('0x18'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x41f3b5,_0xce529f){_0xce529f=_0xce529f||0xcc;return function(_0x1df467){if(_0x1df467){return _0x41f3b5[_0x21e0('0x19')](_0xce529f);}return _0x41f3b5['status'](_0xce529f)[_0x21e0('0x1a')]();};}function respondWithResult(_0x4ad4f7,_0x24a4ea){_0x24a4ea=_0x24a4ea||0xc8;return function(_0x561e47){if(_0x561e47){return _0x4ad4f7[_0x21e0('0x1b')](_0x24a4ea)['json'](_0x561e47);}};}function respondWithFilteredResult(_0xd4676d,_0x3a8cb3){return function(_0x3b4c9a){if(_0x3b4c9a){var _0x4601e6=typeof _0x3a8cb3[_0x21e0('0x1c')]===_0x21e0('0x1d')&&typeof _0x3a8cb3[_0x21e0('0x1e')]===_0x21e0('0x1d');var _0x4b2186=_0x3b4c9a[_0x21e0('0x1f')];var _0x5b839f=_0x4601e6?0x0:_0x3a8cb3['offset'];var _0xd032d3=_0x4601e6?_0x3b4c9a[_0x21e0('0x1f')]:_0x3a8cb3[_0x21e0('0x1c')]+_0x3a8cb3[_0x21e0('0x1e')];var _0x2a560b;if(_0xd032d3>=_0x4b2186){_0xd032d3=_0x4b2186;_0x2a560b=0xc8;}else{_0x2a560b=0xce;}_0xd4676d[_0x21e0('0x1b')](_0x2a560b);return _0xd4676d[_0x21e0('0x20')]('Content-Range',_0x5b839f+'-'+_0xd032d3+'/'+_0x4b2186)[_0x21e0('0x21')](_0x3b4c9a);}return null;};}function patchUpdates(_0x3decc6){return function(_0x23e982){try{jsonpatch[_0x21e0('0x22')](_0x23e982,_0x3decc6,!![]);}catch(_0x569972){return BPromise[_0x21e0('0x23')](_0x569972);}return _0x23e982[_0x21e0('0x24')]();};}function saveUpdates(_0xdb9ecf,_0x3d7e54){return function(_0x14917e){if(_0x14917e){return _0x14917e[_0x21e0('0x25')](_0xdb9ecf)[_0x21e0('0x26')](function(_0x554afe){return _0x554afe;});}return null;};}function removeEntity(_0x2dcf47,_0x34065b){return function(_0x18b789){if(_0x18b789){return _0x18b789[_0x21e0('0x27')]()[_0x21e0('0x26')](function(){var _0x578ae7=_0x18b789[_0x21e0('0x28')]({'plain':!![]});var _0x2e964d=_0x21e0('0x29');return db[_0x21e0('0x2a')][_0x21e0('0x27')]({'where':{'type':_0x2e964d,'resourceId':_0x578ae7['id']}})[_0x21e0('0x26')](function(){return _0x18b789;});})[_0x21e0('0x26')](function(){_0x2dcf47[_0x21e0('0x1b')](0xcc)[_0x21e0('0x1a')]();});}};}function handleEntityNotFound(_0x29cf92,_0x581aaf){return function(_0xaa1540){if(!_0xaa1540){_0x29cf92[_0x21e0('0x19')](0x194);}return _0xaa1540;};}function handleError(_0x19b00f,_0x5b52f5){_0x5b52f5=_0x5b52f5||0x1f4;return function(_0x354fcb){logger[_0x21e0('0x2b')](_0x354fcb[_0x21e0('0x2c')]);if(_0x354fcb[_0x21e0('0x2d')]){delete _0x354fcb[_0x21e0('0x2d')];}_0x19b00f[_0x21e0('0x1b')](_0x5b52f5)[_0x21e0('0x2e')](_0x354fcb);};}exports[_0x21e0('0x2f')]=function(_0x10a12d,_0x52a620){var _0xef026a={},_0x30b93f={},_0x49e216={'count':0x0,'rows':[]};var _0x2034bf=_[_0x21e0('0x30')](db[_0x21e0('0x31')][_0x21e0('0x32')],function(_0x4ab491){return{'name':_0x4ab491[_0x21e0('0x33')],'type':_0x4ab491[_0x21e0('0x34')][_0x21e0('0x35')]};});_0x30b93f[_0x21e0('0x36')]=_[_0x21e0('0x30')](_0x2034bf,'name');_0x30b93f[_0x21e0('0x37')]=_[_0x21e0('0x38')](_0x10a12d[_0x21e0('0x37')]);_0x30b93f[_0x21e0('0x39')]=_['intersection'](_0x30b93f[_0x21e0('0x36')],_0x30b93f['query']);_0xef026a[_0x21e0('0x3a')]=_[_0x21e0('0x3b')](_0x30b93f[_0x21e0('0x36')],qs['fields'](_0x10a12d[_0x21e0('0x37')][_0x21e0('0x3c')]));_0xef026a[_0x21e0('0x3a')]=_0xef026a[_0x21e0('0x3a')]['length']?_0xef026a[_0x21e0('0x3a')]:_0x30b93f[_0x21e0('0x36')];if(!_0x10a12d[_0x21e0('0x37')][_0x21e0('0x3d')](_0x21e0('0x3e'))){_0xef026a[_0x21e0('0x1e')]=qs[_0x21e0('0x1e')](_0x10a12d[_0x21e0('0x37')][_0x21e0('0x1e')]);_0xef026a['offset']=qs[_0x21e0('0x1c')](_0x10a12d[_0x21e0('0x37')][_0x21e0('0x1c')]);}_0xef026a[_0x21e0('0x3f')]=qs[_0x21e0('0x40')](_0x10a12d[_0x21e0('0x37')][_0x21e0('0x40')]);_0xef026a['where']=qs[_0x21e0('0x39')](_[_0x21e0('0x41')](_0x10a12d[_0x21e0('0x37')],_0x30b93f[_0x21e0('0x39')]),_0x2034bf);if(_0x10a12d[_0x21e0('0x37')][_0x21e0('0x42')]){_0xef026a[_0x21e0('0x43')]=_[_0x21e0('0x44')](_0xef026a[_0x21e0('0x43')],{'$or':_[_0x21e0('0x30')](_0x2034bf,function(_0x4bbe7b){if(_0x4bbe7b[_0x21e0('0x34')]!==_0x21e0('0x45')){var _0x24f130={};_0x24f130[_0x4bbe7b[_0x21e0('0x2d')]]={'$like':'%'+_0x10a12d['query'][_0x21e0('0x42')]+'%'};return _0x24f130;}})});}_0xef026a=_[_0x21e0('0x44')]({},_0xef026a,_0x10a12d['options']);var _0x5bc99a={'where':_0xef026a[_0x21e0('0x43')]};return db[_0x21e0('0x31')][_0x21e0('0x1f')](_0x5bc99a)[_0x21e0('0x26')](function(_0x398e22){_0x49e216[_0x21e0('0x1f')]=_0x398e22;if(_0x10a12d['query'][_0x21e0('0x46')]){_0xef026a['include']=[{'all':!![]}];}return db['CmContactHasItem'][_0x21e0('0x47')](_0xef026a);})[_0x21e0('0x26')](function(_0x4dd8ee){_0x49e216['rows']=_0x4dd8ee;return _0x49e216;})[_0x21e0('0x26')](respondWithFilteredResult(_0x52a620,_0xef026a))[_0x21e0('0x48')](handleError(_0x52a620,null));};exports[_0x21e0('0x49')]=function(_0x5cd663,_0x2093f4){var _0x9b71ba={'raw':!![],'where':{'id':_0x5cd663['params']['id']}},_0x803bb={};_0x803bb[_0x21e0('0x36')]=_['keys'](db[_0x21e0('0x31')]['rawAttributes']);_0x803bb[_0x21e0('0x37')]=_[_0x21e0('0x38')](_0x5cd663[_0x21e0('0x37')]);_0x803bb[_0x21e0('0x39')]=_[_0x21e0('0x3b')](_0x803bb[_0x21e0('0x36')],_0x803bb[_0x21e0('0x37')]);_0x9b71ba[_0x21e0('0x3a')]=_[_0x21e0('0x3b')](_0x803bb[_0x21e0('0x36')],qs['fields'](_0x5cd663[_0x21e0('0x37')][_0x21e0('0x3c')]));_0x9b71ba[_0x21e0('0x3a')]=_0x9b71ba[_0x21e0('0x3a')][_0x21e0('0x4a')]?_0x9b71ba[_0x21e0('0x3a')]:_0x803bb[_0x21e0('0x36')];if(_0x5cd663[_0x21e0('0x37')][_0x21e0('0x46')]){_0x9b71ba[_0x21e0('0x4b')]=[{'all':!![]}];}_0x9b71ba=_[_0x21e0('0x44')]({},_0x9b71ba,_0x5cd663[_0x21e0('0x4c')]);return db[_0x21e0('0x31')][_0x21e0('0x4d')](_0x9b71ba)[_0x21e0('0x26')](handleEntityNotFound(_0x2093f4,null))[_0x21e0('0x26')](respondWithResult(_0x2093f4,null))[_0x21e0('0x48')](handleError(_0x2093f4,null));};exports[_0x21e0('0x4e')]=function(_0x4ca5c5,_0x144cc1){return db[_0x21e0('0x31')][_0x21e0('0x4e')](_0x4ca5c5[_0x21e0('0x4f')],{})[_0x21e0('0x26')](function(_0x352393){var _0x21290c=_0x4ca5c5['user'][_0x21e0('0x28')]({'plain':!![]});if(!_0x21290c)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x21290c[_0x21e0('0x50')]===_0x21e0('0x51')){var _0x422fca=_0x352393[_0x21e0('0x28')]({'plain':!![]});var _0x20db9a='CmContactHasItems';return db[_0x21e0('0x52')][_0x21e0('0x4d')]({'where':{'name':_0x20db9a,'userProfileId':_0x21290c[_0x21e0('0x53')]},'raw':!![]})[_0x21e0('0x26')](function(_0x43c71b){if(_0x43c71b&&_0x43c71b[_0x21e0('0x54')]===0x0){return db[_0x21e0('0x2a')][_0x21e0('0x4e')]({'name':_0x422fca['name'],'resourceId':_0x422fca['id'],'type':_0x43c71b['name'],'sectionId':_0x43c71b['id']},{})['then'](function(){return _0x352393;});}else{return _0x352393;}})['catch'](function(_0x6165cf){logger[_0x21e0('0x2b')](_0x21e0('0x55'),_0x6165cf);throw _0x6165cf;});}return _0x352393;})[_0x21e0('0x26')](respondWithResult(_0x144cc1,0xc9))[_0x21e0('0x48')](handleError(_0x144cc1,null));};exports[_0x21e0('0x25')]=function(_0x475afe,_0x2e4058){if(_0x475afe[_0x21e0('0x4f')]['id']){delete _0x475afe[_0x21e0('0x4f')]['id'];}return db[_0x21e0('0x31')][_0x21e0('0x4d')]({'where':{'id':_0x475afe['params']['id']}})[_0x21e0('0x26')](handleEntityNotFound(_0x2e4058,null))['then'](saveUpdates(_0x475afe[_0x21e0('0x4f')],null))[_0x21e0('0x26')](respondWithResult(_0x2e4058,null))[_0x21e0('0x48')](handleError(_0x2e4058,null));};exports[_0x21e0('0x27')]=function(_0x57130e,_0x531aae){return db['CmContactHasItem'][_0x21e0('0x4d')]({'where':{'id':_0x57130e[_0x21e0('0x56')]['id']}})[_0x21e0('0x26')](handleEntityNotFound(_0x531aae,null))[_0x21e0('0x26')](removeEntity(_0x531aae,null))[_0x21e0('0x48')](handleError(_0x531aae,null));}; \ No newline at end of file +var _0x8d4c=['ejs','fs-extra','lodash','squel','crypto','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','status','end','json','offset','undefined','limit','count','Content-Range','reject','save','update','then','destroy','get','UserProfileResource','error','name','send','index','CmContactHasItem','fieldName','model','query','filters','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','pick','where','merge','type','filter','options','rows','catch','show','params','keys','include','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','CmContactHasItems','UserProfileSection','find','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','to-csv'];(function(_0x184e8c,_0x4a8ada){var _0x291471=function(_0x4ccac2){while(--_0x4ccac2){_0x184e8c['push'](_0x184e8c['shift']());}};_0x291471(++_0x4a8ada);}(_0x8d4c,0x95));var _0xc8d4=function(_0x5a5675,_0x1ffcdb){_0x5a5675=_0x5a5675-0x0;var _0x5c2444=_0x8d4c[_0x5a5675];return _0x5c2444;};'use strict';var emlformat=require(_0xc8d4('0x0'));var rimraf=require(_0xc8d4('0x1'));var zipdir=require(_0xc8d4('0x2'));var jsonpatch=require(_0xc8d4('0x3'));var rp=require('request-promise');var moment=require(_0xc8d4('0x4'));var BPromise=require(_0xc8d4('0x5'));var Mustache=require(_0xc8d4('0x6'));var util=require(_0xc8d4('0x7'));var path=require('path');var sox=require('sox');var csv=require(_0xc8d4('0x8'));var ejs=require(_0xc8d4('0x9'));var fs=require('fs');var fs_extra=require(_0xc8d4('0xa'));var _=require(_0xc8d4('0xb'));var squel=require(_0xc8d4('0xc'));var crypto=require(_0xc8d4('0xd'));var jsforce=require(_0xc8d4('0xe'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0xc8d4('0xf'));var Papa=require(_0xc8d4('0x10'));var Redis=require('ioredis');var authService=require(_0xc8d4('0x11'));var qs=require(_0xc8d4('0x12'));var as=require(_0xc8d4('0x13'));var hardwareService=require(_0xc8d4('0x14'));var logger=require(_0xc8d4('0x15'))(_0xc8d4('0x16'));var utils=require(_0xc8d4('0x17'));var config=require(_0xc8d4('0x18'));var licenseUtil=require(_0xc8d4('0x19'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x105ea7,_0x4a90f5){_0x4a90f5=_0x4a90f5||0xcc;return function(_0x3262a3){if(_0x3262a3){return _0x105ea7['sendStatus'](_0x4a90f5);}return _0x105ea7[_0xc8d4('0x1a')](_0x4a90f5)[_0xc8d4('0x1b')]();};}function respondWithResult(_0xc5b9f5,_0x289fb2){_0x289fb2=_0x289fb2||0xc8;return function(_0x1c8101){if(_0x1c8101){return _0xc5b9f5[_0xc8d4('0x1a')](_0x289fb2)[_0xc8d4('0x1c')](_0x1c8101);}};}function respondWithFilteredResult(_0x45352b,_0x9ceaf6){return function(_0x4d7c9d){if(_0x4d7c9d){var _0xdf3c35=typeof _0x9ceaf6[_0xc8d4('0x1d')]===_0xc8d4('0x1e')&&typeof _0x9ceaf6[_0xc8d4('0x1f')]===_0xc8d4('0x1e');var _0x4d0986=_0x4d7c9d[_0xc8d4('0x20')];var _0x2859c7=_0xdf3c35?0x0:_0x9ceaf6[_0xc8d4('0x1d')];var _0x42380b=_0xdf3c35?_0x4d7c9d[_0xc8d4('0x20')]:_0x9ceaf6[_0xc8d4('0x1d')]+_0x9ceaf6[_0xc8d4('0x1f')];var _0xc36851;if(_0x42380b>=_0x4d0986){_0x42380b=_0x4d0986;_0xc36851=0xc8;}else{_0xc36851=0xce;}_0x45352b['status'](_0xc36851);return _0x45352b['set'](_0xc8d4('0x21'),_0x2859c7+'-'+_0x42380b+'/'+_0x4d0986)[_0xc8d4('0x1c')](_0x4d7c9d);}return null;};}function patchUpdates(_0x340a51){return function(_0x3a845a){try{jsonpatch['apply'](_0x3a845a,_0x340a51,!![]);}catch(_0x4192c0){return BPromise[_0xc8d4('0x22')](_0x4192c0);}return _0x3a845a[_0xc8d4('0x23')]();};}function saveUpdates(_0x58727d,_0x56358b){return function(_0x403830){if(_0x403830){return _0x403830[_0xc8d4('0x24')](_0x58727d)[_0xc8d4('0x25')](function(_0x54349d){return _0x54349d;});}return null;};}function removeEntity(_0x4dbb5c,_0x3a99fc){return function(_0x1a2f4a){if(_0x1a2f4a){return _0x1a2f4a[_0xc8d4('0x26')]()[_0xc8d4('0x25')](function(){var _0x3fe8de=_0x1a2f4a[_0xc8d4('0x27')]({'plain':!![]});var _0x1a89c2='CmContactHasItems';return db[_0xc8d4('0x28')][_0xc8d4('0x26')]({'where':{'type':_0x1a89c2,'resourceId':_0x3fe8de['id']}})[_0xc8d4('0x25')](function(){return _0x1a2f4a;});})[_0xc8d4('0x25')](function(){_0x4dbb5c[_0xc8d4('0x1a')](0xcc)[_0xc8d4('0x1b')]();});}};}function handleEntityNotFound(_0x1d90a3,_0x237243){return function(_0x13c865){if(!_0x13c865){_0x1d90a3['sendStatus'](0x194);}return _0x13c865;};}function handleError(_0x3f6ddf,_0x42ca47){_0x42ca47=_0x42ca47||0x1f4;return function(_0x196f1f){logger[_0xc8d4('0x29')](_0x196f1f['stack']);if(_0x196f1f[_0xc8d4('0x2a')]){delete _0x196f1f[_0xc8d4('0x2a')];}_0x3f6ddf[_0xc8d4('0x1a')](_0x42ca47)[_0xc8d4('0x2b')](_0x196f1f);};}exports[_0xc8d4('0x2c')]=function(_0x1ed2d8,_0x356c1a){var _0x1dece3={},_0x2ceb12={},_0x3d6809={'count':0x0,'rows':[]};var _0x33341e=_['map'](db[_0xc8d4('0x2d')]['rawAttributes'],function(_0x9ad893){return{'name':_0x9ad893[_0xc8d4('0x2e')],'type':_0x9ad893['type']['key']};});_0x2ceb12[_0xc8d4('0x2f')]=_['map'](_0x33341e,'name');_0x2ceb12[_0xc8d4('0x30')]=_['keys'](_0x1ed2d8[_0xc8d4('0x30')]);_0x2ceb12[_0xc8d4('0x31')]=_[_0xc8d4('0x32')](_0x2ceb12['model'],_0x2ceb12[_0xc8d4('0x30')]);_0x1dece3[_0xc8d4('0x33')]=_[_0xc8d4('0x32')](_0x2ceb12[_0xc8d4('0x2f')],qs[_0xc8d4('0x34')](_0x1ed2d8['query'][_0xc8d4('0x34')]));_0x1dece3['attributes']=_0x1dece3[_0xc8d4('0x33')]['length']?_0x1dece3['attributes']:_0x2ceb12['model'];if(!_0x1ed2d8[_0xc8d4('0x30')][_0xc8d4('0x35')](_0xc8d4('0x36'))){_0x1dece3[_0xc8d4('0x1f')]=qs['limit'](_0x1ed2d8[_0xc8d4('0x30')][_0xc8d4('0x1f')]);_0x1dece3[_0xc8d4('0x1d')]=qs['offset'](_0x1ed2d8[_0xc8d4('0x30')][_0xc8d4('0x1d')]);}_0x1dece3[_0xc8d4('0x37')]=qs[_0xc8d4('0x38')](_0x1ed2d8[_0xc8d4('0x30')]['sort']);_0x1dece3['where']=qs[_0xc8d4('0x31')](_[_0xc8d4('0x39')](_0x1ed2d8[_0xc8d4('0x30')],_0x2ceb12['filters']),_0x33341e);if(_0x1ed2d8[_0xc8d4('0x30')]['filter']){_0x1dece3[_0xc8d4('0x3a')]=_[_0xc8d4('0x3b')](_0x1dece3['where'],{'$or':_['map'](_0x33341e,function(_0x2e32be){if(_0x2e32be[_0xc8d4('0x3c')]!=='VIRTUAL'){var _0x2e34c4={};_0x2e34c4[_0x2e32be[_0xc8d4('0x2a')]]={'$like':'%'+_0x1ed2d8['query'][_0xc8d4('0x3d')]+'%'};return _0x2e34c4;}})});}_0x1dece3=_[_0xc8d4('0x3b')]({},_0x1dece3,_0x1ed2d8[_0xc8d4('0x3e')]);var _0x33097b={'where':_0x1dece3[_0xc8d4('0x3a')]};return db[_0xc8d4('0x2d')][_0xc8d4('0x20')](_0x33097b)[_0xc8d4('0x25')](function(_0x3ae70e){_0x3d6809[_0xc8d4('0x20')]=_0x3ae70e;if(_0x1ed2d8[_0xc8d4('0x30')]['includeAll']){_0x1dece3['include']=[{'all':!![]}];}return db[_0xc8d4('0x2d')]['findAll'](_0x1dece3);})[_0xc8d4('0x25')](function(_0x3ebe34){_0x3d6809[_0xc8d4('0x3f')]=_0x3ebe34;return _0x3d6809;})[_0xc8d4('0x25')](respondWithFilteredResult(_0x356c1a,_0x1dece3))[_0xc8d4('0x40')](handleError(_0x356c1a,null));};exports[_0xc8d4('0x41')]=function(_0x5b2203,_0x47882e){var _0x27388b={'raw':!![],'where':{'id':_0x5b2203[_0xc8d4('0x42')]['id']}},_0x5cd668={};_0x5cd668[_0xc8d4('0x2f')]=_[_0xc8d4('0x43')](db['CmContactHasItem']['rawAttributes']);_0x5cd668['query']=_[_0xc8d4('0x43')](_0x5b2203[_0xc8d4('0x30')]);_0x5cd668[_0xc8d4('0x31')]=_[_0xc8d4('0x32')](_0x5cd668['model'],_0x5cd668[_0xc8d4('0x30')]);_0x27388b[_0xc8d4('0x33')]=_[_0xc8d4('0x32')](_0x5cd668['model'],qs[_0xc8d4('0x34')](_0x5b2203[_0xc8d4('0x30')]['fields']));_0x27388b['attributes']=_0x27388b['attributes']['length']?_0x27388b[_0xc8d4('0x33')]:_0x5cd668[_0xc8d4('0x2f')];if(_0x5b2203[_0xc8d4('0x30')]['includeAll']){_0x27388b[_0xc8d4('0x44')]=[{'all':!![]}];}_0x27388b=_['merge']({},_0x27388b,_0x5b2203['options']);return db[_0xc8d4('0x2d')]['find'](_0x27388b)[_0xc8d4('0x25')](handleEntityNotFound(_0x47882e,null))[_0xc8d4('0x25')](respondWithResult(_0x47882e,null))['catch'](handleError(_0x47882e,null));};exports['create']=function(_0x45fe64,_0x4fc25d){return db[_0xc8d4('0x2d')][_0xc8d4('0x45')](_0x45fe64[_0xc8d4('0x46')],{})[_0xc8d4('0x25')](function(_0x2bff99){var _0x3a4832=_0x45fe64[_0xc8d4('0x47')][_0xc8d4('0x27')]({'plain':!![]});if(!_0x3a4832)throw new Error(_0xc8d4('0x48'));if(_0x3a4832['role']===_0xc8d4('0x47')){var _0x18f71a=_0x2bff99[_0xc8d4('0x27')]({'plain':!![]});var _0x118b02=_0xc8d4('0x49');return db[_0xc8d4('0x4a')][_0xc8d4('0x4b')]({'where':{'name':_0x118b02,'userProfileId':_0x3a4832[_0xc8d4('0x4c')]},'raw':!![]})[_0xc8d4('0x25')](function(_0x17f53e){if(_0x17f53e&&_0x17f53e[_0xc8d4('0x4d')]===0x0){return db[_0xc8d4('0x28')][_0xc8d4('0x45')]({'name':_0x18f71a[_0xc8d4('0x2a')],'resourceId':_0x18f71a['id'],'type':_0x17f53e[_0xc8d4('0x2a')],'sectionId':_0x17f53e['id']},{})[_0xc8d4('0x25')](function(){return _0x2bff99;});}else{return _0x2bff99;}})[_0xc8d4('0x40')](function(_0x200da4){logger['error'](_0xc8d4('0x4e'),_0x200da4);throw _0x200da4;});}return _0x2bff99;})['then'](respondWithResult(_0x4fc25d,0xc9))['catch'](handleError(_0x4fc25d,null));};exports[_0xc8d4('0x24')]=function(_0x232737,_0x4402f2){if(_0x232737[_0xc8d4('0x46')]['id']){delete _0x232737[_0xc8d4('0x46')]['id'];}return db[_0xc8d4('0x2d')][_0xc8d4('0x4b')]({'where':{'id':_0x232737[_0xc8d4('0x42')]['id']}})['then'](handleEntityNotFound(_0x4402f2,null))[_0xc8d4('0x25')](saveUpdates(_0x232737[_0xc8d4('0x46')],null))[_0xc8d4('0x25')](respondWithResult(_0x4402f2,null))['catch'](handleError(_0x4402f2,null));};exports['destroy']=function(_0x2cc8b6,_0x3d730f){return db[_0xc8d4('0x2d')]['find']({'where':{'id':_0x2cc8b6[_0xc8d4('0x42')]['id']}})[_0xc8d4('0x25')](handleEntityNotFound(_0x3d730f,null))[_0xc8d4('0x25')](removeEntity(_0x3d730f,null))[_0xc8d4('0x40')](handleError(_0x3d730f,null));}; \ No newline at end of file diff --git a/server/api/cmContactHasItem/cmContactHasItem.model.js b/server/api/cmContactHasItem/cmContactHasItem.model.js index de29f0a..01bb0bd 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 _0xce74=['util','../../config/logger','api','bluebird','request-promise','path','../../config/environment','./cmContactHasItem.attributes','exports','define','CmContactHasItem','cm_contact_has_items','lodash'];(function(_0x216f98,_0x470c7f){var _0xea6b36=function(_0x38f18c){while(--_0x38f18c){_0x216f98['push'](_0x216f98['shift']());}};_0xea6b36(++_0x470c7f);}(_0xce74,0x12a));var _0x4ce7=function(_0x1035c1,_0x2d8583){_0x1035c1=_0x1035c1-0x0;var _0x308d67=_0xce74[_0x1035c1];return _0x308d67;};'use strict';var _=require(_0x4ce7('0x0'));var util=require(_0x4ce7('0x1'));var logger=require(_0x4ce7('0x2'))(_0x4ce7('0x3'));var moment=require('moment');var BPromise=require(_0x4ce7('0x4'));var rp=require(_0x4ce7('0x5'));var fs=require('fs');var path=require(_0x4ce7('0x6'));var rimraf=require('rimraf');var config=require(_0x4ce7('0x7'));var attributes=require(_0x4ce7('0x8'));module[_0x4ce7('0x9')]=function(_0x5d654c,_0x42ef0c){return _0x5d654c[_0x4ce7('0xa')](_0x4ce7('0xb'),attributes,{'tableName':_0x4ce7('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xabed=['moment','bluebird','request-promise','path','rimraf','../../config/environment','./cmContactHasItem.attributes','exports','CmContactHasItem','lodash','util','api'];(function(_0x574913,_0x56dc2c){var _0x126d13=function(_0x133fb7){while(--_0x133fb7){_0x574913['push'](_0x574913['shift']());}};_0x126d13(++_0x56dc2c);}(_0xabed,0x81));var _0xdabe=function(_0x40a825,_0x3bac79){_0x40a825=_0x40a825-0x0;var _0x273a54=_0xabed[_0x40a825];return _0x273a54;};'use strict';var _=require(_0xdabe('0x0'));var util=require(_0xdabe('0x1'));var logger=require('../../config/logger')(_0xdabe('0x2'));var moment=require(_0xdabe('0x3'));var BPromise=require(_0xdabe('0x4'));var rp=require(_0xdabe('0x5'));var fs=require('fs');var path=require(_0xdabe('0x6'));var rimraf=require(_0xdabe('0x7'));var config=require(_0xdabe('0x8'));var attributes=require(_0xdabe('0x9'));module[_0xdabe('0xa')]=function(_0xe7979a,_0xaa770e){return _0xe7979a['define'](_0xdabe('0xb'),attributes,{'tableName':'cm_contact_has_items','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/cmContactHasItem/cmContactHasItem.rpc.js b/server/api/cmContactHasItem/cmContactHasItem.rpc.js index 0f07b03..d4665d9 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 _0x6dc5=['error','code','message','result','catch','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','http','request','then','info','CmContactHasItem,\x20%s,\x20%s','request\x20sent','CmContactHasItem,\x20%s,\x20%s,\x20%s','stringify'];(function(_0x4480b9,_0x5c2949){var _0x3f0f02=function(_0x43502f){while(--_0x43502f){_0x4480b9['push'](_0x4480b9['shift']());}};_0x3f0f02(++_0x5c2949);}(_0x6dc5,0x18c));var _0x56dc=function(_0x49330e,_0x3d6b3a){_0x49330e=_0x49330e-0x0;var _0x3bd188=_0x6dc5[_0x49330e];return _0x3bd188;};'use strict';var _=require(_0x56dc('0x0'));var util=require(_0x56dc('0x1'));var moment=require(_0x56dc('0x2'));var BPromise=require('bluebird');var rs=require(_0x56dc('0x3'));var fs=require('fs');var Redis=require(_0x56dc('0x4'));var db=require(_0x56dc('0x5'))['db'];var utils=require(_0x56dc('0x6'));var logger=require(_0x56dc('0x7'))(_0x56dc('0x8'));var config=require(_0x56dc('0x9'));var jayson=require('jayson/promise');var client=jayson['client'][_0x56dc('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x3d1e76,_0xebe38e,_0x47fa41){return new BPromise(function(_0x380af1,_0x2ac805){return client[_0x56dc('0xb')](_0x3d1e76,_0x47fa41)[_0x56dc('0xc')](function(_0x3259bb){logger[_0x56dc('0xd')](_0x56dc('0xe'),_0xebe38e,_0x56dc('0xf'));logger['debug'](_0x56dc('0x10'),_0xebe38e,_0x56dc('0xf'),JSON[_0x56dc('0x11')](_0x3259bb));if(_0x3259bb['error']){if(_0x3259bb[_0x56dc('0x12')][_0x56dc('0x13')]===0x1f4){logger[_0x56dc('0x12')]('CmContactHasItem,\x20%s,\x20%s',_0xebe38e,_0x3259bb[_0x56dc('0x12')][_0x56dc('0x14')]);return _0x2ac805(_0x3259bb[_0x56dc('0x12')][_0x56dc('0x14')]);}logger[_0x56dc('0x12')](_0x56dc('0xe'),_0xebe38e,_0x3259bb['error'][_0x56dc('0x14')]);return _0x380af1(_0x3259bb[_0x56dc('0x12')][_0x56dc('0x14')]);}else{logger[_0x56dc('0xd')](_0x56dc('0xe'),_0xebe38e,_0x56dc('0xf'));_0x380af1(_0x3259bb[_0x56dc('0x15')][_0x56dc('0x14')]);}})[_0x56dc('0x16')](function(_0xf64562){logger['error'](_0x56dc('0xe'),_0xebe38e,_0xf64562);_0x2ac805(_0xf64562);});});} \ No newline at end of file +var _0xf030=['../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','then','info','CmContactHasItem,\x20%s,\x20%s','request\x20sent','debug','CmContactHasItem,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','lodash','util','moment','bluebird','randomstring'];(function(_0x5ef55a,_0x2a03b1){var _0x20ae40=function(_0x46ce81){while(--_0x46ce81){_0x5ef55a['push'](_0x5ef55a['shift']());}};_0x20ae40(++_0x2a03b1);}(_0xf030,0xa3));var _0x0f03=function(_0x40a045,_0x516f0e){_0x40a045=_0x40a045-0x0;var _0x1a687c=_0xf030[_0x40a045];return _0x1a687c;};'use strict';var _=require(_0x0f03('0x0'));var util=require(_0x0f03('0x1'));var moment=require(_0x0f03('0x2'));var BPromise=require(_0x0f03('0x3'));var rs=require(_0x0f03('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x0f03('0x5'))['db'];var utils=require(_0x0f03('0x6'));var logger=require(_0x0f03('0x7'))(_0x0f03('0x8'));var config=require(_0x0f03('0x9'));var jayson=require(_0x0f03('0xa'));var client=jayson[_0x0f03('0xb')][_0x0f03('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x5ebb88,_0x45dfbf,_0x3dd59d){return new BPromise(function(_0x4db168,_0x1802a1){return client['request'](_0x5ebb88,_0x3dd59d)[_0x0f03('0xd')](function(_0x4ed3d9){logger[_0x0f03('0xe')](_0x0f03('0xf'),_0x45dfbf,_0x0f03('0x10'));logger[_0x0f03('0x11')](_0x0f03('0x12'),_0x45dfbf,_0x0f03('0x10'),JSON[_0x0f03('0x13')](_0x4ed3d9));if(_0x4ed3d9['error']){if(_0x4ed3d9['error']['code']===0x1f4){logger[_0x0f03('0x14')](_0x0f03('0xf'),_0x45dfbf,_0x4ed3d9[_0x0f03('0x14')][_0x0f03('0x15')]);return _0x1802a1(_0x4ed3d9[_0x0f03('0x14')][_0x0f03('0x15')]);}logger[_0x0f03('0x14')](_0x0f03('0xf'),_0x45dfbf,_0x4ed3d9[_0x0f03('0x14')][_0x0f03('0x15')]);return _0x4db168(_0x4ed3d9[_0x0f03('0x14')][_0x0f03('0x15')]);}else{logger[_0x0f03('0xe')](_0x0f03('0xf'),_0x45dfbf,_0x0f03('0x10'));_0x4db168(_0x4ed3d9[_0x0f03('0x16')][_0x0f03('0x15')]);}})[_0x0f03('0x17')](function(_0x2448d4){logger['error']('CmContactHasItem,\x20%s,\x20%s',_0x45dfbf,_0x2448d4);_0x1802a1(_0x2448d4);});});} \ No newline at end of file diff --git a/server/api/cmContactHasItem/index.js b/server/api/cmContactHasItem/index.js index 21a0e33..908dc96 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 _0x82b1=['/:id','show','post','put','update','delete','destroy','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','isAuthenticated','index','get'];(function(_0x2ff238,_0x1811d2){var _0x204a56=function(_0x5bf2e1){while(--_0x5bf2e1){_0x2ff238['push'](_0x2ff238['shift']());}};_0x204a56(++_0x1811d2);}(_0x82b1,0x197));var _0x182b=function(_0x246a6c,_0x33a5cd){_0x246a6c=_0x246a6c-0x0;var _0x53a05a=_0x82b1[_0x246a6c];return _0x53a05a;};'use strict';var multer=require(_0x182b('0x0'));var util=require(_0x182b('0x1'));var path=require(_0x182b('0x2'));var timeout=require(_0x182b('0x3'));var express=require(_0x182b('0x4'));var router=express[_0x182b('0x5')]();var fs_extra=require(_0x182b('0x6'));var auth=require(_0x182b('0x7'));var interaction=require(_0x182b('0x8'));var config=require(_0x182b('0x9'));var controller=require('./cmContactHasItem.controller');router['get']('/',auth[_0x182b('0xa')](),controller[_0x182b('0xb')]);router[_0x182b('0xc')](_0x182b('0xd'),auth[_0x182b('0xa')](),controller[_0x182b('0xe')]);router[_0x182b('0xf')]('/',auth[_0x182b('0xa')](),controller['create']);router[_0x182b('0x10')]('/:id',auth[_0x182b('0xa')](),controller[_0x182b('0x11')]);router[_0x182b('0x12')]('/:id',auth[_0x182b('0xa')](),controller[_0x182b('0x13')]);module[_0x182b('0x14')]=router; \ No newline at end of file +var _0x65a2=['./cmContactHasItem.controller','get','isAuthenticated','index','/:id','post','create','put','update','delete','destroy','exports','multer','util','connect-timeout','express','fs-extra','../../components/auth/service','../../config/environment'];(function(_0x3c9626,_0x2bf37e){var _0x5c001f=function(_0x3f0691){while(--_0x3f0691){_0x3c9626['push'](_0x3c9626['shift']());}};_0x5c001f(++_0x2bf37e);}(_0x65a2,0x7e));var _0x265a=function(_0x395608,_0x30cfe2){_0x395608=_0x395608-0x0;var _0x16af55=_0x65a2[_0x395608];return _0x16af55;};'use strict';var multer=require(_0x265a('0x0'));var util=require(_0x265a('0x1'));var path=require('path');var timeout=require(_0x265a('0x2'));var express=require(_0x265a('0x3'));var router=express['Router']();var fs_extra=require(_0x265a('0x4'));var auth=require(_0x265a('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0x265a('0x6'));var controller=require(_0x265a('0x7'));router[_0x265a('0x8')]('/',auth[_0x265a('0x9')](),controller[_0x265a('0xa')]);router[_0x265a('0x8')](_0x265a('0xb'),auth[_0x265a('0x9')](),controller['show']);router[_0x265a('0xc')]('/',auth[_0x265a('0x9')](),controller[_0x265a('0xd')]);router[_0x265a('0xe')](_0x265a('0xb'),auth[_0x265a('0x9')](),controller[_0x265a('0xf')]);router[_0x265a('0x10')]('/:id',auth['isAuthenticated'](),controller[_0x265a('0x11')]);module[_0x265a('0x12')]=router; \ No newline at end of file diff --git a/server/api/cmCustomField/cmCustomField.attributes.js b/server/api/cmCustomField/cmCustomField.attributes.js index 65dd409..9e8768c 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 _0x5211=['select','values','stringify','BOOLEAN','ENUM','voice','exports','VIRTUAL','getDataValue','alias','STRING','setDataValue','TEXT','long','type'];(function(_0x114cdd,_0x3d5c3c){var _0x2eee5c=function(_0x46ef8d){while(--_0x46ef8d){_0x114cdd['push'](_0x114cdd['shift']());}};_0x2eee5c(++_0x3d5c3c);}(_0x5211,0x105));var _0x1521=function(_0x312c87,_0x336076){_0x312c87=_0x312c87-0x0;var _0x3f4a1a=_0x5211[_0x312c87];return _0x3f4a1a;};'use strict';var Sequelize=require('sequelize');var _=require('lodash');module[_0x1521('0x0')]={'name':{'type':Sequelize[_0x1521('0x1')],'get':function(_0x2f6837){return this[_0x1521('0x2')](_0x1521('0x3'));}},'alias':{'type':Sequelize[_0x1521('0x4')],'allowNull':![],'set':function(_0x3a9ff3){this[_0x1521('0x5')](_0x1521('0x3'),_0x3a9ff3?_0x3a9ff3:this[_0x1521('0x2')]('name'));}},'type':{'type':Sequelize[_0x1521('0x4')],'allowNull':![]},'values':{'type':Sequelize[_0x1521('0x6')](_0x1521('0x7')),'get':function(){if(this[_0x1521('0x2')](_0x1521('0x8'))===_0x1521('0x9')){return JSON['parse'](this[_0x1521('0x2')](_0x1521('0xa')));}else{return this['getDataValue'](_0x1521('0xa'));}},'set':function(_0x3f4bd9){if(Array['isArray'](_0x3f4bd9)){this[_0x1521('0x5')](_0x1521('0xa'),JSON[_0x1521('0xb')](_0x3f4bd9));}else{this[_0x1521('0x5')](_0x1521('0xa'),_0x3f4bd9);}}},'required':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'clickToAction':{'type':Sequelize[_0x1521('0xc')],'defaultValue':![]},'actionType':{'type':Sequelize[_0x1521('0xd')](_0x1521('0xe'))}}; \ No newline at end of file +var _0x9fb8=['exports','VIRTUAL','getDataValue','STRING','setDataValue','alias','name','TEXT','long','values','isArray','stringify','BOOLEAN','ENUM','voice','sequelize'];(function(_0x433d0a,_0x348f5b){var _0x883e8e=function(_0x16b4eb){while(--_0x16b4eb){_0x433d0a['push'](_0x433d0a['shift']());}};_0x883e8e(++_0x348f5b);}(_0x9fb8,0x10f));var _0x89fb=function(_0x1de1c9,_0x179709){_0x1de1c9=_0x1de1c9-0x0;var _0x41618e=_0x9fb8[_0x1de1c9];return _0x41618e;};'use strict';var Sequelize=require(_0x89fb('0x0'));var _=require('lodash');module[_0x89fb('0x1')]={'name':{'type':Sequelize[_0x89fb('0x2')],'get':function(_0x3f1ff0){return this[_0x89fb('0x3')]('alias');}},'alias':{'type':Sequelize[_0x89fb('0x4')],'allowNull':![],'set':function(_0xf80c99){this[_0x89fb('0x5')](_0x89fb('0x6'),_0xf80c99?_0xf80c99:this[_0x89fb('0x3')](_0x89fb('0x7')));}},'type':{'type':Sequelize[_0x89fb('0x4')],'allowNull':![]},'values':{'type':Sequelize[_0x89fb('0x8')](_0x89fb('0x9')),'get':function(){if(this[_0x89fb('0x3')]('type')==='select'){return JSON['parse'](this[_0x89fb('0x3')](_0x89fb('0xa')));}else{return this['getDataValue'](_0x89fb('0xa'));}},'set':function(_0x14017a){if(Array[_0x89fb('0xb')](_0x14017a)){this[_0x89fb('0x5')]('values',JSON[_0x89fb('0xc')](_0x14017a));}else{this[_0x89fb('0x5')](_0x89fb('0xa'),_0x14017a);}}},'required':{'type':Sequelize[_0x89fb('0xd')],'defaultValue':![]},'clickToAction':{'type':Sequelize[_0x89fb('0xd')],'defaultValue':![]},'actionType':{'type':Sequelize[_0x89fb('0xe')](_0x89fb('0xf'))}}; \ No newline at end of file diff --git a/server/api/cmCustomField/cmCustomField.controller.js b/server/api/cmCustomField/cmCustomField.controller.js index 92aa456..e422d90 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 _0x7494=['show','params','keys','body','find','create','sequelize','TEXT','text','Sequelize','INTEGER','switch','BOOLEAN','defaultValue','queryInterface','addColumn','format','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','mustache','path','sox','to-csv','fs-extra','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','sendStatus','end','status','offset','undefined','count','limit','set','Content-Range','json','apply','save','then','destroy','error','stack','name','send','index','map','CmCustomField','rawAttributes','fieldName','type','key','model','differenceBy','query','filters','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','where','merge','VIRTUAL','filter','options','includeAll','include','rows','catch'];(function(_0x55bdd2,_0x2dae28){var _0x3b6e03=function(_0x5ea479){while(--_0x5ea479){_0x55bdd2['push'](_0x55bdd2['shift']());}};_0x3b6e03(++_0x2dae28);}(_0x7494,0x69));var _0x4749=function(_0x1a0353,_0x52249e){_0x1a0353=_0x1a0353-0x0;var _0x1f6643=_0x7494[_0x1a0353];return _0x1f6643;};'use strict';var emlformat=require(_0x4749('0x0'));var rimraf=require(_0x4749('0x1'));var zipdir=require(_0x4749('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x4749('0x3'));var moment=require(_0x4749('0x4'));var BPromise=require(_0x4749('0x5'));var Mustache=require(_0x4749('0x6'));var util=require('util');var path=require(_0x4749('0x7'));var sox=require(_0x4749('0x8'));var csv=require(_0x4749('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x4749('0xa'));var _=require('lodash');var squel=require(_0x4749('0xb'));var crypto=require(_0x4749('0xc'));var jsforce=require(_0x4749('0xd'));var deskjs=require(_0x4749('0xe'));var toCsv=require(_0x4749('0x9'));var querystring=require(_0x4749('0xf'));var Papa=require(_0x4749('0x10'));var Redis=require(_0x4749('0x11'));var authService=require(_0x4749('0x12'));var qs=require('../../components/parsers/qs');var as=require(_0x4749('0x13'));var hardwareService=require(_0x4749('0x14'));var logger=require(_0x4749('0x15'))(_0x4749('0x16'));var utils=require(_0x4749('0x17'));var config=require(_0x4749('0x18'));var licenseUtil=require(_0x4749('0x19'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x482959,_0x3d86a8){_0x3d86a8=_0x3d86a8||0xcc;return function(_0x5a0faf){if(_0x5a0faf){return _0x482959[_0x4749('0x1a')](_0x3d86a8);}return _0x482959['status'](_0x3d86a8)[_0x4749('0x1b')]();};}function respondWithResult(_0x4c8547,_0x348c7a){_0x348c7a=_0x348c7a||0xc8;return function(_0x228323){if(_0x228323){return _0x4c8547[_0x4749('0x1c')](_0x348c7a)['json'](_0x228323);}};}function respondWithFilteredResult(_0x1812f4,_0x70045c){return function(_0x599067){if(_0x599067){var _0x530003=typeof _0x70045c[_0x4749('0x1d')]===_0x4749('0x1e')&&typeof _0x70045c['limit']===_0x4749('0x1e');var _0x570d3d=_0x599067['count'];var _0x5e6600=_0x530003?0x0:_0x70045c['offset'];var _0x260835=_0x530003?_0x599067[_0x4749('0x1f')]:_0x70045c[_0x4749('0x1d')]+_0x70045c[_0x4749('0x20')];var _0x48f788;if(_0x260835>=_0x570d3d){_0x260835=_0x570d3d;_0x48f788=0xc8;}else{_0x48f788=0xce;}_0x1812f4[_0x4749('0x1c')](_0x48f788);return _0x1812f4[_0x4749('0x21')](_0x4749('0x22'),_0x5e6600+'-'+_0x260835+'/'+_0x570d3d)[_0x4749('0x23')](_0x599067);}return null;};}function patchUpdates(_0x24c4c7){return function(_0x2196b2){try{jsonpatch[_0x4749('0x24')](_0x2196b2,_0x24c4c7,!![]);}catch(_0x4b1fbe){return BPromise['reject'](_0x4b1fbe);}return _0x2196b2[_0x4749('0x25')]();};}function saveUpdates(_0x1fbdee,_0x3b1a77){return function(_0x474da6){if(_0x474da6){return _0x474da6['update'](_0x1fbdee)[_0x4749('0x26')](function(_0x419bc1){return _0x419bc1;});}return null;};}function removeEntity(_0x2bae93,_0x26b44b){return function(_0x56af41){if(_0x56af41){return _0x56af41[_0x4749('0x27')]()[_0x4749('0x26')](function(){_0x2bae93['status'](0xcc)[_0x4749('0x1b')]();});}};}function handleEntityNotFound(_0x14d7e0,_0x3a3eb8){return function(_0x29f4c4){if(!_0x29f4c4){_0x14d7e0['sendStatus'](0x194);}return _0x29f4c4;};}function handleError(_0x4e1a02,_0x284608){_0x284608=_0x284608||0x1f4;return function(_0x59b394){logger[_0x4749('0x28')](_0x59b394[_0x4749('0x29')]);if(_0x59b394['name']){delete _0x59b394[_0x4749('0x2a')];}_0x4e1a02[_0x4749('0x1c')](_0x284608)[_0x4749('0x2b')](_0x59b394);};}exports[_0x4749('0x2c')]=function(_0x5a58d1,_0x50a103){var _0x202e32={},_0x3331ac={},_0x4eb595={'count':0x0,'rows':[]};var _0x2ae64b=_[_0x4749('0x2d')](db[_0x4749('0x2e')][_0x4749('0x2f')],function(_0x30d9e2){return{'name':_0x30d9e2[_0x4749('0x30')],'type':_0x30d9e2[_0x4749('0x31')][_0x4749('0x32')]};});_0x3331ac[_0x4749('0x33')]=_[_0x4749('0x34')](_[_0x4749('0x2d')](_0x2ae64b,_0x4749('0x2a')),['name']);_0x3331ac[_0x4749('0x35')]=_['keys'](_0x5a58d1[_0x4749('0x35')]);_0x3331ac[_0x4749('0x36')]=_[_0x4749('0x37')](_0x3331ac[_0x4749('0x33')],_0x3331ac['query']);_0x202e32[_0x4749('0x38')]=_['intersection'](_0x3331ac[_0x4749('0x33')],qs['fields'](_0x5a58d1[_0x4749('0x35')][_0x4749('0x39')]));_0x202e32[_0x4749('0x38')]=_0x202e32[_0x4749('0x38')]['length']?_0x202e32[_0x4749('0x38')]:_0x3331ac[_0x4749('0x33')];if(!_0x5a58d1['query'][_0x4749('0x3a')](_0x4749('0x3b'))){_0x202e32[_0x4749('0x20')]=qs[_0x4749('0x20')](_0x5a58d1[_0x4749('0x35')][_0x4749('0x20')]);_0x202e32['offset']=qs[_0x4749('0x1d')](_0x5a58d1[_0x4749('0x35')][_0x4749('0x1d')]);}_0x202e32[_0x4749('0x3c')]=qs['sort'](_0x5a58d1[_0x4749('0x35')][_0x4749('0x3d')]);_0x202e32['where']=qs['filters'](_['pick'](_0x5a58d1[_0x4749('0x35')],_0x3331ac['filters']),_0x2ae64b);if(_0x5a58d1[_0x4749('0x35')]['filter']){_0x202e32[_0x4749('0x3e')]=_[_0x4749('0x3f')](_0x202e32[_0x4749('0x3e')],{'$or':_[_0x4749('0x2d')](_0x2ae64b,function(_0x5635d1){if(_0x5635d1[_0x4749('0x31')]!==_0x4749('0x40')){var _0x3dc123={};_0x3dc123[_0x5635d1[_0x4749('0x2a')]]={'$like':'%'+_0x5a58d1[_0x4749('0x35')][_0x4749('0x41')]+'%'};return _0x3dc123;}})});}_0x202e32=_[_0x4749('0x3f')]({},_0x202e32,_0x5a58d1[_0x4749('0x42')]);var _0x5a3777={'where':_0x202e32[_0x4749('0x3e')]};return db['CmCustomField'][_0x4749('0x1f')](_0x5a3777)[_0x4749('0x26')](function(_0x4c2a7d){_0x4eb595[_0x4749('0x1f')]=_0x4c2a7d;if(_0x5a58d1['query'][_0x4749('0x43')]){_0x202e32[_0x4749('0x44')]=[{'all':!![]}];}return db[_0x4749('0x2e')]['findAll'](_0x202e32);})[_0x4749('0x26')](function(_0x580ac7){_0x4eb595[_0x4749('0x45')]=_0x580ac7;return _0x4eb595;})[_0x4749('0x26')](respondWithFilteredResult(_0x50a103,_0x202e32))[_0x4749('0x46')](handleError(_0x50a103,null));};exports[_0x4749('0x47')]=function(_0x4d3224,_0x14c7e7){var _0x281472={'raw':!![],'where':{'id':_0x4d3224[_0x4749('0x48')]['id']}},_0x26f788={};_0x26f788['model']=_['keys'](db[_0x4749('0x2e')][_0x4749('0x2f')]);_0x26f788[_0x4749('0x35')]=_[_0x4749('0x49')](_0x4d3224[_0x4749('0x35')]);_0x26f788[_0x4749('0x36')]=_[_0x4749('0x37')](_0x26f788[_0x4749('0x33')],_0x26f788[_0x4749('0x35')]);_0x281472[_0x4749('0x38')]=_['intersection'](_0x26f788[_0x4749('0x33')],qs[_0x4749('0x39')](_0x4d3224[_0x4749('0x35')][_0x4749('0x39')]));_0x281472[_0x4749('0x38')]=_0x281472[_0x4749('0x38')]['length']?_0x281472[_0x4749('0x38')]:_0x26f788[_0x4749('0x33')];if(_0x4d3224['query'][_0x4749('0x43')]){_0x281472[_0x4749('0x44')]=[{'all':!![]}];}_0x281472=_[_0x4749('0x3f')]({},_0x281472,_0x4d3224[_0x4749('0x42')]);return db[_0x4749('0x2e')]['find'](_0x281472)['then'](handleEntityNotFound(_0x14c7e7,null))[_0x4749('0x26')](respondWithResult(_0x14c7e7,null))[_0x4749('0x46')](handleError(_0x14c7e7,null));};exports['update']=function(_0x398f12,_0x4639b6){if(_0x398f12[_0x4749('0x4a')]['id']){delete _0x398f12['body']['id'];}return db['CmCustomField'][_0x4749('0x4b')]({'where':{'id':_0x398f12[_0x4749('0x48')]['id']}})[_0x4749('0x26')](handleEntityNotFound(_0x4639b6,null))[_0x4749('0x26')](saveUpdates(_0x398f12['body'],null))[_0x4749('0x26')](respondWithResult(_0x4639b6,null))[_0x4749('0x46')](handleError(_0x4639b6,null));};exports[_0x4749('0x27')]=function(_0x7b7cd6,_0xd3f44b){return db['CmCustomField'][_0x4749('0x4b')]({'where':{'id':_0x7b7cd6[_0x4749('0x48')]['id']}})['then'](handleEntityNotFound(_0xd3f44b,null))[_0x4749('0x26')](removeEntity(_0xd3f44b,null))[_0x4749('0x46')](handleError(_0xd3f44b,null));};exports[_0x4749('0x4c')]=function(_0xf1fc50,_0x64a09c){var _0x155d53;return db[_0x4749('0x4d')]['transaction'](function(_0x267d57){return db[_0x4749('0x2e')][_0x4749('0x4c')](_0xf1fc50[_0x4749('0x4a')],{'transaction':_0x267d57})[_0x4749('0x26')](function(_0x11e6f1){_0x155d53=_0x11e6f1;var _0x507594={'type':db['Sequelize'][_0x4749('0x4e')],'transaction':_0x267d57};switch(_0xf1fc50[_0x4749('0x4a')][_0x4749('0x31')]){case _0x4749('0x4f'):_0x507594[_0x4749('0x31')]=db['Sequelize'][_0x4749('0x4e')];break;case'number':_0x507594[_0x4749('0x31')]=db[_0x4749('0x50')][_0x4749('0x51')];break;case _0x4749('0x52'):_0x507594[_0x4749('0x31')]=db[_0x4749('0x50')][_0x4749('0x53')];_0x507594[_0x4749('0x54')]=![];break;default:}return db[_0x4749('0x4d')][_0x4749('0x55')][_0x4749('0x56')]('cm_contacts',util[_0x4749('0x57')]('cf_%d',_0x155d53['id']),_0x507594);})['then'](function(){return _0x155d53;});})[_0x4749('0x26')](respondWithResult(_0x64a09c,0xc9))[_0x4749('0x46')](handleError(_0x64a09c,null));}; \ No newline at end of file +var _0x5ca0=['bluebird','mustache','util','path','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','Content-Range','apply','reject','save','update','destroy','then','error','stack','name','send','index','CmCustomField','rawAttributes','fieldName','key','query','keys','filters','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','sort','where','filter','merge','map','type','options','include','findAll','catch','show','params','includeAll','body','find','create','transaction','Sequelize','text','TEXT','number','INTEGER','switch','BOOLEAN','defaultValue','sequelize','queryInterface','addColumn','format','rimraf','fast-json-patch'];(function(_0x494452,_0x5b9635){var _0x456e08=function(_0xf79cd4){while(--_0xf79cd4){_0x494452['push'](_0x494452['shift']());}};_0x456e08(++_0x5b9635);}(_0x5ca0,0x15e));var _0x05ca=function(_0x5e61fb,_0x239c06){_0x5e61fb=_0x5e61fb-0x0;var _0x261144=_0x5ca0[_0x5e61fb];return _0x261144;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x05ca('0x0'));var zipdir=require('zip-dir');var jsonpatch=require(_0x05ca('0x1'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0x05ca('0x2'));var Mustache=require(_0x05ca('0x3'));var util=require(_0x05ca('0x4'));var path=require(_0x05ca('0x5'));var sox=require('sox');var csv=require(_0x05ca('0x6'));var ejs=require(_0x05ca('0x7'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x05ca('0x8'));var squel=require(_0x05ca('0x9'));var crypto=require(_0x05ca('0xa'));var jsforce=require(_0x05ca('0xb'));var deskjs=require(_0x05ca('0xc'));var toCsv=require(_0x05ca('0x6'));var querystring=require(_0x05ca('0xd'));var Papa=require(_0x05ca('0xe'));var Redis=require(_0x05ca('0xf'));var authService=require(_0x05ca('0x10'));var qs=require('../../components/parsers/qs');var as=require(_0x05ca('0x11'));var hardwareService=require(_0x05ca('0x12'));var logger=require(_0x05ca('0x13'))(_0x05ca('0x14'));var utils=require(_0x05ca('0x15'));var config=require(_0x05ca('0x16'));var licenseUtil=require(_0x05ca('0x17'));var db=require(_0x05ca('0x18'))['db'];function respondWithStatusCode(_0x52404f,_0x18da78){_0x18da78=_0x18da78||0xcc;return function(_0x31e03f){if(_0x31e03f){return _0x52404f[_0x05ca('0x19')](_0x18da78);}return _0x52404f[_0x05ca('0x1a')](_0x18da78)[_0x05ca('0x1b')]();};}function respondWithResult(_0x161bad,_0x3cee5c){_0x3cee5c=_0x3cee5c||0xc8;return function(_0x5250b2){if(_0x5250b2){return _0x161bad[_0x05ca('0x1a')](_0x3cee5c)[_0x05ca('0x1c')](_0x5250b2);}};}function respondWithFilteredResult(_0x513ecd,_0x167eff){return function(_0x19a89c){if(_0x19a89c){var _0xc7eaa0=typeof _0x167eff[_0x05ca('0x1d')]===_0x05ca('0x1e')&&typeof _0x167eff[_0x05ca('0x1f')]===_0x05ca('0x1e');var _0x14f7bb=_0x19a89c[_0x05ca('0x20')];var _0x5c40f1=_0xc7eaa0?0x0:_0x167eff[_0x05ca('0x1d')];var _0x949786=_0xc7eaa0?_0x19a89c[_0x05ca('0x20')]:_0x167eff[_0x05ca('0x1d')]+_0x167eff[_0x05ca('0x1f')];var _0xc7182e;if(_0x949786>=_0x14f7bb){_0x949786=_0x14f7bb;_0xc7182e=0xc8;}else{_0xc7182e=0xce;}_0x513ecd['status'](_0xc7182e);return _0x513ecd['set'](_0x05ca('0x21'),_0x5c40f1+'-'+_0x949786+'/'+_0x14f7bb)[_0x05ca('0x1c')](_0x19a89c);}return null;};}function patchUpdates(_0x48bc6e){return function(_0x3384d8){try{jsonpatch[_0x05ca('0x22')](_0x3384d8,_0x48bc6e,!![]);}catch(_0x474db8){return BPromise[_0x05ca('0x23')](_0x474db8);}return _0x3384d8[_0x05ca('0x24')]();};}function saveUpdates(_0x2827cd,_0x2bac23){return function(_0x1eadf3){if(_0x1eadf3){return _0x1eadf3[_0x05ca('0x25')](_0x2827cd)['then'](function(_0x1ad459){return _0x1ad459;});}return null;};}function removeEntity(_0x19bd83,_0x366381){return function(_0x5511a1){if(_0x5511a1){return _0x5511a1[_0x05ca('0x26')]()[_0x05ca('0x27')](function(){_0x19bd83[_0x05ca('0x1a')](0xcc)[_0x05ca('0x1b')]();});}};}function handleEntityNotFound(_0x46c198,_0xcd04dc){return function(_0x14993e){if(!_0x14993e){_0x46c198['sendStatus'](0x194);}return _0x14993e;};}function handleError(_0xd0defe,_0x402030){_0x402030=_0x402030||0x1f4;return function(_0x101cc3){logger[_0x05ca('0x28')](_0x101cc3[_0x05ca('0x29')]);if(_0x101cc3[_0x05ca('0x2a')]){delete _0x101cc3[_0x05ca('0x2a')];}_0xd0defe[_0x05ca('0x1a')](_0x402030)[_0x05ca('0x2b')](_0x101cc3);};}exports[_0x05ca('0x2c')]=function(_0x1e5f45,_0x5e6f04){var _0xad53dd={},_0x49a869={},_0x1dcce8={'count':0x0,'rows':[]};var _0x54f99d=_['map'](db[_0x05ca('0x2d')][_0x05ca('0x2e')],function(_0x338f70){return{'name':_0x338f70[_0x05ca('0x2f')],'type':_0x338f70['type'][_0x05ca('0x30')]};});_0x49a869['model']=_['differenceBy'](_['map'](_0x54f99d,_0x05ca('0x2a')),[_0x05ca('0x2a')]);_0x49a869[_0x05ca('0x31')]=_[_0x05ca('0x32')](_0x1e5f45[_0x05ca('0x31')]);_0x49a869[_0x05ca('0x33')]=_[_0x05ca('0x34')](_0x49a869[_0x05ca('0x35')],_0x49a869[_0x05ca('0x31')]);_0xad53dd[_0x05ca('0x36')]=_[_0x05ca('0x34')](_0x49a869[_0x05ca('0x35')],qs[_0x05ca('0x37')](_0x1e5f45['query'][_0x05ca('0x37')]));_0xad53dd[_0x05ca('0x36')]=_0xad53dd[_0x05ca('0x36')][_0x05ca('0x38')]?_0xad53dd[_0x05ca('0x36')]:_0x49a869[_0x05ca('0x35')];if(!_0x1e5f45[_0x05ca('0x31')][_0x05ca('0x39')](_0x05ca('0x3a'))){_0xad53dd['limit']=qs[_0x05ca('0x1f')](_0x1e5f45[_0x05ca('0x31')]['limit']);_0xad53dd[_0x05ca('0x1d')]=qs[_0x05ca('0x1d')](_0x1e5f45[_0x05ca('0x31')]['offset']);}_0xad53dd['order']=qs[_0x05ca('0x3b')](_0x1e5f45[_0x05ca('0x31')][_0x05ca('0x3b')]);_0xad53dd[_0x05ca('0x3c')]=qs['filters'](_['pick'](_0x1e5f45['query'],_0x49a869[_0x05ca('0x33')]),_0x54f99d);if(_0x1e5f45[_0x05ca('0x31')][_0x05ca('0x3d')]){_0xad53dd[_0x05ca('0x3c')]=_[_0x05ca('0x3e')](_0xad53dd[_0x05ca('0x3c')],{'$or':_[_0x05ca('0x3f')](_0x54f99d,function(_0x278f14){if(_0x278f14[_0x05ca('0x40')]!=='VIRTUAL'){var _0x444882={};_0x444882[_0x278f14[_0x05ca('0x2a')]]={'$like':'%'+_0x1e5f45[_0x05ca('0x31')][_0x05ca('0x3d')]+'%'};return _0x444882;}})});}_0xad53dd=_[_0x05ca('0x3e')]({},_0xad53dd,_0x1e5f45[_0x05ca('0x41')]);var _0x36572f={'where':_0xad53dd[_0x05ca('0x3c')]};return db[_0x05ca('0x2d')][_0x05ca('0x20')](_0x36572f)[_0x05ca('0x27')](function(_0x1f843e){_0x1dcce8[_0x05ca('0x20')]=_0x1f843e;if(_0x1e5f45[_0x05ca('0x31')]['includeAll']){_0xad53dd[_0x05ca('0x42')]=[{'all':!![]}];}return db[_0x05ca('0x2d')][_0x05ca('0x43')](_0xad53dd);})['then'](function(_0x16854b){_0x1dcce8['rows']=_0x16854b;return _0x1dcce8;})['then'](respondWithFilteredResult(_0x5e6f04,_0xad53dd))[_0x05ca('0x44')](handleError(_0x5e6f04,null));};exports[_0x05ca('0x45')]=function(_0x2ae8cb,_0x570191){var _0x3dff3b={'raw':!![],'where':{'id':_0x2ae8cb[_0x05ca('0x46')]['id']}},_0xbe8b10={};_0xbe8b10[_0x05ca('0x35')]=_[_0x05ca('0x32')](db[_0x05ca('0x2d')][_0x05ca('0x2e')]);_0xbe8b10['query']=_[_0x05ca('0x32')](_0x2ae8cb['query']);_0xbe8b10[_0x05ca('0x33')]=_[_0x05ca('0x34')](_0xbe8b10['model'],_0xbe8b10[_0x05ca('0x31')]);_0x3dff3b[_0x05ca('0x36')]=_[_0x05ca('0x34')](_0xbe8b10[_0x05ca('0x35')],qs[_0x05ca('0x37')](_0x2ae8cb[_0x05ca('0x31')][_0x05ca('0x37')]));_0x3dff3b[_0x05ca('0x36')]=_0x3dff3b[_0x05ca('0x36')][_0x05ca('0x38')]?_0x3dff3b[_0x05ca('0x36')]:_0xbe8b10['model'];if(_0x2ae8cb[_0x05ca('0x31')][_0x05ca('0x47')]){_0x3dff3b['include']=[{'all':!![]}];}_0x3dff3b=_[_0x05ca('0x3e')]({},_0x3dff3b,_0x2ae8cb[_0x05ca('0x41')]);return db[_0x05ca('0x2d')]['find'](_0x3dff3b)[_0x05ca('0x27')](handleEntityNotFound(_0x570191,null))['then'](respondWithResult(_0x570191,null))[_0x05ca('0x44')](handleError(_0x570191,null));};exports[_0x05ca('0x25')]=function(_0x3c2497,_0x30862c){if(_0x3c2497['body']['id']){delete _0x3c2497[_0x05ca('0x48')]['id'];}return db[_0x05ca('0x2d')][_0x05ca('0x49')]({'where':{'id':_0x3c2497['params']['id']}})[_0x05ca('0x27')](handleEntityNotFound(_0x30862c,null))['then'](saveUpdates(_0x3c2497[_0x05ca('0x48')],null))[_0x05ca('0x27')](respondWithResult(_0x30862c,null))[_0x05ca('0x44')](handleError(_0x30862c,null));};exports[_0x05ca('0x26')]=function(_0x5834ae,_0x307b54){return db[_0x05ca('0x2d')][_0x05ca('0x49')]({'where':{'id':_0x5834ae[_0x05ca('0x46')]['id']}})[_0x05ca('0x27')](handleEntityNotFound(_0x307b54,null))[_0x05ca('0x27')](removeEntity(_0x307b54,null))[_0x05ca('0x44')](handleError(_0x307b54,null));};exports[_0x05ca('0x4a')]=function(_0x5b8ad9,_0x1b9cd0){var _0x128d07;return db['sequelize'][_0x05ca('0x4b')](function(_0x4b8a96){return db[_0x05ca('0x2d')]['create'](_0x5b8ad9[_0x05ca('0x48')],{'transaction':_0x4b8a96})['then'](function(_0x2099eb){_0x128d07=_0x2099eb;var _0x63d22d={'type':db[_0x05ca('0x4c')]['TEXT'],'transaction':_0x4b8a96};switch(_0x5b8ad9[_0x05ca('0x48')][_0x05ca('0x40')]){case _0x05ca('0x4d'):_0x63d22d['type']=db[_0x05ca('0x4c')][_0x05ca('0x4e')];break;case _0x05ca('0x4f'):_0x63d22d[_0x05ca('0x40')]=db[_0x05ca('0x4c')][_0x05ca('0x50')];break;case _0x05ca('0x51'):_0x63d22d[_0x05ca('0x40')]=db[_0x05ca('0x4c')][_0x05ca('0x52')];_0x63d22d[_0x05ca('0x53')]=![];break;default:}return db[_0x05ca('0x54')][_0x05ca('0x55')][_0x05ca('0x56')]('cm_contacts',util[_0x05ca('0x57')]('cf_%d',_0x128d07['id']),_0x63d22d);})[_0x05ca('0x27')](function(){return _0x128d07;});})['then'](respondWithResult(_0x1b9cd0,0xc9))['catch'](handleError(_0x1b9cd0,null));}; \ No newline at end of file diff --git a/server/api/cmCustomField/cmCustomField.model.js b/server/api/cmCustomField/cmCustomField.model.js index 23608dd..14aab4f 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 _0x3a16=['../../config/environment','./cmCustomField.attributes','exports','define','CmCustomField','cm_custom_fields','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf'];(function(_0x8b3b9,_0x1d5fce){var _0x426934=function(_0x330c34){while(--_0x330c34){_0x8b3b9['push'](_0x8b3b9['shift']());}};_0x426934(++_0x1d5fce);}(_0x3a16,0x105));var _0x63a1=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x3a16[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0x63a1('0x0'));var util=require(_0x63a1('0x1'));var logger=require(_0x63a1('0x2'))(_0x63a1('0x3'));var moment=require(_0x63a1('0x4'));var BPromise=require(_0x63a1('0x5'));var rp=require(_0x63a1('0x6'));var fs=require('fs');var path=require(_0x63a1('0x7'));var rimraf=require(_0x63a1('0x8'));var config=require(_0x63a1('0x9'));var attributes=require(_0x63a1('0xa'));module[_0x63a1('0xb')]=function(_0xbfbb9,_0x26aefe){return _0xbfbb9[_0x63a1('0xc')](_0x63a1('0xd'),attributes,{'tableName':_0x63a1('0xe'),'paranoid':!![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xb5ce=['./cmCustomField.attributes','exports','define','CmCustomField','cm_custom_fields','lodash','../../config/logger','moment','bluebird','path','rimraf','../../config/environment'];(function(_0x58dd80,_0x28da73){var _0x11590e=function(_0x2affb8){while(--_0x2affb8){_0x58dd80['push'](_0x58dd80['shift']());}};_0x11590e(++_0x28da73);}(_0xb5ce,0x119));var _0xeb5c=function(_0x15ef26,_0x4dea64){_0x15ef26=_0x15ef26-0x0;var _0x2566e0=_0xb5ce[_0x15ef26];return _0x2566e0;};'use strict';var _=require(_0xeb5c('0x0'));var util=require('util');var logger=require(_0xeb5c('0x1'))('api');var moment=require(_0xeb5c('0x2'));var BPromise=require(_0xeb5c('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xeb5c('0x4'));var rimraf=require(_0xeb5c('0x5'));var config=require(_0xeb5c('0x6'));var attributes=require(_0xeb5c('0x7'));module[_0xeb5c('0x8')]=function(_0x57e8dd,_0x195bde){return _0x57e8dd[_0xeb5c('0x9')](_0xeb5c('0xa'),attributes,{'tableName':_0xeb5c('0xb'),'paranoid':!![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/cmCustomField/cmCustomField.rpc.js b/server/api/cmCustomField/cmCustomField.rpc.js index 5ea491b..ac1a321 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 _0x075d=['../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','request','then','info','request\x20sent','debug','CmCustomField,\x20%s,\x20%s,\x20%s','stringify','error','code','CmCustomField,\x20%s,\x20%s','message','result','catch','lodash','util','bluebird','randomstring','ioredis','../../mysqldb'];(function(_0xd77cdb,_0x24c82a){var _0x269b7b=function(_0x570f67){while(--_0x570f67){_0xd77cdb['push'](_0xd77cdb['shift']());}};_0x269b7b(++_0x24c82a);}(_0x075d,0x11a));var _0xd075=function(_0x469c04,_0x1eb194){_0x469c04=_0x469c04-0x0;var _0x1d297e=_0x075d[_0x469c04];return _0x1d297e;};'use strict';var _=require(_0xd075('0x0'));var util=require(_0xd075('0x1'));var moment=require('moment');var BPromise=require(_0xd075('0x2'));var rs=require(_0xd075('0x3'));var fs=require('fs');var Redis=require(_0xd075('0x4'));var db=require(_0xd075('0x5'))['db'];var utils=require(_0xd075('0x6'));var logger=require(_0xd075('0x7'))(_0xd075('0x8'));var config=require(_0xd075('0x9'));var jayson=require(_0xd075('0xa'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x33840b,_0x381ea8,_0xb54924){return new BPromise(function(_0x335511,_0x91662d){return client[_0xd075('0xb')](_0x33840b,_0xb54924)[_0xd075('0xc')](function(_0x202809){logger[_0xd075('0xd')]('CmCustomField,\x20%s,\x20%s',_0x381ea8,_0xd075('0xe'));logger[_0xd075('0xf')](_0xd075('0x10'),_0x381ea8,_0xd075('0xe'),JSON[_0xd075('0x11')](_0x202809));if(_0x202809[_0xd075('0x12')]){if(_0x202809[_0xd075('0x12')][_0xd075('0x13')]===0x1f4){logger['error'](_0xd075('0x14'),_0x381ea8,_0x202809[_0xd075('0x12')][_0xd075('0x15')]);return _0x91662d(_0x202809[_0xd075('0x12')]['message']);}logger[_0xd075('0x12')](_0xd075('0x14'),_0x381ea8,_0x202809[_0xd075('0x12')]['message']);return _0x335511(_0x202809[_0xd075('0x12')][_0xd075('0x15')]);}else{logger[_0xd075('0xd')](_0xd075('0x14'),_0x381ea8,_0xd075('0xe'));_0x335511(_0x202809[_0xd075('0x16')]['message']);}})[_0xd075('0x17')](function(_0x5d01c3){logger[_0xd075('0x12')](_0xd075('0x14'),_0x381ea8,_0x5d01c3);_0x91662d(_0x5d01c3);});});} \ No newline at end of file +var _0xffe2=['lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','request','then','info','request\x20sent','debug','error','code','CmCustomField,\x20%s,\x20%s','message','result','catch'];(function(_0x5be7aa,_0x5de661){var _0x215408=function(_0x353715){while(--_0x353715){_0x5be7aa['push'](_0x5be7aa['shift']());}};_0x215408(++_0x5de661);}(_0xffe2,0x1b9));var _0x2ffe=function(_0x13bb2f,_0x53180b){_0x13bb2f=_0x13bb2f-0x0;var _0x5393d4=_0xffe2[_0x13bb2f];return _0x5393d4;};'use strict';var _=require(_0x2ffe('0x0'));var util=require(_0x2ffe('0x1'));var moment=require(_0x2ffe('0x2'));var BPromise=require(_0x2ffe('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x2ffe('0x4'));var db=require(_0x2ffe('0x5'))['db'];var utils=require(_0x2ffe('0x6'));var logger=require(_0x2ffe('0x7'))(_0x2ffe('0x8'));var config=require(_0x2ffe('0x9'));var jayson=require('jayson/promise');var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x5c0827,_0xf87232,_0x3d2903){return new BPromise(function(_0x1027e,_0x2df022){return client[_0x2ffe('0xa')](_0x5c0827,_0x3d2903)[_0x2ffe('0xb')](function(_0x255f03){logger[_0x2ffe('0xc')]('CmCustomField,\x20%s,\x20%s',_0xf87232,_0x2ffe('0xd'));logger[_0x2ffe('0xe')]('CmCustomField,\x20%s,\x20%s,\x20%s',_0xf87232,_0x2ffe('0xd'),JSON['stringify'](_0x255f03));if(_0x255f03[_0x2ffe('0xf')]){if(_0x255f03[_0x2ffe('0xf')][_0x2ffe('0x10')]===0x1f4){logger['error'](_0x2ffe('0x11'),_0xf87232,_0x255f03['error'][_0x2ffe('0x12')]);return _0x2df022(_0x255f03[_0x2ffe('0xf')][_0x2ffe('0x12')]);}logger[_0x2ffe('0xf')](_0x2ffe('0x11'),_0xf87232,_0x255f03['error']['message']);return _0x1027e(_0x255f03[_0x2ffe('0xf')][_0x2ffe('0x12')]);}else{logger[_0x2ffe('0xc')](_0x2ffe('0x11'),_0xf87232,'request\x20sent');_0x1027e(_0x255f03[_0x2ffe('0x13')][_0x2ffe('0x12')]);}})[_0x2ffe('0x14')](function(_0x118e71){logger['error'](_0x2ffe('0x11'),_0xf87232,_0x118e71);_0x2df022(_0x118e71);});});} \ No newline at end of file diff --git a/server/api/cmCustomField/index.js b/server/api/cmCustomField/index.js index ae7b3b8..34b4906 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 _0x4989=['destroy','multer','connect-timeout','express','Router','fs-extra','../../config/environment','get','isAuthenticated','/:id','show','post','create','put','update'];(function(_0x44ab49,_0x3f87c0){var _0x3e034c=function(_0x277c82){while(--_0x277c82){_0x44ab49['push'](_0x44ab49['shift']());}};_0x3e034c(++_0x3f87c0);}(_0x4989,0x79));var _0x9498=function(_0x27b3df,_0x34a01a){_0x27b3df=_0x27b3df-0x0;var _0x275390=_0x4989[_0x27b3df];return _0x275390;};'use strict';var multer=require(_0x9498('0x0'));var util=require('util');var path=require('path');var timeout=require(_0x9498('0x1'));var express=require(_0x9498('0x2'));var router=express[_0x9498('0x3')]();var fs_extra=require(_0x9498('0x4'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0x9498('0x5'));var controller=require('./cmCustomField.controller');router[_0x9498('0x6')]('/',auth[_0x9498('0x7')](),controller['index']);router[_0x9498('0x6')](_0x9498('0x8'),auth[_0x9498('0x7')](),controller[_0x9498('0x9')]);router[_0x9498('0xa')]('/',auth[_0x9498('0x7')](),controller[_0x9498('0xb')]);router[_0x9498('0xc')](_0x9498('0x8'),auth[_0x9498('0x7')](),controller[_0x9498('0xd')]);router['delete'](_0x9498('0x8'),auth[_0x9498('0x7')](),controller[_0x9498('0xe')]);module['exports']=router; \ No newline at end of file +var _0x9a22=['delete','destroy','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../config/environment','./cmCustomField.controller','get','isAuthenticated','index','/:id','post','put','update'];(function(_0x2b8393,_0x48dd53){var _0x4b5ca0=function(_0x46b3e0){while(--_0x46b3e0){_0x2b8393['push'](_0x2b8393['shift']());}};_0x4b5ca0(++_0x48dd53);}(_0x9a22,0x75));var _0x29a2=function(_0x513aa5,_0x1fba79){_0x513aa5=_0x513aa5-0x0;var _0x1a1a7c=_0x9a22[_0x513aa5];return _0x1a1a7c;};'use strict';var multer=require(_0x29a2('0x0'));var util=require(_0x29a2('0x1'));var path=require(_0x29a2('0x2'));var timeout=require(_0x29a2('0x3'));var express=require(_0x29a2('0x4'));var router=express[_0x29a2('0x5')]();var fs_extra=require(_0x29a2('0x6'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0x29a2('0x7'));var controller=require(_0x29a2('0x8'));router[_0x29a2('0x9')]('/',auth[_0x29a2('0xa')](),controller[_0x29a2('0xb')]);router[_0x29a2('0x9')](_0x29a2('0xc'),auth[_0x29a2('0xa')](),controller['show']);router[_0x29a2('0xd')]('/',auth[_0x29a2('0xa')](),controller['create']);router[_0x29a2('0xe')](_0x29a2('0xc'),auth['isAuthenticated'](),controller[_0x29a2('0xf')]);router[_0x29a2('0x10')]('/:id',auth[_0x29a2('0xa')](),controller[_0x29a2('0x11')]);module[_0x29a2('0x12')]=router; \ No newline at end of file diff --git a/server/api/cmHopper/cmHopper.attributes.js b/server/api/cmHopper/cmHopper.attributes.js index 36502f5..5b19eee 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 _0x8554=['STRING','moment','sequelize','exports','BOOLEAN','DATE','format','YYYY-MM-DD\x20HH:mm:ss','INTEGER','contactListQueue'];(function(_0x53f964,_0x3b52b8){var _0x17be6c=function(_0x25a732){while(--_0x25a732){_0x53f964['push'](_0x53f964['shift']());}};_0x17be6c(++_0x3b52b8);}(_0x8554,0x191));var _0x4855=function(_0x4565bf,_0x5ad9d6){_0x4565bf=_0x4565bf-0x0;var _0x5610ba=_0x8554[_0x4565bf];return _0x5610ba;};'use strict';var moment=require(_0x4855('0x0'));var Sequelize=require(_0x4855('0x1'));module[_0x4855('0x2')]={'phone':{'type':Sequelize['STRING'],'allowNull':![]},'active':{'type':Sequelize[_0x4855('0x3')],'defaultValue':![]},'scheduledat':{'type':Sequelize[_0x4855('0x4')],'defaultValue':moment()[_0x4855('0x5')](_0x4855('0x6'))},'countbusyretry':{'type':Sequelize[_0x4855('0x7')],'defaultValue':0x0},'countcongestionretry':{'type':Sequelize[_0x4855('0x7')],'defaultValue':0x0},'countnoanswerretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'callback':{'type':Sequelize[_0x4855('0x3')],'defaultValue':![]},'callbackuniqueid':{'type':Sequelize['STRING'],'defaultValue':null},'callbackat':{'type':Sequelize[_0x4855('0x4')]},'priority':{'type':Sequelize['INTEGER'](0x2)['UNSIGNED'],'defaultValue':0x2,'validate':{'min':0x0,'max':0x4}},'recallme':{'type':Sequelize[_0x4855('0x3')],'defaultValue':![]},'ContactId':{'type':Sequelize[_0x4855('0x7')],'unique':_0x4855('0x8')},'ListId':{'type':Sequelize[_0x4855('0x7')],'unique':_0x4855('0x8')},'UserId':{'type':Sequelize[_0x4855('0x7')]},'VoiceQueueId':{'type':Sequelize['INTEGER'],'unique':_0x4855('0x8')},'CampaignId':{'type':Sequelize[_0x4855('0x7')]},'countnosuchnumberretry':{'type':Sequelize[_0x4855('0x7')],'defaultValue':0x0},'countdropretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countabandonedretry':{'type':Sequelize[_0x4855('0x7')],'defaultValue':0x0},'countmachineretry':{'type':Sequelize[_0x4855('0x7')],'defaultValue':0x0},'countagentrejectretry':{'type':Sequelize[_0x4855('0x7')],'defaultValue':0x0},'OrderBy':{'type':Sequelize['INTEGER'],'allowNull':!![],'defaultValue':0x0},'dialTimezone':{'type':Sequelize[_0x4855('0x9')]},'recallmeNotifiedDate':{'type':Sequelize[_0x4855('0x4')],'allowNull':!![],'defaultValue':null}}; \ No newline at end of file +var _0x2eca=['DATE','UNSIGNED','contactListQueue','moment','sequelize','exports','STRING','BOOLEAN','format','YYYY-MM-DD\x20HH:mm:ss','INTEGER'];(function(_0x3233c3,_0x15e5fa){var _0x36029b=function(_0xe3dd12){while(--_0xe3dd12){_0x3233c3['push'](_0x3233c3['shift']());}};_0x36029b(++_0x15e5fa);}(_0x2eca,0x158));var _0xa2ec=function(_0x53f218,_0x27514c){_0x53f218=_0x53f218-0x0;var _0x21890a=_0x2eca[_0x53f218];return _0x21890a;};'use strict';var moment=require(_0xa2ec('0x0'));var Sequelize=require(_0xa2ec('0x1'));module[_0xa2ec('0x2')]={'phone':{'type':Sequelize[_0xa2ec('0x3')],'allowNull':![]},'active':{'type':Sequelize[_0xa2ec('0x4')],'defaultValue':![]},'scheduledat':{'type':Sequelize['DATE'],'defaultValue':moment()[_0xa2ec('0x5')](_0xa2ec('0x6'))},'countbusyretry':{'type':Sequelize[_0xa2ec('0x7')],'defaultValue':0x0},'countcongestionretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countnoanswerretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'callback':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'callbackuniqueid':{'type':Sequelize[_0xa2ec('0x3')],'defaultValue':null},'callbackat':{'type':Sequelize[_0xa2ec('0x8')]},'priority':{'type':Sequelize[_0xa2ec('0x7')](0x2)[_0xa2ec('0x9')],'defaultValue':0x2,'validate':{'min':0x0,'max':0x4}},'recallme':{'type':Sequelize[_0xa2ec('0x4')],'defaultValue':![]},'ContactId':{'type':Sequelize['INTEGER'],'unique':_0xa2ec('0xa')},'ListId':{'type':Sequelize[_0xa2ec('0x7')],'unique':_0xa2ec('0xa')},'UserId':{'type':Sequelize[_0xa2ec('0x7')]},'VoiceQueueId':{'type':Sequelize[_0xa2ec('0x7')],'unique':_0xa2ec('0xa')},'CampaignId':{'type':Sequelize[_0xa2ec('0x7')]},'countnosuchnumberretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countdropretry':{'type':Sequelize[_0xa2ec('0x7')],'defaultValue':0x0},'countabandonedretry':{'type':Sequelize[_0xa2ec('0x7')],'defaultValue':0x0},'countmachineretry':{'type':Sequelize[_0xa2ec('0x7')],'defaultValue':0x0},'countagentrejectretry':{'type':Sequelize[_0xa2ec('0x7')],'defaultValue':0x0},'OrderBy':{'type':Sequelize[_0xa2ec('0x7')],'allowNull':!![],'defaultValue':0x0},'dialTimezone':{'type':Sequelize['STRING']},'recallmeNotifiedDate':{'type':Sequelize[_0xa2ec('0x8')],'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 7078f38..5d3e70c 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 _0xe132=['merge','options','CmHopper','include','findAll','rows','catch','show','params','keys','length','includeAll','body','find','describe','destroy','VoiceQueueId','VoiceQueue','Campaign','CampaignId','omit','dataValues','updatedAt','deleted','campaign','membername','user','UserId','deletedat','YYYY-MM-DD\x20HH:mm:ss','calleridnum','phone','campaigntype','queue','ivr','CmContact','ContactId','firstName','isNil','calleridname','lastName','finally','create','CmHopperAdditionalPhone','end','getVoiceQueues','dialOrderByScheduledAt','dialPreviewAutoRecallMe','transaction','value','direction','prev','isEmpty','hopperIds','priority','ASC','scheduledAt','sequelize','literal','DESC','COALESCE(CmHopper.UserId,\x200)\x20DESC','findOne','scheduledat','recallme','UPDATE','CmCompany','Company','CmList','List','Queue','LOCK','Contact','dialActive','getOpenContacts','outbound','preview','format','CmHopper,\x20%s,\x20%s,\x20%s','entity\x20not\x20found','sendStatus','getTimezones','push','getTimezone','timezones','moment','../../components/parsers/qs','../../config/logger','api','../../config/environment','../../mysqldb','offset','undefined','limit','count','status','Content-Range','json','update','then','stack','name','index','map','rawAttributes','fieldName','type','filters','intersection','model','query','concat','$and','$or','$gt','$gte','$lt','$lte','$eq','$not','$in','$notIn','$like','$iLike','$notILike','$overlap','$contains','$contained','$any','attributes','fields','order','sort','where','pick','filter'];(function(_0xd2f4ac,_0x5aa8e5){var _0x9757b2=function(_0x442ced){while(--_0x442ced){_0xd2f4ac['push'](_0xd2f4ac['shift']());}};_0x9757b2(++_0x5aa8e5);}(_0xe132,0x162));var _0x2e13=function(_0x294931,_0x318a4b){_0x294931=_0x294931-0x0;var _0x5388de=_0xe132[_0x294931];return _0x5388de;};'use strict';var moment=require(_0x2e13('0x0'));var _=require('lodash');var qs=require(_0x2e13('0x1'));var logger=require(_0x2e13('0x2'))(_0x2e13('0x3'));var shared=require(_0x2e13('0x4'));var db=require(_0x2e13('0x5'))['db'];function respondWithResult(_0x4b87a6,_0x1ae6a9){_0x1ae6a9=_0x1ae6a9||0xc8;return function(_0x3f01fe){if(_0x3f01fe){return _0x4b87a6['status'](_0x1ae6a9)['json'](_0x3f01fe);}};}function respondWithFilteredResult(_0x260dc1,_0x2f9d00){return function(_0x1c670b){if(_0x1c670b){var _0x71f9d3=typeof _0x2f9d00[_0x2e13('0x6')]===_0x2e13('0x7')&&typeof _0x2f9d00[_0x2e13('0x8')]===_0x2e13('0x7');var _0xd031e9=_0x1c670b[_0x2e13('0x9')];var _0x5122a2=_0x71f9d3?0x0:_0x2f9d00[_0x2e13('0x6')];var _0x20fe3e=_0x71f9d3?_0x1c670b[_0x2e13('0x9')]:_0x2f9d00[_0x2e13('0x6')]+_0x2f9d00[_0x2e13('0x8')];var _0x1a871d;if(_0x20fe3e>=_0xd031e9){_0x20fe3e=_0xd031e9;_0x1a871d=0xc8;}else{_0x1a871d=0xce;}_0x260dc1[_0x2e13('0xa')](_0x1a871d);return _0x260dc1['set'](_0x2e13('0xb'),_0x5122a2+'-'+_0x20fe3e+'/'+_0xd031e9)[_0x2e13('0xc')](_0x1c670b);}return null;};}function saveUpdates(_0x320303,_0x299dd3){return function(_0x424e58){if(_0x424e58){return _0x424e58[_0x2e13('0xd')](_0x320303)[_0x2e13('0xe')](function(_0x51f1a3){return _0x51f1a3;});}return null;};}function handleEntityNotFound(_0xb70eb8,_0xea6c20){return function(_0xfaca18){if(!_0xfaca18){_0xb70eb8['sendStatus'](0x194);}return _0xfaca18;};}function handleError(_0x4d7fa3,_0x2a58e5){_0x2a58e5=_0x2a58e5||0x1f4;return function(_0x433bbd){logger['error'](_0x433bbd[_0x2e13('0xf')]);if(_0x433bbd[_0x2e13('0x10')]){delete _0x433bbd[_0x2e13('0x10')];}_0x4d7fa3['status'](_0x2a58e5)['send'](_0x433bbd);};}exports[_0x2e13('0x11')]=function(_0x2c026d,_0x336a10){var _0x3cdefc={},_0x399ce2={},_0x32ce2f={'count':0x0,'rows':[]};var _0x2496ee=_[_0x2e13('0x12')](db['CmHopper'][_0x2e13('0x13')],function(_0x9c37a9){return{'name':_0x9c37a9[_0x2e13('0x14')],'type':_0x9c37a9[_0x2e13('0x15')]['key']};});_0x399ce2['model']=_[_0x2e13('0x12')](_0x2496ee,_0x2e13('0x10'));_0x399ce2['query']=_['keys'](_0x2c026d['query']);_0x399ce2[_0x2e13('0x16')]=_[_0x2e13('0x17')](_0x399ce2[_0x2e13('0x18')],_0x399ce2[_0x2e13('0x19')]);_0x399ce2[_0x2e13('0x16')]=_[_0x2e13('0x1a')](_0x399ce2['filters'],[_0x2e13('0x1b'),_0x2e13('0x1c'),_0x2e13('0x1d'),_0x2e13('0x1e'),_0x2e13('0x1f'),_0x2e13('0x20'),'$ne',_0x2e13('0x21'),_0x2e13('0x22'),'$between','$notBetween',_0x2e13('0x23'),_0x2e13('0x24'),_0x2e13('0x25'),'$notLike',_0x2e13('0x26'),_0x2e13('0x27'),_0x2e13('0x25'),_0x2e13('0x28'),_0x2e13('0x29'),_0x2e13('0x2a'),_0x2e13('0x2b')]);_0x3cdefc[_0x2e13('0x2c')]=_[_0x2e13('0x17')](_0x399ce2[_0x2e13('0x18')],qs[_0x2e13('0x2d')](_0x2c026d[_0x2e13('0x19')][_0x2e13('0x2d')]));_0x3cdefc[_0x2e13('0x2c')]=_0x3cdefc[_0x2e13('0x2c')]['length']?_0x3cdefc[_0x2e13('0x2c')]:_0x399ce2[_0x2e13('0x18')];if(!_0x2c026d[_0x2e13('0x19')]['hasOwnProperty']('nolimit')){_0x3cdefc[_0x2e13('0x8')]=qs[_0x2e13('0x8')](_0x2c026d[_0x2e13('0x19')][_0x2e13('0x8')]);_0x3cdefc[_0x2e13('0x6')]=qs[_0x2e13('0x6')](_0x2c026d['query']['offset']);}_0x3cdefc[_0x2e13('0x2e')]=qs[_0x2e13('0x2f')](_0x2c026d[_0x2e13('0x19')][_0x2e13('0x2f')]);_0x3cdefc[_0x2e13('0x30')]=qs[_0x2e13('0x16')](_[_0x2e13('0x31')](_0x2c026d[_0x2e13('0x19')],_0x399ce2['filters']),_0x2496ee);if(_0x2c026d[_0x2e13('0x19')][_0x2e13('0x32')]){_0x3cdefc[_0x2e13('0x30')]=_[_0x2e13('0x33')](_0x3cdefc[_0x2e13('0x30')],{'$or':_['map'](_0x2496ee,function(_0x28e6de){if(_0x28e6de[_0x2e13('0x15')]!=='VIRTUAL'){var _0x750ee2={};_0x750ee2[_0x28e6de[_0x2e13('0x10')]]={'$like':'%'+_0x2c026d[_0x2e13('0x19')]['filter']+'%'};return _0x750ee2;}})});}_0x3cdefc=_[_0x2e13('0x33')]({},_0x3cdefc,_0x2c026d[_0x2e13('0x34')]);var _0x4bfb50={'where':_0x3cdefc[_0x2e13('0x30')]};return db[_0x2e13('0x35')]['count'](_0x4bfb50)[_0x2e13('0xe')](function(_0x5c17bb){_0x32ce2f[_0x2e13('0x9')]=_0x5c17bb;if(_0x2c026d[_0x2e13('0x19')]['includeAll']){_0x3cdefc[_0x2e13('0x36')]=[{'all':!![]}];}return db[_0x2e13('0x35')][_0x2e13('0x37')](_0x3cdefc);})[_0x2e13('0xe')](function(_0x20ae95){_0x32ce2f[_0x2e13('0x38')]=_0x20ae95;return _0x32ce2f;})[_0x2e13('0xe')](respondWithFilteredResult(_0x336a10,_0x3cdefc))[_0x2e13('0x39')](handleError(_0x336a10,null));};exports[_0x2e13('0x3a')]=function(_0x1cca7f,_0x4ffb30){var _0x24ebb6={'raw':!![],'where':{'id':_0x1cca7f[_0x2e13('0x3b')]['id']}},_0xd2e8ae={};_0xd2e8ae[_0x2e13('0x18')]=_[_0x2e13('0x3c')](db['CmHopper'][_0x2e13('0x13')]);_0xd2e8ae['query']=_[_0x2e13('0x3c')](_0x1cca7f[_0x2e13('0x19')]);_0xd2e8ae['filters']=_[_0x2e13('0x17')](_0xd2e8ae['model'],_0xd2e8ae[_0x2e13('0x19')]);_0x24ebb6[_0x2e13('0x2c')]=_[_0x2e13('0x17')](_0xd2e8ae[_0x2e13('0x18')],qs[_0x2e13('0x2d')](_0x1cca7f['query'][_0x2e13('0x2d')]));_0x24ebb6['attributes']=_0x24ebb6[_0x2e13('0x2c')][_0x2e13('0x3d')]?_0x24ebb6[_0x2e13('0x2c')]:_0xd2e8ae[_0x2e13('0x18')];if(_0x1cca7f[_0x2e13('0x19')][_0x2e13('0x3e')]){_0x24ebb6['include']=[{'all':!![]}];}_0x24ebb6=_['merge']({},_0x24ebb6,_0x1cca7f[_0x2e13('0x34')]);return db[_0x2e13('0x35')]['find'](_0x24ebb6)[_0x2e13('0xe')](handleEntityNotFound(_0x4ffb30,null))[_0x2e13('0xe')](respondWithResult(_0x4ffb30,null))[_0x2e13('0x39')](handleError(_0x4ffb30,null));};exports['create']=function(_0x5c6a9a,_0xd44b46){return db['CmHopper']['create'](_0x5c6a9a[_0x2e13('0x3f')],{})[_0x2e13('0xe')](respondWithResult(_0xd44b46,0xc9))[_0x2e13('0x39')](handleError(_0xd44b46,null));};exports['update']=function(_0x20b444,_0x16bdf2){if(_0x20b444[_0x2e13('0x3f')]['id']){delete _0x20b444[_0x2e13('0x3f')]['id'];}return db['CmHopper'][_0x2e13('0x40')]({'where':{'id':_0x20b444['params']['id']}})[_0x2e13('0xe')](handleEntityNotFound(_0x16bdf2,null))[_0x2e13('0xe')](saveUpdates(_0x20b444[_0x2e13('0x3f')],null))[_0x2e13('0xe')](respondWithResult(_0x16bdf2,null))[_0x2e13('0x39')](handleError(_0x16bdf2,null));};exports[_0x2e13('0x41')]=function(_0x961af7,_0x8e8b86){return db[_0x2e13('0x35')][_0x2e13('0x41')]()['then'](respondWithResult(_0x8e8b86,null))[_0x2e13('0x39')](handleError(_0x8e8b86,null));};exports[_0x2e13('0x42')]=function(_0x4780b7,_0x1d13ec){var _0x426e75;var _0xcc5495=_0x4780b7[_0x2e13('0x3b')]['id'];return db[_0x2e13('0x35')][_0x2e13('0x40')]({'where':{'id':_0x4780b7[_0x2e13('0x3b')]['id']}})[_0x2e13('0xe')](handleEntityNotFound(_0x1d13ec,null))[_0x2e13('0xe')](function(_0x532689){if(_0x532689){return _0x532689[_0x2e13('0x42')]()[_0x2e13('0xe')](function(_0x39cef0){return _0x39cef0;});}})[_0x2e13('0xe')](function(_0x13374a){_0x426e75=_0x13374a;if(_0x13374a){if(_0x13374a[_0x2e13('0x43')]||_0x13374a['CampaignId']){return db[_0x13374a[_0x2e13('0x43')]?_0x2e13('0x44'):_0x2e13('0x45')][_0x2e13('0x40')]({'where':{'id':_0x13374a[_0x2e13('0x43')]?_0x13374a[_0x2e13('0x43')]:_0x13374a[_0x2e13('0x46')]},'attributes':['id','name'],'raw':!![]});}}})[_0x2e13('0xe')](function(_0x3a1a9c){var _0x252b14={};if(_0x3a1a9c){_['merge'](_0x252b14,_[_0x2e13('0x47')](_0x426e75[_0x2e13('0x48')],['createdAt',_0x2e13('0x49'),'id']));_0x252b14['state']=0x15;_0x252b14['statedesc']=_0x2e13('0x4a');_0x252b14[_0x2e13('0x4b')]=_0x3a1a9c[_0x2e13('0x10')];_0x252b14[_0x2e13('0x4c')]=_0x4780b7[_0x2e13('0x4d')]['name'];_0x252b14[_0x2e13('0x4e')]=_0x4780b7['user']['id'];_0x252b14['deleted']=!![];_0x252b14[_0x2e13('0x4f')]=moment()['format'](_0x2e13('0x50'));_0x252b14[_0x2e13('0x51')]=_0x426e75[_0x2e13('0x52')];_0x252b14[_0x2e13('0x53')]=_0x426e75[_0x2e13('0x43')]?_0x2e13('0x54'):_0x2e13('0x55');return db[_0x2e13('0x56')]['find']({'where':{'id':_0x252b14[_0x2e13('0x57')]},'attributes':[_0x2e13('0x58'),'lastName']})['then'](function(_0xbfecec){if(!_[_0x2e13('0x59')](_0x1d13ec)&&!_[_0x2e13('0x59')](_0xbfecec['firstName'])){_0x252b14[_0x2e13('0x5a')]=_0xbfecec['firstName'];if(!_[_0x2e13('0x59')](_0xbfecec[_0x2e13('0x5b')])){_0x252b14[_0x2e13('0x5a')]+='\x20'+_0xbfecec['lastName'];}}})[_0x2e13('0x5c')](function(){return db['CmHopperFinal'][_0x2e13('0x5d')](_0x252b14);});}})[_0x2e13('0xe')](function(_0x3de3fc){return db[_0x2e13('0x5e')][_0x2e13('0x42')]({'where':{'CmHopperId':_0xcc5495}});})[_0x2e13('0xe')](function(){return _0x1d13ec['status'](0xcc)[_0x2e13('0x5f')]();})[_0x2e13('0x39')](handleError(_0x1d13ec,null));};exports['getPreview']=function(_0x591065,_0x446643){var _0x1c8862=[];return db['CmContact']['describe']()[_0x2e13('0xe')](function(_0x4b0481){_0x1c8862=_[_0x2e13('0x3c')](_0x4b0481);return _0x591065[_0x2e13('0x4d')][_0x2e13('0x60')]({'where':{'type':'outbound','dialActive':!![],'dialMethod':'preview'},'attributes':['id',_0x2e13('0x61'),_0x2e13('0x62')],'raw':!![]});})[_0x2e13('0xe')](function(_0x52ee42){if(_0x52ee42&&_0x52ee42[_0x2e13('0x3d')]){return db['sequelize'][_0x2e13('0x63')](function(_0x571fd9){var _0x5d09c4={'active':![],'recallme':![],'scheduledAt':{'$lte':moment()['format'](_0x2e13('0x50'))},'VoiceQueueId':{'$in':_[_0x2e13('0x12')](_0x52ee42,'id')},'$or':[{'UserId':null},{'UserId':_0x591065[_0x2e13('0x4d')]['id']}]};var _0x1a1cc0={'active':![],'recallme':!![],'VoiceQueueId':{'$in':_(_0x52ee42)[_0x2e13('0x32')]([_0x2e13('0x62'),0x0])[_0x2e13('0x12')]('id')[_0x2e13('0x64')]()},'$or':[{'UserId':null},{'UserId':_0x591065['user']['id']}]};var _0x1ac435={'$or':[_0x5d09c4,_0x1a1cc0]};var _0x2c75b2=[];if(_0x591065[_0x2e13('0x3f')][_0x2e13('0x65')]&&_0x591065[_0x2e13('0x3f')]['direction']===_0x2e13('0x66')){if(!_[_0x2e13('0x67')](_0x591065['body'][_0x2e13('0x68')])){_0x1ac435['id']={'$in':_0x591065['body'][_0x2e13('0x68')]};}_0x2c75b2=[[_0x2e13('0x69'),_0x2e13('0x6a')],[_0x2e13('0x6b'),_0x52ee42[0x0][_0x2e13('0x61')]===_0x2e13('0x6a')?'DESC':_0x2e13('0x6a')],db[_0x2e13('0x6c')][_0x2e13('0x6d')]('COALESCE(CmHopper.UserId,\x200)\x20ASC'),['id',_0x2e13('0x6e')]];}else{if(!_[_0x2e13('0x67')](_0x591065[_0x2e13('0x3f')][_0x2e13('0x68')])){_0x1ac435['id']={'$notIn':_0x591065['body'][_0x2e13('0x68')]};}_0x2c75b2=[[_0x2e13('0x69'),_0x2e13('0x6e')],[_0x2e13('0x6b'),_0x52ee42[0x0]['dialOrderByScheduledAt']],db[_0x2e13('0x6c')][_0x2e13('0x6d')](_0x2e13('0x6f')),['id','ASC']];}return db[_0x2e13('0x35')][_0x2e13('0x70')]({'attributes':['id',_0x2e13('0x71'),_0x2e13('0x52'),_0x2e13('0x72')],'where':_0x1ac435,'order':_0x2c75b2,'transaction':_0x571fd9,'lock':_0x571fd9['LOCK'][_0x2e13('0x73')],'include':[{'model':db['CmContact'],'as':'Contact','attributes':_0x1c8862,'include':[{'model':db[_0x2e13('0x74')],'as':_0x2e13('0x75'),'attributes':['id',_0x2e13('0x10')]}]},{'model':db[_0x2e13('0x76')],'as':_0x2e13('0x77'),'attributes':['id','name']},{'model':db[_0x2e13('0x44')],'as':_0x2e13('0x78'),'attributes':['id',_0x2e13('0x10'),'dialActive']}]})[_0x2e13('0xe')](function(_0xec435e){if(_0xec435e){return _0xec435e[_0x2e13('0xd')]({'UserId':_0x591065[_0x2e13('0x4d')]['id']},{'transaction':_0x571fd9});}});});}})['then'](handleEntityNotFound(_0x446643,null))[_0x2e13('0xe')](respondWithResult(_0x446643,null))['catch'](handleError(_0x446643,null));};exports['getPreviewRecall']=function(_0x22f345,_0x27ccff,_0xa7c844){var _0x5e110e=[];var _0x101e3b=_0x22f345[_0x2e13('0x3b')]['id'];var _0x55f9ae=_0x22f345[_0x2e13('0x4d')]['id'];return db[_0x2e13('0x56')][_0x2e13('0x41')]()[_0x2e13('0xe')](function(_0x5f50d3){_0x5e110e=_[_0x2e13('0x3c')](_0x5f50d3);return db['sequelize'][_0x2e13('0x63')](function(_0x94d5af){const _0x33e627={'id':_0x101e3b};return db[_0x2e13('0x35')][_0x2e13('0x70')]({'attributes':['id','scheduledat',_0x2e13('0x72')],'where':_0x33e627,'transaction':_0x94d5af,'lock':_0x94d5af[_0x2e13('0x79')][_0x2e13('0x73')],'include':[{'model':db['CmContact'],'as':_0x2e13('0x7a'),'attributes':_0x5e110e,'include':[{'model':db['CmCompany'],'as':_0x2e13('0x75'),'attributes':['id','name']}]},{'model':db['CmList'],'as':_0x2e13('0x77'),'attributes':['id',_0x2e13('0x10')]},{'model':db[_0x2e13('0x44')],'as':_0x2e13('0x78'),'attributes':['id',_0x2e13('0x10'),_0x2e13('0x7b')]}]})[_0x2e13('0xe')](function(_0x5c8f68){if(_0x5c8f68){return _0x5c8f68[_0x2e13('0xd')]({'UserId':_0x55f9ae},{'transaction':_0x94d5af});}});});})[_0x2e13('0xe')](handleEntityNotFound(_0x27ccff,null))['then'](respondWithResult(_0x27ccff,null))[_0x2e13('0x39')](handleError(_0x27ccff,null));};exports[_0x2e13('0x7c')]=function(_0x466858,_0x2f79e2){return _0x466858[_0x2e13('0x4d')][_0x2e13('0x60')]({'where':{'type':_0x2e13('0x7d'),'dialActive':!![],'dialMethod':_0x2e13('0x7e')},'attributes':['id'],'raw':!![]})[_0x2e13('0xe')](function(_0x3be5a8){if(_0x3be5a8&&_0x3be5a8[_0x2e13('0x3d')]){return db['CmHopper']['count']({'where':{'active':![],'recallme':![],'scheduledAt':{'$lte':moment()[_0x2e13('0x7f')](_0x2e13('0x50'))},'VoiceQueueId':{'$in':_[_0x2e13('0x12')](_0x3be5a8,'id')},'$or':[{'UserId':null},{'UserId':_0x466858[_0x2e13('0x4d')]['id']}]}});}return 0x0;})[_0x2e13('0xe')](function(_0x29f599){if(!_[_0x2e13('0x59')](_0x29f599)&&_['isNumber'](_0x29f599)){return _0x2f79e2[_0x2e13('0xa')](0xc8)[_0x2e13('0xc')]({'contacts':_0x29f599});}else{logger['error'](_0x2e13('0x80'),_0x2e13('0x7c'),0x194,_0x2e13('0x81'));_0x2f79e2[_0x2e13('0x82')](0x194);}})[_0x2e13('0x39')](handleError(_0x2f79e2,null));};exports[_0x2e13('0x83')]=function(_0x373100,_0x4c897b){var _0x2ee8d0=shared['timezones'];var _0x1369ff=[];_[_0x2e13('0x12')](_0x2ee8d0,function(_0x42be7d){_0x1369ff[_0x2e13('0x84')]({'id':_0x42be7d['name'],'name':_0x42be7d[_0x2e13('0x10')],'utcOffset':_0x42be7d['utcOffset']});});return _0x4c897b['status'](0xc8)[_0x2e13('0xc')]({'tz':_0x1369ff});};exports[_0x2e13('0x85')]=function(_0x47d8fe,_0x12fbe3){var _0x56a094=shared[_0x2e13('0x86')];var _0x5d1927={};if(!_['isNil'](_0x56a094[_0x47d8fe[_0x2e13('0x3f')]['id']]))_0x5d1927=_0x56a094[_0x47d8fe[_0x2e13('0x3f')]['id']];return _0x12fbe3[_0x2e13('0xa')](0xc8)['json'](_0x5d1927);}; \ No newline at end of file +var _0xf006=['where','filter','merge','VIRTUAL','options','then','include','findAll','rows','catch','params','length','includeAll','find','create','body','describe','VoiceQueueId','CampaignId','VoiceQueue','omit','dataValues','createdAt','updatedAt','state','statedesc','deleted','campaign','membername','user','deletedat','format','calleridnum','phone','campaigntype','queue','CmContact','firstName','lastName','isNil','calleridname','CmHopperAdditionalPhone','getPreview','outbound','dialOrderByScheduledAt','dialPreviewAutoRecallMe','transaction','direction','hopperIds','priority','ASC','scheduledAt','sequelize','literal','COALESCE(CmHopper.UserId,\x200)\x20ASC','DESC','isEmpty','COALESCE(CmHopper.UserId,\x200)\x20DESC','findOne','recallme','LOCK','UPDATE','CmCompany','Company','CmList','List','Queue','dialActive','getPreviewRecall','scheduledat','preview','CmHopper,\x20%s,\x20%s,\x20%s','getOpenContacts','entity\x20not\x20found','getTimezones','timezones','push','utcOffset','../../components/parsers/qs','../../config/logger','../../config/environment','status','json','offset','undefined','limit','count','set','Content-Range','update','sendStatus','error','stack','name','map','CmHopper','rawAttributes','fieldName','type','query','keys','filters','intersection','model','concat','$and','$gt','$gte','$lt','$ne','$not','$notBetween','$in','$notIn','$like','$notLike','$notILike','$overlap','$contains','$contained','$any','attributes','fields','sort'];(function(_0x487a0b,_0x33c302){var _0x4cb1ba=function(_0x2a3615){while(--_0x2a3615){_0x487a0b['push'](_0x487a0b['shift']());}};_0x4cb1ba(++_0x33c302);}(_0xf006,0x146));var _0x6f00=function(_0x527e77,_0x177e32){_0x527e77=_0x527e77-0x0;var _0x19841f=_0xf006[_0x527e77];return _0x19841f;};'use strict';var moment=require('moment');var _=require('lodash');var qs=require(_0x6f00('0x0'));var logger=require(_0x6f00('0x1'))('api');var shared=require(_0x6f00('0x2'));var db=require('../../mysqldb')['db'];function respondWithResult(_0x1c7a9e,_0x4f4466){_0x4f4466=_0x4f4466||0xc8;return function(_0x5039fb){if(_0x5039fb){return _0x1c7a9e[_0x6f00('0x3')](_0x4f4466)[_0x6f00('0x4')](_0x5039fb);}};}function respondWithFilteredResult(_0x141e71,_0x52c9a2){return function(_0x3c29ff){if(_0x3c29ff){var _0x4f918f=typeof _0x52c9a2[_0x6f00('0x5')]===_0x6f00('0x6')&&typeof _0x52c9a2[_0x6f00('0x7')]===_0x6f00('0x6');var _0x286d32=_0x3c29ff[_0x6f00('0x8')];var _0x44b63c=_0x4f918f?0x0:_0x52c9a2[_0x6f00('0x5')];var _0x2aa181=_0x4f918f?_0x3c29ff[_0x6f00('0x8')]:_0x52c9a2[_0x6f00('0x5')]+_0x52c9a2[_0x6f00('0x7')];var _0x723e6e;if(_0x2aa181>=_0x286d32){_0x2aa181=_0x286d32;_0x723e6e=0xc8;}else{_0x723e6e=0xce;}_0x141e71['status'](_0x723e6e);return _0x141e71[_0x6f00('0x9')](_0x6f00('0xa'),_0x44b63c+'-'+_0x2aa181+'/'+_0x286d32)[_0x6f00('0x4')](_0x3c29ff);}return null;};}function saveUpdates(_0x36a2ec,_0x289fe9){return function(_0x5e3264){if(_0x5e3264){return _0x5e3264[_0x6f00('0xb')](_0x36a2ec)['then'](function(_0x30b10e){return _0x30b10e;});}return null;};}function handleEntityNotFound(_0x5047f5,_0x324e67){return function(_0x220e68){if(!_0x220e68){_0x5047f5[_0x6f00('0xc')](0x194);}return _0x220e68;};}function handleError(_0x33f3a2,_0xa6e7a1){_0xa6e7a1=_0xa6e7a1||0x1f4;return function(_0x411203){logger[_0x6f00('0xd')](_0x411203[_0x6f00('0xe')]);if(_0x411203[_0x6f00('0xf')]){delete _0x411203['name'];}_0x33f3a2[_0x6f00('0x3')](_0xa6e7a1)['send'](_0x411203);};}exports['index']=function(_0x7c047e,_0x6cf83f){var _0x466c7c={},_0x340f78={},_0x13f09f={'count':0x0,'rows':[]};var _0x27e466=_[_0x6f00('0x10')](db[_0x6f00('0x11')][_0x6f00('0x12')],function(_0x198cc7){return{'name':_0x198cc7[_0x6f00('0x13')],'type':_0x198cc7[_0x6f00('0x14')]['key']};});_0x340f78['model']=_['map'](_0x27e466,_0x6f00('0xf'));_0x340f78[_0x6f00('0x15')]=_[_0x6f00('0x16')](_0x7c047e['query']);_0x340f78[_0x6f00('0x17')]=_[_0x6f00('0x18')](_0x340f78[_0x6f00('0x19')],_0x340f78[_0x6f00('0x15')]);_0x340f78[_0x6f00('0x17')]=_[_0x6f00('0x1a')](_0x340f78[_0x6f00('0x17')],[_0x6f00('0x1b'),'$or',_0x6f00('0x1c'),_0x6f00('0x1d'),_0x6f00('0x1e'),'$lte',_0x6f00('0x1f'),'$eq',_0x6f00('0x20'),'$between',_0x6f00('0x21'),_0x6f00('0x22'),_0x6f00('0x23'),_0x6f00('0x24'),_0x6f00('0x25'),'$iLike',_0x6f00('0x26'),_0x6f00('0x24'),_0x6f00('0x27'),_0x6f00('0x28'),_0x6f00('0x29'),_0x6f00('0x2a')]);_0x466c7c[_0x6f00('0x2b')]=_[_0x6f00('0x18')](_0x340f78[_0x6f00('0x19')],qs[_0x6f00('0x2c')](_0x7c047e[_0x6f00('0x15')][_0x6f00('0x2c')]));_0x466c7c[_0x6f00('0x2b')]=_0x466c7c[_0x6f00('0x2b')]['length']?_0x466c7c['attributes']:_0x340f78['model'];if(!_0x7c047e['query']['hasOwnProperty']('nolimit')){_0x466c7c[_0x6f00('0x7')]=qs['limit'](_0x7c047e[_0x6f00('0x15')][_0x6f00('0x7')]);_0x466c7c[_0x6f00('0x5')]=qs[_0x6f00('0x5')](_0x7c047e[_0x6f00('0x15')][_0x6f00('0x5')]);}_0x466c7c['order']=qs[_0x6f00('0x2d')](_0x7c047e[_0x6f00('0x15')][_0x6f00('0x2d')]);_0x466c7c[_0x6f00('0x2e')]=qs[_0x6f00('0x17')](_['pick'](_0x7c047e['query'],_0x340f78['filters']),_0x27e466);if(_0x7c047e[_0x6f00('0x15')][_0x6f00('0x2f')]){_0x466c7c[_0x6f00('0x2e')]=_[_0x6f00('0x30')](_0x466c7c[_0x6f00('0x2e')],{'$or':_['map'](_0x27e466,function(_0xf6f5e9){if(_0xf6f5e9[_0x6f00('0x14')]!==_0x6f00('0x31')){var _0x4646dc={};_0x4646dc[_0xf6f5e9[_0x6f00('0xf')]]={'$like':'%'+_0x7c047e[_0x6f00('0x15')][_0x6f00('0x2f')]+'%'};return _0x4646dc;}})});}_0x466c7c=_['merge']({},_0x466c7c,_0x7c047e[_0x6f00('0x32')]);var _0x1dee52={'where':_0x466c7c[_0x6f00('0x2e')]};return db['CmHopper'][_0x6f00('0x8')](_0x1dee52)[_0x6f00('0x33')](function(_0x2da2e7){_0x13f09f['count']=_0x2da2e7;if(_0x7c047e[_0x6f00('0x15')]['includeAll']){_0x466c7c[_0x6f00('0x34')]=[{'all':!![]}];}return db['CmHopper'][_0x6f00('0x35')](_0x466c7c);})[_0x6f00('0x33')](function(_0x37c791){_0x13f09f[_0x6f00('0x36')]=_0x37c791;return _0x13f09f;})['then'](respondWithFilteredResult(_0x6cf83f,_0x466c7c))[_0x6f00('0x37')](handleError(_0x6cf83f,null));};exports['show']=function(_0x231bd6,_0x5bc755){var _0x7785e1={'raw':!![],'where':{'id':_0x231bd6[_0x6f00('0x38')]['id']}},_0x2f1ef1={};_0x2f1ef1[_0x6f00('0x19')]=_['keys'](db['CmHopper'][_0x6f00('0x12')]);_0x2f1ef1['query']=_[_0x6f00('0x16')](_0x231bd6[_0x6f00('0x15')]);_0x2f1ef1['filters']=_[_0x6f00('0x18')](_0x2f1ef1['model'],_0x2f1ef1['query']);_0x7785e1[_0x6f00('0x2b')]=_[_0x6f00('0x18')](_0x2f1ef1[_0x6f00('0x19')],qs[_0x6f00('0x2c')](_0x231bd6['query'][_0x6f00('0x2c')]));_0x7785e1[_0x6f00('0x2b')]=_0x7785e1[_0x6f00('0x2b')][_0x6f00('0x39')]?_0x7785e1[_0x6f00('0x2b')]:_0x2f1ef1[_0x6f00('0x19')];if(_0x231bd6['query'][_0x6f00('0x3a')]){_0x7785e1[_0x6f00('0x34')]=[{'all':!![]}];}_0x7785e1=_[_0x6f00('0x30')]({},_0x7785e1,_0x231bd6[_0x6f00('0x32')]);return db[_0x6f00('0x11')][_0x6f00('0x3b')](_0x7785e1)['then'](handleEntityNotFound(_0x5bc755,null))[_0x6f00('0x33')](respondWithResult(_0x5bc755,null))[_0x6f00('0x37')](handleError(_0x5bc755,null));};exports[_0x6f00('0x3c')]=function(_0x56b7e6,_0x2e6cc6){return db['CmHopper'][_0x6f00('0x3c')](_0x56b7e6[_0x6f00('0x3d')],{})['then'](respondWithResult(_0x2e6cc6,0xc9))[_0x6f00('0x37')](handleError(_0x2e6cc6,null));};exports['update']=function(_0xadd6d8,_0x3d4158){if(_0xadd6d8[_0x6f00('0x3d')]['id']){delete _0xadd6d8[_0x6f00('0x3d')]['id'];}return db['CmHopper'][_0x6f00('0x3b')]({'where':{'id':_0xadd6d8['params']['id']}})[_0x6f00('0x33')](handleEntityNotFound(_0x3d4158,null))['then'](saveUpdates(_0xadd6d8[_0x6f00('0x3d')],null))[_0x6f00('0x33')](respondWithResult(_0x3d4158,null))[_0x6f00('0x37')](handleError(_0x3d4158,null));};exports[_0x6f00('0x3e')]=function(_0x470ff3,_0x3472f0){return db[_0x6f00('0x11')][_0x6f00('0x3e')]()['then'](respondWithResult(_0x3472f0,null))[_0x6f00('0x37')](handleError(_0x3472f0,null));};exports['destroy']=function(_0x265666,_0x31fb17){var _0x27f38b;var _0x5eec08=_0x265666['params']['id'];return db[_0x6f00('0x11')][_0x6f00('0x3b')]({'where':{'id':_0x265666['params']['id']}})[_0x6f00('0x33')](handleEntityNotFound(_0x31fb17,null))['then'](function(_0x28130d){if(_0x28130d){return _0x28130d['destroy']()[_0x6f00('0x33')](function(_0x222b4c){return _0x222b4c;});}})['then'](function(_0x52ee5a){_0x27f38b=_0x52ee5a;if(_0x52ee5a){if(_0x52ee5a[_0x6f00('0x3f')]||_0x52ee5a[_0x6f00('0x40')]){return db[_0x52ee5a['VoiceQueueId']?_0x6f00('0x41'):'Campaign'][_0x6f00('0x3b')]({'where':{'id':_0x52ee5a[_0x6f00('0x3f')]?_0x52ee5a[_0x6f00('0x3f')]:_0x52ee5a[_0x6f00('0x40')]},'attributes':['id',_0x6f00('0xf')],'raw':!![]});}}})[_0x6f00('0x33')](function(_0x25b284){var _0x9933be={};if(_0x25b284){_[_0x6f00('0x30')](_0x9933be,_[_0x6f00('0x42')](_0x27f38b[_0x6f00('0x43')],[_0x6f00('0x44'),_0x6f00('0x45'),'id']));_0x9933be[_0x6f00('0x46')]=0x15;_0x9933be[_0x6f00('0x47')]=_0x6f00('0x48');_0x9933be[_0x6f00('0x49')]=_0x25b284[_0x6f00('0xf')];_0x9933be[_0x6f00('0x4a')]=_0x265666[_0x6f00('0x4b')]['name'];_0x9933be['UserId']=_0x265666[_0x6f00('0x4b')]['id'];_0x9933be['deleted']=!![];_0x9933be[_0x6f00('0x4c')]=moment()[_0x6f00('0x4d')]('YYYY-MM-DD\x20HH:mm:ss');_0x9933be[_0x6f00('0x4e')]=_0x27f38b[_0x6f00('0x4f')];_0x9933be[_0x6f00('0x50')]=_0x27f38b['VoiceQueueId']?_0x6f00('0x51'):'ivr';return db[_0x6f00('0x52')][_0x6f00('0x3b')]({'where':{'id':_0x9933be['ContactId']},'attributes':[_0x6f00('0x53'),_0x6f00('0x54')]})[_0x6f00('0x33')](function(_0x111fd4){if(!_[_0x6f00('0x55')](_0x31fb17)&&!_[_0x6f00('0x55')](_0x111fd4[_0x6f00('0x53')])){_0x9933be['calleridname']=_0x111fd4['firstName'];if(!_['isNil'](_0x111fd4['lastName'])){_0x9933be[_0x6f00('0x56')]+='\x20'+_0x111fd4[_0x6f00('0x54')];}}})['finally'](function(){return db['CmHopperFinal'][_0x6f00('0x3c')](_0x9933be);});}})[_0x6f00('0x33')](function(_0x33bee1){return db[_0x6f00('0x57')]['destroy']({'where':{'CmHopperId':_0x5eec08}});})[_0x6f00('0x33')](function(){return _0x31fb17['status'](0xcc)['end']();})[_0x6f00('0x37')](handleError(_0x31fb17,null));};exports[_0x6f00('0x58')]=function(_0x754f94,_0x11082f){var _0x24c6c4=[];return db['CmContact'][_0x6f00('0x3e')]()[_0x6f00('0x33')](function(_0x41a9b9){_0x24c6c4=_[_0x6f00('0x16')](_0x41a9b9);return _0x754f94['user']['getVoiceQueues']({'where':{'type':_0x6f00('0x59'),'dialActive':!![],'dialMethod':'preview'},'attributes':['id',_0x6f00('0x5a'),_0x6f00('0x5b')],'raw':!![]});})[_0x6f00('0x33')](function(_0x13de6a){if(_0x13de6a&&_0x13de6a['length']){return db['sequelize'][_0x6f00('0x5c')](function(_0x2fcee0){var _0x4ff6dc={'active':![],'recallme':![],'scheduledAt':{'$lte':moment()[_0x6f00('0x4d')]('YYYY-MM-DD\x20HH:mm:ss')},'VoiceQueueId':{'$in':_[_0x6f00('0x10')](_0x13de6a,'id')},'$or':[{'UserId':null},{'UserId':_0x754f94[_0x6f00('0x4b')]['id']}]};var _0x2b2334={'active':![],'recallme':!![],'VoiceQueueId':{'$in':_(_0x13de6a)[_0x6f00('0x2f')]([_0x6f00('0x5b'),0x0])['map']('id')['value']()},'$or':[{'UserId':null},{'UserId':_0x754f94['user']['id']}]};var _0x1e4ae3={'$or':[_0x4ff6dc,_0x2b2334]};var _0x3ca0af=[];if(_0x754f94['body']['direction']&&_0x754f94[_0x6f00('0x3d')][_0x6f00('0x5d')]==='prev'){if(!_['isEmpty'](_0x754f94[_0x6f00('0x3d')][_0x6f00('0x5e')])){_0x1e4ae3['id']={'$in':_0x754f94[_0x6f00('0x3d')][_0x6f00('0x5e')]};}_0x3ca0af=[[_0x6f00('0x5f'),_0x6f00('0x60')],[_0x6f00('0x61'),_0x13de6a[0x0][_0x6f00('0x5a')]==='ASC'?'DESC':_0x6f00('0x60')],db[_0x6f00('0x62')][_0x6f00('0x63')](_0x6f00('0x64')),['id',_0x6f00('0x65')]];}else{if(!_[_0x6f00('0x66')](_0x754f94[_0x6f00('0x3d')][_0x6f00('0x5e')])){_0x1e4ae3['id']={'$notIn':_0x754f94[_0x6f00('0x3d')][_0x6f00('0x5e')]};}_0x3ca0af=[[_0x6f00('0x5f'),_0x6f00('0x65')],[_0x6f00('0x61'),_0x13de6a[0x0][_0x6f00('0x5a')]],db[_0x6f00('0x62')][_0x6f00('0x63')](_0x6f00('0x67')),['id','ASC']];}return db['CmHopper'][_0x6f00('0x68')]({'attributes':['id','scheduledat',_0x6f00('0x4f'),_0x6f00('0x69')],'where':_0x1e4ae3,'order':_0x3ca0af,'transaction':_0x2fcee0,'lock':_0x2fcee0[_0x6f00('0x6a')][_0x6f00('0x6b')],'include':[{'model':db[_0x6f00('0x52')],'as':'Contact','attributes':_0x24c6c4,'include':[{'model':db[_0x6f00('0x6c')],'as':_0x6f00('0x6d'),'attributes':['id',_0x6f00('0xf')]}]},{'model':db[_0x6f00('0x6e')],'as':_0x6f00('0x6f'),'attributes':['id',_0x6f00('0xf')]},{'model':db[_0x6f00('0x41')],'as':_0x6f00('0x70'),'attributes':['id',_0x6f00('0xf'),_0x6f00('0x71')]}]})[_0x6f00('0x33')](function(_0x58a7b8){if(_0x58a7b8){return _0x58a7b8[_0x6f00('0xb')]({'UserId':_0x754f94[_0x6f00('0x4b')]['id']},{'transaction':_0x2fcee0});}});});}})[_0x6f00('0x33')](handleEntityNotFound(_0x11082f,null))['then'](respondWithResult(_0x11082f,null))['catch'](handleError(_0x11082f,null));};exports[_0x6f00('0x72')]=function(_0x23c20f,_0x1e5182,_0x1d24d0){var _0x5a9b42=[];var _0x564625=_0x23c20f['params']['id'];var _0x5089a5=_0x23c20f[_0x6f00('0x4b')]['id'];return db[_0x6f00('0x52')][_0x6f00('0x3e')]()[_0x6f00('0x33')](function(_0x3ba557){_0x5a9b42=_['keys'](_0x3ba557);return db[_0x6f00('0x62')][_0x6f00('0x5c')](function(_0x538143){const _0xf8a1b6={'id':_0x564625};return db[_0x6f00('0x11')][_0x6f00('0x68')]({'attributes':['id',_0x6f00('0x73'),_0x6f00('0x69')],'where':_0xf8a1b6,'transaction':_0x538143,'lock':_0x538143[_0x6f00('0x6a')][_0x6f00('0x6b')],'include':[{'model':db[_0x6f00('0x52')],'as':'Contact','attributes':_0x5a9b42,'include':[{'model':db[_0x6f00('0x6c')],'as':'Company','attributes':['id',_0x6f00('0xf')]}]},{'model':db[_0x6f00('0x6e')],'as':_0x6f00('0x6f'),'attributes':['id',_0x6f00('0xf')]},{'model':db[_0x6f00('0x41')],'as':_0x6f00('0x70'),'attributes':['id',_0x6f00('0xf'),_0x6f00('0x71')]}]})[_0x6f00('0x33')](function(_0x1c2685){if(_0x1c2685){return _0x1c2685[_0x6f00('0xb')]({'UserId':_0x5089a5},{'transaction':_0x538143});}});});})[_0x6f00('0x33')](handleEntityNotFound(_0x1e5182,null))[_0x6f00('0x33')](respondWithResult(_0x1e5182,null))[_0x6f00('0x37')](handleError(_0x1e5182,null));};exports['getOpenContacts']=function(_0x3ba021,_0xdfa8ff){return _0x3ba021[_0x6f00('0x4b')]['getVoiceQueues']({'where':{'type':_0x6f00('0x59'),'dialActive':!![],'dialMethod':_0x6f00('0x74')},'attributes':['id'],'raw':!![]})['then'](function(_0x30f620){if(_0x30f620&&_0x30f620[_0x6f00('0x39')]){return db[_0x6f00('0x11')][_0x6f00('0x8')]({'where':{'active':![],'recallme':![],'scheduledAt':{'$lte':moment()['format']('YYYY-MM-DD\x20HH:mm:ss')},'VoiceQueueId':{'$in':_['map'](_0x30f620,'id')},'$or':[{'UserId':null},{'UserId':_0x3ba021[_0x6f00('0x4b')]['id']}]}});}return 0x0;})[_0x6f00('0x33')](function(_0x26fd77){if(!_[_0x6f00('0x55')](_0x26fd77)&&_['isNumber'](_0x26fd77)){return _0xdfa8ff[_0x6f00('0x3')](0xc8)[_0x6f00('0x4')]({'contacts':_0x26fd77});}else{logger[_0x6f00('0xd')](_0x6f00('0x75'),_0x6f00('0x76'),0x194,_0x6f00('0x77'));_0xdfa8ff['sendStatus'](0x194);}})['catch'](handleError(_0xdfa8ff,null));};exports[_0x6f00('0x78')]=function(_0x179fb7,_0x2f97cd){var _0x1abd35=shared[_0x6f00('0x79')];var _0x4c9db7=[];_[_0x6f00('0x10')](_0x1abd35,function(_0x5e4928){_0x4c9db7[_0x6f00('0x7a')]({'id':_0x5e4928[_0x6f00('0xf')],'name':_0x5e4928['name'],'utcOffset':_0x5e4928[_0x6f00('0x7b')]});});return _0x2f97cd[_0x6f00('0x3')](0xc8)['json']({'tz':_0x4c9db7});};exports['getTimezone']=function(_0x340f76,_0x422649){var _0x25d7da=shared[_0x6f00('0x79')];var _0x1fb213={};if(!_[_0x6f00('0x55')](_0x25d7da[_0x340f76[_0x6f00('0x3d')]['id']]))_0x1fb213=_0x25d7da[_0x340f76['body']['id']];return _0x422649[_0x6f00('0x3')](0xc8)[_0x6f00('0x4')](_0x1fb213);}; \ No newline at end of file diff --git a/server/api/cmHopper/cmHopper.model.js b/server/api/cmHopper/cmHopper.model.js index 818cbbd..662b9cf 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 _0xd117=['bluebird','request-promise','path','rimraf','../../config/environment','./cmHopper.attributes','exports','define','CmHopper','scheduledat','phone','priority','lodash','util','../../config/logger','api','moment'];(function(_0x487b0c,_0x14ff74){var _0x1adbdc=function(_0x2e7b9d){while(--_0x2e7b9d){_0x487b0c['push'](_0x487b0c['shift']());}};_0x1adbdc(++_0x14ff74);}(_0xd117,0x182));var _0x7d11=function(_0x2064e5,_0x4f6fa2){_0x2064e5=_0x2064e5-0x0;var _0x21a233=_0xd117[_0x2064e5];return _0x21a233;};'use strict';var _=require(_0x7d11('0x0'));var util=require(_0x7d11('0x1'));var logger=require(_0x7d11('0x2'))(_0x7d11('0x3'));var moment=require(_0x7d11('0x4'));var BPromise=require(_0x7d11('0x5'));var rp=require(_0x7d11('0x6'));var fs=require('fs');var path=require(_0x7d11('0x7'));var rimraf=require(_0x7d11('0x8'));var config=require(_0x7d11('0x9'));var attributes=require(_0x7d11('0xa'));module[_0x7d11('0xb')]=function(_0x27d7e8,_0x40c3c4){return _0x27d7e8[_0x7d11('0xc')](_0x7d11('0xd'),attributes,{'tableName':'cm_hopper','paranoid':![],'indexes':[{'name':_0x7d11('0xe'),'fields':[_0x7d11('0xe')]},{'name':_0x7d11('0xf'),'fields':['phone']},{'name':_0x7d11('0x10'),'fields':[_0x7d11('0x10')]}],'timestamps':!![]});}; \ No newline at end of file +var _0x01d9=['define','CmHopper','cm_hopper','scheduledat','phone','priority','lodash','util','../../config/logger','api','bluebird','request-promise','path','rimraf','../../config/environment','./cmHopper.attributes','exports'];(function(_0x5c6f37,_0x53bc84){var _0x4ae388=function(_0x32eb6a){while(--_0x32eb6a){_0x5c6f37['push'](_0x5c6f37['shift']());}};_0x4ae388(++_0x53bc84);}(_0x01d9,0x6c));var _0x901d=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0x01d9[_0x20a584];return _0x4b41a8;};'use strict';var _=require(_0x901d('0x0'));var util=require(_0x901d('0x1'));var logger=require(_0x901d('0x2'))(_0x901d('0x3'));var moment=require('moment');var BPromise=require(_0x901d('0x4'));var rp=require(_0x901d('0x5'));var fs=require('fs');var path=require(_0x901d('0x6'));var rimraf=require(_0x901d('0x7'));var config=require(_0x901d('0x8'));var attributes=require(_0x901d('0x9'));module[_0x901d('0xa')]=function(_0x4e7842,_0x1e5d7d){return _0x4e7842[_0x901d('0xb')](_0x901d('0xc'),attributes,{'tableName':_0x901d('0xd'),'paranoid':![],'indexes':[{'name':_0x901d('0xe'),'fields':[_0x901d('0xe')]},{'name':_0x901d('0xf'),'fields':[_0x901d('0xf')]},{'name':_0x901d('0x10'),'fields':[_0x901d('0x10')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/cmHopper/cmHopper.rpc.js b/server/api/cmHopper/cmHopper.rpc.js index ab89bc2..15ff319 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 _0x518b=['describe','GetCmHopperPreview','GetContactByPhone','findOne','phone','dialTimezone','DESC','getContactByPhone','ResetActiveCalls','CmHopperHandlePreviewRecallNotifications','voiceQueueIds','interval','availableAgentsIds','NOW()\x20+\x20INTERVAL\x20','\x20MINUTE','User','voicePause','CmList','NOW()','lodash','util','moment','bluebird','../../mysqldb','CmHopper','findAll','options','raw','attributes','limit','include','map','model','then','info','debug','GetCmHopper','catch','message','error','ShowCmHopper','where','CreateCmHopper','body','stringify','UpdateCmHopper','update','UpdateCmHopper\x20hopper\x20options\x20[%s]\x20active\x20status\x20[%s]','DestroyCmHopper','destroy','GetContactDialer','CmContact','sequelize','LOCK','UPDATE','Contact','keys','Agent','name','length','UserId','includes','push','all','GetContactDialer\x20hopperId\x20[%s]\x20-\x20contactId\x20[%s]\x20-\x20active\x20status\x20[%s]','dataValues','ContactId','active','transaction','CmHopperFinal','create','MoveContactManagedDialer\x20hopper\x20options\x20[%s]\x20active\x20status\x20[%s]','MoveContactManagedDialer','literal','`scheduledat`\x20>=\x20','format','\x22%s\x22','YYYY-MM-DD\x20HH:mm:ss','\x20,\x201,\x20null','contactsRescheduled','CountReScheduled','GetContactRecallMe'];(function(_0x46fdbb,_0x217295){var _0x219d7e=function(_0x1350b8){while(--_0x1350b8){_0x46fdbb['push'](_0x46fdbb['shift']());}};_0x219d7e(++_0x217295);}(_0x518b,0x15b));var _0xb518=function(_0x46947d,_0x1b09c9){_0x46947d=_0x46947d-0x0;var _0x14dbc8=_0x518b[_0x46947d];return _0x14dbc8;};'use strict';var _=require(_0xb518('0x0'));var util=require(_0xb518('0x1'));var moment=require(_0xb518('0x2'));var BPromise=require(_0xb518('0x3'));var db=require(_0xb518('0x4'))['db'];var logger=require('../../config/logger')('rpc');exports['GetCmHopper']=function(_0x72291a){var _0x31255d=this;return new Promise(function(_0x516522,_0x4863c7){return db[_0xb518('0x5')][_0xb518('0x6')]({'raw':_0x72291a[_0xb518('0x7')]?_0x72291a[_0xb518('0x7')][_0xb518('0x8')]===undefined?!![]:![]:!![],'where':_0x72291a['options']?_0x72291a[_0xb518('0x7')]['where']||null:null,'attributes':_0x72291a[_0xb518('0x7')]?_0x72291a['options'][_0xb518('0x9')]||null:null,'limit':_0x72291a['options']?_0x72291a[_0xb518('0x7')][_0xb518('0xa')]||null:null,'include':_0x72291a[_0xb518('0x7')]?_0x72291a[_0xb518('0x7')][_0xb518('0xb')]?_[_0xb518('0xc')](_0x72291a[_0xb518('0x7')][_0xb518('0xb')],function(_0x6257c5){return{'model':db[_0x6257c5[_0xb518('0xd')]],'as':_0x6257c5['as'],'attributes':_0x6257c5[_0xb518('0x9')],'include':_0x6257c5[_0xb518('0xb')]?_[_0xb518('0xc')](_0x6257c5['include'],function(_0x931897){return{'model':db[_0x931897[_0xb518('0xd')]],'as':_0x931897['as'],'attributes':_0x931897[_0xb518('0x9')],'include':_0x931897[_0xb518('0xb')]?_['map'](_0x931897['include'],function(_0xfa2101){return{'model':db[_0xfa2101[_0xb518('0xd')]],'as':_0xfa2101['as'],'attributes':_0xfa2101['attributes']};}):[]};}):[]};}):[]:[]})[_0xb518('0xe')](function(_0x5ef06b){logger[_0xb518('0xf')]('GetCmHopper',_0x72291a);logger[_0xb518('0x10')](_0xb518('0x11'),_0x72291a,JSON['stringify'](_0x5ef06b));_0x516522(_0x5ef06b);})[_0xb518('0x12')](function(_0x1e88b0){logger['error'](_0xb518('0x11'),_0x1e88b0[_0xb518('0x13')],_0x72291a);_0x4863c7(_0x31255d[_0xb518('0x14')](0x1f4,_0x1e88b0[_0xb518('0x13')]));});});};exports[_0xb518('0x15')]=function(_0x5aa176){var _0x15ac75=this;return new Promise(function(_0x3e15e8,_0xc73da9){return db['CmHopper']['find']({'raw':_0x5aa176[_0xb518('0x7')]?_0x5aa176[_0xb518('0x7')][_0xb518('0x8')]===undefined?!![]:![]:!![],'where':_0x5aa176[_0xb518('0x7')]?_0x5aa176[_0xb518('0x7')][_0xb518('0x16')]||null:null,'attributes':_0x5aa176['options']?_0x5aa176[_0xb518('0x7')][_0xb518('0x9')]||null:null,'include':_0x5aa176[_0xb518('0x7')]?_0x5aa176['options'][_0xb518('0xb')]?_[_0xb518('0xc')](_0x5aa176['options'][_0xb518('0xb')],function(_0x239b6f){return{'model':db[_0x239b6f[_0xb518('0xd')]],'as':_0x239b6f['as'],'attributes':_0x239b6f[_0xb518('0x9')],'include':_0x239b6f[_0xb518('0xb')]?_[_0xb518('0xc')](_0x239b6f[_0xb518('0xb')],function(_0x503442){return{'model':db[_0x503442['model']],'as':_0x503442['as'],'attributes':_0x503442[_0xb518('0x9')],'include':_0x503442[_0xb518('0xb')]?_['map'](_0x503442[_0xb518('0xb')],function(_0x162670){return{'model':db[_0x162670['model']],'as':_0x162670['as'],'attributes':_0x162670['attributes']};}):[]};}):[]};}):[]:[]})['then'](function(_0x382585){logger['info'](_0xb518('0x15'),_0x5aa176);logger[_0xb518('0x10')](_0xb518('0x15'),_0x5aa176,JSON['stringify'](_0x382585));_0x3e15e8(_0x382585);})[_0xb518('0x12')](function(_0x40c1f0){logger['error'](_0xb518('0x15'),_0x40c1f0[_0xb518('0x13')],_0x5aa176);_0xc73da9(_0x15ac75[_0xb518('0x14')](0x1f4,_0x40c1f0[_0xb518('0x13')]));});});};exports[_0xb518('0x17')]=function(_0x5e8606){var _0x5768e4=this;return new Promise(function(_0x19ac3c,_0x526c8c){return db[_0xb518('0x5')]['create'](_0x5e8606[_0xb518('0x18')],{'raw':_0x5e8606[_0xb518('0x7')]?_0x5e8606[_0xb518('0x7')][_0xb518('0x8')]===undefined?!![]:![]:!![]})[_0xb518('0xe')](function(_0x314529){logger[_0xb518('0xf')]('CreateCmHopper',_0x5e8606);logger[_0xb518('0x10')](_0xb518('0x17'),_0x5e8606,JSON[_0xb518('0x19')](_0x314529));_0x19ac3c(_0x314529);})['catch'](function(_0x5b56f7){logger[_0xb518('0x14')](_0xb518('0x17'),_0x5b56f7['message'],_0x5e8606);_0x526c8c(_0x5768e4[_0xb518('0x14')](0x1f4,_0x5b56f7['message']));});});};exports[_0xb518('0x1a')]=function(_0x15c464){var _0x577238=this;return new Promise(function(_0x150abc,_0x33a678){return db[_0xb518('0x5')][_0xb518('0x1b')](_0x15c464[_0xb518('0x18')],{'raw':_0x15c464[_0xb518('0x7')]?_0x15c464[_0xb518('0x7')]['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x15c464[_0xb518('0x7')]?_0x15c464['options']['where']||null:null,'attributes':_0x15c464[_0xb518('0x7')]?_0x15c464['options'][_0xb518('0x9')]||null:null,'limit':_0x15c464[_0xb518('0x7')]?_0x15c464[_0xb518('0x7')][_0xb518('0xa')]||null:null})[_0xb518('0xe')](function(_0x1f89d1){logger[_0xb518('0xf')](_0xb518('0x1a'),_0x15c464);logger['info'](_0xb518('0x1c'),JSON[_0xb518('0x19')](_0x15c464[_0xb518('0x7')][_0xb518('0x16')]),_0x15c464[_0xb518('0x18')]['active']);logger['debug'](_0xb518('0x1a'),_0x15c464,JSON[_0xb518('0x19')](_0x1f89d1));_0x150abc(_0x1f89d1);})[_0xb518('0x12')](function(_0x37162d){logger[_0xb518('0x14')](_0xb518('0x1a'),_0x37162d[_0xb518('0x13')],_0x15c464);_0x33a678(_0x577238['error'](0x1f4,_0x37162d[_0xb518('0x13')]));});});};exports[_0xb518('0x1d')]=function(_0x41a251){var _0x401e0b=this;return new Promise(function(_0x7e9834,_0x3ae017){return db[_0xb518('0x5')][_0xb518('0x1e')]({'where':_0x41a251['options']?_0x41a251[_0xb518('0x7')][_0xb518('0x16')]||null:null})[_0xb518('0xe')](function(_0x170e76){logger[_0xb518('0xf')](_0xb518('0x1d'),_0x41a251);logger[_0xb518('0x10')](_0xb518('0x1d'),_0x41a251,JSON[_0xb518('0x19')](_0x170e76));_0x7e9834(_0x170e76);})[_0xb518('0x12')](function(_0x1ceb8e){logger['error'](_0xb518('0x1d'),_0x1ceb8e[_0xb518('0x13')],_0x41a251);_0x3ae017(_0x401e0b[_0xb518('0x14')](0x1f4,_0x1ceb8e['message']));});});};exports[_0xb518('0x1f')]=function(_0x5aaf12){var _0x30968f=this;return new Promise(function(_0x202983,_0x4cde73){return db[_0xb518('0x20')]['describe']()[_0xb518('0xe')](function(_0x1fbcb2){return db[_0xb518('0x21')]['transaction'](function(_0x589817){return db['CmHopper'][_0xb518('0x6')]({'where':_0x5aaf12[_0xb518('0x7')]?_0x5aaf12[_0xb518('0x7')][_0xb518('0x16')]||null:null,'attributes':_0x5aaf12[_0xb518('0x7')]?_0x5aaf12['options'][_0xb518('0x9')]||null:null,'limit':_0x5aaf12['options']?_0x5aaf12[_0xb518('0x7')][_0xb518('0xa')]||null:null,'order':_0x5aaf12[_0xb518('0x7')]?_0x5aaf12[_0xb518('0x7')]['order']||null:null,'transaction':_0x589817,'lock':_0x589817[_0xb518('0x22')][_0xb518('0x23')],'include':[{'model':db['CmContact'],'as':_0xb518('0x24'),'attributes':_[_0xb518('0x25')](_0x1fbcb2)},{'model':db['User'],'as':_0xb518('0x26'),'attributes':['id',_0xb518('0x27'),'voicePause']}]})[_0xb518('0xe')](function(_0x4d4f05){var _0x2a8669=[];var _0x2f21e0=[];for(var _0x55018e=0x0;_0x55018e<_0x4d4f05[_0xb518('0x28')];_0x55018e+=0x1){var _0x172c1d=_0x4d4f05[_0x55018e][_0xb518('0x29')];if(_0x172c1d===null){_0x2a8669['push'](_0x4d4f05[_0x55018e][_0xb518('0x1b')](_0x5aaf12[_0xb518('0x18')],{'transaction':_0x589817}));}else if(!_0x2f21e0[_0xb518('0x2a')](_0x172c1d)){_0x2f21e0[_0xb518('0x2b')](_0x172c1d);_0x2a8669['push'](_0x4d4f05[_0x55018e][_0xb518('0x1b')](_0x5aaf12['body'],{'transaction':_0x589817}));}}return BPromise[_0xb518('0x2c')](_0x2a8669);});})['then'](function(_0x331851){logger['info']('GetContactDialer',_0x5aaf12);if(_0x331851['length']>0x0){logger[_0xb518('0xf')](_0xb518('0x2d'),_0x331851[0x0][_0xb518('0x2e')]['id'],_0x331851[0x0]['dataValues'][_0xb518('0x2f')],_0x331851[0x0]['dataValues'][_0xb518('0x30')]);}logger['debug']('GetContactDialer',_0x5aaf12,JSON[_0xb518('0x19')](_0x331851));_0x202983(_0x331851);})[_0xb518('0x12')](function(_0x3f85ad){logger['error'](_0xb518('0x1f'),_0x3f85ad[_0xb518('0x13')],_0x5aaf12);_0x4cde73(_0x30968f[_0xb518('0x14')](0x1f4,_0x3f85ad['message']));});});});};exports['MoveContactManagedDialer']=function(_0x36f59c){var _0x1b2323=this;return new Promise(function(_0x470f01,_0x6f7a34){return db[_0xb518('0x21')][_0xb518('0x31')](function(_0x57a478){return db[_0xb518('0x32')][_0xb518('0x33')](_0x36f59c[_0xb518('0x18')],{'raw':_0x36f59c[_0xb518('0x7')]?_0x36f59c['options']['raw']===undefined?!![]:![]:!![],'transaction':_0x57a478})[_0xb518('0xe')](function(){logger['info'](_0xb518('0x34'),JSON[_0xb518('0x19')](_0x36f59c[_0xb518('0x7')][_0xb518('0x16')]),_0x36f59c[_0xb518('0x7')]['where'][_0xb518('0x30')]);return db['CmHopper'][_0xb518('0x1e')]({'where':_0x36f59c[_0xb518('0x7')]?_0x36f59c['options']['where']||null:null,'transaction':_0x57a478});});})[_0xb518('0xe')](function(_0x1df987){logger[_0xb518('0xf')](_0xb518('0x35'),_0x36f59c);logger[_0xb518('0x10')]('MoveContactManagedDialer',_0x36f59c,JSON[_0xb518('0x19')](_0x1df987));_0x470f01(_0x1df987);})[_0xb518('0x12')](function(_0x3525d9){logger[_0xb518('0x14')]('MoveContactManagedDialer',_0x3525d9['message'],_0x36f59c);_0x6f7a34(_0x1b2323['error'](0x1f4,_0x3525d9[_0xb518('0x13')]));});});};exports['CountReScheduled']=function(_0x1dbdd2){var _0xc3a65e=this;return new Promise(function(_0x12f380,_0x1082c9){return db[_0xb518('0x5')][_0xb518('0x6')]({'raw':_0x1dbdd2['options']?_0x1dbdd2[_0xb518('0x7')][_0xb518('0x8')]===undefined?!![]:![]:!![],'where':_0x1dbdd2[_0xb518('0x7')]?_0x1dbdd2[_0xb518('0x7')]['where']||null:null,'attributes':[[db[_0xb518('0x21')]['fn']('COUNT',db['sequelize']['fn']('IF',db[_0xb518('0x21')][_0xb518('0x36')](_0xb518('0x37')+util[_0xb518('0x38')](_0xb518('0x39'),moment()[_0xb518('0x38')](_0xb518('0x3a')))+_0xb518('0x3b')))),_0xb518('0x3c')]]})[_0xb518('0xe')](function(_0x3513f3){logger[_0xb518('0xf')]('CountReScheduled',_0x1dbdd2);logger[_0xb518('0x10')](_0xb518('0x3d'),_0x1dbdd2,JSON['stringify'](_0x3513f3));_0x12f380(_0x3513f3);})['catch'](function(_0x85a951){logger[_0xb518('0x14')](_0xb518('0x3d'),_0x85a951[_0xb518('0x13')],_0x1dbdd2);_0x1082c9(_0xc3a65e['error'](0x1f4,_0x85a951[_0xb518('0x13')]));});});};exports[_0xb518('0x3e')]=function(_0x3f472d){var _0x1d2cb4=this;return new Promise(function(_0x30ce14,_0x5461dd){return db[_0xb518('0x20')][_0xb518('0x3f')]()[_0xb518('0xe')](function(){return db[_0xb518('0x21')]['transaction'](function(_0x378c5e){return db[_0xb518('0x5')]['findAll']({'where':_0x3f472d[_0xb518('0x7')]?_0x3f472d[_0xb518('0x7')][_0xb518('0x16')]||null:null,'attributes':_0x3f472d[_0xb518('0x7')]?_0x3f472d[_0xb518('0x7')][_0xb518('0x9')]||null:null,'limit':0x1,'order':_0x3f472d[_0xb518('0x7')]?_0x3f472d[_0xb518('0x7')]['order']||null:null,'group':db[_0xb518('0x5')][_0xb518('0x29')],'transaction':_0x378c5e,'lock':_0x378c5e[_0xb518('0x22')][_0xb518('0x23')],'include':_0x3f472d[_0xb518('0x7')]?_0x3f472d[_0xb518('0x7')]['include']?_[_0xb518('0xc')](_0x3f472d[_0xb518('0x7')]['include'],function(_0x987ff3){return{'model':db[_0x987ff3[_0xb518('0xd')]],'as':_0x987ff3['as'],'attributes':_0x987ff3['attributes'],'include':_0x987ff3['include']?_['map'](_0x987ff3[_0xb518('0xb')],function(_0x322006){return{'model':db[_0x322006[_0xb518('0xd')]],'as':_0x322006['as'],'attributes':_0x322006[_0xb518('0x9')],'include':_0x322006[_0xb518('0xb')]?_[_0xb518('0xc')](_0x322006[_0xb518('0xb')],function(_0x49d601){return{'model':db[_0x49d601['model']],'as':_0x49d601['as'],'attributes':_0x49d601[_0xb518('0x9')]};}):[]};}):[]};}):[]:[]})[_0xb518('0xe')](function(_0x4ddd06){var _0x4e6609=[];for(var _0x4a0d09=0x0;_0x4a0d09<_0x4ddd06['length'];_0x4a0d09+=0x1){_0x4e6609[_0xb518('0x2b')](_0x4ddd06[_0x4a0d09][_0xb518('0x1b')](_0x3f472d[_0xb518('0x18')],{'transaction':_0x378c5e}));}return BPromise[_0xb518('0x2c')](_0x4e6609);});})[_0xb518('0xe')](function(_0x3a1d12){logger[_0xb518('0xf')](_0xb518('0x3e'),_0x3f472d);logger[_0xb518('0x10')]('GetContactRecallMe',_0x3f472d,JSON[_0xb518('0x19')](_0x3a1d12));_0x30ce14(_0x3a1d12);})[_0xb518('0x12')](function(_0x1e2805){logger[_0xb518('0x14')](_0xb518('0x3e'),_0x1e2805[_0xb518('0x13')],_0x3f472d);_0x5461dd(_0x1d2cb4[_0xb518('0x14')](0x1f4,_0x1e2805[_0xb518('0x13')]));});});});};exports[_0xb518('0x40')]=function(_0x428607){var _0x104fa8=this;return new Promise(function(_0x405b53,_0x5c52c0){db[_0xb518('0x20')]['describe']()['then'](function(_0x51f642){return db[_0xb518('0x5')]['findAll']({'raw':_0x428607['options']?_0x428607['options'][_0xb518('0x8')]===undefined?!![]:![]:!![],'where':_0x428607['options']?_0x428607[_0xb518('0x7')]['where']||null:null,'attributes':_0x428607['options']?_0x428607[_0xb518('0x7')]['attributes']||null:null,'limit':_0x428607['options']?_0x428607[_0xb518('0x7')][_0xb518('0xa')]||null:null,'include':_0x428607[_0xb518('0x7')]?_0x428607[_0xb518('0x7')][_0xb518('0xb')]?_['map'](_0x428607[_0xb518('0x7')][_0xb518('0xb')],function(_0x32c47b){return{'model':db[_0x32c47b[_0xb518('0xd')]],'as':_0x32c47b['as'],'attributes':_0x32c47b['as']===_0xb518('0x24')?_['keys'](_0x51f642):_0x32c47b[_0xb518('0x9')],'include':_0x32c47b[_0xb518('0xb')]?_[_0xb518('0xc')](_0x32c47b[_0xb518('0xb')],function(_0xec698e){return{'model':db[_0xec698e[_0xb518('0xd')]],'as':_0xec698e['as'],'attributes':_0xec698e[_0xb518('0x9')],'include':_0xec698e[_0xb518('0xb')]?_[_0xb518('0xc')](_0xec698e[_0xb518('0xb')],function(_0x1b750b){return{'model':db[_0x1b750b[_0xb518('0xd')]],'as':_0x1b750b['as'],'attributes':_0x1b750b[_0xb518('0x9')]};}):[]};}):[]};}):[]:[]})[_0xb518('0xe')](function(_0x39baca){logger[_0xb518('0xf')]('GetCmHopper',_0x428607);logger['debug']('GetCmHopper',_0x428607,JSON[_0xb518('0x19')](_0x39baca));_0x405b53(_0x39baca);})['catch'](function(_0xfef726){logger[_0xb518('0x14')]('GetCmHopper',_0xfef726['message'],_0x428607);_0x5c52c0(_0x104fa8[_0xb518('0x14')](0x1f4,_0xfef726[_0xb518('0x13')]));});});});};exports[_0xb518('0x41')]=function(_0x4d91ef){var _0x17a15f=this;return new Promise(function(_0x230926,_0x3fb4c9){return db[_0xb518('0x20')][_0xb518('0x42')]({'raw':!![],'where':{'phone':_0x4d91ef[_0xb518('0x7')][_0xb518('0x16')][_0xb518('0x43')]},'attributes':['id',_0xb518('0x44')],'order':[['id',_0xb518('0x45')]]})[_0xb518('0xe')](function(_0x24100f){logger['info'](_0xb518('0x46'),_0x4d91ef);logger[_0xb518('0x10')]('getContactByPhone',_0x4d91ef,JSON[_0xb518('0x19')](_0x24100f));_0x230926(_0x24100f);})['catch'](function(_0x3f94c5){logger[_0xb518('0x14')](_0xb518('0x46'),_0x3f94c5[_0xb518('0x13')],_0x4d91ef);_0x3fb4c9(_0x17a15f[_0xb518('0x14')](0x1f4,_0x3f94c5['message']));});});};exports[_0xb518('0x47')]=function(_0x181957){var _0x5ea6ac=this;return new Promise(function(_0x23befc,_0x2399fe){return db[_0xb518('0x21')][_0xb518('0x31')](function(_0x207d11){var _0xeb9cde=_0x181957[_0xb518('0x7')]&&_0x181957['options']['where']?_0x181957['options'][_0xb518('0x16')]:{};return db[_0xb518('0x5')][_0xb518('0x1b')](_0x181957[_0xb518('0x18')],{'where':_0xeb9cde,'transaction':_0x207d11})[_0xb518('0xe')](function(_0x5c08e0){logger['info'](_0xb518('0x47'),_0x181957);logger[_0xb518('0x10')](_0xb518('0x47'),_0x181957,JSON[_0xb518('0x19')](_0x5c08e0));_0x23befc(_0x5c08e0);})[_0xb518('0x12')](function(_0x283da3){logger[_0xb518('0x14')](_0xb518('0x47'),_0x283da3['message'],_0x181957);_0x2399fe(_0x5ea6ac[_0xb518('0x14')](0x1f4,_0x283da3[_0xb518('0x13')]));});});});};exports[_0xb518('0x48')]=function(_0x5af9d9){var _0xca0e08=this;var _0xcd7016=_0x5af9d9[_0xb518('0x18')][_0xb518('0x16')][_0xb518('0x49')];var _0x1d5485=_0x5af9d9[_0xb518('0x18')][_0xb518('0x16')][_0xb518('0x4a')];var _0x563356=_0x5af9d9[_0xb518('0x18')][_0xb518('0x16')][_0xb518('0x4b')];return new Promise(function(_0x591e85,_0x27d984){return db[_0xb518('0x5')][_0xb518('0x6')]({'where':{'voiceQueueId':{'$in':_0xcd7016},'recallme':0x1,'active':0x0,'recallmeNotifiedDate':{'$eq':null},'scheduledat':{'$and':{'$lte':db[_0xb518('0x21')][_0xb518('0x36')](_0xb518('0x4c')+_0x1d5485+_0xb518('0x4d')),'$gt':db['sequelize']['literal']('NOW()')}},'UserId':{'$in':_0x563356}},'include':[{'model':db['CmContact'],'as':_0xb518('0x24')},{'model':db[_0xb518('0x4e')],'as':_0xb518('0x26'),'attributes':['id',_0xb518('0x27'),_0xb518('0x4f')]},{'model':db[_0xb518('0x50')],'as':'List'}]})[_0xb518('0xe')](function(_0x4618db){if(_0x4618db[_0xb518('0x28')]>0x0){return db[_0xb518('0x21')][_0xb518('0x31')](function(_0x56b274){return db[_0xb518('0x5')]['update']({'recallmeNotifiedDate':db[_0xb518('0x21')][_0xb518('0x36')](_0xb518('0x51'))},{'where':{'id':{'$in':_[_0xb518('0xc')](_0x4618db,'id')}},'transaction':_0x56b274})[_0xb518('0xe')](function(){_0x591e85(_0x4618db);})[_0xb518('0x12')](function(_0x21383c){logger['error'](_0xb518('0x48'),_0x21383c[_0xb518('0x13')],_0x5af9d9);_0x27d984(_0xca0e08[_0xb518('0x14')](0x1f4,_0x21383c[_0xb518('0x13')]));});})['catch'](function(_0x343b2e){logger[_0xb518('0x14')](_0xb518('0x48'),_0x343b2e[_0xb518('0x13')],_0x5af9d9);_0x27d984(_0xca0e08[_0xb518('0x14')](0x1f4,_0x343b2e[_0xb518('0x13')]));});}else{_0x591e85(_0x4618db);}});});}; \ No newline at end of file +var _0x6bfa=['find','where','stringify','CreateCmHopper','update','UpdateCmHopper','active','DestroyCmHopper','GetContactDialer','CmContact','describe','sequelize','order','UPDATE','Contact','keys','User','Agent','name','voicePause','length','UserId','push','includes','body','all','GetContactDialer\x20hopperId\x20[%s]\x20-\x20contactId\x20[%s]\x20-\x20active\x20status\x20[%s]','dataValues','ContactId','MoveContactManagedDialer','transaction','create','CountReScheduled','literal','`scheduledat`\x20>=\x20','format','\x22%s\x22','YYYY-MM-DD\x20HH:mm:ss','\x20,\x201,\x20null','contactsRescheduled','GetContactRecallMe','LOCK','GetCmHopperPreview','GetContactByPhone','phone','dialTimezone','DESC','getContactByPhone','ResetActiveCalls','CmHopperHandlePreviewRecallNotifications','voiceQueueIds','interval','availableAgentsIds','NOW()\x20+\x20INTERVAL\x20','\x20MINUTE','NOW()','List','lodash','util','moment','bluebird','../../config/logger','GetCmHopper','findAll','options','raw','limit','include','map','attributes','model','then','info','debug','catch','error','message','ShowCmHopper','CmHopper'];(function(_0x14114d,_0x33f634){var _0x1c8da4=function(_0x18a891){while(--_0x18a891){_0x14114d['push'](_0x14114d['shift']());}};_0x1c8da4(++_0x33f634);}(_0x6bfa,0x175));var _0xa6bf=function(_0x5622d6,_0x40809a){_0x5622d6=_0x5622d6-0x0;var _0x411cae=_0x6bfa[_0x5622d6];return _0x411cae;};'use strict';var _=require(_0xa6bf('0x0'));var util=require(_0xa6bf('0x1'));var moment=require(_0xa6bf('0x2'));var BPromise=require(_0xa6bf('0x3'));var db=require('../../mysqldb')['db'];var logger=require(_0xa6bf('0x4'))('rpc');exports[_0xa6bf('0x5')]=function(_0x3d58a9){var _0x41e6bd=this;return new Promise(function(_0x39e5dd,_0x1ba233){return db['CmHopper'][_0xa6bf('0x6')]({'raw':_0x3d58a9[_0xa6bf('0x7')]?_0x3d58a9['options'][_0xa6bf('0x8')]===undefined?!![]:![]:!![],'where':_0x3d58a9[_0xa6bf('0x7')]?_0x3d58a9['options']['where']||null:null,'attributes':_0x3d58a9[_0xa6bf('0x7')]?_0x3d58a9['options']['attributes']||null:null,'limit':_0x3d58a9[_0xa6bf('0x7')]?_0x3d58a9[_0xa6bf('0x7')][_0xa6bf('0x9')]||null:null,'include':_0x3d58a9[_0xa6bf('0x7')]?_0x3d58a9[_0xa6bf('0x7')][_0xa6bf('0xa')]?_[_0xa6bf('0xb')](_0x3d58a9[_0xa6bf('0x7')]['include'],function(_0x2fbbbe){return{'model':db[_0x2fbbbe['model']],'as':_0x2fbbbe['as'],'attributes':_0x2fbbbe[_0xa6bf('0xc')],'include':_0x2fbbbe[_0xa6bf('0xa')]?_[_0xa6bf('0xb')](_0x2fbbbe['include'],function(_0x145621){return{'model':db[_0x145621[_0xa6bf('0xd')]],'as':_0x145621['as'],'attributes':_0x145621['attributes'],'include':_0x145621['include']?_[_0xa6bf('0xb')](_0x145621[_0xa6bf('0xa')],function(_0x451b27){return{'model':db[_0x451b27['model']],'as':_0x451b27['as'],'attributes':_0x451b27['attributes']};}):[]};}):[]};}):[]:[]})[_0xa6bf('0xe')](function(_0x46b7){logger[_0xa6bf('0xf')](_0xa6bf('0x5'),_0x3d58a9);logger[_0xa6bf('0x10')]('GetCmHopper',_0x3d58a9,JSON['stringify'](_0x46b7));_0x39e5dd(_0x46b7);})[_0xa6bf('0x11')](function(_0x2fa21b){logger[_0xa6bf('0x12')](_0xa6bf('0x5'),_0x2fa21b[_0xa6bf('0x13')],_0x3d58a9);_0x1ba233(_0x41e6bd[_0xa6bf('0x12')](0x1f4,_0x2fa21b[_0xa6bf('0x13')]));});});};exports[_0xa6bf('0x14')]=function(_0x14795f){var _0x1e4f55=this;return new Promise(function(_0x1bb5f3,_0x40aadd){return db[_0xa6bf('0x15')][_0xa6bf('0x16')]({'raw':_0x14795f[_0xa6bf('0x7')]?_0x14795f[_0xa6bf('0x7')][_0xa6bf('0x8')]===undefined?!![]:![]:!![],'where':_0x14795f['options']?_0x14795f['options'][_0xa6bf('0x17')]||null:null,'attributes':_0x14795f[_0xa6bf('0x7')]?_0x14795f[_0xa6bf('0x7')][_0xa6bf('0xc')]||null:null,'include':_0x14795f[_0xa6bf('0x7')]?_0x14795f[_0xa6bf('0x7')]['include']?_['map'](_0x14795f[_0xa6bf('0x7')][_0xa6bf('0xa')],function(_0x1f90fe){return{'model':db[_0x1f90fe[_0xa6bf('0xd')]],'as':_0x1f90fe['as'],'attributes':_0x1f90fe[_0xa6bf('0xc')],'include':_0x1f90fe['include']?_[_0xa6bf('0xb')](_0x1f90fe[_0xa6bf('0xa')],function(_0x1c9a9e){return{'model':db[_0x1c9a9e['model']],'as':_0x1c9a9e['as'],'attributes':_0x1c9a9e['attributes'],'include':_0x1c9a9e[_0xa6bf('0xa')]?_[_0xa6bf('0xb')](_0x1c9a9e[_0xa6bf('0xa')],function(_0x159d3c){return{'model':db[_0x159d3c[_0xa6bf('0xd')]],'as':_0x159d3c['as'],'attributes':_0x159d3c[_0xa6bf('0xc')]};}):[]};}):[]};}):[]:[]})[_0xa6bf('0xe')](function(_0x208260){logger[_0xa6bf('0xf')](_0xa6bf('0x14'),_0x14795f);logger['debug']('ShowCmHopper',_0x14795f,JSON[_0xa6bf('0x18')](_0x208260));_0x1bb5f3(_0x208260);})[_0xa6bf('0x11')](function(_0x60a5a3){logger[_0xa6bf('0x12')]('ShowCmHopper',_0x60a5a3['message'],_0x14795f);_0x40aadd(_0x1e4f55[_0xa6bf('0x12')](0x1f4,_0x60a5a3[_0xa6bf('0x13')]));});});};exports['CreateCmHopper']=function(_0x1700f8){var _0x573735=this;return new Promise(function(_0x22631c,_0x4c91bf){return db[_0xa6bf('0x15')]['create'](_0x1700f8['body'],{'raw':_0x1700f8[_0xa6bf('0x7')]?_0x1700f8[_0xa6bf('0x7')]['raw']===undefined?!![]:![]:!![]})[_0xa6bf('0xe')](function(_0x4d385d){logger[_0xa6bf('0xf')]('CreateCmHopper',_0x1700f8);logger[_0xa6bf('0x10')](_0xa6bf('0x19'),_0x1700f8,JSON[_0xa6bf('0x18')](_0x4d385d));_0x22631c(_0x4d385d);})[_0xa6bf('0x11')](function(_0x15821a){logger[_0xa6bf('0x12')]('CreateCmHopper',_0x15821a[_0xa6bf('0x13')],_0x1700f8);_0x4c91bf(_0x573735[_0xa6bf('0x12')](0x1f4,_0x15821a[_0xa6bf('0x13')]));});});};exports['UpdateCmHopper']=function(_0x2279df){var _0xdf8ddf=this;return new Promise(function(_0x133dde,_0x490e79){return db[_0xa6bf('0x15')][_0xa6bf('0x1a')](_0x2279df['body'],{'raw':_0x2279df[_0xa6bf('0x7')]?_0x2279df[_0xa6bf('0x7')][_0xa6bf('0x8')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x2279df['options']?_0x2279df[_0xa6bf('0x7')][_0xa6bf('0x17')]||null:null,'attributes':_0x2279df['options']?_0x2279df[_0xa6bf('0x7')][_0xa6bf('0xc')]||null:null,'limit':_0x2279df[_0xa6bf('0x7')]?_0x2279df['options'][_0xa6bf('0x9')]||null:null})[_0xa6bf('0xe')](function(_0x6c0d24){logger[_0xa6bf('0xf')](_0xa6bf('0x1b'),_0x2279df);logger['info']('UpdateCmHopper\x20hopper\x20options\x20[%s]\x20active\x20status\x20[%s]',JSON[_0xa6bf('0x18')](_0x2279df['options']['where']),_0x2279df['body'][_0xa6bf('0x1c')]);logger[_0xa6bf('0x10')](_0xa6bf('0x1b'),_0x2279df,JSON['stringify'](_0x6c0d24));_0x133dde(_0x6c0d24);})[_0xa6bf('0x11')](function(_0x4db224){logger[_0xa6bf('0x12')](_0xa6bf('0x1b'),_0x4db224[_0xa6bf('0x13')],_0x2279df);_0x490e79(_0xdf8ddf[_0xa6bf('0x12')](0x1f4,_0x4db224['message']));});});};exports[_0xa6bf('0x1d')]=function(_0x130f0d){var _0x47b1c3=this;return new Promise(function(_0x51a40c,_0x588163){return db['CmHopper']['destroy']({'where':_0x130f0d[_0xa6bf('0x7')]?_0x130f0d['options'][_0xa6bf('0x17')]||null:null})[_0xa6bf('0xe')](function(_0xf69c5a){logger[_0xa6bf('0xf')]('DestroyCmHopper',_0x130f0d);logger[_0xa6bf('0x10')](_0xa6bf('0x1d'),_0x130f0d,JSON[_0xa6bf('0x18')](_0xf69c5a));_0x51a40c(_0xf69c5a);})[_0xa6bf('0x11')](function(_0x6783f7){logger[_0xa6bf('0x12')](_0xa6bf('0x1d'),_0x6783f7[_0xa6bf('0x13')],_0x130f0d);_0x588163(_0x47b1c3['error'](0x1f4,_0x6783f7[_0xa6bf('0x13')]));});});};exports[_0xa6bf('0x1e')]=function(_0x37f7a3){var _0x3f2afd=this;return new Promise(function(_0x26d8e2,_0x411459){return db[_0xa6bf('0x1f')][_0xa6bf('0x20')]()[_0xa6bf('0xe')](function(_0x361632){return db[_0xa6bf('0x21')]['transaction'](function(_0x3a5e53){return db['CmHopper'][_0xa6bf('0x6')]({'where':_0x37f7a3['options']?_0x37f7a3[_0xa6bf('0x7')][_0xa6bf('0x17')]||null:null,'attributes':_0x37f7a3[_0xa6bf('0x7')]?_0x37f7a3['options'][_0xa6bf('0xc')]||null:null,'limit':_0x37f7a3[_0xa6bf('0x7')]?_0x37f7a3['options'][_0xa6bf('0x9')]||null:null,'order':_0x37f7a3['options']?_0x37f7a3[_0xa6bf('0x7')][_0xa6bf('0x22')]||null:null,'transaction':_0x3a5e53,'lock':_0x3a5e53['LOCK'][_0xa6bf('0x23')],'include':[{'model':db[_0xa6bf('0x1f')],'as':_0xa6bf('0x24'),'attributes':_[_0xa6bf('0x25')](_0x361632)},{'model':db[_0xa6bf('0x26')],'as':_0xa6bf('0x27'),'attributes':['id',_0xa6bf('0x28'),_0xa6bf('0x29')]}]})['then'](function(_0x4275b9){var _0x31ba27=[];var _0x471560=[];for(var _0x359c69=0x0;_0x359c69<_0x4275b9[_0xa6bf('0x2a')];_0x359c69+=0x1){var _0x10e2c2=_0x4275b9[_0x359c69][_0xa6bf('0x2b')];if(_0x10e2c2===null){_0x31ba27[_0xa6bf('0x2c')](_0x4275b9[_0x359c69]['update'](_0x37f7a3['body'],{'transaction':_0x3a5e53}));}else if(!_0x471560[_0xa6bf('0x2d')](_0x10e2c2)){_0x471560[_0xa6bf('0x2c')](_0x10e2c2);_0x31ba27['push'](_0x4275b9[_0x359c69][_0xa6bf('0x1a')](_0x37f7a3[_0xa6bf('0x2e')],{'transaction':_0x3a5e53}));}}return BPromise[_0xa6bf('0x2f')](_0x31ba27);});})['then'](function(_0x4fea4a){logger[_0xa6bf('0xf')]('GetContactDialer',_0x37f7a3);if(_0x4fea4a['length']>0x0){logger[_0xa6bf('0xf')](_0xa6bf('0x30'),_0x4fea4a[0x0][_0xa6bf('0x31')]['id'],_0x4fea4a[0x0]['dataValues'][_0xa6bf('0x32')],_0x4fea4a[0x0][_0xa6bf('0x31')][_0xa6bf('0x1c')]);}logger['debug']('GetContactDialer',_0x37f7a3,JSON[_0xa6bf('0x18')](_0x4fea4a));_0x26d8e2(_0x4fea4a);})['catch'](function(_0x31359f){logger[_0xa6bf('0x12')]('GetContactDialer',_0x31359f[_0xa6bf('0x13')],_0x37f7a3);_0x411459(_0x3f2afd['error'](0x1f4,_0x31359f[_0xa6bf('0x13')]));});});});};exports[_0xa6bf('0x33')]=function(_0x37e214){var _0x5a4e54=this;return new Promise(function(_0x358918,_0x99e13a){return db[_0xa6bf('0x21')][_0xa6bf('0x34')](function(_0x140aa9){return db['CmHopperFinal'][_0xa6bf('0x35')](_0x37e214[_0xa6bf('0x2e')],{'raw':_0x37e214['options']?_0x37e214[_0xa6bf('0x7')][_0xa6bf('0x8')]===undefined?!![]:![]:!![],'transaction':_0x140aa9})[_0xa6bf('0xe')](function(){logger[_0xa6bf('0xf')]('MoveContactManagedDialer\x20hopper\x20options\x20[%s]\x20active\x20status\x20[%s]',JSON[_0xa6bf('0x18')](_0x37e214[_0xa6bf('0x7')][_0xa6bf('0x17')]),_0x37e214[_0xa6bf('0x7')][_0xa6bf('0x17')][_0xa6bf('0x1c')]);return db[_0xa6bf('0x15')]['destroy']({'where':_0x37e214['options']?_0x37e214[_0xa6bf('0x7')][_0xa6bf('0x17')]||null:null,'transaction':_0x140aa9});});})[_0xa6bf('0xe')](function(_0x1660a0){logger[_0xa6bf('0xf')](_0xa6bf('0x33'),_0x37e214);logger[_0xa6bf('0x10')](_0xa6bf('0x33'),_0x37e214,JSON[_0xa6bf('0x18')](_0x1660a0));_0x358918(_0x1660a0);})[_0xa6bf('0x11')](function(_0x193a72){logger[_0xa6bf('0x12')](_0xa6bf('0x33'),_0x193a72[_0xa6bf('0x13')],_0x37e214);_0x99e13a(_0x5a4e54[_0xa6bf('0x12')](0x1f4,_0x193a72[_0xa6bf('0x13')]));});});};exports[_0xa6bf('0x36')]=function(_0x530e1b){var _0x187357=this;return new Promise(function(_0x3306f9,_0x38f83b){return db[_0xa6bf('0x15')]['findAll']({'raw':_0x530e1b['options']?_0x530e1b[_0xa6bf('0x7')][_0xa6bf('0x8')]===undefined?!![]:![]:!![],'where':_0x530e1b['options']?_0x530e1b[_0xa6bf('0x7')]['where']||null:null,'attributes':[[db[_0xa6bf('0x21')]['fn']('COUNT',db[_0xa6bf('0x21')]['fn']('IF',db['sequelize'][_0xa6bf('0x37')](_0xa6bf('0x38')+util[_0xa6bf('0x39')](_0xa6bf('0x3a'),moment()[_0xa6bf('0x39')](_0xa6bf('0x3b')))+_0xa6bf('0x3c')))),_0xa6bf('0x3d')]]})[_0xa6bf('0xe')](function(_0x52c91d){logger[_0xa6bf('0xf')](_0xa6bf('0x36'),_0x530e1b);logger[_0xa6bf('0x10')](_0xa6bf('0x36'),_0x530e1b,JSON['stringify'](_0x52c91d));_0x3306f9(_0x52c91d);})[_0xa6bf('0x11')](function(_0x29a507){logger[_0xa6bf('0x12')](_0xa6bf('0x36'),_0x29a507[_0xa6bf('0x13')],_0x530e1b);_0x38f83b(_0x187357[_0xa6bf('0x12')](0x1f4,_0x29a507[_0xa6bf('0x13')]));});});};exports[_0xa6bf('0x3e')]=function(_0x267d8b){var _0x53451e=this;return new Promise(function(_0x26e827,_0x4c949f){return db[_0xa6bf('0x1f')][_0xa6bf('0x20')]()['then'](function(){return db[_0xa6bf('0x21')][_0xa6bf('0x34')](function(_0x214def){return db[_0xa6bf('0x15')]['findAll']({'where':_0x267d8b[_0xa6bf('0x7')]?_0x267d8b['options']['where']||null:null,'attributes':_0x267d8b['options']?_0x267d8b['options'][_0xa6bf('0xc')]||null:null,'limit':0x1,'order':_0x267d8b[_0xa6bf('0x7')]?_0x267d8b[_0xa6bf('0x7')]['order']||null:null,'group':db[_0xa6bf('0x15')][_0xa6bf('0x2b')],'transaction':_0x214def,'lock':_0x214def[_0xa6bf('0x3f')][_0xa6bf('0x23')],'include':_0x267d8b[_0xa6bf('0x7')]?_0x267d8b[_0xa6bf('0x7')]['include']?_[_0xa6bf('0xb')](_0x267d8b['options'][_0xa6bf('0xa')],function(_0x16b3d3){return{'model':db[_0x16b3d3[_0xa6bf('0xd')]],'as':_0x16b3d3['as'],'attributes':_0x16b3d3['attributes'],'include':_0x16b3d3[_0xa6bf('0xa')]?_[_0xa6bf('0xb')](_0x16b3d3['include'],function(_0x314e9a){return{'model':db[_0x314e9a['model']],'as':_0x314e9a['as'],'attributes':_0x314e9a['attributes'],'include':_0x314e9a[_0xa6bf('0xa')]?_[_0xa6bf('0xb')](_0x314e9a[_0xa6bf('0xa')],function(_0x55f720){return{'model':db[_0x55f720[_0xa6bf('0xd')]],'as':_0x55f720['as'],'attributes':_0x55f720[_0xa6bf('0xc')]};}):[]};}):[]};}):[]:[]})[_0xa6bf('0xe')](function(_0x5ed8eb){var _0xecebb0=[];for(var _0x2c998f=0x0;_0x2c998f<_0x5ed8eb['length'];_0x2c998f+=0x1){_0xecebb0[_0xa6bf('0x2c')](_0x5ed8eb[_0x2c998f]['update'](_0x267d8b[_0xa6bf('0x2e')],{'transaction':_0x214def}));}return BPromise[_0xa6bf('0x2f')](_0xecebb0);});})[_0xa6bf('0xe')](function(_0x102134){logger[_0xa6bf('0xf')](_0xa6bf('0x3e'),_0x267d8b);logger[_0xa6bf('0x10')](_0xa6bf('0x3e'),_0x267d8b,JSON[_0xa6bf('0x18')](_0x102134));_0x26e827(_0x102134);})['catch'](function(_0x1f6cce){logger[_0xa6bf('0x12')](_0xa6bf('0x3e'),_0x1f6cce[_0xa6bf('0x13')],_0x267d8b);_0x4c949f(_0x53451e['error'](0x1f4,_0x1f6cce[_0xa6bf('0x13')]));});});});};exports[_0xa6bf('0x40')]=function(_0x2c170a){var _0x14a10b=this;return new Promise(function(_0x2c5d0e,_0x249e38){db[_0xa6bf('0x1f')][_0xa6bf('0x20')]()['then'](function(_0x2a3072){return db['CmHopper'][_0xa6bf('0x6')]({'raw':_0x2c170a[_0xa6bf('0x7')]?_0x2c170a['options'][_0xa6bf('0x8')]===undefined?!![]:![]:!![],'where':_0x2c170a['options']?_0x2c170a['options'][_0xa6bf('0x17')]||null:null,'attributes':_0x2c170a[_0xa6bf('0x7')]?_0x2c170a[_0xa6bf('0x7')][_0xa6bf('0xc')]||null:null,'limit':_0x2c170a[_0xa6bf('0x7')]?_0x2c170a[_0xa6bf('0x7')]['limit']||null:null,'include':_0x2c170a[_0xa6bf('0x7')]?_0x2c170a[_0xa6bf('0x7')][_0xa6bf('0xa')]?_[_0xa6bf('0xb')](_0x2c170a[_0xa6bf('0x7')][_0xa6bf('0xa')],function(_0x56a000){return{'model':db[_0x56a000['model']],'as':_0x56a000['as'],'attributes':_0x56a000['as']==='Contact'?_['keys'](_0x2a3072):_0x56a000[_0xa6bf('0xc')],'include':_0x56a000[_0xa6bf('0xa')]?_['map'](_0x56a000[_0xa6bf('0xa')],function(_0x52349b){return{'model':db[_0x52349b[_0xa6bf('0xd')]],'as':_0x52349b['as'],'attributes':_0x52349b[_0xa6bf('0xc')],'include':_0x52349b[_0xa6bf('0xa')]?_['map'](_0x52349b[_0xa6bf('0xa')],function(_0x420a96){return{'model':db[_0x420a96['model']],'as':_0x420a96['as'],'attributes':_0x420a96[_0xa6bf('0xc')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x381cc0){logger[_0xa6bf('0xf')]('GetCmHopper',_0x2c170a);logger[_0xa6bf('0x10')](_0xa6bf('0x5'),_0x2c170a,JSON[_0xa6bf('0x18')](_0x381cc0));_0x2c5d0e(_0x381cc0);})[_0xa6bf('0x11')](function(_0x3a5054){logger[_0xa6bf('0x12')](_0xa6bf('0x5'),_0x3a5054[_0xa6bf('0x13')],_0x2c170a);_0x249e38(_0x14a10b[_0xa6bf('0x12')](0x1f4,_0x3a5054['message']));});});});};exports[_0xa6bf('0x41')]=function(_0x449193){var _0x2d7c62=this;return new Promise(function(_0x29aadf,_0x16ca4b){return db[_0xa6bf('0x1f')]['findOne']({'raw':!![],'where':{'phone':_0x449193[_0xa6bf('0x7')][_0xa6bf('0x17')][_0xa6bf('0x42')]},'attributes':['id',_0xa6bf('0x43')],'order':[['id',_0xa6bf('0x44')]]})[_0xa6bf('0xe')](function(_0x5943b2){logger[_0xa6bf('0xf')]('getContactByPhone',_0x449193);logger[_0xa6bf('0x10')](_0xa6bf('0x45'),_0x449193,JSON['stringify'](_0x5943b2));_0x29aadf(_0x5943b2);})[_0xa6bf('0x11')](function(_0x1cab6a){logger[_0xa6bf('0x12')](_0xa6bf('0x45'),_0x1cab6a['message'],_0x449193);_0x16ca4b(_0x2d7c62[_0xa6bf('0x12')](0x1f4,_0x1cab6a[_0xa6bf('0x13')]));});});};exports[_0xa6bf('0x46')]=function(_0x103b17){var _0x46148d=this;return new Promise(function(_0x5ee116,_0x5cfb88){return db[_0xa6bf('0x21')][_0xa6bf('0x34')](function(_0x75b83b){var _0x13f0ee=_0x103b17[_0xa6bf('0x7')]&&_0x103b17['options']['where']?_0x103b17['options'][_0xa6bf('0x17')]:{};return db['CmHopper']['update'](_0x103b17['body'],{'where':_0x13f0ee,'transaction':_0x75b83b})['then'](function(_0xc4e7d){logger[_0xa6bf('0xf')](_0xa6bf('0x46'),_0x103b17);logger[_0xa6bf('0x10')](_0xa6bf('0x46'),_0x103b17,JSON[_0xa6bf('0x18')](_0xc4e7d));_0x5ee116(_0xc4e7d);})[_0xa6bf('0x11')](function(_0x1fdbf0){logger['error']('ResetActiveCalls',_0x1fdbf0['message'],_0x103b17);_0x5cfb88(_0x46148d[_0xa6bf('0x12')](0x1f4,_0x1fdbf0['message']));});});});};exports[_0xa6bf('0x47')]=function(_0x2bd5a3){var _0x296325=this;var _0x36f0fa=_0x2bd5a3['body'][_0xa6bf('0x17')][_0xa6bf('0x48')];var _0x2221b3=_0x2bd5a3[_0xa6bf('0x2e')][_0xa6bf('0x17')][_0xa6bf('0x49')];var _0x495df8=_0x2bd5a3[_0xa6bf('0x2e')][_0xa6bf('0x17')][_0xa6bf('0x4a')];return new Promise(function(_0x5b183f,_0x119b6c){return db['CmHopper']['findAll']({'where':{'voiceQueueId':{'$in':_0x36f0fa},'recallme':0x1,'active':0x0,'recallmeNotifiedDate':{'$eq':null},'scheduledat':{'$and':{'$lte':db[_0xa6bf('0x21')][_0xa6bf('0x37')](_0xa6bf('0x4b')+_0x2221b3+_0xa6bf('0x4c')),'$gt':db[_0xa6bf('0x21')]['literal'](_0xa6bf('0x4d'))}},'UserId':{'$in':_0x495df8}},'include':[{'model':db[_0xa6bf('0x1f')],'as':_0xa6bf('0x24')},{'model':db[_0xa6bf('0x26')],'as':_0xa6bf('0x27'),'attributes':['id','name',_0xa6bf('0x29')]},{'model':db['CmList'],'as':_0xa6bf('0x4e')}]})[_0xa6bf('0xe')](function(_0x4cafd5){if(_0x4cafd5[_0xa6bf('0x2a')]>0x0){return db[_0xa6bf('0x21')][_0xa6bf('0x34')](function(_0x1cf201){return db[_0xa6bf('0x15')][_0xa6bf('0x1a')]({'recallmeNotifiedDate':db[_0xa6bf('0x21')]['literal'](_0xa6bf('0x4d'))},{'where':{'id':{'$in':_['map'](_0x4cafd5,'id')}},'transaction':_0x1cf201})[_0xa6bf('0xe')](function(){_0x5b183f(_0x4cafd5);})[_0xa6bf('0x11')](function(_0x39ec20){logger[_0xa6bf('0x12')](_0xa6bf('0x47'),_0x39ec20[_0xa6bf('0x13')],_0x2bd5a3);_0x119b6c(_0x296325[_0xa6bf('0x12')](0x1f4,_0x39ec20[_0xa6bf('0x13')]));});})[_0xa6bf('0x11')](function(_0x1a8915){logger[_0xa6bf('0x12')]('CmHopperHandlePreviewRecallNotifications',_0x1a8915['message'],_0x2bd5a3);_0x119b6c(_0x296325[_0xa6bf('0x12')](0x1f4,_0x1a8915['message']));});}else{_0x5b183f(_0x4cafd5);}});});}; \ No newline at end of file diff --git a/server/api/cmHopper/index.js b/server/api/cmHopper/index.js index 6e25926..7d2567e 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 _0x4bef=['/:id/previewrecall','getPreviewRecall','post','/preview','getPreview','/timezone','getTimezone','put','delete','exports','../../components/auth/service','./cmHopper.controller','get','isAuthenticated','/describe','/opencontacts','getOpenContacts','/timezones','getTimezones','/:id','show'];(function(_0x2f81e1,_0x2c6d9b){var _0x4da558=function(_0x38b586){while(--_0x38b586){_0x2f81e1['push'](_0x2f81e1['shift']());}};_0x4da558(++_0x2c6d9b);}(_0x4bef,0x1ed));var _0xf4be=function(_0x386c3e,_0x44a375){_0x386c3e=_0x386c3e-0x0;var _0x4b8e13=_0x4bef[_0x386c3e];return _0x4b8e13;};'use strict';var express=require('express');var router=express['Router']();var auth=require(_0xf4be('0x0'));var controller=require(_0xf4be('0x1'));router[_0xf4be('0x2')]('/',auth[_0xf4be('0x3')](),controller['index']);router[_0xf4be('0x2')](_0xf4be('0x4'),auth['isAuthenticated'](),controller['describe']);router[_0xf4be('0x2')](_0xf4be('0x5'),auth['isAuthenticated'](),controller[_0xf4be('0x6')]);router[_0xf4be('0x2')](_0xf4be('0x7'),auth[_0xf4be('0x3')](),controller[_0xf4be('0x8')]);router[_0xf4be('0x2')](_0xf4be('0x9'),auth['isAuthenticated'](),controller[_0xf4be('0xa')]);router[_0xf4be('0x2')](_0xf4be('0xb'),auth[_0xf4be('0x3')](),controller[_0xf4be('0xc')]);router[_0xf4be('0xd')]('/',auth[_0xf4be('0x3')](),controller['create']);router['post'](_0xf4be('0xe'),auth[_0xf4be('0x3')](),controller[_0xf4be('0xf')]);router[_0xf4be('0xd')](_0xf4be('0x10'),auth[_0xf4be('0x3')](),controller[_0xf4be('0x11')]);router[_0xf4be('0x12')]('/:id',auth[_0xf4be('0x3')](),controller['update']);router[_0xf4be('0x13')](_0xf4be('0x9'),auth[_0xf4be('0x3')](),controller['destroy']);module[_0xf4be('0x14')]=router; \ No newline at end of file +var _0x7ed8=['describe','getOpenContacts','/timezones','getTimezones','show','/:id/previewrecall','getPreviewRecall','create','/preview','getPreview','/timezone','getTimezone','put','/:id','delete','destroy','exports','express','Router','../../components/auth/service','./cmHopper.controller','get','isAuthenticated','index'];(function(_0x2d12ca,_0x309888){var _0x305f4a=function(_0x561bb5){while(--_0x561bb5){_0x2d12ca['push'](_0x2d12ca['shift']());}};_0x305f4a(++_0x309888);}(_0x7ed8,0xb9));var _0x87ed=function(_0xe57ca3,_0x43ee97){_0xe57ca3=_0xe57ca3-0x0;var _0x38ff3c=_0x7ed8[_0xe57ca3];return _0x38ff3c;};'use strict';var express=require(_0x87ed('0x0'));var router=express[_0x87ed('0x1')]();var auth=require(_0x87ed('0x2'));var controller=require(_0x87ed('0x3'));router[_0x87ed('0x4')]('/',auth[_0x87ed('0x5')](),controller[_0x87ed('0x6')]);router[_0x87ed('0x4')]('/describe',auth['isAuthenticated'](),controller[_0x87ed('0x7')]);router['get']('/opencontacts',auth[_0x87ed('0x5')](),controller[_0x87ed('0x8')]);router[_0x87ed('0x4')](_0x87ed('0x9'),auth[_0x87ed('0x5')](),controller[_0x87ed('0xa')]);router[_0x87ed('0x4')]('/:id',auth[_0x87ed('0x5')](),controller[_0x87ed('0xb')]);router[_0x87ed('0x4')](_0x87ed('0xc'),auth[_0x87ed('0x5')](),controller[_0x87ed('0xd')]);router['post']('/',auth[_0x87ed('0x5')](),controller[_0x87ed('0xe')]);router['post'](_0x87ed('0xf'),auth[_0x87ed('0x5')](),controller[_0x87ed('0x10')]);router['post'](_0x87ed('0x11'),auth[_0x87ed('0x5')](),controller[_0x87ed('0x12')]);router[_0x87ed('0x13')](_0x87ed('0x14'),auth[_0x87ed('0x5')](),controller['update']);router[_0x87ed('0x15')](_0x87ed('0x14'),auth[_0x87ed('0x5')](),controller[_0x87ed('0x16')]);module[_0x87ed('0x17')]=router; \ No newline at end of file diff --git a/server/api/cmHopperAdditionalPhone/cmHopperAdditionalPhone.attributes.js b/server/api/cmHopperAdditionalPhone/cmHopperAdditionalPhone.attributes.js index 6c24ea8..50a8edd 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 _0x6219=['exports','INTEGER','STRING','DATE','format','YYYY-MM-DD\x20HH:mm:ss','moment','sequelize'];(function(_0x1e694f,_0x380ef6){var _0xba5174=function(_0x343344){while(--_0x343344){_0x1e694f['push'](_0x1e694f['shift']());}};_0xba5174(++_0x380ef6);}(_0x6219,0xf6));var _0x9621=function(_0x591cfd,_0x501204){_0x591cfd=_0x591cfd-0x0;var _0x4d0100=_0x6219[_0x591cfd];return _0x4d0100;};'use strict';var moment=require(_0x9621('0x0'));var Sequelize=require(_0x9621('0x1'));module[_0x9621('0x2')]={'CmHopperId':{'type':Sequelize[_0x9621('0x3')]},'phone':{'type':Sequelize[_0x9621('0x4')],'allowNull':![]},'OrderBy':{'type':Sequelize[_0x9621('0x3')],'defaultValue':0x0},'scheduledat':{'type':Sequelize[_0x9621('0x5')],'defaultValue':moment()[_0x9621('0x6')](_0x9621('0x7'))},'countbusyretry':{'type':Sequelize[_0x9621('0x3')],'defaultValue':0x0},'countcongestionretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countnoanswerretry':{'type':Sequelize[_0x9621('0x3')],'defaultValue':0x0},'countnosuchnumberretry':{'type':Sequelize[_0x9621('0x3')],'defaultValue':0x0},'countdropretry':{'type':Sequelize[_0x9621('0x3')],'defaultValue':0x0},'countabandonedretry':{'type':Sequelize[_0x9621('0x3')],'defaultValue':0x0},'countmachineretry':{'type':Sequelize[_0x9621('0x3')],'defaultValue':0x0},'countagentrejectretry':{'type':Sequelize[_0x9621('0x3')],'defaultValue':0x0}}; \ No newline at end of file +var _0x1220=['exports','INTEGER','DATE','format','YYYY-MM-DD\x20HH:mm:ss','moment'];(function(_0xf31593,_0x3da036){var _0x4bd676=function(_0x382615){while(--_0x382615){_0xf31593['push'](_0xf31593['shift']());}};_0x4bd676(++_0x3da036);}(_0x1220,0x149));var _0x0122=function(_0x422905,_0x3bce3a){_0x422905=_0x422905-0x0;var _0x33dc6c=_0x1220[_0x422905];return _0x33dc6c;};'use strict';var moment=require(_0x0122('0x0'));var Sequelize=require('sequelize');module[_0x0122('0x1')]={'CmHopperId':{'type':Sequelize[_0x0122('0x2')]},'phone':{'type':Sequelize['STRING'],'allowNull':![]},'OrderBy':{'type':Sequelize[_0x0122('0x2')],'defaultValue':0x0},'scheduledat':{'type':Sequelize[_0x0122('0x3')],'defaultValue':moment()[_0x0122('0x4')](_0x0122('0x5'))},'countbusyretry':{'type':Sequelize[_0x0122('0x2')],'defaultValue':0x0},'countcongestionretry':{'type':Sequelize[_0x0122('0x2')],'defaultValue':0x0},'countnoanswerretry':{'type':Sequelize[_0x0122('0x2')],'defaultValue':0x0},'countnosuchnumberretry':{'type':Sequelize[_0x0122('0x2')],'defaultValue':0x0},'countdropretry':{'type':Sequelize[_0x0122('0x2')],'defaultValue':0x0},'countabandonedretry':{'type':Sequelize[_0x0122('0x2')],'defaultValue':0x0},'countmachineretry':{'type':Sequelize[_0x0122('0x2')],'defaultValue':0x0},'countagentrejectretry':{'type':Sequelize[_0x0122('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 f81f570..d6687a0 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 _0xa7a5=['CmHopperAdditionalPhones','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','find','eml-format','rimraf','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','desk.js','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','sendStatus','end','status','json','undefined','offset','count','limit','set','Content-Range','reject','save','then','destroy','get','UserProfileResource','stack','name','send','map','CmHopperAdditionalPhone','rawAttributes','fieldName','query','keys','filters','intersection','model','fields','attributes','order','sort','where','pick','filter','merge','type','VIRTUAL','options','includeAll','include','rows','show','params','length','catch','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role'];(function(_0x30a0b7,_0x3698d9){var _0x1d8e00=function(_0xd8696a){while(--_0xd8696a){_0x30a0b7['push'](_0x30a0b7['shift']());}};_0x1d8e00(++_0x3698d9);}(_0xa7a5,0xa7));var _0x5a7a=function(_0x35658f,_0x341ad5){_0x35658f=_0x35658f-0x0;var _0xfd59b3=_0xa7a5[_0x35658f];return _0xfd59b3;};'use strict';var emlformat=require(_0x5a7a('0x0'));var rimraf=require(_0x5a7a('0x1'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x5a7a('0x2'));var moment=require(_0x5a7a('0x3'));var BPromise=require(_0x5a7a('0x4'));var Mustache=require(_0x5a7a('0x5'));var util=require(_0x5a7a('0x6'));var path=require(_0x5a7a('0x7'));var sox=require(_0x5a7a('0x8'));var csv=require(_0x5a7a('0x9'));var ejs=require(_0x5a7a('0xa'));var fs=require('fs');var fs_extra=require(_0x5a7a('0xb'));var _=require(_0x5a7a('0xc'));var squel=require(_0x5a7a('0xd'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x5a7a('0xe'));var toCsv=require(_0x5a7a('0x9'));var querystring=require('querystring');var Papa=require(_0x5a7a('0xf'));var Redis=require('ioredis');var authService=require(_0x5a7a('0x10'));var qs=require(_0x5a7a('0x11'));var as=require(_0x5a7a('0x12'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x5a7a('0x13'))(_0x5a7a('0x14'));var utils=require(_0x5a7a('0x15'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x59a302,_0xe84e5f){_0xe84e5f=_0xe84e5f||0xcc;return function(_0x58e865){if(_0x58e865){return _0x59a302[_0x5a7a('0x16')](_0xe84e5f);}return _0x59a302['status'](_0xe84e5f)[_0x5a7a('0x17')]();};}function respondWithResult(_0x327c36,_0x13c1b3){_0x13c1b3=_0x13c1b3||0xc8;return function(_0x5de1cd){if(_0x5de1cd){return _0x327c36[_0x5a7a('0x18')](_0x13c1b3)[_0x5a7a('0x19')](_0x5de1cd);}};}function respondWithFilteredResult(_0x4c65e8,_0x402380){return function(_0x37f738){if(_0x37f738){var _0x1661ee=typeof _0x402380['offset']===_0x5a7a('0x1a')&&typeof _0x402380['limit']===_0x5a7a('0x1a');var _0x21f96d=_0x37f738['count'];var _0x16c24a=_0x1661ee?0x0:_0x402380[_0x5a7a('0x1b')];var _0x3a0746=_0x1661ee?_0x37f738[_0x5a7a('0x1c')]:_0x402380[_0x5a7a('0x1b')]+_0x402380[_0x5a7a('0x1d')];var _0x2378d8;if(_0x3a0746>=_0x21f96d){_0x3a0746=_0x21f96d;_0x2378d8=0xc8;}else{_0x2378d8=0xce;}_0x4c65e8[_0x5a7a('0x18')](_0x2378d8);return _0x4c65e8[_0x5a7a('0x1e')](_0x5a7a('0x1f'),_0x16c24a+'-'+_0x3a0746+'/'+_0x21f96d)[_0x5a7a('0x19')](_0x37f738);}return null;};}function patchUpdates(_0x2c9193){return function(_0x24f9d9){try{jsonpatch['apply'](_0x24f9d9,_0x2c9193,!![]);}catch(_0x56ae0a){return BPromise[_0x5a7a('0x20')](_0x56ae0a);}return _0x24f9d9[_0x5a7a('0x21')]();};}function saveUpdates(_0x489ae3,_0x5cc067){return function(_0x203144){if(_0x203144){return _0x203144['update'](_0x489ae3)[_0x5a7a('0x22')](function(_0x4d50d3){return _0x4d50d3;});}return null;};}function removeEntity(_0x2db7b2,_0xfbcca8){return function(_0x142c2f){if(_0x142c2f){return _0x142c2f[_0x5a7a('0x23')]()['then'](function(){var _0x26c4b1=_0x142c2f[_0x5a7a('0x24')]({'plain':!![]});var _0x5affb5='CmHopperAdditionalPhones';return db[_0x5a7a('0x25')][_0x5a7a('0x23')]({'where':{'type':_0x5affb5,'resourceId':_0x26c4b1['id']}})[_0x5a7a('0x22')](function(){return _0x142c2f;});})['then'](function(){_0x2db7b2[_0x5a7a('0x18')](0xcc)[_0x5a7a('0x17')]();});}};}function handleEntityNotFound(_0x2b13c4,_0x3602b2){return function(_0x42e3fe){if(!_0x42e3fe){_0x2b13c4[_0x5a7a('0x16')](0x194);}return _0x42e3fe;};}function handleError(_0x590272,_0x496b0b){_0x496b0b=_0x496b0b||0x1f4;return function(_0x55cb88){logger['error'](_0x55cb88[_0x5a7a('0x26')]);if(_0x55cb88[_0x5a7a('0x27')]){delete _0x55cb88[_0x5a7a('0x27')];}_0x590272[_0x5a7a('0x18')](_0x496b0b)[_0x5a7a('0x28')](_0x55cb88);};}exports['index']=function(_0x10d57,_0x26ad64){var _0x8b0854={},_0x5d3305={},_0x5efffc={'count':0x0,'rows':[]};var _0x5d577f=_[_0x5a7a('0x29')](db[_0x5a7a('0x2a')][_0x5a7a('0x2b')],function(_0xb4462a){return{'name':_0xb4462a[_0x5a7a('0x2c')],'type':_0xb4462a['type']['key']};});_0x5d3305['model']=_[_0x5a7a('0x29')](_0x5d577f,_0x5a7a('0x27'));_0x5d3305[_0x5a7a('0x2d')]=_[_0x5a7a('0x2e')](_0x10d57['query']);_0x5d3305[_0x5a7a('0x2f')]=_[_0x5a7a('0x30')](_0x5d3305[_0x5a7a('0x31')],_0x5d3305[_0x5a7a('0x2d')]);_0x8b0854['attributes']=_[_0x5a7a('0x30')](_0x5d3305['model'],qs['fields'](_0x10d57['query'][_0x5a7a('0x32')]));_0x8b0854['attributes']=_0x8b0854[_0x5a7a('0x33')]['length']?_0x8b0854[_0x5a7a('0x33')]:_0x5d3305[_0x5a7a('0x31')];if(!_0x10d57[_0x5a7a('0x2d')]['hasOwnProperty']('nolimit')){_0x8b0854[_0x5a7a('0x1d')]=qs['limit'](_0x10d57['query'][_0x5a7a('0x1d')]);_0x8b0854[_0x5a7a('0x1b')]=qs[_0x5a7a('0x1b')](_0x10d57[_0x5a7a('0x2d')][_0x5a7a('0x1b')]);}_0x8b0854[_0x5a7a('0x34')]=qs[_0x5a7a('0x35')](_0x10d57['query'][_0x5a7a('0x35')]);_0x8b0854[_0x5a7a('0x36')]=qs[_0x5a7a('0x2f')](_[_0x5a7a('0x37')](_0x10d57[_0x5a7a('0x2d')],_0x5d3305[_0x5a7a('0x2f')]),_0x5d577f);if(_0x10d57['query'][_0x5a7a('0x38')]){_0x8b0854[_0x5a7a('0x36')]=_[_0x5a7a('0x39')](_0x8b0854[_0x5a7a('0x36')],{'$or':_[_0x5a7a('0x29')](_0x5d577f,function(_0x15a866){if(_0x15a866[_0x5a7a('0x3a')]!==_0x5a7a('0x3b')){var _0x4dea86={};_0x4dea86[_0x15a866[_0x5a7a('0x27')]]={'$like':'%'+_0x10d57[_0x5a7a('0x2d')][_0x5a7a('0x38')]+'%'};return _0x4dea86;}})});}_0x8b0854=_[_0x5a7a('0x39')]({},_0x8b0854,_0x10d57[_0x5a7a('0x3c')]);var _0x4f964d={'where':_0x8b0854[_0x5a7a('0x36')]};return db[_0x5a7a('0x2a')][_0x5a7a('0x1c')](_0x4f964d)[_0x5a7a('0x22')](function(_0x3f21ab){_0x5efffc[_0x5a7a('0x1c')]=_0x3f21ab;if(_0x10d57[_0x5a7a('0x2d')][_0x5a7a('0x3d')]){_0x8b0854[_0x5a7a('0x3e')]=[{'all':!![]}];}return db['CmHopperAdditionalPhone']['findAll'](_0x8b0854);})[_0x5a7a('0x22')](function(_0x4d7307){_0x5efffc[_0x5a7a('0x3f')]=_0x4d7307;return _0x5efffc;})[_0x5a7a('0x22')](respondWithFilteredResult(_0x26ad64,_0x8b0854))['catch'](handleError(_0x26ad64,null));};exports[_0x5a7a('0x40')]=function(_0x5f4cbe,_0x2b599d){var _0x27814b={'raw':!![],'where':{'id':_0x5f4cbe[_0x5a7a('0x41')]['id']}},_0x49af6d={};_0x49af6d[_0x5a7a('0x31')]=_[_0x5a7a('0x2e')](db[_0x5a7a('0x2a')][_0x5a7a('0x2b')]);_0x49af6d[_0x5a7a('0x2d')]=_['keys'](_0x5f4cbe['query']);_0x49af6d[_0x5a7a('0x2f')]=_['intersection'](_0x49af6d[_0x5a7a('0x31')],_0x49af6d[_0x5a7a('0x2d')]);_0x27814b[_0x5a7a('0x33')]=_['intersection'](_0x49af6d[_0x5a7a('0x31')],qs[_0x5a7a('0x32')](_0x5f4cbe[_0x5a7a('0x2d')][_0x5a7a('0x32')]));_0x27814b['attributes']=_0x27814b[_0x5a7a('0x33')][_0x5a7a('0x42')]?_0x27814b['attributes']:_0x49af6d[_0x5a7a('0x31')];if(_0x5f4cbe['query'][_0x5a7a('0x3d')]){_0x27814b[_0x5a7a('0x3e')]=[{'all':!![]}];}_0x27814b=_[_0x5a7a('0x39')]({},_0x27814b,_0x5f4cbe[_0x5a7a('0x3c')]);return db[_0x5a7a('0x2a')]['find'](_0x27814b)[_0x5a7a('0x22')](handleEntityNotFound(_0x2b599d,null))['then'](respondWithResult(_0x2b599d,null))[_0x5a7a('0x43')](handleError(_0x2b599d,null));};exports[_0x5a7a('0x44')]=function(_0x4c1dac,_0x42a5ea){return db[_0x5a7a('0x2a')][_0x5a7a('0x44')](_0x4c1dac[_0x5a7a('0x45')],{})[_0x5a7a('0x22')](function(_0x158c3f){var _0xff82c9=_0x4c1dac[_0x5a7a('0x46')][_0x5a7a('0x24')]({'plain':!![]});if(!_0xff82c9)throw new Error(_0x5a7a('0x47'));if(_0xff82c9[_0x5a7a('0x48')]===_0x5a7a('0x46')){var _0x575bf8=_0x158c3f[_0x5a7a('0x24')]({'plain':!![]});var _0x21580c=_0x5a7a('0x49');return db[_0x5a7a('0x4a')]['find']({'where':{'name':_0x21580c,'userProfileId':_0xff82c9[_0x5a7a('0x4b')]},'raw':!![]})[_0x5a7a('0x22')](function(_0x5ae12f){if(_0x5ae12f&&_0x5ae12f[_0x5a7a('0x4c')]===0x0){return db['UserProfileResource']['create']({'name':_0x575bf8[_0x5a7a('0x27')],'resourceId':_0x575bf8['id'],'type':_0x5ae12f[_0x5a7a('0x27')],'sectionId':_0x5ae12f['id']},{})[_0x5a7a('0x22')](function(){return _0x158c3f;});}else{return _0x158c3f;}})[_0x5a7a('0x43')](function(_0x253a6e){logger['error'](_0x5a7a('0x4d'),_0x253a6e);throw _0x253a6e;});}return _0x158c3f;})[_0x5a7a('0x22')](respondWithResult(_0x42a5ea,0xc9))[_0x5a7a('0x43')](handleError(_0x42a5ea,null));};exports[_0x5a7a('0x4e')]=function(_0x227d3f,_0x57d5ec){if(_0x227d3f['body']['id']){delete _0x227d3f[_0x5a7a('0x45')]['id'];}return db[_0x5a7a('0x2a')][_0x5a7a('0x4f')]({'where':{'id':_0x227d3f[_0x5a7a('0x41')]['id']}})['then'](handleEntityNotFound(_0x57d5ec,null))[_0x5a7a('0x22')](saveUpdates(_0x227d3f[_0x5a7a('0x45')],null))[_0x5a7a('0x22')](respondWithResult(_0x57d5ec,null))['catch'](handleError(_0x57d5ec,null));};exports['destroy']=function(_0x22a0ca,_0x1e8517){return db[_0x5a7a('0x2a')][_0x5a7a('0x4f')]({'where':{'id':_0x22a0ca['params']['id']}})['then'](handleEntityNotFound(_0x1e8517,null))[_0x5a7a('0x22')](removeEntity(_0x1e8517,null))['catch'](handleError(_0x1e8517,null));}; \ No newline at end of file +var _0x7a6d=['user','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','params','eml-format','rimraf','zip-dir','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','../../config/logger','api','../../config/environment','../../config/license/util','sendStatus','status','end','json','offset','undefined','limit','count','set','reject','save','update','then','CmHopperAdditionalPhones','UserProfileResource','destroy','error','name','index','map','CmHopperAdditionalPhone','rawAttributes','type','key','model','query','keys','filters','intersection','attributes','fields','nolimit','sort','where','pick','filter','merge','options','include','findAll','rows','catch','show','length','includeAll','find','create','body'];(function(_0x1ff4d8,_0x5c60d5){var _0x53e286=function(_0x288310){while(--_0x288310){_0x1ff4d8['push'](_0x1ff4d8['shift']());}};_0x53e286(++_0x5c60d5);}(_0x7a6d,0x155));var _0xd7a6=function(_0x45d1fd,_0x463212){_0x45d1fd=_0x45d1fd-0x0;var _0xd0e542=_0x7a6d[_0x45d1fd];return _0xd0e542;};'use strict';var emlformat=require(_0xd7a6('0x0'));var rimraf=require(_0xd7a6('0x1'));var zipdir=require(_0xd7a6('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0xd7a6('0x3'));var moment=require(_0xd7a6('0x4'));var BPromise=require(_0xd7a6('0x5'));var Mustache=require(_0xd7a6('0x6'));var util=require(_0xd7a6('0x7'));var path=require(_0xd7a6('0x8'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0xd7a6('0x9'));var fs=require('fs');var fs_extra=require(_0xd7a6('0xa'));var _=require(_0xd7a6('0xb'));var squel=require(_0xd7a6('0xc'));var crypto=require(_0xd7a6('0xd'));var jsforce=require(_0xd7a6('0xe'));var deskjs=require(_0xd7a6('0xf'));var toCsv=require(_0xd7a6('0x10'));var querystring=require(_0xd7a6('0x11'));var Papa=require(_0xd7a6('0x12'));var Redis=require(_0xd7a6('0x13'));var authService=require(_0xd7a6('0x14'));var qs=require(_0xd7a6('0x15'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0xd7a6('0x16'))(_0xd7a6('0x17'));var utils=require('../../config/utils');var config=require(_0xd7a6('0x18'));var licenseUtil=require(_0xd7a6('0x19'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x56effe,_0x90b30f){_0x90b30f=_0x90b30f||0xcc;return function(_0x2b499c){if(_0x2b499c){return _0x56effe[_0xd7a6('0x1a')](_0x90b30f);}return _0x56effe[_0xd7a6('0x1b')](_0x90b30f)[_0xd7a6('0x1c')]();};}function respondWithResult(_0x24f5c4,_0x58ec20){_0x58ec20=_0x58ec20||0xc8;return function(_0x3cd848){if(_0x3cd848){return _0x24f5c4[_0xd7a6('0x1b')](_0x58ec20)[_0xd7a6('0x1d')](_0x3cd848);}};}function respondWithFilteredResult(_0x340bdb,_0x570cab){return function(_0x303434){if(_0x303434){var _0x33e2e1=typeof _0x570cab[_0xd7a6('0x1e')]===_0xd7a6('0x1f')&&typeof _0x570cab[_0xd7a6('0x20')]===_0xd7a6('0x1f');var _0x56fc09=_0x303434['count'];var _0x24fe5f=_0x33e2e1?0x0:_0x570cab[_0xd7a6('0x1e')];var _0x3deacb=_0x33e2e1?_0x303434[_0xd7a6('0x21')]:_0x570cab[_0xd7a6('0x1e')]+_0x570cab[_0xd7a6('0x20')];var _0x5eb944;if(_0x3deacb>=_0x56fc09){_0x3deacb=_0x56fc09;_0x5eb944=0xc8;}else{_0x5eb944=0xce;}_0x340bdb['status'](_0x5eb944);return _0x340bdb[_0xd7a6('0x22')]('Content-Range',_0x24fe5f+'-'+_0x3deacb+'/'+_0x56fc09)['json'](_0x303434);}return null;};}function patchUpdates(_0x671d0f){return function(_0x5907fe){try{jsonpatch['apply'](_0x5907fe,_0x671d0f,!![]);}catch(_0x1e0472){return BPromise[_0xd7a6('0x23')](_0x1e0472);}return _0x5907fe[_0xd7a6('0x24')]();};}function saveUpdates(_0x58b350,_0x11f580){return function(_0x207593){if(_0x207593){return _0x207593[_0xd7a6('0x25')](_0x58b350)['then'](function(_0x2db84f){return _0x2db84f;});}return null;};}function removeEntity(_0x1cad99,_0x586b76){return function(_0x235d72){if(_0x235d72){return _0x235d72['destroy']()[_0xd7a6('0x26')](function(){var _0x46c769=_0x235d72['get']({'plain':!![]});var _0x2131de=_0xd7a6('0x27');return db[_0xd7a6('0x28')][_0xd7a6('0x29')]({'where':{'type':_0x2131de,'resourceId':_0x46c769['id']}})[_0xd7a6('0x26')](function(){return _0x235d72;});})[_0xd7a6('0x26')](function(){_0x1cad99[_0xd7a6('0x1b')](0xcc)['end']();});}};}function handleEntityNotFound(_0x3f8347,_0xab3c4c){return function(_0x325a6c){if(!_0x325a6c){_0x3f8347[_0xd7a6('0x1a')](0x194);}return _0x325a6c;};}function handleError(_0x1f8c55,_0x54843f){_0x54843f=_0x54843f||0x1f4;return function(_0x206e9a){logger[_0xd7a6('0x2a')](_0x206e9a['stack']);if(_0x206e9a[_0xd7a6('0x2b')]){delete _0x206e9a['name'];}_0x1f8c55[_0xd7a6('0x1b')](_0x54843f)['send'](_0x206e9a);};}exports[_0xd7a6('0x2c')]=function(_0x2115f9,_0xc55e32){var _0x3a79f5={},_0x35fbb1={},_0x1baf6b={'count':0x0,'rows':[]};var _0x5bba18=_[_0xd7a6('0x2d')](db[_0xd7a6('0x2e')][_0xd7a6('0x2f')],function(_0x1bb6f4){return{'name':_0x1bb6f4['fieldName'],'type':_0x1bb6f4[_0xd7a6('0x30')][_0xd7a6('0x31')]};});_0x35fbb1[_0xd7a6('0x32')]=_['map'](_0x5bba18,'name');_0x35fbb1[_0xd7a6('0x33')]=_[_0xd7a6('0x34')](_0x2115f9[_0xd7a6('0x33')]);_0x35fbb1[_0xd7a6('0x35')]=_[_0xd7a6('0x36')](_0x35fbb1[_0xd7a6('0x32')],_0x35fbb1['query']);_0x3a79f5[_0xd7a6('0x37')]=_[_0xd7a6('0x36')](_0x35fbb1[_0xd7a6('0x32')],qs[_0xd7a6('0x38')](_0x2115f9[_0xd7a6('0x33')]['fields']));_0x3a79f5[_0xd7a6('0x37')]=_0x3a79f5[_0xd7a6('0x37')]['length']?_0x3a79f5[_0xd7a6('0x37')]:_0x35fbb1['model'];if(!_0x2115f9['query']['hasOwnProperty'](_0xd7a6('0x39'))){_0x3a79f5[_0xd7a6('0x20')]=qs[_0xd7a6('0x20')](_0x2115f9[_0xd7a6('0x33')][_0xd7a6('0x20')]);_0x3a79f5[_0xd7a6('0x1e')]=qs[_0xd7a6('0x1e')](_0x2115f9[_0xd7a6('0x33')]['offset']);}_0x3a79f5['order']=qs['sort'](_0x2115f9[_0xd7a6('0x33')][_0xd7a6('0x3a')]);_0x3a79f5[_0xd7a6('0x3b')]=qs[_0xd7a6('0x35')](_[_0xd7a6('0x3c')](_0x2115f9[_0xd7a6('0x33')],_0x35fbb1['filters']),_0x5bba18);if(_0x2115f9[_0xd7a6('0x33')][_0xd7a6('0x3d')]){_0x3a79f5[_0xd7a6('0x3b')]=_[_0xd7a6('0x3e')](_0x3a79f5['where'],{'$or':_[_0xd7a6('0x2d')](_0x5bba18,function(_0x5f48ec){if(_0x5f48ec[_0xd7a6('0x30')]!=='VIRTUAL'){var _0x26d289={};_0x26d289[_0x5f48ec[_0xd7a6('0x2b')]]={'$like':'%'+_0x2115f9[_0xd7a6('0x33')][_0xd7a6('0x3d')]+'%'};return _0x26d289;}})});}_0x3a79f5=_[_0xd7a6('0x3e')]({},_0x3a79f5,_0x2115f9[_0xd7a6('0x3f')]);var _0x2d85cd={'where':_0x3a79f5['where']};return db[_0xd7a6('0x2e')][_0xd7a6('0x21')](_0x2d85cd)[_0xd7a6('0x26')](function(_0x355a7a){_0x1baf6b[_0xd7a6('0x21')]=_0x355a7a;if(_0x2115f9['query']['includeAll']){_0x3a79f5[_0xd7a6('0x40')]=[{'all':!![]}];}return db[_0xd7a6('0x2e')][_0xd7a6('0x41')](_0x3a79f5);})[_0xd7a6('0x26')](function(_0x1f4178){_0x1baf6b[_0xd7a6('0x42')]=_0x1f4178;return _0x1baf6b;})[_0xd7a6('0x26')](respondWithFilteredResult(_0xc55e32,_0x3a79f5))[_0xd7a6('0x43')](handleError(_0xc55e32,null));};exports[_0xd7a6('0x44')]=function(_0x42376b,_0x3bf7af){var _0x40fc0e={'raw':!![],'where':{'id':_0x42376b['params']['id']}},_0x43694f={};_0x43694f[_0xd7a6('0x32')]=_[_0xd7a6('0x34')](db[_0xd7a6('0x2e')]['rawAttributes']);_0x43694f[_0xd7a6('0x33')]=_[_0xd7a6('0x34')](_0x42376b['query']);_0x43694f[_0xd7a6('0x35')]=_[_0xd7a6('0x36')](_0x43694f[_0xd7a6('0x32')],_0x43694f['query']);_0x40fc0e['attributes']=_['intersection'](_0x43694f[_0xd7a6('0x32')],qs['fields'](_0x42376b['query'][_0xd7a6('0x38')]));_0x40fc0e[_0xd7a6('0x37')]=_0x40fc0e[_0xd7a6('0x37')][_0xd7a6('0x45')]?_0x40fc0e[_0xd7a6('0x37')]:_0x43694f['model'];if(_0x42376b['query'][_0xd7a6('0x46')]){_0x40fc0e[_0xd7a6('0x40')]=[{'all':!![]}];}_0x40fc0e=_[_0xd7a6('0x3e')]({},_0x40fc0e,_0x42376b[_0xd7a6('0x3f')]);return db[_0xd7a6('0x2e')][_0xd7a6('0x47')](_0x40fc0e)[_0xd7a6('0x26')](handleEntityNotFound(_0x3bf7af,null))[_0xd7a6('0x26')](respondWithResult(_0x3bf7af,null))[_0xd7a6('0x43')](handleError(_0x3bf7af,null));};exports['create']=function(_0x214f7f,_0xbffe1e){return db[_0xd7a6('0x2e')][_0xd7a6('0x48')](_0x214f7f[_0xd7a6('0x49')],{})[_0xd7a6('0x26')](function(_0x361c36){var _0x329c37=_0x214f7f[_0xd7a6('0x4a')][_0xd7a6('0x4b')]({'plain':!![]});if(!_0x329c37)throw new Error(_0xd7a6('0x4c'));if(_0x329c37[_0xd7a6('0x4d')]===_0xd7a6('0x4a')){var _0x446dfa=_0x361c36[_0xd7a6('0x4b')]({'plain':!![]});var _0x43124c=_0xd7a6('0x27');return db[_0xd7a6('0x4e')]['find']({'where':{'name':_0x43124c,'userProfileId':_0x329c37[_0xd7a6('0x4f')]},'raw':!![]})['then'](function(_0x58f92b){if(_0x58f92b&&_0x58f92b[_0xd7a6('0x50')]===0x0){return db[_0xd7a6('0x28')][_0xd7a6('0x48')]({'name':_0x446dfa[_0xd7a6('0x2b')],'resourceId':_0x446dfa['id'],'type':_0x58f92b[_0xd7a6('0x2b')],'sectionId':_0x58f92b['id']},{})[_0xd7a6('0x26')](function(){return _0x361c36;});}else{return _0x361c36;}})[_0xd7a6('0x43')](function(_0x26391c){logger['error'](_0xd7a6('0x51'),_0x26391c);throw _0x26391c;});}return _0x361c36;})[_0xd7a6('0x26')](respondWithResult(_0xbffe1e,0xc9))[_0xd7a6('0x43')](handleError(_0xbffe1e,null));};exports['update']=function(_0x12f41b,_0x51c36d){if(_0x12f41b['body']['id']){delete _0x12f41b[_0xd7a6('0x49')]['id'];}return db[_0xd7a6('0x2e')][_0xd7a6('0x47')]({'where':{'id':_0x12f41b[_0xd7a6('0x52')]['id']}})[_0xd7a6('0x26')](handleEntityNotFound(_0x51c36d,null))[_0xd7a6('0x26')](saveUpdates(_0x12f41b[_0xd7a6('0x49')],null))[_0xd7a6('0x26')](respondWithResult(_0x51c36d,null))[_0xd7a6('0x43')](handleError(_0x51c36d,null));};exports[_0xd7a6('0x29')]=function(_0x27e16a,_0x1ca094){return db[_0xd7a6('0x2e')]['find']({'where':{'id':_0x27e16a['params']['id']}})[_0xd7a6('0x26')](handleEntityNotFound(_0x1ca094,null))[_0xd7a6('0x26')](removeEntity(_0x1ca094,null))[_0xd7a6('0x43')](handleError(_0x1ca094,null));}; \ No newline at end of file diff --git a/server/api/cmHopperAdditionalPhone/cmHopperAdditionalPhone.model.js b/server/api/cmHopperAdditionalPhone/cmHopperAdditionalPhone.model.js index b12a714..bfea9b3 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 _0x6b5d=['bluebird','request-promise','path','rimraf','../../config/environment','./cmHopperAdditionalPhone.attributes','exports','CmHopperAdditionalPhone','lodash','util','../../config/logger','api'];(function(_0x16adf1,_0x1273a5){var _0xc13362=function(_0x35e767){while(--_0x35e767){_0x16adf1['push'](_0x16adf1['shift']());}};_0xc13362(++_0x1273a5);}(_0x6b5d,0xd4));var _0xd6b5=function(_0x584a6f,_0x308da5){_0x584a6f=_0x584a6f-0x0;var _0x17e3d1=_0x6b5d[_0x584a6f];return _0x17e3d1;};'use strict';var _=require(_0xd6b5('0x0'));var util=require(_0xd6b5('0x1'));var logger=require(_0xd6b5('0x2'))(_0xd6b5('0x3'));var moment=require('moment');var BPromise=require(_0xd6b5('0x4'));var rp=require(_0xd6b5('0x5'));var fs=require('fs');var path=require(_0xd6b5('0x6'));var rimraf=require(_0xd6b5('0x7'));var config=require(_0xd6b5('0x8'));var attributes=require(_0xd6b5('0x9'));module[_0xd6b5('0xa')]=function(_0x5bd530,_0x288321){return _0x5bd530['define'](_0xd6b5('0xb'),attributes,{'tableName':'cm_hopper_additional_phones','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x569f=['./cmHopperAdditionalPhone.attributes','exports','define','CmHopperAdditionalPhone','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment'];(function(_0x3612a5,_0x57f342){var _0x47017d=function(_0x1fb6c8){while(--_0x1fb6c8){_0x3612a5['push'](_0x3612a5['shift']());}};_0x47017d(++_0x57f342);}(_0x569f,0xf2));var _0xf569=function(_0x5ef296,_0x27c9d7){_0x5ef296=_0x5ef296-0x0;var _0x1bf8c0=_0x569f[_0x5ef296];return _0x1bf8c0;};'use strict';var _=require(_0xf569('0x0'));var util=require(_0xf569('0x1'));var logger=require(_0xf569('0x2'))(_0xf569('0x3'));var moment=require(_0xf569('0x4'));var BPromise=require(_0xf569('0x5'));var rp=require(_0xf569('0x6'));var fs=require('fs');var path=require(_0xf569('0x7'));var rimraf=require(_0xf569('0x8'));var config=require(_0xf569('0x9'));var attributes=require(_0xf569('0xa'));module[_0xf569('0xb')]=function(_0x39a889,_0x55a07d){return _0x39a889[_0xf569('0xc')](_0xf569('0xd'),attributes,{'tableName':'cm_hopper_additional_phones','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/cmHopperAdditionalPhone/cmHopperAdditionalPhone.rpc.js b/server/api/cmHopperAdditionalPhone/cmHopperAdditionalPhone.rpc.js index 703cd2b..068342f 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 _0x10c7=['client','http','request','info','CmHopperAdditionalPhone,\x20%s,\x20%s','request\x20sent','CmHopperAdditionalPhone,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','VerifyAdditionalPhones','CmHopper','findOne','body','ContactId','ListId','VoiceQueueId','CampaignId','then','OrderBy','countbusyretry','countcongestionretry','countnoanswerretry','countnosuchnumberretry','countdropretry','countabandonedretry','countmachineretry','ASC','dialGlobalMaxRetry','catch','SwapAdditionalPhones','CmHopperAdditionalPhone','waitTime','duration','isNil','scheduledat','add','minutes','countagentrejectretry','createdAt','updatedAt','phone','sequelize','update','IncrementPreviewCounters','field','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','jayson/promise'];(function(_0xb61568,_0x13b716){var _0x58b607=function(_0x4b6052){while(--_0x4b6052){_0xb61568['push'](_0xb61568['shift']());}};_0x58b607(++_0x13b716);}(_0x10c7,0xd8));var _0x710c=function(_0x2d3145,_0x2e57e3){_0x2d3145=_0x2d3145-0x0;var _0x1d0d68=_0x10c7[_0x2d3145];return _0x1d0d68;};'use strict';var _=require('lodash');var util=require(_0x710c('0x0'));var moment=require(_0x710c('0x1'));var BPromise=require('bluebird');var rs=require(_0x710c('0x2'));var fs=require('fs');var Redis=require(_0x710c('0x3'));var db=require(_0x710c('0x4'))['db'];var utils=require(_0x710c('0x5'));var logger=require(_0x710c('0x6'))('rpc');var config=require('../../config/environment');var jayson=require(_0x710c('0x7'));var client=jayson[_0x710c('0x8')][_0x710c('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x463dd2,_0x2b472c,_0x4cfed5){return new BPromise(function(_0x3cc066,_0x12569d){return client[_0x710c('0xa')](_0x463dd2,_0x4cfed5)['then'](function(_0x2634f3){logger[_0x710c('0xb')](_0x710c('0xc'),_0x2b472c,_0x710c('0xd'));logger['debug'](_0x710c('0xe'),_0x2b472c,'request\x20sent',JSON[_0x710c('0xf')](_0x2634f3));if(_0x2634f3[_0x710c('0x10')]){if(_0x2634f3[_0x710c('0x10')][_0x710c('0x11')]===0x1f4){logger[_0x710c('0x10')](_0x710c('0xc'),_0x2b472c,_0x2634f3['error'][_0x710c('0x12')]);return _0x12569d(_0x2634f3[_0x710c('0x10')]['message']);}logger[_0x710c('0x10')](_0x710c('0xc'),_0x2b472c,_0x2634f3[_0x710c('0x10')][_0x710c('0x12')]);return _0x3cc066(_0x2634f3['error'][_0x710c('0x12')]);}else{logger['info']('CmHopperAdditionalPhone,\x20%s,\x20%s',_0x2b472c,_0x710c('0xd'));_0x3cc066(_0x2634f3[_0x710c('0x13')]['message']);}})['catch'](function(_0x609c1b){logger[_0x710c('0x10')](_0x710c('0xc'),_0x2b472c,_0x609c1b);_0x12569d(_0x609c1b);});});}exports[_0x710c('0x14')]=function(_0x3fbdb3){var _0x31ff08=this;return new Promise(function(_0x3d0bc5,_0x215a1d){return db[_0x710c('0x15')][_0x710c('0x16')]({'raw':!![],'where':{'ContactId':_0x3fbdb3[_0x710c('0x17')][_0x710c('0x18')],'ListId':_0x3fbdb3['body'][_0x710c('0x19')],'VoiceQueueId':_0x3fbdb3[_0x710c('0x17')][_0x710c('0x1a')]===undefined?null:_0x3fbdb3[_0x710c('0x17')][_0x710c('0x1a')],'CampaignId':_0x3fbdb3[_0x710c('0x17')][_0x710c('0x1b')]===undefined?null:_0x3fbdb3[_0x710c('0x17')][_0x710c('0x1b')]}})[_0x710c('0x1c')](function(_0x20744d){if(_0x20744d!=null){return db['CmHopperAdditionalPhone'][_0x710c('0x16')]({'raw':!![],'where':{'CmHopperId':_0x20744d['id'],'OrderBy':{'$gt':_0x20744d[_0x710c('0x1d')]}},'order':[['OrderBy','ASC']]})['then'](function(_0xa2dacd){var _0x3ee68d=0x0;if(_0xa2dacd){if(_0xa2dacd[_0x710c('0x1e')]+_0xa2dacd[_0x710c('0x1f')]+_0xa2dacd[_0x710c('0x20')]+_0xa2dacd[_0x710c('0x21')]+_0xa2dacd[_0x710c('0x22')]+_0xa2dacd[_0x710c('0x23')]+_0xa2dacd[_0x710c('0x24')]+_0xa2dacd['countagentrejectretry']<_0x3fbdb3['entity']['dialGlobalMaxRetry'])_0x3ee68d=0x1;_0x3d0bc5({'additional':_0x3ee68d});}else{return db['CmHopperAdditionalPhone'][_0x710c('0x16')]({'raw':!![],'where':{'CmHopperId':_0x20744d['id']},'order':[[_0x710c('0x1d'),_0x710c('0x25')]]})[_0x710c('0x1c')](function(_0x1976ad){var _0x27ee96=0x0;if(_0x1976ad){if(_0x1976ad['countbusyretry']+_0x1976ad[_0x710c('0x1f')]+_0x1976ad[_0x710c('0x20')]+_0x1976ad[_0x710c('0x21')]+_0x1976ad[_0x710c('0x22')]+_0x1976ad[_0x710c('0x23')]+_0x1976ad[_0x710c('0x24')]+_0x1976ad['countagentrejectretry']<_0x3fbdb3['entity'][_0x710c('0x26')])_0x27ee96=0x1;_0x3d0bc5({'additional':_0x27ee96});}else{_0x3d0bc5({'additional':0x0});}})[_0x710c('0x27')](function(_0x529ec5){logger[_0x710c('0x10')](_0x710c('0x14'),_0x529ec5[_0x710c('0x12')]);_0x215a1d(_0x31ff08[_0x710c('0x10')](0x1f4,_0x529ec5['message']));});}})[_0x710c('0x27')](function(_0x1a51e1){logger[_0x710c('0x10')](_0x710c('0x14'),_0x1a51e1['message']);_0x215a1d(_0x31ff08[_0x710c('0x10')](0x1f4,_0x1a51e1['message']));});}else _0x3d0bc5({'additional':0x0});});});};exports[_0x710c('0x28')]=function(_0x196c3e){var _0x2145a3=this;return new Promise(function(_0x228f17,_0x409ae4){return db[_0x710c('0x15')]['findOne']({'raw':!![],'where':{'ContactId':_0x196c3e[_0x710c('0x17')]['ContactId'],'ListId':_0x196c3e[_0x710c('0x17')][_0x710c('0x19')],'VoiceQueueId':_0x196c3e[_0x710c('0x17')][_0x710c('0x1a')]===undefined?null:_0x196c3e[_0x710c('0x17')]['VoiceQueueId'],'CampaignId':_0x196c3e[_0x710c('0x17')][_0x710c('0x1b')]===undefined?null:_0x196c3e['body'][_0x710c('0x1b')]}})[_0x710c('0x1c')](function(_0x29a0ff){if(_0x29a0ff!=null){return db[_0x710c('0x29')][_0x710c('0x16')]({'raw':!![],'where':{'CmHopperId':_0x29a0ff['id'],'OrderBy':{'$gte':_0x29a0ff[_0x710c('0x1d')]}},'order':[[_0x710c('0x1d'),_0x710c('0x25')]]})[_0x710c('0x1c')](function(_0x3533c4){if(_0x3533c4)return activateAdditionalPhone(_0x29a0ff,_0x196c3e['body'],_0x3533c4,_0x196c3e['duration'],_0x196c3e[_0x710c('0x2a')])[_0x710c('0x1c')](function(_0x5bc409){_0x228f17(_0x5bc409);});else{return db['CmHopperAdditionalPhone'][_0x710c('0x16')]({'raw':!![],'where':{'CmHopperId':_0x29a0ff['id']},'order':[[_0x710c('0x1d'),_0x710c('0x25')]]})[_0x710c('0x1c')](function(_0x29f658){if(_0x29f658)return activateAdditionalPhone(_0x29a0ff,_0x196c3e[_0x710c('0x17')],_0x29f658,_0x196c3e[_0x710c('0x2b')],_0x196c3e[_0x710c('0x2a')])[_0x710c('0x1c')](function(_0x4e7b02){_0x228f17(_0x4e7b02);});else{_0x228f17({'id':_0x29a0ff['id'],'phone':''});}})[_0x710c('0x27')](function(_0x4632ab){logger['error'](_0x710c('0x14'),_0x4632ab[_0x710c('0x12')]);_0x409ae4(_0x2145a3[_0x710c('0x10')](0x1f4,_0x4632ab[_0x710c('0x12')]));});}})[_0x710c('0x27')](function(_0x427487){logger[_0x710c('0x10')]('VerifyAdditionalPhones',_0x427487[_0x710c('0x12')]);_0x409ae4(_0x2145a3[_0x710c('0x10')](0x1f4,_0x427487['message']));});}else _0x228f17(0x1);});});};function activateAdditionalPhone(_0x3b3532,_0x1bc850,_0x5d8cac,_0xc3fb52,_0x4ce1cd){return new Promise(function(_0x17c8df,_0x4d2226){var _0x3d71f9;if(_[_0x710c('0x2c')](_0x5d8cac[_0x710c('0x2d')])){_0x5d8cac[_0x710c('0x2d')]=moment();}if(moment()>moment(_0x5d8cac['scheduledat'])){_0x3d71f9=moment()[_0x710c('0x2e')](_0x4ce1cd||0x3,'minutes');}else{if(_0x5d8cac[_0x710c('0x1d')]==0x0){_0x3d71f9=moment(_0x5d8cac[_0x710c('0x2d')]);}else{_0x3d71f9=moment()[_0x710c('0x2e')](_0x4ce1cd||0x3,_0x710c('0x2f'));}}if(_[_0x710c('0x2c')](_0x3d71f9)){_0x3d71f9=moment()[_0x710c('0x2e')](_0x4ce1cd||0x3,_0x710c('0x2f'));}var _0x40ece2={'phone':_0x3b3532['phone'],'active':0x0,'OrderBy':_[_0x710c('0x2c')](_0x3b3532[_0x710c('0x1d')])?0x0:_0x3b3532[_0x710c('0x1d')],'scheduledat':moment()['add'](_0xc3fb52||0x1,'minutes'),'countbusyretry':_0x1bc850['countbusyretry'],'countcongestionretry':_0x1bc850[_0x710c('0x1f')],'countnoanswerretry':_0x1bc850[_0x710c('0x20')],'countnosuchnumberretry':_0x1bc850[_0x710c('0x21')],'countdropretry':_0x1bc850[_0x710c('0x22')],'countabandonedretry':_0x1bc850[_0x710c('0x23')],'countmachineretry':_0x1bc850['countmachineretry'],'countagentrejectretry':_0x1bc850[_0x710c('0x30')],'createdAt':_0x1bc850[_0x710c('0x31')],'updatedAt':_0x1bc850[_0x710c('0x32')]};var _0x1fdffc={'CmHopperId':_0x3b3532['id'],'phone':_0x5d8cac[_0x710c('0x33')],'active':0x0,'OrderBy':_['isNil'](_0x5d8cac['OrderBy'])?0x0:_0x5d8cac[_0x710c('0x1d')],'scheduledat':_0x3d71f9,'countbusyretry':_0x5d8cac[_0x710c('0x1e')],'countcongestionretry':_0x5d8cac['countcongestionretry'],'countnoanswerretry':_0x5d8cac[_0x710c('0x20')],'countnosuchnumberretry':_0x5d8cac[_0x710c('0x21')],'countdropretry':_0x5d8cac[_0x710c('0x22')],'countabandonedretry':_0x5d8cac[_0x710c('0x23')],'countmachineretry':_0x5d8cac[_0x710c('0x24')],'countagentrejectretry':_0x5d8cac[_0x710c('0x30')],'createdAt':_0x5d8cac[_0x710c('0x31')],'updatedAt':_0x5d8cac[_0x710c('0x32')]};return db[_0x710c('0x34')]['transaction'](function(_0x3bcc24){return db[_0x710c('0x29')][_0x710c('0x35')](_0x40ece2,{'where':{'id':_0x5d8cac['id']}},{'transaction':_0x3bcc24})[_0x710c('0x1c')](function(){return db['CmHopper'][_0x710c('0x35')](_0x1fdffc,{'where':{'id':_0x3b3532['id']}},{'transaction':_0x3bcc24});});})['then'](function(_0x548e11){_0x17c8df({'id':_0x3b3532['id'],'phone':_0x5d8cac[_0x710c('0x33')]});})[_0x710c('0x27')](function(_0x43ce2a){logger[_0x710c('0x10')]('activateAdditionalPhone',_0x43ce2a['message']);_0x4d2226({'error':_0x43ce2a[_0x710c('0x12')]});});});}exports[_0x710c('0x36')]=function(_0x4941a7){var _0x4c216d=this;return new Promise(function(_0x204984,_0x477b2e){return db[_0x710c('0x15')][_0x710c('0x35')](_0x4941a7[_0x710c('0x17')][_0x710c('0x37')],{'where':{'id':_0x4941a7[_0x710c('0x17')]['id']}})[_0x710c('0x1c')](function(_0x153cbb){_0x204984(_0x153cbb);})[_0x710c('0x27')](function(_0x1277be){logger[_0x710c('0x10')]('IncrementPreviewCounters',_0x1277be[_0x710c('0x12')]);_0x477b2e(_0x4c216d[_0x710c('0x10')](0x1f4,_0x1277be[_0x710c('0x12')]));});});}; \ No newline at end of file +var _0xcea5=['jayson/promise','request','info','CmHopperAdditionalPhone,\x20%s,\x20%s','request\x20sent','debug','CmHopperAdditionalPhone,\x20%s,\x20%s,\x20%s','error','message','findOne','body','ContactId','ListId','VoiceQueueId','CampaignId','CmHopperAdditionalPhone','OrderBy','then','countbusyretry','countnoanswerretry','countnosuchnumberretry','countdropretry','countabandonedretry','countmachineretry','countagentrejectretry','dialGlobalMaxRetry','ASC','countcongestionretry','entity','catch','VerifyAdditionalPhones','SwapAdditionalPhones','CmHopper','waitTime','duration','isNil','scheduledat','add','minutes','phone','createdAt','updatedAt','sequelize','transaction','update','IncrementPreviewCounters','field','lodash','moment','randomstring','../../mysqldb','../../config/utils','../../config/logger','../../config/environment'];(function(_0x565096,_0x4352f8){var _0x246b92=function(_0x5b52d1){while(--_0x5b52d1){_0x565096['push'](_0x565096['shift']());}};_0x246b92(++_0x4352f8);}(_0xcea5,0x1a9));var _0x5cea=function(_0x280b43,_0x2a4960){_0x280b43=_0x280b43-0x0;var _0x376c1c=_0xcea5[_0x280b43];return _0x376c1c;};'use strict';var _=require(_0x5cea('0x0'));var util=require('util');var moment=require(_0x5cea('0x1'));var BPromise=require('bluebird');var rs=require(_0x5cea('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x5cea('0x3'))['db'];var utils=require(_0x5cea('0x4'));var logger=require(_0x5cea('0x5'))('rpc');var config=require(_0x5cea('0x6'));var jayson=require(_0x5cea('0x7'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x44b156,_0x2d8d6a,_0x19d73f){return new BPromise(function(_0x57f80e,_0x5e83ff){return client[_0x5cea('0x8')](_0x44b156,_0x19d73f)['then'](function(_0x5c3e17){logger[_0x5cea('0x9')](_0x5cea('0xa'),_0x2d8d6a,_0x5cea('0xb'));logger[_0x5cea('0xc')](_0x5cea('0xd'),_0x2d8d6a,_0x5cea('0xb'),JSON['stringify'](_0x5c3e17));if(_0x5c3e17[_0x5cea('0xe')]){if(_0x5c3e17[_0x5cea('0xe')]['code']===0x1f4){logger[_0x5cea('0xe')](_0x5cea('0xa'),_0x2d8d6a,_0x5c3e17['error'][_0x5cea('0xf')]);return _0x5e83ff(_0x5c3e17[_0x5cea('0xe')][_0x5cea('0xf')]);}logger[_0x5cea('0xe')](_0x5cea('0xa'),_0x2d8d6a,_0x5c3e17[_0x5cea('0xe')][_0x5cea('0xf')]);return _0x57f80e(_0x5c3e17[_0x5cea('0xe')][_0x5cea('0xf')]);}else{logger[_0x5cea('0x9')](_0x5cea('0xa'),_0x2d8d6a,_0x5cea('0xb'));_0x57f80e(_0x5c3e17['result']['message']);}})['catch'](function(_0x4a0be6){logger[_0x5cea('0xe')](_0x5cea('0xa'),_0x2d8d6a,_0x4a0be6);_0x5e83ff(_0x4a0be6);});});}exports['VerifyAdditionalPhones']=function(_0x32ac32){var _0x1575c9=this;return new Promise(function(_0x5f3bcf,_0x228a1f){return db['CmHopper'][_0x5cea('0x10')]({'raw':!![],'where':{'ContactId':_0x32ac32[_0x5cea('0x11')][_0x5cea('0x12')],'ListId':_0x32ac32[_0x5cea('0x11')][_0x5cea('0x13')],'VoiceQueueId':_0x32ac32['body'][_0x5cea('0x14')]===undefined?null:_0x32ac32[_0x5cea('0x11')][_0x5cea('0x14')],'CampaignId':_0x32ac32[_0x5cea('0x11')]['CampaignId']===undefined?null:_0x32ac32[_0x5cea('0x11')][_0x5cea('0x15')]}})['then'](function(_0x4cf0ff){if(_0x4cf0ff!=null){return db[_0x5cea('0x16')]['findOne']({'raw':!![],'where':{'CmHopperId':_0x4cf0ff['id'],'OrderBy':{'$gt':_0x4cf0ff['OrderBy']}},'order':[[_0x5cea('0x17'),'ASC']]})[_0x5cea('0x18')](function(_0x313b60){var _0x47f4f3=0x0;if(_0x313b60){if(_0x313b60[_0x5cea('0x19')]+_0x313b60['countcongestionretry']+_0x313b60[_0x5cea('0x1a')]+_0x313b60[_0x5cea('0x1b')]+_0x313b60[_0x5cea('0x1c')]+_0x313b60[_0x5cea('0x1d')]+_0x313b60[_0x5cea('0x1e')]+_0x313b60[_0x5cea('0x1f')]<_0x32ac32['entity'][_0x5cea('0x20')])_0x47f4f3=0x1;_0x5f3bcf({'additional':_0x47f4f3});}else{return db['CmHopperAdditionalPhone'][_0x5cea('0x10')]({'raw':!![],'where':{'CmHopperId':_0x4cf0ff['id']},'order':[[_0x5cea('0x17'),_0x5cea('0x21')]]})[_0x5cea('0x18')](function(_0x906cb0){var _0x5f0720=0x0;if(_0x906cb0){if(_0x906cb0[_0x5cea('0x19')]+_0x906cb0[_0x5cea('0x22')]+_0x906cb0[_0x5cea('0x1a')]+_0x906cb0[_0x5cea('0x1b')]+_0x906cb0[_0x5cea('0x1c')]+_0x906cb0['countabandonedretry']+_0x906cb0[_0x5cea('0x1e')]+_0x906cb0[_0x5cea('0x1f')]<_0x32ac32[_0x5cea('0x23')][_0x5cea('0x20')])_0x5f0720=0x1;_0x5f3bcf({'additional':_0x5f0720});}else{_0x5f3bcf({'additional':0x0});}})[_0x5cea('0x24')](function(_0xef8c35){logger[_0x5cea('0xe')](_0x5cea('0x25'),_0xef8c35[_0x5cea('0xf')]);_0x228a1f(_0x1575c9[_0x5cea('0xe')](0x1f4,_0xef8c35[_0x5cea('0xf')]));});}})[_0x5cea('0x24')](function(_0x5e0b19){logger[_0x5cea('0xe')](_0x5cea('0x25'),_0x5e0b19[_0x5cea('0xf')]);_0x228a1f(_0x1575c9['error'](0x1f4,_0x5e0b19[_0x5cea('0xf')]));});}else _0x5f3bcf({'additional':0x0});});});};exports[_0x5cea('0x26')]=function(_0x2b77dd){var _0x58e8c2=this;return new Promise(function(_0x9586d8,_0x1be2b4){return db[_0x5cea('0x27')][_0x5cea('0x10')]({'raw':!![],'where':{'ContactId':_0x2b77dd['body'][_0x5cea('0x12')],'ListId':_0x2b77dd[_0x5cea('0x11')][_0x5cea('0x13')],'VoiceQueueId':_0x2b77dd[_0x5cea('0x11')][_0x5cea('0x14')]===undefined?null:_0x2b77dd['body'][_0x5cea('0x14')],'CampaignId':_0x2b77dd[_0x5cea('0x11')][_0x5cea('0x15')]===undefined?null:_0x2b77dd[_0x5cea('0x11')][_0x5cea('0x15')]}})['then'](function(_0x3dec3a){if(_0x3dec3a!=null){return db[_0x5cea('0x16')]['findOne']({'raw':!![],'where':{'CmHopperId':_0x3dec3a['id'],'OrderBy':{'$gte':_0x3dec3a[_0x5cea('0x17')]}},'order':[[_0x5cea('0x17'),_0x5cea('0x21')]]})[_0x5cea('0x18')](function(_0x3aad4b){if(_0x3aad4b)return activateAdditionalPhone(_0x3dec3a,_0x2b77dd[_0x5cea('0x11')],_0x3aad4b,_0x2b77dd['duration'],_0x2b77dd[_0x5cea('0x28')])['then'](function(_0x3e1f26){_0x9586d8(_0x3e1f26);});else{return db[_0x5cea('0x16')][_0x5cea('0x10')]({'raw':!![],'where':{'CmHopperId':_0x3dec3a['id']},'order':[[_0x5cea('0x17'),_0x5cea('0x21')]]})['then'](function(_0x14a903){if(_0x14a903)return activateAdditionalPhone(_0x3dec3a,_0x2b77dd[_0x5cea('0x11')],_0x14a903,_0x2b77dd[_0x5cea('0x29')],_0x2b77dd[_0x5cea('0x28')])[_0x5cea('0x18')](function(_0x2d7f0a){_0x9586d8(_0x2d7f0a);});else{_0x9586d8({'id':_0x3dec3a['id'],'phone':''});}})['catch'](function(_0x59e60c){logger[_0x5cea('0xe')](_0x5cea('0x25'),_0x59e60c[_0x5cea('0xf')]);_0x1be2b4(_0x58e8c2[_0x5cea('0xe')](0x1f4,_0x59e60c[_0x5cea('0xf')]));});}})[_0x5cea('0x24')](function(_0x4cb986){logger[_0x5cea('0xe')]('VerifyAdditionalPhones',_0x4cb986[_0x5cea('0xf')]);_0x1be2b4(_0x58e8c2[_0x5cea('0xe')](0x1f4,_0x4cb986['message']));});}else _0x9586d8(0x1);});});};function activateAdditionalPhone(_0x33e1aa,_0x108957,_0x4d644c,_0x3a734a,_0xc88d1e){return new Promise(function(_0x168cae,_0x15cf7b){var _0x148048;if(_[_0x5cea('0x2a')](_0x4d644c['scheduledat'])){_0x4d644c[_0x5cea('0x2b')]=moment();}if(moment()>moment(_0x4d644c[_0x5cea('0x2b')])){_0x148048=moment()[_0x5cea('0x2c')](_0xc88d1e||0x3,_0x5cea('0x2d'));}else{if(_0x4d644c[_0x5cea('0x17')]==0x0){_0x148048=moment(_0x4d644c[_0x5cea('0x2b')]);}else{_0x148048=moment()[_0x5cea('0x2c')](_0xc88d1e||0x3,_0x5cea('0x2d'));}}if(_[_0x5cea('0x2a')](_0x148048)){_0x148048=moment()[_0x5cea('0x2c')](_0xc88d1e||0x3,_0x5cea('0x2d'));}var _0x437315={'phone':_0x33e1aa[_0x5cea('0x2e')],'active':0x0,'OrderBy':_[_0x5cea('0x2a')](_0x33e1aa['OrderBy'])?0x0:_0x33e1aa[_0x5cea('0x17')],'scheduledat':moment()['add'](_0x3a734a||0x1,_0x5cea('0x2d')),'countbusyretry':_0x108957[_0x5cea('0x19')],'countcongestionretry':_0x108957['countcongestionretry'],'countnoanswerretry':_0x108957[_0x5cea('0x1a')],'countnosuchnumberretry':_0x108957[_0x5cea('0x1b')],'countdropretry':_0x108957[_0x5cea('0x1c')],'countabandonedretry':_0x108957[_0x5cea('0x1d')],'countmachineretry':_0x108957['countmachineretry'],'countagentrejectretry':_0x108957['countagentrejectretry'],'createdAt':_0x108957[_0x5cea('0x2f')],'updatedAt':_0x108957[_0x5cea('0x30')]};var _0x802f01={'CmHopperId':_0x33e1aa['id'],'phone':_0x4d644c['phone'],'active':0x0,'OrderBy':_[_0x5cea('0x2a')](_0x4d644c[_0x5cea('0x17')])?0x0:_0x4d644c[_0x5cea('0x17')],'scheduledat':_0x148048,'countbusyretry':_0x4d644c['countbusyretry'],'countcongestionretry':_0x4d644c[_0x5cea('0x22')],'countnoanswerretry':_0x4d644c[_0x5cea('0x1a')],'countnosuchnumberretry':_0x4d644c['countnosuchnumberretry'],'countdropretry':_0x4d644c[_0x5cea('0x1c')],'countabandonedretry':_0x4d644c['countabandonedretry'],'countmachineretry':_0x4d644c[_0x5cea('0x1e')],'countagentrejectretry':_0x4d644c[_0x5cea('0x1f')],'createdAt':_0x4d644c[_0x5cea('0x2f')],'updatedAt':_0x4d644c[_0x5cea('0x30')]};return db[_0x5cea('0x31')][_0x5cea('0x32')](function(_0x2ead09){return db[_0x5cea('0x16')][_0x5cea('0x33')](_0x437315,{'where':{'id':_0x4d644c['id']}},{'transaction':_0x2ead09})['then'](function(){return db[_0x5cea('0x27')][_0x5cea('0x33')](_0x802f01,{'where':{'id':_0x33e1aa['id']}},{'transaction':_0x2ead09});});})[_0x5cea('0x18')](function(_0x270acf){_0x168cae({'id':_0x33e1aa['id'],'phone':_0x4d644c['phone']});})['catch'](function(_0x5cc4ac){logger['error']('activateAdditionalPhone',_0x5cc4ac[_0x5cea('0xf')]);_0x15cf7b({'error':_0x5cc4ac[_0x5cea('0xf')]});});});}exports[_0x5cea('0x34')]=function(_0x1bef27){var _0x27d61f=this;return new Promise(function(_0x286172,_0xda89e2){return db[_0x5cea('0x27')][_0x5cea('0x33')](_0x1bef27['body'][_0x5cea('0x35')],{'where':{'id':_0x1bef27['body']['id']}})[_0x5cea('0x18')](function(_0x2d55dc){_0x286172(_0x2d55dc);})['catch'](function(_0x1efcee){logger['error']('IncrementPreviewCounters',_0x1efcee[_0x5cea('0xf')]);_0xda89e2(_0x27d61f['error'](0x1f4,_0x1efcee[_0x5cea('0xf')]));});});}; \ No newline at end of file diff --git a/server/api/cmHopperAdditionalPhone/index.js b/server/api/cmHopperAdditionalPhone/index.js index 2f865c0..0ccfaf8 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 _0xc021=['express','Router','fs-extra','../../components/interaction/service','./cmHopperAdditionalPhone.controller','get','isAuthenticated','index','/:id','show','post','create','update','destroy','exports','multer','util','path'];(function(_0x3c8819,_0x5c9166){var _0x30d5cb=function(_0x10db30){while(--_0x10db30){_0x3c8819['push'](_0x3c8819['shift']());}};_0x30d5cb(++_0x5c9166);}(_0xc021,0x19b));var _0x1c02=function(_0x435e16,_0x5d3519){_0x435e16=_0x435e16-0x0;var _0x3629ef=_0xc021[_0x435e16];return _0x3629ef;};'use strict';var multer=require(_0x1c02('0x0'));var util=require(_0x1c02('0x1'));var path=require(_0x1c02('0x2'));var timeout=require('connect-timeout');var express=require(_0x1c02('0x3'));var router=express[_0x1c02('0x4')]();var fs_extra=require(_0x1c02('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0x1c02('0x6'));var config=require('../../config/environment');var controller=require(_0x1c02('0x7'));router[_0x1c02('0x8')]('/',auth[_0x1c02('0x9')](),controller[_0x1c02('0xa')]);router[_0x1c02('0x8')](_0x1c02('0xb'),auth[_0x1c02('0x9')](),controller[_0x1c02('0xc')]);router[_0x1c02('0xd')]('/',auth['isAuthenticated'](),controller[_0x1c02('0xe')]);router['put'](_0x1c02('0xb'),auth[_0x1c02('0x9')](),controller[_0x1c02('0xf')]);router['delete']('/:id',auth[_0x1c02('0x9')](),controller[_0x1c02('0x10')]);module[_0x1c02('0x11')]=router; \ No newline at end of file +var _0xcb1f=['/:id','update','delete','destroy','exports','multer','util','path','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./cmHopperAdditionalPhone.controller','get','isAuthenticated','index','create'];(function(_0x575652,_0x2f6298){var _0x4f31a1=function(_0x4c974d){while(--_0x4c974d){_0x575652['push'](_0x575652['shift']());}};_0x4f31a1(++_0x2f6298);}(_0xcb1f,0x135));var _0xfcb1=function(_0x2b14a7,_0x5d1593){_0x2b14a7=_0x2b14a7-0x0;var _0x378ef0=_0xcb1f[_0x2b14a7];return _0x378ef0;};'use strict';var multer=require(_0xfcb1('0x0'));var util=require(_0xfcb1('0x1'));var path=require(_0xfcb1('0x2'));var timeout=require(_0xfcb1('0x3'));var express=require(_0xfcb1('0x4'));var router=express['Router']();var fs_extra=require(_0xfcb1('0x5'));var auth=require(_0xfcb1('0x6'));var interaction=require(_0xfcb1('0x7'));var config=require(_0xfcb1('0x8'));var controller=require(_0xfcb1('0x9'));router[_0xfcb1('0xa')]('/',auth[_0xfcb1('0xb')](),controller[_0xfcb1('0xc')]);router[_0xfcb1('0xa')]('/:id',auth[_0xfcb1('0xb')](),controller['show']);router['post']('/',auth['isAuthenticated'](),controller[_0xfcb1('0xd')]);router['put'](_0xfcb1('0xe'),auth['isAuthenticated'](),controller[_0xfcb1('0xf')]);router[_0xfcb1('0x10')]('/:id',auth[_0xfcb1('0xb')](),controller[_0xfcb1('0x11')]);module[_0xfcb1('0x12')]=router; \ No newline at end of file diff --git a/server/api/cmHopperBlack/cmHopperBlack.attributes.js b/server/api/cmHopperBlack/cmHopperBlack.attributes.js index 26d046e..92797de 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 _0xc57c=['INTEGER','contactListQueue','moment'];(function(_0x3efc92,_0x49a75b){var _0x152e9d=function(_0x2c7f59){while(--_0x2c7f59){_0x3efc92['push'](_0x3efc92['shift']());}};_0x152e9d(++_0x49a75b);}(_0xc57c,0x149));var _0xcc57=function(_0xf61f53,_0x3f1d7e){_0xf61f53=_0xf61f53-0x0;var _0x50abce=_0xc57c[_0xf61f53];return _0x50abce;};'use strict';var moment=require(_0xcc57('0x0'));var Sequelize=require('sequelize');module['exports']={'phone':{'type':Sequelize['STRING'],'allowNull':![]},'ContactId':{'type':Sequelize[_0xcc57('0x1')],'unique':'contactListQueue'},'ListId':{'type':Sequelize['INTEGER'],'unique':_0xcc57('0x2')},'VoiceQueueId':{'type':Sequelize['INTEGER'],'unique':_0xcc57('0x2')}}; \ No newline at end of file +var _0xe57d=['moment','exports','STRING','INTEGER','contactListQueue'];(function(_0x46a085,_0x33fa72){var _0x57d64f=function(_0x2f6b4e){while(--_0x2f6b4e){_0x46a085['push'](_0x46a085['shift']());}};_0x57d64f(++_0x33fa72);}(_0xe57d,0xd7));var _0xde57=function(_0x485feb,_0x4687f9){_0x485feb=_0x485feb-0x0;var _0x3013fd=_0xe57d[_0x485feb];return _0x3013fd;};'use strict';var moment=require(_0xde57('0x0'));var Sequelize=require('sequelize');module[_0xde57('0x1')]={'phone':{'type':Sequelize[_0xde57('0x2')],'allowNull':![]},'ContactId':{'type':Sequelize['INTEGER'],'unique':'contactListQueue'},'ListId':{'type':Sequelize[_0xde57('0x3')],'unique':_0xde57('0x4')},'VoiceQueueId':{'type':Sequelize[_0xde57('0x3')],'unique':'contactListQueue'}}; \ No newline at end of file diff --git a/server/api/cmHopperBlack/cmHopperBlack.controller.js b/server/api/cmHopperBlack/cmHopperBlack.controller.js index b39b915..694f0d0 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 _0x30cd=['jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','api','../../config/utils','../../config/license/util','status','json','offset','undefined','limit','count','set','Content-Range','apply','reject','update','then','error','stack','name','send','map','CmHopperBlack','fieldName','type','model','query','keys','intersection','attributes','fields','nolimit','order','sort','where','filters','pick','filter','VIRTUAL','options','includeAll','show','params','rawAttributes','length','include','find','catch','body','destroy','describe','eml-format','rimraf','zip-dir','request-promise','moment','mustache','util','path','sox','to-csv','ejs','fs-extra','squel','crypto'];(function(_0x32792d,_0x2f0aae){var _0x4e09aa=function(_0x133f75){while(--_0x133f75){_0x32792d['push'](_0x32792d['shift']());}};_0x4e09aa(++_0x2f0aae);}(_0x30cd,0x1e3));var _0xd30c=function(_0x1c4fcf,_0x5f0319){_0x1c4fcf=_0x1c4fcf-0x0;var _0x3777fc=_0x30cd[_0x1c4fcf];return _0x3777fc;};'use strict';var emlformat=require(_0xd30c('0x0'));var rimraf=require(_0xd30c('0x1'));var zipdir=require(_0xd30c('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0xd30c('0x3'));var moment=require(_0xd30c('0x4'));var BPromise=require('bluebird');var Mustache=require(_0xd30c('0x5'));var util=require(_0xd30c('0x6'));var path=require(_0xd30c('0x7'));var sox=require(_0xd30c('0x8'));var csv=require(_0xd30c('0x9'));var ejs=require(_0xd30c('0xa'));var fs=require('fs');var fs_extra=require(_0xd30c('0xb'));var _=require('lodash');var squel=require(_0xd30c('0xc'));var crypto=require(_0xd30c('0xd'));var jsforce=require(_0xd30c('0xe'));var deskjs=require(_0xd30c('0xf'));var toCsv=require(_0xd30c('0x9'));var querystring=require(_0xd30c('0x10'));var Papa=require(_0xd30c('0x11'));var Redis=require(_0xd30c('0x12'));var authService=require(_0xd30c('0x13'));var qs=require(_0xd30c('0x14'));var as=require(_0xd30c('0x15'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0xd30c('0x16'));var utils=require(_0xd30c('0x17'));var config=require('../../config/environment');var licenseUtil=require(_0xd30c('0x18'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x587a58,_0x10d180){_0x10d180=_0x10d180||0xcc;return function(_0x856153){if(_0x856153){return _0x587a58['sendStatus'](_0x10d180);}return _0x587a58[_0xd30c('0x19')](_0x10d180)['end']();};}function respondWithResult(_0x2d4deb,_0x5bec31){_0x5bec31=_0x5bec31||0xc8;return function(_0x2d7c20){if(_0x2d7c20){return _0x2d4deb[_0xd30c('0x19')](_0x5bec31)[_0xd30c('0x1a')](_0x2d7c20);}};}function respondWithFilteredResult(_0x2e626a,_0x146a94){return function(_0x1526c1){if(_0x1526c1){var _0x30be7d=typeof _0x146a94[_0xd30c('0x1b')]===_0xd30c('0x1c')&&typeof _0x146a94[_0xd30c('0x1d')]===_0xd30c('0x1c');var _0x2021b7=_0x1526c1['count'];var _0x1237de=_0x30be7d?0x0:_0x146a94[_0xd30c('0x1b')];var _0x329906=_0x30be7d?_0x1526c1[_0xd30c('0x1e')]:_0x146a94[_0xd30c('0x1b')]+_0x146a94[_0xd30c('0x1d')];var _0xe5d98f;if(_0x329906>=_0x2021b7){_0x329906=_0x2021b7;_0xe5d98f=0xc8;}else{_0xe5d98f=0xce;}_0x2e626a['status'](_0xe5d98f);return _0x2e626a[_0xd30c('0x1f')](_0xd30c('0x20'),_0x1237de+'-'+_0x329906+'/'+_0x2021b7)['json'](_0x1526c1);}return null;};}function patchUpdates(_0x2b7571){return function(_0x235eb3){try{jsonpatch[_0xd30c('0x21')](_0x235eb3,_0x2b7571,!![]);}catch(_0x5325a8){return BPromise[_0xd30c('0x22')](_0x5325a8);}return _0x235eb3['save']();};}function saveUpdates(_0x88ecb5,_0x1636b4){return function(_0x42b493){if(_0x42b493){return _0x42b493[_0xd30c('0x23')](_0x88ecb5)[_0xd30c('0x24')](function(_0x48aab3){return _0x48aab3;});}return null;};}function removeEntity(_0x58e3a3,_0x2d4fc4){return function(_0x1630da){if(_0x1630da){return _0x1630da['destroy']()[_0xd30c('0x24')](function(){_0x58e3a3['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x1a41b9,_0x41f010){return function(_0x3e1f51){if(!_0x3e1f51){_0x1a41b9['sendStatus'](0x194);}return _0x3e1f51;};}function handleError(_0x3119c8,_0x57d933){_0x57d933=_0x57d933||0x1f4;return function(_0x4fc802){logger[_0xd30c('0x25')](_0x4fc802[_0xd30c('0x26')]);if(_0x4fc802[_0xd30c('0x27')]){delete _0x4fc802[_0xd30c('0x27')];}_0x3119c8['status'](_0x57d933)[_0xd30c('0x28')](_0x4fc802);};}exports['index']=function(_0x48335c,_0x3ab885){var _0x100824={},_0x4f3085={},_0x5140c3={'count':0x0,'rows':[]};var _0x4c8700=_[_0xd30c('0x29')](db[_0xd30c('0x2a')]['rawAttributes'],function(_0x2d030c){return{'name':_0x2d030c[_0xd30c('0x2b')],'type':_0x2d030c[_0xd30c('0x2c')]['key']};});_0x4f3085[_0xd30c('0x2d')]=_['map'](_0x4c8700,_0xd30c('0x27'));_0x4f3085[_0xd30c('0x2e')]=_[_0xd30c('0x2f')](_0x48335c[_0xd30c('0x2e')]);_0x4f3085['filters']=_[_0xd30c('0x30')](_0x4f3085[_0xd30c('0x2d')],_0x4f3085['query']);_0x100824[_0xd30c('0x31')]=_[_0xd30c('0x30')](_0x4f3085[_0xd30c('0x2d')],qs[_0xd30c('0x32')](_0x48335c[_0xd30c('0x2e')]['fields']));_0x100824[_0xd30c('0x31')]=_0x100824[_0xd30c('0x31')]['length']?_0x100824['attributes']:_0x4f3085['model'];if(!_0x48335c[_0xd30c('0x2e')]['hasOwnProperty'](_0xd30c('0x33'))){_0x100824[_0xd30c('0x1d')]=qs[_0xd30c('0x1d')](_0x48335c[_0xd30c('0x2e')][_0xd30c('0x1d')]);_0x100824[_0xd30c('0x1b')]=qs[_0xd30c('0x1b')](_0x48335c['query'][_0xd30c('0x1b')]);}_0x100824[_0xd30c('0x34')]=qs['sort'](_0x48335c[_0xd30c('0x2e')][_0xd30c('0x35')]);_0x100824[_0xd30c('0x36')]=qs[_0xd30c('0x37')](_[_0xd30c('0x38')](_0x48335c['query'],_0x4f3085[_0xd30c('0x37')]),_0x4c8700);if(_0x48335c[_0xd30c('0x2e')][_0xd30c('0x39')]){_0x100824[_0xd30c('0x36')]=_['merge'](_0x100824[_0xd30c('0x36')],{'$or':_[_0xd30c('0x29')](_0x4c8700,function(_0x352482){if(_0x352482['type']!==_0xd30c('0x3a')){var _0x3a2d4b={};_0x3a2d4b[_0x352482[_0xd30c('0x27')]]={'$like':'%'+_0x48335c[_0xd30c('0x2e')][_0xd30c('0x39')]+'%'};return _0x3a2d4b;}})});}_0x100824=_['merge']({},_0x100824,_0x48335c[_0xd30c('0x3b')]);var _0x5c02fd={'where':_0x100824[_0xd30c('0x36')]};return db[_0xd30c('0x2a')][_0xd30c('0x1e')](_0x5c02fd)[_0xd30c('0x24')](function(_0x1599dd){_0x5140c3['count']=_0x1599dd;if(_0x48335c[_0xd30c('0x2e')][_0xd30c('0x3c')]){_0x100824['include']=[{'all':!![]}];}return db['CmHopperBlack']['findAll'](_0x100824);})[_0xd30c('0x24')](function(_0xb2c67a){_0x5140c3['rows']=_0xb2c67a;return _0x5140c3;})['then'](respondWithFilteredResult(_0x3ab885,_0x100824))['catch'](handleError(_0x3ab885,null));};exports[_0xd30c('0x3d')]=function(_0x2ebbe6,_0x265b09){var _0x22b6da={'raw':!![],'where':{'id':_0x2ebbe6[_0xd30c('0x3e')]['id']}},_0x1cefa4={};_0x1cefa4['model']=_[_0xd30c('0x2f')](db[_0xd30c('0x2a')][_0xd30c('0x3f')]);_0x1cefa4[_0xd30c('0x2e')]=_[_0xd30c('0x2f')](_0x2ebbe6['query']);_0x1cefa4[_0xd30c('0x37')]=_['intersection'](_0x1cefa4[_0xd30c('0x2d')],_0x1cefa4[_0xd30c('0x2e')]);_0x22b6da[_0xd30c('0x31')]=_[_0xd30c('0x30')](_0x1cefa4[_0xd30c('0x2d')],qs[_0xd30c('0x32')](_0x2ebbe6['query']['fields']));_0x22b6da[_0xd30c('0x31')]=_0x22b6da[_0xd30c('0x31')][_0xd30c('0x40')]?_0x22b6da[_0xd30c('0x31')]:_0x1cefa4['model'];if(_0x2ebbe6[_0xd30c('0x2e')][_0xd30c('0x3c')]){_0x22b6da[_0xd30c('0x41')]=[{'all':!![]}];}_0x22b6da=_['merge']({},_0x22b6da,_0x2ebbe6[_0xd30c('0x3b')]);return db[_0xd30c('0x2a')][_0xd30c('0x42')](_0x22b6da)['then'](handleEntityNotFound(_0x265b09,null))[_0xd30c('0x24')](respondWithResult(_0x265b09,null))[_0xd30c('0x43')](handleError(_0x265b09,null));};exports[_0xd30c('0x23')]=function(_0x202b28,_0x331662){if(_0x202b28[_0xd30c('0x44')]['id']){delete _0x202b28[_0xd30c('0x44')]['id'];}return db['CmHopperBlack'][_0xd30c('0x42')]({'where':{'id':_0x202b28[_0xd30c('0x3e')]['id']}})[_0xd30c('0x24')](handleEntityNotFound(_0x331662,null))[_0xd30c('0x24')](saveUpdates(_0x202b28['body'],null))['then'](respondWithResult(_0x331662,null))[_0xd30c('0x43')](handleError(_0x331662,null));};exports[_0xd30c('0x45')]=function(_0x506503,_0x33acd9){return db['CmHopperBlack']['find']({'where':{'id':_0x506503[_0xd30c('0x3e')]['id']}})[_0xd30c('0x24')](handleEntityNotFound(_0x33acd9,null))['then'](removeEntity(_0x33acd9,null))[_0xd30c('0x43')](handleError(_0x33acd9,null));};exports[_0xd30c('0x46')]=function(_0x1f78c1,_0x51c8e0){return db[_0xd30c('0x2a')][_0xd30c('0x46')]()[_0xd30c('0x24')](respondWithResult(_0x51c8e0,null))[_0xd30c('0x43')](handleError(_0x51c8e0,null));}; \ No newline at end of file +var _0xc2fe=['util','path','sox','ejs','fs-extra','lodash','squel','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','status','end','json','offset','undefined','count','limit','set','Content-Range','apply','reject','save','update','then','destroy','error','name','send','index','map','CmHopperBlack','rawAttributes','fieldName','type','key','model','query','keys','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','filters','pick','filter','merge','where','VIRTUAL','options','includeAll','include','findAll','rows','catch','show','params','find','body','describe','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache'];(function(_0x5144ea,_0x450cb7){var _0x5bd085=function(_0x53a87e){while(--_0x53a87e){_0x5144ea['push'](_0x5144ea['shift']());}};_0x5bd085(++_0x450cb7);}(_0xc2fe,0x135));var _0xec2f=function(_0x393ea1,_0x525d5c){_0x393ea1=_0x393ea1-0x0;var _0x1820b9=_0xc2fe[_0x393ea1];return _0x1820b9;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xec2f('0x0'));var zipdir=require(_0xec2f('0x1'));var jsonpatch=require(_0xec2f('0x2'));var rp=require(_0xec2f('0x3'));var moment=require(_0xec2f('0x4'));var BPromise=require(_0xec2f('0x5'));var Mustache=require(_0xec2f('0x6'));var util=require(_0xec2f('0x7'));var path=require(_0xec2f('0x8'));var sox=require(_0xec2f('0x9'));var csv=require('to-csv');var ejs=require(_0xec2f('0xa'));var fs=require('fs');var fs_extra=require(_0xec2f('0xb'));var _=require(_0xec2f('0xc'));var squel=require(_0xec2f('0xd'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0xec2f('0xe'));var toCsv=require('to-csv');var querystring=require(_0xec2f('0xf'));var Papa=require('papaparse');var Redis=require(_0xec2f('0x10'));var authService=require(_0xec2f('0x11'));var qs=require(_0xec2f('0x12'));var as=require(_0xec2f('0x13'));var hardwareService=require(_0xec2f('0x14'));var logger=require(_0xec2f('0x15'))('api');var utils=require(_0xec2f('0x16'));var config=require(_0xec2f('0x17'));var licenseUtil=require(_0xec2f('0x18'));var db=require(_0xec2f('0x19'))['db'];function respondWithStatusCode(_0xac4423,_0x31adfd){_0x31adfd=_0x31adfd||0xcc;return function(_0x75a312){if(_0x75a312){return _0xac4423['sendStatus'](_0x31adfd);}return _0xac4423[_0xec2f('0x1a')](_0x31adfd)[_0xec2f('0x1b')]();};}function respondWithResult(_0x24c183,_0x559623){_0x559623=_0x559623||0xc8;return function(_0x141ca5){if(_0x141ca5){return _0x24c183['status'](_0x559623)[_0xec2f('0x1c')](_0x141ca5);}};}function respondWithFilteredResult(_0x1711a2,_0x39f5fc){return function(_0x34eda1){if(_0x34eda1){var _0x1d459c=typeof _0x39f5fc[_0xec2f('0x1d')]===_0xec2f('0x1e')&&typeof _0x39f5fc['limit']==='undefined';var _0xfdccc0=_0x34eda1[_0xec2f('0x1f')];var _0x4e94c7=_0x1d459c?0x0:_0x39f5fc['offset'];var _0x3441dd=_0x1d459c?_0x34eda1[_0xec2f('0x1f')]:_0x39f5fc[_0xec2f('0x1d')]+_0x39f5fc[_0xec2f('0x20')];var _0x36bb6b;if(_0x3441dd>=_0xfdccc0){_0x3441dd=_0xfdccc0;_0x36bb6b=0xc8;}else{_0x36bb6b=0xce;}_0x1711a2[_0xec2f('0x1a')](_0x36bb6b);return _0x1711a2[_0xec2f('0x21')](_0xec2f('0x22'),_0x4e94c7+'-'+_0x3441dd+'/'+_0xfdccc0)[_0xec2f('0x1c')](_0x34eda1);}return null;};}function patchUpdates(_0x4f1989){return function(_0x2deb76){try{jsonpatch[_0xec2f('0x23')](_0x2deb76,_0x4f1989,!![]);}catch(_0x4f2751){return BPromise[_0xec2f('0x24')](_0x4f2751);}return _0x2deb76[_0xec2f('0x25')]();};}function saveUpdates(_0x1a9acb,_0x9a8f7d){return function(_0x47b646){if(_0x47b646){return _0x47b646[_0xec2f('0x26')](_0x1a9acb)[_0xec2f('0x27')](function(_0x1d5976){return _0x1d5976;});}return null;};}function removeEntity(_0x4697c0,_0x5f434b){return function(_0xe65ac0){if(_0xe65ac0){return _0xe65ac0[_0xec2f('0x28')]()[_0xec2f('0x27')](function(){_0x4697c0[_0xec2f('0x1a')](0xcc)[_0xec2f('0x1b')]();});}};}function handleEntityNotFound(_0x4821f6,_0x50a92a){return function(_0x1ad674){if(!_0x1ad674){_0x4821f6['sendStatus'](0x194);}return _0x1ad674;};}function handleError(_0x223f5e,_0x470e57){_0x470e57=_0x470e57||0x1f4;return function(_0x2f2e69){logger[_0xec2f('0x29')](_0x2f2e69['stack']);if(_0x2f2e69['name']){delete _0x2f2e69[_0xec2f('0x2a')];}_0x223f5e['status'](_0x470e57)[_0xec2f('0x2b')](_0x2f2e69);};}exports[_0xec2f('0x2c')]=function(_0x3f7d14,_0x4b2c43){var _0x52facf={},_0x3ba5ac={},_0x40bb53={'count':0x0,'rows':[]};var _0x5d4d6f=_[_0xec2f('0x2d')](db[_0xec2f('0x2e')][_0xec2f('0x2f')],function(_0x299bcc){return{'name':_0x299bcc[_0xec2f('0x30')],'type':_0x299bcc[_0xec2f('0x31')][_0xec2f('0x32')]};});_0x3ba5ac[_0xec2f('0x33')]=_[_0xec2f('0x2d')](_0x5d4d6f,_0xec2f('0x2a'));_0x3ba5ac[_0xec2f('0x34')]=_[_0xec2f('0x35')](_0x3f7d14[_0xec2f('0x34')]);_0x3ba5ac['filters']=_[_0xec2f('0x36')](_0x3ba5ac['model'],_0x3ba5ac[_0xec2f('0x34')]);_0x52facf['attributes']=_['intersection'](_0x3ba5ac[_0xec2f('0x33')],qs['fields'](_0x3f7d14[_0xec2f('0x34')][_0xec2f('0x37')]));_0x52facf[_0xec2f('0x38')]=_0x52facf[_0xec2f('0x38')][_0xec2f('0x39')]?_0x52facf[_0xec2f('0x38')]:_0x3ba5ac[_0xec2f('0x33')];if(!_0x3f7d14[_0xec2f('0x34')][_0xec2f('0x3a')](_0xec2f('0x3b'))){_0x52facf[_0xec2f('0x20')]=qs['limit'](_0x3f7d14[_0xec2f('0x34')][_0xec2f('0x20')]);_0x52facf[_0xec2f('0x1d')]=qs[_0xec2f('0x1d')](_0x3f7d14[_0xec2f('0x34')][_0xec2f('0x1d')]);}_0x52facf[_0xec2f('0x3c')]=qs[_0xec2f('0x3d')](_0x3f7d14[_0xec2f('0x34')][_0xec2f('0x3d')]);_0x52facf['where']=qs[_0xec2f('0x3e')](_[_0xec2f('0x3f')](_0x3f7d14[_0xec2f('0x34')],_0x3ba5ac[_0xec2f('0x3e')]),_0x5d4d6f);if(_0x3f7d14[_0xec2f('0x34')][_0xec2f('0x40')]){_0x52facf['where']=_[_0xec2f('0x41')](_0x52facf[_0xec2f('0x42')],{'$or':_[_0xec2f('0x2d')](_0x5d4d6f,function(_0x452162){if(_0x452162['type']!==_0xec2f('0x43')){var _0x1a4ee1={};_0x1a4ee1[_0x452162[_0xec2f('0x2a')]]={'$like':'%'+_0x3f7d14[_0xec2f('0x34')]['filter']+'%'};return _0x1a4ee1;}})});}_0x52facf=_['merge']({},_0x52facf,_0x3f7d14[_0xec2f('0x44')]);var _0x2d14ef={'where':_0x52facf[_0xec2f('0x42')]};return db[_0xec2f('0x2e')][_0xec2f('0x1f')](_0x2d14ef)[_0xec2f('0x27')](function(_0x16e482){_0x40bb53['count']=_0x16e482;if(_0x3f7d14[_0xec2f('0x34')][_0xec2f('0x45')]){_0x52facf[_0xec2f('0x46')]=[{'all':!![]}];}return db[_0xec2f('0x2e')][_0xec2f('0x47')](_0x52facf);})[_0xec2f('0x27')](function(_0x56039d){_0x40bb53[_0xec2f('0x48')]=_0x56039d;return _0x40bb53;})[_0xec2f('0x27')](respondWithFilteredResult(_0x4b2c43,_0x52facf))[_0xec2f('0x49')](handleError(_0x4b2c43,null));};exports[_0xec2f('0x4a')]=function(_0x473f7b,_0x50906e){var _0x1122bf={'raw':!![],'where':{'id':_0x473f7b[_0xec2f('0x4b')]['id']}},_0x16f0be={};_0x16f0be[_0xec2f('0x33')]=_[_0xec2f('0x35')](db['CmHopperBlack']['rawAttributes']);_0x16f0be[_0xec2f('0x34')]=_[_0xec2f('0x35')](_0x473f7b['query']);_0x16f0be[_0xec2f('0x3e')]=_['intersection'](_0x16f0be['model'],_0x16f0be['query']);_0x1122bf[_0xec2f('0x38')]=_[_0xec2f('0x36')](_0x16f0be[_0xec2f('0x33')],qs['fields'](_0x473f7b[_0xec2f('0x34')][_0xec2f('0x37')]));_0x1122bf[_0xec2f('0x38')]=_0x1122bf['attributes'][_0xec2f('0x39')]?_0x1122bf['attributes']:_0x16f0be[_0xec2f('0x33')];if(_0x473f7b[_0xec2f('0x34')]['includeAll']){_0x1122bf[_0xec2f('0x46')]=[{'all':!![]}];}_0x1122bf=_['merge']({},_0x1122bf,_0x473f7b[_0xec2f('0x44')]);return db[_0xec2f('0x2e')][_0xec2f('0x4c')](_0x1122bf)[_0xec2f('0x27')](handleEntityNotFound(_0x50906e,null))['then'](respondWithResult(_0x50906e,null))[_0xec2f('0x49')](handleError(_0x50906e,null));};exports['update']=function(_0x52ee05,_0x257ed4){if(_0x52ee05[_0xec2f('0x4d')]['id']){delete _0x52ee05[_0xec2f('0x4d')]['id'];}return db[_0xec2f('0x2e')][_0xec2f('0x4c')]({'where':{'id':_0x52ee05[_0xec2f('0x4b')]['id']}})[_0xec2f('0x27')](handleEntityNotFound(_0x257ed4,null))[_0xec2f('0x27')](saveUpdates(_0x52ee05[_0xec2f('0x4d')],null))[_0xec2f('0x27')](respondWithResult(_0x257ed4,null))[_0xec2f('0x49')](handleError(_0x257ed4,null));};exports[_0xec2f('0x28')]=function(_0x501926,_0x231bb4){return db['CmHopperBlack'][_0xec2f('0x4c')]({'where':{'id':_0x501926[_0xec2f('0x4b')]['id']}})[_0xec2f('0x27')](handleEntityNotFound(_0x231bb4,null))[_0xec2f('0x27')](removeEntity(_0x231bb4,null))[_0xec2f('0x49')](handleError(_0x231bb4,null));};exports[_0xec2f('0x4e')]=function(_0x20239f,_0x382e51){return db[_0xec2f('0x2e')][_0xec2f('0x4e')]()[_0xec2f('0x27')](respondWithResult(_0x382e51,null))[_0xec2f('0x49')](handleError(_0x382e51,null));}; \ No newline at end of file diff --git a/server/api/cmHopperBlack/cmHopperBlack.model.js b/server/api/cmHopperBlack/cmHopperBlack.model.js index 389d997..bbe1e10 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 _0x1fb1=['../../config/environment','./cmHopperBlack.attributes','CmHopperBlack','cm_hopper_black','lodash','util','bluebird','request-promise','path'];(function(_0xa49ead,_0x6cb7c5){var _0x11d356=function(_0x4f343b){while(--_0x4f343b){_0xa49ead['push'](_0xa49ead['shift']());}};_0x11d356(++_0x6cb7c5);}(_0x1fb1,0x190));var _0x11fb=function(_0x2de580,_0x569049){_0x2de580=_0x2de580-0x0;var _0x1cc158=_0x1fb1[_0x2de580];return _0x1cc158;};'use strict';var _=require(_0x11fb('0x0'));var util=require(_0x11fb('0x1'));var logger=require('../../config/logger')('api');var moment=require('moment');var BPromise=require(_0x11fb('0x2'));var rp=require(_0x11fb('0x3'));var fs=require('fs');var path=require(_0x11fb('0x4'));var rimraf=require('rimraf');var config=require(_0x11fb('0x5'));var attributes=require(_0x11fb('0x6'));module['exports']=function(_0x9d722b,_0x37de7b){return _0x9d722b['define'](_0x11fb('0x7'),attributes,{'tableName':_0x11fb('0x8'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xa3d1=['cm_hopper_black','util','moment','bluebird','request-promise','path','../../config/environment','./cmHopperBlack.attributes','exports','define','CmHopperBlack'];(function(_0x1a3988,_0x241c3a){var _0x4dca19=function(_0x3b690e){while(--_0x3b690e){_0x1a3988['push'](_0x1a3988['shift']());}};_0x4dca19(++_0x241c3a);}(_0xa3d1,0x177));var _0x1a3d=function(_0x238a7f,_0x561026){_0x238a7f=_0x238a7f-0x0;var _0xa391ed=_0xa3d1[_0x238a7f];return _0xa391ed;};'use strict';var _=require('lodash');var util=require(_0x1a3d('0x0'));var logger=require('../../config/logger')('api');var moment=require(_0x1a3d('0x1'));var BPromise=require(_0x1a3d('0x2'));var rp=require(_0x1a3d('0x3'));var fs=require('fs');var path=require(_0x1a3d('0x4'));var rimraf=require('rimraf');var config=require(_0x1a3d('0x5'));var attributes=require(_0x1a3d('0x6'));module[_0x1a3d('0x7')]=function(_0x4ffc0b,_0x108a2f){return _0x4ffc0b[_0x1a3d('0x8')](_0x1a3d('0x9'),attributes,{'tableName':_0x1a3d('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 0b38367..afdcacd 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 _0x4bf6=['moment','bluebird','randomstring','ioredis','../../config/logger','rpc','jayson/promise','request','then','request\x20sent','debug','CmHopperBlack,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result','CmHopperBlack,\x20%s,\x20%s','GetCmHopperBlack','findAll','options','raw','where','attributes','limit','include','map','model','catch','UpdateCmHopperBlack','CmHopperBlack','body','DestroyCmHopperBlack','lodash','util'];(function(_0x4ae6ef,_0xc2af80){var _0x3cbb4e=function(_0x569ad5){while(--_0x569ad5){_0x4ae6ef['push'](_0x4ae6ef['shift']());}};_0x3cbb4e(++_0xc2af80);}(_0x4bf6,0xd6));var _0x64bf=function(_0x3f173a,_0x222687){_0x3f173a=_0x3f173a-0x0;var _0x2d8559=_0x4bf6[_0x3f173a];return _0x2d8559;};'use strict';var _=require(_0x64bf('0x0'));var util=require(_0x64bf('0x1'));var moment=require(_0x64bf('0x2'));var BPromise=require(_0x64bf('0x3'));var rs=require(_0x64bf('0x4'));var fs=require('fs');var Redis=require(_0x64bf('0x5'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0x64bf('0x6'))(_0x64bf('0x7'));var config=require('../../config/environment');var jayson=require(_0x64bf('0x8'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x48e399,_0x3f038c,_0x601d0d){return new BPromise(function(_0x5dfd5e,_0x36d420){return client[_0x64bf('0x9')](_0x48e399,_0x601d0d)[_0x64bf('0xa')](function(_0x58e7f8){logger['info']('CmHopperBlack,\x20%s,\x20%s',_0x3f038c,_0x64bf('0xb'));logger[_0x64bf('0xc')](_0x64bf('0xd'),_0x3f038c,_0x64bf('0xb'),JSON[_0x64bf('0xe')](_0x58e7f8));if(_0x58e7f8[_0x64bf('0xf')]){if(_0x58e7f8[_0x64bf('0xf')][_0x64bf('0x10')]===0x1f4){logger[_0x64bf('0xf')]('CmHopperBlack,\x20%s,\x20%s',_0x3f038c,_0x58e7f8['error']['message']);return _0x36d420(_0x58e7f8[_0x64bf('0xf')]['message']);}logger['error']('CmHopperBlack,\x20%s,\x20%s',_0x3f038c,_0x58e7f8[_0x64bf('0xf')]['message']);return _0x5dfd5e(_0x58e7f8[_0x64bf('0xf')][_0x64bf('0x11')]);}else{logger[_0x64bf('0x12')]('CmHopperBlack,\x20%s,\x20%s',_0x3f038c,_0x64bf('0xb'));_0x5dfd5e(_0x58e7f8[_0x64bf('0x13')][_0x64bf('0x11')]);}})['catch'](function(_0xe2a27d){logger[_0x64bf('0xf')](_0x64bf('0x14'),_0x3f038c,_0xe2a27d);_0x36d420(_0xe2a27d);});});}exports[_0x64bf('0x15')]=function(_0x287692){var _0x2fdf62=this;return new Promise(function(_0x575258,_0x4a6cb0){return db['CmHopperBlack'][_0x64bf('0x16')]({'raw':_0x287692[_0x64bf('0x17')]?_0x287692[_0x64bf('0x17')][_0x64bf('0x18')]===undefined?!![]:![]:!![],'where':_0x287692[_0x64bf('0x17')]?_0x287692[_0x64bf('0x17')][_0x64bf('0x19')]||null:null,'attributes':_0x287692[_0x64bf('0x17')]?_0x287692[_0x64bf('0x17')][_0x64bf('0x1a')]||null:null,'limit':_0x287692[_0x64bf('0x17')]?_0x287692[_0x64bf('0x17')][_0x64bf('0x1b')]||null:null,'include':_0x287692[_0x64bf('0x17')]?_0x287692[_0x64bf('0x17')][_0x64bf('0x1c')]?_[_0x64bf('0x1d')](_0x287692['options'][_0x64bf('0x1c')],function(_0x537e5a){return{'model':db[_0x537e5a[_0x64bf('0x1e')]],'as':_0x537e5a['as'],'attributes':_0x537e5a['attributes'],'include':_0x537e5a[_0x64bf('0x1c')]?_[_0x64bf('0x1d')](_0x537e5a['include'],function(_0x252de6){return{'model':db[_0x252de6[_0x64bf('0x1e')]],'as':_0x252de6['as'],'attributes':_0x252de6[_0x64bf('0x1a')],'include':_0x252de6[_0x64bf('0x1c')]?_[_0x64bf('0x1d')](_0x252de6[_0x64bf('0x1c')],function(_0x244d50){return{'model':db[_0x244d50['model']],'as':_0x244d50['as'],'attributes':_0x244d50[_0x64bf('0x1a')]};}):[]};}):[]};}):[]:[]})[_0x64bf('0xa')](function(_0x196f26){logger[_0x64bf('0x12')](_0x64bf('0x15'),_0x287692);logger[_0x64bf('0xc')]('GetCmHopperBlack',_0x287692,JSON['stringify'](_0x196f26));_0x575258(_0x196f26);})[_0x64bf('0x1f')](function(_0x1e033f){logger['error']('GetCmHopperBlack',_0x1e033f[_0x64bf('0x11')],_0x287692);_0x4a6cb0(_0x2fdf62[_0x64bf('0xf')](0x1f4,_0x1e033f['message']));});});};exports[_0x64bf('0x20')]=function(_0x2372b0){var _0x3d2438=this;return new Promise(function(_0x4db3ee,_0x3e3e0b){return db[_0x64bf('0x21')]['update'](_0x2372b0[_0x64bf('0x22')],{'raw':_0x2372b0[_0x64bf('0x17')]?_0x2372b0[_0x64bf('0x17')][_0x64bf('0x18')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x2372b0['options']?_0x2372b0[_0x64bf('0x17')][_0x64bf('0x19')]||null:null,'attributes':_0x2372b0['options']?_0x2372b0[_0x64bf('0x17')][_0x64bf('0x1a')]||null:null,'limit':_0x2372b0['options']?_0x2372b0['options'][_0x64bf('0x1b')]||null:null})['then'](function(_0x48fe53){logger['info'](_0x64bf('0x20'),_0x2372b0);logger['debug'](_0x64bf('0x20'),_0x2372b0,JSON[_0x64bf('0xe')](_0x48fe53));_0x4db3ee(_0x48fe53);})[_0x64bf('0x1f')](function(_0x241ab8){logger[_0x64bf('0xf')](_0x64bf('0x20'),_0x241ab8['message'],_0x2372b0);_0x3e3e0b(_0x3d2438['error'](0x1f4,_0x241ab8['message']));});});};exports[_0x64bf('0x23')]=function(_0x267a81){var _0x2ec653=this;return new Promise(function(_0x2b41cd,_0x6c3111){return db[_0x64bf('0x21')]['destroy']({'where':_0x267a81[_0x64bf('0x17')]?_0x267a81[_0x64bf('0x17')][_0x64bf('0x19')]||null:null})['then'](function(_0x2bde26){logger['info'](_0x64bf('0x23'),_0x267a81);logger[_0x64bf('0xc')]('DestroyCmHopperBlack',_0x267a81,JSON['stringify'](_0x2bde26));_0x2b41cd(_0x2bde26);})[_0x64bf('0x1f')](function(_0x1e69eb){logger[_0x64bf('0xf')](_0x64bf('0x23'),_0x1e69eb['message'],_0x267a81);_0x6c3111(_0x2ec653[_0x64bf('0xf')](0x1f4,_0x1e69eb[_0x64bf('0x11')]));});});}; \ No newline at end of file +var _0x625f=['CmHopperBlack,\x20%s,\x20%s,\x20%s','error','message','catch','GetCmHopperBlack','raw','options','where','attributes','limit','map','include','model','stringify','UpdateCmHopperBlack','CmHopperBlack','update','body','DestroyCmHopperBlack','destroy','lodash','util','bluebird','randomstring','ioredis','../../config/logger','../../config/environment','jayson/promise','client','http','request','then','info','CmHopperBlack,\x20%s,\x20%s','request\x20sent','debug'];(function(_0x52e353,_0x5a3a0d){var _0x46e06b=function(_0x2b0644){while(--_0x2b0644){_0x52e353['push'](_0x52e353['shift']());}};_0x46e06b(++_0x5a3a0d);}(_0x625f,0x158));var _0xf625=function(_0xd816e2,_0x5edac2){_0xd816e2=_0xd816e2-0x0;var _0x1f5924=_0x625f[_0xd816e2];return _0x1f5924;};'use strict';var _=require(_0xf625('0x0'));var util=require(_0xf625('0x1'));var moment=require('moment');var BPromise=require(_0xf625('0x2'));var rs=require(_0xf625('0x3'));var fs=require('fs');var Redis=require(_0xf625('0x4'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0xf625('0x5'))('rpc');var config=require(_0xf625('0x6'));var jayson=require(_0xf625('0x7'));var client=jayson[_0xf625('0x8')][_0xf625('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x55c978,_0x4b68c8,_0x30fc7f){return new BPromise(function(_0xc1b1fd,_0x44de80){return client[_0xf625('0xa')](_0x55c978,_0x30fc7f)[_0xf625('0xb')](function(_0x2214c8){logger[_0xf625('0xc')](_0xf625('0xd'),_0x4b68c8,_0xf625('0xe'));logger[_0xf625('0xf')](_0xf625('0x10'),_0x4b68c8,_0xf625('0xe'),JSON['stringify'](_0x2214c8));if(_0x2214c8[_0xf625('0x11')]){if(_0x2214c8[_0xf625('0x11')]['code']===0x1f4){logger['error']('CmHopperBlack,\x20%s,\x20%s',_0x4b68c8,_0x2214c8[_0xf625('0x11')]['message']);return _0x44de80(_0x2214c8[_0xf625('0x11')][_0xf625('0x12')]);}logger[_0xf625('0x11')]('CmHopperBlack,\x20%s,\x20%s',_0x4b68c8,_0x2214c8[_0xf625('0x11')]['message']);return _0xc1b1fd(_0x2214c8[_0xf625('0x11')][_0xf625('0x12')]);}else{logger[_0xf625('0xc')](_0xf625('0xd'),_0x4b68c8,_0xf625('0xe'));_0xc1b1fd(_0x2214c8['result']['message']);}})[_0xf625('0x13')](function(_0x541f3a){logger['error'](_0xf625('0xd'),_0x4b68c8,_0x541f3a);_0x44de80(_0x541f3a);});});}exports[_0xf625('0x14')]=function(_0x33d4e0){var _0x47251a=this;return new Promise(function(_0x5c962d,_0x3c1c2f){return db['CmHopperBlack']['findAll']({'raw':_0x33d4e0['options']?_0x33d4e0['options'][_0xf625('0x15')]===undefined?!![]:![]:!![],'where':_0x33d4e0['options']?_0x33d4e0[_0xf625('0x16')][_0xf625('0x17')]||null:null,'attributes':_0x33d4e0['options']?_0x33d4e0['options'][_0xf625('0x18')]||null:null,'limit':_0x33d4e0['options']?_0x33d4e0['options'][_0xf625('0x19')]||null:null,'include':_0x33d4e0[_0xf625('0x16')]?_0x33d4e0[_0xf625('0x16')]['include']?_[_0xf625('0x1a')](_0x33d4e0[_0xf625('0x16')][_0xf625('0x1b')],function(_0x2b4448){return{'model':db[_0x2b4448['model']],'as':_0x2b4448['as'],'attributes':_0x2b4448['attributes'],'include':_0x2b4448[_0xf625('0x1b')]?_[_0xf625('0x1a')](_0x2b4448[_0xf625('0x1b')],function(_0x3ac771){return{'model':db[_0x3ac771[_0xf625('0x1c')]],'as':_0x3ac771['as'],'attributes':_0x3ac771[_0xf625('0x18')],'include':_0x3ac771[_0xf625('0x1b')]?_[_0xf625('0x1a')](_0x3ac771[_0xf625('0x1b')],function(_0x43135d){return{'model':db[_0x43135d[_0xf625('0x1c')]],'as':_0x43135d['as'],'attributes':_0x43135d[_0xf625('0x18')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x4df1fb){logger[_0xf625('0xc')](_0xf625('0x14'),_0x33d4e0);logger[_0xf625('0xf')](_0xf625('0x14'),_0x33d4e0,JSON[_0xf625('0x1d')](_0x4df1fb));_0x5c962d(_0x4df1fb);})[_0xf625('0x13')](function(_0x5f5635){logger[_0xf625('0x11')](_0xf625('0x14'),_0x5f5635[_0xf625('0x12')],_0x33d4e0);_0x3c1c2f(_0x47251a['error'](0x1f4,_0x5f5635[_0xf625('0x12')]));});});};exports[_0xf625('0x1e')]=function(_0x2ddda9){var _0x3dfb7a=this;return new Promise(function(_0x2e262a,_0x4a7cc8){return db[_0xf625('0x1f')][_0xf625('0x20')](_0x2ddda9[_0xf625('0x21')],{'raw':_0x2ddda9[_0xf625('0x16')]?_0x2ddda9[_0xf625('0x16')][_0xf625('0x15')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x2ddda9[_0xf625('0x16')]?_0x2ddda9['options']['where']||null:null,'attributes':_0x2ddda9[_0xf625('0x16')]?_0x2ddda9['options']['attributes']||null:null,'limit':_0x2ddda9['options']?_0x2ddda9[_0xf625('0x16')][_0xf625('0x19')]||null:null})[_0xf625('0xb')](function(_0x573651){logger['info']('UpdateCmHopperBlack',_0x2ddda9);logger[_0xf625('0xf')](_0xf625('0x1e'),_0x2ddda9,JSON[_0xf625('0x1d')](_0x573651));_0x2e262a(_0x573651);})[_0xf625('0x13')](function(_0x4366a8){logger[_0xf625('0x11')](_0xf625('0x1e'),_0x4366a8[_0xf625('0x12')],_0x2ddda9);_0x4a7cc8(_0x3dfb7a[_0xf625('0x11')](0x1f4,_0x4366a8[_0xf625('0x12')]));});});};exports[_0xf625('0x22')]=function(_0x53f4fe){var _0x1f557c=this;return new Promise(function(_0x3f30a4,_0x21a664){return db[_0xf625('0x1f')][_0xf625('0x23')]({'where':_0x53f4fe['options']?_0x53f4fe[_0xf625('0x16')][_0xf625('0x17')]||null:null})[_0xf625('0xb')](function(_0x3b5f15){logger['info']('DestroyCmHopperBlack',_0x53f4fe);logger['debug'](_0xf625('0x22'),_0x53f4fe,JSON['stringify'](_0x3b5f15));_0x3f30a4(_0x3b5f15);})['catch'](function(_0x2cc51a){logger[_0xf625('0x11')](_0xf625('0x22'),_0x2cc51a['message'],_0x53f4fe);_0x21a664(_0x1f557c['error'](0x1f4,_0x2cc51a[_0xf625('0x12')]));});});}; \ No newline at end of file diff --git a/server/api/cmHopperBlack/index.js b/server/api/cmHopperBlack/index.js index fb6cb84..7c129aa 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 _0x6d38=['exports','util','path','connect-timeout','fs-extra','../../components/interaction/service','../../config/environment','./cmHopperBlack.controller','isAuthenticated','index','get','/describe','/:id'];(function(_0x44b68a,_0x48205e){var _0x159615=function(_0x178a0c){while(--_0x178a0c){_0x44b68a['push'](_0x44b68a['shift']());}};_0x159615(++_0x48205e);}(_0x6d38,0x1ef));var _0x86d3=function(_0x3e5086,_0x48f4a2){_0x3e5086=_0x3e5086-0x0;var _0xfeb102=_0x6d38[_0x3e5086];return _0xfeb102;};'use strict';var multer=require('multer');var util=require(_0x86d3('0x0'));var path=require(_0x86d3('0x1'));var timeout=require(_0x86d3('0x2'));var express=require('express');var router=express['Router']();var fs_extra=require(_0x86d3('0x3'));var auth=require('../../components/auth/service');var interaction=require(_0x86d3('0x4'));var config=require(_0x86d3('0x5'));var controller=require(_0x86d3('0x6'));router['get']('/',auth[_0x86d3('0x7')](),controller[_0x86d3('0x8')]);router[_0x86d3('0x9')](_0x86d3('0xa'),auth['isAuthenticated'](),controller['describe']);router[_0x86d3('0x9')](_0x86d3('0xb'),auth[_0x86d3('0x7')](),controller['show']);router['put'](_0x86d3('0xb'),auth[_0x86d3('0x7')](),controller['update']);router['delete'](_0x86d3('0xb'),auth[_0x86d3('0x7')](),controller['destroy']);module[_0x86d3('0xc')]=router; \ No newline at end of file +var _0x2d72=['connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./cmHopperBlack.controller','get','isAuthenticated','index','/describe','/:id','show','update','delete','multer','util','path'];(function(_0x588061,_0x2c1481){var _0x14136e=function(_0x56882b){while(--_0x56882b){_0x588061['push'](_0x588061['shift']());}};_0x14136e(++_0x2c1481);}(_0x2d72,0xa8));var _0x22d7=function(_0x50aa16,_0x45cad9){_0x50aa16=_0x50aa16-0x0;var _0x42ca6e=_0x2d72[_0x50aa16];return _0x42ca6e;};'use strict';var multer=require(_0x22d7('0x0'));var util=require(_0x22d7('0x1'));var path=require(_0x22d7('0x2'));var timeout=require(_0x22d7('0x3'));var express=require(_0x22d7('0x4'));var router=express[_0x22d7('0x5')]();var fs_extra=require(_0x22d7('0x6'));var auth=require(_0x22d7('0x7'));var interaction=require(_0x22d7('0x8'));var config=require(_0x22d7('0x9'));var controller=require(_0x22d7('0xa'));router[_0x22d7('0xb')]('/',auth[_0x22d7('0xc')](),controller[_0x22d7('0xd')]);router['get'](_0x22d7('0xe'),auth[_0x22d7('0xc')](),controller['describe']);router[_0x22d7('0xb')](_0x22d7('0xf'),auth[_0x22d7('0xc')](),controller[_0x22d7('0x10')]);router['put']('/:id',auth[_0x22d7('0xc')](),controller[_0x22d7('0x11')]);router[_0x22d7('0x12')](_0x22d7('0xf'),auth[_0x22d7('0xc')](),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 87ea81c..36a8882 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 _0x46db=['STRING','DATE','getDataValue','setDataValue','diff','seconds','BOOLEAN','sequelize','moment','INTEGER'];(function(_0x54d4d2,_0x239775){var _0x3a9f07=function(_0x515ca4){while(--_0x515ca4){_0x54d4d2['push'](_0x54d4d2['shift']());}};_0x3a9f07(++_0x239775);}(_0x46db,0x6b));var _0xb46d=function(_0x28780d,_0xaf942e){_0x28780d=_0x28780d-0x0;var _0x41e3bc=_0x46db[_0x28780d];return _0x41e3bc;};'use strict';var Sequelize=require(_0xb46d('0x0'));var moment=require(_0xb46d('0x1'));module['exports']={'state':{'type':Sequelize[_0xb46d('0x2')](0x2)},'statedesc':{'type':Sequelize[_0xb46d('0x3')]},'scheduledat':{'type':Sequelize['DATE']},'countbusyretry':{'type':Sequelize[_0xb46d('0x2')],'defaultValue':0x0},'countcongestionretry':{'type':Sequelize[_0xb46d('0x2')],'defaultValue':0x0},'countnoanswerretry':{'type':Sequelize[_0xb46d('0x2')],'defaultValue':0x0},'countglobal':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'uniqueid':{'type':Sequelize['STRING']},'originatecalleridnum':{'type':Sequelize[_0xb46d('0x3')]},'originatecalleridname':{'type':Sequelize['STRING']},'calleridnum':{'type':Sequelize[_0xb46d('0x3')]},'calleridname':{'type':Sequelize[_0xb46d('0x3')]},'starttime':{'type':Sequelize[_0xb46d('0x4')]},'responsetime':{'type':Sequelize[_0xb46d('0x4')]},'answertime':{'type':Sequelize[_0xb46d('0x4')]},'droptime':{'type':Sequelize[_0xb46d('0x4')]},'endtime':{'type':Sequelize[_0xb46d('0x4')]},'ringtime':{'type':Sequelize[_0xb46d('0x2')],'defaultValue':0x0},'holdtime':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'talktime':{'type':Sequelize[_0xb46d('0x2')],'defaultValue':0x0},'followuptime':{'type':Sequelize[_0xb46d('0x2')],'defaultValue':0x0},'dropreason':{'type':Sequelize['STRING']},'campaign':{'type':Sequelize[_0xb46d('0x3')]},'campaigntype':{'type':Sequelize[_0xb46d('0x3')]},'membername':{'type':Sequelize[_0xb46d('0x3')]},'reason':{'type':Sequelize['STRING']},'disposition':{'type':Sequelize[_0xb46d('0x3')]},'secondDisposition':{'type':Sequelize[_0xb46d('0x3')]},'thirdDisposition':{'type':Sequelize[_0xb46d('0x3')]},'dispositionat':{'type':Sequelize[_0xb46d('0x4')],'set':function(_0x499703){var _0x4cd702=this[_0xb46d('0x5')]('endtime');if(_0x4cd702&&_0x499703){this[_0xb46d('0x6')]('followuptime',moment(_0x499703)[_0xb46d('0x7')](moment(_0x4cd702),_0xb46d('0x8')));}}},'amd':{'type':Sequelize[_0xb46d('0x9')],'defaultValue':![]},'fax':{'type':Sequelize[_0xb46d('0x9')],'defaultValue':![]},'blacklist':{'type':Sequelize[_0xb46d('0x9')],'defaultValue':![]},'rescheduled':{'type':Sequelize[_0xb46d('0x9')],'defaultValue':![]},'rescheduledat':{'type':Sequelize[_0xb46d('0x4')]},'callback':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'callbackuniqueid':{'type':Sequelize[_0xb46d('0x3')],'defaultValue':null},'callbackat':{'type':Sequelize[_0xb46d('0x4')]},'deleted':{'type':Sequelize[_0xb46d('0x3')],'defaultValue':null},'deletedat':{'type':Sequelize[_0xb46d('0x4')]},'recallme':{'type':Sequelize[_0xb46d('0x9')],'defaultValue':![]},'agiafterat':{'type':Sequelize[_0xb46d('0x4')]},'countnosuchnumberretry':{'type':Sequelize[_0xb46d('0x2')],'defaultValue':0x0},'countdropretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countabandonedretry':{'type':Sequelize[_0xb46d('0x2')],'defaultValue':0x0},'countmachineretry':{'type':Sequelize[_0xb46d('0x2')],'defaultValue':0x0},'countagentrejectretry':{'type':Sequelize[_0xb46d('0x2')],'defaultValue':0x0}}; \ No newline at end of file +var _0xe64a=['BOOLEAN','INTEGER','STRING','DATE','getDataValue','setDataValue','followuptime','diff','seconds'];(function(_0x3e64a5,_0x2e0bc0){var _0x53ecb6=function(_0x7b848a){while(--_0x7b848a){_0x3e64a5['push'](_0x3e64a5['shift']());}};_0x53ecb6(++_0x2e0bc0);}(_0xe64a,0x106));var _0xae64=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0xe64a[_0x321bb2];return _0x9c12ed;};'use strict';var Sequelize=require('sequelize');var moment=require('moment');module['exports']={'state':{'type':Sequelize[_0xae64('0x0')](0x2)},'statedesc':{'type':Sequelize['STRING']},'scheduledat':{'type':Sequelize['DATE']},'countbusyretry':{'type':Sequelize[_0xae64('0x0')],'defaultValue':0x0},'countcongestionretry':{'type':Sequelize[_0xae64('0x0')],'defaultValue':0x0},'countnoanswerretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countglobal':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'uniqueid':{'type':Sequelize[_0xae64('0x1')]},'originatecalleridnum':{'type':Sequelize['STRING']},'originatecalleridname':{'type':Sequelize[_0xae64('0x1')]},'calleridnum':{'type':Sequelize[_0xae64('0x1')]},'calleridname':{'type':Sequelize[_0xae64('0x1')]},'starttime':{'type':Sequelize['DATE']},'responsetime':{'type':Sequelize[_0xae64('0x2')]},'answertime':{'type':Sequelize[_0xae64('0x2')]},'droptime':{'type':Sequelize[_0xae64('0x2')]},'endtime':{'type':Sequelize['DATE']},'ringtime':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'holdtime':{'type':Sequelize[_0xae64('0x0')],'defaultValue':0x0},'talktime':{'type':Sequelize[_0xae64('0x0')],'defaultValue':0x0},'followuptime':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'dropreason':{'type':Sequelize[_0xae64('0x1')]},'campaign':{'type':Sequelize[_0xae64('0x1')]},'campaigntype':{'type':Sequelize[_0xae64('0x1')]},'membername':{'type':Sequelize[_0xae64('0x1')]},'reason':{'type':Sequelize['STRING']},'disposition':{'type':Sequelize['STRING']},'secondDisposition':{'type':Sequelize[_0xae64('0x1')]},'thirdDisposition':{'type':Sequelize[_0xae64('0x1')]},'dispositionat':{'type':Sequelize[_0xae64('0x2')],'set':function(_0x5ba7b7){var _0x58dd8b=this[_0xae64('0x3')]('endtime');if(_0x58dd8b&&_0x5ba7b7){this[_0xae64('0x4')](_0xae64('0x5'),moment(_0x5ba7b7)[_0xae64('0x6')](moment(_0x58dd8b),_0xae64('0x7')));}}},'amd':{'type':Sequelize[_0xae64('0x8')],'defaultValue':![]},'fax':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'blacklist':{'type':Sequelize[_0xae64('0x8')],'defaultValue':![]},'rescheduled':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'rescheduledat':{'type':Sequelize['DATE']},'callback':{'type':Sequelize[_0xae64('0x8')],'defaultValue':![]},'callbackuniqueid':{'type':Sequelize['STRING'],'defaultValue':null},'callbackat':{'type':Sequelize[_0xae64('0x2')]},'deleted':{'type':Sequelize[_0xae64('0x1')],'defaultValue':null},'deletedat':{'type':Sequelize[_0xae64('0x2')]},'recallme':{'type':Sequelize[_0xae64('0x8')],'defaultValue':![]},'agiafterat':{'type':Sequelize['DATE']},'countnosuchnumberretry':{'type':Sequelize[_0xae64('0x0')],'defaultValue':0x0},'countdropretry':{'type':Sequelize[_0xae64('0x0')],'defaultValue':0x0},'countabandonedretry':{'type':Sequelize[_0xae64('0x0')],'defaultValue':0x0},'countmachineretry':{'type':Sequelize[_0xae64('0x0')],'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 4eeebcf..f732252 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 _0x2675=['lodash','squel','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','api','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','offset','undefined','limit','count','Content-Range','json','apply','reject','destroy','then','error','name','send','index','map','CmHopperFinal','fieldName','type','key','query','keys','intersection','model','attributes','fields','hasOwnProperty','sort','where','filters','pick','merge','VIRTUAL','filter','includeAll','include','rows','catch','show','rawAttributes','length','options','find','describe','body','uniqueid','params','findAll','sequelize','COUNT','`state`\x20=\x200,\x201,\x20null','literal','`state`\x20=\x203,\x201,\x20null','noAnswerContacts','`state`\x20=\x205,\x201,\x20null','`state`\x20=\x208,\x201,\x20null','congestionContacts','`state`\x20=\x2010\x20,\x201,\x20null','dropContacts','`state`\x20=\x2011\x20,\x201,\x20null','`state`\x20=\x2022,\x201,\x20null','reCallContacts','`state`\x20=\x2019,\x201,\x20null','answeringMachine','countContactsIvrCampaignHopperFinal','noSuchContacts','busyContacts','abandonedContacts','moveContactsQueueCampaignHopperFinal','insert','into','cm_hopper','fromQuery','scheduledAt','ContactId','VoiceQueueId','createdAt','field','ANY_VALUE(calleridnum)','NOW()','ANY_VALUE(ContactId)','ANY_VALUE(ListId)','ListId','ANY_VALUE(VoiceQueueId)','updatedAt','VoiceQueueId\x20=\x20?','toString','state\x20=\x20?','state','calleridnum\x20IS\x20NOT\x20NULL','select','phone','from','calleridnum','cm_hopper_final','state\x20=\x204','moveContactsIvrCampaignHopperFinal','CampaignId','ANY_VALUE(CampaignId)','CampaignId\x20=\x20?','calleridnum\x20NOT\x20IN\x20(?)','group','eml-format','request-promise','moment','mustache','util','sox','to-csv','ejs','fs-extra'];(function(_0x2a8dbe,_0x1cf0bd){var _0x31ce92=function(_0x2c3d64){while(--_0x2c3d64){_0x2a8dbe['push'](_0x2a8dbe['shift']());}};_0x31ce92(++_0x1cf0bd);}(_0x2675,0x75));var _0x5267=function(_0x50d2ce,_0x1dcee4){_0x50d2ce=_0x50d2ce-0x0;var _0x2e1b69=_0x2675[_0x50d2ce];return _0x2e1b69;};'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'];function respondWithStatusCode(_0x1f9be3,_0x1d7090){_0x1d7090=_0x1d7090||0xcc;return function(_0x1171b9){if(_0x1171b9){return _0x1f9be3[_0x5267('0x16')](_0x1d7090);}return _0x1f9be3[_0x5267('0x17')](_0x1d7090)[_0x5267('0x18')]();};}function respondWithResult(_0x1e2d3b,_0x16e5a7){_0x16e5a7=_0x16e5a7||0xc8;return function(_0x29349a){if(_0x29349a){return _0x1e2d3b[_0x5267('0x17')](_0x16e5a7)['json'](_0x29349a);}};}function respondWithFilteredResult(_0x52e24e,_0xa593fb){return function(_0x40d897){if(_0x40d897){var _0x38a147=typeof _0xa593fb[_0x5267('0x19')]===_0x5267('0x1a')&&typeof _0xa593fb[_0x5267('0x1b')]===_0x5267('0x1a');var _0x6831e0=_0x40d897[_0x5267('0x1c')];var _0xb1c97a=_0x38a147?0x0:_0xa593fb[_0x5267('0x19')];var _0x1ab03=_0x38a147?_0x40d897['count']:_0xa593fb[_0x5267('0x19')]+_0xa593fb[_0x5267('0x1b')];var _0x5069e8;if(_0x1ab03>=_0x6831e0){_0x1ab03=_0x6831e0;_0x5069e8=0xc8;}else{_0x5069e8=0xce;}_0x52e24e[_0x5267('0x17')](_0x5069e8);return _0x52e24e['set'](_0x5267('0x1d'),_0xb1c97a+'-'+_0x1ab03+'/'+_0x6831e0)[_0x5267('0x1e')](_0x40d897);}return null;};}function patchUpdates(_0x39c0c3){return function(_0x2a9f99){try{jsonpatch[_0x5267('0x1f')](_0x2a9f99,_0x39c0c3,!![]);}catch(_0x4dd637){return BPromise[_0x5267('0x20')](_0x4dd637);}return _0x2a9f99['save']();};}function saveUpdates(_0xa32663,_0x420fb8){return function(_0x3b53ac){if(_0x3b53ac){return _0x3b53ac['update'](_0xa32663)['then'](function(_0x5546e2){return _0x5546e2;});}return null;};}function removeEntity(_0x4a17c7,_0x5ea6a6){return function(_0x26c7f8){if(_0x26c7f8){return _0x26c7f8[_0x5267('0x21')]()[_0x5267('0x22')](function(){_0x4a17c7[_0x5267('0x17')](0xcc)[_0x5267('0x18')]();});}};}function handleEntityNotFound(_0x40d1be,_0x126a97){return function(_0x220e03){if(!_0x220e03){_0x40d1be[_0x5267('0x16')](0x194);}return _0x220e03;};}function handleError(_0x59f112,_0x5cb64f){_0x5cb64f=_0x5cb64f||0x1f4;return function(_0x354111){logger[_0x5267('0x23')](_0x354111['stack']);if(_0x354111[_0x5267('0x24')]){delete _0x354111['name'];}_0x59f112['status'](_0x5cb64f)[_0x5267('0x25')](_0x354111);};}exports[_0x5267('0x26')]=function(_0x1f33b7,_0x2d2ace){var _0x33c431={},_0x4f3d4d={},_0x5e87eb={'count':0x0,'rows':[]};var _0x18020c=_[_0x5267('0x27')](db[_0x5267('0x28')]['rawAttributes'],function(_0x58d685){return{'name':_0x58d685[_0x5267('0x29')],'type':_0x58d685[_0x5267('0x2a')][_0x5267('0x2b')]};});_0x4f3d4d['model']=_['map'](_0x18020c,_0x5267('0x24'));_0x4f3d4d[_0x5267('0x2c')]=_[_0x5267('0x2d')](_0x1f33b7[_0x5267('0x2c')]);_0x4f3d4d['filters']=_[_0x5267('0x2e')](_0x4f3d4d[_0x5267('0x2f')],_0x4f3d4d[_0x5267('0x2c')]);_0x33c431[_0x5267('0x30')]=_[_0x5267('0x2e')](_0x4f3d4d[_0x5267('0x2f')],qs[_0x5267('0x31')](_0x1f33b7[_0x5267('0x2c')]['fields']));_0x33c431['attributes']=_0x33c431[_0x5267('0x30')]['length']?_0x33c431[_0x5267('0x30')]:_0x4f3d4d[_0x5267('0x2f')];if(!_0x1f33b7[_0x5267('0x2c')][_0x5267('0x32')]('nolimit')){_0x33c431[_0x5267('0x1b')]=qs[_0x5267('0x1b')](_0x1f33b7[_0x5267('0x2c')][_0x5267('0x1b')]);_0x33c431[_0x5267('0x19')]=qs[_0x5267('0x19')](_0x1f33b7[_0x5267('0x2c')][_0x5267('0x19')]);}_0x33c431['order']=qs[_0x5267('0x33')](_0x1f33b7['query'][_0x5267('0x33')]);_0x33c431[_0x5267('0x34')]=qs[_0x5267('0x35')](_[_0x5267('0x36')](_0x1f33b7[_0x5267('0x2c')],_0x4f3d4d[_0x5267('0x35')]),_0x18020c);if(_0x1f33b7[_0x5267('0x2c')]['filter']){_0x33c431[_0x5267('0x34')]=_[_0x5267('0x37')](_0x33c431[_0x5267('0x34')],{'$or':_[_0x5267('0x27')](_0x18020c,function(_0x82cea7){if(_0x82cea7[_0x5267('0x2a')]!==_0x5267('0x38')){var _0x487dfc={};_0x487dfc[_0x82cea7[_0x5267('0x24')]]={'$like':'%'+_0x1f33b7['query'][_0x5267('0x39')]+'%'};return _0x487dfc;}})});}_0x33c431=_['merge']({},_0x33c431,_0x1f33b7['options']);var _0x51bddd={'where':_0x33c431[_0x5267('0x34')]};return db['CmHopperFinal'][_0x5267('0x1c')](_0x51bddd)[_0x5267('0x22')](function(_0x3d4b19){_0x5e87eb[_0x5267('0x1c')]=_0x3d4b19;if(_0x1f33b7['query'][_0x5267('0x3a')]){_0x33c431[_0x5267('0x3b')]=[{'all':!![]}];}return db['CmHopperFinal']['findAll'](_0x33c431);})[_0x5267('0x22')](function(_0x560cdf){_0x5e87eb[_0x5267('0x3c')]=_0x560cdf;return _0x5e87eb;})[_0x5267('0x22')](respondWithFilteredResult(_0x2d2ace,_0x33c431))[_0x5267('0x3d')](handleError(_0x2d2ace,null));};exports[_0x5267('0x3e')]=function(_0x36d0f1,_0x3012cb){var _0x27add5={'raw':!![],'where':{'id':_0x36d0f1['params']['id']}},_0x5697b3={};_0x5697b3[_0x5267('0x2f')]=_['keys'](db[_0x5267('0x28')][_0x5267('0x3f')]);_0x5697b3['query']=_[_0x5267('0x2d')](_0x36d0f1[_0x5267('0x2c')]);_0x5697b3[_0x5267('0x35')]=_[_0x5267('0x2e')](_0x5697b3[_0x5267('0x2f')],_0x5697b3[_0x5267('0x2c')]);_0x27add5[_0x5267('0x30')]=_[_0x5267('0x2e')](_0x5697b3[_0x5267('0x2f')],qs['fields'](_0x36d0f1[_0x5267('0x2c')][_0x5267('0x31')]));_0x27add5[_0x5267('0x30')]=_0x27add5[_0x5267('0x30')][_0x5267('0x40')]?_0x27add5['attributes']:_0x5697b3[_0x5267('0x2f')];if(_0x36d0f1['query'][_0x5267('0x3a')]){_0x27add5['include']=[{'all':!![]}];}_0x27add5=_['merge']({},_0x27add5,_0x36d0f1[_0x5267('0x41')]);return db['CmHopperFinal'][_0x5267('0x42')](_0x27add5)[_0x5267('0x22')](handleEntityNotFound(_0x3012cb,null))[_0x5267('0x22')](respondWithResult(_0x3012cb,null))[_0x5267('0x3d')](handleError(_0x3012cb,null));};exports['describe']=function(_0x12d6a8,_0x4ee826){return db['CmHopperFinal'][_0x5267('0x43')]()[_0x5267('0x22')](respondWithResult(_0x4ee826,null))['catch'](handleError(_0x4ee826,null));};exports['update']=function(_0x383ebe,_0xe0439e){if(_0x383ebe[_0x5267('0x44')][_0x5267('0x45')]){delete _0x383ebe[_0x5267('0x44')][_0x5267('0x45')];}return db[_0x5267('0x28')][_0x5267('0x42')]({'where':{'uniqueid':_0x383ebe[_0x5267('0x46')]['id']}})[_0x5267('0x22')](handleEntityNotFound(_0xe0439e,null))[_0x5267('0x22')](saveUpdates(_0x383ebe[_0x5267('0x44')],null))[_0x5267('0x22')](respondWithResult(_0xe0439e,null))[_0x5267('0x3d')](handleError(_0xe0439e,null));};exports['countContactsQueueCampaignHopperFinal']=function(_0x8636d0,_0x466d46,_0x371486){return db['CmHopperFinal'][_0x5267('0x47')]({'raw':![],'where':{'VoiceQueueId':_0x8636d0[_0x5267('0x46')]['id']},'attributes':[[db[_0x5267('0x48')]['fn'](_0x5267('0x49'),db[_0x5267('0x48')]['fn']('IF',db[_0x5267('0x48')]['literal'](_0x5267('0x4a')))),'noSuchContacts'],[db[_0x5267('0x48')]['fn'](_0x5267('0x49'),db[_0x5267('0x48')]['fn']('IF',db[_0x5267('0x48')][_0x5267('0x4b')](_0x5267('0x4c')))),_0x5267('0x4d')],[db['sequelize']['fn']('COUNT',db[_0x5267('0x48')]['fn']('IF',db[_0x5267('0x48')]['literal'](_0x5267('0x4e')))),'busyContacts'],[db['sequelize']['fn'](_0x5267('0x49'),db[_0x5267('0x48')]['fn']('IF',db[_0x5267('0x48')][_0x5267('0x4b')](_0x5267('0x4f')))),_0x5267('0x50')],[db[_0x5267('0x48')]['fn'](_0x5267('0x49'),db[_0x5267('0x48')]['fn']('IF',db[_0x5267('0x48')]['literal'](_0x5267('0x51')))),_0x5267('0x52')],[db[_0x5267('0x48')]['fn'](_0x5267('0x49'),db[_0x5267('0x48')]['fn']('IF',db[_0x5267('0x48')]['literal'](_0x5267('0x53')))),'abandonedContacts'],[db[_0x5267('0x48')]['fn'](_0x5267('0x49'),db[_0x5267('0x48')]['fn']('IF',db['sequelize'][_0x5267('0x4b')](_0x5267('0x54')))),_0x5267('0x55')],[db[_0x5267('0x48')]['fn'](_0x5267('0x49'),db[_0x5267('0x48')]['fn']('IF',db['sequelize'][_0x5267('0x4b')](_0x5267('0x56')))),_0x5267('0x57')]]})[_0x5267('0x22')](handleEntityNotFound(_0x466d46,null))['then'](respondWithResult(_0x466d46,null))['catch'](handleError(_0x466d46,null));};exports[_0x5267('0x58')]=function(_0x5393e9,_0x3f5cda,_0x47059c){return db['CmHopperFinal']['findAll']({'raw':![],'where':{'CampaignId':_0x5393e9[_0x5267('0x46')]['id']},'attributes':[[db[_0x5267('0x48')]['fn'](_0x5267('0x49'),db['sequelize']['fn']('IF',db[_0x5267('0x48')][_0x5267('0x4b')](_0x5267('0x4a')))),_0x5267('0x59')],[db['sequelize']['fn']('COUNT',db['sequelize']['fn']('IF',db[_0x5267('0x48')][_0x5267('0x4b')](_0x5267('0x4c')))),_0x5267('0x4d')],[db[_0x5267('0x48')]['fn'](_0x5267('0x49'),db[_0x5267('0x48')]['fn']('IF',db[_0x5267('0x48')]['literal'](_0x5267('0x4e')))),_0x5267('0x5a')],[db['sequelize']['fn'](_0x5267('0x49'),db[_0x5267('0x48')]['fn']('IF',db[_0x5267('0x48')][_0x5267('0x4b')](_0x5267('0x4f')))),_0x5267('0x50')],[db['sequelize']['fn'](_0x5267('0x49'),db[_0x5267('0x48')]['fn']('IF',db[_0x5267('0x48')][_0x5267('0x4b')](_0x5267('0x51')))),_0x5267('0x52')],[db['sequelize']['fn'](_0x5267('0x49'),db[_0x5267('0x48')]['fn']('IF',db[_0x5267('0x48')][_0x5267('0x4b')](_0x5267('0x53')))),_0x5267('0x5b')],[db['sequelize']['fn'](_0x5267('0x49'),db[_0x5267('0x48')]['fn']('IF',db[_0x5267('0x48')][_0x5267('0x4b')]('`state`\x20=\x2022,\x201,\x20null'))),'reCallContacts'],[db['sequelize']['fn'](_0x5267('0x49'),db['sequelize']['fn']('IF',db[_0x5267('0x48')]['literal'](_0x5267('0x56')))),_0x5267('0x57')]]})[_0x5267('0x22')](handleEntityNotFound(_0x3f5cda,null))[_0x5267('0x22')](respondWithResult(_0x3f5cda,null))[_0x5267('0x3d')](handleError(_0x3f5cda,null));};exports[_0x5267('0x5c')]=function(_0x21338f,_0x1103c5,_0x489b9a){return db['VoiceQueue']['find']({'where':{'id':_0x21338f[_0x5267('0x46')]['id']}})[_0x5267('0x22')](handleEntityNotFound(_0x1103c5,null))[_0x5267('0x22')](function(_0x457d84){var _0x4974d1;if(_0x457d84){_0x4974d1=squel[_0x5267('0x5d')]()[_0x5267('0x5e')](_0x5267('0x5f'))[_0x5267('0x60')](['phone',_0x5267('0x61'),_0x5267('0x62'),'ListId',_0x5267('0x63'),_0x5267('0x64'),'updatedAt'],squel['select']()[_0x5267('0x65')](_0x5267('0x66'),'phone')['field'](_0x5267('0x67'),_0x5267('0x61'))[_0x5267('0x65')](_0x5267('0x68'),_0x5267('0x62'))['field'](_0x5267('0x69'),_0x5267('0x6a'))['field'](_0x5267('0x6b'),_0x5267('0x63'))[_0x5267('0x65')](_0x5267('0x67'),_0x5267('0x64'))[_0x5267('0x65')](_0x5267('0x67'),_0x5267('0x6c'))['from']('cm_hopper_final')[_0x5267('0x34')](_0x5267('0x6d'),_0x21338f[_0x5267('0x46')]['id'][_0x5267('0x6e')]())['where'](_0x5267('0x6f'),_0x21338f['body'][_0x5267('0x70')][_0x5267('0x6e')]())[_0x5267('0x34')](_0x5267('0x71'))['where']('calleridnum\x20NOT\x20IN\x20(?)',squel[_0x5267('0x72')]()[_0x5267('0x65')](_0x5267('0x73'))[_0x5267('0x74')](_0x5267('0x5f'))[_0x5267('0x34')]('VoiceQueueId\x20=\x20?',_0x21338f[_0x5267('0x46')]['id']['toString']()))[_0x5267('0x34')]('calleridnum\x20NOT\x20IN\x20(?)',squel[_0x5267('0x72')]()[_0x5267('0x65')](_0x5267('0x75'))[_0x5267('0x74')](_0x5267('0x76'))[_0x5267('0x34')](_0x5267('0x6d'),_0x21338f[_0x5267('0x46')]['id'][_0x5267('0x6e')]())[_0x5267('0x34')](_0x5267('0x77')))['group'](_0x5267('0x62')))[_0x5267('0x6e')]();return db['sequelize'][_0x5267('0x2c')](_0x4974d1);}return[];})[_0x5267('0x22')](respondWithResult(_0x1103c5,null))[_0x5267('0x3d')](handleError(_0x1103c5,null));};exports[_0x5267('0x78')]=function(_0xd18795,_0x37b007,_0x358543){return db['Campaign'][_0x5267('0x42')]({'where':{'id':_0xd18795[_0x5267('0x46')]['id']}})[_0x5267('0x22')](handleEntityNotFound(_0x37b007,null))[_0x5267('0x22')](function(_0x1cdf9f){var _0x4dbaa2;if(_0x1cdf9f){_0x4dbaa2=squel['insert']()[_0x5267('0x5e')](_0x5267('0x5f'))[_0x5267('0x60')]([_0x5267('0x73'),'scheduledAt',_0x5267('0x62'),_0x5267('0x6a'),_0x5267('0x79'),_0x5267('0x64'),_0x5267('0x6c')],squel[_0x5267('0x72')]()[_0x5267('0x65')](_0x5267('0x66'),_0x5267('0x73'))[_0x5267('0x65')](_0x5267('0x67'),_0x5267('0x61'))[_0x5267('0x65')]('ANY_VALUE(ContactId)',_0x5267('0x62'))[_0x5267('0x65')](_0x5267('0x69'),_0x5267('0x6a'))[_0x5267('0x65')](_0x5267('0x7a'),_0x5267('0x79'))[_0x5267('0x65')](_0x5267('0x67'),_0x5267('0x64'))[_0x5267('0x65')](_0x5267('0x67'),_0x5267('0x6c'))[_0x5267('0x74')](_0x5267('0x76'))[_0x5267('0x34')](_0x5267('0x7b'),_0xd18795[_0x5267('0x46')]['id'][_0x5267('0x6e')]())[_0x5267('0x34')](_0x5267('0x6f'),_0xd18795[_0x5267('0x44')][_0x5267('0x70')]['toString']())[_0x5267('0x34')](_0x5267('0x71'))[_0x5267('0x34')](_0x5267('0x7c'),squel[_0x5267('0x72')]()['field'](_0x5267('0x73'))[_0x5267('0x74')]('cm_hopper')['where']('CampaignId\x20=\x20?',_0xd18795[_0x5267('0x46')]['id']['toString']()))[_0x5267('0x34')]('calleridnum\x20NOT\x20IN\x20(?)',squel['select']()[_0x5267('0x65')](_0x5267('0x75'))[_0x5267('0x74')](_0x5267('0x76'))[_0x5267('0x34')]('CampaignId\x20=\x20?',_0xd18795['params']['id'][_0x5267('0x6e')]())[_0x5267('0x34')](_0x5267('0x77')))[_0x5267('0x7d')](_0x5267('0x62')))['toString']();return db[_0x5267('0x48')]['query'](_0x4dbaa2);}return[];})['then'](respondWithResult(_0x37b007,null))[_0x5267('0x3d')](handleError(_0x37b007,null));};exports['checkContactHopper']=function(_0x5da8d6,_0x3ebe63,_0x321322){return db['CmHopper']['findOne']({'where':{'VoiceQueueId':_0x5da8d6['body'][_0x5267('0x63')],'CampaignId':_0x5da8d6['body'][_0x5267('0x79')],'ContactId':_0x5da8d6['body'][_0x5267('0x62')]}})[_0x5267('0x22')](handleEntityNotFound(_0x3ebe63,null))['then'](function(_0x1ae9fe){if(_0x1ae9fe){return _0x1ae9fe;}return null;})[_0x5267('0x22')](respondWithResult(_0x3ebe63,null))[_0x5267('0x3d')](handleError(_0x3ebe63,null));}; \ No newline at end of file +var _0xda19=['map','rawAttributes','fieldName','type','model','query','keys','filters','attributes','intersection','fields','length','hasOwnProperty','order','sort','where','pick','merge','VIRTUAL','filter','options','CmHopperFinal','includeAll','findAll','catch','show','uniqueid','body','find','params','countContactsQueueCampaignHopperFinal','COUNT','sequelize','literal','`state`\x20=\x200,\x201,\x20null','noSuchContacts','`state`\x20=\x203,\x201,\x20null','noAnswerContacts','`state`\x20=\x205,\x201,\x20null','`state`\x20=\x208,\x201,\x20null','congestionContacts','dropContacts','`state`\x20=\x2011\x20,\x201,\x20null','abandonedContacts','reCallContacts','`state`\x20=\x2019,\x201,\x20null','countContactsIvrCampaignHopperFinal','busyContacts','`state`\x20=\x2010\x20,\x201,\x20null','`state`\x20=\x2022,\x201,\x20null','VoiceQueue','insert','fromQuery','phone','scheduledAt','VoiceQueueId','createdAt','updatedAt','ANY_VALUE(calleridnum)','field','NOW()','ANY_VALUE(ContactId)','ContactId','ANY_VALUE(ListId)','ANY_VALUE(VoiceQueueId)','from','state\x20=\x20?','state','toString','calleridnum\x20IS\x20NOT\x20NULL','calleridnum\x20NOT\x20IN\x20(?)','select','VoiceQueueId\x20=\x20?','cm_hopper_final','state\x20=\x204','group','moveContactsIvrCampaignHopperFinal','Campaign','cm_hopper','ListId','CampaignId','ANY_VALUE(CampaignId)','CampaignId\x20=\x20?','calleridnum','CmHopper','findOne','rimraf','zip-dir','request-promise','bluebird','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../mysqldb','sendStatus','status','offset','limit','undefined','count','set','Content-Range','json','apply','reject','save','update','then','destroy','end','name','send'];(function(_0x5bf42a,_0x3f6a6a){var _0x54c88e=function(_0x1b46af){while(--_0x1b46af){_0x5bf42a['push'](_0x5bf42a['shift']());}};_0x54c88e(++_0x3f6a6a);}(_0xda19,0xd5));var _0x9da1=function(_0x1e89b8,_0x140679){_0x1e89b8=_0x1e89b8-0x0;var _0x3ee0ab=_0xda19[_0x1e89b8];return _0x3ee0ab;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x9da1('0x0'));var zipdir=require(_0x9da1('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0x9da1('0x2'));var moment=require('moment');var BPromise=require(_0x9da1('0x3'));var Mustache=require('mustache');var util=require(_0x9da1('0x4'));var path=require(_0x9da1('0x5'));var sox=require(_0x9da1('0x6'));var csv=require(_0x9da1('0x7'));var ejs=require(_0x9da1('0x8'));var fs=require('fs');var fs_extra=require(_0x9da1('0x9'));var _=require(_0x9da1('0xa'));var squel=require(_0x9da1('0xb'));var crypto=require(_0x9da1('0xc'));var jsforce=require(_0x9da1('0xd'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x9da1('0xe'));var Redis=require('ioredis');var authService=require(_0x9da1('0xf'));var qs=require(_0x9da1('0x10'));var as=require(_0x9da1('0x11'));var hardwareService=require(_0x9da1('0x12'));var logger=require(_0x9da1('0x13'))(_0x9da1('0x14'));var utils=require(_0x9da1('0x15'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0x9da1('0x16'))['db'];function respondWithStatusCode(_0x596b6b,_0x4735c7){_0x4735c7=_0x4735c7||0xcc;return function(_0x1d93f8){if(_0x1d93f8){return _0x596b6b[_0x9da1('0x17')](_0x4735c7);}return _0x596b6b[_0x9da1('0x18')](_0x4735c7)['end']();};}function respondWithResult(_0x2837e3,_0x535a13){_0x535a13=_0x535a13||0xc8;return function(_0x4d17e1){if(_0x4d17e1){return _0x2837e3[_0x9da1('0x18')](_0x535a13)['json'](_0x4d17e1);}};}function respondWithFilteredResult(_0x433ff4,_0x43c093){return function(_0x37653d){if(_0x37653d){var _0x1a1a6b=typeof _0x43c093[_0x9da1('0x19')]==='undefined'&&typeof _0x43c093[_0x9da1('0x1a')]===_0x9da1('0x1b');var _0xf83bf8=_0x37653d[_0x9da1('0x1c')];var _0xfb278d=_0x1a1a6b?0x0:_0x43c093[_0x9da1('0x19')];var _0x497676=_0x1a1a6b?_0x37653d['count']:_0x43c093[_0x9da1('0x19')]+_0x43c093[_0x9da1('0x1a')];var _0x1b0e7f;if(_0x497676>=_0xf83bf8){_0x497676=_0xf83bf8;_0x1b0e7f=0xc8;}else{_0x1b0e7f=0xce;}_0x433ff4[_0x9da1('0x18')](_0x1b0e7f);return _0x433ff4[_0x9da1('0x1d')](_0x9da1('0x1e'),_0xfb278d+'-'+_0x497676+'/'+_0xf83bf8)[_0x9da1('0x1f')](_0x37653d);}return null;};}function patchUpdates(_0x47e5cf){return function(_0x1a459c){try{jsonpatch[_0x9da1('0x20')](_0x1a459c,_0x47e5cf,!![]);}catch(_0x9c3b37){return BPromise[_0x9da1('0x21')](_0x9c3b37);}return _0x1a459c[_0x9da1('0x22')]();};}function saveUpdates(_0x4e9d7d,_0x5454d3){return function(_0x14793b){if(_0x14793b){return _0x14793b[_0x9da1('0x23')](_0x4e9d7d)[_0x9da1('0x24')](function(_0x330219){return _0x330219;});}return null;};}function removeEntity(_0x32eb55,_0x165b73){return function(_0x4c60aa){if(_0x4c60aa){return _0x4c60aa[_0x9da1('0x25')]()[_0x9da1('0x24')](function(){_0x32eb55['status'](0xcc)[_0x9da1('0x26')]();});}};}function handleEntityNotFound(_0x3f5680,_0x534210){return function(_0x2fd49c){if(!_0x2fd49c){_0x3f5680[_0x9da1('0x17')](0x194);}return _0x2fd49c;};}function handleError(_0x4b1152,_0x36b87a){_0x36b87a=_0x36b87a||0x1f4;return function(_0x1d6af5){logger['error'](_0x1d6af5['stack']);if(_0x1d6af5[_0x9da1('0x27')]){delete _0x1d6af5[_0x9da1('0x27')];}_0x4b1152['status'](_0x36b87a)[_0x9da1('0x28')](_0x1d6af5);};}exports['index']=function(_0x5a6f2d,_0x5a59c2){var _0x31b826={},_0x404b86={},_0x24c6d5={'count':0x0,'rows':[]};var _0x26dd58=_[_0x9da1('0x29')](db['CmHopperFinal'][_0x9da1('0x2a')],function(_0x4e6083){return{'name':_0x4e6083[_0x9da1('0x2b')],'type':_0x4e6083[_0x9da1('0x2c')]['key']};});_0x404b86[_0x9da1('0x2d')]=_[_0x9da1('0x29')](_0x26dd58,'name');_0x404b86[_0x9da1('0x2e')]=_[_0x9da1('0x2f')](_0x5a6f2d[_0x9da1('0x2e')]);_0x404b86[_0x9da1('0x30')]=_['intersection'](_0x404b86['model'],_0x404b86[_0x9da1('0x2e')]);_0x31b826[_0x9da1('0x31')]=_[_0x9da1('0x32')](_0x404b86[_0x9da1('0x2d')],qs[_0x9da1('0x33')](_0x5a6f2d['query'][_0x9da1('0x33')]));_0x31b826[_0x9da1('0x31')]=_0x31b826[_0x9da1('0x31')][_0x9da1('0x34')]?_0x31b826[_0x9da1('0x31')]:_0x404b86[_0x9da1('0x2d')];if(!_0x5a6f2d['query'][_0x9da1('0x35')]('nolimit')){_0x31b826['limit']=qs[_0x9da1('0x1a')](_0x5a6f2d['query'][_0x9da1('0x1a')]);_0x31b826[_0x9da1('0x19')]=qs[_0x9da1('0x19')](_0x5a6f2d[_0x9da1('0x2e')][_0x9da1('0x19')]);}_0x31b826[_0x9da1('0x36')]=qs[_0x9da1('0x37')](_0x5a6f2d[_0x9da1('0x2e')]['sort']);_0x31b826[_0x9da1('0x38')]=qs['filters'](_[_0x9da1('0x39')](_0x5a6f2d['query'],_0x404b86['filters']),_0x26dd58);if(_0x5a6f2d[_0x9da1('0x2e')]['filter']){_0x31b826[_0x9da1('0x38')]=_[_0x9da1('0x3a')](_0x31b826['where'],{'$or':_[_0x9da1('0x29')](_0x26dd58,function(_0x1b750f){if(_0x1b750f[_0x9da1('0x2c')]!==_0x9da1('0x3b')){var _0x56bd49={};_0x56bd49[_0x1b750f[_0x9da1('0x27')]]={'$like':'%'+_0x5a6f2d['query'][_0x9da1('0x3c')]+'%'};return _0x56bd49;}})});}_0x31b826=_['merge']({},_0x31b826,_0x5a6f2d[_0x9da1('0x3d')]);var _0x46c176={'where':_0x31b826['where']};return db[_0x9da1('0x3e')][_0x9da1('0x1c')](_0x46c176)[_0x9da1('0x24')](function(_0x4e9af3){_0x24c6d5['count']=_0x4e9af3;if(_0x5a6f2d['query'][_0x9da1('0x3f')]){_0x31b826['include']=[{'all':!![]}];}return db[_0x9da1('0x3e')][_0x9da1('0x40')](_0x31b826);})[_0x9da1('0x24')](function(_0x43c064){_0x24c6d5['rows']=_0x43c064;return _0x24c6d5;})[_0x9da1('0x24')](respondWithFilteredResult(_0x5a59c2,_0x31b826))[_0x9da1('0x41')](handleError(_0x5a59c2,null));};exports[_0x9da1('0x42')]=function(_0x173dc6,_0x28fc88){var _0x26c225={'raw':!![],'where':{'id':_0x173dc6['params']['id']}},_0x28e0b2={};_0x28e0b2[_0x9da1('0x2d')]=_['keys'](db[_0x9da1('0x3e')]['rawAttributes']);_0x28e0b2[_0x9da1('0x2e')]=_[_0x9da1('0x2f')](_0x173dc6['query']);_0x28e0b2[_0x9da1('0x30')]=_[_0x9da1('0x32')](_0x28e0b2['model'],_0x28e0b2[_0x9da1('0x2e')]);_0x26c225['attributes']=_[_0x9da1('0x32')](_0x28e0b2[_0x9da1('0x2d')],qs['fields'](_0x173dc6['query'][_0x9da1('0x33')]));_0x26c225[_0x9da1('0x31')]=_0x26c225[_0x9da1('0x31')][_0x9da1('0x34')]?_0x26c225[_0x9da1('0x31')]:_0x28e0b2[_0x9da1('0x2d')];if(_0x173dc6[_0x9da1('0x2e')][_0x9da1('0x3f')]){_0x26c225['include']=[{'all':!![]}];}_0x26c225=_[_0x9da1('0x3a')]({},_0x26c225,_0x173dc6[_0x9da1('0x3d')]);return db[_0x9da1('0x3e')]['find'](_0x26c225)[_0x9da1('0x24')](handleEntityNotFound(_0x28fc88,null))[_0x9da1('0x24')](respondWithResult(_0x28fc88,null))[_0x9da1('0x41')](handleError(_0x28fc88,null));};exports['describe']=function(_0x336fc3,_0x351d4d){return db[_0x9da1('0x3e')]['describe']()[_0x9da1('0x24')](respondWithResult(_0x351d4d,null))['catch'](handleError(_0x351d4d,null));};exports['update']=function(_0xfbdde9,_0x43c47d){if(_0xfbdde9['body'][_0x9da1('0x43')]){delete _0xfbdde9[_0x9da1('0x44')]['uniqueid'];}return db[_0x9da1('0x3e')][_0x9da1('0x45')]({'where':{'uniqueid':_0xfbdde9[_0x9da1('0x46')]['id']}})[_0x9da1('0x24')](handleEntityNotFound(_0x43c47d,null))[_0x9da1('0x24')](saveUpdates(_0xfbdde9[_0x9da1('0x44')],null))[_0x9da1('0x24')](respondWithResult(_0x43c47d,null))[_0x9da1('0x41')](handleError(_0x43c47d,null));};exports[_0x9da1('0x47')]=function(_0x5c9b46,_0x147c65,_0xe6c667){return db[_0x9da1('0x3e')][_0x9da1('0x40')]({'raw':![],'where':{'VoiceQueueId':_0x5c9b46['params']['id']},'attributes':[[db['sequelize']['fn'](_0x9da1('0x48'),db[_0x9da1('0x49')]['fn']('IF',db[_0x9da1('0x49')][_0x9da1('0x4a')](_0x9da1('0x4b')))),_0x9da1('0x4c')],[db[_0x9da1('0x49')]['fn'](_0x9da1('0x48'),db[_0x9da1('0x49')]['fn']('IF',db[_0x9da1('0x49')][_0x9da1('0x4a')](_0x9da1('0x4d')))),_0x9da1('0x4e')],[db[_0x9da1('0x49')]['fn']('COUNT',db[_0x9da1('0x49')]['fn']('IF',db[_0x9da1('0x49')]['literal'](_0x9da1('0x4f')))),'busyContacts'],[db[_0x9da1('0x49')]['fn']('COUNT',db[_0x9da1('0x49')]['fn']('IF',db[_0x9da1('0x49')][_0x9da1('0x4a')](_0x9da1('0x50')))),_0x9da1('0x51')],[db[_0x9da1('0x49')]['fn'](_0x9da1('0x48'),db[_0x9da1('0x49')]['fn']('IF',db[_0x9da1('0x49')][_0x9da1('0x4a')]('`state`\x20=\x2010\x20,\x201,\x20null'))),_0x9da1('0x52')],[db[_0x9da1('0x49')]['fn'](_0x9da1('0x48'),db[_0x9da1('0x49')]['fn']('IF',db[_0x9da1('0x49')][_0x9da1('0x4a')](_0x9da1('0x53')))),_0x9da1('0x54')],[db[_0x9da1('0x49')]['fn'](_0x9da1('0x48'),db['sequelize']['fn']('IF',db[_0x9da1('0x49')][_0x9da1('0x4a')]('`state`\x20=\x2022,\x201,\x20null'))),_0x9da1('0x55')],[db[_0x9da1('0x49')]['fn'](_0x9da1('0x48'),db[_0x9da1('0x49')]['fn']('IF',db[_0x9da1('0x49')][_0x9da1('0x4a')](_0x9da1('0x56')))),'answeringMachine']]})[_0x9da1('0x24')](handleEntityNotFound(_0x147c65,null))[_0x9da1('0x24')](respondWithResult(_0x147c65,null))[_0x9da1('0x41')](handleError(_0x147c65,null));};exports[_0x9da1('0x57')]=function(_0x562e05,_0x1a9df0,_0x5c236e){return db[_0x9da1('0x3e')][_0x9da1('0x40')]({'raw':![],'where':{'CampaignId':_0x562e05[_0x9da1('0x46')]['id']},'attributes':[[db[_0x9da1('0x49')]['fn'](_0x9da1('0x48'),db[_0x9da1('0x49')]['fn']('IF',db['sequelize']['literal'](_0x9da1('0x4b')))),'noSuchContacts'],[db['sequelize']['fn']('COUNT',db[_0x9da1('0x49')]['fn']('IF',db['sequelize'][_0x9da1('0x4a')]('`state`\x20=\x203,\x201,\x20null'))),_0x9da1('0x4e')],[db[_0x9da1('0x49')]['fn']('COUNT',db[_0x9da1('0x49')]['fn']('IF',db[_0x9da1('0x49')]['literal'](_0x9da1('0x4f')))),_0x9da1('0x58')],[db['sequelize']['fn']('COUNT',db[_0x9da1('0x49')]['fn']('IF',db[_0x9da1('0x49')][_0x9da1('0x4a')](_0x9da1('0x50')))),_0x9da1('0x51')],[db[_0x9da1('0x49')]['fn']('COUNT',db[_0x9da1('0x49')]['fn']('IF',db['sequelize']['literal'](_0x9da1('0x59')))),_0x9da1('0x52')],[db[_0x9da1('0x49')]['fn'](_0x9da1('0x48'),db[_0x9da1('0x49')]['fn']('IF',db[_0x9da1('0x49')][_0x9da1('0x4a')](_0x9da1('0x53')))),_0x9da1('0x54')],[db['sequelize']['fn'](_0x9da1('0x48'),db[_0x9da1('0x49')]['fn']('IF',db[_0x9da1('0x49')][_0x9da1('0x4a')](_0x9da1('0x5a')))),'reCallContacts'],[db[_0x9da1('0x49')]['fn'](_0x9da1('0x48'),db[_0x9da1('0x49')]['fn']('IF',db[_0x9da1('0x49')][_0x9da1('0x4a')](_0x9da1('0x56')))),'answeringMachine']]})[_0x9da1('0x24')](handleEntityNotFound(_0x1a9df0,null))['then'](respondWithResult(_0x1a9df0,null))[_0x9da1('0x41')](handleError(_0x1a9df0,null));};exports['moveContactsQueueCampaignHopperFinal']=function(_0x7cfa7e,_0xdd3997,_0x44b6c0){return db[_0x9da1('0x5b')]['find']({'where':{'id':_0x7cfa7e['params']['id']}})['then'](handleEntityNotFound(_0xdd3997,null))[_0x9da1('0x24')](function(_0x2b1a71){var _0x266533;if(_0x2b1a71){_0x266533=squel[_0x9da1('0x5c')]()['into']('cm_hopper')[_0x9da1('0x5d')]([_0x9da1('0x5e'),_0x9da1('0x5f'),'ContactId','ListId',_0x9da1('0x60'),_0x9da1('0x61'),_0x9da1('0x62')],squel['select']()['field'](_0x9da1('0x63'),_0x9da1('0x5e'))[_0x9da1('0x64')](_0x9da1('0x65'),_0x9da1('0x5f'))['field'](_0x9da1('0x66'),_0x9da1('0x67'))[_0x9da1('0x64')](_0x9da1('0x68'),'ListId')[_0x9da1('0x64')](_0x9da1('0x69'),_0x9da1('0x60'))['field'](_0x9da1('0x65'),_0x9da1('0x61'))[_0x9da1('0x64')]('NOW()',_0x9da1('0x62'))[_0x9da1('0x6a')]('cm_hopper_final')[_0x9da1('0x38')]('VoiceQueueId\x20=\x20?',_0x7cfa7e[_0x9da1('0x46')]['id']['toString']())[_0x9da1('0x38')](_0x9da1('0x6b'),_0x7cfa7e[_0x9da1('0x44')][_0x9da1('0x6c')][_0x9da1('0x6d')]())[_0x9da1('0x38')](_0x9da1('0x6e'))[_0x9da1('0x38')](_0x9da1('0x6f'),squel[_0x9da1('0x70')]()[_0x9da1('0x64')](_0x9da1('0x5e'))[_0x9da1('0x6a')]('cm_hopper')[_0x9da1('0x38')](_0x9da1('0x71'),_0x7cfa7e[_0x9da1('0x46')]['id'][_0x9da1('0x6d')]()))[_0x9da1('0x38')]('calleridnum\x20NOT\x20IN\x20(?)',squel[_0x9da1('0x70')]()[_0x9da1('0x64')]('calleridnum')['from'](_0x9da1('0x72'))[_0x9da1('0x38')](_0x9da1('0x71'),_0x7cfa7e[_0x9da1('0x46')]['id'][_0x9da1('0x6d')]())[_0x9da1('0x38')](_0x9da1('0x73')))[_0x9da1('0x74')](_0x9da1('0x67')))[_0x9da1('0x6d')]();return db[_0x9da1('0x49')][_0x9da1('0x2e')](_0x266533);}return[];})[_0x9da1('0x24')](respondWithResult(_0xdd3997,null))['catch'](handleError(_0xdd3997,null));};exports[_0x9da1('0x75')]=function(_0x3a0a84,_0x3f9782,_0x30b6fc){return db[_0x9da1('0x76')]['find']({'where':{'id':_0x3a0a84[_0x9da1('0x46')]['id']}})[_0x9da1('0x24')](handleEntityNotFound(_0x3f9782,null))['then'](function(_0x33b625){var _0x5a0533;if(_0x33b625){_0x5a0533=squel[_0x9da1('0x5c')]()['into'](_0x9da1('0x77'))[_0x9da1('0x5d')]([_0x9da1('0x5e'),_0x9da1('0x5f'),_0x9da1('0x67'),_0x9da1('0x78'),_0x9da1('0x79'),_0x9da1('0x61'),_0x9da1('0x62')],squel[_0x9da1('0x70')]()[_0x9da1('0x64')](_0x9da1('0x63'),'phone')[_0x9da1('0x64')](_0x9da1('0x65'),_0x9da1('0x5f'))[_0x9da1('0x64')](_0x9da1('0x66'),_0x9da1('0x67'))['field']('ANY_VALUE(ListId)',_0x9da1('0x78'))[_0x9da1('0x64')](_0x9da1('0x7a'),'CampaignId')[_0x9da1('0x64')](_0x9da1('0x65'),_0x9da1('0x61'))[_0x9da1('0x64')](_0x9da1('0x65'),_0x9da1('0x62'))[_0x9da1('0x6a')]('cm_hopper_final')[_0x9da1('0x38')](_0x9da1('0x7b'),_0x3a0a84['params']['id']['toString']())[_0x9da1('0x38')]('state\x20=\x20?',_0x3a0a84['body'][_0x9da1('0x6c')][_0x9da1('0x6d')]())[_0x9da1('0x38')](_0x9da1('0x6e'))[_0x9da1('0x38')](_0x9da1('0x6f'),squel[_0x9da1('0x70')]()[_0x9da1('0x64')]('phone')['from'](_0x9da1('0x77'))[_0x9da1('0x38')](_0x9da1('0x7b'),_0x3a0a84[_0x9da1('0x46')]['id'][_0x9da1('0x6d')]()))[_0x9da1('0x38')](_0x9da1('0x6f'),squel[_0x9da1('0x70')]()['field'](_0x9da1('0x7c'))['from'](_0x9da1('0x72'))[_0x9da1('0x38')](_0x9da1('0x7b'),_0x3a0a84[_0x9da1('0x46')]['id'][_0x9da1('0x6d')]())[_0x9da1('0x38')](_0x9da1('0x73')))['group'](_0x9da1('0x67')))['toString']();return db[_0x9da1('0x49')][_0x9da1('0x2e')](_0x5a0533);}return[];})[_0x9da1('0x24')](respondWithResult(_0x3f9782,null))[_0x9da1('0x41')](handleError(_0x3f9782,null));};exports['checkContactHopper']=function(_0x3310af,_0x1f93bf,_0x2afe1e){return db[_0x9da1('0x7d')][_0x9da1('0x7e')]({'where':{'VoiceQueueId':_0x3310af[_0x9da1('0x44')][_0x9da1('0x60')],'CampaignId':_0x3310af[_0x9da1('0x44')][_0x9da1('0x79')],'ContactId':_0x3310af[_0x9da1('0x44')][_0x9da1('0x67')]}})[_0x9da1('0x24')](handleEntityNotFound(_0x1f93bf,null))[_0x9da1('0x24')](function(_0x32ff53){if(_0x32ff53){return _0x32ff53;}return null;})['then'](respondWithResult(_0x1f93bf,null))[_0x9da1('0x41')](handleError(_0x1f93bf,null));}; \ No newline at end of file diff --git a/server/api/cmHopperFinal/cmHopperFinal.model.js b/server/api/cmHopperFinal/cmHopperFinal.model.js index 09677c3..a391ca5 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 _0xaee3=['path','rimraf','../../config/environment','./cmHopperFinal.attributes','exports','cm_hopper_final','calleridnum','uniqueid','util','../../config/logger','api','moment','bluebird','request-promise'];(function(_0x3fd275,_0xf0cd7){var _0xe4f14f=function(_0x23971d){while(--_0x23971d){_0x3fd275['push'](_0x3fd275['shift']());}};_0xe4f14f(++_0xf0cd7);}(_0xaee3,0x190));var _0x3aee=function(_0xdd82b4,_0x5cd8b8){_0xdd82b4=_0xdd82b4-0x0;var _0x549bb2=_0xaee3[_0xdd82b4];return _0x549bb2;};'use strict';var _=require('lodash');var util=require(_0x3aee('0x0'));var logger=require(_0x3aee('0x1'))(_0x3aee('0x2'));var moment=require(_0x3aee('0x3'));var BPromise=require(_0x3aee('0x4'));var rp=require(_0x3aee('0x5'));var fs=require('fs');var path=require(_0x3aee('0x6'));var rimraf=require(_0x3aee('0x7'));var config=require(_0x3aee('0x8'));var attributes=require(_0x3aee('0x9'));module[_0x3aee('0xa')]=function(_0x101df5,_0x474374){return _0x101df5['define']('CmHopperFinal',attributes,{'tableName':_0x3aee('0xb'),'paranoid':![],'indexes':[{'name':_0x3aee('0xc'),'fields':[_0x3aee('0xc')]},{'name':_0x3aee('0xd'),'fields':[_0x3aee('0xd')]}],'timestamps':!![]});}; \ No newline at end of file +var _0x95f1=['path','rimraf','../../config/environment','./cmHopperFinal.attributes','exports','CmHopperFinal','cm_hopper_final','calleridnum','uniqueid','lodash','../../config/logger','api','moment','bluebird','request-promise'];(function(_0x2e4aa2,_0x11956a){var _0x5e6092=function(_0x4c12c2){while(--_0x4c12c2){_0x2e4aa2['push'](_0x2e4aa2['shift']());}};_0x5e6092(++_0x11956a);}(_0x95f1,0xdb));var _0x195f=function(_0x2c91e9,_0x2fb965){_0x2c91e9=_0x2c91e9-0x0;var _0x13f0ff=_0x95f1[_0x2c91e9];return _0x13f0ff;};'use strict';var _=require(_0x195f('0x0'));var util=require('util');var logger=require(_0x195f('0x1'))(_0x195f('0x2'));var moment=require(_0x195f('0x3'));var BPromise=require(_0x195f('0x4'));var rp=require(_0x195f('0x5'));var fs=require('fs');var path=require(_0x195f('0x6'));var rimraf=require(_0x195f('0x7'));var config=require(_0x195f('0x8'));var attributes=require(_0x195f('0x9'));module[_0x195f('0xa')]=function(_0x3e4e9f,_0x2f084d){return _0x3e4e9f['define'](_0x195f('0xb'),attributes,{'tableName':_0x195f('0xc'),'paranoid':![],'indexes':[{'name':_0x195f('0xd'),'fields':[_0x195f('0xd')]},{'name':_0x195f('0xe'),'fields':[_0x195f('0xe')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/cmHopperFinal/cmHopperFinal.rpc.js b/server/api/cmHopperFinal/cmHopperFinal.rpc.js index f93e93b..b61af24 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 _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(_0x17cd1a,_0x514190){var _0x480fc8=function(_0x55ae4e){while(--_0x55ae4e){_0x17cd1a['push'](_0x17cd1a['shift']());}};_0x480fc8(++_0x514190);}(_0x7a54,0x106));var _0x47a5=function(_0x418c87,_0x27ec5b){_0x418c87=_0x418c87-0x0;var _0x54eba6=_0x7a54[_0x418c87];return _0x54eba6;};'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 +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(_0x5a5939,_0x50fe0a){var _0x3d04fd=function(_0x1add9e){while(--_0x1add9e){_0x5a5939['push'](_0x5a5939['shift']());}};_0x3d04fd(++_0x50fe0a);}(_0xb10b,0x12a));var _0xbb10=function(_0x4e54e9,_0x40a2b7){_0x4e54e9=_0x4e54e9-0x0;var _0x32be8f=_0xb10b[_0x4e54e9];return _0x32be8f;};'use strict';var _=require(_0xbb10('0x0'));var util=require('util');var moment=require(_0xbb10('0x1'));var BPromise=require(_0xbb10('0x2'));var rs=require(_0xbb10('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xbb10('0x4'))['db'];var utils=require(_0xbb10('0x5'));var logger=require(_0xbb10('0x6'))(_0xbb10('0x7'));var config=require(_0xbb10('0x8'));var jayson=require(_0xbb10('0x9'));var client=jayson['client'][_0xbb10('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x3cdd53,_0x513741,_0x1b9e94){return new BPromise(function(_0x3fb675,_0x21370f){return client[_0xbb10('0xb')](_0x3cdd53,_0x1b9e94)[_0xbb10('0xc')](function(_0x1ce33e){logger[_0xbb10('0xd')](_0xbb10('0xe'),_0x513741,'request\x20sent');logger['debug'](_0xbb10('0xf'),_0x513741,_0xbb10('0x10'),JSON[_0xbb10('0x11')](_0x1ce33e));if(_0x1ce33e['error']){if(_0x1ce33e[_0xbb10('0x12')]['code']===0x1f4){logger[_0xbb10('0x12')](_0xbb10('0xe'),_0x513741,_0x1ce33e[_0xbb10('0x12')][_0xbb10('0x13')]);return _0x21370f(_0x1ce33e[_0xbb10('0x12')][_0xbb10('0x13')]);}logger['error'](_0xbb10('0xe'),_0x513741,_0x1ce33e[_0xbb10('0x12')][_0xbb10('0x13')]);return _0x3fb675(_0x1ce33e[_0xbb10('0x12')][_0xbb10('0x13')]);}else{logger[_0xbb10('0xd')](_0xbb10('0xe'),_0x513741,_0xbb10('0x10'));_0x3fb675(_0x1ce33e[_0xbb10('0x14')][_0xbb10('0x13')]);}})['catch'](function(_0x2eca0f){logger[_0xbb10('0x12')](_0xbb10('0xe'),_0x513741,_0x2eca0f);_0x21370f(_0x2eca0f);});});}exports[_0xbb10('0x15')]=function(_0x378da8){var _0x1682a4=this;return new Promise(function(_0x575cca,_0x30efc6){return db[_0xbb10('0x16')][_0xbb10('0x17')](_0x378da8['body'],{'raw':_0x378da8[_0xbb10('0x18')]?_0x378da8[_0xbb10('0x18')][_0xbb10('0x19')]===undefined?!![]:![]:!![]})[_0xbb10('0xc')](function(_0xdf237d){logger[_0xbb10('0xd')]('CreateCmHopperFinal',_0x378da8);logger[_0xbb10('0x1a')](_0xbb10('0x15'),_0x378da8,JSON['stringify'](_0xdf237d));_0x575cca(_0xdf237d);})['catch'](function(_0x8e2b97){logger[_0xbb10('0x12')](_0xbb10('0x15'),_0x8e2b97[_0xbb10('0x13')],_0x378da8);_0x30efc6(_0x1682a4[_0xbb10('0x12')](0x1f4,_0x8e2b97[_0xbb10('0x13')]));});});}; \ No newline at end of file diff --git a/server/api/cmHopperFinal/index.js b/server/api/cmHopperFinal/index.js index 39eb7d1..babfe9b 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 _0xd592=['get','isAuthenticated','index','/describe','describe','/:id','show','/voice/queue/countAttributes/:id','countContactsQueueCampaignHopperFinal','/campaign/countAttributes/:id','/voice/campaign/moveContacts/:id','moveContactsIvrCampaignHopperFinal','post','/checkContactHopper','put','update','exports','multer','util','path','Router','fs-extra','../../components/interaction/service','../../config/environment','./cmHopperFinal.controller'];(function(_0x5d5c06,_0x5e97f6){var _0x2ccc0d=function(_0x5e1db9){while(--_0x5e1db9){_0x5d5c06['push'](_0x5d5c06['shift']());}};_0x2ccc0d(++_0x5e97f6);}(_0xd592,0x1ec));var _0x2d59=function(_0x358051,_0x15e552){_0x358051=_0x358051-0x0;var _0x36c56b=_0xd592[_0x358051];return _0x36c56b;};'use strict';var multer=require(_0x2d59('0x0'));var util=require(_0x2d59('0x1'));var path=require(_0x2d59('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x2d59('0x3')]();var fs_extra=require(_0x2d59('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0x2d59('0x5'));var config=require(_0x2d59('0x6'));var controller=require(_0x2d59('0x7'));router[_0x2d59('0x8')]('/',auth[_0x2d59('0x9')](),controller[_0x2d59('0xa')]);router[_0x2d59('0x8')](_0x2d59('0xb'),auth[_0x2d59('0x9')](),controller[_0x2d59('0xc')]);router['get'](_0x2d59('0xd'),auth[_0x2d59('0x9')](),controller[_0x2d59('0xe')]);router[_0x2d59('0x8')](_0x2d59('0xf'),auth[_0x2d59('0x9')](),controller[_0x2d59('0x10')]);router[_0x2d59('0x8')](_0x2d59('0x11'),auth[_0x2d59('0x9')](),controller['countContactsIvrCampaignHopperFinal']);router['post']('/voice/queue/moveContacts/:id',auth[_0x2d59('0x9')](),controller['moveContactsQueueCampaignHopperFinal']);router['post'](_0x2d59('0x12'),auth['isAuthenticated'](),controller[_0x2d59('0x13')]);router[_0x2d59('0x14')](_0x2d59('0x15'),auth[_0x2d59('0x9')](),controller['checkContactHopper']);router[_0x2d59('0x16')](_0x2d59('0xd'),auth[_0x2d59('0x9')](),controller[_0x2d59('0x17')]);module[_0x2d59('0x18')]=router; \ No newline at end of file +var _0x327b=['exports','multer','util','path','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','index','/describe','isAuthenticated','describe','get','/:id','show','/voice/queue/countAttributes/:id','countContactsQueueCampaignHopperFinal','countContactsIvrCampaignHopperFinal','post','/voice/queue/moveContacts/:id','moveContactsQueueCampaignHopperFinal','/voice/campaign/moveContacts/:id','checkContactHopper','put'];(function(_0x1da191,_0x1a0669){var _0x33f8a9=function(_0xac0e00){while(--_0xac0e00){_0x1da191['push'](_0x1da191['shift']());}};_0x33f8a9(++_0x1a0669);}(_0x327b,0xfb));var _0xb327=function(_0x2235bf,_0x3a06a7){_0x2235bf=_0x2235bf-0x0;var _0x4c3a64=_0x327b[_0x2235bf];return _0x4c3a64;};'use strict';var multer=require(_0xb327('0x0'));var util=require(_0xb327('0x1'));var path=require(_0xb327('0x2'));var timeout=require('connect-timeout');var express=require(_0xb327('0x3'));var router=express[_0xb327('0x4')]();var fs_extra=require(_0xb327('0x5'));var auth=require(_0xb327('0x6'));var interaction=require(_0xb327('0x7'));var config=require('../../config/environment');var controller=require('./cmHopperFinal.controller');router['get']('/',auth['isAuthenticated'](),controller[_0xb327('0x8')]);router['get'](_0xb327('0x9'),auth[_0xb327('0xa')](),controller[_0xb327('0xb')]);router[_0xb327('0xc')](_0xb327('0xd'),auth[_0xb327('0xa')](),controller[_0xb327('0xe')]);router[_0xb327('0xc')](_0xb327('0xf'),auth[_0xb327('0xa')](),controller[_0xb327('0x10')]);router[_0xb327('0xc')]('/campaign/countAttributes/:id',auth[_0xb327('0xa')](),controller[_0xb327('0x11')]);router[_0xb327('0x12')](_0xb327('0x13'),auth[_0xb327('0xa')](),controller[_0xb327('0x14')]);router[_0xb327('0x12')](_0xb327('0x15'),auth[_0xb327('0xa')](),controller['moveContactsIvrCampaignHopperFinal']);router[_0xb327('0x12')]('/checkContactHopper',auth[_0xb327('0xa')](),controller[_0xb327('0x16')]);router[_0xb327('0x17')]('/:id',auth[_0xb327('0xa')](),controller['update']);module[_0xb327('0x18')]=router; \ No newline at end of file diff --git a/server/api/cmHopperHistory/cmHopperHistory.attributes.js b/server/api/cmHopperHistory/cmHopperHistory.attributes.js index c7ee8af..176e1d5 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 _0xcac3=['STRING','DATE','BOOLEAN','exports','INTEGER'];(function(_0x8db5d8,_0x289e68){var _0x3490ec=function(_0x5dd98b){while(--_0x5dd98b){_0x8db5d8['push'](_0x8db5d8['shift']());}};_0x3490ec(++_0x289e68);}(_0xcac3,0x193));var _0x3cac=function(_0x527bdf,_0x20bd3a){_0x527bdf=_0x527bdf-0x0;var _0x33abdf=_0xcac3[_0x527bdf];return _0x33abdf;};'use strict';var Sequelize=require('sequelize');module[_0x3cac('0x0')]={'state':{'type':Sequelize[_0x3cac('0x1')](0x2)},'statedesc':{'type':Sequelize[_0x3cac('0x2')]},'scheduledat':{'type':Sequelize[_0x3cac('0x3')]},'countbusyretry':{'type':Sequelize[_0x3cac('0x1')],'defaultValue':0x0},'countcongestionretry':{'type':Sequelize[_0x3cac('0x1')],'defaultValue':0x0},'countnoanswerretry':{'type':Sequelize[_0x3cac('0x1')],'defaultValue':0x0},'countglobal':{'type':Sequelize[_0x3cac('0x1')],'defaultValue':0x0},'uniqueid':{'type':Sequelize[_0x3cac('0x2')]},'originatecalleridnum':{'type':Sequelize[_0x3cac('0x2')]},'originatecalleridname':{'type':Sequelize[_0x3cac('0x2')]},'calleridnum':{'type':Sequelize[_0x3cac('0x2')]},'calleridname':{'type':Sequelize[_0x3cac('0x2')]},'starttime':{'type':Sequelize[_0x3cac('0x3')]},'responsetime':{'type':Sequelize[_0x3cac('0x3')]},'answertime':{'type':Sequelize[_0x3cac('0x3')]},'droptime':{'type':Sequelize[_0x3cac('0x3')]},'endtime':{'type':Sequelize['DATE']},'ringtime':{'type':Sequelize[_0x3cac('0x1')],'defaultValue':0x0},'holdtime':{'type':Sequelize[_0x3cac('0x1')],'defaultValue':0x0},'talktime':{'type':Sequelize[_0x3cac('0x1')],'defaultValue':0x0},'followuptime':{'type':Sequelize[_0x3cac('0x1')],'defaultValue':0x0},'dropreason':{'type':Sequelize[_0x3cac('0x2')]},'campaign':{'type':Sequelize['STRING']},'campaigntype':{'type':Sequelize[_0x3cac('0x2')]},'membername':{'type':Sequelize[_0x3cac('0x2')]},'reason':{'type':Sequelize[_0x3cac('0x2')]},'amd':{'type':Sequelize[_0x3cac('0x4')],'defaultValue':![]},'fax':{'type':Sequelize[_0x3cac('0x4')],'defaultValue':![]},'callback':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'callbackuniqueid':{'type':Sequelize['STRING'],'defaultValue':null},'callbackat':{'type':Sequelize[_0x3cac('0x3')]},'recallme':{'type':Sequelize[_0x3cac('0x4')],'defaultValue':![]},'editedat':{'type':Sequelize[_0x3cac('0x3')]},'edited':{'type':Sequelize[_0x3cac('0x4')],'defaultValue':![]},'countnosuchnumberretry':{'type':Sequelize[_0x3cac('0x1')],'defaultValue':0x0},'countdropretry':{'type':Sequelize[_0x3cac('0x1')],'defaultValue':0x0},'countabandonedretry':{'type':Sequelize[_0x3cac('0x1')],'defaultValue':0x0},'countmachineretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countagentrejectretry':{'type':Sequelize[_0x3cac('0x1')],'defaultValue':0x0},'dialTimezone':{'type':Sequelize[_0x3cac('0x2')]}}; \ No newline at end of file +var _0x6b4c=['DATE','BOOLEAN','sequelize','exports','INTEGER','STRING'];(function(_0x21492b,_0x272e66){var _0x1166b4=function(_0x9d23f4){while(--_0x9d23f4){_0x21492b['push'](_0x21492b['shift']());}};_0x1166b4(++_0x272e66);}(_0x6b4c,0x8c));var _0xc6b4=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x6b4c[_0x3dd15e];return _0x231fd0;};'use strict';var Sequelize=require(_0xc6b4('0x0'));module[_0xc6b4('0x1')]={'state':{'type':Sequelize[_0xc6b4('0x2')](0x2)},'statedesc':{'type':Sequelize[_0xc6b4('0x3')]},'scheduledat':{'type':Sequelize[_0xc6b4('0x4')]},'countbusyretry':{'type':Sequelize[_0xc6b4('0x2')],'defaultValue':0x0},'countcongestionretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countnoanswerretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countglobal':{'type':Sequelize[_0xc6b4('0x2')],'defaultValue':0x0},'uniqueid':{'type':Sequelize[_0xc6b4('0x3')]},'originatecalleridnum':{'type':Sequelize[_0xc6b4('0x3')]},'originatecalleridname':{'type':Sequelize['STRING']},'calleridnum':{'type':Sequelize[_0xc6b4('0x3')]},'calleridname':{'type':Sequelize[_0xc6b4('0x3')]},'starttime':{'type':Sequelize[_0xc6b4('0x4')]},'responsetime':{'type':Sequelize[_0xc6b4('0x4')]},'answertime':{'type':Sequelize[_0xc6b4('0x4')]},'droptime':{'type':Sequelize[_0xc6b4('0x4')]},'endtime':{'type':Sequelize['DATE']},'ringtime':{'type':Sequelize[_0xc6b4('0x2')],'defaultValue':0x0},'holdtime':{'type':Sequelize[_0xc6b4('0x2')],'defaultValue':0x0},'talktime':{'type':Sequelize[_0xc6b4('0x2')],'defaultValue':0x0},'followuptime':{'type':Sequelize[_0xc6b4('0x2')],'defaultValue':0x0},'dropreason':{'type':Sequelize[_0xc6b4('0x3')]},'campaign':{'type':Sequelize[_0xc6b4('0x3')]},'campaigntype':{'type':Sequelize[_0xc6b4('0x3')]},'membername':{'type':Sequelize[_0xc6b4('0x3')]},'reason':{'type':Sequelize[_0xc6b4('0x3')]},'amd':{'type':Sequelize[_0xc6b4('0x5')],'defaultValue':![]},'fax':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'callback':{'type':Sequelize[_0xc6b4('0x5')],'defaultValue':![]},'callbackuniqueid':{'type':Sequelize[_0xc6b4('0x3')],'defaultValue':null},'callbackat':{'type':Sequelize[_0xc6b4('0x4')]},'recallme':{'type':Sequelize[_0xc6b4('0x5')],'defaultValue':![]},'editedat':{'type':Sequelize[_0xc6b4('0x4')]},'edited':{'type':Sequelize[_0xc6b4('0x5')],'defaultValue':![]},'countnosuchnumberretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countdropretry':{'type':Sequelize[_0xc6b4('0x2')],'defaultValue':0x0},'countabandonedretry':{'type':Sequelize[_0xc6b4('0x2')],'defaultValue':0x0},'countmachineretry':{'type':Sequelize[_0xc6b4('0x2')],'defaultValue':0x0},'countagentrejectretry':{'type':Sequelize[_0xc6b4('0x2')],'defaultValue':0x0},'dialTimezone':{'type':Sequelize[_0xc6b4('0x3')]}}; \ No newline at end of file diff --git a/server/api/cmHopperHistory/cmHopperHistory.controller.js b/server/api/cmHopperHistory/cmHopperHistory.controller.js index 3fdc7ac..68d7f2d 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 _0x16cc=['save','update','then','error','name','index','map','CmHopperHistory','rawAttributes','fieldName','type','key','keys','query','filters','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','sort','where','merge','VIRTUAL','includeAll','include','findAll','rows','params','options','find','catch','create','body','uniqueid','zip-dir','fast-json-patch','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','jsforce','desk.js','papaparse','ioredis','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','Content-Range','apply','reject'];(function(_0x27d6c5,_0x4c0e92){var _0x51fba6=function(_0xc58e1a){while(--_0xc58e1a){_0x27d6c5['push'](_0x27d6c5['shift']());}};_0x51fba6(++_0x4c0e92);}(_0x16cc,0xb5));var _0xc16c=function(_0x4f8ad6,_0x25fbb2){_0x4f8ad6=_0x4f8ad6-0x0;var _0x55561e=_0x16cc[_0x4f8ad6];return _0x55561e;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0xc16c('0x0'));var jsonpatch=require(_0xc16c('0x1'));var rp=require('request-promise');var moment=require(_0xc16c('0x2'));var BPromise=require(_0xc16c('0x3'));var Mustache=require(_0xc16c('0x4'));var util=require(_0xc16c('0x5'));var path=require(_0xc16c('0x6'));var sox=require(_0xc16c('0x7'));var csv=require(_0xc16c('0x8'));var ejs=require(_0xc16c('0x9'));var fs=require('fs');var fs_extra=require(_0xc16c('0xa'));var _=require(_0xc16c('0xb'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0xc16c('0xc'));var deskjs=require(_0xc16c('0xd'));var toCsv=require(_0xc16c('0x8'));var querystring=require('querystring');var Papa=require(_0xc16c('0xe'));var Redis=require(_0xc16c('0xf'));var authService=require('../../components/auth/service');var qs=require(_0xc16c('0x10'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xc16c('0x11'));var logger=require(_0xc16c('0x12'))(_0xc16c('0x13'));var utils=require(_0xc16c('0x14'));var config=require(_0xc16c('0x15'));var licenseUtil=require(_0xc16c('0x16'));var db=require(_0xc16c('0x17'))['db'];function respondWithStatusCode(_0x59f30f,_0x20b9ba){_0x20b9ba=_0x20b9ba||0xcc;return function(_0x372648){if(_0x372648){return _0x59f30f[_0xc16c('0x18')](_0x20b9ba);}return _0x59f30f[_0xc16c('0x19')](_0x20b9ba)[_0xc16c('0x1a')]();};}function respondWithResult(_0x40ea97,_0x43be21){_0x43be21=_0x43be21||0xc8;return function(_0x1efc95){if(_0x1efc95){return _0x40ea97[_0xc16c('0x19')](_0x43be21)[_0xc16c('0x1b')](_0x1efc95);}};}function respondWithFilteredResult(_0x115840,_0x429268){return function(_0x2333c5){if(_0x2333c5){var _0x46d10f=typeof _0x429268[_0xc16c('0x1c')]===_0xc16c('0x1d')&&typeof _0x429268[_0xc16c('0x1e')]===_0xc16c('0x1d');var _0x503444=_0x2333c5['count'];var _0x48b9ac=_0x46d10f?0x0:_0x429268[_0xc16c('0x1c')];var _0x2df6f8=_0x46d10f?_0x2333c5[_0xc16c('0x1f')]:_0x429268[_0xc16c('0x1c')]+_0x429268[_0xc16c('0x1e')];var _0x703ab2;if(_0x2df6f8>=_0x503444){_0x2df6f8=_0x503444;_0x703ab2=0xc8;}else{_0x703ab2=0xce;}_0x115840[_0xc16c('0x19')](_0x703ab2);return _0x115840['set'](_0xc16c('0x20'),_0x48b9ac+'-'+_0x2df6f8+'/'+_0x503444)['json'](_0x2333c5);}return null;};}function patchUpdates(_0x2c8a65){return function(_0x320a15){try{jsonpatch[_0xc16c('0x21')](_0x320a15,_0x2c8a65,!![]);}catch(_0x1b6a75){return BPromise[_0xc16c('0x22')](_0x1b6a75);}return _0x320a15[_0xc16c('0x23')]();};}function saveUpdates(_0x1adac0,_0x44b26a){return function(_0x104b9c){if(_0x104b9c){return _0x104b9c[_0xc16c('0x24')](_0x1adac0)[_0xc16c('0x25')](function(_0x4c9975){return _0x4c9975;});}return null;};}function removeEntity(_0x17d299,_0x127594){return function(_0x26338e){if(_0x26338e){return _0x26338e['destroy']()['then'](function(){_0x17d299['status'](0xcc)[_0xc16c('0x1a')]();});}};}function handleEntityNotFound(_0x16ccd7,_0x5f355f){return function(_0x30156d){if(!_0x30156d){_0x16ccd7[_0xc16c('0x18')](0x194);}return _0x30156d;};}function handleError(_0x33d104,_0x58962b){_0x58962b=_0x58962b||0x1f4;return function(_0x36d2d3){logger[_0xc16c('0x26')](_0x36d2d3['stack']);if(_0x36d2d3['name']){delete _0x36d2d3[_0xc16c('0x27')];}_0x33d104['status'](_0x58962b)['send'](_0x36d2d3);};}exports[_0xc16c('0x28')]=function(_0x49582c,_0x50fc24){var _0x6f56f1={},_0x590ad1={},_0x54c3c0={'count':0x0,'rows':[]};var _0x31bbe7=_[_0xc16c('0x29')](db[_0xc16c('0x2a')][_0xc16c('0x2b')],function(_0x469c25){return{'name':_0x469c25[_0xc16c('0x2c')],'type':_0x469c25[_0xc16c('0x2d')][_0xc16c('0x2e')]};});_0x590ad1['model']=_[_0xc16c('0x29')](_0x31bbe7,_0xc16c('0x27'));_0x590ad1['query']=_[_0xc16c('0x2f')](_0x49582c[_0xc16c('0x30')]);_0x590ad1[_0xc16c('0x31')]=_[_0xc16c('0x32')](_0x590ad1[_0xc16c('0x33')],_0x590ad1['query']);_0x6f56f1[_0xc16c('0x34')]=_[_0xc16c('0x32')](_0x590ad1[_0xc16c('0x33')],qs[_0xc16c('0x35')](_0x49582c[_0xc16c('0x30')]['fields']));_0x6f56f1[_0xc16c('0x34')]=_0x6f56f1[_0xc16c('0x34')][_0xc16c('0x36')]?_0x6f56f1[_0xc16c('0x34')]:_0x590ad1[_0xc16c('0x33')];if(!_0x49582c[_0xc16c('0x30')][_0xc16c('0x37')](_0xc16c('0x38'))){_0x6f56f1[_0xc16c('0x1e')]=qs['limit'](_0x49582c[_0xc16c('0x30')][_0xc16c('0x1e')]);_0x6f56f1[_0xc16c('0x1c')]=qs[_0xc16c('0x1c')](_0x49582c[_0xc16c('0x30')][_0xc16c('0x1c')]);}_0x6f56f1['order']=qs[_0xc16c('0x39')](_0x49582c[_0xc16c('0x30')][_0xc16c('0x39')]);_0x6f56f1[_0xc16c('0x3a')]=qs[_0xc16c('0x31')](_['pick'](_0x49582c[_0xc16c('0x30')],_0x590ad1[_0xc16c('0x31')]),_0x31bbe7);if(_0x49582c[_0xc16c('0x30')]['filter']){_0x6f56f1[_0xc16c('0x3a')]=_[_0xc16c('0x3b')](_0x6f56f1['where'],{'$or':_[_0xc16c('0x29')](_0x31bbe7,function(_0x2b6835){if(_0x2b6835[_0xc16c('0x2d')]!==_0xc16c('0x3c')){var _0x415159={};_0x415159[_0x2b6835['name']]={'$like':'%'+_0x49582c[_0xc16c('0x30')]['filter']+'%'};return _0x415159;}})});}_0x6f56f1=_[_0xc16c('0x3b')]({},_0x6f56f1,_0x49582c['options']);var _0x18deee={'where':_0x6f56f1['where']};return db['CmHopperHistory']['count'](_0x18deee)[_0xc16c('0x25')](function(_0x225477){_0x54c3c0[_0xc16c('0x1f')]=_0x225477;if(_0x49582c[_0xc16c('0x30')][_0xc16c('0x3d')]){_0x6f56f1[_0xc16c('0x3e')]=[{'all':!![]}];}return db[_0xc16c('0x2a')][_0xc16c('0x3f')](_0x6f56f1);})[_0xc16c('0x25')](function(_0x7285eb){_0x54c3c0[_0xc16c('0x40')]=_0x7285eb;return _0x54c3c0;})[_0xc16c('0x25')](respondWithFilteredResult(_0x50fc24,_0x6f56f1))['catch'](handleError(_0x50fc24,null));};exports['show']=function(_0xdacbc7,_0x532a61){var _0x3b6548={'raw':!![],'where':{'id':_0xdacbc7[_0xc16c('0x41')]['id']}},_0x16fa2c={};_0x16fa2c[_0xc16c('0x33')]=_['keys'](db['CmHopperHistory'][_0xc16c('0x2b')]);_0x16fa2c[_0xc16c('0x30')]=_['keys'](_0xdacbc7[_0xc16c('0x30')]);_0x16fa2c[_0xc16c('0x31')]=_[_0xc16c('0x32')](_0x16fa2c[_0xc16c('0x33')],_0x16fa2c['query']);_0x3b6548['attributes']=_[_0xc16c('0x32')](_0x16fa2c[_0xc16c('0x33')],qs[_0xc16c('0x35')](_0xdacbc7[_0xc16c('0x30')][_0xc16c('0x35')]));_0x3b6548[_0xc16c('0x34')]=_0x3b6548[_0xc16c('0x34')]['length']?_0x3b6548[_0xc16c('0x34')]:_0x16fa2c['model'];if(_0xdacbc7[_0xc16c('0x30')][_0xc16c('0x3d')]){_0x3b6548[_0xc16c('0x3e')]=[{'all':!![]}];}_0x3b6548=_['merge']({},_0x3b6548,_0xdacbc7[_0xc16c('0x42')]);return db[_0xc16c('0x2a')][_0xc16c('0x43')](_0x3b6548)[_0xc16c('0x25')](handleEntityNotFound(_0x532a61,null))[_0xc16c('0x25')](respondWithResult(_0x532a61,null))[_0xc16c('0x44')](handleError(_0x532a61,null));};exports['create']=function(_0x2ea2c0,_0x5c9461){return db[_0xc16c('0x2a')][_0xc16c('0x45')](_0x2ea2c0[_0xc16c('0x46')],{})[_0xc16c('0x25')](respondWithResult(_0x5c9461,0xc9))[_0xc16c('0x44')](handleError(_0x5c9461,null));};exports['describe']=function(_0x4cc89b,_0x4ce332){return db[_0xc16c('0x2a')]['describe']()[_0xc16c('0x25')](respondWithResult(_0x4ce332,null))[_0xc16c('0x44')](handleError(_0x4ce332,null));};exports[_0xc16c('0x24')]=function(_0x29612d,_0x163a8f){if(_0x29612d[_0xc16c('0x46')][_0xc16c('0x47')]){delete _0x29612d[_0xc16c('0x46')][_0xc16c('0x47')];}return db[_0xc16c('0x2a')]['find']({'where':{'uniqueid':_0x29612d[_0xc16c('0x41')]['id']}})['then'](handleEntityNotFound(_0x163a8f,null))[_0xc16c('0x25')](saveUpdates(_0x29612d[_0xc16c('0x46')],null))[_0xc16c('0x25')](respondWithResult(_0x163a8f,null))['catch'](handleError(_0x163a8f,null));}; \ No newline at end of file +var _0xae8b=['options','includeAll','include','findAll','params','length','catch','create','describe','body','uniqueid','eml-format','rimraf','request-promise','moment','bluebird','mustache','util','path','sox','ejs','fs-extra','lodash','crypto','desk.js','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/license/util','../../mysqldb','sendStatus','end','json','offset','undefined','limit','count','status','set','apply','reject','save','update','then','destroy','error','stack','name','send','index','map','CmHopperHistory','rawAttributes','type','key','model','keys','query','filters','intersection','attributes','fields','nolimit','sort','pick','filter','where','VIRTUAL','merge'];(function(_0x40b493,_0x4050de){var _0x548365=function(_0x8ceba7){while(--_0x8ceba7){_0x40b493['push'](_0x40b493['shift']());}};_0x548365(++_0x4050de);}(_0xae8b,0x1bb));var _0xbae8=function(_0x6131cd,_0x4c26a1){_0x6131cd=_0x6131cd-0x0;var _0x47e916=_0xae8b[_0x6131cd];return _0x47e916;};'use strict';var emlformat=require(_0xbae8('0x0'));var rimraf=require(_0xbae8('0x1'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0xbae8('0x2'));var moment=require(_0xbae8('0x3'));var BPromise=require(_0xbae8('0x4'));var Mustache=require(_0xbae8('0x5'));var util=require(_0xbae8('0x6'));var path=require(_0xbae8('0x7'));var sox=require(_0xbae8('0x8'));var csv=require('to-csv');var ejs=require(_0xbae8('0x9'));var fs=require('fs');var fs_extra=require(_0xbae8('0xa'));var _=require(_0xbae8('0xb'));var squel=require('squel');var crypto=require(_0xbae8('0xc'));var jsforce=require('jsforce');var deskjs=require(_0xbae8('0xd'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0xbae8('0xe'));var Redis=require(_0xbae8('0xf'));var authService=require('../../components/auth/service');var qs=require(_0xbae8('0x10'));var as=require(_0xbae8('0x11'));var hardwareService=require(_0xbae8('0x12'));var logger=require('../../config/logger')(_0xbae8('0x13'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0xbae8('0x14'));var db=require(_0xbae8('0x15'))['db'];function respondWithStatusCode(_0x9b923a,_0x334573){_0x334573=_0x334573||0xcc;return function(_0x14b526){if(_0x14b526){return _0x9b923a[_0xbae8('0x16')](_0x334573);}return _0x9b923a['status'](_0x334573)[_0xbae8('0x17')]();};}function respondWithResult(_0x3186f1,_0x438803){_0x438803=_0x438803||0xc8;return function(_0x39eabe){if(_0x39eabe){return _0x3186f1['status'](_0x438803)[_0xbae8('0x18')](_0x39eabe);}};}function respondWithFilteredResult(_0x465c8d,_0xf03492){return function(_0x58f42f){if(_0x58f42f){var _0x259304=typeof _0xf03492[_0xbae8('0x19')]===_0xbae8('0x1a')&&typeof _0xf03492[_0xbae8('0x1b')]==='undefined';var _0x262854=_0x58f42f['count'];var _0x492535=_0x259304?0x0:_0xf03492[_0xbae8('0x19')];var _0x368e71=_0x259304?_0x58f42f[_0xbae8('0x1c')]:_0xf03492[_0xbae8('0x19')]+_0xf03492[_0xbae8('0x1b')];var _0x130b3b;if(_0x368e71>=_0x262854){_0x368e71=_0x262854;_0x130b3b=0xc8;}else{_0x130b3b=0xce;}_0x465c8d[_0xbae8('0x1d')](_0x130b3b);return _0x465c8d[_0xbae8('0x1e')]('Content-Range',_0x492535+'-'+_0x368e71+'/'+_0x262854)['json'](_0x58f42f);}return null;};}function patchUpdates(_0x2f11f3){return function(_0x2bc352){try{jsonpatch[_0xbae8('0x1f')](_0x2bc352,_0x2f11f3,!![]);}catch(_0x4d6ef9){return BPromise[_0xbae8('0x20')](_0x4d6ef9);}return _0x2bc352[_0xbae8('0x21')]();};}function saveUpdates(_0x1fb6ce,_0x138626){return function(_0x761a8c){if(_0x761a8c){return _0x761a8c[_0xbae8('0x22')](_0x1fb6ce)[_0xbae8('0x23')](function(_0xdf72d7){return _0xdf72d7;});}return null;};}function removeEntity(_0x12a1b7,_0x4d5b89){return function(_0x1092d7){if(_0x1092d7){return _0x1092d7[_0xbae8('0x24')]()[_0xbae8('0x23')](function(){_0x12a1b7['status'](0xcc)[_0xbae8('0x17')]();});}};}function handleEntityNotFound(_0x154113,_0x91aed3){return function(_0x40be7e){if(!_0x40be7e){_0x154113[_0xbae8('0x16')](0x194);}return _0x40be7e;};}function handleError(_0xc3e44a,_0x325588){_0x325588=_0x325588||0x1f4;return function(_0x6f0907){logger[_0xbae8('0x25')](_0x6f0907[_0xbae8('0x26')]);if(_0x6f0907[_0xbae8('0x27')]){delete _0x6f0907[_0xbae8('0x27')];}_0xc3e44a[_0xbae8('0x1d')](_0x325588)[_0xbae8('0x28')](_0x6f0907);};}exports[_0xbae8('0x29')]=function(_0x58be61,_0x463425){var _0x29c40b={},_0x52e219={},_0x5f514c={'count':0x0,'rows':[]};var _0x4a0787=_[_0xbae8('0x2a')](db[_0xbae8('0x2b')][_0xbae8('0x2c')],function(_0x4b0adc){return{'name':_0x4b0adc['fieldName'],'type':_0x4b0adc[_0xbae8('0x2d')][_0xbae8('0x2e')]};});_0x52e219[_0xbae8('0x2f')]=_['map'](_0x4a0787,_0xbae8('0x27'));_0x52e219['query']=_[_0xbae8('0x30')](_0x58be61[_0xbae8('0x31')]);_0x52e219[_0xbae8('0x32')]=_[_0xbae8('0x33')](_0x52e219[_0xbae8('0x2f')],_0x52e219['query']);_0x29c40b[_0xbae8('0x34')]=_['intersection'](_0x52e219[_0xbae8('0x2f')],qs[_0xbae8('0x35')](_0x58be61[_0xbae8('0x31')][_0xbae8('0x35')]));_0x29c40b['attributes']=_0x29c40b[_0xbae8('0x34')]['length']?_0x29c40b['attributes']:_0x52e219['model'];if(!_0x58be61[_0xbae8('0x31')]['hasOwnProperty'](_0xbae8('0x36'))){_0x29c40b[_0xbae8('0x1b')]=qs[_0xbae8('0x1b')](_0x58be61[_0xbae8('0x31')][_0xbae8('0x1b')]);_0x29c40b[_0xbae8('0x19')]=qs[_0xbae8('0x19')](_0x58be61[_0xbae8('0x31')]['offset']);}_0x29c40b['order']=qs['sort'](_0x58be61[_0xbae8('0x31')][_0xbae8('0x37')]);_0x29c40b['where']=qs[_0xbae8('0x32')](_[_0xbae8('0x38')](_0x58be61[_0xbae8('0x31')],_0x52e219[_0xbae8('0x32')]),_0x4a0787);if(_0x58be61[_0xbae8('0x31')][_0xbae8('0x39')]){_0x29c40b[_0xbae8('0x3a')]=_['merge'](_0x29c40b[_0xbae8('0x3a')],{'$or':_[_0xbae8('0x2a')](_0x4a0787,function(_0x399044){if(_0x399044[_0xbae8('0x2d')]!==_0xbae8('0x3b')){var _0x3ee00f={};_0x3ee00f[_0x399044[_0xbae8('0x27')]]={'$like':'%'+_0x58be61[_0xbae8('0x31')][_0xbae8('0x39')]+'%'};return _0x3ee00f;}})});}_0x29c40b=_[_0xbae8('0x3c')]({},_0x29c40b,_0x58be61[_0xbae8('0x3d')]);var _0x48388b={'where':_0x29c40b[_0xbae8('0x3a')]};return db[_0xbae8('0x2b')][_0xbae8('0x1c')](_0x48388b)[_0xbae8('0x23')](function(_0x134066){_0x5f514c[_0xbae8('0x1c')]=_0x134066;if(_0x58be61[_0xbae8('0x31')][_0xbae8('0x3e')]){_0x29c40b[_0xbae8('0x3f')]=[{'all':!![]}];}return db[_0xbae8('0x2b')][_0xbae8('0x40')](_0x29c40b);})[_0xbae8('0x23')](function(_0x311c85){_0x5f514c['rows']=_0x311c85;return _0x5f514c;})[_0xbae8('0x23')](respondWithFilteredResult(_0x463425,_0x29c40b))['catch'](handleError(_0x463425,null));};exports['show']=function(_0x3bdaa1,_0xbbc43d){var _0x15fe42={'raw':!![],'where':{'id':_0x3bdaa1[_0xbae8('0x41')]['id']}},_0x328c96={};_0x328c96[_0xbae8('0x2f')]=_[_0xbae8('0x30')](db['CmHopperHistory']['rawAttributes']);_0x328c96['query']=_[_0xbae8('0x30')](_0x3bdaa1[_0xbae8('0x31')]);_0x328c96[_0xbae8('0x32')]=_[_0xbae8('0x33')](_0x328c96[_0xbae8('0x2f')],_0x328c96[_0xbae8('0x31')]);_0x15fe42[_0xbae8('0x34')]=_[_0xbae8('0x33')](_0x328c96['model'],qs[_0xbae8('0x35')](_0x3bdaa1[_0xbae8('0x31')]['fields']));_0x15fe42[_0xbae8('0x34')]=_0x15fe42[_0xbae8('0x34')][_0xbae8('0x42')]?_0x15fe42['attributes']:_0x328c96['model'];if(_0x3bdaa1[_0xbae8('0x31')]['includeAll']){_0x15fe42[_0xbae8('0x3f')]=[{'all':!![]}];}_0x15fe42=_[_0xbae8('0x3c')]({},_0x15fe42,_0x3bdaa1[_0xbae8('0x3d')]);return db[_0xbae8('0x2b')]['find'](_0x15fe42)[_0xbae8('0x23')](handleEntityNotFound(_0xbbc43d,null))[_0xbae8('0x23')](respondWithResult(_0xbbc43d,null))[_0xbae8('0x43')](handleError(_0xbbc43d,null));};exports['create']=function(_0x4ac316,_0x16800d){return db['CmHopperHistory'][_0xbae8('0x44')](_0x4ac316['body'],{})[_0xbae8('0x23')](respondWithResult(_0x16800d,0xc9))[_0xbae8('0x43')](handleError(_0x16800d,null));};exports[_0xbae8('0x45')]=function(_0x147b17,_0x15624e){return db[_0xbae8('0x2b')][_0xbae8('0x45')]()[_0xbae8('0x23')](respondWithResult(_0x15624e,null))['catch'](handleError(_0x15624e,null));};exports[_0xbae8('0x22')]=function(_0x508784,_0x37b407){if(_0x508784[_0xbae8('0x46')]['uniqueid']){delete _0x508784[_0xbae8('0x46')][_0xbae8('0x47')];}return db[_0xbae8('0x2b')]['find']({'where':{'uniqueid':_0x508784['params']['id']}})[_0xbae8('0x23')](handleEntityNotFound(_0x37b407,null))[_0xbae8('0x23')](saveUpdates(_0x508784[_0xbae8('0x46')],null))[_0xbae8('0x23')](respondWithResult(_0x37b407,null))[_0xbae8('0x43')](handleError(_0x37b407,null));}; \ No newline at end of file diff --git a/server/api/cmHopperHistory/cmHopperHistory.model.js b/server/api/cmHopperHistory/cmHopperHistory.model.js index baeba7f..3e6f1f3 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 _0xfb11=['lodash','../../config/logger','api','bluebird','path','../../config/environment','./cmHopperHistory.attributes','CmHopperHistory','cm_hopper_history','endtime','uniqueid'];(function(_0x54567a,_0x18a589){var _0x4a987b=function(_0xb57498){while(--_0xb57498){_0x54567a['push'](_0x54567a['shift']());}};_0x4a987b(++_0x18a589);}(_0xfb11,0x1ad));var _0x1fb1=function(_0x40bffc,_0x3a45d7){_0x40bffc=_0x40bffc-0x0;var _0x3007e9=_0xfb11[_0x40bffc];return _0x3007e9;};'use strict';var _=require(_0x1fb1('0x0'));var util=require('util');var logger=require(_0x1fb1('0x1'))(_0x1fb1('0x2'));var moment=require('moment');var BPromise=require(_0x1fb1('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x1fb1('0x4'));var rimraf=require('rimraf');var config=require(_0x1fb1('0x5'));var attributes=require(_0x1fb1('0x6'));module['exports']=function(_0x25d44f,_0x133727){return _0x25d44f['define'](_0x1fb1('0x7'),attributes,{'tableName':_0x1fb1('0x8'),'paranoid':![],'indexes':[{'name':_0x1fb1('0x9'),'fields':[_0x1fb1('0x9')]},{'name':_0x1fb1('0xa'),'fields':[_0x1fb1('0xa')]}],'timestamps':!![]});}; \ No newline at end of file +var _0x4f2f=['define','CmHopperHistory','endtime','uniqueid','../../config/logger','api','bluebird','request-promise','path','rimraf','../../config/environment','./cmHopperHistory.attributes','exports'];(function(_0x5c326d,_0x1d2e3c){var _0x1c1cda=function(_0x326bcf){while(--_0x326bcf){_0x5c326d['push'](_0x5c326d['shift']());}};_0x1c1cda(++_0x1d2e3c);}(_0x4f2f,0x1cb));var _0xf4f2=function(_0x42bc91,_0x41f40a){_0x42bc91=_0x42bc91-0x0;var _0x3f5507=_0x4f2f[_0x42bc91];return _0x3f5507;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0xf4f2('0x0'))(_0xf4f2('0x1'));var moment=require('moment');var BPromise=require(_0xf4f2('0x2'));var rp=require(_0xf4f2('0x3'));var fs=require('fs');var path=require(_0xf4f2('0x4'));var rimraf=require(_0xf4f2('0x5'));var config=require(_0xf4f2('0x6'));var attributes=require(_0xf4f2('0x7'));module[_0xf4f2('0x8')]=function(_0x2d7c29,_0x1e0ceb){return _0x2d7c29[_0xf4f2('0x9')](_0xf4f2('0xa'),attributes,{'tableName':'cm_hopper_history','paranoid':![],'indexes':[{'name':_0xf4f2('0xb'),'fields':[_0xf4f2('0xb')]},{'name':'uniqueid','fields':[_0xf4f2('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 9b60823..deeb7fd 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 _0xfa7c=['rpc','jayson/promise','client','http','request','then','CmHopperHistory,\x20%s,\x20%s','request\x20sent','debug','CmHopperHistory,\x20%s,\x20%s,\x20%s','error','message','info','result','CreateCmHopperHistory','create','body','options','raw','AvgHandleTime','CmHopperHistory','findAll','where','sequelize','COUNT','col','predictiveIntervalTotalCalls','`state`\x20=\x204,\x201,\x20null','predictiveIntervalAnsweredCalls','predictiveIntervalDroppedCallsTimeout','literal','`state`\x20=\x2011,\x201,\x20null','predictiveIntervalDroppedCallsCallersExit','AVG','predictiveIntervalAvgTalktime','stringify','catch','GetVoiceQueueHopperHistory','campaign','name','`state`\x20=\x200,\x201,\x20null','outboundNoSuchCallsDay','`state`\x20=\x203,\x201,\x20null','outboundAnswerCallsDay','`state`\x20=\x205,\x201,\x20null','outboundBusyCallsDay','outboundCongestionCallsDay','`state`\x20=\x2010\x20,\x201,\x20null','`state`\x20=\x2011\x20,\x201,\x20null','outboundDropCallsDayCallersExit','`state`\x20=\x2012,\x201,\x20null','outboundUnknownCallsDay','`state`\x20=\x2013,\x201,\x20null','`state`\x20=\x2014,\x201,\x20null','outboundOriginateFailureCallsDay','`state`\x20=\x2018,\x201,\x20null','outboundRejectCallsDay','`state`\x20=\x2016,\x201,\x20null','outboundAnswerAgiCallsDay','`state`\x20=\x2022\x20or\x20`state`\x20=\x2023,\x201,\x20null','outboundReCallsDay','GetCampaignHopperHistory','ivrAnswerCallsDay','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger'];(function(_0x380e75,_0x486360){var _0x444d96=function(_0x32c8f8){while(--_0x32c8f8){_0x380e75['push'](_0x380e75['shift']());}};_0x444d96(++_0x486360);}(_0xfa7c,0x15b));var _0xcfa7=function(_0x407871,_0x566a99){_0x407871=_0x407871-0x0;var _0x479e34=_0xfa7c[_0x407871];return _0x479e34;};'use strict';var _=require(_0xcfa7('0x0'));var util=require('util');var moment=require(_0xcfa7('0x1'));var BPromise=require(_0xcfa7('0x2'));var rs=require(_0xcfa7('0x3'));var fs=require('fs');var Redis=require(_0xcfa7('0x4'));var db=require(_0xcfa7('0x5'))['db'];var utils=require(_0xcfa7('0x6'));var logger=require(_0xcfa7('0x7'))(_0xcfa7('0x8'));var config=require('../../config/environment');var jayson=require(_0xcfa7('0x9'));var client=jayson[_0xcfa7('0xa')][_0xcfa7('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x1d5f85,_0x4b2669,_0x816590){return new BPromise(function(_0x573432,_0x376c4e){return client[_0xcfa7('0xc')](_0x1d5f85,_0x816590)[_0xcfa7('0xd')](function(_0x14e62a){logger['info'](_0xcfa7('0xe'),_0x4b2669,_0xcfa7('0xf'));logger[_0xcfa7('0x10')](_0xcfa7('0x11'),_0x4b2669,_0xcfa7('0xf'),JSON['stringify'](_0x14e62a));if(_0x14e62a['error']){if(_0x14e62a[_0xcfa7('0x12')]['code']===0x1f4){logger[_0xcfa7('0x12')](_0xcfa7('0xe'),_0x4b2669,_0x14e62a[_0xcfa7('0x12')][_0xcfa7('0x13')]);return _0x376c4e(_0x14e62a[_0xcfa7('0x12')][_0xcfa7('0x13')]);}logger[_0xcfa7('0x12')](_0xcfa7('0xe'),_0x4b2669,_0x14e62a['error'][_0xcfa7('0x13')]);return _0x573432(_0x14e62a['error']['message']);}else{logger[_0xcfa7('0x14')](_0xcfa7('0xe'),_0x4b2669,_0xcfa7('0xf'));_0x573432(_0x14e62a[_0xcfa7('0x15')][_0xcfa7('0x13')]);}})['catch'](function(_0x11d8bf){logger[_0xcfa7('0x12')](_0xcfa7('0xe'),_0x4b2669,_0x11d8bf);_0x376c4e(_0x11d8bf);});});}exports[_0xcfa7('0x16')]=function(_0x4e2a46){var _0x21f73c=this;return new Promise(function(_0x34f829,_0x558a21){return db['CmHopperHistory'][_0xcfa7('0x17')](_0x4e2a46[_0xcfa7('0x18')],{'raw':_0x4e2a46[_0xcfa7('0x19')]?_0x4e2a46[_0xcfa7('0x19')][_0xcfa7('0x1a')]===undefined?!![]:![]:!![]})[_0xcfa7('0xd')](function(_0x2312fd){logger[_0xcfa7('0x14')]('CreateCmHopperHistory',_0x4e2a46);logger[_0xcfa7('0x10')]('CreateCmHopperHistory',_0x4e2a46,JSON['stringify'](_0x2312fd));_0x34f829(_0x2312fd);})['catch'](function(_0xdf35fa){logger['error'](_0xcfa7('0x16'),_0xdf35fa[_0xcfa7('0x13')],_0x4e2a46);_0x558a21(_0x21f73c[_0xcfa7('0x12')](0x1f4,_0xdf35fa[_0xcfa7('0x13')]));});});};exports[_0xcfa7('0x1b')]=function(_0x2d00e1){var _0x1562c8=this;return new Promise(function(_0x311f9f,_0x5bff8b){return db[_0xcfa7('0x1c')][_0xcfa7('0x1d')]({'raw':_0x2d00e1[_0xcfa7('0x19')]?_0x2d00e1[_0xcfa7('0x19')]['raw']===undefined?!![]:![]:!![],'where':_0x2d00e1[_0xcfa7('0x19')]?_0x2d00e1[_0xcfa7('0x19')][_0xcfa7('0x1e')]||null:null,'attributes':[[db[_0xcfa7('0x1f')]['fn'](_0xcfa7('0x20'),db['sequelize'][_0xcfa7('0x21')]('id')),_0xcfa7('0x22')],[db[_0xcfa7('0x1f')]['fn'](_0xcfa7('0x20'),db['sequelize']['fn']('IF',db['sequelize']['literal'](_0xcfa7('0x23')))),_0xcfa7('0x24')],[db[_0xcfa7('0x1f')]['fn']('COUNT',db['sequelize']['fn']('IF',db[_0xcfa7('0x1f')]['literal']('`state`\x20=\x2010,\x201,\x20null'))),_0xcfa7('0x25')],[db[_0xcfa7('0x1f')]['fn'](_0xcfa7('0x20'),db[_0xcfa7('0x1f')]['fn']('IF',db[_0xcfa7('0x1f')][_0xcfa7('0x26')](_0xcfa7('0x27')))),_0xcfa7('0x28')],[db['sequelize']['fn']('AVG',db[_0xcfa7('0x1f')]['fn']('IF',db[_0xcfa7('0x1f')][_0xcfa7('0x26')]('`state`\x20=\x204,\x20`holdtime`,\x20null'))),'predictiveIntervalAvgHoldtime'],[db[_0xcfa7('0x1f')]['fn'](_0xcfa7('0x29'),db[_0xcfa7('0x1f')]['fn']('IF',db['sequelize'][_0xcfa7('0x26')]('`state`\x20=\x204,\x20`talktime`,\x20null'))),_0xcfa7('0x2a')]]})['then'](function(_0x1b9e07){logger[_0xcfa7('0x14')](_0xcfa7('0x1b'),_0x2d00e1);logger[_0xcfa7('0x10')](_0xcfa7('0x1b'),_0x2d00e1,JSON[_0xcfa7('0x2b')](_0x1b9e07));_0x311f9f(_0x1b9e07);})[_0xcfa7('0x2c')](function(_0x5a9c5a){logger[_0xcfa7('0x12')](_0xcfa7('0x1b'),_0x5a9c5a[_0xcfa7('0x13')],_0x2d00e1);_0x5bff8b(_0x1562c8[_0xcfa7('0x12')](0x1f4,_0x5a9c5a[_0xcfa7('0x13')]));});});};exports[_0xcfa7('0x2d')]=function(_0x1be019){var _0x2926f1=this;return new Promise(function(_0x5c04f3,_0x42a16a){return db['CmHopperHistory']['findAll']({'raw':_0x1be019[_0xcfa7('0x19')]?_0x1be019['options'][_0xcfa7('0x1a')]===undefined?!![]:![]:!![],'where':_0x1be019[_0xcfa7('0x19')]?_0x1be019[_0xcfa7('0x19')]['where']||null:null,'attributes':[[_0xcfa7('0x2e'),_0xcfa7('0x2f')],[db['sequelize']['fn'](_0xcfa7('0x20'),db[_0xcfa7('0x1f')]['fn']('IF',db[_0xcfa7('0x1f')]['literal'](_0xcfa7('0x30')))),_0xcfa7('0x31')],[db[_0xcfa7('0x1f')]['fn'](_0xcfa7('0x20'),db[_0xcfa7('0x1f')]['fn']('IF',db[_0xcfa7('0x1f')]['literal'](_0xcfa7('0x32')))),'outboundNoAnswerCallsDay'],[db[_0xcfa7('0x1f')]['fn'](_0xcfa7('0x20'),db['sequelize']['fn']('IF',db[_0xcfa7('0x1f')][_0xcfa7('0x26')]('`state`\x20=\x204,\x201,\x20null'))),_0xcfa7('0x33')],[db['sequelize']['fn'](_0xcfa7('0x20'),db[_0xcfa7('0x1f')]['fn']('IF',db['sequelize'][_0xcfa7('0x26')](_0xcfa7('0x34')))),_0xcfa7('0x35')],[db[_0xcfa7('0x1f')]['fn'](_0xcfa7('0x20'),db[_0xcfa7('0x1f')]['fn']('IF',db[_0xcfa7('0x1f')][_0xcfa7('0x26')]('`state`\x20=\x208,\x201,\x20null'))),_0xcfa7('0x36')],[db[_0xcfa7('0x1f')]['fn'](_0xcfa7('0x20'),db[_0xcfa7('0x1f')]['fn']('IF',db[_0xcfa7('0x1f')]['literal'](_0xcfa7('0x37')))),'outboundDropCallsDayTimeout'],[db[_0xcfa7('0x1f')]['fn'](_0xcfa7('0x20'),db[_0xcfa7('0x1f')]['fn']('IF',db['sequelize'][_0xcfa7('0x26')](_0xcfa7('0x38')))),_0xcfa7('0x39')],[db[_0xcfa7('0x1f')]['fn'](_0xcfa7('0x20'),db[_0xcfa7('0x1f')]['fn']('IF',db['sequelize'][_0xcfa7('0x26')](_0xcfa7('0x3a')))),_0xcfa7('0x3b')],[db[_0xcfa7('0x1f')]['fn'](_0xcfa7('0x20'),db[_0xcfa7('0x1f')]['fn']('IF',db[_0xcfa7('0x1f')][_0xcfa7('0x26')](_0xcfa7('0x3c')))),'outboundBlacklistCallsDay'],[db[_0xcfa7('0x1f')]['fn'](_0xcfa7('0x20'),db[_0xcfa7('0x1f')]['fn']('IF',db[_0xcfa7('0x1f')][_0xcfa7('0x26')](_0xcfa7('0x3d')))),_0xcfa7('0x3e')],[db['sequelize']['fn']('COUNT',db[_0xcfa7('0x1f')]['fn']('IF',db[_0xcfa7('0x1f')]['literal'](_0xcfa7('0x3f')))),_0xcfa7('0x40')],[db['sequelize']['fn'](_0xcfa7('0x20'),db[_0xcfa7('0x1f')]['fn']('IF',db[_0xcfa7('0x1f')]['literal'](_0xcfa7('0x41')))),_0xcfa7('0x42')],[db['sequelize']['fn'](_0xcfa7('0x20'),db[_0xcfa7('0x1f')]['fn']('IF',db[_0xcfa7('0x1f')][_0xcfa7('0x26')]('`state`\x20=\x2020,\x201,\x20null'))),_0xcfa7('0x40')],[db[_0xcfa7('0x1f')]['fn']('COUNT',db[_0xcfa7('0x1f')]['fn']('IF',db[_0xcfa7('0x1f')]['literal'](_0xcfa7('0x43')))),_0xcfa7('0x44')]],'group':[_0xcfa7('0x2e')]})['then'](function(_0x403f51){logger[_0xcfa7('0x14')](_0xcfa7('0x2d'),_0x1be019);logger[_0xcfa7('0x10')]('GetVoiceQueueHopperHistory',_0x1be019,JSON[_0xcfa7('0x2b')](_0x403f51));_0x5c04f3(_0x403f51);})['catch'](function(_0x360d4d){logger[_0xcfa7('0x12')](_0xcfa7('0x2d'),_0x360d4d[_0xcfa7('0x13')],_0x1be019);_0x42a16a(_0x2926f1[_0xcfa7('0x12')](0x1f4,_0x360d4d[_0xcfa7('0x13')]));});});};exports[_0xcfa7('0x45')]=function(_0x25fe73){var _0x2dd57d=this;return new Promise(function(_0x33b159,_0x4fdf09){return db['CmHopperHistory']['findAll']({'raw':_0x25fe73[_0xcfa7('0x19')]?_0x25fe73[_0xcfa7('0x19')][_0xcfa7('0x1a')]===undefined?!![]:![]:!![],'where':_0x25fe73[_0xcfa7('0x19')]?_0x25fe73[_0xcfa7('0x19')][_0xcfa7('0x1e')]||null:null,'attributes':[[_0xcfa7('0x2e'),'name'],[db[_0xcfa7('0x1f')]['fn'](_0xcfa7('0x20'),db[_0xcfa7('0x1f')][_0xcfa7('0x21')]('id')),'ivrTotalCallsDays'],[db['sequelize']['fn'](_0xcfa7('0x20'),db[_0xcfa7('0x1f')]['fn']('IF',db[_0xcfa7('0x1f')][_0xcfa7('0x26')]('`state`\x20=\x204,\x201,\x20null'))),_0xcfa7('0x46')]],'group':[_0xcfa7('0x2e')]})[_0xcfa7('0xd')](function(_0x40d232){logger[_0xcfa7('0x14')]('GetCampaignHopperHistory',_0x25fe73);logger[_0xcfa7('0x10')](_0xcfa7('0x45'),_0x25fe73,JSON['stringify'](_0x40d232));_0x33b159(_0x40d232);})[_0xcfa7('0x2c')](function(_0x25074d){logger[_0xcfa7('0x12')]('GetCampaignHopperHistory',_0x25074d[_0xcfa7('0x13')],_0x25fe73);_0x4fdf09(_0x2dd57d['error'](0x1f4,_0x25074d['message']));});});}; \ No newline at end of file +var _0x3402=['moment','bluebird','randomstring','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','then','info','CmHopperHistory,\x20%s,\x20%s','request\x20sent','CmHopperHistory,\x20%s,\x20%s,\x20%s','error','message','result','catch','CreateCmHopperHistory','CmHopperHistory','create','body','raw','AvgHandleTime','findAll','options','where','sequelize','COUNT','col','predictiveIntervalTotalCalls','`state`\x20=\x204,\x201,\x20null','predictiveIntervalAnsweredCalls','literal','`state`\x20=\x2010,\x201,\x20null','predictiveIntervalDroppedCallsCallersExit','AVG','predictiveIntervalAvgHoldtime','`state`\x20=\x204,\x20`talktime`,\x20null','predictiveIntervalAvgTalktime','debug','stringify','GetVoiceQueueHopperHistory','campaign','name','`state`\x20=\x200,\x201,\x20null','outboundNoSuchCallsDay','outboundNoAnswerCallsDay','outboundAnswerCallsDay','`state`\x20=\x205,\x201,\x20null','outboundCongestionCallsDay','`state`\x20=\x2010\x20,\x201,\x20null','outboundDropCallsDayTimeout','`state`\x20=\x2011\x20,\x201,\x20null','outboundDropCallsDayCallersExit','`state`\x20=\x2012,\x201,\x20null','outboundUnknownCallsDay','`state`\x20=\x2013,\x201,\x20null','outboundBlacklistCallsDay','`state`\x20=\x2014,\x201,\x20null','outboundOriginateFailureCallsDay','`state`\x20=\x2018,\x201,\x20null','outboundRejectCallsDay','`state`\x20=\x2016,\x201,\x20null','outboundAnswerAgiCallsDay','`state`\x20=\x2020,\x201,\x20null','`state`\x20=\x2022\x20or\x20`state`\x20=\x2023,\x201,\x20null','outboundReCallsDay','GetCampaignHopperHistory','ivrTotalCallsDays','ivrAnswerCallsDay','lodash'];(function(_0x1c5985,_0x35cfca){var _0x1567e0=function(_0x27c8f6){while(--_0x27c8f6){_0x1c5985['push'](_0x1c5985['shift']());}};_0x1567e0(++_0x35cfca);}(_0x3402,0x1f0));var _0x2340=function(_0x4d7d7a,_0x4d1e5e){_0x4d7d7a=_0x4d7d7a-0x0;var _0x4db500=_0x3402[_0x4d7d7a];return _0x4db500;};'use strict';var _=require(_0x2340('0x0'));var util=require('util');var moment=require(_0x2340('0x1'));var BPromise=require(_0x2340('0x2'));var rs=require(_0x2340('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0x2340('0x4'));var logger=require(_0x2340('0x5'))(_0x2340('0x6'));var config=require(_0x2340('0x7'));var jayson=require(_0x2340('0x8'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0xc37850,_0x1deef4,_0x16174f){return new BPromise(function(_0x225250,_0x152e52){return client['request'](_0xc37850,_0x16174f)[_0x2340('0x9')](function(_0x1da381){logger[_0x2340('0xa')](_0x2340('0xb'),_0x1deef4,_0x2340('0xc'));logger['debug'](_0x2340('0xd'),_0x1deef4,_0x2340('0xc'),JSON['stringify'](_0x1da381));if(_0x1da381['error']){if(_0x1da381[_0x2340('0xe')]['code']===0x1f4){logger[_0x2340('0xe')]('CmHopperHistory,\x20%s,\x20%s',_0x1deef4,_0x1da381[_0x2340('0xe')][_0x2340('0xf')]);return _0x152e52(_0x1da381[_0x2340('0xe')][_0x2340('0xf')]);}logger[_0x2340('0xe')](_0x2340('0xb'),_0x1deef4,_0x1da381[_0x2340('0xe')]['message']);return _0x225250(_0x1da381[_0x2340('0xe')][_0x2340('0xf')]);}else{logger[_0x2340('0xa')]('CmHopperHistory,\x20%s,\x20%s',_0x1deef4,_0x2340('0xc'));_0x225250(_0x1da381[_0x2340('0x10')][_0x2340('0xf')]);}})[_0x2340('0x11')](function(_0x4dcab6){logger[_0x2340('0xe')](_0x2340('0xb'),_0x1deef4,_0x4dcab6);_0x152e52(_0x4dcab6);});});}exports[_0x2340('0x12')]=function(_0x9723dd){var _0xd96877=this;return new Promise(function(_0x51524b,_0x4fde34){return db[_0x2340('0x13')][_0x2340('0x14')](_0x9723dd[_0x2340('0x15')],{'raw':_0x9723dd['options']?_0x9723dd['options'][_0x2340('0x16')]===undefined?!![]:![]:!![]})[_0x2340('0x9')](function(_0x1b3822){logger[_0x2340('0xa')]('CreateCmHopperHistory',_0x9723dd);logger['debug'](_0x2340('0x12'),_0x9723dd,JSON['stringify'](_0x1b3822));_0x51524b(_0x1b3822);})[_0x2340('0x11')](function(_0x44622a){logger[_0x2340('0xe')](_0x2340('0x12'),_0x44622a[_0x2340('0xf')],_0x9723dd);_0x4fde34(_0xd96877[_0x2340('0xe')](0x1f4,_0x44622a[_0x2340('0xf')]));});});};exports[_0x2340('0x17')]=function(_0x49c77e){var _0x5085d2=this;return new Promise(function(_0x7d4768,_0x91f5c){return db[_0x2340('0x13')][_0x2340('0x18')]({'raw':_0x49c77e[_0x2340('0x19')]?_0x49c77e[_0x2340('0x19')][_0x2340('0x16')]===undefined?!![]:![]:!![],'where':_0x49c77e['options']?_0x49c77e[_0x2340('0x19')][_0x2340('0x1a')]||null:null,'attributes':[[db[_0x2340('0x1b')]['fn'](_0x2340('0x1c'),db[_0x2340('0x1b')][_0x2340('0x1d')]('id')),_0x2340('0x1e')],[db[_0x2340('0x1b')]['fn'](_0x2340('0x1c'),db[_0x2340('0x1b')]['fn']('IF',db[_0x2340('0x1b')]['literal'](_0x2340('0x1f')))),_0x2340('0x20')],[db['sequelize']['fn'](_0x2340('0x1c'),db[_0x2340('0x1b')]['fn']('IF',db[_0x2340('0x1b')][_0x2340('0x21')](_0x2340('0x22')))),'predictiveIntervalDroppedCallsTimeout'],[db[_0x2340('0x1b')]['fn'](_0x2340('0x1c'),db[_0x2340('0x1b')]['fn']('IF',db[_0x2340('0x1b')][_0x2340('0x21')]('`state`\x20=\x2011,\x201,\x20null'))),_0x2340('0x23')],[db[_0x2340('0x1b')]['fn'](_0x2340('0x24'),db['sequelize']['fn']('IF',db[_0x2340('0x1b')][_0x2340('0x21')]('`state`\x20=\x204,\x20`holdtime`,\x20null'))),_0x2340('0x25')],[db[_0x2340('0x1b')]['fn']('AVG',db[_0x2340('0x1b')]['fn']('IF',db[_0x2340('0x1b')][_0x2340('0x21')](_0x2340('0x26')))),_0x2340('0x27')]]})[_0x2340('0x9')](function(_0x4c5a20){logger[_0x2340('0xa')](_0x2340('0x17'),_0x49c77e);logger[_0x2340('0x28')]('AvgHandleTime',_0x49c77e,JSON[_0x2340('0x29')](_0x4c5a20));_0x7d4768(_0x4c5a20);})[_0x2340('0x11')](function(_0x2f5277){logger[_0x2340('0xe')](_0x2340('0x17'),_0x2f5277[_0x2340('0xf')],_0x49c77e);_0x91f5c(_0x5085d2[_0x2340('0xe')](0x1f4,_0x2f5277[_0x2340('0xf')]));});});};exports[_0x2340('0x2a')]=function(_0x28fcbf){var _0x275f6b=this;return new Promise(function(_0x5d7b37,_0x14da4a){return db['CmHopperHistory']['findAll']({'raw':_0x28fcbf[_0x2340('0x19')]?_0x28fcbf['options'][_0x2340('0x16')]===undefined?!![]:![]:!![],'where':_0x28fcbf[_0x2340('0x19')]?_0x28fcbf['options'][_0x2340('0x1a')]||null:null,'attributes':[[_0x2340('0x2b'),_0x2340('0x2c')],[db[_0x2340('0x1b')]['fn']('COUNT',db[_0x2340('0x1b')]['fn']('IF',db[_0x2340('0x1b')][_0x2340('0x21')](_0x2340('0x2d')))),_0x2340('0x2e')],[db[_0x2340('0x1b')]['fn'](_0x2340('0x1c'),db[_0x2340('0x1b')]['fn']('IF',db[_0x2340('0x1b')][_0x2340('0x21')]('`state`\x20=\x203,\x201,\x20null'))),_0x2340('0x2f')],[db[_0x2340('0x1b')]['fn'](_0x2340('0x1c'),db[_0x2340('0x1b')]['fn']('IF',db[_0x2340('0x1b')]['literal']('`state`\x20=\x204,\x201,\x20null'))),_0x2340('0x30')],[db['sequelize']['fn'](_0x2340('0x1c'),db[_0x2340('0x1b')]['fn']('IF',db[_0x2340('0x1b')][_0x2340('0x21')](_0x2340('0x31')))),'outboundBusyCallsDay'],[db['sequelize']['fn'](_0x2340('0x1c'),db[_0x2340('0x1b')]['fn']('IF',db[_0x2340('0x1b')][_0x2340('0x21')]('`state`\x20=\x208,\x201,\x20null'))),_0x2340('0x32')],[db['sequelize']['fn']('COUNT',db[_0x2340('0x1b')]['fn']('IF',db[_0x2340('0x1b')]['literal'](_0x2340('0x33')))),_0x2340('0x34')],[db[_0x2340('0x1b')]['fn'](_0x2340('0x1c'),db[_0x2340('0x1b')]['fn']('IF',db[_0x2340('0x1b')]['literal'](_0x2340('0x35')))),_0x2340('0x36')],[db[_0x2340('0x1b')]['fn']('COUNT',db['sequelize']['fn']('IF',db['sequelize'][_0x2340('0x21')](_0x2340('0x37')))),_0x2340('0x38')],[db[_0x2340('0x1b')]['fn'](_0x2340('0x1c'),db[_0x2340('0x1b')]['fn']('IF',db['sequelize'][_0x2340('0x21')](_0x2340('0x39')))),_0x2340('0x3a')],[db[_0x2340('0x1b')]['fn'](_0x2340('0x1c'),db[_0x2340('0x1b')]['fn']('IF',db[_0x2340('0x1b')][_0x2340('0x21')](_0x2340('0x3b')))),_0x2340('0x3c')],[db[_0x2340('0x1b')]['fn']('COUNT',db[_0x2340('0x1b')]['fn']('IF',db[_0x2340('0x1b')][_0x2340('0x21')](_0x2340('0x3d')))),_0x2340('0x3e')],[db[_0x2340('0x1b')]['fn'](_0x2340('0x1c'),db['sequelize']['fn']('IF',db[_0x2340('0x1b')][_0x2340('0x21')](_0x2340('0x3f')))),_0x2340('0x40')],[db[_0x2340('0x1b')]['fn']('COUNT',db[_0x2340('0x1b')]['fn']('IF',db[_0x2340('0x1b')][_0x2340('0x21')](_0x2340('0x41')))),_0x2340('0x3e')],[db[_0x2340('0x1b')]['fn'](_0x2340('0x1c'),db[_0x2340('0x1b')]['fn']('IF',db[_0x2340('0x1b')][_0x2340('0x21')](_0x2340('0x42')))),_0x2340('0x43')]],'group':[_0x2340('0x2b')]})[_0x2340('0x9')](function(_0x5bdb15){logger[_0x2340('0xa')](_0x2340('0x2a'),_0x28fcbf);logger[_0x2340('0x28')]('GetVoiceQueueHopperHistory',_0x28fcbf,JSON[_0x2340('0x29')](_0x5bdb15));_0x5d7b37(_0x5bdb15);})[_0x2340('0x11')](function(_0x31953d){logger[_0x2340('0xe')](_0x2340('0x2a'),_0x31953d['message'],_0x28fcbf);_0x14da4a(_0x275f6b[_0x2340('0xe')](0x1f4,_0x31953d[_0x2340('0xf')]));});});};exports[_0x2340('0x44')]=function(_0x4f3c83){var _0x5b3432=this;return new Promise(function(_0x19a515,_0x3b8a9f){return db[_0x2340('0x13')][_0x2340('0x18')]({'raw':_0x4f3c83[_0x2340('0x19')]?_0x4f3c83[_0x2340('0x19')][_0x2340('0x16')]===undefined?!![]:![]:!![],'where':_0x4f3c83['options']?_0x4f3c83[_0x2340('0x19')]['where']||null:null,'attributes':[[_0x2340('0x2b'),'name'],[db['sequelize']['fn']('COUNT',db[_0x2340('0x1b')]['col']('id')),_0x2340('0x45')],[db[_0x2340('0x1b')]['fn'](_0x2340('0x1c'),db[_0x2340('0x1b')]['fn']('IF',db[_0x2340('0x1b')][_0x2340('0x21')]('`state`\x20=\x204,\x201,\x20null'))),_0x2340('0x46')]],'group':[_0x2340('0x2b')]})[_0x2340('0x9')](function(_0x1c1305){logger['info'](_0x2340('0x44'),_0x4f3c83);logger[_0x2340('0x28')]('GetCampaignHopperHistory',_0x4f3c83,JSON[_0x2340('0x29')](_0x1c1305));_0x19a515(_0x1c1305);})[_0x2340('0x11')](function(_0x1f89d1){logger[_0x2340('0xe')](_0x2340('0x44'),_0x1f89d1[_0x2340('0xf')],_0x4f3c83);_0x3b8a9f(_0x5b3432[_0x2340('0xe')](0x1f4,_0x1f89d1[_0x2340('0xf')]));});});}; \ No newline at end of file diff --git a/server/api/cmHopperHistory/index.js b/server/api/cmHopperHistory/index.js index 599f32b..0a5d222 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 _0xd263=['/describe','describe','/:id','show','post','create','put','multer','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','get','isAuthenticated','index'];(function(_0x5c975b,_0x3c39c5){var _0x3b839f=function(_0x1409da){while(--_0x1409da){_0x5c975b['push'](_0x5c975b['shift']());}};_0x3b839f(++_0x3c39c5);}(_0xd263,0x181));var _0x3d26=function(_0x3f7b42,_0x3b2f2d){_0x3f7b42=_0x3f7b42-0x0;var _0x26e4d8=_0xd263[_0x3f7b42];return _0x26e4d8;};'use strict';var multer=require(_0x3d26('0x0'));var util=require('util');var path=require(_0x3d26('0x1'));var timeout=require(_0x3d26('0x2'));var express=require(_0x3d26('0x3'));var router=express[_0x3d26('0x4')]();var fs_extra=require(_0x3d26('0x5'));var auth=require(_0x3d26('0x6'));var interaction=require(_0x3d26('0x7'));var config=require('../../config/environment');var controller=require('./cmHopperHistory.controller');router[_0x3d26('0x8')]('/',auth[_0x3d26('0x9')](),controller[_0x3d26('0xa')]);router['get'](_0x3d26('0xb'),auth[_0x3d26('0x9')](),controller[_0x3d26('0xc')]);router[_0x3d26('0x8')](_0x3d26('0xd'),auth[_0x3d26('0x9')](),controller[_0x3d26('0xe')]);router[_0x3d26('0xf')]('/',auth['isAuthenticated'](),controller[_0x3d26('0x10')]);router[_0x3d26('0x11')](_0x3d26('0xd'),auth[_0x3d26('0x9')](),controller['update']);module['exports']=router; \ No newline at end of file +var _0xbf17=['/describe','describe','/:id','show','put','update','multer','util','path','connect-timeout','express','fs-extra','../../components/auth/service','../../config/environment','./cmHopperHistory.controller','get','isAuthenticated','index'];(function(_0x5a3cf0,_0x160a68){var _0x5a64ee=function(_0x34cd1d){while(--_0x34cd1d){_0x5a3cf0['push'](_0x5a3cf0['shift']());}};_0x5a64ee(++_0x160a68);}(_0xbf17,0xba));var _0x7bf1=function(_0xbb7d1,_0x40b39d){_0xbb7d1=_0xbb7d1-0x0;var _0x3de582=_0xbf17[_0xbb7d1];return _0x3de582;};'use strict';var multer=require(_0x7bf1('0x0'));var util=require(_0x7bf1('0x1'));var path=require(_0x7bf1('0x2'));var timeout=require(_0x7bf1('0x3'));var express=require(_0x7bf1('0x4'));var router=express['Router']();var fs_extra=require(_0x7bf1('0x5'));var auth=require(_0x7bf1('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0x7bf1('0x7'));var controller=require(_0x7bf1('0x8'));router[_0x7bf1('0x9')]('/',auth[_0x7bf1('0xa')](),controller[_0x7bf1('0xb')]);router['get'](_0x7bf1('0xc'),auth[_0x7bf1('0xa')](),controller[_0x7bf1('0xd')]);router[_0x7bf1('0x9')](_0x7bf1('0xe'),auth[_0x7bf1('0xa')](),controller[_0x7bf1('0xf')]);router['post']('/',auth[_0x7bf1('0xa')](),controller['create']);router[_0x7bf1('0x10')](_0x7bf1('0xe'),auth[_0x7bf1('0xa')](),controller[_0x7bf1('0x11')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/cmList/cmList.attributes.js b/server/api/cmList/cmList.attributes.js index 8e2d9c5..9f10b0a 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 _0xaa19=['name','sequelize','exports','STRING'];(function(_0x3d34fc,_0x19448a){var _0x35a98c=function(_0x34b179){while(--_0x34b179){_0x3d34fc['push'](_0x3d34fc['shift']());}};_0x35a98c(++_0x19448a);}(_0xaa19,0x79));var _0x9aa1=function(_0x3b68c1,_0xa6f17e){_0x3b68c1=_0x3b68c1-0x0;var _0x37af14=_0xaa19[_0x3b68c1];return _0x37af14;};'use strict';var Sequelize=require(_0x9aa1('0x0'));module[_0x9aa1('0x1')]={'name':{'type':Sequelize[_0x9aa1('0x2')],'unique':_0x9aa1('0x3'),'allowNull':![],'validate':{'notEmpty':!![]}},'description':{'type':Sequelize['STRING']},'dialPrefix':{'type':Sequelize[_0x9aa1('0x2')]}}; \ No newline at end of file +var _0xe292=['STRING','name'];(function(_0x36be42,_0x39f738){var _0x28b941=function(_0x205298){while(--_0x205298){_0x36be42['push'](_0x36be42['shift']());}};_0x28b941(++_0x39f738);}(_0xe292,0x19e));var _0x2e29=function(_0x4a269e,_0x3bd3e7){_0x4a269e=_0x4a269e-0x0;var _0x3fe019=_0xe292[_0x4a269e];return _0x3fe019;};'use strict';var Sequelize=require('sequelize');module['exports']={'name':{'type':Sequelize[_0x2e29('0x0')],'unique':_0x2e29('0x1'),'allowNull':![],'validate':{'notEmpty':!![]}},'description':{'type':Sequelize['STRING']},'dialPrefix':{'type':Sequelize['STRING']}}; \ No newline at end of file diff --git a/server/api/cmList/cmList.controller.js b/server/api/cmList/cmList.controller.js index 7bc5995..89b6ab4 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 _0x06a5=['../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/license/util','../../mysqldb','redis','localhost','socket.io-emitter','./cmList.socket','register','end','status','json','offset','undefined','limit','count','set','apply','save','update','then','destroy','get','Lists','UserProfileResource','error','stack','name','index','map','CmList','rawAttributes','fieldName','type','key','keys','query','filters','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','merge','VIRTUAL','filter','options','includeAll','include','findAll','rows','params','find','catch','create','body','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','userProfileId','autoAssociation','describe','ListId','Disposition','findOne','removeDispositions','ids','addContacts','CmContact','tags','isArray','join','push','each','omit','success','errors','message','getContacts','CmCustomField','CustomFields','concat','format','cf_%d','pick','raw','getContactsCsv','ContactItemType','OrderBy','alias','from','cm_contacts','c.ListId\x20=\x20?','field','customField_','item','cm_contact_has_items','ItemTypeId\x20=\x20?','CmContactId\x20=\x20c.id','additionalPhone_','select','description','toString','isEmpty','now','writeFileSync','/tmp/list_%d_%s.csv','Content-disposition','attachment;\x20filename=','list_%d_%s.csv','setHeader','Content-type','sendStatus','addCustomField','sequelize','addCustomFields','Sequelize','TEXT','text','number','INTEGER','switch','defaultValue','queryInterface','addColumn','findAndCountAll','addAgents','spread','emit','userCmList:save','removeAgents','userCmList:remove','getAgents','User','info','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','crypto','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs'];(function(_0x3fb9dd,_0x174fff){var _0x20136a=function(_0x480081){while(--_0x480081){_0x3fb9dd['push'](_0x3fb9dd['shift']());}};_0x20136a(++_0x174fff);}(_0x06a5,0x12b));var _0x506a=function(_0x555aa9,_0x3a607f){_0x555aa9=_0x555aa9-0x0;var _0x20aecd=_0x06a5[_0x555aa9];return _0x20aecd;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x506a('0x0'));var zipdir=require(_0x506a('0x1'));var jsonpatch=require(_0x506a('0x2'));var rp=require(_0x506a('0x3'));var moment=require(_0x506a('0x4'));var BPromise=require(_0x506a('0x5'));var Mustache=require(_0x506a('0x6'));var util=require(_0x506a('0x7'));var path=require(_0x506a('0x8'));var sox=require(_0x506a('0x9'));var csv=require(_0x506a('0xa'));var ejs=require(_0x506a('0xb'));var fs=require('fs');var fs_extra=require(_0x506a('0xc'));var _=require('lodash');var squel=require('squel');var crypto=require(_0x506a('0xd'));var jsforce=require('jsforce');var deskjs=require(_0x506a('0xe'));var toCsv=require(_0x506a('0xa'));var querystring=require(_0x506a('0xf'));var Papa=require('papaparse');var Redis=require(_0x506a('0x10'));var authService=require(_0x506a('0x11'));var qs=require(_0x506a('0x12'));var as=require(_0x506a('0x13'));var hardwareService=require(_0x506a('0x14'));var logger=require('../../config/logger')(_0x506a('0x15'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0x506a('0x16'));var db=require(_0x506a('0x17'))['db'];var csv_results;config[_0x506a('0x18')]=_['defaults'](config[_0x506a('0x18')],{'host':_0x506a('0x19'),'port':0x18eb});var socket=require(_0x506a('0x1a'))(new Redis(config[_0x506a('0x18')]));require(_0x506a('0x1b'))[_0x506a('0x1c')](socket);function respondWithStatusCode(_0x45b6d3,_0x8fa677){_0x8fa677=_0x8fa677||0xcc;return function(_0xad5d26){if(_0xad5d26){return _0x45b6d3['sendStatus'](_0x8fa677);}return _0x45b6d3['status'](_0x8fa677)[_0x506a('0x1d')]();};}function respondWithResult(_0x5c5afa,_0x284c96){_0x284c96=_0x284c96||0xc8;return function(_0x3f5f7d){if(_0x3f5f7d){return _0x5c5afa[_0x506a('0x1e')](_0x284c96)[_0x506a('0x1f')](_0x3f5f7d);}};}function respondWithFilteredResult(_0x5807f5,_0x4ad1e5){return function(_0x2a0d34){if(_0x2a0d34){var _0x5a2d16=typeof _0x4ad1e5[_0x506a('0x20')]===_0x506a('0x21')&&typeof _0x4ad1e5[_0x506a('0x22')]===_0x506a('0x21');var _0x357637=_0x2a0d34[_0x506a('0x23')];var _0x40c9cd=_0x5a2d16?0x0:_0x4ad1e5[_0x506a('0x20')];var _0xcfd07=_0x5a2d16?_0x2a0d34[_0x506a('0x23')]:_0x4ad1e5[_0x506a('0x20')]+_0x4ad1e5[_0x506a('0x22')];var _0xeeee0a;if(_0xcfd07>=_0x357637){_0xcfd07=_0x357637;_0xeeee0a=0xc8;}else{_0xeeee0a=0xce;}_0x5807f5[_0x506a('0x1e')](_0xeeee0a);return _0x5807f5[_0x506a('0x24')]('Content-Range',_0x40c9cd+'-'+_0xcfd07+'/'+_0x357637)[_0x506a('0x1f')](_0x2a0d34);}return null;};}function patchUpdates(_0x57e283){return function(_0x54d9f3){try{jsonpatch[_0x506a('0x25')](_0x54d9f3,_0x57e283,!![]);}catch(_0x4238e3){return BPromise['reject'](_0x4238e3);}return _0x54d9f3[_0x506a('0x26')]();};}function saveUpdates(_0x1c9b3f,_0x25f2a8){return function(_0x1886ca){if(_0x1886ca){return _0x1886ca[_0x506a('0x27')](_0x1c9b3f)[_0x506a('0x28')](function(_0xdf91c){return _0xdf91c;});}return null;};}function removeEntity(_0x59edf0,_0x36b1aa){return function(_0x29cdd1){if(_0x29cdd1){return _0x29cdd1[_0x506a('0x29')]()[_0x506a('0x28')](function(){var _0xd31abc=_0x29cdd1[_0x506a('0x2a')]({'plain':!![]});var _0x1a339c=_0x506a('0x2b');return db[_0x506a('0x2c')]['destroy']({'where':{'type':_0x1a339c,'resourceId':_0xd31abc['id']}})['then'](function(){return _0x29cdd1;});})[_0x506a('0x28')](function(){_0x59edf0[_0x506a('0x1e')](0xcc)[_0x506a('0x1d')]();});}};}function handleEntityNotFound(_0x64a8ca,_0x3ffda7){return function(_0x10039f){if(!_0x10039f){_0x64a8ca['sendStatus'](0x194);}return _0x10039f;};}function handleError(_0x2311a4,_0x2a924d){_0x2a924d=_0x2a924d||0x1f4;return function(_0x1d408b){logger[_0x506a('0x2d')](_0x1d408b[_0x506a('0x2e')]);if(_0x1d408b['name']){delete _0x1d408b[_0x506a('0x2f')];}_0x2311a4['status'](_0x2a924d)['send'](_0x1d408b);};}exports[_0x506a('0x30')]=function(_0x4925a4,_0x6870c6){var _0x25d5df={},_0x50a4f0={},_0x2dd370={'count':0x0,'rows':[]};var _0x11b6f7=_[_0x506a('0x31')](db[_0x506a('0x32')][_0x506a('0x33')],function(_0x40d50d){return{'name':_0x40d50d[_0x506a('0x34')],'type':_0x40d50d[_0x506a('0x35')][_0x506a('0x36')]};});_0x50a4f0['model']=_[_0x506a('0x31')](_0x11b6f7,'name');_0x50a4f0['query']=_[_0x506a('0x37')](_0x4925a4[_0x506a('0x38')]);_0x50a4f0[_0x506a('0x39')]=_[_0x506a('0x3a')](_0x50a4f0[_0x506a('0x3b')],_0x50a4f0[_0x506a('0x38')]);_0x25d5df[_0x506a('0x3c')]=_[_0x506a('0x3a')](_0x50a4f0[_0x506a('0x3b')],qs[_0x506a('0x3d')](_0x4925a4[_0x506a('0x38')][_0x506a('0x3d')]));_0x25d5df[_0x506a('0x3c')]=_0x25d5df[_0x506a('0x3c')][_0x506a('0x3e')]?_0x25d5df[_0x506a('0x3c')]:_0x50a4f0[_0x506a('0x3b')];if(!_0x4925a4[_0x506a('0x38')][_0x506a('0x3f')](_0x506a('0x40'))){_0x25d5df['limit']=qs[_0x506a('0x22')](_0x4925a4[_0x506a('0x38')][_0x506a('0x22')]);_0x25d5df[_0x506a('0x20')]=qs['offset'](_0x4925a4[_0x506a('0x38')][_0x506a('0x20')]);}_0x25d5df[_0x506a('0x41')]=qs[_0x506a('0x42')](_0x4925a4[_0x506a('0x38')]['sort']);_0x25d5df[_0x506a('0x43')]=qs[_0x506a('0x39')](_['pick'](_0x4925a4[_0x506a('0x38')],_0x50a4f0['filters']),_0x11b6f7);if(_0x4925a4[_0x506a('0x38')]['filter']){_0x25d5df[_0x506a('0x43')]=_[_0x506a('0x44')](_0x25d5df['where'],{'$or':_[_0x506a('0x31')](_0x11b6f7,function(_0x5a62bf){if(_0x5a62bf['type']!==_0x506a('0x45')){var _0x5d1f24={};_0x5d1f24[_0x5a62bf[_0x506a('0x2f')]]={'$like':'%'+_0x4925a4[_0x506a('0x38')][_0x506a('0x46')]+'%'};return _0x5d1f24;}})});}_0x25d5df=_['merge']({},_0x25d5df,_0x4925a4[_0x506a('0x47')]);var _0x18c115={'where':_0x25d5df[_0x506a('0x43')]};return db[_0x506a('0x32')][_0x506a('0x23')](_0x18c115)[_0x506a('0x28')](function(_0x56113d){_0x2dd370[_0x506a('0x23')]=_0x56113d;if(_0x4925a4[_0x506a('0x38')][_0x506a('0x48')]){_0x25d5df[_0x506a('0x49')]=[{'all':!![]}];}return db[_0x506a('0x32')][_0x506a('0x4a')](_0x25d5df);})[_0x506a('0x28')](function(_0x227ea4){_0x2dd370[_0x506a('0x4b')]=_0x227ea4;return _0x2dd370;})[_0x506a('0x28')](respondWithFilteredResult(_0x6870c6,_0x25d5df))['catch'](handleError(_0x6870c6,null));};exports['show']=function(_0x31f487,_0xdf043e){var _0x177289={'raw':![],'where':{'id':_0x31f487[_0x506a('0x4c')]['id']}},_0x39a39a={};_0x39a39a[_0x506a('0x3b')]=_[_0x506a('0x37')](db['CmList'][_0x506a('0x33')]);_0x39a39a[_0x506a('0x38')]=_[_0x506a('0x37')](_0x31f487[_0x506a('0x38')]);_0x39a39a['filters']=_['intersection'](_0x39a39a[_0x506a('0x3b')],_0x39a39a['query']);_0x177289[_0x506a('0x3c')]=_[_0x506a('0x3a')](_0x39a39a['model'],qs[_0x506a('0x3d')](_0x31f487['query'][_0x506a('0x3d')]));_0x177289[_0x506a('0x3c')]=_0x177289[_0x506a('0x3c')]['length']?_0x177289['attributes']:_0x39a39a[_0x506a('0x3b')];if(_0x31f487[_0x506a('0x38')]['includeAll']){_0x177289[_0x506a('0x49')]=[{'all':!![]}];}_0x177289=_['merge']({},_0x177289,_0x31f487[_0x506a('0x47')]);return db['CmList'][_0x506a('0x4d')](_0x177289)[_0x506a('0x28')](handleEntityNotFound(_0xdf043e,null))['then'](respondWithResult(_0xdf043e,null))[_0x506a('0x4e')](handleError(_0xdf043e,null));};exports[_0x506a('0x4f')]=function(_0x51d8a9,_0x3178a0){return db['CmList'][_0x506a('0x4f')](_0x51d8a9[_0x506a('0x50')],{})[_0x506a('0x28')](function(_0x3e3473){var _0x5775e7=_0x51d8a9['user'][_0x506a('0x2a')]({'plain':!![]});if(!_0x5775e7)throw new Error(_0x506a('0x51'));if(_0x5775e7[_0x506a('0x52')]==='user'){var _0x48bce9=_0x3e3473['get']({'plain':!![]});var _0x424d30=_0x506a('0x2b');return db['UserProfileSection'][_0x506a('0x4d')]({'where':{'name':_0x424d30,'userProfileId':_0x5775e7[_0x506a('0x53')]},'raw':!![]})[_0x506a('0x28')](function(_0x11f9d5){if(_0x11f9d5&&_0x11f9d5[_0x506a('0x54')]===0x0){return db['UserProfileResource']['create']({'name':_0x48bce9[_0x506a('0x2f')],'resourceId':_0x48bce9['id'],'type':_0x11f9d5[_0x506a('0x2f')],'sectionId':_0x11f9d5['id']},{})[_0x506a('0x28')](function(){return _0x3e3473;});}else{return _0x3e3473;}})['catch'](function(_0x12abec){logger[_0x506a('0x2d')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x12abec);throw _0x12abec;});}return _0x3e3473;})['then'](respondWithResult(_0x3178a0,0xc9))['catch'](handleError(_0x3178a0,null));};exports['update']=function(_0x17d600,_0x329b35){if(_0x17d600[_0x506a('0x50')]['id']){delete _0x17d600[_0x506a('0x50')]['id'];}return db['CmList'][_0x506a('0x4d')]({'where':{'id':_0x17d600[_0x506a('0x4c')]['id']}})[_0x506a('0x28')](handleEntityNotFound(_0x329b35,null))[_0x506a('0x28')](saveUpdates(_0x17d600[_0x506a('0x50')],null))[_0x506a('0x28')](respondWithResult(_0x329b35,null))['catch'](handleError(_0x329b35,null));};exports['destroy']=function(_0x15667f,_0x5b0e56){return db[_0x506a('0x32')][_0x506a('0x4d')]({'where':{'id':_0x15667f[_0x506a('0x4c')]['id']}})['then'](handleEntityNotFound(_0x5b0e56,null))[_0x506a('0x28')](removeEntity(_0x5b0e56,null))[_0x506a('0x4e')](handleError(_0x5b0e56,null));};exports[_0x506a('0x55')]=function(_0x4b7132,_0x414059){return db[_0x506a('0x32')]['describe']()['then'](respondWithResult(_0x414059,null))[_0x506a('0x4e')](handleError(_0x414059,null));};exports['addDisposition']=function(_0x5e8fca,_0x45e98f,_0x3e6fff){if(_0x5e8fca['body']['id']){delete _0x5e8fca['body']['id'];}return db[_0x506a('0x32')][_0x506a('0x4d')]({'where':{'id':_0x5e8fca[_0x506a('0x4c')]['id']}})[_0x506a('0x28')](handleEntityNotFound(_0x45e98f,null))[_0x506a('0x28')](function(_0x2051fc){if(_0x2051fc){_0x5e8fca[_0x506a('0x50')][_0x506a('0x56')]=_0x2051fc['id'];return db[_0x506a('0x57')]['create'](_0x5e8fca['body']);}})[_0x506a('0x28')](respondWithResult(_0x45e98f,null))[_0x506a('0x4e')](handleError(_0x45e98f,null));};exports['getDispositions']=function(_0x160b97,_0x434bcb,_0x39a3ac){var _0x35c322={'raw':![],'where':{}};var _0x1832af={};var _0x5ccf1d={'count':0x0,'rows':[]};return db[_0x506a('0x32')][_0x506a('0x58')]({'where':{'id':_0x160b97['params']['id']}})[_0x506a('0x28')](handleEntityNotFound(_0x434bcb,null))[_0x506a('0x28')](function(_0x544bb0){if(_0x544bb0){_0x1832af[_0x506a('0x3b')]=_[_0x506a('0x37')](db[_0x506a('0x57')]['rawAttributes']);_0x1832af[_0x506a('0x38')]=_[_0x506a('0x37')](_0x160b97[_0x506a('0x38')]);_0x1832af['filters']=_[_0x506a('0x3a')](_0x1832af['model'],_0x1832af[_0x506a('0x38')]);_0x35c322[_0x506a('0x3c')]=_[_0x506a('0x3a')](_0x1832af[_0x506a('0x3b')],qs[_0x506a('0x3d')](_0x160b97['query'][_0x506a('0x3d')]));_0x35c322[_0x506a('0x3c')]=_0x35c322[_0x506a('0x3c')][_0x506a('0x3e')]?_0x35c322[_0x506a('0x3c')]:_0x1832af[_0x506a('0x3b')];if(!_0x160b97[_0x506a('0x38')][_0x506a('0x3f')]('nolimit')){_0x35c322[_0x506a('0x22')]=qs[_0x506a('0x22')](_0x160b97[_0x506a('0x38')][_0x506a('0x22')]);_0x35c322['offset']=qs[_0x506a('0x20')](_0x160b97[_0x506a('0x38')][_0x506a('0x20')]);}_0x35c322[_0x506a('0x41')]=qs[_0x506a('0x42')](_0x160b97[_0x506a('0x38')][_0x506a('0x42')]);_0x35c322[_0x506a('0x43')]=qs[_0x506a('0x39')](_['pick'](_0x160b97[_0x506a('0x38')],_0x1832af[_0x506a('0x39')]));_0x35c322[_0x506a('0x43')][_0x506a('0x56')]=_0x544bb0['id'];if(_0x160b97[_0x506a('0x38')][_0x506a('0x46')]){_0x35c322[_0x506a('0x43')]=_['merge'](_0x35c322[_0x506a('0x43')],{'$or':_['map'](_0x35c322['attributes'],function(_0x500a96){var _0x17507d={};_0x17507d[_0x500a96]={'$like':'%'+_0x160b97[_0x506a('0x38')][_0x506a('0x46')]+'%'};return _0x17507d;})});}_0x35c322=_['merge']({},_0x35c322,_0x160b97[_0x506a('0x47')]);return db[_0x506a('0x57')][_0x506a('0x23')]({'where':_0x35c322[_0x506a('0x43')]})[_0x506a('0x28')](function(_0x2a1d00){_0x5ccf1d['count']=_0x2a1d00;if(_0x160b97[_0x506a('0x38')][_0x506a('0x48')]){_0x35c322[_0x506a('0x49')]=[{'all':!![]}];}return db[_0x506a('0x57')][_0x506a('0x4a')](_0x35c322);})[_0x506a('0x28')](function(_0x4faeaa){_0x5ccf1d[_0x506a('0x4b')]=_0x4faeaa;return _0x5ccf1d;});}})[_0x506a('0x28')](respondWithFilteredResult(_0x434bcb,_0x35c322))['catch'](handleError(_0x434bcb,null));};exports['removeDispositions']=function(_0x2eb8e2,_0x1145ce,_0x5cdc86){return db[_0x506a('0x32')][_0x506a('0x4d')]({'where':{'id':_0x2eb8e2[_0x506a('0x4c')]['id']}})['then'](handleEntityNotFound(_0x1145ce,null))[_0x506a('0x28')](function(_0x568ad1){if(_0x568ad1){return _0x568ad1[_0x506a('0x59')](_0x2eb8e2[_0x506a('0x38')][_0x506a('0x5a')]);}})['then'](respondWithStatusCode(_0x1145ce,null))['catch'](handleError(_0x1145ce,null));};exports[_0x506a('0x5b')]=function(_0x17824c,_0x396d7c,_0x60a7a6){return db[_0x506a('0x32')][_0x506a('0x4d')]({'where':{'id':_0x17824c[_0x506a('0x4c')]['id']}})[_0x506a('0x28')](handleEntityNotFound(_0x396d7c,null))[_0x506a('0x28')](function(_0x678cb0){if(_0x678cb0){var _0x5e1d94=[];var _0x319e9f={'success':[],'errors':[]};return db[_0x506a('0x5c')]['describe']()['then'](function(_0x48f135){if(_0x17824c[_0x506a('0x50')][_0x506a('0x5d')]&&_[_0x506a('0x5e')](_0x17824c[_0x506a('0x50')][_0x506a('0x5d')])){if(_0x17824c[_0x506a('0x50')]['tags']['length']){_0x17824c[_0x506a('0x50')][_0x506a('0x5d')]=_0x17824c[_0x506a('0x50')][_0x506a('0x5d')][_0x506a('0x5f')](';')+';';}else{_0x17824c[_0x506a('0x50')]['tags']=null;}}else{_0x17824c[_0x506a('0x50')]['tags']=null;}if(_0x17824c['body']&&_['isArray'](_0x17824c[_0x506a('0x50')])){for(var _0x8005a9=0x0;_0x8005a9<_0x17824c['body'][_0x506a('0x3e')];_0x8005a9+=0x1){_0x17824c[_0x506a('0x50')][_0x8005a9][_0x506a('0x56')]=_0x17824c['params']['id'];_0x5e1d94[_0x506a('0x60')](_0x17824c['body'][_0x8005a9]);}return BPromise[_0x506a('0x61')](_0x5e1d94,function(_0x311fcd){return db[_0x506a('0x5c')][_0x506a('0x4f')](_[_0x506a('0x62')](_0x311fcd,[_0x506a('0x5a'),'id'])||{},{'fields':_[_0x506a('0x37')](_0x48f135),'raw':!![]})[_0x506a('0x28')](function(_0x2e45c0){_0x319e9f[_0x506a('0x63')]['push'](_0x2e45c0['dataValues']);})[_0x506a('0x4e')](function(_0xb2d2fd){_0x319e9f[_0x506a('0x64')][_0x506a('0x60')]({'data':_0x311fcd,'error':_0xb2d2fd[_0x506a('0x65')]});});})['then'](function(_0x237da0){return _0x319e9f;})[_0x506a('0x4e')](function(_0x37fd8d){return _0x37fd8d;});}else{_0x396d7c[_0x506a('0x1e')](0x190)[_0x506a('0x1f')]({'message':'Malformed\x20request\x20syntax'});}});}})['then'](respondWithResult(_0x396d7c,null))['catch'](handleError(_0x396d7c,null));};exports[_0x506a('0x66')]=function(_0x33cf44,_0x51f47e,_0x24c8e8){var _0x2a0aa9;return db[_0x506a('0x32')][_0x506a('0x4d')]({'where':{'id':_0x33cf44['params']['id']},'include':[{'model':db[_0x506a('0x67')],'as':_0x506a('0x68')}]})['then'](handleEntityNotFound(_0x51f47e,null))[_0x506a('0x28')](function(_0x16978a){if(_0x16978a){_0x2a0aa9=_0x16978a;return db[_0x506a('0x5c')][_0x506a('0x33')];}})[_0x506a('0x28')](function(_0x5ded81){if(_0x5ded81){var _0xfa8f40={};var _0x3f7e16={};_0x3f7e16[_0x506a('0x3b')]=_[_0x506a('0x69')](_[_0x506a('0x37')](_0x5ded81),_[_0x506a('0x31')](_0x2a0aa9[_0x506a('0x68')],function(_0x506468){return util[_0x506a('0x6a')](_0x506a('0x6b'),_0x506468['id']);}));_0x3f7e16[_0x506a('0x38')]=_[_0x506a('0x37')](_0x33cf44[_0x506a('0x38')]);_0x3f7e16[_0x506a('0x39')]=_[_0x506a('0x3a')](_0x3f7e16[_0x506a('0x3b')],_0x3f7e16[_0x506a('0x38')]);_0xfa8f40[_0x506a('0x3c')]=_[_0x506a('0x3a')](_0x3f7e16[_0x506a('0x3b')],qs[_0x506a('0x3d')](_0x33cf44[_0x506a('0x38')][_0x506a('0x3d')]));_0xfa8f40[_0x506a('0x3c')]=_0xfa8f40[_0x506a('0x3c')][_0x506a('0x3e')]?_0xfa8f40[_0x506a('0x3c')]:_0x3f7e16[_0x506a('0x3b')];if(!_0x33cf44['query'][_0x506a('0x3f')]('nolimit')){_0xfa8f40[_0x506a('0x22')]=qs['limit'](_0x33cf44[_0x506a('0x38')][_0x506a('0x22')]);_0xfa8f40[_0x506a('0x20')]=qs[_0x506a('0x20')](_0x33cf44[_0x506a('0x38')]['offset']);}_0xfa8f40[_0x506a('0x41')]=qs[_0x506a('0x42')](_0x33cf44['query'][_0x506a('0x42')]);_0xfa8f40['where']=qs[_0x506a('0x39')](_[_0x506a('0x6c')](_0x33cf44['query'],_0x3f7e16[_0x506a('0x39')]));_0xfa8f40[_0x506a('0x6d')]=!![];if(_0x33cf44[_0x506a('0x38')]['filter']){_0xfa8f40[_0x506a('0x43')]=_[_0x506a('0x44')](_0xfa8f40[_0x506a('0x43')],{'$or':_[_0x506a('0x31')](_0xfa8f40[_0x506a('0x3c')],function(_0x11b4ff){var _0x3f34fb={};_0x3f34fb[_0x11b4ff]={'$like':'%'+_0x33cf44[_0x506a('0x38')]['filter']+'%'};return _0x3f34fb;})});}_0xfa8f40=_[_0x506a('0x44')]({},_0xfa8f40,_0x33cf44[_0x506a('0x47')]);return _0x2a0aa9[_0x506a('0x66')](_0xfa8f40);}})[_0x506a('0x28')](respondWithResult(_0x51f47e,null))['catch'](handleError(_0x51f47e,null));};exports[_0x506a('0x6e')]=function(_0x55c33c,_0x52394d,_0x1b342b){var _0xa8c366;var _0x1dcb73;var _0x1f8168;var _0x1f9b41=_0x55c33c[_0x506a('0x4c')]['id'];csv_results=[];return db[_0x506a('0x6f')][_0x506a('0x4a')]({'attributes':['id',_0x506a('0x2f')],'raw':!![],'order':[_0x506a('0x70')]})[_0x506a('0x28')](function(_0x2ad53e){_0xa8c366=_0x2ad53e;var _0x173a60=_[_0x506a('0x37')](db[_0x506a('0x5c')][_0x506a('0x33')]);return db[_0x506a('0x67')][_0x506a('0x4a')]({'raw':!![],'attributes':['id',_0x506a('0x71')]})[_0x506a('0x28')](function(_0xfde3e0){_0x1dcb73=_0xfde3e0;var _0x49f740=squel['select']()[_0x506a('0x3d')](_0x173a60)[_0x506a('0x72')](_0x506a('0x73'),'c')[_0x506a('0x43')](_0x506a('0x74'),_0x1f9b41)[_0x506a('0x43')]('c.deletedAt\x20is\x20null')['distinct']();for(var _0x3dffd2=0x0;_0x3dffd2<_0x1dcb73[_0x506a('0x3e')];_0x3dffd2++){_0x49f740[_0x506a('0x75')]('c.cf_'+_0x1dcb73[_0x3dffd2]['id'],_0x506a('0x76')+_0x1dcb73[_0x3dffd2][_0x506a('0x71')]);}for(var _0x3dffd2=0x0;_0x3dffd2<_0xa8c366[_0x506a('0x3e')];_0x3dffd2++){_0x49f740['field'](squel['select']()['field'](_0x506a('0x77'))['from'](_0x506a('0x78'))[_0x506a('0x43')](_0x506a('0x79'),_0xa8c366[_0x3dffd2]['id'])[_0x506a('0x43')](_0x506a('0x7a')),_0x506a('0x7b')+_0xa8c366[_0x3dffd2][_0x506a('0x2f')]);_0x49f740['field'](squel[_0x506a('0x7c')]()[_0x506a('0x75')](_0x506a('0x7d'))[_0x506a('0x72')](_0x506a('0x78'))[_0x506a('0x43')]('ItemTypeId\x20=\x20?',_0xa8c366[_0x3dffd2]['id'])['where'](_0x506a('0x7a')),'description_additionalPhone_'+_0xa8c366[_0x3dffd2][_0x506a('0x2f')]);}var _0x3489bd=[];_0x3489bd[_0x506a('0x60')](_0x49f740[_0x506a('0x7e')]());BPromise[_0x506a('0x61')](_0x3489bd,handleQuery)[_0x506a('0x28')](function(_0x1a50f1){handleQuery(_0x49f740[_0x506a('0x7e')]());var _0x1b289f=csv_results[0x0];if(!_[_0x506a('0x7f')](_0x1b289f)){var _0x52ea3d=toCsv(_0x1b289f);var _0x48e927=Date[_0x506a('0x80')]();fs[_0x506a('0x81')](util['format'](_0x506a('0x82'),_0x1f9b41,_0x48e927),_0x52ea3d);_0x52394d['setHeader'](_0x506a('0x83'),_0x506a('0x84')+util[_0x506a('0x6a')](_0x506a('0x85'),_0x1f9b41,_0x48e927));_0x52394d[_0x506a('0x86')](_0x506a('0x87'),'text/csv');return _0x52394d['download'](util['format'](_0x506a('0x82'),_0x1f9b41,_0x48e927));}else{return _0x52394d[_0x506a('0x88')](0xcc);}});});});};exports[_0x506a('0x89')]=function(_0x5271f2,_0x2305c2,_0x591aab){var _0x1fd401;delete _0x5271f2[_0x506a('0x50')]['id'];return db['CmList'][_0x506a('0x58')]({'where':{'id':_0x5271f2[_0x506a('0x4c')]['id']}})[_0x506a('0x28')](handleEntityNotFound(_0x2305c2,null))[_0x506a('0x28')](function(_0x3de6fe){if(_0x3de6fe){return db[_0x506a('0x8a')]['transaction'](function(_0x3da571){return db[_0x506a('0x67')][_0x506a('0x4f')](_0x5271f2[_0x506a('0x50')],{'transaction':_0x3da571})[_0x506a('0x28')](function(_0x57936d){_0x1fd401=_0x57936d;return _0x3de6fe[_0x506a('0x8b')](_0x57936d,{'transaction':_0x3da571});})[_0x506a('0x28')](function(){var _0x3a47cc={'type':db[_0x506a('0x8c')][_0x506a('0x8d')],'transaction':_0x3da571};switch(_0x5271f2['body'][_0x506a('0x35')]){case _0x506a('0x8e'):_0x3a47cc[_0x506a('0x35')]=db[_0x506a('0x8c')]['TEXT'];break;case _0x506a('0x8f'):_0x3a47cc[_0x506a('0x35')]=db['Sequelize'][_0x506a('0x90')];break;case _0x506a('0x91'):_0x3a47cc[_0x506a('0x35')]=db['Sequelize']['BOOLEAN'];_0x3a47cc[_0x506a('0x92')]=![];break;default:}return db[_0x506a('0x8a')][_0x506a('0x93')][_0x506a('0x94')](_0x506a('0x73'),util[_0x506a('0x6a')]('cf_%s',_0x1fd401['id']),_0x3a47cc);})[_0x506a('0x28')](function(){return _0x1fd401;});});}})[_0x506a('0x28')](respondWithResult(_0x2305c2,null))[_0x506a('0x4e')](handleError(_0x2305c2,null));};exports['getCustomFields']=function(_0x59cf09,_0x1d9346,_0x3bcd4a){var _0x1107a7={};var _0x51a3c8={};var _0x26ee96;var _0x510fa5;return db['CmList'][_0x506a('0x58')]({'where':{'id':_0x59cf09[_0x506a('0x4c')]['id']}})['then'](handleEntityNotFound(_0x1d9346,null))[_0x506a('0x28')](function(_0xb71cd2){if(_0xb71cd2){_0x26ee96=_0xb71cd2;_0x51a3c8[_0x506a('0x3b')]=_['keys'](db[_0x506a('0x67')][_0x506a('0x33')]);_0x51a3c8[_0x506a('0x38')]=_[_0x506a('0x37')](_0x59cf09[_0x506a('0x38')]);_0x51a3c8[_0x506a('0x39')]=_[_0x506a('0x3a')](_0x51a3c8[_0x506a('0x3b')],_0x51a3c8[_0x506a('0x38')]);_0x1107a7[_0x506a('0x3c')]=_['intersection'](_0x51a3c8['model'],qs[_0x506a('0x3d')](_0x59cf09['query'][_0x506a('0x3d')]));_0x1107a7['attributes']=_0x1107a7[_0x506a('0x3c')][_0x506a('0x3e')]?_0x1107a7[_0x506a('0x3c')]:_0x51a3c8['model'];_0x1107a7[_0x506a('0x41')]=qs[_0x506a('0x42')](_0x59cf09['query'][_0x506a('0x42')]);_0x1107a7[_0x506a('0x43')]=qs[_0x506a('0x39')](_[_0x506a('0x6c')](_0x59cf09['query'],_0x51a3c8['filters']));_0x1107a7['where']=_['merge'](_0x1107a7[_0x506a('0x43')],{'$or':[{'ListId':_0xb71cd2['id']},{'ListId':null}]});if(_0x59cf09[_0x506a('0x38')][_0x506a('0x46')]){_0x1107a7[_0x506a('0x43')]=_[_0x506a('0x44')](_0x1107a7['where'],{'$or':_['map'](_0x1107a7[_0x506a('0x3c')],function(_0x526603){var _0x54408d={};_0x54408d[_0x526603]={'$like':'%'+_0x59cf09[_0x506a('0x38')]['filter']+'%'};return _0x54408d;})});}_0x1107a7=_['merge']({},_0x1107a7,_0x59cf09[_0x506a('0x47')]);return db[_0x506a('0x67')][_0x506a('0x95')](_0x1107a7);}})['then'](respondWithResult(_0x1d9346,null))['catch'](handleError(_0x1d9346,null));};exports['getGlobalCustomFields']=function(_0x4ba636,_0x21c103){return db['CmCustomField'][_0x506a('0x95')]({'where':{'ListId':null}})['then'](handleEntityNotFound(_0x21c103,null))[_0x506a('0x28')](function(_0x39b343){return _0x39b343;})[_0x506a('0x28')](respondWithResult(_0x21c103,null))[_0x506a('0x4e')](handleError(_0x21c103,null));};exports[_0x506a('0x96')]=function(_0x3f429e,_0xd2a9f9,_0x3e7daa){return db[_0x506a('0x32')][_0x506a('0x4d')]({'where':{'id':_0x3f429e[_0x506a('0x4c')]['id']}})[_0x506a('0x28')](handleEntityNotFound(_0xd2a9f9,null))[_0x506a('0x28')](function(_0x2a2354){if(_0x2a2354){return _0x2a2354[_0x506a('0x96')](_0x3f429e[_0x506a('0x50')]['ids'],_['omit'](_0x3f429e['body'],['ids','id'])||{})[_0x506a('0x97')](function(_0x591b91){for(var _0x41795b=0x0;_0x41795b<_0x3f429e['body']['ids'][_0x506a('0x3e')];_0x41795b+=0x1){socket[_0x506a('0x98')](_0x506a('0x99'),{'UserId':Number(_0x3f429e['body'][_0x506a('0x5a')][_0x41795b]),'CmListId':Number(_0x3f429e[_0x506a('0x4c')]['id'])});}return _0x591b91;});}})[_0x506a('0x28')](respondWithResult(_0xd2a9f9,null))[_0x506a('0x4e')](handleError(_0xd2a9f9,null));};exports[_0x506a('0x9a')]=function(_0x290db9,_0x38dced,_0x296c28){return db['CmList'][_0x506a('0x4d')]({'where':{'id':_0x290db9[_0x506a('0x4c')]['id']}})[_0x506a('0x28')](handleEntityNotFound(_0x38dced,null))[_0x506a('0x28')](function(_0x10c6ec){if(_0x10c6ec){return _0x10c6ec[_0x506a('0x9a')](_0x290db9['query'][_0x506a('0x5a')])[_0x506a('0x28')](function(){if(_[_0x506a('0x5e')](_0x290db9[_0x506a('0x38')]['ids'])){for(var _0x15ae3c=0x0;_0x15ae3c<_0x290db9[_0x506a('0x38')]['ids']['length'];_0x15ae3c+=0x1){socket[_0x506a('0x98')](_0x506a('0x9b'),{'UserId':Number(_0x290db9[_0x506a('0x38')][_0x506a('0x5a')][_0x15ae3c]),'CmListId':Number(_0x290db9[_0x506a('0x4c')]['id'])});}}else{socket[_0x506a('0x98')](_0x506a('0x9b'),{'UserId':Number(_0x290db9['query'][_0x506a('0x5a')]),'CmListId':Number(_0x290db9[_0x506a('0x4c')]['id'])});}});}})[_0x506a('0x28')](respondWithStatusCode(_0x38dced,null))[_0x506a('0x4e')](handleError(_0x38dced,null));};exports[_0x506a('0x9c')]=function(_0x12bf22,_0xd31122,_0x6d3a8c){var _0x293160={};var _0x373776={};var _0x3cfc57;var _0x2009f3;return db[_0x506a('0x32')]['findOne']({'where':{'id':_0x12bf22[_0x506a('0x4c')]['id']}})[_0x506a('0x28')](handleEntityNotFound(_0xd31122,null))[_0x506a('0x28')](function(_0x8516f){if(_0x8516f){_0x3cfc57=_0x8516f;_0x373776[_0x506a('0x3b')]=_['keys'](db[_0x506a('0x9d')][_0x506a('0x33')]);_0x373776[_0x506a('0x38')]=_[_0x506a('0x37')](_0x12bf22['query']);_0x373776[_0x506a('0x39')]=_[_0x506a('0x3a')](_0x373776[_0x506a('0x3b')],_0x373776['query']);_0x293160[_0x506a('0x3c')]=_['intersection'](_0x373776['model'],qs[_0x506a('0x3d')](_0x12bf22[_0x506a('0x38')][_0x506a('0x3d')]));_0x293160['attributes']=_0x293160[_0x506a('0x3c')][_0x506a('0x3e')]?_0x293160[_0x506a('0x3c')]:_0x373776[_0x506a('0x3b')];_0x293160[_0x506a('0x41')]=qs[_0x506a('0x42')](_0x12bf22[_0x506a('0x38')][_0x506a('0x42')]);_0x293160[_0x506a('0x43')]=qs[_0x506a('0x39')](_[_0x506a('0x6c')](_0x12bf22[_0x506a('0x38')],_0x373776[_0x506a('0x39')]));if(_0x12bf22[_0x506a('0x38')][_0x506a('0x46')]){_0x293160[_0x506a('0x43')]=_[_0x506a('0x44')](_0x293160['where'],{'$or':_[_0x506a('0x31')](_0x293160[_0x506a('0x3c')],function(_0x5cadb0){var _0x243207={};_0x243207[_0x5cadb0]={'$like':'%'+_0x12bf22[_0x506a('0x38')][_0x506a('0x46')]+'%'};return _0x243207;})});}_0x293160=_[_0x506a('0x44')]({},_0x293160,_0x12bf22['options']);return _0x3cfc57['getAgents'](_0x293160);}})[_0x506a('0x28')](function(_0x1a5ed7){if(_0x1a5ed7){_0x2009f3=_0x1a5ed7[_0x506a('0x3e')];if(!_0x12bf22[_0x506a('0x38')][_0x506a('0x3f')](_0x506a('0x40'))){_0x293160[_0x506a('0x22')]=qs[_0x506a('0x22')](_0x12bf22[_0x506a('0x38')]['limit']);_0x293160[_0x506a('0x20')]=qs[_0x506a('0x20')](_0x12bf22[_0x506a('0x38')][_0x506a('0x20')]);}return _0x3cfc57[_0x506a('0x9c')](_0x293160);}})[_0x506a('0x28')](function(_0x2fe94a){if(_0x2fe94a){return _0x2fe94a?{'count':_0x2009f3,'rows':_0x2fe94a}:null;}})[_0x506a('0x28')](respondWithResult(_0xd31122,null))[_0x506a('0x4e')](handleError(_0xd31122,null));};function handleQuery(_0x2a6e4b){logger[_0x506a('0x9e')](_0x2a6e4b);return db[_0x506a('0x8a')][_0x506a('0x38')](_0x2a6e4b)['spread'](function(_0x416741){csv_results[_0x506a('0x60')](_0x416741);})[_0x506a('0x4e')](function(_0x51f3d9){logger[_0x506a('0x2d')](_0x51f3d9['message']);});} \ No newline at end of file +var _0x6491=['catch','show','params','find','create','body','role','user','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','describe','Disposition','hasOwnProperty','ListId','include','removeDispositions','ids','addContacts','CmContact','tags','isArray','join','push','omit','success','dataValues','message','Malformed\x20request\x20syntax','getContacts','CustomFields','format','cf_%d','raw','ContactItemType','OrderBy','alias','select','from','cm_contacts','c.ListId\x20=\x20?','c.deletedAt\x20is\x20null','distinct','field','c.cf_','customField_','item','cm_contact_has_items','ItemTypeId\x20=\x20?','CmContactId\x20=\x20c.id','description','description_additionalPhone_','toString','each','isEmpty','now','setHeader','Content-disposition','attachment;\x20filename=','list_%d_%s.csv','text/csv','download','/tmp/list_%d_%s.csv','findOne','transaction','CmCustomField','addCustomFields','Sequelize','TEXT','number','INTEGER','switch','BOOLEAN','defaultValue','sequelize','addColumn','cf_%s','getCustomFields','getGlobalCustomFields','findAndCountAll','addAgents','userCmList:save','removeAgents','emit','userCmList:remove','getAgents','User','info','spread','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','path','ejs','fs-extra','lodash','crypto','jsforce','desk.js','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/license/util','../../mysqldb','redis','localhost','socket.io-emitter','./cmList.socket','register','sendStatus','status','json','undefined','limit','offset','count','set','Content-Range','apply','update','then','destroy','get','Lists','UserProfileResource','end','error','name','send','index','CmList','rawAttributes','type','key','model','map','keys','query','filters','intersection','attributes','fields','length','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','findAll','rows'];(function(_0x38abef,_0x59f183){var _0x39107c=function(_0x4ca769){while(--_0x4ca769){_0x38abef['push'](_0x38abef['shift']());}};_0x39107c(++_0x59f183);}(_0x6491,0x197));var _0x1649=function(_0x256f61,_0x203a08){_0x256f61=_0x256f61-0x0;var _0x4174b6=_0x6491[_0x256f61];return _0x4174b6;};'use strict';var emlformat=require(_0x1649('0x0'));var rimraf=require(_0x1649('0x1'));var zipdir=require(_0x1649('0x2'));var jsonpatch=require(_0x1649('0x3'));var rp=require(_0x1649('0x4'));var moment=require('moment');var BPromise=require(_0x1649('0x5'));var Mustache=require(_0x1649('0x6'));var util=require('util');var path=require(_0x1649('0x7'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0x1649('0x8'));var fs=require('fs');var fs_extra=require(_0x1649('0x9'));var _=require(_0x1649('0xa'));var squel=require('squel');var crypto=require(_0x1649('0xb'));var jsforce=require(_0x1649('0xc'));var deskjs=require(_0x1649('0xd'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x1649('0xe'));var Redis=require(_0x1649('0xf'));var authService=require('../../components/auth/service');var qs=require(_0x1649('0x10'));var as=require(_0x1649('0x11'));var hardwareService=require(_0x1649('0x12'));var logger=require(_0x1649('0x13'))('api');var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0x1649('0x14'));var db=require(_0x1649('0x15'))['db'];var csv_results;config[_0x1649('0x16')]=_['defaults'](config[_0x1649('0x16')],{'host':_0x1649('0x17'),'port':0x18eb});var socket=require(_0x1649('0x18'))(new Redis(config[_0x1649('0x16')]));require(_0x1649('0x19'))[_0x1649('0x1a')](socket);function respondWithStatusCode(_0x199d9c,_0x15a0bd){_0x15a0bd=_0x15a0bd||0xcc;return function(_0x24076c){if(_0x24076c){return _0x199d9c[_0x1649('0x1b')](_0x15a0bd);}return _0x199d9c[_0x1649('0x1c')](_0x15a0bd)['end']();};}function respondWithResult(_0x55b593,_0x137f51){_0x137f51=_0x137f51||0xc8;return function(_0xeed641){if(_0xeed641){return _0x55b593[_0x1649('0x1c')](_0x137f51)[_0x1649('0x1d')](_0xeed641);}};}function respondWithFilteredResult(_0xa1c900,_0x469c57){return function(_0xe151d9){if(_0xe151d9){var _0x2cdc7f=typeof _0x469c57['offset']===_0x1649('0x1e')&&typeof _0x469c57[_0x1649('0x1f')]===_0x1649('0x1e');var _0x5f4918=_0xe151d9['count'];var _0x2accb7=_0x2cdc7f?0x0:_0x469c57[_0x1649('0x20')];var _0x46b5dd=_0x2cdc7f?_0xe151d9[_0x1649('0x21')]:_0x469c57[_0x1649('0x20')]+_0x469c57[_0x1649('0x1f')];var _0x169e22;if(_0x46b5dd>=_0x5f4918){_0x46b5dd=_0x5f4918;_0x169e22=0xc8;}else{_0x169e22=0xce;}_0xa1c900[_0x1649('0x1c')](_0x169e22);return _0xa1c900[_0x1649('0x22')](_0x1649('0x23'),_0x2accb7+'-'+_0x46b5dd+'/'+_0x5f4918)[_0x1649('0x1d')](_0xe151d9);}return null;};}function patchUpdates(_0x5d144){return function(_0x3303ee){try{jsonpatch[_0x1649('0x24')](_0x3303ee,_0x5d144,!![]);}catch(_0x55f05a){return BPromise['reject'](_0x55f05a);}return _0x3303ee['save']();};}function saveUpdates(_0x5cd0f4,_0x4cd01f){return function(_0x12e52d){if(_0x12e52d){return _0x12e52d[_0x1649('0x25')](_0x5cd0f4)[_0x1649('0x26')](function(_0x33ad38){return _0x33ad38;});}return null;};}function removeEntity(_0x14beae,_0x5aa03a){return function(_0x3a95c5){if(_0x3a95c5){return _0x3a95c5[_0x1649('0x27')]()[_0x1649('0x26')](function(){var _0x3242d7=_0x3a95c5[_0x1649('0x28')]({'plain':!![]});var _0x4caf5d=_0x1649('0x29');return db[_0x1649('0x2a')][_0x1649('0x27')]({'where':{'type':_0x4caf5d,'resourceId':_0x3242d7['id']}})[_0x1649('0x26')](function(){return _0x3a95c5;});})[_0x1649('0x26')](function(){_0x14beae[_0x1649('0x1c')](0xcc)[_0x1649('0x2b')]();});}};}function handleEntityNotFound(_0x214a05,_0x5723dd){return function(_0x1bc1e3){if(!_0x1bc1e3){_0x214a05[_0x1649('0x1b')](0x194);}return _0x1bc1e3;};}function handleError(_0x317dce,_0x385cce){_0x385cce=_0x385cce||0x1f4;return function(_0x417e09){logger[_0x1649('0x2c')](_0x417e09['stack']);if(_0x417e09[_0x1649('0x2d')]){delete _0x417e09['name'];}_0x317dce['status'](_0x385cce)[_0x1649('0x2e')](_0x417e09);};}exports[_0x1649('0x2f')]=function(_0x4db1bc,_0x5ea3d5){var _0x41d4e1={},_0x13ba98={},_0x10a230={'count':0x0,'rows':[]};var _0x57b9e9=_['map'](db[_0x1649('0x30')][_0x1649('0x31')],function(_0x152279){return{'name':_0x152279['fieldName'],'type':_0x152279[_0x1649('0x32')][_0x1649('0x33')]};});_0x13ba98[_0x1649('0x34')]=_[_0x1649('0x35')](_0x57b9e9,_0x1649('0x2d'));_0x13ba98['query']=_[_0x1649('0x36')](_0x4db1bc[_0x1649('0x37')]);_0x13ba98[_0x1649('0x38')]=_[_0x1649('0x39')](_0x13ba98[_0x1649('0x34')],_0x13ba98['query']);_0x41d4e1[_0x1649('0x3a')]=_[_0x1649('0x39')](_0x13ba98['model'],qs[_0x1649('0x3b')](_0x4db1bc[_0x1649('0x37')][_0x1649('0x3b')]));_0x41d4e1[_0x1649('0x3a')]=_0x41d4e1['attributes'][_0x1649('0x3c')]?_0x41d4e1[_0x1649('0x3a')]:_0x13ba98[_0x1649('0x34')];if(!_0x4db1bc[_0x1649('0x37')]['hasOwnProperty'](_0x1649('0x3d'))){_0x41d4e1[_0x1649('0x1f')]=qs[_0x1649('0x1f')](_0x4db1bc['query'][_0x1649('0x1f')]);_0x41d4e1[_0x1649('0x20')]=qs[_0x1649('0x20')](_0x4db1bc[_0x1649('0x37')][_0x1649('0x20')]);}_0x41d4e1[_0x1649('0x3e')]=qs[_0x1649('0x3f')](_0x4db1bc[_0x1649('0x37')][_0x1649('0x3f')]);_0x41d4e1[_0x1649('0x40')]=qs[_0x1649('0x38')](_[_0x1649('0x41')](_0x4db1bc[_0x1649('0x37')],_0x13ba98['filters']),_0x57b9e9);if(_0x4db1bc['query'][_0x1649('0x42')]){_0x41d4e1[_0x1649('0x40')]=_[_0x1649('0x43')](_0x41d4e1[_0x1649('0x40')],{'$or':_[_0x1649('0x35')](_0x57b9e9,function(_0x16ee25){if(_0x16ee25[_0x1649('0x32')]!==_0x1649('0x44')){var _0x51e6c3={};_0x51e6c3[_0x16ee25[_0x1649('0x2d')]]={'$like':'%'+_0x4db1bc[_0x1649('0x37')][_0x1649('0x42')]+'%'};return _0x51e6c3;}})});}_0x41d4e1=_[_0x1649('0x43')]({},_0x41d4e1,_0x4db1bc[_0x1649('0x45')]);var _0x20ad61={'where':_0x41d4e1[_0x1649('0x40')]};return db['CmList'][_0x1649('0x21')](_0x20ad61)[_0x1649('0x26')](function(_0x2554ed){_0x10a230['count']=_0x2554ed;if(_0x4db1bc[_0x1649('0x37')][_0x1649('0x46')]){_0x41d4e1['include']=[{'all':!![]}];}return db[_0x1649('0x30')][_0x1649('0x47')](_0x41d4e1);})[_0x1649('0x26')](function(_0x401e62){_0x10a230[_0x1649('0x48')]=_0x401e62;return _0x10a230;})[_0x1649('0x26')](respondWithFilteredResult(_0x5ea3d5,_0x41d4e1))[_0x1649('0x49')](handleError(_0x5ea3d5,null));};exports[_0x1649('0x4a')]=function(_0x297dab,_0xf23921){var _0x5a7077={'raw':![],'where':{'id':_0x297dab[_0x1649('0x4b')]['id']}},_0x3d2168={};_0x3d2168[_0x1649('0x34')]=_['keys'](db[_0x1649('0x30')][_0x1649('0x31')]);_0x3d2168[_0x1649('0x37')]=_['keys'](_0x297dab[_0x1649('0x37')]);_0x3d2168[_0x1649('0x38')]=_[_0x1649('0x39')](_0x3d2168[_0x1649('0x34')],_0x3d2168['query']);_0x5a7077[_0x1649('0x3a')]=_[_0x1649('0x39')](_0x3d2168['model'],qs[_0x1649('0x3b')](_0x297dab[_0x1649('0x37')][_0x1649('0x3b')]));_0x5a7077[_0x1649('0x3a')]=_0x5a7077[_0x1649('0x3a')][_0x1649('0x3c')]?_0x5a7077[_0x1649('0x3a')]:_0x3d2168[_0x1649('0x34')];if(_0x297dab[_0x1649('0x37')][_0x1649('0x46')]){_0x5a7077['include']=[{'all':!![]}];}_0x5a7077=_[_0x1649('0x43')]({},_0x5a7077,_0x297dab[_0x1649('0x45')]);return db[_0x1649('0x30')][_0x1649('0x4c')](_0x5a7077)[_0x1649('0x26')](handleEntityNotFound(_0xf23921,null))[_0x1649('0x26')](respondWithResult(_0xf23921,null))[_0x1649('0x49')](handleError(_0xf23921,null));};exports[_0x1649('0x4d')]=function(_0x368d87,_0x81709f){return db[_0x1649('0x30')]['create'](_0x368d87[_0x1649('0x4e')],{})[_0x1649('0x26')](function(_0x1e710d){var _0x293dc6=_0x368d87['user'][_0x1649('0x28')]({'plain':!![]});if(!_0x293dc6)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x293dc6[_0x1649('0x4f')]===_0x1649('0x50')){var _0x267317=_0x1e710d[_0x1649('0x28')]({'plain':!![]});var _0x5c4de1=_0x1649('0x29');return db['UserProfileSection'][_0x1649('0x4c')]({'where':{'name':_0x5c4de1,'userProfileId':_0x293dc6['userProfileId']},'raw':!![]})['then'](function(_0x28705c){if(_0x28705c&&_0x28705c['autoAssociation']===0x0){return db[_0x1649('0x2a')][_0x1649('0x4d')]({'name':_0x267317[_0x1649('0x2d')],'resourceId':_0x267317['id'],'type':_0x28705c[_0x1649('0x2d')],'sectionId':_0x28705c['id']},{})[_0x1649('0x26')](function(){return _0x1e710d;});}else{return _0x1e710d;}})[_0x1649('0x49')](function(_0x553cf8){logger[_0x1649('0x2c')](_0x1649('0x51'),_0x553cf8);throw _0x553cf8;});}return _0x1e710d;})[_0x1649('0x26')](respondWithResult(_0x81709f,0xc9))['catch'](handleError(_0x81709f,null));};exports[_0x1649('0x25')]=function(_0x3620c7,_0x12d251){if(_0x3620c7[_0x1649('0x4e')]['id']){delete _0x3620c7[_0x1649('0x4e')]['id'];}return db[_0x1649('0x30')]['find']({'where':{'id':_0x3620c7[_0x1649('0x4b')]['id']}})['then'](handleEntityNotFound(_0x12d251,null))['then'](saveUpdates(_0x3620c7[_0x1649('0x4e')],null))[_0x1649('0x26')](respondWithResult(_0x12d251,null))[_0x1649('0x49')](handleError(_0x12d251,null));};exports[_0x1649('0x27')]=function(_0x1ce998,_0x29e07d){return db[_0x1649('0x30')]['find']({'where':{'id':_0x1ce998['params']['id']}})[_0x1649('0x26')](handleEntityNotFound(_0x29e07d,null))[_0x1649('0x26')](removeEntity(_0x29e07d,null))[_0x1649('0x49')](handleError(_0x29e07d,null));};exports[_0x1649('0x52')]=function(_0x3a419d,_0x398cc6){return db[_0x1649('0x30')][_0x1649('0x52')]()['then'](respondWithResult(_0x398cc6,null))['catch'](handleError(_0x398cc6,null));};exports['addDisposition']=function(_0xc20589,_0x1a7370,_0x1193b0){if(_0xc20589[_0x1649('0x4e')]['id']){delete _0xc20589[_0x1649('0x4e')]['id'];}return db[_0x1649('0x30')][_0x1649('0x4c')]({'where':{'id':_0xc20589[_0x1649('0x4b')]['id']}})[_0x1649('0x26')](handleEntityNotFound(_0x1a7370,null))[_0x1649('0x26')](function(_0x4e056f){if(_0x4e056f){_0xc20589[_0x1649('0x4e')]['ListId']=_0x4e056f['id'];return db[_0x1649('0x53')][_0x1649('0x4d')](_0xc20589[_0x1649('0x4e')]);}})[_0x1649('0x26')](respondWithResult(_0x1a7370,null))[_0x1649('0x49')](handleError(_0x1a7370,null));};exports['getDispositions']=function(_0x3d5d81,_0x3a0de3,_0x588e46){var _0x5bad79={'raw':![],'where':{}};var _0x42c2a4={};var _0x3818a7={'count':0x0,'rows':[]};return db[_0x1649('0x30')]['findOne']({'where':{'id':_0x3d5d81[_0x1649('0x4b')]['id']}})['then'](handleEntityNotFound(_0x3a0de3,null))[_0x1649('0x26')](function(_0x300fc7){if(_0x300fc7){_0x42c2a4['model']=_[_0x1649('0x36')](db[_0x1649('0x53')][_0x1649('0x31')]);_0x42c2a4['query']=_[_0x1649('0x36')](_0x3d5d81[_0x1649('0x37')]);_0x42c2a4[_0x1649('0x38')]=_[_0x1649('0x39')](_0x42c2a4[_0x1649('0x34')],_0x42c2a4[_0x1649('0x37')]);_0x5bad79[_0x1649('0x3a')]=_['intersection'](_0x42c2a4[_0x1649('0x34')],qs[_0x1649('0x3b')](_0x3d5d81['query'][_0x1649('0x3b')]));_0x5bad79[_0x1649('0x3a')]=_0x5bad79[_0x1649('0x3a')][_0x1649('0x3c')]?_0x5bad79[_0x1649('0x3a')]:_0x42c2a4[_0x1649('0x34')];if(!_0x3d5d81[_0x1649('0x37')][_0x1649('0x54')]('nolimit')){_0x5bad79[_0x1649('0x1f')]=qs[_0x1649('0x1f')](_0x3d5d81[_0x1649('0x37')][_0x1649('0x1f')]);_0x5bad79['offset']=qs[_0x1649('0x20')](_0x3d5d81['query'][_0x1649('0x20')]);}_0x5bad79[_0x1649('0x3e')]=qs[_0x1649('0x3f')](_0x3d5d81[_0x1649('0x37')]['sort']);_0x5bad79[_0x1649('0x40')]=qs[_0x1649('0x38')](_[_0x1649('0x41')](_0x3d5d81['query'],_0x42c2a4[_0x1649('0x38')]));_0x5bad79[_0x1649('0x40')][_0x1649('0x55')]=_0x300fc7['id'];if(_0x3d5d81['query'][_0x1649('0x42')]){_0x5bad79[_0x1649('0x40')]=_[_0x1649('0x43')](_0x5bad79[_0x1649('0x40')],{'$or':_[_0x1649('0x35')](_0x5bad79[_0x1649('0x3a')],function(_0x3372ca){var _0x1a5bd8={};_0x1a5bd8[_0x3372ca]={'$like':'%'+_0x3d5d81[_0x1649('0x37')][_0x1649('0x42')]+'%'};return _0x1a5bd8;})});}_0x5bad79=_[_0x1649('0x43')]({},_0x5bad79,_0x3d5d81['options']);return db['Disposition'][_0x1649('0x21')]({'where':_0x5bad79[_0x1649('0x40')]})[_0x1649('0x26')](function(_0x2a052c){_0x3818a7[_0x1649('0x21')]=_0x2a052c;if(_0x3d5d81[_0x1649('0x37')][_0x1649('0x46')]){_0x5bad79[_0x1649('0x56')]=[{'all':!![]}];}return db['Disposition'][_0x1649('0x47')](_0x5bad79);})[_0x1649('0x26')](function(_0x1f4155){_0x3818a7[_0x1649('0x48')]=_0x1f4155;return _0x3818a7;});}})[_0x1649('0x26')](respondWithFilteredResult(_0x3a0de3,_0x5bad79))[_0x1649('0x49')](handleError(_0x3a0de3,null));};exports['removeDispositions']=function(_0x271b67,_0x8f679f,_0x5ea104){return db['CmList']['find']({'where':{'id':_0x271b67['params']['id']}})[_0x1649('0x26')](handleEntityNotFound(_0x8f679f,null))[_0x1649('0x26')](function(_0x703d82){if(_0x703d82){return _0x703d82[_0x1649('0x57')](_0x271b67[_0x1649('0x37')][_0x1649('0x58')]);}})[_0x1649('0x26')](respondWithStatusCode(_0x8f679f,null))[_0x1649('0x49')](handleError(_0x8f679f,null));};exports[_0x1649('0x59')]=function(_0x43c73c,_0x2055d3,_0x22aa36){return db[_0x1649('0x30')]['find']({'where':{'id':_0x43c73c[_0x1649('0x4b')]['id']}})[_0x1649('0x26')](handleEntityNotFound(_0x2055d3,null))[_0x1649('0x26')](function(_0x53b993){if(_0x53b993){var _0x5073e6=[];var _0x375d07={'success':[],'errors':[]};return db[_0x1649('0x5a')][_0x1649('0x52')]()[_0x1649('0x26')](function(_0x209e6a){if(_0x43c73c[_0x1649('0x4e')][_0x1649('0x5b')]&&_[_0x1649('0x5c')](_0x43c73c['body'][_0x1649('0x5b')])){if(_0x43c73c['body'][_0x1649('0x5b')]['length']){_0x43c73c['body']['tags']=_0x43c73c['body'][_0x1649('0x5b')][_0x1649('0x5d')](';')+';';}else{_0x43c73c['body'][_0x1649('0x5b')]=null;}}else{_0x43c73c[_0x1649('0x4e')][_0x1649('0x5b')]=null;}if(_0x43c73c[_0x1649('0x4e')]&&_['isArray'](_0x43c73c[_0x1649('0x4e')])){for(var _0x7ed20e=0x0;_0x7ed20e<_0x43c73c[_0x1649('0x4e')][_0x1649('0x3c')];_0x7ed20e+=0x1){_0x43c73c['body'][_0x7ed20e]['ListId']=_0x43c73c[_0x1649('0x4b')]['id'];_0x5073e6[_0x1649('0x5e')](_0x43c73c['body'][_0x7ed20e]);}return BPromise['each'](_0x5073e6,function(_0xe53bfe){return db[_0x1649('0x5a')][_0x1649('0x4d')](_[_0x1649('0x5f')](_0xe53bfe,[_0x1649('0x58'),'id'])||{},{'fields':_[_0x1649('0x36')](_0x209e6a),'raw':!![]})[_0x1649('0x26')](function(_0x517cd9){_0x375d07[_0x1649('0x60')][_0x1649('0x5e')](_0x517cd9[_0x1649('0x61')]);})[_0x1649('0x49')](function(_0x1e89d3){_0x375d07['errors'][_0x1649('0x5e')]({'data':_0xe53bfe,'error':_0x1e89d3[_0x1649('0x62')]});});})[_0x1649('0x26')](function(_0x4b19c8){return _0x375d07;})[_0x1649('0x49')](function(_0x3c0227){return _0x3c0227;});}else{_0x2055d3[_0x1649('0x1c')](0x190)['json']({'message':_0x1649('0x63')});}});}})[_0x1649('0x26')](respondWithResult(_0x2055d3,null))[_0x1649('0x49')](handleError(_0x2055d3,null));};exports[_0x1649('0x64')]=function(_0x221fca,_0x5ce2ac,_0x151255){var _0x1dee9c;return db[_0x1649('0x30')][_0x1649('0x4c')]({'where':{'id':_0x221fca['params']['id']},'include':[{'model':db['CmCustomField'],'as':_0x1649('0x65')}]})[_0x1649('0x26')](handleEntityNotFound(_0x5ce2ac,null))[_0x1649('0x26')](function(_0x3db4e0){if(_0x3db4e0){_0x1dee9c=_0x3db4e0;return db[_0x1649('0x5a')][_0x1649('0x31')];}})[_0x1649('0x26')](function(_0x9fc4f4){if(_0x9fc4f4){var _0xadefd={};var _0x5ed7b2={};_0x5ed7b2[_0x1649('0x34')]=_['concat'](_[_0x1649('0x36')](_0x9fc4f4),_['map'](_0x1dee9c[_0x1649('0x65')],function(_0x4ce73e){return util[_0x1649('0x66')](_0x1649('0x67'),_0x4ce73e['id']);}));_0x5ed7b2['query']=_[_0x1649('0x36')](_0x221fca['query']);_0x5ed7b2['filters']=_[_0x1649('0x39')](_0x5ed7b2[_0x1649('0x34')],_0x5ed7b2['query']);_0xadefd[_0x1649('0x3a')]=_[_0x1649('0x39')](_0x5ed7b2[_0x1649('0x34')],qs[_0x1649('0x3b')](_0x221fca[_0x1649('0x37')][_0x1649('0x3b')]));_0xadefd['attributes']=_0xadefd[_0x1649('0x3a')][_0x1649('0x3c')]?_0xadefd['attributes']:_0x5ed7b2[_0x1649('0x34')];if(!_0x221fca['query'][_0x1649('0x54')](_0x1649('0x3d'))){_0xadefd[_0x1649('0x1f')]=qs[_0x1649('0x1f')](_0x221fca['query'][_0x1649('0x1f')]);_0xadefd[_0x1649('0x20')]=qs[_0x1649('0x20')](_0x221fca[_0x1649('0x37')][_0x1649('0x20')]);}_0xadefd['order']=qs['sort'](_0x221fca[_0x1649('0x37')][_0x1649('0x3f')]);_0xadefd[_0x1649('0x40')]=qs['filters'](_[_0x1649('0x41')](_0x221fca['query'],_0x5ed7b2[_0x1649('0x38')]));_0xadefd[_0x1649('0x68')]=!![];if(_0x221fca[_0x1649('0x37')][_0x1649('0x42')]){_0xadefd[_0x1649('0x40')]=_['merge'](_0xadefd[_0x1649('0x40')],{'$or':_['map'](_0xadefd[_0x1649('0x3a')],function(_0x45cb47){var _0x148e1b={};_0x148e1b[_0x45cb47]={'$like':'%'+_0x221fca['query'][_0x1649('0x42')]+'%'};return _0x148e1b;})});}_0xadefd=_[_0x1649('0x43')]({},_0xadefd,_0x221fca['options']);return _0x1dee9c[_0x1649('0x64')](_0xadefd);}})[_0x1649('0x26')](respondWithResult(_0x5ce2ac,null))[_0x1649('0x49')](handleError(_0x5ce2ac,null));};exports['getContactsCsv']=function(_0x2b1049,_0x2a039c,_0x1ca8b1){var _0x1392e0;var _0x400bff;var _0x5f1bd1;var _0x9c42d3=_0x2b1049[_0x1649('0x4b')]['id'];csv_results=[];return db[_0x1649('0x69')]['findAll']({'attributes':['id',_0x1649('0x2d')],'raw':!![],'order':[_0x1649('0x6a')]})['then'](function(_0x24bbf7){_0x1392e0=_0x24bbf7;var _0x545622=_[_0x1649('0x36')](db[_0x1649('0x5a')][_0x1649('0x31')]);return db['CmCustomField']['findAll']({'raw':!![],'attributes':['id',_0x1649('0x6b')]})[_0x1649('0x26')](function(_0x221d13){_0x400bff=_0x221d13;var _0x4efce1=squel[_0x1649('0x6c')]()['fields'](_0x545622)[_0x1649('0x6d')](_0x1649('0x6e'),'c')['where'](_0x1649('0x6f'),_0x9c42d3)[_0x1649('0x40')](_0x1649('0x70'))[_0x1649('0x71')]();for(var _0x122d42=0x0;_0x122d42<_0x400bff[_0x1649('0x3c')];_0x122d42++){_0x4efce1[_0x1649('0x72')](_0x1649('0x73')+_0x400bff[_0x122d42]['id'],_0x1649('0x74')+_0x400bff[_0x122d42][_0x1649('0x6b')]);}for(var _0x122d42=0x0;_0x122d42<_0x1392e0['length'];_0x122d42++){_0x4efce1[_0x1649('0x72')](squel[_0x1649('0x6c')]()[_0x1649('0x72')](_0x1649('0x75'))['from'](_0x1649('0x76'))['where'](_0x1649('0x77'),_0x1392e0[_0x122d42]['id'])[_0x1649('0x40')](_0x1649('0x78')),'additionalPhone_'+_0x1392e0[_0x122d42][_0x1649('0x2d')]);_0x4efce1[_0x1649('0x72')](squel[_0x1649('0x6c')]()[_0x1649('0x72')](_0x1649('0x79'))[_0x1649('0x6d')]('cm_contact_has_items')['where'](_0x1649('0x77'),_0x1392e0[_0x122d42]['id'])[_0x1649('0x40')](_0x1649('0x78')),_0x1649('0x7a')+_0x1392e0[_0x122d42]['name']);}var _0x5dd320=[];_0x5dd320['push'](_0x4efce1[_0x1649('0x7b')]());BPromise[_0x1649('0x7c')](_0x5dd320,handleQuery)[_0x1649('0x26')](function(_0x2df874){handleQuery(_0x4efce1[_0x1649('0x7b')]());var _0x4110e0=csv_results[0x0];if(!_[_0x1649('0x7d')](_0x4110e0)){var _0x52330a=toCsv(_0x4110e0);var _0x1f2322=Date[_0x1649('0x7e')]();fs['writeFileSync'](util[_0x1649('0x66')]('/tmp/list_%d_%s.csv',_0x9c42d3,_0x1f2322),_0x52330a);_0x2a039c[_0x1649('0x7f')](_0x1649('0x80'),_0x1649('0x81')+util[_0x1649('0x66')](_0x1649('0x82'),_0x9c42d3,_0x1f2322));_0x2a039c[_0x1649('0x7f')]('Content-type',_0x1649('0x83'));return _0x2a039c[_0x1649('0x84')](util[_0x1649('0x66')](_0x1649('0x85'),_0x9c42d3,_0x1f2322));}else{return _0x2a039c[_0x1649('0x1b')](0xcc);}});});});};exports['addCustomField']=function(_0x56961a,_0x3ba65c,_0x502f62){var _0x485e30;delete _0x56961a[_0x1649('0x4e')]['id'];return db['CmList'][_0x1649('0x86')]({'where':{'id':_0x56961a[_0x1649('0x4b')]['id']}})[_0x1649('0x26')](handleEntityNotFound(_0x3ba65c,null))['then'](function(_0x121d21){if(_0x121d21){return db['sequelize'][_0x1649('0x87')](function(_0x3de575){return db[_0x1649('0x88')][_0x1649('0x4d')](_0x56961a[_0x1649('0x4e')],{'transaction':_0x3de575})[_0x1649('0x26')](function(_0xcd9505){_0x485e30=_0xcd9505;return _0x121d21[_0x1649('0x89')](_0xcd9505,{'transaction':_0x3de575});})[_0x1649('0x26')](function(){var _0x545616={'type':db[_0x1649('0x8a')][_0x1649('0x8b')],'transaction':_0x3de575};switch(_0x56961a[_0x1649('0x4e')]['type']){case'text':_0x545616[_0x1649('0x32')]=db[_0x1649('0x8a')]['TEXT'];break;case _0x1649('0x8c'):_0x545616[_0x1649('0x32')]=db[_0x1649('0x8a')][_0x1649('0x8d')];break;case _0x1649('0x8e'):_0x545616[_0x1649('0x32')]=db[_0x1649('0x8a')][_0x1649('0x8f')];_0x545616[_0x1649('0x90')]=![];break;default:}return db[_0x1649('0x91')]['queryInterface'][_0x1649('0x92')]('cm_contacts',util[_0x1649('0x66')](_0x1649('0x93'),_0x485e30['id']),_0x545616);})[_0x1649('0x26')](function(){return _0x485e30;});});}})[_0x1649('0x26')](respondWithResult(_0x3ba65c,null))[_0x1649('0x49')](handleError(_0x3ba65c,null));};exports[_0x1649('0x94')]=function(_0x39e76d,_0x21f57d,_0x2c769d){var _0x4052bd={};var _0x46b7cf={};var _0x13cefd;var _0x2a42a4;return db[_0x1649('0x30')]['findOne']({'where':{'id':_0x39e76d[_0x1649('0x4b')]['id']}})[_0x1649('0x26')](handleEntityNotFound(_0x21f57d,null))[_0x1649('0x26')](function(_0x2bf947){if(_0x2bf947){_0x13cefd=_0x2bf947;_0x46b7cf[_0x1649('0x34')]=_[_0x1649('0x36')](db['CmCustomField'][_0x1649('0x31')]);_0x46b7cf[_0x1649('0x37')]=_['keys'](_0x39e76d[_0x1649('0x37')]);_0x46b7cf[_0x1649('0x38')]=_[_0x1649('0x39')](_0x46b7cf[_0x1649('0x34')],_0x46b7cf['query']);_0x4052bd['attributes']=_[_0x1649('0x39')](_0x46b7cf['model'],qs[_0x1649('0x3b')](_0x39e76d[_0x1649('0x37')][_0x1649('0x3b')]));_0x4052bd[_0x1649('0x3a')]=_0x4052bd[_0x1649('0x3a')][_0x1649('0x3c')]?_0x4052bd[_0x1649('0x3a')]:_0x46b7cf[_0x1649('0x34')];_0x4052bd[_0x1649('0x3e')]=qs[_0x1649('0x3f')](_0x39e76d[_0x1649('0x37')][_0x1649('0x3f')]);_0x4052bd[_0x1649('0x40')]=qs[_0x1649('0x38')](_[_0x1649('0x41')](_0x39e76d['query'],_0x46b7cf[_0x1649('0x38')]));_0x4052bd['where']=_[_0x1649('0x43')](_0x4052bd['where'],{'$or':[{'ListId':_0x2bf947['id']},{'ListId':null}]});if(_0x39e76d['query']['filter']){_0x4052bd[_0x1649('0x40')]=_[_0x1649('0x43')](_0x4052bd[_0x1649('0x40')],{'$or':_['map'](_0x4052bd[_0x1649('0x3a')],function(_0x54597a){var _0xd63926={};_0xd63926[_0x54597a]={'$like':'%'+_0x39e76d[_0x1649('0x37')][_0x1649('0x42')]+'%'};return _0xd63926;})});}_0x4052bd=_['merge']({},_0x4052bd,_0x39e76d[_0x1649('0x45')]);return db['CmCustomField']['findAndCountAll'](_0x4052bd);}})[_0x1649('0x26')](respondWithResult(_0x21f57d,null))['catch'](handleError(_0x21f57d,null));};exports[_0x1649('0x95')]=function(_0x3a16e9,_0x2f3c5e){return db['CmCustomField'][_0x1649('0x96')]({'where':{'ListId':null}})[_0x1649('0x26')](handleEntityNotFound(_0x2f3c5e,null))[_0x1649('0x26')](function(_0xf9db4){return _0xf9db4;})[_0x1649('0x26')](respondWithResult(_0x2f3c5e,null))['catch'](handleError(_0x2f3c5e,null));};exports[_0x1649('0x97')]=function(_0x10969a,_0x9f68e9,_0x8cc196){return db[_0x1649('0x30')][_0x1649('0x4c')]({'where':{'id':_0x10969a['params']['id']}})[_0x1649('0x26')](handleEntityNotFound(_0x9f68e9,null))[_0x1649('0x26')](function(_0x461cc3){if(_0x461cc3){return _0x461cc3[_0x1649('0x97')](_0x10969a['body'][_0x1649('0x58')],_[_0x1649('0x5f')](_0x10969a[_0x1649('0x4e')],[_0x1649('0x58'),'id'])||{})['spread'](function(_0x3b2494){for(var _0x96ca30=0x0;_0x96ca30<_0x10969a[_0x1649('0x4e')]['ids']['length'];_0x96ca30+=0x1){socket['emit'](_0x1649('0x98'),{'UserId':Number(_0x10969a[_0x1649('0x4e')][_0x1649('0x58')][_0x96ca30]),'CmListId':Number(_0x10969a[_0x1649('0x4b')]['id'])});}return _0x3b2494;});}})[_0x1649('0x26')](respondWithResult(_0x9f68e9,null))['catch'](handleError(_0x9f68e9,null));};exports[_0x1649('0x99')]=function(_0x214e05,_0x33d8e3,_0x59a7a9){return db[_0x1649('0x30')][_0x1649('0x4c')]({'where':{'id':_0x214e05[_0x1649('0x4b')]['id']}})[_0x1649('0x26')](handleEntityNotFound(_0x33d8e3,null))[_0x1649('0x26')](function(_0x3fe55b){if(_0x3fe55b){return _0x3fe55b[_0x1649('0x99')](_0x214e05[_0x1649('0x37')][_0x1649('0x58')])[_0x1649('0x26')](function(){if(_[_0x1649('0x5c')](_0x214e05[_0x1649('0x37')]['ids'])){for(var _0x5ed016=0x0;_0x5ed016<_0x214e05[_0x1649('0x37')][_0x1649('0x58')][_0x1649('0x3c')];_0x5ed016+=0x1){socket[_0x1649('0x9a')]('userCmList:remove',{'UserId':Number(_0x214e05['query'][_0x1649('0x58')][_0x5ed016]),'CmListId':Number(_0x214e05[_0x1649('0x4b')]['id'])});}}else{socket[_0x1649('0x9a')](_0x1649('0x9b'),{'UserId':Number(_0x214e05[_0x1649('0x37')][_0x1649('0x58')]),'CmListId':Number(_0x214e05[_0x1649('0x4b')]['id'])});}});}})[_0x1649('0x26')](respondWithStatusCode(_0x33d8e3,null))[_0x1649('0x49')](handleError(_0x33d8e3,null));};exports[_0x1649('0x9c')]=function(_0x48d3e5,_0xf0547c,_0x255726){var _0x5a9261={};var _0x108e55={};var _0x7e50c;var _0x29c648;return db['CmList']['findOne']({'where':{'id':_0x48d3e5[_0x1649('0x4b')]['id']}})[_0x1649('0x26')](handleEntityNotFound(_0xf0547c,null))['then'](function(_0x42927a){if(_0x42927a){_0x7e50c=_0x42927a;_0x108e55['model']=_[_0x1649('0x36')](db[_0x1649('0x9d')][_0x1649('0x31')]);_0x108e55[_0x1649('0x37')]=_['keys'](_0x48d3e5['query']);_0x108e55[_0x1649('0x38')]=_[_0x1649('0x39')](_0x108e55[_0x1649('0x34')],_0x108e55['query']);_0x5a9261[_0x1649('0x3a')]=_[_0x1649('0x39')](_0x108e55[_0x1649('0x34')],qs[_0x1649('0x3b')](_0x48d3e5['query'][_0x1649('0x3b')]));_0x5a9261['attributes']=_0x5a9261[_0x1649('0x3a')]['length']?_0x5a9261['attributes']:_0x108e55[_0x1649('0x34')];_0x5a9261[_0x1649('0x3e')]=qs[_0x1649('0x3f')](_0x48d3e5['query']['sort']);_0x5a9261['where']=qs[_0x1649('0x38')](_[_0x1649('0x41')](_0x48d3e5[_0x1649('0x37')],_0x108e55['filters']));if(_0x48d3e5[_0x1649('0x37')][_0x1649('0x42')]){_0x5a9261['where']=_[_0x1649('0x43')](_0x5a9261[_0x1649('0x40')],{'$or':_['map'](_0x5a9261['attributes'],function(_0x55493c){var _0x4978dc={};_0x4978dc[_0x55493c]={'$like':'%'+_0x48d3e5[_0x1649('0x37')][_0x1649('0x42')]+'%'};return _0x4978dc;})});}_0x5a9261=_['merge']({},_0x5a9261,_0x48d3e5[_0x1649('0x45')]);return _0x7e50c['getAgents'](_0x5a9261);}})[_0x1649('0x26')](function(_0x2b6adb){if(_0x2b6adb){_0x29c648=_0x2b6adb['length'];if(!_0x48d3e5[_0x1649('0x37')][_0x1649('0x54')](_0x1649('0x3d'))){_0x5a9261[_0x1649('0x1f')]=qs['limit'](_0x48d3e5[_0x1649('0x37')][_0x1649('0x1f')]);_0x5a9261[_0x1649('0x20')]=qs['offset'](_0x48d3e5[_0x1649('0x37')][_0x1649('0x20')]);}return _0x7e50c['getAgents'](_0x5a9261);}})[_0x1649('0x26')](function(_0x3ee740){if(_0x3ee740){return _0x3ee740?{'count':_0x29c648,'rows':_0x3ee740}:null;}})['then'](respondWithResult(_0xf0547c,null))['catch'](handleError(_0xf0547c,null));};function handleQuery(_0x4e7ace){logger[_0x1649('0x9e')](_0x4e7ace);return db[_0x1649('0x91')][_0x1649('0x37')](_0x4e7ace)[_0x1649('0x9f')](function(_0xe5c1e7){csv_results[_0x1649('0x5e')](_0xe5c1e7);})[_0x1649('0x49')](function(_0x5a0516){logger[_0x1649('0x2c')](_0x5a0516[_0x1649('0x62')]);});} \ No newline at end of file diff --git a/server/api/cmList/cmList.events.js b/server/api/cmList/cmList.events.js index be4ed0a..1226345 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 _0x3e74=['hasOwnProperty','exports','events','CmList','setMaxListeners','save','emit'];(function(_0x2641f9,_0x26715f){var _0x585741=function(_0x2d1462){while(--_0x2d1462){_0x2641f9['push'](_0x2641f9['shift']());}};_0x585741(++_0x26715f);}(_0x3e74,0x175));var _0x43e7=function(_0x3a2213,_0x5eb75d){_0x3a2213=_0x3a2213-0x0;var _0x38a466=_0x3e74[_0x3a2213];return _0x38a466;};'use strict';var EventEmitter=require(_0x43e7('0x0'));var CmList=require('../../mysqldb')['db'][_0x43e7('0x1')];var CmListEvents=new EventEmitter();CmListEvents[_0x43e7('0x2')](0x0);var events={'afterCreate':_0x43e7('0x3'),'afterUpdate':'update','afterDestroy':'remove'};function emitEvent(_0xc58479){return function(_0x4f9bbe,_0x128b0f,_0xe838b4){CmListEvents[_0x43e7('0x4')](_0xc58479+':'+_0x4f9bbe['id'],_0x4f9bbe);CmListEvents[_0x43e7('0x4')](_0xc58479,_0x4f9bbe);_0xe838b4(null);};}for(var e in events){if(events[_0x43e7('0x5')](e)){var event=events[e];CmList['hook'](e,emitEvent(event));}}module[_0x43e7('0x6')]=CmListEvents; \ No newline at end of file +var _0x5fc3=['events','../../mysqldb','setMaxListeners','save','update','remove','emit','hook'];(function(_0x359bbe,_0x5b7fcc){var _0x1b3353=function(_0x34b41c){while(--_0x34b41c){_0x359bbe['push'](_0x359bbe['shift']());}};_0x1b3353(++_0x5b7fcc);}(_0x5fc3,0xa8));var _0x35fc=function(_0x3d2012,_0x3d02b9){_0x3d2012=_0x3d2012-0x0;var _0x53d542=_0x5fc3[_0x3d2012];return _0x53d542;};'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 d78ccda..96a0c66 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 _0xe706=['request-promise','path','rimraf','../../config/environment','./cmList.attributes','exports','define','CmList','cm_lists','lodash','util','../../config/logger','moment','bluebird'];(function(_0x501497,_0x6ab7ea){var _0x5460d2=function(_0xf94618){while(--_0xf94618){_0x501497['push'](_0x501497['shift']());}};_0x5460d2(++_0x6ab7ea);}(_0xe706,0xa3));var _0x6e70=function(_0x3fd7ab,_0x3dd0bc){_0x3fd7ab=_0x3fd7ab-0x0;var _0x56cb4b=_0xe706[_0x3fd7ab];return _0x56cb4b;};'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':[],'timestamps':!![]});}; \ No newline at end of file +var _0x2750=['rimraf','../../config/environment','./cmList.attributes','exports','define','CmList','cm_lists','lodash','../../config/logger','api','moment','bluebird','request-promise','path'];(function(_0x18c4eb,_0x5bdd59){var _0x316be3=function(_0x231922){while(--_0x231922){_0x18c4eb['push'](_0x18c4eb['shift']());}};_0x316be3(++_0x5bdd59);}(_0x2750,0x13b));var _0x0275=function(_0x10381f,_0x4b8639){_0x10381f=_0x10381f-0x0;var _0x310a7b=_0x2750[_0x10381f];return _0x310a7b;};'use strict';var _=require(_0x0275('0x0'));var util=require('util');var logger=require(_0x0275('0x1'))(_0x0275('0x2'));var moment=require(_0x0275('0x3'));var BPromise=require(_0x0275('0x4'));var rp=require(_0x0275('0x5'));var fs=require('fs');var path=require(_0x0275('0x6'));var rimraf=require(_0x0275('0x7'));var config=require(_0x0275('0x8'));var attributes=require(_0x0275('0x9'));module[_0x0275('0xa')]=function(_0x5953f9,_0x3f645f){return _0x5953f9[_0x0275('0xb')](_0x0275('0xc'),attributes,{'tableName':_0x0275('0xd'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/cmList/cmList.rpc.js b/server/api/cmList/cmList.rpc.js index 7e97255..323e130 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 _0x1fc7=['error','CmList,\x20%s,\x20%s','message','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','redis','defaults','socket.io-emitter','./cmList.socket','request','info','request\x20sent','debug','CmList,\x20%s,\x20%s,\x20%s','stringify'];(function(_0x82140,_0x3a9d87){var _0x2b15a6=function(_0x2b565e){while(--_0x2b565e){_0x82140['push'](_0x82140['shift']());}};_0x2b15a6(++_0x3a9d87);}(_0x1fc7,0x163));var _0x71fc=function(_0x13b02f,_0x462a53){_0x13b02f=_0x13b02f-0x0;var _0x12e9a6=_0x1fc7[_0x13b02f];return _0x12e9a6;};'use strict';var _=require(_0x71fc('0x0'));var util=require(_0x71fc('0x1'));var moment=require(_0x71fc('0x2'));var BPromise=require(_0x71fc('0x3'));var rs=require(_0x71fc('0x4'));var fs=require('fs');var Redis=require(_0x71fc('0x5'));var db=require(_0x71fc('0x6'))['db'];var utils=require(_0x71fc('0x7'));var logger=require(_0x71fc('0x8'))(_0x71fc('0x9'));var config=require(_0x71fc('0xa'));var jayson=require(_0x71fc('0xb'));var client=jayson['client'][_0x71fc('0xc')]({'port':0x232a});config[_0x71fc('0xd')]=_[_0x71fc('0xe')](config['redis'],{'host':'localhost','port':0x18eb});var socket=require(_0x71fc('0xf'))(new Redis(config[_0x71fc('0xd')]));require(_0x71fc('0x10'))['register'](socket);function respondWithRpcPromise(_0x2314cc,_0x4e7f44,_0x26fa2c){return new BPromise(function(_0x2c03e8,_0x3faf32){return client[_0x71fc('0x11')](_0x2314cc,_0x26fa2c)['then'](function(_0x5e22b4){logger[_0x71fc('0x12')]('CmList,\x20%s,\x20%s',_0x4e7f44,_0x71fc('0x13'));logger[_0x71fc('0x14')](_0x71fc('0x15'),_0x4e7f44,_0x71fc('0x13'),JSON[_0x71fc('0x16')](_0x5e22b4));if(_0x5e22b4[_0x71fc('0x17')]){if(_0x5e22b4[_0x71fc('0x17')]['code']===0x1f4){logger[_0x71fc('0x17')](_0x71fc('0x18'),_0x4e7f44,_0x5e22b4[_0x71fc('0x17')][_0x71fc('0x19')]);return _0x3faf32(_0x5e22b4[_0x71fc('0x17')][_0x71fc('0x19')]);}logger[_0x71fc('0x17')](_0x71fc('0x18'),_0x4e7f44,_0x5e22b4[_0x71fc('0x17')]['message']);return _0x2c03e8(_0x5e22b4['error'][_0x71fc('0x19')]);}else{logger[_0x71fc('0x12')](_0x71fc('0x18'),_0x4e7f44,'request\x20sent');_0x2c03e8(_0x5e22b4['result']['message']);}})[_0x71fc('0x1a')](function(_0x21989b){logger[_0x71fc('0x17')](_0x71fc('0x18'),_0x4e7f44,_0x21989b);_0x3faf32(_0x21989b);});});} \ No newline at end of file +var _0xe827=['debug','CmList,\x20%s,\x20%s,\x20%s','stringify','error','CmList,\x20%s,\x20%s','message','result','catch','util','moment','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis','localhost','socket.io-emitter','./cmList.socket','request','then','info','request\x20sent'];(function(_0x3afdc3,_0x1997ab){var _0x29df39=function(_0x5a1854){while(--_0x5a1854){_0x3afdc3['push'](_0x3afdc3['shift']());}};_0x29df39(++_0x1997ab);}(_0xe827,0xe0));var _0x7e82=function(_0x4b75d7,_0x46a7dd){_0x4b75d7=_0x4b75d7-0x0;var _0x19e812=_0xe827[_0x4b75d7];return _0x19e812;};'use strict';var _=require('lodash');var util=require(_0x7e82('0x0'));var moment=require(_0x7e82('0x1'));var BPromise=require('bluebird');var rs=require(_0x7e82('0x2'));var fs=require('fs');var Redis=require(_0x7e82('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x7e82('0x4'));var logger=require(_0x7e82('0x5'))(_0x7e82('0x6'));var config=require(_0x7e82('0x7'));var jayson=require(_0x7e82('0x8'));var client=jayson[_0x7e82('0x9')][_0x7e82('0xa')]({'port':0x232a});config[_0x7e82('0xb')]=_['defaults'](config[_0x7e82('0xb')],{'host':_0x7e82('0xc'),'port':0x18eb});var socket=require(_0x7e82('0xd'))(new Redis(config['redis']));require(_0x7e82('0xe'))['register'](socket);function respondWithRpcPromise(_0x5aaa54,_0x282de0,_0x42e0b8){return new BPromise(function(_0x264e2b,_0x2ece94){return client[_0x7e82('0xf')](_0x5aaa54,_0x42e0b8)[_0x7e82('0x10')](function(_0x3254dd){logger[_0x7e82('0x11')]('CmList,\x20%s,\x20%s',_0x282de0,_0x7e82('0x12'));logger[_0x7e82('0x13')](_0x7e82('0x14'),_0x282de0,_0x7e82('0x12'),JSON[_0x7e82('0x15')](_0x3254dd));if(_0x3254dd[_0x7e82('0x16')]){if(_0x3254dd[_0x7e82('0x16')]['code']===0x1f4){logger[_0x7e82('0x16')](_0x7e82('0x17'),_0x282de0,_0x3254dd[_0x7e82('0x16')][_0x7e82('0x18')]);return _0x2ece94(_0x3254dd[_0x7e82('0x16')]['message']);}logger[_0x7e82('0x16')]('CmList,\x20%s,\x20%s',_0x282de0,_0x3254dd['error']['message']);return _0x264e2b(_0x3254dd[_0x7e82('0x16')]['message']);}else{logger[_0x7e82('0x11')](_0x7e82('0x17'),_0x282de0,_0x7e82('0x12'));_0x264e2b(_0x3254dd[_0x7e82('0x19')][_0x7e82('0x18')]);}})[_0x7e82('0x1a')](function(_0x217673){logger[_0x7e82('0x16')](_0x7e82('0x17'),_0x282de0,_0x217673);_0x2ece94(_0x217673);});});} \ No newline at end of file diff --git a/server/api/cmList/cmList.socket.js b/server/api/cmList/cmList.socket.js index 143df34..e115050 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 _0xc3d9=['length','cmList:','remove','emit','removeListener','register'];(function(_0x154c65,_0x186f04){var _0x10effc=function(_0x2a3be5){while(--_0x2a3be5){_0x154c65['push'](_0x154c65['shift']());}};_0x10effc(++_0x186f04);}(_0xc3d9,0x6e));var _0x9c3d=function(_0x1afabf,_0x56fdcc){_0x1afabf=_0x1afabf-0x0;var _0x497ff1=_0xc3d9[_0x1afabf];return _0x497ff1;};'use strict';var CmListEvents=require('./cmList.events');var events=['save',_0x9c3d('0x0'),'update'];function createListener(_0x389e74,_0x1c287d){return function(_0x9f91e6){_0x1c287d[_0x9c3d('0x1')](_0x389e74,_0x9f91e6);};}function removeListener(_0x1f1647,_0x47a71a){return function(){CmListEvents[_0x9c3d('0x2')](_0x1f1647,_0x47a71a);};}exports[_0x9c3d('0x3')]=function(_0x20950d){for(var _0x40d482=0x0,_0x2458e8=events[_0x9c3d('0x4')];_0x40d482<_0x2458e8;_0x40d482++){var _0x4d7ddc=events[_0x40d482];var _0x179ec0=createListener(_0x9c3d('0x5')+_0x4d7ddc,_0x20950d);CmListEvents['on'](_0x4d7ddc,_0x179ec0);}}; \ No newline at end of file +var _0xd08f=['cmList:','./cmList.events','save','remove','update','emit','removeListener','length'];(function(_0x9ace37,_0x4d1159){var _0x23ecc0=function(_0xda11a){while(--_0xda11a){_0x9ace37['push'](_0x9ace37['shift']());}};_0x23ecc0(++_0x4d1159);}(_0xd08f,0x111));var _0xfd08=function(_0x514299,_0x44a553){_0x514299=_0x514299-0x0;var _0x453188=_0xd08f[_0x514299];return _0x453188;};'use strict';var CmListEvents=require(_0xfd08('0x0'));var events=[_0xfd08('0x1'),_0xfd08('0x2'),_0xfd08('0x3')];function createListener(_0x283493,_0x18d5e4){return function(_0x9db9c){_0x18d5e4[_0xfd08('0x4')](_0x283493,_0x9db9c);};}function removeListener(_0x348afc,_0xc381a){return function(){CmListEvents[_0xfd08('0x5')](_0x348afc,_0xc381a);};}exports['register']=function(_0x1e7e96){for(var _0x509edc=0x0,_0x42c632=events[_0xfd08('0x6')];_0x509edc<_0x42c632;_0x509edc++){var _0x5ca256=events[_0x509edc];var _0x2fa672=createListener(_0xfd08('0x7')+_0x5ca256,_0x1e7e96);CmListEvents['on'](_0x5ca256,_0x2fa672);}}; \ No newline at end of file diff --git a/server/api/cmList/index.js b/server/api/cmList/index.js index 4d36211..fa78465 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 _0xd661=['multer','path','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./cmList.controller','isAuthenticated','get','/describe','describe','/global_fields','getGlobalCustomFields','show','/:id/dispositions','getDispositions','/:id/contacts','getContacts','/:id/contacts/csv','getContactsCsv','/:id/users','getAgents','post','addDisposition','addContacts','/:id/fields','addCustomField','addAgents','put','update','delete','/:id','destroy','removeAgents','exports'];(function(_0x9163f5,_0x776cef){var _0x3c879d=function(_0xf7545c){while(--_0xf7545c){_0x9163f5['push'](_0x9163f5['shift']());}};_0x3c879d(++_0x776cef);}(_0xd661,0x197));var _0x1d66=function(_0x450682,_0x201a06){_0x450682=_0x450682-0x0;var _0x1c56bb=_0xd661[_0x450682];return _0x1c56bb;};'use strict';var multer=require(_0x1d66('0x0'));var util=require('util');var path=require(_0x1d66('0x1'));var timeout=require('connect-timeout');var express=require(_0x1d66('0x2'));var router=express[_0x1d66('0x3')]();var fs_extra=require(_0x1d66('0x4'));var auth=require(_0x1d66('0x5'));var interaction=require(_0x1d66('0x6'));var config=require(_0x1d66('0x7'));var controller=require(_0x1d66('0x8'));router['get']('/',auth[_0x1d66('0x9')](),controller['index']);router[_0x1d66('0xa')](_0x1d66('0xb'),auth[_0x1d66('0x9')](),controller[_0x1d66('0xc')]);router[_0x1d66('0xa')](_0x1d66('0xd'),auth['isAuthenticated'](),controller[_0x1d66('0xe')]);router[_0x1d66('0xa')]('/:id',auth[_0x1d66('0x9')](),controller[_0x1d66('0xf')]);router[_0x1d66('0xa')](_0x1d66('0x10'),auth['isAuthenticated'](),controller[_0x1d66('0x11')]);router[_0x1d66('0xa')](_0x1d66('0x12'),auth[_0x1d66('0x9')](),controller[_0x1d66('0x13')]);router[_0x1d66('0xa')](_0x1d66('0x14'),auth[_0x1d66('0x9')](),controller[_0x1d66('0x15')]);router[_0x1d66('0xa')]('/:id/fields',auth[_0x1d66('0x9')](),controller['getCustomFields']);router[_0x1d66('0xa')](_0x1d66('0x16'),auth[_0x1d66('0x9')](),controller[_0x1d66('0x17')]);router[_0x1d66('0x18')]('/',auth[_0x1d66('0x9')](),controller['create']);router[_0x1d66('0x18')](_0x1d66('0x10'),auth[_0x1d66('0x9')](),controller[_0x1d66('0x19')]);router[_0x1d66('0x18')](_0x1d66('0x12'),auth[_0x1d66('0x9')](),controller[_0x1d66('0x1a')]);router[_0x1d66('0x18')](_0x1d66('0x1b'),auth[_0x1d66('0x9')](),controller[_0x1d66('0x1c')]);router[_0x1d66('0x18')](_0x1d66('0x16'),auth[_0x1d66('0x9')](),controller[_0x1d66('0x1d')]);router[_0x1d66('0x1e')]('/:id',auth[_0x1d66('0x9')](),controller[_0x1d66('0x1f')]);router[_0x1d66('0x20')](_0x1d66('0x21'),auth[_0x1d66('0x9')](),controller[_0x1d66('0x22')]);router['delete'](_0x1d66('0x10'),auth[_0x1d66('0x9')](),controller['removeDispositions']);router[_0x1d66('0x20')](_0x1d66('0x16'),auth[_0x1d66('0x9')](),controller[_0x1d66('0x23')]);module[_0x1d66('0x24')]=router; \ No newline at end of file +var _0x3877=['getContactsCsv','getCustomFields','/:id/users','getAgents','post','create','addDisposition','/:id/contacts','addContacts','/:id/fields','addCustomField','addAgents','put','update','delete','removeAgents','exports','util','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./cmList.controller','get','isAuthenticated','index','/describe','describe','getGlobalCustomFields','/:id','show','/:id/dispositions','getDispositions','getContacts'];(function(_0x55179e,_0x234ab5){var _0x384196=function(_0x360b49){while(--_0x360b49){_0x55179e['push'](_0x55179e['shift']());}};_0x384196(++_0x234ab5);}(_0x3877,0x1c1));var _0x7387=function(_0x57fe1a,_0xf52c59){_0x57fe1a=_0x57fe1a-0x0;var _0x31631b=_0x3877[_0x57fe1a];return _0x31631b;};'use strict';var multer=require('multer');var util=require(_0x7387('0x0'));var path=require('path');var timeout=require(_0x7387('0x1'));var express=require(_0x7387('0x2'));var router=express[_0x7387('0x3')]();var fs_extra=require(_0x7387('0x4'));var auth=require(_0x7387('0x5'));var interaction=require(_0x7387('0x6'));var config=require('../../config/environment');var controller=require(_0x7387('0x7'));router[_0x7387('0x8')]('/',auth[_0x7387('0x9')](),controller[_0x7387('0xa')]);router[_0x7387('0x8')](_0x7387('0xb'),auth[_0x7387('0x9')](),controller[_0x7387('0xc')]);router['get']('/global_fields',auth[_0x7387('0x9')](),controller[_0x7387('0xd')]);router[_0x7387('0x8')](_0x7387('0xe'),auth['isAuthenticated'](),controller[_0x7387('0xf')]);router[_0x7387('0x8')](_0x7387('0x10'),auth['isAuthenticated'](),controller[_0x7387('0x11')]);router[_0x7387('0x8')]('/:id/contacts',auth[_0x7387('0x9')](),controller[_0x7387('0x12')]);router[_0x7387('0x8')]('/:id/contacts/csv',auth['isAuthenticated'](),controller[_0x7387('0x13')]);router[_0x7387('0x8')]('/:id/fields',auth['isAuthenticated'](),controller[_0x7387('0x14')]);router['get'](_0x7387('0x15'),auth[_0x7387('0x9')](),controller[_0x7387('0x16')]);router[_0x7387('0x17')]('/',auth['isAuthenticated'](),controller[_0x7387('0x18')]);router[_0x7387('0x17')](_0x7387('0x10'),auth['isAuthenticated'](),controller[_0x7387('0x19')]);router[_0x7387('0x17')](_0x7387('0x1a'),auth['isAuthenticated'](),controller[_0x7387('0x1b')]);router[_0x7387('0x17')](_0x7387('0x1c'),auth[_0x7387('0x9')](),controller[_0x7387('0x1d')]);router[_0x7387('0x17')]('/:id/users',auth[_0x7387('0x9')](),controller[_0x7387('0x1e')]);router[_0x7387('0x1f')](_0x7387('0xe'),auth[_0x7387('0x9')](),controller[_0x7387('0x20')]);router['delete'](_0x7387('0xe'),auth[_0x7387('0x9')](),controller['destroy']);router[_0x7387('0x21')](_0x7387('0x10'),auth[_0x7387('0x9')](),controller['removeDispositions']);router['delete'](_0x7387('0x15'),auth[_0x7387('0x9')](),controller[_0x7387('0x22')]);module[_0x7387('0x23')]=router; \ No newline at end of file diff --git a/server/api/condition/condition.attributes.js b/server/api/condition/condition.attributes.js index ee829b3..54676b8 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 _0x51ba=['sequelize','exports','field','STRING'];(function(_0x5a16a6,_0x13eaa0){var _0x48e7b8=function(_0x4f0b7a){while(--_0x4f0b7a){_0x5a16a6['push'](_0x5a16a6['shift']());}};_0x48e7b8(++_0x13eaa0);}(_0x51ba,0x130));var _0xa51b=function(_0x2d5eaf,_0x3885a1){_0x2d5eaf=_0x2d5eaf-0x0;var _0x510319=_0x51ba[_0x2d5eaf];return _0x510319;};'use strict';var Sequelize=require(_0xa51b('0x0'));module[_0xa51b('0x1')]={'name':{'type':Sequelize['VIRTUAL'],'get':function(_0x50d303){return this['getDataValue'](_0xa51b('0x2'));}},'field':{'type':Sequelize['STRING'],'allowNull':![]},'operator':{'type':Sequelize[_0xa51b('0x3')],'allowNull':![]},'value':{'type':Sequelize[_0xa51b('0x3')],'allowNull':![]}}; \ No newline at end of file +var _0x4322=['field','STRING','sequelize','VIRTUAL','getDataValue'];(function(_0x1548aa,_0x31c31b){var _0x301bab=function(_0x1b225b){while(--_0x1b225b){_0x1548aa['push'](_0x1548aa['shift']());}};_0x301bab(++_0x31c31b);}(_0x4322,0x1f1));var _0x2432=function(_0x41ce29,_0x1a2472){_0x41ce29=_0x41ce29-0x0;var _0x4b5ba7=_0x4322[_0x41ce29];return _0x4b5ba7;};'use strict';var Sequelize=require(_0x2432('0x0'));module['exports']={'name':{'type':Sequelize[_0x2432('0x1')],'get':function(_0x974989){return this[_0x2432('0x2')](_0x2432('0x3'));}},'field':{'type':Sequelize['STRING'],'allowNull':![]},'operator':{'type':Sequelize[_0x2432('0x4')],'allowNull':![]},'value':{'type':Sequelize[_0x2432('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 e91aeba..ec2428f 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(_0x5873f0,_0x40f2d0){var _0x36071b=function(_0x5136d1){while(--_0x5136d1){_0x5873f0['push'](_0x5873f0['shift']());}};_0x36071b(++_0x40f2d0);}(_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 +var _0x7a54=['sox','to-csv','fs-extra','squel','crypto','desk.js','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','count','limit','set','Content-Range','reject','save','update','then','destroy','error','stack','name','send','body','Condition','find','catch','eml-format','rimraf','zip-dir','request-promise','moment','mustache','util','path'];(function(_0x3ca5aa,_0x1b3b1d){var _0x52ae11=function(_0x36bb33){while(--_0x36bb33){_0x3ca5aa['push'](_0x3ca5aa['shift']());}};_0x52ae11(++_0x1b3b1d);}(_0x7a54,0x106));var _0x47a5=function(_0x32bc5e,_0x132459){_0x32bc5e=_0x32bc5e-0x0;var _0x646c96=_0x7a54[_0x32bc5e];return _0x646c96;};'use strict';var emlformat=require(_0x47a5('0x0'));var rimraf=require(_0x47a5('0x1'));var zipdir=require(_0x47a5('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x47a5('0x3'));var moment=require(_0x47a5('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x47a5('0x5'));var util=require(_0x47a5('0x6'));var path=require(_0x47a5('0x7'));var sox=require(_0x47a5('0x8'));var csv=require(_0x47a5('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x47a5('0xa'));var _=require('lodash');var squel=require(_0x47a5('0xb'));var crypto=require(_0x47a5('0xc'));var jsforce=require('jsforce');var deskjs=require(_0x47a5('0xd'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x47a5('0xe'));var authService=require(_0x47a5('0xf'));var qs=require('../../components/parsers/qs');var as=require(_0x47a5('0x10'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x47a5('0x11'));var utils=require(_0x47a5('0x12'));var config=require(_0x47a5('0x13'));var licenseUtil=require(_0x47a5('0x14'));var db=require(_0x47a5('0x15'))['db'];function respondWithStatusCode(_0xd308b8,_0x1eae59){_0x1eae59=_0x1eae59||0xcc;return function(_0x5beb89){if(_0x5beb89){return _0xd308b8[_0x47a5('0x16')](_0x1eae59);}return _0xd308b8[_0x47a5('0x17')](_0x1eae59)[_0x47a5('0x18')]();};}function respondWithResult(_0x711793,_0x139f25){_0x139f25=_0x139f25||0xc8;return function(_0x620ee9){if(_0x620ee9){return _0x711793[_0x47a5('0x17')](_0x139f25)[_0x47a5('0x19')](_0x620ee9);}};}function respondWithFilteredResult(_0x4e99a8,_0x362359){return function(_0x11faf5){if(_0x11faf5){var _0x3b001e=typeof _0x362359[_0x47a5('0x1a')]===_0x47a5('0x1b')&&typeof _0x362359['limit']==='undefined';var _0x138bc0=_0x11faf5['count'];var _0x5247fd=_0x3b001e?0x0:_0x362359[_0x47a5('0x1a')];var _0xaf70a6=_0x3b001e?_0x11faf5[_0x47a5('0x1c')]:_0x362359[_0x47a5('0x1a')]+_0x362359[_0x47a5('0x1d')];var _0x12b98e;if(_0xaf70a6>=_0x138bc0){_0xaf70a6=_0x138bc0;_0x12b98e=0xc8;}else{_0x12b98e=0xce;}_0x4e99a8[_0x47a5('0x17')](_0x12b98e);return _0x4e99a8[_0x47a5('0x1e')](_0x47a5('0x1f'),_0x5247fd+'-'+_0xaf70a6+'/'+_0x138bc0)['json'](_0x11faf5);}return null;};}function patchUpdates(_0x1570bc){return function(_0xf160ba){try{jsonpatch['apply'](_0xf160ba,_0x1570bc,!![]);}catch(_0x2b0360){return BPromise[_0x47a5('0x20')](_0x2b0360);}return _0xf160ba[_0x47a5('0x21')]();};}function saveUpdates(_0x4c5910,_0xb8ae6c){return function(_0x2f142b){if(_0x2f142b){return _0x2f142b[_0x47a5('0x22')](_0x4c5910)[_0x47a5('0x23')](function(_0x5ef1b1){return _0x5ef1b1;});}return null;};}function removeEntity(_0xe2dea9,_0x385687){return function(_0x513981){if(_0x513981){return _0x513981[_0x47a5('0x24')]()[_0x47a5('0x23')](function(){_0xe2dea9[_0x47a5('0x17')](0xcc)[_0x47a5('0x18')]();});}};}function handleEntityNotFound(_0x3abd6a,_0x50bf17){return function(_0x53078a){if(!_0x53078a){_0x3abd6a[_0x47a5('0x16')](0x194);}return _0x53078a;};}function handleError(_0x5686db,_0x1ea9c8){_0x1ea9c8=_0x1ea9c8||0x1f4;return function(_0x5b6c4e){logger[_0x47a5('0x25')](_0x5b6c4e[_0x47a5('0x26')]);if(_0x5b6c4e[_0x47a5('0x27')]){delete _0x5b6c4e[_0x47a5('0x27')];}_0x5686db[_0x47a5('0x17')](_0x1ea9c8)[_0x47a5('0x28')](_0x5b6c4e);};}exports[_0x47a5('0x22')]=function(_0x136b14,_0x16631f){if(_0x136b14[_0x47a5('0x29')]['id']){delete _0x136b14[_0x47a5('0x29')]['id'];}return db[_0x47a5('0x2a')][_0x47a5('0x2b')]({'where':{'id':_0x136b14['params']['id']}})[_0x47a5('0x23')](handleEntityNotFound(_0x16631f,null))['then'](saveUpdates(_0x136b14[_0x47a5('0x29')],null))[_0x47a5('0x23')](respondWithResult(_0x16631f,null))[_0x47a5('0x2c')](handleError(_0x16631f,null));};exports['destroy']=function(_0x256650,_0x625952){return db[_0x47a5('0x2a')][_0x47a5('0x2b')]({'where':{'id':_0x256650['params']['id']}})['then'](handleEntityNotFound(_0x625952,null))[_0x47a5('0x23')](removeEntity(_0x625952,null))[_0x47a5('0x2c')](handleError(_0x625952,null));}; \ No newline at end of file diff --git a/server/api/condition/condition.model.js b/server/api/condition/condition.model.js index 8388e6d..6b00a39 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 _0x1597=['define','Condition','tools_conditions','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf'];(function(_0x4c4a8b,_0x402020){var _0x20fa14=function(_0xbe8c84){while(--_0xbe8c84){_0x4c4a8b['push'](_0x4c4a8b['shift']());}};_0x20fa14(++_0x402020);}(_0x1597,0x19b));var _0x7159=function(_0xdd2348,_0x5d3232){_0xdd2348=_0xdd2348-0x0;var _0x2e0a02=_0x1597[_0xdd2348];return _0x2e0a02;};'use strict';var _=require(_0x7159('0x0'));var util=require(_0x7159('0x1'));var logger=require(_0x7159('0x2'))(_0x7159('0x3'));var moment=require(_0x7159('0x4'));var BPromise=require(_0x7159('0x5'));var rp=require(_0x7159('0x6'));var fs=require('fs');var path=require(_0x7159('0x7'));var rimraf=require(_0x7159('0x8'));var config=require('../../config/environment');var attributes=require('./condition.attributes');module['exports']=function(_0x1c01ca,_0x54a6f9){return _0x1c01ca[_0x7159('0x9')](_0x7159('0xa'),attributes,{'tableName':_0x7159('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x3256=['exports','tools_conditions','util','../../config/logger','api','moment','bluebird','path','rimraf','../../config/environment','./condition.attributes'];(function(_0x5a7f55,_0x3c0d19){var _0x571868=function(_0x246168){while(--_0x246168){_0x5a7f55['push'](_0x5a7f55['shift']());}};_0x571868(++_0x3c0d19);}(_0x3256,0xde));var _0x6325=function(_0x2642ff,_0x231cf1){_0x2642ff=_0x2642ff-0x0;var _0x8b971f=_0x3256[_0x2642ff];return _0x8b971f;};'use strict';var _=require('lodash');var util=require(_0x6325('0x0'));var logger=require(_0x6325('0x1'))(_0x6325('0x2'));var moment=require(_0x6325('0x3'));var BPromise=require(_0x6325('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x6325('0x5'));var rimraf=require(_0x6325('0x6'));var config=require(_0x6325('0x7'));var attributes=require(_0x6325('0x8'));module[_0x6325('0x9')]=function(_0x324089,_0x33c978){return _0x324089['define']('Condition',attributes,{'tableName':_0x6325('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/condition/condition.rpc.js b/server/api/condition/condition.rpc.js index 29cb8c1..f094e0e 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 _0x4ffd=['catch','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','http','request','info','Condition,\x20%s,\x20%s','request\x20sent','Condition,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result'];(function(_0x4653f7,_0x3d3ae3){var _0x5454da=function(_0x448f55){while(--_0x448f55){_0x4653f7['push'](_0x4653f7['shift']());}};_0x5454da(++_0x3d3ae3);}(_0x4ffd,0x1cf));var _0xd4ff=function(_0x1caf6a,_0x26a5bf){_0x1caf6a=_0x1caf6a-0x0;var _0x1bf493=_0x4ffd[_0x1caf6a];return _0x1bf493;};'use strict';var _=require(_0xd4ff('0x0'));var util=require(_0xd4ff('0x1'));var moment=require(_0xd4ff('0x2'));var BPromise=require('bluebird');var rs=require(_0xd4ff('0x3'));var fs=require('fs');var Redis=require(_0xd4ff('0x4'));var db=require(_0xd4ff('0x5'))['db'];var utils=require(_0xd4ff('0x6'));var logger=require(_0xd4ff('0x7'))(_0xd4ff('0x8'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson['client'][_0xd4ff('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x3d14be,_0x770223,_0x483d4c){return new BPromise(function(_0x3d6944,_0x305817){return client[_0xd4ff('0xa')](_0x3d14be,_0x483d4c)['then'](function(_0x27e9bf){logger[_0xd4ff('0xb')](_0xd4ff('0xc'),_0x770223,_0xd4ff('0xd'));logger['debug'](_0xd4ff('0xe'),_0x770223,_0xd4ff('0xd'),JSON[_0xd4ff('0xf')](_0x27e9bf));if(_0x27e9bf[_0xd4ff('0x10')]){if(_0x27e9bf[_0xd4ff('0x10')][_0xd4ff('0x11')]===0x1f4){logger[_0xd4ff('0x10')](_0xd4ff('0xc'),_0x770223,_0x27e9bf[_0xd4ff('0x10')][_0xd4ff('0x12')]);return _0x305817(_0x27e9bf[_0xd4ff('0x10')][_0xd4ff('0x12')]);}logger['error'](_0xd4ff('0xc'),_0x770223,_0x27e9bf[_0xd4ff('0x10')]['message']);return _0x3d6944(_0x27e9bf[_0xd4ff('0x10')][_0xd4ff('0x12')]);}else{logger[_0xd4ff('0xb')](_0xd4ff('0xc'),_0x770223,_0xd4ff('0xd'));_0x3d6944(_0x27e9bf[_0xd4ff('0x13')][_0xd4ff('0x12')]);}})[_0xd4ff('0x14')](function(_0x56fa51){logger['error'](_0xd4ff('0xc'),_0x770223,_0x56fa51);_0x305817(_0x56fa51);});});} \ No newline at end of file +var _0x4d70=['client','http','request','then','info','Condition,\x20%s,\x20%s','request\x20sent','debug','Condition,\x20%s,\x20%s,\x20%s','error','code','message','catch','lodash','util','moment','bluebird','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise'];(function(_0x4b6fc0,_0x56be01){var _0x47bf0b=function(_0x227702){while(--_0x227702){_0x4b6fc0['push'](_0x4b6fc0['shift']());}};_0x47bf0b(++_0x56be01);}(_0x4d70,0x1f0));var _0x04d7=function(_0x353890,_0x11c483){_0x353890=_0x353890-0x0;var _0x33eff3=_0x4d70[_0x353890];return _0x33eff3;};'use strict';var _=require(_0x04d7('0x0'));var util=require(_0x04d7('0x1'));var moment=require(_0x04d7('0x2'));var BPromise=require(_0x04d7('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x04d7('0x4'))['db'];var utils=require(_0x04d7('0x5'));var logger=require(_0x04d7('0x6'))(_0x04d7('0x7'));var config=require(_0x04d7('0x8'));var jayson=require(_0x04d7('0x9'));var client=jayson[_0x04d7('0xa')][_0x04d7('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x3db198,_0x1130ce,_0x36b1ae){return new BPromise(function(_0x387fce,_0x1df00c){return client[_0x04d7('0xc')](_0x3db198,_0x36b1ae)[_0x04d7('0xd')](function(_0x4da60b){logger[_0x04d7('0xe')](_0x04d7('0xf'),_0x1130ce,_0x04d7('0x10'));logger[_0x04d7('0x11')](_0x04d7('0x12'),_0x1130ce,'request\x20sent',JSON['stringify'](_0x4da60b));if(_0x4da60b[_0x04d7('0x13')]){if(_0x4da60b[_0x04d7('0x13')][_0x04d7('0x14')]===0x1f4){logger['error'](_0x04d7('0xf'),_0x1130ce,_0x4da60b[_0x04d7('0x13')][_0x04d7('0x15')]);return _0x1df00c(_0x4da60b[_0x04d7('0x13')]['message']);}logger[_0x04d7('0x13')](_0x04d7('0xf'),_0x1130ce,_0x4da60b[_0x04d7('0x13')][_0x04d7('0x15')]);return _0x387fce(_0x4da60b[_0x04d7('0x13')]['message']);}else{logger[_0x04d7('0xe')](_0x04d7('0xf'),_0x1130ce,'request\x20sent');_0x387fce(_0x4da60b['result'][_0x04d7('0x15')]);}})[_0x04d7('0x16')](function(_0x2ed62b){logger[_0x04d7('0x13')](_0x04d7('0xf'),_0x1130ce,_0x2ed62b);_0x1df00c(_0x2ed62b);});});} \ No newline at end of file diff --git a/server/api/condition/index.js b/server/api/condition/index.js index 96f68e2..bb13389 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 _0xc753=['/:id','destroy','exports','util','connect-timeout','express','Router','fs-extra','../../components/auth/service','./condition.controller','put','isAuthenticated','update','delete'];(function(_0x28b18c,_0x499e63){var _0x1d0b40=function(_0x11d49f){while(--_0x11d49f){_0x28b18c['push'](_0x28b18c['shift']());}};_0x1d0b40(++_0x499e63);}(_0xc753,0x18b));var _0x3c75=function(_0x13502c,_0x118965){_0x13502c=_0x13502c-0x0;var _0x3739a9=_0xc753[_0x13502c];return _0x3739a9;};'use strict';var multer=require('multer');var util=require(_0x3c75('0x0'));var path=require('path');var timeout=require(_0x3c75('0x1'));var express=require(_0x3c75('0x2'));var router=express[_0x3c75('0x3')]();var fs_extra=require(_0x3c75('0x4'));var auth=require(_0x3c75('0x5'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0x3c75('0x6'));router[_0x3c75('0x7')]('/:id',auth[_0x3c75('0x8')](),controller[_0x3c75('0x9')]);router[_0x3c75('0xa')](_0x3c75('0xb'),auth['isAuthenticated'](),controller[_0x3c75('0xc')]);module[_0x3c75('0xd')]=router; \ No newline at end of file +var _0x963e=['multer','util','path','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./condition.controller','put','isAuthenticated','/:id','destroy','exports'];(function(_0x164ab3,_0x2f5d43){var _0x4825ee=function(_0x55e09e){while(--_0x55e09e){_0x164ab3['push'](_0x164ab3['shift']());}};_0x4825ee(++_0x2f5d43);}(_0x963e,0xf0));var _0xe963=function(_0x2aefb6,_0x1bd384){_0x2aefb6=_0x2aefb6-0x0;var _0x202772=_0x963e[_0x2aefb6];return _0x202772;};'use strict';var multer=require(_0xe963('0x0'));var util=require(_0xe963('0x1'));var path=require(_0xe963('0x2'));var timeout=require('connect-timeout');var express=require(_0xe963('0x3'));var router=express[_0xe963('0x4')]();var fs_extra=require(_0xe963('0x5'));var auth=require(_0xe963('0x6'));var interaction=require(_0xe963('0x7'));var config=require(_0xe963('0x8'));var controller=require(_0xe963('0x9'));router[_0xe963('0xa')]('/:id',auth[_0xe963('0xb')](),controller['update']);router['delete'](_0xe963('0xc'),auth[_0xe963('0xb')](),controller[_0xe963('0xd')]);module[_0xe963('0xe')]=router; \ No newline at end of file diff --git a/server/api/contactItemType/contactItemType.attributes.js b/server/api/contactItemType/contactItemType.attributes.js index 9c18196..7b5d01a 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 _0xc939=['INTEGER','sequelize','exports','STRING','name'];(function(_0x387777,_0x356171){var _0x3f84c0=function(_0x4d4423){while(--_0x4d4423){_0x387777['push'](_0x387777['shift']());}};_0x3f84c0(++_0x356171);}(_0xc939,0x187));var _0x9c93=function(_0xfbdb0d,_0x1dc1c5){_0xfbdb0d=_0xfbdb0d-0x0;var _0x4c6097=_0xc939[_0xfbdb0d];return _0x4c6097;};'use strict';var Sequelize=require(_0x9c93('0x0'));module[_0x9c93('0x1')]={'name':{'type':Sequelize[_0x9c93('0x2')],'allowNull':![],'unique':_0x9c93('0x3')},'OrderBy':{'type':Sequelize[_0x9c93('0x4')],'allowNull':!![]},'rgbBackgroundColor':{'type':Sequelize[_0x9c93('0x2')],'allowNull':!![]}}; \ No newline at end of file +var _0x498c=['INTEGER','sequelize','STRING','name'];(function(_0x3e5086,_0x48f4a2){var _0xfeb102=function(_0x5a945f){while(--_0x5a945f){_0x3e5086['push'](_0x3e5086['shift']());}};_0xfeb102(++_0x48f4a2);}(_0x498c,0x1b5));var _0xc498=function(_0x53bedf,_0x55cdac){_0x53bedf=_0x53bedf-0x0;var _0x9e42d=_0x498c[_0x53bedf];return _0x9e42d;};'use strict';var Sequelize=require(_0xc498('0x0'));module['exports']={'name':{'type':Sequelize[_0xc498('0x1')],'allowNull':![],'unique':_0xc498('0x2')},'OrderBy':{'type':Sequelize[_0xc498('0x3')],'allowNull':!![]},'rgbBackgroundColor':{'type':Sequelize[_0xc498('0x1')],'allowNull':!![]}}; \ No newline at end of file diff --git a/server/api/contactItemType/contactItemType.controller.js b/server/api/contactItemType/contactItemType.controller.js index 85703cb..f8eee29 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 _0x1a37=['includeAll','include','catch','show','params','length','find','create','body','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','ContactItemTypes','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','CmContactHasItem','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','to-csv','fs-extra','lodash','squel','crypto','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../mysqldb','sendStatus','status','end','offset','undefined','limit','count','set','Content-Range','apply','reject','update','then','destroy','get','UserProfileResource','error','stack','name','send','index','map','ContactItemType','rawAttributes','type','key','model','query','keys','filters','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','pick','filter','merge','where','options'];(function(_0x3b380d,_0x4bf247){var _0x54502b=function(_0x35d207){while(--_0x35d207){_0x3b380d['push'](_0x3b380d['shift']());}};_0x54502b(++_0x4bf247);}(_0x1a37,0xb4));var _0x71a3=function(_0x1d9aa0,_0x272488){_0x1d9aa0=_0x1d9aa0-0x0;var _0x226868=_0x1a37[_0x1d9aa0];return _0x226868;};'use strict';var emlformat=require(_0x71a3('0x0'));var rimraf=require(_0x71a3('0x1'));var zipdir=require(_0x71a3('0x2'));var jsonpatch=require(_0x71a3('0x3'));var rp=require(_0x71a3('0x4'));var moment=require(_0x71a3('0x5'));var BPromise=require(_0x71a3('0x6'));var Mustache=require(_0x71a3('0x7'));var util=require(_0x71a3('0x8'));var path=require(_0x71a3('0x9'));var sox=require('sox');var csv=require(_0x71a3('0xa'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x71a3('0xb'));var _=require(_0x71a3('0xc'));var squel=require(_0x71a3('0xd'));var crypto=require(_0x71a3('0xe'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x71a3('0xf'));var Redis=require(_0x71a3('0x10'));var authService=require(_0x71a3('0x11'));var qs=require(_0x71a3('0x12'));var as=require(_0x71a3('0x13'));var hardwareService=require(_0x71a3('0x14'));var logger=require(_0x71a3('0x15'))(_0x71a3('0x16'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0x71a3('0x17'))['db'];function respondWithStatusCode(_0x3830cb,_0x27e46d){_0x27e46d=_0x27e46d||0xcc;return function(_0x229134){if(_0x229134){return _0x3830cb[_0x71a3('0x18')](_0x27e46d);}return _0x3830cb[_0x71a3('0x19')](_0x27e46d)[_0x71a3('0x1a')]();};}function respondWithResult(_0x3b256c,_0x4dc4ed){_0x4dc4ed=_0x4dc4ed||0xc8;return function(_0x203ee1){if(_0x203ee1){return _0x3b256c[_0x71a3('0x19')](_0x4dc4ed)['json'](_0x203ee1);}};}function respondWithFilteredResult(_0x1743d7,_0x32591a){return function(_0x59021f){if(_0x59021f){var _0x4aa918=typeof _0x32591a[_0x71a3('0x1b')]===_0x71a3('0x1c')&&typeof _0x32591a[_0x71a3('0x1d')]===_0x71a3('0x1c');var _0x1af1bc=_0x59021f[_0x71a3('0x1e')];var _0x5d4dee=_0x4aa918?0x0:_0x32591a[_0x71a3('0x1b')];var _0x27bfb4=_0x4aa918?_0x59021f['count']:_0x32591a['offset']+_0x32591a[_0x71a3('0x1d')];var _0x250db3;if(_0x27bfb4>=_0x1af1bc){_0x27bfb4=_0x1af1bc;_0x250db3=0xc8;}else{_0x250db3=0xce;}_0x1743d7[_0x71a3('0x19')](_0x250db3);return _0x1743d7[_0x71a3('0x1f')](_0x71a3('0x20'),_0x5d4dee+'-'+_0x27bfb4+'/'+_0x1af1bc)['json'](_0x59021f);}return null;};}function patchUpdates(_0x1ab947){return function(_0x4156e1){try{jsonpatch[_0x71a3('0x21')](_0x4156e1,_0x1ab947,!![]);}catch(_0x3ea036){return BPromise[_0x71a3('0x22')](_0x3ea036);}return _0x4156e1['save']();};}function saveUpdates(_0x1af24b,_0x5bbaee){return function(_0x3bf78e){if(_0x3bf78e){return _0x3bf78e[_0x71a3('0x23')](_0x1af24b)[_0x71a3('0x24')](function(_0x21899d){return _0x21899d;});}return null;};}function removeEntity(_0x452bc4,_0x2847b4){return function(_0x5f33c5){if(_0x5f33c5){return _0x5f33c5[_0x71a3('0x25')]()[_0x71a3('0x24')](function(){var _0xb9c195=_0x5f33c5[_0x71a3('0x26')]({'plain':!![]});var _0xb0f3aa='ContactItemTypes';return db[_0x71a3('0x27')][_0x71a3('0x25')]({'where':{'type':_0xb0f3aa,'resourceId':_0xb9c195['id']}})['then'](function(){return _0x5f33c5;});})[_0x71a3('0x24')](function(){_0x452bc4['status'](0xcc)[_0x71a3('0x1a')]();});}};}function handleEntityNotFound(_0x2fd3b6,_0x211ea8){return function(_0x35b5c7){if(!_0x35b5c7){_0x2fd3b6[_0x71a3('0x18')](0x194);}return _0x35b5c7;};}function handleError(_0x314439,_0x2317ec){_0x2317ec=_0x2317ec||0x1f4;return function(_0x242b85){logger[_0x71a3('0x28')](_0x242b85[_0x71a3('0x29')]);if(_0x242b85[_0x71a3('0x2a')]){delete _0x242b85[_0x71a3('0x2a')];}_0x314439['status'](_0x2317ec)[_0x71a3('0x2b')](_0x242b85);};}exports[_0x71a3('0x2c')]=function(_0x334db0,_0x23ae85){var _0x4a750c={},_0x18a8fe={},_0x216d84={'count':0x0,'rows':[]};var _0x45d13d=_[_0x71a3('0x2d')](db[_0x71a3('0x2e')][_0x71a3('0x2f')],function(_0x1d09bd){return{'name':_0x1d09bd['fieldName'],'type':_0x1d09bd[_0x71a3('0x30')][_0x71a3('0x31')]};});_0x18a8fe[_0x71a3('0x32')]=_[_0x71a3('0x2d')](_0x45d13d,_0x71a3('0x2a'));_0x18a8fe[_0x71a3('0x33')]=_[_0x71a3('0x34')](_0x334db0[_0x71a3('0x33')]);_0x18a8fe[_0x71a3('0x35')]=_[_0x71a3('0x36')](_0x18a8fe[_0x71a3('0x32')],_0x18a8fe[_0x71a3('0x33')]);_0x4a750c[_0x71a3('0x37')]=_['intersection'](_0x18a8fe['model'],qs[_0x71a3('0x38')](_0x334db0[_0x71a3('0x33')]['fields']));_0x4a750c[_0x71a3('0x37')]=_0x4a750c[_0x71a3('0x37')]['length']?_0x4a750c[_0x71a3('0x37')]:_0x18a8fe[_0x71a3('0x32')];if(!_0x334db0[_0x71a3('0x33')][_0x71a3('0x39')](_0x71a3('0x3a'))){_0x4a750c[_0x71a3('0x1d')]=qs[_0x71a3('0x1d')](_0x334db0['query'][_0x71a3('0x1d')]);_0x4a750c[_0x71a3('0x1b')]=qs[_0x71a3('0x1b')](_0x334db0['query'][_0x71a3('0x1b')]);}_0x4a750c[_0x71a3('0x3b')]=qs[_0x71a3('0x3c')](_0x334db0[_0x71a3('0x33')][_0x71a3('0x3c')]);_0x4a750c['where']=qs['filters'](_[_0x71a3('0x3d')](_0x334db0[_0x71a3('0x33')],_0x18a8fe[_0x71a3('0x35')]),_0x45d13d);if(_0x334db0[_0x71a3('0x33')][_0x71a3('0x3e')]){_0x4a750c['where']=_[_0x71a3('0x3f')](_0x4a750c[_0x71a3('0x40')],{'$or':_[_0x71a3('0x2d')](_0x45d13d,function(_0x58b833){if(_0x58b833[_0x71a3('0x30')]!=='VIRTUAL'){var _0x3edeff={};_0x3edeff[_0x58b833[_0x71a3('0x2a')]]={'$like':'%'+_0x334db0[_0x71a3('0x33')][_0x71a3('0x3e')]+'%'};return _0x3edeff;}})});}_0x4a750c=_[_0x71a3('0x3f')]({},_0x4a750c,_0x334db0[_0x71a3('0x41')]);var _0x468ca4={'where':_0x4a750c[_0x71a3('0x40')]};return db[_0x71a3('0x2e')][_0x71a3('0x1e')](_0x468ca4)['then'](function(_0xa49846){_0x216d84['count']=_0xa49846;if(_0x334db0[_0x71a3('0x33')][_0x71a3('0x42')]){_0x4a750c[_0x71a3('0x43')]=[{'all':!![]}];}return db[_0x71a3('0x2e')]['findAll'](_0x4a750c);})[_0x71a3('0x24')](function(_0x4b4fde){_0x216d84['rows']=_0x4b4fde;return _0x216d84;})[_0x71a3('0x24')](respondWithFilteredResult(_0x23ae85,_0x4a750c))[_0x71a3('0x44')](handleError(_0x23ae85,null));};exports[_0x71a3('0x45')]=function(_0x1dc34b,_0x519242){var _0x248a04={'raw':!![],'where':{'id':_0x1dc34b[_0x71a3('0x46')]['id']}},_0x615c6f={};_0x615c6f[_0x71a3('0x32')]=_[_0x71a3('0x34')](db[_0x71a3('0x2e')][_0x71a3('0x2f')]);_0x615c6f[_0x71a3('0x33')]=_[_0x71a3('0x34')](_0x1dc34b[_0x71a3('0x33')]);_0x615c6f[_0x71a3('0x35')]=_[_0x71a3('0x36')](_0x615c6f[_0x71a3('0x32')],_0x615c6f[_0x71a3('0x33')]);_0x248a04[_0x71a3('0x37')]=_[_0x71a3('0x36')](_0x615c6f['model'],qs[_0x71a3('0x38')](_0x1dc34b[_0x71a3('0x33')]['fields']));_0x248a04[_0x71a3('0x37')]=_0x248a04[_0x71a3('0x37')][_0x71a3('0x47')]?_0x248a04[_0x71a3('0x37')]:_0x615c6f[_0x71a3('0x32')];if(_0x1dc34b['query']['includeAll']){_0x248a04[_0x71a3('0x43')]=[{'all':!![]}];}_0x248a04=_[_0x71a3('0x3f')]({},_0x248a04,_0x1dc34b['options']);return db[_0x71a3('0x2e')][_0x71a3('0x48')](_0x248a04)[_0x71a3('0x24')](handleEntityNotFound(_0x519242,null))[_0x71a3('0x24')](respondWithResult(_0x519242,null))[_0x71a3('0x44')](handleError(_0x519242,null));};exports[_0x71a3('0x49')]=function(_0x501a62,_0x1c9ba6){return db['ContactItemType'][_0x71a3('0x49')](_0x501a62[_0x71a3('0x4a')],{})[_0x71a3('0x24')](function(_0x2f3f19){var _0x32e313=_0x501a62['user'][_0x71a3('0x26')]({'plain':!![]});if(!_0x32e313)throw new Error(_0x71a3('0x4b'));if(_0x32e313[_0x71a3('0x4c')]==='user'){var _0x6c34=_0x2f3f19['get']({'plain':!![]});var _0x278e11=_0x71a3('0x4d');return db['UserProfileSection'][_0x71a3('0x48')]({'where':{'name':_0x278e11,'userProfileId':_0x32e313[_0x71a3('0x4e')]},'raw':!![]})[_0x71a3('0x24')](function(_0x384f38){if(_0x384f38&&_0x384f38[_0x71a3('0x4f')]===0x0){return db[_0x71a3('0x27')][_0x71a3('0x49')]({'name':_0x6c34['name'],'resourceId':_0x6c34['id'],'type':_0x384f38[_0x71a3('0x2a')],'sectionId':_0x384f38['id']},{})['then'](function(){return _0x2f3f19;});}else{return _0x2f3f19;}})[_0x71a3('0x44')](function(_0x480e90){logger[_0x71a3('0x28')](_0x71a3('0x50'),_0x480e90);throw _0x480e90;});}return _0x2f3f19;})[_0x71a3('0x24')](respondWithResult(_0x1c9ba6,0xc9))[_0x71a3('0x44')](handleError(_0x1c9ba6,null));};exports['update']=function(_0x54b80f,_0x1e13ae){if(_0x54b80f[_0x71a3('0x4a')]['id']){delete _0x54b80f[_0x71a3('0x4a')]['id'];}return db[_0x71a3('0x2e')]['find']({'where':{'id':_0x54b80f['params']['id']}})[_0x71a3('0x24')](handleEntityNotFound(_0x1e13ae,null))[_0x71a3('0x24')](saveUpdates(_0x54b80f[_0x71a3('0x4a')],null))[_0x71a3('0x24')](respondWithResult(_0x1e13ae,null))[_0x71a3('0x44')](handleError(_0x1e13ae,null));};exports['destroy']=function(_0x421b6a,_0x3379cb){return db[_0x71a3('0x2e')][_0x71a3('0x48')]({'where':{'id':_0x421b6a[_0x71a3('0x46')]['id']}})[_0x71a3('0x24')](handleEntityNotFound(_0x3379cb,null))[_0x71a3('0x24')](db[_0x71a3('0x51')]['update']({'ItemTypeId':null},{'where':{'ItemTypeId':_0x421b6a[_0x71a3('0x46')]['id']}}))[_0x71a3('0x24')](removeEntity(_0x3379cb,null))[_0x71a3('0x44')](handleError(_0x3379cb,null));}; \ No newline at end of file +var _0x14a0=['undefined','limit','count','offset','set','apply','reject','save','update','destroy','then','get','UserProfileResource','error','stack','send','index','map','ContactItemType','rawAttributes','fieldName','type','key','name','query','keys','filters','intersection','attributes','model','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','include','findAll','rows','catch','show','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','ContactItemTypes','userProfileId','autoAssociation','params','CmContactHasItem','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','sox','to-csv','ejs','squel','crypto','jsforce','querystring','../../components/parsers/advancedSearch','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json'];(function(_0x154d1e,_0x1f705a){var _0x17568e=function(_0x2da0bb){while(--_0x2da0bb){_0x154d1e['push'](_0x154d1e['shift']());}};_0x17568e(++_0x1f705a);}(_0x14a0,0x8e));var _0x014a=function(_0x1d4c92,_0x1a3da1){_0x1d4c92=_0x1d4c92-0x0;var _0x5b7189=_0x14a0[_0x1d4c92];return _0x5b7189;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x014a('0x0'));var zipdir=require(_0x014a('0x1'));var jsonpatch=require(_0x014a('0x2'));var rp=require(_0x014a('0x3'));var moment=require(_0x014a('0x4'));var BPromise=require(_0x014a('0x5'));var Mustache=require(_0x014a('0x6'));var util=require('util');var path=require('path');var sox=require(_0x014a('0x7'));var csv=require(_0x014a('0x8'));var ejs=require(_0x014a('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0x014a('0xa'));var crypto=require(_0x014a('0xb'));var jsforce=require(_0x014a('0xc'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0x014a('0xd'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0x014a('0xe'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x014a('0xf'))(_0x014a('0x10'));var utils=require('../../config/utils');var config=require(_0x014a('0x11'));var licenseUtil=require(_0x014a('0x12'));var db=require(_0x014a('0x13'))['db'];function respondWithStatusCode(_0x43bfeb,_0x1bcd1){_0x1bcd1=_0x1bcd1||0xcc;return function(_0x20cb56){if(_0x20cb56){return _0x43bfeb[_0x014a('0x14')](_0x1bcd1);}return _0x43bfeb[_0x014a('0x15')](_0x1bcd1)[_0x014a('0x16')]();};}function respondWithResult(_0x71535d,_0x45cd80){_0x45cd80=_0x45cd80||0xc8;return function(_0x3c54c8){if(_0x3c54c8){return _0x71535d['status'](_0x45cd80)[_0x014a('0x17')](_0x3c54c8);}};}function respondWithFilteredResult(_0x3cf92f,_0x59f207){return function(_0x3a836f){if(_0x3a836f){var _0x128c46=typeof _0x59f207['offset']===_0x014a('0x18')&&typeof _0x59f207[_0x014a('0x19')]===_0x014a('0x18');var _0x12da95=_0x3a836f[_0x014a('0x1a')];var _0x12d339=_0x128c46?0x0:_0x59f207[_0x014a('0x1b')];var _0x263b07=_0x128c46?_0x3a836f[_0x014a('0x1a')]:_0x59f207[_0x014a('0x1b')]+_0x59f207[_0x014a('0x19')];var _0x89e132;if(_0x263b07>=_0x12da95){_0x263b07=_0x12da95;_0x89e132=0xc8;}else{_0x89e132=0xce;}_0x3cf92f[_0x014a('0x15')](_0x89e132);return _0x3cf92f[_0x014a('0x1c')]('Content-Range',_0x12d339+'-'+_0x263b07+'/'+_0x12da95)[_0x014a('0x17')](_0x3a836f);}return null;};}function patchUpdates(_0x109a9c){return function(_0x11065f){try{jsonpatch[_0x014a('0x1d')](_0x11065f,_0x109a9c,!![]);}catch(_0xc9a563){return BPromise[_0x014a('0x1e')](_0xc9a563);}return _0x11065f[_0x014a('0x1f')]();};}function saveUpdates(_0x3dd2d0,_0x290b86){return function(_0x486e66){if(_0x486e66){return _0x486e66[_0x014a('0x20')](_0x3dd2d0)['then'](function(_0x1a1318){return _0x1a1318;});}return null;};}function removeEntity(_0x26718b,_0x44d921){return function(_0x36d52b){if(_0x36d52b){return _0x36d52b[_0x014a('0x21')]()[_0x014a('0x22')](function(){var _0x3fec9f=_0x36d52b[_0x014a('0x23')]({'plain':!![]});var _0x165a42='ContactItemTypes';return db[_0x014a('0x24')]['destroy']({'where':{'type':_0x165a42,'resourceId':_0x3fec9f['id']}})[_0x014a('0x22')](function(){return _0x36d52b;});})[_0x014a('0x22')](function(){_0x26718b['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x9a901f,_0x3f9719){return function(_0x143346){if(!_0x143346){_0x9a901f['sendStatus'](0x194);}return _0x143346;};}function handleError(_0x183f19,_0x3c1fa4){_0x3c1fa4=_0x3c1fa4||0x1f4;return function(_0x598179){logger[_0x014a('0x25')](_0x598179[_0x014a('0x26')]);if(_0x598179['name']){delete _0x598179['name'];}_0x183f19[_0x014a('0x15')](_0x3c1fa4)[_0x014a('0x27')](_0x598179);};}exports[_0x014a('0x28')]=function(_0x29fce5,_0x4ea00c){var _0x434038={},_0x147e7e={},_0x15af07={'count':0x0,'rows':[]};var _0x402d3b=_[_0x014a('0x29')](db[_0x014a('0x2a')][_0x014a('0x2b')],function(_0x1dae8e){return{'name':_0x1dae8e[_0x014a('0x2c')],'type':_0x1dae8e[_0x014a('0x2d')][_0x014a('0x2e')]};});_0x147e7e['model']=_[_0x014a('0x29')](_0x402d3b,_0x014a('0x2f'));_0x147e7e[_0x014a('0x30')]=_[_0x014a('0x31')](_0x29fce5[_0x014a('0x30')]);_0x147e7e[_0x014a('0x32')]=_[_0x014a('0x33')](_0x147e7e['model'],_0x147e7e[_0x014a('0x30')]);_0x434038[_0x014a('0x34')]=_['intersection'](_0x147e7e[_0x014a('0x35')],qs[_0x014a('0x36')](_0x29fce5[_0x014a('0x30')][_0x014a('0x36')]));_0x434038[_0x014a('0x34')]=_0x434038[_0x014a('0x34')][_0x014a('0x37')]?_0x434038[_0x014a('0x34')]:_0x147e7e['model'];if(!_0x29fce5[_0x014a('0x30')][_0x014a('0x38')](_0x014a('0x39'))){_0x434038[_0x014a('0x19')]=qs['limit'](_0x29fce5[_0x014a('0x30')][_0x014a('0x19')]);_0x434038[_0x014a('0x1b')]=qs[_0x014a('0x1b')](_0x29fce5[_0x014a('0x30')][_0x014a('0x1b')]);}_0x434038[_0x014a('0x3a')]=qs[_0x014a('0x3b')](_0x29fce5[_0x014a('0x30')]['sort']);_0x434038[_0x014a('0x3c')]=qs['filters'](_[_0x014a('0x3d')](_0x29fce5[_0x014a('0x30')],_0x147e7e[_0x014a('0x32')]),_0x402d3b);if(_0x29fce5[_0x014a('0x30')][_0x014a('0x3e')]){_0x434038['where']=_[_0x014a('0x3f')](_0x434038[_0x014a('0x3c')],{'$or':_['map'](_0x402d3b,function(_0x9227b8){if(_0x9227b8[_0x014a('0x2d')]!==_0x014a('0x40')){var _0x2e7a14={};_0x2e7a14[_0x9227b8[_0x014a('0x2f')]]={'$like':'%'+_0x29fce5[_0x014a('0x30')][_0x014a('0x3e')]+'%'};return _0x2e7a14;}})});}_0x434038=_[_0x014a('0x3f')]({},_0x434038,_0x29fce5[_0x014a('0x41')]);var _0x537bde={'where':_0x434038[_0x014a('0x3c')]};return db[_0x014a('0x2a')][_0x014a('0x1a')](_0x537bde)[_0x014a('0x22')](function(_0x5f1a91){_0x15af07[_0x014a('0x1a')]=_0x5f1a91;if(_0x29fce5[_0x014a('0x30')][_0x014a('0x42')]){_0x434038[_0x014a('0x43')]=[{'all':!![]}];}return db[_0x014a('0x2a')][_0x014a('0x44')](_0x434038);})['then'](function(_0x361866){_0x15af07[_0x014a('0x45')]=_0x361866;return _0x15af07;})['then'](respondWithFilteredResult(_0x4ea00c,_0x434038))[_0x014a('0x46')](handleError(_0x4ea00c,null));};exports[_0x014a('0x47')]=function(_0x2c45f1,_0x5dc092){var _0x5bcf8={'raw':!![],'where':{'id':_0x2c45f1['params']['id']}},_0x50a8f0={};_0x50a8f0[_0x014a('0x35')]=_[_0x014a('0x31')](db['ContactItemType'][_0x014a('0x2b')]);_0x50a8f0[_0x014a('0x30')]=_[_0x014a('0x31')](_0x2c45f1[_0x014a('0x30')]);_0x50a8f0[_0x014a('0x32')]=_[_0x014a('0x33')](_0x50a8f0['model'],_0x50a8f0[_0x014a('0x30')]);_0x5bcf8[_0x014a('0x34')]=_[_0x014a('0x33')](_0x50a8f0['model'],qs['fields'](_0x2c45f1[_0x014a('0x30')]['fields']));_0x5bcf8['attributes']=_0x5bcf8[_0x014a('0x34')]['length']?_0x5bcf8[_0x014a('0x34')]:_0x50a8f0[_0x014a('0x35')];if(_0x2c45f1[_0x014a('0x30')]['includeAll']){_0x5bcf8[_0x014a('0x43')]=[{'all':!![]}];}_0x5bcf8=_[_0x014a('0x3f')]({},_0x5bcf8,_0x2c45f1[_0x014a('0x41')]);return db[_0x014a('0x2a')][_0x014a('0x48')](_0x5bcf8)[_0x014a('0x22')](handleEntityNotFound(_0x5dc092,null))['then'](respondWithResult(_0x5dc092,null))[_0x014a('0x46')](handleError(_0x5dc092,null));};exports[_0x014a('0x49')]=function(_0x5a861c,_0x1a4df9){return db[_0x014a('0x2a')][_0x014a('0x49')](_0x5a861c[_0x014a('0x4a')],{})[_0x014a('0x22')](function(_0x357ca1){var _0x437f23=_0x5a861c[_0x014a('0x4b')]['get']({'plain':!![]});if(!_0x437f23)throw new Error(_0x014a('0x4c'));if(_0x437f23[_0x014a('0x4d')]===_0x014a('0x4b')){var _0x135e7e=_0x357ca1[_0x014a('0x23')]({'plain':!![]});var _0x4b2fdb=_0x014a('0x4e');return db['UserProfileSection'][_0x014a('0x48')]({'where':{'name':_0x4b2fdb,'userProfileId':_0x437f23[_0x014a('0x4f')]},'raw':!![]})[_0x014a('0x22')](function(_0x479dc0){if(_0x479dc0&&_0x479dc0[_0x014a('0x50')]===0x0){return db['UserProfileResource']['create']({'name':_0x135e7e['name'],'resourceId':_0x135e7e['id'],'type':_0x479dc0['name'],'sectionId':_0x479dc0['id']},{})[_0x014a('0x22')](function(){return _0x357ca1;});}else{return _0x357ca1;}})['catch'](function(_0x1fe253){logger['error']('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x1fe253);throw _0x1fe253;});}return _0x357ca1;})[_0x014a('0x22')](respondWithResult(_0x1a4df9,0xc9))['catch'](handleError(_0x1a4df9,null));};exports[_0x014a('0x20')]=function(_0x1e778d,_0x400633){if(_0x1e778d[_0x014a('0x4a')]['id']){delete _0x1e778d[_0x014a('0x4a')]['id'];}return db[_0x014a('0x2a')][_0x014a('0x48')]({'where':{'id':_0x1e778d[_0x014a('0x51')]['id']}})[_0x014a('0x22')](handleEntityNotFound(_0x400633,null))[_0x014a('0x22')](saveUpdates(_0x1e778d['body'],null))['then'](respondWithResult(_0x400633,null))[_0x014a('0x46')](handleError(_0x400633,null));};exports[_0x014a('0x21')]=function(_0x237345,_0x4cc246){return db['ContactItemType'][_0x014a('0x48')]({'where':{'id':_0x237345['params']['id']}})[_0x014a('0x22')](handleEntityNotFound(_0x4cc246,null))[_0x014a('0x22')](db[_0x014a('0x52')][_0x014a('0x20')]({'ItemTypeId':null},{'where':{'ItemTypeId':_0x237345['params']['id']}}))[_0x014a('0x22')](removeEntity(_0x4cc246,null))[_0x014a('0x46')](handleError(_0x4cc246,null));}; \ No newline at end of file diff --git a/server/api/contactItemType/contactItemType.model.js b/server/api/contactItemType/contactItemType.model.js index 40eec68..90fc88f 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 _0x5870=['path','rimraf','../../config/environment','./contactItemType.attributes','define','ContactItemType','tools_contact_item_types','lodash','util','../../config/logger','api','moment','bluebird'];(function(_0x266618,_0x18f637){var _0x54dbf5=function(_0x1f7985){while(--_0x1f7985){_0x266618['push'](_0x266618['shift']());}};_0x54dbf5(++_0x18f637);}(_0x5870,0x180));var _0x0587=function(_0x122096,_0x60c295){_0x122096=_0x122096-0x0;var _0x3d1966=_0x5870[_0x122096];return _0x3d1966;};'use strict';var _=require(_0x0587('0x0'));var util=require(_0x0587('0x1'));var logger=require(_0x0587('0x2'))(_0x0587('0x3'));var moment=require(_0x0587('0x4'));var BPromise=require(_0x0587('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x0587('0x6'));var rimraf=require(_0x0587('0x7'));var config=require(_0x0587('0x8'));var attributes=require(_0x0587('0x9'));module['exports']=function(_0x23ebcf,_0x44a519){return _0x23ebcf[_0x0587('0xa')](_0x0587('0xb'),attributes,{'tableName':_0x0587('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x9d3d=['./contactItemType.attributes','exports','define','ContactItemType','tools_contact_item_types','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','../../config/environment'];(function(_0x567d3a,_0x3acf08){var _0x36cd10=function(_0x31fbd4){while(--_0x31fbd4){_0x567d3a['push'](_0x567d3a['shift']());}};_0x36cd10(++_0x3acf08);}(_0x9d3d,0x9f));var _0xd9d3=function(_0x27098d,_0x2d8a1c){_0x27098d=_0x27098d-0x0;var _0x488978=_0x9d3d[_0x27098d];return _0x488978;};'use strict';var _=require(_0xd9d3('0x0'));var util=require(_0xd9d3('0x1'));var logger=require(_0xd9d3('0x2'))(_0xd9d3('0x3'));var moment=require(_0xd9d3('0x4'));var BPromise=require(_0xd9d3('0x5'));var rp=require(_0xd9d3('0x6'));var fs=require('fs');var path=require(_0xd9d3('0x7'));var rimraf=require('rimraf');var config=require(_0xd9d3('0x8'));var attributes=require(_0xd9d3('0x9'));module[_0xd9d3('0xa')]=function(_0x3352f6,_0xf7165d){return _0x3352f6[_0xd9d3('0xb')](_0xd9d3('0xc'),attributes,{'tableName':_0xd9d3('0xd'),'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 0196e0a..732a9a0 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 _0x1cfc=['rpc','../../config/environment','jayson/promise','client','http','then','info','ContactItemType,\x20%s,\x20%s','request\x20sent','debug','code','message','error','result','catch','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger'];(function(_0x4d07cc,_0x587613){var _0x42de3b=function(_0x201f78){while(--_0x201f78){_0x4d07cc['push'](_0x4d07cc['shift']());}};_0x42de3b(++_0x587613);}(_0x1cfc,0x6b));var _0xc1cf=function(_0x388ded,_0x306e1d){_0x388ded=_0x388ded-0x0;var _0x37b582=_0x1cfc[_0x388ded];return _0x37b582;};'use strict';var _=require(_0xc1cf('0x0'));var util=require('util');var moment=require(_0xc1cf('0x1'));var BPromise=require(_0xc1cf('0x2'));var rs=require(_0xc1cf('0x3'));var fs=require('fs');var Redis=require(_0xc1cf('0x4'));var db=require(_0xc1cf('0x5'))['db'];var utils=require(_0xc1cf('0x6'));var logger=require(_0xc1cf('0x7'))(_0xc1cf('0x8'));var config=require(_0xc1cf('0x9'));var jayson=require(_0xc1cf('0xa'));var client=jayson[_0xc1cf('0xb')][_0xc1cf('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x4f69ad,_0x4867b8,_0x317173){return new BPromise(function(_0x5e1c1a,_0xf78ae6){return client['request'](_0x4f69ad,_0x317173)[_0xc1cf('0xd')](function(_0x2ce44b){logger[_0xc1cf('0xe')](_0xc1cf('0xf'),_0x4867b8,_0xc1cf('0x10'));logger[_0xc1cf('0x11')]('ContactItemType,\x20%s,\x20%s,\x20%s',_0x4867b8,_0xc1cf('0x10'),JSON['stringify'](_0x2ce44b));if(_0x2ce44b['error']){if(_0x2ce44b['error'][_0xc1cf('0x12')]===0x1f4){logger['error']('ContactItemType,\x20%s,\x20%s',_0x4867b8,_0x2ce44b['error'][_0xc1cf('0x13')]);return _0xf78ae6(_0x2ce44b[_0xc1cf('0x14')][_0xc1cf('0x13')]);}logger[_0xc1cf('0x14')](_0xc1cf('0xf'),_0x4867b8,_0x2ce44b[_0xc1cf('0x14')][_0xc1cf('0x13')]);return _0x5e1c1a(_0x2ce44b['error']['message']);}else{logger[_0xc1cf('0xe')](_0xc1cf('0xf'),_0x4867b8,_0xc1cf('0x10'));_0x5e1c1a(_0x2ce44b[_0xc1cf('0x15')][_0xc1cf('0x13')]);}})[_0xc1cf('0x16')](function(_0x3fd010){logger[_0xc1cf('0x14')](_0xc1cf('0xf'),_0x4867b8,_0x3fd010);_0xf78ae6(_0x3fd010);});});} \ No newline at end of file +var _0x7c53=['../../config/utils','../../config/environment','client','http','request','then','info','ContactItemType,\x20%s,\x20%s','request\x20sent','debug','ContactItemType,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','lodash','util','moment','randomstring','ioredis','../../mysqldb'];(function(_0x1770fd,_0x2a6da1){var _0x197e73=function(_0x23f0d4){while(--_0x23f0d4){_0x1770fd['push'](_0x1770fd['shift']());}};_0x197e73(++_0x2a6da1);}(_0x7c53,0x1dd));var _0x37c5=function(_0x245784,_0x200ce1){_0x245784=_0x245784-0x0;var _0x6d2124=_0x7c53[_0x245784];return _0x6d2124;};'use strict';var _=require(_0x37c5('0x0'));var util=require(_0x37c5('0x1'));var moment=require(_0x37c5('0x2'));var BPromise=require('bluebird');var rs=require(_0x37c5('0x3'));var fs=require('fs');var Redis=require(_0x37c5('0x4'));var db=require(_0x37c5('0x5'))['db'];var utils=require(_0x37c5('0x6'));var logger=require('../../config/logger')('rpc');var config=require(_0x37c5('0x7'));var jayson=require('jayson/promise');var client=jayson[_0x37c5('0x8')][_0x37c5('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x43d977,_0x225d3e,_0x49a340){return new BPromise(function(_0x15ec29,_0x20b32b){return client[_0x37c5('0xa')](_0x43d977,_0x49a340)[_0x37c5('0xb')](function(_0x5633ff){logger[_0x37c5('0xc')](_0x37c5('0xd'),_0x225d3e,_0x37c5('0xe'));logger[_0x37c5('0xf')](_0x37c5('0x10'),_0x225d3e,_0x37c5('0xe'),JSON[_0x37c5('0x11')](_0x5633ff));if(_0x5633ff[_0x37c5('0x12')]){if(_0x5633ff[_0x37c5('0x12')][_0x37c5('0x13')]===0x1f4){logger[_0x37c5('0x12')](_0x37c5('0xd'),_0x225d3e,_0x5633ff[_0x37c5('0x12')][_0x37c5('0x14')]);return _0x20b32b(_0x5633ff[_0x37c5('0x12')][_0x37c5('0x14')]);}logger[_0x37c5('0x12')](_0x37c5('0xd'),_0x225d3e,_0x5633ff[_0x37c5('0x12')][_0x37c5('0x14')]);return _0x15ec29(_0x5633ff['error'][_0x37c5('0x14')]);}else{logger[_0x37c5('0xc')]('ContactItemType,\x20%s,\x20%s',_0x225d3e,_0x37c5('0xe'));_0x15ec29(_0x5633ff[_0x37c5('0x15')][_0x37c5('0x14')]);}})[_0x37c5('0x16')](function(_0x41e90c){logger['error'](_0x37c5('0xd'),_0x225d3e,_0x41e90c);_0x20b32b(_0x41e90c);});});} \ No newline at end of file diff --git a/server/api/contactItemType/index.js b/server/api/contactItemType/index.js index ebdfb42..2799afb 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 _0xbba2=['path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./contactItemType.controller','get','isAuthenticated','post','put','/:id','update','destroy','exports','util'];(function(_0x37ea15,_0x5a0470){var _0x453798=function(_0x47b5f9){while(--_0x47b5f9){_0x37ea15['push'](_0x37ea15['shift']());}};_0x453798(++_0x5a0470);}(_0xbba2,0x131));var _0x2bba=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xbba2[_0x3dd15e];return _0x231fd0;};'use strict';var multer=require('multer');var util=require(_0x2bba('0x0'));var path=require(_0x2bba('0x1'));var timeout=require(_0x2bba('0x2'));var express=require(_0x2bba('0x3'));var router=express[_0x2bba('0x4')]();var fs_extra=require(_0x2bba('0x5'));var auth=require(_0x2bba('0x6'));var interaction=require(_0x2bba('0x7'));var config=require(_0x2bba('0x8'));var controller=require(_0x2bba('0x9'));router[_0x2bba('0xa')]('/',auth[_0x2bba('0xb')](),controller['index']);router[_0x2bba('0xa')]('/:id',auth['isAuthenticated'](),controller['show']);router[_0x2bba('0xc')]('/',auth[_0x2bba('0xb')](),controller['create']);router[_0x2bba('0xd')](_0x2bba('0xe'),auth[_0x2bba('0xb')](),controller[_0x2bba('0xf')]);router['delete'](_0x2bba('0xe'),auth['isAuthenticated'](),controller[_0x2bba('0x10')]);module[_0x2bba('0x11')]=router; \ No newline at end of file +var _0xd60b=['update','destroy','exports','util','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','/:id','post','create','put'];(function(_0x235055,_0x27f642){var _0x4350b5=function(_0x1e48db){while(--_0x1e48db){_0x235055['push'](_0x235055['shift']());}};_0x4350b5(++_0x27f642);}(_0xd60b,0x198));var _0xbd60=function(_0x163e41,_0x2b9ba2){_0x163e41=_0x163e41-0x0;var _0xef6a06=_0xd60b[_0x163e41];return _0xef6a06;};'use strict';var multer=require('multer');var util=require(_0xbd60('0x0'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0xbd60('0x1'));var router=express[_0xbd60('0x2')]();var fs_extra=require('fs-extra');var auth=require(_0xbd60('0x3'));var interaction=require(_0xbd60('0x4'));var config=require(_0xbd60('0x5'));var controller=require('./contactItemType.controller');router[_0xbd60('0x6')]('/',auth[_0xbd60('0x7')](),controller['index']);router[_0xbd60('0x6')](_0xbd60('0x8'),auth[_0xbd60('0x7')](),controller['show']);router[_0xbd60('0x9')]('/',auth[_0xbd60('0x7')](),controller[_0xbd60('0xa')]);router[_0xbd60('0xb')](_0xbd60('0x8'),auth[_0xbd60('0x7')](),controller[_0xbd60('0xc')]);router['delete'](_0xbd60('0x8'),auth[_0xbd60('0x7')](),controller[_0xbd60('0xd')]);module[_0xbd60('0xe')]=router; \ No newline at end of file diff --git a/server/api/dashboard/dashboard.attributes.js b/server/api/dashboard/dashboard.attributes.js index 847b6eb..95e2257 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(_0x58afd5,_0x534a48){var _0x3e503b=function(_0x27ba44){while(--_0x27ba44){_0x58afd5['push'](_0x58afd5['shift']());}};_0x3e503b(++_0x534a48);}(_0xb7e7,0x121));var _0x7b7e=function(_0x34bf97,_0xc60f9d){_0x34bf97=_0x34bf97-0x0;var _0x292719=_0xb7e7[_0x34bf97];return _0x292719;};'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 _0x757a=['exports','STRING'];(function(_0x329dad,_0x4b2073){var _0x438691=function(_0x5b2ec9){while(--_0x5b2ec9){_0x329dad['push'](_0x329dad['shift']());}};_0x438691(++_0x4b2073);}(_0x757a,0xde));var _0xa757=function(_0x45878e,_0x57fac8){_0x45878e=_0x45878e-0x0;var _0x416af6=_0x757a[_0x45878e];return _0x416af6;};'use strict';var Sequelize=require('sequelize');module[_0xa757('0x0')]={'name':{'type':Sequelize[_0xa757('0x1')],'allowNull':![],'unique':'name'},'description':{'type':Sequelize['STRING']}}; \ No newline at end of file diff --git a/server/api/dashboard/dashboard.controller.js b/server/api/dashboard/dashboard.controller.js index a5b439d..db89855 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 _0x371a=['destroy','get','CustomDashboards','UserProfileResource','error','stack','name','index','map','Dashboard','rawAttributes','fieldName','type','key','model','query','keys','filters','attributes','intersection','fields','length','hasOwnProperty','nolimit','order','sort','pick','filter','where','merge','VIRTUAL','options','includeAll','include','findAll','rows','catch','show','params','find','create','body','user','role','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','clone','updatedAt','createdAt','Unable\x20to\x20retrieve\x20the\x20current\x20user','attrUrl','attrs','value','https://','custom','attrPath','clock','attrHourFormat','HH:mm:ss','attrTimezone','0.00','attrFontSize','counter','attrMetric','attrVoiceQueues','attrChannel','voice','attrEmailAccounts','attrFaxAccounts','attrSmsAccounts','attrOpenchannelAccounts','attrWhatsappAccounts','attrChatWebsites','pie-chart','attrSerie1','total','attrSerie2','attrSerie3','web-report','attrReport','reportType','attrRefresh','widgetAttributes:\x20%s','addItem','DashboardId','getItems','DashboardItem','rimraf','zip-dir','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','fs-extra','lodash','crypto','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','redis','socket.io-emitter','sendStatus','status','end','undefined','limit','count','offset','set','Content-Range','json','apply','save','update','then'];(function(_0x2d81a0,_0x3f2db9){var _0x5d680d=function(_0x394a21){while(--_0x394a21){_0x2d81a0['push'](_0x2d81a0['shift']());}};_0x5d680d(++_0x3f2db9);}(_0x371a,0x1d9));var _0xa371=function(_0x190e57,_0x5ce262){_0x190e57=_0x190e57-0x0;var _0x6997e1=_0x371a[_0x190e57];return _0x6997e1;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xa371('0x0'));var zipdir=require(_0xa371('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0xa371('0x2'));var moment=require(_0xa371('0x3'));var BPromise=require(_0xa371('0x4'));var Mustache=require(_0xa371('0x5'));var util=require(_0xa371('0x6'));var path=require(_0xa371('0x7'));var sox=require(_0xa371('0x8'));var csv=require(_0xa371('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xa371('0xa'));var _=require(_0xa371('0xb'));var squel=require('squel');var crypto=require(_0xa371('0xc'));var jsforce=require('jsforce');var deskjs=require(_0xa371('0xd'));var toCsv=require(_0xa371('0x9'));var querystring=require(_0xa371('0xe'));var Papa=require(_0xa371('0xf'));var Redis=require('ioredis');var authService=require(_0xa371('0x10'));var qs=require(_0xa371('0x11'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0xa371('0x12'))(_0xa371('0x13'));var utils=require('../../config/utils');var config=require(_0xa371('0x14'));var licenseUtil=require(_0xa371('0x15'));var db=require(_0xa371('0x16'))['db'];config[_0xa371('0x17')]=_['defaults'](config[_0xa371('0x17')],{'host':'localhost','port':0x18eb});var socket=require(_0xa371('0x18'))(new Redis(config[_0xa371('0x17')]));require('./dashboard.socket')['register'](socket);function respondWithStatusCode(_0x317227,_0x2f7868){_0x2f7868=_0x2f7868||0xcc;return function(_0xe625bb){if(_0xe625bb){return _0x317227[_0xa371('0x19')](_0x2f7868);}return _0x317227[_0xa371('0x1a')](_0x2f7868)[_0xa371('0x1b')]();};}function respondWithResult(_0x57cd7d,_0x308cfc){_0x308cfc=_0x308cfc||0xc8;return function(_0x3c6829){if(_0x3c6829){return _0x57cd7d[_0xa371('0x1a')](_0x308cfc)['json'](_0x3c6829);}};}function respondWithFilteredResult(_0x68762f,_0x4d90ab){return function(_0x3afbdd){if(_0x3afbdd){var _0x3474aa=typeof _0x4d90ab['offset']===_0xa371('0x1c')&&typeof _0x4d90ab[_0xa371('0x1d')]===_0xa371('0x1c');var _0x34df1f=_0x3afbdd[_0xa371('0x1e')];var _0x26e95b=_0x3474aa?0x0:_0x4d90ab[_0xa371('0x1f')];var _0x29f087=_0x3474aa?_0x3afbdd['count']:_0x4d90ab[_0xa371('0x1f')]+_0x4d90ab[_0xa371('0x1d')];var _0x46b4d9;if(_0x29f087>=_0x34df1f){_0x29f087=_0x34df1f;_0x46b4d9=0xc8;}else{_0x46b4d9=0xce;}_0x68762f[_0xa371('0x1a')](_0x46b4d9);return _0x68762f[_0xa371('0x20')](_0xa371('0x21'),_0x26e95b+'-'+_0x29f087+'/'+_0x34df1f)[_0xa371('0x22')](_0x3afbdd);}return null;};}function patchUpdates(_0x257c41){return function(_0x4652d4){try{jsonpatch[_0xa371('0x23')](_0x4652d4,_0x257c41,!![]);}catch(_0x9b8532){return BPromise['reject'](_0x9b8532);}return _0x4652d4[_0xa371('0x24')]();};}function saveUpdates(_0x1db0bb,_0x4969a0){return function(_0x5f2e69){if(_0x5f2e69){return _0x5f2e69[_0xa371('0x25')](_0x1db0bb)[_0xa371('0x26')](function(_0x349937){return _0x349937;});}return null;};}function removeEntity(_0x2c4793,_0x304b37){return function(_0x13242d){if(_0x13242d){return _0x13242d[_0xa371('0x27')]()[_0xa371('0x26')](function(){var _0x118f9f=_0x13242d[_0xa371('0x28')]({'plain':!![]});var _0x788d84=_0xa371('0x29');return db[_0xa371('0x2a')][_0xa371('0x27')]({'where':{'type':_0x788d84,'resourceId':_0x118f9f['id']}})[_0xa371('0x26')](function(){return _0x13242d;});})['then'](function(){_0x2c4793[_0xa371('0x1a')](0xcc)[_0xa371('0x1b')]();});}};}function handleEntityNotFound(_0x4e633c,_0xe2287d){return function(_0x1a1f89){if(!_0x1a1f89){_0x4e633c[_0xa371('0x19')](0x194);}return _0x1a1f89;};}function handleError(_0x4baa27,_0x1027c3){_0x1027c3=_0x1027c3||0x1f4;return function(_0x9b0e0b){logger[_0xa371('0x2b')](_0x9b0e0b[_0xa371('0x2c')]);if(_0x9b0e0b[_0xa371('0x2d')]){delete _0x9b0e0b[_0xa371('0x2d')];}_0x4baa27[_0xa371('0x1a')](_0x1027c3)['send'](_0x9b0e0b);};}exports[_0xa371('0x2e')]=function(_0x16ae19,_0xa3a8){var _0x13f261={},_0x456960={},_0x9705b7={'count':0x0,'rows':[]};var _0x426d7d=_[_0xa371('0x2f')](db[_0xa371('0x30')][_0xa371('0x31')],function(_0x353a0e){return{'name':_0x353a0e[_0xa371('0x32')],'type':_0x353a0e[_0xa371('0x33')][_0xa371('0x34')]};});_0x456960[_0xa371('0x35')]=_[_0xa371('0x2f')](_0x426d7d,'name');_0x456960[_0xa371('0x36')]=_[_0xa371('0x37')](_0x16ae19[_0xa371('0x36')]);_0x456960[_0xa371('0x38')]=_['intersection'](_0x456960[_0xa371('0x35')],_0x456960['query']);_0x13f261[_0xa371('0x39')]=_[_0xa371('0x3a')](_0x456960['model'],qs[_0xa371('0x3b')](_0x16ae19[_0xa371('0x36')][_0xa371('0x3b')]));_0x13f261[_0xa371('0x39')]=_0x13f261[_0xa371('0x39')][_0xa371('0x3c')]?_0x13f261[_0xa371('0x39')]:_0x456960[_0xa371('0x35')];if(!_0x16ae19['query'][_0xa371('0x3d')](_0xa371('0x3e'))){_0x13f261['limit']=qs[_0xa371('0x1d')](_0x16ae19[_0xa371('0x36')][_0xa371('0x1d')]);_0x13f261[_0xa371('0x1f')]=qs[_0xa371('0x1f')](_0x16ae19['query'][_0xa371('0x1f')]);}_0x13f261[_0xa371('0x3f')]=qs[_0xa371('0x40')](_0x16ae19['query']['sort']);_0x13f261['where']=qs[_0xa371('0x38')](_[_0xa371('0x41')](_0x16ae19[_0xa371('0x36')],_0x456960['filters']),_0x426d7d);if(_0x16ae19['query'][_0xa371('0x42')]){_0x13f261[_0xa371('0x43')]=_[_0xa371('0x44')](_0x13f261[_0xa371('0x43')],{'$or':_[_0xa371('0x2f')](_0x426d7d,function(_0x1dbb55){if(_0x1dbb55[_0xa371('0x33')]!==_0xa371('0x45')){var _0x5c0604={};_0x5c0604[_0x1dbb55[_0xa371('0x2d')]]={'$like':'%'+_0x16ae19['query']['filter']+'%'};return _0x5c0604;}})});}_0x13f261=_[_0xa371('0x44')]({},_0x13f261,_0x16ae19[_0xa371('0x46')]);var _0x3f1ccb={'where':_0x13f261[_0xa371('0x43')]};return db[_0xa371('0x30')][_0xa371('0x1e')](_0x3f1ccb)[_0xa371('0x26')](function(_0x51e431){_0x9705b7[_0xa371('0x1e')]=_0x51e431;if(_0x16ae19[_0xa371('0x36')][_0xa371('0x47')]){_0x13f261[_0xa371('0x48')]=[{'all':!![]}];}return db['Dashboard'][_0xa371('0x49')](_0x13f261);})[_0xa371('0x26')](function(_0x44ae7c){_0x9705b7[_0xa371('0x4a')]=_0x44ae7c;return _0x9705b7;})[_0xa371('0x26')](respondWithFilteredResult(_0xa3a8,_0x13f261))[_0xa371('0x4b')](handleError(_0xa3a8,null));};exports[_0xa371('0x4c')]=function(_0x274cb8,_0x485470){var _0x5f4fbe={'raw':![],'where':{'id':_0x274cb8[_0xa371('0x4d')]['id']}},_0x5d0d9a={};_0x5d0d9a[_0xa371('0x35')]=_[_0xa371('0x37')](db['Dashboard'][_0xa371('0x31')]);_0x5d0d9a[_0xa371('0x36')]=_[_0xa371('0x37')](_0x274cb8['query']);_0x5d0d9a['filters']=_[_0xa371('0x3a')](_0x5d0d9a[_0xa371('0x35')],_0x5d0d9a[_0xa371('0x36')]);_0x5f4fbe['attributes']=_['intersection'](_0x5d0d9a['model'],qs[_0xa371('0x3b')](_0x274cb8[_0xa371('0x36')]['fields']));_0x5f4fbe[_0xa371('0x39')]=_0x5f4fbe['attributes'][_0xa371('0x3c')]?_0x5f4fbe[_0xa371('0x39')]:_0x5d0d9a[_0xa371('0x35')];if(_0x274cb8[_0xa371('0x36')][_0xa371('0x47')]){_0x5f4fbe[_0xa371('0x48')]=[{'all':!![]}];}_0x5f4fbe=_['merge']({},_0x5f4fbe,_0x274cb8[_0xa371('0x46')]);return db[_0xa371('0x30')][_0xa371('0x4e')](_0x5f4fbe)[_0xa371('0x26')](handleEntityNotFound(_0x485470,null))[_0xa371('0x26')](respondWithResult(_0x485470,null))[_0xa371('0x4b')](handleError(_0x485470,null));};exports[_0xa371('0x4f')]=function(_0x563fa7,_0x447a18){return db[_0xa371('0x30')][_0xa371('0x4f')](_0x563fa7[_0xa371('0x50')],{})[_0xa371('0x26')](function(_0x5ebf8a){var _0x944cc1=_0x563fa7[_0xa371('0x51')][_0xa371('0x28')]({'plain':!![]});if(!_0x944cc1)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x944cc1[_0xa371('0x52')]===_0xa371('0x51')){var _0x2f49e5=_0x5ebf8a[_0xa371('0x28')]({'plain':!![]});var _0x2611ec=_0xa371('0x29');return db[_0xa371('0x53')]['find']({'where':{'name':_0x2611ec,'userProfileId':_0x944cc1[_0xa371('0x54')]},'raw':!![]})[_0xa371('0x26')](function(_0x2dbd60){if(_0x2dbd60&&_0x2dbd60[_0xa371('0x55')]===0x0){return db['UserProfileResource'][_0xa371('0x4f')]({'name':_0x2f49e5[_0xa371('0x2d')],'resourceId':_0x2f49e5['id'],'type':_0x2dbd60['name'],'sectionId':_0x2dbd60['id']},{})['then'](function(){return _0x5ebf8a;});}else{return _0x5ebf8a;}})[_0xa371('0x4b')](function(_0x26cb29){logger[_0xa371('0x2b')](_0xa371('0x56'),_0x26cb29);throw _0x26cb29;});}return _0x5ebf8a;})['then'](respondWithResult(_0x447a18,0xc9))['catch'](handleError(_0x447a18,null));};exports[_0xa371('0x57')]=function(_0x4f135d,_0xd9f468){var _0x4ed83c={'where':{'id':_0x4f135d[_0xa371('0x4d')]['id']}},_0x19c33c={};_0x19c33c[_0xa371('0x35')]=_[_0xa371('0x37')](db[_0xa371('0x30')][_0xa371('0x31')]);_0x4ed83c[_0xa371('0x39')]=_[_0xa371('0x3a')](_0x19c33c['model'],qs['fields'](_0x4f135d['query'][_0xa371('0x3b')]));_0x4ed83c[_0xa371('0x39')]=_0x4ed83c[_0xa371('0x39')]['length']?_0x4ed83c['attributes']:_0x19c33c[_0xa371('0x35')];if(_0x4f135d['query'][_0xa371('0x47')]){_0x4ed83c[_0xa371('0x48')]=[{'all':!![]}];}_0x4ed83c=_[_0xa371('0x44')]({},_0x4ed83c,_0x4f135d[_0xa371('0x46')]);return db[_0xa371('0x30')][_0xa371('0x4e')](_0x4ed83c)[_0xa371('0x26')](handleEntityNotFound(_0xd9f468,null))[_0xa371('0x26')](function(_0x5272c5){if(_0x5272c5){var _0xf3cb25=_0x5272c5['get']({'plain':!![]});_0xf3cb25=qs['omit'](_0xf3cb25,['id','createdAt',_0xa371('0x58')]);_0x4f135d[_0xa371('0x50')]=_['omit'](_0x4f135d[_0xa371('0x50')],['id',_0xa371('0x59'),_0xa371('0x58')]);return db[_0xa371('0x30')]['create'](_['merge'](_0xf3cb25,_0x4f135d[_0xa371('0x50')]),{'include':_0x4f135d['query'][_0xa371('0x47')]?[{'all':!![]}]:undefined})['then'](function(_0x4c9940){var _0x28bd7c=_0x4f135d[_0xa371('0x51')][_0xa371('0x28')]({'plain':!![]});if(!_0x28bd7c)throw new Error(_0xa371('0x5a'));if(_0x28bd7c[_0xa371('0x52')]===_0xa371('0x51')){var _0x50e9bb=_0x4c9940['get']({'plain':!![]});var _0x58c1e8=_0xa371('0x29');return db['UserProfileSection'][_0xa371('0x4e')]({'where':{'name':_0x58c1e8,'userProfileId':_0x28bd7c[_0xa371('0x54')]},'raw':!![]})[_0xa371('0x26')](function(_0x57079d){if(_0x57079d&&_0x57079d[_0xa371('0x55')]===0x0){return db['UserProfileResource'][_0xa371('0x4f')]({'name':_0x50e9bb[_0xa371('0x2d')],'resourceId':_0x50e9bb['id'],'type':_0x57079d[_0xa371('0x2d')],'sectionId':_0x57079d['id']},{})['then'](function(){return _0x4c9940;});}else{return _0x4c9940;}})[_0xa371('0x4b')](function(_0x3b4f56){logger[_0xa371('0x2b')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x3b4f56);throw _0x3b4f56;});}return _0x4c9940;});}})[_0xa371('0x26')](respondWithResult(_0xd9f468,0xc9))[_0xa371('0x4b')](handleError(_0xd9f468,null));};exports[_0xa371('0x25')]=function(_0x5f3197,_0xe18241){if(_0x5f3197[_0xa371('0x50')]['id']){delete _0x5f3197[_0xa371('0x50')]['id'];}return db[_0xa371('0x30')][_0xa371('0x4e')]({'where':{'id':_0x5f3197[_0xa371('0x4d')]['id']}})[_0xa371('0x26')](handleEntityNotFound(_0xe18241,null))[_0xa371('0x26')](saveUpdates(_0x5f3197[_0xa371('0x50')],null))[_0xa371('0x26')](respondWithResult(_0xe18241,null))[_0xa371('0x4b')](handleError(_0xe18241,null));};exports[_0xa371('0x27')]=function(_0x4e23a1,_0xba2ed1){return db[_0xa371('0x30')][_0xa371('0x4e')]({'where':{'id':_0x4e23a1[_0xa371('0x4d')]['id']}})[_0xa371('0x26')](handleEntityNotFound(_0xba2ed1,null))[_0xa371('0x26')](removeEntity(_0xba2ed1,null))['catch'](handleError(_0xba2ed1,null));};function widgetAttributes(_0x1e441a){try{switch(_0x1e441a[_0xa371('0x33')]){case'iframe':return[{'name':'attrUrl','value':_0x1e441a[_0xa371('0x5b')]||(_0x1e441a[_0xa371('0x5c')]&&_0x1e441a[_0xa371('0x5c')][0x0]?_0x1e441a[_0xa371('0x5c')][0x0][_0xa371('0x5d')]:undefined)||_0xa371('0x5e')}];case _0xa371('0x5f'):return[{'name':_0xa371('0x60'),'value':_0x1e441a['attrPath']||(_0x1e441a[_0xa371('0x5c')]&&_0x1e441a[_0xa371('0x5c')][0x0]?_0x1e441a[_0xa371('0x5c')][0x0][_0xa371('0x5d')]:undefined)||''}];case _0xa371('0x61'):return[{'name':_0xa371('0x62'),'value':_0x1e441a[_0xa371('0x62')]||(_0x1e441a['attrs']&&_0x1e441a['attrs'][0x0]?_0x1e441a['attrs'][0x0]['value']:undefined)||_0xa371('0x63')},{'name':_0xa371('0x64'),'value':_0x1e441a[_0xa371('0x64')]||(_0x1e441a['attrs']&&_0x1e441a[_0xa371('0x5c')][0x1]?_0x1e441a[_0xa371('0x5c')][0x1]['value']:undefined)||_0xa371('0x65')},{'name':_0xa371('0x66'),'value':_0x1e441a['attrFontSize']||(_0x1e441a[_0xa371('0x5c')]&&_0x1e441a[_0xa371('0x5c')][0x2]?_0x1e441a[_0xa371('0x5c')][0x2][_0xa371('0x5d')]:undefined)||0xc}];case _0xa371('0x67'):return[{'name':_0xa371('0x68'),'value':_0x1e441a[_0xa371('0x68')]||(_0x1e441a[_0xa371('0x5c')]&&_0x1e441a[_0xa371('0x5c')][0x0]?_0x1e441a[_0xa371('0x5c')][0x0]['value']:undefined)||'total'},{'name':_0xa371('0x69'),'value':_0x1e441a[_0xa371('0x69')]||(_0x1e441a['attrs']&&_0x1e441a[_0xa371('0x5c')][0x1]?_0x1e441a['attrs'][0x1][_0xa371('0x5d')]:undefined)||[]},{'name':_0xa371('0x66'),'value':_0x1e441a[_0xa371('0x66')]||(_0x1e441a[_0xa371('0x5c')]&&_0x1e441a['attrs'][0x2]?_0x1e441a[_0xa371('0x5c')][0x2][_0xa371('0x5d')]:undefined)||0x14},{'name':_0xa371('0x6a'),'value':_0x1e441a[_0xa371('0x6a')]||(_0x1e441a[_0xa371('0x5c')]&&_0x1e441a[_0xa371('0x5c')][0x3]?_0x1e441a[_0xa371('0x5c')][0x3][_0xa371('0x5d')]:undefined)||_0xa371('0x6b')},{'name':_0xa371('0x6c'),'value':_0x1e441a[_0xa371('0x6c')]||(_0x1e441a[_0xa371('0x5c')]&&_0x1e441a[_0xa371('0x5c')][0x4]?_0x1e441a['attrs'][0x4][_0xa371('0x5d')]:undefined)||''},{'name':_0xa371('0x6d'),'value':_0x1e441a[_0xa371('0x6d')]||(_0x1e441a[_0xa371('0x5c')]&&_0x1e441a[_0xa371('0x5c')][0x5]?_0x1e441a['attrs'][0x5][_0xa371('0x5d')]:undefined)||''},{'name':_0xa371('0x6e'),'value':_0x1e441a[_0xa371('0x6e')]||(_0x1e441a['attrs']&&_0x1e441a[_0xa371('0x5c')][0x6]?_0x1e441a[_0xa371('0x5c')][0x6][_0xa371('0x5d')]:undefined)||''},{'name':_0xa371('0x6f'),'value':_0x1e441a['attrOpenchannelAccounts']||(_0x1e441a[_0xa371('0x5c')]&&_0x1e441a[_0xa371('0x5c')][0x7]?_0x1e441a[_0xa371('0x5c')][0x7][_0xa371('0x5d')]:undefined)||''},{'name':_0xa371('0x70'),'value':_0x1e441a['attrWhatsappAccounts']||(_0x1e441a[_0xa371('0x5c')]&&_0x1e441a[_0xa371('0x5c')][0x8]?_0x1e441a['attrs'][0x8][_0xa371('0x5d')]:undefined)||''},{'name':_0xa371('0x71'),'value':_0x1e441a[_0xa371('0x71')]||(_0x1e441a[_0xa371('0x5c')]&&_0x1e441a['attrs'][0x9]?_0x1e441a[_0xa371('0x5c')][0x9][_0xa371('0x5d')]:undefined)||''}];case'multibar-chart':case _0xa371('0x72'):return[{'name':'attrSerie1','value':_0x1e441a[_0xa371('0x73')]||(_0x1e441a[_0xa371('0x5c')]&&_0x1e441a[_0xa371('0x5c')][0x0]?_0x1e441a[_0xa371('0x5c')][0x0][_0xa371('0x5d')]:undefined)||_0xa371('0x74')},{'name':_0xa371('0x75'),'value':_0x1e441a[_0xa371('0x75')]||(_0x1e441a[_0xa371('0x5c')]&&_0x1e441a[_0xa371('0x5c')][0x1]?_0x1e441a[_0xa371('0x5c')][0x1][_0xa371('0x5d')]:undefined)||null},{'name':_0xa371('0x76'),'value':_0x1e441a[_0xa371('0x76')]||(_0x1e441a['attrs']&&_0x1e441a[_0xa371('0x5c')][0x2]?_0x1e441a[_0xa371('0x5c')][0x2]['value']:undefined)||null},{'name':_0xa371('0x69'),'value':_0x1e441a[_0xa371('0x69')]||(_0x1e441a[_0xa371('0x5c')]&&_0x1e441a[_0xa371('0x5c')][0x3]?_0x1e441a[_0xa371('0x5c')][0x3]['value']:undefined)||[]},{'name':_0xa371('0x6a'),'value':_0x1e441a[_0xa371('0x6a')]||(_0x1e441a[_0xa371('0x5c')]&&_0x1e441a['attrs'][0x4]?_0x1e441a[_0xa371('0x5c')][0x4][_0xa371('0x5d')]:undefined)||'voice'},{'name':_0xa371('0x6c'),'value':_0x1e441a['attrEmailAccounts']||(_0x1e441a[_0xa371('0x5c')]&&_0x1e441a[_0xa371('0x5c')][0x5]?_0x1e441a[_0xa371('0x5c')][0x5][_0xa371('0x5d')]:undefined)||''},{'name':'attrFaxAccounts','value':_0x1e441a[_0xa371('0x6d')]||(_0x1e441a[_0xa371('0x5c')]&&_0x1e441a[_0xa371('0x5c')][0x6]?_0x1e441a[_0xa371('0x5c')][0x6][_0xa371('0x5d')]:undefined)||''},{'name':'attrSmsAccounts','value':_0x1e441a[_0xa371('0x6e')]||(_0x1e441a[_0xa371('0x5c')]&&_0x1e441a['attrs'][0x7]?_0x1e441a[_0xa371('0x5c')][0x7]['value']:undefined)||''},{'name':_0xa371('0x6f'),'value':_0x1e441a['attrOpenchannelAccounts']||(_0x1e441a['attrs']&&_0x1e441a[_0xa371('0x5c')][0x8]?_0x1e441a['attrs'][0x8]['value']:undefined)||''},{'name':_0xa371('0x70'),'value':_0x1e441a[_0xa371('0x70')]||(_0x1e441a['attrs']&&_0x1e441a['attrs'][0x9]?_0x1e441a[_0xa371('0x5c')][0x9][_0xa371('0x5d')]:undefined)||''},{'name':'attrChatWebsites','value':_0x1e441a['attrChatWebsites']||(_0x1e441a[_0xa371('0x5c')]&&_0x1e441a[_0xa371('0x5c')][0xa]?_0x1e441a[_0xa371('0x5c')][0xa][_0xa371('0x5d')]:undefined)||''}];case _0xa371('0x77'):return[{'name':_0xa371('0x78'),'type':_0x1e441a[_0xa371('0x79')]||(_0x1e441a[_0xa371('0x5c')]&&_0x1e441a[_0xa371('0x5c')][0x0]?_0x1e441a[_0xa371('0x5c')][0x0]['type']:undefined)||null,'value':_0x1e441a[_0xa371('0x78')]||(_0x1e441a[_0xa371('0x5c')]&&_0x1e441a['attrs'][0x0]?_0x1e441a[_0xa371('0x5c')][0x0][_0xa371('0x5d')]:undefined)||null},{'name':_0xa371('0x7a'),'value':_0x1e441a[_0xa371('0x7a')]||(_0x1e441a[_0xa371('0x5c')]&&_0x1e441a[_0xa371('0x5c')][0x1]?_0x1e441a[_0xa371('0x5c')][0x1][_0xa371('0x5d')]:undefined)||0x0}];default:return[];}}catch(_0x4cbcc3){logger[_0xa371('0x2b')](_0xa371('0x7b'),JSON['stringify'](_0x4cbcc3));return[];}}exports[_0xa371('0x7c')]=function(_0x3db793,_0x20d088,_0x60ddad){if(_0x3db793[_0xa371('0x50')]['id']){delete _0x3db793[_0xa371('0x50')]['id'];}return db[_0xa371('0x30')][_0xa371('0x4e')]({'where':{'id':_0x3db793[_0xa371('0x4d')]['id']}})['then'](handleEntityNotFound(_0x20d088,null))['then'](function(_0x3d3c03){if(_0x3d3c03){_0x3db793[_0xa371('0x50')][_0xa371('0x7d')]=_0x3d3c03['id'];_0x3db793['body'][_0xa371('0x5c')]=widgetAttributes(_0x3db793[_0xa371('0x50')]);return db['DashboardItem'][_0xa371('0x4f')](_0x3db793[_0xa371('0x50')]);}})['then'](respondWithResult(_0x20d088,null))[_0xa371('0x4b')](handleError(_0x20d088,null));};exports[_0xa371('0x7e')]=function(_0x5407a3,_0x2eea54,_0x572bb6){var _0x4c68c1={};var _0x4ed6a0={};var _0x2b0c24;var _0xaab1b4;return db[_0xa371('0x30')]['findOne']({'where':{'id':_0x5407a3[_0xa371('0x4d')]['id']}})[_0xa371('0x26')](handleEntityNotFound(_0x2eea54,null))['then'](function(_0x56d39d){if(_0x56d39d){_0x2b0c24=_0x56d39d;_0x4ed6a0[_0xa371('0x35')]=_['keys'](db[_0xa371('0x7f')]['rawAttributes']);_0x4ed6a0[_0xa371('0x36')]=_[_0xa371('0x37')](_0x5407a3[_0xa371('0x36')]);_0x4ed6a0[_0xa371('0x38')]=_['intersection'](_0x4ed6a0[_0xa371('0x35')],_0x4ed6a0['query']);_0x4c68c1[_0xa371('0x39')]=_['intersection'](_0x4ed6a0[_0xa371('0x35')],qs[_0xa371('0x3b')](_0x5407a3[_0xa371('0x36')][_0xa371('0x3b')]));_0x4c68c1['attributes']=_0x4c68c1[_0xa371('0x39')][_0xa371('0x3c')]?_0x4c68c1[_0xa371('0x39')]:_0x4ed6a0[_0xa371('0x35')];_0x4c68c1[_0xa371('0x3f')]=qs[_0xa371('0x40')](_0x5407a3['query']['sort']);_0x4c68c1[_0xa371('0x43')]=qs['filters'](_[_0xa371('0x41')](_0x5407a3[_0xa371('0x36')],_0x4ed6a0[_0xa371('0x38')]));if(_0x5407a3[_0xa371('0x36')][_0xa371('0x42')]){_0x4c68c1[_0xa371('0x43')]=_['merge'](_0x4c68c1[_0xa371('0x43')],{'$or':_[_0xa371('0x2f')](_0x4c68c1[_0xa371('0x39')],function(_0x51fe70){var _0x36a915={};_0x36a915[_0x51fe70]={'$like':'%'+_0x5407a3['query'][_0xa371('0x42')]+'%'};return _0x36a915;})});}_0x4c68c1=_[_0xa371('0x44')]({},_0x4c68c1,_0x5407a3['options']);return _0x2b0c24[_0xa371('0x7e')](_0x4c68c1);}})['then'](function(_0x2be686){if(_0x2be686){_0xaab1b4=_0x2be686[_0xa371('0x3c')];if(!_0x5407a3[_0xa371('0x36')][_0xa371('0x3d')](_0xa371('0x3e'))){_0x4c68c1[_0xa371('0x1d')]=qs[_0xa371('0x1d')](_0x5407a3[_0xa371('0x36')][_0xa371('0x1d')]);_0x4c68c1[_0xa371('0x1f')]=qs[_0xa371('0x1f')](_0x5407a3[_0xa371('0x36')][_0xa371('0x1f')]);}return _0x2b0c24[_0xa371('0x7e')](_0x4c68c1);}})[_0xa371('0x26')](function(_0x2952f9){if(_0x2952f9){return _0x2952f9?{'count':_0xaab1b4,'rows':_0x2952f9}:null;}})[_0xa371('0x26')](respondWithResult(_0x2eea54,null))[_0xa371('0x4b')](handleError(_0x2eea54,null));}; \ No newline at end of file +var _0x74e6=['CustomDashboards','UserProfileSection','userProfileId','autoAssociation','clone','omit','createdAt','updatedAt','body','role','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','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','pie-chart','attrSerie1','attrSerie2','attrSerie3','web-report','attrReport','reportType','attrRefresh','widgetAttributes:\x20%s','addItem','DashboardItem','getItems','findOne','pick','eml-format','fast-json-patch','moment','bluebird','mustache','util','path','sox','ejs','fs-extra','lodash','squel','crypto','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','../../config/license/util','redis','defaults','localhost','socket.io-emitter','./dashboard.socket','register','sendStatus','status','json','offset','undefined','limit','count','set','Content-Range','reject','save','update','then','destroy','get','UserProfileResource','end','error','stack','name','index','map','Dashboard','rawAttributes','fieldName','type','model','query','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','filters','filter','where','merge','options','include','rows','catch','show','params','keys','includeAll','find','create','user','Unable\x20to\x20retrieve\x20the\x20current\x20user'];(function(_0x56d98b,_0x586559){var _0x21fdac=function(_0x4ff17c){while(--_0x4ff17c){_0x56d98b['push'](_0x56d98b['shift']());}};_0x21fdac(++_0x586559);}(_0x74e6,0xb4));var _0x674e=function(_0x27bcf9,_0x4f5a31){_0x27bcf9=_0x27bcf9-0x0;var _0x28a577=_0x74e6[_0x27bcf9];return _0x28a577;};'use strict';var emlformat=require(_0x674e('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0x674e('0x1'));var rp=require('request-promise');var moment=require(_0x674e('0x2'));var BPromise=require(_0x674e('0x3'));var Mustache=require(_0x674e('0x4'));var util=require(_0x674e('0x5'));var path=require(_0x674e('0x6'));var sox=require(_0x674e('0x7'));var csv=require('to-csv');var ejs=require(_0x674e('0x8'));var fs=require('fs');var fs_extra=require(_0x674e('0x9'));var _=require(_0x674e('0xa'));var squel=require(_0x674e('0xb'));var crypto=require(_0x674e('0xc'));var jsforce=require(_0x674e('0xd'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0x674e('0xe'));var Papa=require(_0x674e('0xf'));var Redis=require(_0x674e('0x10'));var authService=require(_0x674e('0x11'));var qs=require(_0x674e('0x12'));var as=require(_0x674e('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x674e('0x14'))('api');var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0x674e('0x15'));var db=require('../../mysqldb')['db'];config[_0x674e('0x16')]=_[_0x674e('0x17')](config[_0x674e('0x16')],{'host':_0x674e('0x18'),'port':0x18eb});var socket=require(_0x674e('0x19'))(new Redis(config[_0x674e('0x16')]));require(_0x674e('0x1a'))[_0x674e('0x1b')](socket);function respondWithStatusCode(_0x3d5688,_0x1ff34c){_0x1ff34c=_0x1ff34c||0xcc;return function(_0xb084b2){if(_0xb084b2){return _0x3d5688[_0x674e('0x1c')](_0x1ff34c);}return _0x3d5688['status'](_0x1ff34c)['end']();};}function respondWithResult(_0x2483a7,_0x2f5d32){_0x2f5d32=_0x2f5d32||0xc8;return function(_0x271711){if(_0x271711){return _0x2483a7[_0x674e('0x1d')](_0x2f5d32)[_0x674e('0x1e')](_0x271711);}};}function respondWithFilteredResult(_0x4013c8,_0x80460d){return function(_0x4e4259){if(_0x4e4259){var _0x282ff1=typeof _0x80460d[_0x674e('0x1f')]===_0x674e('0x20')&&typeof _0x80460d[_0x674e('0x21')]===_0x674e('0x20');var _0x221105=_0x4e4259['count'];var _0x2ee5e6=_0x282ff1?0x0:_0x80460d[_0x674e('0x1f')];var _0x572674=_0x282ff1?_0x4e4259[_0x674e('0x22')]:_0x80460d[_0x674e('0x1f')]+_0x80460d[_0x674e('0x21')];var _0x3af832;if(_0x572674>=_0x221105){_0x572674=_0x221105;_0x3af832=0xc8;}else{_0x3af832=0xce;}_0x4013c8[_0x674e('0x1d')](_0x3af832);return _0x4013c8[_0x674e('0x23')](_0x674e('0x24'),_0x2ee5e6+'-'+_0x572674+'/'+_0x221105)[_0x674e('0x1e')](_0x4e4259);}return null;};}function patchUpdates(_0x55ec4c){return function(_0xe57ae2){try{jsonpatch['apply'](_0xe57ae2,_0x55ec4c,!![]);}catch(_0x28e495){return BPromise[_0x674e('0x25')](_0x28e495);}return _0xe57ae2[_0x674e('0x26')]();};}function saveUpdates(_0x3bdf97,_0x204449){return function(_0x46c7b1){if(_0x46c7b1){return _0x46c7b1[_0x674e('0x27')](_0x3bdf97)[_0x674e('0x28')](function(_0x15fe57){return _0x15fe57;});}return null;};}function removeEntity(_0x127b79,_0x24f3be){return function(_0x417f2a){if(_0x417f2a){return _0x417f2a[_0x674e('0x29')]()[_0x674e('0x28')](function(){var _0x1f79ce=_0x417f2a[_0x674e('0x2a')]({'plain':!![]});var _0xc8b9a3='CustomDashboards';return db[_0x674e('0x2b')][_0x674e('0x29')]({'where':{'type':_0xc8b9a3,'resourceId':_0x1f79ce['id']}})['then'](function(){return _0x417f2a;});})[_0x674e('0x28')](function(){_0x127b79['status'](0xcc)[_0x674e('0x2c')]();});}};}function handleEntityNotFound(_0x52c704,_0xa09754){return function(_0x43fc49){if(!_0x43fc49){_0x52c704['sendStatus'](0x194);}return _0x43fc49;};}function handleError(_0x4df78c,_0x29b36b){_0x29b36b=_0x29b36b||0x1f4;return function(_0x3c1239){logger[_0x674e('0x2d')](_0x3c1239[_0x674e('0x2e')]);if(_0x3c1239[_0x674e('0x2f')]){delete _0x3c1239[_0x674e('0x2f')];}_0x4df78c[_0x674e('0x1d')](_0x29b36b)['send'](_0x3c1239);};}exports[_0x674e('0x30')]=function(_0x30219b,_0x5018ec){var _0x574c33={},_0x415354={},_0x1763aa={'count':0x0,'rows':[]};var _0x426594=_[_0x674e('0x31')](db[_0x674e('0x32')][_0x674e('0x33')],function(_0x1863f4){return{'name':_0x1863f4[_0x674e('0x34')],'type':_0x1863f4[_0x674e('0x35')]['key']};});_0x415354[_0x674e('0x36')]=_[_0x674e('0x31')](_0x426594,_0x674e('0x2f'));_0x415354[_0x674e('0x37')]=_['keys'](_0x30219b['query']);_0x415354['filters']=_[_0x674e('0x38')](_0x415354[_0x674e('0x36')],_0x415354['query']);_0x574c33[_0x674e('0x39')]=_[_0x674e('0x38')](_0x415354[_0x674e('0x36')],qs[_0x674e('0x3a')](_0x30219b['query'][_0x674e('0x3a')]));_0x574c33[_0x674e('0x39')]=_0x574c33[_0x674e('0x39')][_0x674e('0x3b')]?_0x574c33['attributes']:_0x415354['model'];if(!_0x30219b[_0x674e('0x37')][_0x674e('0x3c')](_0x674e('0x3d'))){_0x574c33[_0x674e('0x21')]=qs['limit'](_0x30219b[_0x674e('0x37')][_0x674e('0x21')]);_0x574c33[_0x674e('0x1f')]=qs[_0x674e('0x1f')](_0x30219b['query']['offset']);}_0x574c33[_0x674e('0x3e')]=qs[_0x674e('0x3f')](_0x30219b['query'][_0x674e('0x3f')]);_0x574c33['where']=qs[_0x674e('0x40')](_['pick'](_0x30219b[_0x674e('0x37')],_0x415354[_0x674e('0x40')]),_0x426594);if(_0x30219b[_0x674e('0x37')][_0x674e('0x41')]){_0x574c33[_0x674e('0x42')]=_[_0x674e('0x43')](_0x574c33[_0x674e('0x42')],{'$or':_[_0x674e('0x31')](_0x426594,function(_0x4f6058){if(_0x4f6058[_0x674e('0x35')]!=='VIRTUAL'){var _0x3a2ade={};_0x3a2ade[_0x4f6058[_0x674e('0x2f')]]={'$like':'%'+_0x30219b['query'][_0x674e('0x41')]+'%'};return _0x3a2ade;}})});}_0x574c33=_[_0x674e('0x43')]({},_0x574c33,_0x30219b[_0x674e('0x44')]);var _0x2fb11b={'where':_0x574c33['where']};return db['Dashboard'][_0x674e('0x22')](_0x2fb11b)[_0x674e('0x28')](function(_0x5c8794){_0x1763aa[_0x674e('0x22')]=_0x5c8794;if(_0x30219b[_0x674e('0x37')]['includeAll']){_0x574c33[_0x674e('0x45')]=[{'all':!![]}];}return db[_0x674e('0x32')]['findAll'](_0x574c33);})[_0x674e('0x28')](function(_0x12d12b){_0x1763aa[_0x674e('0x46')]=_0x12d12b;return _0x1763aa;})[_0x674e('0x28')](respondWithFilteredResult(_0x5018ec,_0x574c33))[_0x674e('0x47')](handleError(_0x5018ec,null));};exports[_0x674e('0x48')]=function(_0x36d7f5,_0x23c9fa){var _0x33d3d4={'raw':![],'where':{'id':_0x36d7f5[_0x674e('0x49')]['id']}},_0x359e4d={};_0x359e4d[_0x674e('0x36')]=_[_0x674e('0x4a')](db[_0x674e('0x32')][_0x674e('0x33')]);_0x359e4d[_0x674e('0x37')]=_['keys'](_0x36d7f5[_0x674e('0x37')]);_0x359e4d[_0x674e('0x40')]=_[_0x674e('0x38')](_0x359e4d[_0x674e('0x36')],_0x359e4d[_0x674e('0x37')]);_0x33d3d4[_0x674e('0x39')]=_[_0x674e('0x38')](_0x359e4d[_0x674e('0x36')],qs[_0x674e('0x3a')](_0x36d7f5[_0x674e('0x37')][_0x674e('0x3a')]));_0x33d3d4[_0x674e('0x39')]=_0x33d3d4[_0x674e('0x39')]['length']?_0x33d3d4[_0x674e('0x39')]:_0x359e4d[_0x674e('0x36')];if(_0x36d7f5['query'][_0x674e('0x4b')]){_0x33d3d4[_0x674e('0x45')]=[{'all':!![]}];}_0x33d3d4=_[_0x674e('0x43')]({},_0x33d3d4,_0x36d7f5[_0x674e('0x44')]);return db['Dashboard'][_0x674e('0x4c')](_0x33d3d4)[_0x674e('0x28')](handleEntityNotFound(_0x23c9fa,null))[_0x674e('0x28')](respondWithResult(_0x23c9fa,null))[_0x674e('0x47')](handleError(_0x23c9fa,null));};exports[_0x674e('0x4d')]=function(_0x334695,_0x68e1f8){return db[_0x674e('0x32')][_0x674e('0x4d')](_0x334695['body'],{})[_0x674e('0x28')](function(_0x3f8439){var _0x1131ed=_0x334695[_0x674e('0x4e')]['get']({'plain':!![]});if(!_0x1131ed)throw new Error(_0x674e('0x4f'));if(_0x1131ed['role']===_0x674e('0x4e')){var _0x3c9348=_0x3f8439[_0x674e('0x2a')]({'plain':!![]});var _0xa0d1f=_0x674e('0x50');return db[_0x674e('0x51')][_0x674e('0x4c')]({'where':{'name':_0xa0d1f,'userProfileId':_0x1131ed[_0x674e('0x52')]},'raw':!![]})[_0x674e('0x28')](function(_0xb34e42){if(_0xb34e42&&_0xb34e42[_0x674e('0x53')]===0x0){return db[_0x674e('0x2b')][_0x674e('0x4d')]({'name':_0x3c9348[_0x674e('0x2f')],'resourceId':_0x3c9348['id'],'type':_0xb34e42[_0x674e('0x2f')],'sectionId':_0xb34e42['id']},{})[_0x674e('0x28')](function(){return _0x3f8439;});}else{return _0x3f8439;}})[_0x674e('0x47')](function(_0xa19652){logger[_0x674e('0x2d')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0xa19652);throw _0xa19652;});}return _0x3f8439;})[_0x674e('0x28')](respondWithResult(_0x68e1f8,0xc9))[_0x674e('0x47')](handleError(_0x68e1f8,null));};exports[_0x674e('0x54')]=function(_0x3d7fa2,_0x429f9a){var _0xa940a4={'where':{'id':_0x3d7fa2['params']['id']}},_0x44e043={};_0x44e043[_0x674e('0x36')]=_['keys'](db[_0x674e('0x32')][_0x674e('0x33')]);_0xa940a4[_0x674e('0x39')]=_[_0x674e('0x38')](_0x44e043[_0x674e('0x36')],qs[_0x674e('0x3a')](_0x3d7fa2[_0x674e('0x37')][_0x674e('0x3a')]));_0xa940a4[_0x674e('0x39')]=_0xa940a4[_0x674e('0x39')][_0x674e('0x3b')]?_0xa940a4['attributes']:_0x44e043['model'];if(_0x3d7fa2[_0x674e('0x37')][_0x674e('0x4b')]){_0xa940a4[_0x674e('0x45')]=[{'all':!![]}];}_0xa940a4=_[_0x674e('0x43')]({},_0xa940a4,_0x3d7fa2[_0x674e('0x44')]);return db['Dashboard'][_0x674e('0x4c')](_0xa940a4)[_0x674e('0x28')](handleEntityNotFound(_0x429f9a,null))[_0x674e('0x28')](function(_0x3d67ee){if(_0x3d67ee){var _0xa73400=_0x3d67ee[_0x674e('0x2a')]({'plain':!![]});_0xa73400=qs[_0x674e('0x55')](_0xa73400,['id',_0x674e('0x56'),_0x674e('0x57')]);_0x3d7fa2[_0x674e('0x58')]=_[_0x674e('0x55')](_0x3d7fa2['body'],['id',_0x674e('0x56'),'updatedAt']);return db[_0x674e('0x32')]['create'](_['merge'](_0xa73400,_0x3d7fa2[_0x674e('0x58')]),{'include':_0x3d7fa2['query'][_0x674e('0x4b')]?[{'all':!![]}]:undefined})[_0x674e('0x28')](function(_0x410f25){var _0x194834=_0x3d7fa2[_0x674e('0x4e')][_0x674e('0x2a')]({'plain':!![]});if(!_0x194834)throw new Error(_0x674e('0x4f'));if(_0x194834[_0x674e('0x59')]===_0x674e('0x4e')){var _0x2f8ffa=_0x410f25['get']({'plain':!![]});var _0x2dc46d=_0x674e('0x50');return db[_0x674e('0x51')]['find']({'where':{'name':_0x2dc46d,'userProfileId':_0x194834[_0x674e('0x52')]},'raw':!![]})[_0x674e('0x28')](function(_0x2416db){if(_0x2416db&&_0x2416db[_0x674e('0x53')]===0x0){return db[_0x674e('0x2b')][_0x674e('0x4d')]({'name':_0x2f8ffa[_0x674e('0x2f')],'resourceId':_0x2f8ffa['id'],'type':_0x2416db[_0x674e('0x2f')],'sectionId':_0x2416db['id']},{})[_0x674e('0x28')](function(){return _0x410f25;});}else{return _0x410f25;}})[_0x674e('0x47')](function(_0x1f9748){logger['error'](_0x674e('0x5a'),_0x1f9748);throw _0x1f9748;});}return _0x410f25;});}})['then'](respondWithResult(_0x429f9a,0xc9))[_0x674e('0x47')](handleError(_0x429f9a,null));};exports[_0x674e('0x27')]=function(_0xc8fc3f,_0x730f88){if(_0xc8fc3f['body']['id']){delete _0xc8fc3f[_0x674e('0x58')]['id'];}return db[_0x674e('0x32')][_0x674e('0x4c')]({'where':{'id':_0xc8fc3f[_0x674e('0x49')]['id']}})[_0x674e('0x28')](handleEntityNotFound(_0x730f88,null))[_0x674e('0x28')](saveUpdates(_0xc8fc3f['body'],null))[_0x674e('0x28')](respondWithResult(_0x730f88,null))['catch'](handleError(_0x730f88,null));};exports[_0x674e('0x29')]=function(_0x427f6b,_0x349844){return db['Dashboard'][_0x674e('0x4c')]({'where':{'id':_0x427f6b[_0x674e('0x49')]['id']}})[_0x674e('0x28')](handleEntityNotFound(_0x349844,null))[_0x674e('0x28')](removeEntity(_0x349844,null))[_0x674e('0x47')](handleError(_0x349844,null));};function widgetAttributes(_0x168c41){try{switch(_0x168c41[_0x674e('0x35')]){case _0x674e('0x5b'):return[{'name':_0x674e('0x5c'),'value':_0x168c41['attrUrl']||(_0x168c41['attrs']&&_0x168c41[_0x674e('0x5d')][0x0]?_0x168c41['attrs'][0x0][_0x674e('0x5e')]:undefined)||_0x674e('0x5f')}];case _0x674e('0x60'):return[{'name':'attrPath','value':_0x168c41[_0x674e('0x61')]||(_0x168c41[_0x674e('0x5d')]&&_0x168c41[_0x674e('0x5d')][0x0]?_0x168c41[_0x674e('0x5d')][0x0][_0x674e('0x5e')]:undefined)||''}];case _0x674e('0x62'):return[{'name':'attrHourFormat','value':_0x168c41[_0x674e('0x63')]||(_0x168c41['attrs']&&_0x168c41[_0x674e('0x5d')][0x0]?_0x168c41['attrs'][0x0][_0x674e('0x5e')]:undefined)||_0x674e('0x64')},{'name':_0x674e('0x65'),'value':_0x168c41[_0x674e('0x65')]||(_0x168c41['attrs']&&_0x168c41[_0x674e('0x5d')][0x1]?_0x168c41['attrs'][0x1][_0x674e('0x5e')]:undefined)||_0x674e('0x66')},{'name':_0x674e('0x67'),'value':_0x168c41[_0x674e('0x67')]||(_0x168c41[_0x674e('0x5d')]&&_0x168c41[_0x674e('0x5d')][0x2]?_0x168c41['attrs'][0x2]['value']:undefined)||0xc}];case _0x674e('0x68'):return[{'name':'attrMetric','value':_0x168c41[_0x674e('0x69')]||(_0x168c41[_0x674e('0x5d')]&&_0x168c41['attrs'][0x0]?_0x168c41[_0x674e('0x5d')][0x0][_0x674e('0x5e')]:undefined)||_0x674e('0x6a')},{'name':_0x674e('0x6b'),'value':_0x168c41[_0x674e('0x6b')]||(_0x168c41[_0x674e('0x5d')]&&_0x168c41[_0x674e('0x5d')][0x1]?_0x168c41['attrs'][0x1][_0x674e('0x5e')]:undefined)||[]},{'name':_0x674e('0x67'),'value':_0x168c41[_0x674e('0x67')]||(_0x168c41[_0x674e('0x5d')]&&_0x168c41[_0x674e('0x5d')][0x2]?_0x168c41['attrs'][0x2][_0x674e('0x5e')]:undefined)||0x14},{'name':_0x674e('0x6c'),'value':_0x168c41[_0x674e('0x6c')]||(_0x168c41[_0x674e('0x5d')]&&_0x168c41[_0x674e('0x5d')][0x3]?_0x168c41['attrs'][0x3][_0x674e('0x5e')]:undefined)||_0x674e('0x6d')},{'name':_0x674e('0x6e'),'value':_0x168c41[_0x674e('0x6e')]||(_0x168c41[_0x674e('0x5d')]&&_0x168c41[_0x674e('0x5d')][0x4]?_0x168c41[_0x674e('0x5d')][0x4][_0x674e('0x5e')]:undefined)||''},{'name':_0x674e('0x6f'),'value':_0x168c41[_0x674e('0x6f')]||(_0x168c41[_0x674e('0x5d')]&&_0x168c41[_0x674e('0x5d')][0x5]?_0x168c41['attrs'][0x5][_0x674e('0x5e')]:undefined)||''},{'name':_0x674e('0x70'),'value':_0x168c41['attrSmsAccounts']||(_0x168c41[_0x674e('0x5d')]&&_0x168c41[_0x674e('0x5d')][0x6]?_0x168c41[_0x674e('0x5d')][0x6][_0x674e('0x5e')]:undefined)||''},{'name':_0x674e('0x71'),'value':_0x168c41[_0x674e('0x71')]||(_0x168c41[_0x674e('0x5d')]&&_0x168c41['attrs'][0x7]?_0x168c41['attrs'][0x7]['value']:undefined)||''},{'name':_0x674e('0x72'),'value':_0x168c41[_0x674e('0x72')]||(_0x168c41['attrs']&&_0x168c41[_0x674e('0x5d')][0x8]?_0x168c41[_0x674e('0x5d')][0x8][_0x674e('0x5e')]:undefined)||''},{'name':_0x674e('0x73'),'value':_0x168c41['attrChatWebsites']||(_0x168c41[_0x674e('0x5d')]&&_0x168c41[_0x674e('0x5d')][0x9]?_0x168c41[_0x674e('0x5d')][0x9][_0x674e('0x5e')]:undefined)||''}];case'multibar-chart':case _0x674e('0x74'):return[{'name':_0x674e('0x75'),'value':_0x168c41[_0x674e('0x75')]||(_0x168c41['attrs']&&_0x168c41['attrs'][0x0]?_0x168c41[_0x674e('0x5d')][0x0][_0x674e('0x5e')]:undefined)||_0x674e('0x6a')},{'name':_0x674e('0x76'),'value':_0x168c41[_0x674e('0x76')]||(_0x168c41[_0x674e('0x5d')]&&_0x168c41['attrs'][0x1]?_0x168c41[_0x674e('0x5d')][0x1][_0x674e('0x5e')]:undefined)||null},{'name':'attrSerie3','value':_0x168c41[_0x674e('0x77')]||(_0x168c41['attrs']&&_0x168c41[_0x674e('0x5d')][0x2]?_0x168c41['attrs'][0x2]['value']:undefined)||null},{'name':'attrVoiceQueues','value':_0x168c41['attrVoiceQueues']||(_0x168c41[_0x674e('0x5d')]&&_0x168c41['attrs'][0x3]?_0x168c41['attrs'][0x3][_0x674e('0x5e')]:undefined)||[]},{'name':_0x674e('0x6c'),'value':_0x168c41['attrChannel']||(_0x168c41[_0x674e('0x5d')]&&_0x168c41[_0x674e('0x5d')][0x4]?_0x168c41[_0x674e('0x5d')][0x4][_0x674e('0x5e')]:undefined)||'voice'},{'name':_0x674e('0x6e'),'value':_0x168c41[_0x674e('0x6e')]||(_0x168c41[_0x674e('0x5d')]&&_0x168c41['attrs'][0x5]?_0x168c41[_0x674e('0x5d')][0x5][_0x674e('0x5e')]:undefined)||''},{'name':_0x674e('0x6f'),'value':_0x168c41[_0x674e('0x6f')]||(_0x168c41[_0x674e('0x5d')]&&_0x168c41[_0x674e('0x5d')][0x6]?_0x168c41[_0x674e('0x5d')][0x6]['value']:undefined)||''},{'name':_0x674e('0x70'),'value':_0x168c41[_0x674e('0x70')]||(_0x168c41[_0x674e('0x5d')]&&_0x168c41['attrs'][0x7]?_0x168c41['attrs'][0x7]['value']:undefined)||''},{'name':'attrOpenchannelAccounts','value':_0x168c41['attrOpenchannelAccounts']||(_0x168c41[_0x674e('0x5d')]&&_0x168c41[_0x674e('0x5d')][0x8]?_0x168c41[_0x674e('0x5d')][0x8][_0x674e('0x5e')]:undefined)||''},{'name':_0x674e('0x72'),'value':_0x168c41[_0x674e('0x72')]||(_0x168c41[_0x674e('0x5d')]&&_0x168c41[_0x674e('0x5d')][0x9]?_0x168c41[_0x674e('0x5d')][0x9][_0x674e('0x5e')]:undefined)||''},{'name':_0x674e('0x73'),'value':_0x168c41[_0x674e('0x73')]||(_0x168c41[_0x674e('0x5d')]&&_0x168c41['attrs'][0xa]?_0x168c41[_0x674e('0x5d')][0xa][_0x674e('0x5e')]:undefined)||''}];case _0x674e('0x78'):return[{'name':_0x674e('0x79'),'type':_0x168c41[_0x674e('0x7a')]||(_0x168c41[_0x674e('0x5d')]&&_0x168c41['attrs'][0x0]?_0x168c41[_0x674e('0x5d')][0x0][_0x674e('0x35')]:undefined)||null,'value':_0x168c41[_0x674e('0x79')]||(_0x168c41['attrs']&&_0x168c41['attrs'][0x0]?_0x168c41['attrs'][0x0]['value']:undefined)||null},{'name':_0x674e('0x7b'),'value':_0x168c41[_0x674e('0x7b')]||(_0x168c41['attrs']&&_0x168c41[_0x674e('0x5d')][0x1]?_0x168c41['attrs'][0x1][_0x674e('0x5e')]:undefined)||0x0}];default:return[];}}catch(_0x823f06){logger['error'](_0x674e('0x7c'),JSON['stringify'](_0x823f06));return[];}}exports[_0x674e('0x7d')]=function(_0x27ca25,_0x3bbd0a,_0xc0df63){if(_0x27ca25[_0x674e('0x58')]['id']){delete _0x27ca25[_0x674e('0x58')]['id'];}return db[_0x674e('0x32')][_0x674e('0x4c')]({'where':{'id':_0x27ca25[_0x674e('0x49')]['id']}})['then'](handleEntityNotFound(_0x3bbd0a,null))['then'](function(_0x460786){if(_0x460786){_0x27ca25['body']['DashboardId']=_0x460786['id'];_0x27ca25[_0x674e('0x58')][_0x674e('0x5d')]=widgetAttributes(_0x27ca25[_0x674e('0x58')]);return db[_0x674e('0x7e')][_0x674e('0x4d')](_0x27ca25['body']);}})['then'](respondWithResult(_0x3bbd0a,null))[_0x674e('0x47')](handleError(_0x3bbd0a,null));};exports[_0x674e('0x7f')]=function(_0x1412ac,_0x251523,_0x17dfd4){var _0x526cea={};var _0x939bb4={};var _0x5a7b05;var _0x4ddaf0;return db[_0x674e('0x32')][_0x674e('0x80')]({'where':{'id':_0x1412ac[_0x674e('0x49')]['id']}})[_0x674e('0x28')](handleEntityNotFound(_0x251523,null))[_0x674e('0x28')](function(_0x3e3191){if(_0x3e3191){_0x5a7b05=_0x3e3191;_0x939bb4[_0x674e('0x36')]=_[_0x674e('0x4a')](db[_0x674e('0x7e')][_0x674e('0x33')]);_0x939bb4['query']=_[_0x674e('0x4a')](_0x1412ac[_0x674e('0x37')]);_0x939bb4['filters']=_[_0x674e('0x38')](_0x939bb4['model'],_0x939bb4[_0x674e('0x37')]);_0x526cea[_0x674e('0x39')]=_[_0x674e('0x38')](_0x939bb4[_0x674e('0x36')],qs[_0x674e('0x3a')](_0x1412ac[_0x674e('0x37')][_0x674e('0x3a')]));_0x526cea[_0x674e('0x39')]=_0x526cea['attributes'][_0x674e('0x3b')]?_0x526cea[_0x674e('0x39')]:_0x939bb4[_0x674e('0x36')];_0x526cea[_0x674e('0x3e')]=qs[_0x674e('0x3f')](_0x1412ac[_0x674e('0x37')]['sort']);_0x526cea[_0x674e('0x42')]=qs[_0x674e('0x40')](_[_0x674e('0x81')](_0x1412ac['query'],_0x939bb4[_0x674e('0x40')]));if(_0x1412ac[_0x674e('0x37')][_0x674e('0x41')]){_0x526cea[_0x674e('0x42')]=_[_0x674e('0x43')](_0x526cea['where'],{'$or':_[_0x674e('0x31')](_0x526cea[_0x674e('0x39')],function(_0x5c2f87){var _0x48f36f={};_0x48f36f[_0x5c2f87]={'$like':'%'+_0x1412ac[_0x674e('0x37')]['filter']+'%'};return _0x48f36f;})});}_0x526cea=_[_0x674e('0x43')]({},_0x526cea,_0x1412ac[_0x674e('0x44')]);return _0x5a7b05[_0x674e('0x7f')](_0x526cea);}})['then'](function(_0x13e7b4){if(_0x13e7b4){_0x4ddaf0=_0x13e7b4[_0x674e('0x3b')];if(!_0x1412ac[_0x674e('0x37')][_0x674e('0x3c')](_0x674e('0x3d'))){_0x526cea[_0x674e('0x21')]=qs[_0x674e('0x21')](_0x1412ac[_0x674e('0x37')][_0x674e('0x21')]);_0x526cea[_0x674e('0x1f')]=qs[_0x674e('0x1f')](_0x1412ac[_0x674e('0x37')][_0x674e('0x1f')]);}return _0x5a7b05[_0x674e('0x7f')](_0x526cea);}})[_0x674e('0x28')](function(_0x32a4b8){if(_0x32a4b8){return _0x32a4b8?{'count':_0x4ddaf0,'rows':_0x32a4b8}:null;}})['then'](respondWithResult(_0x251523,null))['catch'](handleError(_0x251523,null));}; \ No newline at end of file diff --git a/server/api/dashboard/dashboard.events.js b/server/api/dashboard/dashboard.events.js index ec47d4f..e6e33dd 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 _0x2732=['Dashboard','save','emit','hook','exports','../../mysqldb'];(function(_0x2673c5,_0x15d7ce){var _0x38498b=function(_0x3be856){while(--_0x3be856){_0x2673c5['push'](_0x2673c5['shift']());}};_0x38498b(++_0x15d7ce);}(_0x2732,0x17f));var _0x2273=function(_0xebed77,_0x2de5c4){_0xebed77=_0xebed77-0x0;var _0x4eb945=_0x2732[_0xebed77];return _0x4eb945;};'use strict';var EventEmitter=require('events');var Dashboard=require(_0x2273('0x0'))['db'][_0x2273('0x1')];var DashboardEvents=new EventEmitter();DashboardEvents['setMaxListeners'](0x0);var events={'afterCreate':_0x2273('0x2'),'afterUpdate':'update','afterDestroy':'remove'};function emitEvent(_0x48c8c7){return function(_0xb3d2aa,_0x28d290,_0x29d6d7){DashboardEvents[_0x2273('0x3')](_0x48c8c7+':'+_0xb3d2aa['id'],_0xb3d2aa);DashboardEvents[_0x2273('0x3')](_0x48c8c7,_0xb3d2aa);_0x29d6d7(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];Dashboard[_0x2273('0x4')](e,emitEvent(event));}}module[_0x2273('0x5')]=DashboardEvents; \ No newline at end of file +var _0x229d=['save','remove','emit','exports','Dashboard','setMaxListeners'];(function(_0xcd0c63,_0xc0c46f){var _0xa84f9e=function(_0x2ebb32){while(--_0x2ebb32){_0xcd0c63['push'](_0xcd0c63['shift']());}};_0xa84f9e(++_0xc0c46f);}(_0x229d,0x100));var _0xd229=function(_0x3947c9,_0x4d6c97){_0x3947c9=_0x3947c9-0x0;var _0x2e7871=_0x229d[_0x3947c9];return _0x2e7871;};'use strict';var EventEmitter=require('events');var Dashboard=require('../../mysqldb')['db'][_0xd229('0x0')];var DashboardEvents=new EventEmitter();DashboardEvents[_0xd229('0x1')](0x0);var events={'afterCreate':_0xd229('0x2'),'afterUpdate':'update','afterDestroy':_0xd229('0x3')};function emitEvent(_0x23e003){return function(_0x544ecb,_0x29ff10,_0x4464e1){DashboardEvents[_0xd229('0x4')](_0x23e003+':'+_0x544ecb['id'],_0x544ecb);DashboardEvents[_0xd229('0x4')](_0x23e003,_0x544ecb);_0x4464e1(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];Dashboard['hook'](e,emitEvent(event));}}module[_0xd229('0x5')]=DashboardEvents; \ No newline at end of file diff --git a/server/api/dashboard/dashboard.model.js b/server/api/dashboard/dashboard.model.js index 5e4f83a..99a4145 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 _0x291a=['Dashboard','lodash','util','api','moment','path','../../config/environment','exports'];(function(_0x54cffe,_0x3bd547){var _0x5ca54d=function(_0x13cf63){while(--_0x13cf63){_0x54cffe['push'](_0x54cffe['shift']());}};_0x5ca54d(++_0x3bd547);}(_0x291a,0x101));var _0xa291=function(_0x22754d,_0x3ffa6b){_0x22754d=_0x22754d-0x0;var _0x4e2724=_0x291a[_0x22754d];return _0x4e2724;};'use strict';var _=require(_0xa291('0x0'));var util=require(_0xa291('0x1'));var logger=require('../../config/logger')(_0xa291('0x2'));var moment=require(_0xa291('0x3'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0xa291('0x4'));var rimraf=require('rimraf');var config=require(_0xa291('0x5'));var attributes=require('./dashboard.attributes');module[_0xa291('0x6')]=function(_0xb3855,_0x4728e2){return _0xb3855['define'](_0xa291('0x7'),attributes,{'tableName':'dashboards','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x1ae6=['path','./dashboard.attributes','define','Dashboard','lodash','../../config/logger','moment','bluebird'];(function(_0x5cbcf8,_0x24cbac){var _0x204024=function(_0x2072b9){while(--_0x2072b9){_0x5cbcf8['push'](_0x5cbcf8['shift']());}};_0x204024(++_0x24cbac);}(_0x1ae6,0x94));var _0x61ae=function(_0x2d7f0e,_0x3e6fbd){_0x2d7f0e=_0x2d7f0e-0x0;var _0x110b07=_0x1ae6[_0x2d7f0e];return _0x110b07;};'use strict';var _=require(_0x61ae('0x0'));var util=require('util');var logger=require(_0x61ae('0x1'))('api');var moment=require(_0x61ae('0x2'));var BPromise=require(_0x61ae('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x61ae('0x4'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0x61ae('0x5'));module['exports']=function(_0x37727d,_0x17adea){return _0x37727d[_0x61ae('0x6')](_0x61ae('0x7'),attributes,{'tableName':'dashboards','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 c65a87a..b5cb32a 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 _0x6a5a=['result','catch','lodash','util','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','redis','defaults','localhost','socket.io-emitter','./dashboard.socket','register','request','then','info','Dashboard,\x20%s,\x20%s','request\x20sent','debug','Dashboard,\x20%s,\x20%s,\x20%s','stringify','error','code','message'];(function(_0x462a0e,_0x65bb6b){var _0x368281=function(_0x7f61bf){while(--_0x7f61bf){_0x462a0e['push'](_0x462a0e['shift']());}};_0x368281(++_0x65bb6b);}(_0x6a5a,0xaa));var _0xa6a5=function(_0x4f48ab,_0x5b366e){_0x4f48ab=_0x4f48ab-0x0;var _0x759f9e=_0x6a5a[_0x4f48ab];return _0x759f9e;};'use strict';var _=require(_0xa6a5('0x0'));var util=require(_0xa6a5('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xa6a5('0x2'));var db=require('../../mysqldb')['db'];var utils=require(_0xa6a5('0x3'));var logger=require(_0xa6a5('0x4'))(_0xa6a5('0x5'));var config=require(_0xa6a5('0x6'));var jayson=require(_0xa6a5('0x7'));var client=jayson['client'][_0xa6a5('0x8')]({'port':0x232a});config[_0xa6a5('0x9')]=_[_0xa6a5('0xa')](config[_0xa6a5('0x9')],{'host':_0xa6a5('0xb'),'port':0x18eb});var socket=require(_0xa6a5('0xc'))(new Redis(config[_0xa6a5('0x9')]));require(_0xa6a5('0xd'))[_0xa6a5('0xe')](socket);function respondWithRpcPromise(_0x245ddf,_0x5a23f1,_0x29d13b){return new BPromise(function(_0x39c405,_0x1cb70a){return client[_0xa6a5('0xf')](_0x245ddf,_0x29d13b)[_0xa6a5('0x10')](function(_0x59f8b9){logger[_0xa6a5('0x11')](_0xa6a5('0x12'),_0x5a23f1,_0xa6a5('0x13'));logger[_0xa6a5('0x14')](_0xa6a5('0x15'),_0x5a23f1,'request\x20sent',JSON[_0xa6a5('0x16')](_0x59f8b9));if(_0x59f8b9['error']){if(_0x59f8b9[_0xa6a5('0x17')][_0xa6a5('0x18')]===0x1f4){logger[_0xa6a5('0x17')](_0xa6a5('0x12'),_0x5a23f1,_0x59f8b9[_0xa6a5('0x17')][_0xa6a5('0x19')]);return _0x1cb70a(_0x59f8b9[_0xa6a5('0x17')]['message']);}logger[_0xa6a5('0x17')](_0xa6a5('0x12'),_0x5a23f1,_0x59f8b9[_0xa6a5('0x17')][_0xa6a5('0x19')]);return _0x39c405(_0x59f8b9[_0xa6a5('0x17')][_0xa6a5('0x19')]);}else{logger['info']('Dashboard,\x20%s,\x20%s',_0x5a23f1,_0xa6a5('0x13'));_0x39c405(_0x59f8b9[_0xa6a5('0x1a')]['message']);}})[_0xa6a5('0x1b')](function(_0x2cf455){logger[_0xa6a5('0x17')](_0xa6a5('0x12'),_0x5a23f1,_0x2cf455);_0x1cb70a(_0x2cf455);});});} \ No newline at end of file +var _0x88c8=['debug','stringify','error','message','catch','lodash','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/environment','jayson/promise','client','http','redis','defaults','localhost','socket.io-emitter','./dashboard.socket','register','request','then','info','Dashboard,\x20%s,\x20%s','request\x20sent'];(function(_0x502c7d,_0x2f1285){var _0x30b7ed=function(_0x2d92f3){while(--_0x2d92f3){_0x502c7d['push'](_0x502c7d['shift']());}};_0x30b7ed(++_0x2f1285);}(_0x88c8,0x118));var _0x888c=function(_0x4a4e21,_0x31ce98){_0x4a4e21=_0x4a4e21-0x0;var _0x446871=_0x88c8[_0x4a4e21];return _0x446871;};'use strict';var _=require(_0x888c('0x0'));var util=require('util');var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0x888c('0x1'));var fs=require('fs');var Redis=require(_0x888c('0x2'));var db=require(_0x888c('0x3'))['db'];var utils=require(_0x888c('0x4'));var logger=require('../../config/logger')('rpc');var config=require(_0x888c('0x5'));var jayson=require(_0x888c('0x6'));var client=jayson[_0x888c('0x7')][_0x888c('0x8')]({'port':0x232a});config[_0x888c('0x9')]=_[_0x888c('0xa')](config['redis'],{'host':_0x888c('0xb'),'port':0x18eb});var socket=require(_0x888c('0xc'))(new Redis(config['redis']));require(_0x888c('0xd'))[_0x888c('0xe')](socket);function respondWithRpcPromise(_0x33dbf9,_0x413819,_0x46de8e){return new BPromise(function(_0x2c73e6,_0x5e80c1){return client[_0x888c('0xf')](_0x33dbf9,_0x46de8e)[_0x888c('0x10')](function(_0x459928){logger[_0x888c('0x11')](_0x888c('0x12'),_0x413819,_0x888c('0x13'));logger[_0x888c('0x14')]('Dashboard,\x20%s,\x20%s,\x20%s',_0x413819,_0x888c('0x13'),JSON[_0x888c('0x15')](_0x459928));if(_0x459928[_0x888c('0x16')]){if(_0x459928[_0x888c('0x16')]['code']===0x1f4){logger['error'](_0x888c('0x12'),_0x413819,_0x459928[_0x888c('0x16')][_0x888c('0x17')]);return _0x5e80c1(_0x459928['error'][_0x888c('0x17')]);}logger['error'](_0x888c('0x12'),_0x413819,_0x459928['error'][_0x888c('0x17')]);return _0x2c73e6(_0x459928['error'][_0x888c('0x17')]);}else{logger['info'](_0x888c('0x12'),_0x413819,'request\x20sent');_0x2c73e6(_0x459928['result'][_0x888c('0x17')]);}})[_0x888c('0x18')](function(_0x26442b){logger['error'](_0x888c('0x12'),_0x413819,_0x26442b);_0x5e80c1(_0x26442b);});});} \ No newline at end of file diff --git a/server/api/dashboard/dashboard.socket.js b/server/api/dashboard/dashboard.socket.js index c179a78..188474f 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 _0x8d09=['save','remove','update','removeListener','register','length','dashboard:','./dashboard.events'];(function(_0x178b3d,_0x40dc46){var _0x1c05c1=function(_0x525349){while(--_0x525349){_0x178b3d['push'](_0x178b3d['shift']());}};_0x1c05c1(++_0x40dc46);}(_0x8d09,0x1df));var _0x98d0=function(_0x5da4d8,_0x31cca6){_0x5da4d8=_0x5da4d8-0x0;var _0x354518=_0x8d09[_0x5da4d8];return _0x354518;};'use strict';var DashboardEvents=require(_0x98d0('0x0'));var events=[_0x98d0('0x1'),_0x98d0('0x2'),_0x98d0('0x3')];function createListener(_0x2d8010,_0x319eae){return function(_0x258ee2){_0x319eae['emit'](_0x2d8010,_0x258ee2);};}function removeListener(_0x28a0a8,_0x3ade74){return function(){DashboardEvents[_0x98d0('0x4')](_0x28a0a8,_0x3ade74);};}exports[_0x98d0('0x5')]=function(_0x1533e0){for(var _0x42825c=0x0,_0x54c44e=events[_0x98d0('0x6')];_0x42825c<_0x54c44e;_0x42825c++){var _0x103a7f=events[_0x42825c];var _0x53808f=createListener(_0x98d0('0x7')+_0x103a7f,_0x1533e0);DashboardEvents['on'](_0x103a7f,_0x53808f);}}; \ No newline at end of file +var _0x7e6d=['remove','removeListener','length','./dashboard.events','save'];(function(_0x3daf12,_0x50808f){var _0xe73e43=function(_0x590df3){while(--_0x590df3){_0x3daf12['push'](_0x3daf12['shift']());}};_0xe73e43(++_0x50808f);}(_0x7e6d,0xee));var _0xd7e6=function(_0x212776,_0x5d8008){_0x212776=_0x212776-0x0;var _0x1c9c44=_0x7e6d[_0x212776];return _0x1c9c44;};'use strict';var DashboardEvents=require(_0xd7e6('0x0'));var events=[_0xd7e6('0x1'),_0xd7e6('0x2'),'update'];function createListener(_0x3b93f2,_0x14ab04){return function(_0x4063be){_0x14ab04['emit'](_0x3b93f2,_0x4063be);};}function removeListener(_0x13fea5,_0x112611){return function(){DashboardEvents[_0xd7e6('0x3')](_0x13fea5,_0x112611);};}exports['register']=function(_0x5c7c32){for(var _0x5a379b=0x0,_0x53de8c=events[_0xd7e6('0x4')];_0x5a379b<_0x53de8c;_0x5a379b++){var _0x576562=events[_0x5a379b];var _0x475e9f=createListener('dashboard:'+_0x576562,_0x5c7c32);DashboardEvents['on'](_0x576562,_0x475e9f);}}; \ No newline at end of file diff --git a/server/api/dashboard/index.js b/server/api/dashboard/index.js index 0fc7a70..4e10e44 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 _0x3560=['get','isAuthenticated','index','/:id/items','getItems','create','post','/:id/clone','clone','addItem','put','/:id','update','delete','destroy','exports','multer','path','connect-timeout','fs-extra','../../components/interaction/service'];(function(_0x2a7b8e,_0x50ffce){var _0x29b5c8=function(_0x131fe0){while(--_0x131fe0){_0x2a7b8e['push'](_0x2a7b8e['shift']());}};_0x29b5c8(++_0x50ffce);}(_0x3560,0x121));var _0x0356=function(_0x27d10a,_0x35ff44){_0x27d10a=_0x27d10a-0x0;var _0x63302e=_0x3560[_0x27d10a];return _0x63302e;};'use strict';var multer=require(_0x0356('0x0'));var util=require('util');var path=require(_0x0356('0x1'));var timeout=require(_0x0356('0x2'));var express=require('express');var router=express['Router']();var fs_extra=require(_0x0356('0x3'));var auth=require('../../components/auth/service');var interaction=require(_0x0356('0x4'));var config=require('../../config/environment');var controller=require('./dashboard.controller');router[_0x0356('0x5')]('/',auth[_0x0356('0x6')](),controller[_0x0356('0x7')]);router[_0x0356('0x5')]('/:id',auth[_0x0356('0x6')](),controller['show']);router[_0x0356('0x5')](_0x0356('0x8'),auth[_0x0356('0x6')](),controller[_0x0356('0x9')]);router['post']('/',auth['isAuthenticated'](),controller[_0x0356('0xa')]);router[_0x0356('0xb')](_0x0356('0xc'),auth[_0x0356('0x6')](),controller[_0x0356('0xd')]);router['post'](_0x0356('0x8'),auth[_0x0356('0x6')](),controller[_0x0356('0xe')]);router[_0x0356('0xf')](_0x0356('0x10'),auth[_0x0356('0x6')](),controller[_0x0356('0x11')]);router[_0x0356('0x12')]('/:id',auth[_0x0356('0x6')](),controller[_0x0356('0x13')]);module[_0x0356('0x14')]=router; \ No newline at end of file +var _0xb0cf=['update','delete','destroy','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service','../../config/environment','isAuthenticated','index','get','/:id','show','getItems','post','create','/:id/clone','clone','addItem','put'];(function(_0x48c674,_0x4ca959){var _0x207f2c=function(_0x3594f7){while(--_0x3594f7){_0x48c674['push'](_0x48c674['shift']());}};_0x207f2c(++_0x4ca959);}(_0xb0cf,0xc3));var _0xfb0c=function(_0xd48ed9,_0x4aa193){_0xd48ed9=_0xd48ed9-0x0;var _0x6cf52a=_0xb0cf[_0xd48ed9];return _0x6cf52a;};'use strict';var multer=require(_0xfb0c('0x0'));var util=require(_0xfb0c('0x1'));var path=require(_0xfb0c('0x2'));var timeout=require(_0xfb0c('0x3'));var express=require(_0xfb0c('0x4'));var router=express[_0xfb0c('0x5')]();var fs_extra=require(_0xfb0c('0x6'));var auth=require('../../components/auth/service');var interaction=require(_0xfb0c('0x7'));var config=require(_0xfb0c('0x8'));var controller=require('./dashboard.controller');router['get']('/',auth[_0xfb0c('0x9')](),controller[_0xfb0c('0xa')]);router[_0xfb0c('0xb')](_0xfb0c('0xc'),auth[_0xfb0c('0x9')](),controller[_0xfb0c('0xd')]);router[_0xfb0c('0xb')]('/:id/items',auth[_0xfb0c('0x9')](),controller[_0xfb0c('0xe')]);router[_0xfb0c('0xf')]('/',auth[_0xfb0c('0x9')](),controller[_0xfb0c('0x10')]);router['post'](_0xfb0c('0x11'),auth[_0xfb0c('0x9')](),controller[_0xfb0c('0x12')]);router['post']('/:id/items',auth['isAuthenticated'](),controller[_0xfb0c('0x13')]);router[_0xfb0c('0x14')](_0xfb0c('0xc'),auth['isAuthenticated'](),controller[_0xfb0c('0x15')]);router[_0xfb0c('0x16')](_0xfb0c('0xc'),auth[_0xfb0c('0x9')](),controller[_0xfb0c('0x17')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/dashboardItem/dashboardItem.attributes.js b/server/api/dashboardItem/dashboardItem.attributes.js index fa8673f..ceda8a6 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 _0x6f47=['#ffffff','squel','lodash','STRING','TEXT','parse','getDataValue','attrs','setDataValue','stringify','INTEGER'];(function(_0x9a02e0,_0x2540c2){var _0x1d9afe=function(_0x36276e){while(--_0x36276e){_0x9a02e0['push'](_0x9a02e0['shift']());}};_0x1d9afe(++_0x2540c2);}(_0x6f47,0xc7));var _0x76f4=function(_0x164eca,_0x555e28){_0x164eca=_0x164eca-0x0;var _0x2ce562=_0x6f47[_0x164eca];return _0x2ce562;};'use strict';var Sequelize=require('sequelize');var squel=require(_0x76f4('0x0'));var _=require(_0x76f4('0x1'));module['exports']={'title':{'type':Sequelize[_0x76f4('0x2')],'allowNull':![]},'type':{'type':Sequelize['STRING'](0x14),'allowNull':![],'validate':{'len':[0x1,0x14]}},'attrs':{'type':Sequelize[_0x76f4('0x3')]('long'),'get':function(){try{return JSON[_0x76f4('0x4')](this[_0x76f4('0x5')](_0x76f4('0x6')));}catch(_0x2523ba){return[];}},'set':function(_0x5754ca){try{this[_0x76f4('0x7')](_0x76f4('0x6'),JSON[_0x76f4('0x8')](_0x5754ca));}catch(_0x497f99){this[_0x76f4('0x7')](_0x76f4('0x6'),JSON[_0x76f4('0x8')]([]));}}},'sizeX':{'type':Sequelize[_0x76f4('0x9')],'allowNull':![],'defaultValue':0x1},'sizeY':{'type':Sequelize[_0x76f4('0x9')],'allowNull':![],'defaultValue':0x1},'row':{'type':Sequelize['INTEGER']},'col':{'type':Sequelize['INTEGER']},'background':{'type':Sequelize[_0x76f4('0x2')],'allowNull':![],'defaultValue':_0x76f4('0xa'),'validate':{'notEmpty':!![]}},'foreground':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':'#2196f3','validate':{'notEmpty':!![]}},'link':{'type':Sequelize[_0x76f4('0x2')]},'titleFontSize':{'type':Sequelize[_0x76f4('0x9')],'defaultValue':0xc}}; \ No newline at end of file +var _0xfdbd=['sequelize','squel','lodash','exports','STRING','TEXT','long','parse','attrs','setDataValue','INTEGER','#ffffff'];(function(_0x34f701,_0x37e407){var _0x3e2429=function(_0x20c0c3){while(--_0x20c0c3){_0x34f701['push'](_0x34f701['shift']());}};_0x3e2429(++_0x37e407);}(_0xfdbd,0xf0));var _0xdfdb=function(_0x581af1,_0x4f02c5){_0x581af1=_0x581af1-0x0;var _0x54c22e=_0xfdbd[_0x581af1];return _0x54c22e;};'use strict';var Sequelize=require(_0xdfdb('0x0'));var squel=require(_0xdfdb('0x1'));var _=require(_0xdfdb('0x2'));module[_0xdfdb('0x3')]={'title':{'type':Sequelize[_0xdfdb('0x4')],'allowNull':![]},'type':{'type':Sequelize[_0xdfdb('0x4')](0x14),'allowNull':![],'validate':{'len':[0x1,0x14]}},'attrs':{'type':Sequelize[_0xdfdb('0x5')](_0xdfdb('0x6')),'get':function(){try{return JSON[_0xdfdb('0x7')](this['getDataValue'](_0xdfdb('0x8')));}catch(_0x4a4a3f){return[];}},'set':function(_0x453ef6){try{this[_0xdfdb('0x9')]('attrs',JSON['stringify'](_0x453ef6));}catch(_0x590b5d){this[_0xdfdb('0x9')](_0xdfdb('0x8'),JSON['stringify']([]));}}},'sizeX':{'type':Sequelize[_0xdfdb('0xa')],'allowNull':![],'defaultValue':0x1},'sizeY':{'type':Sequelize[_0xdfdb('0xa')],'allowNull':![],'defaultValue':0x1},'row':{'type':Sequelize[_0xdfdb('0xa')]},'col':{'type':Sequelize[_0xdfdb('0xa')]},'background':{'type':Sequelize[_0xdfdb('0x4')],'allowNull':![],'defaultValue':_0xdfdb('0xb'),'validate':{'notEmpty':!![]}},'foreground':{'type':Sequelize[_0xdfdb('0x4')],'allowNull':![],'defaultValue':'#2196f3','validate':{'notEmpty':!![]}},'link':{'type':Sequelize[_0xdfdb('0x4')]},'titleFontSize':{'type':Sequelize[_0xdfdb('0xa')],'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 ec4af5f..e57663b 100644 --- a/server/api/dashboardItem/dashboardItem.controller.js +++ b/server/api/dashboardItem/dashboardItem.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x2ef3=['eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','util','sox','to-csv','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','redis','localhost','./dashboardItem.socket','sendStatus','status','undefined','limit','count','offset','set','json','reject','save','update','destroy','then','end','error','name','send','params','model','keys','rawAttributes','query','intersection','attributes','length','options','DashboardItem','find','catch','type','iframe','attrUrl','attrs','https://','custom','attrPath','value','clock','attrHourFormat','HH:mm:ss','attrTimezone','0.00','attrFontSize','attrMetric','total','attrVoiceQueues','attrChannel','voice','attrFaxAccounts','attrSmsAccounts','attrOpenchannelAccounts','attrWhatsappAccounts','attrChatWebsites','multibar-chart','pie-chart','attrSerie1','attrSerie2','attrSerie3','attrEmailAccounts','attrReport','reportType','attrRefresh','widgetAttributes:\x20%s','stringify','create','body'];(function(_0x11eac6,_0x293339){var _0x384383=function(_0x442210){while(--_0x442210){_0x11eac6['push'](_0x11eac6['shift']());}};_0x384383(++_0x293339);}(_0x2ef3,0xba));var _0x32ef=function(_0xf706c2,_0x118f6a){_0xf706c2=_0xf706c2-0x0;var _0x941ba2=_0x2ef3[_0xf706c2];return _0x941ba2;};'use strict';var emlformat=require(_0x32ef('0x0'));var rimraf=require(_0x32ef('0x1'));var zipdir=require(_0x32ef('0x2'));var jsonpatch=require(_0x32ef('0x3'));var rp=require(_0x32ef('0x4'));var moment=require(_0x32ef('0x5'));var BPromise=require('bluebird');var Mustache=require(_0x32ef('0x6'));var util=require(_0x32ef('0x7'));var path=require('path');var sox=require(_0x32ef('0x8'));var csv=require(_0x32ef('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x32ef('0xa'));var squel=require(_0x32ef('0xb'));var crypto=require(_0x32ef('0xc'));var jsforce=require(_0x32ef('0xd'));var deskjs=require(_0x32ef('0xe'));var toCsv=require(_0x32ef('0x9'));var querystring=require(_0x32ef('0xf'));var Papa=require(_0x32ef('0x10'));var Redis=require(_0x32ef('0x11'));var authService=require(_0x32ef('0x12'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x32ef('0x13'));var logger=require(_0x32ef('0x14'))(_0x32ef('0x15'));var utils=require(_0x32ef('0x16'));var config=require('../../config/environment');var licenseUtil=require(_0x32ef('0x17'));var db=require('../../mysqldb')['db'];config[_0x32ef('0x18')]=_['defaults'](config[_0x32ef('0x18')],{'host':_0x32ef('0x19'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require(_0x32ef('0x1a'))['register'](socket);function respondWithStatusCode(_0x326fce,_0x40a6e6){_0x40a6e6=_0x40a6e6||0xcc;return function(_0x93d492){if(_0x93d492){return _0x326fce[_0x32ef('0x1b')](_0x40a6e6);}return _0x326fce['status'](_0x40a6e6)['end']();};}function respondWithResult(_0x531e30,_0x13db1a){_0x13db1a=_0x13db1a||0xc8;return function(_0x3950e6){if(_0x3950e6){return _0x531e30[_0x32ef('0x1c')](_0x13db1a)['json'](_0x3950e6);}};}function respondWithFilteredResult(_0x5d559b,_0x1eb468){return function(_0x1a9476){if(_0x1a9476){var _0x286bfb=typeof _0x1eb468['offset']===_0x32ef('0x1d')&&typeof _0x1eb468[_0x32ef('0x1e')]==='undefined';var _0x304505=_0x1a9476[_0x32ef('0x1f')];var _0x26aff3=_0x286bfb?0x0:_0x1eb468[_0x32ef('0x20')];var _0x445cda=_0x286bfb?_0x1a9476[_0x32ef('0x1f')]:_0x1eb468['offset']+_0x1eb468[_0x32ef('0x1e')];var _0x5cc3ef;if(_0x445cda>=_0x304505){_0x445cda=_0x304505;_0x5cc3ef=0xc8;}else{_0x5cc3ef=0xce;}_0x5d559b[_0x32ef('0x1c')](_0x5cc3ef);return _0x5d559b[_0x32ef('0x21')]('Content-Range',_0x26aff3+'-'+_0x445cda+'/'+_0x304505)[_0x32ef('0x22')](_0x1a9476);}return null;};}function patchUpdates(_0x97780){return function(_0x5e8898){try{jsonpatch['apply'](_0x5e8898,_0x97780,!![]);}catch(_0x57f5e5){return BPromise[_0x32ef('0x23')](_0x57f5e5);}return _0x5e8898[_0x32ef('0x24')]();};}function saveUpdates(_0x225feb,_0x478bef){return function(_0x59585f){if(_0x59585f){return _0x59585f[_0x32ef('0x25')](_0x225feb)['then'](function(_0x51a412){return _0x51a412;});}return null;};}function removeEntity(_0x278495,_0x14d4b3){return function(_0x371540){if(_0x371540){return _0x371540[_0x32ef('0x26')]()[_0x32ef('0x27')](function(){_0x278495[_0x32ef('0x1c')](0xcc)[_0x32ef('0x28')]();});}};}function handleEntityNotFound(_0x38aed5,_0x338f19){return function(_0x2f52d7){if(!_0x2f52d7){_0x38aed5[_0x32ef('0x1b')](0x194);}return _0x2f52d7;};}function handleError(_0xba4b3f,_0x5a88a5){_0x5a88a5=_0x5a88a5||0x1f4;return function(_0xd65fde){logger[_0x32ef('0x29')](_0xd65fde['stack']);if(_0xd65fde[_0x32ef('0x2a')]){delete _0xd65fde[_0x32ef('0x2a')];}_0xba4b3f[_0x32ef('0x1c')](_0x5a88a5)[_0x32ef('0x2b')](_0xd65fde);};}exports['show']=function(_0x10e38c,_0x22bf86){var _0x31dbc3={'raw':![],'where':{'id':_0x10e38c[_0x32ef('0x2c')]['id']}},_0x2ac686={};_0x2ac686[_0x32ef('0x2d')]=_[_0x32ef('0x2e')](db['DashboardItem'][_0x32ef('0x2f')]);_0x2ac686['query']=_[_0x32ef('0x2e')](_0x10e38c[_0x32ef('0x30')]);_0x2ac686['filters']=_[_0x32ef('0x31')](_0x2ac686[_0x32ef('0x2d')],_0x2ac686[_0x32ef('0x30')]);_0x31dbc3[_0x32ef('0x32')]=_[_0x32ef('0x31')](_0x2ac686['model'],qs['fields'](_0x10e38c[_0x32ef('0x30')]['fields']));_0x31dbc3[_0x32ef('0x32')]=_0x31dbc3[_0x32ef('0x32')][_0x32ef('0x33')]?_0x31dbc3[_0x32ef('0x32')]:_0x2ac686[_0x32ef('0x2d')];if(_0x10e38c[_0x32ef('0x30')]['includeAll']){_0x31dbc3['include']=[{'all':!![]}];}_0x31dbc3=_['merge']({},_0x31dbc3,_0x10e38c[_0x32ef('0x34')]);return db[_0x32ef('0x35')][_0x32ef('0x36')](_0x31dbc3)['then'](handleEntityNotFound(_0x22bf86,null))['then'](respondWithResult(_0x22bf86,null))[_0x32ef('0x37')](handleError(_0x22bf86,null));};exports[_0x32ef('0x26')]=function(_0x410334,_0x480348){return db['DashboardItem'][_0x32ef('0x36')]({'where':{'id':_0x410334[_0x32ef('0x2c')]['id']}})[_0x32ef('0x27')](handleEntityNotFound(_0x480348,null))[_0x32ef('0x27')](removeEntity(_0x480348,null))[_0x32ef('0x37')](handleError(_0x480348,null));};function widgetAttributes(_0x211c79){try{switch(_0x211c79[_0x32ef('0x38')]){case _0x32ef('0x39'):return[{'name':_0x32ef('0x3a'),'value':_0x211c79['attrUrl']||(_0x211c79[_0x32ef('0x3b')]&&_0x211c79[_0x32ef('0x3b')][0x0]?_0x211c79[_0x32ef('0x3b')][0x0]['value']:undefined)||_0x32ef('0x3c')}];case _0x32ef('0x3d'):return[{'name':_0x32ef('0x3e'),'value':_0x211c79[_0x32ef('0x3e')]||(_0x211c79[_0x32ef('0x3b')]&&_0x211c79[_0x32ef('0x3b')][0x0]?_0x211c79[_0x32ef('0x3b')][0x0][_0x32ef('0x3f')]:undefined)||''}];case _0x32ef('0x40'):return[{'name':_0x32ef('0x41'),'value':_0x211c79[_0x32ef('0x41')]||(_0x211c79[_0x32ef('0x3b')]&&_0x211c79['attrs'][0x0]?_0x211c79[_0x32ef('0x3b')][0x0][_0x32ef('0x3f')]:undefined)||_0x32ef('0x42')},{'name':_0x32ef('0x43'),'value':_0x211c79[_0x32ef('0x43')]||(_0x211c79[_0x32ef('0x3b')]&&_0x211c79[_0x32ef('0x3b')][0x1]?_0x211c79['attrs'][0x1]['value']:undefined)||_0x32ef('0x44')},{'name':_0x32ef('0x45'),'value':_0x211c79[_0x32ef('0x45')]||(_0x211c79[_0x32ef('0x3b')]&&_0x211c79['attrs'][0x2]?_0x211c79[_0x32ef('0x3b')][0x2][_0x32ef('0x3f')]:undefined)||0xc}];case'counter':return[{'name':_0x32ef('0x46'),'value':_0x211c79['attrMetric']||(_0x211c79[_0x32ef('0x3b')]&&_0x211c79[_0x32ef('0x3b')][0x0]?_0x211c79[_0x32ef('0x3b')][0x0][_0x32ef('0x3f')]:undefined)||_0x32ef('0x47')},{'name':_0x32ef('0x48'),'value':_0x211c79[_0x32ef('0x48')]||(_0x211c79[_0x32ef('0x3b')]&&_0x211c79[_0x32ef('0x3b')][0x1]?_0x211c79[_0x32ef('0x3b')][0x1]['value']:undefined)||[]},{'name':_0x32ef('0x45'),'value':_0x211c79['attrFontSize']||(_0x211c79[_0x32ef('0x3b')]&&_0x211c79[_0x32ef('0x3b')][0x2]?_0x211c79[_0x32ef('0x3b')][0x2]['value']:undefined)||0x14},{'name':_0x32ef('0x49'),'value':_0x211c79[_0x32ef('0x49')]||(_0x211c79[_0x32ef('0x3b')]&&_0x211c79[_0x32ef('0x3b')][0x3]?_0x211c79[_0x32ef('0x3b')][0x3][_0x32ef('0x3f')]:undefined)||_0x32ef('0x4a')},{'name':'attrEmailAccounts','value':_0x211c79['attrEmailAccounts']||(_0x211c79[_0x32ef('0x3b')]&&_0x211c79[_0x32ef('0x3b')][0x4]?_0x211c79[_0x32ef('0x3b')][0x4][_0x32ef('0x3f')]:undefined)||''},{'name':_0x32ef('0x4b'),'value':_0x211c79[_0x32ef('0x4b')]||(_0x211c79[_0x32ef('0x3b')]&&_0x211c79[_0x32ef('0x3b')][0x5]?_0x211c79[_0x32ef('0x3b')][0x5][_0x32ef('0x3f')]:undefined)||''},{'name':_0x32ef('0x4c'),'value':_0x211c79[_0x32ef('0x4c')]||(_0x211c79[_0x32ef('0x3b')]&&_0x211c79['attrs'][0x6]?_0x211c79[_0x32ef('0x3b')][0x6][_0x32ef('0x3f')]:undefined)||''},{'name':_0x32ef('0x4d'),'value':_0x211c79[_0x32ef('0x4d')]||(_0x211c79[_0x32ef('0x3b')]&&_0x211c79[_0x32ef('0x3b')][0x7]?_0x211c79[_0x32ef('0x3b')][0x7][_0x32ef('0x3f')]:undefined)||''},{'name':_0x32ef('0x4e'),'value':_0x211c79[_0x32ef('0x4e')]||(_0x211c79[_0x32ef('0x3b')]&&_0x211c79[_0x32ef('0x3b')][0x8]?_0x211c79[_0x32ef('0x3b')][0x8][_0x32ef('0x3f')]:undefined)||''},{'name':_0x32ef('0x4f'),'value':_0x211c79[_0x32ef('0x4f')]||(_0x211c79[_0x32ef('0x3b')]&&_0x211c79[_0x32ef('0x3b')][0x9]?_0x211c79['attrs'][0x9]['value']:undefined)||''}];case _0x32ef('0x50'):case _0x32ef('0x51'):return[{'name':_0x32ef('0x52'),'value':_0x211c79[_0x32ef('0x52')]||(_0x211c79[_0x32ef('0x3b')]&&_0x211c79[_0x32ef('0x3b')][0x0]?_0x211c79[_0x32ef('0x3b')][0x0][_0x32ef('0x3f')]:undefined)||_0x32ef('0x47')},{'name':_0x32ef('0x53'),'value':_0x211c79[_0x32ef('0x53')]||(_0x211c79['attrs']&&_0x211c79[_0x32ef('0x3b')][0x1]?_0x211c79[_0x32ef('0x3b')][0x1][_0x32ef('0x3f')]:undefined)||null},{'name':_0x32ef('0x54'),'value':_0x211c79[_0x32ef('0x54')]||(_0x211c79[_0x32ef('0x3b')]&&_0x211c79['attrs'][0x2]?_0x211c79[_0x32ef('0x3b')][0x2][_0x32ef('0x3f')]:undefined)||null},{'name':_0x32ef('0x48'),'value':_0x211c79['attrVoiceQueues']||(_0x211c79[_0x32ef('0x3b')]&&_0x211c79['attrs'][0x3]?_0x211c79[_0x32ef('0x3b')][0x3][_0x32ef('0x3f')]:undefined)||[]},{'name':'attrChannel','value':_0x211c79[_0x32ef('0x49')]||(_0x211c79['attrs']&&_0x211c79[_0x32ef('0x3b')][0x4]?_0x211c79[_0x32ef('0x3b')][0x4][_0x32ef('0x3f')]:undefined)||_0x32ef('0x4a')},{'name':_0x32ef('0x55'),'value':_0x211c79[_0x32ef('0x55')]||(_0x211c79[_0x32ef('0x3b')]&&_0x211c79['attrs'][0x5]?_0x211c79['attrs'][0x5][_0x32ef('0x3f')]:undefined)||''},{'name':'attrFaxAccounts','value':_0x211c79['attrFaxAccounts']||(_0x211c79[_0x32ef('0x3b')]&&_0x211c79[_0x32ef('0x3b')][0x6]?_0x211c79[_0x32ef('0x3b')][0x6][_0x32ef('0x3f')]:undefined)||''},{'name':_0x32ef('0x4c'),'value':_0x211c79[_0x32ef('0x4c')]||(_0x211c79[_0x32ef('0x3b')]&&_0x211c79[_0x32ef('0x3b')][0x7]?_0x211c79[_0x32ef('0x3b')][0x7][_0x32ef('0x3f')]:undefined)||''},{'name':'attrOpenchannelAccounts','value':_0x211c79['attrOpenchannelAccounts']||(_0x211c79[_0x32ef('0x3b')]&&_0x211c79[_0x32ef('0x3b')][0x8]?_0x211c79['attrs'][0x8][_0x32ef('0x3f')]:undefined)||''},{'name':_0x32ef('0x4e'),'value':_0x211c79[_0x32ef('0x4e')]||(_0x211c79['attrs']&&_0x211c79[_0x32ef('0x3b')][0x9]?_0x211c79[_0x32ef('0x3b')][0x9][_0x32ef('0x3f')]:undefined)||''},{'name':'attrChatWebsites','value':_0x211c79['attrChatWebsites']||(_0x211c79[_0x32ef('0x3b')]&&_0x211c79['attrs'][0xa]?_0x211c79[_0x32ef('0x3b')][0xa]['value']:undefined)||''}];case'web-report':return[{'name':_0x32ef('0x56'),'type':_0x211c79[_0x32ef('0x57')]||(_0x211c79[_0x32ef('0x3b')]&&_0x211c79['attrs'][0x0]?_0x211c79[_0x32ef('0x3b')][0x0][_0x32ef('0x38')]:undefined)||null,'value':_0x211c79[_0x32ef('0x56')]||(_0x211c79['attrs']&&_0x211c79[_0x32ef('0x3b')][0x0]?_0x211c79[_0x32ef('0x3b')][0x0]['value']:undefined)||null},{'name':'attrRefresh','value':_0x211c79[_0x32ef('0x58')]||(_0x211c79[_0x32ef('0x3b')]&&_0x211c79[_0x32ef('0x3b')][0x1]?_0x211c79[_0x32ef('0x3b')][0x1][_0x32ef('0x3f')]:undefined)||0x0}];default:return[];}}catch(_0x40700e){logger['error'](_0x32ef('0x59'),JSON[_0x32ef('0x5a')](_0x40700e));return[];}}exports[_0x32ef('0x5b')]=function(_0x36ed97,_0x21e930){if(_0x36ed97[_0x32ef('0x5c')]){_0x36ed97[_0x32ef('0x5c')][_0x32ef('0x3b')]=widgetAttributes(_0x36ed97[_0x32ef('0x5c')]);}return db['DashboardItem'][_0x32ef('0x5b')](_0x36ed97[_0x32ef('0x5c')],{})[_0x32ef('0x27')](respondWithResult(_0x21e930,0xc9))[_0x32ef('0x37')](handleError(_0x21e930,null));};exports[_0x32ef('0x25')]=function(_0x5ad75c,_0x47c0ed){if(_0x5ad75c[_0x32ef('0x5c')]['id']){delete _0x5ad75c[_0x32ef('0x5c')]['id'];}_0x5ad75c[_0x32ef('0x5c')][_0x32ef('0x3b')]=widgetAttributes(_0x5ad75c[_0x32ef('0x5c')]);return db['DashboardItem'][_0x32ef('0x36')]({'where':{'id':_0x5ad75c['params']['id']}})[_0x32ef('0x27')](handleEntityNotFound(_0x47c0ed,null))[_0x32ef('0x27')](saveUpdates(_0x5ad75c['body'],null))['then'](respondWithResult(_0x47c0ed,null))[_0x32ef('0x37')](handleError(_0x47c0ed,null));}; \ No newline at end of file +var _0x9a14=['register','sendStatus','status','json','offset','undefined','count','limit','set','reject','save','update','then','end','name','send','params','model','keys','DashboardItem','rawAttributes','query','filters','intersection','fields','attributes','length','includeAll','include','merge','options','find','catch','destroy','iframe','attrUrl','attrs','value','https://','custom','attrPath','clock','attrHourFormat','HH:mm:ss','attrTimezone','0.00','attrFontSize','attrMetric','attrVoiceQueues','attrChannel','attrEmailAccounts','attrFaxAccounts','attrSmsAccounts','attrOpenchannelAccounts','attrWhatsappAccounts','attrChatWebsites','multibar-chart','pie-chart','attrSerie1','total','attrSerie2','attrSerie3','voice','web-report','attrReport','reportType','type','attrRefresh','create','body','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','lodash','squel','crypto','desk.js','to-csv','querystring','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./dashboardItem.socket'];(function(_0x48e6ef,_0x3d9826){var _0x55be46=function(_0x704779){while(--_0x704779){_0x48e6ef['push'](_0x48e6ef['shift']());}};_0x55be46(++_0x3d9826);}(_0x9a14,0xa8));var _0x49a1=function(_0x579646,_0x519fed){_0x579646=_0x579646-0x0;var _0x57b23a=_0x9a14[_0x579646];return _0x57b23a;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0x49a1('0x0'));var jsonpatch=require(_0x49a1('0x1'));var rp=require(_0x49a1('0x2'));var moment=require(_0x49a1('0x3'));var BPromise=require(_0x49a1('0x4'));var Mustache=require(_0x49a1('0x5'));var util=require(_0x49a1('0x6'));var path=require(_0x49a1('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(_0x49a1('0x8'));var squel=require(_0x49a1('0x9'));var crypto=require(_0x49a1('0xa'));var jsforce=require('jsforce');var deskjs=require(_0x49a1('0xb'));var toCsv=require(_0x49a1('0xc'));var querystring=require(_0x49a1('0xd'));var Papa=require('papaparse');var Redis=require(_0x49a1('0xe'));var authService=require(_0x49a1('0xf'));var qs=require('../../components/parsers/qs');var as=require(_0x49a1('0x10'));var hardwareService=require(_0x49a1('0x11'));var logger=require(_0x49a1('0x12'))(_0x49a1('0x13'));var utils=require(_0x49a1('0x14'));var config=require('../../config/environment');var licenseUtil=require(_0x49a1('0x15'));var db=require(_0x49a1('0x16'))['db'];config[_0x49a1('0x17')]=_[_0x49a1('0x18')](config[_0x49a1('0x17')],{'host':_0x49a1('0x19'),'port':0x18eb});var socket=require(_0x49a1('0x1a'))(new Redis(config[_0x49a1('0x17')]));require(_0x49a1('0x1b'))[_0x49a1('0x1c')](socket);function respondWithStatusCode(_0x278713,_0x13128e){_0x13128e=_0x13128e||0xcc;return function(_0x3b6089){if(_0x3b6089){return _0x278713[_0x49a1('0x1d')](_0x13128e);}return _0x278713[_0x49a1('0x1e')](_0x13128e)['end']();};}function respondWithResult(_0x27dff1,_0x383bea){_0x383bea=_0x383bea||0xc8;return function(_0x20aa5d){if(_0x20aa5d){return _0x27dff1['status'](_0x383bea)[_0x49a1('0x1f')](_0x20aa5d);}};}function respondWithFilteredResult(_0x7b53dc,_0x561ac4){return function(_0xd93b68){if(_0xd93b68){var _0x5bed0e=typeof _0x561ac4[_0x49a1('0x20')]===_0x49a1('0x21')&&typeof _0x561ac4['limit']===_0x49a1('0x21');var _0x508f32=_0xd93b68[_0x49a1('0x22')];var _0x468bac=_0x5bed0e?0x0:_0x561ac4[_0x49a1('0x20')];var _0x51dcd6=_0x5bed0e?_0xd93b68[_0x49a1('0x22')]:_0x561ac4[_0x49a1('0x20')]+_0x561ac4[_0x49a1('0x23')];var _0x286cb9;if(_0x51dcd6>=_0x508f32){_0x51dcd6=_0x508f32;_0x286cb9=0xc8;}else{_0x286cb9=0xce;}_0x7b53dc[_0x49a1('0x1e')](_0x286cb9);return _0x7b53dc[_0x49a1('0x24')]('Content-Range',_0x468bac+'-'+_0x51dcd6+'/'+_0x508f32)[_0x49a1('0x1f')](_0xd93b68);}return null;};}function patchUpdates(_0x108d66){return function(_0x28609c){try{jsonpatch['apply'](_0x28609c,_0x108d66,!![]);}catch(_0x12011d){return BPromise[_0x49a1('0x25')](_0x12011d);}return _0x28609c[_0x49a1('0x26')]();};}function saveUpdates(_0x4b4bf3,_0x4d13b7){return function(_0x32b63e){if(_0x32b63e){return _0x32b63e[_0x49a1('0x27')](_0x4b4bf3)[_0x49a1('0x28')](function(_0x38c624){return _0x38c624;});}return null;};}function removeEntity(_0x3d6f52,_0x273df9){return function(_0x3d3330){if(_0x3d3330){return _0x3d3330['destroy']()[_0x49a1('0x28')](function(){_0x3d6f52[_0x49a1('0x1e')](0xcc)[_0x49a1('0x29')]();});}};}function handleEntityNotFound(_0x2935d1,_0x20af10){return function(_0x1e3f21){if(!_0x1e3f21){_0x2935d1[_0x49a1('0x1d')](0x194);}return _0x1e3f21;};}function handleError(_0x232289,_0x5b3842){_0x5b3842=_0x5b3842||0x1f4;return function(_0x3cd5ff){logger['error'](_0x3cd5ff['stack']);if(_0x3cd5ff['name']){delete _0x3cd5ff[_0x49a1('0x2a')];}_0x232289[_0x49a1('0x1e')](_0x5b3842)[_0x49a1('0x2b')](_0x3cd5ff);};}exports['show']=function(_0x542be7,_0x22ddf9){var _0x30a265={'raw':![],'where':{'id':_0x542be7[_0x49a1('0x2c')]['id']}},_0x330ec6={};_0x330ec6[_0x49a1('0x2d')]=_[_0x49a1('0x2e')](db[_0x49a1('0x2f')][_0x49a1('0x30')]);_0x330ec6[_0x49a1('0x31')]=_[_0x49a1('0x2e')](_0x542be7[_0x49a1('0x31')]);_0x330ec6[_0x49a1('0x32')]=_[_0x49a1('0x33')](_0x330ec6[_0x49a1('0x2d')],_0x330ec6[_0x49a1('0x31')]);_0x30a265['attributes']=_[_0x49a1('0x33')](_0x330ec6['model'],qs['fields'](_0x542be7[_0x49a1('0x31')][_0x49a1('0x34')]));_0x30a265[_0x49a1('0x35')]=_0x30a265['attributes'][_0x49a1('0x36')]?_0x30a265[_0x49a1('0x35')]:_0x330ec6['model'];if(_0x542be7['query'][_0x49a1('0x37')]){_0x30a265[_0x49a1('0x38')]=[{'all':!![]}];}_0x30a265=_[_0x49a1('0x39')]({},_0x30a265,_0x542be7[_0x49a1('0x3a')]);return db[_0x49a1('0x2f')][_0x49a1('0x3b')](_0x30a265)[_0x49a1('0x28')](handleEntityNotFound(_0x22ddf9,null))[_0x49a1('0x28')](respondWithResult(_0x22ddf9,null))[_0x49a1('0x3c')](handleError(_0x22ddf9,null));};exports[_0x49a1('0x3d')]=function(_0x2973dd,_0x43eee7){return db[_0x49a1('0x2f')][_0x49a1('0x3b')]({'where':{'id':_0x2973dd[_0x49a1('0x2c')]['id']}})[_0x49a1('0x28')](handleEntityNotFound(_0x43eee7,null))['then'](removeEntity(_0x43eee7,null))[_0x49a1('0x3c')](handleError(_0x43eee7,null));};function widgetAttributes(_0x20261f){try{switch(_0x20261f['type']){case _0x49a1('0x3e'):return[{'name':'attrUrl','value':_0x20261f[_0x49a1('0x3f')]||(_0x20261f[_0x49a1('0x40')]&&_0x20261f['attrs'][0x0]?_0x20261f[_0x49a1('0x40')][0x0][_0x49a1('0x41')]:undefined)||_0x49a1('0x42')}];case _0x49a1('0x43'):return[{'name':_0x49a1('0x44'),'value':_0x20261f[_0x49a1('0x44')]||(_0x20261f[_0x49a1('0x40')]&&_0x20261f[_0x49a1('0x40')][0x0]?_0x20261f[_0x49a1('0x40')][0x0][_0x49a1('0x41')]:undefined)||''}];case _0x49a1('0x45'):return[{'name':_0x49a1('0x46'),'value':_0x20261f[_0x49a1('0x46')]||(_0x20261f[_0x49a1('0x40')]&&_0x20261f[_0x49a1('0x40')][0x0]?_0x20261f[_0x49a1('0x40')][0x0][_0x49a1('0x41')]:undefined)||_0x49a1('0x47')},{'name':'attrTimezone','value':_0x20261f[_0x49a1('0x48')]||(_0x20261f[_0x49a1('0x40')]&&_0x20261f[_0x49a1('0x40')][0x1]?_0x20261f[_0x49a1('0x40')][0x1][_0x49a1('0x41')]:undefined)||_0x49a1('0x49')},{'name':'attrFontSize','value':_0x20261f[_0x49a1('0x4a')]||(_0x20261f[_0x49a1('0x40')]&&_0x20261f[_0x49a1('0x40')][0x2]?_0x20261f['attrs'][0x2][_0x49a1('0x41')]:undefined)||0xc}];case'counter':return[{'name':'attrMetric','value':_0x20261f[_0x49a1('0x4b')]||(_0x20261f[_0x49a1('0x40')]&&_0x20261f[_0x49a1('0x40')][0x0]?_0x20261f[_0x49a1('0x40')][0x0][_0x49a1('0x41')]:undefined)||'total'},{'name':_0x49a1('0x4c'),'value':_0x20261f[_0x49a1('0x4c')]||(_0x20261f[_0x49a1('0x40')]&&_0x20261f[_0x49a1('0x40')][0x1]?_0x20261f['attrs'][0x1]['value']:undefined)||[]},{'name':_0x49a1('0x4a'),'value':_0x20261f[_0x49a1('0x4a')]||(_0x20261f['attrs']&&_0x20261f[_0x49a1('0x40')][0x2]?_0x20261f[_0x49a1('0x40')][0x2]['value']:undefined)||0x14},{'name':_0x49a1('0x4d'),'value':_0x20261f[_0x49a1('0x4d')]||(_0x20261f[_0x49a1('0x40')]&&_0x20261f[_0x49a1('0x40')][0x3]?_0x20261f[_0x49a1('0x40')][0x3][_0x49a1('0x41')]:undefined)||'voice'},{'name':_0x49a1('0x4e'),'value':_0x20261f['attrEmailAccounts']||(_0x20261f[_0x49a1('0x40')]&&_0x20261f[_0x49a1('0x40')][0x4]?_0x20261f[_0x49a1('0x40')][0x4][_0x49a1('0x41')]:undefined)||''},{'name':_0x49a1('0x4f'),'value':_0x20261f[_0x49a1('0x4f')]||(_0x20261f[_0x49a1('0x40')]&&_0x20261f['attrs'][0x5]?_0x20261f[_0x49a1('0x40')][0x5][_0x49a1('0x41')]:undefined)||''},{'name':_0x49a1('0x50'),'value':_0x20261f[_0x49a1('0x50')]||(_0x20261f['attrs']&&_0x20261f[_0x49a1('0x40')][0x6]?_0x20261f[_0x49a1('0x40')][0x6][_0x49a1('0x41')]:undefined)||''},{'name':_0x49a1('0x51'),'value':_0x20261f[_0x49a1('0x51')]||(_0x20261f[_0x49a1('0x40')]&&_0x20261f[_0x49a1('0x40')][0x7]?_0x20261f[_0x49a1('0x40')][0x7][_0x49a1('0x41')]:undefined)||''},{'name':'attrWhatsappAccounts','value':_0x20261f[_0x49a1('0x52')]||(_0x20261f[_0x49a1('0x40')]&&_0x20261f[_0x49a1('0x40')][0x8]?_0x20261f[_0x49a1('0x40')][0x8][_0x49a1('0x41')]:undefined)||''},{'name':_0x49a1('0x53'),'value':_0x20261f[_0x49a1('0x53')]||(_0x20261f['attrs']&&_0x20261f[_0x49a1('0x40')][0x9]?_0x20261f['attrs'][0x9][_0x49a1('0x41')]:undefined)||''}];case _0x49a1('0x54'):case _0x49a1('0x55'):return[{'name':_0x49a1('0x56'),'value':_0x20261f[_0x49a1('0x56')]||(_0x20261f[_0x49a1('0x40')]&&_0x20261f[_0x49a1('0x40')][0x0]?_0x20261f['attrs'][0x0][_0x49a1('0x41')]:undefined)||_0x49a1('0x57')},{'name':'attrSerie2','value':_0x20261f[_0x49a1('0x58')]||(_0x20261f[_0x49a1('0x40')]&&_0x20261f[_0x49a1('0x40')][0x1]?_0x20261f[_0x49a1('0x40')][0x1][_0x49a1('0x41')]:undefined)||null},{'name':'attrSerie3','value':_0x20261f[_0x49a1('0x59')]||(_0x20261f[_0x49a1('0x40')]&&_0x20261f[_0x49a1('0x40')][0x2]?_0x20261f[_0x49a1('0x40')][0x2][_0x49a1('0x41')]:undefined)||null},{'name':_0x49a1('0x4c'),'value':_0x20261f[_0x49a1('0x4c')]||(_0x20261f[_0x49a1('0x40')]&&_0x20261f[_0x49a1('0x40')][0x3]?_0x20261f['attrs'][0x3][_0x49a1('0x41')]:undefined)||[]},{'name':_0x49a1('0x4d'),'value':_0x20261f[_0x49a1('0x4d')]||(_0x20261f['attrs']&&_0x20261f[_0x49a1('0x40')][0x4]?_0x20261f[_0x49a1('0x40')][0x4][_0x49a1('0x41')]:undefined)||_0x49a1('0x5a')},{'name':_0x49a1('0x4e'),'value':_0x20261f[_0x49a1('0x4e')]||(_0x20261f[_0x49a1('0x40')]&&_0x20261f[_0x49a1('0x40')][0x5]?_0x20261f['attrs'][0x5]['value']:undefined)||''},{'name':'attrFaxAccounts','value':_0x20261f[_0x49a1('0x4f')]||(_0x20261f[_0x49a1('0x40')]&&_0x20261f[_0x49a1('0x40')][0x6]?_0x20261f[_0x49a1('0x40')][0x6][_0x49a1('0x41')]:undefined)||''},{'name':_0x49a1('0x50'),'value':_0x20261f[_0x49a1('0x50')]||(_0x20261f[_0x49a1('0x40')]&&_0x20261f[_0x49a1('0x40')][0x7]?_0x20261f[_0x49a1('0x40')][0x7][_0x49a1('0x41')]:undefined)||''},{'name':_0x49a1('0x51'),'value':_0x20261f[_0x49a1('0x51')]||(_0x20261f[_0x49a1('0x40')]&&_0x20261f['attrs'][0x8]?_0x20261f['attrs'][0x8]['value']:undefined)||''},{'name':_0x49a1('0x52'),'value':_0x20261f['attrWhatsappAccounts']||(_0x20261f['attrs']&&_0x20261f[_0x49a1('0x40')][0x9]?_0x20261f[_0x49a1('0x40')][0x9][_0x49a1('0x41')]:undefined)||''},{'name':_0x49a1('0x53'),'value':_0x20261f[_0x49a1('0x53')]||(_0x20261f[_0x49a1('0x40')]&&_0x20261f[_0x49a1('0x40')][0xa]?_0x20261f['attrs'][0xa][_0x49a1('0x41')]:undefined)||''}];case _0x49a1('0x5b'):return[{'name':_0x49a1('0x5c'),'type':_0x20261f[_0x49a1('0x5d')]||(_0x20261f[_0x49a1('0x40')]&&_0x20261f['attrs'][0x0]?_0x20261f['attrs'][0x0][_0x49a1('0x5e')]:undefined)||null,'value':_0x20261f[_0x49a1('0x5c')]||(_0x20261f[_0x49a1('0x40')]&&_0x20261f['attrs'][0x0]?_0x20261f['attrs'][0x0][_0x49a1('0x41')]:undefined)||null},{'name':_0x49a1('0x5f'),'value':_0x20261f[_0x49a1('0x5f')]||(_0x20261f[_0x49a1('0x40')]&&_0x20261f[_0x49a1('0x40')][0x1]?_0x20261f[_0x49a1('0x40')][0x1][_0x49a1('0x41')]:undefined)||0x0}];default:return[];}}catch(_0x45b8c1){logger['error']('widgetAttributes:\x20%s',JSON['stringify'](_0x45b8c1));return[];}}exports[_0x49a1('0x60')]=function(_0x14db47,_0x5d8bc1){if(_0x14db47['body']){_0x14db47[_0x49a1('0x61')][_0x49a1('0x40')]=widgetAttributes(_0x14db47['body']);}return db['DashboardItem']['create'](_0x14db47['body'],{})[_0x49a1('0x28')](respondWithResult(_0x5d8bc1,0xc9))[_0x49a1('0x3c')](handleError(_0x5d8bc1,null));};exports[_0x49a1('0x27')]=function(_0x35ba58,_0x13ad48){if(_0x35ba58['body']['id']){delete _0x35ba58[_0x49a1('0x61')]['id'];}_0x35ba58[_0x49a1('0x61')][_0x49a1('0x40')]=widgetAttributes(_0x35ba58[_0x49a1('0x61')]);return db[_0x49a1('0x2f')][_0x49a1('0x3b')]({'where':{'id':_0x35ba58[_0x49a1('0x2c')]['id']}})[_0x49a1('0x28')](handleEntityNotFound(_0x13ad48,null))[_0x49a1('0x28')](saveUpdates(_0x35ba58[_0x49a1('0x61')],null))[_0x49a1('0x28')](respondWithResult(_0x13ad48,null))[_0x49a1('0x3c')](handleError(_0x13ad48,null));}; \ No newline at end of file diff --git a/server/api/dashboardItem/dashboardItem.events.js b/server/api/dashboardItem/dashboardItem.events.js index aef01d6..cdb9b86 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 _0x12ad=['remove','emit','../../mysqldb','DashboardItem','setMaxListeners','update'];(function(_0xb817c6,_0x45038c){var _0x513b57=function(_0x40fff9){while(--_0x40fff9){_0xb817c6['push'](_0xb817c6['shift']());}};_0x513b57(++_0x45038c);}(_0x12ad,0xfe));var _0xd12a=function(_0x2cfb2b,_0x30c0f1){_0x2cfb2b=_0x2cfb2b-0x0;var _0x403a5c=_0x12ad[_0x2cfb2b];return _0x403a5c;};'use strict';var EventEmitter=require('events');var DashboardItem=require(_0xd12a('0x0'))['db'][_0xd12a('0x1')];var DashboardItemEvents=new EventEmitter();DashboardItemEvents[_0xd12a('0x2')](0x0);var events={'afterCreate':'save','afterUpdate':_0xd12a('0x3'),'afterDestroy':_0xd12a('0x4')};function emitEvent(_0x584530){return function(_0x4129cc,_0x84594f,_0x9f2a36){DashboardItemEvents['emit'](_0x584530+':'+_0x4129cc['id'],_0x4129cc);DashboardItemEvents[_0xd12a('0x5')](_0x584530,_0x4129cc);_0x9f2a36(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];DashboardItem['hook'](e,emitEvent(event));}}module['exports']=DashboardItemEvents; \ No newline at end of file +var _0xfcfc=['hook','exports','events','../../mysqldb','setMaxListeners','update','remove','emit','hasOwnProperty'];(function(_0x465028,_0x4570ac){var _0xb783d4=function(_0x5458c5){while(--_0x5458c5){_0x465028['push'](_0x465028['shift']());}};_0xb783d4(++_0x4570ac);}(_0xfcfc,0x9b));var _0xcfcf=function(_0x10fb0e,_0x1727f2){_0x10fb0e=_0x10fb0e-0x0;var _0x46533d=_0xfcfc[_0x10fb0e];return _0x46533d;};'use strict';var EventEmitter=require(_0xcfcf('0x0'));var DashboardItem=require(_0xcfcf('0x1'))['db']['DashboardItem'];var DashboardItemEvents=new EventEmitter();DashboardItemEvents[_0xcfcf('0x2')](0x0);var events={'afterCreate':'save','afterUpdate':_0xcfcf('0x3'),'afterDestroy':_0xcfcf('0x4')};function emitEvent(_0x46f7ee){return function(_0x19a3c9,_0x2518e4,_0x2d9203){DashboardItemEvents[_0xcfcf('0x5')](_0x46f7ee+':'+_0x19a3c9['id'],_0x19a3c9);DashboardItemEvents[_0xcfcf('0x5')](_0x46f7ee,_0x19a3c9);_0x2d9203(null);};}for(var e in events){if(events[_0xcfcf('0x6')](e)){var event=events[e];DashboardItem[_0xcfcf('0x7')](e,emitEvent(event));}}module[_0xcfcf('0x8')]=DashboardItemEvents; \ No newline at end of file diff --git a/server/api/dashboardItem/dashboardItem.model.js b/server/api/dashboardItem/dashboardItem.model.js index 8ee01a9..b22a1a0 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 _0xb358=['request-promise','path','rimraf','../../config/environment','./dashboardItem.attributes','exports','DashboardItem','dashboard_items','util','../../config/logger','bluebird'];(function(_0x3ec15a,_0x3426d1){var _0x3691c9=function(_0x4e6384){while(--_0x4e6384){_0x3ec15a['push'](_0x3ec15a['shift']());}};_0x3691c9(++_0x3426d1);}(_0xb358,0x1b5));var _0x8b35=function(_0x2c42a5,_0x2d1b8f){_0x2c42a5=_0x2c42a5-0x0;var _0x50ef99=_0xb358[_0x2c42a5];return _0x50ef99;};'use strict';var _=require('lodash');var util=require(_0x8b35('0x0'));var logger=require(_0x8b35('0x1'))('api');var moment=require('moment');var BPromise=require(_0x8b35('0x2'));var rp=require(_0x8b35('0x3'));var fs=require('fs');var path=require(_0x8b35('0x4'));var rimraf=require(_0x8b35('0x5'));var config=require(_0x8b35('0x6'));var attributes=require(_0x8b35('0x7'));module[_0x8b35('0x8')]=function(_0x249e2e,_0x122a86){return _0x249e2e['define'](_0x8b35('0x9'),attributes,{'tableName':_0x8b35('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x2875=['bluebird','request-promise','path','rimraf','../../config/environment','exports','define','DashboardItem','dashboard_items','lodash','util','../../config/logger','api','moment'];(function(_0x4ae763,_0x2f6d8c){var _0x2a9568=function(_0x5f59d5){while(--_0x5f59d5){_0x4ae763['push'](_0x4ae763['shift']());}};_0x2a9568(++_0x2f6d8c);}(_0x2875,0x14b));var _0x5287=function(_0x407d57,_0xc7e784){_0x407d57=_0x407d57-0x0;var _0x16a22b=_0x2875[_0x407d57];return _0x16a22b;};'use strict';var _=require(_0x5287('0x0'));var util=require(_0x5287('0x1'));var logger=require(_0x5287('0x2'))(_0x5287('0x3'));var moment=require(_0x5287('0x4'));var BPromise=require(_0x5287('0x5'));var rp=require(_0x5287('0x6'));var fs=require('fs');var path=require(_0x5287('0x7'));var rimraf=require(_0x5287('0x8'));var config=require(_0x5287('0x9'));var attributes=require('./dashboardItem.attributes');module[_0x5287('0xa')]=function(_0x84167b,_0x30b8db){return _0x84167b[_0x5287('0xb')](_0x5287('0xc'),attributes,{'tableName':_0x5287('0xd'),'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 173872c..60d94d2 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 _0x4723=['../../config/logger','rpc','jayson/promise','client','redis','defaults','localhost','request','debug','DashboardItem,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','DashboardItem,\x20%s,\x20%s','message','result','catch','util','bluebird','ioredis'];(function(_0x4c260a,_0x148241){var _0x17bbdd=function(_0x4f3e9f){while(--_0x4f3e9f){_0x4c260a['push'](_0x4c260a['shift']());}};_0x17bbdd(++_0x148241);}(_0x4723,0x115));var _0x3472=function(_0x328cdc,_0xe9775){_0x328cdc=_0x328cdc-0x0;var _0x17eea7=_0x4723[_0x328cdc];return _0x17eea7;};'use strict';var _=require('lodash');var util=require(_0x3472('0x0'));var moment=require('moment');var BPromise=require(_0x3472('0x1'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x3472('0x2'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0x3472('0x3'))(_0x3472('0x4'));var config=require('../../config/environment');var jayson=require(_0x3472('0x5'));var client=jayson[_0x3472('0x6')]['http']({'port':0x232a});config[_0x3472('0x7')]=_[_0x3472('0x8')](config[_0x3472('0x7')],{'host':_0x3472('0x9'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x3472('0x7')]));require('./dashboardItem.socket')['register'](socket);function respondWithRpcPromise(_0x1e0eeb,_0x390946,_0x1dbbe8){return new BPromise(function(_0xd34349,_0x573315){return client[_0x3472('0xa')](_0x1e0eeb,_0x1dbbe8)['then'](function(_0x1c3236){logger['info']('DashboardItem,\x20%s,\x20%s',_0x390946,'request\x20sent');logger[_0x3472('0xb')](_0x3472('0xc'),_0x390946,_0x3472('0xd'),JSON[_0x3472('0xe')](_0x1c3236));if(_0x1c3236['error']){if(_0x1c3236['error']['code']===0x1f4){logger[_0x3472('0xf')](_0x3472('0x10'),_0x390946,_0x1c3236['error'][_0x3472('0x11')]);return _0x573315(_0x1c3236['error'][_0x3472('0x11')]);}logger[_0x3472('0xf')]('DashboardItem,\x20%s,\x20%s',_0x390946,_0x1c3236[_0x3472('0xf')]['message']);return _0xd34349(_0x1c3236[_0x3472('0xf')][_0x3472('0x11')]);}else{logger['info']('DashboardItem,\x20%s,\x20%s',_0x390946,'request\x20sent');_0xd34349(_0x1c3236[_0x3472('0x12')][_0x3472('0x11')]);}})[_0x3472('0x13')](function(_0x135ba6){logger[_0x3472('0xf')](_0x3472('0x10'),_0x390946,_0x135ba6);_0x573315(_0x135ba6);});});} \ No newline at end of file +var _0xb480=['../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','defaults','redis','localhost','socket.io-emitter','./dashboardItem.socket','then','info','DashboardItem,\x20%s,\x20%s','request\x20sent','DashboardItem,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','moment','bluebird','ioredis'];(function(_0x404f65,_0x2df6ec){var _0x38e774=function(_0x3588cc){while(--_0x3588cc){_0x404f65['push'](_0x404f65['shift']());}};_0x38e774(++_0x2df6ec);}(_0xb480,0xf7));var _0x0b48=function(_0x381268,_0x2b43e4){_0x381268=_0x381268-0x0;var _0x3b986a=_0xb480[_0x381268];return _0x3b986a;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x0b48('0x0'));var BPromise=require(_0x0b48('0x1'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x0b48('0x2'));var db=require(_0x0b48('0x3'))['db'];var utils=require(_0x0b48('0x4'));var logger=require('../../config/logger')(_0x0b48('0x5'));var config=require(_0x0b48('0x6'));var jayson=require(_0x0b48('0x7'));var client=jayson[_0x0b48('0x8')][_0x0b48('0x9')]({'port':0x232a});config['redis']=_[_0x0b48('0xa')](config[_0x0b48('0xb')],{'host':_0x0b48('0xc'),'port':0x18eb});var socket=require(_0x0b48('0xd'))(new Redis(config['redis']));require(_0x0b48('0xe'))['register'](socket);function respondWithRpcPromise(_0x193826,_0x442385,_0x409961){return new BPromise(function(_0x2f13eb,_0x1378f5){return client['request'](_0x193826,_0x409961)[_0x0b48('0xf')](function(_0x13a651){logger[_0x0b48('0x10')](_0x0b48('0x11'),_0x442385,_0x0b48('0x12'));logger['debug'](_0x0b48('0x13'),_0x442385,'request\x20sent',JSON[_0x0b48('0x14')](_0x13a651));if(_0x13a651[_0x0b48('0x15')]){if(_0x13a651[_0x0b48('0x15')][_0x0b48('0x16')]===0x1f4){logger[_0x0b48('0x15')](_0x0b48('0x11'),_0x442385,_0x13a651[_0x0b48('0x15')][_0x0b48('0x17')]);return _0x1378f5(_0x13a651[_0x0b48('0x15')][_0x0b48('0x17')]);}logger['error'](_0x0b48('0x11'),_0x442385,_0x13a651[_0x0b48('0x15')][_0x0b48('0x17')]);return _0x2f13eb(_0x13a651['error'][_0x0b48('0x17')]);}else{logger[_0x0b48('0x10')](_0x0b48('0x11'),_0x442385,_0x0b48('0x12'));_0x2f13eb(_0x13a651[_0x0b48('0x18')][_0x0b48('0x17')]);}})['catch'](function(_0xe9acd5){logger['error'](_0x0b48('0x11'),_0x442385,_0xe9acd5);_0x1378f5(_0xe9acd5);});});} \ No newline at end of file diff --git a/server/api/dashboardItem/dashboardItem.socket.js b/server/api/dashboardItem/dashboardItem.socket.js index 138974a..5ce46ce 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 _0xe193=['save','remove','update','emit','length','dashboardItem:','./dashboardItem.events'];(function(_0xe5b349,_0x5f06e4){var _0x26b0ad=function(_0x1a97f1){while(--_0x1a97f1){_0xe5b349['push'](_0xe5b349['shift']());}};_0x26b0ad(++_0x5f06e4);}(_0xe193,0x125));var _0x3e19=function(_0x2b8491,_0x428bf0){_0x2b8491=_0x2b8491-0x0;var _0x484b14=_0xe193[_0x2b8491];return _0x484b14;};'use strict';var DashboardItemEvents=require(_0x3e19('0x0'));var events=[_0x3e19('0x1'),_0x3e19('0x2'),_0x3e19('0x3')];function createListener(_0x129f7e,_0x1db5a){return function(_0x377738){_0x1db5a[_0x3e19('0x4')](_0x129f7e,_0x377738);};}function removeListener(_0x3f707b,_0xf72aa7){return function(){DashboardItemEvents['removeListener'](_0x3f707b,_0xf72aa7);};}exports['register']=function(_0x4df7c5){for(var _0x3c398e=0x0,_0x559cec=events[_0x3e19('0x5')];_0x3c398e<_0x559cec;_0x3c398e++){var _0x820931=events[_0x3c398e];var _0x57ea3e=createListener(_0x3e19('0x6')+_0x820931,_0x4df7c5);DashboardItemEvents['on'](_0x820931,_0x57ea3e);}}; \ No newline at end of file +var _0xff62=['save','remove','update','emit','removeListener','dashboardItem:','./dashboardItem.events'];(function(_0x85e9f3,_0x4f0cec){var _0x2fee98=function(_0x3a3346){while(--_0x3a3346){_0x85e9f3['push'](_0x85e9f3['shift']());}};_0x2fee98(++_0x4f0cec);}(_0xff62,0x1cd));var _0x2ff6=function(_0x553ca4,_0x39ab4d){_0x553ca4=_0x553ca4-0x0;var _0x265d86=_0xff62[_0x553ca4];return _0x265d86;};'use strict';var DashboardItemEvents=require(_0x2ff6('0x0'));var events=[_0x2ff6('0x1'),_0x2ff6('0x2'),_0x2ff6('0x3')];function createListener(_0x544411,_0x167422){return function(_0x29caa0){_0x167422[_0x2ff6('0x4')](_0x544411,_0x29caa0);};}function removeListener(_0x3bf509,_0x5de8ff){return function(){DashboardItemEvents[_0x2ff6('0x5')](_0x3bf509,_0x5de8ff);};}exports['register']=function(_0x4e9454){for(var _0x419afb=0x0,_0x1dce72=events['length'];_0x419afb<_0x1dce72;_0x419afb++){var _0x4201c2=events[_0x419afb];var _0x3c7db5=createListener(_0x2ff6('0x6')+_0x4201c2,_0x4e9454);DashboardItemEvents['on'](_0x4201c2,_0x3c7db5);}}; \ No newline at end of file diff --git a/server/api/dashboardItem/index.js b/server/api/dashboardItem/index.js index b6b4de6..071c02f 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 _0x5cf0=['util','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./dashboardItem.controller','get','/:id','isAuthenticated','show','post','put','update','delete','destroy','exports','multer'];(function(_0x17f397,_0x5bf1eb){var _0x65aa26=function(_0x2dfc7c){while(--_0x2dfc7c){_0x17f397['push'](_0x17f397['shift']());}};_0x65aa26(++_0x5bf1eb);}(_0x5cf0,0x1d3));var _0x05cf=function(_0x12bebf,_0x53a8fa){_0x12bebf=_0x12bebf-0x0;var _0x49667d=_0x5cf0[_0x12bebf];return _0x49667d;};'use strict';var multer=require(_0x05cf('0x0'));var util=require(_0x05cf('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0x05cf('0x2'));var router=express[_0x05cf('0x3')]();var fs_extra=require(_0x05cf('0x4'));var auth=require(_0x05cf('0x5'));var interaction=require(_0x05cf('0x6'));var config=require('../../config/environment');var controller=require(_0x05cf('0x7'));router[_0x05cf('0x8')](_0x05cf('0x9'),auth[_0x05cf('0xa')](),controller[_0x05cf('0xb')]);router[_0x05cf('0xc')]('/',auth[_0x05cf('0xa')](),controller['create']);router[_0x05cf('0xd')](_0x05cf('0x9'),auth[_0x05cf('0xa')](),controller[_0x05cf('0xe')]);router[_0x05cf('0xf')](_0x05cf('0x9'),auth['isAuthenticated'](),controller[_0x05cf('0x10')]);module[_0x05cf('0x11')]=router; \ No newline at end of file +var _0x4d7e=['../../components/auth/service','../../config/environment','./dashboardItem.controller','get','/:id','show','isAuthenticated','put','update','delete','destroy','exports','multer','util','path','fs-extra'];(function(_0x1aed80,_0x3ca6f6){var _0x43961e=function(_0x43bf2b){while(--_0x43bf2b){_0x1aed80['push'](_0x1aed80['shift']());}};_0x43961e(++_0x3ca6f6);}(_0x4d7e,0x16c));var _0xe4d7=function(_0x54e4f9,_0x35d3ba){_0x54e4f9=_0x54e4f9-0x0;var _0x5de187=_0x4d7e[_0x54e4f9];return _0x5de187;};'use strict';var multer=require(_0xe4d7('0x0'));var util=require(_0xe4d7('0x1'));var path=require(_0xe4d7('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express['Router']();var fs_extra=require(_0xe4d7('0x3'));var auth=require(_0xe4d7('0x4'));var interaction=require('../../components/interaction/service');var config=require(_0xe4d7('0x5'));var controller=require(_0xe4d7('0x6'));router[_0xe4d7('0x7')](_0xe4d7('0x8'),auth['isAuthenticated'](),controller[_0xe4d7('0x9')]);router['post']('/',auth[_0xe4d7('0xa')](),controller['create']);router[_0xe4d7('0xb')](_0xe4d7('0x8'),auth[_0xe4d7('0xa')](),controller[_0xe4d7('0xc')]);router[_0xe4d7('0xd')]('/:id',auth[_0xe4d7('0xa')](),controller[_0xe4d7('0xe')]);module[_0xe4d7('0xf')]=router; \ No newline at end of file diff --git a/server/api/disposition/disposition.attributes.js b/server/api/disposition/disposition.attributes.js index d49527e..88637a6 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 _0x04dd=['exports','STRING','ENUM','first','second','third','sequelize'];(function(_0x4b2436,_0x452299){var _0x4f5ab2=function(_0x5c6679){while(--_0x5c6679){_0x4b2436['push'](_0x4b2436['shift']());}};_0x4f5ab2(++_0x452299);}(_0x04dd,0x14f));var _0xd04d=function(_0x51921f,_0x42bde0){_0x51921f=_0x51921f-0x0;var _0x41743a=_0x04dd[_0x51921f];return _0x41743a;};'use strict';var Sequelize=require(_0xd04d('0x0'));module[_0xd04d('0x1')]={'name':{'type':Sequelize[_0xd04d('0x2')],'allowNull':![]},'level':{'type':Sequelize[_0xd04d('0x3')](_0xd04d('0x4'),_0xd04d('0x5'),_0xd04d('0x6')),'allowNull':![],'defaultValue':_0xd04d('0x4')},'description':{'type':Sequelize[_0xd04d('0x2')]}}; \ No newline at end of file +var _0xa90f=['STRING','first','second'];(function(_0xab8e26,_0x3bb94e){var _0x22fbbd=function(_0x2e48fd){while(--_0x2e48fd){_0xab8e26['push'](_0xab8e26['shift']());}};_0x22fbbd(++_0x3bb94e);}(_0xa90f,0x16e));var _0xfa90=function(_0x2c4013,_0x529007){_0x2c4013=_0x2c4013-0x0;var _0x45479f=_0xa90f[_0x2c4013];return _0x45479f;};'use strict';var Sequelize=require('sequelize');module['exports']={'name':{'type':Sequelize[_0xfa90('0x0')],'allowNull':![]},'level':{'type':Sequelize['ENUM'](_0xfa90('0x1'),_0xfa90('0x2'),'third'),'allowNull':![],'defaultValue':'first'},'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 be372e5..f1280df 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 _0x238d=['set','Content-Range','apply','reject','save','update','destroy','get','UserProfileResource','then','error','stack','index','map','fieldName','type','key','name','keys','query','filters','attributes','intersection','model','fields','length','hasOwnProperty','nolimit','order','sort','where','filter','merge','options','Disposition','includeAll','findAll','show','rawAttributes','include','catch','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','Dispositions','find','userProfileId','autoAssociation','params','eml-format','rimraf','zip-dir','fast-json-patch','moment','mustache','path','sox','to-csv','fs-extra','lodash','squel','crypto','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','sendStatus','status','json','offset','undefined','count','limit'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x238d,0x123));var _0xd238=function(_0x469587,_0x2e65fb){_0x469587=_0x469587-0x0;var _0x50a7fc=_0x238d[_0x469587];return _0x50a7fc;};'use strict';var emlformat=require(_0xd238('0x0'));var rimraf=require(_0xd238('0x1'));var zipdir=require(_0xd238('0x2'));var jsonpatch=require(_0xd238('0x3'));var rp=require('request-promise');var moment=require(_0xd238('0x4'));var BPromise=require('bluebird');var Mustache=require(_0xd238('0x5'));var util=require('util');var path=require(_0xd238('0x6'));var sox=require(_0xd238('0x7'));var csv=require(_0xd238('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xd238('0x9'));var _=require(_0xd238('0xa'));var squel=require(_0xd238('0xb'));var crypto=require(_0xd238('0xc'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0xd238('0x8'));var querystring=require(_0xd238('0xd'));var Papa=require(_0xd238('0xe'));var Redis=require('ioredis');var authService=require(_0xd238('0xf'));var qs=require(_0xd238('0x10'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xd238('0x11'));var logger=require(_0xd238('0x12'))('api');var utils=require(_0xd238('0x13'));var config=require(_0xd238('0x14'));var licenseUtil=require(_0xd238('0x15'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0xf91d80,_0x3e976c){_0x3e976c=_0x3e976c||0xcc;return function(_0x520060){if(_0x520060){return _0xf91d80[_0xd238('0x16')](_0x3e976c);}return _0xf91d80[_0xd238('0x17')](_0x3e976c)['end']();};}function respondWithResult(_0x4f6a65,_0x395458){_0x395458=_0x395458||0xc8;return function(_0x127466){if(_0x127466){return _0x4f6a65[_0xd238('0x17')](_0x395458)[_0xd238('0x18')](_0x127466);}};}function respondWithFilteredResult(_0x14a9d3,_0x32f66c){return function(_0x247099){if(_0x247099){var _0x49ece3=typeof _0x32f66c[_0xd238('0x19')]===_0xd238('0x1a')&&typeof _0x32f66c['limit']===_0xd238('0x1a');var _0x47346c=_0x247099[_0xd238('0x1b')];var _0x3c281e=_0x49ece3?0x0:_0x32f66c[_0xd238('0x19')];var _0x1a5e94=_0x49ece3?_0x247099[_0xd238('0x1b')]:_0x32f66c[_0xd238('0x19')]+_0x32f66c[_0xd238('0x1c')];var _0x3ad878;if(_0x1a5e94>=_0x47346c){_0x1a5e94=_0x47346c;_0x3ad878=0xc8;}else{_0x3ad878=0xce;}_0x14a9d3[_0xd238('0x17')](_0x3ad878);return _0x14a9d3[_0xd238('0x1d')](_0xd238('0x1e'),_0x3c281e+'-'+_0x1a5e94+'/'+_0x47346c)['json'](_0x247099);}return null;};}function patchUpdates(_0xd905e2){return function(_0x406324){try{jsonpatch[_0xd238('0x1f')](_0x406324,_0xd905e2,!![]);}catch(_0xf9247){return BPromise[_0xd238('0x20')](_0xf9247);}return _0x406324[_0xd238('0x21')]();};}function saveUpdates(_0x589036,_0x42b2e3){return function(_0x51460f){if(_0x51460f){return _0x51460f[_0xd238('0x22')](_0x589036)['then'](function(_0x34defc){return _0x34defc;});}return null;};}function removeEntity(_0xeb4572,_0xd4e3e4){return function(_0x75f8a6){if(_0x75f8a6){return _0x75f8a6[_0xd238('0x23')]()['then'](function(){var _0x2ca995=_0x75f8a6[_0xd238('0x24')]({'plain':!![]});var _0x2c3979='Dispositions';return db[_0xd238('0x25')]['destroy']({'where':{'type':_0x2c3979,'resourceId':_0x2ca995['id']}})[_0xd238('0x26')](function(){return _0x75f8a6;});})['then'](function(){_0xeb4572[_0xd238('0x17')](0xcc)['end']();});}};}function handleEntityNotFound(_0x4e52e8,_0x159c17){return function(_0x58d39d){if(!_0x58d39d){_0x4e52e8[_0xd238('0x16')](0x194);}return _0x58d39d;};}function handleError(_0x4a8510,_0x28a0a9){_0x28a0a9=_0x28a0a9||0x1f4;return function(_0x28d9ea){logger[_0xd238('0x27')](_0x28d9ea[_0xd238('0x28')]);if(_0x28d9ea['name']){delete _0x28d9ea['name'];}_0x4a8510[_0xd238('0x17')](_0x28a0a9)['send'](_0x28d9ea);};}exports[_0xd238('0x29')]=function(_0x5f0574,_0x189fbd){var _0x190db1={},_0x3ebbe7={},_0x3c8f5d={'count':0x0,'rows':[]};var _0x453cf9=_[_0xd238('0x2a')](db['Disposition']['rawAttributes'],function(_0x1c68ea){return{'name':_0x1c68ea[_0xd238('0x2b')],'type':_0x1c68ea[_0xd238('0x2c')][_0xd238('0x2d')]};});_0x3ebbe7['model']=_[_0xd238('0x2a')](_0x453cf9,_0xd238('0x2e'));_0x3ebbe7['query']=_[_0xd238('0x2f')](_0x5f0574[_0xd238('0x30')]);_0x3ebbe7[_0xd238('0x31')]=_['intersection'](_0x3ebbe7['model'],_0x3ebbe7[_0xd238('0x30')]);_0x190db1[_0xd238('0x32')]=_[_0xd238('0x33')](_0x3ebbe7[_0xd238('0x34')],qs[_0xd238('0x35')](_0x5f0574[_0xd238('0x30')][_0xd238('0x35')]));_0x190db1[_0xd238('0x32')]=_0x190db1[_0xd238('0x32')][_0xd238('0x36')]?_0x190db1[_0xd238('0x32')]:_0x3ebbe7[_0xd238('0x34')];if(!_0x5f0574[_0xd238('0x30')][_0xd238('0x37')](_0xd238('0x38'))){_0x190db1[_0xd238('0x1c')]=qs[_0xd238('0x1c')](_0x5f0574['query'][_0xd238('0x1c')]);_0x190db1[_0xd238('0x19')]=qs[_0xd238('0x19')](_0x5f0574[_0xd238('0x30')][_0xd238('0x19')]);}_0x190db1[_0xd238('0x39')]=qs[_0xd238('0x3a')](_0x5f0574['query'][_0xd238('0x3a')]);_0x190db1[_0xd238('0x3b')]=qs[_0xd238('0x31')](_['pick'](_0x5f0574[_0xd238('0x30')],_0x3ebbe7[_0xd238('0x31')]),_0x453cf9);if(_0x5f0574[_0xd238('0x30')][_0xd238('0x3c')]){_0x190db1[_0xd238('0x3b')]=_['merge'](_0x190db1[_0xd238('0x3b')],{'$or':_[_0xd238('0x2a')](_0x453cf9,function(_0xe8630a){if(_0xe8630a[_0xd238('0x2c')]!=='VIRTUAL'){var _0x75324c={};_0x75324c[_0xe8630a[_0xd238('0x2e')]]={'$like':'%'+_0x5f0574['query'][_0xd238('0x3c')]+'%'};return _0x75324c;}})});}_0x190db1=_[_0xd238('0x3d')]({},_0x190db1,_0x5f0574[_0xd238('0x3e')]);var _0x294049={'where':_0x190db1[_0xd238('0x3b')]};return db[_0xd238('0x3f')][_0xd238('0x1b')](_0x294049)[_0xd238('0x26')](function(_0x283383){_0x3c8f5d[_0xd238('0x1b')]=_0x283383;if(_0x5f0574[_0xd238('0x30')][_0xd238('0x40')]){_0x190db1['include']=[{'all':!![]}];}return db[_0xd238('0x3f')][_0xd238('0x41')](_0x190db1);})['then'](function(_0x172434){_0x3c8f5d['rows']=_0x172434;return _0x3c8f5d;})[_0xd238('0x26')](respondWithFilteredResult(_0x189fbd,_0x190db1))['catch'](handleError(_0x189fbd,null));};exports[_0xd238('0x42')]=function(_0x49cbf8,_0x4b4662){var _0xad3e19={'raw':!![],'where':{'id':_0x49cbf8['params']['id']}},_0x479516={};_0x479516[_0xd238('0x34')]=_[_0xd238('0x2f')](db[_0xd238('0x3f')][_0xd238('0x43')]);_0x479516[_0xd238('0x30')]=_[_0xd238('0x2f')](_0x49cbf8['query']);_0x479516[_0xd238('0x31')]=_[_0xd238('0x33')](_0x479516[_0xd238('0x34')],_0x479516['query']);_0xad3e19[_0xd238('0x32')]=_[_0xd238('0x33')](_0x479516[_0xd238('0x34')],qs['fields'](_0x49cbf8['query'][_0xd238('0x35')]));_0xad3e19[_0xd238('0x32')]=_0xad3e19['attributes'][_0xd238('0x36')]?_0xad3e19[_0xd238('0x32')]:_0x479516[_0xd238('0x34')];if(_0x49cbf8[_0xd238('0x30')][_0xd238('0x40')]){_0xad3e19[_0xd238('0x44')]=[{'all':!![]}];}_0xad3e19=_[_0xd238('0x3d')]({},_0xad3e19,_0x49cbf8[_0xd238('0x3e')]);return db[_0xd238('0x3f')]['find'](_0xad3e19)[_0xd238('0x26')](handleEntityNotFound(_0x4b4662,null))[_0xd238('0x26')](respondWithResult(_0x4b4662,null))[_0xd238('0x45')](handleError(_0x4b4662,null));};exports[_0xd238('0x46')]=function(_0x4881d1,_0x368284){return db[_0xd238('0x3f')][_0xd238('0x46')](_0x4881d1[_0xd238('0x47')],{})[_0xd238('0x26')](function(_0x162cf3){var _0x5e9648=_0x4881d1[_0xd238('0x48')][_0xd238('0x24')]({'plain':!![]});if(!_0x5e9648)throw new Error(_0xd238('0x49'));if(_0x5e9648[_0xd238('0x4a')]===_0xd238('0x48')){var _0x5257dd=_0x162cf3[_0xd238('0x24')]({'plain':!![]});var _0x51bc00=_0xd238('0x4b');return db['UserProfileSection'][_0xd238('0x4c')]({'where':{'name':_0x51bc00,'userProfileId':_0x5e9648[_0xd238('0x4d')]},'raw':!![]})[_0xd238('0x26')](function(_0x4fb0f6){if(_0x4fb0f6&&_0x4fb0f6[_0xd238('0x4e')]===0x0){return db['UserProfileResource'][_0xd238('0x46')]({'name':_0x5257dd[_0xd238('0x2e')],'resourceId':_0x5257dd['id'],'type':_0x4fb0f6['name'],'sectionId':_0x4fb0f6['id']},{})['then'](function(){return _0x162cf3;});}else{return _0x162cf3;}})[_0xd238('0x45')](function(_0x24e9c1){logger[_0xd238('0x27')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x24e9c1);throw _0x24e9c1;});}return _0x162cf3;})['then'](respondWithResult(_0x368284,0xc9))['catch'](handleError(_0x368284,null));};exports[_0xd238('0x22')]=function(_0x1b8ac0,_0x602986){if(_0x1b8ac0[_0xd238('0x47')]['id']){delete _0x1b8ac0['body']['id'];}return db['Disposition']['find']({'where':{'id':_0x1b8ac0[_0xd238('0x4f')]['id']}})['then'](handleEntityNotFound(_0x602986,null))[_0xd238('0x26')](saveUpdates(_0x1b8ac0['body'],null))['then'](respondWithResult(_0x602986,null))[_0xd238('0x45')](handleError(_0x602986,null));};exports[_0xd238('0x23')]=function(_0x43e63a,_0x1d4bd7){return db['Disposition'][_0xd238('0x4c')]({'where':{'id':_0x43e63a[_0xd238('0x4f')]['id']}})[_0xd238('0x26')](handleEntityNotFound(_0x1d4bd7,null))[_0xd238('0x26')](removeEntity(_0x1d4bd7,null))[_0xd238('0x45')](handleError(_0x1d4bd7,null));}; \ No newline at end of file +var _0xa7cb=['keys','filters','intersection','attributes','fields','length','hasOwnProperty','sort','where','pick','merge','type','filter','options','includeAll','findAll','rows','show','include','find','create','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','autoAssociation','catch','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','params','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','util','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','status','end','offset','undefined','limit','count','set','json','apply','save','update','then','destroy','get','Dispositions','UserProfileResource','sendStatus','error','stack','name','map','Disposition','rawAttributes','fieldName','key','model','query'];(function(_0x3dfeb9,_0x1cc6e4){var _0x412314=function(_0x321253){while(--_0x321253){_0x3dfeb9['push'](_0x3dfeb9['shift']());}};_0x412314(++_0x1cc6e4);}(_0xa7cb,0xc7));var _0xba7c=function(_0x5b7f24,_0x52a1a8){_0x5b7f24=_0x5b7f24-0x0;var _0x4c1ec9=_0xa7cb[_0x5b7f24];return _0x4c1ec9;};'use strict';var emlformat=require(_0xba7c('0x0'));var rimraf=require(_0xba7c('0x1'));var zipdir=require(_0xba7c('0x2'));var jsonpatch=require(_0xba7c('0x3'));var rp=require(_0xba7c('0x4'));var moment=require('moment');var BPromise=require(_0xba7c('0x5'));var Mustache=require('mustache');var util=require(_0xba7c('0x6'));var path=require('path');var sox=require(_0xba7c('0x7'));var csv=require(_0xba7c('0x8'));var ejs=require(_0xba7c('0x9'));var fs=require('fs');var fs_extra=require(_0xba7c('0xa'));var _=require(_0xba7c('0xb'));var squel=require(_0xba7c('0xc'));var crypto=require(_0xba7c('0xd'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0xba7c('0x8'));var querystring=require(_0xba7c('0xe'));var Papa=require(_0xba7c('0xf'));var Redis=require('ioredis');var authService=require(_0xba7c('0x10'));var qs=require(_0xba7c('0x11'));var as=require(_0xba7c('0x12'));var hardwareService=require(_0xba7c('0x13'));var logger=require(_0xba7c('0x14'))(_0xba7c('0x15'));var utils=require(_0xba7c('0x16'));var config=require(_0xba7c('0x17'));var licenseUtil=require(_0xba7c('0x18'));var db=require(_0xba7c('0x19'))['db'];function respondWithStatusCode(_0x5c251a,_0x597378){_0x597378=_0x597378||0xcc;return function(_0x322db0){if(_0x322db0){return _0x5c251a['sendStatus'](_0x597378);}return _0x5c251a[_0xba7c('0x1a')](_0x597378)[_0xba7c('0x1b')]();};}function respondWithResult(_0x2d2ad7,_0x2b6da8){_0x2b6da8=_0x2b6da8||0xc8;return function(_0x37bcde){if(_0x37bcde){return _0x2d2ad7[_0xba7c('0x1a')](_0x2b6da8)['json'](_0x37bcde);}};}function respondWithFilteredResult(_0x58f837,_0x3a24d1){return function(_0x4dfdcf){if(_0x4dfdcf){var _0x3b7a98=typeof _0x3a24d1[_0xba7c('0x1c')]===_0xba7c('0x1d')&&typeof _0x3a24d1[_0xba7c('0x1e')]===_0xba7c('0x1d');var _0x512684=_0x4dfdcf[_0xba7c('0x1f')];var _0xec84fa=_0x3b7a98?0x0:_0x3a24d1[_0xba7c('0x1c')];var _0x257fba=_0x3b7a98?_0x4dfdcf['count']:_0x3a24d1[_0xba7c('0x1c')]+_0x3a24d1['limit'];var _0x2dfd8f;if(_0x257fba>=_0x512684){_0x257fba=_0x512684;_0x2dfd8f=0xc8;}else{_0x2dfd8f=0xce;}_0x58f837[_0xba7c('0x1a')](_0x2dfd8f);return _0x58f837[_0xba7c('0x20')]('Content-Range',_0xec84fa+'-'+_0x257fba+'/'+_0x512684)[_0xba7c('0x21')](_0x4dfdcf);}return null;};}function patchUpdates(_0x6ff51a){return function(_0x553725){try{jsonpatch[_0xba7c('0x22')](_0x553725,_0x6ff51a,!![]);}catch(_0x4f677c){return BPromise['reject'](_0x4f677c);}return _0x553725[_0xba7c('0x23')]();};}function saveUpdates(_0x802b85,_0x3a7c1d){return function(_0x84a094){if(_0x84a094){return _0x84a094[_0xba7c('0x24')](_0x802b85)[_0xba7c('0x25')](function(_0x55e90c){return _0x55e90c;});}return null;};}function removeEntity(_0x4f5262,_0x20db07){return function(_0x33941e){if(_0x33941e){return _0x33941e[_0xba7c('0x26')]()[_0xba7c('0x25')](function(){var _0x486dc6=_0x33941e[_0xba7c('0x27')]({'plain':!![]});var _0x398af0=_0xba7c('0x28');return db[_0xba7c('0x29')]['destroy']({'where':{'type':_0x398af0,'resourceId':_0x486dc6['id']}})[_0xba7c('0x25')](function(){return _0x33941e;});})[_0xba7c('0x25')](function(){_0x4f5262['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x3c1a08,_0x3dad5c){return function(_0x45ab71){if(!_0x45ab71){_0x3c1a08[_0xba7c('0x2a')](0x194);}return _0x45ab71;};}function handleError(_0x170555,_0x206a93){_0x206a93=_0x206a93||0x1f4;return function(_0x2e60f7){logger[_0xba7c('0x2b')](_0x2e60f7[_0xba7c('0x2c')]);if(_0x2e60f7[_0xba7c('0x2d')]){delete _0x2e60f7[_0xba7c('0x2d')];}_0x170555[_0xba7c('0x1a')](_0x206a93)['send'](_0x2e60f7);};}exports['index']=function(_0x45c7ee,_0x4bae33){var _0x46996d={},_0x57c3b0={},_0x5681ad={'count':0x0,'rows':[]};var _0x117067=_[_0xba7c('0x2e')](db[_0xba7c('0x2f')][_0xba7c('0x30')],function(_0x44e3d5){return{'name':_0x44e3d5[_0xba7c('0x31')],'type':_0x44e3d5['type'][_0xba7c('0x32')]};});_0x57c3b0[_0xba7c('0x33')]=_['map'](_0x117067,'name');_0x57c3b0[_0xba7c('0x34')]=_[_0xba7c('0x35')](_0x45c7ee[_0xba7c('0x34')]);_0x57c3b0[_0xba7c('0x36')]=_[_0xba7c('0x37')](_0x57c3b0['model'],_0x57c3b0[_0xba7c('0x34')]);_0x46996d[_0xba7c('0x38')]=_[_0xba7c('0x37')](_0x57c3b0[_0xba7c('0x33')],qs[_0xba7c('0x39')](_0x45c7ee[_0xba7c('0x34')][_0xba7c('0x39')]));_0x46996d[_0xba7c('0x38')]=_0x46996d[_0xba7c('0x38')][_0xba7c('0x3a')]?_0x46996d[_0xba7c('0x38')]:_0x57c3b0[_0xba7c('0x33')];if(!_0x45c7ee[_0xba7c('0x34')][_0xba7c('0x3b')]('nolimit')){_0x46996d[_0xba7c('0x1e')]=qs[_0xba7c('0x1e')](_0x45c7ee[_0xba7c('0x34')][_0xba7c('0x1e')]);_0x46996d['offset']=qs['offset'](_0x45c7ee[_0xba7c('0x34')]['offset']);}_0x46996d['order']=qs[_0xba7c('0x3c')](_0x45c7ee[_0xba7c('0x34')][_0xba7c('0x3c')]);_0x46996d[_0xba7c('0x3d')]=qs[_0xba7c('0x36')](_[_0xba7c('0x3e')](_0x45c7ee[_0xba7c('0x34')],_0x57c3b0[_0xba7c('0x36')]),_0x117067);if(_0x45c7ee[_0xba7c('0x34')]['filter']){_0x46996d[_0xba7c('0x3d')]=_[_0xba7c('0x3f')](_0x46996d[_0xba7c('0x3d')],{'$or':_[_0xba7c('0x2e')](_0x117067,function(_0x1e1f95){if(_0x1e1f95[_0xba7c('0x40')]!=='VIRTUAL'){var _0x52dc49={};_0x52dc49[_0x1e1f95[_0xba7c('0x2d')]]={'$like':'%'+_0x45c7ee['query'][_0xba7c('0x41')]+'%'};return _0x52dc49;}})});}_0x46996d=_[_0xba7c('0x3f')]({},_0x46996d,_0x45c7ee[_0xba7c('0x42')]);var _0x1d1718={'where':_0x46996d[_0xba7c('0x3d')]};return db[_0xba7c('0x2f')][_0xba7c('0x1f')](_0x1d1718)[_0xba7c('0x25')](function(_0x33e570){_0x5681ad[_0xba7c('0x1f')]=_0x33e570;if(_0x45c7ee[_0xba7c('0x34')][_0xba7c('0x43')]){_0x46996d['include']=[{'all':!![]}];}return db[_0xba7c('0x2f')][_0xba7c('0x44')](_0x46996d);})[_0xba7c('0x25')](function(_0x41184a){_0x5681ad[_0xba7c('0x45')]=_0x41184a;return _0x5681ad;})[_0xba7c('0x25')](respondWithFilteredResult(_0x4bae33,_0x46996d))['catch'](handleError(_0x4bae33,null));};exports[_0xba7c('0x46')]=function(_0xb6c9c,_0x5e7064){var _0x11b5b3={'raw':!![],'where':{'id':_0xb6c9c['params']['id']}},_0x506722={};_0x506722['model']=_[_0xba7c('0x35')](db['Disposition'][_0xba7c('0x30')]);_0x506722['query']=_[_0xba7c('0x35')](_0xb6c9c[_0xba7c('0x34')]);_0x506722[_0xba7c('0x36')]=_[_0xba7c('0x37')](_0x506722[_0xba7c('0x33')],_0x506722['query']);_0x11b5b3[_0xba7c('0x38')]=_[_0xba7c('0x37')](_0x506722[_0xba7c('0x33')],qs[_0xba7c('0x39')](_0xb6c9c[_0xba7c('0x34')][_0xba7c('0x39')]));_0x11b5b3[_0xba7c('0x38')]=_0x11b5b3[_0xba7c('0x38')][_0xba7c('0x3a')]?_0x11b5b3['attributes']:_0x506722['model'];if(_0xb6c9c[_0xba7c('0x34')][_0xba7c('0x43')]){_0x11b5b3[_0xba7c('0x47')]=[{'all':!![]}];}_0x11b5b3=_[_0xba7c('0x3f')]({},_0x11b5b3,_0xb6c9c['options']);return db[_0xba7c('0x2f')][_0xba7c('0x48')](_0x11b5b3)[_0xba7c('0x25')](handleEntityNotFound(_0x5e7064,null))[_0xba7c('0x25')](respondWithResult(_0x5e7064,null))['catch'](handleError(_0x5e7064,null));};exports[_0xba7c('0x49')]=function(_0x92731,_0x544569){return db['Disposition'][_0xba7c('0x49')](_0x92731['body'],{})[_0xba7c('0x25')](function(_0x56d33c){var _0x550e33=_0x92731[_0xba7c('0x4a')][_0xba7c('0x27')]({'plain':!![]});if(!_0x550e33)throw new Error(_0xba7c('0x4b'));if(_0x550e33[_0xba7c('0x4c')]==='user'){var _0x1cf314=_0x56d33c[_0xba7c('0x27')]({'plain':!![]});var _0x52560e=_0xba7c('0x28');return db[_0xba7c('0x4d')][_0xba7c('0x48')]({'where':{'name':_0x52560e,'userProfileId':_0x550e33[_0xba7c('0x4e')]},'raw':!![]})['then'](function(_0x4cefbf){if(_0x4cefbf&&_0x4cefbf[_0xba7c('0x4f')]===0x0){return db[_0xba7c('0x29')][_0xba7c('0x49')]({'name':_0x1cf314[_0xba7c('0x2d')],'resourceId':_0x1cf314['id'],'type':_0x4cefbf[_0xba7c('0x2d')],'sectionId':_0x4cefbf['id']},{})[_0xba7c('0x25')](function(){return _0x56d33c;});}else{return _0x56d33c;}})[_0xba7c('0x50')](function(_0x3916cf){logger['error'](_0xba7c('0x51'),_0x3916cf);throw _0x3916cf;});}return _0x56d33c;})[_0xba7c('0x25')](respondWithResult(_0x544569,0xc9))[_0xba7c('0x50')](handleError(_0x544569,null));};exports[_0xba7c('0x24')]=function(_0x5e9f81,_0x4ffddc){if(_0x5e9f81['body']['id']){delete _0x5e9f81[_0xba7c('0x52')]['id'];}return db['Disposition'][_0xba7c('0x48')]({'where':{'id':_0x5e9f81['params']['id']}})['then'](handleEntityNotFound(_0x4ffddc,null))[_0xba7c('0x25')](saveUpdates(_0x5e9f81['body'],null))[_0xba7c('0x25')](respondWithResult(_0x4ffddc,null))['catch'](handleError(_0x4ffddc,null));};exports[_0xba7c('0x26')]=function(_0x15f281,_0x4507d6){return db['Disposition']['find']({'where':{'id':_0x15f281[_0xba7c('0x53')]['id']}})['then'](handleEntityNotFound(_0x4507d6,null))[_0xba7c('0x25')](removeEntity(_0x4507d6,null))[_0xba7c('0x50')](handleError(_0x4507d6,null));}; \ No newline at end of file diff --git a/server/api/disposition/disposition.model.js b/server/api/disposition/disposition.model.js index 7e4e7f9..4e7e359 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 _0x3620=['bluebird','path','rimraf','../../config/environment','./disposition.attributes','define','Disposition','tools_dispositions','name_voice','ListId','name_chat','ChatWebsiteId','name_mail','name','MailAccountId','name_fax','FaxAccountId','name_openchannel','OpenchannelAccountId','name_whatsapp','WhatsappAccountId','lodash','util','api','moment'];(function(_0x543b08,_0x36bcfc){var _0x1e08e4=function(_0x3bf864){while(--_0x3bf864){_0x543b08['push'](_0x543b08['shift']());}};_0x1e08e4(++_0x36bcfc);}(_0x3620,0xc4));var _0x0362=function(_0x3c4cb8,_0x227405){_0x3c4cb8=_0x3c4cb8-0x0;var _0x5eacf7=_0x3620[_0x3c4cb8];return _0x5eacf7;};'use strict';var _=require(_0x0362('0x0'));var util=require(_0x0362('0x1'));var logger=require('../../config/logger')(_0x0362('0x2'));var moment=require(_0x0362('0x3'));var BPromise=require(_0x0362('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x0362('0x5'));var rimraf=require(_0x0362('0x6'));var config=require(_0x0362('0x7'));var attributes=require(_0x0362('0x8'));module['exports']=function(_0xd57a9d,_0x7b95d){return _0xd57a9d[_0x0362('0x9')](_0x0362('0xa'),attributes,{'tableName':_0x0362('0xb'),'paranoid':![],'indexes':[{'unique':!![],'name':_0x0362('0xc'),'fields':['name',_0x0362('0xd')]},{'unique':!![],'name':_0x0362('0xe'),'fields':['name',_0x0362('0xf')]},{'unique':!![],'name':_0x0362('0x10'),'fields':[_0x0362('0x11'),_0x0362('0x12')]},{'unique':!![],'name':'name_sms','fields':[_0x0362('0x11'),'SmsAccountId']},{'unique':!![],'name':_0x0362('0x13'),'fields':['name',_0x0362('0x14')]},{'unique':!![],'name':_0x0362('0x15'),'fields':[_0x0362('0x11'),_0x0362('0x16')]},{'unique':!![],'name':_0x0362('0x17'),'fields':[_0x0362('0x11'),_0x0362('0x18')]}],'timestamps':!![]});}; \ No newline at end of file +var _0x7680=['lodash','util','../../config/logger','api','bluebird','path','rimraf','../../config/environment','exports','define','Disposition','tools_dispositions','name','ListId','name_chat','ChatWebsiteId','name_sms','SmsAccountId','name_fax','OpenchannelAccountId','name_whatsapp','WhatsappAccountId'];(function(_0x49ee70,_0x115b1e){var _0x3a7254=function(_0x1bc688){while(--_0x1bc688){_0x49ee70['push'](_0x49ee70['shift']());}};_0x3a7254(++_0x115b1e);}(_0x7680,0x1ce));var _0x0768=function(_0xea2c75,_0x4bf4bd){_0xea2c75=_0xea2c75-0x0;var _0x2bebca=_0x7680[_0xea2c75];return _0x2bebca;};'use strict';var _=require(_0x0768('0x0'));var util=require(_0x0768('0x1'));var logger=require(_0x0768('0x2'))(_0x0768('0x3'));var moment=require('moment');var BPromise=require(_0x0768('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x0768('0x5'));var rimraf=require(_0x0768('0x6'));var config=require(_0x0768('0x7'));var attributes=require('./disposition.attributes');module[_0x0768('0x8')]=function(_0x33cf2d,_0x1a2cf7){return _0x33cf2d[_0x0768('0x9')](_0x0768('0xa'),attributes,{'tableName':_0x0768('0xb'),'paranoid':![],'indexes':[{'unique':!![],'name':'name_voice','fields':[_0x0768('0xc'),_0x0768('0xd')]},{'unique':!![],'name':_0x0768('0xe'),'fields':[_0x0768('0xc'),_0x0768('0xf')]},{'unique':!![],'name':'name_mail','fields':[_0x0768('0xc'),'MailAccountId']},{'unique':!![],'name':_0x0768('0x10'),'fields':[_0x0768('0xc'),_0x0768('0x11')]},{'unique':!![],'name':_0x0768('0x12'),'fields':['name','FaxAccountId']},{'unique':!![],'name':'name_openchannel','fields':['name',_0x0768('0x13')]},{'unique':!![],'name':_0x0768('0x14'),'fields':[_0x0768('0xc'),_0x0768('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 5a2a6cf..acfc05c 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(_0x25b4aa,_0xae1d10){var _0x373b29=function(_0x7da86f){while(--_0x7da86f){_0x25b4aa['push'](_0x25b4aa['shift']());}};_0x373b29(++_0xae1d10);}(_0xa9e0,0x123));var _0x0a9e=function(_0x2576d7,_0x167624){_0x2576d7=_0x2576d7-0x0;var _0x16a08c=_0xa9e0[_0x2576d7];return _0x16a08c;};'use strict';var _=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var moment=require(_0x0a9e('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x0a9e('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x0a9e('0x4'));var logger=require(_0x0a9e('0x5'))(_0x0a9e('0x6'));var config=require(_0x0a9e('0x7'));var jayson=require(_0x0a9e('0x8'));var client=jayson['client'][_0x0a9e('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x441e3a,_0x2cc193,_0x5f41ea){return new BPromise(function(_0x503809,_0xe42b77){return client['request'](_0x441e3a,_0x5f41ea)['then'](function(_0x39753a){logger[_0x0a9e('0xa')](_0x0a9e('0xb'),_0x2cc193,_0x0a9e('0xc'));logger[_0x0a9e('0xd')](_0x0a9e('0xe'),_0x2cc193,'request\x20sent',JSON['stringify'](_0x39753a));if(_0x39753a['error']){if(_0x39753a['error'][_0x0a9e('0xf')]===0x1f4){logger[_0x0a9e('0x10')](_0x0a9e('0xb'),_0x2cc193,_0x39753a[_0x0a9e('0x10')][_0x0a9e('0x11')]);return _0xe42b77(_0x39753a[_0x0a9e('0x10')]['message']);}logger[_0x0a9e('0x10')](_0x0a9e('0xb'),_0x2cc193,_0x39753a[_0x0a9e('0x10')][_0x0a9e('0x11')]);return _0x503809(_0x39753a[_0x0a9e('0x10')][_0x0a9e('0x11')]);}else{logger['info'](_0x0a9e('0xb'),_0x2cc193,'request\x20sent');_0x503809(_0x39753a[_0x0a9e('0x12')]['message']);}})[_0x0a9e('0x13')](function(_0x12066b){logger['error'](_0x0a9e('0xb'),_0x2cc193,_0x12066b);_0xe42b77(_0x12066b);});});} \ No newline at end of file +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(_0x1bfa9f,_0x1cf016){var _0x48fee1=function(_0x57b521){while(--_0x57b521){_0x1bfa9f['push'](_0x1bfa9f['shift']());}};_0x48fee1(++_0x1cf016);}(_0xa9e0,0x123));var _0x0a9e=function(_0x32d457,_0x1a39c9){_0x32d457=_0x32d457-0x0;var _0x338386=_0xa9e0[_0x32d457];return _0x338386;};'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 bad32e7..24d2aa0 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 _0x6485=['index','isAuthenticated','show','create','/:id','update','delete','destroy','exports','multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../config/environment'];(function(_0x502c7d,_0x2f1285){var _0x30b7ed=function(_0x2d92f3){while(--_0x2d92f3){_0x502c7d['push'](_0x502c7d['shift']());}};_0x30b7ed(++_0x2f1285);}(_0x6485,0xb3));var _0x5648=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0x6485[_0x321bb2];return _0x9c12ed;};'use strict';var multer=require(_0x5648('0x0'));var util=require(_0x5648('0x1'));var path=require(_0x5648('0x2'));var timeout=require(_0x5648('0x3'));var express=require(_0x5648('0x4'));var router=express[_0x5648('0x5')]();var fs_extra=require('fs-extra');var auth=require(_0x5648('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0x5648('0x7'));var controller=require('./disposition.controller');router['get']('/',auth['isAuthenticated'](),controller[_0x5648('0x8')]);router['get']('/:id',auth[_0x5648('0x9')](),controller[_0x5648('0xa')]);router['post']('/',auth[_0x5648('0x9')](),controller[_0x5648('0xb')]);router['put'](_0x5648('0xc'),auth[_0x5648('0x9')](),controller[_0x5648('0xd')]);router[_0x5648('0xe')](_0x5648('0xc'),auth[_0x5648('0x9')](),controller[_0x5648('0xf')]);module[_0x5648('0x10')]=router; \ No newline at end of file +var _0xb288=['exports','multer','path','connect-timeout','express','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/:id','show','post','put','update','delete','destroy'];(function(_0x69b64e,_0x392a8f){var _0x4e32da=function(_0x5777b7){while(--_0x5777b7){_0x69b64e['push'](_0x69b64e['shift']());}};_0x4e32da(++_0x392a8f);}(_0xb288,0x1b1));var _0x8b28=function(_0x2bb0aa,_0x59e2ba){_0x2bb0aa=_0x2bb0aa-0x0;var _0x2e46dc=_0xb288[_0x2bb0aa];return _0x2e46dc;};'use strict';var multer=require(_0x8b28('0x0'));var util=require('util');var path=require(_0x8b28('0x1'));var timeout=require(_0x8b28('0x2'));var express=require(_0x8b28('0x3'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0x8b28('0x4'));var interaction=require(_0x8b28('0x5'));var config=require(_0x8b28('0x6'));var controller=require('./disposition.controller');router[_0x8b28('0x7')]('/',auth[_0x8b28('0x8')](),controller[_0x8b28('0x9')]);router[_0x8b28('0x7')](_0x8b28('0xa'),auth[_0x8b28('0x8')](),controller[_0x8b28('0xb')]);router[_0x8b28('0xc')]('/',auth[_0x8b28('0x8')](),controller['create']);router[_0x8b28('0xd')](_0x8b28('0xa'),auth[_0x8b28('0x8')](),controller[_0x8b28('0xe')]);router[_0x8b28('0xf')](_0x8b28('0xa'),auth[_0x8b28('0x8')](),controller[_0x8b28('0x10')]);module[_0x8b28('0x11')]=router; \ No newline at end of file diff --git a/server/api/faxAccount/faxAccount.attributes.js b/server/api/faxAccount/faxAccount.attributes.js index cdbc6b6..7a45656 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 _0xf767=['7200','9600','12000','14400','v17,v27,v29','SIP','IAX','DADHI','KHOMP','Account:\x20{{account.name}}
{{#queue}}Queue:\x20{{queue.name}}
{{/queue}}From\x20:\x20{{from}}','BOOLEAN','INTEGER','Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','exports','STRING','ENUM','yes','xCALLY\x20Motion\x20Fax','localstationid','2400','4800'];(function(_0x40212e,_0x37a1b6){var _0x14b040=function(_0x42e08e){while(--_0x42e08e){_0x40212e['push'](_0x40212e['shift']());}};_0x14b040(++_0x37a1b6);}(_0xf767,0x76));var _0x7f76=function(_0x590b63,_0x14debb){_0x590b63=_0x590b63-0x0;var _0x3c9380=_0xf767[_0x590b63];return _0x3c9380;};'use strict';var Sequelize=require('sequelize');module[_0x7f76('0x0')]={'name':{'type':Sequelize[_0x7f76('0x1')],'allowNull':![],'validate':{'notEmpty':!![]}},'description':{'type':Sequelize[_0x7f76('0x1')]},'ecm':{'type':Sequelize[_0x7f76('0x2')](_0x7f76('0x3'),'no'),'defaultValue':'yes'},'headerinfo':{'type':Sequelize[_0x7f76('0x1')],'defaultValue':_0x7f76('0x4')},'localstationid':{'type':Sequelize[_0x7f76('0x1')],'unique':_0x7f76('0x5')},'minrate':{'type':Sequelize['ENUM'](_0x7f76('0x6'),_0x7f76('0x7'),_0x7f76('0x8'),_0x7f76('0x9'),_0x7f76('0xa'),'14400'),'defaultValue':_0x7f76('0x7')},'maxrate':{'type':Sequelize[_0x7f76('0x2')](_0x7f76('0x6'),_0x7f76('0x7'),'7200',_0x7f76('0x9'),'12000',_0x7f76('0xb')),'defaultValue':_0x7f76('0xb')},'modem':{'type':Sequelize[_0x7f76('0x1')],'defaultValue':_0x7f76('0xc')},'gateway':{'type':Sequelize[_0x7f76('0x1')],'defaultValue':'no','validate':{'is':/^(?:yes|no|[0-9]+)$/}},'faxdetect':{'type':Sequelize[_0x7f76('0x1')],'defaultValue':'no','validate':{'is':/^(?:yes|no|t38|cng|[0-9]+)$/}},'t38timeout':{'type':Sequelize['INTEGER'],'defaultValue':0x1388,'validate':{'min':0x3e8}},'tech':{'type':Sequelize[_0x7f76('0x2')](_0x7f76('0xd'),_0x7f76('0xe'),_0x7f76('0xf'),_0x7f76('0x10')),'defaultValue':'SIP'},'key':{'type':Sequelize[_0x7f76('0x1')],'allowNull':![]},'notificationTemplate':{'type':Sequelize['TEXT'],'defaultValue':function(){return _0x7f76('0x11');}},'notificationSound':{'type':Sequelize[_0x7f76('0x12')],'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},'queueTransfer':{'type':Sequelize[_0x7f76('0x12')],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize[_0x7f76('0x13')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize[_0x7f76('0x12')],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'mandatoryDispositionPauseId':{'type':Sequelize[_0x7f76('0x13')],'allowNull':!![],'defaultValue':null,'comment':'Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled'},'mandatoryDisposition':{'type':Sequelize[_0x7f76('0x12')],'defaultValue':![],'comment':_0x7f76('0x14'),'set':function(_0x431076){if(!_0x431076)this['setDataValue']('mandatoryDispositionPauseId',null);this['setDataValue']('mandatoryDisposition',_0x431076);}}}; \ No newline at end of file +var _0xb46f=['7200','9600','14400','v17,v27,v29','INTEGER','SIP','IAX','TEXT','Account:\x20{{account.name}}
{{#queue}}Queue:\x20{{queue.name}}
{{/queue}}From\x20:\x20{{from}}','BOOLEAN','Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','mandatoryDispositionPauseId','setDataValue','mandatoryDisposition','sequelize','exports','STRING','ENUM','yes','2400','4800'];(function(_0x3a37eb,_0x4834a5){var _0x1b900c=function(_0x2758e4){while(--_0x2758e4){_0x3a37eb['push'](_0x3a37eb['shift']());}};_0x1b900c(++_0x4834a5);}(_0xb46f,0xb6));var _0xfb46=function(_0x1d32d0,_0x50c1ed){_0x1d32d0=_0x1d32d0-0x0;var _0x58b67c=_0xb46f[_0x1d32d0];return _0x58b67c;};'use strict';var Sequelize=require(_0xfb46('0x0'));module[_0xfb46('0x1')]={'name':{'type':Sequelize['STRING'],'allowNull':![],'validate':{'notEmpty':!![]}},'description':{'type':Sequelize[_0xfb46('0x2')]},'ecm':{'type':Sequelize[_0xfb46('0x3')](_0xfb46('0x4'),'no'),'defaultValue':_0xfb46('0x4')},'headerinfo':{'type':Sequelize[_0xfb46('0x2')],'defaultValue':'xCALLY\x20Motion\x20Fax'},'localstationid':{'type':Sequelize[_0xfb46('0x2')],'unique':'localstationid'},'minrate':{'type':Sequelize[_0xfb46('0x3')](_0xfb46('0x5'),_0xfb46('0x6'),_0xfb46('0x7'),_0xfb46('0x8'),'12000',_0xfb46('0x9')),'defaultValue':_0xfb46('0x6')},'maxrate':{'type':Sequelize['ENUM']('2400','4800','7200',_0xfb46('0x8'),'12000',_0xfb46('0x9')),'defaultValue':_0xfb46('0x9')},'modem':{'type':Sequelize[_0xfb46('0x2')],'defaultValue':_0xfb46('0xa')},'gateway':{'type':Sequelize[_0xfb46('0x2')],'defaultValue':'no','validate':{'is':/^(?:yes|no|[0-9]+)$/}},'faxdetect':{'type':Sequelize[_0xfb46('0x2')],'defaultValue':'no','validate':{'is':/^(?:yes|no|t38|cng|[0-9]+)$/}},'t38timeout':{'type':Sequelize[_0xfb46('0xb')],'defaultValue':0x1388,'validate':{'min':0x3e8}},'tech':{'type':Sequelize[_0xfb46('0x3')](_0xfb46('0xc'),_0xfb46('0xd'),'DADHI','KHOMP'),'defaultValue':_0xfb46('0xc')},'key':{'type':Sequelize['STRING'],'allowNull':![]},'notificationTemplate':{'type':Sequelize[_0xfb46('0xe')],'defaultValue':function(){return _0xfb46('0xf');}},'notificationSound':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'notificationShake':{'type':Sequelize[_0xfb46('0x10')],'defaultValue':![]},'waitForTheAssignedAgent':{'type':Sequelize[_0xfb46('0xb')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'waitForTheAssignedQueue':{'type':Sequelize[_0xfb46('0xb')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'queueTransfer':{'type':Sequelize[_0xfb46('0x10')],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize[_0xfb46('0x10')],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize[_0xfb46('0xb')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'mandatoryDispositionPauseId':{'type':Sequelize[_0xfb46('0xb')],'allowNull':!![],'defaultValue':null,'comment':'Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled'},'mandatoryDisposition':{'type':Sequelize[_0xfb46('0x10')],'defaultValue':![],'comment':_0xfb46('0x11'),'set':function(_0x47959d){if(!_0x47959d)this['setDataValue'](_0xfb46('0x12'),null);this[_0xfb46('0x13')](_0xfb46('0x14'),_0x47959d);}}}; \ No newline at end of file diff --git a/server/api/faxAccount/faxAccount.controller.js b/server/api/faxAccount/faxAccount.controller.js index dd72278..e387859 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 _0xf934=['rimraf','zip-dir','fast-json-patch','request-promise','moment','util','path','sox','to-csv','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/license/util','../../mysqldb','redis','defaults','localhost','socket.io-emitter','jayson/promise','client','http','request','then','info','FaxAccount,\x20%s,\x20%s','request\x20sent','debug','FaxAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','UserProfileResource','destroy','name','index','Pause','mandatoryDispositionPause','map','rawAttributes','key','model','query','keys','filters','intersection','attributes','fields','length','nolimit','order','sort','pick','filter','merge','where','VIRTUAL','options','FaxAccount','includeAll','findAll','rows','params','include','find','create','user','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','FaxAccounts','UserProfileSection','userProfileId','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','describe','FaxAccountId','Disposition','hasOwnProperty','removeDispositions','addAnswer','CannedAnswer','getAnswers','removeAnswers','ids','addInteraction','FaxInteraction','omit','getInteractions','findOne','CmContact','Contact','User','Owner','fullname','Tag','Tags','color','tag','sequelize','transaction','FaxApplication','findAndCountAll','priority','stack','finally','send','getApplications','context','from-voip-provider','exten','localstationid','type','description','Fax\x20Extension','appdata','push','Answer','Set','ecm','headerinfo','maxrate','t38timeout','FAXOPT(','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','bulkCreate','updateAccountApplications','tech','createdAt','updatedAt','TrunkId','findById','getMessages','split','format','YYYY-MM-DD\x20HH:mm:ss','FaxMessage','CmList','List','Contacts','DESC','attachments','join','root','server/files/attachments','basename','CheckAfterSend','isNil','from','fax','ListId','List\x20not\x20found','Send\x20Fax\x20failed','out','filename','Messages','Contact\x20not\x20found','spread','ContactId','dataValues','SendFax','SendFaxRpc,\x20%s','addAgents','userFaxAccount:save','removeAgents','isArray','emit','userFaxAccount:remove','getAgents'];(function(_0xc42937,_0x542030){var _0x45dd61=function(_0x48376e){while(--_0x48376e){_0xc42937['push'](_0xc42937['shift']());}};_0x45dd61(++_0x542030);}(_0xf934,0xc5));var _0x4f93=function(_0x35885a,_0x42fed7){_0x35885a=_0x35885a-0x0;var _0xe86249=_0xf934[_0x35885a];return _0xe86249;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x4f93('0x0'));var zipdir=require(_0x4f93('0x1'));var jsonpatch=require(_0x4f93('0x2'));var rp=require(_0x4f93('0x3'));var moment=require(_0x4f93('0x4'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0x4f93('0x5'));var path=require(_0x4f93('0x6'));var sox=require(_0x4f93('0x7'));var csv=require(_0x4f93('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x4f93('0x9'));var _=require(_0x4f93('0xa'));var squel=require(_0x4f93('0xb'));var crypto=require(_0x4f93('0xc'));var jsforce=require(_0x4f93('0xd'));var deskjs=require(_0x4f93('0xe'));var toCsv=require(_0x4f93('0x8'));var querystring=require(_0x4f93('0xf'));var Papa=require(_0x4f93('0x10'));var Redis=require('ioredis');var authService=require(_0x4f93('0x11'));var qs=require(_0x4f93('0x12'));var as=require(_0x4f93('0x13'));var hardwareService=require(_0x4f93('0x14'));var logger=require('../../config/logger')(_0x4f93('0x15'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0x4f93('0x16'));var db=require(_0x4f93('0x17'))['db'];config[_0x4f93('0x18')]=_[_0x4f93('0x19')](config['redis'],{'host':_0x4f93('0x1a'),'port':0x18eb});var socket=require(_0x4f93('0x1b'))(new Redis(config[_0x4f93('0x18')]));require('./faxAccount.socket')['register'](socket);var jayson=require(_0x4f93('0x1c'));var client=jayson[_0x4f93('0x1d')][_0x4f93('0x1e')]({'port':0x232c});var client9002=jayson['client'][_0x4f93('0x1e')]({'port':0x232a});function respondWithRpcPromise(_0xc86e66,_0x12591b,_0x339605,_0x503f88){return new BPromise(function(_0xe58170,_0x4e0b43){var _0x4debbb=_0x503f88||client;return _0x4debbb[_0x4f93('0x1f')](_0xc86e66,_0x339605)[_0x4f93('0x20')](function(_0x232192){logger[_0x4f93('0x21')](_0x4f93('0x22'),_0x12591b,_0x4f93('0x23'));logger[_0x4f93('0x24')](_0x4f93('0x25'),_0x12591b,_0x4f93('0x23'),JSON[_0x4f93('0x26')](_0x232192));if(_0x232192[_0x4f93('0x27')]){if(_0x232192[_0x4f93('0x27')][_0x4f93('0x28')]===0x1f4){logger[_0x4f93('0x27')](_0x4f93('0x22'),_0x12591b,_0x232192[_0x4f93('0x27')][_0x4f93('0x29')]);return _0x4e0b43(_0x232192[_0x4f93('0x27')][_0x4f93('0x29')]);}logger[_0x4f93('0x27')](_0x4f93('0x22'),_0x12591b,_0x232192['error'][_0x4f93('0x29')]);return _0xe58170(_0x232192[_0x4f93('0x27')][_0x4f93('0x29')]);}else{logger['info'](_0x4f93('0x22'),_0x12591b,_0x4f93('0x23'));_0xe58170(_0x232192[_0x4f93('0x2a')][_0x4f93('0x29')]);}})[_0x4f93('0x2b')](function(_0x194a68){logger[_0x4f93('0x27')](_0x4f93('0x22'),_0x12591b,_0x194a68);_0x4e0b43(_0x194a68);});});}function respondWithStatusCode(_0x21700f,_0x1e23e2){_0x1e23e2=_0x1e23e2||0xcc;return function(_0x4193f6){if(_0x4193f6){return _0x21700f['sendStatus'](_0x1e23e2);}return _0x21700f[_0x4f93('0x2c')](_0x1e23e2)[_0x4f93('0x2d')]();};}function respondWithResult(_0x1b8cdd,_0x1f5288){_0x1f5288=_0x1f5288||0xc8;return function(_0x5268a6){if(_0x5268a6){return _0x1b8cdd[_0x4f93('0x2c')](_0x1f5288)[_0x4f93('0x2e')](_0x5268a6);}};}function respondWithFilteredResult(_0x4beaa9,_0x3a9f89){return function(_0x3ed960){if(_0x3ed960){var _0x2e59f2=typeof _0x3a9f89[_0x4f93('0x2f')]===_0x4f93('0x30')&&typeof _0x3a9f89[_0x4f93('0x31')]===_0x4f93('0x30');var _0x3a87db=_0x3ed960['count'];var _0x372e5a=_0x2e59f2?0x0:_0x3a9f89[_0x4f93('0x2f')];var _0x4f9b01=_0x2e59f2?_0x3ed960[_0x4f93('0x32')]:_0x3a9f89[_0x4f93('0x2f')]+_0x3a9f89['limit'];var _0x427da6;if(_0x4f9b01>=_0x3a87db){_0x4f9b01=_0x3a87db;_0x427da6=0xc8;}else{_0x427da6=0xce;}_0x4beaa9[_0x4f93('0x2c')](_0x427da6);return _0x4beaa9[_0x4f93('0x33')](_0x4f93('0x34'),_0x372e5a+'-'+_0x4f9b01+'/'+_0x3a87db)['json'](_0x3ed960);}return null;};}function patchUpdates(_0x598bc6){return function(_0x137712){try{jsonpatch[_0x4f93('0x35')](_0x137712,_0x598bc6,!![]);}catch(_0x2325e9){return BPromise[_0x4f93('0x36')](_0x2325e9);}return _0x137712[_0x4f93('0x37')]();};}function saveUpdates(_0x1a5d4a,_0x374b41){return function(_0x5f5b59){if(_0x5f5b59){return _0x5f5b59[_0x4f93('0x38')](_0x1a5d4a)['then'](function(_0x236382){return _0x236382;});}return null;};}function removeEntity(_0x145ca8,_0x43ae8c){return function(_0x37d1b5){if(_0x37d1b5){return _0x37d1b5['destroy']()['then'](function(){var _0x5a8ebf=_0x37d1b5['get']({'plain':!![]});var _0x179136='FaxAccounts';return db[_0x4f93('0x39')][_0x4f93('0x3a')]({'where':{'type':_0x179136,'resourceId':_0x5a8ebf['id']}})[_0x4f93('0x20')](function(){return _0x37d1b5;});})[_0x4f93('0x20')](function(){_0x145ca8[_0x4f93('0x2c')](0xcc)[_0x4f93('0x2d')]();});}};}function handleEntityNotFound(_0xca5547,_0x7a20d1){return function(_0x405deb){if(!_0x405deb){_0xca5547['sendStatus'](0x194);}return _0x405deb;};}function handleError(_0xe03aee,_0x4d9b65){_0x4d9b65=_0x4d9b65||0x1f4;return function(_0xf284ef){logger[_0x4f93('0x27')](_0xf284ef['stack']);if(_0xf284ef[_0x4f93('0x3b')]){delete _0xf284ef[_0x4f93('0x3b')];}_0xe03aee[_0x4f93('0x2c')](_0x4d9b65)['send'](_0xf284ef);};}exports[_0x4f93('0x3c')]=function(_0x224fa7,_0x1c3157){var _0x5715cc={'include':[{'model':db[_0x4f93('0x3d')],'as':_0x4f93('0x3e')}]},_0x217286={},_0x51233f={'count':0x0,'rows':[]};var _0x391e61=_[_0x4f93('0x3f')](db['FaxAccount'][_0x4f93('0x40')],function(_0x4cc8d1){return{'name':_0x4cc8d1['fieldName'],'type':_0x4cc8d1['type'][_0x4f93('0x41')]};});_0x217286[_0x4f93('0x42')]=_[_0x4f93('0x3f')](_0x391e61,_0x4f93('0x3b'));_0x217286[_0x4f93('0x43')]=_[_0x4f93('0x44')](_0x224fa7['query']);_0x217286[_0x4f93('0x45')]=_[_0x4f93('0x46')](_0x217286[_0x4f93('0x42')],_0x217286[_0x4f93('0x43')]);_0x5715cc[_0x4f93('0x47')]=_[_0x4f93('0x46')](_0x217286[_0x4f93('0x42')],qs[_0x4f93('0x48')](_0x224fa7['query'][_0x4f93('0x48')]));_0x5715cc[_0x4f93('0x47')]=_0x5715cc['attributes'][_0x4f93('0x49')]?_0x5715cc['attributes']:_0x217286[_0x4f93('0x42')];if(!_0x224fa7[_0x4f93('0x43')]['hasOwnProperty'](_0x4f93('0x4a'))){_0x5715cc[_0x4f93('0x31')]=qs[_0x4f93('0x31')](_0x224fa7[_0x4f93('0x43')][_0x4f93('0x31')]);_0x5715cc[_0x4f93('0x2f')]=qs['offset'](_0x224fa7[_0x4f93('0x43')][_0x4f93('0x2f')]);}_0x5715cc[_0x4f93('0x4b')]=qs[_0x4f93('0x4c')](_0x224fa7[_0x4f93('0x43')]['sort']);_0x5715cc['where']=qs[_0x4f93('0x45')](_[_0x4f93('0x4d')](_0x224fa7[_0x4f93('0x43')],_0x217286[_0x4f93('0x45')]),_0x391e61);if(_0x224fa7['query'][_0x4f93('0x4e')]){_0x5715cc['where']=_[_0x4f93('0x4f')](_0x5715cc[_0x4f93('0x50')],{'$or':_[_0x4f93('0x3f')](_0x391e61,function(_0x4c45ba){if(_0x4c45ba['type']!==_0x4f93('0x51')){var _0x538f44={};_0x538f44[_0x4c45ba[_0x4f93('0x3b')]]={'$like':'%'+_0x224fa7[_0x4f93('0x43')][_0x4f93('0x4e')]+'%'};return _0x538f44;}})});}_0x5715cc=_[_0x4f93('0x4f')]({},_0x5715cc,_0x224fa7[_0x4f93('0x52')]);var _0x5f0646={'where':_0x5715cc[_0x4f93('0x50')]};return db[_0x4f93('0x53')][_0x4f93('0x32')](_0x5f0646)['then'](function(_0x545af9){_0x51233f[_0x4f93('0x32')]=_0x545af9;if(_0x224fa7[_0x4f93('0x43')][_0x4f93('0x54')]){_0x5715cc['include']=[{'all':!![]}];}return db[_0x4f93('0x53')][_0x4f93('0x55')](_0x5715cc);})[_0x4f93('0x20')](function(_0x4bf796){_0x51233f[_0x4f93('0x56')]=_0x4bf796;return _0x51233f;})['then'](respondWithFilteredResult(_0x1c3157,_0x5715cc))[_0x4f93('0x2b')](handleError(_0x1c3157,null));};exports['show']=function(_0x4d0a99,_0x211682){var _0x12279d={'raw':![],'where':{'id':_0x4d0a99[_0x4f93('0x57')]['id']},'include':[{'model':db['Pause'],'as':_0x4f93('0x3e')}]},_0x506294={};_0x506294['model']=_[_0x4f93('0x44')](db['FaxAccount'][_0x4f93('0x40')]);_0x506294['query']=_[_0x4f93('0x44')](_0x4d0a99[_0x4f93('0x43')]);_0x506294[_0x4f93('0x45')]=_[_0x4f93('0x46')](_0x506294[_0x4f93('0x42')],_0x506294[_0x4f93('0x43')]);_0x12279d[_0x4f93('0x47')]=_['intersection'](_0x506294[_0x4f93('0x42')],qs[_0x4f93('0x48')](_0x4d0a99[_0x4f93('0x43')]['fields']));_0x12279d[_0x4f93('0x47')]=_0x12279d[_0x4f93('0x47')]['length']?_0x12279d['attributes']:_0x506294[_0x4f93('0x42')];if(_0x4d0a99[_0x4f93('0x43')][_0x4f93('0x54')]){_0x12279d[_0x4f93('0x58')]=[{'all':!![]}];}_0x12279d=_['merge']({},_0x12279d,_0x4d0a99[_0x4f93('0x52')]);return db[_0x4f93('0x53')][_0x4f93('0x59')](_0x12279d)[_0x4f93('0x20')](handleEntityNotFound(_0x211682,null))[_0x4f93('0x20')](respondWithResult(_0x211682,null))['catch'](handleError(_0x211682,null));};exports['create']=function(_0x3f8fae,_0x2d532d){return db[_0x4f93('0x53')][_0x4f93('0x5a')](_0x3f8fae['body'],{})['then'](function(_0x240635){var _0xd60093=_0x3f8fae[_0x4f93('0x5b')][_0x4f93('0x5c')]({'plain':!![]});if(!_0xd60093)throw new Error(_0x4f93('0x5d'));if(_0xd60093[_0x4f93('0x5e')]==='user'){var _0x299aa4=_0x240635[_0x4f93('0x5c')]({'plain':!![]});var _0xdd832e=_0x4f93('0x5f');return db[_0x4f93('0x60')][_0x4f93('0x59')]({'where':{'name':_0xdd832e,'userProfileId':_0xd60093[_0x4f93('0x61')]},'raw':!![]})[_0x4f93('0x20')](function(_0xfbbd83){if(_0xfbbd83&&_0xfbbd83['autoAssociation']===0x0){return db['UserProfileResource'][_0x4f93('0x5a')]({'name':_0x299aa4[_0x4f93('0x3b')],'resourceId':_0x299aa4['id'],'type':_0xfbbd83[_0x4f93('0x3b')],'sectionId':_0xfbbd83['id']},{})[_0x4f93('0x20')](function(){return _0x240635;});}else{return _0x240635;}})['catch'](function(_0x2886e2){logger[_0x4f93('0x27')](_0x4f93('0x62'),_0x2886e2);throw _0x2886e2;});}return _0x240635;})[_0x4f93('0x20')](respondWithResult(_0x2d532d,0xc9))['catch'](handleError(_0x2d532d,null));};exports[_0x4f93('0x38')]=function(_0x2e1ae3,_0x36bbfa){if(_0x2e1ae3[_0x4f93('0x63')]['id']){delete _0x2e1ae3[_0x4f93('0x63')]['id'];}return db['FaxAccount'][_0x4f93('0x59')]({'where':{'id':_0x2e1ae3['params']['id']},'include':[{'model':db[_0x4f93('0x3d')],'as':_0x4f93('0x3e')}]})['then'](handleEntityNotFound(_0x36bbfa,null))[_0x4f93('0x20')](saveUpdates(_0x2e1ae3[_0x4f93('0x63')],null))[_0x4f93('0x20')](respondWithResult(_0x36bbfa,null))[_0x4f93('0x2b')](handleError(_0x36bbfa,null));};exports[_0x4f93('0x3a')]=function(_0x2cfd2b,_0x48e004){return db[_0x4f93('0x53')][_0x4f93('0x59')]({'where':{'id':_0x2cfd2b[_0x4f93('0x57')]['id']}})[_0x4f93('0x20')](handleEntityNotFound(_0x48e004,null))[_0x4f93('0x20')](removeEntity(_0x48e004,null))[_0x4f93('0x2b')](handleError(_0x48e004,null));};exports[_0x4f93('0x64')]=function(_0x525d67,_0x2b51d0){return db['FaxAccount']['describe']()[_0x4f93('0x20')](respondWithResult(_0x2b51d0,null))['catch'](handleError(_0x2b51d0,null));};exports['addDisposition']=function(_0x51dff2,_0x1529c8,_0x48f8ca){if(_0x51dff2['body']['id']){delete _0x51dff2[_0x4f93('0x63')]['id'];}return db[_0x4f93('0x53')][_0x4f93('0x59')]({'where':{'id':_0x51dff2['params']['id']}})['then'](handleEntityNotFound(_0x1529c8,null))['then'](function(_0x5e3c6b){if(_0x5e3c6b){_0x51dff2['body'][_0x4f93('0x65')]=_0x5e3c6b['id'];return db[_0x4f93('0x66')][_0x4f93('0x5a')](_0x51dff2[_0x4f93('0x63')]);}})[_0x4f93('0x20')](respondWithResult(_0x1529c8,null))[_0x4f93('0x2b')](handleError(_0x1529c8,null));};exports['getDispositions']=function(_0x32b404,_0x818a2b,_0x1bd77f){var _0x7bc060={'raw':![],'where':{}};var _0x110dd3={};var _0x2c511b={'count':0x0,'rows':[]};return db['FaxAccount']['findOne']({'where':{'id':_0x32b404[_0x4f93('0x57')]['id']}})[_0x4f93('0x20')](handleEntityNotFound(_0x818a2b,null))[_0x4f93('0x20')](function(_0x34fc8a){if(_0x34fc8a){_0x110dd3['model']=_[_0x4f93('0x44')](db[_0x4f93('0x66')][_0x4f93('0x40')]);_0x110dd3[_0x4f93('0x43')]=_[_0x4f93('0x44')](_0x32b404['query']);_0x110dd3[_0x4f93('0x45')]=_['intersection'](_0x110dd3[_0x4f93('0x42')],_0x110dd3[_0x4f93('0x43')]);_0x7bc060[_0x4f93('0x47')]=_['intersection'](_0x110dd3[_0x4f93('0x42')],qs['fields'](_0x32b404[_0x4f93('0x43')][_0x4f93('0x48')]));_0x7bc060[_0x4f93('0x47')]=_0x7bc060[_0x4f93('0x47')][_0x4f93('0x49')]?_0x7bc060[_0x4f93('0x47')]:_0x110dd3[_0x4f93('0x42')];if(!_0x32b404[_0x4f93('0x43')][_0x4f93('0x67')](_0x4f93('0x4a'))){_0x7bc060[_0x4f93('0x31')]=qs[_0x4f93('0x31')](_0x32b404[_0x4f93('0x43')][_0x4f93('0x31')]);_0x7bc060[_0x4f93('0x2f')]=qs['offset'](_0x32b404[_0x4f93('0x43')][_0x4f93('0x2f')]);}_0x7bc060['order']=qs[_0x4f93('0x4c')](_0x32b404[_0x4f93('0x43')]['sort']);_0x7bc060[_0x4f93('0x50')]=qs[_0x4f93('0x45')](_[_0x4f93('0x4d')](_0x32b404[_0x4f93('0x43')],_0x110dd3[_0x4f93('0x45')]));_0x7bc060['where'][_0x4f93('0x65')]=_0x34fc8a['id'];if(_0x32b404[_0x4f93('0x43')][_0x4f93('0x4e')]){_0x7bc060['where']=_[_0x4f93('0x4f')](_0x7bc060[_0x4f93('0x50')],{'$or':_['map'](_0x7bc060[_0x4f93('0x47')],function(_0x48e7f9){var _0xb22709={};_0xb22709[_0x48e7f9]={'$like':'%'+_0x32b404[_0x4f93('0x43')]['filter']+'%'};return _0xb22709;})});}_0x7bc060=_[_0x4f93('0x4f')]({},_0x7bc060,_0x32b404[_0x4f93('0x52')]);return db[_0x4f93('0x66')][_0x4f93('0x32')]({'where':_0x7bc060[_0x4f93('0x50')]})[_0x4f93('0x20')](function(_0x4ded3f){_0x2c511b['count']=_0x4ded3f;if(_0x32b404[_0x4f93('0x43')][_0x4f93('0x54')]){_0x7bc060[_0x4f93('0x58')]=[{'all':!![]}];}return db['Disposition'][_0x4f93('0x55')](_0x7bc060);})[_0x4f93('0x20')](function(_0x2d3a4b){_0x2c511b[_0x4f93('0x56')]=_0x2d3a4b;return _0x2c511b;});}})['then'](respondWithFilteredResult(_0x818a2b,_0x7bc060))['catch'](handleError(_0x818a2b,null));};exports[_0x4f93('0x68')]=function(_0x3250f2,_0x38423c,_0x2838f8){return db[_0x4f93('0x53')][_0x4f93('0x59')]({'where':{'id':_0x3250f2['params']['id']}})[_0x4f93('0x20')](handleEntityNotFound(_0x38423c,null))['then'](function(_0x4e3486){if(_0x4e3486){return _0x4e3486['removeDispositions'](_0x3250f2[_0x4f93('0x43')]['ids']);}})[_0x4f93('0x20')](respondWithStatusCode(_0x38423c,null))[_0x4f93('0x2b')](handleError(_0x38423c,null));};exports[_0x4f93('0x69')]=function(_0x49fcd8,_0x48c8c6,_0x19627d){if(_0x49fcd8[_0x4f93('0x63')]['id']){delete _0x49fcd8['body']['id'];}return db[_0x4f93('0x53')]['find']({'where':{'id':_0x49fcd8[_0x4f93('0x57')]['id']}})[_0x4f93('0x20')](handleEntityNotFound(_0x48c8c6,null))[_0x4f93('0x20')](function(_0x598862){if(_0x598862){_0x49fcd8[_0x4f93('0x63')]['FaxAccountId']=_0x598862['id'];return db[_0x4f93('0x6a')]['create'](_0x49fcd8['body']);}})[_0x4f93('0x20')](respondWithResult(_0x48c8c6,null))['catch'](handleError(_0x48c8c6,null));};exports[_0x4f93('0x6b')]=function(_0x372dd6,_0x4c4f16,_0x2f24e4){var _0x24782f={'raw':![],'where':{}};var _0x2bb2b9={};var _0x57c713={'count':0x0,'rows':[]};return db[_0x4f93('0x53')]['findOne']({'where':{'id':_0x372dd6[_0x4f93('0x57')]['id']}})['then'](handleEntityNotFound(_0x4c4f16,null))[_0x4f93('0x20')](function(_0xf19030){if(_0xf19030){_0x2bb2b9['model']=_[_0x4f93('0x44')](db[_0x4f93('0x6a')]['rawAttributes']);_0x2bb2b9[_0x4f93('0x43')]=_[_0x4f93('0x44')](_0x372dd6[_0x4f93('0x43')]);_0x2bb2b9['filters']=_[_0x4f93('0x46')](_0x2bb2b9['model'],_0x2bb2b9[_0x4f93('0x43')]);_0x24782f['attributes']=_[_0x4f93('0x46')](_0x2bb2b9[_0x4f93('0x42')],qs['fields'](_0x372dd6['query']['fields']));_0x24782f[_0x4f93('0x47')]=_0x24782f[_0x4f93('0x47')][_0x4f93('0x49')]?_0x24782f[_0x4f93('0x47')]:_0x2bb2b9['model'];if(!_0x372dd6[_0x4f93('0x43')][_0x4f93('0x67')]('nolimit')){_0x24782f[_0x4f93('0x31')]=qs['limit'](_0x372dd6[_0x4f93('0x43')][_0x4f93('0x31')]);_0x24782f[_0x4f93('0x2f')]=qs[_0x4f93('0x2f')](_0x372dd6[_0x4f93('0x43')][_0x4f93('0x2f')]);}_0x24782f[_0x4f93('0x4b')]=qs['sort'](_0x372dd6[_0x4f93('0x43')][_0x4f93('0x4c')]);_0x24782f[_0x4f93('0x50')]=qs[_0x4f93('0x45')](_['pick'](_0x372dd6[_0x4f93('0x43')],_0x2bb2b9[_0x4f93('0x45')]));_0x24782f[_0x4f93('0x50')][_0x4f93('0x65')]=_0xf19030['id'];if(_0x372dd6[_0x4f93('0x43')][_0x4f93('0x4e')]){_0x24782f['where']=_[_0x4f93('0x4f')](_0x24782f[_0x4f93('0x50')],{'$or':_[_0x4f93('0x3f')](_0x24782f[_0x4f93('0x47')],function(_0x4e8fca){var _0x1ebcc7={};_0x1ebcc7[_0x4e8fca]={'$like':'%'+_0x372dd6[_0x4f93('0x43')][_0x4f93('0x4e')]+'%'};return _0x1ebcc7;})});}_0x24782f=_[_0x4f93('0x4f')]({},_0x24782f,_0x372dd6[_0x4f93('0x52')]);return db['CannedAnswer'][_0x4f93('0x32')]({'where':_0x24782f['where']})[_0x4f93('0x20')](function(_0x52aaf6){_0x57c713['count']=_0x52aaf6;if(_0x372dd6[_0x4f93('0x43')][_0x4f93('0x54')]){_0x24782f[_0x4f93('0x58')]=[{'all':!![]}];}return db[_0x4f93('0x6a')]['findAll'](_0x24782f);})[_0x4f93('0x20')](function(_0x192956){_0x57c713[_0x4f93('0x56')]=_0x192956;return _0x57c713;});}})[_0x4f93('0x20')](respondWithFilteredResult(_0x4c4f16,_0x24782f))[_0x4f93('0x2b')](handleError(_0x4c4f16,null));};exports[_0x4f93('0x6c')]=function(_0x11ba47,_0x683daf,_0x1758e1){return db[_0x4f93('0x53')][_0x4f93('0x59')]({'where':{'id':_0x11ba47[_0x4f93('0x57')]['id']}})[_0x4f93('0x20')](handleEntityNotFound(_0x683daf,null))[_0x4f93('0x20')](function(_0x50e6da){if(_0x50e6da){return _0x50e6da[_0x4f93('0x6c')](_0x11ba47['query'][_0x4f93('0x6d')]);}})['then'](respondWithStatusCode(_0x683daf,null))[_0x4f93('0x2b')](handleError(_0x683daf,null));};exports[_0x4f93('0x6e')]=function(_0xbe9342,_0x6f1fab,_0x42e00e){return db[_0x4f93('0x6f')]['find']({'where':{'id':_0xbe9342[_0x4f93('0x57')]['id']}})[_0x4f93('0x20')](handleEntityNotFound(_0x6f1fab,null))[_0x4f93('0x20')](function(_0x3d3e72){if(_0x3d3e72){return _0x3d3e72[_0x4f93('0x6e')](_0xbe9342[_0x4f93('0x63')][_0x4f93('0x6d')],_[_0x4f93('0x70')](_0xbe9342['body'],[_0x4f93('0x6d'),'id'])||{});}})[_0x4f93('0x20')](respondWithResult(_0x6f1fab,null))[_0x4f93('0x2b')](handleError(_0x6f1fab,null));};exports[_0x4f93('0x71')]=function(_0x4f55c3,_0x37f7e9,_0x288027){var _0x4506f7={'raw':![],'where':{}};var _0x16f127={};var _0x85a5a9={'count':0x0,'rows':[]};return db[_0x4f93('0x53')][_0x4f93('0x72')]({'where':{'id':_0x4f55c3['params']['id']}})[_0x4f93('0x20')](handleEntityNotFound(_0x37f7e9,null))['then'](function(_0x4c5069){if(_0x4c5069){_0x16f127[_0x4f93('0x42')]=_[_0x4f93('0x44')](db[_0x4f93('0x6f')][_0x4f93('0x40')]);_0x16f127[_0x4f93('0x43')]=_[_0x4f93('0x44')](_0x4f55c3['query']);_0x16f127['filters']=_[_0x4f93('0x46')](_0x16f127[_0x4f93('0x42')],_0x16f127['query']);_0x4506f7[_0x4f93('0x47')]=_['intersection'](_0x16f127[_0x4f93('0x42')],qs[_0x4f93('0x48')](_0x4f55c3['query']['fields']));_0x4506f7[_0x4f93('0x47')]=_0x4506f7['attributes'][_0x4f93('0x49')]?_0x4506f7[_0x4f93('0x47')]:_0x16f127[_0x4f93('0x42')];if(!_0x4f55c3[_0x4f93('0x43')][_0x4f93('0x67')](_0x4f93('0x4a'))){_0x4506f7[_0x4f93('0x31')]=qs[_0x4f93('0x31')](_0x4f55c3[_0x4f93('0x43')][_0x4f93('0x31')]);_0x4506f7['offset']=qs[_0x4f93('0x2f')](_0x4f55c3['query'][_0x4f93('0x2f')]);}_0x4506f7[_0x4f93('0x4b')]=qs['sort'](_0x4f55c3[_0x4f93('0x43')]['sort']);_0x4506f7[_0x4f93('0x50')]=qs['filters'](_[_0x4f93('0x4d')](_0x4f55c3[_0x4f93('0x43')],_0x16f127['filters']));_0x4506f7['where'][_0x4f93('0x65')]=_0x4c5069['id'];if(_0x4f55c3['query'][_0x4f93('0x4e')]){_0x4506f7[_0x4f93('0x50')]=_['merge'](_0x4506f7[_0x4f93('0x50')],{'$or':_[_0x4f93('0x3f')](_0x4506f7[_0x4f93('0x47')],function(_0x307fcc){var _0x2ccbdc={};_0x2ccbdc[_0x307fcc]={'$like':'%'+_0x4f55c3[_0x4f93('0x43')][_0x4f93('0x4e')]+'%'};return _0x2ccbdc;})});}_0x4506f7=_[_0x4f93('0x4f')]({},_0x4506f7,_0x4f55c3['options']);return db[_0x4f93('0x6f')][_0x4f93('0x32')]({'where':_0x4506f7['where']})[_0x4f93('0x20')](function(_0x18ab29){_0x85a5a9['count']=_0x18ab29;if(_0x4f55c3['query'][_0x4f93('0x54')]){_0x4506f7[_0x4f93('0x58')]=[{'model':db[_0x4f93('0x73')],'as':_0x4f93('0x74'),'required':![]},{'model':db[_0x4f93('0x75')],'as':_0x4f93('0x76'),'attributes':['name',_0x4f93('0x77'),'internal'],'required':![]},{'model':db[_0x4f93('0x78')],'as':_0x4f93('0x79'),'attributes':['id',_0x4f93('0x3b'),_0x4f93('0x7a')],'where':_0x4f55c3[_0x4f93('0x43')][_0x4f93('0x7b')]?{'id':_0x4f55c3[_0x4f93('0x43')]['tag']}:undefined,'required':_0x4f55c3['query'][_0x4f93('0x7b')]?!![]:![]}];}return db[_0x4f93('0x6f')][_0x4f93('0x55')](_0x4506f7);})[_0x4f93('0x20')](function(_0x29ee68){_0x85a5a9[_0x4f93('0x56')]=_0x29ee68;return _0x85a5a9;});}})[_0x4f93('0x20')](respondWithFilteredResult(_0x37f7e9,_0x4506f7))[_0x4f93('0x2b')](handleError(_0x37f7e9,null));};exports['addApplications']=function(_0x149eba,_0x2b88f3){var _0x3a6f88=_0x149eba[_0x4f93('0x57')]['id'];var _0x44ba94=_0x149eba[_0x4f93('0x63')];var _0x3d85be=0xc8;var _0x2ff929=null;return db[_0x4f93('0x7c')][_0x4f93('0x7d')]({'isolationLevel':db[_0x4f93('0x7c')]['Transaction']['ISOLATION_LEVELS']['READ_COMMITTED']},function(_0x4b793c){return db[_0x4f93('0x53')]['findOne']({'where':{'id':_0x3a6f88},'transaction':_0x4b793c})[_0x4f93('0x20')](function(_0x3ec93d){if(_0x3ec93d){return db[_0x4f93('0x7e')][_0x4f93('0x3a')]({'where':{'FaxAccountId':_0x3a6f88},'transaction':_0x4b793c})[_0x4f93('0x20')](function(){var _0x172638=_[_0x4f93('0x3f')](_0x44ba94,function(_0x4d12d5){_0x4d12d5[_0x4f93('0x65')]=_0x3a6f88;return _0x4d12d5;});return db[_0x4f93('0x7e')]['bulkCreate'](_0x172638,{'transaction':_0x4b793c});});}else{_0x3d85be=0x194;_0x2ff929=[];}});})[_0x4f93('0x20')](function(){if(_0x3d85be!==0x194){return db[_0x4f93('0x7e')][_0x4f93('0x7f')]({'where':{'FaxAccountId':_0x3a6f88},'order':_0x4f93('0x80')})[_0x4f93('0x20')](function(_0x51b77b){_0x2ff929=_0x51b77b;});}})[_0x4f93('0x2b')](function(_0x491d63){_0x3d85be=0x1f4;logger[_0x4f93('0x27')](_0x491d63[_0x4f93('0x81')]);if(_0x491d63[_0x4f93('0x3b')]){delete _0x491d63[_0x4f93('0x3b')];}_0x2ff929=_0x491d63;})[_0x4f93('0x82')](function(){if(_0x2ff929===null){_0x2b88f3['sendStatus'](_0x3d85be);}else{if(_0x3d85be===0x1f4){_0x2b88f3['status'](_0x3d85be)[_0x4f93('0x83')](_0x2ff929);}else{_0x2b88f3['status'](_0x3d85be)[_0x4f93('0x2e')](_0x2ff929);}}});};exports[_0x4f93('0x84')]=function(_0x465d25,_0x2284c6,_0x378b52){var _0xaf0211={};var _0x3969f6={};var _0x83f4a9;var _0x57226f;return db[_0x4f93('0x53')]['findOne']({'where':{'id':_0x465d25[_0x4f93('0x57')]['id']}})[_0x4f93('0x20')](handleEntityNotFound(_0x2284c6,null))['then'](function(_0x4e2d22){if(_0x4e2d22){_0x83f4a9=_0x4e2d22;_0x3969f6['model']=_['keys'](db[_0x4f93('0x7e')]['rawAttributes']);_0x3969f6[_0x4f93('0x43')]=_[_0x4f93('0x44')](_0x465d25[_0x4f93('0x43')]);_0x3969f6[_0x4f93('0x45')]=_[_0x4f93('0x46')](_0x3969f6[_0x4f93('0x42')],_0x3969f6['query']);_0xaf0211[_0x4f93('0x47')]=_[_0x4f93('0x46')](_0x3969f6['model'],qs['fields'](_0x465d25[_0x4f93('0x43')][_0x4f93('0x48')]));_0xaf0211[_0x4f93('0x47')]=_0xaf0211[_0x4f93('0x47')]['length']?_0xaf0211[_0x4f93('0x47')]:_0x3969f6[_0x4f93('0x42')];_0xaf0211['order']=qs[_0x4f93('0x4c')](_0x465d25[_0x4f93('0x43')][_0x4f93('0x4c')]);_0xaf0211[_0x4f93('0x50')]=qs[_0x4f93('0x45')](_[_0x4f93('0x4d')](_0x465d25[_0x4f93('0x43')],_0x3969f6[_0x4f93('0x45')]));if(_0x465d25['query'][_0x4f93('0x4e')]){_0xaf0211[_0x4f93('0x50')]=_[_0x4f93('0x4f')](_0xaf0211[_0x4f93('0x50')],{'$or':_[_0x4f93('0x3f')](_0xaf0211[_0x4f93('0x47')],function(_0x4c8a5c){var _0x2a17e1={};_0x2a17e1[_0x4c8a5c]={'$like':'%'+_0x465d25[_0x4f93('0x43')][_0x4f93('0x4e')]+'%'};return _0x2a17e1;})});}_0xaf0211=_[_0x4f93('0x4f')]({},_0xaf0211,_0x465d25[_0x4f93('0x52')]);return _0x83f4a9[_0x4f93('0x84')](_0xaf0211);}})['then'](function(_0x13632e){if(_0x13632e){_0x57226f=_0x13632e[_0x4f93('0x49')];if(!_0x465d25[_0x4f93('0x43')][_0x4f93('0x67')]('nolimit')){_0xaf0211[_0x4f93('0x31')]=qs[_0x4f93('0x31')](_0x465d25['query'][_0x4f93('0x31')]);_0xaf0211['offset']=qs['offset'](_0x465d25['query'][_0x4f93('0x2f')]);}return _0x83f4a9['getApplications'](_0xaf0211);}})['then'](function(_0x3e8d1c){if(_0x3e8d1c){return _0x3e8d1c?{'count':_0x57226f,'rows':_0x3e8d1c}:null;}})[_0x4f93('0x20')](respondWithResult(_0x2284c6,null))[_0x4f93('0x2b')](handleError(_0x2284c6,null));};function Extension(_0x51df8d,_0x1045e3,_0x307c51,_0x645b92){this[_0x4f93('0x85')]=_0x4f93('0x86');this[_0x4f93('0x87')]=_0x51df8d[_0x4f93('0x88')];this['app']=_0x645b92;this[_0x4f93('0x89')]='system';this[_0x4f93('0x8a')]=_0x4f93('0x8b');this[_0x4f93('0x65')]=_0x51df8d['id'];this[_0x4f93('0x80')]=_0x1045e3;this[_0x4f93('0x8c')]=_0x307c51;}function createExtensionsReciveFax(_0x7e082f){var _0x50c0ff=0x1;var _0x5edd72=[];_0x5edd72[_0x4f93('0x8d')](new Extension(_0x7e082f,_0x50c0ff,'',_0x4f93('0x8e')));_0x50c0ff+=0x1;_0x5edd72[_0x4f93('0x8d')](new Extension(_0x7e082f,_0x50c0ff,'CDR(type)=inbound-fax',_0x4f93('0x8f')));_0x50c0ff+=0x1;for(var _0x369b99 in _0x7e082f){if(_0x7e082f[_0x4f93('0x67')](_0x369b99)&&(_0x369b99===_0x4f93('0x90')||_0x369b99===_0x4f93('0x88')||_0x369b99==='gateway'||_0x369b99==='faxdetect'||_0x369b99===_0x4f93('0x91')||_0x369b99===_0x4f93('0x92')||_0x369b99==='minrate'||_0x369b99==='modem'||_0x369b99===_0x4f93('0x93'))){_0x5edd72[_0x4f93('0x8d')](new Extension(_0x7e082f,_0x50c0ff,_0x4f93('0x94')+_0x369b99+')='+_0x7e082f[_0x369b99],'Set'));_0x50c0ff+=0x1;}}_0x5edd72['push'](new Extension(_0x7e082f,_0x50c0ff,'6',_0x4f93('0x95')));_0x50c0ff+=0x1;_0x5edd72[_0x4f93('0x8d')](new Extension(_0x7e082f,_0x50c0ff,_0x4f93('0x96'),_0x4f93('0x97')));_0x50c0ff=0x0;return _0x5edd72;}exports['addAccountApplications']=function(_0x560b17,_0x3cbc0e,_0x1897c8){var _0x43774a;return db[_0x4f93('0x7c')][_0x4f93('0x7d')](function(_0xa3cb04){return db[_0x4f93('0x53')][_0x4f93('0x5a')](_0x560b17['body'],{'transaction':_0xa3cb04})[_0x4f93('0x20')](function(_0x17d72d){_0x43774a=_0x17d72d[_0x4f93('0x5c')]({'plain':!![]});return db[_0x4f93('0x98')][_0x4f93('0x99')](createExtensionsReciveFax(_0x43774a),{'transaction':_0xa3cb04});});})[_0x4f93('0x20')](function(){return _0x43774a;})[_0x4f93('0x20')](respondWithResult(_0x3cbc0e,null))['catch'](handleError(_0x3cbc0e,null));};exports[_0x4f93('0x9a')]=function(_0x19006b,_0x440c69,_0x1cb5a1){var _0x25e589;return db[_0x4f93('0x7c')][_0x4f93('0x7d')](function(_0x20c2b8){return db[_0x4f93('0x53')][_0x4f93('0x38')](_0x19006b[_0x4f93('0x63')],{'where':{'id':_0x19006b[_0x4f93('0x63')]['id']},'transaction':_0x20c2b8})[_0x4f93('0x20')](function(_0x1b7b91){return db['VoiceExtension'][_0x4f93('0x3a')]({'where':{'FaxAccountId':_0x19006b[_0x4f93('0x63')]['id']},'transaction':_0x20c2b8})[_0x4f93('0x20')](function(_0x28bd4b){return db['VoiceExtension'][_0x4f93('0x99')](createExtensionsReciveFax(_['omit'](_0x19006b[_0x4f93('0x63')],[_0x4f93('0x9b'),_0x4f93('0x41'),_0x4f93('0x9c'),_0x4f93('0x9d'),_0x4f93('0x9e'),'ListId'])),{'transaction':_0x20c2b8});});});})[_0x4f93('0x20')](function(){return db[_0x4f93('0x53')][_0x4f93('0x9f')](_0x19006b[_0x4f93('0x63')]['id']);})[_0x4f93('0x20')](respondWithResult(_0x440c69,null))[_0x4f93('0x2b')](handleError(_0x440c69,null));};exports[_0x4f93('0xa0')]=function(_0x3b673d,_0x39f36d,_0x273ea2){var _0x123ae8={'raw':!![],'where':{}};var _0x19fe55={};var _0x5027d2={'count':0x0,'rows':[]};return db['FaxAccount'][_0x4f93('0x72')]({'where':{'id':_0x3b673d['params']['id']}})[_0x4f93('0x20')](handleEntityNotFound(_0x39f36d,null))[_0x4f93('0x20')](function(_0x4ccd73){if(_0x4ccd73){_0x19fe55['model']=_[_0x4f93('0x44')](db['FaxMessage'][_0x4f93('0x40')]);_0x19fe55[_0x4f93('0x43')]=_[_0x4f93('0x44')](_0x3b673d['query']);_0x19fe55[_0x4f93('0x45')]=_[_0x4f93('0x46')](_0x19fe55[_0x4f93('0x42')],_0x19fe55['query']);_0x123ae8[_0x4f93('0x47')]=_[_0x4f93('0x46')](_0x19fe55[_0x4f93('0x42')],qs[_0x4f93('0x48')](_0x3b673d['query'][_0x4f93('0x48')]));_0x123ae8['attributes']=_0x123ae8[_0x4f93('0x47')]['length']?_0x123ae8[_0x4f93('0x47')]:_0x19fe55['model'];if(!_0x3b673d[_0x4f93('0x43')][_0x4f93('0x67')](_0x4f93('0x4a'))){_0x123ae8[_0x4f93('0x31')]=qs[_0x4f93('0x31')](_0x3b673d[_0x4f93('0x43')][_0x4f93('0x31')]);_0x123ae8[_0x4f93('0x2f')]=qs[_0x4f93('0x2f')](_0x3b673d[_0x4f93('0x43')]['offset']);}_0x123ae8[_0x4f93('0x4b')]=qs['sort'](_0x3b673d[_0x4f93('0x43')][_0x4f93('0x4c')]);_0x123ae8[_0x4f93('0x50')]=qs[_0x4f93('0x45')](_[_0x4f93('0x4d')](_0x3b673d['query'],_0x19fe55['filters']));_0x123ae8[_0x4f93('0x50')][_0x4f93('0x65')]=_0x4ccd73['id'];if(_0x3b673d[_0x4f93('0x43')][_0x4f93('0x4e')]){_0x123ae8[_0x4f93('0x50')]=_[_0x4f93('0x4f')](_0x123ae8['where'],{'$or':_[_0x4f93('0x3f')](_0x123ae8[_0x4f93('0x47')],function(_0x3fe584){var _0x23d085={};_0x23d085[_0x3fe584]={'$like':'%'+_0x3b673d[_0x4f93('0x43')][_0x4f93('0x4e')]+'%'};return _0x23d085;})});}if(_0x3b673d[_0x4f93('0x43')]['$gte']){var _0xc3805c=_0x3b673d[_0x4f93('0x43')]['$gte'][_0x4f93('0xa1')](',');var _0x3624f1={};_0x3624f1[_0xc3805c[0x0]]={'$gte':moment(_0xc3805c[0x1])[_0x4f93('0xa2')](_0x4f93('0xa3'))};_0x123ae8[_0x4f93('0x50')]=_[_0x4f93('0x4f')](_0x123ae8[_0x4f93('0x50')],_0x3624f1);}_0x123ae8=_[_0x4f93('0x4f')]({},_0x123ae8,_0x3b673d['options']);return db[_0x4f93('0xa4')][_0x4f93('0x32')]({'where':_0x123ae8[_0x4f93('0x50')]})['then'](function(_0x104701){_0x5027d2[_0x4f93('0x32')]=_0x104701;if(_0x3b673d[_0x4f93('0x43')][_0x4f93('0x54')]){_0x123ae8['include']=[{'all':!![]}];}return db[_0x4f93('0xa4')][_0x4f93('0x55')](_0x123ae8);})[_0x4f93('0x20')](function(_0x1373d7){_0x5027d2[_0x4f93('0x56')]=_0x1373d7;return _0x5027d2;});}})[_0x4f93('0x20')](respondWithFilteredResult(_0x39f36d,_0x123ae8))[_0x4f93('0x2b')](handleError(_0x39f36d,null));};exports['send']=function(_0x333479,_0x21ec00,_0x4358fa){var _0x2575d5,_0x3d9849={},_0x38fa98;if(_0x333479['body']['to']){_0x38fa98=_0x333479['body']['to'][0x0];}return db[_0x4f93('0x53')][_0x4f93('0x59')]({'where':{'id':_0x333479[_0x4f93('0x57')]['id']},'include':[{'model':db[_0x4f93('0xa5')],'as':_0x4f93('0xa6'),'include':[{'model':db['CmContact'],'as':_0x4f93('0xa7'),'where':{'fax':_0x38fa98},'limit':0x1,'order':[['updatedAt',_0x4f93('0xa8')]]}]}]})[_0x4f93('0x20')](handleEntityNotFound(_0x21ec00,null))[_0x4f93('0x20')](function(_0x15f8d4){_0x2575d5=_0x15f8d4;if(_0x333479['body'][_0x4f93('0xa9')]&&_0x333479[_0x4f93('0x63')][_0x4f93('0xa9')][_0x4f93('0x49')]){for(var _0x10eb25=0x0;_0x10eb25<_0x333479[_0x4f93('0x63')]['attachments'][_0x4f93('0x49')];_0x10eb25+=0x1){_0x333479['body'][_0x4f93('0xa9')][_0x10eb25]={'filename':_0x333479[_0x4f93('0x63')][_0x4f93('0xa9')][_0x10eb25][_0x4f93('0x3b')],'id':_0x333479['body'][_0x4f93('0xa9')][_0x10eb25]['id'],'path':path[_0x4f93('0xaa')](config[_0x4f93('0xab')],_0x4f93('0xac'),_0x333479['body'][_0x4f93('0xa9')][_0x10eb25][_0x4f93('0xad')])};}}return respondWithRpcPromise(_0x4f93('0xae'),'CheckAfterSend',{'FaxAccountId':_[_0x4f93('0xaf')](_0x333479[_0x4f93('0x57')]['id'])?undefined:_0x333479[_0x4f93('0x57')]['id'],'path':_['isNil'](_0x333479[_0x4f93('0x63')][_0x4f93('0xa9')][0x0]['path'])?undefined:_0x333479['body']['attachments'][0x0][_0x4f93('0x6')],'fax':_[_0x4f93('0xaf')](_0x333479[_0x4f93('0x63')]['to'][0x0])?undefined:_0x333479[_0x4f93('0x63')]['to'][0x0]},client9002);})[_0x4f93('0x20')](function(){if(_0x2575d5){if(_[_0x4f93('0xaf')](_0x333479[_0x4f93('0x63')][_0x4f93('0xb0')])){_0x333479[_0x4f93('0x63')][_0x4f93('0xb0')]=util[_0x4f93('0xa2')]('\x22%s\x22\x20<%s>',_0x2575d5[_0x4f93('0x3b')],_0x2575d5[_0x4f93('0xb1')]);}if(_0x2575d5[_0x4f93('0xa6')]){if(_0x2575d5[_0x4f93('0xa6')][_0x4f93('0xa7')][_0x4f93('0x49')]){return _0x2575d5[_0x4f93('0xa6')][_0x4f93('0xa7')][0x0];}else{return db[_0x4f93('0x73')][_0x4f93('0x5a')](_['defaults'](_0x333479[_0x4f93('0x63')],{'firstName':_0x333479[_0x4f93('0x63')]['to'][0x0],'phone':_0x333479[_0x4f93('0x63')]['to'][0x0],'fax':_0x333479[_0x4f93('0x63')]['to'][0x0],'ListId':_0x2575d5[_0x4f93('0xb2')]}));}}else{throw new Error(_0x4f93('0xb3'));}}else{throw new Error(_0x4f93('0xb4'));}})[_0x4f93('0x20')](function(_0x5718e1){if(_0x5718e1){return db[_0x4f93('0x6f')][_0x4f93('0x59')]({'where':{'ContactId':_0x5718e1['id'],'closed':![],'FaxAccountId':_0x2575d5['id']}})['then'](function(_0x46c924){if(_0x46c924){return[_0x46c924,![]];}return db[_0x4f93('0x6f')][_0x4f93('0x5a')]({'UserId':_0x333479[_0x4f93('0x5b')]['id'],'ContactId':_0x5718e1['id'],'FaxAccountId':_0x2575d5['id'],'fax':_0x333479[_0x4f93('0x63')]['to'][0x0],'firstMsgDirection':_0x4f93('0xb5'),'Messages':[_[_0x4f93('0x4f')](_0x333479[_0x4f93('0x63')],{'read':![],'body':_0x333479[_0x4f93('0x63')][_0x4f93('0xa9')][0x0][_0x4f93('0xb6')],'FaxAccountId':_0x2575d5['id'],'UserId':_0x333479[_0x4f93('0x5b')]['id'],'ContactId':_0x5718e1['id'],'AttachmentId':_0x333479[_0x4f93('0x63')][_0x4f93('0xa9')][0x0]['id']})]},{'include':[{'model':db[_0x4f93('0xa4')],'as':_0x4f93('0xb7')}]})['then'](function(_0x744a08){return[_0x744a08,!![]];});});}else{throw new Error(_0x4f93('0xb8'));}})[_0x4f93('0xb9')](function(_0x1113ac,_0x4cb5b2){if(_0x4cb5b2){return _0x1113ac;}return db[_0x4f93('0xa4')]['create']({'direction':_0x4f93('0xb5'),'read':![],'body':_0x333479[_0x4f93('0x63')][_0x4f93('0xa9')][0x0]['filename'],'FaxAccountId':_0x2575d5['id'],'FaxInteractionId':_0x1113ac['id'],'UserId':_0x333479[_0x4f93('0x5b')]['id'],'ContactId':_0x1113ac[_0x4f93('0xba')],'AttachmentId':_0x333479[_0x4f93('0x63')][_0x4f93('0xa9')][0x0]['id']})[_0x4f93('0x20')](function(_0x1ce0cb){_0x1113ac[_0x4f93('0xbb')][_0x4f93('0xb7')]=[];_0x1113ac[_0x4f93('0xbb')]['Messages'][_0x4f93('0x8d')](_0x1ce0cb['dataValues']);return _0x1113ac;});})[_0x4f93('0x20')](function(_0x18dbfa){respondWithRpcPromise(_0x4f93('0xbc'),_0x4f93('0xbc'),{'FaxAccountId':_['isNil'](_0x333479[_0x4f93('0x57')]['id'])?undefined:_0x333479[_0x4f93('0x57')]['id'],'path':_['isNil'](_0x333479[_0x4f93('0x63')][_0x4f93('0xa9')][0x0][_0x4f93('0x6')])?undefined:_0x333479['body'][_0x4f93('0xa9')][0x0][_0x4f93('0x6')],'fax':_[_0x4f93('0xaf')](_0x333479[_0x4f93('0x63')]['to'][0x0])?undefined:_0x333479[_0x4f93('0x63')]['to'][0x0],'AttachmentId':_0x333479[_0x4f93('0x63')][_0x4f93('0xa9')][0x0]['id']},client9002)[_0x4f93('0x20')](function(_0x36e440){logger[_0x4f93('0x21')](_0x4f93('0xbd'),_0x36e440);})[_0x4f93('0x2b')](function(_0x212cc9){logger['info'](_0x4f93('0xbd'),_0x212cc9);});return _0x18dbfa;})[_0x4f93('0x20')](respondWithResult(_0x21ec00,null))[_0x4f93('0x2b')](handleError(_0x21ec00,null));};exports[_0x4f93('0xbe')]=function(_0x5708c6,_0x26c4ca,_0x10f8ac){return db['FaxAccount']['find']({'where':{'id':_0x5708c6[_0x4f93('0x57')]['id']}})[_0x4f93('0x20')](handleEntityNotFound(_0x26c4ca,null))['then'](function(_0x420e43){if(_0x420e43){return _0x420e43['addAgents'](_0x5708c6['body'][_0x4f93('0x6d')],_['omit'](_0x5708c6[_0x4f93('0x63')],[_0x4f93('0x6d'),'id'])||{})['spread'](function(_0x559fe6){for(var _0x470d78=0x0;_0x470d78<_0x5708c6[_0x4f93('0x63')][_0x4f93('0x6d')][_0x4f93('0x49')];_0x470d78+=0x1){socket['emit'](_0x4f93('0xbf'),{'UserId':Number(_0x5708c6[_0x4f93('0x63')]['ids'][_0x470d78]),'FaxAccountId':Number(_0x5708c6[_0x4f93('0x57')]['id'])});}return _0x559fe6;});}})[_0x4f93('0x20')](respondWithResult(_0x26c4ca,null))[_0x4f93('0x2b')](handleError(_0x26c4ca,null));};exports[_0x4f93('0xc0')]=function(_0x3170dd,_0x26c97b,_0x30af4a){return db['FaxAccount']['find']({'where':{'id':_0x3170dd['params']['id']}})[_0x4f93('0x20')](handleEntityNotFound(_0x26c97b,null))['then'](function(_0x5336e7){if(_0x5336e7){return _0x5336e7[_0x4f93('0xc0')](_0x3170dd[_0x4f93('0x43')][_0x4f93('0x6d')])[_0x4f93('0x20')](function(){if(_[_0x4f93('0xc1')](_0x3170dd[_0x4f93('0x43')][_0x4f93('0x6d')])){for(var _0x38e857=0x0;_0x38e857<_0x3170dd[_0x4f93('0x43')]['ids']['length'];_0x38e857+=0x1){socket[_0x4f93('0xc2')](_0x4f93('0xc3'),{'UserId':Number(_0x3170dd[_0x4f93('0x43')][_0x4f93('0x6d')][_0x38e857]),'FaxAccountId':Number(_0x3170dd[_0x4f93('0x57')]['id'])});}}else{socket['emit'](_0x4f93('0xc3'),{'UserId':Number(_0x3170dd['query']['ids']),'FaxAccountId':Number(_0x3170dd[_0x4f93('0x57')]['id'])});}});}})[_0x4f93('0x20')](respondWithStatusCode(_0x26c97b,null))['catch'](handleError(_0x26c97b,null));};exports[_0x4f93('0xc4')]=function(_0xbb5045,_0x2fc6f8,_0x2b9998){var _0x357c7c={};var _0x358207={};var _0x5a1233;var _0x3d8d8b;return db[_0x4f93('0x53')][_0x4f93('0x72')]({'where':{'id':_0xbb5045['params']['id']}})[_0x4f93('0x20')](handleEntityNotFound(_0x2fc6f8,null))[_0x4f93('0x20')](function(_0x4ded3c){if(_0x4ded3c){_0x5a1233=_0x4ded3c;_0x358207[_0x4f93('0x42')]=_[_0x4f93('0x44')](db['User'][_0x4f93('0x40')]);_0x358207['query']=_['keys'](_0xbb5045[_0x4f93('0x43')]);_0x358207[_0x4f93('0x45')]=_[_0x4f93('0x46')](_0x358207[_0x4f93('0x42')],_0x358207[_0x4f93('0x43')]);_0x357c7c['attributes']=_[_0x4f93('0x46')](_0x358207[_0x4f93('0x42')],qs['fields'](_0xbb5045[_0x4f93('0x43')][_0x4f93('0x48')]));_0x357c7c[_0x4f93('0x47')]=_0x357c7c['attributes'][_0x4f93('0x49')]?_0x357c7c[_0x4f93('0x47')]:_0x358207['model'];_0x357c7c[_0x4f93('0x4b')]=qs[_0x4f93('0x4c')](_0xbb5045[_0x4f93('0x43')]['sort']);_0x357c7c[_0x4f93('0x50')]=qs[_0x4f93('0x45')](_[_0x4f93('0x4d')](_0xbb5045[_0x4f93('0x43')],_0x358207[_0x4f93('0x45')]));if(_0xbb5045[_0x4f93('0x43')][_0x4f93('0x4e')]){_0x357c7c[_0x4f93('0x50')]=_[_0x4f93('0x4f')](_0x357c7c['where'],{'$or':_[_0x4f93('0x3f')](_0x357c7c[_0x4f93('0x47')],function(_0x3dbe5f){var _0x575ff7={};_0x575ff7[_0x3dbe5f]={'$like':'%'+_0xbb5045[_0x4f93('0x43')][_0x4f93('0x4e')]+'%'};return _0x575ff7;})});}_0x357c7c=_['merge']({},_0x357c7c,_0xbb5045[_0x4f93('0x52')]);return _0x5a1233[_0x4f93('0xc4')](_0x357c7c);}})['then'](function(_0x430db1){if(_0x430db1){_0x3d8d8b=_0x430db1[_0x4f93('0x49')];if(!_0xbb5045['query']['hasOwnProperty'](_0x4f93('0x4a'))){_0x357c7c[_0x4f93('0x31')]=qs[_0x4f93('0x31')](_0xbb5045[_0x4f93('0x43')][_0x4f93('0x31')]);_0x357c7c[_0x4f93('0x2f')]=qs['offset'](_0xbb5045['query']['offset']);}return _0x5a1233[_0x4f93('0xc4')](_0x357c7c);}})[_0x4f93('0x20')](function(_0x4becf3){if(_0x4becf3){return _0x4becf3?{'count':_0x3d8d8b,'rows':_0x4becf3}:null;}})[_0x4f93('0x20')](respondWithResult(_0x2fc6f8,null))[_0x4f93('0x2b')](handleError(_0x2fc6f8,null));}; \ No newline at end of file +var _0xa1b5=['$gte','split','format','FaxMessage','CmList','List','Contacts','DESC','attachments','join','server/files/attachments','CheckAfterSend','isNil','from','\x22%s\x22\x20<%s>','fax','List\x20not\x20found','out','filename','Contact\x20not\x20found','spread','Messages','dataValues','SendFax','SendFaxRpc,\x20%s','addAgents','emit','userFaxAccount:save','removeAgents','isArray','userFaxAccount:remove','getAgents','eml-format','rimraf','request-promise','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','localhost','./faxAccount.socket','jayson/promise','client','http','request','then','info','FaxAccount,\x20%s,\x20%s','debug','FaxAccount,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','message','result','catch','sendStatus','status','end','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','destroy','FaxAccounts','stack','name','send','index','mandatoryDispositionPause','FaxAccount','fieldName','type','key','map','query','intersection','model','attributes','fields','length','hasOwnProperty','order','sort','where','filters','pick','filter','merge','VIRTUAL','findAll','show','params','keys','rawAttributes','includeAll','include','options','find','create','user','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','userProfileId','autoAssociation','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','Pause','describe','addDisposition','FaxAccountId','getDispositions','findOne','Disposition','nolimit','rows','removeDispositions','CannedAnswer','removeAnswers','addInteraction','FaxInteraction','ids','getInteractions','CmContact','Contact','User','Owner','fullname','internal','color','tag','addApplications','transaction','sequelize','Transaction','ISOLATION_LEVELS','READ_COMMITTED','FaxApplication','bulkCreate','finally','json','getApplications','context','from-voip-provider','exten','localstationid','app','system','description','priority','Answer','CDR(type)=inbound-fax','ecm','gateway','headerinfo','maxrate','minrate','modem','t38timeout','push','FAXOPT(','Set','Wait','ReceiveFax','addAccountApplications','VoiceExtension','updateAccountApplications','omit','tech','updatedAt','TrunkId','getMessages'];(function(_0x3e4683,_0x5f4871){var _0x2eeab8=function(_0xb83159){while(--_0xb83159){_0x3e4683['push'](_0x3e4683['shift']());}};_0x2eeab8(++_0x5f4871);}(_0xa1b5,0xe7));var _0x5a1b=function(_0xc9f12f,_0xddddce){_0xc9f12f=_0xc9f12f-0x0;var _0x3f5861=_0xa1b5[_0xc9f12f];return _0x3f5861;};'use strict';var emlformat=require(_0x5a1b('0x0'));var rimraf=require(_0x5a1b('0x1'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x5a1b('0x2'));var moment=require('moment');var BPromise=require(_0x5a1b('0x3'));var Mustache=require(_0x5a1b('0x4'));var util=require(_0x5a1b('0x5'));var path=require(_0x5a1b('0x6'));var sox=require(_0x5a1b('0x7'));var csv=require(_0x5a1b('0x8'));var ejs=require(_0x5a1b('0x9'));var fs=require('fs');var fs_extra=require(_0x5a1b('0xa'));var _=require(_0x5a1b('0xb'));var squel=require(_0x5a1b('0xc'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x5a1b('0xd'));var toCsv=require(_0x5a1b('0x8'));var querystring=require(_0x5a1b('0xe'));var Papa=require(_0x5a1b('0xf'));var Redis=require(_0x5a1b('0x10'));var authService=require(_0x5a1b('0x11'));var qs=require(_0x5a1b('0x12'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x5a1b('0x13'));var logger=require(_0x5a1b('0x14'))(_0x5a1b('0x15'));var utils=require('../../config/utils');var config=require(_0x5a1b('0x16'));var licenseUtil=require(_0x5a1b('0x17'));var db=require(_0x5a1b('0x18'))['db'];config[_0x5a1b('0x19')]=_[_0x5a1b('0x1a')](config[_0x5a1b('0x19')],{'host':_0x5a1b('0x1b'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x5a1b('0x19')]));require(_0x5a1b('0x1c'))['register'](socket);var jayson=require(_0x5a1b('0x1d'));var client=jayson[_0x5a1b('0x1e')][_0x5a1b('0x1f')]({'port':0x232c});var client9002=jayson[_0x5a1b('0x1e')][_0x5a1b('0x1f')]({'port':0x232a});function respondWithRpcPromise(_0x550c14,_0x4e3e92,_0x3fd551,_0x2d59ad){return new BPromise(function(_0x240514,_0x4ee471){var _0x4b5f98=_0x2d59ad||client;return _0x4b5f98[_0x5a1b('0x20')](_0x550c14,_0x3fd551)[_0x5a1b('0x21')](function(_0x1b5c29){logger[_0x5a1b('0x22')](_0x5a1b('0x23'),_0x4e3e92,'request\x20sent');logger[_0x5a1b('0x24')](_0x5a1b('0x25'),_0x4e3e92,_0x5a1b('0x26'),JSON[_0x5a1b('0x27')](_0x1b5c29));if(_0x1b5c29[_0x5a1b('0x28')]){if(_0x1b5c29[_0x5a1b('0x28')]['code']===0x1f4){logger['error'](_0x5a1b('0x23'),_0x4e3e92,_0x1b5c29[_0x5a1b('0x28')][_0x5a1b('0x29')]);return _0x4ee471(_0x1b5c29[_0x5a1b('0x28')]['message']);}logger[_0x5a1b('0x28')](_0x5a1b('0x23'),_0x4e3e92,_0x1b5c29['error']['message']);return _0x240514(_0x1b5c29['error'][_0x5a1b('0x29')]);}else{logger[_0x5a1b('0x22')]('FaxAccount,\x20%s,\x20%s',_0x4e3e92,_0x5a1b('0x26'));_0x240514(_0x1b5c29[_0x5a1b('0x2a')][_0x5a1b('0x29')]);}})[_0x5a1b('0x2b')](function(_0x3e4358){logger[_0x5a1b('0x28')](_0x5a1b('0x23'),_0x4e3e92,_0x3e4358);_0x4ee471(_0x3e4358);});});}function respondWithStatusCode(_0x1e9f72,_0x2bbd0f){_0x2bbd0f=_0x2bbd0f||0xcc;return function(_0xf8b60a){if(_0xf8b60a){return _0x1e9f72[_0x5a1b('0x2c')](_0x2bbd0f);}return _0x1e9f72[_0x5a1b('0x2d')](_0x2bbd0f)[_0x5a1b('0x2e')]();};}function respondWithResult(_0x141dc2,_0x51b4cc){_0x51b4cc=_0x51b4cc||0xc8;return function(_0x17c571){if(_0x17c571){return _0x141dc2['status'](_0x51b4cc)['json'](_0x17c571);}};}function respondWithFilteredResult(_0x1b3839,_0x2cedad){return function(_0x216fe3){if(_0x216fe3){var _0x2e8c92=typeof _0x2cedad[_0x5a1b('0x2f')]===_0x5a1b('0x30')&&typeof _0x2cedad[_0x5a1b('0x31')]==='undefined';var _0x3b9cfb=_0x216fe3['count'];var _0x2f7918=_0x2e8c92?0x0:_0x2cedad[_0x5a1b('0x2f')];var _0x1469cd=_0x2e8c92?_0x216fe3[_0x5a1b('0x32')]:_0x2cedad[_0x5a1b('0x2f')]+_0x2cedad[_0x5a1b('0x31')];var _0x2a8b60;if(_0x1469cd>=_0x3b9cfb){_0x1469cd=_0x3b9cfb;_0x2a8b60=0xc8;}else{_0x2a8b60=0xce;}_0x1b3839[_0x5a1b('0x2d')](_0x2a8b60);return _0x1b3839[_0x5a1b('0x33')](_0x5a1b('0x34'),_0x2f7918+'-'+_0x1469cd+'/'+_0x3b9cfb)['json'](_0x216fe3);}return null;};}function patchUpdates(_0x96b10d){return function(_0x55fd2b){try{jsonpatch[_0x5a1b('0x35')](_0x55fd2b,_0x96b10d,!![]);}catch(_0x217c93){return BPromise[_0x5a1b('0x36')](_0x217c93);}return _0x55fd2b[_0x5a1b('0x37')]();};}function saveUpdates(_0x53bf05,_0x258bbb){return function(_0x2e4c54){if(_0x2e4c54){return _0x2e4c54[_0x5a1b('0x38')](_0x53bf05)['then'](function(_0x554a10){return _0x554a10;});}return null;};}function removeEntity(_0x5e404c,_0x1f9698){return function(_0x1a8efc){if(_0x1a8efc){return _0x1a8efc[_0x5a1b('0x39')]()[_0x5a1b('0x21')](function(){var _0x17d83c=_0x1a8efc['get']({'plain':!![]});var _0x1c337b=_0x5a1b('0x3a');return db['UserProfileResource'][_0x5a1b('0x39')]({'where':{'type':_0x1c337b,'resourceId':_0x17d83c['id']}})[_0x5a1b('0x21')](function(){return _0x1a8efc;});})['then'](function(){_0x5e404c[_0x5a1b('0x2d')](0xcc)[_0x5a1b('0x2e')]();});}};}function handleEntityNotFound(_0x64fdf9,_0xd9fec9){return function(_0x52f77a){if(!_0x52f77a){_0x64fdf9[_0x5a1b('0x2c')](0x194);}return _0x52f77a;};}function handleError(_0x58b24e,_0x3e4406){_0x3e4406=_0x3e4406||0x1f4;return function(_0x14b3ac){logger[_0x5a1b('0x28')](_0x14b3ac[_0x5a1b('0x3b')]);if(_0x14b3ac[_0x5a1b('0x3c')]){delete _0x14b3ac[_0x5a1b('0x3c')];}_0x58b24e['status'](_0x3e4406)[_0x5a1b('0x3d')](_0x14b3ac);};}exports[_0x5a1b('0x3e')]=function(_0x169a04,_0x4b1b52){var _0x8f0b57={'include':[{'model':db['Pause'],'as':_0x5a1b('0x3f')}]},_0x2030e8={},_0x803f16={'count':0x0,'rows':[]};var _0x5ac483=_['map'](db[_0x5a1b('0x40')]['rawAttributes'],function(_0x44d12f){return{'name':_0x44d12f[_0x5a1b('0x41')],'type':_0x44d12f[_0x5a1b('0x42')][_0x5a1b('0x43')]};});_0x2030e8['model']=_[_0x5a1b('0x44')](_0x5ac483,_0x5a1b('0x3c'));_0x2030e8[_0x5a1b('0x45')]=_['keys'](_0x169a04[_0x5a1b('0x45')]);_0x2030e8['filters']=_[_0x5a1b('0x46')](_0x2030e8[_0x5a1b('0x47')],_0x2030e8[_0x5a1b('0x45')]);_0x8f0b57[_0x5a1b('0x48')]=_['intersection'](_0x2030e8['model'],qs[_0x5a1b('0x49')](_0x169a04[_0x5a1b('0x45')]['fields']));_0x8f0b57['attributes']=_0x8f0b57[_0x5a1b('0x48')][_0x5a1b('0x4a')]?_0x8f0b57[_0x5a1b('0x48')]:_0x2030e8[_0x5a1b('0x47')];if(!_0x169a04[_0x5a1b('0x45')][_0x5a1b('0x4b')]('nolimit')){_0x8f0b57[_0x5a1b('0x31')]=qs['limit'](_0x169a04[_0x5a1b('0x45')][_0x5a1b('0x31')]);_0x8f0b57['offset']=qs['offset'](_0x169a04['query'][_0x5a1b('0x2f')]);}_0x8f0b57[_0x5a1b('0x4c')]=qs[_0x5a1b('0x4d')](_0x169a04[_0x5a1b('0x45')][_0x5a1b('0x4d')]);_0x8f0b57[_0x5a1b('0x4e')]=qs[_0x5a1b('0x4f')](_[_0x5a1b('0x50')](_0x169a04[_0x5a1b('0x45')],_0x2030e8['filters']),_0x5ac483);if(_0x169a04[_0x5a1b('0x45')][_0x5a1b('0x51')]){_0x8f0b57[_0x5a1b('0x4e')]=_[_0x5a1b('0x52')](_0x8f0b57['where'],{'$or':_[_0x5a1b('0x44')](_0x5ac483,function(_0x11114e){if(_0x11114e[_0x5a1b('0x42')]!==_0x5a1b('0x53')){var _0x12c3bb={};_0x12c3bb[_0x11114e['name']]={'$like':'%'+_0x169a04['query']['filter']+'%'};return _0x12c3bb;}})});}_0x8f0b57=_[_0x5a1b('0x52')]({},_0x8f0b57,_0x169a04['options']);var _0x4a4b3d={'where':_0x8f0b57['where']};return db[_0x5a1b('0x40')][_0x5a1b('0x32')](_0x4a4b3d)[_0x5a1b('0x21')](function(_0x5af420){_0x803f16[_0x5a1b('0x32')]=_0x5af420;if(_0x169a04[_0x5a1b('0x45')]['includeAll']){_0x8f0b57['include']=[{'all':!![]}];}return db[_0x5a1b('0x40')][_0x5a1b('0x54')](_0x8f0b57);})[_0x5a1b('0x21')](function(_0xfa978f){_0x803f16['rows']=_0xfa978f;return _0x803f16;})[_0x5a1b('0x21')](respondWithFilteredResult(_0x4b1b52,_0x8f0b57))[_0x5a1b('0x2b')](handleError(_0x4b1b52,null));};exports[_0x5a1b('0x55')]=function(_0x36adf9,_0x332d5a){var _0x31de15={'raw':![],'where':{'id':_0x36adf9[_0x5a1b('0x56')]['id']},'include':[{'model':db['Pause'],'as':_0x5a1b('0x3f')}]},_0xec89b1={};_0xec89b1[_0x5a1b('0x47')]=_[_0x5a1b('0x57')](db['FaxAccount'][_0x5a1b('0x58')]);_0xec89b1['query']=_[_0x5a1b('0x57')](_0x36adf9[_0x5a1b('0x45')]);_0xec89b1[_0x5a1b('0x4f')]=_[_0x5a1b('0x46')](_0xec89b1[_0x5a1b('0x47')],_0xec89b1[_0x5a1b('0x45')]);_0x31de15['attributes']=_[_0x5a1b('0x46')](_0xec89b1['model'],qs['fields'](_0x36adf9[_0x5a1b('0x45')][_0x5a1b('0x49')]));_0x31de15['attributes']=_0x31de15[_0x5a1b('0x48')][_0x5a1b('0x4a')]?_0x31de15[_0x5a1b('0x48')]:_0xec89b1[_0x5a1b('0x47')];if(_0x36adf9['query'][_0x5a1b('0x59')]){_0x31de15[_0x5a1b('0x5a')]=[{'all':!![]}];}_0x31de15=_[_0x5a1b('0x52')]({},_0x31de15,_0x36adf9[_0x5a1b('0x5b')]);return db[_0x5a1b('0x40')][_0x5a1b('0x5c')](_0x31de15)[_0x5a1b('0x21')](handleEntityNotFound(_0x332d5a,null))[_0x5a1b('0x21')](respondWithResult(_0x332d5a,null))[_0x5a1b('0x2b')](handleError(_0x332d5a,null));};exports[_0x5a1b('0x5d')]=function(_0x5f0fcd,_0x7349cc){return db[_0x5a1b('0x40')][_0x5a1b('0x5d')](_0x5f0fcd['body'],{})['then'](function(_0x481db9){var _0x5cab05=_0x5f0fcd[_0x5a1b('0x5e')][_0x5a1b('0x5f')]({'plain':!![]});if(!_0x5cab05)throw new Error(_0x5a1b('0x60'));if(_0x5cab05['role']===_0x5a1b('0x5e')){var _0x21a2ea=_0x481db9['get']({'plain':!![]});var _0x343e9e=_0x5a1b('0x3a');return db['UserProfileSection']['find']({'where':{'name':_0x343e9e,'userProfileId':_0x5cab05[_0x5a1b('0x61')]},'raw':!![]})['then'](function(_0x5aba55){if(_0x5aba55&&_0x5aba55[_0x5a1b('0x62')]===0x0){return db[_0x5a1b('0x63')]['create']({'name':_0x21a2ea['name'],'resourceId':_0x21a2ea['id'],'type':_0x5aba55[_0x5a1b('0x3c')],'sectionId':_0x5aba55['id']},{})[_0x5a1b('0x21')](function(){return _0x481db9;});}else{return _0x481db9;}})[_0x5a1b('0x2b')](function(_0x23cd2c){logger[_0x5a1b('0x28')](_0x5a1b('0x64'),_0x23cd2c);throw _0x23cd2c;});}return _0x481db9;})[_0x5a1b('0x21')](respondWithResult(_0x7349cc,0xc9))['catch'](handleError(_0x7349cc,null));};exports[_0x5a1b('0x38')]=function(_0x592e75,_0x55673d){if(_0x592e75[_0x5a1b('0x65')]['id']){delete _0x592e75[_0x5a1b('0x65')]['id'];}return db['FaxAccount'][_0x5a1b('0x5c')]({'where':{'id':_0x592e75[_0x5a1b('0x56')]['id']},'include':[{'model':db[_0x5a1b('0x66')],'as':'mandatoryDispositionPause'}]})[_0x5a1b('0x21')](handleEntityNotFound(_0x55673d,null))[_0x5a1b('0x21')](saveUpdates(_0x592e75[_0x5a1b('0x65')],null))['then'](respondWithResult(_0x55673d,null))[_0x5a1b('0x2b')](handleError(_0x55673d,null));};exports[_0x5a1b('0x39')]=function(_0x5eb0c9,_0x1f453d){return db[_0x5a1b('0x40')][_0x5a1b('0x5c')]({'where':{'id':_0x5eb0c9[_0x5a1b('0x56')]['id']}})[_0x5a1b('0x21')](handleEntityNotFound(_0x1f453d,null))['then'](removeEntity(_0x1f453d,null))[_0x5a1b('0x2b')](handleError(_0x1f453d,null));};exports[_0x5a1b('0x67')]=function(_0x40d5c7,_0x555d06){return db['FaxAccount'][_0x5a1b('0x67')]()[_0x5a1b('0x21')](respondWithResult(_0x555d06,null))[_0x5a1b('0x2b')](handleError(_0x555d06,null));};exports[_0x5a1b('0x68')]=function(_0x59f4bb,_0x22dd0e,_0x389b07){if(_0x59f4bb[_0x5a1b('0x65')]['id']){delete _0x59f4bb[_0x5a1b('0x65')]['id'];}return db['FaxAccount'][_0x5a1b('0x5c')]({'where':{'id':_0x59f4bb['params']['id']}})[_0x5a1b('0x21')](handleEntityNotFound(_0x22dd0e,null))[_0x5a1b('0x21')](function(_0x18f81d){if(_0x18f81d){_0x59f4bb['body'][_0x5a1b('0x69')]=_0x18f81d['id'];return db['Disposition'][_0x5a1b('0x5d')](_0x59f4bb[_0x5a1b('0x65')]);}})[_0x5a1b('0x21')](respondWithResult(_0x22dd0e,null))[_0x5a1b('0x2b')](handleError(_0x22dd0e,null));};exports[_0x5a1b('0x6a')]=function(_0x1eb4e5,_0x40be68,_0x15ceac){var _0x4f24f0={'raw':![],'where':{}};var _0x14e8e1={};var _0x365bd2={'count':0x0,'rows':[]};return db[_0x5a1b('0x40')][_0x5a1b('0x6b')]({'where':{'id':_0x1eb4e5[_0x5a1b('0x56')]['id']}})[_0x5a1b('0x21')](handleEntityNotFound(_0x40be68,null))[_0x5a1b('0x21')](function(_0x31bb32){if(_0x31bb32){_0x14e8e1['model']=_['keys'](db[_0x5a1b('0x6c')][_0x5a1b('0x58')]);_0x14e8e1[_0x5a1b('0x45')]=_[_0x5a1b('0x57')](_0x1eb4e5[_0x5a1b('0x45')]);_0x14e8e1[_0x5a1b('0x4f')]=_['intersection'](_0x14e8e1['model'],_0x14e8e1[_0x5a1b('0x45')]);_0x4f24f0['attributes']=_[_0x5a1b('0x46')](_0x14e8e1[_0x5a1b('0x47')],qs[_0x5a1b('0x49')](_0x1eb4e5[_0x5a1b('0x45')]['fields']));_0x4f24f0[_0x5a1b('0x48')]=_0x4f24f0[_0x5a1b('0x48')][_0x5a1b('0x4a')]?_0x4f24f0[_0x5a1b('0x48')]:_0x14e8e1[_0x5a1b('0x47')];if(!_0x1eb4e5[_0x5a1b('0x45')]['hasOwnProperty'](_0x5a1b('0x6d'))){_0x4f24f0[_0x5a1b('0x31')]=qs[_0x5a1b('0x31')](_0x1eb4e5[_0x5a1b('0x45')]['limit']);_0x4f24f0[_0x5a1b('0x2f')]=qs[_0x5a1b('0x2f')](_0x1eb4e5['query']['offset']);}_0x4f24f0[_0x5a1b('0x4c')]=qs[_0x5a1b('0x4d')](_0x1eb4e5['query'][_0x5a1b('0x4d')]);_0x4f24f0[_0x5a1b('0x4e')]=qs['filters'](_[_0x5a1b('0x50')](_0x1eb4e5[_0x5a1b('0x45')],_0x14e8e1['filters']));_0x4f24f0[_0x5a1b('0x4e')][_0x5a1b('0x69')]=_0x31bb32['id'];if(_0x1eb4e5[_0x5a1b('0x45')][_0x5a1b('0x51')]){_0x4f24f0[_0x5a1b('0x4e')]=_[_0x5a1b('0x52')](_0x4f24f0[_0x5a1b('0x4e')],{'$or':_[_0x5a1b('0x44')](_0x4f24f0[_0x5a1b('0x48')],function(_0x51b713){var _0xe2761={};_0xe2761[_0x51b713]={'$like':'%'+_0x1eb4e5['query'][_0x5a1b('0x51')]+'%'};return _0xe2761;})});}_0x4f24f0=_[_0x5a1b('0x52')]({},_0x4f24f0,_0x1eb4e5['options']);return db[_0x5a1b('0x6c')][_0x5a1b('0x32')]({'where':_0x4f24f0[_0x5a1b('0x4e')]})['then'](function(_0x4737d2){_0x365bd2[_0x5a1b('0x32')]=_0x4737d2;if(_0x1eb4e5[_0x5a1b('0x45')][_0x5a1b('0x59')]){_0x4f24f0[_0x5a1b('0x5a')]=[{'all':!![]}];}return db[_0x5a1b('0x6c')][_0x5a1b('0x54')](_0x4f24f0);})[_0x5a1b('0x21')](function(_0x20852d){_0x365bd2[_0x5a1b('0x6e')]=_0x20852d;return _0x365bd2;});}})['then'](respondWithFilteredResult(_0x40be68,_0x4f24f0))[_0x5a1b('0x2b')](handleError(_0x40be68,null));};exports[_0x5a1b('0x6f')]=function(_0x5ad145,_0x19811e,_0x48fbd3){return db[_0x5a1b('0x40')][_0x5a1b('0x5c')]({'where':{'id':_0x5ad145[_0x5a1b('0x56')]['id']}})[_0x5a1b('0x21')](handleEntityNotFound(_0x19811e,null))[_0x5a1b('0x21')](function(_0x340472){if(_0x340472){return _0x340472[_0x5a1b('0x6f')](_0x5ad145['query']['ids']);}})[_0x5a1b('0x21')](respondWithStatusCode(_0x19811e,null))[_0x5a1b('0x2b')](handleError(_0x19811e,null));};exports['addAnswer']=function(_0x30bd2a,_0x47c732,_0x211ad8){if(_0x30bd2a[_0x5a1b('0x65')]['id']){delete _0x30bd2a[_0x5a1b('0x65')]['id'];}return db[_0x5a1b('0x40')][_0x5a1b('0x5c')]({'where':{'id':_0x30bd2a[_0x5a1b('0x56')]['id']}})['then'](handleEntityNotFound(_0x47c732,null))[_0x5a1b('0x21')](function(_0x1efa93){if(_0x1efa93){_0x30bd2a[_0x5a1b('0x65')][_0x5a1b('0x69')]=_0x1efa93['id'];return db[_0x5a1b('0x70')][_0x5a1b('0x5d')](_0x30bd2a[_0x5a1b('0x65')]);}})['then'](respondWithResult(_0x47c732,null))[_0x5a1b('0x2b')](handleError(_0x47c732,null));};exports['getAnswers']=function(_0x27ca9f,_0x21c868,_0x131f8e){var _0x362a97={'raw':![],'where':{}};var _0x3523c9={};var _0x5e2331={'count':0x0,'rows':[]};return db['FaxAccount'][_0x5a1b('0x6b')]({'where':{'id':_0x27ca9f[_0x5a1b('0x56')]['id']}})[_0x5a1b('0x21')](handleEntityNotFound(_0x21c868,null))[_0x5a1b('0x21')](function(_0x2b83d7){if(_0x2b83d7){_0x3523c9[_0x5a1b('0x47')]=_[_0x5a1b('0x57')](db[_0x5a1b('0x70')]['rawAttributes']);_0x3523c9['query']=_[_0x5a1b('0x57')](_0x27ca9f[_0x5a1b('0x45')]);_0x3523c9['filters']=_[_0x5a1b('0x46')](_0x3523c9[_0x5a1b('0x47')],_0x3523c9['query']);_0x362a97['attributes']=_[_0x5a1b('0x46')](_0x3523c9[_0x5a1b('0x47')],qs[_0x5a1b('0x49')](_0x27ca9f[_0x5a1b('0x45')][_0x5a1b('0x49')]));_0x362a97['attributes']=_0x362a97['attributes']['length']?_0x362a97[_0x5a1b('0x48')]:_0x3523c9[_0x5a1b('0x47')];if(!_0x27ca9f[_0x5a1b('0x45')][_0x5a1b('0x4b')](_0x5a1b('0x6d'))){_0x362a97[_0x5a1b('0x31')]=qs[_0x5a1b('0x31')](_0x27ca9f['query'][_0x5a1b('0x31')]);_0x362a97[_0x5a1b('0x2f')]=qs['offset'](_0x27ca9f['query'][_0x5a1b('0x2f')]);}_0x362a97[_0x5a1b('0x4c')]=qs[_0x5a1b('0x4d')](_0x27ca9f[_0x5a1b('0x45')][_0x5a1b('0x4d')]);_0x362a97[_0x5a1b('0x4e')]=qs['filters'](_['pick'](_0x27ca9f[_0x5a1b('0x45')],_0x3523c9[_0x5a1b('0x4f')]));_0x362a97['where'][_0x5a1b('0x69')]=_0x2b83d7['id'];if(_0x27ca9f[_0x5a1b('0x45')]['filter']){_0x362a97[_0x5a1b('0x4e')]=_[_0x5a1b('0x52')](_0x362a97[_0x5a1b('0x4e')],{'$or':_[_0x5a1b('0x44')](_0x362a97[_0x5a1b('0x48')],function(_0x342f45){var _0x42691a={};_0x42691a[_0x342f45]={'$like':'%'+_0x27ca9f[_0x5a1b('0x45')][_0x5a1b('0x51')]+'%'};return _0x42691a;})});}_0x362a97=_['merge']({},_0x362a97,_0x27ca9f[_0x5a1b('0x5b')]);return db[_0x5a1b('0x70')]['count']({'where':_0x362a97[_0x5a1b('0x4e')]})[_0x5a1b('0x21')](function(_0x1132be){_0x5e2331[_0x5a1b('0x32')]=_0x1132be;if(_0x27ca9f[_0x5a1b('0x45')][_0x5a1b('0x59')]){_0x362a97[_0x5a1b('0x5a')]=[{'all':!![]}];}return db[_0x5a1b('0x70')][_0x5a1b('0x54')](_0x362a97);})[_0x5a1b('0x21')](function(_0x58fe47){_0x5e2331[_0x5a1b('0x6e')]=_0x58fe47;return _0x5e2331;});}})['then'](respondWithFilteredResult(_0x21c868,_0x362a97))[_0x5a1b('0x2b')](handleError(_0x21c868,null));};exports[_0x5a1b('0x71')]=function(_0x5394a8,_0x60c4bb,_0x2d25fc){return db[_0x5a1b('0x40')]['find']({'where':{'id':_0x5394a8[_0x5a1b('0x56')]['id']}})['then'](handleEntityNotFound(_0x60c4bb,null))[_0x5a1b('0x21')](function(_0x31ad16){if(_0x31ad16){return _0x31ad16[_0x5a1b('0x71')](_0x5394a8[_0x5a1b('0x45')]['ids']);}})['then'](respondWithStatusCode(_0x60c4bb,null))['catch'](handleError(_0x60c4bb,null));};exports[_0x5a1b('0x72')]=function(_0x3f0c39,_0x4835c5,_0x2c4db6){return db[_0x5a1b('0x73')]['find']({'where':{'id':_0x3f0c39[_0x5a1b('0x56')]['id']}})[_0x5a1b('0x21')](handleEntityNotFound(_0x4835c5,null))[_0x5a1b('0x21')](function(_0x2b8196){if(_0x2b8196){return _0x2b8196['addInteraction'](_0x3f0c39[_0x5a1b('0x65')][_0x5a1b('0x74')],_['omit'](_0x3f0c39[_0x5a1b('0x65')],[_0x5a1b('0x74'),'id'])||{});}})['then'](respondWithResult(_0x4835c5,null))[_0x5a1b('0x2b')](handleError(_0x4835c5,null));};exports[_0x5a1b('0x75')]=function(_0x575be9,_0x448b54,_0x1ee0e4){var _0x26335b={'raw':![],'where':{}};var _0x3564f5={};var _0x51fac2={'count':0x0,'rows':[]};return db[_0x5a1b('0x40')][_0x5a1b('0x6b')]({'where':{'id':_0x575be9[_0x5a1b('0x56')]['id']}})[_0x5a1b('0x21')](handleEntityNotFound(_0x448b54,null))[_0x5a1b('0x21')](function(_0x49a73b){if(_0x49a73b){_0x3564f5['model']=_[_0x5a1b('0x57')](db[_0x5a1b('0x73')]['rawAttributes']);_0x3564f5['query']=_[_0x5a1b('0x57')](_0x575be9[_0x5a1b('0x45')]);_0x3564f5['filters']=_[_0x5a1b('0x46')](_0x3564f5['model'],_0x3564f5['query']);_0x26335b[_0x5a1b('0x48')]=_[_0x5a1b('0x46')](_0x3564f5[_0x5a1b('0x47')],qs[_0x5a1b('0x49')](_0x575be9[_0x5a1b('0x45')][_0x5a1b('0x49')]));_0x26335b[_0x5a1b('0x48')]=_0x26335b[_0x5a1b('0x48')]['length']?_0x26335b['attributes']:_0x3564f5['model'];if(!_0x575be9[_0x5a1b('0x45')][_0x5a1b('0x4b')](_0x5a1b('0x6d'))){_0x26335b[_0x5a1b('0x31')]=qs[_0x5a1b('0x31')](_0x575be9[_0x5a1b('0x45')][_0x5a1b('0x31')]);_0x26335b[_0x5a1b('0x2f')]=qs[_0x5a1b('0x2f')](_0x575be9['query'][_0x5a1b('0x2f')]);}_0x26335b[_0x5a1b('0x4c')]=qs['sort'](_0x575be9[_0x5a1b('0x45')]['sort']);_0x26335b[_0x5a1b('0x4e')]=qs['filters'](_[_0x5a1b('0x50')](_0x575be9[_0x5a1b('0x45')],_0x3564f5[_0x5a1b('0x4f')]));_0x26335b[_0x5a1b('0x4e')]['FaxAccountId']=_0x49a73b['id'];if(_0x575be9[_0x5a1b('0x45')]['filter']){_0x26335b['where']=_[_0x5a1b('0x52')](_0x26335b[_0x5a1b('0x4e')],{'$or':_[_0x5a1b('0x44')](_0x26335b[_0x5a1b('0x48')],function(_0x4362de){var _0x13b1f3={};_0x13b1f3[_0x4362de]={'$like':'%'+_0x575be9[_0x5a1b('0x45')][_0x5a1b('0x51')]+'%'};return _0x13b1f3;})});}_0x26335b=_[_0x5a1b('0x52')]({},_0x26335b,_0x575be9[_0x5a1b('0x5b')]);return db[_0x5a1b('0x73')][_0x5a1b('0x32')]({'where':_0x26335b['where']})[_0x5a1b('0x21')](function(_0x19478f){_0x51fac2['count']=_0x19478f;if(_0x575be9[_0x5a1b('0x45')][_0x5a1b('0x59')]){_0x26335b[_0x5a1b('0x5a')]=[{'model':db[_0x5a1b('0x76')],'as':_0x5a1b('0x77'),'required':![]},{'model':db[_0x5a1b('0x78')],'as':_0x5a1b('0x79'),'attributes':[_0x5a1b('0x3c'),_0x5a1b('0x7a'),_0x5a1b('0x7b')],'required':![]},{'model':db['Tag'],'as':'Tags','attributes':['id','name',_0x5a1b('0x7c')],'where':_0x575be9['query'][_0x5a1b('0x7d')]?{'id':_0x575be9[_0x5a1b('0x45')][_0x5a1b('0x7d')]}:undefined,'required':_0x575be9['query']['tag']?!![]:![]}];}return db['FaxInteraction'][_0x5a1b('0x54')](_0x26335b);})[_0x5a1b('0x21')](function(_0x300aca){_0x51fac2[_0x5a1b('0x6e')]=_0x300aca;return _0x51fac2;});}})[_0x5a1b('0x21')](respondWithFilteredResult(_0x448b54,_0x26335b))[_0x5a1b('0x2b')](handleError(_0x448b54,null));};exports[_0x5a1b('0x7e')]=function(_0x4a6c37,_0x4586a8){var _0x283f69=_0x4a6c37[_0x5a1b('0x56')]['id'];var _0x4592f7=_0x4a6c37[_0x5a1b('0x65')];var _0x1bba68=0xc8;var _0x1b645a=null;return db['sequelize'][_0x5a1b('0x7f')]({'isolationLevel':db[_0x5a1b('0x80')][_0x5a1b('0x81')][_0x5a1b('0x82')][_0x5a1b('0x83')]},function(_0x4c49fb){return db[_0x5a1b('0x40')][_0x5a1b('0x6b')]({'where':{'id':_0x283f69},'transaction':_0x4c49fb})['then'](function(_0x10f0cf){if(_0x10f0cf){return db[_0x5a1b('0x84')][_0x5a1b('0x39')]({'where':{'FaxAccountId':_0x283f69},'transaction':_0x4c49fb})['then'](function(){var _0x3f3c3f=_[_0x5a1b('0x44')](_0x4592f7,function(_0x2f548e){_0x2f548e[_0x5a1b('0x69')]=_0x283f69;return _0x2f548e;});return db[_0x5a1b('0x84')][_0x5a1b('0x85')](_0x3f3c3f,{'transaction':_0x4c49fb});});}else{_0x1bba68=0x194;_0x1b645a=[];}});})[_0x5a1b('0x21')](function(){if(_0x1bba68!==0x194){return db[_0x5a1b('0x84')]['findAndCountAll']({'where':{'FaxAccountId':_0x283f69},'order':'priority'})[_0x5a1b('0x21')](function(_0x22c3e8){_0x1b645a=_0x22c3e8;});}})[_0x5a1b('0x2b')](function(_0x4b9f7f){_0x1bba68=0x1f4;logger[_0x5a1b('0x28')](_0x4b9f7f[_0x5a1b('0x3b')]);if(_0x4b9f7f[_0x5a1b('0x3c')]){delete _0x4b9f7f[_0x5a1b('0x3c')];}_0x1b645a=_0x4b9f7f;})[_0x5a1b('0x86')](function(){if(_0x1b645a===null){_0x4586a8[_0x5a1b('0x2c')](_0x1bba68);}else{if(_0x1bba68===0x1f4){_0x4586a8[_0x5a1b('0x2d')](_0x1bba68)[_0x5a1b('0x3d')](_0x1b645a);}else{_0x4586a8[_0x5a1b('0x2d')](_0x1bba68)[_0x5a1b('0x87')](_0x1b645a);}}});};exports['getApplications']=function(_0x114dd9,_0xcbff23,_0x48a990){var _0x1a0480={};var _0x161c99={};var _0x544e2d;var _0xb88f64;return db['FaxAccount']['findOne']({'where':{'id':_0x114dd9[_0x5a1b('0x56')]['id']}})[_0x5a1b('0x21')](handleEntityNotFound(_0xcbff23,null))[_0x5a1b('0x21')](function(_0x4bb626){if(_0x4bb626){_0x544e2d=_0x4bb626;_0x161c99[_0x5a1b('0x47')]=_[_0x5a1b('0x57')](db['FaxApplication'][_0x5a1b('0x58')]);_0x161c99[_0x5a1b('0x45')]=_['keys'](_0x114dd9[_0x5a1b('0x45')]);_0x161c99[_0x5a1b('0x4f')]=_[_0x5a1b('0x46')](_0x161c99[_0x5a1b('0x47')],_0x161c99[_0x5a1b('0x45')]);_0x1a0480[_0x5a1b('0x48')]=_[_0x5a1b('0x46')](_0x161c99[_0x5a1b('0x47')],qs[_0x5a1b('0x49')](_0x114dd9['query'][_0x5a1b('0x49')]));_0x1a0480[_0x5a1b('0x48')]=_0x1a0480[_0x5a1b('0x48')][_0x5a1b('0x4a')]?_0x1a0480['attributes']:_0x161c99[_0x5a1b('0x47')];_0x1a0480[_0x5a1b('0x4c')]=qs[_0x5a1b('0x4d')](_0x114dd9['query'][_0x5a1b('0x4d')]);_0x1a0480[_0x5a1b('0x4e')]=qs['filters'](_[_0x5a1b('0x50')](_0x114dd9[_0x5a1b('0x45')],_0x161c99['filters']));if(_0x114dd9[_0x5a1b('0x45')]['filter']){_0x1a0480[_0x5a1b('0x4e')]=_[_0x5a1b('0x52')](_0x1a0480['where'],{'$or':_[_0x5a1b('0x44')](_0x1a0480[_0x5a1b('0x48')],function(_0x33ed84){var _0x93640={};_0x93640[_0x33ed84]={'$like':'%'+_0x114dd9[_0x5a1b('0x45')][_0x5a1b('0x51')]+'%'};return _0x93640;})});}_0x1a0480=_['merge']({},_0x1a0480,_0x114dd9[_0x5a1b('0x5b')]);return _0x544e2d[_0x5a1b('0x88')](_0x1a0480);}})['then'](function(_0x461691){if(_0x461691){_0xb88f64=_0x461691[_0x5a1b('0x4a')];if(!_0x114dd9['query'][_0x5a1b('0x4b')](_0x5a1b('0x6d'))){_0x1a0480[_0x5a1b('0x31')]=qs[_0x5a1b('0x31')](_0x114dd9[_0x5a1b('0x45')][_0x5a1b('0x31')]);_0x1a0480[_0x5a1b('0x2f')]=qs[_0x5a1b('0x2f')](_0x114dd9[_0x5a1b('0x45')][_0x5a1b('0x2f')]);}return _0x544e2d['getApplications'](_0x1a0480);}})['then'](function(_0x1144d9){if(_0x1144d9){return _0x1144d9?{'count':_0xb88f64,'rows':_0x1144d9}:null;}})['then'](respondWithResult(_0xcbff23,null))['catch'](handleError(_0xcbff23,null));};function Extension(_0x5b3cd4,_0x1b4640,_0x2fdb35,_0x43ae6e){this[_0x5a1b('0x89')]=_0x5a1b('0x8a');this[_0x5a1b('0x8b')]=_0x5b3cd4[_0x5a1b('0x8c')];this[_0x5a1b('0x8d')]=_0x43ae6e;this[_0x5a1b('0x42')]=_0x5a1b('0x8e');this[_0x5a1b('0x8f')]='Fax\x20Extension';this['FaxAccountId']=_0x5b3cd4['id'];this[_0x5a1b('0x90')]=_0x1b4640;this['appdata']=_0x2fdb35;}function createExtensionsReciveFax(_0x5bf19c){var _0xa80eec=0x1;var _0x19fa81=[];_0x19fa81['push'](new Extension(_0x5bf19c,_0xa80eec,'',_0x5a1b('0x91')));_0xa80eec+=0x1;_0x19fa81['push'](new Extension(_0x5bf19c,_0xa80eec,_0x5a1b('0x92'),'Set'));_0xa80eec+=0x1;for(var _0x2bf3a8 in _0x5bf19c){if(_0x5bf19c[_0x5a1b('0x4b')](_0x2bf3a8)&&(_0x2bf3a8===_0x5a1b('0x93')||_0x2bf3a8==='localstationid'||_0x2bf3a8===_0x5a1b('0x94')||_0x2bf3a8==='faxdetect'||_0x2bf3a8===_0x5a1b('0x95')||_0x2bf3a8===_0x5a1b('0x96')||_0x2bf3a8===_0x5a1b('0x97')||_0x2bf3a8===_0x5a1b('0x98')||_0x2bf3a8===_0x5a1b('0x99'))){_0x19fa81[_0x5a1b('0x9a')](new Extension(_0x5bf19c,_0xa80eec,_0x5a1b('0x9b')+_0x2bf3a8+')='+_0x5bf19c[_0x2bf3a8],_0x5a1b('0x9c')));_0xa80eec+=0x1;}}_0x19fa81[_0x5a1b('0x9a')](new Extension(_0x5bf19c,_0xa80eec,'6',_0x5a1b('0x9d')));_0xa80eec+=0x1;_0x19fa81[_0x5a1b('0x9a')](new Extension(_0x5bf19c,_0xa80eec,'/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',_0x5a1b('0x9e')));_0xa80eec=0x0;return _0x19fa81;}exports[_0x5a1b('0x9f')]=function(_0x2b102b,_0x206739,_0x44841d){var _0x2f8a4c;return db[_0x5a1b('0x80')]['transaction'](function(_0x57a8fb){return db[_0x5a1b('0x40')][_0x5a1b('0x5d')](_0x2b102b[_0x5a1b('0x65')],{'transaction':_0x57a8fb})['then'](function(_0x267507){_0x2f8a4c=_0x267507[_0x5a1b('0x5f')]({'plain':!![]});return db[_0x5a1b('0xa0')]['bulkCreate'](createExtensionsReciveFax(_0x2f8a4c),{'transaction':_0x57a8fb});});})[_0x5a1b('0x21')](function(){return _0x2f8a4c;})[_0x5a1b('0x21')](respondWithResult(_0x206739,null))[_0x5a1b('0x2b')](handleError(_0x206739,null));};exports[_0x5a1b('0xa1')]=function(_0x465d91,_0x17fff1,_0x34cbf5){var _0x5590d8;return db[_0x5a1b('0x80')][_0x5a1b('0x7f')](function(_0x3deef8){return db['FaxAccount'][_0x5a1b('0x38')](_0x465d91['body'],{'where':{'id':_0x465d91[_0x5a1b('0x65')]['id']},'transaction':_0x3deef8})[_0x5a1b('0x21')](function(_0x2de38c){return db[_0x5a1b('0xa0')][_0x5a1b('0x39')]({'where':{'FaxAccountId':_0x465d91[_0x5a1b('0x65')]['id']},'transaction':_0x3deef8})['then'](function(_0x37e921){return db[_0x5a1b('0xa0')][_0x5a1b('0x85')](createExtensionsReciveFax(_[_0x5a1b('0xa2')](_0x465d91['body'],[_0x5a1b('0xa3'),_0x5a1b('0x43'),'createdAt',_0x5a1b('0xa4'),_0x5a1b('0xa5'),'ListId'])),{'transaction':_0x3deef8});});});})[_0x5a1b('0x21')](function(){return db[_0x5a1b('0x40')]['findById'](_0x465d91[_0x5a1b('0x65')]['id']);})[_0x5a1b('0x21')](respondWithResult(_0x17fff1,null))[_0x5a1b('0x2b')](handleError(_0x17fff1,null));};exports[_0x5a1b('0xa6')]=function(_0xcb2c83,_0x5a9c76,_0x151dce){var _0x45c725={'raw':!![],'where':{}};var _0x563b49={};var _0x4e44b9={'count':0x0,'rows':[]};return db[_0x5a1b('0x40')][_0x5a1b('0x6b')]({'where':{'id':_0xcb2c83['params']['id']}})[_0x5a1b('0x21')](handleEntityNotFound(_0x5a9c76,null))['then'](function(_0x54e1fb){if(_0x54e1fb){_0x563b49[_0x5a1b('0x47')]=_[_0x5a1b('0x57')](db['FaxMessage'][_0x5a1b('0x58')]);_0x563b49[_0x5a1b('0x45')]=_[_0x5a1b('0x57')](_0xcb2c83[_0x5a1b('0x45')]);_0x563b49[_0x5a1b('0x4f')]=_[_0x5a1b('0x46')](_0x563b49[_0x5a1b('0x47')],_0x563b49['query']);_0x45c725[_0x5a1b('0x48')]=_[_0x5a1b('0x46')](_0x563b49['model'],qs['fields'](_0xcb2c83[_0x5a1b('0x45')][_0x5a1b('0x49')]));_0x45c725[_0x5a1b('0x48')]=_0x45c725['attributes'][_0x5a1b('0x4a')]?_0x45c725[_0x5a1b('0x48')]:_0x563b49[_0x5a1b('0x47')];if(!_0xcb2c83[_0x5a1b('0x45')][_0x5a1b('0x4b')](_0x5a1b('0x6d'))){_0x45c725[_0x5a1b('0x31')]=qs[_0x5a1b('0x31')](_0xcb2c83['query']['limit']);_0x45c725[_0x5a1b('0x2f')]=qs[_0x5a1b('0x2f')](_0xcb2c83[_0x5a1b('0x45')][_0x5a1b('0x2f')]);}_0x45c725['order']=qs[_0x5a1b('0x4d')](_0xcb2c83[_0x5a1b('0x45')][_0x5a1b('0x4d')]);_0x45c725['where']=qs[_0x5a1b('0x4f')](_[_0x5a1b('0x50')](_0xcb2c83['query'],_0x563b49[_0x5a1b('0x4f')]));_0x45c725[_0x5a1b('0x4e')]['FaxAccountId']=_0x54e1fb['id'];if(_0xcb2c83[_0x5a1b('0x45')]['filter']){_0x45c725[_0x5a1b('0x4e')]=_[_0x5a1b('0x52')](_0x45c725['where'],{'$or':_[_0x5a1b('0x44')](_0x45c725[_0x5a1b('0x48')],function(_0x4de463){var _0x44c0ff={};_0x44c0ff[_0x4de463]={'$like':'%'+_0xcb2c83[_0x5a1b('0x45')][_0x5a1b('0x51')]+'%'};return _0x44c0ff;})});}if(_0xcb2c83[_0x5a1b('0x45')][_0x5a1b('0xa7')]){var _0x284d31=_0xcb2c83['query'][_0x5a1b('0xa7')][_0x5a1b('0xa8')](',');var _0x393d93={};_0x393d93[_0x284d31[0x0]]={'$gte':moment(_0x284d31[0x1])[_0x5a1b('0xa9')]('YYYY-MM-DD\x20HH:mm:ss')};_0x45c725[_0x5a1b('0x4e')]=_[_0x5a1b('0x52')](_0x45c725[_0x5a1b('0x4e')],_0x393d93);}_0x45c725=_[_0x5a1b('0x52')]({},_0x45c725,_0xcb2c83[_0x5a1b('0x5b')]);return db[_0x5a1b('0xaa')][_0x5a1b('0x32')]({'where':_0x45c725[_0x5a1b('0x4e')]})[_0x5a1b('0x21')](function(_0x396158){_0x4e44b9[_0x5a1b('0x32')]=_0x396158;if(_0xcb2c83[_0x5a1b('0x45')][_0x5a1b('0x59')]){_0x45c725[_0x5a1b('0x5a')]=[{'all':!![]}];}return db[_0x5a1b('0xaa')][_0x5a1b('0x54')](_0x45c725);})[_0x5a1b('0x21')](function(_0x302698){_0x4e44b9[_0x5a1b('0x6e')]=_0x302698;return _0x4e44b9;});}})['then'](respondWithFilteredResult(_0x5a9c76,_0x45c725))[_0x5a1b('0x2b')](handleError(_0x5a9c76,null));};exports[_0x5a1b('0x3d')]=function(_0x385191,_0xea0bd2,_0x5327aa){var _0x196dd7,_0x36ba9b={},_0x360f42;if(_0x385191[_0x5a1b('0x65')]['to']){_0x360f42=_0x385191[_0x5a1b('0x65')]['to'][0x0];}return db[_0x5a1b('0x40')][_0x5a1b('0x5c')]({'where':{'id':_0x385191[_0x5a1b('0x56')]['id']},'include':[{'model':db[_0x5a1b('0xab')],'as':_0x5a1b('0xac'),'include':[{'model':db['CmContact'],'as':_0x5a1b('0xad'),'where':{'fax':_0x360f42},'limit':0x1,'order':[[_0x5a1b('0xa4'),_0x5a1b('0xae')]]}]}]})[_0x5a1b('0x21')](handleEntityNotFound(_0xea0bd2,null))[_0x5a1b('0x21')](function(_0x224110){_0x196dd7=_0x224110;if(_0x385191[_0x5a1b('0x65')][_0x5a1b('0xaf')]&&_0x385191[_0x5a1b('0x65')][_0x5a1b('0xaf')]['length']){for(var _0x178718=0x0;_0x178718<_0x385191[_0x5a1b('0x65')]['attachments'][_0x5a1b('0x4a')];_0x178718+=0x1){_0x385191[_0x5a1b('0x65')][_0x5a1b('0xaf')][_0x178718]={'filename':_0x385191[_0x5a1b('0x65')]['attachments'][_0x178718][_0x5a1b('0x3c')],'id':_0x385191[_0x5a1b('0x65')][_0x5a1b('0xaf')][_0x178718]['id'],'path':path[_0x5a1b('0xb0')](config['root'],_0x5a1b('0xb1'),_0x385191['body'][_0x5a1b('0xaf')][_0x178718]['basename'])};}}return respondWithRpcPromise(_0x5a1b('0xb2'),'CheckAfterSend',{'FaxAccountId':_['isNil'](_0x385191[_0x5a1b('0x56')]['id'])?undefined:_0x385191['params']['id'],'path':_[_0x5a1b('0xb3')](_0x385191['body'][_0x5a1b('0xaf')][0x0]['path'])?undefined:_0x385191[_0x5a1b('0x65')]['attachments'][0x0][_0x5a1b('0x6')],'fax':_[_0x5a1b('0xb3')](_0x385191[_0x5a1b('0x65')]['to'][0x0])?undefined:_0x385191['body']['to'][0x0]},client9002);})['then'](function(){if(_0x196dd7){if(_[_0x5a1b('0xb3')](_0x385191[_0x5a1b('0x65')][_0x5a1b('0xb4')])){_0x385191[_0x5a1b('0x65')][_0x5a1b('0xb4')]=util[_0x5a1b('0xa9')](_0x5a1b('0xb5'),_0x196dd7[_0x5a1b('0x3c')],_0x196dd7[_0x5a1b('0xb6')]);}if(_0x196dd7[_0x5a1b('0xac')]){if(_0x196dd7[_0x5a1b('0xac')]['Contacts'][_0x5a1b('0x4a')]){return _0x196dd7[_0x5a1b('0xac')][_0x5a1b('0xad')][0x0];}else{return db[_0x5a1b('0x76')][_0x5a1b('0x5d')](_[_0x5a1b('0x1a')](_0x385191['body'],{'firstName':_0x385191['body']['to'][0x0],'phone':_0x385191[_0x5a1b('0x65')]['to'][0x0],'fax':_0x385191[_0x5a1b('0x65')]['to'][0x0],'ListId':_0x196dd7['ListId']}));}}else{throw new Error(_0x5a1b('0xb7'));}}else{throw new Error('Send\x20Fax\x20failed');}})[_0x5a1b('0x21')](function(_0x258471){if(_0x258471){return db[_0x5a1b('0x73')][_0x5a1b('0x5c')]({'where':{'ContactId':_0x258471['id'],'closed':![],'FaxAccountId':_0x196dd7['id']}})[_0x5a1b('0x21')](function(_0x15be86){if(_0x15be86){return[_0x15be86,![]];}return db[_0x5a1b('0x73')]['create']({'UserId':_0x385191[_0x5a1b('0x5e')]['id'],'ContactId':_0x258471['id'],'FaxAccountId':_0x196dd7['id'],'fax':_0x385191[_0x5a1b('0x65')]['to'][0x0],'firstMsgDirection':_0x5a1b('0xb8'),'Messages':[_[_0x5a1b('0x52')](_0x385191['body'],{'read':![],'body':_0x385191[_0x5a1b('0x65')]['attachments'][0x0][_0x5a1b('0xb9')],'FaxAccountId':_0x196dd7['id'],'UserId':_0x385191[_0x5a1b('0x5e')]['id'],'ContactId':_0x258471['id'],'AttachmentId':_0x385191[_0x5a1b('0x65')][_0x5a1b('0xaf')][0x0]['id']})]},{'include':[{'model':db[_0x5a1b('0xaa')],'as':'Messages'}]})[_0x5a1b('0x21')](function(_0x36d852){return[_0x36d852,!![]];});});}else{throw new Error(_0x5a1b('0xba'));}})[_0x5a1b('0xbb')](function(_0x4d9d96,_0x440a20){if(_0x440a20){return _0x4d9d96;}return db['FaxMessage']['create']({'direction':_0x5a1b('0xb8'),'read':![],'body':_0x385191[_0x5a1b('0x65')]['attachments'][0x0][_0x5a1b('0xb9')],'FaxAccountId':_0x196dd7['id'],'FaxInteractionId':_0x4d9d96['id'],'UserId':_0x385191[_0x5a1b('0x5e')]['id'],'ContactId':_0x4d9d96['ContactId'],'AttachmentId':_0x385191[_0x5a1b('0x65')][_0x5a1b('0xaf')][0x0]['id']})[_0x5a1b('0x21')](function(_0x5aa2f7){_0x4d9d96['dataValues'][_0x5a1b('0xbc')]=[];_0x4d9d96['dataValues']['Messages'][_0x5a1b('0x9a')](_0x5aa2f7[_0x5a1b('0xbd')]);return _0x4d9d96;});})[_0x5a1b('0x21')](function(_0x218d85){respondWithRpcPromise(_0x5a1b('0xbe'),_0x5a1b('0xbe'),{'FaxAccountId':_[_0x5a1b('0xb3')](_0x385191[_0x5a1b('0x56')]['id'])?undefined:_0x385191['params']['id'],'path':_[_0x5a1b('0xb3')](_0x385191['body'][_0x5a1b('0xaf')][0x0]['path'])?undefined:_0x385191[_0x5a1b('0x65')][_0x5a1b('0xaf')][0x0]['path'],'fax':_[_0x5a1b('0xb3')](_0x385191[_0x5a1b('0x65')]['to'][0x0])?undefined:_0x385191[_0x5a1b('0x65')]['to'][0x0],'AttachmentId':_0x385191[_0x5a1b('0x65')][_0x5a1b('0xaf')][0x0]['id']},client9002)[_0x5a1b('0x21')](function(_0x4d200d){logger['info'](_0x5a1b('0xbf'),_0x4d200d);})[_0x5a1b('0x2b')](function(_0x390c68){logger[_0x5a1b('0x22')](_0x5a1b('0xbf'),_0x390c68);});return _0x218d85;})['then'](respondWithResult(_0xea0bd2,null))[_0x5a1b('0x2b')](handleError(_0xea0bd2,null));};exports[_0x5a1b('0xc0')]=function(_0x39a73a,_0x5492fe,_0x29c72c){return db[_0x5a1b('0x40')][_0x5a1b('0x5c')]({'where':{'id':_0x39a73a[_0x5a1b('0x56')]['id']}})[_0x5a1b('0x21')](handleEntityNotFound(_0x5492fe,null))[_0x5a1b('0x21')](function(_0x4dbfea){if(_0x4dbfea){return _0x4dbfea[_0x5a1b('0xc0')](_0x39a73a[_0x5a1b('0x65')][_0x5a1b('0x74')],_[_0x5a1b('0xa2')](_0x39a73a[_0x5a1b('0x65')],[_0x5a1b('0x74'),'id'])||{})[_0x5a1b('0xbb')](function(_0x597838){for(var _0x2934e3=0x0;_0x2934e3<_0x39a73a[_0x5a1b('0x65')][_0x5a1b('0x74')][_0x5a1b('0x4a')];_0x2934e3+=0x1){socket[_0x5a1b('0xc1')](_0x5a1b('0xc2'),{'UserId':Number(_0x39a73a[_0x5a1b('0x65')]['ids'][_0x2934e3]),'FaxAccountId':Number(_0x39a73a['params']['id'])});}return _0x597838;});}})['then'](respondWithResult(_0x5492fe,null))[_0x5a1b('0x2b')](handleError(_0x5492fe,null));};exports['removeAgents']=function(_0x305cd0,_0x441f45,_0x26bf17){return db['FaxAccount'][_0x5a1b('0x5c')]({'where':{'id':_0x305cd0[_0x5a1b('0x56')]['id']}})[_0x5a1b('0x21')](handleEntityNotFound(_0x441f45,null))[_0x5a1b('0x21')](function(_0x20e45e){if(_0x20e45e){return _0x20e45e[_0x5a1b('0xc3')](_0x305cd0[_0x5a1b('0x45')][_0x5a1b('0x74')])['then'](function(){if(_[_0x5a1b('0xc4')](_0x305cd0[_0x5a1b('0x45')][_0x5a1b('0x74')])){for(var _0x114b19=0x0;_0x114b19<_0x305cd0['query'][_0x5a1b('0x74')][_0x5a1b('0x4a')];_0x114b19+=0x1){socket[_0x5a1b('0xc1')]('userFaxAccount:remove',{'UserId':Number(_0x305cd0[_0x5a1b('0x45')][_0x5a1b('0x74')][_0x114b19]),'FaxAccountId':Number(_0x305cd0[_0x5a1b('0x56')]['id'])});}}else{socket['emit'](_0x5a1b('0xc5'),{'UserId':Number(_0x305cd0[_0x5a1b('0x45')][_0x5a1b('0x74')]),'FaxAccountId':Number(_0x305cd0['params']['id'])});}});}})[_0x5a1b('0x21')](respondWithStatusCode(_0x441f45,null))[_0x5a1b('0x2b')](handleError(_0x441f45,null));};exports[_0x5a1b('0xc6')]=function(_0x2dab17,_0x59edb4,_0x468304){var _0x3d3bf1={};var _0x3c655b={};var _0x3422c8;var _0x419ef3;return db['FaxAccount']['findOne']({'where':{'id':_0x2dab17['params']['id']}})['then'](handleEntityNotFound(_0x59edb4,null))[_0x5a1b('0x21')](function(_0x1faa9d){if(_0x1faa9d){_0x3422c8=_0x1faa9d;_0x3c655b[_0x5a1b('0x47')]=_[_0x5a1b('0x57')](db[_0x5a1b('0x78')]['rawAttributes']);_0x3c655b[_0x5a1b('0x45')]=_[_0x5a1b('0x57')](_0x2dab17[_0x5a1b('0x45')]);_0x3c655b[_0x5a1b('0x4f')]=_[_0x5a1b('0x46')](_0x3c655b['model'],_0x3c655b[_0x5a1b('0x45')]);_0x3d3bf1[_0x5a1b('0x48')]=_[_0x5a1b('0x46')](_0x3c655b[_0x5a1b('0x47')],qs[_0x5a1b('0x49')](_0x2dab17[_0x5a1b('0x45')][_0x5a1b('0x49')]));_0x3d3bf1[_0x5a1b('0x48')]=_0x3d3bf1[_0x5a1b('0x48')][_0x5a1b('0x4a')]?_0x3d3bf1[_0x5a1b('0x48')]:_0x3c655b[_0x5a1b('0x47')];_0x3d3bf1['order']=qs['sort'](_0x2dab17[_0x5a1b('0x45')]['sort']);_0x3d3bf1[_0x5a1b('0x4e')]=qs[_0x5a1b('0x4f')](_['pick'](_0x2dab17[_0x5a1b('0x45')],_0x3c655b[_0x5a1b('0x4f')]));if(_0x2dab17[_0x5a1b('0x45')][_0x5a1b('0x51')]){_0x3d3bf1[_0x5a1b('0x4e')]=_[_0x5a1b('0x52')](_0x3d3bf1[_0x5a1b('0x4e')],{'$or':_[_0x5a1b('0x44')](_0x3d3bf1['attributes'],function(_0x48e6d5){var _0x18b364={};_0x18b364[_0x48e6d5]={'$like':'%'+_0x2dab17['query'][_0x5a1b('0x51')]+'%'};return _0x18b364;})});}_0x3d3bf1=_[_0x5a1b('0x52')]({},_0x3d3bf1,_0x2dab17[_0x5a1b('0x5b')]);return _0x3422c8[_0x5a1b('0xc6')](_0x3d3bf1);}})['then'](function(_0x2d6cd2){if(_0x2d6cd2){_0x419ef3=_0x2d6cd2[_0x5a1b('0x4a')];if(!_0x2dab17[_0x5a1b('0x45')]['hasOwnProperty']('nolimit')){_0x3d3bf1[_0x5a1b('0x31')]=qs[_0x5a1b('0x31')](_0x2dab17['query'][_0x5a1b('0x31')]);_0x3d3bf1[_0x5a1b('0x2f')]=qs['offset'](_0x2dab17[_0x5a1b('0x45')][_0x5a1b('0x2f')]);}return _0x3422c8[_0x5a1b('0xc6')](_0x3d3bf1);}})['then'](function(_0x5a7296){if(_0x5a7296){return _0x5a7296?{'count':_0x419ef3,'rows':_0x5a7296}:null;}})[_0x5a1b('0x21')](respondWithResult(_0x59edb4,null))['catch'](handleError(_0x59edb4,null));}; \ No newline at end of file diff --git a/server/api/faxAccount/faxAccount.events.js b/server/api/faxAccount/faxAccount.events.js index b5d27e0..77bfa93 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 _0xbb29=['exports','events','setMaxListeners','save','update','remove','emit','hasOwnProperty','hook'];(function(_0x138f59,_0x1b53fb){var _0x3d114d=function(_0x1f9461){while(--_0x1f9461){_0x138f59['push'](_0x138f59['shift']());}};_0x3d114d(++_0x1b53fb);}(_0xbb29,0x6d));var _0x9bb2=function(_0x298827,_0xe3d6ce){_0x298827=_0x298827-0x0;var _0x4a706d=_0xbb29[_0x298827];return _0x4a706d;};'use strict';var EventEmitter=require(_0x9bb2('0x0'));var FaxAccount=require('../../mysqldb')['db']['FaxAccount'];var FaxAccountEvents=new EventEmitter();FaxAccountEvents[_0x9bb2('0x1')](0x0);var events={'afterCreate':_0x9bb2('0x2'),'afterUpdate':_0x9bb2('0x3'),'afterDestroy':_0x9bb2('0x4')};function emitEvent(_0x5d2206){return function(_0x45ab7c,_0x3707d,_0x2fda2d){FaxAccountEvents[_0x9bb2('0x5')](_0x5d2206+':'+_0x45ab7c['id'],_0x45ab7c);FaxAccountEvents[_0x9bb2('0x5')](_0x5d2206,_0x45ab7c);_0x2fda2d(null);};}for(var e in events){if(events[_0x9bb2('0x6')](e)){var event=events[e];FaxAccount[_0x9bb2('0x7')](e,emitEvent(event));}}module[_0x9bb2('0x8')]=FaxAccountEvents; \ No newline at end of file +var _0x1819=['emit','hook','exports','events','setMaxListeners','save','remove'];(function(_0x31a7a4,_0xa9e868){var _0xf33bae=function(_0x36a116){while(--_0x36a116){_0x31a7a4['push'](_0x31a7a4['shift']());}};_0xf33bae(++_0xa9e868);}(_0x1819,0x81));var _0x9181=function(_0x32c012,_0xe3c576){_0x32c012=_0x32c012-0x0;var _0x48562e=_0x1819[_0x32c012];return _0x48562e;};'use strict';var EventEmitter=require(_0x9181('0x0'));var FaxAccount=require('../../mysqldb')['db']['FaxAccount'];var FaxAccountEvents=new EventEmitter();FaxAccountEvents[_0x9181('0x1')](0x0);var events={'afterCreate':_0x9181('0x2'),'afterUpdate':'update','afterDestroy':_0x9181('0x3')};function emitEvent(_0x543c56){return function(_0x5432a6,_0x142cdb,_0x41eeec){FaxAccountEvents['emit'](_0x543c56+':'+_0x5432a6['id'],_0x5432a6);FaxAccountEvents[_0x9181('0x4')](_0x543c56,_0x5432a6);_0x41eeec(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];FaxAccount[_0x9181('0x5')](e,emitEvent(event));}}module[_0x9181('0x6')]=FaxAccountEvents; \ No newline at end of file diff --git a/server/api/faxAccount/faxAccount.model.js b/server/api/faxAccount/faxAccount.model.js index d07c00c..d6f2482 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 _0xbe1b=['../../config/logger','api','moment','path','rimraf','./faxAccount.attributes','exports','define','FaxAccount','fax_accounts','lodash'];(function(_0x1aa368,_0x56c31d){var _0x3d9e29=function(_0x32c580){while(--_0x32c580){_0x1aa368['push'](_0x1aa368['shift']());}};_0x3d9e29(++_0x56c31d);}(_0xbe1b,0xd0));var _0xbbe1=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xbe1b[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0xbbe1('0x0'));var util=require('util');var logger=require(_0xbbe1('0x1'))(_0xbbe1('0x2'));var moment=require(_0xbbe1('0x3'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0xbbe1('0x4'));var rimraf=require(_0xbbe1('0x5'));var config=require('../../config/environment');var attributes=require(_0xbbe1('0x6'));module[_0xbbe1('0x7')]=function(_0xf9dcd8,_0x480daa){return _0xf9dcd8[_0xbbe1('0x8')](_0xbbe1('0x9'),attributes,{'tableName':_0xbbe1('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x4b89=['./faxAccount.attributes','exports','define','fax_accounts','lodash','util','../../config/logger','api','moment','bluebird','path','rimraf','../../config/environment'];(function(_0x39f097,_0x17116b){var _0x544f6a=function(_0x457caf){while(--_0x457caf){_0x39f097['push'](_0x39f097['shift']());}};_0x544f6a(++_0x17116b);}(_0x4b89,0xc7));var _0x94b8=function(_0x2a4291,_0x53bdd8){_0x2a4291=_0x2a4291-0x0;var _0xf91cbe=_0x4b89[_0x2a4291];return _0xf91cbe;};'use strict';var _=require(_0x94b8('0x0'));var util=require(_0x94b8('0x1'));var logger=require(_0x94b8('0x2'))(_0x94b8('0x3'));var moment=require(_0x94b8('0x4'));var BPromise=require(_0x94b8('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x94b8('0x6'));var rimraf=require(_0x94b8('0x7'));var config=require(_0x94b8('0x8'));var attributes=require(_0x94b8('0x9'));module[_0x94b8('0xa')]=function(_0x4ae15a,_0x27cd43){return _0x4ae15a[_0x94b8('0xb')]('FaxAccount',attributes,{'tableName':_0x94b8('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 3d00fc6..f554619 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 _0xaecc=['difference','keys','createdAt','updatedAt','CompanyId','isNil','from','Sequelize','ValidationError','from\x20is\x20mandatory','body','body\x20is\x20mandatory\x20and\x20not\x20empty','mapKey','mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','includes','mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','FaxAccount','find','CmList','List','Contacts','DESC','FaxApplication','Applications','get','account','list','orderBy','applications','asc','length','ListId','create','contact','FaxInteraction','Contact\x20not\x20found','autoclose','unmanaged','created','FaxMessage','ContactId','UserId','User','interaction','agent','waitForTheAssignedAgent','*,*,*,*','FaxQueue','name','queueId','unshift','queue','waitForTheAssignedQueue','Start','startRouting','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','http','redis','localhost','socket.io-emitter','./faxAccount.socket','register','request','then','info','FaxAccount,\x20%s,\x20%s','request\x20sent','debug','FaxAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','GetFaxAccount','findAll','options','raw','where','attributes','limit','include','map','model','NotifyFaxAccount','fax','CmContact'];(function(_0x5c524b,_0x551920){var _0x1bfcd4=function(_0x294df8){while(--_0x294df8){_0x5c524b['push'](_0x5c524b['shift']());}};_0x1bfcd4(++_0x551920);}(_0xaecc,0x154));var _0xcaec=function(_0x5abdb1,_0x53a9d8){_0x5abdb1=_0x5abdb1-0x0;var _0x353b1b=_0xaecc[_0x5abdb1];return _0x353b1b;};'use strict';var _=require('lodash');var util=require(_0xcaec('0x0'));var moment=require(_0xcaec('0x1'));var BPromise=require('bluebird');var rs=require(_0xcaec('0x2'));var fs=require('fs');var Redis=require(_0xcaec('0x3'));var db=require(_0xcaec('0x4'))['db'];var utils=require(_0xcaec('0x5'));var logger=require(_0xcaec('0x6'))(_0xcaec('0x7'));var config=require(_0xcaec('0x8'));var jayson=require('jayson/promise');var client=jayson['client'][_0xcaec('0x9')]({'port':0x232c});config[_0xcaec('0xa')]=_['defaults'](config[_0xcaec('0xa')],{'host':_0xcaec('0xb'),'port':0x18eb});var socket=require(_0xcaec('0xc'))(new Redis(config[_0xcaec('0xa')]));require(_0xcaec('0xd'))[_0xcaec('0xe')](socket);function respondWithRpcPromise(_0x1016a6,_0x1735ee,_0x3304ba){return new BPromise(function(_0x3ebc49,_0x5867f1){return client[_0xcaec('0xf')](_0x1016a6,_0x3304ba)[_0xcaec('0x10')](function(_0x314678){logger[_0xcaec('0x11')](_0xcaec('0x12'),_0x1735ee,_0xcaec('0x13'));logger[_0xcaec('0x14')](_0xcaec('0x15'),_0x1735ee,_0xcaec('0x13'),JSON[_0xcaec('0x16')](_0x314678));if(_0x314678[_0xcaec('0x17')]){if(_0x314678[_0xcaec('0x17')][_0xcaec('0x18')]===0x1f4){logger[_0xcaec('0x17')]('FaxAccount,\x20%s,\x20%s',_0x1735ee,_0x314678[_0xcaec('0x17')][_0xcaec('0x19')]);return _0x5867f1(_0x314678[_0xcaec('0x17')][_0xcaec('0x19')]);}logger[_0xcaec('0x17')]('FaxAccount,\x20%s,\x20%s',_0x1735ee,_0x314678[_0xcaec('0x17')][_0xcaec('0x19')]);return _0x3ebc49(_0x314678[_0xcaec('0x17')][_0xcaec('0x19')]);}else{logger[_0xcaec('0x11')]('FaxAccount,\x20%s,\x20%s',_0x1735ee,_0xcaec('0x13'));_0x3ebc49(_0x314678['result'][_0xcaec('0x19')]);}})[_0xcaec('0x1a')](function(_0x5c5e29){logger[_0xcaec('0x17')](_0xcaec('0x12'),_0x1735ee,_0x5c5e29);_0x5867f1(_0x5c5e29);});});}exports[_0xcaec('0x1b')]=function(_0x4b3ee2){var _0x325794=this;return new Promise(function(_0xd617fb,_0x55bf19){return db['FaxAccount'][_0xcaec('0x1c')]({'raw':_0x4b3ee2[_0xcaec('0x1d')]?_0x4b3ee2[_0xcaec('0x1d')][_0xcaec('0x1e')]===undefined?!![]:![]:!![],'where':_0x4b3ee2['options']?_0x4b3ee2[_0xcaec('0x1d')][_0xcaec('0x1f')]||null:null,'attributes':_0x4b3ee2['options']?_0x4b3ee2[_0xcaec('0x1d')][_0xcaec('0x20')]||null:null,'limit':_0x4b3ee2['options']?_0x4b3ee2[_0xcaec('0x1d')][_0xcaec('0x21')]||null:null,'include':_0x4b3ee2[_0xcaec('0x1d')]?_0x4b3ee2['options'][_0xcaec('0x22')]?_[_0xcaec('0x23')](_0x4b3ee2[_0xcaec('0x1d')]['include'],function(_0x1b167d){return{'model':db[_0x1b167d[_0xcaec('0x24')]],'as':_0x1b167d['as'],'attributes':_0x1b167d[_0xcaec('0x20')],'include':_0x1b167d[_0xcaec('0x22')]?_[_0xcaec('0x23')](_0x1b167d[_0xcaec('0x22')],function(_0x30e3a2){return{'model':db[_0x30e3a2[_0xcaec('0x24')]],'as':_0x30e3a2['as'],'attributes':_0x30e3a2[_0xcaec('0x20')],'include':_0x30e3a2['include']?_[_0xcaec('0x23')](_0x30e3a2[_0xcaec('0x22')],function(_0x127c91){return{'model':db[_0x127c91[_0xcaec('0x24')]],'as':_0x127c91['as'],'attributes':_0x127c91[_0xcaec('0x20')]};}):[]};}):[]};}):[]:[]})[_0xcaec('0x10')](function(_0x521100){logger[_0xcaec('0x11')](_0xcaec('0x1b'),_0x4b3ee2);logger[_0xcaec('0x14')](_0xcaec('0x1b'),_0x4b3ee2,JSON['stringify'](_0x521100));_0xd617fb(_0x521100);})[_0xcaec('0x1a')](function(_0x4c3174){logger[_0xcaec('0x17')](_0xcaec('0x1b'),_0x4c3174[_0xcaec('0x19')],_0x4b3ee2);_0x55bf19(_0x325794[_0xcaec('0x17')](0x1f4,_0x4c3174[_0xcaec('0x19')]));});});};exports[_0xcaec('0x25')]=function(_0x5509cf,_0x14c2fe,_0x221ee3){var _0x230958=this;return new Promise(function(_0x3d284f,_0x3d2978){var _0x211246={'body':_0x5509cf['body'],'channel':_0xcaec('0x26')};var _0x17146b=[];var _0x2b99d3=[];var _0x14b1bb={};return db[_0xcaec('0x27')]['describe']()['then'](function(_0x17b921){if(!_0x17b921){throw new db['Sequelize']['ValidationError']('no\x20available\x20attributes');}_0x17146b=_[_0xcaec('0x28')](_[_0xcaec('0x29')](_0x17b921),[_0xcaec('0x2a'),_0xcaec('0x2b')]);_0x2b99d3=_[_0xcaec('0x28')](_['keys'](_0x17b921),[_0xcaec('0x2a'),'updatedAt',_0xcaec('0x2c'),'ListId']);if(_0x5509cf['body']['id']){delete _0x5509cf['body']['id'];}if(_[_0xcaec('0x2d')](_0x5509cf['body'][_0xcaec('0x2e')])){throw new db[(_0xcaec('0x2f'))][(_0xcaec('0x30'))](_0xcaec('0x31'));}if(_['isNil'](_0x5509cf['body'][_0xcaec('0x32')])||_0x5509cf[_0xcaec('0x32')][_0xcaec('0x32')]===''){throw new db[(_0xcaec('0x2f'))][(_0xcaec('0x30'))](_0xcaec('0x33'));}if(_['isNil'](_0x5509cf[_0xcaec('0x32')][_0xcaec('0x34')])){throw new db['Sequelize'][(_0xcaec('0x30'))](_0xcaec('0x35')+_0x2b99d3);}if(!_[_0xcaec('0x36')](_0x2b99d3,_0x5509cf[_0xcaec('0x32')][_0xcaec('0x34')])){throw new db['Sequelize'][(_0xcaec('0x30'))](_0xcaec('0x37')+_0x2b99d3);}_0x14b1bb[_0x5509cf[_0xcaec('0x32')]['mapKey']]=_0x5509cf[_0xcaec('0x32')][_0xcaec('0x2e')];})[_0xcaec('0x10')](function(){return db[_0xcaec('0x38')][_0xcaec('0x39')]({'where':{'id':_0x5509cf['account']['id']},'include':[{'model':db[_0xcaec('0x3a')],'as':_0xcaec('0x3b'),'include':[{'model':db['CmContact'],'as':_0xcaec('0x3c'),'where':_0x14b1bb,'limit':0x1,'order':[[_0xcaec('0x2b'),_0xcaec('0x3d')]]}]},{'model':db[_0xcaec('0x3e')],'as':_0xcaec('0x3f')}]});})[_0xcaec('0x10')](function(_0x2e6e5b){if(_0x2e6e5b&&_0x2e6e5b[_0xcaec('0x3b')]){var _0x8a6529=_0x2e6e5b[_0xcaec('0x40')]({'plain':!![]});_0x211246[_0xcaec('0x41')]=_0x8a6529;_0x211246['applications']=_0x8a6529[_0xcaec('0x3f')];_0x211246[_0xcaec('0x42')]=_0x8a6529[_0xcaec('0x3b')];_0x211246['applications']=_[_0xcaec('0x43')](_0x211246[_0xcaec('0x44')],['priority'],[_0xcaec('0x45')]);if(_0x211246[_0xcaec('0x41')][_0xcaec('0x3f')]){delete _0x211246['account'][_0xcaec('0x3f')];}if(_0x211246[_0xcaec('0x41')][_0xcaec('0x3b')]&&_0x211246['account'][_0xcaec('0x3b')][_0xcaec('0x3c')][_0xcaec('0x46')]){return _0x211246[_0xcaec('0x41')]['List'][_0xcaec('0x3c')][0x0];}var _0x4dba0f=_['defaults'](_0x5509cf[_0xcaec('0x32')],{'firstName':_0x5509cf['body'][_0xcaec('0x2e')],'ListId':_0x8a6529[_0xcaec('0x47')]});_0x4dba0f[_0x5509cf[_0xcaec('0x32')][_0xcaec('0x34')]]=_0x5509cf[_0xcaec('0x32')][_0xcaec('0x2e')];return db[_0xcaec('0x27')][_0xcaec('0x48')](_0x4dba0f,{'fields':_0x17146b,'raw':!![]});}})[_0xcaec('0x10')](function(_0x3fa46f){_0x211246[_0xcaec('0x49')]=_0x3fa46f;if(_0x3fa46f){var _0x2fb1c0={'ContactId':_0x3fa46f['id'],'FaxAccountId':_0x5509cf[_0xcaec('0x41')]['id'],'fax':_0x3fa46f[_0xcaec('0x26')]};return db[_0xcaec('0x4a')][_0xcaec('0x39')]({'where':{'ContactId':_0x3fa46f['id'],'closed':![],'FaxAccountId':_0x5509cf[_0xcaec('0x41')]['id']}})[_0xcaec('0x10')](function(_0x461a3f){if(_0x461a3f){return[_0x461a3f,![]];}return db[_0xcaec('0x4a')][_0xcaec('0x48')](_0x2fb1c0)[_0xcaec('0x10')](function(_0x3aedd5){return[_0x3aedd5,!![]];});});}else{throw new Error(_0xcaec('0x4b'));}})['spread'](function(_0x20cba4,_0x4e6299){var _0x2385a5=_0x20cba4[_0xcaec('0x40')]({'plain':!![]});if(_0x4e6299){if(_0x211246[_0xcaec('0x41')][_0xcaec('0x4c')]){_0x211246[_0xcaec('0x44')]['push']({'id':0x0,'priority':_0x211246['applications'][_0xcaec('0x46')]+0x1,'app':'close','appdata':_0xcaec('0x4d'),'interval':'*,*,*,*'});}_0x2385a5[_0xcaec('0x4e')]=!![];}else{_0x2385a5[_0xcaec('0x4e')]=![];}_0x211246['interaction']=_0x2385a5;return db[_0xcaec('0x4f')][_0xcaec('0x48')]({'body':_0x5509cf['body']['body'],'FaxAccountId':_0x5509cf['account']['id'],'FaxInteractionId':_0x20cba4['id'],'direction':'in','ContactId':_0x20cba4[_0xcaec('0x50')],'AttachmentId':_0x5509cf[_0xcaec('0x32')]['AttachmentId']});})['then'](function(_0x903805){_0x211246['message']=_0x903805;if(!_0x211246['interaction'][_0xcaec('0x51')])return;return db[_0xcaec('0x52')][_0xcaec('0x39')]({'attributes':['id','name'],'where':{'id':_0x211246[_0xcaec('0x53')][_0xcaec('0x51')]}});})['then'](function(_0x480a0d){if(_0x480a0d){_0x211246[_0xcaec('0x44')]['unshift']({'id':0x0,'priority':0x0,'app':_0xcaec('0x54'),'appdata':_0x480a0d['name']+','+(_0x211246[_0xcaec('0x41')][_0xcaec('0x55')]||0xa),'interval':_0xcaec('0x56')});}if(!_0x211246['interaction']['queueId'])return;return db[_0xcaec('0x57')][_0xcaec('0x39')]({'attributes':['id',_0xcaec('0x58')],'where':{'id':_0x211246[_0xcaec('0x53')][_0xcaec('0x59')]}});})['then'](function(_0x408405){if(_0x408405){_0x211246[_0xcaec('0x44')][_0xcaec('0x5a')]({'id':0x0,'priority':0x1,'app':_0xcaec('0x5b'),'appdata':_0x408405['name']+','+(_0x211246[_0xcaec('0x41')][_0xcaec('0x5c')]||0x12c),'interval':_0xcaec('0x56')});}return respondWithRpcPromise(_0xcaec('0x5d'),_0xcaec('0x5e'),_0x211246);})['then'](function(_0x5e3de4){_0x3d284f(_0x5e3de4);})['catch'](function(_0x5ab508){_0x3d2978(_0x230958[_0xcaec('0x17')](0x1f4,_0x5ab508[_0xcaec('0x19')]));});});}; \ No newline at end of file +var _0x0785=['lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis','defaults','localhost','socket.io-emitter','./faxAccount.socket','request','then','info','FaxAccount,\x20%s,\x20%s','request\x20sent','debug','FaxAccount,\x20%s,\x20%s,\x20%s','error','code','message','result','GetFaxAccount','FaxAccount','findAll','options','raw','where','attributes','include','map','model','stringify','catch','NotifyFaxAccount','body','fax','describe','Sequelize','difference','updatedAt','keys','createdAt','CompanyId','ListId','isNil','from','ValidationError','from\x20is\x20mandatory','body\x20is\x20mandatory\x20and\x20not\x20empty','mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','mapKey','account','List','CmContact','Contacts','DESC','Applications','get','applications','list','orderBy','priority','asc','create','FaxInteraction','find','Contact\x20not\x20found','spread','autoclose','push','length','unmanaged','*,*,*,*','created','interaction','FaxMessage','ContactId','AttachmentId','UserId','User','name','unshift','agent','waitForTheAssignedAgent','queueId','FaxQueue','queue','waitForTheAssignedQueue'];(function(_0x13e741,_0x5d3c24){var _0x3f8bb3=function(_0x4440a0){while(--_0x4440a0){_0x13e741['push'](_0x13e741['shift']());}};_0x3f8bb3(++_0x5d3c24);}(_0x0785,0x1e5));var _0x5078=function(_0x35b2a1,_0x4cdca8){_0x35b2a1=_0x35b2a1-0x0;var _0x6023da=_0x0785[_0x35b2a1];return _0x6023da;};'use strict';var _=require(_0x5078('0x0'));var util=require('util');var moment=require(_0x5078('0x1'));var BPromise=require(_0x5078('0x2'));var rs=require(_0x5078('0x3'));var fs=require('fs');var Redis=require(_0x5078('0x4'));var db=require(_0x5078('0x5'))['db'];var utils=require(_0x5078('0x6'));var logger=require(_0x5078('0x7'))(_0x5078('0x8'));var config=require(_0x5078('0x9'));var jayson=require(_0x5078('0xa'));var client=jayson[_0x5078('0xb')][_0x5078('0xc')]({'port':0x232c});config[_0x5078('0xd')]=_[_0x5078('0xe')](config[_0x5078('0xd')],{'host':_0x5078('0xf'),'port':0x18eb});var socket=require(_0x5078('0x10'))(new Redis(config[_0x5078('0xd')]));require(_0x5078('0x11'))['register'](socket);function respondWithRpcPromise(_0x2227c3,_0x2ac63e,_0x4f0e5d){return new BPromise(function(_0x2882f4,_0x14a9e2){return client[_0x5078('0x12')](_0x2227c3,_0x4f0e5d)[_0x5078('0x13')](function(_0x5262a0){logger[_0x5078('0x14')](_0x5078('0x15'),_0x2ac63e,_0x5078('0x16'));logger[_0x5078('0x17')](_0x5078('0x18'),_0x2ac63e,_0x5078('0x16'),JSON['stringify'](_0x5262a0));if(_0x5262a0[_0x5078('0x19')]){if(_0x5262a0['error'][_0x5078('0x1a')]===0x1f4){logger[_0x5078('0x19')](_0x5078('0x15'),_0x2ac63e,_0x5262a0[_0x5078('0x19')][_0x5078('0x1b')]);return _0x14a9e2(_0x5262a0[_0x5078('0x19')][_0x5078('0x1b')]);}logger[_0x5078('0x19')](_0x5078('0x15'),_0x2ac63e,_0x5262a0[_0x5078('0x19')][_0x5078('0x1b')]);return _0x2882f4(_0x5262a0['error']['message']);}else{logger['info']('FaxAccount,\x20%s,\x20%s',_0x2ac63e,'request\x20sent');_0x2882f4(_0x5262a0[_0x5078('0x1c')][_0x5078('0x1b')]);}})['catch'](function(_0x237c8e){logger[_0x5078('0x19')](_0x5078('0x15'),_0x2ac63e,_0x237c8e);_0x14a9e2(_0x237c8e);});});}exports[_0x5078('0x1d')]=function(_0xccfe26){var _0x41f955=this;return new Promise(function(_0x24eb0e,_0x3cc4eb){return db[_0x5078('0x1e')][_0x5078('0x1f')]({'raw':_0xccfe26['options']?_0xccfe26[_0x5078('0x20')][_0x5078('0x21')]===undefined?!![]:![]:!![],'where':_0xccfe26[_0x5078('0x20')]?_0xccfe26['options'][_0x5078('0x22')]||null:null,'attributes':_0xccfe26['options']?_0xccfe26[_0x5078('0x20')][_0x5078('0x23')]||null:null,'limit':_0xccfe26[_0x5078('0x20')]?_0xccfe26['options']['limit']||null:null,'include':_0xccfe26[_0x5078('0x20')]?_0xccfe26[_0x5078('0x20')][_0x5078('0x24')]?_[_0x5078('0x25')](_0xccfe26[_0x5078('0x20')][_0x5078('0x24')],function(_0x7337b9){return{'model':db[_0x7337b9[_0x5078('0x26')]],'as':_0x7337b9['as'],'attributes':_0x7337b9[_0x5078('0x23')],'include':_0x7337b9[_0x5078('0x24')]?_['map'](_0x7337b9[_0x5078('0x24')],function(_0x113738){return{'model':db[_0x113738[_0x5078('0x26')]],'as':_0x113738['as'],'attributes':_0x113738['attributes'],'include':_0x113738['include']?_[_0x5078('0x25')](_0x113738[_0x5078('0x24')],function(_0x419384){return{'model':db[_0x419384[_0x5078('0x26')]],'as':_0x419384['as'],'attributes':_0x419384[_0x5078('0x23')]};}):[]};}):[]};}):[]:[]})[_0x5078('0x13')](function(_0x7116a4){logger[_0x5078('0x14')](_0x5078('0x1d'),_0xccfe26);logger[_0x5078('0x17')]('GetFaxAccount',_0xccfe26,JSON[_0x5078('0x27')](_0x7116a4));_0x24eb0e(_0x7116a4);})[_0x5078('0x28')](function(_0xf039da){logger[_0x5078('0x19')](_0x5078('0x1d'),_0xf039da[_0x5078('0x1b')],_0xccfe26);_0x3cc4eb(_0x41f955[_0x5078('0x19')](0x1f4,_0xf039da[_0x5078('0x1b')]));});});};exports[_0x5078('0x29')]=function(_0xe4710b,_0x1d4d63,_0xf2a05e){var _0x17fd04=this;return new Promise(function(_0x5ee6d8,_0x2c3069){var _0x3edc2d={'body':_0xe4710b[_0x5078('0x2a')],'channel':_0x5078('0x2b')};var _0x440cf9=[];var _0x54bf96=[];var _0x48d582={};return db['CmContact'][_0x5078('0x2c')]()[_0x5078('0x13')](function(_0x8db72c){if(!_0x8db72c){throw new db[(_0x5078('0x2d'))]['ValidationError']('no\x20available\x20attributes');}_0x440cf9=_[_0x5078('0x2e')](_['keys'](_0x8db72c),['createdAt',_0x5078('0x2f')]);_0x54bf96=_['difference'](_[_0x5078('0x30')](_0x8db72c),[_0x5078('0x31'),_0x5078('0x2f'),_0x5078('0x32'),_0x5078('0x33')]);if(_0xe4710b[_0x5078('0x2a')]['id']){delete _0xe4710b[_0x5078('0x2a')]['id'];}if(_[_0x5078('0x34')](_0xe4710b[_0x5078('0x2a')][_0x5078('0x35')])){throw new db[(_0x5078('0x2d'))][(_0x5078('0x36'))](_0x5078('0x37'));}if(_[_0x5078('0x34')](_0xe4710b[_0x5078('0x2a')][_0x5078('0x2a')])||_0xe4710b[_0x5078('0x2a')][_0x5078('0x2a')]===''){throw new db['Sequelize']['ValidationError'](_0x5078('0x38'));}if(_[_0x5078('0x34')](_0xe4710b[_0x5078('0x2a')]['mapKey'])){throw new db[(_0x5078('0x2d'))][(_0x5078('0x36'))](_0x5078('0x39')+_0x54bf96);}if(!_['includes'](_0x54bf96,_0xe4710b[_0x5078('0x2a')]['mapKey'])){throw new db[(_0x5078('0x2d'))]['ValidationError'](_0x5078('0x3a')+_0x54bf96);}_0x48d582[_0xe4710b[_0x5078('0x2a')][_0x5078('0x3b')]]=_0xe4710b[_0x5078('0x2a')][_0x5078('0x35')];})[_0x5078('0x13')](function(){return db[_0x5078('0x1e')]['find']({'where':{'id':_0xe4710b[_0x5078('0x3c')]['id']},'include':[{'model':db['CmList'],'as':_0x5078('0x3d'),'include':[{'model':db[_0x5078('0x3e')],'as':_0x5078('0x3f'),'where':_0x48d582,'limit':0x1,'order':[[_0x5078('0x2f'),_0x5078('0x40')]]}]},{'model':db['FaxApplication'],'as':_0x5078('0x41')}]});})[_0x5078('0x13')](function(_0x19c4a5){if(_0x19c4a5&&_0x19c4a5['List']){var _0x4df0c5=_0x19c4a5[_0x5078('0x42')]({'plain':!![]});_0x3edc2d['account']=_0x4df0c5;_0x3edc2d[_0x5078('0x43')]=_0x4df0c5[_0x5078('0x41')];_0x3edc2d[_0x5078('0x44')]=_0x4df0c5[_0x5078('0x3d')];_0x3edc2d[_0x5078('0x43')]=_[_0x5078('0x45')](_0x3edc2d[_0x5078('0x43')],[_0x5078('0x46')],[_0x5078('0x47')]);if(_0x3edc2d[_0x5078('0x3c')]['Applications']){delete _0x3edc2d[_0x5078('0x3c')][_0x5078('0x41')];}if(_0x3edc2d['account'][_0x5078('0x3d')]&&_0x3edc2d['account']['List'][_0x5078('0x3f')]['length']){return _0x3edc2d[_0x5078('0x3c')][_0x5078('0x3d')][_0x5078('0x3f')][0x0];}var _0x19ec01=_[_0x5078('0xe')](_0xe4710b['body'],{'firstName':_0xe4710b[_0x5078('0x2a')][_0x5078('0x35')],'ListId':_0x4df0c5[_0x5078('0x33')]});_0x19ec01[_0xe4710b[_0x5078('0x2a')][_0x5078('0x3b')]]=_0xe4710b['body'][_0x5078('0x35')];return db['CmContact'][_0x5078('0x48')](_0x19ec01,{'fields':_0x440cf9,'raw':!![]});}})[_0x5078('0x13')](function(_0x2bd3ae){_0x3edc2d['contact']=_0x2bd3ae;if(_0x2bd3ae){var _0x4d36ad={'ContactId':_0x2bd3ae['id'],'FaxAccountId':_0xe4710b['account']['id'],'fax':_0x2bd3ae[_0x5078('0x2b')]};return db[_0x5078('0x49')][_0x5078('0x4a')]({'where':{'ContactId':_0x2bd3ae['id'],'closed':![],'FaxAccountId':_0xe4710b[_0x5078('0x3c')]['id']}})['then'](function(_0x55a0f0){if(_0x55a0f0){return[_0x55a0f0,![]];}return db['FaxInteraction'][_0x5078('0x48')](_0x4d36ad)['then'](function(_0x393055){return[_0x393055,!![]];});});}else{throw new Error(_0x5078('0x4b'));}})[_0x5078('0x4c')](function(_0xeb76f2,_0x22a1e3){var _0x5d5fa9=_0xeb76f2[_0x5078('0x42')]({'plain':!![]});if(_0x22a1e3){if(_0x3edc2d[_0x5078('0x3c')][_0x5078('0x4d')]){_0x3edc2d['applications'][_0x5078('0x4e')]({'id':0x0,'priority':_0x3edc2d[_0x5078('0x43')][_0x5078('0x4f')]+0x1,'app':'close','appdata':_0x5078('0x50'),'interval':_0x5078('0x51')});}_0x5d5fa9[_0x5078('0x52')]=!![];}else{_0x5d5fa9[_0x5078('0x52')]=![];}_0x3edc2d[_0x5078('0x53')]=_0x5d5fa9;return db[_0x5078('0x54')][_0x5078('0x48')]({'body':_0xe4710b[_0x5078('0x2a')][_0x5078('0x2a')],'FaxAccountId':_0xe4710b[_0x5078('0x3c')]['id'],'FaxInteractionId':_0xeb76f2['id'],'direction':'in','ContactId':_0xeb76f2[_0x5078('0x55')],'AttachmentId':_0xe4710b[_0x5078('0x2a')][_0x5078('0x56')]});})[_0x5078('0x13')](function(_0x2b52db){_0x3edc2d['message']=_0x2b52db;if(!_0x3edc2d[_0x5078('0x53')][_0x5078('0x57')])return;return db[_0x5078('0x58')][_0x5078('0x4a')]({'attributes':['id',_0x5078('0x59')],'where':{'id':_0x3edc2d[_0x5078('0x53')]['UserId']}});})['then'](function(_0x394aee){if(_0x394aee){_0x3edc2d[_0x5078('0x43')][_0x5078('0x5a')]({'id':0x0,'priority':0x0,'app':_0x5078('0x5b'),'appdata':_0x394aee[_0x5078('0x59')]+','+(_0x3edc2d[_0x5078('0x3c')][_0x5078('0x5c')]||0xa),'interval':_0x5078('0x51')});}if(!_0x3edc2d['interaction'][_0x5078('0x5d')])return;return db[_0x5078('0x5e')][_0x5078('0x4a')]({'attributes':['id','name'],'where':{'id':_0x3edc2d['interaction'][_0x5078('0x5d')]}});})['then'](function(_0x51648c){if(_0x51648c){_0x3edc2d['applications'][_0x5078('0x5a')]({'id':0x0,'priority':0x1,'app':_0x5078('0x5f'),'appdata':_0x51648c[_0x5078('0x59')]+','+(_0x3edc2d['account'][_0x5078('0x60')]||0x12c),'interval':_0x5078('0x51')});}return respondWithRpcPromise('Start','startRouting',_0x3edc2d);})[_0x5078('0x13')](function(_0x12e284){_0x5ee6d8(_0x12e284);})['catch'](function(_0x4ca5fd){_0x2c3069(_0x17fd04[_0x5078('0x19')](0x1f4,_0x4ca5fd[_0x5078('0x1b')]));});});}; \ No newline at end of file diff --git a/server/api/faxAccount/faxAccount.socket.js b/server/api/faxAccount/faxAccount.socket.js index 41b2c83..4c4bb49 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 _0xcba2=['register','length','save','remove','update','removeListener'];(function(_0x26a9a0,_0x45ccbd){var _0x128bf5=function(_0x1c500a){while(--_0x1c500a){_0x26a9a0['push'](_0x26a9a0['shift']());}};_0x128bf5(++_0x45ccbd);}(_0xcba2,0x1e2));var _0x2cba=function(_0x10377e,_0x37dce5){_0x10377e=_0x10377e-0x0;var _0x4b59e1=_0xcba2[_0x10377e];return _0x4b59e1;};'use strict';var FaxAccountEvents=require('./faxAccount.events');var events=[_0x2cba('0x0'),_0x2cba('0x1'),_0x2cba('0x2')];function createListener(_0x4b3659,_0x1d6961){return function(_0x458f2a){_0x1d6961['emit'](_0x4b3659,_0x458f2a);};}function removeListener(_0x523025,_0x16d238){return function(){FaxAccountEvents[_0x2cba('0x3')](_0x523025,_0x16d238);};}exports[_0x2cba('0x4')]=function(_0x931425){for(var _0x1e0afd=0x0,_0x4e143d=events[_0x2cba('0x5')];_0x1e0afd<_0x4e143d;_0x1e0afd++){var _0x2136d9=events[_0x1e0afd];var _0x2b3820=createListener('faxAccount:'+_0x2136d9,_0x931425);FaxAccountEvents['on'](_0x2136d9,_0x2b3820);}}; \ No newline at end of file +var _0x9ddb=['length','faxAccount:','./faxAccount.events','save','remove','update','removeListener','register'];(function(_0x3406bf,_0x399d3c){var _0x122b6e=function(_0x4c16f0){while(--_0x4c16f0){_0x3406bf['push'](_0x3406bf['shift']());}};_0x122b6e(++_0x399d3c);}(_0x9ddb,0x132));var _0xb9dd=function(_0x5efaf0,_0x4cfe84){_0x5efaf0=_0x5efaf0-0x0;var _0x202e48=_0x9ddb[_0x5efaf0];return _0x202e48;};'use strict';var FaxAccountEvents=require(_0xb9dd('0x0'));var events=[_0xb9dd('0x1'),_0xb9dd('0x2'),_0xb9dd('0x3')];function createListener(_0x4032cd,_0x4a2ff3){return function(_0x147de5){_0x4a2ff3['emit'](_0x4032cd,_0x147de5);};}function removeListener(_0x960eda,_0x476ae3){return function(){FaxAccountEvents[_0xb9dd('0x4')](_0x960eda,_0x476ae3);};}exports[_0xb9dd('0x5')]=function(_0x32864a){for(var _0x50d04e=0x0,_0x47b24d=events[_0xb9dd('0x6')];_0x50d04e<_0x47b24d;_0x50d04e++){var _0x56818e=events[_0x50d04e];var _0x224f7c=createListener(_0xb9dd('0x7')+_0x56818e,_0x32864a);FaxAccountEvents['on'](_0x56818e,_0x224f7c);}}; \ No newline at end of file diff --git a/server/api/faxAccount/index.js b/server/api/faxAccount/index.js index 0d29fa2..91fd3e7 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 _0x69d1=['post','addDisposition','addAnswer','addInteraction','addApplications','addAccountApplications','/updateaccountapplications','updateAccountApplications','/:id/send','addAgents','put','update','delete','destroy','removeDispositions','removeAnswers','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','./faxAccount.controller','get','isAuthenticated','index','/describe','describe','/:id','show','/:id/dispositions','/:id/canned_answers','getAnswers','/:id/interactions','/:id/users','getAgents'];(function(_0x5c161,_0x12144c){var _0x1d961f=function(_0x207cbb){while(--_0x207cbb){_0x5c161['push'](_0x5c161['shift']());}};_0x1d961f(++_0x12144c);}(_0x69d1,0x170));var _0x169d=function(_0x59c5b7,_0x4fb175){_0x59c5b7=_0x59c5b7-0x0;var _0x1a79ff=_0x69d1[_0x59c5b7];return _0x1a79ff;};'use strict';var multer=require(_0x169d('0x0'));var util=require(_0x169d('0x1'));var path=require(_0x169d('0x2'));var timeout=require(_0x169d('0x3'));var express=require(_0x169d('0x4'));var router=express[_0x169d('0x5')]();var fs_extra=require(_0x169d('0x6'));var auth=require(_0x169d('0x7'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0x169d('0x8'));router[_0x169d('0x9')]('/',auth[_0x169d('0xa')](),controller[_0x169d('0xb')]);router[_0x169d('0x9')](_0x169d('0xc'),auth[_0x169d('0xa')](),controller[_0x169d('0xd')]);router['get'](_0x169d('0xe'),auth[_0x169d('0xa')](),controller[_0x169d('0xf')]);router[_0x169d('0x9')](_0x169d('0x10'),auth['isAuthenticated'](),controller['getDispositions']);router[_0x169d('0x9')](_0x169d('0x11'),auth[_0x169d('0xa')](),controller[_0x169d('0x12')]);router['get'](_0x169d('0x13'),auth[_0x169d('0xa')](),controller['getInteractions']);router['get']('/:id/applications',auth[_0x169d('0xa')](),controller['getApplications']);router['get']('/:id/messages',auth[_0x169d('0xa')](),controller['getMessages']);router[_0x169d('0x9')](_0x169d('0x14'),auth[_0x169d('0xa')](),controller[_0x169d('0x15')]);router[_0x169d('0x16')]('/',auth[_0x169d('0xa')](),controller['create']);router[_0x169d('0x16')](_0x169d('0x10'),auth[_0x169d('0xa')](),controller[_0x169d('0x17')]);router['post'](_0x169d('0x11'),auth[_0x169d('0xa')](),controller[_0x169d('0x18')]);router['post']('/:id/interactions',auth[_0x169d('0xa')](),controller[_0x169d('0x19')]);router['post']('/:id/applications',auth['isAuthenticated'](),controller[_0x169d('0x1a')]);router[_0x169d('0x16')]('/addaccountapplications',auth[_0x169d('0xa')](),controller[_0x169d('0x1b')]);router['post'](_0x169d('0x1c'),auth[_0x169d('0xa')](),controller[_0x169d('0x1d')]);router['post'](_0x169d('0x1e'),auth[_0x169d('0xa')](),controller['send']);router[_0x169d('0x16')](_0x169d('0x14'),auth[_0x169d('0xa')](),controller[_0x169d('0x1f')]);router[_0x169d('0x20')](_0x169d('0xe'),auth['isAuthenticated'](),controller[_0x169d('0x21')]);router[_0x169d('0x22')]('/:id',auth[_0x169d('0xa')](),controller[_0x169d('0x23')]);router[_0x169d('0x22')]('/:id/dispositions',auth[_0x169d('0xa')](),controller[_0x169d('0x24')]);router['delete'](_0x169d('0x11'),auth[_0x169d('0xa')](),controller[_0x169d('0x25')]);router[_0x169d('0x22')](_0x169d('0x14'),auth['isAuthenticated'](),controller['removeAgents']);module[_0x169d('0x26')]=router; \ No newline at end of file +var _0xb8b9=['send','addAgents','/:id','update','delete','destroy','removeDispositions','removeAnswers','removeAgents','exports','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./faxAccount.controller','index','get','/describe','isAuthenticated','describe','show','/:id/dispositions','getDispositions','/:id/canned_answers','getAnswers','/:id/applications','getApplications','/:id/messages','/:id/users','getAgents','post','addDisposition','addAnswer','addInteraction','/addaccountapplications','addAccountApplications','/updateaccountapplications','updateAccountApplications'];(function(_0x21a9d9,_0x4d5ac8){var _0x46adce=function(_0xfdd336){while(--_0xfdd336){_0x21a9d9['push'](_0x21a9d9['shift']());}};_0x46adce(++_0x4d5ac8);}(_0xb8b9,0x15a));var _0x9b8b=function(_0x2bc484,_0x58fb40){_0x2bc484=_0x2bc484-0x0;var _0x2778c1=_0xb8b9[_0x2bc484];return _0x2778c1;};'use strict';var multer=require('multer');var util=require(_0x9b8b('0x0'));var path=require(_0x9b8b('0x1'));var timeout=require(_0x9b8b('0x2'));var express=require(_0x9b8b('0x3'));var router=express[_0x9b8b('0x4')]();var fs_extra=require(_0x9b8b('0x5'));var auth=require(_0x9b8b('0x6'));var interaction=require(_0x9b8b('0x7'));var config=require('../../config/environment');var controller=require(_0x9b8b('0x8'));router['get']('/',auth['isAuthenticated'](),controller[_0x9b8b('0x9')]);router[_0x9b8b('0xa')](_0x9b8b('0xb'),auth[_0x9b8b('0xc')](),controller[_0x9b8b('0xd')]);router[_0x9b8b('0xa')]('/:id',auth[_0x9b8b('0xc')](),controller[_0x9b8b('0xe')]);router[_0x9b8b('0xa')](_0x9b8b('0xf'),auth['isAuthenticated'](),controller[_0x9b8b('0x10')]);router[_0x9b8b('0xa')](_0x9b8b('0x11'),auth['isAuthenticated'](),controller[_0x9b8b('0x12')]);router['get']('/:id/interactions',auth[_0x9b8b('0xc')](),controller['getInteractions']);router[_0x9b8b('0xa')](_0x9b8b('0x13'),auth['isAuthenticated'](),controller[_0x9b8b('0x14')]);router[_0x9b8b('0xa')](_0x9b8b('0x15'),auth[_0x9b8b('0xc')](),controller['getMessages']);router[_0x9b8b('0xa')](_0x9b8b('0x16'),auth[_0x9b8b('0xc')](),controller[_0x9b8b('0x17')]);router[_0x9b8b('0x18')]('/',auth[_0x9b8b('0xc')](),controller['create']);router[_0x9b8b('0x18')]('/:id/dispositions',auth[_0x9b8b('0xc')](),controller[_0x9b8b('0x19')]);router[_0x9b8b('0x18')](_0x9b8b('0x11'),auth[_0x9b8b('0xc')](),controller[_0x9b8b('0x1a')]);router[_0x9b8b('0x18')]('/:id/interactions',auth['isAuthenticated'](),controller[_0x9b8b('0x1b')]);router['post'](_0x9b8b('0x13'),auth[_0x9b8b('0xc')](),controller['addApplications']);router[_0x9b8b('0x18')](_0x9b8b('0x1c'),auth['isAuthenticated'](),controller[_0x9b8b('0x1d')]);router['post'](_0x9b8b('0x1e'),auth[_0x9b8b('0xc')](),controller[_0x9b8b('0x1f')]);router[_0x9b8b('0x18')]('/:id/send',auth[_0x9b8b('0xc')](),controller[_0x9b8b('0x20')]);router['post'](_0x9b8b('0x16'),auth[_0x9b8b('0xc')](),controller[_0x9b8b('0x21')]);router['put'](_0x9b8b('0x22'),auth[_0x9b8b('0xc')](),controller[_0x9b8b('0x23')]);router[_0x9b8b('0x24')]('/:id',auth[_0x9b8b('0xc')](),controller[_0x9b8b('0x25')]);router[_0x9b8b('0x24')](_0x9b8b('0xf'),auth[_0x9b8b('0xc')](),controller[_0x9b8b('0x26')]);router['delete'](_0x9b8b('0x11'),auth['isAuthenticated'](),controller[_0x9b8b('0x27')]);router[_0x9b8b('0x24')](_0x9b8b('0x16'),auth['isAuthenticated'](),controller[_0x9b8b('0x28')]);module[_0x9b8b('0x29')]=router; \ No newline at end of file diff --git a/server/api/faxApplication/faxApplication.attributes.js b/server/api/faxApplication/faxApplication.attributes.js index 6f2412a..3098814 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 _0xacb5=['sequelize','exports','INTEGER','STRING','TEXT'];(function(_0x38d887,_0x261d68){var _0x84c717=function(_0x4c5a40){while(--_0x4c5a40){_0x38d887['push'](_0x38d887['shift']());}};_0x84c717(++_0x261d68);}(_0xacb5,0x1d1));var _0x5acb=function(_0x1deba7,_0x30f270){_0x1deba7=_0x1deba7-0x0;var _0x2dcc31=_0xacb5[_0x1deba7];return _0x2dcc31;};'use strict';var Sequelize=require(_0x5acb('0x0'));module[_0x5acb('0x1')]={'priority':{'type':Sequelize[_0x5acb('0x2')],'allowNull':![]},'app':{'type':Sequelize[_0x5acb('0x3')],'allowNull':![],'defaultValue':'noop'},'appdata':{'type':Sequelize[_0x5acb('0x4')]()},'description':{'type':Sequelize[_0x5acb('0x3')]},'interval':{'type':Sequelize[_0x5acb('0x3')],'defaultValue':'*,*,*,*'}}; \ No newline at end of file +var _0xdf12=['*,*,*,*','sequelize','exports','INTEGER','STRING','TEXT'];(function(_0x32636f,_0x2739b0){var _0xe11724=function(_0x2e9208){while(--_0x2e9208){_0x32636f['push'](_0x32636f['shift']());}};_0xe11724(++_0x2739b0);}(_0xdf12,0x1e7));var _0x2df1=function(_0x3b5bb8,_0x502d0a){_0x3b5bb8=_0x3b5bb8-0x0;var _0x9a4bef=_0xdf12[_0x3b5bb8];return _0x9a4bef;};'use strict';var Sequelize=require(_0x2df1('0x0'));module[_0x2df1('0x1')]={'priority':{'type':Sequelize[_0x2df1('0x2')],'allowNull':![]},'app':{'type':Sequelize[_0x2df1('0x3')],'allowNull':![],'defaultValue':'noop'},'appdata':{'type':Sequelize[_0x2df1('0x4')]()},'description':{'type':Sequelize['STRING']},'interval':{'type':Sequelize[_0x2df1('0x3')],'defaultValue':_0x2df1('0x5')}}; \ No newline at end of file diff --git a/server/api/faxApplication/faxApplication.controller.js b/server/api/faxApplication/faxApplication.controller.js index c3de35a..90e5c9a 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 _0xa3de=['name','send','map','FaxApplication','rawAttributes','fieldName','key','model','query','keys','attributes','length','hasOwnProperty','nolimit','sort','filters','filter','where','merge','VIRTUAL','include','findAll','rows','catch','params','intersection','fields','options','find','create','body','eml-format','rimraf','zip-dir','request-promise','moment','mustache','sox','ejs','fs-extra','lodash','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','set','Content-Range','apply','reject','update','then','destroy','error','stack'];(function(_0x33ee6a,_0x456591){var _0x1311df=function(_0x38f6fd){while(--_0x38f6fd){_0x33ee6a['push'](_0x33ee6a['shift']());}};_0x1311df(++_0x456591);}(_0xa3de,0x68));var _0xea3d=function(_0x403115,_0x2d6d03){_0x403115=_0x403115-0x0;var _0x596ef3=_0xa3de[_0x403115];return _0x596ef3;};'use strict';var emlformat=require(_0xea3d('0x0'));var rimraf=require(_0xea3d('0x1'));var zipdir=require(_0xea3d('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0xea3d('0x3'));var moment=require(_0xea3d('0x4'));var BPromise=require('bluebird');var Mustache=require(_0xea3d('0x5'));var util=require('util');var path=require('path');var sox=require(_0xea3d('0x6'));var csv=require('to-csv');var ejs=require(_0xea3d('0x7'));var fs=require('fs');var fs_extra=require(_0xea3d('0x8'));var _=require(_0xea3d('0x9'));var squel=require(_0xea3d('0xa'));var crypto=require('crypto');var jsforce=require(_0xea3d('0xb'));var deskjs=require(_0xea3d('0xc'));var toCsv=require('to-csv');var querystring=require(_0xea3d('0xd'));var Papa=require(_0xea3d('0xe'));var Redis=require(_0xea3d('0xf'));var authService=require(_0xea3d('0x10'));var qs=require(_0xea3d('0x11'));var as=require(_0xea3d('0x12'));var hardwareService=require(_0xea3d('0x13'));var logger=require(_0xea3d('0x14'))(_0xea3d('0x15'));var utils=require(_0xea3d('0x16'));var config=require(_0xea3d('0x17'));var licenseUtil=require(_0xea3d('0x18'));var db=require(_0xea3d('0x19'))['db'];function respondWithStatusCode(_0xd5e1d9,_0x2ddf19){_0x2ddf19=_0x2ddf19||0xcc;return function(_0x42b800){if(_0x42b800){return _0xd5e1d9[_0xea3d('0x1a')](_0x2ddf19);}return _0xd5e1d9[_0xea3d('0x1b')](_0x2ddf19)[_0xea3d('0x1c')]();};}function respondWithResult(_0x1ec1a4,_0x4bf6da){_0x4bf6da=_0x4bf6da||0xc8;return function(_0x12bce7){if(_0x12bce7){return _0x1ec1a4['status'](_0x4bf6da)[_0xea3d('0x1d')](_0x12bce7);}};}function respondWithFilteredResult(_0x726bb,_0x537909){return function(_0x4787e6){if(_0x4787e6){var _0x1d342c=typeof _0x537909[_0xea3d('0x1e')]===_0xea3d('0x1f')&&typeof _0x537909[_0xea3d('0x20')]==='undefined';var _0x4ded1a=_0x4787e6['count'];var _0x522569=_0x1d342c?0x0:_0x537909[_0xea3d('0x1e')];var _0x48eca0=_0x1d342c?_0x4787e6['count']:_0x537909[_0xea3d('0x1e')]+_0x537909[_0xea3d('0x20')];var _0x3b8486;if(_0x48eca0>=_0x4ded1a){_0x48eca0=_0x4ded1a;_0x3b8486=0xc8;}else{_0x3b8486=0xce;}_0x726bb['status'](_0x3b8486);return _0x726bb[_0xea3d('0x21')](_0xea3d('0x22'),_0x522569+'-'+_0x48eca0+'/'+_0x4ded1a)['json'](_0x4787e6);}return null;};}function patchUpdates(_0x6656b4){return function(_0x33de06){try{jsonpatch[_0xea3d('0x23')](_0x33de06,_0x6656b4,!![]);}catch(_0x48d0da){return BPromise[_0xea3d('0x24')](_0x48d0da);}return _0x33de06['save']();};}function saveUpdates(_0x3c8e82,_0x2d3381){return function(_0x27bacd){if(_0x27bacd){return _0x27bacd[_0xea3d('0x25')](_0x3c8e82)[_0xea3d('0x26')](function(_0x11bbc6){return _0x11bbc6;});}return null;};}function removeEntity(_0x11ecb9,_0x407925){return function(_0x2318ab){if(_0x2318ab){return _0x2318ab[_0xea3d('0x27')]()[_0xea3d('0x26')](function(){_0x11ecb9[_0xea3d('0x1b')](0xcc)[_0xea3d('0x1c')]();});}};}function handleEntityNotFound(_0x5635d3,_0x356407){return function(_0x42f1ac){if(!_0x42f1ac){_0x5635d3[_0xea3d('0x1a')](0x194);}return _0x42f1ac;};}function handleError(_0x1c1fbe,_0x3a15a2){_0x3a15a2=_0x3a15a2||0x1f4;return function(_0x563f77){logger[_0xea3d('0x28')](_0x563f77[_0xea3d('0x29')]);if(_0x563f77[_0xea3d('0x2a')]){delete _0x563f77[_0xea3d('0x2a')];}_0x1c1fbe['status'](_0x3a15a2)[_0xea3d('0x2b')](_0x563f77);};}exports['index']=function(_0x2a3fbd,_0x2af7d1){var _0x3f2d27={},_0x59c295={},_0x2e522a={'count':0x0,'rows':[]};var _0x14eaf5=_[_0xea3d('0x2c')](db[_0xea3d('0x2d')][_0xea3d('0x2e')],function(_0x1bd692){return{'name':_0x1bd692[_0xea3d('0x2f')],'type':_0x1bd692['type'][_0xea3d('0x30')]};});_0x59c295[_0xea3d('0x31')]=_[_0xea3d('0x2c')](_0x14eaf5,_0xea3d('0x2a'));_0x59c295[_0xea3d('0x32')]=_[_0xea3d('0x33')](_0x2a3fbd['query']);_0x59c295['filters']=_['intersection'](_0x59c295['model'],_0x59c295[_0xea3d('0x32')]);_0x3f2d27[_0xea3d('0x34')]=_['intersection'](_0x59c295[_0xea3d('0x31')],qs['fields'](_0x2a3fbd[_0xea3d('0x32')]['fields']));_0x3f2d27[_0xea3d('0x34')]=_0x3f2d27['attributes'][_0xea3d('0x35')]?_0x3f2d27[_0xea3d('0x34')]:_0x59c295[_0xea3d('0x31')];if(!_0x2a3fbd[_0xea3d('0x32')][_0xea3d('0x36')](_0xea3d('0x37'))){_0x3f2d27[_0xea3d('0x20')]=qs['limit'](_0x2a3fbd[_0xea3d('0x32')][_0xea3d('0x20')]);_0x3f2d27['offset']=qs['offset'](_0x2a3fbd[_0xea3d('0x32')]['offset']);}_0x3f2d27['order']=qs[_0xea3d('0x38')](_0x2a3fbd['query'][_0xea3d('0x38')]);_0x3f2d27['where']=qs[_0xea3d('0x39')](_['pick'](_0x2a3fbd['query'],_0x59c295[_0xea3d('0x39')]),_0x14eaf5);if(_0x2a3fbd[_0xea3d('0x32')][_0xea3d('0x3a')]){_0x3f2d27[_0xea3d('0x3b')]=_[_0xea3d('0x3c')](_0x3f2d27[_0xea3d('0x3b')],{'$or':_[_0xea3d('0x2c')](_0x14eaf5,function(_0x48ffb7){if(_0x48ffb7['type']!==_0xea3d('0x3d')){var _0x43b80a={};_0x43b80a[_0x48ffb7['name']]={'$like':'%'+_0x2a3fbd['query'][_0xea3d('0x3a')]+'%'};return _0x43b80a;}})});}_0x3f2d27=_[_0xea3d('0x3c')]({},_0x3f2d27,_0x2a3fbd['options']);var _0x39cf67={'where':_0x3f2d27[_0xea3d('0x3b')]};return db[_0xea3d('0x2d')]['count'](_0x39cf67)[_0xea3d('0x26')](function(_0x533407){_0x2e522a['count']=_0x533407;if(_0x2a3fbd[_0xea3d('0x32')]['includeAll']){_0x3f2d27[_0xea3d('0x3e')]=[{'all':!![]}];}return db[_0xea3d('0x2d')][_0xea3d('0x3f')](_0x3f2d27);})['then'](function(_0x1b310b){_0x2e522a[_0xea3d('0x40')]=_0x1b310b;return _0x2e522a;})['then'](respondWithFilteredResult(_0x2af7d1,_0x3f2d27))[_0xea3d('0x41')](handleError(_0x2af7d1,null));};exports['show']=function(_0x39e1ae,_0x233918){var _0x491c72={'raw':!![],'where':{'id':_0x39e1ae[_0xea3d('0x42')]['id']}},_0x4c0f63={};_0x4c0f63[_0xea3d('0x31')]=_[_0xea3d('0x33')](db['FaxApplication']['rawAttributes']);_0x4c0f63[_0xea3d('0x32')]=_['keys'](_0x39e1ae[_0xea3d('0x32')]);_0x4c0f63[_0xea3d('0x39')]=_[_0xea3d('0x43')](_0x4c0f63['model'],_0x4c0f63[_0xea3d('0x32')]);_0x491c72[_0xea3d('0x34')]=_[_0xea3d('0x43')](_0x4c0f63[_0xea3d('0x31')],qs[_0xea3d('0x44')](_0x39e1ae[_0xea3d('0x32')][_0xea3d('0x44')]));_0x491c72[_0xea3d('0x34')]=_0x491c72[_0xea3d('0x34')][_0xea3d('0x35')]?_0x491c72['attributes']:_0x4c0f63['model'];if(_0x39e1ae[_0xea3d('0x32')]['includeAll']){_0x491c72[_0xea3d('0x3e')]=[{'all':!![]}];}_0x491c72=_[_0xea3d('0x3c')]({},_0x491c72,_0x39e1ae[_0xea3d('0x45')]);return db['FaxApplication'][_0xea3d('0x46')](_0x491c72)[_0xea3d('0x26')](handleEntityNotFound(_0x233918,null))[_0xea3d('0x26')](respondWithResult(_0x233918,null))[_0xea3d('0x41')](handleError(_0x233918,null));};exports['create']=function(_0x5e7361,_0x249ce3){return db[_0xea3d('0x2d')][_0xea3d('0x47')](_0x5e7361[_0xea3d('0x48')],{})[_0xea3d('0x26')](respondWithResult(_0x249ce3,0xc9))['catch'](handleError(_0x249ce3,null));};exports[_0xea3d('0x25')]=function(_0x3e7a10,_0x32c4c2){if(_0x3e7a10[_0xea3d('0x48')]['id']){delete _0x3e7a10[_0xea3d('0x48')]['id'];}return db[_0xea3d('0x2d')][_0xea3d('0x46')]({'where':{'id':_0x3e7a10[_0xea3d('0x42')]['id']}})[_0xea3d('0x26')](handleEntityNotFound(_0x32c4c2,null))['then'](saveUpdates(_0x3e7a10[_0xea3d('0x48')],null))[_0xea3d('0x26')](respondWithResult(_0x32c4c2,null))['catch'](handleError(_0x32c4c2,null));};exports[_0xea3d('0x27')]=function(_0x342416,_0x2d21aa){return db[_0xea3d('0x2d')][_0xea3d('0x46')]({'where':{'id':_0x342416['params']['id']}})['then'](handleEntityNotFound(_0x2d21aa,null))[_0xea3d('0x26')](removeEntity(_0x2d21aa,null))[_0xea3d('0x41')](handleError(_0x2d21aa,null));}; \ No newline at end of file +var _0x7e86=['then','sendStatus','error','stack','name','send','map','fieldName','type','key','model','query','keys','filters','intersection','fields','attributes','length','hasOwnProperty','order','where','filter','VIRTUAL','options','FaxApplication','includeAll','include','findAll','rows','params','rawAttributes','merge','catch','body','find','destroy','eml-format','rimraf','zip-dir','request-promise','moment','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','jsforce','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','status','end','offset','undefined','limit','count','set','json','reject','save','update'];(function(_0x5df326,_0x21fa65){var _0x118129=function(_0x632b4c){while(--_0x632b4c){_0x5df326['push'](_0x5df326['shift']());}};_0x118129(++_0x21fa65);}(_0x7e86,0x6d));var _0x67e8=function(_0x491dff,_0x3c5934){_0x491dff=_0x491dff-0x0;var _0x12c66d=_0x7e86[_0x491dff];return _0x12c66d;};'use strict';var emlformat=require(_0x67e8('0x0'));var rimraf=require(_0x67e8('0x1'));var zipdir=require(_0x67e8('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x67e8('0x3'));var moment=require(_0x67e8('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x67e8('0x5'));var util=require(_0x67e8('0x6'));var path=require(_0x67e8('0x7'));var sox=require(_0x67e8('0x8'));var csv=require(_0x67e8('0x9'));var ejs=require(_0x67e8('0xa'));var fs=require('fs');var fs_extra=require(_0x67e8('0xb'));var _=require(_0x67e8('0xc'));var squel=require(_0x67e8('0xd'));var crypto=require('crypto');var jsforce=require(_0x67e8('0xe'));var deskjs=require('desk.js');var toCsv=require(_0x67e8('0x9'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x67e8('0xf'));var authService=require(_0x67e8('0x10'));var qs=require(_0x67e8('0x11'));var as=require(_0x67e8('0x12'));var hardwareService=require(_0x67e8('0x13'));var logger=require(_0x67e8('0x14'))(_0x67e8('0x15'));var utils=require(_0x67e8('0x16'));var config=require(_0x67e8('0x17'));var licenseUtil=require(_0x67e8('0x18'));var db=require(_0x67e8('0x19'))['db'];function respondWithStatusCode(_0x47b7d2,_0x57de99){_0x57de99=_0x57de99||0xcc;return function(_0x997e0b){if(_0x997e0b){return _0x47b7d2['sendStatus'](_0x57de99);}return _0x47b7d2[_0x67e8('0x1a')](_0x57de99)[_0x67e8('0x1b')]();};}function respondWithResult(_0x5bac7a,_0x82056e){_0x82056e=_0x82056e||0xc8;return function(_0x558d0b){if(_0x558d0b){return _0x5bac7a[_0x67e8('0x1a')](_0x82056e)['json'](_0x558d0b);}};}function respondWithFilteredResult(_0x1df7e6,_0x2dc7d7){return function(_0x2ade4e){if(_0x2ade4e){var _0x1c79bb=typeof _0x2dc7d7[_0x67e8('0x1c')]===_0x67e8('0x1d')&&typeof _0x2dc7d7[_0x67e8('0x1e')]==='undefined';var _0x1bc5ca=_0x2ade4e[_0x67e8('0x1f')];var _0x31e7f9=_0x1c79bb?0x0:_0x2dc7d7[_0x67e8('0x1c')];var _0x249693=_0x1c79bb?_0x2ade4e['count']:_0x2dc7d7[_0x67e8('0x1c')]+_0x2dc7d7[_0x67e8('0x1e')];var _0x3342ba;if(_0x249693>=_0x1bc5ca){_0x249693=_0x1bc5ca;_0x3342ba=0xc8;}else{_0x3342ba=0xce;}_0x1df7e6['status'](_0x3342ba);return _0x1df7e6[_0x67e8('0x20')]('Content-Range',_0x31e7f9+'-'+_0x249693+'/'+_0x1bc5ca)[_0x67e8('0x21')](_0x2ade4e);}return null;};}function patchUpdates(_0x7a3585){return function(_0x32c872){try{jsonpatch['apply'](_0x32c872,_0x7a3585,!![]);}catch(_0x38e084){return BPromise[_0x67e8('0x22')](_0x38e084);}return _0x32c872[_0x67e8('0x23')]();};}function saveUpdates(_0x170519,_0x171857){return function(_0x4f58b4){if(_0x4f58b4){return _0x4f58b4[_0x67e8('0x24')](_0x170519)['then'](function(_0x59e4ad){return _0x59e4ad;});}return null;};}function removeEntity(_0x4aa5ea,_0x726aaa){return function(_0x3a88de){if(_0x3a88de){return _0x3a88de['destroy']()[_0x67e8('0x25')](function(){_0x4aa5ea[_0x67e8('0x1a')](0xcc)['end']();});}};}function handleEntityNotFound(_0x3b9c90,_0x27c2ba){return function(_0x3bfc2c){if(!_0x3bfc2c){_0x3b9c90[_0x67e8('0x26')](0x194);}return _0x3bfc2c;};}function handleError(_0x4d406d,_0x48438c){_0x48438c=_0x48438c||0x1f4;return function(_0xd9ea78){logger[_0x67e8('0x27')](_0xd9ea78[_0x67e8('0x28')]);if(_0xd9ea78[_0x67e8('0x29')]){delete _0xd9ea78[_0x67e8('0x29')];}_0x4d406d[_0x67e8('0x1a')](_0x48438c)[_0x67e8('0x2a')](_0xd9ea78);};}exports['index']=function(_0x4593c5,_0x59f40a){var _0x1f7d1f={},_0x57ad76={},_0x4a0b83={'count':0x0,'rows':[]};var _0x3900e2=_[_0x67e8('0x2b')](db['FaxApplication']['rawAttributes'],function(_0x307305){return{'name':_0x307305[_0x67e8('0x2c')],'type':_0x307305[_0x67e8('0x2d')][_0x67e8('0x2e')]};});_0x57ad76[_0x67e8('0x2f')]=_['map'](_0x3900e2,'name');_0x57ad76[_0x67e8('0x30')]=_[_0x67e8('0x31')](_0x4593c5[_0x67e8('0x30')]);_0x57ad76[_0x67e8('0x32')]=_[_0x67e8('0x33')](_0x57ad76[_0x67e8('0x2f')],_0x57ad76[_0x67e8('0x30')]);_0x1f7d1f['attributes']=_['intersection'](_0x57ad76['model'],qs[_0x67e8('0x34')](_0x4593c5[_0x67e8('0x30')][_0x67e8('0x34')]));_0x1f7d1f['attributes']=_0x1f7d1f[_0x67e8('0x35')][_0x67e8('0x36')]?_0x1f7d1f[_0x67e8('0x35')]:_0x57ad76[_0x67e8('0x2f')];if(!_0x4593c5['query'][_0x67e8('0x37')]('nolimit')){_0x1f7d1f[_0x67e8('0x1e')]=qs[_0x67e8('0x1e')](_0x4593c5[_0x67e8('0x30')][_0x67e8('0x1e')]);_0x1f7d1f['offset']=qs[_0x67e8('0x1c')](_0x4593c5[_0x67e8('0x30')][_0x67e8('0x1c')]);}_0x1f7d1f[_0x67e8('0x38')]=qs['sort'](_0x4593c5[_0x67e8('0x30')]['sort']);_0x1f7d1f[_0x67e8('0x39')]=qs[_0x67e8('0x32')](_['pick'](_0x4593c5[_0x67e8('0x30')],_0x57ad76[_0x67e8('0x32')]),_0x3900e2);if(_0x4593c5[_0x67e8('0x30')][_0x67e8('0x3a')]){_0x1f7d1f[_0x67e8('0x39')]=_['merge'](_0x1f7d1f[_0x67e8('0x39')],{'$or':_[_0x67e8('0x2b')](_0x3900e2,function(_0x5513ea){if(_0x5513ea[_0x67e8('0x2d')]!==_0x67e8('0x3b')){var _0x36450e={};_0x36450e[_0x5513ea[_0x67e8('0x29')]]={'$like':'%'+_0x4593c5[_0x67e8('0x30')][_0x67e8('0x3a')]+'%'};return _0x36450e;}})});}_0x1f7d1f=_['merge']({},_0x1f7d1f,_0x4593c5[_0x67e8('0x3c')]);var _0x4622e={'where':_0x1f7d1f[_0x67e8('0x39')]};return db[_0x67e8('0x3d')][_0x67e8('0x1f')](_0x4622e)[_0x67e8('0x25')](function(_0x43a9cb){_0x4a0b83['count']=_0x43a9cb;if(_0x4593c5['query'][_0x67e8('0x3e')]){_0x1f7d1f[_0x67e8('0x3f')]=[{'all':!![]}];}return db[_0x67e8('0x3d')][_0x67e8('0x40')](_0x1f7d1f);})[_0x67e8('0x25')](function(_0x3fa2d1){_0x4a0b83[_0x67e8('0x41')]=_0x3fa2d1;return _0x4a0b83;})[_0x67e8('0x25')](respondWithFilteredResult(_0x59f40a,_0x1f7d1f))['catch'](handleError(_0x59f40a,null));};exports['show']=function(_0x99de93,_0x1e7a7c){var _0x2d8a3e={'raw':!![],'where':{'id':_0x99de93[_0x67e8('0x42')]['id']}},_0x4976e1={};_0x4976e1['model']=_[_0x67e8('0x31')](db[_0x67e8('0x3d')][_0x67e8('0x43')]);_0x4976e1['query']=_[_0x67e8('0x31')](_0x99de93['query']);_0x4976e1[_0x67e8('0x32')]=_['intersection'](_0x4976e1['model'],_0x4976e1[_0x67e8('0x30')]);_0x2d8a3e[_0x67e8('0x35')]=_[_0x67e8('0x33')](_0x4976e1[_0x67e8('0x2f')],qs['fields'](_0x99de93[_0x67e8('0x30')]['fields']));_0x2d8a3e[_0x67e8('0x35')]=_0x2d8a3e['attributes'][_0x67e8('0x36')]?_0x2d8a3e[_0x67e8('0x35')]:_0x4976e1[_0x67e8('0x2f')];if(_0x99de93[_0x67e8('0x30')][_0x67e8('0x3e')]){_0x2d8a3e[_0x67e8('0x3f')]=[{'all':!![]}];}_0x2d8a3e=_[_0x67e8('0x44')]({},_0x2d8a3e,_0x99de93[_0x67e8('0x3c')]);return db[_0x67e8('0x3d')]['find'](_0x2d8a3e)['then'](handleEntityNotFound(_0x1e7a7c,null))['then'](respondWithResult(_0x1e7a7c,null))[_0x67e8('0x45')](handleError(_0x1e7a7c,null));};exports['create']=function(_0x513afe,_0x49acc8){return db['FaxApplication']['create'](_0x513afe[_0x67e8('0x46')],{})[_0x67e8('0x25')](respondWithResult(_0x49acc8,0xc9))[_0x67e8('0x45')](handleError(_0x49acc8,null));};exports['update']=function(_0x5498d9,_0x2f11d7){if(_0x5498d9['body']['id']){delete _0x5498d9[_0x67e8('0x46')]['id'];}return db[_0x67e8('0x3d')][_0x67e8('0x47')]({'where':{'id':_0x5498d9[_0x67e8('0x42')]['id']}})[_0x67e8('0x25')](handleEntityNotFound(_0x2f11d7,null))[_0x67e8('0x25')](saveUpdates(_0x5498d9[_0x67e8('0x46')],null))['then'](respondWithResult(_0x2f11d7,null))[_0x67e8('0x45')](handleError(_0x2f11d7,null));};exports[_0x67e8('0x48')]=function(_0xd39e2a,_0x8ed238){return db['FaxApplication'][_0x67e8('0x47')]({'where':{'id':_0xd39e2a[_0x67e8('0x42')]['id']}})['then'](handleEntityNotFound(_0x8ed238,null))[_0x67e8('0x25')](removeEntity(_0x8ed238,null))[_0x67e8('0x45')](handleError(_0x8ed238,null));}; \ No newline at end of file diff --git a/server/api/faxApplication/faxApplication.model.js b/server/api/faxApplication/faxApplication.model.js index 6e40670..a6f9ed8 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 _0x966d=['rimraf','../../config/environment','./faxApplication.attributes','exports','define','fax_applications','utf8mb4_unicode_ci','../../config/logger','api','moment','bluebird','path'];(function(_0x3ae033,_0x154aca){var _0x13dca7=function(_0x479c29){while(--_0x479c29){_0x3ae033['push'](_0x3ae033['shift']());}};_0x13dca7(++_0x154aca);}(_0x966d,0x1e7));var _0xd966=function(_0x5d1fd3,_0xa9527f){_0x5d1fd3=_0x5d1fd3-0x0;var _0x2ae6df=_0x966d[_0x5d1fd3];return _0x2ae6df;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0xd966('0x0'))(_0xd966('0x1'));var moment=require(_0xd966('0x2'));var BPromise=require(_0xd966('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xd966('0x4'));var rimraf=require(_0xd966('0x5'));var config=require(_0xd966('0x6'));var attributes=require(_0xd966('0x7'));module[_0xd966('0x8')]=function(_0xd4180c,_0x326080){return _0xd4180c[_0xd966('0x9')]('FaxApplication',attributes,{'tableName':_0xd966('0xa'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':'utf8mb4','collate':_0xd966('0xb')});}; \ No newline at end of file +var _0x72ce=['utf8mb4_unicode_ci','lodash','api','rimraf','../../config/environment','exports','FaxApplication'];(function(_0xae7c2f,_0xf31e04){var _0x5d7001=function(_0x4eeadb){while(--_0x4eeadb){_0xae7c2f['push'](_0xae7c2f['shift']());}};_0x5d7001(++_0xf31e04);}(_0x72ce,0x182));var _0xe72c=function(_0x4cc1d0,_0x208f90){_0x4cc1d0=_0x4cc1d0-0x0;var _0x56da18=_0x72ce[_0x4cc1d0];return _0x56da18;};'use strict';var _=require(_0xe72c('0x0'));var util=require('util');var logger=require('../../config/logger')(_0xe72c('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0xe72c('0x2'));var config=require(_0xe72c('0x3'));var attributes=require('./faxApplication.attributes');module[_0xe72c('0x4')]=function(_0x381be6,_0x213523){return _0x381be6['define'](_0xe72c('0x5'),attributes,{'tableName':'fax_applications','paranoid':![],'indexes':[],'timestamps':!![],'charset':'utf8mb4','collate':_0xe72c('0x6')});}; \ No newline at end of file diff --git a/server/api/faxApplication/faxApplication.rpc.js b/server/api/faxApplication/faxApplication.rpc.js index 88bacc7..5afc658 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 _0x8e67=['randomstring','ioredis','../../config/utils','../../config/logger','rpc','jayson/promise','http','request','then','info','request\x20sent','FaxApplication,\x20%s,\x20%s,\x20%s','stringify','error','FaxApplication,\x20%s,\x20%s','message','catch','FaxApplication','update','body','options','raw','where','attributes','limit','UpdateFaxApplication','debug','lodash','util','bluebird'];(function(_0x17ec13,_0x303855){var _0x1a8c12=function(_0xf82e9e){while(--_0xf82e9e){_0x17ec13['push'](_0x17ec13['shift']());}};_0x1a8c12(++_0x303855);}(_0x8e67,0x75));var _0x78e6=function(_0x342baa,_0x4a110f){_0x342baa=_0x342baa-0x0;var _0x1208f3=_0x8e67[_0x342baa];return _0x1208f3;};'use strict';var _=require(_0x78e6('0x0'));var util=require(_0x78e6('0x1'));var moment=require('moment');var BPromise=require(_0x78e6('0x2'));var rs=require(_0x78e6('0x3'));var fs=require('fs');var Redis=require(_0x78e6('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x78e6('0x5'));var logger=require(_0x78e6('0x6'))(_0x78e6('0x7'));var config=require('../../config/environment');var jayson=require(_0x78e6('0x8'));var client=jayson['client'][_0x78e6('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x5391cd,_0x3c4265,_0x59c862){return new BPromise(function(_0x78905c,_0x5198f6){return client[_0x78e6('0xa')](_0x5391cd,_0x59c862)[_0x78e6('0xb')](function(_0x23e521){logger[_0x78e6('0xc')]('FaxApplication,\x20%s,\x20%s',_0x3c4265,_0x78e6('0xd'));logger['debug'](_0x78e6('0xe'),_0x3c4265,'request\x20sent',JSON[_0x78e6('0xf')](_0x23e521));if(_0x23e521[_0x78e6('0x10')]){if(_0x23e521[_0x78e6('0x10')]['code']===0x1f4){logger['error'](_0x78e6('0x11'),_0x3c4265,_0x23e521['error'][_0x78e6('0x12')]);return _0x5198f6(_0x23e521['error'][_0x78e6('0x12')]);}logger['error']('FaxApplication,\x20%s,\x20%s',_0x3c4265,_0x23e521[_0x78e6('0x10')][_0x78e6('0x12')]);return _0x78905c(_0x23e521[_0x78e6('0x10')][_0x78e6('0x12')]);}else{logger['info']('FaxApplication,\x20%s,\x20%s',_0x3c4265,_0x78e6('0xd'));_0x78905c(_0x23e521['result'][_0x78e6('0x12')]);}})[_0x78e6('0x13')](function(_0x262723){logger[_0x78e6('0x10')](_0x78e6('0x11'),_0x3c4265,_0x262723);_0x5198f6(_0x262723);});});}exports['UpdateFaxApplication']=function(_0xa49aa8){var _0x54abc3=this;return new Promise(function(_0x37d629,_0x176cc2){return db[_0x78e6('0x14')][_0x78e6('0x15')](_0xa49aa8[_0x78e6('0x16')],{'raw':_0xa49aa8[_0x78e6('0x17')]?_0xa49aa8[_0x78e6('0x17')][_0x78e6('0x18')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0xa49aa8[_0x78e6('0x17')]?_0xa49aa8[_0x78e6('0x17')][_0x78e6('0x19')]||null:null,'attributes':_0xa49aa8[_0x78e6('0x17')]?_0xa49aa8[_0x78e6('0x17')][_0x78e6('0x1a')]||null:null,'limit':_0xa49aa8['options']?_0xa49aa8['options'][_0x78e6('0x1b')]||null:null})['then'](function(_0x28b71c){logger['info'](_0x78e6('0x1c'),_0xa49aa8);logger[_0x78e6('0x1d')]('UpdateFaxApplication',_0xa49aa8,JSON[_0x78e6('0xf')](_0x28b71c));_0x37d629(_0x28b71c);})['catch'](function(_0x471489){logger[_0x78e6('0x10')](_0x78e6('0x1c'),_0x471489[_0x78e6('0x12')],_0xa49aa8);_0x176cc2(_0x54abc3[_0x78e6('0x10')](0x1f4,_0x471489['message']));});});}; \ No newline at end of file +var _0x9ca2=['update','body','options','raw','where','attributes','limit','then','util','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','http','info','FaxApplication,\x20%s,\x20%s','debug','FaxApplication,\x20%s,\x20%s,\x20%s','request\x20sent','error','message','result','catch','UpdateFaxApplication'];(function(_0x3364db,_0x5e2522){var _0x526ea9=function(_0x35b5d3){while(--_0x35b5d3){_0x3364db['push'](_0x3364db['shift']());}};_0x526ea9(++_0x5e2522);}(_0x9ca2,0x13c));var _0x29ca=function(_0x35b29e,_0x353c07){_0x35b29e=_0x35b29e-0x0;var _0xb29026=_0x9ca2[_0x35b29e];return _0xb29026;};'use strict';var _=require('lodash');var util=require(_0x29ca('0x0'));var moment=require(_0x29ca('0x1'));var BPromise=require(_0x29ca('0x2'));var rs=require(_0x29ca('0x3'));var fs=require('fs');var Redis=require(_0x29ca('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x29ca('0x5'));var logger=require(_0x29ca('0x6'))(_0x29ca('0x7'));var config=require(_0x29ca('0x8'));var jayson=require('jayson/promise');var client=jayson['client'][_0x29ca('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x267231,_0x5e4b8f,_0x5b64f2){return new BPromise(function(_0x4b3d2a,_0x1d21e3){return client['request'](_0x267231,_0x5b64f2)['then'](function(_0x2a932b){logger[_0x29ca('0xa')](_0x29ca('0xb'),_0x5e4b8f,'request\x20sent');logger[_0x29ca('0xc')](_0x29ca('0xd'),_0x5e4b8f,_0x29ca('0xe'),JSON['stringify'](_0x2a932b));if(_0x2a932b[_0x29ca('0xf')]){if(_0x2a932b[_0x29ca('0xf')]['code']===0x1f4){logger[_0x29ca('0xf')]('FaxApplication,\x20%s,\x20%s',_0x5e4b8f,_0x2a932b['error'][_0x29ca('0x10')]);return _0x1d21e3(_0x2a932b['error'][_0x29ca('0x10')]);}logger[_0x29ca('0xf')](_0x29ca('0xb'),_0x5e4b8f,_0x2a932b[_0x29ca('0xf')]['message']);return _0x4b3d2a(_0x2a932b['error']['message']);}else{logger[_0x29ca('0xa')](_0x29ca('0xb'),_0x5e4b8f,_0x29ca('0xe'));_0x4b3d2a(_0x2a932b[_0x29ca('0x11')][_0x29ca('0x10')]);}})[_0x29ca('0x12')](function(_0x1f532a){logger[_0x29ca('0xf')](_0x29ca('0xb'),_0x5e4b8f,_0x1f532a);_0x1d21e3(_0x1f532a);});});}exports[_0x29ca('0x13')]=function(_0xe547c2){var _0x5082f4=this;return new Promise(function(_0x287a70,_0x4924fb){return db['FaxApplication'][_0x29ca('0x14')](_0xe547c2[_0x29ca('0x15')],{'raw':_0xe547c2['options']?_0xe547c2[_0x29ca('0x16')][_0x29ca('0x17')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0xe547c2[_0x29ca('0x16')]?_0xe547c2[_0x29ca('0x16')][_0x29ca('0x18')]||null:null,'attributes':_0xe547c2[_0x29ca('0x16')]?_0xe547c2[_0x29ca('0x16')][_0x29ca('0x19')]||null:null,'limit':_0xe547c2[_0x29ca('0x16')]?_0xe547c2['options'][_0x29ca('0x1a')]||null:null})[_0x29ca('0x1b')](function(_0x2dc216){logger['info'](_0x29ca('0x13'),_0xe547c2);logger[_0x29ca('0xc')](_0x29ca('0x13'),_0xe547c2,JSON['stringify'](_0x2dc216));_0x287a70(_0x2dc216);})[_0x29ca('0x12')](function(_0x27c1f7){logger[_0x29ca('0xf')](_0x29ca('0x13'),_0x27c1f7[_0x29ca('0x10')],_0xe547c2);_0x4924fb(_0x5082f4[_0x29ca('0xf')](0x1f4,_0x27c1f7[_0x29ca('0x10')]));});});}; \ No newline at end of file diff --git a/server/api/faxApplication/index.js b/server/api/faxApplication/index.js index 94df091..b8c4ba3 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 _0x3266=['exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./faxApplication.controller','isAuthenticated','index','get','post','create','put','/:id','update','delete','destroy'];(function(_0x3bf83f,_0x181cac){var _0x22c4a9=function(_0xb3ff0d){while(--_0xb3ff0d){_0x3bf83f['push'](_0x3bf83f['shift']());}};_0x22c4a9(++_0x181cac);}(_0x3266,0x6a));var _0x6326=function(_0x2aecb2,_0x343312){_0x2aecb2=_0x2aecb2-0x0;var _0x3ebb80=_0x3266[_0x2aecb2];return _0x3ebb80;};'use strict';var multer=require(_0x6326('0x0'));var util=require(_0x6326('0x1'));var path=require(_0x6326('0x2'));var timeout=require(_0x6326('0x3'));var express=require(_0x6326('0x4'));var router=express[_0x6326('0x5')]();var fs_extra=require(_0x6326('0x6'));var auth=require(_0x6326('0x7'));var interaction=require(_0x6326('0x8'));var config=require('../../config/environment');var controller=require(_0x6326('0x9'));router['get']('/',auth[_0x6326('0xa')](),controller[_0x6326('0xb')]);router[_0x6326('0xc')]('/:id',auth[_0x6326('0xa')](),controller['show']);router[_0x6326('0xd')]('/',auth[_0x6326('0xa')](),controller[_0x6326('0xe')]);router[_0x6326('0xf')](_0x6326('0x10'),auth['isAuthenticated'](),controller[_0x6326('0x11')]);router[_0x6326('0x12')](_0x6326('0x10'),auth[_0x6326('0xa')](),controller[_0x6326('0x13')]);module[_0x6326('0x14')]=router; \ No newline at end of file +var _0x3423=['fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./faxApplication.controller','get','isAuthenticated','index','/:id','show','post','create','destroy','exports','path','connect-timeout','express','Router'];(function(_0xf1c200,_0xfec1d4){var _0x35750e=function(_0x526c68){while(--_0x526c68){_0xf1c200['push'](_0xf1c200['shift']());}};_0x35750e(++_0xfec1d4);}(_0x3423,0x188));var _0x3342=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x3423[_0x3dd15e];return _0x231fd0;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x3342('0x0'));var timeout=require(_0x3342('0x1'));var express=require(_0x3342('0x2'));var router=express[_0x3342('0x3')]();var fs_extra=require(_0x3342('0x4'));var auth=require(_0x3342('0x5'));var interaction=require(_0x3342('0x6'));var config=require(_0x3342('0x7'));var controller=require(_0x3342('0x8'));router[_0x3342('0x9')]('/',auth[_0x3342('0xa')](),controller[_0x3342('0xb')]);router[_0x3342('0x9')](_0x3342('0xc'),auth[_0x3342('0xa')](),controller[_0x3342('0xd')]);router[_0x3342('0xe')]('/',auth[_0x3342('0xa')](),controller[_0x3342('0xf')]);router['put']('/:id',auth[_0x3342('0xa')](),controller['update']);router['delete']('/:id',auth['isAuthenticated'](),controller[_0x3342('0x10')]);module[_0x3342('0x11')]=router; \ No newline at end of file diff --git a/server/api/faxInteraction/faxInteraction.attributes.js b/server/api/faxInteraction/faxInteraction.attributes.js index f518569..84940c5 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 _0x57ca=['STRING','DATE','ENUM','out','INTEGER','exports','BOOLEAN'];(function(_0x1e7788,_0x2c0e2f){var _0x7da817=function(_0x213204){while(--_0x213204){_0x1e7788['push'](_0x1e7788['shift']());}};_0x7da817(++_0x2c0e2f);}(_0x57ca,0x108));var _0xa57c=function(_0x197939,_0x4bafd6){_0x197939=_0x197939-0x0;var _0x21e0e4=_0x57ca[_0x197939];return _0x21e0e4;};'use strict';var Sequelize=require('sequelize');module[_0xa57c('0x0')]={'closed':{'type':Sequelize[_0xa57c('0x1')],'defaultValue':![]},'closedAt':{'type':Sequelize['DATE']},'disposition':{'type':Sequelize[_0xa57c('0x2')]},'secondDisposition':{'type':Sequelize[_0xa57c('0x2')]},'thirdDisposition':{'type':Sequelize[_0xa57c('0x2')]},'note':{'type':Sequelize[_0xa57c('0x2')]},'read1stAt':{'type':Sequelize[_0xa57c('0x3')]},'fax':{'type':Sequelize['STRING']},'firstMsgDirection':{'type':Sequelize[_0xa57c('0x4')]('in',_0xa57c('0x5')),'defaultValue':'in','allowNull':![]},'lastMsgAt':{'type':Sequelize[_0xa57c('0x3')]},'lastMsgDirection':{'type':Sequelize[_0xa57c('0x4')]('in',_0xa57c('0x5')),'defaultValue':'in','allowNull':![]},'queueId':{'type':Sequelize[_0xa57c('0x6')]}}; \ No newline at end of file +var _0xa456=['out','INTEGER','sequelize','exports','BOOLEAN','DATE','STRING','ENUM'];(function(_0x32cbe0,_0x403849){var _0x532da5=function(_0x30f0b4){while(--_0x30f0b4){_0x32cbe0['push'](_0x32cbe0['shift']());}};_0x532da5(++_0x403849);}(_0xa456,0x142));var _0x6a45=function(_0x500419,_0x549162){_0x500419=_0x500419-0x0;var _0x241c1a=_0xa456[_0x500419];return _0x241c1a;};'use strict';var Sequelize=require(_0x6a45('0x0'));module[_0x6a45('0x1')]={'closed':{'type':Sequelize[_0x6a45('0x2')],'defaultValue':![]},'closedAt':{'type':Sequelize[_0x6a45('0x3')]},'disposition':{'type':Sequelize['STRING']},'secondDisposition':{'type':Sequelize[_0x6a45('0x4')]},'thirdDisposition':{'type':Sequelize[_0x6a45('0x4')]},'note':{'type':Sequelize[_0x6a45('0x4')]},'read1stAt':{'type':Sequelize['DATE']},'fax':{'type':Sequelize[_0x6a45('0x4')]},'firstMsgDirection':{'type':Sequelize[_0x6a45('0x5')]('in',_0x6a45('0x6')),'defaultValue':'in','allowNull':![]},'lastMsgAt':{'type':Sequelize[_0x6a45('0x3')]},'lastMsgDirection':{'type':Sequelize['ENUM']('in',_0x6a45('0x6')),'defaultValue':'in','allowNull':![]},'queueId':{'type':Sequelize[_0x6a45('0x7')]}}; \ No newline at end of file diff --git a/server/api/faxInteraction/faxInteraction.controller.js b/server/api/faxInteraction/faxInteraction.controller.js index 3dad55a..c63504a 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 _0x45c5=['err','sendStatus','rimraf','zip-dir','moment','bluebird','util','path','../../components/interaction/service','../../components/parsers/qs','../../config/logger','api','../../config/environment','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./faxInteraction.socket','status','end','json','offset','undefined','count','limit','set','Content-Range','update','then','destroy','stack','name','index','map','FaxInteraction','rawAttributes','type','key','getOptions','findAll','fax','query','params','model','keys','attributes','intersection','fields','length','includeAll','include','merge','options','find','catch','create','body','describe','addMessage','FaxMessage','ids','omit','findOne','order','sort','where','filters','pick','FaxInteractionId','$gte','split','format','YYYY-MM-DD\x20HH:mm:ss','rows','addTags','setTags','Tag','color','faxInteractionTags:save','removeTags','download','unix','toString','root','server','files','attachments','join','transcript-%d-%s.zip','push','Attachment','Messages','createdAt','get','basename','existsSync','createReadStream','pipe','createWriteStream','resolve','log'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0x45c5,0x68));var _0x545c=function(_0x457539,_0x15025c){_0x457539=_0x457539-0x0;var _0x951b03=_0x45c5[_0x457539];return _0x951b03;};'use strict';var rimraf=require(_0x545c('0x0'));var zipdir=require(_0x545c('0x1'));var moment=require(_0x545c('0x2'));var BPromise=require(_0x545c('0x3'));var util=require(_0x545c('0x4'));var path=require(_0x545c('0x5'));var fs=require('fs');var _=require('lodash');var Redis=require('ioredis');var interaction=require(_0x545c('0x6'));var qs=require(_0x545c('0x7'));var logger=require(_0x545c('0x8'))(_0x545c('0x9'));var config=require(_0x545c('0xa'));var db=require(_0x545c('0xb'))['db'];config[_0x545c('0xc')]=_[_0x545c('0xd')](config['redis'],{'host':_0x545c('0xe'),'port':0x18eb});var socket=require(_0x545c('0xf'))(new Redis(config[_0x545c('0xc')]));require(_0x545c('0x10'))['register'](socket);function respondWithStatusCode(_0x29a86f,_0x3fe70e){_0x3fe70e=_0x3fe70e||0xcc;return function(_0x194a0c){if(_0x194a0c){return _0x29a86f['sendStatus'](_0x3fe70e);}return _0x29a86f[_0x545c('0x11')](_0x3fe70e)[_0x545c('0x12')]();};}function respondWithResult(_0xec3504,_0x4f341f){_0x4f341f=_0x4f341f||0xc8;return function(_0xa37300){if(_0xa37300){return _0xec3504[_0x545c('0x11')](_0x4f341f)[_0x545c('0x13')](_0xa37300);}};}function respondWithFilteredResult(_0xf985a2,_0x43e326){return function(_0x155454){if(_0x155454){var _0x5f077c=typeof _0x43e326[_0x545c('0x14')]==='undefined'&&typeof _0x43e326['limit']===_0x545c('0x15');var _0xb5b1d8=_0x155454[_0x545c('0x16')];var _0x11dd97=_0x5f077c?0x0:_0x43e326['offset'];var _0x2e5343=_0x5f077c?_0x155454[_0x545c('0x16')]:_0x43e326['offset']+_0x43e326[_0x545c('0x17')];var _0x24d2be;if(_0x2e5343>=_0xb5b1d8){_0x2e5343=_0xb5b1d8;_0x24d2be=0xc8;}else{_0x24d2be=0xce;}_0xf985a2[_0x545c('0x11')](_0x24d2be);return _0xf985a2[_0x545c('0x18')](_0x545c('0x19'),_0x11dd97+'-'+_0x2e5343+'/'+_0xb5b1d8)[_0x545c('0x13')](_0x155454);}return null;};}function saveUpdates(_0xf8d343){return function(_0x53dac3){if(_0x53dac3){return _0x53dac3[_0x545c('0x1a')](_0xf8d343)[_0x545c('0x1b')](function(_0x5db260){return _0x5db260;});}return null;};}function removeEntity(_0x5504d1){return function(_0x474796){if(_0x474796){return _0x474796[_0x545c('0x1c')]()[_0x545c('0x1b')](function(){_0x5504d1[_0x545c('0x11')](0xcc)[_0x545c('0x12')]();});}};}function handleEntityNotFound(_0x8c99f7){return function(_0x3ab1ec){if(!_0x3ab1ec){_0x8c99f7['sendStatus'](0x194);}return _0x3ab1ec;};}function handleError(_0x5f2aa1,_0x1ad98e){_0x1ad98e=_0x1ad98e||0x1f4;return function(_0x46aadb){logger['error'](_0x46aadb[_0x545c('0x1d')]);if(_0x46aadb[_0x545c('0x1e')]){delete _0x46aadb['name'];}_0x5f2aa1[_0x545c('0x11')](_0x1ad98e)['send'](_0x46aadb);};}exports[_0x545c('0x1f')]=function(_0x43c656,_0x2fdfbb){var _0x3d623e={};var _0x343af7=_[_0x545c('0x20')](db[_0x545c('0x21')][_0x545c('0x22')],function(_0x3cf5ef){return{'name':_0x3cf5ef['fieldName'],'type':_0x3cf5ef[_0x545c('0x23')][_0x545c('0x24')]};});_0x3d623e=qs[_0x545c('0x25')](_0x343af7,_0x43c656);return interaction[_0x545c('0x26')](_0x545c('0x27'),_0x43c656[_0x545c('0x28')],_0x43c656['user'],_0x3d623e,_0x343af7)['then'](respondWithFilteredResult(_0x2fdfbb,_0x3d623e))['catch'](handleError(_0x2fdfbb,null));};exports['show']=function(_0x341789,_0x52d2fc){var _0x213e1b={'raw':![],'where':{'id':_0x341789[_0x545c('0x29')]['id']}},_0x326255={};_0x326255[_0x545c('0x2a')]=_['keys'](db['FaxInteraction'][_0x545c('0x22')]);_0x326255[_0x545c('0x28')]=_[_0x545c('0x2b')](_0x341789['query']);_0x326255['filters']=_['intersection'](_0x326255[_0x545c('0x2a')],_0x326255[_0x545c('0x28')]);_0x213e1b[_0x545c('0x2c')]=_[_0x545c('0x2d')](_0x326255[_0x545c('0x2a')],qs[_0x545c('0x2e')](_0x341789[_0x545c('0x28')]['fields']));_0x213e1b['attributes']=_0x213e1b[_0x545c('0x2c')][_0x545c('0x2f')]?_0x213e1b['attributes']:_0x326255[_0x545c('0x2a')];if(_0x341789['query'][_0x545c('0x30')]){_0x213e1b[_0x545c('0x31')]=[{'all':!![]}];}_0x213e1b=_[_0x545c('0x32')]({},_0x213e1b,_0x341789[_0x545c('0x33')]);return db[_0x545c('0x21')][_0x545c('0x34')](_0x213e1b)[_0x545c('0x1b')](handleEntityNotFound(_0x52d2fc,null))[_0x545c('0x1b')](respondWithResult(_0x52d2fc,null))[_0x545c('0x35')](handleError(_0x52d2fc,null));};exports['create']=function(_0x26233e,_0x16c2b5){return db['FaxInteraction'][_0x545c('0x36')](_0x26233e[_0x545c('0x37')],{})[_0x545c('0x1b')](respondWithResult(_0x16c2b5,0xc9))['catch'](handleError(_0x16c2b5,null));};exports[_0x545c('0x1a')]=function(_0xaa466f,_0x3b704a){if(_0xaa466f[_0x545c('0x37')]['id']){delete _0xaa466f[_0x545c('0x37')]['id'];}return db[_0x545c('0x21')][_0x545c('0x34')]({'where':{'id':_0xaa466f[_0x545c('0x29')]['id']}})[_0x545c('0x1b')](handleEntityNotFound(_0x3b704a,null))[_0x545c('0x1b')](saveUpdates(_0xaa466f[_0x545c('0x37')],null))[_0x545c('0x1b')](respondWithResult(_0x3b704a,null))['catch'](handleError(_0x3b704a,null));};exports['destroy']=function(_0x1fae62,_0x306703){return db['FaxInteraction']['find']({'where':{'id':_0x1fae62['params']['id']}})[_0x545c('0x1b')](handleEntityNotFound(_0x306703,null))[_0x545c('0x1b')](removeEntity(_0x306703,null))[_0x545c('0x35')](handleError(_0x306703,null));};exports[_0x545c('0x38')]=function(_0x2b0387,_0x5a13c4){return db['FaxInteraction'][_0x545c('0x38')]()[_0x545c('0x1b')](respondWithResult(_0x5a13c4,null))[_0x545c('0x35')](handleError(_0x5a13c4,null));};exports[_0x545c('0x39')]=function(_0x23f182,_0x2c6c39){return db[_0x545c('0x3a')][_0x545c('0x34')]({'where':{'id':_0x23f182[_0x545c('0x29')]['id']}})[_0x545c('0x1b')](handleEntityNotFound(_0x2c6c39,null))[_0x545c('0x1b')](function(_0x29dd9c){if(_0x29dd9c){return _0x29dd9c[_0x545c('0x39')](_0x23f182['body'][_0x545c('0x3b')],_[_0x545c('0x3c')](_0x23f182[_0x545c('0x37')],[_0x545c('0x3b'),'id'])||{});}})['then'](respondWithResult(_0x2c6c39,null))[_0x545c('0x35')](handleError(_0x2c6c39,null));};exports['getMessages']=function(_0x4c0768,_0x5d15ff){var _0x2f5ec2={'raw':![],'where':{}};var _0x387b99={};var _0x487d68={'count':0x0,'rows':[]};return db[_0x545c('0x21')][_0x545c('0x3d')]({'where':{'id':_0x4c0768[_0x545c('0x29')]['id']}})[_0x545c('0x1b')](handleEntityNotFound(_0x5d15ff,null))[_0x545c('0x1b')](function(_0x2f4ae4){if(_0x2f4ae4){_0x387b99[_0x545c('0x2a')]=_['keys'](db[_0x545c('0x3a')][_0x545c('0x22')]);_0x387b99[_0x545c('0x28')]=_[_0x545c('0x2b')](_0x4c0768[_0x545c('0x28')]);_0x387b99['filters']=_['intersection'](_0x387b99[_0x545c('0x2a')],_0x387b99[_0x545c('0x28')]);_0x2f5ec2['attributes']=_[_0x545c('0x2d')](_0x387b99[_0x545c('0x2a')],qs[_0x545c('0x2e')](_0x4c0768[_0x545c('0x28')][_0x545c('0x2e')]));_0x2f5ec2[_0x545c('0x2c')]=_0x2f5ec2[_0x545c('0x2c')][_0x545c('0x2f')]?_0x2f5ec2[_0x545c('0x2c')]:_0x387b99['model'];if(!_0x4c0768[_0x545c('0x28')]['hasOwnProperty']('nolimit')){_0x2f5ec2[_0x545c('0x17')]=qs[_0x545c('0x17')](_0x4c0768['query'][_0x545c('0x17')]);_0x2f5ec2[_0x545c('0x14')]=qs['offset'](_0x4c0768[_0x545c('0x28')][_0x545c('0x14')]);}_0x2f5ec2[_0x545c('0x3e')]=qs[_0x545c('0x3f')](_0x4c0768[_0x545c('0x28')][_0x545c('0x3f')]);_0x2f5ec2[_0x545c('0x40')]=qs[_0x545c('0x41')](_[_0x545c('0x42')](_0x4c0768[_0x545c('0x28')],_0x387b99[_0x545c('0x41')]));_0x2f5ec2[_0x545c('0x40')][_0x545c('0x43')]=_0x2f4ae4['id'];if(_0x4c0768['query']['filter']){_0x2f5ec2[_0x545c('0x40')]=_[_0x545c('0x32')](_0x2f5ec2[_0x545c('0x40')],{'$or':_[_0x545c('0x20')](_0x2f5ec2[_0x545c('0x2c')],function(_0x3d7e50){var _0x2ca6fd={};_0x2ca6fd[_0x3d7e50]={'$like':'%'+_0x4c0768[_0x545c('0x28')]['filter']+'%'};return _0x2ca6fd;})});}if(_0x4c0768['query'][_0x545c('0x44')]){var _0x2e51f9=_0x4c0768[_0x545c('0x28')]['$gte'][_0x545c('0x45')](',');var _0x1a6204={};_0x1a6204[_0x2e51f9[0x0]]={'$gte':moment(_0x2e51f9[0x1])[_0x545c('0x46')](_0x545c('0x47'))};_0x2f5ec2[_0x545c('0x40')]=_[_0x545c('0x32')](_0x2f5ec2[_0x545c('0x40')],_0x1a6204);}_0x2f5ec2=_[_0x545c('0x32')]({},_0x2f5ec2,_0x4c0768[_0x545c('0x33')]);return db[_0x545c('0x3a')][_0x545c('0x16')]({'where':_0x2f5ec2[_0x545c('0x40')]})['then'](function(_0x15df35){_0x487d68[_0x545c('0x16')]=_0x15df35;if(_0x4c0768[_0x545c('0x28')]['includeAll']){_0x2f5ec2[_0x545c('0x31')]=[{'all':!![]}];}return db[_0x545c('0x3a')][_0x545c('0x26')](_0x2f5ec2);})['then'](function(_0x48569f){_0x487d68[_0x545c('0x48')]=_0x48569f;return _0x487d68;});}})[_0x545c('0x1b')](respondWithFilteredResult(_0x5d15ff,_0x2f5ec2))['catch'](handleError(_0x5d15ff,null));};exports[_0x545c('0x49')]=function(_0x15ddc2,_0x10acd3){return db[_0x545c('0x21')]['find']({'where':{'id':_0x15ddc2[_0x545c('0x29')]['id']}})[_0x545c('0x1b')](handleEntityNotFound(_0x10acd3,null))[_0x545c('0x1b')](function(_0x303655){if(_0x303655){return _0x303655[_0x545c('0x4a')](_0x15ddc2[_0x545c('0x37')][_0x545c('0x3b')],_[_0x545c('0x3c')](_0x15ddc2[_0x545c('0x37')],['ids','id'])||{})['spread'](function(){return db[_0x545c('0x4b')][_0x545c('0x26')]({'attributes':['id',_0x545c('0x1e'),_0x545c('0x4c')],'where':{'id':_0x15ddc2['body']['ids']}});})[_0x545c('0x1b')](function(_0x1cc2fc){socket['emit'](_0x545c('0x4d'),{'id':Number(_0x15ddc2['params']['id']),'tags':_0x1cc2fc||[]});return{'id':Number(_0x15ddc2[_0x545c('0x29')]['id']),'tags':_0x1cc2fc||[]};});}})[_0x545c('0x1b')](respondWithResult(_0x10acd3,null))[_0x545c('0x35')](handleError(_0x10acd3,null));};exports[_0x545c('0x4e')]=function(_0x1b2a4f,_0x467cbf){return db[_0x545c('0x21')][_0x545c('0x34')]({'where':{'id':_0x1b2a4f[_0x545c('0x29')]['id']}})['then'](handleEntityNotFound(_0x467cbf,null))[_0x545c('0x1b')](function(_0x24daaf){if(_0x24daaf){return _0x24daaf[_0x545c('0x4e')](_0x1b2a4f['query'][_0x545c('0x3b')]);}})[_0x545c('0x1b')](respondWithStatusCode(_0x467cbf,null))['catch'](handleError(_0x467cbf,null));};exports[_0x545c('0x4f')]=function(_0x2e6515,_0x1b7d17){var _0x3bf1d0=moment()[_0x545c('0x50')]()[_0x545c('0x51')]();var _0x485586=path['join'](config[_0x545c('0x52')],_0x545c('0x53'),_0x545c('0x54'),'tmp');var _0x173ecb=path['join'](config['root'],'server','files',_0x545c('0x55'));var _0x565f81=path[_0x545c('0x56')](_0x485586,_0x3bf1d0);var _0xaeb91c=util['format'](_0x545c('0x57'),_0x2e6515['params']['id'],_0x3bf1d0);var _0x2cebe6=path[_0x545c('0x56')](_0x485586,_0xaeb91c);var _0x32bf63=[];_0x32bf63[_0x545c('0x58')]({'model':db['Attachment'],'as':_0x545c('0x59'),'raw':!![]});var _0x51a524=[{'model':db[_0x545c('0x3a')],'as':_0x545c('0x5a'),'attributes':['id','body',_0x545c('0x5b')],'include':_0x32bf63}];return db[_0x545c('0x21')][_0x545c('0x34')]({'where':{'id':_0x2e6515[_0x545c('0x29')]['id']},'include':_0x51a524})['then'](handleEntityNotFound(_0x1b7d17,null))[_0x545c('0x1b')](function(_0x216c51){if(_0x216c51&&_0x216c51[_0x545c('0x5a')]){var _0x1c5404=_0x216c51[_0x545c('0x5c')]({'plain':!![]});fs['mkdirSync'](_0x565f81);for(var _0xf7ab30=0x0;_0xf7ab30<_0x1c5404[_0x545c('0x5a')]['length'];_0xf7ab30++){var _0xc5ecc=_0x1c5404['Messages'][_0xf7ab30][_0x545c('0x59')];if(_0xc5ecc){var _0x50f8f3=path[_0x545c('0x56')](_0x173ecb,_0xc5ecc[_0x545c('0x5d')]);if(fs[_0x545c('0x5e')](_0x50f8f3)){fs[_0x545c('0x5f')](_0x50f8f3)[_0x545c('0x60')](fs[_0x545c('0x61')](path[_0x545c('0x56')](_0x565f81,_0xc5ecc[_0x545c('0x5d')])));}}}return BPromise[_0x545c('0x62')]()['then'](function(){return new BPromise(function(_0xf99655,_0x55011b){zipdir(_0x565f81,{'saveTo':_0x2cebe6},function(_0x549240,_0x5ebd99){if(_0x549240)return _0x55011b(_0x549240);return _0xf99655(_0x5ebd99);});})[_0x545c('0x1b')](function(){return new BPromise(function(_0x495f57,_0x48c681){rimraf(_0x565f81,function(_0x2da13a){if(_0x2da13a)_0x48c681(_0x2da13a);return _0x495f57();});});})[_0x545c('0x1b')](function(){return _0x1b7d17[_0x545c('0x4f')](_0x2cebe6,_0xaeb91c,function(_0x107970){if(_0x107970){console[_0x545c('0x63')](_0x545c('0x64'),_0x107970);}else{fs['unlinkSync'](_0x2cebe6);}});});});}else{return _0x1b7d17[_0x545c('0x65')](0xc8);}})[_0x545c('0x35')](handleError(_0x1b7d17,null));}; \ No newline at end of file +var _0xe2f9=['FaxMessage','omit','ids','getMessages','findOne','hasOwnProperty','nolimit','sort','where','FaxInteractionId','filter','$gte','split','format','YYYY-MM-DD\x20HH:mm:ss','rows','setTags','color','emit','faxInteractionTags:save','removeTags','download','unix','toString','root','server','files','join','transcript-%d-%s.zip','push','Attachment','Messages','createdAt','mkdirSync','basename','existsSync','resolve','log','err','unlinkSync','rimraf','zip-dir','moment','util','path','ioredis','../../components/interaction/service','../../components/parsers/qs','../../config/logger','api','../../config/environment','../../mysqldb','redis','defaults','socket.io-emitter','./faxInteraction.socket','register','sendStatus','status','end','json','offset','limit','undefined','count','set','Content-Range','update','then','destroy','stack','name','send','map','FaxInteraction','rawAttributes','fieldName','type','findAll','user','catch','show','params','keys','query','filters','intersection','model','attributes','fields','length','include','merge','create','body','find','describe','addMessage'];(function(_0x5608a3,_0x5b33c5){var _0x1ed50a=function(_0x959171){while(--_0x959171){_0x5608a3['push'](_0x5608a3['shift']());}};_0x1ed50a(++_0x5b33c5);}(_0xe2f9,0x1b0));var _0x9e2f=function(_0x1c7703,_0x5a91d8){_0x1c7703=_0x1c7703-0x0;var _0x163f1a=_0xe2f9[_0x1c7703];return _0x163f1a;};'use strict';var rimraf=require(_0x9e2f('0x0'));var zipdir=require(_0x9e2f('0x1'));var moment=require(_0x9e2f('0x2'));var BPromise=require('bluebird');var util=require(_0x9e2f('0x3'));var path=require(_0x9e2f('0x4'));var fs=require('fs');var _=require('lodash');var Redis=require(_0x9e2f('0x5'));var interaction=require(_0x9e2f('0x6'));var qs=require(_0x9e2f('0x7'));var logger=require(_0x9e2f('0x8'))(_0x9e2f('0x9'));var config=require(_0x9e2f('0xa'));var db=require(_0x9e2f('0xb'))['db'];config[_0x9e2f('0xc')]=_[_0x9e2f('0xd')](config['redis'],{'host':'localhost','port':0x18eb});var socket=require(_0x9e2f('0xe'))(new Redis(config[_0x9e2f('0xc')]));require(_0x9e2f('0xf'))[_0x9e2f('0x10')](socket);function respondWithStatusCode(_0x2b088d,_0x1699ed){_0x1699ed=_0x1699ed||0xcc;return function(_0x255f4e){if(_0x255f4e){return _0x2b088d[_0x9e2f('0x11')](_0x1699ed);}return _0x2b088d[_0x9e2f('0x12')](_0x1699ed)[_0x9e2f('0x13')]();};}function respondWithResult(_0x120f66,_0x54dfc2){_0x54dfc2=_0x54dfc2||0xc8;return function(_0xa8a1e1){if(_0xa8a1e1){return _0x120f66[_0x9e2f('0x12')](_0x54dfc2)[_0x9e2f('0x14')](_0xa8a1e1);}};}function respondWithFilteredResult(_0x34f57f,_0x2e27c7){return function(_0x26fa0d){if(_0x26fa0d){var _0x459e46=typeof _0x2e27c7[_0x9e2f('0x15')]==='undefined'&&typeof _0x2e27c7[_0x9e2f('0x16')]===_0x9e2f('0x17');var _0xbdc3a1=_0x26fa0d[_0x9e2f('0x18')];var _0x34ff51=_0x459e46?0x0:_0x2e27c7[_0x9e2f('0x15')];var _0x4022b6=_0x459e46?_0x26fa0d[_0x9e2f('0x18')]:_0x2e27c7[_0x9e2f('0x15')]+_0x2e27c7[_0x9e2f('0x16')];var _0x41b32e;if(_0x4022b6>=_0xbdc3a1){_0x4022b6=_0xbdc3a1;_0x41b32e=0xc8;}else{_0x41b32e=0xce;}_0x34f57f[_0x9e2f('0x12')](_0x41b32e);return _0x34f57f[_0x9e2f('0x19')](_0x9e2f('0x1a'),_0x34ff51+'-'+_0x4022b6+'/'+_0xbdc3a1)[_0x9e2f('0x14')](_0x26fa0d);}return null;};}function saveUpdates(_0x47d60e){return function(_0x3112c2){if(_0x3112c2){return _0x3112c2[_0x9e2f('0x1b')](_0x47d60e)[_0x9e2f('0x1c')](function(_0xddb5e7){return _0xddb5e7;});}return null;};}function removeEntity(_0xcfcee7){return function(_0x57ab09){if(_0x57ab09){return _0x57ab09[_0x9e2f('0x1d')]()['then'](function(){_0xcfcee7[_0x9e2f('0x12')](0xcc)[_0x9e2f('0x13')]();});}};}function handleEntityNotFound(_0x184504){return function(_0x53bfd8){if(!_0x53bfd8){_0x184504[_0x9e2f('0x11')](0x194);}return _0x53bfd8;};}function handleError(_0x3e524c,_0x3159a3){_0x3159a3=_0x3159a3||0x1f4;return function(_0x5cd8ee){logger['error'](_0x5cd8ee[_0x9e2f('0x1e')]);if(_0x5cd8ee[_0x9e2f('0x1f')]){delete _0x5cd8ee[_0x9e2f('0x1f')];}_0x3e524c[_0x9e2f('0x12')](_0x3159a3)[_0x9e2f('0x20')](_0x5cd8ee);};}exports['index']=function(_0x4737c7,_0xd8e6c1){var _0x403473={};var _0x47bbdd=_[_0x9e2f('0x21')](db[_0x9e2f('0x22')][_0x9e2f('0x23')],function(_0x11af3d){return{'name':_0x11af3d[_0x9e2f('0x24')],'type':_0x11af3d[_0x9e2f('0x25')]['key']};});_0x403473=qs['getOptions'](_0x47bbdd,_0x4737c7);return interaction[_0x9e2f('0x26')]('fax',_0x4737c7['query'],_0x4737c7[_0x9e2f('0x27')],_0x403473,_0x47bbdd)[_0x9e2f('0x1c')](respondWithFilteredResult(_0xd8e6c1,_0x403473))[_0x9e2f('0x28')](handleError(_0xd8e6c1,null));};exports[_0x9e2f('0x29')]=function(_0x138f69,_0x32f090){var _0x330675={'raw':![],'where':{'id':_0x138f69[_0x9e2f('0x2a')]['id']}},_0x51e691={};_0x51e691['model']=_[_0x9e2f('0x2b')](db[_0x9e2f('0x22')][_0x9e2f('0x23')]);_0x51e691[_0x9e2f('0x2c')]=_[_0x9e2f('0x2b')](_0x138f69['query']);_0x51e691[_0x9e2f('0x2d')]=_[_0x9e2f('0x2e')](_0x51e691[_0x9e2f('0x2f')],_0x51e691[_0x9e2f('0x2c')]);_0x330675[_0x9e2f('0x30')]=_[_0x9e2f('0x2e')](_0x51e691[_0x9e2f('0x2f')],qs[_0x9e2f('0x31')](_0x138f69[_0x9e2f('0x2c')][_0x9e2f('0x31')]));_0x330675['attributes']=_0x330675[_0x9e2f('0x30')][_0x9e2f('0x32')]?_0x330675[_0x9e2f('0x30')]:_0x51e691[_0x9e2f('0x2f')];if(_0x138f69[_0x9e2f('0x2c')]['includeAll']){_0x330675[_0x9e2f('0x33')]=[{'all':!![]}];}_0x330675=_[_0x9e2f('0x34')]({},_0x330675,_0x138f69['options']);return db[_0x9e2f('0x22')]['find'](_0x330675)[_0x9e2f('0x1c')](handleEntityNotFound(_0x32f090,null))[_0x9e2f('0x1c')](respondWithResult(_0x32f090,null))[_0x9e2f('0x28')](handleError(_0x32f090,null));};exports['create']=function(_0x24ec5e,_0x31cdfe){return db[_0x9e2f('0x22')][_0x9e2f('0x35')](_0x24ec5e[_0x9e2f('0x36')],{})[_0x9e2f('0x1c')](respondWithResult(_0x31cdfe,0xc9))[_0x9e2f('0x28')](handleError(_0x31cdfe,null));};exports[_0x9e2f('0x1b')]=function(_0x1cfde6,_0x574e60){if(_0x1cfde6[_0x9e2f('0x36')]['id']){delete _0x1cfde6[_0x9e2f('0x36')]['id'];}return db[_0x9e2f('0x22')][_0x9e2f('0x37')]({'where':{'id':_0x1cfde6[_0x9e2f('0x2a')]['id']}})['then'](handleEntityNotFound(_0x574e60,null))[_0x9e2f('0x1c')](saveUpdates(_0x1cfde6[_0x9e2f('0x36')],null))[_0x9e2f('0x1c')](respondWithResult(_0x574e60,null))['catch'](handleError(_0x574e60,null));};exports[_0x9e2f('0x1d')]=function(_0x5443ed,_0x30165f){return db['FaxInteraction'][_0x9e2f('0x37')]({'where':{'id':_0x5443ed[_0x9e2f('0x2a')]['id']}})[_0x9e2f('0x1c')](handleEntityNotFound(_0x30165f,null))[_0x9e2f('0x1c')](removeEntity(_0x30165f,null))[_0x9e2f('0x28')](handleError(_0x30165f,null));};exports[_0x9e2f('0x38')]=function(_0x419e4b,_0x546ad2){return db[_0x9e2f('0x22')][_0x9e2f('0x38')]()[_0x9e2f('0x1c')](respondWithResult(_0x546ad2,null))['catch'](handleError(_0x546ad2,null));};exports[_0x9e2f('0x39')]=function(_0x29efcf,_0x4a3055){return db[_0x9e2f('0x3a')][_0x9e2f('0x37')]({'where':{'id':_0x29efcf[_0x9e2f('0x2a')]['id']}})[_0x9e2f('0x1c')](handleEntityNotFound(_0x4a3055,null))['then'](function(_0x58771b){if(_0x58771b){return _0x58771b[_0x9e2f('0x39')](_0x29efcf[_0x9e2f('0x36')]['ids'],_[_0x9e2f('0x3b')](_0x29efcf[_0x9e2f('0x36')],[_0x9e2f('0x3c'),'id'])||{});}})[_0x9e2f('0x1c')](respondWithResult(_0x4a3055,null))[_0x9e2f('0x28')](handleError(_0x4a3055,null));};exports[_0x9e2f('0x3d')]=function(_0x4c922f,_0x2c0d20){var _0x584566={'raw':![],'where':{}};var _0x2769c8={};var _0x41a88c={'count':0x0,'rows':[]};return db[_0x9e2f('0x22')][_0x9e2f('0x3e')]({'where':{'id':_0x4c922f[_0x9e2f('0x2a')]['id']}})['then'](handleEntityNotFound(_0x2c0d20,null))['then'](function(_0x3c2a72){if(_0x3c2a72){_0x2769c8['model']=_[_0x9e2f('0x2b')](db[_0x9e2f('0x3a')][_0x9e2f('0x23')]);_0x2769c8[_0x9e2f('0x2c')]=_[_0x9e2f('0x2b')](_0x4c922f[_0x9e2f('0x2c')]);_0x2769c8['filters']=_[_0x9e2f('0x2e')](_0x2769c8['model'],_0x2769c8[_0x9e2f('0x2c')]);_0x584566[_0x9e2f('0x30')]=_['intersection'](_0x2769c8['model'],qs[_0x9e2f('0x31')](_0x4c922f[_0x9e2f('0x2c')]['fields']));_0x584566[_0x9e2f('0x30')]=_0x584566[_0x9e2f('0x30')][_0x9e2f('0x32')]?_0x584566[_0x9e2f('0x30')]:_0x2769c8[_0x9e2f('0x2f')];if(!_0x4c922f[_0x9e2f('0x2c')][_0x9e2f('0x3f')](_0x9e2f('0x40'))){_0x584566[_0x9e2f('0x16')]=qs[_0x9e2f('0x16')](_0x4c922f['query'][_0x9e2f('0x16')]);_0x584566[_0x9e2f('0x15')]=qs[_0x9e2f('0x15')](_0x4c922f['query'][_0x9e2f('0x15')]);}_0x584566['order']=qs['sort'](_0x4c922f['query'][_0x9e2f('0x41')]);_0x584566[_0x9e2f('0x42')]=qs[_0x9e2f('0x2d')](_['pick'](_0x4c922f[_0x9e2f('0x2c')],_0x2769c8[_0x9e2f('0x2d')]));_0x584566[_0x9e2f('0x42')][_0x9e2f('0x43')]=_0x3c2a72['id'];if(_0x4c922f[_0x9e2f('0x2c')][_0x9e2f('0x44')]){_0x584566[_0x9e2f('0x42')]=_[_0x9e2f('0x34')](_0x584566['where'],{'$or':_[_0x9e2f('0x21')](_0x584566[_0x9e2f('0x30')],function(_0x5c9d68){var _0x11b335={};_0x11b335[_0x5c9d68]={'$like':'%'+_0x4c922f['query'][_0x9e2f('0x44')]+'%'};return _0x11b335;})});}if(_0x4c922f[_0x9e2f('0x2c')][_0x9e2f('0x45')]){var _0x208dbd=_0x4c922f['query'][_0x9e2f('0x45')][_0x9e2f('0x46')](',');var _0x39a379={};_0x39a379[_0x208dbd[0x0]]={'$gte':moment(_0x208dbd[0x1])[_0x9e2f('0x47')](_0x9e2f('0x48'))};_0x584566[_0x9e2f('0x42')]=_[_0x9e2f('0x34')](_0x584566[_0x9e2f('0x42')],_0x39a379);}_0x584566=_[_0x9e2f('0x34')]({},_0x584566,_0x4c922f['options']);return db[_0x9e2f('0x3a')][_0x9e2f('0x18')]({'where':_0x584566[_0x9e2f('0x42')]})[_0x9e2f('0x1c')](function(_0x40d323){_0x41a88c[_0x9e2f('0x18')]=_0x40d323;if(_0x4c922f['query']['includeAll']){_0x584566[_0x9e2f('0x33')]=[{'all':!![]}];}return db[_0x9e2f('0x3a')][_0x9e2f('0x26')](_0x584566);})[_0x9e2f('0x1c')](function(_0x5bb3ab){_0x41a88c[_0x9e2f('0x49')]=_0x5bb3ab;return _0x41a88c;});}})[_0x9e2f('0x1c')](respondWithFilteredResult(_0x2c0d20,_0x584566))['catch'](handleError(_0x2c0d20,null));};exports['addTags']=function(_0x422e95,_0x5564ca){return db[_0x9e2f('0x22')]['find']({'where':{'id':_0x422e95['params']['id']}})[_0x9e2f('0x1c')](handleEntityNotFound(_0x5564ca,null))['then'](function(_0x117a83){if(_0x117a83){return _0x117a83[_0x9e2f('0x4a')](_0x422e95[_0x9e2f('0x36')][_0x9e2f('0x3c')],_[_0x9e2f('0x3b')](_0x422e95[_0x9e2f('0x36')],[_0x9e2f('0x3c'),'id'])||{})['spread'](function(){return db['Tag'][_0x9e2f('0x26')]({'attributes':['id',_0x9e2f('0x1f'),_0x9e2f('0x4b')],'where':{'id':_0x422e95[_0x9e2f('0x36')][_0x9e2f('0x3c')]}});})[_0x9e2f('0x1c')](function(_0x2dd14c){socket[_0x9e2f('0x4c')](_0x9e2f('0x4d'),{'id':Number(_0x422e95[_0x9e2f('0x2a')]['id']),'tags':_0x2dd14c||[]});return{'id':Number(_0x422e95['params']['id']),'tags':_0x2dd14c||[]};});}})[_0x9e2f('0x1c')](respondWithResult(_0x5564ca,null))[_0x9e2f('0x28')](handleError(_0x5564ca,null));};exports[_0x9e2f('0x4e')]=function(_0x3260fd,_0x2939d8){return db[_0x9e2f('0x22')][_0x9e2f('0x37')]({'where':{'id':_0x3260fd['params']['id']}})['then'](handleEntityNotFound(_0x2939d8,null))[_0x9e2f('0x1c')](function(_0x146edb){if(_0x146edb){return _0x146edb['removeTags'](_0x3260fd[_0x9e2f('0x2c')][_0x9e2f('0x3c')]);}})['then'](respondWithStatusCode(_0x2939d8,null))['catch'](handleError(_0x2939d8,null));};exports[_0x9e2f('0x4f')]=function(_0x2134e9,_0x38907c){var _0x53c2e5=moment()[_0x9e2f('0x50')]()[_0x9e2f('0x51')]();var _0x2b1e5b=path['join'](config[_0x9e2f('0x52')],_0x9e2f('0x53'),_0x9e2f('0x54'),'tmp');var _0x1f3044=path[_0x9e2f('0x55')](config['root'],_0x9e2f('0x53'),_0x9e2f('0x54'),'attachments');var _0x2b9409=path[_0x9e2f('0x55')](_0x2b1e5b,_0x53c2e5);var _0x21f965=util[_0x9e2f('0x47')](_0x9e2f('0x56'),_0x2134e9[_0x9e2f('0x2a')]['id'],_0x53c2e5);var _0x4c3096=path['join'](_0x2b1e5b,_0x21f965);var _0x83aa65=[];_0x83aa65[_0x9e2f('0x57')]({'model':db[_0x9e2f('0x58')],'as':_0x9e2f('0x58'),'raw':!![]});var _0xbd2609=[{'model':db['FaxMessage'],'as':_0x9e2f('0x59'),'attributes':['id',_0x9e2f('0x36'),_0x9e2f('0x5a')],'include':_0x83aa65}];return db['FaxInteraction'][_0x9e2f('0x37')]({'where':{'id':_0x2134e9['params']['id']},'include':_0xbd2609})[_0x9e2f('0x1c')](handleEntityNotFound(_0x38907c,null))[_0x9e2f('0x1c')](function(_0x4bbad2){if(_0x4bbad2&&_0x4bbad2[_0x9e2f('0x59')]){var _0x4e7aa9=_0x4bbad2['get']({'plain':!![]});fs[_0x9e2f('0x5b')](_0x2b9409);for(var _0x17dbe5=0x0;_0x17dbe5<_0x4e7aa9[_0x9e2f('0x59')][_0x9e2f('0x32')];_0x17dbe5++){var _0x404711=_0x4e7aa9['Messages'][_0x17dbe5]['Attachment'];if(_0x404711){var _0x1e7d5d=path['join'](_0x1f3044,_0x404711[_0x9e2f('0x5c')]);if(fs[_0x9e2f('0x5d')](_0x1e7d5d)){fs['createReadStream'](_0x1e7d5d)['pipe'](fs['createWriteStream'](path[_0x9e2f('0x55')](_0x2b9409,_0x404711[_0x9e2f('0x5c')])));}}}return BPromise[_0x9e2f('0x5e')]()[_0x9e2f('0x1c')](function(){return new BPromise(function(_0x1fd5c8,_0x204de0){zipdir(_0x2b9409,{'saveTo':_0x4c3096},function(_0x1365ac,_0x243881){if(_0x1365ac)return _0x204de0(_0x1365ac);return _0x1fd5c8(_0x243881);});})['then'](function(){return new BPromise(function(_0x34bb28,_0x20d5d0){rimraf(_0x2b9409,function(_0x589f5e){if(_0x589f5e)_0x20d5d0(_0x589f5e);return _0x34bb28();});});})[_0x9e2f('0x1c')](function(){return _0x38907c[_0x9e2f('0x4f')](_0x4c3096,_0x21f965,function(_0x532ab4){if(_0x532ab4){console[_0x9e2f('0x5f')](_0x9e2f('0x60'),_0x532ab4);}else{fs[_0x9e2f('0x61')](_0x4c3096);}});});});}else{return _0x38907c['sendStatus'](0xc8);}})[_0x9e2f('0x28')](handleError(_0x38907c,null));}; \ No newline at end of file diff --git a/server/api/faxInteraction/faxInteraction.events.js b/server/api/faxInteraction/faxInteraction.events.js index d5e3157..c19bd2a 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 _0xfbbb=['hasOwnProperty','hook','exports','events','../../mysqldb','FaxInteraction','FaxMessage','setMaxListeners','update','remove','getUsers','setDataValue','map','findAll','then','unreadMessages','emit'];(function(_0x6f2ce5,_0x4231eb){var _0x28a54a=function(_0x1bc980){while(--_0x1bc980){_0x6f2ce5['push'](_0x6f2ce5['shift']());}};_0x28a54a(++_0x4231eb);}(_0xfbbb,0x18a));var _0xbfbb=function(_0x1029f9,_0x15d0d7){_0x1029f9=_0x1029f9-0x0;var _0x570775=_0xfbbb[_0x1029f9];return _0x570775;};'use strict';var EventEmitter=require(_0xbfbb('0x0'));var FaxInteraction=require(_0xbfbb('0x1'))['db'][_0xbfbb('0x2')];var FaxMessage=require(_0xbfbb('0x1'))['db'][_0xbfbb('0x3')];var FaxInteractionEvents=new EventEmitter();FaxInteractionEvents[_0xbfbb('0x4')](0x0);var events={'afterCreate':'save','afterUpdate':_0xbfbb('0x5'),'afterDestroy':_0xbfbb('0x6')};function emitEvent(_0x241066){return function(_0x1b09b5,_0xb351b8,_0x1c712){_0x1b09b5[_0xbfbb('0x7')]({'attributes':['id'],'raw':!![]})['then'](function(_0xcacfb){_0x1b09b5[_0xbfbb('0x8')]('Users',_0xcacfb[_0xbfbb('0x9')](function(_0x4cd078){return{'id':_0x4cd078['id']};}));return FaxMessage[_0xbfbb('0xa')]({'where':{'FaxInteractionId':_0x1b09b5['id'],'direction':'in','read':![]},'raw':!![]});})[_0xbfbb('0xb')](function(_0x243ed6){_0x1b09b5['setDataValue'](_0xbfbb('0xc'),_0x243ed6['length']);FaxInteractionEvents['emit'](_0x241066+':'+_0x1b09b5['id'],_0x1b09b5);FaxInteractionEvents[_0xbfbb('0xd')](_0x241066,_0x1b09b5);_0x1c712(null);})['catch'](_0x1c712(null));};}for(var e in events){if(events[_0xbfbb('0xe')](e)){var event=events[e];FaxInteraction[_0xbfbb('0xf')](e,emitEvent(event));}}module[_0xbfbb('0x10')]=FaxInteractionEvents; \ No newline at end of file +var _0x279c=['events','FaxInteraction','../../mysqldb','save','remove','Users','map','findAll','then','unreadMessages','length','emit','catch','hasOwnProperty','hook','exports'];(function(_0x15984e,_0x514d15){var _0x4f07a3=function(_0x1a2b91){while(--_0x1a2b91){_0x15984e['push'](_0x15984e['shift']());}};_0x4f07a3(++_0x514d15);}(_0x279c,0x1b0));var _0xc279=function(_0x220f3f,_0x11c540){_0x220f3f=_0x220f3f-0x0;var _0x1f170e=_0x279c[_0x220f3f];return _0x1f170e;};'use strict';var EventEmitter=require(_0xc279('0x0'));var FaxInteraction=require('../../mysqldb')['db'][_0xc279('0x1')];var FaxMessage=require(_0xc279('0x2'))['db']['FaxMessage'];var FaxInteractionEvents=new EventEmitter();FaxInteractionEvents['setMaxListeners'](0x0);var events={'afterCreate':_0xc279('0x3'),'afterUpdate':'update','afterDestroy':_0xc279('0x4')};function emitEvent(_0x1b18c1){return function(_0x181097,_0x3ddbe2,_0x416039){_0x181097['getUsers']({'attributes':['id'],'raw':!![]})['then'](function(_0x16ba03){_0x181097['setDataValue'](_0xc279('0x5'),_0x16ba03[_0xc279('0x6')](function(_0x5fbabe){return{'id':_0x5fbabe['id']};}));return FaxMessage[_0xc279('0x7')]({'where':{'FaxInteractionId':_0x181097['id'],'direction':'in','read':![]},'raw':!![]});})[_0xc279('0x8')](function(_0x365488){_0x181097['setDataValue'](_0xc279('0x9'),_0x365488[_0xc279('0xa')]);FaxInteractionEvents[_0xc279('0xb')](_0x1b18c1+':'+_0x181097['id'],_0x181097);FaxInteractionEvents[_0xc279('0xb')](_0x1b18c1,_0x181097);_0x416039(null);})[_0xc279('0xc')](_0x416039(null));};}for(var e in events){if(events[_0xc279('0xd')](e)){var event=events[e];FaxInteraction[_0xc279('0xe')](e,emitEvent(event));}}module[_0xc279('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 75ce43e..9b7ea54 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 _0x5a1b=['fax_interactions','closed','closedAt','format','YYYY-MM-DD\x20HH:mm:ss','lodash','util','../../config/logger','api','moment','request-promise','path','rimraf','./faxInteraction.attributes','define'];(function(_0x5e1b99,_0x522acc){var _0x162cb6=function(_0x5576c5){while(--_0x5576c5){_0x5e1b99['push'](_0x5e1b99['shift']());}};_0x162cb6(++_0x522acc);}(_0x5a1b,0xe6));var _0xb5a1=function(_0x3eb845,_0x28693f){_0x3eb845=_0x3eb845-0x0;var _0x36368e=_0x5a1b[_0x3eb845];return _0x36368e;};'use strict';var _=require(_0xb5a1('0x0'));var util=require(_0xb5a1('0x1'));var logger=require(_0xb5a1('0x2'))(_0xb5a1('0x3'));var moment=require(_0xb5a1('0x4'));var BPromise=require('bluebird');var rp=require(_0xb5a1('0x5'));var fs=require('fs');var path=require(_0xb5a1('0x6'));var rimraf=require(_0xb5a1('0x7'));var config=require('../../config/environment');var attributes=require(_0xb5a1('0x8'));module['exports']=function(_0x1fbb20,_0x123910){return _0x1fbb20[_0xb5a1('0x9')]('FaxInteraction',attributes,{'tableName':_0xb5a1('0xa'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x2c59a5,_0x1c64d0,_0x3f8102){if(_0x2c59a5['changed'](_0xb5a1('0xb'))){_0x2c59a5[_0xb5a1('0xc')]=moment()[_0xb5a1('0xd')](_0xb5a1('0xe'));}_0x3f8102(null,_0x2c59a5);}}});}; \ No newline at end of file +var _0x73a3=['path','rimraf','../../config/environment','./faxInteraction.attributes','define','FaxInteraction','changed','closed','closedAt','format','YYYY-MM-DD\x20HH:mm:ss','lodash','util','../../config/logger','moment','bluebird','request-promise'];(function(_0x3c3bb7,_0x41170f){var _0x4ab9c6=function(_0x8f3141){while(--_0x8f3141){_0x3c3bb7['push'](_0x3c3bb7['shift']());}};_0x4ab9c6(++_0x41170f);}(_0x73a3,0x14e));var _0x373a=function(_0x27af45,_0x1b57aa){_0x27af45=_0x27af45-0x0;var _0x18df21=_0x73a3[_0x27af45];return _0x18df21;};'use strict';var _=require(_0x373a('0x0'));var util=require(_0x373a('0x1'));var logger=require(_0x373a('0x2'))('api');var moment=require(_0x373a('0x3'));var BPromise=require(_0x373a('0x4'));var rp=require(_0x373a('0x5'));var fs=require('fs');var path=require(_0x373a('0x6'));var rimraf=require(_0x373a('0x7'));var config=require(_0x373a('0x8'));var attributes=require(_0x373a('0x9'));module['exports']=function(_0x4995cc,_0x394734){return _0x4995cc[_0x373a('0xa')](_0x373a('0xb'),attributes,{'tableName':'fax_interactions','paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x546506,_0x1a727c,_0x5b6762){if(_0x546506[_0x373a('0xc')](_0x373a('0xd'))){_0x546506[_0x373a('0xe')]=moment()[_0x373a('0xf')](_0x373a('0x10'));}_0x5b6762(null,_0x546506);}}});}; \ No newline at end of file diff --git a/server/api/faxInteraction/faxInteraction.rpc.js b/server/api/faxInteraction/faxInteraction.rpc.js index ed9178c..bd4bceb 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 _0x3511=['code','message','info','result','catch','UpdateFaxInteraction','FaxInteraction','update','options','raw','where','attributes','limit','AddTagsToFaxInteraction','find','addTags','ids','body','spread','debug','AddTags','lodash','util','randomstring','ioredis','../../config/logger','redis','defaults','socket.io-emitter','register','request','then','FaxInteraction,\x20%s,\x20%s','request\x20sent','FaxInteraction,\x20%s,\x20%s,\x20%s','stringify','error'];(function(_0x535c63,_0x2464e9){var _0x2f5e71=function(_0x52e31e){while(--_0x52e31e){_0x535c63['push'](_0x535c63['shift']());}};_0x2f5e71(++_0x2464e9);}(_0x3511,0x1d1));var _0x1351=function(_0xbf7f20,_0x3f856e){_0xbf7f20=_0xbf7f20-0x0;var _0x5dc25d=_0x3511[_0xbf7f20];return _0x5dc25d;};'use strict';var _=require(_0x1351('0x0'));var util=require(_0x1351('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0x1351('0x2'));var fs=require('fs');var Redis=require(_0x1351('0x3'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0x1351('0x4'))('rpc');var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson['client']['http']({'port':0x232a});config[_0x1351('0x5')]=_[_0x1351('0x6')](config[_0x1351('0x5')],{'host':'localhost','port':0x18eb});var socket=require(_0x1351('0x7'))(new Redis(config[_0x1351('0x5')]));require('./faxInteraction.socket')[_0x1351('0x8')](socket);function respondWithRpcPromise(_0x1750e9,_0x22ac84,_0x4624f2){return new BPromise(function(_0x6881dc,_0x94a995){return client[_0x1351('0x9')](_0x1750e9,_0x4624f2)[_0x1351('0xa')](function(_0x4a454d){logger['info'](_0x1351('0xb'),_0x22ac84,_0x1351('0xc'));logger['debug'](_0x1351('0xd'),_0x22ac84,'request\x20sent',JSON[_0x1351('0xe')](_0x4a454d));if(_0x4a454d['error']){if(_0x4a454d[_0x1351('0xf')][_0x1351('0x10')]===0x1f4){logger[_0x1351('0xf')](_0x1351('0xb'),_0x22ac84,_0x4a454d[_0x1351('0xf')]['message']);return _0x94a995(_0x4a454d['error'][_0x1351('0x11')]);}logger[_0x1351('0xf')]('FaxInteraction,\x20%s,\x20%s',_0x22ac84,_0x4a454d[_0x1351('0xf')]['message']);return _0x6881dc(_0x4a454d[_0x1351('0xf')][_0x1351('0x11')]);}else{logger[_0x1351('0x12')](_0x1351('0xb'),_0x22ac84,'request\x20sent');_0x6881dc(_0x4a454d[_0x1351('0x13')]['message']);}})[_0x1351('0x14')](function(_0x4c9cae){logger['error'](_0x1351('0xb'),_0x22ac84,_0x4c9cae);_0x94a995(_0x4c9cae);});});}exports[_0x1351('0x15')]=function(_0x5be228){var _0x27016d=this;return new Promise(function(_0xe9d577,_0xc1bac7){return db[_0x1351('0x16')][_0x1351('0x17')](_0x5be228['body'],{'raw':_0x5be228[_0x1351('0x18')]?_0x5be228['options'][_0x1351('0x19')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x5be228[_0x1351('0x18')]?_0x5be228[_0x1351('0x18')][_0x1351('0x1a')]||null:null,'attributes':_0x5be228[_0x1351('0x18')]?_0x5be228[_0x1351('0x18')][_0x1351('0x1b')]||null:null,'limit':_0x5be228['options']?_0x5be228[_0x1351('0x18')][_0x1351('0x1c')]||null:null})[_0x1351('0xa')](function(_0x79a6e8){logger[_0x1351('0x12')](_0x1351('0x15'),_0x5be228);logger['debug']('UpdateFaxInteraction',_0x5be228,JSON[_0x1351('0xe')](_0x79a6e8));_0xe9d577(_0x79a6e8);})[_0x1351('0x14')](function(_0xca2251){logger['error'](_0x1351('0x15'),_0xca2251[_0x1351('0x11')],_0x5be228);_0xc1bac7(_0x27016d['error'](0x1f4,_0xca2251[_0x1351('0x11')]));});});};exports[_0x1351('0x1d')]=function(_0x454d27){return new Promise(function(_0x3005f0,_0x7e7701){return db[_0x1351('0x16')][_0x1351('0x1e')]({'where':_0x454d27[_0x1351('0x18')]?_0x454d27['options']['where']||null:null})[_0x1351('0xa')](function(_0x2adaa1){if(_0x2adaa1){return _0x2adaa1[_0x1351('0x1f')](_0x454d27['body'][_0x1351('0x20')],_['omit'](_0x454d27[_0x1351('0x21')],[_0x1351('0x20'),'id'])||{});}})[_0x1351('0x22')](function(_0x4b207f){logger[_0x1351('0x12')]('AddTags',_0x454d27);logger[_0x1351('0x23')](_0x1351('0x24'),_0x454d27,JSON[_0x1351('0xe')](_0x4b207f));_0x3005f0(_0x4b207f);})['catch'](function(_0x4aa1eb){logger['error'](_0x1351('0x24'),_0x4aa1eb[_0x1351('0x11')],_0x454d27);_0x7e7701(_this['error'](0x1f4,_0x4aa1eb[_0x1351('0x11')]));});});}; \ No newline at end of file +var _0x885b=['catch','AddTagsToFaxInteraction','find','addTags','body','omit','ids','spread','AddTags','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','redis','defaults','localhost','socket.io-emitter','./faxInteraction.socket','register','request','then','info','FaxInteraction,\x20%s,\x20%s','request\x20sent','debug','FaxInteraction,\x20%s,\x20%s,\x20%s','error','code','message','result','UpdateFaxInteraction','FaxInteraction','options','raw','where','stringify'];(function(_0x4b0952,_0x45c22e){var _0x33b2d5=function(_0x2bd08b){while(--_0x2bd08b){_0x4b0952['push'](_0x4b0952['shift']());}};_0x33b2d5(++_0x45c22e);}(_0x885b,0xb9));var _0xb885=function(_0x11e53e,_0x537460){_0x11e53e=_0x11e53e-0x0;var _0x112276=_0x885b[_0x11e53e];return _0x112276;};'use strict';var _=require('lodash');var util=require(_0xb885('0x0'));var moment=require(_0xb885('0x1'));var BPromise=require(_0xb885('0x2'));var rs=require(_0xb885('0x3'));var fs=require('fs');var Redis=require(_0xb885('0x4'));var db=require(_0xb885('0x5'))['db'];var utils=require(_0xb885('0x6'));var logger=require(_0xb885('0x7'))(_0xb885('0x8'));var config=require('../../config/environment');var jayson=require(_0xb885('0x9'));var client=jayson[_0xb885('0xa')][_0xb885('0xb')]({'port':0x232a});config[_0xb885('0xc')]=_[_0xb885('0xd')](config['redis'],{'host':_0xb885('0xe'),'port':0x18eb});var socket=require(_0xb885('0xf'))(new Redis(config['redis']));require(_0xb885('0x10'))[_0xb885('0x11')](socket);function respondWithRpcPromise(_0x42aa63,_0x5b1f43,_0x5c3c43){return new BPromise(function(_0x4903a5,_0x951238){return client[_0xb885('0x12')](_0x42aa63,_0x5c3c43)[_0xb885('0x13')](function(_0x53bb9f){logger[_0xb885('0x14')](_0xb885('0x15'),_0x5b1f43,_0xb885('0x16'));logger[_0xb885('0x17')](_0xb885('0x18'),_0x5b1f43,_0xb885('0x16'),JSON['stringify'](_0x53bb9f));if(_0x53bb9f[_0xb885('0x19')]){if(_0x53bb9f[_0xb885('0x19')][_0xb885('0x1a')]===0x1f4){logger[_0xb885('0x19')](_0xb885('0x15'),_0x5b1f43,_0x53bb9f[_0xb885('0x19')][_0xb885('0x1b')]);return _0x951238(_0x53bb9f[_0xb885('0x19')][_0xb885('0x1b')]);}logger[_0xb885('0x19')]('FaxInteraction,\x20%s,\x20%s',_0x5b1f43,_0x53bb9f[_0xb885('0x19')][_0xb885('0x1b')]);return _0x4903a5(_0x53bb9f[_0xb885('0x19')][_0xb885('0x1b')]);}else{logger[_0xb885('0x14')](_0xb885('0x15'),_0x5b1f43,'request\x20sent');_0x4903a5(_0x53bb9f[_0xb885('0x1c')][_0xb885('0x1b')]);}})['catch'](function(_0x4b4e42){logger[_0xb885('0x19')]('FaxInteraction,\x20%s,\x20%s',_0x5b1f43,_0x4b4e42);_0x951238(_0x4b4e42);});});}exports[_0xb885('0x1d')]=function(_0x20199a){var _0x3b1c7e=this;return new Promise(function(_0x2ca1b9,_0x64ca1d){return db[_0xb885('0x1e')]['update'](_0x20199a['body'],{'raw':_0x20199a[_0xb885('0x1f')]?_0x20199a[_0xb885('0x1f')][_0xb885('0x20')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x20199a['options']?_0x20199a[_0xb885('0x1f')][_0xb885('0x21')]||null:null,'attributes':_0x20199a[_0xb885('0x1f')]?_0x20199a[_0xb885('0x1f')]['attributes']||null:null,'limit':_0x20199a[_0xb885('0x1f')]?_0x20199a[_0xb885('0x1f')]['limit']||null:null})[_0xb885('0x13')](function(_0x1a61d6){logger[_0xb885('0x14')](_0xb885('0x1d'),_0x20199a);logger[_0xb885('0x17')](_0xb885('0x1d'),_0x20199a,JSON[_0xb885('0x22')](_0x1a61d6));_0x2ca1b9(_0x1a61d6);})[_0xb885('0x23')](function(_0x4db848){logger[_0xb885('0x19')](_0xb885('0x1d'),_0x4db848[_0xb885('0x1b')],_0x20199a);_0x64ca1d(_0x3b1c7e[_0xb885('0x19')](0x1f4,_0x4db848['message']));});});};exports[_0xb885('0x24')]=function(_0x371daf){return new Promise(function(_0x12ea81,_0x2c0090){return db[_0xb885('0x1e')][_0xb885('0x25')]({'where':_0x371daf[_0xb885('0x1f')]?_0x371daf['options']['where']||null:null})[_0xb885('0x13')](function(_0x52c415){if(_0x52c415){return _0x52c415[_0xb885('0x26')](_0x371daf[_0xb885('0x27')]['ids'],_[_0xb885('0x28')](_0x371daf['body'],[_0xb885('0x29'),'id'])||{});}})[_0xb885('0x2a')](function(_0x364e0d){logger[_0xb885('0x14')]('AddTags',_0x371daf);logger[_0xb885('0x17')](_0xb885('0x2b'),_0x371daf,JSON[_0xb885('0x22')](_0x364e0d));_0x12ea81(_0x364e0d);})[_0xb885('0x23')](function(_0x2ad90b){logger[_0xb885('0x19')](_0xb885('0x2b'),_0x2ad90b[_0xb885('0x1b')],_0x371daf);_0x2c0090(_this[_0xb885('0x19')](0x1f4,_0x2ad90b['message']));});});}; \ No newline at end of file diff --git a/server/api/faxInteraction/faxInteraction.socket.js b/server/api/faxInteraction/faxInteraction.socket.js index d3a0036..557e520 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 _0xe62b=['register','length','faxInteraction:','./faxInteraction.events','save','remove','update','emit','removeListener'];(function(_0x2587ca,_0x231303){var _0x5aada1=function(_0x2d21e1){while(--_0x2d21e1){_0x2587ca['push'](_0x2587ca['shift']());}};_0x5aada1(++_0x231303);}(_0xe62b,0x162));var _0xbe62=function(_0x426076,_0xfdf5d2){_0x426076=_0x426076-0x0;var _0x1e9565=_0xe62b[_0x426076];return _0x1e9565;};'use strict';var FaxInteractionEvents=require(_0xbe62('0x0'));var events=[_0xbe62('0x1'),_0xbe62('0x2'),_0xbe62('0x3')];function createListener(_0x4f69e8,_0x291ff9){return function(_0x267a7b){_0x291ff9[_0xbe62('0x4')](_0x4f69e8,_0x267a7b);};}function removeListener(_0x506887,_0x54312c){return function(){FaxInteractionEvents[_0xbe62('0x5')](_0x506887,_0x54312c);};}exports[_0xbe62('0x6')]=function(_0x22453f){for(var _0x25e768=0x0,_0x180741=events[_0xbe62('0x7')];_0x25e768<_0x180741;_0x25e768++){var _0x58a092=events[_0x25e768];var _0x9c2af3=createListener(_0xbe62('0x8')+_0x58a092,_0x22453f);FaxInteractionEvents['on'](_0x58a092,_0x9c2af3);}}; \ No newline at end of file +var _0x869c=['remove','update','emit','register','./faxInteraction.events','save'];(function(_0x3ee55a,_0x19aeea){var _0x581800=function(_0x636cb7){while(--_0x636cb7){_0x3ee55a['push'](_0x3ee55a['shift']());}};_0x581800(++_0x19aeea);}(_0x869c,0xf4));var _0xc869=function(_0x4ff57f,_0x5196e2){_0x4ff57f=_0x4ff57f-0x0;var _0x4be2c9=_0x869c[_0x4ff57f];return _0x4be2c9;};'use strict';var FaxInteractionEvents=require(_0xc869('0x0'));var events=[_0xc869('0x1'),_0xc869('0x2'),_0xc869('0x3')];function createListener(_0x10064c,_0x19b934){return function(_0x34d998){_0x19b934[_0xc869('0x4')](_0x10064c,_0x34d998);};}function removeListener(_0x344569,_0x5007b3){return function(){FaxInteractionEvents['removeListener'](_0x344569,_0x5007b3);};}exports[_0xc869('0x5')]=function(_0x47216){for(var _0x54ed4e=0x0,_0x2de4bf=events['length'];_0x54ed4e<_0x2de4bf;_0x54ed4e++){var _0x5ca579=events[_0x54ed4e];var _0x4f3f65=createListener('faxInteraction:'+_0x5ca579,_0x47216);FaxInteractionEvents['on'](_0x5ca579,_0x4f3f65);}}; \ No newline at end of file diff --git a/server/api/faxInteraction/index.js b/server/api/faxInteraction/index.js index c6a99f2..34962d9 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 _0x8b9a=['util','path','connect-timeout','express','../../components/auth/service','../../components/interaction/service','./faxInteraction.controller','get','isAuthenticated','describe','/:id','show','/:id/messages','getMessages','/:id/download','download','post','/:id/tags','tracked','fax','faxinteraction:addtags','addTags','put','faxinteraction:update','delete','exports','multer'];(function(_0x1fc84d,_0x3f469d){var _0x2658fa=function(_0x189ad0){while(--_0x189ad0){_0x1fc84d['push'](_0x1fc84d['shift']());}};_0x2658fa(++_0x3f469d);}(_0x8b9a,0x179));var _0xa8b9=function(_0x29fb8f,_0xeeeb0b){_0x29fb8f=_0x29fb8f-0x0;var _0x25dc93=_0x8b9a[_0x29fb8f];return _0x25dc93;};'use strict';var multer=require(_0xa8b9('0x0'));var util=require(_0xa8b9('0x1'));var path=require(_0xa8b9('0x2'));var timeout=require(_0xa8b9('0x3'));var express=require(_0xa8b9('0x4'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0xa8b9('0x5'));var interaction=require(_0xa8b9('0x6'));var config=require('../../config/environment');var controller=require(_0xa8b9('0x7'));router['get']('/',auth['isAuthenticated'](),controller['index']);router[_0xa8b9('0x8')]('/describe',auth[_0xa8b9('0x9')](),controller[_0xa8b9('0xa')]);router['get'](_0xa8b9('0xb'),auth[_0xa8b9('0x9')](),controller[_0xa8b9('0xc')]);router['get'](_0xa8b9('0xd'),auth[_0xa8b9('0x9')](),controller[_0xa8b9('0xe')]);router[_0xa8b9('0x8')](_0xa8b9('0xf'),auth['isAuthenticated'](),controller[_0xa8b9('0x10')]);router[_0xa8b9('0x11')]('/',auth[_0xa8b9('0x9')](),controller['create']);router[_0xa8b9('0x11')](_0xa8b9('0xd'),auth[_0xa8b9('0x9')](),controller['addMessage']);router['post'](_0xa8b9('0x12'),auth['isAuthenticated'](),interaction[_0xa8b9('0x13')](_0xa8b9('0x14'),_0xa8b9('0x15')),controller[_0xa8b9('0x16')]);router[_0xa8b9('0x17')](_0xa8b9('0xb'),auth[_0xa8b9('0x9')](),interaction[_0xa8b9('0x13')](_0xa8b9('0x14'),_0xa8b9('0x18')),controller['update']);router[_0xa8b9('0x19')](_0xa8b9('0xb'),auth[_0xa8b9('0x9')](),interaction[_0xa8b9('0x13')](_0xa8b9('0x14'),'faxinteraction:destroy'),controller['destroy']);router['delete'](_0xa8b9('0x12'),auth[_0xa8b9('0x9')](),controller['removeTags']);module[_0xa8b9('0x1a')]=router; \ No newline at end of file +var _0x768e=['get','show','/:id/messages','getMessages','download','post','addMessage','/:id/tags','fax','faxinteraction:addtags','addTags','/:id','update','delete','tracked','faxinteraction:destroy','destroy','removeTags','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./faxInteraction.controller','index','/describe','isAuthenticated','describe'];(function(_0x255a63,_0x2b8f0c){var _0xf6a438=function(_0x1c3a0f){while(--_0x1c3a0f){_0x255a63['push'](_0x255a63['shift']());}};_0xf6a438(++_0x2b8f0c);}(_0x768e,0x9b));var _0xe768=function(_0xf1ac21,_0x1b71b6){_0xf1ac21=_0xf1ac21-0x0;var _0x26a2cf=_0x768e[_0xf1ac21];return _0x26a2cf;};'use strict';var multer=require(_0xe768('0x0'));var util=require(_0xe768('0x1'));var path=require(_0xe768('0x2'));var timeout=require(_0xe768('0x3'));var express=require(_0xe768('0x4'));var router=express[_0xe768('0x5')]();var fs_extra=require(_0xe768('0x6'));var auth=require(_0xe768('0x7'));var interaction=require(_0xe768('0x8'));var config=require(_0xe768('0x9'));var controller=require(_0xe768('0xa'));router['get']('/',auth['isAuthenticated'](),controller[_0xe768('0xb')]);router['get'](_0xe768('0xc'),auth[_0xe768('0xd')](),controller[_0xe768('0xe')]);router[_0xe768('0xf')]('/:id',auth[_0xe768('0xd')](),controller[_0xe768('0x10')]);router['get'](_0xe768('0x11'),auth[_0xe768('0xd')](),controller[_0xe768('0x12')]);router['get']('/:id/download',auth[_0xe768('0xd')](),controller[_0xe768('0x13')]);router[_0xe768('0x14')]('/',auth[_0xe768('0xd')](),controller['create']);router[_0xe768('0x14')](_0xe768('0x11'),auth['isAuthenticated'](),controller[_0xe768('0x15')]);router[_0xe768('0x14')](_0xe768('0x16'),auth[_0xe768('0xd')](),interaction['tracked'](_0xe768('0x17'),_0xe768('0x18')),controller[_0xe768('0x19')]);router['put'](_0xe768('0x1a'),auth[_0xe768('0xd')](),interaction['tracked'](_0xe768('0x17'),'faxinteraction:update'),controller[_0xe768('0x1b')]);router[_0xe768('0x1c')](_0xe768('0x1a'),auth[_0xe768('0xd')](),interaction[_0xe768('0x1d')](_0xe768('0x17'),_0xe768('0x1e')),controller[_0xe768('0x1f')]);router['delete'](_0xe768('0x16'),auth['isAuthenticated'](),controller[_0xe768('0x20')]);module[_0xe768('0x21')]=router; \ No newline at end of file diff --git a/server/api/faxMessage/faxMessage.attributes.js b/server/api/faxMessage/faxMessage.attributes.js index f0b1d23..13779c4 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 _0xf3cd=['TEXT','medium','BOOLEAN','ENUM','out','DATE','sequelize','exports'];(function(_0x391747,_0x5853f7){var _0x15e572=function(_0x4f6caa){while(--_0x4f6caa){_0x391747['push'](_0x391747['shift']());}};_0x15e572(++_0x5853f7);}(_0xf3cd,0xfe));var _0xdf3c=function(_0x43d0e6,_0x3c1489){_0x43d0e6=_0x43d0e6-0x0;var _0x51d841=_0xf3cd[_0x43d0e6];return _0x51d841;};'use strict';var Sequelize=require(_0xdf3c('0x0'));module[_0xdf3c('0x1')]={'body':{'type':Sequelize[_0xdf3c('0x2')](_0xdf3c('0x3')),'allowNull':![]},'read':{'type':Sequelize[_0xdf3c('0x4')],'defaultValue':![]},'direction':{'type':Sequelize[_0xdf3c('0x5')]('in','out'),'defaultValue':_0xdf3c('0x6'),'allowNull':![]},'failMessage':{'type':Sequelize[_0xdf3c('0x2')],'defaultValue':null},'readAt':{'type':Sequelize[_0xdf3c('0x7')]}}; \ No newline at end of file +var _0x6953=['DATE','sequelize','exports','ENUM','out','TEXT'];(function(_0x1bd7b7,_0x18e7c4){var _0x46a408=function(_0x447563){while(--_0x447563){_0x1bd7b7['push'](_0x1bd7b7['shift']());}};_0x46a408(++_0x18e7c4);}(_0x6953,0x91));var _0x3695=function(_0x3ec0ca,_0xa2d707){_0x3ec0ca=_0x3ec0ca-0x0;var _0xc4b818=_0x6953[_0x3ec0ca];return _0xc4b818;};'use strict';var Sequelize=require(_0x3695('0x0'));module[_0x3695('0x1')]={'body':{'type':Sequelize['TEXT']('medium'),'allowNull':![]},'read':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'direction':{'type':Sequelize[_0x3695('0x2')]('in','out'),'defaultValue':_0x3695('0x3'),'allowNull':![]},'failMessage':{'type':Sequelize[_0x3695('0x4')],'defaultValue':null},'readAt':{'type':Sequelize[_0x3695('0x5')]}}; \ No newline at end of file diff --git a/server/api/faxMessage/faxMessage.controller.js b/server/api/faxMessage/faxMessage.controller.js index 89ecaeb..aab9e7e 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 _0xedd2=['code','FaxMessage,\x20%s,\x20%s','error','message','result','status','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','end','sendStatus','stack','name','index','map','FaxMessage','rawAttributes','type','key','model','keys','query','intersection','attributes','fields','length','hasOwnProperty','nolimit','sort','where','filters','merge','VIRTUAL','includeAll','include','rows','catch','params','options','find','body','describe','fax-interactions','accept','fax','read','format','YYYY-MM-DD\x20HH:mm:ss','UserId','user','agent','get','FaxInteraction','FaxInteractionId','isNil','read1stAt','interaction','null','AcceptMessage','acceptMessage','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','ContactId','Sequelize','QueryTypes','SELECT','contact','User','fullname','internal','interface','SIP/%s','channel','motionChannel','event','EventManager','../../config/logger','[FAXMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','role','RejectMessage','rejectmessage','create','findOne','Attachment','SendFax','FaxAccountId','basename','AttachmentId','join','root','server','attachments','download','eml-format','zip-dir','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','api','../../config/license/util','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./faxMessage.socket','register','jayson/promise','client','http','request','then','info','debug','FaxMessage,\x20%s,\x20%s,\x20%s','request\x20sent','stringify'];(function(_0x16b6e3,_0x5616f5){var _0x4732cf=function(_0x144ae1){while(--_0x144ae1){_0x16b6e3['push'](_0x16b6e3['shift']());}};_0x4732cf(++_0x5616f5);}(_0xedd2,0xf0));var _0x2edd=function(_0x19950b,_0x53d0d7){_0x19950b=_0x19950b-0x0;var _0x3c6b41=_0xedd2[_0x19950b];return _0x3c6b41;};'use strict';var emlformat=require(_0x2edd('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x2edd('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0x2edd('0x2'));var moment=require(_0x2edd('0x3'));var BPromise=require(_0x2edd('0x4'));var Mustache=require(_0x2edd('0x5'));var util=require(_0x2edd('0x6'));var path=require(_0x2edd('0x7'));var sox=require(_0x2edd('0x8'));var csv=require(_0x2edd('0x9'));var ejs=require(_0x2edd('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x2edd('0xb'));var squel=require(_0x2edd('0xc'));var crypto=require(_0x2edd('0xd'));var jsforce=require(_0x2edd('0xe'));var deskjs=require(_0x2edd('0xf'));var toCsv=require(_0x2edd('0x9'));var querystring=require(_0x2edd('0x10'));var Papa=require(_0x2edd('0x11'));var Redis=require(_0x2edd('0x12'));var authService=require(_0x2edd('0x13'));var qs=require(_0x2edd('0x14'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x2edd('0x15'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0x2edd('0x16'));var db=require(_0x2edd('0x17'))['db'];config[_0x2edd('0x18')]=_[_0x2edd('0x19')](config['redis'],{'host':_0x2edd('0x1a'),'port':0x18eb});var socket=require(_0x2edd('0x1b'))(new Redis(config[_0x2edd('0x18')]));require(_0x2edd('0x1c'))[_0x2edd('0x1d')](socket);var jayson=require(_0x2edd('0x1e'));var client=jayson[_0x2edd('0x1f')][_0x2edd('0x20')]({'port':0x232c});var client9002=jayson['client'][_0x2edd('0x20')]({'port':0x232a});function respondWithRpcPromise(_0x39c8d8,_0x2d6843,_0x2cbb34,_0x1a65fd){return new BPromise(function(_0x1a1f4e,_0x446255){var _0x7bb293=_0x1a65fd||client;return _0x7bb293[_0x2edd('0x21')](_0x39c8d8,_0x2cbb34)[_0x2edd('0x22')](function(_0x4c984b){logger[_0x2edd('0x23')]('FaxMessage,\x20%s,\x20%s',_0x2d6843,'request\x20sent');logger[_0x2edd('0x24')](_0x2edd('0x25'),_0x2d6843,_0x2edd('0x26'),JSON[_0x2edd('0x27')](_0x4c984b));if(_0x4c984b['error']){if(_0x4c984b['error'][_0x2edd('0x28')]===0x1f4){logger['error'](_0x2edd('0x29'),_0x2d6843,_0x4c984b[_0x2edd('0x2a')]['message']);return _0x446255(_0x4c984b['error'][_0x2edd('0x2b')]);}logger[_0x2edd('0x2a')]('FaxMessage,\x20%s,\x20%s',_0x2d6843,_0x4c984b[_0x2edd('0x2a')][_0x2edd('0x2b')]);return _0x1a1f4e(_0x4c984b[_0x2edd('0x2a')][_0x2edd('0x2b')]);}else{logger[_0x2edd('0x23')](_0x2edd('0x29'),_0x2d6843,_0x2edd('0x26'));_0x1a1f4e(_0x4c984b[_0x2edd('0x2c')]['message']);}})['catch'](function(_0x10e3db){logger[_0x2edd('0x2a')]('FaxMessage,\x20%s,\x20%s',_0x2d6843,_0x10e3db);_0x446255(_0x10e3db);});});}function respondWithStatusCode(_0x13109b,_0x4fe1dc){_0x4fe1dc=_0x4fe1dc||0xcc;return function(_0x4a000b){if(_0x4a000b){return _0x13109b['sendStatus'](_0x4fe1dc);}return _0x13109b[_0x2edd('0x2d')](_0x4fe1dc)['end']();};}function respondWithResult(_0x5b1bb9,_0x178413){_0x178413=_0x178413||0xc8;return function(_0x4cd03b){if(_0x4cd03b){return _0x5b1bb9[_0x2edd('0x2d')](_0x178413)[_0x2edd('0x2e')](_0x4cd03b);}};}function respondWithFilteredResult(_0x5235e7,_0x48d8e9){return function(_0xb3f02f){if(_0xb3f02f){var _0x4e0605=typeof _0x48d8e9[_0x2edd('0x2f')]===_0x2edd('0x30')&&typeof _0x48d8e9[_0x2edd('0x31')]==='undefined';var _0x26deb1=_0xb3f02f[_0x2edd('0x32')];var _0x2bdecb=_0x4e0605?0x0:_0x48d8e9[_0x2edd('0x2f')];var _0x5f5012=_0x4e0605?_0xb3f02f[_0x2edd('0x32')]:_0x48d8e9[_0x2edd('0x2f')]+_0x48d8e9[_0x2edd('0x31')];var _0x1f9bd0;if(_0x5f5012>=_0x26deb1){_0x5f5012=_0x26deb1;_0x1f9bd0=0xc8;}else{_0x1f9bd0=0xce;}_0x5235e7['status'](_0x1f9bd0);return _0x5235e7[_0x2edd('0x33')](_0x2edd('0x34'),_0x2bdecb+'-'+_0x5f5012+'/'+_0x26deb1)[_0x2edd('0x2e')](_0xb3f02f);}return null;};}function patchUpdates(_0x55c623){return function(_0x3f2242){try{jsonpatch[_0x2edd('0x35')](_0x3f2242,_0x55c623,!![]);}catch(_0x32dbc0){return BPromise[_0x2edd('0x36')](_0x32dbc0);}return _0x3f2242[_0x2edd('0x37')]();};}function saveUpdates(_0x3b83f3,_0x431ccb){return function(_0xc66997){if(_0xc66997){return _0xc66997[_0x2edd('0x38')](_0x3b83f3)[_0x2edd('0x22')](function(_0x17512f){return _0x17512f;});}return null;};}function removeEntity(_0x10af06,_0x4cd119){return function(_0x4d860c){if(_0x4d860c){return _0x4d860c['destroy']()[_0x2edd('0x22')](function(){_0x10af06[_0x2edd('0x2d')](0xcc)[_0x2edd('0x39')]();});}};}function handleEntityNotFound(_0x310999,_0x1d03cc){return function(_0x2430e9){if(!_0x2430e9){_0x310999[_0x2edd('0x3a')](0x194);}return _0x2430e9;};}function handleError(_0x5948bc,_0xabcdd7){_0xabcdd7=_0xabcdd7||0x1f4;return function(_0x37e754){logger[_0x2edd('0x2a')](_0x37e754[_0x2edd('0x3b')]);if(_0x37e754['name']){delete _0x37e754[_0x2edd('0x3c')];}_0x5948bc[_0x2edd('0x2d')](_0xabcdd7)['send'](_0x37e754);};}exports[_0x2edd('0x3d')]=function(_0x1421c8,_0x2058db){var _0x1bbee1={},_0x172b52={},_0x484e71={'count':0x0,'rows':[]};var _0x5e6b9b=_[_0x2edd('0x3e')](db[_0x2edd('0x3f')][_0x2edd('0x40')],function(_0x38cd8b){return{'name':_0x38cd8b['fieldName'],'type':_0x38cd8b[_0x2edd('0x41')][_0x2edd('0x42')]};});_0x172b52[_0x2edd('0x43')]=_[_0x2edd('0x3e')](_0x5e6b9b,_0x2edd('0x3c'));_0x172b52['query']=_[_0x2edd('0x44')](_0x1421c8[_0x2edd('0x45')]);_0x172b52['filters']=_[_0x2edd('0x46')](_0x172b52['model'],_0x172b52['query']);_0x1bbee1[_0x2edd('0x47')]=_[_0x2edd('0x46')](_0x172b52['model'],qs[_0x2edd('0x48')](_0x1421c8[_0x2edd('0x45')][_0x2edd('0x48')]));_0x1bbee1[_0x2edd('0x47')]=_0x1bbee1[_0x2edd('0x47')][_0x2edd('0x49')]?_0x1bbee1[_0x2edd('0x47')]:_0x172b52[_0x2edd('0x43')];if(!_0x1421c8['query'][_0x2edd('0x4a')](_0x2edd('0x4b'))){_0x1bbee1[_0x2edd('0x31')]=qs[_0x2edd('0x31')](_0x1421c8['query'][_0x2edd('0x31')]);_0x1bbee1[_0x2edd('0x2f')]=qs[_0x2edd('0x2f')](_0x1421c8[_0x2edd('0x45')][_0x2edd('0x2f')]);}_0x1bbee1['order']=qs[_0x2edd('0x4c')](_0x1421c8[_0x2edd('0x45')][_0x2edd('0x4c')]);_0x1bbee1[_0x2edd('0x4d')]=qs[_0x2edd('0x4e')](_['pick'](_0x1421c8[_0x2edd('0x45')],_0x172b52[_0x2edd('0x4e')]),_0x5e6b9b);if(_0x1421c8[_0x2edd('0x45')]['filter']){_0x1bbee1[_0x2edd('0x4d')]=_[_0x2edd('0x4f')](_0x1bbee1[_0x2edd('0x4d')],{'$or':_[_0x2edd('0x3e')](_0x5e6b9b,function(_0x14cc67){if(_0x14cc67[_0x2edd('0x41')]!==_0x2edd('0x50')){var _0x177908={};_0x177908[_0x14cc67['name']]={'$like':'%'+_0x1421c8['query']['filter']+'%'};return _0x177908;}})});}_0x1bbee1=_['merge']({},_0x1bbee1,_0x1421c8['options']);var _0x281c6d={'where':_0x1bbee1[_0x2edd('0x4d')]};return db[_0x2edd('0x3f')][_0x2edd('0x32')](_0x281c6d)['then'](function(_0x2a0466){_0x484e71[_0x2edd('0x32')]=_0x2a0466;if(_0x1421c8[_0x2edd('0x45')][_0x2edd('0x51')]){_0x1bbee1[_0x2edd('0x52')]=[{'all':!![]}];}return db['FaxMessage']['findAll'](_0x1bbee1);})[_0x2edd('0x22')](function(_0x4896cf){_0x484e71[_0x2edd('0x53')]=_0x4896cf;return _0x484e71;})[_0x2edd('0x22')](respondWithFilteredResult(_0x2058db,_0x1bbee1))[_0x2edd('0x54')](handleError(_0x2058db,null));};exports['show']=function(_0x49c5df,_0x4b419e){var _0x2bf6e2={'raw':!![],'where':{'id':_0x49c5df[_0x2edd('0x55')]['id']}},_0x5e2f88={};_0x5e2f88[_0x2edd('0x43')]=_['keys'](db[_0x2edd('0x3f')][_0x2edd('0x40')]);_0x5e2f88[_0x2edd('0x45')]=_[_0x2edd('0x44')](_0x49c5df[_0x2edd('0x45')]);_0x5e2f88[_0x2edd('0x4e')]=_['intersection'](_0x5e2f88['model'],_0x5e2f88[_0x2edd('0x45')]);_0x2bf6e2['attributes']=_[_0x2edd('0x46')](_0x5e2f88[_0x2edd('0x43')],qs[_0x2edd('0x48')](_0x49c5df[_0x2edd('0x45')][_0x2edd('0x48')]));_0x2bf6e2[_0x2edd('0x47')]=_0x2bf6e2['attributes'][_0x2edd('0x49')]?_0x2bf6e2[_0x2edd('0x47')]:_0x5e2f88[_0x2edd('0x43')];if(_0x49c5df['query'][_0x2edd('0x51')]){_0x2bf6e2[_0x2edd('0x52')]=[{'all':!![]}];}_0x2bf6e2=_[_0x2edd('0x4f')]({},_0x2bf6e2,_0x49c5df[_0x2edd('0x56')]);return db[_0x2edd('0x3f')][_0x2edd('0x57')](_0x2bf6e2)[_0x2edd('0x22')](handleEntityNotFound(_0x4b419e,null))['then'](respondWithResult(_0x4b419e,null))[_0x2edd('0x54')](handleError(_0x4b419e,null));};exports[_0x2edd('0x38')]=function(_0x525ed6,_0x354cda){if(_0x525ed6['body']['id']){delete _0x525ed6[_0x2edd('0x58')]['id'];}return db['FaxMessage']['find']({'where':{'id':_0x525ed6[_0x2edd('0x55')]['id']}})[_0x2edd('0x22')](handleEntityNotFound(_0x354cda,null))['then'](saveUpdates(_0x525ed6['body'],null))['then'](respondWithResult(_0x354cda,null))['catch'](handleError(_0x354cda,null));};exports['destroy']=function(_0x48ae43,_0x475418){return db[_0x2edd('0x3f')]['find']({'where':{'id':_0x48ae43[_0x2edd('0x55')]['id']}})['then'](handleEntityNotFound(_0x475418,null))[_0x2edd('0x22')](removeEntity(_0x475418,null))[_0x2edd('0x54')](handleError(_0x475418,null));};exports['describe']=function(_0x514ecb,_0xd75433){return db[_0x2edd('0x3f')][_0x2edd('0x59')]()[_0x2edd('0x22')](respondWithResult(_0xd75433,null))[_0x2edd('0x54')](handleError(_0xd75433,null));};var interaction_log=require('../../config/logger')(_0x2edd('0x5a'));exports[_0x2edd('0x5b')]=function(_0x52017f,_0x590d68,_0xd3043a){var _0x4d9fe6={'agent':{},'channel':_0x2edd('0x5c')};if(_0x52017f[_0x2edd('0x58')]['id']){delete _0x52017f[_0x2edd('0x58')]['id'];}_0x52017f[_0x2edd('0x58')][_0x2edd('0x5d')]=!![];_0x52017f[_0x2edd('0x58')]['readAt']=moment()[_0x2edd('0x5e')](_0x2edd('0x5f'));_0x52017f[_0x2edd('0x58')][_0x2edd('0x60')]=_0x52017f[_0x2edd('0x58')][_0x2edd('0x60')]||_0x52017f[_0x2edd('0x61')]['id'];_0x4d9fe6[_0x2edd('0x62')]['id']=_0x52017f[_0x2edd('0x58')][_0x2edd('0x60')];return db[_0x2edd('0x3f')]['find']({'where':{'id':_0x52017f[_0x2edd('0x55')]['id'],'UserId':null}})[_0x2edd('0x22')](handleEntityNotFound(_0x590d68,null))[_0x2edd('0x22')](saveUpdates(_0x52017f[_0x2edd('0x58')],null))[_0x2edd('0x22')](function(_0x1d50af){if(_0x1d50af){_0x4d9fe6[_0x2edd('0x2b')]=_0x1d50af[_0x2edd('0x63')]({'plain':!![]});return db[_0x2edd('0x64')][_0x2edd('0x57')]({'where':{'id':_0x1d50af[_0x2edd('0x65')]}});}return null;})['then'](handleEntityNotFound(_0x590d68,null))[_0x2edd('0x22')](function(_0x3320dd){if(_0x3320dd){return _0x3320dd[_0x2edd('0x38')]({'UserId':_0x52017f[_0x2edd('0x58')][_0x2edd('0x60')],'read1stAt':_[_0x2edd('0x66')](_0x3320dd[_0x2edd('0x67')])?moment()['format'](_0x2edd('0x5f')):undefined});}return null;})[_0x2edd('0x22')](function(_0x424253){if(_0x424253){_0x4d9fe6[_0x2edd('0x68')]=_0x424253[_0x2edd('0x63')]({'plain':!![]});interaction_log[_0x2edd('0x23')]('[FAXMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s',_0x52017f['user']['id'],_0x52017f[_0x2edd('0x61')][_0x2edd('0x3c')],_0x52017f['user']['role'],_0x4d9fe6[_0x2edd('0x68')]['id'],_0x52017f[_0x2edd('0x58')]?JSON[_0x2edd('0x27')](_0x52017f['body']):_0x2edd('0x69'));return respondWithRpcPromise(_0x2edd('0x6a'),_0x2edd('0x6b'),_0x4d9fe6);}return null;})[_0x2edd('0x22')](function(_0x18e743){var _0x54a0b4=_0x2edd('0x6c')+_0x18e743[_0x2edd('0x2b')][_0x2edd('0x6d')];return db['sequelize'][_0x2edd('0x45')](_0x54a0b4,{'type':db[_0x2edd('0x6e')][_0x2edd('0x6f')][_0x2edd('0x70')],'raw':!![]})[_0x2edd('0x22')](function(_0x51a26e){return _0x51a26e;});})[_0x2edd('0x22')](function(_0x2316f8){if(_0x2316f8){_0x4d9fe6[_0x2edd('0x2b')][_0x2edd('0x71')]=_0x2316f8[0x0];if(!_0x52017f[_0x2edd('0x58')]['UserId'])return;return db[_0x2edd('0x72')][_0x2edd('0x57')]({'where':{'id':_0x52017f[_0x2edd('0x58')][_0x2edd('0x60')],'role':_0x2edd('0x62')},'attributes':['id',_0x2edd('0x3c'),_0x2edd('0x73'),'email',_0x2edd('0x74')],'raw':!![]});}return null;})['then'](function(_0x1551be){if(!_0x1551be)return null;_0x4d9fe6[_0x2edd('0x2b')][_0x2edd('0x62')]=_0x1551be;return _0x4d9fe6;})[_0x2edd('0x22')](function(_0x432482){if(_0x432482){if(_0x52017f['body']['manual']){_0x4d9fe6[_0x2edd('0x2b')][_0x2edd('0x75')]=util[_0x2edd('0x5e')](_0x2edd('0x76'),_0x52017f[_0x2edd('0x61')][_0x2edd('0x3c')]);_0x4d9fe6['message'][_0x2edd('0x77')]=_0x4d9fe6[_0x2edd('0x77')];_0x4d9fe6[_0x2edd('0x2b')][_0x2edd('0x78')]=_0x4d9fe6[_0x2edd('0x77')];_0x4d9fe6['message'][_0x2edd('0x79')]=_0x2edd('0x5b');return respondWithRpcPromise('EventManager',_0x2edd('0x7a'),{'event':'acceptmessage','message':_0x4d9fe6[_0x2edd('0x2b')]},client9002)[_0x2edd('0x22')](function(){return _0x4d9fe6;});}return _0x4d9fe6;}return null;})[_0x2edd('0x22')](respondWithResult(_0x590d68,null))[_0x2edd('0x54')](handleError(_0x590d68,null));};var interaction_log=require(_0x2edd('0x7b'))(_0x2edd('0x5a'));exports['reject']=function(_0x12199c,_0x27af8f,_0x5df857){var _0x27b93e={'agent':{},'channel':_0x2edd('0x5c')};if(_0x12199c['body']['id']){delete _0x12199c['body']['id'];}_0x12199c['body']['UserId']=_0x12199c[_0x2edd('0x58')][_0x2edd('0x60')]||_0x12199c[_0x2edd('0x61')]['id'];_0x27b93e[_0x2edd('0x62')]['id']=_0x12199c['body'][_0x2edd('0x60')];return db[_0x2edd('0x3f')][_0x2edd('0x57')]({'where':{'id':_0x12199c[_0x2edd('0x55')]['id'],'UserId':null}})['then'](handleEntityNotFound(_0x27af8f,null))['then'](function(_0xade6c9){if(_0xade6c9){_0x27b93e[_0x2edd('0x2b')]=_0xade6c9[_0x2edd('0x63')]({'plain':!![]});return db['FaxInteraction'][_0x2edd('0x57')]({'where':{'id':_0xade6c9['FaxInteractionId']}});}return null;})[_0x2edd('0x22')](handleEntityNotFound(_0x27af8f,null))['then'](function(_0x57194d){if(_0x57194d){_0x27b93e[_0x2edd('0x68')]=_0x57194d[_0x2edd('0x63')]({'plain':!![]});interaction_log[_0x2edd('0x23')](_0x2edd('0x7c'),_0x12199c[_0x2edd('0x61')]['id'],_0x12199c['user']['name'],_0x12199c[_0x2edd('0x61')][_0x2edd('0x7d')],_0x27b93e['interaction']['id'],_0x12199c[_0x2edd('0x58')]?JSON[_0x2edd('0x27')](_0x12199c[_0x2edd('0x58')]):'null');return respondWithRpcPromise(_0x2edd('0x7e'),'rejectMessage',_0x27b93e);}return null;})[_0x2edd('0x22')](function(_0x481de8){var _0x2deef6=_0x2edd('0x6c')+_0x481de8[_0x2edd('0x2b')][_0x2edd('0x6d')];return db['sequelize'][_0x2edd('0x45')](_0x2deef6,{'type':db[_0x2edd('0x6e')][_0x2edd('0x6f')]['SELECT'],'raw':!![]})['then'](function(_0x2cf56f){return _0x2cf56f;});})[_0x2edd('0x22')](function(_0x1f13b9){if(_0x1f13b9){_0x27b93e[_0x2edd('0x2b')][_0x2edd('0x71')]=_0x1f13b9[0x0];if(!_0x12199c['body'][_0x2edd('0x60')])return;return db['User'][_0x2edd('0x57')]({'where':{'id':_0x12199c[_0x2edd('0x58')][_0x2edd('0x60')],'role':_0x2edd('0x62')},'attributes':['id',_0x2edd('0x3c'),'fullname','email','internal'],'raw':!![]});}return null;})['then'](function(_0x262741){if(!_0x262741)return null;_0x27b93e['message'][_0x2edd('0x62')]=_0x262741;return _0x27b93e;})[_0x2edd('0x22')](function(_0x4e5f07){if(_0x4e5f07){_0x4e5f07[_0x2edd('0x2b')][_0x2edd('0x75')]=util[_0x2edd('0x5e')]('SIP/%s',_0x12199c['user'][_0x2edd('0x3c')]);_0x4e5f07[_0x2edd('0x2b')]['channel']=_0x27b93e[_0x2edd('0x77')];_0x4e5f07['message'][_0x2edd('0x78')]=_0x27b93e['channel'];_0x4e5f07[_0x2edd('0x2b')][_0x2edd('0x79')]='reject';respondWithRpcPromise(_0x2edd('0x7a'),_0x2edd('0x7a'),{'event':_0x2edd('0x7f'),'message':_0x4e5f07[_0x2edd('0x2b')]},client9002);return _0x27b93e;}return null;})['then'](respondWithResult(_0x27af8f,null))[_0x2edd('0x54')](handleError(_0x27af8f,null));};exports[_0x2edd('0x80')]=function(_0x17abc0,_0x28c3e8){var _0x343c64;return db[_0x2edd('0x3f')]['create'](_0x17abc0[_0x2edd('0x58')],{})[_0x2edd('0x22')](function(_0x272f1f){_0x343c64=_0x272f1f;return db['CmContact'][_0x2edd('0x81')]({'where':{'id':_0x343c64[_0x2edd('0x6d')]}});})[_0x2edd('0x22')](function(_0x4b906a){if(_['isNil'](_0x4b906a)){return;}else{_0x343c64['fax']=_0x4b906a[_0x2edd('0x5c')];return db[_0x2edd('0x82')][_0x2edd('0x81')]({'where':{'id':_0x343c64['AttachmentId']}});}})[_0x2edd('0x22')](function(_0x3c90cd){return respondWithRpcPromise(_0x2edd('0x83'),_0x2edd('0x83'),{'FaxAccountId':_['isNil'](_0x17abc0[_0x2edd('0x58')])?undefined:_0x17abc0[_0x2edd('0x58')][_0x2edd('0x84')],'path':_['isNil'](_0x3c90cd)?undefined:util[_0x2edd('0x5e')]('/var/opt/motion2/server/files/attachments/%s',_0x3c90cd[_0x2edd('0x85')]),'fax':_[_0x2edd('0x66')](_0x343c64[_0x2edd('0x5c')])?undefined:_0x343c64['fax'],'AttachmentId':_0x343c64[_0x2edd('0x86')]},client9002);})['then'](respondWithResult(_0x28c3e8,0xc9))[_0x2edd('0x54')](handleError(_0x28c3e8,null));};exports['download']=function(_0x44e4f1,_0x232f5f){var _0x8580f=path[_0x2edd('0x87')](config[_0x2edd('0x88')],_0x2edd('0x89'),'files',_0x2edd('0x8a'));return db['FaxMessage'][_0x2edd('0x57')]({'where':{'id':_0x44e4f1[_0x2edd('0x55')]['id']},'include':[{'model':db[_0x2edd('0x82')],'as':_0x2edd('0x82')}]})['then'](handleEntityNotFound(_0x232f5f,null))[_0x2edd('0x22')](function(_0xb3db80){if(_0xb3db80){return _0x232f5f[_0x2edd('0x8b')](path[_0x2edd('0x87')](_0x8580f,_0xb3db80['Attachment'][_0x2edd('0x85')]));}})[_0x2edd('0x54')](handleError(_0x232f5f,null));}; \ No newline at end of file +var _0x3c92=['request\x20sent','stringify','error','message','result','catch','sendStatus','status','end','json','offset','limit','undefined','set','Content-Range','apply','reject','then','destroy','stack','name','send','index','map','rawAttributes','key','model','query','keys','filters','attributes','intersection','fields','length','hasOwnProperty','sort','pick','filter','merge','where','VIRTUAL','count','includeAll','include','findAll','rows','FaxMessage','options','find','update','params','accept','fax','body','read','readAt','YYYY-MM-DD\x20HH:mm:ss','UserId','agent','get','isNil','read1stAt','interaction','[FAXMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','user','acceptMessage','ContactId','sequelize','Sequelize','SELECT','contact','User','fullname','email','internal','manual','interface','SIP/%s','channel','EventManager','acceptmessage','FaxInteraction','FaxInteractionId','[FAXMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','null','RejectMessage','rejectMessage','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','rejectmessage','create','CmContact','Attachment','findOne','AttachmentId','SendFax','FaxAccountId','format','basename','join','root','attachments','download','eml-format','fast-json-patch','bluebird','mustache','util','path','ejs','lodash','squel','crypto','desk.js','to-csv','querystring','ioredis','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','redis','socket.io-emitter','./faxMessage.socket','register','jayson/promise','client','http','request','info','FaxMessage,\x20%s,\x20%s'];(function(_0x2f59ca,_0x452a04){var _0x5b5acd=function(_0x4550f4){while(--_0x4550f4){_0x2f59ca['push'](_0x2f59ca['shift']());}};_0x5b5acd(++_0x452a04);}(_0x3c92,0x170));var _0x23c9=function(_0x3b0f2d,_0x583e14){_0x3b0f2d=_0x3b0f2d-0x0;var _0x5d72e8=_0x3c92[_0x3b0f2d];return _0x5d72e8;};'use strict';var emlformat=require(_0x23c9('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0x23c9('0x1'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0x23c9('0x2'));var Mustache=require(_0x23c9('0x3'));var util=require(_0x23c9('0x4'));var path=require(_0x23c9('0x5'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0x23c9('0x6'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x23c9('0x7'));var squel=require(_0x23c9('0x8'));var crypto=require(_0x23c9('0x9'));var jsforce=require('jsforce');var deskjs=require(_0x23c9('0xa'));var toCsv=require(_0x23c9('0xb'));var querystring=require(_0x23c9('0xc'));var Papa=require('papaparse');var Redis=require(_0x23c9('0xd'));var authService=require('../../components/auth/service');var qs=require(_0x23c9('0xe'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x23c9('0xf'));var logger=require(_0x23c9('0x10'))(_0x23c9('0x11'));var utils=require(_0x23c9('0x12'));var config=require(_0x23c9('0x13'));var licenseUtil=require('../../config/license/util');var db=require(_0x23c9('0x14'))['db'];config[_0x23c9('0x15')]=_['defaults'](config[_0x23c9('0x15')],{'host':'localhost','port':0x18eb});var socket=require(_0x23c9('0x16'))(new Redis(config[_0x23c9('0x15')]));require(_0x23c9('0x17'))[_0x23c9('0x18')](socket);var jayson=require(_0x23c9('0x19'));var client=jayson[_0x23c9('0x1a')][_0x23c9('0x1b')]({'port':0x232c});var client9002=jayson[_0x23c9('0x1a')][_0x23c9('0x1b')]({'port':0x232a});function respondWithRpcPromise(_0xa1e9fd,_0xdde677,_0x187b95,_0x30543f){return new BPromise(function(_0x550c6c,_0x4e06be){var _0x302ef2=_0x30543f||client;return _0x302ef2[_0x23c9('0x1c')](_0xa1e9fd,_0x187b95)['then'](function(_0x1126a8){logger[_0x23c9('0x1d')](_0x23c9('0x1e'),_0xdde677,_0x23c9('0x1f'));logger['debug']('FaxMessage,\x20%s,\x20%s,\x20%s',_0xdde677,_0x23c9('0x1f'),JSON[_0x23c9('0x20')](_0x1126a8));if(_0x1126a8['error']){if(_0x1126a8[_0x23c9('0x21')]['code']===0x1f4){logger[_0x23c9('0x21')](_0x23c9('0x1e'),_0xdde677,_0x1126a8['error']['message']);return _0x4e06be(_0x1126a8[_0x23c9('0x21')][_0x23c9('0x22')]);}logger[_0x23c9('0x21')](_0x23c9('0x1e'),_0xdde677,_0x1126a8[_0x23c9('0x21')][_0x23c9('0x22')]);return _0x550c6c(_0x1126a8[_0x23c9('0x21')][_0x23c9('0x22')]);}else{logger[_0x23c9('0x1d')]('FaxMessage,\x20%s,\x20%s',_0xdde677,_0x23c9('0x1f'));_0x550c6c(_0x1126a8[_0x23c9('0x23')][_0x23c9('0x22')]);}})[_0x23c9('0x24')](function(_0x2e5d93){logger[_0x23c9('0x21')]('FaxMessage,\x20%s,\x20%s',_0xdde677,_0x2e5d93);_0x4e06be(_0x2e5d93);});});}function respondWithStatusCode(_0x751872,_0x1d3543){_0x1d3543=_0x1d3543||0xcc;return function(_0xc4d58f){if(_0xc4d58f){return _0x751872[_0x23c9('0x25')](_0x1d3543);}return _0x751872[_0x23c9('0x26')](_0x1d3543)[_0x23c9('0x27')]();};}function respondWithResult(_0x1237f0,_0x578c23){_0x578c23=_0x578c23||0xc8;return function(_0x3e0554){if(_0x3e0554){return _0x1237f0['status'](_0x578c23)[_0x23c9('0x28')](_0x3e0554);}};}function respondWithFilteredResult(_0xd1579a,_0x46b140){return function(_0x153593){if(_0x153593){var _0x48288a=typeof _0x46b140[_0x23c9('0x29')]==='undefined'&&typeof _0x46b140[_0x23c9('0x2a')]===_0x23c9('0x2b');var _0x4a3fc1=_0x153593['count'];var _0x1273c9=_0x48288a?0x0:_0x46b140[_0x23c9('0x29')];var _0x22780f=_0x48288a?_0x153593['count']:_0x46b140[_0x23c9('0x29')]+_0x46b140[_0x23c9('0x2a')];var _0x5c6005;if(_0x22780f>=_0x4a3fc1){_0x22780f=_0x4a3fc1;_0x5c6005=0xc8;}else{_0x5c6005=0xce;}_0xd1579a['status'](_0x5c6005);return _0xd1579a[_0x23c9('0x2c')](_0x23c9('0x2d'),_0x1273c9+'-'+_0x22780f+'/'+_0x4a3fc1)['json'](_0x153593);}return null;};}function patchUpdates(_0x15a2b4){return function(_0x1e0519){try{jsonpatch[_0x23c9('0x2e')](_0x1e0519,_0x15a2b4,!![]);}catch(_0x164ea6){return BPromise[_0x23c9('0x2f')](_0x164ea6);}return _0x1e0519['save']();};}function saveUpdates(_0x32fdce,_0x5ec2f7){return function(_0x6cf919){if(_0x6cf919){return _0x6cf919['update'](_0x32fdce)[_0x23c9('0x30')](function(_0x5ad92a){return _0x5ad92a;});}return null;};}function removeEntity(_0x588f5f,_0x812918){return function(_0xcb44b0){if(_0xcb44b0){return _0xcb44b0[_0x23c9('0x31')]()[_0x23c9('0x30')](function(){_0x588f5f['status'](0xcc)[_0x23c9('0x27')]();});}};}function handleEntityNotFound(_0x422cc9,_0x1ada91){return function(_0x243e0c){if(!_0x243e0c){_0x422cc9[_0x23c9('0x25')](0x194);}return _0x243e0c;};}function handleError(_0x3672b4,_0x310ebd){_0x310ebd=_0x310ebd||0x1f4;return function(_0x1deb0b){logger[_0x23c9('0x21')](_0x1deb0b[_0x23c9('0x32')]);if(_0x1deb0b[_0x23c9('0x33')]){delete _0x1deb0b[_0x23c9('0x33')];}_0x3672b4[_0x23c9('0x26')](_0x310ebd)[_0x23c9('0x34')](_0x1deb0b);};}exports[_0x23c9('0x35')]=function(_0x2dd816,_0x19d886){var _0x240665={},_0x3d9c36={},_0x502b0d={'count':0x0,'rows':[]};var _0x240926=_[_0x23c9('0x36')](db['FaxMessage'][_0x23c9('0x37')],function(_0x1dcaf6){return{'name':_0x1dcaf6['fieldName'],'type':_0x1dcaf6['type'][_0x23c9('0x38')]};});_0x3d9c36[_0x23c9('0x39')]=_[_0x23c9('0x36')](_0x240926,_0x23c9('0x33'));_0x3d9c36[_0x23c9('0x3a')]=_[_0x23c9('0x3b')](_0x2dd816['query']);_0x3d9c36[_0x23c9('0x3c')]=_['intersection'](_0x3d9c36[_0x23c9('0x39')],_0x3d9c36[_0x23c9('0x3a')]);_0x240665[_0x23c9('0x3d')]=_[_0x23c9('0x3e')](_0x3d9c36['model'],qs[_0x23c9('0x3f')](_0x2dd816['query']['fields']));_0x240665['attributes']=_0x240665[_0x23c9('0x3d')][_0x23c9('0x40')]?_0x240665[_0x23c9('0x3d')]:_0x3d9c36[_0x23c9('0x39')];if(!_0x2dd816[_0x23c9('0x3a')][_0x23c9('0x41')]('nolimit')){_0x240665[_0x23c9('0x2a')]=qs[_0x23c9('0x2a')](_0x2dd816[_0x23c9('0x3a')][_0x23c9('0x2a')]);_0x240665[_0x23c9('0x29')]=qs[_0x23c9('0x29')](_0x2dd816['query'][_0x23c9('0x29')]);}_0x240665['order']=qs[_0x23c9('0x42')](_0x2dd816['query']['sort']);_0x240665['where']=qs['filters'](_[_0x23c9('0x43')](_0x2dd816[_0x23c9('0x3a')],_0x3d9c36[_0x23c9('0x3c')]),_0x240926);if(_0x2dd816[_0x23c9('0x3a')][_0x23c9('0x44')]){_0x240665['where']=_[_0x23c9('0x45')](_0x240665[_0x23c9('0x46')],{'$or':_[_0x23c9('0x36')](_0x240926,function(_0x468e4e){if(_0x468e4e['type']!==_0x23c9('0x47')){var _0x36ab67={};_0x36ab67[_0x468e4e[_0x23c9('0x33')]]={'$like':'%'+_0x2dd816[_0x23c9('0x3a')]['filter']+'%'};return _0x36ab67;}})});}_0x240665=_['merge']({},_0x240665,_0x2dd816['options']);var _0x4f444f={'where':_0x240665[_0x23c9('0x46')]};return db['FaxMessage'][_0x23c9('0x48')](_0x4f444f)[_0x23c9('0x30')](function(_0x1703d9){_0x502b0d[_0x23c9('0x48')]=_0x1703d9;if(_0x2dd816['query'][_0x23c9('0x49')]){_0x240665[_0x23c9('0x4a')]=[{'all':!![]}];}return db['FaxMessage'][_0x23c9('0x4b')](_0x240665);})[_0x23c9('0x30')](function(_0x119111){_0x502b0d[_0x23c9('0x4c')]=_0x119111;return _0x502b0d;})[_0x23c9('0x30')](respondWithFilteredResult(_0x19d886,_0x240665))[_0x23c9('0x24')](handleError(_0x19d886,null));};exports['show']=function(_0x201e4c,_0x1d54ef){var _0x4c7003={'raw':!![],'where':{'id':_0x201e4c['params']['id']}},_0x1bde6b={};_0x1bde6b['model']=_['keys'](db[_0x23c9('0x4d')][_0x23c9('0x37')]);_0x1bde6b[_0x23c9('0x3a')]=_[_0x23c9('0x3b')](_0x201e4c[_0x23c9('0x3a')]);_0x1bde6b[_0x23c9('0x3c')]=_[_0x23c9('0x3e')](_0x1bde6b[_0x23c9('0x39')],_0x1bde6b[_0x23c9('0x3a')]);_0x4c7003[_0x23c9('0x3d')]=_[_0x23c9('0x3e')](_0x1bde6b[_0x23c9('0x39')],qs[_0x23c9('0x3f')](_0x201e4c[_0x23c9('0x3a')][_0x23c9('0x3f')]));_0x4c7003[_0x23c9('0x3d')]=_0x4c7003[_0x23c9('0x3d')][_0x23c9('0x40')]?_0x4c7003[_0x23c9('0x3d')]:_0x1bde6b['model'];if(_0x201e4c[_0x23c9('0x3a')][_0x23c9('0x49')]){_0x4c7003[_0x23c9('0x4a')]=[{'all':!![]}];}_0x4c7003=_[_0x23c9('0x45')]({},_0x4c7003,_0x201e4c[_0x23c9('0x4e')]);return db['FaxMessage'][_0x23c9('0x4f')](_0x4c7003)['then'](handleEntityNotFound(_0x1d54ef,null))[_0x23c9('0x30')](respondWithResult(_0x1d54ef,null))[_0x23c9('0x24')](handleError(_0x1d54ef,null));};exports[_0x23c9('0x50')]=function(_0x42247f,_0x505055){if(_0x42247f['body']['id']){delete _0x42247f['body']['id'];}return db[_0x23c9('0x4d')][_0x23c9('0x4f')]({'where':{'id':_0x42247f[_0x23c9('0x51')]['id']}})[_0x23c9('0x30')](handleEntityNotFound(_0x505055,null))[_0x23c9('0x30')](saveUpdates(_0x42247f['body'],null))[_0x23c9('0x30')](respondWithResult(_0x505055,null))['catch'](handleError(_0x505055,null));};exports[_0x23c9('0x31')]=function(_0x92fa7,_0x264558){return db[_0x23c9('0x4d')]['find']({'where':{'id':_0x92fa7[_0x23c9('0x51')]['id']}})[_0x23c9('0x30')](handleEntityNotFound(_0x264558,null))[_0x23c9('0x30')](removeEntity(_0x264558,null))[_0x23c9('0x24')](handleError(_0x264558,null));};exports['describe']=function(_0x256f54,_0x2a4019){return db[_0x23c9('0x4d')]['describe']()['then'](respondWithResult(_0x2a4019,null))[_0x23c9('0x24')](handleError(_0x2a4019,null));};var interaction_log=require('../../config/logger')('fax-interactions');exports[_0x23c9('0x52')]=function(_0x189ab8,_0x150ecb,_0x16b1a7){var _0x1a1861={'agent':{},'channel':_0x23c9('0x53')};if(_0x189ab8[_0x23c9('0x54')]['id']){delete _0x189ab8[_0x23c9('0x54')]['id'];}_0x189ab8['body'][_0x23c9('0x55')]=!![];_0x189ab8[_0x23c9('0x54')][_0x23c9('0x56')]=moment()['format'](_0x23c9('0x57'));_0x189ab8[_0x23c9('0x54')][_0x23c9('0x58')]=_0x189ab8['body'][_0x23c9('0x58')]||_0x189ab8['user']['id'];_0x1a1861[_0x23c9('0x59')]['id']=_0x189ab8[_0x23c9('0x54')][_0x23c9('0x58')];return db[_0x23c9('0x4d')][_0x23c9('0x4f')]({'where':{'id':_0x189ab8[_0x23c9('0x51')]['id'],'UserId':null}})['then'](handleEntityNotFound(_0x150ecb,null))[_0x23c9('0x30')](saveUpdates(_0x189ab8['body'],null))[_0x23c9('0x30')](function(_0x3346ad){if(_0x3346ad){_0x1a1861[_0x23c9('0x22')]=_0x3346ad[_0x23c9('0x5a')]({'plain':!![]});return db['FaxInteraction'][_0x23c9('0x4f')]({'where':{'id':_0x3346ad['FaxInteractionId']}});}return null;})[_0x23c9('0x30')](handleEntityNotFound(_0x150ecb,null))[_0x23c9('0x30')](function(_0x5c4458){if(_0x5c4458){return _0x5c4458['update']({'UserId':_0x189ab8[_0x23c9('0x54')]['UserId'],'read1stAt':_[_0x23c9('0x5b')](_0x5c4458[_0x23c9('0x5c')])?moment()['format'](_0x23c9('0x57')):undefined});}return null;})[_0x23c9('0x30')](function(_0x446b93){if(_0x446b93){_0x1a1861[_0x23c9('0x5d')]=_0x446b93[_0x23c9('0x5a')]({'plain':!![]});interaction_log['info'](_0x23c9('0x5e'),_0x189ab8[_0x23c9('0x5f')]['id'],_0x189ab8[_0x23c9('0x5f')][_0x23c9('0x33')],_0x189ab8[_0x23c9('0x5f')]['role'],_0x1a1861[_0x23c9('0x5d')]['id'],_0x189ab8[_0x23c9('0x54')]?JSON[_0x23c9('0x20')](_0x189ab8[_0x23c9('0x54')]):'null');return respondWithRpcPromise('AcceptMessage',_0x23c9('0x60'),_0x1a1861);}return null;})[_0x23c9('0x30')](function(_0x528d71){var _0x26d7db='SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20'+_0x528d71['message'][_0x23c9('0x61')];return db[_0x23c9('0x62')][_0x23c9('0x3a')](_0x26d7db,{'type':db[_0x23c9('0x63')]['QueryTypes'][_0x23c9('0x64')],'raw':!![]})[_0x23c9('0x30')](function(_0x517805){return _0x517805;});})[_0x23c9('0x30')](function(_0x306ccf){if(_0x306ccf){_0x1a1861[_0x23c9('0x22')][_0x23c9('0x65')]=_0x306ccf[0x0];if(!_0x189ab8['body'][_0x23c9('0x58')])return;return db[_0x23c9('0x66')][_0x23c9('0x4f')]({'where':{'id':_0x189ab8[_0x23c9('0x54')]['UserId'],'role':_0x23c9('0x59')},'attributes':['id',_0x23c9('0x33'),_0x23c9('0x67'),_0x23c9('0x68'),_0x23c9('0x69')],'raw':!![]});}return null;})['then'](function(_0x514419){if(!_0x514419)return null;_0x1a1861['message'][_0x23c9('0x59')]=_0x514419;return _0x1a1861;})['then'](function(_0x959f26){if(_0x959f26){if(_0x189ab8['body'][_0x23c9('0x6a')]){_0x1a1861[_0x23c9('0x22')][_0x23c9('0x6b')]=util['format'](_0x23c9('0x6c'),_0x189ab8['user'][_0x23c9('0x33')]);_0x1a1861[_0x23c9('0x22')][_0x23c9('0x6d')]=_0x1a1861[_0x23c9('0x6d')];_0x1a1861[_0x23c9('0x22')]['motionChannel']=_0x1a1861[_0x23c9('0x6d')];_0x1a1861[_0x23c9('0x22')]['event']=_0x23c9('0x52');return respondWithRpcPromise('EventManager',_0x23c9('0x6e'),{'event':_0x23c9('0x6f'),'message':_0x1a1861['message']},client9002)[_0x23c9('0x30')](function(){return _0x1a1861;});}return _0x1a1861;}return null;})[_0x23c9('0x30')](respondWithResult(_0x150ecb,null))[_0x23c9('0x24')](handleError(_0x150ecb,null));};var interaction_log=require(_0x23c9('0x10'))('fax-interactions');exports[_0x23c9('0x2f')]=function(_0x545d93,_0x5e53cd,_0x3e164d){var _0x4a4b89={'agent':{},'channel':_0x23c9('0x53')};if(_0x545d93[_0x23c9('0x54')]['id']){delete _0x545d93['body']['id'];}_0x545d93[_0x23c9('0x54')][_0x23c9('0x58')]=_0x545d93[_0x23c9('0x54')][_0x23c9('0x58')]||_0x545d93[_0x23c9('0x5f')]['id'];_0x4a4b89[_0x23c9('0x59')]['id']=_0x545d93['body'][_0x23c9('0x58')];return db['FaxMessage'][_0x23c9('0x4f')]({'where':{'id':_0x545d93[_0x23c9('0x51')]['id'],'UserId':null}})[_0x23c9('0x30')](handleEntityNotFound(_0x5e53cd,null))['then'](function(_0x227da3){if(_0x227da3){_0x4a4b89[_0x23c9('0x22')]=_0x227da3[_0x23c9('0x5a')]({'plain':!![]});return db[_0x23c9('0x70')][_0x23c9('0x4f')]({'where':{'id':_0x227da3[_0x23c9('0x71')]}});}return null;})[_0x23c9('0x30')](handleEntityNotFound(_0x5e53cd,null))[_0x23c9('0x30')](function(_0x9f0e45){if(_0x9f0e45){_0x4a4b89[_0x23c9('0x5d')]=_0x9f0e45['get']({'plain':!![]});interaction_log[_0x23c9('0x1d')](_0x23c9('0x72'),_0x545d93[_0x23c9('0x5f')]['id'],_0x545d93[_0x23c9('0x5f')][_0x23c9('0x33')],_0x545d93[_0x23c9('0x5f')]['role'],_0x4a4b89[_0x23c9('0x5d')]['id'],_0x545d93[_0x23c9('0x54')]?JSON[_0x23c9('0x20')](_0x545d93[_0x23c9('0x54')]):_0x23c9('0x73'));return respondWithRpcPromise(_0x23c9('0x74'),_0x23c9('0x75'),_0x4a4b89);}return null;})[_0x23c9('0x30')](function(_0x16048b){var _0xf67208=_0x23c9('0x76')+_0x16048b['message'][_0x23c9('0x61')];return db[_0x23c9('0x62')]['query'](_0xf67208,{'type':db[_0x23c9('0x63')]['QueryTypes']['SELECT'],'raw':!![]})[_0x23c9('0x30')](function(_0x1ecaa3){return _0x1ecaa3;});})[_0x23c9('0x30')](function(_0x269b33){if(_0x269b33){_0x4a4b89[_0x23c9('0x22')][_0x23c9('0x65')]=_0x269b33[0x0];if(!_0x545d93[_0x23c9('0x54')][_0x23c9('0x58')])return;return db['User'][_0x23c9('0x4f')]({'where':{'id':_0x545d93['body'][_0x23c9('0x58')],'role':_0x23c9('0x59')},'attributes':['id',_0x23c9('0x33'),_0x23c9('0x67'),_0x23c9('0x68'),_0x23c9('0x69')],'raw':!![]});}return null;})[_0x23c9('0x30')](function(_0x4d561e){if(!_0x4d561e)return null;_0x4a4b89['message'][_0x23c9('0x59')]=_0x4d561e;return _0x4a4b89;})['then'](function(_0x4675c7){if(_0x4675c7){_0x4675c7[_0x23c9('0x22')][_0x23c9('0x6b')]=util['format'](_0x23c9('0x6c'),_0x545d93['user'][_0x23c9('0x33')]);_0x4675c7[_0x23c9('0x22')][_0x23c9('0x6d')]=_0x4a4b89['channel'];_0x4675c7[_0x23c9('0x22')]['motionChannel']=_0x4a4b89[_0x23c9('0x6d')];_0x4675c7[_0x23c9('0x22')]['event']=_0x23c9('0x2f');respondWithRpcPromise(_0x23c9('0x6e'),'EventManager',{'event':_0x23c9('0x77'),'message':_0x4675c7['message']},client9002);return _0x4a4b89;}return null;})[_0x23c9('0x30')](respondWithResult(_0x5e53cd,null))[_0x23c9('0x24')](handleError(_0x5e53cd,null));};exports[_0x23c9('0x78')]=function(_0x1fd016,_0x3395b1){var _0x4011d8;return db[_0x23c9('0x4d')][_0x23c9('0x78')](_0x1fd016[_0x23c9('0x54')],{})[_0x23c9('0x30')](function(_0x21aaef){_0x4011d8=_0x21aaef;return db[_0x23c9('0x79')]['findOne']({'where':{'id':_0x4011d8['ContactId']}});})['then'](function(_0x2cf5c9){if(_[_0x23c9('0x5b')](_0x2cf5c9)){return;}else{_0x4011d8[_0x23c9('0x53')]=_0x2cf5c9[_0x23c9('0x53')];return db[_0x23c9('0x7a')][_0x23c9('0x7b')]({'where':{'id':_0x4011d8[_0x23c9('0x7c')]}});}})[_0x23c9('0x30')](function(_0x223c52){return respondWithRpcPromise('SendFax',_0x23c9('0x7d'),{'FaxAccountId':_['isNil'](_0x1fd016['body'])?undefined:_0x1fd016['body'][_0x23c9('0x7e')],'path':_[_0x23c9('0x5b')](_0x223c52)?undefined:util[_0x23c9('0x7f')]('/var/opt/motion2/server/files/attachments/%s',_0x223c52[_0x23c9('0x80')]),'fax':_[_0x23c9('0x5b')](_0x4011d8[_0x23c9('0x53')])?undefined:_0x4011d8[_0x23c9('0x53')],'AttachmentId':_0x4011d8['AttachmentId']},client9002);})[_0x23c9('0x30')](respondWithResult(_0x3395b1,0xc9))['catch'](handleError(_0x3395b1,null));};exports['download']=function(_0x1f67e8,_0x335cc9){var _0x567f00=path[_0x23c9('0x81')](config[_0x23c9('0x82')],'server','files',_0x23c9('0x83'));return db[_0x23c9('0x4d')][_0x23c9('0x4f')]({'where':{'id':_0x1f67e8[_0x23c9('0x51')]['id']},'include':[{'model':db['Attachment'],'as':_0x23c9('0x7a')}]})[_0x23c9('0x30')](handleEntityNotFound(_0x335cc9,null))[_0x23c9('0x30')](function(_0x284a49){if(_0x284a49){return _0x335cc9[_0x23c9('0x84')](path[_0x23c9('0x81')](_0x567f00,_0x284a49[_0x23c9('0x7a')][_0x23c9('0x80')]));}})[_0x23c9('0x24')](handleError(_0x335cc9,null));}; \ No newline at end of file diff --git a/server/api/faxMessage/faxMessage.events.js b/server/api/faxMessage/faxMessage.events.js index e36722e..c5ebd11 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 _0x4744=['hook','exports','events','../../mysqldb','setMaxListeners','save','update','remove','hasOwnProperty'];(function(_0x4c3456,_0x35a0f4){var _0x611b5c=function(_0x1b05d8){while(--_0x1b05d8){_0x4c3456['push'](_0x4c3456['shift']());}};_0x611b5c(++_0x35a0f4);}(_0x4744,0x107));var _0x4474=function(_0x2c3f5e,_0x3ca8aa){_0x2c3f5e=_0x2c3f5e-0x0;var _0x3b1259=_0x4744[_0x2c3f5e];return _0x3b1259;};'use strict';var EventEmitter=require(_0x4474('0x0'));var FaxMessage=require(_0x4474('0x1'))['db']['FaxMessage'];var FaxMessageEvents=new EventEmitter();FaxMessageEvents[_0x4474('0x2')](0x0);var events={'afterCreate':_0x4474('0x3'),'afterUpdate':_0x4474('0x4'),'afterDestroy':_0x4474('0x5')};function emitEvent(_0xbb4a32){return function(_0x3337f4,_0x395f6d,_0x37c996){FaxMessageEvents['emit'](_0xbb4a32+':'+_0x3337f4['id'],_0x3337f4);FaxMessageEvents['emit'](_0xbb4a32,_0x3337f4);_0x37c996(null);};}for(var e in events){if(events[_0x4474('0x6')](e)){var event=events[e];FaxMessage[_0x4474('0x7')](e,emitEvent(event));}}module[_0x4474('0x8')]=FaxMessageEvents; \ No newline at end of file +var _0x4c4a=['events','../../mysqldb','FaxMessage','save','update','remove','emit','exports'];(function(_0x3bae68,_0x3258d9){var _0x562a5f=function(_0x452f2b){while(--_0x452f2b){_0x3bae68['push'](_0x3bae68['shift']());}};_0x562a5f(++_0x3258d9);}(_0x4c4a,0x1d0));var _0xa4c4=function(_0xa3a6d4,_0xdb44b9){_0xa3a6d4=_0xa3a6d4-0x0;var _0x570398=_0x4c4a[_0xa3a6d4];return _0x570398;};'use strict';var EventEmitter=require(_0xa4c4('0x0'));var FaxMessage=require(_0xa4c4('0x1'))['db'][_0xa4c4('0x2')];var FaxMessageEvents=new EventEmitter();FaxMessageEvents['setMaxListeners'](0x0);var events={'afterCreate':_0xa4c4('0x3'),'afterUpdate':_0xa4c4('0x4'),'afterDestroy':_0xa4c4('0x5')};function emitEvent(_0x1dff8d){return function(_0x513255,_0x38fa20,_0x55a242){FaxMessageEvents[_0xa4c4('0x6')](_0x1dff8d+':'+_0x513255['id'],_0x513255);FaxMessageEvents[_0xa4c4('0x6')](_0x1dff8d,_0x513255);_0x55a242(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];FaxMessage['hook'](e,emitEvent(event));}}module[_0xa4c4('0x7')]=FaxMessageEvents; \ No newline at end of file diff --git a/server/api/faxMessage/faxMessage.model.js b/server/api/faxMessage/faxMessage.model.js index a80ed06..247e76c 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 _0x7c7b=['FaxInteraction','FaxInteractionId','update','catch','error','utf8mb4_unicode_ci','util','../../config/logger','moment','bluebird','request-promise','path','rimraf','../../config/environment','./faxMessage.attributes','define','FaxMessage','fax_messages','body','FULLTEXT','models','get','direction','toLowerCase','out','secret','UserId'];(function(_0x5416db,_0x55683a){var _0x243e35=function(_0x1eb623){while(--_0x1eb623){_0x5416db['push'](_0x5416db['shift']());}};_0x243e35(++_0x55683a);}(_0x7c7b,0x19b));var _0xb7c7=function(_0x52c218,_0x559397){_0x52c218=_0x52c218-0x0;var _0x39ac6f=_0x7c7b[_0x52c218];return _0x39ac6f;};'use strict';var _=require('lodash');var util=require(_0xb7c7('0x0'));var logger=require(_0xb7c7('0x1'))('api');var moment=require(_0xb7c7('0x2'));var BPromise=require(_0xb7c7('0x3'));var rp=require(_0xb7c7('0x4'));var fs=require('fs');var path=require(_0xb7c7('0x5'));var rimraf=require(_0xb7c7('0x6'));var config=require(_0xb7c7('0x7'));var attributes=require(_0xb7c7('0x8'));module['exports']=function(_0x500e77,_0x276be7){return _0x500e77[_0xb7c7('0x9')](_0xb7c7('0xa'),attributes,{'tableName':_0xb7c7('0xb'),'paranoid':![],'indexes':[{'name':'fti_fax_messages','fields':[_0xb7c7('0xc')],'type':_0xb7c7('0xd')}],'timestamps':!![],'hooks':{'afterCreate':function(_0x314184,_0x199c01,_0x513002){var _0x176370=_0x500e77[_0xb7c7('0xe')];var _0x5b1d91=_0x314184[_0xb7c7('0xf')]({'plain':!![]});if(_0x5b1d91[_0xb7c7('0x10')][_0xb7c7('0x11')]()==='in'||_0x5b1d91[_0xb7c7('0x10')][_0xb7c7('0x11')]()===_0xb7c7('0x12')&&!_0x5b1d91[_0xb7c7('0x13')]&&!_['isNil'](_0x5b1d91[_0xb7c7('0x14')])){_0x176370[_0xb7c7('0x15')]['findOne']({'where':{'id':_0x5b1d91[_0xb7c7('0x16')]}})['then'](function(_0x539a5d){if(_0x539a5d){_0x539a5d[_0xb7c7('0x17')]({'lastMsgAt':_0x5b1d91['createdAt'],'lastMsgDirection':_0x5b1d91[_0xb7c7('0x10')]['toLowerCase']()});}})[_0xb7c7('0x18')](function(_0x303cb4){console[_0xb7c7('0x19')](_0x303cb4);});}_0x513002();}},'charset':'utf8mb4','collate':_0xb7c7('0x1a')});}; \ No newline at end of file +var _0x7213=['direction','toLowerCase','out','isNil','FaxInteraction','findOne','then','update','createdAt','catch','error','utf8mb4','utf8mb4_unicode_ci','util','../../config/logger','api','bluebird','request-promise','rimraf','../../config/environment','define','fax_messages','fti_fax_messages','body','models','get'];(function(_0x32d82b,_0x220fdf){var _0x14f1e2=function(_0x24e87f){while(--_0x24e87f){_0x32d82b['push'](_0x32d82b['shift']());}};_0x14f1e2(++_0x220fdf);}(_0x7213,0xc3));var _0x3721=function(_0x4bcaa8,_0x47b056){_0x4bcaa8=_0x4bcaa8-0x0;var _0x2959ad=_0x7213[_0x4bcaa8];return _0x2959ad;};'use strict';var _=require('lodash');var util=require(_0x3721('0x0'));var logger=require(_0x3721('0x1'))(_0x3721('0x2'));var moment=require('moment');var BPromise=require(_0x3721('0x3'));var rp=require(_0x3721('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0x3721('0x5'));var config=require(_0x3721('0x6'));var attributes=require('./faxMessage.attributes');module['exports']=function(_0x52f25c,_0x1515f8){return _0x52f25c[_0x3721('0x7')]('FaxMessage',attributes,{'tableName':_0x3721('0x8'),'paranoid':![],'indexes':[{'name':_0x3721('0x9'),'fields':[_0x3721('0xa')],'type':'FULLTEXT'}],'timestamps':!![],'hooks':{'afterCreate':function(_0x5a03c3,_0x343d26,_0x3440b3){var _0x48b296=_0x52f25c[_0x3721('0xb')];var _0x2299c4=_0x5a03c3[_0x3721('0xc')]({'plain':!![]});if(_0x2299c4[_0x3721('0xd')]['toLowerCase']()==='in'||_0x2299c4[_0x3721('0xd')][_0x3721('0xe')]()===_0x3721('0xf')&&!_0x2299c4['secret']&&!_[_0x3721('0x10')](_0x2299c4['UserId'])){_0x48b296[_0x3721('0x11')][_0x3721('0x12')]({'where':{'id':_0x2299c4['FaxInteractionId']}})[_0x3721('0x13')](function(_0x1f17ac){if(_0x1f17ac){_0x1f17ac[_0x3721('0x14')]({'lastMsgAt':_0x2299c4[_0x3721('0x15')],'lastMsgDirection':_0x2299c4['direction']['toLowerCase']()});}})[_0x3721('0x16')](function(_0x22d7ea){console[_0x3721('0x17')](_0x22d7ea);});}_0x3440b3();}},'charset':_0x3721('0x18'),'collate':_0x3721('0x19')});}; \ No newline at end of file diff --git a/server/api/faxMessage/faxMessage.rpc.js b/server/api/faxMessage/faxMessage.rpc.js index 014e9f6..bc188db 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 _0x55e0=['moment','bluebird','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','redis','localhost','socket.io-emitter','./faxMessage.socket','FaxMessage,\x20%s,\x20%s','request\x20sent','debug','FaxMessage,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result','catch','CreateFaxMessage','FaxMessage','create','body','options','raw','then','UpdateFaxMessage','update','where','attributes','limit','lodash','util'];(function(_0x3ff26a,_0x3c5177){var _0x2fb1aa=function(_0x65f1f4){while(--_0x65f1f4){_0x3ff26a['push'](_0x3ff26a['shift']());}};_0x2fb1aa(++_0x3c5177);}(_0x55e0,0xdc));var _0x055e=function(_0xd75eec,_0xf6aa2c){_0xd75eec=_0xd75eec-0x0;var _0x548dc3=_0x55e0[_0xd75eec];return _0x548dc3;};'use strict';var _=require(_0x055e('0x0'));var util=require(_0x055e('0x1'));var moment=require(_0x055e('0x2'));var BPromise=require(_0x055e('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x055e('0x4'))['db'];var utils=require(_0x055e('0x5'));var logger=require(_0x055e('0x6'))(_0x055e('0x7'));var config=require(_0x055e('0x8'));var jayson=require(_0x055e('0x9'));var client=jayson['client']['http']({'port':0x232a});config[_0x055e('0xa')]=_['defaults'](config[_0x055e('0xa')],{'host':_0x055e('0xb'),'port':0x18eb});var socket=require(_0x055e('0xc'))(new Redis(config[_0x055e('0xa')]));require(_0x055e('0xd'))['register'](socket);function respondWithRpcPromise(_0x40779c,_0xd67814,_0xb816c){return new BPromise(function(_0xa0d384,_0x238068){return client['request'](_0x40779c,_0xb816c)['then'](function(_0x187cce){logger['info'](_0x055e('0xe'),_0xd67814,_0x055e('0xf'));logger[_0x055e('0x10')](_0x055e('0x11'),_0xd67814,_0x055e('0xf'),JSON[_0x055e('0x12')](_0x187cce));if(_0x187cce[_0x055e('0x13')]){if(_0x187cce['error'][_0x055e('0x14')]===0x1f4){logger[_0x055e('0x13')](_0x055e('0xe'),_0xd67814,_0x187cce[_0x055e('0x13')][_0x055e('0x15')]);return _0x238068(_0x187cce['error'][_0x055e('0x15')]);}logger[_0x055e('0x13')](_0x055e('0xe'),_0xd67814,_0x187cce['error'][_0x055e('0x15')]);return _0xa0d384(_0x187cce[_0x055e('0x13')][_0x055e('0x15')]);}else{logger[_0x055e('0x16')](_0x055e('0xe'),_0xd67814,'request\x20sent');_0xa0d384(_0x187cce[_0x055e('0x17')][_0x055e('0x15')]);}})[_0x055e('0x18')](function(_0x2ed6fb){logger['error'](_0x055e('0xe'),_0xd67814,_0x2ed6fb);_0x238068(_0x2ed6fb);});});}exports[_0x055e('0x19')]=function(_0x58e44a){var _0xe2b7b5=this;return new Promise(function(_0x4412f9,_0x10258f){return db[_0x055e('0x1a')][_0x055e('0x1b')](_0x58e44a[_0x055e('0x1c')],{'raw':_0x58e44a['options']?_0x58e44a[_0x055e('0x1d')][_0x055e('0x1e')]===undefined?!![]:![]:!![]})[_0x055e('0x1f')](function(_0x5930ff){logger[_0x055e('0x16')](_0x055e('0x19'),_0x58e44a);logger[_0x055e('0x10')](_0x055e('0x19'),_0x58e44a,JSON['stringify'](_0x5930ff));_0x4412f9(_0x5930ff);})[_0x055e('0x18')](function(_0x56c372){logger[_0x055e('0x13')](_0x055e('0x19'),_0x56c372[_0x055e('0x15')],_0x58e44a);_0x10258f(_0xe2b7b5[_0x055e('0x13')](0x1f4,_0x56c372[_0x055e('0x15')]));});});};exports[_0x055e('0x20')]=function(_0x58caf9){var _0x2fb49b=this;return new Promise(function(_0x1f90a9,_0x2a82f8){return db['FaxMessage'][_0x055e('0x21')](_0x58caf9[_0x055e('0x1c')],{'raw':_0x58caf9[_0x055e('0x1d')]?_0x58caf9[_0x055e('0x1d')]['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x58caf9[_0x055e('0x1d')]?_0x58caf9['options'][_0x055e('0x22')]||null:null,'attributes':_0x58caf9[_0x055e('0x1d')]?_0x58caf9[_0x055e('0x1d')][_0x055e('0x23')]||null:null,'limit':_0x58caf9[_0x055e('0x1d')]?_0x58caf9['options'][_0x055e('0x24')]||null:null})[_0x055e('0x1f')](function(_0x293062){logger[_0x055e('0x16')](_0x055e('0x20'),_0x58caf9);logger[_0x055e('0x10')](_0x055e('0x20'),_0x58caf9,JSON[_0x055e('0x12')](_0x293062));_0x1f90a9(_0x293062);})['catch'](function(_0x26d1c2){logger[_0x055e('0x13')]('UpdateFaxMessage',_0x26d1c2[_0x055e('0x15')],_0x58caf9);_0x2a82f8(_0x2fb49b[_0x055e('0x13')](0x1f4,_0x26d1c2[_0x055e('0x15')]));});});}; \ No newline at end of file +var _0xac9d=['then','info','FaxMessage,\x20%s,\x20%s','debug','FaxMessage,\x20%s,\x20%s,\x20%s','request\x20sent','error','code','message','result','catch','FaxMessage','body','options','raw','CreateFaxMessage','UpdateFaxMessage','update','attributes','limit','stringify','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','jayson/promise','client','http','redis','defaults','socket.io-emitter','./faxMessage.socket','register','request'];(function(_0x2f74e5,_0xc8c26){var _0x3994c0=function(_0x23bc75){while(--_0x23bc75){_0x2f74e5['push'](_0x2f74e5['shift']());}};_0x3994c0(++_0xc8c26);}(_0xac9d,0x14d));var _0xdac9=function(_0x5ddaac,_0x2697a8){_0x5ddaac=_0x5ddaac-0x0;var _0x2a9c58=_0xac9d[_0x5ddaac];return _0x2a9c58;};'use strict';var _=require(_0xdac9('0x0'));var util=require(_0xdac9('0x1'));var moment=require(_0xdac9('0x2'));var BPromise=require(_0xdac9('0x3'));var rs=require(_0xdac9('0x4'));var fs=require('fs');var Redis=require(_0xdac9('0x5'));var db=require(_0xdac9('0x6'))['db'];var utils=require(_0xdac9('0x7'));var logger=require('../../config/logger')(_0xdac9('0x8'));var config=require('../../config/environment');var jayson=require(_0xdac9('0x9'));var client=jayson[_0xdac9('0xa')][_0xdac9('0xb')]({'port':0x232a});config[_0xdac9('0xc')]=_[_0xdac9('0xd')](config[_0xdac9('0xc')],{'host':'localhost','port':0x18eb});var socket=require(_0xdac9('0xe'))(new Redis(config['redis']));require(_0xdac9('0xf'))[_0xdac9('0x10')](socket);function respondWithRpcPromise(_0x39c92c,_0x1a4674,_0x23ec14){return new BPromise(function(_0x2859bf,_0x255627){return client[_0xdac9('0x11')](_0x39c92c,_0x23ec14)[_0xdac9('0x12')](function(_0x5514c5){logger[_0xdac9('0x13')](_0xdac9('0x14'),_0x1a4674,'request\x20sent');logger[_0xdac9('0x15')](_0xdac9('0x16'),_0x1a4674,_0xdac9('0x17'),JSON['stringify'](_0x5514c5));if(_0x5514c5[_0xdac9('0x18')]){if(_0x5514c5[_0xdac9('0x18')][_0xdac9('0x19')]===0x1f4){logger['error']('FaxMessage,\x20%s,\x20%s',_0x1a4674,_0x5514c5[_0xdac9('0x18')][_0xdac9('0x1a')]);return _0x255627(_0x5514c5['error'][_0xdac9('0x1a')]);}logger[_0xdac9('0x18')](_0xdac9('0x14'),_0x1a4674,_0x5514c5[_0xdac9('0x18')][_0xdac9('0x1a')]);return _0x2859bf(_0x5514c5[_0xdac9('0x18')][_0xdac9('0x1a')]);}else{logger[_0xdac9('0x13')]('FaxMessage,\x20%s,\x20%s',_0x1a4674,_0xdac9('0x17'));_0x2859bf(_0x5514c5[_0xdac9('0x1b')]['message']);}})[_0xdac9('0x1c')](function(_0xa57f2d){logger[_0xdac9('0x18')](_0xdac9('0x14'),_0x1a4674,_0xa57f2d);_0x255627(_0xa57f2d);});});}exports['CreateFaxMessage']=function(_0x520369){var _0x4029fc=this;return new Promise(function(_0x20ece3,_0x2b9d91){return db[_0xdac9('0x1d')]['create'](_0x520369[_0xdac9('0x1e')],{'raw':_0x520369[_0xdac9('0x1f')]?_0x520369[_0xdac9('0x1f')][_0xdac9('0x20')]===undefined?!![]:![]:!![]})[_0xdac9('0x12')](function(_0x42317c){logger[_0xdac9('0x13')](_0xdac9('0x21'),_0x520369);logger[_0xdac9('0x15')](_0xdac9('0x21'),_0x520369,JSON['stringify'](_0x42317c));_0x20ece3(_0x42317c);})[_0xdac9('0x1c')](function(_0x11f4fd){logger[_0xdac9('0x18')](_0xdac9('0x21'),_0x11f4fd['message'],_0x520369);_0x2b9d91(_0x4029fc[_0xdac9('0x18')](0x1f4,_0x11f4fd['message']));});});};exports[_0xdac9('0x22')]=function(_0x2fce71){var _0x566d8c=this;return new Promise(function(_0x433be9,_0x5105f1){return db[_0xdac9('0x1d')][_0xdac9('0x23')](_0x2fce71[_0xdac9('0x1e')],{'raw':_0x2fce71[_0xdac9('0x1f')]?_0x2fce71['options']['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x2fce71[_0xdac9('0x1f')]?_0x2fce71[_0xdac9('0x1f')]['where']||null:null,'attributes':_0x2fce71['options']?_0x2fce71[_0xdac9('0x1f')][_0xdac9('0x24')]||null:null,'limit':_0x2fce71[_0xdac9('0x1f')]?_0x2fce71[_0xdac9('0x1f')][_0xdac9('0x25')]||null:null})[_0xdac9('0x12')](function(_0xed99f9){logger[_0xdac9('0x13')](_0xdac9('0x22'),_0x2fce71);logger[_0xdac9('0x15')](_0xdac9('0x22'),_0x2fce71,JSON[_0xdac9('0x26')](_0xed99f9));_0x433be9(_0xed99f9);})[_0xdac9('0x1c')](function(_0x336fd5){logger[_0xdac9('0x18')](_0xdac9('0x22'),_0x336fd5[_0xdac9('0x1a')],_0x2fce71);_0x5105f1(_0x566d8c[_0xdac9('0x18')](0x1f4,_0x336fd5[_0xdac9('0x1a')]));});});}; \ No newline at end of file diff --git a/server/api/faxMessage/faxMessage.socket.js b/server/api/faxMessage/faxMessage.socket.js index 97dcada..fe429da 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 _0x4923=['save','remove','update','removeListener','length','faxMessage:'];(function(_0x4565bf,_0x5ad9d6){var _0x5610ba=function(_0x170988){while(--_0x170988){_0x4565bf['push'](_0x4565bf['shift']());}};_0x5610ba(++_0x5ad9d6);}(_0x4923,0x1b0));var _0x3492=function(_0x42cae2,_0x284ef8){_0x42cae2=_0x42cae2-0x0;var _0x5f256f=_0x4923[_0x42cae2];return _0x5f256f;};'use strict';var FaxMessageEvents=require('./faxMessage.events');var events=[_0x3492('0x0'),_0x3492('0x1'),_0x3492('0x2')];function createListener(_0xa7240c,_0xb0009c){return function(_0x324562){_0xb0009c['emit'](_0xa7240c,_0x324562);};}function removeListener(_0x4c0a86,_0x4bd209){return function(){FaxMessageEvents[_0x3492('0x3')](_0x4c0a86,_0x4bd209);};}exports['register']=function(_0x2f160a){for(var _0x25818c=0x0,_0x3de5a9=events[_0x3492('0x4')];_0x25818c<_0x3de5a9;_0x25818c++){var _0x3a7445=events[_0x25818c];var _0x162c61=createListener(_0x3492('0x5')+_0x3a7445,_0x2f160a);FaxMessageEvents['on'](_0x3a7445,_0x162c61);}}; \ No newline at end of file +var _0xf26b=['length','faxMessage:','remove','update','register'];(function(_0x411bbc,_0x44eea7){var _0x164e02=function(_0x11be9f){while(--_0x11be9f){_0x411bbc['push'](_0x411bbc['shift']());}};_0x164e02(++_0x44eea7);}(_0xf26b,0xb6));var _0xbf26=function(_0x549051,_0x20c0d4){_0x549051=_0x549051-0x0;var _0x4df703=_0xf26b[_0x549051];return _0x4df703;};'use strict';var FaxMessageEvents=require('./faxMessage.events');var events=['save',_0xbf26('0x0'),_0xbf26('0x1')];function createListener(_0x270ed7,_0x2e27e1){return function(_0x3074b5){_0x2e27e1['emit'](_0x270ed7,_0x3074b5);};}function removeListener(_0x2c0696,_0x2f89dd){return function(){FaxMessageEvents['removeListener'](_0x2c0696,_0x2f89dd);};}exports[_0xbf26('0x2')]=function(_0x511d81){for(var _0x8ba849=0x0,_0x1b60bd=events[_0xbf26('0x3')];_0x8ba849<_0x1b60bd;_0x8ba849++){var _0x4caad5=events[_0x8ba849];var _0x361f08=createListener(_0xbf26('0x4')+_0x4caad5,_0x511d81);FaxMessageEvents['on'](_0x4caad5,_0x361f08);}}; \ No newline at end of file diff --git a/server/api/faxMessage/index.js b/server/api/faxMessage/index.js index 2a017ce..de06c06 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 _0xf72b=['Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./faxMessage.controller','get','isAuthenticated','/describe','describe','/:id','show','/:id/download','post','tracked','fax','faxmessage:create','create','put','update','/:id/accept','accept','reject','delete','destroy','exports','multer','path','express'];(function(_0x5d1c7b,_0x4d11cd){var _0x5b63a2=function(_0x3aff7f){while(--_0x3aff7f){_0x5d1c7b['push'](_0x5d1c7b['shift']());}};_0x5b63a2(++_0x4d11cd);}(_0xf72b,0x1d9));var _0xbf72=function(_0x485c99,_0x17194c){_0x485c99=_0x485c99-0x0;var _0x2879a3=_0xf72b[_0x485c99];return _0x2879a3;};'use strict';var multer=require(_0xbf72('0x0'));var util=require('util');var path=require(_0xbf72('0x1'));var timeout=require('connect-timeout');var express=require(_0xbf72('0x2'));var router=express[_0xbf72('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0xbf72('0x4'));var interaction=require(_0xbf72('0x5'));var config=require(_0xbf72('0x6'));var controller=require(_0xbf72('0x7'));router[_0xbf72('0x8')]('/',auth[_0xbf72('0x9')](),controller['index']);router[_0xbf72('0x8')](_0xbf72('0xa'),auth[_0xbf72('0x9')](),controller[_0xbf72('0xb')]);router[_0xbf72('0x8')](_0xbf72('0xc'),auth['isAuthenticated'](),controller[_0xbf72('0xd')]);router['get'](_0xbf72('0xe'),auth[_0xbf72('0x9')](),controller['download']);router[_0xbf72('0xf')]('/',auth[_0xbf72('0x9')](),interaction[_0xbf72('0x10')](_0xbf72('0x11'),_0xbf72('0x12')),controller[_0xbf72('0x13')]);router[_0xbf72('0x14')](_0xbf72('0xc'),auth['isAuthenticated'](),controller[_0xbf72('0x15')]);router[_0xbf72('0x14')](_0xbf72('0x16'),auth['isAuthenticated'](),controller[_0xbf72('0x17')]);router['put']('/:id/reject',auth['isAuthenticated'](),controller[_0xbf72('0x18')]);router[_0xbf72('0x19')](_0xbf72('0xc'),auth[_0xbf72('0x9')](),controller[_0xbf72('0x1a')]);module[_0xbf72('0x1b')]=router; \ No newline at end of file +var _0x9354=['describe','/:id','show','/:id/download','download','post','fax','put','update','/:id/accept','accept','/:id/reject','reject','delete','destroy','util','path','express','Router','fs-extra','../../components/auth/service','../../config/environment','./faxMessage.controller','get','isAuthenticated','index','/describe'];(function(_0x3f49f6,_0x413397){var _0xfa2c5d=function(_0x320849){while(--_0x320849){_0x3f49f6['push'](_0x3f49f6['shift']());}};_0xfa2c5d(++_0x413397);}(_0x9354,0x96));var _0x4935=function(_0x380b8f,_0x32271d){_0x380b8f=_0x380b8f-0x0;var _0x646c69=_0x9354[_0x380b8f];return _0x646c69;};'use strict';var multer=require('multer');var util=require(_0x4935('0x0'));var path=require(_0x4935('0x1'));var timeout=require('connect-timeout');var express=require(_0x4935('0x2'));var router=express[_0x4935('0x3')]();var fs_extra=require(_0x4935('0x4'));var auth=require(_0x4935('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0x4935('0x6'));var controller=require(_0x4935('0x7'));router[_0x4935('0x8')]('/',auth[_0x4935('0x9')](),controller[_0x4935('0xa')]);router[_0x4935('0x8')](_0x4935('0xb'),auth[_0x4935('0x9')](),controller[_0x4935('0xc')]);router['get'](_0x4935('0xd'),auth['isAuthenticated'](),controller[_0x4935('0xe')]);router[_0x4935('0x8')](_0x4935('0xf'),auth[_0x4935('0x9')](),controller[_0x4935('0x10')]);router[_0x4935('0x11')]('/',auth['isAuthenticated'](),interaction['tracked'](_0x4935('0x12'),'faxmessage:create'),controller['create']);router[_0x4935('0x13')](_0x4935('0xd'),auth[_0x4935('0x9')](),controller[_0x4935('0x14')]);router[_0x4935('0x13')](_0x4935('0x15'),auth[_0x4935('0x9')](),controller[_0x4935('0x16')]);router[_0x4935('0x13')](_0x4935('0x17'),auth[_0x4935('0x9')](),controller[_0x4935('0x18')]);router[_0x4935('0x19')](_0x4935('0xd'),auth[_0x4935('0x9')](),controller[_0x4935('0x1a')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/faxQueue/faxQueue.attributes.js b/server/api/faxQueue/faxQueue.attributes.js index fbaccbc..ffe4ff3 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 _0x2b67=['roundrobin','sequelize','STRING','name','INTEGER','beepall'];(function(_0x1afe3e,_0x4bf84a){var _0x25645f=function(_0x1a8eb1){while(--_0x1a8eb1){_0x1afe3e['push'](_0x1afe3e['shift']());}};_0x25645f(++_0x4bf84a);}(_0x2b67,0x67));var _0x72b6=function(_0x32836,_0x1a21e7){_0x32836=_0x32836-0x0;var _0x486a81=_0x2b67[_0x32836];return _0x486a81;};'use strict';var Sequelize=require(_0x72b6('0x0'));module['exports']={'name':{'type':Sequelize[_0x72b6('0x1')],'unique':_0x72b6('0x2'),'allowNull':![],'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize['STRING']},'timeout':{'type':Sequelize[_0x72b6('0x3')],'allowNull':![],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize['ENUM']('rrmemory',_0x72b6('0x4'),_0x72b6('0x5')),'allowNull':![]},'lastAgent':{'type':Sequelize[_0x72b6('0x3')],'defaultValue':0x0}}; \ No newline at end of file +var _0x5224=['rrmemory','beepall','roundrobin','INTEGER','sequelize','exports','STRING','name','ENUM'];(function(_0x13bcbb,_0x2eb915){var _0x457c81=function(_0xf44477){while(--_0xf44477){_0x13bcbb['push'](_0x13bcbb['shift']());}};_0x457c81(++_0x2eb915);}(_0x5224,0xa6));var _0x4522=function(_0x53b53e,_0x498437){_0x53b53e=_0x53b53e-0x0;var _0xbb6179=_0x5224[_0x53b53e];return _0xbb6179;};'use strict';var Sequelize=require(_0x4522('0x0'));module[_0x4522('0x1')]={'name':{'type':Sequelize[_0x4522('0x2')],'unique':_0x4522('0x3'),'allowNull':![],'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize[_0x4522('0x2')]},'timeout':{'type':Sequelize['INTEGER'],'allowNull':![],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize[_0x4522('0x4')](_0x4522('0x5'),_0x4522('0x6'),_0x4522('0x7')),'allowNull':![]},'lastAgent':{'type':Sequelize[_0x4522('0x8')],'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 8c79d6b..259bfcb 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 _0x44ff=['model','keys','filters','intersection','attributes','fields','length','includeAll','merge','options','find','create','body','user','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','describe','getMembers','rawAttributes','nolimit','order','sort','where','filter','UserFaxQueue','findAndCountAll','UserId','agent','createdAt','count','format','%s/%s','SIP','faxPause','updatedAt','getTeams','Team','pick','hasOwnProperty','ids','Agents','online','voicePause','interface','sequelize','transaction','addTeams','findOrCreate','forEach','userFaxQueue:save','removeTeams','User','select','field','from','team_has_fax_queues','user_has_teams','ut.TeamId\x20=\x20tq.TeamId','FaxQueueId\x20=\x20?','clone','ut.UserId\x20=\x20?','QueryTypes','SELECT','TeamId','includes','all','union','compact','value','removeAgents','userFaxQueue:remove','addAgents','omit','spread','emit','isArray','getAgents','util','lodash','squel','../../config/environment','../../mysqldb','redis','localhost','socket.io-emitter','./faxQueue.socket','register','sendStatus','status','end','json','offset','undefined','limit','set','update','then','FaxQueues','UserProfileResource','destroy','error','stack','name','send','index','map','FaxQueue','fieldName','type','key','getOptions','include','query','findAll','rows','catch','show','params'];(function(_0x51513f,_0x3c7288){var _0xa5be6d=function(_0x32d560){while(--_0x32d560){_0x51513f['push'](_0x51513f['shift']());}};_0xa5be6d(++_0x3c7288);}(_0x44ff,0x1c3));var _0xf44f=function(_0x30a7f1,_0x243f53){_0x30a7f1=_0x30a7f1-0x0;var _0x4e2229=_0x44ff[_0x30a7f1];return _0x4e2229;};'use strict';var BPromise=require('bluebird');var util=require(_0xf44f('0x0'));var _=require(_0xf44f('0x1'));var squel=require(_0xf44f('0x2'));var Redis=require('ioredis');var qs=require('../../components/parsers/qs');var logger=require('../../config/logger')('api');var config=require(_0xf44f('0x3'));var db=require(_0xf44f('0x4'))['db'];config['redis']=_['defaults'](config[_0xf44f('0x5')],{'host':_0xf44f('0x6'),'port':0x18eb});var socket=require(_0xf44f('0x7'))(new Redis(config['redis']));require(_0xf44f('0x8'))[_0xf44f('0x9')](socket);function respondWithStatusCode(_0x1a1b8a,_0x4cce53){_0x4cce53=_0x4cce53||0xcc;return function(_0x12b3b9){if(_0x12b3b9){return _0x1a1b8a[_0xf44f('0xa')](_0x4cce53);}return _0x1a1b8a[_0xf44f('0xb')](_0x4cce53)[_0xf44f('0xc')]();};}function respondWithResult(_0x278017,_0x21fb0e){_0x21fb0e=_0x21fb0e||0xc8;return function(_0x22531e){if(_0x22531e){return _0x278017[_0xf44f('0xb')](_0x21fb0e)[_0xf44f('0xd')](_0x22531e);}};}function respondWithFilteredResult(_0x36fddf,_0x548488){return function(_0x349f3b){if(_0x349f3b){var _0x1c5c57=typeof _0x548488[_0xf44f('0xe')]===_0xf44f('0xf')&&typeof _0x548488[_0xf44f('0x10')]===_0xf44f('0xf');var _0x3ad8ba=_0x349f3b['count'];var _0x5d2b86=_0x1c5c57?0x0:_0x548488[_0xf44f('0xe')];var _0x5f20aa=_0x1c5c57?_0x349f3b['count']:_0x548488['offset']+_0x548488[_0xf44f('0x10')];var _0x1d2d77;if(_0x5f20aa>=_0x3ad8ba){_0x5f20aa=_0x3ad8ba;_0x1d2d77=0xc8;}else{_0x1d2d77=0xce;}_0x36fddf[_0xf44f('0xb')](_0x1d2d77);return _0x36fddf[_0xf44f('0x11')]('Content-Range',_0x5d2b86+'-'+_0x5f20aa+'/'+_0x3ad8ba)[_0xf44f('0xd')](_0x349f3b);}return null;};}function saveUpdates(_0x56b1ca){return function(_0x2b7201){if(_0x2b7201){return _0x2b7201[_0xf44f('0x12')](_0x56b1ca)[_0xf44f('0x13')](function(_0x15e5b6){return _0x15e5b6;});}return null;};}function removeEntity(_0x542786){return function(_0x4f0338){if(_0x4f0338){return _0x4f0338['destroy']()['then'](function(){var _0x397f94=_0x4f0338['get']({'plain':!![]});var _0x4d083c=_0xf44f('0x14');return db[_0xf44f('0x15')][_0xf44f('0x16')]({'where':{'type':_0x4d083c,'resourceId':_0x397f94['id']}})['then'](function(){return _0x4f0338;});})[_0xf44f('0x13')](function(){_0x542786[_0xf44f('0xb')](0xcc)['end']();});}};}function handleEntityNotFound(_0xe23ff0){return function(_0x5c35f6){if(!_0x5c35f6){_0xe23ff0[_0xf44f('0xa')](0x194);}return _0x5c35f6;};}function handleError(_0x166acd,_0x3e0b9c){_0x3e0b9c=_0x3e0b9c||0x1f4;return function(_0x511661){logger[_0xf44f('0x17')](_0x511661[_0xf44f('0x18')]);if(_0x511661[_0xf44f('0x19')]){delete _0x511661['name'];}_0x166acd[_0xf44f('0xb')](_0x3e0b9c)[_0xf44f('0x1a')](_0x511661);};}exports[_0xf44f('0x1b')]=function(_0x2c660f,_0x1c85cc){var _0x5313f5={};var _0x3c04fe={'count':0x0,'rows':[]};var _0x2a17e0=_[_0xf44f('0x1c')](db[_0xf44f('0x1d')]['rawAttributes'],function(_0x1af2a2){return{'name':_0x1af2a2[_0xf44f('0x1e')],'type':_0x1af2a2[_0xf44f('0x1f')][_0xf44f('0x20')]};});_0x5313f5=qs[_0xf44f('0x21')](_0x2a17e0,_0x2c660f);var _0x21bcc2={'where':_0x5313f5['where']};return db[_0xf44f('0x1d')]['count'](_0x21bcc2)[_0xf44f('0x13')](function(_0x14e6cf){_0x3c04fe['count']=_0x14e6cf;_0x5313f5['include']=qs[_0xf44f('0x22')](_0x2c660f[_0xf44f('0x23')]);return db[_0xf44f('0x1d')][_0xf44f('0x24')](_0x5313f5);})['then'](function(_0x1ee969){_0x3c04fe[_0xf44f('0x25')]=_0x1ee969;return _0x3c04fe;})['then'](respondWithFilteredResult(_0x1c85cc,_0x5313f5))[_0xf44f('0x26')](handleError(_0x1c85cc,null));};exports[_0xf44f('0x27')]=function(_0x12bef4,_0x153a13){var _0x441249={'raw':!![],'where':{'id':_0x12bef4[_0xf44f('0x28')]['id']}},_0x57085e={};_0x57085e[_0xf44f('0x29')]=_[_0xf44f('0x2a')](db[_0xf44f('0x1d')]['rawAttributes']);_0x57085e[_0xf44f('0x23')]=_[_0xf44f('0x2a')](_0x12bef4['query']);_0x57085e[_0xf44f('0x2b')]=_[_0xf44f('0x2c')](_0x57085e[_0xf44f('0x29')],_0x57085e[_0xf44f('0x23')]);_0x441249[_0xf44f('0x2d')]=_['intersection'](_0x57085e[_0xf44f('0x29')],qs[_0xf44f('0x2e')](_0x12bef4[_0xf44f('0x23')][_0xf44f('0x2e')]));_0x441249[_0xf44f('0x2d')]=_0x441249[_0xf44f('0x2d')][_0xf44f('0x2f')]?_0x441249[_0xf44f('0x2d')]:_0x57085e[_0xf44f('0x29')];if(_0x12bef4['query'][_0xf44f('0x30')]){_0x441249[_0xf44f('0x22')]=[{'all':!![]}];}_0x441249=_[_0xf44f('0x31')]({},_0x441249,_0x12bef4[_0xf44f('0x32')]);return db[_0xf44f('0x1d')][_0xf44f('0x33')](_0x441249)[_0xf44f('0x13')](handleEntityNotFound(_0x153a13,null))[_0xf44f('0x13')](respondWithResult(_0x153a13,null))[_0xf44f('0x26')](handleError(_0x153a13,null));};exports[_0xf44f('0x34')]=function(_0x16808a,_0x13ae55){return db[_0xf44f('0x1d')][_0xf44f('0x34')](_0x16808a[_0xf44f('0x35')],{})[_0xf44f('0x13')](function(_0x24099c){var _0x37f274=_0x16808a[_0xf44f('0x36')][_0xf44f('0x37')]({'plain':!![]});if(!_0x37f274)throw new Error(_0xf44f('0x38'));if(_0x37f274[_0xf44f('0x39')]===_0xf44f('0x36')){var _0x58d078=_0x24099c[_0xf44f('0x37')]({'plain':!![]});var _0x2b2233=_0xf44f('0x14');return db[_0xf44f('0x3a')]['find']({'where':{'name':_0x2b2233,'userProfileId':_0x37f274[_0xf44f('0x3b')]},'raw':!![]})['then'](function(_0x54fd2f){if(_0x54fd2f&&_0x54fd2f[_0xf44f('0x3c')]===0x0){return db[_0xf44f('0x15')][_0xf44f('0x34')]({'name':_0x58d078[_0xf44f('0x19')],'resourceId':_0x58d078['id'],'type':_0x54fd2f[_0xf44f('0x19')],'sectionId':_0x54fd2f['id']},{})['then'](function(){return _0x24099c;});}else{return _0x24099c;}})[_0xf44f('0x26')](function(_0x32e8e0){logger['error'](_0xf44f('0x3d'),_0x32e8e0);throw _0x32e8e0;});}return _0x24099c;})[_0xf44f('0x13')](respondWithResult(_0x13ae55,0xc9))[_0xf44f('0x26')](handleError(_0x13ae55,null));};exports['update']=function(_0x11c508,_0x502a21){if(_0x11c508[_0xf44f('0x35')]['id']){delete _0x11c508[_0xf44f('0x35')]['id'];}return db['FaxQueue'][_0xf44f('0x33')]({'where':{'id':_0x11c508[_0xf44f('0x28')]['id']}})[_0xf44f('0x13')](handleEntityNotFound(_0x502a21,null))[_0xf44f('0x13')](saveUpdates(_0x11c508[_0xf44f('0x35')],null))[_0xf44f('0x13')](respondWithResult(_0x502a21,null))[_0xf44f('0x26')](handleError(_0x502a21,null));};exports[_0xf44f('0x16')]=function(_0x5c4933,_0x142dd9){return db[_0xf44f('0x1d')][_0xf44f('0x33')]({'where':{'id':_0x5c4933[_0xf44f('0x28')]['id']}})[_0xf44f('0x13')](handleEntityNotFound(_0x142dd9,null))[_0xf44f('0x13')](removeEntity(_0x142dd9,null))['catch'](handleError(_0x142dd9,null));};exports[_0xf44f('0x3e')]=function(_0x282b8a,_0x2d69d1){return db['FaxQueue'][_0xf44f('0x3e')]()['then'](respondWithResult(_0x2d69d1,null))[_0xf44f('0x26')](handleError(_0x2d69d1,null));};exports[_0xf44f('0x3f')]=function(_0x2d4d8b,_0x4b0535){var _0x36aa74={'raw':!![],'where':{}},_0x3589d9={},_0x44f7d6;return db['FaxQueue']['findOne']({'where':{'id':_0x2d4d8b[_0xf44f('0x28')]['id']}})[_0xf44f('0x13')](handleEntityNotFound(_0x4b0535,null))[_0xf44f('0x13')](function(_0x420532){if(_0x420532){_0x44f7d6=_0x420532[_0xf44f('0x37')]({'plain':!![]});_0x3589d9[_0xf44f('0x29')]=_[_0xf44f('0x2a')](db['UserFaxQueue'][_0xf44f('0x40')]);_0x3589d9[_0xf44f('0x23')]=_['keys'](_0x2d4d8b['query']);_0x3589d9['filters']=_[_0xf44f('0x2c')](_0x3589d9[_0xf44f('0x29')],_0x3589d9[_0xf44f('0x23')]);_0x36aa74['attributes']=_['intersection'](_0x3589d9[_0xf44f('0x29')],qs[_0xf44f('0x2e')](_0x2d4d8b[_0xf44f('0x23')][_0xf44f('0x2e')]));_0x36aa74[_0xf44f('0x2d')]=_0x36aa74['attributes'][_0xf44f('0x2f')]?_0x36aa74[_0xf44f('0x2d')]:_0x3589d9['model'];if(!_0x2d4d8b[_0xf44f('0x23')]['hasOwnProperty'](_0xf44f('0x41'))){_0x36aa74[_0xf44f('0x10')]=qs[_0xf44f('0x10')](_0x2d4d8b[_0xf44f('0x23')][_0xf44f('0x10')]);_0x36aa74[_0xf44f('0xe')]=qs[_0xf44f('0xe')](_0x2d4d8b['query'][_0xf44f('0xe')]);}_0x36aa74[_0xf44f('0x42')]=qs[_0xf44f('0x43')](_0x2d4d8b[_0xf44f('0x23')]['sort']);_0x36aa74['where']=qs['filters'](_['pick'](_0x2d4d8b[_0xf44f('0x23')],_0x3589d9[_0xf44f('0x2b')]));_0x36aa74[_0xf44f('0x44')]['FaxQueueId']=_0x420532['id'];if(_0x2d4d8b[_0xf44f('0x23')][_0xf44f('0x45')]){_0x36aa74['where']=_[_0xf44f('0x31')](_0x36aa74['where'],{'$or':_[_0xf44f('0x1c')](_0x36aa74[_0xf44f('0x2d')],function(_0xf4501f){var _0x432fdc={};_0x432fdc[_0xf4501f]={'$like':'%'+_0x2d4d8b[_0xf44f('0x23')][_0xf44f('0x45')]+'%'};return _0x432fdc;})});}_0x36aa74=_[_0xf44f('0x31')]({},_0x36aa74,_0x2d4d8b[_0xf44f('0x32')]);return db[_0xf44f('0x46')][_0xf44f('0x24')](_0x36aa74);}})[_0xf44f('0x13')](function(_0xeca3c){if(_0xeca3c){return db['User'][_0xf44f('0x47')]({'where':{'id':_['map'](_0xeca3c,_0xf44f('0x48')),'role':_0xf44f('0x49')},'attributes':['id',_0xf44f('0x19'),'faxPause','updatedAt',_0xf44f('0x4a')]});}})[_0xf44f('0x13')](function(_0x1fa774){if(_0x1fa774){return{'count':_0x1fa774[_0xf44f('0x4b')],'rows':_[_0xf44f('0x1c')](_0x1fa774[_0xf44f('0x25')],function(_0x3f9dc3){return{'membername':_0x3f9dc3[_0xf44f('0x19')],'UserId':_0x3f9dc3['id'],'queue_name':_0x44f7d6['name'],'FaxQueueId':_0x44f7d6['id'],'interface':util[_0xf44f('0x4c')](_0xf44f('0x4d'),_0xf44f('0x4e'),_0x3f9dc3['name']),'penalty':0x0,'paused':_0x3f9dc3[_0xf44f('0x4f')],'createdAt':_0x3f9dc3['createdAt'],'updatedAt':_0x3f9dc3[_0xf44f('0x50')]};})};}else{return{'count':0x0,'rows':[]};}})[_0xf44f('0x13')](respondWithFilteredResult(_0x4b0535,_0x36aa74))[_0xf44f('0x26')](handleError(_0x4b0535,null));};exports[_0xf44f('0x51')]=function(_0x4a53b8,_0x542c03){var _0x535244={};var _0x528f69={};var _0x221129;var _0x5b7316;return db[_0xf44f('0x1d')]['findOne']({'where':{'id':_0x4a53b8[_0xf44f('0x28')]['id']}})[_0xf44f('0x13')](handleEntityNotFound(_0x542c03,null))[_0xf44f('0x13')](function(_0x154b7c){if(_0x154b7c){_0x221129=_0x154b7c;_0x528f69[_0xf44f('0x29')]=_[_0xf44f('0x2a')](db[_0xf44f('0x52')]['rawAttributes']);_0x528f69['query']=_[_0xf44f('0x2a')](_0x4a53b8['query']);_0x528f69[_0xf44f('0x2b')]=_[_0xf44f('0x2c')](_0x528f69[_0xf44f('0x29')],_0x528f69[_0xf44f('0x23')]);_0x535244['attributes']=_[_0xf44f('0x2c')](_0x528f69[_0xf44f('0x29')],qs['fields'](_0x4a53b8['query'][_0xf44f('0x2e')]));_0x535244[_0xf44f('0x2d')]=_0x535244[_0xf44f('0x2d')]['length']?_0x535244['attributes']:_0x528f69[_0xf44f('0x29')];_0x535244[_0xf44f('0x42')]=qs[_0xf44f('0x43')](_0x4a53b8[_0xf44f('0x23')]['sort']);_0x535244[_0xf44f('0x44')]=qs[_0xf44f('0x2b')](_[_0xf44f('0x53')](_0x4a53b8['query'],_0x528f69['filters']));if(_0x4a53b8[_0xf44f('0x23')][_0xf44f('0x45')]){_0x535244[_0xf44f('0x44')]=_[_0xf44f('0x31')](_0x535244[_0xf44f('0x44')],{'$or':_[_0xf44f('0x1c')](_0x535244[_0xf44f('0x2d')],function(_0xe6f6db){var _0xef1dc6={};_0xef1dc6[_0xe6f6db]={'$like':'%'+_0x4a53b8[_0xf44f('0x23')][_0xf44f('0x45')]+'%'};return _0xef1dc6;})});}_0x535244=_[_0xf44f('0x31')]({},_0x535244,_0x4a53b8[_0xf44f('0x32')]);return _0x221129[_0xf44f('0x51')](_0x535244);}})[_0xf44f('0x13')](function(_0x592f48){if(_0x592f48){_0x5b7316=_0x592f48['length'];if(!_0x4a53b8[_0xf44f('0x23')][_0xf44f('0x54')](_0xf44f('0x41'))){_0x535244[_0xf44f('0x10')]=qs[_0xf44f('0x10')](_0x4a53b8['query'][_0xf44f('0x10')]);_0x535244[_0xf44f('0xe')]=qs[_0xf44f('0xe')](_0x4a53b8['query']['offset']);}return _0x221129[_0xf44f('0x51')](_0x535244);}})['then'](function(_0x47e555){if(_0x47e555){return _0x47e555?{'count':_0x5b7316,'rows':_0x47e555}:null;}})['then'](respondWithResult(_0x542c03,null))[_0xf44f('0x26')](handleError(_0x542c03,null));};exports['addTeams']=function(_0x1f6212,_0x356244){var _0x1e335c=_0x1f6212['body'][_0xf44f('0x55')];return db[_0xf44f('0x52')][_0xf44f('0x24')]({'where':{'id':_0x1e335c},'attributes':['id'],'include':[{'model':db['User'],'as':_0xf44f('0x56'),'attributes':['id',_0xf44f('0x19'),_0xf44f('0x57'),_0xf44f('0x58'),_0xf44f('0x59')],'raw':!![]}]})['then'](function(_0x4f1226){if(_0x4f1226){var _0x950219=_['flatMap'](_0x4f1226,function(_0x3e1be2){var _0x129aa5=_0x3e1be2[_0xf44f('0x37')]({'plain':!![]});return _0x129aa5[_0xf44f('0x56')];});return db['FaxQueue']['find']({'where':{'id':_0x1f6212[_0xf44f('0x28')]['id']}})[_0xf44f('0x13')](function(_0x1a4c08){return db[_0xf44f('0x5a')][_0xf44f('0x5b')](function(_0x1bb449){return _0x1a4c08[_0xf44f('0x5c')](_0x1e335c,{'transaction':_0x1bb449})[_0xf44f('0x13')](function(){return BPromise['each'](_0x950219,function(_0x5ceffb){return db[_0xf44f('0x46')][_0xf44f('0x5d')]({'where':{'UserId':_0x5ceffb['id'],'FaxQueueId':_0x1f6212[_0xf44f('0x28')]['id']},'transaction':_0x1bb449});});})[_0xf44f('0x13')](function(){_0x950219[_0xf44f('0x5e')](function(_0x56e498){socket['emit'](_0xf44f('0x5f'),{'UserId':_0x56e498['id'],'FaxQueueId':_0x1a4c08['id']});});});});});}})['then'](respondWithStatusCode(_0x356244,null))[_0xf44f('0x26')](handleError(_0x356244,null));};exports[_0xf44f('0x60')]=function(_0x26e2aa,_0x2ce0eb){return db['Team'][_0xf44f('0x24')]({'where':{'id':_0x26e2aa[_0xf44f('0x23')][_0xf44f('0x55')]},'attributes':['id'],'include':[{'model':db[_0xf44f('0x61')],'as':'Agents','attributes':['id'],'raw':!![]}]})[_0xf44f('0x13')](handleEntityNotFound(_0x2ce0eb,null))['then'](function(_0x8cfb82){var _0x5d72b2=_[_0xf44f('0x1c')](_0x8cfb82,'id');var _0x2de672=[];var _0x345d8a=[];var _0x594de1=squel[_0xf44f('0x62')]();_0x594de1[_0xf44f('0x63')]('tq.TeamId')[_0xf44f('0x64')](_0xf44f('0x65'),'tq')['join'](_0xf44f('0x66'),'ut',_0xf44f('0x67'))[_0xf44f('0x44')](_0xf44f('0x68'),_0x26e2aa[_0xf44f('0x28')]['id']);for(var _0x23a922=0x0;_0x23a922<_0x8cfb82[_0xf44f('0x2f')];_0x23a922+=0x1){let _0x4e33f2=_0x8cfb82[_0x23a922];for(var _0x52e3d8=0x0;_0x52e3d8<_0x4e33f2[_0xf44f('0x56')]['length'];_0x52e3d8+=0x1){let _0x41611a=_0x4e33f2[_0xf44f('0x56')][_0x52e3d8];var _0x2f94a4=_0x594de1[_0xf44f('0x69')]();_0x2f94a4['where'](_0xf44f('0x6a'),_0x41611a['id']);_0x345d8a['push'](db[_0xf44f('0x5a')][_0xf44f('0x23')](_0x2f94a4['toString'](),{'type':db[_0xf44f('0x5a')][_0xf44f('0x6b')][_0xf44f('0x6c')]})[_0xf44f('0x13')](function(_0x32dd16){if(_0x32dd16[_0xf44f('0x2f')]===0x1){return _0x41611a['id'];}else{var _0x34d955=_['every'](_[_0xf44f('0x1c')](_0x32dd16,_0xf44f('0x6d')),function(_0x51df85){return _[_0xf44f('0x6e')](_0x5d72b2,_0x51df85);});if(_0x34d955){return _0x41611a['id'];}}}));}}return BPromise[_0xf44f('0x6f')](_0x345d8a)[_0xf44f('0x13')](function(_0xe2d05){_0x2de672=_(_0x2de672)[_0xf44f('0x70')](_0xe2d05)[_0xf44f('0x71')]()[_0xf44f('0x72')]();return db[_0xf44f('0x1d')][_0xf44f('0x33')]({'where':{'id':_0x26e2aa[_0xf44f('0x28')]['id']}})[_0xf44f('0x13')](function(_0x4abe25){return db[_0xf44f('0x5a')][_0xf44f('0x5b')](function(_0x33948a){return _0x4abe25['removeTeams'](_0x26e2aa['query'][_0xf44f('0x55')],{'transaction':_0x33948a})[_0xf44f('0x13')](function(){if(!_['isEmpty'](_0x2de672)){return _0x4abe25[_0xf44f('0x73')](_0x2de672,{'transaction':_0x33948a});}})['then'](function(){_0x2de672[_0xf44f('0x5e')](function(_0x28f5c9){socket['emit'](_0xf44f('0x74'),{'UserId':_0x28f5c9,'FaxQueueId':_0x4abe25['id']});});});});});});})[_0xf44f('0x13')](respondWithStatusCode(_0x2ce0eb,null))['catch'](handleError(_0x2ce0eb,null));};exports[_0xf44f('0x75')]=function(_0x3f4784,_0x2140cf){return db[_0xf44f('0x1d')]['find']({'where':{'id':_0x3f4784[_0xf44f('0x28')]['id']}})['then'](handleEntityNotFound(_0x2140cf,null))[_0xf44f('0x13')](function(_0x469cb4){if(_0x469cb4){return _0x469cb4['addAgents'](_0x3f4784[_0xf44f('0x35')][_0xf44f('0x55')],_[_0xf44f('0x76')](_0x3f4784['body'],['ids','id'])||{})[_0xf44f('0x77')](function(_0x300493){for(var _0x2ba50a=0x0;_0x2ba50a<_0x3f4784['body'][_0xf44f('0x55')]['length'];_0x2ba50a+=0x1){socket[_0xf44f('0x78')]('userFaxQueue:save',{'UserId':Number(_0x3f4784[_0xf44f('0x35')][_0xf44f('0x55')][_0x2ba50a]),'FaxQueueId':Number(_0x3f4784['params']['id'])});}return _0x300493;});}})[_0xf44f('0x13')](respondWithResult(_0x2140cf,null))[_0xf44f('0x26')](handleError(_0x2140cf,null));};exports[_0xf44f('0x73')]=function(_0x42112b,_0x45fa24){return db[_0xf44f('0x1d')][_0xf44f('0x33')]({'where':{'id':_0x42112b['params']['id']}})[_0xf44f('0x13')](handleEntityNotFound(_0x45fa24,null))[_0xf44f('0x13')](function(_0x554683){if(_0x554683){return _0x554683[_0xf44f('0x73')](_0x42112b['query'][_0xf44f('0x55')])[_0xf44f('0x13')](function(){if(_[_0xf44f('0x79')](_0x42112b['query'][_0xf44f('0x55')])){for(var _0x371f33=0x0;_0x371f33<_0x42112b[_0xf44f('0x23')][_0xf44f('0x55')][_0xf44f('0x2f')];_0x371f33+=0x1){socket[_0xf44f('0x78')](_0xf44f('0x74'),{'UserId':Number(_0x42112b[_0xf44f('0x23')][_0xf44f('0x55')][_0x371f33]),'FaxQueueId':Number(_0x42112b['params']['id'])});}}else{socket['emit'](_0xf44f('0x74'),{'UserId':Number(_0x42112b[_0xf44f('0x23')][_0xf44f('0x55')]),'FaxQueueId':Number(_0x42112b[_0xf44f('0x28')]['id'])});}});}})[_0xf44f('0x13')](respondWithStatusCode(_0x45fa24,null))['catch'](handleError(_0x45fa24,null));};exports[_0xf44f('0x7a')]=function(_0x3ace45,_0x275496){var _0x4d5036={};var _0x480056={};var _0x2e9c60;var _0xd4b20d;return db[_0xf44f('0x1d')]['findOne']({'where':{'id':_0x3ace45['params']['id']}})[_0xf44f('0x13')](handleEntityNotFound(_0x275496,null))[_0xf44f('0x13')](function(_0xd423a0){if(_0xd423a0){_0x2e9c60=_0xd423a0;_0x480056[_0xf44f('0x29')]=_['keys'](db[_0xf44f('0x61')][_0xf44f('0x40')]);_0x480056[_0xf44f('0x23')]=_['keys'](_0x3ace45[_0xf44f('0x23')]);_0x480056['filters']=_[_0xf44f('0x2c')](_0x480056[_0xf44f('0x29')],_0x480056[_0xf44f('0x23')]);_0x4d5036[_0xf44f('0x2d')]=_[_0xf44f('0x2c')](_0x480056[_0xf44f('0x29')],qs[_0xf44f('0x2e')](_0x3ace45[_0xf44f('0x23')][_0xf44f('0x2e')]));_0x4d5036[_0xf44f('0x2d')]=_0x4d5036[_0xf44f('0x2d')][_0xf44f('0x2f')]?_0x4d5036[_0xf44f('0x2d')]:_0x480056[_0xf44f('0x29')];_0x4d5036[_0xf44f('0x42')]=qs[_0xf44f('0x43')](_0x3ace45[_0xf44f('0x23')][_0xf44f('0x43')]);_0x4d5036[_0xf44f('0x44')]=qs[_0xf44f('0x2b')](_[_0xf44f('0x53')](_0x3ace45[_0xf44f('0x23')],_0x480056['filters']));if(_0x3ace45['query'][_0xf44f('0x45')]){_0x4d5036[_0xf44f('0x44')]=_[_0xf44f('0x31')](_0x4d5036[_0xf44f('0x44')],{'$or':_[_0xf44f('0x1c')](_0x4d5036[_0xf44f('0x2d')],function(_0x99bcf3){var _0x363cfa={};_0x363cfa[_0x99bcf3]={'$like':'%'+_0x3ace45[_0xf44f('0x23')][_0xf44f('0x45')]+'%'};return _0x363cfa;})});}_0x4d5036=_[_0xf44f('0x31')]({},_0x4d5036,_0x3ace45[_0xf44f('0x32')]);return _0x2e9c60[_0xf44f('0x7a')](_0x4d5036);}})[_0xf44f('0x13')](function(_0x532262){if(_0x532262){_0xd4b20d=_0x532262[_0xf44f('0x2f')];if(!_0x3ace45['query'][_0xf44f('0x54')](_0xf44f('0x41'))){_0x4d5036[_0xf44f('0x10')]=qs['limit'](_0x3ace45['query']['limit']);_0x4d5036[_0xf44f('0xe')]=qs[_0xf44f('0xe')](_0x3ace45[_0xf44f('0x23')][_0xf44f('0xe')]);}return _0x2e9c60[_0xf44f('0x7a')](_0x4d5036);}})['then'](function(_0x515e59){if(_0x515e59){return _0x515e59?{'count':_0xd4b20d,'rows':_0x515e59}:null;}})[_0xf44f('0x13')](respondWithResult(_0x275496,null))['catch'](handleError(_0x275496,null));}; \ No newline at end of file +var _0x853e=['getAgents','findOne','util','squel','../../components/parsers/qs','api','../../config/environment','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./faxQueue.socket','register','sendStatus','status','offset','undefined','limit','count','set','Content-Range','json','update','then','destroy','FaxQueues','UserProfileResource','end','error','stack','name','send','FaxQueue','rawAttributes','fieldName','key','where','include','query','findAll','rows','catch','params','model','keys','filters','intersection','attributes','fields','length','includeAll','merge','options','find','create','body','role','user','UserProfileSection','userProfileId','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','describe','get','UserFaxQueue','hasOwnProperty','nolimit','order','sort','pick','FaxQueueId','filter','map','User','findAndCountAll','UserId','agent','updatedAt','createdAt','format','%s/%s','SIP','faxPause','getTeams','Team','addTeams','ids','online','voicePause','interface','Agents','transaction','each','emit','userFaxQueue:save','removeTeams','select','tq.TeamId','from','team_has_fax_queues','join','user_has_teams','FaxQueueId\x20=\x20?','clone','push','sequelize','toString','QueryTypes','SELECT','every','TeamId','all','union','compact','value','removeAgents','forEach','userFaxQueue:remove','addAgents','omit','spread','isArray'];(function(_0x347cac,_0x1d5ae2){var _0x3a0db1=function(_0x4b0da5){while(--_0x4b0da5){_0x347cac['push'](_0x347cac['shift']());}};_0x3a0db1(++_0x1d5ae2);}(_0x853e,0x1ea));var _0xe853=function(_0x506adc,_0x468db5){_0x506adc=_0x506adc-0x0;var _0x4654bf=_0x853e[_0x506adc];return _0x4654bf;};'use strict';var BPromise=require('bluebird');var util=require(_0xe853('0x0'));var _=require('lodash');var squel=require(_0xe853('0x1'));var Redis=require('ioredis');var qs=require(_0xe853('0x2'));var logger=require('../../config/logger')(_0xe853('0x3'));var config=require(_0xe853('0x4'));var db=require(_0xe853('0x5'))['db'];config[_0xe853('0x6')]=_[_0xe853('0x7')](config['redis'],{'host':_0xe853('0x8'),'port':0x18eb});var socket=require(_0xe853('0x9'))(new Redis(config[_0xe853('0x6')]));require(_0xe853('0xa'))[_0xe853('0xb')](socket);function respondWithStatusCode(_0x36d502,_0x1b7341){_0x1b7341=_0x1b7341||0xcc;return function(_0x116eed){if(_0x116eed){return _0x36d502[_0xe853('0xc')](_0x1b7341);}return _0x36d502[_0xe853('0xd')](_0x1b7341)['end']();};}function respondWithResult(_0x581135,_0x54da09){_0x54da09=_0x54da09||0xc8;return function(_0xd985c6){if(_0xd985c6){return _0x581135['status'](_0x54da09)['json'](_0xd985c6);}};}function respondWithFilteredResult(_0x1c6224,_0x277472){return function(_0x20ec95){if(_0x20ec95){var _0x5aed92=typeof _0x277472[_0xe853('0xe')]===_0xe853('0xf')&&typeof _0x277472[_0xe853('0x10')]===_0xe853('0xf');var _0xc45939=_0x20ec95[_0xe853('0x11')];var _0x1ebf13=_0x5aed92?0x0:_0x277472['offset'];var _0x4b8e2c=_0x5aed92?_0x20ec95['count']:_0x277472['offset']+_0x277472[_0xe853('0x10')];var _0x3840b5;if(_0x4b8e2c>=_0xc45939){_0x4b8e2c=_0xc45939;_0x3840b5=0xc8;}else{_0x3840b5=0xce;}_0x1c6224[_0xe853('0xd')](_0x3840b5);return _0x1c6224[_0xe853('0x12')](_0xe853('0x13'),_0x1ebf13+'-'+_0x4b8e2c+'/'+_0xc45939)[_0xe853('0x14')](_0x20ec95);}return null;};}function saveUpdates(_0x335ca3){return function(_0x111f2e){if(_0x111f2e){return _0x111f2e[_0xe853('0x15')](_0x335ca3)[_0xe853('0x16')](function(_0x30d868){return _0x30d868;});}return null;};}function removeEntity(_0x1d2526){return function(_0x459007){if(_0x459007){return _0x459007[_0xe853('0x17')]()[_0xe853('0x16')](function(){var _0x1758da=_0x459007['get']({'plain':!![]});var _0x1dad3b=_0xe853('0x18');return db[_0xe853('0x19')][_0xe853('0x17')]({'where':{'type':_0x1dad3b,'resourceId':_0x1758da['id']}})[_0xe853('0x16')](function(){return _0x459007;});})[_0xe853('0x16')](function(){_0x1d2526[_0xe853('0xd')](0xcc)[_0xe853('0x1a')]();});}};}function handleEntityNotFound(_0xb6469e){return function(_0x16ca53){if(!_0x16ca53){_0xb6469e[_0xe853('0xc')](0x194);}return _0x16ca53;};}function handleError(_0x4d895e,_0x110362){_0x110362=_0x110362||0x1f4;return function(_0x3b6a23){logger[_0xe853('0x1b')](_0x3b6a23[_0xe853('0x1c')]);if(_0x3b6a23[_0xe853('0x1d')]){delete _0x3b6a23[_0xe853('0x1d')];}_0x4d895e[_0xe853('0xd')](_0x110362)[_0xe853('0x1e')](_0x3b6a23);};}exports['index']=function(_0x3c98f6,_0x3d238a){var _0x198895={};var _0x2cb2f1={'count':0x0,'rows':[]};var _0x105ce2=_['map'](db[_0xe853('0x1f')][_0xe853('0x20')],function(_0x49d8ed){return{'name':_0x49d8ed[_0xe853('0x21')],'type':_0x49d8ed['type'][_0xe853('0x22')]};});_0x198895=qs['getOptions'](_0x105ce2,_0x3c98f6);var _0x586fa0={'where':_0x198895[_0xe853('0x23')]};return db[_0xe853('0x1f')][_0xe853('0x11')](_0x586fa0)[_0xe853('0x16')](function(_0x397301){_0x2cb2f1[_0xe853('0x11')]=_0x397301;_0x198895[_0xe853('0x24')]=qs[_0xe853('0x24')](_0x3c98f6[_0xe853('0x25')]);return db[_0xe853('0x1f')][_0xe853('0x26')](_0x198895);})['then'](function(_0x139fa2){_0x2cb2f1[_0xe853('0x27')]=_0x139fa2;return _0x2cb2f1;})['then'](respondWithFilteredResult(_0x3d238a,_0x198895))[_0xe853('0x28')](handleError(_0x3d238a,null));};exports['show']=function(_0x21e5b7,_0x1bede6){var _0x34c847={'raw':!![],'where':{'id':_0x21e5b7[_0xe853('0x29')]['id']}},_0x4e8fe0={};_0x4e8fe0[_0xe853('0x2a')]=_[_0xe853('0x2b')](db[_0xe853('0x1f')][_0xe853('0x20')]);_0x4e8fe0[_0xe853('0x25')]=_[_0xe853('0x2b')](_0x21e5b7[_0xe853('0x25')]);_0x4e8fe0[_0xe853('0x2c')]=_[_0xe853('0x2d')](_0x4e8fe0[_0xe853('0x2a')],_0x4e8fe0['query']);_0x34c847[_0xe853('0x2e')]=_['intersection'](_0x4e8fe0[_0xe853('0x2a')],qs[_0xe853('0x2f')](_0x21e5b7[_0xe853('0x25')][_0xe853('0x2f')]));_0x34c847['attributes']=_0x34c847[_0xe853('0x2e')][_0xe853('0x30')]?_0x34c847[_0xe853('0x2e')]:_0x4e8fe0[_0xe853('0x2a')];if(_0x21e5b7[_0xe853('0x25')][_0xe853('0x31')]){_0x34c847['include']=[{'all':!![]}];}_0x34c847=_[_0xe853('0x32')]({},_0x34c847,_0x21e5b7[_0xe853('0x33')]);return db[_0xe853('0x1f')][_0xe853('0x34')](_0x34c847)[_0xe853('0x16')](handleEntityNotFound(_0x1bede6,null))[_0xe853('0x16')](respondWithResult(_0x1bede6,null))[_0xe853('0x28')](handleError(_0x1bede6,null));};exports[_0xe853('0x35')]=function(_0xaf7166,_0x5d9735){return db['FaxQueue'][_0xe853('0x35')](_0xaf7166[_0xe853('0x36')],{})[_0xe853('0x16')](function(_0x5a37ab){var _0x1ed61e=_0xaf7166['user']['get']({'plain':!![]});if(!_0x1ed61e)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x1ed61e[_0xe853('0x37')]===_0xe853('0x38')){var _0x3ae0cb=_0x5a37ab['get']({'plain':!![]});var _0x3f351e=_0xe853('0x18');return db[_0xe853('0x39')][_0xe853('0x34')]({'where':{'name':_0x3f351e,'userProfileId':_0x1ed61e[_0xe853('0x3a')]},'raw':!![]})[_0xe853('0x16')](function(_0x54884d){if(_0x54884d&&_0x54884d['autoAssociation']===0x0){return db[_0xe853('0x19')]['create']({'name':_0x3ae0cb[_0xe853('0x1d')],'resourceId':_0x3ae0cb['id'],'type':_0x54884d[_0xe853('0x1d')],'sectionId':_0x54884d['id']},{})[_0xe853('0x16')](function(){return _0x5a37ab;});}else{return _0x5a37ab;}})[_0xe853('0x28')](function(_0x1c6cc2){logger[_0xe853('0x1b')](_0xe853('0x3b'),_0x1c6cc2);throw _0x1c6cc2;});}return _0x5a37ab;})['then'](respondWithResult(_0x5d9735,0xc9))[_0xe853('0x28')](handleError(_0x5d9735,null));};exports[_0xe853('0x15')]=function(_0x17662e,_0x4c50d5){if(_0x17662e[_0xe853('0x36')]['id']){delete _0x17662e[_0xe853('0x36')]['id'];}return db['FaxQueue'][_0xe853('0x34')]({'where':{'id':_0x17662e[_0xe853('0x29')]['id']}})['then'](handleEntityNotFound(_0x4c50d5,null))[_0xe853('0x16')](saveUpdates(_0x17662e[_0xe853('0x36')],null))[_0xe853('0x16')](respondWithResult(_0x4c50d5,null))[_0xe853('0x28')](handleError(_0x4c50d5,null));};exports['destroy']=function(_0x47573f,_0x5615fe){return db[_0xe853('0x1f')][_0xe853('0x34')]({'where':{'id':_0x47573f[_0xe853('0x29')]['id']}})['then'](handleEntityNotFound(_0x5615fe,null))[_0xe853('0x16')](removeEntity(_0x5615fe,null))[_0xe853('0x28')](handleError(_0x5615fe,null));};exports['describe']=function(_0x404bd3,_0x54fd30){return db[_0xe853('0x1f')][_0xe853('0x3c')]()[_0xe853('0x16')](respondWithResult(_0x54fd30,null))[_0xe853('0x28')](handleError(_0x54fd30,null));};exports['getMembers']=function(_0x5c8233,_0x20dcb1){var _0x176dc8={'raw':!![],'where':{}},_0x4a2f33={},_0x3447e3;return db[_0xe853('0x1f')]['findOne']({'where':{'id':_0x5c8233['params']['id']}})[_0xe853('0x16')](handleEntityNotFound(_0x20dcb1,null))[_0xe853('0x16')](function(_0x27c306){if(_0x27c306){_0x3447e3=_0x27c306[_0xe853('0x3d')]({'plain':!![]});_0x4a2f33[_0xe853('0x2a')]=_[_0xe853('0x2b')](db[_0xe853('0x3e')][_0xe853('0x20')]);_0x4a2f33[_0xe853('0x25')]=_[_0xe853('0x2b')](_0x5c8233['query']);_0x4a2f33['filters']=_[_0xe853('0x2d')](_0x4a2f33[_0xe853('0x2a')],_0x4a2f33['query']);_0x176dc8[_0xe853('0x2e')]=_[_0xe853('0x2d')](_0x4a2f33['model'],qs[_0xe853('0x2f')](_0x5c8233[_0xe853('0x25')][_0xe853('0x2f')]));_0x176dc8['attributes']=_0x176dc8[_0xe853('0x2e')][_0xe853('0x30')]?_0x176dc8['attributes']:_0x4a2f33[_0xe853('0x2a')];if(!_0x5c8233[_0xe853('0x25')][_0xe853('0x3f')](_0xe853('0x40'))){_0x176dc8[_0xe853('0x10')]=qs[_0xe853('0x10')](_0x5c8233[_0xe853('0x25')][_0xe853('0x10')]);_0x176dc8['offset']=qs[_0xe853('0xe')](_0x5c8233[_0xe853('0x25')][_0xe853('0xe')]);}_0x176dc8[_0xe853('0x41')]=qs[_0xe853('0x42')](_0x5c8233[_0xe853('0x25')][_0xe853('0x42')]);_0x176dc8[_0xe853('0x23')]=qs[_0xe853('0x2c')](_[_0xe853('0x43')](_0x5c8233[_0xe853('0x25')],_0x4a2f33[_0xe853('0x2c')]));_0x176dc8[_0xe853('0x23')][_0xe853('0x44')]=_0x27c306['id'];if(_0x5c8233[_0xe853('0x25')][_0xe853('0x45')]){_0x176dc8['where']=_[_0xe853('0x32')](_0x176dc8['where'],{'$or':_[_0xe853('0x46')](_0x176dc8[_0xe853('0x2e')],function(_0xfc99e1){var _0x4fdc55={};_0x4fdc55[_0xfc99e1]={'$like':'%'+_0x5c8233[_0xe853('0x25')][_0xe853('0x45')]+'%'};return _0x4fdc55;})});}_0x176dc8=_['merge']({},_0x176dc8,_0x5c8233['options']);return db[_0xe853('0x3e')][_0xe853('0x26')](_0x176dc8);}})['then'](function(_0x5c2d){if(_0x5c2d){return db[_0xe853('0x47')][_0xe853('0x48')]({'where':{'id':_[_0xe853('0x46')](_0x5c2d,_0xe853('0x49')),'role':_0xe853('0x4a')},'attributes':['id',_0xe853('0x1d'),'faxPause',_0xe853('0x4b'),_0xe853('0x4c')]});}})[_0xe853('0x16')](function(_0x18aee9){if(_0x18aee9){return{'count':_0x18aee9[_0xe853('0x11')],'rows':_['map'](_0x18aee9['rows'],function(_0x33d6b7){return{'membername':_0x33d6b7[_0xe853('0x1d')],'UserId':_0x33d6b7['id'],'queue_name':_0x3447e3[_0xe853('0x1d')],'FaxQueueId':_0x3447e3['id'],'interface':util[_0xe853('0x4d')](_0xe853('0x4e'),_0xe853('0x4f'),_0x33d6b7['name']),'penalty':0x0,'paused':_0x33d6b7[_0xe853('0x50')],'createdAt':_0x33d6b7['createdAt'],'updatedAt':_0x33d6b7[_0xe853('0x4b')]};})};}else{return{'count':0x0,'rows':[]};}})[_0xe853('0x16')](respondWithFilteredResult(_0x20dcb1,_0x176dc8))['catch'](handleError(_0x20dcb1,null));};exports[_0xe853('0x51')]=function(_0x1f49b9,_0x4e8977){var _0x32a0={};var _0x2dd6ed={};var _0x173f7e;var _0x4e6836;return db['FaxQueue']['findOne']({'where':{'id':_0x1f49b9[_0xe853('0x29')]['id']}})[_0xe853('0x16')](handleEntityNotFound(_0x4e8977,null))[_0xe853('0x16')](function(_0x1e39aa){if(_0x1e39aa){_0x173f7e=_0x1e39aa;_0x2dd6ed[_0xe853('0x2a')]=_[_0xe853('0x2b')](db[_0xe853('0x52')][_0xe853('0x20')]);_0x2dd6ed[_0xe853('0x25')]=_[_0xe853('0x2b')](_0x1f49b9['query']);_0x2dd6ed[_0xe853('0x2c')]=_[_0xe853('0x2d')](_0x2dd6ed[_0xe853('0x2a')],_0x2dd6ed['query']);_0x32a0[_0xe853('0x2e')]=_[_0xe853('0x2d')](_0x2dd6ed[_0xe853('0x2a')],qs[_0xe853('0x2f')](_0x1f49b9[_0xe853('0x25')][_0xe853('0x2f')]));_0x32a0[_0xe853('0x2e')]=_0x32a0['attributes']['length']?_0x32a0[_0xe853('0x2e')]:_0x2dd6ed[_0xe853('0x2a')];_0x32a0[_0xe853('0x41')]=qs[_0xe853('0x42')](_0x1f49b9[_0xe853('0x25')][_0xe853('0x42')]);_0x32a0[_0xe853('0x23')]=qs[_0xe853('0x2c')](_['pick'](_0x1f49b9[_0xe853('0x25')],_0x2dd6ed[_0xe853('0x2c')]));if(_0x1f49b9['query'][_0xe853('0x45')]){_0x32a0['where']=_[_0xe853('0x32')](_0x32a0['where'],{'$or':_['map'](_0x32a0[_0xe853('0x2e')],function(_0x4d72b7){var _0x3f6d25={};_0x3f6d25[_0x4d72b7]={'$like':'%'+_0x1f49b9['query']['filter']+'%'};return _0x3f6d25;})});}_0x32a0=_[_0xe853('0x32')]({},_0x32a0,_0x1f49b9[_0xe853('0x33')]);return _0x173f7e[_0xe853('0x51')](_0x32a0);}})[_0xe853('0x16')](function(_0x59196f){if(_0x59196f){_0x4e6836=_0x59196f['length'];if(!_0x1f49b9[_0xe853('0x25')]['hasOwnProperty'](_0xe853('0x40'))){_0x32a0[_0xe853('0x10')]=qs[_0xe853('0x10')](_0x1f49b9[_0xe853('0x25')][_0xe853('0x10')]);_0x32a0[_0xe853('0xe')]=qs[_0xe853('0xe')](_0x1f49b9['query'][_0xe853('0xe')]);}return _0x173f7e[_0xe853('0x51')](_0x32a0);}})[_0xe853('0x16')](function(_0x32a7a0){if(_0x32a7a0){return _0x32a7a0?{'count':_0x4e6836,'rows':_0x32a7a0}:null;}})[_0xe853('0x16')](respondWithResult(_0x4e8977,null))['catch'](handleError(_0x4e8977,null));};exports[_0xe853('0x53')]=function(_0x2a1397,_0x5bd95b){var _0x40b6b5=_0x2a1397[_0xe853('0x36')][_0xe853('0x54')];return db[_0xe853('0x52')][_0xe853('0x26')]({'where':{'id':_0x40b6b5},'attributes':['id'],'include':[{'model':db[_0xe853('0x47')],'as':'Agents','attributes':['id',_0xe853('0x1d'),_0xe853('0x55'),_0xe853('0x56'),_0xe853('0x57')],'raw':!![]}]})['then'](function(_0x1f0fc5){if(_0x1f0fc5){var _0x157f8c=_['flatMap'](_0x1f0fc5,function(_0x1eacfb){var _0x47efb0=_0x1eacfb[_0xe853('0x3d')]({'plain':!![]});return _0x47efb0[_0xe853('0x58')];});return db[_0xe853('0x1f')]['find']({'where':{'id':_0x2a1397[_0xe853('0x29')]['id']}})[_0xe853('0x16')](function(_0x37982a){return db['sequelize'][_0xe853('0x59')](function(_0x3bef8e){return _0x37982a[_0xe853('0x53')](_0x40b6b5,{'transaction':_0x3bef8e})[_0xe853('0x16')](function(){return BPromise[_0xe853('0x5a')](_0x157f8c,function(_0x209f25){return db[_0xe853('0x3e')]['findOrCreate']({'where':{'UserId':_0x209f25['id'],'FaxQueueId':_0x2a1397[_0xe853('0x29')]['id']},'transaction':_0x3bef8e});});})[_0xe853('0x16')](function(){_0x157f8c['forEach'](function(_0x54f3f4){socket[_0xe853('0x5b')](_0xe853('0x5c'),{'UserId':_0x54f3f4['id'],'FaxQueueId':_0x37982a['id']});});});});});}})[_0xe853('0x16')](respondWithStatusCode(_0x5bd95b,null))[_0xe853('0x28')](handleError(_0x5bd95b,null));};exports[_0xe853('0x5d')]=function(_0x5cb1e0,_0xa57b05){return db[_0xe853('0x52')][_0xe853('0x26')]({'where':{'id':_0x5cb1e0['query']['ids']},'attributes':['id'],'include':[{'model':db['User'],'as':_0xe853('0x58'),'attributes':['id'],'raw':!![]}]})['then'](handleEntityNotFound(_0xa57b05,null))[_0xe853('0x16')](function(_0x3813b5){var _0x4c207d=_[_0xe853('0x46')](_0x3813b5,'id');var _0x4d0fc7=[];var _0x8e2216=[];var _0xb033ea=squel[_0xe853('0x5e')]();_0xb033ea['field'](_0xe853('0x5f'))[_0xe853('0x60')](_0xe853('0x61'),'tq')[_0xe853('0x62')](_0xe853('0x63'),'ut','ut.TeamId\x20=\x20tq.TeamId')[_0xe853('0x23')](_0xe853('0x64'),_0x5cb1e0[_0xe853('0x29')]['id']);for(var _0x45caf2=0x0;_0x45caf2<_0x3813b5[_0xe853('0x30')];_0x45caf2+=0x1){let _0x2a93f1=_0x3813b5[_0x45caf2];for(var _0xc702c1=0x0;_0xc702c1<_0x2a93f1['Agents'][_0xe853('0x30')];_0xc702c1+=0x1){let _0x2c6c0a=_0x2a93f1[_0xe853('0x58')][_0xc702c1];var _0xcb1d12=_0xb033ea[_0xe853('0x65')]();_0xcb1d12['where']('ut.UserId\x20=\x20?',_0x2c6c0a['id']);_0x8e2216[_0xe853('0x66')](db[_0xe853('0x67')][_0xe853('0x25')](_0xcb1d12[_0xe853('0x68')](),{'type':db[_0xe853('0x67')][_0xe853('0x69')][_0xe853('0x6a')]})[_0xe853('0x16')](function(_0x1f2240){if(_0x1f2240[_0xe853('0x30')]===0x1){return _0x2c6c0a['id'];}else{var _0x265780=_[_0xe853('0x6b')](_['map'](_0x1f2240,_0xe853('0x6c')),function(_0xae5d26){return _['includes'](_0x4c207d,_0xae5d26);});if(_0x265780){return _0x2c6c0a['id'];}}}));}}return BPromise[_0xe853('0x6d')](_0x8e2216)[_0xe853('0x16')](function(_0x7e230c){_0x4d0fc7=_(_0x4d0fc7)[_0xe853('0x6e')](_0x7e230c)[_0xe853('0x6f')]()[_0xe853('0x70')]();return db[_0xe853('0x1f')][_0xe853('0x34')]({'where':{'id':_0x5cb1e0[_0xe853('0x29')]['id']}})[_0xe853('0x16')](function(_0x18c5a1){return db['sequelize'][_0xe853('0x59')](function(_0x2d8543){return _0x18c5a1['removeTeams'](_0x5cb1e0[_0xe853('0x25')]['ids'],{'transaction':_0x2d8543})[_0xe853('0x16')](function(){if(!_['isEmpty'](_0x4d0fc7)){return _0x18c5a1[_0xe853('0x71')](_0x4d0fc7,{'transaction':_0x2d8543});}})['then'](function(){_0x4d0fc7[_0xe853('0x72')](function(_0x3ec38b){socket['emit'](_0xe853('0x73'),{'UserId':_0x3ec38b,'FaxQueueId':_0x18c5a1['id']});});});});});});})[_0xe853('0x16')](respondWithStatusCode(_0xa57b05,null))[_0xe853('0x28')](handleError(_0xa57b05,null));};exports['addAgents']=function(_0x406d5d,_0x473026){return db['FaxQueue']['find']({'where':{'id':_0x406d5d[_0xe853('0x29')]['id']}})[_0xe853('0x16')](handleEntityNotFound(_0x473026,null))[_0xe853('0x16')](function(_0x305138){if(_0x305138){return _0x305138[_0xe853('0x74')](_0x406d5d[_0xe853('0x36')][_0xe853('0x54')],_[_0xe853('0x75')](_0x406d5d[_0xe853('0x36')],[_0xe853('0x54'),'id'])||{})[_0xe853('0x76')](function(_0x2298a5){for(var _0x530c3f=0x0;_0x530c3f<_0x406d5d['body']['ids'][_0xe853('0x30')];_0x530c3f+=0x1){socket[_0xe853('0x5b')]('userFaxQueue:save',{'UserId':Number(_0x406d5d[_0xe853('0x36')][_0xe853('0x54')][_0x530c3f]),'FaxQueueId':Number(_0x406d5d[_0xe853('0x29')]['id'])});}return _0x2298a5;});}})[_0xe853('0x16')](respondWithResult(_0x473026,null))[_0xe853('0x28')](handleError(_0x473026,null));};exports[_0xe853('0x71')]=function(_0x2f49f6,_0x44770b){return db[_0xe853('0x1f')][_0xe853('0x34')]({'where':{'id':_0x2f49f6[_0xe853('0x29')]['id']}})['then'](handleEntityNotFound(_0x44770b,null))[_0xe853('0x16')](function(_0x38511e){if(_0x38511e){return _0x38511e[_0xe853('0x71')](_0x2f49f6[_0xe853('0x25')][_0xe853('0x54')])[_0xe853('0x16')](function(){if(_[_0xe853('0x77')](_0x2f49f6[_0xe853('0x25')][_0xe853('0x54')])){for(var _0x264c5f=0x0;_0x264c5f<_0x2f49f6['query'][_0xe853('0x54')][_0xe853('0x30')];_0x264c5f+=0x1){socket[_0xe853('0x5b')](_0xe853('0x73'),{'UserId':Number(_0x2f49f6['query'][_0xe853('0x54')][_0x264c5f]),'FaxQueueId':Number(_0x2f49f6[_0xe853('0x29')]['id'])});}}else{socket['emit'](_0xe853('0x73'),{'UserId':Number(_0x2f49f6[_0xe853('0x25')][_0xe853('0x54')]),'FaxQueueId':Number(_0x2f49f6['params']['id'])});}});}})[_0xe853('0x16')](respondWithStatusCode(_0x44770b,null))[_0xe853('0x28')](handleError(_0x44770b,null));};exports[_0xe853('0x78')]=function(_0x112f1c,_0x269ef2){var _0x3e7c96={};var _0x14e989={};var _0x4cc93c;var _0x26ad71;return db['FaxQueue'][_0xe853('0x79')]({'where':{'id':_0x112f1c[_0xe853('0x29')]['id']}})['then'](handleEntityNotFound(_0x269ef2,null))[_0xe853('0x16')](function(_0x5efedc){if(_0x5efedc){_0x4cc93c=_0x5efedc;_0x14e989[_0xe853('0x2a')]=_[_0xe853('0x2b')](db['User'][_0xe853('0x20')]);_0x14e989[_0xe853('0x25')]=_[_0xe853('0x2b')](_0x112f1c[_0xe853('0x25')]);_0x14e989[_0xe853('0x2c')]=_['intersection'](_0x14e989[_0xe853('0x2a')],_0x14e989['query']);_0x3e7c96[_0xe853('0x2e')]=_[_0xe853('0x2d')](_0x14e989['model'],qs[_0xe853('0x2f')](_0x112f1c[_0xe853('0x25')][_0xe853('0x2f')]));_0x3e7c96[_0xe853('0x2e')]=_0x3e7c96[_0xe853('0x2e')][_0xe853('0x30')]?_0x3e7c96['attributes']:_0x14e989['model'];_0x3e7c96[_0xe853('0x41')]=qs['sort'](_0x112f1c['query']['sort']);_0x3e7c96[_0xe853('0x23')]=qs['filters'](_[_0xe853('0x43')](_0x112f1c[_0xe853('0x25')],_0x14e989[_0xe853('0x2c')]));if(_0x112f1c[_0xe853('0x25')][_0xe853('0x45')]){_0x3e7c96['where']=_[_0xe853('0x32')](_0x3e7c96['where'],{'$or':_['map'](_0x3e7c96['attributes'],function(_0x3eceb5){var _0x245f95={};_0x245f95[_0x3eceb5]={'$like':'%'+_0x112f1c[_0xe853('0x25')]['filter']+'%'};return _0x245f95;})});}_0x3e7c96=_[_0xe853('0x32')]({},_0x3e7c96,_0x112f1c[_0xe853('0x33')]);return _0x4cc93c[_0xe853('0x78')](_0x3e7c96);}})[_0xe853('0x16')](function(_0x87f58b){if(_0x87f58b){_0x26ad71=_0x87f58b[_0xe853('0x30')];if(!_0x112f1c[_0xe853('0x25')]['hasOwnProperty'](_0xe853('0x40'))){_0x3e7c96['limit']=qs[_0xe853('0x10')](_0x112f1c[_0xe853('0x25')][_0xe853('0x10')]);_0x3e7c96[_0xe853('0xe')]=qs[_0xe853('0xe')](_0x112f1c['query'][_0xe853('0xe')]);}return _0x4cc93c[_0xe853('0x78')](_0x3e7c96);}})[_0xe853('0x16')](function(_0x5c3e4){if(_0x5c3e4){return _0x5c3e4?{'count':_0x26ad71,'rows':_0x5c3e4}:null;}})['then'](respondWithResult(_0x269ef2,null))[_0xe853('0x28')](handleError(_0x269ef2,null));}; \ No newline at end of file diff --git a/server/api/faxQueue/faxQueue.events.js b/server/api/faxQueue/faxQueue.events.js index 031ab8b..637f6b1 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 _0x3809=['FaxQueue','setMaxListeners','update','emit','hasOwnProperty','events'];(function(_0x81b2b2,_0xcea40){var _0x49f38b=function(_0x255dff){while(--_0x255dff){_0x81b2b2['push'](_0x81b2b2['shift']());}};_0x49f38b(++_0xcea40);}(_0x3809,0xe9));var _0x9380=function(_0x420e81,_0x241214){_0x420e81=_0x420e81-0x0;var _0x171e58=_0x3809[_0x420e81];return _0x171e58;};'use strict';var EventEmitter=require(_0x9380('0x0'));var FaxQueue=require('../../mysqldb')['db'][_0x9380('0x1')];var FaxQueueEvents=new EventEmitter();FaxQueueEvents[_0x9380('0x2')](0x0);var events={'afterCreate':'save','afterUpdate':_0x9380('0x3'),'afterDestroy':'remove'};function emitEvent(_0x3bfe87){return function(_0x7f089b,_0x3b1e59,_0x44fe6d){FaxQueueEvents[_0x9380('0x4')](_0x3bfe87+':'+_0x7f089b['id'],_0x7f089b);FaxQueueEvents[_0x9380('0x4')](_0x3bfe87,_0x7f089b);_0x44fe6d(null);};}for(var e in events){if(events[_0x9380('0x5')](e)){var event=events[e];FaxQueue['hook'](e,emitEvent(event));}}module['exports']=FaxQueueEvents; \ No newline at end of file +var _0x1699=['../../mysqldb','save','emit','hasOwnProperty','hook','exports','events'];(function(_0x6c993a,_0x5ea3ab){var _0x27f547=function(_0x22df20){while(--_0x22df20){_0x6c993a['push'](_0x6c993a['shift']());}};_0x27f547(++_0x5ea3ab);}(_0x1699,0x6f));var _0x9169=function(_0x36b5be,_0x25cbb9){_0x36b5be=_0x36b5be-0x0;var _0x186b09=_0x1699[_0x36b5be];return _0x186b09;};'use strict';var EventEmitter=require(_0x9169('0x0'));var FaxQueue=require(_0x9169('0x1'))['db']['FaxQueue'];var FaxQueueEvents=new EventEmitter();FaxQueueEvents['setMaxListeners'](0x0);var events={'afterCreate':_0x9169('0x2'),'afterUpdate':'update','afterDestroy':'remove'};function emitEvent(_0x50ca18){return function(_0x4d85b5,_0x496edc,_0x38ec65){FaxQueueEvents[_0x9169('0x3')](_0x50ca18+':'+_0x4d85b5['id'],_0x4d85b5);FaxQueueEvents[_0x9169('0x3')](_0x50ca18,_0x4d85b5);_0x38ec65(null);};}for(var e in events){if(events[_0x9169('0x4')](e)){var event=events[e];FaxQueue[_0x9169('0x5')](e,emitEvent(event));}}module[_0x9169('0x6')]=FaxQueueEvents; \ No newline at end of file diff --git a/server/api/faxQueue/faxQueue.model.js b/server/api/faxQueue/faxQueue.model.js index 801f5a1..1a3465f 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 _0x68f9=['lodash','util','../../config/logger','moment','bluebird','rimraf','../../config/environment','./faxQueue.attributes','exports','define','FaxQueue','fax_queues'];(function(_0x2e7735,_0x462860){var _0x587604=function(_0x5a3349){while(--_0x5a3349){_0x2e7735['push'](_0x2e7735['shift']());}};_0x587604(++_0x462860);}(_0x68f9,0x18c));var _0x968f=function(_0x20fd8,_0x1396a2){_0x20fd8=_0x20fd8-0x0;var _0x33f916=_0x68f9[_0x20fd8];return _0x33f916;};'use strict';var _=require(_0x968f('0x0'));var util=require(_0x968f('0x1'));var logger=require(_0x968f('0x2'))('api');var moment=require(_0x968f('0x3'));var BPromise=require(_0x968f('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0x968f('0x5'));var config=require(_0x968f('0x6'));var attributes=require(_0x968f('0x7'));module[_0x968f('0x8')]=function(_0x52a35c,_0x4d4a70){return _0x52a35c[_0x968f('0x9')](_0x968f('0xa'),attributes,{'tableName':_0x968f('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x61ac=['request-promise','path','rimraf','../../config/environment','FaxQueue','fax_queues','lodash','util','../../config/logger','api','moment','bluebird'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x61ac,0xa2));var _0xc61a=function(_0x59b533,_0x59fdcc){_0x59b533=_0x59b533-0x0;var _0x2beced=_0x61ac[_0x59b533];return _0x2beced;};'use strict';var _=require(_0xc61a('0x0'));var util=require(_0xc61a('0x1'));var logger=require(_0xc61a('0x2'))(_0xc61a('0x3'));var moment=require(_0xc61a('0x4'));var BPromise=require(_0xc61a('0x5'));var rp=require(_0xc61a('0x6'));var fs=require('fs');var path=require(_0xc61a('0x7'));var rimraf=require(_0xc61a('0x8'));var config=require(_0xc61a('0x9'));var attributes=require('./faxQueue.attributes');module['exports']=function(_0x102992,_0x34d041){return _0x102992['define'](_0xc61a('0xa'),attributes,{'tableName':_0xc61a('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/faxQueue/faxQueue.rpc.js b/server/api/faxQueue/faxQueue.rpc.js index e596a81..e6cc1dc 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 _0x5ee0=['findAll','options','raw','where','attributes','limit','include','map','model','GetFaxQueue','stringify','ShowFaxQueue','find','then','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','redis','defaults','localhost','socket.io-emitter','register','request','info','request\x20sent','FaxQueue,\x20%s,\x20%s,\x20%s','error','code','message','FaxQueue,\x20%s,\x20%s','result','catch','FaxQueue'];(function(_0x1f5be0,_0x2c41e5){var _0x21bcf7=function(_0x5134ca){while(--_0x5134ca){_0x1f5be0['push'](_0x1f5be0['shift']());}};_0x21bcf7(++_0x2c41e5);}(_0x5ee0,0xb2));var _0x05ee=function(_0x5c4a96,_0xbe3c95){_0x5c4a96=_0x5c4a96-0x0;var _0x3672ba=_0x5ee0[_0x5c4a96];return _0x3672ba;};'use strict';var _=require(_0x05ee('0x0'));var util=require(_0x05ee('0x1'));var moment=require(_0x05ee('0x2'));var BPromise=require(_0x05ee('0x3'));var rs=require(_0x05ee('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x05ee('0x5'))['db'];var utils=require(_0x05ee('0x6'));var logger=require(_0x05ee('0x7'))(_0x05ee('0x8'));var config=require('../../config/environment');var jayson=require(_0x05ee('0x9'));var client=jayson[_0x05ee('0xa')]['http']({'port':0x232a});config[_0x05ee('0xb')]=_[_0x05ee('0xc')](config['redis'],{'host':_0x05ee('0xd'),'port':0x18eb});var socket=require(_0x05ee('0xe'))(new Redis(config[_0x05ee('0xb')]));require('./faxQueue.socket')[_0x05ee('0xf')](socket);function respondWithRpcPromise(_0x1b8e21,_0x5b6035,_0x22f7da){return new BPromise(function(_0x29d7cb,_0x109de3){return client[_0x05ee('0x10')](_0x1b8e21,_0x22f7da)['then'](function(_0x36931c){logger[_0x05ee('0x11')]('FaxQueue,\x20%s,\x20%s',_0x5b6035,_0x05ee('0x12'));logger['debug'](_0x05ee('0x13'),_0x5b6035,'request\x20sent',JSON['stringify'](_0x36931c));if(_0x36931c[_0x05ee('0x14')]){if(_0x36931c[_0x05ee('0x14')][_0x05ee('0x15')]===0x1f4){logger['error']('FaxQueue,\x20%s,\x20%s',_0x5b6035,_0x36931c[_0x05ee('0x14')]['message']);return _0x109de3(_0x36931c[_0x05ee('0x14')][_0x05ee('0x16')]);}logger[_0x05ee('0x14')](_0x05ee('0x17'),_0x5b6035,_0x36931c[_0x05ee('0x14')][_0x05ee('0x16')]);return _0x29d7cb(_0x36931c['error'][_0x05ee('0x16')]);}else{logger['info'](_0x05ee('0x17'),_0x5b6035,_0x05ee('0x12'));_0x29d7cb(_0x36931c[_0x05ee('0x18')]['message']);}})[_0x05ee('0x19')](function(_0x1db67d){logger[_0x05ee('0x14')]('FaxQueue,\x20%s,\x20%s',_0x5b6035,_0x1db67d);_0x109de3(_0x1db67d);});});}exports['GetFaxQueue']=function(_0x4bfa56){var _0x242f5a=this;return new Promise(function(_0x3013df,_0x2da237){return db[_0x05ee('0x1a')][_0x05ee('0x1b')]({'raw':_0x4bfa56['options']?_0x4bfa56[_0x05ee('0x1c')][_0x05ee('0x1d')]===undefined?!![]:![]:!![],'where':_0x4bfa56[_0x05ee('0x1c')]?_0x4bfa56[_0x05ee('0x1c')][_0x05ee('0x1e')]||null:null,'attributes':_0x4bfa56[_0x05ee('0x1c')]?_0x4bfa56[_0x05ee('0x1c')][_0x05ee('0x1f')]||null:null,'limit':_0x4bfa56['options']?_0x4bfa56['options'][_0x05ee('0x20')]||null:null,'include':_0x4bfa56['options']?_0x4bfa56['options'][_0x05ee('0x21')]?_[_0x05ee('0x22')](_0x4bfa56[_0x05ee('0x1c')]['include'],function(_0x5dae26){return{'model':db[_0x5dae26[_0x05ee('0x23')]],'as':_0x5dae26['as'],'attributes':_0x5dae26[_0x05ee('0x1f')],'include':_0x5dae26[_0x05ee('0x21')]?_[_0x05ee('0x22')](_0x5dae26['include'],function(_0x190208){return{'model':db[_0x190208[_0x05ee('0x23')]],'as':_0x190208['as'],'attributes':_0x190208[_0x05ee('0x1f')],'include':_0x190208[_0x05ee('0x21')]?_[_0x05ee('0x22')](_0x190208[_0x05ee('0x21')],function(_0x52756c){return{'model':db[_0x52756c[_0x05ee('0x23')]],'as':_0x52756c['as'],'attributes':_0x52756c[_0x05ee('0x1f')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x175809){logger[_0x05ee('0x11')]('GetFaxQueue',_0x4bfa56);logger['debug'](_0x05ee('0x24'),_0x4bfa56,JSON[_0x05ee('0x25')](_0x175809));_0x3013df(_0x175809);})[_0x05ee('0x19')](function(_0x2c851b){logger['error']('GetFaxQueue',_0x2c851b[_0x05ee('0x16')],_0x4bfa56);_0x2da237(_0x242f5a[_0x05ee('0x14')](0x1f4,_0x2c851b[_0x05ee('0x16')]));});});};exports[_0x05ee('0x26')]=function(_0x1b4ff1){var _0x29207e=this;return new Promise(function(_0x14c9de,_0x57b480){return db['FaxQueue'][_0x05ee('0x27')]({'raw':_0x1b4ff1['options']?_0x1b4ff1['options'][_0x05ee('0x1d')]===undefined?!![]:![]:!![],'where':_0x1b4ff1['options']?_0x1b4ff1[_0x05ee('0x1c')][_0x05ee('0x1e')]||null:null,'attributes':_0x1b4ff1[_0x05ee('0x1c')]?_0x1b4ff1[_0x05ee('0x1c')][_0x05ee('0x1f')]||null:null,'include':_0x1b4ff1[_0x05ee('0x1c')]?_0x1b4ff1[_0x05ee('0x1c')]['include']?_[_0x05ee('0x22')](_0x1b4ff1['options'][_0x05ee('0x21')],function(_0x5be152){return{'model':db[_0x5be152[_0x05ee('0x23')]],'as':_0x5be152['as'],'attributes':_0x5be152[_0x05ee('0x1f')],'include':_0x5be152[_0x05ee('0x21')]?_['map'](_0x5be152['include'],function(_0xdb439c){return{'model':db[_0xdb439c[_0x05ee('0x23')]],'as':_0xdb439c['as'],'attributes':_0xdb439c[_0x05ee('0x1f')],'include':_0xdb439c[_0x05ee('0x21')]?_[_0x05ee('0x22')](_0xdb439c[_0x05ee('0x21')],function(_0x59a565){return{'model':db[_0x59a565[_0x05ee('0x23')]],'as':_0x59a565['as'],'attributes':_0x59a565[_0x05ee('0x1f')]};}):[]};}):[]};}):[]:[]})[_0x05ee('0x28')](function(_0x588302){logger[_0x05ee('0x11')]('ShowFaxQueue',_0x1b4ff1);logger['debug'](_0x05ee('0x26'),_0x1b4ff1,JSON['stringify'](_0x588302));_0x14c9de(_0x588302);})[_0x05ee('0x19')](function(_0x3c6c17){logger[_0x05ee('0x14')](_0x05ee('0x26'),_0x3c6c17[_0x05ee('0x16')],_0x1b4ff1);_0x57b480(_0x29207e[_0x05ee('0x14')](0x1f4,_0x3c6c17[_0x05ee('0x16')]));});});}; \ No newline at end of file +var _0xdbe9=['../../mysqldb','../../config/utils','rpc','jayson/promise','http','defaults','localhost','register','request','then','FaxQueue,\x20%s,\x20%s','request\x20sent','FaxQueue,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result','catch','GetFaxQueue','FaxQueue','findAll','options','raw','where','limit','include','model','attributes','map','ShowFaxQueue','util','randomstring','ioredis'];(function(_0x172133,_0x10246b){var _0x2460e5=function(_0x3c4918){while(--_0x3c4918){_0x172133['push'](_0x172133['shift']());}};_0x2460e5(++_0x10246b);}(_0xdbe9,0xcf));var _0x9dbe=function(_0x2d0d0c,_0x594064){_0x2d0d0c=_0x2d0d0c-0x0;var _0x1f0fe9=_0xdbe9[_0x2d0d0c];return _0x1f0fe9;};'use strict';var _=require('lodash');var util=require(_0x9dbe('0x0'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0x9dbe('0x1'));var fs=require('fs');var Redis=require(_0x9dbe('0x2'));var db=require(_0x9dbe('0x3'))['db'];var utils=require(_0x9dbe('0x4'));var logger=require('../../config/logger')(_0x9dbe('0x5'));var config=require('../../config/environment');var jayson=require(_0x9dbe('0x6'));var client=jayson['client'][_0x9dbe('0x7')]({'port':0x232a});config['redis']=_[_0x9dbe('0x8')](config['redis'],{'host':_0x9dbe('0x9'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require('./faxQueue.socket')[_0x9dbe('0xa')](socket);function respondWithRpcPromise(_0x158420,_0x1015af,_0x23f441){return new BPromise(function(_0x2bddd0,_0x4f6bfe){return client[_0x9dbe('0xb')](_0x158420,_0x23f441)[_0x9dbe('0xc')](function(_0x584635){logger['info'](_0x9dbe('0xd'),_0x1015af,_0x9dbe('0xe'));logger['debug'](_0x9dbe('0xf'),_0x1015af,_0x9dbe('0xe'),JSON[_0x9dbe('0x10')](_0x584635));if(_0x584635[_0x9dbe('0x11')]){if(_0x584635[_0x9dbe('0x11')][_0x9dbe('0x12')]===0x1f4){logger[_0x9dbe('0x11')](_0x9dbe('0xd'),_0x1015af,_0x584635[_0x9dbe('0x11')][_0x9dbe('0x13')]);return _0x4f6bfe(_0x584635[_0x9dbe('0x11')][_0x9dbe('0x13')]);}logger['error'](_0x9dbe('0xd'),_0x1015af,_0x584635['error']['message']);return _0x2bddd0(_0x584635[_0x9dbe('0x11')][_0x9dbe('0x13')]);}else{logger[_0x9dbe('0x14')](_0x9dbe('0xd'),_0x1015af,_0x9dbe('0xe'));_0x2bddd0(_0x584635[_0x9dbe('0x15')]['message']);}})[_0x9dbe('0x16')](function(_0xab677a){logger[_0x9dbe('0x11')](_0x9dbe('0xd'),_0x1015af,_0xab677a);_0x4f6bfe(_0xab677a);});});}exports[_0x9dbe('0x17')]=function(_0x1306f1){var _0x436e88=this;return new Promise(function(_0x285271,_0x8eb6af){return db[_0x9dbe('0x18')][_0x9dbe('0x19')]({'raw':_0x1306f1[_0x9dbe('0x1a')]?_0x1306f1['options'][_0x9dbe('0x1b')]===undefined?!![]:![]:!![],'where':_0x1306f1[_0x9dbe('0x1a')]?_0x1306f1[_0x9dbe('0x1a')][_0x9dbe('0x1c')]||null:null,'attributes':_0x1306f1['options']?_0x1306f1[_0x9dbe('0x1a')]['attributes']||null:null,'limit':_0x1306f1[_0x9dbe('0x1a')]?_0x1306f1['options'][_0x9dbe('0x1d')]||null:null,'include':_0x1306f1['options']?_0x1306f1[_0x9dbe('0x1a')]['include']?_['map'](_0x1306f1['options'][_0x9dbe('0x1e')],function(_0x45b709){return{'model':db[_0x45b709[_0x9dbe('0x1f')]],'as':_0x45b709['as'],'attributes':_0x45b709[_0x9dbe('0x20')],'include':_0x45b709[_0x9dbe('0x1e')]?_[_0x9dbe('0x21')](_0x45b709[_0x9dbe('0x1e')],function(_0x258960){return{'model':db[_0x258960[_0x9dbe('0x1f')]],'as':_0x258960['as'],'attributes':_0x258960[_0x9dbe('0x20')],'include':_0x258960['include']?_['map'](_0x258960[_0x9dbe('0x1e')],function(_0x449067){return{'model':db[_0x449067[_0x9dbe('0x1f')]],'as':_0x449067['as'],'attributes':_0x449067[_0x9dbe('0x20')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x2c21c0){logger['info']('GetFaxQueue',_0x1306f1);logger['debug']('GetFaxQueue',_0x1306f1,JSON['stringify'](_0x2c21c0));_0x285271(_0x2c21c0);})[_0x9dbe('0x16')](function(_0x21f2b3){logger['error']('GetFaxQueue',_0x21f2b3[_0x9dbe('0x13')],_0x1306f1);_0x8eb6af(_0x436e88['error'](0x1f4,_0x21f2b3[_0x9dbe('0x13')]));});});};exports[_0x9dbe('0x22')]=function(_0x4b7ade){var _0x3c3b0b=this;return new Promise(function(_0x38855e,_0x547e01){return db[_0x9dbe('0x18')]['find']({'raw':_0x4b7ade[_0x9dbe('0x1a')]?_0x4b7ade[_0x9dbe('0x1a')][_0x9dbe('0x1b')]===undefined?!![]:![]:!![],'where':_0x4b7ade['options']?_0x4b7ade[_0x9dbe('0x1a')][_0x9dbe('0x1c')]||null:null,'attributes':_0x4b7ade[_0x9dbe('0x1a')]?_0x4b7ade[_0x9dbe('0x1a')]['attributes']||null:null,'include':_0x4b7ade[_0x9dbe('0x1a')]?_0x4b7ade[_0x9dbe('0x1a')][_0x9dbe('0x1e')]?_[_0x9dbe('0x21')](_0x4b7ade['options']['include'],function(_0xe111e7){return{'model':db[_0xe111e7[_0x9dbe('0x1f')]],'as':_0xe111e7['as'],'attributes':_0xe111e7[_0x9dbe('0x20')],'include':_0xe111e7[_0x9dbe('0x1e')]?_[_0x9dbe('0x21')](_0xe111e7[_0x9dbe('0x1e')],function(_0x3017c8){return{'model':db[_0x3017c8[_0x9dbe('0x1f')]],'as':_0x3017c8['as'],'attributes':_0x3017c8[_0x9dbe('0x20')],'include':_0x3017c8['include']?_[_0x9dbe('0x21')](_0x3017c8[_0x9dbe('0x1e')],function(_0x241868){return{'model':db[_0x241868['model']],'as':_0x241868['as'],'attributes':_0x241868['attributes']};}):[]};}):[]};}):[]:[]})[_0x9dbe('0xc')](function(_0x5950fa){logger[_0x9dbe('0x14')](_0x9dbe('0x22'),_0x4b7ade);logger['debug'](_0x9dbe('0x22'),_0x4b7ade,JSON[_0x9dbe('0x10')](_0x5950fa));_0x38855e(_0x5950fa);})[_0x9dbe('0x16')](function(_0x4f04e1){logger['error'](_0x9dbe('0x22'),_0x4f04e1['message'],_0x4b7ade);_0x547e01(_0x3c3b0b[_0x9dbe('0x11')](0x1f4,_0x4f04e1['message']));});});}; \ No newline at end of file diff --git a/server/api/faxQueue/faxQueue.socket.js b/server/api/faxQueue/faxQueue.socket.js index ab27251..31801eb 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 _0x31c2=['removeListener','register','length','faxQueue:','./faxQueue.events','save','remove','update','emit'];(function(_0x5ca10d,_0x4800dd){var _0xc14a55=function(_0x15527c){while(--_0x15527c){_0x5ca10d['push'](_0x5ca10d['shift']());}};_0xc14a55(++_0x4800dd);}(_0x31c2,0x1e1));var _0x231c=function(_0x58f082,_0x50a3a0){_0x58f082=_0x58f082-0x0;var _0x1ae862=_0x31c2[_0x58f082];return _0x1ae862;};'use strict';var FaxQueueEvents=require(_0x231c('0x0'));var events=[_0x231c('0x1'),_0x231c('0x2'),_0x231c('0x3')];function createListener(_0x1c57c9,_0x7e36a0){return function(_0xa1faa4){_0x7e36a0[_0x231c('0x4')](_0x1c57c9,_0xa1faa4);};}function removeListener(_0x5b0b0a,_0x59f232){return function(){FaxQueueEvents[_0x231c('0x5')](_0x5b0b0a,_0x59f232);};}exports[_0x231c('0x6')]=function(_0x1f3f7d){for(var _0x219c3f=0x0,_0x48bfb2=events[_0x231c('0x7')];_0x219c3f<_0x48bfb2;_0x219c3f++){var _0x49ff9e=events[_0x219c3f];var _0x439df8=createListener(_0x231c('0x8')+_0x49ff9e,_0x1f3f7d);FaxQueueEvents['on'](_0x49ff9e,_0x439df8);}}; \ No newline at end of file +var _0x0b1a=['remove','update','emit','length','./faxQueue.events','save'];(function(_0x1a1682,_0xbd7409){var _0x4b3a37=function(_0x1be09d){while(--_0x1be09d){_0x1a1682['push'](_0x1a1682['shift']());}};_0x4b3a37(++_0xbd7409);}(_0x0b1a,0x10c));var _0xa0b1=function(_0x20daf0,_0x1e96d7){_0x20daf0=_0x20daf0-0x0;var _0x100b63=_0x0b1a[_0x20daf0];return _0x100b63;};'use strict';var FaxQueueEvents=require(_0xa0b1('0x0'));var events=[_0xa0b1('0x1'),_0xa0b1('0x2'),_0xa0b1('0x3')];function createListener(_0x3824cf,_0x3b154a){return function(_0xddcad){_0x3b154a[_0xa0b1('0x4')](_0x3824cf,_0xddcad);};}function removeListener(_0x1c6e41,_0x36c041){return function(){FaxQueueEvents['removeListener'](_0x1c6e41,_0x36c041);};}exports['register']=function(_0x26b76f){for(var _0x446904=0x0,_0x2e6d17=events[_0xa0b1('0x5')];_0x446904<_0x2e6d17;_0x446904++){var _0x96fa55=events[_0x446904];var _0x5d94ca=createListener('faxQueue:'+_0x96fa55,_0x26b76f);FaxQueueEvents['on'](_0x96fa55,_0x5d94ca);}}; \ No newline at end of file diff --git a/server/api/faxQueue/index.js b/server/api/faxQueue/index.js index 7762a71..2840ef7 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 _0x8506=['addTeams','put','update','delete','destroy','removeTeams','exports','util','connect-timeout','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/:id','/:id/members','getMembers','/:id/teams','getTeams','/:id/users','getAgents','post','create'];(function(_0x4cbf20,_0x1bfa66){var _0x582ae4=function(_0x5eca38){while(--_0x5eca38){_0x4cbf20['push'](_0x4cbf20['shift']());}};_0x582ae4(++_0x1bfa66);}(_0x8506,0xe8));var _0x6850=function(_0x50fb14,_0x3c6504){_0x50fb14=_0x50fb14-0x0;var _0x2fa003=_0x8506[_0x50fb14];return _0x2fa003;};'use strict';var multer=require('multer');var util=require(_0x6850('0x0'));var path=require('path');var timeout=require(_0x6850('0x1'));var express=require('express');var router=express[_0x6850('0x2')]();var fs_extra=require('fs-extra');var auth=require(_0x6850('0x3'));var interaction=require(_0x6850('0x4'));var config=require(_0x6850('0x5'));var controller=require('./faxQueue.controller');router[_0x6850('0x6')]('/',auth[_0x6850('0x7')](),controller[_0x6850('0x8')]);router[_0x6850('0x6')]('/describe',auth['isAuthenticated'](),controller['describe']);router[_0x6850('0x6')](_0x6850('0x9'),auth[_0x6850('0x7')](),controller['show']);router['get'](_0x6850('0xa'),auth[_0x6850('0x7')](),controller[_0x6850('0xb')]);router[_0x6850('0x6')](_0x6850('0xc'),auth['isAuthenticated'](),controller[_0x6850('0xd')]);router[_0x6850('0x6')](_0x6850('0xe'),auth[_0x6850('0x7')](),controller[_0x6850('0xf')]);router[_0x6850('0x10')]('/',auth['isAuthenticated'](),controller[_0x6850('0x11')]);router[_0x6850('0x10')](_0x6850('0xc'),auth[_0x6850('0x7')](),controller[_0x6850('0x12')]);router[_0x6850('0x10')]('/:id/users',auth[_0x6850('0x7')](),controller['addAgents']);router[_0x6850('0x13')](_0x6850('0x9'),auth[_0x6850('0x7')](),controller[_0x6850('0x14')]);router[_0x6850('0x15')](_0x6850('0x9'),auth[_0x6850('0x7')](),controller[_0x6850('0x16')]);router[_0x6850('0x15')](_0x6850('0xc'),auth[_0x6850('0x7')](),controller[_0x6850('0x17')]);router[_0x6850('0x15')](_0x6850('0xe'),auth['isAuthenticated'](),controller['removeAgents']);module[_0x6850('0x18')]=router; \ No newline at end of file +var _0x90b1=['addTeams','addAgents','put','update','delete','removeTeams','removeAgents','exports','multer','util','path','Router','fs-extra','../../components/auth/service','../../components/interaction/service','index','get','/describe','isAuthenticated','describe','/:id','show','/:id/members','getMembers','/:id/teams','/:id/users','getAgents','post','create'];(function(_0x36328f,_0x47b04d){var _0x5543f5=function(_0x4fca6b){while(--_0x4fca6b){_0x36328f['push'](_0x36328f['shift']());}};_0x5543f5(++_0x47b04d);}(_0x90b1,0x1bb));var _0x190b=function(_0x26d6d9,_0x431cb8){_0x26d6d9=_0x26d6d9-0x0;var _0x1b4875=_0x90b1[_0x26d6d9];return _0x1b4875;};'use strict';var multer=require(_0x190b('0x0'));var util=require(_0x190b('0x1'));var path=require(_0x190b('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x190b('0x3')]();var fs_extra=require(_0x190b('0x4'));var auth=require(_0x190b('0x5'));var interaction=require(_0x190b('0x6'));var config=require('../../config/environment');var controller=require('./faxQueue.controller');router['get']('/',auth['isAuthenticated'](),controller[_0x190b('0x7')]);router[_0x190b('0x8')](_0x190b('0x9'),auth[_0x190b('0xa')](),controller[_0x190b('0xb')]);router[_0x190b('0x8')](_0x190b('0xc'),auth['isAuthenticated'](),controller[_0x190b('0xd')]);router[_0x190b('0x8')](_0x190b('0xe'),auth[_0x190b('0xa')](),controller[_0x190b('0xf')]);router[_0x190b('0x8')](_0x190b('0x10'),auth[_0x190b('0xa')](),controller['getTeams']);router[_0x190b('0x8')](_0x190b('0x11'),auth['isAuthenticated'](),controller[_0x190b('0x12')]);router[_0x190b('0x13')]('/',auth[_0x190b('0xa')](),controller[_0x190b('0x14')]);router[_0x190b('0x13')](_0x190b('0x10'),auth[_0x190b('0xa')](),controller[_0x190b('0x15')]);router[_0x190b('0x13')](_0x190b('0x11'),auth[_0x190b('0xa')](),controller[_0x190b('0x16')]);router[_0x190b('0x17')](_0x190b('0xc'),auth[_0x190b('0xa')](),controller[_0x190b('0x18')]);router[_0x190b('0x19')]('/:id',auth[_0x190b('0xa')](),controller['destroy']);router[_0x190b('0x19')](_0x190b('0x10'),auth[_0x190b('0xa')](),controller[_0x190b('0x1a')]);router['delete'](_0x190b('0x11'),auth[_0x190b('0xa')](),controller[_0x190b('0x1b')]);module[_0x190b('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 c67e385..fca99ec 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 _0x6cb7=['exports','STRING','DATE','moment','sequelize'];(function(_0x1f23cd,_0x1d6fcf){var _0x18af3d=function(_0x425430){while(--_0x425430){_0x1f23cd['push'](_0x1f23cd['shift']());}};_0x18af3d(++_0x1d6fcf);}(_0x6cb7,0xa3));var _0x76cb=function(_0x829e00,_0x26034e){_0x829e00=_0x829e00-0x0;var _0x1e73a0=_0x6cb7[_0x829e00];return _0x1e73a0;};'use strict';var moment=require(_0x76cb('0x0'));var Sequelize=require(_0x76cb('0x1'));module[_0x76cb('0x2')]={'uniqueid':{'type':Sequelize[_0x76cb('0x3')],'allowNull':![]},'from':{'type':Sequelize[_0x76cb('0x3')]},'joinAt':{'type':Sequelize['DATE']},'leaveAt':{'type':Sequelize[_0x76cb('0x4')]},'acceptAt':{'type':Sequelize['DATE']},'exitAt':{'type':Sequelize['DATE']},'reason':{'type':Sequelize[_0x76cb('0x3')]}}; \ No newline at end of file +var _0x43e1=['DATE','moment','sequelize','exports','STRING'];(function(_0x209941,_0x5c9988){var _0x1e8729=function(_0x51a9b8){while(--_0x51a9b8){_0x209941['push'](_0x209941['shift']());}};_0x1e8729(++_0x5c9988);}(_0x43e1,0x18c));var _0x143e=function(_0x9d1e6b,_0x3bdc22){_0x9d1e6b=_0x9d1e6b-0x0;var _0x2b3070=_0x43e1[_0x9d1e6b];return _0x2b3070;};'use strict';var moment=require(_0x143e('0x0'));var Sequelize=require(_0x143e('0x1'));module[_0x143e('0x2')]={'uniqueid':{'type':Sequelize[_0x143e('0x3')],'allowNull':![]},'from':{'type':Sequelize[_0x143e('0x3')]},'joinAt':{'type':Sequelize[_0x143e('0x4')]},'leaveAt':{'type':Sequelize[_0x143e('0x4')]},'acceptAt':{'type':Sequelize[_0x143e('0x4')]},'exitAt':{'type':Sequelize['DATE']},'reason':{'type':Sequelize[_0x143e('0x3')]}}; \ No newline at end of file diff --git a/server/api/faxQueueReport/faxQueueReport.controller.js b/server/api/faxQueueReport/faxQueueReport.controller.js index 4b5ee40..9d326f7 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 _0x7070=['ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/license/util','sendStatus','status','end','offset','limit','undefined','set','json','save','then','destroy','error','name','send','index','map','FaxQueueReport','rawAttributes','fieldName','type','key','query','keys','intersection','model','attributes','fields','hasOwnProperty','nolimit','order','sort','where','pick','filters','filter','merge','VIRTUAL','options','count','include','rows','catch','params','length','find','create','body','update','describe','rimraf','fast-json-patch','bluebird','mustache','util','path','to-csv','ejs','squel','desk.js','querystring','papaparse'];(function(_0xfba903,_0x1b675e){var _0x1553c4=function(_0x332214){while(--_0x332214){_0xfba903['push'](_0xfba903['shift']());}};_0x1553c4(++_0x1b675e);}(_0x7070,0x1d7));var _0x0707=function(_0xe6d064,_0x2fa6a7){_0xe6d064=_0xe6d064-0x0;var _0x1a650b=_0x7070[_0xe6d064];return _0x1a650b;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x0707('0x0'));var zipdir=require('zip-dir');var jsonpatch=require(_0x0707('0x1'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0x0707('0x2'));var Mustache=require(_0x0707('0x3'));var util=require(_0x0707('0x4'));var path=require(_0x0707('0x5'));var sox=require('sox');var csv=require(_0x0707('0x6'));var ejs=require(_0x0707('0x7'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0x0707('0x8'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x0707('0x9'));var toCsv=require(_0x0707('0x6'));var querystring=require(_0x0707('0xa'));var Papa=require(_0x0707('0xb'));var Redis=require(_0x0707('0xc'));var authService=require(_0x0707('0xd'));var qs=require(_0x0707('0xe'));var as=require(_0x0707('0xf'));var hardwareService=require(_0x0707('0x10'));var logger=require(_0x0707('0x11'))('api');var utils=require(_0x0707('0x12'));var config=require('../../config/environment');var licenseUtil=require(_0x0707('0x13'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x3b55c6,_0x2bd4d8){_0x2bd4d8=_0x2bd4d8||0xcc;return function(_0x3eeea8){if(_0x3eeea8){return _0x3b55c6[_0x0707('0x14')](_0x2bd4d8);}return _0x3b55c6[_0x0707('0x15')](_0x2bd4d8)[_0x0707('0x16')]();};}function respondWithResult(_0x3b0f64,_0x111fd7){_0x111fd7=_0x111fd7||0xc8;return function(_0x380abc){if(_0x380abc){return _0x3b0f64[_0x0707('0x15')](_0x111fd7)['json'](_0x380abc);}};}function respondWithFilteredResult(_0x5bae3d,_0x3fce78){return function(_0x429da2){if(_0x429da2){var _0x1370b3=typeof _0x3fce78[_0x0707('0x17')]==='undefined'&&typeof _0x3fce78[_0x0707('0x18')]===_0x0707('0x19');var _0xe1cf0e=_0x429da2['count'];var _0x13d5de=_0x1370b3?0x0:_0x3fce78['offset'];var _0x471431=_0x1370b3?_0x429da2['count']:_0x3fce78[_0x0707('0x17')]+_0x3fce78[_0x0707('0x18')];var _0x1debb9;if(_0x471431>=_0xe1cf0e){_0x471431=_0xe1cf0e;_0x1debb9=0xc8;}else{_0x1debb9=0xce;}_0x5bae3d[_0x0707('0x15')](_0x1debb9);return _0x5bae3d[_0x0707('0x1a')]('Content-Range',_0x13d5de+'-'+_0x471431+'/'+_0xe1cf0e)[_0x0707('0x1b')](_0x429da2);}return null;};}function patchUpdates(_0x360caf){return function(_0x37d1fd){try{jsonpatch['apply'](_0x37d1fd,_0x360caf,!![]);}catch(_0x5c8731){return BPromise['reject'](_0x5c8731);}return _0x37d1fd[_0x0707('0x1c')]();};}function saveUpdates(_0x3f31e1,_0x1d133c){return function(_0x51dec4){if(_0x51dec4){return _0x51dec4['update'](_0x3f31e1)[_0x0707('0x1d')](function(_0x225a58){return _0x225a58;});}return null;};}function removeEntity(_0x370554,_0x3e9c41){return function(_0x3ba507){if(_0x3ba507){return _0x3ba507[_0x0707('0x1e')]()[_0x0707('0x1d')](function(){_0x370554[_0x0707('0x15')](0xcc)[_0x0707('0x16')]();});}};}function handleEntityNotFound(_0x3dc5fb,_0x392acd){return function(_0x373bca){if(!_0x373bca){_0x3dc5fb['sendStatus'](0x194);}return _0x373bca;};}function handleError(_0x14d68b,_0x1834e0){_0x1834e0=_0x1834e0||0x1f4;return function(_0x3be832){logger[_0x0707('0x1f')](_0x3be832['stack']);if(_0x3be832[_0x0707('0x20')]){delete _0x3be832[_0x0707('0x20')];}_0x14d68b[_0x0707('0x15')](_0x1834e0)[_0x0707('0x21')](_0x3be832);};}exports[_0x0707('0x22')]=function(_0x599090,_0x1a4f0b){var _0x3378a5={},_0x2f0ed2={},_0x2d7c68={'count':0x0,'rows':[]};var _0x5e8cbf=_[_0x0707('0x23')](db[_0x0707('0x24')][_0x0707('0x25')],function(_0x451c3f){return{'name':_0x451c3f[_0x0707('0x26')],'type':_0x451c3f[_0x0707('0x27')][_0x0707('0x28')]};});_0x2f0ed2['model']=_['map'](_0x5e8cbf,_0x0707('0x20'));_0x2f0ed2[_0x0707('0x29')]=_[_0x0707('0x2a')](_0x599090[_0x0707('0x29')]);_0x2f0ed2['filters']=_[_0x0707('0x2b')](_0x2f0ed2[_0x0707('0x2c')],_0x2f0ed2['query']);_0x3378a5[_0x0707('0x2d')]=_[_0x0707('0x2b')](_0x2f0ed2['model'],qs[_0x0707('0x2e')](_0x599090[_0x0707('0x29')]['fields']));_0x3378a5[_0x0707('0x2d')]=_0x3378a5[_0x0707('0x2d')]['length']?_0x3378a5[_0x0707('0x2d')]:_0x2f0ed2[_0x0707('0x2c')];if(!_0x599090[_0x0707('0x29')][_0x0707('0x2f')](_0x0707('0x30'))){_0x3378a5[_0x0707('0x18')]=qs[_0x0707('0x18')](_0x599090['query'][_0x0707('0x18')]);_0x3378a5[_0x0707('0x17')]=qs[_0x0707('0x17')](_0x599090['query'][_0x0707('0x17')]);}_0x3378a5[_0x0707('0x31')]=qs['sort'](_0x599090[_0x0707('0x29')][_0x0707('0x32')]);_0x3378a5[_0x0707('0x33')]=qs['filters'](_[_0x0707('0x34')](_0x599090['query'],_0x2f0ed2[_0x0707('0x35')]),_0x5e8cbf);if(_0x599090[_0x0707('0x29')][_0x0707('0x36')]){_0x3378a5[_0x0707('0x33')]=_[_0x0707('0x37')](_0x3378a5[_0x0707('0x33')],{'$or':_[_0x0707('0x23')](_0x5e8cbf,function(_0x23c13f){if(_0x23c13f[_0x0707('0x27')]!==_0x0707('0x38')){var _0x4da7c={};_0x4da7c[_0x23c13f[_0x0707('0x20')]]={'$like':'%'+_0x599090[_0x0707('0x29')][_0x0707('0x36')]+'%'};return _0x4da7c;}})});}_0x3378a5=_[_0x0707('0x37')]({},_0x3378a5,_0x599090[_0x0707('0x39')]);var _0x374e21={'where':_0x3378a5[_0x0707('0x33')]};return db[_0x0707('0x24')]['count'](_0x374e21)[_0x0707('0x1d')](function(_0x3cce6b){_0x2d7c68[_0x0707('0x3a')]=_0x3cce6b;if(_0x599090['query']['includeAll']){_0x3378a5[_0x0707('0x3b')]=[{'all':!![]}];}return db[_0x0707('0x24')]['findAll'](_0x3378a5);})[_0x0707('0x1d')](function(_0x2d9c47){_0x2d7c68[_0x0707('0x3c')]=_0x2d9c47;return _0x2d7c68;})[_0x0707('0x1d')](respondWithFilteredResult(_0x1a4f0b,_0x3378a5))[_0x0707('0x3d')](handleError(_0x1a4f0b,null));};exports['show']=function(_0x12eb2f,_0x56bf6e){var _0x2d67d6={'raw':!![],'where':{'id':_0x12eb2f[_0x0707('0x3e')]['id']}},_0x508cc2={};_0x508cc2[_0x0707('0x2c')]=_[_0x0707('0x2a')](db[_0x0707('0x24')][_0x0707('0x25')]);_0x508cc2[_0x0707('0x29')]=_['keys'](_0x12eb2f[_0x0707('0x29')]);_0x508cc2[_0x0707('0x35')]=_[_0x0707('0x2b')](_0x508cc2[_0x0707('0x2c')],_0x508cc2['query']);_0x2d67d6['attributes']=_[_0x0707('0x2b')](_0x508cc2[_0x0707('0x2c')],qs[_0x0707('0x2e')](_0x12eb2f[_0x0707('0x29')][_0x0707('0x2e')]));_0x2d67d6[_0x0707('0x2d')]=_0x2d67d6[_0x0707('0x2d')][_0x0707('0x3f')]?_0x2d67d6[_0x0707('0x2d')]:_0x508cc2[_0x0707('0x2c')];if(_0x12eb2f[_0x0707('0x29')]['includeAll']){_0x2d67d6[_0x0707('0x3b')]=[{'all':!![]}];}_0x2d67d6=_[_0x0707('0x37')]({},_0x2d67d6,_0x12eb2f[_0x0707('0x39')]);return db['FaxQueueReport'][_0x0707('0x40')](_0x2d67d6)[_0x0707('0x1d')](handleEntityNotFound(_0x56bf6e,null))[_0x0707('0x1d')](respondWithResult(_0x56bf6e,null))[_0x0707('0x3d')](handleError(_0x56bf6e,null));};exports[_0x0707('0x41')]=function(_0x2dae01,_0x1e560f){return db[_0x0707('0x24')]['create'](_0x2dae01[_0x0707('0x42')],{})[_0x0707('0x1d')](respondWithResult(_0x1e560f,0xc9))[_0x0707('0x3d')](handleError(_0x1e560f,null));};exports[_0x0707('0x43')]=function(_0x19a4df,_0x5e5d53){if(_0x19a4df[_0x0707('0x42')]['id']){delete _0x19a4df[_0x0707('0x42')]['id'];}return db[_0x0707('0x24')][_0x0707('0x40')]({'where':{'id':_0x19a4df['params']['id']}})[_0x0707('0x1d')](handleEntityNotFound(_0x5e5d53,null))['then'](saveUpdates(_0x19a4df[_0x0707('0x42')],null))[_0x0707('0x1d')](respondWithResult(_0x5e5d53,null))[_0x0707('0x3d')](handleError(_0x5e5d53,null));};exports[_0x0707('0x1e')]=function(_0x504255,_0x2aa0){return db[_0x0707('0x24')][_0x0707('0x40')]({'where':{'id':_0x504255[_0x0707('0x3e')]['id']}})[_0x0707('0x1d')](handleEntityNotFound(_0x2aa0,null))[_0x0707('0x1d')](removeEntity(_0x2aa0,null))['catch'](handleError(_0x2aa0,null));};exports[_0x0707('0x44')]=function(_0x1db4b5,_0x474463){return db[_0x0707('0x24')][_0x0707('0x44')]()[_0x0707('0x1d')](respondWithResult(_0x474463,null))['catch'](handleError(_0x474463,null));}; \ No newline at end of file +var _0xae7b=['save','update','then','sendStatus','error','stack','send','index','map','FaxQueueReport','rawAttributes','fieldName','type','model','name','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','merge','VIRTUAL','filter','options','includeAll','include','findAll','rows','catch','show','params','create','body','describe','eml-format','rimraf','zip-dir','moment','bluebird','mustache','util','to-csv','ejs','fs-extra','squel','jsforce','desk.js','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/license/util','status','end','offset','undefined','limit','count','set','Content-Range','json','apply','reject'];(function(_0x58f25a,_0x3bf004){var _0x563cb8=function(_0x53d2a2){while(--_0x53d2a2){_0x58f25a['push'](_0x58f25a['shift']());}};_0x563cb8(++_0x3bf004);}(_0xae7b,0xbe));var _0xbae7=function(_0x223c0d,_0x3ec04d){_0x223c0d=_0x223c0d-0x0;var _0x207827=_0xae7b[_0x223c0d];return _0x207827;};'use strict';var emlformat=require(_0xbae7('0x0'));var rimraf=require(_0xbae7('0x1'));var zipdir=require(_0xbae7('0x2'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0xbae7('0x3'));var BPromise=require(_0xbae7('0x4'));var Mustache=require(_0xbae7('0x5'));var util=require(_0xbae7('0x6'));var path=require('path');var sox=require('sox');var csv=require(_0xbae7('0x7'));var ejs=require(_0xbae7('0x8'));var fs=require('fs');var fs_extra=require(_0xbae7('0x9'));var _=require('lodash');var squel=require(_0xbae7('0xa'));var crypto=require('crypto');var jsforce=require(_0xbae7('0xb'));var deskjs=require(_0xbae7('0xc'));var toCsv=require(_0xbae7('0x7'));var querystring=require('querystring');var Papa=require(_0xbae7('0xd'));var Redis=require('ioredis');var authService=require(_0xbae7('0xe'));var qs=require(_0xbae7('0xf'));var as=require(_0xbae7('0x10'));var hardwareService=require(_0xbae7('0x11'));var logger=require('../../config/logger')(_0xbae7('0x12'));var utils=require(_0xbae7('0x13'));var config=require('../../config/environment');var licenseUtil=require(_0xbae7('0x14'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x3d17ae,_0x4090a1){_0x4090a1=_0x4090a1||0xcc;return function(_0x5b1abe){if(_0x5b1abe){return _0x3d17ae['sendStatus'](_0x4090a1);}return _0x3d17ae[_0xbae7('0x15')](_0x4090a1)[_0xbae7('0x16')]();};}function respondWithResult(_0x43e4ca,_0x25d1a){_0x25d1a=_0x25d1a||0xc8;return function(_0x4cc0a9){if(_0x4cc0a9){return _0x43e4ca[_0xbae7('0x15')](_0x25d1a)['json'](_0x4cc0a9);}};}function respondWithFilteredResult(_0x5aae99,_0x249669){return function(_0xb272c4){if(_0xb272c4){var _0x1b9ee1=typeof _0x249669[_0xbae7('0x17')]===_0xbae7('0x18')&&typeof _0x249669[_0xbae7('0x19')]==='undefined';var _0x1b2949=_0xb272c4[_0xbae7('0x1a')];var _0x99d88=_0x1b9ee1?0x0:_0x249669[_0xbae7('0x17')];var _0x1fc9fb=_0x1b9ee1?_0xb272c4['count']:_0x249669['offset']+_0x249669['limit'];var _0xa9ed79;if(_0x1fc9fb>=_0x1b2949){_0x1fc9fb=_0x1b2949;_0xa9ed79=0xc8;}else{_0xa9ed79=0xce;}_0x5aae99[_0xbae7('0x15')](_0xa9ed79);return _0x5aae99[_0xbae7('0x1b')](_0xbae7('0x1c'),_0x99d88+'-'+_0x1fc9fb+'/'+_0x1b2949)[_0xbae7('0x1d')](_0xb272c4);}return null;};}function patchUpdates(_0x519980){return function(_0xd87dc2){try{jsonpatch[_0xbae7('0x1e')](_0xd87dc2,_0x519980,!![]);}catch(_0x34a82b){return BPromise[_0xbae7('0x1f')](_0x34a82b);}return _0xd87dc2[_0xbae7('0x20')]();};}function saveUpdates(_0x502f06,_0x32d772){return function(_0x3e4569){if(_0x3e4569){return _0x3e4569[_0xbae7('0x21')](_0x502f06)[_0xbae7('0x22')](function(_0xb5d7f3){return _0xb5d7f3;});}return null;};}function removeEntity(_0x384ea6,_0x32f8eb){return function(_0x5c0245){if(_0x5c0245){return _0x5c0245['destroy']()[_0xbae7('0x22')](function(){_0x384ea6[_0xbae7('0x15')](0xcc)[_0xbae7('0x16')]();});}};}function handleEntityNotFound(_0x375df5,_0x61170a){return function(_0x3e003d){if(!_0x3e003d){_0x375df5[_0xbae7('0x23')](0x194);}return _0x3e003d;};}function handleError(_0x1b5caa,_0x1399bc){_0x1399bc=_0x1399bc||0x1f4;return function(_0x3e104e){logger[_0xbae7('0x24')](_0x3e104e[_0xbae7('0x25')]);if(_0x3e104e['name']){delete _0x3e104e['name'];}_0x1b5caa['status'](_0x1399bc)[_0xbae7('0x26')](_0x3e104e);};}exports[_0xbae7('0x27')]=function(_0x203848,_0x12dd23){var _0x12797a={},_0x2d8202={},_0x47e12b={'count':0x0,'rows':[]};var _0x5d702f=_[_0xbae7('0x28')](db[_0xbae7('0x29')][_0xbae7('0x2a')],function(_0x258c08){return{'name':_0x258c08[_0xbae7('0x2b')],'type':_0x258c08[_0xbae7('0x2c')]['key']};});_0x2d8202[_0xbae7('0x2d')]=_[_0xbae7('0x28')](_0x5d702f,_0xbae7('0x2e'));_0x2d8202[_0xbae7('0x2f')]=_[_0xbae7('0x30')](_0x203848[_0xbae7('0x2f')]);_0x2d8202[_0xbae7('0x31')]=_[_0xbae7('0x32')](_0x2d8202[_0xbae7('0x2d')],_0x2d8202[_0xbae7('0x2f')]);_0x12797a[_0xbae7('0x33')]=_[_0xbae7('0x32')](_0x2d8202['model'],qs[_0xbae7('0x34')](_0x203848[_0xbae7('0x2f')][_0xbae7('0x34')]));_0x12797a['attributes']=_0x12797a[_0xbae7('0x33')][_0xbae7('0x35')]?_0x12797a['attributes']:_0x2d8202[_0xbae7('0x2d')];if(!_0x203848[_0xbae7('0x2f')][_0xbae7('0x36')](_0xbae7('0x37'))){_0x12797a[_0xbae7('0x19')]=qs[_0xbae7('0x19')](_0x203848[_0xbae7('0x2f')][_0xbae7('0x19')]);_0x12797a[_0xbae7('0x17')]=qs['offset'](_0x203848['query'][_0xbae7('0x17')]);}_0x12797a[_0xbae7('0x38')]=qs['sort'](_0x203848[_0xbae7('0x2f')][_0xbae7('0x39')]);_0x12797a[_0xbae7('0x3a')]=qs[_0xbae7('0x31')](_[_0xbae7('0x3b')](_0x203848[_0xbae7('0x2f')],_0x2d8202[_0xbae7('0x31')]),_0x5d702f);if(_0x203848[_0xbae7('0x2f')]['filter']){_0x12797a['where']=_[_0xbae7('0x3c')](_0x12797a['where'],{'$or':_[_0xbae7('0x28')](_0x5d702f,function(_0x59e90b){if(_0x59e90b[_0xbae7('0x2c')]!==_0xbae7('0x3d')){var _0x1fdb4f={};_0x1fdb4f[_0x59e90b[_0xbae7('0x2e')]]={'$like':'%'+_0x203848[_0xbae7('0x2f')][_0xbae7('0x3e')]+'%'};return _0x1fdb4f;}})});}_0x12797a=_['merge']({},_0x12797a,_0x203848[_0xbae7('0x3f')]);var _0x4fa0ba={'where':_0x12797a['where']};return db[_0xbae7('0x29')][_0xbae7('0x1a')](_0x4fa0ba)[_0xbae7('0x22')](function(_0xc1c69e){_0x47e12b[_0xbae7('0x1a')]=_0xc1c69e;if(_0x203848['query'][_0xbae7('0x40')]){_0x12797a[_0xbae7('0x41')]=[{'all':!![]}];}return db[_0xbae7('0x29')][_0xbae7('0x42')](_0x12797a);})[_0xbae7('0x22')](function(_0x5047b0){_0x47e12b[_0xbae7('0x43')]=_0x5047b0;return _0x47e12b;})['then'](respondWithFilteredResult(_0x12dd23,_0x12797a))[_0xbae7('0x44')](handleError(_0x12dd23,null));};exports[_0xbae7('0x45')]=function(_0x3647a8,_0x472686){var _0x1895ef={'raw':!![],'where':{'id':_0x3647a8[_0xbae7('0x46')]['id']}},_0x57f345={};_0x57f345[_0xbae7('0x2d')]=_[_0xbae7('0x30')](db[_0xbae7('0x29')][_0xbae7('0x2a')]);_0x57f345[_0xbae7('0x2f')]=_[_0xbae7('0x30')](_0x3647a8['query']);_0x57f345[_0xbae7('0x31')]=_[_0xbae7('0x32')](_0x57f345[_0xbae7('0x2d')],_0x57f345[_0xbae7('0x2f')]);_0x1895ef[_0xbae7('0x33')]=_[_0xbae7('0x32')](_0x57f345['model'],qs['fields'](_0x3647a8[_0xbae7('0x2f')][_0xbae7('0x34')]));_0x1895ef['attributes']=_0x1895ef[_0xbae7('0x33')][_0xbae7('0x35')]?_0x1895ef[_0xbae7('0x33')]:_0x57f345[_0xbae7('0x2d')];if(_0x3647a8[_0xbae7('0x2f')]['includeAll']){_0x1895ef[_0xbae7('0x41')]=[{'all':!![]}];}_0x1895ef=_[_0xbae7('0x3c')]({},_0x1895ef,_0x3647a8[_0xbae7('0x3f')]);return db[_0xbae7('0x29')]['find'](_0x1895ef)[_0xbae7('0x22')](handleEntityNotFound(_0x472686,null))[_0xbae7('0x22')](respondWithResult(_0x472686,null))[_0xbae7('0x44')](handleError(_0x472686,null));};exports[_0xbae7('0x47')]=function(_0x50b52b,_0x11722e){return db[_0xbae7('0x29')][_0xbae7('0x47')](_0x50b52b[_0xbae7('0x48')],{})['then'](respondWithResult(_0x11722e,0xc9))[_0xbae7('0x44')](handleError(_0x11722e,null));};exports[_0xbae7('0x21')]=function(_0xb6df1f,_0x363b7b){if(_0xb6df1f[_0xbae7('0x48')]['id']){delete _0xb6df1f['body']['id'];}return db['FaxQueueReport']['find']({'where':{'id':_0xb6df1f[_0xbae7('0x46')]['id']}})[_0xbae7('0x22')](handleEntityNotFound(_0x363b7b,null))[_0xbae7('0x22')](saveUpdates(_0xb6df1f[_0xbae7('0x48')],null))[_0xbae7('0x22')](respondWithResult(_0x363b7b,null))['catch'](handleError(_0x363b7b,null));};exports['destroy']=function(_0x1bb00a,_0x46f0a9){return db[_0xbae7('0x29')]['find']({'where':{'id':_0x1bb00a[_0xbae7('0x46')]['id']}})[_0xbae7('0x22')](handleEntityNotFound(_0x46f0a9,null))[_0xbae7('0x22')](removeEntity(_0x46f0a9,null))[_0xbae7('0x44')](handleError(_0x46f0a9,null));};exports[_0xbae7('0x49')]=function(_0x4cf377,_0x2ccd2c){return db['FaxQueueReport'][_0xbae7('0x49')]()[_0xbae7('0x22')](respondWithResult(_0x2ccd2c,null))[_0xbae7('0x44')](handleError(_0x2ccd2c,null));}; \ No newline at end of file diff --git a/server/api/faxQueueReport/faxQueueReport.model.js b/server/api/faxQueueReport/faxQueueReport.model.js index 7f952dd..3aaac1c 100644 --- a/server/api/faxQueueReport/faxQueueReport.model.js +++ b/server/api/faxQueueReport/faxQueueReport.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x814b=['../../config/logger','api','moment','bluebird','path','rimraf','../../config/environment','./faxQueueReport.attributes','exports','define','FaxQueueReport','uniqueid','lodash','util'];(function(_0x307086,_0x3bfe4e){var _0x699043=function(_0x1a7677){while(--_0x1a7677){_0x307086['push'](_0x307086['shift']());}};_0x699043(++_0x3bfe4e);}(_0x814b,0x1a2));var _0xb814=function(_0x45a7a6,_0x380289){_0x45a7a6=_0x45a7a6-0x0;var _0x514f51=_0x814b[_0x45a7a6];return _0x514f51;};'use strict';var _=require(_0xb814('0x0'));var util=require(_0xb814('0x1'));var logger=require(_0xb814('0x2'))(_0xb814('0x3'));var moment=require(_0xb814('0x4'));var BPromise=require(_0xb814('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xb814('0x6'));var rimraf=require(_0xb814('0x7'));var config=require(_0xb814('0x8'));var attributes=require(_0xb814('0x9'));module[_0xb814('0xa')]=function(_0x322a70,_0x53e507){return _0x322a70[_0xb814('0xb')](_0xb814('0xc'),attributes,{'tableName':'report_fax_queue','paranoid':![],'indexes':[{'name':_0xb814('0xd'),'fields':[_0xb814('0xd')]}],'timestamps':!![]});}; \ No newline at end of file +var _0xe14b=['bluebird','path','./faxQueueReport.attributes','exports','define','FaxQueueReport','report_fax_queue','lodash','util','moment'];(function(_0x4b5560,_0x3aa3ed){var _0x36791c=function(_0x35ac95){while(--_0x35ac95){_0x4b5560['push'](_0x4b5560['shift']());}};_0x36791c(++_0x3aa3ed);}(_0xe14b,0x93));var _0xbe14=function(_0x2193e3,_0x1a9552){_0x2193e3=_0x2193e3-0x0;var _0x219158=_0xe14b[_0x2193e3];return _0x219158;};'use strict';var _=require(_0xbe14('0x0'));var util=require(_0xbe14('0x1'));var logger=require('../../config/logger')('api');var moment=require(_0xbe14('0x2'));var BPromise=require(_0xbe14('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xbe14('0x4'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0xbe14('0x5'));module[_0xbe14('0x6')]=function(_0x1fe204,_0x1ff100){return _0x1fe204[_0xbe14('0x7')](_0xbe14('0x8'),attributes,{'tableName':_0xbe14('0x9'),'paranoid':![],'indexes':[{'name':'uniqueid','fields':['uniqueid']}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/faxQueueReport/faxQueueReport.rpc.js b/server/api/faxQueueReport/faxQueueReport.rpc.js index 8e53656..a0f3bbc 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 _0x1792=['where','attributes','util','moment','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','jayson/promise','client','http','request','then','request\x20sent','debug','FaxQueueReport,\x20%s,\x20%s,\x20%s','stringify','error','code','FaxQueueReport,\x20%s,\x20%s','message','info','result','catch','FaxQueueReport','create','body','options','raw','CreateFaxQueueReport','UpdateFaxQueueReport','update'];(function(_0x4d3759,_0x3a8cde){var _0x36b555=function(_0x38e39a){while(--_0x38e39a){_0x4d3759['push'](_0x4d3759['shift']());}};_0x36b555(++_0x3a8cde);}(_0x1792,0x65));var _0x2179=function(_0x5800a5,_0x2823f6){_0x5800a5=_0x5800a5-0x0;var _0x420c85=_0x1792[_0x5800a5];return _0x420c85;};'use strict';var _=require('lodash');var util=require(_0x2179('0x0'));var moment=require(_0x2179('0x1'));var BPromise=require('bluebird');var rs=require(_0x2179('0x2'));var fs=require('fs');var Redis=require(_0x2179('0x3'));var db=require(_0x2179('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0x2179('0x5'))(_0x2179('0x6'));var config=require('../../config/environment');var jayson=require(_0x2179('0x7'));var client=jayson[_0x2179('0x8')][_0x2179('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x373ea7,_0x5d9720,_0x17ba43){return new BPromise(function(_0xdf1bb,_0x51a0bc){return client[_0x2179('0xa')](_0x373ea7,_0x17ba43)[_0x2179('0xb')](function(_0x3ee55a){logger['info']('FaxQueueReport,\x20%s,\x20%s',_0x5d9720,_0x2179('0xc'));logger[_0x2179('0xd')](_0x2179('0xe'),_0x5d9720,_0x2179('0xc'),JSON[_0x2179('0xf')](_0x3ee55a));if(_0x3ee55a[_0x2179('0x10')]){if(_0x3ee55a[_0x2179('0x10')][_0x2179('0x11')]===0x1f4){logger[_0x2179('0x10')](_0x2179('0x12'),_0x5d9720,_0x3ee55a[_0x2179('0x10')][_0x2179('0x13')]);return _0x51a0bc(_0x3ee55a['error'][_0x2179('0x13')]);}logger[_0x2179('0x10')](_0x2179('0x12'),_0x5d9720,_0x3ee55a[_0x2179('0x10')]['message']);return _0xdf1bb(_0x3ee55a['error']['message']);}else{logger[_0x2179('0x14')](_0x2179('0x12'),_0x5d9720,_0x2179('0xc'));_0xdf1bb(_0x3ee55a[_0x2179('0x15')][_0x2179('0x13')]);}})[_0x2179('0x16')](function(_0x12bc87){logger['error']('FaxQueueReport,\x20%s,\x20%s',_0x5d9720,_0x12bc87);_0x51a0bc(_0x12bc87);});});}exports['CreateFaxQueueReport']=function(_0x26fafc){var _0x200f74=this;return new Promise(function(_0x500e81,_0x17aff5){return db[_0x2179('0x17')][_0x2179('0x18')](_0x26fafc[_0x2179('0x19')],{'raw':_0x26fafc['options']?_0x26fafc[_0x2179('0x1a')][_0x2179('0x1b')]===undefined?!![]:![]:!![]})['then'](function(_0x192372){logger[_0x2179('0x14')](_0x2179('0x1c'),_0x26fafc);logger[_0x2179('0xd')](_0x2179('0x1c'),_0x26fafc,JSON[_0x2179('0xf')](_0x192372));_0x500e81(_0x192372);})[_0x2179('0x16')](function(_0xcdeab5){logger[_0x2179('0x10')](_0x2179('0x1c'),_0xcdeab5[_0x2179('0x13')],_0x26fafc);_0x17aff5(_0x200f74[_0x2179('0x10')](0x1f4,_0xcdeab5[_0x2179('0x13')]));});});};exports[_0x2179('0x1d')]=function(_0x4b529c){var _0x504112=this;return new Promise(function(_0x46dc9f,_0x580f47){return db[_0x2179('0x17')][_0x2179('0x1e')](_0x4b529c[_0x2179('0x19')],{'raw':_0x4b529c[_0x2179('0x1a')]?_0x4b529c[_0x2179('0x1a')][_0x2179('0x1b')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x4b529c[_0x2179('0x1a')]?_0x4b529c[_0x2179('0x1a')][_0x2179('0x1f')]||null:null,'attributes':_0x4b529c[_0x2179('0x1a')]?_0x4b529c[_0x2179('0x1a')][_0x2179('0x20')]||null:null,'limit':_0x4b529c['options']?_0x4b529c[_0x2179('0x1a')]['limit']||null:null})[_0x2179('0xb')](function(_0x430f37){logger[_0x2179('0x14')](_0x2179('0x1d'),_0x4b529c);logger[_0x2179('0xd')](_0x2179('0x1d'),_0x4b529c,JSON[_0x2179('0xf')](_0x430f37));_0x46dc9f(_0x430f37);})[_0x2179('0x16')](function(_0x57e8bc){logger[_0x2179('0x10')](_0x2179('0x1d'),_0x57e8bc[_0x2179('0x13')],_0x4b529c);_0x580f47(_0x504112[_0x2179('0x10')](0x1f4,_0x57e8bc['message']));});});}; \ No newline at end of file +var _0xc8aa=['../../config/environment','client','http','request','info','FaxQueueReport,\x20%s,\x20%s','request\x20sent','FaxQueueReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','FaxQueueReport','create','body','options','raw','then','debug','CreateFaxQueueReport','where','attributes','UpdateFaxQueueReport','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc'];(function(_0x4f499e,_0x4dbd69){var _0x5628f2=function(_0x5cc8d4){while(--_0x5cc8d4){_0x4f499e['push'](_0x4f499e['shift']());}};_0x5628f2(++_0x4dbd69);}(_0xc8aa,0x7c));var _0xac8a=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0xc8aa[_0x20a584];return _0x4b41a8;};'use strict';var _=require('lodash');var util=require(_0xac8a('0x0'));var moment=require('moment');var BPromise=require(_0xac8a('0x1'));var rs=require(_0xac8a('0x2'));var fs=require('fs');var Redis=require(_0xac8a('0x3'));var db=require(_0xac8a('0x4'))['db'];var utils=require(_0xac8a('0x5'));var logger=require(_0xac8a('0x6'))(_0xac8a('0x7'));var config=require(_0xac8a('0x8'));var jayson=require('jayson/promise');var client=jayson[_0xac8a('0x9')][_0xac8a('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x37eb71,_0xc942c7,_0x800c0d){return new BPromise(function(_0x234ca1,_0x1d08d9){return client[_0xac8a('0xb')](_0x37eb71,_0x800c0d)['then'](function(_0x255812){logger[_0xac8a('0xc')](_0xac8a('0xd'),_0xc942c7,_0xac8a('0xe'));logger['debug'](_0xac8a('0xf'),_0xc942c7,'request\x20sent',JSON[_0xac8a('0x10')](_0x255812));if(_0x255812['error']){if(_0x255812[_0xac8a('0x11')][_0xac8a('0x12')]===0x1f4){logger[_0xac8a('0x11')](_0xac8a('0xd'),_0xc942c7,_0x255812[_0xac8a('0x11')][_0xac8a('0x13')]);return _0x1d08d9(_0x255812[_0xac8a('0x11')][_0xac8a('0x13')]);}logger[_0xac8a('0x11')](_0xac8a('0xd'),_0xc942c7,_0x255812['error'][_0xac8a('0x13')]);return _0x234ca1(_0x255812[_0xac8a('0x11')][_0xac8a('0x13')]);}else{logger['info'](_0xac8a('0xd'),_0xc942c7,_0xac8a('0xe'));_0x234ca1(_0x255812[_0xac8a('0x14')][_0xac8a('0x13')]);}})[_0xac8a('0x15')](function(_0x2a1dfa){logger[_0xac8a('0x11')](_0xac8a('0xd'),_0xc942c7,_0x2a1dfa);_0x1d08d9(_0x2a1dfa);});});}exports['CreateFaxQueueReport']=function(_0x498e37){var _0x83de27=this;return new Promise(function(_0x5b4976,_0x584a43){return db[_0xac8a('0x16')][_0xac8a('0x17')](_0x498e37[_0xac8a('0x18')],{'raw':_0x498e37[_0xac8a('0x19')]?_0x498e37['options'][_0xac8a('0x1a')]===undefined?!![]:![]:!![]})[_0xac8a('0x1b')](function(_0x30a73b){logger['info']('CreateFaxQueueReport',_0x498e37);logger[_0xac8a('0x1c')](_0xac8a('0x1d'),_0x498e37,JSON[_0xac8a('0x10')](_0x30a73b));_0x5b4976(_0x30a73b);})['catch'](function(_0x3cabb9){logger[_0xac8a('0x11')](_0xac8a('0x1d'),_0x3cabb9[_0xac8a('0x13')],_0x498e37);_0x584a43(_0x83de27[_0xac8a('0x11')](0x1f4,_0x3cabb9['message']));});});};exports['UpdateFaxQueueReport']=function(_0x11484d){var _0x3a6fe5=this;return new Promise(function(_0x42d055,_0x57345d){return db[_0xac8a('0x16')]['update'](_0x11484d[_0xac8a('0x18')],{'raw':_0x11484d[_0xac8a('0x19')]?_0x11484d[_0xac8a('0x19')]['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x11484d[_0xac8a('0x19')]?_0x11484d[_0xac8a('0x19')][_0xac8a('0x1e')]||null:null,'attributes':_0x11484d[_0xac8a('0x19')]?_0x11484d[_0xac8a('0x19')][_0xac8a('0x1f')]||null:null,'limit':_0x11484d[_0xac8a('0x19')]?_0x11484d['options']['limit']||null:null})[_0xac8a('0x1b')](function(_0x5cb55f){logger[_0xac8a('0xc')]('UpdateFaxQueueReport',_0x11484d);logger[_0xac8a('0x1c')](_0xac8a('0x20'),_0x11484d,JSON[_0xac8a('0x10')](_0x5cb55f));_0x42d055(_0x5cb55f);})[_0xac8a('0x15')](function(_0x6da15f){logger[_0xac8a('0x11')](_0xac8a('0x20'),_0x6da15f[_0xac8a('0x13')],_0x11484d);_0x57345d(_0x3a6fe5[_0xac8a('0x11')](0x1f4,_0x6da15f[_0xac8a('0x13')]));});});}; \ No newline at end of file diff --git a/server/api/faxQueueReport/index.js b/server/api/faxQueueReport/index.js index 6256aab..c356f7f 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 _0xceb9=['exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./faxQueueReport.controller','isAuthenticated','/describe','describe','get','/:id','show','post','create','put','delete','destroy'];(function(_0x3b8644,_0x2beda8){var _0x469f74=function(_0x49db04){while(--_0x49db04){_0x3b8644['push'](_0x3b8644['shift']());}};_0x469f74(++_0x2beda8);}(_0xceb9,0x18d));var _0x9ceb=function(_0x22929a,_0x5615d2){_0x22929a=_0x22929a-0x0;var _0x2140a5=_0xceb9[_0x22929a];return _0x2140a5;};'use strict';var multer=require(_0x9ceb('0x0'));var util=require(_0x9ceb('0x1'));var path=require(_0x9ceb('0x2'));var timeout=require(_0x9ceb('0x3'));var express=require(_0x9ceb('0x4'));var router=express[_0x9ceb('0x5')]();var fs_extra=require(_0x9ceb('0x6'));var auth=require(_0x9ceb('0x7'));var interaction=require(_0x9ceb('0x8'));var config=require('../../config/environment');var controller=require(_0x9ceb('0x9'));router['get']('/',auth[_0x9ceb('0xa')](),controller['index']);router['get'](_0x9ceb('0xb'),auth[_0x9ceb('0xa')](),controller[_0x9ceb('0xc')]);router[_0x9ceb('0xd')](_0x9ceb('0xe'),auth['isAuthenticated'](),controller[_0x9ceb('0xf')]);router[_0x9ceb('0x10')]('/',auth['isAuthenticated'](),controller[_0x9ceb('0x11')]);router[_0x9ceb('0x12')](_0x9ceb('0xe'),auth[_0x9ceb('0xa')](),controller['update']);router[_0x9ceb('0x13')](_0x9ceb('0xe'),auth[_0x9ceb('0xa')](),controller[_0x9ceb('0x14')]);module[_0x9ceb('0x15')]=router; \ No newline at end of file +var _0x855c=['create','put','update','delete','destroy','exports','multer','util','path','connect-timeout','express','fs-extra','../../components/interaction/service','../../config/environment','./faxQueueReport.controller','get','isAuthenticated','/describe','describe','/:id','show','post'];(function(_0x3914c4,_0x31f1c8){var _0x52ef52=function(_0x35fea9){while(--_0x35fea9){_0x3914c4['push'](_0x3914c4['shift']());}};_0x52ef52(++_0x31f1c8);}(_0x855c,0x8a));var _0xc855=function(_0x47e7cb,_0x4c1b8d){_0x47e7cb=_0x47e7cb-0x0;var _0x2a8874=_0x855c[_0x47e7cb];return _0x2a8874;};'use strict';var multer=require(_0xc855('0x0'));var util=require(_0xc855('0x1'));var path=require(_0xc855('0x2'));var timeout=require(_0xc855('0x3'));var express=require(_0xc855('0x4'));var router=express['Router']();var fs_extra=require(_0xc855('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0xc855('0x6'));var config=require(_0xc855('0x7'));var controller=require(_0xc855('0x8'));router[_0xc855('0x9')]('/',auth[_0xc855('0xa')](),controller['index']);router[_0xc855('0x9')](_0xc855('0xb'),auth[_0xc855('0xa')](),controller[_0xc855('0xc')]);router[_0xc855('0x9')](_0xc855('0xd'),auth['isAuthenticated'](),controller[_0xc855('0xe')]);router[_0xc855('0xf')]('/',auth['isAuthenticated'](),controller[_0xc855('0x10')]);router[_0xc855('0x11')](_0xc855('0xd'),auth[_0xc855('0xa')](),controller[_0xc855('0x12')]);router[_0xc855('0x13')]('/:id',auth['isAuthenticated'](),controller[_0xc855('0x14')]);module[_0xc855('0x15')]=router; \ No newline at end of file diff --git a/server/api/faxTransferReport/faxTransferReport.attributes.js b/server/api/faxTransferReport/faxTransferReport.attributes.js index 5cbc1fd..53edea6 100644 --- a/server/api/faxTransferReport/faxTransferReport.attributes.js +++ b/server/api/faxTransferReport/faxTransferReport.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xaa88=['account','agent','queue','DATE','NOW','moment','sequelize','exports','STRING'];(function(_0x2e7a3f,_0x588e2a){var _0x663314=function(_0x2e6d4a){while(--_0x2e6d4a){_0x2e7a3f['push'](_0x2e7a3f['shift']());}};_0x663314(++_0x588e2a);}(_0xaa88,0x137));var _0x8aa8=function(_0x1139d0,_0x41e5f8){_0x1139d0=_0x1139d0-0x0;var _0xcc01a6=_0xaa88[_0x1139d0];return _0xcc01a6;};'use strict';var moment=require(_0x8aa8('0x0'));var Sequelize=require(_0x8aa8('0x1'));module[_0x8aa8('0x2')]={'uniqueid':{'type':Sequelize[_0x8aa8('0x3')],'allowNull':![]},'type':{'type':Sequelize['ENUM'](_0x8aa8('0x4'),_0x8aa8('0x5'),_0x8aa8('0x6')),'allowNull':![],'defaultValue':_0x8aa8('0x6')},'transferredAt':{'type':Sequelize[_0x8aa8('0x7')],'allowNull':![],'defaultValue':Sequelize[_0x8aa8('0x8')]}}; \ No newline at end of file +var _0x008c=['ENUM','agent','queue','DATE','NOW','moment','sequelize','exports','STRING'];(function(_0x352108,_0xb5cdc3){var _0x2c901c=function(_0x4e0a61){while(--_0x4e0a61){_0x352108['push'](_0x352108['shift']());}};_0x2c901c(++_0xb5cdc3);}(_0x008c,0x188));var _0xc008=function(_0x19017b,_0x56d52c){_0x19017b=_0x19017b-0x0;var _0x3becdc=_0x008c[_0x19017b];return _0x3becdc;};'use strict';var moment=require(_0xc008('0x0'));var Sequelize=require(_0xc008('0x1'));module[_0xc008('0x2')]={'uniqueid':{'type':Sequelize[_0xc008('0x3')],'allowNull':![]},'type':{'type':Sequelize[_0xc008('0x4')]('account',_0xc008('0x5'),_0xc008('0x6')),'allowNull':![],'defaultValue':_0xc008('0x6')},'transferredAt':{'type':Sequelize[_0xc008('0x7')],'allowNull':![],'defaultValue':Sequelize[_0xc008('0x8')]}}; \ No newline at end of file diff --git a/server/api/faxTransferReport/faxTransferReport.controller.js b/server/api/faxTransferReport/faxTransferReport.controller.js index 2061c20..7bd1e22 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 _0x2775=['count','set','Content-Range','json','apply','save','update','then','end','error','name','send','index','map','FaxTransferReport','rawAttributes','fieldName','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','type','options','includeAll','findAll','rows','params','include','find','catch','create','body','destroy','describe','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','util','path','sox','to-csv','ejs','squel','crypto','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','sendStatus','status','offset','limit','undefined'];(function(_0xfd76a8,_0x1cfcf5){var _0x7a0fbf=function(_0x38cc0e){while(--_0x38cc0e){_0xfd76a8['push'](_0xfd76a8['shift']());}};_0x7a0fbf(++_0x1cfcf5);}(_0x2775,0x110));var _0x5277=function(_0x4565bf,_0x5ad9d6){_0x4565bf=_0x4565bf-0x0;var _0x5610ba=_0x2775[_0x4565bf];return _0x5610ba;};'use strict';var emlformat=require(_0x5277('0x0'));var rimraf=require(_0x5277('0x1'));var zipdir=require(_0x5277('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x5277('0x3'));var moment=require(_0x5277('0x4'));var BPromise=require(_0x5277('0x5'));var Mustache=require('mustache');var util=require(_0x5277('0x6'));var path=require(_0x5277('0x7'));var sox=require(_0x5277('0x8'));var csv=require(_0x5277('0x9'));var ejs=require(_0x5277('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0x5277('0xb'));var crypto=require(_0x5277('0xc'));var jsforce=require('jsforce');var deskjs=require(_0x5277('0xd'));var toCsv=require('to-csv');var querystring=require(_0x5277('0xe'));var Papa=require('papaparse');var Redis=require(_0x5277('0xf'));var authService=require(_0x5277('0x10'));var qs=require(_0x5277('0x11'));var as=require(_0x5277('0x12'));var hardwareService=require(_0x5277('0x13'));var logger=require(_0x5277('0x14'))(_0x5277('0x15'));var utils=require(_0x5277('0x16'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x260bce,_0x1457b0){_0x1457b0=_0x1457b0||0xcc;return function(_0x38fc43){if(_0x38fc43){return _0x260bce[_0x5277('0x17')](_0x1457b0);}return _0x260bce[_0x5277('0x18')](_0x1457b0)['end']();};}function respondWithResult(_0x3c6fcb,_0x185b59){_0x185b59=_0x185b59||0xc8;return function(_0xac3541){if(_0xac3541){return _0x3c6fcb[_0x5277('0x18')](_0x185b59)['json'](_0xac3541);}};}function respondWithFilteredResult(_0x1aff2c,_0x353ce6){return function(_0x1fb36f){if(_0x1fb36f){var _0x2f2a2c=typeof _0x353ce6[_0x5277('0x19')]==='undefined'&&typeof _0x353ce6[_0x5277('0x1a')]===_0x5277('0x1b');var _0x5ebe22=_0x1fb36f[_0x5277('0x1c')];var _0x50fb2c=_0x2f2a2c?0x0:_0x353ce6[_0x5277('0x19')];var _0x5b8775=_0x2f2a2c?_0x1fb36f[_0x5277('0x1c')]:_0x353ce6[_0x5277('0x19')]+_0x353ce6[_0x5277('0x1a')];var _0xebe592;if(_0x5b8775>=_0x5ebe22){_0x5b8775=_0x5ebe22;_0xebe592=0xc8;}else{_0xebe592=0xce;}_0x1aff2c[_0x5277('0x18')](_0xebe592);return _0x1aff2c[_0x5277('0x1d')](_0x5277('0x1e'),_0x50fb2c+'-'+_0x5b8775+'/'+_0x5ebe22)[_0x5277('0x1f')](_0x1fb36f);}return null;};}function patchUpdates(_0xfa389){return function(_0x469636){try{jsonpatch[_0x5277('0x20')](_0x469636,_0xfa389,!![]);}catch(_0x2b8f4a){return BPromise['reject'](_0x2b8f4a);}return _0x469636[_0x5277('0x21')]();};}function saveUpdates(_0x54e08a,_0x5b5461){return function(_0x9c12b0){if(_0x9c12b0){return _0x9c12b0[_0x5277('0x22')](_0x54e08a)[_0x5277('0x23')](function(_0x46076c){return _0x46076c;});}return null;};}function removeEntity(_0x338bb6,_0x4ce57e){return function(_0x507bf2){if(_0x507bf2){return _0x507bf2['destroy']()['then'](function(){_0x338bb6[_0x5277('0x18')](0xcc)[_0x5277('0x24')]();});}};}function handleEntityNotFound(_0x3423c9,_0x1753ac){return function(_0x1e190d){if(!_0x1e190d){_0x3423c9[_0x5277('0x17')](0x194);}return _0x1e190d;};}function handleError(_0x372db8,_0x327fe7){_0x327fe7=_0x327fe7||0x1f4;return function(_0x42643c){logger[_0x5277('0x25')](_0x42643c['stack']);if(_0x42643c[_0x5277('0x26')]){delete _0x42643c[_0x5277('0x26')];}_0x372db8['status'](_0x327fe7)[_0x5277('0x27')](_0x42643c);};}exports[_0x5277('0x28')]=function(_0x3491cc,_0x518325){var _0xe54420={},_0x4fdc10={},_0x346aa6={'count':0x0,'rows':[]};var _0x4abf02=_[_0x5277('0x29')](db[_0x5277('0x2a')][_0x5277('0x2b')],function(_0x3961ca){return{'name':_0x3961ca[_0x5277('0x2c')],'type':_0x3961ca['type'][_0x5277('0x2d')]};});_0x4fdc10[_0x5277('0x2e')]=_[_0x5277('0x29')](_0x4abf02,_0x5277('0x26'));_0x4fdc10[_0x5277('0x2f')]=_[_0x5277('0x30')](_0x3491cc[_0x5277('0x2f')]);_0x4fdc10[_0x5277('0x31')]=_[_0x5277('0x32')](_0x4fdc10[_0x5277('0x2e')],_0x4fdc10['query']);_0xe54420[_0x5277('0x33')]=_['intersection'](_0x4fdc10['model'],qs[_0x5277('0x34')](_0x3491cc[_0x5277('0x2f')][_0x5277('0x34')]));_0xe54420[_0x5277('0x33')]=_0xe54420[_0x5277('0x33')][_0x5277('0x35')]?_0xe54420[_0x5277('0x33')]:_0x4fdc10[_0x5277('0x2e')];if(!_0x3491cc[_0x5277('0x2f')][_0x5277('0x36')](_0x5277('0x37'))){_0xe54420[_0x5277('0x1a')]=qs['limit'](_0x3491cc['query'][_0x5277('0x1a')]);_0xe54420[_0x5277('0x19')]=qs[_0x5277('0x19')](_0x3491cc[_0x5277('0x2f')][_0x5277('0x19')]);}_0xe54420[_0x5277('0x38')]=qs[_0x5277('0x39')](_0x3491cc[_0x5277('0x2f')][_0x5277('0x39')]);_0xe54420[_0x5277('0x3a')]=qs[_0x5277('0x31')](_[_0x5277('0x3b')](_0x3491cc[_0x5277('0x2f')],_0x4fdc10[_0x5277('0x31')]),_0x4abf02);if(_0x3491cc['query'][_0x5277('0x3c')]){_0xe54420[_0x5277('0x3a')]=_[_0x5277('0x3d')](_0xe54420[_0x5277('0x3a')],{'$or':_['map'](_0x4abf02,function(_0xb0b919){if(_0xb0b919[_0x5277('0x3e')]!=='VIRTUAL'){var _0x25c3fd={};_0x25c3fd[_0xb0b919[_0x5277('0x26')]]={'$like':'%'+_0x3491cc[_0x5277('0x2f')][_0x5277('0x3c')]+'%'};return _0x25c3fd;}})});}_0xe54420=_[_0x5277('0x3d')]({},_0xe54420,_0x3491cc[_0x5277('0x3f')]);var _0x1956f2={'where':_0xe54420[_0x5277('0x3a')]};return db[_0x5277('0x2a')]['count'](_0x1956f2)['then'](function(_0x5ae064){_0x346aa6[_0x5277('0x1c')]=_0x5ae064;if(_0x3491cc[_0x5277('0x2f')][_0x5277('0x40')]){_0xe54420['include']=[{'all':!![]}];}return db[_0x5277('0x2a')][_0x5277('0x41')](_0xe54420);})['then'](function(_0x5d2587){_0x346aa6[_0x5277('0x42')]=_0x5d2587;return _0x346aa6;})['then'](respondWithFilteredResult(_0x518325,_0xe54420))['catch'](handleError(_0x518325,null));};exports['show']=function(_0x413b9,_0x17f3e4){var _0x3e1136={'raw':!![],'where':{'id':_0x413b9[_0x5277('0x43')]['id']}},_0x13fe94={};_0x13fe94['model']=_['keys'](db['FaxTransferReport'][_0x5277('0x2b')]);_0x13fe94['query']=_[_0x5277('0x30')](_0x413b9[_0x5277('0x2f')]);_0x13fe94[_0x5277('0x31')]=_[_0x5277('0x32')](_0x13fe94[_0x5277('0x2e')],_0x13fe94[_0x5277('0x2f')]);_0x3e1136['attributes']=_[_0x5277('0x32')](_0x13fe94[_0x5277('0x2e')],qs[_0x5277('0x34')](_0x413b9[_0x5277('0x2f')][_0x5277('0x34')]));_0x3e1136[_0x5277('0x33')]=_0x3e1136[_0x5277('0x33')]['length']?_0x3e1136[_0x5277('0x33')]:_0x13fe94['model'];if(_0x413b9[_0x5277('0x2f')][_0x5277('0x40')]){_0x3e1136[_0x5277('0x44')]=[{'all':!![]}];}_0x3e1136=_[_0x5277('0x3d')]({},_0x3e1136,_0x413b9['options']);return db[_0x5277('0x2a')][_0x5277('0x45')](_0x3e1136)[_0x5277('0x23')](handleEntityNotFound(_0x17f3e4,null))['then'](respondWithResult(_0x17f3e4,null))[_0x5277('0x46')](handleError(_0x17f3e4,null));};exports[_0x5277('0x47')]=function(_0x259c9e,_0x3b9763){return db[_0x5277('0x2a')]['create'](_0x259c9e['body'],{})[_0x5277('0x23')](respondWithResult(_0x3b9763,0xc9))[_0x5277('0x46')](handleError(_0x3b9763,null));};exports[_0x5277('0x22')]=function(_0x91b946,_0x5bcf98){if(_0x91b946[_0x5277('0x48')]['id']){delete _0x91b946[_0x5277('0x48')]['id'];}return db[_0x5277('0x2a')][_0x5277('0x45')]({'where':{'id':_0x91b946[_0x5277('0x43')]['id']}})[_0x5277('0x23')](handleEntityNotFound(_0x5bcf98,null))['then'](saveUpdates(_0x91b946[_0x5277('0x48')],null))[_0x5277('0x23')](respondWithResult(_0x5bcf98,null))[_0x5277('0x46')](handleError(_0x5bcf98,null));};exports[_0x5277('0x49')]=function(_0x57df09,_0x2dcba6){return db['FaxTransferReport'][_0x5277('0x45')]({'where':{'id':_0x57df09[_0x5277('0x43')]['id']}})[_0x5277('0x23')](handleEntityNotFound(_0x2dcba6,null))[_0x5277('0x23')](removeEntity(_0x2dcba6,null))[_0x5277('0x46')](handleError(_0x2dcba6,null));};exports['describe']=function(_0x5e6fc2,_0x104e20){return db['FaxTransferReport'][_0x5277('0x4a')]()[_0x5277('0x23')](respondWithResult(_0x104e20,null))[_0x5277('0x46')](handleError(_0x104e20,null));}; \ No newline at end of file +var _0xf8e4=['lodash','squel','crypto','jsforce','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','end','status','json','offset','undefined','count','limit','Content-Range','apply','reject','save','then','destroy','stack','name','send','rawAttributes','key','map','keys','filters','intersection','query','attributes','model','fields','nolimit','sort','pick','where','merge','type','VIRTUAL','filter','options','includeAll','include','FaxTransferReport','findAll','rows','catch','show','params','find','create','body','update','describe','rimraf','zip-dir','moment','mustache','util','path','sox','ejs','fs-extra'];(function(_0x243066,_0x159960){var _0x5341db=function(_0x2f6c4c){while(--_0x2f6c4c){_0x243066['push'](_0x243066['shift']());}};_0x5341db(++_0x159960);}(_0xf8e4,0x8d));var _0x4f8e=function(_0x21b36c,_0x543483){_0x21b36c=_0x21b36c-0x0;var _0x236627=_0xf8e4[_0x21b36c];return _0x236627;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x4f8e('0x0'));var zipdir=require(_0x4f8e('0x1'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0x4f8e('0x2'));var BPromise=require('bluebird');var Mustache=require(_0x4f8e('0x3'));var util=require(_0x4f8e('0x4'));var path=require(_0x4f8e('0x5'));var sox=require(_0x4f8e('0x6'));var csv=require('to-csv');var ejs=require(_0x4f8e('0x7'));var fs=require('fs');var fs_extra=require(_0x4f8e('0x8'));var _=require(_0x4f8e('0x9'));var squel=require(_0x4f8e('0xa'));var crypto=require(_0x4f8e('0xb'));var jsforce=require(_0x4f8e('0xc'));var deskjs=require('desk.js');var toCsv=require(_0x4f8e('0xd'));var querystring=require(_0x4f8e('0xe'));var Papa=require(_0x4f8e('0xf'));var Redis=require(_0x4f8e('0x10'));var authService=require(_0x4f8e('0x11'));var qs=require(_0x4f8e('0x12'));var as=require(_0x4f8e('0x13'));var hardwareService=require(_0x4f8e('0x14'));var logger=require('../../config/logger')(_0x4f8e('0x15'));var utils=require(_0x4f8e('0x16'));var config=require(_0x4f8e('0x17'));var licenseUtil=require(_0x4f8e('0x18'));var db=require(_0x4f8e('0x19'))['db'];function respondWithStatusCode(_0x2b7705,_0x5367b9){_0x5367b9=_0x5367b9||0xcc;return function(_0x3ecd85){if(_0x3ecd85){return _0x2b7705[_0x4f8e('0x1a')](_0x5367b9);}return _0x2b7705['status'](_0x5367b9)[_0x4f8e('0x1b')]();};}function respondWithResult(_0x485261,_0x1363d7){_0x1363d7=_0x1363d7||0xc8;return function(_0x1468fd){if(_0x1468fd){return _0x485261[_0x4f8e('0x1c')](_0x1363d7)[_0x4f8e('0x1d')](_0x1468fd);}};}function respondWithFilteredResult(_0x569c64,_0x15a087){return function(_0x3d484e){if(_0x3d484e){var _0x2aedb2=typeof _0x15a087[_0x4f8e('0x1e')]===_0x4f8e('0x1f')&&typeof _0x15a087['limit']==='undefined';var _0xeec602=_0x3d484e[_0x4f8e('0x20')];var _0x1c9abf=_0x2aedb2?0x0:_0x15a087[_0x4f8e('0x1e')];var _0x3593b4=_0x2aedb2?_0x3d484e['count']:_0x15a087[_0x4f8e('0x1e')]+_0x15a087[_0x4f8e('0x21')];var _0x3ac7cc;if(_0x3593b4>=_0xeec602){_0x3593b4=_0xeec602;_0x3ac7cc=0xc8;}else{_0x3ac7cc=0xce;}_0x569c64[_0x4f8e('0x1c')](_0x3ac7cc);return _0x569c64['set'](_0x4f8e('0x22'),_0x1c9abf+'-'+_0x3593b4+'/'+_0xeec602)[_0x4f8e('0x1d')](_0x3d484e);}return null;};}function patchUpdates(_0x4eaa30){return function(_0x4cbb95){try{jsonpatch[_0x4f8e('0x23')](_0x4cbb95,_0x4eaa30,!![]);}catch(_0x2a9b6d){return BPromise[_0x4f8e('0x24')](_0x2a9b6d);}return _0x4cbb95[_0x4f8e('0x25')]();};}function saveUpdates(_0x44d8ce,_0x27a5ea){return function(_0x4250be){if(_0x4250be){return _0x4250be['update'](_0x44d8ce)[_0x4f8e('0x26')](function(_0x1685d4){return _0x1685d4;});}return null;};}function removeEntity(_0x182cef,_0x34a731){return function(_0x9c8eb0){if(_0x9c8eb0){return _0x9c8eb0[_0x4f8e('0x27')]()['then'](function(){_0x182cef['status'](0xcc)[_0x4f8e('0x1b')]();});}};}function handleEntityNotFound(_0x4c52d0,_0x26ab24){return function(_0x12eada){if(!_0x12eada){_0x4c52d0[_0x4f8e('0x1a')](0x194);}return _0x12eada;};}function handleError(_0x4f6bc4,_0xce9ea4){_0xce9ea4=_0xce9ea4||0x1f4;return function(_0x1969d9){logger['error'](_0x1969d9[_0x4f8e('0x28')]);if(_0x1969d9[_0x4f8e('0x29')]){delete _0x1969d9[_0x4f8e('0x29')];}_0x4f6bc4[_0x4f8e('0x1c')](_0xce9ea4)[_0x4f8e('0x2a')](_0x1969d9);};}exports['index']=function(_0x7e2c02,_0x48ef40){var _0x421686={},_0x491f4d={},_0xa08e2b={'count':0x0,'rows':[]};var _0x4b7c5a=_['map'](db['FaxTransferReport'][_0x4f8e('0x2b')],function(_0x1a1af0){return{'name':_0x1a1af0['fieldName'],'type':_0x1a1af0['type'][_0x4f8e('0x2c')]};});_0x491f4d['model']=_[_0x4f8e('0x2d')](_0x4b7c5a,_0x4f8e('0x29'));_0x491f4d['query']=_[_0x4f8e('0x2e')](_0x7e2c02['query']);_0x491f4d[_0x4f8e('0x2f')]=_[_0x4f8e('0x30')](_0x491f4d['model'],_0x491f4d[_0x4f8e('0x31')]);_0x421686[_0x4f8e('0x32')]=_[_0x4f8e('0x30')](_0x491f4d[_0x4f8e('0x33')],qs[_0x4f8e('0x34')](_0x7e2c02['query'][_0x4f8e('0x34')]));_0x421686[_0x4f8e('0x32')]=_0x421686['attributes']['length']?_0x421686['attributes']:_0x491f4d[_0x4f8e('0x33')];if(!_0x7e2c02[_0x4f8e('0x31')]['hasOwnProperty'](_0x4f8e('0x35'))){_0x421686['limit']=qs[_0x4f8e('0x21')](_0x7e2c02[_0x4f8e('0x31')][_0x4f8e('0x21')]);_0x421686['offset']=qs[_0x4f8e('0x1e')](_0x7e2c02[_0x4f8e('0x31')][_0x4f8e('0x1e')]);}_0x421686['order']=qs[_0x4f8e('0x36')](_0x7e2c02[_0x4f8e('0x31')]['sort']);_0x421686['where']=qs[_0x4f8e('0x2f')](_[_0x4f8e('0x37')](_0x7e2c02['query'],_0x491f4d[_0x4f8e('0x2f')]),_0x4b7c5a);if(_0x7e2c02[_0x4f8e('0x31')]['filter']){_0x421686[_0x4f8e('0x38')]=_[_0x4f8e('0x39')](_0x421686[_0x4f8e('0x38')],{'$or':_[_0x4f8e('0x2d')](_0x4b7c5a,function(_0x357ff3){if(_0x357ff3[_0x4f8e('0x3a')]!==_0x4f8e('0x3b')){var _0x15b0f5={};_0x15b0f5[_0x357ff3[_0x4f8e('0x29')]]={'$like':'%'+_0x7e2c02[_0x4f8e('0x31')][_0x4f8e('0x3c')]+'%'};return _0x15b0f5;}})});}_0x421686=_[_0x4f8e('0x39')]({},_0x421686,_0x7e2c02[_0x4f8e('0x3d')]);var _0x46a9e7={'where':_0x421686[_0x4f8e('0x38')]};return db['FaxTransferReport'][_0x4f8e('0x20')](_0x46a9e7)[_0x4f8e('0x26')](function(_0x1b3461){_0xa08e2b[_0x4f8e('0x20')]=_0x1b3461;if(_0x7e2c02[_0x4f8e('0x31')][_0x4f8e('0x3e')]){_0x421686[_0x4f8e('0x3f')]=[{'all':!![]}];}return db[_0x4f8e('0x40')][_0x4f8e('0x41')](_0x421686);})['then'](function(_0x1ee18d){_0xa08e2b[_0x4f8e('0x42')]=_0x1ee18d;return _0xa08e2b;})[_0x4f8e('0x26')](respondWithFilteredResult(_0x48ef40,_0x421686))[_0x4f8e('0x43')](handleError(_0x48ef40,null));};exports[_0x4f8e('0x44')]=function(_0x3902b3,_0xdc6250){var _0x27822b={'raw':!![],'where':{'id':_0x3902b3[_0x4f8e('0x45')]['id']}},_0x2e28e1={};_0x2e28e1['model']=_['keys'](db[_0x4f8e('0x40')]['rawAttributes']);_0x2e28e1[_0x4f8e('0x31')]=_[_0x4f8e('0x2e')](_0x3902b3['query']);_0x2e28e1[_0x4f8e('0x2f')]=_[_0x4f8e('0x30')](_0x2e28e1['model'],_0x2e28e1[_0x4f8e('0x31')]);_0x27822b[_0x4f8e('0x32')]=_[_0x4f8e('0x30')](_0x2e28e1[_0x4f8e('0x33')],qs[_0x4f8e('0x34')](_0x3902b3[_0x4f8e('0x31')][_0x4f8e('0x34')]));_0x27822b[_0x4f8e('0x32')]=_0x27822b[_0x4f8e('0x32')]['length']?_0x27822b[_0x4f8e('0x32')]:_0x2e28e1[_0x4f8e('0x33')];if(_0x3902b3[_0x4f8e('0x31')][_0x4f8e('0x3e')]){_0x27822b['include']=[{'all':!![]}];}_0x27822b=_[_0x4f8e('0x39')]({},_0x27822b,_0x3902b3[_0x4f8e('0x3d')]);return db[_0x4f8e('0x40')][_0x4f8e('0x46')](_0x27822b)[_0x4f8e('0x26')](handleEntityNotFound(_0xdc6250,null))[_0x4f8e('0x26')](respondWithResult(_0xdc6250,null))[_0x4f8e('0x43')](handleError(_0xdc6250,null));};exports['create']=function(_0x2b3cf4,_0x2fd112){return db[_0x4f8e('0x40')][_0x4f8e('0x47')](_0x2b3cf4[_0x4f8e('0x48')],{})[_0x4f8e('0x26')](respondWithResult(_0x2fd112,0xc9))[_0x4f8e('0x43')](handleError(_0x2fd112,null));};exports[_0x4f8e('0x49')]=function(_0x58711b,_0x12c6f2){if(_0x58711b[_0x4f8e('0x48')]['id']){delete _0x58711b[_0x4f8e('0x48')]['id'];}return db['FaxTransferReport'][_0x4f8e('0x46')]({'where':{'id':_0x58711b['params']['id']}})[_0x4f8e('0x26')](handleEntityNotFound(_0x12c6f2,null))[_0x4f8e('0x26')](saveUpdates(_0x58711b[_0x4f8e('0x48')],null))['then'](respondWithResult(_0x12c6f2,null))[_0x4f8e('0x43')](handleError(_0x12c6f2,null));};exports[_0x4f8e('0x27')]=function(_0x4f78e5,_0x54ea0d){return db[_0x4f8e('0x40')][_0x4f8e('0x46')]({'where':{'id':_0x4f78e5[_0x4f8e('0x45')]['id']}})[_0x4f8e('0x26')](handleEntityNotFound(_0x54ea0d,null))[_0x4f8e('0x26')](removeEntity(_0x54ea0d,null))[_0x4f8e('0x43')](handleError(_0x54ea0d,null));};exports['describe']=function(_0x5a11d5,_0x5dbce1){return db[_0x4f8e('0x40')][_0x4f8e('0x4a')]()[_0x4f8e('0x26')](respondWithResult(_0x5dbce1,null))['catch'](handleError(_0x5dbce1,null));}; \ No newline at end of file diff --git a/server/api/faxTransferReport/faxTransferReport.model.js b/server/api/faxTransferReport/faxTransferReport.model.js index a97fc24..3cd5f51 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 _0xad3a=['./faxTransferReport.attributes','exports','FaxTransferReport','report_fax_transfer','uniqueid','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment'];(function(_0x234563,_0x1b724c){var _0x33334e=function(_0x40321d){while(--_0x40321d){_0x234563['push'](_0x234563['shift']());}};_0x33334e(++_0x1b724c);}(_0xad3a,0x13d));var _0xaad3=function(_0x243217,_0x522951){_0x243217=_0x243217-0x0;var _0x478029=_0xad3a[_0x243217];return _0x478029;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0xaad3('0x0'))(_0xaad3('0x1'));var moment=require(_0xaad3('0x2'));var BPromise=require(_0xaad3('0x3'));var rp=require(_0xaad3('0x4'));var fs=require('fs');var path=require(_0xaad3('0x5'));var rimraf=require(_0xaad3('0x6'));var config=require(_0xaad3('0x7'));var attributes=require(_0xaad3('0x8'));module[_0xaad3('0x9')]=function(_0x277700,_0x533571){return _0x277700['define'](_0xaad3('0xa'),attributes,{'tableName':_0xaad3('0xb'),'paranoid':![],'indexes':[{'name':_0xaad3('0xc'),'fields':[_0xaad3('0xc')]}],'timestamps':!![]});}; \ No newline at end of file +var _0x80c4=['request-promise','path','../../config/environment','./faxTransferReport.attributes','exports','define','FaxTransferReport','report_fax_transfer','uniqueid','lodash','../../config/logger','api','moment','bluebird'];(function(_0x182394,_0xc13ead){var _0x23a459=function(_0x332ac7){while(--_0x332ac7){_0x182394['push'](_0x182394['shift']());}};_0x23a459(++_0xc13ead);}(_0x80c4,0xa3));var _0x480c=function(_0x492a99,_0x57df8f){_0x492a99=_0x492a99-0x0;var _0x533d65=_0x80c4[_0x492a99];return _0x533d65;};'use strict';var _=require(_0x480c('0x0'));var util=require('util');var logger=require(_0x480c('0x1'))(_0x480c('0x2'));var moment=require(_0x480c('0x3'));var BPromise=require(_0x480c('0x4'));var rp=require(_0x480c('0x5'));var fs=require('fs');var path=require(_0x480c('0x6'));var rimraf=require('rimraf');var config=require(_0x480c('0x7'));var attributes=require(_0x480c('0x8'));module[_0x480c('0x9')]=function(_0x1813b6,_0x9805b5){return _0x1813b6[_0x480c('0xa')](_0x480c('0xb'),attributes,{'tableName':_0x480c('0xc'),'paranoid':![],'indexes':[{'name':_0x480c('0xd'),'fields':['uniqueid']}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/faxTransferReport/faxTransferReport.rpc.js b/server/api/faxTransferReport/faxTransferReport.rpc.js index 80cb2cf..ea8b74c 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 _0xecff=['bluebird','randomstring','../../mysqldb','../../config/utils','rpc','../../config/environment','client','http','request','then','FaxTransferReport,\x20%s,\x20%s','debug','FaxTransferReport,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','message','result','util'];(function(_0x16f88a,_0x2948fe){var _0x178cb7=function(_0x58cde4){while(--_0x58cde4){_0x16f88a['push'](_0x16f88a['shift']());}};_0x178cb7(++_0x2948fe);}(_0xecff,0xf6));var _0xfecf=function(_0xce0c61,_0x3769c0){_0xce0c61=_0xce0c61-0x0;var _0x36d93c=_0xecff[_0xce0c61];return _0x36d93c;};'use strict';var _=require('lodash');var util=require(_0xfecf('0x0'));var moment=require('moment');var BPromise=require(_0xfecf('0x1'));var rs=require(_0xfecf('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xfecf('0x3'))['db'];var utils=require(_0xfecf('0x4'));var logger=require('../../config/logger')(_0xfecf('0x5'));var config=require(_0xfecf('0x6'));var jayson=require('jayson/promise');var client=jayson[_0xfecf('0x7')][_0xfecf('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x8c2113,_0x3da3c1,_0x1d622b){return new BPromise(function(_0x56506c,_0x1d6584){return client[_0xfecf('0x9')](_0x8c2113,_0x1d622b)[_0xfecf('0xa')](function(_0x1bd325){logger['info'](_0xfecf('0xb'),_0x3da3c1,'request\x20sent');logger[_0xfecf('0xc')](_0xfecf('0xd'),_0x3da3c1,_0xfecf('0xe'),JSON[_0xfecf('0xf')](_0x1bd325));if(_0x1bd325[_0xfecf('0x10')]){if(_0x1bd325[_0xfecf('0x10')]['code']===0x1f4){logger['error'](_0xfecf('0xb'),_0x3da3c1,_0x1bd325[_0xfecf('0x10')][_0xfecf('0x11')]);return _0x1d6584(_0x1bd325[_0xfecf('0x10')][_0xfecf('0x11')]);}logger[_0xfecf('0x10')](_0xfecf('0xb'),_0x3da3c1,_0x1bd325[_0xfecf('0x10')][_0xfecf('0x11')]);return _0x56506c(_0x1bd325[_0xfecf('0x10')]['message']);}else{logger['info'](_0xfecf('0xb'),_0x3da3c1,_0xfecf('0xe'));_0x56506c(_0x1bd325[_0xfecf('0x12')]['message']);}})['catch'](function(_0x1c4bb6){logger[_0xfecf('0x10')](_0xfecf('0xb'),_0x3da3c1,_0x1c4bb6);_0x1d6584(_0x1c4bb6);});});} \ No newline at end of file +var _0xdbc4=['rpc','../../config/environment','client','http','request','then','info','FaxTransferReport,\x20%s,\x20%s','request\x20sent','FaxTransferReport,\x20%s,\x20%s,\x20%s','error','code','message','result','lodash','moment','bluebird','randomstring','ioredis','../../config/utils'];(function(_0xfae23b,_0x2be4ba){var _0x200640=function(_0x4ae258){while(--_0x4ae258){_0xfae23b['push'](_0xfae23b['shift']());}};_0x200640(++_0x2be4ba);}(_0xdbc4,0x18a));var _0x4dbc=function(_0x3e85ab,_0x1e7d04){_0x3e85ab=_0x3e85ab-0x0;var _0x49147d=_0xdbc4[_0x3e85ab];return _0x49147d;};'use strict';var _=require(_0x4dbc('0x0'));var util=require('util');var moment=require(_0x4dbc('0x1'));var BPromise=require(_0x4dbc('0x2'));var rs=require(_0x4dbc('0x3'));var fs=require('fs');var Redis=require(_0x4dbc('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x4dbc('0x5'));var logger=require('../../config/logger')(_0x4dbc('0x6'));var config=require(_0x4dbc('0x7'));var jayson=require('jayson/promise');var client=jayson[_0x4dbc('0x8')][_0x4dbc('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x316e07,_0x1b4d51,_0x365248){return new BPromise(function(_0x5caa15,_0x17115e){return client[_0x4dbc('0xa')](_0x316e07,_0x365248)[_0x4dbc('0xb')](function(_0x48cc28){logger[_0x4dbc('0xc')](_0x4dbc('0xd'),_0x1b4d51,_0x4dbc('0xe'));logger['debug'](_0x4dbc('0xf'),_0x1b4d51,_0x4dbc('0xe'),JSON['stringify'](_0x48cc28));if(_0x48cc28[_0x4dbc('0x10')]){if(_0x48cc28[_0x4dbc('0x10')][_0x4dbc('0x11')]===0x1f4){logger[_0x4dbc('0x10')](_0x4dbc('0xd'),_0x1b4d51,_0x48cc28['error']['message']);return _0x17115e(_0x48cc28[_0x4dbc('0x10')][_0x4dbc('0x12')]);}logger[_0x4dbc('0x10')](_0x4dbc('0xd'),_0x1b4d51,_0x48cc28[_0x4dbc('0x10')][_0x4dbc('0x12')]);return _0x5caa15(_0x48cc28[_0x4dbc('0x10')][_0x4dbc('0x12')]);}else{logger[_0x4dbc('0xc')](_0x4dbc('0xd'),_0x1b4d51,_0x4dbc('0xe'));_0x5caa15(_0x48cc28[_0x4dbc('0x13')]['message']);}})['catch'](function(_0x31cedb){logger[_0x4dbc('0x10')](_0x4dbc('0xd'),_0x1b4d51,_0x31cedb);_0x17115e(_0x31cedb);});});} \ No newline at end of file diff --git a/server/api/faxTransferReport/index.js b/server/api/faxTransferReport/index.js index 1afcac4..f284170 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 _0xbf8d=['path','connect-timeout','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./faxTransferReport.controller','get','isAuthenticated','index','/describe','describe','/:id','show','post','create','put','update','delete','destroy','exports'];(function(_0x3b96cf,_0x1592f2){var _0x2e315a=function(_0x21fa50){while(--_0x21fa50){_0x3b96cf['push'](_0x3b96cf['shift']());}};_0x2e315a(++_0x1592f2);}(_0xbf8d,0x13b));var _0xdbf8=function(_0x136659,_0x661891){_0x136659=_0x136659-0x0;var _0x192cd9=_0xbf8d[_0x136659];return _0x192cd9;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0xdbf8('0x0'));var timeout=require(_0xdbf8('0x1'));var express=require('express');var router=express['Router']();var fs_extra=require(_0xdbf8('0x2'));var auth=require(_0xdbf8('0x3'));var interaction=require(_0xdbf8('0x4'));var config=require(_0xdbf8('0x5'));var controller=require(_0xdbf8('0x6'));router[_0xdbf8('0x7')]('/',auth[_0xdbf8('0x8')](),controller[_0xdbf8('0x9')]);router[_0xdbf8('0x7')](_0xdbf8('0xa'),auth[_0xdbf8('0x8')](),controller[_0xdbf8('0xb')]);router[_0xdbf8('0x7')](_0xdbf8('0xc'),auth[_0xdbf8('0x8')](),controller[_0xdbf8('0xd')]);router[_0xdbf8('0xe')]('/',auth[_0xdbf8('0x8')](),controller[_0xdbf8('0xf')]);router[_0xdbf8('0x10')](_0xdbf8('0xc'),auth[_0xdbf8('0x8')](),controller[_0xdbf8('0x11')]);router[_0xdbf8('0x12')](_0xdbf8('0xc'),auth['isAuthenticated'](),controller[_0xdbf8('0x13')]);module[_0xdbf8('0x14')]=router; \ No newline at end of file +var _0xd03b=['destroy','exports','multer','util','path','express','fs-extra','../../components/auth/service','../../components/interaction/service','./faxTransferReport.controller','isAuthenticated','get','/describe','/:id','show','post','put'];(function(_0x5bef3a,_0x50e39c){var _0x27e79f=function(_0x4c0b4b){while(--_0x4c0b4b){_0x5bef3a['push'](_0x5bef3a['shift']());}};_0x27e79f(++_0x50e39c);}(_0xd03b,0xac));var _0xbd03=function(_0x42274e,_0x29996c){_0x42274e=_0x42274e-0x0;var _0x37fcc5=_0xd03b[_0x42274e];return _0x37fcc5;};'use strict';var multer=require(_0xbd03('0x0'));var util=require(_0xbd03('0x1'));var path=require(_0xbd03('0x2'));var timeout=require('connect-timeout');var express=require(_0xbd03('0x3'));var router=express['Router']();var fs_extra=require(_0xbd03('0x4'));var auth=require(_0xbd03('0x5'));var interaction=require(_0xbd03('0x6'));var config=require('../../config/environment');var controller=require(_0xbd03('0x7'));router['get']('/',auth[_0xbd03('0x8')](),controller['index']);router[_0xbd03('0x9')](_0xbd03('0xa'),auth['isAuthenticated'](),controller['describe']);router[_0xbd03('0x9')](_0xbd03('0xb'),auth[_0xbd03('0x8')](),controller[_0xbd03('0xc')]);router[_0xbd03('0xd')]('/',auth['isAuthenticated'](),controller['create']);router[_0xbd03('0xe')](_0xbd03('0xb'),auth[_0xbd03('0x8')](),controller['update']);router['delete'](_0xbd03('0xb'),auth[_0xbd03('0x8')](),controller[_0xbd03('0xf')]);module[_0xbd03('0x10')]=router; \ No newline at end of file diff --git a/server/api/intDeskAccount/index.js b/server/api/intDeskAccount/index.js index bda7fa7..8bb642b 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 _0xbf32=['/:id','/:id/configurations','post','create','addConfiguration','delete','destroy','exports','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./intDeskAccount.controller','get','isAuthenticated'];(function(_0x2a574b,_0x548a73){var _0x2e4ed3=function(_0x1ea83a){while(--_0x1ea83a){_0x2a574b['push'](_0x2a574b['shift']());}};_0x2e4ed3(++_0x548a73);}(_0xbf32,0x88));var _0x2bf3=function(_0x23f713,_0x192541){_0x23f713=_0x23f713-0x0;var _0x47ad32=_0xbf32[_0x23f713];return _0x47ad32;};'use strict';var multer=require('multer');var util=require('util');var path=require('path');var timeout=require('connect-timeout');var express=require(_0x2bf3('0x0'));var router=express['Router']();var fs_extra=require(_0x2bf3('0x1'));var auth=require(_0x2bf3('0x2'));var interaction=require(_0x2bf3('0x3'));var config=require(_0x2bf3('0x4'));var controller=require(_0x2bf3('0x5'));router[_0x2bf3('0x6')]('/',auth[_0x2bf3('0x7')](),controller['index']);router[_0x2bf3('0x6')](_0x2bf3('0x8'),auth[_0x2bf3('0x7')](),controller['show']);router[_0x2bf3('0x6')](_0x2bf3('0x9'),auth['isAuthenticated'](),controller['getConfigurations']);router[_0x2bf3('0x6')]('/:id/fields',auth[_0x2bf3('0x7')](),controller['getFields']);router[_0x2bf3('0xa')]('/',auth['isAuthenticated'](),controller[_0x2bf3('0xb')]);router[_0x2bf3('0xa')](_0x2bf3('0x9'),auth[_0x2bf3('0x7')](),controller[_0x2bf3('0xc')]);router['put'](_0x2bf3('0x8'),auth[_0x2bf3('0x7')](),controller['update']);router[_0x2bf3('0xd')](_0x2bf3('0x8'),auth[_0x2bf3('0x7')](),controller[_0x2bf3('0xe')]);module[_0x2bf3('0xf')]=router; \ No newline at end of file +var _0x64d1=['getConfigurations','getFields','post','create','addConfiguration','put','update','delete','destroy','exports','multer','util','connect-timeout','express','Router','../../components/interaction/service','./intDeskAccount.controller','get','index','/:id','show','/:id/configurations','isAuthenticated'];(function(_0x1ec773,_0x10fae9){var _0x2053c9=function(_0x26a6e9){while(--_0x26a6e9){_0x1ec773['push'](_0x1ec773['shift']());}};_0x2053c9(++_0x10fae9);}(_0x64d1,0x17a));var _0x164d=function(_0x382a62,_0x1baa5e){_0x382a62=_0x382a62-0x0;var _0x490a25=_0x64d1[_0x382a62];return _0x490a25;};'use strict';var multer=require(_0x164d('0x0'));var util=require(_0x164d('0x1'));var path=require('path');var timeout=require(_0x164d('0x2'));var express=require(_0x164d('0x3'));var router=express[_0x164d('0x4')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0x164d('0x5'));var config=require('../../config/environment');var controller=require(_0x164d('0x6'));router[_0x164d('0x7')]('/',auth['isAuthenticated'](),controller[_0x164d('0x8')]);router[_0x164d('0x7')](_0x164d('0x9'),auth['isAuthenticated'](),controller[_0x164d('0xa')]);router['get'](_0x164d('0xb'),auth[_0x164d('0xc')](),controller[_0x164d('0xd')]);router['get']('/:id/fields',auth[_0x164d('0xc')](),controller[_0x164d('0xe')]);router[_0x164d('0xf')]('/',auth[_0x164d('0xc')](),controller[_0x164d('0x10')]);router['post'](_0x164d('0xb'),auth['isAuthenticated'](),controller[_0x164d('0x11')]);router[_0x164d('0x12')]('/:id',auth['isAuthenticated'](),controller[_0x164d('0x13')]);router[_0x164d('0x14')]('/:id',auth[_0x164d('0xc')](),controller[_0x164d('0x15')]);module[_0x164d('0x16')]=router; \ No newline at end of file diff --git a/server/api/intDeskAccount/intDeskAccount.attributes.js b/server/api/intDeskAccount/intDeskAccount.attributes.js index fa549db..debcfd6 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 _0xe352=['newTab','STRING','basic','ENUM','integrationTab'];(function(_0x7f5eb5,_0x124f16){var _0x4eff06=function(_0x4eb444){while(--_0x4eb444){_0x7f5eb5['push'](_0x7f5eb5['shift']());}};_0x4eff06(++_0x124f16);}(_0xe352,0x1aa));var _0x2e35=function(_0x1373c8,_0x2dea8b){_0x1373c8=_0x1373c8-0x0;var _0x5c1ce5=_0xe352[_0x1373c8];return _0x5c1ce5;};'use strict';var Sequelize=require('sequelize');module['exports']={'name':{'type':Sequelize[_0x2e35('0x0')]},'description':{'type':Sequelize[_0x2e35('0x0')]},'username':{'type':Sequelize[_0x2e35('0x0')]},'remoteUri':{'type':Sequelize[_0x2e35('0x0')]},'authType':{'type':Sequelize['ENUM']('basic'),'defaultValue':_0x2e35('0x1')},'password':{'type':Sequelize[_0x2e35('0x0')]},'consumerKey':{'type':Sequelize[_0x2e35('0x0')]},'consumerSecret':{'type':Sequelize['STRING']},'token':{'type':Sequelize[_0x2e35('0x0')]},'tokenSecret':{'type':Sequelize[_0x2e35('0x0')]},'serverUrl':{'type':Sequelize[_0x2e35('0x0')],'allowNull':![]},'type':{'type':Sequelize[_0x2e35('0x2')](_0x2e35('0x3'),_0x2e35('0x4')),'defaultValue':_0x2e35('0x3')}}; \ No newline at end of file +var _0xdc3c=['integrationTab','newTab','sequelize','exports','STRING','ENUM','basic'];(function(_0x20040b,_0x440859){var _0x4a2165=function(_0x27bb84){while(--_0x27bb84){_0x20040b['push'](_0x20040b['shift']());}};_0x4a2165(++_0x440859);}(_0xdc3c,0xa3));var _0xcdc3=function(_0x5a1ff6,_0x5d387f){_0x5a1ff6=_0x5a1ff6-0x0;var _0x5d4813=_0xdc3c[_0x5a1ff6];return _0x5d4813;};'use strict';var Sequelize=require(_0xcdc3('0x0'));module[_0xcdc3('0x1')]={'name':{'type':Sequelize[_0xcdc3('0x2')]},'description':{'type':Sequelize[_0xcdc3('0x2')]},'username':{'type':Sequelize[_0xcdc3('0x2')]},'remoteUri':{'type':Sequelize['STRING']},'authType':{'type':Sequelize[_0xcdc3('0x3')](_0xcdc3('0x4')),'defaultValue':_0xcdc3('0x4')},'password':{'type':Sequelize[_0xcdc3('0x2')]},'consumerKey':{'type':Sequelize[_0xcdc3('0x2')]},'consumerSecret':{'type':Sequelize[_0xcdc3('0x2')]},'token':{'type':Sequelize[_0xcdc3('0x2')]},'tokenSecret':{'type':Sequelize[_0xcdc3('0x2')]},'serverUrl':{'type':Sequelize[_0xcdc3('0x2')],'allowNull':![]},'type':{'type':Sequelize[_0xcdc3('0x3')](_0xcdc3('0x5'),_0xcdc3('0x6')),'defaultValue':_0xcdc3('0x5')}}; \ No newline at end of file diff --git a/server/api/intDeskAccount/intDeskAccount.controller.js b/server/api/intDeskAccount/intDeskAccount.controller.js index 3d0610d..6d71db8 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 _0x93f0=['Wrong\x20credentials','statusCode','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','../../config/utils','../../config/license/util','../../mysqldb','../../components/integrations/configuration','status','end','offset','undefined','count','set','Content-Range','json','reject','save','then','destroy','error','stack','name','send','index','map','DeskAccount','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes','length','nolimit','limit','order','sort','pick','filter','where','options','findAll','rows','catch','show','params','fields','includeAll','merge','create','body','find','getConfigurations','findOne','DeskConfiguration','hasOwnProperty','addConfiguration','AccountId','getSubjects','channel','Descriptions','getDescriptions','Subjects','DeskField','getFields','priority','remoteUri','username','password','consumerKey','consumerSecret','token','tokenSecret','slice','substring','lastIndexOf','GET','format','%s/custom_fields','application/json','authType','basic','Authorization','Basic\x20%s','%s:%s','toString','base64','concat','_embedded','active','label','test','getFields,\x20%s,\x20%s,\x20%s','stringify'];(function(_0x58b142,_0x142ba9){var _0x28acf7=function(_0x3d4011){while(--_0x3d4011){_0x58b142['push'](_0x58b142['shift']());}};_0x28acf7(++_0x142ba9);}(_0x93f0,0x1e2));var _0x093f=function(_0x531f0e,_0x284d79){_0x531f0e=_0x531f0e-0x0;var _0x1f68b1=_0x93f0[_0x531f0e];return _0x1f68b1;};'use strict';var emlformat=require(_0x093f('0x0'));var rimraf=require(_0x093f('0x1'));var zipdir=require(_0x093f('0x2'));var jsonpatch=require(_0x093f('0x3'));var rp=require(_0x093f('0x4'));var moment=require('moment');var BPromise=require(_0x093f('0x5'));var Mustache=require(_0x093f('0x6'));var util=require(_0x093f('0x7'));var path=require(_0x093f('0x8'));var sox=require(_0x093f('0x9'));var csv=require(_0x093f('0xa'));var ejs=require(_0x093f('0xb'));var fs=require('fs');var fs_extra=require(_0x093f('0xc'));var _=require(_0x093f('0xd'));var squel=require(_0x093f('0xe'));var crypto=require(_0x093f('0xf'));var jsforce=require(_0x093f('0x10'));var deskjs=require('desk.js');var toCsv=require(_0x093f('0xa'));var querystring=require('querystring');var Papa=require(_0x093f('0x11'));var Redis=require(_0x093f('0x12'));var authService=require(_0x093f('0x13'));var qs=require(_0x093f('0x14'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x093f('0x15'));var logger=require(_0x093f('0x16'))('api');var utils=require(_0x093f('0x17'));var config=require('../../config/environment');var licenseUtil=require(_0x093f('0x18'));var db=require(_0x093f('0x19'))['db'];var integrations=require(_0x093f('0x1a'));function respondWithStatusCode(_0x5dd0c7,_0x561049){_0x561049=_0x561049||0xcc;return function(_0xae32bc){if(_0xae32bc){return _0x5dd0c7['sendStatus'](_0x561049);}return _0x5dd0c7[_0x093f('0x1b')](_0x561049)[_0x093f('0x1c')]();};}function respondWithResult(_0x5c627b,_0x218e13){_0x218e13=_0x218e13||0xc8;return function(_0x294284){if(_0x294284){return _0x5c627b['status'](_0x218e13)['json'](_0x294284);}};}function respondWithFilteredResult(_0x493d6b,_0x3b4cd7){return function(_0x10aa84){if(_0x10aa84){var _0x1eafe2=typeof _0x3b4cd7[_0x093f('0x1d')]===_0x093f('0x1e')&&typeof _0x3b4cd7['limit']===_0x093f('0x1e');var _0x4f231f=_0x10aa84['count'];var _0x38e0c9=_0x1eafe2?0x0:_0x3b4cd7[_0x093f('0x1d')];var _0x40e81e=_0x1eafe2?_0x10aa84[_0x093f('0x1f')]:_0x3b4cd7['offset']+_0x3b4cd7['limit'];var _0x1e7c49;if(_0x40e81e>=_0x4f231f){_0x40e81e=_0x4f231f;_0x1e7c49=0xc8;}else{_0x1e7c49=0xce;}_0x493d6b[_0x093f('0x1b')](_0x1e7c49);return _0x493d6b[_0x093f('0x20')](_0x093f('0x21'),_0x38e0c9+'-'+_0x40e81e+'/'+_0x4f231f)[_0x093f('0x22')](_0x10aa84);}return null;};}function patchUpdates(_0x540aa0){return function(_0x2eb3c3){try{jsonpatch['apply'](_0x2eb3c3,_0x540aa0,!![]);}catch(_0x2b4bd8){return BPromise[_0x093f('0x23')](_0x2b4bd8);}return _0x2eb3c3[_0x093f('0x24')]();};}function saveUpdates(_0x38e0db,_0x3ce1ab){return function(_0x553589){if(_0x553589){return _0x553589['update'](_0x38e0db)[_0x093f('0x25')](function(_0xe5eb54){return _0xe5eb54;});}return null;};}function removeEntity(_0x275ff9,_0x26587c){return function(_0xbaa4ae){if(_0xbaa4ae){return _0xbaa4ae[_0x093f('0x26')]()[_0x093f('0x25')](function(){_0x275ff9[_0x093f('0x1b')](0xcc)[_0x093f('0x1c')]();});}};}function handleEntityNotFound(_0x477bf7,_0x2e1120){return function(_0x234cd9){if(!_0x234cd9){_0x477bf7['sendStatus'](0x194);}return _0x234cd9;};}function handleError(_0x1f29cb,_0x14fa2f){_0x14fa2f=_0x14fa2f||0x1f4;return function(_0x1dd446){logger[_0x093f('0x27')](_0x1dd446[_0x093f('0x28')]);if(_0x1dd446[_0x093f('0x29')]){delete _0x1dd446['name'];}_0x1f29cb[_0x093f('0x1b')](_0x14fa2f)[_0x093f('0x2a')](_0x1dd446);};}exports[_0x093f('0x2b')]=function(_0x28a19b,_0x322134){var _0x84df92={},_0x20002e={},_0x353e3e={'count':0x0,'rows':[]};var _0x318f2d=_[_0x093f('0x2c')](db[_0x093f('0x2d')][_0x093f('0x2e')],function(_0x30ac99){return{'name':_0x30ac99[_0x093f('0x2f')],'type':_0x30ac99[_0x093f('0x30')][_0x093f('0x31')]};});_0x20002e[_0x093f('0x32')]=_[_0x093f('0x2c')](_0x318f2d,_0x093f('0x29'));_0x20002e[_0x093f('0x33')]=_[_0x093f('0x34')](_0x28a19b[_0x093f('0x33')]);_0x20002e[_0x093f('0x35')]=_[_0x093f('0x36')](_0x20002e[_0x093f('0x32')],_0x20002e[_0x093f('0x33')]);_0x84df92[_0x093f('0x37')]=_['intersection'](_0x20002e['model'],qs['fields'](_0x28a19b['query']['fields']));_0x84df92[_0x093f('0x37')]=_0x84df92[_0x093f('0x37')][_0x093f('0x38')]?_0x84df92['attributes']:_0x20002e[_0x093f('0x32')];if(!_0x28a19b[_0x093f('0x33')]['hasOwnProperty'](_0x093f('0x39'))){_0x84df92['limit']=qs[_0x093f('0x3a')](_0x28a19b[_0x093f('0x33')][_0x093f('0x3a')]);_0x84df92[_0x093f('0x1d')]=qs[_0x093f('0x1d')](_0x28a19b[_0x093f('0x33')][_0x093f('0x1d')]);}_0x84df92[_0x093f('0x3b')]=qs[_0x093f('0x3c')](_0x28a19b[_0x093f('0x33')][_0x093f('0x3c')]);_0x84df92['where']=qs[_0x093f('0x35')](_[_0x093f('0x3d')](_0x28a19b[_0x093f('0x33')],_0x20002e[_0x093f('0x35')]),_0x318f2d);if(_0x28a19b[_0x093f('0x33')][_0x093f('0x3e')]){_0x84df92['where']=_['merge'](_0x84df92[_0x093f('0x3f')],{'$or':_['map'](_0x318f2d,function(_0x36e4dd){if(_0x36e4dd[_0x093f('0x30')]!=='VIRTUAL'){var _0x13d39f={};_0x13d39f[_0x36e4dd['name']]={'$like':'%'+_0x28a19b[_0x093f('0x33')][_0x093f('0x3e')]+'%'};return _0x13d39f;}})});}_0x84df92=_['merge']({},_0x84df92,_0x28a19b[_0x093f('0x40')]);var _0x8daa02={'where':_0x84df92['where']};return db['DeskAccount']['count'](_0x8daa02)[_0x093f('0x25')](function(_0x527d80){_0x353e3e[_0x093f('0x1f')]=_0x527d80;if(_0x28a19b['query']['includeAll']){_0x84df92['include']=[{'all':!![]}];}return db['DeskAccount'][_0x093f('0x41')](_0x84df92);})[_0x093f('0x25')](function(_0x969c42){_0x353e3e[_0x093f('0x42')]=_0x969c42;return _0x353e3e;})['then'](respondWithFilteredResult(_0x322134,_0x84df92))[_0x093f('0x43')](handleError(_0x322134,null));};exports[_0x093f('0x44')]=function(_0x54ee6,_0x484b1c){var _0x54c77c={'raw':![],'where':{'id':_0x54ee6[_0x093f('0x45')]['id']}},_0x5c8ae8={};_0x5c8ae8[_0x093f('0x32')]=_[_0x093f('0x34')](db[_0x093f('0x2d')][_0x093f('0x2e')]);_0x5c8ae8[_0x093f('0x33')]=_[_0x093f('0x34')](_0x54ee6['query']);_0x5c8ae8['filters']=_[_0x093f('0x36')](_0x5c8ae8[_0x093f('0x32')],_0x5c8ae8[_0x093f('0x33')]);_0x54c77c[_0x093f('0x37')]=_['intersection'](_0x5c8ae8[_0x093f('0x32')],qs[_0x093f('0x46')](_0x54ee6[_0x093f('0x33')]['fields']));_0x54c77c[_0x093f('0x37')]=_0x54c77c['attributes'][_0x093f('0x38')]?_0x54c77c['attributes']:_0x5c8ae8[_0x093f('0x32')];if(_0x54ee6[_0x093f('0x33')][_0x093f('0x47')]){_0x54c77c['include']=[{'all':!![]}];}_0x54c77c=_[_0x093f('0x48')]({},_0x54c77c,_0x54ee6[_0x093f('0x40')]);return db[_0x093f('0x2d')]['find'](_0x54c77c)['then'](handleEntityNotFound(_0x484b1c,null))[_0x093f('0x25')](respondWithResult(_0x484b1c,null))[_0x093f('0x43')](handleError(_0x484b1c,null));};exports[_0x093f('0x49')]=function(_0x5469d1,_0x1c8ab0){return db[_0x093f('0x2d')][_0x093f('0x49')](_0x5469d1['body'],{})[_0x093f('0x25')](respondWithResult(_0x1c8ab0,0xc9))[_0x093f('0x43')](handleError(_0x1c8ab0,null));};exports['update']=function(_0x456bd4,_0x3ba1d8){if(_0x456bd4['body']['id']){delete _0x456bd4[_0x093f('0x4a')]['id'];}return db[_0x093f('0x2d')][_0x093f('0x4b')]({'where':{'id':_0x456bd4[_0x093f('0x45')]['id']}})['then'](handleEntityNotFound(_0x3ba1d8,null))[_0x093f('0x25')](saveUpdates(_0x456bd4[_0x093f('0x4a')],null))[_0x093f('0x25')](respondWithResult(_0x3ba1d8,null))['catch'](handleError(_0x3ba1d8,null));};exports[_0x093f('0x26')]=function(_0xb9c647,_0x51eb01){return db[_0x093f('0x2d')][_0x093f('0x4b')]({'where':{'id':_0xb9c647[_0x093f('0x45')]['id']}})[_0x093f('0x25')](handleEntityNotFound(_0x51eb01,null))['then'](removeEntity(_0x51eb01,null))[_0x093f('0x43')](handleError(_0x51eb01,null));};exports[_0x093f('0x4c')]=function(_0x4f82e4,_0x1a898f,_0x53d83e){var _0x4c3394={};var _0x42c9df={};var _0x398e23;var _0x257efa;return db[_0x093f('0x2d')][_0x093f('0x4d')]({'where':{'id':_0x4f82e4[_0x093f('0x45')]['id']}})[_0x093f('0x25')](handleEntityNotFound(_0x1a898f,null))[_0x093f('0x25')](function(_0x334ed0){if(_0x334ed0){_0x398e23=_0x334ed0;_0x42c9df[_0x093f('0x32')]=_[_0x093f('0x34')](db[_0x093f('0x4e')][_0x093f('0x2e')]);_0x42c9df[_0x093f('0x33')]=_[_0x093f('0x34')](_0x4f82e4[_0x093f('0x33')]);_0x42c9df[_0x093f('0x35')]=_['intersection'](_0x42c9df['model'],_0x42c9df[_0x093f('0x33')]);_0x4c3394[_0x093f('0x37')]=_[_0x093f('0x36')](_0x42c9df['model'],qs[_0x093f('0x46')](_0x4f82e4[_0x093f('0x33')][_0x093f('0x46')]));_0x4c3394['attributes']=_0x4c3394['attributes'][_0x093f('0x38')]?_0x4c3394[_0x093f('0x37')]:_0x42c9df[_0x093f('0x32')];_0x4c3394[_0x093f('0x3b')]=qs['sort'](_0x4f82e4[_0x093f('0x33')]['sort']);_0x4c3394[_0x093f('0x3f')]=qs[_0x093f('0x35')](_[_0x093f('0x3d')](_0x4f82e4[_0x093f('0x33')],_0x42c9df[_0x093f('0x35')]));if(_0x4f82e4[_0x093f('0x33')][_0x093f('0x3e')]){_0x4c3394[_0x093f('0x3f')]=_['merge'](_0x4c3394[_0x093f('0x3f')],{'$or':_[_0x093f('0x2c')](_0x4c3394[_0x093f('0x37')],function(_0x1ffd7b){var _0x58710a={};_0x58710a[_0x1ffd7b]={'$like':'%'+_0x4f82e4[_0x093f('0x33')]['filter']+'%'};return _0x58710a;})});}_0x4c3394=_[_0x093f('0x48')]({},_0x4c3394,_0x4f82e4[_0x093f('0x40')]);return _0x398e23[_0x093f('0x4c')](_0x4c3394);}})['then'](function(_0x8317ca){if(_0x8317ca){_0x257efa=_0x8317ca[_0x093f('0x38')];if(!_0x4f82e4[_0x093f('0x33')][_0x093f('0x4f')](_0x093f('0x39'))){_0x4c3394[_0x093f('0x3a')]=qs[_0x093f('0x3a')](_0x4f82e4[_0x093f('0x33')][_0x093f('0x3a')]);_0x4c3394[_0x093f('0x1d')]=qs['offset'](_0x4f82e4[_0x093f('0x33')]['offset']);}return _0x398e23[_0x093f('0x4c')](_0x4c3394);}})[_0x093f('0x25')](function(_0x34e633){if(_0x34e633){return _0x34e633?{'count':_0x257efa,'rows':_0x34e633}:null;}})[_0x093f('0x25')](respondWithResult(_0x1a898f,null))[_0x093f('0x43')](handleError(_0x1a898f,null));};exports[_0x093f('0x50')]=function(_0x4c888f,_0x11f74e,_0x352bae){if(_0x4c888f[_0x093f('0x4a')]['id']){delete _0x4c888f[_0x093f('0x4a')]['id'];}return db[_0x093f('0x2d')][_0x093f('0x4d')]({'where':{'id':_0x4c888f[_0x093f('0x45')]['id']}})[_0x093f('0x25')](handleEntityNotFound(_0x11f74e,null))[_0x093f('0x25')](function(_0x5cf24f){if(_0x5cf24f){_0x4c888f['body'][_0x093f('0x51')]=_0x5cf24f['id'];_0x4c888f[_0x093f('0x4a')]['Subjects']=integrations[_0x093f('0x52')](_0x4c888f[_0x093f('0x4a')][_0x093f('0x53')],_0x4c888f['body'][_0x093f('0x30')]);_0x4c888f[_0x093f('0x4a')][_0x093f('0x54')]=integrations[_0x093f('0x55')](_0x4c888f[_0x093f('0x4a')]['channel'],_0x4c888f[_0x093f('0x4a')][_0x093f('0x30')]);return db[_0x093f('0x4e')][_0x093f('0x49')](_0x4c888f[_0x093f('0x4a')],{'include':[{'model':db['DeskField'],'as':_0x093f('0x56')},{'model':db[_0x093f('0x57')],'as':_0x093f('0x54')}]});}return null;})['then'](respondWithResult(_0x11f74e,null))[_0x093f('0x43')](handleError(_0x11f74e,null));};exports[_0x093f('0x58')]=function(_0x4bfbbc,_0xb69b0c,_0x763f8b){var _0x4899e6=[{'name':_0x093f('0x59'),'label':_0x093f('0x59'),'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 _0x5ea0fe='';return db[_0x093f('0x2d')]['findOne']({'where':{'id':_0x4bfbbc[_0x093f('0x45')]['id']},'attributes':['id',_0x093f('0x5a'),'authType',_0x093f('0x5b'),_0x093f('0x5c'),_0x093f('0x5d'),_0x093f('0x5e'),_0x093f('0x5f'),_0x093f('0x60')]})[_0x093f('0x25')](handleEntityNotFound(_0xb69b0c,null))[_0x093f('0x25')](function(_0x332f3e){if(_0x332f3e){_0x5ea0fe=_0x332f3e[_0x093f('0x5a')];var _0x7da5ee=_0x5ea0fe[_0x093f('0x61')](-0x1);if(_0x7da5ee==='/'){_0x5ea0fe=_0x5ea0fe[_0x093f('0x62')](0x0,_0x5ea0fe[_0x093f('0x63')](_0x7da5ee));}var _0x39ad66={'method':_0x093f('0x64'),'uri':util[_0x093f('0x65')](_0x093f('0x66'),_0x5ea0fe),'headers':{'Content-Type':_0x093f('0x67'),'Accept':_0x093f('0x67')},'json':!![]};if(_0x332f3e[_0x093f('0x68')]===_0x093f('0x69')){_0x39ad66['headers'][_0x093f('0x6a')]=util['format'](_0x093f('0x6b'),new Buffer(util['format'](_0x093f('0x6c'),_0x332f3e[_0x093f('0x5b')],_0x332f3e[_0x093f('0x5c')]))[_0x093f('0x6d')](_0x093f('0x6e')));}return rp(_0x39ad66)[_0x093f('0x25')](function(_0x2cb316){return _0x4899e6[_0x093f('0x6f')](_[_0x093f('0x2c')](_0x2cb316[_0x093f('0x70')]['entries'],function(_0x35e9d4){return{'id':_0x35e9d4[_0x093f('0x29')],'name':_0x35e9d4[_0x093f('0x29')],'type':_0x35e9d4['type'],'active':_0x35e9d4[_0x093f('0x71')],'label':_0x35e9d4[_0x093f('0x72')],'custom':!![]};}));});}})[_0x093f('0x25')](function(_0x4933d7){return{'count':_0x4933d7[_0x093f('0x38')],'rows':_0x4933d7};})[_0x093f('0x25')](respondWithResult(_0xb69b0c,null))[_0x093f('0x43')](function(_0x59ebbb){var _0x1e75da=_0x4bfbbc[_0x093f('0x33')][_0x093f('0x73')]?0x1f4:_0x59ebbb['statusCode']||0x1f4;logger[_0x093f('0x27')](_0x093f('0x74'),_0x093f('0x58'),_0x1e75da,JSON[_0x093f('0x75')](_0x59ebbb));delete _0x59ebbb['name'];if(_0x1e75da===0x191){_0x1e75da=0x190;}_0xb69b0c[_0x093f('0x1b')](_0x1e75da)['send'](_0x4bfbbc['query'][_0x093f('0x73')]?{'message':_0x093f('0x76'),'statusCode':_0x59ebbb[_0x093f('0x77')]}:_0x59ebbb);});}; \ No newline at end of file +var _0x90e3=['stack','name','send','DeskAccount','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','map','options','includeAll','include','findAll','rows','catch','show','params','find','create','body','getConfigurations','findOne','DeskConfiguration','addConfiguration','AccountId','channel','getDescriptions','Subjects','DeskField','Descriptions','getFields','priority','remoteUri','authType','username','password','consumerKey','consumerSecret','slice','substring','GET','%s/custom_fields','application/json','basic','headers','format','Basic\x20%s','base64','concat','_embedded','entries','active','label','statusCode','stringify','test','Wrong\x20credentials','eml-format','zip-dir','fast-json-patch','request-promise','moment','util','path','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','../../mysqldb','../../components/integrations/configuration','sendStatus','status','end','json','offset','undefined','limit','count','set','apply','save','update','then','destroy','error'];(function(_0x9d639c,_0x524dbe){var _0x1671de=function(_0x27888e){while(--_0x27888e){_0x9d639c['push'](_0x9d639c['shift']());}};_0x1671de(++_0x524dbe);}(_0x90e3,0x12d));var _0x390e=function(_0x50f0e9,_0x2f9300){_0x50f0e9=_0x50f0e9-0x0;var _0x12dae4=_0x90e3[_0x50f0e9];return _0x12dae4;};'use strict';var emlformat=require(_0x390e('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x390e('0x1'));var jsonpatch=require(_0x390e('0x2'));var rp=require(_0x390e('0x3'));var moment=require(_0x390e('0x4'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0x390e('0x5'));var path=require(_0x390e('0x6'));var sox=require('sox');var csv=require(_0x390e('0x7'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x390e('0x8'));var _=require(_0x390e('0x9'));var squel=require(_0x390e('0xa'));var crypto=require('crypto');var jsforce=require(_0x390e('0xb'));var deskjs=require(_0x390e('0xc'));var toCsv=require(_0x390e('0x7'));var querystring=require(_0x390e('0xd'));var Papa=require(_0x390e('0xe'));var Redis=require(_0x390e('0xf'));var authService=require(_0x390e('0x10'));var qs=require(_0x390e('0x11'));var as=require(_0x390e('0x12'));var hardwareService=require(_0x390e('0x13'));var logger=require(_0x390e('0x14'))(_0x390e('0x15'));var utils=require(_0x390e('0x16'));var config=require(_0x390e('0x17'));var licenseUtil=require('../../config/license/util');var db=require(_0x390e('0x18'))['db'];var integrations=require(_0x390e('0x19'));function respondWithStatusCode(_0x31f21c,_0x2e6b55){_0x2e6b55=_0x2e6b55||0xcc;return function(_0x414e88){if(_0x414e88){return _0x31f21c[_0x390e('0x1a')](_0x2e6b55);}return _0x31f21c[_0x390e('0x1b')](_0x2e6b55)[_0x390e('0x1c')]();};}function respondWithResult(_0xb9ec28,_0x371f6c){_0x371f6c=_0x371f6c||0xc8;return function(_0x3b9555){if(_0x3b9555){return _0xb9ec28[_0x390e('0x1b')](_0x371f6c)[_0x390e('0x1d')](_0x3b9555);}};}function respondWithFilteredResult(_0x174c0b,_0x54aae0){return function(_0x4a28fc){if(_0x4a28fc){var _0x279d57=typeof _0x54aae0[_0x390e('0x1e')]===_0x390e('0x1f')&&typeof _0x54aae0[_0x390e('0x20')]===_0x390e('0x1f');var _0x54da1c=_0x4a28fc[_0x390e('0x21')];var _0x4e8257=_0x279d57?0x0:_0x54aae0['offset'];var _0xf7c57=_0x279d57?_0x4a28fc[_0x390e('0x21')]:_0x54aae0[_0x390e('0x1e')]+_0x54aae0[_0x390e('0x20')];var _0x4431ff;if(_0xf7c57>=_0x54da1c){_0xf7c57=_0x54da1c;_0x4431ff=0xc8;}else{_0x4431ff=0xce;}_0x174c0b[_0x390e('0x1b')](_0x4431ff);return _0x174c0b[_0x390e('0x22')]('Content-Range',_0x4e8257+'-'+_0xf7c57+'/'+_0x54da1c)[_0x390e('0x1d')](_0x4a28fc);}return null;};}function patchUpdates(_0x267969){return function(_0x533b22){try{jsonpatch[_0x390e('0x23')](_0x533b22,_0x267969,!![]);}catch(_0x11342c){return BPromise['reject'](_0x11342c);}return _0x533b22[_0x390e('0x24')]();};}function saveUpdates(_0x5d0ee5,_0x365c71){return function(_0x3ad2ac){if(_0x3ad2ac){return _0x3ad2ac[_0x390e('0x25')](_0x5d0ee5)[_0x390e('0x26')](function(_0x4d06c7){return _0x4d06c7;});}return null;};}function removeEntity(_0xc8f6d1,_0x57816b){return function(_0x37156e){if(_0x37156e){return _0x37156e[_0x390e('0x27')]()[_0x390e('0x26')](function(){_0xc8f6d1['status'](0xcc)[_0x390e('0x1c')]();});}};}function handleEntityNotFound(_0x195f06,_0x3fb3d5){return function(_0x177b89){if(!_0x177b89){_0x195f06['sendStatus'](0x194);}return _0x177b89;};}function handleError(_0x42c0f2,_0x243d6a){_0x243d6a=_0x243d6a||0x1f4;return function(_0x18ee9b){logger[_0x390e('0x28')](_0x18ee9b[_0x390e('0x29')]);if(_0x18ee9b[_0x390e('0x2a')]){delete _0x18ee9b[_0x390e('0x2a')];}_0x42c0f2[_0x390e('0x1b')](_0x243d6a)[_0x390e('0x2b')](_0x18ee9b);};}exports['index']=function(_0x31e811,_0x4eb737){var _0x3a95dc={},_0x5efb38={},_0x3e0627={'count':0x0,'rows':[]};var _0x20717e=_['map'](db[_0x390e('0x2c')][_0x390e('0x2d')],function(_0x2dca46){return{'name':_0x2dca46[_0x390e('0x2e')],'type':_0x2dca46[_0x390e('0x2f')][_0x390e('0x30')]};});_0x5efb38[_0x390e('0x31')]=_['map'](_0x20717e,_0x390e('0x2a'));_0x5efb38[_0x390e('0x32')]=_[_0x390e('0x33')](_0x31e811[_0x390e('0x32')]);_0x5efb38[_0x390e('0x34')]=_[_0x390e('0x35')](_0x5efb38[_0x390e('0x31')],_0x5efb38['query']);_0x3a95dc[_0x390e('0x36')]=_[_0x390e('0x35')](_0x5efb38['model'],qs['fields'](_0x31e811[_0x390e('0x32')][_0x390e('0x37')]));_0x3a95dc[_0x390e('0x36')]=_0x3a95dc[_0x390e('0x36')][_0x390e('0x38')]?_0x3a95dc[_0x390e('0x36')]:_0x5efb38[_0x390e('0x31')];if(!_0x31e811['query'][_0x390e('0x39')](_0x390e('0x3a'))){_0x3a95dc['limit']=qs[_0x390e('0x20')](_0x31e811[_0x390e('0x32')][_0x390e('0x20')]);_0x3a95dc[_0x390e('0x1e')]=qs[_0x390e('0x1e')](_0x31e811[_0x390e('0x32')][_0x390e('0x1e')]);}_0x3a95dc[_0x390e('0x3b')]=qs[_0x390e('0x3c')](_0x31e811[_0x390e('0x32')]['sort']);_0x3a95dc[_0x390e('0x3d')]=qs[_0x390e('0x34')](_[_0x390e('0x3e')](_0x31e811[_0x390e('0x32')],_0x5efb38['filters']),_0x20717e);if(_0x31e811[_0x390e('0x32')][_0x390e('0x3f')]){_0x3a95dc[_0x390e('0x3d')]=_[_0x390e('0x40')](_0x3a95dc[_0x390e('0x3d')],{'$or':_[_0x390e('0x41')](_0x20717e,function(_0x425d84){if(_0x425d84[_0x390e('0x2f')]!=='VIRTUAL'){var _0x3b83b2={};_0x3b83b2[_0x425d84[_0x390e('0x2a')]]={'$like':'%'+_0x31e811['query'][_0x390e('0x3f')]+'%'};return _0x3b83b2;}})});}_0x3a95dc=_[_0x390e('0x40')]({},_0x3a95dc,_0x31e811[_0x390e('0x42')]);var _0x42fd2d={'where':_0x3a95dc[_0x390e('0x3d')]};return db[_0x390e('0x2c')][_0x390e('0x21')](_0x42fd2d)[_0x390e('0x26')](function(_0x49787f){_0x3e0627[_0x390e('0x21')]=_0x49787f;if(_0x31e811[_0x390e('0x32')][_0x390e('0x43')]){_0x3a95dc[_0x390e('0x44')]=[{'all':!![]}];}return db['DeskAccount'][_0x390e('0x45')](_0x3a95dc);})[_0x390e('0x26')](function(_0x3dc953){_0x3e0627[_0x390e('0x46')]=_0x3dc953;return _0x3e0627;})[_0x390e('0x26')](respondWithFilteredResult(_0x4eb737,_0x3a95dc))[_0x390e('0x47')](handleError(_0x4eb737,null));};exports[_0x390e('0x48')]=function(_0x7f817e,_0x2fd8ca){var _0x478ba6={'raw':![],'where':{'id':_0x7f817e[_0x390e('0x49')]['id']}},_0x19849b={};_0x19849b['model']=_[_0x390e('0x33')](db[_0x390e('0x2c')][_0x390e('0x2d')]);_0x19849b['query']=_[_0x390e('0x33')](_0x7f817e['query']);_0x19849b[_0x390e('0x34')]=_[_0x390e('0x35')](_0x19849b[_0x390e('0x31')],_0x19849b[_0x390e('0x32')]);_0x478ba6[_0x390e('0x36')]=_['intersection'](_0x19849b['model'],qs['fields'](_0x7f817e[_0x390e('0x32')][_0x390e('0x37')]));_0x478ba6[_0x390e('0x36')]=_0x478ba6['attributes']['length']?_0x478ba6['attributes']:_0x19849b[_0x390e('0x31')];if(_0x7f817e[_0x390e('0x32')][_0x390e('0x43')]){_0x478ba6[_0x390e('0x44')]=[{'all':!![]}];}_0x478ba6=_[_0x390e('0x40')]({},_0x478ba6,_0x7f817e[_0x390e('0x42')]);return db[_0x390e('0x2c')][_0x390e('0x4a')](_0x478ba6)[_0x390e('0x26')](handleEntityNotFound(_0x2fd8ca,null))[_0x390e('0x26')](respondWithResult(_0x2fd8ca,null))[_0x390e('0x47')](handleError(_0x2fd8ca,null));};exports[_0x390e('0x4b')]=function(_0x237d93,_0x350ce3){return db['DeskAccount']['create'](_0x237d93['body'],{})[_0x390e('0x26')](respondWithResult(_0x350ce3,0xc9))[_0x390e('0x47')](handleError(_0x350ce3,null));};exports[_0x390e('0x25')]=function(_0x5a2851,_0xf2787b){if(_0x5a2851[_0x390e('0x4c')]['id']){delete _0x5a2851[_0x390e('0x4c')]['id'];}return db['DeskAccount'][_0x390e('0x4a')]({'where':{'id':_0x5a2851[_0x390e('0x49')]['id']}})[_0x390e('0x26')](handleEntityNotFound(_0xf2787b,null))['then'](saveUpdates(_0x5a2851[_0x390e('0x4c')],null))['then'](respondWithResult(_0xf2787b,null))[_0x390e('0x47')](handleError(_0xf2787b,null));};exports['destroy']=function(_0x41731f,_0x3a98f5){return db[_0x390e('0x2c')][_0x390e('0x4a')]({'where':{'id':_0x41731f[_0x390e('0x49')]['id']}})[_0x390e('0x26')](handleEntityNotFound(_0x3a98f5,null))['then'](removeEntity(_0x3a98f5,null))[_0x390e('0x47')](handleError(_0x3a98f5,null));};exports[_0x390e('0x4d')]=function(_0x4f3857,_0x552925,_0x50762d){var _0x559ccf={};var _0x51264f={};var _0x3a4b86;var _0x417774;return db[_0x390e('0x2c')][_0x390e('0x4e')]({'where':{'id':_0x4f3857[_0x390e('0x49')]['id']}})[_0x390e('0x26')](handleEntityNotFound(_0x552925,null))[_0x390e('0x26')](function(_0xb6c626){if(_0xb6c626){_0x3a4b86=_0xb6c626;_0x51264f[_0x390e('0x31')]=_['keys'](db[_0x390e('0x4f')]['rawAttributes']);_0x51264f[_0x390e('0x32')]=_[_0x390e('0x33')](_0x4f3857['query']);_0x51264f['filters']=_[_0x390e('0x35')](_0x51264f[_0x390e('0x31')],_0x51264f[_0x390e('0x32')]);_0x559ccf[_0x390e('0x36')]=_['intersection'](_0x51264f['model'],qs[_0x390e('0x37')](_0x4f3857['query'][_0x390e('0x37')]));_0x559ccf[_0x390e('0x36')]=_0x559ccf[_0x390e('0x36')][_0x390e('0x38')]?_0x559ccf[_0x390e('0x36')]:_0x51264f[_0x390e('0x31')];_0x559ccf[_0x390e('0x3b')]=qs[_0x390e('0x3c')](_0x4f3857[_0x390e('0x32')][_0x390e('0x3c')]);_0x559ccf[_0x390e('0x3d')]=qs[_0x390e('0x34')](_[_0x390e('0x3e')](_0x4f3857[_0x390e('0x32')],_0x51264f['filters']));if(_0x4f3857[_0x390e('0x32')][_0x390e('0x3f')]){_0x559ccf[_0x390e('0x3d')]=_['merge'](_0x559ccf[_0x390e('0x3d')],{'$or':_['map'](_0x559ccf['attributes'],function(_0x11ee80){var _0x318e13={};_0x318e13[_0x11ee80]={'$like':'%'+_0x4f3857[_0x390e('0x32')][_0x390e('0x3f')]+'%'};return _0x318e13;})});}_0x559ccf=_['merge']({},_0x559ccf,_0x4f3857[_0x390e('0x42')]);return _0x3a4b86[_0x390e('0x4d')](_0x559ccf);}})['then'](function(_0x5dfb97){if(_0x5dfb97){_0x417774=_0x5dfb97[_0x390e('0x38')];if(!_0x4f3857[_0x390e('0x32')]['hasOwnProperty']('nolimit')){_0x559ccf[_0x390e('0x20')]=qs[_0x390e('0x20')](_0x4f3857[_0x390e('0x32')]['limit']);_0x559ccf[_0x390e('0x1e')]=qs['offset'](_0x4f3857[_0x390e('0x32')][_0x390e('0x1e')]);}return _0x3a4b86[_0x390e('0x4d')](_0x559ccf);}})[_0x390e('0x26')](function(_0x17929f){if(_0x17929f){return _0x17929f?{'count':_0x417774,'rows':_0x17929f}:null;}})[_0x390e('0x26')](respondWithResult(_0x552925,null))['catch'](handleError(_0x552925,null));};exports[_0x390e('0x50')]=function(_0x45fd8c,_0x4adfcc,_0x43b1e3){if(_0x45fd8c[_0x390e('0x4c')]['id']){delete _0x45fd8c[_0x390e('0x4c')]['id'];}return db[_0x390e('0x2c')][_0x390e('0x4e')]({'where':{'id':_0x45fd8c['params']['id']}})['then'](handleEntityNotFound(_0x4adfcc,null))[_0x390e('0x26')](function(_0xfd57c){if(_0xfd57c){_0x45fd8c[_0x390e('0x4c')][_0x390e('0x51')]=_0xfd57c['id'];_0x45fd8c['body']['Subjects']=integrations['getSubjects'](_0x45fd8c[_0x390e('0x4c')][_0x390e('0x52')],_0x45fd8c[_0x390e('0x4c')][_0x390e('0x2f')]);_0x45fd8c['body']['Descriptions']=integrations[_0x390e('0x53')](_0x45fd8c[_0x390e('0x4c')]['channel'],_0x45fd8c['body'][_0x390e('0x2f')]);return db[_0x390e('0x4f')][_0x390e('0x4b')](_0x45fd8c[_0x390e('0x4c')],{'include':[{'model':db['DeskField'],'as':_0x390e('0x54')},{'model':db[_0x390e('0x55')],'as':_0x390e('0x56')}]});}return null;})[_0x390e('0x26')](respondWithResult(_0x4adfcc,null))[_0x390e('0x47')](handleError(_0x4adfcc,null));};exports[_0x390e('0x57')]=function(_0x235ee2,_0x2e5e89,_0x201ff1){var _0x50b27f=[{'name':_0x390e('0x58'),'label':_0x390e('0x58'),'custom':![],'options':[{'name':0x1,'value':0x1},{'name':0x2,'value':0x2},{'name':0x3,'value':0x3},{'name':0x4,'value':0x4},{'name':0x5,'value':0x5},{'name':0x6,'value':0x6},{'name':0x7,'value':0x7},{'name':0x8,'value':0x8},{'name':0x9,'value':0x9},{'name':0xa,'value':0xa}]}];var _0x3ddda3='';return db[_0x390e('0x2c')]['findOne']({'where':{'id':_0x235ee2[_0x390e('0x49')]['id']},'attributes':['id',_0x390e('0x59'),_0x390e('0x5a'),_0x390e('0x5b'),_0x390e('0x5c'),_0x390e('0x5d'),_0x390e('0x5e'),'token','tokenSecret']})[_0x390e('0x26')](handleEntityNotFound(_0x2e5e89,null))[_0x390e('0x26')](function(_0x2db81e){if(_0x2db81e){_0x3ddda3=_0x2db81e[_0x390e('0x59')];var _0x17391f=_0x3ddda3[_0x390e('0x5f')](-0x1);if(_0x17391f==='/'){_0x3ddda3=_0x3ddda3[_0x390e('0x60')](0x0,_0x3ddda3['lastIndexOf'](_0x17391f));}var _0x1a422e={'method':_0x390e('0x61'),'uri':util['format'](_0x390e('0x62'),_0x3ddda3),'headers':{'Content-Type':_0x390e('0x63'),'Accept':'application/json'},'json':!![]};if(_0x2db81e[_0x390e('0x5a')]===_0x390e('0x64')){_0x1a422e[_0x390e('0x65')]['Authorization']=util[_0x390e('0x66')](_0x390e('0x67'),new Buffer(util[_0x390e('0x66')]('%s:%s',_0x2db81e[_0x390e('0x5b')],_0x2db81e[_0x390e('0x5c')]))['toString'](_0x390e('0x68')));}return rp(_0x1a422e)['then'](function(_0x37638c){return _0x50b27f[_0x390e('0x69')](_['map'](_0x37638c[_0x390e('0x6a')][_0x390e('0x6b')],function(_0x2b346b){return{'id':_0x2b346b[_0x390e('0x2a')],'name':_0x2b346b[_0x390e('0x2a')],'type':_0x2b346b['type'],'active':_0x2b346b[_0x390e('0x6c')],'label':_0x2b346b[_0x390e('0x6d')],'custom':!![]};}));});}})['then'](function(_0x326ad2){return{'count':_0x326ad2[_0x390e('0x38')],'rows':_0x326ad2};})[_0x390e('0x26')](respondWithResult(_0x2e5e89,null))['catch'](function(_0x2391a6){var _0xd69f3d=_0x235ee2[_0x390e('0x32')]['test']?0x1f4:_0x2391a6[_0x390e('0x6e')]||0x1f4;logger[_0x390e('0x28')]('getFields,\x20%s,\x20%s,\x20%s',_0x390e('0x57'),_0xd69f3d,JSON[_0x390e('0x6f')](_0x2391a6));delete _0x2391a6[_0x390e('0x2a')];if(_0xd69f3d===0x191){_0xd69f3d=0x190;}_0x2e5e89[_0x390e('0x1b')](_0xd69f3d)['send'](_0x235ee2[_0x390e('0x32')][_0x390e('0x70')]?{'message':_0x390e('0x71'),'statusCode':_0x2391a6[_0x390e('0x6e')]}:_0x2391a6);});}; \ No newline at end of file diff --git a/server/api/intDeskAccount/intDeskAccount.model.js b/server/api/intDeskAccount/intDeskAccount.model.js index c6c994f..ff1e425 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 _0x2dd6=['./intDeskAccount.attributes','../../components/integrations/configuration','exports','define','DeskAccount','lodash','util','../../config/logger','api','bluebird','path','../../config/environment'];(function(_0x359639,_0x21ca4b){var _0x334f44=function(_0x14874d){while(--_0x14874d){_0x359639['push'](_0x359639['shift']());}};_0x334f44(++_0x21ca4b);}(_0x2dd6,0x101));var _0x62dd=function(_0x4f45bc,_0x3ea5f3){_0x4f45bc=_0x4f45bc-0x0;var _0x2c5112=_0x2dd6[_0x4f45bc];return _0x2c5112;};'use strict';var _=require(_0x62dd('0x0'));var util=require(_0x62dd('0x1'));var logger=require(_0x62dd('0x2'))(_0x62dd('0x3'));var moment=require('moment');var BPromise=require(_0x62dd('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x62dd('0x5'));var rimraf=require('rimraf');var config=require(_0x62dd('0x6'));var attributes=require(_0x62dd('0x7'));var integrations=require(_0x62dd('0x8'));module[_0x62dd('0x9')]=function(_0x16a082,_0x507753){return _0x16a082[_0x62dd('0xa')](_0x62dd('0xb'),attributes,{'tableName':'int_desk_accounts','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x3335=['int_desk_accounts','lodash','../../config/logger','moment','bluebird','rimraf','../../config/environment','./intDeskAccount.attributes','../../components/integrations/configuration','define'];(function(_0x16251a,_0x535991){var _0x5553ac=function(_0x524c44){while(--_0x524c44){_0x16251a['push'](_0x16251a['shift']());}};_0x5553ac(++_0x535991);}(_0x3335,0x173));var _0x5333=function(_0x3a9661,_0x530b12){_0x3a9661=_0x3a9661-0x0;var _0x5bb119=_0x3335[_0x3a9661];return _0x5bb119;};'use strict';var _=require(_0x5333('0x0'));var util=require('util');var logger=require(_0x5333('0x1'))('api');var moment=require(_0x5333('0x2'));var BPromise=require(_0x5333('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0x5333('0x4'));var config=require(_0x5333('0x5'));var attributes=require(_0x5333('0x6'));var integrations=require(_0x5333('0x7'));module['exports']=function(_0xb9638f,_0x5cad24){return _0xb9638f[_0x5333('0x8')]('DeskAccount',attributes,{'tableName':_0x5333('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 e817181..713247a 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 _0xc147=['rpc','../../config/environment','jayson/promise','info','DeskAccount,\x20%s,\x20%s','request\x20sent','DeskAccount,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','GetDeskAccount','DeskAccount','findAll','options','raw','where','limit','include','map','attributes','model','ShowDeskAccount','find','then','debug','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger'];(function(_0x46e363,_0x45d7e2){var _0x3fb059=function(_0x5e6274){while(--_0x5e6274){_0x46e363['push'](_0x46e363['shift']());}};_0x3fb059(++_0x45d7e2);}(_0xc147,0x133));var _0x7c14=function(_0x459a08,_0x5ae29a){_0x459a08=_0x459a08-0x0;var _0x3f4d07=_0xc147[_0x459a08];return _0x3f4d07;};'use strict';var _=require(_0x7c14('0x0'));var util=require('util');var moment=require(_0x7c14('0x1'));var BPromise=require(_0x7c14('0x2'));var rs=require(_0x7c14('0x3'));var fs=require('fs');var Redis=require(_0x7c14('0x4'));var db=require(_0x7c14('0x5'))['db'];var utils=require(_0x7c14('0x6'));var logger=require(_0x7c14('0x7'))(_0x7c14('0x8'));var config=require(_0x7c14('0x9'));var jayson=require(_0x7c14('0xa'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x4b5575,_0x2ec60b,_0x2febad){return new BPromise(function(_0x113f9c,_0x3fbf04){return client['request'](_0x4b5575,_0x2febad)['then'](function(_0x2ca5f8){logger[_0x7c14('0xb')](_0x7c14('0xc'),_0x2ec60b,_0x7c14('0xd'));logger['debug'](_0x7c14('0xe'),_0x2ec60b,_0x7c14('0xd'),JSON[_0x7c14('0xf')](_0x2ca5f8));if(_0x2ca5f8[_0x7c14('0x10')]){if(_0x2ca5f8['error']['code']===0x1f4){logger[_0x7c14('0x10')]('DeskAccount,\x20%s,\x20%s',_0x2ec60b,_0x2ca5f8[_0x7c14('0x10')][_0x7c14('0x11')]);return _0x3fbf04(_0x2ca5f8['error'][_0x7c14('0x11')]);}logger[_0x7c14('0x10')](_0x7c14('0xc'),_0x2ec60b,_0x2ca5f8['error']['message']);return _0x113f9c(_0x2ca5f8['error']['message']);}else{logger[_0x7c14('0xb')](_0x7c14('0xc'),_0x2ec60b,_0x7c14('0xd'));_0x113f9c(_0x2ca5f8[_0x7c14('0x12')][_0x7c14('0x11')]);}})[_0x7c14('0x13')](function(_0x4719a6){logger[_0x7c14('0x10')](_0x7c14('0xc'),_0x2ec60b,_0x4719a6);_0x3fbf04(_0x4719a6);});});}exports[_0x7c14('0x14')]=function(_0x26ce16){var _0x203ed4=this;return new Promise(function(_0x1907f7,_0x543a44){return db[_0x7c14('0x15')][_0x7c14('0x16')]({'raw':_0x26ce16[_0x7c14('0x17')]?_0x26ce16[_0x7c14('0x17')][_0x7c14('0x18')]===undefined?!![]:![]:!![],'where':_0x26ce16[_0x7c14('0x17')]?_0x26ce16['options'][_0x7c14('0x19')]||null:null,'attributes':_0x26ce16['options']?_0x26ce16['options']['attributes']||null:null,'limit':_0x26ce16[_0x7c14('0x17')]?_0x26ce16[_0x7c14('0x17')][_0x7c14('0x1a')]||null:null,'include':_0x26ce16[_0x7c14('0x17')]?_0x26ce16[_0x7c14('0x17')][_0x7c14('0x1b')]?_[_0x7c14('0x1c')](_0x26ce16[_0x7c14('0x17')][_0x7c14('0x1b')],function(_0x473d1d){return{'model':db[_0x473d1d['model']],'as':_0x473d1d['as'],'attributes':_0x473d1d[_0x7c14('0x1d')],'include':_0x473d1d[_0x7c14('0x1b')]?_['map'](_0x473d1d[_0x7c14('0x1b')],function(_0x4d3a7b){return{'model':db[_0x4d3a7b[_0x7c14('0x1e')]],'as':_0x4d3a7b['as'],'attributes':_0x4d3a7b[_0x7c14('0x1d')],'include':_0x4d3a7b[_0x7c14('0x1b')]?_[_0x7c14('0x1c')](_0x4d3a7b['include'],function(_0x5abb9f){return{'model':db[_0x5abb9f[_0x7c14('0x1e')]],'as':_0x5abb9f['as'],'attributes':_0x5abb9f[_0x7c14('0x1d')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x144199){logger[_0x7c14('0xb')](_0x7c14('0x14'),_0x26ce16);logger['debug'](_0x7c14('0x14'),_0x26ce16,JSON[_0x7c14('0xf')](_0x144199));_0x1907f7(_0x144199);})[_0x7c14('0x13')](function(_0x4e4efc){logger['error'](_0x7c14('0x14'),_0x4e4efc[_0x7c14('0x11')],_0x26ce16);_0x543a44(_0x203ed4[_0x7c14('0x10')](0x1f4,_0x4e4efc['message']));});});};exports[_0x7c14('0x1f')]=function(_0xe34388){var _0x2a32cb=this;return new Promise(function(_0x57b39c,_0x2fa7b4){return db[_0x7c14('0x15')][_0x7c14('0x20')]({'raw':_0xe34388[_0x7c14('0x17')]?_0xe34388[_0x7c14('0x17')][_0x7c14('0x18')]===undefined?!![]:![]:!![],'where':_0xe34388[_0x7c14('0x17')]?_0xe34388[_0x7c14('0x17')][_0x7c14('0x19')]||null:null,'attributes':_0xe34388[_0x7c14('0x17')]?_0xe34388['options']['attributes']||null:null,'include':_0xe34388[_0x7c14('0x17')]?_0xe34388[_0x7c14('0x17')][_0x7c14('0x1b')]?_[_0x7c14('0x1c')](_0xe34388[_0x7c14('0x17')][_0x7c14('0x1b')],function(_0x5862d6){return{'model':db[_0x5862d6[_0x7c14('0x1e')]],'as':_0x5862d6['as'],'attributes':_0x5862d6[_0x7c14('0x1d')],'include':_0x5862d6[_0x7c14('0x1b')]?_['map'](_0x5862d6[_0x7c14('0x1b')],function(_0x1fa47c){return{'model':db[_0x1fa47c['model']],'as':_0x1fa47c['as'],'attributes':_0x1fa47c['attributes'],'include':_0x1fa47c[_0x7c14('0x1b')]?_[_0x7c14('0x1c')](_0x1fa47c['include'],function(_0x4686e5){return{'model':db[_0x4686e5[_0x7c14('0x1e')]],'as':_0x4686e5['as'],'attributes':_0x4686e5[_0x7c14('0x1d')]};}):[]};}):[]};}):[]:[]})[_0x7c14('0x21')](function(_0x5ae090){logger[_0x7c14('0xb')]('ShowDeskAccount',_0xe34388);logger[_0x7c14('0x22')](_0x7c14('0x1f'),_0xe34388,JSON['stringify'](_0x5ae090));_0x57b39c(_0x5ae090);})[_0x7c14('0x13')](function(_0x3ee2e0){logger[_0x7c14('0x10')](_0x7c14('0x1f'),_0x3ee2e0[_0x7c14('0x11')],_0xe34388);_0x2fa7b4(_0x2a32cb[_0x7c14('0x10')](0x1f4,_0x3ee2e0['message']));});});}; \ No newline at end of file +var _0x9ac0=['GetDeskAccount','options','raw','attributes','limit','include','map','model','DeskAccount','find','ShowDeskAccount','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','request','then','info','DeskAccount,\x20%s,\x20%s','request\x20sent','debug','DeskAccount,\x20%s,\x20%s,\x20%s','stringify','code','error','message','result','catch'];(function(_0x26c2da,_0x4704f8){var _0xfcec8e=function(_0x5de280){while(--_0x5de280){_0x26c2da['push'](_0x26c2da['shift']());}};_0xfcec8e(++_0x4704f8);}(_0x9ac0,0x12b));var _0x09ac=function(_0x4d5bff,_0x2bf885){_0x4d5bff=_0x4d5bff-0x0;var _0x2b3c0b=_0x9ac0[_0x4d5bff];return _0x2b3c0b;};'use strict';var _=require(_0x09ac('0x0'));var util=require('util');var moment=require(_0x09ac('0x1'));var BPromise=require(_0x09ac('0x2'));var rs=require(_0x09ac('0x3'));var fs=require('fs');var Redis=require(_0x09ac('0x4'));var db=require(_0x09ac('0x5'))['db'];var utils=require(_0x09ac('0x6'));var logger=require(_0x09ac('0x7'))(_0x09ac('0x8'));var config=require(_0x09ac('0x9'));var jayson=require(_0x09ac('0xa'));var client=jayson[_0x09ac('0xb')]['http']({'port':0x232a});function respondWithRpcPromise(_0x3d4cd5,_0x1fba73,_0x1f9cd2){return new BPromise(function(_0x3e38b4,_0x111288){return client[_0x09ac('0xc')](_0x3d4cd5,_0x1f9cd2)[_0x09ac('0xd')](function(_0x393df5){logger[_0x09ac('0xe')](_0x09ac('0xf'),_0x1fba73,_0x09ac('0x10'));logger[_0x09ac('0x11')](_0x09ac('0x12'),_0x1fba73,'request\x20sent',JSON[_0x09ac('0x13')](_0x393df5));if(_0x393df5['error']){if(_0x393df5['error'][_0x09ac('0x14')]===0x1f4){logger[_0x09ac('0x15')](_0x09ac('0xf'),_0x1fba73,_0x393df5['error']['message']);return _0x111288(_0x393df5['error']['message']);}logger['error'](_0x09ac('0xf'),_0x1fba73,_0x393df5['error'][_0x09ac('0x16')]);return _0x3e38b4(_0x393df5['error']['message']);}else{logger[_0x09ac('0xe')](_0x09ac('0xf'),_0x1fba73,_0x09ac('0x10'));_0x3e38b4(_0x393df5[_0x09ac('0x17')][_0x09ac('0x16')]);}})[_0x09ac('0x18')](function(_0x17a7f8){logger['error']('DeskAccount,\x20%s,\x20%s',_0x1fba73,_0x17a7f8);_0x111288(_0x17a7f8);});});}exports[_0x09ac('0x19')]=function(_0x4aea78){var _0x31553c=this;return new Promise(function(_0x31366d,_0x199390){return db['DeskAccount']['findAll']({'raw':_0x4aea78[_0x09ac('0x1a')]?_0x4aea78[_0x09ac('0x1a')][_0x09ac('0x1b')]===undefined?!![]:![]:!![],'where':_0x4aea78[_0x09ac('0x1a')]?_0x4aea78[_0x09ac('0x1a')]['where']||null:null,'attributes':_0x4aea78['options']?_0x4aea78[_0x09ac('0x1a')][_0x09ac('0x1c')]||null:null,'limit':_0x4aea78[_0x09ac('0x1a')]?_0x4aea78[_0x09ac('0x1a')][_0x09ac('0x1d')]||null:null,'include':_0x4aea78[_0x09ac('0x1a')]?_0x4aea78['options'][_0x09ac('0x1e')]?_[_0x09ac('0x1f')](_0x4aea78[_0x09ac('0x1a')][_0x09ac('0x1e')],function(_0x1f6e4f){return{'model':db[_0x1f6e4f[_0x09ac('0x20')]],'as':_0x1f6e4f['as'],'attributes':_0x1f6e4f[_0x09ac('0x1c')],'include':_0x1f6e4f[_0x09ac('0x1e')]?_[_0x09ac('0x1f')](_0x1f6e4f['include'],function(_0x148946){return{'model':db[_0x148946[_0x09ac('0x20')]],'as':_0x148946['as'],'attributes':_0x148946[_0x09ac('0x1c')],'include':_0x148946[_0x09ac('0x1e')]?_['map'](_0x148946[_0x09ac('0x1e')],function(_0x5b1cfc){return{'model':db[_0x5b1cfc[_0x09ac('0x20')]],'as':_0x5b1cfc['as'],'attributes':_0x5b1cfc[_0x09ac('0x1c')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x42526e){logger[_0x09ac('0xe')](_0x09ac('0x19'),_0x4aea78);logger[_0x09ac('0x11')]('GetDeskAccount',_0x4aea78,JSON[_0x09ac('0x13')](_0x42526e));_0x31366d(_0x42526e);})['catch'](function(_0xa00dd5){logger[_0x09ac('0x15')](_0x09ac('0x19'),_0xa00dd5[_0x09ac('0x16')],_0x4aea78);_0x199390(_0x31553c[_0x09ac('0x15')](0x1f4,_0xa00dd5[_0x09ac('0x16')]));});});};exports['ShowDeskAccount']=function(_0x1e83be){var _0x37b8f2=this;return new Promise(function(_0x38c61b,_0x3d7735){return db[_0x09ac('0x21')][_0x09ac('0x22')]({'raw':_0x1e83be[_0x09ac('0x1a')]?_0x1e83be[_0x09ac('0x1a')]['raw']===undefined?!![]:![]:!![],'where':_0x1e83be['options']?_0x1e83be['options']['where']||null:null,'attributes':_0x1e83be['options']?_0x1e83be['options'][_0x09ac('0x1c')]||null:null,'include':_0x1e83be['options']?_0x1e83be[_0x09ac('0x1a')][_0x09ac('0x1e')]?_[_0x09ac('0x1f')](_0x1e83be['options'][_0x09ac('0x1e')],function(_0x1a8c84){return{'model':db[_0x1a8c84[_0x09ac('0x20')]],'as':_0x1a8c84['as'],'attributes':_0x1a8c84[_0x09ac('0x1c')],'include':_0x1a8c84['include']?_[_0x09ac('0x1f')](_0x1a8c84[_0x09ac('0x1e')],function(_0x10528d){return{'model':db[_0x10528d[_0x09ac('0x20')]],'as':_0x10528d['as'],'attributes':_0x10528d[_0x09ac('0x1c')],'include':_0x10528d[_0x09ac('0x1e')]?_[_0x09ac('0x1f')](_0x10528d[_0x09ac('0x1e')],function(_0x10093d){return{'model':db[_0x10093d[_0x09ac('0x20')]],'as':_0x10093d['as'],'attributes':_0x10093d['attributes']};}):[]};}):[]};}):[]:[]})[_0x09ac('0xd')](function(_0x4819e1){logger['info'](_0x09ac('0x23'),_0x1e83be);logger[_0x09ac('0x11')](_0x09ac('0x23'),_0x1e83be,JSON['stringify'](_0x4819e1));_0x38c61b(_0x4819e1);})['catch'](function(_0x41c4bf){logger['error'](_0x09ac('0x23'),_0x41c4bf[_0x09ac('0x16')],_0x1e83be);_0x3d7735(_0x37b8f2[_0x09ac('0x15')](0x1f4,_0x41c4bf[_0x09ac('0x16')]));});});}; \ No newline at end of file diff --git a/server/api/intDeskConfiguration/index.js b/server/api/intDeskConfiguration/index.js index 1d43215..21cfd64 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 _0x55ca=['../../config/environment','./intDeskConfiguration.controller','get','isAuthenticated','index','show','/:id/fields','/:id/subjects','getSubjects','/:id/descriptions','getDescriptions','/:id/tags','setTags','put','/:id','update','destroy','exports','multer','util','Router','fs-extra','../../components/interaction/service'];(function(_0x533381,_0x8a69fa){var _0x2877ed=function(_0x45cb54){while(--_0x45cb54){_0x533381['push'](_0x533381['shift']());}};_0x2877ed(++_0x8a69fa);}(_0x55ca,0x126));var _0xa55c=function(_0x332c1b,_0x28d711){_0x332c1b=_0x332c1b-0x0;var _0x21b49b=_0x55ca[_0x332c1b];return _0x21b49b;};'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')]('/:id',auth[_0xa55c('0x8')](),controller[_0xa55c('0xa')]);router['get'](_0xa55c('0xb'),auth[_0xa55c('0x8')](),controller['getFields']);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['getTags']);router['post']('/',auth[_0xa55c('0x8')](),controller['create']);router['post']('/:id/tags',auth[_0xa55c('0x8')](),controller[_0xa55c('0x11')]);router[_0xa55c('0x12')](_0xa55c('0x13'),auth[_0xa55c('0x8')](),controller[_0xa55c('0x14')]);router['delete'](_0xa55c('0x13'),auth[_0xa55c('0x8')](),controller[_0xa55c('0x15')]);module[_0xa55c('0x16')]=router; \ No newline at end of file +var _0x9957=['/:id/subjects','getSubjects','getDescriptions','/:id/tags','getTags','post','create','setTags','put','update','delete','exports','multer','util','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./intDeskConfiguration.controller','get','isAuthenticated','index','/:id','show','getFields'];(function(_0x2078d4,_0x11a400){var _0x5d679b=function(_0x5aab7c){while(--_0x5aab7c){_0x2078d4['push'](_0x2078d4['shift']());}};_0x5d679b(++_0x11a400);}(_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/fields',auth[_0x7995('0xa')](),controller[_0x7995('0xe')]);router[_0x7995('0x9')](_0x7995('0xf'),auth[_0x7995('0xa')](),controller[_0x7995('0x10')]);router[_0x7995('0x9')]('/:id/descriptions',auth[_0x7995('0xa')](),controller[_0x7995('0x11')]);router['get'](_0x7995('0x12'),auth[_0x7995('0xa')](),controller[_0x7995('0x13')]);router[_0x7995('0x14')]('/',auth[_0x7995('0xa')](),controller[_0x7995('0x15')]);router[_0x7995('0x14')]('/:id/tags',auth['isAuthenticated'](),controller[_0x7995('0x16')]);router[_0x7995('0x17')](_0x7995('0xc'),auth[_0x7995('0xa')](),controller[_0x7995('0x18')]);router[_0x7995('0x19')](_0x7995('0xc'),auth[_0x7995('0xa')](),controller['destroy']);module[_0x7995('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 1d01970..af677a9 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 _0xb268=['STRING','sequelize','exports'];(function(_0x1ddd0,_0x15f9f4){var _0x4d86d0=function(_0x3173d7){while(--_0x3173d7){_0x1ddd0['push'](_0x1ddd0['shift']());}};_0x4d86d0(++_0x15f9f4);}(_0xb268,0x67));var _0x8b26=function(_0x17695f,_0x11f678){_0x17695f=_0x17695f-0x0;var _0x240989=_0xb268[_0x17695f];return _0x240989;};'use strict';var Sequelize=require(_0x8b26('0x0'));module[_0x8b26('0x1')]={'name':{'type':Sequelize[_0x8b26('0x2')]},'description':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0x9412=['STRING','sequelize','exports'];(function(_0x170742,_0x456fc9){var _0x3b0ce5=function(_0x4dd95e){while(--_0x4dd95e){_0x170742['push'](_0x170742['shift']());}};_0x3b0ce5(++_0x456fc9);}(_0x9412,0x130));var _0x2941=function(_0x59c683,_0x209444){_0x59c683=_0x59c683-0x0;var _0x47251b=_0x9412[_0x59c683];return _0x47251b;};'use strict';var Sequelize=require(_0x2941('0x0'));module[_0x2941('0x1')]={'name':{'type':Sequelize[_0x2941('0x2')]},'description':{'type':Sequelize[_0x2941('0x2')]}}; \ No newline at end of file diff --git a/server/api/intDeskConfiguration/intDeskConfiguration.controller.js b/server/api/intDeskConfiguration/intDeskConfiguration.controller.js index ebab24a..2660c05 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 _0x20b5=['limit','order','sort','where','filter','merge','options','includeAll','rows','params','fields','catch','create','update','body','find','getFields','findOne','DeskField','pick','getSubjects','hasOwnProperty','getDescriptions','getTags','Tag','setTags','ids','eml-format','rimraf','zip-dir','fast-json-patch','moment','mustache','path','sox','ejs','fs-extra','squel','crypto','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','sendStatus','status','end','undefined','count','offset','set','Content-Range','json','apply','save','then','destroy','error','stack','name','send','index','map','DeskConfiguration','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes','length','nolimit'];(function(_0x27acd2,_0x37dbd0){var _0x738fca=function(_0x21cb00){while(--_0x21cb00){_0x27acd2['push'](_0x27acd2['shift']());}};_0x738fca(++_0x37dbd0);}(_0x20b5,0x11a));var _0x520b=function(_0x163380,_0x21cc82){_0x163380=_0x163380-0x0;var _0x44afe4=_0x20b5[_0x163380];return _0x44afe4;};'use strict';var emlformat=require(_0x520b('0x0'));var rimraf=require(_0x520b('0x1'));var zipdir=require(_0x520b('0x2'));var jsonpatch=require(_0x520b('0x3'));var rp=require('request-promise');var moment=require(_0x520b('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x520b('0x5'));var util=require('util');var path=require(_0x520b('0x6'));var sox=require(_0x520b('0x7'));var csv=require('to-csv');var ejs=require(_0x520b('0x8'));var fs=require('fs');var fs_extra=require(_0x520b('0x9'));var _=require('lodash');var squel=require(_0x520b('0xa'));var crypto=require(_0x520b('0xb'));var jsforce=require(_0x520b('0xc'));var deskjs=require(_0x520b('0xd'));var toCsv=require(_0x520b('0xe'));var querystring=require(_0x520b('0xf'));var Papa=require(_0x520b('0x10'));var Redis=require(_0x520b('0x11'));var authService=require(_0x520b('0x12'));var qs=require('../../components/parsers/qs');var as=require(_0x520b('0x13'));var hardwareService=require(_0x520b('0x14'));var logger=require(_0x520b('0x15'))(_0x520b('0x16'));var utils=require(_0x520b('0x17'));var config=require(_0x520b('0x18'));var licenseUtil=require(_0x520b('0x19'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x186889,_0x59418b){_0x59418b=_0x59418b||0xcc;return function(_0x27f75e){if(_0x27f75e){return _0x186889[_0x520b('0x1a')](_0x59418b);}return _0x186889[_0x520b('0x1b')](_0x59418b)[_0x520b('0x1c')]();};}function respondWithResult(_0x3aaac4,_0x39c21c){_0x39c21c=_0x39c21c||0xc8;return function(_0x5eb90a){if(_0x5eb90a){return _0x3aaac4[_0x520b('0x1b')](_0x39c21c)['json'](_0x5eb90a);}};}function respondWithFilteredResult(_0x44369f,_0x162ed5){return function(_0x10b3e9){if(_0x10b3e9){var _0x477f97=typeof _0x162ed5['offset']===_0x520b('0x1d')&&typeof _0x162ed5['limit']===_0x520b('0x1d');var _0xde7488=_0x10b3e9[_0x520b('0x1e')];var _0x2c9e65=_0x477f97?0x0:_0x162ed5[_0x520b('0x1f')];var _0x2236b6=_0x477f97?_0x10b3e9[_0x520b('0x1e')]:_0x162ed5[_0x520b('0x1f')]+_0x162ed5['limit'];var _0x49b7b5;if(_0x2236b6>=_0xde7488){_0x2236b6=_0xde7488;_0x49b7b5=0xc8;}else{_0x49b7b5=0xce;}_0x44369f[_0x520b('0x1b')](_0x49b7b5);return _0x44369f[_0x520b('0x20')](_0x520b('0x21'),_0x2c9e65+'-'+_0x2236b6+'/'+_0xde7488)[_0x520b('0x22')](_0x10b3e9);}return null;};}function patchUpdates(_0xeeb7fd){return function(_0xdc9fd7){try{jsonpatch[_0x520b('0x23')](_0xdc9fd7,_0xeeb7fd,!![]);}catch(_0x548e90){return BPromise['reject'](_0x548e90);}return _0xdc9fd7[_0x520b('0x24')]();};}function saveUpdates(_0x7cb29e,_0x2a46fe){return function(_0x16e5db){if(_0x16e5db){return _0x16e5db['update'](_0x7cb29e)[_0x520b('0x25')](function(_0x423595){return _0x423595;});}return null;};}function removeEntity(_0x4db6f2,_0x3738d0){return function(_0xf492a){if(_0xf492a){return _0xf492a[_0x520b('0x26')]()[_0x520b('0x25')](function(){_0x4db6f2[_0x520b('0x1b')](0xcc)[_0x520b('0x1c')]();});}};}function handleEntityNotFound(_0x1a5629,_0x4fe68a){return function(_0x439d35){if(!_0x439d35){_0x1a5629[_0x520b('0x1a')](0x194);}return _0x439d35;};}function handleError(_0xf8958c,_0x40713f){_0x40713f=_0x40713f||0x1f4;return function(_0x3c58d4){logger[_0x520b('0x27')](_0x3c58d4[_0x520b('0x28')]);if(_0x3c58d4[_0x520b('0x29')]){delete _0x3c58d4[_0x520b('0x29')];}_0xf8958c[_0x520b('0x1b')](_0x40713f)[_0x520b('0x2a')](_0x3c58d4);};}exports[_0x520b('0x2b')]=function(_0x90e5ff,_0x31b52f){var _0xd93189={},_0x3684d8={},_0x1cc05e={'count':0x0,'rows':[]};var _0x88ed8d=_[_0x520b('0x2c')](db[_0x520b('0x2d')][_0x520b('0x2e')],function(_0x5adfbd){return{'name':_0x5adfbd[_0x520b('0x2f')],'type':_0x5adfbd[_0x520b('0x30')][_0x520b('0x31')]};});_0x3684d8[_0x520b('0x32')]=_[_0x520b('0x2c')](_0x88ed8d,'name');_0x3684d8[_0x520b('0x33')]=_[_0x520b('0x34')](_0x90e5ff[_0x520b('0x33')]);_0x3684d8[_0x520b('0x35')]=_[_0x520b('0x36')](_0x3684d8[_0x520b('0x32')],_0x3684d8[_0x520b('0x33')]);_0xd93189[_0x520b('0x37')]=_['intersection'](_0x3684d8['model'],qs['fields'](_0x90e5ff['query']['fields']));_0xd93189['attributes']=_0xd93189['attributes'][_0x520b('0x38')]?_0xd93189[_0x520b('0x37')]:_0x3684d8[_0x520b('0x32')];if(!_0x90e5ff[_0x520b('0x33')]['hasOwnProperty'](_0x520b('0x39'))){_0xd93189[_0x520b('0x3a')]=qs['limit'](_0x90e5ff[_0x520b('0x33')]['limit']);_0xd93189[_0x520b('0x1f')]=qs[_0x520b('0x1f')](_0x90e5ff[_0x520b('0x33')]['offset']);}_0xd93189[_0x520b('0x3b')]=qs[_0x520b('0x3c')](_0x90e5ff[_0x520b('0x33')][_0x520b('0x3c')]);_0xd93189[_0x520b('0x3d')]=qs['filters'](_['pick'](_0x90e5ff[_0x520b('0x33')],_0x3684d8[_0x520b('0x35')]),_0x88ed8d);if(_0x90e5ff['query'][_0x520b('0x3e')]){_0xd93189[_0x520b('0x3d')]=_[_0x520b('0x3f')](_0xd93189[_0x520b('0x3d')],{'$or':_['map'](_0x88ed8d,function(_0x52c894){if(_0x52c894[_0x520b('0x30')]!=='VIRTUAL'){var _0x39fde4={};_0x39fde4[_0x52c894['name']]={'$like':'%'+_0x90e5ff[_0x520b('0x33')][_0x520b('0x3e')]+'%'};return _0x39fde4;}})});}_0xd93189=_[_0x520b('0x3f')]({},_0xd93189,_0x90e5ff[_0x520b('0x40')]);var _0xaa4c7e={'where':_0xd93189[_0x520b('0x3d')]};return db[_0x520b('0x2d')][_0x520b('0x1e')](_0xaa4c7e)[_0x520b('0x25')](function(_0x576527){_0x1cc05e[_0x520b('0x1e')]=_0x576527;if(_0x90e5ff['query'][_0x520b('0x41')]){_0xd93189['include']=[{'all':!![]}];}return db[_0x520b('0x2d')]['findAll'](_0xd93189);})[_0x520b('0x25')](function(_0x3db348){_0x1cc05e[_0x520b('0x42')]=_0x3db348;return _0x1cc05e;})[_0x520b('0x25')](respondWithFilteredResult(_0x31b52f,_0xd93189))['catch'](handleError(_0x31b52f,null));};exports['show']=function(_0x32e6eb,_0x1abfe3){var _0x1c7845={'raw':![],'where':{'id':_0x32e6eb[_0x520b('0x43')]['id']}},_0x11dc5d={};_0x11dc5d[_0x520b('0x32')]=_[_0x520b('0x34')](db[_0x520b('0x2d')][_0x520b('0x2e')]);_0x11dc5d[_0x520b('0x33')]=_[_0x520b('0x34')](_0x32e6eb[_0x520b('0x33')]);_0x11dc5d[_0x520b('0x35')]=_[_0x520b('0x36')](_0x11dc5d[_0x520b('0x32')],_0x11dc5d[_0x520b('0x33')]);_0x1c7845[_0x520b('0x37')]=_[_0x520b('0x36')](_0x11dc5d['model'],qs[_0x520b('0x44')](_0x32e6eb[_0x520b('0x33')]['fields']));_0x1c7845[_0x520b('0x37')]=_0x1c7845['attributes'][_0x520b('0x38')]?_0x1c7845[_0x520b('0x37')]:_0x11dc5d[_0x520b('0x32')];if(_0x32e6eb[_0x520b('0x33')]['includeAll']){_0x1c7845['include']=[{'all':!![]}];}_0x1c7845=_[_0x520b('0x3f')]({},_0x1c7845,_0x32e6eb[_0x520b('0x40')]);return db[_0x520b('0x2d')]['find'](_0x1c7845)[_0x520b('0x25')](handleEntityNotFound(_0x1abfe3,null))['then'](respondWithResult(_0x1abfe3,null))[_0x520b('0x45')](handleError(_0x1abfe3,null));};exports[_0x520b('0x46')]=function(_0x244f39,_0x4bbfeb){return db[_0x520b('0x2d')][_0x520b('0x46')](_0x244f39['body'],{})[_0x520b('0x25')](respondWithResult(_0x4bbfeb,0xc9))[_0x520b('0x45')](handleError(_0x4bbfeb,null));};exports[_0x520b('0x47')]=function(_0x40811e,_0x348797){if(_0x40811e[_0x520b('0x48')]['id']){delete _0x40811e[_0x520b('0x48')]['id'];}return db[_0x520b('0x2d')][_0x520b('0x49')]({'where':{'id':_0x40811e[_0x520b('0x43')]['id']}})[_0x520b('0x25')](handleEntityNotFound(_0x348797,null))[_0x520b('0x25')](saveUpdates(_0x40811e['body'],null))[_0x520b('0x25')](respondWithResult(_0x348797,null))[_0x520b('0x45')](handleError(_0x348797,null));};exports[_0x520b('0x26')]=function(_0x5c4d54,_0x26068c){return db['DeskConfiguration']['find']({'where':{'id':_0x5c4d54[_0x520b('0x43')]['id']}})['then'](handleEntityNotFound(_0x26068c,null))[_0x520b('0x25')](removeEntity(_0x26068c,null))[_0x520b('0x45')](handleError(_0x26068c,null));};exports[_0x520b('0x4a')]=function(_0x49bb41,_0x40d766,_0x5d941d){var _0x412975={};var _0x4f8bf5={};var _0x233d34;var _0x197c4e;return db[_0x520b('0x2d')][_0x520b('0x4b')]({'where':{'id':_0x49bb41[_0x520b('0x43')]['id']}})[_0x520b('0x25')](handleEntityNotFound(_0x40d766,null))['then'](function(_0x2948d6){if(_0x2948d6){_0x233d34=_0x2948d6;_0x4f8bf5['model']=_[_0x520b('0x34')](db[_0x520b('0x4c')][_0x520b('0x2e')]);_0x4f8bf5['query']=_['keys'](_0x49bb41['query']);_0x4f8bf5[_0x520b('0x35')]=_[_0x520b('0x36')](_0x4f8bf5[_0x520b('0x32')],_0x4f8bf5[_0x520b('0x33')]);_0x412975[_0x520b('0x37')]=_[_0x520b('0x36')](_0x4f8bf5[_0x520b('0x32')],qs[_0x520b('0x44')](_0x49bb41[_0x520b('0x33')][_0x520b('0x44')]));_0x412975[_0x520b('0x37')]=_0x412975[_0x520b('0x37')][_0x520b('0x38')]?_0x412975[_0x520b('0x37')]:_0x4f8bf5[_0x520b('0x32')];_0x412975['order']=qs['sort'](_0x49bb41[_0x520b('0x33')][_0x520b('0x3c')]);_0x412975['where']=qs[_0x520b('0x35')](_[_0x520b('0x4d')](_0x49bb41[_0x520b('0x33')],_0x4f8bf5['filters']));if(_0x49bb41[_0x520b('0x33')][_0x520b('0x3e')]){_0x412975[_0x520b('0x3d')]=_[_0x520b('0x3f')](_0x412975[_0x520b('0x3d')],{'$or':_[_0x520b('0x2c')](_0x412975['attributes'],function(_0x47658f){var _0x2560d7={};_0x2560d7[_0x47658f]={'$like':'%'+_0x49bb41[_0x520b('0x33')][_0x520b('0x3e')]+'%'};return _0x2560d7;})});}_0x412975=_[_0x520b('0x3f')]({},_0x412975,_0x49bb41[_0x520b('0x40')]);return _0x233d34['getFields'](_0x412975);}})[_0x520b('0x25')](function(_0x4e1fb9){if(_0x4e1fb9){_0x197c4e=_0x4e1fb9[_0x520b('0x38')];if(!_0x49bb41[_0x520b('0x33')]['hasOwnProperty'](_0x520b('0x39'))){_0x412975['limit']=qs[_0x520b('0x3a')](_0x49bb41['query'][_0x520b('0x3a')]);_0x412975[_0x520b('0x1f')]=qs['offset'](_0x49bb41['query']['offset']);}return _0x233d34[_0x520b('0x4a')](_0x412975);}})[_0x520b('0x25')](function(_0x22cba7){if(_0x22cba7){return _0x22cba7?{'count':_0x197c4e,'rows':_0x22cba7}:null;}})[_0x520b('0x25')](respondWithResult(_0x40d766,null))['catch'](handleError(_0x40d766,null));};exports['getSubjects']=function(_0xf895a1,_0x478585,_0x431ccf){var _0x3f229e={};var _0x3459c3={};var _0x2d7eef;var _0x53297b;return db[_0x520b('0x2d')][_0x520b('0x4b')]({'where':{'id':_0xf895a1['params']['id']}})[_0x520b('0x25')](handleEntityNotFound(_0x478585,null))[_0x520b('0x25')](function(_0x393ec0){if(_0x393ec0){_0x2d7eef=_0x393ec0;_0x3459c3[_0x520b('0x32')]=_[_0x520b('0x34')](db[_0x520b('0x4c')][_0x520b('0x2e')]);_0x3459c3[_0x520b('0x33')]=_[_0x520b('0x34')](_0xf895a1['query']);_0x3459c3[_0x520b('0x35')]=_[_0x520b('0x36')](_0x3459c3[_0x520b('0x32')],_0x3459c3[_0x520b('0x33')]);_0x3f229e[_0x520b('0x37')]=_[_0x520b('0x36')](_0x3459c3[_0x520b('0x32')],qs[_0x520b('0x44')](_0xf895a1[_0x520b('0x33')][_0x520b('0x44')]));_0x3f229e['attributes']=_0x3f229e[_0x520b('0x37')][_0x520b('0x38')]?_0x3f229e['attributes']:_0x3459c3[_0x520b('0x32')];_0x3f229e['order']=qs[_0x520b('0x3c')](_0xf895a1['query'][_0x520b('0x3c')]);_0x3f229e['where']=qs['filters'](_[_0x520b('0x4d')](_0xf895a1['query'],_0x3459c3['filters']));if(_0xf895a1[_0x520b('0x33')]['filter']){_0x3f229e[_0x520b('0x3d')]=_['merge'](_0x3f229e[_0x520b('0x3d')],{'$or':_[_0x520b('0x2c')](_0x3f229e[_0x520b('0x37')],function(_0xe818a1){var _0x552023={};_0x552023[_0xe818a1]={'$like':'%'+_0xf895a1[_0x520b('0x33')][_0x520b('0x3e')]+'%'};return _0x552023;})});}_0x3f229e=_['merge']({},_0x3f229e,_0xf895a1[_0x520b('0x40')]);return _0x2d7eef[_0x520b('0x4e')](_0x3f229e);}})['then'](function(_0x387fa8){if(_0x387fa8){_0x53297b=_0x387fa8[_0x520b('0x38')];if(!_0xf895a1[_0x520b('0x33')][_0x520b('0x4f')](_0x520b('0x39'))){_0x3f229e[_0x520b('0x3a')]=qs[_0x520b('0x3a')](_0xf895a1[_0x520b('0x33')][_0x520b('0x3a')]);_0x3f229e['offset']=qs[_0x520b('0x1f')](_0xf895a1['query'][_0x520b('0x1f')]);}return _0x2d7eef[_0x520b('0x4e')](_0x3f229e);}})['then'](function(_0x2b9988){if(_0x2b9988){return _0x2b9988?{'count':_0x53297b,'rows':_0x2b9988}:null;}})[_0x520b('0x25')](respondWithResult(_0x478585,null))[_0x520b('0x45')](handleError(_0x478585,null));};exports[_0x520b('0x50')]=function(_0x406d58,_0x4bff46,_0xb77b79){var _0x4b27b7={};var _0x4e647={};var _0x5220e4;var _0x1755d3;return db[_0x520b('0x2d')]['findOne']({'where':{'id':_0x406d58['params']['id']}})[_0x520b('0x25')](handleEntityNotFound(_0x4bff46,null))['then'](function(_0x5655e2){if(_0x5655e2){_0x5220e4=_0x5655e2;_0x4e647['model']=_['keys'](db[_0x520b('0x4c')][_0x520b('0x2e')]);_0x4e647[_0x520b('0x33')]=_['keys'](_0x406d58['query']);_0x4e647[_0x520b('0x35')]=_[_0x520b('0x36')](_0x4e647['model'],_0x4e647[_0x520b('0x33')]);_0x4b27b7[_0x520b('0x37')]=_['intersection'](_0x4e647['model'],qs[_0x520b('0x44')](_0x406d58['query'][_0x520b('0x44')]));_0x4b27b7[_0x520b('0x37')]=_0x4b27b7['attributes'][_0x520b('0x38')]?_0x4b27b7['attributes']:_0x4e647[_0x520b('0x32')];_0x4b27b7[_0x520b('0x3b')]=qs[_0x520b('0x3c')](_0x406d58[_0x520b('0x33')][_0x520b('0x3c')]);_0x4b27b7[_0x520b('0x3d')]=qs[_0x520b('0x35')](_['pick'](_0x406d58[_0x520b('0x33')],_0x4e647[_0x520b('0x35')]));if(_0x406d58[_0x520b('0x33')][_0x520b('0x3e')]){_0x4b27b7[_0x520b('0x3d')]=_[_0x520b('0x3f')](_0x4b27b7[_0x520b('0x3d')],{'$or':_['map'](_0x4b27b7['attributes'],function(_0x4e5eb1){var _0x3070f6={};_0x3070f6[_0x4e5eb1]={'$like':'%'+_0x406d58[_0x520b('0x33')][_0x520b('0x3e')]+'%'};return _0x3070f6;})});}_0x4b27b7=_[_0x520b('0x3f')]({},_0x4b27b7,_0x406d58[_0x520b('0x40')]);return _0x5220e4[_0x520b('0x50')](_0x4b27b7);}})[_0x520b('0x25')](function(_0x567e3b){if(_0x567e3b){_0x1755d3=_0x567e3b[_0x520b('0x38')];if(!_0x406d58['query'][_0x520b('0x4f')](_0x520b('0x39'))){_0x4b27b7[_0x520b('0x3a')]=qs['limit'](_0x406d58[_0x520b('0x33')][_0x520b('0x3a')]);_0x4b27b7[_0x520b('0x1f')]=qs[_0x520b('0x1f')](_0x406d58[_0x520b('0x33')]['offset']);}return _0x5220e4['getDescriptions'](_0x4b27b7);}})[_0x520b('0x25')](function(_0x632b78){if(_0x632b78){return _0x632b78?{'count':_0x1755d3,'rows':_0x632b78}:null;}})[_0x520b('0x25')](respondWithResult(_0x4bff46,null))['catch'](handleError(_0x4bff46,null));};exports[_0x520b('0x51')]=function(_0x5d8746,_0x3a9be2,_0x29072d){var _0x528894={};var _0x5b5f06={};var _0x42b2db;var _0x3274d5;return db[_0x520b('0x2d')][_0x520b('0x4b')]({'where':{'id':_0x5d8746['params']['id']}})[_0x520b('0x25')](handleEntityNotFound(_0x3a9be2,null))[_0x520b('0x25')](function(_0x3b7191){if(_0x3b7191){_0x42b2db=_0x3b7191;_0x5b5f06[_0x520b('0x32')]=_[_0x520b('0x34')](db[_0x520b('0x52')][_0x520b('0x2e')]);_0x5b5f06[_0x520b('0x33')]=_['keys'](_0x5d8746[_0x520b('0x33')]);_0x5b5f06[_0x520b('0x35')]=_['intersection'](_0x5b5f06[_0x520b('0x32')],_0x5b5f06[_0x520b('0x33')]);_0x528894[_0x520b('0x37')]=_[_0x520b('0x36')](_0x5b5f06[_0x520b('0x32')],qs[_0x520b('0x44')](_0x5d8746[_0x520b('0x33')][_0x520b('0x44')]));_0x528894[_0x520b('0x37')]=_0x528894['attributes'][_0x520b('0x38')]?_0x528894['attributes']:_0x5b5f06[_0x520b('0x32')];_0x528894['order']=qs[_0x520b('0x3c')](_0x5d8746[_0x520b('0x33')][_0x520b('0x3c')]);_0x528894['where']=qs[_0x520b('0x35')](_[_0x520b('0x4d')](_0x5d8746[_0x520b('0x33')],_0x5b5f06[_0x520b('0x35')]));if(_0x5d8746[_0x520b('0x33')][_0x520b('0x3e')]){_0x528894[_0x520b('0x3d')]=_['merge'](_0x528894[_0x520b('0x3d')],{'$or':_[_0x520b('0x2c')](_0x528894['attributes'],function(_0x4b1d67){var _0x2159d7={};_0x2159d7[_0x4b1d67]={'$like':'%'+_0x5d8746[_0x520b('0x33')][_0x520b('0x3e')]+'%'};return _0x2159d7;})});}_0x528894=_[_0x520b('0x3f')]({},_0x528894,_0x5d8746[_0x520b('0x40')]);return _0x42b2db[_0x520b('0x51')](_0x528894);}})[_0x520b('0x25')](function(_0x38fbb5){if(_0x38fbb5){_0x3274d5=_0x38fbb5[_0x520b('0x38')];if(!_0x5d8746[_0x520b('0x33')][_0x520b('0x4f')](_0x520b('0x39'))){_0x528894[_0x520b('0x3a')]=qs[_0x520b('0x3a')](_0x5d8746[_0x520b('0x33')]['limit']);_0x528894[_0x520b('0x1f')]=qs[_0x520b('0x1f')](_0x5d8746[_0x520b('0x33')][_0x520b('0x1f')]);}return _0x42b2db[_0x520b('0x51')](_0x528894);}})['then'](function(_0x1a1f3e){if(_0x1a1f3e){return _0x1a1f3e?{'count':_0x3274d5,'rows':_0x1a1f3e}:null;}})[_0x520b('0x25')](respondWithResult(_0x3a9be2,null))[_0x520b('0x45')](handleError(_0x3a9be2,null));};exports['setTags']=function(_0xdf4cf4,_0x132290,_0x21e199){if(_0xdf4cf4[_0x520b('0x48')]['id']){delete _0xdf4cf4[_0x520b('0x48')]['id'];}return db[_0x520b('0x2d')][_0x520b('0x4b')]({'where':{'id':_0xdf4cf4[_0x520b('0x43')]['id']}})['then'](handleEntityNotFound(_0x132290,null))[_0x520b('0x25')](function(_0x3aa91b){if(_0x3aa91b){return _0x3aa91b[_0x520b('0x53')](_0xdf4cf4['body'][_0x520b('0x54')]||[]);}return null;})[_0x520b('0x25')](respondWithResult(_0x132290,null))[_0x520b('0x45')](handleError(_0x132290,null));}; \ No newline at end of file +var _0x5813=['includeAll','include','findAll','catch','params','length','create','body','find','getFields','pick','nolimit','getSubjects','findOne','hasOwnProperty','DeskField','getDescriptions','getTags','Tag','setTags','ids','rimraf','fast-json-patch','moment','bluebird','mustache','sox','to-csv','ejs','fs-extra','squel','crypto','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','offset','limit','count','set','Content-Range','json','apply','reject','save','update','then','destroy','error','stack','name','index','map','DeskConfiguration','rawAttributes','fieldName','type','model','query','keys','filters','attributes','intersection','fields','order','sort','where','merge','VIRTUAL','filter','options'];(function(_0x9012de,_0x41f802){var _0x39b2ff=function(_0x394b79){while(--_0x394b79){_0x9012de['push'](_0x9012de['shift']());}};_0x39b2ff(++_0x41f802);}(_0x5813,0x69));var _0x3581=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0x5813[_0x321bb2];return _0x9c12ed;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x3581('0x0'));var zipdir=require('zip-dir');var jsonpatch=require(_0x3581('0x1'));var rp=require('request-promise');var moment=require(_0x3581('0x2'));var BPromise=require(_0x3581('0x3'));var Mustache=require(_0x3581('0x4'));var util=require('util');var path=require('path');var sox=require(_0x3581('0x5'));var csv=require(_0x3581('0x6'));var ejs=require(_0x3581('0x7'));var fs=require('fs');var fs_extra=require(_0x3581('0x8'));var _=require('lodash');var squel=require(_0x3581('0x9'));var crypto=require(_0x3581('0xa'));var jsforce=require(_0x3581('0xb'));var deskjs=require(_0x3581('0xc'));var toCsv=require(_0x3581('0x6'));var querystring=require(_0x3581('0xd'));var Papa=require('papaparse');var Redis=require(_0x3581('0xe'));var authService=require(_0x3581('0xf'));var qs=require(_0x3581('0x10'));var as=require(_0x3581('0x11'));var hardwareService=require(_0x3581('0x12'));var logger=require(_0x3581('0x13'))(_0x3581('0x14'));var utils=require(_0x3581('0x15'));var config=require(_0x3581('0x16'));var licenseUtil=require(_0x3581('0x17'));var db=require(_0x3581('0x18'))['db'];function respondWithStatusCode(_0x220834,_0x4de261){_0x4de261=_0x4de261||0xcc;return function(_0x2f025d){if(_0x2f025d){return _0x220834[_0x3581('0x19')](_0x4de261);}return _0x220834[_0x3581('0x1a')](_0x4de261)[_0x3581('0x1b')]();};}function respondWithResult(_0x439da7,_0x4d7297){_0x4d7297=_0x4d7297||0xc8;return function(_0x310787){if(_0x310787){return _0x439da7['status'](_0x4d7297)['json'](_0x310787);}};}function respondWithFilteredResult(_0x316313,_0x2228dc){return function(_0xdf4be8){if(_0xdf4be8){var _0x15821c=typeof _0x2228dc[_0x3581('0x1c')]==='undefined'&&typeof _0x2228dc[_0x3581('0x1d')]==='undefined';var _0x267fb3=_0xdf4be8[_0x3581('0x1e')];var _0x4c0ada=_0x15821c?0x0:_0x2228dc['offset'];var _0x3283c9=_0x15821c?_0xdf4be8[_0x3581('0x1e')]:_0x2228dc[_0x3581('0x1c')]+_0x2228dc[_0x3581('0x1d')];var _0x404158;if(_0x3283c9>=_0x267fb3){_0x3283c9=_0x267fb3;_0x404158=0xc8;}else{_0x404158=0xce;}_0x316313['status'](_0x404158);return _0x316313[_0x3581('0x1f')](_0x3581('0x20'),_0x4c0ada+'-'+_0x3283c9+'/'+_0x267fb3)[_0x3581('0x21')](_0xdf4be8);}return null;};}function patchUpdates(_0x136234){return function(_0xc081ec){try{jsonpatch[_0x3581('0x22')](_0xc081ec,_0x136234,!![]);}catch(_0x4bc110){return BPromise[_0x3581('0x23')](_0x4bc110);}return _0xc081ec[_0x3581('0x24')]();};}function saveUpdates(_0x1d65dd,_0x3e117a){return function(_0x953a00){if(_0x953a00){return _0x953a00[_0x3581('0x25')](_0x1d65dd)[_0x3581('0x26')](function(_0x5a1324){return _0x5a1324;});}return null;};}function removeEntity(_0x2728ab,_0x5cc6e3){return function(_0xd69b33){if(_0xd69b33){return _0xd69b33[_0x3581('0x27')]()[_0x3581('0x26')](function(){_0x2728ab[_0x3581('0x1a')](0xcc)[_0x3581('0x1b')]();});}};}function handleEntityNotFound(_0x392cd2,_0x2596cf){return function(_0x2ff205){if(!_0x2ff205){_0x392cd2['sendStatus'](0x194);}return _0x2ff205;};}function handleError(_0x9e6613,_0x182ff2){_0x182ff2=_0x182ff2||0x1f4;return function(_0x27d48a){logger[_0x3581('0x28')](_0x27d48a[_0x3581('0x29')]);if(_0x27d48a[_0x3581('0x2a')]){delete _0x27d48a[_0x3581('0x2a')];}_0x9e6613[_0x3581('0x1a')](_0x182ff2)['send'](_0x27d48a);};}exports[_0x3581('0x2b')]=function(_0x471322,_0x10e78e){var _0xddeb98={},_0x218d59={},_0x5666d2={'count':0x0,'rows':[]};var _0x32a50d=_[_0x3581('0x2c')](db[_0x3581('0x2d')][_0x3581('0x2e')],function(_0x468d1f){return{'name':_0x468d1f[_0x3581('0x2f')],'type':_0x468d1f[_0x3581('0x30')]['key']};});_0x218d59[_0x3581('0x31')]=_[_0x3581('0x2c')](_0x32a50d,_0x3581('0x2a'));_0x218d59[_0x3581('0x32')]=_[_0x3581('0x33')](_0x471322[_0x3581('0x32')]);_0x218d59[_0x3581('0x34')]=_['intersection'](_0x218d59[_0x3581('0x31')],_0x218d59[_0x3581('0x32')]);_0xddeb98[_0x3581('0x35')]=_[_0x3581('0x36')](_0x218d59[_0x3581('0x31')],qs[_0x3581('0x37')](_0x471322['query']['fields']));_0xddeb98[_0x3581('0x35')]=_0xddeb98['attributes']['length']?_0xddeb98[_0x3581('0x35')]:_0x218d59[_0x3581('0x31')];if(!_0x471322[_0x3581('0x32')]['hasOwnProperty']('nolimit')){_0xddeb98[_0x3581('0x1d')]=qs[_0x3581('0x1d')](_0x471322[_0x3581('0x32')]['limit']);_0xddeb98['offset']=qs[_0x3581('0x1c')](_0x471322[_0x3581('0x32')][_0x3581('0x1c')]);}_0xddeb98[_0x3581('0x38')]=qs[_0x3581('0x39')](_0x471322[_0x3581('0x32')][_0x3581('0x39')]);_0xddeb98[_0x3581('0x3a')]=qs[_0x3581('0x34')](_['pick'](_0x471322['query'],_0x218d59[_0x3581('0x34')]),_0x32a50d);if(_0x471322['query']['filter']){_0xddeb98[_0x3581('0x3a')]=_[_0x3581('0x3b')](_0xddeb98['where'],{'$or':_[_0x3581('0x2c')](_0x32a50d,function(_0x1dfab9){if(_0x1dfab9[_0x3581('0x30')]!==_0x3581('0x3c')){var _0x2bbf7f={};_0x2bbf7f[_0x1dfab9[_0x3581('0x2a')]]={'$like':'%'+_0x471322['query'][_0x3581('0x3d')]+'%'};return _0x2bbf7f;}})});}_0xddeb98=_['merge']({},_0xddeb98,_0x471322[_0x3581('0x3e')]);var _0x3949a9={'where':_0xddeb98[_0x3581('0x3a')]};return db['DeskConfiguration'][_0x3581('0x1e')](_0x3949a9)[_0x3581('0x26')](function(_0x56bcbf){_0x5666d2[_0x3581('0x1e')]=_0x56bcbf;if(_0x471322['query'][_0x3581('0x3f')]){_0xddeb98[_0x3581('0x40')]=[{'all':!![]}];}return db[_0x3581('0x2d')][_0x3581('0x41')](_0xddeb98);})['then'](function(_0x48b610){_0x5666d2['rows']=_0x48b610;return _0x5666d2;})[_0x3581('0x26')](respondWithFilteredResult(_0x10e78e,_0xddeb98))[_0x3581('0x42')](handleError(_0x10e78e,null));};exports['show']=function(_0x28c51b,_0x2fe400){var _0xbe4a1f={'raw':![],'where':{'id':_0x28c51b[_0x3581('0x43')]['id']}},_0x2c110d={};_0x2c110d[_0x3581('0x31')]=_[_0x3581('0x33')](db[_0x3581('0x2d')][_0x3581('0x2e')]);_0x2c110d[_0x3581('0x32')]=_[_0x3581('0x33')](_0x28c51b['query']);_0x2c110d[_0x3581('0x34')]=_[_0x3581('0x36')](_0x2c110d[_0x3581('0x31')],_0x2c110d['query']);_0xbe4a1f[_0x3581('0x35')]=_[_0x3581('0x36')](_0x2c110d['model'],qs[_0x3581('0x37')](_0x28c51b['query']['fields']));_0xbe4a1f[_0x3581('0x35')]=_0xbe4a1f[_0x3581('0x35')][_0x3581('0x44')]?_0xbe4a1f[_0x3581('0x35')]:_0x2c110d[_0x3581('0x31')];if(_0x28c51b[_0x3581('0x32')][_0x3581('0x3f')]){_0xbe4a1f['include']=[{'all':!![]}];}_0xbe4a1f=_[_0x3581('0x3b')]({},_0xbe4a1f,_0x28c51b[_0x3581('0x3e')]);return db[_0x3581('0x2d')]['find'](_0xbe4a1f)['then'](handleEntityNotFound(_0x2fe400,null))[_0x3581('0x26')](respondWithResult(_0x2fe400,null))[_0x3581('0x42')](handleError(_0x2fe400,null));};exports[_0x3581('0x45')]=function(_0x44def5,_0x3b979b){return db[_0x3581('0x2d')]['create'](_0x44def5['body'],{})[_0x3581('0x26')](respondWithResult(_0x3b979b,0xc9))[_0x3581('0x42')](handleError(_0x3b979b,null));};exports[_0x3581('0x25')]=function(_0x4c71fa,_0x46a15b){if(_0x4c71fa[_0x3581('0x46')]['id']){delete _0x4c71fa['body']['id'];}return db[_0x3581('0x2d')][_0x3581('0x47')]({'where':{'id':_0x4c71fa[_0x3581('0x43')]['id']}})[_0x3581('0x26')](handleEntityNotFound(_0x46a15b,null))[_0x3581('0x26')](saveUpdates(_0x4c71fa[_0x3581('0x46')],null))[_0x3581('0x26')](respondWithResult(_0x46a15b,null))[_0x3581('0x42')](handleError(_0x46a15b,null));};exports['destroy']=function(_0x32dc2e,_0xcb368){return db['DeskConfiguration'][_0x3581('0x47')]({'where':{'id':_0x32dc2e[_0x3581('0x43')]['id']}})[_0x3581('0x26')](handleEntityNotFound(_0xcb368,null))['then'](removeEntity(_0xcb368,null))[_0x3581('0x42')](handleError(_0xcb368,null));};exports[_0x3581('0x48')]=function(_0x3f5ce2,_0x1dd264,_0xedeba2){var _0x2e0a15={};var _0x3ff724={};var _0x5ea27e;var _0x3f32d8;return db['DeskConfiguration']['findOne']({'where':{'id':_0x3f5ce2[_0x3581('0x43')]['id']}})[_0x3581('0x26')](handleEntityNotFound(_0x1dd264,null))['then'](function(_0x6304c1){if(_0x6304c1){_0x5ea27e=_0x6304c1;_0x3ff724[_0x3581('0x31')]=_[_0x3581('0x33')](db['DeskField']['rawAttributes']);_0x3ff724[_0x3581('0x32')]=_[_0x3581('0x33')](_0x3f5ce2[_0x3581('0x32')]);_0x3ff724[_0x3581('0x34')]=_[_0x3581('0x36')](_0x3ff724['model'],_0x3ff724[_0x3581('0x32')]);_0x2e0a15[_0x3581('0x35')]=_[_0x3581('0x36')](_0x3ff724[_0x3581('0x31')],qs[_0x3581('0x37')](_0x3f5ce2[_0x3581('0x32')][_0x3581('0x37')]));_0x2e0a15[_0x3581('0x35')]=_0x2e0a15[_0x3581('0x35')]['length']?_0x2e0a15['attributes']:_0x3ff724['model'];_0x2e0a15['order']=qs[_0x3581('0x39')](_0x3f5ce2[_0x3581('0x32')][_0x3581('0x39')]);_0x2e0a15[_0x3581('0x3a')]=qs[_0x3581('0x34')](_[_0x3581('0x49')](_0x3f5ce2[_0x3581('0x32')],_0x3ff724[_0x3581('0x34')]));if(_0x3f5ce2[_0x3581('0x32')]['filter']){_0x2e0a15[_0x3581('0x3a')]=_[_0x3581('0x3b')](_0x2e0a15['where'],{'$or':_[_0x3581('0x2c')](_0x2e0a15[_0x3581('0x35')],function(_0x3d254a){var _0x4300b1={};_0x4300b1[_0x3d254a]={'$like':'%'+_0x3f5ce2[_0x3581('0x32')][_0x3581('0x3d')]+'%'};return _0x4300b1;})});}_0x2e0a15=_[_0x3581('0x3b')]({},_0x2e0a15,_0x3f5ce2[_0x3581('0x3e')]);return _0x5ea27e[_0x3581('0x48')](_0x2e0a15);}})['then'](function(_0x3b4403){if(_0x3b4403){_0x3f32d8=_0x3b4403[_0x3581('0x44')];if(!_0x3f5ce2[_0x3581('0x32')]['hasOwnProperty'](_0x3581('0x4a'))){_0x2e0a15[_0x3581('0x1d')]=qs[_0x3581('0x1d')](_0x3f5ce2[_0x3581('0x32')]['limit']);_0x2e0a15[_0x3581('0x1c')]=qs[_0x3581('0x1c')](_0x3f5ce2['query'][_0x3581('0x1c')]);}return _0x5ea27e[_0x3581('0x48')](_0x2e0a15);}})[_0x3581('0x26')](function(_0x491e2e){if(_0x491e2e){return _0x491e2e?{'count':_0x3f32d8,'rows':_0x491e2e}:null;}})[_0x3581('0x26')](respondWithResult(_0x1dd264,null))['catch'](handleError(_0x1dd264,null));};exports[_0x3581('0x4b')]=function(_0x41a648,_0x39727e,_0x587727){var _0x3a9457={};var _0x2505f3={};var _0x315a1c;var _0x3a63b8;return db['DeskConfiguration'][_0x3581('0x4c')]({'where':{'id':_0x41a648[_0x3581('0x43')]['id']}})['then'](handleEntityNotFound(_0x39727e,null))['then'](function(_0x552b33){if(_0x552b33){_0x315a1c=_0x552b33;_0x2505f3[_0x3581('0x31')]=_['keys'](db['DeskField'][_0x3581('0x2e')]);_0x2505f3['query']=_[_0x3581('0x33')](_0x41a648[_0x3581('0x32')]);_0x2505f3[_0x3581('0x34')]=_[_0x3581('0x36')](_0x2505f3[_0x3581('0x31')],_0x2505f3[_0x3581('0x32')]);_0x3a9457['attributes']=_[_0x3581('0x36')](_0x2505f3['model'],qs['fields'](_0x41a648[_0x3581('0x32')][_0x3581('0x37')]));_0x3a9457[_0x3581('0x35')]=_0x3a9457[_0x3581('0x35')][_0x3581('0x44')]?_0x3a9457[_0x3581('0x35')]:_0x2505f3[_0x3581('0x31')];_0x3a9457[_0x3581('0x38')]=qs['sort'](_0x41a648[_0x3581('0x32')][_0x3581('0x39')]);_0x3a9457[_0x3581('0x3a')]=qs[_0x3581('0x34')](_[_0x3581('0x49')](_0x41a648[_0x3581('0x32')],_0x2505f3[_0x3581('0x34')]));if(_0x41a648['query'][_0x3581('0x3d')]){_0x3a9457['where']=_[_0x3581('0x3b')](_0x3a9457['where'],{'$or':_['map'](_0x3a9457[_0x3581('0x35')],function(_0x1f99a9){var _0x5723a3={};_0x5723a3[_0x1f99a9]={'$like':'%'+_0x41a648[_0x3581('0x32')][_0x3581('0x3d')]+'%'};return _0x5723a3;})});}_0x3a9457=_[_0x3581('0x3b')]({},_0x3a9457,_0x41a648['options']);return _0x315a1c['getSubjects'](_0x3a9457);}})[_0x3581('0x26')](function(_0x372184){if(_0x372184){_0x3a63b8=_0x372184['length'];if(!_0x41a648[_0x3581('0x32')][_0x3581('0x4d')](_0x3581('0x4a'))){_0x3a9457[_0x3581('0x1d')]=qs[_0x3581('0x1d')](_0x41a648[_0x3581('0x32')][_0x3581('0x1d')]);_0x3a9457[_0x3581('0x1c')]=qs[_0x3581('0x1c')](_0x41a648['query'][_0x3581('0x1c')]);}return _0x315a1c[_0x3581('0x4b')](_0x3a9457);}})[_0x3581('0x26')](function(_0x43f6db){if(_0x43f6db){return _0x43f6db?{'count':_0x3a63b8,'rows':_0x43f6db}:null;}})[_0x3581('0x26')](respondWithResult(_0x39727e,null))['catch'](handleError(_0x39727e,null));};exports['getDescriptions']=function(_0x5a4330,_0x35b4f7,_0x126510){var _0x28c3e9={};var _0x427a62={};var _0x5be803;var _0x4ea95e;return db[_0x3581('0x2d')][_0x3581('0x4c')]({'where':{'id':_0x5a4330[_0x3581('0x43')]['id']}})['then'](handleEntityNotFound(_0x35b4f7,null))[_0x3581('0x26')](function(_0x29bc33){if(_0x29bc33){_0x5be803=_0x29bc33;_0x427a62[_0x3581('0x31')]=_['keys'](db[_0x3581('0x4e')]['rawAttributes']);_0x427a62[_0x3581('0x32')]=_[_0x3581('0x33')](_0x5a4330[_0x3581('0x32')]);_0x427a62[_0x3581('0x34')]=_[_0x3581('0x36')](_0x427a62[_0x3581('0x31')],_0x427a62[_0x3581('0x32')]);_0x28c3e9[_0x3581('0x35')]=_['intersection'](_0x427a62[_0x3581('0x31')],qs['fields'](_0x5a4330[_0x3581('0x32')][_0x3581('0x37')]));_0x28c3e9[_0x3581('0x35')]=_0x28c3e9[_0x3581('0x35')]['length']?_0x28c3e9['attributes']:_0x427a62[_0x3581('0x31')];_0x28c3e9['order']=qs[_0x3581('0x39')](_0x5a4330[_0x3581('0x32')][_0x3581('0x39')]);_0x28c3e9['where']=qs[_0x3581('0x34')](_[_0x3581('0x49')](_0x5a4330[_0x3581('0x32')],_0x427a62['filters']));if(_0x5a4330[_0x3581('0x32')]['filter']){_0x28c3e9['where']=_[_0x3581('0x3b')](_0x28c3e9[_0x3581('0x3a')],{'$or':_[_0x3581('0x2c')](_0x28c3e9[_0x3581('0x35')],function(_0x3d11d7){var _0x41a200={};_0x41a200[_0x3d11d7]={'$like':'%'+_0x5a4330['query'][_0x3581('0x3d')]+'%'};return _0x41a200;})});}_0x28c3e9=_['merge']({},_0x28c3e9,_0x5a4330[_0x3581('0x3e')]);return _0x5be803[_0x3581('0x4f')](_0x28c3e9);}})[_0x3581('0x26')](function(_0x169184){if(_0x169184){_0x4ea95e=_0x169184['length'];if(!_0x5a4330['query'][_0x3581('0x4d')](_0x3581('0x4a'))){_0x28c3e9[_0x3581('0x1d')]=qs[_0x3581('0x1d')](_0x5a4330['query'][_0x3581('0x1d')]);_0x28c3e9[_0x3581('0x1c')]=qs[_0x3581('0x1c')](_0x5a4330[_0x3581('0x32')][_0x3581('0x1c')]);}return _0x5be803[_0x3581('0x4f')](_0x28c3e9);}})[_0x3581('0x26')](function(_0x29fe0c){if(_0x29fe0c){return _0x29fe0c?{'count':_0x4ea95e,'rows':_0x29fe0c}:null;}})[_0x3581('0x26')](respondWithResult(_0x35b4f7,null))[_0x3581('0x42')](handleError(_0x35b4f7,null));};exports[_0x3581('0x50')]=function(_0x24d7a2,_0x4cd529,_0x506b26){var _0x331be0={};var _0x5eea10={};var _0x23cd4e;var _0x2a29c6;return db[_0x3581('0x2d')]['findOne']({'where':{'id':_0x24d7a2[_0x3581('0x43')]['id']}})[_0x3581('0x26')](handleEntityNotFound(_0x4cd529,null))[_0x3581('0x26')](function(_0x1b68d6){if(_0x1b68d6){_0x23cd4e=_0x1b68d6;_0x5eea10[_0x3581('0x31')]=_[_0x3581('0x33')](db[_0x3581('0x51')][_0x3581('0x2e')]);_0x5eea10[_0x3581('0x32')]=_[_0x3581('0x33')](_0x24d7a2[_0x3581('0x32')]);_0x5eea10[_0x3581('0x34')]=_[_0x3581('0x36')](_0x5eea10[_0x3581('0x31')],_0x5eea10[_0x3581('0x32')]);_0x331be0[_0x3581('0x35')]=_[_0x3581('0x36')](_0x5eea10['model'],qs[_0x3581('0x37')](_0x24d7a2[_0x3581('0x32')][_0x3581('0x37')]));_0x331be0[_0x3581('0x35')]=_0x331be0[_0x3581('0x35')][_0x3581('0x44')]?_0x331be0[_0x3581('0x35')]:_0x5eea10[_0x3581('0x31')];_0x331be0[_0x3581('0x38')]=qs[_0x3581('0x39')](_0x24d7a2[_0x3581('0x32')][_0x3581('0x39')]);_0x331be0[_0x3581('0x3a')]=qs[_0x3581('0x34')](_[_0x3581('0x49')](_0x24d7a2[_0x3581('0x32')],_0x5eea10[_0x3581('0x34')]));if(_0x24d7a2['query'][_0x3581('0x3d')]){_0x331be0[_0x3581('0x3a')]=_[_0x3581('0x3b')](_0x331be0[_0x3581('0x3a')],{'$or':_[_0x3581('0x2c')](_0x331be0[_0x3581('0x35')],function(_0xc2491c){var _0x4e9d22={};_0x4e9d22[_0xc2491c]={'$like':'%'+_0x24d7a2[_0x3581('0x32')][_0x3581('0x3d')]+'%'};return _0x4e9d22;})});}_0x331be0=_[_0x3581('0x3b')]({},_0x331be0,_0x24d7a2[_0x3581('0x3e')]);return _0x23cd4e[_0x3581('0x50')](_0x331be0);}})[_0x3581('0x26')](function(_0x552dd2){if(_0x552dd2){_0x2a29c6=_0x552dd2['length'];if(!_0x24d7a2['query']['hasOwnProperty'](_0x3581('0x4a'))){_0x331be0[_0x3581('0x1d')]=qs[_0x3581('0x1d')](_0x24d7a2[_0x3581('0x32')][_0x3581('0x1d')]);_0x331be0[_0x3581('0x1c')]=qs[_0x3581('0x1c')](_0x24d7a2[_0x3581('0x32')][_0x3581('0x1c')]);}return _0x23cd4e[_0x3581('0x50')](_0x331be0);}})['then'](function(_0x59fd47){if(_0x59fd47){return _0x59fd47?{'count':_0x2a29c6,'rows':_0x59fd47}:null;}})[_0x3581('0x26')](respondWithResult(_0x4cd529,null))['catch'](handleError(_0x4cd529,null));};exports['setTags']=function(_0x285fd6,_0x7df047,_0x406a8d){if(_0x285fd6[_0x3581('0x46')]['id']){delete _0x285fd6[_0x3581('0x46')]['id'];}return db[_0x3581('0x2d')][_0x3581('0x4c')]({'where':{'id':_0x285fd6['params']['id']}})[_0x3581('0x26')](handleEntityNotFound(_0x7df047,null))[_0x3581('0x26')](function(_0x1e458e){if(_0x1e458e){return _0x1e458e[_0x3581('0x52')](_0x285fd6[_0x3581('0x46')][_0x3581('0x53')]||[]);}return null;})[_0x3581('0x26')](respondWithResult(_0x7df047,null))[_0x3581('0x42')](handleError(_0x7df047,null));}; \ No newline at end of file diff --git a/server/api/intDeskConfiguration/intDeskConfiguration.model.js b/server/api/intDeskConfiguration/intDeskConfiguration.model.js index 21d20cf..d388a9a 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 _0x9063=['lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','../../config/environment','./intDeskConfiguration.attributes','exports'];(function(_0x213c71,_0xe432f5){var _0x3453ea=function(_0x172dd7){while(--_0x172dd7){_0x213c71['push'](_0x213c71['shift']());}};_0x3453ea(++_0xe432f5);}(_0x9063,0x1a2));var _0x3906=function(_0x3635ce,_0x33a6f9){_0x3635ce=_0x3635ce-0x0;var _0x97ecd0=_0x9063[_0x3635ce];return _0x97ecd0;};'use strict';var _=require(_0x3906('0x0'));var util=require(_0x3906('0x1'));var logger=require(_0x3906('0x2'))(_0x3906('0x3'));var moment=require(_0x3906('0x4'));var BPromise=require(_0x3906('0x5'));var rp=require(_0x3906('0x6'));var fs=require('fs');var path=require(_0x3906('0x7'));var rimraf=require('rimraf');var config=require(_0x3906('0x8'));var attributes=require(_0x3906('0x9'));module[_0x3906('0xa')]=function(_0x17c286,_0x79d5ae){return _0x17c286['define']('DeskConfiguration',attributes,{'tableName':'int_desk_configurations','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xaefc=['DeskConfiguration','int_desk_configurations','lodash','util','moment','bluebird','request-promise','rimraf','../../config/environment','./intDeskConfiguration.attributes','exports'];(function(_0x4f5fbc,_0x74cb4e){var _0x486e0e=function(_0x306829){while(--_0x306829){_0x4f5fbc['push'](_0x4f5fbc['shift']());}};_0x486e0e(++_0x74cb4e);}(_0xaefc,0xe9));var _0xcaef=function(_0xe09b32,_0x9a33b9){_0xe09b32=_0xe09b32-0x0;var _0x611dfc=_0xaefc[_0xe09b32];return _0x611dfc;};'use strict';var _=require(_0xcaef('0x0'));var util=require(_0xcaef('0x1'));var logger=require('../../config/logger')('api');var moment=require(_0xcaef('0x2'));var BPromise=require(_0xcaef('0x3'));var rp=require(_0xcaef('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0xcaef('0x5'));var config=require(_0xcaef('0x6'));var attributes=require(_0xcaef('0x7'));module[_0xcaef('0x8')]=function(_0x414413,_0x2cdb06){return _0x414413['define'](_0xcaef('0x9'),attributes,{'tableName':_0xcaef('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/intDeskConfiguration/intDeskConfiguration.rpc.js b/server/api/intDeskConfiguration/intDeskConfiguration.rpc.js index 0e24960..fa76a4b 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 _0xfe39=['../../config/environment','jayson/promise','client','http','request','then','info','DeskConfiguration,\x20%s,\x20%s','DeskConfiguration,\x20%s,\x20%s,\x20%s','request\x20sent','error','code','message','result','catch','lodash','util','bluebird','../../mysqldb','../../config/utils'];(function(_0x39905e,_0x225eb1){var _0x5f49b8=function(_0x5c17ad){while(--_0x5c17ad){_0x39905e['push'](_0x39905e['shift']());}};_0x5f49b8(++_0x225eb1);}(_0xfe39,0x1b3));var _0x9fe3=function(_0x29d94e,_0xf386d6){_0x29d94e=_0x29d94e-0x0;var _0x106237=_0xfe39[_0x29d94e];return _0x106237;};'use strict';var _=require(_0x9fe3('0x0'));var util=require(_0x9fe3('0x1'));var moment=require('moment');var BPromise=require(_0x9fe3('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x9fe3('0x3'))['db'];var utils=require(_0x9fe3('0x4'));var logger=require('../../config/logger')('rpc');var config=require(_0x9fe3('0x5'));var jayson=require(_0x9fe3('0x6'));var client=jayson[_0x9fe3('0x7')][_0x9fe3('0x8')]({'port':0x232a});function respondWithRpcPromise(_0xc469b7,_0x4183ce,_0x25868f){return new BPromise(function(_0x5a3bd6,_0x211eb2){return client[_0x9fe3('0x9')](_0xc469b7,_0x25868f)[_0x9fe3('0xa')](function(_0x35c391){logger[_0x9fe3('0xb')](_0x9fe3('0xc'),_0x4183ce,'request\x20sent');logger['debug'](_0x9fe3('0xd'),_0x4183ce,_0x9fe3('0xe'),JSON['stringify'](_0x35c391));if(_0x35c391[_0x9fe3('0xf')]){if(_0x35c391[_0x9fe3('0xf')][_0x9fe3('0x10')]===0x1f4){logger[_0x9fe3('0xf')]('DeskConfiguration,\x20%s,\x20%s',_0x4183ce,_0x35c391[_0x9fe3('0xf')][_0x9fe3('0x11')]);return _0x211eb2(_0x35c391[_0x9fe3('0xf')][_0x9fe3('0x11')]);}logger['error']('DeskConfiguration,\x20%s,\x20%s',_0x4183ce,_0x35c391[_0x9fe3('0xf')][_0x9fe3('0x11')]);return _0x5a3bd6(_0x35c391[_0x9fe3('0xf')][_0x9fe3('0x11')]);}else{logger[_0x9fe3('0xb')]('DeskConfiguration,\x20%s,\x20%s',_0x4183ce,'request\x20sent');_0x5a3bd6(_0x35c391[_0x9fe3('0x12')][_0x9fe3('0x11')]);}})[_0x9fe3('0x13')](function(_0x2d28d4){logger['error'](_0x9fe3('0xc'),_0x4183ce,_0x2d28d4);_0x211eb2(_0x2d28d4);});});} \ No newline at end of file +var _0x969e=['DeskConfiguration,\x20%s,\x20%s','request\x20sent','debug','DeskConfiguration,\x20%s,\x20%s,\x20%s','error','code','message','info','result','catch','lodash','util','bluebird','randomstring','ioredis','rpc','../../config/environment','jayson/promise','client','then'];(function(_0x3ec122,_0x55150a){var _0x4ecf41=function(_0x1709cd){while(--_0x1709cd){_0x3ec122['push'](_0x3ec122['shift']());}};_0x4ecf41(++_0x55150a);}(_0x969e,0x136));var _0xe969=function(_0x5067fd,_0x5ceba6){_0x5067fd=_0x5067fd-0x0;var _0x25ac53=_0x969e[_0x5067fd];return _0x25ac53;};'use strict';var _=require(_0xe969('0x0'));var util=require(_0xe969('0x1'));var moment=require('moment');var BPromise=require(_0xe969('0x2'));var rs=require(_0xe969('0x3'));var fs=require('fs');var Redis=require(_0xe969('0x4'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0xe969('0x5'));var config=require(_0xe969('0x6'));var jayson=require(_0xe969('0x7'));var client=jayson[_0xe969('0x8')]['http']({'port':0x232a});function respondWithRpcPromise(_0x340384,_0x18f8af,_0x2118e2){return new BPromise(function(_0x56b962,_0x4084aa){return client['request'](_0x340384,_0x2118e2)[_0xe969('0x9')](function(_0x2d37e0){logger['info'](_0xe969('0xa'),_0x18f8af,_0xe969('0xb'));logger[_0xe969('0xc')](_0xe969('0xd'),_0x18f8af,_0xe969('0xb'),JSON['stringify'](_0x2d37e0));if(_0x2d37e0[_0xe969('0xe')]){if(_0x2d37e0[_0xe969('0xe')][_0xe969('0xf')]===0x1f4){logger[_0xe969('0xe')](_0xe969('0xa'),_0x18f8af,_0x2d37e0[_0xe969('0xe')]['message']);return _0x4084aa(_0x2d37e0[_0xe969('0xe')]['message']);}logger['error'](_0xe969('0xa'),_0x18f8af,_0x2d37e0[_0xe969('0xe')][_0xe969('0x10')]);return _0x56b962(_0x2d37e0[_0xe969('0xe')]['message']);}else{logger[_0xe969('0x11')](_0xe969('0xa'),_0x18f8af,_0xe969('0xb'));_0x56b962(_0x2d37e0[_0xe969('0x12')][_0xe969('0x10')]);}})[_0xe969('0x13')](function(_0x4c3756){logger['error'](_0xe969('0xa'),_0x18f8af,_0x4c3756);_0x4084aa(_0x4c3756);});});} \ No newline at end of file diff --git a/server/api/intDeskField/index.js b/server/api/intDeskField/index.js index 4fb7ade..4f75883 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 _0x2c02=['connect-timeout','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./intDeskField.controller','get','isAuthenticated','index','/:id','show','post','create','put','update','delete','destroy','exports','multer'];(function(_0x3a13cf,_0x478c62){var _0x4817c=function(_0x3a2e75){while(--_0x3a2e75){_0x3a13cf['push'](_0x3a13cf['shift']());}};_0x4817c(++_0x478c62);}(_0x2c02,0x18e));var _0x22c0=function(_0x44bfca,_0x4c4b95){_0x44bfca=_0x44bfca-0x0;var _0x2944e4=_0x2c02[_0x44bfca];return _0x2944e4;};'use strict';var multer=require(_0x22c0('0x0'));var util=require('util');var path=require('path');var timeout=require(_0x22c0('0x1'));var express=require('express');var router=express[_0x22c0('0x2')]();var fs_extra=require('fs-extra');var auth=require(_0x22c0('0x3'));var interaction=require(_0x22c0('0x4'));var config=require(_0x22c0('0x5'));var controller=require(_0x22c0('0x6'));router[_0x22c0('0x7')]('/',auth[_0x22c0('0x8')](),controller[_0x22c0('0x9')]);router['get'](_0x22c0('0xa'),auth[_0x22c0('0x8')](),controller[_0x22c0('0xb')]);router[_0x22c0('0xc')]('/',auth['isAuthenticated'](),controller[_0x22c0('0xd')]);router[_0x22c0('0xe')](_0x22c0('0xa'),auth[_0x22c0('0x8')](),controller[_0x22c0('0xf')]);router[_0x22c0('0x10')](_0x22c0('0xa'),auth[_0x22c0('0x8')](),controller[_0x22c0('0x11')]);module[_0x22c0('0x12')]=router; \ No newline at end of file +var _0xefcf=['connect-timeout','express','../../components/auth/service','../../components/interaction/service','../../config/environment','isAuthenticated','/:id','show','post','create','update','delete','destroy','exports','multer','util','path'];(function(_0x45efd7,_0x1f3825){var _0x168809=function(_0x585074){while(--_0x585074){_0x45efd7['push'](_0x45efd7['shift']());}};_0x168809(++_0x1f3825);}(_0xefcf,0x184));var _0xfefc=function(_0xd98def,_0x19ebc7){_0xd98def=_0xd98def-0x0;var _0x55b182=_0xefcf[_0xd98def];return _0x55b182;};'use strict';var multer=require(_0xfefc('0x0'));var util=require(_0xfefc('0x1'));var path=require(_0xfefc('0x2'));var timeout=require(_0xfefc('0x3'));var express=require(_0xfefc('0x4'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0xfefc('0x5'));var interaction=require(_0xfefc('0x6'));var config=require(_0xfefc('0x7'));var controller=require('./intDeskField.controller');router['get']('/',auth[_0xfefc('0x8')](),controller['index']);router['get'](_0xfefc('0x9'),auth[_0xfefc('0x8')](),controller[_0xfefc('0xa')]);router[_0xfefc('0xb')]('/',auth[_0xfefc('0x8')](),controller[_0xfefc('0xc')]);router['put']('/:id',auth[_0xfefc('0x8')](),controller[_0xfefc('0xd')]);router[_0xfefc('0xe')](_0xfefc('0x9'),auth[_0xfefc('0x8')](),controller[_0xfefc('0xf')]);module[_0xfefc('0x10')]=router; \ No newline at end of file diff --git a/server/api/intDeskField/intDeskField.attributes.js b/server/api/intDeskField/intDeskField.attributes.js index ebc5d35..238a8f3 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 _0x7698=['variable','customVariable','keyValue','picklist','STRING','BOOLEAN','exports','ENUM'];(function(_0x177ff1,_0x493fb3){var _0x1a2909=function(_0xd0045f){while(--_0xd0045f){_0x177ff1['push'](_0x177ff1['shift']());}};_0x1a2909(++_0x493fb3);}(_0x7698,0x1ee));var _0x8769=function(_0x3c7c53,_0x489c00){_0x3c7c53=_0x3c7c53-0x0;var _0x1c2077=_0x7698[_0x3c7c53];return _0x1c2077;};'use strict';var Sequelize=require('sequelize');module[_0x8769('0x0')]={'type':{'type':Sequelize[_0x8769('0x1')]('string',_0x8769('0x2'),_0x8769('0x3'),_0x8769('0x4'),_0x8769('0x5')),'defaultValue':'string'},'content':{'type':Sequelize[_0x8769('0x6')]},'key':{'type':Sequelize[_0x8769('0x6')]},'keyType':{'type':Sequelize[_0x8769('0x1')]('string','variable',_0x8769('0x3'))},'keyContent':{'type':Sequelize[_0x8769('0x6')]},'idField':{'type':Sequelize[_0x8769('0x6')]},'nameField':{'type':Sequelize[_0x8769('0x6')]},'customField':{'type':Sequelize[_0x8769('0x7')],'defaultValue':!![]},'variableName':{'type':Sequelize[_0x8769('0x6')]}}; \ No newline at end of file +var _0x7604=['keyValue','STRING','sequelize','exports','string','variable','customVariable'];(function(_0x4e8255,_0x53aed4){var _0x3b936e=function(_0x51ac13){while(--_0x51ac13){_0x4e8255['push'](_0x4e8255['shift']());}};_0x3b936e(++_0x53aed4);}(_0x7604,0xe9));var _0x4760=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0x7604[_0x20a584];return _0x4b41a8;};'use strict';var Sequelize=require(_0x4760('0x0'));module[_0x4760('0x1')]={'type':{'type':Sequelize['ENUM'](_0x4760('0x2'),_0x4760('0x3'),_0x4760('0x4'),_0x4760('0x5'),'picklist'),'defaultValue':_0x4760('0x2')},'content':{'type':Sequelize[_0x4760('0x6')]},'key':{'type':Sequelize[_0x4760('0x6')]},'keyType':{'type':Sequelize['ENUM']('string',_0x4760('0x3'),_0x4760('0x4'))},'keyContent':{'type':Sequelize[_0x4760('0x6')]},'idField':{'type':Sequelize[_0x4760('0x6')]},'nameField':{'type':Sequelize[_0x4760('0x6')]},'customField':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'variableName':{'type':Sequelize[_0x4760('0x6')]}}; \ No newline at end of file diff --git a/server/api/intDeskField/intDeskField.controller.js b/server/api/intDeskField/intDeskField.controller.js index d399d88..e0bf54d 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 _0x8b52=['../../config/license/util','sendStatus','end','status','offset','limit','count','Content-Range','json','reject','save','then','destroy','stack','name','send','index','map','rawAttributes','fieldName','type','key','model','query','filters','intersection','attributes','fields','length','hasOwnProperty','sort','where','filter','merge','VIRTUAL','options','DeskField','includeAll','include','findAll','rows','catch','show','params','keys','find','create','body','update','eml-format','rimraf','zip-dir','request-promise','moment','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','jsforce','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils'];(function(_0x465351,_0x115a2c){var _0x19f941=function(_0x4584d7){while(--_0x4584d7){_0x465351['push'](_0x465351['shift']());}};_0x19f941(++_0x115a2c);}(_0x8b52,0x151));var _0x28b5=function(_0x167cc1,_0x56ef5a){_0x167cc1=_0x167cc1-0x0;var _0x10bc4b=_0x8b52[_0x167cc1];return _0x10bc4b;};'use strict';var emlformat=require(_0x28b5('0x0'));var rimraf=require(_0x28b5('0x1'));var zipdir=require(_0x28b5('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x28b5('0x3'));var moment=require(_0x28b5('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x28b5('0x5'));var util=require(_0x28b5('0x6'));var path=require(_0x28b5('0x7'));var sox=require(_0x28b5('0x8'));var csv=require(_0x28b5('0x9'));var ejs=require(_0x28b5('0xa'));var fs=require('fs');var fs_extra=require(_0x28b5('0xb'));var _=require(_0x28b5('0xc'));var squel=require(_0x28b5('0xd'));var crypto=require('crypto');var jsforce=require(_0x28b5('0xe'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0x28b5('0xf'));var Papa=require(_0x28b5('0x10'));var Redis=require('ioredis');var authService=require(_0x28b5('0x11'));var qs=require(_0x28b5('0x12'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x28b5('0x13'));var logger=require(_0x28b5('0x14'))(_0x28b5('0x15'));var utils=require(_0x28b5('0x16'));var config=require('../../config/environment');var licenseUtil=require(_0x28b5('0x17'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0xc18108,_0x3bd9f3){_0x3bd9f3=_0x3bd9f3||0xcc;return function(_0x5f41b6){if(_0x5f41b6){return _0xc18108[_0x28b5('0x18')](_0x3bd9f3);}return _0xc18108['status'](_0x3bd9f3)[_0x28b5('0x19')]();};}function respondWithResult(_0x4a684e,_0x58f350){_0x58f350=_0x58f350||0xc8;return function(_0xff943a){if(_0xff943a){return _0x4a684e[_0x28b5('0x1a')](_0x58f350)['json'](_0xff943a);}};}function respondWithFilteredResult(_0x2c17c7,_0x26213c){return function(_0x1e4a10){if(_0x1e4a10){var _0x16c115=typeof _0x26213c[_0x28b5('0x1b')]==='undefined'&&typeof _0x26213c[_0x28b5('0x1c')]==='undefined';var _0x7b6900=_0x1e4a10[_0x28b5('0x1d')];var _0xfea919=_0x16c115?0x0:_0x26213c[_0x28b5('0x1b')];var _0x540933=_0x16c115?_0x1e4a10[_0x28b5('0x1d')]:_0x26213c[_0x28b5('0x1b')]+_0x26213c[_0x28b5('0x1c')];var _0x534136;if(_0x540933>=_0x7b6900){_0x540933=_0x7b6900;_0x534136=0xc8;}else{_0x534136=0xce;}_0x2c17c7[_0x28b5('0x1a')](_0x534136);return _0x2c17c7['set'](_0x28b5('0x1e'),_0xfea919+'-'+_0x540933+'/'+_0x7b6900)[_0x28b5('0x1f')](_0x1e4a10);}return null;};}function patchUpdates(_0x2c4cae){return function(_0x386494){try{jsonpatch['apply'](_0x386494,_0x2c4cae,!![]);}catch(_0x3ebe9e){return BPromise[_0x28b5('0x20')](_0x3ebe9e);}return _0x386494[_0x28b5('0x21')]();};}function saveUpdates(_0x32c819,_0x5c453a){return function(_0x4a8893){if(_0x4a8893){return _0x4a8893['update'](_0x32c819)[_0x28b5('0x22')](function(_0x1bf044){return _0x1bf044;});}return null;};}function removeEntity(_0x395feb,_0x740562){return function(_0x8fa4b9){if(_0x8fa4b9){return _0x8fa4b9[_0x28b5('0x23')]()['then'](function(){_0x395feb['status'](0xcc)[_0x28b5('0x19')]();});}};}function handleEntityNotFound(_0x528993,_0x304f72){return function(_0x25fd54){if(!_0x25fd54){_0x528993[_0x28b5('0x18')](0x194);}return _0x25fd54;};}function handleError(_0x18176c,_0x127ab0){_0x127ab0=_0x127ab0||0x1f4;return function(_0x5ae41d){logger['error'](_0x5ae41d[_0x28b5('0x24')]);if(_0x5ae41d[_0x28b5('0x25')]){delete _0x5ae41d[_0x28b5('0x25')];}_0x18176c[_0x28b5('0x1a')](_0x127ab0)[_0x28b5('0x26')](_0x5ae41d);};}exports[_0x28b5('0x27')]=function(_0x2db6f1,_0x1bbe54){var _0x139524={},_0x2a182a={},_0x491b72={'count':0x0,'rows':[]};var _0x2b46f7=_[_0x28b5('0x28')](db['DeskField'][_0x28b5('0x29')],function(_0x330767){return{'name':_0x330767[_0x28b5('0x2a')],'type':_0x330767[_0x28b5('0x2b')][_0x28b5('0x2c')]};});_0x2a182a[_0x28b5('0x2d')]=_[_0x28b5('0x28')](_0x2b46f7,'name');_0x2a182a[_0x28b5('0x2e')]=_['keys'](_0x2db6f1[_0x28b5('0x2e')]);_0x2a182a[_0x28b5('0x2f')]=_[_0x28b5('0x30')](_0x2a182a[_0x28b5('0x2d')],_0x2a182a[_0x28b5('0x2e')]);_0x139524[_0x28b5('0x31')]=_[_0x28b5('0x30')](_0x2a182a[_0x28b5('0x2d')],qs[_0x28b5('0x32')](_0x2db6f1[_0x28b5('0x2e')][_0x28b5('0x32')]));_0x139524[_0x28b5('0x31')]=_0x139524[_0x28b5('0x31')][_0x28b5('0x33')]?_0x139524[_0x28b5('0x31')]:_0x2a182a[_0x28b5('0x2d')];if(!_0x2db6f1['query'][_0x28b5('0x34')]('nolimit')){_0x139524[_0x28b5('0x1c')]=qs[_0x28b5('0x1c')](_0x2db6f1[_0x28b5('0x2e')][_0x28b5('0x1c')]);_0x139524['offset']=qs[_0x28b5('0x1b')](_0x2db6f1[_0x28b5('0x2e')][_0x28b5('0x1b')]);}_0x139524['order']=qs['sort'](_0x2db6f1[_0x28b5('0x2e')][_0x28b5('0x35')]);_0x139524[_0x28b5('0x36')]=qs[_0x28b5('0x2f')](_['pick'](_0x2db6f1[_0x28b5('0x2e')],_0x2a182a[_0x28b5('0x2f')]),_0x2b46f7);if(_0x2db6f1[_0x28b5('0x2e')][_0x28b5('0x37')]){_0x139524[_0x28b5('0x36')]=_[_0x28b5('0x38')](_0x139524[_0x28b5('0x36')],{'$or':_[_0x28b5('0x28')](_0x2b46f7,function(_0x4cc88a){if(_0x4cc88a[_0x28b5('0x2b')]!==_0x28b5('0x39')){var _0x4d3d09={};_0x4d3d09[_0x4cc88a[_0x28b5('0x25')]]={'$like':'%'+_0x2db6f1['query'][_0x28b5('0x37')]+'%'};return _0x4d3d09;}})});}_0x139524=_[_0x28b5('0x38')]({},_0x139524,_0x2db6f1[_0x28b5('0x3a')]);var _0x5e1fb2={'where':_0x139524[_0x28b5('0x36')]};return db[_0x28b5('0x3b')][_0x28b5('0x1d')](_0x5e1fb2)[_0x28b5('0x22')](function(_0x31f620){_0x491b72[_0x28b5('0x1d')]=_0x31f620;if(_0x2db6f1['query'][_0x28b5('0x3c')]){_0x139524[_0x28b5('0x3d')]=[{'all':!![]}];}return db[_0x28b5('0x3b')][_0x28b5('0x3e')](_0x139524);})[_0x28b5('0x22')](function(_0x5c237f){_0x491b72[_0x28b5('0x3f')]=_0x5c237f;return _0x491b72;})[_0x28b5('0x22')](respondWithFilteredResult(_0x1bbe54,_0x139524))[_0x28b5('0x40')](handleError(_0x1bbe54,null));};exports[_0x28b5('0x41')]=function(_0x45bd3c,_0x4bd2e3){var _0x2ac508={'raw':!![],'where':{'id':_0x45bd3c[_0x28b5('0x42')]['id']}},_0x5bee77={};_0x5bee77[_0x28b5('0x2d')]=_[_0x28b5('0x43')](db[_0x28b5('0x3b')]['rawAttributes']);_0x5bee77['query']=_[_0x28b5('0x43')](_0x45bd3c[_0x28b5('0x2e')]);_0x5bee77[_0x28b5('0x2f')]=_[_0x28b5('0x30')](_0x5bee77[_0x28b5('0x2d')],_0x5bee77['query']);_0x2ac508[_0x28b5('0x31')]=_['intersection'](_0x5bee77[_0x28b5('0x2d')],qs[_0x28b5('0x32')](_0x45bd3c[_0x28b5('0x2e')][_0x28b5('0x32')]));_0x2ac508[_0x28b5('0x31')]=_0x2ac508[_0x28b5('0x31')][_0x28b5('0x33')]?_0x2ac508['attributes']:_0x5bee77[_0x28b5('0x2d')];if(_0x45bd3c[_0x28b5('0x2e')][_0x28b5('0x3c')]){_0x2ac508[_0x28b5('0x3d')]=[{'all':!![]}];}_0x2ac508=_[_0x28b5('0x38')]({},_0x2ac508,_0x45bd3c[_0x28b5('0x3a')]);return db[_0x28b5('0x3b')][_0x28b5('0x44')](_0x2ac508)[_0x28b5('0x22')](handleEntityNotFound(_0x4bd2e3,null))['then'](respondWithResult(_0x4bd2e3,null))[_0x28b5('0x40')](handleError(_0x4bd2e3,null));};exports[_0x28b5('0x45')]=function(_0xe46b0a,_0x141f9a){return db['DeskField'][_0x28b5('0x45')](_0xe46b0a[_0x28b5('0x46')],{})[_0x28b5('0x22')](respondWithResult(_0x141f9a,0xc9))[_0x28b5('0x40')](handleError(_0x141f9a,null));};exports[_0x28b5('0x47')]=function(_0xaf449d,_0x3d7fdd){if(_0xaf449d[_0x28b5('0x46')]['id']){delete _0xaf449d[_0x28b5('0x46')]['id'];}return db[_0x28b5('0x3b')][_0x28b5('0x44')]({'where':{'id':_0xaf449d[_0x28b5('0x42')]['id']}})[_0x28b5('0x22')](handleEntityNotFound(_0x3d7fdd,null))[_0x28b5('0x22')](saveUpdates(_0xaf449d['body'],null))['then'](respondWithResult(_0x3d7fdd,null))['catch'](handleError(_0x3d7fdd,null));};exports[_0x28b5('0x23')]=function(_0x97af32,_0x5aaef3){return db[_0x28b5('0x3b')][_0x28b5('0x44')]({'where':{'id':_0x97af32['params']['id']}})[_0x28b5('0x22')](handleEntityNotFound(_0x5aaef3,null))[_0x28b5('0x22')](removeEntity(_0x5aaef3,null))[_0x28b5('0x40')](handleError(_0x5aaef3,null));}; \ No newline at end of file +var _0x0736=['find','create','body','update','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../mysqldb','sendStatus','status','end','json','undefined','limit','count','offset','set','Content-Range','then','destroy','error','stack','name','index','map','DeskField','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','length','nolimit','order','sort','where','filter','VIRTUAL','merge','options','includeAll','include','findAll','rows','catch','show','params'];(function(_0x2641f9,_0x26715f){var _0x585741=function(_0x2d1462){while(--_0x2d1462){_0x2641f9['push'](_0x2641f9['shift']());}};_0x585741(++_0x26715f);}(_0x0736,0x1c0));var _0x6073=function(_0x198455,_0x5baed5){_0x198455=_0x198455-0x0;var _0x355596=_0x0736[_0x198455];return _0x355596;};'use strict';var emlformat=require(_0x6073('0x0'));var rimraf=require(_0x6073('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x6073('0x2'));var rp=require(_0x6073('0x3'));var moment=require(_0x6073('0x4'));var BPromise=require(_0x6073('0x5'));var Mustache=require(_0x6073('0x6'));var util=require(_0x6073('0x7'));var path=require(_0x6073('0x8'));var sox=require(_0x6073('0x9'));var csv=require(_0x6073('0xa'));var ejs=require(_0x6073('0xb'));var fs=require('fs');var fs_extra=require(_0x6073('0xc'));var _=require(_0x6073('0xd'));var squel=require(_0x6073('0xe'));var crypto=require(_0x6073('0xf'));var jsforce=require(_0x6073('0x10'));var deskjs=require(_0x6073('0x11'));var toCsv=require(_0x6073('0xa'));var querystring=require('querystring');var Papa=require(_0x6073('0x12'));var Redis=require(_0x6073('0x13'));var authService=require(_0x6073('0x14'));var qs=require(_0x6073('0x15'));var as=require(_0x6073('0x16'));var hardwareService=require(_0x6073('0x17'));var logger=require(_0x6073('0x18'))('api');var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0x6073('0x19'))['db'];function respondWithStatusCode(_0xbb20d4,_0x4ceaa8){_0x4ceaa8=_0x4ceaa8||0xcc;return function(_0x305dd0){if(_0x305dd0){return _0xbb20d4[_0x6073('0x1a')](_0x4ceaa8);}return _0xbb20d4[_0x6073('0x1b')](_0x4ceaa8)[_0x6073('0x1c')]();};}function respondWithResult(_0x109dc5,_0x32fb98){_0x32fb98=_0x32fb98||0xc8;return function(_0x2f1baa){if(_0x2f1baa){return _0x109dc5[_0x6073('0x1b')](_0x32fb98)[_0x6073('0x1d')](_0x2f1baa);}};}function respondWithFilteredResult(_0xcb3c36,_0x5a6ae0){return function(_0x43a2fe){if(_0x43a2fe){var _0x45637e=typeof _0x5a6ae0['offset']===_0x6073('0x1e')&&typeof _0x5a6ae0[_0x6073('0x1f')]===_0x6073('0x1e');var _0x50d889=_0x43a2fe[_0x6073('0x20')];var _0x43b234=_0x45637e?0x0:_0x5a6ae0[_0x6073('0x21')];var _0x6ebd7a=_0x45637e?_0x43a2fe['count']:_0x5a6ae0['offset']+_0x5a6ae0[_0x6073('0x1f')];var _0x4a6299;if(_0x6ebd7a>=_0x50d889){_0x6ebd7a=_0x50d889;_0x4a6299=0xc8;}else{_0x4a6299=0xce;}_0xcb3c36['status'](_0x4a6299);return _0xcb3c36[_0x6073('0x22')](_0x6073('0x23'),_0x43b234+'-'+_0x6ebd7a+'/'+_0x50d889)[_0x6073('0x1d')](_0x43a2fe);}return null;};}function patchUpdates(_0x16ee59){return function(_0x1a95b1){try{jsonpatch['apply'](_0x1a95b1,_0x16ee59,!![]);}catch(_0x1794cf){return BPromise['reject'](_0x1794cf);}return _0x1a95b1['save']();};}function saveUpdates(_0x12a6d9,_0x2defaf){return function(_0x2228ca){if(_0x2228ca){return _0x2228ca['update'](_0x12a6d9)[_0x6073('0x24')](function(_0x3db8c8){return _0x3db8c8;});}return null;};}function removeEntity(_0x10589d,_0x3d454f){return function(_0x21dd44){if(_0x21dd44){return _0x21dd44[_0x6073('0x25')]()['then'](function(){_0x10589d[_0x6073('0x1b')](0xcc)['end']();});}};}function handleEntityNotFound(_0xd58a15,_0x2cee6b){return function(_0x432d87){if(!_0x432d87){_0xd58a15[_0x6073('0x1a')](0x194);}return _0x432d87;};}function handleError(_0x26cc30,_0x3802e8){_0x3802e8=_0x3802e8||0x1f4;return function(_0x455ab0){logger[_0x6073('0x26')](_0x455ab0[_0x6073('0x27')]);if(_0x455ab0['name']){delete _0x455ab0[_0x6073('0x28')];}_0x26cc30['status'](_0x3802e8)['send'](_0x455ab0);};}exports[_0x6073('0x29')]=function(_0x3dd707,_0xdb627b){var _0x3bbfb8={},_0x179cc2={},_0x4ac95d={'count':0x0,'rows':[]};var _0x9c63bd=_[_0x6073('0x2a')](db[_0x6073('0x2b')]['rawAttributes'],function(_0x5c01c1){return{'name':_0x5c01c1[_0x6073('0x2c')],'type':_0x5c01c1[_0x6073('0x2d')][_0x6073('0x2e')]};});_0x179cc2[_0x6073('0x2f')]=_[_0x6073('0x2a')](_0x9c63bd,'name');_0x179cc2[_0x6073('0x30')]=_[_0x6073('0x31')](_0x3dd707[_0x6073('0x30')]);_0x179cc2[_0x6073('0x32')]=_[_0x6073('0x33')](_0x179cc2['model'],_0x179cc2[_0x6073('0x30')]);_0x3bbfb8[_0x6073('0x34')]=_[_0x6073('0x33')](_0x179cc2[_0x6073('0x2f')],qs[_0x6073('0x35')](_0x3dd707[_0x6073('0x30')]['fields']));_0x3bbfb8['attributes']=_0x3bbfb8['attributes'][_0x6073('0x36')]?_0x3bbfb8[_0x6073('0x34')]:_0x179cc2[_0x6073('0x2f')];if(!_0x3dd707['query']['hasOwnProperty'](_0x6073('0x37'))){_0x3bbfb8['limit']=qs['limit'](_0x3dd707[_0x6073('0x30')][_0x6073('0x1f')]);_0x3bbfb8[_0x6073('0x21')]=qs['offset'](_0x3dd707[_0x6073('0x30')][_0x6073('0x21')]);}_0x3bbfb8[_0x6073('0x38')]=qs[_0x6073('0x39')](_0x3dd707[_0x6073('0x30')]['sort']);_0x3bbfb8[_0x6073('0x3a')]=qs['filters'](_['pick'](_0x3dd707[_0x6073('0x30')],_0x179cc2[_0x6073('0x32')]),_0x9c63bd);if(_0x3dd707[_0x6073('0x30')][_0x6073('0x3b')]){_0x3bbfb8[_0x6073('0x3a')]=_['merge'](_0x3bbfb8['where'],{'$or':_[_0x6073('0x2a')](_0x9c63bd,function(_0x19b608){if(_0x19b608[_0x6073('0x2d')]!==_0x6073('0x3c')){var _0x40f68a={};_0x40f68a[_0x19b608['name']]={'$like':'%'+_0x3dd707[_0x6073('0x30')][_0x6073('0x3b')]+'%'};return _0x40f68a;}})});}_0x3bbfb8=_[_0x6073('0x3d')]({},_0x3bbfb8,_0x3dd707[_0x6073('0x3e')]);var _0x359f08={'where':_0x3bbfb8[_0x6073('0x3a')]};return db['DeskField'][_0x6073('0x20')](_0x359f08)[_0x6073('0x24')](function(_0x81ef7c){_0x4ac95d[_0x6073('0x20')]=_0x81ef7c;if(_0x3dd707[_0x6073('0x30')][_0x6073('0x3f')]){_0x3bbfb8[_0x6073('0x40')]=[{'all':!![]}];}return db[_0x6073('0x2b')][_0x6073('0x41')](_0x3bbfb8);})[_0x6073('0x24')](function(_0x277ce0){_0x4ac95d[_0x6073('0x42')]=_0x277ce0;return _0x4ac95d;})[_0x6073('0x24')](respondWithFilteredResult(_0xdb627b,_0x3bbfb8))[_0x6073('0x43')](handleError(_0xdb627b,null));};exports[_0x6073('0x44')]=function(_0x30c68e,_0x513fa8){var _0x5d3aea={'raw':!![],'where':{'id':_0x30c68e[_0x6073('0x45')]['id']}},_0x22952c={};_0x22952c[_0x6073('0x2f')]=_['keys'](db[_0x6073('0x2b')]['rawAttributes']);_0x22952c[_0x6073('0x30')]=_[_0x6073('0x31')](_0x30c68e[_0x6073('0x30')]);_0x22952c['filters']=_[_0x6073('0x33')](_0x22952c[_0x6073('0x2f')],_0x22952c[_0x6073('0x30')]);_0x5d3aea[_0x6073('0x34')]=_[_0x6073('0x33')](_0x22952c[_0x6073('0x2f')],qs['fields'](_0x30c68e[_0x6073('0x30')][_0x6073('0x35')]));_0x5d3aea[_0x6073('0x34')]=_0x5d3aea[_0x6073('0x34')][_0x6073('0x36')]?_0x5d3aea[_0x6073('0x34')]:_0x22952c['model'];if(_0x30c68e[_0x6073('0x30')][_0x6073('0x3f')]){_0x5d3aea['include']=[{'all':!![]}];}_0x5d3aea=_[_0x6073('0x3d')]({},_0x5d3aea,_0x30c68e[_0x6073('0x3e')]);return db[_0x6073('0x2b')][_0x6073('0x46')](_0x5d3aea)['then'](handleEntityNotFound(_0x513fa8,null))[_0x6073('0x24')](respondWithResult(_0x513fa8,null))[_0x6073('0x43')](handleError(_0x513fa8,null));};exports[_0x6073('0x47')]=function(_0x3fccd6,_0x31aac3){return db[_0x6073('0x2b')]['create'](_0x3fccd6[_0x6073('0x48')],{})['then'](respondWithResult(_0x31aac3,0xc9))[_0x6073('0x43')](handleError(_0x31aac3,null));};exports[_0x6073('0x49')]=function(_0x3c5af9,_0x5a5270){if(_0x3c5af9[_0x6073('0x48')]['id']){delete _0x3c5af9[_0x6073('0x48')]['id'];}return db[_0x6073('0x2b')][_0x6073('0x46')]({'where':{'id':_0x3c5af9[_0x6073('0x45')]['id']}})[_0x6073('0x24')](handleEntityNotFound(_0x5a5270,null))[_0x6073('0x24')](saveUpdates(_0x3c5af9[_0x6073('0x48')],null))['then'](respondWithResult(_0x5a5270,null))[_0x6073('0x43')](handleError(_0x5a5270,null));};exports[_0x6073('0x25')]=function(_0x5c67a1,_0xb112cb){return db[_0x6073('0x2b')]['find']({'where':{'id':_0x5c67a1[_0x6073('0x45')]['id']}})['then'](handleEntityNotFound(_0xb112cb,null))['then'](removeEntity(_0xb112cb,null))[_0x6073('0x43')](handleError(_0xb112cb,null));}; \ No newline at end of file diff --git a/server/api/intDeskField/intDeskField.model.js b/server/api/intDeskField/intDeskField.model.js index c0c015d..6da80f1 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 _0x88ae=['api','moment','bluebird','request-promise','path','exports','desk_unique_index','idField','FieldId','lodash','util','../../config/logger'];(function(_0x47fd36,_0x41535d){var _0x21a0fc=function(_0x44c07c){while(--_0x44c07c){_0x47fd36['push'](_0x47fd36['shift']());}};_0x21a0fc(++_0x41535d);}(_0x88ae,0x105));var _0xe88a=function(_0x2d4f17,_0x377787){_0x2d4f17=_0x2d4f17-0x0;var _0x467237=_0x88ae[_0x2d4f17];return _0x467237;};'use strict';var _=require(_0xe88a('0x0'));var util=require(_0xe88a('0x1'));var logger=require(_0xe88a('0x2'))(_0xe88a('0x3'));var moment=require(_0xe88a('0x4'));var BPromise=require(_0xe88a('0x5'));var rp=require(_0xe88a('0x6'));var fs=require('fs');var path=require(_0xe88a('0x7'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require('./intDeskField.attributes');module[_0xe88a('0x8')]=function(_0x3ee331,_0x3c57ec){return _0x3ee331['define']('DeskField',attributes,{'tableName':'int_desk_fields','paranoid':![],'indexes':[{'name':_0xe88a('0x9'),'fields':[_0xe88a('0xa'),_0xe88a('0xb')],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file +var _0xf09d=['lodash','util','../../config/logger','api','moment','bluebird','request-promise','rimraf','./intDeskField.attributes','exports','DeskField','int_desk_fields','desk_unique_index','idField'];(function(_0x5c5baf,_0x105d94){var _0x2d3a1e=function(_0xb585bd){while(--_0xb585bd){_0x5c5baf['push'](_0x5c5baf['shift']());}};_0x2d3a1e(++_0x105d94);}(_0xf09d,0x15e));var _0xdf09=function(_0x48b3fb,_0x4b07bf){_0x48b3fb=_0x48b3fb-0x0;var _0x458604=_0xf09d[_0x48b3fb];return _0x458604;};'use strict';var _=require(_0xdf09('0x0'));var util=require(_0xdf09('0x1'));var logger=require(_0xdf09('0x2'))(_0xdf09('0x3'));var moment=require(_0xdf09('0x4'));var BPromise=require(_0xdf09('0x5'));var rp=require(_0xdf09('0x6'));var fs=require('fs');var path=require('path');var rimraf=require(_0xdf09('0x7'));var config=require('../../config/environment');var attributes=require(_0xdf09('0x8'));module[_0xdf09('0x9')]=function(_0x5b8986,_0x338518){return _0x5b8986['define'](_0xdf09('0xa'),attributes,{'tableName':_0xdf09('0xb'),'paranoid':![],'indexes':[{'name':_0xdf09('0xc'),'fields':[_0xdf09('0xd'),'FieldId'],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/intDeskField/intDeskField.rpc.js b/server/api/intDeskField/intDeskField.rpc.js index 8e4d635..975b7bd 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 _0xf24d=['util','moment','bluebird','randomstring','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','then','info','DeskField,\x20%s,\x20%s','request\x20sent','debug','stringify','error','message','result','catch','lodash'];(function(_0x1facfa,_0x1acf7d){var _0x9ec701=function(_0x115e37){while(--_0x115e37){_0x1facfa['push'](_0x1facfa['shift']());}};_0x9ec701(++_0x1acf7d);}(_0xf24d,0xfb));var _0xdf24=function(_0x40beac,_0x2e0edd){_0x40beac=_0x40beac-0x0;var _0x21e917=_0xf24d[_0x40beac];return _0x21e917;};'use strict';var _=require(_0xdf24('0x0'));var util=require(_0xdf24('0x1'));var moment=require(_0xdf24('0x2'));var BPromise=require(_0xdf24('0x3'));var rs=require(_0xdf24('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0xdf24('0x5'));var logger=require(_0xdf24('0x6'))('rpc');var config=require(_0xdf24('0x7'));var jayson=require(_0xdf24('0x8'));var client=jayson[_0xdf24('0x9')][_0xdf24('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x3c7861,_0x317188,_0x2188a6){return new BPromise(function(_0x39876a,_0x3d9626){return client['request'](_0x3c7861,_0x2188a6)[_0xdf24('0xb')](function(_0x24ab4c){logger[_0xdf24('0xc')](_0xdf24('0xd'),_0x317188,_0xdf24('0xe'));logger[_0xdf24('0xf')]('DeskField,\x20%s,\x20%s,\x20%s',_0x317188,'request\x20sent',JSON[_0xdf24('0x10')](_0x24ab4c));if(_0x24ab4c['error']){if(_0x24ab4c[_0xdf24('0x11')]['code']===0x1f4){logger[_0xdf24('0x11')]('DeskField,\x20%s,\x20%s',_0x317188,_0x24ab4c['error'][_0xdf24('0x12')]);return _0x3d9626(_0x24ab4c[_0xdf24('0x11')]['message']);}logger[_0xdf24('0x11')](_0xdf24('0xd'),_0x317188,_0x24ab4c[_0xdf24('0x11')][_0xdf24('0x12')]);return _0x39876a(_0x24ab4c['error'][_0xdf24('0x12')]);}else{logger[_0xdf24('0xc')](_0xdf24('0xd'),_0x317188,_0xdf24('0xe'));_0x39876a(_0x24ab4c[_0xdf24('0x13')][_0xdf24('0x12')]);}})[_0xdf24('0x14')](function(_0x3dce2d){logger['error']('DeskField,\x20%s,\x20%s',_0x317188,_0x3dce2d);_0x3d9626(_0x3dce2d);});});} \ No newline at end of file +var _0x599c=['rpc','../../config/environment','jayson/promise','client','request','then','info','request\x20sent','debug','DeskField,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','DeskField,\x20%s,\x20%s','lodash','util','randomstring','ioredis','../../config/utils'];(function(_0x26b204,_0xe06ffb){var _0x53e5a3=function(_0x16ce49){while(--_0x16ce49){_0x26b204['push'](_0x26b204['shift']());}};_0x53e5a3(++_0xe06ffb);}(_0x599c,0x69));var _0xc599=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x599c[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0xc599('0x0'));var util=require(_0xc599('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0xc599('0x2'));var fs=require('fs');var Redis=require(_0xc599('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0xc599('0x4'));var logger=require('../../config/logger')(_0xc599('0x5'));var config=require(_0xc599('0x6'));var jayson=require(_0xc599('0x7'));var client=jayson[_0xc599('0x8')]['http']({'port':0x232a});function respondWithRpcPromise(_0x9ffb36,_0x551833,_0x3a360c){return new BPromise(function(_0x400cc6,_0x58bd1a){return client[_0xc599('0x9')](_0x9ffb36,_0x3a360c)[_0xc599('0xa')](function(_0x49d5e3){logger[_0xc599('0xb')]('DeskField,\x20%s,\x20%s',_0x551833,_0xc599('0xc'));logger[_0xc599('0xd')](_0xc599('0xe'),_0x551833,_0xc599('0xc'),JSON[_0xc599('0xf')](_0x49d5e3));if(_0x49d5e3[_0xc599('0x10')]){if(_0x49d5e3[_0xc599('0x10')][_0xc599('0x11')]===0x1f4){logger['error']('DeskField,\x20%s,\x20%s',_0x551833,_0x49d5e3[_0xc599('0x10')]['message']);return _0x58bd1a(_0x49d5e3[_0xc599('0x10')]['message']);}logger['error']('DeskField,\x20%s,\x20%s',_0x551833,_0x49d5e3[_0xc599('0x10')][_0xc599('0x12')]);return _0x400cc6(_0x49d5e3[_0xc599('0x10')]['message']);}else{logger[_0xc599('0xb')]('DeskField,\x20%s,\x20%s',_0x551833,_0xc599('0xc'));_0x400cc6(_0x49d5e3[_0xc599('0x13')][_0xc599('0x12')]);}})[_0xc599('0x14')](function(_0x533292){logger[_0xc599('0x10')](_0xc599('0x15'),_0x551833,_0x533292);_0x58bd1a(_0x533292);});});} \ No newline at end of file diff --git a/server/api/intDynamics365Account/index.js b/server/api/intDynamics365Account/index.js index 2a3a9cc..27f6e95 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 _0x5d65=['/:id/configurations','getConfigurations','/:id/fields','getFields','post','addConfiguration','put','update','delete','destroy','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./intDynamics365Account.controller','isAuthenticated','index','get','show'];(function(_0x24a956,_0x1a7a4f){var _0x38aac9=function(_0x12d778){while(--_0x12d778){_0x24a956['push'](_0x24a956['shift']());}};_0x38aac9(++_0x1a7a4f);}(_0x5d65,0x14f));var _0x55d6=function(_0x2576d7,_0x167624){_0x2576d7=_0x2576d7-0x0;var _0x16a08c=_0x5d65[_0x2576d7];return _0x16a08c;};'use strict';var multer=require(_0x55d6('0x0'));var util=require(_0x55d6('0x1'));var path=require(_0x55d6('0x2'));var timeout=require(_0x55d6('0x3'));var express=require(_0x55d6('0x4'));var router=express[_0x55d6('0x5')]();var fs_extra=require(_0x55d6('0x6'));var auth=require(_0x55d6('0x7'));var interaction=require(_0x55d6('0x8'));var config=require(_0x55d6('0x9'));var controller=require(_0x55d6('0xa'));router['get']('/',auth[_0x55d6('0xb')](),controller[_0x55d6('0xc')]);router[_0x55d6('0xd')]('/:id',auth[_0x55d6('0xb')](),controller[_0x55d6('0xe')]);router[_0x55d6('0xd')](_0x55d6('0xf'),auth[_0x55d6('0xb')](),controller[_0x55d6('0x10')]);router[_0x55d6('0xd')](_0x55d6('0x11'),auth[_0x55d6('0xb')](),controller[_0x55d6('0x12')]);router['post']('/',auth[_0x55d6('0xb')](),controller['create']);router[_0x55d6('0x13')]('/:id/configurations',auth[_0x55d6('0xb')](),controller[_0x55d6('0x14')]);router[_0x55d6('0x15')]('/:id',auth[_0x55d6('0xb')](),controller[_0x55d6('0x16')]);router[_0x55d6('0x17')]('/:id',auth['isAuthenticated'](),controller[_0x55d6('0x18')]);module['exports']=router; \ No newline at end of file +var _0xc449=['post','create','/:id/configurations','addConfiguration','put','/:id','delete','destroy','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../config/environment','get','isAuthenticated','index','show','getConfigurations','/:id/fields','getFields'];(function(_0x3762f9,_0x4e9593){var _0x24decf=function(_0x24bd4){while(--_0x24bd4){_0x3762f9['push'](_0x3762f9['shift']());}};_0x24decf(++_0x4e9593);}(_0xc449,0x68));var _0x9c44=function(_0x2d42e9,_0x42774d){_0x2d42e9=_0x2d42e9-0x0;var _0x4f4f39=_0xc449[_0x2d42e9];return _0x4f4f39;};'use strict';var multer=require(_0x9c44('0x0'));var util=require(_0x9c44('0x1'));var path=require(_0x9c44('0x2'));var timeout=require(_0x9c44('0x3'));var express=require(_0x9c44('0x4'));var router=express[_0x9c44('0x5')]();var fs_extra=require(_0x9c44('0x6'));var auth=require(_0x9c44('0x7'));var interaction=require('../../components/interaction/service');var config=require(_0x9c44('0x8'));var controller=require('./intDynamics365Account.controller');router[_0x9c44('0x9')]('/',auth[_0x9c44('0xa')](),controller[_0x9c44('0xb')]);router[_0x9c44('0x9')]('/:id',auth['isAuthenticated'](),controller[_0x9c44('0xc')]);router[_0x9c44('0x9')]('/:id/configurations',auth[_0x9c44('0xa')](),controller[_0x9c44('0xd')]);router[_0x9c44('0x9')](_0x9c44('0xe'),auth['isAuthenticated'](),controller[_0x9c44('0xf')]);router[_0x9c44('0x10')]('/',auth[_0x9c44('0xa')](),controller[_0x9c44('0x11')]);router[_0x9c44('0x10')](_0x9c44('0x12'),auth[_0x9c44('0xa')](),controller[_0x9c44('0x13')]);router[_0x9c44('0x14')](_0x9c44('0x15'),auth['isAuthenticated'](),controller['update']);router[_0x9c44('0x16')](_0x9c44('0x15'),auth[_0x9c44('0xa')](),controller[_0x9c44('0x17')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/intDynamics365Account/intDynamics365Account.attributes.js b/server/api/intDynamics365Account/intDynamics365Account.attributes.js index a68806c..a62746c 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 _0xca9e=['STRING','BOOLEAN','sequelize','exports'];(function(_0x50fc19,_0x2685e7){var _0x30c392=function(_0x5763f6){while(--_0x5763f6){_0x50fc19['push'](_0x50fc19['shift']());}};_0x30c392(++_0x2685e7);}(_0xca9e,0x136));var _0xeca9=function(_0x2d9b6b,_0x2b81ca){_0x2d9b6b=_0x2d9b6b-0x0;var _0x5b360b=_0xca9e[_0x2d9b6b];return _0x5b360b;};'use strict';var Sequelize=require(_0xeca9('0x0'));module[_0xeca9('0x1')]={'name':{'type':Sequelize[_0xeca9('0x2')]},'username':{'type':Sequelize[_0xeca9('0x2')]},'password':{'type':Sequelize[_0xeca9('0x2')]},'remoteUri':{'type':Sequelize[_0xeca9('0x2')]},'tenantId':{'type':Sequelize[_0xeca9('0x2')]},'clientId':{'type':Sequelize[_0xeca9('0x2')]},'clientSecret':{'type':Sequelize[_0xeca9('0x2')]},'serverUrl':{'type':Sequelize[_0xeca9('0x2')],'allowNull':![]},'description':{'type':Sequelize[_0xeca9('0x2')]},'modernAuthentication':{'type':Sequelize[_0xeca9('0x3')],'defaultValue':!![]}}; \ No newline at end of file +var _0x872a=['sequelize','exports','STRING','BOOLEAN'];(function(_0x265d31,_0x5dbbb0){var _0x162f48=function(_0x3b314d){while(--_0x3b314d){_0x265d31['push'](_0x265d31['shift']());}};_0x162f48(++_0x5dbbb0);}(_0x872a,0x100));var _0xa872=function(_0x33572a,_0x435db1){_0x33572a=_0x33572a-0x0;var _0x596284=_0x872a[_0x33572a];return _0x596284;};'use strict';var Sequelize=require(_0xa872('0x0'));module[_0xa872('0x1')]={'name':{'type':Sequelize[_0xa872('0x2')]},'username':{'type':Sequelize[_0xa872('0x2')]},'password':{'type':Sequelize['STRING']},'remoteUri':{'type':Sequelize['STRING']},'tenantId':{'type':Sequelize['STRING']},'clientId':{'type':Sequelize[_0xa872('0x2')]},'clientSecret':{'type':Sequelize[_0xa872('0x2')]},'serverUrl':{'type':Sequelize[_0xa872('0x2')],'allowNull':![]},'description':{'type':Sequelize[_0xa872('0x2')]},'modernAuthentication':{'type':Sequelize[_0xa872('0x3')],'defaultValue':!![]}}; \ No newline at end of file diff --git a/server/api/intDynamics365Account/intDynamics365Account.controller.js b/server/api/intDynamics365Account/intDynamics365Account.controller.js index 01dd93a..5c59d36 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 _0x094f=['substring','lastIndexOf','format','getFields','ticketType','incident','Incident','PhoneCall','description','customerid','caseorigincode','subject','phonenumber','regardingobjectid','directioncode','phonecall_activity_parties','actualserviceunits','contactidname','contractdetailidname','createdbyexternalpartyname','createdbyname','createdbyyominame','createdon','createdonbehalfbyname','createdonbehalfbyyominame','customeridname','customeridtype','customeridyominame','emailaddress','entitlementidname','escalatedon','exchangerate','firstresponsebykpiidname','followupby','importsequencenumber','influencescore','kbarticleidname','lastonholdtime','masteridname','modifiedbyexternalpartyname','modifiedbyname','modifiedbyyominame','modifiedon','modifiedonbehalfbyname','msdyn_incidenttypename','msdyn_iotalertname','numberofchildincidents','onholdtime','overriddencreatedon','owneridname','owneridtype','owneridyominame','parentcaseidname','primarycontactidname','primarycontactidyominame','prioritycodename','productidname','productserialnumber','resolveby','resolvebykpiidname','responseby','responsiblecontactidname','responsiblecontactidyominame','sentimentvalue','slainvokedidname','slaname','socialprofileidname','statecode','statuscode','subjectidname','ticketnumber','timezoneruleversionnumber','traversedpath','versionnumber','concat','username','password','tenantId','clientId','clientSecret','modernAuthentication','CloudProvider','data5','access_token','data7','remoteUri','POST','/oauth2/token','GET','EntityDefinitions?$select=DisplayName,EntitySetName&$filter=SchemaName\x20eq\x20\x27','Bearer\x20','value','MetadataId',')?$select=LogicalName&$expand=Attributes($select=LogicalName)','4.0','Attributes','LogicalName','forEach','@odata.type','PicklistAttributeMetadata','all','isNil','BooleanAttributeMetadata','push','StringAttributeMetadata','DoubleAttributeMetadata','BigIntAttributeMetadata','IntegerAttributeMetadata','MemoAttributeMetadata','DateTimeAttributeMetadata','DecimalAttributeMetadata','test','statusCode','EntityDefinitions(',')/Attributes(',')/Microsoft.Dynamics.CRM.PicklistAttributeMetadata?','$select=DisplayName,LogicalName&$expand=OptionSet($select=Options)','OptionSet','Options','Label','Value','DisplayName','UserLocalizedLabel','true','FalseOption','false',')/Microsoft.Dynamics.CRM.','?$select=DisplayName,LogicalName','request-promise','util','lodash','../../components/parsers/qs','api','../../mysqldb','../../components/integrations/configuration','status','json','count','offset','limit','then','destroy','end','error','stack','name','send','index','map','rawAttributes','fieldName','type','model','query','intersection','attributes','fields','length','hasOwnProperty','sort','where','pick','filter','merge','VIRTUAL','options','Dynamics365Account','includeAll','include','findAll','rows','catch','show','params','keys','filters','create','body','update','find','findOne','Dynamics365Configuration','getConfigurations','addConfiguration','AccountId','Subjects','getSubjects','channel','Descriptions','getDescriptions','Dynamics365Field','slice'];(function(_0xc98be6,_0x4befae){var _0x57b80b=function(_0x536ebf){while(--_0x536ebf){_0xc98be6['push'](_0xc98be6['shift']());}};_0x57b80b(++_0x4befae);}(_0x094f,0x80));var _0xf094=function(_0x344a3f,_0x579a22){_0x344a3f=_0x344a3f-0x0;var _0x264712=_0x094f[_0x344a3f];return _0x264712;};'use strict';var rp=require(_0xf094('0x0'));var util=require(_0xf094('0x1'));var _=require(_0xf094('0x2'));var qs=require(_0xf094('0x3'));var logger=require('../../config/logger')(_0xf094('0x4'));var db=require(_0xf094('0x5'))['db'];var integrations=require(_0xf094('0x6'));function respondWithResult(_0x588cc2,_0x4af4d6){_0x4af4d6=_0x4af4d6||0xc8;return function(_0x2896e0){if(_0x2896e0){return _0x588cc2[_0xf094('0x7')](_0x4af4d6)[_0xf094('0x8')](_0x2896e0);}};}function respondWithFilteredResult(_0x1c421e,_0x507b62){return function(_0xa02b58){if(_0xa02b58){var _0xa00294=typeof _0x507b62['offset']==='undefined'&&typeof _0x507b62['limit']==='undefined';var _0x4cc43f=_0xa02b58[_0xf094('0x9')];var _0x172bce=_0xa00294?0x0:_0x507b62[_0xf094('0xa')];var _0x30ceb2=_0xa00294?_0xa02b58[_0xf094('0x9')]:_0x507b62['offset']+_0x507b62[_0xf094('0xb')];var _0x456da2;if(_0x30ceb2>=_0x4cc43f){_0x30ceb2=_0x4cc43f;_0x456da2=0xc8;}else{_0x456da2=0xce;}_0x1c421e['status'](_0x456da2);return _0x1c421e['set']('Content-Range',_0x172bce+'-'+_0x30ceb2+'/'+_0x4cc43f)[_0xf094('0x8')](_0xa02b58);}return null;};}function saveUpdates(_0x4d99bd){return function(_0x583a23){if(_0x583a23){return _0x583a23['update'](_0x4d99bd)[_0xf094('0xc')](function(_0x5997ea){return _0x5997ea;});}return null;};}function removeEntity(_0x4b97cb){return function(_0x32f64d){if(_0x32f64d){return _0x32f64d[_0xf094('0xd')]()[_0xf094('0xc')](function(){_0x4b97cb[_0xf094('0x7')](0xcc)[_0xf094('0xe')]();});}};}function handleEntityNotFound(_0x187460){return function(_0x51f2af){if(!_0x51f2af){_0x187460['sendStatus'](0x194);}return _0x51f2af;};}function handleError(_0xf589f7,_0x2f12d5){_0x2f12d5=_0x2f12d5||0x1f4;return function(_0x446cca){logger[_0xf094('0xf')](_0x446cca[_0xf094('0x10')]);if(_0x446cca[_0xf094('0x11')]){delete _0x446cca['name'];}_0xf589f7[_0xf094('0x7')](_0x2f12d5)[_0xf094('0x12')](_0x446cca);};}exports[_0xf094('0x13')]=function(_0x4db9f3,_0x550b7f){var _0x5ec15d={},_0x5b3b41={},_0x5b73af={'count':0x0,'rows':[]};var _0x182735=_[_0xf094('0x14')](db['Dynamics365Account'][_0xf094('0x15')],function(_0x28088f){return{'name':_0x28088f[_0xf094('0x16')],'type':_0x28088f[_0xf094('0x17')]['key']};});_0x5b3b41[_0xf094('0x18')]=_[_0xf094('0x14')](_0x182735,'name');_0x5b3b41[_0xf094('0x19')]=_['keys'](_0x4db9f3[_0xf094('0x19')]);_0x5b3b41['filters']=_[_0xf094('0x1a')](_0x5b3b41[_0xf094('0x18')],_0x5b3b41[_0xf094('0x19')]);_0x5ec15d[_0xf094('0x1b')]=_[_0xf094('0x1a')](_0x5b3b41[_0xf094('0x18')],qs[_0xf094('0x1c')](_0x4db9f3['query'][_0xf094('0x1c')]));_0x5ec15d[_0xf094('0x1b')]=_0x5ec15d['attributes'][_0xf094('0x1d')]?_0x5ec15d[_0xf094('0x1b')]:_0x5b3b41[_0xf094('0x18')];if(!_0x4db9f3[_0xf094('0x19')][_0xf094('0x1e')]('nolimit')){_0x5ec15d[_0xf094('0xb')]=qs['limit'](_0x4db9f3['query'][_0xf094('0xb')]);_0x5ec15d[_0xf094('0xa')]=qs[_0xf094('0xa')](_0x4db9f3[_0xf094('0x19')]['offset']);}_0x5ec15d['order']=qs[_0xf094('0x1f')](_0x4db9f3[_0xf094('0x19')][_0xf094('0x1f')]);_0x5ec15d[_0xf094('0x20')]=qs['filters'](_[_0xf094('0x21')](_0x4db9f3['query'],_0x5b3b41['filters']),_0x182735);if(_0x4db9f3[_0xf094('0x19')][_0xf094('0x22')]){_0x5ec15d['where']=_[_0xf094('0x23')](_0x5ec15d[_0xf094('0x20')],{'$or':_[_0xf094('0x14')](_0x182735,function(_0x3f157e){if(_0x3f157e[_0xf094('0x17')]!==_0xf094('0x24')){var _0x259321={};_0x259321[_0x3f157e[_0xf094('0x11')]]={'$like':'%'+_0x4db9f3['query'][_0xf094('0x22')]+'%'};return _0x259321;}})});}_0x5ec15d=_[_0xf094('0x23')]({},_0x5ec15d,_0x4db9f3[_0xf094('0x25')]);var _0x472ae9={'where':_0x5ec15d['where']};return db[_0xf094('0x26')]['count'](_0x472ae9)['then'](function(_0x18d42f){_0x5b73af['count']=_0x18d42f;if(_0x4db9f3['query'][_0xf094('0x27')]){_0x5ec15d[_0xf094('0x28')]=[{'all':!![]}];}return db[_0xf094('0x26')][_0xf094('0x29')](_0x5ec15d);})[_0xf094('0xc')](function(_0x3104d3){_0x5b73af[_0xf094('0x2a')]=_0x3104d3;return _0x5b73af;})[_0xf094('0xc')](respondWithFilteredResult(_0x550b7f,_0x5ec15d))[_0xf094('0x2b')](handleError(_0x550b7f,null));};exports[_0xf094('0x2c')]=function(_0x538b01,_0x4b1666){var _0x4061a4={'raw':![],'where':{'id':_0x538b01[_0xf094('0x2d')]['id']}},_0x39a41c={};_0x39a41c[_0xf094('0x18')]=_[_0xf094('0x2e')](db[_0xf094('0x26')][_0xf094('0x15')]);_0x39a41c['query']=_[_0xf094('0x2e')](_0x538b01[_0xf094('0x19')]);_0x39a41c[_0xf094('0x2f')]=_['intersection'](_0x39a41c[_0xf094('0x18')],_0x39a41c['query']);_0x4061a4[_0xf094('0x1b')]=_[_0xf094('0x1a')](_0x39a41c['model'],qs[_0xf094('0x1c')](_0x538b01[_0xf094('0x19')][_0xf094('0x1c')]));_0x4061a4[_0xf094('0x1b')]=_0x4061a4[_0xf094('0x1b')][_0xf094('0x1d')]?_0x4061a4[_0xf094('0x1b')]:_0x39a41c[_0xf094('0x18')];if(_0x538b01[_0xf094('0x19')]['includeAll']){_0x4061a4['include']=[{'all':!![]}];}_0x4061a4=_[_0xf094('0x23')]({},_0x4061a4,_0x538b01[_0xf094('0x25')]);return db['Dynamics365Account']['find'](_0x4061a4)[_0xf094('0xc')](handleEntityNotFound(_0x4b1666,null))[_0xf094('0xc')](respondWithResult(_0x4b1666,null))[_0xf094('0x2b')](handleError(_0x4b1666,null));};exports['create']=function(_0x262c1e,_0x1f4908){return db['Dynamics365Account'][_0xf094('0x30')](_0x262c1e[_0xf094('0x31')],{})[_0xf094('0xc')](respondWithResult(_0x1f4908,0xc9))[_0xf094('0x2b')](handleError(_0x1f4908,null));};exports[_0xf094('0x32')]=function(_0x2b052f,_0x5869f7){if(_0x2b052f['body']['id']){delete _0x2b052f[_0xf094('0x31')]['id'];}return db['Dynamics365Account']['find']({'where':{'id':_0x2b052f[_0xf094('0x2d')]['id']}})[_0xf094('0xc')](handleEntityNotFound(_0x5869f7,null))[_0xf094('0xc')](saveUpdates(_0x2b052f['body'],null))['then'](respondWithResult(_0x5869f7,null))[_0xf094('0x2b')](handleError(_0x5869f7,null));};exports[_0xf094('0xd')]=function(_0x3316ff,_0x449073){return db[_0xf094('0x26')][_0xf094('0x33')]({'where':{'id':_0x3316ff[_0xf094('0x2d')]['id']}})['then'](handleEntityNotFound(_0x449073,null))[_0xf094('0xc')](removeEntity(_0x449073,null))['catch'](handleError(_0x449073,null));};exports['getConfigurations']=function(_0x4d7e3e,_0x1990e3){var _0x2277b1={};var _0x2c7589={};var _0x295589;var _0x2fe7ce;return db[_0xf094('0x26')][_0xf094('0x34')]({'where':{'id':_0x4d7e3e['params']['id']}})[_0xf094('0xc')](handleEntityNotFound(_0x1990e3,null))[_0xf094('0xc')](function(_0x32370a){if(_0x32370a){_0x295589=_0x32370a;_0x2c7589['model']=_['keys'](db[_0xf094('0x35')]['rawAttributes']);_0x2c7589[_0xf094('0x19')]=_[_0xf094('0x2e')](_0x4d7e3e[_0xf094('0x19')]);_0x2c7589[_0xf094('0x2f')]=_[_0xf094('0x1a')](_0x2c7589[_0xf094('0x18')],_0x2c7589[_0xf094('0x19')]);_0x2277b1['attributes']=_[_0xf094('0x1a')](_0x2c7589['model'],qs[_0xf094('0x1c')](_0x4d7e3e['query'][_0xf094('0x1c')]));_0x2277b1[_0xf094('0x1b')]=_0x2277b1[_0xf094('0x1b')][_0xf094('0x1d')]?_0x2277b1[_0xf094('0x1b')]:_0x2c7589[_0xf094('0x18')];_0x2277b1['order']=qs[_0xf094('0x1f')](_0x4d7e3e[_0xf094('0x19')]['sort']);_0x2277b1[_0xf094('0x20')]=qs[_0xf094('0x2f')](_[_0xf094('0x21')](_0x4d7e3e[_0xf094('0x19')],_0x2c7589[_0xf094('0x2f')]));if(_0x4d7e3e[_0xf094('0x19')]['filter']){_0x2277b1[_0xf094('0x20')]=_[_0xf094('0x23')](_0x2277b1['where'],{'$or':_[_0xf094('0x14')](_0x2277b1[_0xf094('0x1b')],function(_0x5d4df0){var _0x177252={};_0x177252[_0x5d4df0]={'$like':'%'+_0x4d7e3e[_0xf094('0x19')][_0xf094('0x22')]+'%'};return _0x177252;})});}_0x2277b1=_[_0xf094('0x23')]({},_0x2277b1,_0x4d7e3e['options']);return _0x295589[_0xf094('0x36')](_0x2277b1);}})['then'](function(_0x42dc9e){if(_0x42dc9e){_0x2fe7ce=_0x42dc9e[_0xf094('0x1d')];if(!_0x4d7e3e['query'][_0xf094('0x1e')]('nolimit')){_0x2277b1[_0xf094('0xb')]=qs[_0xf094('0xb')](_0x4d7e3e['query'][_0xf094('0xb')]);_0x2277b1[_0xf094('0xa')]=qs[_0xf094('0xa')](_0x4d7e3e[_0xf094('0x19')][_0xf094('0xa')]);}return _0x295589[_0xf094('0x36')](_0x2277b1);}})[_0xf094('0xc')](function(_0x33faaa){if(_0x33faaa){return _0x33faaa?{'count':_0x2fe7ce,'rows':_0x33faaa}:null;}})[_0xf094('0xc')](respondWithResult(_0x1990e3,null))[_0xf094('0x2b')](handleError(_0x1990e3,null));};exports[_0xf094('0x37')]=function(_0x54c62b,_0x19a8ac){if(_0x54c62b['body']['id']){delete _0x54c62b[_0xf094('0x31')]['id'];}return db[_0xf094('0x26')][_0xf094('0x34')]({'where':{'id':_0x54c62b['params']['id']}})[_0xf094('0xc')](handleEntityNotFound(_0x19a8ac,null))[_0xf094('0xc')](function(_0x3438f1){if(_0x3438f1){_0x54c62b[_0xf094('0x31')][_0xf094('0x38')]=_0x3438f1['id'];_0x54c62b[_0xf094('0x31')][_0xf094('0x39')]=integrations[_0xf094('0x3a')](_0x54c62b['body'][_0xf094('0x3b')],_0x54c62b['body'][_0xf094('0x17')]);_0x54c62b[_0xf094('0x31')][_0xf094('0x3c')]=integrations[_0xf094('0x3d')](_0x54c62b[_0xf094('0x31')][_0xf094('0x3b')],_0x54c62b[_0xf094('0x31')][_0xf094('0x17')]);return db[_0xf094('0x35')][_0xf094('0x30')](_0x54c62b[_0xf094('0x31')],{'include':[{'model':db['Dynamics365Field'],'as':_0xf094('0x39')},{'model':db[_0xf094('0x3e')],'as':_0xf094('0x3c')}]});}return null;})[_0xf094('0xc')](respondWithResult(_0x19a8ac,null))[_0xf094('0x2b')](handleError(_0x19a8ac,null));};function sanitizeRemoteUri(_0x3964bb){var _0x5b93ae=_0x3964bb[_0xf094('0x3f')](-0x1);if(_0x5b93ae==='/')return _0x3964bb[_0xf094('0x40')](0x0,_0x3964bb[_0xf094('0x41')](_0x5b93ae));return _0x3964bb;}function getWebApiUrl(_0x91619d){return util[_0xf094('0x42')]('%s/api/data/v9.0/',_0x91619d);}exports[_0xf094('0x43')]=function(_0x388cb8,_0x5d3474){var _0x447b3c=_0x388cb8[_0xf094('0x19')][_0xf094('0x44')];var _0x3867a6=_0x447b3c===_0xf094('0x45')?_0xf094('0x46'):_0xf094('0x47');var _0x48f335='';var _0x63b645='';var _0x3f195d='';var _0x525b16='';var _0x2670a5='';var _0x2f84ae='';var _0x570cc0='';var _0x3ace28='';var _0xd5c336=['title',_0xf094('0x48'),_0xf094('0x49'),'ownerid',_0xf094('0x4a'),_0xf094('0x4b'),_0xf094('0x4c'),_0xf094('0x4d'),_0xf094('0x4e'),_0xf094('0x4f')];var _0x38333e=['accountidname','accountidyominame',_0xf094('0x50'),'billedserviceunits',_0xf094('0x51'),'contactidyominame',_0xf094('0x52'),'contractidname',_0xf094('0x53'),'createdbyexternalpartyyominame',_0xf094('0x54'),_0xf094('0x55'),_0xf094('0x56'),_0xf094('0x57'),_0xf094('0x58'),_0xf094('0x59'),_0xf094('0x5a'),_0xf094('0x5b'),_0xf094('0x5c'),_0xf094('0x5d'),'entityimage_timestamp','entityimage_url',_0xf094('0x5e'),_0xf094('0x5f'),_0xf094('0x60'),_0xf094('0x61'),_0xf094('0x62'),_0xf094('0x63'),_0xf094('0x64'),_0xf094('0x65'),_0xf094('0x66'),_0xf094('0x67'),'modifiedbyexternalpartyyominame',_0xf094('0x68'),_0xf094('0x69'),_0xf094('0x6a'),_0xf094('0x6b'),'modifiedonbehalfbyyominame',_0xf094('0x6c'),_0xf094('0x6d'),_0xf094('0x6e'),_0xf094('0x6f'),_0xf094('0x70'),_0xf094('0x71'),_0xf094('0x72'),_0xf094('0x73'),_0xf094('0x74'),_0xf094('0x75'),_0xf094('0x76'),_0xf094('0x77'),_0xf094('0x78'),_0xf094('0x79'),_0xf094('0x7a'),_0xf094('0x7b'),_0xf094('0x7c'),_0xf094('0x7d'),_0xf094('0x7e'),_0xf094('0x7f'),_0xf094('0x80'),_0xf094('0x81'),_0xf094('0x82'),_0xf094('0x83'),_0xf094('0x84'),_0xf094('0x85'),_0xf094('0x86'),_0xf094('0x87'),'transactioncurrencyidname',_0xf094('0x88'),'utcconversiontimezonecode',_0xf094('0x89')];var _0x1d34af=_0xd5c336[_0xf094('0x8a')](_0x38333e);return db['Dynamics365Account'][_0xf094('0x34')]({'where':{'id':_0x388cb8[_0xf094('0x2d')]['id']},'attributes':['id',_0xf094('0x8b'),_0xf094('0x8c'),'remoteUri',_0xf094('0x8d'),_0xf094('0x8e'),_0xf094('0x8f'),_0xf094('0x90')],'include':[{'model':db[_0xf094('0x91')],'as':_0xf094('0x91'),'attributes':['id',_0xf094('0x92'),'data7']}]})['then'](handleEntityNotFound(_0x5d3474,null))[_0xf094('0xc')](function(_0x49e42a){if(_0x49e42a){if(_0x49e42a[_0xf094('0x90')]){_0x49e42a[_0xf094('0x93')]=_0x49e42a['CloudProvider'][_0xf094('0x92')];_0x3ace28=sanitizeRemoteUri(_0x49e42a[_0xf094('0x91')][_0xf094('0x94')]);_0x570cc0=getWebApiUrl(_0x3ace28);return _0x49e42a;}_0x3ace28=sanitizeRemoteUri(_0x49e42a[_0xf094('0x95')]);_0x570cc0=getWebApiUrl(_0x3ace28);var _0x16e602={'method':_0xf094('0x96'),'uri':'https://login.microsoftonline.com/'+_0x49e42a[_0xf094('0x8d')]+_0xf094('0x97'),'form':{'client_id':_0x49e42a[_0xf094('0x8e')],'resource':_0x3ace28,'username':_0x49e42a['username'],'password':_0x49e42a[_0xf094('0x8c')],'grant_type':_0xf094('0x8c'),'client_secret':_0x49e42a[_0xf094('0x8f')]},'json':!![]};return rp(_0x16e602);}})['then'](function(_0x2085eb){_0x2f84ae=_0x2085eb[_0xf094('0x93')];var _0x34c7db={'method':_0xf094('0x98'),'uri':encodeURI(_0x570cc0+_0xf094('0x99')+_0x3867a6+'\x27'),'headers':{'Authorization':_0xf094('0x9a')+_0x2f84ae,'If-None-Match':null,'OData-Version':'4.0'},'json':!![]};return rp(_0x34c7db);})[_0xf094('0xc')](function(_0x491050){var _0x1d943b=_0x491050[_0xf094('0x9b')][0x0];var _0x3f8546=_0x1d943b[_0xf094('0x9c')];var _0x21996a={'method':'GET','uri':_0x570cc0+'EntityDefinitions('+_0x3f8546+_0xf094('0x9d'),'headers':{'Authorization':_0xf094('0x9a')+_0x2f84ae,'If-None-Match':null,'OData-Version':_0xf094('0x9e')},'json':!![]};return rp(_0x21996a);})[_0xf094('0xc')](function(_0x30eec0){_0x48f335=_0x30eec0;_0x63b645=_0x48f335[_0xf094('0x9f')];_0x63b645=_['remove'](_0x63b645,function(_0x1e7cfb){return!_0x1d34af['includes'](_0x1e7cfb[_0xf094('0xa0')]);});var _0x17dddd=[];var _0x6475f6=[];_0x63b645[_0xf094('0xa1')](function(_0x2f7665){if(_0x2f7665[_0xf094('0xa2')]){var _0x49ffce=_0x2f7665[_0xf094('0xa2')][_0xf094('0x40')](_0x2f7665['@odata.type'][_0xf094('0x41')]('.')+0x1);if(_0x49ffce===_0xf094('0xa3')){_0x17dddd['push'](getSelectList(_0x570cc0,_0x447b3c,_0x6475f6,_0x48f335[_0xf094('0x9c')],_0x2f7665[_0xf094('0x9c')],_0x2f84ae));}}});return Promise[_0xf094('0xa4')](_0x17dddd);})[_0xf094('0xc')](function(_0x1f83bb){_0x3f195d=_0x1f83bb[0x0];var _0x396c44=[];var _0x39a2de=[];_0x63b645[_0xf094('0xa1')](function(_0x5c8081){if(!_[_0xf094('0xa5')](_0x5c8081[_0xf094('0xa2')])){var _0x27f7d9=_0x5c8081[_0xf094('0xa2')]['substring'](_0x5c8081[_0xf094('0xa2')][_0xf094('0x41')]('.')+0x1);if(_0x27f7d9===_0xf094('0xa6')){_0x396c44[_0xf094('0xa7')](getBooleanList(_0x570cc0,_0x447b3c,_0x39a2de,_0x48f335['MetadataId'],_0x5c8081[_0xf094('0x9c')],_0x2f84ae));}}});return Promise[_0xf094('0xa4')](_0x396c44);})['then'](function(_0x19a0d6){_0x525b16=_0x19a0d6[0x0];var _0x390f20=[];var _0x1f14e3=[];_0x63b645['forEach'](function(_0xfa5188){if(_0xfa5188[_0xf094('0xa2')]){var _0x5eac45=_0xfa5188[_0xf094('0xa2')][_0xf094('0x40')](_0xfa5188[_0xf094('0xa2')][_0xf094('0x41')]('.')+0x1);if(_0x5eac45===_0xf094('0xa8')||_0x5eac45===_0xf094('0xa9')||_0x5eac45===_0xf094('0xaa')||_0x5eac45===_0xf094('0xab')||_0x5eac45===_0xf094('0xac')||_0x5eac45===_0xf094('0xad')||_0x5eac45==='StatusAttributeMetadata'||_0x5eac45==='EntityNameAttributeMetadata'||_0x5eac45==='StateAttributeMetadata'||_0x5eac45===_0xf094('0xae')){_0x390f20[_0xf094('0xa7')](getInputList(_0x570cc0,_0x447b3c,_0x5eac45,_0x1f14e3,_0x48f335[_0xf094('0x9c')],_0xfa5188['MetadataId'],_0x2f84ae));}}});return Promise[_0xf094('0xa4')](_0x390f20);})['then'](function(_0x232323){_0x2670a5=_0x232323[0x0];var _0x5cb82f=_0x3f195d[_0xf094('0x8a')](_0x525b16)[_0xf094('0x8a')](_0x2670a5);var _0x3124c3={'count':_0x5cb82f[_0xf094('0x1d')],'rows':_0x5cb82f};return _0x3124c3;})['then'](respondWithResult(_0x5d3474,null))[_0xf094('0x2b')](function(_0x1124cb){var _0x10efd0=_0x388cb8[_0xf094('0x19')][_0xf094('0xaf')]?0x1f4:_0x1124cb[_0xf094('0xb0')]||0x1f4;logger[_0xf094('0xf')](_0x1124cb[_0xf094('0x10')]);delete _0x1124cb['name'];if(_0x10efd0===0x191){_0x10efd0=0x190;}_0x5d3474[_0xf094('0x7')](_0x10efd0)[_0xf094('0x12')](_0x388cb8[_0xf094('0x19')][_0xf094('0xaf')]?{'message':'Wrong\x20credentials','statusCode':_0x1124cb[_0xf094('0xb0')]}:_0x1124cb);});};function getSelectList(_0x3bf949,_0x2cbe80,_0xcf3da4,_0x3ac5d7,_0x5abd75,_0x2bdd63){var _0x500268={'method':_0xf094('0x98'),'uri':_0x3bf949+_0xf094('0xb1')+_0x3ac5d7+_0xf094('0xb2')+_0x5abd75+_0xf094('0xb3')+_0xf094('0xb4'),'headers':{'Authorization':_0xf094('0x9a')+_0x2bdd63,'If-None-Match':null,'OData-Version':_0xf094('0x9e')},'json':!![]};return rp(_0x500268)[_0xf094('0xc')](function(_0x5d7819){var _0x354192=[];var _0x5dfece=_0x5d7819[_0xf094('0xb5')][_0xf094('0xb6')];_0x5dfece[_0xf094('0xa1')](function(_0x4a9555){_0x354192['push']({'name':_0x4a9555[_0xf094('0xb7')]['UserLocalizedLabel']['Label'],'value':String(_0x4a9555[_0xf094('0xb8')])});});var _0x346008={'id':_0x2cbe80+'_'+_0x5d7819[_0xf094('0xa0')],'name':_0x5d7819[_0xf094('0xb9')][_0xf094('0xba')]['Label'],'custom':![],'options':_0x354192};_0xcf3da4[_0xf094('0xa7')](_0x346008);return _0xcf3da4;});}function getBooleanList(_0x2fc431,_0x1a086e,_0x56abb9,_0x36b3fe,_0x267034,_0x40e1e6){var _0x37d557={'method':_0xf094('0x98'),'uri':_0x2fc431+'EntityDefinitions('+_0x36b3fe+_0xf094('0xb2')+_0x267034+')/Microsoft.Dynamics.CRM.BooleanAttributeMetadata?$select=DisplayName,LogicalName&$expand=OptionSet($select=FalseOption,\x20TrueOption)','headers':{'Authorization':_0xf094('0x9a')+_0x40e1e6,'If-None-Match':null,'OData-Version':_0xf094('0x9e')},'json':!![]};return rp(_0x37d557)[_0xf094('0xc')](function(_0x1297f7){var _0x569dfc=[];_0x569dfc[_0xf094('0xa7')]({'name':_0x1297f7[_0xf094('0xb5')]['TrueOption'][_0xf094('0xb7')]['UserLocalizedLabel'][_0xf094('0xb7')],'value':_0xf094('0xbb')},{'name':_0x1297f7[_0xf094('0xb5')][_0xf094('0xbc')][_0xf094('0xb7')]['UserLocalizedLabel'][_0xf094('0xb7')],'value':_0xf094('0xbd')});var _0x166779={'id':_0x1a086e+'_'+_0x1297f7[_0xf094('0xa0')],'name':_0x1297f7[_0xf094('0xb9')][_0xf094('0xba')][_0xf094('0xb7')],'custom':![],'options':_0x569dfc};_0x56abb9['push'](_0x166779);return _0x56abb9;});}function getInputList(_0x59cfc3,_0x50b522,_0x54aeb9,_0x55ad2b,_0x193d2d,_0x3f86f1,_0x5ac9dc){var _0x5542ec={'method':_0xf094('0x98'),'uri':_0x59cfc3+_0xf094('0xb1')+_0x193d2d+_0xf094('0xb2')+_0x3f86f1+_0xf094('0xbe')+_0x54aeb9+_0xf094('0xbf'),'headers':{'Authorization':_0xf094('0x9a')+_0x5ac9dc,'If-None-Match':null,'OData-Version':_0xf094('0x9e')},'json':!![]};return rp(_0x5542ec)[_0xf094('0xc')](function(_0x495e94){var _0x5f2a1e={'id':_0x50b522+'_'+_0x495e94[_0xf094('0xa0')],'name':_0x495e94[_0xf094('0xb9')][_0xf094('0xba')]?_0x495e94['DisplayName'][_0xf094('0xba')]['Label']:_0x495e94[_0xf094('0xa0')],'custom':![],'options':[]};_0x55ad2b['push'](_0x5f2a1e);return _0x55ad2b;});} \ No newline at end of file +var _0xe6dc=['PhoneCall','title','description','customerid','ownerid','caseorigincode','subject','directioncode','accountidname','accountidyominame','actualserviceunits','billedserviceunits','contactidname','contactidyominame','contractdetailidname','contractidname','createdbyexternalpartyname','createdbyexternalpartyyominame','createdbyname','createdon','createdonbehalfbyname','createdonbehalfbyyominame','customeridtype','customeridyominame','emailaddress','entitlementidname','entityimage_timestamp','escalatedon','firstresponsebykpiidname','followupby','importsequencenumber','influencescore','kbarticleidname','lastonholdtime','masteridname','modifiedbyexternalpartyname','modifiedbyexternalpartyyominame','modifiedbyyominame','modifiedon','modifiedonbehalfbyyominame','msdyn_incidenttypename','msdyn_iotalertname','numberofchildincidents','owneridname','owneridtype','parentcaseidname','primarycontactidname','prioritycodename','productserialnumber','resolvebykpiidname','responseby','responsiblecontactidname','sentimentvalue','slaname','socialprofileidname','statuscode','subjectidname','timezoneruleversionnumber','transactioncurrencyidname','utcconversiontimezonecode','versionnumber','concat','password','remoteUri','clientId','modernAuthentication','CloudProvider','access_token','data5','POST','https://login.microsoftonline.com/','tenantId','clientSecret','GET','4.0','MetadataId','EntityDefinitions(',')?$select=LogicalName&$expand=Attributes($select=LogicalName)','Bearer\x20','includes','LogicalName','forEach','@odata.type','isNil','BooleanAttributeMetadata','push','all','DoubleAttributeMetadata','BigIntAttributeMetadata','IntegerAttributeMetadata','DateTimeAttributeMetadata','StatusAttributeMetadata','EntityNameAttributeMetadata','StateAttributeMetadata','DecimalAttributeMetadata','test','Wrong\x20credentials',')/Microsoft.Dynamics.CRM.PicklistAttributeMetadata?','$select=DisplayName,LogicalName&$expand=OptionSet($select=Options)','OptionSet','Options','Label','UserLocalizedLabel','Value','DisplayName',')/Attributes(',')/Microsoft.Dynamics.CRM.BooleanAttributeMetadata?$select=DisplayName,LogicalName&$expand=OptionSet($select=FalseOption,\x20TrueOption)','TrueOption','true','false',')/Microsoft.Dynamics.CRM.','?$select=DisplayName,LogicalName','request-promise','util','lodash','../../components/parsers/qs','../../config/logger','api','../../mysqldb','../../components/integrations/configuration','status','json','undefined','limit','count','offset','set','Content-Range','update','then','destroy','end','sendStatus','error','stack','name','send','index','map','Dynamics365Account','fieldName','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','sort','where','pick','filter','merge','type','VIRTUAL','includeAll','show','params','rawAttributes','include','find','create','body','catch','getConfigurations','findOne','Dynamics365Configuration','order','addConfiguration','AccountId','Subjects','getSubjects','channel','Descriptions','getDescriptions','Dynamics365Field','slice','substring','lastIndexOf','format','%s/api/data/v9.0/','incident','Incident'];(function(_0x115e41,_0x2257e5){var _0x5632a7=function(_0x38291b){while(--_0x38291b){_0x115e41['push'](_0x115e41['shift']());}};_0x5632a7(++_0x2257e5);}(_0xe6dc,0x70));var _0xce6d=function(_0x306321,_0x67f5d0){_0x306321=_0x306321-0x0;var _0x12e9e7=_0xe6dc[_0x306321];return _0x12e9e7;};'use strict';var rp=require(_0xce6d('0x0'));var util=require(_0xce6d('0x1'));var _=require(_0xce6d('0x2'));var qs=require(_0xce6d('0x3'));var logger=require(_0xce6d('0x4'))(_0xce6d('0x5'));var db=require(_0xce6d('0x6'))['db'];var integrations=require(_0xce6d('0x7'));function respondWithResult(_0x9a8de8,_0x12c5de){_0x12c5de=_0x12c5de||0xc8;return function(_0x454a05){if(_0x454a05){return _0x9a8de8[_0xce6d('0x8')](_0x12c5de)[_0xce6d('0x9')](_0x454a05);}};}function respondWithFilteredResult(_0x5aaad9,_0x1738ca){return function(_0xb6d14e){if(_0xb6d14e){var _0x186c11=typeof _0x1738ca['offset']===_0xce6d('0xa')&&typeof _0x1738ca[_0xce6d('0xb')]==='undefined';var _0x2bc5da=_0xb6d14e[_0xce6d('0xc')];var _0x42edef=_0x186c11?0x0:_0x1738ca[_0xce6d('0xd')];var _0x2763e0=_0x186c11?_0xb6d14e['count']:_0x1738ca[_0xce6d('0xd')]+_0x1738ca[_0xce6d('0xb')];var _0x102452;if(_0x2763e0>=_0x2bc5da){_0x2763e0=_0x2bc5da;_0x102452=0xc8;}else{_0x102452=0xce;}_0x5aaad9[_0xce6d('0x8')](_0x102452);return _0x5aaad9[_0xce6d('0xe')](_0xce6d('0xf'),_0x42edef+'-'+_0x2763e0+'/'+_0x2bc5da)[_0xce6d('0x9')](_0xb6d14e);}return null;};}function saveUpdates(_0x1b0d89){return function(_0x488fbd){if(_0x488fbd){return _0x488fbd[_0xce6d('0x10')](_0x1b0d89)[_0xce6d('0x11')](function(_0x531eec){return _0x531eec;});}return null;};}function removeEntity(_0x398c7f){return function(_0x289d22){if(_0x289d22){return _0x289d22[_0xce6d('0x12')]()[_0xce6d('0x11')](function(){_0x398c7f[_0xce6d('0x8')](0xcc)[_0xce6d('0x13')]();});}};}function handleEntityNotFound(_0x39da30){return function(_0x314039){if(!_0x314039){_0x39da30[_0xce6d('0x14')](0x194);}return _0x314039;};}function handleError(_0x23f237,_0xb7d524){_0xb7d524=_0xb7d524||0x1f4;return function(_0x515aef){logger[_0xce6d('0x15')](_0x515aef[_0xce6d('0x16')]);if(_0x515aef[_0xce6d('0x17')]){delete _0x515aef[_0xce6d('0x17')];}_0x23f237[_0xce6d('0x8')](_0xb7d524)[_0xce6d('0x18')](_0x515aef);};}exports[_0xce6d('0x19')]=function(_0x4ca0dd,_0x4ca648){var _0x478233={},_0x32e643={},_0x687511={'count':0x0,'rows':[]};var _0x1124a1=_[_0xce6d('0x1a')](db[_0xce6d('0x1b')]['rawAttributes'],function(_0x5e2cfd){return{'name':_0x5e2cfd[_0xce6d('0x1c')],'type':_0x5e2cfd['type'][_0xce6d('0x1d')]};});_0x32e643[_0xce6d('0x1e')]=_[_0xce6d('0x1a')](_0x1124a1,_0xce6d('0x17'));_0x32e643[_0xce6d('0x1f')]=_[_0xce6d('0x20')](_0x4ca0dd['query']);_0x32e643[_0xce6d('0x21')]=_[_0xce6d('0x22')](_0x32e643[_0xce6d('0x1e')],_0x32e643[_0xce6d('0x1f')]);_0x478233[_0xce6d('0x23')]=_['intersection'](_0x32e643[_0xce6d('0x1e')],qs['fields'](_0x4ca0dd[_0xce6d('0x1f')][_0xce6d('0x24')]));_0x478233[_0xce6d('0x23')]=_0x478233[_0xce6d('0x23')][_0xce6d('0x25')]?_0x478233['attributes']:_0x32e643[_0xce6d('0x1e')];if(!_0x4ca0dd['query'][_0xce6d('0x26')](_0xce6d('0x27'))){_0x478233[_0xce6d('0xb')]=qs['limit'](_0x4ca0dd['query'][_0xce6d('0xb')]);_0x478233['offset']=qs[_0xce6d('0xd')](_0x4ca0dd['query'][_0xce6d('0xd')]);}_0x478233['order']=qs['sort'](_0x4ca0dd[_0xce6d('0x1f')][_0xce6d('0x28')]);_0x478233[_0xce6d('0x29')]=qs[_0xce6d('0x21')](_[_0xce6d('0x2a')](_0x4ca0dd[_0xce6d('0x1f')],_0x32e643[_0xce6d('0x21')]),_0x1124a1);if(_0x4ca0dd['query'][_0xce6d('0x2b')]){_0x478233[_0xce6d('0x29')]=_[_0xce6d('0x2c')](_0x478233[_0xce6d('0x29')],{'$or':_[_0xce6d('0x1a')](_0x1124a1,function(_0xfe3a66){if(_0xfe3a66[_0xce6d('0x2d')]!==_0xce6d('0x2e')){var _0x4ecbe8={};_0x4ecbe8[_0xfe3a66['name']]={'$like':'%'+_0x4ca0dd[_0xce6d('0x1f')][_0xce6d('0x2b')]+'%'};return _0x4ecbe8;}})});}_0x478233=_[_0xce6d('0x2c')]({},_0x478233,_0x4ca0dd['options']);var _0x559077={'where':_0x478233[_0xce6d('0x29')]};return db['Dynamics365Account'][_0xce6d('0xc')](_0x559077)[_0xce6d('0x11')](function(_0x85309f){_0x687511[_0xce6d('0xc')]=_0x85309f;if(_0x4ca0dd['query'][_0xce6d('0x2f')]){_0x478233['include']=[{'all':!![]}];}return db[_0xce6d('0x1b')]['findAll'](_0x478233);})[_0xce6d('0x11')](function(_0x12ac87){_0x687511['rows']=_0x12ac87;return _0x687511;})[_0xce6d('0x11')](respondWithFilteredResult(_0x4ca648,_0x478233))['catch'](handleError(_0x4ca648,null));};exports[_0xce6d('0x30')]=function(_0x57753e,_0x37679b){var _0x5e26fb={'raw':![],'where':{'id':_0x57753e[_0xce6d('0x31')]['id']}},_0x466ec0={};_0x466ec0[_0xce6d('0x1e')]=_[_0xce6d('0x20')](db[_0xce6d('0x1b')][_0xce6d('0x32')]);_0x466ec0['query']=_[_0xce6d('0x20')](_0x57753e[_0xce6d('0x1f')]);_0x466ec0[_0xce6d('0x21')]=_[_0xce6d('0x22')](_0x466ec0['model'],_0x466ec0['query']);_0x5e26fb[_0xce6d('0x23')]=_['intersection'](_0x466ec0[_0xce6d('0x1e')],qs['fields'](_0x57753e[_0xce6d('0x1f')][_0xce6d('0x24')]));_0x5e26fb['attributes']=_0x5e26fb['attributes'][_0xce6d('0x25')]?_0x5e26fb['attributes']:_0x466ec0[_0xce6d('0x1e')];if(_0x57753e[_0xce6d('0x1f')][_0xce6d('0x2f')]){_0x5e26fb[_0xce6d('0x33')]=[{'all':!![]}];}_0x5e26fb=_['merge']({},_0x5e26fb,_0x57753e['options']);return db[_0xce6d('0x1b')][_0xce6d('0x34')](_0x5e26fb)[_0xce6d('0x11')](handleEntityNotFound(_0x37679b,null))[_0xce6d('0x11')](respondWithResult(_0x37679b,null))['catch'](handleError(_0x37679b,null));};exports[_0xce6d('0x35')]=function(_0x2fa0e5,_0x2556b5){return db[_0xce6d('0x1b')][_0xce6d('0x35')](_0x2fa0e5[_0xce6d('0x36')],{})[_0xce6d('0x11')](respondWithResult(_0x2556b5,0xc9))[_0xce6d('0x37')](handleError(_0x2556b5,null));};exports[_0xce6d('0x10')]=function(_0x50d5fd,_0x5c4708){if(_0x50d5fd['body']['id']){delete _0x50d5fd[_0xce6d('0x36')]['id'];}return db[_0xce6d('0x1b')][_0xce6d('0x34')]({'where':{'id':_0x50d5fd[_0xce6d('0x31')]['id']}})['then'](handleEntityNotFound(_0x5c4708,null))[_0xce6d('0x11')](saveUpdates(_0x50d5fd[_0xce6d('0x36')],null))[_0xce6d('0x11')](respondWithResult(_0x5c4708,null))['catch'](handleError(_0x5c4708,null));};exports[_0xce6d('0x12')]=function(_0x1edb71,_0x15ef7e){return db['Dynamics365Account'][_0xce6d('0x34')]({'where':{'id':_0x1edb71[_0xce6d('0x31')]['id']}})[_0xce6d('0x11')](handleEntityNotFound(_0x15ef7e,null))[_0xce6d('0x11')](removeEntity(_0x15ef7e,null))[_0xce6d('0x37')](handleError(_0x15ef7e,null));};exports[_0xce6d('0x38')]=function(_0x215c51,_0x3e49f3){var _0x44fe94={};var _0x8f850d={};var _0x47e662;var _0x220eb0;return db[_0xce6d('0x1b')][_0xce6d('0x39')]({'where':{'id':_0x215c51['params']['id']}})[_0xce6d('0x11')](handleEntityNotFound(_0x3e49f3,null))['then'](function(_0x4d6c26){if(_0x4d6c26){_0x47e662=_0x4d6c26;_0x8f850d['model']=_[_0xce6d('0x20')](db[_0xce6d('0x3a')][_0xce6d('0x32')]);_0x8f850d[_0xce6d('0x1f')]=_[_0xce6d('0x20')](_0x215c51[_0xce6d('0x1f')]);_0x8f850d[_0xce6d('0x21')]=_[_0xce6d('0x22')](_0x8f850d[_0xce6d('0x1e')],_0x8f850d[_0xce6d('0x1f')]);_0x44fe94['attributes']=_[_0xce6d('0x22')](_0x8f850d[_0xce6d('0x1e')],qs[_0xce6d('0x24')](_0x215c51[_0xce6d('0x1f')]['fields']));_0x44fe94['attributes']=_0x44fe94['attributes'][_0xce6d('0x25')]?_0x44fe94[_0xce6d('0x23')]:_0x8f850d[_0xce6d('0x1e')];_0x44fe94[_0xce6d('0x3b')]=qs[_0xce6d('0x28')](_0x215c51[_0xce6d('0x1f')][_0xce6d('0x28')]);_0x44fe94['where']=qs[_0xce6d('0x21')](_[_0xce6d('0x2a')](_0x215c51[_0xce6d('0x1f')],_0x8f850d[_0xce6d('0x21')]));if(_0x215c51[_0xce6d('0x1f')][_0xce6d('0x2b')]){_0x44fe94[_0xce6d('0x29')]=_[_0xce6d('0x2c')](_0x44fe94[_0xce6d('0x29')],{'$or':_['map'](_0x44fe94[_0xce6d('0x23')],function(_0x1d00d4){var _0x472c6d={};_0x472c6d[_0x1d00d4]={'$like':'%'+_0x215c51[_0xce6d('0x1f')][_0xce6d('0x2b')]+'%'};return _0x472c6d;})});}_0x44fe94=_[_0xce6d('0x2c')]({},_0x44fe94,_0x215c51['options']);return _0x47e662[_0xce6d('0x38')](_0x44fe94);}})['then'](function(_0x20d8be){if(_0x20d8be){_0x220eb0=_0x20d8be['length'];if(!_0x215c51['query'][_0xce6d('0x26')](_0xce6d('0x27'))){_0x44fe94['limit']=qs[_0xce6d('0xb')](_0x215c51[_0xce6d('0x1f')][_0xce6d('0xb')]);_0x44fe94[_0xce6d('0xd')]=qs[_0xce6d('0xd')](_0x215c51[_0xce6d('0x1f')][_0xce6d('0xd')]);}return _0x47e662[_0xce6d('0x38')](_0x44fe94);}})[_0xce6d('0x11')](function(_0x4f170e){if(_0x4f170e){return _0x4f170e?{'count':_0x220eb0,'rows':_0x4f170e}:null;}})[_0xce6d('0x11')](respondWithResult(_0x3e49f3,null))[_0xce6d('0x37')](handleError(_0x3e49f3,null));};exports[_0xce6d('0x3c')]=function(_0x4671b9,_0x3a2151){if(_0x4671b9[_0xce6d('0x36')]['id']){delete _0x4671b9['body']['id'];}return db[_0xce6d('0x1b')][_0xce6d('0x39')]({'where':{'id':_0x4671b9['params']['id']}})['then'](handleEntityNotFound(_0x3a2151,null))[_0xce6d('0x11')](function(_0x133e66){if(_0x133e66){_0x4671b9[_0xce6d('0x36')][_0xce6d('0x3d')]=_0x133e66['id'];_0x4671b9[_0xce6d('0x36')][_0xce6d('0x3e')]=integrations[_0xce6d('0x3f')](_0x4671b9[_0xce6d('0x36')][_0xce6d('0x40')],_0x4671b9[_0xce6d('0x36')][_0xce6d('0x2d')]);_0x4671b9[_0xce6d('0x36')][_0xce6d('0x41')]=integrations[_0xce6d('0x42')](_0x4671b9['body'][_0xce6d('0x40')],_0x4671b9['body'][_0xce6d('0x2d')]);return db[_0xce6d('0x3a')][_0xce6d('0x35')](_0x4671b9[_0xce6d('0x36')],{'include':[{'model':db[_0xce6d('0x43')],'as':_0xce6d('0x3e')},{'model':db[_0xce6d('0x43')],'as':_0xce6d('0x41')}]});}return null;})[_0xce6d('0x11')](respondWithResult(_0x3a2151,null))[_0xce6d('0x37')](handleError(_0x3a2151,null));};function sanitizeRemoteUri(_0x3cc162){var _0x491259=_0x3cc162[_0xce6d('0x44')](-0x1);if(_0x491259==='/')return _0x3cc162[_0xce6d('0x45')](0x0,_0x3cc162[_0xce6d('0x46')](_0x491259));return _0x3cc162;}function getWebApiUrl(_0x56ffd9){return util[_0xce6d('0x47')](_0xce6d('0x48'),_0x56ffd9);}exports['getFields']=function(_0x31e132,_0x5852f9){var _0x4da725=_0x31e132[_0xce6d('0x1f')]['ticketType'];var _0x3e676c=_0x4da725===_0xce6d('0x49')?_0xce6d('0x4a'):_0xce6d('0x4b');var _0x40ddc6='';var _0x3301f3='';var _0x39a09d='';var _0x1c151d='';var _0x24ce61='';var _0x5d3296='';var _0x2de20c='';var _0xdc11d2='';var _0x576ac6=[_0xce6d('0x4c'),_0xce6d('0x4d'),_0xce6d('0x4e'),_0xce6d('0x4f'),_0xce6d('0x50'),_0xce6d('0x51'),'phonenumber','regardingobjectid',_0xce6d('0x52'),'phonecall_activity_parties'];var _0x26dc1d=[_0xce6d('0x53'),_0xce6d('0x54'),_0xce6d('0x55'),_0xce6d('0x56'),_0xce6d('0x57'),_0xce6d('0x58'),_0xce6d('0x59'),_0xce6d('0x5a'),_0xce6d('0x5b'),_0xce6d('0x5c'),_0xce6d('0x5d'),'createdbyyominame',_0xce6d('0x5e'),_0xce6d('0x5f'),_0xce6d('0x60'),'customeridname',_0xce6d('0x61'),_0xce6d('0x62'),_0xce6d('0x63'),_0xce6d('0x64'),_0xce6d('0x65'),'entityimage_url',_0xce6d('0x66'),'exchangerate',_0xce6d('0x67'),_0xce6d('0x68'),_0xce6d('0x69'),_0xce6d('0x6a'),_0xce6d('0x6b'),_0xce6d('0x6c'),_0xce6d('0x6d'),_0xce6d('0x6e'),_0xce6d('0x6f'),'modifiedbyname',_0xce6d('0x70'),_0xce6d('0x71'),'modifiedonbehalfbyname',_0xce6d('0x72'),_0xce6d('0x73'),_0xce6d('0x74'),_0xce6d('0x75'),'onholdtime','overriddencreatedon',_0xce6d('0x76'),_0xce6d('0x77'),'owneridyominame',_0xce6d('0x78'),_0xce6d('0x79'),'primarycontactidyominame',_0xce6d('0x7a'),'productidname',_0xce6d('0x7b'),'resolveby',_0xce6d('0x7c'),_0xce6d('0x7d'),_0xce6d('0x7e'),'responsiblecontactidyominame',_0xce6d('0x7f'),'slainvokedidname',_0xce6d('0x80'),_0xce6d('0x81'),'statecode',_0xce6d('0x82'),_0xce6d('0x83'),'ticketnumber',_0xce6d('0x84'),_0xce6d('0x85'),'traversedpath',_0xce6d('0x86'),_0xce6d('0x87')];var _0x44a2e3=_0x576ac6[_0xce6d('0x88')](_0x26dc1d);return db[_0xce6d('0x1b')]['findOne']({'where':{'id':_0x31e132[_0xce6d('0x31')]['id']},'attributes':['id','username',_0xce6d('0x89'),_0xce6d('0x8a'),'tenantId',_0xce6d('0x8b'),'clientSecret',_0xce6d('0x8c')],'include':[{'model':db[_0xce6d('0x8d')],'as':_0xce6d('0x8d'),'attributes':['id','data5','data7']}]})[_0xce6d('0x11')](handleEntityNotFound(_0x5852f9,null))[_0xce6d('0x11')](function(_0x3a327b){if(_0x3a327b){if(_0x3a327b['modernAuthentication']){_0x3a327b[_0xce6d('0x8e')]=_0x3a327b[_0xce6d('0x8d')][_0xce6d('0x8f')];_0xdc11d2=sanitizeRemoteUri(_0x3a327b[_0xce6d('0x8d')]['data7']);_0x2de20c=getWebApiUrl(_0xdc11d2);return _0x3a327b;}_0xdc11d2=sanitizeRemoteUri(_0x3a327b[_0xce6d('0x8a')]);_0x2de20c=getWebApiUrl(_0xdc11d2);var _0x53c053={'method':_0xce6d('0x90'),'uri':_0xce6d('0x91')+_0x3a327b[_0xce6d('0x92')]+'/oauth2/token','form':{'client_id':_0x3a327b['clientId'],'resource':_0xdc11d2,'username':_0x3a327b['username'],'password':_0x3a327b[_0xce6d('0x89')],'grant_type':'password','client_secret':_0x3a327b[_0xce6d('0x93')]},'json':!![]};return rp(_0x53c053);}})[_0xce6d('0x11')](function(_0x3112f6){_0x5d3296=_0x3112f6[_0xce6d('0x8e')];var _0x36bdb8={'method':_0xce6d('0x94'),'uri':encodeURI(_0x2de20c+'EntityDefinitions?$select=DisplayName,EntitySetName&$filter=SchemaName\x20eq\x20\x27'+_0x3e676c+'\x27'),'headers':{'Authorization':'Bearer\x20'+_0x5d3296,'If-None-Match':null,'OData-Version':_0xce6d('0x95')},'json':!![]};return rp(_0x36bdb8);})['then'](function(_0x5d770d){var _0x3de935=_0x5d770d['value'][0x0];var _0x5a1f14=_0x3de935[_0xce6d('0x96')];var _0x3c511f={'method':_0xce6d('0x94'),'uri':_0x2de20c+_0xce6d('0x97')+_0x5a1f14+_0xce6d('0x98'),'headers':{'Authorization':_0xce6d('0x99')+_0x5d3296,'If-None-Match':null,'OData-Version':_0xce6d('0x95')},'json':!![]};return rp(_0x3c511f);})['then'](function(_0x346948){_0x40ddc6=_0x346948;_0x3301f3=_0x40ddc6['Attributes'];_0x3301f3=_['remove'](_0x3301f3,function(_0x4d3024){return!_0x44a2e3[_0xce6d('0x9a')](_0x4d3024[_0xce6d('0x9b')]);});var _0x203825=[];var _0x41b619=[];_0x3301f3[_0xce6d('0x9c')](function(_0x936611){if(_0x936611[_0xce6d('0x9d')]){var _0x389c29=_0x936611[_0xce6d('0x9d')][_0xce6d('0x45')](_0x936611['@odata.type']['lastIndexOf']('.')+0x1);if(_0x389c29==='PicklistAttributeMetadata'){_0x203825['push'](getSelectList(_0x2de20c,_0x4da725,_0x41b619,_0x40ddc6[_0xce6d('0x96')],_0x936611[_0xce6d('0x96')],_0x5d3296));}}});return Promise['all'](_0x203825);})[_0xce6d('0x11')](function(_0x17c37a){_0x39a09d=_0x17c37a[0x0];var _0x51599f=[];var _0xd4adad=[];_0x3301f3[_0xce6d('0x9c')](function(_0x18727c){if(!_[_0xce6d('0x9e')](_0x18727c[_0xce6d('0x9d')])){var _0x1bf415=_0x18727c[_0xce6d('0x9d')][_0xce6d('0x45')](_0x18727c['@odata.type'][_0xce6d('0x46')]('.')+0x1);if(_0x1bf415===_0xce6d('0x9f')){_0x51599f[_0xce6d('0xa0')](getBooleanList(_0x2de20c,_0x4da725,_0xd4adad,_0x40ddc6[_0xce6d('0x96')],_0x18727c[_0xce6d('0x96')],_0x5d3296));}}});return Promise[_0xce6d('0xa1')](_0x51599f);})[_0xce6d('0x11')](function(_0x4c7bb2){_0x1c151d=_0x4c7bb2[0x0];var _0x48f167=[];var _0x2cd092=[];_0x3301f3['forEach'](function(_0x38acbd){if(_0x38acbd['@odata.type']){var _0x17b3b3=_0x38acbd['@odata.type']['substring'](_0x38acbd['@odata.type']['lastIndexOf']('.')+0x1);if(_0x17b3b3==='StringAttributeMetadata'||_0x17b3b3===_0xce6d('0xa2')||_0x17b3b3===_0xce6d('0xa3')||_0x17b3b3===_0xce6d('0xa4')||_0x17b3b3==='MemoAttributeMetadata'||_0x17b3b3===_0xce6d('0xa5')||_0x17b3b3===_0xce6d('0xa6')||_0x17b3b3===_0xce6d('0xa7')||_0x17b3b3===_0xce6d('0xa8')||_0x17b3b3===_0xce6d('0xa9')){_0x48f167[_0xce6d('0xa0')](getInputList(_0x2de20c,_0x4da725,_0x17b3b3,_0x2cd092,_0x40ddc6[_0xce6d('0x96')],_0x38acbd[_0xce6d('0x96')],_0x5d3296));}}});return Promise[_0xce6d('0xa1')](_0x48f167);})[_0xce6d('0x11')](function(_0x286d07){_0x24ce61=_0x286d07[0x0];var _0x19ccc7=_0x39a09d['concat'](_0x1c151d)[_0xce6d('0x88')](_0x24ce61);var _0x2f786e={'count':_0x19ccc7[_0xce6d('0x25')],'rows':_0x19ccc7};return _0x2f786e;})[_0xce6d('0x11')](respondWithResult(_0x5852f9,null))[_0xce6d('0x37')](function(_0xc800c0){var _0x27da62=_0x31e132[_0xce6d('0x1f')][_0xce6d('0xaa')]?0x1f4:_0xc800c0['statusCode']||0x1f4;logger[_0xce6d('0x15')](_0xc800c0['stack']);delete _0xc800c0[_0xce6d('0x17')];if(_0x27da62===0x191){_0x27da62=0x190;}_0x5852f9['status'](_0x27da62)['send'](_0x31e132[_0xce6d('0x1f')][_0xce6d('0xaa')]?{'message':_0xce6d('0xab'),'statusCode':_0xc800c0['statusCode']}:_0xc800c0);});};function getSelectList(_0xb7ba4f,_0x2f9f44,_0x3f9e48,_0x403be8,_0x18e919,_0x205b43){var _0x425221={'method':_0xce6d('0x94'),'uri':_0xb7ba4f+_0xce6d('0x97')+_0x403be8+')/Attributes('+_0x18e919+_0xce6d('0xac')+_0xce6d('0xad'),'headers':{'Authorization':'Bearer\x20'+_0x205b43,'If-None-Match':null,'OData-Version':'4.0'},'json':!![]};return rp(_0x425221)[_0xce6d('0x11')](function(_0x1c2d5a){var _0x572726=[];var _0x41765a=_0x1c2d5a[_0xce6d('0xae')][_0xce6d('0xaf')];_0x41765a[_0xce6d('0x9c')](function(_0x58727a){_0x572726[_0xce6d('0xa0')]({'name':_0x58727a[_0xce6d('0xb0')][_0xce6d('0xb1')][_0xce6d('0xb0')],'value':String(_0x58727a[_0xce6d('0xb2')])});});var _0x5ca552={'id':_0x2f9f44+'_'+_0x1c2d5a[_0xce6d('0x9b')],'name':_0x1c2d5a[_0xce6d('0xb3')][_0xce6d('0xb1')][_0xce6d('0xb0')],'custom':![],'options':_0x572726};_0x3f9e48['push'](_0x5ca552);return _0x3f9e48;});}function getBooleanList(_0x5bcdee,_0x410525,_0xd81bfd,_0x3bb4a1,_0x194f25,_0x21210a){var _0x2ccb1d={'method':_0xce6d('0x94'),'uri':_0x5bcdee+_0xce6d('0x97')+_0x3bb4a1+_0xce6d('0xb4')+_0x194f25+_0xce6d('0xb5'),'headers':{'Authorization':_0xce6d('0x99')+_0x21210a,'If-None-Match':null,'OData-Version':_0xce6d('0x95')},'json':!![]};return rp(_0x2ccb1d)['then'](function(_0x59b51c){var _0x3cc840=[];_0x3cc840[_0xce6d('0xa0')]({'name':_0x59b51c[_0xce6d('0xae')][_0xce6d('0xb6')][_0xce6d('0xb0')][_0xce6d('0xb1')][_0xce6d('0xb0')],'value':_0xce6d('0xb7')},{'name':_0x59b51c['OptionSet']['FalseOption']['Label'][_0xce6d('0xb1')][_0xce6d('0xb0')],'value':_0xce6d('0xb8')});var _0x4ea95c={'id':_0x410525+'_'+_0x59b51c['LogicalName'],'name':_0x59b51c[_0xce6d('0xb3')][_0xce6d('0xb1')][_0xce6d('0xb0')],'custom':![],'options':_0x3cc840};_0xd81bfd[_0xce6d('0xa0')](_0x4ea95c);return _0xd81bfd;});}function getInputList(_0x37927b,_0x5a0e43,_0x49d661,_0x12a6a8,_0x38a53d,_0x4d76,_0x306feb){var _0x2958e7={'method':'GET','uri':_0x37927b+_0xce6d('0x97')+_0x38a53d+_0xce6d('0xb4')+_0x4d76+_0xce6d('0xb9')+_0x49d661+_0xce6d('0xba'),'headers':{'Authorization':_0xce6d('0x99')+_0x306feb,'If-None-Match':null,'OData-Version':'4.0'},'json':!![]};return rp(_0x2958e7)[_0xce6d('0x11')](function(_0xd3ad42){var _0xd3b4d4={'id':_0x5a0e43+'_'+_0xd3ad42['LogicalName'],'name':_0xd3ad42[_0xce6d('0xb3')][_0xce6d('0xb1')]?_0xd3ad42[_0xce6d('0xb3')][_0xce6d('0xb1')]['Label']:_0xd3ad42[_0xce6d('0x9b')],'custom':![],'options':[]};_0x12a6a8[_0xce6d('0xa0')](_0xd3b4d4);return _0x12a6a8;});} \ No newline at end of file diff --git a/server/api/intDynamics365Account/intDynamics365Account.model.js b/server/api/intDynamics365Account/intDynamics365Account.model.js index cb7513d..43bd7ff 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 _0xb7e7=['int_dynamics365_accounts','lodash','../../config/logger','moment','request-promise','rimraf','../../config/environment','./intDynamics365Account.attributes','define'];(function(_0x374a0e,_0x313fc8){var _0x192043=function(_0x1321da){while(--_0x1321da){_0x374a0e['push'](_0x374a0e['shift']());}};_0x192043(++_0x313fc8);}(_0xb7e7,0x121));var _0x7b7e=function(_0xa6cc5c,_0x239c99){_0xa6cc5c=_0xa6cc5c-0x0;var _0x44803d=_0xb7e7[_0xa6cc5c];return _0x44803d;};'use strict';var _=require(_0x7b7e('0x0'));var util=require('util');var logger=require(_0x7b7e('0x1'))('api');var moment=require(_0x7b7e('0x2'));var BPromise=require('bluebird');var rp=require(_0x7b7e('0x3'));var fs=require('fs');var path=require('path');var rimraf=require(_0x7b7e('0x4'));var config=require(_0x7b7e('0x5'));var attributes=require(_0x7b7e('0x6'));var integrations=require('../../components/integrations/configuration');module['exports']=function(_0x333fa4,_0x372bde){return _0x333fa4[_0x7b7e('0x7')]('Dynamics365Account',attributes,{'tableName':_0x7b7e('0x8'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x757a=['Dynamics365Account','int_dynamics365_accounts','util','../../config/logger','request-promise','path','rimraf','../../config/environment','./intDynamics365Account.attributes','../../components/integrations/configuration'];(function(_0x1e1329,_0x3a01bd){var _0xd66a6f=function(_0x88d74b){while(--_0x88d74b){_0x1e1329['push'](_0x1e1329['shift']());}};_0xd66a6f(++_0x3a01bd);}(_0x757a,0xde));var _0xa757=function(_0x37f6e7,_0x1621c1){_0x37f6e7=_0x37f6e7-0x0;var _0xc44bca=_0x757a[_0x37f6e7];return _0xc44bca;};'use strict';var _=require('lodash');var util=require(_0xa757('0x0'));var logger=require(_0xa757('0x1'))('api');var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0xa757('0x2'));var fs=require('fs');var path=require(_0xa757('0x3'));var rimraf=require(_0xa757('0x4'));var config=require(_0xa757('0x5'));var attributes=require(_0xa757('0x6'));var integrations=require(_0xa757('0x7'));module['exports']=function(_0xae0e7c,_0x4343b6){return _0xae0e7c['define'](_0xa757('0x8'),attributes,{'tableName':_0xa757('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/intDynamics365Account/intDynamics365Account.rpc.js b/server/api/intDynamics365Account/intDynamics365Account.rpc.js index 1547cff..aba430c 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 _0x5e35=['model','GetDynamics365Account','ShowDynamics365Account','find','stringify','lodash','util','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','request','then','Dynamics365Account,\x20%s,\x20%s','request\x20sent','debug','error','message','info','result','catch','Dynamics365Account','options','raw','attributes','include','map'];(function(_0x3fb2b6,_0x505be5){var _0x420547=function(_0x30d1d5){while(--_0x30d1d5){_0x3fb2b6['push'](_0x3fb2b6['shift']());}};_0x420547(++_0x505be5);}(_0x5e35,0x198));var _0x55e3=function(_0x565ed7,_0x398228){_0x565ed7=_0x565ed7-0x0;var _0x183ad7=_0x5e35[_0x565ed7];return _0x183ad7;};'use strict';var _=require(_0x55e3('0x0'));var util=require(_0x55e3('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0x55e3('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x55e3('0x3'))['db'];var utils=require(_0x55e3('0x4'));var logger=require(_0x55e3('0x5'))(_0x55e3('0x6'));var config=require(_0x55e3('0x7'));var jayson=require('jayson/promise');var client=jayson[_0x55e3('0x8')][_0x55e3('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x3304b0,_0x362366,_0x3bf238){return new BPromise(function(_0x10ba78,_0x5ef486){return client[_0x55e3('0xa')](_0x3304b0,_0x3bf238)[_0x55e3('0xb')](function(_0x474b47){logger['info'](_0x55e3('0xc'),_0x362366,_0x55e3('0xd'));logger[_0x55e3('0xe')]('Dynamics365Account,\x20%s,\x20%s,\x20%s',_0x362366,_0x55e3('0xd'),JSON['stringify'](_0x474b47));if(_0x474b47[_0x55e3('0xf')]){if(_0x474b47['error']['code']===0x1f4){logger['error'](_0x55e3('0xc'),_0x362366,_0x474b47[_0x55e3('0xf')][_0x55e3('0x10')]);return _0x5ef486(_0x474b47[_0x55e3('0xf')]['message']);}logger[_0x55e3('0xf')](_0x55e3('0xc'),_0x362366,_0x474b47[_0x55e3('0xf')]['message']);return _0x10ba78(_0x474b47['error'][_0x55e3('0x10')]);}else{logger[_0x55e3('0x11')](_0x55e3('0xc'),_0x362366,'request\x20sent');_0x10ba78(_0x474b47[_0x55e3('0x12')][_0x55e3('0x10')]);}})[_0x55e3('0x13')](function(_0x57985f){logger[_0x55e3('0xf')](_0x55e3('0xc'),_0x362366,_0x57985f);_0x5ef486(_0x57985f);});});}exports['GetDynamics365Account']=function(_0x463096){var _0x359b6b=this;return new Promise(function(_0xc5427d,_0x2a18f8){return db[_0x55e3('0x14')]['findAll']({'raw':_0x463096[_0x55e3('0x15')]?_0x463096[_0x55e3('0x15')][_0x55e3('0x16')]===undefined?!![]:![]:!![],'where':_0x463096[_0x55e3('0x15')]?_0x463096[_0x55e3('0x15')]['where']||null:null,'attributes':_0x463096['options']?_0x463096[_0x55e3('0x15')][_0x55e3('0x17')]||null:null,'limit':_0x463096['options']?_0x463096[_0x55e3('0x15')]['limit']||null:null,'include':_0x463096['options']?_0x463096[_0x55e3('0x15')][_0x55e3('0x18')]?_[_0x55e3('0x19')](_0x463096[_0x55e3('0x15')]['include'],function(_0xfa4df7){return{'model':db[_0xfa4df7['model']],'as':_0xfa4df7['as'],'attributes':_0xfa4df7[_0x55e3('0x17')],'include':_0xfa4df7[_0x55e3('0x18')]?_[_0x55e3('0x19')](_0xfa4df7[_0x55e3('0x18')],function(_0x2b9281){return{'model':db[_0x2b9281['model']],'as':_0x2b9281['as'],'attributes':_0x2b9281[_0x55e3('0x17')],'include':_0x2b9281[_0x55e3('0x18')]?_[_0x55e3('0x19')](_0x2b9281['include'],function(_0xed218f){return{'model':db[_0xed218f[_0x55e3('0x1a')]],'as':_0xed218f['as'],'attributes':_0xed218f[_0x55e3('0x17')]};}):[]};}):[]};}):[]:[]})[_0x55e3('0xb')](function(_0x1c92fa){logger[_0x55e3('0x11')](_0x55e3('0x1b'),_0x463096);logger['debug']('GetDynamics365Account',_0x463096,JSON['stringify'](_0x1c92fa));_0xc5427d(_0x1c92fa);})['catch'](function(_0x1b918e){logger[_0x55e3('0xf')](_0x55e3('0x1b'),_0x1b918e[_0x55e3('0x10')],_0x463096);_0x2a18f8(_0x359b6b[_0x55e3('0xf')](0x1f4,_0x1b918e[_0x55e3('0x10')]));});});};exports[_0x55e3('0x1c')]=function(_0x483b45){var _0x521364=this;return new Promise(function(_0x33c882,_0x530812){return db['Dynamics365Account'][_0x55e3('0x1d')]({'raw':_0x483b45[_0x55e3('0x15')]?_0x483b45[_0x55e3('0x15')]['raw']===undefined?!![]:![]:!![],'where':_0x483b45[_0x55e3('0x15')]?_0x483b45['options']['where']||null:null,'attributes':_0x483b45['options']?_0x483b45[_0x55e3('0x15')][_0x55e3('0x17')]||null:null,'include':_0x483b45[_0x55e3('0x15')]?_0x483b45[_0x55e3('0x15')][_0x55e3('0x18')]?_[_0x55e3('0x19')](_0x483b45['options'][_0x55e3('0x18')],function(_0x91d37d){return{'model':db[_0x91d37d[_0x55e3('0x1a')]],'as':_0x91d37d['as'],'attributes':_0x91d37d[_0x55e3('0x17')],'include':_0x91d37d[_0x55e3('0x18')]?_[_0x55e3('0x19')](_0x91d37d[_0x55e3('0x18')],function(_0x5760e5){return{'model':db[_0x5760e5[_0x55e3('0x1a')]],'as':_0x5760e5['as'],'attributes':_0x5760e5[_0x55e3('0x17')],'include':_0x5760e5[_0x55e3('0x18')]?_['map'](_0x5760e5['include'],function(_0x4fd922){return{'model':db[_0x4fd922[_0x55e3('0x1a')]],'as':_0x4fd922['as'],'attributes':_0x4fd922[_0x55e3('0x17')]};}):[]};}):[]};}):[]:[]})[_0x55e3('0xb')](function(_0xffee27){logger[_0x55e3('0x11')](_0x55e3('0x1c'),_0x483b45);logger['debug']('ShowDynamics365Account',_0x483b45,JSON[_0x55e3('0x1e')](_0xffee27));_0x33c882(_0xffee27);})[_0x55e3('0x13')](function(_0x53f60){logger[_0x55e3('0xf')](_0x55e3('0x1c'),_0x53f60['message'],_0x483b45);_0x530812(_0x521364[_0x55e3('0xf')](0x1f4,_0x53f60[_0x55e3('0x10')]));});});}; \ No newline at end of file +var _0x37fb=['code','message','result','catch','GetDynamics365Account','Dynamics365Account','findAll','options','raw','where','limit','include','map','attributes','model','then','debug','ShowDynamics365Account','lodash','util','moment','bluebird','randomstring','ioredis','../../config/logger','rpc','jayson/promise','client','request','info','Dynamics365Account,\x20%s,\x20%s','request\x20sent','Dynamics365Account,\x20%s,\x20%s,\x20%s','stringify','error'];(function(_0x27a384,_0x46d1aa){var _0x26c8fb=function(_0x1e09ea){while(--_0x1e09ea){_0x27a384['push'](_0x27a384['shift']());}};_0x26c8fb(++_0x46d1aa);}(_0x37fb,0x1d9));var _0xb37f=function(_0x1f0bea,_0x93433b){_0x1f0bea=_0x1f0bea-0x0;var _0xc1c2c=_0x37fb[_0x1f0bea];return _0xc1c2c;};'use strict';var _=require(_0xb37f('0x0'));var util=require(_0xb37f('0x1'));var moment=require(_0xb37f('0x2'));var BPromise=require(_0xb37f('0x3'));var rs=require(_0xb37f('0x4'));var fs=require('fs');var Redis=require(_0xb37f('0x5'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0xb37f('0x6'))(_0xb37f('0x7'));var config=require('../../config/environment');var jayson=require(_0xb37f('0x8'));var client=jayson[_0xb37f('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x24a1c1,_0x156a82,_0x5e79f5){return new BPromise(function(_0x2b3310,_0x5a83f0){return client[_0xb37f('0xa')](_0x24a1c1,_0x5e79f5)['then'](function(_0x3a8c97){logger[_0xb37f('0xb')](_0xb37f('0xc'),_0x156a82,_0xb37f('0xd'));logger['debug'](_0xb37f('0xe'),_0x156a82,_0xb37f('0xd'),JSON[_0xb37f('0xf')](_0x3a8c97));if(_0x3a8c97[_0xb37f('0x10')]){if(_0x3a8c97[_0xb37f('0x10')][_0xb37f('0x11')]===0x1f4){logger[_0xb37f('0x10')](_0xb37f('0xc'),_0x156a82,_0x3a8c97[_0xb37f('0x10')][_0xb37f('0x12')]);return _0x5a83f0(_0x3a8c97[_0xb37f('0x10')]['message']);}logger[_0xb37f('0x10')]('Dynamics365Account,\x20%s,\x20%s',_0x156a82,_0x3a8c97[_0xb37f('0x10')][_0xb37f('0x12')]);return _0x2b3310(_0x3a8c97[_0xb37f('0x10')][_0xb37f('0x12')]);}else{logger['info']('Dynamics365Account,\x20%s,\x20%s',_0x156a82,_0xb37f('0xd'));_0x2b3310(_0x3a8c97[_0xb37f('0x13')]['message']);}})[_0xb37f('0x14')](function(_0x2931da){logger[_0xb37f('0x10')]('Dynamics365Account,\x20%s,\x20%s',_0x156a82,_0x2931da);_0x5a83f0(_0x2931da);});});}exports[_0xb37f('0x15')]=function(_0x210eae){var _0x56c927=this;return new Promise(function(_0x4b6065,_0x48b69a){return db[_0xb37f('0x16')][_0xb37f('0x17')]({'raw':_0x210eae[_0xb37f('0x18')]?_0x210eae[_0xb37f('0x18')][_0xb37f('0x19')]===undefined?!![]:![]:!![],'where':_0x210eae[_0xb37f('0x18')]?_0x210eae['options'][_0xb37f('0x1a')]||null:null,'attributes':_0x210eae[_0xb37f('0x18')]?_0x210eae['options']['attributes']||null:null,'limit':_0x210eae[_0xb37f('0x18')]?_0x210eae[_0xb37f('0x18')][_0xb37f('0x1b')]||null:null,'include':_0x210eae[_0xb37f('0x18')]?_0x210eae[_0xb37f('0x18')][_0xb37f('0x1c')]?_[_0xb37f('0x1d')](_0x210eae[_0xb37f('0x18')][_0xb37f('0x1c')],function(_0xf409c1){return{'model':db[_0xf409c1['model']],'as':_0xf409c1['as'],'attributes':_0xf409c1[_0xb37f('0x1e')],'include':_0xf409c1[_0xb37f('0x1c')]?_[_0xb37f('0x1d')](_0xf409c1[_0xb37f('0x1c')],function(_0x40f1a4){return{'model':db[_0x40f1a4[_0xb37f('0x1f')]],'as':_0x40f1a4['as'],'attributes':_0x40f1a4[_0xb37f('0x1e')],'include':_0x40f1a4['include']?_['map'](_0x40f1a4[_0xb37f('0x1c')],function(_0x432077){return{'model':db[_0x432077[_0xb37f('0x1f')]],'as':_0x432077['as'],'attributes':_0x432077[_0xb37f('0x1e')]};}):[]};}):[]};}):[]:[]})[_0xb37f('0x20')](function(_0x2e0751){logger['info']('GetDynamics365Account',_0x210eae);logger[_0xb37f('0x21')]('GetDynamics365Account',_0x210eae,JSON[_0xb37f('0xf')](_0x2e0751));_0x4b6065(_0x2e0751);})['catch'](function(_0x7ccf20){logger[_0xb37f('0x10')](_0xb37f('0x15'),_0x7ccf20['message'],_0x210eae);_0x48b69a(_0x56c927[_0xb37f('0x10')](0x1f4,_0x7ccf20['message']));});});};exports[_0xb37f('0x22')]=function(_0x5c5024){var _0x1618cb=this;return new Promise(function(_0x43b457,_0x5642f8){return db['Dynamics365Account']['find']({'raw':_0x5c5024['options']?_0x5c5024[_0xb37f('0x18')][_0xb37f('0x19')]===undefined?!![]:![]:!![],'where':_0x5c5024[_0xb37f('0x18')]?_0x5c5024[_0xb37f('0x18')]['where']||null:null,'attributes':_0x5c5024[_0xb37f('0x18')]?_0x5c5024[_0xb37f('0x18')][_0xb37f('0x1e')]||null:null,'include':_0x5c5024[_0xb37f('0x18')]?_0x5c5024[_0xb37f('0x18')]['include']?_[_0xb37f('0x1d')](_0x5c5024[_0xb37f('0x18')][_0xb37f('0x1c')],function(_0x3c76df){return{'model':db[_0x3c76df[_0xb37f('0x1f')]],'as':_0x3c76df['as'],'attributes':_0x3c76df[_0xb37f('0x1e')],'include':_0x3c76df[_0xb37f('0x1c')]?_['map'](_0x3c76df[_0xb37f('0x1c')],function(_0x3cb5e1){return{'model':db[_0x3cb5e1[_0xb37f('0x1f')]],'as':_0x3cb5e1['as'],'attributes':_0x3cb5e1[_0xb37f('0x1e')],'include':_0x3cb5e1[_0xb37f('0x1c')]?_[_0xb37f('0x1d')](_0x3cb5e1[_0xb37f('0x1c')],function(_0x109b08){return{'model':db[_0x109b08[_0xb37f('0x1f')]],'as':_0x109b08['as'],'attributes':_0x109b08['attributes']};}):[]};}):[]};}):[]:[]})[_0xb37f('0x20')](function(_0x524dce){logger[_0xb37f('0xb')]('ShowDynamics365Account',_0x5c5024);logger[_0xb37f('0x21')]('ShowDynamics365Account',_0x5c5024,JSON[_0xb37f('0xf')](_0x524dce));_0x43b457(_0x524dce);})[_0xb37f('0x14')](function(_0x463245){logger[_0xb37f('0x10')](_0xb37f('0x22'),_0x463245[_0xb37f('0x12')],_0x5c5024);_0x5642f8(_0x1618cb[_0xb37f('0x10')](0x1f4,_0x463245[_0xb37f('0x12')]));});});}; \ No newline at end of file diff --git a/server/api/intDynamics365Configuration/index.js b/server/api/intDynamics365Configuration/index.js index ad5e8ae..70637b7 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 _0x10ff=['../../components/auth/service','../../components/interaction/service','../../config/environment','./intDynamics365Configuration.controller','get','isAuthenticated','index','/:id','/:id/fields','/:id/subjects','getSubjects','getDescriptions','post','create','update','delete','destroy','multer','connect-timeout','express','fs-extra'];(function(_0x5b5cde,_0x1f7c5f){var _0x364ad2=function(_0x4a1172){while(--_0x4a1172){_0x5b5cde['push'](_0x5b5cde['shift']());}};_0x364ad2(++_0x1f7c5f);}(_0x10ff,0x1b5));var _0xf10f=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0x10ff[_0x321bb2];return _0x9c12ed;};'use strict';var multer=require(_0xf10f('0x0'));var util=require('util');var path=require('path');var timeout=require(_0xf10f('0x1'));var express=require(_0xf10f('0x2'));var router=express['Router']();var fs_extra=require(_0xf10f('0x3'));var auth=require(_0xf10f('0x4'));var interaction=require(_0xf10f('0x5'));var config=require(_0xf10f('0x6'));var controller=require(_0xf10f('0x7'));router[_0xf10f('0x8')]('/',auth[_0xf10f('0x9')](),controller[_0xf10f('0xa')]);router[_0xf10f('0x8')](_0xf10f('0xb'),auth['isAuthenticated'](),controller['show']);router['get'](_0xf10f('0xc'),auth[_0xf10f('0x9')](),controller['getFields']);router[_0xf10f('0x8')](_0xf10f('0xd'),auth['isAuthenticated'](),controller[_0xf10f('0xe')]);router[_0xf10f('0x8')]('/:id/descriptions',auth[_0xf10f('0x9')](),controller[_0xf10f('0xf')]);router[_0xf10f('0x10')]('/',auth['isAuthenticated'](),controller[_0xf10f('0x11')]);router['put'](_0xf10f('0xb'),auth['isAuthenticated'](),controller[_0xf10f('0x12')]);router[_0xf10f('0x13')](_0xf10f('0xb'),auth[_0xf10f('0x9')](),controller[_0xf10f('0x14')]);module['exports']=router; \ No newline at end of file +var _0xa724=['connect-timeout','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./intDynamics365Configuration.controller','isAuthenticated','get','/:id','show','/:id/fields','getFields','/:id/subjects','getSubjects','/:id/descriptions','getDescriptions','post','create','put','destroy','exports','multer'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xa724,0xf1));var _0x4a72=function(_0x13159c,_0x329267){_0x13159c=_0x13159c-0x0;var _0x2ad79c=_0xa724[_0x13159c];return _0x2ad79c;};'use strict';var multer=require(_0x4a72('0x0'));var util=require('util');var path=require('path');var timeout=require(_0x4a72('0x1'));var express=require('express');var router=express[_0x4a72('0x2')]();var fs_extra=require('fs-extra');var auth=require(_0x4a72('0x3'));var interaction=require(_0x4a72('0x4'));var config=require(_0x4a72('0x5'));var controller=require(_0x4a72('0x6'));router['get']('/',auth[_0x4a72('0x7')](),controller['index']);router[_0x4a72('0x8')](_0x4a72('0x9'),auth[_0x4a72('0x7')](),controller[_0x4a72('0xa')]);router[_0x4a72('0x8')](_0x4a72('0xb'),auth[_0x4a72('0x7')](),controller[_0x4a72('0xc')]);router[_0x4a72('0x8')](_0x4a72('0xd'),auth[_0x4a72('0x7')](),controller[_0x4a72('0xe')]);router['get'](_0x4a72('0xf'),auth[_0x4a72('0x7')](),controller[_0x4a72('0x10')]);router[_0x4a72('0x11')]('/',auth['isAuthenticated'](),controller[_0x4a72('0x12')]);router[_0x4a72('0x13')](_0x4a72('0x9'),auth[_0x4a72('0x7')](),controller['update']);router['delete']('/:id',auth['isAuthenticated'](),controller[_0x4a72('0x14')]);module[_0x4a72('0x15')]=router; \ No newline at end of file diff --git a/server/api/intDynamics365Configuration/intDynamics365Configuration.attributes.js b/server/api/intDynamics365Configuration/intDynamics365Configuration.attributes.js index f4eaaf0..26f9391 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 _0x9e53=['STRING','ENUM','incident','phonecall','contact','nothing','sequelize','exports'];(function(_0x581d17,_0x951b0a){var _0x2014bb=function(_0x44fb08){while(--_0x44fb08){_0x581d17['push'](_0x581d17['shift']());}};_0x2014bb(++_0x951b0a);}(_0x9e53,0xc6));var _0x39e5=function(_0x580b15,_0x28afa4){_0x580b15=_0x580b15-0x0;var _0x1adb1b=_0x9e53[_0x580b15];return _0x1adb1b;};'use strict';var Sequelize=require(_0x39e5('0x0'));module[_0x39e5('0x1')]={'name':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0x39e5('0x2')]},'ticketType':{'type':Sequelize[_0x39e5('0x3')](_0x39e5('0x4'),_0x39e5('0x5')),'defaultValue':_0x39e5('0x4')},'moduleCreate':{'type':Sequelize['ENUM'](_0x39e5('0x6'),_0x39e5('0x7')),'defaultValue':_0x39e5('0x6'),'allowNull':![]},'additionalSearchContact':{'type':Sequelize[_0x39e5('0x2')],'allowNull':!![]},'openNewTab':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]}}; \ No newline at end of file +var _0xed4a=['sequelize','exports','STRING','ENUM','incident','phonecall','contact','nothing','BOOLEAN'];(function(_0x2b5513,_0x3fe5cd){var _0x578fd2=function(_0x7a9106){while(--_0x7a9106){_0x2b5513['push'](_0x2b5513['shift']());}};_0x578fd2(++_0x3fe5cd);}(_0xed4a,0x144));var _0xaed4=function(_0x1cd477,_0x42d4cd){_0x1cd477=_0x1cd477-0x0;var _0x3d9007=_0xed4a[_0x1cd477];return _0x3d9007;};'use strict';var Sequelize=require(_0xaed4('0x0'));module[_0xaed4('0x1')]={'name':{'type':Sequelize[_0xaed4('0x2')]},'description':{'type':Sequelize[_0xaed4('0x2')]},'ticketType':{'type':Sequelize[_0xaed4('0x3')](_0xaed4('0x4'),_0xaed4('0x5')),'defaultValue':'incident'},'moduleCreate':{'type':Sequelize[_0xaed4('0x3')](_0xaed4('0x6'),_0xaed4('0x7')),'defaultValue':'contact','allowNull':![]},'additionalSearchContact':{'type':Sequelize['STRING'],'allowNull':!![]},'openNewTab':{'type':Sequelize[_0xaed4('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 528820c..b729435 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 _0xa02e=['hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','Dynamics365Configuration','includeAll','include','findAll','rows','catch','show','params','keys','find','body','findOne','Dynamics365Field','length','getFields','getSubjects','getDescriptions','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','ejs','lodash','squel','jsforce','desk.js','to-csv','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','set','reject','save','update','then','destroy','error','stack','name','send','index','rawAttributes','fieldName','type','key','model','map','query','filters','intersection','fields','attributes'];(function(_0x885692,_0x2d01a0){var _0x5addcd=function(_0x4101a1){while(--_0x4101a1){_0x885692['push'](_0x885692['shift']());}};_0x5addcd(++_0x2d01a0);}(_0xa02e,0xbb));var _0xea02=function(_0x48ca5b,_0x1ad69e){_0x48ca5b=_0x48ca5b-0x0;var _0x354a06=_0xa02e[_0x48ca5b];return _0x354a06;};'use strict';var emlformat=require(_0xea02('0x0'));var rimraf=require(_0xea02('0x1'));var zipdir=require(_0xea02('0x2'));var jsonpatch=require(_0xea02('0x3'));var rp=require('request-promise');var moment=require(_0xea02('0x4'));var BPromise=require(_0xea02('0x5'));var Mustache=require('mustache');var util=require('util');var path=require('path');var sox=require('sox');var csv=require('to-csv');var ejs=require(_0xea02('0x6'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xea02('0x7'));var squel=require(_0xea02('0x8'));var crypto=require('crypto');var jsforce=require(_0xea02('0x9'));var deskjs=require(_0xea02('0xa'));var toCsv=require(_0xea02('0xb'));var querystring=require(_0xea02('0xc'));var Papa=require(_0xea02('0xd'));var Redis=require(_0xea02('0xe'));var authService=require(_0xea02('0xf'));var qs=require('../../components/parsers/qs');var as=require(_0xea02('0x10'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xea02('0x11'))(_0xea02('0x12'));var utils=require(_0xea02('0x13'));var config=require(_0xea02('0x14'));var licenseUtil=require(_0xea02('0x15'));var db=require(_0xea02('0x16'))['db'];function respondWithStatusCode(_0x2ddc0f,_0x26d1be){_0x26d1be=_0x26d1be||0xcc;return function(_0x4dc53f){if(_0x4dc53f){return _0x2ddc0f[_0xea02('0x17')](_0x26d1be);}return _0x2ddc0f[_0xea02('0x18')](_0x26d1be)[_0xea02('0x19')]();};}function respondWithResult(_0x2cf55d,_0x45af7f){_0x45af7f=_0x45af7f||0xc8;return function(_0x47dac1){if(_0x47dac1){return _0x2cf55d[_0xea02('0x18')](_0x45af7f)[_0xea02('0x1a')](_0x47dac1);}};}function respondWithFilteredResult(_0x6bb0cc,_0x4016eb){return function(_0x546f96){if(_0x546f96){var _0x4ececc=typeof _0x4016eb[_0xea02('0x1b')]===_0xea02('0x1c')&&typeof _0x4016eb[_0xea02('0x1d')]==='undefined';var _0xdaea33=_0x546f96[_0xea02('0x1e')];var _0x11fd31=_0x4ececc?0x0:_0x4016eb['offset'];var _0x1cfe6b=_0x4ececc?_0x546f96[_0xea02('0x1e')]:_0x4016eb[_0xea02('0x1b')]+_0x4016eb[_0xea02('0x1d')];var _0x23c901;if(_0x1cfe6b>=_0xdaea33){_0x1cfe6b=_0xdaea33;_0x23c901=0xc8;}else{_0x23c901=0xce;}_0x6bb0cc[_0xea02('0x18')](_0x23c901);return _0x6bb0cc[_0xea02('0x1f')]('Content-Range',_0x11fd31+'-'+_0x1cfe6b+'/'+_0xdaea33)[_0xea02('0x1a')](_0x546f96);}return null;};}function patchUpdates(_0x36cb0b){return function(_0x524887){try{jsonpatch['apply'](_0x524887,_0x36cb0b,!![]);}catch(_0x31ea0b){return BPromise[_0xea02('0x20')](_0x31ea0b);}return _0x524887[_0xea02('0x21')]();};}function saveUpdates(_0x1ea9ff,_0xa32a1b){return function(_0x26d78c){if(_0x26d78c){return _0x26d78c[_0xea02('0x22')](_0x1ea9ff)[_0xea02('0x23')](function(_0x2c97e3){return _0x2c97e3;});}return null;};}function removeEntity(_0x1e0a28,_0x43b67b){return function(_0x24afba){if(_0x24afba){return _0x24afba[_0xea02('0x24')]()[_0xea02('0x23')](function(){_0x1e0a28[_0xea02('0x18')](0xcc)[_0xea02('0x19')]();});}};}function handleEntityNotFound(_0x33d7ed,_0x1da770){return function(_0x2e895d){if(!_0x2e895d){_0x33d7ed['sendStatus'](0x194);}return _0x2e895d;};}function handleError(_0x4cd08d,_0x41fa7f){_0x41fa7f=_0x41fa7f||0x1f4;return function(_0x3834af){logger[_0xea02('0x25')](_0x3834af[_0xea02('0x26')]);if(_0x3834af[_0xea02('0x27')]){delete _0x3834af['name'];}_0x4cd08d[_0xea02('0x18')](_0x41fa7f)[_0xea02('0x28')](_0x3834af);};}exports[_0xea02('0x29')]=function(_0x16952f,_0x29553a){var _0x1b1c1b={},_0x4d1efe={},_0x172424={'count':0x0,'rows':[]};var _0x32c73f=_['map'](db['Dynamics365Configuration'][_0xea02('0x2a')],function(_0x3e2271){return{'name':_0x3e2271[_0xea02('0x2b')],'type':_0x3e2271[_0xea02('0x2c')][_0xea02('0x2d')]};});_0x4d1efe[_0xea02('0x2e')]=_[_0xea02('0x2f')](_0x32c73f,_0xea02('0x27'));_0x4d1efe[_0xea02('0x30')]=_['keys'](_0x16952f[_0xea02('0x30')]);_0x4d1efe[_0xea02('0x31')]=_[_0xea02('0x32')](_0x4d1efe[_0xea02('0x2e')],_0x4d1efe[_0xea02('0x30')]);_0x1b1c1b['attributes']=_[_0xea02('0x32')](_0x4d1efe[_0xea02('0x2e')],qs[_0xea02('0x33')](_0x16952f[_0xea02('0x30')][_0xea02('0x33')]));_0x1b1c1b[_0xea02('0x34')]=_0x1b1c1b[_0xea02('0x34')]['length']?_0x1b1c1b[_0xea02('0x34')]:_0x4d1efe[_0xea02('0x2e')];if(!_0x16952f[_0xea02('0x30')][_0xea02('0x35')](_0xea02('0x36'))){_0x1b1c1b['limit']=qs[_0xea02('0x1d')](_0x16952f['query'][_0xea02('0x1d')]);_0x1b1c1b[_0xea02('0x1b')]=qs['offset'](_0x16952f[_0xea02('0x30')]['offset']);}_0x1b1c1b[_0xea02('0x37')]=qs[_0xea02('0x38')](_0x16952f['query'][_0xea02('0x38')]);_0x1b1c1b[_0xea02('0x39')]=qs[_0xea02('0x31')](_[_0xea02('0x3a')](_0x16952f['query'],_0x4d1efe[_0xea02('0x31')]),_0x32c73f);if(_0x16952f[_0xea02('0x30')][_0xea02('0x3b')]){_0x1b1c1b[_0xea02('0x39')]=_[_0xea02('0x3c')](_0x1b1c1b[_0xea02('0x39')],{'$or':_['map'](_0x32c73f,function(_0x385b91){if(_0x385b91['type']!==_0xea02('0x3d')){var _0x39d1e9={};_0x39d1e9[_0x385b91['name']]={'$like':'%'+_0x16952f[_0xea02('0x30')][_0xea02('0x3b')]+'%'};return _0x39d1e9;}})});}_0x1b1c1b=_[_0xea02('0x3c')]({},_0x1b1c1b,_0x16952f[_0xea02('0x3e')]);var _0x41635b={'where':_0x1b1c1b[_0xea02('0x39')]};return db[_0xea02('0x3f')]['count'](_0x41635b)[_0xea02('0x23')](function(_0xc42dff){_0x172424[_0xea02('0x1e')]=_0xc42dff;if(_0x16952f[_0xea02('0x30')][_0xea02('0x40')]){_0x1b1c1b[_0xea02('0x41')]=[{'all':!![]}];}return db[_0xea02('0x3f')][_0xea02('0x42')](_0x1b1c1b);})['then'](function(_0x53bba9){_0x172424[_0xea02('0x43')]=_0x53bba9;return _0x172424;})[_0xea02('0x23')](respondWithFilteredResult(_0x29553a,_0x1b1c1b))[_0xea02('0x44')](handleError(_0x29553a,null));};exports[_0xea02('0x45')]=function(_0x5a1829,_0x4e9598){var _0x136ba1={'raw':![],'where':{'id':_0x5a1829[_0xea02('0x46')]['id']}},_0x3803d7={};_0x3803d7[_0xea02('0x2e')]=_[_0xea02('0x47')](db[_0xea02('0x3f')][_0xea02('0x2a')]);_0x3803d7[_0xea02('0x30')]=_['keys'](_0x5a1829[_0xea02('0x30')]);_0x3803d7[_0xea02('0x31')]=_[_0xea02('0x32')](_0x3803d7[_0xea02('0x2e')],_0x3803d7[_0xea02('0x30')]);_0x136ba1[_0xea02('0x34')]=_[_0xea02('0x32')](_0x3803d7[_0xea02('0x2e')],qs[_0xea02('0x33')](_0x5a1829['query']['fields']));_0x136ba1[_0xea02('0x34')]=_0x136ba1[_0xea02('0x34')]['length']?_0x136ba1[_0xea02('0x34')]:_0x3803d7['model'];if(_0x5a1829[_0xea02('0x30')][_0xea02('0x40')]){_0x136ba1[_0xea02('0x41')]=[{'all':!![]}];}_0x136ba1=_['merge']({},_0x136ba1,_0x5a1829[_0xea02('0x3e')]);return db[_0xea02('0x3f')][_0xea02('0x48')](_0x136ba1)[_0xea02('0x23')](handleEntityNotFound(_0x4e9598,null))[_0xea02('0x23')](respondWithResult(_0x4e9598,null))[_0xea02('0x44')](handleError(_0x4e9598,null));};exports['create']=function(_0x4bc510,_0x4713a2){return db[_0xea02('0x3f')]['create'](_0x4bc510[_0xea02('0x49')],{})[_0xea02('0x23')](respondWithResult(_0x4713a2,0xc9))['catch'](handleError(_0x4713a2,null));};exports[_0xea02('0x22')]=function(_0x4fcd7b,_0x2be6f0){if(_0x4fcd7b[_0xea02('0x49')]['id']){delete _0x4fcd7b['body']['id'];}return db[_0xea02('0x3f')]['find']({'where':{'id':_0x4fcd7b[_0xea02('0x46')]['id']}})[_0xea02('0x23')](handleEntityNotFound(_0x2be6f0,null))['then'](saveUpdates(_0x4fcd7b[_0xea02('0x49')],null))['then'](respondWithResult(_0x2be6f0,null))[_0xea02('0x44')](handleError(_0x2be6f0,null));};exports[_0xea02('0x24')]=function(_0x25c4a9,_0x232c3c){return db[_0xea02('0x3f')][_0xea02('0x48')]({'where':{'id':_0x25c4a9[_0xea02('0x46')]['id']}})[_0xea02('0x23')](handleEntityNotFound(_0x232c3c,null))[_0xea02('0x23')](removeEntity(_0x232c3c,null))[_0xea02('0x44')](handleError(_0x232c3c,null));};exports['getFields']=function(_0x2ea3e6,_0x5a72e3,_0x1a0585){var _0x2cd9d6={};var _0x27293c={};var _0x432931;var _0xfb0c0;return db[_0xea02('0x3f')][_0xea02('0x4a')]({'where':{'id':_0x2ea3e6[_0xea02('0x46')]['id']}})[_0xea02('0x23')](handleEntityNotFound(_0x5a72e3,null))['then'](function(_0x4e5e0c){if(_0x4e5e0c){_0x432931=_0x4e5e0c;_0x27293c['model']=_[_0xea02('0x47')](db[_0xea02('0x4b')]['rawAttributes']);_0x27293c[_0xea02('0x30')]=_[_0xea02('0x47')](_0x2ea3e6[_0xea02('0x30')]);_0x27293c[_0xea02('0x31')]=_[_0xea02('0x32')](_0x27293c[_0xea02('0x2e')],_0x27293c[_0xea02('0x30')]);_0x2cd9d6[_0xea02('0x34')]=_['intersection'](_0x27293c['model'],qs[_0xea02('0x33')](_0x2ea3e6['query'][_0xea02('0x33')]));_0x2cd9d6[_0xea02('0x34')]=_0x2cd9d6[_0xea02('0x34')][_0xea02('0x4c')]?_0x2cd9d6[_0xea02('0x34')]:_0x27293c['model'];_0x2cd9d6[_0xea02('0x37')]=qs['sort'](_0x2ea3e6[_0xea02('0x30')][_0xea02('0x38')]);_0x2cd9d6[_0xea02('0x39')]=qs[_0xea02('0x31')](_[_0xea02('0x3a')](_0x2ea3e6[_0xea02('0x30')],_0x27293c[_0xea02('0x31')]));if(_0x2ea3e6[_0xea02('0x30')][_0xea02('0x3b')]){_0x2cd9d6['where']=_[_0xea02('0x3c')](_0x2cd9d6['where'],{'$or':_['map'](_0x2cd9d6[_0xea02('0x34')],function(_0x56c64c){var _0x43bb58={};_0x43bb58[_0x56c64c]={'$like':'%'+_0x2ea3e6[_0xea02('0x30')]['filter']+'%'};return _0x43bb58;})});}_0x2cd9d6=_[_0xea02('0x3c')]({},_0x2cd9d6,_0x2ea3e6[_0xea02('0x3e')]);return _0x432931[_0xea02('0x4d')](_0x2cd9d6);}})['then'](function(_0x50cd33){if(_0x50cd33){_0xfb0c0=_0x50cd33[_0xea02('0x4c')];if(!_0x2ea3e6[_0xea02('0x30')][_0xea02('0x35')](_0xea02('0x36'))){_0x2cd9d6[_0xea02('0x1d')]=qs[_0xea02('0x1d')](_0x2ea3e6['query']['limit']);_0x2cd9d6[_0xea02('0x1b')]=qs['offset'](_0x2ea3e6[_0xea02('0x30')][_0xea02('0x1b')]);}return _0x432931['getFields'](_0x2cd9d6);}})[_0xea02('0x23')](function(_0xf0e3fa){if(_0xf0e3fa){return _0xf0e3fa?{'count':_0xfb0c0,'rows':_0xf0e3fa}:null;}})[_0xea02('0x23')](respondWithResult(_0x5a72e3,null))['catch'](handleError(_0x5a72e3,null));};exports[_0xea02('0x4e')]=function(_0x3cf245,_0x45b1ee,_0x1f6605){var _0x4d2d07={};var _0x1fd794={};var _0x19118b;var _0x138f5e;return db['Dynamics365Configuration'][_0xea02('0x4a')]({'where':{'id':_0x3cf245[_0xea02('0x46')]['id']}})[_0xea02('0x23')](handleEntityNotFound(_0x45b1ee,null))['then'](function(_0x54b2e2){if(_0x54b2e2){_0x19118b=_0x54b2e2;_0x1fd794['model']=_['keys'](db['Dynamics365Field'][_0xea02('0x2a')]);_0x1fd794[_0xea02('0x30')]=_[_0xea02('0x47')](_0x3cf245[_0xea02('0x30')]);_0x1fd794[_0xea02('0x31')]=_[_0xea02('0x32')](_0x1fd794[_0xea02('0x2e')],_0x1fd794[_0xea02('0x30')]);_0x4d2d07[_0xea02('0x34')]=_[_0xea02('0x32')](_0x1fd794[_0xea02('0x2e')],qs[_0xea02('0x33')](_0x3cf245['query'][_0xea02('0x33')]));_0x4d2d07[_0xea02('0x34')]=_0x4d2d07['attributes'][_0xea02('0x4c')]?_0x4d2d07[_0xea02('0x34')]:_0x1fd794[_0xea02('0x2e')];_0x4d2d07[_0xea02('0x37')]=qs[_0xea02('0x38')](_0x3cf245[_0xea02('0x30')][_0xea02('0x38')]);_0x4d2d07[_0xea02('0x39')]=qs[_0xea02('0x31')](_[_0xea02('0x3a')](_0x3cf245[_0xea02('0x30')],_0x1fd794[_0xea02('0x31')]));if(_0x3cf245[_0xea02('0x30')][_0xea02('0x3b')]){_0x4d2d07[_0xea02('0x39')]=_[_0xea02('0x3c')](_0x4d2d07[_0xea02('0x39')],{'$or':_[_0xea02('0x2f')](_0x4d2d07[_0xea02('0x34')],function(_0xbb58a7){var _0x55bf3d={};_0x55bf3d[_0xbb58a7]={'$like':'%'+_0x3cf245[_0xea02('0x30')][_0xea02('0x3b')]+'%'};return _0x55bf3d;})});}_0x4d2d07=_[_0xea02('0x3c')]({},_0x4d2d07,_0x3cf245[_0xea02('0x3e')]);return _0x19118b[_0xea02('0x4e')](_0x4d2d07);}})[_0xea02('0x23')](function(_0x2e11d9){if(_0x2e11d9){_0x138f5e=_0x2e11d9[_0xea02('0x4c')];if(!_0x3cf245[_0xea02('0x30')][_0xea02('0x35')]('nolimit')){_0x4d2d07[_0xea02('0x1d')]=qs[_0xea02('0x1d')](_0x3cf245[_0xea02('0x30')]['limit']);_0x4d2d07[_0xea02('0x1b')]=qs[_0xea02('0x1b')](_0x3cf245[_0xea02('0x30')][_0xea02('0x1b')]);}return _0x19118b[_0xea02('0x4e')](_0x4d2d07);}})[_0xea02('0x23')](function(_0x5d80e6){if(_0x5d80e6){return _0x5d80e6?{'count':_0x138f5e,'rows':_0x5d80e6}:null;}})[_0xea02('0x23')](respondWithResult(_0x45b1ee,null))[_0xea02('0x44')](handleError(_0x45b1ee,null));};exports[_0xea02('0x4f')]=function(_0x4664a2,_0x58aa2d,_0x2db504){var _0x55a1a9={};var _0x3ff6a3={};var _0x1abbc7;var _0x268e41;return db[_0xea02('0x3f')][_0xea02('0x4a')]({'where':{'id':_0x4664a2[_0xea02('0x46')]['id']}})[_0xea02('0x23')](handleEntityNotFound(_0x58aa2d,null))['then'](function(_0x1a6283){if(_0x1a6283){_0x1abbc7=_0x1a6283;_0x3ff6a3[_0xea02('0x2e')]=_[_0xea02('0x47')](db[_0xea02('0x4b')][_0xea02('0x2a')]);_0x3ff6a3['query']=_[_0xea02('0x47')](_0x4664a2[_0xea02('0x30')]);_0x3ff6a3[_0xea02('0x31')]=_[_0xea02('0x32')](_0x3ff6a3['model'],_0x3ff6a3[_0xea02('0x30')]);_0x55a1a9[_0xea02('0x34')]=_[_0xea02('0x32')](_0x3ff6a3[_0xea02('0x2e')],qs['fields'](_0x4664a2[_0xea02('0x30')][_0xea02('0x33')]));_0x55a1a9['attributes']=_0x55a1a9[_0xea02('0x34')][_0xea02('0x4c')]?_0x55a1a9['attributes']:_0x3ff6a3[_0xea02('0x2e')];_0x55a1a9[_0xea02('0x37')]=qs['sort'](_0x4664a2[_0xea02('0x30')][_0xea02('0x38')]);_0x55a1a9['where']=qs['filters'](_[_0xea02('0x3a')](_0x4664a2[_0xea02('0x30')],_0x3ff6a3[_0xea02('0x31')]));if(_0x4664a2[_0xea02('0x30')][_0xea02('0x3b')]){_0x55a1a9[_0xea02('0x39')]=_[_0xea02('0x3c')](_0x55a1a9[_0xea02('0x39')],{'$or':_[_0xea02('0x2f')](_0x55a1a9[_0xea02('0x34')],function(_0xcac17f){var _0x2f7958={};_0x2f7958[_0xcac17f]={'$like':'%'+_0x4664a2[_0xea02('0x30')][_0xea02('0x3b')]+'%'};return _0x2f7958;})});}_0x55a1a9=_[_0xea02('0x3c')]({},_0x55a1a9,_0x4664a2[_0xea02('0x3e')]);return _0x1abbc7[_0xea02('0x4f')](_0x55a1a9);}})[_0xea02('0x23')](function(_0x3ccc65){if(_0x3ccc65){_0x268e41=_0x3ccc65['length'];if(!_0x4664a2['query']['hasOwnProperty'](_0xea02('0x36'))){_0x55a1a9[_0xea02('0x1d')]=qs['limit'](_0x4664a2[_0xea02('0x30')]['limit']);_0x55a1a9[_0xea02('0x1b')]=qs['offset'](_0x4664a2[_0xea02('0x30')][_0xea02('0x1b')]);}return _0x1abbc7[_0xea02('0x4f')](_0x55a1a9);}})['then'](function(_0x287b99){if(_0x287b99){return _0x287b99?{'count':_0x268e41,'rows':_0x287b99}:null;}})[_0xea02('0x23')](respondWithResult(_0x58aa2d,null))[_0xea02('0x44')](handleError(_0x58aa2d,null));}; \ No newline at end of file +var _0x4302=['save','update','then','destroy','error','stack','name','send','index','map','rawAttributes','fieldName','type','query','filters','intersection','model','fields','attributes','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','Dynamics365Configuration','includeAll','findAll','show','params','keys','length','include','create','body','catch','find','getFields','findOne','Dynamics365Field','getSubjects','getDescriptions','eml-format','rimraf','fast-json-patch','moment','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','sendStatus','status','end','offset','undefined','count','limit','set','Content-Range','json','apply','reject'];(function(_0x1f763f,_0x4410b0){var _0x5816a=function(_0x198b89){while(--_0x198b89){_0x1f763f['push'](_0x1f763f['shift']());}};_0x5816a(++_0x4410b0);}(_0x4302,0x17a));var _0x2430=function(_0x465028,_0x4570ac){_0x465028=_0x465028-0x0;var _0xb783d4=_0x4302[_0x465028];return _0xb783d4;};'use strict';var emlformat=require(_0x2430('0x0'));var rimraf=require(_0x2430('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x2430('0x2'));var rp=require('request-promise');var moment=require(_0x2430('0x3'));var BPromise=require('bluebird');var Mustache=require(_0x2430('0x4'));var util=require(_0x2430('0x5'));var path=require(_0x2430('0x6'));var sox=require(_0x2430('0x7'));var csv=require(_0x2430('0x8'));var ejs=require(_0x2430('0x9'));var fs=require('fs');var fs_extra=require(_0x2430('0xa'));var _=require(_0x2430('0xb'));var squel=require('squel');var crypto=require(_0x2430('0xc'));var jsforce=require(_0x2430('0xd'));var deskjs=require(_0x2430('0xe'));var toCsv=require('to-csv');var querystring=require(_0x2430('0xf'));var Papa=require(_0x2430('0x10'));var Redis=require(_0x2430('0x11'));var authService=require(_0x2430('0x12'));var qs=require('../../components/parsers/qs');var as=require(_0x2430('0x13'));var hardwareService=require(_0x2430('0x14'));var logger=require(_0x2430('0x15'))(_0x2430('0x16'));var utils=require(_0x2430('0x17'));var config=require(_0x2430('0x18'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x4fcdd6,_0x17ec10){_0x17ec10=_0x17ec10||0xcc;return function(_0x125a52){if(_0x125a52){return _0x4fcdd6[_0x2430('0x19')](_0x17ec10);}return _0x4fcdd6[_0x2430('0x1a')](_0x17ec10)[_0x2430('0x1b')]();};}function respondWithResult(_0x5dcc52,_0x2cf9ef){_0x2cf9ef=_0x2cf9ef||0xc8;return function(_0x23980c){if(_0x23980c){return _0x5dcc52['status'](_0x2cf9ef)['json'](_0x23980c);}};}function respondWithFilteredResult(_0x2ca42b,_0x2a3b97){return function(_0x26b58b){if(_0x26b58b){var _0xfb0d4f=typeof _0x2a3b97[_0x2430('0x1c')]==='undefined'&&typeof _0x2a3b97['limit']===_0x2430('0x1d');var _0x88af89=_0x26b58b[_0x2430('0x1e')];var _0x21df44=_0xfb0d4f?0x0:_0x2a3b97[_0x2430('0x1c')];var _0xa535d9=_0xfb0d4f?_0x26b58b['count']:_0x2a3b97['offset']+_0x2a3b97[_0x2430('0x1f')];var _0x2e983a;if(_0xa535d9>=_0x88af89){_0xa535d9=_0x88af89;_0x2e983a=0xc8;}else{_0x2e983a=0xce;}_0x2ca42b[_0x2430('0x1a')](_0x2e983a);return _0x2ca42b[_0x2430('0x20')](_0x2430('0x21'),_0x21df44+'-'+_0xa535d9+'/'+_0x88af89)[_0x2430('0x22')](_0x26b58b);}return null;};}function patchUpdates(_0x37cbed){return function(_0x581886){try{jsonpatch[_0x2430('0x23')](_0x581886,_0x37cbed,!![]);}catch(_0x526017){return BPromise[_0x2430('0x24')](_0x526017);}return _0x581886[_0x2430('0x25')]();};}function saveUpdates(_0x15a6d1,_0x5c9cb2){return function(_0x533c40){if(_0x533c40){return _0x533c40[_0x2430('0x26')](_0x15a6d1)[_0x2430('0x27')](function(_0x11cc92){return _0x11cc92;});}return null;};}function removeEntity(_0x197583,_0x5e7589){return function(_0x1d7712){if(_0x1d7712){return _0x1d7712[_0x2430('0x28')]()[_0x2430('0x27')](function(){_0x197583[_0x2430('0x1a')](0xcc)[_0x2430('0x1b')]();});}};}function handleEntityNotFound(_0x5ff3f0,_0x4438bb){return function(_0x4f9094){if(!_0x4f9094){_0x5ff3f0[_0x2430('0x19')](0x194);}return _0x4f9094;};}function handleError(_0x27284a,_0x56f291){_0x56f291=_0x56f291||0x1f4;return function(_0x151f57){logger[_0x2430('0x29')](_0x151f57[_0x2430('0x2a')]);if(_0x151f57[_0x2430('0x2b')]){delete _0x151f57[_0x2430('0x2b')];}_0x27284a['status'](_0x56f291)[_0x2430('0x2c')](_0x151f57);};}exports[_0x2430('0x2d')]=function(_0x169d04,_0x250b54){var _0x49f38e={},_0x42c737={},_0x2bee52={'count':0x0,'rows':[]};var _0xd310ce=_[_0x2430('0x2e')](db['Dynamics365Configuration'][_0x2430('0x2f')],function(_0x3a60c7){return{'name':_0x3a60c7[_0x2430('0x30')],'type':_0x3a60c7[_0x2430('0x31')]['key']};});_0x42c737['model']=_[_0x2430('0x2e')](_0xd310ce,_0x2430('0x2b'));_0x42c737[_0x2430('0x32')]=_['keys'](_0x169d04[_0x2430('0x32')]);_0x42c737[_0x2430('0x33')]=_[_0x2430('0x34')](_0x42c737[_0x2430('0x35')],_0x42c737[_0x2430('0x32')]);_0x49f38e['attributes']=_['intersection'](_0x42c737[_0x2430('0x35')],qs[_0x2430('0x36')](_0x169d04[_0x2430('0x32')]['fields']));_0x49f38e[_0x2430('0x37')]=_0x49f38e[_0x2430('0x37')]['length']?_0x49f38e['attributes']:_0x42c737[_0x2430('0x35')];if(!_0x169d04['query'][_0x2430('0x38')](_0x2430('0x39'))){_0x49f38e[_0x2430('0x1f')]=qs[_0x2430('0x1f')](_0x169d04['query'][_0x2430('0x1f')]);_0x49f38e['offset']=qs[_0x2430('0x1c')](_0x169d04['query'][_0x2430('0x1c')]);}_0x49f38e[_0x2430('0x3a')]=qs['sort'](_0x169d04[_0x2430('0x32')][_0x2430('0x3b')]);_0x49f38e[_0x2430('0x3c')]=qs[_0x2430('0x33')](_[_0x2430('0x3d')](_0x169d04['query'],_0x42c737[_0x2430('0x33')]),_0xd310ce);if(_0x169d04[_0x2430('0x32')][_0x2430('0x3e')]){_0x49f38e[_0x2430('0x3c')]=_[_0x2430('0x3f')](_0x49f38e[_0x2430('0x3c')],{'$or':_['map'](_0xd310ce,function(_0xc01c94){if(_0xc01c94['type']!==_0x2430('0x40')){var _0x2cad72={};_0x2cad72[_0xc01c94['name']]={'$like':'%'+_0x169d04['query'][_0x2430('0x3e')]+'%'};return _0x2cad72;}})});}_0x49f38e=_[_0x2430('0x3f')]({},_0x49f38e,_0x169d04[_0x2430('0x41')]);var _0x121e2b={'where':_0x49f38e[_0x2430('0x3c')]};return db[_0x2430('0x42')]['count'](_0x121e2b)['then'](function(_0x403dca){_0x2bee52['count']=_0x403dca;if(_0x169d04[_0x2430('0x32')][_0x2430('0x43')]){_0x49f38e['include']=[{'all':!![]}];}return db[_0x2430('0x42')][_0x2430('0x44')](_0x49f38e);})['then'](function(_0x2b253e){_0x2bee52['rows']=_0x2b253e;return _0x2bee52;})['then'](respondWithFilteredResult(_0x250b54,_0x49f38e))['catch'](handleError(_0x250b54,null));};exports[_0x2430('0x45')]=function(_0x2e527d,_0x30f246){var _0x4605c8={'raw':![],'where':{'id':_0x2e527d[_0x2430('0x46')]['id']}},_0x3963cb={};_0x3963cb[_0x2430('0x35')]=_[_0x2430('0x47')](db[_0x2430('0x42')][_0x2430('0x2f')]);_0x3963cb[_0x2430('0x32')]=_[_0x2430('0x47')](_0x2e527d[_0x2430('0x32')]);_0x3963cb['filters']=_[_0x2430('0x34')](_0x3963cb[_0x2430('0x35')],_0x3963cb[_0x2430('0x32')]);_0x4605c8['attributes']=_[_0x2430('0x34')](_0x3963cb['model'],qs[_0x2430('0x36')](_0x2e527d[_0x2430('0x32')]['fields']));_0x4605c8[_0x2430('0x37')]=_0x4605c8[_0x2430('0x37')][_0x2430('0x48')]?_0x4605c8[_0x2430('0x37')]:_0x3963cb[_0x2430('0x35')];if(_0x2e527d[_0x2430('0x32')][_0x2430('0x43')]){_0x4605c8[_0x2430('0x49')]=[{'all':!![]}];}_0x4605c8=_[_0x2430('0x3f')]({},_0x4605c8,_0x2e527d[_0x2430('0x41')]);return db[_0x2430('0x42')]['find'](_0x4605c8)[_0x2430('0x27')](handleEntityNotFound(_0x30f246,null))[_0x2430('0x27')](respondWithResult(_0x30f246,null))['catch'](handleError(_0x30f246,null));};exports[_0x2430('0x4a')]=function(_0x383fd4,_0x39443c){return db[_0x2430('0x42')][_0x2430('0x4a')](_0x383fd4[_0x2430('0x4b')],{})[_0x2430('0x27')](respondWithResult(_0x39443c,0xc9))[_0x2430('0x4c')](handleError(_0x39443c,null));};exports[_0x2430('0x26')]=function(_0x6167cd,_0x4b5eb4){if(_0x6167cd[_0x2430('0x4b')]['id']){delete _0x6167cd[_0x2430('0x4b')]['id'];}return db[_0x2430('0x42')][_0x2430('0x4d')]({'where':{'id':_0x6167cd[_0x2430('0x46')]['id']}})['then'](handleEntityNotFound(_0x4b5eb4,null))[_0x2430('0x27')](saveUpdates(_0x6167cd[_0x2430('0x4b')],null))[_0x2430('0x27')](respondWithResult(_0x4b5eb4,null))[_0x2430('0x4c')](handleError(_0x4b5eb4,null));};exports['destroy']=function(_0x288b7b,_0x5df319){return db[_0x2430('0x42')][_0x2430('0x4d')]({'where':{'id':_0x288b7b[_0x2430('0x46')]['id']}})[_0x2430('0x27')](handleEntityNotFound(_0x5df319,null))['then'](removeEntity(_0x5df319,null))[_0x2430('0x4c')](handleError(_0x5df319,null));};exports[_0x2430('0x4e')]=function(_0x1e2750,_0x7b11a1,_0x59a4d6){var _0xf747d6={};var _0x34150a={};var _0x1d449f;var _0x2b01d2;return db['Dynamics365Configuration'][_0x2430('0x4f')]({'where':{'id':_0x1e2750[_0x2430('0x46')]['id']}})[_0x2430('0x27')](handleEntityNotFound(_0x7b11a1,null))[_0x2430('0x27')](function(_0x2ca97e){if(_0x2ca97e){_0x1d449f=_0x2ca97e;_0x34150a[_0x2430('0x35')]=_[_0x2430('0x47')](db[_0x2430('0x50')][_0x2430('0x2f')]);_0x34150a['query']=_[_0x2430('0x47')](_0x1e2750[_0x2430('0x32')]);_0x34150a[_0x2430('0x33')]=_[_0x2430('0x34')](_0x34150a['model'],_0x34150a[_0x2430('0x32')]);_0xf747d6['attributes']=_[_0x2430('0x34')](_0x34150a[_0x2430('0x35')],qs[_0x2430('0x36')](_0x1e2750[_0x2430('0x32')][_0x2430('0x36')]));_0xf747d6[_0x2430('0x37')]=_0xf747d6[_0x2430('0x37')][_0x2430('0x48')]?_0xf747d6[_0x2430('0x37')]:_0x34150a[_0x2430('0x35')];_0xf747d6[_0x2430('0x3a')]=qs[_0x2430('0x3b')](_0x1e2750[_0x2430('0x32')]['sort']);_0xf747d6[_0x2430('0x3c')]=qs[_0x2430('0x33')](_[_0x2430('0x3d')](_0x1e2750[_0x2430('0x32')],_0x34150a[_0x2430('0x33')]));if(_0x1e2750[_0x2430('0x32')]['filter']){_0xf747d6[_0x2430('0x3c')]=_[_0x2430('0x3f')](_0xf747d6[_0x2430('0x3c')],{'$or':_[_0x2430('0x2e')](_0xf747d6[_0x2430('0x37')],function(_0x42dc0a){var _0x1b115b={};_0x1b115b[_0x42dc0a]={'$like':'%'+_0x1e2750[_0x2430('0x32')][_0x2430('0x3e')]+'%'};return _0x1b115b;})});}_0xf747d6=_[_0x2430('0x3f')]({},_0xf747d6,_0x1e2750[_0x2430('0x41')]);return _0x1d449f[_0x2430('0x4e')](_0xf747d6);}})[_0x2430('0x27')](function(_0x496321){if(_0x496321){_0x2b01d2=_0x496321[_0x2430('0x48')];if(!_0x1e2750[_0x2430('0x32')][_0x2430('0x38')](_0x2430('0x39'))){_0xf747d6['limit']=qs['limit'](_0x1e2750['query'][_0x2430('0x1f')]);_0xf747d6[_0x2430('0x1c')]=qs[_0x2430('0x1c')](_0x1e2750[_0x2430('0x32')]['offset']);}return _0x1d449f[_0x2430('0x4e')](_0xf747d6);}})[_0x2430('0x27')](function(_0x3bc500){if(_0x3bc500){return _0x3bc500?{'count':_0x2b01d2,'rows':_0x3bc500}:null;}})[_0x2430('0x27')](respondWithResult(_0x7b11a1,null))[_0x2430('0x4c')](handleError(_0x7b11a1,null));};exports[_0x2430('0x51')]=function(_0x1b475d,_0x5514ec,_0x4be54c){var _0x2cd99b={};var _0x3591bf={};var _0x2a3ba1;var _0xf6d5a9;return db['Dynamics365Configuration'][_0x2430('0x4f')]({'where':{'id':_0x1b475d[_0x2430('0x46')]['id']}})[_0x2430('0x27')](handleEntityNotFound(_0x5514ec,null))[_0x2430('0x27')](function(_0x43e60e){if(_0x43e60e){_0x2a3ba1=_0x43e60e;_0x3591bf[_0x2430('0x35')]=_[_0x2430('0x47')](db[_0x2430('0x50')][_0x2430('0x2f')]);_0x3591bf['query']=_[_0x2430('0x47')](_0x1b475d[_0x2430('0x32')]);_0x3591bf[_0x2430('0x33')]=_['intersection'](_0x3591bf[_0x2430('0x35')],_0x3591bf[_0x2430('0x32')]);_0x2cd99b[_0x2430('0x37')]=_[_0x2430('0x34')](_0x3591bf[_0x2430('0x35')],qs[_0x2430('0x36')](_0x1b475d[_0x2430('0x32')][_0x2430('0x36')]));_0x2cd99b['attributes']=_0x2cd99b[_0x2430('0x37')][_0x2430('0x48')]?_0x2cd99b[_0x2430('0x37')]:_0x3591bf[_0x2430('0x35')];_0x2cd99b[_0x2430('0x3a')]=qs[_0x2430('0x3b')](_0x1b475d[_0x2430('0x32')]['sort']);_0x2cd99b[_0x2430('0x3c')]=qs[_0x2430('0x33')](_[_0x2430('0x3d')](_0x1b475d['query'],_0x3591bf[_0x2430('0x33')]));if(_0x1b475d[_0x2430('0x32')][_0x2430('0x3e')]){_0x2cd99b[_0x2430('0x3c')]=_[_0x2430('0x3f')](_0x2cd99b[_0x2430('0x3c')],{'$or':_[_0x2430('0x2e')](_0x2cd99b[_0x2430('0x37')],function(_0x35db7c){var _0x1db88a={};_0x1db88a[_0x35db7c]={'$like':'%'+_0x1b475d[_0x2430('0x32')][_0x2430('0x3e')]+'%'};return _0x1db88a;})});}_0x2cd99b=_[_0x2430('0x3f')]({},_0x2cd99b,_0x1b475d[_0x2430('0x41')]);return _0x2a3ba1[_0x2430('0x51')](_0x2cd99b);}})[_0x2430('0x27')](function(_0x1f5305){if(_0x1f5305){_0xf6d5a9=_0x1f5305['length'];if(!_0x1b475d[_0x2430('0x32')][_0x2430('0x38')](_0x2430('0x39'))){_0x2cd99b[_0x2430('0x1f')]=qs[_0x2430('0x1f')](_0x1b475d[_0x2430('0x32')]['limit']);_0x2cd99b[_0x2430('0x1c')]=qs[_0x2430('0x1c')](_0x1b475d[_0x2430('0x32')][_0x2430('0x1c')]);}return _0x2a3ba1[_0x2430('0x51')](_0x2cd99b);}})[_0x2430('0x27')](function(_0x280b87){if(_0x280b87){return _0x280b87?{'count':_0xf6d5a9,'rows':_0x280b87}:null;}})[_0x2430('0x27')](respondWithResult(_0x5514ec,null))['catch'](handleError(_0x5514ec,null));};exports[_0x2430('0x52')]=function(_0x513be7,_0x18aeb8,_0x27354a){var _0x2ad7d5={};var _0x226a53={};var _0x2f1311;var _0x3faf12;return db[_0x2430('0x42')][_0x2430('0x4f')]({'where':{'id':_0x513be7['params']['id']}})[_0x2430('0x27')](handleEntityNotFound(_0x18aeb8,null))[_0x2430('0x27')](function(_0xe299d9){if(_0xe299d9){_0x2f1311=_0xe299d9;_0x226a53[_0x2430('0x35')]=_[_0x2430('0x47')](db['Dynamics365Field']['rawAttributes']);_0x226a53[_0x2430('0x32')]=_[_0x2430('0x47')](_0x513be7[_0x2430('0x32')]);_0x226a53[_0x2430('0x33')]=_[_0x2430('0x34')](_0x226a53[_0x2430('0x35')],_0x226a53['query']);_0x2ad7d5[_0x2430('0x37')]=_[_0x2430('0x34')](_0x226a53[_0x2430('0x35')],qs[_0x2430('0x36')](_0x513be7[_0x2430('0x32')][_0x2430('0x36')]));_0x2ad7d5[_0x2430('0x37')]=_0x2ad7d5['attributes'][_0x2430('0x48')]?_0x2ad7d5['attributes']:_0x226a53[_0x2430('0x35')];_0x2ad7d5['order']=qs[_0x2430('0x3b')](_0x513be7[_0x2430('0x32')][_0x2430('0x3b')]);_0x2ad7d5['where']=qs[_0x2430('0x33')](_[_0x2430('0x3d')](_0x513be7[_0x2430('0x32')],_0x226a53['filters']));if(_0x513be7['query'][_0x2430('0x3e')]){_0x2ad7d5['where']=_[_0x2430('0x3f')](_0x2ad7d5[_0x2430('0x3c')],{'$or':_['map'](_0x2ad7d5[_0x2430('0x37')],function(_0x31b5fb){var _0x25e128={};_0x25e128[_0x31b5fb]={'$like':'%'+_0x513be7['query']['filter']+'%'};return _0x25e128;})});}_0x2ad7d5=_['merge']({},_0x2ad7d5,_0x513be7[_0x2430('0x41')]);return _0x2f1311[_0x2430('0x52')](_0x2ad7d5);}})[_0x2430('0x27')](function(_0x35deca){if(_0x35deca){_0x3faf12=_0x35deca[_0x2430('0x48')];if(!_0x513be7[_0x2430('0x32')]['hasOwnProperty'](_0x2430('0x39'))){_0x2ad7d5['limit']=qs[_0x2430('0x1f')](_0x513be7[_0x2430('0x32')]['limit']);_0x2ad7d5[_0x2430('0x1c')]=qs[_0x2430('0x1c')](_0x513be7[_0x2430('0x32')][_0x2430('0x1c')]);}return _0x2f1311[_0x2430('0x52')](_0x2ad7d5);}})[_0x2430('0x27')](function(_0x28c374){if(_0x28c374){return _0x28c374?{'count':_0x3faf12,'rows':_0x28c374}:null;}})[_0x2430('0x27')](respondWithResult(_0x18aeb8,null))['catch'](handleError(_0x18aeb8,null));}; \ No newline at end of file diff --git a/server/api/intDynamics365Configuration/intDynamics365Configuration.model.js b/server/api/intDynamics365Configuration/intDynamics365Configuration.model.js index 0f9f5b3..a88c77a 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 _0x3e74=['exports','Dynamics365Configuration','int_dynamics365_configurations','lodash','../../config/logger','api','moment','path','../../config/environment','./intDynamics365Configuration.attributes'];(function(_0x3b64ae,_0x2c4e93){var _0x1506b8=function(_0x2591d7){while(--_0x2591d7){_0x3b64ae['push'](_0x3b64ae['shift']());}};_0x1506b8(++_0x2c4e93);}(_0x3e74,0x175));var _0x43e7=function(_0x3eb6a5,_0xe82ab8){_0x3eb6a5=_0x3eb6a5-0x0;var _0x417b40=_0x3e74[_0x3eb6a5];return _0x417b40;};'use strict';var _=require(_0x43e7('0x0'));var util=require('util');var logger=require(_0x43e7('0x1'))(_0x43e7('0x2'));var moment=require(_0x43e7('0x3'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0x43e7('0x4'));var rimraf=require('rimraf');var config=require(_0x43e7('0x5'));var attributes=require(_0x43e7('0x6'));module[_0x43e7('0x7')]=function(_0x1c503b,_0xc98b9c){return _0x1c503b['define'](_0x43e7('0x8'),attributes,{'tableName':_0x43e7('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x008c=['define','int_dynamics365_configurations','lodash','util','../../config/logger','api','moment','request-promise','path','rimraf','../../config/environment','./intDynamics365Configuration.attributes','exports'];(function(_0xc5c9ac,_0x57c492){var _0x3f4606=function(_0x2aa448){while(--_0x2aa448){_0xc5c9ac['push'](_0xc5c9ac['shift']());}};_0x3f4606(++_0x57c492);}(_0x008c,0x188));var _0xc008=function(_0x267c52,_0x3c0df3){_0x267c52=_0x267c52-0x0;var _0x46c47b=_0x008c[_0x267c52];return _0x46c47b;};'use strict';var _=require(_0xc008('0x0'));var util=require(_0xc008('0x1'));var logger=require(_0xc008('0x2'))(_0xc008('0x3'));var moment=require(_0xc008('0x4'));var BPromise=require('bluebird');var rp=require(_0xc008('0x5'));var fs=require('fs');var path=require(_0xc008('0x6'));var rimraf=require(_0xc008('0x7'));var config=require(_0xc008('0x8'));var attributes=require(_0xc008('0x9'));module[_0xc008('0xa')]=function(_0x13aa7,_0x39bb5e){return _0x13aa7[_0xc008('0xb')]('Dynamics365Configuration',attributes,{'tableName':_0xc008('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/intDynamics365Configuration/intDynamics365Configuration.rpc.js b/server/api/intDynamics365Configuration/intDynamics365Configuration.rpc.js index 290e825..f2558c8 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 _0x5497=['moment','bluebird','randomstring','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','Dynamics365Configuration,\x20%s,\x20%s','request\x20sent','debug','stringify','error','message','catch','lodash','util'];(function(_0x3bfdde,_0x306be4){var _0x3f752a=function(_0x3b6751){while(--_0x3b6751){_0x3bfdde['push'](_0x3bfdde['shift']());}};_0x3f752a(++_0x306be4);}(_0x5497,0x106));var _0x7549=function(_0x4f66,_0x4c4a2e){_0x4f66=_0x4f66-0x0;var _0x4e3d42=_0x5497[_0x4f66];return _0x4e3d42;};'use strict';var _=require(_0x7549('0x0'));var util=require(_0x7549('0x1'));var moment=require(_0x7549('0x2'));var BPromise=require(_0x7549('0x3'));var rs=require(_0x7549('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0x7549('0x5'));var logger=require(_0x7549('0x6'))(_0x7549('0x7'));var config=require(_0x7549('0x8'));var jayson=require(_0x7549('0x9'));var client=jayson[_0x7549('0xa')][_0x7549('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x5de9a1,_0x267d15,_0x371112){return new BPromise(function(_0x25246b,_0x15fb87){return client[_0x7549('0xc')](_0x5de9a1,_0x371112)[_0x7549('0xd')](function(_0x28635d){logger[_0x7549('0xe')](_0x7549('0xf'),_0x267d15,_0x7549('0x10'));logger[_0x7549('0x11')]('Dynamics365Configuration,\x20%s,\x20%s,\x20%s',_0x267d15,_0x7549('0x10'),JSON[_0x7549('0x12')](_0x28635d));if(_0x28635d['error']){if(_0x28635d['error']['code']===0x1f4){logger['error'](_0x7549('0xf'),_0x267d15,_0x28635d[_0x7549('0x13')][_0x7549('0x14')]);return _0x15fb87(_0x28635d[_0x7549('0x13')][_0x7549('0x14')]);}logger['error'](_0x7549('0xf'),_0x267d15,_0x28635d[_0x7549('0x13')][_0x7549('0x14')]);return _0x25246b(_0x28635d[_0x7549('0x13')][_0x7549('0x14')]);}else{logger[_0x7549('0xe')](_0x7549('0xf'),_0x267d15,'request\x20sent');_0x25246b(_0x28635d['result'][_0x7549('0x14')]);}})[_0x7549('0x15')](function(_0x381371){logger[_0x7549('0x13')](_0x7549('0xf'),_0x267d15,_0x381371);_0x15fb87(_0x381371);});});} \ No newline at end of file +var _0x50c6=['Dynamics365Configuration,\x20%s,\x20%s','request\x20sent','debug','Dynamics365Configuration,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','jayson/promise','client','http','request','then','info'];(function(_0xc7d3de,_0x564949){var _0x35e47b=function(_0x2fc30e){while(--_0x2fc30e){_0xc7d3de['push'](_0xc7d3de['shift']());}};_0x35e47b(++_0x564949);}(_0x50c6,0x14b));var _0x650c=function(_0xf96084,_0x5d0a46){_0xf96084=_0xf96084-0x0;var _0x3fe395=_0x50c6[_0xf96084];return _0x3fe395;};'use strict';var _=require(_0x650c('0x0'));var util=require(_0x650c('0x1'));var moment=require('moment');var BPromise=require(_0x650c('0x2'));var rs=require(_0x650c('0x3'));var fs=require('fs');var Redis=require(_0x650c('0x4'));var db=require(_0x650c('0x5'))['db'];var utils=require(_0x650c('0x6'));var logger=require(_0x650c('0x7'))('rpc');var config=require('../../config/environment');var jayson=require(_0x650c('0x8'));var client=jayson[_0x650c('0x9')][_0x650c('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x381f72,_0x41bca1,_0x4b2cca){return new BPromise(function(_0x360940,_0x4d2a1c){return client[_0x650c('0xb')](_0x381f72,_0x4b2cca)[_0x650c('0xc')](function(_0x4a298d){logger[_0x650c('0xd')](_0x650c('0xe'),_0x41bca1,_0x650c('0xf'));logger[_0x650c('0x10')](_0x650c('0x11'),_0x41bca1,_0x650c('0xf'),JSON[_0x650c('0x12')](_0x4a298d));if(_0x4a298d[_0x650c('0x13')]){if(_0x4a298d[_0x650c('0x13')]['code']===0x1f4){logger[_0x650c('0x13')](_0x650c('0xe'),_0x41bca1,_0x4a298d[_0x650c('0x13')][_0x650c('0x14')]);return _0x4d2a1c(_0x4a298d[_0x650c('0x13')][_0x650c('0x14')]);}logger[_0x650c('0x13')](_0x650c('0xe'),_0x41bca1,_0x4a298d[_0x650c('0x13')][_0x650c('0x14')]);return _0x360940(_0x4a298d[_0x650c('0x13')][_0x650c('0x14')]);}else{logger[_0x650c('0xd')](_0x650c('0xe'),_0x41bca1,_0x650c('0xf'));_0x360940(_0x4a298d[_0x650c('0x15')][_0x650c('0x14')]);}})[_0x650c('0x16')](function(_0x8aa4d9){logger[_0x650c('0x13')]('Dynamics365Configuration,\x20%s,\x20%s',_0x41bca1,_0x8aa4d9);_0x4d2a1c(_0x8aa4d9);});});} \ No newline at end of file diff --git a/server/api/intDynamics365Field/index.js b/server/api/intDynamics365Field/index.js index 771b256..25df9fa 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 _0x3b8c=['update','destroy','exports','util','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service','../../config/environment','get','isAuthenticated','/:id','show','put'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0x3b8c,0xa3));var _0xc3b8=function(_0x5a70e8,_0x3f02b5){_0x5a70e8=_0x5a70e8-0x0;var _0x32eac5=_0x3b8c[_0x5a70e8];return _0x32eac5;};'use strict';var multer=require('multer');var util=require(_0xc3b8('0x0'));var path=require(_0xc3b8('0x1'));var timeout=require(_0xc3b8('0x2'));var express=require(_0xc3b8('0x3'));var router=express[_0xc3b8('0x4')]();var fs_extra=require(_0xc3b8('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0xc3b8('0x6'));var config=require(_0xc3b8('0x7'));var controller=require('./intDynamics365Field.controller');router[_0xc3b8('0x8')]('/',auth[_0xc3b8('0x9')](),controller['index']);router[_0xc3b8('0x8')](_0xc3b8('0xa'),auth[_0xc3b8('0x9')](),controller[_0xc3b8('0xb')]);router['post']('/',auth[_0xc3b8('0x9')](),controller['create']);router[_0xc3b8('0xc')](_0xc3b8('0xa'),auth[_0xc3b8('0x9')](),controller[_0xc3b8('0xd')]);router['delete']('/:id',auth[_0xc3b8('0x9')](),controller[_0xc3b8('0xe')]);module[_0xc3b8('0xf')]=router; \ No newline at end of file +var _0xbcdc=['put','update','delete','exports','multer','path','connect-timeout','../../components/auth/service','../../components/interaction/service','../../config/environment','./intDynamics365Field.controller','get','isAuthenticated','index','/:id','show','post','create'];(function(_0x3b3070,_0xdfb262){var _0xef4af4=function(_0x437f4e){while(--_0x437f4e){_0x3b3070['push'](_0x3b3070['shift']());}};_0xef4af4(++_0xdfb262);}(_0xbcdc,0x100));var _0xcbcd=function(_0x15d867,_0x50994b){_0x15d867=_0x15d867-0x0;var _0x5c2b06=_0xbcdc[_0x15d867];return _0x5c2b06;};'use strict';var multer=require(_0xcbcd('0x0'));var util=require('util');var path=require(_0xcbcd('0x1'));var timeout=require(_0xcbcd('0x2'));var express=require('express');var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0xcbcd('0x3'));var interaction=require(_0xcbcd('0x4'));var config=require(_0xcbcd('0x5'));var controller=require(_0xcbcd('0x6'));router[_0xcbcd('0x7')]('/',auth[_0xcbcd('0x8')](),controller[_0xcbcd('0x9')]);router[_0xcbcd('0x7')](_0xcbcd('0xa'),auth['isAuthenticated'](),controller[_0xcbcd('0xb')]);router[_0xcbcd('0xc')]('/',auth['isAuthenticated'](),controller[_0xcbcd('0xd')]);router[_0xcbcd('0xe')](_0xcbcd('0xa'),auth[_0xcbcd('0x8')](),controller[_0xcbcd('0xf')]);router[_0xcbcd('0x10')]('/:id',auth[_0xcbcd('0x8')](),controller['destroy']);module[_0xcbcd('0x11')]=router; \ No newline at end of file diff --git a/server/api/intDynamics365Field/intDynamics365Field.attributes.js b/server/api/intDynamics365Field/intDynamics365Field.attributes.js index 8877485..87ad545 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 _0x7418=['BOOLEAN','sequelize','ENUM','string','variable','keyValue','STRING','customVariable'];(function(_0x2c065c,_0x4a5679){var _0x1a512c=function(_0x49e249){while(--_0x49e249){_0x2c065c['push'](_0x2c065c['shift']());}};_0x1a512c(++_0x4a5679);}(_0x7418,0x1d9));var _0x8741=function(_0x22d8a0,_0x554412){_0x22d8a0=_0x22d8a0-0x0;var _0xb8e3e5=_0x7418[_0x22d8a0];return _0xb8e3e5;};'use strict';var Sequelize=require(_0x8741('0x0'));module['exports']={'type':{'type':Sequelize[_0x8741('0x1')](_0x8741('0x2'),_0x8741('0x3'),'customVariable',_0x8741('0x4'),'picklist'),'defaultValue':_0x8741('0x2')},'content':{'type':Sequelize['STRING']},'key':{'type':Sequelize[_0x8741('0x5')]},'keyType':{'type':Sequelize[_0x8741('0x1')](_0x8741('0x2'),_0x8741('0x3'),_0x8741('0x6'))},'keyContent':{'type':Sequelize[_0x8741('0x5')]},'idField':{'type':Sequelize['STRING']},'nameField':{'type':Sequelize[_0x8741('0x5')]},'customField':{'type':Sequelize[_0x8741('0x7')],'defaultValue':!![]},'variableName':{'type':Sequelize[_0x8741('0x5')]}}; \ No newline at end of file +var _0x4a2e=['picklist','STRING','ENUM','BOOLEAN','sequelize','exports','string','variable','customVariable'];(function(_0xf94546,_0x4fc38e){var _0xe8b9af=function(_0x32baa6){while(--_0x32baa6){_0xf94546['push'](_0xf94546['shift']());}};_0xe8b9af(++_0x4fc38e);}(_0x4a2e,0xca));var _0xe4a2=function(_0x26dfc5,_0x138166){_0x26dfc5=_0x26dfc5-0x0;var _0x566350=_0x4a2e[_0x26dfc5];return _0x566350;};'use strict';var Sequelize=require(_0xe4a2('0x0'));module[_0xe4a2('0x1')]={'type':{'type':Sequelize['ENUM'](_0xe4a2('0x2'),_0xe4a2('0x3'),_0xe4a2('0x4'),'keyValue',_0xe4a2('0x5')),'defaultValue':_0xe4a2('0x2')},'content':{'type':Sequelize[_0xe4a2('0x6')]},'key':{'type':Sequelize['STRING']},'keyType':{'type':Sequelize[_0xe4a2('0x7')]('string',_0xe4a2('0x3'),'customVariable')},'keyContent':{'type':Sequelize[_0xe4a2('0x6')]},'idField':{'type':Sequelize[_0xe4a2('0x6')]},'nameField':{'type':Sequelize[_0xe4a2('0x6')]},'customField':{'type':Sequelize[_0xe4a2('0x8')],'defaultValue':!![]},'variableName':{'type':Sequelize[_0xe4a2('0x6')]}}; \ No newline at end of file diff --git a/server/api/intDynamics365Field/intDynamics365Field.controller.js b/server/api/intDynamics365Field/intDynamics365Field.controller.js index ac04474..422279d 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 _0x32e2=['where','merge','includeAll','include','findAll','rows','catch','show','length','find','create','body','params','rimraf','zip-dir','request-promise','bluebird','util','path','to-csv','ejs','fs-extra','lodash','squel','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/utils','../../config/environment','../../config/license/util','sendStatus','status','json','offset','count','limit','Content-Range','apply','reject','save','update','destroy','then','end','name','send','map','Dynamics365Field','rawAttributes','fieldName','type','key','query','keys','filters','intersection','model','attributes','fields','hasOwnProperty','nolimit','sort','pick','filter'];(function(_0x3ac5e2,_0x3e9e01){var _0x297b42=function(_0x16cbfc){while(--_0x16cbfc){_0x3ac5e2['push'](_0x3ac5e2['shift']());}};_0x297b42(++_0x3e9e01);}(_0x32e2,0xdc));var _0x232e=function(_0x36b400,_0x277ec5){_0x36b400=_0x36b400-0x0;var _0x4d47bf=_0x32e2[_0x36b400];return _0x4d47bf;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x232e('0x0'));var zipdir=require(_0x232e('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0x232e('0x2'));var moment=require('moment');var BPromise=require(_0x232e('0x3'));var Mustache=require('mustache');var util=require(_0x232e('0x4'));var path=require(_0x232e('0x5'));var sox=require('sox');var csv=require(_0x232e('0x6'));var ejs=require(_0x232e('0x7'));var fs=require('fs');var fs_extra=require(_0x232e('0x8'));var _=require(_0x232e('0x9'));var squel=require(_0x232e('0xa'));var crypto=require('crypto');var jsforce=require(_0x232e('0xb'));var deskjs=require(_0x232e('0xc'));var toCsv=require(_0x232e('0x6'));var querystring=require(_0x232e('0xd'));var Papa=require(_0x232e('0xe'));var Redis=require('ioredis');var authService=require(_0x232e('0xf'));var qs=require(_0x232e('0x10'));var as=require(_0x232e('0x11'));var hardwareService=require(_0x232e('0x12'));var logger=require('../../config/logger')('api');var utils=require(_0x232e('0x13'));var config=require(_0x232e('0x14'));var licenseUtil=require(_0x232e('0x15'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x11fe4a,_0x157e51){_0x157e51=_0x157e51||0xcc;return function(_0x18c130){if(_0x18c130){return _0x11fe4a[_0x232e('0x16')](_0x157e51);}return _0x11fe4a[_0x232e('0x17')](_0x157e51)['end']();};}function respondWithResult(_0xee56e4,_0x2f396c){_0x2f396c=_0x2f396c||0xc8;return function(_0x36c019){if(_0x36c019){return _0xee56e4[_0x232e('0x17')](_0x2f396c)[_0x232e('0x18')](_0x36c019);}};}function respondWithFilteredResult(_0x72d84d,_0x5273d2){return function(_0x337226){if(_0x337226){var _0x2c27dd=typeof _0x5273d2[_0x232e('0x19')]==='undefined'&&typeof _0x5273d2['limit']==='undefined';var _0xa57f32=_0x337226[_0x232e('0x1a')];var _0x527945=_0x2c27dd?0x0:_0x5273d2[_0x232e('0x19')];var _0xbf564d=_0x2c27dd?_0x337226[_0x232e('0x1a')]:_0x5273d2[_0x232e('0x19')]+_0x5273d2[_0x232e('0x1b')];var _0x23738d;if(_0xbf564d>=_0xa57f32){_0xbf564d=_0xa57f32;_0x23738d=0xc8;}else{_0x23738d=0xce;}_0x72d84d[_0x232e('0x17')](_0x23738d);return _0x72d84d['set'](_0x232e('0x1c'),_0x527945+'-'+_0xbf564d+'/'+_0xa57f32)[_0x232e('0x18')](_0x337226);}return null;};}function patchUpdates(_0x1d4caf){return function(_0x3facb4){try{jsonpatch[_0x232e('0x1d')](_0x3facb4,_0x1d4caf,!![]);}catch(_0xa8df06){return BPromise[_0x232e('0x1e')](_0xa8df06);}return _0x3facb4[_0x232e('0x1f')]();};}function saveUpdates(_0x44c251,_0x5bd292){return function(_0x167535){if(_0x167535){return _0x167535[_0x232e('0x20')](_0x44c251)['then'](function(_0x100fad){return _0x100fad;});}return null;};}function removeEntity(_0x2d3705,_0x12aeb9){return function(_0xf3079d){if(_0xf3079d){return _0xf3079d[_0x232e('0x21')]()[_0x232e('0x22')](function(){_0x2d3705['status'](0xcc)[_0x232e('0x23')]();});}};}function handleEntityNotFound(_0x3e30db,_0xf3f433){return function(_0x26ee4c){if(!_0x26ee4c){_0x3e30db[_0x232e('0x16')](0x194);}return _0x26ee4c;};}function handleError(_0x3b4052,_0x1042b1){_0x1042b1=_0x1042b1||0x1f4;return function(_0x5f1222){logger['error'](_0x5f1222['stack']);if(_0x5f1222[_0x232e('0x24')]){delete _0x5f1222[_0x232e('0x24')];}_0x3b4052['status'](_0x1042b1)[_0x232e('0x25')](_0x5f1222);};}exports['index']=function(_0x462b33,_0x397c8d){var _0x3d13b9={},_0x26552d={},_0x34fbb8={'count':0x0,'rows':[]};var _0x363903=_[_0x232e('0x26')](db[_0x232e('0x27')][_0x232e('0x28')],function(_0x10c9c5){return{'name':_0x10c9c5[_0x232e('0x29')],'type':_0x10c9c5[_0x232e('0x2a')][_0x232e('0x2b')]};});_0x26552d['model']=_['map'](_0x363903,_0x232e('0x24'));_0x26552d[_0x232e('0x2c')]=_[_0x232e('0x2d')](_0x462b33[_0x232e('0x2c')]);_0x26552d[_0x232e('0x2e')]=_[_0x232e('0x2f')](_0x26552d[_0x232e('0x30')],_0x26552d['query']);_0x3d13b9[_0x232e('0x31')]=_['intersection'](_0x26552d[_0x232e('0x30')],qs[_0x232e('0x32')](_0x462b33[_0x232e('0x2c')][_0x232e('0x32')]));_0x3d13b9['attributes']=_0x3d13b9[_0x232e('0x31')]['length']?_0x3d13b9['attributes']:_0x26552d[_0x232e('0x30')];if(!_0x462b33[_0x232e('0x2c')][_0x232e('0x33')](_0x232e('0x34'))){_0x3d13b9[_0x232e('0x1b')]=qs[_0x232e('0x1b')](_0x462b33[_0x232e('0x2c')][_0x232e('0x1b')]);_0x3d13b9[_0x232e('0x19')]=qs['offset'](_0x462b33[_0x232e('0x2c')][_0x232e('0x19')]);}_0x3d13b9['order']=qs[_0x232e('0x35')](_0x462b33['query'][_0x232e('0x35')]);_0x3d13b9['where']=qs[_0x232e('0x2e')](_[_0x232e('0x36')](_0x462b33[_0x232e('0x2c')],_0x26552d['filters']),_0x363903);if(_0x462b33[_0x232e('0x2c')][_0x232e('0x37')]){_0x3d13b9[_0x232e('0x38')]=_[_0x232e('0x39')](_0x3d13b9['where'],{'$or':_[_0x232e('0x26')](_0x363903,function(_0x326579){if(_0x326579[_0x232e('0x2a')]!=='VIRTUAL'){var _0x5af201={};_0x5af201[_0x326579[_0x232e('0x24')]]={'$like':'%'+_0x462b33[_0x232e('0x2c')][_0x232e('0x37')]+'%'};return _0x5af201;}})});}_0x3d13b9=_[_0x232e('0x39')]({},_0x3d13b9,_0x462b33['options']);var _0x2ee7e8={'where':_0x3d13b9[_0x232e('0x38')]};return db[_0x232e('0x27')][_0x232e('0x1a')](_0x2ee7e8)[_0x232e('0x22')](function(_0x1e288b){_0x34fbb8[_0x232e('0x1a')]=_0x1e288b;if(_0x462b33['query'][_0x232e('0x3a')]){_0x3d13b9[_0x232e('0x3b')]=[{'all':!![]}];}return db[_0x232e('0x27')][_0x232e('0x3c')](_0x3d13b9);})['then'](function(_0x213dee){_0x34fbb8[_0x232e('0x3d')]=_0x213dee;return _0x34fbb8;})['then'](respondWithFilteredResult(_0x397c8d,_0x3d13b9))[_0x232e('0x3e')](handleError(_0x397c8d,null));};exports[_0x232e('0x3f')]=function(_0x33258f,_0x10e8c9){var _0x1cc564={'raw':!![],'where':{'id':_0x33258f['params']['id']}},_0xcfdd91={};_0xcfdd91[_0x232e('0x30')]=_['keys'](db['Dynamics365Field'][_0x232e('0x28')]);_0xcfdd91[_0x232e('0x2c')]=_[_0x232e('0x2d')](_0x33258f[_0x232e('0x2c')]);_0xcfdd91[_0x232e('0x2e')]=_[_0x232e('0x2f')](_0xcfdd91[_0x232e('0x30')],_0xcfdd91['query']);_0x1cc564[_0x232e('0x31')]=_[_0x232e('0x2f')](_0xcfdd91[_0x232e('0x30')],qs[_0x232e('0x32')](_0x33258f[_0x232e('0x2c')][_0x232e('0x32')]));_0x1cc564[_0x232e('0x31')]=_0x1cc564[_0x232e('0x31')][_0x232e('0x40')]?_0x1cc564['attributes']:_0xcfdd91['model'];if(_0x33258f['query'][_0x232e('0x3a')]){_0x1cc564[_0x232e('0x3b')]=[{'all':!![]}];}_0x1cc564=_[_0x232e('0x39')]({},_0x1cc564,_0x33258f['options']);return db[_0x232e('0x27')][_0x232e('0x41')](_0x1cc564)['then'](handleEntityNotFound(_0x10e8c9,null))['then'](respondWithResult(_0x10e8c9,null))[_0x232e('0x3e')](handleError(_0x10e8c9,null));};exports['create']=function(_0x66e61e,_0xbd8dea){return db[_0x232e('0x27')][_0x232e('0x42')](_0x66e61e[_0x232e('0x43')],{})['then'](respondWithResult(_0xbd8dea,0xc9))['catch'](handleError(_0xbd8dea,null));};exports['update']=function(_0x527722,_0x14f371){if(_0x527722[_0x232e('0x43')]['id']){delete _0x527722[_0x232e('0x43')]['id'];}return db['Dynamics365Field'][_0x232e('0x41')]({'where':{'id':_0x527722[_0x232e('0x44')]['id']}})['then'](handleEntityNotFound(_0x14f371,null))[_0x232e('0x22')](saveUpdates(_0x527722[_0x232e('0x43')],null))[_0x232e('0x22')](respondWithResult(_0x14f371,null))['catch'](handleError(_0x14f371,null));};exports[_0x232e('0x21')]=function(_0x41a5be,_0x122890){return db[_0x232e('0x27')]['find']({'where':{'id':_0x41a5be[_0x232e('0x44')]['id']}})['then'](handleEntityNotFound(_0x122890,null))[_0x232e('0x22')](removeEntity(_0x122890,null))[_0x232e('0x3e')](handleError(_0x122890,null));}; \ No newline at end of file +var _0x1175=['bluebird','mustache','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','end','undefined','limit','offset','count','set','Content-Range','json','apply','update','then','destroy','sendStatus','stack','name','status','send','index','map','Dynamics365Field','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','include','findAll','rows','catch','show','params','length','find','create','body','eml-format','rimraf','zip-dir','fast-json-patch','request-promise'];(function(_0x58dfb8,_0x5a93ae){var _0x5dc366=function(_0x3c13cc){while(--_0x3c13cc){_0x58dfb8['push'](_0x58dfb8['shift']());}};_0x5dc366(++_0x5a93ae);}(_0x1175,0x1e1));var _0x5117=function(_0x20d36d,_0x190347){_0x20d36d=_0x20d36d-0x0;var _0x31c69e=_0x1175[_0x20d36d];return _0x31c69e;};'use strict';var emlformat=require(_0x5117('0x0'));var rimraf=require(_0x5117('0x1'));var zipdir=require(_0x5117('0x2'));var jsonpatch=require(_0x5117('0x3'));var rp=require(_0x5117('0x4'));var moment=require('moment');var BPromise=require(_0x5117('0x5'));var Mustache=require(_0x5117('0x6'));var util=require('util');var path=require(_0x5117('0x7'));var sox=require(_0x5117('0x8'));var csv=require(_0x5117('0x9'));var ejs=require(_0x5117('0xa'));var fs=require('fs');var fs_extra=require(_0x5117('0xb'));var _=require(_0x5117('0xc'));var squel=require(_0x5117('0xd'));var crypto=require(_0x5117('0xe'));var jsforce=require(_0x5117('0xf'));var deskjs=require(_0x5117('0x10'));var toCsv=require(_0x5117('0x9'));var querystring=require(_0x5117('0x11'));var Papa=require(_0x5117('0x12'));var Redis=require(_0x5117('0x13'));var authService=require('../../components/auth/service');var qs=require(_0x5117('0x14'));var as=require(_0x5117('0x15'));var hardwareService=require(_0x5117('0x16'));var logger=require(_0x5117('0x17'))(_0x5117('0x18'));var utils=require(_0x5117('0x19'));var config=require(_0x5117('0x1a'));var licenseUtil=require(_0x5117('0x1b'));var db=require(_0x5117('0x1c'))['db'];function respondWithStatusCode(_0x42cab1,_0x2a3895){_0x2a3895=_0x2a3895||0xcc;return function(_0x260e2d){if(_0x260e2d){return _0x42cab1['sendStatus'](_0x2a3895);}return _0x42cab1['status'](_0x2a3895)[_0x5117('0x1d')]();};}function respondWithResult(_0x403dae,_0x34a8c5){_0x34a8c5=_0x34a8c5||0xc8;return function(_0x43bda1){if(_0x43bda1){return _0x403dae['status'](_0x34a8c5)['json'](_0x43bda1);}};}function respondWithFilteredResult(_0xc1ab1a,_0x30308f){return function(_0x2aed75){if(_0x2aed75){var _0x2241c4=typeof _0x30308f['offset']===_0x5117('0x1e')&&typeof _0x30308f[_0x5117('0x1f')]==='undefined';var _0x2fdbfc=_0x2aed75['count'];var _0x21fe57=_0x2241c4?0x0:_0x30308f[_0x5117('0x20')];var _0x25137a=_0x2241c4?_0x2aed75[_0x5117('0x21')]:_0x30308f[_0x5117('0x20')]+_0x30308f[_0x5117('0x1f')];var _0x3d7ea3;if(_0x25137a>=_0x2fdbfc){_0x25137a=_0x2fdbfc;_0x3d7ea3=0xc8;}else{_0x3d7ea3=0xce;}_0xc1ab1a['status'](_0x3d7ea3);return _0xc1ab1a[_0x5117('0x22')](_0x5117('0x23'),_0x21fe57+'-'+_0x25137a+'/'+_0x2fdbfc)[_0x5117('0x24')](_0x2aed75);}return null;};}function patchUpdates(_0x4b6e28){return function(_0x5ea81d){try{jsonpatch[_0x5117('0x25')](_0x5ea81d,_0x4b6e28,!![]);}catch(_0x4ddd99){return BPromise['reject'](_0x4ddd99);}return _0x5ea81d['save']();};}function saveUpdates(_0x114c33,_0x44f951){return function(_0x5d29c9){if(_0x5d29c9){return _0x5d29c9[_0x5117('0x26')](_0x114c33)[_0x5117('0x27')](function(_0x4a2578){return _0x4a2578;});}return null;};}function removeEntity(_0x3dc9d5,_0x501dad){return function(_0x2d581d){if(_0x2d581d){return _0x2d581d[_0x5117('0x28')]()[_0x5117('0x27')](function(){_0x3dc9d5['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x2d4a4a,_0x3f085d){return function(_0x23416f){if(!_0x23416f){_0x2d4a4a[_0x5117('0x29')](0x194);}return _0x23416f;};}function handleError(_0x3466e0,_0x312d67){_0x312d67=_0x312d67||0x1f4;return function(_0x12b8f5){logger['error'](_0x12b8f5[_0x5117('0x2a')]);if(_0x12b8f5[_0x5117('0x2b')]){delete _0x12b8f5[_0x5117('0x2b')];}_0x3466e0[_0x5117('0x2c')](_0x312d67)[_0x5117('0x2d')](_0x12b8f5);};}exports[_0x5117('0x2e')]=function(_0x17dbfc,_0x5a37ad){var _0x1a1a66={},_0x3c4c69={},_0x217536={'count':0x0,'rows':[]};var _0x5e549a=_[_0x5117('0x2f')](db[_0x5117('0x30')][_0x5117('0x31')],function(_0x3d737b){return{'name':_0x3d737b[_0x5117('0x32')],'type':_0x3d737b[_0x5117('0x33')][_0x5117('0x34')]};});_0x3c4c69[_0x5117('0x35')]=_[_0x5117('0x2f')](_0x5e549a,_0x5117('0x2b'));_0x3c4c69[_0x5117('0x36')]=_[_0x5117('0x37')](_0x17dbfc[_0x5117('0x36')]);_0x3c4c69[_0x5117('0x38')]=_[_0x5117('0x39')](_0x3c4c69['model'],_0x3c4c69[_0x5117('0x36')]);_0x1a1a66[_0x5117('0x3a')]=_['intersection'](_0x3c4c69['model'],qs['fields'](_0x17dbfc['query'][_0x5117('0x3b')]));_0x1a1a66['attributes']=_0x1a1a66[_0x5117('0x3a')]['length']?_0x1a1a66[_0x5117('0x3a')]:_0x3c4c69[_0x5117('0x35')];if(!_0x17dbfc[_0x5117('0x36')][_0x5117('0x3c')](_0x5117('0x3d'))){_0x1a1a66[_0x5117('0x1f')]=qs[_0x5117('0x1f')](_0x17dbfc['query'][_0x5117('0x1f')]);_0x1a1a66['offset']=qs[_0x5117('0x20')](_0x17dbfc['query'][_0x5117('0x20')]);}_0x1a1a66[_0x5117('0x3e')]=qs[_0x5117('0x3f')](_0x17dbfc[_0x5117('0x36')][_0x5117('0x3f')]);_0x1a1a66[_0x5117('0x40')]=qs['filters'](_[_0x5117('0x41')](_0x17dbfc[_0x5117('0x36')],_0x3c4c69['filters']),_0x5e549a);if(_0x17dbfc['query'][_0x5117('0x42')]){_0x1a1a66['where']=_[_0x5117('0x43')](_0x1a1a66[_0x5117('0x40')],{'$or':_[_0x5117('0x2f')](_0x5e549a,function(_0x2b3658){if(_0x2b3658[_0x5117('0x33')]!==_0x5117('0x44')){var _0x58c5e2={};_0x58c5e2[_0x2b3658[_0x5117('0x2b')]]={'$like':'%'+_0x17dbfc['query']['filter']+'%'};return _0x58c5e2;}})});}_0x1a1a66=_[_0x5117('0x43')]({},_0x1a1a66,_0x17dbfc[_0x5117('0x45')]);var _0x3d3aa8={'where':_0x1a1a66[_0x5117('0x40')]};return db['Dynamics365Field'][_0x5117('0x21')](_0x3d3aa8)[_0x5117('0x27')](function(_0x495d38){_0x217536[_0x5117('0x21')]=_0x495d38;if(_0x17dbfc[_0x5117('0x36')][_0x5117('0x46')]){_0x1a1a66[_0x5117('0x47')]=[{'all':!![]}];}return db[_0x5117('0x30')][_0x5117('0x48')](_0x1a1a66);})[_0x5117('0x27')](function(_0x1ad7a1){_0x217536[_0x5117('0x49')]=_0x1ad7a1;return _0x217536;})[_0x5117('0x27')](respondWithFilteredResult(_0x5a37ad,_0x1a1a66))[_0x5117('0x4a')](handleError(_0x5a37ad,null));};exports[_0x5117('0x4b')]=function(_0x432c80,_0x182f1b){var _0x5cd65e={'raw':!![],'where':{'id':_0x432c80[_0x5117('0x4c')]['id']}},_0x148a03={};_0x148a03[_0x5117('0x35')]=_[_0x5117('0x37')](db['Dynamics365Field'][_0x5117('0x31')]);_0x148a03['query']=_['keys'](_0x432c80['query']);_0x148a03['filters']=_[_0x5117('0x39')](_0x148a03[_0x5117('0x35')],_0x148a03['query']);_0x5cd65e['attributes']=_['intersection'](_0x148a03['model'],qs[_0x5117('0x3b')](_0x432c80['query']['fields']));_0x5cd65e[_0x5117('0x3a')]=_0x5cd65e[_0x5117('0x3a')][_0x5117('0x4d')]?_0x5cd65e['attributes']:_0x148a03[_0x5117('0x35')];if(_0x432c80[_0x5117('0x36')][_0x5117('0x46')]){_0x5cd65e['include']=[{'all':!![]}];}_0x5cd65e=_[_0x5117('0x43')]({},_0x5cd65e,_0x432c80[_0x5117('0x45')]);return db[_0x5117('0x30')][_0x5117('0x4e')](_0x5cd65e)[_0x5117('0x27')](handleEntityNotFound(_0x182f1b,null))[_0x5117('0x27')](respondWithResult(_0x182f1b,null))[_0x5117('0x4a')](handleError(_0x182f1b,null));};exports[_0x5117('0x4f')]=function(_0x478183,_0x5b49ca){return db[_0x5117('0x30')][_0x5117('0x4f')](_0x478183['body'],{})[_0x5117('0x27')](respondWithResult(_0x5b49ca,0xc9))[_0x5117('0x4a')](handleError(_0x5b49ca,null));};exports[_0x5117('0x26')]=function(_0x5969de,_0x4745c2){if(_0x5969de[_0x5117('0x50')]['id']){delete _0x5969de[_0x5117('0x50')]['id'];}return db[_0x5117('0x30')][_0x5117('0x4e')]({'where':{'id':_0x5969de['params']['id']}})[_0x5117('0x27')](handleEntityNotFound(_0x4745c2,null))['then'](saveUpdates(_0x5969de[_0x5117('0x50')],null))[_0x5117('0x27')](respondWithResult(_0x4745c2,null))[_0x5117('0x4a')](handleError(_0x4745c2,null));};exports[_0x5117('0x28')]=function(_0x19519f,_0x528abe){return db[_0x5117('0x30')][_0x5117('0x4e')]({'where':{'id':_0x19519f[_0x5117('0x4c')]['id']}})[_0x5117('0x27')](handleEntityNotFound(_0x528abe,null))[_0x5117('0x27')](removeEntity(_0x528abe,null))[_0x5117('0x4a')](handleError(_0x528abe,null));}; \ No newline at end of file diff --git a/server/api/intDynamics365Field/intDynamics365Field.model.js b/server/api/intDynamics365Field/intDynamics365Field.model.js index 3afdd41..8efe818 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 _0x232a=['util','../../config/logger','api','moment','request-promise','../../config/environment','exports','Dynamics365Field','int_dynamics365_fields','dynamics365_unique_index','idField','lodash'];(function(_0x3851c0,_0x34164d){var _0xf6f68b=function(_0x2b1da3){while(--_0x2b1da3){_0x3851c0['push'](_0x3851c0['shift']());}};_0xf6f68b(++_0x34164d);}(_0x232a,0xa7));var _0xa232=function(_0x287dc2,_0x5d488c){_0x287dc2=_0x287dc2-0x0;var _0xc10e1a=_0x232a[_0x287dc2];return _0xc10e1a;};'use strict';var _=require(_0xa232('0x0'));var util=require(_0xa232('0x1'));var logger=require(_0xa232('0x2'))(_0xa232('0x3'));var moment=require(_0xa232('0x4'));var BPromise=require('bluebird');var rp=require(_0xa232('0x5'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0xa232('0x6'));var attributes=require('./intDynamics365Field.attributes');module[_0xa232('0x7')]=function(_0x544b65,_0x5cc833){return _0x544b65['define'](_0xa232('0x8'),attributes,{'tableName':_0xa232('0x9'),'paranoid':![],'indexes':[{'name':_0xa232('0xa'),'fields':[_0xa232('0xb'),'FieldId'],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file +var _0x2da9=['int_dynamics365_fields','idField','FieldId','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','exports'];(function(_0x5f382f,_0x3f1432){var _0x3bb11b=function(_0x4daf9b){while(--_0x4daf9b){_0x5f382f['push'](_0x5f382f['shift']());}};_0x3bb11b(++_0x3f1432);}(_0x2da9,0x81));var _0x92da=function(_0x154280,_0x249306){_0x154280=_0x154280-0x0;var _0x5c6bb3=_0x2da9[_0x154280];return _0x5c6bb3;};'use strict';var _=require(_0x92da('0x0'));var util=require(_0x92da('0x1'));var logger=require(_0x92da('0x2'))(_0x92da('0x3'));var moment=require(_0x92da('0x4'));var BPromise=require(_0x92da('0x5'));var rp=require(_0x92da('0x6'));var fs=require('fs');var path=require(_0x92da('0x7'));var rimraf=require(_0x92da('0x8'));var config=require(_0x92da('0x9'));var attributes=require('./intDynamics365Field.attributes');module[_0x92da('0xa')]=function(_0x2489c3,_0x123627){return _0x2489c3['define']('Dynamics365Field',attributes,{'tableName':_0x92da('0xb'),'paranoid':![],'indexes':[{'name':'dynamics365_unique_index','fields':[_0x92da('0xc'),_0x92da('0xd')],'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 d3c4817..c8e454d 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 _0x4a8d=['lodash','util','moment','randomstring','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','Dynamics365Field,\x20%s,\x20%s','request\x20sent','Dynamics365Field,\x20%s,\x20%s,\x20%s','stringify','error','message','result'];(function(_0x484e36,_0x4482d8){var _0xafc85d=function(_0xaba9c8){while(--_0xaba9c8){_0x484e36['push'](_0x484e36['shift']());}};_0xafc85d(++_0x4482d8);}(_0x4a8d,0xd2));var _0xd4a8=function(_0x5e6e72,_0x557ff5){_0x5e6e72=_0x5e6e72-0x0;var _0x5d230b=_0x4a8d[_0x5e6e72];return _0x5d230b;};'use strict';var _=require(_0xd4a8('0x0'));var util=require(_0xd4a8('0x1'));var moment=require(_0xd4a8('0x2'));var BPromise=require('bluebird');var rs=require(_0xd4a8('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xd4a8('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0xd4a8('0x5'))(_0xd4a8('0x6'));var config=require(_0xd4a8('0x7'));var jayson=require(_0xd4a8('0x8'));var client=jayson[_0xd4a8('0x9')][_0xd4a8('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x1f4a78,_0x506cf9,_0x4012cb){return new BPromise(function(_0x2cc66e,_0x1bb87f){return client[_0xd4a8('0xb')](_0x1f4a78,_0x4012cb)[_0xd4a8('0xc')](function(_0xd128ac){logger[_0xd4a8('0xd')](_0xd4a8('0xe'),_0x506cf9,_0xd4a8('0xf'));logger['debug'](_0xd4a8('0x10'),_0x506cf9,_0xd4a8('0xf'),JSON[_0xd4a8('0x11')](_0xd128ac));if(_0xd128ac[_0xd4a8('0x12')]){if(_0xd128ac[_0xd4a8('0x12')]['code']===0x1f4){logger[_0xd4a8('0x12')](_0xd4a8('0xe'),_0x506cf9,_0xd128ac['error'][_0xd4a8('0x13')]);return _0x1bb87f(_0xd128ac['error']['message']);}logger[_0xd4a8('0x12')](_0xd4a8('0xe'),_0x506cf9,_0xd128ac['error'][_0xd4a8('0x13')]);return _0x2cc66e(_0xd128ac['error'][_0xd4a8('0x13')]);}else{logger[_0xd4a8('0xd')](_0xd4a8('0xe'),_0x506cf9,'request\x20sent');_0x2cc66e(_0xd128ac[_0xd4a8('0x14')][_0xd4a8('0x13')]);}})['catch'](function(_0x346c18){logger[_0xd4a8('0x12')](_0xd4a8('0xe'),_0x506cf9,_0x346c18);_0x1bb87f(_0x346c18);});});} \ No newline at end of file +var _0x6941=['Dynamics365Field,\x20%s,\x20%s,\x20%s','stringify','error','code','Dynamics365Field,\x20%s,\x20%s','message','result','lodash','util','moment','bluebird','randomstring','ioredis','rpc','../../config/environment','client','request','then','info','request\x20sent','debug'];(function(_0x432682,_0x253044){var _0x463d05=function(_0xa73403){while(--_0xa73403){_0x432682['push'](_0x432682['shift']());}};_0x463d05(++_0x253044);}(_0x6941,0xee));var _0x1694=function(_0x187ee1,_0x3fd1e6){_0x187ee1=_0x187ee1-0x0;var _0x388160=_0x6941[_0x187ee1];return _0x388160;};'use strict';var _=require(_0x1694('0x0'));var util=require(_0x1694('0x1'));var moment=require(_0x1694('0x2'));var BPromise=require(_0x1694('0x3'));var rs=require(_0x1694('0x4'));var fs=require('fs');var Redis=require(_0x1694('0x5'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0x1694('0x6'));var config=require(_0x1694('0x7'));var jayson=require('jayson/promise');var client=jayson[_0x1694('0x8')]['http']({'port':0x232a});function respondWithRpcPromise(_0x361184,_0x558269,_0x517871){return new BPromise(function(_0x5b60b8,_0x41aea8){return client[_0x1694('0x9')](_0x361184,_0x517871)[_0x1694('0xa')](function(_0x53e017){logger[_0x1694('0xb')]('Dynamics365Field,\x20%s,\x20%s',_0x558269,_0x1694('0xc'));logger[_0x1694('0xd')](_0x1694('0xe'),_0x558269,'request\x20sent',JSON[_0x1694('0xf')](_0x53e017));if(_0x53e017[_0x1694('0x10')]){if(_0x53e017[_0x1694('0x10')][_0x1694('0x11')]===0x1f4){logger[_0x1694('0x10')](_0x1694('0x12'),_0x558269,_0x53e017['error'][_0x1694('0x13')]);return _0x41aea8(_0x53e017[_0x1694('0x10')][_0x1694('0x13')]);}logger[_0x1694('0x10')](_0x1694('0x12'),_0x558269,_0x53e017[_0x1694('0x10')][_0x1694('0x13')]);return _0x5b60b8(_0x53e017['error'][_0x1694('0x13')]);}else{logger[_0x1694('0xb')](_0x1694('0x12'),_0x558269,'request\x20sent');_0x5b60b8(_0x53e017[_0x1694('0x14')][_0x1694('0x13')]);}})['catch'](function(_0x3e36fa){logger[_0x1694('0x10')](_0x1694('0x12'),_0x558269,_0x3e36fa);_0x41aea8(_0x3e36fa);});});} \ No newline at end of file diff --git a/server/api/intFreshdeskAccount/index.js b/server/api/intFreshdeskAccount/index.js index fbdc833..debee3d 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 _0xc2c2=['Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./intFreshdeskAccount.controller','index','/:id','isAuthenticated','show','get','/:id/configurations','getConfigurations','post','create','put','delete','destroy','exports','multer','util','path','connect-timeout','express'];(function(_0x2cad64,_0x2a699e){var _0x16504b=function(_0x290937){while(--_0x290937){_0x2cad64['push'](_0x2cad64['shift']());}};_0x16504b(++_0x2a699e);}(_0xc2c2,0x154));var _0x2c2c=function(_0x3dbda9,_0x12232c){_0x3dbda9=_0x3dbda9-0x0;var _0x12dd01=_0xc2c2[_0x3dbda9];return _0x12dd01;};'use strict';var multer=require(_0x2c2c('0x0'));var util=require(_0x2c2c('0x1'));var path=require(_0x2c2c('0x2'));var timeout=require(_0x2c2c('0x3'));var express=require(_0x2c2c('0x4'));var router=express[_0x2c2c('0x5')]();var fs_extra=require('fs-extra');var auth=require(_0x2c2c('0x6'));var interaction=require(_0x2c2c('0x7'));var config=require(_0x2c2c('0x8'));var controller=require(_0x2c2c('0x9'));router['get']('/',auth['isAuthenticated'](),controller[_0x2c2c('0xa')]);router['get'](_0x2c2c('0xb'),auth[_0x2c2c('0xc')](),controller[_0x2c2c('0xd')]);router[_0x2c2c('0xe')](_0x2c2c('0xf'),auth[_0x2c2c('0xc')](),controller[_0x2c2c('0x10')]);router[_0x2c2c('0xe')]('/:id/fields',auth[_0x2c2c('0xc')](),controller['getFields']);router[_0x2c2c('0x11')]('/',auth[_0x2c2c('0xc')](),controller[_0x2c2c('0x12')]);router[_0x2c2c('0x11')]('/:id/configurations',auth[_0x2c2c('0xc')](),controller['addConfiguration']);router[_0x2c2c('0x13')](_0x2c2c('0xb'),auth[_0x2c2c('0xc')](),controller['update']);router[_0x2c2c('0x14')]('/:id',auth[_0x2c2c('0xc')](),controller[_0x2c2c('0x15')]);module[_0x2c2c('0x16')]=router; \ No newline at end of file +var _0x1ec4=['destroy','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./intFreshdeskAccount.controller','get','isAuthenticated','index','getConfigurations','/:id/fields','post','create','/:id/configurations','addConfiguration','put','/:id','update'];(function(_0x56e4e7,_0x1db098){var _0x383618=function(_0xb088c6){while(--_0xb088c6){_0x56e4e7['push'](_0x56e4e7['shift']());}};_0x383618(++_0x1db098);}(_0x1ec4,0x1c4));var _0x41ec=function(_0x389736,_0x19925f){_0x389736=_0x389736-0x0;var _0x17a000=_0x1ec4[_0x389736];return _0x17a000;};'use strict';var multer=require(_0x41ec('0x0'));var util=require(_0x41ec('0x1'));var path=require(_0x41ec('0x2'));var timeout=require(_0x41ec('0x3'));var express=require(_0x41ec('0x4'));var router=express[_0x41ec('0x5')]();var fs_extra=require(_0x41ec('0x6'));var auth=require(_0x41ec('0x7'));var interaction=require(_0x41ec('0x8'));var config=require(_0x41ec('0x9'));var controller=require(_0x41ec('0xa'));router[_0x41ec('0xb')]('/',auth[_0x41ec('0xc')](),controller[_0x41ec('0xd')]);router[_0x41ec('0xb')]('/:id',auth[_0x41ec('0xc')](),controller['show']);router[_0x41ec('0xb')]('/:id/configurations',auth['isAuthenticated'](),controller[_0x41ec('0xe')]);router[_0x41ec('0xb')](_0x41ec('0xf'),auth[_0x41ec('0xc')](),controller['getFields']);router[_0x41ec('0x10')]('/',auth['isAuthenticated'](),controller[_0x41ec('0x11')]);router[_0x41ec('0x10')](_0x41ec('0x12'),auth[_0x41ec('0xc')](),controller[_0x41ec('0x13')]);router[_0x41ec('0x14')](_0x41ec('0x15'),auth[_0x41ec('0xc')](),controller[_0x41ec('0x16')]);router['delete']('/:id',auth[_0x41ec('0xc')](),controller[_0x41ec('0x17')]);module[_0x41ec('0x18')]=router; \ No newline at end of file diff --git a/server/api/intFreshdeskAccount/intFreshdeskAccount.attributes.js b/server/api/intFreshdeskAccount/intFreshdeskAccount.attributes.js index 3bfd30f..64d9ef5 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 _0x065e=['sequelize','STRING','username'];(function(_0x4d0df6,_0x4634f3){var _0x4e2615=function(_0x5285e2){while(--_0x5285e2){_0x4d0df6['push'](_0x4d0df6['shift']());}};_0x4e2615(++_0x4634f3);}(_0x065e,0x1a7));var _0xe065=function(_0xc3212e,_0x30e7ec){_0xc3212e=_0xc3212e-0x0;var _0x2fc81e=_0x065e[_0xc3212e];return _0x2fc81e;};'use strict';var Sequelize=require(_0xe065('0x0'));module['exports']={'name':{'type':Sequelize['STRING']},'description':{'type':Sequelize['STRING']},'username':{'type':Sequelize[_0xe065('0x1')],'unique':_0xe065('0x2')},'apiKey':{'type':Sequelize[_0xe065('0x1')]},'remoteUri':{'type':Sequelize['STRING'],'unique':'remoteUri'},'serverUrl':{'type':Sequelize[_0xe065('0x1')],'allowNull':![]}}; \ No newline at end of file +var _0x0adf=['remoteUri','sequelize','exports','STRING','username'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x0adf,0x1d2));var _0xf0ad=function(_0x3947b6,_0x499ec6){_0x3947b6=_0x3947b6-0x0;var _0x3bde14=_0x0adf[_0x3947b6];return _0x3bde14;};'use strict';var Sequelize=require(_0xf0ad('0x0'));module[_0xf0ad('0x1')]={'name':{'type':Sequelize[_0xf0ad('0x2')]},'description':{'type':Sequelize['STRING']},'username':{'type':Sequelize[_0xf0ad('0x2')],'unique':_0xf0ad('0x3')},'apiKey':{'type':Sequelize[_0xf0ad('0x2')]},'remoteUri':{'type':Sequelize[_0xf0ad('0x2')],'unique':_0xf0ad('0x4')},'serverUrl':{'type':Sequelize[_0xf0ad('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 10e369a..1111bbc 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 _0x25a3=['merge','options','FreshdeskAccount','includeAll','include','findAll','rows','catch','show','keys','create','body','params','find','findOne','pick','getConfigurations','hasOwnProperty','addConfiguration','AccountId','Subjects','getSubjects','Descriptions','getDescriptions','channel','FreshdeskConfiguration','FreshdeskField','getFields','apiKey','slice','substring','lastIndexOf','GET','format','%s/%s','api/v2/ticket_fields','Basic\x20%s','%s:X','base64','requester','subject','priority','ticket_type','group','company','includes','default','custom_text','label','choices','capitalize','test','statusCode','getFields,\x20%s,\x20%s,\x20%s','stringify','eml-format','rimraf','zip-dir','request-promise','bluebird','mustache','util','sox','to-csv','ejs','squel','crypto','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/license/util','../../mysqldb','../../components/integrations/configuration','sendStatus','end','status','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','destroy','then','error','stack','name','send','index','map','rawAttributes','fieldName','type','model','query','filters','intersection','attributes','fields','length','nolimit','order','sort','where','filter'];(function(_0x21a9d9,_0x4d5ac8){var _0x46adce=function(_0xfdd336){while(--_0xfdd336){_0x21a9d9['push'](_0x21a9d9['shift']());}};_0x46adce(++_0x4d5ac8);}(_0x25a3,0x121));var _0x325a=function(_0x3ac374,_0x4a5aca){_0x3ac374=_0x3ac374-0x0;var _0xc7b061=_0x25a3[_0x3ac374];return _0xc7b061;};'use strict';var emlformat=require(_0x325a('0x0'));var rimraf=require(_0x325a('0x1'));var zipdir=require(_0x325a('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x325a('0x3'));var moment=require('moment');var BPromise=require(_0x325a('0x4'));var Mustache=require(_0x325a('0x5'));var util=require(_0x325a('0x6'));var path=require('path');var sox=require(_0x325a('0x7'));var csv=require(_0x325a('0x8'));var ejs=require(_0x325a('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0x325a('0xa'));var crypto=require(_0x325a('0xb'));var jsforce=require(_0x325a('0xc'));var deskjs=require(_0x325a('0xd'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x325a('0xe'));var Redis=require(_0x325a('0xf'));var authService=require(_0x325a('0x10'));var qs=require(_0x325a('0x11'));var as=require(_0x325a('0x12'));var hardwareService=require(_0x325a('0x13'));var logger=require('../../config/logger')(_0x325a('0x14'));var utils=require(_0x325a('0x15'));var config=require('../../config/environment');var licenseUtil=require(_0x325a('0x16'));var db=require(_0x325a('0x17'))['db'];var integrations=require(_0x325a('0x18'));function respondWithStatusCode(_0x3e90fe,_0x4e3b88){_0x4e3b88=_0x4e3b88||0xcc;return function(_0x596519){if(_0x596519){return _0x3e90fe[_0x325a('0x19')](_0x4e3b88);}return _0x3e90fe['status'](_0x4e3b88)[_0x325a('0x1a')]();};}function respondWithResult(_0xa8dc3a,_0x3db556){_0x3db556=_0x3db556||0xc8;return function(_0x28d6d3){if(_0x28d6d3){return _0xa8dc3a[_0x325a('0x1b')](_0x3db556)[_0x325a('0x1c')](_0x28d6d3);}};}function respondWithFilteredResult(_0x1d7efc,_0x4412ba){return function(_0x1fd4ec){if(_0x1fd4ec){var _0x1b0f33=typeof _0x4412ba[_0x325a('0x1d')]===_0x325a('0x1e')&&typeof _0x4412ba[_0x325a('0x1f')]===_0x325a('0x1e');var _0x4d934d=_0x1fd4ec[_0x325a('0x20')];var _0x4fbd50=_0x1b0f33?0x0:_0x4412ba['offset'];var _0x34c4c8=_0x1b0f33?_0x1fd4ec[_0x325a('0x20')]:_0x4412ba[_0x325a('0x1d')]+_0x4412ba[_0x325a('0x1f')];var _0x1ea710;if(_0x34c4c8>=_0x4d934d){_0x34c4c8=_0x4d934d;_0x1ea710=0xc8;}else{_0x1ea710=0xce;}_0x1d7efc[_0x325a('0x1b')](_0x1ea710);return _0x1d7efc[_0x325a('0x21')](_0x325a('0x22'),_0x4fbd50+'-'+_0x34c4c8+'/'+_0x4d934d)[_0x325a('0x1c')](_0x1fd4ec);}return null;};}function patchUpdates(_0x1d76b7){return function(_0x36c634){try{jsonpatch[_0x325a('0x23')](_0x36c634,_0x1d76b7,!![]);}catch(_0x5bd4e5){return BPromise[_0x325a('0x24')](_0x5bd4e5);}return _0x36c634[_0x325a('0x25')]();};}function saveUpdates(_0x18e29f,_0x192e83){return function(_0x2535ef){if(_0x2535ef){return _0x2535ef[_0x325a('0x26')](_0x18e29f)['then'](function(_0x36b2ac){return _0x36b2ac;});}return null;};}function removeEntity(_0x4c403d,_0x15b5a6){return function(_0x3e6934){if(_0x3e6934){return _0x3e6934[_0x325a('0x27')]()[_0x325a('0x28')](function(){_0x4c403d[_0x325a('0x1b')](0xcc)['end']();});}};}function handleEntityNotFound(_0x29543e,_0x4b4155){return function(_0x13e86b){if(!_0x13e86b){_0x29543e[_0x325a('0x19')](0x194);}return _0x13e86b;};}function handleError(_0x41d0d2,_0x5ad31d){_0x5ad31d=_0x5ad31d||0x1f4;return function(_0x2ff37a){logger[_0x325a('0x29')](_0x2ff37a[_0x325a('0x2a')]);if(_0x2ff37a[_0x325a('0x2b')]){delete _0x2ff37a[_0x325a('0x2b')];}_0x41d0d2[_0x325a('0x1b')](_0x5ad31d)[_0x325a('0x2c')](_0x2ff37a);};}exports[_0x325a('0x2d')]=function(_0x44468d,_0x5cdfd1){var _0x201e01={},_0x3fa4f6={},_0xb10b39={'count':0x0,'rows':[]};var _0x19a3b0=_[_0x325a('0x2e')](db['FreshdeskAccount'][_0x325a('0x2f')],function(_0x4b1e46){return{'name':_0x4b1e46[_0x325a('0x30')],'type':_0x4b1e46[_0x325a('0x31')]['key']};});_0x3fa4f6[_0x325a('0x32')]=_[_0x325a('0x2e')](_0x19a3b0,_0x325a('0x2b'));_0x3fa4f6[_0x325a('0x33')]=_['keys'](_0x44468d[_0x325a('0x33')]);_0x3fa4f6[_0x325a('0x34')]=_[_0x325a('0x35')](_0x3fa4f6[_0x325a('0x32')],_0x3fa4f6['query']);_0x201e01[_0x325a('0x36')]=_[_0x325a('0x35')](_0x3fa4f6[_0x325a('0x32')],qs[_0x325a('0x37')](_0x44468d[_0x325a('0x33')][_0x325a('0x37')]));_0x201e01['attributes']=_0x201e01[_0x325a('0x36')][_0x325a('0x38')]?_0x201e01['attributes']:_0x3fa4f6[_0x325a('0x32')];if(!_0x44468d[_0x325a('0x33')]['hasOwnProperty'](_0x325a('0x39'))){_0x201e01['limit']=qs[_0x325a('0x1f')](_0x44468d[_0x325a('0x33')][_0x325a('0x1f')]);_0x201e01[_0x325a('0x1d')]=qs['offset'](_0x44468d[_0x325a('0x33')]['offset']);}_0x201e01[_0x325a('0x3a')]=qs['sort'](_0x44468d['query'][_0x325a('0x3b')]);_0x201e01[_0x325a('0x3c')]=qs[_0x325a('0x34')](_['pick'](_0x44468d[_0x325a('0x33')],_0x3fa4f6['filters']),_0x19a3b0);if(_0x44468d[_0x325a('0x33')][_0x325a('0x3d')]){_0x201e01[_0x325a('0x3c')]=_[_0x325a('0x3e')](_0x201e01[_0x325a('0x3c')],{'$or':_[_0x325a('0x2e')](_0x19a3b0,function(_0x10b7bf){if(_0x10b7bf[_0x325a('0x31')]!=='VIRTUAL'){var _0x45b9cc={};_0x45b9cc[_0x10b7bf[_0x325a('0x2b')]]={'$like':'%'+_0x44468d[_0x325a('0x33')][_0x325a('0x3d')]+'%'};return _0x45b9cc;}})});}_0x201e01=_[_0x325a('0x3e')]({},_0x201e01,_0x44468d[_0x325a('0x3f')]);var _0x1adb83={'where':_0x201e01[_0x325a('0x3c')]};return db[_0x325a('0x40')]['count'](_0x1adb83)[_0x325a('0x28')](function(_0x2eed88){_0xb10b39[_0x325a('0x20')]=_0x2eed88;if(_0x44468d[_0x325a('0x33')][_0x325a('0x41')]){_0x201e01[_0x325a('0x42')]=[{'all':!![]}];}return db[_0x325a('0x40')][_0x325a('0x43')](_0x201e01);})[_0x325a('0x28')](function(_0xefcc28){_0xb10b39[_0x325a('0x44')]=_0xefcc28;return _0xb10b39;})['then'](respondWithFilteredResult(_0x5cdfd1,_0x201e01))[_0x325a('0x45')](handleError(_0x5cdfd1,null));};exports[_0x325a('0x46')]=function(_0x415825,_0x128d53){var _0x2750dd={'raw':![],'where':{'id':_0x415825['params']['id']}},_0x39a6f7={};_0x39a6f7[_0x325a('0x32')]=_[_0x325a('0x47')](db[_0x325a('0x40')][_0x325a('0x2f')]);_0x39a6f7[_0x325a('0x33')]=_['keys'](_0x415825[_0x325a('0x33')]);_0x39a6f7[_0x325a('0x34')]=_[_0x325a('0x35')](_0x39a6f7['model'],_0x39a6f7[_0x325a('0x33')]);_0x2750dd[_0x325a('0x36')]=_[_0x325a('0x35')](_0x39a6f7['model'],qs['fields'](_0x415825[_0x325a('0x33')][_0x325a('0x37')]));_0x2750dd[_0x325a('0x36')]=_0x2750dd[_0x325a('0x36')]['length']?_0x2750dd[_0x325a('0x36')]:_0x39a6f7[_0x325a('0x32')];if(_0x415825['query'][_0x325a('0x41')]){_0x2750dd[_0x325a('0x42')]=[{'all':!![]}];}_0x2750dd=_['merge']({},_0x2750dd,_0x415825[_0x325a('0x3f')]);return db[_0x325a('0x40')]['find'](_0x2750dd)[_0x325a('0x28')](handleEntityNotFound(_0x128d53,null))['then'](respondWithResult(_0x128d53,null))['catch'](handleError(_0x128d53,null));};exports[_0x325a('0x48')]=function(_0x26721a,_0x7486ba){return db['FreshdeskAccount'][_0x325a('0x48')](_0x26721a[_0x325a('0x49')],{})['then'](respondWithResult(_0x7486ba,0xc9))['catch'](handleError(_0x7486ba,null));};exports[_0x325a('0x26')]=function(_0x2002c4,_0x5ac946){if(_0x2002c4[_0x325a('0x49')]['id']){delete _0x2002c4['body']['id'];}return db['FreshdeskAccount']['find']({'where':{'id':_0x2002c4[_0x325a('0x4a')]['id']}})[_0x325a('0x28')](handleEntityNotFound(_0x5ac946,null))['then'](saveUpdates(_0x2002c4[_0x325a('0x49')],null))[_0x325a('0x28')](respondWithResult(_0x5ac946,null))['catch'](handleError(_0x5ac946,null));};exports[_0x325a('0x27')]=function(_0x2d00c4,_0x12a4c6){return db[_0x325a('0x40')][_0x325a('0x4b')]({'where':{'id':_0x2d00c4[_0x325a('0x4a')]['id']}})['then'](handleEntityNotFound(_0x12a4c6,null))[_0x325a('0x28')](removeEntity(_0x12a4c6,null))[_0x325a('0x45')](handleError(_0x12a4c6,null));};exports['getConfigurations']=function(_0x189b23,_0x508514,_0x2ed4ed){var _0x264cda={};var _0x2c938a={};var _0x454aca;var _0x2854e6;return db[_0x325a('0x40')][_0x325a('0x4c')]({'where':{'id':_0x189b23[_0x325a('0x4a')]['id']}})[_0x325a('0x28')](handleEntityNotFound(_0x508514,null))[_0x325a('0x28')](function(_0x52a211){if(_0x52a211){_0x454aca=_0x52a211;_0x2c938a[_0x325a('0x32')]=_[_0x325a('0x47')](db['FreshdeskConfiguration'][_0x325a('0x2f')]);_0x2c938a[_0x325a('0x33')]=_[_0x325a('0x47')](_0x189b23[_0x325a('0x33')]);_0x2c938a[_0x325a('0x34')]=_[_0x325a('0x35')](_0x2c938a[_0x325a('0x32')],_0x2c938a[_0x325a('0x33')]);_0x264cda[_0x325a('0x36')]=_[_0x325a('0x35')](_0x2c938a[_0x325a('0x32')],qs[_0x325a('0x37')](_0x189b23[_0x325a('0x33')][_0x325a('0x37')]));_0x264cda['attributes']=_0x264cda[_0x325a('0x36')][_0x325a('0x38')]?_0x264cda[_0x325a('0x36')]:_0x2c938a[_0x325a('0x32')];_0x264cda[_0x325a('0x3a')]=qs[_0x325a('0x3b')](_0x189b23[_0x325a('0x33')][_0x325a('0x3b')]);_0x264cda[_0x325a('0x3c')]=qs[_0x325a('0x34')](_[_0x325a('0x4d')](_0x189b23[_0x325a('0x33')],_0x2c938a['filters']));if(_0x189b23[_0x325a('0x33')][_0x325a('0x3d')]){_0x264cda['where']=_[_0x325a('0x3e')](_0x264cda[_0x325a('0x3c')],{'$or':_[_0x325a('0x2e')](_0x264cda['attributes'],function(_0x55eb10){var _0x44af6b={};_0x44af6b[_0x55eb10]={'$like':'%'+_0x189b23[_0x325a('0x33')][_0x325a('0x3d')]+'%'};return _0x44af6b;})});}_0x264cda=_[_0x325a('0x3e')]({},_0x264cda,_0x189b23[_0x325a('0x3f')]);return _0x454aca[_0x325a('0x4e')](_0x264cda);}})[_0x325a('0x28')](function(_0x12d276){if(_0x12d276){_0x2854e6=_0x12d276['length'];if(!_0x189b23[_0x325a('0x33')][_0x325a('0x4f')](_0x325a('0x39'))){_0x264cda[_0x325a('0x1f')]=qs[_0x325a('0x1f')](_0x189b23[_0x325a('0x33')][_0x325a('0x1f')]);_0x264cda[_0x325a('0x1d')]=qs[_0x325a('0x1d')](_0x189b23[_0x325a('0x33')][_0x325a('0x1d')]);}return _0x454aca[_0x325a('0x4e')](_0x264cda);}})[_0x325a('0x28')](function(_0xcdfbc2){if(_0xcdfbc2){return _0xcdfbc2?{'count':_0x2854e6,'rows':_0xcdfbc2}:null;}})['then'](respondWithResult(_0x508514,null))[_0x325a('0x45')](handleError(_0x508514,null));};exports[_0x325a('0x50')]=function(_0x5c7681,_0x3a7d44,_0x415524){if(_0x5c7681[_0x325a('0x49')]['id']){delete _0x5c7681[_0x325a('0x49')]['id'];}return db[_0x325a('0x40')][_0x325a('0x4c')]({'where':{'id':_0x5c7681['params']['id']}})[_0x325a('0x28')](handleEntityNotFound(_0x3a7d44,null))[_0x325a('0x28')](function(_0x286572){if(_0x286572){_0x5c7681[_0x325a('0x49')][_0x325a('0x51')]=_0x286572['id'];_0x5c7681['body'][_0x325a('0x52')]=integrations[_0x325a('0x53')](_0x5c7681['body']['channel'],_0x5c7681[_0x325a('0x49')]['type']);_0x5c7681['body'][_0x325a('0x54')]=integrations[_0x325a('0x55')](_0x5c7681['body'][_0x325a('0x56')],_0x5c7681[_0x325a('0x49')]['type']);return db[_0x325a('0x57')]['create'](_0x5c7681[_0x325a('0x49')],{'include':[{'model':db[_0x325a('0x58')],'as':_0x325a('0x52')},{'model':db[_0x325a('0x58')],'as':_0x325a('0x54')}]});}return null;})[_0x325a('0x28')](respondWithResult(_0x3a7d44,null))['catch'](handleError(_0x3a7d44,null));};exports[_0x325a('0x59')]=function(_0x2ddfa0,_0x3b9520,_0x5168de){var _0x47e360='';return db['FreshdeskAccount'][_0x325a('0x4c')]({'where':{'id':_0x2ddfa0[_0x325a('0x4a')]['id']},'attributes':['id','remoteUri',_0x325a('0x5a')]})[_0x325a('0x28')](handleEntityNotFound(_0x3b9520,null))['then'](function(_0x423fd5){if(_0x423fd5){_0x47e360=_0x423fd5['remoteUri'];var _0xa1cacf=_0x47e360[_0x325a('0x5b')](-0x1);if(_0xa1cacf==='/'){_0x47e360=_0x47e360[_0x325a('0x5c')](0x0,_0x47e360[_0x325a('0x5d')](_0xa1cacf));}return rp({'method':_0x325a('0x5e'),'uri':util[_0x325a('0x5f')](_0x325a('0x60'),_0x47e360,_0x325a('0x61')),'headers':{'Authorization':util[_0x325a('0x5f')](_0x325a('0x62'),new Buffer(util[_0x325a('0x5f')](_0x325a('0x63'),_0x423fd5[_0x325a('0x5a')]))['toString'](_0x325a('0x64')))},'json':!![]});}})[_0x325a('0x28')](function(_0x54acd0){if(_0x54acd0){var _0x1c5d62=[_0x325a('0x65'),_0x325a('0x66'),'agent','description',_0x325a('0x1b'),_0x325a('0x67'),'group','source',_0x325a('0x68'),_0x325a('0x69'),_0x325a('0x6a')];_['remove'](_0x54acd0,function(_0x1cbe07){return _0x1c5d62[_0x325a('0x6b')](_0x1cbe07['name'])||!_0x1cbe07[_0x325a('0x6c')]&&_0x1cbe07[_0x325a('0x31')]!==_0x325a('0x6d')&&_0x1cbe07[_0x325a('0x31')]!=='custom_dropdown';});return{'count':_0x54acd0[_0x325a('0x38')],'rows':_[_0x325a('0x2e')](_0x54acd0,function(_0x398f31){return{'id':_0x398f31[_0x325a('0x2b')],'name':_0x398f31[_0x325a('0x6e')],'custom':!_0x398f31[_0x325a('0x6c')],'options':_0x398f31[_0x325a('0x6f')]?_[_0x325a('0x2e')](_0x398f31['choices'],function(_0x4c33a4){return{'name':_[_0x325a('0x70')](_0x4c33a4),'value':_0x4c33a4};}):[]};})};}})['then'](respondWithResult(_0x3b9520,null))[_0x325a('0x45')](function(_0x573c8){var _0x32a397=_0x2ddfa0[_0x325a('0x33')][_0x325a('0x71')]?0x1f4:_0x573c8[_0x325a('0x72')]||0x1f4;logger[_0x325a('0x29')](_0x325a('0x73'),_0x325a('0x59'),_0x32a397,JSON[_0x325a('0x74')](_0x573c8));delete _0x573c8[_0x325a('0x2b')];if(_0x32a397===0x191){_0x32a397=0x190;}_0x3b9520[_0x325a('0x1b')](_0x32a397)['send'](_0x2ddfa0[_0x325a('0x33')]['test']?{'message':'Wrong\x20credentials','statusCode':_0x573c8[_0x325a('0x72')]}:_0x573c8);});}; \ No newline at end of file +var _0x4746=['sendStatus','status','end','json','offset','undefined','limit','count','set','apply','reject','save','update','destroy','then','error','stack','name','map','FreshdeskAccount','rawAttributes','fieldName','type','model','query','intersection','fields','attributes','hasOwnProperty','nolimit','order','sort','where','filters','pick','filter','merge','options','include','findAll','rows','show','find','catch','create','body','params','getConfigurations','findOne','keys','FreshdeskConfiguration','length','addConfiguration','AccountId','getSubjects','channel','Descriptions','FreshdeskField','getFields','apiKey','remoteUri','substring','lastIndexOf','%s/%s','format','Basic\x20%s','%s:X','toString','requester','subject','agent','description','priority','source','ticket_type','company','remove','includes','default','custom_text','custom_dropdown','label','choices','test','getFields,\x20%s,\x20%s,\x20%s','stringify','send','Wrong\x20credentials','eml-format','rimraf','fast-json-patch','moment','bluebird','mustache','util','path','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','papaparse','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','../../config/utils','../../config/license/util','../../mysqldb'];(function(_0x28e1e6,_0x8f23cb){var _0x5ca171=function(_0x3e9275){while(--_0x3e9275){_0x28e1e6['push'](_0x28e1e6['shift']());}};_0x5ca171(++_0x8f23cb);}(_0x4746,0xc6));var _0x6474=function(_0x41fa87,_0x119133){_0x41fa87=_0x41fa87-0x0;var _0x2f4ad1=_0x4746[_0x41fa87];return _0x2f4ad1;};'use strict';var emlformat=require(_0x6474('0x0'));var rimraf=require(_0x6474('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x6474('0x2'));var rp=require('request-promise');var moment=require(_0x6474('0x3'));var BPromise=require(_0x6474('0x4'));var Mustache=require(_0x6474('0x5'));var util=require(_0x6474('0x6'));var path=require(_0x6474('0x7'));var sox=require('sox');var csv=require(_0x6474('0x8'));var ejs=require(_0x6474('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x6474('0xa'));var squel=require(_0x6474('0xb'));var crypto=require(_0x6474('0xc'));var jsforce=require(_0x6474('0xd'));var deskjs=require(_0x6474('0xe'));var toCsv=require(_0x6474('0x8'));var querystring=require('querystring');var Papa=require(_0x6474('0xf'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0x6474('0x10'));var as=require(_0x6474('0x11'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x6474('0x12'))('api');var utils=require(_0x6474('0x13'));var config=require('../../config/environment');var licenseUtil=require(_0x6474('0x14'));var db=require(_0x6474('0x15'))['db'];var integrations=require('../../components/integrations/configuration');function respondWithStatusCode(_0x4936c2,_0x5cf0de){_0x5cf0de=_0x5cf0de||0xcc;return function(_0x23c805){if(_0x23c805){return _0x4936c2[_0x6474('0x16')](_0x5cf0de);}return _0x4936c2[_0x6474('0x17')](_0x5cf0de)[_0x6474('0x18')]();};}function respondWithResult(_0x113aba,_0x37fe08){_0x37fe08=_0x37fe08||0xc8;return function(_0x407149){if(_0x407149){return _0x113aba[_0x6474('0x17')](_0x37fe08)[_0x6474('0x19')](_0x407149);}};}function respondWithFilteredResult(_0x5cf8fa,_0x5ee279){return function(_0x583afa){if(_0x583afa){var _0x205df7=typeof _0x5ee279[_0x6474('0x1a')]===_0x6474('0x1b')&&typeof _0x5ee279[_0x6474('0x1c')]===_0x6474('0x1b');var _0x502755=_0x583afa[_0x6474('0x1d')];var _0x7585ed=_0x205df7?0x0:_0x5ee279[_0x6474('0x1a')];var _0xc3448d=_0x205df7?_0x583afa[_0x6474('0x1d')]:_0x5ee279[_0x6474('0x1a')]+_0x5ee279[_0x6474('0x1c')];var _0x47029c;if(_0xc3448d>=_0x502755){_0xc3448d=_0x502755;_0x47029c=0xc8;}else{_0x47029c=0xce;}_0x5cf8fa['status'](_0x47029c);return _0x5cf8fa[_0x6474('0x1e')]('Content-Range',_0x7585ed+'-'+_0xc3448d+'/'+_0x502755)[_0x6474('0x19')](_0x583afa);}return null;};}function patchUpdates(_0x1df53c){return function(_0x2be8fe){try{jsonpatch[_0x6474('0x1f')](_0x2be8fe,_0x1df53c,!![]);}catch(_0x271b12){return BPromise[_0x6474('0x20')](_0x271b12);}return _0x2be8fe[_0x6474('0x21')]();};}function saveUpdates(_0x5d0e5c,_0xf3cd65){return function(_0x5f44f1){if(_0x5f44f1){return _0x5f44f1[_0x6474('0x22')](_0x5d0e5c)['then'](function(_0x4ba645){return _0x4ba645;});}return null;};}function removeEntity(_0x58e024,_0xb67896){return function(_0x340fb6){if(_0x340fb6){return _0x340fb6[_0x6474('0x23')]()[_0x6474('0x24')](function(){_0x58e024[_0x6474('0x17')](0xcc)['end']();});}};}function handleEntityNotFound(_0x7020fb,_0x388d2d){return function(_0x46bf4f){if(!_0x46bf4f){_0x7020fb[_0x6474('0x16')](0x194);}return _0x46bf4f;};}function handleError(_0x559b33,_0x587b7a){_0x587b7a=_0x587b7a||0x1f4;return function(_0x38a5a4){logger[_0x6474('0x25')](_0x38a5a4[_0x6474('0x26')]);if(_0x38a5a4[_0x6474('0x27')]){delete _0x38a5a4['name'];}_0x559b33['status'](_0x587b7a)['send'](_0x38a5a4);};}exports['index']=function(_0x3333a8,_0x28d445){var _0x1751bc={},_0x2387e9={},_0x52e64b={'count':0x0,'rows':[]};var _0x13af68=_[_0x6474('0x28')](db[_0x6474('0x29')][_0x6474('0x2a')],function(_0x2a3ad0){return{'name':_0x2a3ad0[_0x6474('0x2b')],'type':_0x2a3ad0[_0x6474('0x2c')]['key']};});_0x2387e9[_0x6474('0x2d')]=_[_0x6474('0x28')](_0x13af68,_0x6474('0x27'));_0x2387e9[_0x6474('0x2e')]=_['keys'](_0x3333a8['query']);_0x2387e9['filters']=_[_0x6474('0x2f')](_0x2387e9[_0x6474('0x2d')],_0x2387e9[_0x6474('0x2e')]);_0x1751bc['attributes']=_[_0x6474('0x2f')](_0x2387e9[_0x6474('0x2d')],qs[_0x6474('0x30')](_0x3333a8['query'][_0x6474('0x30')]));_0x1751bc[_0x6474('0x31')]=_0x1751bc[_0x6474('0x31')]['length']?_0x1751bc[_0x6474('0x31')]:_0x2387e9[_0x6474('0x2d')];if(!_0x3333a8['query'][_0x6474('0x32')](_0x6474('0x33'))){_0x1751bc[_0x6474('0x1c')]=qs[_0x6474('0x1c')](_0x3333a8[_0x6474('0x2e')]['limit']);_0x1751bc[_0x6474('0x1a')]=qs[_0x6474('0x1a')](_0x3333a8['query']['offset']);}_0x1751bc[_0x6474('0x34')]=qs['sort'](_0x3333a8[_0x6474('0x2e')][_0x6474('0x35')]);_0x1751bc[_0x6474('0x36')]=qs[_0x6474('0x37')](_[_0x6474('0x38')](_0x3333a8['query'],_0x2387e9['filters']),_0x13af68);if(_0x3333a8[_0x6474('0x2e')][_0x6474('0x39')]){_0x1751bc[_0x6474('0x36')]=_['merge'](_0x1751bc[_0x6474('0x36')],{'$or':_['map'](_0x13af68,function(_0xf5f16f){if(_0xf5f16f['type']!=='VIRTUAL'){var _0x53be2e={};_0x53be2e[_0xf5f16f[_0x6474('0x27')]]={'$like':'%'+_0x3333a8[_0x6474('0x2e')][_0x6474('0x39')]+'%'};return _0x53be2e;}})});}_0x1751bc=_[_0x6474('0x3a')]({},_0x1751bc,_0x3333a8[_0x6474('0x3b')]);var _0x29bb36={'where':_0x1751bc['where']};return db[_0x6474('0x29')][_0x6474('0x1d')](_0x29bb36)['then'](function(_0xca2394){_0x52e64b[_0x6474('0x1d')]=_0xca2394;if(_0x3333a8[_0x6474('0x2e')]['includeAll']){_0x1751bc[_0x6474('0x3c')]=[{'all':!![]}];}return db[_0x6474('0x29')][_0x6474('0x3d')](_0x1751bc);})['then'](function(_0x5c1153){_0x52e64b[_0x6474('0x3e')]=_0x5c1153;return _0x52e64b;})[_0x6474('0x24')](respondWithFilteredResult(_0x28d445,_0x1751bc))['catch'](handleError(_0x28d445,null));};exports[_0x6474('0x3f')]=function(_0x44ed73,_0x9bdba5){var _0x1a4bde={'raw':![],'where':{'id':_0x44ed73['params']['id']}},_0x49590d={};_0x49590d[_0x6474('0x2d')]=_['keys'](db[_0x6474('0x29')][_0x6474('0x2a')]);_0x49590d[_0x6474('0x2e')]=_['keys'](_0x44ed73[_0x6474('0x2e')]);_0x49590d[_0x6474('0x37')]=_['intersection'](_0x49590d[_0x6474('0x2d')],_0x49590d[_0x6474('0x2e')]);_0x1a4bde[_0x6474('0x31')]=_[_0x6474('0x2f')](_0x49590d[_0x6474('0x2d')],qs[_0x6474('0x30')](_0x44ed73[_0x6474('0x2e')]['fields']));_0x1a4bde[_0x6474('0x31')]=_0x1a4bde[_0x6474('0x31')]['length']?_0x1a4bde[_0x6474('0x31')]:_0x49590d[_0x6474('0x2d')];if(_0x44ed73['query']['includeAll']){_0x1a4bde['include']=[{'all':!![]}];}_0x1a4bde=_['merge']({},_0x1a4bde,_0x44ed73[_0x6474('0x3b')]);return db[_0x6474('0x29')][_0x6474('0x40')](_0x1a4bde)[_0x6474('0x24')](handleEntityNotFound(_0x9bdba5,null))['then'](respondWithResult(_0x9bdba5,null))[_0x6474('0x41')](handleError(_0x9bdba5,null));};exports[_0x6474('0x42')]=function(_0x1c411e,_0x29ffac){return db[_0x6474('0x29')][_0x6474('0x42')](_0x1c411e['body'],{})[_0x6474('0x24')](respondWithResult(_0x29ffac,0xc9))[_0x6474('0x41')](handleError(_0x29ffac,null));};exports[_0x6474('0x22')]=function(_0x495666,_0x2d83e5){if(_0x495666[_0x6474('0x43')]['id']){delete _0x495666['body']['id'];}return db[_0x6474('0x29')][_0x6474('0x40')]({'where':{'id':_0x495666[_0x6474('0x44')]['id']}})[_0x6474('0x24')](handleEntityNotFound(_0x2d83e5,null))[_0x6474('0x24')](saveUpdates(_0x495666[_0x6474('0x43')],null))[_0x6474('0x24')](respondWithResult(_0x2d83e5,null))['catch'](handleError(_0x2d83e5,null));};exports[_0x6474('0x23')]=function(_0x3697a0,_0x231a02){return db['FreshdeskAccount'][_0x6474('0x40')]({'where':{'id':_0x3697a0[_0x6474('0x44')]['id']}})[_0x6474('0x24')](handleEntityNotFound(_0x231a02,null))['then'](removeEntity(_0x231a02,null))['catch'](handleError(_0x231a02,null));};exports[_0x6474('0x45')]=function(_0x3cc8ad,_0x4ce208,_0x5a4335){var _0xed51b5={};var _0x4e1e3b={};var _0x9b3bc0;var _0x409e55;return db[_0x6474('0x29')][_0x6474('0x46')]({'where':{'id':_0x3cc8ad[_0x6474('0x44')]['id']}})[_0x6474('0x24')](handleEntityNotFound(_0x4ce208,null))[_0x6474('0x24')](function(_0x451080){if(_0x451080){_0x9b3bc0=_0x451080;_0x4e1e3b[_0x6474('0x2d')]=_[_0x6474('0x47')](db[_0x6474('0x48')][_0x6474('0x2a')]);_0x4e1e3b[_0x6474('0x2e')]=_['keys'](_0x3cc8ad[_0x6474('0x2e')]);_0x4e1e3b['filters']=_['intersection'](_0x4e1e3b[_0x6474('0x2d')],_0x4e1e3b[_0x6474('0x2e')]);_0xed51b5[_0x6474('0x31')]=_[_0x6474('0x2f')](_0x4e1e3b['model'],qs[_0x6474('0x30')](_0x3cc8ad[_0x6474('0x2e')][_0x6474('0x30')]));_0xed51b5[_0x6474('0x31')]=_0xed51b5[_0x6474('0x31')][_0x6474('0x49')]?_0xed51b5[_0x6474('0x31')]:_0x4e1e3b[_0x6474('0x2d')];_0xed51b5[_0x6474('0x34')]=qs[_0x6474('0x35')](_0x3cc8ad[_0x6474('0x2e')][_0x6474('0x35')]);_0xed51b5['where']=qs['filters'](_[_0x6474('0x38')](_0x3cc8ad[_0x6474('0x2e')],_0x4e1e3b[_0x6474('0x37')]));if(_0x3cc8ad[_0x6474('0x2e')][_0x6474('0x39')]){_0xed51b5[_0x6474('0x36')]=_[_0x6474('0x3a')](_0xed51b5['where'],{'$or':_['map'](_0xed51b5[_0x6474('0x31')],function(_0x242870){var _0x2db5d7={};_0x2db5d7[_0x242870]={'$like':'%'+_0x3cc8ad['query'][_0x6474('0x39')]+'%'};return _0x2db5d7;})});}_0xed51b5=_[_0x6474('0x3a')]({},_0xed51b5,_0x3cc8ad['options']);return _0x9b3bc0[_0x6474('0x45')](_0xed51b5);}})['then'](function(_0x152459){if(_0x152459){_0x409e55=_0x152459[_0x6474('0x49')];if(!_0x3cc8ad[_0x6474('0x2e')][_0x6474('0x32')]('nolimit')){_0xed51b5[_0x6474('0x1c')]=qs[_0x6474('0x1c')](_0x3cc8ad[_0x6474('0x2e')][_0x6474('0x1c')]);_0xed51b5[_0x6474('0x1a')]=qs[_0x6474('0x1a')](_0x3cc8ad[_0x6474('0x2e')][_0x6474('0x1a')]);}return _0x9b3bc0[_0x6474('0x45')](_0xed51b5);}})[_0x6474('0x24')](function(_0x4a1560){if(_0x4a1560){return _0x4a1560?{'count':_0x409e55,'rows':_0x4a1560}:null;}})[_0x6474('0x24')](respondWithResult(_0x4ce208,null))['catch'](handleError(_0x4ce208,null));};exports[_0x6474('0x4a')]=function(_0x40182c,_0x273854,_0x3d8139){if(_0x40182c[_0x6474('0x43')]['id']){delete _0x40182c[_0x6474('0x43')]['id'];}return db[_0x6474('0x29')][_0x6474('0x46')]({'where':{'id':_0x40182c['params']['id']}})[_0x6474('0x24')](handleEntityNotFound(_0x273854,null))['then'](function(_0x173ad6){if(_0x173ad6){_0x40182c[_0x6474('0x43')][_0x6474('0x4b')]=_0x173ad6['id'];_0x40182c['body']['Subjects']=integrations[_0x6474('0x4c')](_0x40182c[_0x6474('0x43')][_0x6474('0x4d')],_0x40182c['body'][_0x6474('0x2c')]);_0x40182c['body'][_0x6474('0x4e')]=integrations['getDescriptions'](_0x40182c['body']['channel'],_0x40182c[_0x6474('0x43')][_0x6474('0x2c')]);return db[_0x6474('0x48')][_0x6474('0x42')](_0x40182c['body'],{'include':[{'model':db[_0x6474('0x4f')],'as':'Subjects'},{'model':db[_0x6474('0x4f')],'as':_0x6474('0x4e')}]});}return null;})['then'](respondWithResult(_0x273854,null))['catch'](handleError(_0x273854,null));};exports[_0x6474('0x50')]=function(_0x30f9fe,_0x26ab00,_0x9f1ec0){var _0x58a86c='';return db['FreshdeskAccount'][_0x6474('0x46')]({'where':{'id':_0x30f9fe[_0x6474('0x44')]['id']},'attributes':['id','remoteUri',_0x6474('0x51')]})[_0x6474('0x24')](handleEntityNotFound(_0x26ab00,null))[_0x6474('0x24')](function(_0x2a49f8){if(_0x2a49f8){_0x58a86c=_0x2a49f8[_0x6474('0x52')];var _0x4fa53b=_0x58a86c['slice'](-0x1);if(_0x4fa53b==='/'){_0x58a86c=_0x58a86c[_0x6474('0x53')](0x0,_0x58a86c[_0x6474('0x54')](_0x4fa53b));}return rp({'method':'GET','uri':util['format'](_0x6474('0x55'),_0x58a86c,'api/v2/ticket_fields'),'headers':{'Authorization':util[_0x6474('0x56')](_0x6474('0x57'),new Buffer(util[_0x6474('0x56')](_0x6474('0x58'),_0x2a49f8[_0x6474('0x51')]))[_0x6474('0x59')]('base64'))},'json':!![]});}})[_0x6474('0x24')](function(_0xc4fc20){if(_0xc4fc20){var _0x1e2746=[_0x6474('0x5a'),_0x6474('0x5b'),_0x6474('0x5c'),_0x6474('0x5d'),_0x6474('0x17'),_0x6474('0x5e'),'group',_0x6474('0x5f'),_0x6474('0x60'),'group',_0x6474('0x61')];_[_0x6474('0x62')](_0xc4fc20,function(_0x268cee){return _0x1e2746[_0x6474('0x63')](_0x268cee[_0x6474('0x27')])||!_0x268cee[_0x6474('0x64')]&&_0x268cee[_0x6474('0x2c')]!==_0x6474('0x65')&&_0x268cee[_0x6474('0x2c')]!==_0x6474('0x66');});return{'count':_0xc4fc20[_0x6474('0x49')],'rows':_[_0x6474('0x28')](_0xc4fc20,function(_0x361fa4){return{'id':_0x361fa4[_0x6474('0x27')],'name':_0x361fa4[_0x6474('0x67')],'custom':!_0x361fa4[_0x6474('0x64')],'options':_0x361fa4[_0x6474('0x68')]?_[_0x6474('0x28')](_0x361fa4[_0x6474('0x68')],function(_0x22e676){return{'name':_['capitalize'](_0x22e676),'value':_0x22e676};}):[]};})};}})[_0x6474('0x24')](respondWithResult(_0x26ab00,null))[_0x6474('0x41')](function(_0x20cd4e){var _0x2bca17=_0x30f9fe[_0x6474('0x2e')][_0x6474('0x69')]?0x1f4:_0x20cd4e['statusCode']||0x1f4;logger['error'](_0x6474('0x6a'),_0x6474('0x50'),_0x2bca17,JSON[_0x6474('0x6b')](_0x20cd4e));delete _0x20cd4e['name'];if(_0x2bca17===0x191){_0x2bca17=0x190;}_0x26ab00[_0x6474('0x17')](_0x2bca17)[_0x6474('0x6c')](_0x30f9fe['query']['test']?{'message':_0x6474('0x6d'),'statusCode':_0x20cd4e['statusCode']}:_0x20cd4e);});}; \ No newline at end of file diff --git a/server/api/intFreshdeskAccount/intFreshdeskAccount.model.js b/server/api/intFreshdeskAccount/intFreshdeskAccount.model.js index 6948a42..3377c87 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 _0x2da9=['bluebird','request-promise','../../config/environment','./intFreshdeskAccount.attributes','../../components/integrations/configuration','exports','define','FreshdeskAccount','int_freshdesk_accounts','lodash','../../config/logger','api','moment'];(function(_0x5122c7,_0x50103d){var _0x2b487b=function(_0x332463){while(--_0x332463){_0x5122c7['push'](_0x5122c7['shift']());}};_0x2b487b(++_0x50103d);}(_0x2da9,0x1d0));var _0x92da=function(_0x3c8f5f,_0x4ed370){_0x3c8f5f=_0x3c8f5f-0x0;var _0x4ed868=_0x2da9[_0x3c8f5f];return _0x4ed868;};'use strict';var _=require(_0x92da('0x0'));var util=require('util');var logger=require(_0x92da('0x1'))(_0x92da('0x2'));var moment=require(_0x92da('0x3'));var BPromise=require(_0x92da('0x4'));var rp=require(_0x92da('0x5'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0x92da('0x6'));var attributes=require(_0x92da('0x7'));var integrations=require(_0x92da('0x8'));module[_0x92da('0x9')]=function(_0x59f8be,_0x46b952){return _0x59f8be[_0x92da('0xa')](_0x92da('0xb'),attributes,{'tableName':_0x92da('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x0181=['FreshdeskAccount','int_freshdesk_accounts','util','../../config/logger','moment','request-promise','../../config/environment','./intFreshdeskAccount.attributes','define'];(function(_0x486129,_0x59fcc9){var _0x42d2da=function(_0x2dcc4d){while(--_0x2dcc4d){_0x486129['push'](_0x486129['shift']());}};_0x42d2da(++_0x59fcc9);}(_0x0181,0x158));var _0x1018=function(_0x29d915,_0x54a040){_0x29d915=_0x29d915-0x0;var _0x160f86=_0x0181[_0x29d915];return _0x160f86;};'use strict';var _=require('lodash');var util=require(_0x1018('0x0'));var logger=require(_0x1018('0x1'))('api');var moment=require(_0x1018('0x2'));var BPromise=require('bluebird');var rp=require(_0x1018('0x3'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0x1018('0x4'));var attributes=require(_0x1018('0x5'));var integrations=require('../../components/integrations/configuration');module['exports']=function(_0x32960d,_0x436e2e){return _0x32960d[_0x1018('0x6')](_0x1018('0x7'),attributes,{'tableName':_0x1018('0x8'),'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 92a32cb..3e41be8 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 _0xdbd0=['../../config/environment','jayson/promise','client','http','request','then','request\x20sent','debug','FreshdeskAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','FreshdeskAccount,\x20%s,\x20%s','message','info','catch','findAll','options','where','attributes','map','include','model','GetFreshdeskAccount','ShowFreshdeskAccount','FreshdeskAccount','find','raw','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger'];(function(_0x141c2c,_0x8cf393){var _0x302935=function(_0x513d05){while(--_0x513d05){_0x141c2c['push'](_0x141c2c['shift']());}};_0x302935(++_0x8cf393);}(_0xdbd0,0x88));var _0x0dbd=function(_0x3f12b1,_0x7d3a9c){_0x3f12b1=_0x3f12b1-0x0;var _0xa89515=_0xdbd0[_0x3f12b1];return _0xa89515;};'use strict';var _=require(_0x0dbd('0x0'));var util=require(_0x0dbd('0x1'));var moment=require(_0x0dbd('0x2'));var BPromise=require(_0x0dbd('0x3'));var rs=require(_0x0dbd('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x0dbd('0x5'))['db'];var utils=require(_0x0dbd('0x6'));var logger=require(_0x0dbd('0x7'))('rpc');var config=require(_0x0dbd('0x8'));var jayson=require(_0x0dbd('0x9'));var client=jayson[_0x0dbd('0xa')][_0x0dbd('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x4b653b,_0x47e742,_0xcb72c2){return new BPromise(function(_0x3b3f21,_0x1a957e){return client[_0x0dbd('0xc')](_0x4b653b,_0xcb72c2)[_0x0dbd('0xd')](function(_0x453836){logger['info']('FreshdeskAccount,\x20%s,\x20%s',_0x47e742,_0x0dbd('0xe'));logger[_0x0dbd('0xf')](_0x0dbd('0x10'),_0x47e742,_0x0dbd('0xe'),JSON[_0x0dbd('0x11')](_0x453836));if(_0x453836[_0x0dbd('0x12')]){if(_0x453836[_0x0dbd('0x12')][_0x0dbd('0x13')]===0x1f4){logger['error'](_0x0dbd('0x14'),_0x47e742,_0x453836[_0x0dbd('0x12')][_0x0dbd('0x15')]);return _0x1a957e(_0x453836['error'][_0x0dbd('0x15')]);}logger[_0x0dbd('0x12')](_0x0dbd('0x14'),_0x47e742,_0x453836[_0x0dbd('0x12')][_0x0dbd('0x15')]);return _0x3b3f21(_0x453836[_0x0dbd('0x12')][_0x0dbd('0x15')]);}else{logger[_0x0dbd('0x16')](_0x0dbd('0x14'),_0x47e742,'request\x20sent');_0x3b3f21(_0x453836['result'][_0x0dbd('0x15')]);}})[_0x0dbd('0x17')](function(_0x5b2a34){logger[_0x0dbd('0x12')](_0x0dbd('0x14'),_0x47e742,_0x5b2a34);_0x1a957e(_0x5b2a34);});});}exports['GetFreshdeskAccount']=function(_0x500fc6){var _0xcbad4b=this;return new Promise(function(_0x23db13,_0x24ac9d){return db['FreshdeskAccount'][_0x0dbd('0x18')]({'raw':_0x500fc6[_0x0dbd('0x19')]?_0x500fc6['options']['raw']===undefined?!![]:![]:!![],'where':_0x500fc6[_0x0dbd('0x19')]?_0x500fc6[_0x0dbd('0x19')][_0x0dbd('0x1a')]||null:null,'attributes':_0x500fc6['options']?_0x500fc6['options'][_0x0dbd('0x1b')]||null:null,'limit':_0x500fc6[_0x0dbd('0x19')]?_0x500fc6['options']['limit']||null:null,'include':_0x500fc6[_0x0dbd('0x19')]?_0x500fc6[_0x0dbd('0x19')]['include']?_[_0x0dbd('0x1c')](_0x500fc6[_0x0dbd('0x19')][_0x0dbd('0x1d')],function(_0x524a84){return{'model':db[_0x524a84[_0x0dbd('0x1e')]],'as':_0x524a84['as'],'attributes':_0x524a84[_0x0dbd('0x1b')],'include':_0x524a84['include']?_[_0x0dbd('0x1c')](_0x524a84[_0x0dbd('0x1d')],function(_0x563185){return{'model':db[_0x563185[_0x0dbd('0x1e')]],'as':_0x563185['as'],'attributes':_0x563185[_0x0dbd('0x1b')],'include':_0x563185['include']?_[_0x0dbd('0x1c')](_0x563185[_0x0dbd('0x1d')],function(_0x66a345){return{'model':db[_0x66a345[_0x0dbd('0x1e')]],'as':_0x66a345['as'],'attributes':_0x66a345[_0x0dbd('0x1b')]};}):[]};}):[]};}):[]:[]})[_0x0dbd('0xd')](function(_0x4938d9){logger['info']('GetFreshdeskAccount',_0x500fc6);logger[_0x0dbd('0xf')]('GetFreshdeskAccount',_0x500fc6,JSON[_0x0dbd('0x11')](_0x4938d9));_0x23db13(_0x4938d9);})['catch'](function(_0x57fd18){logger[_0x0dbd('0x12')](_0x0dbd('0x1f'),_0x57fd18[_0x0dbd('0x15')],_0x500fc6);_0x24ac9d(_0xcbad4b[_0x0dbd('0x12')](0x1f4,_0x57fd18['message']));});});};exports[_0x0dbd('0x20')]=function(_0x327fba){var _0x1366ce=this;return new Promise(function(_0x52b8ee,_0x467d49){return db[_0x0dbd('0x21')][_0x0dbd('0x22')]({'raw':_0x327fba[_0x0dbd('0x19')]?_0x327fba['options'][_0x0dbd('0x23')]===undefined?!![]:![]:!![],'where':_0x327fba[_0x0dbd('0x19')]?_0x327fba[_0x0dbd('0x19')][_0x0dbd('0x1a')]||null:null,'attributes':_0x327fba['options']?_0x327fba[_0x0dbd('0x19')][_0x0dbd('0x1b')]||null:null,'include':_0x327fba[_0x0dbd('0x19')]?_0x327fba['options'][_0x0dbd('0x1d')]?_[_0x0dbd('0x1c')](_0x327fba[_0x0dbd('0x19')]['include'],function(_0x7252ec){return{'model':db[_0x7252ec['model']],'as':_0x7252ec['as'],'attributes':_0x7252ec[_0x0dbd('0x1b')],'include':_0x7252ec['include']?_['map'](_0x7252ec['include'],function(_0x5a5f09){return{'model':db[_0x5a5f09[_0x0dbd('0x1e')]],'as':_0x5a5f09['as'],'attributes':_0x5a5f09[_0x0dbd('0x1b')],'include':_0x5a5f09['include']?_[_0x0dbd('0x1c')](_0x5a5f09[_0x0dbd('0x1d')],function(_0x5452f0){return{'model':db[_0x5452f0[_0x0dbd('0x1e')]],'as':_0x5452f0['as'],'attributes':_0x5452f0[_0x0dbd('0x1b')]};}):[]};}):[]};}):[]:[]})[_0x0dbd('0xd')](function(_0x59e81c){logger['info']('ShowFreshdeskAccount',_0x327fba);logger[_0x0dbd('0xf')]('ShowFreshdeskAccount',_0x327fba,JSON['stringify'](_0x59e81c));_0x52b8ee(_0x59e81c);})[_0x0dbd('0x17')](function(_0x47c920){logger[_0x0dbd('0x12')](_0x0dbd('0x20'),_0x47c920[_0x0dbd('0x15')],_0x327fba);_0x467d49(_0x1366ce[_0x0dbd('0x12')](0x1f4,_0x47c920[_0x0dbd('0x15')]));});});}; \ No newline at end of file +var _0x96b2=['info','request\x20sent','debug','FreshdeskAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','FreshdeskAccount,\x20%s,\x20%s','message','catch','GetFreshdeskAccount','FreshdeskAccount','findAll','options','raw','attributes','include','model','map','find','ShowFreshdeskAccount','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','request','then'];(function(_0x595d48,_0x3a5ad1){var _0x472d1c=function(_0x4a8700){while(--_0x4a8700){_0x595d48['push'](_0x595d48['shift']());}};_0x472d1c(++_0x3a5ad1);}(_0x96b2,0x1cf));var _0x296b=function(_0x5d570b,_0x28659f){_0x5d570b=_0x5d570b-0x0;var _0x833180=_0x96b2[_0x5d570b];return _0x833180;};'use strict';var _=require('lodash');var util=require(_0x296b('0x0'));var moment=require(_0x296b('0x1'));var BPromise=require(_0x296b('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x296b('0x3'));var db=require(_0x296b('0x4'))['db'];var utils=require(_0x296b('0x5'));var logger=require('../../config/logger')(_0x296b('0x6'));var config=require(_0x296b('0x7'));var jayson=require(_0x296b('0x8'));var client=jayson[_0x296b('0x9')][_0x296b('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x1243ca,_0x538fa9,_0x59d822){return new BPromise(function(_0x5fe136,_0x22d3a2){return client[_0x296b('0xb')](_0x1243ca,_0x59d822)[_0x296b('0xc')](function(_0x3959da){logger[_0x296b('0xd')]('FreshdeskAccount,\x20%s,\x20%s',_0x538fa9,_0x296b('0xe'));logger[_0x296b('0xf')](_0x296b('0x10'),_0x538fa9,'request\x20sent',JSON[_0x296b('0x11')](_0x3959da));if(_0x3959da['error']){if(_0x3959da[_0x296b('0x12')][_0x296b('0x13')]===0x1f4){logger[_0x296b('0x12')](_0x296b('0x14'),_0x538fa9,_0x3959da[_0x296b('0x12')]['message']);return _0x22d3a2(_0x3959da[_0x296b('0x12')][_0x296b('0x15')]);}logger[_0x296b('0x12')]('FreshdeskAccount,\x20%s,\x20%s',_0x538fa9,_0x3959da[_0x296b('0x12')][_0x296b('0x15')]);return _0x5fe136(_0x3959da[_0x296b('0x12')][_0x296b('0x15')]);}else{logger['info'](_0x296b('0x14'),_0x538fa9,_0x296b('0xe'));_0x5fe136(_0x3959da['result'][_0x296b('0x15')]);}})[_0x296b('0x16')](function(_0x194a2f){logger[_0x296b('0x12')](_0x296b('0x14'),_0x538fa9,_0x194a2f);_0x22d3a2(_0x194a2f);});});}exports[_0x296b('0x17')]=function(_0x5a6bbd){var _0x60f3b=this;return new Promise(function(_0x5e44ca,_0x11327c){return db[_0x296b('0x18')][_0x296b('0x19')]({'raw':_0x5a6bbd[_0x296b('0x1a')]?_0x5a6bbd[_0x296b('0x1a')][_0x296b('0x1b')]===undefined?!![]:![]:!![],'where':_0x5a6bbd[_0x296b('0x1a')]?_0x5a6bbd[_0x296b('0x1a')]['where']||null:null,'attributes':_0x5a6bbd['options']?_0x5a6bbd['options'][_0x296b('0x1c')]||null:null,'limit':_0x5a6bbd[_0x296b('0x1a')]?_0x5a6bbd[_0x296b('0x1a')]['limit']||null:null,'include':_0x5a6bbd[_0x296b('0x1a')]?_0x5a6bbd[_0x296b('0x1a')]['include']?_['map'](_0x5a6bbd[_0x296b('0x1a')][_0x296b('0x1d')],function(_0xc210e1){return{'model':db[_0xc210e1[_0x296b('0x1e')]],'as':_0xc210e1['as'],'attributes':_0xc210e1[_0x296b('0x1c')],'include':_0xc210e1[_0x296b('0x1d')]?_[_0x296b('0x1f')](_0xc210e1[_0x296b('0x1d')],function(_0x4c08b1){return{'model':db[_0x4c08b1['model']],'as':_0x4c08b1['as'],'attributes':_0x4c08b1[_0x296b('0x1c')],'include':_0x4c08b1[_0x296b('0x1d')]?_[_0x296b('0x1f')](_0x4c08b1[_0x296b('0x1d')],function(_0x1f84b4){return{'model':db[_0x1f84b4[_0x296b('0x1e')]],'as':_0x1f84b4['as'],'attributes':_0x1f84b4['attributes']};}):[]};}):[]};}):[]:[]})[_0x296b('0xc')](function(_0x3c0b1d){logger[_0x296b('0xd')]('GetFreshdeskAccount',_0x5a6bbd);logger['debug'](_0x296b('0x17'),_0x5a6bbd,JSON[_0x296b('0x11')](_0x3c0b1d));_0x5e44ca(_0x3c0b1d);})[_0x296b('0x16')](function(_0x3ddee8){logger[_0x296b('0x12')](_0x296b('0x17'),_0x3ddee8[_0x296b('0x15')],_0x5a6bbd);_0x11327c(_0x60f3b[_0x296b('0x12')](0x1f4,_0x3ddee8[_0x296b('0x15')]));});});};exports['ShowFreshdeskAccount']=function(_0x510ebc){var _0x158f50=this;return new Promise(function(_0x35844c,_0x1009be){return db[_0x296b('0x18')][_0x296b('0x20')]({'raw':_0x510ebc[_0x296b('0x1a')]?_0x510ebc[_0x296b('0x1a')]['raw']===undefined?!![]:![]:!![],'where':_0x510ebc['options']?_0x510ebc['options']['where']||null:null,'attributes':_0x510ebc['options']?_0x510ebc[_0x296b('0x1a')][_0x296b('0x1c')]||null:null,'include':_0x510ebc[_0x296b('0x1a')]?_0x510ebc[_0x296b('0x1a')]['include']?_[_0x296b('0x1f')](_0x510ebc[_0x296b('0x1a')][_0x296b('0x1d')],function(_0x5d2d05){return{'model':db[_0x5d2d05[_0x296b('0x1e')]],'as':_0x5d2d05['as'],'attributes':_0x5d2d05['attributes'],'include':_0x5d2d05[_0x296b('0x1d')]?_[_0x296b('0x1f')](_0x5d2d05[_0x296b('0x1d')],function(_0x1493b3){return{'model':db[_0x1493b3['model']],'as':_0x1493b3['as'],'attributes':_0x1493b3[_0x296b('0x1c')],'include':_0x1493b3[_0x296b('0x1d')]?_[_0x296b('0x1f')](_0x1493b3['include'],function(_0x44ee25){return{'model':db[_0x44ee25[_0x296b('0x1e')]],'as':_0x44ee25['as'],'attributes':_0x44ee25[_0x296b('0x1c')]};}):[]};}):[]};}):[]:[]})[_0x296b('0xc')](function(_0x3c0494){logger['info'](_0x296b('0x21'),_0x510ebc);logger['debug'](_0x296b('0x21'),_0x510ebc,JSON['stringify'](_0x3c0494));_0x35844c(_0x3c0494);})[_0x296b('0x16')](function(_0x256f7d){logger[_0x296b('0x12')](_0x296b('0x21'),_0x256f7d[_0x296b('0x15')],_0x510ebc);_0x1009be(_0x158f50['error'](0x1f4,_0x256f7d[_0x296b('0x15')]));});});}; \ No newline at end of file diff --git a/server/api/intFreshdeskConfiguration/index.js b/server/api/intFreshdeskConfiguration/index.js index bf123bc..31e66d3 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 _0x3828=['get','isAuthenticated','/:id','getFields','/:id/subjects','getSubjects','/:id/descriptions','getDescriptions','/:id/tags','getTags','post','create','setTags','put','delete','destroy','exports','multer','util','path','express','Router','fs-extra','../../components/interaction/service','../../config/environment'];(function(_0x47d060,_0x4a2b1d){var _0xb2d051=function(_0x3434e7){while(--_0x3434e7){_0x47d060['push'](_0x47d060['shift']());}};_0xb2d051(++_0x4a2b1d);}(_0x3828,0x1d3));var _0x8382=function(_0x4b369d,_0x265eb8){_0x4b369d=_0x4b369d-0x0;var _0x571a98=_0x3828[_0x4b369d];return _0x571a98;};'use strict';var multer=require(_0x8382('0x0'));var util=require(_0x8382('0x1'));var path=require(_0x8382('0x2'));var timeout=require('connect-timeout');var express=require(_0x8382('0x3'));var router=express[_0x8382('0x4')]();var fs_extra=require(_0x8382('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0x8382('0x6'));var config=require(_0x8382('0x7'));var controller=require('./intFreshdeskConfiguration.controller');router[_0x8382('0x8')]('/',auth[_0x8382('0x9')](),controller['index']);router['get'](_0x8382('0xa'),auth[_0x8382('0x9')](),controller['show']);router[_0x8382('0x8')]('/:id/fields',auth[_0x8382('0x9')](),controller[_0x8382('0xb')]);router[_0x8382('0x8')](_0x8382('0xc'),auth['isAuthenticated'](),controller[_0x8382('0xd')]);router['get'](_0x8382('0xe'),auth[_0x8382('0x9')](),controller[_0x8382('0xf')]);router[_0x8382('0x8')](_0x8382('0x10'),auth[_0x8382('0x9')](),controller[_0x8382('0x11')]);router[_0x8382('0x12')]('/',auth[_0x8382('0x9')](),controller[_0x8382('0x13')]);router[_0x8382('0x12')]('/:id/tags',auth[_0x8382('0x9')](),controller[_0x8382('0x14')]);router[_0x8382('0x15')](_0x8382('0xa'),auth['isAuthenticated'](),controller['update']);router[_0x8382('0x16')](_0x8382('0xa'),auth[_0x8382('0x9')](),controller[_0x8382('0x17')]);module[_0x8382('0x18')]=router; \ No newline at end of file +var _0x0b76=['/:id/fields','getFields','/:id/subjects','getDescriptions','/:id/tags','getTags','post','setTags','update','delete','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./intFreshdeskConfiguration.controller','get','isAuthenticated','index','/:id','show'];(function(_0x11db97,_0x28a6c5){var _0xb6fb02=function(_0x203286){while(--_0x203286){_0x11db97['push'](_0x11db97['shift']());}};_0xb6fb02(++_0x28a6c5);}(_0x0b76,0xc0));var _0x60b7=function(_0x1bfca8,_0x27e9a9){_0x1bfca8=_0x1bfca8-0x0;var _0x4f08c2=_0x0b76[_0x1bfca8];return _0x4f08c2;};'use strict';var multer=require(_0x60b7('0x0'));var util=require(_0x60b7('0x1'));var path=require(_0x60b7('0x2'));var timeout=require(_0x60b7('0x3'));var express=require(_0x60b7('0x4'));var router=express[_0x60b7('0x5')]();var fs_extra=require(_0x60b7('0x6'));var auth=require(_0x60b7('0x7'));var interaction=require(_0x60b7('0x8'));var config=require(_0x60b7('0x9'));var controller=require(_0x60b7('0xa'));router[_0x60b7('0xb')]('/',auth[_0x60b7('0xc')](),controller[_0x60b7('0xd')]);router[_0x60b7('0xb')](_0x60b7('0xe'),auth[_0x60b7('0xc')](),controller[_0x60b7('0xf')]);router[_0x60b7('0xb')](_0x60b7('0x10'),auth['isAuthenticated'](),controller[_0x60b7('0x11')]);router['get'](_0x60b7('0x12'),auth[_0x60b7('0xc')](),controller['getSubjects']);router[_0x60b7('0xb')]('/:id/descriptions',auth[_0x60b7('0xc')](),controller[_0x60b7('0x13')]);router[_0x60b7('0xb')](_0x60b7('0x14'),auth[_0x60b7('0xc')](),controller[_0x60b7('0x15')]);router[_0x60b7('0x16')]('/',auth[_0x60b7('0xc')](),controller['create']);router['post'](_0x60b7('0x14'),auth[_0x60b7('0xc')](),controller[_0x60b7('0x17')]);router['put'](_0x60b7('0xe'),auth[_0x60b7('0xc')](),controller[_0x60b7('0x18')]);router[_0x60b7('0x19')]('/:id',auth[_0x60b7('0xc')](),controller['destroy']);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 0caac5a..331312d 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 _0x5bc5=['STRING','sequelize'];(function(_0x99d551,_0x42347d){var _0x4427c=function(_0xe9b6fb){while(--_0xe9b6fb){_0x99d551['push'](_0x99d551['shift']());}};_0x4427c(++_0x42347d);}(_0x5bc5,0x17b));var _0x55bc=function(_0x10dfdf,_0x36b623){_0x10dfdf=_0x10dfdf-0x0;var _0x4d857d=_0x5bc5[_0x10dfdf];return _0x4d857d;};'use strict';var Sequelize=require(_0x55bc('0x0'));module['exports']={'name':{'type':Sequelize[_0x55bc('0x1')]},'description':{'type':Sequelize[_0x55bc('0x1')]}}; \ No newline at end of file +var _0x34fb=['exports','STRING'];(function(_0x10f059,_0xb56fdd){var _0x4ab4ed=function(_0x4419b9){while(--_0x4419b9){_0x10f059['push'](_0x10f059['shift']());}};_0x4ab4ed(++_0xb56fdd);}(_0x34fb,0x1ca));var _0xb34f=function(_0x1bcf57,_0x550f1a){_0x1bcf57=_0x1bcf57-0x0;var _0x22b2ed=_0x34fb[_0x1bcf57];return _0x22b2ed;};'use strict';var Sequelize=require('sequelize');module[_0xb34f('0x0')]={'name':{'type':Sequelize[_0xb34f('0x1')]},'description':{'type':Sequelize['STRING']}}; \ No newline at end of file diff --git a/server/api/intFreshdeskConfiguration/intFreshdeskConfiguration.controller.js b/server/api/intFreshdeskConfiguration/intFreshdeskConfiguration.controller.js index 6447cde..d672e73 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 _0x5deb=['getFields','findOne','FreshdeskField','order','pick','getSubjects','getDescriptions','getTags','Tag','setTags','ids','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','end','json','undefined','limit','count','offset','Content-Range','apply','save','update','destroy','then','error','stack','name','send','index','map','FreshdeskConfiguration','rawAttributes','fieldName','model','query','filters','attributes','intersection','fields','length','hasOwnProperty','nolimit','sort','filter','where','merge','type','VIRTUAL','options','includeAll','include','findAll','rows','show','params','keys','find','catch','create','body'];(function(_0x18a577,_0x25560c){var _0x1cb0c7=function(_0x195eeb){while(--_0x195eeb){_0x18a577['push'](_0x18a577['shift']());}};_0x1cb0c7(++_0x25560c);}(_0x5deb,0x1be));var _0xb5de=function(_0x54bfa9,_0x424d55){_0x54bfa9=_0x54bfa9-0x0;var _0x160e13=_0x5deb[_0x54bfa9];return _0x160e13;};'use strict';var emlformat=require(_0xb5de('0x0'));var rimraf=require(_0xb5de('0x1'));var zipdir=require(_0xb5de('0x2'));var jsonpatch=require(_0xb5de('0x3'));var rp=require(_0xb5de('0x4'));var moment=require(_0xb5de('0x5'));var BPromise=require('bluebird');var Mustache=require(_0xb5de('0x6'));var util=require(_0xb5de('0x7'));var path=require(_0xb5de('0x8'));var sox=require(_0xb5de('0x9'));var csv=require(_0xb5de('0xa'));var ejs=require(_0xb5de('0xb'));var fs=require('fs');var fs_extra=require(_0xb5de('0xc'));var _=require(_0xb5de('0xd'));var squel=require(_0xb5de('0xe'));var crypto=require(_0xb5de('0xf'));var jsforce=require(_0xb5de('0x10'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0xb5de('0x11'));var authService=require(_0xb5de('0x12'));var qs=require(_0xb5de('0x13'));var as=require(_0xb5de('0x14'));var hardwareService=require(_0xb5de('0x15'));var logger=require(_0xb5de('0x16'))('api');var utils=require(_0xb5de('0x17'));var config=require('../../config/environment');var licenseUtil=require(_0xb5de('0x18'));var db=require(_0xb5de('0x19'))['db'];function respondWithStatusCode(_0x1780dd,_0x5f5970){_0x5f5970=_0x5f5970||0xcc;return function(_0xf56797){if(_0xf56797){return _0x1780dd[_0xb5de('0x1a')](_0x5f5970);}return _0x1780dd[_0xb5de('0x1b')](_0x5f5970)[_0xb5de('0x1c')]();};}function respondWithResult(_0x424160,_0x2d66b1){_0x2d66b1=_0x2d66b1||0xc8;return function(_0x53b9fc){if(_0x53b9fc){return _0x424160[_0xb5de('0x1b')](_0x2d66b1)[_0xb5de('0x1d')](_0x53b9fc);}};}function respondWithFilteredResult(_0x3727ad,_0x5ebbb9){return function(_0x20dcac){if(_0x20dcac){var _0x43dc43=typeof _0x5ebbb9['offset']===_0xb5de('0x1e')&&typeof _0x5ebbb9[_0xb5de('0x1f')]==='undefined';var _0x5af024=_0x20dcac[_0xb5de('0x20')];var _0xc882b=_0x43dc43?0x0:_0x5ebbb9[_0xb5de('0x21')];var _0x5e82ab=_0x43dc43?_0x20dcac[_0xb5de('0x20')]:_0x5ebbb9[_0xb5de('0x21')]+_0x5ebbb9['limit'];var _0x2af9db;if(_0x5e82ab>=_0x5af024){_0x5e82ab=_0x5af024;_0x2af9db=0xc8;}else{_0x2af9db=0xce;}_0x3727ad[_0xb5de('0x1b')](_0x2af9db);return _0x3727ad['set'](_0xb5de('0x22'),_0xc882b+'-'+_0x5e82ab+'/'+_0x5af024)[_0xb5de('0x1d')](_0x20dcac);}return null;};}function patchUpdates(_0x2033b0){return function(_0xac8228){try{jsonpatch[_0xb5de('0x23')](_0xac8228,_0x2033b0,!![]);}catch(_0x1dc0e5){return BPromise['reject'](_0x1dc0e5);}return _0xac8228[_0xb5de('0x24')]();};}function saveUpdates(_0x21623c,_0x333685){return function(_0x1ba62c){if(_0x1ba62c){return _0x1ba62c[_0xb5de('0x25')](_0x21623c)['then'](function(_0x506c97){return _0x506c97;});}return null;};}function removeEntity(_0x424e32,_0x183466){return function(_0x360595){if(_0x360595){return _0x360595[_0xb5de('0x26')]()[_0xb5de('0x27')](function(){_0x424e32['status'](0xcc)[_0xb5de('0x1c')]();});}};}function handleEntityNotFound(_0x44e7a1,_0x19a19a){return function(_0x130d83){if(!_0x130d83){_0x44e7a1[_0xb5de('0x1a')](0x194);}return _0x130d83;};}function handleError(_0x16bf69,_0x34405a){_0x34405a=_0x34405a||0x1f4;return function(_0x56b8ae){logger[_0xb5de('0x28')](_0x56b8ae[_0xb5de('0x29')]);if(_0x56b8ae[_0xb5de('0x2a')]){delete _0x56b8ae['name'];}_0x16bf69[_0xb5de('0x1b')](_0x34405a)[_0xb5de('0x2b')](_0x56b8ae);};}exports[_0xb5de('0x2c')]=function(_0x1de6f4,_0x4080d7){var _0x1d0e35={},_0x37f8c8={},_0x122f99={'count':0x0,'rows':[]};var _0x1281ff=_[_0xb5de('0x2d')](db[_0xb5de('0x2e')][_0xb5de('0x2f')],function(_0x5dd35e){return{'name':_0x5dd35e[_0xb5de('0x30')],'type':_0x5dd35e['type']['key']};});_0x37f8c8[_0xb5de('0x31')]=_[_0xb5de('0x2d')](_0x1281ff,_0xb5de('0x2a'));_0x37f8c8[_0xb5de('0x32')]=_['keys'](_0x1de6f4[_0xb5de('0x32')]);_0x37f8c8[_0xb5de('0x33')]=_['intersection'](_0x37f8c8[_0xb5de('0x31')],_0x37f8c8[_0xb5de('0x32')]);_0x1d0e35[_0xb5de('0x34')]=_[_0xb5de('0x35')](_0x37f8c8['model'],qs[_0xb5de('0x36')](_0x1de6f4[_0xb5de('0x32')][_0xb5de('0x36')]));_0x1d0e35[_0xb5de('0x34')]=_0x1d0e35[_0xb5de('0x34')][_0xb5de('0x37')]?_0x1d0e35[_0xb5de('0x34')]:_0x37f8c8[_0xb5de('0x31')];if(!_0x1de6f4[_0xb5de('0x32')][_0xb5de('0x38')](_0xb5de('0x39'))){_0x1d0e35[_0xb5de('0x1f')]=qs[_0xb5de('0x1f')](_0x1de6f4[_0xb5de('0x32')][_0xb5de('0x1f')]);_0x1d0e35[_0xb5de('0x21')]=qs[_0xb5de('0x21')](_0x1de6f4[_0xb5de('0x32')][_0xb5de('0x21')]);}_0x1d0e35['order']=qs[_0xb5de('0x3a')](_0x1de6f4['query'][_0xb5de('0x3a')]);_0x1d0e35['where']=qs[_0xb5de('0x33')](_['pick'](_0x1de6f4[_0xb5de('0x32')],_0x37f8c8[_0xb5de('0x33')]),_0x1281ff);if(_0x1de6f4[_0xb5de('0x32')][_0xb5de('0x3b')]){_0x1d0e35[_0xb5de('0x3c')]=_[_0xb5de('0x3d')](_0x1d0e35[_0xb5de('0x3c')],{'$or':_[_0xb5de('0x2d')](_0x1281ff,function(_0x4ad197){if(_0x4ad197[_0xb5de('0x3e')]!==_0xb5de('0x3f')){var _0xf4beb2={};_0xf4beb2[_0x4ad197[_0xb5de('0x2a')]]={'$like':'%'+_0x1de6f4[_0xb5de('0x32')][_0xb5de('0x3b')]+'%'};return _0xf4beb2;}})});}_0x1d0e35=_[_0xb5de('0x3d')]({},_0x1d0e35,_0x1de6f4[_0xb5de('0x40')]);var _0x5d50b7={'where':_0x1d0e35[_0xb5de('0x3c')]};return db['FreshdeskConfiguration'][_0xb5de('0x20')](_0x5d50b7)['then'](function(_0x4e36c6){_0x122f99[_0xb5de('0x20')]=_0x4e36c6;if(_0x1de6f4[_0xb5de('0x32')][_0xb5de('0x41')]){_0x1d0e35[_0xb5de('0x42')]=[{'all':!![]}];}return db[_0xb5de('0x2e')][_0xb5de('0x43')](_0x1d0e35);})[_0xb5de('0x27')](function(_0x26eb13){_0x122f99[_0xb5de('0x44')]=_0x26eb13;return _0x122f99;})['then'](respondWithFilteredResult(_0x4080d7,_0x1d0e35))['catch'](handleError(_0x4080d7,null));};exports[_0xb5de('0x45')]=function(_0x580ef0,_0x4c0ede){var _0x2906ac={'raw':![],'where':{'id':_0x580ef0[_0xb5de('0x46')]['id']}},_0x322b9f={};_0x322b9f[_0xb5de('0x31')]=_[_0xb5de('0x47')](db[_0xb5de('0x2e')]['rawAttributes']);_0x322b9f[_0xb5de('0x32')]=_[_0xb5de('0x47')](_0x580ef0[_0xb5de('0x32')]);_0x322b9f[_0xb5de('0x33')]=_['intersection'](_0x322b9f[_0xb5de('0x31')],_0x322b9f[_0xb5de('0x32')]);_0x2906ac[_0xb5de('0x34')]=_[_0xb5de('0x35')](_0x322b9f[_0xb5de('0x31')],qs[_0xb5de('0x36')](_0x580ef0[_0xb5de('0x32')]['fields']));_0x2906ac[_0xb5de('0x34')]=_0x2906ac['attributes'][_0xb5de('0x37')]?_0x2906ac[_0xb5de('0x34')]:_0x322b9f[_0xb5de('0x31')];if(_0x580ef0[_0xb5de('0x32')]['includeAll']){_0x2906ac[_0xb5de('0x42')]=[{'all':!![]}];}_0x2906ac=_['merge']({},_0x2906ac,_0x580ef0[_0xb5de('0x40')]);return db[_0xb5de('0x2e')][_0xb5de('0x48')](_0x2906ac)[_0xb5de('0x27')](handleEntityNotFound(_0x4c0ede,null))[_0xb5de('0x27')](respondWithResult(_0x4c0ede,null))[_0xb5de('0x49')](handleError(_0x4c0ede,null));};exports[_0xb5de('0x4a')]=function(_0x58a520,_0x5873ae){return db[_0xb5de('0x2e')][_0xb5de('0x4a')](_0x58a520[_0xb5de('0x4b')],{})['then'](respondWithResult(_0x5873ae,0xc9))[_0xb5de('0x49')](handleError(_0x5873ae,null));};exports[_0xb5de('0x25')]=function(_0x27205b,_0x25e771){if(_0x27205b[_0xb5de('0x4b')]['id']){delete _0x27205b['body']['id'];}return db[_0xb5de('0x2e')][_0xb5de('0x48')]({'where':{'id':_0x27205b[_0xb5de('0x46')]['id']}})[_0xb5de('0x27')](handleEntityNotFound(_0x25e771,null))[_0xb5de('0x27')](saveUpdates(_0x27205b['body'],null))[_0xb5de('0x27')](respondWithResult(_0x25e771,null))[_0xb5de('0x49')](handleError(_0x25e771,null));};exports[_0xb5de('0x26')]=function(_0x41b4a1,_0x3ba52e){return db[_0xb5de('0x2e')][_0xb5de('0x48')]({'where':{'id':_0x41b4a1[_0xb5de('0x46')]['id']}})[_0xb5de('0x27')](handleEntityNotFound(_0x3ba52e,null))[_0xb5de('0x27')](removeEntity(_0x3ba52e,null))['catch'](handleError(_0x3ba52e,null));};exports[_0xb5de('0x4c')]=function(_0x2b6581,_0x6b25e6,_0x9a1278){var _0x3af256={};var _0x11c767={};var _0x345aae;var _0x4ef4b9;return db[_0xb5de('0x2e')][_0xb5de('0x4d')]({'where':{'id':_0x2b6581[_0xb5de('0x46')]['id']}})['then'](handleEntityNotFound(_0x6b25e6,null))[_0xb5de('0x27')](function(_0xb45c5d){if(_0xb45c5d){_0x345aae=_0xb45c5d;_0x11c767[_0xb5de('0x31')]=_['keys'](db[_0xb5de('0x4e')][_0xb5de('0x2f')]);_0x11c767[_0xb5de('0x32')]=_[_0xb5de('0x47')](_0x2b6581[_0xb5de('0x32')]);_0x11c767[_0xb5de('0x33')]=_[_0xb5de('0x35')](_0x11c767[_0xb5de('0x31')],_0x11c767[_0xb5de('0x32')]);_0x3af256[_0xb5de('0x34')]=_[_0xb5de('0x35')](_0x11c767['model'],qs[_0xb5de('0x36')](_0x2b6581['query'][_0xb5de('0x36')]));_0x3af256[_0xb5de('0x34')]=_0x3af256['attributes'][_0xb5de('0x37')]?_0x3af256['attributes']:_0x11c767[_0xb5de('0x31')];_0x3af256[_0xb5de('0x4f')]=qs[_0xb5de('0x3a')](_0x2b6581[_0xb5de('0x32')][_0xb5de('0x3a')]);_0x3af256[_0xb5de('0x3c')]=qs[_0xb5de('0x33')](_[_0xb5de('0x50')](_0x2b6581['query'],_0x11c767['filters']));if(_0x2b6581[_0xb5de('0x32')][_0xb5de('0x3b')]){_0x3af256[_0xb5de('0x3c')]=_[_0xb5de('0x3d')](_0x3af256[_0xb5de('0x3c')],{'$or':_[_0xb5de('0x2d')](_0x3af256[_0xb5de('0x34')],function(_0x7f9ade){var _0x204268={};_0x204268[_0x7f9ade]={'$like':'%'+_0x2b6581[_0xb5de('0x32')]['filter']+'%'};return _0x204268;})});}_0x3af256=_[_0xb5de('0x3d')]({},_0x3af256,_0x2b6581[_0xb5de('0x40')]);return _0x345aae[_0xb5de('0x4c')](_0x3af256);}})['then'](function(_0x1a6f5f){if(_0x1a6f5f){_0x4ef4b9=_0x1a6f5f['length'];if(!_0x2b6581['query']['hasOwnProperty'](_0xb5de('0x39'))){_0x3af256[_0xb5de('0x1f')]=qs[_0xb5de('0x1f')](_0x2b6581['query']['limit']);_0x3af256[_0xb5de('0x21')]=qs['offset'](_0x2b6581[_0xb5de('0x32')]['offset']);}return _0x345aae[_0xb5de('0x4c')](_0x3af256);}})['then'](function(_0x3a30e8){if(_0x3a30e8){return _0x3a30e8?{'count':_0x4ef4b9,'rows':_0x3a30e8}:null;}})['then'](respondWithResult(_0x6b25e6,null))[_0xb5de('0x49')](handleError(_0x6b25e6,null));};exports[_0xb5de('0x51')]=function(_0x71e80a,_0x10eeca,_0x207803){var _0xdb67be={};var _0x3688ba={};var _0x196b75;var _0x53375f;return db['FreshdeskConfiguration']['findOne']({'where':{'id':_0x71e80a[_0xb5de('0x46')]['id']}})[_0xb5de('0x27')](handleEntityNotFound(_0x10eeca,null))[_0xb5de('0x27')](function(_0x2e31b9){if(_0x2e31b9){_0x196b75=_0x2e31b9;_0x3688ba['model']=_['keys'](db[_0xb5de('0x4e')][_0xb5de('0x2f')]);_0x3688ba[_0xb5de('0x32')]=_[_0xb5de('0x47')](_0x71e80a[_0xb5de('0x32')]);_0x3688ba['filters']=_['intersection'](_0x3688ba['model'],_0x3688ba[_0xb5de('0x32')]);_0xdb67be[_0xb5de('0x34')]=_[_0xb5de('0x35')](_0x3688ba[_0xb5de('0x31')],qs[_0xb5de('0x36')](_0x71e80a['query']['fields']));_0xdb67be['attributes']=_0xdb67be['attributes'][_0xb5de('0x37')]?_0xdb67be[_0xb5de('0x34')]:_0x3688ba['model'];_0xdb67be['order']=qs['sort'](_0x71e80a['query'][_0xb5de('0x3a')]);_0xdb67be[_0xb5de('0x3c')]=qs[_0xb5de('0x33')](_[_0xb5de('0x50')](_0x71e80a['query'],_0x3688ba[_0xb5de('0x33')]));if(_0x71e80a[_0xb5de('0x32')]['filter']){_0xdb67be[_0xb5de('0x3c')]=_[_0xb5de('0x3d')](_0xdb67be[_0xb5de('0x3c')],{'$or':_[_0xb5de('0x2d')](_0xdb67be[_0xb5de('0x34')],function(_0x5995f7){var _0x11ade4={};_0x11ade4[_0x5995f7]={'$like':'%'+_0x71e80a['query'][_0xb5de('0x3b')]+'%'};return _0x11ade4;})});}_0xdb67be=_['merge']({},_0xdb67be,_0x71e80a['options']);return _0x196b75['getSubjects'](_0xdb67be);}})[_0xb5de('0x27')](function(_0x50b768){if(_0x50b768){_0x53375f=_0x50b768['length'];if(!_0x71e80a[_0xb5de('0x32')][_0xb5de('0x38')](_0xb5de('0x39'))){_0xdb67be[_0xb5de('0x1f')]=qs[_0xb5de('0x1f')](_0x71e80a[_0xb5de('0x32')][_0xb5de('0x1f')]);_0xdb67be[_0xb5de('0x21')]=qs['offset'](_0x71e80a[_0xb5de('0x32')]['offset']);}return _0x196b75[_0xb5de('0x51')](_0xdb67be);}})[_0xb5de('0x27')](function(_0x4b6dc1){if(_0x4b6dc1){return _0x4b6dc1?{'count':_0x53375f,'rows':_0x4b6dc1}:null;}})[_0xb5de('0x27')](respondWithResult(_0x10eeca,null))['catch'](handleError(_0x10eeca,null));};exports[_0xb5de('0x52')]=function(_0x8d6a72,_0x1d2570,_0x428754){var _0x5d697f={};var _0x23d262={};var _0x25f7be;var _0x1ad64a;return db[_0xb5de('0x2e')][_0xb5de('0x4d')]({'where':{'id':_0x8d6a72['params']['id']}})[_0xb5de('0x27')](handleEntityNotFound(_0x1d2570,null))[_0xb5de('0x27')](function(_0x41ab48){if(_0x41ab48){_0x25f7be=_0x41ab48;_0x23d262['model']=_[_0xb5de('0x47')](db[_0xb5de('0x4e')][_0xb5de('0x2f')]);_0x23d262[_0xb5de('0x32')]=_['keys'](_0x8d6a72['query']);_0x23d262[_0xb5de('0x33')]=_[_0xb5de('0x35')](_0x23d262['model'],_0x23d262[_0xb5de('0x32')]);_0x5d697f[_0xb5de('0x34')]=_[_0xb5de('0x35')](_0x23d262[_0xb5de('0x31')],qs[_0xb5de('0x36')](_0x8d6a72['query'][_0xb5de('0x36')]));_0x5d697f[_0xb5de('0x34')]=_0x5d697f[_0xb5de('0x34')][_0xb5de('0x37')]?_0x5d697f[_0xb5de('0x34')]:_0x23d262[_0xb5de('0x31')];_0x5d697f[_0xb5de('0x4f')]=qs[_0xb5de('0x3a')](_0x8d6a72[_0xb5de('0x32')][_0xb5de('0x3a')]);_0x5d697f[_0xb5de('0x3c')]=qs[_0xb5de('0x33')](_['pick'](_0x8d6a72[_0xb5de('0x32')],_0x23d262[_0xb5de('0x33')]));if(_0x8d6a72[_0xb5de('0x32')]['filter']){_0x5d697f[_0xb5de('0x3c')]=_[_0xb5de('0x3d')](_0x5d697f[_0xb5de('0x3c')],{'$or':_[_0xb5de('0x2d')](_0x5d697f[_0xb5de('0x34')],function(_0x1fe94e){var _0x1b2bc0={};_0x1b2bc0[_0x1fe94e]={'$like':'%'+_0x8d6a72['query'][_0xb5de('0x3b')]+'%'};return _0x1b2bc0;})});}_0x5d697f=_['merge']({},_0x5d697f,_0x8d6a72[_0xb5de('0x40')]);return _0x25f7be[_0xb5de('0x52')](_0x5d697f);}})[_0xb5de('0x27')](function(_0x19eb94){if(_0x19eb94){_0x1ad64a=_0x19eb94[_0xb5de('0x37')];if(!_0x8d6a72[_0xb5de('0x32')]['hasOwnProperty'](_0xb5de('0x39'))){_0x5d697f[_0xb5de('0x1f')]=qs['limit'](_0x8d6a72[_0xb5de('0x32')][_0xb5de('0x1f')]);_0x5d697f[_0xb5de('0x21')]=qs[_0xb5de('0x21')](_0x8d6a72[_0xb5de('0x32')][_0xb5de('0x21')]);}return _0x25f7be[_0xb5de('0x52')](_0x5d697f);}})['then'](function(_0x23513e){if(_0x23513e){return _0x23513e?{'count':_0x1ad64a,'rows':_0x23513e}:null;}})[_0xb5de('0x27')](respondWithResult(_0x1d2570,null))[_0xb5de('0x49')](handleError(_0x1d2570,null));};exports[_0xb5de('0x53')]=function(_0x372235,_0xcfd104,_0x28eede){var _0x2213e1={};var _0xd4af07={};var _0xea8e0d;var _0x4def4c;return db[_0xb5de('0x2e')][_0xb5de('0x4d')]({'where':{'id':_0x372235['params']['id']}})[_0xb5de('0x27')](handleEntityNotFound(_0xcfd104,null))['then'](function(_0x6d4c0a){if(_0x6d4c0a){_0xea8e0d=_0x6d4c0a;_0xd4af07[_0xb5de('0x31')]=_[_0xb5de('0x47')](db[_0xb5de('0x54')]['rawAttributes']);_0xd4af07[_0xb5de('0x32')]=_[_0xb5de('0x47')](_0x372235['query']);_0xd4af07[_0xb5de('0x33')]=_[_0xb5de('0x35')](_0xd4af07['model'],_0xd4af07[_0xb5de('0x32')]);_0x2213e1['attributes']=_[_0xb5de('0x35')](_0xd4af07[_0xb5de('0x31')],qs[_0xb5de('0x36')](_0x372235[_0xb5de('0x32')][_0xb5de('0x36')]));_0x2213e1['attributes']=_0x2213e1[_0xb5de('0x34')][_0xb5de('0x37')]?_0x2213e1[_0xb5de('0x34')]:_0xd4af07[_0xb5de('0x31')];_0x2213e1[_0xb5de('0x4f')]=qs['sort'](_0x372235[_0xb5de('0x32')][_0xb5de('0x3a')]);_0x2213e1[_0xb5de('0x3c')]=qs[_0xb5de('0x33')](_['pick'](_0x372235['query'],_0xd4af07[_0xb5de('0x33')]));if(_0x372235[_0xb5de('0x32')][_0xb5de('0x3b')]){_0x2213e1[_0xb5de('0x3c')]=_[_0xb5de('0x3d')](_0x2213e1['where'],{'$or':_[_0xb5de('0x2d')](_0x2213e1[_0xb5de('0x34')],function(_0x37a602){var _0x38a508={};_0x38a508[_0x37a602]={'$like':'%'+_0x372235[_0xb5de('0x32')][_0xb5de('0x3b')]+'%'};return _0x38a508;})});}_0x2213e1=_[_0xb5de('0x3d')]({},_0x2213e1,_0x372235[_0xb5de('0x40')]);return _0xea8e0d[_0xb5de('0x53')](_0x2213e1);}})[_0xb5de('0x27')](function(_0x2a12d7){if(_0x2a12d7){_0x4def4c=_0x2a12d7[_0xb5de('0x37')];if(!_0x372235[_0xb5de('0x32')]['hasOwnProperty']('nolimit')){_0x2213e1[_0xb5de('0x1f')]=qs['limit'](_0x372235['query'][_0xb5de('0x1f')]);_0x2213e1[_0xb5de('0x21')]=qs[_0xb5de('0x21')](_0x372235[_0xb5de('0x32')]['offset']);}return _0xea8e0d[_0xb5de('0x53')](_0x2213e1);}})[_0xb5de('0x27')](function(_0x363dcd){if(_0x363dcd){return _0x363dcd?{'count':_0x4def4c,'rows':_0x363dcd}:null;}})[_0xb5de('0x27')](respondWithResult(_0xcfd104,null))[_0xb5de('0x49')](handleError(_0xcfd104,null));};exports[_0xb5de('0x55')]=function(_0x5a6ab8,_0x3889c,_0x337471){if(_0x5a6ab8[_0xb5de('0x4b')]['id']){delete _0x5a6ab8[_0xb5de('0x4b')]['id'];}return db['FreshdeskConfiguration'][_0xb5de('0x4d')]({'where':{'id':_0x5a6ab8[_0xb5de('0x46')]['id']}})[_0xb5de('0x27')](handleEntityNotFound(_0x3889c,null))['then'](function(_0x597a4d){if(_0x597a4d){return _0x597a4d[_0xb5de('0x55')](_0x5a6ab8[_0xb5de('0x4b')][_0xb5de('0x56')]||[]);}return null;})[_0xb5de('0x27')](respondWithResult(_0x3889c,null))[_0xb5de('0x49')](handleError(_0x3889c,null));}; \ No newline at end of file +var _0x2955=['sort','getFields','getSubjects','hasOwnProperty','getDescriptions','getTags','setTags','ids','rimraf','zip-dir','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','sendStatus','status','end','json','offset','undefined','count','limit','set','Content-Range','apply','reject','save','update','then','destroy','error','stack','name','send','index','map','rawAttributes','fieldName','key','query','keys','intersection','model','attributes','fields','length','nolimit','order','where','filters','pick','filter','merge','type','VIRTUAL','options','FreshdeskConfiguration','include','findAll','rows','catch','params','find','create','body','findOne','FreshdeskField'];(function(_0x1b393f,_0x2f3b07){var _0x3bb006=function(_0x46708d){while(--_0x46708d){_0x1b393f['push'](_0x1b393f['shift']());}};_0x3bb006(++_0x2f3b07);}(_0x2955,0x10d));var _0x5295=function(_0xd6c93d,_0x2c405c){_0xd6c93d=_0xd6c93d-0x0;var _0x14d2e0=_0x2955[_0xd6c93d];return _0x14d2e0;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x5295('0x0'));var zipdir=require(_0x5295('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0x5295('0x2'));var moment=require(_0x5295('0x3'));var BPromise=require(_0x5295('0x4'));var Mustache=require(_0x5295('0x5'));var util=require(_0x5295('0x6'));var path=require(_0x5295('0x7'));var sox=require(_0x5295('0x8'));var csv=require(_0x5295('0x9'));var ejs=require(_0x5295('0xa'));var fs=require('fs');var fs_extra=require(_0x5295('0xb'));var _=require(_0x5295('0xc'));var squel=require(_0x5295('0xd'));var crypto=require(_0x5295('0xe'));var jsforce=require(_0x5295('0xf'));var deskjs=require(_0x5295('0x10'));var toCsv=require('to-csv');var querystring=require(_0x5295('0x11'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0x5295('0x12'));var qs=require(_0x5295('0x13'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x5295('0x14'));var logger=require(_0x5295('0x15'))(_0x5295('0x16'));var utils=require(_0x5295('0x17'));var config=require(_0x5295('0x18'));var licenseUtil=require(_0x5295('0x19'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x353b51,_0x1b0c75){_0x1b0c75=_0x1b0c75||0xcc;return function(_0x5db34f){if(_0x5db34f){return _0x353b51[_0x5295('0x1a')](_0x1b0c75);}return _0x353b51[_0x5295('0x1b')](_0x1b0c75)[_0x5295('0x1c')]();};}function respondWithResult(_0x3c17a7,_0x32ee76){_0x32ee76=_0x32ee76||0xc8;return function(_0x1dd743){if(_0x1dd743){return _0x3c17a7[_0x5295('0x1b')](_0x32ee76)[_0x5295('0x1d')](_0x1dd743);}};}function respondWithFilteredResult(_0x5ba2d6,_0x1fb5f8){return function(_0x512530){if(_0x512530){var _0x4cb7cb=typeof _0x1fb5f8[_0x5295('0x1e')]===_0x5295('0x1f')&&typeof _0x1fb5f8['limit']===_0x5295('0x1f');var _0x24b294=_0x512530[_0x5295('0x20')];var _0x5e4d71=_0x4cb7cb?0x0:_0x1fb5f8[_0x5295('0x1e')];var _0x40300e=_0x4cb7cb?_0x512530[_0x5295('0x20')]:_0x1fb5f8[_0x5295('0x1e')]+_0x1fb5f8[_0x5295('0x21')];var _0x32c517;if(_0x40300e>=_0x24b294){_0x40300e=_0x24b294;_0x32c517=0xc8;}else{_0x32c517=0xce;}_0x5ba2d6[_0x5295('0x1b')](_0x32c517);return _0x5ba2d6[_0x5295('0x22')](_0x5295('0x23'),_0x5e4d71+'-'+_0x40300e+'/'+_0x24b294)['json'](_0x512530);}return null;};}function patchUpdates(_0x31c36f){return function(_0x291b10){try{jsonpatch[_0x5295('0x24')](_0x291b10,_0x31c36f,!![]);}catch(_0x891a5b){return BPromise[_0x5295('0x25')](_0x891a5b);}return _0x291b10[_0x5295('0x26')]();};}function saveUpdates(_0x4bcfb7,_0x48976a){return function(_0x6446b6){if(_0x6446b6){return _0x6446b6[_0x5295('0x27')](_0x4bcfb7)[_0x5295('0x28')](function(_0x1a0b7c){return _0x1a0b7c;});}return null;};}function removeEntity(_0x279c6f,_0x1c6cba){return function(_0x396323){if(_0x396323){return _0x396323[_0x5295('0x29')]()[_0x5295('0x28')](function(){_0x279c6f[_0x5295('0x1b')](0xcc)[_0x5295('0x1c')]();});}};}function handleEntityNotFound(_0x27d707,_0x39ff14){return function(_0x4ad91e){if(!_0x4ad91e){_0x27d707[_0x5295('0x1a')](0x194);}return _0x4ad91e;};}function handleError(_0x5edc63,_0x1e4143){_0x1e4143=_0x1e4143||0x1f4;return function(_0x26bf94){logger[_0x5295('0x2a')](_0x26bf94[_0x5295('0x2b')]);if(_0x26bf94[_0x5295('0x2c')]){delete _0x26bf94[_0x5295('0x2c')];}_0x5edc63[_0x5295('0x1b')](_0x1e4143)[_0x5295('0x2d')](_0x26bf94);};}exports[_0x5295('0x2e')]=function(_0x19f38c,_0x653133){var _0x2659fc={},_0x59fe02={},_0x1e8e80={'count':0x0,'rows':[]};var _0x3a44f5=_[_0x5295('0x2f')](db['FreshdeskConfiguration'][_0x5295('0x30')],function(_0x310a5c){return{'name':_0x310a5c[_0x5295('0x31')],'type':_0x310a5c['type'][_0x5295('0x32')]};});_0x59fe02['model']=_[_0x5295('0x2f')](_0x3a44f5,_0x5295('0x2c'));_0x59fe02[_0x5295('0x33')]=_[_0x5295('0x34')](_0x19f38c['query']);_0x59fe02['filters']=_[_0x5295('0x35')](_0x59fe02[_0x5295('0x36')],_0x59fe02[_0x5295('0x33')]);_0x2659fc[_0x5295('0x37')]=_[_0x5295('0x35')](_0x59fe02[_0x5295('0x36')],qs[_0x5295('0x38')](_0x19f38c[_0x5295('0x33')][_0x5295('0x38')]));_0x2659fc[_0x5295('0x37')]=_0x2659fc[_0x5295('0x37')][_0x5295('0x39')]?_0x2659fc[_0x5295('0x37')]:_0x59fe02[_0x5295('0x36')];if(!_0x19f38c['query']['hasOwnProperty'](_0x5295('0x3a'))){_0x2659fc['limit']=qs[_0x5295('0x21')](_0x19f38c[_0x5295('0x33')][_0x5295('0x21')]);_0x2659fc['offset']=qs[_0x5295('0x1e')](_0x19f38c['query'][_0x5295('0x1e')]);}_0x2659fc[_0x5295('0x3b')]=qs['sort'](_0x19f38c[_0x5295('0x33')]['sort']);_0x2659fc[_0x5295('0x3c')]=qs[_0x5295('0x3d')](_[_0x5295('0x3e')](_0x19f38c[_0x5295('0x33')],_0x59fe02[_0x5295('0x3d')]),_0x3a44f5);if(_0x19f38c['query'][_0x5295('0x3f')]){_0x2659fc[_0x5295('0x3c')]=_[_0x5295('0x40')](_0x2659fc[_0x5295('0x3c')],{'$or':_[_0x5295('0x2f')](_0x3a44f5,function(_0x4242dd){if(_0x4242dd[_0x5295('0x41')]!==_0x5295('0x42')){var _0x476970={};_0x476970[_0x4242dd[_0x5295('0x2c')]]={'$like':'%'+_0x19f38c[_0x5295('0x33')][_0x5295('0x3f')]+'%'};return _0x476970;}})});}_0x2659fc=_['merge']({},_0x2659fc,_0x19f38c[_0x5295('0x43')]);var _0x1320d4={'where':_0x2659fc[_0x5295('0x3c')]};return db[_0x5295('0x44')][_0x5295('0x20')](_0x1320d4)[_0x5295('0x28')](function(_0x384294){_0x1e8e80['count']=_0x384294;if(_0x19f38c['query']['includeAll']){_0x2659fc[_0x5295('0x45')]=[{'all':!![]}];}return db[_0x5295('0x44')][_0x5295('0x46')](_0x2659fc);})[_0x5295('0x28')](function(_0x25417f){_0x1e8e80[_0x5295('0x47')]=_0x25417f;return _0x1e8e80;})['then'](respondWithFilteredResult(_0x653133,_0x2659fc))[_0x5295('0x48')](handleError(_0x653133,null));};exports['show']=function(_0x5a0ddf,_0x34116c){var _0x236ea1={'raw':![],'where':{'id':_0x5a0ddf[_0x5295('0x49')]['id']}},_0x4e7dfd={};_0x4e7dfd[_0x5295('0x36')]=_[_0x5295('0x34')](db['FreshdeskConfiguration'][_0x5295('0x30')]);_0x4e7dfd['query']=_[_0x5295('0x34')](_0x5a0ddf[_0x5295('0x33')]);_0x4e7dfd[_0x5295('0x3d')]=_[_0x5295('0x35')](_0x4e7dfd[_0x5295('0x36')],_0x4e7dfd[_0x5295('0x33')]);_0x236ea1[_0x5295('0x37')]=_[_0x5295('0x35')](_0x4e7dfd['model'],qs[_0x5295('0x38')](_0x5a0ddf[_0x5295('0x33')][_0x5295('0x38')]));_0x236ea1[_0x5295('0x37')]=_0x236ea1[_0x5295('0x37')][_0x5295('0x39')]?_0x236ea1['attributes']:_0x4e7dfd[_0x5295('0x36')];if(_0x5a0ddf[_0x5295('0x33')]['includeAll']){_0x236ea1[_0x5295('0x45')]=[{'all':!![]}];}_0x236ea1=_[_0x5295('0x40')]({},_0x236ea1,_0x5a0ddf[_0x5295('0x43')]);return db[_0x5295('0x44')][_0x5295('0x4a')](_0x236ea1)[_0x5295('0x28')](handleEntityNotFound(_0x34116c,null))[_0x5295('0x28')](respondWithResult(_0x34116c,null))[_0x5295('0x48')](handleError(_0x34116c,null));};exports['create']=function(_0x3a9326,_0xeb2faa){return db[_0x5295('0x44')][_0x5295('0x4b')](_0x3a9326[_0x5295('0x4c')],{})[_0x5295('0x28')](respondWithResult(_0xeb2faa,0xc9))[_0x5295('0x48')](handleError(_0xeb2faa,null));};exports[_0x5295('0x27')]=function(_0x375023,_0x287c15){if(_0x375023[_0x5295('0x4c')]['id']){delete _0x375023['body']['id'];}return db[_0x5295('0x44')]['find']({'where':{'id':_0x375023[_0x5295('0x49')]['id']}})[_0x5295('0x28')](handleEntityNotFound(_0x287c15,null))['then'](saveUpdates(_0x375023['body'],null))[_0x5295('0x28')](respondWithResult(_0x287c15,null))[_0x5295('0x48')](handleError(_0x287c15,null));};exports[_0x5295('0x29')]=function(_0x149fe4,_0x108368){return db[_0x5295('0x44')][_0x5295('0x4a')]({'where':{'id':_0x149fe4[_0x5295('0x49')]['id']}})[_0x5295('0x28')](handleEntityNotFound(_0x108368,null))[_0x5295('0x28')](removeEntity(_0x108368,null))[_0x5295('0x48')](handleError(_0x108368,null));};exports['getFields']=function(_0x38680a,_0x352319,_0x41459f){var _0x2a35a6={};var _0x22b0c1={};var _0x1c03d0;var _0x427a41;return db['FreshdeskConfiguration'][_0x5295('0x4d')]({'where':{'id':_0x38680a[_0x5295('0x49')]['id']}})['then'](handleEntityNotFound(_0x352319,null))['then'](function(_0x9fb6e9){if(_0x9fb6e9){_0x1c03d0=_0x9fb6e9;_0x22b0c1[_0x5295('0x36')]=_[_0x5295('0x34')](db[_0x5295('0x4e')][_0x5295('0x30')]);_0x22b0c1['query']=_['keys'](_0x38680a['query']);_0x22b0c1[_0x5295('0x3d')]=_[_0x5295('0x35')](_0x22b0c1[_0x5295('0x36')],_0x22b0c1[_0x5295('0x33')]);_0x2a35a6[_0x5295('0x37')]=_['intersection'](_0x22b0c1['model'],qs['fields'](_0x38680a[_0x5295('0x33')][_0x5295('0x38')]));_0x2a35a6[_0x5295('0x37')]=_0x2a35a6[_0x5295('0x37')]['length']?_0x2a35a6[_0x5295('0x37')]:_0x22b0c1[_0x5295('0x36')];_0x2a35a6[_0x5295('0x3b')]=qs[_0x5295('0x4f')](_0x38680a['query'][_0x5295('0x4f')]);_0x2a35a6['where']=qs[_0x5295('0x3d')](_[_0x5295('0x3e')](_0x38680a[_0x5295('0x33')],_0x22b0c1['filters']));if(_0x38680a[_0x5295('0x33')][_0x5295('0x3f')]){_0x2a35a6[_0x5295('0x3c')]=_[_0x5295('0x40')](_0x2a35a6[_0x5295('0x3c')],{'$or':_[_0x5295('0x2f')](_0x2a35a6[_0x5295('0x37')],function(_0x3ffaae){var _0x1dd500={};_0x1dd500[_0x3ffaae]={'$like':'%'+_0x38680a['query'][_0x5295('0x3f')]+'%'};return _0x1dd500;})});}_0x2a35a6=_[_0x5295('0x40')]({},_0x2a35a6,_0x38680a[_0x5295('0x43')]);return _0x1c03d0[_0x5295('0x50')](_0x2a35a6);}})[_0x5295('0x28')](function(_0x1b40ea){if(_0x1b40ea){_0x427a41=_0x1b40ea[_0x5295('0x39')];if(!_0x38680a['query']['hasOwnProperty'](_0x5295('0x3a'))){_0x2a35a6['limit']=qs[_0x5295('0x21')](_0x38680a[_0x5295('0x33')]['limit']);_0x2a35a6[_0x5295('0x1e')]=qs[_0x5295('0x1e')](_0x38680a[_0x5295('0x33')][_0x5295('0x1e')]);}return _0x1c03d0[_0x5295('0x50')](_0x2a35a6);}})['then'](function(_0x43283c){if(_0x43283c){return _0x43283c?{'count':_0x427a41,'rows':_0x43283c}:null;}})[_0x5295('0x28')](respondWithResult(_0x352319,null))['catch'](handleError(_0x352319,null));};exports['getSubjects']=function(_0x35b8bd,_0x250b2d,_0xb631dc){var _0x118929={};var _0x1438da={};var _0x3a2c3f;var _0x546786;return db[_0x5295('0x44')][_0x5295('0x4d')]({'where':{'id':_0x35b8bd[_0x5295('0x49')]['id']}})[_0x5295('0x28')](handleEntityNotFound(_0x250b2d,null))[_0x5295('0x28')](function(_0x35efc1){if(_0x35efc1){_0x3a2c3f=_0x35efc1;_0x1438da['model']=_[_0x5295('0x34')](db[_0x5295('0x4e')][_0x5295('0x30')]);_0x1438da[_0x5295('0x33')]=_['keys'](_0x35b8bd[_0x5295('0x33')]);_0x1438da[_0x5295('0x3d')]=_[_0x5295('0x35')](_0x1438da['model'],_0x1438da['query']);_0x118929[_0x5295('0x37')]=_[_0x5295('0x35')](_0x1438da['model'],qs['fields'](_0x35b8bd['query'][_0x5295('0x38')]));_0x118929['attributes']=_0x118929[_0x5295('0x37')][_0x5295('0x39')]?_0x118929[_0x5295('0x37')]:_0x1438da[_0x5295('0x36')];_0x118929[_0x5295('0x3b')]=qs['sort'](_0x35b8bd[_0x5295('0x33')][_0x5295('0x4f')]);_0x118929['where']=qs[_0x5295('0x3d')](_[_0x5295('0x3e')](_0x35b8bd[_0x5295('0x33')],_0x1438da[_0x5295('0x3d')]));if(_0x35b8bd['query'][_0x5295('0x3f')]){_0x118929[_0x5295('0x3c')]=_[_0x5295('0x40')](_0x118929[_0x5295('0x3c')],{'$or':_[_0x5295('0x2f')](_0x118929[_0x5295('0x37')],function(_0x596fc0){var _0x9a27bf={};_0x9a27bf[_0x596fc0]={'$like':'%'+_0x35b8bd[_0x5295('0x33')][_0x5295('0x3f')]+'%'};return _0x9a27bf;})});}_0x118929=_[_0x5295('0x40')]({},_0x118929,_0x35b8bd[_0x5295('0x43')]);return _0x3a2c3f[_0x5295('0x51')](_0x118929);}})[_0x5295('0x28')](function(_0x46fd78){if(_0x46fd78){_0x546786=_0x46fd78[_0x5295('0x39')];if(!_0x35b8bd['query'][_0x5295('0x52')](_0x5295('0x3a'))){_0x118929[_0x5295('0x21')]=qs['limit'](_0x35b8bd['query'][_0x5295('0x21')]);_0x118929['offset']=qs[_0x5295('0x1e')](_0x35b8bd[_0x5295('0x33')][_0x5295('0x1e')]);}return _0x3a2c3f['getSubjects'](_0x118929);}})[_0x5295('0x28')](function(_0x40b9fa){if(_0x40b9fa){return _0x40b9fa?{'count':_0x546786,'rows':_0x40b9fa}:null;}})[_0x5295('0x28')](respondWithResult(_0x250b2d,null))['catch'](handleError(_0x250b2d,null));};exports[_0x5295('0x53')]=function(_0xea9efe,_0x1cafe6,_0x2529ba){var _0x493d41={};var _0x321547={};var _0xd70f44;var _0x1c66f6;return db[_0x5295('0x44')][_0x5295('0x4d')]({'where':{'id':_0xea9efe[_0x5295('0x49')]['id']}})[_0x5295('0x28')](handleEntityNotFound(_0x1cafe6,null))[_0x5295('0x28')](function(_0x370d26){if(_0x370d26){_0xd70f44=_0x370d26;_0x321547[_0x5295('0x36')]=_[_0x5295('0x34')](db[_0x5295('0x4e')][_0x5295('0x30')]);_0x321547[_0x5295('0x33')]=_['keys'](_0xea9efe[_0x5295('0x33')]);_0x321547[_0x5295('0x3d')]=_['intersection'](_0x321547[_0x5295('0x36')],_0x321547[_0x5295('0x33')]);_0x493d41['attributes']=_[_0x5295('0x35')](_0x321547[_0x5295('0x36')],qs[_0x5295('0x38')](_0xea9efe[_0x5295('0x33')]['fields']));_0x493d41[_0x5295('0x37')]=_0x493d41[_0x5295('0x37')]['length']?_0x493d41[_0x5295('0x37')]:_0x321547['model'];_0x493d41[_0x5295('0x3b')]=qs[_0x5295('0x4f')](_0xea9efe[_0x5295('0x33')][_0x5295('0x4f')]);_0x493d41['where']=qs[_0x5295('0x3d')](_[_0x5295('0x3e')](_0xea9efe[_0x5295('0x33')],_0x321547[_0x5295('0x3d')]));if(_0xea9efe['query'][_0x5295('0x3f')]){_0x493d41[_0x5295('0x3c')]=_[_0x5295('0x40')](_0x493d41[_0x5295('0x3c')],{'$or':_[_0x5295('0x2f')](_0x493d41[_0x5295('0x37')],function(_0x3def9b){var _0x4aa050={};_0x4aa050[_0x3def9b]={'$like':'%'+_0xea9efe[_0x5295('0x33')][_0x5295('0x3f')]+'%'};return _0x4aa050;})});}_0x493d41=_[_0x5295('0x40')]({},_0x493d41,_0xea9efe[_0x5295('0x43')]);return _0xd70f44[_0x5295('0x53')](_0x493d41);}})[_0x5295('0x28')](function(_0x168a23){if(_0x168a23){_0x1c66f6=_0x168a23[_0x5295('0x39')];if(!_0xea9efe[_0x5295('0x33')][_0x5295('0x52')](_0x5295('0x3a'))){_0x493d41[_0x5295('0x21')]=qs[_0x5295('0x21')](_0xea9efe['query'][_0x5295('0x21')]);_0x493d41['offset']=qs[_0x5295('0x1e')](_0xea9efe[_0x5295('0x33')][_0x5295('0x1e')]);}return _0xd70f44['getDescriptions'](_0x493d41);}})[_0x5295('0x28')](function(_0x17a34){if(_0x17a34){return _0x17a34?{'count':_0x1c66f6,'rows':_0x17a34}:null;}})['then'](respondWithResult(_0x1cafe6,null))[_0x5295('0x48')](handleError(_0x1cafe6,null));};exports['getTags']=function(_0xdf4400,_0x241f55,_0x495436){var _0xd21a5c={};var _0x48255f={};var _0x5c3b9b;var _0x442832;return db[_0x5295('0x44')]['findOne']({'where':{'id':_0xdf4400[_0x5295('0x49')]['id']}})['then'](handleEntityNotFound(_0x241f55,null))['then'](function(_0x580fdf){if(_0x580fdf){_0x5c3b9b=_0x580fdf;_0x48255f[_0x5295('0x36')]=_[_0x5295('0x34')](db['Tag'][_0x5295('0x30')]);_0x48255f[_0x5295('0x33')]=_['keys'](_0xdf4400['query']);_0x48255f[_0x5295('0x3d')]=_['intersection'](_0x48255f[_0x5295('0x36')],_0x48255f['query']);_0xd21a5c['attributes']=_[_0x5295('0x35')](_0x48255f[_0x5295('0x36')],qs[_0x5295('0x38')](_0xdf4400[_0x5295('0x33')]['fields']));_0xd21a5c['attributes']=_0xd21a5c[_0x5295('0x37')][_0x5295('0x39')]?_0xd21a5c[_0x5295('0x37')]:_0x48255f['model'];_0xd21a5c[_0x5295('0x3b')]=qs[_0x5295('0x4f')](_0xdf4400[_0x5295('0x33')]['sort']);_0xd21a5c[_0x5295('0x3c')]=qs[_0x5295('0x3d')](_[_0x5295('0x3e')](_0xdf4400[_0x5295('0x33')],_0x48255f[_0x5295('0x3d')]));if(_0xdf4400[_0x5295('0x33')]['filter']){_0xd21a5c[_0x5295('0x3c')]=_['merge'](_0xd21a5c['where'],{'$or':_['map'](_0xd21a5c['attributes'],function(_0x1b735f){var _0x5c26d2={};_0x5c26d2[_0x1b735f]={'$like':'%'+_0xdf4400[_0x5295('0x33')]['filter']+'%'};return _0x5c26d2;})});}_0xd21a5c=_[_0x5295('0x40')]({},_0xd21a5c,_0xdf4400[_0x5295('0x43')]);return _0x5c3b9b[_0x5295('0x54')](_0xd21a5c);}})[_0x5295('0x28')](function(_0x4119ba){if(_0x4119ba){_0x442832=_0x4119ba[_0x5295('0x39')];if(!_0xdf4400['query'][_0x5295('0x52')](_0x5295('0x3a'))){_0xd21a5c[_0x5295('0x21')]=qs[_0x5295('0x21')](_0xdf4400[_0x5295('0x33')]['limit']);_0xd21a5c[_0x5295('0x1e')]=qs[_0x5295('0x1e')](_0xdf4400[_0x5295('0x33')][_0x5295('0x1e')]);}return _0x5c3b9b[_0x5295('0x54')](_0xd21a5c);}})[_0x5295('0x28')](function(_0x3937c7){if(_0x3937c7){return _0x3937c7?{'count':_0x442832,'rows':_0x3937c7}:null;}})[_0x5295('0x28')](respondWithResult(_0x241f55,null))['catch'](handleError(_0x241f55,null));};exports[_0x5295('0x55')]=function(_0x3d1eb9,_0x53b3f5,_0x4590c2){if(_0x3d1eb9[_0x5295('0x4c')]['id']){delete _0x3d1eb9[_0x5295('0x4c')]['id'];}return db[_0x5295('0x44')][_0x5295('0x4d')]({'where':{'id':_0x3d1eb9[_0x5295('0x49')]['id']}})['then'](handleEntityNotFound(_0x53b3f5,null))['then'](function(_0x3339ca){if(_0x3339ca){return _0x3339ca['setTags'](_0x3d1eb9[_0x5295('0x4c')][_0x5295('0x56')]||[]);}return null;})[_0x5295('0x28')](respondWithResult(_0x53b3f5,null))[_0x5295('0x48')](handleError(_0x53b3f5,null));}; \ No newline at end of file diff --git a/server/api/intFreshdeskConfiguration/intFreshdeskConfiguration.model.js b/server/api/intFreshdeskConfiguration/intFreshdeskConfiguration.model.js index a5db7a6..7d4153c 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 _0xd89d=['FreshdeskConfiguration','int_freshdesk_configurations','../../config/logger','moment','bluebird','request-promise','path','rimraf','../../config/environment','./intFreshdeskConfiguration.attributes','exports','define'];(function(_0x356aba,_0x22291a){var _0x1e7533=function(_0xe56fe){while(--_0xe56fe){_0x356aba['push'](_0x356aba['shift']());}};_0x1e7533(++_0x22291a);}(_0xd89d,0xf2));var _0xdd89=function(_0x163c97,_0x444c68){_0x163c97=_0x163c97-0x0;var _0x26dad4=_0xd89d[_0x163c97];return _0x26dad4;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0xdd89('0x0'))('api');var moment=require(_0xdd89('0x1'));var BPromise=require(_0xdd89('0x2'));var rp=require(_0xdd89('0x3'));var fs=require('fs');var path=require(_0xdd89('0x4'));var rimraf=require(_0xdd89('0x5'));var config=require(_0xdd89('0x6'));var attributes=require(_0xdd89('0x7'));module[_0xdd89('0x8')]=function(_0x87d75e,_0x467001){return _0x87d75e[_0xdd89('0x9')](_0xdd89('0xa'),attributes,{'tableName':_0xdd89('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x7162=['exports','define','int_freshdesk_configurations','lodash','../../config/logger','api','moment','request-promise','path','rimraf','../../config/environment','./intFreshdeskConfiguration.attributes'];(function(_0x2b305c,_0x5ae303){var _0x5d8c85=function(_0x33129f){while(--_0x33129f){_0x2b305c['push'](_0x2b305c['shift']());}};_0x5d8c85(++_0x5ae303);}(_0x7162,0x18f));var _0x2716=function(_0x5a2f92,_0x2f1d42){_0x5a2f92=_0x5a2f92-0x0;var _0x3c2980=_0x7162[_0x5a2f92];return _0x3c2980;};'use strict';var _=require(_0x2716('0x0'));var util=require('util');var logger=require(_0x2716('0x1'))(_0x2716('0x2'));var moment=require(_0x2716('0x3'));var BPromise=require('bluebird');var rp=require(_0x2716('0x4'));var fs=require('fs');var path=require(_0x2716('0x5'));var rimraf=require(_0x2716('0x6'));var config=require(_0x2716('0x7'));var attributes=require(_0x2716('0x8'));module[_0x2716('0x9')]=function(_0x323022,_0x1647f0){return _0x323022[_0x2716('0xa')]('FreshdeskConfiguration',attributes,{'tableName':_0x2716('0xb'),'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 39c0296..9ac6ab8 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 _0x3a4d=['FreshdeskConfiguration,\x20%s,\x20%s','message','lodash','util','moment','randomstring','../../config/utils','../../config/logger','rpc','../../config/environment','http','then','info','request\x20sent','debug','FreshdeskConfiguration,\x20%s,\x20%s,\x20%s','code','error'];(function(_0xdeefbd,_0x9e1b3d){var _0x4ff63f=function(_0x4b51f9){while(--_0x4b51f9){_0xdeefbd['push'](_0xdeefbd['shift']());}};_0x4ff63f(++_0x9e1b3d);}(_0x3a4d,0x110));var _0xd3a4=function(_0xcba4b6,_0x1ecf6a){_0xcba4b6=_0xcba4b6-0x0;var _0x2bd8bf=_0x3a4d[_0xcba4b6];return _0x2bd8bf;};'use strict';var _=require(_0xd3a4('0x0'));var util=require(_0xd3a4('0x1'));var moment=require(_0xd3a4('0x2'));var BPromise=require('bluebird');var rs=require(_0xd3a4('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0xd3a4('0x4'));var logger=require(_0xd3a4('0x5'))(_0xd3a4('0x6'));var config=require(_0xd3a4('0x7'));var jayson=require('jayson/promise');var client=jayson['client'][_0xd3a4('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x371cdc,_0x4081eb,_0x3f1ad9){return new BPromise(function(_0x576cdb,_0x2e041f){return client['request'](_0x371cdc,_0x3f1ad9)[_0xd3a4('0x9')](function(_0x467a8d){logger[_0xd3a4('0xa')]('FreshdeskConfiguration,\x20%s,\x20%s',_0x4081eb,_0xd3a4('0xb'));logger[_0xd3a4('0xc')](_0xd3a4('0xd'),_0x4081eb,_0xd3a4('0xb'),JSON['stringify'](_0x467a8d));if(_0x467a8d['error']){if(_0x467a8d['error'][_0xd3a4('0xe')]===0x1f4){logger[_0xd3a4('0xf')]('FreshdeskConfiguration,\x20%s,\x20%s',_0x4081eb,_0x467a8d[_0xd3a4('0xf')]['message']);return _0x2e041f(_0x467a8d[_0xd3a4('0xf')]['message']);}logger['error'](_0xd3a4('0x10'),_0x4081eb,_0x467a8d[_0xd3a4('0xf')][_0xd3a4('0x11')]);return _0x576cdb(_0x467a8d[_0xd3a4('0xf')]['message']);}else{logger[_0xd3a4('0xa')]('FreshdeskConfiguration,\x20%s,\x20%s',_0x4081eb,_0xd3a4('0xb'));_0x576cdb(_0x467a8d['result'][_0xd3a4('0x11')]);}})['catch'](function(_0x2df4f7){logger[_0xd3a4('0xf')](_0xd3a4('0x10'),_0x4081eb,_0x2df4f7);_0x2e041f(_0x2df4f7);});});} \ No newline at end of file +var _0xba10=['error','code','FreshdeskConfiguration,\x20%s,\x20%s','message','result','catch','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','request','then','info','request\x20sent','FreshdeskConfiguration,\x20%s,\x20%s,\x20%s','stringify'];(function(_0x114b07,_0x4bcc2a){var _0x387799=function(_0x1d1735){while(--_0x1d1735){_0x114b07['push'](_0x114b07['shift']());}};_0x387799(++_0x4bcc2a);}(_0xba10,0x150));var _0x0ba1=function(_0x58cbaf,_0x46c928){_0x58cbaf=_0x58cbaf-0x0;var _0x2a20a7=_0xba10[_0x58cbaf];return _0x2a20a7;};'use strict';var _=require('lodash');var util=require(_0x0ba1('0x0'));var moment=require(_0x0ba1('0x1'));var BPromise=require(_0x0ba1('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x0ba1('0x3'));var db=require(_0x0ba1('0x4'))['db'];var utils=require(_0x0ba1('0x5'));var logger=require('../../config/logger')(_0x0ba1('0x6'));var config=require(_0x0ba1('0x7'));var jayson=require(_0x0ba1('0x8'));var client=jayson[_0x0ba1('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x35425c,_0x23aac5,_0x3a0a5e){return new BPromise(function(_0x1a7ba9,_0x7ffbf9){return client[_0x0ba1('0xa')](_0x35425c,_0x3a0a5e)[_0x0ba1('0xb')](function(_0x19c659){logger[_0x0ba1('0xc')]('FreshdeskConfiguration,\x20%s,\x20%s',_0x23aac5,_0x0ba1('0xd'));logger['debug'](_0x0ba1('0xe'),_0x23aac5,_0x0ba1('0xd'),JSON[_0x0ba1('0xf')](_0x19c659));if(_0x19c659[_0x0ba1('0x10')]){if(_0x19c659[_0x0ba1('0x10')][_0x0ba1('0x11')]===0x1f4){logger['error'](_0x0ba1('0x12'),_0x23aac5,_0x19c659[_0x0ba1('0x10')][_0x0ba1('0x13')]);return _0x7ffbf9(_0x19c659[_0x0ba1('0x10')][_0x0ba1('0x13')]);}logger['error'](_0x0ba1('0x12'),_0x23aac5,_0x19c659['error']['message']);return _0x1a7ba9(_0x19c659['error'][_0x0ba1('0x13')]);}else{logger[_0x0ba1('0xc')](_0x0ba1('0x12'),_0x23aac5,'request\x20sent');_0x1a7ba9(_0x19c659[_0x0ba1('0x14')][_0x0ba1('0x13')]);}})[_0x0ba1('0x15')](function(_0x330f53){logger['error'](_0x0ba1('0x12'),_0x23aac5,_0x330f53);_0x7ffbf9(_0x330f53);});});} \ No newline at end of file diff --git a/server/api/intFreshdeskField/index.js b/server/api/intFreshdeskField/index.js index c4717cd..5b19866 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 _0xad35=['path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./intFreshdeskField.controller','get','isAuthenticated','show','post','create','/:id','delete','destroy','exports','util'];(function(_0xf90a9,_0x2541bb){var _0x5dd272=function(_0x3d168f){while(--_0x3d168f){_0xf90a9['push'](_0xf90a9['shift']());}};_0x5dd272(++_0x2541bb);}(_0xad35,0x71));var _0x5ad3=function(_0x128e43,_0x155cc9){_0x128e43=_0x128e43-0x0;var _0x589423=_0xad35[_0x128e43];return _0x589423;};'use strict';var multer=require('multer');var util=require(_0x5ad3('0x0'));var path=require(_0x5ad3('0x1'));var timeout=require(_0x5ad3('0x2'));var express=require(_0x5ad3('0x3'));var router=express[_0x5ad3('0x4')]();var fs_extra=require(_0x5ad3('0x5'));var auth=require(_0x5ad3('0x6'));var interaction=require(_0x5ad3('0x7'));var config=require(_0x5ad3('0x8'));var controller=require(_0x5ad3('0x9'));router[_0x5ad3('0xa')]('/',auth[_0x5ad3('0xb')](),controller['index']);router[_0x5ad3('0xa')]('/:id',auth[_0x5ad3('0xb')](),controller[_0x5ad3('0xc')]);router[_0x5ad3('0xd')]('/',auth[_0x5ad3('0xb')](),controller[_0x5ad3('0xe')]);router['put'](_0x5ad3('0xf'),auth[_0x5ad3('0xb')](),controller['update']);router[_0x5ad3('0x10')](_0x5ad3('0xf'),auth[_0x5ad3('0xb')](),controller[_0x5ad3('0x11')]);module[_0x5ad3('0x12')]=router; \ No newline at end of file +var _0x5a77=['express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','get','isAuthenticated','index','/:id','show','post','create','put','delete','destroy','exports','multer','path','connect-timeout'];(function(_0x1e0136,_0x16fa9c){var _0xd25e14=function(_0x3094f2){while(--_0x3094f2){_0x1e0136['push'](_0x1e0136['shift']());}};_0xd25e14(++_0x16fa9c);}(_0x5a77,0xce));var _0x75a7=function(_0x1a411a,_0xc32f43){_0x1a411a=_0x1a411a-0x0;var _0x5d1152=_0x5a77[_0x1a411a];return _0x5d1152;};'use strict';var multer=require(_0x75a7('0x0'));var util=require('util');var path=require(_0x75a7('0x1'));var timeout=require(_0x75a7('0x2'));var express=require(_0x75a7('0x3'));var router=express[_0x75a7('0x4')]();var fs_extra=require(_0x75a7('0x5'));var auth=require(_0x75a7('0x6'));var interaction=require(_0x75a7('0x7'));var config=require('../../config/environment');var controller=require('./intFreshdeskField.controller');router[_0x75a7('0x8')]('/',auth[_0x75a7('0x9')](),controller[_0x75a7('0xa')]);router[_0x75a7('0x8')](_0x75a7('0xb'),auth[_0x75a7('0x9')](),controller[_0x75a7('0xc')]);router[_0x75a7('0xd')]('/',auth[_0x75a7('0x9')](),controller[_0x75a7('0xe')]);router[_0x75a7('0xf')](_0x75a7('0xb'),auth[_0x75a7('0x9')](),controller['update']);router[_0x75a7('0x10')]('/:id',auth[_0x75a7('0x9')](),controller[_0x75a7('0x11')]);module[_0x75a7('0x12')]=router; \ No newline at end of file diff --git a/server/api/intFreshdeskField/intFreshdeskField.attributes.js b/server/api/intFreshdeskField/intFreshdeskField.attributes.js index 4331dad..d6e3b6f 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 _0x02c9=['customVariable','BOOLEAN','sequelize','exports','ENUM','string','keyValue','picklist','STRING','variable'];(function(_0x27cbf1,_0x14613c){var _0x1cfb81=function(_0x2c001a){while(--_0x2c001a){_0x27cbf1['push'](_0x27cbf1['shift']());}};_0x1cfb81(++_0x14613c);}(_0x02c9,0x19c));var _0x902c=function(_0x922b28,_0x4c3e77){_0x922b28=_0x922b28-0x0;var _0x344b39=_0x02c9[_0x922b28];return _0x344b39;};'use strict';var Sequelize=require(_0x902c('0x0'));module[_0x902c('0x1')]={'type':{'type':Sequelize[_0x902c('0x2')](_0x902c('0x3'),'variable','customVariable',_0x902c('0x4'),_0x902c('0x5')),'defaultValue':_0x902c('0x3')},'content':{'type':Sequelize[_0x902c('0x6')]},'key':{'type':Sequelize['STRING']},'keyType':{'type':Sequelize[_0x902c('0x2')](_0x902c('0x3'),_0x902c('0x7'),_0x902c('0x8'))},'keyContent':{'type':Sequelize['STRING']},'idField':{'type':Sequelize[_0x902c('0x6')]},'nameField':{'type':Sequelize[_0x902c('0x6')]},'customField':{'type':Sequelize[_0x902c('0x9')],'defaultValue':!![]},'variableName':{'type':Sequelize[_0x902c('0x6')]}}; \ No newline at end of file +var _0x223a=['customVariable','picklist','STRING','sequelize','exports','ENUM','string','variable'];(function(_0x255d5b,_0x4f6f35){var _0x3e141a=function(_0x249ee2){while(--_0x249ee2){_0x255d5b['push'](_0x255d5b['shift']());}};_0x3e141a(++_0x4f6f35);}(_0x223a,0xa3));var _0xa223=function(_0x1593b1,_0x4e681b){_0x1593b1=_0x1593b1-0x0;var _0x34895d=_0x223a[_0x1593b1];return _0x34895d;};'use strict';var Sequelize=require(_0xa223('0x0'));module[_0xa223('0x1')]={'type':{'type':Sequelize[_0xa223('0x2')](_0xa223('0x3'),_0xa223('0x4'),_0xa223('0x5'),'keyValue',_0xa223('0x6')),'defaultValue':_0xa223('0x3')},'content':{'type':Sequelize[_0xa223('0x7')]},'key':{'type':Sequelize[_0xa223('0x7')]},'keyType':{'type':Sequelize[_0xa223('0x2')]('string',_0xa223('0x4'),_0xa223('0x5'))},'keyContent':{'type':Sequelize['STRING']},'idField':{'type':Sequelize[_0xa223('0x7')]},'nameField':{'type':Sequelize['STRING']},'customField':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'variableName':{'type':Sequelize['STRING']}}; \ No newline at end of file diff --git a/server/api/intFreshdeskField/intFreshdeskField.controller.js b/server/api/intFreshdeskField/intFreshdeskField.controller.js index 6bfd4a1..4baf800 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 _0x6f0d=['params','find','catch','body','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','path','sox','ejs','lodash','squel','crypto','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','end','offset','undefined','limit','count','json','reject','update','destroy','then','error','stack','name','index','map','FreshdeskField','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','length','nolimit','sort','where','pick','merge','VIRTUAL','filter','options','includeAll','include','findAll','rows','show'];(function(_0x30c649,_0x2ebbac){var _0x3edfb9=function(_0xab82f5){while(--_0xab82f5){_0x30c649['push'](_0x30c649['shift']());}};_0x3edfb9(++_0x2ebbac);}(_0x6f0d,0x16c));var _0xd6f0=function(_0x2ecc2a,_0x33362d){_0x2ecc2a=_0x2ecc2a-0x0;var _0x1898f1=_0x6f0d[_0x2ecc2a];return _0x1898f1;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xd6f0('0x0'));var zipdir=require(_0xd6f0('0x1'));var jsonpatch=require(_0xd6f0('0x2'));var rp=require(_0xd6f0('0x3'));var moment=require('moment');var BPromise=require(_0xd6f0('0x4'));var Mustache=require(_0xd6f0('0x5'));var util=require(_0xd6f0('0x6'));var path=require(_0xd6f0('0x7'));var sox=require(_0xd6f0('0x8'));var csv=require('to-csv');var ejs=require(_0xd6f0('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xd6f0('0xa'));var squel=require(_0xd6f0('0xb'));var crypto=require(_0xd6f0('0xc'));var jsforce=require(_0xd6f0('0xd'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0xd6f0('0xe'));var Papa=require(_0xd6f0('0xf'));var Redis=require(_0xd6f0('0x10'));var authService=require(_0xd6f0('0x11'));var qs=require(_0xd6f0('0x12'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xd6f0('0x13'));var logger=require(_0xd6f0('0x14'))(_0xd6f0('0x15'));var utils=require(_0xd6f0('0x16'));var config=require('../../config/environment');var licenseUtil=require(_0xd6f0('0x17'));var db=require(_0xd6f0('0x18'))['db'];function respondWithStatusCode(_0x306aad,_0x45973d){_0x45973d=_0x45973d||0xcc;return function(_0x109655){if(_0x109655){return _0x306aad[_0xd6f0('0x19')](_0x45973d);}return _0x306aad[_0xd6f0('0x1a')](_0x45973d)[_0xd6f0('0x1b')]();};}function respondWithResult(_0x246dad,_0x4ab979){_0x4ab979=_0x4ab979||0xc8;return function(_0x2b3f32){if(_0x2b3f32){return _0x246dad[_0xd6f0('0x1a')](_0x4ab979)['json'](_0x2b3f32);}};}function respondWithFilteredResult(_0x419b7e,_0x593abe){return function(_0x3f4851){if(_0x3f4851){var _0x154e3e=typeof _0x593abe[_0xd6f0('0x1c')]===_0xd6f0('0x1d')&&typeof _0x593abe[_0xd6f0('0x1e')]===_0xd6f0('0x1d');var _0x25da0c=_0x3f4851[_0xd6f0('0x1f')];var _0x2e71bd=_0x154e3e?0x0:_0x593abe[_0xd6f0('0x1c')];var _0x23ab6c=_0x154e3e?_0x3f4851[_0xd6f0('0x1f')]:_0x593abe[_0xd6f0('0x1c')]+_0x593abe[_0xd6f0('0x1e')];var _0x1f43d7;if(_0x23ab6c>=_0x25da0c){_0x23ab6c=_0x25da0c;_0x1f43d7=0xc8;}else{_0x1f43d7=0xce;}_0x419b7e[_0xd6f0('0x1a')](_0x1f43d7);return _0x419b7e['set']('Content-Range',_0x2e71bd+'-'+_0x23ab6c+'/'+_0x25da0c)[_0xd6f0('0x20')](_0x3f4851);}return null;};}function patchUpdates(_0x264104){return function(_0x1158dc){try{jsonpatch['apply'](_0x1158dc,_0x264104,!![]);}catch(_0x67afa7){return BPromise[_0xd6f0('0x21')](_0x67afa7);}return _0x1158dc['save']();};}function saveUpdates(_0x86dde0,_0x515687){return function(_0x1ee584){if(_0x1ee584){return _0x1ee584[_0xd6f0('0x22')](_0x86dde0)['then'](function(_0xb9e820){return _0xb9e820;});}return null;};}function removeEntity(_0x45e99c,_0x5ea2dd){return function(_0x3dbdc3){if(_0x3dbdc3){return _0x3dbdc3[_0xd6f0('0x23')]()[_0xd6f0('0x24')](function(){_0x45e99c['status'](0xcc)[_0xd6f0('0x1b')]();});}};}function handleEntityNotFound(_0x3dc166,_0x5ecb16){return function(_0xcea0ae){if(!_0xcea0ae){_0x3dc166['sendStatus'](0x194);}return _0xcea0ae;};}function handleError(_0x2042d5,_0x3fb5c3){_0x3fb5c3=_0x3fb5c3||0x1f4;return function(_0x1630dc){logger[_0xd6f0('0x25')](_0x1630dc[_0xd6f0('0x26')]);if(_0x1630dc[_0xd6f0('0x27')]){delete _0x1630dc[_0xd6f0('0x27')];}_0x2042d5[_0xd6f0('0x1a')](_0x3fb5c3)['send'](_0x1630dc);};}exports[_0xd6f0('0x28')]=function(_0x1982d3,_0x55656c){var _0x38a3e9={},_0x385947={},_0x27db5e={'count':0x0,'rows':[]};var _0xb61222=_[_0xd6f0('0x29')](db[_0xd6f0('0x2a')][_0xd6f0('0x2b')],function(_0x3151f8){return{'name':_0x3151f8[_0xd6f0('0x2c')],'type':_0x3151f8[_0xd6f0('0x2d')][_0xd6f0('0x2e')]};});_0x385947[_0xd6f0('0x2f')]=_[_0xd6f0('0x29')](_0xb61222,_0xd6f0('0x27'));_0x385947[_0xd6f0('0x30')]=_[_0xd6f0('0x31')](_0x1982d3[_0xd6f0('0x30')]);_0x385947[_0xd6f0('0x32')]=_[_0xd6f0('0x33')](_0x385947[_0xd6f0('0x2f')],_0x385947[_0xd6f0('0x30')]);_0x38a3e9[_0xd6f0('0x34')]=_['intersection'](_0x385947[_0xd6f0('0x2f')],qs['fields'](_0x1982d3['query'][_0xd6f0('0x35')]));_0x38a3e9[_0xd6f0('0x34')]=_0x38a3e9[_0xd6f0('0x34')][_0xd6f0('0x36')]?_0x38a3e9[_0xd6f0('0x34')]:_0x385947['model'];if(!_0x1982d3[_0xd6f0('0x30')]['hasOwnProperty'](_0xd6f0('0x37'))){_0x38a3e9[_0xd6f0('0x1e')]=qs[_0xd6f0('0x1e')](_0x1982d3[_0xd6f0('0x30')][_0xd6f0('0x1e')]);_0x38a3e9['offset']=qs['offset'](_0x1982d3[_0xd6f0('0x30')][_0xd6f0('0x1c')]);}_0x38a3e9['order']=qs[_0xd6f0('0x38')](_0x1982d3['query'][_0xd6f0('0x38')]);_0x38a3e9[_0xd6f0('0x39')]=qs[_0xd6f0('0x32')](_[_0xd6f0('0x3a')](_0x1982d3[_0xd6f0('0x30')],_0x385947[_0xd6f0('0x32')]),_0xb61222);if(_0x1982d3[_0xd6f0('0x30')]['filter']){_0x38a3e9['where']=_[_0xd6f0('0x3b')](_0x38a3e9[_0xd6f0('0x39')],{'$or':_[_0xd6f0('0x29')](_0xb61222,function(_0x5c2d9a){if(_0x5c2d9a['type']!==_0xd6f0('0x3c')){var _0x2def01={};_0x2def01[_0x5c2d9a[_0xd6f0('0x27')]]={'$like':'%'+_0x1982d3[_0xd6f0('0x30')][_0xd6f0('0x3d')]+'%'};return _0x2def01;}})});}_0x38a3e9=_[_0xd6f0('0x3b')]({},_0x38a3e9,_0x1982d3[_0xd6f0('0x3e')]);var _0x64359c={'where':_0x38a3e9['where']};return db[_0xd6f0('0x2a')][_0xd6f0('0x1f')](_0x64359c)[_0xd6f0('0x24')](function(_0x3964e6){_0x27db5e['count']=_0x3964e6;if(_0x1982d3[_0xd6f0('0x30')][_0xd6f0('0x3f')]){_0x38a3e9[_0xd6f0('0x40')]=[{'all':!![]}];}return db[_0xd6f0('0x2a')][_0xd6f0('0x41')](_0x38a3e9);})['then'](function(_0x332809){_0x27db5e[_0xd6f0('0x42')]=_0x332809;return _0x27db5e;})[_0xd6f0('0x24')](respondWithFilteredResult(_0x55656c,_0x38a3e9))['catch'](handleError(_0x55656c,null));};exports[_0xd6f0('0x43')]=function(_0x1ddc40,_0x4b8cc7){var _0x516ffd={'raw':!![],'where':{'id':_0x1ddc40[_0xd6f0('0x44')]['id']}},_0x9cffd4={};_0x9cffd4[_0xd6f0('0x2f')]=_['keys'](db[_0xd6f0('0x2a')][_0xd6f0('0x2b')]);_0x9cffd4['query']=_[_0xd6f0('0x31')](_0x1ddc40[_0xd6f0('0x30')]);_0x9cffd4[_0xd6f0('0x32')]=_[_0xd6f0('0x33')](_0x9cffd4['model'],_0x9cffd4[_0xd6f0('0x30')]);_0x516ffd[_0xd6f0('0x34')]=_[_0xd6f0('0x33')](_0x9cffd4[_0xd6f0('0x2f')],qs[_0xd6f0('0x35')](_0x1ddc40[_0xd6f0('0x30')][_0xd6f0('0x35')]));_0x516ffd[_0xd6f0('0x34')]=_0x516ffd['attributes'][_0xd6f0('0x36')]?_0x516ffd[_0xd6f0('0x34')]:_0x9cffd4['model'];if(_0x1ddc40[_0xd6f0('0x30')][_0xd6f0('0x3f')]){_0x516ffd[_0xd6f0('0x40')]=[{'all':!![]}];}_0x516ffd=_[_0xd6f0('0x3b')]({},_0x516ffd,_0x1ddc40['options']);return db[_0xd6f0('0x2a')][_0xd6f0('0x45')](_0x516ffd)['then'](handleEntityNotFound(_0x4b8cc7,null))['then'](respondWithResult(_0x4b8cc7,null))[_0xd6f0('0x46')](handleError(_0x4b8cc7,null));};exports['create']=function(_0x35a8f5,_0x61b354){return db[_0xd6f0('0x2a')]['create'](_0x35a8f5[_0xd6f0('0x47')],{})[_0xd6f0('0x24')](respondWithResult(_0x61b354,0xc9))[_0xd6f0('0x46')](handleError(_0x61b354,null));};exports[_0xd6f0('0x22')]=function(_0xc4147e,_0x4c42ce){if(_0xc4147e[_0xd6f0('0x47')]['id']){delete _0xc4147e['body']['id'];}return db[_0xd6f0('0x2a')][_0xd6f0('0x45')]({'where':{'id':_0xc4147e[_0xd6f0('0x44')]['id']}})[_0xd6f0('0x24')](handleEntityNotFound(_0x4c42ce,null))['then'](saveUpdates(_0xc4147e['body'],null))[_0xd6f0('0x24')](respondWithResult(_0x4c42ce,null))[_0xd6f0('0x46')](handleError(_0x4c42ce,null));};exports['destroy']=function(_0xa68b18,_0x56c448){return db[_0xd6f0('0x2a')][_0xd6f0('0x45')]({'where':{'id':_0xa68b18[_0xd6f0('0x44')]['id']}})[_0xd6f0('0x24')](handleEntityNotFound(_0x56c448,null))[_0xd6f0('0x24')](removeEntity(_0x56c448,null))['catch'](handleError(_0x56c448,null));}; \ No newline at end of file +var _0x407f=['sendStatus','status','end','json','offset','undefined','limit','count','set','apply','reject','save','then','destroy','error','stack','name','index','map','FreshdeskField','rawAttributes','fieldName','model','query','keys','filters','attributes','intersection','fields','length','order','sort','pick','where','merge','type','VIRTUAL','filter','include','catch','show','params','includeAll','options','create','body','update','find','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util'];(function(_0xbe15ce,_0x4c3f35){var _0x2797bb=function(_0x37f618){while(--_0x37f618){_0xbe15ce['push'](_0xbe15ce['shift']());}};_0x2797bb(++_0x4c3f35);}(_0x407f,0xc2));var _0xf407=function(_0x1b650a,_0x41a453){_0x1b650a=_0x1b650a-0x0;var _0x3ac6b1=_0x407f[_0x1b650a];return _0x3ac6b1;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0xf407('0x0'));var rp=require(_0xf407('0x1'));var moment=require(_0xf407('0x2'));var BPromise=require(_0xf407('0x3'));var Mustache=require(_0xf407('0x4'));var util=require(_0xf407('0x5'));var path=require(_0xf407('0x6'));var sox=require(_0xf407('0x7'));var csv=require(_0xf407('0x8'));var ejs=require(_0xf407('0x9'));var fs=require('fs');var fs_extra=require(_0xf407('0xa'));var _=require(_0xf407('0xb'));var squel=require(_0xf407('0xc'));var crypto=require(_0xf407('0xd'));var jsforce=require(_0xf407('0xe'));var deskjs=require(_0xf407('0xf'));var toCsv=require('to-csv');var querystring=require(_0xf407('0x10'));var Papa=require(_0xf407('0x11'));var Redis=require(_0xf407('0x12'));var authService=require(_0xf407('0x13'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0xf407('0x14'))(_0xf407('0x15'));var utils=require(_0xf407('0x16'));var config=require(_0xf407('0x17'));var licenseUtil=require(_0xf407('0x18'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x2ee485,_0x3f4ca0){_0x3f4ca0=_0x3f4ca0||0xcc;return function(_0x3b26ae){if(_0x3b26ae){return _0x2ee485[_0xf407('0x19')](_0x3f4ca0);}return _0x2ee485[_0xf407('0x1a')](_0x3f4ca0)[_0xf407('0x1b')]();};}function respondWithResult(_0x242f43,_0x5257ef){_0x5257ef=_0x5257ef||0xc8;return function(_0x5d80ab){if(_0x5d80ab){return _0x242f43['status'](_0x5257ef)[_0xf407('0x1c')](_0x5d80ab);}};}function respondWithFilteredResult(_0x593e36,_0x454710){return function(_0x4c1320){if(_0x4c1320){var _0x48fd5d=typeof _0x454710[_0xf407('0x1d')]===_0xf407('0x1e')&&typeof _0x454710[_0xf407('0x1f')]===_0xf407('0x1e');var _0x351252=_0x4c1320[_0xf407('0x20')];var _0x4ddbe6=_0x48fd5d?0x0:_0x454710[_0xf407('0x1d')];var _0x588fe4=_0x48fd5d?_0x4c1320[_0xf407('0x20')]:_0x454710[_0xf407('0x1d')]+_0x454710[_0xf407('0x1f')];var _0x334c1a;if(_0x588fe4>=_0x351252){_0x588fe4=_0x351252;_0x334c1a=0xc8;}else{_0x334c1a=0xce;}_0x593e36[_0xf407('0x1a')](_0x334c1a);return _0x593e36[_0xf407('0x21')]('Content-Range',_0x4ddbe6+'-'+_0x588fe4+'/'+_0x351252)[_0xf407('0x1c')](_0x4c1320);}return null;};}function patchUpdates(_0x39febd){return function(_0x2f7ed0){try{jsonpatch[_0xf407('0x22')](_0x2f7ed0,_0x39febd,!![]);}catch(_0x4eb0c3){return BPromise[_0xf407('0x23')](_0x4eb0c3);}return _0x2f7ed0[_0xf407('0x24')]();};}function saveUpdates(_0x23659c,_0xa6f11e){return function(_0x5f32bb){if(_0x5f32bb){return _0x5f32bb['update'](_0x23659c)[_0xf407('0x25')](function(_0x100e6e){return _0x100e6e;});}return null;};}function removeEntity(_0x2558a1,_0x2cea00){return function(_0x9406cf){if(_0x9406cf){return _0x9406cf[_0xf407('0x26')]()[_0xf407('0x25')](function(){_0x2558a1['status'](0xcc)[_0xf407('0x1b')]();});}};}function handleEntityNotFound(_0x1996c8,_0x2f620d){return function(_0x50897a){if(!_0x50897a){_0x1996c8[_0xf407('0x19')](0x194);}return _0x50897a;};}function handleError(_0x1bbd76,_0x2757f7){_0x2757f7=_0x2757f7||0x1f4;return function(_0x2c594a){logger[_0xf407('0x27')](_0x2c594a[_0xf407('0x28')]);if(_0x2c594a['name']){delete _0x2c594a[_0xf407('0x29')];}_0x1bbd76['status'](_0x2757f7)['send'](_0x2c594a);};}exports[_0xf407('0x2a')]=function(_0x115dce,_0x2705c0){var _0x582453={},_0x1c5335={},_0x249028={'count':0x0,'rows':[]};var _0x4c49b7=_[_0xf407('0x2b')](db[_0xf407('0x2c')][_0xf407('0x2d')],function(_0x89915b){return{'name':_0x89915b[_0xf407('0x2e')],'type':_0x89915b['type']['key']};});_0x1c5335[_0xf407('0x2f')]=_[_0xf407('0x2b')](_0x4c49b7,_0xf407('0x29'));_0x1c5335[_0xf407('0x30')]=_[_0xf407('0x31')](_0x115dce[_0xf407('0x30')]);_0x1c5335[_0xf407('0x32')]=_['intersection'](_0x1c5335[_0xf407('0x2f')],_0x1c5335['query']);_0x582453[_0xf407('0x33')]=_[_0xf407('0x34')](_0x1c5335['model'],qs['fields'](_0x115dce['query'][_0xf407('0x35')]));_0x582453[_0xf407('0x33')]=_0x582453['attributes'][_0xf407('0x36')]?_0x582453[_0xf407('0x33')]:_0x1c5335[_0xf407('0x2f')];if(!_0x115dce[_0xf407('0x30')]['hasOwnProperty']('nolimit')){_0x582453[_0xf407('0x1f')]=qs[_0xf407('0x1f')](_0x115dce[_0xf407('0x30')][_0xf407('0x1f')]);_0x582453[_0xf407('0x1d')]=qs[_0xf407('0x1d')](_0x115dce[_0xf407('0x30')][_0xf407('0x1d')]);}_0x582453[_0xf407('0x37')]=qs[_0xf407('0x38')](_0x115dce['query'][_0xf407('0x38')]);_0x582453['where']=qs[_0xf407('0x32')](_[_0xf407('0x39')](_0x115dce[_0xf407('0x30')],_0x1c5335[_0xf407('0x32')]),_0x4c49b7);if(_0x115dce[_0xf407('0x30')]['filter']){_0x582453[_0xf407('0x3a')]=_[_0xf407('0x3b')](_0x582453[_0xf407('0x3a')],{'$or':_[_0xf407('0x2b')](_0x4c49b7,function(_0x492ba9){if(_0x492ba9[_0xf407('0x3c')]!==_0xf407('0x3d')){var _0xe84235={};_0xe84235[_0x492ba9['name']]={'$like':'%'+_0x115dce['query'][_0xf407('0x3e')]+'%'};return _0xe84235;}})});}_0x582453=_['merge']({},_0x582453,_0x115dce['options']);var _0x612d67={'where':_0x582453[_0xf407('0x3a')]};return db['FreshdeskField'][_0xf407('0x20')](_0x612d67)[_0xf407('0x25')](function(_0x2ceefd){_0x249028[_0xf407('0x20')]=_0x2ceefd;if(_0x115dce[_0xf407('0x30')]['includeAll']){_0x582453[_0xf407('0x3f')]=[{'all':!![]}];}return db['FreshdeskField']['findAll'](_0x582453);})[_0xf407('0x25')](function(_0x1ddb15){_0x249028['rows']=_0x1ddb15;return _0x249028;})[_0xf407('0x25')](respondWithFilteredResult(_0x2705c0,_0x582453))[_0xf407('0x40')](handleError(_0x2705c0,null));};exports[_0xf407('0x41')]=function(_0x1696e6,_0x43e7a7){var _0xaa954d={'raw':!![],'where':{'id':_0x1696e6[_0xf407('0x42')]['id']}},_0x1c8f17={};_0x1c8f17['model']=_[_0xf407('0x31')](db['FreshdeskField'][_0xf407('0x2d')]);_0x1c8f17['query']=_[_0xf407('0x31')](_0x1696e6['query']);_0x1c8f17[_0xf407('0x32')]=_[_0xf407('0x34')](_0x1c8f17[_0xf407('0x2f')],_0x1c8f17[_0xf407('0x30')]);_0xaa954d[_0xf407('0x33')]=_[_0xf407('0x34')](_0x1c8f17[_0xf407('0x2f')],qs['fields'](_0x1696e6[_0xf407('0x30')][_0xf407('0x35')]));_0xaa954d[_0xf407('0x33')]=_0xaa954d[_0xf407('0x33')][_0xf407('0x36')]?_0xaa954d[_0xf407('0x33')]:_0x1c8f17['model'];if(_0x1696e6[_0xf407('0x30')][_0xf407('0x43')]){_0xaa954d[_0xf407('0x3f')]=[{'all':!![]}];}_0xaa954d=_[_0xf407('0x3b')]({},_0xaa954d,_0x1696e6[_0xf407('0x44')]);return db[_0xf407('0x2c')]['find'](_0xaa954d)[_0xf407('0x25')](handleEntityNotFound(_0x43e7a7,null))[_0xf407('0x25')](respondWithResult(_0x43e7a7,null))[_0xf407('0x40')](handleError(_0x43e7a7,null));};exports['create']=function(_0x2ce4c0,_0x49cf34){return db[_0xf407('0x2c')][_0xf407('0x45')](_0x2ce4c0[_0xf407('0x46')],{})[_0xf407('0x25')](respondWithResult(_0x49cf34,0xc9))['catch'](handleError(_0x49cf34,null));};exports[_0xf407('0x47')]=function(_0x3b6c44,_0x16cf14){if(_0x3b6c44['body']['id']){delete _0x3b6c44['body']['id'];}return db[_0xf407('0x2c')][_0xf407('0x48')]({'where':{'id':_0x3b6c44[_0xf407('0x42')]['id']}})['then'](handleEntityNotFound(_0x16cf14,null))[_0xf407('0x25')](saveUpdates(_0x3b6c44[_0xf407('0x46')],null))[_0xf407('0x25')](respondWithResult(_0x16cf14,null))[_0xf407('0x40')](handleError(_0x16cf14,null));};exports['destroy']=function(_0x1282df,_0x3d3c9d){return db['FreshdeskField'][_0xf407('0x48')]({'where':{'id':_0x1282df[_0xf407('0x42')]['id']}})[_0xf407('0x25')](handleEntityNotFound(_0x3d3c9d,null))['then'](removeEntity(_0x3d3c9d,null))[_0xf407('0x40')](handleError(_0x3d3c9d,null));}; \ No newline at end of file diff --git a/server/api/intFreshdeskField/intFreshdeskField.model.js b/server/api/intFreshdeskField/intFreshdeskField.model.js index 17cf7bb..88c6d90 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 _0x6250=['FieldId','util','../../config/logger','request-promise','rimraf','../../config/environment','./intFreshdeskField.attributes','exports','define','FreshdeskField','freshdesk_unique_index','idField'];(function(_0x536037,_0x2b2515){var _0x1484eb=function(_0x4584ee){while(--_0x4584ee){_0x536037['push'](_0x536037['shift']());}};_0x1484eb(++_0x2b2515);}(_0x6250,0x85));var _0x0625=function(_0x10c038,_0x52b5ec){_0x10c038=_0x10c038-0x0;var _0x461d40=_0x6250[_0x10c038];return _0x461d40;};'use strict';var _=require('lodash');var util=require(_0x0625('0x0'));var logger=require(_0x0625('0x1'))('api');var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0x0625('0x2'));var fs=require('fs');var path=require('path');var rimraf=require(_0x0625('0x3'));var config=require(_0x0625('0x4'));var attributes=require(_0x0625('0x5'));module[_0x0625('0x6')]=function(_0x44cc7e,_0x7ed7c){return _0x44cc7e[_0x0625('0x7')](_0x0625('0x8'),attributes,{'tableName':'int_freshdesk_fields','paranoid':![],'indexes':[{'name':_0x0625('0x9'),'fields':[_0x0625('0xa'),_0x0625('0xb')],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file +var _0x4860=['define','int_freshdesk_fields','freshdesk_unique_index','idField','lodash','util','../../config/logger','moment','request-promise','path','../../config/environment','./intFreshdeskField.attributes','exports'];(function(_0x21a9d9,_0x4d5ac8){var _0x46adce=function(_0xfdd336){while(--_0xfdd336){_0x21a9d9['push'](_0x21a9d9['shift']());}};_0x46adce(++_0x4d5ac8);}(_0x4860,0x197));var _0x0486=function(_0x20d7a8,_0x2c4258){_0x20d7a8=_0x20d7a8-0x0;var _0x5c4c96=_0x4860[_0x20d7a8];return _0x5c4c96;};'use strict';var _=require(_0x0486('0x0'));var util=require(_0x0486('0x1'));var logger=require(_0x0486('0x2'))('api');var moment=require(_0x0486('0x3'));var BPromise=require('bluebird');var rp=require(_0x0486('0x4'));var fs=require('fs');var path=require(_0x0486('0x5'));var rimraf=require('rimraf');var config=require(_0x0486('0x6'));var attributes=require(_0x0486('0x7'));module[_0x0486('0x8')]=function(_0x47946b,_0x355f17){return _0x47946b[_0x0486('0x9')]('FreshdeskField',attributes,{'tableName':_0x0486('0xa'),'paranoid':![],'indexes':[{'name':_0x0486('0xb'),'fields':[_0x0486('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 96d3ed7..697bbc9 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 _0x302f=['then','info','FreshdeskField,\x20%s,\x20%s','request\x20sent','debug','FreshdeskField,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','util','moment','bluebird','ioredis','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request'];(function(_0x397e5f,_0x454c8f){var _0x5302b8=function(_0x1a29ef){while(--_0x1a29ef){_0x397e5f['push'](_0x397e5f['shift']());}};_0x5302b8(++_0x454c8f);}(_0x302f,0x1aa));var _0xf302=function(_0x52788d,_0x3c67ca){_0x52788d=_0x52788d-0x0;var _0x5c7576=_0x302f[_0x52788d];return _0x5c7576;};'use strict';var _=require('lodash');var util=require(_0xf302('0x0'));var moment=require(_0xf302('0x1'));var BPromise=require(_0xf302('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xf302('0x3'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0xf302('0x4'))(_0xf302('0x5'));var config=require(_0xf302('0x6'));var jayson=require(_0xf302('0x7'));var client=jayson[_0xf302('0x8')][_0xf302('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x423c9e,_0x469cab,_0x386cb6){return new BPromise(function(_0x5d5691,_0x5d49c5){return client[_0xf302('0xa')](_0x423c9e,_0x386cb6)[_0xf302('0xb')](function(_0x3bbaa5){logger[_0xf302('0xc')](_0xf302('0xd'),_0x469cab,_0xf302('0xe'));logger[_0xf302('0xf')](_0xf302('0x10'),_0x469cab,_0xf302('0xe'),JSON[_0xf302('0x11')](_0x3bbaa5));if(_0x3bbaa5[_0xf302('0x12')]){if(_0x3bbaa5[_0xf302('0x12')][_0xf302('0x13')]===0x1f4){logger[_0xf302('0x12')](_0xf302('0xd'),_0x469cab,_0x3bbaa5['error'][_0xf302('0x14')]);return _0x5d49c5(_0x3bbaa5[_0xf302('0x12')][_0xf302('0x14')]);}logger[_0xf302('0x12')](_0xf302('0xd'),_0x469cab,_0x3bbaa5[_0xf302('0x12')][_0xf302('0x14')]);return _0x5d5691(_0x3bbaa5[_0xf302('0x12')][_0xf302('0x14')]);}else{logger[_0xf302('0xc')](_0xf302('0xd'),_0x469cab,'request\x20sent');_0x5d5691(_0x3bbaa5[_0xf302('0x15')][_0xf302('0x14')]);}})[_0xf302('0x16')](function(_0x1ee23c){logger['error'](_0xf302('0xd'),_0x469cab,_0x1ee23c);_0x5d49c5(_0x1ee23c);});});} \ No newline at end of file +var _0x419d=['then','info','request\x20sent','FreshdeskField,\x20%s,\x20%s,\x20%s','stringify','error','code','FreshdeskField,\x20%s,\x20%s','message','result','catch','lodash','util','moment','bluebird','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','request'];(function(_0x30aaf8,_0x45433d){var _0x5d735f=function(_0x5a6d6a){while(--_0x5a6d6a){_0x30aaf8['push'](_0x30aaf8['shift']());}};_0x5d735f(++_0x45433d);}(_0x419d,0x11f));var _0xd419=function(_0x3a6e4b,_0x118cd9){_0x3a6e4b=_0x3a6e4b-0x0;var _0x36572d=_0x419d[_0x3a6e4b];return _0x36572d;};'use strict';var _=require(_0xd419('0x0'));var util=require(_0xd419('0x1'));var moment=require(_0xd419('0x2'));var BPromise=require(_0xd419('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xd419('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0xd419('0x5'));var logger=require(_0xd419('0x6'))(_0xd419('0x7'));var config=require(_0xd419('0x8'));var jayson=require('jayson/promise');var client=jayson[_0xd419('0x9')][_0xd419('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x65b2d9,_0x3ffa11,_0xbe4e26){return new BPromise(function(_0x5ba2ae,_0x2a3d89){return client[_0xd419('0xb')](_0x65b2d9,_0xbe4e26)[_0xd419('0xc')](function(_0x1f17b2){logger[_0xd419('0xd')]('FreshdeskField,\x20%s,\x20%s',_0x3ffa11,_0xd419('0xe'));logger['debug'](_0xd419('0xf'),_0x3ffa11,_0xd419('0xe'),JSON[_0xd419('0x10')](_0x1f17b2));if(_0x1f17b2[_0xd419('0x11')]){if(_0x1f17b2['error'][_0xd419('0x12')]===0x1f4){logger[_0xd419('0x11')](_0xd419('0x13'),_0x3ffa11,_0x1f17b2[_0xd419('0x11')]['message']);return _0x2a3d89(_0x1f17b2['error']['message']);}logger['error'](_0xd419('0x13'),_0x3ffa11,_0x1f17b2['error'][_0xd419('0x14')]);return _0x5ba2ae(_0x1f17b2[_0xd419('0x11')]['message']);}else{logger[_0xd419('0xd')]('FreshdeskField,\x20%s,\x20%s',_0x3ffa11,_0xd419('0xe'));_0x5ba2ae(_0x1f17b2[_0xd419('0x15')][_0xd419('0x14')]);}})[_0xd419('0x16')](function(_0x21073e){logger['error'](_0xd419('0x13'),_0x3ffa11,_0x21073e);_0x2a3d89(_0x21073e);});});} \ No newline at end of file diff --git a/server/api/intFreshsalesAccount/index.js b/server/api/intFreshsalesAccount/index.js index b9d3bbf..deaf049 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 _0x757a=['destroy','exports','util','path','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./intFreshsalesAccount.controller','get','index','isAuthenticated','show','/:id/configurations','/:id/fields','getFields','post','create','/:id','delete'];(function(_0x22b39b,_0x2b7d63){var _0x280e1d=function(_0xc74635){while(--_0xc74635){_0x22b39b['push'](_0x22b39b['shift']());}};_0x280e1d(++_0x2b7d63);}(_0x757a,0xde));var _0xa757=function(_0x14b1ae,_0x27a672){_0x14b1ae=_0x14b1ae-0x0;var _0x302184=_0x757a[_0x14b1ae];return _0x302184;};'use strict';var multer=require('multer');var util=require(_0xa757('0x0'));var path=require(_0xa757('0x1'));var timeout=require('connect-timeout');var express=require('express');var router=express['Router']();var fs_extra=require(_0xa757('0x2'));var auth=require(_0xa757('0x3'));var interaction=require(_0xa757('0x4'));var config=require(_0xa757('0x5'));var controller=require(_0xa757('0x6'));router[_0xa757('0x7')]('/',auth['isAuthenticated'](),controller[_0xa757('0x8')]);router[_0xa757('0x7')]('/:id',auth[_0xa757('0x9')](),controller[_0xa757('0xa')]);router[_0xa757('0x7')](_0xa757('0xb'),auth[_0xa757('0x9')](),controller['getConfigurations']);router[_0xa757('0x7')](_0xa757('0xc'),auth[_0xa757('0x9')](),controller[_0xa757('0xd')]);router[_0xa757('0xe')]('/',auth[_0xa757('0x9')](),controller[_0xa757('0xf')]);router['post']('/:id/configurations',auth['isAuthenticated'](),controller['addConfiguration']);router['put'](_0xa757('0x10'),auth['isAuthenticated'](),controller['update']);router[_0xa757('0x11')]('/:id',auth['isAuthenticated'](),controller[_0xa757('0x12')]);module[_0xa757('0x13')]=router; \ No newline at end of file +var _0x6e6c=['../../config/environment','get','isAuthenticated','/:id','show','/:id/fields','getFields','post','create','/:id/configurations','addConfiguration','update','delete','destroy','exports','multer','util','connect-timeout','express','../../components/auth/service'];(function(_0x2e2394,_0x222316){var _0x4f7b17=function(_0x17d1fa){while(--_0x17d1fa){_0x2e2394['push'](_0x2e2394['shift']());}};_0x4f7b17(++_0x222316);}(_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('./intFreshsalesAccount.controller');router[_0xc6e6('0x6')]('/',auth[_0xc6e6('0x7')](),controller['index']);router[_0xc6e6('0x6')](_0xc6e6('0x8'),auth['isAuthenticated'](),controller[_0xc6e6('0x9')]);router[_0xc6e6('0x6')]('/:id/configurations',auth[_0xc6e6('0x7')](),controller['getConfigurations']);router[_0xc6e6('0x6')](_0xc6e6('0xa'),auth[_0xc6e6('0x7')](),controller[_0xc6e6('0xb')]);router[_0xc6e6('0xc')]('/',auth[_0xc6e6('0x7')](),controller[_0xc6e6('0xd')]);router[_0xc6e6('0xc')](_0xc6e6('0xe'),auth['isAuthenticated'](),controller[_0xc6e6('0xf')]);router['put'](_0xc6e6('0x8'),auth[_0xc6e6('0x7')](),controller[_0xc6e6('0x10')]);router[_0xc6e6('0x11')]('/:id',auth[_0xc6e6('0x7')](),controller[_0xc6e6('0x12')]);module[_0xc6e6('0x13')]=router; \ No newline at end of file diff --git a/server/api/intFreshsalesAccount/intFreshsalesAccount.attributes.js b/server/api/intFreshsalesAccount/intFreshsalesAccount.attributes.js index 799c70b..e85ee55 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 _0xffd6=['exports','STRING','username','sequelize'];(function(_0x1d4848,_0x5975f3){var _0x43a2b8=function(_0x38a2d3){while(--_0x38a2d3){_0x1d4848['push'](_0x1d4848['shift']());}};_0x43a2b8(++_0x5975f3);}(_0xffd6,0x97));var _0x6ffd=function(_0x45fc6a,_0x166adb){_0x45fc6a=_0x45fc6a-0x0;var _0x14bcfd=_0xffd6[_0x45fc6a];return _0x14bcfd;};'use strict';var Sequelize=require(_0x6ffd('0x0'));module[_0x6ffd('0x1')]={'name':{'type':Sequelize[_0x6ffd('0x2')]},'description':{'type':Sequelize['STRING']},'username':{'type':Sequelize['STRING'],'unique':_0x6ffd('0x3')},'apiKey':{'type':Sequelize[_0x6ffd('0x2')]},'remoteUri':{'type':Sequelize[_0x6ffd('0x2')],'unique':'remoteUri'},'serverUrl':{'type':Sequelize[_0x6ffd('0x2')],'allowNull':![]}}; \ No newline at end of file +var _0x1a37=['sequelize','exports','STRING','username','remoteUri'];(function(_0x227e24,_0x573dd6){var _0x2ccc99=function(_0x177963){while(--_0x177963){_0x227e24['push'](_0x227e24['shift']());}};_0x2ccc99(++_0x573dd6);}(_0x1a37,0xb4));var _0x71a3=function(_0x5bd426,_0x4878e5){_0x5bd426=_0x5bd426-0x0;var _0x23a7eb=_0x1a37[_0x5bd426];return _0x23a7eb;};'use strict';var Sequelize=require(_0x71a3('0x0'));module[_0x71a3('0x1')]={'name':{'type':Sequelize[_0x71a3('0x2')]},'description':{'type':Sequelize[_0x71a3('0x2')]},'username':{'type':Sequelize[_0x71a3('0x2')],'unique':_0x71a3('0x3')},'apiKey':{'type':Sequelize[_0x71a3('0x2')]},'remoteUri':{'type':Sequelize[_0x71a3('0x2')],'unique':_0x71a3('0x4')},'serverUrl':{'type':Sequelize[_0x71a3('0x2')],'allowNull':![]}}; \ No newline at end of file diff --git a/server/api/intFreshsalesAccount/intFreshsalesAccount.controller.js b/server/api/intFreshsalesAccount/intFreshsalesAccount.controller.js index da1aa35..7f9e1a7 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 _0xe168=['reject','save','then','destroy','error','stack','name','send','index','map','FreshsalesAccount','rawAttributes','type','key','model','query','filters','intersection','attributes','fields','hasOwnProperty','nolimit','sort','where','VIRTUAL','filter','options','includeAll','include','findAll','rows','catch','keys','length','merge','body','update','find','params','getConfigurations','findOne','FreshsalesConfiguration','order','pick','addConfiguration','AccountId','getSubjects','channel','create','FreshsalesField','Descriptions','getFields','remoteUri','apiKey','username','slice','substring','lastIndexOf','GET','format','%s%s','Token\x20token=','email','test','statusCode','getFields,\x20%s,\x20%s,\x20%s','stringify','Wrong\x20credentials','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','sox','to-csv','ejs','fs-extra','jsforce','desk.js','querystring','../../components/auth/service','../../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'];(function(_0x5d0d60,_0x1a7010){var _0x94f865=function(_0x20aaab){while(--_0x20aaab){_0x5d0d60['push'](_0x5d0d60['shift']());}};_0x94f865(++_0x1a7010);}(_0xe168,0x1dc));var _0x8e16=function(_0x5cfd12,_0x2b2935){_0x5cfd12=_0x5cfd12-0x0;var _0x1b4b38=_0xe168[_0x5cfd12];return _0x1b4b38;};'use strict';var emlformat=require(_0x8e16('0x0'));var rimraf=require(_0x8e16('0x1'));var zipdir=require(_0x8e16('0x2'));var jsonpatch=require(_0x8e16('0x3'));var rp=require(_0x8e16('0x4'));var moment=require(_0x8e16('0x5'));var BPromise=require(_0x8e16('0x6'));var Mustache=require(_0x8e16('0x7'));var util=require(_0x8e16('0x8'));var path=require('path');var sox=require(_0x8e16('0x9'));var csv=require(_0x8e16('0xa'));var ejs=require(_0x8e16('0xb'));var fs=require('fs');var fs_extra=require(_0x8e16('0xc'));var _=require('lodash');var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0x8e16('0xd'));var deskjs=require(_0x8e16('0xe'));var toCsv=require(_0x8e16('0xa'));var querystring=require(_0x8e16('0xf'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0x8e16('0x10'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x8e16('0x11'));var logger=require(_0x8e16('0x12'))(_0x8e16('0x13'));var utils=require(_0x8e16('0x14'));var config=require(_0x8e16('0x15'));var licenseUtil=require(_0x8e16('0x16'));var db=require(_0x8e16('0x17'))['db'];var integrations=require('../../components/integrations/configuration');function respondWithStatusCode(_0xec9c1b,_0x327238){_0x327238=_0x327238||0xcc;return function(_0x5d6e10){if(_0x5d6e10){return _0xec9c1b[_0x8e16('0x18')](_0x327238);}return _0xec9c1b[_0x8e16('0x19')](_0x327238)[_0x8e16('0x1a')]();};}function respondWithResult(_0x5c8bf7,_0x3c6b99){_0x3c6b99=_0x3c6b99||0xc8;return function(_0x271d1f){if(_0x271d1f){return _0x5c8bf7['status'](_0x3c6b99)[_0x8e16('0x1b')](_0x271d1f);}};}function respondWithFilteredResult(_0x5a5a3e,_0x5be05f){return function(_0x58476f){if(_0x58476f){var _0x4ae258=typeof _0x5be05f[_0x8e16('0x1c')]===_0x8e16('0x1d')&&typeof _0x5be05f[_0x8e16('0x1e')]===_0x8e16('0x1d');var _0x49ffba=_0x58476f['count'];var _0x38eb17=_0x4ae258?0x0:_0x5be05f[_0x8e16('0x1c')];var _0xfc1666=_0x4ae258?_0x58476f[_0x8e16('0x1f')]:_0x5be05f[_0x8e16('0x1c')]+_0x5be05f[_0x8e16('0x1e')];var _0x191df4;if(_0xfc1666>=_0x49ffba){_0xfc1666=_0x49ffba;_0x191df4=0xc8;}else{_0x191df4=0xce;}_0x5a5a3e['status'](_0x191df4);return _0x5a5a3e[_0x8e16('0x20')](_0x8e16('0x21'),_0x38eb17+'-'+_0xfc1666+'/'+_0x49ffba)[_0x8e16('0x1b')](_0x58476f);}return null;};}function patchUpdates(_0x59f7d3){return function(_0x18760b){try{jsonpatch['apply'](_0x18760b,_0x59f7d3,!![]);}catch(_0x39b0e6){return BPromise[_0x8e16('0x22')](_0x39b0e6);}return _0x18760b[_0x8e16('0x23')]();};}function saveUpdates(_0x385f3f,_0x28b3ef){return function(_0x24372a){if(_0x24372a){return _0x24372a['update'](_0x385f3f)[_0x8e16('0x24')](function(_0xc24f16){return _0xc24f16;});}return null;};}function removeEntity(_0x21bbab,_0x1df7bf){return function(_0x19f907){if(_0x19f907){return _0x19f907[_0x8e16('0x25')]()[_0x8e16('0x24')](function(){_0x21bbab[_0x8e16('0x19')](0xcc)[_0x8e16('0x1a')]();});}};}function handleEntityNotFound(_0x25d727,_0x3538af){return function(_0x199608){if(!_0x199608){_0x25d727['sendStatus'](0x194);}return _0x199608;};}function handleError(_0x3bb67c,_0x55301f){_0x55301f=_0x55301f||0x1f4;return function(_0x1b0606){logger[_0x8e16('0x26')](_0x1b0606[_0x8e16('0x27')]);if(_0x1b0606[_0x8e16('0x28')]){delete _0x1b0606[_0x8e16('0x28')];}_0x3bb67c[_0x8e16('0x19')](_0x55301f)[_0x8e16('0x29')](_0x1b0606);};}exports[_0x8e16('0x2a')]=function(_0x54b3a4,_0xe1d867){var _0x2cd69f={},_0x166fb1={},_0xa0eec4={'count':0x0,'rows':[]};var _0x407302=_[_0x8e16('0x2b')](db[_0x8e16('0x2c')][_0x8e16('0x2d')],function(_0x14b70b){return{'name':_0x14b70b['fieldName'],'type':_0x14b70b[_0x8e16('0x2e')][_0x8e16('0x2f')]};});_0x166fb1[_0x8e16('0x30')]=_[_0x8e16('0x2b')](_0x407302,_0x8e16('0x28'));_0x166fb1[_0x8e16('0x31')]=_['keys'](_0x54b3a4['query']);_0x166fb1[_0x8e16('0x32')]=_[_0x8e16('0x33')](_0x166fb1[_0x8e16('0x30')],_0x166fb1[_0x8e16('0x31')]);_0x2cd69f[_0x8e16('0x34')]=_['intersection'](_0x166fb1['model'],qs[_0x8e16('0x35')](_0x54b3a4[_0x8e16('0x31')][_0x8e16('0x35')]));_0x2cd69f[_0x8e16('0x34')]=_0x2cd69f[_0x8e16('0x34')]['length']?_0x2cd69f[_0x8e16('0x34')]:_0x166fb1[_0x8e16('0x30')];if(!_0x54b3a4[_0x8e16('0x31')][_0x8e16('0x36')](_0x8e16('0x37'))){_0x2cd69f[_0x8e16('0x1e')]=qs[_0x8e16('0x1e')](_0x54b3a4['query'][_0x8e16('0x1e')]);_0x2cd69f[_0x8e16('0x1c')]=qs[_0x8e16('0x1c')](_0x54b3a4[_0x8e16('0x31')]['offset']);}_0x2cd69f['order']=qs[_0x8e16('0x38')](_0x54b3a4[_0x8e16('0x31')][_0x8e16('0x38')]);_0x2cd69f[_0x8e16('0x39')]=qs[_0x8e16('0x32')](_['pick'](_0x54b3a4[_0x8e16('0x31')],_0x166fb1['filters']),_0x407302);if(_0x54b3a4['query']['filter']){_0x2cd69f[_0x8e16('0x39')]=_['merge'](_0x2cd69f[_0x8e16('0x39')],{'$or':_[_0x8e16('0x2b')](_0x407302,function(_0x8124ed){if(_0x8124ed[_0x8e16('0x2e')]!==_0x8e16('0x3a')){var _0x951ff={};_0x951ff[_0x8124ed[_0x8e16('0x28')]]={'$like':'%'+_0x54b3a4['query'][_0x8e16('0x3b')]+'%'};return _0x951ff;}})});}_0x2cd69f=_['merge']({},_0x2cd69f,_0x54b3a4[_0x8e16('0x3c')]);var _0x5212c2={'where':_0x2cd69f[_0x8e16('0x39')]};return db[_0x8e16('0x2c')]['count'](_0x5212c2)['then'](function(_0x32e062){_0xa0eec4[_0x8e16('0x1f')]=_0x32e062;if(_0x54b3a4[_0x8e16('0x31')][_0x8e16('0x3d')]){_0x2cd69f[_0x8e16('0x3e')]=[{'all':!![]}];}return db[_0x8e16('0x2c')][_0x8e16('0x3f')](_0x2cd69f);})['then'](function(_0x3874e9){_0xa0eec4[_0x8e16('0x40')]=_0x3874e9;return _0xa0eec4;})[_0x8e16('0x24')](respondWithFilteredResult(_0xe1d867,_0x2cd69f))[_0x8e16('0x41')](handleError(_0xe1d867,null));};exports['show']=function(_0x2520c9,_0x582c84){var _0x227075={'raw':![],'where':{'id':_0x2520c9['params']['id']}},_0x1082c5={};_0x1082c5['model']=_[_0x8e16('0x42')](db[_0x8e16('0x2c')][_0x8e16('0x2d')]);_0x1082c5[_0x8e16('0x31')]=_[_0x8e16('0x42')](_0x2520c9[_0x8e16('0x31')]);_0x1082c5[_0x8e16('0x32')]=_['intersection'](_0x1082c5['model'],_0x1082c5[_0x8e16('0x31')]);_0x227075[_0x8e16('0x34')]=_['intersection'](_0x1082c5[_0x8e16('0x30')],qs['fields'](_0x2520c9[_0x8e16('0x31')][_0x8e16('0x35')]));_0x227075[_0x8e16('0x34')]=_0x227075[_0x8e16('0x34')][_0x8e16('0x43')]?_0x227075[_0x8e16('0x34')]:_0x1082c5[_0x8e16('0x30')];if(_0x2520c9[_0x8e16('0x31')]['includeAll']){_0x227075[_0x8e16('0x3e')]=[{'all':!![]}];}_0x227075=_[_0x8e16('0x44')]({},_0x227075,_0x2520c9[_0x8e16('0x3c')]);return db[_0x8e16('0x2c')]['find'](_0x227075)['then'](handleEntityNotFound(_0x582c84,null))['then'](respondWithResult(_0x582c84,null))[_0x8e16('0x41')](handleError(_0x582c84,null));};exports['create']=function(_0x413c03,_0x508bad){return db[_0x8e16('0x2c')]['create'](_0x413c03[_0x8e16('0x45')],{})[_0x8e16('0x24')](respondWithResult(_0x508bad,0xc9))[_0x8e16('0x41')](handleError(_0x508bad,null));};exports[_0x8e16('0x46')]=function(_0x21f264,_0x35038a){if(_0x21f264[_0x8e16('0x45')]['id']){delete _0x21f264[_0x8e16('0x45')]['id'];}return db[_0x8e16('0x2c')][_0x8e16('0x47')]({'where':{'id':_0x21f264[_0x8e16('0x48')]['id']}})['then'](handleEntityNotFound(_0x35038a,null))[_0x8e16('0x24')](saveUpdates(_0x21f264[_0x8e16('0x45')],null))[_0x8e16('0x24')](respondWithResult(_0x35038a,null))[_0x8e16('0x41')](handleError(_0x35038a,null));};exports[_0x8e16('0x25')]=function(_0x29d47e,_0x208afd){return db[_0x8e16('0x2c')][_0x8e16('0x47')]({'where':{'id':_0x29d47e[_0x8e16('0x48')]['id']}})[_0x8e16('0x24')](handleEntityNotFound(_0x208afd,null))[_0x8e16('0x24')](removeEntity(_0x208afd,null))[_0x8e16('0x41')](handleError(_0x208afd,null));};exports[_0x8e16('0x49')]=function(_0x6e4f83,_0x222793,_0x259207){var _0x39a7d5={};var _0x255074={};var _0x4b1b9a;var _0x4f199c;return db['FreshsalesAccount'][_0x8e16('0x4a')]({'where':{'id':_0x6e4f83['params']['id']}})[_0x8e16('0x24')](handleEntityNotFound(_0x222793,null))['then'](function(_0x221068){if(_0x221068){_0x4b1b9a=_0x221068;_0x255074[_0x8e16('0x30')]=_[_0x8e16('0x42')](db[_0x8e16('0x4b')][_0x8e16('0x2d')]);_0x255074['query']=_[_0x8e16('0x42')](_0x6e4f83[_0x8e16('0x31')]);_0x255074[_0x8e16('0x32')]=_[_0x8e16('0x33')](_0x255074[_0x8e16('0x30')],_0x255074[_0x8e16('0x31')]);_0x39a7d5['attributes']=_[_0x8e16('0x33')](_0x255074[_0x8e16('0x30')],qs[_0x8e16('0x35')](_0x6e4f83[_0x8e16('0x31')][_0x8e16('0x35')]));_0x39a7d5[_0x8e16('0x34')]=_0x39a7d5['attributes']['length']?_0x39a7d5['attributes']:_0x255074[_0x8e16('0x30')];_0x39a7d5[_0x8e16('0x4c')]=qs['sort'](_0x6e4f83['query']['sort']);_0x39a7d5[_0x8e16('0x39')]=qs[_0x8e16('0x32')](_[_0x8e16('0x4d')](_0x6e4f83[_0x8e16('0x31')],_0x255074[_0x8e16('0x32')]));if(_0x6e4f83['query'][_0x8e16('0x3b')]){_0x39a7d5[_0x8e16('0x39')]=_[_0x8e16('0x44')](_0x39a7d5[_0x8e16('0x39')],{'$or':_['map'](_0x39a7d5[_0x8e16('0x34')],function(_0x5602fe){var _0x215bf7={};_0x215bf7[_0x5602fe]={'$like':'%'+_0x6e4f83['query'][_0x8e16('0x3b')]+'%'};return _0x215bf7;})});}_0x39a7d5=_[_0x8e16('0x44')]({},_0x39a7d5,_0x6e4f83[_0x8e16('0x3c')]);return _0x4b1b9a['getConfigurations'](_0x39a7d5);}})[_0x8e16('0x24')](function(_0x901634){if(_0x901634){_0x4f199c=_0x901634['length'];if(!_0x6e4f83['query'][_0x8e16('0x36')](_0x8e16('0x37'))){_0x39a7d5['limit']=qs[_0x8e16('0x1e')](_0x6e4f83[_0x8e16('0x31')][_0x8e16('0x1e')]);_0x39a7d5['offset']=qs[_0x8e16('0x1c')](_0x6e4f83[_0x8e16('0x31')]['offset']);}return _0x4b1b9a[_0x8e16('0x49')](_0x39a7d5);}})[_0x8e16('0x24')](function(_0x55cd6f){if(_0x55cd6f){return _0x55cd6f?{'count':_0x4f199c,'rows':_0x55cd6f}:null;}})[_0x8e16('0x24')](respondWithResult(_0x222793,null))[_0x8e16('0x41')](handleError(_0x222793,null));};exports[_0x8e16('0x4e')]=function(_0x4958dc,_0x2485f1,_0x269e7d){if(_0x4958dc[_0x8e16('0x45')]['id']){delete _0x4958dc[_0x8e16('0x45')]['id'];}return db[_0x8e16('0x2c')][_0x8e16('0x4a')]({'where':{'id':_0x4958dc[_0x8e16('0x48')]['id']}})[_0x8e16('0x24')](handleEntityNotFound(_0x2485f1,null))[_0x8e16('0x24')](function(_0x4a3165){if(_0x4a3165){_0x4958dc[_0x8e16('0x45')][_0x8e16('0x4f')]=_0x4a3165['id'];_0x4958dc[_0x8e16('0x45')]['Subjects']=integrations[_0x8e16('0x50')](_0x4958dc[_0x8e16('0x45')][_0x8e16('0x51')],_0x4958dc[_0x8e16('0x45')]['type']);_0x4958dc[_0x8e16('0x45')]['Descriptions']=integrations['getDescriptions'](_0x4958dc[_0x8e16('0x45')][_0x8e16('0x51')],_0x4958dc[_0x8e16('0x45')][_0x8e16('0x2e')]);return db[_0x8e16('0x4b')][_0x8e16('0x52')](_0x4958dc[_0x8e16('0x45')],{'include':[{'model':db[_0x8e16('0x53')],'as':'Subjects'},{'model':db['FreshsalesField'],'as':_0x8e16('0x54')}]});}return null;})['then'](respondWithResult(_0x2485f1,null))[_0x8e16('0x41')](handleError(_0x2485f1,null));};exports[_0x8e16('0x55')]=function(_0x35615e,_0x8500b0,_0x2963d9){var _0x1b153c='';var _0x64cc8a='';return db['FreshsalesAccount'][_0x8e16('0x4a')]({'where':{'id':_0x35615e[_0x8e16('0x48')]['id']},'attributes':['id','username',_0x8e16('0x56'),_0x8e16('0x57')]})[_0x8e16('0x24')](handleEntityNotFound(_0x8500b0,null))[_0x8e16('0x24')](function(_0xf0b731){if(_0xf0b731){_0x64cc8a=_0xf0b731[_0x8e16('0x58')];_0x1b153c=_0xf0b731[_0x8e16('0x56')];var _0x5bef8a=_0xf0b731[_0x8e16('0x56')][_0x8e16('0x59')](-0x1);if(_0x5bef8a==='/'){_0x1b153c=_0x1b153c[_0x8e16('0x5a')](0x0,_0x1b153c[_0x8e16('0x5b')](_0x5bef8a));}return rp({'method':_0x8e16('0x5c'),'uri':util[_0x8e16('0x5d')](_0x8e16('0x5e'),_0x1b153c,'/api/selector/owners'),'headers':{'Authorization':_0x8e16('0x5f')+_0xf0b731[_0x8e16('0x57')]},'json':!![]});}})['then'](function(_0x6571e5){if(_0x6571e5){var _0xf9a30=_0x6571e5['users'];var _0x5918e3=![];var _0x5715e3=null;for(_0x5715e3=0x0;_0x5715e3<_0xf9a30[_0x8e16('0x43')];_0x5715e3++){if(_0xf9a30[_0x5715e3][_0x8e16('0x60')]===_0x64cc8a){_0x5918e3=!![];}}if(_0x5918e3){return!![];}else{throw new Error({'statusCode':0x194,'message':'Requested\x20Resource\x20not\x20Found'});}}})[_0x8e16('0x24')](respondWithResult(_0x8500b0,null))[_0x8e16('0x41')](function(_0x4fd46d){var _0x1d8888=_0x35615e['query'][_0x8e16('0x61')]?0x1f4:_0x4fd46d[_0x8e16('0x62')]||0x1f4;logger[_0x8e16('0x26')](_0x8e16('0x63'),_0x8e16('0x55'),_0x1d8888,JSON[_0x8e16('0x64')](_0x4fd46d));delete _0x4fd46d[_0x8e16('0x28')];if(_0x1d8888===0x191){_0x1d8888=0x190;}_0x8500b0['status'](_0x1d8888)['send'](_0x35615e[_0x8e16('0x31')][_0x8e16('0x61')]?{'message':_0x8e16('0x65'),'statusCode':_0x4fd46d[_0x8e16('0x62')]}:_0x4fd46d);});}; \ No newline at end of file +var _0x3482=['fields','attributes','length','order','sort','where','filters','pick','merge','VIRTUAL','filter','options','includeAll','include','rows','catch','show','params','keys','find','create','body','update','getConfigurations','findOne','FreshsalesConfiguration','nolimit','addConfiguration','getSubjects','Descriptions','channel','FreshsalesField','Subjects','getFields','remoteUri','apiKey','username','slice','substring','lastIndexOf','GET','%s%s','/api/selector/owners','Token\x20token=','users','email','Requested\x20Resource\x20not\x20Found','statusCode','getFields,\x20%s,\x20%s,\x20%s','stringify','send','test','Wrong\x20credentials','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','path','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','../../components/integrations/configuration','sendStatus','status','end','json','limit','undefined','count','offset','set','apply','reject','destroy','then','error','stack','name','index','map','FreshsalesAccount','rawAttributes','type','model','intersection','query'];(function(_0x58f6cf,_0x39a197){var _0x23829a=function(_0x523c69){while(--_0x523c69){_0x58f6cf['push'](_0x58f6cf['shift']());}};_0x23829a(++_0x39a197);}(_0x3482,0x9e));var _0x2348=function(_0x476c7,_0x298ee0){_0x476c7=_0x476c7-0x0;var _0x47ae56=_0x3482[_0x476c7];return _0x47ae56;};'use strict';var emlformat=require(_0x2348('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x2348('0x1'));var jsonpatch=require(_0x2348('0x2'));var rp=require(_0x2348('0x3'));var moment=require(_0x2348('0x4'));var BPromise=require(_0x2348('0x5'));var Mustache=require('mustache');var util=require(_0x2348('0x6'));var path=require(_0x2348('0x7'));var sox=require('sox');var csv=require(_0x2348('0x8'));var ejs=require(_0x2348('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x2348('0xa'));var squel=require(_0x2348('0xb'));var crypto=require(_0x2348('0xc'));var jsforce=require(_0x2348('0xd'));var deskjs=require(_0x2348('0xe'));var toCsv=require(_0x2348('0x8'));var querystring=require(_0x2348('0xf'));var Papa=require(_0x2348('0x10'));var Redis=require(_0x2348('0x11'));var authService=require(_0x2348('0x12'));var qs=require(_0x2348('0x13'));var as=require(_0x2348('0x14'));var hardwareService=require(_0x2348('0x15'));var logger=require('../../config/logger')(_0x2348('0x16'));var utils=require(_0x2348('0x17'));var config=require(_0x2348('0x18'));var licenseUtil=require(_0x2348('0x19'));var db=require(_0x2348('0x1a'))['db'];var integrations=require(_0x2348('0x1b'));function respondWithStatusCode(_0x4cc6d9,_0x61328){_0x61328=_0x61328||0xcc;return function(_0x2fadbd){if(_0x2fadbd){return _0x4cc6d9[_0x2348('0x1c')](_0x61328);}return _0x4cc6d9[_0x2348('0x1d')](_0x61328)[_0x2348('0x1e')]();};}function respondWithResult(_0x2f10a7,_0x542724){_0x542724=_0x542724||0xc8;return function(_0x5ccac3){if(_0x5ccac3){return _0x2f10a7['status'](_0x542724)[_0x2348('0x1f')](_0x5ccac3);}};}function respondWithFilteredResult(_0x511294,_0x235655){return function(_0x3f70df){if(_0x3f70df){var _0xfad3b5=typeof _0x235655['offset']==='undefined'&&typeof _0x235655[_0x2348('0x20')]===_0x2348('0x21');var _0xe3d228=_0x3f70df[_0x2348('0x22')];var _0xf54c=_0xfad3b5?0x0:_0x235655['offset'];var _0x54e6ee=_0xfad3b5?_0x3f70df[_0x2348('0x22')]:_0x235655[_0x2348('0x23')]+_0x235655['limit'];var _0x48a1db;if(_0x54e6ee>=_0xe3d228){_0x54e6ee=_0xe3d228;_0x48a1db=0xc8;}else{_0x48a1db=0xce;}_0x511294[_0x2348('0x1d')](_0x48a1db);return _0x511294[_0x2348('0x24')]('Content-Range',_0xf54c+'-'+_0x54e6ee+'/'+_0xe3d228)[_0x2348('0x1f')](_0x3f70df);}return null;};}function patchUpdates(_0x50a098){return function(_0x60778a){try{jsonpatch[_0x2348('0x25')](_0x60778a,_0x50a098,!![]);}catch(_0x5b1a01){return BPromise[_0x2348('0x26')](_0x5b1a01);}return _0x60778a['save']();};}function saveUpdates(_0x28c003,_0x14d96d){return function(_0x3926d8){if(_0x3926d8){return _0x3926d8['update'](_0x28c003)['then'](function(_0x4ff209){return _0x4ff209;});}return null;};}function removeEntity(_0x594fbd,_0x2a7e0e){return function(_0x3780b9){if(_0x3780b9){return _0x3780b9[_0x2348('0x27')]()[_0x2348('0x28')](function(){_0x594fbd[_0x2348('0x1d')](0xcc)[_0x2348('0x1e')]();});}};}function handleEntityNotFound(_0x5e5c1b,_0x341e09){return function(_0x31fc16){if(!_0x31fc16){_0x5e5c1b[_0x2348('0x1c')](0x194);}return _0x31fc16;};}function handleError(_0x3209a5,_0x12fa55){_0x12fa55=_0x12fa55||0x1f4;return function(_0x3a3a36){logger[_0x2348('0x29')](_0x3a3a36[_0x2348('0x2a')]);if(_0x3a3a36[_0x2348('0x2b')]){delete _0x3a3a36[_0x2348('0x2b')];}_0x3209a5[_0x2348('0x1d')](_0x12fa55)['send'](_0x3a3a36);};}exports[_0x2348('0x2c')]=function(_0x29a29c,_0x5a11e2){var _0x2bb23e={},_0x23667b={},_0x54c183={'count':0x0,'rows':[]};var _0x33a97f=_[_0x2348('0x2d')](db[_0x2348('0x2e')][_0x2348('0x2f')],function(_0x264215){return{'name':_0x264215['fieldName'],'type':_0x264215[_0x2348('0x30')]['key']};});_0x23667b[_0x2348('0x31')]=_[_0x2348('0x2d')](_0x33a97f,'name');_0x23667b['query']=_['keys'](_0x29a29c['query']);_0x23667b['filters']=_[_0x2348('0x32')](_0x23667b[_0x2348('0x31')],_0x23667b[_0x2348('0x33')]);_0x2bb23e['attributes']=_[_0x2348('0x32')](_0x23667b['model'],qs[_0x2348('0x34')](_0x29a29c['query']['fields']));_0x2bb23e[_0x2348('0x35')]=_0x2bb23e[_0x2348('0x35')][_0x2348('0x36')]?_0x2bb23e[_0x2348('0x35')]:_0x23667b['model'];if(!_0x29a29c[_0x2348('0x33')]['hasOwnProperty']('nolimit')){_0x2bb23e['limit']=qs[_0x2348('0x20')](_0x29a29c[_0x2348('0x33')][_0x2348('0x20')]);_0x2bb23e[_0x2348('0x23')]=qs[_0x2348('0x23')](_0x29a29c[_0x2348('0x33')][_0x2348('0x23')]);}_0x2bb23e[_0x2348('0x37')]=qs[_0x2348('0x38')](_0x29a29c[_0x2348('0x33')][_0x2348('0x38')]);_0x2bb23e[_0x2348('0x39')]=qs[_0x2348('0x3a')](_[_0x2348('0x3b')](_0x29a29c[_0x2348('0x33')],_0x23667b['filters']),_0x33a97f);if(_0x29a29c[_0x2348('0x33')]['filter']){_0x2bb23e[_0x2348('0x39')]=_[_0x2348('0x3c')](_0x2bb23e[_0x2348('0x39')],{'$or':_[_0x2348('0x2d')](_0x33a97f,function(_0x12355b){if(_0x12355b[_0x2348('0x30')]!==_0x2348('0x3d')){var _0x237bc1={};_0x237bc1[_0x12355b[_0x2348('0x2b')]]={'$like':'%'+_0x29a29c['query'][_0x2348('0x3e')]+'%'};return _0x237bc1;}})});}_0x2bb23e=_[_0x2348('0x3c')]({},_0x2bb23e,_0x29a29c[_0x2348('0x3f')]);var _0x116a94={'where':_0x2bb23e['where']};return db[_0x2348('0x2e')][_0x2348('0x22')](_0x116a94)[_0x2348('0x28')](function(_0x5ec05d){_0x54c183[_0x2348('0x22')]=_0x5ec05d;if(_0x29a29c['query'][_0x2348('0x40')]){_0x2bb23e[_0x2348('0x41')]=[{'all':!![]}];}return db[_0x2348('0x2e')]['findAll'](_0x2bb23e);})[_0x2348('0x28')](function(_0x37cbc6){_0x54c183[_0x2348('0x42')]=_0x37cbc6;return _0x54c183;})[_0x2348('0x28')](respondWithFilteredResult(_0x5a11e2,_0x2bb23e))[_0x2348('0x43')](handleError(_0x5a11e2,null));};exports[_0x2348('0x44')]=function(_0x4da502,_0x290092){var _0x2a600f={'raw':![],'where':{'id':_0x4da502[_0x2348('0x45')]['id']}},_0x11a15e={};_0x11a15e[_0x2348('0x31')]=_[_0x2348('0x46')](db[_0x2348('0x2e')][_0x2348('0x2f')]);_0x11a15e['query']=_[_0x2348('0x46')](_0x4da502[_0x2348('0x33')]);_0x11a15e['filters']=_['intersection'](_0x11a15e[_0x2348('0x31')],_0x11a15e[_0x2348('0x33')]);_0x2a600f['attributes']=_[_0x2348('0x32')](_0x11a15e['model'],qs[_0x2348('0x34')](_0x4da502[_0x2348('0x33')][_0x2348('0x34')]));_0x2a600f[_0x2348('0x35')]=_0x2a600f[_0x2348('0x35')][_0x2348('0x36')]?_0x2a600f['attributes']:_0x11a15e['model'];if(_0x4da502[_0x2348('0x33')]['includeAll']){_0x2a600f['include']=[{'all':!![]}];}_0x2a600f=_[_0x2348('0x3c')]({},_0x2a600f,_0x4da502[_0x2348('0x3f')]);return db[_0x2348('0x2e')][_0x2348('0x47')](_0x2a600f)[_0x2348('0x28')](handleEntityNotFound(_0x290092,null))[_0x2348('0x28')](respondWithResult(_0x290092,null))[_0x2348('0x43')](handleError(_0x290092,null));};exports[_0x2348('0x48')]=function(_0x142d28,_0x126701){return db[_0x2348('0x2e')][_0x2348('0x48')](_0x142d28[_0x2348('0x49')],{})[_0x2348('0x28')](respondWithResult(_0x126701,0xc9))[_0x2348('0x43')](handleError(_0x126701,null));};exports[_0x2348('0x4a')]=function(_0x3b0b96,_0x2d8131){if(_0x3b0b96[_0x2348('0x49')]['id']){delete _0x3b0b96[_0x2348('0x49')]['id'];}return db[_0x2348('0x2e')][_0x2348('0x47')]({'where':{'id':_0x3b0b96[_0x2348('0x45')]['id']}})[_0x2348('0x28')](handleEntityNotFound(_0x2d8131,null))[_0x2348('0x28')](saveUpdates(_0x3b0b96[_0x2348('0x49')],null))[_0x2348('0x28')](respondWithResult(_0x2d8131,null))[_0x2348('0x43')](handleError(_0x2d8131,null));};exports['destroy']=function(_0xe490ba,_0x529e0a){return db['FreshsalesAccount'][_0x2348('0x47')]({'where':{'id':_0xe490ba[_0x2348('0x45')]['id']}})[_0x2348('0x28')](handleEntityNotFound(_0x529e0a,null))['then'](removeEntity(_0x529e0a,null))[_0x2348('0x43')](handleError(_0x529e0a,null));};exports[_0x2348('0x4b')]=function(_0x30e8bd,_0x2048e2,_0x251610){var _0xfc67dc={};var _0x30ce63={};var _0x4c756a;var _0x3821da;return db['FreshsalesAccount'][_0x2348('0x4c')]({'where':{'id':_0x30e8bd[_0x2348('0x45')]['id']}})['then'](handleEntityNotFound(_0x2048e2,null))[_0x2348('0x28')](function(_0x316c44){if(_0x316c44){_0x4c756a=_0x316c44;_0x30ce63[_0x2348('0x31')]=_[_0x2348('0x46')](db[_0x2348('0x4d')]['rawAttributes']);_0x30ce63['query']=_[_0x2348('0x46')](_0x30e8bd[_0x2348('0x33')]);_0x30ce63['filters']=_[_0x2348('0x32')](_0x30ce63[_0x2348('0x31')],_0x30ce63[_0x2348('0x33')]);_0xfc67dc[_0x2348('0x35')]=_[_0x2348('0x32')](_0x30ce63['model'],qs[_0x2348('0x34')](_0x30e8bd[_0x2348('0x33')][_0x2348('0x34')]));_0xfc67dc[_0x2348('0x35')]=_0xfc67dc[_0x2348('0x35')][_0x2348('0x36')]?_0xfc67dc[_0x2348('0x35')]:_0x30ce63[_0x2348('0x31')];_0xfc67dc['order']=qs[_0x2348('0x38')](_0x30e8bd['query'][_0x2348('0x38')]);_0xfc67dc[_0x2348('0x39')]=qs['filters'](_['pick'](_0x30e8bd[_0x2348('0x33')],_0x30ce63['filters']));if(_0x30e8bd[_0x2348('0x33')][_0x2348('0x3e')]){_0xfc67dc[_0x2348('0x39')]=_['merge'](_0xfc67dc[_0x2348('0x39')],{'$or':_[_0x2348('0x2d')](_0xfc67dc['attributes'],function(_0x141710){var _0x371097={};_0x371097[_0x141710]={'$like':'%'+_0x30e8bd['query'][_0x2348('0x3e')]+'%'};return _0x371097;})});}_0xfc67dc=_['merge']({},_0xfc67dc,_0x30e8bd['options']);return _0x4c756a[_0x2348('0x4b')](_0xfc67dc);}})['then'](function(_0x180e65){if(_0x180e65){_0x3821da=_0x180e65['length'];if(!_0x30e8bd['query']['hasOwnProperty'](_0x2348('0x4e'))){_0xfc67dc[_0x2348('0x20')]=qs[_0x2348('0x20')](_0x30e8bd[_0x2348('0x33')]['limit']);_0xfc67dc[_0x2348('0x23')]=qs['offset'](_0x30e8bd[_0x2348('0x33')][_0x2348('0x23')]);}return _0x4c756a['getConfigurations'](_0xfc67dc);}})[_0x2348('0x28')](function(_0x24c81c){if(_0x24c81c){return _0x24c81c?{'count':_0x3821da,'rows':_0x24c81c}:null;}})[_0x2348('0x28')](respondWithResult(_0x2048e2,null))[_0x2348('0x43')](handleError(_0x2048e2,null));};exports[_0x2348('0x4f')]=function(_0x43b9a7,_0x23c517,_0xf026c9){if(_0x43b9a7[_0x2348('0x49')]['id']){delete _0x43b9a7[_0x2348('0x49')]['id'];}return db['FreshsalesAccount']['findOne']({'where':{'id':_0x43b9a7[_0x2348('0x45')]['id']}})['then'](handleEntityNotFound(_0x23c517,null))[_0x2348('0x28')](function(_0x14d59b){if(_0x14d59b){_0x43b9a7[_0x2348('0x49')]['AccountId']=_0x14d59b['id'];_0x43b9a7['body']['Subjects']=integrations[_0x2348('0x50')](_0x43b9a7[_0x2348('0x49')]['channel'],_0x43b9a7['body']['type']);_0x43b9a7['body'][_0x2348('0x51')]=integrations['getDescriptions'](_0x43b9a7[_0x2348('0x49')][_0x2348('0x52')],_0x43b9a7[_0x2348('0x49')][_0x2348('0x30')]);return db[_0x2348('0x4d')]['create'](_0x43b9a7[_0x2348('0x49')],{'include':[{'model':db[_0x2348('0x53')],'as':_0x2348('0x54')},{'model':db[_0x2348('0x53')],'as':'Descriptions'}]});}return null;})[_0x2348('0x28')](respondWithResult(_0x23c517,null))['catch'](handleError(_0x23c517,null));};exports[_0x2348('0x55')]=function(_0x3b43cd,_0xdf409c,_0x2942b0){var _0x1e8d2a='';var _0x4e0368='';return db[_0x2348('0x2e')]['findOne']({'where':{'id':_0x3b43cd['params']['id']},'attributes':['id','username',_0x2348('0x56'),_0x2348('0x57')]})[_0x2348('0x28')](handleEntityNotFound(_0xdf409c,null))[_0x2348('0x28')](function(_0x2a3c4e){if(_0x2a3c4e){_0x4e0368=_0x2a3c4e[_0x2348('0x58')];_0x1e8d2a=_0x2a3c4e[_0x2348('0x56')];var _0x13fd24=_0x2a3c4e['remoteUri'][_0x2348('0x59')](-0x1);if(_0x13fd24==='/'){_0x1e8d2a=_0x1e8d2a[_0x2348('0x5a')](0x0,_0x1e8d2a[_0x2348('0x5b')](_0x13fd24));}return rp({'method':_0x2348('0x5c'),'uri':util['format'](_0x2348('0x5d'),_0x1e8d2a,_0x2348('0x5e')),'headers':{'Authorization':_0x2348('0x5f')+_0x2a3c4e[_0x2348('0x57')]},'json':!![]});}})[_0x2348('0x28')](function(_0xc2f350){if(_0xc2f350){var _0x2986ff=_0xc2f350[_0x2348('0x60')];var _0x4965e7=![];var _0x2e9027=null;for(_0x2e9027=0x0;_0x2e9027<_0x2986ff[_0x2348('0x36')];_0x2e9027++){if(_0x2986ff[_0x2e9027][_0x2348('0x61')]===_0x4e0368){_0x4965e7=!![];}}if(_0x4965e7){return!![];}else{throw new Error({'statusCode':0x194,'message':_0x2348('0x62')});}}})[_0x2348('0x28')](respondWithResult(_0xdf409c,null))['catch'](function(_0x148496){var _0x331b44=_0x3b43cd[_0x2348('0x33')]['test']?0x1f4:_0x148496[_0x2348('0x63')]||0x1f4;logger[_0x2348('0x29')](_0x2348('0x64'),_0x2348('0x55'),_0x331b44,JSON[_0x2348('0x65')](_0x148496));delete _0x148496[_0x2348('0x2b')];if(_0x331b44===0x191){_0x331b44=0x190;}_0xdf409c[_0x2348('0x1d')](_0x331b44)[_0x2348('0x66')](_0x3b43cd[_0x2348('0x33')][_0x2348('0x67')]?{'message':_0x2348('0x68'),'statusCode':_0x148496[_0x2348('0x63')]}:_0x148496);});}; \ No newline at end of file diff --git a/server/api/intFreshsalesAccount/intFreshsalesAccount.model.js b/server/api/intFreshsalesAccount/intFreshsalesAccount.model.js index 059c715..a1cdb94 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 _0x0424=['./intFreshsalesAccount.attributes','../../components/integrations/configuration','exports','define','FreshsalesAccount','../../config/logger','api','moment','bluebird','path'];(function(_0x27a544,_0x4c38e1){var _0x312f88=function(_0x198d5e){while(--_0x198d5e){_0x27a544['push'](_0x27a544['shift']());}};_0x312f88(++_0x4c38e1);}(_0x0424,0x159));var _0x4042=function(_0x23e4cf,_0x12704d){_0x23e4cf=_0x23e4cf-0x0;var _0x2bd35a=_0x0424[_0x23e4cf];return _0x2bd35a;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x4042('0x0'))(_0x4042('0x1'));var moment=require(_0x4042('0x2'));var BPromise=require(_0x4042('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x4042('0x4'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0x4042('0x5'));var integrations=require(_0x4042('0x6'));module[_0x4042('0x7')]=function(_0xc0fba0,_0x3abaf1){return _0xc0fba0[_0x4042('0x8')](_0x4042('0x9'),attributes,{'tableName':'int_freshsales_accounts','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x5fdc=['moment','bluebird','request-promise','path','rimraf','../../config/environment','./intFreshsalesAccount.attributes','../../components/integrations/configuration','exports','lodash','util','../../config/logger','api'];(function(_0x49dce0,_0x1a7921){var _0x22746b=function(_0x2fd22d){while(--_0x2fd22d){_0x49dce0['push'](_0x49dce0['shift']());}};_0x22746b(++_0x1a7921);}(_0x5fdc,0x127));var _0xc5fd=function(_0x52cf50,_0x545ce6){_0x52cf50=_0x52cf50-0x0;var _0x5ba88e=_0x5fdc[_0x52cf50];return _0x5ba88e;};'use strict';var _=require(_0xc5fd('0x0'));var util=require(_0xc5fd('0x1'));var logger=require(_0xc5fd('0x2'))(_0xc5fd('0x3'));var moment=require(_0xc5fd('0x4'));var BPromise=require(_0xc5fd('0x5'));var rp=require(_0xc5fd('0x6'));var fs=require('fs');var path=require(_0xc5fd('0x7'));var rimraf=require(_0xc5fd('0x8'));var config=require(_0xc5fd('0x9'));var attributes=require(_0xc5fd('0xa'));var integrations=require(_0xc5fd('0xb'));module[_0xc5fd('0xc')]=function(_0x216902,_0x15ffe7){return _0x216902['define']('FreshsalesAccount',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 b56eba6..d5ea12c 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 _0xed1c=['model','ShowFreshsalesAccount','find','debug','lodash','util','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','request','then','info','request\x20sent','FreshsalesAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','message','FreshsalesAccount,\x20%s,\x20%s','catch','GetFreshsalesAccount','FreshsalesAccount','options','raw','where','attributes','include','map'];(function(_0x416bed,_0xca08f8){var _0x3466d4=function(_0x4bfc07){while(--_0x4bfc07){_0x416bed['push'](_0x416bed['shift']());}};_0x3466d4(++_0xca08f8);}(_0xed1c,0xe4));var _0xced1=function(_0x166436,_0x522fe3){_0x166436=_0x166436-0x0;var _0x27b22f=_0xed1c[_0x166436];return _0x27b22f;};'use strict';var _=require(_0xced1('0x0'));var util=require(_0xced1('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0xced1('0x2'))['db'];var utils=require(_0xced1('0x3'));var logger=require(_0xced1('0x4'))('rpc');var config=require(_0xced1('0x5'));var jayson=require(_0xced1('0x6'));var client=jayson[_0xced1('0x7')][_0xced1('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x59399e,_0x2bcf42,_0x38bca8){return new BPromise(function(_0x39d5df,_0x1fb40b){return client[_0xced1('0x9')](_0x59399e,_0x38bca8)[_0xced1('0xa')](function(_0x325dd2){logger[_0xced1('0xb')]('FreshsalesAccount,\x20%s,\x20%s',_0x2bcf42,_0xced1('0xc'));logger['debug'](_0xced1('0xd'),_0x2bcf42,_0xced1('0xc'),JSON[_0xced1('0xe')](_0x325dd2));if(_0x325dd2[_0xced1('0xf')]){if(_0x325dd2[_0xced1('0xf')][_0xced1('0x10')]===0x1f4){logger[_0xced1('0xf')]('FreshsalesAccount,\x20%s,\x20%s',_0x2bcf42,_0x325dd2[_0xced1('0xf')][_0xced1('0x11')]);return _0x1fb40b(_0x325dd2[_0xced1('0xf')][_0xced1('0x11')]);}logger['error'](_0xced1('0x12'),_0x2bcf42,_0x325dd2[_0xced1('0xf')]['message']);return _0x39d5df(_0x325dd2[_0xced1('0xf')][_0xced1('0x11')]);}else{logger[_0xced1('0xb')](_0xced1('0x12'),_0x2bcf42,'request\x20sent');_0x39d5df(_0x325dd2['result'][_0xced1('0x11')]);}})[_0xced1('0x13')](function(_0x236473){logger[_0xced1('0xf')](_0xced1('0x12'),_0x2bcf42,_0x236473);_0x1fb40b(_0x236473);});});}exports[_0xced1('0x14')]=function(_0x5a563a){var _0x56fc50=this;return new Promise(function(_0x2a92c8,_0x111fb0){return db[_0xced1('0x15')]['findAll']({'raw':_0x5a563a[_0xced1('0x16')]?_0x5a563a[_0xced1('0x16')][_0xced1('0x17')]===undefined?!![]:![]:!![],'where':_0x5a563a['options']?_0x5a563a[_0xced1('0x16')][_0xced1('0x18')]||null:null,'attributes':_0x5a563a[_0xced1('0x16')]?_0x5a563a['options'][_0xced1('0x19')]||null:null,'limit':_0x5a563a[_0xced1('0x16')]?_0x5a563a[_0xced1('0x16')]['limit']||null:null,'include':_0x5a563a['options']?_0x5a563a[_0xced1('0x16')][_0xced1('0x1a')]?_[_0xced1('0x1b')](_0x5a563a[_0xced1('0x16')][_0xced1('0x1a')],function(_0x49c8b9){return{'model':db[_0x49c8b9[_0xced1('0x1c')]],'as':_0x49c8b9['as'],'attributes':_0x49c8b9[_0xced1('0x19')],'include':_0x49c8b9['include']?_['map'](_0x49c8b9[_0xced1('0x1a')],function(_0x258c9a){return{'model':db[_0x258c9a[_0xced1('0x1c')]],'as':_0x258c9a['as'],'attributes':_0x258c9a[_0xced1('0x19')],'include':_0x258c9a[_0xced1('0x1a')]?_[_0xced1('0x1b')](_0x258c9a['include'],function(_0x181f6e){return{'model':db[_0x181f6e[_0xced1('0x1c')]],'as':_0x181f6e['as'],'attributes':_0x181f6e[_0xced1('0x19')]};}):[]};}):[]};}):[]:[]})[_0xced1('0xa')](function(_0x34dd2e){logger[_0xced1('0xb')](_0xced1('0x14'),_0x5a563a);logger['debug'](_0xced1('0x14'),_0x5a563a,JSON['stringify'](_0x34dd2e));_0x2a92c8(_0x34dd2e);})[_0xced1('0x13')](function(_0x2c2269){logger[_0xced1('0xf')](_0xced1('0x14'),_0x2c2269['message'],_0x5a563a);_0x111fb0(_0x56fc50['error'](0x1f4,_0x2c2269[_0xced1('0x11')]));});});};exports[_0xced1('0x1d')]=function(_0x2bc785){var _0x4ea07e=this;return new Promise(function(_0x573146,_0x543c47){return db[_0xced1('0x15')][_0xced1('0x1e')]({'raw':_0x2bc785[_0xced1('0x16')]?_0x2bc785[_0xced1('0x16')]['raw']===undefined?!![]:![]:!![],'where':_0x2bc785[_0xced1('0x16')]?_0x2bc785[_0xced1('0x16')][_0xced1('0x18')]||null:null,'attributes':_0x2bc785[_0xced1('0x16')]?_0x2bc785[_0xced1('0x16')][_0xced1('0x19')]||null:null,'include':_0x2bc785[_0xced1('0x16')]?_0x2bc785['options']['include']?_[_0xced1('0x1b')](_0x2bc785[_0xced1('0x16')][_0xced1('0x1a')],function(_0x7ebeb3){return{'model':db[_0x7ebeb3[_0xced1('0x1c')]],'as':_0x7ebeb3['as'],'attributes':_0x7ebeb3[_0xced1('0x19')],'include':_0x7ebeb3['include']?_['map'](_0x7ebeb3['include'],function(_0x4d305c){return{'model':db[_0x4d305c[_0xced1('0x1c')]],'as':_0x4d305c['as'],'attributes':_0x4d305c[_0xced1('0x19')],'include':_0x4d305c[_0xced1('0x1a')]?_[_0xced1('0x1b')](_0x4d305c[_0xced1('0x1a')],function(_0x1c36fa){return{'model':db[_0x1c36fa[_0xced1('0x1c')]],'as':_0x1c36fa['as'],'attributes':_0x1c36fa[_0xced1('0x19')]};}):[]};}):[]};}):[]:[]})[_0xced1('0xa')](function(_0x3dfd2f){logger[_0xced1('0xb')](_0xced1('0x1d'),_0x2bc785);logger[_0xced1('0x1f')]('ShowFreshsalesAccount',_0x2bc785,JSON[_0xced1('0xe')](_0x3dfd2f));_0x573146(_0x3dfd2f);})[_0xced1('0x13')](function(_0x1116de){logger[_0xced1('0xf')](_0xced1('0x1d'),_0x1116de[_0xced1('0x11')],_0x2bc785);_0x543c47(_0x4ea07e['error'](0x1f4,_0x1116de[_0xced1('0x11')]));});});}; \ No newline at end of file +var _0xb145=['stringify','error','FreshsalesAccount,\x20%s,\x20%s','message','result','catch','FreshsalesAccount','findAll','options','raw','attributes','limit','include','map','model','then','GetFreshsalesAccount','where','ShowFreshsalesAccount','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','request','info','request\x20sent','debug','FreshsalesAccount,\x20%s,\x20%s,\x20%s'];(function(_0x2641f9,_0x26715f){var _0x585741=function(_0x2d1462){while(--_0x2d1462){_0x2641f9['push'](_0x2641f9['shift']());}};_0x585741(++_0x26715f);}(_0xb145,0xa3));var _0x5b14=function(_0x1debce,_0x369ede){_0x1debce=_0x1debce-0x0;var _0x5c2d23=_0xb145[_0x1debce];return _0x5c2d23;};'use strict';var _=require('lodash');var util=require(_0x5b14('0x0'));var moment=require(_0x5b14('0x1'));var BPromise=require(_0x5b14('0x2'));var rs=require(_0x5b14('0x3'));var fs=require('fs');var Redis=require(_0x5b14('0x4'));var db=require(_0x5b14('0x5'))['db'];var utils=require(_0x5b14('0x6'));var logger=require(_0x5b14('0x7'))('rpc');var config=require(_0x5b14('0x8'));var jayson=require(_0x5b14('0x9'));var client=jayson[_0x5b14('0xa')][_0x5b14('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x50fd91,_0x1d12ed,_0x2a3921){return new BPromise(function(_0x34530a,_0x62cdcd){return client[_0x5b14('0xc')](_0x50fd91,_0x2a3921)['then'](function(_0x32d729){logger[_0x5b14('0xd')]('FreshsalesAccount,\x20%s,\x20%s',_0x1d12ed,_0x5b14('0xe'));logger[_0x5b14('0xf')](_0x5b14('0x10'),_0x1d12ed,_0x5b14('0xe'),JSON[_0x5b14('0x11')](_0x32d729));if(_0x32d729['error']){if(_0x32d729[_0x5b14('0x12')]['code']===0x1f4){logger[_0x5b14('0x12')](_0x5b14('0x13'),_0x1d12ed,_0x32d729[_0x5b14('0x12')][_0x5b14('0x14')]);return _0x62cdcd(_0x32d729[_0x5b14('0x12')][_0x5b14('0x14')]);}logger['error'](_0x5b14('0x13'),_0x1d12ed,_0x32d729[_0x5b14('0x12')][_0x5b14('0x14')]);return _0x34530a(_0x32d729[_0x5b14('0x12')][_0x5b14('0x14')]);}else{logger[_0x5b14('0xd')](_0x5b14('0x13'),_0x1d12ed,_0x5b14('0xe'));_0x34530a(_0x32d729[_0x5b14('0x15')][_0x5b14('0x14')]);}})[_0x5b14('0x16')](function(_0x2c3efb){logger['error'](_0x5b14('0x13'),_0x1d12ed,_0x2c3efb);_0x62cdcd(_0x2c3efb);});});}exports['GetFreshsalesAccount']=function(_0x48d395){var _0x58bf3c=this;return new Promise(function(_0x3f397d,_0x3035b5){return db[_0x5b14('0x17')][_0x5b14('0x18')]({'raw':_0x48d395[_0x5b14('0x19')]?_0x48d395[_0x5b14('0x19')][_0x5b14('0x1a')]===undefined?!![]:![]:!![],'where':_0x48d395['options']?_0x48d395['options']['where']||null:null,'attributes':_0x48d395[_0x5b14('0x19')]?_0x48d395[_0x5b14('0x19')][_0x5b14('0x1b')]||null:null,'limit':_0x48d395[_0x5b14('0x19')]?_0x48d395['options'][_0x5b14('0x1c')]||null:null,'include':_0x48d395[_0x5b14('0x19')]?_0x48d395['options'][_0x5b14('0x1d')]?_[_0x5b14('0x1e')](_0x48d395['options'][_0x5b14('0x1d')],function(_0x54073f){return{'model':db[_0x54073f['model']],'as':_0x54073f['as'],'attributes':_0x54073f['attributes'],'include':_0x54073f['include']?_[_0x5b14('0x1e')](_0x54073f[_0x5b14('0x1d')],function(_0x153a25){return{'model':db[_0x153a25['model']],'as':_0x153a25['as'],'attributes':_0x153a25[_0x5b14('0x1b')],'include':_0x153a25[_0x5b14('0x1d')]?_[_0x5b14('0x1e')](_0x153a25[_0x5b14('0x1d')],function(_0xe6851b){return{'model':db[_0xe6851b[_0x5b14('0x1f')]],'as':_0xe6851b['as'],'attributes':_0xe6851b[_0x5b14('0x1b')]};}):[]};}):[]};}):[]:[]})[_0x5b14('0x20')](function(_0x296d65){logger[_0x5b14('0xd')](_0x5b14('0x21'),_0x48d395);logger[_0x5b14('0xf')](_0x5b14('0x21'),_0x48d395,JSON[_0x5b14('0x11')](_0x296d65));_0x3f397d(_0x296d65);})['catch'](function(_0x370fcd){logger[_0x5b14('0x12')]('GetFreshsalesAccount',_0x370fcd['message'],_0x48d395);_0x3035b5(_0x58bf3c[_0x5b14('0x12')](0x1f4,_0x370fcd[_0x5b14('0x14')]));});});};exports['ShowFreshsalesAccount']=function(_0x4c1f0e){var _0x21b43b=this;return new Promise(function(_0x4d3905,_0x38c665){return db[_0x5b14('0x17')]['find']({'raw':_0x4c1f0e['options']?_0x4c1f0e[_0x5b14('0x19')][_0x5b14('0x1a')]===undefined?!![]:![]:!![],'where':_0x4c1f0e[_0x5b14('0x19')]?_0x4c1f0e['options'][_0x5b14('0x22')]||null:null,'attributes':_0x4c1f0e['options']?_0x4c1f0e[_0x5b14('0x19')][_0x5b14('0x1b')]||null:null,'include':_0x4c1f0e[_0x5b14('0x19')]?_0x4c1f0e[_0x5b14('0x19')]['include']?_[_0x5b14('0x1e')](_0x4c1f0e[_0x5b14('0x19')][_0x5b14('0x1d')],function(_0x37f62c){return{'model':db[_0x37f62c['model']],'as':_0x37f62c['as'],'attributes':_0x37f62c[_0x5b14('0x1b')],'include':_0x37f62c[_0x5b14('0x1d')]?_[_0x5b14('0x1e')](_0x37f62c['include'],function(_0x2fe74d){return{'model':db[_0x2fe74d['model']],'as':_0x2fe74d['as'],'attributes':_0x2fe74d[_0x5b14('0x1b')],'include':_0x2fe74d[_0x5b14('0x1d')]?_['map'](_0x2fe74d[_0x5b14('0x1d')],function(_0x2a83d4){return{'model':db[_0x2a83d4['model']],'as':_0x2a83d4['as'],'attributes':_0x2a83d4[_0x5b14('0x1b')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x1ce6bb){logger[_0x5b14('0xd')](_0x5b14('0x23'),_0x4c1f0e);logger[_0x5b14('0xf')]('ShowFreshsalesAccount',_0x4c1f0e,JSON[_0x5b14('0x11')](_0x1ce6bb));_0x4d3905(_0x1ce6bb);})[_0x5b14('0x16')](function(_0x15d4c4){logger[_0x5b14('0x12')](_0x5b14('0x23'),_0x15d4c4[_0x5b14('0x14')],_0x4c1f0e);_0x38c665(_0x21b43b[_0x5b14('0x12')](0x1f4,_0x15d4c4[_0x5b14('0x14')]));});});}; \ No newline at end of file diff --git a/server/api/intFreshsalesConfiguration/index.js b/server/api/intFreshsalesConfiguration/index.js index 13a942d..749e522 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 _0xa5dc=['express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./intFreshsalesConfiguration.controller','get','isAuthenticated','index','/:id','/:id/subjects','getSubjects','/:id/descriptions','getDescriptions','/:id/fields','getFields','post','create','put','multer','util','path'];(function(_0x4fb8ee,_0x431280){var _0x1f2f75=function(_0x1da04a){while(--_0x1da04a){_0x4fb8ee['push'](_0x4fb8ee['shift']());}};_0x1f2f75(++_0x431280);}(_0xa5dc,0x1e0));var _0xca5d=function(_0xe2070e,_0x3a8903){_0xe2070e=_0xe2070e-0x0;var _0x377eee=_0xa5dc[_0xe2070e];return _0x377eee;};'use strict';var multer=require(_0xca5d('0x0'));var util=require(_0xca5d('0x1'));var path=require(_0xca5d('0x2'));var timeout=require('connect-timeout');var express=require(_0xca5d('0x3'));var router=express[_0xca5d('0x4')]();var fs_extra=require(_0xca5d('0x5'));var auth=require(_0xca5d('0x6'));var interaction=require(_0xca5d('0x7'));var config=require(_0xca5d('0x8'));var controller=require(_0xca5d('0x9'));router[_0xca5d('0xa')]('/',auth[_0xca5d('0xb')](),controller[_0xca5d('0xc')]);router['get'](_0xca5d('0xd'),auth[_0xca5d('0xb')](),controller['show']);router[_0xca5d('0xa')](_0xca5d('0xe'),auth[_0xca5d('0xb')](),controller[_0xca5d('0xf')]);router[_0xca5d('0xa')](_0xca5d('0x10'),auth[_0xca5d('0xb')](),controller[_0xca5d('0x11')]);router[_0xca5d('0xa')](_0xca5d('0x12'),auth[_0xca5d('0xb')](),controller[_0xca5d('0x13')]);router[_0xca5d('0x14')]('/',auth[_0xca5d('0xb')](),controller[_0xca5d('0x15')]);router[_0xca5d('0x16')](_0xca5d('0xd'),auth[_0xca5d('0xb')](),controller['update']);router['delete'](_0xca5d('0xd'),auth[_0xca5d('0xb')](),controller['destroy']);module['exports']=router; \ No newline at end of file +var _0x6dc3=['../../components/interaction/service','../../config/environment','./intFreshsalesConfiguration.controller','get','isAuthenticated','/:id','show','/:id/subjects','getSubjects','getDescriptions','/:id/fields','post','put','exports','multer','path','connect-timeout','express','Router','../../components/auth/service'];(function(_0x1a0581,_0x4cbfb6){var _0x478075=function(_0x150c56){while(--_0x150c56){_0x1a0581['push'](_0x1a0581['shift']());}};_0x478075(++_0x4cbfb6);}(_0x6dc3,0x18a));var _0x36dc=function(_0x6ed229,_0x2589e9){_0x6ed229=_0x6ed229-0x0;var _0x25a4e8=_0x6dc3[_0x6ed229];return _0x25a4e8;};'use strict';var multer=require(_0x36dc('0x0'));var util=require('util');var path=require(_0x36dc('0x1'));var timeout=require(_0x36dc('0x2'));var express=require(_0x36dc('0x3'));var router=express[_0x36dc('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0x36dc('0x5'));var interaction=require(_0x36dc('0x6'));var config=require(_0x36dc('0x7'));var controller=require(_0x36dc('0x8'));router[_0x36dc('0x9')]('/',auth[_0x36dc('0xa')](),controller['index']);router[_0x36dc('0x9')](_0x36dc('0xb'),auth[_0x36dc('0xa')](),controller[_0x36dc('0xc')]);router[_0x36dc('0x9')](_0x36dc('0xd'),auth[_0x36dc('0xa')](),controller[_0x36dc('0xe')]);router[_0x36dc('0x9')]('/:id/descriptions',auth[_0x36dc('0xa')](),controller[_0x36dc('0xf')]);router[_0x36dc('0x9')](_0x36dc('0x10'),auth[_0x36dc('0xa')](),controller['getFields']);router[_0x36dc('0x11')]('/',auth[_0x36dc('0xa')](),controller['create']);router[_0x36dc('0x12')](_0x36dc('0xb'),auth[_0x36dc('0xa')](),controller['update']);router['delete'](_0x36dc('0xb'),auth['isAuthenticated'](),controller['destroy']);module[_0x36dc('0x13')]=router; \ No newline at end of file diff --git a/server/api/intFreshsalesConfiguration/intFreshsalesConfiguration.attributes.js b/server/api/intFreshsalesConfiguration/intFreshsalesConfiguration.attributes.js index 9181ee7..621c933 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 _0xc4b0=['STRING','sequelize','exports'];(function(_0x502c7d,_0x2f1285){var _0x30b7ed=function(_0x2d92f3){while(--_0x2d92f3){_0x502c7d['push'](_0x502c7d['shift']());}};_0x30b7ed(++_0x2f1285);}(_0xc4b0,0xe5));var _0x0c4b=function(_0x2af11a,_0x443532){_0x2af11a=_0x2af11a-0x0;var _0x40d52e=_0xc4b0[_0x2af11a];return _0x40d52e;};'use strict';var Sequelize=require(_0x0c4b('0x0'));module[_0x0c4b('0x1')]={'name':{'type':Sequelize[_0x0c4b('0x2')]},'description':{'type':Sequelize[_0x0c4b('0x2')]}}; \ No newline at end of file +var _0x871c=['STRING','sequelize','exports'];(function(_0x29b609,_0x19d388){var _0x54c952=function(_0xb3c38d){while(--_0xb3c38d){_0x29b609['push'](_0x29b609['shift']());}};_0x54c952(++_0x19d388);}(_0x871c,0x193));var _0xc871=function(_0x59d43f,_0xf3e787){_0x59d43f=_0x59d43f-0x0;var _0x19ef43=_0x871c[_0x59d43f];return _0x19ef43;};'use strict';var Sequelize=require(_0xc871('0x0'));module[_0xc871('0x1')]={'name':{'type':Sequelize[_0xc871('0x2')]},'description':{'type':Sequelize[_0xc871('0x2')]}}; \ No newline at end of file diff --git a/server/api/intFreshsalesConfiguration/intFreshsalesConfiguration.controller.js b/server/api/intFreshsalesConfiguration/intFreshsalesConfiguration.controller.js index c0d0aa5..8edacbe 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 _0xfd58=['where','pick','filter','merge','VIRTUAL','options','FreshsalesConfiguration','includeAll','findAll','params','rawAttributes','include','catch','create','body','find','getSubjects','findOne','hasOwnProperty','getDescriptions','getFields','FreshsalesField','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','crypto','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','api','../../config/license/util','../../mysqldb','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','update','then','destroy','sendStatus','error','stack','name','map','fieldName','type','model','keys','filters','attributes','intersection','fields','query','length','nolimit','order','sort'];(function(_0x202055,_0x3e4838){var _0x5314a5=function(_0x5de5b5){while(--_0x5de5b5){_0x202055['push'](_0x202055['shift']());}};_0x5314a5(++_0x3e4838);}(_0xfd58,0x14e));var _0x8fd5=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0xfd58[_0x321bb2];return _0x9c12ed;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x8fd5('0x0'));var zipdir=require(_0x8fd5('0x1'));var jsonpatch=require(_0x8fd5('0x2'));var rp=require(_0x8fd5('0x3'));var moment=require(_0x8fd5('0x4'));var BPromise=require(_0x8fd5('0x5'));var Mustache=require(_0x8fd5('0x6'));var util=require(_0x8fd5('0x7'));var path=require(_0x8fd5('0x8'));var sox=require(_0x8fd5('0x9'));var csv=require(_0x8fd5('0xa'));var ejs=require(_0x8fd5('0xb'));var fs=require('fs');var fs_extra=require(_0x8fd5('0xc'));var _=require(_0x8fd5('0xd'));var squel=require('squel');var crypto=require(_0x8fd5('0xe'));var jsforce=require(_0x8fd5('0xf'));var deskjs=require('desk.js');var toCsv=require(_0x8fd5('0xa'));var querystring=require(_0x8fd5('0x10'));var Papa=require(_0x8fd5('0x11'));var Redis=require(_0x8fd5('0x12'));var authService=require(_0x8fd5('0x13'));var qs=require('../../components/parsers/qs');var as=require(_0x8fd5('0x14'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x8fd5('0x15'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0x8fd5('0x16'));var db=require(_0x8fd5('0x17'))['db'];function respondWithStatusCode(_0x468696,_0x9a34b7){_0x9a34b7=_0x9a34b7||0xcc;return function(_0x391149){if(_0x391149){return _0x468696['sendStatus'](_0x9a34b7);}return _0x468696[_0x8fd5('0x18')](_0x9a34b7)[_0x8fd5('0x19')]();};}function respondWithResult(_0x4e5b27,_0x37dd8f){_0x37dd8f=_0x37dd8f||0xc8;return function(_0x2dac09){if(_0x2dac09){return _0x4e5b27['status'](_0x37dd8f)[_0x8fd5('0x1a')](_0x2dac09);}};}function respondWithFilteredResult(_0x58c6e0,_0x5f1fde){return function(_0x1b79ef){if(_0x1b79ef){var _0x10d242=typeof _0x5f1fde[_0x8fd5('0x1b')]===_0x8fd5('0x1c')&&typeof _0x5f1fde[_0x8fd5('0x1d')]===_0x8fd5('0x1c');var _0x4aeaaf=_0x1b79ef[_0x8fd5('0x1e')];var _0x1b63e6=_0x10d242?0x0:_0x5f1fde['offset'];var _0x1c38b4=_0x10d242?_0x1b79ef[_0x8fd5('0x1e')]:_0x5f1fde[_0x8fd5('0x1b')]+_0x5f1fde[_0x8fd5('0x1d')];var _0x48083a;if(_0x1c38b4>=_0x4aeaaf){_0x1c38b4=_0x4aeaaf;_0x48083a=0xc8;}else{_0x48083a=0xce;}_0x58c6e0[_0x8fd5('0x18')](_0x48083a);return _0x58c6e0[_0x8fd5('0x1f')](_0x8fd5('0x20'),_0x1b63e6+'-'+_0x1c38b4+'/'+_0x4aeaaf)[_0x8fd5('0x1a')](_0x1b79ef);}return null;};}function patchUpdates(_0x322527){return function(_0x32e80d){try{jsonpatch[_0x8fd5('0x21')](_0x32e80d,_0x322527,!![]);}catch(_0x420166){return BPromise[_0x8fd5('0x22')](_0x420166);}return _0x32e80d['save']();};}function saveUpdates(_0x373a11,_0x2eed55){return function(_0xf70270){if(_0xf70270){return _0xf70270[_0x8fd5('0x23')](_0x373a11)[_0x8fd5('0x24')](function(_0x1c17d4){return _0x1c17d4;});}return null;};}function removeEntity(_0x1ae72a,_0x9d7eb0){return function(_0x3e7369){if(_0x3e7369){return _0x3e7369[_0x8fd5('0x25')]()[_0x8fd5('0x24')](function(){_0x1ae72a[_0x8fd5('0x18')](0xcc)[_0x8fd5('0x19')]();});}};}function handleEntityNotFound(_0x3c6796,_0x273278){return function(_0x19132c){if(!_0x19132c){_0x3c6796[_0x8fd5('0x26')](0x194);}return _0x19132c;};}function handleError(_0x44cb26,_0x35f633){_0x35f633=_0x35f633||0x1f4;return function(_0xadf9b2){logger[_0x8fd5('0x27')](_0xadf9b2[_0x8fd5('0x28')]);if(_0xadf9b2[_0x8fd5('0x29')]){delete _0xadf9b2['name'];}_0x44cb26[_0x8fd5('0x18')](_0x35f633)['send'](_0xadf9b2);};}exports['index']=function(_0x32885f,_0x25ab30){var _0x4f11c5={},_0x168f4c={},_0x54d02f={'count':0x0,'rows':[]};var _0x2ce673=_[_0x8fd5('0x2a')](db['FreshsalesConfiguration']['rawAttributes'],function(_0x5b7647){return{'name':_0x5b7647[_0x8fd5('0x2b')],'type':_0x5b7647[_0x8fd5('0x2c')]['key']};});_0x168f4c[_0x8fd5('0x2d')]=_[_0x8fd5('0x2a')](_0x2ce673,_0x8fd5('0x29'));_0x168f4c['query']=_[_0x8fd5('0x2e')](_0x32885f['query']);_0x168f4c[_0x8fd5('0x2f')]=_['intersection'](_0x168f4c[_0x8fd5('0x2d')],_0x168f4c['query']);_0x4f11c5[_0x8fd5('0x30')]=_[_0x8fd5('0x31')](_0x168f4c[_0x8fd5('0x2d')],qs[_0x8fd5('0x32')](_0x32885f[_0x8fd5('0x33')][_0x8fd5('0x32')]));_0x4f11c5['attributes']=_0x4f11c5[_0x8fd5('0x30')][_0x8fd5('0x34')]?_0x4f11c5[_0x8fd5('0x30')]:_0x168f4c[_0x8fd5('0x2d')];if(!_0x32885f['query']['hasOwnProperty'](_0x8fd5('0x35'))){_0x4f11c5[_0x8fd5('0x1d')]=qs['limit'](_0x32885f['query']['limit']);_0x4f11c5[_0x8fd5('0x1b')]=qs[_0x8fd5('0x1b')](_0x32885f[_0x8fd5('0x33')][_0x8fd5('0x1b')]);}_0x4f11c5[_0x8fd5('0x36')]=qs[_0x8fd5('0x37')](_0x32885f[_0x8fd5('0x33')][_0x8fd5('0x37')]);_0x4f11c5[_0x8fd5('0x38')]=qs[_0x8fd5('0x2f')](_[_0x8fd5('0x39')](_0x32885f[_0x8fd5('0x33')],_0x168f4c[_0x8fd5('0x2f')]),_0x2ce673);if(_0x32885f[_0x8fd5('0x33')][_0x8fd5('0x3a')]){_0x4f11c5[_0x8fd5('0x38')]=_[_0x8fd5('0x3b')](_0x4f11c5['where'],{'$or':_[_0x8fd5('0x2a')](_0x2ce673,function(_0x42d993){if(_0x42d993['type']!==_0x8fd5('0x3c')){var _0x13efb8={};_0x13efb8[_0x42d993[_0x8fd5('0x29')]]={'$like':'%'+_0x32885f[_0x8fd5('0x33')][_0x8fd5('0x3a')]+'%'};return _0x13efb8;}})});}_0x4f11c5=_['merge']({},_0x4f11c5,_0x32885f[_0x8fd5('0x3d')]);var _0x2470f8={'where':_0x4f11c5[_0x8fd5('0x38')]};return db[_0x8fd5('0x3e')]['count'](_0x2470f8)[_0x8fd5('0x24')](function(_0x7a09ee){_0x54d02f[_0x8fd5('0x1e')]=_0x7a09ee;if(_0x32885f[_0x8fd5('0x33')][_0x8fd5('0x3f')]){_0x4f11c5['include']=[{'all':!![]}];}return db['FreshsalesConfiguration'][_0x8fd5('0x40')](_0x4f11c5);})[_0x8fd5('0x24')](function(_0x317b41){_0x54d02f['rows']=_0x317b41;return _0x54d02f;})[_0x8fd5('0x24')](respondWithFilteredResult(_0x25ab30,_0x4f11c5))['catch'](handleError(_0x25ab30,null));};exports['show']=function(_0x2d1fe8,_0xcf7518){var _0x4fc9fa={'raw':![],'where':{'id':_0x2d1fe8[_0x8fd5('0x41')]['id']}},_0x162cc9={};_0x162cc9[_0x8fd5('0x2d')]=_[_0x8fd5('0x2e')](db[_0x8fd5('0x3e')][_0x8fd5('0x42')]);_0x162cc9[_0x8fd5('0x33')]=_[_0x8fd5('0x2e')](_0x2d1fe8[_0x8fd5('0x33')]);_0x162cc9['filters']=_[_0x8fd5('0x31')](_0x162cc9['model'],_0x162cc9['query']);_0x4fc9fa[_0x8fd5('0x30')]=_[_0x8fd5('0x31')](_0x162cc9['model'],qs['fields'](_0x2d1fe8[_0x8fd5('0x33')][_0x8fd5('0x32')]));_0x4fc9fa[_0x8fd5('0x30')]=_0x4fc9fa['attributes'][_0x8fd5('0x34')]?_0x4fc9fa['attributes']:_0x162cc9[_0x8fd5('0x2d')];if(_0x2d1fe8[_0x8fd5('0x33')][_0x8fd5('0x3f')]){_0x4fc9fa[_0x8fd5('0x43')]=[{'all':!![]}];}_0x4fc9fa=_[_0x8fd5('0x3b')]({},_0x4fc9fa,_0x2d1fe8[_0x8fd5('0x3d')]);return db[_0x8fd5('0x3e')]['find'](_0x4fc9fa)[_0x8fd5('0x24')](handleEntityNotFound(_0xcf7518,null))[_0x8fd5('0x24')](respondWithResult(_0xcf7518,null))[_0x8fd5('0x44')](handleError(_0xcf7518,null));};exports[_0x8fd5('0x45')]=function(_0x18d21f,_0x16db10){return db[_0x8fd5('0x3e')]['create'](_0x18d21f[_0x8fd5('0x46')],{})['then'](respondWithResult(_0x16db10,0xc9))[_0x8fd5('0x44')](handleError(_0x16db10,null));};exports['update']=function(_0xa12dc7,_0x3071cd){if(_0xa12dc7[_0x8fd5('0x46')]['id']){delete _0xa12dc7[_0x8fd5('0x46')]['id'];}return db[_0x8fd5('0x3e')][_0x8fd5('0x47')]({'where':{'id':_0xa12dc7[_0x8fd5('0x41')]['id']}})[_0x8fd5('0x24')](handleEntityNotFound(_0x3071cd,null))['then'](saveUpdates(_0xa12dc7[_0x8fd5('0x46')],null))[_0x8fd5('0x24')](respondWithResult(_0x3071cd,null))[_0x8fd5('0x44')](handleError(_0x3071cd,null));};exports[_0x8fd5('0x25')]=function(_0x1d1898,_0x5f3f4b){return db[_0x8fd5('0x3e')][_0x8fd5('0x47')]({'where':{'id':_0x1d1898[_0x8fd5('0x41')]['id']}})['then'](handleEntityNotFound(_0x5f3f4b,null))[_0x8fd5('0x24')](removeEntity(_0x5f3f4b,null))[_0x8fd5('0x44')](handleError(_0x5f3f4b,null));};exports[_0x8fd5('0x48')]=function(_0x33662f,_0x3acc4b,_0x326f72){var _0x8a164c={};var _0x4c2481={};var _0x4859e9;var _0x958ed8;return db[_0x8fd5('0x3e')][_0x8fd5('0x49')]({'where':{'id':_0x33662f[_0x8fd5('0x41')]['id']}})['then'](handleEntityNotFound(_0x3acc4b,null))[_0x8fd5('0x24')](function(_0x1ef7b5){if(_0x1ef7b5){_0x4859e9=_0x1ef7b5;_0x4c2481[_0x8fd5('0x2d')]=_[_0x8fd5('0x2e')](db['FreshsalesField'][_0x8fd5('0x42')]);_0x4c2481[_0x8fd5('0x33')]=_[_0x8fd5('0x2e')](_0x33662f[_0x8fd5('0x33')]);_0x4c2481['filters']=_[_0x8fd5('0x31')](_0x4c2481[_0x8fd5('0x2d')],_0x4c2481['query']);_0x8a164c['attributes']=_[_0x8fd5('0x31')](_0x4c2481[_0x8fd5('0x2d')],qs[_0x8fd5('0x32')](_0x33662f[_0x8fd5('0x33')]['fields']));_0x8a164c[_0x8fd5('0x30')]=_0x8a164c[_0x8fd5('0x30')][_0x8fd5('0x34')]?_0x8a164c[_0x8fd5('0x30')]:_0x4c2481[_0x8fd5('0x2d')];_0x8a164c[_0x8fd5('0x36')]=qs[_0x8fd5('0x37')](_0x33662f[_0x8fd5('0x33')][_0x8fd5('0x37')]);_0x8a164c['where']=qs[_0x8fd5('0x2f')](_['pick'](_0x33662f[_0x8fd5('0x33')],_0x4c2481['filters']));if(_0x33662f['query']['filter']){_0x8a164c[_0x8fd5('0x38')]=_[_0x8fd5('0x3b')](_0x8a164c['where'],{'$or':_[_0x8fd5('0x2a')](_0x8a164c[_0x8fd5('0x30')],function(_0x5edd4e){var _0xe56e67={};_0xe56e67[_0x5edd4e]={'$like':'%'+_0x33662f[_0x8fd5('0x33')][_0x8fd5('0x3a')]+'%'};return _0xe56e67;})});}_0x8a164c=_[_0x8fd5('0x3b')]({},_0x8a164c,_0x33662f['options']);return _0x4859e9['getSubjects'](_0x8a164c);}})[_0x8fd5('0x24')](function(_0x376a0c){if(_0x376a0c){_0x958ed8=_0x376a0c['length'];if(!_0x33662f['query'][_0x8fd5('0x4a')]('nolimit')){_0x8a164c['limit']=qs['limit'](_0x33662f['query'][_0x8fd5('0x1d')]);_0x8a164c[_0x8fd5('0x1b')]=qs[_0x8fd5('0x1b')](_0x33662f[_0x8fd5('0x33')][_0x8fd5('0x1b')]);}return _0x4859e9[_0x8fd5('0x48')](_0x8a164c);}})[_0x8fd5('0x24')](function(_0x545cbc){if(_0x545cbc){return _0x545cbc?{'count':_0x958ed8,'rows':_0x545cbc}:null;}})[_0x8fd5('0x24')](respondWithResult(_0x3acc4b,null))[_0x8fd5('0x44')](handleError(_0x3acc4b,null));};exports['getDescriptions']=function(_0x353922,_0x39c73c,_0x2fb25b){var _0x4c6101={};var _0x325ffb={};var _0xdc6fda;var _0x55f60a;return db[_0x8fd5('0x3e')][_0x8fd5('0x49')]({'where':{'id':_0x353922['params']['id']}})[_0x8fd5('0x24')](handleEntityNotFound(_0x39c73c,null))[_0x8fd5('0x24')](function(_0xab786e){if(_0xab786e){_0xdc6fda=_0xab786e;_0x325ffb[_0x8fd5('0x2d')]=_['keys'](db['FreshsalesField']['rawAttributes']);_0x325ffb[_0x8fd5('0x33')]=_[_0x8fd5('0x2e')](_0x353922[_0x8fd5('0x33')]);_0x325ffb[_0x8fd5('0x2f')]=_['intersection'](_0x325ffb[_0x8fd5('0x2d')],_0x325ffb[_0x8fd5('0x33')]);_0x4c6101['attributes']=_[_0x8fd5('0x31')](_0x325ffb[_0x8fd5('0x2d')],qs[_0x8fd5('0x32')](_0x353922[_0x8fd5('0x33')][_0x8fd5('0x32')]));_0x4c6101['attributes']=_0x4c6101['attributes'][_0x8fd5('0x34')]?_0x4c6101[_0x8fd5('0x30')]:_0x325ffb['model'];_0x4c6101[_0x8fd5('0x36')]=qs[_0x8fd5('0x37')](_0x353922['query']['sort']);_0x4c6101[_0x8fd5('0x38')]=qs[_0x8fd5('0x2f')](_[_0x8fd5('0x39')](_0x353922[_0x8fd5('0x33')],_0x325ffb[_0x8fd5('0x2f')]));if(_0x353922[_0x8fd5('0x33')][_0x8fd5('0x3a')]){_0x4c6101[_0x8fd5('0x38')]=_['merge'](_0x4c6101[_0x8fd5('0x38')],{'$or':_['map'](_0x4c6101['attributes'],function(_0x2d0c78){var _0x49bd12={};_0x49bd12[_0x2d0c78]={'$like':'%'+_0x353922[_0x8fd5('0x33')][_0x8fd5('0x3a')]+'%'};return _0x49bd12;})});}_0x4c6101=_[_0x8fd5('0x3b')]({},_0x4c6101,_0x353922[_0x8fd5('0x3d')]);return _0xdc6fda[_0x8fd5('0x4b')](_0x4c6101);}})[_0x8fd5('0x24')](function(_0x2a1cf6){if(_0x2a1cf6){_0x55f60a=_0x2a1cf6[_0x8fd5('0x34')];if(!_0x353922['query']['hasOwnProperty'](_0x8fd5('0x35'))){_0x4c6101[_0x8fd5('0x1d')]=qs['limit'](_0x353922[_0x8fd5('0x33')][_0x8fd5('0x1d')]);_0x4c6101[_0x8fd5('0x1b')]=qs[_0x8fd5('0x1b')](_0x353922[_0x8fd5('0x33')][_0x8fd5('0x1b')]);}return _0xdc6fda[_0x8fd5('0x4b')](_0x4c6101);}})[_0x8fd5('0x24')](function(_0x59770a){if(_0x59770a){return _0x59770a?{'count':_0x55f60a,'rows':_0x59770a}:null;}})['then'](respondWithResult(_0x39c73c,null))['catch'](handleError(_0x39c73c,null));};exports[_0x8fd5('0x4c')]=function(_0x4878b2,_0x544889,_0x524639){var _0x29a372={};var _0x144456={};var _0x12e7d6;var _0x1144da;return db[_0x8fd5('0x3e')][_0x8fd5('0x49')]({'where':{'id':_0x4878b2[_0x8fd5('0x41')]['id']}})[_0x8fd5('0x24')](handleEntityNotFound(_0x544889,null))['then'](function(_0x178ef3){if(_0x178ef3){_0x12e7d6=_0x178ef3;_0x144456['model']=_[_0x8fd5('0x2e')](db[_0x8fd5('0x4d')][_0x8fd5('0x42')]);_0x144456[_0x8fd5('0x33')]=_[_0x8fd5('0x2e')](_0x4878b2[_0x8fd5('0x33')]);_0x144456['filters']=_[_0x8fd5('0x31')](_0x144456[_0x8fd5('0x2d')],_0x144456['query']);_0x29a372[_0x8fd5('0x30')]=_[_0x8fd5('0x31')](_0x144456[_0x8fd5('0x2d')],qs['fields'](_0x4878b2[_0x8fd5('0x33')][_0x8fd5('0x32')]));_0x29a372['attributes']=_0x29a372['attributes'][_0x8fd5('0x34')]?_0x29a372[_0x8fd5('0x30')]:_0x144456[_0x8fd5('0x2d')];_0x29a372[_0x8fd5('0x36')]=qs[_0x8fd5('0x37')](_0x4878b2[_0x8fd5('0x33')]['sort']);_0x29a372[_0x8fd5('0x38')]=qs[_0x8fd5('0x2f')](_[_0x8fd5('0x39')](_0x4878b2['query'],_0x144456[_0x8fd5('0x2f')]));if(_0x4878b2[_0x8fd5('0x33')][_0x8fd5('0x3a')]){_0x29a372[_0x8fd5('0x38')]=_[_0x8fd5('0x3b')](_0x29a372['where'],{'$or':_['map'](_0x29a372[_0x8fd5('0x30')],function(_0x54acf7){var _0x3cfd52={};_0x3cfd52[_0x54acf7]={'$like':'%'+_0x4878b2['query']['filter']+'%'};return _0x3cfd52;})});}_0x29a372=_[_0x8fd5('0x3b')]({},_0x29a372,_0x4878b2[_0x8fd5('0x3d')]);return _0x12e7d6['getFields'](_0x29a372);}})[_0x8fd5('0x24')](function(_0x1f46ce){if(_0x1f46ce){_0x1144da=_0x1f46ce['length'];if(!_0x4878b2[_0x8fd5('0x33')]['hasOwnProperty'](_0x8fd5('0x35'))){_0x29a372['limit']=qs[_0x8fd5('0x1d')](_0x4878b2['query'][_0x8fd5('0x1d')]);_0x29a372[_0x8fd5('0x1b')]=qs['offset'](_0x4878b2[_0x8fd5('0x33')][_0x8fd5('0x1b')]);}return _0x12e7d6[_0x8fd5('0x4c')](_0x29a372);}})[_0x8fd5('0x24')](function(_0x543f2d){if(_0x543f2d){return _0x543f2d?{'count':_0x1144da,'rows':_0x543f2d}:null;}})[_0x8fd5('0x24')](respondWithResult(_0x544889,null))[_0x8fd5('0x44')](handleError(_0x544889,null));}; \ No newline at end of file +var _0x45eb=['create','body','destroy','getSubjects','findOne','order','options','getDescriptions','FreshsalesField','getFields','eml-format','rimraf','zip-dir','moment','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','json','offset','limit','count','reject','save','update','then','stack','name','send','index','map','FreshsalesConfiguration','rawAttributes','fieldName','type','model','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','sort','where','pick','merge','VIRTUAL','filter','includeAll','rows','catch','show','params','keys','include','find'];(function(_0x37d00,_0x59bb14){var _0x208534=function(_0x10acdf){while(--_0x10acdf){_0x37d00['push'](_0x37d00['shift']());}};_0x208534(++_0x59bb14);}(_0x45eb,0x142));var _0xb45e=function(_0x1c688b,_0x4df102){_0x1c688b=_0x1c688b-0x0;var _0x4d4577=_0x45eb[_0x1c688b];return _0x4d4577;};'use strict';var emlformat=require(_0xb45e('0x0'));var rimraf=require(_0xb45e('0x1'));var zipdir=require(_0xb45e('0x2'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0xb45e('0x3'));var BPromise=require('bluebird');var Mustache=require(_0xb45e('0x4'));var util=require(_0xb45e('0x5'));var path=require(_0xb45e('0x6'));var sox=require(_0xb45e('0x7'));var csv=require(_0xb45e('0x8'));var ejs=require(_0xb45e('0x9'));var fs=require('fs');var fs_extra=require(_0xb45e('0xa'));var _=require(_0xb45e('0xb'));var squel=require(_0xb45e('0xc'));var crypto=require(_0xb45e('0xd'));var jsforce=require(_0xb45e('0xe'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0xb45e('0xf'));var Papa=require(_0xb45e('0x10'));var Redis=require(_0xb45e('0x11'));var authService=require(_0xb45e('0x12'));var qs=require(_0xb45e('0x13'));var as=require(_0xb45e('0x14'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xb45e('0x15'))('api');var utils=require(_0xb45e('0x16'));var config=require(_0xb45e('0x17'));var licenseUtil=require(_0xb45e('0x18'));var db=require(_0xb45e('0x19'))['db'];function respondWithStatusCode(_0x2dcca8,_0x2772bb){_0x2772bb=_0x2772bb||0xcc;return function(_0x586c01){if(_0x586c01){return _0x2dcca8[_0xb45e('0x1a')](_0x2772bb);}return _0x2dcca8[_0xb45e('0x1b')](_0x2772bb)['end']();};}function respondWithResult(_0x5cff4f,_0x396ac0){_0x396ac0=_0x396ac0||0xc8;return function(_0x117e16){if(_0x117e16){return _0x5cff4f[_0xb45e('0x1b')](_0x396ac0)[_0xb45e('0x1c')](_0x117e16);}};}function respondWithFilteredResult(_0x209d77,_0x4e361e){return function(_0x3516ec){if(_0x3516ec){var _0x130650=typeof _0x4e361e[_0xb45e('0x1d')]==='undefined'&&typeof _0x4e361e[_0xb45e('0x1e')]==='undefined';var _0x43f3f0=_0x3516ec[_0xb45e('0x1f')];var _0x17c1cc=_0x130650?0x0:_0x4e361e[_0xb45e('0x1d')];var _0x2ad97d=_0x130650?_0x3516ec['count']:_0x4e361e[_0xb45e('0x1d')]+_0x4e361e[_0xb45e('0x1e')];var _0x35d057;if(_0x2ad97d>=_0x43f3f0){_0x2ad97d=_0x43f3f0;_0x35d057=0xc8;}else{_0x35d057=0xce;}_0x209d77[_0xb45e('0x1b')](_0x35d057);return _0x209d77['set']('Content-Range',_0x17c1cc+'-'+_0x2ad97d+'/'+_0x43f3f0)[_0xb45e('0x1c')](_0x3516ec);}return null;};}function patchUpdates(_0x1fd8c8){return function(_0x21b211){try{jsonpatch['apply'](_0x21b211,_0x1fd8c8,!![]);}catch(_0x2b25f9){return BPromise[_0xb45e('0x20')](_0x2b25f9);}return _0x21b211[_0xb45e('0x21')]();};}function saveUpdates(_0x1e517c,_0x564722){return function(_0x59cd6a){if(_0x59cd6a){return _0x59cd6a[_0xb45e('0x22')](_0x1e517c)[_0xb45e('0x23')](function(_0x3b757e){return _0x3b757e;});}return null;};}function removeEntity(_0x1cec6f,_0x3962be){return function(_0x46ebcb){if(_0x46ebcb){return _0x46ebcb['destroy']()[_0xb45e('0x23')](function(){_0x1cec6f[_0xb45e('0x1b')](0xcc)['end']();});}};}function handleEntityNotFound(_0x4f40b3,_0x5de0dd){return function(_0x1dcb7c){if(!_0x1dcb7c){_0x4f40b3[_0xb45e('0x1a')](0x194);}return _0x1dcb7c;};}function handleError(_0x2c2361,_0x318968){_0x318968=_0x318968||0x1f4;return function(_0x56193b){logger['error'](_0x56193b[_0xb45e('0x24')]);if(_0x56193b['name']){delete _0x56193b[_0xb45e('0x25')];}_0x2c2361[_0xb45e('0x1b')](_0x318968)[_0xb45e('0x26')](_0x56193b);};}exports[_0xb45e('0x27')]=function(_0x20a539,_0x1e0345){var _0x5e7ecc={},_0x3f3ba6={},_0xd5dbec={'count':0x0,'rows':[]};var _0x39a862=_[_0xb45e('0x28')](db[_0xb45e('0x29')][_0xb45e('0x2a')],function(_0x217ad7){return{'name':_0x217ad7[_0xb45e('0x2b')],'type':_0x217ad7[_0xb45e('0x2c')]['key']};});_0x3f3ba6[_0xb45e('0x2d')]=_[_0xb45e('0x28')](_0x39a862,_0xb45e('0x25'));_0x3f3ba6['query']=_['keys'](_0x20a539[_0xb45e('0x2e')]);_0x3f3ba6[_0xb45e('0x2f')]=_[_0xb45e('0x30')](_0x3f3ba6[_0xb45e('0x2d')],_0x3f3ba6[_0xb45e('0x2e')]);_0x5e7ecc[_0xb45e('0x31')]=_[_0xb45e('0x30')](_0x3f3ba6['model'],qs[_0xb45e('0x32')](_0x20a539[_0xb45e('0x2e')]['fields']));_0x5e7ecc[_0xb45e('0x31')]=_0x5e7ecc[_0xb45e('0x31')][_0xb45e('0x33')]?_0x5e7ecc[_0xb45e('0x31')]:_0x3f3ba6[_0xb45e('0x2d')];if(!_0x20a539[_0xb45e('0x2e')][_0xb45e('0x34')](_0xb45e('0x35'))){_0x5e7ecc[_0xb45e('0x1e')]=qs['limit'](_0x20a539[_0xb45e('0x2e')]['limit']);_0x5e7ecc[_0xb45e('0x1d')]=qs['offset'](_0x20a539[_0xb45e('0x2e')][_0xb45e('0x1d')]);}_0x5e7ecc['order']=qs[_0xb45e('0x36')](_0x20a539[_0xb45e('0x2e')][_0xb45e('0x36')]);_0x5e7ecc[_0xb45e('0x37')]=qs[_0xb45e('0x2f')](_[_0xb45e('0x38')](_0x20a539[_0xb45e('0x2e')],_0x3f3ba6['filters']),_0x39a862);if(_0x20a539[_0xb45e('0x2e')]['filter']){_0x5e7ecc[_0xb45e('0x37')]=_[_0xb45e('0x39')](_0x5e7ecc[_0xb45e('0x37')],{'$or':_[_0xb45e('0x28')](_0x39a862,function(_0x4f7f5c){if(_0x4f7f5c[_0xb45e('0x2c')]!==_0xb45e('0x3a')){var _0x3d15f0={};_0x3d15f0[_0x4f7f5c[_0xb45e('0x25')]]={'$like':'%'+_0x20a539[_0xb45e('0x2e')][_0xb45e('0x3b')]+'%'};return _0x3d15f0;}})});}_0x5e7ecc=_['merge']({},_0x5e7ecc,_0x20a539['options']);var _0x55b332={'where':_0x5e7ecc[_0xb45e('0x37')]};return db[_0xb45e('0x29')][_0xb45e('0x1f')](_0x55b332)['then'](function(_0x54efa7){_0xd5dbec['count']=_0x54efa7;if(_0x20a539[_0xb45e('0x2e')][_0xb45e('0x3c')]){_0x5e7ecc['include']=[{'all':!![]}];}return db[_0xb45e('0x29')]['findAll'](_0x5e7ecc);})[_0xb45e('0x23')](function(_0x88f6f2){_0xd5dbec[_0xb45e('0x3d')]=_0x88f6f2;return _0xd5dbec;})[_0xb45e('0x23')](respondWithFilteredResult(_0x1e0345,_0x5e7ecc))[_0xb45e('0x3e')](handleError(_0x1e0345,null));};exports[_0xb45e('0x3f')]=function(_0xb2f66b,_0x518b5c){var _0x4b6709={'raw':![],'where':{'id':_0xb2f66b[_0xb45e('0x40')]['id']}},_0x1a17dd={};_0x1a17dd[_0xb45e('0x2d')]=_[_0xb45e('0x41')](db[_0xb45e('0x29')][_0xb45e('0x2a')]);_0x1a17dd['query']=_[_0xb45e('0x41')](_0xb2f66b[_0xb45e('0x2e')]);_0x1a17dd[_0xb45e('0x2f')]=_[_0xb45e('0x30')](_0x1a17dd[_0xb45e('0x2d')],_0x1a17dd['query']);_0x4b6709[_0xb45e('0x31')]=_[_0xb45e('0x30')](_0x1a17dd['model'],qs[_0xb45e('0x32')](_0xb2f66b['query'][_0xb45e('0x32')]));_0x4b6709['attributes']=_0x4b6709['attributes'][_0xb45e('0x33')]?_0x4b6709['attributes']:_0x1a17dd[_0xb45e('0x2d')];if(_0xb2f66b[_0xb45e('0x2e')][_0xb45e('0x3c')]){_0x4b6709[_0xb45e('0x42')]=[{'all':!![]}];}_0x4b6709=_['merge']({},_0x4b6709,_0xb2f66b['options']);return db['FreshsalesConfiguration'][_0xb45e('0x43')](_0x4b6709)[_0xb45e('0x23')](handleEntityNotFound(_0x518b5c,null))[_0xb45e('0x23')](respondWithResult(_0x518b5c,null))['catch'](handleError(_0x518b5c,null));};exports[_0xb45e('0x44')]=function(_0x2d2067,_0x2093c7){return db['FreshsalesConfiguration'][_0xb45e('0x44')](_0x2d2067[_0xb45e('0x45')],{})[_0xb45e('0x23')](respondWithResult(_0x2093c7,0xc9))[_0xb45e('0x3e')](handleError(_0x2093c7,null));};exports[_0xb45e('0x22')]=function(_0x39d1ab,_0x3fb2c3){if(_0x39d1ab['body']['id']){delete _0x39d1ab[_0xb45e('0x45')]['id'];}return db[_0xb45e('0x29')][_0xb45e('0x43')]({'where':{'id':_0x39d1ab['params']['id']}})[_0xb45e('0x23')](handleEntityNotFound(_0x3fb2c3,null))[_0xb45e('0x23')](saveUpdates(_0x39d1ab['body'],null))[_0xb45e('0x23')](respondWithResult(_0x3fb2c3,null))[_0xb45e('0x3e')](handleError(_0x3fb2c3,null));};exports[_0xb45e('0x46')]=function(_0x5c747c,_0x58c48c){return db['FreshsalesConfiguration'][_0xb45e('0x43')]({'where':{'id':_0x5c747c[_0xb45e('0x40')]['id']}})['then'](handleEntityNotFound(_0x58c48c,null))['then'](removeEntity(_0x58c48c,null))[_0xb45e('0x3e')](handleError(_0x58c48c,null));};exports[_0xb45e('0x47')]=function(_0x163f3a,_0x23e44c,_0xc5537){var _0x18e89a={};var _0xb836c1={};var _0x4ec0a2;var _0x24b7fe;return db[_0xb45e('0x29')][_0xb45e('0x48')]({'where':{'id':_0x163f3a[_0xb45e('0x40')]['id']}})[_0xb45e('0x23')](handleEntityNotFound(_0x23e44c,null))[_0xb45e('0x23')](function(_0x4f730d){if(_0x4f730d){_0x4ec0a2=_0x4f730d;_0xb836c1['model']=_[_0xb45e('0x41')](db['FreshsalesField'][_0xb45e('0x2a')]);_0xb836c1[_0xb45e('0x2e')]=_[_0xb45e('0x41')](_0x163f3a[_0xb45e('0x2e')]);_0xb836c1[_0xb45e('0x2f')]=_[_0xb45e('0x30')](_0xb836c1[_0xb45e('0x2d')],_0xb836c1[_0xb45e('0x2e')]);_0x18e89a['attributes']=_[_0xb45e('0x30')](_0xb836c1[_0xb45e('0x2d')],qs[_0xb45e('0x32')](_0x163f3a['query'][_0xb45e('0x32')]));_0x18e89a[_0xb45e('0x31')]=_0x18e89a[_0xb45e('0x31')][_0xb45e('0x33')]?_0x18e89a['attributes']:_0xb836c1[_0xb45e('0x2d')];_0x18e89a[_0xb45e('0x49')]=qs['sort'](_0x163f3a[_0xb45e('0x2e')][_0xb45e('0x36')]);_0x18e89a[_0xb45e('0x37')]=qs[_0xb45e('0x2f')](_[_0xb45e('0x38')](_0x163f3a['query'],_0xb836c1[_0xb45e('0x2f')]));if(_0x163f3a['query'][_0xb45e('0x3b')]){_0x18e89a[_0xb45e('0x37')]=_[_0xb45e('0x39')](_0x18e89a[_0xb45e('0x37')],{'$or':_[_0xb45e('0x28')](_0x18e89a[_0xb45e('0x31')],function(_0x301437){var _0x19319a={};_0x19319a[_0x301437]={'$like':'%'+_0x163f3a[_0xb45e('0x2e')]['filter']+'%'};return _0x19319a;})});}_0x18e89a=_[_0xb45e('0x39')]({},_0x18e89a,_0x163f3a[_0xb45e('0x4a')]);return _0x4ec0a2[_0xb45e('0x47')](_0x18e89a);}})[_0xb45e('0x23')](function(_0x1d321b){if(_0x1d321b){_0x24b7fe=_0x1d321b[_0xb45e('0x33')];if(!_0x163f3a[_0xb45e('0x2e')][_0xb45e('0x34')](_0xb45e('0x35'))){_0x18e89a[_0xb45e('0x1e')]=qs[_0xb45e('0x1e')](_0x163f3a[_0xb45e('0x2e')]['limit']);_0x18e89a[_0xb45e('0x1d')]=qs[_0xb45e('0x1d')](_0x163f3a[_0xb45e('0x2e')][_0xb45e('0x1d')]);}return _0x4ec0a2['getSubjects'](_0x18e89a);}})[_0xb45e('0x23')](function(_0x3659b7){if(_0x3659b7){return _0x3659b7?{'count':_0x24b7fe,'rows':_0x3659b7}:null;}})[_0xb45e('0x23')](respondWithResult(_0x23e44c,null))[_0xb45e('0x3e')](handleError(_0x23e44c,null));};exports[_0xb45e('0x4b')]=function(_0x58c123,_0x8aaf62,_0x45753e){var _0x5b548e={};var _0x2cd568={};var _0x374cf9;var _0x14dc4a;return db['FreshsalesConfiguration']['findOne']({'where':{'id':_0x58c123['params']['id']}})[_0xb45e('0x23')](handleEntityNotFound(_0x8aaf62,null))[_0xb45e('0x23')](function(_0x118b2b){if(_0x118b2b){_0x374cf9=_0x118b2b;_0x2cd568[_0xb45e('0x2d')]=_[_0xb45e('0x41')](db[_0xb45e('0x4c')][_0xb45e('0x2a')]);_0x2cd568['query']=_[_0xb45e('0x41')](_0x58c123['query']);_0x2cd568['filters']=_[_0xb45e('0x30')](_0x2cd568[_0xb45e('0x2d')],_0x2cd568[_0xb45e('0x2e')]);_0x5b548e[_0xb45e('0x31')]=_[_0xb45e('0x30')](_0x2cd568[_0xb45e('0x2d')],qs[_0xb45e('0x32')](_0x58c123[_0xb45e('0x2e')][_0xb45e('0x32')]));_0x5b548e[_0xb45e('0x31')]=_0x5b548e[_0xb45e('0x31')][_0xb45e('0x33')]?_0x5b548e[_0xb45e('0x31')]:_0x2cd568[_0xb45e('0x2d')];_0x5b548e[_0xb45e('0x49')]=qs['sort'](_0x58c123[_0xb45e('0x2e')][_0xb45e('0x36')]);_0x5b548e['where']=qs[_0xb45e('0x2f')](_[_0xb45e('0x38')](_0x58c123['query'],_0x2cd568['filters']));if(_0x58c123[_0xb45e('0x2e')][_0xb45e('0x3b')]){_0x5b548e[_0xb45e('0x37')]=_[_0xb45e('0x39')](_0x5b548e[_0xb45e('0x37')],{'$or':_[_0xb45e('0x28')](_0x5b548e['attributes'],function(_0x38accf){var _0x49b43d={};_0x49b43d[_0x38accf]={'$like':'%'+_0x58c123[_0xb45e('0x2e')][_0xb45e('0x3b')]+'%'};return _0x49b43d;})});}_0x5b548e=_[_0xb45e('0x39')]({},_0x5b548e,_0x58c123[_0xb45e('0x4a')]);return _0x374cf9[_0xb45e('0x4b')](_0x5b548e);}})[_0xb45e('0x23')](function(_0x2005dc){if(_0x2005dc){_0x14dc4a=_0x2005dc[_0xb45e('0x33')];if(!_0x58c123[_0xb45e('0x2e')][_0xb45e('0x34')](_0xb45e('0x35'))){_0x5b548e[_0xb45e('0x1e')]=qs[_0xb45e('0x1e')](_0x58c123['query'][_0xb45e('0x1e')]);_0x5b548e['offset']=qs[_0xb45e('0x1d')](_0x58c123['query'][_0xb45e('0x1d')]);}return _0x374cf9['getDescriptions'](_0x5b548e);}})[_0xb45e('0x23')](function(_0x2b4286){if(_0x2b4286){return _0x2b4286?{'count':_0x14dc4a,'rows':_0x2b4286}:null;}})[_0xb45e('0x23')](respondWithResult(_0x8aaf62,null))[_0xb45e('0x3e')](handleError(_0x8aaf62,null));};exports[_0xb45e('0x4d')]=function(_0x95ec77,_0x37efca,_0x5835d3){var _0x5178b3={};var _0x17e1ba={};var _0x325534;var _0x513f20;return db[_0xb45e('0x29')]['findOne']({'where':{'id':_0x95ec77[_0xb45e('0x40')]['id']}})[_0xb45e('0x23')](handleEntityNotFound(_0x37efca,null))['then'](function(_0x786b13){if(_0x786b13){_0x325534=_0x786b13;_0x17e1ba['model']=_[_0xb45e('0x41')](db[_0xb45e('0x4c')][_0xb45e('0x2a')]);_0x17e1ba[_0xb45e('0x2e')]=_[_0xb45e('0x41')](_0x95ec77['query']);_0x17e1ba['filters']=_[_0xb45e('0x30')](_0x17e1ba[_0xb45e('0x2d')],_0x17e1ba[_0xb45e('0x2e')]);_0x5178b3['attributes']=_['intersection'](_0x17e1ba[_0xb45e('0x2d')],qs[_0xb45e('0x32')](_0x95ec77[_0xb45e('0x2e')][_0xb45e('0x32')]));_0x5178b3[_0xb45e('0x31')]=_0x5178b3[_0xb45e('0x31')]['length']?_0x5178b3[_0xb45e('0x31')]:_0x17e1ba[_0xb45e('0x2d')];_0x5178b3['order']=qs[_0xb45e('0x36')](_0x95ec77['query']['sort']);_0x5178b3[_0xb45e('0x37')]=qs[_0xb45e('0x2f')](_[_0xb45e('0x38')](_0x95ec77['query'],_0x17e1ba[_0xb45e('0x2f')]));if(_0x95ec77[_0xb45e('0x2e')][_0xb45e('0x3b')]){_0x5178b3['where']=_[_0xb45e('0x39')](_0x5178b3[_0xb45e('0x37')],{'$or':_[_0xb45e('0x28')](_0x5178b3[_0xb45e('0x31')],function(_0x283d5a){var _0x2032b7={};_0x2032b7[_0x283d5a]={'$like':'%'+_0x95ec77[_0xb45e('0x2e')][_0xb45e('0x3b')]+'%'};return _0x2032b7;})});}_0x5178b3=_[_0xb45e('0x39')]({},_0x5178b3,_0x95ec77['options']);return _0x325534['getFields'](_0x5178b3);}})[_0xb45e('0x23')](function(_0x27cb93){if(_0x27cb93){_0x513f20=_0x27cb93[_0xb45e('0x33')];if(!_0x95ec77[_0xb45e('0x2e')][_0xb45e('0x34')](_0xb45e('0x35'))){_0x5178b3['limit']=qs[_0xb45e('0x1e')](_0x95ec77['query'][_0xb45e('0x1e')]);_0x5178b3[_0xb45e('0x1d')]=qs['offset'](_0x95ec77[_0xb45e('0x2e')][_0xb45e('0x1d')]);}return _0x325534['getFields'](_0x5178b3);}})[_0xb45e('0x23')](function(_0x2bbb62){if(_0x2bbb62){return _0x2bbb62?{'count':_0x513f20,'rows':_0x2bbb62}:null;}})['then'](respondWithResult(_0x37efca,null))[_0xb45e('0x3e')](handleError(_0x37efca,null));}; \ No newline at end of file diff --git a/server/api/intFreshsalesConfiguration/intFreshsalesConfiguration.model.js b/server/api/intFreshsalesConfiguration/intFreshsalesConfiguration.model.js index bb5a9ec..1b6f55e 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 _0x8a60=['./intFreshsalesConfiguration.attributes','exports','define','FreshsalesConfiguration','lodash','util','api','moment','bluebird','request-promise','path','rimraf'];(function(_0x54c194,_0x40a287){var _0x4a7009=function(_0x40488b){while(--_0x40488b){_0x54c194['push'](_0x54c194['shift']());}};_0x4a7009(++_0x40a287);}(_0x8a60,0xd0));var _0x08a6=function(_0x1c8491,_0x335e02){_0x1c8491=_0x1c8491-0x0;var _0x2a9aae=_0x8a60[_0x1c8491];return _0x2a9aae;};'use strict';var _=require(_0x08a6('0x0'));var util=require(_0x08a6('0x1'));var logger=require('../../config/logger')(_0x08a6('0x2'));var moment=require(_0x08a6('0x3'));var BPromise=require(_0x08a6('0x4'));var rp=require(_0x08a6('0x5'));var fs=require('fs');var path=require(_0x08a6('0x6'));var rimraf=require(_0x08a6('0x7'));var config=require('../../config/environment');var attributes=require(_0x08a6('0x8'));module[_0x08a6('0x9')]=function(_0x184df3,_0x2439cc){return _0x184df3[_0x08a6('0xa')](_0x08a6('0xb'),attributes,{'tableName':'int_freshsales_configurations','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x372a=['path','rimraf','exports','FreshsalesConfiguration','int_freshsales_configurations','lodash','../../config/logger','api','moment','bluebird','request-promise'];(function(_0x1e79b9,_0x223ef3){var _0x2c2d29=function(_0x4573aa){while(--_0x4573aa){_0x1e79b9['push'](_0x1e79b9['shift']());}};_0x2c2d29(++_0x223ef3);}(_0x372a,0x144));var _0xa372=function(_0x252aa0,_0x3bdca0){_0x252aa0=_0x252aa0-0x0;var _0x575216=_0x372a[_0x252aa0];return _0x575216;};'use strict';var _=require(_0xa372('0x0'));var util=require('util');var logger=require(_0xa372('0x1'))(_0xa372('0x2'));var moment=require(_0xa372('0x3'));var BPromise=require(_0xa372('0x4'));var rp=require(_0xa372('0x5'));var fs=require('fs');var path=require(_0xa372('0x6'));var rimraf=require(_0xa372('0x7'));var config=require('../../config/environment');var attributes=require('./intFreshsalesConfiguration.attributes');module[_0xa372('0x8')]=function(_0x453da1,_0x24af2c){return _0x453da1['define'](_0xa372('0x9'),attributes,{'tableName':_0xa372('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 36c6244..0933282 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 _0x8c82=['stringify','error','code','message','info','result','catch','lodash','moment','bluebird','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','then','FreshsalesConfiguration,\x20%s,\x20%s','request\x20sent','debug','FreshsalesConfiguration,\x20%s,\x20%s,\x20%s'];(function(_0x3a853d,_0x1c62fb){var _0x436119=function(_0x17c7b7){while(--_0x17c7b7){_0x3a853d['push'](_0x3a853d['shift']());}};_0x436119(++_0x1c62fb);}(_0x8c82,0x13b));var _0x28c8=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x8c82[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0x28c8('0x0'));var util=require('util');var moment=require(_0x28c8('0x1'));var BPromise=require(_0x28c8('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x28c8('0x3'));var db=require(_0x28c8('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0x28c8('0x5'))(_0x28c8('0x6'));var config=require(_0x28c8('0x7'));var jayson=require(_0x28c8('0x8'));var client=jayson[_0x28c8('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x542e17,_0x1fb04a,_0x2492d9){return new BPromise(function(_0x5e1bc4,_0x28e310){return client['request'](_0x542e17,_0x2492d9)[_0x28c8('0xa')](function(_0x44f12c){logger['info'](_0x28c8('0xb'),_0x1fb04a,_0x28c8('0xc'));logger[_0x28c8('0xd')](_0x28c8('0xe'),_0x1fb04a,_0x28c8('0xc'),JSON[_0x28c8('0xf')](_0x44f12c));if(_0x44f12c[_0x28c8('0x10')]){if(_0x44f12c['error'][_0x28c8('0x11')]===0x1f4){logger[_0x28c8('0x10')](_0x28c8('0xb'),_0x1fb04a,_0x44f12c['error']['message']);return _0x28e310(_0x44f12c[_0x28c8('0x10')][_0x28c8('0x12')]);}logger[_0x28c8('0x10')]('FreshsalesConfiguration,\x20%s,\x20%s',_0x1fb04a,_0x44f12c[_0x28c8('0x10')][_0x28c8('0x12')]);return _0x5e1bc4(_0x44f12c['error'][_0x28c8('0x12')]);}else{logger[_0x28c8('0x13')](_0x28c8('0xb'),_0x1fb04a,'request\x20sent');_0x5e1bc4(_0x44f12c[_0x28c8('0x14')][_0x28c8('0x12')]);}})[_0x28c8('0x15')](function(_0x40a23c){logger[_0x28c8('0x10')](_0x28c8('0xb'),_0x1fb04a,_0x40a23c);_0x28e310(_0x40a23c);});});} \ No newline at end of file +var _0xc575=['bluebird','randomstring','ioredis','../../mysqldb','http','then','request\x20sent','debug','FreshsalesConfiguration,\x20%s,\x20%s,\x20%s','stringify','error','code','FreshsalesConfiguration,\x20%s,\x20%s','message','info','catch','util'];(function(_0x1483af,_0x423b92){var _0x27fcc4=function(_0x1f3ea6){while(--_0x1f3ea6){_0x1483af['push'](_0x1483af['shift']());}};_0x27fcc4(++_0x423b92);}(_0xc575,0x1db));var _0x5c57=function(_0x32d6fd,_0x2b6541){_0x32d6fd=_0x32d6fd-0x0;var _0x548066=_0xc575[_0x32d6fd];return _0x548066;};'use strict';var _=require('lodash');var util=require(_0x5c57('0x0'));var moment=require('moment');var BPromise=require(_0x5c57('0x1'));var rs=require(_0x5c57('0x2'));var fs=require('fs');var Redis=require(_0x5c57('0x3'));var db=require(_0x5c57('0x4'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')('rpc');var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson['client'][_0x5c57('0x5')]({'port':0x232a});function respondWithRpcPromise(_0x56c7d9,_0x20bc6d,_0x162e78){return new BPromise(function(_0x1c8ed6,_0x17ab7c){return client['request'](_0x56c7d9,_0x162e78)[_0x5c57('0x6')](function(_0x56a8c3){logger['info']('FreshsalesConfiguration,\x20%s,\x20%s',_0x20bc6d,_0x5c57('0x7'));logger[_0x5c57('0x8')](_0x5c57('0x9'),_0x20bc6d,'request\x20sent',JSON[_0x5c57('0xa')](_0x56a8c3));if(_0x56a8c3[_0x5c57('0xb')]){if(_0x56a8c3[_0x5c57('0xb')][_0x5c57('0xc')]===0x1f4){logger[_0x5c57('0xb')](_0x5c57('0xd'),_0x20bc6d,_0x56a8c3[_0x5c57('0xb')][_0x5c57('0xe')]);return _0x17ab7c(_0x56a8c3[_0x5c57('0xb')]['message']);}logger['error'](_0x5c57('0xd'),_0x20bc6d,_0x56a8c3[_0x5c57('0xb')][_0x5c57('0xe')]);return _0x1c8ed6(_0x56a8c3['error'][_0x5c57('0xe')]);}else{logger[_0x5c57('0xf')](_0x5c57('0xd'),_0x20bc6d,'request\x20sent');_0x1c8ed6(_0x56a8c3['result'][_0x5c57('0xe')]);}})[_0x5c57('0x10')](function(_0xcf0014){logger[_0x5c57('0xb')](_0x5c57('0xd'),_0x20bc6d,_0xcf0014);_0x17ab7c(_0xcf0014);});});} \ No newline at end of file diff --git a/server/api/intFreshsalesField/index.js b/server/api/intFreshsalesField/index.js index 5ccb984..137d313 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 _0x5fc7=['connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./intFreshsalesField.controller','get','index','/:id','isAuthenticated','show','post','create','put','update','delete','exports','multer','util','path'];(function(_0x275910,_0x3d8c92){var _0x41d702=function(_0x428a29){while(--_0x428a29){_0x275910['push'](_0x275910['shift']());}};_0x41d702(++_0x3d8c92);}(_0x5fc7,0x1e1));var _0x75fc=function(_0x19dd7a,_0x51de21){_0x19dd7a=_0x19dd7a-0x0;var _0x3feb6a=_0x5fc7[_0x19dd7a];return _0x3feb6a;};'use strict';var multer=require(_0x75fc('0x0'));var util=require(_0x75fc('0x1'));var path=require(_0x75fc('0x2'));var timeout=require(_0x75fc('0x3'));var express=require(_0x75fc('0x4'));var router=express[_0x75fc('0x5')]();var fs_extra=require(_0x75fc('0x6'));var auth=require(_0x75fc('0x7'));var interaction=require(_0x75fc('0x8'));var config=require(_0x75fc('0x9'));var controller=require(_0x75fc('0xa'));router[_0x75fc('0xb')]('/',auth['isAuthenticated'](),controller[_0x75fc('0xc')]);router[_0x75fc('0xb')](_0x75fc('0xd'),auth[_0x75fc('0xe')](),controller[_0x75fc('0xf')]);router[_0x75fc('0x10')]('/',auth[_0x75fc('0xe')](),controller[_0x75fc('0x11')]);router[_0x75fc('0x12')](_0x75fc('0xd'),auth['isAuthenticated'](),controller[_0x75fc('0x13')]);router[_0x75fc('0x14')](_0x75fc('0xd'),auth[_0x75fc('0xe')](),controller['destroy']);module[_0x75fc('0x15')]=router; \ No newline at end of file +var _0x324f=['../../components/auth/service','../../components/interaction/service','./intFreshsalesField.controller','get','index','/:id','isAuthenticated','show','post','create','put','update','delete','destroy','exports','multer','util','path','Router'];(function(_0x19a9b5,_0x198382){var _0x632733=function(_0x2b4f07){while(--_0x2b4f07){_0x19a9b5['push'](_0x19a9b5['shift']());}};_0x632733(++_0x198382);}(_0x324f,0x94));var _0xf324=function(_0xa25342,_0x24522b){_0xa25342=_0xa25342-0x0;var _0x52be43=_0x324f[_0xa25342];return _0x52be43;};'use strict';var multer=require(_0xf324('0x0'));var util=require(_0xf324('0x1'));var path=require(_0xf324('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0xf324('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0xf324('0x4'));var interaction=require(_0xf324('0x5'));var config=require('../../config/environment');var controller=require(_0xf324('0x6'));router[_0xf324('0x7')]('/',auth['isAuthenticated'](),controller[_0xf324('0x8')]);router[_0xf324('0x7')](_0xf324('0x9'),auth[_0xf324('0xa')](),controller[_0xf324('0xb')]);router[_0xf324('0xc')]('/',auth[_0xf324('0xa')](),controller[_0xf324('0xd')]);router[_0xf324('0xe')]('/:id',auth[_0xf324('0xa')](),controller[_0xf324('0xf')]);router[_0xf324('0x10')](_0xf324('0x9'),auth['isAuthenticated'](),controller[_0xf324('0x11')]);module[_0xf324('0x12')]=router; \ No newline at end of file diff --git a/server/api/intFreshsalesField/intFreshsalesField.attributes.js b/server/api/intFreshsalesField/intFreshsalesField.attributes.js index 59d8037..e9869df 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 _0xff73=['picklist','STRING','sequelize','ENUM','string','variable','keyValue'];(function(_0x2affa1,_0x1d5ce6){var _0x4171be=function(_0x5b6fe1){while(--_0x5b6fe1){_0x2affa1['push'](_0x2affa1['shift']());}};_0x4171be(++_0x1d5ce6);}(_0xff73,0x152));var _0x3ff7=function(_0x3b59aa,_0x7a990b){_0x3b59aa=_0x3b59aa-0x0;var _0x5cad80=_0xff73[_0x3b59aa];return _0x5cad80;};'use strict';var Sequelize=require(_0x3ff7('0x0'));module['exports']={'type':{'type':Sequelize[_0x3ff7('0x1')](_0x3ff7('0x2'),_0x3ff7('0x3'),'customVariable',_0x3ff7('0x4'),_0x3ff7('0x5')),'defaultValue':'string'},'content':{'type':Sequelize[_0x3ff7('0x6')]},'key':{'type':Sequelize[_0x3ff7('0x6')]},'keyType':{'type':Sequelize['ENUM']('string',_0x3ff7('0x3'),'customVariable')},'keyContent':{'type':Sequelize[_0x3ff7('0x6')]},'idField':{'type':Sequelize[_0x3ff7('0x6')]},'nameField':{'type':Sequelize[_0x3ff7('0x6')]},'customField':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'variableName':{'type':Sequelize[_0x3ff7('0x6')]}}; \ No newline at end of file +var _0xd5e8=['BOOLEAN','ENUM','string','variable','customVariable','keyValue','STRING'];(function(_0xd68500,_0x1faeb1){var _0x2fcc22=function(_0x277552){while(--_0x277552){_0xd68500['push'](_0xd68500['shift']());}};_0x2fcc22(++_0x1faeb1);}(_0xd5e8,0x174));var _0x8d5e=function(_0x39b7a7,_0x1e92a1){_0x39b7a7=_0x39b7a7-0x0;var _0x28c909=_0xd5e8[_0x39b7a7];return _0x28c909;};'use strict';var Sequelize=require('sequelize');module['exports']={'type':{'type':Sequelize[_0x8d5e('0x0')](_0x8d5e('0x1'),_0x8d5e('0x2'),_0x8d5e('0x3'),_0x8d5e('0x4'),'picklist'),'defaultValue':_0x8d5e('0x1')},'content':{'type':Sequelize['STRING']},'key':{'type':Sequelize[_0x8d5e('0x5')]},'keyType':{'type':Sequelize['ENUM'](_0x8d5e('0x1'),'variable',_0x8d5e('0x3'))},'keyContent':{'type':Sequelize[_0x8d5e('0x5')]},'idField':{'type':Sequelize[_0x8d5e('0x5')]},'nameField':{'type':Sequelize[_0x8d5e('0x5')]},'customField':{'type':Sequelize[_0x8d5e('0x6')],'defaultValue':!![]},'variableName':{'type':Sequelize[_0x8d5e('0x5')]}}; \ No newline at end of file diff --git a/server/api/intFreshsalesField/intFreshsalesField.controller.js b/server/api/intFreshsalesField/intFreshsalesField.controller.js index 37c9f88..fdc8674 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 _0x8aef=['../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','undefined','count','offset','limit','set','apply','save','update','destroy','then','error','name','send','fieldName','map','query','keys','attributes','intersection','model','fields','hasOwnProperty','nolimit','sort','where','filters','pick','filter','merge','type','VIRTUAL','FreshsalesField','includeAll','include','findAll','rows','params','rawAttributes','length','options','find','create','body','catch','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','sox','ejs','lodash','squel','crypto','desk.js','to-csv','querystring','papaparse','ioredis','../../components/auth/service'];(function(_0xdea1ee,_0x2d2841){var _0x96c530=function(_0x4e743b){while(--_0x4e743b){_0xdea1ee['push'](_0xdea1ee['shift']());}};_0x96c530(++_0x2d2841);}(_0x8aef,0x1e0));var _0xf8ae=function(_0x2fc012,_0x503e5b){_0x2fc012=_0x2fc012-0x0;var _0x2891f9=_0x8aef[_0x2fc012];return _0x2891f9;};'use strict';var emlformat=require(_0xf8ae('0x0'));var rimraf=require(_0xf8ae('0x1'));var zipdir=require(_0xf8ae('0x2'));var jsonpatch=require(_0xf8ae('0x3'));var rp=require(_0xf8ae('0x4'));var moment=require('moment');var BPromise=require(_0xf8ae('0x5'));var Mustache=require('mustache');var util=require('util');var path=require('path');var sox=require(_0xf8ae('0x6'));var csv=require('to-csv');var ejs=require(_0xf8ae('0x7'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xf8ae('0x8'));var squel=require(_0xf8ae('0x9'));var crypto=require(_0xf8ae('0xa'));var jsforce=require('jsforce');var deskjs=require(_0xf8ae('0xb'));var toCsv=require(_0xf8ae('0xc'));var querystring=require(_0xf8ae('0xd'));var Papa=require(_0xf8ae('0xe'));var Redis=require(_0xf8ae('0xf'));var authService=require(_0xf8ae('0x10'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0xf8ae('0x11'))(_0xf8ae('0x12'));var utils=require(_0xf8ae('0x13'));var config=require(_0xf8ae('0x14'));var licenseUtil=require(_0xf8ae('0x15'));var db=require(_0xf8ae('0x16'))['db'];function respondWithStatusCode(_0x35eb1d,_0x5d8498){_0x5d8498=_0x5d8498||0xcc;return function(_0x530e66){if(_0x530e66){return _0x35eb1d[_0xf8ae('0x17')](_0x5d8498);}return _0x35eb1d[_0xf8ae('0x18')](_0x5d8498)[_0xf8ae('0x19')]();};}function respondWithResult(_0x4f0658,_0x405db6){_0x405db6=_0x405db6||0xc8;return function(_0x51a0d2){if(_0x51a0d2){return _0x4f0658['status'](_0x405db6)[_0xf8ae('0x1a')](_0x51a0d2);}};}function respondWithFilteredResult(_0x48161f,_0x35a77f){return function(_0x15390b){if(_0x15390b){var _0x103d6e=typeof _0x35a77f['offset']==='undefined'&&typeof _0x35a77f['limit']===_0xf8ae('0x1b');var _0xd92397=_0x15390b[_0xf8ae('0x1c')];var _0x5dc3c5=_0x103d6e?0x0:_0x35a77f[_0xf8ae('0x1d')];var _0xa6b0a5=_0x103d6e?_0x15390b[_0xf8ae('0x1c')]:_0x35a77f[_0xf8ae('0x1d')]+_0x35a77f[_0xf8ae('0x1e')];var _0x531bfb;if(_0xa6b0a5>=_0xd92397){_0xa6b0a5=_0xd92397;_0x531bfb=0xc8;}else{_0x531bfb=0xce;}_0x48161f[_0xf8ae('0x18')](_0x531bfb);return _0x48161f[_0xf8ae('0x1f')]('Content-Range',_0x5dc3c5+'-'+_0xa6b0a5+'/'+_0xd92397)[_0xf8ae('0x1a')](_0x15390b);}return null;};}function patchUpdates(_0x5bc224){return function(_0x4736db){try{jsonpatch[_0xf8ae('0x20')](_0x4736db,_0x5bc224,!![]);}catch(_0x1c6137){return BPromise['reject'](_0x1c6137);}return _0x4736db[_0xf8ae('0x21')]();};}function saveUpdates(_0x19ffe2,_0x25b261){return function(_0x11dbfb){if(_0x11dbfb){return _0x11dbfb[_0xf8ae('0x22')](_0x19ffe2)['then'](function(_0x1755f0){return _0x1755f0;});}return null;};}function removeEntity(_0x4d3827,_0x4e1503){return function(_0x574ffc){if(_0x574ffc){return _0x574ffc[_0xf8ae('0x23')]()[_0xf8ae('0x24')](function(){_0x4d3827['status'](0xcc)[_0xf8ae('0x19')]();});}};}function handleEntityNotFound(_0x4b9871,_0x328c11){return function(_0x5b3d82){if(!_0x5b3d82){_0x4b9871[_0xf8ae('0x17')](0x194);}return _0x5b3d82;};}function handleError(_0xd3be79,_0x12a4e7){_0x12a4e7=_0x12a4e7||0x1f4;return function(_0x5788ae){logger[_0xf8ae('0x25')](_0x5788ae['stack']);if(_0x5788ae[_0xf8ae('0x26')]){delete _0x5788ae[_0xf8ae('0x26')];}_0xd3be79[_0xf8ae('0x18')](_0x12a4e7)[_0xf8ae('0x27')](_0x5788ae);};}exports['index']=function(_0x4e6491,_0x2f732d){var _0x22d000={},_0x4bf56d={},_0x2fbec0={'count':0x0,'rows':[]};var _0x53717b=_['map'](db['FreshsalesField']['rawAttributes'],function(_0x9bd38b){return{'name':_0x9bd38b[_0xf8ae('0x28')],'type':_0x9bd38b['type']['key']};});_0x4bf56d['model']=_[_0xf8ae('0x29')](_0x53717b,_0xf8ae('0x26'));_0x4bf56d[_0xf8ae('0x2a')]=_[_0xf8ae('0x2b')](_0x4e6491[_0xf8ae('0x2a')]);_0x4bf56d['filters']=_['intersection'](_0x4bf56d['model'],_0x4bf56d[_0xf8ae('0x2a')]);_0x22d000[_0xf8ae('0x2c')]=_[_0xf8ae('0x2d')](_0x4bf56d[_0xf8ae('0x2e')],qs[_0xf8ae('0x2f')](_0x4e6491[_0xf8ae('0x2a')][_0xf8ae('0x2f')]));_0x22d000[_0xf8ae('0x2c')]=_0x22d000[_0xf8ae('0x2c')]['length']?_0x22d000[_0xf8ae('0x2c')]:_0x4bf56d['model'];if(!_0x4e6491[_0xf8ae('0x2a')][_0xf8ae('0x30')](_0xf8ae('0x31'))){_0x22d000[_0xf8ae('0x1e')]=qs[_0xf8ae('0x1e')](_0x4e6491[_0xf8ae('0x2a')][_0xf8ae('0x1e')]);_0x22d000[_0xf8ae('0x1d')]=qs[_0xf8ae('0x1d')](_0x4e6491[_0xf8ae('0x2a')][_0xf8ae('0x1d')]);}_0x22d000['order']=qs[_0xf8ae('0x32')](_0x4e6491[_0xf8ae('0x2a')][_0xf8ae('0x32')]);_0x22d000[_0xf8ae('0x33')]=qs[_0xf8ae('0x34')](_[_0xf8ae('0x35')](_0x4e6491['query'],_0x4bf56d[_0xf8ae('0x34')]),_0x53717b);if(_0x4e6491[_0xf8ae('0x2a')][_0xf8ae('0x36')]){_0x22d000['where']=_[_0xf8ae('0x37')](_0x22d000[_0xf8ae('0x33')],{'$or':_['map'](_0x53717b,function(_0x37e18a){if(_0x37e18a[_0xf8ae('0x38')]!==_0xf8ae('0x39')){var _0x9f7a98={};_0x9f7a98[_0x37e18a[_0xf8ae('0x26')]]={'$like':'%'+_0x4e6491['query'][_0xf8ae('0x36')]+'%'};return _0x9f7a98;}})});}_0x22d000=_[_0xf8ae('0x37')]({},_0x22d000,_0x4e6491['options']);var _0x5c0ffb={'where':_0x22d000[_0xf8ae('0x33')]};return db[_0xf8ae('0x3a')]['count'](_0x5c0ffb)[_0xf8ae('0x24')](function(_0x3ca28e){_0x2fbec0[_0xf8ae('0x1c')]=_0x3ca28e;if(_0x4e6491[_0xf8ae('0x2a')][_0xf8ae('0x3b')]){_0x22d000[_0xf8ae('0x3c')]=[{'all':!![]}];}return db[_0xf8ae('0x3a')][_0xf8ae('0x3d')](_0x22d000);})[_0xf8ae('0x24')](function(_0x39731f){_0x2fbec0[_0xf8ae('0x3e')]=_0x39731f;return _0x2fbec0;})[_0xf8ae('0x24')](respondWithFilteredResult(_0x2f732d,_0x22d000))['catch'](handleError(_0x2f732d,null));};exports['show']=function(_0xdfbbe2,_0x4b7f95){var _0x5cd628={'raw':!![],'where':{'id':_0xdfbbe2[_0xf8ae('0x3f')]['id']}},_0x5ad7fb={};_0x5ad7fb[_0xf8ae('0x2e')]=_['keys'](db['FreshsalesField'][_0xf8ae('0x40')]);_0x5ad7fb['query']=_['keys'](_0xdfbbe2[_0xf8ae('0x2a')]);_0x5ad7fb[_0xf8ae('0x34')]=_['intersection'](_0x5ad7fb['model'],_0x5ad7fb[_0xf8ae('0x2a')]);_0x5cd628[_0xf8ae('0x2c')]=_['intersection'](_0x5ad7fb[_0xf8ae('0x2e')],qs['fields'](_0xdfbbe2[_0xf8ae('0x2a')]['fields']));_0x5cd628['attributes']=_0x5cd628['attributes'][_0xf8ae('0x41')]?_0x5cd628[_0xf8ae('0x2c')]:_0x5ad7fb[_0xf8ae('0x2e')];if(_0xdfbbe2[_0xf8ae('0x2a')]['includeAll']){_0x5cd628[_0xf8ae('0x3c')]=[{'all':!![]}];}_0x5cd628=_[_0xf8ae('0x37')]({},_0x5cd628,_0xdfbbe2[_0xf8ae('0x42')]);return db[_0xf8ae('0x3a')][_0xf8ae('0x43')](_0x5cd628)[_0xf8ae('0x24')](handleEntityNotFound(_0x4b7f95,null))[_0xf8ae('0x24')](respondWithResult(_0x4b7f95,null))['catch'](handleError(_0x4b7f95,null));};exports[_0xf8ae('0x44')]=function(_0x204fdd,_0x2d9c58){return db[_0xf8ae('0x3a')][_0xf8ae('0x44')](_0x204fdd[_0xf8ae('0x45')],{})[_0xf8ae('0x24')](respondWithResult(_0x2d9c58,0xc9))[_0xf8ae('0x46')](handleError(_0x2d9c58,null));};exports[_0xf8ae('0x22')]=function(_0x91e565,_0x2cb075){if(_0x91e565[_0xf8ae('0x45')]['id']){delete _0x91e565[_0xf8ae('0x45')]['id'];}return db[_0xf8ae('0x3a')][_0xf8ae('0x43')]({'where':{'id':_0x91e565['params']['id']}})[_0xf8ae('0x24')](handleEntityNotFound(_0x2cb075,null))[_0xf8ae('0x24')](saveUpdates(_0x91e565[_0xf8ae('0x45')],null))[_0xf8ae('0x24')](respondWithResult(_0x2cb075,null))['catch'](handleError(_0x2cb075,null));};exports[_0xf8ae('0x23')]=function(_0x39c53b,_0x3c1fb2){return db['FreshsalesField'][_0xf8ae('0x43')]({'where':{'id':_0x39c53b['params']['id']}})[_0xf8ae('0x24')](handleEntityNotFound(_0x3c1fb2,null))[_0xf8ae('0x24')](removeEntity(_0x3c1fb2,null))['catch'](handleError(_0x3c1fb2,null));}; \ No newline at end of file +var _0x0ccb=['options','rows','show','params','includeAll','include','find','catch','create','body','rimraf','zip-dir','request-promise','moment','bluebird','path','sox','ejs','fs-extra','lodash','crypto','jsforce','desk.js','to-csv','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','status','end','json','offset','count','limit','set','apply','reject','update','then','destroy','sendStatus','error','name','index','map','FreshsalesField','rawAttributes','type','query','keys','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','sort','where','filters','pick','filter','merge','VIRTUAL'];(function(_0x5774be,_0x2259d3){var _0x4914b4=function(_0x1eebc3){while(--_0x1eebc3){_0x5774be['push'](_0x5774be['shift']());}};_0x4914b4(++_0x2259d3);}(_0x0ccb,0x1a8));var _0xb0cc=function(_0x40511c,_0xf8a4d9){_0x40511c=_0x40511c-0x0;var _0x817c2c=_0x0ccb[_0x40511c];return _0x817c2c;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xb0cc('0x0'));var zipdir=require(_0xb0cc('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0xb0cc('0x2'));var moment=require(_0xb0cc('0x3'));var BPromise=require(_0xb0cc('0x4'));var Mustache=require('mustache');var util=require('util');var path=require(_0xb0cc('0x5'));var sox=require(_0xb0cc('0x6'));var csv=require('to-csv');var ejs=require(_0xb0cc('0x7'));var fs=require('fs');var fs_extra=require(_0xb0cc('0x8'));var _=require(_0xb0cc('0x9'));var squel=require('squel');var crypto=require(_0xb0cc('0xa'));var jsforce=require(_0xb0cc('0xb'));var deskjs=require(_0xb0cc('0xc'));var toCsv=require(_0xb0cc('0xd'));var querystring=require(_0xb0cc('0xe'));var Papa=require('papaparse');var Redis=require(_0xb0cc('0xf'));var authService=require(_0xb0cc('0x10'));var qs=require(_0xb0cc('0x11'));var as=require(_0xb0cc('0x12'));var hardwareService=require(_0xb0cc('0x13'));var logger=require(_0xb0cc('0x14'))(_0xb0cc('0x15'));var utils=require(_0xb0cc('0x16'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x2d58fb,_0x118e05){_0x118e05=_0x118e05||0xcc;return function(_0x386333){if(_0x386333){return _0x2d58fb['sendStatus'](_0x118e05);}return _0x2d58fb[_0xb0cc('0x17')](_0x118e05)[_0xb0cc('0x18')]();};}function respondWithResult(_0x16b407,_0xdd4df6){_0xdd4df6=_0xdd4df6||0xc8;return function(_0x54d0ce){if(_0x54d0ce){return _0x16b407[_0xb0cc('0x17')](_0xdd4df6)[_0xb0cc('0x19')](_0x54d0ce);}};}function respondWithFilteredResult(_0x3e2bb1,_0x38a4e5){return function(_0x402e8a){if(_0x402e8a){var _0x112aa6=typeof _0x38a4e5[_0xb0cc('0x1a')]==='undefined'&&typeof _0x38a4e5['limit']==='undefined';var _0x12e2b6=_0x402e8a[_0xb0cc('0x1b')];var _0x24eef8=_0x112aa6?0x0:_0x38a4e5[_0xb0cc('0x1a')];var _0x455c0c=_0x112aa6?_0x402e8a[_0xb0cc('0x1b')]:_0x38a4e5[_0xb0cc('0x1a')]+_0x38a4e5[_0xb0cc('0x1c')];var _0xf84b75;if(_0x455c0c>=_0x12e2b6){_0x455c0c=_0x12e2b6;_0xf84b75=0xc8;}else{_0xf84b75=0xce;}_0x3e2bb1[_0xb0cc('0x17')](_0xf84b75);return _0x3e2bb1[_0xb0cc('0x1d')]('Content-Range',_0x24eef8+'-'+_0x455c0c+'/'+_0x12e2b6)['json'](_0x402e8a);}return null;};}function patchUpdates(_0x31b9f8){return function(_0x21fe16){try{jsonpatch[_0xb0cc('0x1e')](_0x21fe16,_0x31b9f8,!![]);}catch(_0x3eb530){return BPromise[_0xb0cc('0x1f')](_0x3eb530);}return _0x21fe16['save']();};}function saveUpdates(_0x3ce5a0,_0x849be9){return function(_0x176327){if(_0x176327){return _0x176327[_0xb0cc('0x20')](_0x3ce5a0)[_0xb0cc('0x21')](function(_0x4b734d){return _0x4b734d;});}return null;};}function removeEntity(_0x121dd8,_0x40f756){return function(_0x52cd41){if(_0x52cd41){return _0x52cd41[_0xb0cc('0x22')]()[_0xb0cc('0x21')](function(){_0x121dd8[_0xb0cc('0x17')](0xcc)[_0xb0cc('0x18')]();});}};}function handleEntityNotFound(_0x43c635,_0x3e09ff){return function(_0x11ff2a){if(!_0x11ff2a){_0x43c635[_0xb0cc('0x23')](0x194);}return _0x11ff2a;};}function handleError(_0x508ad8,_0x1a8949){_0x1a8949=_0x1a8949||0x1f4;return function(_0x98e306){logger[_0xb0cc('0x24')](_0x98e306['stack']);if(_0x98e306[_0xb0cc('0x25')]){delete _0x98e306[_0xb0cc('0x25')];}_0x508ad8['status'](_0x1a8949)['send'](_0x98e306);};}exports[_0xb0cc('0x26')]=function(_0x2a6b3e,_0x5f509b){var _0x3e7be9={},_0x41ab33={},_0x2cfb8c={'count':0x0,'rows':[]};var _0x418cff=_[_0xb0cc('0x27')](db[_0xb0cc('0x28')][_0xb0cc('0x29')],function(_0x7543cb){return{'name':_0x7543cb['fieldName'],'type':_0x7543cb[_0xb0cc('0x2a')]['key']};});_0x41ab33['model']=_['map'](_0x418cff,_0xb0cc('0x25'));_0x41ab33[_0xb0cc('0x2b')]=_[_0xb0cc('0x2c')](_0x2a6b3e[_0xb0cc('0x2b')]);_0x41ab33['filters']=_[_0xb0cc('0x2d')](_0x41ab33[_0xb0cc('0x2e')],_0x41ab33[_0xb0cc('0x2b')]);_0x3e7be9[_0xb0cc('0x2f')]=_[_0xb0cc('0x2d')](_0x41ab33[_0xb0cc('0x2e')],qs[_0xb0cc('0x30')](_0x2a6b3e['query'][_0xb0cc('0x30')]));_0x3e7be9[_0xb0cc('0x2f')]=_0x3e7be9[_0xb0cc('0x2f')][_0xb0cc('0x31')]?_0x3e7be9['attributes']:_0x41ab33[_0xb0cc('0x2e')];if(!_0x2a6b3e[_0xb0cc('0x2b')][_0xb0cc('0x32')](_0xb0cc('0x33'))){_0x3e7be9[_0xb0cc('0x1c')]=qs['limit'](_0x2a6b3e[_0xb0cc('0x2b')][_0xb0cc('0x1c')]);_0x3e7be9[_0xb0cc('0x1a')]=qs[_0xb0cc('0x1a')](_0x2a6b3e['query'][_0xb0cc('0x1a')]);}_0x3e7be9['order']=qs[_0xb0cc('0x34')](_0x2a6b3e[_0xb0cc('0x2b')][_0xb0cc('0x34')]);_0x3e7be9[_0xb0cc('0x35')]=qs[_0xb0cc('0x36')](_[_0xb0cc('0x37')](_0x2a6b3e[_0xb0cc('0x2b')],_0x41ab33[_0xb0cc('0x36')]),_0x418cff);if(_0x2a6b3e[_0xb0cc('0x2b')][_0xb0cc('0x38')]){_0x3e7be9[_0xb0cc('0x35')]=_[_0xb0cc('0x39')](_0x3e7be9[_0xb0cc('0x35')],{'$or':_[_0xb0cc('0x27')](_0x418cff,function(_0x51fe78){if(_0x51fe78[_0xb0cc('0x2a')]!==_0xb0cc('0x3a')){var _0x1cd406={};_0x1cd406[_0x51fe78[_0xb0cc('0x25')]]={'$like':'%'+_0x2a6b3e[_0xb0cc('0x2b')]['filter']+'%'};return _0x1cd406;}})});}_0x3e7be9=_[_0xb0cc('0x39')]({},_0x3e7be9,_0x2a6b3e[_0xb0cc('0x3b')]);var _0x3878fa={'where':_0x3e7be9[_0xb0cc('0x35')]};return db[_0xb0cc('0x28')][_0xb0cc('0x1b')](_0x3878fa)[_0xb0cc('0x21')](function(_0x4fa1c1){_0x2cfb8c[_0xb0cc('0x1b')]=_0x4fa1c1;if(_0x2a6b3e[_0xb0cc('0x2b')]['includeAll']){_0x3e7be9['include']=[{'all':!![]}];}return db['FreshsalesField']['findAll'](_0x3e7be9);})['then'](function(_0x34761d){_0x2cfb8c[_0xb0cc('0x3c')]=_0x34761d;return _0x2cfb8c;})['then'](respondWithFilteredResult(_0x5f509b,_0x3e7be9))['catch'](handleError(_0x5f509b,null));};exports[_0xb0cc('0x3d')]=function(_0x16da68,_0x2f8bf8){var _0x2ab9c={'raw':!![],'where':{'id':_0x16da68[_0xb0cc('0x3e')]['id']}},_0x5aec96={};_0x5aec96[_0xb0cc('0x2e')]=_['keys'](db[_0xb0cc('0x28')]['rawAttributes']);_0x5aec96[_0xb0cc('0x2b')]=_['keys'](_0x16da68[_0xb0cc('0x2b')]);_0x5aec96[_0xb0cc('0x36')]=_[_0xb0cc('0x2d')](_0x5aec96[_0xb0cc('0x2e')],_0x5aec96[_0xb0cc('0x2b')]);_0x2ab9c[_0xb0cc('0x2f')]=_[_0xb0cc('0x2d')](_0x5aec96[_0xb0cc('0x2e')],qs[_0xb0cc('0x30')](_0x16da68['query'][_0xb0cc('0x30')]));_0x2ab9c['attributes']=_0x2ab9c['attributes']['length']?_0x2ab9c['attributes']:_0x5aec96[_0xb0cc('0x2e')];if(_0x16da68[_0xb0cc('0x2b')][_0xb0cc('0x3f')]){_0x2ab9c[_0xb0cc('0x40')]=[{'all':!![]}];}_0x2ab9c=_[_0xb0cc('0x39')]({},_0x2ab9c,_0x16da68[_0xb0cc('0x3b')]);return db[_0xb0cc('0x28')][_0xb0cc('0x41')](_0x2ab9c)[_0xb0cc('0x21')](handleEntityNotFound(_0x2f8bf8,null))[_0xb0cc('0x21')](respondWithResult(_0x2f8bf8,null))[_0xb0cc('0x42')](handleError(_0x2f8bf8,null));};exports['create']=function(_0x38ab72,_0x274d88){return db[_0xb0cc('0x28')][_0xb0cc('0x43')](_0x38ab72[_0xb0cc('0x44')],{})[_0xb0cc('0x21')](respondWithResult(_0x274d88,0xc9))[_0xb0cc('0x42')](handleError(_0x274d88,null));};exports[_0xb0cc('0x20')]=function(_0x2711bc,_0xf913cd){if(_0x2711bc[_0xb0cc('0x44')]['id']){delete _0x2711bc[_0xb0cc('0x44')]['id'];}return db[_0xb0cc('0x28')][_0xb0cc('0x41')]({'where':{'id':_0x2711bc[_0xb0cc('0x3e')]['id']}})[_0xb0cc('0x21')](handleEntityNotFound(_0xf913cd,null))[_0xb0cc('0x21')](saveUpdates(_0x2711bc[_0xb0cc('0x44')],null))[_0xb0cc('0x21')](respondWithResult(_0xf913cd,null))[_0xb0cc('0x42')](handleError(_0xf913cd,null));};exports[_0xb0cc('0x22')]=function(_0xd2f706,_0x32804c){return db['FreshsalesField'][_0xb0cc('0x41')]({'where':{'id':_0xd2f706[_0xb0cc('0x3e')]['id']}})['then'](handleEntityNotFound(_0x32804c,null))[_0xb0cc('0x21')](removeEntity(_0x32804c,null))[_0xb0cc('0x42')](handleError(_0x32804c,null));}; \ No newline at end of file diff --git a/server/api/intFreshsalesField/intFreshsalesField.model.js b/server/api/intFreshsalesField/intFreshsalesField.model.js index e310846..99408a8 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 _0x1678=['int_freshsales_fields','freshsales_unique_index','lodash','util','../../config/logger','api','moment','path','rimraf','../../config/environment','./intFreshsalesField.attributes','exports','FreshsalesField'];(function(_0x164eca,_0x555e28){var _0x2ce562=function(_0x148ca6){while(--_0x148ca6){_0x164eca['push'](_0x164eca['shift']());}};_0x2ce562(++_0x555e28);}(_0x1678,0x17b));var _0x8167=function(_0x3fa008,_0x3fb7fc){_0x3fa008=_0x3fa008-0x0;var _0x367efd=_0x1678[_0x3fa008];return _0x367efd;};'use strict';var _=require(_0x8167('0x0'));var util=require(_0x8167('0x1'));var logger=require(_0x8167('0x2'))(_0x8167('0x3'));var moment=require(_0x8167('0x4'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0x8167('0x5'));var rimraf=require(_0x8167('0x6'));var config=require(_0x8167('0x7'));var attributes=require(_0x8167('0x8'));module[_0x8167('0x9')]=function(_0xa9fd75,_0x30f248){return _0xa9fd75['define'](_0x8167('0xa'),attributes,{'tableName':_0x8167('0xb'),'paranoid':![],'indexes':[{'name':_0x8167('0xc'),'fields':['idField','FieldId'],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file +var _0x9e6b=['../../config/environment','exports','FreshsalesField','FieldId','lodash','util','api','request-promise','path','rimraf'];(function(_0x34d8f8,_0x5eef65){var _0x437155=function(_0x285e58){while(--_0x285e58){_0x34d8f8['push'](_0x34d8f8['shift']());}};_0x437155(++_0x5eef65);}(_0x9e6b,0x11c));var _0xb9e6=function(_0x42cae2,_0x284ef8){_0x42cae2=_0x42cae2-0x0;var _0x5f256f=_0x9e6b[_0x42cae2];return _0x5f256f;};'use strict';var _=require(_0xb9e6('0x0'));var util=require(_0xb9e6('0x1'));var logger=require('../../config/logger')(_0xb9e6('0x2'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0xb9e6('0x3'));var fs=require('fs');var path=require(_0xb9e6('0x4'));var rimraf=require(_0xb9e6('0x5'));var config=require(_0xb9e6('0x6'));var attributes=require('./intFreshsalesField.attributes');module[_0xb9e6('0x7')]=function(_0x1a6a4f,_0x1b9eed){return _0x1a6a4f['define'](_0xb9e6('0x8'),attributes,{'tableName':'int_freshsales_fields','paranoid':![],'indexes':[{'name':'freshsales_unique_index','fields':['idField',_0xb9e6('0x9')],'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 47906a6..01a6d48 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 _0xe2fe=['then','info','FreshsalesField,\x20%s,\x20%s','stringify','error','message','request\x20sent','result','lodash','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','request'];(function(_0x2f6641,_0x258c00){var _0x103625=function(_0x204573){while(--_0x204573){_0x2f6641['push'](_0x2f6641['shift']());}};_0x103625(++_0x258c00);}(_0xe2fe,0x86));var _0xee2f=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xe2fe[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0xee2f('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0xee2f('0x1'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xee2f('0x2'));var db=require(_0xee2f('0x3'))['db'];var utils=require(_0xee2f('0x4'));var logger=require(_0xee2f('0x5'))(_0xee2f('0x6'));var config=require('../../config/environment');var jayson=require(_0xee2f('0x7'));var client=jayson[_0xee2f('0x8')]['http']({'port':0x232a});function respondWithRpcPromise(_0x1533a0,_0x2e1c8c,_0x5a7975){return new BPromise(function(_0x3c4095,_0x5ea796){return client[_0xee2f('0x9')](_0x1533a0,_0x5a7975)[_0xee2f('0xa')](function(_0x53f7dd){logger[_0xee2f('0xb')](_0xee2f('0xc'),_0x2e1c8c,'request\x20sent');logger['debug']('FreshsalesField,\x20%s,\x20%s,\x20%s',_0x2e1c8c,'request\x20sent',JSON[_0xee2f('0xd')](_0x53f7dd));if(_0x53f7dd['error']){if(_0x53f7dd['error']['code']===0x1f4){logger[_0xee2f('0xe')](_0xee2f('0xc'),_0x2e1c8c,_0x53f7dd[_0xee2f('0xe')][_0xee2f('0xf')]);return _0x5ea796(_0x53f7dd[_0xee2f('0xe')][_0xee2f('0xf')]);}logger['error'](_0xee2f('0xc'),_0x2e1c8c,_0x53f7dd['error'][_0xee2f('0xf')]);return _0x3c4095(_0x53f7dd[_0xee2f('0xe')]['message']);}else{logger[_0xee2f('0xb')](_0xee2f('0xc'),_0x2e1c8c,_0xee2f('0x10'));_0x3c4095(_0x53f7dd[_0xee2f('0x11')][_0xee2f('0xf')]);}})['catch'](function(_0x3f6372){logger['error'](_0xee2f('0xc'),_0x2e1c8c,_0x3f6372);_0x5ea796(_0x3f6372);});});} \ No newline at end of file +var _0xba34=['../../config/environment','jayson/promise','client','http','request','then','info','FreshsalesField,\x20%s,\x20%s','request\x20sent','debug','FreshsalesField,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','lodash','util','moment','bluebird','randomstring','../../config/logger','rpc'];(function(_0x3afbbf,_0x1b42f2){var _0x8309f3=function(_0x567126){while(--_0x567126){_0x3afbbf['push'](_0x3afbbf['shift']());}};_0x8309f3(++_0x1b42f2);}(_0xba34,0x119));var _0x4ba3=function(_0x235672,_0x560f51){_0x235672=_0x235672-0x0;var _0x354674=_0xba34[_0x235672];return _0x354674;};'use strict';var _=require(_0x4ba3('0x0'));var util=require(_0x4ba3('0x1'));var moment=require(_0x4ba3('0x2'));var BPromise=require(_0x4ba3('0x3'));var rs=require(_0x4ba3('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0x4ba3('0x5'))(_0x4ba3('0x6'));var config=require(_0x4ba3('0x7'));var jayson=require(_0x4ba3('0x8'));var client=jayson[_0x4ba3('0x9')][_0x4ba3('0xa')]({'port':0x232a});function respondWithRpcPromise(_0xe5f99a,_0x585f2d,_0x6254fb){return new BPromise(function(_0x368eee,_0x2df7f3){return client[_0x4ba3('0xb')](_0xe5f99a,_0x6254fb)[_0x4ba3('0xc')](function(_0xcf1ec3){logger[_0x4ba3('0xd')](_0x4ba3('0xe'),_0x585f2d,_0x4ba3('0xf'));logger[_0x4ba3('0x10')](_0x4ba3('0x11'),_0x585f2d,'request\x20sent',JSON[_0x4ba3('0x12')](_0xcf1ec3));if(_0xcf1ec3[_0x4ba3('0x13')]){if(_0xcf1ec3['error'][_0x4ba3('0x14')]===0x1f4){logger['error'](_0x4ba3('0xe'),_0x585f2d,_0xcf1ec3['error'][_0x4ba3('0x15')]);return _0x2df7f3(_0xcf1ec3[_0x4ba3('0x13')][_0x4ba3('0x15')]);}logger[_0x4ba3('0x13')](_0x4ba3('0xe'),_0x585f2d,_0xcf1ec3[_0x4ba3('0x13')][_0x4ba3('0x15')]);return _0x368eee(_0xcf1ec3[_0x4ba3('0x13')][_0x4ba3('0x15')]);}else{logger[_0x4ba3('0xd')](_0x4ba3('0xe'),_0x585f2d,_0x4ba3('0xf'));_0x368eee(_0xcf1ec3[_0x4ba3('0x16')][_0x4ba3('0x15')]);}})[_0x4ba3('0x17')](function(_0x1b7776){logger['error'](_0x4ba3('0xe'),_0x585f2d,_0x1b7776);_0x2df7f3(_0x1b7776);});});} \ No newline at end of file diff --git a/server/api/intSalesforceAccount/index.js b/server/api/intSalesforceAccount/index.js index d560b57..698c762 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(_0x5818c8,_0xbdfd48){var _0x219ce5=function(_0x10157c){while(--_0x10157c){_0x5818c8['push'](_0x5818c8['shift']());}};_0x219ce5(++_0xbdfd48);}(_0xa9e0,0x123));var _0x0a9e=function(_0x4243a3,_0x447337){_0x4243a3=_0x4243a3-0x0;var _0x1b2a33=_0xa9e0[_0x4243a3];return _0x1b2a33;};'use strict';var multer=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var path=require(_0x0a9e('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x0a9e('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x0a9e('0x4'));var interaction=require(_0x0a9e('0x5'));var config=require(_0x0a9e('0x6'));var controller=require(_0x0a9e('0x7'));router[_0x0a9e('0x8')]('/',auth['isAuthenticated'](),controller[_0x0a9e('0x9')]);router[_0x0a9e('0x8')](_0x0a9e('0xa'),auth['isAuthenticated'](),controller['show']);router[_0x0a9e('0x8')]('/:id/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(_0x3de9bf,_0xdd9855){var _0x3e9e1b=function(_0xebd2ac){while(--_0xebd2ac){_0x3de9bf['push'](_0x3de9bf['shift']());}};_0x3e9e1b(++_0xdd9855);}(_0x9957,0x93));var _0x7995=function(_0x1ac595,_0x5d2081){_0x1ac595=_0x1ac595-0x0;var _0x455fff=_0x9957[_0x1ac595];return _0x455fff;};'use strict';var multer=require(_0x7995('0x0'));var util=require(_0x7995('0x1'));var path=require(_0x7995('0x2'));var timeout=require(_0x7995('0x3'));var express=require('express');var router=express[_0x7995('0x4')]();var fs_extra=require(_0x7995('0x5'));var auth=require(_0x7995('0x6'));var interaction=require(_0x7995('0x7'));var config=require('../../config/environment');var controller=require(_0x7995('0x8'));router[_0x7995('0x9')]('/',auth[_0x7995('0xa')](),controller[_0x7995('0xb')]);router[_0x7995('0x9')](_0x7995('0xc'),auth['isAuthenticated'](),controller[_0x7995('0xd')]);router[_0x7995('0x9')]('/:id/configurations',auth[_0x7995('0xa')](),controller[_0x7995('0xe')]);router[_0x7995('0x9')](_0x7995('0xf'),auth[_0x7995('0xa')](),controller[_0x7995('0x10')]);router[_0x7995('0x11')]('/',auth['isAuthenticated'](),controller[_0x7995('0x12')]);router[_0x7995('0x11')]('/:id/configurations',auth[_0x7995('0xa')](),controller[_0x7995('0x13')]);router[_0x7995('0x14')](_0x7995('0xc'),auth[_0x7995('0xa')](),controller[_0x7995('0x15')]);router[_0x7995('0x16')]('/:id',auth['isAuthenticated'](),controller[_0x7995('0x17')]);module[_0x7995('0x18')]=router; \ No newline at end of file diff --git a/server/api/intSalesforceAccount/intSalesforceAccount.attributes.js b/server/api/intSalesforceAccount/intSalesforceAccount.attributes.js index d76c0fb..e13e3a1 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 _0x9962=['STRING','ENUM','newTab','integrationTab','sequelize'];(function(_0x3c910d,_0x3b5566){var _0x4927fa=function(_0xc98564){while(--_0xc98564){_0x3c910d['push'](_0x3c910d['shift']());}};_0x4927fa(++_0x3b5566);}(_0x9962,0xb8));var _0x2996=function(_0x9e782f,_0x3213e0){_0x9e782f=_0x9e782f-0x0;var _0x2bc4a8=_0x9962[_0x9e782f];return _0x2bc4a8;};'use strict';var Sequelize=require(_0x2996('0x0'));module['exports']={'name':{'type':Sequelize[_0x2996('0x1')]},'description':{'type':Sequelize[_0x2996('0x1')]},'username':{'type':Sequelize[_0x2996('0x1')],'unique':'username'},'remoteUri':{'type':Sequelize[_0x2996('0x1')]},'password':{'type':Sequelize['STRING']},'clientId':{'type':Sequelize[_0x2996('0x1')]},'clientSecret':{'type':Sequelize[_0x2996('0x1')]},'securityToken':{'type':Sequelize['STRING']},'serverUrl':{'type':Sequelize[_0x2996('0x1')],'allowNull':![]},'type':{'type':Sequelize[_0x2996('0x2')]('integrationTab',_0x2996('0x3')),'defaultValue':_0x2996('0x4')}}; \ No newline at end of file +var _0x8be3=['STRING','username','integrationTab','newTab','exports'];(function(_0x4cf98e,_0xba4b79){var _0x1623ac=function(_0x459bc0){while(--_0x459bc0){_0x4cf98e['push'](_0x4cf98e['shift']());}};_0x1623ac(++_0xba4b79);}(_0x8be3,0xd1));var _0x38be=function(_0x403967,_0x3d7b8d){_0x403967=_0x403967-0x0;var _0x5df22d=_0x8be3[_0x403967];return _0x5df22d;};'use strict';var Sequelize=require('sequelize');module[_0x38be('0x0')]={'name':{'type':Sequelize[_0x38be('0x1')]},'description':{'type':Sequelize[_0x38be('0x1')]},'username':{'type':Sequelize['STRING'],'unique':_0x38be('0x2')},'remoteUri':{'type':Sequelize['STRING']},'password':{'type':Sequelize[_0x38be('0x1')]},'clientId':{'type':Sequelize[_0x38be('0x1')]},'clientSecret':{'type':Sequelize[_0x38be('0x1')]},'securityToken':{'type':Sequelize[_0x38be('0x1')]},'serverUrl':{'type':Sequelize[_0x38be('0x1')],'allowNull':![]},'type':{'type':Sequelize['ENUM'](_0x38be('0x3'),_0x38be('0x4')),'defaultValue':_0x38be('0x3')}}; \ No newline at end of file diff --git a/server/api/intSalesforceAccount/intSalesforceAccount.controller.js b/server/api/intSalesforceAccount/intSalesforceAccount.controller.js index ff63c23..5ad0b6e 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 _0xaa4b=['login','concat','sobject','describe','OwnerId','ActivityDate','IsReminderSet','IsRecurrence','Description','string','picklist','boolean','email','textarea','phone','includes','label','custom','picklistValues','True','true','False','false','test','statusCode','getFields,\x20%s,\x20%s,\x20%s','stringify','send','Wrong\x20credentials','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','sox','to-csv','fs-extra','lodash','crypto','jsforce','querystring','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','status','end','json','offset','limit','undefined','count','set','Content-Range','apply','update','then','destroy','sendStatus','error','name','index','map','SalesforceAccount','rawAttributes','query','filters','intersection','model','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','pick','merge','type','VIRTUAL','filter','options','includeAll','include','findAll','rows','catch','show','keys','find','create','body','params','getConfigurations','SalesforceConfiguration','addConfiguration','findOne','AccountId','Subjects','getSubjects','channel','Descriptions','getDescriptions','SalesforceField','getFields','Task','remoteUri','clientId','clientSecret','username','password','securityToken','slice','Connection'];(function(_0x100573,_0x91e515){var _0x11cb6c=function(_0x3e1dd2){while(--_0x3e1dd2){_0x100573['push'](_0x100573['shift']());}};_0x11cb6c(++_0x91e515);}(_0xaa4b,0x188));var _0xbaa4=function(_0x295d18,_0x59d858){_0x295d18=_0x295d18-0x0;var _0x1cc1f1=_0xaa4b[_0x295d18];return _0x1cc1f1;};'use strict';var emlformat=require(_0xbaa4('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xbaa4('0x1'));var jsonpatch=require(_0xbaa4('0x2'));var rp=require(_0xbaa4('0x3'));var moment=require(_0xbaa4('0x4'));var BPromise=require(_0xbaa4('0x5'));var Mustache=require(_0xbaa4('0x6'));var util=require(_0xbaa4('0x7'));var path=require('path');var sox=require(_0xbaa4('0x8'));var csv=require(_0xbaa4('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xbaa4('0xa'));var _=require(_0xbaa4('0xb'));var squel=require('squel');var crypto=require(_0xbaa4('0xc'));var jsforce=require(_0xbaa4('0xd'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0xbaa4('0xe'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0xbaa4('0xf'));var hardwareService=require(_0xbaa4('0x10'));var logger=require('../../config/logger')(_0xbaa4('0x11'));var utils=require(_0xbaa4('0x12'));var config=require(_0xbaa4('0x13'));var licenseUtil=require(_0xbaa4('0x14'));var db=require(_0xbaa4('0x15'))['db'];var integrations=require('../../components/integrations/configuration');function respondWithStatusCode(_0x31a493,_0x9d85bb){_0x9d85bb=_0x9d85bb||0xcc;return function(_0x557bd0){if(_0x557bd0){return _0x31a493['sendStatus'](_0x9d85bb);}return _0x31a493[_0xbaa4('0x16')](_0x9d85bb)[_0xbaa4('0x17')]();};}function respondWithResult(_0x3cf072,_0x15a459){_0x15a459=_0x15a459||0xc8;return function(_0x934153){if(_0x934153){return _0x3cf072['status'](_0x15a459)[_0xbaa4('0x18')](_0x934153);}};}function respondWithFilteredResult(_0x58a238,_0xc2950){return function(_0x57237d){if(_0x57237d){var _0x25120b=typeof _0xc2950[_0xbaa4('0x19')]==='undefined'&&typeof _0xc2950[_0xbaa4('0x1a')]===_0xbaa4('0x1b');var _0x5c9a68=_0x57237d[_0xbaa4('0x1c')];var _0x1bd2aa=_0x25120b?0x0:_0xc2950[_0xbaa4('0x19')];var _0x457651=_0x25120b?_0x57237d['count']:_0xc2950[_0xbaa4('0x19')]+_0xc2950[_0xbaa4('0x1a')];var _0x1a2218;if(_0x457651>=_0x5c9a68){_0x457651=_0x5c9a68;_0x1a2218=0xc8;}else{_0x1a2218=0xce;}_0x58a238[_0xbaa4('0x16')](_0x1a2218);return _0x58a238[_0xbaa4('0x1d')](_0xbaa4('0x1e'),_0x1bd2aa+'-'+_0x457651+'/'+_0x5c9a68)[_0xbaa4('0x18')](_0x57237d);}return null;};}function patchUpdates(_0x2fdd44){return function(_0x372c2c){try{jsonpatch[_0xbaa4('0x1f')](_0x372c2c,_0x2fdd44,!![]);}catch(_0x179992){return BPromise['reject'](_0x179992);}return _0x372c2c['save']();};}function saveUpdates(_0x2d7e96,_0x3e3f6a){return function(_0x572b4c){if(_0x572b4c){return _0x572b4c[_0xbaa4('0x20')](_0x2d7e96)[_0xbaa4('0x21')](function(_0x1c568d){return _0x1c568d;});}return null;};}function removeEntity(_0x298bfb,_0x49c2f1){return function(_0x133e24){if(_0x133e24){return _0x133e24[_0xbaa4('0x22')]()['then'](function(){_0x298bfb[_0xbaa4('0x16')](0xcc)['end']();});}};}function handleEntityNotFound(_0x22f5e1,_0x107f89){return function(_0x28d7d3){if(!_0x28d7d3){_0x22f5e1[_0xbaa4('0x23')](0x194);}return _0x28d7d3;};}function handleError(_0x2d1474,_0x79c61){_0x79c61=_0x79c61||0x1f4;return function(_0xb7458d){logger[_0xbaa4('0x24')](_0xb7458d['stack']);if(_0xb7458d['name']){delete _0xb7458d[_0xbaa4('0x25')];}_0x2d1474['status'](_0x79c61)['send'](_0xb7458d);};}exports[_0xbaa4('0x26')]=function(_0x3bb426,_0x3df811){var _0x5a8eec={},_0x1cb1b9={},_0x8e587f={'count':0x0,'rows':[]};var _0x12eaa0=_[_0xbaa4('0x27')](db[_0xbaa4('0x28')][_0xbaa4('0x29')],function(_0x1bfdef){return{'name':_0x1bfdef['fieldName'],'type':_0x1bfdef['type']['key']};});_0x1cb1b9['model']=_[_0xbaa4('0x27')](_0x12eaa0,_0xbaa4('0x25'));_0x1cb1b9[_0xbaa4('0x2a')]=_['keys'](_0x3bb426[_0xbaa4('0x2a')]);_0x1cb1b9[_0xbaa4('0x2b')]=_[_0xbaa4('0x2c')](_0x1cb1b9[_0xbaa4('0x2d')],_0x1cb1b9[_0xbaa4('0x2a')]);_0x5a8eec['attributes']=_[_0xbaa4('0x2c')](_0x1cb1b9['model'],qs[_0xbaa4('0x2e')](_0x3bb426[_0xbaa4('0x2a')][_0xbaa4('0x2e')]));_0x5a8eec[_0xbaa4('0x2f')]=_0x5a8eec[_0xbaa4('0x2f')][_0xbaa4('0x30')]?_0x5a8eec['attributes']:_0x1cb1b9[_0xbaa4('0x2d')];if(!_0x3bb426['query'][_0xbaa4('0x31')](_0xbaa4('0x32'))){_0x5a8eec[_0xbaa4('0x1a')]=qs[_0xbaa4('0x1a')](_0x3bb426[_0xbaa4('0x2a')][_0xbaa4('0x1a')]);_0x5a8eec[_0xbaa4('0x19')]=qs[_0xbaa4('0x19')](_0x3bb426[_0xbaa4('0x2a')]['offset']);}_0x5a8eec[_0xbaa4('0x33')]=qs[_0xbaa4('0x34')](_0x3bb426['query'][_0xbaa4('0x34')]);_0x5a8eec[_0xbaa4('0x35')]=qs[_0xbaa4('0x2b')](_[_0xbaa4('0x36')](_0x3bb426['query'],_0x1cb1b9[_0xbaa4('0x2b')]),_0x12eaa0);if(_0x3bb426[_0xbaa4('0x2a')]['filter']){_0x5a8eec[_0xbaa4('0x35')]=_[_0xbaa4('0x37')](_0x5a8eec['where'],{'$or':_[_0xbaa4('0x27')](_0x12eaa0,function(_0x282e87){if(_0x282e87[_0xbaa4('0x38')]!==_0xbaa4('0x39')){var _0xcc60fd={};_0xcc60fd[_0x282e87[_0xbaa4('0x25')]]={'$like':'%'+_0x3bb426[_0xbaa4('0x2a')][_0xbaa4('0x3a')]+'%'};return _0xcc60fd;}})});}_0x5a8eec=_[_0xbaa4('0x37')]({},_0x5a8eec,_0x3bb426[_0xbaa4('0x3b')]);var _0x4cb90e={'where':_0x5a8eec[_0xbaa4('0x35')]};return db[_0xbaa4('0x28')][_0xbaa4('0x1c')](_0x4cb90e)[_0xbaa4('0x21')](function(_0x3cb7d0){_0x8e587f[_0xbaa4('0x1c')]=_0x3cb7d0;if(_0x3bb426['query'][_0xbaa4('0x3c')]){_0x5a8eec[_0xbaa4('0x3d')]=[{'all':!![]}];}return db[_0xbaa4('0x28')][_0xbaa4('0x3e')](_0x5a8eec);})[_0xbaa4('0x21')](function(_0x2e37ed){_0x8e587f[_0xbaa4('0x3f')]=_0x2e37ed;return _0x8e587f;})['then'](respondWithFilteredResult(_0x3df811,_0x5a8eec))[_0xbaa4('0x40')](handleError(_0x3df811,null));};exports[_0xbaa4('0x41')]=function(_0x159455,_0x1c93fe){var _0x4574b6={'raw':![],'where':{'id':_0x159455['params']['id']}},_0x1f988d={};_0x1f988d[_0xbaa4('0x2d')]=_[_0xbaa4('0x42')](db['SalesforceAccount'][_0xbaa4('0x29')]);_0x1f988d[_0xbaa4('0x2a')]=_[_0xbaa4('0x42')](_0x159455[_0xbaa4('0x2a')]);_0x1f988d['filters']=_['intersection'](_0x1f988d[_0xbaa4('0x2d')],_0x1f988d[_0xbaa4('0x2a')]);_0x4574b6['attributes']=_[_0xbaa4('0x2c')](_0x1f988d['model'],qs['fields'](_0x159455[_0xbaa4('0x2a')][_0xbaa4('0x2e')]));_0x4574b6[_0xbaa4('0x2f')]=_0x4574b6[_0xbaa4('0x2f')][_0xbaa4('0x30')]?_0x4574b6[_0xbaa4('0x2f')]:_0x1f988d['model'];if(_0x159455['query'][_0xbaa4('0x3c')]){_0x4574b6[_0xbaa4('0x3d')]=[{'all':!![]}];}_0x4574b6=_[_0xbaa4('0x37')]({},_0x4574b6,_0x159455[_0xbaa4('0x3b')]);return db[_0xbaa4('0x28')][_0xbaa4('0x43')](_0x4574b6)[_0xbaa4('0x21')](handleEntityNotFound(_0x1c93fe,null))[_0xbaa4('0x21')](respondWithResult(_0x1c93fe,null))['catch'](handleError(_0x1c93fe,null));};exports[_0xbaa4('0x44')]=function(_0x52a8ad,_0x310fbe){return db['SalesforceAccount'][_0xbaa4('0x44')](_0x52a8ad[_0xbaa4('0x45')],{})[_0xbaa4('0x21')](respondWithResult(_0x310fbe,0xc9))[_0xbaa4('0x40')](handleError(_0x310fbe,null));};exports[_0xbaa4('0x20')]=function(_0x4ce0b5,_0x365d95){if(_0x4ce0b5[_0xbaa4('0x45')]['id']){delete _0x4ce0b5['body']['id'];}return db[_0xbaa4('0x28')][_0xbaa4('0x43')]({'where':{'id':_0x4ce0b5[_0xbaa4('0x46')]['id']}})[_0xbaa4('0x21')](handleEntityNotFound(_0x365d95,null))[_0xbaa4('0x21')](saveUpdates(_0x4ce0b5[_0xbaa4('0x45')],null))[_0xbaa4('0x21')](respondWithResult(_0x365d95,null))[_0xbaa4('0x40')](handleError(_0x365d95,null));};exports[_0xbaa4('0x22')]=function(_0x44b107,_0x308ea7){return db['SalesforceAccount']['find']({'where':{'id':_0x44b107[_0xbaa4('0x46')]['id']}})['then'](handleEntityNotFound(_0x308ea7,null))[_0xbaa4('0x21')](removeEntity(_0x308ea7,null))[_0xbaa4('0x40')](handleError(_0x308ea7,null));};exports[_0xbaa4('0x47')]=function(_0x1136b7,_0x68c4b5,_0x1ec2b7){var _0xe6b68={};var _0x504432={};var _0x457976;var _0x52e43e;return db['SalesforceAccount']['findOne']({'where':{'id':_0x1136b7[_0xbaa4('0x46')]['id']}})[_0xbaa4('0x21')](handleEntityNotFound(_0x68c4b5,null))[_0xbaa4('0x21')](function(_0x2358f8){if(_0x2358f8){_0x457976=_0x2358f8;_0x504432[_0xbaa4('0x2d')]=_[_0xbaa4('0x42')](db[_0xbaa4('0x48')][_0xbaa4('0x29')]);_0x504432['query']=_[_0xbaa4('0x42')](_0x1136b7[_0xbaa4('0x2a')]);_0x504432[_0xbaa4('0x2b')]=_[_0xbaa4('0x2c')](_0x504432[_0xbaa4('0x2d')],_0x504432[_0xbaa4('0x2a')]);_0xe6b68[_0xbaa4('0x2f')]=_[_0xbaa4('0x2c')](_0x504432[_0xbaa4('0x2d')],qs[_0xbaa4('0x2e')](_0x1136b7[_0xbaa4('0x2a')][_0xbaa4('0x2e')]));_0xe6b68[_0xbaa4('0x2f')]=_0xe6b68[_0xbaa4('0x2f')][_0xbaa4('0x30')]?_0xe6b68[_0xbaa4('0x2f')]:_0x504432[_0xbaa4('0x2d')];_0xe6b68[_0xbaa4('0x33')]=qs[_0xbaa4('0x34')](_0x1136b7[_0xbaa4('0x2a')][_0xbaa4('0x34')]);_0xe6b68[_0xbaa4('0x35')]=qs[_0xbaa4('0x2b')](_[_0xbaa4('0x36')](_0x1136b7[_0xbaa4('0x2a')],_0x504432['filters']));if(_0x1136b7[_0xbaa4('0x2a')][_0xbaa4('0x3a')]){_0xe6b68['where']=_[_0xbaa4('0x37')](_0xe6b68[_0xbaa4('0x35')],{'$or':_[_0xbaa4('0x27')](_0xe6b68[_0xbaa4('0x2f')],function(_0x1b7120){var _0x29b98e={};_0x29b98e[_0x1b7120]={'$like':'%'+_0x1136b7[_0xbaa4('0x2a')][_0xbaa4('0x3a')]+'%'};return _0x29b98e;})});}_0xe6b68=_[_0xbaa4('0x37')]({},_0xe6b68,_0x1136b7[_0xbaa4('0x3b')]);return _0x457976[_0xbaa4('0x47')](_0xe6b68);}})[_0xbaa4('0x21')](function(_0x38c605){if(_0x38c605){_0x52e43e=_0x38c605[_0xbaa4('0x30')];if(!_0x1136b7[_0xbaa4('0x2a')][_0xbaa4('0x31')](_0xbaa4('0x32'))){_0xe6b68[_0xbaa4('0x1a')]=qs[_0xbaa4('0x1a')](_0x1136b7[_0xbaa4('0x2a')][_0xbaa4('0x1a')]);_0xe6b68['offset']=qs[_0xbaa4('0x19')](_0x1136b7[_0xbaa4('0x2a')][_0xbaa4('0x19')]);}return _0x457976[_0xbaa4('0x47')](_0xe6b68);}})[_0xbaa4('0x21')](function(_0x339cbe){if(_0x339cbe){return _0x339cbe?{'count':_0x52e43e,'rows':_0x339cbe}:null;}})[_0xbaa4('0x21')](respondWithResult(_0x68c4b5,null))[_0xbaa4('0x40')](handleError(_0x68c4b5,null));};exports[_0xbaa4('0x49')]=function(_0x3d9e18,_0x294002,_0x559595){if(_0x3d9e18[_0xbaa4('0x45')]['id']){delete _0x3d9e18['body']['id'];}return db[_0xbaa4('0x28')][_0xbaa4('0x4a')]({'where':{'id':_0x3d9e18[_0xbaa4('0x46')]['id']}})[_0xbaa4('0x21')](handleEntityNotFound(_0x294002,null))[_0xbaa4('0x21')](function(_0x23e75a){if(_0x23e75a){_0x3d9e18[_0xbaa4('0x45')][_0xbaa4('0x4b')]=_0x23e75a['id'];_0x3d9e18[_0xbaa4('0x45')][_0xbaa4('0x4c')]=integrations[_0xbaa4('0x4d')](_0x3d9e18[_0xbaa4('0x45')][_0xbaa4('0x4e')],_0x3d9e18[_0xbaa4('0x45')][_0xbaa4('0x38')]);_0x3d9e18[_0xbaa4('0x45')][_0xbaa4('0x4f')]=integrations[_0xbaa4('0x50')](_0x3d9e18[_0xbaa4('0x45')][_0xbaa4('0x4e')],_0x3d9e18[_0xbaa4('0x45')]['type']);return db[_0xbaa4('0x48')][_0xbaa4('0x44')](_0x3d9e18[_0xbaa4('0x45')],{'include':[{'model':db[_0xbaa4('0x51')],'as':_0xbaa4('0x4c')},{'model':db[_0xbaa4('0x51')],'as':_0xbaa4('0x4f')}]});}return null;})[_0xbaa4('0x21')](respondWithResult(_0x294002,null))[_0xbaa4('0x40')](handleError(_0x294002,null));};exports[_0xbaa4('0x52')]=function(_0x4a48a8,_0x1a6d6b,_0x41b10e){var _0x576fe6;var _0x387608='';var _0x36a964=_0xbaa4('0x53');return db[_0xbaa4('0x28')][_0xbaa4('0x4a')]({'where':{'id':_0x4a48a8['params']['id']},'attributes':['id',_0xbaa4('0x54'),_0xbaa4('0x55'),_0xbaa4('0x56'),_0xbaa4('0x57'),_0xbaa4('0x58'),_0xbaa4('0x59')]})[_0xbaa4('0x21')](handleEntityNotFound(_0x1a6d6b,null))[_0xbaa4('0x21')](function(_0x531aa4){if(_0x531aa4){_0x387608=_0x531aa4[_0xbaa4('0x54')];var _0x346f7f=_0x387608[_0xbaa4('0x5a')](-0x1);if(_0x346f7f==='/'){_0x387608=_0x387608['substring'](0x0,_0x387608['lastIndexOf'](_0x346f7f));}_0x576fe6=new jsforce[(_0xbaa4('0x5b'))]({'oauth2':{'loginUrl':_0x387608,'clientId':_0x531aa4[_0xbaa4('0x55')],'clientSecret':_0x531aa4[_0xbaa4('0x56')]}});return _0x576fe6[_0xbaa4('0x5c')](_0x531aa4[_0xbaa4('0x57')],_0x531aa4[_0xbaa4('0x58')][_0xbaa4('0x5d')](_0x531aa4[_0xbaa4('0x59')]));}})[_0xbaa4('0x21')](function(_0x834d9e){if(_0x834d9e){if(!_['isNil'](_0x4a48a8['query']['ticketType'])){_0x36a964=_0x4a48a8[_0xbaa4('0x2a')]['ticketType'];}return _0x576fe6[_0xbaa4('0x5e')](_0x36a964)[_0xbaa4('0x5f')]();}})[_0xbaa4('0x21')](function(_0x5d53d9){var _0xb8d48e=[_0xbaa4('0x60'),_0xbaa4('0x61'),_0xbaa4('0x62'),_0xbaa4('0x63'),'Subject',_0xbaa4('0x64')];var _0x522f0e=[_0xbaa4('0x65'),'int',_0xbaa4('0x66'),_0xbaa4('0x67'),_0xbaa4('0x68'),_0xbaa4('0x69'),_0xbaa4('0x6a')];if(_0x5d53d9){_['remove'](_0x5d53d9[_0xbaa4('0x2e')],function(_0x3c116d){return _0xb8d48e[_0xbaa4('0x6b')](_0x3c116d[_0xbaa4('0x25')])||!_0x522f0e[_0xbaa4('0x6b')](_0x3c116d[_0xbaa4('0x38')]);});return{'count':_0x5d53d9['fields'][_0xbaa4('0x30')],'rows':_[_0xbaa4('0x27')](_0x5d53d9[_0xbaa4('0x2e')],function(_0x12ffb0){return{'id':_0x12ffb0[_0xbaa4('0x25')],'name':_0x12ffb0[_0xbaa4('0x6c')],'custom':_0x12ffb0[_0xbaa4('0x6d')],'options':_0x12ffb0[_0xbaa4('0x6e')]['length']>0x0?_[_0xbaa4('0x27')](_0x12ffb0['picklistValues'],function(_0x5f2896){return{'name':_0x5f2896[_0xbaa4('0x6c')],'value':_0x5f2896['value']};}):_0x12ffb0['type']==_0xbaa4('0x67')?[{'name':_0xbaa4('0x6f'),'value':_0xbaa4('0x70')},{'name':_0xbaa4('0x71'),'value':_0xbaa4('0x72')}]:[]};})};}})['then'](respondWithResult(_0x1a6d6b,null))[_0xbaa4('0x40')](function(_0x34c51b){var _0x26b14b=_0x4a48a8[_0xbaa4('0x2a')][_0xbaa4('0x73')]?0x1f4:_0x34c51b[_0xbaa4('0x74')]||0x1f4;logger[_0xbaa4('0x24')](_0xbaa4('0x75'),_0xbaa4('0x52'),_0x26b14b,JSON[_0xbaa4('0x76')](_0x34c51b));delete _0x34c51b[_0xbaa4('0x25')];if(_0x26b14b===0x191){_0x26b14b=0x190;}_0x1a6d6b[_0xbaa4('0x16')](_0x26b14b)[_0xbaa4('0x77')](_0x4a48a8[_0xbaa4('0x2a')][_0xbaa4('0x73')]?{'message':_0xbaa4('0x78'),'statusCode':_0x34c51b[_0xbaa4('0x74')]}:_0x34c51b);});}; \ No newline at end of file +var _0xb3b6=['picklist','boolean','textarea','remove','includes','label','custom','picklistValues','True','true','False','false','test','statusCode','getFields,\x20%s,\x20%s,\x20%s','stringify','send','Wrong\x20credentials','rimraf','zip-dir','moment','bluebird','mustache','util','path','to-csv','ejs','lodash','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','sendStatus','status','undefined','count','offset','limit','set','json','apply','save','update','then','destroy','end','error','stack','name','map','fieldName','type','key','model','query','keys','filters','intersection','attributes','length','hasOwnProperty','order','sort','where','pick','filter','merge','VIRTUAL','SalesforceAccount','includeAll','catch','params','fields','include','options','find','create','body','getConfigurations','SalesforceConfiguration','rawAttributes','nolimit','findOne','AccountId','Subjects','getSubjects','channel','SalesforceField','Descriptions','getFields','Task','remoteUri','clientSecret','username','substring','lastIndexOf','Connection','clientId','login','password','isNil','ticketType','sobject','describe','OwnerId','ActivityDate','IsReminderSet','IsRecurrence','Description','string','int'];(function(_0xa016f6,_0x3a8863){var _0x313949=function(_0x570eeb){while(--_0x570eeb){_0xa016f6['push'](_0xa016f6['shift']());}};_0x313949(++_0x3a8863);}(_0xb3b6,0x177));var _0x6b3b=function(_0x7509da,_0x58eb96){_0x7509da=_0x7509da-0x0;var _0x482e6a=_0xb3b6[_0x7509da];return _0x482e6a;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x6b3b('0x0'));var zipdir=require(_0x6b3b('0x1'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0x6b3b('0x2'));var BPromise=require(_0x6b3b('0x3'));var Mustache=require(_0x6b3b('0x4'));var util=require(_0x6b3b('0x5'));var path=require(_0x6b3b('0x6'));var sox=require('sox');var csv=require(_0x6b3b('0x7'));var ejs=require(_0x6b3b('0x8'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x6b3b('0x9'));var squel=require('squel');var crypto=require(_0x6b3b('0xa'));var jsforce=require(_0x6b3b('0xb'));var deskjs=require(_0x6b3b('0xc'));var toCsv=require(_0x6b3b('0x7'));var querystring=require(_0x6b3b('0xd'));var Papa=require(_0x6b3b('0xe'));var Redis=require(_0x6b3b('0xf'));var authService=require(_0x6b3b('0x10'));var qs=require(_0x6b3b('0x11'));var as=require(_0x6b3b('0x12'));var hardwareService=require(_0x6b3b('0x13'));var logger=require('../../config/logger')(_0x6b3b('0x14'));var utils=require(_0x6b3b('0x15'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];var integrations=require('../../components/integrations/configuration');function respondWithStatusCode(_0x67837f,_0x3543e6){_0x3543e6=_0x3543e6||0xcc;return function(_0xc1e9be){if(_0xc1e9be){return _0x67837f[_0x6b3b('0x16')](_0x3543e6);}return _0x67837f['status'](_0x3543e6)['end']();};}function respondWithResult(_0xe1ab22,_0x144677){_0x144677=_0x144677||0xc8;return function(_0x5bb8fe){if(_0x5bb8fe){return _0xe1ab22[_0x6b3b('0x17')](_0x144677)['json'](_0x5bb8fe);}};}function respondWithFilteredResult(_0x18e1f6,_0x49c14e){return function(_0x34d2b7){if(_0x34d2b7){var _0x27a121=typeof _0x49c14e['offset']===_0x6b3b('0x18')&&typeof _0x49c14e['limit']===_0x6b3b('0x18');var _0x5ee934=_0x34d2b7[_0x6b3b('0x19')];var _0x84386f=_0x27a121?0x0:_0x49c14e[_0x6b3b('0x1a')];var _0x564bc9=_0x27a121?_0x34d2b7['count']:_0x49c14e['offset']+_0x49c14e[_0x6b3b('0x1b')];var _0x30194c;if(_0x564bc9>=_0x5ee934){_0x564bc9=_0x5ee934;_0x30194c=0xc8;}else{_0x30194c=0xce;}_0x18e1f6[_0x6b3b('0x17')](_0x30194c);return _0x18e1f6[_0x6b3b('0x1c')]('Content-Range',_0x84386f+'-'+_0x564bc9+'/'+_0x5ee934)[_0x6b3b('0x1d')](_0x34d2b7);}return null;};}function patchUpdates(_0x36418b){return function(_0x9eeec2){try{jsonpatch[_0x6b3b('0x1e')](_0x9eeec2,_0x36418b,!![]);}catch(_0x49ac96){return BPromise['reject'](_0x49ac96);}return _0x9eeec2[_0x6b3b('0x1f')]();};}function saveUpdates(_0x30cdd6,_0x3bce4e){return function(_0x1e3ba1){if(_0x1e3ba1){return _0x1e3ba1[_0x6b3b('0x20')](_0x30cdd6)[_0x6b3b('0x21')](function(_0x2f1251){return _0x2f1251;});}return null;};}function removeEntity(_0x45fdbb,_0x54104d){return function(_0x4bc88c){if(_0x4bc88c){return _0x4bc88c[_0x6b3b('0x22')]()[_0x6b3b('0x21')](function(){_0x45fdbb[_0x6b3b('0x17')](0xcc)[_0x6b3b('0x23')]();});}};}function handleEntityNotFound(_0x121ca8,_0x1acef7){return function(_0x41bc10){if(!_0x41bc10){_0x121ca8[_0x6b3b('0x16')](0x194);}return _0x41bc10;};}function handleError(_0x4bef3f,_0x20269e){_0x20269e=_0x20269e||0x1f4;return function(_0x5b0f29){logger[_0x6b3b('0x24')](_0x5b0f29[_0x6b3b('0x25')]);if(_0x5b0f29[_0x6b3b('0x26')]){delete _0x5b0f29['name'];}_0x4bef3f[_0x6b3b('0x17')](_0x20269e)['send'](_0x5b0f29);};}exports['index']=function(_0x5eadef,_0x1d99c5){var _0x17a690={},_0x45d39f={},_0x2e49e7={'count':0x0,'rows':[]};var _0x1bb694=_[_0x6b3b('0x27')](db['SalesforceAccount']['rawAttributes'],function(_0x247cb4){return{'name':_0x247cb4[_0x6b3b('0x28')],'type':_0x247cb4[_0x6b3b('0x29')][_0x6b3b('0x2a')]};});_0x45d39f[_0x6b3b('0x2b')]=_[_0x6b3b('0x27')](_0x1bb694,_0x6b3b('0x26'));_0x45d39f[_0x6b3b('0x2c')]=_[_0x6b3b('0x2d')](_0x5eadef[_0x6b3b('0x2c')]);_0x45d39f[_0x6b3b('0x2e')]=_[_0x6b3b('0x2f')](_0x45d39f[_0x6b3b('0x2b')],_0x45d39f[_0x6b3b('0x2c')]);_0x17a690[_0x6b3b('0x30')]=_[_0x6b3b('0x2f')](_0x45d39f[_0x6b3b('0x2b')],qs['fields'](_0x5eadef[_0x6b3b('0x2c')]['fields']));_0x17a690['attributes']=_0x17a690[_0x6b3b('0x30')][_0x6b3b('0x31')]?_0x17a690[_0x6b3b('0x30')]:_0x45d39f[_0x6b3b('0x2b')];if(!_0x5eadef[_0x6b3b('0x2c')][_0x6b3b('0x32')]('nolimit')){_0x17a690[_0x6b3b('0x1b')]=qs[_0x6b3b('0x1b')](_0x5eadef['query'][_0x6b3b('0x1b')]);_0x17a690[_0x6b3b('0x1a')]=qs[_0x6b3b('0x1a')](_0x5eadef['query'][_0x6b3b('0x1a')]);}_0x17a690[_0x6b3b('0x33')]=qs[_0x6b3b('0x34')](_0x5eadef[_0x6b3b('0x2c')][_0x6b3b('0x34')]);_0x17a690[_0x6b3b('0x35')]=qs[_0x6b3b('0x2e')](_[_0x6b3b('0x36')](_0x5eadef['query'],_0x45d39f[_0x6b3b('0x2e')]),_0x1bb694);if(_0x5eadef[_0x6b3b('0x2c')][_0x6b3b('0x37')]){_0x17a690[_0x6b3b('0x35')]=_[_0x6b3b('0x38')](_0x17a690[_0x6b3b('0x35')],{'$or':_[_0x6b3b('0x27')](_0x1bb694,function(_0x63e860){if(_0x63e860[_0x6b3b('0x29')]!==_0x6b3b('0x39')){var _0x1944dc={};_0x1944dc[_0x63e860['name']]={'$like':'%'+_0x5eadef[_0x6b3b('0x2c')][_0x6b3b('0x37')]+'%'};return _0x1944dc;}})});}_0x17a690=_[_0x6b3b('0x38')]({},_0x17a690,_0x5eadef['options']);var _0x34602a={'where':_0x17a690['where']};return db[_0x6b3b('0x3a')][_0x6b3b('0x19')](_0x34602a)[_0x6b3b('0x21')](function(_0x1df76c){_0x2e49e7[_0x6b3b('0x19')]=_0x1df76c;if(_0x5eadef['query'][_0x6b3b('0x3b')]){_0x17a690['include']=[{'all':!![]}];}return db[_0x6b3b('0x3a')]['findAll'](_0x17a690);})[_0x6b3b('0x21')](function(_0x2192bc){_0x2e49e7['rows']=_0x2192bc;return _0x2e49e7;})[_0x6b3b('0x21')](respondWithFilteredResult(_0x1d99c5,_0x17a690))[_0x6b3b('0x3c')](handleError(_0x1d99c5,null));};exports['show']=function(_0x4b355c,_0x354920){var _0xcd2667={'raw':![],'where':{'id':_0x4b355c[_0x6b3b('0x3d')]['id']}},_0x59be9d={};_0x59be9d[_0x6b3b('0x2b')]=_[_0x6b3b('0x2d')](db['SalesforceAccount']['rawAttributes']);_0x59be9d[_0x6b3b('0x2c')]=_[_0x6b3b('0x2d')](_0x4b355c[_0x6b3b('0x2c')]);_0x59be9d['filters']=_[_0x6b3b('0x2f')](_0x59be9d[_0x6b3b('0x2b')],_0x59be9d['query']);_0xcd2667[_0x6b3b('0x30')]=_[_0x6b3b('0x2f')](_0x59be9d[_0x6b3b('0x2b')],qs[_0x6b3b('0x3e')](_0x4b355c['query'][_0x6b3b('0x3e')]));_0xcd2667['attributes']=_0xcd2667[_0x6b3b('0x30')]['length']?_0xcd2667['attributes']:_0x59be9d[_0x6b3b('0x2b')];if(_0x4b355c[_0x6b3b('0x2c')][_0x6b3b('0x3b')]){_0xcd2667[_0x6b3b('0x3f')]=[{'all':!![]}];}_0xcd2667=_[_0x6b3b('0x38')]({},_0xcd2667,_0x4b355c[_0x6b3b('0x40')]);return db['SalesforceAccount'][_0x6b3b('0x41')](_0xcd2667)[_0x6b3b('0x21')](handleEntityNotFound(_0x354920,null))[_0x6b3b('0x21')](respondWithResult(_0x354920,null))[_0x6b3b('0x3c')](handleError(_0x354920,null));};exports[_0x6b3b('0x42')]=function(_0x269572,_0x4551a4){return db[_0x6b3b('0x3a')]['create'](_0x269572[_0x6b3b('0x43')],{})[_0x6b3b('0x21')](respondWithResult(_0x4551a4,0xc9))[_0x6b3b('0x3c')](handleError(_0x4551a4,null));};exports['update']=function(_0x3d7ec1,_0x2c83c3){if(_0x3d7ec1[_0x6b3b('0x43')]['id']){delete _0x3d7ec1[_0x6b3b('0x43')]['id'];}return db['SalesforceAccount']['find']({'where':{'id':_0x3d7ec1[_0x6b3b('0x3d')]['id']}})[_0x6b3b('0x21')](handleEntityNotFound(_0x2c83c3,null))['then'](saveUpdates(_0x3d7ec1[_0x6b3b('0x43')],null))[_0x6b3b('0x21')](respondWithResult(_0x2c83c3,null))[_0x6b3b('0x3c')](handleError(_0x2c83c3,null));};exports[_0x6b3b('0x22')]=function(_0x4c89cd,_0x145ec7){return db[_0x6b3b('0x3a')][_0x6b3b('0x41')]({'where':{'id':_0x4c89cd[_0x6b3b('0x3d')]['id']}})[_0x6b3b('0x21')](handleEntityNotFound(_0x145ec7,null))['then'](removeEntity(_0x145ec7,null))['catch'](handleError(_0x145ec7,null));};exports[_0x6b3b('0x44')]=function(_0x20fa6f,_0x2c2c58,_0x303c20){var _0xbb7186={};var _0x208c9e={};var _0x56b6a1;var _0x263b44;return db[_0x6b3b('0x3a')]['findOne']({'where':{'id':_0x20fa6f['params']['id']}})[_0x6b3b('0x21')](handleEntityNotFound(_0x2c2c58,null))[_0x6b3b('0x21')](function(_0x1afcef){if(_0x1afcef){_0x56b6a1=_0x1afcef;_0x208c9e[_0x6b3b('0x2b')]=_[_0x6b3b('0x2d')](db[_0x6b3b('0x45')][_0x6b3b('0x46')]);_0x208c9e['query']=_['keys'](_0x20fa6f[_0x6b3b('0x2c')]);_0x208c9e[_0x6b3b('0x2e')]=_['intersection'](_0x208c9e['model'],_0x208c9e['query']);_0xbb7186[_0x6b3b('0x30')]=_[_0x6b3b('0x2f')](_0x208c9e[_0x6b3b('0x2b')],qs['fields'](_0x20fa6f['query']['fields']));_0xbb7186[_0x6b3b('0x30')]=_0xbb7186[_0x6b3b('0x30')]['length']?_0xbb7186[_0x6b3b('0x30')]:_0x208c9e[_0x6b3b('0x2b')];_0xbb7186['order']=qs['sort'](_0x20fa6f[_0x6b3b('0x2c')][_0x6b3b('0x34')]);_0xbb7186['where']=qs[_0x6b3b('0x2e')](_[_0x6b3b('0x36')](_0x20fa6f[_0x6b3b('0x2c')],_0x208c9e[_0x6b3b('0x2e')]));if(_0x20fa6f[_0x6b3b('0x2c')]['filter']){_0xbb7186[_0x6b3b('0x35')]=_[_0x6b3b('0x38')](_0xbb7186[_0x6b3b('0x35')],{'$or':_[_0x6b3b('0x27')](_0xbb7186[_0x6b3b('0x30')],function(_0x8376fd){var _0xa82b9d={};_0xa82b9d[_0x8376fd]={'$like':'%'+_0x20fa6f[_0x6b3b('0x2c')][_0x6b3b('0x37')]+'%'};return _0xa82b9d;})});}_0xbb7186=_['merge']({},_0xbb7186,_0x20fa6f[_0x6b3b('0x40')]);return _0x56b6a1[_0x6b3b('0x44')](_0xbb7186);}})[_0x6b3b('0x21')](function(_0x52f8cd){if(_0x52f8cd){_0x263b44=_0x52f8cd[_0x6b3b('0x31')];if(!_0x20fa6f[_0x6b3b('0x2c')][_0x6b3b('0x32')](_0x6b3b('0x47'))){_0xbb7186[_0x6b3b('0x1b')]=qs[_0x6b3b('0x1b')](_0x20fa6f[_0x6b3b('0x2c')]['limit']);_0xbb7186['offset']=qs['offset'](_0x20fa6f[_0x6b3b('0x2c')][_0x6b3b('0x1a')]);}return _0x56b6a1[_0x6b3b('0x44')](_0xbb7186);}})[_0x6b3b('0x21')](function(_0x435d90){if(_0x435d90){return _0x435d90?{'count':_0x263b44,'rows':_0x435d90}:null;}})[_0x6b3b('0x21')](respondWithResult(_0x2c2c58,null))[_0x6b3b('0x3c')](handleError(_0x2c2c58,null));};exports['addConfiguration']=function(_0x4c960d,_0x586d6d,_0x1d39d3){if(_0x4c960d[_0x6b3b('0x43')]['id']){delete _0x4c960d[_0x6b3b('0x43')]['id'];}return db[_0x6b3b('0x3a')][_0x6b3b('0x48')]({'where':{'id':_0x4c960d[_0x6b3b('0x3d')]['id']}})['then'](handleEntityNotFound(_0x586d6d,null))[_0x6b3b('0x21')](function(_0x492fae){if(_0x492fae){_0x4c960d[_0x6b3b('0x43')][_0x6b3b('0x49')]=_0x492fae['id'];_0x4c960d['body'][_0x6b3b('0x4a')]=integrations[_0x6b3b('0x4b')](_0x4c960d[_0x6b3b('0x43')][_0x6b3b('0x4c')],_0x4c960d[_0x6b3b('0x43')]['type']);_0x4c960d[_0x6b3b('0x43')]['Descriptions']=integrations['getDescriptions'](_0x4c960d[_0x6b3b('0x43')][_0x6b3b('0x4c')],_0x4c960d[_0x6b3b('0x43')][_0x6b3b('0x29')]);return db[_0x6b3b('0x45')][_0x6b3b('0x42')](_0x4c960d[_0x6b3b('0x43')],{'include':[{'model':db[_0x6b3b('0x4d')],'as':_0x6b3b('0x4a')},{'model':db[_0x6b3b('0x4d')],'as':_0x6b3b('0x4e')}]});}return null;})[_0x6b3b('0x21')](respondWithResult(_0x586d6d,null))[_0x6b3b('0x3c')](handleError(_0x586d6d,null));};exports[_0x6b3b('0x4f')]=function(_0x15e8c0,_0x553e1a,_0x38f6ff){var _0x4dff1e;var _0x5397ab='';var _0x526fbe=_0x6b3b('0x50');return db[_0x6b3b('0x3a')][_0x6b3b('0x48')]({'where':{'id':_0x15e8c0['params']['id']},'attributes':['id',_0x6b3b('0x51'),'clientId',_0x6b3b('0x52'),_0x6b3b('0x53'),'password','securityToken']})[_0x6b3b('0x21')](handleEntityNotFound(_0x553e1a,null))[_0x6b3b('0x21')](function(_0x27fe18){if(_0x27fe18){_0x5397ab=_0x27fe18[_0x6b3b('0x51')];var _0x1077c7=_0x5397ab['slice'](-0x1);if(_0x1077c7==='/'){_0x5397ab=_0x5397ab[_0x6b3b('0x54')](0x0,_0x5397ab[_0x6b3b('0x55')](_0x1077c7));}_0x4dff1e=new jsforce[(_0x6b3b('0x56'))]({'oauth2':{'loginUrl':_0x5397ab,'clientId':_0x27fe18[_0x6b3b('0x57')],'clientSecret':_0x27fe18['clientSecret']}});return _0x4dff1e[_0x6b3b('0x58')](_0x27fe18[_0x6b3b('0x53')],_0x27fe18[_0x6b3b('0x59')]['concat'](_0x27fe18['securityToken']));}})[_0x6b3b('0x21')](function(_0x2e9d72){if(_0x2e9d72){if(!_[_0x6b3b('0x5a')](_0x15e8c0[_0x6b3b('0x2c')]['ticketType'])){_0x526fbe=_0x15e8c0[_0x6b3b('0x2c')][_0x6b3b('0x5b')];}return _0x4dff1e[_0x6b3b('0x5c')](_0x526fbe)[_0x6b3b('0x5d')]();}})[_0x6b3b('0x21')](function(_0x5912df){var _0x5a6736=[_0x6b3b('0x5e'),_0x6b3b('0x5f'),_0x6b3b('0x60'),_0x6b3b('0x61'),'Subject',_0x6b3b('0x62')];var _0x4496f5=[_0x6b3b('0x63'),_0x6b3b('0x64'),_0x6b3b('0x65'),_0x6b3b('0x66'),'email',_0x6b3b('0x67'),'phone'];if(_0x5912df){_[_0x6b3b('0x68')](_0x5912df[_0x6b3b('0x3e')],function(_0x518701){return _0x5a6736[_0x6b3b('0x69')](_0x518701[_0x6b3b('0x26')])||!_0x4496f5[_0x6b3b('0x69')](_0x518701['type']);});return{'count':_0x5912df[_0x6b3b('0x3e')][_0x6b3b('0x31')],'rows':_[_0x6b3b('0x27')](_0x5912df[_0x6b3b('0x3e')],function(_0x15085e){return{'id':_0x15085e[_0x6b3b('0x26')],'name':_0x15085e[_0x6b3b('0x6a')],'custom':_0x15085e[_0x6b3b('0x6b')],'options':_0x15085e['picklistValues'][_0x6b3b('0x31')]>0x0?_[_0x6b3b('0x27')](_0x15085e[_0x6b3b('0x6c')],function(_0x28dacf){return{'name':_0x28dacf[_0x6b3b('0x6a')],'value':_0x28dacf['value']};}):_0x15085e[_0x6b3b('0x29')]==_0x6b3b('0x66')?[{'name':_0x6b3b('0x6d'),'value':_0x6b3b('0x6e')},{'name':_0x6b3b('0x6f'),'value':_0x6b3b('0x70')}]:[]};})};}})[_0x6b3b('0x21')](respondWithResult(_0x553e1a,null))['catch'](function(_0x373b60){var _0x2be887=_0x15e8c0[_0x6b3b('0x2c')][_0x6b3b('0x71')]?0x1f4:_0x373b60[_0x6b3b('0x72')]||0x1f4;logger[_0x6b3b('0x24')](_0x6b3b('0x73'),_0x6b3b('0x4f'),_0x2be887,JSON[_0x6b3b('0x74')](_0x373b60));delete _0x373b60[_0x6b3b('0x26')];if(_0x2be887===0x191){_0x2be887=0x190;}_0x553e1a[_0x6b3b('0x17')](_0x2be887)[_0x6b3b('0x75')](_0x15e8c0['query']['test']?{'message':_0x6b3b('0x76'),'statusCode':_0x373b60[_0x6b3b('0x72')]}:_0x373b60);});}; \ No newline at end of file diff --git a/server/api/intSalesforceAccount/intSalesforceAccount.model.js b/server/api/intSalesforceAccount/intSalesforceAccount.model.js index a79edc6..fbe786d 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 _0xd5cc=['./intSalesforceAccount.attributes','../../components/integrations/configuration','define','int_salesforce_accounts','lodash','util','../../config/logger','api','moment','bluebird','request-promise','rimraf','../../config/environment'];(function(_0x25e90b,_0x23f6fc){var _0x2aeb6c=function(_0x2ff23b){while(--_0x2ff23b){_0x25e90b['push'](_0x25e90b['shift']());}};_0x2aeb6c(++_0x23f6fc);}(_0xd5cc,0xfb));var _0xcd5c=function(_0x4ba3e1,_0x4a7eec){_0x4ba3e1=_0x4ba3e1-0x0;var _0x13353d=_0xd5cc[_0x4ba3e1];return _0x13353d;};'use strict';var _=require(_0xcd5c('0x0'));var util=require(_0xcd5c('0x1'));var logger=require(_0xcd5c('0x2'))(_0xcd5c('0x3'));var moment=require(_0xcd5c('0x4'));var BPromise=require(_0xcd5c('0x5'));var rp=require(_0xcd5c('0x6'));var fs=require('fs');var path=require('path');var rimraf=require(_0xcd5c('0x7'));var config=require(_0xcd5c('0x8'));var attributes=require(_0xcd5c('0x9'));var integrations=require(_0xcd5c('0xa'));module['exports']=function(_0x573214,_0x159004){return _0x573214[_0xcd5c('0xb')]('SalesforceAccount',attributes,{'tableName':_0xcd5c('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xb927=['util','../../config/logger','api','moment','bluebird','path','rimraf','../../config/environment','./intSalesforceAccount.attributes','../../components/integrations/configuration','exports','define','SalesforceAccount'];(function(_0x45847f,_0x683ea3){var _0xd944a2=function(_0x88a8c8){while(--_0x88a8c8){_0x45847f['push'](_0x45847f['shift']());}};_0xd944a2(++_0x683ea3);}(_0xb927,0xa9));var _0x7b92=function(_0x103bde,_0x542a72){_0x103bde=_0x103bde-0x0;var _0x1cbf3c=_0xb927[_0x103bde];return _0x1cbf3c;};'use strict';var _=require('lodash');var util=require(_0x7b92('0x0'));var logger=require(_0x7b92('0x1'))(_0x7b92('0x2'));var moment=require(_0x7b92('0x3'));var BPromise=require(_0x7b92('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x7b92('0x5'));var rimraf=require(_0x7b92('0x6'));var config=require(_0x7b92('0x7'));var attributes=require(_0x7b92('0x8'));var integrations=require(_0x7b92('0x9'));module[_0x7b92('0xa')]=function(_0x37a67b,_0x3c5b67){return _0x37a67b[_0x7b92('0xb')](_0x7b92('0xc'),attributes,{'tableName':'int_salesforce_accounts','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/intSalesforceAccount/intSalesforceAccount.rpc.js b/server/api/intSalesforceAccount/intSalesforceAccount.rpc.js index e7202a1..2509132 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 _0x713f=['debug','stringify','error','code','message','result','catch','GetSalesforceAccount','SalesforceAccount','findAll','options','raw','where','limit','include','map','model','attributes','then','ShowSalesforceAccount','find','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','info','SalesforceAccount,\x20%s,\x20%s','request\x20sent'];(function(_0x1b91c7,_0x539acd){var _0xbbe014=function(_0x57ff15){while(--_0x57ff15){_0x1b91c7['push'](_0x1b91c7['shift']());}};_0xbbe014(++_0x539acd);}(_0x713f,0xed));var _0xf713=function(_0x11daaf,_0x40a85d){_0x11daaf=_0x11daaf-0x0;var _0x3dfb17=_0x713f[_0x11daaf];return _0x3dfb17;};'use strict';var _=require(_0xf713('0x0'));var util=require(_0xf713('0x1'));var moment=require(_0xf713('0x2'));var BPromise=require(_0xf713('0x3'));var rs=require(_0xf713('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xf713('0x5'))['db'];var utils=require(_0xf713('0x6'));var logger=require(_0xf713('0x7'))(_0xf713('0x8'));var config=require('../../config/environment');var jayson=require(_0xf713('0x9'));var client=jayson[_0xf713('0xa')][_0xf713('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x5e2561,_0x1c9433,_0x475e7c){return new BPromise(function(_0x469952,_0x168387){return client['request'](_0x5e2561,_0x475e7c)['then'](function(_0x3b6bac){logger[_0xf713('0xc')](_0xf713('0xd'),_0x1c9433,_0xf713('0xe'));logger[_0xf713('0xf')]('SalesforceAccount,\x20%s,\x20%s,\x20%s',_0x1c9433,_0xf713('0xe'),JSON[_0xf713('0x10')](_0x3b6bac));if(_0x3b6bac[_0xf713('0x11')]){if(_0x3b6bac[_0xf713('0x11')][_0xf713('0x12')]===0x1f4){logger[_0xf713('0x11')](_0xf713('0xd'),_0x1c9433,_0x3b6bac[_0xf713('0x11')][_0xf713('0x13')]);return _0x168387(_0x3b6bac[_0xf713('0x11')][_0xf713('0x13')]);}logger[_0xf713('0x11')](_0xf713('0xd'),_0x1c9433,_0x3b6bac['error']['message']);return _0x469952(_0x3b6bac[_0xf713('0x11')][_0xf713('0x13')]);}else{logger[_0xf713('0xc')]('SalesforceAccount,\x20%s,\x20%s',_0x1c9433,_0xf713('0xe'));_0x469952(_0x3b6bac[_0xf713('0x14')][_0xf713('0x13')]);}})[_0xf713('0x15')](function(_0x2ebee0){logger[_0xf713('0x11')](_0xf713('0xd'),_0x1c9433,_0x2ebee0);_0x168387(_0x2ebee0);});});}exports[_0xf713('0x16')]=function(_0x202276){var _0x57ff4f=this;return new Promise(function(_0x45201f,_0x168010){return db[_0xf713('0x17')][_0xf713('0x18')]({'raw':_0x202276[_0xf713('0x19')]?_0x202276[_0xf713('0x19')][_0xf713('0x1a')]===undefined?!![]:![]:!![],'where':_0x202276['options']?_0x202276[_0xf713('0x19')][_0xf713('0x1b')]||null:null,'attributes':_0x202276['options']?_0x202276[_0xf713('0x19')]['attributes']||null:null,'limit':_0x202276['options']?_0x202276[_0xf713('0x19')][_0xf713('0x1c')]||null:null,'include':_0x202276[_0xf713('0x19')]?_0x202276[_0xf713('0x19')][_0xf713('0x1d')]?_[_0xf713('0x1e')](_0x202276[_0xf713('0x19')][_0xf713('0x1d')],function(_0x355a85){return{'model':db[_0x355a85[_0xf713('0x1f')]],'as':_0x355a85['as'],'attributes':_0x355a85[_0xf713('0x20')],'include':_0x355a85['include']?_[_0xf713('0x1e')](_0x355a85[_0xf713('0x1d')],function(_0x501511){return{'model':db[_0x501511[_0xf713('0x1f')]],'as':_0x501511['as'],'attributes':_0x501511[_0xf713('0x20')],'include':_0x501511['include']?_[_0xf713('0x1e')](_0x501511[_0xf713('0x1d')],function(_0x5a1081){return{'model':db[_0x5a1081['model']],'as':_0x5a1081['as'],'attributes':_0x5a1081[_0xf713('0x20')]};}):[]};}):[]};}):[]:[]})[_0xf713('0x21')](function(_0x15e99d){logger[_0xf713('0xc')](_0xf713('0x16'),_0x202276);logger[_0xf713('0xf')](_0xf713('0x16'),_0x202276,JSON[_0xf713('0x10')](_0x15e99d));_0x45201f(_0x15e99d);})['catch'](function(_0x52794b){logger[_0xf713('0x11')](_0xf713('0x16'),_0x52794b['message'],_0x202276);_0x168010(_0x57ff4f[_0xf713('0x11')](0x1f4,_0x52794b['message']));});});};exports[_0xf713('0x22')]=function(_0x5f204c){var _0x2c7429=this;return new Promise(function(_0x37d72c,_0x464a11){return db[_0xf713('0x17')][_0xf713('0x23')]({'raw':_0x5f204c[_0xf713('0x19')]?_0x5f204c['options'][_0xf713('0x1a')]===undefined?!![]:![]:!![],'where':_0x5f204c[_0xf713('0x19')]?_0x5f204c[_0xf713('0x19')]['where']||null:null,'attributes':_0x5f204c[_0xf713('0x19')]?_0x5f204c[_0xf713('0x19')][_0xf713('0x20')]||null:null,'include':_0x5f204c[_0xf713('0x19')]?_0x5f204c[_0xf713('0x19')][_0xf713('0x1d')]?_[_0xf713('0x1e')](_0x5f204c[_0xf713('0x19')]['include'],function(_0x5e9dda){return{'model':db[_0x5e9dda[_0xf713('0x1f')]],'as':_0x5e9dda['as'],'attributes':_0x5e9dda[_0xf713('0x20')],'include':_0x5e9dda[_0xf713('0x1d')]?_[_0xf713('0x1e')](_0x5e9dda['include'],function(_0x56f8a0){return{'model':db[_0x56f8a0[_0xf713('0x1f')]],'as':_0x56f8a0['as'],'attributes':_0x56f8a0[_0xf713('0x20')],'include':_0x56f8a0[_0xf713('0x1d')]?_[_0xf713('0x1e')](_0x56f8a0['include'],function(_0xcfc316){return{'model':db[_0xcfc316[_0xf713('0x1f')]],'as':_0xcfc316['as'],'attributes':_0xcfc316[_0xf713('0x20')]};}):[]};}):[]};}):[]:[]})[_0xf713('0x21')](function(_0x5ce88c){logger[_0xf713('0xc')](_0xf713('0x22'),_0x5f204c);logger['debug'](_0xf713('0x22'),_0x5f204c,JSON[_0xf713('0x10')](_0x5ce88c));_0x37d72c(_0x5ce88c);})[_0xf713('0x15')](function(_0x4396d7){logger[_0xf713('0x11')]('ShowSalesforceAccount',_0x4396d7[_0xf713('0x13')],_0x5f204c);_0x464a11(_0x2c7429[_0xf713('0x11')](0x1f4,_0x4396d7['message']));});});}; \ No newline at end of file +var _0xfe7d=['http','request','then','info','SalesforceAccount,\x20%s,\x20%s','SalesforceAccount,\x20%s,\x20%s,\x20%s','error','code','message','request\x20sent','result','catch','GetSalesforceAccount','SalesforceAccount','findAll','options','raw','where','limit','include','map','model','attributes','debug','stringify','ShowSalesforceAccount','find','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','client'];(function(_0x3b380d,_0x4bf247){var _0x54502b=function(_0x35d207){while(--_0x35d207){_0x3b380d['push'](_0x3b380d['shift']());}};_0x54502b(++_0x4bf247);}(_0xfe7d,0x197));var _0xdfe7=function(_0x33a694,_0x9b6640){_0x33a694=_0x33a694-0x0;var _0x41ff01=_0xfe7d[_0x33a694];return _0x41ff01;};'use strict';var _=require(_0xdfe7('0x0'));var util=require(_0xdfe7('0x1'));var moment=require(_0xdfe7('0x2'));var BPromise=require(_0xdfe7('0x3'));var rs=require(_0xdfe7('0x4'));var fs=require('fs');var Redis=require(_0xdfe7('0x5'));var db=require(_0xdfe7('0x6'))['db'];var utils=require(_0xdfe7('0x7'));var logger=require(_0xdfe7('0x8'))(_0xdfe7('0x9'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0xdfe7('0xa')][_0xdfe7('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x2d7f3c,_0x2eb0b9,_0x5210e2){return new BPromise(function(_0x4c0785,_0x59d469){return client[_0xdfe7('0xc')](_0x2d7f3c,_0x5210e2)[_0xdfe7('0xd')](function(_0x4822e8){logger[_0xdfe7('0xe')](_0xdfe7('0xf'),_0x2eb0b9,'request\x20sent');logger['debug'](_0xdfe7('0x10'),_0x2eb0b9,'request\x20sent',JSON['stringify'](_0x4822e8));if(_0x4822e8[_0xdfe7('0x11')]){if(_0x4822e8[_0xdfe7('0x11')][_0xdfe7('0x12')]===0x1f4){logger[_0xdfe7('0x11')](_0xdfe7('0xf'),_0x2eb0b9,_0x4822e8[_0xdfe7('0x11')][_0xdfe7('0x13')]);return _0x59d469(_0x4822e8[_0xdfe7('0x11')][_0xdfe7('0x13')]);}logger[_0xdfe7('0x11')](_0xdfe7('0xf'),_0x2eb0b9,_0x4822e8[_0xdfe7('0x11')][_0xdfe7('0x13')]);return _0x4c0785(_0x4822e8['error'][_0xdfe7('0x13')]);}else{logger[_0xdfe7('0xe')](_0xdfe7('0xf'),_0x2eb0b9,_0xdfe7('0x14'));_0x4c0785(_0x4822e8[_0xdfe7('0x15')][_0xdfe7('0x13')]);}})[_0xdfe7('0x16')](function(_0x580c62){logger[_0xdfe7('0x11')](_0xdfe7('0xf'),_0x2eb0b9,_0x580c62);_0x59d469(_0x580c62);});});}exports[_0xdfe7('0x17')]=function(_0x3ba2a7){var _0x5a4529=this;return new Promise(function(_0x5e317a,_0x115221){return db[_0xdfe7('0x18')][_0xdfe7('0x19')]({'raw':_0x3ba2a7[_0xdfe7('0x1a')]?_0x3ba2a7[_0xdfe7('0x1a')][_0xdfe7('0x1b')]===undefined?!![]:![]:!![],'where':_0x3ba2a7[_0xdfe7('0x1a')]?_0x3ba2a7[_0xdfe7('0x1a')][_0xdfe7('0x1c')]||null:null,'attributes':_0x3ba2a7[_0xdfe7('0x1a')]?_0x3ba2a7[_0xdfe7('0x1a')]['attributes']||null:null,'limit':_0x3ba2a7[_0xdfe7('0x1a')]?_0x3ba2a7[_0xdfe7('0x1a')][_0xdfe7('0x1d')]||null:null,'include':_0x3ba2a7[_0xdfe7('0x1a')]?_0x3ba2a7[_0xdfe7('0x1a')][_0xdfe7('0x1e')]?_[_0xdfe7('0x1f')](_0x3ba2a7[_0xdfe7('0x1a')][_0xdfe7('0x1e')],function(_0x4dbf1b){return{'model':db[_0x4dbf1b[_0xdfe7('0x20')]],'as':_0x4dbf1b['as'],'attributes':_0x4dbf1b[_0xdfe7('0x21')],'include':_0x4dbf1b[_0xdfe7('0x1e')]?_[_0xdfe7('0x1f')](_0x4dbf1b[_0xdfe7('0x1e')],function(_0x1700d5){return{'model':db[_0x1700d5[_0xdfe7('0x20')]],'as':_0x1700d5['as'],'attributes':_0x1700d5['attributes'],'include':_0x1700d5[_0xdfe7('0x1e')]?_['map'](_0x1700d5['include'],function(_0x536c69){return{'model':db[_0x536c69['model']],'as':_0x536c69['as'],'attributes':_0x536c69[_0xdfe7('0x21')]};}):[]};}):[]};}):[]:[]})[_0xdfe7('0xd')](function(_0x54a5e9){logger[_0xdfe7('0xe')](_0xdfe7('0x17'),_0x3ba2a7);logger[_0xdfe7('0x22')](_0xdfe7('0x17'),_0x3ba2a7,JSON[_0xdfe7('0x23')](_0x54a5e9));_0x5e317a(_0x54a5e9);})[_0xdfe7('0x16')](function(_0x2a115e){logger[_0xdfe7('0x11')](_0xdfe7('0x17'),_0x2a115e[_0xdfe7('0x13')],_0x3ba2a7);_0x115221(_0x5a4529['error'](0x1f4,_0x2a115e['message']));});});};exports[_0xdfe7('0x24')]=function(_0x1956a2){var _0x165d8c=this;return new Promise(function(_0x67e41a,_0x2c42b8){return db[_0xdfe7('0x18')][_0xdfe7('0x25')]({'raw':_0x1956a2['options']?_0x1956a2[_0xdfe7('0x1a')][_0xdfe7('0x1b')]===undefined?!![]:![]:!![],'where':_0x1956a2['options']?_0x1956a2[_0xdfe7('0x1a')]['where']||null:null,'attributes':_0x1956a2[_0xdfe7('0x1a')]?_0x1956a2[_0xdfe7('0x1a')]['attributes']||null:null,'include':_0x1956a2[_0xdfe7('0x1a')]?_0x1956a2[_0xdfe7('0x1a')][_0xdfe7('0x1e')]?_[_0xdfe7('0x1f')](_0x1956a2['options'][_0xdfe7('0x1e')],function(_0x4b2988){return{'model':db[_0x4b2988[_0xdfe7('0x20')]],'as':_0x4b2988['as'],'attributes':_0x4b2988['attributes'],'include':_0x4b2988[_0xdfe7('0x1e')]?_[_0xdfe7('0x1f')](_0x4b2988[_0xdfe7('0x1e')],function(_0x3b01a4){return{'model':db[_0x3b01a4['model']],'as':_0x3b01a4['as'],'attributes':_0x3b01a4[_0xdfe7('0x21')],'include':_0x3b01a4[_0xdfe7('0x1e')]?_[_0xdfe7('0x1f')](_0x3b01a4[_0xdfe7('0x1e')],function(_0x4b04d5){return{'model':db[_0x4b04d5[_0xdfe7('0x20')]],'as':_0x4b04d5['as'],'attributes':_0x4b04d5[_0xdfe7('0x21')]};}):[]};}):[]};}):[]:[]})[_0xdfe7('0xd')](function(_0x3def28){logger[_0xdfe7('0xe')]('ShowSalesforceAccount',_0x1956a2);logger[_0xdfe7('0x22')](_0xdfe7('0x24'),_0x1956a2,JSON[_0xdfe7('0x23')](_0x3def28));_0x67e41a(_0x3def28);})[_0xdfe7('0x16')](function(_0x1830e7){logger[_0xdfe7('0x11')](_0xdfe7('0x24'),_0x1830e7[_0xdfe7('0x13')],_0x1956a2);_0x2c42b8(_0x165d8c[_0xdfe7('0x11')](0x1f4,_0x1830e7[_0xdfe7('0x13')]));});});}; \ No newline at end of file diff --git a/server/api/intSalesforceConfiguration/index.js b/server/api/intSalesforceConfiguration/index.js index 0a9b24b..fb86b5b 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 _0x2032=['Router','fs-extra','../../components/interaction/service','../../config/environment','./intSalesforceConfiguration.controller','get','isAuthenticated','index','/:id','show','getFields','/:id/subjects','getSubjects','/:id/descriptions','getDescriptions','create','exports','util','path','connect-timeout'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0x2032,0xd9));var _0x2203=function(_0x12c713,_0x36343c){_0x12c713=_0x12c713-0x0;var _0x3e1ece=_0x2032[_0x12c713];return _0x3e1ece;};'use strict';var multer=require('multer');var util=require(_0x2203('0x0'));var path=require(_0x2203('0x1'));var timeout=require(_0x2203('0x2'));var express=require('express');var router=express[_0x2203('0x3')]();var fs_extra=require(_0x2203('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0x2203('0x5'));var config=require(_0x2203('0x6'));var controller=require(_0x2203('0x7'));router[_0x2203('0x8')]('/',auth[_0x2203('0x9')](),controller[_0x2203('0xa')]);router[_0x2203('0x8')](_0x2203('0xb'),auth[_0x2203('0x9')](),controller[_0x2203('0xc')]);router[_0x2203('0x8')]('/:id/fields',auth['isAuthenticated'](),controller[_0x2203('0xd')]);router['get'](_0x2203('0xe'),auth[_0x2203('0x9')](),controller[_0x2203('0xf')]);router['get'](_0x2203('0x10'),auth['isAuthenticated'](),controller[_0x2203('0x11')]);router['post']('/',auth[_0x2203('0x9')](),controller[_0x2203('0x12')]);router['put']('/:id',auth['isAuthenticated'](),controller['update']);router['delete'](_0x2203('0xb'),auth['isAuthenticated'](),controller['destroy']);module[_0x2203('0x13')]=router; \ No newline at end of file +var _0x0b0e=['post','create','put','/:id','update','destroy','exports','multer','path','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./intSalesforceConfiguration.controller','get','isAuthenticated','index','show','/:id/fields','/:id/subjects','getSubjects','getDescriptions'];(function(_0x4b174a,_0x33a017){var _0x3cd7bf=function(_0x44ccd9){while(--_0x44ccd9){_0x4b174a['push'](_0x4b174a['shift']());}};_0x3cd7bf(++_0x33a017);}(_0x0b0e,0x187));var _0xe0b0=function(_0x5adb18,_0x222326){_0x5adb18=_0x5adb18-0x0;var _0x420c98=_0x0b0e[_0x5adb18];return _0x420c98;};'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['getFields']);router[_0xe0b0('0x9')](_0xe0b0('0xe'),auth['isAuthenticated'](),controller[_0xe0b0('0xf')]);router[_0xe0b0('0x9')]('/:id/descriptions',auth[_0xe0b0('0xa')](),controller[_0xe0b0('0x10')]);router[_0xe0b0('0x11')]('/',auth['isAuthenticated'](),controller[_0xe0b0('0x12')]);router[_0xe0b0('0x13')](_0xe0b0('0x14'),auth[_0xe0b0('0xa')](),controller[_0xe0b0('0x15')]);router['delete'](_0xe0b0('0x14'),auth[_0xe0b0('0xa')](),controller[_0xe0b0('0x16')]);module[_0xe0b0('0x17')]=router; \ No newline at end of file diff --git a/server/api/intSalesforceConfiguration/intSalesforceConfiguration.attributes.js b/server/api/intSalesforceConfiguration/intSalesforceConfiguration.attributes.js index 4bcb985..59954d7 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 _0x185f=['STRING','ENUM','Task','Case','contact_lead','contact','lead','account_contact_lead','account','nothing'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x185f,0x1a4));var _0xf185=function(_0x24f988,_0x515e43){_0x24f988=_0x24f988-0x0;var _0x2377b1=_0x185f[_0x24f988];return _0x2377b1;};'use strict';var Sequelize=require('sequelize');module['exports']={'name':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0xf185('0x0')]},'ticketType':{'type':Sequelize[_0xf185('0x1')](_0xf185('0x2'),_0xf185('0x3')),'defaultValue':_0xf185('0x2')},'moduleSearch':{'type':Sequelize['ENUM'](_0xf185('0x4'),_0xf185('0x5'),_0xf185('0x6'),_0xf185('0x7'),_0xf185('0x8')),'defaultValue':_0xf185('0x4')},'moduleCreate':{'type':Sequelize['ENUM'](_0xf185('0x9'),_0xf185('0x5'),_0xf185('0x6'),_0xf185('0x8')),'defaultValue':_0xf185('0x6')},'leadId':{'type':Sequelize['STRING']},'additionalSearchAccount':{'type':Sequelize[_0xf185('0x0')]},'additionalSearchContact':{'type':Sequelize['STRING']},'additionalSearchLead':{'type':Sequelize[_0xf185('0x0')]}}; \ No newline at end of file +var _0x3338=['STRING','ENUM','Case','Task','contact_lead','contact','account_contact_lead','account','nothing','lead','sequelize','exports'];(function(_0x202c6c,_0x48c352){var _0x1fbd76=function(_0x14d3bb){while(--_0x14d3bb){_0x202c6c['push'](_0x202c6c['shift']());}};_0x1fbd76(++_0x48c352);}(_0x3338,0xfa));var _0x8333=function(_0x19c1c8,_0x2f0b5d){_0x19c1c8=_0x19c1c8-0x0;var _0x39a68a=_0x3338[_0x19c1c8];return _0x39a68a;};'use strict';var Sequelize=require(_0x8333('0x0'));module[_0x8333('0x1')]={'name':{'type':Sequelize[_0x8333('0x2')]},'description':{'type':Sequelize[_0x8333('0x2')]},'ticketType':{'type':Sequelize[_0x8333('0x3')]('Task',_0x8333('0x4')),'defaultValue':_0x8333('0x5')},'moduleSearch':{'type':Sequelize[_0x8333('0x3')](_0x8333('0x6'),_0x8333('0x7'),'lead',_0x8333('0x8'),_0x8333('0x9')),'defaultValue':_0x8333('0x6')},'moduleCreate':{'type':Sequelize[_0x8333('0x3')](_0x8333('0xa'),'contact',_0x8333('0xb'),'account'),'defaultValue':_0x8333('0xb')},'leadId':{'type':Sequelize[_0x8333('0x2')]},'additionalSearchAccount':{'type':Sequelize[_0x8333('0x2')]},'additionalSearchContact':{'type':Sequelize[_0x8333('0x2')]},'additionalSearchLead':{'type':Sequelize['STRING']}}; \ No newline at end of file diff --git a/server/api/intSalesforceConfiguration/intSalesforceConfiguration.controller.js b/server/api/intSalesforceConfiguration/intSalesforceConfiguration.controller.js index b484c01..fd2aa71 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 _0xed23=['json','undefined','limit','offset','count','Content-Range','apply','reject','save','then','sendStatus','error','name','send','index','map','SalesforceConfiguration','rawAttributes','fieldName','key','keys','filters','intersection','model','query','fields','attributes','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','type','VIRTUAL','include','findAll','show','includeAll','options','find','create','body','catch','destroy','getFields','findOne','params','SalesforceField','length','getSubjects','getDescriptions','eml-format','rimraf','fast-json-patch','request-promise','bluebird','mustache','util','sox','to-csv','fs-extra','lodash','squel','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/environment','../../config/license/util','status','end'];(function(_0x28f99c,_0xfdc16c){var _0x423678=function(_0x4b55c4){while(--_0x4b55c4){_0x28f99c['push'](_0x28f99c['shift']());}};_0x423678(++_0xfdc16c);}(_0xed23,0x172));var _0x3ed2=function(_0x21eaff,_0x329825){_0x21eaff=_0x21eaff-0x0;var _0x5ac009=_0xed23[_0x21eaff];return _0x5ac009;};'use strict';var emlformat=require(_0x3ed2('0x0'));var rimraf=require(_0x3ed2('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x3ed2('0x2'));var rp=require(_0x3ed2('0x3'));var moment=require('moment');var BPromise=require(_0x3ed2('0x4'));var Mustache=require(_0x3ed2('0x5'));var util=require(_0x3ed2('0x6'));var path=require('path');var sox=require(_0x3ed2('0x7'));var csv=require(_0x3ed2('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x3ed2('0x9'));var _=require(_0x3ed2('0xa'));var squel=require(_0x3ed2('0xb'));var crypto=require('crypto');var jsforce=require(_0x3ed2('0xc'));var deskjs=require(_0x3ed2('0xd'));var toCsv=require(_0x3ed2('0x8'));var querystring=require(_0x3ed2('0xe'));var Papa=require('papaparse');var Redis=require(_0x3ed2('0xf'));var authService=require(_0x3ed2('0x10'));var qs=require(_0x3ed2('0x11'));var as=require(_0x3ed2('0x12'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x3ed2('0x13'))(_0x3ed2('0x14'));var utils=require('../../config/utils');var config=require(_0x3ed2('0x15'));var licenseUtil=require(_0x3ed2('0x16'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x4d7c1e,_0x46f308){_0x46f308=_0x46f308||0xcc;return function(_0x473aff){if(_0x473aff){return _0x4d7c1e['sendStatus'](_0x46f308);}return _0x4d7c1e[_0x3ed2('0x17')](_0x46f308)[_0x3ed2('0x18')]();};}function respondWithResult(_0x155e1e,_0xf10005){_0xf10005=_0xf10005||0xc8;return function(_0x48de98){if(_0x48de98){return _0x155e1e['status'](_0xf10005)[_0x3ed2('0x19')](_0x48de98);}};}function respondWithFilteredResult(_0x54f9ac,_0x3878ff){return function(_0x3e5d39){if(_0x3e5d39){var _0x1a69df=typeof _0x3878ff['offset']===_0x3ed2('0x1a')&&typeof _0x3878ff[_0x3ed2('0x1b')]==='undefined';var _0x463448=_0x3e5d39['count'];var _0x96d818=_0x1a69df?0x0:_0x3878ff[_0x3ed2('0x1c')];var _0x3cc3d9=_0x1a69df?_0x3e5d39[_0x3ed2('0x1d')]:_0x3878ff[_0x3ed2('0x1c')]+_0x3878ff['limit'];var _0x164ab2;if(_0x3cc3d9>=_0x463448){_0x3cc3d9=_0x463448;_0x164ab2=0xc8;}else{_0x164ab2=0xce;}_0x54f9ac[_0x3ed2('0x17')](_0x164ab2);return _0x54f9ac['set'](_0x3ed2('0x1e'),_0x96d818+'-'+_0x3cc3d9+'/'+_0x463448)[_0x3ed2('0x19')](_0x3e5d39);}return null;};}function patchUpdates(_0x28c2fb){return function(_0x30af6e){try{jsonpatch[_0x3ed2('0x1f')](_0x30af6e,_0x28c2fb,!![]);}catch(_0x29d2a5){return BPromise[_0x3ed2('0x20')](_0x29d2a5);}return _0x30af6e[_0x3ed2('0x21')]();};}function saveUpdates(_0x38d7e2,_0x199b62){return function(_0x172f8a){if(_0x172f8a){return _0x172f8a['update'](_0x38d7e2)['then'](function(_0x1ae760){return _0x1ae760;});}return null;};}function removeEntity(_0x187097,_0x5df78e){return function(_0x3873c5){if(_0x3873c5){return _0x3873c5['destroy']()[_0x3ed2('0x22')](function(){_0x187097[_0x3ed2('0x17')](0xcc)['end']();});}};}function handleEntityNotFound(_0x138ec8,_0x411c5f){return function(_0x77925e){if(!_0x77925e){_0x138ec8[_0x3ed2('0x23')](0x194);}return _0x77925e;};}function handleError(_0xc112d7,_0x13d04e){_0x13d04e=_0x13d04e||0x1f4;return function(_0x5f482c){logger[_0x3ed2('0x24')](_0x5f482c['stack']);if(_0x5f482c['name']){delete _0x5f482c[_0x3ed2('0x25')];}_0xc112d7['status'](_0x13d04e)[_0x3ed2('0x26')](_0x5f482c);};}exports[_0x3ed2('0x27')]=function(_0x1eddda,_0x29e131){var _0x26b7d7={},_0x1c5d47={},_0x5e558e={'count':0x0,'rows':[]};var _0x4edd42=_[_0x3ed2('0x28')](db[_0x3ed2('0x29')][_0x3ed2('0x2a')],function(_0x1480bb){return{'name':_0x1480bb[_0x3ed2('0x2b')],'type':_0x1480bb['type'][_0x3ed2('0x2c')]};});_0x1c5d47['model']=_[_0x3ed2('0x28')](_0x4edd42,_0x3ed2('0x25'));_0x1c5d47['query']=_[_0x3ed2('0x2d')](_0x1eddda['query']);_0x1c5d47[_0x3ed2('0x2e')]=_[_0x3ed2('0x2f')](_0x1c5d47[_0x3ed2('0x30')],_0x1c5d47['query']);_0x26b7d7['attributes']=_[_0x3ed2('0x2f')](_0x1c5d47[_0x3ed2('0x30')],qs['fields'](_0x1eddda[_0x3ed2('0x31')][_0x3ed2('0x32')]));_0x26b7d7[_0x3ed2('0x33')]=_0x26b7d7[_0x3ed2('0x33')]['length']?_0x26b7d7[_0x3ed2('0x33')]:_0x1c5d47[_0x3ed2('0x30')];if(!_0x1eddda['query'][_0x3ed2('0x34')](_0x3ed2('0x35'))){_0x26b7d7[_0x3ed2('0x1b')]=qs['limit'](_0x1eddda[_0x3ed2('0x31')]['limit']);_0x26b7d7['offset']=qs[_0x3ed2('0x1c')](_0x1eddda[_0x3ed2('0x31')][_0x3ed2('0x1c')]);}_0x26b7d7[_0x3ed2('0x36')]=qs[_0x3ed2('0x37')](_0x1eddda['query'][_0x3ed2('0x37')]);_0x26b7d7[_0x3ed2('0x38')]=qs[_0x3ed2('0x2e')](_[_0x3ed2('0x39')](_0x1eddda[_0x3ed2('0x31')],_0x1c5d47[_0x3ed2('0x2e')]),_0x4edd42);if(_0x1eddda['query'][_0x3ed2('0x3a')]){_0x26b7d7[_0x3ed2('0x38')]=_[_0x3ed2('0x3b')](_0x26b7d7[_0x3ed2('0x38')],{'$or':_[_0x3ed2('0x28')](_0x4edd42,function(_0x5ec9a1){if(_0x5ec9a1[_0x3ed2('0x3c')]!==_0x3ed2('0x3d')){var _0x373eb1={};_0x373eb1[_0x5ec9a1[_0x3ed2('0x25')]]={'$like':'%'+_0x1eddda['query'][_0x3ed2('0x3a')]+'%'};return _0x373eb1;}})});}_0x26b7d7=_[_0x3ed2('0x3b')]({},_0x26b7d7,_0x1eddda['options']);var _0x3ab47c={'where':_0x26b7d7['where']};return db[_0x3ed2('0x29')][_0x3ed2('0x1d')](_0x3ab47c)[_0x3ed2('0x22')](function(_0x457286){_0x5e558e[_0x3ed2('0x1d')]=_0x457286;if(_0x1eddda[_0x3ed2('0x31')]['includeAll']){_0x26b7d7[_0x3ed2('0x3e')]=[{'all':!![]}];}return db['SalesforceConfiguration'][_0x3ed2('0x3f')](_0x26b7d7);})[_0x3ed2('0x22')](function(_0x258d9d){_0x5e558e['rows']=_0x258d9d;return _0x5e558e;})[_0x3ed2('0x22')](respondWithFilteredResult(_0x29e131,_0x26b7d7))['catch'](handleError(_0x29e131,null));};exports[_0x3ed2('0x40')]=function(_0x25caf0,_0x43d409){var _0x5e9457={'raw':![],'where':{'id':_0x25caf0['params']['id']}},_0x283a87={};_0x283a87[_0x3ed2('0x30')]=_[_0x3ed2('0x2d')](db[_0x3ed2('0x29')][_0x3ed2('0x2a')]);_0x283a87[_0x3ed2('0x31')]=_[_0x3ed2('0x2d')](_0x25caf0[_0x3ed2('0x31')]);_0x283a87[_0x3ed2('0x2e')]=_[_0x3ed2('0x2f')](_0x283a87[_0x3ed2('0x30')],_0x283a87[_0x3ed2('0x31')]);_0x5e9457[_0x3ed2('0x33')]=_[_0x3ed2('0x2f')](_0x283a87[_0x3ed2('0x30')],qs[_0x3ed2('0x32')](_0x25caf0[_0x3ed2('0x31')][_0x3ed2('0x32')]));_0x5e9457[_0x3ed2('0x33')]=_0x5e9457[_0x3ed2('0x33')]['length']?_0x5e9457['attributes']:_0x283a87['model'];if(_0x25caf0[_0x3ed2('0x31')][_0x3ed2('0x41')]){_0x5e9457[_0x3ed2('0x3e')]=[{'all':!![]}];}_0x5e9457=_[_0x3ed2('0x3b')]({},_0x5e9457,_0x25caf0[_0x3ed2('0x42')]);return db[_0x3ed2('0x29')][_0x3ed2('0x43')](_0x5e9457)['then'](handleEntityNotFound(_0x43d409,null))['then'](respondWithResult(_0x43d409,null))['catch'](handleError(_0x43d409,null));};exports[_0x3ed2('0x44')]=function(_0x1a25a0,_0x4de105){return db[_0x3ed2('0x29')][_0x3ed2('0x44')](_0x1a25a0[_0x3ed2('0x45')],{})[_0x3ed2('0x22')](respondWithResult(_0x4de105,0xc9))[_0x3ed2('0x46')](handleError(_0x4de105,null));};exports['update']=function(_0x595bf8,_0x2c53b2){if(_0x595bf8[_0x3ed2('0x45')]['id']){delete _0x595bf8[_0x3ed2('0x45')]['id'];}return db[_0x3ed2('0x29')][_0x3ed2('0x43')]({'where':{'id':_0x595bf8['params']['id']}})[_0x3ed2('0x22')](handleEntityNotFound(_0x2c53b2,null))[_0x3ed2('0x22')](saveUpdates(_0x595bf8[_0x3ed2('0x45')],null))[_0x3ed2('0x22')](respondWithResult(_0x2c53b2,null))[_0x3ed2('0x46')](handleError(_0x2c53b2,null));};exports[_0x3ed2('0x47')]=function(_0x429822,_0x466a63){return db[_0x3ed2('0x29')][_0x3ed2('0x43')]({'where':{'id':_0x429822['params']['id']}})[_0x3ed2('0x22')](handleEntityNotFound(_0x466a63,null))['then'](removeEntity(_0x466a63,null))[_0x3ed2('0x46')](handleError(_0x466a63,null));};exports[_0x3ed2('0x48')]=function(_0x29ee3e,_0x1f202f,_0x4e60d7){var _0x1ddd53={};var _0x1bbe5e={};var _0x110368;var _0x2bcfe9;return db[_0x3ed2('0x29')][_0x3ed2('0x49')]({'where':{'id':_0x29ee3e[_0x3ed2('0x4a')]['id']}})['then'](handleEntityNotFound(_0x1f202f,null))['then'](function(_0x55043d){if(_0x55043d){_0x110368=_0x55043d;_0x1bbe5e['model']=_[_0x3ed2('0x2d')](db[_0x3ed2('0x4b')][_0x3ed2('0x2a')]);_0x1bbe5e[_0x3ed2('0x31')]=_['keys'](_0x29ee3e[_0x3ed2('0x31')]);_0x1bbe5e['filters']=_[_0x3ed2('0x2f')](_0x1bbe5e[_0x3ed2('0x30')],_0x1bbe5e['query']);_0x1ddd53['attributes']=_[_0x3ed2('0x2f')](_0x1bbe5e[_0x3ed2('0x30')],qs[_0x3ed2('0x32')](_0x29ee3e[_0x3ed2('0x31')][_0x3ed2('0x32')]));_0x1ddd53[_0x3ed2('0x33')]=_0x1ddd53[_0x3ed2('0x33')][_0x3ed2('0x4c')]?_0x1ddd53[_0x3ed2('0x33')]:_0x1bbe5e['model'];_0x1ddd53[_0x3ed2('0x36')]=qs[_0x3ed2('0x37')](_0x29ee3e[_0x3ed2('0x31')][_0x3ed2('0x37')]);_0x1ddd53[_0x3ed2('0x38')]=qs[_0x3ed2('0x2e')](_[_0x3ed2('0x39')](_0x29ee3e['query'],_0x1bbe5e[_0x3ed2('0x2e')]));if(_0x29ee3e[_0x3ed2('0x31')][_0x3ed2('0x3a')]){_0x1ddd53[_0x3ed2('0x38')]=_['merge'](_0x1ddd53['where'],{'$or':_['map'](_0x1ddd53[_0x3ed2('0x33')],function(_0x5ee20a){var _0x46f1c1={};_0x46f1c1[_0x5ee20a]={'$like':'%'+_0x29ee3e[_0x3ed2('0x31')][_0x3ed2('0x3a')]+'%'};return _0x46f1c1;})});}_0x1ddd53=_[_0x3ed2('0x3b')]({},_0x1ddd53,_0x29ee3e[_0x3ed2('0x42')]);return _0x110368[_0x3ed2('0x48')](_0x1ddd53);}})['then'](function(_0x4d92e3){if(_0x4d92e3){_0x2bcfe9=_0x4d92e3[_0x3ed2('0x4c')];if(!_0x29ee3e['query']['hasOwnProperty'](_0x3ed2('0x35'))){_0x1ddd53[_0x3ed2('0x1b')]=qs[_0x3ed2('0x1b')](_0x29ee3e[_0x3ed2('0x31')][_0x3ed2('0x1b')]);_0x1ddd53['offset']=qs[_0x3ed2('0x1c')](_0x29ee3e['query'][_0x3ed2('0x1c')]);}return _0x110368['getFields'](_0x1ddd53);}})['then'](function(_0x23712e){if(_0x23712e){return _0x23712e?{'count':_0x2bcfe9,'rows':_0x23712e}:null;}})[_0x3ed2('0x22')](respondWithResult(_0x1f202f,null))[_0x3ed2('0x46')](handleError(_0x1f202f,null));};exports[_0x3ed2('0x4d')]=function(_0x464a8f,_0x1f3427,_0x1c26df){var _0x3cec46={};var _0x3c2c08={};var _0x53b611;var _0x4d76eb;return db['SalesforceConfiguration']['findOne']({'where':{'id':_0x464a8f[_0x3ed2('0x4a')]['id']}})[_0x3ed2('0x22')](handleEntityNotFound(_0x1f3427,null))['then'](function(_0x2c1982){if(_0x2c1982){_0x53b611=_0x2c1982;_0x3c2c08[_0x3ed2('0x30')]=_[_0x3ed2('0x2d')](db[_0x3ed2('0x4b')][_0x3ed2('0x2a')]);_0x3c2c08[_0x3ed2('0x31')]=_[_0x3ed2('0x2d')](_0x464a8f[_0x3ed2('0x31')]);_0x3c2c08[_0x3ed2('0x2e')]=_['intersection'](_0x3c2c08[_0x3ed2('0x30')],_0x3c2c08['query']);_0x3cec46[_0x3ed2('0x33')]=_['intersection'](_0x3c2c08[_0x3ed2('0x30')],qs['fields'](_0x464a8f[_0x3ed2('0x31')][_0x3ed2('0x32')]));_0x3cec46[_0x3ed2('0x33')]=_0x3cec46[_0x3ed2('0x33')]['length']?_0x3cec46[_0x3ed2('0x33')]:_0x3c2c08[_0x3ed2('0x30')];_0x3cec46[_0x3ed2('0x36')]=qs['sort'](_0x464a8f['query'][_0x3ed2('0x37')]);_0x3cec46[_0x3ed2('0x38')]=qs[_0x3ed2('0x2e')](_['pick'](_0x464a8f['query'],_0x3c2c08['filters']));if(_0x464a8f[_0x3ed2('0x31')][_0x3ed2('0x3a')]){_0x3cec46[_0x3ed2('0x38')]=_[_0x3ed2('0x3b')](_0x3cec46['where'],{'$or':_[_0x3ed2('0x28')](_0x3cec46[_0x3ed2('0x33')],function(_0x21e7f2){var _0x36c525={};_0x36c525[_0x21e7f2]={'$like':'%'+_0x464a8f['query'][_0x3ed2('0x3a')]+'%'};return _0x36c525;})});}_0x3cec46=_[_0x3ed2('0x3b')]({},_0x3cec46,_0x464a8f[_0x3ed2('0x42')]);return _0x53b611[_0x3ed2('0x4d')](_0x3cec46);}})[_0x3ed2('0x22')](function(_0x2c5bfa){if(_0x2c5bfa){_0x4d76eb=_0x2c5bfa[_0x3ed2('0x4c')];if(!_0x464a8f[_0x3ed2('0x31')][_0x3ed2('0x34')](_0x3ed2('0x35'))){_0x3cec46[_0x3ed2('0x1b')]=qs[_0x3ed2('0x1b')](_0x464a8f[_0x3ed2('0x31')][_0x3ed2('0x1b')]);_0x3cec46[_0x3ed2('0x1c')]=qs[_0x3ed2('0x1c')](_0x464a8f[_0x3ed2('0x31')][_0x3ed2('0x1c')]);}return _0x53b611['getSubjects'](_0x3cec46);}})[_0x3ed2('0x22')](function(_0x6d139a){if(_0x6d139a){return _0x6d139a?{'count':_0x4d76eb,'rows':_0x6d139a}:null;}})[_0x3ed2('0x22')](respondWithResult(_0x1f3427,null))[_0x3ed2('0x46')](handleError(_0x1f3427,null));};exports[_0x3ed2('0x4e')]=function(_0x1f6fea,_0x21018f,_0xf70180){var _0x3a1a58={};var _0x1f8487={};var _0x2e5be2;var _0x5d5231;return db[_0x3ed2('0x29')][_0x3ed2('0x49')]({'where':{'id':_0x1f6fea[_0x3ed2('0x4a')]['id']}})[_0x3ed2('0x22')](handleEntityNotFound(_0x21018f,null))['then'](function(_0x35d9a3){if(_0x35d9a3){_0x2e5be2=_0x35d9a3;_0x1f8487[_0x3ed2('0x30')]=_['keys'](db[_0x3ed2('0x4b')][_0x3ed2('0x2a')]);_0x1f8487['query']=_[_0x3ed2('0x2d')](_0x1f6fea['query']);_0x1f8487[_0x3ed2('0x2e')]=_[_0x3ed2('0x2f')](_0x1f8487[_0x3ed2('0x30')],_0x1f8487['query']);_0x3a1a58['attributes']=_[_0x3ed2('0x2f')](_0x1f8487[_0x3ed2('0x30')],qs[_0x3ed2('0x32')](_0x1f6fea[_0x3ed2('0x31')][_0x3ed2('0x32')]));_0x3a1a58[_0x3ed2('0x33')]=_0x3a1a58[_0x3ed2('0x33')][_0x3ed2('0x4c')]?_0x3a1a58[_0x3ed2('0x33')]:_0x1f8487[_0x3ed2('0x30')];_0x3a1a58[_0x3ed2('0x36')]=qs[_0x3ed2('0x37')](_0x1f6fea[_0x3ed2('0x31')][_0x3ed2('0x37')]);_0x3a1a58['where']=qs[_0x3ed2('0x2e')](_['pick'](_0x1f6fea[_0x3ed2('0x31')],_0x1f8487[_0x3ed2('0x2e')]));if(_0x1f6fea[_0x3ed2('0x31')][_0x3ed2('0x3a')]){_0x3a1a58[_0x3ed2('0x38')]=_['merge'](_0x3a1a58[_0x3ed2('0x38')],{'$or':_[_0x3ed2('0x28')](_0x3a1a58[_0x3ed2('0x33')],function(_0x7a7b92){var _0x13b384={};_0x13b384[_0x7a7b92]={'$like':'%'+_0x1f6fea[_0x3ed2('0x31')][_0x3ed2('0x3a')]+'%'};return _0x13b384;})});}_0x3a1a58=_[_0x3ed2('0x3b')]({},_0x3a1a58,_0x1f6fea['options']);return _0x2e5be2['getDescriptions'](_0x3a1a58);}})['then'](function(_0x4c7865){if(_0x4c7865){_0x5d5231=_0x4c7865[_0x3ed2('0x4c')];if(!_0x1f6fea[_0x3ed2('0x31')][_0x3ed2('0x34')](_0x3ed2('0x35'))){_0x3a1a58[_0x3ed2('0x1b')]=qs[_0x3ed2('0x1b')](_0x1f6fea[_0x3ed2('0x31')][_0x3ed2('0x1b')]);_0x3a1a58[_0x3ed2('0x1c')]=qs['offset'](_0x1f6fea[_0x3ed2('0x31')]['offset']);}return _0x2e5be2['getDescriptions'](_0x3a1a58);}})[_0x3ed2('0x22')](function(_0x369527){if(_0x369527){return _0x369527?{'count':_0x5d5231,'rows':_0x369527}:null;}})['then'](respondWithResult(_0x21018f,null))[_0x3ed2('0x46')](handleError(_0x21018f,null));}; \ No newline at end of file +var _0xee26=['request-promise','moment','bluebird','util','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','json','offset','undefined','limit','count','set','Content-Range','apply','save','update','then','destroy','end','error','stack','name','index','map','type','key','model','query','keys','filters','intersection','fields','attributes','length','hasOwnProperty','sort','where','pick','filter','merge','VIRTUAL','options','SalesforceConfiguration','includeAll','include','rows','catch','show','params','find','create','body','findOne','SalesforceField','order','nolimit','getFields','getSubjects','rawAttributes','getDescriptions','rimraf','zip-dir'];(function(_0x2d5fa4,_0x43d64a){var _0x2cc27b=function(_0x4d8656){while(--_0x4d8656){_0x2d5fa4['push'](_0x2d5fa4['shift']());}};_0x2cc27b(++_0x43d64a);}(_0xee26,0x9c));var _0x6ee2=function(_0x462a4d,_0x1fd3ec){_0x462a4d=_0x462a4d-0x0;var _0x52a053=_0xee26[_0x462a4d];return _0x52a053;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x6ee2('0x0'));var zipdir=require(_0x6ee2('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0x6ee2('0x2'));var moment=require(_0x6ee2('0x3'));var BPromise=require(_0x6ee2('0x4'));var Mustache=require('mustache');var util=require(_0x6ee2('0x5'));var path=require('path');var sox=require(_0x6ee2('0x6'));var csv=require(_0x6ee2('0x7'));var ejs=require(_0x6ee2('0x8'));var fs=require('fs');var fs_extra=require(_0x6ee2('0x9'));var _=require(_0x6ee2('0xa'));var squel=require(_0x6ee2('0xb'));var crypto=require(_0x6ee2('0xc'));var jsforce=require(_0x6ee2('0xd'));var deskjs=require(_0x6ee2('0xe'));var toCsv=require(_0x6ee2('0x7'));var querystring=require(_0x6ee2('0xf'));var Papa=require(_0x6ee2('0x10'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0x6ee2('0x11'));var hardwareService=require(_0x6ee2('0x12'));var logger=require(_0x6ee2('0x13'))('api');var utils=require(_0x6ee2('0x14'));var config=require(_0x6ee2('0x15'));var licenseUtil=require('../../config/license/util');var db=require(_0x6ee2('0x16'))['db'];function respondWithStatusCode(_0x4fd291,_0x24fc2b){_0x24fc2b=_0x24fc2b||0xcc;return function(_0x160ed4){if(_0x160ed4){return _0x4fd291[_0x6ee2('0x17')](_0x24fc2b);}return _0x4fd291[_0x6ee2('0x18')](_0x24fc2b)['end']();};}function respondWithResult(_0x180bcf,_0x3afc7f){_0x3afc7f=_0x3afc7f||0xc8;return function(_0x57b117){if(_0x57b117){return _0x180bcf['status'](_0x3afc7f)[_0x6ee2('0x19')](_0x57b117);}};}function respondWithFilteredResult(_0x3b51dd,_0xefa882){return function(_0x18d074){if(_0x18d074){var _0x3fd0f2=typeof _0xefa882[_0x6ee2('0x1a')]===_0x6ee2('0x1b')&&typeof _0xefa882[_0x6ee2('0x1c')]===_0x6ee2('0x1b');var _0x5aae4e=_0x18d074[_0x6ee2('0x1d')];var _0x3dc49a=_0x3fd0f2?0x0:_0xefa882['offset'];var _0x2c5f9e=_0x3fd0f2?_0x18d074[_0x6ee2('0x1d')]:_0xefa882[_0x6ee2('0x1a')]+_0xefa882['limit'];var _0x374112;if(_0x2c5f9e>=_0x5aae4e){_0x2c5f9e=_0x5aae4e;_0x374112=0xc8;}else{_0x374112=0xce;}_0x3b51dd[_0x6ee2('0x18')](_0x374112);return _0x3b51dd[_0x6ee2('0x1e')](_0x6ee2('0x1f'),_0x3dc49a+'-'+_0x2c5f9e+'/'+_0x5aae4e)[_0x6ee2('0x19')](_0x18d074);}return null;};}function patchUpdates(_0x59e57c){return function(_0x5bc141){try{jsonpatch[_0x6ee2('0x20')](_0x5bc141,_0x59e57c,!![]);}catch(_0x4995d8){return BPromise['reject'](_0x4995d8);}return _0x5bc141[_0x6ee2('0x21')]();};}function saveUpdates(_0x59891,_0x5dbe76){return function(_0x5bebb8){if(_0x5bebb8){return _0x5bebb8[_0x6ee2('0x22')](_0x59891)[_0x6ee2('0x23')](function(_0x5d3a81){return _0x5d3a81;});}return null;};}function removeEntity(_0x7cac9,_0x325c89){return function(_0x1510e3){if(_0x1510e3){return _0x1510e3[_0x6ee2('0x24')]()['then'](function(){_0x7cac9[_0x6ee2('0x18')](0xcc)[_0x6ee2('0x25')]();});}};}function handleEntityNotFound(_0x12a771,_0x8b2328){return function(_0x10e506){if(!_0x10e506){_0x12a771[_0x6ee2('0x17')](0x194);}return _0x10e506;};}function handleError(_0x529dfe,_0x428b8d){_0x428b8d=_0x428b8d||0x1f4;return function(_0x1bc872){logger[_0x6ee2('0x26')](_0x1bc872[_0x6ee2('0x27')]);if(_0x1bc872[_0x6ee2('0x28')]){delete _0x1bc872[_0x6ee2('0x28')];}_0x529dfe[_0x6ee2('0x18')](_0x428b8d)['send'](_0x1bc872);};}exports[_0x6ee2('0x29')]=function(_0xa39b7f,_0x25bcc9){var _0x53a93f={},_0x248b46={},_0xbd1e60={'count':0x0,'rows':[]};var _0x386c51=_[_0x6ee2('0x2a')](db['SalesforceConfiguration']['rawAttributes'],function(_0x25f855){return{'name':_0x25f855['fieldName'],'type':_0x25f855[_0x6ee2('0x2b')][_0x6ee2('0x2c')]};});_0x248b46[_0x6ee2('0x2d')]=_['map'](_0x386c51,'name');_0x248b46[_0x6ee2('0x2e')]=_[_0x6ee2('0x2f')](_0xa39b7f[_0x6ee2('0x2e')]);_0x248b46[_0x6ee2('0x30')]=_[_0x6ee2('0x31')](_0x248b46['model'],_0x248b46[_0x6ee2('0x2e')]);_0x53a93f['attributes']=_[_0x6ee2('0x31')](_0x248b46[_0x6ee2('0x2d')],qs[_0x6ee2('0x32')](_0xa39b7f['query']['fields']));_0x53a93f['attributes']=_0x53a93f[_0x6ee2('0x33')][_0x6ee2('0x34')]?_0x53a93f[_0x6ee2('0x33')]:_0x248b46[_0x6ee2('0x2d')];if(!_0xa39b7f[_0x6ee2('0x2e')][_0x6ee2('0x35')]('nolimit')){_0x53a93f[_0x6ee2('0x1c')]=qs[_0x6ee2('0x1c')](_0xa39b7f['query'][_0x6ee2('0x1c')]);_0x53a93f[_0x6ee2('0x1a')]=qs[_0x6ee2('0x1a')](_0xa39b7f[_0x6ee2('0x2e')]['offset']);}_0x53a93f['order']=qs[_0x6ee2('0x36')](_0xa39b7f[_0x6ee2('0x2e')][_0x6ee2('0x36')]);_0x53a93f[_0x6ee2('0x37')]=qs[_0x6ee2('0x30')](_[_0x6ee2('0x38')](_0xa39b7f[_0x6ee2('0x2e')],_0x248b46[_0x6ee2('0x30')]),_0x386c51);if(_0xa39b7f['query'][_0x6ee2('0x39')]){_0x53a93f[_0x6ee2('0x37')]=_[_0x6ee2('0x3a')](_0x53a93f[_0x6ee2('0x37')],{'$or':_['map'](_0x386c51,function(_0x47d091){if(_0x47d091[_0x6ee2('0x2b')]!==_0x6ee2('0x3b')){var _0x329d57={};_0x329d57[_0x47d091[_0x6ee2('0x28')]]={'$like':'%'+_0xa39b7f[_0x6ee2('0x2e')][_0x6ee2('0x39')]+'%'};return _0x329d57;}})});}_0x53a93f=_[_0x6ee2('0x3a')]({},_0x53a93f,_0xa39b7f[_0x6ee2('0x3c')]);var _0x5c22d2={'where':_0x53a93f[_0x6ee2('0x37')]};return db[_0x6ee2('0x3d')][_0x6ee2('0x1d')](_0x5c22d2)[_0x6ee2('0x23')](function(_0x471455){_0xbd1e60[_0x6ee2('0x1d')]=_0x471455;if(_0xa39b7f['query'][_0x6ee2('0x3e')]){_0x53a93f[_0x6ee2('0x3f')]=[{'all':!![]}];}return db['SalesforceConfiguration']['findAll'](_0x53a93f);})['then'](function(_0x20d082){_0xbd1e60[_0x6ee2('0x40')]=_0x20d082;return _0xbd1e60;})['then'](respondWithFilteredResult(_0x25bcc9,_0x53a93f))[_0x6ee2('0x41')](handleError(_0x25bcc9,null));};exports[_0x6ee2('0x42')]=function(_0x3d902c,_0x1b4b47){var _0x199d5d={'raw':![],'where':{'id':_0x3d902c[_0x6ee2('0x43')]['id']}},_0x444267={};_0x444267[_0x6ee2('0x2d')]=_[_0x6ee2('0x2f')](db[_0x6ee2('0x3d')]['rawAttributes']);_0x444267['query']=_[_0x6ee2('0x2f')](_0x3d902c[_0x6ee2('0x2e')]);_0x444267['filters']=_[_0x6ee2('0x31')](_0x444267[_0x6ee2('0x2d')],_0x444267[_0x6ee2('0x2e')]);_0x199d5d['attributes']=_[_0x6ee2('0x31')](_0x444267[_0x6ee2('0x2d')],qs[_0x6ee2('0x32')](_0x3d902c[_0x6ee2('0x2e')][_0x6ee2('0x32')]));_0x199d5d[_0x6ee2('0x33')]=_0x199d5d[_0x6ee2('0x33')][_0x6ee2('0x34')]?_0x199d5d[_0x6ee2('0x33')]:_0x444267[_0x6ee2('0x2d')];if(_0x3d902c[_0x6ee2('0x2e')]['includeAll']){_0x199d5d['include']=[{'all':!![]}];}_0x199d5d=_[_0x6ee2('0x3a')]({},_0x199d5d,_0x3d902c[_0x6ee2('0x3c')]);return db[_0x6ee2('0x3d')][_0x6ee2('0x44')](_0x199d5d)[_0x6ee2('0x23')](handleEntityNotFound(_0x1b4b47,null))[_0x6ee2('0x23')](respondWithResult(_0x1b4b47,null))[_0x6ee2('0x41')](handleError(_0x1b4b47,null));};exports[_0x6ee2('0x45')]=function(_0x59b4c3,_0x57f147){return db['SalesforceConfiguration'][_0x6ee2('0x45')](_0x59b4c3['body'],{})[_0x6ee2('0x23')](respondWithResult(_0x57f147,0xc9))[_0x6ee2('0x41')](handleError(_0x57f147,null));};exports[_0x6ee2('0x22')]=function(_0x300c28,_0x177bc6){if(_0x300c28['body']['id']){delete _0x300c28[_0x6ee2('0x46')]['id'];}return db['SalesforceConfiguration'][_0x6ee2('0x44')]({'where':{'id':_0x300c28['params']['id']}})[_0x6ee2('0x23')](handleEntityNotFound(_0x177bc6,null))[_0x6ee2('0x23')](saveUpdates(_0x300c28[_0x6ee2('0x46')],null))[_0x6ee2('0x23')](respondWithResult(_0x177bc6,null))[_0x6ee2('0x41')](handleError(_0x177bc6,null));};exports[_0x6ee2('0x24')]=function(_0x2c9f20,_0xac5aff){return db[_0x6ee2('0x3d')]['find']({'where':{'id':_0x2c9f20[_0x6ee2('0x43')]['id']}})[_0x6ee2('0x23')](handleEntityNotFound(_0xac5aff,null))[_0x6ee2('0x23')](removeEntity(_0xac5aff,null))[_0x6ee2('0x41')](handleError(_0xac5aff,null));};exports['getFields']=function(_0x8e2be5,_0x461932,_0x45b08c){var _0x4ccaa3={};var _0x4d73ce={};var _0x1a4348;var _0x4cd440;return db[_0x6ee2('0x3d')][_0x6ee2('0x47')]({'where':{'id':_0x8e2be5['params']['id']}})[_0x6ee2('0x23')](handleEntityNotFound(_0x461932,null))[_0x6ee2('0x23')](function(_0x3f496e){if(_0x3f496e){_0x1a4348=_0x3f496e;_0x4d73ce[_0x6ee2('0x2d')]=_[_0x6ee2('0x2f')](db[_0x6ee2('0x48')]['rawAttributes']);_0x4d73ce[_0x6ee2('0x2e')]=_[_0x6ee2('0x2f')](_0x8e2be5[_0x6ee2('0x2e')]);_0x4d73ce[_0x6ee2('0x30')]=_[_0x6ee2('0x31')](_0x4d73ce[_0x6ee2('0x2d')],_0x4d73ce[_0x6ee2('0x2e')]);_0x4ccaa3[_0x6ee2('0x33')]=_[_0x6ee2('0x31')](_0x4d73ce[_0x6ee2('0x2d')],qs[_0x6ee2('0x32')](_0x8e2be5['query'][_0x6ee2('0x32')]));_0x4ccaa3[_0x6ee2('0x33')]=_0x4ccaa3[_0x6ee2('0x33')][_0x6ee2('0x34')]?_0x4ccaa3['attributes']:_0x4d73ce[_0x6ee2('0x2d')];_0x4ccaa3[_0x6ee2('0x49')]=qs['sort'](_0x8e2be5['query']['sort']);_0x4ccaa3['where']=qs[_0x6ee2('0x30')](_[_0x6ee2('0x38')](_0x8e2be5[_0x6ee2('0x2e')],_0x4d73ce[_0x6ee2('0x30')]));if(_0x8e2be5[_0x6ee2('0x2e')][_0x6ee2('0x39')]){_0x4ccaa3[_0x6ee2('0x37')]=_[_0x6ee2('0x3a')](_0x4ccaa3['where'],{'$or':_[_0x6ee2('0x2a')](_0x4ccaa3['attributes'],function(_0x49fd5b){var _0x36ee5d={};_0x36ee5d[_0x49fd5b]={'$like':'%'+_0x8e2be5[_0x6ee2('0x2e')][_0x6ee2('0x39')]+'%'};return _0x36ee5d;})});}_0x4ccaa3=_[_0x6ee2('0x3a')]({},_0x4ccaa3,_0x8e2be5[_0x6ee2('0x3c')]);return _0x1a4348['getFields'](_0x4ccaa3);}})[_0x6ee2('0x23')](function(_0x4245e4){if(_0x4245e4){_0x4cd440=_0x4245e4['length'];if(!_0x8e2be5['query']['hasOwnProperty'](_0x6ee2('0x4a'))){_0x4ccaa3[_0x6ee2('0x1c')]=qs['limit'](_0x8e2be5['query']['limit']);_0x4ccaa3['offset']=qs['offset'](_0x8e2be5[_0x6ee2('0x2e')][_0x6ee2('0x1a')]);}return _0x1a4348[_0x6ee2('0x4b')](_0x4ccaa3);}})['then'](function(_0x147e25){if(_0x147e25){return _0x147e25?{'count':_0x4cd440,'rows':_0x147e25}:null;}})[_0x6ee2('0x23')](respondWithResult(_0x461932,null))['catch'](handleError(_0x461932,null));};exports[_0x6ee2('0x4c')]=function(_0x201f83,_0x29c1be,_0x3af594){var _0x19359c={};var _0x1c6b68={};var _0x4b8169;var _0xf775a3;return db[_0x6ee2('0x3d')][_0x6ee2('0x47')]({'where':{'id':_0x201f83[_0x6ee2('0x43')]['id']}})['then'](handleEntityNotFound(_0x29c1be,null))[_0x6ee2('0x23')](function(_0x57f88a){if(_0x57f88a){_0x4b8169=_0x57f88a;_0x1c6b68[_0x6ee2('0x2d')]=_[_0x6ee2('0x2f')](db['SalesforceField'][_0x6ee2('0x4d')]);_0x1c6b68[_0x6ee2('0x2e')]=_[_0x6ee2('0x2f')](_0x201f83['query']);_0x1c6b68[_0x6ee2('0x30')]=_[_0x6ee2('0x31')](_0x1c6b68['model'],_0x1c6b68[_0x6ee2('0x2e')]);_0x19359c[_0x6ee2('0x33')]=_[_0x6ee2('0x31')](_0x1c6b68[_0x6ee2('0x2d')],qs[_0x6ee2('0x32')](_0x201f83[_0x6ee2('0x2e')][_0x6ee2('0x32')]));_0x19359c[_0x6ee2('0x33')]=_0x19359c['attributes']['length']?_0x19359c[_0x6ee2('0x33')]:_0x1c6b68[_0x6ee2('0x2d')];_0x19359c[_0x6ee2('0x49')]=qs[_0x6ee2('0x36')](_0x201f83['query'][_0x6ee2('0x36')]);_0x19359c[_0x6ee2('0x37')]=qs[_0x6ee2('0x30')](_[_0x6ee2('0x38')](_0x201f83['query'],_0x1c6b68[_0x6ee2('0x30')]));if(_0x201f83[_0x6ee2('0x2e')][_0x6ee2('0x39')]){_0x19359c[_0x6ee2('0x37')]=_[_0x6ee2('0x3a')](_0x19359c['where'],{'$or':_[_0x6ee2('0x2a')](_0x19359c['attributes'],function(_0x3ef484){var _0xb79f3c={};_0xb79f3c[_0x3ef484]={'$like':'%'+_0x201f83[_0x6ee2('0x2e')]['filter']+'%'};return _0xb79f3c;})});}_0x19359c=_['merge']({},_0x19359c,_0x201f83[_0x6ee2('0x3c')]);return _0x4b8169[_0x6ee2('0x4c')](_0x19359c);}})[_0x6ee2('0x23')](function(_0xeb9061){if(_0xeb9061){_0xf775a3=_0xeb9061['length'];if(!_0x201f83[_0x6ee2('0x2e')][_0x6ee2('0x35')](_0x6ee2('0x4a'))){_0x19359c[_0x6ee2('0x1c')]=qs[_0x6ee2('0x1c')](_0x201f83['query'][_0x6ee2('0x1c')]);_0x19359c[_0x6ee2('0x1a')]=qs[_0x6ee2('0x1a')](_0x201f83['query']['offset']);}return _0x4b8169['getSubjects'](_0x19359c);}})[_0x6ee2('0x23')](function(_0x1e8159){if(_0x1e8159){return _0x1e8159?{'count':_0xf775a3,'rows':_0x1e8159}:null;}})[_0x6ee2('0x23')](respondWithResult(_0x29c1be,null))[_0x6ee2('0x41')](handleError(_0x29c1be,null));};exports[_0x6ee2('0x4e')]=function(_0x533206,_0x2ef9bb,_0xb12dbd){var _0x33e9e9={};var _0x281270={};var _0x3e6cef;var _0x32bf2a;return db['SalesforceConfiguration'][_0x6ee2('0x47')]({'where':{'id':_0x533206[_0x6ee2('0x43')]['id']}})[_0x6ee2('0x23')](handleEntityNotFound(_0x2ef9bb,null))[_0x6ee2('0x23')](function(_0x2bfb5a){if(_0x2bfb5a){_0x3e6cef=_0x2bfb5a;_0x281270['model']=_[_0x6ee2('0x2f')](db[_0x6ee2('0x48')][_0x6ee2('0x4d')]);_0x281270[_0x6ee2('0x2e')]=_[_0x6ee2('0x2f')](_0x533206['query']);_0x281270['filters']=_[_0x6ee2('0x31')](_0x281270[_0x6ee2('0x2d')],_0x281270['query']);_0x33e9e9[_0x6ee2('0x33')]=_[_0x6ee2('0x31')](_0x281270['model'],qs[_0x6ee2('0x32')](_0x533206[_0x6ee2('0x2e')][_0x6ee2('0x32')]));_0x33e9e9[_0x6ee2('0x33')]=_0x33e9e9[_0x6ee2('0x33')][_0x6ee2('0x34')]?_0x33e9e9[_0x6ee2('0x33')]:_0x281270[_0x6ee2('0x2d')];_0x33e9e9[_0x6ee2('0x49')]=qs[_0x6ee2('0x36')](_0x533206[_0x6ee2('0x2e')][_0x6ee2('0x36')]);_0x33e9e9[_0x6ee2('0x37')]=qs[_0x6ee2('0x30')](_[_0x6ee2('0x38')](_0x533206['query'],_0x281270[_0x6ee2('0x30')]));if(_0x533206[_0x6ee2('0x2e')][_0x6ee2('0x39')]){_0x33e9e9[_0x6ee2('0x37')]=_[_0x6ee2('0x3a')](_0x33e9e9['where'],{'$or':_[_0x6ee2('0x2a')](_0x33e9e9[_0x6ee2('0x33')],function(_0x36e3d7){var _0x361704={};_0x361704[_0x36e3d7]={'$like':'%'+_0x533206[_0x6ee2('0x2e')]['filter']+'%'};return _0x361704;})});}_0x33e9e9=_[_0x6ee2('0x3a')]({},_0x33e9e9,_0x533206[_0x6ee2('0x3c')]);return _0x3e6cef[_0x6ee2('0x4e')](_0x33e9e9);}})[_0x6ee2('0x23')](function(_0x379618){if(_0x379618){_0x32bf2a=_0x379618[_0x6ee2('0x34')];if(!_0x533206[_0x6ee2('0x2e')][_0x6ee2('0x35')](_0x6ee2('0x4a'))){_0x33e9e9['limit']=qs[_0x6ee2('0x1c')](_0x533206[_0x6ee2('0x2e')]['limit']);_0x33e9e9[_0x6ee2('0x1a')]=qs[_0x6ee2('0x1a')](_0x533206[_0x6ee2('0x2e')][_0x6ee2('0x1a')]);}return _0x3e6cef['getDescriptions'](_0x33e9e9);}})[_0x6ee2('0x23')](function(_0x35c2e5){if(_0x35c2e5){return _0x35c2e5?{'count':_0x32bf2a,'rows':_0x35c2e5}:null;}})['then'](respondWithResult(_0x2ef9bb,null))[_0x6ee2('0x41')](handleError(_0x2ef9bb,null));}; \ No newline at end of file diff --git a/server/api/intSalesforceConfiguration/intSalesforceConfiguration.model.js b/server/api/intSalesforceConfiguration/intSalesforceConfiguration.model.js index faeee8a..7905b38 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 _0x5793=['request-promise','path','rimraf','../../config/environment','./intSalesforceConfiguration.attributes','exports','define','util','../../config/logger','api','moment','bluebird'];(function(_0x3b14a8,_0x2de21f){var _0x12bdc9=function(_0x2c485f){while(--_0x2c485f){_0x3b14a8['push'](_0x3b14a8['shift']());}};_0x12bdc9(++_0x2de21f);}(_0x5793,0x16f));var _0x3579=function(_0x1ced8b,_0x459894){_0x1ced8b=_0x1ced8b-0x0;var _0xf29fbb=_0x5793[_0x1ced8b];return _0xf29fbb;};'use strict';var _=require('lodash');var util=require(_0x3579('0x0'));var logger=require(_0x3579('0x1'))(_0x3579('0x2'));var moment=require(_0x3579('0x3'));var BPromise=require(_0x3579('0x4'));var rp=require(_0x3579('0x5'));var fs=require('fs');var path=require(_0x3579('0x6'));var rimraf=require(_0x3579('0x7'));var config=require(_0x3579('0x8'));var attributes=require(_0x3579('0x9'));module[_0x3579('0xa')]=function(_0x1cf17f,_0x2010e5){return _0x1cf17f[_0x3579('0xb')]('SalesforceConfiguration',attributes,{'tableName':'int_salesforce_configurations','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xdad2=['api','moment','bluebird','request-promise','rimraf','./intSalesforceConfiguration.attributes','exports','define','SalesforceConfiguration','int_salesforce_configurations','lodash','util','../../config/logger'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xdad2,0x169));var _0x2dad=function(_0x1cc8fe,_0x105328){_0x1cc8fe=_0x1cc8fe-0x0;var _0x230054=_0xdad2[_0x1cc8fe];return _0x230054;};'use strict';var _=require(_0x2dad('0x0'));var util=require(_0x2dad('0x1'));var logger=require(_0x2dad('0x2'))(_0x2dad('0x3'));var moment=require(_0x2dad('0x4'));var BPromise=require(_0x2dad('0x5'));var rp=require(_0x2dad('0x6'));var fs=require('fs');var path=require('path');var rimraf=require(_0x2dad('0x7'));var config=require('../../config/environment');var attributes=require(_0x2dad('0x8'));module[_0x2dad('0x9')]=function(_0x2dbda7,_0x11fe07){return _0x2dbda7[_0x2dad('0xa')](_0x2dad('0xb'),attributes,{'tableName':_0x2dad('0xc'),'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 6d3f5f6..77e257f 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 _0xa534=['SalesforceConfiguration,\x20%s,\x20%s','request\x20sent','debug','SalesforceConfiguration,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','lodash','util','randomstring','../../config/environment','jayson/promise','client','http','request','then','info'];(function(_0x3f1710,_0x3877a2){var _0x528458=function(_0x4b5d0f){while(--_0x4b5d0f){_0x3f1710['push'](_0x3f1710['shift']());}};_0x528458(++_0x3877a2);}(_0xa534,0xbe));var _0x4a53=function(_0x565c49,_0x54acd0){_0x565c49=_0x565c49-0x0;var _0x20ca34=_0xa534[_0x565c49];return _0x20ca34;};'use strict';var _=require(_0x4a53('0x0'));var util=require(_0x4a53('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0x4a53('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')('rpc');var config=require(_0x4a53('0x3'));var jayson=require(_0x4a53('0x4'));var client=jayson[_0x4a53('0x5')][_0x4a53('0x6')]({'port':0x232a});function respondWithRpcPromise(_0x12930f,_0x2b7f3e,_0x20d631){return new BPromise(function(_0x1d8e2e,_0x5623a4){return client[_0x4a53('0x7')](_0x12930f,_0x20d631)[_0x4a53('0x8')](function(_0x710517){logger[_0x4a53('0x9')](_0x4a53('0xa'),_0x2b7f3e,_0x4a53('0xb'));logger[_0x4a53('0xc')](_0x4a53('0xd'),_0x2b7f3e,_0x4a53('0xb'),JSON[_0x4a53('0xe')](_0x710517));if(_0x710517[_0x4a53('0xf')]){if(_0x710517[_0x4a53('0xf')][_0x4a53('0x10')]===0x1f4){logger['error'](_0x4a53('0xa'),_0x2b7f3e,_0x710517['error'][_0x4a53('0x11')]);return _0x5623a4(_0x710517[_0x4a53('0xf')]['message']);}logger['error'](_0x4a53('0xa'),_0x2b7f3e,_0x710517['error'][_0x4a53('0x11')]);return _0x1d8e2e(_0x710517[_0x4a53('0xf')]['message']);}else{logger[_0x4a53('0x9')](_0x4a53('0xa'),_0x2b7f3e,_0x4a53('0xb'));_0x1d8e2e(_0x710517[_0x4a53('0x12')]['message']);}})[_0x4a53('0x13')](function(_0x2364d0){logger[_0x4a53('0xf')](_0x4a53('0xa'),_0x2b7f3e,_0x2364d0);_0x5623a4(_0x2364d0);});});} \ No newline at end of file +var _0x2c22=['randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','then','info','request\x20sent','debug','SalesforceConfiguration,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','SalesforceConfiguration,\x20%s,\x20%s','lodash','util','moment','bluebird'];(function(_0x598f74,_0x28a754){var _0x11b44b=function(_0x4213e2){while(--_0x4213e2){_0x598f74['push'](_0x598f74['shift']());}};_0x11b44b(++_0x28a754);}(_0x2c22,0x18c));var _0x22c2=function(_0x1eaa75,_0x1ef0c9){_0x1eaa75=_0x1eaa75-0x0;var _0x3b2ed5=_0x2c22[_0x1eaa75];return _0x3b2ed5;};'use strict';var _=require(_0x22c2('0x0'));var util=require(_0x22c2('0x1'));var moment=require(_0x22c2('0x2'));var BPromise=require(_0x22c2('0x3'));var rs=require(_0x22c2('0x4'));var fs=require('fs');var Redis=require(_0x22c2('0x5'));var db=require(_0x22c2('0x6'))['db'];var utils=require(_0x22c2('0x7'));var logger=require(_0x22c2('0x8'))(_0x22c2('0x9'));var config=require(_0x22c2('0xa'));var jayson=require(_0x22c2('0xb'));var client=jayson[_0x22c2('0xc')][_0x22c2('0xd')]({'port':0x232a});function respondWithRpcPromise(_0x4df9d6,_0xeba4da,_0x396a2f){return new BPromise(function(_0x84f493,_0x347fd2){return client['request'](_0x4df9d6,_0x396a2f)[_0x22c2('0xe')](function(_0x2da162){logger[_0x22c2('0xf')]('SalesforceConfiguration,\x20%s,\x20%s',_0xeba4da,_0x22c2('0x10'));logger[_0x22c2('0x11')](_0x22c2('0x12'),_0xeba4da,_0x22c2('0x10'),JSON[_0x22c2('0x13')](_0x2da162));if(_0x2da162[_0x22c2('0x14')]){if(_0x2da162[_0x22c2('0x14')][_0x22c2('0x15')]===0x1f4){logger[_0x22c2('0x14')]('SalesforceConfiguration,\x20%s,\x20%s',_0xeba4da,_0x2da162[_0x22c2('0x14')][_0x22c2('0x16')]);return _0x347fd2(_0x2da162[_0x22c2('0x14')][_0x22c2('0x16')]);}logger[_0x22c2('0x14')]('SalesforceConfiguration,\x20%s,\x20%s',_0xeba4da,_0x2da162[_0x22c2('0x14')][_0x22c2('0x16')]);return _0x84f493(_0x2da162['error'][_0x22c2('0x16')]);}else{logger[_0x22c2('0xf')]('SalesforceConfiguration,\x20%s,\x20%s',_0xeba4da,_0x22c2('0x10'));_0x84f493(_0x2da162['result'][_0x22c2('0x16')]);}})[_0x22c2('0x17')](function(_0x110e02){logger[_0x22c2('0x14')](_0x22c2('0x18'),_0xeba4da,_0x110e02);_0x347fd2(_0x110e02);});});} \ No newline at end of file diff --git a/server/api/intSalesforceField/index.js b/server/api/intSalesforceField/index.js index c212f81..7d18b29 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 _0x5bb3=['show','create','put','update','destroy','exports','multer','util','path','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','isAuthenticated','index','/:id'];(function(_0x1ddedd,_0x485606){var _0xa3e1ac=function(_0x580444){while(--_0x580444){_0x1ddedd['push'](_0x1ddedd['shift']());}};_0xa3e1ac(++_0x485606);}(_0x5bb3,0x116));var _0x35bb=function(_0x22da18,_0x1e10d4){_0x22da18=_0x22da18-0x0;var _0x49c023=_0x5bb3[_0x22da18];return _0x49c023;};'use strict';var multer=require(_0x35bb('0x0'));var util=require(_0x35bb('0x1'));var path=require(_0x35bb('0x2'));var timeout=require('connect-timeout');var express=require(_0x35bb('0x3'));var router=express['Router']();var fs_extra=require(_0x35bb('0x4'));var auth=require(_0x35bb('0x5'));var interaction=require(_0x35bb('0x6'));var config=require(_0x35bb('0x7'));var controller=require('./intSalesforceField.controller');router['get']('/',auth[_0x35bb('0x8')](),controller[_0x35bb('0x9')]);router['get'](_0x35bb('0xa'),auth[_0x35bb('0x8')](),controller[_0x35bb('0xb')]);router['post']('/',auth[_0x35bb('0x8')](),controller[_0x35bb('0xc')]);router[_0x35bb('0xd')](_0x35bb('0xa'),auth[_0x35bb('0x8')](),controller[_0x35bb('0xe')]);router['delete'](_0x35bb('0xa'),auth['isAuthenticated'](),controller[_0x35bb('0xf')]);module[_0x35bb('0x10')]=router; \ No newline at end of file +var _0xf8fe=['../../components/auth/service','../../components/interaction/service','./intSalesforceField.controller','get','isAuthenticated','index','create','put','update','/:id','destroy','exports','multer','util','path','connect-timeout','express','Router','fs-extra'];(function(_0x3d0fb6,_0x508029){var _0x55eb25=function(_0x4104bc){while(--_0x4104bc){_0x3d0fb6['push'](_0x3d0fb6['shift']());}};_0x55eb25(++_0x508029);}(_0xf8fe,0xf0));var _0xef8f=function(_0x3b8f2e,_0x4657c4){_0x3b8f2e=_0x3b8f2e-0x0;var _0xeb09f0=_0xf8fe[_0x3b8f2e];return _0xeb09f0;};'use strict';var multer=require(_0xef8f('0x0'));var util=require(_0xef8f('0x1'));var path=require(_0xef8f('0x2'));var timeout=require(_0xef8f('0x3'));var express=require(_0xef8f('0x4'));var router=express[_0xef8f('0x5')]();var fs_extra=require(_0xef8f('0x6'));var auth=require(_0xef8f('0x7'));var interaction=require(_0xef8f('0x8'));var config=require('../../config/environment');var controller=require(_0xef8f('0x9'));router[_0xef8f('0xa')]('/',auth[_0xef8f('0xb')](),controller[_0xef8f('0xc')]);router[_0xef8f('0xa')]('/:id',auth[_0xef8f('0xb')](),controller['show']);router['post']('/',auth[_0xef8f('0xb')](),controller[_0xef8f('0xd')]);router[_0xef8f('0xe')]('/:id',auth['isAuthenticated'](),controller[_0xef8f('0xf')]);router['delete'](_0xef8f('0x10'),auth[_0xef8f('0xb')](),controller[_0xef8f('0x11')]);module[_0xef8f('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 4644249..7182c2c 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 _0x266d=['ENUM','customVariable','picklist','string','STRING','variable','sequelize'];(function(_0xdd7389,_0x487607){var _0x3c46e0=function(_0x24c6fe){while(--_0x24c6fe){_0xdd7389['push'](_0xdd7389['shift']());}};_0x3c46e0(++_0x487607);}(_0x266d,0x125));var _0xd266=function(_0x40a045,_0x516f0e){_0x40a045=_0x40a045-0x0;var _0x1a687c=_0x266d[_0x40a045];return _0x1a687c;};'use strict';var Sequelize=require(_0xd266('0x0'));module['exports']={'type':{'type':Sequelize[_0xd266('0x1')]('string','variable',_0xd266('0x2'),'keyValue',_0xd266('0x3')),'defaultValue':_0xd266('0x4')},'content':{'type':Sequelize[_0xd266('0x5')]},'key':{'type':Sequelize[_0xd266('0x5')]},'keyType':{'type':Sequelize['ENUM'](_0xd266('0x4'),_0xd266('0x6'),_0xd266('0x2'))},'keyContent':{'type':Sequelize[_0xd266('0x5')]},'idField':{'type':Sequelize['STRING']},'variableName':{'type':Sequelize[_0xd266('0x5')]}}; \ No newline at end of file +var _0x838e=['ENUM','variable','customVariable','keyValue','picklist','string','STRING','sequelize','exports'];(function(_0x2c52a4,_0x1917f0){var _0x1630b4=function(_0x16e1e5){while(--_0x16e1e5){_0x2c52a4['push'](_0x2c52a4['shift']());}};_0x1630b4(++_0x1917f0);}(_0x838e,0xa9));var _0xe838=function(_0x5007b9,_0x532e47){_0x5007b9=_0x5007b9-0x0;var _0x58f845=_0x838e[_0x5007b9];return _0x58f845;};'use strict';var Sequelize=require(_0xe838('0x0'));module[_0xe838('0x1')]={'type':{'type':Sequelize[_0xe838('0x2')]('string',_0xe838('0x3'),_0xe838('0x4'),_0xe838('0x5'),_0xe838('0x6')),'defaultValue':_0xe838('0x7')},'content':{'type':Sequelize[_0xe838('0x8')]},'key':{'type':Sequelize[_0xe838('0x8')]},'keyType':{'type':Sequelize['ENUM'](_0xe838('0x7'),_0xe838('0x3'),_0xe838('0x4'))},'keyContent':{'type':Sequelize['STRING']},'idField':{'type':Sequelize[_0xe838('0x8')]},'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 4942448..a9d586e 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 _0xae7f=['where','pick','filter','merge','VIRTUAL','SalesforceField','includeAll','findAll','rows','catch','show','params','include','options','find','create','body','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','path','sox','ejs','fs-extra','lodash','squel','crypto','jsforce','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','sendStatus','end','json','offset','undefined','limit','count','status','set','Content-Range','apply','update','then','destroy','error','stack','name','send','index','map','rawAttributes','fieldName','type','key','query','keys','filters','intersection','model','fields','attributes','length','nolimit','sort'];(function(_0xbb14db,_0x3ee8c6){var _0x36bed7=function(_0x16c478){while(--_0x16c478){_0xbb14db['push'](_0xbb14db['shift']());}};_0x36bed7(++_0x3ee8c6);}(_0xae7f,0xf5));var _0xfae7=function(_0x541a62,_0x40b36d){_0x541a62=_0x541a62-0x0;var _0x456123=_0xae7f[_0x541a62];return _0x456123;};'use strict';var emlformat=require(_0xfae7('0x0'));var rimraf=require(_0xfae7('0x1'));var zipdir=require(_0xfae7('0x2'));var jsonpatch=require(_0xfae7('0x3'));var rp=require('request-promise');var moment=require(_0xfae7('0x4'));var BPromise=require(_0xfae7('0x5'));var Mustache=require(_0xfae7('0x6'));var util=require('util');var path=require(_0xfae7('0x7'));var sox=require(_0xfae7('0x8'));var csv=require('to-csv');var ejs=require(_0xfae7('0x9'));var fs=require('fs');var fs_extra=require(_0xfae7('0xa'));var _=require(_0xfae7('0xb'));var squel=require(_0xfae7('0xc'));var crypto=require(_0xfae7('0xd'));var jsforce=require(_0xfae7('0xe'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0xfae7('0xf'));var Redis=require(_0xfae7('0x10'));var authService=require(_0xfae7('0x11'));var qs=require(_0xfae7('0x12'));var as=require(_0xfae7('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xfae7('0x14'))(_0xfae7('0x15'));var utils=require(_0xfae7('0x16'));var config=require(_0xfae7('0x17'));var licenseUtil=require(_0xfae7('0x18'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x1b82b0,_0x3a9534){_0x3a9534=_0x3a9534||0xcc;return function(_0x33c670){if(_0x33c670){return _0x1b82b0[_0xfae7('0x19')](_0x3a9534);}return _0x1b82b0['status'](_0x3a9534)[_0xfae7('0x1a')]();};}function respondWithResult(_0x5c0844,_0x2f54c9){_0x2f54c9=_0x2f54c9||0xc8;return function(_0x3b881c){if(_0x3b881c){return _0x5c0844['status'](_0x2f54c9)[_0xfae7('0x1b')](_0x3b881c);}};}function respondWithFilteredResult(_0x14c699,_0x38e03e){return function(_0x1afefd){if(_0x1afefd){var _0xbf573a=typeof _0x38e03e[_0xfae7('0x1c')]===_0xfae7('0x1d')&&typeof _0x38e03e[_0xfae7('0x1e')]===_0xfae7('0x1d');var _0x1c3e32=_0x1afefd['count'];var _0x288446=_0xbf573a?0x0:_0x38e03e[_0xfae7('0x1c')];var _0x1637e5=_0xbf573a?_0x1afefd[_0xfae7('0x1f')]:_0x38e03e[_0xfae7('0x1c')]+_0x38e03e[_0xfae7('0x1e')];var _0x574814;if(_0x1637e5>=_0x1c3e32){_0x1637e5=_0x1c3e32;_0x574814=0xc8;}else{_0x574814=0xce;}_0x14c699[_0xfae7('0x20')](_0x574814);return _0x14c699[_0xfae7('0x21')](_0xfae7('0x22'),_0x288446+'-'+_0x1637e5+'/'+_0x1c3e32)[_0xfae7('0x1b')](_0x1afefd);}return null;};}function patchUpdates(_0x5b93cb){return function(_0x16dc40){try{jsonpatch[_0xfae7('0x23')](_0x16dc40,_0x5b93cb,!![]);}catch(_0x4920c6){return BPromise['reject'](_0x4920c6);}return _0x16dc40['save']();};}function saveUpdates(_0x155ce9,_0x9c2523){return function(_0x1b3750){if(_0x1b3750){return _0x1b3750[_0xfae7('0x24')](_0x155ce9)[_0xfae7('0x25')](function(_0x49d910){return _0x49d910;});}return null;};}function removeEntity(_0x1aa7f0,_0x4b30a3){return function(_0x1caec5){if(_0x1caec5){return _0x1caec5[_0xfae7('0x26')]()[_0xfae7('0x25')](function(){_0x1aa7f0[_0xfae7('0x20')](0xcc)[_0xfae7('0x1a')]();});}};}function handleEntityNotFound(_0x2fbccf,_0x526dcb){return function(_0x1255f5){if(!_0x1255f5){_0x2fbccf[_0xfae7('0x19')](0x194);}return _0x1255f5;};}function handleError(_0x49e733,_0x302ec9){_0x302ec9=_0x302ec9||0x1f4;return function(_0x219098){logger[_0xfae7('0x27')](_0x219098[_0xfae7('0x28')]);if(_0x219098[_0xfae7('0x29')]){delete _0x219098[_0xfae7('0x29')];}_0x49e733[_0xfae7('0x20')](_0x302ec9)[_0xfae7('0x2a')](_0x219098);};}exports[_0xfae7('0x2b')]=function(_0x1e0406,_0x577978){var _0x618872={},_0xc2dd7={},_0x1d913a={'count':0x0,'rows':[]};var _0x4a146b=_[_0xfae7('0x2c')](db['SalesforceField'][_0xfae7('0x2d')],function(_0x213545){return{'name':_0x213545[_0xfae7('0x2e')],'type':_0x213545[_0xfae7('0x2f')][_0xfae7('0x30')]};});_0xc2dd7['model']=_[_0xfae7('0x2c')](_0x4a146b,_0xfae7('0x29'));_0xc2dd7[_0xfae7('0x31')]=_[_0xfae7('0x32')](_0x1e0406[_0xfae7('0x31')]);_0xc2dd7[_0xfae7('0x33')]=_[_0xfae7('0x34')](_0xc2dd7[_0xfae7('0x35')],_0xc2dd7[_0xfae7('0x31')]);_0x618872['attributes']=_[_0xfae7('0x34')](_0xc2dd7[_0xfae7('0x35')],qs[_0xfae7('0x36')](_0x1e0406[_0xfae7('0x31')][_0xfae7('0x36')]));_0x618872['attributes']=_0x618872[_0xfae7('0x37')][_0xfae7('0x38')]?_0x618872[_0xfae7('0x37')]:_0xc2dd7['model'];if(!_0x1e0406[_0xfae7('0x31')]['hasOwnProperty'](_0xfae7('0x39'))){_0x618872['limit']=qs[_0xfae7('0x1e')](_0x1e0406[_0xfae7('0x31')]['limit']);_0x618872[_0xfae7('0x1c')]=qs['offset'](_0x1e0406[_0xfae7('0x31')][_0xfae7('0x1c')]);}_0x618872['order']=qs[_0xfae7('0x3a')](_0x1e0406[_0xfae7('0x31')][_0xfae7('0x3a')]);_0x618872[_0xfae7('0x3b')]=qs[_0xfae7('0x33')](_[_0xfae7('0x3c')](_0x1e0406[_0xfae7('0x31')],_0xc2dd7[_0xfae7('0x33')]),_0x4a146b);if(_0x1e0406[_0xfae7('0x31')][_0xfae7('0x3d')]){_0x618872[_0xfae7('0x3b')]=_[_0xfae7('0x3e')](_0x618872[_0xfae7('0x3b')],{'$or':_[_0xfae7('0x2c')](_0x4a146b,function(_0x588c1f){if(_0x588c1f[_0xfae7('0x2f')]!==_0xfae7('0x3f')){var _0x45ab3a={};_0x45ab3a[_0x588c1f['name']]={'$like':'%'+_0x1e0406[_0xfae7('0x31')][_0xfae7('0x3d')]+'%'};return _0x45ab3a;}})});}_0x618872=_[_0xfae7('0x3e')]({},_0x618872,_0x1e0406['options']);var _0x4084bd={'where':_0x618872[_0xfae7('0x3b')]};return db[_0xfae7('0x40')][_0xfae7('0x1f')](_0x4084bd)['then'](function(_0xe2ea24){_0x1d913a['count']=_0xe2ea24;if(_0x1e0406[_0xfae7('0x31')][_0xfae7('0x41')]){_0x618872['include']=[{'all':!![]}];}return db[_0xfae7('0x40')][_0xfae7('0x42')](_0x618872);})['then'](function(_0x288c2a){_0x1d913a[_0xfae7('0x43')]=_0x288c2a;return _0x1d913a;})['then'](respondWithFilteredResult(_0x577978,_0x618872))[_0xfae7('0x44')](handleError(_0x577978,null));};exports[_0xfae7('0x45')]=function(_0x513340,_0x35285d){var _0x97f9be={'raw':!![],'where':{'id':_0x513340[_0xfae7('0x46')]['id']}},_0x59a1df={};_0x59a1df[_0xfae7('0x35')]=_[_0xfae7('0x32')](db[_0xfae7('0x40')]['rawAttributes']);_0x59a1df['query']=_[_0xfae7('0x32')](_0x513340['query']);_0x59a1df['filters']=_[_0xfae7('0x34')](_0x59a1df[_0xfae7('0x35')],_0x59a1df[_0xfae7('0x31')]);_0x97f9be[_0xfae7('0x37')]=_[_0xfae7('0x34')](_0x59a1df['model'],qs['fields'](_0x513340[_0xfae7('0x31')][_0xfae7('0x36')]));_0x97f9be[_0xfae7('0x37')]=_0x97f9be['attributes'][_0xfae7('0x38')]?_0x97f9be[_0xfae7('0x37')]:_0x59a1df[_0xfae7('0x35')];if(_0x513340['query'][_0xfae7('0x41')]){_0x97f9be[_0xfae7('0x47')]=[{'all':!![]}];}_0x97f9be=_['merge']({},_0x97f9be,_0x513340[_0xfae7('0x48')]);return db[_0xfae7('0x40')][_0xfae7('0x49')](_0x97f9be)['then'](handleEntityNotFound(_0x35285d,null))[_0xfae7('0x25')](respondWithResult(_0x35285d,null))[_0xfae7('0x44')](handleError(_0x35285d,null));};exports[_0xfae7('0x4a')]=function(_0x541e5d,_0x403528){return db[_0xfae7('0x40')][_0xfae7('0x4a')](_0x541e5d[_0xfae7('0x4b')],{})[_0xfae7('0x25')](respondWithResult(_0x403528,0xc9))['catch'](handleError(_0x403528,null));};exports['update']=function(_0x45dfef,_0x183d40){if(_0x45dfef[_0xfae7('0x4b')]['id']){delete _0x45dfef['body']['id'];}return db[_0xfae7('0x40')][_0xfae7('0x49')]({'where':{'id':_0x45dfef[_0xfae7('0x46')]['id']}})[_0xfae7('0x25')](handleEntityNotFound(_0x183d40,null))[_0xfae7('0x25')](saveUpdates(_0x45dfef[_0xfae7('0x4b')],null))['then'](respondWithResult(_0x183d40,null))[_0xfae7('0x44')](handleError(_0x183d40,null));};exports['destroy']=function(_0x14e65c,_0x323c6b){return db[_0xfae7('0x40')][_0xfae7('0x49')]({'where':{'id':_0x14e65c[_0xfae7('0x46')]['id']}})[_0xfae7('0x25')](handleEntityNotFound(_0x323c6b,null))[_0xfae7('0x25')](removeEntity(_0x323c6b,null))[_0xfae7('0x44')](handleError(_0x323c6b,null));}; \ No newline at end of file +var _0xadb6=['SalesforceField','fieldName','type','model','map','name','query','filters','attributes','intersection','fields','hasOwnProperty','order','sort','where','pick','merge','filter','options','includeAll','findAll','catch','params','keys','rawAttributes','include','find','create','body','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','sox','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','json','offset','undefined','limit','count','Content-Range','reject','save','update','then','destroy','end','error','send','index'];(function(_0x1d83db,_0x89d115){var _0x2dc1d1=function(_0x13fdc3){while(--_0x13fdc3){_0x1d83db['push'](_0x1d83db['shift']());}};_0x2dc1d1(++_0x89d115);}(_0xadb6,0x1df));var _0x6adb=function(_0x64f648,_0x57bec1){_0x64f648=_0x64f648-0x0;var _0x3e19ae=_0xadb6[_0x64f648];return _0x3e19ae;};'use strict';var emlformat=require(_0x6adb('0x0'));var rimraf=require(_0x6adb('0x1'));var zipdir=require(_0x6adb('0x2'));var jsonpatch=require(_0x6adb('0x3'));var rp=require(_0x6adb('0x4'));var moment=require('moment');var BPromise=require(_0x6adb('0x5'));var Mustache=require(_0x6adb('0x6'));var util=require(_0x6adb('0x7'));var path=require('path');var sox=require(_0x6adb('0x8'));var csv=require('to-csv');var ejs=require(_0x6adb('0x9'));var fs=require('fs');var fs_extra=require(_0x6adb('0xa'));var _=require(_0x6adb('0xb'));var squel=require(_0x6adb('0xc'));var crypto=require(_0x6adb('0xd'));var jsforce=require(_0x6adb('0xe'));var deskjs=require(_0x6adb('0xf'));var toCsv=require(_0x6adb('0x10'));var querystring=require(_0x6adb('0x11'));var Papa=require(_0x6adb('0x12'));var Redis=require(_0x6adb('0x13'));var authService=require(_0x6adb('0x14'));var qs=require(_0x6adb('0x15'));var as=require(_0x6adb('0x16'));var hardwareService=require(_0x6adb('0x17'));var logger=require(_0x6adb('0x18'))(_0x6adb('0x19'));var utils=require(_0x6adb('0x1a'));var config=require('../../config/environment');var licenseUtil=require(_0x6adb('0x1b'));var db=require(_0x6adb('0x1c'))['db'];function respondWithStatusCode(_0x4c4956,_0x3fc77a){_0x3fc77a=_0x3fc77a||0xcc;return function(_0x3a3271){if(_0x3a3271){return _0x4c4956[_0x6adb('0x1d')](_0x3fc77a);}return _0x4c4956[_0x6adb('0x1e')](_0x3fc77a)['end']();};}function respondWithResult(_0x7e9c04,_0x93be46){_0x93be46=_0x93be46||0xc8;return function(_0x4e9df2){if(_0x4e9df2){return _0x7e9c04[_0x6adb('0x1e')](_0x93be46)[_0x6adb('0x1f')](_0x4e9df2);}};}function respondWithFilteredResult(_0x463627,_0x59ae23){return function(_0x2a28f3){if(_0x2a28f3){var _0xe7246f=typeof _0x59ae23[_0x6adb('0x20')]===_0x6adb('0x21')&&typeof _0x59ae23[_0x6adb('0x22')]===_0x6adb('0x21');var _0x1c7c87=_0x2a28f3['count'];var _0x34698c=_0xe7246f?0x0:_0x59ae23[_0x6adb('0x20')];var _0x2ad90b=_0xe7246f?_0x2a28f3[_0x6adb('0x23')]:_0x59ae23['offset']+_0x59ae23['limit'];var _0x5e4765;if(_0x2ad90b>=_0x1c7c87){_0x2ad90b=_0x1c7c87;_0x5e4765=0xc8;}else{_0x5e4765=0xce;}_0x463627['status'](_0x5e4765);return _0x463627['set'](_0x6adb('0x24'),_0x34698c+'-'+_0x2ad90b+'/'+_0x1c7c87)[_0x6adb('0x1f')](_0x2a28f3);}return null;};}function patchUpdates(_0x236435){return function(_0x18af5f){try{jsonpatch['apply'](_0x18af5f,_0x236435,!![]);}catch(_0x3b7cd6){return BPromise[_0x6adb('0x25')](_0x3b7cd6);}return _0x18af5f[_0x6adb('0x26')]();};}function saveUpdates(_0x2ba4e9,_0xf66ae6){return function(_0x1d27a8){if(_0x1d27a8){return _0x1d27a8[_0x6adb('0x27')](_0x2ba4e9)[_0x6adb('0x28')](function(_0x465869){return _0x465869;});}return null;};}function removeEntity(_0x1a62c7,_0x5df038){return function(_0x440731){if(_0x440731){return _0x440731[_0x6adb('0x29')]()[_0x6adb('0x28')](function(){_0x1a62c7['status'](0xcc)[_0x6adb('0x2a')]();});}};}function handleEntityNotFound(_0x4113ee,_0x4a556c){return function(_0x1798d1){if(!_0x1798d1){_0x4113ee[_0x6adb('0x1d')](0x194);}return _0x1798d1;};}function handleError(_0x1c3815,_0x58faf7){_0x58faf7=_0x58faf7||0x1f4;return function(_0x2f00a1){logger[_0x6adb('0x2b')](_0x2f00a1['stack']);if(_0x2f00a1['name']){delete _0x2f00a1['name'];}_0x1c3815[_0x6adb('0x1e')](_0x58faf7)[_0x6adb('0x2c')](_0x2f00a1);};}exports[_0x6adb('0x2d')]=function(_0x4261e0,_0x3acafa){var _0x369dbd={},_0xb9c0f8={},_0x148849={'count':0x0,'rows':[]};var _0x4505e5=_['map'](db[_0x6adb('0x2e')]['rawAttributes'],function(_0x5bc1b4){return{'name':_0x5bc1b4[_0x6adb('0x2f')],'type':_0x5bc1b4[_0x6adb('0x30')]['key']};});_0xb9c0f8[_0x6adb('0x31')]=_[_0x6adb('0x32')](_0x4505e5,_0x6adb('0x33'));_0xb9c0f8[_0x6adb('0x34')]=_['keys'](_0x4261e0['query']);_0xb9c0f8[_0x6adb('0x35')]=_['intersection'](_0xb9c0f8[_0x6adb('0x31')],_0xb9c0f8[_0x6adb('0x34')]);_0x369dbd[_0x6adb('0x36')]=_[_0x6adb('0x37')](_0xb9c0f8['model'],qs['fields'](_0x4261e0[_0x6adb('0x34')][_0x6adb('0x38')]));_0x369dbd[_0x6adb('0x36')]=_0x369dbd[_0x6adb('0x36')]['length']?_0x369dbd[_0x6adb('0x36')]:_0xb9c0f8[_0x6adb('0x31')];if(!_0x4261e0[_0x6adb('0x34')][_0x6adb('0x39')]('nolimit')){_0x369dbd[_0x6adb('0x22')]=qs[_0x6adb('0x22')](_0x4261e0[_0x6adb('0x34')]['limit']);_0x369dbd[_0x6adb('0x20')]=qs['offset'](_0x4261e0[_0x6adb('0x34')][_0x6adb('0x20')]);}_0x369dbd[_0x6adb('0x3a')]=qs['sort'](_0x4261e0[_0x6adb('0x34')][_0x6adb('0x3b')]);_0x369dbd[_0x6adb('0x3c')]=qs[_0x6adb('0x35')](_[_0x6adb('0x3d')](_0x4261e0['query'],_0xb9c0f8[_0x6adb('0x35')]),_0x4505e5);if(_0x4261e0[_0x6adb('0x34')]['filter']){_0x369dbd[_0x6adb('0x3c')]=_[_0x6adb('0x3e')](_0x369dbd[_0x6adb('0x3c')],{'$or':_[_0x6adb('0x32')](_0x4505e5,function(_0x13599b){if(_0x13599b[_0x6adb('0x30')]!=='VIRTUAL'){var _0x23ea0e={};_0x23ea0e[_0x13599b[_0x6adb('0x33')]]={'$like':'%'+_0x4261e0[_0x6adb('0x34')][_0x6adb('0x3f')]+'%'};return _0x23ea0e;}})});}_0x369dbd=_[_0x6adb('0x3e')]({},_0x369dbd,_0x4261e0[_0x6adb('0x40')]);var _0x4e5a23={'where':_0x369dbd[_0x6adb('0x3c')]};return db[_0x6adb('0x2e')]['count'](_0x4e5a23)['then'](function(_0x3c28bc){_0x148849[_0x6adb('0x23')]=_0x3c28bc;if(_0x4261e0['query'][_0x6adb('0x41')]){_0x369dbd['include']=[{'all':!![]}];}return db[_0x6adb('0x2e')][_0x6adb('0x42')](_0x369dbd);})[_0x6adb('0x28')](function(_0x5954b5){_0x148849['rows']=_0x5954b5;return _0x148849;})[_0x6adb('0x28')](respondWithFilteredResult(_0x3acafa,_0x369dbd))[_0x6adb('0x43')](handleError(_0x3acafa,null));};exports['show']=function(_0x5362cc,_0x1b5317){var _0x5c1282={'raw':!![],'where':{'id':_0x5362cc[_0x6adb('0x44')]['id']}},_0x249d58={};_0x249d58['model']=_[_0x6adb('0x45')](db['SalesforceField'][_0x6adb('0x46')]);_0x249d58[_0x6adb('0x34')]=_[_0x6adb('0x45')](_0x5362cc[_0x6adb('0x34')]);_0x249d58['filters']=_[_0x6adb('0x37')](_0x249d58[_0x6adb('0x31')],_0x249d58[_0x6adb('0x34')]);_0x5c1282[_0x6adb('0x36')]=_[_0x6adb('0x37')](_0x249d58[_0x6adb('0x31')],qs[_0x6adb('0x38')](_0x5362cc[_0x6adb('0x34')][_0x6adb('0x38')]));_0x5c1282[_0x6adb('0x36')]=_0x5c1282[_0x6adb('0x36')]['length']?_0x5c1282[_0x6adb('0x36')]:_0x249d58[_0x6adb('0x31')];if(_0x5362cc[_0x6adb('0x34')][_0x6adb('0x41')]){_0x5c1282[_0x6adb('0x47')]=[{'all':!![]}];}_0x5c1282=_[_0x6adb('0x3e')]({},_0x5c1282,_0x5362cc[_0x6adb('0x40')]);return db[_0x6adb('0x2e')][_0x6adb('0x48')](_0x5c1282)['then'](handleEntityNotFound(_0x1b5317,null))[_0x6adb('0x28')](respondWithResult(_0x1b5317,null))[_0x6adb('0x43')](handleError(_0x1b5317,null));};exports[_0x6adb('0x49')]=function(_0x462822,_0x2d8b79){return db[_0x6adb('0x2e')]['create'](_0x462822['body'],{})['then'](respondWithResult(_0x2d8b79,0xc9))[_0x6adb('0x43')](handleError(_0x2d8b79,null));};exports['update']=function(_0x405ee0,_0x171b4b){if(_0x405ee0['body']['id']){delete _0x405ee0['body']['id'];}return db[_0x6adb('0x2e')]['find']({'where':{'id':_0x405ee0['params']['id']}})[_0x6adb('0x28')](handleEntityNotFound(_0x171b4b,null))[_0x6adb('0x28')](saveUpdates(_0x405ee0[_0x6adb('0x4a')],null))[_0x6adb('0x28')](respondWithResult(_0x171b4b,null))[_0x6adb('0x43')](handleError(_0x171b4b,null));};exports[_0x6adb('0x29')]=function(_0xe22cf7,_0xcf16c5){return db['SalesforceField'][_0x6adb('0x48')]({'where':{'id':_0xe22cf7['params']['id']}})[_0x6adb('0x28')](handleEntityNotFound(_0xcf16c5,null))[_0x6adb('0x28')](removeEntity(_0xcf16c5,null))[_0x6adb('0x43')](handleError(_0xcf16c5,null));}; \ No newline at end of file diff --git a/server/api/intSalesforceField/intSalesforceField.model.js b/server/api/intSalesforceField/intSalesforceField.model.js index c545e5e..d351fdf 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 _0x84ec=['util','bluebird','request-promise','rimraf','../../config/environment','./intSalesforceField.attributes','exports','define','SalesforceField','int_salesforce_fields','salesforce_unique_index','idField','FieldId','lodash'];(function(_0x3de629,_0x240939){var _0x239e30=function(_0x3ef5af){while(--_0x3ef5af){_0x3de629['push'](_0x3de629['shift']());}};_0x239e30(++_0x240939);}(_0x84ec,0x8b));var _0xc84e=function(_0x3d80bd,_0x41985e){_0x3d80bd=_0x3d80bd-0x0;var _0x3f7b26=_0x84ec[_0x3d80bd];return _0x3f7b26;};'use strict';var _=require(_0xc84e('0x0'));var util=require(_0xc84e('0x1'));var logger=require('../../config/logger')('api');var moment=require('moment');var BPromise=require(_0xc84e('0x2'));var rp=require(_0xc84e('0x3'));var fs=require('fs');var path=require('path');var rimraf=require(_0xc84e('0x4'));var config=require(_0xc84e('0x5'));var attributes=require(_0xc84e('0x6'));module[_0xc84e('0x7')]=function(_0x2d1177,_0x963cb9){return _0x2d1177[_0xc84e('0x8')](_0xc84e('0x9'),attributes,{'tableName':_0xc84e('0xa'),'paranoid':![],'indexes':[{'name':_0xc84e('0xb'),'fields':[_0xc84e('0xc'),_0xc84e('0xd')],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file +var _0x55c4=['define','SalesforceField','salesforce_unique_index','idField','FieldId','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path'];(function(_0x4dbbdd,_0x272cf0){var _0x20d28d=function(_0x295729){while(--_0x295729){_0x4dbbdd['push'](_0x4dbbdd['shift']());}};_0x20d28d(++_0x272cf0);}(_0x55c4,0x1bf));var _0x455c=function(_0x58744b,_0x464752){_0x58744b=_0x58744b-0x0;var _0x56665d=_0x55c4[_0x58744b];return _0x56665d;};'use strict';var _=require(_0x455c('0x0'));var util=require(_0x455c('0x1'));var logger=require(_0x455c('0x2'))(_0x455c('0x3'));var moment=require(_0x455c('0x4'));var BPromise=require(_0x455c('0x5'));var rp=require(_0x455c('0x6'));var fs=require('fs');var path=require(_0x455c('0x7'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require('./intSalesforceField.attributes');module['exports']=function(_0x399152,_0x4b8f9b){return _0x399152[_0x455c('0x8')](_0x455c('0x9'),attributes,{'tableName':'int_salesforce_fields','paranoid':![],'indexes':[{'name':_0x455c('0xa'),'fields':[_0x455c('0xb'),_0x455c('0xc')],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/intSalesforceField/intSalesforceField.rpc.js b/server/api/intSalesforceField/intSalesforceField.rpc.js index 809b9cc..c6d2a31 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 _0xa704=['catch','lodash','moment','bluebird','randomstring','ioredis','../../config/utils','rpc','../../config/environment','request','then','info','SalesforceField,\x20%s,\x20%s','request\x20sent','SalesforceField,\x20%s,\x20%s,\x20%s','stringify','error','message','result'];(function(_0x46e363,_0x45d7e2){var _0x3fb059=function(_0x5e6274){while(--_0x5e6274){_0x46e363['push'](_0x46e363['shift']());}};_0x3fb059(++_0x45d7e2);}(_0xa704,0x10b));var _0x4a70=function(_0x4e4f0e,_0x1c3892){_0x4e4f0e=_0x4e4f0e-0x0;var _0x1a7219=_0xa704[_0x4e4f0e];return _0x1a7219;};'use strict';var _=require(_0x4a70('0x0'));var util=require('util');var moment=require(_0x4a70('0x1'));var BPromise=require(_0x4a70('0x2'));var rs=require(_0x4a70('0x3'));var fs=require('fs');var Redis=require(_0x4a70('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x4a70('0x5'));var logger=require('../../config/logger')(_0x4a70('0x6'));var config=require(_0x4a70('0x7'));var jayson=require('jayson/promise');var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0xa34124,_0x58f59a,_0x1d292a){return new BPromise(function(_0x5de1e6,_0xb6f353){return client[_0x4a70('0x8')](_0xa34124,_0x1d292a)[_0x4a70('0x9')](function(_0x15c907){logger[_0x4a70('0xa')](_0x4a70('0xb'),_0x58f59a,_0x4a70('0xc'));logger['debug'](_0x4a70('0xd'),_0x58f59a,'request\x20sent',JSON[_0x4a70('0xe')](_0x15c907));if(_0x15c907[_0x4a70('0xf')]){if(_0x15c907[_0x4a70('0xf')]['code']===0x1f4){logger[_0x4a70('0xf')](_0x4a70('0xb'),_0x58f59a,_0x15c907['error'][_0x4a70('0x10')]);return _0xb6f353(_0x15c907['error'][_0x4a70('0x10')]);}logger[_0x4a70('0xf')](_0x4a70('0xb'),_0x58f59a,_0x15c907['error'][_0x4a70('0x10')]);return _0x5de1e6(_0x15c907['error'][_0x4a70('0x10')]);}else{logger[_0x4a70('0xa')](_0x4a70('0xb'),_0x58f59a,_0x4a70('0xc'));_0x5de1e6(_0x15c907[_0x4a70('0x11')][_0x4a70('0x10')]);}})[_0x4a70('0x12')](function(_0x5aa6a6){logger[_0x4a70('0xf')](_0x4a70('0xb'),_0x58f59a,_0x5aa6a6);_0xb6f353(_0x5aa6a6);});});} \ No newline at end of file +var _0xb19b=['../../config/environment','client','request','SalesforceField,\x20%s,\x20%s','request\x20sent','debug','error','code','message','info','catch','lodash','util','bluebird','ioredis','../../mysqldb','../../config/utils','rpc'];(function(_0xb3339d,_0x8803d){var _0x4dce04=function(_0x42ead0){while(--_0x42ead0){_0xb3339d['push'](_0xb3339d['shift']());}};_0x4dce04(++_0x8803d);}(_0xb19b,0x77));var _0xbb19=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xb19b[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0xbb19('0x0'));var util=require(_0xbb19('0x1'));var moment=require('moment');var BPromise=require(_0xbb19('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xbb19('0x3'));var db=require(_0xbb19('0x4'))['db'];var utils=require(_0xbb19('0x5'));var logger=require('../../config/logger')(_0xbb19('0x6'));var config=require(_0xbb19('0x7'));var jayson=require('jayson/promise');var client=jayson[_0xbb19('0x8')]['http']({'port':0x232a});function respondWithRpcPromise(_0x247107,_0x4328d8,_0x52b4a8){return new BPromise(function(_0x100546,_0x48b70e){return client[_0xbb19('0x9')](_0x247107,_0x52b4a8)['then'](function(_0x1d4c24){logger['info'](_0xbb19('0xa'),_0x4328d8,_0xbb19('0xb'));logger[_0xbb19('0xc')]('SalesforceField,\x20%s,\x20%s,\x20%s',_0x4328d8,'request\x20sent',JSON['stringify'](_0x1d4c24));if(_0x1d4c24[_0xbb19('0xd')]){if(_0x1d4c24[_0xbb19('0xd')][_0xbb19('0xe')]===0x1f4){logger[_0xbb19('0xd')](_0xbb19('0xa'),_0x4328d8,_0x1d4c24[_0xbb19('0xd')]['message']);return _0x48b70e(_0x1d4c24[_0xbb19('0xd')][_0xbb19('0xf')]);}logger['error'](_0xbb19('0xa'),_0x4328d8,_0x1d4c24[_0xbb19('0xd')][_0xbb19('0xf')]);return _0x100546(_0x1d4c24[_0xbb19('0xd')]['message']);}else{logger[_0xbb19('0x10')]('SalesforceField,\x20%s,\x20%s',_0x4328d8,'request\x20sent');_0x100546(_0x1d4c24['result'][_0xbb19('0xf')]);}})[_0xbb19('0x11')](function(_0xab8e9c){logger[_0xbb19('0xd')](_0xbb19('0xa'),_0x4328d8,_0xab8e9c);_0x48b70e(_0xab8e9c);});});} \ No newline at end of file diff --git a/server/api/intServicenowAccount/index.js b/server/api/intServicenowAccount/index.js index fa44c84..85da384 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 _0xd245=['exports','multer','util','path','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','isAuthenticated','get','/:id','show','/:id/configurations','getConfigurations','getFields','post','addConfiguration','put','delete','destroy'];(function(_0x3ab9ee,_0x4a74b8){var _0x82ee88=function(_0x6ccc7e){while(--_0x6ccc7e){_0x3ab9ee['push'](_0x3ab9ee['shift']());}};_0x82ee88(++_0x4a74b8);}(_0xd245,0xd3));var _0x5d24=function(_0x4709c8,_0x3384ca){_0x4709c8=_0x4709c8-0x0;var _0x478cdd=_0xd245[_0x4709c8];return _0x478cdd;};'use strict';var multer=require(_0x5d24('0x0'));var util=require(_0x5d24('0x1'));var path=require(_0x5d24('0x2'));var timeout=require('connect-timeout');var express=require(_0x5d24('0x3'));var router=express[_0x5d24('0x4')]();var fs_extra=require(_0x5d24('0x5'));var auth=require(_0x5d24('0x6'));var interaction=require(_0x5d24('0x7'));var config=require('../../config/environment');var controller=require('./intServicenowAccount.controller');router['get']('/',auth[_0x5d24('0x8')](),controller['index']);router[_0x5d24('0x9')](_0x5d24('0xa'),auth[_0x5d24('0x8')](),controller[_0x5d24('0xb')]);router[_0x5d24('0x9')](_0x5d24('0xc'),auth['isAuthenticated'](),controller[_0x5d24('0xd')]);router['get']('/:id/fields',auth[_0x5d24('0x8')](),controller[_0x5d24('0xe')]);router[_0x5d24('0xf')]('/',auth[_0x5d24('0x8')](),controller['create']);router['post'](_0x5d24('0xc'),auth['isAuthenticated'](),controller[_0x5d24('0x10')]);router[_0x5d24('0x11')]('/:id',auth[_0x5d24('0x8')](),controller['update']);router[_0x5d24('0x12')]('/:id',auth[_0x5d24('0x8')](),controller[_0x5d24('0x13')]);module[_0x5d24('0x14')]=router; \ No newline at end of file +var _0x84be=['../../components/interaction/service','./intServicenowAccount.controller','get','isAuthenticated','show','/:id/configurations','getConfigurations','getFields','post','create','addConfiguration','/:id','update','delete','destroy','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service'];(function(_0x4fcd03,_0x279590){var _0x311ff3=function(_0x231352){while(--_0x231352){_0x4fcd03['push'](_0x4fcd03['shift']());}};_0x311ff3(++_0x279590);}(_0x84be,0xc7));var _0xe84b=function(_0xb0f7c3,_0x4eae95){_0xb0f7c3=_0xb0f7c3-0x0;var _0x28ea68=_0x84be[_0xb0f7c3];return _0x28ea68;};'use strict';var multer=require(_0xe84b('0x0'));var util=require(_0xe84b('0x1'));var path=require(_0xe84b('0x2'));var timeout=require(_0xe84b('0x3'));var express=require(_0xe84b('0x4'));var router=express[_0xe84b('0x5')]();var fs_extra=require(_0xe84b('0x6'));var auth=require(_0xe84b('0x7'));var interaction=require(_0xe84b('0x8'));var config=require('../../config/environment');var controller=require(_0xe84b('0x9'));router[_0xe84b('0xa')]('/',auth[_0xe84b('0xb')](),controller['index']);router['get']('/:id',auth[_0xe84b('0xb')](),controller[_0xe84b('0xc')]);router[_0xe84b('0xa')](_0xe84b('0xd'),auth[_0xe84b('0xb')](),controller[_0xe84b('0xe')]);router[_0xe84b('0xa')]('/:id/fields',auth[_0xe84b('0xb')](),controller[_0xe84b('0xf')]);router[_0xe84b('0x10')]('/',auth['isAuthenticated'](),controller[_0xe84b('0x11')]);router[_0xe84b('0x10')](_0xe84b('0xd'),auth[_0xe84b('0xb')](),controller[_0xe84b('0x12')]);router['put'](_0xe84b('0x13'),auth[_0xe84b('0xb')](),controller[_0xe84b('0x14')]);router[_0xe84b('0x15')](_0xe84b('0x13'),auth[_0xe84b('0xb')](),controller[_0xe84b('0x16')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/intServicenowAccount/intServicenowAccount.attributes.js b/server/api/intServicenowAccount/intServicenowAccount.attributes.js index 6252053..fc90802 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 _0x5a27=['STRING','username','remoteUri','sequelize','exports'];(function(_0x527059,_0x224ffb){var _0x44ed63=function(_0xa60c93){while(--_0xa60c93){_0x527059['push'](_0x527059['shift']());}};_0x44ed63(++_0x224ffb);}(_0x5a27,0x12a));var _0x75a2=function(_0x38c699,_0x56fea7){_0x38c699=_0x38c699-0x0;var _0x3b1ded=_0x5a27[_0x38c699];return _0x3b1ded;};'use strict';var Sequelize=require(_0x75a2('0x0'));module[_0x75a2('0x1')]={'name':{'type':Sequelize[_0x75a2('0x2')]},'description':{'type':Sequelize[_0x75a2('0x2')]},'username':{'type':Sequelize[_0x75a2('0x2')],'unique':_0x75a2('0x3')},'password':{'type':Sequelize['STRING']},'email':{'type':Sequelize[_0x75a2('0x2')]},'remoteUri':{'type':Sequelize[_0x75a2('0x2')],'unique':_0x75a2('0x4')},'serverUrl':{'type':Sequelize[_0x75a2('0x2')],'allowNull':![]}}; \ No newline at end of file +var _0xf73c=['remoteUri','sequelize','exports','STRING','username'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xf73c,0xd3));var _0xcf73=function(_0x3dbde4,_0x81723d){_0x3dbde4=_0x3dbde4-0x0;var _0x511b74=_0xf73c[_0x3dbde4];return _0x511b74;};'use strict';var Sequelize=require(_0xcf73('0x0'));module[_0xcf73('0x1')]={'name':{'type':Sequelize[_0xcf73('0x2')]},'description':{'type':Sequelize[_0xcf73('0x2')]},'username':{'type':Sequelize['STRING'],'unique':_0xcf73('0x3')},'password':{'type':Sequelize[_0xcf73('0x2')]},'email':{'type':Sequelize[_0xcf73('0x2')]},'remoteUri':{'type':Sequelize['STRING'],'unique':_0xcf73('0x4')},'serverUrl':{'type':Sequelize['STRING'],'allowNull':![]}}; \ No newline at end of file diff --git a/server/api/intServicenowAccount/intServicenowAccount.controller.js b/server/api/intServicenowAccount/intServicenowAccount.controller.js index fc1f037..c651d60 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 _0x7c93=['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/environment','../../config/license/util','../../mysqldb','../../components/integrations/configuration','status','end','json','offset','limit','undefined','count','set','Content-Range','reject','save','update','then','destroy','sendStatus','stack','name','send','map','ServicenowAccount','rawAttributes','fieldName','key','keys','filters','intersection','model','query','attributes','fields','nolimit','order','sort','where','pick','filter','type','VIRTUAL','merge','options','include','findAll','rows','catch','show','params','length','includeAll','find','create','body','getConfigurations','addConfiguration','findOne','AccountId','Subjects','getSubjects','channel','Descriptions','getDescriptions','ServicenowField','getFields','hold_reason','subcategory','close_code','notify','incident_state','severity','category','parent','caused_by','watch_list','upon_reject','sys_updated_on','number','resolved_by','sys_updated_by','opened_by','user_input','sys_created_on','state','sys_created_by','calendar_stc','closed_at','delivery_plan','impact','active','business_service','priority','sys_domain_path','rfc','work_end','reopened_time','resolved_at','caller_id','approval_set','work_notes','short_description','delivery_task','work_start','business_stc','additional_assignee_list','description','calendar_duration','sys_class_name','follow_up','parent_incident','sys_id','contact_type','urgency','problem_id','reassignment_count','activity_due','assigned_to','comments','sla_due','comments_and_work_notes','sys_mod_count','sys_tags','escalation','upon_approval','correlation_id','password','email','remoteUri','serverUrl','slice','substring','lastIndexOf','username','GET','result','log','incident\x20table\x20objects','remove','forEach','internalType','label','all','assign','TCL:\x20_object','includes','push','concat','ServiceNow\x20error:\x20','test','statusCode','error','boolean','True','true','False','sys_choice?sysparm_query=name=incident^element=','inactive','false','eml-format','zip-dir','fast-json-patch','moment','bluebird','mustache','util'];(function(_0x49a4d1,_0x2bc356){var _0x13699d=function(_0x12f762){while(--_0x12f762){_0x49a4d1['push'](_0x49a4d1['shift']());}};_0x13699d(++_0x2bc356);}(_0x7c93,0x165));var _0x37c9=function(_0xb43734,_0x858446){_0xb43734=_0xb43734-0x0;var _0x1431db=_0x7c93[_0xb43734];return _0x1431db;};'use strict';var emlformat=require(_0x37c9('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x37c9('0x1'));var jsonpatch=require(_0x37c9('0x2'));var rp=require('request-promise');var moment=require(_0x37c9('0x3'));var BPromise=require(_0x37c9('0x4'));var Mustache=require(_0x37c9('0x5'));var util=require(_0x37c9('0x6'));var path=require(_0x37c9('0x7'));var sox=require(_0x37c9('0x8'));var csv=require(_0x37c9('0x9'));var ejs=require(_0x37c9('0xa'));var fs=require('fs');var fs_extra=require(_0x37c9('0xb'));var _=require(_0x37c9('0xc'));var squel=require(_0x37c9('0xd'));var crypto=require(_0x37c9('0xe'));var jsforce=require(_0x37c9('0xf'));var deskjs=require(_0x37c9('0x10'));var toCsv=require('to-csv');var querystring=require(_0x37c9('0x11'));var Papa=require(_0x37c9('0x12'));var Redis=require('ioredis');var authService=require(_0x37c9('0x13'));var qs=require(_0x37c9('0x14'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x37c9('0x15'));var logger=require('../../config/logger')(_0x37c9('0x16'));var utils=require('../../config/utils');var config=require(_0x37c9('0x17'));var licenseUtil=require(_0x37c9('0x18'));var db=require(_0x37c9('0x19'))['db'];var integrations=require(_0x37c9('0x1a'));function respondWithStatusCode(_0x56415a,_0x1e894b){_0x1e894b=_0x1e894b||0xcc;return function(_0x594ed1){if(_0x594ed1){return _0x56415a['sendStatus'](_0x1e894b);}return _0x56415a[_0x37c9('0x1b')](_0x1e894b)[_0x37c9('0x1c')]();};}function respondWithResult(_0x453e82,_0x39af8a){_0x39af8a=_0x39af8a||0xc8;return function(_0x23f0d5){if(_0x23f0d5){return _0x453e82['status'](_0x39af8a)[_0x37c9('0x1d')](_0x23f0d5);}};}function respondWithFilteredResult(_0x510575,_0x4315b7){return function(_0x20d8ed){if(_0x20d8ed){var _0x2f4f24=typeof _0x4315b7[_0x37c9('0x1e')]==='undefined'&&typeof _0x4315b7[_0x37c9('0x1f')]===_0x37c9('0x20');var _0x74e510=_0x20d8ed['count'];var _0x2ff253=_0x2f4f24?0x0:_0x4315b7['offset'];var _0x1d53c1=_0x2f4f24?_0x20d8ed[_0x37c9('0x21')]:_0x4315b7[_0x37c9('0x1e')]+_0x4315b7[_0x37c9('0x1f')];var _0x4ce029;if(_0x1d53c1>=_0x74e510){_0x1d53c1=_0x74e510;_0x4ce029=0xc8;}else{_0x4ce029=0xce;}_0x510575[_0x37c9('0x1b')](_0x4ce029);return _0x510575[_0x37c9('0x22')](_0x37c9('0x23'),_0x2ff253+'-'+_0x1d53c1+'/'+_0x74e510)[_0x37c9('0x1d')](_0x20d8ed);}return null;};}function patchUpdates(_0x265c47){return function(_0x2ef49e){try{jsonpatch['apply'](_0x2ef49e,_0x265c47,!![]);}catch(_0xfbba97){return BPromise[_0x37c9('0x24')](_0xfbba97);}return _0x2ef49e[_0x37c9('0x25')]();};}function saveUpdates(_0x4b68f0,_0x2a5f4b){return function(_0x5d1530){if(_0x5d1530){return _0x5d1530[_0x37c9('0x26')](_0x4b68f0)[_0x37c9('0x27')](function(_0x2e90d0){return _0x2e90d0;});}return null;};}function removeEntity(_0x468b56,_0x3f7479){return function(_0x1687bd){if(_0x1687bd){return _0x1687bd[_0x37c9('0x28')]()[_0x37c9('0x27')](function(){_0x468b56[_0x37c9('0x1b')](0xcc)[_0x37c9('0x1c')]();});}};}function handleEntityNotFound(_0xdbbd10,_0x27ca2d){return function(_0x5d00c3){if(!_0x5d00c3){_0xdbbd10[_0x37c9('0x29')](0x194);}return _0x5d00c3;};}function handleError(_0x4540c3,_0x4f9b8a){_0x4f9b8a=_0x4f9b8a||0x1f4;return function(_0x50b74a){logger['error'](_0x50b74a[_0x37c9('0x2a')]);if(_0x50b74a[_0x37c9('0x2b')]){delete _0x50b74a[_0x37c9('0x2b')];}_0x4540c3[_0x37c9('0x1b')](_0x4f9b8a)[_0x37c9('0x2c')](_0x50b74a);};}exports['index']=function(_0xa1196e,_0x1596ce){var _0x31c8ef={},_0x271c3d={},_0x2a7d40={'count':0x0,'rows':[]};var _0x156e66=_[_0x37c9('0x2d')](db[_0x37c9('0x2e')][_0x37c9('0x2f')],function(_0x6ab19f){return{'name':_0x6ab19f[_0x37c9('0x30')],'type':_0x6ab19f['type'][_0x37c9('0x31')]};});_0x271c3d['model']=_[_0x37c9('0x2d')](_0x156e66,_0x37c9('0x2b'));_0x271c3d['query']=_[_0x37c9('0x32')](_0xa1196e['query']);_0x271c3d[_0x37c9('0x33')]=_[_0x37c9('0x34')](_0x271c3d[_0x37c9('0x35')],_0x271c3d[_0x37c9('0x36')]);_0x31c8ef[_0x37c9('0x37')]=_[_0x37c9('0x34')](_0x271c3d[_0x37c9('0x35')],qs[_0x37c9('0x38')](_0xa1196e[_0x37c9('0x36')][_0x37c9('0x38')]));_0x31c8ef[_0x37c9('0x37')]=_0x31c8ef[_0x37c9('0x37')]['length']?_0x31c8ef[_0x37c9('0x37')]:_0x271c3d[_0x37c9('0x35')];if(!_0xa1196e[_0x37c9('0x36')]['hasOwnProperty'](_0x37c9('0x39'))){_0x31c8ef[_0x37c9('0x1f')]=qs[_0x37c9('0x1f')](_0xa1196e['query'][_0x37c9('0x1f')]);_0x31c8ef[_0x37c9('0x1e')]=qs['offset'](_0xa1196e[_0x37c9('0x36')][_0x37c9('0x1e')]);}_0x31c8ef[_0x37c9('0x3a')]=qs['sort'](_0xa1196e[_0x37c9('0x36')][_0x37c9('0x3b')]);_0x31c8ef[_0x37c9('0x3c')]=qs[_0x37c9('0x33')](_[_0x37c9('0x3d')](_0xa1196e['query'],_0x271c3d[_0x37c9('0x33')]),_0x156e66);if(_0xa1196e['query'][_0x37c9('0x3e')]){_0x31c8ef[_0x37c9('0x3c')]=_['merge'](_0x31c8ef[_0x37c9('0x3c')],{'$or':_['map'](_0x156e66,function(_0x313b79){if(_0x313b79[_0x37c9('0x3f')]!==_0x37c9('0x40')){var _0x2044a2={};_0x2044a2[_0x313b79[_0x37c9('0x2b')]]={'$like':'%'+_0xa1196e['query'][_0x37c9('0x3e')]+'%'};return _0x2044a2;}})});}_0x31c8ef=_[_0x37c9('0x41')]({},_0x31c8ef,_0xa1196e[_0x37c9('0x42')]);var _0x41e896={'where':_0x31c8ef[_0x37c9('0x3c')]};return db['ServicenowAccount'][_0x37c9('0x21')](_0x41e896)[_0x37c9('0x27')](function(_0x309936){_0x2a7d40[_0x37c9('0x21')]=_0x309936;if(_0xa1196e[_0x37c9('0x36')]['includeAll']){_0x31c8ef[_0x37c9('0x43')]=[{'all':!![]}];}return db[_0x37c9('0x2e')][_0x37c9('0x44')](_0x31c8ef);})[_0x37c9('0x27')](function(_0x3cf324){_0x2a7d40[_0x37c9('0x45')]=_0x3cf324;return _0x2a7d40;})[_0x37c9('0x27')](respondWithFilteredResult(_0x1596ce,_0x31c8ef))[_0x37c9('0x46')](handleError(_0x1596ce,null));};exports[_0x37c9('0x47')]=function(_0x12de2c,_0x293ade){var _0x187c8c={'raw':![],'where':{'id':_0x12de2c[_0x37c9('0x48')]['id']}},_0x3886f9={};_0x3886f9[_0x37c9('0x35')]=_[_0x37c9('0x32')](db[_0x37c9('0x2e')]['rawAttributes']);_0x3886f9['query']=_[_0x37c9('0x32')](_0x12de2c['query']);_0x3886f9[_0x37c9('0x33')]=_[_0x37c9('0x34')](_0x3886f9[_0x37c9('0x35')],_0x3886f9[_0x37c9('0x36')]);_0x187c8c[_0x37c9('0x37')]=_[_0x37c9('0x34')](_0x3886f9[_0x37c9('0x35')],qs[_0x37c9('0x38')](_0x12de2c['query']['fields']));_0x187c8c['attributes']=_0x187c8c[_0x37c9('0x37')][_0x37c9('0x49')]?_0x187c8c[_0x37c9('0x37')]:_0x3886f9[_0x37c9('0x35')];if(_0x12de2c[_0x37c9('0x36')][_0x37c9('0x4a')]){_0x187c8c[_0x37c9('0x43')]=[{'all':!![]}];}_0x187c8c=_[_0x37c9('0x41')]({},_0x187c8c,_0x12de2c[_0x37c9('0x42')]);return db[_0x37c9('0x2e')][_0x37c9('0x4b')](_0x187c8c)[_0x37c9('0x27')](handleEntityNotFound(_0x293ade,null))[_0x37c9('0x27')](respondWithResult(_0x293ade,null))[_0x37c9('0x46')](handleError(_0x293ade,null));};exports[_0x37c9('0x4c')]=function(_0x109268,_0x1c536d){return db['ServicenowAccount'][_0x37c9('0x4c')](_0x109268['body'],{})[_0x37c9('0x27')](respondWithResult(_0x1c536d,0xc9))[_0x37c9('0x46')](handleError(_0x1c536d,null));};exports[_0x37c9('0x26')]=function(_0x97f6c8,_0x231fcb){if(_0x97f6c8[_0x37c9('0x4d')]['id']){delete _0x97f6c8['body']['id'];}return db[_0x37c9('0x2e')]['find']({'where':{'id':_0x97f6c8[_0x37c9('0x48')]['id']}})['then'](handleEntityNotFound(_0x231fcb,null))[_0x37c9('0x27')](saveUpdates(_0x97f6c8[_0x37c9('0x4d')],null))[_0x37c9('0x27')](respondWithResult(_0x231fcb,null))[_0x37c9('0x46')](handleError(_0x231fcb,null));};exports[_0x37c9('0x28')]=function(_0x5a1216,_0xb2cbd5){return db[_0x37c9('0x2e')]['find']({'where':{'id':_0x5a1216['params']['id']}})[_0x37c9('0x27')](handleEntityNotFound(_0xb2cbd5,null))[_0x37c9('0x27')](removeEntity(_0xb2cbd5,null))['catch'](handleError(_0xb2cbd5,null));};exports[_0x37c9('0x4e')]=function(_0x33c99d,_0x9034a7,_0x25361d){var _0x2888ab={};var _0x17d67e={};var _0x9983a1;var _0xcd75c9;return db[_0x37c9('0x2e')]['findOne']({'where':{'id':_0x33c99d[_0x37c9('0x48')]['id']}})['then'](handleEntityNotFound(_0x9034a7,null))[_0x37c9('0x27')](function(_0x5b652d){if(_0x5b652d){_0x9983a1=_0x5b652d;_0x17d67e[_0x37c9('0x35')]=_[_0x37c9('0x32')](db['ServicenowConfiguration']['rawAttributes']);_0x17d67e[_0x37c9('0x36')]=_[_0x37c9('0x32')](_0x33c99d['query']);_0x17d67e[_0x37c9('0x33')]=_[_0x37c9('0x34')](_0x17d67e[_0x37c9('0x35')],_0x17d67e[_0x37c9('0x36')]);_0x2888ab[_0x37c9('0x37')]=_['intersection'](_0x17d67e[_0x37c9('0x35')],qs[_0x37c9('0x38')](_0x33c99d[_0x37c9('0x36')]['fields']));_0x2888ab['attributes']=_0x2888ab['attributes'][_0x37c9('0x49')]?_0x2888ab['attributes']:_0x17d67e[_0x37c9('0x35')];_0x2888ab['order']=qs[_0x37c9('0x3b')](_0x33c99d[_0x37c9('0x36')][_0x37c9('0x3b')]);_0x2888ab[_0x37c9('0x3c')]=qs['filters'](_[_0x37c9('0x3d')](_0x33c99d[_0x37c9('0x36')],_0x17d67e[_0x37c9('0x33')]));if(_0x33c99d['query'][_0x37c9('0x3e')]){_0x2888ab[_0x37c9('0x3c')]=_['merge'](_0x2888ab[_0x37c9('0x3c')],{'$or':_[_0x37c9('0x2d')](_0x2888ab[_0x37c9('0x37')],function(_0x5397f4){var _0x3201bc={};_0x3201bc[_0x5397f4]={'$like':'%'+_0x33c99d[_0x37c9('0x36')][_0x37c9('0x3e')]+'%'};return _0x3201bc;})});}_0x2888ab=_[_0x37c9('0x41')]({},_0x2888ab,_0x33c99d['options']);return _0x9983a1[_0x37c9('0x4e')](_0x2888ab);}})[_0x37c9('0x27')](function(_0x5c0155){if(_0x5c0155){_0xcd75c9=_0x5c0155['length'];if(!_0x33c99d[_0x37c9('0x36')]['hasOwnProperty'](_0x37c9('0x39'))){_0x2888ab[_0x37c9('0x1f')]=qs['limit'](_0x33c99d[_0x37c9('0x36')]['limit']);_0x2888ab[_0x37c9('0x1e')]=qs['offset'](_0x33c99d[_0x37c9('0x36')][_0x37c9('0x1e')]);}return _0x9983a1[_0x37c9('0x4e')](_0x2888ab);}})[_0x37c9('0x27')](function(_0x54f6e4){if(_0x54f6e4){return _0x54f6e4?{'count':_0xcd75c9,'rows':_0x54f6e4}:null;}})[_0x37c9('0x27')](respondWithResult(_0x9034a7,null))[_0x37c9('0x46')](handleError(_0x9034a7,null));};exports[_0x37c9('0x4f')]=function(_0x1c3303,_0x525adb,_0x39cf38){if(_0x1c3303[_0x37c9('0x4d')]['id']){delete _0x1c3303['body']['id'];}return db['ServicenowAccount'][_0x37c9('0x50')]({'where':{'id':_0x1c3303[_0x37c9('0x48')]['id']}})[_0x37c9('0x27')](handleEntityNotFound(_0x525adb,null))['then'](function(_0x106ae7){if(_0x106ae7){_0x1c3303[_0x37c9('0x4d')][_0x37c9('0x51')]=_0x106ae7['id'];_0x1c3303[_0x37c9('0x4d')][_0x37c9('0x52')]=integrations[_0x37c9('0x53')](_0x1c3303['body'][_0x37c9('0x54')],_0x1c3303['body'][_0x37c9('0x3f')]);_0x1c3303[_0x37c9('0x4d')][_0x37c9('0x55')]=integrations[_0x37c9('0x56')](_0x1c3303[_0x37c9('0x4d')][_0x37c9('0x54')],_0x1c3303[_0x37c9('0x4d')]['type']);return db['ServicenowConfiguration'][_0x37c9('0x4c')](_0x1c3303[_0x37c9('0x4d')],{'include':[{'model':db['ServicenowField'],'as':_0x37c9('0x52')},{'model':db[_0x37c9('0x57')],'as':_0x37c9('0x55')}]});}return null;})[_0x37c9('0x27')](respondWithResult(_0x525adb,null))[_0x37c9('0x46')](handleError(_0x525adb,null));};exports[_0x37c9('0x58')]=function(_0x165eaa,_0x1996ac,_0x472d05){var _0x414588=['made_sla',_0x37c9('0x59'),'knowledge',_0x37c9('0x5a'),_0x37c9('0x5b'),_0x37c9('0x5c'),_0x37c9('0x5d'),_0x37c9('0x5e'),_0x37c9('0x5f')];var _0x54cac4=[_0x37c9('0x60'),'made_sla',_0x37c9('0x61'),_0x37c9('0x62'),_0x37c9('0x63'),_0x37c9('0x64'),'child_incidents',_0x37c9('0x59'),'approval_history',_0x37c9('0x65'),_0x37c9('0x66'),_0x37c9('0x67'),_0x37c9('0x68'),_0x37c9('0x69'),_0x37c9('0x6a'),'sys_domain',_0x37c9('0x6b'),_0x37c9('0x6c'),'knowledge',_0x37c9('0x3a'),_0x37c9('0x6d'),_0x37c9('0x6e'),'cmdb_ci',_0x37c9('0x6f'),_0x37c9('0x70'),_0x37c9('0x71'),'work_notes_list',_0x37c9('0x72'),_0x37c9('0x73'),_0x37c9('0x74'),_0x37c9('0x75'),'time_worked','expected_start','opened_at','business_duration','group_list',_0x37c9('0x76'),_0x37c9('0x77'),_0x37c9('0x78'),_0x37c9('0x79'),_0x37c9('0x7a'),'subcategory',_0x37c9('0x7b'),_0x37c9('0x7c'),_0x37c9('0x5b'),'correlation_display',_0x37c9('0x7d'),_0x37c9('0x7e'),'assignment_group',_0x37c9('0x7f'),_0x37c9('0x80'),_0x37c9('0x81'),_0x37c9('0x82'),_0x37c9('0x5c'),_0x37c9('0x83'),'close_notes','closed_by',_0x37c9('0x84'),_0x37c9('0x85'),_0x37c9('0x86'),_0x37c9('0x87'),'reopened_by',_0x37c9('0x5d'),_0x37c9('0x88'),_0x37c9('0x89'),'company',_0x37c9('0x8a'),_0x37c9('0x8b'),_0x37c9('0x8c'),_0x37c9('0x5e'),_0x37c9('0x8d'),_0x37c9('0x8e'),'approval',_0x37c9('0x8f'),'due_date',_0x37c9('0x90'),'reopen_count',_0x37c9('0x91'),_0x37c9('0x92'),_0x37c9('0x93'),_0x37c9('0x94'),'location',_0x37c9('0x5f')];var _0x451ce0='';var _0x3f7e12='';var _0x36a6e9=[];var _0x1e3085='';var _0x5405c2='';var _0x1b0358=[];var _0x11a490='';var _0x44bea4='';var _0x1cb71a={};var _0x390aa3='';return db[_0x37c9('0x2e')]['findOne']({'where':{'id':_0x165eaa[_0x37c9('0x48')]['id']},'attributes':['id','username',_0x37c9('0x95'),_0x37c9('0x96'),_0x37c9('0x97'),_0x37c9('0x98')]})[_0x37c9('0x27')](handleEntityNotFound(_0x1996ac,null))[_0x37c9('0x27')](function(_0x137e64){if(_0x137e64){_0x390aa3=_0x137e64['remoteUri'];var _0x457b7e=_0x390aa3[_0x37c9('0x99')](-0x1);if(_0x457b7e==='/'){_0x390aa3=_0x390aa3[_0x37c9('0x9a')](0x0,_0x390aa3[_0x37c9('0x9b')](_0x457b7e));}_0x44bea4=util['format']('%s/api/now/doc/table/schema/',_0x390aa3);_0x11a490=util['format']('%s/api/now/table/',_0x390aa3);_0x1cb71a={'user':_0x137e64[_0x37c9('0x9c')],'pass':_0x137e64['password']};var _0x20a90a={'method':_0x37c9('0x9d'),'uri':_0x44bea4+'incident?sysparm_display_value=all','auth':_0x1cb71a,'json':!![]};return rp(_0x20a90a);}})['then'](function(_0x32e06a){if(_0x32e06a[_0x37c9('0x9e')][_0x37c9('0x49')]>0x0){_0x451ce0=_0x32e06a[_0x37c9('0x9e')];}console[_0x37c9('0x9f')](_0x37c9('0xa0'),_0x451ce0);_0x1b0358=[];_0x3f7e12=Object['assign']([],_0x451ce0);_[_0x37c9('0xa1')](_0x3f7e12,function(_0x50f725){return!_0x414588['includes'](_0x50f725[_0x37c9('0x2b')]);});_0x3f7e12[_0x37c9('0xa2')](function(_0x1ef363){var _0xa8f6e1=createFieldObject(_0x11a490,_0x1cb71a,_0x1ef363[_0x37c9('0xa3')],_0x1ef363[_0x37c9('0x2b')],_0x1ef363[_0x37c9('0xa4')],![]);_0x1b0358['push'](_0xa8f6e1);});return Promise[_0x37c9('0xa5')](_0x1b0358);})['then'](function(_0x5d4bab){_0x36a6e9=_0x5d4bab;_0x1e3085=Object[_0x37c9('0xa6')]([],_0x451ce0);console[_0x37c9('0x9f')](_0x37c9('0xa7'),_0x451ce0);_['remove'](_0x1e3085,function(_0x14b2cd){return _0x54cac4[_0x37c9('0xa8')](_0x14b2cd[_0x37c9('0x2b')]);});console['log']('TCL:\x20exports.getEntityFields\x20->\x20_objectsCustom',_0x1e3085);_0x1b0358=[];_0x1e3085[_0x37c9('0xa2')](function(_0x35dc44){var _0x58cc71=createFieldObject(_0x11a490,_0x1cb71a,_0x35dc44[_0x37c9('0xa3')],_0x35dc44[_0x37c9('0x2b')],_0x35dc44[_0x37c9('0xa4')],!![]);_0x1b0358[_0x37c9('0xa9')](_0x58cc71);});return Promise['all'](_0x1b0358);})[_0x37c9('0x27')](function(_0x248fe2){_0x5405c2=_0x248fe2;var _0x4557bc=_0x36a6e9[_0x37c9('0xaa')](_0x5405c2);return{'count':_0x4557bc[_0x37c9('0x49')],'rows':_0x4557bc};})[_0x37c9('0x27')](respondWithResult(_0x1996ac,null))[_0x37c9('0x46')](function(_0x41330b){console[_0x37c9('0x9f')](_0x37c9('0xab')+_0x41330b);var _0x8b4770=_0x165eaa[_0x37c9('0x36')][_0x37c9('0xac')]?0x1f4:_0x41330b[_0x37c9('0xad')]||0x1f4;logger[_0x37c9('0xae')](_0x41330b[_0x37c9('0x2a')]);delete _0x41330b[_0x37c9('0x2b')];if(_0x8b4770===0x191){_0x8b4770=0x190;}_0x1996ac['status'](_0x8b4770)[_0x37c9('0x2c')](_0x165eaa['query'][_0x37c9('0xac')]?{'message':'Wrong\x20credentials','statusCode':_0x41330b[_0x37c9('0xad')]}:_0x41330b);});};function createFieldObject(_0x3753bd,_0x4bb143,_0x5172eb,_0x17fd1e,_0x33b4f1,_0x4382cf){return new Promise(function(_0x4ac72f,_0xaebedb){var _0x2f38f1={'id':_0x17fd1e,'name':_0x33b4f1,'custom':_0x4382cf};if(_0x5172eb===_0x37c9('0xaf')){_0x2f38f1['options']=[{'name':_0x37c9('0xb0'),'value':_0x37c9('0xb1')},{'name':_0x37c9('0xb2'),'value':'false'}];_0x4ac72f(_0x2f38f1);}else{var _0x393d57={'method':'GET','uri':_0x3753bd+_0x37c9('0xb3')+_0x17fd1e,'auth':_0x4bb143,'json':!![]};return rp(_0x393d57)['then'](function(_0x5b6c50){var _0x10338e=[];if(_0x5b6c50['result']['length']>0x0){_0x5b6c50[_0x37c9('0x9e')]['forEach'](function(_0x156e0b){if(_0x156e0b[_0x37c9('0xb4')]===_0x37c9('0xb5')){var _0x1ac46e={'name':_0x156e0b[_0x37c9('0xa4')],'value':_0x156e0b['value']};_0x10338e[_0x37c9('0xa9')](_0x1ac46e);}});}_0x2f38f1[_0x37c9('0x42')]=_0x10338e;if(_0x2f38f1[_0x37c9('0x42')][_0x37c9('0x49')]>0x0){_0x4ac72f(_0x2f38f1);}else{if(_0x4382cf==![]){_0x4ac72f();}else{_0x4ac72f(_0x2f38f1);}}});}});} \ No newline at end of file +var _0x4917=['label','push','all','TCL:\x20_object','remove','TCL:\x20exports.getEntityFields\x20->\x20_objectsCustom','concat','ServiceNow\x20error:\x20','test','statusCode','error','Wrong\x20credentials','boolean','True','true','False','false','sys_choice?sysparm_query=name=incident^element=','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','mustache','path','sox','to-csv','ejs','squel','crypto','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','sendStatus','status','end','json','offset','undefined','count','limit','set','Content-Range','apply','reject','save','destroy','then','stack','name','send','index','map','ServicenowAccount','rawAttributes','fieldName','model','query','attributes','intersection','fields','length','hasOwnProperty','sort','where','filters','pick','filter','merge','VIRTUAL','options','include','rows','catch','params','keys','includeAll','find','create','body','getConfigurations','findOne','ServicenowConfiguration','order','nolimit','addConfiguration','Subjects','getSubjects','type','Descriptions','getDescriptions','channel','ServicenowField','getFields','hold_reason','knowledge','subcategory','close_code','notify','severity','category','parent','caused_by','watch_list','upon_reject','child_incidents','approval_history','resolved_by','opened_by','user_input','sys_created_on','state','calendar_stc','closed_at','cmdb_ci','delivery_plan','impact','active','work_notes_list','business_service','priority','sys_domain_path','time_worked','expected_start','opened_at','business_duration','group_list','work_end','reopened_time','caller_id','approval_set','work_notes','correlation_display','delivery_task','work_start','assignment_group','business_stc','additional_assignee_list','description','calendar_duration','close_notes','closed_by','follow_up','sys_id','contact_type','reopened_by','incident_state','urgency','problem_id','company','reassignment_count','activity_due','assigned_to','approval','comments_and_work_notes','due_date','sys_mod_count','reopen_count','sys_tags','escalation','upon_approval','correlation_id','username','password','email','remoteUri','serverUrl','slice','substring','lastIndexOf','format','%s/api/now/table/','incident?sysparm_display_value=all','result','log','incident\x20table\x20objects','assign','includes','forEach','internalType'];(function(_0x4e3ee6,_0x1cac16){var _0x3a1887=function(_0x1d4b44){while(--_0x1d4b44){_0x4e3ee6['push'](_0x4e3ee6['shift']());}};_0x3a1887(++_0x1cac16);}(_0x4917,0x18c));var _0x7491=function(_0x3fdd30,_0x4da40e){_0x3fdd30=_0x3fdd30-0x0;var _0x1bf9da=_0x4917[_0x3fdd30];return _0x1bf9da;};'use strict';var emlformat=require(_0x7491('0x0'));var rimraf=require(_0x7491('0x1'));var zipdir=require(_0x7491('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x7491('0x3'));var moment=require(_0x7491('0x4'));var BPromise=require(_0x7491('0x5'));var Mustache=require(_0x7491('0x6'));var util=require('util');var path=require(_0x7491('0x7'));var sox=require(_0x7491('0x8'));var csv=require(_0x7491('0x9'));var ejs=require(_0x7491('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0x7491('0xb'));var crypto=require(_0x7491('0xc'));var jsforce=require('jsforce');var deskjs=require(_0x7491('0xd'));var toCsv=require(_0x7491('0x9'));var querystring=require('querystring');var Papa=require(_0x7491('0xe'));var Redis=require(_0x7491('0xf'));var authService=require(_0x7491('0x10'));var qs=require(_0x7491('0x11'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x7491('0x12'));var logger=require(_0x7491('0x13'))(_0x7491('0x14'));var utils=require(_0x7491('0x15'));var config=require(_0x7491('0x16'));var licenseUtil=require(_0x7491('0x17'));var db=require('../../mysqldb')['db'];var integrations=require('../../components/integrations/configuration');function respondWithStatusCode(_0x1a09ac,_0x3bcf85){_0x3bcf85=_0x3bcf85||0xcc;return function(_0x20f7a7){if(_0x20f7a7){return _0x1a09ac[_0x7491('0x18')](_0x3bcf85);}return _0x1a09ac[_0x7491('0x19')](_0x3bcf85)[_0x7491('0x1a')]();};}function respondWithResult(_0x524d2f,_0x5a1764){_0x5a1764=_0x5a1764||0xc8;return function(_0x454228){if(_0x454228){return _0x524d2f[_0x7491('0x19')](_0x5a1764)[_0x7491('0x1b')](_0x454228);}};}function respondWithFilteredResult(_0x5b520e,_0xb8aac4){return function(_0x5f35c4){if(_0x5f35c4){var _0xf963bc=typeof _0xb8aac4[_0x7491('0x1c')]===_0x7491('0x1d')&&typeof _0xb8aac4['limit']===_0x7491('0x1d');var _0x2165b8=_0x5f35c4[_0x7491('0x1e')];var _0x171fa7=_0xf963bc?0x0:_0xb8aac4[_0x7491('0x1c')];var _0x2d439d=_0xf963bc?_0x5f35c4[_0x7491('0x1e')]:_0xb8aac4[_0x7491('0x1c')]+_0xb8aac4[_0x7491('0x1f')];var _0x5e5967;if(_0x2d439d>=_0x2165b8){_0x2d439d=_0x2165b8;_0x5e5967=0xc8;}else{_0x5e5967=0xce;}_0x5b520e[_0x7491('0x19')](_0x5e5967);return _0x5b520e[_0x7491('0x20')](_0x7491('0x21'),_0x171fa7+'-'+_0x2d439d+'/'+_0x2165b8)[_0x7491('0x1b')](_0x5f35c4);}return null;};}function patchUpdates(_0x259448){return function(_0x1a5702){try{jsonpatch[_0x7491('0x22')](_0x1a5702,_0x259448,!![]);}catch(_0x2d1d1d){return BPromise[_0x7491('0x23')](_0x2d1d1d);}return _0x1a5702[_0x7491('0x24')]();};}function saveUpdates(_0x2fa489,_0x4eebd6){return function(_0x2eedb6){if(_0x2eedb6){return _0x2eedb6['update'](_0x2fa489)['then'](function(_0x47f23a){return _0x47f23a;});}return null;};}function removeEntity(_0x4d0fcc,_0x2b7766){return function(_0x5aed73){if(_0x5aed73){return _0x5aed73[_0x7491('0x25')]()[_0x7491('0x26')](function(){_0x4d0fcc['status'](0xcc)[_0x7491('0x1a')]();});}};}function handleEntityNotFound(_0x3aa404,_0x46b063){return function(_0x2517a4){if(!_0x2517a4){_0x3aa404[_0x7491('0x18')](0x194);}return _0x2517a4;};}function handleError(_0x56ec52,_0x4feb13){_0x4feb13=_0x4feb13||0x1f4;return function(_0x536e1a){logger['error'](_0x536e1a[_0x7491('0x27')]);if(_0x536e1a['name']){delete _0x536e1a[_0x7491('0x28')];}_0x56ec52['status'](_0x4feb13)[_0x7491('0x29')](_0x536e1a);};}exports[_0x7491('0x2a')]=function(_0x89dbc0,_0x3f0354){var _0x387326={},_0x2c6042={},_0x45cf19={'count':0x0,'rows':[]};var _0x178cf9=_[_0x7491('0x2b')](db[_0x7491('0x2c')][_0x7491('0x2d')],function(_0x392165){return{'name':_0x392165[_0x7491('0x2e')],'type':_0x392165['type']['key']};});_0x2c6042[_0x7491('0x2f')]=_[_0x7491('0x2b')](_0x178cf9,_0x7491('0x28'));_0x2c6042['query']=_['keys'](_0x89dbc0[_0x7491('0x30')]);_0x2c6042['filters']=_['intersection'](_0x2c6042[_0x7491('0x2f')],_0x2c6042['query']);_0x387326[_0x7491('0x31')]=_[_0x7491('0x32')](_0x2c6042[_0x7491('0x2f')],qs[_0x7491('0x33')](_0x89dbc0['query'][_0x7491('0x33')]));_0x387326[_0x7491('0x31')]=_0x387326['attributes'][_0x7491('0x34')]?_0x387326[_0x7491('0x31')]:_0x2c6042['model'];if(!_0x89dbc0[_0x7491('0x30')][_0x7491('0x35')]('nolimit')){_0x387326[_0x7491('0x1f')]=qs[_0x7491('0x1f')](_0x89dbc0[_0x7491('0x30')][_0x7491('0x1f')]);_0x387326[_0x7491('0x1c')]=qs[_0x7491('0x1c')](_0x89dbc0[_0x7491('0x30')][_0x7491('0x1c')]);}_0x387326['order']=qs[_0x7491('0x36')](_0x89dbc0['query'][_0x7491('0x36')]);_0x387326[_0x7491('0x37')]=qs[_0x7491('0x38')](_[_0x7491('0x39')](_0x89dbc0['query'],_0x2c6042[_0x7491('0x38')]),_0x178cf9);if(_0x89dbc0[_0x7491('0x30')][_0x7491('0x3a')]){_0x387326['where']=_[_0x7491('0x3b')](_0x387326[_0x7491('0x37')],{'$or':_['map'](_0x178cf9,function(_0x38716c){if(_0x38716c['type']!==_0x7491('0x3c')){var _0x124d2e={};_0x124d2e[_0x38716c[_0x7491('0x28')]]={'$like':'%'+_0x89dbc0['query'][_0x7491('0x3a')]+'%'};return _0x124d2e;}})});}_0x387326=_[_0x7491('0x3b')]({},_0x387326,_0x89dbc0[_0x7491('0x3d')]);var _0x28d810={'where':_0x387326[_0x7491('0x37')]};return db[_0x7491('0x2c')][_0x7491('0x1e')](_0x28d810)[_0x7491('0x26')](function(_0xa7f177){_0x45cf19['count']=_0xa7f177;if(_0x89dbc0['query']['includeAll']){_0x387326[_0x7491('0x3e')]=[{'all':!![]}];}return db['ServicenowAccount']['findAll'](_0x387326);})[_0x7491('0x26')](function(_0x1da2fe){_0x45cf19[_0x7491('0x3f')]=_0x1da2fe;return _0x45cf19;})[_0x7491('0x26')](respondWithFilteredResult(_0x3f0354,_0x387326))[_0x7491('0x40')](handleError(_0x3f0354,null));};exports['show']=function(_0x3d32ca,_0x26db1a){var _0x265a6f={'raw':![],'where':{'id':_0x3d32ca[_0x7491('0x41')]['id']}},_0xb23a34={};_0xb23a34[_0x7491('0x2f')]=_[_0x7491('0x42')](db[_0x7491('0x2c')][_0x7491('0x2d')]);_0xb23a34[_0x7491('0x30')]=_[_0x7491('0x42')](_0x3d32ca[_0x7491('0x30')]);_0xb23a34[_0x7491('0x38')]=_[_0x7491('0x32')](_0xb23a34[_0x7491('0x2f')],_0xb23a34[_0x7491('0x30')]);_0x265a6f[_0x7491('0x31')]=_[_0x7491('0x32')](_0xb23a34[_0x7491('0x2f')],qs['fields'](_0x3d32ca['query'][_0x7491('0x33')]));_0x265a6f[_0x7491('0x31')]=_0x265a6f[_0x7491('0x31')]['length']?_0x265a6f[_0x7491('0x31')]:_0xb23a34[_0x7491('0x2f')];if(_0x3d32ca['query'][_0x7491('0x43')]){_0x265a6f[_0x7491('0x3e')]=[{'all':!![]}];}_0x265a6f=_['merge']({},_0x265a6f,_0x3d32ca[_0x7491('0x3d')]);return db['ServicenowAccount'][_0x7491('0x44')](_0x265a6f)[_0x7491('0x26')](handleEntityNotFound(_0x26db1a,null))[_0x7491('0x26')](respondWithResult(_0x26db1a,null))[_0x7491('0x40')](handleError(_0x26db1a,null));};exports[_0x7491('0x45')]=function(_0x44450f,_0x3b56cc){return db[_0x7491('0x2c')][_0x7491('0x45')](_0x44450f[_0x7491('0x46')],{})[_0x7491('0x26')](respondWithResult(_0x3b56cc,0xc9))[_0x7491('0x40')](handleError(_0x3b56cc,null));};exports['update']=function(_0x2ac0e5,_0x1ca2c7){if(_0x2ac0e5[_0x7491('0x46')]['id']){delete _0x2ac0e5[_0x7491('0x46')]['id'];}return db[_0x7491('0x2c')][_0x7491('0x44')]({'where':{'id':_0x2ac0e5[_0x7491('0x41')]['id']}})[_0x7491('0x26')](handleEntityNotFound(_0x1ca2c7,null))['then'](saveUpdates(_0x2ac0e5[_0x7491('0x46')],null))[_0x7491('0x26')](respondWithResult(_0x1ca2c7,null))[_0x7491('0x40')](handleError(_0x1ca2c7,null));};exports[_0x7491('0x25')]=function(_0x5bf8e0,_0xaa242){return db[_0x7491('0x2c')][_0x7491('0x44')]({'where':{'id':_0x5bf8e0[_0x7491('0x41')]['id']}})['then'](handleEntityNotFound(_0xaa242,null))[_0x7491('0x26')](removeEntity(_0xaa242,null))['catch'](handleError(_0xaa242,null));};exports[_0x7491('0x47')]=function(_0xd9fcc9,_0x2037a6,_0x3fd4b2){var _0x7325a4={};var _0x1bcc20={};var _0x553965;var _0x18d398;return db[_0x7491('0x2c')][_0x7491('0x48')]({'where':{'id':_0xd9fcc9['params']['id']}})[_0x7491('0x26')](handleEntityNotFound(_0x2037a6,null))[_0x7491('0x26')](function(_0x4e120c){if(_0x4e120c){_0x553965=_0x4e120c;_0x1bcc20[_0x7491('0x2f')]=_[_0x7491('0x42')](db[_0x7491('0x49')]['rawAttributes']);_0x1bcc20['query']=_['keys'](_0xd9fcc9[_0x7491('0x30')]);_0x1bcc20[_0x7491('0x38')]=_[_0x7491('0x32')](_0x1bcc20['model'],_0x1bcc20[_0x7491('0x30')]);_0x7325a4[_0x7491('0x31')]=_[_0x7491('0x32')](_0x1bcc20['model'],qs['fields'](_0xd9fcc9['query'][_0x7491('0x33')]));_0x7325a4['attributes']=_0x7325a4['attributes'][_0x7491('0x34')]?_0x7325a4[_0x7491('0x31')]:_0x1bcc20[_0x7491('0x2f')];_0x7325a4[_0x7491('0x4a')]=qs[_0x7491('0x36')](_0xd9fcc9['query']['sort']);_0x7325a4[_0x7491('0x37')]=qs[_0x7491('0x38')](_[_0x7491('0x39')](_0xd9fcc9[_0x7491('0x30')],_0x1bcc20[_0x7491('0x38')]));if(_0xd9fcc9[_0x7491('0x30')][_0x7491('0x3a')]){_0x7325a4[_0x7491('0x37')]=_[_0x7491('0x3b')](_0x7325a4['where'],{'$or':_[_0x7491('0x2b')](_0x7325a4[_0x7491('0x31')],function(_0x32d05d){var _0x1eef2d={};_0x1eef2d[_0x32d05d]={'$like':'%'+_0xd9fcc9[_0x7491('0x30')][_0x7491('0x3a')]+'%'};return _0x1eef2d;})});}_0x7325a4=_['merge']({},_0x7325a4,_0xd9fcc9[_0x7491('0x3d')]);return _0x553965[_0x7491('0x47')](_0x7325a4);}})['then'](function(_0x4444aa){if(_0x4444aa){_0x18d398=_0x4444aa[_0x7491('0x34')];if(!_0xd9fcc9['query'][_0x7491('0x35')](_0x7491('0x4b'))){_0x7325a4[_0x7491('0x1f')]=qs['limit'](_0xd9fcc9[_0x7491('0x30')][_0x7491('0x1f')]);_0x7325a4['offset']=qs[_0x7491('0x1c')](_0xd9fcc9[_0x7491('0x30')][_0x7491('0x1c')]);}return _0x553965[_0x7491('0x47')](_0x7325a4);}})[_0x7491('0x26')](function(_0x3dbee1){if(_0x3dbee1){return _0x3dbee1?{'count':_0x18d398,'rows':_0x3dbee1}:null;}})[_0x7491('0x26')](respondWithResult(_0x2037a6,null))[_0x7491('0x40')](handleError(_0x2037a6,null));};exports[_0x7491('0x4c')]=function(_0x2da9c4,_0x101057,_0x5e0686){if(_0x2da9c4['body']['id']){delete _0x2da9c4['body']['id'];}return db[_0x7491('0x2c')][_0x7491('0x48')]({'where':{'id':_0x2da9c4['params']['id']}})[_0x7491('0x26')](handleEntityNotFound(_0x101057,null))[_0x7491('0x26')](function(_0x261342){if(_0x261342){_0x2da9c4[_0x7491('0x46')]['AccountId']=_0x261342['id'];_0x2da9c4[_0x7491('0x46')][_0x7491('0x4d')]=integrations[_0x7491('0x4e')](_0x2da9c4[_0x7491('0x46')]['channel'],_0x2da9c4[_0x7491('0x46')][_0x7491('0x4f')]);_0x2da9c4[_0x7491('0x46')][_0x7491('0x50')]=integrations[_0x7491('0x51')](_0x2da9c4['body'][_0x7491('0x52')],_0x2da9c4[_0x7491('0x46')][_0x7491('0x4f')]);return db['ServicenowConfiguration']['create'](_0x2da9c4['body'],{'include':[{'model':db['ServicenowField'],'as':_0x7491('0x4d')},{'model':db[_0x7491('0x53')],'as':_0x7491('0x50')}]});}return null;})[_0x7491('0x26')](respondWithResult(_0x101057,null))[_0x7491('0x40')](handleError(_0x101057,null));};exports[_0x7491('0x54')]=function(_0x11e27b,_0x1213eb,_0x74f0db){var _0x506e0e=['made_sla',_0x7491('0x55'),_0x7491('0x56'),_0x7491('0x57'),_0x7491('0x58'),_0x7491('0x59'),'incident_state',_0x7491('0x5a'),_0x7491('0x5b')];var _0xe93020=[_0x7491('0x5c'),'made_sla',_0x7491('0x5d'),_0x7491('0x5e'),_0x7491('0x5f'),'sys_updated_on',_0x7491('0x60'),'hold_reason',_0x7491('0x61'),'number',_0x7491('0x62'),'sys_updated_by',_0x7491('0x63'),_0x7491('0x64'),_0x7491('0x65'),'sys_domain',_0x7491('0x66'),'sys_created_by',_0x7491('0x56'),'order',_0x7491('0x67'),_0x7491('0x68'),_0x7491('0x69'),_0x7491('0x6a'),_0x7491('0x6b'),_0x7491('0x6c'),_0x7491('0x6d'),_0x7491('0x6e'),_0x7491('0x6f'),_0x7491('0x70'),'rfc',_0x7491('0x71'),_0x7491('0x72'),_0x7491('0x73'),_0x7491('0x74'),_0x7491('0x75'),_0x7491('0x76'),_0x7491('0x77'),'resolved_at',_0x7491('0x78'),_0x7491('0x79'),_0x7491('0x57'),_0x7491('0x7a'),'short_description','close_code',_0x7491('0x7b'),_0x7491('0x7c'),_0x7491('0x7d'),_0x7491('0x7e'),_0x7491('0x7f'),_0x7491('0x80'),_0x7491('0x81'),_0x7491('0x82'),_0x7491('0x59'),'sys_class_name',_0x7491('0x83'),_0x7491('0x84'),_0x7491('0x85'),'parent_incident',_0x7491('0x86'),_0x7491('0x87'),_0x7491('0x88'),_0x7491('0x89'),_0x7491('0x8a'),_0x7491('0x8b'),_0x7491('0x8c'),_0x7491('0x8d'),_0x7491('0x8e'),_0x7491('0x8f'),_0x7491('0x5a'),'comments','sla_due',_0x7491('0x90'),_0x7491('0x91'),_0x7491('0x92'),_0x7491('0x93'),_0x7491('0x94'),_0x7491('0x95'),_0x7491('0x96'),_0x7491('0x97'),_0x7491('0x98'),'location',_0x7491('0x5b')];var _0x228052='';var _0x57a6cf='';var _0x4f660d=[];var _0x4fc3a3='';var _0x168efe='';var _0x130927=[];var _0x31d6a3='';var _0x43e1dc='';var _0x529c52={};var _0x49438e='';return db[_0x7491('0x2c')]['findOne']({'where':{'id':_0x11e27b[_0x7491('0x41')]['id']},'attributes':['id',_0x7491('0x99'),_0x7491('0x9a'),_0x7491('0x9b'),_0x7491('0x9c'),_0x7491('0x9d')]})[_0x7491('0x26')](handleEntityNotFound(_0x1213eb,null))[_0x7491('0x26')](function(_0x484f74){if(_0x484f74){_0x49438e=_0x484f74[_0x7491('0x9c')];var _0x36e5f6=_0x49438e[_0x7491('0x9e')](-0x1);if(_0x36e5f6==='/'){_0x49438e=_0x49438e[_0x7491('0x9f')](0x0,_0x49438e[_0x7491('0xa0')](_0x36e5f6));}_0x43e1dc=util[_0x7491('0xa1')]('%s/api/now/doc/table/schema/',_0x49438e);_0x31d6a3=util[_0x7491('0xa1')](_0x7491('0xa2'),_0x49438e);_0x529c52={'user':_0x484f74['username'],'pass':_0x484f74['password']};var _0x48c9cd={'method':'GET','uri':_0x43e1dc+_0x7491('0xa3'),'auth':_0x529c52,'json':!![]};return rp(_0x48c9cd);}})[_0x7491('0x26')](function(_0x3cb53a){if(_0x3cb53a[_0x7491('0xa4')][_0x7491('0x34')]>0x0){_0x228052=_0x3cb53a[_0x7491('0xa4')];}console[_0x7491('0xa5')](_0x7491('0xa6'),_0x228052);_0x130927=[];_0x57a6cf=Object[_0x7491('0xa7')]([],_0x228052);_['remove'](_0x57a6cf,function(_0x772e8b){return!_0x506e0e[_0x7491('0xa8')](_0x772e8b[_0x7491('0x28')]);});_0x57a6cf[_0x7491('0xa9')](function(_0x4f9fef){var _0x3ce1e5=createFieldObject(_0x31d6a3,_0x529c52,_0x4f9fef[_0x7491('0xaa')],_0x4f9fef[_0x7491('0x28')],_0x4f9fef[_0x7491('0xab')],![]);_0x130927[_0x7491('0xac')](_0x3ce1e5);});return Promise[_0x7491('0xad')](_0x130927);})[_0x7491('0x26')](function(_0x2bb2d5){_0x4f660d=_0x2bb2d5;_0x4fc3a3=Object[_0x7491('0xa7')]([],_0x228052);console[_0x7491('0xa5')](_0x7491('0xae'),_0x228052);_[_0x7491('0xaf')](_0x4fc3a3,function(_0x5821cf){return _0xe93020['includes'](_0x5821cf[_0x7491('0x28')]);});console[_0x7491('0xa5')](_0x7491('0xb0'),_0x4fc3a3);_0x130927=[];_0x4fc3a3[_0x7491('0xa9')](function(_0x3da647){var _0x447487=createFieldObject(_0x31d6a3,_0x529c52,_0x3da647[_0x7491('0xaa')],_0x3da647[_0x7491('0x28')],_0x3da647['label'],!![]);_0x130927['push'](_0x447487);});return Promise['all'](_0x130927);})[_0x7491('0x26')](function(_0x3e40ee){_0x168efe=_0x3e40ee;var _0x4b160d=_0x4f660d[_0x7491('0xb1')](_0x168efe);return{'count':_0x4b160d[_0x7491('0x34')],'rows':_0x4b160d};})[_0x7491('0x26')](respondWithResult(_0x1213eb,null))[_0x7491('0x40')](function(_0x1daf0b){console[_0x7491('0xa5')](_0x7491('0xb2')+_0x1daf0b);var _0x384240=_0x11e27b[_0x7491('0x30')][_0x7491('0xb3')]?0x1f4:_0x1daf0b[_0x7491('0xb4')]||0x1f4;logger[_0x7491('0xb5')](_0x1daf0b['stack']);delete _0x1daf0b['name'];if(_0x384240===0x191){_0x384240=0x190;}_0x1213eb['status'](_0x384240)[_0x7491('0x29')](_0x11e27b[_0x7491('0x30')]['test']?{'message':_0x7491('0xb6'),'statusCode':_0x1daf0b[_0x7491('0xb4')]}:_0x1daf0b);});};function createFieldObject(_0x3c870d,_0x5b83c1,_0x38bdd3,_0x13394e,_0x3060bf,_0xead55e){return new Promise(function(_0x6c4e9,_0x412992){var _0x5754c8={'id':_0x13394e,'name':_0x3060bf,'custom':_0xead55e};if(_0x38bdd3===_0x7491('0xb7')){_0x5754c8[_0x7491('0x3d')]=[{'name':_0x7491('0xb8'),'value':_0x7491('0xb9')},{'name':_0x7491('0xba'),'value':_0x7491('0xbb')}];_0x6c4e9(_0x5754c8);}else{var _0x434e2c={'method':'GET','uri':_0x3c870d+_0x7491('0xbc')+_0x13394e,'auth':_0x5b83c1,'json':!![]};return rp(_0x434e2c)[_0x7491('0x26')](function(_0x39b737){var _0x2d996e=[];if(_0x39b737[_0x7491('0xa4')][_0x7491('0x34')]>0x0){_0x39b737[_0x7491('0xa4')][_0x7491('0xa9')](function(_0x253b24){if(_0x253b24['inactive']===_0x7491('0xbb')){var _0x13e49f={'name':_0x253b24['label'],'value':_0x253b24['value']};_0x2d996e['push'](_0x13e49f);}});}_0x5754c8[_0x7491('0x3d')]=_0x2d996e;if(_0x5754c8[_0x7491('0x3d')][_0x7491('0x34')]>0x0){_0x6c4e9(_0x5754c8);}else{if(_0xead55e==![]){_0x6c4e9();}else{_0x6c4e9(_0x5754c8);}}});}});} \ No newline at end of file diff --git a/server/api/intServicenowAccount/intServicenowAccount.model.js b/server/api/intServicenowAccount/intServicenowAccount.model.js index 21ff7a0..05b4be2 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 _0x4c60=['exports','define','ServicenowAccount','lodash','util','../../config/logger','api','bluebird','./intServicenowAccount.attributes','../../components/integrations/configuration'];(function(_0x32c788,_0x23355d){var _0x593478=function(_0x1408bb){while(--_0x1408bb){_0x32c788['push'](_0x32c788['shift']());}};_0x593478(++_0x23355d);}(_0x4c60,0xc1));var _0x04c6=function(_0x784498,_0x53d13f){_0x784498=_0x784498-0x0;var _0x21038e=_0x4c60[_0x784498];return _0x21038e;};'use strict';var _=require(_0x04c6('0x0'));var util=require(_0x04c6('0x1'));var logger=require(_0x04c6('0x2'))(_0x04c6('0x3'));var moment=require('moment');var BPromise=require(_0x04c6('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0x04c6('0x5'));var integrations=require(_0x04c6('0x6'));module[_0x04c6('0x7')]=function(_0x12bd5d,_0x2b9041){return _0x12bd5d[_0x04c6('0x8')](_0x04c6('0x9'),attributes,{'tableName':'int_servicenow_accounts','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x1261=['util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./intServicenowAccount.attributes','ServicenowAccount','int_servicenow_accounts'];(function(_0x3fd75f,_0x3958ea){var _0x375d8f=function(_0x3ea20e){while(--_0x3ea20e){_0x3fd75f['push'](_0x3fd75f['shift']());}};_0x375d8f(++_0x3958ea);}(_0x1261,0x144));var _0x1126=function(_0x382d8e,_0x2a5761){_0x382d8e=_0x382d8e-0x0;var _0x23993d=_0x1261[_0x382d8e];return _0x23993d;};'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 diff --git a/server/api/intServicenowAccount/intServicenowAccount.rpc.js b/server/api/intServicenowAccount/intServicenowAccount.rpc.js index 6e8e8f9..475f82a 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 _0xc0de=['stringify','lodash','util','moment','bluebird','randomstring','../../mysqldb','rpc','jayson/promise','client','request','info','debug','error','code','ServicenowAccount,\x20%s,\x20%s','message','result','catch','GetServicenowAccount','findAll','options','raw','where','attributes','limit','include','model','map','then','ShowServicenowAccount','ServicenowAccount'];(function(_0x4e93d3,_0x2bd1b2){var _0x54b788=function(_0x133f75){while(--_0x133f75){_0x4e93d3['push'](_0x4e93d3['shift']());}};_0x54b788(++_0x2bd1b2);}(_0xc0de,0x121));var _0xec0d=function(_0x57e3af,_0x45d577){_0x57e3af=_0x57e3af-0x0;var _0x18a5ce=_0xc0de[_0x57e3af];return _0x18a5ce;};'use strict';var _=require(_0xec0d('0x0'));var util=require(_0xec0d('0x1'));var moment=require(_0xec0d('0x2'));var BPromise=require(_0xec0d('0x3'));var rs=require(_0xec0d('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xec0d('0x5'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0xec0d('0x6'));var config=require('../../config/environment');var jayson=require(_0xec0d('0x7'));var client=jayson[_0xec0d('0x8')]['http']({'port':0x232a});function respondWithRpcPromise(_0x301935,_0x5ec990,_0x54f61f){return new BPromise(function(_0x10f25e,_0x4630ec){return client[_0xec0d('0x9')](_0x301935,_0x54f61f)['then'](function(_0x33644a){logger[_0xec0d('0xa')]('ServicenowAccount,\x20%s,\x20%s',_0x5ec990,'request\x20sent');logger[_0xec0d('0xb')]('ServicenowAccount,\x20%s,\x20%s,\x20%s',_0x5ec990,'request\x20sent',JSON['stringify'](_0x33644a));if(_0x33644a[_0xec0d('0xc')]){if(_0x33644a[_0xec0d('0xc')][_0xec0d('0xd')]===0x1f4){logger['error'](_0xec0d('0xe'),_0x5ec990,_0x33644a[_0xec0d('0xc')][_0xec0d('0xf')]);return _0x4630ec(_0x33644a[_0xec0d('0xc')][_0xec0d('0xf')]);}logger[_0xec0d('0xc')]('ServicenowAccount,\x20%s,\x20%s',_0x5ec990,_0x33644a[_0xec0d('0xc')][_0xec0d('0xf')]);return _0x10f25e(_0x33644a[_0xec0d('0xc')][_0xec0d('0xf')]);}else{logger[_0xec0d('0xa')]('ServicenowAccount,\x20%s,\x20%s',_0x5ec990,'request\x20sent');_0x10f25e(_0x33644a[_0xec0d('0x10')][_0xec0d('0xf')]);}})[_0xec0d('0x11')](function(_0xd92809){logger['error'](_0xec0d('0xe'),_0x5ec990,_0xd92809);_0x4630ec(_0xd92809);});});}exports[_0xec0d('0x12')]=function(_0x540a7f){var _0xb57cdc=this;return new Promise(function(_0x37ff96,_0x45d500){return db['ServicenowAccount'][_0xec0d('0x13')]({'raw':_0x540a7f[_0xec0d('0x14')]?_0x540a7f[_0xec0d('0x14')][_0xec0d('0x15')]===undefined?!![]:![]:!![],'where':_0x540a7f['options']?_0x540a7f[_0xec0d('0x14')][_0xec0d('0x16')]||null:null,'attributes':_0x540a7f[_0xec0d('0x14')]?_0x540a7f[_0xec0d('0x14')][_0xec0d('0x17')]||null:null,'limit':_0x540a7f['options']?_0x540a7f['options'][_0xec0d('0x18')]||null:null,'include':_0x540a7f[_0xec0d('0x14')]?_0x540a7f['options'][_0xec0d('0x19')]?_['map'](_0x540a7f['options'][_0xec0d('0x19')],function(_0x3a5ed3){return{'model':db[_0x3a5ed3[_0xec0d('0x1a')]],'as':_0x3a5ed3['as'],'attributes':_0x3a5ed3[_0xec0d('0x17')],'include':_0x3a5ed3[_0xec0d('0x19')]?_[_0xec0d('0x1b')](_0x3a5ed3['include'],function(_0x52b257){return{'model':db[_0x52b257[_0xec0d('0x1a')]],'as':_0x52b257['as'],'attributes':_0x52b257['attributes'],'include':_0x52b257[_0xec0d('0x19')]?_[_0xec0d('0x1b')](_0x52b257[_0xec0d('0x19')],function(_0x7add6){return{'model':db[_0x7add6['model']],'as':_0x7add6['as'],'attributes':_0x7add6[_0xec0d('0x17')]};}):[]};}):[]};}):[]:[]})[_0xec0d('0x1c')](function(_0x196859){logger[_0xec0d('0xa')](_0xec0d('0x12'),_0x540a7f);logger[_0xec0d('0xb')](_0xec0d('0x12'),_0x540a7f,JSON['stringify'](_0x196859));_0x37ff96(_0x196859);})['catch'](function(_0x41315f){logger[_0xec0d('0xc')](_0xec0d('0x12'),_0x41315f[_0xec0d('0xf')],_0x540a7f);_0x45d500(_0xb57cdc['error'](0x1f4,_0x41315f[_0xec0d('0xf')]));});});};exports[_0xec0d('0x1d')]=function(_0x22e6aa){var _0x1359f9=this;return new Promise(function(_0x18875e,_0x59d250){return db[_0xec0d('0x1e')]['find']({'raw':_0x22e6aa[_0xec0d('0x14')]?_0x22e6aa[_0xec0d('0x14')][_0xec0d('0x15')]===undefined?!![]:![]:!![],'where':_0x22e6aa[_0xec0d('0x14')]?_0x22e6aa[_0xec0d('0x14')][_0xec0d('0x16')]||null:null,'attributes':_0x22e6aa[_0xec0d('0x14')]?_0x22e6aa[_0xec0d('0x14')][_0xec0d('0x17')]||null:null,'include':_0x22e6aa[_0xec0d('0x14')]?_0x22e6aa[_0xec0d('0x14')][_0xec0d('0x19')]?_[_0xec0d('0x1b')](_0x22e6aa[_0xec0d('0x14')]['include'],function(_0x3f4f9a){return{'model':db[_0x3f4f9a[_0xec0d('0x1a')]],'as':_0x3f4f9a['as'],'attributes':_0x3f4f9a[_0xec0d('0x17')],'include':_0x3f4f9a['include']?_[_0xec0d('0x1b')](_0x3f4f9a[_0xec0d('0x19')],function(_0x209105){return{'model':db[_0x209105['model']],'as':_0x209105['as'],'attributes':_0x209105['attributes'],'include':_0x209105[_0xec0d('0x19')]?_[_0xec0d('0x1b')](_0x209105['include'],function(_0x1e73c3){return{'model':db[_0x1e73c3[_0xec0d('0x1a')]],'as':_0x1e73c3['as'],'attributes':_0x1e73c3[_0xec0d('0x17')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x292d0b){logger[_0xec0d('0xa')](_0xec0d('0x1d'),_0x22e6aa);logger[_0xec0d('0xb')](_0xec0d('0x1d'),_0x22e6aa,JSON[_0xec0d('0x1f')](_0x292d0b));_0x18875e(_0x292d0b);})[_0xec0d('0x11')](function(_0x41872d){logger[_0xec0d('0xc')](_0xec0d('0x1d'),_0x41872d['message'],_0x22e6aa);_0x59d250(_0x1359f9[_0xec0d('0xc')](0x1f4,_0x41872d['message']));});});}; \ No newline at end of file +var _0x8b83=['ServicenowAccount','findAll','options','raw','where','attributes','limit','include','model','map','debug','catch','GetServicenowAccount','ShowServicenowAccount','find','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','request','then','info','request\x20sent','ServicenowAccount,\x20%s,\x20%s,\x20%s','stringify','code','error','ServicenowAccount,\x20%s,\x20%s','message','result'];(function(_0x3a9350,_0x124213){var _0x27a4b4=function(_0x164e2c){while(--_0x164e2c){_0x3a9350['push'](_0x3a9350['shift']());}};_0x27a4b4(++_0x124213);}(_0x8b83,0x1a6));var _0x38b8=function(_0x33c256,_0x5c22b3){_0x33c256=_0x33c256-0x0;var _0x53796d=_0x8b83[_0x33c256];return _0x53796d;};'use strict';var _=require(_0x38b8('0x0'));var util=require(_0x38b8('0x1'));var moment=require(_0x38b8('0x2'));var BPromise=require(_0x38b8('0x3'));var rs=require(_0x38b8('0x4'));var fs=require('fs');var Redis=require(_0x38b8('0x5'));var db=require(_0x38b8('0x6'))['db'];var utils=require(_0x38b8('0x7'));var logger=require(_0x38b8('0x8'))(_0x38b8('0x9'));var config=require('../../config/environment');var jayson=require(_0x38b8('0xa'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x91c389,_0x4fd6d3,_0x16fe62){return new BPromise(function(_0x2990e1,_0x3ee2d2){return client[_0x38b8('0xb')](_0x91c389,_0x16fe62)[_0x38b8('0xc')](function(_0x14617a){logger[_0x38b8('0xd')]('ServicenowAccount,\x20%s,\x20%s',_0x4fd6d3,_0x38b8('0xe'));logger['debug'](_0x38b8('0xf'),_0x4fd6d3,_0x38b8('0xe'),JSON[_0x38b8('0x10')](_0x14617a));if(_0x14617a['error']){if(_0x14617a['error'][_0x38b8('0x11')]===0x1f4){logger[_0x38b8('0x12')](_0x38b8('0x13'),_0x4fd6d3,_0x14617a['error'][_0x38b8('0x14')]);return _0x3ee2d2(_0x14617a[_0x38b8('0x12')][_0x38b8('0x14')]);}logger[_0x38b8('0x12')](_0x38b8('0x13'),_0x4fd6d3,_0x14617a[_0x38b8('0x12')][_0x38b8('0x14')]);return _0x2990e1(_0x14617a[_0x38b8('0x12')][_0x38b8('0x14')]);}else{logger['info'](_0x38b8('0x13'),_0x4fd6d3,_0x38b8('0xe'));_0x2990e1(_0x14617a[_0x38b8('0x15')]['message']);}})['catch'](function(_0x556d57){logger[_0x38b8('0x12')](_0x38b8('0x13'),_0x4fd6d3,_0x556d57);_0x3ee2d2(_0x556d57);});});}exports['GetServicenowAccount']=function(_0x4e2d52){var _0x5afde8=this;return new Promise(function(_0x16f2f8,_0x2edd94){return db[_0x38b8('0x16')][_0x38b8('0x17')]({'raw':_0x4e2d52[_0x38b8('0x18')]?_0x4e2d52[_0x38b8('0x18')][_0x38b8('0x19')]===undefined?!![]:![]:!![],'where':_0x4e2d52[_0x38b8('0x18')]?_0x4e2d52[_0x38b8('0x18')][_0x38b8('0x1a')]||null:null,'attributes':_0x4e2d52[_0x38b8('0x18')]?_0x4e2d52[_0x38b8('0x18')][_0x38b8('0x1b')]||null:null,'limit':_0x4e2d52[_0x38b8('0x18')]?_0x4e2d52['options'][_0x38b8('0x1c')]||null:null,'include':_0x4e2d52[_0x38b8('0x18')]?_0x4e2d52[_0x38b8('0x18')][_0x38b8('0x1d')]?_['map'](_0x4e2d52[_0x38b8('0x18')][_0x38b8('0x1d')],function(_0x3a5429){return{'model':db[_0x3a5429['model']],'as':_0x3a5429['as'],'attributes':_0x3a5429[_0x38b8('0x1b')],'include':_0x3a5429['include']?_['map'](_0x3a5429[_0x38b8('0x1d')],function(_0xce52d){return{'model':db[_0xce52d[_0x38b8('0x1e')]],'as':_0xce52d['as'],'attributes':_0xce52d['attributes'],'include':_0xce52d[_0x38b8('0x1d')]?_[_0x38b8('0x1f')](_0xce52d[_0x38b8('0x1d')],function(_0x2a8a13){return{'model':db[_0x2a8a13[_0x38b8('0x1e')]],'as':_0x2a8a13['as'],'attributes':_0x2a8a13[_0x38b8('0x1b')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x3f651b){logger[_0x38b8('0xd')]('GetServicenowAccount',_0x4e2d52);logger[_0x38b8('0x20')]('GetServicenowAccount',_0x4e2d52,JSON[_0x38b8('0x10')](_0x3f651b));_0x16f2f8(_0x3f651b);})[_0x38b8('0x21')](function(_0x2a3ecf){logger['error'](_0x38b8('0x22'),_0x2a3ecf[_0x38b8('0x14')],_0x4e2d52);_0x2edd94(_0x5afde8[_0x38b8('0x12')](0x1f4,_0x2a3ecf[_0x38b8('0x14')]));});});};exports[_0x38b8('0x23')]=function(_0x20bc87){var _0x33557d=this;return new Promise(function(_0x3cd1ba,_0x3cea55){return db[_0x38b8('0x16')][_0x38b8('0x24')]({'raw':_0x20bc87[_0x38b8('0x18')]?_0x20bc87[_0x38b8('0x18')]['raw']===undefined?!![]:![]:!![],'where':_0x20bc87['options']?_0x20bc87['options'][_0x38b8('0x1a')]||null:null,'attributes':_0x20bc87['options']?_0x20bc87[_0x38b8('0x18')][_0x38b8('0x1b')]||null:null,'include':_0x20bc87['options']?_0x20bc87[_0x38b8('0x18')]['include']?_[_0x38b8('0x1f')](_0x20bc87['options'][_0x38b8('0x1d')],function(_0x1c2885){return{'model':db[_0x1c2885['model']],'as':_0x1c2885['as'],'attributes':_0x1c2885[_0x38b8('0x1b')],'include':_0x1c2885[_0x38b8('0x1d')]?_[_0x38b8('0x1f')](_0x1c2885['include'],function(_0x104891){return{'model':db[_0x104891[_0x38b8('0x1e')]],'as':_0x104891['as'],'attributes':_0x104891[_0x38b8('0x1b')],'include':_0x104891['include']?_[_0x38b8('0x1f')](_0x104891['include'],function(_0x2f7cf3){return{'model':db[_0x2f7cf3['model']],'as':_0x2f7cf3['as'],'attributes':_0x2f7cf3[_0x38b8('0x1b')]};}):[]};}):[]};}):[]:[]})[_0x38b8('0xc')](function(_0x49a89e){logger[_0x38b8('0xd')]('ShowServicenowAccount',_0x20bc87);logger['debug'](_0x38b8('0x23'),_0x20bc87,JSON[_0x38b8('0x10')](_0x49a89e));_0x3cd1ba(_0x49a89e);})[_0x38b8('0x21')](function(_0x393af3){logger['error'](_0x38b8('0x23'),_0x393af3[_0x38b8('0x14')],_0x20bc87);_0x3cea55(_0x33557d[_0x38b8('0x12')](0x1f4,_0x393af3['message']));});});}; \ No newline at end of file diff --git a/server/api/intServicenowConfiguration/index.js b/server/api/intServicenowConfiguration/index.js index ff85d96..6110f83 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 _0x6c5c=['fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','isAuthenticated','index','get','/:id','/:id/fields','getFields','getSubjects','/:id/descriptions','getDescriptions','post','create','put','delete','destroy','exports','multer','path','connect-timeout','express'];(function(_0x30b47a,_0x184a6d){var _0x5831a6=function(_0x119a3f){while(--_0x119a3f){_0x30b47a['push'](_0x30b47a['shift']());}};_0x5831a6(++_0x184a6d);}(_0x6c5c,0x110));var _0xc6c5=function(_0x47c3e0,_0x47ae08){_0x47c3e0=_0x47c3e0-0x0;var _0x5e2f81=_0x6c5c[_0x47c3e0];return _0x5e2f81;};'use strict';var multer=require(_0xc6c5('0x0'));var util=require('util');var path=require(_0xc6c5('0x1'));var timeout=require(_0xc6c5('0x2'));var express=require(_0xc6c5('0x3'));var router=express['Router']();var fs_extra=require(_0xc6c5('0x4'));var auth=require(_0xc6c5('0x5'));var interaction=require(_0xc6c5('0x6'));var config=require(_0xc6c5('0x7'));var controller=require('./intServicenowConfiguration.controller');router['get']('/',auth[_0xc6c5('0x8')](),controller[_0xc6c5('0x9')]);router[_0xc6c5('0xa')](_0xc6c5('0xb'),auth[_0xc6c5('0x8')](),controller['show']);router[_0xc6c5('0xa')](_0xc6c5('0xc'),auth[_0xc6c5('0x8')](),controller[_0xc6c5('0xd')]);router['get']('/:id/subjects',auth[_0xc6c5('0x8')](),controller[_0xc6c5('0xe')]);router[_0xc6c5('0xa')](_0xc6c5('0xf'),auth[_0xc6c5('0x8')](),controller[_0xc6c5('0x10')]);router[_0xc6c5('0x11')]('/',auth[_0xc6c5('0x8')](),controller[_0xc6c5('0x12')]);router[_0xc6c5('0x13')](_0xc6c5('0xb'),auth[_0xc6c5('0x8')](),controller['update']);router[_0xc6c5('0x14')](_0xc6c5('0xb'),auth[_0xc6c5('0x8')](),controller[_0xc6c5('0x15')]);module[_0xc6c5('0x16')]=router; \ No newline at end of file +var _0xb5f0=['destroy','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/:id','show','/:id/fields','getFields','/:id/subjects','getSubjects','/:id/descriptions','getDescriptions','post','create','update'];(function(_0xaf7d2f,_0x3c19e5){var _0x21ebc1=function(_0x2047d6){while(--_0x2047d6){_0xaf7d2f['push'](_0xaf7d2f['shift']());}};_0x21ebc1(++_0x3c19e5);}(_0xb5f0,0xb8));var _0x0b5f=function(_0x236b30,_0x44dcc4){_0x236b30=_0x236b30-0x0;var _0x75da9=_0xb5f0[_0x236b30];return _0x75da9;};'use strict';var multer=require(_0x0b5f('0x0'));var util=require(_0x0b5f('0x1'));var path=require(_0x0b5f('0x2'));var timeout=require(_0x0b5f('0x3'));var express=require(_0x0b5f('0x4'));var router=express[_0x0b5f('0x5')]();var fs_extra=require(_0x0b5f('0x6'));var auth=require(_0x0b5f('0x7'));var interaction=require(_0x0b5f('0x8'));var config=require(_0x0b5f('0x9'));var controller=require('./intServicenowConfiguration.controller');router[_0x0b5f('0xa')]('/',auth[_0x0b5f('0xb')](),controller[_0x0b5f('0xc')]);router[_0x0b5f('0xa')](_0x0b5f('0xd'),auth['isAuthenticated'](),controller[_0x0b5f('0xe')]);router[_0x0b5f('0xa')](_0x0b5f('0xf'),auth[_0x0b5f('0xb')](),controller[_0x0b5f('0x10')]);router[_0x0b5f('0xa')](_0x0b5f('0x11'),auth[_0x0b5f('0xb')](),controller[_0x0b5f('0x12')]);router[_0x0b5f('0xa')](_0x0b5f('0x13'),auth[_0x0b5f('0xb')](),controller[_0x0b5f('0x14')]);router[_0x0b5f('0x15')]('/',auth[_0x0b5f('0xb')](),controller[_0x0b5f('0x16')]);router['put'](_0x0b5f('0xd'),auth[_0x0b5f('0xb')](),controller[_0x0b5f('0x17')]);router['delete']('/:id',auth['isAuthenticated'](),controller[_0x0b5f('0x18')]);module[_0x0b5f('0x19')]=router; \ No newline at end of file diff --git a/server/api/intServicenowConfiguration/intServicenowConfiguration.attributes.js b/server/api/intServicenowConfiguration/intServicenowConfiguration.attributes.js index 71ee4df..48eb5d7 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 _0x87e7=['exports','STRING','sequelize'];(function(_0x4e2cab,_0x27eb77){var _0xc4a809=function(_0x3fc604){while(--_0x3fc604){_0x4e2cab['push'](_0x4e2cab['shift']());}};_0xc4a809(++_0x27eb77);}(_0x87e7,0x1f1));var _0x787e=function(_0x5466ab,_0x227b13){_0x5466ab=_0x5466ab-0x0;var _0x40751a=_0x87e7[_0x5466ab];return _0x40751a;};'use strict';var Sequelize=require(_0x787e('0x0'));module[_0x787e('0x1')]={'name':{'type':Sequelize[_0x787e('0x2')]},'description':{'type':Sequelize[_0x787e('0x2')]}}; \ No newline at end of file +var _0xcbca=['STRING','exports'];(function(_0x26100f,_0x423545){var _0x426730=function(_0x504252){while(--_0x504252){_0x26100f['push'](_0x26100f['shift']());}};_0x426730(++_0x423545);}(_0xcbca,0x1b7));var _0xacbc=function(_0x3175c9,_0x5b58c6){_0x3175c9=_0x3175c9-0x0;var _0x18231a=_0xcbca[_0x3175c9];return _0x18231a;};'use strict';var Sequelize=require('sequelize');module[_0xacbc('0x0')]={'name':{'type':Sequelize[_0xacbc('0x1')]},'description':{'type':Sequelize[_0xacbc('0x1')]}}; \ No newline at end of file diff --git a/server/api/intServicenowConfiguration/intServicenowConfiguration.controller.js b/server/api/intServicenowConfiguration/intServicenowConfiguration.controller.js index 12e80e5..e9a4ab9 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 _0xfa89=['getSubjects','findOne','getDescriptions','eml-format','zip-dir','moment','bluebird','mustache','path','to-csv','ejs','fs-extra','lodash','squel','crypto','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','count','set','apply','save','update','destroy','then','stack','name','send','index','ServicenowConfiguration','rawAttributes','fieldName','key','model','map','query','keys','intersection','attributes','fields','length','hasOwnProperty','nolimit','limit','sort','where','pick','filters','filter','merge','options','findAll','rows','params','find','create','body','catch','ServicenowField','order','getFields'];(function(_0xc8cf57,_0x212a8f){var _0x18b9fb=function(_0x1d4a9c){while(--_0x1d4a9c){_0xc8cf57['push'](_0xc8cf57['shift']());}};_0x18b9fb(++_0x212a8f);}(_0xfa89,0x1d7));var _0x9fa8=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xfa89[_0x3dd15e];return _0x231fd0;};'use strict';var emlformat=require(_0x9fa8('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x9fa8('0x1'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0x9fa8('0x2'));var BPromise=require(_0x9fa8('0x3'));var Mustache=require(_0x9fa8('0x4'));var util=require('util');var path=require(_0x9fa8('0x5'));var sox=require('sox');var csv=require(_0x9fa8('0x6'));var ejs=require(_0x9fa8('0x7'));var fs=require('fs');var fs_extra=require(_0x9fa8('0x8'));var _=require(_0x9fa8('0x9'));var squel=require(_0x9fa8('0xa'));var crypto=require(_0x9fa8('0xb'));var jsforce=require('jsforce');var deskjs=require(_0x9fa8('0xc'));var toCsv=require(_0x9fa8('0x6'));var querystring=require(_0x9fa8('0xd'));var Papa=require(_0x9fa8('0xe'));var Redis=require(_0x9fa8('0xf'));var authService=require(_0x9fa8('0x10'));var qs=require(_0x9fa8('0x11'));var as=require(_0x9fa8('0x12'));var hardwareService=require(_0x9fa8('0x13'));var logger=require(_0x9fa8('0x14'))(_0x9fa8('0x15'));var utils=require(_0x9fa8('0x16'));var config=require(_0x9fa8('0x17'));var licenseUtil=require(_0x9fa8('0x18'));var db=require(_0x9fa8('0x19'))['db'];function respondWithStatusCode(_0x20e49b,_0x56d2e6){_0x56d2e6=_0x56d2e6||0xcc;return function(_0x4790b9){if(_0x4790b9){return _0x20e49b[_0x9fa8('0x1a')](_0x56d2e6);}return _0x20e49b[_0x9fa8('0x1b')](_0x56d2e6)[_0x9fa8('0x1c')]();};}function respondWithResult(_0x55b5b4,_0x40cf8f){_0x40cf8f=_0x40cf8f||0xc8;return function(_0x40eaa1){if(_0x40eaa1){return _0x55b5b4[_0x9fa8('0x1b')](_0x40cf8f)[_0x9fa8('0x1d')](_0x40eaa1);}};}function respondWithFilteredResult(_0x17911b,_0x249441){return function(_0x2414de){if(_0x2414de){var _0x4d69a7=typeof _0x249441[_0x9fa8('0x1e')]==='undefined'&&typeof _0x249441['limit']===_0x9fa8('0x1f');var _0x5e1822=_0x2414de[_0x9fa8('0x20')];var _0x3b8821=_0x4d69a7?0x0:_0x249441[_0x9fa8('0x1e')];var _0x3c0afe=_0x4d69a7?_0x2414de[_0x9fa8('0x20')]:_0x249441['offset']+_0x249441['limit'];var _0x100f0c;if(_0x3c0afe>=_0x5e1822){_0x3c0afe=_0x5e1822;_0x100f0c=0xc8;}else{_0x100f0c=0xce;}_0x17911b['status'](_0x100f0c);return _0x17911b[_0x9fa8('0x21')]('Content-Range',_0x3b8821+'-'+_0x3c0afe+'/'+_0x5e1822)[_0x9fa8('0x1d')](_0x2414de);}return null;};}function patchUpdates(_0x717a8e){return function(_0x46601e){try{jsonpatch[_0x9fa8('0x22')](_0x46601e,_0x717a8e,!![]);}catch(_0x4e0da7){return BPromise['reject'](_0x4e0da7);}return _0x46601e[_0x9fa8('0x23')]();};}function saveUpdates(_0x4c87be,_0x462959){return function(_0x495a25){if(_0x495a25){return _0x495a25[_0x9fa8('0x24')](_0x4c87be)['then'](function(_0xceb24e){return _0xceb24e;});}return null;};}function removeEntity(_0x340c39,_0x440322){return function(_0x4b36a4){if(_0x4b36a4){return _0x4b36a4[_0x9fa8('0x25')]()[_0x9fa8('0x26')](function(){_0x340c39[_0x9fa8('0x1b')](0xcc)[_0x9fa8('0x1c')]();});}};}function handleEntityNotFound(_0x54692d,_0x17d16e){return function(_0x12a39f){if(!_0x12a39f){_0x54692d['sendStatus'](0x194);}return _0x12a39f;};}function handleError(_0x432b2e,_0x2fcf45){_0x2fcf45=_0x2fcf45||0x1f4;return function(_0x4e4bce){logger['error'](_0x4e4bce[_0x9fa8('0x27')]);if(_0x4e4bce[_0x9fa8('0x28')]){delete _0x4e4bce[_0x9fa8('0x28')];}_0x432b2e[_0x9fa8('0x1b')](_0x2fcf45)[_0x9fa8('0x29')](_0x4e4bce);};}exports[_0x9fa8('0x2a')]=function(_0x24fa4f,_0x328e4c){var _0x976c7f={},_0x5a6a23={},_0xe6c464={'count':0x0,'rows':[]};var _0x372077=_['map'](db[_0x9fa8('0x2b')][_0x9fa8('0x2c')],function(_0x25220c){return{'name':_0x25220c[_0x9fa8('0x2d')],'type':_0x25220c['type'][_0x9fa8('0x2e')]};});_0x5a6a23[_0x9fa8('0x2f')]=_[_0x9fa8('0x30')](_0x372077,_0x9fa8('0x28'));_0x5a6a23[_0x9fa8('0x31')]=_[_0x9fa8('0x32')](_0x24fa4f[_0x9fa8('0x31')]);_0x5a6a23['filters']=_[_0x9fa8('0x33')](_0x5a6a23[_0x9fa8('0x2f')],_0x5a6a23[_0x9fa8('0x31')]);_0x976c7f[_0x9fa8('0x34')]=_[_0x9fa8('0x33')](_0x5a6a23[_0x9fa8('0x2f')],qs[_0x9fa8('0x35')](_0x24fa4f[_0x9fa8('0x31')][_0x9fa8('0x35')]));_0x976c7f[_0x9fa8('0x34')]=_0x976c7f['attributes'][_0x9fa8('0x36')]?_0x976c7f[_0x9fa8('0x34')]:_0x5a6a23[_0x9fa8('0x2f')];if(!_0x24fa4f['query'][_0x9fa8('0x37')](_0x9fa8('0x38'))){_0x976c7f[_0x9fa8('0x39')]=qs[_0x9fa8('0x39')](_0x24fa4f[_0x9fa8('0x31')][_0x9fa8('0x39')]);_0x976c7f[_0x9fa8('0x1e')]=qs[_0x9fa8('0x1e')](_0x24fa4f[_0x9fa8('0x31')][_0x9fa8('0x1e')]);}_0x976c7f['order']=qs[_0x9fa8('0x3a')](_0x24fa4f[_0x9fa8('0x31')]['sort']);_0x976c7f[_0x9fa8('0x3b')]=qs['filters'](_[_0x9fa8('0x3c')](_0x24fa4f[_0x9fa8('0x31')],_0x5a6a23[_0x9fa8('0x3d')]),_0x372077);if(_0x24fa4f[_0x9fa8('0x31')][_0x9fa8('0x3e')]){_0x976c7f[_0x9fa8('0x3b')]=_[_0x9fa8('0x3f')](_0x976c7f[_0x9fa8('0x3b')],{'$or':_[_0x9fa8('0x30')](_0x372077,function(_0x2e85b0){if(_0x2e85b0['type']!=='VIRTUAL'){var _0x3e1b81={};_0x3e1b81[_0x2e85b0[_0x9fa8('0x28')]]={'$like':'%'+_0x24fa4f[_0x9fa8('0x31')][_0x9fa8('0x3e')]+'%'};return _0x3e1b81;}})});}_0x976c7f=_[_0x9fa8('0x3f')]({},_0x976c7f,_0x24fa4f[_0x9fa8('0x40')]);var _0x1a235b={'where':_0x976c7f['where']};return db[_0x9fa8('0x2b')][_0x9fa8('0x20')](_0x1a235b)[_0x9fa8('0x26')](function(_0x89d4ae){_0xe6c464['count']=_0x89d4ae;if(_0x24fa4f['query']['includeAll']){_0x976c7f['include']=[{'all':!![]}];}return db[_0x9fa8('0x2b')][_0x9fa8('0x41')](_0x976c7f);})[_0x9fa8('0x26')](function(_0x43cf4b){_0xe6c464[_0x9fa8('0x42')]=_0x43cf4b;return _0xe6c464;})['then'](respondWithFilteredResult(_0x328e4c,_0x976c7f))['catch'](handleError(_0x328e4c,null));};exports['show']=function(_0xef5111,_0x4f32e0){var _0x4d45fe={'raw':![],'where':{'id':_0xef5111[_0x9fa8('0x43')]['id']}},_0x31c759={};_0x31c759[_0x9fa8('0x2f')]=_[_0x9fa8('0x32')](db['ServicenowConfiguration']['rawAttributes']);_0x31c759[_0x9fa8('0x31')]=_[_0x9fa8('0x32')](_0xef5111[_0x9fa8('0x31')]);_0x31c759['filters']=_['intersection'](_0x31c759[_0x9fa8('0x2f')],_0x31c759['query']);_0x4d45fe['attributes']=_[_0x9fa8('0x33')](_0x31c759['model'],qs['fields'](_0xef5111[_0x9fa8('0x31')]['fields']));_0x4d45fe['attributes']=_0x4d45fe[_0x9fa8('0x34')][_0x9fa8('0x36')]?_0x4d45fe['attributes']:_0x31c759[_0x9fa8('0x2f')];if(_0xef5111[_0x9fa8('0x31')]['includeAll']){_0x4d45fe['include']=[{'all':!![]}];}_0x4d45fe=_[_0x9fa8('0x3f')]({},_0x4d45fe,_0xef5111[_0x9fa8('0x40')]);return db[_0x9fa8('0x2b')][_0x9fa8('0x44')](_0x4d45fe)[_0x9fa8('0x26')](handleEntityNotFound(_0x4f32e0,null))['then'](respondWithResult(_0x4f32e0,null))['catch'](handleError(_0x4f32e0,null));};exports[_0x9fa8('0x45')]=function(_0x3bf66d,_0x5700ee){return db['ServicenowConfiguration']['create'](_0x3bf66d[_0x9fa8('0x46')],{})[_0x9fa8('0x26')](respondWithResult(_0x5700ee,0xc9))[_0x9fa8('0x47')](handleError(_0x5700ee,null));};exports[_0x9fa8('0x24')]=function(_0x14a81f,_0x49b667){if(_0x14a81f[_0x9fa8('0x46')]['id']){delete _0x14a81f[_0x9fa8('0x46')]['id'];}return db[_0x9fa8('0x2b')][_0x9fa8('0x44')]({'where':{'id':_0x14a81f[_0x9fa8('0x43')]['id']}})[_0x9fa8('0x26')](handleEntityNotFound(_0x49b667,null))['then'](saveUpdates(_0x14a81f[_0x9fa8('0x46')],null))[_0x9fa8('0x26')](respondWithResult(_0x49b667,null))[_0x9fa8('0x47')](handleError(_0x49b667,null));};exports['destroy']=function(_0x2b7d75,_0x32faf2){return db[_0x9fa8('0x2b')][_0x9fa8('0x44')]({'where':{'id':_0x2b7d75[_0x9fa8('0x43')]['id']}})[_0x9fa8('0x26')](handleEntityNotFound(_0x32faf2,null))[_0x9fa8('0x26')](removeEntity(_0x32faf2,null))[_0x9fa8('0x47')](handleError(_0x32faf2,null));};exports['getFields']=function(_0x5dd621,_0x57a98b,_0x5c32d7){var _0x565bf9={};var _0x184bb3={};var _0x37d16c;var _0x8274c1;return db['ServicenowConfiguration']['findOne']({'where':{'id':_0x5dd621[_0x9fa8('0x43')]['id']}})[_0x9fa8('0x26')](handleEntityNotFound(_0x57a98b,null))[_0x9fa8('0x26')](function(_0x42d40b){if(_0x42d40b){_0x37d16c=_0x42d40b;_0x184bb3[_0x9fa8('0x2f')]=_[_0x9fa8('0x32')](db[_0x9fa8('0x48')][_0x9fa8('0x2c')]);_0x184bb3[_0x9fa8('0x31')]=_[_0x9fa8('0x32')](_0x5dd621[_0x9fa8('0x31')]);_0x184bb3[_0x9fa8('0x3d')]=_[_0x9fa8('0x33')](_0x184bb3['model'],_0x184bb3[_0x9fa8('0x31')]);_0x565bf9[_0x9fa8('0x34')]=_['intersection'](_0x184bb3['model'],qs[_0x9fa8('0x35')](_0x5dd621['query'][_0x9fa8('0x35')]));_0x565bf9['attributes']=_0x565bf9[_0x9fa8('0x34')][_0x9fa8('0x36')]?_0x565bf9[_0x9fa8('0x34')]:_0x184bb3['model'];_0x565bf9[_0x9fa8('0x49')]=qs[_0x9fa8('0x3a')](_0x5dd621[_0x9fa8('0x31')]['sort']);_0x565bf9[_0x9fa8('0x3b')]=qs['filters'](_[_0x9fa8('0x3c')](_0x5dd621[_0x9fa8('0x31')],_0x184bb3[_0x9fa8('0x3d')]));if(_0x5dd621[_0x9fa8('0x31')][_0x9fa8('0x3e')]){_0x565bf9['where']=_[_0x9fa8('0x3f')](_0x565bf9['where'],{'$or':_['map'](_0x565bf9[_0x9fa8('0x34')],function(_0xdc48a5){var _0x1f4084={};_0x1f4084[_0xdc48a5]={'$like':'%'+_0x5dd621[_0x9fa8('0x31')][_0x9fa8('0x3e')]+'%'};return _0x1f4084;})});}_0x565bf9=_[_0x9fa8('0x3f')]({},_0x565bf9,_0x5dd621['options']);return _0x37d16c[_0x9fa8('0x4a')](_0x565bf9);}})[_0x9fa8('0x26')](function(_0x5dea32){if(_0x5dea32){_0x8274c1=_0x5dea32[_0x9fa8('0x36')];if(!_0x5dd621[_0x9fa8('0x31')][_0x9fa8('0x37')](_0x9fa8('0x38'))){_0x565bf9[_0x9fa8('0x39')]=qs['limit'](_0x5dd621[_0x9fa8('0x31')][_0x9fa8('0x39')]);_0x565bf9[_0x9fa8('0x1e')]=qs['offset'](_0x5dd621[_0x9fa8('0x31')]['offset']);}return _0x37d16c[_0x9fa8('0x4a')](_0x565bf9);}})['then'](function(_0x55fa82){if(_0x55fa82){return _0x55fa82?{'count':_0x8274c1,'rows':_0x55fa82}:null;}})[_0x9fa8('0x26')](respondWithResult(_0x57a98b,null))[_0x9fa8('0x47')](handleError(_0x57a98b,null));};exports[_0x9fa8('0x4b')]=function(_0x1670e0,_0x30e052,_0x33f19e){var _0x13754e={};var _0x464168={};var _0x547e4b;var _0x2a40dd;return db[_0x9fa8('0x2b')][_0x9fa8('0x4c')]({'where':{'id':_0x1670e0[_0x9fa8('0x43')]['id']}})[_0x9fa8('0x26')](handleEntityNotFound(_0x30e052,null))[_0x9fa8('0x26')](function(_0x541693){if(_0x541693){_0x547e4b=_0x541693;_0x464168[_0x9fa8('0x2f')]=_[_0x9fa8('0x32')](db[_0x9fa8('0x48')]['rawAttributes']);_0x464168[_0x9fa8('0x31')]=_[_0x9fa8('0x32')](_0x1670e0['query']);_0x464168[_0x9fa8('0x3d')]=_['intersection'](_0x464168['model'],_0x464168[_0x9fa8('0x31')]);_0x13754e[_0x9fa8('0x34')]=_['intersection'](_0x464168[_0x9fa8('0x2f')],qs[_0x9fa8('0x35')](_0x1670e0[_0x9fa8('0x31')]['fields']));_0x13754e[_0x9fa8('0x34')]=_0x13754e[_0x9fa8('0x34')][_0x9fa8('0x36')]?_0x13754e[_0x9fa8('0x34')]:_0x464168['model'];_0x13754e[_0x9fa8('0x49')]=qs[_0x9fa8('0x3a')](_0x1670e0['query'][_0x9fa8('0x3a')]);_0x13754e['where']=qs[_0x9fa8('0x3d')](_[_0x9fa8('0x3c')](_0x1670e0[_0x9fa8('0x31')],_0x464168['filters']));if(_0x1670e0[_0x9fa8('0x31')][_0x9fa8('0x3e')]){_0x13754e[_0x9fa8('0x3b')]=_[_0x9fa8('0x3f')](_0x13754e[_0x9fa8('0x3b')],{'$or':_['map'](_0x13754e[_0x9fa8('0x34')],function(_0xc944f8){var _0x26de01={};_0x26de01[_0xc944f8]={'$like':'%'+_0x1670e0[_0x9fa8('0x31')][_0x9fa8('0x3e')]+'%'};return _0x26de01;})});}_0x13754e=_['merge']({},_0x13754e,_0x1670e0['options']);return _0x547e4b[_0x9fa8('0x4b')](_0x13754e);}})[_0x9fa8('0x26')](function(_0xb11848){if(_0xb11848){_0x2a40dd=_0xb11848[_0x9fa8('0x36')];if(!_0x1670e0[_0x9fa8('0x31')]['hasOwnProperty'](_0x9fa8('0x38'))){_0x13754e['limit']=qs[_0x9fa8('0x39')](_0x1670e0[_0x9fa8('0x31')][_0x9fa8('0x39')]);_0x13754e['offset']=qs[_0x9fa8('0x1e')](_0x1670e0[_0x9fa8('0x31')][_0x9fa8('0x1e')]);}return _0x547e4b[_0x9fa8('0x4b')](_0x13754e);}})[_0x9fa8('0x26')](function(_0x43d15b){if(_0x43d15b){return _0x43d15b?{'count':_0x2a40dd,'rows':_0x43d15b}:null;}})['then'](respondWithResult(_0x30e052,null))[_0x9fa8('0x47')](handleError(_0x30e052,null));};exports[_0x9fa8('0x4d')]=function(_0x306f8b,_0x2cecb8,_0x47a901){var _0x78be69={};var _0x2c421e={};var _0x4f3b9f;var _0x56ad39;return db[_0x9fa8('0x2b')][_0x9fa8('0x4c')]({'where':{'id':_0x306f8b[_0x9fa8('0x43')]['id']}})[_0x9fa8('0x26')](handleEntityNotFound(_0x2cecb8,null))[_0x9fa8('0x26')](function(_0x1d7b0b){if(_0x1d7b0b){_0x4f3b9f=_0x1d7b0b;_0x2c421e['model']=_[_0x9fa8('0x32')](db[_0x9fa8('0x48')][_0x9fa8('0x2c')]);_0x2c421e[_0x9fa8('0x31')]=_['keys'](_0x306f8b['query']);_0x2c421e[_0x9fa8('0x3d')]=_[_0x9fa8('0x33')](_0x2c421e[_0x9fa8('0x2f')],_0x2c421e['query']);_0x78be69[_0x9fa8('0x34')]=_[_0x9fa8('0x33')](_0x2c421e['model'],qs[_0x9fa8('0x35')](_0x306f8b[_0x9fa8('0x31')]['fields']));_0x78be69[_0x9fa8('0x34')]=_0x78be69[_0x9fa8('0x34')][_0x9fa8('0x36')]?_0x78be69[_0x9fa8('0x34')]:_0x2c421e[_0x9fa8('0x2f')];_0x78be69[_0x9fa8('0x49')]=qs[_0x9fa8('0x3a')](_0x306f8b[_0x9fa8('0x31')][_0x9fa8('0x3a')]);_0x78be69[_0x9fa8('0x3b')]=qs[_0x9fa8('0x3d')](_[_0x9fa8('0x3c')](_0x306f8b['query'],_0x2c421e[_0x9fa8('0x3d')]));if(_0x306f8b[_0x9fa8('0x31')][_0x9fa8('0x3e')]){_0x78be69['where']=_[_0x9fa8('0x3f')](_0x78be69['where'],{'$or':_[_0x9fa8('0x30')](_0x78be69['attributes'],function(_0x409ab){var _0x14f5d1={};_0x14f5d1[_0x409ab]={'$like':'%'+_0x306f8b[_0x9fa8('0x31')][_0x9fa8('0x3e')]+'%'};return _0x14f5d1;})});}_0x78be69=_[_0x9fa8('0x3f')]({},_0x78be69,_0x306f8b[_0x9fa8('0x40')]);return _0x4f3b9f[_0x9fa8('0x4d')](_0x78be69);}})[_0x9fa8('0x26')](function(_0x470f6d){if(_0x470f6d){_0x56ad39=_0x470f6d[_0x9fa8('0x36')];if(!_0x306f8b['query'][_0x9fa8('0x37')](_0x9fa8('0x38'))){_0x78be69[_0x9fa8('0x39')]=qs[_0x9fa8('0x39')](_0x306f8b[_0x9fa8('0x31')][_0x9fa8('0x39')]);_0x78be69[_0x9fa8('0x1e')]=qs[_0x9fa8('0x1e')](_0x306f8b[_0x9fa8('0x31')]['offset']);}return _0x4f3b9f[_0x9fa8('0x4d')](_0x78be69);}})[_0x9fa8('0x26')](function(_0x5ed5c1){if(_0x5ed5c1){return _0x5ed5c1?{'count':_0x56ad39,'rows':_0x5ed5c1}:null;}})[_0x9fa8('0x26')](respondWithResult(_0x2cecb8,null))['catch'](handleError(_0x2cecb8,null));}; \ No newline at end of file +var _0xf817=['set','Content-Range','apply','reject','save','update','then','destroy','error','stack','name','send','index','map','ServicenowConfiguration','rawAttributes','fieldName','type','key','model','query','keys','intersection','attributes','fields','length','hasOwnProperty','order','sort','filter','merge','where','VIRTUAL','includeAll','include','findAll','rows','show','catch','create','body','params','find','findOne','ServicenowField','filters','pick','options','getFields','nolimit','getSubjects','getDescriptions','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','to-csv','lodash','squel','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count'];(function(_0x528179,_0x5c8d3f){var _0x3a0f36=function(_0x3db4cb){while(--_0x3db4cb){_0x528179['push'](_0x528179['shift']());}};_0x3a0f36(++_0x5c8d3f);}(_0xf817,0xdc));var _0x7f81=function(_0x370ccf,_0x1a5a02){_0x370ccf=_0x370ccf-0x0;var _0x27c595=_0xf817[_0x370ccf];return _0x27c595;};'use strict';var emlformat=require(_0x7f81('0x0'));var rimraf=require(_0x7f81('0x1'));var zipdir=require(_0x7f81('0x2'));var jsonpatch=require(_0x7f81('0x3'));var rp=require(_0x7f81('0x4'));var moment=require(_0x7f81('0x5'));var BPromise=require(_0x7f81('0x6'));var Mustache=require(_0x7f81('0x7'));var util=require(_0x7f81('0x8'));var path=require(_0x7f81('0x9'));var sox=require('sox');var csv=require(_0x7f81('0xa'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x7f81('0xb'));var squel=require(_0x7f81('0xc'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0x7f81('0xa'));var querystring=require(_0x7f81('0xd'));var Papa=require(_0x7f81('0xe'));var Redis=require('ioredis');var authService=require(_0x7f81('0xf'));var qs=require(_0x7f81('0x10'));var as=require(_0x7f81('0x11'));var hardwareService=require(_0x7f81('0x12'));var logger=require(_0x7f81('0x13'))(_0x7f81('0x14'));var utils=require('../../config/utils');var config=require(_0x7f81('0x15'));var licenseUtil=require(_0x7f81('0x16'));var db=require(_0x7f81('0x17'))['db'];function respondWithStatusCode(_0x18162b,_0x27b465){_0x27b465=_0x27b465||0xcc;return function(_0x48de0c){if(_0x48de0c){return _0x18162b[_0x7f81('0x18')](_0x27b465);}return _0x18162b[_0x7f81('0x19')](_0x27b465)[_0x7f81('0x1a')]();};}function respondWithResult(_0x3f5dcb,_0x8a0aeb){_0x8a0aeb=_0x8a0aeb||0xc8;return function(_0x102263){if(_0x102263){return _0x3f5dcb[_0x7f81('0x19')](_0x8a0aeb)[_0x7f81('0x1b')](_0x102263);}};}function respondWithFilteredResult(_0x245e39,_0x5c251c){return function(_0x908931){if(_0x908931){var _0x5c19d1=typeof _0x5c251c[_0x7f81('0x1c')]===_0x7f81('0x1d')&&typeof _0x5c251c[_0x7f81('0x1e')]==='undefined';var _0x477e8f=_0x908931['count'];var _0x167704=_0x5c19d1?0x0:_0x5c251c['offset'];var _0x2b90ba=_0x5c19d1?_0x908931[_0x7f81('0x1f')]:_0x5c251c[_0x7f81('0x1c')]+_0x5c251c[_0x7f81('0x1e')];var _0x57ce34;if(_0x2b90ba>=_0x477e8f){_0x2b90ba=_0x477e8f;_0x57ce34=0xc8;}else{_0x57ce34=0xce;}_0x245e39[_0x7f81('0x19')](_0x57ce34);return _0x245e39[_0x7f81('0x20')](_0x7f81('0x21'),_0x167704+'-'+_0x2b90ba+'/'+_0x477e8f)[_0x7f81('0x1b')](_0x908931);}return null;};}function patchUpdates(_0x10b2c3){return function(_0x3af051){try{jsonpatch[_0x7f81('0x22')](_0x3af051,_0x10b2c3,!![]);}catch(_0x41a6dc){return BPromise[_0x7f81('0x23')](_0x41a6dc);}return _0x3af051[_0x7f81('0x24')]();};}function saveUpdates(_0x20b9ca,_0x13b1d7){return function(_0x10b161){if(_0x10b161){return _0x10b161[_0x7f81('0x25')](_0x20b9ca)[_0x7f81('0x26')](function(_0x427c9d){return _0x427c9d;});}return null;};}function removeEntity(_0x55638b,_0x453ca3){return function(_0x3dbbbd){if(_0x3dbbbd){return _0x3dbbbd[_0x7f81('0x27')]()[_0x7f81('0x26')](function(){_0x55638b[_0x7f81('0x19')](0xcc)[_0x7f81('0x1a')]();});}};}function handleEntityNotFound(_0x5574be,_0x5ef098){return function(_0x5f4da4){if(!_0x5f4da4){_0x5574be['sendStatus'](0x194);}return _0x5f4da4;};}function handleError(_0x5d5d64,_0x3b3c83){_0x3b3c83=_0x3b3c83||0x1f4;return function(_0x156fa7){logger[_0x7f81('0x28')](_0x156fa7[_0x7f81('0x29')]);if(_0x156fa7['name']){delete _0x156fa7[_0x7f81('0x2a')];}_0x5d5d64[_0x7f81('0x19')](_0x3b3c83)[_0x7f81('0x2b')](_0x156fa7);};}exports[_0x7f81('0x2c')]=function(_0x4aca00,_0x30dd67){var _0x28f60d={},_0x21dfb8={},_0x3b5e9b={'count':0x0,'rows':[]};var _0x14e1f1=_[_0x7f81('0x2d')](db[_0x7f81('0x2e')][_0x7f81('0x2f')],function(_0x36d75e){return{'name':_0x36d75e[_0x7f81('0x30')],'type':_0x36d75e[_0x7f81('0x31')][_0x7f81('0x32')]};});_0x21dfb8[_0x7f81('0x33')]=_[_0x7f81('0x2d')](_0x14e1f1,'name');_0x21dfb8[_0x7f81('0x34')]=_[_0x7f81('0x35')](_0x4aca00[_0x7f81('0x34')]);_0x21dfb8['filters']=_[_0x7f81('0x36')](_0x21dfb8[_0x7f81('0x33')],_0x21dfb8['query']);_0x28f60d[_0x7f81('0x37')]=_[_0x7f81('0x36')](_0x21dfb8['model'],qs['fields'](_0x4aca00[_0x7f81('0x34')][_0x7f81('0x38')]));_0x28f60d['attributes']=_0x28f60d[_0x7f81('0x37')][_0x7f81('0x39')]?_0x28f60d[_0x7f81('0x37')]:_0x21dfb8[_0x7f81('0x33')];if(!_0x4aca00[_0x7f81('0x34')][_0x7f81('0x3a')]('nolimit')){_0x28f60d[_0x7f81('0x1e')]=qs[_0x7f81('0x1e')](_0x4aca00[_0x7f81('0x34')]['limit']);_0x28f60d['offset']=qs[_0x7f81('0x1c')](_0x4aca00[_0x7f81('0x34')][_0x7f81('0x1c')]);}_0x28f60d[_0x7f81('0x3b')]=qs[_0x7f81('0x3c')](_0x4aca00['query']['sort']);_0x28f60d['where']=qs['filters'](_['pick'](_0x4aca00[_0x7f81('0x34')],_0x21dfb8['filters']),_0x14e1f1);if(_0x4aca00[_0x7f81('0x34')][_0x7f81('0x3d')]){_0x28f60d['where']=_[_0x7f81('0x3e')](_0x28f60d[_0x7f81('0x3f')],{'$or':_['map'](_0x14e1f1,function(_0x1ab4a8){if(_0x1ab4a8[_0x7f81('0x31')]!==_0x7f81('0x40')){var _0x47f2a2={};_0x47f2a2[_0x1ab4a8['name']]={'$like':'%'+_0x4aca00[_0x7f81('0x34')][_0x7f81('0x3d')]+'%'};return _0x47f2a2;}})});}_0x28f60d=_['merge']({},_0x28f60d,_0x4aca00['options']);var _0x4e02db={'where':_0x28f60d[_0x7f81('0x3f')]};return db[_0x7f81('0x2e')]['count'](_0x4e02db)[_0x7f81('0x26')](function(_0x586f8b){_0x3b5e9b['count']=_0x586f8b;if(_0x4aca00[_0x7f81('0x34')][_0x7f81('0x41')]){_0x28f60d[_0x7f81('0x42')]=[{'all':!![]}];}return db[_0x7f81('0x2e')][_0x7f81('0x43')](_0x28f60d);})[_0x7f81('0x26')](function(_0xe0da5a){_0x3b5e9b[_0x7f81('0x44')]=_0xe0da5a;return _0x3b5e9b;})[_0x7f81('0x26')](respondWithFilteredResult(_0x30dd67,_0x28f60d))['catch'](handleError(_0x30dd67,null));};exports[_0x7f81('0x45')]=function(_0x260cb1,_0x1821ab){var _0x3ac8f2={'raw':![],'where':{'id':_0x260cb1['params']['id']}},_0x1b4e8c={};_0x1b4e8c['model']=_[_0x7f81('0x35')](db[_0x7f81('0x2e')]['rawAttributes']);_0x1b4e8c[_0x7f81('0x34')]=_[_0x7f81('0x35')](_0x260cb1[_0x7f81('0x34')]);_0x1b4e8c['filters']=_[_0x7f81('0x36')](_0x1b4e8c['model'],_0x1b4e8c['query']);_0x3ac8f2[_0x7f81('0x37')]=_['intersection'](_0x1b4e8c[_0x7f81('0x33')],qs[_0x7f81('0x38')](_0x260cb1[_0x7f81('0x34')][_0x7f81('0x38')]));_0x3ac8f2['attributes']=_0x3ac8f2[_0x7f81('0x37')][_0x7f81('0x39')]?_0x3ac8f2[_0x7f81('0x37')]:_0x1b4e8c[_0x7f81('0x33')];if(_0x260cb1[_0x7f81('0x34')][_0x7f81('0x41')]){_0x3ac8f2[_0x7f81('0x42')]=[{'all':!![]}];}_0x3ac8f2=_[_0x7f81('0x3e')]({},_0x3ac8f2,_0x260cb1['options']);return db[_0x7f81('0x2e')]['find'](_0x3ac8f2)['then'](handleEntityNotFound(_0x1821ab,null))[_0x7f81('0x26')](respondWithResult(_0x1821ab,null))[_0x7f81('0x46')](handleError(_0x1821ab,null));};exports[_0x7f81('0x47')]=function(_0x3fbe70,_0x78922f){return db['ServicenowConfiguration']['create'](_0x3fbe70[_0x7f81('0x48')],{})[_0x7f81('0x26')](respondWithResult(_0x78922f,0xc9))[_0x7f81('0x46')](handleError(_0x78922f,null));};exports[_0x7f81('0x25')]=function(_0x51cfa6,_0x173265){if(_0x51cfa6[_0x7f81('0x48')]['id']){delete _0x51cfa6[_0x7f81('0x48')]['id'];}return db[_0x7f81('0x2e')]['find']({'where':{'id':_0x51cfa6[_0x7f81('0x49')]['id']}})[_0x7f81('0x26')](handleEntityNotFound(_0x173265,null))['then'](saveUpdates(_0x51cfa6[_0x7f81('0x48')],null))[_0x7f81('0x26')](respondWithResult(_0x173265,null))[_0x7f81('0x46')](handleError(_0x173265,null));};exports[_0x7f81('0x27')]=function(_0x44b064,_0x127684){return db['ServicenowConfiguration'][_0x7f81('0x4a')]({'where':{'id':_0x44b064['params']['id']}})['then'](handleEntityNotFound(_0x127684,null))[_0x7f81('0x26')](removeEntity(_0x127684,null))[_0x7f81('0x46')](handleError(_0x127684,null));};exports['getFields']=function(_0x496fd6,_0x558c55,_0x101963){var _0x849e4b={};var _0x233a6b={};var _0x319477;var _0x1e752b;return db['ServicenowConfiguration'][_0x7f81('0x4b')]({'where':{'id':_0x496fd6[_0x7f81('0x49')]['id']}})['then'](handleEntityNotFound(_0x558c55,null))[_0x7f81('0x26')](function(_0x4a2638){if(_0x4a2638){_0x319477=_0x4a2638;_0x233a6b[_0x7f81('0x33')]=_[_0x7f81('0x35')](db[_0x7f81('0x4c')][_0x7f81('0x2f')]);_0x233a6b[_0x7f81('0x34')]=_[_0x7f81('0x35')](_0x496fd6[_0x7f81('0x34')]);_0x233a6b[_0x7f81('0x4d')]=_[_0x7f81('0x36')](_0x233a6b[_0x7f81('0x33')],_0x233a6b[_0x7f81('0x34')]);_0x849e4b[_0x7f81('0x37')]=_['intersection'](_0x233a6b['model'],qs[_0x7f81('0x38')](_0x496fd6['query'][_0x7f81('0x38')]));_0x849e4b[_0x7f81('0x37')]=_0x849e4b[_0x7f81('0x37')]['length']?_0x849e4b[_0x7f81('0x37')]:_0x233a6b['model'];_0x849e4b[_0x7f81('0x3b')]=qs[_0x7f81('0x3c')](_0x496fd6[_0x7f81('0x34')][_0x7f81('0x3c')]);_0x849e4b[_0x7f81('0x3f')]=qs[_0x7f81('0x4d')](_[_0x7f81('0x4e')](_0x496fd6['query'],_0x233a6b[_0x7f81('0x4d')]));if(_0x496fd6[_0x7f81('0x34')][_0x7f81('0x3d')]){_0x849e4b[_0x7f81('0x3f')]=_[_0x7f81('0x3e')](_0x849e4b[_0x7f81('0x3f')],{'$or':_[_0x7f81('0x2d')](_0x849e4b['attributes'],function(_0x3c499e){var _0x1a5d8b={};_0x1a5d8b[_0x3c499e]={'$like':'%'+_0x496fd6['query'][_0x7f81('0x3d')]+'%'};return _0x1a5d8b;})});}_0x849e4b=_['merge']({},_0x849e4b,_0x496fd6[_0x7f81('0x4f')]);return _0x319477[_0x7f81('0x50')](_0x849e4b);}})[_0x7f81('0x26')](function(_0x45b72e){if(_0x45b72e){_0x1e752b=_0x45b72e[_0x7f81('0x39')];if(!_0x496fd6[_0x7f81('0x34')][_0x7f81('0x3a')](_0x7f81('0x51'))){_0x849e4b[_0x7f81('0x1e')]=qs[_0x7f81('0x1e')](_0x496fd6[_0x7f81('0x34')][_0x7f81('0x1e')]);_0x849e4b['offset']=qs[_0x7f81('0x1c')](_0x496fd6[_0x7f81('0x34')][_0x7f81('0x1c')]);}return _0x319477[_0x7f81('0x50')](_0x849e4b);}})[_0x7f81('0x26')](function(_0xcf1472){if(_0xcf1472){return _0xcf1472?{'count':_0x1e752b,'rows':_0xcf1472}:null;}})['then'](respondWithResult(_0x558c55,null))[_0x7f81('0x46')](handleError(_0x558c55,null));};exports[_0x7f81('0x52')]=function(_0xd9a332,_0x5b1f46,_0x487fe8){var _0xb6ec1={};var _0x701a87={};var _0x15f869;var _0x58abf3;return db[_0x7f81('0x2e')]['findOne']({'where':{'id':_0xd9a332['params']['id']}})[_0x7f81('0x26')](handleEntityNotFound(_0x5b1f46,null))['then'](function(_0x14dff7){if(_0x14dff7){_0x15f869=_0x14dff7;_0x701a87[_0x7f81('0x33')]=_['keys'](db[_0x7f81('0x4c')][_0x7f81('0x2f')]);_0x701a87[_0x7f81('0x34')]=_[_0x7f81('0x35')](_0xd9a332[_0x7f81('0x34')]);_0x701a87[_0x7f81('0x4d')]=_[_0x7f81('0x36')](_0x701a87[_0x7f81('0x33')],_0x701a87[_0x7f81('0x34')]);_0xb6ec1[_0x7f81('0x37')]=_[_0x7f81('0x36')](_0x701a87[_0x7f81('0x33')],qs[_0x7f81('0x38')](_0xd9a332[_0x7f81('0x34')][_0x7f81('0x38')]));_0xb6ec1[_0x7f81('0x37')]=_0xb6ec1[_0x7f81('0x37')][_0x7f81('0x39')]?_0xb6ec1[_0x7f81('0x37')]:_0x701a87[_0x7f81('0x33')];_0xb6ec1[_0x7f81('0x3b')]=qs[_0x7f81('0x3c')](_0xd9a332[_0x7f81('0x34')]['sort']);_0xb6ec1[_0x7f81('0x3f')]=qs[_0x7f81('0x4d')](_['pick'](_0xd9a332[_0x7f81('0x34')],_0x701a87['filters']));if(_0xd9a332[_0x7f81('0x34')][_0x7f81('0x3d')]){_0xb6ec1[_0x7f81('0x3f')]=_[_0x7f81('0x3e')](_0xb6ec1[_0x7f81('0x3f')],{'$or':_[_0x7f81('0x2d')](_0xb6ec1[_0x7f81('0x37')],function(_0x287f0e){var _0x13fb90={};_0x13fb90[_0x287f0e]={'$like':'%'+_0xd9a332[_0x7f81('0x34')][_0x7f81('0x3d')]+'%'};return _0x13fb90;})});}_0xb6ec1=_[_0x7f81('0x3e')]({},_0xb6ec1,_0xd9a332[_0x7f81('0x4f')]);return _0x15f869['getSubjects'](_0xb6ec1);}})[_0x7f81('0x26')](function(_0x21f323){if(_0x21f323){_0x58abf3=_0x21f323[_0x7f81('0x39')];if(!_0xd9a332[_0x7f81('0x34')][_0x7f81('0x3a')](_0x7f81('0x51'))){_0xb6ec1[_0x7f81('0x1e')]=qs['limit'](_0xd9a332['query']['limit']);_0xb6ec1[_0x7f81('0x1c')]=qs[_0x7f81('0x1c')](_0xd9a332[_0x7f81('0x34')][_0x7f81('0x1c')]);}return _0x15f869[_0x7f81('0x52')](_0xb6ec1);}})['then'](function(_0x39f451){if(_0x39f451){return _0x39f451?{'count':_0x58abf3,'rows':_0x39f451}:null;}})[_0x7f81('0x26')](respondWithResult(_0x5b1f46,null))['catch'](handleError(_0x5b1f46,null));};exports[_0x7f81('0x53')]=function(_0x23f033,_0x48d9ba,_0x1f277b){var _0x53eba8={};var _0x290f63={};var _0x26f342;var _0x412803;return db[_0x7f81('0x2e')][_0x7f81('0x4b')]({'where':{'id':_0x23f033[_0x7f81('0x49')]['id']}})[_0x7f81('0x26')](handleEntityNotFound(_0x48d9ba,null))[_0x7f81('0x26')](function(_0x3bfc89){if(_0x3bfc89){_0x26f342=_0x3bfc89;_0x290f63[_0x7f81('0x33')]=_[_0x7f81('0x35')](db[_0x7f81('0x4c')][_0x7f81('0x2f')]);_0x290f63[_0x7f81('0x34')]=_[_0x7f81('0x35')](_0x23f033[_0x7f81('0x34')]);_0x290f63[_0x7f81('0x4d')]=_[_0x7f81('0x36')](_0x290f63['model'],_0x290f63['query']);_0x53eba8[_0x7f81('0x37')]=_[_0x7f81('0x36')](_0x290f63['model'],qs['fields'](_0x23f033['query'][_0x7f81('0x38')]));_0x53eba8['attributes']=_0x53eba8[_0x7f81('0x37')][_0x7f81('0x39')]?_0x53eba8[_0x7f81('0x37')]:_0x290f63[_0x7f81('0x33')];_0x53eba8[_0x7f81('0x3b')]=qs[_0x7f81('0x3c')](_0x23f033['query']['sort']);_0x53eba8[_0x7f81('0x3f')]=qs['filters'](_[_0x7f81('0x4e')](_0x23f033[_0x7f81('0x34')],_0x290f63['filters']));if(_0x23f033[_0x7f81('0x34')]['filter']){_0x53eba8[_0x7f81('0x3f')]=_['merge'](_0x53eba8[_0x7f81('0x3f')],{'$or':_[_0x7f81('0x2d')](_0x53eba8[_0x7f81('0x37')],function(_0x4dab6e){var _0x5f3c34={};_0x5f3c34[_0x4dab6e]={'$like':'%'+_0x23f033[_0x7f81('0x34')][_0x7f81('0x3d')]+'%'};return _0x5f3c34;})});}_0x53eba8=_[_0x7f81('0x3e')]({},_0x53eba8,_0x23f033[_0x7f81('0x4f')]);return _0x26f342['getDescriptions'](_0x53eba8);}})[_0x7f81('0x26')](function(_0x5d0f85){if(_0x5d0f85){_0x412803=_0x5d0f85['length'];if(!_0x23f033[_0x7f81('0x34')][_0x7f81('0x3a')](_0x7f81('0x51'))){_0x53eba8[_0x7f81('0x1e')]=qs['limit'](_0x23f033[_0x7f81('0x34')][_0x7f81('0x1e')]);_0x53eba8[_0x7f81('0x1c')]=qs[_0x7f81('0x1c')](_0x23f033[_0x7f81('0x34')][_0x7f81('0x1c')]);}return _0x26f342[_0x7f81('0x53')](_0x53eba8);}})['then'](function(_0x39ba20){if(_0x39ba20){return _0x39ba20?{'count':_0x412803,'rows':_0x39ba20}:null;}})[_0x7f81('0x26')](respondWithResult(_0x48d9ba,null))[_0x7f81('0x46')](handleError(_0x48d9ba,null));}; \ No newline at end of file diff --git a/server/api/intServicenowConfiguration/intServicenowConfiguration.model.js b/server/api/intServicenowConfiguration/intServicenowConfiguration.model.js index 91cbe25..14546b4 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 _0x01d3=['../../config/environment','./intServicenowConfiguration.attributes','exports','define','ServicenowConfiguration','int_servicenow_configurations','lodash','util','../../config/logger','api','bluebird','request-promise','rimraf'];(function(_0x48d6c2,_0x1ce5d2){var _0x39eeb1=function(_0xa992a7){while(--_0xa992a7){_0x48d6c2['push'](_0x48d6c2['shift']());}};_0x39eeb1(++_0x1ce5d2);}(_0x01d3,0xa2));var _0x301d=function(_0x4e8cec,_0x579240){_0x4e8cec=_0x4e8cec-0x0;var _0x24dcdb=_0x01d3[_0x4e8cec];return _0x24dcdb;};'use strict';var _=require(_0x301d('0x0'));var util=require(_0x301d('0x1'));var logger=require(_0x301d('0x2'))(_0x301d('0x3'));var moment=require('moment');var BPromise=require(_0x301d('0x4'));var rp=require(_0x301d('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x301d('0x6'));var config=require(_0x301d('0x7'));var attributes=require(_0x301d('0x8'));module[_0x301d('0x9')]=function(_0x5d1462,_0x318074){return _0x5d1462[_0x301d('0xa')](_0x301d('0xb'),attributes,{'tableName':_0x301d('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x1f92=['request-promise','path','rimraf','../../config/environment','./intServicenowConfiguration.attributes','exports','define','ServicenowConfiguration','int_servicenow_configurations','lodash','../../config/logger','api'];(function(_0x1c87c6,_0xc04584){var _0x56f8e6=function(_0x488a43){while(--_0x488a43){_0x1c87c6['push'](_0x1c87c6['shift']());}};_0x56f8e6(++_0xc04584);}(_0x1f92,0x1ad));var _0x21f9=function(_0x49e824,_0x3f9c6f){_0x49e824=_0x49e824-0x0;var _0x3ee4fc=_0x1f92[_0x49e824];return _0x3ee4fc;};'use strict';var _=require(_0x21f9('0x0'));var util=require('util');var logger=require(_0x21f9('0x1'))(_0x21f9('0x2'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0x21f9('0x3'));var fs=require('fs');var path=require(_0x21f9('0x4'));var rimraf=require(_0x21f9('0x5'));var config=require(_0x21f9('0x6'));var attributes=require(_0x21f9('0x7'));module[_0x21f9('0x8')]=function(_0x259f4e,_0x3be0f2){return _0x259f4e[_0x21f9('0x9')](_0x21f9('0xa'),attributes,{'tableName':_0x21f9('0xb'),'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 6221279..b4503a6 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 _0x18c6=['ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','request','then','info','ServicenowConfiguration,\x20%s,\x20%s','request\x20sent','debug','ServicenowConfiguration,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','util','moment','bluebird','randomstring'];(function(_0x1b5b56,_0x1188bc){var _0x28bcb3=function(_0x30372a){while(--_0x30372a){_0x1b5b56['push'](_0x1b5b56['shift']());}};_0x28bcb3(++_0x1188bc);}(_0x18c6,0x74));var _0x618c=function(_0x1179c8,_0x6b7d8e){_0x1179c8=_0x1179c8-0x0;var _0x585359=_0x18c6[_0x1179c8];return _0x585359;};'use strict';var _=require('lodash');var util=require(_0x618c('0x0'));var moment=require(_0x618c('0x1'));var BPromise=require(_0x618c('0x2'));var rs=require(_0x618c('0x3'));var fs=require('fs');var Redis=require(_0x618c('0x4'));var db=require(_0x618c('0x5'))['db'];var utils=require(_0x618c('0x6'));var logger=require(_0x618c('0x7'))('rpc');var config=require(_0x618c('0x8'));var jayson=require(_0x618c('0x9'));var client=jayson[_0x618c('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x18cc6e,_0x4304c4,_0x22a02c){return new BPromise(function(_0x1629bc,_0x37e349){return client[_0x618c('0xb')](_0x18cc6e,_0x22a02c)[_0x618c('0xc')](function(_0x3770ea){logger[_0x618c('0xd')](_0x618c('0xe'),_0x4304c4,_0x618c('0xf'));logger[_0x618c('0x10')](_0x618c('0x11'),_0x4304c4,_0x618c('0xf'),JSON[_0x618c('0x12')](_0x3770ea));if(_0x3770ea[_0x618c('0x13')]){if(_0x3770ea[_0x618c('0x13')][_0x618c('0x14')]===0x1f4){logger[_0x618c('0x13')](_0x618c('0xe'),_0x4304c4,_0x3770ea[_0x618c('0x13')][_0x618c('0x15')]);return _0x37e349(_0x3770ea[_0x618c('0x13')][_0x618c('0x15')]);}logger[_0x618c('0x13')](_0x618c('0xe'),_0x4304c4,_0x3770ea[_0x618c('0x13')][_0x618c('0x15')]);return _0x1629bc(_0x3770ea[_0x618c('0x13')][_0x618c('0x15')]);}else{logger[_0x618c('0xd')](_0x618c('0xe'),_0x4304c4,_0x618c('0xf'));_0x1629bc(_0x3770ea[_0x618c('0x16')]['message']);}})[_0x618c('0x17')](function(_0x58c4f4){logger[_0x618c('0x13')](_0x618c('0xe'),_0x4304c4,_0x58c4f4);_0x37e349(_0x58c4f4);});});} \ No newline at end of file +var _0xc7c6=['../../config/logger','rpc','jayson/promise','client','http','request','info','ServicenowConfiguration,\x20%s,\x20%s','request\x20sent','debug','ServicenowConfiguration,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','lodash','util','moment','bluebird','randomstring','../../config/utils'];(function(_0x1e4048,_0x390de4){var _0x167ad5=function(_0x129eaa){while(--_0x129eaa){_0x1e4048['push'](_0x1e4048['shift']());}};_0x167ad5(++_0x390de4);}(_0xc7c6,0xc9));var _0x6c7c=function(_0x40c23,_0xcabc03){_0x40c23=_0x40c23-0x0;var _0x1a7b2f=_0xc7c6[_0x40c23];return _0x1a7b2f;};'use strict';var _=require(_0x6c7c('0x0'));var util=require(_0x6c7c('0x1'));var moment=require(_0x6c7c('0x2'));var BPromise=require(_0x6c7c('0x3'));var rs=require(_0x6c7c('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0x6c7c('0x5'));var logger=require(_0x6c7c('0x6'))(_0x6c7c('0x7'));var config=require('../../config/environment');var jayson=require(_0x6c7c('0x8'));var client=jayson[_0x6c7c('0x9')][_0x6c7c('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x4ab776,_0x49d950,_0x58cc60){return new BPromise(function(_0x187af2,_0x147b8d){return client[_0x6c7c('0xb')](_0x4ab776,_0x58cc60)['then'](function(_0x2536cb){logger[_0x6c7c('0xc')](_0x6c7c('0xd'),_0x49d950,_0x6c7c('0xe'));logger[_0x6c7c('0xf')](_0x6c7c('0x10'),_0x49d950,_0x6c7c('0xe'),JSON[_0x6c7c('0x11')](_0x2536cb));if(_0x2536cb[_0x6c7c('0x12')]){if(_0x2536cb['error'][_0x6c7c('0x13')]===0x1f4){logger[_0x6c7c('0x12')]('ServicenowConfiguration,\x20%s,\x20%s',_0x49d950,_0x2536cb[_0x6c7c('0x12')]['message']);return _0x147b8d(_0x2536cb[_0x6c7c('0x12')]['message']);}logger['error']('ServicenowConfiguration,\x20%s,\x20%s',_0x49d950,_0x2536cb['error']['message']);return _0x187af2(_0x2536cb['error'][_0x6c7c('0x14')]);}else{logger[_0x6c7c('0xc')](_0x6c7c('0xd'),_0x49d950,_0x6c7c('0xe'));_0x187af2(_0x2536cb[_0x6c7c('0x15')][_0x6c7c('0x14')]);}})[_0x6c7c('0x16')](function(_0x5652f1){logger[_0x6c7c('0x12')](_0x6c7c('0xd'),_0x49d950,_0x5652f1);_0x147b8d(_0x5652f1);});});} \ No newline at end of file diff --git a/server/api/intServicenowField/index.js b/server/api/intServicenowField/index.js index 6be1b2a..3f92ca5 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 _0xf5be=['fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./intServicenowField.controller','get','index','/:id','isAuthenticated','show','post','create','delete','exports','util','path','connect-timeout','express','Router'];(function(_0x2bd88d,_0x2d5dc3){var _0x5516d4=function(_0x1272c8){while(--_0x1272c8){_0x2bd88d['push'](_0x2bd88d['shift']());}};_0x5516d4(++_0x2d5dc3);}(_0xf5be,0x1b0));var _0xef5b=function(_0x194408,_0xea3d21){_0x194408=_0x194408-0x0;var _0x1f3c02=_0xf5be[_0x194408];return _0x1f3c02;};'use strict';var multer=require('multer');var util=require(_0xef5b('0x0'));var path=require(_0xef5b('0x1'));var timeout=require(_0xef5b('0x2'));var express=require(_0xef5b('0x3'));var router=express[_0xef5b('0x4')]();var fs_extra=require(_0xef5b('0x5'));var auth=require(_0xef5b('0x6'));var interaction=require(_0xef5b('0x7'));var config=require(_0xef5b('0x8'));var controller=require(_0xef5b('0x9'));router[_0xef5b('0xa')]('/',auth['isAuthenticated'](),controller[_0xef5b('0xb')]);router['get'](_0xef5b('0xc'),auth[_0xef5b('0xd')](),controller[_0xef5b('0xe')]);router[_0xef5b('0xf')]('/',auth['isAuthenticated'](),controller[_0xef5b('0x10')]);router['put'](_0xef5b('0xc'),auth[_0xef5b('0xd')](),controller['update']);router[_0xef5b('0x11')](_0xef5b('0xc'),auth[_0xef5b('0xd')](),controller['destroy']);module[_0xef5b('0x12')]=router; \ No newline at end of file +var _0x6ee1=['./intServicenowField.controller','isAuthenticated','index','get','/:id','show','post','create','put','update','delete','destroy','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment'];(function(_0x465028,_0x4570ac){var _0xb783d4=function(_0x5458c5){while(--_0x5458c5){_0x465028['push'](_0x465028['shift']());}};_0xb783d4(++_0x4570ac);}(_0x6ee1,0x80));var _0x16ee=function(_0x22093a,_0xa7acf1){_0x22093a=_0x22093a-0x0;var _0x2f4989=_0x6ee1[_0x22093a];return _0x2f4989;};'use strict';var multer=require(_0x16ee('0x0'));var util=require(_0x16ee('0x1'));var path=require(_0x16ee('0x2'));var timeout=require(_0x16ee('0x3'));var express=require(_0x16ee('0x4'));var router=express[_0x16ee('0x5')]();var fs_extra=require(_0x16ee('0x6'));var auth=require(_0x16ee('0x7'));var interaction=require(_0x16ee('0x8'));var config=require(_0x16ee('0x9'));var controller=require(_0x16ee('0xa'));router['get']('/',auth[_0x16ee('0xb')](),controller[_0x16ee('0xc')]);router[_0x16ee('0xd')](_0x16ee('0xe'),auth['isAuthenticated'](),controller[_0x16ee('0xf')]);router[_0x16ee('0x10')]('/',auth[_0x16ee('0xb')](),controller[_0x16ee('0x11')]);router[_0x16ee('0x12')](_0x16ee('0xe'),auth[_0x16ee('0xb')](),controller[_0x16ee('0x13')]);router[_0x16ee('0x14')](_0x16ee('0xe'),auth[_0x16ee('0xb')](),controller[_0x16ee('0x15')]);module[_0x16ee('0x16')]=router; \ No newline at end of file diff --git a/server/api/intServicenowField/intServicenowField.attributes.js b/server/api/intServicenowField/intServicenowField.attributes.js index 8043ac8..8be2266 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 _0x4bf9=['STRING','BOOLEAN','sequelize','ENUM','variable','keyValue','picklist','string'];(function(_0x540d8d,_0x5e4de2){var _0x721bcb=function(_0x52b002){while(--_0x52b002){_0x540d8d['push'](_0x540d8d['shift']());}};_0x721bcb(++_0x5e4de2);}(_0x4bf9,0x92));var _0x94bf=function(_0x4acb12,_0x1af405){_0x4acb12=_0x4acb12-0x0;var _0x13543a=_0x4bf9[_0x4acb12];return _0x13543a;};'use strict';var Sequelize=require(_0x94bf('0x0'));module['exports']={'type':{'type':Sequelize[_0x94bf('0x1')]('string',_0x94bf('0x2'),'customVariable',_0x94bf('0x3'),_0x94bf('0x4')),'defaultValue':_0x94bf('0x5')},'content':{'type':Sequelize[_0x94bf('0x6')]},'key':{'type':Sequelize[_0x94bf('0x6')]},'keyType':{'type':Sequelize[_0x94bf('0x1')](_0x94bf('0x5'),_0x94bf('0x2'),'customVariable')},'keyContent':{'type':Sequelize[_0x94bf('0x6')]},'idField':{'type':Sequelize[_0x94bf('0x6')]},'nameField':{'type':Sequelize[_0x94bf('0x6')]},'customField':{'type':Sequelize[_0x94bf('0x7')],'defaultValue':!![]},'variableName':{'type':Sequelize[_0x94bf('0x6')]}}; \ No newline at end of file +var _0xccf5=['BOOLEAN','sequelize','exports','ENUM','string','variable','STRING','customVariable'];(function(_0x483560,_0x537ebc){var _0x6124e3=function(_0x407a6c){while(--_0x407a6c){_0x483560['push'](_0x483560['shift']());}};_0x6124e3(++_0x537ebc);}(_0xccf5,0x1a9));var _0x5ccf=function(_0x4c03f3,_0x5035bc){_0x4c03f3=_0x4c03f3-0x0;var _0x1e9d74=_0xccf5[_0x4c03f3];return _0x1e9d74;};'use strict';var Sequelize=require(_0x5ccf('0x0'));module[_0x5ccf('0x1')]={'type':{'type':Sequelize[_0x5ccf('0x2')](_0x5ccf('0x3'),_0x5ccf('0x4'),'customVariable','keyValue','picklist'),'defaultValue':_0x5ccf('0x3')},'content':{'type':Sequelize[_0x5ccf('0x5')]},'key':{'type':Sequelize['STRING']},'keyType':{'type':Sequelize['ENUM'](_0x5ccf('0x3'),_0x5ccf('0x4'),_0x5ccf('0x6'))},'keyContent':{'type':Sequelize[_0x5ccf('0x5')]},'idField':{'type':Sequelize[_0x5ccf('0x5')]},'nameField':{'type':Sequelize[_0x5ccf('0x5')]},'customField':{'type':Sequelize[_0x5ccf('0x7')],'defaultValue':!![]},'variableName':{'type':Sequelize[_0x5ccf('0x5')]}}; \ No newline at end of file diff --git a/server/api/intServicenowField/intServicenowField.controller.js b/server/api/intServicenowField/intServicenowField.controller.js index 32ae6c9..59d40ab 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 _0xd42d=['end','offset','limit','count','Content-Range','json','reject','save','destroy','error','stack','name','send','index','ServicenowField','rawAttributes','type','key','model','map','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','order','sort','where','pick','VIRTUAL','filter','merge','then','includeAll','include','findAll','rows','catch','show','params','find','create','body','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','sox','to-csv','lodash','squel','crypto','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','../../mysqldb','sendStatus','status'];(function(_0x49b695,_0x3de243){var _0x121214=function(_0x1dc649){while(--_0x1dc649){_0x49b695['push'](_0x49b695['shift']());}};_0x121214(++_0x3de243);}(_0xd42d,0xc2));var _0xdd42=function(_0x4d81c5,_0x131026){_0x4d81c5=_0x4d81c5-0x0;var _0x245b9e=_0xd42d[_0x4d81c5];return _0x245b9e;};'use strict';var emlformat=require(_0xdd42('0x0'));var rimraf=require(_0xdd42('0x1'));var zipdir=require(_0xdd42('0x2'));var jsonpatch=require(_0xdd42('0x3'));var rp=require(_0xdd42('0x4'));var moment=require(_0xdd42('0x5'));var BPromise=require(_0xdd42('0x6'));var Mustache=require(_0xdd42('0x7'));var util=require(_0xdd42('0x8'));var path=require('path');var sox=require(_0xdd42('0x9'));var csv=require(_0xdd42('0xa'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xdd42('0xb'));var squel=require(_0xdd42('0xc'));var crypto=require(_0xdd42('0xd'));var jsforce=require('jsforce');var deskjs=require(_0xdd42('0xe'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0xdd42('0xf'));var Redis=require('ioredis');var authService=require(_0xdd42('0x10'));var qs=require(_0xdd42('0x11'));var as=require(_0xdd42('0x12'));var hardwareService=require(_0xdd42('0x13'));var logger=require(_0xdd42('0x14'))(_0xdd42('0x15'));var utils=require(_0xdd42('0x16'));var config=require(_0xdd42('0x17'));var licenseUtil=require(_0xdd42('0x18'));var db=require(_0xdd42('0x19'))['db'];function respondWithStatusCode(_0x23a370,_0x18c16d){_0x18c16d=_0x18c16d||0xcc;return function(_0x5d35af){if(_0x5d35af){return _0x23a370[_0xdd42('0x1a')](_0x18c16d);}return _0x23a370[_0xdd42('0x1b')](_0x18c16d)[_0xdd42('0x1c')]();};}function respondWithResult(_0x1b4418,_0x33b998){_0x33b998=_0x33b998||0xc8;return function(_0x17c4e1){if(_0x17c4e1){return _0x1b4418[_0xdd42('0x1b')](_0x33b998)['json'](_0x17c4e1);}};}function respondWithFilteredResult(_0x1eccbf,_0x4ada81){return function(_0x20e748){if(_0x20e748){var _0x44f836=typeof _0x4ada81[_0xdd42('0x1d')]==='undefined'&&typeof _0x4ada81[_0xdd42('0x1e')]==='undefined';var _0x2ad4e9=_0x20e748[_0xdd42('0x1f')];var _0x4d8cbe=_0x44f836?0x0:_0x4ada81[_0xdd42('0x1d')];var _0x429d1e=_0x44f836?_0x20e748[_0xdd42('0x1f')]:_0x4ada81[_0xdd42('0x1d')]+_0x4ada81[_0xdd42('0x1e')];var _0x41d346;if(_0x429d1e>=_0x2ad4e9){_0x429d1e=_0x2ad4e9;_0x41d346=0xc8;}else{_0x41d346=0xce;}_0x1eccbf[_0xdd42('0x1b')](_0x41d346);return _0x1eccbf['set'](_0xdd42('0x20'),_0x4d8cbe+'-'+_0x429d1e+'/'+_0x2ad4e9)[_0xdd42('0x21')](_0x20e748);}return null;};}function patchUpdates(_0x52df9a){return function(_0x22f966){try{jsonpatch['apply'](_0x22f966,_0x52df9a,!![]);}catch(_0x5b1a73){return BPromise[_0xdd42('0x22')](_0x5b1a73);}return _0x22f966[_0xdd42('0x23')]();};}function saveUpdates(_0x3445a7,_0x56d34b){return function(_0x4ab317){if(_0x4ab317){return _0x4ab317['update'](_0x3445a7)['then'](function(_0x2712dd){return _0x2712dd;});}return null;};}function removeEntity(_0x45d6a6,_0x4711ee){return function(_0x203a24){if(_0x203a24){return _0x203a24[_0xdd42('0x24')]()['then'](function(){_0x45d6a6[_0xdd42('0x1b')](0xcc)[_0xdd42('0x1c')]();});}};}function handleEntityNotFound(_0x9a0abe,_0x850cdf){return function(_0x5ad51e){if(!_0x5ad51e){_0x9a0abe[_0xdd42('0x1a')](0x194);}return _0x5ad51e;};}function handleError(_0x45a00e,_0x528d83){_0x528d83=_0x528d83||0x1f4;return function(_0x4e5192){logger[_0xdd42('0x25')](_0x4e5192[_0xdd42('0x26')]);if(_0x4e5192[_0xdd42('0x27')]){delete _0x4e5192[_0xdd42('0x27')];}_0x45a00e[_0xdd42('0x1b')](_0x528d83)[_0xdd42('0x28')](_0x4e5192);};}exports[_0xdd42('0x29')]=function(_0x5c6864,_0x297e35){var _0xf6d22f={},_0x253683={},_0x3724ae={'count':0x0,'rows':[]};var _0x713ea6=_['map'](db[_0xdd42('0x2a')][_0xdd42('0x2b')],function(_0x1028f9){return{'name':_0x1028f9['fieldName'],'type':_0x1028f9[_0xdd42('0x2c')][_0xdd42('0x2d')]};});_0x253683[_0xdd42('0x2e')]=_[_0xdd42('0x2f')](_0x713ea6,_0xdd42('0x27'));_0x253683[_0xdd42('0x30')]=_[_0xdd42('0x31')](_0x5c6864[_0xdd42('0x30')]);_0x253683[_0xdd42('0x32')]=_[_0xdd42('0x33')](_0x253683['model'],_0x253683[_0xdd42('0x30')]);_0xf6d22f[_0xdd42('0x34')]=_[_0xdd42('0x33')](_0x253683[_0xdd42('0x2e')],qs[_0xdd42('0x35')](_0x5c6864[_0xdd42('0x30')]['fields']));_0xf6d22f[_0xdd42('0x34')]=_0xf6d22f[_0xdd42('0x34')][_0xdd42('0x36')]?_0xf6d22f['attributes']:_0x253683['model'];if(!_0x5c6864[_0xdd42('0x30')][_0xdd42('0x37')]('nolimit')){_0xf6d22f[_0xdd42('0x1e')]=qs[_0xdd42('0x1e')](_0x5c6864[_0xdd42('0x30')][_0xdd42('0x1e')]);_0xf6d22f[_0xdd42('0x1d')]=qs[_0xdd42('0x1d')](_0x5c6864[_0xdd42('0x30')]['offset']);}_0xf6d22f[_0xdd42('0x38')]=qs['sort'](_0x5c6864['query'][_0xdd42('0x39')]);_0xf6d22f[_0xdd42('0x3a')]=qs[_0xdd42('0x32')](_[_0xdd42('0x3b')](_0x5c6864[_0xdd42('0x30')],_0x253683[_0xdd42('0x32')]),_0x713ea6);if(_0x5c6864[_0xdd42('0x30')]['filter']){_0xf6d22f[_0xdd42('0x3a')]=_['merge'](_0xf6d22f['where'],{'$or':_[_0xdd42('0x2f')](_0x713ea6,function(_0x4f4a5a){if(_0x4f4a5a[_0xdd42('0x2c')]!==_0xdd42('0x3c')){var _0x551b47={};_0x551b47[_0x4f4a5a['name']]={'$like':'%'+_0x5c6864['query'][_0xdd42('0x3d')]+'%'};return _0x551b47;}})});}_0xf6d22f=_[_0xdd42('0x3e')]({},_0xf6d22f,_0x5c6864['options']);var _0x5f476b={'where':_0xf6d22f[_0xdd42('0x3a')]};return db['ServicenowField'][_0xdd42('0x1f')](_0x5f476b)[_0xdd42('0x3f')](function(_0x40d09d){_0x3724ae[_0xdd42('0x1f')]=_0x40d09d;if(_0x5c6864['query'][_0xdd42('0x40')]){_0xf6d22f[_0xdd42('0x41')]=[{'all':!![]}];}return db[_0xdd42('0x2a')][_0xdd42('0x42')](_0xf6d22f);})[_0xdd42('0x3f')](function(_0x54c381){_0x3724ae[_0xdd42('0x43')]=_0x54c381;return _0x3724ae;})[_0xdd42('0x3f')](respondWithFilteredResult(_0x297e35,_0xf6d22f))[_0xdd42('0x44')](handleError(_0x297e35,null));};exports[_0xdd42('0x45')]=function(_0x3efda8,_0x4bae9d){var _0x1cf93e={'raw':!![],'where':{'id':_0x3efda8[_0xdd42('0x46')]['id']}},_0x40ad12={};_0x40ad12['model']=_[_0xdd42('0x31')](db[_0xdd42('0x2a')]['rawAttributes']);_0x40ad12['query']=_[_0xdd42('0x31')](_0x3efda8['query']);_0x40ad12[_0xdd42('0x32')]=_[_0xdd42('0x33')](_0x40ad12[_0xdd42('0x2e')],_0x40ad12[_0xdd42('0x30')]);_0x1cf93e[_0xdd42('0x34')]=_[_0xdd42('0x33')](_0x40ad12[_0xdd42('0x2e')],qs[_0xdd42('0x35')](_0x3efda8[_0xdd42('0x30')][_0xdd42('0x35')]));_0x1cf93e[_0xdd42('0x34')]=_0x1cf93e[_0xdd42('0x34')][_0xdd42('0x36')]?_0x1cf93e[_0xdd42('0x34')]:_0x40ad12[_0xdd42('0x2e')];if(_0x3efda8[_0xdd42('0x30')][_0xdd42('0x40')]){_0x1cf93e['include']=[{'all':!![]}];}_0x1cf93e=_[_0xdd42('0x3e')]({},_0x1cf93e,_0x3efda8['options']);return db[_0xdd42('0x2a')][_0xdd42('0x47')](_0x1cf93e)[_0xdd42('0x3f')](handleEntityNotFound(_0x4bae9d,null))[_0xdd42('0x3f')](respondWithResult(_0x4bae9d,null))[_0xdd42('0x44')](handleError(_0x4bae9d,null));};exports[_0xdd42('0x48')]=function(_0x5652a9,_0x396d13){return db[_0xdd42('0x2a')]['create'](_0x5652a9[_0xdd42('0x49')],{})[_0xdd42('0x3f')](respondWithResult(_0x396d13,0xc9))[_0xdd42('0x44')](handleError(_0x396d13,null));};exports['update']=function(_0x4aeb0f,_0x26ea08){if(_0x4aeb0f[_0xdd42('0x49')]['id']){delete _0x4aeb0f[_0xdd42('0x49')]['id'];}return db[_0xdd42('0x2a')][_0xdd42('0x47')]({'where':{'id':_0x4aeb0f[_0xdd42('0x46')]['id']}})[_0xdd42('0x3f')](handleEntityNotFound(_0x26ea08,null))[_0xdd42('0x3f')](saveUpdates(_0x4aeb0f['body'],null))[_0xdd42('0x3f')](respondWithResult(_0x26ea08,null))[_0xdd42('0x44')](handleError(_0x26ea08,null));};exports[_0xdd42('0x24')]=function(_0x2e804d,_0x4d751e){return db[_0xdd42('0x2a')][_0xdd42('0x47')]({'where':{'id':_0x2e804d['params']['id']}})['then'](handleEntityNotFound(_0x4d751e,null))[_0xdd42('0x3f')](removeEntity(_0x4d751e,null))[_0xdd42('0x44')](handleError(_0x4d751e,null));}; \ No newline at end of file +var _0x7500=['then','destroy','name','send','ServicenowField','fieldName','type','key','model','keys','query','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','where','pick','filter','merge','VIRTUAL','options','includeAll','include','catch','show','params','find','create','body','update','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','set','apply','reject','save'];(function(_0x2ec5a3,_0xd9ef07){var _0x1e48da=function(_0x14be70){while(--_0x14be70){_0x2ec5a3['push'](_0x2ec5a3['shift']());}};_0x1e48da(++_0xd9ef07);}(_0x7500,0x69));var _0x0750=function(_0x413feb,_0x10477f){_0x413feb=_0x413feb-0x0;var _0x40ee88=_0x7500[_0x413feb];return _0x40ee88;};'use strict';var emlformat=require(_0x0750('0x0'));var rimraf=require(_0x0750('0x1'));var zipdir=require(_0x0750('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x0750('0x3'));var moment=require(_0x0750('0x4'));var BPromise=require(_0x0750('0x5'));var Mustache=require(_0x0750('0x6'));var util=require(_0x0750('0x7'));var path=require(_0x0750('0x8'));var sox=require(_0x0750('0x9'));var csv=require(_0x0750('0xa'));var ejs=require(_0x0750('0xb'));var fs=require('fs');var fs_extra=require(_0x0750('0xc'));var _=require(_0x0750('0xd'));var squel=require(_0x0750('0xe'));var crypto=require('crypto');var jsforce=require(_0x0750('0xf'));var deskjs=require(_0x0750('0x10'));var toCsv=require(_0x0750('0xa'));var querystring=require(_0x0750('0x11'));var Papa=require(_0x0750('0x12'));var Redis=require(_0x0750('0x13'));var authService=require(_0x0750('0x14'));var qs=require(_0x0750('0x15'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0x0750('0x16'))(_0x0750('0x17'));var utils=require('../../config/utils');var config=require(_0x0750('0x18'));var licenseUtil=require(_0x0750('0x19'));var db=require(_0x0750('0x1a'))['db'];function respondWithStatusCode(_0x428e31,_0x19baf0){_0x19baf0=_0x19baf0||0xcc;return function(_0x5972f6){if(_0x5972f6){return _0x428e31[_0x0750('0x1b')](_0x19baf0);}return _0x428e31[_0x0750('0x1c')](_0x19baf0)[_0x0750('0x1d')]();};}function respondWithResult(_0xd31bc9,_0x367d63){_0x367d63=_0x367d63||0xc8;return function(_0x34c13f){if(_0x34c13f){return _0xd31bc9[_0x0750('0x1c')](_0x367d63)[_0x0750('0x1e')](_0x34c13f);}};}function respondWithFilteredResult(_0x5e5f29,_0x20423a){return function(_0x31c55a){if(_0x31c55a){var _0x10f1e2=typeof _0x20423a[_0x0750('0x1f')]===_0x0750('0x20')&&typeof _0x20423a[_0x0750('0x21')]===_0x0750('0x20');var _0xff95da=_0x31c55a[_0x0750('0x22')];var _0x3b9499=_0x10f1e2?0x0:_0x20423a[_0x0750('0x1f')];var _0x133eba=_0x10f1e2?_0x31c55a['count']:_0x20423a[_0x0750('0x1f')]+_0x20423a[_0x0750('0x21')];var _0x5261c5;if(_0x133eba>=_0xff95da){_0x133eba=_0xff95da;_0x5261c5=0xc8;}else{_0x5261c5=0xce;}_0x5e5f29[_0x0750('0x1c')](_0x5261c5);return _0x5e5f29[_0x0750('0x23')]('Content-Range',_0x3b9499+'-'+_0x133eba+'/'+_0xff95da)['json'](_0x31c55a);}return null;};}function patchUpdates(_0x31d316){return function(_0x141e26){try{jsonpatch[_0x0750('0x24')](_0x141e26,_0x31d316,!![]);}catch(_0x3b4557){return BPromise[_0x0750('0x25')](_0x3b4557);}return _0x141e26[_0x0750('0x26')]();};}function saveUpdates(_0x112358,_0x1ebcb9){return function(_0x10d3a0){if(_0x10d3a0){return _0x10d3a0['update'](_0x112358)[_0x0750('0x27')](function(_0x481bae){return _0x481bae;});}return null;};}function removeEntity(_0x26b0ca,_0x4b31f6){return function(_0x185b49){if(_0x185b49){return _0x185b49[_0x0750('0x28')]()[_0x0750('0x27')](function(){_0x26b0ca[_0x0750('0x1c')](0xcc)[_0x0750('0x1d')]();});}};}function handleEntityNotFound(_0x4b4522,_0x5440c3){return function(_0x55397f){if(!_0x55397f){_0x4b4522[_0x0750('0x1b')](0x194);}return _0x55397f;};}function handleError(_0x52a499,_0x2fc50b){_0x2fc50b=_0x2fc50b||0x1f4;return function(_0x210192){logger['error'](_0x210192['stack']);if(_0x210192[_0x0750('0x29')]){delete _0x210192[_0x0750('0x29')];}_0x52a499[_0x0750('0x1c')](_0x2fc50b)[_0x0750('0x2a')](_0x210192);};}exports['index']=function(_0x58d1b1,_0x56bcbd){var _0x3c6d64={},_0x5c64c1={},_0xf0abf8={'count':0x0,'rows':[]};var _0x536fa2=_['map'](db[_0x0750('0x2b')]['rawAttributes'],function(_0xebb9de){return{'name':_0xebb9de[_0x0750('0x2c')],'type':_0xebb9de[_0x0750('0x2d')][_0x0750('0x2e')]};});_0x5c64c1[_0x0750('0x2f')]=_['map'](_0x536fa2,_0x0750('0x29'));_0x5c64c1['query']=_[_0x0750('0x30')](_0x58d1b1[_0x0750('0x31')]);_0x5c64c1[_0x0750('0x32')]=_[_0x0750('0x33')](_0x5c64c1[_0x0750('0x2f')],_0x5c64c1['query']);_0x3c6d64['attributes']=_['intersection'](_0x5c64c1['model'],qs[_0x0750('0x34')](_0x58d1b1[_0x0750('0x31')][_0x0750('0x34')]));_0x3c6d64[_0x0750('0x35')]=_0x3c6d64[_0x0750('0x35')][_0x0750('0x36')]?_0x3c6d64[_0x0750('0x35')]:_0x5c64c1['model'];if(!_0x58d1b1['query'][_0x0750('0x37')](_0x0750('0x38'))){_0x3c6d64['limit']=qs[_0x0750('0x21')](_0x58d1b1['query'][_0x0750('0x21')]);_0x3c6d64[_0x0750('0x1f')]=qs[_0x0750('0x1f')](_0x58d1b1[_0x0750('0x31')][_0x0750('0x1f')]);}_0x3c6d64['order']=qs['sort'](_0x58d1b1[_0x0750('0x31')]['sort']);_0x3c6d64[_0x0750('0x39')]=qs[_0x0750('0x32')](_[_0x0750('0x3a')](_0x58d1b1['query'],_0x5c64c1[_0x0750('0x32')]),_0x536fa2);if(_0x58d1b1[_0x0750('0x31')][_0x0750('0x3b')]){_0x3c6d64[_0x0750('0x39')]=_[_0x0750('0x3c')](_0x3c6d64[_0x0750('0x39')],{'$or':_['map'](_0x536fa2,function(_0x559c91){if(_0x559c91[_0x0750('0x2d')]!==_0x0750('0x3d')){var _0x42912b={};_0x42912b[_0x559c91[_0x0750('0x29')]]={'$like':'%'+_0x58d1b1[_0x0750('0x31')][_0x0750('0x3b')]+'%'};return _0x42912b;}})});}_0x3c6d64=_[_0x0750('0x3c')]({},_0x3c6d64,_0x58d1b1[_0x0750('0x3e')]);var _0xed2591={'where':_0x3c6d64['where']};return db[_0x0750('0x2b')][_0x0750('0x22')](_0xed2591)[_0x0750('0x27')](function(_0x1ba8f0){_0xf0abf8[_0x0750('0x22')]=_0x1ba8f0;if(_0x58d1b1[_0x0750('0x31')][_0x0750('0x3f')]){_0x3c6d64[_0x0750('0x40')]=[{'all':!![]}];}return db[_0x0750('0x2b')]['findAll'](_0x3c6d64);})['then'](function(_0x2b1b8b){_0xf0abf8['rows']=_0x2b1b8b;return _0xf0abf8;})[_0x0750('0x27')](respondWithFilteredResult(_0x56bcbd,_0x3c6d64))[_0x0750('0x41')](handleError(_0x56bcbd,null));};exports[_0x0750('0x42')]=function(_0x446fec,_0x3b6b1b){var _0x3b731f={'raw':!![],'where':{'id':_0x446fec[_0x0750('0x43')]['id']}},_0xd1499={};_0xd1499[_0x0750('0x2f')]=_['keys'](db[_0x0750('0x2b')]['rawAttributes']);_0xd1499['query']=_[_0x0750('0x30')](_0x446fec[_0x0750('0x31')]);_0xd1499['filters']=_['intersection'](_0xd1499[_0x0750('0x2f')],_0xd1499['query']);_0x3b731f['attributes']=_['intersection'](_0xd1499[_0x0750('0x2f')],qs['fields'](_0x446fec['query'][_0x0750('0x34')]));_0x3b731f[_0x0750('0x35')]=_0x3b731f[_0x0750('0x35')][_0x0750('0x36')]?_0x3b731f['attributes']:_0xd1499[_0x0750('0x2f')];if(_0x446fec['query'][_0x0750('0x3f')]){_0x3b731f[_0x0750('0x40')]=[{'all':!![]}];}_0x3b731f=_[_0x0750('0x3c')]({},_0x3b731f,_0x446fec['options']);return db[_0x0750('0x2b')][_0x0750('0x44')](_0x3b731f)['then'](handleEntityNotFound(_0x3b6b1b,null))[_0x0750('0x27')](respondWithResult(_0x3b6b1b,null))[_0x0750('0x41')](handleError(_0x3b6b1b,null));};exports[_0x0750('0x45')]=function(_0x4df156,_0xfc0d94){return db[_0x0750('0x2b')][_0x0750('0x45')](_0x4df156[_0x0750('0x46')],{})[_0x0750('0x27')](respondWithResult(_0xfc0d94,0xc9))[_0x0750('0x41')](handleError(_0xfc0d94,null));};exports[_0x0750('0x47')]=function(_0x12f747,_0x1e8b1b){if(_0x12f747[_0x0750('0x46')]['id']){delete _0x12f747['body']['id'];}return db[_0x0750('0x2b')][_0x0750('0x44')]({'where':{'id':_0x12f747['params']['id']}})['then'](handleEntityNotFound(_0x1e8b1b,null))['then'](saveUpdates(_0x12f747[_0x0750('0x46')],null))[_0x0750('0x27')](respondWithResult(_0x1e8b1b,null))[_0x0750('0x41')](handleError(_0x1e8b1b,null));};exports[_0x0750('0x28')]=function(_0x12559d,_0x57d957){return db[_0x0750('0x2b')][_0x0750('0x44')]({'where':{'id':_0x12559d['params']['id']}})[_0x0750('0x27')](handleEntityNotFound(_0x57d957,null))[_0x0750('0x27')](removeEntity(_0x57d957,null))[_0x0750('0x41')](handleError(_0x57d957,null));}; \ No newline at end of file diff --git a/server/api/intServicenowField/intServicenowField.model.js b/server/api/intServicenowField/intServicenowField.model.js index 5248090..5512afd 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 _0xace8=['../../config/environment','./intServicenowField.attributes','define','ServicenowField','int_servicenow_fields','servicenow_unique_index','idField','FieldId','lodash','util','../../config/logger','api','moment','bluebird','request-promise','rimraf'];(function(_0x3e45a6,_0x576195){var _0x4751f7=function(_0x14d175){while(--_0x14d175){_0x3e45a6['push'](_0x3e45a6['shift']());}};_0x4751f7(++_0x576195);}(_0xace8,0x88));var _0x8ace=function(_0x27f157,_0x5055df){_0x27f157=_0x27f157-0x0;var _0x3d765=_0xace8[_0x27f157];return _0x3d765;};'use strict';var _=require(_0x8ace('0x0'));var util=require(_0x8ace('0x1'));var logger=require(_0x8ace('0x2'))(_0x8ace('0x3'));var moment=require(_0x8ace('0x4'));var BPromise=require(_0x8ace('0x5'));var rp=require(_0x8ace('0x6'));var fs=require('fs');var path=require('path');var rimraf=require(_0x8ace('0x7'));var config=require(_0x8ace('0x8'));var attributes=require(_0x8ace('0x9'));module['exports']=function(_0x56b566,_0x571c6c){return _0x56b566[_0x8ace('0xa')](_0x8ace('0xb'),attributes,{'tableName':_0x8ace('0xc'),'paranoid':![],'indexes':[{'name':_0x8ace('0xd'),'fields':[_0x8ace('0xe'),_0x8ace('0xf')],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file +var _0xfbdd=['path','rimraf','../../config/environment','./intServicenowField.attributes','define','int_servicenow_fields','servicenow_unique_index','FieldId','lodash','../../config/logger','api','moment'];(function(_0xe08054,_0x22c584){var _0x5c3e9d=function(_0x3e461a){while(--_0x3e461a){_0xe08054['push'](_0xe08054['shift']());}};_0x5c3e9d(++_0x22c584);}(_0xfbdd,0x17c));var _0xdfbd=function(_0x368972,_0x8ce1eb){_0x368972=_0x368972-0x0;var _0x1bf6e4=_0xfbdd[_0x368972];return _0x1bf6e4;};'use strict';var _=require(_0xdfbd('0x0'));var util=require('util');var logger=require(_0xdfbd('0x1'))(_0xdfbd('0x2'));var moment=require(_0xdfbd('0x3'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0xdfbd('0x4'));var rimraf=require(_0xdfbd('0x5'));var config=require(_0xdfbd('0x6'));var attributes=require(_0xdfbd('0x7'));module['exports']=function(_0x23fdb9,_0x3a9d64){return _0x23fdb9[_0xdfbd('0x8')]('ServicenowField',attributes,{'tableName':_0xdfbd('0x9'),'paranoid':![],'indexes':[{'name':_0xdfbd('0xa'),'fields':['idField',_0xdfbd('0xb')],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/intServicenowField/intServicenowField.rpc.js b/server/api/intServicenowField/intServicenowField.rpc.js index 0663f1e..23fb7b4 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 _0xa9e0=['http','info','ServicenowField,\x20%s,\x20%s','request\x20sent','debug','ServicenowField,\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(_0x16fa0c,_0x211a76){var _0x27e477=function(_0x530653){while(--_0x530653){_0x16fa0c['push'](_0x16fa0c['shift']());}};_0x27e477(++_0x211a76);}(_0xa9e0,0x123));var _0x0a9e=function(_0x47e7cb,_0x4c1b8d){_0x47e7cb=_0x47e7cb-0x0;var _0x2a8874=_0xa9e0[_0x47e7cb];return _0x2a8874;};'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 _0xb43b=['rpc','../../config/environment','http','request','info','request\x20sent','debug','ServicenowField,\x20%s,\x20%s,\x20%s','stringify','error','code','message','ServicenowField,\x20%s,\x20%s','catch','lodash','util','bluebird','randomstring','ioredis','../../config/utils','../../config/logger'];(function(_0x380e9a,_0x2c2463){var _0x568dc5=function(_0x318736){while(--_0x318736){_0x380e9a['push'](_0x380e9a['shift']());}};_0x568dc5(++_0x2c2463);}(_0xb43b,0x1b2));var _0xbb43=function(_0x3dd153,_0x40a894){_0x3dd153=_0x3dd153-0x0;var _0x4fe23c=_0xb43b[_0x3dd153];return _0x4fe23c;};'use strict';var _=require(_0xbb43('0x0'));var util=require(_0xbb43('0x1'));var moment=require('moment');var BPromise=require(_0xbb43('0x2'));var rs=require(_0xbb43('0x3'));var fs=require('fs');var Redis=require(_0xbb43('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0xbb43('0x5'));var logger=require(_0xbb43('0x6'))(_0xbb43('0x7'));var config=require(_0xbb43('0x8'));var jayson=require('jayson/promise');var client=jayson['client'][_0xbb43('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x553520,_0x80fe61,_0x1ccd49){return new BPromise(function(_0x2a2f11,_0x29ae1a){return client[_0xbb43('0xa')](_0x553520,_0x1ccd49)['then'](function(_0x208c2b){logger[_0xbb43('0xb')]('ServicenowField,\x20%s,\x20%s',_0x80fe61,_0xbb43('0xc'));logger[_0xbb43('0xd')](_0xbb43('0xe'),_0x80fe61,_0xbb43('0xc'),JSON[_0xbb43('0xf')](_0x208c2b));if(_0x208c2b[_0xbb43('0x10')]){if(_0x208c2b['error'][_0xbb43('0x11')]===0x1f4){logger[_0xbb43('0x10')]('ServicenowField,\x20%s,\x20%s',_0x80fe61,_0x208c2b['error'][_0xbb43('0x12')]);return _0x29ae1a(_0x208c2b['error']['message']);}logger[_0xbb43('0x10')]('ServicenowField,\x20%s,\x20%s',_0x80fe61,_0x208c2b[_0xbb43('0x10')][_0xbb43('0x12')]);return _0x2a2f11(_0x208c2b['error']['message']);}else{logger['info'](_0xbb43('0x13'),_0x80fe61,_0xbb43('0xc'));_0x2a2f11(_0x208c2b['result']['message']);}})[_0xbb43('0x14')](function(_0x563ce1){logger['error'](_0xbb43('0x13'),_0x80fe61,_0x563ce1);_0x29ae1a(_0x563ce1);});});} \ No newline at end of file diff --git a/server/api/intSugarcrmAccount/index.js b/server/api/intSugarcrmAccount/index.js index 0d6379a..dcfa3e0 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(_0x1bd162,_0x4e49c0){var _0x462838=function(_0x52d3e6){while(--_0x52d3e6){_0x1bd162['push'](_0x1bd162['shift']());}};_0x462838(++_0x4e49c0);}(_0x9957,0x93));var _0x7995=function(_0x3947c9,_0x4d6c97){_0x3947c9=_0x3947c9-0x0;var _0x2e7871=_0x9957[_0x3947c9];return _0x2e7871;};'use strict';var multer=require(_0x7995('0x0'));var util=require(_0x7995('0x1'));var path=require(_0x7995('0x2'));var timeout=require(_0x7995('0x3'));var express=require('express');var router=express[_0x7995('0x4')]();var fs_extra=require(_0x7995('0x5'));var auth=require(_0x7995('0x6'));var interaction=require(_0x7995('0x7'));var config=require('../../config/environment');var controller=require(_0x7995('0x8'));router[_0x7995('0x9')]('/',auth[_0x7995('0xa')](),controller[_0x7995('0xb')]);router[_0x7995('0x9')](_0x7995('0xc'),auth['isAuthenticated'](),controller[_0x7995('0xd')]);router[_0x7995('0x9')]('/:id/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(_0x237623,_0x3d11e6){var _0x3ba068=function(_0xdc0a4){while(--_0xdc0a4){_0x237623['push'](_0x237623['shift']());}};_0x3ba068(++_0x3d11e6);}(_0xa9e0,0x123));var _0x0a9e=function(_0x9aada2,_0xd2d349){_0x9aada2=_0x9aada2-0x0;var _0x196dff=_0xa9e0[_0x9aada2];return _0x196dff;};'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 f32630d..331e618 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(_0x100c69,_0x3ab91c){var _0x160855=function(_0x5d45e3){while(--_0x5d45e3){_0x100c69['push'](_0x100c69['shift']());}};_0x160855(++_0x3ab91c);}(_0xa9e0,0x123));var _0x0a9e=function(_0x3c2a69,_0x4c8b41){_0x3c2a69=_0x3c2a69-0x0;var _0x596bc8=_0xa9e0[_0x3c2a69];return _0x596bc8;};'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(_0x4c9d2a,_0x54d23d){var _0x394800=function(_0x45a0){while(--_0x45a0){_0x4c9d2a['push'](_0x4c9d2a['shift']());}};_0x394800(++_0x54d23d);}(_0xa9e0,0x123));var _0x0a9e=function(_0x311c35,_0x534915){_0x311c35=_0x311c35-0x0;var _0x5cc50c=_0xa9e0[_0x311c35];return _0x5cc50c;};'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 5aa6fa2..599b434 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 _0xe9bc=['format','/service/v4_1/rest.php','login','JSON','stringify','PLAIN','Invalid\x20Login','%s%s','Calls','module_fields','endsWith','values','test','statusCode','error','Wrong\x20credentials','eml-format','rimraf','zip-dir','fast-json-patch','bluebird','mustache','util','path','sox','to-csv','ejs','lodash','crypto','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../components/integrations/configuration','sendStatus','status','end','json','offset','undefined','limit','count','Content-Range','apply','save','update','then','destroy','stack','name','send','index','map','rawAttributes','fieldName','type','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','VIRTUAL','options','SugarcrmAccount','includeAll','include','findAll','params','merge','find','catch','body','getConfigurations','SugarcrmConfiguration','addConfiguration','findOne','AccountId','Subjects','getSubjects','Descriptions','channel','create','SugarcrmField','getFields','assigned_user_id','created_by','date_start','duration_hours','duration_minutes','parent_id','parent_type','parent_name','direction','username','password','remoteUri','lastIndexOf','POST'];(function(_0x378b4e,_0x1e99f7){var _0x127a34=function(_0x1535e6){while(--_0x1535e6){_0x378b4e['push'](_0x378b4e['shift']());}};_0x127a34(++_0x1e99f7);}(_0xe9bc,0x16f));var _0xce9b=function(_0x2b52a0,_0x12f1d7){_0x2b52a0=_0x2b52a0-0x0;var _0x4a47f3=_0xe9bc[_0x2b52a0];return _0x4a47f3;};'use strict';var emlformat=require(_0xce9b('0x0'));var rimraf=require(_0xce9b('0x1'));var zipdir=require(_0xce9b('0x2'));var jsonpatch=require(_0xce9b('0x3'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0xce9b('0x4'));var Mustache=require(_0xce9b('0x5'));var util=require(_0xce9b('0x6'));var path=require(_0xce9b('0x7'));var sox=require(_0xce9b('0x8'));var csv=require(_0xce9b('0x9'));var ejs=require(_0xce9b('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xce9b('0xb'));var squel=require('squel');var crypto=require(_0xce9b('0xc'));var jsforce=require(_0xce9b('0xd'));var deskjs=require(_0xce9b('0xe'));var toCsv=require('to-csv');var querystring=require(_0xce9b('0xf'));var Papa=require('papaparse');var Redis=require(_0xce9b('0x10'));var authService=require(_0xce9b('0x11'));var qs=require(_0xce9b('0x12'));var as=require(_0xce9b('0x13'));var hardwareService=require(_0xce9b('0x14'));var logger=require(_0xce9b('0x15'))(_0xce9b('0x16'));var utils=require(_0xce9b('0x17'));var config=require(_0xce9b('0x18'));var licenseUtil=require(_0xce9b('0x19'));var db=require('../../mysqldb')['db'];var integrations=require(_0xce9b('0x1a'));function respondWithStatusCode(_0x1062f1,_0x3c3feb){_0x3c3feb=_0x3c3feb||0xcc;return function(_0xa9efe4){if(_0xa9efe4){return _0x1062f1[_0xce9b('0x1b')](_0x3c3feb);}return _0x1062f1[_0xce9b('0x1c')](_0x3c3feb)[_0xce9b('0x1d')]();};}function respondWithResult(_0x5517e6,_0x44ece1){_0x44ece1=_0x44ece1||0xc8;return function(_0x4a1edb){if(_0x4a1edb){return _0x5517e6[_0xce9b('0x1c')](_0x44ece1)[_0xce9b('0x1e')](_0x4a1edb);}};}function respondWithFilteredResult(_0x3362ed,_0x122488){return function(_0x352e56){if(_0x352e56){var _0x118063=typeof _0x122488[_0xce9b('0x1f')]===_0xce9b('0x20')&&typeof _0x122488[_0xce9b('0x21')]==='undefined';var _0x3d28b7=_0x352e56[_0xce9b('0x22')];var _0x2948e9=_0x118063?0x0:_0x122488[_0xce9b('0x1f')];var _0x31fd2d=_0x118063?_0x352e56[_0xce9b('0x22')]:_0x122488[_0xce9b('0x1f')]+_0x122488['limit'];var _0x3b1397;if(_0x31fd2d>=_0x3d28b7){_0x31fd2d=_0x3d28b7;_0x3b1397=0xc8;}else{_0x3b1397=0xce;}_0x3362ed['status'](_0x3b1397);return _0x3362ed['set'](_0xce9b('0x23'),_0x2948e9+'-'+_0x31fd2d+'/'+_0x3d28b7)[_0xce9b('0x1e')](_0x352e56);}return null;};}function patchUpdates(_0x2a4a82){return function(_0x6ea784){try{jsonpatch[_0xce9b('0x24')](_0x6ea784,_0x2a4a82,!![]);}catch(_0x2cd824){return BPromise['reject'](_0x2cd824);}return _0x6ea784[_0xce9b('0x25')]();};}function saveUpdates(_0x46a3cb,_0x1020a5){return function(_0x1e3944){if(_0x1e3944){return _0x1e3944[_0xce9b('0x26')](_0x46a3cb)[_0xce9b('0x27')](function(_0x3da075){return _0x3da075;});}return null;};}function removeEntity(_0x40398e,_0xdacf4e){return function(_0x1b2235){if(_0x1b2235){return _0x1b2235[_0xce9b('0x28')]()[_0xce9b('0x27')](function(){_0x40398e[_0xce9b('0x1c')](0xcc)['end']();});}};}function handleEntityNotFound(_0x2a5fb3,_0x34e49f){return function(_0x1bd4cf){if(!_0x1bd4cf){_0x2a5fb3['sendStatus'](0x194);}return _0x1bd4cf;};}function handleError(_0x330de6,_0x565781){_0x565781=_0x565781||0x1f4;return function(_0x50e71d){logger['error'](_0x50e71d[_0xce9b('0x29')]);if(_0x50e71d[_0xce9b('0x2a')]){delete _0x50e71d[_0xce9b('0x2a')];}_0x330de6[_0xce9b('0x1c')](_0x565781)[_0xce9b('0x2b')](_0x50e71d);};}exports[_0xce9b('0x2c')]=function(_0x59f7b8,_0x40df37){var _0x1e03d3={},_0x231835={},_0x21bb2b={'count':0x0,'rows':[]};var _0x2b0adc=_[_0xce9b('0x2d')](db['SugarcrmAccount'][_0xce9b('0x2e')],function(_0x196c8f){return{'name':_0x196c8f[_0xce9b('0x2f')],'type':_0x196c8f[_0xce9b('0x30')]['key']};});_0x231835[_0xce9b('0x31')]=_[_0xce9b('0x2d')](_0x2b0adc,'name');_0x231835[_0xce9b('0x32')]=_[_0xce9b('0x33')](_0x59f7b8[_0xce9b('0x32')]);_0x231835[_0xce9b('0x34')]=_[_0xce9b('0x35')](_0x231835[_0xce9b('0x31')],_0x231835[_0xce9b('0x32')]);_0x1e03d3[_0xce9b('0x36')]=_[_0xce9b('0x35')](_0x231835[_0xce9b('0x31')],qs[_0xce9b('0x37')](_0x59f7b8[_0xce9b('0x32')][_0xce9b('0x37')]));_0x1e03d3[_0xce9b('0x36')]=_0x1e03d3[_0xce9b('0x36')][_0xce9b('0x38')]?_0x1e03d3['attributes']:_0x231835[_0xce9b('0x31')];if(!_0x59f7b8[_0xce9b('0x32')][_0xce9b('0x39')](_0xce9b('0x3a'))){_0x1e03d3[_0xce9b('0x21')]=qs['limit'](_0x59f7b8[_0xce9b('0x32')][_0xce9b('0x21')]);_0x1e03d3[_0xce9b('0x1f')]=qs[_0xce9b('0x1f')](_0x59f7b8[_0xce9b('0x32')][_0xce9b('0x1f')]);}_0x1e03d3[_0xce9b('0x3b')]=qs[_0xce9b('0x3c')](_0x59f7b8[_0xce9b('0x32')][_0xce9b('0x3c')]);_0x1e03d3[_0xce9b('0x3d')]=qs['filters'](_[_0xce9b('0x3e')](_0x59f7b8[_0xce9b('0x32')],_0x231835[_0xce9b('0x34')]),_0x2b0adc);if(_0x59f7b8[_0xce9b('0x32')][_0xce9b('0x3f')]){_0x1e03d3[_0xce9b('0x3d')]=_['merge'](_0x1e03d3[_0xce9b('0x3d')],{'$or':_[_0xce9b('0x2d')](_0x2b0adc,function(_0xcd12f0){if(_0xcd12f0['type']!==_0xce9b('0x40')){var _0x4ee1d3={};_0x4ee1d3[_0xcd12f0[_0xce9b('0x2a')]]={'$like':'%'+_0x59f7b8['query']['filter']+'%'};return _0x4ee1d3;}})});}_0x1e03d3=_['merge']({},_0x1e03d3,_0x59f7b8[_0xce9b('0x41')]);var _0x4a64c2={'where':_0x1e03d3[_0xce9b('0x3d')]};return db[_0xce9b('0x42')][_0xce9b('0x22')](_0x4a64c2)[_0xce9b('0x27')](function(_0x470aab){_0x21bb2b['count']=_0x470aab;if(_0x59f7b8[_0xce9b('0x32')][_0xce9b('0x43')]){_0x1e03d3[_0xce9b('0x44')]=[{'all':!![]}];}return db['SugarcrmAccount'][_0xce9b('0x45')](_0x1e03d3);})[_0xce9b('0x27')](function(_0x471c8f){_0x21bb2b['rows']=_0x471c8f;return _0x21bb2b;})['then'](respondWithFilteredResult(_0x40df37,_0x1e03d3))['catch'](handleError(_0x40df37,null));};exports['show']=function(_0x48760e,_0xe79137){var _0x4628fd={'raw':![],'where':{'id':_0x48760e[_0xce9b('0x46')]['id']}},_0x4d3255={};_0x4d3255[_0xce9b('0x31')]=_[_0xce9b('0x33')](db['SugarcrmAccount'][_0xce9b('0x2e')]);_0x4d3255[_0xce9b('0x32')]=_['keys'](_0x48760e[_0xce9b('0x32')]);_0x4d3255['filters']=_[_0xce9b('0x35')](_0x4d3255['model'],_0x4d3255[_0xce9b('0x32')]);_0x4628fd[_0xce9b('0x36')]=_[_0xce9b('0x35')](_0x4d3255['model'],qs['fields'](_0x48760e[_0xce9b('0x32')][_0xce9b('0x37')]));_0x4628fd[_0xce9b('0x36')]=_0x4628fd[_0xce9b('0x36')][_0xce9b('0x38')]?_0x4628fd[_0xce9b('0x36')]:_0x4d3255[_0xce9b('0x31')];if(_0x48760e['query'][_0xce9b('0x43')]){_0x4628fd[_0xce9b('0x44')]=[{'all':!![]}];}_0x4628fd=_[_0xce9b('0x47')]({},_0x4628fd,_0x48760e[_0xce9b('0x41')]);return db[_0xce9b('0x42')][_0xce9b('0x48')](_0x4628fd)[_0xce9b('0x27')](handleEntityNotFound(_0xe79137,null))[_0xce9b('0x27')](respondWithResult(_0xe79137,null))[_0xce9b('0x49')](handleError(_0xe79137,null));};exports['create']=function(_0x11d4f1,_0x58f96c){return db[_0xce9b('0x42')]['create'](_0x11d4f1[_0xce9b('0x4a')],{})['then'](respondWithResult(_0x58f96c,0xc9))[_0xce9b('0x49')](handleError(_0x58f96c,null));};exports[_0xce9b('0x26')]=function(_0x364bef,_0x468a3e){if(_0x364bef[_0xce9b('0x4a')]['id']){delete _0x364bef[_0xce9b('0x4a')]['id'];}return db['SugarcrmAccount'][_0xce9b('0x48')]({'where':{'id':_0x364bef[_0xce9b('0x46')]['id']}})['then'](handleEntityNotFound(_0x468a3e,null))[_0xce9b('0x27')](saveUpdates(_0x364bef[_0xce9b('0x4a')],null))[_0xce9b('0x27')](respondWithResult(_0x468a3e,null))[_0xce9b('0x49')](handleError(_0x468a3e,null));};exports[_0xce9b('0x28')]=function(_0x707bc3,_0x152c0c){return db[_0xce9b('0x42')]['find']({'where':{'id':_0x707bc3[_0xce9b('0x46')]['id']}})[_0xce9b('0x27')](handleEntityNotFound(_0x152c0c,null))['then'](removeEntity(_0x152c0c,null))[_0xce9b('0x49')](handleError(_0x152c0c,null));};exports[_0xce9b('0x4b')]=function(_0x2a618d,_0x269e81,_0x4aa8d3){var _0x17fa96={};var _0x412e96={};var _0x5de604;var _0x5dd9d1;return db[_0xce9b('0x42')]['findOne']({'where':{'id':_0x2a618d[_0xce9b('0x46')]['id']}})[_0xce9b('0x27')](handleEntityNotFound(_0x269e81,null))[_0xce9b('0x27')](function(_0x4cf471){if(_0x4cf471){_0x5de604=_0x4cf471;_0x412e96[_0xce9b('0x31')]=_[_0xce9b('0x33')](db[_0xce9b('0x4c')]['rawAttributes']);_0x412e96[_0xce9b('0x32')]=_[_0xce9b('0x33')](_0x2a618d['query']);_0x412e96[_0xce9b('0x34')]=_[_0xce9b('0x35')](_0x412e96[_0xce9b('0x31')],_0x412e96['query']);_0x17fa96['attributes']=_[_0xce9b('0x35')](_0x412e96[_0xce9b('0x31')],qs[_0xce9b('0x37')](_0x2a618d[_0xce9b('0x32')]['fields']));_0x17fa96[_0xce9b('0x36')]=_0x17fa96['attributes']['length']?_0x17fa96[_0xce9b('0x36')]:_0x412e96[_0xce9b('0x31')];_0x17fa96[_0xce9b('0x3b')]=qs[_0xce9b('0x3c')](_0x2a618d[_0xce9b('0x32')][_0xce9b('0x3c')]);_0x17fa96[_0xce9b('0x3d')]=qs['filters'](_[_0xce9b('0x3e')](_0x2a618d[_0xce9b('0x32')],_0x412e96[_0xce9b('0x34')]));if(_0x2a618d['query'][_0xce9b('0x3f')]){_0x17fa96[_0xce9b('0x3d')]=_[_0xce9b('0x47')](_0x17fa96[_0xce9b('0x3d')],{'$or':_[_0xce9b('0x2d')](_0x17fa96['attributes'],function(_0x516d62){var _0x41bf10={};_0x41bf10[_0x516d62]={'$like':'%'+_0x2a618d[_0xce9b('0x32')]['filter']+'%'};return _0x41bf10;})});}_0x17fa96=_['merge']({},_0x17fa96,_0x2a618d[_0xce9b('0x41')]);return _0x5de604['getConfigurations'](_0x17fa96);}})[_0xce9b('0x27')](function(_0xb9f19a){if(_0xb9f19a){_0x5dd9d1=_0xb9f19a[_0xce9b('0x38')];if(!_0x2a618d[_0xce9b('0x32')][_0xce9b('0x39')](_0xce9b('0x3a'))){_0x17fa96['limit']=qs[_0xce9b('0x21')](_0x2a618d[_0xce9b('0x32')][_0xce9b('0x21')]);_0x17fa96['offset']=qs[_0xce9b('0x1f')](_0x2a618d[_0xce9b('0x32')][_0xce9b('0x1f')]);}return _0x5de604[_0xce9b('0x4b')](_0x17fa96);}})[_0xce9b('0x27')](function(_0x3b220d){if(_0x3b220d){return _0x3b220d?{'count':_0x5dd9d1,'rows':_0x3b220d}:null;}})['then'](respondWithResult(_0x269e81,null))['catch'](handleError(_0x269e81,null));};exports[_0xce9b('0x4d')]=function(_0x5a70fa,_0x491e41,_0x2f2deb){if(_0x5a70fa[_0xce9b('0x4a')]['id']){delete _0x5a70fa[_0xce9b('0x4a')]['id'];}return db[_0xce9b('0x42')][_0xce9b('0x4e')]({'where':{'id':_0x5a70fa[_0xce9b('0x46')]['id']}})[_0xce9b('0x27')](handleEntityNotFound(_0x491e41,null))[_0xce9b('0x27')](function(_0x28c8ac){if(_0x28c8ac){_0x5a70fa[_0xce9b('0x4a')][_0xce9b('0x4f')]=_0x28c8ac['id'];_0x5a70fa[_0xce9b('0x4a')][_0xce9b('0x50')]=integrations[_0xce9b('0x51')](_0x5a70fa[_0xce9b('0x4a')]['channel'],_0x5a70fa[_0xce9b('0x4a')]['type']);_0x5a70fa['body'][_0xce9b('0x52')]=integrations['getDescriptions'](_0x5a70fa['body'][_0xce9b('0x53')],_0x5a70fa['body']['type']);return db['SugarcrmConfiguration'][_0xce9b('0x54')](_0x5a70fa[_0xce9b('0x4a')],{'include':[{'model':db['SugarcrmField'],'as':_0xce9b('0x50')},{'model':db[_0xce9b('0x55')],'as':_0xce9b('0x52')}]});}return null;})['then'](respondWithResult(_0x491e41,null))['catch'](handleError(_0x491e41,null));};exports[_0xce9b('0x56')]=function(_0x37e104,_0x34cb7d,_0x3456aa){var _0x3182f5='';var _0x27e122=['id',_0xce9b('0x2a'),_0xce9b('0x57'),_0xce9b('0x58'),'description',_0xce9b('0x59'),_0xce9b('0x5a'),_0xce9b('0x5b'),_0xce9b('0x5c'),_0xce9b('0x5d'),_0xce9b('0x5e'),_0xce9b('0x5f')];return db[_0xce9b('0x42')][_0xce9b('0x4e')]({'where':{'id':_0x37e104[_0xce9b('0x46')]['id']},'attributes':['id',_0xce9b('0x60'),_0xce9b('0x61'),_0xce9b('0x62')]})['then'](handleEntityNotFound(_0x34cb7d,null))['then'](function(_0x4d68ae){if(_0x4d68ae){_0x3182f5=_0x4d68ae['remoteUri'];var _0x5bbd3c=_0x3182f5['slice'](-0x1);if(_0x5bbd3c==='/'){_0x3182f5=_0x3182f5['substring'](0x0,_0x3182f5[_0xce9b('0x63')](_0x5bbd3c));}return rp({'method':_0xce9b('0x64'),'uri':util[_0xce9b('0x65')]('%s%s',_0x3182f5,_0xce9b('0x66')),'json':!![],'form':{'method':_0xce9b('0x67'),'input_type':'JSON','response_type':_0xce9b('0x68'),'rest_data':JSON[_0xce9b('0x69')]({'user_auth':{'user_name':_0x4d68ae[_0xce9b('0x60')],'password':_0x4d68ae[_0xce9b('0x61')],'encryption':_0xce9b('0x6a')},'application':'xCALLY\x20Motion\x20Integration'})}});}})['then'](function(_0x4feb16){if(_0x4feb16&&_0x4feb16[_0xce9b('0x2a')]!==_0xce9b('0x6b')&&_0x4feb16[_0xce9b('0x2a')]!=='Password\x20Expired'){return rp({'method':_0xce9b('0x64'),'uri':util['format'](_0xce9b('0x6c'),_0x3182f5,_0xce9b('0x66')),'json':!![],'form':{'method':'get_module_fields','input_type':_0xce9b('0x68'),'response_type':_0xce9b('0x68'),'rest_data':JSON[_0xce9b('0x69')]({'session':_0x4feb16['id'],'module_name':_0xce9b('0x6d')})}})[_0xce9b('0x27')](function(_0x25a19c){if(_0x25a19c){var _0x5d2864=_['values'](_0x25a19c[_0xce9b('0x6e')]);_['remove'](_0x5d2864,function(_0x5759b3){return _0x27e122['includes'](_0x5759b3['name']);});return{'count':_0x5d2864[_0xce9b('0x38')],'rows':_[_0xce9b('0x2d')](_0x5d2864,function(_0x1c2f67){return{'id':_0x1c2f67[_0xce9b('0x2a')],'name':_0x1c2f67['label'],'custom':_[_0xce9b('0x6f')](_0x1c2f67[_0xce9b('0x2a')],'_c')?!![]:![],'options':_0x1c2f67[_0xce9b('0x41')]?_['map'](_[_0xce9b('0x70')](_0x1c2f67[_0xce9b('0x41')]),function(_0x1bb317){return{'name':_0x1bb317['value'],'value':_0x1bb317[_0xce9b('0x2a')]};}):[]};})};}})[_0xce9b('0x27')](respondWithResult(_0x34cb7d,null))['catch'](function(_0x2600d6){var _0x114f9e=_0x37e104['query'][_0xce9b('0x71')]?0x1f4:_0x2600d6[_0xce9b('0x72')]||0x1f4;logger[_0xce9b('0x73')]('getFields,\x20%s,\x20%s,\x20%s','getFields',_0x114f9e,JSON[_0xce9b('0x69')](_0x2600d6));delete _0x2600d6[_0xce9b('0x2a')];if(_0x114f9e===0x191){_0x114f9e=0x190;}_0x34cb7d[_0xce9b('0x1c')](_0x114f9e)['send'](_0x37e104[_0xce9b('0x32')][_0xce9b('0x71')]?{'message':_0xce9b('0x74'),'statusCode':_0x2600d6['statusCode']}:_0x2600d6);});}else{var _0x551e7a=0x1f4;_0x34cb7d['status'](_0x551e7a)[_0xce9b('0x2b')]({'message':'Wrong\x20credentials','statusCode':0x190});}});}; \ No newline at end of file +var _0x4781=['sox','fs-extra','lodash','squel','crypto','jsforce','desk.js','to-csv','querystring','papaparse','../../components/auth/service','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','../../components/integrations/configuration','status','end','json','offset','undefined','limit','count','Content-Range','apply','reject','save','destroy','then','error','stack','name','send','index','SugarcrmAccount','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','map','VIRTUAL','filter','merge','options','includeAll','include','findAll','show','find','catch','create','update','body','params','SugarcrmConfiguration','getConfigurations','addConfiguration','findOne','AccountId','Subjects','getSubjects','Descriptions','getDescriptions','channel','SugarcrmField','assigned_user_id','created_by','description','date_start','duration_hours','duration_minutes','parent_type','direction','password','remoteUri','slice','substring','lastIndexOf','format','login','JSON','stringify','username','PLAIN','xCALLY\x20Motion\x20Integration','Password\x20Expired','%s%s','/service/v4_1/rest.php','get_module_fields','Calls','values','module_fields','remove','includes','label','endsWith','value','test','statusCode','getFields,\x20%s,\x20%s,\x20%s','getFields','Wrong\x20credentials','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','path'];(function(_0x413727,_0x17adb1){var _0x5f46d7=function(_0xbb668e){while(--_0xbb668e){_0x413727['push'](_0x413727['shift']());}};_0x5f46d7(++_0x17adb1);}(_0x4781,0xf5));var _0x1478=function(_0x533965,_0x132bd6){_0x533965=_0x533965-0x0;var _0x5e6b9d=_0x4781[_0x533965];return _0x5e6b9d;};'use strict';var emlformat=require(_0x1478('0x0'));var rimraf=require(_0x1478('0x1'));var zipdir=require(_0x1478('0x2'));var jsonpatch=require(_0x1478('0x3'));var rp=require(_0x1478('0x4'));var moment=require(_0x1478('0x5'));var BPromise=require(_0x1478('0x6'));var Mustache=require(_0x1478('0x7'));var util=require('util');var path=require(_0x1478('0x8'));var sox=require(_0x1478('0x9'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x1478('0xa'));var _=require(_0x1478('0xb'));var squel=require(_0x1478('0xc'));var crypto=require(_0x1478('0xd'));var jsforce=require(_0x1478('0xe'));var deskjs=require(_0x1478('0xf'));var toCsv=require(_0x1478('0x10'));var querystring=require(_0x1478('0x11'));var Papa=require(_0x1478('0x12'));var Redis=require('ioredis');var authService=require(_0x1478('0x13'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x1478('0x14'));var logger=require(_0x1478('0x15'))('api');var utils=require(_0x1478('0x16'));var config=require(_0x1478('0x17'));var licenseUtil=require(_0x1478('0x18'));var db=require(_0x1478('0x19'))['db'];var integrations=require(_0x1478('0x1a'));function respondWithStatusCode(_0x45fd35,_0x5ae8e5){_0x5ae8e5=_0x5ae8e5||0xcc;return function(_0x2deda8){if(_0x2deda8){return _0x45fd35['sendStatus'](_0x5ae8e5);}return _0x45fd35[_0x1478('0x1b')](_0x5ae8e5)[_0x1478('0x1c')]();};}function respondWithResult(_0x123635,_0x4da030){_0x4da030=_0x4da030||0xc8;return function(_0x2e61fa){if(_0x2e61fa){return _0x123635[_0x1478('0x1b')](_0x4da030)[_0x1478('0x1d')](_0x2e61fa);}};}function respondWithFilteredResult(_0x1b73b5,_0x4df80a){return function(_0x37b2d4){if(_0x37b2d4){var _0x2f1e7f=typeof _0x4df80a[_0x1478('0x1e')]===_0x1478('0x1f')&&typeof _0x4df80a[_0x1478('0x20')]===_0x1478('0x1f');var _0x5c6b2a=_0x37b2d4['count'];var _0xf66a8f=_0x2f1e7f?0x0:_0x4df80a[_0x1478('0x1e')];var _0x458507=_0x2f1e7f?_0x37b2d4[_0x1478('0x21')]:_0x4df80a[_0x1478('0x1e')]+_0x4df80a[_0x1478('0x20')];var _0x555388;if(_0x458507>=_0x5c6b2a){_0x458507=_0x5c6b2a;_0x555388=0xc8;}else{_0x555388=0xce;}_0x1b73b5[_0x1478('0x1b')](_0x555388);return _0x1b73b5['set'](_0x1478('0x22'),_0xf66a8f+'-'+_0x458507+'/'+_0x5c6b2a)['json'](_0x37b2d4);}return null;};}function patchUpdates(_0x2ce754){return function(_0x5432b8){try{jsonpatch[_0x1478('0x23')](_0x5432b8,_0x2ce754,!![]);}catch(_0x4fbf54){return BPromise[_0x1478('0x24')](_0x4fbf54);}return _0x5432b8[_0x1478('0x25')]();};}function saveUpdates(_0x42fc93,_0x318ff1){return function(_0x489d62){if(_0x489d62){return _0x489d62['update'](_0x42fc93)['then'](function(_0xc8148c){return _0xc8148c;});}return null;};}function removeEntity(_0xc9f9d,_0x2de312){return function(_0x11921e){if(_0x11921e){return _0x11921e[_0x1478('0x26')]()[_0x1478('0x27')](function(){_0xc9f9d[_0x1478('0x1b')](0xcc)[_0x1478('0x1c')]();});}};}function handleEntityNotFound(_0x2a6b45,_0x50f9ff){return function(_0x347bf6){if(!_0x347bf6){_0x2a6b45['sendStatus'](0x194);}return _0x347bf6;};}function handleError(_0x2d7971,_0x38391a){_0x38391a=_0x38391a||0x1f4;return function(_0x4c6282){logger[_0x1478('0x28')](_0x4c6282[_0x1478('0x29')]);if(_0x4c6282[_0x1478('0x2a')]){delete _0x4c6282['name'];}_0x2d7971[_0x1478('0x1b')](_0x38391a)[_0x1478('0x2b')](_0x4c6282);};}exports[_0x1478('0x2c')]=function(_0x2b9135,_0x612406){var _0x29cee9={},_0x104fe0={},_0x2a0c35={'count':0x0,'rows':[]};var _0x3c2448=_['map'](db[_0x1478('0x2d')][_0x1478('0x2e')],function(_0x4df48a){return{'name':_0x4df48a[_0x1478('0x2f')],'type':_0x4df48a[_0x1478('0x30')][_0x1478('0x31')]};});_0x104fe0[_0x1478('0x32')]=_['map'](_0x3c2448,'name');_0x104fe0[_0x1478('0x33')]=_[_0x1478('0x34')](_0x2b9135['query']);_0x104fe0[_0x1478('0x35')]=_[_0x1478('0x36')](_0x104fe0[_0x1478('0x32')],_0x104fe0[_0x1478('0x33')]);_0x29cee9[_0x1478('0x37')]=_[_0x1478('0x36')](_0x104fe0[_0x1478('0x32')],qs[_0x1478('0x38')](_0x2b9135[_0x1478('0x33')][_0x1478('0x38')]));_0x29cee9['attributes']=_0x29cee9[_0x1478('0x37')][_0x1478('0x39')]?_0x29cee9[_0x1478('0x37')]:_0x104fe0['model'];if(!_0x2b9135[_0x1478('0x33')][_0x1478('0x3a')](_0x1478('0x3b'))){_0x29cee9['limit']=qs[_0x1478('0x20')](_0x2b9135[_0x1478('0x33')][_0x1478('0x20')]);_0x29cee9[_0x1478('0x1e')]=qs[_0x1478('0x1e')](_0x2b9135['query']['offset']);}_0x29cee9[_0x1478('0x3c')]=qs[_0x1478('0x3d')](_0x2b9135[_0x1478('0x33')][_0x1478('0x3d')]);_0x29cee9[_0x1478('0x3e')]=qs[_0x1478('0x35')](_[_0x1478('0x3f')](_0x2b9135[_0x1478('0x33')],_0x104fe0[_0x1478('0x35')]),_0x3c2448);if(_0x2b9135[_0x1478('0x33')]['filter']){_0x29cee9[_0x1478('0x3e')]=_['merge'](_0x29cee9[_0x1478('0x3e')],{'$or':_[_0x1478('0x40')](_0x3c2448,function(_0x3b0547){if(_0x3b0547[_0x1478('0x30')]!==_0x1478('0x41')){var _0x489ff6={};_0x489ff6[_0x3b0547[_0x1478('0x2a')]]={'$like':'%'+_0x2b9135[_0x1478('0x33')][_0x1478('0x42')]+'%'};return _0x489ff6;}})});}_0x29cee9=_[_0x1478('0x43')]({},_0x29cee9,_0x2b9135[_0x1478('0x44')]);var _0x5ad6c3={'where':_0x29cee9[_0x1478('0x3e')]};return db['SugarcrmAccount'][_0x1478('0x21')](_0x5ad6c3)[_0x1478('0x27')](function(_0x1e4324){_0x2a0c35[_0x1478('0x21')]=_0x1e4324;if(_0x2b9135[_0x1478('0x33')][_0x1478('0x45')]){_0x29cee9[_0x1478('0x46')]=[{'all':!![]}];}return db[_0x1478('0x2d')][_0x1478('0x47')](_0x29cee9);})[_0x1478('0x27')](function(_0xcaa1c3){_0x2a0c35['rows']=_0xcaa1c3;return _0x2a0c35;})[_0x1478('0x27')](respondWithFilteredResult(_0x612406,_0x29cee9))['catch'](handleError(_0x612406,null));};exports[_0x1478('0x48')]=function(_0x52af6e,_0x26b381){var _0x319b0c={'raw':![],'where':{'id':_0x52af6e['params']['id']}},_0x2edef7={};_0x2edef7[_0x1478('0x32')]=_['keys'](db[_0x1478('0x2d')][_0x1478('0x2e')]);_0x2edef7[_0x1478('0x33')]=_[_0x1478('0x34')](_0x52af6e[_0x1478('0x33')]);_0x2edef7[_0x1478('0x35')]=_['intersection'](_0x2edef7[_0x1478('0x32')],_0x2edef7[_0x1478('0x33')]);_0x319b0c[_0x1478('0x37')]=_[_0x1478('0x36')](_0x2edef7[_0x1478('0x32')],qs['fields'](_0x52af6e['query']['fields']));_0x319b0c['attributes']=_0x319b0c[_0x1478('0x37')][_0x1478('0x39')]?_0x319b0c[_0x1478('0x37')]:_0x2edef7[_0x1478('0x32')];if(_0x52af6e[_0x1478('0x33')][_0x1478('0x45')]){_0x319b0c[_0x1478('0x46')]=[{'all':!![]}];}_0x319b0c=_[_0x1478('0x43')]({},_0x319b0c,_0x52af6e['options']);return db[_0x1478('0x2d')][_0x1478('0x49')](_0x319b0c)[_0x1478('0x27')](handleEntityNotFound(_0x26b381,null))[_0x1478('0x27')](respondWithResult(_0x26b381,null))[_0x1478('0x4a')](handleError(_0x26b381,null));};exports[_0x1478('0x4b')]=function(_0x3c3442,_0x316f84){return db[_0x1478('0x2d')][_0x1478('0x4b')](_0x3c3442['body'],{})[_0x1478('0x27')](respondWithResult(_0x316f84,0xc9))[_0x1478('0x4a')](handleError(_0x316f84,null));};exports[_0x1478('0x4c')]=function(_0xfde44a,_0xed564c){if(_0xfde44a['body']['id']){delete _0xfde44a[_0x1478('0x4d')]['id'];}return db[_0x1478('0x2d')][_0x1478('0x49')]({'where':{'id':_0xfde44a[_0x1478('0x4e')]['id']}})['then'](handleEntityNotFound(_0xed564c,null))[_0x1478('0x27')](saveUpdates(_0xfde44a[_0x1478('0x4d')],null))[_0x1478('0x27')](respondWithResult(_0xed564c,null))[_0x1478('0x4a')](handleError(_0xed564c,null));};exports['destroy']=function(_0xffb766,_0x274cd9){return db[_0x1478('0x2d')][_0x1478('0x49')]({'where':{'id':_0xffb766[_0x1478('0x4e')]['id']}})[_0x1478('0x27')](handleEntityNotFound(_0x274cd9,null))[_0x1478('0x27')](removeEntity(_0x274cd9,null))[_0x1478('0x4a')](handleError(_0x274cd9,null));};exports['getConfigurations']=function(_0x4015ff,_0x45b680,_0x3cef67){var _0xc24d4a={};var _0xe76991={};var _0x5b6c3a;var _0x1825cd;return db['SugarcrmAccount']['findOne']({'where':{'id':_0x4015ff[_0x1478('0x4e')]['id']}})[_0x1478('0x27')](handleEntityNotFound(_0x45b680,null))['then'](function(_0x517992){if(_0x517992){_0x5b6c3a=_0x517992;_0xe76991['model']=_[_0x1478('0x34')](db[_0x1478('0x4f')][_0x1478('0x2e')]);_0xe76991[_0x1478('0x33')]=_['keys'](_0x4015ff[_0x1478('0x33')]);_0xe76991[_0x1478('0x35')]=_[_0x1478('0x36')](_0xe76991[_0x1478('0x32')],_0xe76991[_0x1478('0x33')]);_0xc24d4a[_0x1478('0x37')]=_[_0x1478('0x36')](_0xe76991[_0x1478('0x32')],qs[_0x1478('0x38')](_0x4015ff[_0x1478('0x33')]['fields']));_0xc24d4a[_0x1478('0x37')]=_0xc24d4a[_0x1478('0x37')]['length']?_0xc24d4a[_0x1478('0x37')]:_0xe76991['model'];_0xc24d4a['order']=qs[_0x1478('0x3d')](_0x4015ff[_0x1478('0x33')]['sort']);_0xc24d4a[_0x1478('0x3e')]=qs[_0x1478('0x35')](_[_0x1478('0x3f')](_0x4015ff[_0x1478('0x33')],_0xe76991[_0x1478('0x35')]));if(_0x4015ff[_0x1478('0x33')]['filter']){_0xc24d4a[_0x1478('0x3e')]=_['merge'](_0xc24d4a[_0x1478('0x3e')],{'$or':_['map'](_0xc24d4a[_0x1478('0x37')],function(_0x59f317){var _0x5f3a6b={};_0x5f3a6b[_0x59f317]={'$like':'%'+_0x4015ff[_0x1478('0x33')][_0x1478('0x42')]+'%'};return _0x5f3a6b;})});}_0xc24d4a=_[_0x1478('0x43')]({},_0xc24d4a,_0x4015ff[_0x1478('0x44')]);return _0x5b6c3a[_0x1478('0x50')](_0xc24d4a);}})[_0x1478('0x27')](function(_0xcc036f){if(_0xcc036f){_0x1825cd=_0xcc036f[_0x1478('0x39')];if(!_0x4015ff[_0x1478('0x33')][_0x1478('0x3a')](_0x1478('0x3b'))){_0xc24d4a[_0x1478('0x20')]=qs[_0x1478('0x20')](_0x4015ff[_0x1478('0x33')][_0x1478('0x20')]);_0xc24d4a[_0x1478('0x1e')]=qs[_0x1478('0x1e')](_0x4015ff[_0x1478('0x33')][_0x1478('0x1e')]);}return _0x5b6c3a[_0x1478('0x50')](_0xc24d4a);}})[_0x1478('0x27')](function(_0x3c5411){if(_0x3c5411){return _0x3c5411?{'count':_0x1825cd,'rows':_0x3c5411}:null;}})[_0x1478('0x27')](respondWithResult(_0x45b680,null))[_0x1478('0x4a')](handleError(_0x45b680,null));};exports[_0x1478('0x51')]=function(_0x2c534d,_0x2ac726,_0x3fb515){if(_0x2c534d[_0x1478('0x4d')]['id']){delete _0x2c534d[_0x1478('0x4d')]['id'];}return db[_0x1478('0x2d')][_0x1478('0x52')]({'where':{'id':_0x2c534d[_0x1478('0x4e')]['id']}})[_0x1478('0x27')](handleEntityNotFound(_0x2ac726,null))['then'](function(_0x5cf50b){if(_0x5cf50b){_0x2c534d[_0x1478('0x4d')][_0x1478('0x53')]=_0x5cf50b['id'];_0x2c534d[_0x1478('0x4d')][_0x1478('0x54')]=integrations[_0x1478('0x55')](_0x2c534d[_0x1478('0x4d')]['channel'],_0x2c534d[_0x1478('0x4d')][_0x1478('0x30')]);_0x2c534d[_0x1478('0x4d')][_0x1478('0x56')]=integrations[_0x1478('0x57')](_0x2c534d['body'][_0x1478('0x58')],_0x2c534d['body'][_0x1478('0x30')]);return db['SugarcrmConfiguration']['create'](_0x2c534d['body'],{'include':[{'model':db[_0x1478('0x59')],'as':_0x1478('0x54')},{'model':db[_0x1478('0x59')],'as':'Descriptions'}]});}return null;})[_0x1478('0x27')](respondWithResult(_0x2ac726,null))[_0x1478('0x4a')](handleError(_0x2ac726,null));};exports['getFields']=function(_0x2b71a0,_0x106b15,_0x26ad41){var _0x1bbf99='';var _0xaeb4c7=['id',_0x1478('0x2a'),_0x1478('0x5a'),_0x1478('0x5b'),_0x1478('0x5c'),_0x1478('0x5d'),_0x1478('0x5e'),_0x1478('0x5f'),'parent_id',_0x1478('0x60'),'parent_name',_0x1478('0x61')];return db[_0x1478('0x2d')][_0x1478('0x52')]({'where':{'id':_0x2b71a0[_0x1478('0x4e')]['id']},'attributes':['id','username',_0x1478('0x62'),_0x1478('0x63')]})['then'](handleEntityNotFound(_0x106b15,null))[_0x1478('0x27')](function(_0x5ba5ca){if(_0x5ba5ca){_0x1bbf99=_0x5ba5ca[_0x1478('0x63')];var _0x68578a=_0x1bbf99[_0x1478('0x64')](-0x1);if(_0x68578a==='/'){_0x1bbf99=_0x1bbf99[_0x1478('0x65')](0x0,_0x1bbf99[_0x1478('0x66')](_0x68578a));}return rp({'method':'POST','uri':util[_0x1478('0x67')]('%s%s',_0x1bbf99,'/service/v4_1/rest.php'),'json':!![],'form':{'method':_0x1478('0x68'),'input_type':_0x1478('0x69'),'response_type':_0x1478('0x69'),'rest_data':JSON[_0x1478('0x6a')]({'user_auth':{'user_name':_0x5ba5ca[_0x1478('0x6b')],'password':_0x5ba5ca[_0x1478('0x62')],'encryption':_0x1478('0x6c')},'application':_0x1478('0x6d')})}});}})['then'](function(_0x5551e9){if(_0x5551e9&&_0x5551e9[_0x1478('0x2a')]!=='Invalid\x20Login'&&_0x5551e9[_0x1478('0x2a')]!==_0x1478('0x6e')){return rp({'method':'POST','uri':util['format'](_0x1478('0x6f'),_0x1bbf99,_0x1478('0x70')),'json':!![],'form':{'method':_0x1478('0x71'),'input_type':_0x1478('0x69'),'response_type':_0x1478('0x69'),'rest_data':JSON[_0x1478('0x6a')]({'session':_0x5551e9['id'],'module_name':_0x1478('0x72')})}})['then'](function(_0xa798f7){if(_0xa798f7){var _0x3c6e49=_[_0x1478('0x73')](_0xa798f7[_0x1478('0x74')]);_[_0x1478('0x75')](_0x3c6e49,function(_0x4053e3){return _0xaeb4c7[_0x1478('0x76')](_0x4053e3[_0x1478('0x2a')]);});return{'count':_0x3c6e49['length'],'rows':_[_0x1478('0x40')](_0x3c6e49,function(_0x3f996b){return{'id':_0x3f996b[_0x1478('0x2a')],'name':_0x3f996b[_0x1478('0x77')],'custom':_[_0x1478('0x78')](_0x3f996b[_0x1478('0x2a')],'_c')?!![]:![],'options':_0x3f996b[_0x1478('0x44')]?_['map'](_[_0x1478('0x73')](_0x3f996b[_0x1478('0x44')]),function(_0x4fed9c){return{'name':_0x4fed9c[_0x1478('0x79')],'value':_0x4fed9c[_0x1478('0x2a')]};}):[]};})};}})[_0x1478('0x27')](respondWithResult(_0x106b15,null))[_0x1478('0x4a')](function(_0x52fe5f){var _0x378447=_0x2b71a0[_0x1478('0x33')][_0x1478('0x7a')]?0x1f4:_0x52fe5f[_0x1478('0x7b')]||0x1f4;logger[_0x1478('0x28')](_0x1478('0x7c'),_0x1478('0x7d'),_0x378447,JSON['stringify'](_0x52fe5f));delete _0x52fe5f['name'];if(_0x378447===0x191){_0x378447=0x190;}_0x106b15[_0x1478('0x1b')](_0x378447)[_0x1478('0x2b')](_0x2b71a0['query'][_0x1478('0x7a')]?{'message':_0x1478('0x7e'),'statusCode':_0x52fe5f['statusCode']}:_0x52fe5f);});}else{var _0x134ed4=0x1f4;_0x106b15['status'](_0x134ed4)[_0x1478('0x2b')]({'message':_0x1478('0x7e'),'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 0ebdebf..dffef97 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 _0x15fc=['util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./intSugarcrmAccount.attributes','exports','define','int_sugarcrm_accounts'];(function(_0x4612f6,_0x2291c8){var _0x4f5f16=function(_0x5dd442){while(--_0x5dd442){_0x4612f6['push'](_0x4612f6['shift']());}};_0x4f5f16(++_0x2291c8);}(_0x15fc,0x8f));var _0xc15f=function(_0x39f237,_0x20c4be){_0x39f237=_0x39f237-0x0;var _0x3fb158=_0x15fc[_0x39f237];return _0x3fb158;};'use strict';var _=require('lodash');var util=require(_0xc15f('0x0'));var logger=require(_0xc15f('0x1'))(_0xc15f('0x2'));var moment=require(_0xc15f('0x3'));var BPromise=require(_0xc15f('0x4'));var rp=require(_0xc15f('0x5'));var fs=require('fs');var path=require(_0xc15f('0x6'));var rimraf=require(_0xc15f('0x7'));var config=require(_0xc15f('0x8'));var attributes=require(_0xc15f('0x9'));var integrations=require('../../components/integrations/configuration');module[_0xc15f('0xa')]=function(_0x46a525,_0x156845){return _0x46a525[_0xc15f('0xb')]('SugarcrmAccount',attributes,{'tableName':_0xc15f('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x7d7f=['lodash','util','../../config/logger','moment','request-promise','rimraf','./intSugarcrmAccount.attributes','../../components/integrations/configuration','define','SugarcrmAccount','int_sugarcrm_accounts'];(function(_0x507129,_0x513611){var _0x2a443b=function(_0x48aac7){while(--_0x48aac7){_0x507129['push'](_0x507129['shift']());}};_0x2a443b(++_0x513611);}(_0x7d7f,0x1c3));var _0xf7d7=function(_0x21d4ff,_0x27420d){_0x21d4ff=_0x21d4ff-0x0;var _0x4d07d3=_0x7d7f[_0x21d4ff];return _0x4d07d3;};'use strict';var _=require(_0xf7d7('0x0'));var util=require(_0xf7d7('0x1'));var logger=require(_0xf7d7('0x2'))('api');var moment=require(_0xf7d7('0x3'));var BPromise=require('bluebird');var rp=require(_0xf7d7('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0xf7d7('0x5'));var config=require('../../config/environment');var attributes=require(_0xf7d7('0x6'));var integrations=require(_0xf7d7('0x7'));module['exports']=function(_0x562184,_0x9a9f91){return _0x562184[_0xf7d7('0x8')](_0xf7d7('0x9'),attributes,{'tableName':_0xf7d7('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/intSugarcrmAccount/intSugarcrmAccount.rpc.js b/server/api/intSugarcrmAccount/intSugarcrmAccount.rpc.js index 94b29fc..f3909c2 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 _0x6b05=['ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','client','http','request','then','SugarcrmAccount,\x20%s,\x20%s','debug','SugarcrmAccount,\x20%s,\x20%s,\x20%s','request\x20sent','code','error','message','result','catch','GetSugarcrmAccount','SugarcrmAccount','findAll','options','raw','where','attributes','include','map','model','info','ShowSugarcrmAccount','find','stringify','util','moment'];(function(_0x43929b,_0x2fcfd3){var _0x266f29=function(_0x587bb1){while(--_0x587bb1){_0x43929b['push'](_0x43929b['shift']());}};_0x266f29(++_0x2fcfd3);}(_0x6b05,0x130));var _0x56b0=function(_0xb1af0f,_0x4203cd){_0xb1af0f=_0xb1af0f-0x0;var _0x3c89b1=_0x6b05[_0xb1af0f];return _0x3c89b1;};'use strict';var _=require('lodash');var util=require(_0x56b0('0x0'));var moment=require(_0x56b0('0x1'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x56b0('0x2'));var db=require(_0x56b0('0x3'))['db'];var utils=require(_0x56b0('0x4'));var logger=require('../../config/logger')(_0x56b0('0x5'));var config=require(_0x56b0('0x6'));var jayson=require('jayson/promise');var client=jayson[_0x56b0('0x7')][_0x56b0('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x4efabc,_0x5b2421,_0x74c629){return new BPromise(function(_0xec5c,_0x2aba7e){return client[_0x56b0('0x9')](_0x4efabc,_0x74c629)[_0x56b0('0xa')](function(_0x62464d){logger['info'](_0x56b0('0xb'),_0x5b2421,'request\x20sent');logger[_0x56b0('0xc')](_0x56b0('0xd'),_0x5b2421,_0x56b0('0xe'),JSON['stringify'](_0x62464d));if(_0x62464d['error']){if(_0x62464d['error'][_0x56b0('0xf')]===0x1f4){logger['error']('SugarcrmAccount,\x20%s,\x20%s',_0x5b2421,_0x62464d[_0x56b0('0x10')][_0x56b0('0x11')]);return _0x2aba7e(_0x62464d[_0x56b0('0x10')]['message']);}logger[_0x56b0('0x10')](_0x56b0('0xb'),_0x5b2421,_0x62464d[_0x56b0('0x10')]['message']);return _0xec5c(_0x62464d[_0x56b0('0x10')][_0x56b0('0x11')]);}else{logger['info']('SugarcrmAccount,\x20%s,\x20%s',_0x5b2421,_0x56b0('0xe'));_0xec5c(_0x62464d[_0x56b0('0x12')][_0x56b0('0x11')]);}})[_0x56b0('0x13')](function(_0x40de4a){logger[_0x56b0('0x10')](_0x56b0('0xb'),_0x5b2421,_0x40de4a);_0x2aba7e(_0x40de4a);});});}exports[_0x56b0('0x14')]=function(_0x22c8ff){var _0x1165b1=this;return new Promise(function(_0x1d1301,_0x10315a){return db[_0x56b0('0x15')][_0x56b0('0x16')]({'raw':_0x22c8ff['options']?_0x22c8ff[_0x56b0('0x17')][_0x56b0('0x18')]===undefined?!![]:![]:!![],'where':_0x22c8ff[_0x56b0('0x17')]?_0x22c8ff['options'][_0x56b0('0x19')]||null:null,'attributes':_0x22c8ff[_0x56b0('0x17')]?_0x22c8ff['options'][_0x56b0('0x1a')]||null:null,'limit':_0x22c8ff['options']?_0x22c8ff[_0x56b0('0x17')]['limit']||null:null,'include':_0x22c8ff[_0x56b0('0x17')]?_0x22c8ff[_0x56b0('0x17')][_0x56b0('0x1b')]?_['map'](_0x22c8ff[_0x56b0('0x17')]['include'],function(_0x25d60c){return{'model':db[_0x25d60c['model']],'as':_0x25d60c['as'],'attributes':_0x25d60c[_0x56b0('0x1a')],'include':_0x25d60c[_0x56b0('0x1b')]?_[_0x56b0('0x1c')](_0x25d60c['include'],function(_0x2bcecc){return{'model':db[_0x2bcecc[_0x56b0('0x1d')]],'as':_0x2bcecc['as'],'attributes':_0x2bcecc['attributes'],'include':_0x2bcecc[_0x56b0('0x1b')]?_[_0x56b0('0x1c')](_0x2bcecc[_0x56b0('0x1b')],function(_0x319797){return{'model':db[_0x319797[_0x56b0('0x1d')]],'as':_0x319797['as'],'attributes':_0x319797[_0x56b0('0x1a')]};}):[]};}):[]};}):[]:[]})[_0x56b0('0xa')](function(_0x586914){logger[_0x56b0('0x1e')]('GetSugarcrmAccount',_0x22c8ff);logger[_0x56b0('0xc')](_0x56b0('0x14'),_0x22c8ff,JSON['stringify'](_0x586914));_0x1d1301(_0x586914);})[_0x56b0('0x13')](function(_0x24dcec){logger['error'](_0x56b0('0x14'),_0x24dcec[_0x56b0('0x11')],_0x22c8ff);_0x10315a(_0x1165b1[_0x56b0('0x10')](0x1f4,_0x24dcec[_0x56b0('0x11')]));});});};exports[_0x56b0('0x1f')]=function(_0xfa28a4){var _0x4070b6=this;return new Promise(function(_0x3eb14a,_0x3dda06){return db[_0x56b0('0x15')][_0x56b0('0x20')]({'raw':_0xfa28a4[_0x56b0('0x17')]?_0xfa28a4[_0x56b0('0x17')]['raw']===undefined?!![]:![]:!![],'where':_0xfa28a4['options']?_0xfa28a4[_0x56b0('0x17')][_0x56b0('0x19')]||null:null,'attributes':_0xfa28a4[_0x56b0('0x17')]?_0xfa28a4['options'][_0x56b0('0x1a')]||null:null,'include':_0xfa28a4[_0x56b0('0x17')]?_0xfa28a4['options'][_0x56b0('0x1b')]?_['map'](_0xfa28a4['options'][_0x56b0('0x1b')],function(_0x3569ad){return{'model':db[_0x3569ad[_0x56b0('0x1d')]],'as':_0x3569ad['as'],'attributes':_0x3569ad[_0x56b0('0x1a')],'include':_0x3569ad['include']?_[_0x56b0('0x1c')](_0x3569ad[_0x56b0('0x1b')],function(_0x3587d5){return{'model':db[_0x3587d5[_0x56b0('0x1d')]],'as':_0x3587d5['as'],'attributes':_0x3587d5['attributes'],'include':_0x3587d5[_0x56b0('0x1b')]?_[_0x56b0('0x1c')](_0x3587d5[_0x56b0('0x1b')],function(_0x292c09){return{'model':db[_0x292c09[_0x56b0('0x1d')]],'as':_0x292c09['as'],'attributes':_0x292c09[_0x56b0('0x1a')]};}):[]};}):[]};}):[]:[]})[_0x56b0('0xa')](function(_0x1eeec0){logger[_0x56b0('0x1e')]('ShowSugarcrmAccount',_0xfa28a4);logger['debug'](_0x56b0('0x1f'),_0xfa28a4,JSON[_0x56b0('0x21')](_0x1eeec0));_0x3eb14a(_0x1eeec0);})[_0x56b0('0x13')](function(_0x5e6272){logger[_0x56b0('0x10')]('ShowSugarcrmAccount',_0x5e6272[_0x56b0('0x11')],_0xfa28a4);_0x3dda06(_0x4070b6[_0x56b0('0x10')](0x1f4,_0x5e6272[_0x56b0('0x11')]));});});}; \ No newline at end of file +var _0x32de=['lodash','util','moment','bluebird','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','SugarcrmAccount,\x20%s,\x20%s','request\x20sent','SugarcrmAccount,\x20%s,\x20%s,\x20%s','error','message','result','catch','GetSugarcrmAccount','SugarcrmAccount','options','raw','attributes','limit','include','map','model','debug','stringify','ShowSugarcrmAccount','find','where'];(function(_0xffa654,_0x4c734){var _0x5dd847=function(_0x64173a){while(--_0x64173a){_0xffa654['push'](_0xffa654['shift']());}};_0x5dd847(++_0x4c734);}(_0x32de,0x144));var _0xe32d=function(_0xf1a516,_0x4b7594){_0xf1a516=_0xf1a516-0x0;var _0x6792d2=_0x32de[_0xf1a516];return _0x6792d2;};'use strict';var _=require(_0xe32d('0x0'));var util=require(_0xe32d('0x1'));var moment=require(_0xe32d('0x2'));var BPromise=require(_0xe32d('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xe32d('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0xe32d('0x5'));var logger=require(_0xe32d('0x6'))(_0xe32d('0x7'));var config=require(_0xe32d('0x8'));var jayson=require(_0xe32d('0x9'));var client=jayson[_0xe32d('0xa')][_0xe32d('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x208819,_0x483e4f,_0x288cb3){return new BPromise(function(_0x1627cd,_0x596ac7){return client[_0xe32d('0xc')](_0x208819,_0x288cb3)[_0xe32d('0xd')](function(_0x5dec7a){logger[_0xe32d('0xe')](_0xe32d('0xf'),_0x483e4f,_0xe32d('0x10'));logger['debug'](_0xe32d('0x11'),_0x483e4f,_0xe32d('0x10'),JSON['stringify'](_0x5dec7a));if(_0x5dec7a[_0xe32d('0x12')]){if(_0x5dec7a[_0xe32d('0x12')]['code']===0x1f4){logger['error'](_0xe32d('0xf'),_0x483e4f,_0x5dec7a[_0xe32d('0x12')][_0xe32d('0x13')]);return _0x596ac7(_0x5dec7a[_0xe32d('0x12')][_0xe32d('0x13')]);}logger['error']('SugarcrmAccount,\x20%s,\x20%s',_0x483e4f,_0x5dec7a[_0xe32d('0x12')][_0xe32d('0x13')]);return _0x1627cd(_0x5dec7a[_0xe32d('0x12')]['message']);}else{logger[_0xe32d('0xe')]('SugarcrmAccount,\x20%s,\x20%s',_0x483e4f,_0xe32d('0x10'));_0x1627cd(_0x5dec7a[_0xe32d('0x14')][_0xe32d('0x13')]);}})[_0xe32d('0x15')](function(_0xdd373d){logger['error']('SugarcrmAccount,\x20%s,\x20%s',_0x483e4f,_0xdd373d);_0x596ac7(_0xdd373d);});});}exports[_0xe32d('0x16')]=function(_0x7495f8){var _0x251f65=this;return new Promise(function(_0x1130eb,_0x5795e1){return db[_0xe32d('0x17')]['findAll']({'raw':_0x7495f8[_0xe32d('0x18')]?_0x7495f8[_0xe32d('0x18')][_0xe32d('0x19')]===undefined?!![]:![]:!![],'where':_0x7495f8[_0xe32d('0x18')]?_0x7495f8[_0xe32d('0x18')]['where']||null:null,'attributes':_0x7495f8[_0xe32d('0x18')]?_0x7495f8['options'][_0xe32d('0x1a')]||null:null,'limit':_0x7495f8[_0xe32d('0x18')]?_0x7495f8[_0xe32d('0x18')][_0xe32d('0x1b')]||null:null,'include':_0x7495f8[_0xe32d('0x18')]?_0x7495f8[_0xe32d('0x18')][_0xe32d('0x1c')]?_[_0xe32d('0x1d')](_0x7495f8[_0xe32d('0x18')]['include'],function(_0x409185){return{'model':db[_0x409185[_0xe32d('0x1e')]],'as':_0x409185['as'],'attributes':_0x409185[_0xe32d('0x1a')],'include':_0x409185[_0xe32d('0x1c')]?_[_0xe32d('0x1d')](_0x409185[_0xe32d('0x1c')],function(_0x1e650c){return{'model':db[_0x1e650c[_0xe32d('0x1e')]],'as':_0x1e650c['as'],'attributes':_0x1e650c['attributes'],'include':_0x1e650c['include']?_['map'](_0x1e650c['include'],function(_0x17c175){return{'model':db[_0x17c175[_0xe32d('0x1e')]],'as':_0x17c175['as'],'attributes':_0x17c175[_0xe32d('0x1a')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x5f1fb4){logger[_0xe32d('0xe')](_0xe32d('0x16'),_0x7495f8);logger[_0xe32d('0x1f')](_0xe32d('0x16'),_0x7495f8,JSON[_0xe32d('0x20')](_0x5f1fb4));_0x1130eb(_0x5f1fb4);})[_0xe32d('0x15')](function(_0x3de8e3){logger[_0xe32d('0x12')](_0xe32d('0x16'),_0x3de8e3[_0xe32d('0x13')],_0x7495f8);_0x5795e1(_0x251f65[_0xe32d('0x12')](0x1f4,_0x3de8e3[_0xe32d('0x13')]));});});};exports[_0xe32d('0x21')]=function(_0x38ec20){var _0x3a46e7=this;return new Promise(function(_0xfb3e52,_0x16b511){return db[_0xe32d('0x17')][_0xe32d('0x22')]({'raw':_0x38ec20['options']?_0x38ec20[_0xe32d('0x18')][_0xe32d('0x19')]===undefined?!![]:![]:!![],'where':_0x38ec20['options']?_0x38ec20[_0xe32d('0x18')][_0xe32d('0x23')]||null:null,'attributes':_0x38ec20[_0xe32d('0x18')]?_0x38ec20[_0xe32d('0x18')]['attributes']||null:null,'include':_0x38ec20['options']?_0x38ec20['options']['include']?_[_0xe32d('0x1d')](_0x38ec20[_0xe32d('0x18')][_0xe32d('0x1c')],function(_0x4b8fb8){return{'model':db[_0x4b8fb8[_0xe32d('0x1e')]],'as':_0x4b8fb8['as'],'attributes':_0x4b8fb8[_0xe32d('0x1a')],'include':_0x4b8fb8['include']?_['map'](_0x4b8fb8['include'],function(_0x3ab5a3){return{'model':db[_0x3ab5a3[_0xe32d('0x1e')]],'as':_0x3ab5a3['as'],'attributes':_0x3ab5a3[_0xe32d('0x1a')],'include':_0x3ab5a3[_0xe32d('0x1c')]?_[_0xe32d('0x1d')](_0x3ab5a3[_0xe32d('0x1c')],function(_0x28b520){return{'model':db[_0x28b520[_0xe32d('0x1e')]],'as':_0x28b520['as'],'attributes':_0x28b520[_0xe32d('0x1a')]};}):[]};}):[]};}):[]:[]})[_0xe32d('0xd')](function(_0x27893a){logger['info']('ShowSugarcrmAccount',_0x38ec20);logger[_0xe32d('0x1f')]('ShowSugarcrmAccount',_0x38ec20,JSON[_0xe32d('0x20')](_0x27893a));_0xfb3e52(_0x27893a);})['catch'](function(_0x3406b9){logger['error'](_0xe32d('0x21'),_0x3406b9[_0xe32d('0x13')],_0x38ec20);_0x16b511(_0x3a46e7[_0xe32d('0x12')](0x1f4,_0x3406b9[_0xe32d('0x13')]));});});}; \ No newline at end of file diff --git a/server/api/intSugarcrmConfiguration/index.js b/server/api/intSugarcrmConfiguration/index.js index 91f8bd7..44efd9f 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 _0x9f4b=['exports','multer','util','connect-timeout','Router','fs-extra','../../components/auth/service','../../config/environment','./intSugarcrmConfiguration.controller','index','get','/:id','show','/:id/fields','isAuthenticated','/:id/subjects','getSubjects','/:id/descriptions','getDescriptions','create','put','delete','destroy'];(function(_0x5a1343,_0x61a61b){var _0x161cb6=function(_0x131919){while(--_0x131919){_0x5a1343['push'](_0x5a1343['shift']());}};_0x161cb6(++_0x61a61b);}(_0x9f4b,0x188));var _0xb9f4=function(_0x10db91,_0x44f379){_0x10db91=_0x10db91-0x0;var _0x39088a=_0x9f4b[_0x10db91];return _0x39088a;};'use strict';var multer=require(_0xb9f4('0x0'));var util=require(_0xb9f4('0x1'));var path=require('path');var timeout=require(_0xb9f4('0x2'));var express=require('express');var router=express[_0xb9f4('0x3')]();var fs_extra=require(_0xb9f4('0x4'));var auth=require(_0xb9f4('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0xb9f4('0x6'));var controller=require(_0xb9f4('0x7'));router['get']('/',auth['isAuthenticated'](),controller[_0xb9f4('0x8')]);router[_0xb9f4('0x9')](_0xb9f4('0xa'),auth['isAuthenticated'](),controller[_0xb9f4('0xb')]);router[_0xb9f4('0x9')](_0xb9f4('0xc'),auth[_0xb9f4('0xd')](),controller['getFields']);router[_0xb9f4('0x9')](_0xb9f4('0xe'),auth[_0xb9f4('0xd')](),controller[_0xb9f4('0xf')]);router[_0xb9f4('0x9')](_0xb9f4('0x10'),auth[_0xb9f4('0xd')](),controller[_0xb9f4('0x11')]);router['post']('/',auth[_0xb9f4('0xd')](),controller[_0xb9f4('0x12')]);router[_0xb9f4('0x13')](_0xb9f4('0xa'),auth[_0xb9f4('0xd')](),controller['update']);router[_0xb9f4('0x14')](_0xb9f4('0xa'),auth['isAuthenticated'](),controller[_0xb9f4('0x15')]);module[_0xb9f4('0x16')]=router; \ No newline at end of file +var _0xdeea=['getFields','/:id/subjects','/:id/descriptions','getDescriptions','create','put','update','delete','destroy','exports','path','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./intSugarcrmConfiguration.controller','get','isAuthenticated','index','/:id','show','/:id/fields'];(function(_0x3a2288,_0x23cfda){var _0x187d33=function(_0x5c2d5e){while(--_0x5c2d5e){_0x3a2288['push'](_0x3a2288['shift']());}};_0x187d33(++_0x23cfda);}(_0xdeea,0x172));var _0xadee=function(_0xa8883,_0x1f107f){_0xa8883=_0xa8883-0x0;var _0x479426=_0xdeea[_0xa8883];return _0x479426;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0xadee('0x0'));var timeout=require('connect-timeout');var express=require(_0xadee('0x1'));var router=express[_0xadee('0x2')]();var fs_extra=require(_0xadee('0x3'));var auth=require(_0xadee('0x4'));var interaction=require(_0xadee('0x5'));var config=require(_0xadee('0x6'));var controller=require(_0xadee('0x7'));router[_0xadee('0x8')]('/',auth[_0xadee('0x9')](),controller[_0xadee('0xa')]);router[_0xadee('0x8')](_0xadee('0xb'),auth[_0xadee('0x9')](),controller[_0xadee('0xc')]);router[_0xadee('0x8')](_0xadee('0xd'),auth[_0xadee('0x9')](),controller[_0xadee('0xe')]);router['get'](_0xadee('0xf'),auth[_0xadee('0x9')](),controller['getSubjects']);router[_0xadee('0x8')](_0xadee('0x10'),auth[_0xadee('0x9')](),controller[_0xadee('0x11')]);router['post']('/',auth[_0xadee('0x9')](),controller[_0xadee('0x12')]);router[_0xadee('0x13')]('/:id',auth[_0xadee('0x9')](),controller[_0xadee('0x14')]);router[_0xadee('0x15')](_0xadee('0xb'),auth[_0xadee('0x9')](),controller[_0xadee('0x16')]);module[_0xadee('0x17')]=router; \ No newline at end of file diff --git a/server/api/intSugarcrmConfiguration/intSugarcrmConfiguration.attributes.js b/server/api/intSugarcrmConfiguration/intSugarcrmConfiguration.attributes.js index b7396bf..1d3ad71 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 _0x4eb9=['sequelize','exports','STRING'];(function(_0x4cf98e,_0xba4b79){var _0x1623ac=function(_0x459bc0){while(--_0x459bc0){_0x4cf98e['push'](_0x4cf98e['shift']());}};_0x1623ac(++_0xba4b79);}(_0x4eb9,0x87));var _0x94eb=function(_0x502c7d,_0x2f1285){_0x502c7d=_0x502c7d-0x0;var _0x30b7ed=_0x4eb9[_0x502c7d];return _0x30b7ed;};'use strict';var Sequelize=require(_0x94eb('0x0'));module[_0x94eb('0x1')]={'name':{'type':Sequelize[_0x94eb('0x2')]},'description':{'type':Sequelize[_0x94eb('0x2')]}}; \ No newline at end of file +var _0xaad8=['STRING','exports'];(function(_0x40ebff,_0x1dd15e){var _0x40122a=function(_0xae6174){while(--_0xae6174){_0x40ebff['push'](_0x40ebff['shift']());}};_0x40122a(++_0x1dd15e);}(_0xaad8,0xeb));var _0x8aad=function(_0x2499fe,_0x36b606){_0x2499fe=_0x2499fe-0x0;var _0x57db93=_0xaad8[_0x2499fe];return _0x57db93;};'use strict';var Sequelize=require('sequelize');module[_0x8aad('0x0')]={'name':{'type':Sequelize[_0x8aad('0x1')]},'description':{'type':Sequelize[_0x8aad('0x1')]}}; \ No newline at end of file diff --git a/server/api/intSugarcrmConfiguration/intSugarcrmConfiguration.controller.js b/server/api/intSugarcrmConfiguration/intSugarcrmConfiguration.controller.js index 08a4501..977e187 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 _0xe0c2=['catch','create','body','getFields','findOne','SugarcrmField','order','getSubjects','getDescriptions','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','lodash','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/license/util','sendStatus','status','end','json','offset','undefined','limit','count','apply','reject','save','update','destroy','then','error','stack','name','map','SugarcrmConfiguration','rawAttributes','fieldName','type','model','query','keys','filters','intersection','attributes','fields','hasOwnProperty','nolimit','sort','where','pick','filter','merge','VIRTUAL','options','include','findAll','show','params','length','find'];(function(_0x55f8b4,_0x401c05){var _0x2dfd72=function(_0x5d92cf){while(--_0x5d92cf){_0x55f8b4['push'](_0x55f8b4['shift']());}};_0x2dfd72(++_0x401c05);}(_0xe0c2,0xea));var _0x2e0c=function(_0x2acd0f,_0x3ac736){_0x2acd0f=_0x2acd0f-0x0;var _0x434b3e=_0xe0c2[_0x2acd0f];return _0x434b3e;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0x2e0c('0x0'));var jsonpatch=require(_0x2e0c('0x1'));var rp=require(_0x2e0c('0x2'));var moment=require(_0x2e0c('0x3'));var BPromise=require(_0x2e0c('0x4'));var Mustache=require(_0x2e0c('0x5'));var util=require(_0x2e0c('0x6'));var path=require(_0x2e0c('0x7'));var sox=require(_0x2e0c('0x8'));var csv=require(_0x2e0c('0x9'));var ejs=require(_0x2e0c('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x2e0c('0xb'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0x2e0c('0xc'));var deskjs=require(_0x2e0c('0xd'));var toCsv=require(_0x2e0c('0x9'));var querystring=require(_0x2e0c('0xe'));var Papa=require(_0x2e0c('0xf'));var Redis=require(_0x2e0c('0x10'));var authService=require('../../components/auth/service');var qs=require(_0x2e0c('0x11'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x2e0c('0x12'));var logger=require(_0x2e0c('0x13'))(_0x2e0c('0x14'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0x2e0c('0x15'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x103123,_0x1b8d38){_0x1b8d38=_0x1b8d38||0xcc;return function(_0x34f777){if(_0x34f777){return _0x103123[_0x2e0c('0x16')](_0x1b8d38);}return _0x103123[_0x2e0c('0x17')](_0x1b8d38)[_0x2e0c('0x18')]();};}function respondWithResult(_0x179a61,_0x2f5c6e){_0x2f5c6e=_0x2f5c6e||0xc8;return function(_0x41e39e){if(_0x41e39e){return _0x179a61[_0x2e0c('0x17')](_0x2f5c6e)[_0x2e0c('0x19')](_0x41e39e);}};}function respondWithFilteredResult(_0x1f7855,_0x2b43e5){return function(_0x174ef5){if(_0x174ef5){var _0x4cbf1e=typeof _0x2b43e5[_0x2e0c('0x1a')]===_0x2e0c('0x1b')&&typeof _0x2b43e5[_0x2e0c('0x1c')]===_0x2e0c('0x1b');var _0x195062=_0x174ef5[_0x2e0c('0x1d')];var _0x596534=_0x4cbf1e?0x0:_0x2b43e5[_0x2e0c('0x1a')];var _0x10aa48=_0x4cbf1e?_0x174ef5[_0x2e0c('0x1d')]:_0x2b43e5[_0x2e0c('0x1a')]+_0x2b43e5[_0x2e0c('0x1c')];var _0x38a62a;if(_0x10aa48>=_0x195062){_0x10aa48=_0x195062;_0x38a62a=0xc8;}else{_0x38a62a=0xce;}_0x1f7855[_0x2e0c('0x17')](_0x38a62a);return _0x1f7855['set']('Content-Range',_0x596534+'-'+_0x10aa48+'/'+_0x195062)[_0x2e0c('0x19')](_0x174ef5);}return null;};}function patchUpdates(_0x14fbd9){return function(_0x3ab997){try{jsonpatch[_0x2e0c('0x1e')](_0x3ab997,_0x14fbd9,!![]);}catch(_0x43c5e6){return BPromise[_0x2e0c('0x1f')](_0x43c5e6);}return _0x3ab997[_0x2e0c('0x20')]();};}function saveUpdates(_0x36996f,_0x323e5a){return function(_0x4437e2){if(_0x4437e2){return _0x4437e2[_0x2e0c('0x21')](_0x36996f)['then'](function(_0x373fa0){return _0x373fa0;});}return null;};}function removeEntity(_0x351f33,_0x5089f6){return function(_0x443e36){if(_0x443e36){return _0x443e36[_0x2e0c('0x22')]()[_0x2e0c('0x23')](function(){_0x351f33[_0x2e0c('0x17')](0xcc)[_0x2e0c('0x18')]();});}};}function handleEntityNotFound(_0x591938,_0x536a8f){return function(_0x53db80){if(!_0x53db80){_0x591938[_0x2e0c('0x16')](0x194);}return _0x53db80;};}function handleError(_0x32093f,_0x27f2f2){_0x27f2f2=_0x27f2f2||0x1f4;return function(_0x4d961a){logger[_0x2e0c('0x24')](_0x4d961a[_0x2e0c('0x25')]);if(_0x4d961a[_0x2e0c('0x26')]){delete _0x4d961a['name'];}_0x32093f[_0x2e0c('0x17')](_0x27f2f2)['send'](_0x4d961a);};}exports['index']=function(_0x522922,_0x579bc9){var _0x5eb661={},_0x539251={},_0x4739c9={'count':0x0,'rows':[]};var _0x33ad6b=_[_0x2e0c('0x27')](db[_0x2e0c('0x28')][_0x2e0c('0x29')],function(_0x2c95b5){return{'name':_0x2c95b5[_0x2e0c('0x2a')],'type':_0x2c95b5[_0x2e0c('0x2b')]['key']};});_0x539251[_0x2e0c('0x2c')]=_[_0x2e0c('0x27')](_0x33ad6b,'name');_0x539251[_0x2e0c('0x2d')]=_[_0x2e0c('0x2e')](_0x522922['query']);_0x539251[_0x2e0c('0x2f')]=_[_0x2e0c('0x30')](_0x539251[_0x2e0c('0x2c')],_0x539251['query']);_0x5eb661[_0x2e0c('0x31')]=_['intersection'](_0x539251[_0x2e0c('0x2c')],qs[_0x2e0c('0x32')](_0x522922[_0x2e0c('0x2d')][_0x2e0c('0x32')]));_0x5eb661[_0x2e0c('0x31')]=_0x5eb661[_0x2e0c('0x31')]['length']?_0x5eb661['attributes']:_0x539251[_0x2e0c('0x2c')];if(!_0x522922[_0x2e0c('0x2d')][_0x2e0c('0x33')](_0x2e0c('0x34'))){_0x5eb661['limit']=qs[_0x2e0c('0x1c')](_0x522922[_0x2e0c('0x2d')][_0x2e0c('0x1c')]);_0x5eb661['offset']=qs[_0x2e0c('0x1a')](_0x522922[_0x2e0c('0x2d')][_0x2e0c('0x1a')]);}_0x5eb661['order']=qs[_0x2e0c('0x35')](_0x522922[_0x2e0c('0x2d')][_0x2e0c('0x35')]);_0x5eb661[_0x2e0c('0x36')]=qs[_0x2e0c('0x2f')](_[_0x2e0c('0x37')](_0x522922['query'],_0x539251[_0x2e0c('0x2f')]),_0x33ad6b);if(_0x522922[_0x2e0c('0x2d')][_0x2e0c('0x38')]){_0x5eb661[_0x2e0c('0x36')]=_[_0x2e0c('0x39')](_0x5eb661[_0x2e0c('0x36')],{'$or':_[_0x2e0c('0x27')](_0x33ad6b,function(_0x50913a){if(_0x50913a[_0x2e0c('0x2b')]!==_0x2e0c('0x3a')){var _0x478b4f={};_0x478b4f[_0x50913a[_0x2e0c('0x26')]]={'$like':'%'+_0x522922[_0x2e0c('0x2d')]['filter']+'%'};return _0x478b4f;}})});}_0x5eb661=_['merge']({},_0x5eb661,_0x522922[_0x2e0c('0x3b')]);var _0xeaf1d={'where':_0x5eb661[_0x2e0c('0x36')]};return db[_0x2e0c('0x28')][_0x2e0c('0x1d')](_0xeaf1d)['then'](function(_0x13741d){_0x4739c9[_0x2e0c('0x1d')]=_0x13741d;if(_0x522922[_0x2e0c('0x2d')]['includeAll']){_0x5eb661[_0x2e0c('0x3c')]=[{'all':!![]}];}return db[_0x2e0c('0x28')][_0x2e0c('0x3d')](_0x5eb661);})[_0x2e0c('0x23')](function(_0x2588b7){_0x4739c9['rows']=_0x2588b7;return _0x4739c9;})['then'](respondWithFilteredResult(_0x579bc9,_0x5eb661))['catch'](handleError(_0x579bc9,null));};exports[_0x2e0c('0x3e')]=function(_0x59c516,_0x38650f){var _0x4fa767={'raw':![],'where':{'id':_0x59c516[_0x2e0c('0x3f')]['id']}},_0x7b2d4d={};_0x7b2d4d[_0x2e0c('0x2c')]=_[_0x2e0c('0x2e')](db[_0x2e0c('0x28')][_0x2e0c('0x29')]);_0x7b2d4d[_0x2e0c('0x2d')]=_[_0x2e0c('0x2e')](_0x59c516[_0x2e0c('0x2d')]);_0x7b2d4d[_0x2e0c('0x2f')]=_[_0x2e0c('0x30')](_0x7b2d4d[_0x2e0c('0x2c')],_0x7b2d4d[_0x2e0c('0x2d')]);_0x4fa767[_0x2e0c('0x31')]=_[_0x2e0c('0x30')](_0x7b2d4d[_0x2e0c('0x2c')],qs['fields'](_0x59c516[_0x2e0c('0x2d')]['fields']));_0x4fa767[_0x2e0c('0x31')]=_0x4fa767['attributes'][_0x2e0c('0x40')]?_0x4fa767[_0x2e0c('0x31')]:_0x7b2d4d[_0x2e0c('0x2c')];if(_0x59c516[_0x2e0c('0x2d')]['includeAll']){_0x4fa767[_0x2e0c('0x3c')]=[{'all':!![]}];}_0x4fa767=_[_0x2e0c('0x39')]({},_0x4fa767,_0x59c516['options']);return db['SugarcrmConfiguration'][_0x2e0c('0x41')](_0x4fa767)['then'](handleEntityNotFound(_0x38650f,null))[_0x2e0c('0x23')](respondWithResult(_0x38650f,null))[_0x2e0c('0x42')](handleError(_0x38650f,null));};exports[_0x2e0c('0x43')]=function(_0x58321c,_0x46e8f9){return db[_0x2e0c('0x28')][_0x2e0c('0x43')](_0x58321c['body'],{})[_0x2e0c('0x23')](respondWithResult(_0x46e8f9,0xc9))[_0x2e0c('0x42')](handleError(_0x46e8f9,null));};exports['update']=function(_0x460388,_0x2bc589){if(_0x460388[_0x2e0c('0x44')]['id']){delete _0x460388[_0x2e0c('0x44')]['id'];}return db[_0x2e0c('0x28')][_0x2e0c('0x41')]({'where':{'id':_0x460388[_0x2e0c('0x3f')]['id']}})['then'](handleEntityNotFound(_0x2bc589,null))['then'](saveUpdates(_0x460388[_0x2e0c('0x44')],null))['then'](respondWithResult(_0x2bc589,null))['catch'](handleError(_0x2bc589,null));};exports[_0x2e0c('0x22')]=function(_0x230ce7,_0x86b65b){return db[_0x2e0c('0x28')][_0x2e0c('0x41')]({'where':{'id':_0x230ce7[_0x2e0c('0x3f')]['id']}})['then'](handleEntityNotFound(_0x86b65b,null))['then'](removeEntity(_0x86b65b,null))['catch'](handleError(_0x86b65b,null));};exports[_0x2e0c('0x45')]=function(_0x528197,_0x53bcb5,_0x4d16f6){var _0x576258={};var _0x53834f={};var _0x7e6908;var _0x80f5ac;return db[_0x2e0c('0x28')][_0x2e0c('0x46')]({'where':{'id':_0x528197[_0x2e0c('0x3f')]['id']}})[_0x2e0c('0x23')](handleEntityNotFound(_0x53bcb5,null))[_0x2e0c('0x23')](function(_0x3aafdb){if(_0x3aafdb){_0x7e6908=_0x3aafdb;_0x53834f['model']=_[_0x2e0c('0x2e')](db[_0x2e0c('0x47')][_0x2e0c('0x29')]);_0x53834f[_0x2e0c('0x2d')]=_[_0x2e0c('0x2e')](_0x528197[_0x2e0c('0x2d')]);_0x53834f['filters']=_[_0x2e0c('0x30')](_0x53834f[_0x2e0c('0x2c')],_0x53834f[_0x2e0c('0x2d')]);_0x576258[_0x2e0c('0x31')]=_[_0x2e0c('0x30')](_0x53834f[_0x2e0c('0x2c')],qs['fields'](_0x528197[_0x2e0c('0x2d')][_0x2e0c('0x32')]));_0x576258[_0x2e0c('0x31')]=_0x576258[_0x2e0c('0x31')][_0x2e0c('0x40')]?_0x576258[_0x2e0c('0x31')]:_0x53834f[_0x2e0c('0x2c')];_0x576258[_0x2e0c('0x48')]=qs[_0x2e0c('0x35')](_0x528197[_0x2e0c('0x2d')][_0x2e0c('0x35')]);_0x576258['where']=qs[_0x2e0c('0x2f')](_[_0x2e0c('0x37')](_0x528197[_0x2e0c('0x2d')],_0x53834f[_0x2e0c('0x2f')]));if(_0x528197[_0x2e0c('0x2d')]['filter']){_0x576258['where']=_['merge'](_0x576258['where'],{'$or':_['map'](_0x576258[_0x2e0c('0x31')],function(_0xae32cc){var _0x546903={};_0x546903[_0xae32cc]={'$like':'%'+_0x528197[_0x2e0c('0x2d')]['filter']+'%'};return _0x546903;})});}_0x576258=_[_0x2e0c('0x39')]({},_0x576258,_0x528197[_0x2e0c('0x3b')]);return _0x7e6908['getFields'](_0x576258);}})[_0x2e0c('0x23')](function(_0x2ca759){if(_0x2ca759){_0x80f5ac=_0x2ca759[_0x2e0c('0x40')];if(!_0x528197['query'][_0x2e0c('0x33')](_0x2e0c('0x34'))){_0x576258[_0x2e0c('0x1c')]=qs[_0x2e0c('0x1c')](_0x528197[_0x2e0c('0x2d')]['limit']);_0x576258[_0x2e0c('0x1a')]=qs[_0x2e0c('0x1a')](_0x528197['query'][_0x2e0c('0x1a')]);}return _0x7e6908[_0x2e0c('0x45')](_0x576258);}})['then'](function(_0x14aaff){if(_0x14aaff){return _0x14aaff?{'count':_0x80f5ac,'rows':_0x14aaff}:null;}})[_0x2e0c('0x23')](respondWithResult(_0x53bcb5,null))[_0x2e0c('0x42')](handleError(_0x53bcb5,null));};exports[_0x2e0c('0x49')]=function(_0x4c9448,_0x1e54cc,_0x2d4d83){var _0x46d3f5={};var _0x60b7ad={};var _0x1ff494;var _0x520f40;return db[_0x2e0c('0x28')][_0x2e0c('0x46')]({'where':{'id':_0x4c9448[_0x2e0c('0x3f')]['id']}})[_0x2e0c('0x23')](handleEntityNotFound(_0x1e54cc,null))[_0x2e0c('0x23')](function(_0x533fa2){if(_0x533fa2){_0x1ff494=_0x533fa2;_0x60b7ad[_0x2e0c('0x2c')]=_[_0x2e0c('0x2e')](db[_0x2e0c('0x47')][_0x2e0c('0x29')]);_0x60b7ad[_0x2e0c('0x2d')]=_[_0x2e0c('0x2e')](_0x4c9448[_0x2e0c('0x2d')]);_0x60b7ad[_0x2e0c('0x2f')]=_[_0x2e0c('0x30')](_0x60b7ad[_0x2e0c('0x2c')],_0x60b7ad[_0x2e0c('0x2d')]);_0x46d3f5['attributes']=_[_0x2e0c('0x30')](_0x60b7ad[_0x2e0c('0x2c')],qs[_0x2e0c('0x32')](_0x4c9448[_0x2e0c('0x2d')][_0x2e0c('0x32')]));_0x46d3f5[_0x2e0c('0x31')]=_0x46d3f5[_0x2e0c('0x31')][_0x2e0c('0x40')]?_0x46d3f5['attributes']:_0x60b7ad[_0x2e0c('0x2c')];_0x46d3f5['order']=qs[_0x2e0c('0x35')](_0x4c9448[_0x2e0c('0x2d')][_0x2e0c('0x35')]);_0x46d3f5[_0x2e0c('0x36')]=qs[_0x2e0c('0x2f')](_[_0x2e0c('0x37')](_0x4c9448['query'],_0x60b7ad['filters']));if(_0x4c9448[_0x2e0c('0x2d')][_0x2e0c('0x38')]){_0x46d3f5[_0x2e0c('0x36')]=_[_0x2e0c('0x39')](_0x46d3f5['where'],{'$or':_[_0x2e0c('0x27')](_0x46d3f5[_0x2e0c('0x31')],function(_0x50fd37){var _0x400a52={};_0x400a52[_0x50fd37]={'$like':'%'+_0x4c9448['query'][_0x2e0c('0x38')]+'%'};return _0x400a52;})});}_0x46d3f5=_['merge']({},_0x46d3f5,_0x4c9448[_0x2e0c('0x3b')]);return _0x1ff494[_0x2e0c('0x49')](_0x46d3f5);}})[_0x2e0c('0x23')](function(_0x30a427){if(_0x30a427){_0x520f40=_0x30a427[_0x2e0c('0x40')];if(!_0x4c9448[_0x2e0c('0x2d')][_0x2e0c('0x33')](_0x2e0c('0x34'))){_0x46d3f5[_0x2e0c('0x1c')]=qs[_0x2e0c('0x1c')](_0x4c9448[_0x2e0c('0x2d')][_0x2e0c('0x1c')]);_0x46d3f5['offset']=qs['offset'](_0x4c9448[_0x2e0c('0x2d')][_0x2e0c('0x1a')]);}return _0x1ff494[_0x2e0c('0x49')](_0x46d3f5);}})[_0x2e0c('0x23')](function(_0x4fa1d7){if(_0x4fa1d7){return _0x4fa1d7?{'count':_0x520f40,'rows':_0x4fa1d7}:null;}})[_0x2e0c('0x23')](respondWithResult(_0x1e54cc,null))['catch'](handleError(_0x1e54cc,null));};exports[_0x2e0c('0x4a')]=function(_0xf1bc80,_0x1c2ce8,_0x4cb20e){var _0x2177a5={};var _0x549fea={};var _0xa2e956;var _0x1a7743;return db[_0x2e0c('0x28')][_0x2e0c('0x46')]({'where':{'id':_0xf1bc80[_0x2e0c('0x3f')]['id']}})[_0x2e0c('0x23')](handleEntityNotFound(_0x1c2ce8,null))[_0x2e0c('0x23')](function(_0x1f5dc0){if(_0x1f5dc0){_0xa2e956=_0x1f5dc0;_0x549fea['model']=_['keys'](db[_0x2e0c('0x47')][_0x2e0c('0x29')]);_0x549fea[_0x2e0c('0x2d')]=_[_0x2e0c('0x2e')](_0xf1bc80[_0x2e0c('0x2d')]);_0x549fea['filters']=_['intersection'](_0x549fea['model'],_0x549fea['query']);_0x2177a5[_0x2e0c('0x31')]=_[_0x2e0c('0x30')](_0x549fea[_0x2e0c('0x2c')],qs[_0x2e0c('0x32')](_0xf1bc80[_0x2e0c('0x2d')][_0x2e0c('0x32')]));_0x2177a5[_0x2e0c('0x31')]=_0x2177a5[_0x2e0c('0x31')][_0x2e0c('0x40')]?_0x2177a5['attributes']:_0x549fea[_0x2e0c('0x2c')];_0x2177a5[_0x2e0c('0x48')]=qs[_0x2e0c('0x35')](_0xf1bc80[_0x2e0c('0x2d')][_0x2e0c('0x35')]);_0x2177a5[_0x2e0c('0x36')]=qs[_0x2e0c('0x2f')](_[_0x2e0c('0x37')](_0xf1bc80[_0x2e0c('0x2d')],_0x549fea[_0x2e0c('0x2f')]));if(_0xf1bc80['query']['filter']){_0x2177a5[_0x2e0c('0x36')]=_['merge'](_0x2177a5[_0x2e0c('0x36')],{'$or':_[_0x2e0c('0x27')](_0x2177a5[_0x2e0c('0x31')],function(_0x39a506){var _0x112525={};_0x112525[_0x39a506]={'$like':'%'+_0xf1bc80[_0x2e0c('0x2d')][_0x2e0c('0x38')]+'%'};return _0x112525;})});}_0x2177a5=_['merge']({},_0x2177a5,_0xf1bc80[_0x2e0c('0x3b')]);return _0xa2e956[_0x2e0c('0x4a')](_0x2177a5);}})[_0x2e0c('0x23')](function(_0x286c40){if(_0x286c40){_0x1a7743=_0x286c40[_0x2e0c('0x40')];if(!_0xf1bc80[_0x2e0c('0x2d')][_0x2e0c('0x33')](_0x2e0c('0x34'))){_0x2177a5[_0x2e0c('0x1c')]=qs[_0x2e0c('0x1c')](_0xf1bc80[_0x2e0c('0x2d')][_0x2e0c('0x1c')]);_0x2177a5[_0x2e0c('0x1a')]=qs[_0x2e0c('0x1a')](_0xf1bc80[_0x2e0c('0x2d')]['offset']);}return _0xa2e956[_0x2e0c('0x4a')](_0x2177a5);}})[_0x2e0c('0x23')](function(_0x5b1860){if(_0x5b1860){return _0x5b1860?{'count':_0x1a7743,'rows':_0x5b1860}:null;}})[_0x2e0c('0x23')](respondWithResult(_0x1c2ce8,null))[_0x2e0c('0x42')](handleError(_0x1c2ce8,null));}; \ No newline at end of file +var _0x0aa9=['jsforce','desk.js','querystring','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','offset','undefined','count','set','Content-Range','json','apply','reject','save','update','destroy','then','error','stack','name','send','index','map','SugarcrmConfiguration','rawAttributes','fieldName','key','model','query','intersection','attributes','fields','length','hasOwnProperty','nolimit','limit','order','sort','where','pick','filters','merge','VIRTUAL','filter','options','include','rows','catch','show','params','keys','find','create','body','getFields','SugarcrmField','getSubjects','getDescriptions','findOne','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','path','sox','to-csv','ejs','fs-extra','squel','crypto'];(function(_0x1c4f53,_0xa140fa){var _0x4d0b4b=function(_0x5e3edf){while(--_0x5e3edf){_0x1c4f53['push'](_0x1c4f53['shift']());}};_0x4d0b4b(++_0xa140fa);}(_0x0aa9,0x13e));var _0x90aa=function(_0x59c193,_0x381e04){_0x59c193=_0x59c193-0x0;var _0x3ef4a6=_0x0aa9[_0x59c193];return _0x3ef4a6;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x90aa('0x0'));var zipdir=require(_0x90aa('0x1'));var jsonpatch=require(_0x90aa('0x2'));var rp=require(_0x90aa('0x3'));var moment=require(_0x90aa('0x4'));var BPromise=require(_0x90aa('0x5'));var Mustache=require('mustache');var util=require(_0x90aa('0x6'));var path=require(_0x90aa('0x7'));var sox=require(_0x90aa('0x8'));var csv=require(_0x90aa('0x9'));var ejs=require(_0x90aa('0xa'));var fs=require('fs');var fs_extra=require(_0x90aa('0xb'));var _=require('lodash');var squel=require(_0x90aa('0xc'));var crypto=require(_0x90aa('0xd'));var jsforce=require(_0x90aa('0xe'));var deskjs=require(_0x90aa('0xf'));var toCsv=require(_0x90aa('0x9'));var querystring=require(_0x90aa('0x10'));var Papa=require('papaparse');var Redis=require(_0x90aa('0x11'));var authService=require('../../components/auth/service');var qs=require(_0x90aa('0x12'));var as=require(_0x90aa('0x13'));var hardwareService=require(_0x90aa('0x14'));var logger=require(_0x90aa('0x15'))('api');var utils=require(_0x90aa('0x16'));var config=require(_0x90aa('0x17'));var licenseUtil=require(_0x90aa('0x18'));var db=require(_0x90aa('0x19'))['db'];function respondWithStatusCode(_0x38e8cd,_0x14341d){_0x14341d=_0x14341d||0xcc;return function(_0x2e39d1){if(_0x2e39d1){return _0x38e8cd[_0x90aa('0x1a')](_0x14341d);}return _0x38e8cd[_0x90aa('0x1b')](_0x14341d)[_0x90aa('0x1c')]();};}function respondWithResult(_0x35aa77,_0x5e10af){_0x5e10af=_0x5e10af||0xc8;return function(_0x455ca1){if(_0x455ca1){return _0x35aa77[_0x90aa('0x1b')](_0x5e10af)['json'](_0x455ca1);}};}function respondWithFilteredResult(_0x5a8fa6,_0x2dbb33){return function(_0xe86fcc){if(_0xe86fcc){var _0x2d185b=typeof _0x2dbb33[_0x90aa('0x1d')]===_0x90aa('0x1e')&&typeof _0x2dbb33['limit']===_0x90aa('0x1e');var _0x2e0d76=_0xe86fcc[_0x90aa('0x1f')];var _0x22520e=_0x2d185b?0x0:_0x2dbb33['offset'];var _0x4dd519=_0x2d185b?_0xe86fcc[_0x90aa('0x1f')]:_0x2dbb33['offset']+_0x2dbb33['limit'];var _0x46f6d5;if(_0x4dd519>=_0x2e0d76){_0x4dd519=_0x2e0d76;_0x46f6d5=0xc8;}else{_0x46f6d5=0xce;}_0x5a8fa6[_0x90aa('0x1b')](_0x46f6d5);return _0x5a8fa6[_0x90aa('0x20')](_0x90aa('0x21'),_0x22520e+'-'+_0x4dd519+'/'+_0x2e0d76)[_0x90aa('0x22')](_0xe86fcc);}return null;};}function patchUpdates(_0x4eb4ae){return function(_0x1e3cb8){try{jsonpatch[_0x90aa('0x23')](_0x1e3cb8,_0x4eb4ae,!![]);}catch(_0x4b4f3f){return BPromise[_0x90aa('0x24')](_0x4b4f3f);}return _0x1e3cb8[_0x90aa('0x25')]();};}function saveUpdates(_0x40c922,_0xe3590d){return function(_0x2f3c2a){if(_0x2f3c2a){return _0x2f3c2a[_0x90aa('0x26')](_0x40c922)['then'](function(_0x5b6703){return _0x5b6703;});}return null;};}function removeEntity(_0x232a74,_0x2596e6){return function(_0x2388c3){if(_0x2388c3){return _0x2388c3[_0x90aa('0x27')]()[_0x90aa('0x28')](function(){_0x232a74[_0x90aa('0x1b')](0xcc)['end']();});}};}function handleEntityNotFound(_0x3a6cd2,_0x18874f){return function(_0x3b5ef9){if(!_0x3b5ef9){_0x3a6cd2[_0x90aa('0x1a')](0x194);}return _0x3b5ef9;};}function handleError(_0x2dd779,_0x448a66){_0x448a66=_0x448a66||0x1f4;return function(_0x24ed8f){logger[_0x90aa('0x29')](_0x24ed8f[_0x90aa('0x2a')]);if(_0x24ed8f[_0x90aa('0x2b')]){delete _0x24ed8f[_0x90aa('0x2b')];}_0x2dd779['status'](_0x448a66)[_0x90aa('0x2c')](_0x24ed8f);};}exports[_0x90aa('0x2d')]=function(_0xb0fb5b,_0x33e01e){var _0x56f76b={},_0x54b07c={},_0x4520e1={'count':0x0,'rows':[]};var _0x3aa23b=_[_0x90aa('0x2e')](db[_0x90aa('0x2f')][_0x90aa('0x30')],function(_0x2711fe){return{'name':_0x2711fe[_0x90aa('0x31')],'type':_0x2711fe['type'][_0x90aa('0x32')]};});_0x54b07c[_0x90aa('0x33')]=_[_0x90aa('0x2e')](_0x3aa23b,_0x90aa('0x2b'));_0x54b07c[_0x90aa('0x34')]=_['keys'](_0xb0fb5b['query']);_0x54b07c['filters']=_[_0x90aa('0x35')](_0x54b07c[_0x90aa('0x33')],_0x54b07c['query']);_0x56f76b[_0x90aa('0x36')]=_['intersection'](_0x54b07c['model'],qs[_0x90aa('0x37')](_0xb0fb5b[_0x90aa('0x34')][_0x90aa('0x37')]));_0x56f76b['attributes']=_0x56f76b[_0x90aa('0x36')][_0x90aa('0x38')]?_0x56f76b[_0x90aa('0x36')]:_0x54b07c[_0x90aa('0x33')];if(!_0xb0fb5b[_0x90aa('0x34')][_0x90aa('0x39')](_0x90aa('0x3a'))){_0x56f76b[_0x90aa('0x3b')]=qs[_0x90aa('0x3b')](_0xb0fb5b[_0x90aa('0x34')][_0x90aa('0x3b')]);_0x56f76b[_0x90aa('0x1d')]=qs[_0x90aa('0x1d')](_0xb0fb5b[_0x90aa('0x34')][_0x90aa('0x1d')]);}_0x56f76b[_0x90aa('0x3c')]=qs[_0x90aa('0x3d')](_0xb0fb5b[_0x90aa('0x34')]['sort']);_0x56f76b[_0x90aa('0x3e')]=qs['filters'](_[_0x90aa('0x3f')](_0xb0fb5b[_0x90aa('0x34')],_0x54b07c[_0x90aa('0x40')]),_0x3aa23b);if(_0xb0fb5b[_0x90aa('0x34')]['filter']){_0x56f76b['where']=_[_0x90aa('0x41')](_0x56f76b[_0x90aa('0x3e')],{'$or':_[_0x90aa('0x2e')](_0x3aa23b,function(_0x33bebf){if(_0x33bebf['type']!==_0x90aa('0x42')){var _0x22723e={};_0x22723e[_0x33bebf['name']]={'$like':'%'+_0xb0fb5b[_0x90aa('0x34')][_0x90aa('0x43')]+'%'};return _0x22723e;}})});}_0x56f76b=_[_0x90aa('0x41')]({},_0x56f76b,_0xb0fb5b[_0x90aa('0x44')]);var _0x157ee8={'where':_0x56f76b['where']};return db[_0x90aa('0x2f')][_0x90aa('0x1f')](_0x157ee8)[_0x90aa('0x28')](function(_0x18f69d){_0x4520e1['count']=_0x18f69d;if(_0xb0fb5b[_0x90aa('0x34')]['includeAll']){_0x56f76b[_0x90aa('0x45')]=[{'all':!![]}];}return db[_0x90aa('0x2f')]['findAll'](_0x56f76b);})[_0x90aa('0x28')](function(_0x2033c1){_0x4520e1[_0x90aa('0x46')]=_0x2033c1;return _0x4520e1;})[_0x90aa('0x28')](respondWithFilteredResult(_0x33e01e,_0x56f76b))[_0x90aa('0x47')](handleError(_0x33e01e,null));};exports[_0x90aa('0x48')]=function(_0x418a2a,_0x523a85){var _0xcdfa35={'raw':![],'where':{'id':_0x418a2a[_0x90aa('0x49')]['id']}},_0x33b0f2={};_0x33b0f2[_0x90aa('0x33')]=_[_0x90aa('0x4a')](db[_0x90aa('0x2f')]['rawAttributes']);_0x33b0f2[_0x90aa('0x34')]=_[_0x90aa('0x4a')](_0x418a2a[_0x90aa('0x34')]);_0x33b0f2[_0x90aa('0x40')]=_['intersection'](_0x33b0f2['model'],_0x33b0f2[_0x90aa('0x34')]);_0xcdfa35[_0x90aa('0x36')]=_['intersection'](_0x33b0f2[_0x90aa('0x33')],qs[_0x90aa('0x37')](_0x418a2a[_0x90aa('0x34')]['fields']));_0xcdfa35[_0x90aa('0x36')]=_0xcdfa35[_0x90aa('0x36')][_0x90aa('0x38')]?_0xcdfa35[_0x90aa('0x36')]:_0x33b0f2[_0x90aa('0x33')];if(_0x418a2a[_0x90aa('0x34')]['includeAll']){_0xcdfa35[_0x90aa('0x45')]=[{'all':!![]}];}_0xcdfa35=_[_0x90aa('0x41')]({},_0xcdfa35,_0x418a2a[_0x90aa('0x44')]);return db[_0x90aa('0x2f')][_0x90aa('0x4b')](_0xcdfa35)[_0x90aa('0x28')](handleEntityNotFound(_0x523a85,null))[_0x90aa('0x28')](respondWithResult(_0x523a85,null))[_0x90aa('0x47')](handleError(_0x523a85,null));};exports[_0x90aa('0x4c')]=function(_0x4792a5,_0x5bf461){return db[_0x90aa('0x2f')][_0x90aa('0x4c')](_0x4792a5['body'],{})[_0x90aa('0x28')](respondWithResult(_0x5bf461,0xc9))['catch'](handleError(_0x5bf461,null));};exports[_0x90aa('0x26')]=function(_0x308744,_0xef9ecb){if(_0x308744['body']['id']){delete _0x308744['body']['id'];}return db[_0x90aa('0x2f')][_0x90aa('0x4b')]({'where':{'id':_0x308744[_0x90aa('0x49')]['id']}})[_0x90aa('0x28')](handleEntityNotFound(_0xef9ecb,null))[_0x90aa('0x28')](saveUpdates(_0x308744[_0x90aa('0x4d')],null))[_0x90aa('0x28')](respondWithResult(_0xef9ecb,null))[_0x90aa('0x47')](handleError(_0xef9ecb,null));};exports[_0x90aa('0x27')]=function(_0x1b8763,_0x173bcc){return db[_0x90aa('0x2f')]['find']({'where':{'id':_0x1b8763['params']['id']}})[_0x90aa('0x28')](handleEntityNotFound(_0x173bcc,null))[_0x90aa('0x28')](removeEntity(_0x173bcc,null))['catch'](handleError(_0x173bcc,null));};exports[_0x90aa('0x4e')]=function(_0x335981,_0x58761d,_0x2c57cb){var _0x3c255f={};var _0x7b269e={};var _0x5d1e6a;var _0x8643e8;return db[_0x90aa('0x2f')]['findOne']({'where':{'id':_0x335981[_0x90aa('0x49')]['id']}})[_0x90aa('0x28')](handleEntityNotFound(_0x58761d,null))['then'](function(_0x53871e){if(_0x53871e){_0x5d1e6a=_0x53871e;_0x7b269e['model']=_[_0x90aa('0x4a')](db[_0x90aa('0x4f')][_0x90aa('0x30')]);_0x7b269e[_0x90aa('0x34')]=_[_0x90aa('0x4a')](_0x335981[_0x90aa('0x34')]);_0x7b269e[_0x90aa('0x40')]=_[_0x90aa('0x35')](_0x7b269e[_0x90aa('0x33')],_0x7b269e[_0x90aa('0x34')]);_0x3c255f[_0x90aa('0x36')]=_[_0x90aa('0x35')](_0x7b269e[_0x90aa('0x33')],qs[_0x90aa('0x37')](_0x335981['query']['fields']));_0x3c255f[_0x90aa('0x36')]=_0x3c255f[_0x90aa('0x36')][_0x90aa('0x38')]?_0x3c255f['attributes']:_0x7b269e['model'];_0x3c255f['order']=qs[_0x90aa('0x3d')](_0x335981[_0x90aa('0x34')]['sort']);_0x3c255f[_0x90aa('0x3e')]=qs[_0x90aa('0x40')](_['pick'](_0x335981[_0x90aa('0x34')],_0x7b269e['filters']));if(_0x335981[_0x90aa('0x34')]['filter']){_0x3c255f[_0x90aa('0x3e')]=_['merge'](_0x3c255f[_0x90aa('0x3e')],{'$or':_[_0x90aa('0x2e')](_0x3c255f[_0x90aa('0x36')],function(_0x1982a1){var _0x4457b1={};_0x4457b1[_0x1982a1]={'$like':'%'+_0x335981[_0x90aa('0x34')][_0x90aa('0x43')]+'%'};return _0x4457b1;})});}_0x3c255f=_[_0x90aa('0x41')]({},_0x3c255f,_0x335981[_0x90aa('0x44')]);return _0x5d1e6a[_0x90aa('0x4e')](_0x3c255f);}})[_0x90aa('0x28')](function(_0x57caff){if(_0x57caff){_0x8643e8=_0x57caff[_0x90aa('0x38')];if(!_0x335981[_0x90aa('0x34')]['hasOwnProperty'](_0x90aa('0x3a'))){_0x3c255f[_0x90aa('0x3b')]=qs[_0x90aa('0x3b')](_0x335981[_0x90aa('0x34')][_0x90aa('0x3b')]);_0x3c255f[_0x90aa('0x1d')]=qs[_0x90aa('0x1d')](_0x335981[_0x90aa('0x34')][_0x90aa('0x1d')]);}return _0x5d1e6a[_0x90aa('0x4e')](_0x3c255f);}})[_0x90aa('0x28')](function(_0x6c2f72){if(_0x6c2f72){return _0x6c2f72?{'count':_0x8643e8,'rows':_0x6c2f72}:null;}})['then'](respondWithResult(_0x58761d,null))[_0x90aa('0x47')](handleError(_0x58761d,null));};exports[_0x90aa('0x50')]=function(_0x15f23e,_0x45743d,_0x1f601c){var _0x4a0f26={};var _0x37906f={};var _0x326b0a;var _0x2f668b;return db['SugarcrmConfiguration']['findOne']({'where':{'id':_0x15f23e[_0x90aa('0x49')]['id']}})[_0x90aa('0x28')](handleEntityNotFound(_0x45743d,null))[_0x90aa('0x28')](function(_0x443050){if(_0x443050){_0x326b0a=_0x443050;_0x37906f['model']=_[_0x90aa('0x4a')](db[_0x90aa('0x4f')]['rawAttributes']);_0x37906f[_0x90aa('0x34')]=_[_0x90aa('0x4a')](_0x15f23e[_0x90aa('0x34')]);_0x37906f[_0x90aa('0x40')]=_['intersection'](_0x37906f['model'],_0x37906f[_0x90aa('0x34')]);_0x4a0f26['attributes']=_[_0x90aa('0x35')](_0x37906f[_0x90aa('0x33')],qs[_0x90aa('0x37')](_0x15f23e[_0x90aa('0x34')][_0x90aa('0x37')]));_0x4a0f26['attributes']=_0x4a0f26['attributes'][_0x90aa('0x38')]?_0x4a0f26[_0x90aa('0x36')]:_0x37906f['model'];_0x4a0f26[_0x90aa('0x3c')]=qs[_0x90aa('0x3d')](_0x15f23e[_0x90aa('0x34')][_0x90aa('0x3d')]);_0x4a0f26[_0x90aa('0x3e')]=qs[_0x90aa('0x40')](_['pick'](_0x15f23e['query'],_0x37906f[_0x90aa('0x40')]));if(_0x15f23e[_0x90aa('0x34')][_0x90aa('0x43')]){_0x4a0f26[_0x90aa('0x3e')]=_[_0x90aa('0x41')](_0x4a0f26[_0x90aa('0x3e')],{'$or':_['map'](_0x4a0f26[_0x90aa('0x36')],function(_0x545801){var _0x5cb2b5={};_0x5cb2b5[_0x545801]={'$like':'%'+_0x15f23e[_0x90aa('0x34')][_0x90aa('0x43')]+'%'};return _0x5cb2b5;})});}_0x4a0f26=_[_0x90aa('0x41')]({},_0x4a0f26,_0x15f23e['options']);return _0x326b0a[_0x90aa('0x50')](_0x4a0f26);}})[_0x90aa('0x28')](function(_0x43b6d9){if(_0x43b6d9){_0x2f668b=_0x43b6d9[_0x90aa('0x38')];if(!_0x15f23e['query'][_0x90aa('0x39')](_0x90aa('0x3a'))){_0x4a0f26['limit']=qs[_0x90aa('0x3b')](_0x15f23e[_0x90aa('0x34')][_0x90aa('0x3b')]);_0x4a0f26[_0x90aa('0x1d')]=qs['offset'](_0x15f23e['query']['offset']);}return _0x326b0a[_0x90aa('0x50')](_0x4a0f26);}})[_0x90aa('0x28')](function(_0x3a044a){if(_0x3a044a){return _0x3a044a?{'count':_0x2f668b,'rows':_0x3a044a}:null;}})[_0x90aa('0x28')](respondWithResult(_0x45743d,null))['catch'](handleError(_0x45743d,null));};exports[_0x90aa('0x51')]=function(_0x138a91,_0x369da0,_0x26cd65){var _0x4b6a86={};var _0x3c50c6={};var _0x3851b7;var _0xd11327;return db['SugarcrmConfiguration'][_0x90aa('0x52')]({'where':{'id':_0x138a91[_0x90aa('0x49')]['id']}})[_0x90aa('0x28')](handleEntityNotFound(_0x369da0,null))[_0x90aa('0x28')](function(_0x4de5f2){if(_0x4de5f2){_0x3851b7=_0x4de5f2;_0x3c50c6[_0x90aa('0x33')]=_[_0x90aa('0x4a')](db[_0x90aa('0x4f')][_0x90aa('0x30')]);_0x3c50c6[_0x90aa('0x34')]=_['keys'](_0x138a91['query']);_0x3c50c6[_0x90aa('0x40')]=_[_0x90aa('0x35')](_0x3c50c6[_0x90aa('0x33')],_0x3c50c6[_0x90aa('0x34')]);_0x4b6a86[_0x90aa('0x36')]=_['intersection'](_0x3c50c6[_0x90aa('0x33')],qs[_0x90aa('0x37')](_0x138a91['query'][_0x90aa('0x37')]));_0x4b6a86['attributes']=_0x4b6a86[_0x90aa('0x36')][_0x90aa('0x38')]?_0x4b6a86[_0x90aa('0x36')]:_0x3c50c6['model'];_0x4b6a86[_0x90aa('0x3c')]=qs[_0x90aa('0x3d')](_0x138a91['query'][_0x90aa('0x3d')]);_0x4b6a86[_0x90aa('0x3e')]=qs[_0x90aa('0x40')](_['pick'](_0x138a91['query'],_0x3c50c6[_0x90aa('0x40')]));if(_0x138a91[_0x90aa('0x34')]['filter']){_0x4b6a86[_0x90aa('0x3e')]=_['merge'](_0x4b6a86[_0x90aa('0x3e')],{'$or':_[_0x90aa('0x2e')](_0x4b6a86[_0x90aa('0x36')],function(_0x5a166e){var _0x486975={};_0x486975[_0x5a166e]={'$like':'%'+_0x138a91[_0x90aa('0x34')][_0x90aa('0x43')]+'%'};return _0x486975;})});}_0x4b6a86=_['merge']({},_0x4b6a86,_0x138a91[_0x90aa('0x44')]);return _0x3851b7[_0x90aa('0x51')](_0x4b6a86);}})[_0x90aa('0x28')](function(_0x5791d7){if(_0x5791d7){_0xd11327=_0x5791d7[_0x90aa('0x38')];if(!_0x138a91[_0x90aa('0x34')][_0x90aa('0x39')](_0x90aa('0x3a'))){_0x4b6a86[_0x90aa('0x3b')]=qs[_0x90aa('0x3b')](_0x138a91[_0x90aa('0x34')][_0x90aa('0x3b')]);_0x4b6a86['offset']=qs[_0x90aa('0x1d')](_0x138a91[_0x90aa('0x34')][_0x90aa('0x1d')]);}return _0x3851b7[_0x90aa('0x51')](_0x4b6a86);}})[_0x90aa('0x28')](function(_0x24d917){if(_0x24d917){return _0x24d917?{'count':_0xd11327,'rows':_0x24d917}:null;}})['then'](respondWithResult(_0x369da0,null))[_0x90aa('0x47')](handleError(_0x369da0,null));}; \ No newline at end of file diff --git a/server/api/intSugarcrmConfiguration/intSugarcrmConfiguration.model.js b/server/api/intSugarcrmConfiguration/intSugarcrmConfiguration.model.js index 97917ab..1c37f34 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 _0x1bf5=['../../config/environment','./intSugarcrmConfiguration.attributes','exports','define','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf'];(function(_0x4e93a9,_0x413f30){var _0x43013c=function(_0x3a0cf3){while(--_0x3a0cf3){_0x4e93a9['push'](_0x4e93a9['shift']());}};_0x43013c(++_0x413f30);}(_0x1bf5,0x122));var _0x51bf=function(_0x21bc06,_0x34364a){_0x21bc06=_0x21bc06-0x0;var _0x40d8b9=_0x1bf5[_0x21bc06];return _0x40d8b9;};'use strict';var _=require(_0x51bf('0x0'));var util=require(_0x51bf('0x1'));var logger=require(_0x51bf('0x2'))(_0x51bf('0x3'));var moment=require(_0x51bf('0x4'));var BPromise=require(_0x51bf('0x5'));var rp=require(_0x51bf('0x6'));var fs=require('fs');var path=require(_0x51bf('0x7'));var rimraf=require(_0x51bf('0x8'));var config=require(_0x51bf('0x9'));var attributes=require(_0x51bf('0xa'));module[_0x51bf('0xb')]=function(_0x4576e8,_0x1cca15){return _0x4576e8[_0x51bf('0xc')]('SugarcrmConfiguration',attributes,{'tableName':'int_sugarcrm_configurations','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x06e6=['../../config/environment','exports','SugarcrmConfiguration','int_sugarcrm_configurations','lodash','util','../../config/logger','bluebird','path','rimraf'];(function(_0x2b69cf,_0x351895){var _0x28bdfc=function(_0x109e52){while(--_0x109e52){_0x2b69cf['push'](_0x2b69cf['shift']());}};_0x28bdfc(++_0x351895);}(_0x06e6,0x9a));var _0x606e=function(_0x526046,_0x154040){_0x526046=_0x526046-0x0;var _0x5b92a2=_0x06e6[_0x526046];return _0x5b92a2;};'use strict';var _=require(_0x606e('0x0'));var util=require(_0x606e('0x1'));var logger=require(_0x606e('0x2'))('api');var moment=require('moment');var BPromise=require(_0x606e('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x606e('0x4'));var rimraf=require(_0x606e('0x5'));var config=require(_0x606e('0x6'));var attributes=require('./intSugarcrmConfiguration.attributes');module[_0x606e('0x7')]=function(_0x228a5e,_0x520528){return _0x228a5e['define'](_0x606e('0x8'),attributes,{'tableName':_0x606e('0x9'),'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 4e8af49..55700a6 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 _0xffb9=['rpc','../../config/environment','jayson/promise','client','http','request','then','request\x20sent','debug','SugarcrmConfiguration,\x20%s,\x20%s,\x20%s','stringify','error','code','message','SugarcrmConfiguration,\x20%s,\x20%s','info','catch','util','moment','../../mysqldb','../../config/utils','../../config/logger'];(function(_0x56e96c,_0x32f6ce){var _0x406a8a=function(_0x130be7){while(--_0x130be7){_0x56e96c['push'](_0x56e96c['shift']());}};_0x406a8a(++_0x32f6ce);}(_0xffb9,0x19d));var _0x9ffb=function(_0x29d88a,_0x519495){_0x29d88a=_0x29d88a-0x0;var _0x9f46f3=_0xffb9[_0x29d88a];return _0x9f46f3;};'use strict';var _=require('lodash');var util=require(_0x9ffb('0x0'));var moment=require(_0x9ffb('0x1'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x9ffb('0x2'))['db'];var utils=require(_0x9ffb('0x3'));var logger=require(_0x9ffb('0x4'))(_0x9ffb('0x5'));var config=require(_0x9ffb('0x6'));var jayson=require(_0x9ffb('0x7'));var client=jayson[_0x9ffb('0x8')][_0x9ffb('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x557e20,_0x44dc2b,_0x46d9d8){return new BPromise(function(_0x5b4dca,_0x16affe){return client[_0x9ffb('0xa')](_0x557e20,_0x46d9d8)[_0x9ffb('0xb')](function(_0x5da73e){logger['info']('SugarcrmConfiguration,\x20%s,\x20%s',_0x44dc2b,_0x9ffb('0xc'));logger[_0x9ffb('0xd')](_0x9ffb('0xe'),_0x44dc2b,_0x9ffb('0xc'),JSON[_0x9ffb('0xf')](_0x5da73e));if(_0x5da73e[_0x9ffb('0x10')]){if(_0x5da73e[_0x9ffb('0x10')][_0x9ffb('0x11')]===0x1f4){logger['error']('SugarcrmConfiguration,\x20%s,\x20%s',_0x44dc2b,_0x5da73e[_0x9ffb('0x10')][_0x9ffb('0x12')]);return _0x16affe(_0x5da73e[_0x9ffb('0x10')]['message']);}logger[_0x9ffb('0x10')](_0x9ffb('0x13'),_0x44dc2b,_0x5da73e[_0x9ffb('0x10')]['message']);return _0x5b4dca(_0x5da73e[_0x9ffb('0x10')][_0x9ffb('0x12')]);}else{logger[_0x9ffb('0x14')](_0x9ffb('0x13'),_0x44dc2b,_0x9ffb('0xc'));_0x5b4dca(_0x5da73e['result'][_0x9ffb('0x12')]);}})[_0x9ffb('0x15')](function(_0x210acd){logger[_0x9ffb('0x10')](_0x9ffb('0x13'),_0x44dc2b,_0x210acd);_0x16affe(_0x210acd);});});} \ No newline at end of file +var _0x4e3e=['error','code','message','request\x20sent','moment','bluebird','randomstring','rpc','jayson/promise','client','request','then','info','SugarcrmConfiguration,\x20%s,\x20%s','debug','SugarcrmConfiguration,\x20%s,\x20%s,\x20%s','stringify'];(function(_0x471277,_0x49c428){var _0x51690b=function(_0x5d0037){while(--_0x5d0037){_0x471277['push'](_0x471277['shift']());}};_0x51690b(++_0x49c428);}(_0x4e3e,0x1f1));var _0xe4e3=function(_0x28669c,_0x1f62c4){_0x28669c=_0x28669c-0x0;var _0x4a3af6=_0x4e3e[_0x28669c];return _0x4a3af6;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0xe4e3('0x0'));var BPromise=require(_0xe4e3('0x1'));var rs=require(_0xe4e3('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0xe4e3('0x3'));var config=require('../../config/environment');var jayson=require(_0xe4e3('0x4'));var client=jayson[_0xe4e3('0x5')]['http']({'port':0x232a});function respondWithRpcPromise(_0x21659f,_0x3be567,_0x1ce692){return new BPromise(function(_0xadb07f,_0x410286){return client[_0xe4e3('0x6')](_0x21659f,_0x1ce692)[_0xe4e3('0x7')](function(_0x3d4bde){logger[_0xe4e3('0x8')](_0xe4e3('0x9'),_0x3be567,'request\x20sent');logger[_0xe4e3('0xa')](_0xe4e3('0xb'),_0x3be567,'request\x20sent',JSON[_0xe4e3('0xc')](_0x3d4bde));if(_0x3d4bde[_0xe4e3('0xd')]){if(_0x3d4bde['error'][_0xe4e3('0xe')]===0x1f4){logger[_0xe4e3('0xd')](_0xe4e3('0x9'),_0x3be567,_0x3d4bde[_0xe4e3('0xd')]['message']);return _0x410286(_0x3d4bde[_0xe4e3('0xd')][_0xe4e3('0xf')]);}logger[_0xe4e3('0xd')](_0xe4e3('0x9'),_0x3be567,_0x3d4bde[_0xe4e3('0xd')]['message']);return _0xadb07f(_0x3d4bde[_0xe4e3('0xd')]['message']);}else{logger[_0xe4e3('0x8')](_0xe4e3('0x9'),_0x3be567,_0xe4e3('0x10'));_0xadb07f(_0x3d4bde['result'][_0xe4e3('0xf')]);}})['catch'](function(_0x5652c0){logger['error'](_0xe4e3('0x9'),_0x3be567,_0x5652c0);_0x410286(_0x5652c0);});});} \ No newline at end of file diff --git a/server/api/intSugarcrmField/index.js b/server/api/intSugarcrmField/index.js index 43b053b..ad69cc1 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 _0x11d2=['multer','util','path','../../components/auth/service','../../components/interaction/service','../../config/environment','./intSugarcrmField.controller','get','isAuthenticated','/:id','show','post','put','exports'];(function(_0x4a248b,_0x29e290){var _0x565f8c=function(_0x3944b1){while(--_0x3944b1){_0x4a248b['push'](_0x4a248b['shift']());}};_0x565f8c(++_0x29e290);}(_0x11d2,0xfc));var _0x211d=function(_0x2d2c16,_0x4e88b6){_0x2d2c16=_0x2d2c16-0x0;var _0x53f2fb=_0x11d2[_0x2d2c16];return _0x53f2fb;};'use strict';var multer=require(_0x211d('0x0'));var util=require(_0x211d('0x1'));var path=require(_0x211d('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0x211d('0x3'));var interaction=require(_0x211d('0x4'));var config=require(_0x211d('0x5'));var controller=require(_0x211d('0x6'));router[_0x211d('0x7')]('/',auth[_0x211d('0x8')](),controller['index']);router[_0x211d('0x7')](_0x211d('0x9'),auth[_0x211d('0x8')](),controller[_0x211d('0xa')]);router[_0x211d('0xb')]('/',auth[_0x211d('0x8')](),controller['create']);router[_0x211d('0xc')](_0x211d('0x9'),auth[_0x211d('0x8')](),controller['update']);router['delete'](_0x211d('0x9'),auth[_0x211d('0x8')](),controller['destroy']);module[_0x211d('0xd')]=router; \ No newline at end of file +var _0x87ed=['index','/:id','show','create','update','delete','destroy','exports','multer','util','path','connect-timeout','Router','fs-extra','../../components/interaction/service','../../config/environment','get','isAuthenticated'];(function(_0x541639,_0x494591){var _0x242fa6=function(_0x562aba){while(--_0x562aba){_0x541639['push'](_0x541639['shift']());}};_0x242fa6(++_0x494591);}(_0x87ed,0x1a6));var _0xd87e=function(_0x54de1b,_0x3cbe78){_0x54de1b=_0x54de1b-0x0;var _0x1fe2e2=_0x87ed[_0x54de1b];return _0x1fe2e2;};'use strict';var multer=require(_0xd87e('0x0'));var util=require(_0xd87e('0x1'));var path=require(_0xd87e('0x2'));var timeout=require(_0xd87e('0x3'));var express=require('express');var router=express[_0xd87e('0x4')]();var fs_extra=require(_0xd87e('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0xd87e('0x6'));var config=require(_0xd87e('0x7'));var controller=require('./intSugarcrmField.controller');router[_0xd87e('0x8')]('/',auth[_0xd87e('0x9')](),controller[_0xd87e('0xa')]);router[_0xd87e('0x8')](_0xd87e('0xb'),auth[_0xd87e('0x9')](),controller[_0xd87e('0xc')]);router['post']('/',auth[_0xd87e('0x9')](),controller[_0xd87e('0xd')]);router['put'](_0xd87e('0xb'),auth[_0xd87e('0x9')](),controller[_0xd87e('0xe')]);router[_0xd87e('0xf')](_0xd87e('0xb'),auth[_0xd87e('0x9')](),controller[_0xd87e('0x10')]);module[_0xd87e('0x11')]=router; \ No newline at end of file diff --git a/server/api/intSugarcrmField/intSugarcrmField.attributes.js b/server/api/intSugarcrmField/intSugarcrmField.attributes.js index 12a4e37..7cf14b5 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 _0x747a=['BOOLEAN','sequelize','exports','variable','customVariable','picklist','string','ENUM','STRING'];(function(_0xbb091,_0x3fe7ee){var _0x467a04=function(_0x3a978d){while(--_0x3a978d){_0xbb091['push'](_0xbb091['shift']());}};_0x467a04(++_0x3fe7ee);}(_0x747a,0xfd));var _0xa747=function(_0x531f8d,_0x264155){_0x531f8d=_0x531f8d-0x0;var _0x5cfda3=_0x747a[_0x531f8d];return _0x5cfda3;};'use strict';var Sequelize=require(_0xa747('0x0'));module[_0xa747('0x1')]={'type':{'type':Sequelize['ENUM']('string',_0xa747('0x2'),_0xa747('0x3'),'keyValue',_0xa747('0x4')),'defaultValue':_0xa747('0x5')},'content':{'type':Sequelize['STRING']},'key':{'type':Sequelize['STRING']},'keyType':{'type':Sequelize[_0xa747('0x6')]('string',_0xa747('0x2'),_0xa747('0x3'))},'keyContent':{'type':Sequelize['STRING']},'idField':{'type':Sequelize[_0xa747('0x7')]},'nameField':{'type':Sequelize[_0xa747('0x7')]},'customField':{'type':Sequelize[_0xa747('0x8')],'defaultValue':!![]},'variableName':{'type':Sequelize[_0xa747('0x7')]}}; \ No newline at end of file +var _0xa46a=['exports','ENUM','string','customVariable','keyValue','picklist','STRING','variable','sequelize'];(function(_0x341fcc,_0x5d784b){var _0x26d5f7=function(_0x19d303){while(--_0x19d303){_0x341fcc['push'](_0x341fcc['shift']());}};_0x26d5f7(++_0x5d784b);}(_0xa46a,0x6b));var _0xaa46=function(_0x7a68b,_0x964789){_0x7a68b=_0x7a68b-0x0;var _0x110d37=_0xa46a[_0x7a68b];return _0x110d37;};'use strict';var Sequelize=require(_0xaa46('0x0'));module[_0xaa46('0x1')]={'type':{'type':Sequelize[_0xaa46('0x2')](_0xaa46('0x3'),'variable',_0xaa46('0x4'),_0xaa46('0x5'),_0xaa46('0x6')),'defaultValue':'string'},'content':{'type':Sequelize['STRING']},'key':{'type':Sequelize[_0xaa46('0x7')]},'keyType':{'type':Sequelize[_0xaa46('0x2')](_0xaa46('0x3'),_0xaa46('0x8'),'customVariable')},'keyContent':{'type':Sequelize[_0xaa46('0x7')]},'idField':{'type':Sequelize[_0xaa46('0x7')]},'nameField':{'type':Sequelize[_0xaa46('0x7')]},'customField':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'variableName':{'type':Sequelize['STRING']}}; \ No newline at end of file diff --git a/server/api/intSugarcrmField/intSugarcrmField.controller.js b/server/api/intSugarcrmField/intSugarcrmField.controller.js index 4e22417..81d9c6e 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 _0xa129=['key','model','query','filters','attributes','fields','length','nolimit','order','sort','where','filter','VIRTUAL','include','findAll','rows','catch','params','intersection','includeAll','merge','options','find','create','body','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','path','sox','to-csv','ejs','lodash','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/logger','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','update','destroy','then','error','stack','name','index','map','SugarcrmField','rawAttributes','fieldName','type'];(function(_0x50470f,_0x1e0719){var _0x45e97c=function(_0xe1218d){while(--_0xe1218d){_0x50470f['push'](_0x50470f['shift']());}};_0x45e97c(++_0x1e0719);}(_0xa129,0xf4));var _0x9a12=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xa129[_0x3dd15e];return _0x231fd0;};'use strict';var emlformat=require(_0x9a12('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x9a12('0x1'));var jsonpatch=require(_0x9a12('0x2'));var rp=require(_0x9a12('0x3'));var moment=require(_0x9a12('0x4'));var BPromise=require(_0x9a12('0x5'));var Mustache=require(_0x9a12('0x6'));var util=require('util');var path=require(_0x9a12('0x7'));var sox=require(_0x9a12('0x8'));var csv=require(_0x9a12('0x9'));var ejs=require(_0x9a12('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x9a12('0xb'));var squel=require('squel');var crypto=require(_0x9a12('0xc'));var jsforce=require(_0x9a12('0xd'));var deskjs=require(_0x9a12('0xe'));var toCsv=require(_0x9a12('0x9'));var querystring=require(_0x9a12('0xf'));var Papa=require(_0x9a12('0x10'));var Redis=require(_0x9a12('0x11'));var authService=require(_0x9a12('0x12'));var qs=require(_0x9a12('0x13'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0x9a12('0x14'))('api');var utils=require('../../config/utils');var config=require(_0x9a12('0x15'));var licenseUtil=require(_0x9a12('0x16'));var db=require(_0x9a12('0x17'))['db'];function respondWithStatusCode(_0x3997c0,_0x1483fd){_0x1483fd=_0x1483fd||0xcc;return function(_0x592352){if(_0x592352){return _0x3997c0[_0x9a12('0x18')](_0x1483fd);}return _0x3997c0[_0x9a12('0x19')](_0x1483fd)[_0x9a12('0x1a')]();};}function respondWithResult(_0x42e2ff,_0x4ce5a5){_0x4ce5a5=_0x4ce5a5||0xc8;return function(_0x1bf31a){if(_0x1bf31a){return _0x42e2ff['status'](_0x4ce5a5)[_0x9a12('0x1b')](_0x1bf31a);}};}function respondWithFilteredResult(_0x32e9c5,_0x2348da){return function(_0x77f2a0){if(_0x77f2a0){var _0x470d3e=typeof _0x2348da[_0x9a12('0x1c')]===_0x9a12('0x1d')&&typeof _0x2348da[_0x9a12('0x1e')]===_0x9a12('0x1d');var _0x4ef182=_0x77f2a0['count'];var _0x23b90d=_0x470d3e?0x0:_0x2348da['offset'];var _0x4482de=_0x470d3e?_0x77f2a0[_0x9a12('0x1f')]:_0x2348da['offset']+_0x2348da[_0x9a12('0x1e')];var _0x2e8dfa;if(_0x4482de>=_0x4ef182){_0x4482de=_0x4ef182;_0x2e8dfa=0xc8;}else{_0x2e8dfa=0xce;}_0x32e9c5[_0x9a12('0x19')](_0x2e8dfa);return _0x32e9c5[_0x9a12('0x20')](_0x9a12('0x21'),_0x23b90d+'-'+_0x4482de+'/'+_0x4ef182)['json'](_0x77f2a0);}return null;};}function patchUpdates(_0x103a4d){return function(_0x17cbef){try{jsonpatch[_0x9a12('0x22')](_0x17cbef,_0x103a4d,!![]);}catch(_0x496640){return BPromise[_0x9a12('0x23')](_0x496640);}return _0x17cbef['save']();};}function saveUpdates(_0x323459,_0xb7040b){return function(_0x3c8c12){if(_0x3c8c12){return _0x3c8c12[_0x9a12('0x24')](_0x323459)['then'](function(_0x274be2){return _0x274be2;});}return null;};}function removeEntity(_0xde98d9,_0x4aaec6){return function(_0x1e9b37){if(_0x1e9b37){return _0x1e9b37[_0x9a12('0x25')]()[_0x9a12('0x26')](function(){_0xde98d9[_0x9a12('0x19')](0xcc)[_0x9a12('0x1a')]();});}};}function handleEntityNotFound(_0x4810a4,_0x3ed2c6){return function(_0xd8d12f){if(!_0xd8d12f){_0x4810a4[_0x9a12('0x18')](0x194);}return _0xd8d12f;};}function handleError(_0x2e5362,_0x5bdf02){_0x5bdf02=_0x5bdf02||0x1f4;return function(_0x24955f){logger[_0x9a12('0x27')](_0x24955f[_0x9a12('0x28')]);if(_0x24955f[_0x9a12('0x29')]){delete _0x24955f[_0x9a12('0x29')];}_0x2e5362['status'](_0x5bdf02)['send'](_0x24955f);};}exports[_0x9a12('0x2a')]=function(_0x131181,_0x3a1fae){var _0x1ac3f3={},_0x35075a={},_0x977943={'count':0x0,'rows':[]};var _0x3277ed=_[_0x9a12('0x2b')](db[_0x9a12('0x2c')][_0x9a12('0x2d')],function(_0x5ed645){return{'name':_0x5ed645[_0x9a12('0x2e')],'type':_0x5ed645[_0x9a12('0x2f')][_0x9a12('0x30')]};});_0x35075a[_0x9a12('0x31')]=_[_0x9a12('0x2b')](_0x3277ed,_0x9a12('0x29'));_0x35075a['query']=_['keys'](_0x131181[_0x9a12('0x32')]);_0x35075a[_0x9a12('0x33')]=_['intersection'](_0x35075a[_0x9a12('0x31')],_0x35075a[_0x9a12('0x32')]);_0x1ac3f3[_0x9a12('0x34')]=_['intersection'](_0x35075a[_0x9a12('0x31')],qs[_0x9a12('0x35')](_0x131181[_0x9a12('0x32')][_0x9a12('0x35')]));_0x1ac3f3['attributes']=_0x1ac3f3['attributes'][_0x9a12('0x36')]?_0x1ac3f3[_0x9a12('0x34')]:_0x35075a['model'];if(!_0x131181[_0x9a12('0x32')]['hasOwnProperty'](_0x9a12('0x37'))){_0x1ac3f3['limit']=qs['limit'](_0x131181[_0x9a12('0x32')][_0x9a12('0x1e')]);_0x1ac3f3[_0x9a12('0x1c')]=qs[_0x9a12('0x1c')](_0x131181['query']['offset']);}_0x1ac3f3[_0x9a12('0x38')]=qs[_0x9a12('0x39')](_0x131181[_0x9a12('0x32')][_0x9a12('0x39')]);_0x1ac3f3[_0x9a12('0x3a')]=qs[_0x9a12('0x33')](_['pick'](_0x131181[_0x9a12('0x32')],_0x35075a[_0x9a12('0x33')]),_0x3277ed);if(_0x131181[_0x9a12('0x32')][_0x9a12('0x3b')]){_0x1ac3f3['where']=_['merge'](_0x1ac3f3[_0x9a12('0x3a')],{'$or':_[_0x9a12('0x2b')](_0x3277ed,function(_0x2527c7){if(_0x2527c7[_0x9a12('0x2f')]!==_0x9a12('0x3c')){var _0x2eec9b={};_0x2eec9b[_0x2527c7[_0x9a12('0x29')]]={'$like':'%'+_0x131181[_0x9a12('0x32')][_0x9a12('0x3b')]+'%'};return _0x2eec9b;}})});}_0x1ac3f3=_['merge']({},_0x1ac3f3,_0x131181['options']);var _0x105560={'where':_0x1ac3f3[_0x9a12('0x3a')]};return db[_0x9a12('0x2c')][_0x9a12('0x1f')](_0x105560)[_0x9a12('0x26')](function(_0x12fabd){_0x977943['count']=_0x12fabd;if(_0x131181[_0x9a12('0x32')]['includeAll']){_0x1ac3f3[_0x9a12('0x3d')]=[{'all':!![]}];}return db[_0x9a12('0x2c')][_0x9a12('0x3e')](_0x1ac3f3);})[_0x9a12('0x26')](function(_0x288224){_0x977943[_0x9a12('0x3f')]=_0x288224;return _0x977943;})[_0x9a12('0x26')](respondWithFilteredResult(_0x3a1fae,_0x1ac3f3))[_0x9a12('0x40')](handleError(_0x3a1fae,null));};exports['show']=function(_0x43af1b,_0x4169b4){var _0x120411={'raw':!![],'where':{'id':_0x43af1b[_0x9a12('0x41')]['id']}},_0x1a5193={};_0x1a5193[_0x9a12('0x31')]=_['keys'](db[_0x9a12('0x2c')][_0x9a12('0x2d')]);_0x1a5193[_0x9a12('0x32')]=_['keys'](_0x43af1b[_0x9a12('0x32')]);_0x1a5193['filters']=_[_0x9a12('0x42')](_0x1a5193[_0x9a12('0x31')],_0x1a5193[_0x9a12('0x32')]);_0x120411[_0x9a12('0x34')]=_[_0x9a12('0x42')](_0x1a5193[_0x9a12('0x31')],qs[_0x9a12('0x35')](_0x43af1b[_0x9a12('0x32')][_0x9a12('0x35')]));_0x120411[_0x9a12('0x34')]=_0x120411['attributes'][_0x9a12('0x36')]?_0x120411[_0x9a12('0x34')]:_0x1a5193[_0x9a12('0x31')];if(_0x43af1b[_0x9a12('0x32')][_0x9a12('0x43')]){_0x120411['include']=[{'all':!![]}];}_0x120411=_[_0x9a12('0x44')]({},_0x120411,_0x43af1b[_0x9a12('0x45')]);return db[_0x9a12('0x2c')][_0x9a12('0x46')](_0x120411)['then'](handleEntityNotFound(_0x4169b4,null))['then'](respondWithResult(_0x4169b4,null))[_0x9a12('0x40')](handleError(_0x4169b4,null));};exports[_0x9a12('0x47')]=function(_0x2e1668,_0x3b3618){return db[_0x9a12('0x2c')][_0x9a12('0x47')](_0x2e1668[_0x9a12('0x48')],{})[_0x9a12('0x26')](respondWithResult(_0x3b3618,0xc9))[_0x9a12('0x40')](handleError(_0x3b3618,null));};exports[_0x9a12('0x24')]=function(_0x1b2305,_0xe016ce){if(_0x1b2305[_0x9a12('0x48')]['id']){delete _0x1b2305[_0x9a12('0x48')]['id'];}return db[_0x9a12('0x2c')]['find']({'where':{'id':_0x1b2305[_0x9a12('0x41')]['id']}})[_0x9a12('0x26')](handleEntityNotFound(_0xe016ce,null))[_0x9a12('0x26')](saveUpdates(_0x1b2305[_0x9a12('0x48')],null))[_0x9a12('0x26')](respondWithResult(_0xe016ce,null))['catch'](handleError(_0xe016ce,null));};exports[_0x9a12('0x25')]=function(_0x4cb876,_0x5252f3){return db[_0x9a12('0x2c')]['find']({'where':{'id':_0x4cb876[_0x9a12('0x41')]['id']}})[_0x9a12('0x26')](handleEntityNotFound(_0x5252f3,null))[_0x9a12('0x26')](removeEntity(_0x5252f3,null))[_0x9a12('0x40')](handleError(_0x5252f3,null));}; \ No newline at end of file +var _0xa2e3=['rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','path','sox','to-csv','ejs','fs-extra','lodash','squel','desk.js','querystring','../../components/auth/service','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','json','undefined','limit','count','offset','Content-Range','update','destroy','then','error','stack','name','send','map','SugarcrmField','rawAttributes','type','key','model','query','keys','filters','intersection','attributes','fields','length','nolimit','order','sort','pick','merge','where','filter','options','includeAll','include','rows','catch','show','create','body','find','params','eml-format'];(function(_0x4b10f9,_0x15829b){var _0x219568=function(_0x5299e5){while(--_0x5299e5){_0x4b10f9['push'](_0x4b10f9['shift']());}};_0x219568(++_0x15829b);}(_0xa2e3,0xcb));var _0x3a2e=function(_0x53f5ef,_0x148d30){_0x53f5ef=_0x53f5ef-0x0;var _0xe236bb=_0xa2e3[_0x53f5ef];return _0xe236bb;};'use strict';var emlformat=require(_0x3a2e('0x0'));var rimraf=require(_0x3a2e('0x1'));var zipdir=require(_0x3a2e('0x2'));var jsonpatch=require(_0x3a2e('0x3'));var rp=require(_0x3a2e('0x4'));var moment=require(_0x3a2e('0x5'));var BPromise=require('bluebird');var Mustache=require(_0x3a2e('0x6'));var util=require('util');var path=require(_0x3a2e('0x7'));var sox=require(_0x3a2e('0x8'));var csv=require(_0x3a2e('0x9'));var ejs=require(_0x3a2e('0xa'));var fs=require('fs');var fs_extra=require(_0x3a2e('0xb'));var _=require(_0x3a2e('0xc'));var squel=require(_0x3a2e('0xd'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x3a2e('0xe'));var toCsv=require(_0x3a2e('0x9'));var querystring=require(_0x3a2e('0xf'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0x3a2e('0x10'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0x3a2e('0x11'))(_0x3a2e('0x12'));var utils=require(_0x3a2e('0x13'));var config=require(_0x3a2e('0x14'));var licenseUtil=require('../../config/license/util');var db=require(_0x3a2e('0x15'))['db'];function respondWithStatusCode(_0xe896d0,_0x1672ed){_0x1672ed=_0x1672ed||0xcc;return function(_0xcc0991){if(_0xcc0991){return _0xe896d0[_0x3a2e('0x16')](_0x1672ed);}return _0xe896d0[_0x3a2e('0x17')](_0x1672ed)[_0x3a2e('0x18')]();};}function respondWithResult(_0x113388,_0x11cc90){_0x11cc90=_0x11cc90||0xc8;return function(_0xc73737){if(_0xc73737){return _0x113388['status'](_0x11cc90)[_0x3a2e('0x19')](_0xc73737);}};}function respondWithFilteredResult(_0xfb80ee,_0x1861c3){return function(_0x515b21){if(_0x515b21){var _0x1c317f=typeof _0x1861c3['offset']===_0x3a2e('0x1a')&&typeof _0x1861c3[_0x3a2e('0x1b')]===_0x3a2e('0x1a');var _0x28adf6=_0x515b21[_0x3a2e('0x1c')];var _0x113b4d=_0x1c317f?0x0:_0x1861c3[_0x3a2e('0x1d')];var _0x537b60=_0x1c317f?_0x515b21[_0x3a2e('0x1c')]:_0x1861c3['offset']+_0x1861c3[_0x3a2e('0x1b')];var _0x46b1c0;if(_0x537b60>=_0x28adf6){_0x537b60=_0x28adf6;_0x46b1c0=0xc8;}else{_0x46b1c0=0xce;}_0xfb80ee[_0x3a2e('0x17')](_0x46b1c0);return _0xfb80ee['set'](_0x3a2e('0x1e'),_0x113b4d+'-'+_0x537b60+'/'+_0x28adf6)[_0x3a2e('0x19')](_0x515b21);}return null;};}function patchUpdates(_0x4f6d6f){return function(_0x5a1e52){try{jsonpatch['apply'](_0x5a1e52,_0x4f6d6f,!![]);}catch(_0x454216){return BPromise['reject'](_0x454216);}return _0x5a1e52['save']();};}function saveUpdates(_0x2a7015,_0x10b98c){return function(_0x5a910c){if(_0x5a910c){return _0x5a910c[_0x3a2e('0x1f')](_0x2a7015)['then'](function(_0x353544){return _0x353544;});}return null;};}function removeEntity(_0x52b3ba,_0x11b9af){return function(_0x4da51d){if(_0x4da51d){return _0x4da51d[_0x3a2e('0x20')]()[_0x3a2e('0x21')](function(){_0x52b3ba[_0x3a2e('0x17')](0xcc)['end']();});}};}function handleEntityNotFound(_0x231504,_0x58b698){return function(_0x4b71fb){if(!_0x4b71fb){_0x231504[_0x3a2e('0x16')](0x194);}return _0x4b71fb;};}function handleError(_0x40a805,_0xf434f8){_0xf434f8=_0xf434f8||0x1f4;return function(_0xe72479){logger[_0x3a2e('0x22')](_0xe72479[_0x3a2e('0x23')]);if(_0xe72479[_0x3a2e('0x24')]){delete _0xe72479['name'];}_0x40a805['status'](_0xf434f8)[_0x3a2e('0x25')](_0xe72479);};}exports['index']=function(_0x5de8ef,_0x13ade1){var _0x117b93={},_0x417ba3={},_0x50ac76={'count':0x0,'rows':[]};var _0xece2b7=_[_0x3a2e('0x26')](db[_0x3a2e('0x27')][_0x3a2e('0x28')],function(_0x2738f8){return{'name':_0x2738f8['fieldName'],'type':_0x2738f8[_0x3a2e('0x29')][_0x3a2e('0x2a')]};});_0x417ba3[_0x3a2e('0x2b')]=_[_0x3a2e('0x26')](_0xece2b7,_0x3a2e('0x24'));_0x417ba3[_0x3a2e('0x2c')]=_[_0x3a2e('0x2d')](_0x5de8ef[_0x3a2e('0x2c')]);_0x417ba3[_0x3a2e('0x2e')]=_[_0x3a2e('0x2f')](_0x417ba3[_0x3a2e('0x2b')],_0x417ba3[_0x3a2e('0x2c')]);_0x117b93[_0x3a2e('0x30')]=_['intersection'](_0x417ba3['model'],qs[_0x3a2e('0x31')](_0x5de8ef[_0x3a2e('0x2c')]['fields']));_0x117b93['attributes']=_0x117b93[_0x3a2e('0x30')][_0x3a2e('0x32')]?_0x117b93[_0x3a2e('0x30')]:_0x417ba3[_0x3a2e('0x2b')];if(!_0x5de8ef['query']['hasOwnProperty'](_0x3a2e('0x33'))){_0x117b93['limit']=qs[_0x3a2e('0x1b')](_0x5de8ef[_0x3a2e('0x2c')]['limit']);_0x117b93['offset']=qs[_0x3a2e('0x1d')](_0x5de8ef[_0x3a2e('0x2c')][_0x3a2e('0x1d')]);}_0x117b93[_0x3a2e('0x34')]=qs[_0x3a2e('0x35')](_0x5de8ef['query'][_0x3a2e('0x35')]);_0x117b93['where']=qs[_0x3a2e('0x2e')](_[_0x3a2e('0x36')](_0x5de8ef[_0x3a2e('0x2c')],_0x417ba3['filters']),_0xece2b7);if(_0x5de8ef[_0x3a2e('0x2c')]['filter']){_0x117b93['where']=_[_0x3a2e('0x37')](_0x117b93[_0x3a2e('0x38')],{'$or':_[_0x3a2e('0x26')](_0xece2b7,function(_0x260a2b){if(_0x260a2b[_0x3a2e('0x29')]!=='VIRTUAL'){var _0x2fe3ca={};_0x2fe3ca[_0x260a2b['name']]={'$like':'%'+_0x5de8ef['query'][_0x3a2e('0x39')]+'%'};return _0x2fe3ca;}})});}_0x117b93=_[_0x3a2e('0x37')]({},_0x117b93,_0x5de8ef[_0x3a2e('0x3a')]);var _0x3ee887={'where':_0x117b93[_0x3a2e('0x38')]};return db['SugarcrmField'][_0x3a2e('0x1c')](_0x3ee887)['then'](function(_0x3524f5){_0x50ac76[_0x3a2e('0x1c')]=_0x3524f5;if(_0x5de8ef[_0x3a2e('0x2c')][_0x3a2e('0x3b')]){_0x117b93[_0x3a2e('0x3c')]=[{'all':!![]}];}return db[_0x3a2e('0x27')]['findAll'](_0x117b93);})[_0x3a2e('0x21')](function(_0x36893e){_0x50ac76[_0x3a2e('0x3d')]=_0x36893e;return _0x50ac76;})[_0x3a2e('0x21')](respondWithFilteredResult(_0x13ade1,_0x117b93))[_0x3a2e('0x3e')](handleError(_0x13ade1,null));};exports[_0x3a2e('0x3f')]=function(_0x45791b,_0x333b97){var _0x28bfdf={'raw':!![],'where':{'id':_0x45791b['params']['id']}},_0x544783={};_0x544783[_0x3a2e('0x2b')]=_['keys'](db['SugarcrmField']['rawAttributes']);_0x544783[_0x3a2e('0x2c')]=_[_0x3a2e('0x2d')](_0x45791b[_0x3a2e('0x2c')]);_0x544783['filters']=_[_0x3a2e('0x2f')](_0x544783[_0x3a2e('0x2b')],_0x544783['query']);_0x28bfdf[_0x3a2e('0x30')]=_[_0x3a2e('0x2f')](_0x544783[_0x3a2e('0x2b')],qs[_0x3a2e('0x31')](_0x45791b[_0x3a2e('0x2c')]['fields']));_0x28bfdf[_0x3a2e('0x30')]=_0x28bfdf['attributes'][_0x3a2e('0x32')]?_0x28bfdf[_0x3a2e('0x30')]:_0x544783[_0x3a2e('0x2b')];if(_0x45791b[_0x3a2e('0x2c')]['includeAll']){_0x28bfdf[_0x3a2e('0x3c')]=[{'all':!![]}];}_0x28bfdf=_[_0x3a2e('0x37')]({},_0x28bfdf,_0x45791b[_0x3a2e('0x3a')]);return db[_0x3a2e('0x27')]['find'](_0x28bfdf)[_0x3a2e('0x21')](handleEntityNotFound(_0x333b97,null))[_0x3a2e('0x21')](respondWithResult(_0x333b97,null))[_0x3a2e('0x3e')](handleError(_0x333b97,null));};exports['create']=function(_0x44e3da,_0x13040a){return db[_0x3a2e('0x27')][_0x3a2e('0x40')](_0x44e3da[_0x3a2e('0x41')],{})[_0x3a2e('0x21')](respondWithResult(_0x13040a,0xc9))[_0x3a2e('0x3e')](handleError(_0x13040a,null));};exports[_0x3a2e('0x1f')]=function(_0x121706,_0x35d85a){if(_0x121706[_0x3a2e('0x41')]['id']){delete _0x121706['body']['id'];}return db[_0x3a2e('0x27')][_0x3a2e('0x42')]({'where':{'id':_0x121706[_0x3a2e('0x43')]['id']}})['then'](handleEntityNotFound(_0x35d85a,null))['then'](saveUpdates(_0x121706['body'],null))[_0x3a2e('0x21')](respondWithResult(_0x35d85a,null))[_0x3a2e('0x3e')](handleError(_0x35d85a,null));};exports[_0x3a2e('0x20')]=function(_0x596568,_0x14c90d){return db[_0x3a2e('0x27')][_0x3a2e('0x42')]({'where':{'id':_0x596568[_0x3a2e('0x43')]['id']}})[_0x3a2e('0x21')](handleEntityNotFound(_0x14c90d,null))['then'](removeEntity(_0x14c90d,null))[_0x3a2e('0x3e')](handleError(_0x14c90d,null));}; \ No newline at end of file diff --git a/server/api/intSugarcrmField/intSugarcrmField.model.js b/server/api/intSugarcrmField/intSugarcrmField.model.js index 0ecc6ce..9f2ac5f 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 _0x6f80=['./intSugarcrmField.attributes','exports','define','idField','FieldId','lodash','util','../../config/logger','bluebird','request-promise','rimraf','../../config/environment'];(function(_0x2664c0,_0x2a75d1){var _0x312b33=function(_0x4304c8){while(--_0x4304c8){_0x2664c0['push'](_0x2664c0['shift']());}};_0x312b33(++_0x2a75d1);}(_0x6f80,0x1b5));var _0x06f8=function(_0x492801,_0x39de84){_0x492801=_0x492801-0x0;var _0x276377=_0x6f80[_0x492801];return _0x276377;};'use strict';var _=require(_0x06f8('0x0'));var util=require(_0x06f8('0x1'));var logger=require(_0x06f8('0x2'))('api');var moment=require('moment');var BPromise=require(_0x06f8('0x3'));var rp=require(_0x06f8('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0x06f8('0x5'));var config=require(_0x06f8('0x6'));var attributes=require(_0x06f8('0x7'));module[_0x06f8('0x8')]=function(_0x1aa40f,_0x29b73a){return _0x1aa40f[_0x06f8('0x9')]('SugarcrmField',attributes,{'tableName':'int_sugarcrm_fields','paranoid':![],'indexes':[{'name':'sugarcrm_unique_index','fields':[_0x06f8('0xa'),_0x06f8('0xb')],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file +var _0xf809=['int_sugarcrm_fields','sugarcrm_unique_index','idField','FieldId','lodash','util','../../config/logger','api','moment','bluebird','request-promise','../../config/environment','exports','define','SugarcrmField'];(function(_0x9b0409,_0x1985af){var _0x541719=function(_0x452894){while(--_0x452894){_0x9b0409['push'](_0x9b0409['shift']());}};_0x541719(++_0x1985af);}(_0xf809,0x18a));var _0x9f80=function(_0x42070b,_0x2c9e0a){_0x42070b=_0x42070b-0x0;var _0x13cf8f=_0xf809[_0x42070b];return _0x13cf8f;};'use strict';var _=require(_0x9f80('0x0'));var util=require(_0x9f80('0x1'));var logger=require(_0x9f80('0x2'))(_0x9f80('0x3'));var moment=require(_0x9f80('0x4'));var BPromise=require(_0x9f80('0x5'));var rp=require(_0x9f80('0x6'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0x9f80('0x7'));var attributes=require('./intSugarcrmField.attributes');module[_0x9f80('0x8')]=function(_0x24bd4c,_0x3cb6a2){return _0x24bd4c[_0x9f80('0x9')](_0x9f80('0xa'),attributes,{'tableName':_0x9f80('0xb'),'paranoid':![],'indexes':[{'name':_0x9f80('0xc'),'fields':[_0x9f80('0xd'),_0x9f80('0xe')],'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 26eb165..4db1dc0 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 _0x6a61=['debug','request\x20sent','code','error','message','info','result','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','SugarcrmField,\x20%s,\x20%s'];(function(_0x4c9b5b,_0x4681eb){var _0x2104e1=function(_0x427c66){while(--_0x427c66){_0x4c9b5b['push'](_0x4c9b5b['shift']());}};_0x2104e1(++_0x4681eb);}(_0x6a61,0x160));var _0x16a6=function(_0x5ec0a4,_0xc13c7f){_0x5ec0a4=_0x5ec0a4-0x0;var _0x49540d=_0x6a61[_0x5ec0a4];return _0x49540d;};'use strict';var _=require(_0x16a6('0x0'));var util=require(_0x16a6('0x1'));var moment=require(_0x16a6('0x2'));var BPromise=require(_0x16a6('0x3'));var rs=require(_0x16a6('0x4'));var fs=require('fs');var Redis=require(_0x16a6('0x5'));var db=require(_0x16a6('0x6'))['db'];var utils=require('../../config/utils');var logger=require(_0x16a6('0x7'))(_0x16a6('0x8'));var config=require(_0x16a6('0x9'));var jayson=require(_0x16a6('0xa'));var client=jayson[_0x16a6('0xb')][_0x16a6('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x4462dd,_0x14445a,_0x143239){return new BPromise(function(_0x3ea66b,_0x18e9cd){return client[_0x16a6('0xd')](_0x4462dd,_0x143239)[_0x16a6('0xe')](function(_0x75f52a){logger['info'](_0x16a6('0xf'),_0x14445a,'request\x20sent');logger[_0x16a6('0x10')]('SugarcrmField,\x20%s,\x20%s,\x20%s',_0x14445a,_0x16a6('0x11'),JSON['stringify'](_0x75f52a));if(_0x75f52a['error']){if(_0x75f52a['error'][_0x16a6('0x12')]===0x1f4){logger['error'](_0x16a6('0xf'),_0x14445a,_0x75f52a[_0x16a6('0x13')]['message']);return _0x18e9cd(_0x75f52a[_0x16a6('0x13')][_0x16a6('0x14')]);}logger['error'](_0x16a6('0xf'),_0x14445a,_0x75f52a[_0x16a6('0x13')]['message']);return _0x3ea66b(_0x75f52a[_0x16a6('0x13')][_0x16a6('0x14')]);}else{logger[_0x16a6('0x15')](_0x16a6('0xf'),_0x14445a,_0x16a6('0x11'));_0x3ea66b(_0x75f52a[_0x16a6('0x16')]['message']);}})['catch'](function(_0x54fe8b){logger[_0x16a6('0x13')](_0x16a6('0xf'),_0x14445a,_0x54fe8b);_0x18e9cd(_0x54fe8b);});});} \ No newline at end of file +var _0x18ab=['SugarcrmField,\x20%s,\x20%s','request\x20sent','debug','SugarcrmField,\x20%s,\x20%s,\x20%s','stringify','error','code','message','lodash','util','moment','bluebird','randomstring','ioredis','../../config/logger','../../config/environment','jayson/promise','client','http','request','info'];(function(_0x5b0fcc,_0x449df1){var _0x16eb1e=function(_0x24a12f){while(--_0x24a12f){_0x5b0fcc['push'](_0x5b0fcc['shift']());}};_0x16eb1e(++_0x449df1);}(_0x18ab,0xda));var _0xb18a=function(_0x54a138,_0x3442ae){_0x54a138=_0x54a138-0x0;var _0x2058e6=_0x18ab[_0x54a138];return _0x2058e6;};'use strict';var _=require(_0xb18a('0x0'));var util=require(_0xb18a('0x1'));var moment=require(_0xb18a('0x2'));var BPromise=require(_0xb18a('0x3'));var rs=require(_0xb18a('0x4'));var fs=require('fs');var Redis=require(_0xb18a('0x5'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0xb18a('0x6'))('rpc');var config=require(_0xb18a('0x7'));var jayson=require(_0xb18a('0x8'));var client=jayson[_0xb18a('0x9')][_0xb18a('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x3f593c,_0x2b603e,_0x5a7d19){return new BPromise(function(_0x448e4e,_0x17cc06){return client[_0xb18a('0xb')](_0x3f593c,_0x5a7d19)['then'](function(_0x3d3cd4){logger[_0xb18a('0xc')](_0xb18a('0xd'),_0x2b603e,_0xb18a('0xe'));logger[_0xb18a('0xf')](_0xb18a('0x10'),_0x2b603e,_0xb18a('0xe'),JSON[_0xb18a('0x11')](_0x3d3cd4));if(_0x3d3cd4[_0xb18a('0x12')]){if(_0x3d3cd4[_0xb18a('0x12')][_0xb18a('0x13')]===0x1f4){logger[_0xb18a('0x12')](_0xb18a('0xd'),_0x2b603e,_0x3d3cd4['error'][_0xb18a('0x14')]);return _0x17cc06(_0x3d3cd4['error'][_0xb18a('0x14')]);}logger[_0xb18a('0x12')](_0xb18a('0xd'),_0x2b603e,_0x3d3cd4[_0xb18a('0x12')][_0xb18a('0x14')]);return _0x448e4e(_0x3d3cd4[_0xb18a('0x12')]['message']);}else{logger[_0xb18a('0xc')](_0xb18a('0xd'),_0x2b603e,_0xb18a('0xe'));_0x448e4e(_0x3d3cd4['result'][_0xb18a('0x14')]);}})['catch'](function(_0x82fd2){logger[_0xb18a('0x12')](_0xb18a('0xd'),_0x2b603e,_0x82fd2);_0x17cc06(_0x82fd2);});});} \ No newline at end of file diff --git a/server/api/intVtigerAccount/index.js b/server/api/intVtigerAccount/index.js index 2661037..c0af95c 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 _0x5530=['/:id','isAuthenticated','/:id/configurations','getConfigurations','/:id/fields','getFields','create','post','addConfiguration','put','update','delete','exports','multer','path','connect-timeout','express','Router','../../components/auth/service','../../config/environment','get','index'];(function(_0x538a20,_0x5c14d6){var _0xec72f5=function(_0x582321){while(--_0x582321){_0x538a20['push'](_0x538a20['shift']());}};_0xec72f5(++_0x5c14d6);}(_0x5530,0xa7));var _0x0553=function(_0xfc4ab8,_0x5df9d0){_0xfc4ab8=_0xfc4ab8-0x0;var _0x5ed755=_0x5530[_0xfc4ab8];return _0x5ed755;};'use strict';var multer=require(_0x0553('0x0'));var util=require('util');var path=require(_0x0553('0x1'));var timeout=require(_0x0553('0x2'));var express=require(_0x0553('0x3'));var router=express[_0x0553('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0x0553('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0x0553('0x6'));var controller=require('./intVtigerAccount.controller');router[_0x0553('0x7')]('/',auth['isAuthenticated'](),controller[_0x0553('0x8')]);router[_0x0553('0x7')](_0x0553('0x9'),auth[_0x0553('0xa')](),controller['show']);router['get'](_0x0553('0xb'),auth[_0x0553('0xa')](),controller[_0x0553('0xc')]);router[_0x0553('0x7')](_0x0553('0xd'),auth[_0x0553('0xa')](),controller[_0x0553('0xe')]);router['post']('/',auth['isAuthenticated'](),controller[_0x0553('0xf')]);router[_0x0553('0x10')](_0x0553('0xb'),auth[_0x0553('0xa')](),controller[_0x0553('0x11')]);router[_0x0553('0x12')](_0x0553('0x9'),auth[_0x0553('0xa')](),controller[_0x0553('0x13')]);router[_0x0553('0x14')]('/:id',auth[_0x0553('0xa')](),controller['destroy']);module[_0x0553('0x15')]=router; \ No newline at end of file +var _0x0531=['/:id/fields','create','addConfiguration','put','update','delete','multer','util','express','../../components/auth/service','../../components/interaction/service','../../config/environment','./intVtigerAccount.controller','get','isAuthenticated','index','/:id','/:id/configurations'];(function(_0x5af6fd,_0x350698){var _0x5a83ee=function(_0x4dd6b9){while(--_0x4dd6b9){_0x5af6fd['push'](_0x5af6fd['shift']());}};_0x5a83ee(++_0x350698);}(_0x0531,0xde));var _0x1053=function(_0x5e77db,_0x356d1c){_0x5e77db=_0x5e77db-0x0;var _0x34b675=_0x0531[_0x5e77db];return _0x34b675;};'use strict';var multer=require(_0x1053('0x0'));var util=require(_0x1053('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0x1053('0x2'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0x1053('0x3'));var interaction=require(_0x1053('0x4'));var config=require(_0x1053('0x5'));var controller=require(_0x1053('0x6'));router[_0x1053('0x7')]('/',auth[_0x1053('0x8')](),controller[_0x1053('0x9')]);router[_0x1053('0x7')](_0x1053('0xa'),auth[_0x1053('0x8')](),controller['show']);router[_0x1053('0x7')](_0x1053('0xb'),auth[_0x1053('0x8')](),controller['getConfigurations']);router[_0x1053('0x7')](_0x1053('0xc'),auth[_0x1053('0x8')](),controller['getFields']);router['post']('/',auth[_0x1053('0x8')](),controller[_0x1053('0xd')]);router['post'](_0x1053('0xb'),auth[_0x1053('0x8')](),controller[_0x1053('0xe')]);router[_0x1053('0xf')](_0x1053('0xa'),auth[_0x1053('0x8')](),controller[_0x1053('0x10')]);router[_0x1053('0x11')](_0x1053('0xa'),auth[_0x1053('0x8')](),controller['destroy']);module['exports']=router; \ No newline at end of file diff --git a/server/api/intVtigerAccount/intVtigerAccount.attributes.js b/server/api/intVtigerAccount/intVtigerAccount.attributes.js index 711d364..df39105 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 _0x8cdf=['exports','STRING','sequelize'];(function(_0x386306,_0x1363c9){var _0xcb23d=function(_0x1fc525){while(--_0x1fc525){_0x386306['push'](_0x386306['shift']());}};_0xcb23d(++_0x1363c9);}(_0x8cdf,0x134));var _0xf8cd=function(_0x549ef3,_0x19bc63){_0x549ef3=_0x549ef3-0x0;var _0x16d550=_0x8cdf[_0x549ef3];return _0x16d550;};'use strict';var Sequelize=require(_0xf8cd('0x0'));module[_0xf8cd('0x1')]={'name':{'type':Sequelize[_0xf8cd('0x2')],'allowNull':![]},'description':{'type':Sequelize[_0xf8cd('0x2')]},'username':{'type':Sequelize[_0xf8cd('0x2')],'allowNull':![]},'moduleName':{'type':Sequelize[_0xf8cd('0x2')],'allowNull':![],'defaultValue':'HelpDesk'},'remoteUri':{'type':Sequelize[_0xf8cd('0x2')],'allowNull':![]},'serverUrl':{'type':Sequelize[_0xf8cd('0x2')],'allowNull':![]},'accessKey':{'type':Sequelize['STRING'],'allowNull':![]}}; \ No newline at end of file +var _0x6a6f=['HelpDesk','sequelize','exports','STRING'];(function(_0x3ae9dd,_0x191e2f){var _0x593c5a=function(_0x22a90d){while(--_0x22a90d){_0x3ae9dd['push'](_0x3ae9dd['shift']());}};_0x593c5a(++_0x191e2f);}(_0x6a6f,0x135));var _0xf6a6=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x6a6f[_0x3dd15e];return _0x231fd0;};'use strict';var Sequelize=require(_0xf6a6('0x0'));module[_0xf6a6('0x1')]={'name':{'type':Sequelize['STRING'],'allowNull':![]},'description':{'type':Sequelize[_0xf6a6('0x2')]},'username':{'type':Sequelize[_0xf6a6('0x2')],'allowNull':![]},'moduleName':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':_0xf6a6('0x3')},'remoteUri':{'type':Sequelize['STRING'],'allowNull':![]},'serverUrl':{'type':Sequelize[_0xf6a6('0x2')],'allowNull':![]},'accessKey':{'type':Sequelize['STRING'],'allowNull':![]}}; \ No newline at end of file diff --git a/server/api/intVtigerAccount/intVtigerAccount.controller.js b/server/api/intVtigerAccount/intVtigerAccount.controller.js index 6cb2ea5..2ac88ec 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 _0x98f7=['nolimit','order','sort','pick','filter','where','merge','VIRTUAL','options','includeAll','findAll','rows','show','params','include','find','catch','create','body','update','findOne','VtigerConfiguration','hasOwnProperty','getConfigurations','addConfiguration','AccountId','getSubjects','channel','Descriptions','getDescriptions','VtigerField','Subjects','getFields','username','moduleName','serverUrl','accessKey','slice','substring','format','%s/webservice.php','GET','getchallenge','success','POST','login','token','describe','result','autogenerated','owner','remove','includes','false','label','startsWith','picklist','picklistValues','value','vTiger\x20error:\x20','stringify','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','util','path','sox','to-csv','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','set','apply','reject','save','destroy','then','error','stack','name','send','index','map','VtigerAccount','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','length'];(function(_0x2de905,_0x198ee8){var _0x251152=function(_0x5d7ad3){while(--_0x5d7ad3){_0x2de905['push'](_0x2de905['shift']());}};_0x251152(++_0x198ee8);}(_0x98f7,0x1a8));var _0x798f=function(_0x35c46b,_0xb32428){_0x35c46b=_0x35c46b-0x0;var _0x49ac37=_0x98f7[_0x35c46b];return _0x49ac37;};'use strict';var emlformat=require(_0x798f('0x0'));var rimraf=require(_0x798f('0x1'));var zipdir=require(_0x798f('0x2'));var jsonpatch=require(_0x798f('0x3'));var rp=require(_0x798f('0x4'));var moment=require(_0x798f('0x5'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0x798f('0x6'));var path=require(_0x798f('0x7'));var sox=require(_0x798f('0x8'));var csv=require(_0x798f('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x798f('0xa'));var squel=require(_0x798f('0xb'));var crypto=require(_0x798f('0xc'));var jsforce=require(_0x798f('0xd'));var deskjs=require(_0x798f('0xe'));var toCsv=require(_0x798f('0x9'));var querystring=require(_0x798f('0xf'));var Papa=require(_0x798f('0x10'));var Redis=require(_0x798f('0x11'));var authService=require('../../components/auth/service');var qs=require(_0x798f('0x12'));var as=require(_0x798f('0x13'));var hardwareService=require(_0x798f('0x14'));var logger=require(_0x798f('0x15'))(_0x798f('0x16'));var utils=require(_0x798f('0x17'));var config=require(_0x798f('0x18'));var licenseUtil=require(_0x798f('0x19'));var db=require(_0x798f('0x1a'))['db'];var integrations=require('../../components/integrations/configuration');function respondWithStatusCode(_0x13ec06,_0x5b69f4){_0x5b69f4=_0x5b69f4||0xcc;return function(_0x261854){if(_0x261854){return _0x13ec06[_0x798f('0x1b')](_0x5b69f4);}return _0x13ec06[_0x798f('0x1c')](_0x5b69f4)[_0x798f('0x1d')]();};}function respondWithResult(_0x33806f,_0x2582e0){_0x2582e0=_0x2582e0||0xc8;return function(_0x59e08b){if(_0x59e08b){return _0x33806f['status'](_0x2582e0)[_0x798f('0x1e')](_0x59e08b);}};}function respondWithFilteredResult(_0x2b134a,_0x44dd3b){return function(_0x38de59){if(_0x38de59){var _0x59b94f=typeof _0x44dd3b[_0x798f('0x1f')]===_0x798f('0x20')&&typeof _0x44dd3b[_0x798f('0x21')]===_0x798f('0x20');var _0x3b5f98=_0x38de59[_0x798f('0x22')];var _0x2c6cef=_0x59b94f?0x0:_0x44dd3b['offset'];var _0x2bf2f2=_0x59b94f?_0x38de59['count']:_0x44dd3b[_0x798f('0x1f')]+_0x44dd3b['limit'];var _0x990413;if(_0x2bf2f2>=_0x3b5f98){_0x2bf2f2=_0x3b5f98;_0x990413=0xc8;}else{_0x990413=0xce;}_0x2b134a[_0x798f('0x1c')](_0x990413);return _0x2b134a[_0x798f('0x23')]('Content-Range',_0x2c6cef+'-'+_0x2bf2f2+'/'+_0x3b5f98)[_0x798f('0x1e')](_0x38de59);}return null;};}function patchUpdates(_0x2d0a41){return function(_0x228080){try{jsonpatch[_0x798f('0x24')](_0x228080,_0x2d0a41,!![]);}catch(_0x24a4bf){return BPromise[_0x798f('0x25')](_0x24a4bf);}return _0x228080[_0x798f('0x26')]();};}function saveUpdates(_0x10bf8f,_0x4222ae){return function(_0x22fbef){if(_0x22fbef){return _0x22fbef['update'](_0x10bf8f)['then'](function(_0x18fbd8){return _0x18fbd8;});}return null;};}function removeEntity(_0x51484f,_0x42d765){return function(_0x2dbd38){if(_0x2dbd38){return _0x2dbd38[_0x798f('0x27')]()[_0x798f('0x28')](function(){_0x51484f[_0x798f('0x1c')](0xcc)['end']();});}};}function handleEntityNotFound(_0x4cc613,_0x496169){return function(_0x9ac20){if(!_0x9ac20){_0x4cc613[_0x798f('0x1b')](0x194);}return _0x9ac20;};}function handleError(_0x1258dd,_0x18a05f){_0x18a05f=_0x18a05f||0x1f4;return function(_0x4b91b0){logger[_0x798f('0x29')](_0x4b91b0[_0x798f('0x2a')]);if(_0x4b91b0[_0x798f('0x2b')]){delete _0x4b91b0[_0x798f('0x2b')];}_0x1258dd[_0x798f('0x1c')](_0x18a05f)[_0x798f('0x2c')](_0x4b91b0);};}exports[_0x798f('0x2d')]=function(_0x5e8bec,_0x3673e9){var _0x33d9c0={},_0x25643c={},_0x5c6338={'count':0x0,'rows':[]};var _0x3367ae=_[_0x798f('0x2e')](db[_0x798f('0x2f')][_0x798f('0x30')],function(_0xef86d3){return{'name':_0xef86d3[_0x798f('0x31')],'type':_0xef86d3[_0x798f('0x32')][_0x798f('0x33')]};});_0x25643c[_0x798f('0x34')]=_[_0x798f('0x2e')](_0x3367ae,'name');_0x25643c[_0x798f('0x35')]=_[_0x798f('0x36')](_0x5e8bec[_0x798f('0x35')]);_0x25643c[_0x798f('0x37')]=_[_0x798f('0x38')](_0x25643c[_0x798f('0x34')],_0x25643c['query']);_0x33d9c0[_0x798f('0x39')]=_['intersection'](_0x25643c[_0x798f('0x34')],qs[_0x798f('0x3a')](_0x5e8bec[_0x798f('0x35')][_0x798f('0x3a')]));_0x33d9c0[_0x798f('0x39')]=_0x33d9c0[_0x798f('0x39')][_0x798f('0x3b')]?_0x33d9c0[_0x798f('0x39')]:_0x25643c['model'];if(!_0x5e8bec[_0x798f('0x35')]['hasOwnProperty'](_0x798f('0x3c'))){_0x33d9c0[_0x798f('0x21')]=qs[_0x798f('0x21')](_0x5e8bec['query'][_0x798f('0x21')]);_0x33d9c0[_0x798f('0x1f')]=qs[_0x798f('0x1f')](_0x5e8bec[_0x798f('0x35')][_0x798f('0x1f')]);}_0x33d9c0[_0x798f('0x3d')]=qs['sort'](_0x5e8bec[_0x798f('0x35')][_0x798f('0x3e')]);_0x33d9c0['where']=qs[_0x798f('0x37')](_[_0x798f('0x3f')](_0x5e8bec[_0x798f('0x35')],_0x25643c[_0x798f('0x37')]),_0x3367ae);if(_0x5e8bec[_0x798f('0x35')][_0x798f('0x40')]){_0x33d9c0[_0x798f('0x41')]=_[_0x798f('0x42')](_0x33d9c0[_0x798f('0x41')],{'$or':_[_0x798f('0x2e')](_0x3367ae,function(_0x2ddbf5){if(_0x2ddbf5[_0x798f('0x32')]!==_0x798f('0x43')){var _0x41e5e4={};_0x41e5e4[_0x2ddbf5[_0x798f('0x2b')]]={'$like':'%'+_0x5e8bec[_0x798f('0x35')][_0x798f('0x40')]+'%'};return _0x41e5e4;}})});}_0x33d9c0=_[_0x798f('0x42')]({},_0x33d9c0,_0x5e8bec[_0x798f('0x44')]);var _0x3b09d1={'where':_0x33d9c0['where']};return db[_0x798f('0x2f')][_0x798f('0x22')](_0x3b09d1)[_0x798f('0x28')](function(_0x4b4e76){_0x5c6338[_0x798f('0x22')]=_0x4b4e76;if(_0x5e8bec[_0x798f('0x35')][_0x798f('0x45')]){_0x33d9c0['include']=[{'all':!![]}];}return db['VtigerAccount'][_0x798f('0x46')](_0x33d9c0);})[_0x798f('0x28')](function(_0x40930d){_0x5c6338[_0x798f('0x47')]=_0x40930d;return _0x5c6338;})['then'](respondWithFilteredResult(_0x3673e9,_0x33d9c0))['catch'](handleError(_0x3673e9,null));};exports[_0x798f('0x48')]=function(_0x199d83,_0x3b1208){var _0x5e63fc={'raw':![],'where':{'id':_0x199d83[_0x798f('0x49')]['id']}},_0x13d40a={};_0x13d40a['model']=_[_0x798f('0x36')](db[_0x798f('0x2f')][_0x798f('0x30')]);_0x13d40a[_0x798f('0x35')]=_['keys'](_0x199d83[_0x798f('0x35')]);_0x13d40a[_0x798f('0x37')]=_[_0x798f('0x38')](_0x13d40a['model'],_0x13d40a[_0x798f('0x35')]);_0x5e63fc[_0x798f('0x39')]=_['intersection'](_0x13d40a[_0x798f('0x34')],qs[_0x798f('0x3a')](_0x199d83[_0x798f('0x35')][_0x798f('0x3a')]));_0x5e63fc[_0x798f('0x39')]=_0x5e63fc[_0x798f('0x39')][_0x798f('0x3b')]?_0x5e63fc[_0x798f('0x39')]:_0x13d40a['model'];if(_0x199d83[_0x798f('0x35')]['includeAll']){_0x5e63fc[_0x798f('0x4a')]=[{'all':!![]}];}_0x5e63fc=_['merge']({},_0x5e63fc,_0x199d83[_0x798f('0x44')]);return db[_0x798f('0x2f')][_0x798f('0x4b')](_0x5e63fc)[_0x798f('0x28')](handleEntityNotFound(_0x3b1208,null))['then'](respondWithResult(_0x3b1208,null))[_0x798f('0x4c')](handleError(_0x3b1208,null));};exports[_0x798f('0x4d')]=function(_0x557cb8,_0x4ff2e5){return db[_0x798f('0x2f')]['create'](_0x557cb8[_0x798f('0x4e')],{})[_0x798f('0x28')](respondWithResult(_0x4ff2e5,0xc9))[_0x798f('0x4c')](handleError(_0x4ff2e5,null));};exports[_0x798f('0x4f')]=function(_0x2e84da,_0x572f65){if(_0x2e84da['body']['id']){delete _0x2e84da[_0x798f('0x4e')]['id'];}return db[_0x798f('0x2f')][_0x798f('0x4b')]({'where':{'id':_0x2e84da[_0x798f('0x49')]['id']}})[_0x798f('0x28')](handleEntityNotFound(_0x572f65,null))[_0x798f('0x28')](saveUpdates(_0x2e84da[_0x798f('0x4e')],null))[_0x798f('0x28')](respondWithResult(_0x572f65,null))[_0x798f('0x4c')](handleError(_0x572f65,null));};exports[_0x798f('0x27')]=function(_0x222cf8,_0xe41bdb){return db['VtigerAccount'][_0x798f('0x4b')]({'where':{'id':_0x222cf8[_0x798f('0x49')]['id']}})['then'](handleEntityNotFound(_0xe41bdb,null))[_0x798f('0x28')](removeEntity(_0xe41bdb,null))[_0x798f('0x4c')](handleError(_0xe41bdb,null));};exports['getConfigurations']=function(_0x3ae00a,_0x38a06c,_0x50fd46){var _0x3f738c={};var _0x5b9361={};var _0x44925f;var _0x17baff;return db[_0x798f('0x2f')][_0x798f('0x50')]({'where':{'id':_0x3ae00a[_0x798f('0x49')]['id']}})[_0x798f('0x28')](handleEntityNotFound(_0x38a06c,null))[_0x798f('0x28')](function(_0x45a561){if(_0x45a561){_0x44925f=_0x45a561;_0x5b9361[_0x798f('0x34')]=_[_0x798f('0x36')](db[_0x798f('0x51')][_0x798f('0x30')]);_0x5b9361['query']=_[_0x798f('0x36')](_0x3ae00a[_0x798f('0x35')]);_0x5b9361[_0x798f('0x37')]=_[_0x798f('0x38')](_0x5b9361[_0x798f('0x34')],_0x5b9361[_0x798f('0x35')]);_0x3f738c['attributes']=_['intersection'](_0x5b9361[_0x798f('0x34')],qs['fields'](_0x3ae00a[_0x798f('0x35')][_0x798f('0x3a')]));_0x3f738c[_0x798f('0x39')]=_0x3f738c[_0x798f('0x39')][_0x798f('0x3b')]?_0x3f738c[_0x798f('0x39')]:_0x5b9361[_0x798f('0x34')];_0x3f738c['order']=qs[_0x798f('0x3e')](_0x3ae00a[_0x798f('0x35')][_0x798f('0x3e')]);_0x3f738c[_0x798f('0x41')]=qs[_0x798f('0x37')](_[_0x798f('0x3f')](_0x3ae00a[_0x798f('0x35')],_0x5b9361[_0x798f('0x37')]));if(_0x3ae00a[_0x798f('0x35')]['filter']){_0x3f738c['where']=_[_0x798f('0x42')](_0x3f738c['where'],{'$or':_[_0x798f('0x2e')](_0x3f738c[_0x798f('0x39')],function(_0x13b619){var _0x593370={};_0x593370[_0x13b619]={'$like':'%'+_0x3ae00a['query'][_0x798f('0x40')]+'%'};return _0x593370;})});}_0x3f738c=_[_0x798f('0x42')]({},_0x3f738c,_0x3ae00a['options']);return _0x44925f['getConfigurations'](_0x3f738c);}})[_0x798f('0x28')](function(_0x2278d1){if(_0x2278d1){_0x17baff=_0x2278d1['length'];if(!_0x3ae00a[_0x798f('0x35')][_0x798f('0x52')](_0x798f('0x3c'))){_0x3f738c['limit']=qs['limit'](_0x3ae00a[_0x798f('0x35')]['limit']);_0x3f738c[_0x798f('0x1f')]=qs[_0x798f('0x1f')](_0x3ae00a[_0x798f('0x35')][_0x798f('0x1f')]);}return _0x44925f[_0x798f('0x53')](_0x3f738c);}})['then'](function(_0x4073a6){if(_0x4073a6){return _0x4073a6?{'count':_0x17baff,'rows':_0x4073a6}:null;}})[_0x798f('0x28')](respondWithResult(_0x38a06c,null))[_0x798f('0x4c')](handleError(_0x38a06c,null));};exports[_0x798f('0x54')]=function(_0x15d7d5,_0x3f0343,_0x22b734){if(_0x15d7d5[_0x798f('0x4e')]['id']){delete _0x15d7d5[_0x798f('0x4e')]['id'];}return db[_0x798f('0x2f')]['findOne']({'where':{'id':_0x15d7d5[_0x798f('0x49')]['id']}})[_0x798f('0x28')](handleEntityNotFound(_0x3f0343,null))[_0x798f('0x28')](function(_0x3907b2){if(_0x3907b2){_0x15d7d5[_0x798f('0x4e')][_0x798f('0x55')]=_0x3907b2['id'];_0x15d7d5[_0x798f('0x4e')]['Subjects']=integrations[_0x798f('0x56')](_0x15d7d5['body'][_0x798f('0x57')],_0x15d7d5[_0x798f('0x4e')][_0x798f('0x32')]);_0x15d7d5[_0x798f('0x4e')][_0x798f('0x58')]=integrations[_0x798f('0x59')](_0x15d7d5[_0x798f('0x4e')][_0x798f('0x57')],_0x15d7d5[_0x798f('0x4e')]['type']);return db['VtigerConfiguration'][_0x798f('0x4d')](_0x15d7d5[_0x798f('0x4e')],{'include':[{'model':db[_0x798f('0x5a')],'as':_0x798f('0x5b')},{'model':db[_0x798f('0x5a')],'as':_0x798f('0x58')}]});}return null;})[_0x798f('0x28')](respondWithResult(_0x3f0343,null))[_0x798f('0x4c')](handleError(_0x3f0343,null));};var md5=require('md5');exports[_0x798f('0x5c')]=function(_0x52c3a8,_0x57b4f9,_0x735d4a){var _0x38fb31=null;var _0x253ac4=null;var _0x2e2939=null;var _0x35fc82=null;var _0x4327d7='';return db['VtigerAccount'][_0x798f('0x50')]({'where':{'id':_0x52c3a8[_0x798f('0x49')]['id']},'attributes':['id',_0x798f('0x2b'),_0x798f('0x5d'),'description',_0x798f('0x5e'),'remoteUri',_0x798f('0x5f'),_0x798f('0x60')]})[_0x798f('0x28')](handleEntityNotFound(_0x57b4f9,null))[_0x798f('0x28')](function(_0x5645fd){if(_0x5645fd){_0x38fb31=_0x5645fd[_0x798f('0x5d')];_0x253ac4=_0x5645fd[_0x798f('0x60')];_0x2e2939=_0x5645fd['moduleName'];_0x4327d7=_0x5645fd['remoteUri'];var _0x18092a=_0x4327d7[_0x798f('0x61')](-0x1);if(_0x18092a==='/'){_0x4327d7=_0x4327d7[_0x798f('0x62')](0x0,_0x4327d7['lastIndexOf'](_0x18092a));}_0x35fc82=util[_0x798f('0x63')](_0x798f('0x64'),_0x4327d7);var _0x499edc={'method':_0x798f('0x65'),'uri':_0x35fc82,'qs':{'operation':_0x798f('0x66'),'username':_0x5645fd['username']},'json':!![]};return rp(_0x499edc);}})[_0x798f('0x28')](function(_0x449b18){if(_0x449b18[_0x798f('0x67')]){var _0x1bc378={'method':_0x798f('0x68'),'uri':_0x35fc82,'form':{'operation':_0x798f('0x69'),'username':_0x38fb31,'accessKey':md5(_0x449b18['result'][_0x798f('0x6a')]+_0x253ac4)},'json':!![]};return rp(_0x1bc378);}})['then'](function(_0x265f3b){if(_0x265f3b[_0x798f('0x67')]){var _0x4a0c8b={'method':_0x798f('0x65'),'uri':_0x35fc82,'qs':{'operation':_0x798f('0x6b'),'username':_0x38fb31,'sessionName':_0x265f3b[_0x798f('0x6c')]['sessionName'],'elementType':_0x2e2939},'json':!![]};return rp(_0x4a0c8b);}})[_0x798f('0x28')](function(_0x50633b){if(_0x50633b[_0x798f('0x67')]){var _0x1ebd31=[_0x798f('0x6d'),'reference',_0x798f('0x6e')];_[_0x798f('0x6f')](_0x50633b[_0x798f('0x6c')][_0x798f('0x3a')],function(_0x12108b){return _0x1ebd31[_0x798f('0x70')](_0x12108b['type'][_0x798f('0x2b')]);});_[_0x798f('0x6f')](_0x50633b[_0x798f('0x6c')][_0x798f('0x3a')],function(_0x2164a0){return _0x2164a0['editable']===_0x798f('0x71');});return{'count':_0x50633b[_0x798f('0x6c')][_0x798f('0x3a')]['length'],'rows':_[_0x798f('0x2e')](_0x50633b[_0x798f('0x6c')][_0x798f('0x3a')],function(_0x485748){return{'id':_0x485748['name'],'name':_0x485748[_0x798f('0x72')],'custom':_[_0x798f('0x73')](_0x485748[_0x798f('0x2b')],'cf_')?!![]:![],'options':_0x485748[_0x798f('0x32')][_0x798f('0x2b')]===_0x798f('0x74')&&_0x485748['type'][_0x798f('0x75')][_0x798f('0x3b')]>0x0?_[_0x798f('0x2e')](_0x485748[_0x798f('0x32')]['picklistValues'],function(_0xc418c9){return{'name':_0xc418c9[_0x798f('0x72')],'value':_0xc418c9[_0x798f('0x76')]};}):[]};})};}})['then'](respondWithResult(_0x57b4f9,null))[_0x798f('0x4c')](function(_0x53ac03){console['log'](_0x798f('0x77')+_0x53ac03);var _0x23110c=_0x52c3a8[_0x798f('0x35')]['test']?0x1f4:_0x53ac03['statusCode']||0x1f4;logger['error']('getFields,\x20%s,\x20%s,\x20%s','getFields',_0x23110c,JSON[_0x798f('0x78')](_0x53ac03));delete _0x53ac03[_0x798f('0x2b')];if(_0x23110c===0x191){_0x23110c=0x190;}_0x57b4f9['status'](_0x23110c)[_0x798f('0x2c')](_0x52c3a8[_0x798f('0x35')]['test']?{'message':'Wrong\x20credentials','statusCode':_0x53ac03['statusCode']}:_0x53ac03);});}; \ No newline at end of file +var _0x1b7e=['getchallenge','POST','login','result','token','success','autogenerated','reference','owner','remove','includes','editable','cf_','label','value','log','test','error','getFields','stringify','statusCode','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','to-csv','ejs','fs-extra','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','end','status','json','undefined','count','offset','Content-Range','save','then','destroy','stack','name','index','map','type','model','query','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','limit','sort','pick','merge','filter','options','where','VtigerAccount','includeAll','include','findAll','rows','catch','show','params','keys','rawAttributes','create','body','update','find','getConfigurations','findOne','AccountId','Subjects','getSubjects','channel','Descriptions','getDescriptions','VtigerConfiguration','VtigerField','md5','description','moduleName','remoteUri','username','accessKey','slice','substring','lastIndexOf','format','%s/webservice.php','GET'];(function(_0x5c4ef6,_0x4e702d){var _0x49d22b=function(_0x386846){while(--_0x386846){_0x5c4ef6['push'](_0x5c4ef6['shift']());}};_0x49d22b(++_0x4e702d);}(_0x1b7e,0x88));var _0xe1b7=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x1b7e[_0x3dd15e];return _0x231fd0;};'use strict';var emlformat=require(_0xe1b7('0x0'));var rimraf=require(_0xe1b7('0x1'));var zipdir=require(_0xe1b7('0x2'));var jsonpatch=require(_0xe1b7('0x3'));var rp=require(_0xe1b7('0x4'));var moment=require(_0xe1b7('0x5'));var BPromise=require(_0xe1b7('0x6'));var Mustache=require(_0xe1b7('0x7'));var util=require(_0xe1b7('0x8'));var path=require(_0xe1b7('0x9'));var sox=require('sox');var csv=require(_0xe1b7('0xa'));var ejs=require(_0xe1b7('0xb'));var fs=require('fs');var fs_extra=require(_0xe1b7('0xc'));var _=require('lodash');var squel=require(_0xe1b7('0xd'));var crypto=require(_0xe1b7('0xe'));var jsforce=require(_0xe1b7('0xf'));var deskjs=require(_0xe1b7('0x10'));var toCsv=require(_0xe1b7('0xa'));var querystring=require(_0xe1b7('0x11'));var Papa=require(_0xe1b7('0x12'));var Redis=require(_0xe1b7('0x13'));var authService=require(_0xe1b7('0x14'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xe1b7('0x15'));var logger=require(_0xe1b7('0x16'))(_0xe1b7('0x17'));var utils=require(_0xe1b7('0x18'));var config=require(_0xe1b7('0x19'));var licenseUtil=require('../../config/license/util');var db=require(_0xe1b7('0x1a'))['db'];var integrations=require('../../components/integrations/configuration');function respondWithStatusCode(_0x334937,_0x5db432){_0x5db432=_0x5db432||0xcc;return function(_0x1cccee){if(_0x1cccee){return _0x334937['sendStatus'](_0x5db432);}return _0x334937['status'](_0x5db432)[_0xe1b7('0x1b')]();};}function respondWithResult(_0x1536c9,_0x414a2f){_0x414a2f=_0x414a2f||0xc8;return function(_0x577a38){if(_0x577a38){return _0x1536c9[_0xe1b7('0x1c')](_0x414a2f)[_0xe1b7('0x1d')](_0x577a38);}};}function respondWithFilteredResult(_0x3fcbbf,_0x53b64c){return function(_0x2918ed){if(_0x2918ed){var _0x1bf5d2=typeof _0x53b64c['offset']===_0xe1b7('0x1e')&&typeof _0x53b64c['limit']==='undefined';var _0x477c66=_0x2918ed['count'];var _0x5f5a8c=_0x1bf5d2?0x0:_0x53b64c['offset'];var _0x492c18=_0x1bf5d2?_0x2918ed[_0xe1b7('0x1f')]:_0x53b64c[_0xe1b7('0x20')]+_0x53b64c['limit'];var _0x3eb7b3;if(_0x492c18>=_0x477c66){_0x492c18=_0x477c66;_0x3eb7b3=0xc8;}else{_0x3eb7b3=0xce;}_0x3fcbbf[_0xe1b7('0x1c')](_0x3eb7b3);return _0x3fcbbf['set'](_0xe1b7('0x21'),_0x5f5a8c+'-'+_0x492c18+'/'+_0x477c66)[_0xe1b7('0x1d')](_0x2918ed);}return null;};}function patchUpdates(_0x179821){return function(_0x28a2ba){try{jsonpatch['apply'](_0x28a2ba,_0x179821,!![]);}catch(_0x227613){return BPromise['reject'](_0x227613);}return _0x28a2ba[_0xe1b7('0x22')]();};}function saveUpdates(_0x595cff,_0x4cc379){return function(_0x3b7335){if(_0x3b7335){return _0x3b7335['update'](_0x595cff)[_0xe1b7('0x23')](function(_0x298e81){return _0x298e81;});}return null;};}function removeEntity(_0x35ec21,_0x49f917){return function(_0x38bf40){if(_0x38bf40){return _0x38bf40[_0xe1b7('0x24')]()[_0xe1b7('0x23')](function(){_0x35ec21[_0xe1b7('0x1c')](0xcc)['end']();});}};}function handleEntityNotFound(_0x5138df,_0x462f40){return function(_0x2b602c){if(!_0x2b602c){_0x5138df['sendStatus'](0x194);}return _0x2b602c;};}function handleError(_0x48cfd4,_0x2db41c){_0x2db41c=_0x2db41c||0x1f4;return function(_0x409ad9){logger['error'](_0x409ad9[_0xe1b7('0x25')]);if(_0x409ad9[_0xe1b7('0x26')]){delete _0x409ad9['name'];}_0x48cfd4[_0xe1b7('0x1c')](_0x2db41c)['send'](_0x409ad9);};}exports[_0xe1b7('0x27')]=function(_0x1ec41a,_0x16e017){var _0x26181e={},_0x34ca9a={},_0x5127da={'count':0x0,'rows':[]};var _0x21ea2e=_[_0xe1b7('0x28')](db['VtigerAccount']['rawAttributes'],function(_0x5de9c9){return{'name':_0x5de9c9['fieldName'],'type':_0x5de9c9[_0xe1b7('0x29')]['key']};});_0x34ca9a[_0xe1b7('0x2a')]=_[_0xe1b7('0x28')](_0x21ea2e,_0xe1b7('0x26'));_0x34ca9a[_0xe1b7('0x2b')]=_['keys'](_0x1ec41a[_0xe1b7('0x2b')]);_0x34ca9a[_0xe1b7('0x2c')]=_[_0xe1b7('0x2d')](_0x34ca9a[_0xe1b7('0x2a')],_0x34ca9a['query']);_0x26181e['attributes']=_['intersection'](_0x34ca9a[_0xe1b7('0x2a')],qs[_0xe1b7('0x2e')](_0x1ec41a[_0xe1b7('0x2b')][_0xe1b7('0x2e')]));_0x26181e['attributes']=_0x26181e[_0xe1b7('0x2f')][_0xe1b7('0x30')]?_0x26181e[_0xe1b7('0x2f')]:_0x34ca9a[_0xe1b7('0x2a')];if(!_0x1ec41a[_0xe1b7('0x2b')][_0xe1b7('0x31')](_0xe1b7('0x32'))){_0x26181e[_0xe1b7('0x33')]=qs[_0xe1b7('0x33')](_0x1ec41a[_0xe1b7('0x2b')][_0xe1b7('0x33')]);_0x26181e[_0xe1b7('0x20')]=qs[_0xe1b7('0x20')](_0x1ec41a[_0xe1b7('0x2b')][_0xe1b7('0x20')]);}_0x26181e['order']=qs[_0xe1b7('0x34')](_0x1ec41a[_0xe1b7('0x2b')][_0xe1b7('0x34')]);_0x26181e['where']=qs[_0xe1b7('0x2c')](_[_0xe1b7('0x35')](_0x1ec41a['query'],_0x34ca9a['filters']),_0x21ea2e);if(_0x1ec41a['query']['filter']){_0x26181e['where']=_[_0xe1b7('0x36')](_0x26181e['where'],{'$or':_['map'](_0x21ea2e,function(_0x18bfb8){if(_0x18bfb8[_0xe1b7('0x29')]!=='VIRTUAL'){var _0x2859fd={};_0x2859fd[_0x18bfb8['name']]={'$like':'%'+_0x1ec41a[_0xe1b7('0x2b')][_0xe1b7('0x37')]+'%'};return _0x2859fd;}})});}_0x26181e=_[_0xe1b7('0x36')]({},_0x26181e,_0x1ec41a[_0xe1b7('0x38')]);var _0x119442={'where':_0x26181e[_0xe1b7('0x39')]};return db[_0xe1b7('0x3a')][_0xe1b7('0x1f')](_0x119442)[_0xe1b7('0x23')](function(_0x4a12a8){_0x5127da['count']=_0x4a12a8;if(_0x1ec41a['query'][_0xe1b7('0x3b')]){_0x26181e[_0xe1b7('0x3c')]=[{'all':!![]}];}return db[_0xe1b7('0x3a')][_0xe1b7('0x3d')](_0x26181e);})[_0xe1b7('0x23')](function(_0x3756ed){_0x5127da[_0xe1b7('0x3e')]=_0x3756ed;return _0x5127da;})[_0xe1b7('0x23')](respondWithFilteredResult(_0x16e017,_0x26181e))[_0xe1b7('0x3f')](handleError(_0x16e017,null));};exports[_0xe1b7('0x40')]=function(_0x2accca,_0x24856f){var _0xf5d136={'raw':![],'where':{'id':_0x2accca[_0xe1b7('0x41')]['id']}},_0x150cec={};_0x150cec[_0xe1b7('0x2a')]=_[_0xe1b7('0x42')](db[_0xe1b7('0x3a')][_0xe1b7('0x43')]);_0x150cec[_0xe1b7('0x2b')]=_[_0xe1b7('0x42')](_0x2accca[_0xe1b7('0x2b')]);_0x150cec[_0xe1b7('0x2c')]=_['intersection'](_0x150cec[_0xe1b7('0x2a')],_0x150cec[_0xe1b7('0x2b')]);_0xf5d136[_0xe1b7('0x2f')]=_['intersection'](_0x150cec[_0xe1b7('0x2a')],qs[_0xe1b7('0x2e')](_0x2accca[_0xe1b7('0x2b')][_0xe1b7('0x2e')]));_0xf5d136[_0xe1b7('0x2f')]=_0xf5d136[_0xe1b7('0x2f')]['length']?_0xf5d136[_0xe1b7('0x2f')]:_0x150cec[_0xe1b7('0x2a')];if(_0x2accca[_0xe1b7('0x2b')]['includeAll']){_0xf5d136[_0xe1b7('0x3c')]=[{'all':!![]}];}_0xf5d136=_[_0xe1b7('0x36')]({},_0xf5d136,_0x2accca[_0xe1b7('0x38')]);return db[_0xe1b7('0x3a')]['find'](_0xf5d136)[_0xe1b7('0x23')](handleEntityNotFound(_0x24856f,null))[_0xe1b7('0x23')](respondWithResult(_0x24856f,null))['catch'](handleError(_0x24856f,null));};exports['create']=function(_0x5ac334,_0x179056){return db[_0xe1b7('0x3a')][_0xe1b7('0x44')](_0x5ac334[_0xe1b7('0x45')],{})[_0xe1b7('0x23')](respondWithResult(_0x179056,0xc9))[_0xe1b7('0x3f')](handleError(_0x179056,null));};exports[_0xe1b7('0x46')]=function(_0x1f2d3d,_0x1baa5e){if(_0x1f2d3d[_0xe1b7('0x45')]['id']){delete _0x1f2d3d['body']['id'];}return db['VtigerAccount'][_0xe1b7('0x47')]({'where':{'id':_0x1f2d3d[_0xe1b7('0x41')]['id']}})[_0xe1b7('0x23')](handleEntityNotFound(_0x1baa5e,null))['then'](saveUpdates(_0x1f2d3d[_0xe1b7('0x45')],null))[_0xe1b7('0x23')](respondWithResult(_0x1baa5e,null))[_0xe1b7('0x3f')](handleError(_0x1baa5e,null));};exports[_0xe1b7('0x24')]=function(_0x2f9c58,_0x4167f0){return db[_0xe1b7('0x3a')][_0xe1b7('0x47')]({'where':{'id':_0x2f9c58['params']['id']}})['then'](handleEntityNotFound(_0x4167f0,null))[_0xe1b7('0x23')](removeEntity(_0x4167f0,null))[_0xe1b7('0x3f')](handleError(_0x4167f0,null));};exports[_0xe1b7('0x48')]=function(_0x25e115,_0x2f034d,_0x5cf460){var _0x58cf68={};var _0x3ea5f2={};var _0x13bb49;var _0x390c0d;return db[_0xe1b7('0x3a')][_0xe1b7('0x49')]({'where':{'id':_0x25e115[_0xe1b7('0x41')]['id']}})['then'](handleEntityNotFound(_0x2f034d,null))['then'](function(_0x5e8476){if(_0x5e8476){_0x13bb49=_0x5e8476;_0x3ea5f2[_0xe1b7('0x2a')]=_[_0xe1b7('0x42')](db['VtigerConfiguration'][_0xe1b7('0x43')]);_0x3ea5f2[_0xe1b7('0x2b')]=_[_0xe1b7('0x42')](_0x25e115[_0xe1b7('0x2b')]);_0x3ea5f2[_0xe1b7('0x2c')]=_[_0xe1b7('0x2d')](_0x3ea5f2[_0xe1b7('0x2a')],_0x3ea5f2[_0xe1b7('0x2b')]);_0x58cf68[_0xe1b7('0x2f')]=_[_0xe1b7('0x2d')](_0x3ea5f2[_0xe1b7('0x2a')],qs[_0xe1b7('0x2e')](_0x25e115[_0xe1b7('0x2b')][_0xe1b7('0x2e')]));_0x58cf68[_0xe1b7('0x2f')]=_0x58cf68[_0xe1b7('0x2f')][_0xe1b7('0x30')]?_0x58cf68[_0xe1b7('0x2f')]:_0x3ea5f2[_0xe1b7('0x2a')];_0x58cf68['order']=qs['sort'](_0x25e115[_0xe1b7('0x2b')][_0xe1b7('0x34')]);_0x58cf68['where']=qs[_0xe1b7('0x2c')](_['pick'](_0x25e115['query'],_0x3ea5f2[_0xe1b7('0x2c')]));if(_0x25e115[_0xe1b7('0x2b')]['filter']){_0x58cf68[_0xe1b7('0x39')]=_[_0xe1b7('0x36')](_0x58cf68['where'],{'$or':_[_0xe1b7('0x28')](_0x58cf68[_0xe1b7('0x2f')],function(_0x57774f){var _0x291ffc={};_0x291ffc[_0x57774f]={'$like':'%'+_0x25e115[_0xe1b7('0x2b')]['filter']+'%'};return _0x291ffc;})});}_0x58cf68=_['merge']({},_0x58cf68,_0x25e115['options']);return _0x13bb49[_0xe1b7('0x48')](_0x58cf68);}})[_0xe1b7('0x23')](function(_0x10bfb3){if(_0x10bfb3){_0x390c0d=_0x10bfb3[_0xe1b7('0x30')];if(!_0x25e115[_0xe1b7('0x2b')][_0xe1b7('0x31')]('nolimit')){_0x58cf68['limit']=qs['limit'](_0x25e115[_0xe1b7('0x2b')][_0xe1b7('0x33')]);_0x58cf68[_0xe1b7('0x20')]=qs['offset'](_0x25e115[_0xe1b7('0x2b')][_0xe1b7('0x20')]);}return _0x13bb49[_0xe1b7('0x48')](_0x58cf68);}})[_0xe1b7('0x23')](function(_0x481d26){if(_0x481d26){return _0x481d26?{'count':_0x390c0d,'rows':_0x481d26}:null;}})[_0xe1b7('0x23')](respondWithResult(_0x2f034d,null))[_0xe1b7('0x3f')](handleError(_0x2f034d,null));};exports['addConfiguration']=function(_0x24df96,_0x4febe4,_0x3e7813){if(_0x24df96[_0xe1b7('0x45')]['id']){delete _0x24df96[_0xe1b7('0x45')]['id'];}return db['VtigerAccount']['findOne']({'where':{'id':_0x24df96['params']['id']}})['then'](handleEntityNotFound(_0x4febe4,null))[_0xe1b7('0x23')](function(_0x29ff6e){if(_0x29ff6e){_0x24df96[_0xe1b7('0x45')][_0xe1b7('0x4a')]=_0x29ff6e['id'];_0x24df96[_0xe1b7('0x45')][_0xe1b7('0x4b')]=integrations[_0xe1b7('0x4c')](_0x24df96[_0xe1b7('0x45')][_0xe1b7('0x4d')],_0x24df96[_0xe1b7('0x45')][_0xe1b7('0x29')]);_0x24df96[_0xe1b7('0x45')][_0xe1b7('0x4e')]=integrations[_0xe1b7('0x4f')](_0x24df96[_0xe1b7('0x45')][_0xe1b7('0x4d')],_0x24df96[_0xe1b7('0x45')][_0xe1b7('0x29')]);return db[_0xe1b7('0x50')][_0xe1b7('0x44')](_0x24df96['body'],{'include':[{'model':db[_0xe1b7('0x51')],'as':'Subjects'},{'model':db[_0xe1b7('0x51')],'as':_0xe1b7('0x4e')}]});}return null;})['then'](respondWithResult(_0x4febe4,null))[_0xe1b7('0x3f')](handleError(_0x4febe4,null));};var md5=require(_0xe1b7('0x52'));exports['getFields']=function(_0x3b69ba,_0x172bb7,_0x4c209b){var _0x516edb=null;var _0x1cc238=null;var _0x556f3c=null;var _0x37f048=null;var _0x1f307f='';return db[_0xe1b7('0x3a')]['findOne']({'where':{'id':_0x3b69ba[_0xe1b7('0x41')]['id']},'attributes':['id',_0xe1b7('0x26'),'username',_0xe1b7('0x53'),_0xe1b7('0x54'),_0xe1b7('0x55'),'serverUrl','accessKey']})[_0xe1b7('0x23')](handleEntityNotFound(_0x172bb7,null))[_0xe1b7('0x23')](function(_0x180719){if(_0x180719){_0x516edb=_0x180719[_0xe1b7('0x56')];_0x1cc238=_0x180719[_0xe1b7('0x57')];_0x556f3c=_0x180719['moduleName'];_0x1f307f=_0x180719[_0xe1b7('0x55')];var _0x570ed3=_0x1f307f[_0xe1b7('0x58')](-0x1);if(_0x570ed3==='/'){_0x1f307f=_0x1f307f[_0xe1b7('0x59')](0x0,_0x1f307f[_0xe1b7('0x5a')](_0x570ed3));}_0x37f048=util[_0xe1b7('0x5b')](_0xe1b7('0x5c'),_0x1f307f);var _0x2c702f={'method':_0xe1b7('0x5d'),'uri':_0x37f048,'qs':{'operation':_0xe1b7('0x5e'),'username':_0x180719['username']},'json':!![]};return rp(_0x2c702f);}})[_0xe1b7('0x23')](function(_0x2efae6){if(_0x2efae6['success']){var _0x50de18={'method':_0xe1b7('0x5f'),'uri':_0x37f048,'form':{'operation':_0xe1b7('0x60'),'username':_0x516edb,'accessKey':md5(_0x2efae6[_0xe1b7('0x61')][_0xe1b7('0x62')]+_0x1cc238)},'json':!![]};return rp(_0x50de18);}})['then'](function(_0x145d82){if(_0x145d82[_0xe1b7('0x63')]){var _0x757cae={'method':_0xe1b7('0x5d'),'uri':_0x37f048,'qs':{'operation':'describe','username':_0x516edb,'sessionName':_0x145d82[_0xe1b7('0x61')]['sessionName'],'elementType':_0x556f3c},'json':!![]};return rp(_0x757cae);}})[_0xe1b7('0x23')](function(_0x214499){if(_0x214499[_0xe1b7('0x63')]){var _0x250898=[_0xe1b7('0x64'),_0xe1b7('0x65'),_0xe1b7('0x66')];_[_0xe1b7('0x67')](_0x214499['result'][_0xe1b7('0x2e')],function(_0x29e011){return _0x250898[_0xe1b7('0x68')](_0x29e011[_0xe1b7('0x29')][_0xe1b7('0x26')]);});_[_0xe1b7('0x67')](_0x214499[_0xe1b7('0x61')][_0xe1b7('0x2e')],function(_0x512807){return _0x512807[_0xe1b7('0x69')]==='false';});return{'count':_0x214499[_0xe1b7('0x61')]['fields'][_0xe1b7('0x30')],'rows':_[_0xe1b7('0x28')](_0x214499[_0xe1b7('0x61')][_0xe1b7('0x2e')],function(_0x2bfad4){return{'id':_0x2bfad4[_0xe1b7('0x26')],'name':_0x2bfad4['label'],'custom':_['startsWith'](_0x2bfad4['name'],_0xe1b7('0x6a'))?!![]:![],'options':_0x2bfad4['type'][_0xe1b7('0x26')]==='picklist'&&_0x2bfad4[_0xe1b7('0x29')]['picklistValues']['length']>0x0?_[_0xe1b7('0x28')](_0x2bfad4['type']['picklistValues'],function(_0x1c7bb5){return{'name':_0x1c7bb5[_0xe1b7('0x6b')],'value':_0x1c7bb5[_0xe1b7('0x6c')]};}):[]};})};}})[_0xe1b7('0x23')](respondWithResult(_0x172bb7,null))[_0xe1b7('0x3f')](function(_0x1a5f8e){console[_0xe1b7('0x6d')]('vTiger\x20error:\x20'+_0x1a5f8e);var _0x1cbfec=_0x3b69ba[_0xe1b7('0x2b')][_0xe1b7('0x6e')]?0x1f4:_0x1a5f8e['statusCode']||0x1f4;logger[_0xe1b7('0x6f')]('getFields,\x20%s,\x20%s,\x20%s',_0xe1b7('0x70'),_0x1cbfec,JSON[_0xe1b7('0x71')](_0x1a5f8e));delete _0x1a5f8e[_0xe1b7('0x26')];if(_0x1cbfec===0x191){_0x1cbfec=0x190;}_0x172bb7[_0xe1b7('0x1c')](_0x1cbfec)['send'](_0x3b69ba[_0xe1b7('0x2b')][_0xe1b7('0x6e')]?{'message':'Wrong\x20credentials','statusCode':_0x1a5f8e[_0xe1b7('0x72')]}:_0x1a5f8e);});}; \ No newline at end of file diff --git a/server/api/intVtigerAccount/intVtigerAccount.model.js b/server/api/intVtigerAccount/intVtigerAccount.model.js index 15d86e8..12818a3 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 _0xd4ae=['bluebird','request-promise','path','rimraf','../../config/environment','./intVtigerAccount.attributes','exports','define','VtigerAccount','int_vtiger_accounts','lodash','util','../../config/logger','api','moment'];(function(_0x3569ae,_0x3c6f42){var _0x5eb875=function(_0x204a24){while(--_0x204a24){_0x3569ae['push'](_0x3569ae['shift']());}};_0x5eb875(++_0x3c6f42);}(_0xd4ae,0x181));var _0xed4a=function(_0x2a9153,_0x44fd73){_0x2a9153=_0x2a9153-0x0;var _0x2f6615=_0xd4ae[_0x2a9153];return _0x2f6615;};'use strict';var _=require(_0xed4a('0x0'));var util=require(_0xed4a('0x1'));var logger=require(_0xed4a('0x2'))(_0xed4a('0x3'));var moment=require(_0xed4a('0x4'));var BPromise=require(_0xed4a('0x5'));var rp=require(_0xed4a('0x6'));var fs=require('fs');var path=require(_0xed4a('0x7'));var rimraf=require(_0xed4a('0x8'));var config=require(_0xed4a('0x9'));var attributes=require(_0xed4a('0xa'));var integrations=require('../../components/integrations/configuration');module[_0xed4a('0xb')]=function(_0x502e4b,_0x4bc09c){return _0x502e4b[_0xed4a('0xc')](_0xed4a('0xd'),attributes,{'tableName':_0xed4a('0xe'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x8e6a=['../../config/environment','../../components/integrations/configuration','exports','VtigerAccount','int_vtiger_accounts','lodash','util','../../config/logger','moment','bluebird','request-promise','rimraf'];(function(_0x3d4674,_0x2734af){var _0x3a3070=function(_0x3b79b0){while(--_0x3b79b0){_0x3d4674['push'](_0x3d4674['shift']());}};_0x3a3070(++_0x2734af);}(_0x8e6a,0x71));var _0xa8e6=function(_0x5551df,_0x42509d){_0x5551df=_0x5551df-0x0;var _0x31f4b2=_0x8e6a[_0x5551df];return _0x31f4b2;};'use strict';var _=require(_0xa8e6('0x0'));var util=require(_0xa8e6('0x1'));var logger=require(_0xa8e6('0x2'))('api');var moment=require(_0xa8e6('0x3'));var BPromise=require(_0xa8e6('0x4'));var rp=require(_0xa8e6('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0xa8e6('0x6'));var config=require(_0xa8e6('0x7'));var attributes=require('./intVtigerAccount.attributes');var integrations=require(_0xa8e6('0x8'));module[_0xa8e6('0x9')]=function(_0x163c20,_0x4fe50d){return _0x163c20['define'](_0xa8e6('0xa'),attributes,{'tableName':_0xa8e6('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/intVtigerAccount/intVtigerAccount.rpc.js b/server/api/intVtigerAccount/intVtigerAccount.rpc.js index 627d9f3..d770ca5 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 _0xee5b=['map','model','attributes','catch','ShowVtigerAccount','lodash','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','jayson/promise','client','http','then','info','VtigerAccount,\x20%s,\x20%s','debug','VtigerAccount,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','GetVtigerAccount','VtigerAccount','findAll','options','raw','where','include'];(function(_0xfc2644,_0x4a3b13){var _0x4873b7=function(_0x4a99ac){while(--_0x4a99ac){_0xfc2644['push'](_0xfc2644['shift']());}};_0x4873b7(++_0x4a3b13);}(_0xee5b,0x1f4));var _0xbee5=function(_0x47b846,_0x3b00e5){_0x47b846=_0x47b846-0x0;var _0x53c201=_0xee5b[_0x47b846];return _0x53c201;};'use strict';var _=require(_0xbee5('0x0'));var util=require('util');var moment=require(_0xbee5('0x1'));var BPromise=require(_0xbee5('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xbee5('0x3'));var db=require(_0xbee5('0x4'))['db'];var utils=require(_0xbee5('0x5'));var logger=require(_0xbee5('0x6'))('rpc');var config=require('../../config/environment');var jayson=require(_0xbee5('0x7'));var client=jayson[_0xbee5('0x8')][_0xbee5('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x804ab8,_0x4f5065,_0x5505e3){return new BPromise(function(_0x53d5b9,_0x5baf5c){return client['request'](_0x804ab8,_0x5505e3)[_0xbee5('0xa')](function(_0x7dda04){logger[_0xbee5('0xb')](_0xbee5('0xc'),_0x4f5065,'request\x20sent');logger[_0xbee5('0xd')](_0xbee5('0xe'),_0x4f5065,_0xbee5('0xf'),JSON[_0xbee5('0x10')](_0x7dda04));if(_0x7dda04[_0xbee5('0x11')]){if(_0x7dda04[_0xbee5('0x11')][_0xbee5('0x12')]===0x1f4){logger[_0xbee5('0x11')](_0xbee5('0xc'),_0x4f5065,_0x7dda04['error'][_0xbee5('0x13')]);return _0x5baf5c(_0x7dda04['error'][_0xbee5('0x13')]);}logger[_0xbee5('0x11')](_0xbee5('0xc'),_0x4f5065,_0x7dda04['error']['message']);return _0x53d5b9(_0x7dda04[_0xbee5('0x11')]['message']);}else{logger[_0xbee5('0xb')]('VtigerAccount,\x20%s,\x20%s',_0x4f5065,_0xbee5('0xf'));_0x53d5b9(_0x7dda04[_0xbee5('0x14')][_0xbee5('0x13')]);}})['catch'](function(_0x27e034){logger[_0xbee5('0x11')]('VtigerAccount,\x20%s,\x20%s',_0x4f5065,_0x27e034);_0x5baf5c(_0x27e034);});});}exports[_0xbee5('0x15')]=function(_0x538460){var _0x11b4a3=this;return new Promise(function(_0x3c3f4e,_0x35eb5c){return db[_0xbee5('0x16')][_0xbee5('0x17')]({'raw':_0x538460[_0xbee5('0x18')]?_0x538460[_0xbee5('0x18')][_0xbee5('0x19')]===undefined?!![]:![]:!![],'where':_0x538460[_0xbee5('0x18')]?_0x538460[_0xbee5('0x18')][_0xbee5('0x1a')]||null:null,'attributes':_0x538460[_0xbee5('0x18')]?_0x538460[_0xbee5('0x18')]['attributes']||null:null,'limit':_0x538460['options']?_0x538460[_0xbee5('0x18')]['limit']||null:null,'include':_0x538460[_0xbee5('0x18')]?_0x538460[_0xbee5('0x18')][_0xbee5('0x1b')]?_[_0xbee5('0x1c')](_0x538460[_0xbee5('0x18')][_0xbee5('0x1b')],function(_0x359ccf){return{'model':db[_0x359ccf[_0xbee5('0x1d')]],'as':_0x359ccf['as'],'attributes':_0x359ccf[_0xbee5('0x1e')],'include':_0x359ccf['include']?_['map'](_0x359ccf['include'],function(_0x519473){return{'model':db[_0x519473['model']],'as':_0x519473['as'],'attributes':_0x519473[_0xbee5('0x1e')],'include':_0x519473[_0xbee5('0x1b')]?_[_0xbee5('0x1c')](_0x519473[_0xbee5('0x1b')],function(_0x169042){return{'model':db[_0x169042[_0xbee5('0x1d')]],'as':_0x169042['as'],'attributes':_0x169042[_0xbee5('0x1e')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x36b50f){logger[_0xbee5('0xb')](_0xbee5('0x15'),_0x538460);logger[_0xbee5('0xd')](_0xbee5('0x15'),_0x538460,JSON['stringify'](_0x36b50f));_0x3c3f4e(_0x36b50f);})[_0xbee5('0x1f')](function(_0x15ffb1){logger[_0xbee5('0x11')](_0xbee5('0x15'),_0x15ffb1[_0xbee5('0x13')],_0x538460);_0x35eb5c(_0x11b4a3[_0xbee5('0x11')](0x1f4,_0x15ffb1[_0xbee5('0x13')]));});});};exports[_0xbee5('0x20')]=function(_0x2ccb91){var _0x59c2e4=this;return new Promise(function(_0x22df5f,_0x5b10a6){return db[_0xbee5('0x16')]['find']({'raw':_0x2ccb91[_0xbee5('0x18')]?_0x2ccb91['options'][_0xbee5('0x19')]===undefined?!![]:![]:!![],'where':_0x2ccb91['options']?_0x2ccb91[_0xbee5('0x18')][_0xbee5('0x1a')]||null:null,'attributes':_0x2ccb91[_0xbee5('0x18')]?_0x2ccb91[_0xbee5('0x18')]['attributes']||null:null,'include':_0x2ccb91[_0xbee5('0x18')]?_0x2ccb91[_0xbee5('0x18')][_0xbee5('0x1b')]?_[_0xbee5('0x1c')](_0x2ccb91['options'][_0xbee5('0x1b')],function(_0x28f8e3){return{'model':db[_0x28f8e3[_0xbee5('0x1d')]],'as':_0x28f8e3['as'],'attributes':_0x28f8e3[_0xbee5('0x1e')],'include':_0x28f8e3['include']?_[_0xbee5('0x1c')](_0x28f8e3[_0xbee5('0x1b')],function(_0x3e854){return{'model':db[_0x3e854[_0xbee5('0x1d')]],'as':_0x3e854['as'],'attributes':_0x3e854['attributes'],'include':_0x3e854[_0xbee5('0x1b')]?_['map'](_0x3e854[_0xbee5('0x1b')],function(_0x58a2e3){return{'model':db[_0x58a2e3['model']],'as':_0x58a2e3['as'],'attributes':_0x58a2e3['attributes']};}):[]};}):[]};}):[]:[]})[_0xbee5('0xa')](function(_0x315523){logger[_0xbee5('0xb')](_0xbee5('0x20'),_0x2ccb91);logger[_0xbee5('0xd')](_0xbee5('0x20'),_0x2ccb91,JSON[_0xbee5('0x10')](_0x315523));_0x22df5f(_0x315523);})[_0xbee5('0x1f')](function(_0x58452a){logger[_0xbee5('0x11')]('ShowVtigerAccount',_0x58452a[_0xbee5('0x13')],_0x2ccb91);_0x5b10a6(_0x59c2e4[_0xbee5('0x11')](0x1f4,_0x58452a[_0xbee5('0x13')]));});});}; \ No newline at end of file +var _0x8f59=['bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','request','info','VtigerAccount,\x20%s,\x20%s','request\x20sent','VtigerAccount,\x20%s,\x20%s,\x20%s','error','message','result','GetVtigerAccount','VtigerAccount','findAll','options','raw','where','attributes','limit','map','include','model','then','debug','catch','ShowVtigerAccount','stringify','lodash','util','moment'];(function(_0x15f8ad,_0x5275c3){var _0xc0238a=function(_0x5550c8){while(--_0x5550c8){_0x15f8ad['push'](_0x15f8ad['shift']());}};_0xc0238a(++_0x5275c3);}(_0x8f59,0x11d));var _0x98f5=function(_0x58e34d,_0x46e1ef){_0x58e34d=_0x58e34d-0x0;var _0x4d30d0=_0x8f59[_0x58e34d];return _0x4d30d0;};'use strict';var _=require(_0x98f5('0x0'));var util=require(_0x98f5('0x1'));var moment=require(_0x98f5('0x2'));var BPromise=require(_0x98f5('0x3'));var rs=require(_0x98f5('0x4'));var fs=require('fs');var Redis=require(_0x98f5('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0x98f5('0x6'));var logger=require(_0x98f5('0x7'))(_0x98f5('0x8'));var config=require(_0x98f5('0x9'));var jayson=require('jayson/promise');var client=jayson[_0x98f5('0xa')][_0x98f5('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x2e2acf,_0x5869ee,_0x5e91b3){return new BPromise(function(_0x109417,_0x1cd8a8){return client[_0x98f5('0xc')](_0x2e2acf,_0x5e91b3)['then'](function(_0x456329){logger[_0x98f5('0xd')](_0x98f5('0xe'),_0x5869ee,_0x98f5('0xf'));logger['debug'](_0x98f5('0x10'),_0x5869ee,'request\x20sent',JSON['stringify'](_0x456329));if(_0x456329[_0x98f5('0x11')]){if(_0x456329[_0x98f5('0x11')]['code']===0x1f4){logger[_0x98f5('0x11')](_0x98f5('0xe'),_0x5869ee,_0x456329[_0x98f5('0x11')][_0x98f5('0x12')]);return _0x1cd8a8(_0x456329[_0x98f5('0x11')][_0x98f5('0x12')]);}logger['error'](_0x98f5('0xe'),_0x5869ee,_0x456329[_0x98f5('0x11')]['message']);return _0x109417(_0x456329[_0x98f5('0x11')][_0x98f5('0x12')]);}else{logger[_0x98f5('0xd')]('VtigerAccount,\x20%s,\x20%s',_0x5869ee,_0x98f5('0xf'));_0x109417(_0x456329[_0x98f5('0x13')][_0x98f5('0x12')]);}})['catch'](function(_0x440cfa){logger[_0x98f5('0x11')]('VtigerAccount,\x20%s,\x20%s',_0x5869ee,_0x440cfa);_0x1cd8a8(_0x440cfa);});});}exports[_0x98f5('0x14')]=function(_0x51a567){var _0x10c57c=this;return new Promise(function(_0x9e42dd,_0x2291d5){return db[_0x98f5('0x15')][_0x98f5('0x16')]({'raw':_0x51a567[_0x98f5('0x17')]?_0x51a567['options'][_0x98f5('0x18')]===undefined?!![]:![]:!![],'where':_0x51a567['options']?_0x51a567[_0x98f5('0x17')][_0x98f5('0x19')]||null:null,'attributes':_0x51a567['options']?_0x51a567[_0x98f5('0x17')][_0x98f5('0x1a')]||null:null,'limit':_0x51a567[_0x98f5('0x17')]?_0x51a567[_0x98f5('0x17')][_0x98f5('0x1b')]||null:null,'include':_0x51a567[_0x98f5('0x17')]?_0x51a567[_0x98f5('0x17')]['include']?_[_0x98f5('0x1c')](_0x51a567['options'][_0x98f5('0x1d')],function(_0x495889){return{'model':db[_0x495889[_0x98f5('0x1e')]],'as':_0x495889['as'],'attributes':_0x495889[_0x98f5('0x1a')],'include':_0x495889[_0x98f5('0x1d')]?_[_0x98f5('0x1c')](_0x495889[_0x98f5('0x1d')],function(_0x18052d){return{'model':db[_0x18052d[_0x98f5('0x1e')]],'as':_0x18052d['as'],'attributes':_0x18052d['attributes'],'include':_0x18052d[_0x98f5('0x1d')]?_[_0x98f5('0x1c')](_0x18052d['include'],function(_0x1a1c55){return{'model':db[_0x1a1c55[_0x98f5('0x1e')]],'as':_0x1a1c55['as'],'attributes':_0x1a1c55[_0x98f5('0x1a')]};}):[]};}):[]};}):[]:[]})[_0x98f5('0x1f')](function(_0x230d1b){logger[_0x98f5('0xd')](_0x98f5('0x14'),_0x51a567);logger[_0x98f5('0x20')]('GetVtigerAccount',_0x51a567,JSON['stringify'](_0x230d1b));_0x9e42dd(_0x230d1b);})[_0x98f5('0x21')](function(_0x71661e){logger[_0x98f5('0x11')](_0x98f5('0x14'),_0x71661e[_0x98f5('0x12')],_0x51a567);_0x2291d5(_0x10c57c[_0x98f5('0x11')](0x1f4,_0x71661e['message']));});});};exports[_0x98f5('0x22')]=function(_0x6d7418){var _0x7a922b=this;return new Promise(function(_0xd20823,_0x1e7138){return db[_0x98f5('0x15')]['find']({'raw':_0x6d7418[_0x98f5('0x17')]?_0x6d7418[_0x98f5('0x17')][_0x98f5('0x18')]===undefined?!![]:![]:!![],'where':_0x6d7418[_0x98f5('0x17')]?_0x6d7418['options'][_0x98f5('0x19')]||null:null,'attributes':_0x6d7418[_0x98f5('0x17')]?_0x6d7418[_0x98f5('0x17')][_0x98f5('0x1a')]||null:null,'include':_0x6d7418[_0x98f5('0x17')]?_0x6d7418[_0x98f5('0x17')][_0x98f5('0x1d')]?_[_0x98f5('0x1c')](_0x6d7418[_0x98f5('0x17')][_0x98f5('0x1d')],function(_0x12d874){return{'model':db[_0x12d874[_0x98f5('0x1e')]],'as':_0x12d874['as'],'attributes':_0x12d874[_0x98f5('0x1a')],'include':_0x12d874[_0x98f5('0x1d')]?_[_0x98f5('0x1c')](_0x12d874[_0x98f5('0x1d')],function(_0x2227f1){return{'model':db[_0x2227f1[_0x98f5('0x1e')]],'as':_0x2227f1['as'],'attributes':_0x2227f1[_0x98f5('0x1a')],'include':_0x2227f1[_0x98f5('0x1d')]?_['map'](_0x2227f1[_0x98f5('0x1d')],function(_0x4aba7a){return{'model':db[_0x4aba7a['model']],'as':_0x4aba7a['as'],'attributes':_0x4aba7a[_0x98f5('0x1a')]};}):[]};}):[]};}):[]:[]})[_0x98f5('0x1f')](function(_0x65c03b){logger[_0x98f5('0xd')]('ShowVtigerAccount',_0x6d7418);logger[_0x98f5('0x20')](_0x98f5('0x22'),_0x6d7418,JSON[_0x98f5('0x23')](_0x65c03b));_0xd20823(_0x65c03b);})['catch'](function(_0x17bfe2){logger[_0x98f5('0x11')]('ShowVtigerAccount',_0x17bfe2[_0x98f5('0x12')],_0x6d7418);_0x1e7138(_0x7a922b[_0x98f5('0x11')](0x1f4,_0x17bfe2[_0x98f5('0x12')]));});});}; \ No newline at end of file diff --git a/server/api/intVtigerConfiguration/index.js b/server/api/intVtigerConfiguration/index.js index 65ae6ec..ce93222 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 _0x2a8f=['getDescriptions','post','create','put','update','delete','destroy','exports','Router','fs-extra','../../components/auth/service','../../config/environment','./intVtigerConfiguration.controller','get','/:id','show','/:id/fields','isAuthenticated','/:id/subjects','getSubjects'];(function(_0x16e243,_0x356355){var _0x506a2a=function(_0x5d4fe7){while(--_0x5d4fe7){_0x16e243['push'](_0x16e243['shift']());}};_0x506a2a(++_0x356355);}(_0x2a8f,0xe4));var _0xf2a8=function(_0x5c2e3e,_0x26ecd3){_0x5c2e3e=_0x5c2e3e-0x0;var _0x53f64a=_0x2a8f[_0x5c2e3e];return _0x53f64a;};'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[_0xf2a8('0x0')]();var fs_extra=require(_0xf2a8('0x1'));var auth=require(_0xf2a8('0x2'));var interaction=require('../../components/interaction/service');var config=require(_0xf2a8('0x3'));var controller=require(_0xf2a8('0x4'));router[_0xf2a8('0x5')]('/',auth['isAuthenticated'](),controller['index']);router['get'](_0xf2a8('0x6'),auth['isAuthenticated'](),controller[_0xf2a8('0x7')]);router[_0xf2a8('0x5')](_0xf2a8('0x8'),auth[_0xf2a8('0x9')](),controller['getFields']);router['get'](_0xf2a8('0xa'),auth[_0xf2a8('0x9')](),controller[_0xf2a8('0xb')]);router[_0xf2a8('0x5')]('/:id/descriptions',auth[_0xf2a8('0x9')](),controller[_0xf2a8('0xc')]);router[_0xf2a8('0xd')]('/',auth[_0xf2a8('0x9')](),controller[_0xf2a8('0xe')]);router[_0xf2a8('0xf')](_0xf2a8('0x6'),auth[_0xf2a8('0x9')](),controller[_0xf2a8('0x10')]);router[_0xf2a8('0x11')](_0xf2a8('0x6'),auth[_0xf2a8('0x9')](),controller[_0xf2a8('0x12')]);module[_0xf2a8('0x13')]=router; \ No newline at end of file +var _0x9a04=['fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./intVtigerConfiguration.controller','isAuthenticated','index','get','/:id','show','/:id/fields','getFields','/:id/subjects','getSubjects','/:id/descriptions','getDescriptions','post','create','update','delete','destroy','multer','util','path','express','Router'];(function(_0x46e21a,_0x59664a){var _0x436a5e=function(_0x56714a){while(--_0x56714a){_0x46e21a['push'](_0x46e21a['shift']());}};_0x436a5e(++_0x59664a);}(_0x9a04,0x181));var _0x49a0=function(_0x1408c1,_0x20d0fc){_0x1408c1=_0x1408c1-0x0;var _0x7ad2b=_0x9a04[_0x1408c1];return _0x7ad2b;};'use strict';var multer=require(_0x49a0('0x0'));var util=require(_0x49a0('0x1'));var path=require(_0x49a0('0x2'));var timeout=require('connect-timeout');var express=require(_0x49a0('0x3'));var router=express[_0x49a0('0x4')]();var fs_extra=require(_0x49a0('0x5'));var auth=require(_0x49a0('0x6'));var interaction=require(_0x49a0('0x7'));var config=require(_0x49a0('0x8'));var controller=require(_0x49a0('0x9'));router['get']('/',auth[_0x49a0('0xa')](),controller[_0x49a0('0xb')]);router[_0x49a0('0xc')](_0x49a0('0xd'),auth['isAuthenticated'](),controller[_0x49a0('0xe')]);router[_0x49a0('0xc')](_0x49a0('0xf'),auth['isAuthenticated'](),controller[_0x49a0('0x10')]);router[_0x49a0('0xc')](_0x49a0('0x11'),auth[_0x49a0('0xa')](),controller[_0x49a0('0x12')]);router[_0x49a0('0xc')](_0x49a0('0x13'),auth[_0x49a0('0xa')](),controller[_0x49a0('0x14')]);router[_0x49a0('0x15')]('/',auth[_0x49a0('0xa')](),controller[_0x49a0('0x16')]);router['put'](_0x49a0('0xd'),auth[_0x49a0('0xa')](),controller[_0x49a0('0x17')]);router[_0x49a0('0x18')]('/:id',auth['isAuthenticated'](),controller[_0x49a0('0x19')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/intVtigerConfiguration/intVtigerConfiguration.attributes.js b/server/api/intVtigerConfiguration/intVtigerConfiguration.attributes.js index 345b397..f536e96 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 _0xe8dd=['sequelize','exports','STRING'];(function(_0x563cc5,_0xaa4e13){var _0x5268ca=function(_0x5c595d){while(--_0x5c595d){_0x563cc5['push'](_0x563cc5['shift']());}};_0x5268ca(++_0xaa4e13);}(_0xe8dd,0x1e9));var _0xde8d=function(_0x1dd66d,_0x2d8ec5){_0x1dd66d=_0x1dd66d-0x0;var _0x468a54=_0xe8dd[_0x1dd66d];return _0x468a54;};'use strict';var Sequelize=require(_0xde8d('0x0'));module[_0xde8d('0x1')]={'name':{'type':Sequelize[_0xde8d('0x2')]},'description':{'type':Sequelize[_0xde8d('0x2')]}}; \ No newline at end of file +var _0xa496=['STRING','sequelize'];(function(_0x3c8568,_0x262756){var _0x5de6b4=function(_0x43eafb){while(--_0x43eafb){_0x3c8568['push'](_0x3c8568['shift']());}};_0x5de6b4(++_0x262756);}(_0xa496,0xe3));var _0x6a49=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xa496[_0x3dd15e];return _0x231fd0;};'use strict';var Sequelize=require(_0x6a49('0x0'));module['exports']={'name':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0x6a49('0x1')]}}; \ No newline at end of file diff --git a/server/api/intVtigerConfiguration/intVtigerConfiguration.controller.js b/server/api/intVtigerConfiguration/intVtigerConfiguration.controller.js index 857f0fe..18648fc 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 _0xa132=['fields','length','nolimit','sort','pick','filter','merge','where','type','include','findAll','rows','catch','params','find','create','body','update','findOne','VtigerField','order','options','getFields','hasOwnProperty','getSubjects','getDescriptions','eml-format','zip-dir','request-promise','moment','bluebird','util','to-csv','ejs','lodash','squel','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','sendStatus','status','end','offset','limit','undefined','count','set','Content-Range','json','apply','reject','save','then','destroy','error','name','send','index','map','VtigerConfiguration','rawAttributes','key','model','query','keys','filters','intersection','attributes'];(function(_0x2b10c6,_0x185590){var _0x3789d2=function(_0x272987){while(--_0x272987){_0x2b10c6['push'](_0x2b10c6['shift']());}};_0x3789d2(++_0x185590);}(_0xa132,0x196));var _0x2a13=function(_0x4bc2f5,_0x4c5fe7){_0x4bc2f5=_0x4bc2f5-0x0;var _0x11aa74=_0xa132[_0x4bc2f5];return _0x11aa74;};'use strict';var emlformat=require(_0x2a13('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x2a13('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0x2a13('0x2'));var moment=require(_0x2a13('0x3'));var BPromise=require(_0x2a13('0x4'));var Mustache=require('mustache');var util=require(_0x2a13('0x5'));var path=require('path');var sox=require('sox');var csv=require(_0x2a13('0x6'));var ejs=require(_0x2a13('0x7'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x2a13('0x8'));var squel=require(_0x2a13('0x9'));var crypto=require('crypto');var jsforce=require(_0x2a13('0xa'));var deskjs=require(_0x2a13('0xb'));var toCsv=require(_0x2a13('0x6'));var querystring=require(_0x2a13('0xc'));var Papa=require(_0x2a13('0xd'));var Redis=require('ioredis');var authService=require(_0x2a13('0xe'));var qs=require(_0x2a13('0xf'));var as=require(_0x2a13('0x10'));var hardwareService=require(_0x2a13('0x11'));var logger=require('../../config/logger')(_0x2a13('0x12'));var utils=require(_0x2a13('0x13'));var config=require(_0x2a13('0x14'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x327130,_0x14ab68){_0x14ab68=_0x14ab68||0xcc;return function(_0x1c6297){if(_0x1c6297){return _0x327130[_0x2a13('0x15')](_0x14ab68);}return _0x327130[_0x2a13('0x16')](_0x14ab68)[_0x2a13('0x17')]();};}function respondWithResult(_0x2aa0c3,_0x4b9a18){_0x4b9a18=_0x4b9a18||0xc8;return function(_0x4b0b40){if(_0x4b0b40){return _0x2aa0c3['status'](_0x4b9a18)['json'](_0x4b0b40);}};}function respondWithFilteredResult(_0x50dc80,_0x12570f){return function(_0x26ff1f){if(_0x26ff1f){var _0x528b01=typeof _0x12570f[_0x2a13('0x18')]==='undefined'&&typeof _0x12570f[_0x2a13('0x19')]===_0x2a13('0x1a');var _0x469d81=_0x26ff1f[_0x2a13('0x1b')];var _0x207950=_0x528b01?0x0:_0x12570f['offset'];var _0xcdc4f4=_0x528b01?_0x26ff1f[_0x2a13('0x1b')]:_0x12570f[_0x2a13('0x18')]+_0x12570f[_0x2a13('0x19')];var _0x6b2803;if(_0xcdc4f4>=_0x469d81){_0xcdc4f4=_0x469d81;_0x6b2803=0xc8;}else{_0x6b2803=0xce;}_0x50dc80['status'](_0x6b2803);return _0x50dc80[_0x2a13('0x1c')](_0x2a13('0x1d'),_0x207950+'-'+_0xcdc4f4+'/'+_0x469d81)[_0x2a13('0x1e')](_0x26ff1f);}return null;};}function patchUpdates(_0x42f4a2){return function(_0x18ab7f){try{jsonpatch[_0x2a13('0x1f')](_0x18ab7f,_0x42f4a2,!![]);}catch(_0x37a567){return BPromise[_0x2a13('0x20')](_0x37a567);}return _0x18ab7f[_0x2a13('0x21')]();};}function saveUpdates(_0x30e4d7,_0x2c8885){return function(_0x3e1a6e){if(_0x3e1a6e){return _0x3e1a6e['update'](_0x30e4d7)[_0x2a13('0x22')](function(_0x2e8b00){return _0x2e8b00;});}return null;};}function removeEntity(_0x23d0ec,_0x5043f4){return function(_0xd11f4b){if(_0xd11f4b){return _0xd11f4b[_0x2a13('0x23')]()['then'](function(){_0x23d0ec[_0x2a13('0x16')](0xcc)[_0x2a13('0x17')]();});}};}function handleEntityNotFound(_0x5a7c96,_0x25b438){return function(_0x19df00){if(!_0x19df00){_0x5a7c96['sendStatus'](0x194);}return _0x19df00;};}function handleError(_0x4940b6,_0x31ef91){_0x31ef91=_0x31ef91||0x1f4;return function(_0xe34aa){logger[_0x2a13('0x24')](_0xe34aa['stack']);if(_0xe34aa[_0x2a13('0x25')]){delete _0xe34aa[_0x2a13('0x25')];}_0x4940b6[_0x2a13('0x16')](_0x31ef91)[_0x2a13('0x26')](_0xe34aa);};}exports[_0x2a13('0x27')]=function(_0x16bc54,_0x3c6a99){var _0x127974={},_0x47c158={},_0x3b5302={'count':0x0,'rows':[]};var _0x37babe=_[_0x2a13('0x28')](db[_0x2a13('0x29')][_0x2a13('0x2a')],function(_0x2b2632){return{'name':_0x2b2632['fieldName'],'type':_0x2b2632['type'][_0x2a13('0x2b')]};});_0x47c158[_0x2a13('0x2c')]=_[_0x2a13('0x28')](_0x37babe,_0x2a13('0x25'));_0x47c158[_0x2a13('0x2d')]=_[_0x2a13('0x2e')](_0x16bc54[_0x2a13('0x2d')]);_0x47c158[_0x2a13('0x2f')]=_[_0x2a13('0x30')](_0x47c158['model'],_0x47c158[_0x2a13('0x2d')]);_0x127974[_0x2a13('0x31')]=_[_0x2a13('0x30')](_0x47c158['model'],qs['fields'](_0x16bc54['query'][_0x2a13('0x32')]));_0x127974[_0x2a13('0x31')]=_0x127974[_0x2a13('0x31')][_0x2a13('0x33')]?_0x127974[_0x2a13('0x31')]:_0x47c158[_0x2a13('0x2c')];if(!_0x16bc54[_0x2a13('0x2d')]['hasOwnProperty'](_0x2a13('0x34'))){_0x127974[_0x2a13('0x19')]=qs[_0x2a13('0x19')](_0x16bc54[_0x2a13('0x2d')][_0x2a13('0x19')]);_0x127974[_0x2a13('0x18')]=qs['offset'](_0x16bc54['query'][_0x2a13('0x18')]);}_0x127974['order']=qs[_0x2a13('0x35')](_0x16bc54[_0x2a13('0x2d')][_0x2a13('0x35')]);_0x127974['where']=qs['filters'](_[_0x2a13('0x36')](_0x16bc54[_0x2a13('0x2d')],_0x47c158['filters']),_0x37babe);if(_0x16bc54[_0x2a13('0x2d')][_0x2a13('0x37')]){_0x127974['where']=_[_0x2a13('0x38')](_0x127974[_0x2a13('0x39')],{'$or':_[_0x2a13('0x28')](_0x37babe,function(_0x4bc208){if(_0x4bc208[_0x2a13('0x3a')]!=='VIRTUAL'){var _0x5ae1ec={};_0x5ae1ec[_0x4bc208[_0x2a13('0x25')]]={'$like':'%'+_0x16bc54[_0x2a13('0x2d')]['filter']+'%'};return _0x5ae1ec;}})});}_0x127974=_['merge']({},_0x127974,_0x16bc54['options']);var _0x27cc7a={'where':_0x127974[_0x2a13('0x39')]};return db[_0x2a13('0x29')][_0x2a13('0x1b')](_0x27cc7a)[_0x2a13('0x22')](function(_0x29b2f4){_0x3b5302['count']=_0x29b2f4;if(_0x16bc54['query']['includeAll']){_0x127974[_0x2a13('0x3b')]=[{'all':!![]}];}return db[_0x2a13('0x29')][_0x2a13('0x3c')](_0x127974);})[_0x2a13('0x22')](function(_0x210ac5){_0x3b5302[_0x2a13('0x3d')]=_0x210ac5;return _0x3b5302;})[_0x2a13('0x22')](respondWithFilteredResult(_0x3c6a99,_0x127974))[_0x2a13('0x3e')](handleError(_0x3c6a99,null));};exports['show']=function(_0x2e9d88,_0x215490){var _0x36378c={'raw':![],'where':{'id':_0x2e9d88[_0x2a13('0x3f')]['id']}},_0x11493b={};_0x11493b[_0x2a13('0x2c')]=_['keys'](db['VtigerConfiguration'][_0x2a13('0x2a')]);_0x11493b['query']=_[_0x2a13('0x2e')](_0x2e9d88[_0x2a13('0x2d')]);_0x11493b[_0x2a13('0x2f')]=_[_0x2a13('0x30')](_0x11493b['model'],_0x11493b[_0x2a13('0x2d')]);_0x36378c[_0x2a13('0x31')]=_[_0x2a13('0x30')](_0x11493b['model'],qs[_0x2a13('0x32')](_0x2e9d88['query'][_0x2a13('0x32')]));_0x36378c[_0x2a13('0x31')]=_0x36378c[_0x2a13('0x31')][_0x2a13('0x33')]?_0x36378c[_0x2a13('0x31')]:_0x11493b[_0x2a13('0x2c')];if(_0x2e9d88['query']['includeAll']){_0x36378c[_0x2a13('0x3b')]=[{'all':!![]}];}_0x36378c=_[_0x2a13('0x38')]({},_0x36378c,_0x2e9d88['options']);return db['VtigerConfiguration'][_0x2a13('0x40')](_0x36378c)[_0x2a13('0x22')](handleEntityNotFound(_0x215490,null))[_0x2a13('0x22')](respondWithResult(_0x215490,null))[_0x2a13('0x3e')](handleError(_0x215490,null));};exports[_0x2a13('0x41')]=function(_0x4d381a,_0x171c81){return db[_0x2a13('0x29')][_0x2a13('0x41')](_0x4d381a[_0x2a13('0x42')],{})[_0x2a13('0x22')](respondWithResult(_0x171c81,0xc9))[_0x2a13('0x3e')](handleError(_0x171c81,null));};exports[_0x2a13('0x43')]=function(_0x5b38b,_0x27a3a8){if(_0x5b38b['body']['id']){delete _0x5b38b['body']['id'];}return db[_0x2a13('0x29')][_0x2a13('0x40')]({'where':{'id':_0x5b38b[_0x2a13('0x3f')]['id']}})['then'](handleEntityNotFound(_0x27a3a8,null))[_0x2a13('0x22')](saveUpdates(_0x5b38b[_0x2a13('0x42')],null))[_0x2a13('0x22')](respondWithResult(_0x27a3a8,null))[_0x2a13('0x3e')](handleError(_0x27a3a8,null));};exports['destroy']=function(_0x231861,_0x30b34d){return db[_0x2a13('0x29')][_0x2a13('0x40')]({'where':{'id':_0x231861[_0x2a13('0x3f')]['id']}})[_0x2a13('0x22')](handleEntityNotFound(_0x30b34d,null))['then'](removeEntity(_0x30b34d,null))[_0x2a13('0x3e')](handleError(_0x30b34d,null));};exports['getFields']=function(_0x510dce,_0x29b236,_0x238548){var _0x9bc9ac={};var _0x468be5={};var _0x571fd3;var _0x10bedf;return db[_0x2a13('0x29')][_0x2a13('0x44')]({'where':{'id':_0x510dce[_0x2a13('0x3f')]['id']}})[_0x2a13('0x22')](handleEntityNotFound(_0x29b236,null))[_0x2a13('0x22')](function(_0x465ff1){if(_0x465ff1){_0x571fd3=_0x465ff1;_0x468be5[_0x2a13('0x2c')]=_[_0x2a13('0x2e')](db[_0x2a13('0x45')][_0x2a13('0x2a')]);_0x468be5[_0x2a13('0x2d')]=_[_0x2a13('0x2e')](_0x510dce['query']);_0x468be5['filters']=_[_0x2a13('0x30')](_0x468be5['model'],_0x468be5[_0x2a13('0x2d')]);_0x9bc9ac['attributes']=_[_0x2a13('0x30')](_0x468be5['model'],qs[_0x2a13('0x32')](_0x510dce['query'][_0x2a13('0x32')]));_0x9bc9ac[_0x2a13('0x31')]=_0x9bc9ac[_0x2a13('0x31')][_0x2a13('0x33')]?_0x9bc9ac[_0x2a13('0x31')]:_0x468be5[_0x2a13('0x2c')];_0x9bc9ac[_0x2a13('0x46')]=qs[_0x2a13('0x35')](_0x510dce[_0x2a13('0x2d')][_0x2a13('0x35')]);_0x9bc9ac[_0x2a13('0x39')]=qs[_0x2a13('0x2f')](_[_0x2a13('0x36')](_0x510dce[_0x2a13('0x2d')],_0x468be5[_0x2a13('0x2f')]));if(_0x510dce[_0x2a13('0x2d')]['filter']){_0x9bc9ac[_0x2a13('0x39')]=_['merge'](_0x9bc9ac[_0x2a13('0x39')],{'$or':_['map'](_0x9bc9ac[_0x2a13('0x31')],function(_0x4f41ab){var _0x56b1de={};_0x56b1de[_0x4f41ab]={'$like':'%'+_0x510dce['query'][_0x2a13('0x37')]+'%'};return _0x56b1de;})});}_0x9bc9ac=_['merge']({},_0x9bc9ac,_0x510dce[_0x2a13('0x47')]);return _0x571fd3[_0x2a13('0x48')](_0x9bc9ac);}})[_0x2a13('0x22')](function(_0x46a6b0){if(_0x46a6b0){_0x10bedf=_0x46a6b0[_0x2a13('0x33')];if(!_0x510dce['query'][_0x2a13('0x49')](_0x2a13('0x34'))){_0x9bc9ac[_0x2a13('0x19')]=qs[_0x2a13('0x19')](_0x510dce[_0x2a13('0x2d')][_0x2a13('0x19')]);_0x9bc9ac[_0x2a13('0x18')]=qs['offset'](_0x510dce[_0x2a13('0x2d')][_0x2a13('0x18')]);}return _0x571fd3[_0x2a13('0x48')](_0x9bc9ac);}})[_0x2a13('0x22')](function(_0x4568e3){if(_0x4568e3){return _0x4568e3?{'count':_0x10bedf,'rows':_0x4568e3}:null;}})[_0x2a13('0x22')](respondWithResult(_0x29b236,null))[_0x2a13('0x3e')](handleError(_0x29b236,null));};exports['getSubjects']=function(_0x263c0d,_0x5ac2c8,_0x3a4297){var _0x1033b3={};var _0x17b92c={};var _0x37e073;var _0x36986e;return db['VtigerConfiguration'][_0x2a13('0x44')]({'where':{'id':_0x263c0d[_0x2a13('0x3f')]['id']}})['then'](handleEntityNotFound(_0x5ac2c8,null))['then'](function(_0x244ca4){if(_0x244ca4){_0x37e073=_0x244ca4;_0x17b92c[_0x2a13('0x2c')]=_[_0x2a13('0x2e')](db['VtigerField'][_0x2a13('0x2a')]);_0x17b92c[_0x2a13('0x2d')]=_[_0x2a13('0x2e')](_0x263c0d[_0x2a13('0x2d')]);_0x17b92c['filters']=_[_0x2a13('0x30')](_0x17b92c['model'],_0x17b92c['query']);_0x1033b3[_0x2a13('0x31')]=_['intersection'](_0x17b92c[_0x2a13('0x2c')],qs['fields'](_0x263c0d['query'][_0x2a13('0x32')]));_0x1033b3[_0x2a13('0x31')]=_0x1033b3[_0x2a13('0x31')]['length']?_0x1033b3[_0x2a13('0x31')]:_0x17b92c[_0x2a13('0x2c')];_0x1033b3[_0x2a13('0x46')]=qs[_0x2a13('0x35')](_0x263c0d[_0x2a13('0x2d')]['sort']);_0x1033b3[_0x2a13('0x39')]=qs['filters'](_['pick'](_0x263c0d[_0x2a13('0x2d')],_0x17b92c[_0x2a13('0x2f')]));if(_0x263c0d['query'][_0x2a13('0x37')]){_0x1033b3['where']=_[_0x2a13('0x38')](_0x1033b3[_0x2a13('0x39')],{'$or':_[_0x2a13('0x28')](_0x1033b3[_0x2a13('0x31')],function(_0x507598){var _0x54d546={};_0x54d546[_0x507598]={'$like':'%'+_0x263c0d['query'][_0x2a13('0x37')]+'%'};return _0x54d546;})});}_0x1033b3=_[_0x2a13('0x38')]({},_0x1033b3,_0x263c0d[_0x2a13('0x47')]);return _0x37e073['getSubjects'](_0x1033b3);}})[_0x2a13('0x22')](function(_0x186849){if(_0x186849){_0x36986e=_0x186849[_0x2a13('0x33')];if(!_0x263c0d[_0x2a13('0x2d')][_0x2a13('0x49')](_0x2a13('0x34'))){_0x1033b3[_0x2a13('0x19')]=qs[_0x2a13('0x19')](_0x263c0d['query'][_0x2a13('0x19')]);_0x1033b3['offset']=qs[_0x2a13('0x18')](_0x263c0d[_0x2a13('0x2d')][_0x2a13('0x18')]);}return _0x37e073[_0x2a13('0x4a')](_0x1033b3);}})[_0x2a13('0x22')](function(_0x4f41b6){if(_0x4f41b6){return _0x4f41b6?{'count':_0x36986e,'rows':_0x4f41b6}:null;}})[_0x2a13('0x22')](respondWithResult(_0x5ac2c8,null))[_0x2a13('0x3e')](handleError(_0x5ac2c8,null));};exports[_0x2a13('0x4b')]=function(_0x470dec,_0x23a451,_0x5ebd14){var _0xe17fff={};var _0x51a8ba={};var _0x846403;var _0x36acdd;return db[_0x2a13('0x29')][_0x2a13('0x44')]({'where':{'id':_0x470dec[_0x2a13('0x3f')]['id']}})['then'](handleEntityNotFound(_0x23a451,null))[_0x2a13('0x22')](function(_0x27d9f7){if(_0x27d9f7){_0x846403=_0x27d9f7;_0x51a8ba[_0x2a13('0x2c')]=_[_0x2a13('0x2e')](db['VtigerField'][_0x2a13('0x2a')]);_0x51a8ba[_0x2a13('0x2d')]=_[_0x2a13('0x2e')](_0x470dec[_0x2a13('0x2d')]);_0x51a8ba[_0x2a13('0x2f')]=_[_0x2a13('0x30')](_0x51a8ba[_0x2a13('0x2c')],_0x51a8ba[_0x2a13('0x2d')]);_0xe17fff['attributes']=_[_0x2a13('0x30')](_0x51a8ba['model'],qs[_0x2a13('0x32')](_0x470dec[_0x2a13('0x2d')]['fields']));_0xe17fff['attributes']=_0xe17fff[_0x2a13('0x31')][_0x2a13('0x33')]?_0xe17fff[_0x2a13('0x31')]:_0x51a8ba['model'];_0xe17fff[_0x2a13('0x46')]=qs[_0x2a13('0x35')](_0x470dec[_0x2a13('0x2d')][_0x2a13('0x35')]);_0xe17fff[_0x2a13('0x39')]=qs[_0x2a13('0x2f')](_[_0x2a13('0x36')](_0x470dec[_0x2a13('0x2d')],_0x51a8ba[_0x2a13('0x2f')]));if(_0x470dec[_0x2a13('0x2d')][_0x2a13('0x37')]){_0xe17fff['where']=_[_0x2a13('0x38')](_0xe17fff[_0x2a13('0x39')],{'$or':_[_0x2a13('0x28')](_0xe17fff[_0x2a13('0x31')],function(_0xb22a7e){var _0x56bbde={};_0x56bbde[_0xb22a7e]={'$like':'%'+_0x470dec[_0x2a13('0x2d')][_0x2a13('0x37')]+'%'};return _0x56bbde;})});}_0xe17fff=_[_0x2a13('0x38')]({},_0xe17fff,_0x470dec['options']);return _0x846403[_0x2a13('0x4b')](_0xe17fff);}})['then'](function(_0x2815b6){if(_0x2815b6){_0x36acdd=_0x2815b6[_0x2a13('0x33')];if(!_0x470dec[_0x2a13('0x2d')][_0x2a13('0x49')](_0x2a13('0x34'))){_0xe17fff[_0x2a13('0x19')]=qs[_0x2a13('0x19')](_0x470dec[_0x2a13('0x2d')][_0x2a13('0x19')]);_0xe17fff['offset']=qs[_0x2a13('0x18')](_0x470dec[_0x2a13('0x2d')]['offset']);}return _0x846403[_0x2a13('0x4b')](_0xe17fff);}})[_0x2a13('0x22')](function(_0xdb393){if(_0xdb393){return _0xdb393?{'count':_0x36acdd,'rows':_0xdb393}:null;}})[_0x2a13('0x22')](respondWithResult(_0x23a451,null))[_0x2a13('0x3e')](handleError(_0x23a451,null));}; \ No newline at end of file +var _0xcdd0=['body','getFields','findOne','order','nolimit','getSubjects','getDescriptions','VtigerField','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','to-csv','ejs','squel','jsforce','desk.js','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/license/util','status','end','json','undefined','limit','count','offset','set','Content-Range','save','update','then','destroy','sendStatus','error','name','send','map','VtigerConfiguration','rawAttributes','fieldName','type','query','intersection','model','attributes','fields','length','hasOwnProperty','sort','where','filters','pick','filter','VIRTUAL','merge','options','includeAll','include','rows','catch','show','params','keys','find','create'];(function(_0xeff2c3,_0x3a5a82){var _0x2cade6=function(_0x5a26a1){while(--_0x5a26a1){_0xeff2c3['push'](_0xeff2c3['shift']());}};_0x2cade6(++_0x3a5a82);}(_0xcdd0,0x184));var _0x0cdd=function(_0x397e5f,_0x454c8f){_0x397e5f=_0x397e5f-0x0;var _0x5302b8=_0xcdd0[_0x397e5f];return _0x5302b8;};'use strict';var emlformat=require(_0x0cdd('0x0'));var rimraf=require(_0x0cdd('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x0cdd('0x2'));var rp=require(_0x0cdd('0x3'));var moment=require(_0x0cdd('0x4'));var BPromise=require(_0x0cdd('0x5'));var Mustache=require(_0x0cdd('0x6'));var util=require(_0x0cdd('0x7'));var path=require(_0x0cdd('0x8'));var sox=require('sox');var csv=require(_0x0cdd('0x9'));var ejs=require(_0x0cdd('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0x0cdd('0xb'));var crypto=require('crypto');var jsforce=require(_0x0cdd('0xc'));var deskjs=require(_0x0cdd('0xd'));var toCsv=require(_0x0cdd('0x9'));var querystring=require('querystring');var Papa=require(_0x0cdd('0xe'));var Redis=require('ioredis');var authService=require(_0x0cdd('0xf'));var qs=require(_0x0cdd('0x10'));var as=require(_0x0cdd('0x11'));var hardwareService=require(_0x0cdd('0x12'));var logger=require(_0x0cdd('0x13'))('api');var utils=require(_0x0cdd('0x14'));var config=require('../../config/environment');var licenseUtil=require(_0x0cdd('0x15'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x188deb,_0x1b72d6){_0x1b72d6=_0x1b72d6||0xcc;return function(_0x573321){if(_0x573321){return _0x188deb['sendStatus'](_0x1b72d6);}return _0x188deb[_0x0cdd('0x16')](_0x1b72d6)[_0x0cdd('0x17')]();};}function respondWithResult(_0x111f3c,_0x3f094d){_0x3f094d=_0x3f094d||0xc8;return function(_0x5ec231){if(_0x5ec231){return _0x111f3c[_0x0cdd('0x16')](_0x3f094d)[_0x0cdd('0x18')](_0x5ec231);}};}function respondWithFilteredResult(_0x63d5d1,_0xaf7423){return function(_0x3b5206){if(_0x3b5206){var _0x19563a=typeof _0xaf7423['offset']===_0x0cdd('0x19')&&typeof _0xaf7423[_0x0cdd('0x1a')]===_0x0cdd('0x19');var _0x1a1069=_0x3b5206[_0x0cdd('0x1b')];var _0x55e866=_0x19563a?0x0:_0xaf7423[_0x0cdd('0x1c')];var _0x2fddde=_0x19563a?_0x3b5206[_0x0cdd('0x1b')]:_0xaf7423[_0x0cdd('0x1c')]+_0xaf7423[_0x0cdd('0x1a')];var _0x81c23a;if(_0x2fddde>=_0x1a1069){_0x2fddde=_0x1a1069;_0x81c23a=0xc8;}else{_0x81c23a=0xce;}_0x63d5d1[_0x0cdd('0x16')](_0x81c23a);return _0x63d5d1[_0x0cdd('0x1d')](_0x0cdd('0x1e'),_0x55e866+'-'+_0x2fddde+'/'+_0x1a1069)[_0x0cdd('0x18')](_0x3b5206);}return null;};}function patchUpdates(_0x217004){return function(_0xc311a1){try{jsonpatch['apply'](_0xc311a1,_0x217004,!![]);}catch(_0x5c3a1e){return BPromise['reject'](_0x5c3a1e);}return _0xc311a1[_0x0cdd('0x1f')]();};}function saveUpdates(_0x46cb68,_0x15b33e){return function(_0x22e082){if(_0x22e082){return _0x22e082[_0x0cdd('0x20')](_0x46cb68)[_0x0cdd('0x21')](function(_0x373cbf){return _0x373cbf;});}return null;};}function removeEntity(_0x81d9fe,_0x3c44e3){return function(_0x405fb3){if(_0x405fb3){return _0x405fb3[_0x0cdd('0x22')]()['then'](function(){_0x81d9fe[_0x0cdd('0x16')](0xcc)[_0x0cdd('0x17')]();});}};}function handleEntityNotFound(_0x44e12a,_0x3d4e84){return function(_0x4943fe){if(!_0x4943fe){_0x44e12a[_0x0cdd('0x23')](0x194);}return _0x4943fe;};}function handleError(_0x40749b,_0x31b5d){_0x31b5d=_0x31b5d||0x1f4;return function(_0x363fae){logger[_0x0cdd('0x24')](_0x363fae['stack']);if(_0x363fae['name']){delete _0x363fae[_0x0cdd('0x25')];}_0x40749b['status'](_0x31b5d)[_0x0cdd('0x26')](_0x363fae);};}exports['index']=function(_0x33c143,_0x3f9e13){var _0xc01d34={},_0x1da52b={},_0x2ad155={'count':0x0,'rows':[]};var _0x3f3bea=_[_0x0cdd('0x27')](db[_0x0cdd('0x28')][_0x0cdd('0x29')],function(_0xa33ec9){return{'name':_0xa33ec9[_0x0cdd('0x2a')],'type':_0xa33ec9[_0x0cdd('0x2b')]['key']};});_0x1da52b['model']=_[_0x0cdd('0x27')](_0x3f3bea,_0x0cdd('0x25'));_0x1da52b[_0x0cdd('0x2c')]=_['keys'](_0x33c143[_0x0cdd('0x2c')]);_0x1da52b['filters']=_[_0x0cdd('0x2d')](_0x1da52b[_0x0cdd('0x2e')],_0x1da52b['query']);_0xc01d34[_0x0cdd('0x2f')]=_[_0x0cdd('0x2d')](_0x1da52b[_0x0cdd('0x2e')],qs[_0x0cdd('0x30')](_0x33c143[_0x0cdd('0x2c')][_0x0cdd('0x30')]));_0xc01d34['attributes']=_0xc01d34[_0x0cdd('0x2f')][_0x0cdd('0x31')]?_0xc01d34[_0x0cdd('0x2f')]:_0x1da52b[_0x0cdd('0x2e')];if(!_0x33c143[_0x0cdd('0x2c')][_0x0cdd('0x32')]('nolimit')){_0xc01d34[_0x0cdd('0x1a')]=qs[_0x0cdd('0x1a')](_0x33c143['query'][_0x0cdd('0x1a')]);_0xc01d34[_0x0cdd('0x1c')]=qs['offset'](_0x33c143[_0x0cdd('0x2c')][_0x0cdd('0x1c')]);}_0xc01d34['order']=qs[_0x0cdd('0x33')](_0x33c143[_0x0cdd('0x2c')][_0x0cdd('0x33')]);_0xc01d34[_0x0cdd('0x34')]=qs[_0x0cdd('0x35')](_[_0x0cdd('0x36')](_0x33c143['query'],_0x1da52b['filters']),_0x3f3bea);if(_0x33c143['query'][_0x0cdd('0x37')]){_0xc01d34[_0x0cdd('0x34')]=_['merge'](_0xc01d34['where'],{'$or':_[_0x0cdd('0x27')](_0x3f3bea,function(_0x534521){if(_0x534521[_0x0cdd('0x2b')]!==_0x0cdd('0x38')){var _0x312ad3={};_0x312ad3[_0x534521[_0x0cdd('0x25')]]={'$like':'%'+_0x33c143['query']['filter']+'%'};return _0x312ad3;}})});}_0xc01d34=_[_0x0cdd('0x39')]({},_0xc01d34,_0x33c143[_0x0cdd('0x3a')]);var _0x580d70={'where':_0xc01d34[_0x0cdd('0x34')]};return db[_0x0cdd('0x28')][_0x0cdd('0x1b')](_0x580d70)['then'](function(_0x24a092){_0x2ad155[_0x0cdd('0x1b')]=_0x24a092;if(_0x33c143[_0x0cdd('0x2c')][_0x0cdd('0x3b')]){_0xc01d34[_0x0cdd('0x3c')]=[{'all':!![]}];}return db['VtigerConfiguration']['findAll'](_0xc01d34);})['then'](function(_0x4489a4){_0x2ad155[_0x0cdd('0x3d')]=_0x4489a4;return _0x2ad155;})[_0x0cdd('0x21')](respondWithFilteredResult(_0x3f9e13,_0xc01d34))[_0x0cdd('0x3e')](handleError(_0x3f9e13,null));};exports[_0x0cdd('0x3f')]=function(_0x4bc4b7,_0x58fb60){var _0x2003ac={'raw':![],'where':{'id':_0x4bc4b7[_0x0cdd('0x40')]['id']}},_0x1ae5c9={};_0x1ae5c9['model']=_[_0x0cdd('0x41')](db[_0x0cdd('0x28')][_0x0cdd('0x29')]);_0x1ae5c9['query']=_[_0x0cdd('0x41')](_0x4bc4b7['query']);_0x1ae5c9[_0x0cdd('0x35')]=_[_0x0cdd('0x2d')](_0x1ae5c9['model'],_0x1ae5c9['query']);_0x2003ac[_0x0cdd('0x2f')]=_[_0x0cdd('0x2d')](_0x1ae5c9[_0x0cdd('0x2e')],qs['fields'](_0x4bc4b7[_0x0cdd('0x2c')][_0x0cdd('0x30')]));_0x2003ac[_0x0cdd('0x2f')]=_0x2003ac['attributes']['length']?_0x2003ac[_0x0cdd('0x2f')]:_0x1ae5c9[_0x0cdd('0x2e')];if(_0x4bc4b7[_0x0cdd('0x2c')]['includeAll']){_0x2003ac[_0x0cdd('0x3c')]=[{'all':!![]}];}_0x2003ac=_[_0x0cdd('0x39')]({},_0x2003ac,_0x4bc4b7[_0x0cdd('0x3a')]);return db['VtigerConfiguration'][_0x0cdd('0x42')](_0x2003ac)['then'](handleEntityNotFound(_0x58fb60,null))['then'](respondWithResult(_0x58fb60,null))[_0x0cdd('0x3e')](handleError(_0x58fb60,null));};exports[_0x0cdd('0x43')]=function(_0x16c2be,_0x4c8c02){return db['VtigerConfiguration'][_0x0cdd('0x43')](_0x16c2be[_0x0cdd('0x44')],{})[_0x0cdd('0x21')](respondWithResult(_0x4c8c02,0xc9))[_0x0cdd('0x3e')](handleError(_0x4c8c02,null));};exports['update']=function(_0x4fa4da,_0x1563e6){if(_0x4fa4da[_0x0cdd('0x44')]['id']){delete _0x4fa4da[_0x0cdd('0x44')]['id'];}return db['VtigerConfiguration']['find']({'where':{'id':_0x4fa4da[_0x0cdd('0x40')]['id']}})[_0x0cdd('0x21')](handleEntityNotFound(_0x1563e6,null))['then'](saveUpdates(_0x4fa4da[_0x0cdd('0x44')],null))[_0x0cdd('0x21')](respondWithResult(_0x1563e6,null))[_0x0cdd('0x3e')](handleError(_0x1563e6,null));};exports[_0x0cdd('0x22')]=function(_0x5eedf7,_0x4ebf29){return db['VtigerConfiguration'][_0x0cdd('0x42')]({'where':{'id':_0x5eedf7[_0x0cdd('0x40')]['id']}})[_0x0cdd('0x21')](handleEntityNotFound(_0x4ebf29,null))[_0x0cdd('0x21')](removeEntity(_0x4ebf29,null))[_0x0cdd('0x3e')](handleError(_0x4ebf29,null));};exports[_0x0cdd('0x45')]=function(_0x1bb1a1,_0x419e64,_0x4b87ea){var _0x17a0e1={};var _0x5eba23={};var _0x15870a;var _0x51d0e5;return db['VtigerConfiguration'][_0x0cdd('0x46')]({'where':{'id':_0x1bb1a1[_0x0cdd('0x40')]['id']}})[_0x0cdd('0x21')](handleEntityNotFound(_0x419e64,null))[_0x0cdd('0x21')](function(_0x5ba715){if(_0x5ba715){_0x15870a=_0x5ba715;_0x5eba23[_0x0cdd('0x2e')]=_[_0x0cdd('0x41')](db['VtigerField'][_0x0cdd('0x29')]);_0x5eba23['query']=_[_0x0cdd('0x41')](_0x1bb1a1[_0x0cdd('0x2c')]);_0x5eba23['filters']=_[_0x0cdd('0x2d')](_0x5eba23['model'],_0x5eba23[_0x0cdd('0x2c')]);_0x17a0e1[_0x0cdd('0x2f')]=_[_0x0cdd('0x2d')](_0x5eba23[_0x0cdd('0x2e')],qs[_0x0cdd('0x30')](_0x1bb1a1[_0x0cdd('0x2c')][_0x0cdd('0x30')]));_0x17a0e1[_0x0cdd('0x2f')]=_0x17a0e1[_0x0cdd('0x2f')][_0x0cdd('0x31')]?_0x17a0e1[_0x0cdd('0x2f')]:_0x5eba23[_0x0cdd('0x2e')];_0x17a0e1[_0x0cdd('0x47')]=qs['sort'](_0x1bb1a1[_0x0cdd('0x2c')][_0x0cdd('0x33')]);_0x17a0e1[_0x0cdd('0x34')]=qs[_0x0cdd('0x35')](_[_0x0cdd('0x36')](_0x1bb1a1['query'],_0x5eba23[_0x0cdd('0x35')]));if(_0x1bb1a1['query'][_0x0cdd('0x37')]){_0x17a0e1[_0x0cdd('0x34')]=_[_0x0cdd('0x39')](_0x17a0e1[_0x0cdd('0x34')],{'$or':_['map'](_0x17a0e1['attributes'],function(_0x1279c1){var _0x496f07={};_0x496f07[_0x1279c1]={'$like':'%'+_0x1bb1a1['query'][_0x0cdd('0x37')]+'%'};return _0x496f07;})});}_0x17a0e1=_[_0x0cdd('0x39')]({},_0x17a0e1,_0x1bb1a1[_0x0cdd('0x3a')]);return _0x15870a[_0x0cdd('0x45')](_0x17a0e1);}})['then'](function(_0x5ec40){if(_0x5ec40){_0x51d0e5=_0x5ec40['length'];if(!_0x1bb1a1[_0x0cdd('0x2c')][_0x0cdd('0x32')](_0x0cdd('0x48'))){_0x17a0e1[_0x0cdd('0x1a')]=qs[_0x0cdd('0x1a')](_0x1bb1a1[_0x0cdd('0x2c')][_0x0cdd('0x1a')]);_0x17a0e1[_0x0cdd('0x1c')]=qs[_0x0cdd('0x1c')](_0x1bb1a1[_0x0cdd('0x2c')]['offset']);}return _0x15870a['getFields'](_0x17a0e1);}})['then'](function(_0x2dd40b){if(_0x2dd40b){return _0x2dd40b?{'count':_0x51d0e5,'rows':_0x2dd40b}:null;}})[_0x0cdd('0x21')](respondWithResult(_0x419e64,null))[_0x0cdd('0x3e')](handleError(_0x419e64,null));};exports[_0x0cdd('0x49')]=function(_0x1c1127,_0x26429a,_0x468d12){var _0x579fdf={};var _0x8a62b5={};var _0x634af5;var _0x3889f0;return db[_0x0cdd('0x28')][_0x0cdd('0x46')]({'where':{'id':_0x1c1127[_0x0cdd('0x40')]['id']}})[_0x0cdd('0x21')](handleEntityNotFound(_0x26429a,null))[_0x0cdd('0x21')](function(_0x19d853){if(_0x19d853){_0x634af5=_0x19d853;_0x8a62b5[_0x0cdd('0x2e')]=_[_0x0cdd('0x41')](db['VtigerField']['rawAttributes']);_0x8a62b5[_0x0cdd('0x2c')]=_[_0x0cdd('0x41')](_0x1c1127[_0x0cdd('0x2c')]);_0x8a62b5[_0x0cdd('0x35')]=_[_0x0cdd('0x2d')](_0x8a62b5['model'],_0x8a62b5[_0x0cdd('0x2c')]);_0x579fdf['attributes']=_[_0x0cdd('0x2d')](_0x8a62b5['model'],qs[_0x0cdd('0x30')](_0x1c1127[_0x0cdd('0x2c')][_0x0cdd('0x30')]));_0x579fdf[_0x0cdd('0x2f')]=_0x579fdf[_0x0cdd('0x2f')][_0x0cdd('0x31')]?_0x579fdf[_0x0cdd('0x2f')]:_0x8a62b5[_0x0cdd('0x2e')];_0x579fdf[_0x0cdd('0x47')]=qs[_0x0cdd('0x33')](_0x1c1127[_0x0cdd('0x2c')][_0x0cdd('0x33')]);_0x579fdf[_0x0cdd('0x34')]=qs['filters'](_[_0x0cdd('0x36')](_0x1c1127[_0x0cdd('0x2c')],_0x8a62b5[_0x0cdd('0x35')]));if(_0x1c1127[_0x0cdd('0x2c')][_0x0cdd('0x37')]){_0x579fdf['where']=_[_0x0cdd('0x39')](_0x579fdf[_0x0cdd('0x34')],{'$or':_[_0x0cdd('0x27')](_0x579fdf['attributes'],function(_0x146b82){var _0x2b881d={};_0x2b881d[_0x146b82]={'$like':'%'+_0x1c1127[_0x0cdd('0x2c')][_0x0cdd('0x37')]+'%'};return _0x2b881d;})});}_0x579fdf=_[_0x0cdd('0x39')]({},_0x579fdf,_0x1c1127[_0x0cdd('0x3a')]);return _0x634af5['getSubjects'](_0x579fdf);}})[_0x0cdd('0x21')](function(_0x24bd02){if(_0x24bd02){_0x3889f0=_0x24bd02[_0x0cdd('0x31')];if(!_0x1c1127['query'][_0x0cdd('0x32')](_0x0cdd('0x48'))){_0x579fdf[_0x0cdd('0x1a')]=qs[_0x0cdd('0x1a')](_0x1c1127[_0x0cdd('0x2c')][_0x0cdd('0x1a')]);_0x579fdf['offset']=qs[_0x0cdd('0x1c')](_0x1c1127[_0x0cdd('0x2c')][_0x0cdd('0x1c')]);}return _0x634af5['getSubjects'](_0x579fdf);}})[_0x0cdd('0x21')](function(_0x342931){if(_0x342931){return _0x342931?{'count':_0x3889f0,'rows':_0x342931}:null;}})[_0x0cdd('0x21')](respondWithResult(_0x26429a,null))['catch'](handleError(_0x26429a,null));};exports[_0x0cdd('0x4a')]=function(_0x2ae403,_0xdc7047,_0x436ff5){var _0x456048={};var _0x255339={};var _0x269f43;var _0x43da22;return db[_0x0cdd('0x28')][_0x0cdd('0x46')]({'where':{'id':_0x2ae403[_0x0cdd('0x40')]['id']}})[_0x0cdd('0x21')](handleEntityNotFound(_0xdc7047,null))[_0x0cdd('0x21')](function(_0x2247e6){if(_0x2247e6){_0x269f43=_0x2247e6;_0x255339['model']=_[_0x0cdd('0x41')](db[_0x0cdd('0x4b')][_0x0cdd('0x29')]);_0x255339[_0x0cdd('0x2c')]=_[_0x0cdd('0x41')](_0x2ae403[_0x0cdd('0x2c')]);_0x255339['filters']=_[_0x0cdd('0x2d')](_0x255339[_0x0cdd('0x2e')],_0x255339['query']);_0x456048[_0x0cdd('0x2f')]=_[_0x0cdd('0x2d')](_0x255339[_0x0cdd('0x2e')],qs[_0x0cdd('0x30')](_0x2ae403[_0x0cdd('0x2c')][_0x0cdd('0x30')]));_0x456048[_0x0cdd('0x2f')]=_0x456048[_0x0cdd('0x2f')]['length']?_0x456048[_0x0cdd('0x2f')]:_0x255339[_0x0cdd('0x2e')];_0x456048['order']=qs[_0x0cdd('0x33')](_0x2ae403[_0x0cdd('0x2c')][_0x0cdd('0x33')]);_0x456048[_0x0cdd('0x34')]=qs[_0x0cdd('0x35')](_[_0x0cdd('0x36')](_0x2ae403['query'],_0x255339[_0x0cdd('0x35')]));if(_0x2ae403['query'][_0x0cdd('0x37')]){_0x456048[_0x0cdd('0x34')]=_['merge'](_0x456048[_0x0cdd('0x34')],{'$or':_[_0x0cdd('0x27')](_0x456048[_0x0cdd('0x2f')],function(_0x24c974){var _0xe35462={};_0xe35462[_0x24c974]={'$like':'%'+_0x2ae403[_0x0cdd('0x2c')][_0x0cdd('0x37')]+'%'};return _0xe35462;})});}_0x456048=_[_0x0cdd('0x39')]({},_0x456048,_0x2ae403['options']);return _0x269f43[_0x0cdd('0x4a')](_0x456048);}})[_0x0cdd('0x21')](function(_0x1a2f41){if(_0x1a2f41){_0x43da22=_0x1a2f41[_0x0cdd('0x31')];if(!_0x2ae403[_0x0cdd('0x2c')][_0x0cdd('0x32')]('nolimit')){_0x456048[_0x0cdd('0x1a')]=qs[_0x0cdd('0x1a')](_0x2ae403[_0x0cdd('0x2c')][_0x0cdd('0x1a')]);_0x456048[_0x0cdd('0x1c')]=qs['offset'](_0x2ae403[_0x0cdd('0x2c')][_0x0cdd('0x1c')]);}return _0x269f43[_0x0cdd('0x4a')](_0x456048);}})['then'](function(_0x3372d6){if(_0x3372d6){return _0x3372d6?{'count':_0x43da22,'rows':_0x3372d6}:null;}})['then'](respondWithResult(_0xdc7047,null))[_0x0cdd('0x3e')](handleError(_0xdc7047,null));}; \ No newline at end of file diff --git a/server/api/intVtigerConfiguration/intVtigerConfiguration.model.js b/server/api/intVtigerConfiguration/intVtigerConfiguration.model.js index 0d3da87..5a3da6c 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 _0x9c06=['path','rimraf','../../config/environment','./intVtigerConfiguration.attributes','exports','VtigerConfiguration','int_vtiger_configurations','lodash','util','api','bluebird'];(function(_0x3b166b,_0x2c8ba1){var _0x579602=function(_0x8d7abc){while(--_0x8d7abc){_0x3b166b['push'](_0x3b166b['shift']());}};_0x579602(++_0x2c8ba1);}(_0x9c06,0x6a));var _0x69c0=function(_0x383d43,_0x3a51f6){_0x383d43=_0x383d43-0x0;var _0x5d75e6=_0x9c06[_0x383d43];return _0x5d75e6;};'use strict';var _=require(_0x69c0('0x0'));var util=require(_0x69c0('0x1'));var logger=require('../../config/logger')(_0x69c0('0x2'));var moment=require('moment');var BPromise=require(_0x69c0('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x69c0('0x4'));var rimraf=require(_0x69c0('0x5'));var config=require(_0x69c0('0x6'));var attributes=require(_0x69c0('0x7'));module[_0x69c0('0x8')]=function(_0x2e8603,_0x1f4751){return _0x2e8603['define'](_0x69c0('0x9'),attributes,{'tableName':_0x69c0('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x1531=['request-promise','path','rimraf','../../config/environment','define','VtigerConfiguration','int_vtiger_configurations','lodash','util','../../config/logger','api','bluebird'];(function(_0x5767b2,_0x4da302){var _0x5c746a=function(_0x518061){while(--_0x518061){_0x5767b2['push'](_0x5767b2['shift']());}};_0x5c746a(++_0x4da302);}(_0x1531,0x1db));var _0x1153=function(_0x583d65,_0x313889){_0x583d65=_0x583d65-0x0;var _0x4b5530=_0x1531[_0x583d65];return _0x4b5530;};'use strict';var _=require(_0x1153('0x0'));var util=require(_0x1153('0x1'));var logger=require(_0x1153('0x2'))(_0x1153('0x3'));var moment=require('moment');var BPromise=require(_0x1153('0x4'));var rp=require(_0x1153('0x5'));var fs=require('fs');var path=require(_0x1153('0x6'));var rimraf=require(_0x1153('0x7'));var config=require(_0x1153('0x8'));var attributes=require('./intVtigerConfiguration.attributes');module['exports']=function(_0x4ef3e3,_0x39bde3){return _0x4ef3e3[_0x1153('0x9')](_0x1153('0xa'),attributes,{'tableName':_0x1153('0xb'),'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 75ee269..dee2f7e 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 _0x7374=['../../config/environment','client','http','request','then','info','VtigerConfiguration,\x20%s,\x20%s','request\x20sent','stringify','error','message','result','catch','moment','randomstring','ioredis','../../mysqldb','../../config/utils'];(function(_0x21e034,_0x59fc14){var _0x1faab3=function(_0x2bd3ba){while(--_0x2bd3ba){_0x21e034['push'](_0x21e034['shift']());}};_0x1faab3(++_0x59fc14);}(_0x7374,0xe5));var _0x4737=function(_0x3588d8,_0x500a65){_0x3588d8=_0x3588d8-0x0;var _0x3bbf69=_0x7374[_0x3588d8];return _0x3bbf69;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x4737('0x0'));var BPromise=require('bluebird');var rs=require(_0x4737('0x1'));var fs=require('fs');var Redis=require(_0x4737('0x2'));var db=require(_0x4737('0x3'))['db'];var utils=require(_0x4737('0x4'));var logger=require('../../config/logger')('rpc');var config=require(_0x4737('0x5'));var jayson=require('jayson/promise');var client=jayson[_0x4737('0x6')][_0x4737('0x7')]({'port':0x232a});function respondWithRpcPromise(_0x28142f,_0x177733,_0x128f46){return new BPromise(function(_0x6dbc30,_0xf9b74b){return client[_0x4737('0x8')](_0x28142f,_0x128f46)[_0x4737('0x9')](function(_0x491d40){logger[_0x4737('0xa')](_0x4737('0xb'),_0x177733,_0x4737('0xc'));logger['debug']('VtigerConfiguration,\x20%s,\x20%s,\x20%s',_0x177733,_0x4737('0xc'),JSON[_0x4737('0xd')](_0x491d40));if(_0x491d40[_0x4737('0xe')]){if(_0x491d40['error']['code']===0x1f4){logger[_0x4737('0xe')]('VtigerConfiguration,\x20%s,\x20%s',_0x177733,_0x491d40[_0x4737('0xe')]['message']);return _0xf9b74b(_0x491d40['error'][_0x4737('0xf')]);}logger[_0x4737('0xe')]('VtigerConfiguration,\x20%s,\x20%s',_0x177733,_0x491d40['error'][_0x4737('0xf')]);return _0x6dbc30(_0x491d40[_0x4737('0xe')][_0x4737('0xf')]);}else{logger[_0x4737('0xa')](_0x4737('0xb'),_0x177733,'request\x20sent');_0x6dbc30(_0x491d40[_0x4737('0x10')][_0x4737('0xf')]);}})[_0x4737('0x11')](function(_0x5a41d6){logger['error']('VtigerConfiguration,\x20%s,\x20%s',_0x177733,_0x5a41d6);_0xf9b74b(_0x5a41d6);});});} \ No newline at end of file +var _0x172b=['catch','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','request','VtigerConfiguration,\x20%s,\x20%s','request\x20sent','debug','VtigerConfiguration,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result'];(function(_0x618414,_0x1a7a60){var _0x21c19a=function(_0x507b17){while(--_0x507b17){_0x618414['push'](_0x618414['shift']());}};_0x21c19a(++_0x1a7a60);}(_0x172b,0x109));var _0xb172=function(_0x406801,_0x44095b){_0x406801=_0x406801-0x0;var _0x58c4f0=_0x172b[_0x406801];return _0x58c4f0;};'use strict';var _=require(_0xb172('0x0'));var util=require(_0xb172('0x1'));var moment=require('moment');var BPromise=require(_0xb172('0x2'));var rs=require(_0xb172('0x3'));var fs=require('fs');var Redis=require(_0xb172('0x4'));var db=require(_0xb172('0x5'))['db'];var utils=require(_0xb172('0x6'));var logger=require(_0xb172('0x7'))(_0xb172('0x8'));var config=require(_0xb172('0x9'));var jayson=require(_0xb172('0xa'));var client=jayson[_0xb172('0xb')]['http']({'port':0x232a});function respondWithRpcPromise(_0x4b56b0,_0x26bf59,_0x2d1cca){return new BPromise(function(_0x5ad99e,_0x538bf6){return client[_0xb172('0xc')](_0x4b56b0,_0x2d1cca)['then'](function(_0x47350a){logger['info'](_0xb172('0xd'),_0x26bf59,_0xb172('0xe'));logger[_0xb172('0xf')](_0xb172('0x10'),_0x26bf59,'request\x20sent',JSON[_0xb172('0x11')](_0x47350a));if(_0x47350a[_0xb172('0x12')]){if(_0x47350a['error'][_0xb172('0x13')]===0x1f4){logger['error'](_0xb172('0xd'),_0x26bf59,_0x47350a[_0xb172('0x12')][_0xb172('0x14')]);return _0x538bf6(_0x47350a['error'][_0xb172('0x14')]);}logger['error'](_0xb172('0xd'),_0x26bf59,_0x47350a[_0xb172('0x12')][_0xb172('0x14')]);return _0x5ad99e(_0x47350a['error'][_0xb172('0x14')]);}else{logger[_0xb172('0x15')]('VtigerConfiguration,\x20%s,\x20%s',_0x26bf59,'request\x20sent');_0x5ad99e(_0x47350a[_0xb172('0x16')]['message']);}})[_0xb172('0x17')](function(_0x4468a6){logger[_0xb172('0x12')](_0xb172('0xd'),_0x26bf59,_0x4468a6);_0x538bf6(_0x4468a6);});});} \ No newline at end of file diff --git a/server/api/intVtigerField/index.js b/server/api/intVtigerField/index.js index c148bac..136f037 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 _0x6cb0=['path','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./intVtigerField.controller','get','isAuthenticated','show','post','create','/:id','update','delete','destroy','exports','util'];(function(_0xdf897a,_0xd23b65){var _0x3243dc=function(_0x4b6e7e){while(--_0x4b6e7e){_0xdf897a['push'](_0xdf897a['shift']());}};_0x3243dc(++_0xd23b65);}(_0x6cb0,0x98));var _0x06cb=function(_0x4e3bd3,_0x4f9cc4){_0x4e3bd3=_0x4e3bd3-0x0;var _0x1fb687=_0x6cb0[_0x4e3bd3];return _0x1fb687;};'use strict';var multer=require('multer');var util=require(_0x06cb('0x0'));var path=require(_0x06cb('0x1'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x06cb('0x2')]();var fs_extra=require(_0x06cb('0x3'));var auth=require(_0x06cb('0x4'));var interaction=require(_0x06cb('0x5'));var config=require('../../config/environment');var controller=require(_0x06cb('0x6'));router[_0x06cb('0x7')]('/',auth[_0x06cb('0x8')](),controller['index']);router[_0x06cb('0x7')]('/:id',auth[_0x06cb('0x8')](),controller[_0x06cb('0x9')]);router[_0x06cb('0xa')]('/',auth['isAuthenticated'](),controller[_0x06cb('0xb')]);router['put'](_0x06cb('0xc'),auth['isAuthenticated'](),controller[_0x06cb('0xd')]);router[_0x06cb('0xe')](_0x06cb('0xc'),auth[_0x06cb('0x8')](),controller[_0x06cb('0xf')]);module[_0x06cb('0x10')]=router; \ No newline at end of file +var _0xf1dd=['post','create','put','update','destroy','exports','util','fs-extra','../../components/auth/service','../../components/interaction/service','./intVtigerField.controller','get','isAuthenticated','index','/:id','show'];(function(_0x3c3770,_0x17a17b){var _0x57121a=function(_0x3909fa){while(--_0x3909fa){_0x3c3770['push'](_0x3c3770['shift']());}};_0x57121a(++_0x17a17b);}(_0xf1dd,0xe6));var _0xdf1d=function(_0x5302fb,_0x1a2db3){_0x5302fb=_0x5302fb-0x0;var _0x43e6a4=_0xf1dd[_0x5302fb];return _0x43e6a4;};'use strict';var multer=require('multer');var util=require(_0xdf1d('0x0'));var path=require('path');var timeout=require('connect-timeout');var express=require('express');var router=express['Router']();var fs_extra=require(_0xdf1d('0x1'));var auth=require(_0xdf1d('0x2'));var interaction=require(_0xdf1d('0x3'));var config=require('../../config/environment');var controller=require(_0xdf1d('0x4'));router[_0xdf1d('0x5')]('/',auth[_0xdf1d('0x6')](),controller[_0xdf1d('0x7')]);router[_0xdf1d('0x5')](_0xdf1d('0x8'),auth[_0xdf1d('0x6')](),controller[_0xdf1d('0x9')]);router[_0xdf1d('0xa')]('/',auth[_0xdf1d('0x6')](),controller[_0xdf1d('0xb')]);router[_0xdf1d('0xc')]('/:id',auth[_0xdf1d('0x6')](),controller[_0xdf1d('0xd')]);router['delete'](_0xdf1d('0x8'),auth[_0xdf1d('0x6')](),controller[_0xdf1d('0xe')]);module[_0xdf1d('0xf')]=router; \ No newline at end of file diff --git a/server/api/intVtigerField/intVtigerField.attributes.js b/server/api/intVtigerField/intVtigerField.attributes.js index c3e35bd..c926af3 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 _0x698a=['picklist','string','STRING','BOOLEAN','exports','ENUM','variable','customVariable'];(function(_0x403cff,_0x1cf463){var _0x5a7c56=function(_0x1bab9d){while(--_0x1bab9d){_0x403cff['push'](_0x403cff['shift']());}};_0x5a7c56(++_0x1cf463);}(_0x698a,0x94));var _0xa698=function(_0xf6bb7d,_0x8af4f5){_0xf6bb7d=_0xf6bb7d-0x0;var _0x132764=_0x698a[_0xf6bb7d];return _0x132764;};'use strict';var Sequelize=require('sequelize');module[_0xa698('0x0')]={'type':{'type':Sequelize[_0xa698('0x1')]('string',_0xa698('0x2'),_0xa698('0x3'),'keyValue',_0xa698('0x4')),'defaultValue':_0xa698('0x5')},'content':{'type':Sequelize[_0xa698('0x6')]},'key':{'type':Sequelize[_0xa698('0x6')]},'keyType':{'type':Sequelize[_0xa698('0x1')]('string',_0xa698('0x2'),_0xa698('0x3'))},'keyContent':{'type':Sequelize[_0xa698('0x6')]},'idField':{'type':Sequelize[_0xa698('0x6')]},'nameField':{'type':Sequelize['STRING']},'customField':{'type':Sequelize[_0xa698('0x7')],'defaultValue':!![]},'variableName':{'type':Sequelize[_0xa698('0x6')]}}; \ No newline at end of file +var _0x1897=['sequelize','exports','variable','keyValue','picklist','string','STRING','customVariable'];(function(_0x48a77f,_0x5b4c14){var _0xf51bfc=function(_0x422d4a){while(--_0x422d4a){_0x48a77f['push'](_0x48a77f['shift']());}};_0xf51bfc(++_0x5b4c14);}(_0x1897,0x110));var _0x7189=function(_0x2c30ab,_0x5398c6){_0x2c30ab=_0x2c30ab-0x0;var _0x20bb75=_0x1897[_0x2c30ab];return _0x20bb75;};'use strict';var Sequelize=require(_0x7189('0x0'));module[_0x7189('0x1')]={'type':{'type':Sequelize['ENUM']('string',_0x7189('0x2'),'customVariable',_0x7189('0x3'),_0x7189('0x4')),'defaultValue':_0x7189('0x5')},'content':{'type':Sequelize[_0x7189('0x6')]},'key':{'type':Sequelize[_0x7189('0x6')]},'keyType':{'type':Sequelize['ENUM'](_0x7189('0x5'),_0x7189('0x2'),_0x7189('0x7'))},'keyContent':{'type':Sequelize['STRING']},'idField':{'type':Sequelize[_0x7189('0x6')]},'nameField':{'type':Sequelize[_0x7189('0x6')]},'customField':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'variableName':{'type':Sequelize[_0x7189('0x6')]}}; \ No newline at end of file diff --git a/server/api/intVtigerField/intVtigerField.controller.js b/server/api/intVtigerField/intVtigerField.controller.js index a7e43a0..0e9688e 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 _0x78ba=['create','body','eml-format','zip-dir','request-promise','moment','bluebird','util','path','sox','to-csv','ejs','squel','crypto','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','sendStatus','status','end','json','undefined','count','offset','limit','set','Content-Range','apply','reject','save','update','then','destroy','error','stack','name','index','VtigerField','fieldName','type','map','query','keys','intersection','model','attributes','fields','length','nolimit','order','sort','where','pick','filters','filter','merge','VIRTUAL','options','include','rows','show','params','rawAttributes','includeAll','find','catch'];(function(_0x5547da,_0x1dbd91){var _0x53a783=function(_0x2cba74){while(--_0x2cba74){_0x5547da['push'](_0x5547da['shift']());}};_0x53a783(++_0x1dbd91);}(_0x78ba,0x1be));var _0xa78b=function(_0x47bc49,_0x294526){_0x47bc49=_0x47bc49-0x0;var _0x174582=_0x78ba[_0x47bc49];return _0x174582;};'use strict';var emlformat=require(_0xa78b('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xa78b('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0xa78b('0x2'));var moment=require(_0xa78b('0x3'));var BPromise=require(_0xa78b('0x4'));var Mustache=require('mustache');var util=require(_0xa78b('0x5'));var path=require(_0xa78b('0x6'));var sox=require(_0xa78b('0x7'));var csv=require(_0xa78b('0x8'));var ejs=require(_0xa78b('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0xa78b('0xa'));var crypto=require(_0xa78b('0xb'));var jsforce=require(_0xa78b('0xc'));var deskjs=require(_0xa78b('0xd'));var toCsv=require(_0xa78b('0x8'));var querystring=require(_0xa78b('0xe'));var Papa=require('papaparse');var Redis=require(_0xa78b('0xf'));var authService=require(_0xa78b('0x10'));var qs=require(_0xa78b('0x11'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xa78b('0x12'));var logger=require('../../config/logger')(_0xa78b('0x13'));var utils=require(_0xa78b('0x14'));var config=require(_0xa78b('0x15'));var licenseUtil=require(_0xa78b('0x16'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x41a9b2,_0x57ab18){_0x57ab18=_0x57ab18||0xcc;return function(_0x4fbf98){if(_0x4fbf98){return _0x41a9b2[_0xa78b('0x17')](_0x57ab18);}return _0x41a9b2[_0xa78b('0x18')](_0x57ab18)[_0xa78b('0x19')]();};}function respondWithResult(_0x36260e,_0x42836e){_0x42836e=_0x42836e||0xc8;return function(_0x4a1ffc){if(_0x4a1ffc){return _0x36260e[_0xa78b('0x18')](_0x42836e)[_0xa78b('0x1a')](_0x4a1ffc);}};}function respondWithFilteredResult(_0x2745b4,_0x27a71f){return function(_0x3a0f6f){if(_0x3a0f6f){var _0xa5e063=typeof _0x27a71f['offset']===_0xa78b('0x1b')&&typeof _0x27a71f['limit']===_0xa78b('0x1b');var _0x2d4577=_0x3a0f6f[_0xa78b('0x1c')];var _0x34b0b0=_0xa5e063?0x0:_0x27a71f[_0xa78b('0x1d')];var _0x596f8c=_0xa5e063?_0x3a0f6f[_0xa78b('0x1c')]:_0x27a71f[_0xa78b('0x1d')]+_0x27a71f[_0xa78b('0x1e')];var _0x3e13de;if(_0x596f8c>=_0x2d4577){_0x596f8c=_0x2d4577;_0x3e13de=0xc8;}else{_0x3e13de=0xce;}_0x2745b4[_0xa78b('0x18')](_0x3e13de);return _0x2745b4[_0xa78b('0x1f')](_0xa78b('0x20'),_0x34b0b0+'-'+_0x596f8c+'/'+_0x2d4577)[_0xa78b('0x1a')](_0x3a0f6f);}return null;};}function patchUpdates(_0x5184a9){return function(_0x96883c){try{jsonpatch[_0xa78b('0x21')](_0x96883c,_0x5184a9,!![]);}catch(_0x20dcdd){return BPromise[_0xa78b('0x22')](_0x20dcdd);}return _0x96883c[_0xa78b('0x23')]();};}function saveUpdates(_0x149a0a,_0x18bba5){return function(_0x305644){if(_0x305644){return _0x305644[_0xa78b('0x24')](_0x149a0a)[_0xa78b('0x25')](function(_0x1b2367){return _0x1b2367;});}return null;};}function removeEntity(_0x4e1c88,_0x20c751){return function(_0x58296b){if(_0x58296b){return _0x58296b[_0xa78b('0x26')]()['then'](function(){_0x4e1c88['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x31accc,_0x56dfd8){return function(_0xb00367){if(!_0xb00367){_0x31accc[_0xa78b('0x17')](0x194);}return _0xb00367;};}function handleError(_0x4ee08c,_0x145e24){_0x145e24=_0x145e24||0x1f4;return function(_0x305b19){logger[_0xa78b('0x27')](_0x305b19[_0xa78b('0x28')]);if(_0x305b19['name']){delete _0x305b19[_0xa78b('0x29')];}_0x4ee08c[_0xa78b('0x18')](_0x145e24)['send'](_0x305b19);};}exports[_0xa78b('0x2a')]=function(_0x1690b0,_0x252ff9){var _0x121364={},_0x117697={},_0x5e7db8={'count':0x0,'rows':[]};var _0x35a377=_['map'](db[_0xa78b('0x2b')]['rawAttributes'],function(_0x9ac6a1){return{'name':_0x9ac6a1[_0xa78b('0x2c')],'type':_0x9ac6a1[_0xa78b('0x2d')]['key']};});_0x117697['model']=_[_0xa78b('0x2e')](_0x35a377,_0xa78b('0x29'));_0x117697[_0xa78b('0x2f')]=_[_0xa78b('0x30')](_0x1690b0[_0xa78b('0x2f')]);_0x117697['filters']=_[_0xa78b('0x31')](_0x117697[_0xa78b('0x32')],_0x117697[_0xa78b('0x2f')]);_0x121364[_0xa78b('0x33')]=_[_0xa78b('0x31')](_0x117697['model'],qs[_0xa78b('0x34')](_0x1690b0[_0xa78b('0x2f')]['fields']));_0x121364[_0xa78b('0x33')]=_0x121364['attributes'][_0xa78b('0x35')]?_0x121364[_0xa78b('0x33')]:_0x117697['model'];if(!_0x1690b0[_0xa78b('0x2f')]['hasOwnProperty'](_0xa78b('0x36'))){_0x121364[_0xa78b('0x1e')]=qs['limit'](_0x1690b0[_0xa78b('0x2f')][_0xa78b('0x1e')]);_0x121364[_0xa78b('0x1d')]=qs['offset'](_0x1690b0['query'][_0xa78b('0x1d')]);}_0x121364[_0xa78b('0x37')]=qs[_0xa78b('0x38')](_0x1690b0['query'][_0xa78b('0x38')]);_0x121364[_0xa78b('0x39')]=qs['filters'](_[_0xa78b('0x3a')](_0x1690b0[_0xa78b('0x2f')],_0x117697[_0xa78b('0x3b')]),_0x35a377);if(_0x1690b0[_0xa78b('0x2f')][_0xa78b('0x3c')]){_0x121364['where']=_[_0xa78b('0x3d')](_0x121364[_0xa78b('0x39')],{'$or':_[_0xa78b('0x2e')](_0x35a377,function(_0x334612){if(_0x334612['type']!==_0xa78b('0x3e')){var _0x33d7c9={};_0x33d7c9[_0x334612[_0xa78b('0x29')]]={'$like':'%'+_0x1690b0[_0xa78b('0x2f')][_0xa78b('0x3c')]+'%'};return _0x33d7c9;}})});}_0x121364=_['merge']({},_0x121364,_0x1690b0[_0xa78b('0x3f')]);var _0x23fd31={'where':_0x121364[_0xa78b('0x39')]};return db[_0xa78b('0x2b')][_0xa78b('0x1c')](_0x23fd31)[_0xa78b('0x25')](function(_0x7ba99d){_0x5e7db8[_0xa78b('0x1c')]=_0x7ba99d;if(_0x1690b0[_0xa78b('0x2f')]['includeAll']){_0x121364[_0xa78b('0x40')]=[{'all':!![]}];}return db['VtigerField']['findAll'](_0x121364);})['then'](function(_0x494b80){_0x5e7db8[_0xa78b('0x41')]=_0x494b80;return _0x5e7db8;})[_0xa78b('0x25')](respondWithFilteredResult(_0x252ff9,_0x121364))['catch'](handleError(_0x252ff9,null));};exports[_0xa78b('0x42')]=function(_0x5b463f,_0x5908ff){var _0x5bdb95={'raw':!![],'where':{'id':_0x5b463f[_0xa78b('0x43')]['id']}},_0xf35a9c={};_0xf35a9c['model']=_[_0xa78b('0x30')](db[_0xa78b('0x2b')][_0xa78b('0x44')]);_0xf35a9c[_0xa78b('0x2f')]=_[_0xa78b('0x30')](_0x5b463f['query']);_0xf35a9c[_0xa78b('0x3b')]=_[_0xa78b('0x31')](_0xf35a9c[_0xa78b('0x32')],_0xf35a9c['query']);_0x5bdb95[_0xa78b('0x33')]=_[_0xa78b('0x31')](_0xf35a9c[_0xa78b('0x32')],qs[_0xa78b('0x34')](_0x5b463f[_0xa78b('0x2f')][_0xa78b('0x34')]));_0x5bdb95[_0xa78b('0x33')]=_0x5bdb95[_0xa78b('0x33')][_0xa78b('0x35')]?_0x5bdb95[_0xa78b('0x33')]:_0xf35a9c[_0xa78b('0x32')];if(_0x5b463f['query'][_0xa78b('0x45')]){_0x5bdb95[_0xa78b('0x40')]=[{'all':!![]}];}_0x5bdb95=_[_0xa78b('0x3d')]({},_0x5bdb95,_0x5b463f['options']);return db['VtigerField'][_0xa78b('0x46')](_0x5bdb95)['then'](handleEntityNotFound(_0x5908ff,null))[_0xa78b('0x25')](respondWithResult(_0x5908ff,null))[_0xa78b('0x47')](handleError(_0x5908ff,null));};exports[_0xa78b('0x48')]=function(_0x220310,_0x1e0e25){return db[_0xa78b('0x2b')]['create'](_0x220310[_0xa78b('0x49')],{})[_0xa78b('0x25')](respondWithResult(_0x1e0e25,0xc9))['catch'](handleError(_0x1e0e25,null));};exports[_0xa78b('0x24')]=function(_0x26197c,_0x4a0c32){if(_0x26197c[_0xa78b('0x49')]['id']){delete _0x26197c[_0xa78b('0x49')]['id'];}return db[_0xa78b('0x2b')]['find']({'where':{'id':_0x26197c[_0xa78b('0x43')]['id']}})[_0xa78b('0x25')](handleEntityNotFound(_0x4a0c32,null))[_0xa78b('0x25')](saveUpdates(_0x26197c[_0xa78b('0x49')],null))[_0xa78b('0x25')](respondWithResult(_0x4a0c32,null))[_0xa78b('0x47')](handleError(_0x4a0c32,null));};exports[_0xa78b('0x26')]=function(_0xc24955,_0x473b4b){return db[_0xa78b('0x2b')]['find']({'where':{'id':_0xc24955['params']['id']}})[_0xa78b('0x25')](handleEntityNotFound(_0x473b4b,null))[_0xa78b('0x25')](removeEntity(_0x473b4b,null))[_0xa78b('0x47')](handleError(_0x473b4b,null));}; \ No newline at end of file +var _0x73db=['save','then','destroy','error','stack','name','send','index','fieldName','type','model','map','query','keys','filters','attributes','intersection','fields','length','hasOwnProperty','nolimit','sort','where','pick','VIRTUAL','filter','merge','includeAll','include','VtigerField','rows','catch','show','params','rawAttributes','options','create','body','update','find','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject'];(function(_0x21fded,_0x203183){var _0x5927de=function(_0x1e5762){while(--_0x1e5762){_0x21fded['push'](_0x21fded['shift']());}};_0x5927de(++_0x203183);}(_0x73db,0x76));var _0xb73d=function(_0x3e9bcc,_0x5e04a1){_0x3e9bcc=_0x3e9bcc-0x0;var _0x11239d=_0x73db[_0x3e9bcc];return _0x11239d;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xb73d('0x0'));var zipdir=require(_0xb73d('0x1'));var jsonpatch=require(_0xb73d('0x2'));var rp=require(_0xb73d('0x3'));var moment=require(_0xb73d('0x4'));var BPromise=require(_0xb73d('0x5'));var Mustache=require(_0xb73d('0x6'));var util=require(_0xb73d('0x7'));var path=require('path');var sox=require(_0xb73d('0x8'));var csv=require(_0xb73d('0x9'));var ejs=require(_0xb73d('0xa'));var fs=require('fs');var fs_extra=require(_0xb73d('0xb'));var _=require(_0xb73d('0xc'));var squel=require(_0xb73d('0xd'));var crypto=require(_0xb73d('0xe'));var jsforce=require('jsforce');var deskjs=require(_0xb73d('0xf'));var toCsv=require(_0xb73d('0x9'));var querystring=require(_0xb73d('0x10'));var Papa=require(_0xb73d('0x11'));var Redis=require(_0xb73d('0x12'));var authService=require(_0xb73d('0x13'));var qs=require(_0xb73d('0x14'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xb73d('0x15'));var logger=require('../../config/logger')(_0xb73d('0x16'));var utils=require(_0xb73d('0x17'));var config=require('../../config/environment');var licenseUtil=require(_0xb73d('0x18'));var db=require(_0xb73d('0x19'))['db'];function respondWithStatusCode(_0x2722d0,_0x533252){_0x533252=_0x533252||0xcc;return function(_0x244913){if(_0x244913){return _0x2722d0[_0xb73d('0x1a')](_0x533252);}return _0x2722d0[_0xb73d('0x1b')](_0x533252)[_0xb73d('0x1c')]();};}function respondWithResult(_0xb79d18,_0x57f9cf){_0x57f9cf=_0x57f9cf||0xc8;return function(_0x53bb27){if(_0x53bb27){return _0xb79d18['status'](_0x57f9cf)[_0xb73d('0x1d')](_0x53bb27);}};}function respondWithFilteredResult(_0x473b9d,_0x2b2237){return function(_0x1b0e8c){if(_0x1b0e8c){var _0x3460c3=typeof _0x2b2237[_0xb73d('0x1e')]===_0xb73d('0x1f')&&typeof _0x2b2237[_0xb73d('0x20')]===_0xb73d('0x1f');var _0x10a606=_0x1b0e8c[_0xb73d('0x21')];var _0x180f41=_0x3460c3?0x0:_0x2b2237['offset'];var _0x30a12d=_0x3460c3?_0x1b0e8c[_0xb73d('0x21')]:_0x2b2237[_0xb73d('0x1e')]+_0x2b2237[_0xb73d('0x20')];var _0x383866;if(_0x30a12d>=_0x10a606){_0x30a12d=_0x10a606;_0x383866=0xc8;}else{_0x383866=0xce;}_0x473b9d[_0xb73d('0x1b')](_0x383866);return _0x473b9d[_0xb73d('0x22')](_0xb73d('0x23'),_0x180f41+'-'+_0x30a12d+'/'+_0x10a606)[_0xb73d('0x1d')](_0x1b0e8c);}return null;};}function patchUpdates(_0x33095e){return function(_0x48954f){try{jsonpatch[_0xb73d('0x24')](_0x48954f,_0x33095e,!![]);}catch(_0x512c46){return BPromise[_0xb73d('0x25')](_0x512c46);}return _0x48954f[_0xb73d('0x26')]();};}function saveUpdates(_0x15a522,_0x265576){return function(_0x22b0f7){if(_0x22b0f7){return _0x22b0f7['update'](_0x15a522)[_0xb73d('0x27')](function(_0x1a41fc){return _0x1a41fc;});}return null;};}function removeEntity(_0x28f8df,_0xc1cc69){return function(_0x1e74f){if(_0x1e74f){return _0x1e74f[_0xb73d('0x28')]()['then'](function(){_0x28f8df['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x51db9e,_0x4e0e27){return function(_0x50206d){if(!_0x50206d){_0x51db9e['sendStatus'](0x194);}return _0x50206d;};}function handleError(_0x40aca0,_0x2c015f){_0x2c015f=_0x2c015f||0x1f4;return function(_0x306dfa){logger[_0xb73d('0x29')](_0x306dfa[_0xb73d('0x2a')]);if(_0x306dfa[_0xb73d('0x2b')]){delete _0x306dfa['name'];}_0x40aca0[_0xb73d('0x1b')](_0x2c015f)[_0xb73d('0x2c')](_0x306dfa);};}exports[_0xb73d('0x2d')]=function(_0x4b73ea,_0x1866be){var _0x5dc78a={},_0x5b151c={},_0x15f629={'count':0x0,'rows':[]};var _0x52af05=_['map'](db['VtigerField']['rawAttributes'],function(_0x286cea){return{'name':_0x286cea[_0xb73d('0x2e')],'type':_0x286cea[_0xb73d('0x2f')]['key']};});_0x5b151c[_0xb73d('0x30')]=_[_0xb73d('0x31')](_0x52af05,_0xb73d('0x2b'));_0x5b151c[_0xb73d('0x32')]=_[_0xb73d('0x33')](_0x4b73ea[_0xb73d('0x32')]);_0x5b151c[_0xb73d('0x34')]=_['intersection'](_0x5b151c[_0xb73d('0x30')],_0x5b151c[_0xb73d('0x32')]);_0x5dc78a[_0xb73d('0x35')]=_[_0xb73d('0x36')](_0x5b151c[_0xb73d('0x30')],qs['fields'](_0x4b73ea['query'][_0xb73d('0x37')]));_0x5dc78a['attributes']=_0x5dc78a[_0xb73d('0x35')][_0xb73d('0x38')]?_0x5dc78a[_0xb73d('0x35')]:_0x5b151c[_0xb73d('0x30')];if(!_0x4b73ea['query'][_0xb73d('0x39')](_0xb73d('0x3a'))){_0x5dc78a['limit']=qs['limit'](_0x4b73ea[_0xb73d('0x32')]['limit']);_0x5dc78a[_0xb73d('0x1e')]=qs[_0xb73d('0x1e')](_0x4b73ea[_0xb73d('0x32')][_0xb73d('0x1e')]);}_0x5dc78a['order']=qs[_0xb73d('0x3b')](_0x4b73ea[_0xb73d('0x32')][_0xb73d('0x3b')]);_0x5dc78a[_0xb73d('0x3c')]=qs[_0xb73d('0x34')](_[_0xb73d('0x3d')](_0x4b73ea[_0xb73d('0x32')],_0x5b151c[_0xb73d('0x34')]),_0x52af05);if(_0x4b73ea[_0xb73d('0x32')]['filter']){_0x5dc78a[_0xb73d('0x3c')]=_['merge'](_0x5dc78a['where'],{'$or':_[_0xb73d('0x31')](_0x52af05,function(_0x1380cf){if(_0x1380cf[_0xb73d('0x2f')]!==_0xb73d('0x3e')){var _0xab32f3={};_0xab32f3[_0x1380cf[_0xb73d('0x2b')]]={'$like':'%'+_0x4b73ea[_0xb73d('0x32')][_0xb73d('0x3f')]+'%'};return _0xab32f3;}})});}_0x5dc78a=_[_0xb73d('0x40')]({},_0x5dc78a,_0x4b73ea['options']);var _0x31e7c3={'where':_0x5dc78a['where']};return db['VtigerField'][_0xb73d('0x21')](_0x31e7c3)[_0xb73d('0x27')](function(_0x4d8c16){_0x15f629[_0xb73d('0x21')]=_0x4d8c16;if(_0x4b73ea[_0xb73d('0x32')][_0xb73d('0x41')]){_0x5dc78a[_0xb73d('0x42')]=[{'all':!![]}];}return db[_0xb73d('0x43')]['findAll'](_0x5dc78a);})[_0xb73d('0x27')](function(_0x3db6bb){_0x15f629[_0xb73d('0x44')]=_0x3db6bb;return _0x15f629;})[_0xb73d('0x27')](respondWithFilteredResult(_0x1866be,_0x5dc78a))[_0xb73d('0x45')](handleError(_0x1866be,null));};exports[_0xb73d('0x46')]=function(_0x2a00d8,_0x1386cc){var _0x3826da={'raw':!![],'where':{'id':_0x2a00d8[_0xb73d('0x47')]['id']}},_0x31c59f={};_0x31c59f[_0xb73d('0x30')]=_[_0xb73d('0x33')](db['VtigerField'][_0xb73d('0x48')]);_0x31c59f[_0xb73d('0x32')]=_['keys'](_0x2a00d8[_0xb73d('0x32')]);_0x31c59f[_0xb73d('0x34')]=_[_0xb73d('0x36')](_0x31c59f['model'],_0x31c59f[_0xb73d('0x32')]);_0x3826da[_0xb73d('0x35')]=_[_0xb73d('0x36')](_0x31c59f['model'],qs[_0xb73d('0x37')](_0x2a00d8['query'][_0xb73d('0x37')]));_0x3826da['attributes']=_0x3826da[_0xb73d('0x35')][_0xb73d('0x38')]?_0x3826da[_0xb73d('0x35')]:_0x31c59f['model'];if(_0x2a00d8[_0xb73d('0x32')][_0xb73d('0x41')]){_0x3826da[_0xb73d('0x42')]=[{'all':!![]}];}_0x3826da=_[_0xb73d('0x40')]({},_0x3826da,_0x2a00d8[_0xb73d('0x49')]);return db['VtigerField']['find'](_0x3826da)[_0xb73d('0x27')](handleEntityNotFound(_0x1386cc,null))[_0xb73d('0x27')](respondWithResult(_0x1386cc,null))['catch'](handleError(_0x1386cc,null));};exports[_0xb73d('0x4a')]=function(_0x5cca21,_0x5e4dc8){return db[_0xb73d('0x43')][_0xb73d('0x4a')](_0x5cca21[_0xb73d('0x4b')],{})[_0xb73d('0x27')](respondWithResult(_0x5e4dc8,0xc9))['catch'](handleError(_0x5e4dc8,null));};exports[_0xb73d('0x4c')]=function(_0x3036a1,_0x4f71c1){if(_0x3036a1[_0xb73d('0x4b')]['id']){delete _0x3036a1['body']['id'];}return db[_0xb73d('0x43')][_0xb73d('0x4d')]({'where':{'id':_0x3036a1[_0xb73d('0x47')]['id']}})['then'](handleEntityNotFound(_0x4f71c1,null))['then'](saveUpdates(_0x3036a1['body'],null))[_0xb73d('0x27')](respondWithResult(_0x4f71c1,null))['catch'](handleError(_0x4f71c1,null));};exports[_0xb73d('0x28')]=function(_0x2908fa,_0x3a9697){return db['VtigerField']['find']({'where':{'id':_0x2908fa[_0xb73d('0x47')]['id']}})[_0xb73d('0x27')](handleEntityNotFound(_0x3a9697,null))[_0xb73d('0x27')](removeEntity(_0x3a9697,null))['catch'](handleError(_0x3a9697,null));}; \ No newline at end of file diff --git a/server/api/intVtigerField/intVtigerField.model.js b/server/api/intVtigerField/intVtigerField.model.js index c731620..71de9e5 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 _0x5a46=['lodash','util','../../config/logger','moment','request-promise','path','rimraf','./intVtigerField.attributes','exports','VtigerField','int_vtiger_fields','idField','FieldId'];(function(_0x2211ed,_0x1bca0b){var _0x4d78cc=function(_0x467b59){while(--_0x467b59){_0x2211ed['push'](_0x2211ed['shift']());}};_0x4d78cc(++_0x1bca0b);}(_0x5a46,0x68));var _0x65a4=function(_0x19ba79,_0x57cb16){_0x19ba79=_0x19ba79-0x0;var _0x966d6c=_0x5a46[_0x19ba79];return _0x966d6c;};'use strict';var _=require(_0x65a4('0x0'));var util=require(_0x65a4('0x1'));var logger=require(_0x65a4('0x2'))('api');var moment=require(_0x65a4('0x3'));var BPromise=require('bluebird');var rp=require(_0x65a4('0x4'));var fs=require('fs');var path=require(_0x65a4('0x5'));var rimraf=require(_0x65a4('0x6'));var config=require('../../config/environment');var attributes=require(_0x65a4('0x7'));module[_0x65a4('0x8')]=function(_0x45930e,_0x17511d){return _0x45930e['define'](_0x65a4('0x9'),attributes,{'tableName':_0x65a4('0xa'),'paranoid':![],'indexes':[{'name':'vtiger_unique_index','fields':[_0x65a4('0xb'),_0x65a4('0xc')],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file +var _0x8656=['moment','bluebird','request-promise','path','rimraf','../../config/environment','./intVtigerField.attributes','exports','define','int_vtiger_fields','vtiger_unique_index','idField','lodash','util','api'];(function(_0x1aaaaa,_0x351fb7){var _0x143966=function(_0x12161c){while(--_0x12161c){_0x1aaaaa['push'](_0x1aaaaa['shift']());}};_0x143966(++_0x351fb7);}(_0x8656,0x84));var _0x6865=function(_0xf937d7,_0x59d955){_0xf937d7=_0xf937d7-0x0;var _0x39edc8=_0x8656[_0xf937d7];return _0x39edc8;};'use strict';var _=require(_0x6865('0x0'));var util=require(_0x6865('0x1'));var logger=require('../../config/logger')(_0x6865('0x2'));var moment=require(_0x6865('0x3'));var BPromise=require(_0x6865('0x4'));var rp=require(_0x6865('0x5'));var fs=require('fs');var path=require(_0x6865('0x6'));var rimraf=require(_0x6865('0x7'));var config=require(_0x6865('0x8'));var attributes=require(_0x6865('0x9'));module[_0x6865('0xa')]=function(_0x199c3d,_0x2dee14){return _0x199c3d[_0x6865('0xb')]('VtigerField',attributes,{'tableName':_0x6865('0xc'),'paranoid':![],'indexes':[{'name':_0x6865('0xd'),'fields':[_0x6865('0xe'),'FieldId'],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/intVtigerField/intVtigerField.rpc.js b/server/api/intVtigerField/intVtigerField.rpc.js index 7ed4fc7..b8ce1e2 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 _0x9885=['then','info','VtigerField,\x20%s,\x20%s','request\x20sent','debug','VtigerField,\x20%s,\x20%s,\x20%s','stringify','error','code','message','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','http','request'];(function(_0x18e9f9,_0x4313c2){var _0x32922f=function(_0x2c3e81){while(--_0x2c3e81){_0x18e9f9['push'](_0x18e9f9['shift']());}};_0x32922f(++_0x4313c2);}(_0x9885,0x191));var _0x5988=function(_0x448faa,_0x12957d){_0x448faa=_0x448faa-0x0;var _0x5851f7=_0x9885[_0x448faa];return _0x5851f7;};'use strict';var _=require(_0x5988('0x0'));var util=require(_0x5988('0x1'));var moment=require(_0x5988('0x2'));var BPromise=require(_0x5988('0x3'));var rs=require(_0x5988('0x4'));var fs=require('fs');var Redis=require(_0x5988('0x5'));var db=require(_0x5988('0x6'))['db'];var utils=require(_0x5988('0x7'));var logger=require('../../config/logger')(_0x5988('0x8'));var config=require(_0x5988('0x9'));var jayson=require(_0x5988('0xa'));var client=jayson['client'][_0x5988('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x394436,_0x556bed,_0x4af41f){return new BPromise(function(_0x4888b6,_0x4bd76b){return client[_0x5988('0xc')](_0x394436,_0x4af41f)[_0x5988('0xd')](function(_0x12973c){logger[_0x5988('0xe')](_0x5988('0xf'),_0x556bed,_0x5988('0x10'));logger[_0x5988('0x11')](_0x5988('0x12'),_0x556bed,_0x5988('0x10'),JSON[_0x5988('0x13')](_0x12973c));if(_0x12973c[_0x5988('0x14')]){if(_0x12973c[_0x5988('0x14')][_0x5988('0x15')]===0x1f4){logger[_0x5988('0x14')](_0x5988('0xf'),_0x556bed,_0x12973c[_0x5988('0x14')]['message']);return _0x4bd76b(_0x12973c['error'][_0x5988('0x16')]);}logger[_0x5988('0x14')](_0x5988('0xf'),_0x556bed,_0x12973c['error'][_0x5988('0x16')]);return _0x4888b6(_0x12973c[_0x5988('0x14')][_0x5988('0x16')]);}else{logger[_0x5988('0xe')](_0x5988('0xf'),_0x556bed,_0x5988('0x10'));_0x4888b6(_0x12973c['result'][_0x5988('0x16')]);}})['catch'](function(_0x4702b6){logger[_0x5988('0x14')](_0x5988('0xf'),_0x556bed,_0x4702b6);_0x4bd76b(_0x4702b6);});});} \ No newline at end of file +var _0xc1f2=['http','request','info','VtigerField,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','result','catch','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise'];(function(_0x34a2d0,_0x28d689){var _0x1f41c9=function(_0x2a793c){while(--_0x2a793c){_0x34a2d0['push'](_0x34a2d0['shift']());}};_0x1f41c9(++_0x28d689);}(_0xc1f2,0xfe));var _0x2c1f=function(_0x1d9934,_0x15c292){_0x1d9934=_0x1d9934-0x0;var _0x3f8856=_0xc1f2[_0x1d9934];return _0x3f8856;};'use strict';var _=require(_0x2c1f('0x0'));var util=require('util');var moment=require(_0x2c1f('0x1'));var BPromise=require(_0x2c1f('0x2'));var rs=require(_0x2c1f('0x3'));var fs=require('fs');var Redis=require(_0x2c1f('0x4'));var db=require(_0x2c1f('0x5'))['db'];var utils=require(_0x2c1f('0x6'));var logger=require(_0x2c1f('0x7'))(_0x2c1f('0x8'));var config=require('../../config/environment');var jayson=require(_0x2c1f('0x9'));var client=jayson['client'][_0x2c1f('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x1a58d2,_0x468cf3,_0x1b5b2c){return new BPromise(function(_0x27c7e9,_0x53387c){return client[_0x2c1f('0xb')](_0x1a58d2,_0x1b5b2c)['then'](function(_0x370983){logger[_0x2c1f('0xc')](_0x2c1f('0xd'),_0x468cf3,_0x2c1f('0xe'));logger[_0x2c1f('0xf')]('VtigerField,\x20%s,\x20%s,\x20%s',_0x468cf3,_0x2c1f('0xe'),JSON[_0x2c1f('0x10')](_0x370983));if(_0x370983['error']){if(_0x370983[_0x2c1f('0x11')][_0x2c1f('0x12')]===0x1f4){logger[_0x2c1f('0x11')](_0x2c1f('0xd'),_0x468cf3,_0x370983['error'][_0x2c1f('0x13')]);return _0x53387c(_0x370983[_0x2c1f('0x11')][_0x2c1f('0x13')]);}logger[_0x2c1f('0x11')]('VtigerField,\x20%s,\x20%s',_0x468cf3,_0x370983['error']['message']);return _0x27c7e9(_0x370983[_0x2c1f('0x11')]['message']);}else{logger[_0x2c1f('0xc')]('VtigerField,\x20%s,\x20%s',_0x468cf3,_0x2c1f('0xe'));_0x27c7e9(_0x370983[_0x2c1f('0x14')][_0x2c1f('0x13')]);}})[_0x2c1f('0x15')](function(_0x19ce10){logger[_0x2c1f('0x11')](_0x2c1f('0xd'),_0x468cf3,_0x19ce10);_0x53387c(_0x19ce10);});});} \ No newline at end of file diff --git a/server/api/intZendeskAccount/index.js b/server/api/intZendeskAccount/index.js index 42695d7..fc26cc8 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 _0x563f=['exports','util','path','Router','../../components/interaction/service','../../config/environment','./intZendeskAccount.controller','get','isAuthenticated','/:id','show','/:id/configurations','getConfigurations','/:id/fields','getFields','post','addConfiguration','put','update'];(function(_0x37a7c6,_0x3a84b6){var _0x539905=function(_0xa00c20){while(--_0xa00c20){_0x37a7c6['push'](_0x37a7c6['shift']());}};_0x539905(++_0x3a84b6);}(_0x563f,0x86));var _0xf563=function(_0x3b380d,_0x4bf247){_0x3b380d=_0x3b380d-0x0;var _0x54502b=_0x563f[_0x3b380d];return _0x54502b;};'use strict';var multer=require('multer');var util=require(_0xf563('0x0'));var path=require(_0xf563('0x1'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0xf563('0x2')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0xf563('0x3'));var config=require(_0xf563('0x4'));var controller=require(_0xf563('0x5'));router[_0xf563('0x6')]('/',auth[_0xf563('0x7')](),controller['index']);router[_0xf563('0x6')](_0xf563('0x8'),auth[_0xf563('0x7')](),controller[_0xf563('0x9')]);router[_0xf563('0x6')](_0xf563('0xa'),auth[_0xf563('0x7')](),controller[_0xf563('0xb')]);router[_0xf563('0x6')](_0xf563('0xc'),auth[_0xf563('0x7')](),controller[_0xf563('0xd')]);router[_0xf563('0xe')]('/',auth[_0xf563('0x7')](),controller['create']);router[_0xf563('0xe')](_0xf563('0xa'),auth[_0xf563('0x7')](),controller[_0xf563('0xf')]);router[_0xf563('0x10')](_0xf563('0x8'),auth[_0xf563('0x7')](),controller[_0xf563('0x11')]);router['delete'](_0xf563('0x8'),auth[_0xf563('0x7')](),controller['destroy']);module[_0xf563('0x12')]=router; \ No newline at end of file +var _0x6d19=['destroy','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service','../../config/environment','./intZendeskAccount.controller','get','index','/:id','show','/:id/configurations','isAuthenticated','getConfigurations','getFields','post','create','addConfiguration','put','delete'];(function(_0x243b59,_0x3f9495){var _0x3e1676=function(_0x354052){while(--_0x354052){_0x243b59['push'](_0x243b59['shift']());}};_0x3e1676(++_0x3f9495);}(_0x6d19,0x160));var _0x96d1=function(_0xf79bae,_0x263b2a){_0xf79bae=_0xf79bae-0x0;var _0x5d2cb7=_0x6d19[_0xf79bae];return _0x5d2cb7;};'use strict';var multer=require(_0x96d1('0x0'));var util=require(_0x96d1('0x1'));var path=require(_0x96d1('0x2'));var timeout=require(_0x96d1('0x3'));var express=require(_0x96d1('0x4'));var router=express[_0x96d1('0x5')]();var fs_extra=require(_0x96d1('0x6'));var auth=require('../../components/auth/service');var interaction=require(_0x96d1('0x7'));var config=require(_0x96d1('0x8'));var controller=require(_0x96d1('0x9'));router[_0x96d1('0xa')]('/',auth['isAuthenticated'](),controller[_0x96d1('0xb')]);router[_0x96d1('0xa')](_0x96d1('0xc'),auth['isAuthenticated'](),controller[_0x96d1('0xd')]);router[_0x96d1('0xa')](_0x96d1('0xe'),auth[_0x96d1('0xf')](),controller[_0x96d1('0x10')]);router[_0x96d1('0xa')]('/:id/fields',auth['isAuthenticated'](),controller[_0x96d1('0x11')]);router[_0x96d1('0x12')]('/',auth['isAuthenticated'](),controller[_0x96d1('0x13')]);router['post'](_0x96d1('0xe'),auth[_0x96d1('0xf')](),controller[_0x96d1('0x14')]);router[_0x96d1('0x15')](_0x96d1('0xc'),auth[_0x96d1('0xf')](),controller['update']);router[_0x96d1('0x16')](_0x96d1('0xc'),auth[_0x96d1('0xf')](),controller[_0x96d1('0x17')]);module[_0x96d1('0x18')]=router; \ No newline at end of file diff --git a/server/api/intZendeskAccount/intZendeskAccount.attributes.js b/server/api/intZendeskAccount/intZendeskAccount.attributes.js index addf1b8..2be04f3 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 _0xd959=['password','token','integrationTab','newTab','sequelize','exports','STRING','username','ENUM'];(function(_0x2fd02e,_0x8ebcc5){var _0x4d7f54=function(_0x1437c0){while(--_0x1437c0){_0x2fd02e['push'](_0x2fd02e['shift']());}};_0x4d7f54(++_0x8ebcc5);}(_0xd959,0x94));var _0x9d95=function(_0x4be2c0,_0x3a8f8d){_0x4be2c0=_0x4be2c0-0x0;var _0x21275d=_0xd959[_0x4be2c0];return _0x21275d;};'use strict';var Sequelize=require(_0x9d95('0x0'));module[_0x9d95('0x1')]={'name':{'type':Sequelize[_0x9d95('0x2')]},'description':{'type':Sequelize['STRING']},'username':{'type':Sequelize[_0x9d95('0x2')],'unique':_0x9d95('0x3')},'password':{'type':Sequelize[_0x9d95('0x2')]},'token':{'type':Sequelize[_0x9d95('0x2')]},'remoteUri':{'type':Sequelize[_0x9d95('0x2')],'unique':'remoteUri'},'authType':{'type':Sequelize[_0x9d95('0x4')](_0x9d95('0x5'),_0x9d95('0x6')),'defaultValue':_0x9d95('0x5')},'serverUrl':{'type':Sequelize['STRING'],'allowNull':![]},'type':{'type':Sequelize[_0x9d95('0x4')](_0x9d95('0x7'),_0x9d95('0x8')),'defaultValue':'integrationTab'}}; \ No newline at end of file +var _0xcb22=['password','integrationTab','sequelize','exports','STRING','username','remoteUri','ENUM','token'];(function(_0x2e1266,_0x253797){var _0x20c755=function(_0x3161bc){while(--_0x3161bc){_0x2e1266['push'](_0x2e1266['shift']());}};_0x20c755(++_0x253797);}(_0xcb22,0xc8));var _0x2cb2=function(_0x1242ac,_0x50d8cd){_0x1242ac=_0x1242ac-0x0;var _0x26d81a=_0xcb22[_0x1242ac];return _0x26d81a;};'use strict';var Sequelize=require(_0x2cb2('0x0'));module[_0x2cb2('0x1')]={'name':{'type':Sequelize[_0x2cb2('0x2')]},'description':{'type':Sequelize[_0x2cb2('0x2')]},'username':{'type':Sequelize[_0x2cb2('0x2')],'unique':_0x2cb2('0x3')},'password':{'type':Sequelize[_0x2cb2('0x2')]},'token':{'type':Sequelize[_0x2cb2('0x2')]},'remoteUri':{'type':Sequelize[_0x2cb2('0x2')],'unique':_0x2cb2('0x4')},'authType':{'type':Sequelize[_0x2cb2('0x5')]('password',_0x2cb2('0x6')),'defaultValue':_0x2cb2('0x7')},'serverUrl':{'type':Sequelize[_0x2cb2('0x2')],'allowNull':![]},'type':{'type':Sequelize[_0x2cb2('0x5')](_0x2cb2('0x8'),'newTab'),'defaultValue':_0x2cb2('0x8')}}; \ No newline at end of file diff --git a/server/api/intZendeskAccount/intZendeskAccount.controller.js b/server/api/intZendeskAccount/intZendeskAccount.controller.js index d4487bc..5fda169 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 _0x351d=['Subjects','Descriptions','getFields','password','token','remoteUri','slice','substring','lastIndexOf','format','%s/%s','authType','headers','Basic\x20%s','%s:%s','username','toString','base64','%s/token:%s','ValidationError','Unknown\x20authentication\x20type','subject','description','group','assignee','ticket_fields','position','system_field_options','custom_field_options','test','statusCode','error','getFields,\x20%s,\x20%s,\x20%s','send','eml-format','zip-dir','fast-json-patch','request-promise','bluebird','util','path','to-csv','ejs','fs-extra','squel','crypto','desk.js','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/environment','../../components/integrations/configuration','status','end','json','undefined','count','offset','Content-Range','apply','reject','then','destroy','sendStatus','stack','index','rawAttributes','fieldName','type','model','map','name','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','limit','where','pick','filter','merge','options','ZendeskAccount','includeAll','findAll','catch','params','include','find','create','body','update','findOne','ZendeskConfiguration','order','sort','getConfigurations','addConfiguration','AccountId','getSubjects','getDescriptions','channel','ZendeskField'];(function(_0x3578f7,_0x596166){var _0x2af14c=function(_0x12fee0){while(--_0x12fee0){_0x3578f7['push'](_0x3578f7['shift']());}};_0x2af14c(++_0x596166);}(_0x351d,0x90));var _0xd351=function(_0x220476,_0x33807c){_0x220476=_0x220476-0x0;var _0x29cf54=_0x351d[_0x220476];return _0x29cf54;};'use strict';var emlformat=require(_0xd351('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xd351('0x1'));var jsonpatch=require(_0xd351('0x2'));var rp=require(_0xd351('0x3'));var moment=require('moment');var BPromise=require(_0xd351('0x4'));var Mustache=require('mustache');var util=require(_0xd351('0x5'));var path=require(_0xd351('0x6'));var sox=require('sox');var csv=require(_0xd351('0x7'));var ejs=require(_0xd351('0x8'));var fs=require('fs');var fs_extra=require(_0xd351('0x9'));var _=require('lodash');var squel=require(_0xd351('0xa'));var crypto=require(_0xd351('0xb'));var jsforce=require('jsforce');var deskjs=require(_0xd351('0xc'));var toCsv=require(_0xd351('0x7'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0xd351('0xd'));var authService=require('../../components/auth/service');var qs=require(_0xd351('0xe'));var as=require(_0xd351('0xf'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xd351('0x10'))(_0xd351('0x11'));var utils=require('../../config/utils');var config=require(_0xd351('0x12'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];var integrations=require(_0xd351('0x13'));function respondWithStatusCode(_0x15549a,_0x23445f){_0x23445f=_0x23445f||0xcc;return function(_0x1eb2a9){if(_0x1eb2a9){return _0x15549a['sendStatus'](_0x23445f);}return _0x15549a[_0xd351('0x14')](_0x23445f)[_0xd351('0x15')]();};}function respondWithResult(_0x597d7c,_0xc5a145){_0xc5a145=_0xc5a145||0xc8;return function(_0xb106ef){if(_0xb106ef){return _0x597d7c[_0xd351('0x14')](_0xc5a145)[_0xd351('0x16')](_0xb106ef);}};}function respondWithFilteredResult(_0x3867fb,_0x4d238c){return function(_0x9f790f){if(_0x9f790f){var _0x49d8bb=typeof _0x4d238c['offset']===_0xd351('0x17')&&typeof _0x4d238c['limit']===_0xd351('0x17');var _0x1de35f=_0x9f790f[_0xd351('0x18')];var _0x4c6693=_0x49d8bb?0x0:_0x4d238c[_0xd351('0x19')];var _0x2bfc53=_0x49d8bb?_0x9f790f[_0xd351('0x18')]:_0x4d238c[_0xd351('0x19')]+_0x4d238c['limit'];var _0xc2d2c0;if(_0x2bfc53>=_0x1de35f){_0x2bfc53=_0x1de35f;_0xc2d2c0=0xc8;}else{_0xc2d2c0=0xce;}_0x3867fb['status'](_0xc2d2c0);return _0x3867fb['set'](_0xd351('0x1a'),_0x4c6693+'-'+_0x2bfc53+'/'+_0x1de35f)['json'](_0x9f790f);}return null;};}function patchUpdates(_0x33b1e5){return function(_0x2d75dd){try{jsonpatch[_0xd351('0x1b')](_0x2d75dd,_0x33b1e5,!![]);}catch(_0x42631b){return BPromise[_0xd351('0x1c')](_0x42631b);}return _0x2d75dd['save']();};}function saveUpdates(_0x18625b,_0xbbc58){return function(_0x241265){if(_0x241265){return _0x241265['update'](_0x18625b)[_0xd351('0x1d')](function(_0x2d9aa0){return _0x2d9aa0;});}return null;};}function removeEntity(_0x365bbc,_0x59fb6d){return function(_0x1ce279){if(_0x1ce279){return _0x1ce279[_0xd351('0x1e')]()[_0xd351('0x1d')](function(){_0x365bbc[_0xd351('0x14')](0xcc)['end']();});}};}function handleEntityNotFound(_0x40f7f3,_0x483c92){return function(_0x358bff){if(!_0x358bff){_0x40f7f3[_0xd351('0x1f')](0x194);}return _0x358bff;};}function handleError(_0x54f471,_0x2648d0){_0x2648d0=_0x2648d0||0x1f4;return function(_0x55b4d3){logger['error'](_0x55b4d3[_0xd351('0x20')]);if(_0x55b4d3['name']){delete _0x55b4d3['name'];}_0x54f471[_0xd351('0x14')](_0x2648d0)['send'](_0x55b4d3);};}exports[_0xd351('0x21')]=function(_0x2ddae8,_0x407b50){var _0x4d3f48={},_0x71ce9c={},_0x4aa902={'count':0x0,'rows':[]};var _0x1c826b=_['map'](db['ZendeskAccount'][_0xd351('0x22')],function(_0x38c82f){return{'name':_0x38c82f[_0xd351('0x23')],'type':_0x38c82f[_0xd351('0x24')]['key']};});_0x71ce9c[_0xd351('0x25')]=_[_0xd351('0x26')](_0x1c826b,_0xd351('0x27'));_0x71ce9c[_0xd351('0x28')]=_[_0xd351('0x29')](_0x2ddae8[_0xd351('0x28')]);_0x71ce9c[_0xd351('0x2a')]=_[_0xd351('0x2b')](_0x71ce9c[_0xd351('0x25')],_0x71ce9c['query']);_0x4d3f48[_0xd351('0x2c')]=_[_0xd351('0x2b')](_0x71ce9c[_0xd351('0x25')],qs[_0xd351('0x2d')](_0x2ddae8['query'][_0xd351('0x2d')]));_0x4d3f48[_0xd351('0x2c')]=_0x4d3f48[_0xd351('0x2c')][_0xd351('0x2e')]?_0x4d3f48[_0xd351('0x2c')]:_0x71ce9c[_0xd351('0x25')];if(!_0x2ddae8[_0xd351('0x28')][_0xd351('0x2f')](_0xd351('0x30'))){_0x4d3f48['limit']=qs['limit'](_0x2ddae8[_0xd351('0x28')][_0xd351('0x31')]);_0x4d3f48[_0xd351('0x19')]=qs[_0xd351('0x19')](_0x2ddae8[_0xd351('0x28')][_0xd351('0x19')]);}_0x4d3f48['order']=qs['sort'](_0x2ddae8[_0xd351('0x28')]['sort']);_0x4d3f48[_0xd351('0x32')]=qs[_0xd351('0x2a')](_[_0xd351('0x33')](_0x2ddae8[_0xd351('0x28')],_0x71ce9c[_0xd351('0x2a')]),_0x1c826b);if(_0x2ddae8[_0xd351('0x28')][_0xd351('0x34')]){_0x4d3f48[_0xd351('0x32')]=_[_0xd351('0x35')](_0x4d3f48[_0xd351('0x32')],{'$or':_[_0xd351('0x26')](_0x1c826b,function(_0x4b15db){if(_0x4b15db[_0xd351('0x24')]!=='VIRTUAL'){var _0x22631={};_0x22631[_0x4b15db[_0xd351('0x27')]]={'$like':'%'+_0x2ddae8[_0xd351('0x28')][_0xd351('0x34')]+'%'};return _0x22631;}})});}_0x4d3f48=_[_0xd351('0x35')]({},_0x4d3f48,_0x2ddae8[_0xd351('0x36')]);var _0x545bfc={'where':_0x4d3f48[_0xd351('0x32')]};return db[_0xd351('0x37')]['count'](_0x545bfc)[_0xd351('0x1d')](function(_0x2d8ea8){_0x4aa902[_0xd351('0x18')]=_0x2d8ea8;if(_0x2ddae8[_0xd351('0x28')][_0xd351('0x38')]){_0x4d3f48['include']=[{'all':!![]}];}return db['ZendeskAccount'][_0xd351('0x39')](_0x4d3f48);})[_0xd351('0x1d')](function(_0x5dae6d){_0x4aa902['rows']=_0x5dae6d;return _0x4aa902;})[_0xd351('0x1d')](respondWithFilteredResult(_0x407b50,_0x4d3f48))[_0xd351('0x3a')](handleError(_0x407b50,null));};exports['show']=function(_0x570d57,_0x46af23){var _0x18f9d1={'raw':![],'where':{'id':_0x570d57[_0xd351('0x3b')]['id']}},_0x3b8526={};_0x3b8526[_0xd351('0x25')]=_[_0xd351('0x29')](db[_0xd351('0x37')][_0xd351('0x22')]);_0x3b8526[_0xd351('0x28')]=_['keys'](_0x570d57['query']);_0x3b8526[_0xd351('0x2a')]=_[_0xd351('0x2b')](_0x3b8526[_0xd351('0x25')],_0x3b8526[_0xd351('0x28')]);_0x18f9d1[_0xd351('0x2c')]=_[_0xd351('0x2b')](_0x3b8526[_0xd351('0x25')],qs[_0xd351('0x2d')](_0x570d57[_0xd351('0x28')][_0xd351('0x2d')]));_0x18f9d1[_0xd351('0x2c')]=_0x18f9d1[_0xd351('0x2c')][_0xd351('0x2e')]?_0x18f9d1[_0xd351('0x2c')]:_0x3b8526[_0xd351('0x25')];if(_0x570d57[_0xd351('0x28')]['includeAll']){_0x18f9d1[_0xd351('0x3c')]=[{'all':!![]}];}_0x18f9d1=_[_0xd351('0x35')]({},_0x18f9d1,_0x570d57[_0xd351('0x36')]);return db['ZendeskAccount'][_0xd351('0x3d')](_0x18f9d1)[_0xd351('0x1d')](handleEntityNotFound(_0x46af23,null))[_0xd351('0x1d')](respondWithResult(_0x46af23,null))[_0xd351('0x3a')](handleError(_0x46af23,null));};exports[_0xd351('0x3e')]=function(_0x5bc86a,_0x5adea4){return db['ZendeskAccount'][_0xd351('0x3e')](_0x5bc86a[_0xd351('0x3f')],{})['then'](respondWithResult(_0x5adea4,0xc9))['catch'](handleError(_0x5adea4,null));};exports[_0xd351('0x40')]=function(_0x444206,_0x2af877){if(_0x444206['body']['id']){delete _0x444206[_0xd351('0x3f')]['id'];}return db[_0xd351('0x37')]['find']({'where':{'id':_0x444206[_0xd351('0x3b')]['id']}})['then'](handleEntityNotFound(_0x2af877,null))[_0xd351('0x1d')](saveUpdates(_0x444206[_0xd351('0x3f')],null))['then'](respondWithResult(_0x2af877,null))['catch'](handleError(_0x2af877,null));};exports[_0xd351('0x1e')]=function(_0x58ce5a,_0xf9f375){return db[_0xd351('0x37')][_0xd351('0x3d')]({'where':{'id':_0x58ce5a['params']['id']}})[_0xd351('0x1d')](handleEntityNotFound(_0xf9f375,null))['then'](removeEntity(_0xf9f375,null))['catch'](handleError(_0xf9f375,null));};exports['getConfigurations']=function(_0x7e4bad,_0x292af3,_0x334029){var _0x5a2e9b={};var _0x554e3a={};var _0x1748f0;var _0x42f248;return db['ZendeskAccount'][_0xd351('0x41')]({'where':{'id':_0x7e4bad[_0xd351('0x3b')]['id']}})['then'](handleEntityNotFound(_0x292af3,null))[_0xd351('0x1d')](function(_0x59ab0f){if(_0x59ab0f){_0x1748f0=_0x59ab0f;_0x554e3a[_0xd351('0x25')]=_['keys'](db[_0xd351('0x42')][_0xd351('0x22')]);_0x554e3a[_0xd351('0x28')]=_[_0xd351('0x29')](_0x7e4bad[_0xd351('0x28')]);_0x554e3a[_0xd351('0x2a')]=_[_0xd351('0x2b')](_0x554e3a['model'],_0x554e3a['query']);_0x5a2e9b[_0xd351('0x2c')]=_[_0xd351('0x2b')](_0x554e3a['model'],qs[_0xd351('0x2d')](_0x7e4bad[_0xd351('0x28')][_0xd351('0x2d')]));_0x5a2e9b['attributes']=_0x5a2e9b[_0xd351('0x2c')]['length']?_0x5a2e9b['attributes']:_0x554e3a[_0xd351('0x25')];_0x5a2e9b[_0xd351('0x43')]=qs['sort'](_0x7e4bad[_0xd351('0x28')][_0xd351('0x44')]);_0x5a2e9b[_0xd351('0x32')]=qs[_0xd351('0x2a')](_[_0xd351('0x33')](_0x7e4bad[_0xd351('0x28')],_0x554e3a['filters']));if(_0x7e4bad[_0xd351('0x28')][_0xd351('0x34')]){_0x5a2e9b[_0xd351('0x32')]=_[_0xd351('0x35')](_0x5a2e9b[_0xd351('0x32')],{'$or':_[_0xd351('0x26')](_0x5a2e9b[_0xd351('0x2c')],function(_0x4b2029){var _0x24dcdb={};_0x24dcdb[_0x4b2029]={'$like':'%'+_0x7e4bad['query'][_0xd351('0x34')]+'%'};return _0x24dcdb;})});}_0x5a2e9b=_[_0xd351('0x35')]({},_0x5a2e9b,_0x7e4bad[_0xd351('0x36')]);return _0x1748f0[_0xd351('0x45')](_0x5a2e9b);}})[_0xd351('0x1d')](function(_0x4eaf18){if(_0x4eaf18){_0x42f248=_0x4eaf18[_0xd351('0x2e')];if(!_0x7e4bad['query'][_0xd351('0x2f')](_0xd351('0x30'))){_0x5a2e9b[_0xd351('0x31')]=qs[_0xd351('0x31')](_0x7e4bad[_0xd351('0x28')]['limit']);_0x5a2e9b['offset']=qs[_0xd351('0x19')](_0x7e4bad[_0xd351('0x28')]['offset']);}return _0x1748f0[_0xd351('0x45')](_0x5a2e9b);}})[_0xd351('0x1d')](function(_0x2718e9){if(_0x2718e9){return _0x2718e9?{'count':_0x42f248,'rows':_0x2718e9}:null;}})['then'](respondWithResult(_0x292af3,null))[_0xd351('0x3a')](handleError(_0x292af3,null));};exports[_0xd351('0x46')]=function(_0x284d12,_0x5dbdef,_0x5d13ec){if(_0x284d12['body']['id']){delete _0x284d12[_0xd351('0x3f')]['id'];}return db[_0xd351('0x37')][_0xd351('0x41')]({'where':{'id':_0x284d12[_0xd351('0x3b')]['id']}})[_0xd351('0x1d')](handleEntityNotFound(_0x5dbdef,null))[_0xd351('0x1d')](function(_0x2c83fe){if(_0x2c83fe){_0x284d12['body'][_0xd351('0x47')]=_0x2c83fe['id'];_0x284d12['body']['Subjects']=integrations[_0xd351('0x48')](_0x284d12[_0xd351('0x3f')]['channel'],_0x284d12[_0xd351('0x3f')]['type']);_0x284d12['body']['Descriptions']=integrations[_0xd351('0x49')](_0x284d12[_0xd351('0x3f')][_0xd351('0x4a')],_0x284d12['body'][_0xd351('0x24')]);return db[_0xd351('0x42')][_0xd351('0x3e')](_0x284d12[_0xd351('0x3f')],{'include':[{'model':db[_0xd351('0x4b')],'as':_0xd351('0x4c')},{'model':db[_0xd351('0x4b')],'as':_0xd351('0x4d')}]});}return null;})[_0xd351('0x1d')](respondWithResult(_0x5dbdef,null))[_0xd351('0x3a')](handleError(_0x5dbdef,null));};exports[_0xd351('0x4e')]=function(_0x4d20af,_0x2fcede,_0x2d59a5){var _0x431e91='';return db[_0xd351('0x37')][_0xd351('0x41')]({'where':{'id':_0x4d20af[_0xd351('0x3b')]['id']},'attributes':['id','username',_0xd351('0x4f'),_0xd351('0x50'),'authType','remoteUri']})[_0xd351('0x1d')](handleEntityNotFound(_0x2fcede,null))[_0xd351('0x1d')](function(_0x44dc58){if(_0x44dc58){_0x431e91=_0x44dc58[_0xd351('0x51')];var _0x1db455=_0x431e91[_0xd351('0x52')](-0x1);if(_0x1db455==='/'){_0x431e91=_0x431e91[_0xd351('0x53')](0x0,_0x431e91[_0xd351('0x54')](_0x1db455));}var _0x3ce2b9={'method':'GET','uri':util[_0xd351('0x55')](_0xd351('0x56'),_0x431e91,'ticket_fields'),'json':!![]};switch(_0x44dc58[_0xd351('0x57')]){case'password':_0x3ce2b9[_0xd351('0x58')]={'Authorization':util['format'](_0xd351('0x59'),new Buffer(util[_0xd351('0x55')](_0xd351('0x5a'),_0x44dc58[_0xd351('0x5b')],_0x44dc58[_0xd351('0x4f')]))[_0xd351('0x5c')](_0xd351('0x5d')))};break;case'token':_0x3ce2b9[_0xd351('0x58')]={'Authorization':util[_0xd351('0x55')](_0xd351('0x59'),new Buffer(util[_0xd351('0x55')](_0xd351('0x5e'),_0x44dc58['username'],_0x44dc58[_0xd351('0x50')]))[_0xd351('0x5c')](_0xd351('0x5d')))};break;default:throw new db['Sequelize'][(_0xd351('0x5f'))](_0xd351('0x60'));}return rp(_0x3ce2b9);}})[_0xd351('0x1d')](function(_0x3f0d27){if(_0x3f0d27){var _0x3635ad=[_0xd351('0x61'),_0xd351('0x62'),_0xd351('0x63'),_0xd351('0x64')];_['remove'](_0x3f0d27[_0xd351('0x65')],function(_0x190a00){return _0x3635ad['includes'](_0x190a00[_0xd351('0x24')]);});return{'count':_0x3f0d27['ticket_fields']['length'],'rows':_['map'](_0x3f0d27[_0xd351('0x65')],function(_0x3367f8){return{'id':_0x3367f8['id'],'name':_0x3367f8[_0xd351('0x66')]>0x7?_0x3367f8['title']:_0x3367f8[_0xd351('0x24')],'custom':_0x3367f8['position']>0x7?!![]:![],'options':_0x3367f8[_0xd351('0x67')]?_0x3367f8['system_field_options']:_0x3367f8[_0xd351('0x68')]?_0x3367f8[_0xd351('0x68')]:[]};})};}})[_0xd351('0x1d')](respondWithResult(_0x2fcede,null))[_0xd351('0x3a')](function(_0x35b148){var _0x1bb955=_0x4d20af[_0xd351('0x28')][_0xd351('0x69')]?0x1f4:_0x35b148[_0xd351('0x6a')]||0x1f4;logger[_0xd351('0x6b')](_0xd351('0x6c'),_0xd351('0x4e'),_0x1bb955,JSON['stringify'](_0x35b148));delete _0x35b148[_0xd351('0x27')];if(_0x1bb955===0x191){_0x1bb955=0x190;}_0x2fcede[_0xd351('0x14')](_0x1bb955)[_0xd351('0x6d')](_0x4d20af[_0xd351('0x28')][_0xd351('0x69')]?{'message':'Wrong\x20credentials','statusCode':_0x35b148[_0xd351('0x6a')]}:_0x35b148);});}; \ No newline at end of file +var _0xd8b0=['ZendeskAccount','includeAll','include','findAll','rows','catch','params','keys','find','create','body','ZendeskConfiguration','options','getConfigurations','AccountId','Subjects','getSubjects','channel','Descriptions','getDescriptions','ZendeskField','getFields','findOne','username','token','authType','remoteUri','slice','substring','lastIndexOf','GET','format','%s/%s','ticket_fields','headers','Basic\x20%s','toString','base64','%s/token:%s','Sequelize','ValidationError','Unknown\x20authentication\x20type','subject','description','group','assignee','remove','includes','position','system_field_options','custom_field_options','test','statusCode','error','stringify','Wrong\x20credentials','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','../../components/integrations/configuration','sendStatus','status','end','offset','limit','undefined','count','set','Content-Range','json','reject','update','then','destroy','name','send','map','rawAttributes','fieldName','query','filters','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','order','sort','pick','filter','where','merge','type','VIRTUAL'];(function(_0x9dfc10,_0x19c2d5){var _0x4f938a=function(_0x12b1e5){while(--_0x12b1e5){_0x9dfc10['push'](_0x9dfc10['shift']());}};_0x4f938a(++_0x19c2d5);}(_0xd8b0,0xad));var _0x0d8b=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0xd8b0[_0x20a584];return _0x4b41a8;};'use strict';var emlformat=require(_0x0d8b('0x0'));var rimraf=require(_0x0d8b('0x1'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0x0d8b('0x2'));var BPromise=require(_0x0d8b('0x3'));var Mustache=require(_0x0d8b('0x4'));var util=require(_0x0d8b('0x5'));var path=require(_0x0d8b('0x6'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0x0d8b('0x7'));var fs=require('fs');var fs_extra=require(_0x0d8b('0x8'));var _=require(_0x0d8b('0x9'));var squel=require('squel');var crypto=require(_0x0d8b('0xa'));var jsforce=require(_0x0d8b('0xb'));var deskjs=require('desk.js');var toCsv=require(_0x0d8b('0xc'));var querystring=require(_0x0d8b('0xd'));var Papa=require(_0x0d8b('0xe'));var Redis=require(_0x0d8b('0xf'));var authService=require(_0x0d8b('0x10'));var qs=require(_0x0d8b('0x11'));var as=require(_0x0d8b('0x12'));var hardwareService=require(_0x0d8b('0x13'));var logger=require('../../config/logger')(_0x0d8b('0x14'));var utils=require('../../config/utils');var config=require(_0x0d8b('0x15'));var licenseUtil=require(_0x0d8b('0x16'));var db=require(_0x0d8b('0x17'))['db'];var integrations=require(_0x0d8b('0x18'));function respondWithStatusCode(_0x35a07b,_0x32bb1a){_0x32bb1a=_0x32bb1a||0xcc;return function(_0x15dd0f){if(_0x15dd0f){return _0x35a07b[_0x0d8b('0x19')](_0x32bb1a);}return _0x35a07b[_0x0d8b('0x1a')](_0x32bb1a)[_0x0d8b('0x1b')]();};}function respondWithResult(_0x5ad086,_0xe65334){_0xe65334=_0xe65334||0xc8;return function(_0x1567ce){if(_0x1567ce){return _0x5ad086[_0x0d8b('0x1a')](_0xe65334)['json'](_0x1567ce);}};}function respondWithFilteredResult(_0x23eb7b,_0xa86349){return function(_0x17f7df){if(_0x17f7df){var _0xe2e167=typeof _0xa86349[_0x0d8b('0x1c')]==='undefined'&&typeof _0xa86349[_0x0d8b('0x1d')]===_0x0d8b('0x1e');var _0x2fd0fc=_0x17f7df[_0x0d8b('0x1f')];var _0x333674=_0xe2e167?0x0:_0xa86349[_0x0d8b('0x1c')];var _0x264b39=_0xe2e167?_0x17f7df[_0x0d8b('0x1f')]:_0xa86349['offset']+_0xa86349[_0x0d8b('0x1d')];var _0x23d58f;if(_0x264b39>=_0x2fd0fc){_0x264b39=_0x2fd0fc;_0x23d58f=0xc8;}else{_0x23d58f=0xce;}_0x23eb7b[_0x0d8b('0x1a')](_0x23d58f);return _0x23eb7b[_0x0d8b('0x20')](_0x0d8b('0x21'),_0x333674+'-'+_0x264b39+'/'+_0x2fd0fc)[_0x0d8b('0x22')](_0x17f7df);}return null;};}function patchUpdates(_0x393beb){return function(_0x352c17){try{jsonpatch['apply'](_0x352c17,_0x393beb,!![]);}catch(_0x4f0a1a){return BPromise[_0x0d8b('0x23')](_0x4f0a1a);}return _0x352c17['save']();};}function saveUpdates(_0x56c729,_0x5527d8){return function(_0x238728){if(_0x238728){return _0x238728[_0x0d8b('0x24')](_0x56c729)[_0x0d8b('0x25')](function(_0x38efc8){return _0x38efc8;});}return null;};}function removeEntity(_0x221071,_0x2c64e2){return function(_0x30980c){if(_0x30980c){return _0x30980c[_0x0d8b('0x26')]()[_0x0d8b('0x25')](function(){_0x221071['status'](0xcc)[_0x0d8b('0x1b')]();});}};}function handleEntityNotFound(_0x4463ee,_0x5363e3){return function(_0xe1ef20){if(!_0xe1ef20){_0x4463ee['sendStatus'](0x194);}return _0xe1ef20;};}function handleError(_0x3dd149,_0x234bdd){_0x234bdd=_0x234bdd||0x1f4;return function(_0xa2af02){logger['error'](_0xa2af02['stack']);if(_0xa2af02[_0x0d8b('0x27')]){delete _0xa2af02[_0x0d8b('0x27')];}_0x3dd149['status'](_0x234bdd)[_0x0d8b('0x28')](_0xa2af02);};}exports['index']=function(_0x1b2b59,_0x4b59e5){var _0x97050a={},_0x48f24f={},_0x2ab00d={'count':0x0,'rows':[]};var _0x546bf6=_[_0x0d8b('0x29')](db['ZendeskAccount'][_0x0d8b('0x2a')],function(_0x106e4c){return{'name':_0x106e4c[_0x0d8b('0x2b')],'type':_0x106e4c['type']['key']};});_0x48f24f['model']=_[_0x0d8b('0x29')](_0x546bf6,'name');_0x48f24f[_0x0d8b('0x2c')]=_['keys'](_0x1b2b59['query']);_0x48f24f[_0x0d8b('0x2d')]=_[_0x0d8b('0x2e')](_0x48f24f[_0x0d8b('0x2f')],_0x48f24f[_0x0d8b('0x2c')]);_0x97050a[_0x0d8b('0x30')]=_[_0x0d8b('0x2e')](_0x48f24f[_0x0d8b('0x2f')],qs[_0x0d8b('0x31')](_0x1b2b59['query'][_0x0d8b('0x31')]));_0x97050a[_0x0d8b('0x30')]=_0x97050a['attributes'][_0x0d8b('0x32')]?_0x97050a[_0x0d8b('0x30')]:_0x48f24f[_0x0d8b('0x2f')];if(!_0x1b2b59['query'][_0x0d8b('0x33')](_0x0d8b('0x34'))){_0x97050a[_0x0d8b('0x1d')]=qs[_0x0d8b('0x1d')](_0x1b2b59[_0x0d8b('0x2c')]['limit']);_0x97050a[_0x0d8b('0x1c')]=qs[_0x0d8b('0x1c')](_0x1b2b59['query'][_0x0d8b('0x1c')]);}_0x97050a[_0x0d8b('0x35')]=qs[_0x0d8b('0x36')](_0x1b2b59[_0x0d8b('0x2c')][_0x0d8b('0x36')]);_0x97050a['where']=qs['filters'](_[_0x0d8b('0x37')](_0x1b2b59['query'],_0x48f24f['filters']),_0x546bf6);if(_0x1b2b59[_0x0d8b('0x2c')][_0x0d8b('0x38')]){_0x97050a[_0x0d8b('0x39')]=_[_0x0d8b('0x3a')](_0x97050a[_0x0d8b('0x39')],{'$or':_[_0x0d8b('0x29')](_0x546bf6,function(_0x579324){if(_0x579324[_0x0d8b('0x3b')]!==_0x0d8b('0x3c')){var _0x28fd82={};_0x28fd82[_0x579324[_0x0d8b('0x27')]]={'$like':'%'+_0x1b2b59[_0x0d8b('0x2c')][_0x0d8b('0x38')]+'%'};return _0x28fd82;}})});}_0x97050a=_[_0x0d8b('0x3a')]({},_0x97050a,_0x1b2b59['options']);var _0x1d06b6={'where':_0x97050a[_0x0d8b('0x39')]};return db[_0x0d8b('0x3d')][_0x0d8b('0x1f')](_0x1d06b6)['then'](function(_0xe0bf42){_0x2ab00d['count']=_0xe0bf42;if(_0x1b2b59[_0x0d8b('0x2c')][_0x0d8b('0x3e')]){_0x97050a[_0x0d8b('0x3f')]=[{'all':!![]}];}return db[_0x0d8b('0x3d')][_0x0d8b('0x40')](_0x97050a);})[_0x0d8b('0x25')](function(_0x1ff17d){_0x2ab00d[_0x0d8b('0x41')]=_0x1ff17d;return _0x2ab00d;})[_0x0d8b('0x25')](respondWithFilteredResult(_0x4b59e5,_0x97050a))[_0x0d8b('0x42')](handleError(_0x4b59e5,null));};exports['show']=function(_0x571acf,_0x576050){var _0x4d0811={'raw':![],'where':{'id':_0x571acf[_0x0d8b('0x43')]['id']}},_0x524d79={};_0x524d79[_0x0d8b('0x2f')]=_[_0x0d8b('0x44')](db['ZendeskAccount']['rawAttributes']);_0x524d79[_0x0d8b('0x2c')]=_[_0x0d8b('0x44')](_0x571acf[_0x0d8b('0x2c')]);_0x524d79['filters']=_[_0x0d8b('0x2e')](_0x524d79[_0x0d8b('0x2f')],_0x524d79['query']);_0x4d0811['attributes']=_[_0x0d8b('0x2e')](_0x524d79['model'],qs[_0x0d8b('0x31')](_0x571acf['query']['fields']));_0x4d0811[_0x0d8b('0x30')]=_0x4d0811[_0x0d8b('0x30')]['length']?_0x4d0811['attributes']:_0x524d79['model'];if(_0x571acf['query'][_0x0d8b('0x3e')]){_0x4d0811[_0x0d8b('0x3f')]=[{'all':!![]}];}_0x4d0811=_[_0x0d8b('0x3a')]({},_0x4d0811,_0x571acf['options']);return db[_0x0d8b('0x3d')][_0x0d8b('0x45')](_0x4d0811)[_0x0d8b('0x25')](handleEntityNotFound(_0x576050,null))[_0x0d8b('0x25')](respondWithResult(_0x576050,null))[_0x0d8b('0x42')](handleError(_0x576050,null));};exports[_0x0d8b('0x46')]=function(_0x11d22b,_0x1d5067){return db[_0x0d8b('0x3d')][_0x0d8b('0x46')](_0x11d22b[_0x0d8b('0x47')],{})[_0x0d8b('0x25')](respondWithResult(_0x1d5067,0xc9))[_0x0d8b('0x42')](handleError(_0x1d5067,null));};exports[_0x0d8b('0x24')]=function(_0x570af8,_0xdfcf32){if(_0x570af8[_0x0d8b('0x47')]['id']){delete _0x570af8[_0x0d8b('0x47')]['id'];}return db[_0x0d8b('0x3d')]['find']({'where':{'id':_0x570af8[_0x0d8b('0x43')]['id']}})['then'](handleEntityNotFound(_0xdfcf32,null))['then'](saveUpdates(_0x570af8[_0x0d8b('0x47')],null))[_0x0d8b('0x25')](respondWithResult(_0xdfcf32,null))[_0x0d8b('0x42')](handleError(_0xdfcf32,null));};exports[_0x0d8b('0x26')]=function(_0x505d22,_0x131579){return db[_0x0d8b('0x3d')][_0x0d8b('0x45')]({'where':{'id':_0x505d22[_0x0d8b('0x43')]['id']}})[_0x0d8b('0x25')](handleEntityNotFound(_0x131579,null))['then'](removeEntity(_0x131579,null))['catch'](handleError(_0x131579,null));};exports['getConfigurations']=function(_0x573f4f,_0x368ede,_0xf22c3c){var _0x5e3bb4={};var _0x4950a8={};var _0x44c5c1;var _0x3d3cb6;return db['ZendeskAccount']['findOne']({'where':{'id':_0x573f4f[_0x0d8b('0x43')]['id']}})[_0x0d8b('0x25')](handleEntityNotFound(_0x368ede,null))[_0x0d8b('0x25')](function(_0x346c0d){if(_0x346c0d){_0x44c5c1=_0x346c0d;_0x4950a8[_0x0d8b('0x2f')]=_['keys'](db[_0x0d8b('0x48')][_0x0d8b('0x2a')]);_0x4950a8['query']=_['keys'](_0x573f4f[_0x0d8b('0x2c')]);_0x4950a8[_0x0d8b('0x2d')]=_['intersection'](_0x4950a8['model'],_0x4950a8[_0x0d8b('0x2c')]);_0x5e3bb4[_0x0d8b('0x30')]=_[_0x0d8b('0x2e')](_0x4950a8[_0x0d8b('0x2f')],qs['fields'](_0x573f4f[_0x0d8b('0x2c')]['fields']));_0x5e3bb4['attributes']=_0x5e3bb4[_0x0d8b('0x30')][_0x0d8b('0x32')]?_0x5e3bb4['attributes']:_0x4950a8['model'];_0x5e3bb4[_0x0d8b('0x35')]=qs[_0x0d8b('0x36')](_0x573f4f[_0x0d8b('0x2c')][_0x0d8b('0x36')]);_0x5e3bb4[_0x0d8b('0x39')]=qs[_0x0d8b('0x2d')](_[_0x0d8b('0x37')](_0x573f4f[_0x0d8b('0x2c')],_0x4950a8['filters']));if(_0x573f4f[_0x0d8b('0x2c')][_0x0d8b('0x38')]){_0x5e3bb4[_0x0d8b('0x39')]=_[_0x0d8b('0x3a')](_0x5e3bb4[_0x0d8b('0x39')],{'$or':_[_0x0d8b('0x29')](_0x5e3bb4[_0x0d8b('0x30')],function(_0x1c78b6){var _0x375684={};_0x375684[_0x1c78b6]={'$like':'%'+_0x573f4f['query'][_0x0d8b('0x38')]+'%'};return _0x375684;})});}_0x5e3bb4=_[_0x0d8b('0x3a')]({},_0x5e3bb4,_0x573f4f[_0x0d8b('0x49')]);return _0x44c5c1[_0x0d8b('0x4a')](_0x5e3bb4);}})[_0x0d8b('0x25')](function(_0x577951){if(_0x577951){_0x3d3cb6=_0x577951[_0x0d8b('0x32')];if(!_0x573f4f[_0x0d8b('0x2c')][_0x0d8b('0x33')](_0x0d8b('0x34'))){_0x5e3bb4[_0x0d8b('0x1d')]=qs['limit'](_0x573f4f['query'][_0x0d8b('0x1d')]);_0x5e3bb4[_0x0d8b('0x1c')]=qs[_0x0d8b('0x1c')](_0x573f4f[_0x0d8b('0x2c')]['offset']);}return _0x44c5c1[_0x0d8b('0x4a')](_0x5e3bb4);}})[_0x0d8b('0x25')](function(_0x8c0bbe){if(_0x8c0bbe){return _0x8c0bbe?{'count':_0x3d3cb6,'rows':_0x8c0bbe}:null;}})['then'](respondWithResult(_0x368ede,null))[_0x0d8b('0x42')](handleError(_0x368ede,null));};exports['addConfiguration']=function(_0x2fce07,_0x3ed63e,_0x1efce6){if(_0x2fce07[_0x0d8b('0x47')]['id']){delete _0x2fce07[_0x0d8b('0x47')]['id'];}return db[_0x0d8b('0x3d')]['findOne']({'where':{'id':_0x2fce07[_0x0d8b('0x43')]['id']}})['then'](handleEntityNotFound(_0x3ed63e,null))[_0x0d8b('0x25')](function(_0x4577c8){if(_0x4577c8){_0x2fce07[_0x0d8b('0x47')][_0x0d8b('0x4b')]=_0x4577c8['id'];_0x2fce07['body'][_0x0d8b('0x4c')]=integrations[_0x0d8b('0x4d')](_0x2fce07[_0x0d8b('0x47')][_0x0d8b('0x4e')],_0x2fce07[_0x0d8b('0x47')][_0x0d8b('0x3b')]);_0x2fce07[_0x0d8b('0x47')][_0x0d8b('0x4f')]=integrations[_0x0d8b('0x50')](_0x2fce07[_0x0d8b('0x47')]['channel'],_0x2fce07['body'][_0x0d8b('0x3b')]);return db[_0x0d8b('0x48')]['create'](_0x2fce07[_0x0d8b('0x47')],{'include':[{'model':db['ZendeskField'],'as':'Subjects'},{'model':db[_0x0d8b('0x51')],'as':_0x0d8b('0x4f')}]});}return null;})['then'](respondWithResult(_0x3ed63e,null))['catch'](handleError(_0x3ed63e,null));};exports[_0x0d8b('0x52')]=function(_0x1c007b,_0x70e4b2,_0x435090){var _0x2ab72b='';return db[_0x0d8b('0x3d')][_0x0d8b('0x53')]({'where':{'id':_0x1c007b['params']['id']},'attributes':['id',_0x0d8b('0x54'),'password',_0x0d8b('0x55'),_0x0d8b('0x56'),_0x0d8b('0x57')]})[_0x0d8b('0x25')](handleEntityNotFound(_0x70e4b2,null))['then'](function(_0x3fe47d){if(_0x3fe47d){_0x2ab72b=_0x3fe47d['remoteUri'];var _0x3a356b=_0x2ab72b[_0x0d8b('0x58')](-0x1);if(_0x3a356b==='/'){_0x2ab72b=_0x2ab72b[_0x0d8b('0x59')](0x0,_0x2ab72b[_0x0d8b('0x5a')](_0x3a356b));}var _0xc5c35f={'method':_0x0d8b('0x5b'),'uri':util[_0x0d8b('0x5c')](_0x0d8b('0x5d'),_0x2ab72b,_0x0d8b('0x5e')),'json':!![]};switch(_0x3fe47d[_0x0d8b('0x56')]){case'password':_0xc5c35f[_0x0d8b('0x5f')]={'Authorization':util['format'](_0x0d8b('0x60'),new Buffer(util[_0x0d8b('0x5c')]('%s:%s',_0x3fe47d[_0x0d8b('0x54')],_0x3fe47d['password']))[_0x0d8b('0x61')](_0x0d8b('0x62')))};break;case _0x0d8b('0x55'):_0xc5c35f[_0x0d8b('0x5f')]={'Authorization':util[_0x0d8b('0x5c')](_0x0d8b('0x60'),new Buffer(util[_0x0d8b('0x5c')](_0x0d8b('0x63'),_0x3fe47d['username'],_0x3fe47d[_0x0d8b('0x55')]))[_0x0d8b('0x61')]('base64'))};break;default:throw new db[(_0x0d8b('0x64'))][(_0x0d8b('0x65'))](_0x0d8b('0x66'));}return rp(_0xc5c35f);}})[_0x0d8b('0x25')](function(_0x16141a){if(_0x16141a){var _0x9e44b4=[_0x0d8b('0x67'),_0x0d8b('0x68'),_0x0d8b('0x69'),_0x0d8b('0x6a')];_[_0x0d8b('0x6b')](_0x16141a[_0x0d8b('0x5e')],function(_0x50c0ff){return _0x9e44b4[_0x0d8b('0x6c')](_0x50c0ff[_0x0d8b('0x3b')]);});return{'count':_0x16141a[_0x0d8b('0x5e')]['length'],'rows':_['map'](_0x16141a[_0x0d8b('0x5e')],function(_0x3aeb45){return{'id':_0x3aeb45['id'],'name':_0x3aeb45[_0x0d8b('0x6d')]>0x7?_0x3aeb45['title']:_0x3aeb45['type'],'custom':_0x3aeb45[_0x0d8b('0x6d')]>0x7?!![]:![],'options':_0x3aeb45[_0x0d8b('0x6e')]?_0x3aeb45[_0x0d8b('0x6e')]:_0x3aeb45[_0x0d8b('0x6f')]?_0x3aeb45[_0x0d8b('0x6f')]:[]};})};}})[_0x0d8b('0x25')](respondWithResult(_0x70e4b2,null))[_0x0d8b('0x42')](function(_0x2c826b){var _0x20a3dd=_0x1c007b[_0x0d8b('0x2c')][_0x0d8b('0x70')]?0x1f4:_0x2c826b[_0x0d8b('0x71')]||0x1f4;logger[_0x0d8b('0x72')]('getFields,\x20%s,\x20%s,\x20%s',_0x0d8b('0x52'),_0x20a3dd,JSON[_0x0d8b('0x73')](_0x2c826b));delete _0x2c826b['name'];if(_0x20a3dd===0x191){_0x20a3dd=0x190;}_0x70e4b2['status'](_0x20a3dd)[_0x0d8b('0x28')](_0x1c007b[_0x0d8b('0x2c')][_0x0d8b('0x70')]?{'message':_0x0d8b('0x74'),'statusCode':_0x2c826b[_0x0d8b('0x71')]}:_0x2c826b);});}; \ No newline at end of file diff --git a/server/api/intZendeskAccount/intZendeskAccount.model.js b/server/api/intZendeskAccount/intZendeskAccount.model.js index 21cbcb0..462bb5a 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 _0xa70a=['./intZendeskAccount.attributes','../../components/integrations/configuration','exports','ZendeskAccount','lodash','util','../../config/logger','api','request-promise','path','rimraf','../../config/environment'];(function(_0x1e5ad0,_0x58ffe3){var _0x46da3b=function(_0x37d2f6){while(--_0x37d2f6){_0x1e5ad0['push'](_0x1e5ad0['shift']());}};_0x46da3b(++_0x58ffe3);}(_0xa70a,0x1c0));var _0xaa70=function(_0x1c1a4d,_0x46b403){_0x1c1a4d=_0x1c1a4d-0x0;var _0x3c17ea=_0xa70a[_0x1c1a4d];return _0x3c17ea;};'use strict';var _=require(_0xaa70('0x0'));var util=require(_0xaa70('0x1'));var logger=require(_0xaa70('0x2'))(_0xaa70('0x3'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0xaa70('0x4'));var fs=require('fs');var path=require(_0xaa70('0x5'));var rimraf=require(_0xaa70('0x6'));var config=require(_0xaa70('0x7'));var attributes=require(_0xaa70('0x8'));var integrations=require(_0xaa70('0x9'));module[_0xaa70('0xa')]=function(_0x47fb20,_0x5345be){return _0x47fb20['define'](_0xaa70('0xb'),attributes,{'tableName':'int_zendesk_accounts','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x082f=['../../components/integrations/configuration','exports','define','ZendeskAccount','util','../../config/logger','api','bluebird'];(function(_0x5c9307,_0x5b97e4){var _0x373e29=function(_0xefebbd){while(--_0xefebbd){_0x5c9307['push'](_0x5c9307['shift']());}};_0x373e29(++_0x5b97e4);}(_0x082f,0xfc));var _0xf082=function(_0x2bee11,_0x21dcce){_0x2bee11=_0x2bee11-0x0;var _0x56670f=_0x082f[_0x2bee11];return _0x56670f;};'use strict';var _=require('lodash');var util=require(_0xf082('0x0'));var logger=require(_0xf082('0x1'))(_0xf082('0x2'));var moment=require('moment');var BPromise=require(_0xf082('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require('./intZendeskAccount.attributes');var integrations=require(_0xf082('0x4'));module[_0xf082('0x5')]=function(_0x13ccf5,_0xbf87e4){return _0x13ccf5[_0xf082('0x6')](_0xf082('0x7'),attributes,{'tableName':'int_zendesk_accounts','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 9fcb459..34197b9 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 _0x8c4e=['client','http','request','then','info','ZendeskAccount,\x20%s,\x20%s','request\x20sent','debug','ZendeskAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','GetZendeskAccount','ZendeskAccount','findAll','options','raw','where','attributes','model','map','include','ShowZendeskAccount','find','lodash','util','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','jayson/promise'];(function(_0x489312,_0x1100cd){var _0x2c2830=function(_0x401063){while(--_0x401063){_0x489312['push'](_0x489312['shift']());}};_0x2c2830(++_0x1100cd);}(_0x8c4e,0x117));var _0xe8c4=function(_0x5403a9,_0x237d0a){_0x5403a9=_0x5403a9-0x0;var _0x516080=_0x8c4e[_0x5403a9];return _0x516080;};'use strict';var _=require(_0xe8c4('0x0'));var util=require(_0xe8c4('0x1'));var moment=require('moment');var BPromise=require(_0xe8c4('0x2'));var rs=require(_0xe8c4('0x3'));var fs=require('fs');var Redis=require(_0xe8c4('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0xe8c4('0x5'));var logger=require(_0xe8c4('0x6'))(_0xe8c4('0x7'));var config=require('../../config/environment');var jayson=require(_0xe8c4('0x8'));var client=jayson[_0xe8c4('0x9')][_0xe8c4('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x110e6d,_0x271793,_0xe4822e){return new BPromise(function(_0x59c97f,_0xdc3396){return client[_0xe8c4('0xb')](_0x110e6d,_0xe4822e)[_0xe8c4('0xc')](function(_0x4404a2){logger[_0xe8c4('0xd')](_0xe8c4('0xe'),_0x271793,_0xe8c4('0xf'));logger[_0xe8c4('0x10')](_0xe8c4('0x11'),_0x271793,_0xe8c4('0xf'),JSON[_0xe8c4('0x12')](_0x4404a2));if(_0x4404a2[_0xe8c4('0x13')]){if(_0x4404a2['error'][_0xe8c4('0x14')]===0x1f4){logger[_0xe8c4('0x13')](_0xe8c4('0xe'),_0x271793,_0x4404a2[_0xe8c4('0x13')][_0xe8c4('0x15')]);return _0xdc3396(_0x4404a2[_0xe8c4('0x13')]['message']);}logger[_0xe8c4('0x13')](_0xe8c4('0xe'),_0x271793,_0x4404a2[_0xe8c4('0x13')]['message']);return _0x59c97f(_0x4404a2[_0xe8c4('0x13')][_0xe8c4('0x15')]);}else{logger['info'](_0xe8c4('0xe'),_0x271793,_0xe8c4('0xf'));_0x59c97f(_0x4404a2[_0xe8c4('0x16')][_0xe8c4('0x15')]);}})[_0xe8c4('0x17')](function(_0x10774b){logger[_0xe8c4('0x13')](_0xe8c4('0xe'),_0x271793,_0x10774b);_0xdc3396(_0x10774b);});});}exports[_0xe8c4('0x18')]=function(_0x147d3f){var _0x329813=this;return new Promise(function(_0x2e2c66,_0x253539){return db[_0xe8c4('0x19')][_0xe8c4('0x1a')]({'raw':_0x147d3f[_0xe8c4('0x1b')]?_0x147d3f[_0xe8c4('0x1b')][_0xe8c4('0x1c')]===undefined?!![]:![]:!![],'where':_0x147d3f[_0xe8c4('0x1b')]?_0x147d3f['options'][_0xe8c4('0x1d')]||null:null,'attributes':_0x147d3f[_0xe8c4('0x1b')]?_0x147d3f[_0xe8c4('0x1b')][_0xe8c4('0x1e')]||null:null,'limit':_0x147d3f[_0xe8c4('0x1b')]?_0x147d3f[_0xe8c4('0x1b')]['limit']||null:null,'include':_0x147d3f[_0xe8c4('0x1b')]?_0x147d3f[_0xe8c4('0x1b')]['include']?_['map'](_0x147d3f[_0xe8c4('0x1b')]['include'],function(_0x228e07){return{'model':db[_0x228e07[_0xe8c4('0x1f')]],'as':_0x228e07['as'],'attributes':_0x228e07[_0xe8c4('0x1e')],'include':_0x228e07['include']?_[_0xe8c4('0x20')](_0x228e07[_0xe8c4('0x21')],function(_0x28cd56){return{'model':db[_0x28cd56[_0xe8c4('0x1f')]],'as':_0x28cd56['as'],'attributes':_0x28cd56['attributes'],'include':_0x28cd56[_0xe8c4('0x21')]?_[_0xe8c4('0x20')](_0x28cd56['include'],function(_0x1d1f52){return{'model':db[_0x1d1f52['model']],'as':_0x1d1f52['as'],'attributes':_0x1d1f52[_0xe8c4('0x1e')]};}):[]};}):[]};}):[]:[]})[_0xe8c4('0xc')](function(_0x5ea8a7){logger[_0xe8c4('0xd')](_0xe8c4('0x18'),_0x147d3f);logger[_0xe8c4('0x10')](_0xe8c4('0x18'),_0x147d3f,JSON[_0xe8c4('0x12')](_0x5ea8a7));_0x2e2c66(_0x5ea8a7);})[_0xe8c4('0x17')](function(_0xdb0c4b){logger['error'](_0xe8c4('0x18'),_0xdb0c4b[_0xe8c4('0x15')],_0x147d3f);_0x253539(_0x329813['error'](0x1f4,_0xdb0c4b[_0xe8c4('0x15')]));});});};exports[_0xe8c4('0x22')]=function(_0x283bb8){var _0x33667c=this;return new Promise(function(_0x3dd506,_0x4fa47b){return db[_0xe8c4('0x19')][_0xe8c4('0x23')]({'raw':_0x283bb8[_0xe8c4('0x1b')]?_0x283bb8['options'][_0xe8c4('0x1c')]===undefined?!![]:![]:!![],'where':_0x283bb8[_0xe8c4('0x1b')]?_0x283bb8[_0xe8c4('0x1b')][_0xe8c4('0x1d')]||null:null,'attributes':_0x283bb8[_0xe8c4('0x1b')]?_0x283bb8[_0xe8c4('0x1b')][_0xe8c4('0x1e')]||null:null,'include':_0x283bb8[_0xe8c4('0x1b')]?_0x283bb8[_0xe8c4('0x1b')]['include']?_['map'](_0x283bb8[_0xe8c4('0x1b')][_0xe8c4('0x21')],function(_0x232526){return{'model':db[_0x232526[_0xe8c4('0x1f')]],'as':_0x232526['as'],'attributes':_0x232526[_0xe8c4('0x1e')],'include':_0x232526[_0xe8c4('0x21')]?_[_0xe8c4('0x20')](_0x232526[_0xe8c4('0x21')],function(_0x5a0d25){return{'model':db[_0x5a0d25['model']],'as':_0x5a0d25['as'],'attributes':_0x5a0d25[_0xe8c4('0x1e')],'include':_0x5a0d25['include']?_[_0xe8c4('0x20')](_0x5a0d25[_0xe8c4('0x21')],function(_0x54d14d){return{'model':db[_0x54d14d[_0xe8c4('0x1f')]],'as':_0x54d14d['as'],'attributes':_0x54d14d['attributes']};}):[]};}):[]};}):[]:[]})[_0xe8c4('0xc')](function(_0x18c3fa){logger[_0xe8c4('0xd')](_0xe8c4('0x22'),_0x283bb8);logger[_0xe8c4('0x10')](_0xe8c4('0x22'),_0x283bb8,JSON[_0xe8c4('0x12')](_0x18c3fa));_0x3dd506(_0x18c3fa);})[_0xe8c4('0x17')](function(_0x1334d1){logger[_0xe8c4('0x13')](_0xe8c4('0x22'),_0x1334d1[_0xe8c4('0x15')],_0x283bb8);_0x4fa47b(_0x33667c[_0xe8c4('0x13')](0x1f4,_0x1334d1[_0xe8c4('0x15')]));});});}; \ No newline at end of file +var _0x7953=['stringify','error','code','message','result','catch','GetZendeskAccount','findAll','options','attributes','limit','include','map','model','then','ZendeskAccount','find','raw','where','ShowZendeskAccount','lodash','util','moment','randomstring','../../mysqldb','../../config/logger','rpc','../../config/environment','client','http','request','info','ZendeskAccount,\x20%s,\x20%s','request\x20sent','debug','ZendeskAccount,\x20%s,\x20%s,\x20%s'];(function(_0x2bb512,_0x539768){var _0x49762f=function(_0x501b98){while(--_0x501b98){_0x2bb512['push'](_0x2bb512['shift']());}};_0x49762f(++_0x539768);}(_0x7953,0x1c4));var _0x3795=function(_0x49ad79,_0x48ee93){_0x49ad79=_0x49ad79-0x0;var _0xa4e38a=_0x7953[_0x49ad79];return _0xa4e38a;};'use strict';var _=require(_0x3795('0x0'));var util=require(_0x3795('0x1'));var moment=require(_0x3795('0x2'));var BPromise=require('bluebird');var rs=require(_0x3795('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x3795('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0x3795('0x5'))(_0x3795('0x6'));var config=require(_0x3795('0x7'));var jayson=require('jayson/promise');var client=jayson[_0x3795('0x8')][_0x3795('0x9')]({'port':0x232a});function respondWithRpcPromise(_0xd3b455,_0x2e23c5,_0x7112ea){return new BPromise(function(_0xd4da1b,_0x58b160){return client[_0x3795('0xa')](_0xd3b455,_0x7112ea)['then'](function(_0x468676){logger[_0x3795('0xb')](_0x3795('0xc'),_0x2e23c5,_0x3795('0xd'));logger[_0x3795('0xe')](_0x3795('0xf'),_0x2e23c5,'request\x20sent',JSON[_0x3795('0x10')](_0x468676));if(_0x468676[_0x3795('0x11')]){if(_0x468676[_0x3795('0x11')][_0x3795('0x12')]===0x1f4){logger['error'](_0x3795('0xc'),_0x2e23c5,_0x468676['error']['message']);return _0x58b160(_0x468676[_0x3795('0x11')][_0x3795('0x13')]);}logger[_0x3795('0x11')](_0x3795('0xc'),_0x2e23c5,_0x468676[_0x3795('0x11')][_0x3795('0x13')]);return _0xd4da1b(_0x468676[_0x3795('0x11')][_0x3795('0x13')]);}else{logger[_0x3795('0xb')]('ZendeskAccount,\x20%s,\x20%s',_0x2e23c5,_0x3795('0xd'));_0xd4da1b(_0x468676[_0x3795('0x14')]['message']);}})[_0x3795('0x15')](function(_0x29ee9d){logger['error']('ZendeskAccount,\x20%s,\x20%s',_0x2e23c5,_0x29ee9d);_0x58b160(_0x29ee9d);});});}exports[_0x3795('0x16')]=function(_0x13f978){var _0x39df78=this;return new Promise(function(_0x1d293a,_0x43c513){return db['ZendeskAccount'][_0x3795('0x17')]({'raw':_0x13f978[_0x3795('0x18')]?_0x13f978[_0x3795('0x18')]['raw']===undefined?!![]:![]:!![],'where':_0x13f978[_0x3795('0x18')]?_0x13f978[_0x3795('0x18')]['where']||null:null,'attributes':_0x13f978[_0x3795('0x18')]?_0x13f978['options'][_0x3795('0x19')]||null:null,'limit':_0x13f978[_0x3795('0x18')]?_0x13f978[_0x3795('0x18')][_0x3795('0x1a')]||null:null,'include':_0x13f978[_0x3795('0x18')]?_0x13f978[_0x3795('0x18')][_0x3795('0x1b')]?_['map'](_0x13f978[_0x3795('0x18')][_0x3795('0x1b')],function(_0x4a934f){return{'model':db[_0x4a934f['model']],'as':_0x4a934f['as'],'attributes':_0x4a934f[_0x3795('0x19')],'include':_0x4a934f['include']?_[_0x3795('0x1c')](_0x4a934f[_0x3795('0x1b')],function(_0xdd3a90){return{'model':db[_0xdd3a90[_0x3795('0x1d')]],'as':_0xdd3a90['as'],'attributes':_0xdd3a90[_0x3795('0x19')],'include':_0xdd3a90['include']?_[_0x3795('0x1c')](_0xdd3a90[_0x3795('0x1b')],function(_0x1e6abd){return{'model':db[_0x1e6abd['model']],'as':_0x1e6abd['as'],'attributes':_0x1e6abd[_0x3795('0x19')]};}):[]};}):[]};}):[]:[]})[_0x3795('0x1e')](function(_0x3f99c0){logger[_0x3795('0xb')](_0x3795('0x16'),_0x13f978);logger[_0x3795('0xe')]('GetZendeskAccount',_0x13f978,JSON['stringify'](_0x3f99c0));_0x1d293a(_0x3f99c0);})['catch'](function(_0x5784ee){logger[_0x3795('0x11')](_0x3795('0x16'),_0x5784ee['message'],_0x13f978);_0x43c513(_0x39df78[_0x3795('0x11')](0x1f4,_0x5784ee[_0x3795('0x13')]));});});};exports['ShowZendeskAccount']=function(_0x489424){var _0x4b947c=this;return new Promise(function(_0x4f51a7,_0x3fc604){return db[_0x3795('0x1f')][_0x3795('0x20')]({'raw':_0x489424[_0x3795('0x18')]?_0x489424[_0x3795('0x18')][_0x3795('0x21')]===undefined?!![]:![]:!![],'where':_0x489424[_0x3795('0x18')]?_0x489424[_0x3795('0x18')][_0x3795('0x22')]||null:null,'attributes':_0x489424[_0x3795('0x18')]?_0x489424[_0x3795('0x18')][_0x3795('0x19')]||null:null,'include':_0x489424[_0x3795('0x18')]?_0x489424['options'][_0x3795('0x1b')]?_['map'](_0x489424['options'][_0x3795('0x1b')],function(_0x1b6af4){return{'model':db[_0x1b6af4[_0x3795('0x1d')]],'as':_0x1b6af4['as'],'attributes':_0x1b6af4[_0x3795('0x19')],'include':_0x1b6af4[_0x3795('0x1b')]?_['map'](_0x1b6af4[_0x3795('0x1b')],function(_0x59978a){return{'model':db[_0x59978a[_0x3795('0x1d')]],'as':_0x59978a['as'],'attributes':_0x59978a[_0x3795('0x19')],'include':_0x59978a[_0x3795('0x1b')]?_[_0x3795('0x1c')](_0x59978a[_0x3795('0x1b')],function(_0x37bcba){return{'model':db[_0x37bcba[_0x3795('0x1d')]],'as':_0x37bcba['as'],'attributes':_0x37bcba[_0x3795('0x19')]};}):[]};}):[]};}):[]:[]})[_0x3795('0x1e')](function(_0x419ad1){logger[_0x3795('0xb')](_0x3795('0x23'),_0x489424);logger[_0x3795('0xe')](_0x3795('0x23'),_0x489424,JSON[_0x3795('0x10')](_0x419ad1));_0x4f51a7(_0x419ad1);})['catch'](function(_0x53049b){logger[_0x3795('0x11')](_0x3795('0x23'),_0x53049b[_0x3795('0x13')],_0x489424);_0x3fc604(_0x4b947c[_0x3795('0x11')](0x1f4,_0x53049b[_0x3795('0x13')]));});});}; \ No newline at end of file diff --git a/server/api/intZendeskConfiguration/index.js b/server/api/intZendeskConfiguration/index.js index 3ff9c6c..869b029 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 _0x757a=['index','isAuthenticated','show','/:id/fields','/:id/subjects','getSubjects','/:id/descriptions','post','setTags','put','/:id','update','delete','destroy','exports','util','path','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./intZendeskConfiguration.controller','get'];(function(_0x27f4cd,_0x141f75){var _0x2ba602=function(_0x22df3c){while(--_0x22df3c){_0x27f4cd['push'](_0x27f4cd['shift']());}};_0x2ba602(++_0x141f75);}(_0x757a,0xde));var _0xa757=function(_0x41052a,_0x157b27){_0x41052a=_0x41052a-0x0;var _0x31dd43=_0x757a[_0x41052a];return _0x31dd43;};'use strict';var multer=require('multer');var util=require(_0xa757('0x0'));var path=require(_0xa757('0x1'));var timeout=require('connect-timeout');var express=require('express');var router=express['Router']();var fs_extra=require(_0xa757('0x2'));var auth=require(_0xa757('0x3'));var interaction=require(_0xa757('0x4'));var config=require(_0xa757('0x5'));var controller=require(_0xa757('0x6'));router[_0xa757('0x7')]('/',auth['isAuthenticated'](),controller[_0xa757('0x8')]);router[_0xa757('0x7')]('/:id',auth[_0xa757('0x9')](),controller[_0xa757('0xa')]);router[_0xa757('0x7')](_0xa757('0xb'),auth[_0xa757('0x9')](),controller['getFields']);router[_0xa757('0x7')](_0xa757('0xc'),auth[_0xa757('0x9')](),controller[_0xa757('0xd')]);router[_0xa757('0x7')](_0xa757('0xe'),auth[_0xa757('0x9')](),controller['getDescriptions']);router['get']('/:id/tags',auth['isAuthenticated'](),controller['getTags']);router[_0xa757('0xf')]('/',auth['isAuthenticated'](),controller['create']);router[_0xa757('0xf')]('/:id/tags',auth['isAuthenticated'](),controller[_0xa757('0x10')]);router[_0xa757('0x11')](_0xa757('0x12'),auth[_0xa757('0x9')](),controller[_0xa757('0x13')]);router[_0xa757('0x14')](_0xa757('0x12'),auth[_0xa757('0x9')](),controller[_0xa757('0x15')]);module[_0xa757('0x16')]=router; \ No newline at end of file +var _0xf4eb=['put','update','delete','/:id','destroy','exports','multer','Router','../../components/interaction/service','../../config/environment','./intZendeskConfiguration.controller','get','isAuthenticated','index','/:id/fields','getFields','/:id/subjects','getSubjects','/:id/tags','getTags','create','post','setTags'];(function(_0xa6af16,_0x124a7f){var _0x26fbba=function(_0xe321a6){while(--_0xe321a6){_0xa6af16['push'](_0xa6af16['shift']());}};_0x26fbba(++_0x124a7f);}(_0xf4eb,0xec));var _0xbf4e=function(_0x2e80ff,_0x4793ae){_0x2e80ff=_0x2e80ff-0x0;var _0x14b060=_0xf4eb[_0x2e80ff];return _0x14b060;};'use strict';var multer=require(_0xbf4e('0x0'));var util=require('util');var path=require('path');var timeout=require('connect-timeout');var express=require('express');var router=express[_0xbf4e('0x1')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0xbf4e('0x2'));var config=require(_0xbf4e('0x3'));var controller=require(_0xbf4e('0x4'));router[_0xbf4e('0x5')]('/',auth[_0xbf4e('0x6')](),controller[_0xbf4e('0x7')]);router[_0xbf4e('0x5')]('/:id',auth[_0xbf4e('0x6')](),controller['show']);router['get'](_0xbf4e('0x8'),auth[_0xbf4e('0x6')](),controller[_0xbf4e('0x9')]);router[_0xbf4e('0x5')](_0xbf4e('0xa'),auth[_0xbf4e('0x6')](),controller[_0xbf4e('0xb')]);router['get']('/:id/descriptions',auth[_0xbf4e('0x6')](),controller['getDescriptions']);router[_0xbf4e('0x5')](_0xbf4e('0xc'),auth['isAuthenticated'](),controller[_0xbf4e('0xd')]);router['post']('/',auth['isAuthenticated'](),controller[_0xbf4e('0xe')]);router[_0xbf4e('0xf')](_0xbf4e('0xc'),auth[_0xbf4e('0x6')](),controller[_0xbf4e('0x10')]);router[_0xbf4e('0x11')]('/:id',auth['isAuthenticated'](),controller[_0xbf4e('0x12')]);router[_0xbf4e('0x13')](_0xbf4e('0x14'),auth['isAuthenticated'](),controller[_0xbf4e('0x15')]);module[_0xbf4e('0x16')]=router; \ No newline at end of file diff --git a/server/api/intZendeskConfiguration/intZendeskConfiguration.attributes.js b/server/api/intZendeskConfiguration/intZendeskConfiguration.attributes.js index 81b1ba0..981cda7 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 _0x8ad8=['exports','STRING','sequelize'];(function(_0x355fb1,_0x7b9ceb){var _0x4ee0f9=function(_0x492b75){while(--_0x492b75){_0x355fb1['push'](_0x355fb1['shift']());}};_0x4ee0f9(++_0x7b9ceb);}(_0x8ad8,0x10a));var _0x88ad=function(_0x50cea5,_0x3ca132){_0x50cea5=_0x50cea5-0x0;var _0x24c178=_0x8ad8[_0x50cea5];return _0x24c178;};'use strict';var Sequelize=require(_0x88ad('0x0'));module[_0x88ad('0x1')]={'name':{'type':Sequelize[_0x88ad('0x2')]},'description':{'type':Sequelize[_0x88ad('0x2')]}}; \ No newline at end of file +var _0xc725=['STRING'];(function(_0x369026,_0x46ebf0){var _0x11e5d8=function(_0xf28d8d){while(--_0xf28d8d){_0x369026['push'](_0x369026['shift']());}};_0x11e5d8(++_0x46ebf0);}(_0xc725,0x16a));var _0x5c72=function(_0x3f761d,_0x5d907d){_0x3f761d=_0x3f761d-0x0;var _0x49d6e3=_0xc725[_0x3f761d];return _0x49d6e3;};'use strict';var Sequelize=require('sequelize');module['exports']={'name':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0x5c72('0x0')]}}; \ No newline at end of file diff --git a/server/api/intZendeskConfiguration/intZendeskConfiguration.controller.js b/server/api/intZendeskConfiguration/intZendeskConfiguration.controller.js index 300b780..346ff9f 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 _0x6e74=['setTags','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','jsforce','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','end','status','json','offset','limit','undefined','count','set','Content-Range','apply','reject','save','update','then','error','name','index','map','ZendeskConfiguration','rawAttributes','fieldName','key','model','query','filters','intersection','attributes','fields','length','order','sort','where','pick','filter','merge','type','VIRTUAL','options','includeAll','findAll','show','params','keys','find','catch','create','body','findOne','ZendeskField','getFields','hasOwnProperty','nolimit','getSubjects','getTags','Tag'];(function(_0x489dbe,_0x234f3a){var _0x4afdc6=function(_0x12f744){while(--_0x12f744){_0x489dbe['push'](_0x489dbe['shift']());}};_0x4afdc6(++_0x234f3a);}(_0x6e74,0x196));var _0x46e7=function(_0x8c8fd6,_0x4f7eca){_0x8c8fd6=_0x8c8fd6-0x0;var _0x1cf12d=_0x6e74[_0x8c8fd6];return _0x1cf12d;};'use strict';var emlformat=require(_0x46e7('0x0'));var rimraf=require(_0x46e7('0x1'));var zipdir=require(_0x46e7('0x2'));var jsonpatch=require(_0x46e7('0x3'));var rp=require(_0x46e7('0x4'));var moment=require(_0x46e7('0x5'));var BPromise=require(_0x46e7('0x6'));var Mustache=require(_0x46e7('0x7'));var util=require(_0x46e7('0x8'));var path=require(_0x46e7('0x9'));var sox=require(_0x46e7('0xa'));var csv=require(_0x46e7('0xb'));var ejs=require(_0x46e7('0xc'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0x46e7('0xd'));var deskjs=require('desk.js');var toCsv=require(_0x46e7('0xb'));var querystring=require('querystring');var Papa=require(_0x46e7('0xe'));var Redis=require(_0x46e7('0xf'));var authService=require(_0x46e7('0x10'));var qs=require(_0x46e7('0x11'));var as=require(_0x46e7('0x12'));var hardwareService=require(_0x46e7('0x13'));var logger=require(_0x46e7('0x14'))('api');var utils=require(_0x46e7('0x15'));var config=require('../../config/environment');var licenseUtil=require(_0x46e7('0x16'));var db=require(_0x46e7('0x17'))['db'];function respondWithStatusCode(_0x3d9837,_0x3b889b){_0x3b889b=_0x3b889b||0xcc;return function(_0x24089d){if(_0x24089d){return _0x3d9837[_0x46e7('0x18')](_0x3b889b);}return _0x3d9837['status'](_0x3b889b)[_0x46e7('0x19')]();};}function respondWithResult(_0x4e275b,_0x35cc40){_0x35cc40=_0x35cc40||0xc8;return function(_0x16b685){if(_0x16b685){return _0x4e275b[_0x46e7('0x1a')](_0x35cc40)[_0x46e7('0x1b')](_0x16b685);}};}function respondWithFilteredResult(_0x121666,_0x166367){return function(_0x3d4824){if(_0x3d4824){var _0x545966=typeof _0x166367[_0x46e7('0x1c')]==='undefined'&&typeof _0x166367[_0x46e7('0x1d')]===_0x46e7('0x1e');var _0x93419b=_0x3d4824[_0x46e7('0x1f')];var _0x2146d5=_0x545966?0x0:_0x166367[_0x46e7('0x1c')];var _0x4763d2=_0x545966?_0x3d4824[_0x46e7('0x1f')]:_0x166367[_0x46e7('0x1c')]+_0x166367[_0x46e7('0x1d')];var _0x3b1459;if(_0x4763d2>=_0x93419b){_0x4763d2=_0x93419b;_0x3b1459=0xc8;}else{_0x3b1459=0xce;}_0x121666[_0x46e7('0x1a')](_0x3b1459);return _0x121666[_0x46e7('0x20')](_0x46e7('0x21'),_0x2146d5+'-'+_0x4763d2+'/'+_0x93419b)[_0x46e7('0x1b')](_0x3d4824);}return null;};}function patchUpdates(_0xc6bd1f){return function(_0xfc6b9d){try{jsonpatch[_0x46e7('0x22')](_0xfc6b9d,_0xc6bd1f,!![]);}catch(_0x274059){return BPromise[_0x46e7('0x23')](_0x274059);}return _0xfc6b9d[_0x46e7('0x24')]();};}function saveUpdates(_0x419c5e,_0x4aff86){return function(_0x3e54ac){if(_0x3e54ac){return _0x3e54ac[_0x46e7('0x25')](_0x419c5e)[_0x46e7('0x26')](function(_0x2c871c){return _0x2c871c;});}return null;};}function removeEntity(_0x5efdb1,_0x36bfbb){return function(_0x2fd748){if(_0x2fd748){return _0x2fd748['destroy']()[_0x46e7('0x26')](function(){_0x5efdb1[_0x46e7('0x1a')](0xcc)[_0x46e7('0x19')]();});}};}function handleEntityNotFound(_0x3aa585,_0x10205a){return function(_0x17dcc8){if(!_0x17dcc8){_0x3aa585[_0x46e7('0x18')](0x194);}return _0x17dcc8;};}function handleError(_0x1ae75e,_0x7f6b5d){_0x7f6b5d=_0x7f6b5d||0x1f4;return function(_0x4ebfbe){logger[_0x46e7('0x27')](_0x4ebfbe['stack']);if(_0x4ebfbe['name']){delete _0x4ebfbe[_0x46e7('0x28')];}_0x1ae75e[_0x46e7('0x1a')](_0x7f6b5d)['send'](_0x4ebfbe);};}exports[_0x46e7('0x29')]=function(_0x30d037,_0x25cbf7){var _0x19663f={},_0x49436b={},_0x720ab6={'count':0x0,'rows':[]};var _0x1d8914=_[_0x46e7('0x2a')](db[_0x46e7('0x2b')][_0x46e7('0x2c')],function(_0x40bf0e){return{'name':_0x40bf0e[_0x46e7('0x2d')],'type':_0x40bf0e['type'][_0x46e7('0x2e')]};});_0x49436b[_0x46e7('0x2f')]=_[_0x46e7('0x2a')](_0x1d8914,'name');_0x49436b[_0x46e7('0x30')]=_['keys'](_0x30d037[_0x46e7('0x30')]);_0x49436b[_0x46e7('0x31')]=_[_0x46e7('0x32')](_0x49436b[_0x46e7('0x2f')],_0x49436b['query']);_0x19663f[_0x46e7('0x33')]=_[_0x46e7('0x32')](_0x49436b['model'],qs[_0x46e7('0x34')](_0x30d037['query'][_0x46e7('0x34')]));_0x19663f[_0x46e7('0x33')]=_0x19663f[_0x46e7('0x33')][_0x46e7('0x35')]?_0x19663f[_0x46e7('0x33')]:_0x49436b['model'];if(!_0x30d037[_0x46e7('0x30')]['hasOwnProperty']('nolimit')){_0x19663f['limit']=qs['limit'](_0x30d037['query'][_0x46e7('0x1d')]);_0x19663f[_0x46e7('0x1c')]=qs[_0x46e7('0x1c')](_0x30d037[_0x46e7('0x30')]['offset']);}_0x19663f[_0x46e7('0x36')]=qs[_0x46e7('0x37')](_0x30d037[_0x46e7('0x30')]['sort']);_0x19663f[_0x46e7('0x38')]=qs[_0x46e7('0x31')](_[_0x46e7('0x39')](_0x30d037[_0x46e7('0x30')],_0x49436b[_0x46e7('0x31')]),_0x1d8914);if(_0x30d037[_0x46e7('0x30')][_0x46e7('0x3a')]){_0x19663f[_0x46e7('0x38')]=_[_0x46e7('0x3b')](_0x19663f[_0x46e7('0x38')],{'$or':_['map'](_0x1d8914,function(_0x38afde){if(_0x38afde[_0x46e7('0x3c')]!==_0x46e7('0x3d')){var _0x5afc91={};_0x5afc91[_0x38afde[_0x46e7('0x28')]]={'$like':'%'+_0x30d037[_0x46e7('0x30')][_0x46e7('0x3a')]+'%'};return _0x5afc91;}})});}_0x19663f=_[_0x46e7('0x3b')]({},_0x19663f,_0x30d037[_0x46e7('0x3e')]);var _0x540c31={'where':_0x19663f[_0x46e7('0x38')]};return db[_0x46e7('0x2b')][_0x46e7('0x1f')](_0x540c31)[_0x46e7('0x26')](function(_0x56bd01){_0x720ab6[_0x46e7('0x1f')]=_0x56bd01;if(_0x30d037[_0x46e7('0x30')][_0x46e7('0x3f')]){_0x19663f['include']=[{'all':!![]}];}return db[_0x46e7('0x2b')][_0x46e7('0x40')](_0x19663f);})[_0x46e7('0x26')](function(_0x37d1f7){_0x720ab6['rows']=_0x37d1f7;return _0x720ab6;})['then'](respondWithFilteredResult(_0x25cbf7,_0x19663f))['catch'](handleError(_0x25cbf7,null));};exports[_0x46e7('0x41')]=function(_0x5b37bb,_0x25b5d0){var _0x2d8f93={'raw':![],'where':{'id':_0x5b37bb[_0x46e7('0x42')]['id']}},_0x1ab87e={};_0x1ab87e['model']=_[_0x46e7('0x43')](db[_0x46e7('0x2b')][_0x46e7('0x2c')]);_0x1ab87e[_0x46e7('0x30')]=_[_0x46e7('0x43')](_0x5b37bb[_0x46e7('0x30')]);_0x1ab87e[_0x46e7('0x31')]=_[_0x46e7('0x32')](_0x1ab87e[_0x46e7('0x2f')],_0x1ab87e[_0x46e7('0x30')]);_0x2d8f93[_0x46e7('0x33')]=_[_0x46e7('0x32')](_0x1ab87e['model'],qs['fields'](_0x5b37bb[_0x46e7('0x30')][_0x46e7('0x34')]));_0x2d8f93['attributes']=_0x2d8f93[_0x46e7('0x33')][_0x46e7('0x35')]?_0x2d8f93['attributes']:_0x1ab87e[_0x46e7('0x2f')];if(_0x5b37bb[_0x46e7('0x30')][_0x46e7('0x3f')]){_0x2d8f93['include']=[{'all':!![]}];}_0x2d8f93=_[_0x46e7('0x3b')]({},_0x2d8f93,_0x5b37bb[_0x46e7('0x3e')]);return db[_0x46e7('0x2b')][_0x46e7('0x44')](_0x2d8f93)[_0x46e7('0x26')](handleEntityNotFound(_0x25b5d0,null))[_0x46e7('0x26')](respondWithResult(_0x25b5d0,null))[_0x46e7('0x45')](handleError(_0x25b5d0,null));};exports[_0x46e7('0x46')]=function(_0x3dcbcb,_0x18f375){return db[_0x46e7('0x2b')][_0x46e7('0x46')](_0x3dcbcb[_0x46e7('0x47')],{})['then'](respondWithResult(_0x18f375,0xc9))[_0x46e7('0x45')](handleError(_0x18f375,null));};exports['update']=function(_0x1b29fa,_0x14b9bc){if(_0x1b29fa['body']['id']){delete _0x1b29fa['body']['id'];}return db[_0x46e7('0x2b')][_0x46e7('0x44')]({'where':{'id':_0x1b29fa[_0x46e7('0x42')]['id']}})[_0x46e7('0x26')](handleEntityNotFound(_0x14b9bc,null))[_0x46e7('0x26')](saveUpdates(_0x1b29fa['body'],null))[_0x46e7('0x26')](respondWithResult(_0x14b9bc,null))[_0x46e7('0x45')](handleError(_0x14b9bc,null));};exports['destroy']=function(_0x13c10c,_0x51510a){return db[_0x46e7('0x2b')][_0x46e7('0x44')]({'where':{'id':_0x13c10c[_0x46e7('0x42')]['id']}})[_0x46e7('0x26')](handleEntityNotFound(_0x51510a,null))['then'](removeEntity(_0x51510a,null))['catch'](handleError(_0x51510a,null));};exports['getFields']=function(_0x39a309,_0x331ebc,_0x392f17){var _0x2986d0={};var _0xbeab51={};var _0x277dae;var _0x4fa209;return db['ZendeskConfiguration'][_0x46e7('0x48')]({'where':{'id':_0x39a309[_0x46e7('0x42')]['id']}})[_0x46e7('0x26')](handleEntityNotFound(_0x331ebc,null))['then'](function(_0x6a460d){if(_0x6a460d){_0x277dae=_0x6a460d;_0xbeab51[_0x46e7('0x2f')]=_[_0x46e7('0x43')](db[_0x46e7('0x49')]['rawAttributes']);_0xbeab51[_0x46e7('0x30')]=_[_0x46e7('0x43')](_0x39a309[_0x46e7('0x30')]);_0xbeab51[_0x46e7('0x31')]=_[_0x46e7('0x32')](_0xbeab51[_0x46e7('0x2f')],_0xbeab51[_0x46e7('0x30')]);_0x2986d0[_0x46e7('0x33')]=_['intersection'](_0xbeab51['model'],qs[_0x46e7('0x34')](_0x39a309[_0x46e7('0x30')][_0x46e7('0x34')]));_0x2986d0[_0x46e7('0x33')]=_0x2986d0[_0x46e7('0x33')][_0x46e7('0x35')]?_0x2986d0[_0x46e7('0x33')]:_0xbeab51[_0x46e7('0x2f')];_0x2986d0[_0x46e7('0x36')]=qs['sort'](_0x39a309[_0x46e7('0x30')][_0x46e7('0x37')]);_0x2986d0[_0x46e7('0x38')]=qs[_0x46e7('0x31')](_[_0x46e7('0x39')](_0x39a309['query'],_0xbeab51[_0x46e7('0x31')]));if(_0x39a309[_0x46e7('0x30')]['filter']){_0x2986d0[_0x46e7('0x38')]=_[_0x46e7('0x3b')](_0x2986d0[_0x46e7('0x38')],{'$or':_['map'](_0x2986d0[_0x46e7('0x33')],function(_0xd7f405){var _0x5974fa={};_0x5974fa[_0xd7f405]={'$like':'%'+_0x39a309[_0x46e7('0x30')][_0x46e7('0x3a')]+'%'};return _0x5974fa;})});}_0x2986d0=_[_0x46e7('0x3b')]({},_0x2986d0,_0x39a309['options']);return _0x277dae[_0x46e7('0x4a')](_0x2986d0);}})[_0x46e7('0x26')](function(_0x13761f){if(_0x13761f){_0x4fa209=_0x13761f['length'];if(!_0x39a309[_0x46e7('0x30')][_0x46e7('0x4b')](_0x46e7('0x4c'))){_0x2986d0[_0x46e7('0x1d')]=qs[_0x46e7('0x1d')](_0x39a309[_0x46e7('0x30')]['limit']);_0x2986d0[_0x46e7('0x1c')]=qs[_0x46e7('0x1c')](_0x39a309[_0x46e7('0x30')][_0x46e7('0x1c')]);}return _0x277dae[_0x46e7('0x4a')](_0x2986d0);}})[_0x46e7('0x26')](function(_0x2bd853){if(_0x2bd853){return _0x2bd853?{'count':_0x4fa209,'rows':_0x2bd853}:null;}})[_0x46e7('0x26')](respondWithResult(_0x331ebc,null))[_0x46e7('0x45')](handleError(_0x331ebc,null));};exports[_0x46e7('0x4d')]=function(_0x4e8cac,_0x2b7fc2,_0x13c65d){var _0x43cfec={};var _0x1e679a={};var _0x2c690b;var _0x57da2e;return db[_0x46e7('0x2b')][_0x46e7('0x48')]({'where':{'id':_0x4e8cac['params']['id']}})[_0x46e7('0x26')](handleEntityNotFound(_0x2b7fc2,null))[_0x46e7('0x26')](function(_0x167806){if(_0x167806){_0x2c690b=_0x167806;_0x1e679a[_0x46e7('0x2f')]=_[_0x46e7('0x43')](db[_0x46e7('0x49')][_0x46e7('0x2c')]);_0x1e679a[_0x46e7('0x30')]=_[_0x46e7('0x43')](_0x4e8cac[_0x46e7('0x30')]);_0x1e679a[_0x46e7('0x31')]=_[_0x46e7('0x32')](_0x1e679a[_0x46e7('0x2f')],_0x1e679a[_0x46e7('0x30')]);_0x43cfec[_0x46e7('0x33')]=_[_0x46e7('0x32')](_0x1e679a[_0x46e7('0x2f')],qs[_0x46e7('0x34')](_0x4e8cac[_0x46e7('0x30')][_0x46e7('0x34')]));_0x43cfec['attributes']=_0x43cfec['attributes'][_0x46e7('0x35')]?_0x43cfec['attributes']:_0x1e679a[_0x46e7('0x2f')];_0x43cfec[_0x46e7('0x36')]=qs['sort'](_0x4e8cac[_0x46e7('0x30')][_0x46e7('0x37')]);_0x43cfec['where']=qs['filters'](_[_0x46e7('0x39')](_0x4e8cac[_0x46e7('0x30')],_0x1e679a[_0x46e7('0x31')]));if(_0x4e8cac[_0x46e7('0x30')]['filter']){_0x43cfec[_0x46e7('0x38')]=_[_0x46e7('0x3b')](_0x43cfec['where'],{'$or':_['map'](_0x43cfec['attributes'],function(_0x4ade58){var _0x255bbc={};_0x255bbc[_0x4ade58]={'$like':'%'+_0x4e8cac[_0x46e7('0x30')][_0x46e7('0x3a')]+'%'};return _0x255bbc;})});}_0x43cfec=_['merge']({},_0x43cfec,_0x4e8cac[_0x46e7('0x3e')]);return _0x2c690b[_0x46e7('0x4d')](_0x43cfec);}})[_0x46e7('0x26')](function(_0x5a5695){if(_0x5a5695){_0x57da2e=_0x5a5695['length'];if(!_0x4e8cac[_0x46e7('0x30')]['hasOwnProperty'](_0x46e7('0x4c'))){_0x43cfec[_0x46e7('0x1d')]=qs[_0x46e7('0x1d')](_0x4e8cac[_0x46e7('0x30')][_0x46e7('0x1d')]);_0x43cfec['offset']=qs['offset'](_0x4e8cac[_0x46e7('0x30')][_0x46e7('0x1c')]);}return _0x2c690b['getSubjects'](_0x43cfec);}})[_0x46e7('0x26')](function(_0xb237e2){if(_0xb237e2){return _0xb237e2?{'count':_0x57da2e,'rows':_0xb237e2}:null;}})[_0x46e7('0x26')](respondWithResult(_0x2b7fc2,null))['catch'](handleError(_0x2b7fc2,null));};exports['getDescriptions']=function(_0x4c8675,_0x22c0e2,_0x2ef08b){var _0x2e4227={};var _0x42e747={};var _0x2a015a;var _0x2ceafb;return db[_0x46e7('0x2b')][_0x46e7('0x48')]({'where':{'id':_0x4c8675[_0x46e7('0x42')]['id']}})[_0x46e7('0x26')](handleEntityNotFound(_0x22c0e2,null))[_0x46e7('0x26')](function(_0x349b3b){if(_0x349b3b){_0x2a015a=_0x349b3b;_0x42e747['model']=_[_0x46e7('0x43')](db[_0x46e7('0x49')][_0x46e7('0x2c')]);_0x42e747[_0x46e7('0x30')]=_[_0x46e7('0x43')](_0x4c8675['query']);_0x42e747['filters']=_[_0x46e7('0x32')](_0x42e747[_0x46e7('0x2f')],_0x42e747['query']);_0x2e4227[_0x46e7('0x33')]=_[_0x46e7('0x32')](_0x42e747[_0x46e7('0x2f')],qs['fields'](_0x4c8675['query']['fields']));_0x2e4227[_0x46e7('0x33')]=_0x2e4227[_0x46e7('0x33')][_0x46e7('0x35')]?_0x2e4227['attributes']:_0x42e747[_0x46e7('0x2f')];_0x2e4227[_0x46e7('0x36')]=qs[_0x46e7('0x37')](_0x4c8675[_0x46e7('0x30')][_0x46e7('0x37')]);_0x2e4227[_0x46e7('0x38')]=qs['filters'](_['pick'](_0x4c8675[_0x46e7('0x30')],_0x42e747['filters']));if(_0x4c8675[_0x46e7('0x30')]['filter']){_0x2e4227[_0x46e7('0x38')]=_['merge'](_0x2e4227[_0x46e7('0x38')],{'$or':_[_0x46e7('0x2a')](_0x2e4227[_0x46e7('0x33')],function(_0x33ff93){var _0x531aa4={};_0x531aa4[_0x33ff93]={'$like':'%'+_0x4c8675['query'][_0x46e7('0x3a')]+'%'};return _0x531aa4;})});}_0x2e4227=_['merge']({},_0x2e4227,_0x4c8675[_0x46e7('0x3e')]);return _0x2a015a['getDescriptions'](_0x2e4227);}})[_0x46e7('0x26')](function(_0x37148b){if(_0x37148b){_0x2ceafb=_0x37148b[_0x46e7('0x35')];if(!_0x4c8675[_0x46e7('0x30')][_0x46e7('0x4b')](_0x46e7('0x4c'))){_0x2e4227['limit']=qs[_0x46e7('0x1d')](_0x4c8675[_0x46e7('0x30')][_0x46e7('0x1d')]);_0x2e4227[_0x46e7('0x1c')]=qs[_0x46e7('0x1c')](_0x4c8675[_0x46e7('0x30')][_0x46e7('0x1c')]);}return _0x2a015a['getDescriptions'](_0x2e4227);}})['then'](function(_0xb1652c){if(_0xb1652c){return _0xb1652c?{'count':_0x2ceafb,'rows':_0xb1652c}:null;}})[_0x46e7('0x26')](respondWithResult(_0x22c0e2,null))[_0x46e7('0x45')](handleError(_0x22c0e2,null));};exports[_0x46e7('0x4e')]=function(_0x18ca59,_0x4e866e,_0x426092){var _0x23b0c5={};var _0x11661d={};var _0xd5edd7;var _0x3495d4;return db[_0x46e7('0x2b')][_0x46e7('0x48')]({'where':{'id':_0x18ca59[_0x46e7('0x42')]['id']}})[_0x46e7('0x26')](handleEntityNotFound(_0x4e866e,null))[_0x46e7('0x26')](function(_0x4d34c1){if(_0x4d34c1){_0xd5edd7=_0x4d34c1;_0x11661d['model']=_[_0x46e7('0x43')](db[_0x46e7('0x4f')]['rawAttributes']);_0x11661d[_0x46e7('0x30')]=_[_0x46e7('0x43')](_0x18ca59[_0x46e7('0x30')]);_0x11661d[_0x46e7('0x31')]=_[_0x46e7('0x32')](_0x11661d[_0x46e7('0x2f')],_0x11661d[_0x46e7('0x30')]);_0x23b0c5[_0x46e7('0x33')]=_['intersection'](_0x11661d[_0x46e7('0x2f')],qs['fields'](_0x18ca59[_0x46e7('0x30')][_0x46e7('0x34')]));_0x23b0c5[_0x46e7('0x33')]=_0x23b0c5[_0x46e7('0x33')][_0x46e7('0x35')]?_0x23b0c5[_0x46e7('0x33')]:_0x11661d[_0x46e7('0x2f')];_0x23b0c5[_0x46e7('0x36')]=qs[_0x46e7('0x37')](_0x18ca59['query'][_0x46e7('0x37')]);_0x23b0c5[_0x46e7('0x38')]=qs[_0x46e7('0x31')](_[_0x46e7('0x39')](_0x18ca59[_0x46e7('0x30')],_0x11661d[_0x46e7('0x31')]));if(_0x18ca59[_0x46e7('0x30')][_0x46e7('0x3a')]){_0x23b0c5[_0x46e7('0x38')]=_['merge'](_0x23b0c5[_0x46e7('0x38')],{'$or':_[_0x46e7('0x2a')](_0x23b0c5['attributes'],function(_0x1326c0){var _0x3f1797={};_0x3f1797[_0x1326c0]={'$like':'%'+_0x18ca59['query'][_0x46e7('0x3a')]+'%'};return _0x3f1797;})});}_0x23b0c5=_[_0x46e7('0x3b')]({},_0x23b0c5,_0x18ca59[_0x46e7('0x3e')]);return _0xd5edd7[_0x46e7('0x4e')](_0x23b0c5);}})[_0x46e7('0x26')](function(_0x2023ba){if(_0x2023ba){_0x3495d4=_0x2023ba[_0x46e7('0x35')];if(!_0x18ca59['query'][_0x46e7('0x4b')](_0x46e7('0x4c'))){_0x23b0c5[_0x46e7('0x1d')]=qs['limit'](_0x18ca59['query'][_0x46e7('0x1d')]);_0x23b0c5[_0x46e7('0x1c')]=qs['offset'](_0x18ca59[_0x46e7('0x30')][_0x46e7('0x1c')]);}return _0xd5edd7[_0x46e7('0x4e')](_0x23b0c5);}})[_0x46e7('0x26')](function(_0x4c1658){if(_0x4c1658){return _0x4c1658?{'count':_0x3495d4,'rows':_0x4c1658}:null;}})['then'](respondWithResult(_0x4e866e,null))[_0x46e7('0x45')](handleError(_0x4e866e,null));};exports[_0x46e7('0x50')]=function(_0x3433a4,_0x5139aa,_0x599a52){if(_0x3433a4[_0x46e7('0x47')]['id']){delete _0x3433a4['body']['id'];}return db[_0x46e7('0x2b')]['findOne']({'where':{'id':_0x3433a4[_0x46e7('0x42')]['id']}})[_0x46e7('0x26')](handleEntityNotFound(_0x5139aa,null))[_0x46e7('0x26')](function(_0x628873){if(_0x628873){return _0x628873[_0x46e7('0x50')](_0x3433a4[_0x46e7('0x47')]['ids']||[]);}return null;})[_0x46e7('0x26')](respondWithResult(_0x5139aa,null))[_0x46e7('0x45')](handleError(_0x5139aa,null));}; \ No newline at end of file +var _0x951a=['../../config/license/hardware','../../config/logger','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','offset','undefined','limit','count','set','Content-Range','apply','reject','save','destroy','error','stack','name','index','ZendeskConfiguration','fieldName','type','model','map','query','filters','intersection','fields','length','attributes','nolimit','order','sort','where','pick','filter','VIRTUAL','merge','options','then','includeAll','include','rows','catch','show','params','keys','find','create','body','update','getFields','findOne','rawAttributes','hasOwnProperty','getSubjects','getDescriptions','ZendeskField','getTags','Tag','setTags','eml-format','rimraf','zip-dir','fast-json-patch','bluebird','mustache','util','path','sox','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch'];(function(_0x22cf0f,_0x49c48c){var _0x2c2ed8=function(_0x115e55){while(--_0x115e55){_0x22cf0f['push'](_0x22cf0f['shift']());}};_0x2c2ed8(++_0x49c48c);}(_0x951a,0x18f));var _0xa951=function(_0x4f2f68,_0x67f62c){_0x4f2f68=_0x4f2f68-0x0;var _0x100f73=_0x951a[_0x4f2f68];return _0x100f73;};'use strict';var emlformat=require(_0xa951('0x0'));var rimraf=require(_0xa951('0x1'));var zipdir=require(_0xa951('0x2'));var jsonpatch=require(_0xa951('0x3'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0xa951('0x4'));var Mustache=require(_0xa951('0x5'));var util=require(_0xa951('0x6'));var path=require(_0xa951('0x7'));var sox=require(_0xa951('0x8'));var csv=require(_0xa951('0x9'));var ejs=require(_0xa951('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xa951('0xb'));var squel=require(_0xa951('0xc'));var crypto=require(_0xa951('0xd'));var jsforce=require(_0xa951('0xe'));var deskjs=require(_0xa951('0xf'));var toCsv=require(_0xa951('0x9'));var querystring=require(_0xa951('0x10'));var Papa=require(_0xa951('0x11'));var Redis=require('ioredis');var authService=require(_0xa951('0x12'));var qs=require(_0xa951('0x13'));var as=require(_0xa951('0x14'));var hardwareService=require(_0xa951('0x15'));var logger=require(_0xa951('0x16'))('api');var utils=require('../../config/utils');var config=require(_0xa951('0x17'));var licenseUtil=require(_0xa951('0x18'));var db=require(_0xa951('0x19'))['db'];function respondWithStatusCode(_0x4c8b39,_0x46aa13){_0x46aa13=_0x46aa13||0xcc;return function(_0x2512ff){if(_0x2512ff){return _0x4c8b39[_0xa951('0x1a')](_0x46aa13);}return _0x4c8b39[_0xa951('0x1b')](_0x46aa13)['end']();};}function respondWithResult(_0x43be54,_0x1fb5d1){_0x1fb5d1=_0x1fb5d1||0xc8;return function(_0x1ec589){if(_0x1ec589){return _0x43be54[_0xa951('0x1b')](_0x1fb5d1)['json'](_0x1ec589);}};}function respondWithFilteredResult(_0xc9e9c7,_0x311ae2){return function(_0x390ef5){if(_0x390ef5){var _0xe19167=typeof _0x311ae2[_0xa951('0x1c')]===_0xa951('0x1d')&&typeof _0x311ae2[_0xa951('0x1e')]===_0xa951('0x1d');var _0x4fd7c4=_0x390ef5['count'];var _0x59bc10=_0xe19167?0x0:_0x311ae2[_0xa951('0x1c')];var _0x5bd160=_0xe19167?_0x390ef5[_0xa951('0x1f')]:_0x311ae2[_0xa951('0x1c')]+_0x311ae2['limit'];var _0x8bf8cf;if(_0x5bd160>=_0x4fd7c4){_0x5bd160=_0x4fd7c4;_0x8bf8cf=0xc8;}else{_0x8bf8cf=0xce;}_0xc9e9c7[_0xa951('0x1b')](_0x8bf8cf);return _0xc9e9c7[_0xa951('0x20')](_0xa951('0x21'),_0x59bc10+'-'+_0x5bd160+'/'+_0x4fd7c4)['json'](_0x390ef5);}return null;};}function patchUpdates(_0x1ffa80){return function(_0x379f29){try{jsonpatch[_0xa951('0x22')](_0x379f29,_0x1ffa80,!![]);}catch(_0x42e99d){return BPromise[_0xa951('0x23')](_0x42e99d);}return _0x379f29[_0xa951('0x24')]();};}function saveUpdates(_0x529bc1,_0x3348c1){return function(_0xd47138){if(_0xd47138){return _0xd47138['update'](_0x529bc1)['then'](function(_0x2b9a8f){return _0x2b9a8f;});}return null;};}function removeEntity(_0x6a9000,_0x3e47ae){return function(_0x4fccc7){if(_0x4fccc7){return _0x4fccc7[_0xa951('0x25')]()['then'](function(){_0x6a9000[_0xa951('0x1b')](0xcc)['end']();});}};}function handleEntityNotFound(_0x2681fb,_0x472f28){return function(_0x56ff43){if(!_0x56ff43){_0x2681fb['sendStatus'](0x194);}return _0x56ff43;};}function handleError(_0x2bef97,_0x326b9e){_0x326b9e=_0x326b9e||0x1f4;return function(_0x29a7b7){logger[_0xa951('0x26')](_0x29a7b7[_0xa951('0x27')]);if(_0x29a7b7['name']){delete _0x29a7b7[_0xa951('0x28')];}_0x2bef97[_0xa951('0x1b')](_0x326b9e)['send'](_0x29a7b7);};}exports[_0xa951('0x29')]=function(_0x46f875,_0x5001ce){var _0xd3fd38={},_0x5a496c={},_0x26d29f={'count':0x0,'rows':[]};var _0x12be59=_['map'](db[_0xa951('0x2a')]['rawAttributes'],function(_0x1cde2f){return{'name':_0x1cde2f[_0xa951('0x2b')],'type':_0x1cde2f[_0xa951('0x2c')]['key']};});_0x5a496c[_0xa951('0x2d')]=_[_0xa951('0x2e')](_0x12be59,_0xa951('0x28'));_0x5a496c['query']=_['keys'](_0x46f875[_0xa951('0x2f')]);_0x5a496c[_0xa951('0x30')]=_[_0xa951('0x31')](_0x5a496c[_0xa951('0x2d')],_0x5a496c[_0xa951('0x2f')]);_0xd3fd38['attributes']=_[_0xa951('0x31')](_0x5a496c[_0xa951('0x2d')],qs[_0xa951('0x32')](_0x46f875['query'][_0xa951('0x32')]));_0xd3fd38['attributes']=_0xd3fd38['attributes'][_0xa951('0x33')]?_0xd3fd38[_0xa951('0x34')]:_0x5a496c[_0xa951('0x2d')];if(!_0x46f875[_0xa951('0x2f')]['hasOwnProperty'](_0xa951('0x35'))){_0xd3fd38[_0xa951('0x1e')]=qs[_0xa951('0x1e')](_0x46f875['query']['limit']);_0xd3fd38[_0xa951('0x1c')]=qs[_0xa951('0x1c')](_0x46f875['query']['offset']);}_0xd3fd38[_0xa951('0x36')]=qs[_0xa951('0x37')](_0x46f875[_0xa951('0x2f')][_0xa951('0x37')]);_0xd3fd38[_0xa951('0x38')]=qs[_0xa951('0x30')](_[_0xa951('0x39')](_0x46f875['query'],_0x5a496c[_0xa951('0x30')]),_0x12be59);if(_0x46f875[_0xa951('0x2f')][_0xa951('0x3a')]){_0xd3fd38[_0xa951('0x38')]=_['merge'](_0xd3fd38[_0xa951('0x38')],{'$or':_['map'](_0x12be59,function(_0x50bf80){if(_0x50bf80[_0xa951('0x2c')]!==_0xa951('0x3b')){var _0x51e7d9={};_0x51e7d9[_0x50bf80['name']]={'$like':'%'+_0x46f875[_0xa951('0x2f')][_0xa951('0x3a')]+'%'};return _0x51e7d9;}})});}_0xd3fd38=_[_0xa951('0x3c')]({},_0xd3fd38,_0x46f875[_0xa951('0x3d')]);var _0x1b4d15={'where':_0xd3fd38['where']};return db[_0xa951('0x2a')][_0xa951('0x1f')](_0x1b4d15)[_0xa951('0x3e')](function(_0x1ac9fa){_0x26d29f[_0xa951('0x1f')]=_0x1ac9fa;if(_0x46f875[_0xa951('0x2f')][_0xa951('0x3f')]){_0xd3fd38[_0xa951('0x40')]=[{'all':!![]}];}return db[_0xa951('0x2a')]['findAll'](_0xd3fd38);})[_0xa951('0x3e')](function(_0x2eb312){_0x26d29f[_0xa951('0x41')]=_0x2eb312;return _0x26d29f;})[_0xa951('0x3e')](respondWithFilteredResult(_0x5001ce,_0xd3fd38))[_0xa951('0x42')](handleError(_0x5001ce,null));};exports[_0xa951('0x43')]=function(_0x3453fc,_0x2f7ff7){var _0x4f92ed={'raw':![],'where':{'id':_0x3453fc[_0xa951('0x44')]['id']}},_0x16f67c={};_0x16f67c[_0xa951('0x2d')]=_[_0xa951('0x45')](db['ZendeskConfiguration']['rawAttributes']);_0x16f67c['query']=_[_0xa951('0x45')](_0x3453fc[_0xa951('0x2f')]);_0x16f67c['filters']=_['intersection'](_0x16f67c['model'],_0x16f67c[_0xa951('0x2f')]);_0x4f92ed[_0xa951('0x34')]=_[_0xa951('0x31')](_0x16f67c[_0xa951('0x2d')],qs[_0xa951('0x32')](_0x3453fc['query'][_0xa951('0x32')]));_0x4f92ed[_0xa951('0x34')]=_0x4f92ed[_0xa951('0x34')][_0xa951('0x33')]?_0x4f92ed[_0xa951('0x34')]:_0x16f67c[_0xa951('0x2d')];if(_0x3453fc['query'][_0xa951('0x3f')]){_0x4f92ed[_0xa951('0x40')]=[{'all':!![]}];}_0x4f92ed=_[_0xa951('0x3c')]({},_0x4f92ed,_0x3453fc[_0xa951('0x3d')]);return db[_0xa951('0x2a')][_0xa951('0x46')](_0x4f92ed)['then'](handleEntityNotFound(_0x2f7ff7,null))[_0xa951('0x3e')](respondWithResult(_0x2f7ff7,null))[_0xa951('0x42')](handleError(_0x2f7ff7,null));};exports[_0xa951('0x47')]=function(_0x38bdad,_0x173c07){return db[_0xa951('0x2a')][_0xa951('0x47')](_0x38bdad[_0xa951('0x48')],{})[_0xa951('0x3e')](respondWithResult(_0x173c07,0xc9))[_0xa951('0x42')](handleError(_0x173c07,null));};exports[_0xa951('0x49')]=function(_0x307aa3,_0x3bfd46){if(_0x307aa3[_0xa951('0x48')]['id']){delete _0x307aa3[_0xa951('0x48')]['id'];}return db[_0xa951('0x2a')][_0xa951('0x46')]({'where':{'id':_0x307aa3[_0xa951('0x44')]['id']}})[_0xa951('0x3e')](handleEntityNotFound(_0x3bfd46,null))[_0xa951('0x3e')](saveUpdates(_0x307aa3[_0xa951('0x48')],null))[_0xa951('0x3e')](respondWithResult(_0x3bfd46,null))[_0xa951('0x42')](handleError(_0x3bfd46,null));};exports[_0xa951('0x25')]=function(_0x3472b0,_0x465d85){return db[_0xa951('0x2a')][_0xa951('0x46')]({'where':{'id':_0x3472b0[_0xa951('0x44')]['id']}})[_0xa951('0x3e')](handleEntityNotFound(_0x465d85,null))[_0xa951('0x3e')](removeEntity(_0x465d85,null))[_0xa951('0x42')](handleError(_0x465d85,null));};exports[_0xa951('0x4a')]=function(_0x2b150b,_0x51b224,_0x2981aa){var _0x269333={};var _0x4489e6={};var _0x276368;var _0x40d688;return db[_0xa951('0x2a')][_0xa951('0x4b')]({'where':{'id':_0x2b150b['params']['id']}})[_0xa951('0x3e')](handleEntityNotFound(_0x51b224,null))['then'](function(_0x593786){if(_0x593786){_0x276368=_0x593786;_0x4489e6[_0xa951('0x2d')]=_[_0xa951('0x45')](db['ZendeskField'][_0xa951('0x4c')]);_0x4489e6[_0xa951('0x2f')]=_[_0xa951('0x45')](_0x2b150b[_0xa951('0x2f')]);_0x4489e6[_0xa951('0x30')]=_[_0xa951('0x31')](_0x4489e6['model'],_0x4489e6[_0xa951('0x2f')]);_0x269333['attributes']=_[_0xa951('0x31')](_0x4489e6['model'],qs['fields'](_0x2b150b[_0xa951('0x2f')][_0xa951('0x32')]));_0x269333[_0xa951('0x34')]=_0x269333[_0xa951('0x34')][_0xa951('0x33')]?_0x269333[_0xa951('0x34')]:_0x4489e6[_0xa951('0x2d')];_0x269333[_0xa951('0x36')]=qs['sort'](_0x2b150b[_0xa951('0x2f')][_0xa951('0x37')]);_0x269333[_0xa951('0x38')]=qs[_0xa951('0x30')](_[_0xa951('0x39')](_0x2b150b[_0xa951('0x2f')],_0x4489e6[_0xa951('0x30')]));if(_0x2b150b['query'][_0xa951('0x3a')]){_0x269333[_0xa951('0x38')]=_[_0xa951('0x3c')](_0x269333[_0xa951('0x38')],{'$or':_[_0xa951('0x2e')](_0x269333['attributes'],function(_0x5bfe3e){var _0x3ad0ce={};_0x3ad0ce[_0x5bfe3e]={'$like':'%'+_0x2b150b[_0xa951('0x2f')][_0xa951('0x3a')]+'%'};return _0x3ad0ce;})});}_0x269333=_[_0xa951('0x3c')]({},_0x269333,_0x2b150b[_0xa951('0x3d')]);return _0x276368[_0xa951('0x4a')](_0x269333);}})[_0xa951('0x3e')](function(_0x963270){if(_0x963270){_0x40d688=_0x963270[_0xa951('0x33')];if(!_0x2b150b[_0xa951('0x2f')][_0xa951('0x4d')](_0xa951('0x35'))){_0x269333['limit']=qs[_0xa951('0x1e')](_0x2b150b['query']['limit']);_0x269333[_0xa951('0x1c')]=qs[_0xa951('0x1c')](_0x2b150b['query'][_0xa951('0x1c')]);}return _0x276368['getFields'](_0x269333);}})[_0xa951('0x3e')](function(_0x3aba7e){if(_0x3aba7e){return _0x3aba7e?{'count':_0x40d688,'rows':_0x3aba7e}:null;}})[_0xa951('0x3e')](respondWithResult(_0x51b224,null))[_0xa951('0x42')](handleError(_0x51b224,null));};exports[_0xa951('0x4e')]=function(_0x29971f,_0x5c1a63,_0x154fe4){var _0x246924={};var _0x1e33fa={};var _0x55cdb2;var _0x36a6cf;return db[_0xa951('0x2a')][_0xa951('0x4b')]({'where':{'id':_0x29971f[_0xa951('0x44')]['id']}})['then'](handleEntityNotFound(_0x5c1a63,null))[_0xa951('0x3e')](function(_0x31fe8b){if(_0x31fe8b){_0x55cdb2=_0x31fe8b;_0x1e33fa[_0xa951('0x2d')]=_[_0xa951('0x45')](db['ZendeskField'][_0xa951('0x4c')]);_0x1e33fa[_0xa951('0x2f')]=_[_0xa951('0x45')](_0x29971f[_0xa951('0x2f')]);_0x1e33fa['filters']=_[_0xa951('0x31')](_0x1e33fa['model'],_0x1e33fa[_0xa951('0x2f')]);_0x246924['attributes']=_[_0xa951('0x31')](_0x1e33fa[_0xa951('0x2d')],qs['fields'](_0x29971f[_0xa951('0x2f')][_0xa951('0x32')]));_0x246924['attributes']=_0x246924['attributes'][_0xa951('0x33')]?_0x246924[_0xa951('0x34')]:_0x1e33fa['model'];_0x246924['order']=qs[_0xa951('0x37')](_0x29971f[_0xa951('0x2f')]['sort']);_0x246924[_0xa951('0x38')]=qs[_0xa951('0x30')](_[_0xa951('0x39')](_0x29971f[_0xa951('0x2f')],_0x1e33fa['filters']));if(_0x29971f[_0xa951('0x2f')][_0xa951('0x3a')]){_0x246924['where']=_[_0xa951('0x3c')](_0x246924[_0xa951('0x38')],{'$or':_['map'](_0x246924[_0xa951('0x34')],function(_0x278101){var _0x1a5b7a={};_0x1a5b7a[_0x278101]={'$like':'%'+_0x29971f[_0xa951('0x2f')]['filter']+'%'};return _0x1a5b7a;})});}_0x246924=_[_0xa951('0x3c')]({},_0x246924,_0x29971f[_0xa951('0x3d')]);return _0x55cdb2['getSubjects'](_0x246924);}})[_0xa951('0x3e')](function(_0x178ab7){if(_0x178ab7){_0x36a6cf=_0x178ab7[_0xa951('0x33')];if(!_0x29971f[_0xa951('0x2f')][_0xa951('0x4d')](_0xa951('0x35'))){_0x246924[_0xa951('0x1e')]=qs['limit'](_0x29971f[_0xa951('0x2f')][_0xa951('0x1e')]);_0x246924[_0xa951('0x1c')]=qs[_0xa951('0x1c')](_0x29971f[_0xa951('0x2f')][_0xa951('0x1c')]);}return _0x55cdb2[_0xa951('0x4e')](_0x246924);}})[_0xa951('0x3e')](function(_0x51f7cc){if(_0x51f7cc){return _0x51f7cc?{'count':_0x36a6cf,'rows':_0x51f7cc}:null;}})[_0xa951('0x3e')](respondWithResult(_0x5c1a63,null))[_0xa951('0x42')](handleError(_0x5c1a63,null));};exports[_0xa951('0x4f')]=function(_0x5bc68f,_0x379411,_0x53a1ea){var _0x4ed6e3={};var _0x19c707={};var _0x5cb0fe;var _0x301384;return db[_0xa951('0x2a')][_0xa951('0x4b')]({'where':{'id':_0x5bc68f['params']['id']}})[_0xa951('0x3e')](handleEntityNotFound(_0x379411,null))[_0xa951('0x3e')](function(_0x410eb1){if(_0x410eb1){_0x5cb0fe=_0x410eb1;_0x19c707[_0xa951('0x2d')]=_[_0xa951('0x45')](db[_0xa951('0x50')]['rawAttributes']);_0x19c707[_0xa951('0x2f')]=_['keys'](_0x5bc68f[_0xa951('0x2f')]);_0x19c707[_0xa951('0x30')]=_[_0xa951('0x31')](_0x19c707['model'],_0x19c707[_0xa951('0x2f')]);_0x4ed6e3[_0xa951('0x34')]=_[_0xa951('0x31')](_0x19c707['model'],qs[_0xa951('0x32')](_0x5bc68f[_0xa951('0x2f')][_0xa951('0x32')]));_0x4ed6e3[_0xa951('0x34')]=_0x4ed6e3[_0xa951('0x34')]['length']?_0x4ed6e3[_0xa951('0x34')]:_0x19c707[_0xa951('0x2d')];_0x4ed6e3[_0xa951('0x36')]=qs['sort'](_0x5bc68f['query'][_0xa951('0x37')]);_0x4ed6e3['where']=qs['filters'](_[_0xa951('0x39')](_0x5bc68f[_0xa951('0x2f')],_0x19c707[_0xa951('0x30')]));if(_0x5bc68f[_0xa951('0x2f')][_0xa951('0x3a')]){_0x4ed6e3[_0xa951('0x38')]=_[_0xa951('0x3c')](_0x4ed6e3[_0xa951('0x38')],{'$or':_['map'](_0x4ed6e3[_0xa951('0x34')],function(_0x219a35){var _0x2dc3e8={};_0x2dc3e8[_0x219a35]={'$like':'%'+_0x5bc68f['query'][_0xa951('0x3a')]+'%'};return _0x2dc3e8;})});}_0x4ed6e3=_[_0xa951('0x3c')]({},_0x4ed6e3,_0x5bc68f[_0xa951('0x3d')]);return _0x5cb0fe['getDescriptions'](_0x4ed6e3);}})[_0xa951('0x3e')](function(_0xc94491){if(_0xc94491){_0x301384=_0xc94491[_0xa951('0x33')];if(!_0x5bc68f[_0xa951('0x2f')]['hasOwnProperty']('nolimit')){_0x4ed6e3[_0xa951('0x1e')]=qs['limit'](_0x5bc68f[_0xa951('0x2f')][_0xa951('0x1e')]);_0x4ed6e3['offset']=qs[_0xa951('0x1c')](_0x5bc68f['query'][_0xa951('0x1c')]);}return _0x5cb0fe[_0xa951('0x4f')](_0x4ed6e3);}})[_0xa951('0x3e')](function(_0x2bbdf6){if(_0x2bbdf6){return _0x2bbdf6?{'count':_0x301384,'rows':_0x2bbdf6}:null;}})['then'](respondWithResult(_0x379411,null))[_0xa951('0x42')](handleError(_0x379411,null));};exports[_0xa951('0x51')]=function(_0x343a51,_0x14292c,_0xf5b06e){var _0x1223e7={};var _0x3742cb={};var _0xea437e;var _0x5b284c;return db['ZendeskConfiguration']['findOne']({'where':{'id':_0x343a51[_0xa951('0x44')]['id']}})[_0xa951('0x3e')](handleEntityNotFound(_0x14292c,null))['then'](function(_0x3cccae){if(_0x3cccae){_0xea437e=_0x3cccae;_0x3742cb[_0xa951('0x2d')]=_['keys'](db[_0xa951('0x52')][_0xa951('0x4c')]);_0x3742cb[_0xa951('0x2f')]=_['keys'](_0x343a51[_0xa951('0x2f')]);_0x3742cb[_0xa951('0x30')]=_[_0xa951('0x31')](_0x3742cb[_0xa951('0x2d')],_0x3742cb[_0xa951('0x2f')]);_0x1223e7['attributes']=_[_0xa951('0x31')](_0x3742cb['model'],qs[_0xa951('0x32')](_0x343a51['query'][_0xa951('0x32')]));_0x1223e7['attributes']=_0x1223e7[_0xa951('0x34')][_0xa951('0x33')]?_0x1223e7[_0xa951('0x34')]:_0x3742cb[_0xa951('0x2d')];_0x1223e7['order']=qs[_0xa951('0x37')](_0x343a51[_0xa951('0x2f')][_0xa951('0x37')]);_0x1223e7[_0xa951('0x38')]=qs[_0xa951('0x30')](_[_0xa951('0x39')](_0x343a51[_0xa951('0x2f')],_0x3742cb[_0xa951('0x30')]));if(_0x343a51[_0xa951('0x2f')]['filter']){_0x1223e7[_0xa951('0x38')]=_[_0xa951('0x3c')](_0x1223e7[_0xa951('0x38')],{'$or':_[_0xa951('0x2e')](_0x1223e7[_0xa951('0x34')],function(_0x4153b8){var _0x311660={};_0x311660[_0x4153b8]={'$like':'%'+_0x343a51[_0xa951('0x2f')][_0xa951('0x3a')]+'%'};return _0x311660;})});}_0x1223e7=_[_0xa951('0x3c')]({},_0x1223e7,_0x343a51[_0xa951('0x3d')]);return _0xea437e[_0xa951('0x51')](_0x1223e7);}})[_0xa951('0x3e')](function(_0x174ca4){if(_0x174ca4){_0x5b284c=_0x174ca4['length'];if(!_0x343a51[_0xa951('0x2f')][_0xa951('0x4d')](_0xa951('0x35'))){_0x1223e7['limit']=qs[_0xa951('0x1e')](_0x343a51[_0xa951('0x2f')][_0xa951('0x1e')]);_0x1223e7[_0xa951('0x1c')]=qs[_0xa951('0x1c')](_0x343a51[_0xa951('0x2f')]['offset']);}return _0xea437e[_0xa951('0x51')](_0x1223e7);}})[_0xa951('0x3e')](function(_0x1b9842){if(_0x1b9842){return _0x1b9842?{'count':_0x5b284c,'rows':_0x1b9842}:null;}})[_0xa951('0x3e')](respondWithResult(_0x14292c,null))[_0xa951('0x42')](handleError(_0x14292c,null));};exports[_0xa951('0x53')]=function(_0x20a51a,_0x3e8a47,_0x5e1b6b){if(_0x20a51a['body']['id']){delete _0x20a51a[_0xa951('0x48')]['id'];}return db[_0xa951('0x2a')][_0xa951('0x4b')]({'where':{'id':_0x20a51a[_0xa951('0x44')]['id']}})[_0xa951('0x3e')](handleEntityNotFound(_0x3e8a47,null))['then'](function(_0x911c3f){if(_0x911c3f){return _0x911c3f['setTags'](_0x20a51a[_0xa951('0x48')]['ids']||[]);}return null;})[_0xa951('0x3e')](respondWithResult(_0x3e8a47,null))[_0xa951('0x42')](handleError(_0x3e8a47,null));}; \ No newline at end of file diff --git a/server/api/intZendeskConfiguration/intZendeskConfiguration.model.js b/server/api/intZendeskConfiguration/intZendeskConfiguration.model.js index c88bda0..75e26ae 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 _0x2032=['int_zendesk_configurations','util','../../config/logger','api','bluebird','request-promise','rimraf','../../config/environment','./intZendeskConfiguration.attributes','exports','define','ZendeskConfiguration'];(function(_0xfbfb3a,_0x362c75){var _0x3f7f5a=function(_0x26eb28){while(--_0x26eb28){_0xfbfb3a['push'](_0xfbfb3a['shift']());}};_0x3f7f5a(++_0x362c75);}(_0x2032,0xd9));var _0x2203=function(_0x30cf17,_0x2fed35){_0x30cf17=_0x30cf17-0x0;var _0x2587cb=_0x2032[_0x30cf17];return _0x2587cb;};'use strict';var _=require('lodash');var util=require(_0x2203('0x0'));var logger=require(_0x2203('0x1'))(_0x2203('0x2'));var moment=require('moment');var BPromise=require(_0x2203('0x3'));var rp=require(_0x2203('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0x2203('0x5'));var config=require(_0x2203('0x6'));var attributes=require(_0x2203('0x7'));module[_0x2203('0x8')]=function(_0x3f7ba1,_0x13367a){return _0x3f7ba1[_0x2203('0x9')](_0x2203('0xa'),attributes,{'tableName':_0x2203('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xb574=['./intZendeskConfiguration.attributes','lodash','util','api','moment','request-promise','path','rimraf','../../config/environment'];(function(_0x2ef43f,_0x5b91e5){var _0x2a05a5=function(_0x19af4c){while(--_0x19af4c){_0x2ef43f['push'](_0x2ef43f['shift']());}};_0x2a05a5(++_0x5b91e5);}(_0xb574,0x106));var _0x4b57=function(_0x5c9ffa,_0x34e967){_0x5c9ffa=_0x5c9ffa-0x0;var _0x3f2aeb=_0xb574[_0x5c9ffa];return _0x3f2aeb;};'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']('ZendeskConfiguration',attributes,{'tableName':'int_zendesk_configurations','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 91627fe..91d6d99 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 _0x390c=['debug','ZendeskConfiguration,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','request','then','info','ZendeskConfiguration,\x20%s,\x20%s'];(function(_0x5cec00,_0x979dd0){var _0x15fbf7=function(_0x50a3f0){while(--_0x50a3f0){_0x5cec00['push'](_0x5cec00['shift']());}};_0x15fbf7(++_0x979dd0);}(_0x390c,0x81));var _0xc390=function(_0x840cef,_0xa6acd8){_0x840cef=_0x840cef-0x0;var _0x2427dc=_0x390c[_0x840cef];return _0x2427dc;};'use strict';var _=require('lodash');var util=require(_0xc390('0x0'));var moment=require(_0xc390('0x1'));var BPromise=require(_0xc390('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xc390('0x3'));var db=require(_0xc390('0x4'))['db'];var utils=require(_0xc390('0x5'));var logger=require('../../config/logger')(_0xc390('0x6'));var config=require(_0xc390('0x7'));var jayson=require(_0xc390('0x8'));var client=jayson[_0xc390('0x9')][_0xc390('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x35188d,_0x15de58,_0x2cd7cc){return new BPromise(function(_0xc9910e,_0x39def6){return client[_0xc390('0xb')](_0x35188d,_0x2cd7cc)[_0xc390('0xc')](function(_0x1d1aa5){logger[_0xc390('0xd')](_0xc390('0xe'),_0x15de58,'request\x20sent');logger[_0xc390('0xf')](_0xc390('0x10'),_0x15de58,_0xc390('0x11'),JSON[_0xc390('0x12')](_0x1d1aa5));if(_0x1d1aa5['error']){if(_0x1d1aa5[_0xc390('0x13')][_0xc390('0x14')]===0x1f4){logger[_0xc390('0x13')](_0xc390('0xe'),_0x15de58,_0x1d1aa5[_0xc390('0x13')]['message']);return _0x39def6(_0x1d1aa5[_0xc390('0x13')][_0xc390('0x15')]);}logger['error'](_0xc390('0xe'),_0x15de58,_0x1d1aa5[_0xc390('0x13')][_0xc390('0x15')]);return _0xc9910e(_0x1d1aa5[_0xc390('0x13')]['message']);}else{logger[_0xc390('0xd')](_0xc390('0xe'),_0x15de58,'request\x20sent');_0xc9910e(_0x1d1aa5[_0xc390('0x16')]['message']);}})[_0xc390('0x17')](function(_0x5b5e6f){logger[_0xc390('0x13')](_0xc390('0xe'),_0x15de58,_0x5b5e6f);_0x39def6(_0x5b5e6f);});});} \ No newline at end of file +var _0x1af3=['request\x20sent','debug','ZendeskConfiguration,\x20%s,\x20%s,\x20%s','stringify','error','code','ZendeskConfiguration,\x20%s,\x20%s','message','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info'];(function(_0x16c32b,_0xef7c98){var _0x3c37ab=function(_0x1bb96a){while(--_0x1bb96a){_0x16c32b['push'](_0x16c32b['shift']());}};_0x3c37ab(++_0xef7c98);}(_0x1af3,0x128));var _0x31af=function(_0x5a26f5,_0x196300){_0x5a26f5=_0x5a26f5-0x0;var _0x2e9ef7=_0x1af3[_0x5a26f5];return _0x2e9ef7;};'use strict';var _=require(_0x31af('0x0'));var util=require(_0x31af('0x1'));var moment=require(_0x31af('0x2'));var BPromise=require(_0x31af('0x3'));var rs=require(_0x31af('0x4'));var fs=require('fs');var Redis=require(_0x31af('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0x31af('0x6'));var logger=require(_0x31af('0x7'))(_0x31af('0x8'));var config=require(_0x31af('0x9'));var jayson=require(_0x31af('0xa'));var client=jayson[_0x31af('0xb')][_0x31af('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x3815b4,_0x3b7d30,_0xad3d85){return new BPromise(function(_0x2e1255,_0x81d852){return client[_0x31af('0xd')](_0x3815b4,_0xad3d85)[_0x31af('0xe')](function(_0x1c2e7f){logger[_0x31af('0xf')]('ZendeskConfiguration,\x20%s,\x20%s',_0x3b7d30,_0x31af('0x10'));logger[_0x31af('0x11')](_0x31af('0x12'),_0x3b7d30,_0x31af('0x10'),JSON[_0x31af('0x13')](_0x1c2e7f));if(_0x1c2e7f[_0x31af('0x14')]){if(_0x1c2e7f['error'][_0x31af('0x15')]===0x1f4){logger[_0x31af('0x14')](_0x31af('0x16'),_0x3b7d30,_0x1c2e7f[_0x31af('0x14')]['message']);return _0x81d852(_0x1c2e7f['error'][_0x31af('0x17')]);}logger['error'](_0x31af('0x16'),_0x3b7d30,_0x1c2e7f[_0x31af('0x14')][_0x31af('0x17')]);return _0x2e1255(_0x1c2e7f['error'][_0x31af('0x17')]);}else{logger[_0x31af('0xf')](_0x31af('0x16'),_0x3b7d30,'request\x20sent');_0x2e1255(_0x1c2e7f[_0x31af('0x18')][_0x31af('0x17')]);}})[_0x31af('0x19')](function(_0x1557b5){logger[_0x31af('0x14')]('ZendeskConfiguration,\x20%s,\x20%s',_0x3b7d30,_0x1557b5);_0x81d852(_0x1557b5);});});} \ No newline at end of file diff --git a/server/api/intZendeskField/index.js b/server/api/intZendeskField/index.js index 7c5db7b..19b1ec4 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 _0xa3fe=['../../components/auth/service','../../components/interaction/service','../../config/environment','isAuthenticated','/:id','show','create','put','update','destroy','exports','multer','util','connect-timeout','express','Router','fs-extra'];(function(_0x1cb21a,_0x4bc8d7){var _0x2d80b2=function(_0x7f2e25){while(--_0x7f2e25){_0x1cb21a['push'](_0x1cb21a['shift']());}};_0x2d80b2(++_0x4bc8d7);}(_0xa3fe,0xd7));var _0xea3f=function(_0x5caafa,_0x45346b){_0x5caafa=_0x5caafa-0x0;var _0x176a7c=_0xa3fe[_0x5caafa];return _0x176a7c;};'use strict';var multer=require(_0xea3f('0x0'));var util=require(_0xea3f('0x1'));var path=require('path');var timeout=require(_0xea3f('0x2'));var express=require(_0xea3f('0x3'));var router=express[_0xea3f('0x4')]();var fs_extra=require(_0xea3f('0x5'));var auth=require(_0xea3f('0x6'));var interaction=require(_0xea3f('0x7'));var config=require(_0xea3f('0x8'));var controller=require('./intZendeskField.controller');router['get']('/',auth[_0xea3f('0x9')](),controller['index']);router['get'](_0xea3f('0xa'),auth['isAuthenticated'](),controller[_0xea3f('0xb')]);router['post']('/',auth[_0xea3f('0x9')](),controller[_0xea3f('0xc')]);router[_0xea3f('0xd')](_0xea3f('0xa'),auth[_0xea3f('0x9')](),controller[_0xea3f('0xe')]);router['delete']('/:id',auth[_0xea3f('0x9')](),controller[_0xea3f('0xf')]);module[_0xea3f('0x10')]=router; \ No newline at end of file +var _0xf8cd=['../../components/auth/service','../../components/interaction/service','isAuthenticated','get','/:id','show','post','create','update','delete','destroy','exports','multer','util','path','connect-timeout','Router','fs-extra'];(function(_0xe418a3,_0x470d69){var _0x4b776d=function(_0x353c0b){while(--_0x353c0b){_0xe418a3['push'](_0xe418a3['shift']());}};_0x4b776d(++_0x470d69);}(_0xf8cd,0x11a));var _0xdf8c=function(_0x1e8c5b,_0x37ea41){_0x1e8c5b=_0x1e8c5b-0x0;var _0x372092=_0xf8cd[_0x1e8c5b];return _0x372092;};'use strict';var multer=require(_0xdf8c('0x0'));var util=require(_0xdf8c('0x1'));var path=require(_0xdf8c('0x2'));var timeout=require(_0xdf8c('0x3'));var express=require('express');var router=express[_0xdf8c('0x4')]();var fs_extra=require(_0xdf8c('0x5'));var auth=require(_0xdf8c('0x6'));var interaction=require(_0xdf8c('0x7'));var config=require('../../config/environment');var controller=require('./intZendeskField.controller');router['get']('/',auth[_0xdf8c('0x8')](),controller['index']);router[_0xdf8c('0x9')](_0xdf8c('0xa'),auth[_0xdf8c('0x8')](),controller[_0xdf8c('0xb')]);router[_0xdf8c('0xc')]('/',auth[_0xdf8c('0x8')](),controller[_0xdf8c('0xd')]);router['put']('/:id',auth[_0xdf8c('0x8')](),controller[_0xdf8c('0xe')]);router[_0xdf8c('0xf')](_0xdf8c('0xa'),auth[_0xdf8c('0x8')](),controller[_0xdf8c('0x10')]);module[_0xdf8c('0x11')]=router; \ No newline at end of file diff --git a/server/api/intZendeskField/intZendeskField.attributes.js b/server/api/intZendeskField/intZendeskField.attributes.js index 356f5a5..ffb898f 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 _0xaa3e=['variable','picklist','STRING','customVariable','BOOLEAN','sequelize','ENUM','string'];(function(_0x2c541c,_0x5227f7){var _0x4656a7=function(_0x481cfb){while(--_0x481cfb){_0x2c541c['push'](_0x2c541c['shift']());}};_0x4656a7(++_0x5227f7);}(_0xaa3e,0x7d));var _0xeaa3=function(_0x5e8c32,_0x1b1f3f){_0x5e8c32=_0x5e8c32-0x0;var _0x595f7b=_0xaa3e[_0x5e8c32];return _0x595f7b;};'use strict';var Sequelize=require(_0xeaa3('0x0'));module['exports']={'type':{'type':Sequelize[_0xeaa3('0x1')](_0xeaa3('0x2'),_0xeaa3('0x3'),'customVariable','keyValue',_0xeaa3('0x4')),'defaultValue':'string'},'content':{'type':Sequelize[_0xeaa3('0x5')]},'key':{'type':Sequelize[_0xeaa3('0x5')]},'keyType':{'type':Sequelize[_0xeaa3('0x1')](_0xeaa3('0x2'),_0xeaa3('0x3'),_0xeaa3('0x6'))},'keyContent':{'type':Sequelize[_0xeaa3('0x5')]},'idField':{'type':Sequelize[_0xeaa3('0x5')]},'nameField':{'type':Sequelize[_0xeaa3('0x5')]},'customField':{'type':Sequelize[_0xeaa3('0x7')],'defaultValue':!![]},'variableName':{'type':Sequelize[_0xeaa3('0x5')]}}; \ No newline at end of file +var _0x7ffc=['customVariable','ENUM','variable','picklist','string','STRING'];(function(_0x612c2a,_0x53f3f6){var _0x24aa56=function(_0x12655c){while(--_0x12655c){_0x612c2a['push'](_0x612c2a['shift']());}};_0x24aa56(++_0x53f3f6);}(_0x7ffc,0x115));var _0xc7ff=function(_0xa0d6e8,_0x41e320){_0xa0d6e8=_0xa0d6e8-0x0;var _0x4ba300=_0x7ffc[_0xa0d6e8];return _0x4ba300;};'use strict';var Sequelize=require('sequelize');module['exports']={'type':{'type':Sequelize[_0xc7ff('0x0')]('string',_0xc7ff('0x1'),'customVariable','keyValue',_0xc7ff('0x2')),'defaultValue':_0xc7ff('0x3')},'content':{'type':Sequelize['STRING']},'key':{'type':Sequelize[_0xc7ff('0x4')]},'keyType':{'type':Sequelize[_0xc7ff('0x0')](_0xc7ff('0x3'),_0xc7ff('0x1'),_0xc7ff('0x5'))},'keyContent':{'type':Sequelize[_0xc7ff('0x4')]},'idField':{'type':Sequelize[_0xc7ff('0x4')]},'nameField':{'type':Sequelize[_0xc7ff('0x4')]},'customField':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'variableName':{'type':Sequelize['STRING']}}; \ No newline at end of file diff --git a/server/api/intZendeskField/intZendeskField.controller.js b/server/api/intZendeskField/intZendeskField.controller.js index 5a81f46..3305abd 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 _0x93e7=['includeAll','include','findAll','rows','catch','show','params','options','find','create','body','destroy','eml-format','zip-dir','fast-json-patch','moment','bluebird','mustache','util','sox','ejs','lodash','crypto','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','api','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','set','Content-Range','apply','reject','save','update','then','error','stack','name','send','index','ZendeskField','fieldName','model','query','keys','filters','intersection','attributes','fields','length','nolimit','order','sort','where','filter','merge','map','type','VIRTUAL','count'];(function(_0x554494,_0x462f8a){var _0x34d6c1=function(_0x43ae88){while(--_0x43ae88){_0x554494['push'](_0x554494['shift']());}};_0x34d6c1(++_0x462f8a);}(_0x93e7,0x9e));var _0x793e=function(_0x294f3d,_0x1b0f82){_0x294f3d=_0x294f3d-0x0;var _0x2c8f6c=_0x93e7[_0x294f3d];return _0x2c8f6c;};'use strict';var emlformat=require(_0x793e('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x793e('0x1'));var jsonpatch=require(_0x793e('0x2'));var rp=require('request-promise');var moment=require(_0x793e('0x3'));var BPromise=require(_0x793e('0x4'));var Mustache=require(_0x793e('0x5'));var util=require(_0x793e('0x6'));var path=require('path');var sox=require(_0x793e('0x7'));var csv=require('to-csv');var ejs=require(_0x793e('0x8'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x793e('0x9'));var squel=require('squel');var crypto=require(_0x793e('0xa'));var jsforce=require(_0x793e('0xb'));var deskjs=require(_0x793e('0xc'));var toCsv=require(_0x793e('0xd'));var querystring=require(_0x793e('0xe'));var Papa=require(_0x793e('0xf'));var Redis=require(_0x793e('0x10'));var authService=require(_0x793e('0x11'));var qs=require(_0x793e('0x12'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x793e('0x13'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0x793e('0x14'));var db=require(_0x793e('0x15'))['db'];function respondWithStatusCode(_0x57709f,_0x6a5f34){_0x6a5f34=_0x6a5f34||0xcc;return function(_0x2e2efe){if(_0x2e2efe){return _0x57709f[_0x793e('0x16')](_0x6a5f34);}return _0x57709f[_0x793e('0x17')](_0x6a5f34)[_0x793e('0x18')]();};}function respondWithResult(_0x410914,_0x1c7c58){_0x1c7c58=_0x1c7c58||0xc8;return function(_0x3a0952){if(_0x3a0952){return _0x410914[_0x793e('0x17')](_0x1c7c58)[_0x793e('0x19')](_0x3a0952);}};}function respondWithFilteredResult(_0x1121e5,_0x36686c){return function(_0x418b5f){if(_0x418b5f){var _0x18990a=typeof _0x36686c[_0x793e('0x1a')]===_0x793e('0x1b')&&typeof _0x36686c[_0x793e('0x1c')]===_0x793e('0x1b');var _0xeacea6=_0x418b5f['count'];var _0x3b38ef=_0x18990a?0x0:_0x36686c[_0x793e('0x1a')];var _0x4ba056=_0x18990a?_0x418b5f['count']:_0x36686c['offset']+_0x36686c[_0x793e('0x1c')];var _0x2f0494;if(_0x4ba056>=_0xeacea6){_0x4ba056=_0xeacea6;_0x2f0494=0xc8;}else{_0x2f0494=0xce;}_0x1121e5[_0x793e('0x17')](_0x2f0494);return _0x1121e5[_0x793e('0x1d')](_0x793e('0x1e'),_0x3b38ef+'-'+_0x4ba056+'/'+_0xeacea6)[_0x793e('0x19')](_0x418b5f);}return null;};}function patchUpdates(_0x1af167){return function(_0x9413f9){try{jsonpatch[_0x793e('0x1f')](_0x9413f9,_0x1af167,!![]);}catch(_0x31413a){return BPromise[_0x793e('0x20')](_0x31413a);}return _0x9413f9[_0x793e('0x21')]();};}function saveUpdates(_0x1596bf,_0xed37e){return function(_0x33fe28){if(_0x33fe28){return _0x33fe28[_0x793e('0x22')](_0x1596bf)[_0x793e('0x23')](function(_0x4be20c){return _0x4be20c;});}return null;};}function removeEntity(_0x59a4ff,_0xc259c8){return function(_0x36840f){if(_0x36840f){return _0x36840f['destroy']()[_0x793e('0x23')](function(){_0x59a4ff['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x55b37a,_0x59b191){return function(_0x5203aa){if(!_0x5203aa){_0x55b37a[_0x793e('0x16')](0x194);}return _0x5203aa;};}function handleError(_0x74048a,_0x4c7816){_0x4c7816=_0x4c7816||0x1f4;return function(_0x361a87){logger[_0x793e('0x24')](_0x361a87[_0x793e('0x25')]);if(_0x361a87[_0x793e('0x26')]){delete _0x361a87[_0x793e('0x26')];}_0x74048a[_0x793e('0x17')](_0x4c7816)[_0x793e('0x27')](_0x361a87);};}exports[_0x793e('0x28')]=function(_0x597c7d,_0xfe7fb9){var _0x48edff={},_0x4a45ae={},_0x530316={'count':0x0,'rows':[]};var _0xeb38af=_['map'](db[_0x793e('0x29')]['rawAttributes'],function(_0x2bebef){return{'name':_0x2bebef[_0x793e('0x2a')],'type':_0x2bebef['type']['key']};});_0x4a45ae[_0x793e('0x2b')]=_['map'](_0xeb38af,_0x793e('0x26'));_0x4a45ae[_0x793e('0x2c')]=_[_0x793e('0x2d')](_0x597c7d['query']);_0x4a45ae[_0x793e('0x2e')]=_[_0x793e('0x2f')](_0x4a45ae[_0x793e('0x2b')],_0x4a45ae[_0x793e('0x2c')]);_0x48edff[_0x793e('0x30')]=_['intersection'](_0x4a45ae[_0x793e('0x2b')],qs[_0x793e('0x31')](_0x597c7d[_0x793e('0x2c')][_0x793e('0x31')]));_0x48edff['attributes']=_0x48edff[_0x793e('0x30')][_0x793e('0x32')]?_0x48edff[_0x793e('0x30')]:_0x4a45ae[_0x793e('0x2b')];if(!_0x597c7d[_0x793e('0x2c')]['hasOwnProperty'](_0x793e('0x33'))){_0x48edff[_0x793e('0x1c')]=qs[_0x793e('0x1c')](_0x597c7d[_0x793e('0x2c')][_0x793e('0x1c')]);_0x48edff[_0x793e('0x1a')]=qs[_0x793e('0x1a')](_0x597c7d[_0x793e('0x2c')]['offset']);}_0x48edff[_0x793e('0x34')]=qs[_0x793e('0x35')](_0x597c7d[_0x793e('0x2c')][_0x793e('0x35')]);_0x48edff[_0x793e('0x36')]=qs[_0x793e('0x2e')](_['pick'](_0x597c7d[_0x793e('0x2c')],_0x4a45ae[_0x793e('0x2e')]),_0xeb38af);if(_0x597c7d[_0x793e('0x2c')][_0x793e('0x37')]){_0x48edff[_0x793e('0x36')]=_[_0x793e('0x38')](_0x48edff[_0x793e('0x36')],{'$or':_[_0x793e('0x39')](_0xeb38af,function(_0x57fdec){if(_0x57fdec[_0x793e('0x3a')]!==_0x793e('0x3b')){var _0x397af4={};_0x397af4[_0x57fdec[_0x793e('0x26')]]={'$like':'%'+_0x597c7d[_0x793e('0x2c')][_0x793e('0x37')]+'%'};return _0x397af4;}})});}_0x48edff=_['merge']({},_0x48edff,_0x597c7d['options']);var _0x2d4037={'where':_0x48edff[_0x793e('0x36')]};return db[_0x793e('0x29')][_0x793e('0x3c')](_0x2d4037)[_0x793e('0x23')](function(_0x28343b){_0x530316[_0x793e('0x3c')]=_0x28343b;if(_0x597c7d[_0x793e('0x2c')][_0x793e('0x3d')]){_0x48edff[_0x793e('0x3e')]=[{'all':!![]}];}return db[_0x793e('0x29')][_0x793e('0x3f')](_0x48edff);})[_0x793e('0x23')](function(_0x1f3059){_0x530316[_0x793e('0x40')]=_0x1f3059;return _0x530316;})[_0x793e('0x23')](respondWithFilteredResult(_0xfe7fb9,_0x48edff))[_0x793e('0x41')](handleError(_0xfe7fb9,null));};exports[_0x793e('0x42')]=function(_0x1bec3d,_0xd0a349){var _0x10f99e={'raw':!![],'where':{'id':_0x1bec3d[_0x793e('0x43')]['id']}},_0x42883d={};_0x42883d[_0x793e('0x2b')]=_['keys'](db[_0x793e('0x29')]['rawAttributes']);_0x42883d['query']=_[_0x793e('0x2d')](_0x1bec3d[_0x793e('0x2c')]);_0x42883d[_0x793e('0x2e')]=_[_0x793e('0x2f')](_0x42883d[_0x793e('0x2b')],_0x42883d[_0x793e('0x2c')]);_0x10f99e[_0x793e('0x30')]=_[_0x793e('0x2f')](_0x42883d[_0x793e('0x2b')],qs['fields'](_0x1bec3d['query'][_0x793e('0x31')]));_0x10f99e[_0x793e('0x30')]=_0x10f99e[_0x793e('0x30')][_0x793e('0x32')]?_0x10f99e['attributes']:_0x42883d[_0x793e('0x2b')];if(_0x1bec3d[_0x793e('0x2c')][_0x793e('0x3d')]){_0x10f99e[_0x793e('0x3e')]=[{'all':!![]}];}_0x10f99e=_['merge']({},_0x10f99e,_0x1bec3d[_0x793e('0x44')]);return db[_0x793e('0x29')][_0x793e('0x45')](_0x10f99e)[_0x793e('0x23')](handleEntityNotFound(_0xd0a349,null))[_0x793e('0x23')](respondWithResult(_0xd0a349,null))['catch'](handleError(_0xd0a349,null));};exports['create']=function(_0x5cb3a8,_0x494921){return db[_0x793e('0x29')][_0x793e('0x46')](_0x5cb3a8[_0x793e('0x47')],{})[_0x793e('0x23')](respondWithResult(_0x494921,0xc9))['catch'](handleError(_0x494921,null));};exports[_0x793e('0x22')]=function(_0x794076,_0x112645){if(_0x794076['body']['id']){delete _0x794076[_0x793e('0x47')]['id'];}return db['ZendeskField']['find']({'where':{'id':_0x794076[_0x793e('0x43')]['id']}})[_0x793e('0x23')](handleEntityNotFound(_0x112645,null))[_0x793e('0x23')](saveUpdates(_0x794076[_0x793e('0x47')],null))['then'](respondWithResult(_0x112645,null))[_0x793e('0x41')](handleError(_0x112645,null));};exports[_0x793e('0x48')]=function(_0x1e1b94,_0x363bf0){return db['ZendeskField']['find']({'where':{'id':_0x1e1b94['params']['id']}})[_0x793e('0x23')](handleEntityNotFound(_0x363bf0,null))[_0x793e('0x23')](removeEntity(_0x363bf0,null))[_0x793e('0x41')](handleError(_0x363bf0,null));}; \ No newline at end of file +var _0xeb81=['sendStatus','status','end','json','offset','undefined','limit','count','apply','reject','update','then','destroy','error','name','send','index','map','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','fields','attributes','hasOwnProperty','nolimit','order','sort','where','pick','merge','VIRTUAL','filter','options','ZendeskField','includeAll','include','findAll','catch','length','find','create','body','params','eml-format','zip-dir','request-promise','moment','mustache','util','sox','to-csv','crypto','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/license/util','../../mysqldb'];(function(_0x32e89d,_0x2bef2a){var _0x21ba25=function(_0x453d69){while(--_0x453d69){_0x32e89d['push'](_0x32e89d['shift']());}};_0x21ba25(++_0x2bef2a);}(_0xeb81,0x100));var _0x1eb8=function(_0x8d3b4b,_0xd1db47){_0x8d3b4b=_0x8d3b4b-0x0;var _0x509753=_0xeb81[_0x8d3b4b];return _0x509753;};'use strict';var emlformat=require(_0x1eb8('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x1eb8('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0x1eb8('0x2'));var moment=require(_0x1eb8('0x3'));var BPromise=require('bluebird');var Mustache=require(_0x1eb8('0x4'));var util=require(_0x1eb8('0x5'));var path=require('path');var sox=require(_0x1eb8('0x6'));var csv=require(_0x1eb8('0x7'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require('squel');var crypto=require(_0x1eb8('0x8'));var jsforce=require(_0x1eb8('0x9'));var deskjs=require(_0x1eb8('0xa'));var toCsv=require(_0x1eb8('0x7'));var querystring=require('querystring');var Papa=require(_0x1eb8('0xb'));var Redis=require(_0x1eb8('0xc'));var authService=require(_0x1eb8('0xd'));var qs=require(_0x1eb8('0xe'));var as=require(_0x1eb8('0xf'));var hardwareService=require(_0x1eb8('0x10'));var logger=require(_0x1eb8('0x11'))('api');var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0x1eb8('0x12'));var db=require(_0x1eb8('0x13'))['db'];function respondWithStatusCode(_0x1e8abd,_0xa65365){_0xa65365=_0xa65365||0xcc;return function(_0x5b5d8d){if(_0x5b5d8d){return _0x1e8abd[_0x1eb8('0x14')](_0xa65365);}return _0x1e8abd[_0x1eb8('0x15')](_0xa65365)[_0x1eb8('0x16')]();};}function respondWithResult(_0x52bd2b,_0x5324c6){_0x5324c6=_0x5324c6||0xc8;return function(_0x2c707f){if(_0x2c707f){return _0x52bd2b[_0x1eb8('0x15')](_0x5324c6)[_0x1eb8('0x17')](_0x2c707f);}};}function respondWithFilteredResult(_0x9db045,_0x486cfd){return function(_0x1f200b){if(_0x1f200b){var _0x479f56=typeof _0x486cfd[_0x1eb8('0x18')]===_0x1eb8('0x19')&&typeof _0x486cfd[_0x1eb8('0x1a')]==='undefined';var _0x15a840=_0x1f200b['count'];var _0x25207c=_0x479f56?0x0:_0x486cfd['offset'];var _0xbb4f89=_0x479f56?_0x1f200b[_0x1eb8('0x1b')]:_0x486cfd[_0x1eb8('0x18')]+_0x486cfd[_0x1eb8('0x1a')];var _0x3d584f;if(_0xbb4f89>=_0x15a840){_0xbb4f89=_0x15a840;_0x3d584f=0xc8;}else{_0x3d584f=0xce;}_0x9db045[_0x1eb8('0x15')](_0x3d584f);return _0x9db045['set']('Content-Range',_0x25207c+'-'+_0xbb4f89+'/'+_0x15a840)[_0x1eb8('0x17')](_0x1f200b);}return null;};}function patchUpdates(_0x47256f){return function(_0x1b8bf8){try{jsonpatch[_0x1eb8('0x1c')](_0x1b8bf8,_0x47256f,!![]);}catch(_0x2754ce){return BPromise[_0x1eb8('0x1d')](_0x2754ce);}return _0x1b8bf8['save']();};}function saveUpdates(_0x4f4f45,_0x3bd347){return function(_0x5c999f){if(_0x5c999f){return _0x5c999f[_0x1eb8('0x1e')](_0x4f4f45)[_0x1eb8('0x1f')](function(_0x2d83f3){return _0x2d83f3;});}return null;};}function removeEntity(_0x356986,_0x15c900){return function(_0x250981){if(_0x250981){return _0x250981[_0x1eb8('0x20')]()[_0x1eb8('0x1f')](function(){_0x356986[_0x1eb8('0x15')](0xcc)['end']();});}};}function handleEntityNotFound(_0x42308b,_0x5819ab){return function(_0x3a1d70){if(!_0x3a1d70){_0x42308b['sendStatus'](0x194);}return _0x3a1d70;};}function handleError(_0x51547d,_0x139e36){_0x139e36=_0x139e36||0x1f4;return function(_0x1e5f2f){logger[_0x1eb8('0x21')](_0x1e5f2f['stack']);if(_0x1e5f2f[_0x1eb8('0x22')]){delete _0x1e5f2f['name'];}_0x51547d[_0x1eb8('0x15')](_0x139e36)[_0x1eb8('0x23')](_0x1e5f2f);};}exports[_0x1eb8('0x24')]=function(_0x3a317c,_0x1312a4){var _0x5d3f85={},_0x47fcdf={},_0x51c5b0={'count':0x0,'rows':[]};var _0x122797=_[_0x1eb8('0x25')](db['ZendeskField'][_0x1eb8('0x26')],function(_0x302603){return{'name':_0x302603[_0x1eb8('0x27')],'type':_0x302603[_0x1eb8('0x28')][_0x1eb8('0x29')]};});_0x47fcdf[_0x1eb8('0x2a')]=_[_0x1eb8('0x25')](_0x122797,'name');_0x47fcdf[_0x1eb8('0x2b')]=_[_0x1eb8('0x2c')](_0x3a317c[_0x1eb8('0x2b')]);_0x47fcdf[_0x1eb8('0x2d')]=_['intersection'](_0x47fcdf['model'],_0x47fcdf[_0x1eb8('0x2b')]);_0x5d3f85['attributes']=_[_0x1eb8('0x2e')](_0x47fcdf[_0x1eb8('0x2a')],qs['fields'](_0x3a317c['query'][_0x1eb8('0x2f')]));_0x5d3f85[_0x1eb8('0x30')]=_0x5d3f85[_0x1eb8('0x30')]['length']?_0x5d3f85[_0x1eb8('0x30')]:_0x47fcdf[_0x1eb8('0x2a')];if(!_0x3a317c['query'][_0x1eb8('0x31')](_0x1eb8('0x32'))){_0x5d3f85[_0x1eb8('0x1a')]=qs[_0x1eb8('0x1a')](_0x3a317c[_0x1eb8('0x2b')][_0x1eb8('0x1a')]);_0x5d3f85['offset']=qs['offset'](_0x3a317c[_0x1eb8('0x2b')][_0x1eb8('0x18')]);}_0x5d3f85[_0x1eb8('0x33')]=qs[_0x1eb8('0x34')](_0x3a317c[_0x1eb8('0x2b')][_0x1eb8('0x34')]);_0x5d3f85[_0x1eb8('0x35')]=qs['filters'](_[_0x1eb8('0x36')](_0x3a317c['query'],_0x47fcdf[_0x1eb8('0x2d')]),_0x122797);if(_0x3a317c[_0x1eb8('0x2b')]['filter']){_0x5d3f85[_0x1eb8('0x35')]=_[_0x1eb8('0x37')](_0x5d3f85['where'],{'$or':_[_0x1eb8('0x25')](_0x122797,function(_0x5be35d){if(_0x5be35d[_0x1eb8('0x28')]!==_0x1eb8('0x38')){var _0x5c046e={};_0x5c046e[_0x5be35d['name']]={'$like':'%'+_0x3a317c[_0x1eb8('0x2b')][_0x1eb8('0x39')]+'%'};return _0x5c046e;}})});}_0x5d3f85=_[_0x1eb8('0x37')]({},_0x5d3f85,_0x3a317c[_0x1eb8('0x3a')]);var _0x2fed5b={'where':_0x5d3f85['where']};return db[_0x1eb8('0x3b')][_0x1eb8('0x1b')](_0x2fed5b)[_0x1eb8('0x1f')](function(_0x401dc0){_0x51c5b0[_0x1eb8('0x1b')]=_0x401dc0;if(_0x3a317c[_0x1eb8('0x2b')][_0x1eb8('0x3c')]){_0x5d3f85[_0x1eb8('0x3d')]=[{'all':!![]}];}return db[_0x1eb8('0x3b')][_0x1eb8('0x3e')](_0x5d3f85);})[_0x1eb8('0x1f')](function(_0x5560ca){_0x51c5b0['rows']=_0x5560ca;return _0x51c5b0;})[_0x1eb8('0x1f')](respondWithFilteredResult(_0x1312a4,_0x5d3f85))[_0x1eb8('0x3f')](handleError(_0x1312a4,null));};exports['show']=function(_0x59d11c,_0x23f0c3){var _0x4b7c5f={'raw':!![],'where':{'id':_0x59d11c['params']['id']}},_0x48386f={};_0x48386f[_0x1eb8('0x2a')]=_[_0x1eb8('0x2c')](db[_0x1eb8('0x3b')][_0x1eb8('0x26')]);_0x48386f[_0x1eb8('0x2b')]=_[_0x1eb8('0x2c')](_0x59d11c[_0x1eb8('0x2b')]);_0x48386f[_0x1eb8('0x2d')]=_[_0x1eb8('0x2e')](_0x48386f[_0x1eb8('0x2a')],_0x48386f[_0x1eb8('0x2b')]);_0x4b7c5f[_0x1eb8('0x30')]=_[_0x1eb8('0x2e')](_0x48386f['model'],qs[_0x1eb8('0x2f')](_0x59d11c[_0x1eb8('0x2b')][_0x1eb8('0x2f')]));_0x4b7c5f[_0x1eb8('0x30')]=_0x4b7c5f['attributes'][_0x1eb8('0x40')]?_0x4b7c5f[_0x1eb8('0x30')]:_0x48386f[_0x1eb8('0x2a')];if(_0x59d11c[_0x1eb8('0x2b')][_0x1eb8('0x3c')]){_0x4b7c5f[_0x1eb8('0x3d')]=[{'all':!![]}];}_0x4b7c5f=_[_0x1eb8('0x37')]({},_0x4b7c5f,_0x59d11c['options']);return db[_0x1eb8('0x3b')][_0x1eb8('0x41')](_0x4b7c5f)[_0x1eb8('0x1f')](handleEntityNotFound(_0x23f0c3,null))['then'](respondWithResult(_0x23f0c3,null))[_0x1eb8('0x3f')](handleError(_0x23f0c3,null));};exports['create']=function(_0x154f01,_0x324ec8){return db[_0x1eb8('0x3b')][_0x1eb8('0x42')](_0x154f01[_0x1eb8('0x43')],{})[_0x1eb8('0x1f')](respondWithResult(_0x324ec8,0xc9))['catch'](handleError(_0x324ec8,null));};exports[_0x1eb8('0x1e')]=function(_0x3804b6,_0x27a7b0){if(_0x3804b6['body']['id']){delete _0x3804b6['body']['id'];}return db['ZendeskField'][_0x1eb8('0x41')]({'where':{'id':_0x3804b6[_0x1eb8('0x44')]['id']}})[_0x1eb8('0x1f')](handleEntityNotFound(_0x27a7b0,null))[_0x1eb8('0x1f')](saveUpdates(_0x3804b6['body'],null))[_0x1eb8('0x1f')](respondWithResult(_0x27a7b0,null))[_0x1eb8('0x3f')](handleError(_0x27a7b0,null));};exports[_0x1eb8('0x20')]=function(_0x1b5a97,_0x54626b){return db[_0x1eb8('0x3b')]['find']({'where':{'id':_0x1b5a97[_0x1eb8('0x44')]['id']}})[_0x1eb8('0x1f')](handleEntityNotFound(_0x54626b,null))[_0x1eb8('0x1f')](removeEntity(_0x54626b,null))['catch'](handleError(_0x54626b,null));}; \ No newline at end of file diff --git a/server/api/intZendeskField/intZendeskField.model.js b/server/api/intZendeskField/intZendeskField.model.js index 56744f2..ea8ca46 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 _0xe06a=['moment','bluebird','request-promise','path','rimraf','../../config/environment','./intZendeskField.attributes','exports','define','ZendeskField','int_zendesk_fields','zendesk_unique_index','FieldId','lodash','util','../../config/logger'];(function(_0x9aada2,_0xd2d349){var _0x196dff=function(_0x5ad061){while(--_0x5ad061){_0x9aada2['push'](_0x9aada2['shift']());}};_0x196dff(++_0xd2d349);}(_0xe06a,0x19d));var _0xae06=function(_0x3ee8e7,_0xbd037a){_0x3ee8e7=_0x3ee8e7-0x0;var _0x44d046=_0xe06a[_0x3ee8e7];return _0x44d046;};'use strict';var _=require(_0xae06('0x0'));var util=require(_0xae06('0x1'));var logger=require(_0xae06('0x2'))('api');var moment=require(_0xae06('0x3'));var BPromise=require(_0xae06('0x4'));var rp=require(_0xae06('0x5'));var fs=require('fs');var path=require(_0xae06('0x6'));var rimraf=require(_0xae06('0x7'));var config=require(_0xae06('0x8'));var attributes=require(_0xae06('0x9'));module[_0xae06('0xa')]=function(_0x3c3ea9,_0x195b74){return _0x3c3ea9[_0xae06('0xb')](_0xae06('0xc'),attributes,{'tableName':_0xae06('0xd'),'paranoid':![],'indexes':[{'name':_0xae06('0xe'),'fields':['idField',_0xae06('0xf')],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file +var _0x0990=['request-promise','path','../../config/environment','./intZendeskField.attributes','exports','define','ZendeskField','int_zendesk_fields','zendesk_unique_index','idField','FieldId','lodash','util','../../config/logger','api','moment','bluebird'];(function(_0x287a47,_0x2f731c){var _0x3fb726=function(_0xbedc33){while(--_0xbedc33){_0x287a47['push'](_0x287a47['shift']());}};_0x3fb726(++_0x2f731c);}(_0x0990,0x1c5));var _0x0099=function(_0x1bbc08,_0x444008){_0x1bbc08=_0x1bbc08-0x0;var _0x5d825b=_0x0990[_0x1bbc08];return _0x5d825b;};'use strict';var _=require(_0x0099('0x0'));var util=require(_0x0099('0x1'));var logger=require(_0x0099('0x2'))(_0x0099('0x3'));var moment=require(_0x0099('0x4'));var BPromise=require(_0x0099('0x5'));var rp=require(_0x0099('0x6'));var fs=require('fs');var path=require(_0x0099('0x7'));var rimraf=require('rimraf');var config=require(_0x0099('0x8'));var attributes=require(_0x0099('0x9'));module[_0x0099('0xa')]=function(_0x5be258,_0x1d1369){return _0x5be258[_0x0099('0xb')](_0x0099('0xc'),attributes,{'tableName':_0x0099('0xd'),'paranoid':![],'indexes':[{'name':_0x0099('0xe'),'fields':[_0x0099('0xf'),_0x0099('0x10')],'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 7ecd758..81fe482 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 _0x0872=['stringify','error','code','message','info','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','request','ZendeskField,\x20%s,\x20%s','request\x20sent','ZendeskField,\x20%s,\x20%s,\x20%s'];(function(_0x562faa,_0x23adc7){var _0xc70f59=function(_0x2d7dec){while(--_0x2d7dec){_0x562faa['push'](_0x562faa['shift']());}};_0xc70f59(++_0x23adc7);}(_0x0872,0x195));var _0x2087=function(_0x3b0ff8,_0x18f70a){_0x3b0ff8=_0x3b0ff8-0x0;var _0x310f4b=_0x0872[_0x3b0ff8];return _0x310f4b;};'use strict';var _=require(_0x2087('0x0'));var util=require(_0x2087('0x1'));var moment=require('moment');var BPromise=require(_0x2087('0x2'));var rs=require(_0x2087('0x3'));var fs=require('fs');var Redis=require(_0x2087('0x4'));var db=require(_0x2087('0x5'))['db'];var utils=require(_0x2087('0x6'));var logger=require(_0x2087('0x7'))(_0x2087('0x8'));var config=require(_0x2087('0x9'));var jayson=require('jayson/promise');var client=jayson[_0x2087('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x3cf196,_0x604961,_0x2ddedb){return new BPromise(function(_0x26d446,_0x5d6738){return client[_0x2087('0xb')](_0x3cf196,_0x2ddedb)['then'](function(_0x956daa){logger['info'](_0x2087('0xc'),_0x604961,_0x2087('0xd'));logger['debug'](_0x2087('0xe'),_0x604961,_0x2087('0xd'),JSON[_0x2087('0xf')](_0x956daa));if(_0x956daa['error']){if(_0x956daa[_0x2087('0x10')][_0x2087('0x11')]===0x1f4){logger[_0x2087('0x10')](_0x2087('0xc'),_0x604961,_0x956daa[_0x2087('0x10')][_0x2087('0x12')]);return _0x5d6738(_0x956daa[_0x2087('0x10')]['message']);}logger[_0x2087('0x10')]('ZendeskField,\x20%s,\x20%s',_0x604961,_0x956daa[_0x2087('0x10')]['message']);return _0x26d446(_0x956daa['error'][_0x2087('0x12')]);}else{logger[_0x2087('0x13')](_0x2087('0xc'),_0x604961,_0x2087('0xd'));_0x26d446(_0x956daa['result'][_0x2087('0x12')]);}})['catch'](function(_0x567b6b){logger[_0x2087('0x10')](_0x2087('0xc'),_0x604961,_0x567b6b);_0x5d6738(_0x567b6b);});});} \ No newline at end of file +var _0x2f03=['http','then','info','request\x20sent','debug','ZendeskField,\x20%s,\x20%s,\x20%s','error','code','ZendeskField,\x20%s,\x20%s','message','result','catch','lodash','util','moment','bluebird','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise'];(function(_0x493301,_0x4a05bd){var _0x51226d=function(_0x690aad){while(--_0x690aad){_0x493301['push'](_0x493301['shift']());}};_0x51226d(++_0x4a05bd);}(_0x2f03,0x11d));var _0x32f0=function(_0x31014c,_0x47f17b){_0x31014c=_0x31014c-0x0;var _0x1cd9f1=_0x2f03[_0x31014c];return _0x1cd9f1;};'use strict';var _=require(_0x32f0('0x0'));var util=require(_0x32f0('0x1'));var moment=require(_0x32f0('0x2'));var BPromise=require(_0x32f0('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x32f0('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0x32f0('0x5'))(_0x32f0('0x6'));var config=require(_0x32f0('0x7'));var jayson=require(_0x32f0('0x8'));var client=jayson['client'][_0x32f0('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x1e6ce4,_0x2accaf,_0x1d1620){return new BPromise(function(_0x31599e,_0x9901d9){return client['request'](_0x1e6ce4,_0x1d1620)[_0x32f0('0xa')](function(_0x1ea5a8){logger[_0x32f0('0xb')]('ZendeskField,\x20%s,\x20%s',_0x2accaf,_0x32f0('0xc'));logger[_0x32f0('0xd')](_0x32f0('0xe'),_0x2accaf,_0x32f0('0xc'),JSON['stringify'](_0x1ea5a8));if(_0x1ea5a8[_0x32f0('0xf')]){if(_0x1ea5a8[_0x32f0('0xf')][_0x32f0('0x10')]===0x1f4){logger['error'](_0x32f0('0x11'),_0x2accaf,_0x1ea5a8['error'][_0x32f0('0x12')]);return _0x9901d9(_0x1ea5a8[_0x32f0('0xf')][_0x32f0('0x12')]);}logger[_0x32f0('0xf')](_0x32f0('0x11'),_0x2accaf,_0x1ea5a8[_0x32f0('0xf')]['message']);return _0x31599e(_0x1ea5a8[_0x32f0('0xf')][_0x32f0('0x12')]);}else{logger[_0x32f0('0xb')](_0x32f0('0x11'),_0x2accaf,_0x32f0('0xc'));_0x31599e(_0x1ea5a8[_0x32f0('0x13')][_0x32f0('0x12')]);}})[_0x32f0('0x14')](function(_0x30c100){logger['error'](_0x32f0('0x11'),_0x2accaf,_0x30c100);_0x9901d9(_0x30c100);});});} \ No newline at end of file diff --git a/server/api/intZohoAccount/index.js b/server/api/intZohoAccount/index.js index 87b9abf..1c9188e 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 _0x5f58=['/:id','update','delete','destroy','multer','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../config/environment','./intZohoAccount.controller','get','isAuthenticated','index','show','getConfigurations','getFields','post','create','/:id/configurations'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x5f58,0x1a6));var _0x85f5=function(_0x354ab1,_0xec5b21){_0x354ab1=_0x354ab1-0x0;var _0x9918a1=_0x5f58[_0x354ab1];return _0x9918a1;};'use strict';var multer=require(_0x85f5('0x0'));var util=require('util');var path=require(_0x85f5('0x1'));var timeout=require(_0x85f5('0x2'));var express=require(_0x85f5('0x3'));var router=express[_0x85f5('0x4')]();var fs_extra=require(_0x85f5('0x5'));var auth=require(_0x85f5('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0x85f5('0x7'));var controller=require(_0x85f5('0x8'));router[_0x85f5('0x9')]('/',auth[_0x85f5('0xa')](),controller[_0x85f5('0xb')]);router['get']('/:id',auth[_0x85f5('0xa')](),controller[_0x85f5('0xc')]);router[_0x85f5('0x9')]('/:id/configurations',auth[_0x85f5('0xa')](),controller[_0x85f5('0xd')]);router[_0x85f5('0x9')]('/:id/fields',auth[_0x85f5('0xa')](),controller[_0x85f5('0xe')]);router[_0x85f5('0xf')]('/',auth[_0x85f5('0xa')](),controller[_0x85f5('0x10')]);router[_0x85f5('0xf')](_0x85f5('0x11'),auth['isAuthenticated'](),controller['addConfiguration']);router['put'](_0x85f5('0x12'),auth[_0x85f5('0xa')](),controller[_0x85f5('0x13')]);router[_0x85f5('0x14')]('/:id',auth['isAuthenticated'](),controller[_0x85f5('0x15')]);module['exports']=router; \ No newline at end of file +var _0x6c05=['exports','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../config/environment','get','isAuthenticated','index','/:id','show','/:id/configurations','/:id/fields','create','post','addConfiguration','put','update','destroy'];(function(_0x53f3f5,_0x49e2c9){var _0x589260=function(_0x5e8dee){while(--_0x5e8dee){_0x53f3f5['push'](_0x53f3f5['shift']());}};_0x589260(++_0x49e2c9);}(_0x6c05,0x1e5));var _0x56c0=function(_0x203ae5,_0x24ae52){_0x203ae5=_0x203ae5-0x0;var _0x466dbf=_0x6c05[_0x203ae5];return _0x466dbf;};'use strict';var multer=require('multer');var util=require(_0x56c0('0x0'));var path=require(_0x56c0('0x1'));var timeout=require(_0x56c0('0x2'));var express=require(_0x56c0('0x3'));var router=express[_0x56c0('0x4')]();var fs_extra=require(_0x56c0('0x5'));var auth=require(_0x56c0('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0x56c0('0x7'));var controller=require('./intZohoAccount.controller');router[_0x56c0('0x8')]('/',auth[_0x56c0('0x9')](),controller[_0x56c0('0xa')]);router[_0x56c0('0x8')](_0x56c0('0xb'),auth[_0x56c0('0x9')](),controller[_0x56c0('0xc')]);router[_0x56c0('0x8')](_0x56c0('0xd'),auth[_0x56c0('0x9')](),controller['getConfigurations']);router[_0x56c0('0x8')](_0x56c0('0xe'),auth[_0x56c0('0x9')](),controller['getFields']);router['post']('/',auth[_0x56c0('0x9')](),controller[_0x56c0('0xf')]);router[_0x56c0('0x10')](_0x56c0('0xd'),auth[_0x56c0('0x9')](),controller[_0x56c0('0x11')]);router[_0x56c0('0x12')]('/:id',auth['isAuthenticated'](),controller[_0x56c0('0x13')]);router['delete'](_0x56c0('0xb'),auth['isAuthenticated'](),controller[_0x56c0('0x14')]);module[_0x56c0('0x15')]=router; \ No newline at end of file diff --git a/server/api/intZohoAccount/intZohoAccount.attributes.js b/server/api/intZohoAccount/intZohoAccount.attributes.js index 8ffdaa4..43d49b8 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 _0x99e9=['exports','STRING'];(function(_0x383a93,_0x5baf82){var _0x2c00ee=function(_0x7a6aa5){while(--_0x7a6aa5){_0x383a93['push'](_0x383a93['shift']());}};_0x2c00ee(++_0x5baf82);}(_0x99e9,0xb4));var _0x999e=function(_0x16b992,_0x43d74c){_0x16b992=_0x16b992-0x0;var _0x385c78=_0x99e9[_0x16b992];return _0x385c78;};'use strict';var Sequelize=require('sequelize');module[_0x999e('0x0')]={'name':{'type':Sequelize[_0x999e('0x1')]},'description':{'type':Sequelize[_0x999e('0x1')]},'host':{'type':Sequelize[_0x999e('0x1')]},'zone':{'type':Sequelize['STRING']},'clientId':{'type':Sequelize[_0x999e('0x1')]},'clientSecret':{'type':Sequelize[_0x999e('0x1')]},'serverUrl':{'type':Sequelize[_0x999e('0x1')],'allowNull':![]},'code':{'type':Sequelize['STRING']},'refreshToken':{'type':Sequelize[_0x999e('0x1')]}}; \ No newline at end of file +var _0x70e0=['STRING','sequelize','exports'];(function(_0x41ea1e,_0x151764){var _0x5eed1e=function(_0x4e6666){while(--_0x4e6666){_0x41ea1e['push'](_0x41ea1e['shift']());}};_0x5eed1e(++_0x151764);}(_0x70e0,0x17b));var _0x070e=function(_0x48dc92,_0x53fd39){_0x48dc92=_0x48dc92-0x0;var _0x5f582f=_0x70e0[_0x48dc92];return _0x5f582f;};'use strict';var Sequelize=require(_0x070e('0x0'));module[_0x070e('0x1')]={'name':{'type':Sequelize[_0x070e('0x2')]},'description':{'type':Sequelize['STRING']},'host':{'type':Sequelize['STRING']},'zone':{'type':Sequelize[_0x070e('0x2')]},'clientId':{'type':Sequelize[_0x070e('0x2')]},'clientSecret':{'type':Sequelize[_0x070e('0x2')]},'serverUrl':{'type':Sequelize[_0x070e('0x2')],'allowNull':![]},'code':{'type':Sequelize['STRING']},'refreshToken':{'type':Sequelize[_0x070e('0x2')]}}; \ No newline at end of file diff --git a/server/api/intZohoAccount/intZohoAccount.controller.js b/server/api/intZohoAccount/intZohoAccount.controller.js index 1b287ef..2e13ee9 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 _0xd31a=['limit','count','Content-Range','json','apply','reject','save','then','destroy','end','error','stack','name','send','map','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','VIRTUAL','filter','options','includeAll','include','ZohoAccount','rows','catch','show','params','find','create','body','update','getConfigurations','findOne','ZohoConfiguration','merge','addConfiguration','AccountId','getSubjects','Descriptions','getDescriptions','channel','ZohoField','zone','https://accounts.zoho.com','https://accounts.zoho.com.au','https://accounts.zoho.com.cn','https://accounts.zoho.eu','POST','/oauth/v2/token','refreshToken','clientId','clientSecret','refresh_token','access_token','Unable\x20to\x20retrieve\x20the\x20access\x20token','host','serverUrl','code','zoho.eu','com','slice','substring','lastIndexOf','Refresh\x20Token\x20not\x20available\x20for\x20the\x20account','GET','format','Calls','Zoho-oauthtoken\x20','response','Owner','Subject','Description','WhoId','Call_Duration','Call_Result','Call_Start_Time','Call_Type','remove','includes','api_name','system_mandatory','display_label','custom_field','data_type','picklist','pick_list_values','test','statusCode','getFields,\x20%s,\x20%s,\x20%s','getFields','stringify','Wrong\x20credentials','eml-format','rimraf','zip-dir','request-promise','bluebird','util','sox','to-csv','fs-extra','lodash','squel','crypto','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/environment','../../config/license/util','sendStatus','status','offset','undefined'];(function(_0x16de68,_0x33d7ff){var _0x1c277e=function(_0x1d8549){while(--_0x1d8549){_0x16de68['push'](_0x16de68['shift']());}};_0x1c277e(++_0x33d7ff);}(_0xd31a,0x177));var _0xad31=function(_0x8130af,_0x5a0e78){_0x8130af=_0x8130af-0x0;var _0x20ac43=_0xd31a[_0x8130af];return _0x20ac43;};'use strict';var emlformat=require(_0xad31('0x0'));var rimraf=require(_0xad31('0x1'));var zipdir=require(_0xad31('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0xad31('0x3'));var moment=require('moment');var BPromise=require(_0xad31('0x4'));var Mustache=require('mustache');var util=require(_0xad31('0x5'));var path=require('path');var sox=require(_0xad31('0x6'));var csv=require(_0xad31('0x7'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xad31('0x8'));var _=require(_0xad31('0x9'));var squel=require(_0xad31('0xa'));var crypto=require(_0xad31('0xb'));var jsforce=require(_0xad31('0xc'));var deskjs=require('desk.js');var toCsv=require(_0xad31('0x7'));var querystring=require(_0xad31('0xd'));var Papa=require(_0xad31('0xe'));var Redis=require(_0xad31('0xf'));var authService=require(_0xad31('0x10'));var qs=require(_0xad31('0x11'));var as=require(_0xad31('0x12'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xad31('0x13'))(_0xad31('0x14'));var utils=require('../../config/utils');var config=require(_0xad31('0x15'));var licenseUtil=require(_0xad31('0x16'));var db=require('../../mysqldb')['db'];var integrations=require('../../components/integrations/configuration');function respondWithStatusCode(_0x44abea,_0x5c2640){_0x5c2640=_0x5c2640||0xcc;return function(_0x294473){if(_0x294473){return _0x44abea[_0xad31('0x17')](_0x5c2640);}return _0x44abea['status'](_0x5c2640)['end']();};}function respondWithResult(_0x3de9d8,_0x39bbfe){_0x39bbfe=_0x39bbfe||0xc8;return function(_0x302647){if(_0x302647){return _0x3de9d8[_0xad31('0x18')](_0x39bbfe)['json'](_0x302647);}};}function respondWithFilteredResult(_0x5305c0,_0x3a5950){return function(_0x10cb02){if(_0x10cb02){var _0x55b9ab=typeof _0x3a5950[_0xad31('0x19')]===_0xad31('0x1a')&&typeof _0x3a5950[_0xad31('0x1b')]==='undefined';var _0x46009d=_0x10cb02[_0xad31('0x1c')];var _0x4ffa3a=_0x55b9ab?0x0:_0x3a5950[_0xad31('0x19')];var _0xb2e58a=_0x55b9ab?_0x10cb02[_0xad31('0x1c')]:_0x3a5950[_0xad31('0x19')]+_0x3a5950[_0xad31('0x1b')];var _0x2591e9;if(_0xb2e58a>=_0x46009d){_0xb2e58a=_0x46009d;_0x2591e9=0xc8;}else{_0x2591e9=0xce;}_0x5305c0[_0xad31('0x18')](_0x2591e9);return _0x5305c0['set'](_0xad31('0x1d'),_0x4ffa3a+'-'+_0xb2e58a+'/'+_0x46009d)[_0xad31('0x1e')](_0x10cb02);}return null;};}function patchUpdates(_0x3beaf7){return function(_0x353f74){try{jsonpatch[_0xad31('0x1f')](_0x353f74,_0x3beaf7,!![]);}catch(_0x23cd08){return BPromise[_0xad31('0x20')](_0x23cd08);}return _0x353f74[_0xad31('0x21')]();};}function saveUpdates(_0x17efe5,_0x2f7431){return function(_0xe990e1){if(_0xe990e1){return _0xe990e1['update'](_0x17efe5)[_0xad31('0x22')](function(_0x5d2432){return _0x5d2432;});}return null;};}function removeEntity(_0x34b57c,_0x50a2ea){return function(_0x5cc707){if(_0x5cc707){return _0x5cc707[_0xad31('0x23')]()[_0xad31('0x22')](function(){_0x34b57c[_0xad31('0x18')](0xcc)[_0xad31('0x24')]();});}};}function handleEntityNotFound(_0x4df66e,_0x4f7cc6){return function(_0x3c7403){if(!_0x3c7403){_0x4df66e[_0xad31('0x17')](0x194);}return _0x3c7403;};}function handleError(_0x36a2e6,_0xf92114){_0xf92114=_0xf92114||0x1f4;return function(_0x3ced76){logger[_0xad31('0x25')](_0x3ced76[_0xad31('0x26')]);if(_0x3ced76[_0xad31('0x27')]){delete _0x3ced76[_0xad31('0x27')];}_0x36a2e6[_0xad31('0x18')](_0xf92114)[_0xad31('0x28')](_0x3ced76);};}exports['index']=function(_0x57c176,_0x425641){var _0xc314f6={},_0x1af63e={},_0x5ed865={'count':0x0,'rows':[]};var _0x24a25c=_[_0xad31('0x29')](db['ZohoAccount'][_0xad31('0x2a')],function(_0x1744fe){return{'name':_0x1744fe[_0xad31('0x2b')],'type':_0x1744fe[_0xad31('0x2c')][_0xad31('0x2d')]};});_0x1af63e[_0xad31('0x2e')]=_[_0xad31('0x29')](_0x24a25c,_0xad31('0x27'));_0x1af63e[_0xad31('0x2f')]=_[_0xad31('0x30')](_0x57c176['query']);_0x1af63e[_0xad31('0x31')]=_['intersection'](_0x1af63e[_0xad31('0x2e')],_0x1af63e[_0xad31('0x2f')]);_0xc314f6['attributes']=_[_0xad31('0x32')](_0x1af63e[_0xad31('0x2e')],qs[_0xad31('0x33')](_0x57c176[_0xad31('0x2f')][_0xad31('0x33')]));_0xc314f6[_0xad31('0x34')]=_0xc314f6[_0xad31('0x34')][_0xad31('0x35')]?_0xc314f6[_0xad31('0x34')]:_0x1af63e[_0xad31('0x2e')];if(!_0x57c176['query'][_0xad31('0x36')](_0xad31('0x37'))){_0xc314f6['limit']=qs['limit'](_0x57c176[_0xad31('0x2f')][_0xad31('0x1b')]);_0xc314f6[_0xad31('0x19')]=qs['offset'](_0x57c176[_0xad31('0x2f')]['offset']);}_0xc314f6[_0xad31('0x38')]=qs[_0xad31('0x39')](_0x57c176[_0xad31('0x2f')][_0xad31('0x39')]);_0xc314f6[_0xad31('0x3a')]=qs['filters'](_['pick'](_0x57c176['query'],_0x1af63e[_0xad31('0x31')]),_0x24a25c);if(_0x57c176[_0xad31('0x2f')]['filter']){_0xc314f6[_0xad31('0x3a')]=_['merge'](_0xc314f6[_0xad31('0x3a')],{'$or':_['map'](_0x24a25c,function(_0xbf378d){if(_0xbf378d['type']!==_0xad31('0x3b')){var _0x593012={};_0x593012[_0xbf378d[_0xad31('0x27')]]={'$like':'%'+_0x57c176['query'][_0xad31('0x3c')]+'%'};return _0x593012;}})});}_0xc314f6=_['merge']({},_0xc314f6,_0x57c176[_0xad31('0x3d')]);var _0x3f3f59={'where':_0xc314f6[_0xad31('0x3a')]};return db['ZohoAccount'][_0xad31('0x1c')](_0x3f3f59)[_0xad31('0x22')](function(_0x34eea0){_0x5ed865['count']=_0x34eea0;if(_0x57c176['query'][_0xad31('0x3e')]){_0xc314f6[_0xad31('0x3f')]=[{'all':!![]}];}return db[_0xad31('0x40')]['findAll'](_0xc314f6);})[_0xad31('0x22')](function(_0x284531){_0x5ed865[_0xad31('0x41')]=_0x284531;return _0x5ed865;})[_0xad31('0x22')](respondWithFilteredResult(_0x425641,_0xc314f6))[_0xad31('0x42')](handleError(_0x425641,null));};exports[_0xad31('0x43')]=function(_0x2ca2f3,_0x3b1d4f){var _0x477994={'raw':![],'where':{'id':_0x2ca2f3[_0xad31('0x44')]['id']}},_0x261295={};_0x261295['model']=_[_0xad31('0x30')](db[_0xad31('0x40')][_0xad31('0x2a')]);_0x261295[_0xad31('0x2f')]=_[_0xad31('0x30')](_0x2ca2f3[_0xad31('0x2f')]);_0x261295[_0xad31('0x31')]=_[_0xad31('0x32')](_0x261295['model'],_0x261295[_0xad31('0x2f')]);_0x477994[_0xad31('0x34')]=_[_0xad31('0x32')](_0x261295[_0xad31('0x2e')],qs['fields'](_0x2ca2f3[_0xad31('0x2f')]['fields']));_0x477994['attributes']=_0x477994[_0xad31('0x34')][_0xad31('0x35')]?_0x477994[_0xad31('0x34')]:_0x261295[_0xad31('0x2e')];if(_0x2ca2f3['query'][_0xad31('0x3e')]){_0x477994[_0xad31('0x3f')]=[{'all':!![]}];}_0x477994=_['merge']({},_0x477994,_0x2ca2f3[_0xad31('0x3d')]);return db[_0xad31('0x40')][_0xad31('0x45')](_0x477994)[_0xad31('0x22')](handleEntityNotFound(_0x3b1d4f,null))[_0xad31('0x22')](respondWithResult(_0x3b1d4f,null))['catch'](handleError(_0x3b1d4f,null));};exports[_0xad31('0x46')]=function(_0x276240,_0x56f308){return db[_0xad31('0x40')][_0xad31('0x46')](_0x276240[_0xad31('0x47')],{})['then'](respondWithResult(_0x56f308,0xc9))[_0xad31('0x42')](handleError(_0x56f308,null));};exports[_0xad31('0x48')]=function(_0x3ba798,_0x36987c){if(_0x3ba798[_0xad31('0x47')]['id']){delete _0x3ba798[_0xad31('0x47')]['id'];}return db[_0xad31('0x40')][_0xad31('0x45')]({'where':{'id':_0x3ba798[_0xad31('0x44')]['id']}})['then'](handleEntityNotFound(_0x36987c,null))[_0xad31('0x22')](saveUpdates(_0x3ba798['body'],null))['then'](respondWithResult(_0x36987c,null))['catch'](handleError(_0x36987c,null));};exports[_0xad31('0x23')]=function(_0x4c9f28,_0x13935b){return db[_0xad31('0x40')][_0xad31('0x45')]({'where':{'id':_0x4c9f28[_0xad31('0x44')]['id']}})[_0xad31('0x22')](handleEntityNotFound(_0x13935b,null))[_0xad31('0x22')](removeEntity(_0x13935b,null))[_0xad31('0x42')](handleError(_0x13935b,null));};exports[_0xad31('0x49')]=function(_0x5dce87,_0x2ab2ac,_0x1e77de){var _0x56109a={};var _0x471189={};var _0x3204df;var _0x3d2247;return db['ZohoAccount'][_0xad31('0x4a')]({'where':{'id':_0x5dce87[_0xad31('0x44')]['id']}})[_0xad31('0x22')](handleEntityNotFound(_0x2ab2ac,null))[_0xad31('0x22')](function(_0x1a381d){if(_0x1a381d){_0x3204df=_0x1a381d;_0x471189[_0xad31('0x2e')]=_[_0xad31('0x30')](db[_0xad31('0x4b')]['rawAttributes']);_0x471189[_0xad31('0x2f')]=_[_0xad31('0x30')](_0x5dce87[_0xad31('0x2f')]);_0x471189[_0xad31('0x31')]=_[_0xad31('0x32')](_0x471189['model'],_0x471189[_0xad31('0x2f')]);_0x56109a[_0xad31('0x34')]=_[_0xad31('0x32')](_0x471189['model'],qs[_0xad31('0x33')](_0x5dce87['query'][_0xad31('0x33')]));_0x56109a[_0xad31('0x34')]=_0x56109a[_0xad31('0x34')][_0xad31('0x35')]?_0x56109a[_0xad31('0x34')]:_0x471189['model'];_0x56109a['order']=qs[_0xad31('0x39')](_0x5dce87[_0xad31('0x2f')][_0xad31('0x39')]);_0x56109a[_0xad31('0x3a')]=qs[_0xad31('0x31')](_['pick'](_0x5dce87[_0xad31('0x2f')],_0x471189[_0xad31('0x31')]));if(_0x5dce87[_0xad31('0x2f')][_0xad31('0x3c')]){_0x56109a['where']=_[_0xad31('0x4c')](_0x56109a[_0xad31('0x3a')],{'$or':_[_0xad31('0x29')](_0x56109a[_0xad31('0x34')],function(_0x1dec7f){var _0x5dd26e={};_0x5dd26e[_0x1dec7f]={'$like':'%'+_0x5dce87[_0xad31('0x2f')][_0xad31('0x3c')]+'%'};return _0x5dd26e;})});}_0x56109a=_[_0xad31('0x4c')]({},_0x56109a,_0x5dce87['options']);return _0x3204df[_0xad31('0x49')](_0x56109a);}})['then'](function(_0x5d5ab8){if(_0x5d5ab8){_0x3d2247=_0x5d5ab8[_0xad31('0x35')];if(!_0x5dce87[_0xad31('0x2f')][_0xad31('0x36')]('nolimit')){_0x56109a['limit']=qs[_0xad31('0x1b')](_0x5dce87['query'][_0xad31('0x1b')]);_0x56109a[_0xad31('0x19')]=qs[_0xad31('0x19')](_0x5dce87[_0xad31('0x2f')]['offset']);}return _0x3204df['getConfigurations'](_0x56109a);}})[_0xad31('0x22')](function(_0x563011){if(_0x563011){return _0x563011?{'count':_0x3d2247,'rows':_0x563011}:null;}})[_0xad31('0x22')](respondWithResult(_0x2ab2ac,null))[_0xad31('0x42')](handleError(_0x2ab2ac,null));};exports[_0xad31('0x4d')]=function(_0x420950,_0x5b61ce,_0xfc0af3){if(_0x420950['body']['id']){delete _0x420950[_0xad31('0x47')]['id'];}return db[_0xad31('0x40')][_0xad31('0x4a')]({'where':{'id':_0x420950[_0xad31('0x44')]['id']}})['then'](handleEntityNotFound(_0x5b61ce,null))['then'](function(_0x266a17){if(_0x266a17){_0x420950['body'][_0xad31('0x4e')]=_0x266a17['id'];_0x420950[_0xad31('0x47')]['Subjects']=integrations[_0xad31('0x4f')](_0x420950[_0xad31('0x47')]['channel'],_0x420950[_0xad31('0x47')]['type']);_0x420950['body'][_0xad31('0x50')]=integrations[_0xad31('0x51')](_0x420950['body'][_0xad31('0x52')],_0x420950['body'][_0xad31('0x2c')]);return db[_0xad31('0x4b')][_0xad31('0x46')](_0x420950[_0xad31('0x47')],{'include':[{'model':db[_0xad31('0x53')],'as':'Subjects'},{'model':db[_0xad31('0x53')],'as':_0xad31('0x50')}]});}return null;})[_0xad31('0x22')](respondWithResult(_0x5b61ce,null))[_0xad31('0x42')](handleError(_0x5b61ce,null));};function getAccessToken(_0x1ecda0){return new Promise(function(_0x105883,_0x4041e8){var _0x365a9a;switch(_0x1ecda0[_0xad31('0x54')]){case'US':_0x365a9a=_0xad31('0x55');break;case'AU':_0x365a9a=_0xad31('0x56');break;case'EU':_0x365a9a='https://accounts.zoho.eu';break;case'IN':_0x365a9a='https://accounts.zoho.in';break;case'CN':_0x365a9a=_0xad31('0x57');break;default:_0x365a9a=_0xad31('0x58');break;}var _0x1d81ca={'method':_0xad31('0x59'),'uri':_0x365a9a+_0xad31('0x5a'),'qs':{'refresh_token':_0x1ecda0[_0xad31('0x5b')],'client_id':_0x1ecda0[_0xad31('0x5c')],'client_secret':_0x1ecda0[_0xad31('0x5d')],'grant_type':_0xad31('0x5e')},'json':!![]};return rp(_0x1d81ca)[_0xad31('0x22')](function(_0xc94df8){if(_0xc94df8[_0xad31('0x5f')]){_0x105883(_0xc94df8[_0xad31('0x5f')]);}else{_0x4041e8(_0xad31('0x60'));}})[_0xad31('0x42')](function(_0x1e1eb){_0x4041e8(_0x1e1eb);});});}exports['getFields']=function(_0x112b80,_0x32b898,_0x3d710d){var _0x96e4ea,_0x3c88df,_0x5d9c03,_0x1868d9,_0x4d22af;return db[_0xad31('0x40')][_0xad31('0x4a')]({'where':{'id':_0x112b80[_0xad31('0x44')]['id']},'attributes':['id',_0xad31('0x61'),_0xad31('0x54'),_0xad31('0x5c'),'clientSecret',_0xad31('0x62'),_0xad31('0x63'),_0xad31('0x5b')]})[_0xad31('0x22')](handleEntityNotFound(_0x32b898,null))[_0xad31('0x22')](function(_0x295da4){_0x4d22af=_0x295da4;_0x96e4ea=_0x4d22af[_0xad31('0x61')];_0x3c88df=_0x96e4ea===_0xad31('0x64')?'eu':_0xad31('0x65');_0x5d9c03=_0x4d22af[_0xad31('0x62')];var _0x548688=_0x5d9c03[_0xad31('0x66')](-0x1);if(_0x548688==='/'||_0x548688==='\x5c'||_0x548688===':'){_0x5d9c03=_0x5d9c03[_0xad31('0x67')](0x0,_0x5d9c03[_0xad31('0x68')](_0x548688));}if(!_0x4d22af[_0xad31('0x5b')]){throw new Error(_0xad31('0x69'));}return getAccessToken(_0x4d22af);})[_0xad31('0x22')](function(_0x572ee8){if(_0x572ee8){return rp({'method':_0xad31('0x6a'),'uri':util[_0xad31('0x6b')]('https://www.zohoapis.%s/crm/v2/settings/fields',_0x3c88df),'qs':{'module':_0xad31('0x6c')},'headers':{'Authorization':_0xad31('0x6d')+_0x572ee8},'json':!![]});}})[_0xad31('0x22')](function(_0x4a5792){if(_0x4a5792){if(_0x4a5792[_0xad31('0x6e')]&&_0x4a5792[_0xad31('0x6e')][_0xad31('0x25')]){throw new Error(_0x4a5792['response'][_0xad31('0x25')]['message']);}var _0x5f3942=[];var _0x461353=[];var _0xc3c360=[_0xad31('0x6f'),_0xad31('0x70'),_0xad31('0x71'),_0xad31('0x72'),_0xad31('0x73'),_0xad31('0x74'),_0xad31('0x75'),_0xad31('0x76')];_0x461353=_[_0xad31('0x77')](_0x4a5792[_0xad31('0x33')],function(_0x6a6640){return _0xc3c360[_0xad31('0x78')](_0x6a6640[_0xad31('0x79')]);});for(var _0x192429=0x0;_0x192429<_0x461353[_0xad31('0x35')];_0x192429++){if(_0x461353[_0x192429][_0xad31('0x7a')]===![]){_0x5f3942['push']({'id':_0x461353[_0x192429]['id'],'name':_0x461353[_0x192429][_0xad31('0x7b')],'custom':_0x461353[_0x192429][_0xad31('0x7c')],'options':_0x461353[_0x192429][_0xad31('0x7d')]===_0xad31('0x7e')&&_0x461353[_0x192429][_0xad31('0x7f')][_0xad31('0x35')]>-0x1?_[_0xad31('0x29')](_0x461353[_0x192429]['pick_list_values'],function(_0x2ed3b9){return{'name':_0x2ed3b9,'value':_0x2ed3b9};}):[]});}}return{'count':_0x5f3942[_0xad31('0x35')],'rows':_0x5f3942};}else{return{'count':0x0,'rows':[]};}})[_0xad31('0x22')](respondWithResult(_0x32b898,null))['catch'](function(_0x4505bc){var _0x46081f=_0x112b80[_0xad31('0x2f')][_0xad31('0x80')]?0x1f4:_0x4505bc[_0xad31('0x81')]||0x1f4;logger['error'](_0xad31('0x82'),_0xad31('0x83'),_0x46081f,JSON[_0xad31('0x84')](_0x4505bc));delete _0x4505bc['name'];if(_0x46081f===0x191){_0x46081f=0x190;}_0x32b898[_0xad31('0x18')](_0x46081f)[_0xad31('0x28')](_0x112b80['query']['test']?{'message':_0xad31('0x85'),'statusCode':_0x4505bc['statusCode']}:_0x4505bc);});}; \ No newline at end of file +var _0x5a81=['papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','../../components/integrations/configuration','sendStatus','status','end','json','offset','undefined','limit','set','reject','update','then','destroy','error','stack','name','send','map','ZohoAccount','rawAttributes','type','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','sort','where','merge','VIRTUAL','options','count','includeAll','include','rows','find','create','body','catch','params','findOne','ZohoConfiguration','order','pick','filter','getConfigurations','addConfiguration','AccountId','Subjects','getSubjects','channel','ZohoField','https://accounts.zoho.com','https://accounts.zoho.com.au','https://accounts.zoho.eu','https://accounts.zoho.in','https://accounts.zoho.com.cn','POST','/oauth/v2/token','refreshToken','clientId','clientSecret','refresh_token','access_token','Unable\x20to\x20retrieve\x20the\x20access\x20token','getFields','host','zone','code','zoho.eu','com','serverUrl','slice','substring','lastIndexOf','Refresh\x20Token\x20not\x20available\x20for\x20the\x20account','GET','format','https://www.zohoapis.%s/crm/v2/settings/fields','Calls','response','message','Owner','Description','Call_Duration','Call_Result','Call_Start_Time','Call_Type','remove','includes','api_name','push','display_label','picklist','pick_list_values','test','statusCode','getFields,\x20%s,\x20%s,\x20%s','stringify','eml-format','rimraf','zip-dir','fast-json-patch','moment','mustache','path','to-csv','ejs','fs-extra','lodash','squel','querystring'];(function(_0x1035c1,_0x2d8583){var _0x308d67=function(_0x58ddb6){while(--_0x58ddb6){_0x1035c1['push'](_0x1035c1['shift']());}};_0x308d67(++_0x2d8583);}(_0x5a81,0x1f3));var _0x15a8=function(_0x3fd844,_0x3a772b){_0x3fd844=_0x3fd844-0x0;var _0x20a365=_0x5a81[_0x3fd844];return _0x20a365;};'use strict';var emlformat=require(_0x15a8('0x0'));var rimraf=require(_0x15a8('0x1'));var zipdir=require(_0x15a8('0x2'));var jsonpatch=require(_0x15a8('0x3'));var rp=require('request-promise');var moment=require(_0x15a8('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x15a8('0x5'));var util=require('util');var path=require(_0x15a8('0x6'));var sox=require('sox');var csv=require(_0x15a8('0x7'));var ejs=require(_0x15a8('0x8'));var fs=require('fs');var fs_extra=require(_0x15a8('0x9'));var _=require(_0x15a8('0xa'));var squel=require(_0x15a8('0xb'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0x15a8('0x7'));var querystring=require(_0x15a8('0xc'));var Papa=require(_0x15a8('0xd'));var Redis=require(_0x15a8('0xe'));var authService=require(_0x15a8('0xf'));var qs=require(_0x15a8('0x10'));var as=require(_0x15a8('0x11'));var hardwareService=require(_0x15a8('0x12'));var logger=require(_0x15a8('0x13'))(_0x15a8('0x14'));var utils=require(_0x15a8('0x15'));var config=require('../../config/environment');var licenseUtil=require(_0x15a8('0x16'));var db=require(_0x15a8('0x17'))['db'];var integrations=require(_0x15a8('0x18'));function respondWithStatusCode(_0x177e29,_0x595830){_0x595830=_0x595830||0xcc;return function(_0x1de19a){if(_0x1de19a){return _0x177e29[_0x15a8('0x19')](_0x595830);}return _0x177e29[_0x15a8('0x1a')](_0x595830)[_0x15a8('0x1b')]();};}function respondWithResult(_0x57337b,_0x166597){_0x166597=_0x166597||0xc8;return function(_0x289f24){if(_0x289f24){return _0x57337b[_0x15a8('0x1a')](_0x166597)[_0x15a8('0x1c')](_0x289f24);}};}function respondWithFilteredResult(_0x46649b,_0xed0eec){return function(_0x3ecd40){if(_0x3ecd40){var _0x252557=typeof _0xed0eec[_0x15a8('0x1d')]===_0x15a8('0x1e')&&typeof _0xed0eec[_0x15a8('0x1f')]===_0x15a8('0x1e');var _0x51a561=_0x3ecd40['count'];var _0x583f77=_0x252557?0x0:_0xed0eec['offset'];var _0x44f918=_0x252557?_0x3ecd40['count']:_0xed0eec[_0x15a8('0x1d')]+_0xed0eec[_0x15a8('0x1f')];var _0x642507;if(_0x44f918>=_0x51a561){_0x44f918=_0x51a561;_0x642507=0xc8;}else{_0x642507=0xce;}_0x46649b[_0x15a8('0x1a')](_0x642507);return _0x46649b[_0x15a8('0x20')]('Content-Range',_0x583f77+'-'+_0x44f918+'/'+_0x51a561)[_0x15a8('0x1c')](_0x3ecd40);}return null;};}function patchUpdates(_0x5e6281){return function(_0xa301b4){try{jsonpatch['apply'](_0xa301b4,_0x5e6281,!![]);}catch(_0x4e5352){return BPromise[_0x15a8('0x21')](_0x4e5352);}return _0xa301b4['save']();};}function saveUpdates(_0x3a3a1a,_0x192029){return function(_0x24cd1d){if(_0x24cd1d){return _0x24cd1d[_0x15a8('0x22')](_0x3a3a1a)[_0x15a8('0x23')](function(_0x399891){return _0x399891;});}return null;};}function removeEntity(_0x21dc2d,_0x314e7e){return function(_0x256891){if(_0x256891){return _0x256891[_0x15a8('0x24')]()[_0x15a8('0x23')](function(){_0x21dc2d[_0x15a8('0x1a')](0xcc)[_0x15a8('0x1b')]();});}};}function handleEntityNotFound(_0x25f95c,_0x5d0ccf){return function(_0x30d86f){if(!_0x30d86f){_0x25f95c[_0x15a8('0x19')](0x194);}return _0x30d86f;};}function handleError(_0xfc3303,_0x10d5d5){_0x10d5d5=_0x10d5d5||0x1f4;return function(_0x520fa1){logger[_0x15a8('0x25')](_0x520fa1[_0x15a8('0x26')]);if(_0x520fa1[_0x15a8('0x27')]){delete _0x520fa1[_0x15a8('0x27')];}_0xfc3303[_0x15a8('0x1a')](_0x10d5d5)[_0x15a8('0x28')](_0x520fa1);};}exports['index']=function(_0x194fa4,_0x1d8745){var _0x2ae9d0={},_0x44034d={},_0x43baf2={'count':0x0,'rows':[]};var _0x23e0f3=_[_0x15a8('0x29')](db[_0x15a8('0x2a')][_0x15a8('0x2b')],function(_0x528a03){return{'name':_0x528a03['fieldName'],'type':_0x528a03[_0x15a8('0x2c')]['key']};});_0x44034d[_0x15a8('0x2d')]=_['map'](_0x23e0f3,_0x15a8('0x27'));_0x44034d[_0x15a8('0x2e')]=_[_0x15a8('0x2f')](_0x194fa4[_0x15a8('0x2e')]);_0x44034d[_0x15a8('0x30')]=_[_0x15a8('0x31')](_0x44034d[_0x15a8('0x2d')],_0x44034d[_0x15a8('0x2e')]);_0x2ae9d0[_0x15a8('0x32')]=_[_0x15a8('0x31')](_0x44034d[_0x15a8('0x2d')],qs[_0x15a8('0x33')](_0x194fa4[_0x15a8('0x2e')][_0x15a8('0x33')]));_0x2ae9d0['attributes']=_0x2ae9d0[_0x15a8('0x32')][_0x15a8('0x34')]?_0x2ae9d0['attributes']:_0x44034d[_0x15a8('0x2d')];if(!_0x194fa4[_0x15a8('0x2e')][_0x15a8('0x35')](_0x15a8('0x36'))){_0x2ae9d0[_0x15a8('0x1f')]=qs[_0x15a8('0x1f')](_0x194fa4['query'][_0x15a8('0x1f')]);_0x2ae9d0[_0x15a8('0x1d')]=qs[_0x15a8('0x1d')](_0x194fa4['query']['offset']);}_0x2ae9d0['order']=qs[_0x15a8('0x37')](_0x194fa4['query'][_0x15a8('0x37')]);_0x2ae9d0[_0x15a8('0x38')]=qs[_0x15a8('0x30')](_['pick'](_0x194fa4[_0x15a8('0x2e')],_0x44034d[_0x15a8('0x30')]),_0x23e0f3);if(_0x194fa4[_0x15a8('0x2e')]['filter']){_0x2ae9d0[_0x15a8('0x38')]=_[_0x15a8('0x39')](_0x2ae9d0[_0x15a8('0x38')],{'$or':_[_0x15a8('0x29')](_0x23e0f3,function(_0x336a9b){if(_0x336a9b['type']!==_0x15a8('0x3a')){var _0x7896a7={};_0x7896a7[_0x336a9b[_0x15a8('0x27')]]={'$like':'%'+_0x194fa4['query']['filter']+'%'};return _0x7896a7;}})});}_0x2ae9d0=_[_0x15a8('0x39')]({},_0x2ae9d0,_0x194fa4[_0x15a8('0x3b')]);var _0x160cbf={'where':_0x2ae9d0[_0x15a8('0x38')]};return db[_0x15a8('0x2a')]['count'](_0x160cbf)['then'](function(_0x3c83df){_0x43baf2[_0x15a8('0x3c')]=_0x3c83df;if(_0x194fa4[_0x15a8('0x2e')][_0x15a8('0x3d')]){_0x2ae9d0[_0x15a8('0x3e')]=[{'all':!![]}];}return db[_0x15a8('0x2a')]['findAll'](_0x2ae9d0);})['then'](function(_0x17642a){_0x43baf2[_0x15a8('0x3f')]=_0x17642a;return _0x43baf2;})[_0x15a8('0x23')](respondWithFilteredResult(_0x1d8745,_0x2ae9d0))['catch'](handleError(_0x1d8745,null));};exports['show']=function(_0x10862f,_0x1f1a9a){var _0x4e5cfd={'raw':![],'where':{'id':_0x10862f['params']['id']}},_0x56608e={};_0x56608e[_0x15a8('0x2d')]=_[_0x15a8('0x2f')](db[_0x15a8('0x2a')][_0x15a8('0x2b')]);_0x56608e['query']=_[_0x15a8('0x2f')](_0x10862f[_0x15a8('0x2e')]);_0x56608e[_0x15a8('0x30')]=_['intersection'](_0x56608e[_0x15a8('0x2d')],_0x56608e[_0x15a8('0x2e')]);_0x4e5cfd[_0x15a8('0x32')]=_[_0x15a8('0x31')](_0x56608e[_0x15a8('0x2d')],qs[_0x15a8('0x33')](_0x10862f[_0x15a8('0x2e')][_0x15a8('0x33')]));_0x4e5cfd[_0x15a8('0x32')]=_0x4e5cfd[_0x15a8('0x32')][_0x15a8('0x34')]?_0x4e5cfd[_0x15a8('0x32')]:_0x56608e[_0x15a8('0x2d')];if(_0x10862f['query']['includeAll']){_0x4e5cfd[_0x15a8('0x3e')]=[{'all':!![]}];}_0x4e5cfd=_['merge']({},_0x4e5cfd,_0x10862f['options']);return db[_0x15a8('0x2a')][_0x15a8('0x40')](_0x4e5cfd)[_0x15a8('0x23')](handleEntityNotFound(_0x1f1a9a,null))['then'](respondWithResult(_0x1f1a9a,null))['catch'](handleError(_0x1f1a9a,null));};exports[_0x15a8('0x41')]=function(_0x153ca5,_0x42c807){return db['ZohoAccount'][_0x15a8('0x41')](_0x153ca5[_0x15a8('0x42')],{})[_0x15a8('0x23')](respondWithResult(_0x42c807,0xc9))[_0x15a8('0x43')](handleError(_0x42c807,null));};exports[_0x15a8('0x22')]=function(_0x339274,_0x57b79e){if(_0x339274[_0x15a8('0x42')]['id']){delete _0x339274[_0x15a8('0x42')]['id'];}return db[_0x15a8('0x2a')]['find']({'where':{'id':_0x339274[_0x15a8('0x44')]['id']}})['then'](handleEntityNotFound(_0x57b79e,null))[_0x15a8('0x23')](saveUpdates(_0x339274[_0x15a8('0x42')],null))[_0x15a8('0x23')](respondWithResult(_0x57b79e,null))[_0x15a8('0x43')](handleError(_0x57b79e,null));};exports[_0x15a8('0x24')]=function(_0x49864d,_0x576657){return db[_0x15a8('0x2a')]['find']({'where':{'id':_0x49864d[_0x15a8('0x44')]['id']}})[_0x15a8('0x23')](handleEntityNotFound(_0x576657,null))[_0x15a8('0x23')](removeEntity(_0x576657,null))[_0x15a8('0x43')](handleError(_0x576657,null));};exports['getConfigurations']=function(_0x23f5c3,_0x517ddf,_0x40e1e6){var _0x5e5447={};var _0x132ee4={};var _0x47fec6;var _0x5dd659;return db[_0x15a8('0x2a')][_0x15a8('0x45')]({'where':{'id':_0x23f5c3['params']['id']}})[_0x15a8('0x23')](handleEntityNotFound(_0x517ddf,null))[_0x15a8('0x23')](function(_0xf50b11){if(_0xf50b11){_0x47fec6=_0xf50b11;_0x132ee4[_0x15a8('0x2d')]=_[_0x15a8('0x2f')](db[_0x15a8('0x46')][_0x15a8('0x2b')]);_0x132ee4[_0x15a8('0x2e')]=_['keys'](_0x23f5c3['query']);_0x132ee4['filters']=_['intersection'](_0x132ee4[_0x15a8('0x2d')],_0x132ee4[_0x15a8('0x2e')]);_0x5e5447[_0x15a8('0x32')]=_[_0x15a8('0x31')](_0x132ee4[_0x15a8('0x2d')],qs[_0x15a8('0x33')](_0x23f5c3[_0x15a8('0x2e')][_0x15a8('0x33')]));_0x5e5447[_0x15a8('0x32')]=_0x5e5447['attributes'][_0x15a8('0x34')]?_0x5e5447['attributes']:_0x132ee4[_0x15a8('0x2d')];_0x5e5447[_0x15a8('0x47')]=qs['sort'](_0x23f5c3['query'][_0x15a8('0x37')]);_0x5e5447['where']=qs['filters'](_[_0x15a8('0x48')](_0x23f5c3['query'],_0x132ee4[_0x15a8('0x30')]));if(_0x23f5c3[_0x15a8('0x2e')][_0x15a8('0x49')]){_0x5e5447[_0x15a8('0x38')]=_[_0x15a8('0x39')](_0x5e5447['where'],{'$or':_[_0x15a8('0x29')](_0x5e5447[_0x15a8('0x32')],function(_0x1bd78e){var _0x4a9da9={};_0x4a9da9[_0x1bd78e]={'$like':'%'+_0x23f5c3['query']['filter']+'%'};return _0x4a9da9;})});}_0x5e5447=_['merge']({},_0x5e5447,_0x23f5c3[_0x15a8('0x3b')]);return _0x47fec6[_0x15a8('0x4a')](_0x5e5447);}})[_0x15a8('0x23')](function(_0xa3871f){if(_0xa3871f){_0x5dd659=_0xa3871f[_0x15a8('0x34')];if(!_0x23f5c3[_0x15a8('0x2e')][_0x15a8('0x35')]('nolimit')){_0x5e5447['limit']=qs[_0x15a8('0x1f')](_0x23f5c3[_0x15a8('0x2e')][_0x15a8('0x1f')]);_0x5e5447[_0x15a8('0x1d')]=qs[_0x15a8('0x1d')](_0x23f5c3['query'][_0x15a8('0x1d')]);}return _0x47fec6[_0x15a8('0x4a')](_0x5e5447);}})[_0x15a8('0x23')](function(_0x462d82){if(_0x462d82){return _0x462d82?{'count':_0x5dd659,'rows':_0x462d82}:null;}})['then'](respondWithResult(_0x517ddf,null))[_0x15a8('0x43')](handleError(_0x517ddf,null));};exports[_0x15a8('0x4b')]=function(_0x231de4,_0x2e2363,_0x27196a){if(_0x231de4['body']['id']){delete _0x231de4[_0x15a8('0x42')]['id'];}return db['ZohoAccount'][_0x15a8('0x45')]({'where':{'id':_0x231de4[_0x15a8('0x44')]['id']}})[_0x15a8('0x23')](handleEntityNotFound(_0x2e2363,null))[_0x15a8('0x23')](function(_0x13502b){if(_0x13502b){_0x231de4[_0x15a8('0x42')][_0x15a8('0x4c')]=_0x13502b['id'];_0x231de4[_0x15a8('0x42')][_0x15a8('0x4d')]=integrations[_0x15a8('0x4e')](_0x231de4[_0x15a8('0x42')]['channel'],_0x231de4['body'][_0x15a8('0x2c')]);_0x231de4[_0x15a8('0x42')]['Descriptions']=integrations['getDescriptions'](_0x231de4['body'][_0x15a8('0x4f')],_0x231de4[_0x15a8('0x42')][_0x15a8('0x2c')]);return db[_0x15a8('0x46')][_0x15a8('0x41')](_0x231de4[_0x15a8('0x42')],{'include':[{'model':db['ZohoField'],'as':_0x15a8('0x4d')},{'model':db[_0x15a8('0x50')],'as':'Descriptions'}]});}return null;})[_0x15a8('0x23')](respondWithResult(_0x2e2363,null))[_0x15a8('0x43')](handleError(_0x2e2363,null));};function getAccessToken(_0x34bc94){return new Promise(function(_0x2de790,_0x4735a3){var _0x6e1837;switch(_0x34bc94['zone']){case'US':_0x6e1837=_0x15a8('0x51');break;case'AU':_0x6e1837=_0x15a8('0x52');break;case'EU':_0x6e1837=_0x15a8('0x53');break;case'IN':_0x6e1837=_0x15a8('0x54');break;case'CN':_0x6e1837=_0x15a8('0x55');break;default:_0x6e1837=_0x15a8('0x53');break;}var _0x1c5e4f={'method':_0x15a8('0x56'),'uri':_0x6e1837+_0x15a8('0x57'),'qs':{'refresh_token':_0x34bc94[_0x15a8('0x58')],'client_id':_0x34bc94[_0x15a8('0x59')],'client_secret':_0x34bc94[_0x15a8('0x5a')],'grant_type':_0x15a8('0x5b')},'json':!![]};return rp(_0x1c5e4f)[_0x15a8('0x23')](function(_0x1d23ae){if(_0x1d23ae[_0x15a8('0x5c')]){_0x2de790(_0x1d23ae['access_token']);}else{_0x4735a3(_0x15a8('0x5d'));}})[_0x15a8('0x43')](function(_0x3fda8a){_0x4735a3(_0x3fda8a);});});}exports[_0x15a8('0x5e')]=function(_0x25b79d,_0x379640,_0x3c8671){var _0x3aa9c1,_0x533637,_0x32cafa,_0x49dc8d,_0x476384;return db[_0x15a8('0x2a')]['findOne']({'where':{'id':_0x25b79d[_0x15a8('0x44')]['id']},'attributes':['id',_0x15a8('0x5f'),_0x15a8('0x60'),'clientId','clientSecret','serverUrl',_0x15a8('0x61'),_0x15a8('0x58')]})[_0x15a8('0x23')](handleEntityNotFound(_0x379640,null))[_0x15a8('0x23')](function(_0x1b6c3b){_0x476384=_0x1b6c3b;_0x3aa9c1=_0x476384[_0x15a8('0x5f')];_0x533637=_0x3aa9c1===_0x15a8('0x62')?'eu':_0x15a8('0x63');_0x32cafa=_0x476384[_0x15a8('0x64')];var _0xf94cd0=_0x32cafa[_0x15a8('0x65')](-0x1);if(_0xf94cd0==='/'||_0xf94cd0==='\x5c'||_0xf94cd0===':'){_0x32cafa=_0x32cafa[_0x15a8('0x66')](0x0,_0x32cafa[_0x15a8('0x67')](_0xf94cd0));}if(!_0x476384[_0x15a8('0x58')]){throw new Error(_0x15a8('0x68'));}return getAccessToken(_0x476384);})['then'](function(_0x5b0fdd){if(_0x5b0fdd){return rp({'method':_0x15a8('0x69'),'uri':util[_0x15a8('0x6a')](_0x15a8('0x6b'),_0x533637),'qs':{'module':_0x15a8('0x6c')},'headers':{'Authorization':'Zoho-oauthtoken\x20'+_0x5b0fdd},'json':!![]});}})[_0x15a8('0x23')](function(_0x572169){if(_0x572169){if(_0x572169['response']&&_0x572169[_0x15a8('0x6d')][_0x15a8('0x25')]){throw new Error(_0x572169[_0x15a8('0x6d')]['error'][_0x15a8('0x6e')]);}var _0x4f3e34=[];var _0x3f7009=[];var _0x41362c=[_0x15a8('0x6f'),'Subject',_0x15a8('0x70'),'WhoId',_0x15a8('0x71'),_0x15a8('0x72'),_0x15a8('0x73'),_0x15a8('0x74')];_0x3f7009=_[_0x15a8('0x75')](_0x572169['fields'],function(_0x1ced49){return _0x41362c[_0x15a8('0x76')](_0x1ced49[_0x15a8('0x77')]);});for(var _0x20e9c9=0x0;_0x20e9c9<_0x3f7009[_0x15a8('0x34')];_0x20e9c9++){if(_0x3f7009[_0x20e9c9]['system_mandatory']===![]){_0x4f3e34[_0x15a8('0x78')]({'id':_0x3f7009[_0x20e9c9]['id'],'name':_0x3f7009[_0x20e9c9][_0x15a8('0x79')],'custom':_0x3f7009[_0x20e9c9]['custom_field'],'options':_0x3f7009[_0x20e9c9]['data_type']===_0x15a8('0x7a')&&_0x3f7009[_0x20e9c9][_0x15a8('0x7b')]['length']>-0x1?_[_0x15a8('0x29')](_0x3f7009[_0x20e9c9][_0x15a8('0x7b')],function(_0x20a459){return{'name':_0x20a459,'value':_0x20a459};}):[]});}}return{'count':_0x4f3e34[_0x15a8('0x34')],'rows':_0x4f3e34};}else{return{'count':0x0,'rows':[]};}})[_0x15a8('0x23')](respondWithResult(_0x379640,null))['catch'](function(_0x3963db){var _0x39c2df=_0x25b79d[_0x15a8('0x2e')][_0x15a8('0x7c')]?0x1f4:_0x3963db[_0x15a8('0x7d')]||0x1f4;logger[_0x15a8('0x25')](_0x15a8('0x7e'),_0x15a8('0x5e'),_0x39c2df,JSON[_0x15a8('0x7f')](_0x3963db));delete _0x3963db[_0x15a8('0x27')];if(_0x39c2df===0x191){_0x39c2df=0x190;}_0x379640[_0x15a8('0x1a')](_0x39c2df)['send'](_0x25b79d[_0x15a8('0x2e')][_0x15a8('0x7c')]?{'message':'Wrong\x20credentials','statusCode':_0x3963db[_0x15a8('0x7d')]}:_0x3963db);});}; \ No newline at end of file diff --git a/server/api/intZohoAccount/intZohoAccount.model.js b/server/api/intZohoAccount/intZohoAccount.model.js index 9e97f35..baa8f97 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 _0x62cf=['refresh_token','refreshToken','ZohoAccount,\x20Refresh\x20token\x20successfully\x20generated\x20for\x20account\x20\x22%s\x22\x20#%d','name','error','format','ZohoAccount,\x20Unable\x20to\x20generate\x20the\x20refresh\x20token\x20for\x20account\x20\x22%s\x22\x20#%d','inspect','https://accounts.zoho.com.au','https://accounts.zoho.eu','parse','catch','lodash','../../config/logger','moment','bluebird','rimraf','../../config/environment','./intZohoAccount.attributes','../../components/integrations/configuration','exports','define','ZohoAccount','changed','zone','serverUrl','clientId','clientSecret','code','host','substring','lastIndexOf','https://accounts.zoho.com','https://accounts.zoho.in','https://accounts.zoho.com.cn','POST','authorization_code','application/x-www-form-urlencoded','then'];(function(_0x4d1ee9,_0x394a78){var _0x9a5456=function(_0x224f3b){while(--_0x224f3b){_0x4d1ee9['push'](_0x4d1ee9['shift']());}};_0x9a5456(++_0x394a78);}(_0x62cf,0x81));var _0xf62c=function(_0x44fca9,_0xec4377){_0x44fca9=_0x44fca9-0x0;var _0x5b5904=_0x62cf[_0x44fca9];return _0x5b5904;};'use strict';var _=require(_0xf62c('0x0'));var util=require('util');var logger=require(_0xf62c('0x1'))('api');var moment=require(_0xf62c('0x2'));var BPromise=require(_0xf62c('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0xf62c('0x4'));var config=require(_0xf62c('0x5'));var attributes=require(_0xf62c('0x6'));var integrations=require(_0xf62c('0x7'));module[_0xf62c('0x8')]=function(_0x40487e,_0x45749c){return _0x40487e[_0xf62c('0x9')](_0xf62c('0xa'),attributes,{'tableName':'int_zoho_accounts','paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeCreate':function(_0x181f87,_0x4e0655,_0x34fdf0){if(_0x181f87[_0xf62c('0xb')](_0xf62c('0xc'))||_0x181f87[_0xf62c('0xb')](_0xf62c('0xd'))||_0x181f87[_0xf62c('0xb')](_0xf62c('0xe'))||_0x181f87[_0xf62c('0xb')](_0xf62c('0xf'))||_0x181f87[_0xf62c('0xb')](_0xf62c('0x10'))||_0x181f87['changed'](_0xf62c('0x11'))){var _0x5c07d3,_0x4ead27;_0x5c07d3=_0x181f87[_0xf62c('0xd')];var _0x8489c0=_0x5c07d3['slice'](-0x1);if(_0x8489c0==='/'||_0x8489c0==='\x5c'||_0x8489c0===':'){_0x5c07d3=_0x5c07d3[_0xf62c('0x12')](0x0,_0x5c07d3[_0xf62c('0x13')](_0x8489c0));}switch(_0x181f87['zone']){case'US':_0x4ead27=_0xf62c('0x14');break;case'AU':_0x4ead27='https://accounts.zoho.com.au';break;case'IN':_0x4ead27=_0xf62c('0x15');break;case'CN':_0x4ead27=_0xf62c('0x16');break;default:_0x4ead27='https://accounts.zoho.eu';break;}var _0x3c748a={'method':_0xf62c('0x17'),'uri':_0x4ead27+'/oauth/v2/token','form':{'grant_type':_0xf62c('0x18'),'client_id':_0x181f87[_0xf62c('0xe')],'client_secret':_0x181f87[_0xf62c('0xf')],'redirect_uri':_0x181f87['serverUrl'],'code':_0x181f87[_0xf62c('0x10')]},'headers':{'Content-Type':_0xf62c('0x19')}};return rp(_0x3c748a)[_0xf62c('0x1a')](function(_0x329c3c){var _0x32a7c3=JSON['parse'](_0x329c3c);if(_0x32a7c3[_0xf62c('0x1b')]){_0x181f87[_0xf62c('0x1c')]=_0x32a7c3[_0xf62c('0x1b')];logger['info'](util['format'](_0xf62c('0x1d'),_0x181f87[_0xf62c('0x1e')],_0x181f87['id']));}else{logger[_0xf62c('0x1f')](util[_0xf62c('0x20')](_0xf62c('0x21'),_0x181f87['name'],_0x181f87['id']),util['inspect'](_0x32a7c3,{'showHidden':![],'depth':null}));}return _0x34fdf0(null,_0x4e0655);})['catch'](function(_0x11fda3){logger[_0xf62c('0x1f')](util[_0xf62c('0x20')](_0xf62c('0x21'),_0x181f87[_0xf62c('0x1e')],_0x181f87['id']),util[_0xf62c('0x22')](parsedResult,{'showHidden':![],'depth':null}));return _0x34fdf0(_0x11fda3);});}else{return _0x34fdf0(null,_0x4e0655);}},'beforeUpdate':function(_0x5c048f,_0x33b572,_0x120077){if(_0x5c048f[_0xf62c('0xb')]('zone')||_0x5c048f['changed']('serverUrl')||_0x5c048f['changed'](_0xf62c('0xe'))||_0x5c048f['changed'](_0xf62c('0xf'))||_0x5c048f['changed'](_0xf62c('0x10'))||_0x5c048f['changed'](_0xf62c('0x11'))){var _0x41c49f,_0x439f48;_0x41c49f=_0x5c048f[_0xf62c('0xd')];var _0xbaa5a0=_0x41c49f['slice'](-0x1);if(_0xbaa5a0==='/'||_0xbaa5a0==='\x5c'||_0xbaa5a0===':'){_0x41c49f=_0x41c49f[_0xf62c('0x12')](0x0,_0x41c49f[_0xf62c('0x13')](_0xbaa5a0));}switch(_0x5c048f[_0xf62c('0xc')]){case'US':_0x439f48=_0xf62c('0x14');break;case'AU':_0x439f48=_0xf62c('0x23');break;case'IN':_0x439f48=_0xf62c('0x15');break;case'CN':_0x439f48=_0xf62c('0x16');break;default:_0x439f48=_0xf62c('0x24');break;}var _0x19b820={'method':_0xf62c('0x17'),'uri':_0x439f48+'/oauth/v2/token','form':{'grant_type':_0xf62c('0x18'),'client_id':_0x5c048f[_0xf62c('0xe')],'client_secret':_0x5c048f['clientSecret'],'redirect_uri':_0x5c048f[_0xf62c('0xd')],'code':_0x5c048f['code']},'headers':{'Content-Type':_0xf62c('0x19')}};return rp(_0x19b820)[_0xf62c('0x1a')](function(_0x515292){var _0x5e7590=JSON[_0xf62c('0x25')](_0x515292);if(_0x5e7590[_0xf62c('0x1b')]){_0x5c048f['refreshToken']=_0x5e7590[_0xf62c('0x1b')];logger['info'](util[_0xf62c('0x20')](_0xf62c('0x1d'),_0x5c048f[_0xf62c('0x1e')],_0x5c048f['id']));}else{logger[_0xf62c('0x1f')](util['format']('ZohoAccount,\x20Unable\x20to\x20generate\x20the\x20refresh\x20token\x20for\x20account\x20\x22%s\x22\x20#%d',_0x5c048f[_0xf62c('0x1e')],_0x5c048f['id']),util['inspect'](_0x5e7590,{'showHidden':![],'depth':null}));}return _0x120077(null,_0x33b572);})[_0xf62c('0x26')](function(_0x5deddd){logger[_0xf62c('0x1f')](util[_0xf62c('0x20')](_0xf62c('0x21'),_0x5c048f[_0xf62c('0x1e')],_0x5c048f['id']),util['inspect'](parsedResult,{'showHidden':![],'depth':null}));return _0x120077(_0x5deddd);});}else{return _0x120077(null,_0x33b572);}}}});}; \ No newline at end of file +var _0x2bd8=['zone','serverUrl','clientSecret','code','host','slice','substring','https://accounts.zoho.com','https://accounts.zoho.com.au','https://accounts.zoho.in','https://accounts.zoho.eu','POST','/oauth/v2/token','authorization_code','clientId','then','refreshToken','refresh_token','format','ZohoAccount,\x20Refresh\x20token\x20successfully\x20generated\x20for\x20account\x20\x22%s\x22\x20#%d','name','error','ZohoAccount,\x20Unable\x20to\x20generate\x20the\x20refresh\x20token\x20for\x20account\x20\x22%s\x22\x20#%d','catch','inspect','lastIndexOf','application/x-www-form-urlencoded','parse','info','../../config/logger','api','moment','bluebird','path','rimraf','../../config/environment','./intZohoAccount.attributes','../../components/integrations/configuration','exports','define','ZohoAccount','int_zoho_accounts','changed'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0x2bd8,0x11f));var _0x82bd=function(_0x239f74,_0x4a84d5){_0x239f74=_0x239f74-0x0;var _0x22fc6b=_0x2bd8[_0x239f74];return _0x22fc6b;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x82bd('0x0'))(_0x82bd('0x1'));var moment=require(_0x82bd('0x2'));var BPromise=require(_0x82bd('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x82bd('0x4'));var rimraf=require(_0x82bd('0x5'));var config=require(_0x82bd('0x6'));var attributes=require(_0x82bd('0x7'));var integrations=require(_0x82bd('0x8'));module[_0x82bd('0x9')]=function(_0x16620b,_0x4fc953){return _0x16620b[_0x82bd('0xa')](_0x82bd('0xb'),attributes,{'tableName':_0x82bd('0xc'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeCreate':function(_0x6f3004,_0x2a1e99,_0x25e266){if(_0x6f3004[_0x82bd('0xd')](_0x82bd('0xe'))||_0x6f3004[_0x82bd('0xd')](_0x82bd('0xf'))||_0x6f3004[_0x82bd('0xd')]('clientId')||_0x6f3004['changed'](_0x82bd('0x10'))||_0x6f3004[_0x82bd('0xd')](_0x82bd('0x11'))||_0x6f3004[_0x82bd('0xd')](_0x82bd('0x12'))){var _0x3b43d6,_0x104832;_0x3b43d6=_0x6f3004['serverUrl'];var _0x4847fe=_0x3b43d6[_0x82bd('0x13')](-0x1);if(_0x4847fe==='/'||_0x4847fe==='\x5c'||_0x4847fe===':'){_0x3b43d6=_0x3b43d6[_0x82bd('0x14')](0x0,_0x3b43d6['lastIndexOf'](_0x4847fe));}switch(_0x6f3004[_0x82bd('0xe')]){case'US':_0x104832=_0x82bd('0x15');break;case'AU':_0x104832=_0x82bd('0x16');break;case'IN':_0x104832=_0x82bd('0x17');break;case'CN':_0x104832='https://accounts.zoho.com.cn';break;default:_0x104832=_0x82bd('0x18');break;}var _0x2ebe74={'method':_0x82bd('0x19'),'uri':_0x104832+_0x82bd('0x1a'),'form':{'grant_type':_0x82bd('0x1b'),'client_id':_0x6f3004[_0x82bd('0x1c')],'client_secret':_0x6f3004['clientSecret'],'redirect_uri':_0x6f3004[_0x82bd('0xf')],'code':_0x6f3004['code']},'headers':{'Content-Type':'application/x-www-form-urlencoded'}};return rp(_0x2ebe74)[_0x82bd('0x1d')](function(_0x328091){var _0x3130d9=JSON['parse'](_0x328091);if(_0x3130d9['refresh_token']){_0x6f3004[_0x82bd('0x1e')]=_0x3130d9[_0x82bd('0x1f')];logger['info'](util[_0x82bd('0x20')](_0x82bd('0x21'),_0x6f3004[_0x82bd('0x22')],_0x6f3004['id']));}else{logger[_0x82bd('0x23')](util[_0x82bd('0x20')](_0x82bd('0x24'),_0x6f3004[_0x82bd('0x22')],_0x6f3004['id']),util['inspect'](_0x3130d9,{'showHidden':![],'depth':null}));}return _0x25e266(null,_0x2a1e99);})[_0x82bd('0x25')](function(_0xc87583){logger[_0x82bd('0x23')](util[_0x82bd('0x20')]('ZohoAccount,\x20Unable\x20to\x20generate\x20the\x20refresh\x20token\x20for\x20account\x20\x22%s\x22\x20#%d',_0x6f3004[_0x82bd('0x22')],_0x6f3004['id']),util[_0x82bd('0x26')](parsedResult,{'showHidden':![],'depth':null}));return _0x25e266(_0xc87583);});}else{return _0x25e266(null,_0x2a1e99);}},'beforeUpdate':function(_0x2ab745,_0x361fe6,_0x3afc8f){if(_0x2ab745[_0x82bd('0xd')](_0x82bd('0xe'))||_0x2ab745[_0x82bd('0xd')]('serverUrl')||_0x2ab745[_0x82bd('0xd')](_0x82bd('0x1c'))||_0x2ab745[_0x82bd('0xd')](_0x82bd('0x10'))||_0x2ab745['changed'](_0x82bd('0x11'))||_0x2ab745[_0x82bd('0xd')](_0x82bd('0x12'))){var _0x3a505e,_0x263ac2;_0x3a505e=_0x2ab745[_0x82bd('0xf')];var _0x2eef38=_0x3a505e[_0x82bd('0x13')](-0x1);if(_0x2eef38==='/'||_0x2eef38==='\x5c'||_0x2eef38===':'){_0x3a505e=_0x3a505e[_0x82bd('0x14')](0x0,_0x3a505e[_0x82bd('0x27')](_0x2eef38));}switch(_0x2ab745[_0x82bd('0xe')]){case'US':_0x263ac2='https://accounts.zoho.com';break;case'AU':_0x263ac2=_0x82bd('0x16');break;case'IN':_0x263ac2='https://accounts.zoho.in';break;case'CN':_0x263ac2='https://accounts.zoho.com.cn';break;default:_0x263ac2=_0x82bd('0x18');break;}var _0x1aa717={'method':_0x82bd('0x19'),'uri':_0x263ac2+'/oauth/v2/token','form':{'grant_type':_0x82bd('0x1b'),'client_id':_0x2ab745[_0x82bd('0x1c')],'client_secret':_0x2ab745[_0x82bd('0x10')],'redirect_uri':_0x2ab745[_0x82bd('0xf')],'code':_0x2ab745[_0x82bd('0x11')]},'headers':{'Content-Type':_0x82bd('0x28')}};return rp(_0x1aa717)['then'](function(_0x4d927e){var _0x35f267=JSON[_0x82bd('0x29')](_0x4d927e);if(_0x35f267[_0x82bd('0x1f')]){_0x2ab745[_0x82bd('0x1e')]=_0x35f267['refresh_token'];logger[_0x82bd('0x2a')](util['format'](_0x82bd('0x21'),_0x2ab745['name'],_0x2ab745['id']));}else{logger['error'](util[_0x82bd('0x20')](_0x82bd('0x24'),_0x2ab745[_0x82bd('0x22')],_0x2ab745['id']),util[_0x82bd('0x26')](_0x35f267,{'showHidden':![],'depth':null}));}return _0x3afc8f(null,_0x361fe6);})[_0x82bd('0x25')](function(_0x4ff793){logger[_0x82bd('0x23')](util[_0x82bd('0x20')](_0x82bd('0x24'),_0x2ab745['name'],_0x2ab745['id']),util[_0x82bd('0x26')](parsedResult,{'showHidden':![],'depth':null}));return _0x3afc8f(_0x4ff793);});}else{return _0x3afc8f(null,_0x361fe6);}}}});}; \ No newline at end of file diff --git a/server/api/intZohoAccount/intZohoAccount.rpc.js b/server/api/intZohoAccount/intZohoAccount.rpc.js index acd5fa3..56eac4b 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 _0x1131=['catch','GetZohoAccount','findAll','options','raw','attributes','limit','include','map','model','debug','ShowZohoAccount','ZohoAccount','where','util','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','request','then','info','ZohoAccount,\x20%s,\x20%s','ZohoAccount,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result'];(function(_0x30a64d,_0x351426){var _0x56c565=function(_0x548161){while(--_0x548161){_0x30a64d['push'](_0x30a64d['shift']());}};_0x56c565(++_0x351426);}(_0x1131,0x71));var _0x1113=function(_0x1581bc,_0x23b9de){_0x1581bc=_0x1581bc-0x0;var _0x5e7936=_0x1131[_0x1581bc];return _0x5e7936;};'use strict';var _=require('lodash');var util=require(_0x1113('0x0'));var moment=require('moment');var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x1113('0x1'));var db=require(_0x1113('0x2'))['db'];var utils=require(_0x1113('0x3'));var logger=require(_0x1113('0x4'))(_0x1113('0x5'));var config=require(_0x1113('0x6'));var jayson=require('jayson/promise');var client=jayson[_0x1113('0x7')]['http']({'port':0x232a});function respondWithRpcPromise(_0x1f76a7,_0x500c86,_0x502a53){return new BPromise(function(_0x458f86,_0x53a218){return client[_0x1113('0x8')](_0x1f76a7,_0x502a53)[_0x1113('0x9')](function(_0x3e20dd){logger[_0x1113('0xa')](_0x1113('0xb'),_0x500c86,'request\x20sent');logger['debug'](_0x1113('0xc'),_0x500c86,_0x1113('0xd'),JSON[_0x1113('0xe')](_0x3e20dd));if(_0x3e20dd['error']){if(_0x3e20dd[_0x1113('0xf')][_0x1113('0x10')]===0x1f4){logger['error'](_0x1113('0xb'),_0x500c86,_0x3e20dd[_0x1113('0xf')][_0x1113('0x11')]);return _0x53a218(_0x3e20dd[_0x1113('0xf')]['message']);}logger['error']('ZohoAccount,\x20%s,\x20%s',_0x500c86,_0x3e20dd['error'][_0x1113('0x11')]);return _0x458f86(_0x3e20dd[_0x1113('0xf')][_0x1113('0x11')]);}else{logger[_0x1113('0xa')]('ZohoAccount,\x20%s,\x20%s',_0x500c86,_0x1113('0xd'));_0x458f86(_0x3e20dd[_0x1113('0x12')][_0x1113('0x11')]);}})[_0x1113('0x13')](function(_0x1cadcb){logger[_0x1113('0xf')](_0x1113('0xb'),_0x500c86,_0x1cadcb);_0x53a218(_0x1cadcb);});});}exports[_0x1113('0x14')]=function(_0x2fc97b){var _0x1fa6ed=this;return new Promise(function(_0x52cbcd,_0x5a878a){return db['ZohoAccount'][_0x1113('0x15')]({'raw':_0x2fc97b['options']?_0x2fc97b[_0x1113('0x16')][_0x1113('0x17')]===undefined?!![]:![]:!![],'where':_0x2fc97b['options']?_0x2fc97b['options']['where']||null:null,'attributes':_0x2fc97b['options']?_0x2fc97b[_0x1113('0x16')][_0x1113('0x18')]||null:null,'limit':_0x2fc97b[_0x1113('0x16')]?_0x2fc97b[_0x1113('0x16')][_0x1113('0x19')]||null:null,'include':_0x2fc97b[_0x1113('0x16')]?_0x2fc97b[_0x1113('0x16')][_0x1113('0x1a')]?_[_0x1113('0x1b')](_0x2fc97b['options'][_0x1113('0x1a')],function(_0x357726){return{'model':db[_0x357726[_0x1113('0x1c')]],'as':_0x357726['as'],'attributes':_0x357726['attributes'],'include':_0x357726[_0x1113('0x1a')]?_['map'](_0x357726[_0x1113('0x1a')],function(_0x46b4d5){return{'model':db[_0x46b4d5[_0x1113('0x1c')]],'as':_0x46b4d5['as'],'attributes':_0x46b4d5[_0x1113('0x18')],'include':_0x46b4d5['include']?_[_0x1113('0x1b')](_0x46b4d5[_0x1113('0x1a')],function(_0x389410){return{'model':db[_0x389410[_0x1113('0x1c')]],'as':_0x389410['as'],'attributes':_0x389410['attributes']};}):[]};}):[]};}):[]:[]})[_0x1113('0x9')](function(_0x3e4b26){logger[_0x1113('0xa')]('GetZohoAccount',_0x2fc97b);logger[_0x1113('0x1d')](_0x1113('0x14'),_0x2fc97b,JSON[_0x1113('0xe')](_0x3e4b26));_0x52cbcd(_0x3e4b26);})['catch'](function(_0x190299){logger[_0x1113('0xf')](_0x1113('0x14'),_0x190299[_0x1113('0x11')],_0x2fc97b);_0x5a878a(_0x1fa6ed[_0x1113('0xf')](0x1f4,_0x190299[_0x1113('0x11')]));});});};exports[_0x1113('0x1e')]=function(_0x26b2be){var _0x28b5d0=this;return new Promise(function(_0x14dd61,_0xdab083){return db[_0x1113('0x1f')]['find']({'raw':_0x26b2be['options']?_0x26b2be[_0x1113('0x16')][_0x1113('0x17')]===undefined?!![]:![]:!![],'where':_0x26b2be['options']?_0x26b2be[_0x1113('0x16')][_0x1113('0x20')]||null:null,'attributes':_0x26b2be['options']?_0x26b2be[_0x1113('0x16')][_0x1113('0x18')]||null:null,'include':_0x26b2be['options']?_0x26b2be[_0x1113('0x16')][_0x1113('0x1a')]?_[_0x1113('0x1b')](_0x26b2be[_0x1113('0x16')]['include'],function(_0x52e0c2){return{'model':db[_0x52e0c2[_0x1113('0x1c')]],'as':_0x52e0c2['as'],'attributes':_0x52e0c2[_0x1113('0x18')],'include':_0x52e0c2['include']?_[_0x1113('0x1b')](_0x52e0c2['include'],function(_0x337b13){return{'model':db[_0x337b13[_0x1113('0x1c')]],'as':_0x337b13['as'],'attributes':_0x337b13[_0x1113('0x18')],'include':_0x337b13[_0x1113('0x1a')]?_[_0x1113('0x1b')](_0x337b13[_0x1113('0x1a')],function(_0x5b387b){return{'model':db[_0x5b387b[_0x1113('0x1c')]],'as':_0x5b387b['as'],'attributes':_0x5b387b['attributes']};}):[]};}):[]};}):[]:[]})[_0x1113('0x9')](function(_0x1df78e){logger['info'](_0x1113('0x1e'),_0x26b2be);logger['debug'](_0x1113('0x1e'),_0x26b2be,JSON[_0x1113('0xe')](_0x1df78e));_0x14dd61(_0x1df78e);})['catch'](function(_0x31e8e0){logger['error'](_0x1113('0x1e'),_0x31e8e0[_0x1113('0x11')],_0x26b2be);_0xdab083(_0x28b5d0[_0x1113('0xf')](0x1f4,_0x31e8e0['message']));});});}; \ No newline at end of file +var _0x57ca=['then','debug','ShowZohoAccount','find','stringify','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','request','info','request\x20sent','ZohoAccount,\x20%s,\x20%s,\x20%s','error','code','ZohoAccount,\x20%s,\x20%s','message','result','catch','GetZohoAccount','ZohoAccount','findAll','options','raw','where','attributes','limit','include','map','model'];(function(_0x4d5a7a,_0x1bc05d){var _0x67c69f=function(_0x44b756){while(--_0x44b756){_0x4d5a7a['push'](_0x4d5a7a['shift']());}};_0x67c69f(++_0x1bc05d);}(_0x57ca,0x108));var _0xa57c=function(_0x39918b,_0x4f8c1b){_0x39918b=_0x39918b-0x0;var _0x54a4e6=_0x57ca[_0x39918b];return _0x54a4e6;};'use strict';var _=require('lodash');var util=require(_0xa57c('0x0'));var moment=require(_0xa57c('0x1'));var BPromise=require('bluebird');var rs=require(_0xa57c('0x2'));var fs=require('fs');var Redis=require(_0xa57c('0x3'));var db=require(_0xa57c('0x4'))['db'];var utils=require(_0xa57c('0x5'));var logger=require(_0xa57c('0x6'))('rpc');var config=require(_0xa57c('0x7'));var jayson=require(_0xa57c('0x8'));var client=jayson[_0xa57c('0x9')][_0xa57c('0xa')]({'port':0x232a});function respondWithRpcPromise(_0xbdfffb,_0x314574,_0x19e28e){return new BPromise(function(_0x271ccc,_0x5e3962){return client[_0xa57c('0xb')](_0xbdfffb,_0x19e28e)['then'](function(_0x46ba92){logger[_0xa57c('0xc')]('ZohoAccount,\x20%s,\x20%s',_0x314574,_0xa57c('0xd'));logger['debug'](_0xa57c('0xe'),_0x314574,_0xa57c('0xd'),JSON['stringify'](_0x46ba92));if(_0x46ba92[_0xa57c('0xf')]){if(_0x46ba92['error'][_0xa57c('0x10')]===0x1f4){logger[_0xa57c('0xf')](_0xa57c('0x11'),_0x314574,_0x46ba92[_0xa57c('0xf')][_0xa57c('0x12')]);return _0x5e3962(_0x46ba92['error'][_0xa57c('0x12')]);}logger['error'](_0xa57c('0x11'),_0x314574,_0x46ba92[_0xa57c('0xf')][_0xa57c('0x12')]);return _0x271ccc(_0x46ba92[_0xa57c('0xf')][_0xa57c('0x12')]);}else{logger[_0xa57c('0xc')](_0xa57c('0x11'),_0x314574,'request\x20sent');_0x271ccc(_0x46ba92[_0xa57c('0x13')][_0xa57c('0x12')]);}})[_0xa57c('0x14')](function(_0x5a6024){logger[_0xa57c('0xf')]('ZohoAccount,\x20%s,\x20%s',_0x314574,_0x5a6024);_0x5e3962(_0x5a6024);});});}exports[_0xa57c('0x15')]=function(_0x3d781d){var _0x93462c=this;return new Promise(function(_0xe3d505,_0x1fd0d8){return db[_0xa57c('0x16')][_0xa57c('0x17')]({'raw':_0x3d781d[_0xa57c('0x18')]?_0x3d781d['options'][_0xa57c('0x19')]===undefined?!![]:![]:!![],'where':_0x3d781d['options']?_0x3d781d['options'][_0xa57c('0x1a')]||null:null,'attributes':_0x3d781d[_0xa57c('0x18')]?_0x3d781d[_0xa57c('0x18')][_0xa57c('0x1b')]||null:null,'limit':_0x3d781d['options']?_0x3d781d[_0xa57c('0x18')][_0xa57c('0x1c')]||null:null,'include':_0x3d781d[_0xa57c('0x18')]?_0x3d781d[_0xa57c('0x18')][_0xa57c('0x1d')]?_[_0xa57c('0x1e')](_0x3d781d[_0xa57c('0x18')][_0xa57c('0x1d')],function(_0x2e99ed){return{'model':db[_0x2e99ed[_0xa57c('0x1f')]],'as':_0x2e99ed['as'],'attributes':_0x2e99ed[_0xa57c('0x1b')],'include':_0x2e99ed[_0xa57c('0x1d')]?_[_0xa57c('0x1e')](_0x2e99ed[_0xa57c('0x1d')],function(_0x431bec){return{'model':db[_0x431bec['model']],'as':_0x431bec['as'],'attributes':_0x431bec[_0xa57c('0x1b')],'include':_0x431bec[_0xa57c('0x1d')]?_[_0xa57c('0x1e')](_0x431bec[_0xa57c('0x1d')],function(_0x315ad7){return{'model':db[_0x315ad7[_0xa57c('0x1f')]],'as':_0x315ad7['as'],'attributes':_0x315ad7[_0xa57c('0x1b')]};}):[]};}):[]};}):[]:[]})[_0xa57c('0x20')](function(_0x337f97){logger[_0xa57c('0xc')]('GetZohoAccount',_0x3d781d);logger[_0xa57c('0x21')]('GetZohoAccount',_0x3d781d,JSON['stringify'](_0x337f97));_0xe3d505(_0x337f97);})[_0xa57c('0x14')](function(_0x7d10ec){logger['error'](_0xa57c('0x15'),_0x7d10ec[_0xa57c('0x12')],_0x3d781d);_0x1fd0d8(_0x93462c[_0xa57c('0xf')](0x1f4,_0x7d10ec['message']));});});};exports[_0xa57c('0x22')]=function(_0x58d46f){var _0xf5f70c=this;return new Promise(function(_0x5464f2,_0x2a3bbe){return db['ZohoAccount'][_0xa57c('0x23')]({'raw':_0x58d46f['options']?_0x58d46f[_0xa57c('0x18')][_0xa57c('0x19')]===undefined?!![]:![]:!![],'where':_0x58d46f[_0xa57c('0x18')]?_0x58d46f[_0xa57c('0x18')][_0xa57c('0x1a')]||null:null,'attributes':_0x58d46f[_0xa57c('0x18')]?_0x58d46f[_0xa57c('0x18')]['attributes']||null:null,'include':_0x58d46f[_0xa57c('0x18')]?_0x58d46f['options'][_0xa57c('0x1d')]?_[_0xa57c('0x1e')](_0x58d46f[_0xa57c('0x18')]['include'],function(_0x289174){return{'model':db[_0x289174['model']],'as':_0x289174['as'],'attributes':_0x289174[_0xa57c('0x1b')],'include':_0x289174['include']?_[_0xa57c('0x1e')](_0x289174['include'],function(_0x433116){return{'model':db[_0x433116[_0xa57c('0x1f')]],'as':_0x433116['as'],'attributes':_0x433116['attributes'],'include':_0x433116[_0xa57c('0x1d')]?_['map'](_0x433116[_0xa57c('0x1d')],function(_0x5c56d3){return{'model':db[_0x5c56d3[_0xa57c('0x1f')]],'as':_0x5c56d3['as'],'attributes':_0x5c56d3[_0xa57c('0x1b')]};}):[]};}):[]};}):[]:[]})[_0xa57c('0x20')](function(_0x62f697){logger[_0xa57c('0xc')](_0xa57c('0x22'),_0x58d46f);logger['debug']('ShowZohoAccount',_0x58d46f,JSON[_0xa57c('0x24')](_0x62f697));_0x5464f2(_0x62f697);})[_0xa57c('0x14')](function(_0x2c70d6){logger['error'](_0xa57c('0x22'),_0x2c70d6['message'],_0x58d46f);_0x2a3bbe(_0xf5f70c[_0xa57c('0xf')](0x1f4,_0x2c70d6[_0xa57c('0x12')]));});});}; \ No newline at end of file diff --git a/server/api/intZohoConfiguration/index.js b/server/api/intZohoConfiguration/index.js index 12b5de8..7192791 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 _0x9853=['../../components/auth/service','./intZohoConfiguration.controller','get','index','isAuthenticated','show','/:id/fields','getFields','/:id/subjects','/:id/descriptions','getDescriptions','post','create','put','/:id','update','delete','destroy','exports','multer','util','express','fs-extra'];(function(_0x2dafbe,_0x5d04de){var _0x58a45a=function(_0x50ac96){while(--_0x50ac96){_0x2dafbe['push'](_0x2dafbe['shift']());}};_0x58a45a(++_0x5d04de);}(_0x9853,0x86));var _0x3985=function(_0x562362,_0x5d54f4){_0x562362=_0x562362-0x0;var _0x3a18ce=_0x9853[_0x562362];return _0x3a18ce;};'use strict';var multer=require(_0x3985('0x0'));var util=require(_0x3985('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0x3985('0x2'));var router=express['Router']();var fs_extra=require(_0x3985('0x3'));var auth=require(_0x3985('0x4'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0x3985('0x5'));router[_0x3985('0x6')]('/',auth['isAuthenticated'](),controller[_0x3985('0x7')]);router['get']('/:id',auth[_0x3985('0x8')](),controller[_0x3985('0x9')]);router[_0x3985('0x6')](_0x3985('0xa'),auth[_0x3985('0x8')](),controller[_0x3985('0xb')]);router[_0x3985('0x6')](_0x3985('0xc'),auth[_0x3985('0x8')](),controller['getSubjects']);router[_0x3985('0x6')](_0x3985('0xd'),auth['isAuthenticated'](),controller[_0x3985('0xe')]);router[_0x3985('0xf')]('/',auth[_0x3985('0x8')](),controller[_0x3985('0x10')]);router[_0x3985('0x11')](_0x3985('0x12'),auth[_0x3985('0x8')](),controller[_0x3985('0x13')]);router[_0x3985('0x14')](_0x3985('0x12'),auth[_0x3985('0x8')](),controller[_0x3985('0x15')]);module[_0x3985('0x16')]=router; \ No newline at end of file +var _0xc1d2=['get','isAuthenticated','/:id','show','getSubjects','/:id/descriptions','getDescriptions','post','create','put','update','destroy','util','path','Router','fs-extra','../../components/auth/service','../../components/interaction/service'];(function(_0x11de8b,_0x2d5972){var _0x4d15c5=function(_0x48d8ab){while(--_0x48d8ab){_0x11de8b['push'](_0x11de8b['shift']());}};_0x4d15c5(++_0x2d5972);}(_0xc1d2,0x8a));var _0x2c1d=function(_0x4ccb12,_0x892a4f){_0x4ccb12=_0x4ccb12-0x0;var _0x1d13cf=_0xc1d2[_0x4ccb12];return _0x1d13cf;};'use strict';var multer=require('multer');var util=require(_0x2c1d('0x0'));var path=require(_0x2c1d('0x1'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x2c1d('0x2')]();var fs_extra=require(_0x2c1d('0x3'));var auth=require(_0x2c1d('0x4'));var interaction=require(_0x2c1d('0x5'));var config=require('../../config/environment');var controller=require('./intZohoConfiguration.controller');router[_0x2c1d('0x6')]('/',auth[_0x2c1d('0x7')](),controller['index']);router[_0x2c1d('0x6')](_0x2c1d('0x8'),auth[_0x2c1d('0x7')](),controller[_0x2c1d('0x9')]);router[_0x2c1d('0x6')]('/:id/fields',auth[_0x2c1d('0x7')](),controller['getFields']);router['get']('/:id/subjects',auth[_0x2c1d('0x7')](),controller[_0x2c1d('0xa')]);router[_0x2c1d('0x6')](_0x2c1d('0xb'),auth[_0x2c1d('0x7')](),controller[_0x2c1d('0xc')]);router[_0x2c1d('0xd')]('/',auth[_0x2c1d('0x7')](),controller[_0x2c1d('0xe')]);router[_0x2c1d('0xf')]('/:id',auth[_0x2c1d('0x7')](),controller[_0x2c1d('0x10')]);router['delete'](_0x2c1d('0x8'),auth[_0x2c1d('0x7')](),controller[_0x2c1d('0x11')]);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 18193cb..8412e3e 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 _0x645e=['nothing','contact','contact_lead','sequelize','exports','STRING','ENUM','lead'];(function(_0x1cc8fe,_0x105328){var _0x230054=function(_0x1a1b56){while(--_0x1a1b56){_0x1cc8fe['push'](_0x1cc8fe['shift']());}};_0x230054(++_0x105328);}(_0x645e,0x16b));var _0xe645=function(_0x306f97,_0x1894a3){_0x306f97=_0x306f97-0x0;var _0x53837d=_0x645e[_0x306f97];return _0x53837d;};'use strict';var Sequelize=require(_0xe645('0x0'));module[_0xe645('0x1')]={'name':{'type':Sequelize[_0xe645('0x2')]},'moduleCreate':{'type':Sequelize[_0xe645('0x3')](_0xe645('0x4'),'contact',_0xe645('0x5')),'defaultValue':_0xe645('0x4')},'moduleSearch':{'type':Sequelize['ENUM']('contact_lead',_0xe645('0x6'),'lead'),'defaultValue':_0xe645('0x7')},'description':{'type':Sequelize[_0xe645('0x2')]}}; \ No newline at end of file +var _0x6b14=['exports','STRING','ENUM','lead','contact','contact_lead'];(function(_0xfb6a1,_0xdcbdf){var _0x4a5225=function(_0x566717){while(--_0x566717){_0xfb6a1['push'](_0xfb6a1['shift']());}};_0x4a5225(++_0xdcbdf);}(_0x6b14,0x102));var _0x46b1=function(_0x2a4c54,_0x3b008e){_0x2a4c54=_0x2a4c54-0x0;var _0xc95cc=_0x6b14[_0x2a4c54];return _0xc95cc;};'use strict';var Sequelize=require('sequelize');module[_0x46b1('0x0')]={'name':{'type':Sequelize[_0x46b1('0x1')]},'moduleCreate':{'type':Sequelize[_0x46b1('0x2')](_0x46b1('0x3'),_0x46b1('0x4'),'nothing'),'defaultValue':_0x46b1('0x3')},'moduleSearch':{'type':Sequelize[_0x46b1('0x2')](_0x46b1('0x5'),_0x46b1('0x4'),_0x46b1('0x3')),'defaultValue':_0x46b1('0x5')},'description':{'type':Sequelize[_0x46b1('0x1')]}}; \ No newline at end of file diff --git a/server/api/intZohoConfiguration/intZohoConfiguration.controller.js b/server/api/intZohoConfiguration/intZohoConfiguration.controller.js index 80bbc5c..20221fb 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 _0x1545=['include','rows','show','params','rawAttributes','length','includeAll','find','create','body','catch','update','getFields','ZohoField','order','hasOwnProperty','getSubjects','findOne','getDescriptions','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','fs-extra','squel','crypto','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','json','offset','limit','undefined','count','set','apply','destroy','then','end','error','stack','name','map','ZohoConfiguration','fieldName','type','key','model','keys','query','intersection','attributes','fields','nolimit','sort','where','filters','pick','merge','VIRTUAL','filter','options'];(function(_0x55f8b4,_0x43f30d){var _0x2475f9=function(_0xdd6f4a){while(--_0xdd6f4a){_0x55f8b4['push'](_0x55f8b4['shift']());}};_0x2475f9(++_0x43f30d);}(_0x1545,0x1e7));var _0x5154=function(_0x598efc,_0x5e971c){_0x598efc=_0x598efc-0x0;var _0x435e4f=_0x1545[_0x598efc];return _0x435e4f;};'use strict';var emlformat=require(_0x5154('0x0'));var rimraf=require(_0x5154('0x1'));var zipdir=require(_0x5154('0x2'));var jsonpatch=require(_0x5154('0x3'));var rp=require(_0x5154('0x4'));var moment=require(_0x5154('0x5'));var BPromise=require(_0x5154('0x6'));var Mustache=require(_0x5154('0x7'));var util=require(_0x5154('0x8'));var path=require(_0x5154('0x9'));var sox=require(_0x5154('0xa'));var csv=require(_0x5154('0xb'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x5154('0xc'));var _=require('lodash');var squel=require(_0x5154('0xd'));var crypto=require(_0x5154('0xe'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0x5154('0xb'));var querystring=require('querystring');var Papa=require(_0x5154('0xf'));var Redis=require(_0x5154('0x10'));var authService=require(_0x5154('0x11'));var qs=require('../../components/parsers/qs');var as=require(_0x5154('0x12'));var hardwareService=require(_0x5154('0x13'));var logger=require('../../config/logger')(_0x5154('0x14'));var utils=require(_0x5154('0x15'));var config=require(_0x5154('0x16'));var licenseUtil=require('../../config/license/util');var db=require(_0x5154('0x17'))['db'];function respondWithStatusCode(_0x177a58,_0x35849c){_0x35849c=_0x35849c||0xcc;return function(_0x28c7e6){if(_0x28c7e6){return _0x177a58[_0x5154('0x18')](_0x35849c);}return _0x177a58[_0x5154('0x19')](_0x35849c)['end']();};}function respondWithResult(_0xb02dac,_0x2381b8){_0x2381b8=_0x2381b8||0xc8;return function(_0x3874ec){if(_0x3874ec){return _0xb02dac[_0x5154('0x19')](_0x2381b8)[_0x5154('0x1a')](_0x3874ec);}};}function respondWithFilteredResult(_0x18cb39,_0x23869b){return function(_0x4efff0){if(_0x4efff0){var _0x279820=typeof _0x23869b[_0x5154('0x1b')]==='undefined'&&typeof _0x23869b[_0x5154('0x1c')]===_0x5154('0x1d');var _0x7e7e47=_0x4efff0[_0x5154('0x1e')];var _0x2671ec=_0x279820?0x0:_0x23869b['offset'];var _0x73e0b5=_0x279820?_0x4efff0[_0x5154('0x1e')]:_0x23869b['offset']+_0x23869b[_0x5154('0x1c')];var _0x1f549e;if(_0x73e0b5>=_0x7e7e47){_0x73e0b5=_0x7e7e47;_0x1f549e=0xc8;}else{_0x1f549e=0xce;}_0x18cb39[_0x5154('0x19')](_0x1f549e);return _0x18cb39[_0x5154('0x1f')]('Content-Range',_0x2671ec+'-'+_0x73e0b5+'/'+_0x7e7e47)[_0x5154('0x1a')](_0x4efff0);}return null;};}function patchUpdates(_0xfc1001){return function(_0xd8757){try{jsonpatch[_0x5154('0x20')](_0xd8757,_0xfc1001,!![]);}catch(_0x446dd6){return BPromise['reject'](_0x446dd6);}return _0xd8757['save']();};}function saveUpdates(_0x5cd776,_0x3e250e){return function(_0xaca195){if(_0xaca195){return _0xaca195['update'](_0x5cd776)['then'](function(_0x5d8c6c){return _0x5d8c6c;});}return null;};}function removeEntity(_0x3a2d00,_0x534615){return function(_0x27adae){if(_0x27adae){return _0x27adae[_0x5154('0x21')]()[_0x5154('0x22')](function(){_0x3a2d00[_0x5154('0x19')](0xcc)[_0x5154('0x23')]();});}};}function handleEntityNotFound(_0x5de8df,_0xcd5aa0){return function(_0x19b725){if(!_0x19b725){_0x5de8df['sendStatus'](0x194);}return _0x19b725;};}function handleError(_0x42ed94,_0x2861c0){_0x2861c0=_0x2861c0||0x1f4;return function(_0xee6934){logger[_0x5154('0x24')](_0xee6934[_0x5154('0x25')]);if(_0xee6934[_0x5154('0x26')]){delete _0xee6934['name'];}_0x42ed94[_0x5154('0x19')](_0x2861c0)['send'](_0xee6934);};}exports['index']=function(_0x54bd33,_0xb4f7ac){var _0x51081={},_0x42bccb={},_0x3ceb62={'count':0x0,'rows':[]};var _0x3cdfe5=_[_0x5154('0x27')](db[_0x5154('0x28')]['rawAttributes'],function(_0x447be1){return{'name':_0x447be1[_0x5154('0x29')],'type':_0x447be1[_0x5154('0x2a')][_0x5154('0x2b')]};});_0x42bccb[_0x5154('0x2c')]=_[_0x5154('0x27')](_0x3cdfe5,'name');_0x42bccb['query']=_[_0x5154('0x2d')](_0x54bd33[_0x5154('0x2e')]);_0x42bccb['filters']=_[_0x5154('0x2f')](_0x42bccb[_0x5154('0x2c')],_0x42bccb['query']);_0x51081[_0x5154('0x30')]=_[_0x5154('0x2f')](_0x42bccb['model'],qs['fields'](_0x54bd33['query'][_0x5154('0x31')]));_0x51081[_0x5154('0x30')]=_0x51081[_0x5154('0x30')]['length']?_0x51081['attributes']:_0x42bccb[_0x5154('0x2c')];if(!_0x54bd33[_0x5154('0x2e')]['hasOwnProperty'](_0x5154('0x32'))){_0x51081[_0x5154('0x1c')]=qs[_0x5154('0x1c')](_0x54bd33[_0x5154('0x2e')][_0x5154('0x1c')]);_0x51081[_0x5154('0x1b')]=qs[_0x5154('0x1b')](_0x54bd33[_0x5154('0x2e')][_0x5154('0x1b')]);}_0x51081['order']=qs[_0x5154('0x33')](_0x54bd33[_0x5154('0x2e')]['sort']);_0x51081[_0x5154('0x34')]=qs[_0x5154('0x35')](_[_0x5154('0x36')](_0x54bd33[_0x5154('0x2e')],_0x42bccb[_0x5154('0x35')]),_0x3cdfe5);if(_0x54bd33[_0x5154('0x2e')]['filter']){_0x51081[_0x5154('0x34')]=_[_0x5154('0x37')](_0x51081['where'],{'$or':_[_0x5154('0x27')](_0x3cdfe5,function(_0x2a7dbc){if(_0x2a7dbc[_0x5154('0x2a')]!==_0x5154('0x38')){var _0x1dfb53={};_0x1dfb53[_0x2a7dbc[_0x5154('0x26')]]={'$like':'%'+_0x54bd33[_0x5154('0x2e')][_0x5154('0x39')]+'%'};return _0x1dfb53;}})});}_0x51081=_[_0x5154('0x37')]({},_0x51081,_0x54bd33[_0x5154('0x3a')]);var _0x2c0c32={'where':_0x51081[_0x5154('0x34')]};return db['ZohoConfiguration'][_0x5154('0x1e')](_0x2c0c32)[_0x5154('0x22')](function(_0x4d2dae){_0x3ceb62[_0x5154('0x1e')]=_0x4d2dae;if(_0x54bd33[_0x5154('0x2e')]['includeAll']){_0x51081[_0x5154('0x3b')]=[{'all':!![]}];}return db['ZohoConfiguration']['findAll'](_0x51081);})[_0x5154('0x22')](function(_0x3d7e2e){_0x3ceb62[_0x5154('0x3c')]=_0x3d7e2e;return _0x3ceb62;})['then'](respondWithFilteredResult(_0xb4f7ac,_0x51081))['catch'](handleError(_0xb4f7ac,null));};exports[_0x5154('0x3d')]=function(_0x798bfd,_0x425176){var _0x116ccc={'raw':![],'where':{'id':_0x798bfd[_0x5154('0x3e')]['id']}},_0x1623e7={};_0x1623e7[_0x5154('0x2c')]=_[_0x5154('0x2d')](db[_0x5154('0x28')][_0x5154('0x3f')]);_0x1623e7[_0x5154('0x2e')]=_[_0x5154('0x2d')](_0x798bfd[_0x5154('0x2e')]);_0x1623e7[_0x5154('0x35')]=_['intersection'](_0x1623e7[_0x5154('0x2c')],_0x1623e7['query']);_0x116ccc[_0x5154('0x30')]=_[_0x5154('0x2f')](_0x1623e7[_0x5154('0x2c')],qs[_0x5154('0x31')](_0x798bfd[_0x5154('0x2e')][_0x5154('0x31')]));_0x116ccc[_0x5154('0x30')]=_0x116ccc['attributes'][_0x5154('0x40')]?_0x116ccc[_0x5154('0x30')]:_0x1623e7[_0x5154('0x2c')];if(_0x798bfd[_0x5154('0x2e')][_0x5154('0x41')]){_0x116ccc[_0x5154('0x3b')]=[{'all':!![]}];}_0x116ccc=_[_0x5154('0x37')]({},_0x116ccc,_0x798bfd['options']);return db[_0x5154('0x28')][_0x5154('0x42')](_0x116ccc)[_0x5154('0x22')](handleEntityNotFound(_0x425176,null))[_0x5154('0x22')](respondWithResult(_0x425176,null))['catch'](handleError(_0x425176,null));};exports[_0x5154('0x43')]=function(_0x1e3a53,_0x2d8eca){return db['ZohoConfiguration'][_0x5154('0x43')](_0x1e3a53[_0x5154('0x44')],{})[_0x5154('0x22')](respondWithResult(_0x2d8eca,0xc9))[_0x5154('0x45')](handleError(_0x2d8eca,null));};exports[_0x5154('0x46')]=function(_0x3b41e0,_0x1ce92f){if(_0x3b41e0['body']['id']){delete _0x3b41e0[_0x5154('0x44')]['id'];}return db[_0x5154('0x28')][_0x5154('0x42')]({'where':{'id':_0x3b41e0[_0x5154('0x3e')]['id']}})[_0x5154('0x22')](handleEntityNotFound(_0x1ce92f,null))[_0x5154('0x22')](saveUpdates(_0x3b41e0['body'],null))['then'](respondWithResult(_0x1ce92f,null))['catch'](handleError(_0x1ce92f,null));};exports[_0x5154('0x21')]=function(_0x52d49b,_0x2c98c8){return db['ZohoConfiguration'][_0x5154('0x42')]({'where':{'id':_0x52d49b[_0x5154('0x3e')]['id']}})[_0x5154('0x22')](handleEntityNotFound(_0x2c98c8,null))[_0x5154('0x22')](removeEntity(_0x2c98c8,null))['catch'](handleError(_0x2c98c8,null));};exports[_0x5154('0x47')]=function(_0x51d763,_0x92064b,_0x5381f3){var _0xc5622b={};var _0x5283b0={};var _0x540a7f;var _0x14fd43;return db['ZohoConfiguration']['findOne']({'where':{'id':_0x51d763['params']['id']}})['then'](handleEntityNotFound(_0x92064b,null))[_0x5154('0x22')](function(_0xee19a5){if(_0xee19a5){_0x540a7f=_0xee19a5;_0x5283b0['model']=_[_0x5154('0x2d')](db[_0x5154('0x48')][_0x5154('0x3f')]);_0x5283b0[_0x5154('0x2e')]=_[_0x5154('0x2d')](_0x51d763[_0x5154('0x2e')]);_0x5283b0[_0x5154('0x35')]=_[_0x5154('0x2f')](_0x5283b0[_0x5154('0x2c')],_0x5283b0[_0x5154('0x2e')]);_0xc5622b[_0x5154('0x30')]=_[_0x5154('0x2f')](_0x5283b0[_0x5154('0x2c')],qs[_0x5154('0x31')](_0x51d763[_0x5154('0x2e')][_0x5154('0x31')]));_0xc5622b[_0x5154('0x30')]=_0xc5622b[_0x5154('0x30')][_0x5154('0x40')]?_0xc5622b['attributes']:_0x5283b0['model'];_0xc5622b[_0x5154('0x49')]=qs[_0x5154('0x33')](_0x51d763[_0x5154('0x2e')]['sort']);_0xc5622b[_0x5154('0x34')]=qs['filters'](_[_0x5154('0x36')](_0x51d763[_0x5154('0x2e')],_0x5283b0[_0x5154('0x35')]));if(_0x51d763[_0x5154('0x2e')]['filter']){_0xc5622b[_0x5154('0x34')]=_[_0x5154('0x37')](_0xc5622b[_0x5154('0x34')],{'$or':_['map'](_0xc5622b['attributes'],function(_0x3eaddb){var _0x4cac47={};_0x4cac47[_0x3eaddb]={'$like':'%'+_0x51d763[_0x5154('0x2e')][_0x5154('0x39')]+'%'};return _0x4cac47;})});}_0xc5622b=_[_0x5154('0x37')]({},_0xc5622b,_0x51d763[_0x5154('0x3a')]);return _0x540a7f[_0x5154('0x47')](_0xc5622b);}})[_0x5154('0x22')](function(_0x5e93be){if(_0x5e93be){_0x14fd43=_0x5e93be[_0x5154('0x40')];if(!_0x51d763[_0x5154('0x2e')][_0x5154('0x4a')](_0x5154('0x32'))){_0xc5622b['limit']=qs[_0x5154('0x1c')](_0x51d763[_0x5154('0x2e')][_0x5154('0x1c')]);_0xc5622b[_0x5154('0x1b')]=qs[_0x5154('0x1b')](_0x51d763['query'][_0x5154('0x1b')]);}return _0x540a7f['getFields'](_0xc5622b);}})[_0x5154('0x22')](function(_0x4b1eec){if(_0x4b1eec){return _0x4b1eec?{'count':_0x14fd43,'rows':_0x4b1eec}:null;}})[_0x5154('0x22')](respondWithResult(_0x92064b,null))['catch'](handleError(_0x92064b,null));};exports[_0x5154('0x4b')]=function(_0x54079d,_0x462363,_0xe524d3){var _0x23957e={};var _0x1b26c3={};var _0x4bf091;var _0x385b55;return db[_0x5154('0x28')][_0x5154('0x4c')]({'where':{'id':_0x54079d['params']['id']}})[_0x5154('0x22')](handleEntityNotFound(_0x462363,null))['then'](function(_0x5148fb){if(_0x5148fb){_0x4bf091=_0x5148fb;_0x1b26c3[_0x5154('0x2c')]=_[_0x5154('0x2d')](db[_0x5154('0x48')][_0x5154('0x3f')]);_0x1b26c3[_0x5154('0x2e')]=_[_0x5154('0x2d')](_0x54079d[_0x5154('0x2e')]);_0x1b26c3['filters']=_['intersection'](_0x1b26c3[_0x5154('0x2c')],_0x1b26c3['query']);_0x23957e['attributes']=_[_0x5154('0x2f')](_0x1b26c3[_0x5154('0x2c')],qs[_0x5154('0x31')](_0x54079d['query']['fields']));_0x23957e[_0x5154('0x30')]=_0x23957e[_0x5154('0x30')]['length']?_0x23957e[_0x5154('0x30')]:_0x1b26c3[_0x5154('0x2c')];_0x23957e['order']=qs['sort'](_0x54079d[_0x5154('0x2e')][_0x5154('0x33')]);_0x23957e['where']=qs[_0x5154('0x35')](_[_0x5154('0x36')](_0x54079d[_0x5154('0x2e')],_0x1b26c3[_0x5154('0x35')]));if(_0x54079d['query'][_0x5154('0x39')]){_0x23957e[_0x5154('0x34')]=_[_0x5154('0x37')](_0x23957e['where'],{'$or':_[_0x5154('0x27')](_0x23957e[_0x5154('0x30')],function(_0x24dd6f){var _0x3aa858={};_0x3aa858[_0x24dd6f]={'$like':'%'+_0x54079d['query'][_0x5154('0x39')]+'%'};return _0x3aa858;})});}_0x23957e=_[_0x5154('0x37')]({},_0x23957e,_0x54079d['options']);return _0x4bf091['getSubjects'](_0x23957e);}})['then'](function(_0x2ae9d3){if(_0x2ae9d3){_0x385b55=_0x2ae9d3[_0x5154('0x40')];if(!_0x54079d['query']['hasOwnProperty'](_0x5154('0x32'))){_0x23957e['limit']=qs['limit'](_0x54079d[_0x5154('0x2e')]['limit']);_0x23957e[_0x5154('0x1b')]=qs[_0x5154('0x1b')](_0x54079d[_0x5154('0x2e')][_0x5154('0x1b')]);}return _0x4bf091[_0x5154('0x4b')](_0x23957e);}})['then'](function(_0x570fb9){if(_0x570fb9){return _0x570fb9?{'count':_0x385b55,'rows':_0x570fb9}:null;}})['then'](respondWithResult(_0x462363,null))[_0x5154('0x45')](handleError(_0x462363,null));};exports['getDescriptions']=function(_0x1aade5,_0x5e5182,_0x11203d){var _0x5bec67={};var _0x1ffb4f={};var _0x2c1758;var _0x5d31a4;return db['ZohoConfiguration'][_0x5154('0x4c')]({'where':{'id':_0x1aade5[_0x5154('0x3e')]['id']}})[_0x5154('0x22')](handleEntityNotFound(_0x5e5182,null))[_0x5154('0x22')](function(_0x3cf746){if(_0x3cf746){_0x2c1758=_0x3cf746;_0x1ffb4f[_0x5154('0x2c')]=_[_0x5154('0x2d')](db[_0x5154('0x48')][_0x5154('0x3f')]);_0x1ffb4f[_0x5154('0x2e')]=_['keys'](_0x1aade5[_0x5154('0x2e')]);_0x1ffb4f['filters']=_[_0x5154('0x2f')](_0x1ffb4f[_0x5154('0x2c')],_0x1ffb4f[_0x5154('0x2e')]);_0x5bec67[_0x5154('0x30')]=_[_0x5154('0x2f')](_0x1ffb4f[_0x5154('0x2c')],qs[_0x5154('0x31')](_0x1aade5['query'][_0x5154('0x31')]));_0x5bec67[_0x5154('0x30')]=_0x5bec67['attributes'][_0x5154('0x40')]?_0x5bec67[_0x5154('0x30')]:_0x1ffb4f['model'];_0x5bec67['order']=qs['sort'](_0x1aade5[_0x5154('0x2e')][_0x5154('0x33')]);_0x5bec67[_0x5154('0x34')]=qs[_0x5154('0x35')](_[_0x5154('0x36')](_0x1aade5[_0x5154('0x2e')],_0x1ffb4f['filters']));if(_0x1aade5[_0x5154('0x2e')][_0x5154('0x39')]){_0x5bec67[_0x5154('0x34')]=_[_0x5154('0x37')](_0x5bec67[_0x5154('0x34')],{'$or':_[_0x5154('0x27')](_0x5bec67[_0x5154('0x30')],function(_0x31a4d0){var _0x31b793={};_0x31b793[_0x31a4d0]={'$like':'%'+_0x1aade5[_0x5154('0x2e')][_0x5154('0x39')]+'%'};return _0x31b793;})});}_0x5bec67=_[_0x5154('0x37')]({},_0x5bec67,_0x1aade5[_0x5154('0x3a')]);return _0x2c1758[_0x5154('0x4d')](_0x5bec67);}})[_0x5154('0x22')](function(_0x54483b){if(_0x54483b){_0x5d31a4=_0x54483b[_0x5154('0x40')];if(!_0x1aade5[_0x5154('0x2e')][_0x5154('0x4a')](_0x5154('0x32'))){_0x5bec67['limit']=qs[_0x5154('0x1c')](_0x1aade5[_0x5154('0x2e')][_0x5154('0x1c')]);_0x5bec67[_0x5154('0x1b')]=qs[_0x5154('0x1b')](_0x1aade5[_0x5154('0x2e')]['offset']);}return _0x2c1758[_0x5154('0x4d')](_0x5bec67);}})[_0x5154('0x22')](function(_0x3d0a02){if(_0x3d0a02){return _0x3d0a02?{'count':_0x5d31a4,'rows':_0x3d0a02}:null;}})[_0x5154('0x22')](respondWithResult(_0x5e5182,null))[_0x5154('0x45')](handleError(_0x5e5182,null));}; \ No newline at end of file +var _0x2a01=['error','stack','map','rawAttributes','fieldName','query','keys','filters','model','attributes','intersection','fields','length','hasOwnProperty','nolimit','order','sort','where','filter','merge','options','ZohoConfiguration','includeAll','include','findAll','then','rows','show','params','find','create','body','catch','destroy','getFields','findOne','pick','getSubjects','ZohoField','getDescriptions','eml-format','rimraf','fast-json-patch','moment','bluebird','path','sox','to-csv','ejs','fs-extra','squel','crypto','desk.js','papaparse','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','status','end','json','offset','limit','undefined','count','Content-Range','reject','update','sendStatus'];(function(_0x13594e,_0x6f0ed0){var _0x1a4f42=function(_0x30b064){while(--_0x30b064){_0x13594e['push'](_0x13594e['shift']());}};_0x1a4f42(++_0x6f0ed0);}(_0x2a01,0x70));var _0x12a0=function(_0x2235bf,_0x3a06a7){_0x2235bf=_0x2235bf-0x0;var _0x4c3a64=_0x2a01[_0x2235bf];return _0x4c3a64;};'use strict';var emlformat=require(_0x12a0('0x0'));var rimraf=require(_0x12a0('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x12a0('0x2'));var rp=require('request-promise');var moment=require(_0x12a0('0x3'));var BPromise=require(_0x12a0('0x4'));var Mustache=require('mustache');var util=require('util');var path=require(_0x12a0('0x5'));var sox=require(_0x12a0('0x6'));var csv=require(_0x12a0('0x7'));var ejs=require(_0x12a0('0x8'));var fs=require('fs');var fs_extra=require(_0x12a0('0x9'));var _=require('lodash');var squel=require(_0x12a0('0xa'));var crypto=require(_0x12a0('0xb'));var jsforce=require('jsforce');var deskjs=require(_0x12a0('0xc'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x12a0('0xd'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0x12a0('0xe'));var hardwareService=require(_0x12a0('0xf'));var logger=require(_0x12a0('0x10'))(_0x12a0('0x11'));var utils=require('../../config/utils');var config=require(_0x12a0('0x12'));var licenseUtil=require(_0x12a0('0x13'));var db=require(_0x12a0('0x14'))['db'];function respondWithStatusCode(_0x35ea39,_0x52f6f9){_0x52f6f9=_0x52f6f9||0xcc;return function(_0x54d81e){if(_0x54d81e){return _0x35ea39['sendStatus'](_0x52f6f9);}return _0x35ea39[_0x12a0('0x15')](_0x52f6f9)[_0x12a0('0x16')]();};}function respondWithResult(_0x549a8f,_0x2c00b0){_0x2c00b0=_0x2c00b0||0xc8;return function(_0x1ac740){if(_0x1ac740){return _0x549a8f[_0x12a0('0x15')](_0x2c00b0)[_0x12a0('0x17')](_0x1ac740);}};}function respondWithFilteredResult(_0x412ece,_0x5aea92){return function(_0x5ac096){if(_0x5ac096){var _0x24d88c=typeof _0x5aea92[_0x12a0('0x18')]==='undefined'&&typeof _0x5aea92[_0x12a0('0x19')]===_0x12a0('0x1a');var _0xcef704=_0x5ac096[_0x12a0('0x1b')];var _0x258e61=_0x24d88c?0x0:_0x5aea92[_0x12a0('0x18')];var _0x173454=_0x24d88c?_0x5ac096[_0x12a0('0x1b')]:_0x5aea92[_0x12a0('0x18')]+_0x5aea92[_0x12a0('0x19')];var _0x13d73e;if(_0x173454>=_0xcef704){_0x173454=_0xcef704;_0x13d73e=0xc8;}else{_0x13d73e=0xce;}_0x412ece['status'](_0x13d73e);return _0x412ece['set'](_0x12a0('0x1c'),_0x258e61+'-'+_0x173454+'/'+_0xcef704)['json'](_0x5ac096);}return null;};}function patchUpdates(_0x30686e){return function(_0x56da84){try{jsonpatch['apply'](_0x56da84,_0x30686e,!![]);}catch(_0x3b8b11){return BPromise[_0x12a0('0x1d')](_0x3b8b11);}return _0x56da84['save']();};}function saveUpdates(_0x72544e,_0x16fc52){return function(_0x5083d0){if(_0x5083d0){return _0x5083d0[_0x12a0('0x1e')](_0x72544e)['then'](function(_0x5e0682){return _0x5e0682;});}return null;};}function removeEntity(_0x3568bb,_0x2e422b){return function(_0x1756e7){if(_0x1756e7){return _0x1756e7['destroy']()['then'](function(){_0x3568bb['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x45c45b,_0x4f5283){return function(_0x16a5a4){if(!_0x16a5a4){_0x45c45b[_0x12a0('0x1f')](0x194);}return _0x16a5a4;};}function handleError(_0x46ce80,_0x51f94b){_0x51f94b=_0x51f94b||0x1f4;return function(_0x4249fa){logger[_0x12a0('0x20')](_0x4249fa[_0x12a0('0x21')]);if(_0x4249fa['name']){delete _0x4249fa['name'];}_0x46ce80[_0x12a0('0x15')](_0x51f94b)['send'](_0x4249fa);};}exports['index']=function(_0x1d6e27,_0x495168){var _0x3d6db2={},_0x167a9a={},_0x4d44fd={'count':0x0,'rows':[]};var _0x20d8f5=_[_0x12a0('0x22')](db['ZohoConfiguration'][_0x12a0('0x23')],function(_0xbaea38){return{'name':_0xbaea38[_0x12a0('0x24')],'type':_0xbaea38['type']['key']};});_0x167a9a['model']=_['map'](_0x20d8f5,'name');_0x167a9a[_0x12a0('0x25')]=_[_0x12a0('0x26')](_0x1d6e27['query']);_0x167a9a[_0x12a0('0x27')]=_['intersection'](_0x167a9a[_0x12a0('0x28')],_0x167a9a['query']);_0x3d6db2[_0x12a0('0x29')]=_[_0x12a0('0x2a')](_0x167a9a[_0x12a0('0x28')],qs['fields'](_0x1d6e27[_0x12a0('0x25')][_0x12a0('0x2b')]));_0x3d6db2[_0x12a0('0x29')]=_0x3d6db2[_0x12a0('0x29')][_0x12a0('0x2c')]?_0x3d6db2[_0x12a0('0x29')]:_0x167a9a['model'];if(!_0x1d6e27[_0x12a0('0x25')][_0x12a0('0x2d')](_0x12a0('0x2e'))){_0x3d6db2[_0x12a0('0x19')]=qs[_0x12a0('0x19')](_0x1d6e27[_0x12a0('0x25')]['limit']);_0x3d6db2[_0x12a0('0x18')]=qs[_0x12a0('0x18')](_0x1d6e27[_0x12a0('0x25')]['offset']);}_0x3d6db2[_0x12a0('0x2f')]=qs[_0x12a0('0x30')](_0x1d6e27[_0x12a0('0x25')]['sort']);_0x3d6db2[_0x12a0('0x31')]=qs[_0x12a0('0x27')](_['pick'](_0x1d6e27[_0x12a0('0x25')],_0x167a9a['filters']),_0x20d8f5);if(_0x1d6e27[_0x12a0('0x25')][_0x12a0('0x32')]){_0x3d6db2[_0x12a0('0x31')]=_[_0x12a0('0x33')](_0x3d6db2['where'],{'$or':_['map'](_0x20d8f5,function(_0x5257d2){if(_0x5257d2['type']!=='VIRTUAL'){var _0x15bfce={};_0x15bfce[_0x5257d2['name']]={'$like':'%'+_0x1d6e27['query'][_0x12a0('0x32')]+'%'};return _0x15bfce;}})});}_0x3d6db2=_[_0x12a0('0x33')]({},_0x3d6db2,_0x1d6e27[_0x12a0('0x34')]);var _0x370a94={'where':_0x3d6db2[_0x12a0('0x31')]};return db[_0x12a0('0x35')][_0x12a0('0x1b')](_0x370a94)['then'](function(_0x3f6147){_0x4d44fd[_0x12a0('0x1b')]=_0x3f6147;if(_0x1d6e27[_0x12a0('0x25')][_0x12a0('0x36')]){_0x3d6db2[_0x12a0('0x37')]=[{'all':!![]}];}return db[_0x12a0('0x35')][_0x12a0('0x38')](_0x3d6db2);})[_0x12a0('0x39')](function(_0x1ac602){_0x4d44fd[_0x12a0('0x3a')]=_0x1ac602;return _0x4d44fd;})[_0x12a0('0x39')](respondWithFilteredResult(_0x495168,_0x3d6db2))['catch'](handleError(_0x495168,null));};exports[_0x12a0('0x3b')]=function(_0xa4a27a,_0x27e5ef){var _0x476e9c={'raw':![],'where':{'id':_0xa4a27a[_0x12a0('0x3c')]['id']}},_0x2bbfd7={};_0x2bbfd7['model']=_[_0x12a0('0x26')](db[_0x12a0('0x35')][_0x12a0('0x23')]);_0x2bbfd7['query']=_[_0x12a0('0x26')](_0xa4a27a[_0x12a0('0x25')]);_0x2bbfd7[_0x12a0('0x27')]=_['intersection'](_0x2bbfd7['model'],_0x2bbfd7['query']);_0x476e9c['attributes']=_['intersection'](_0x2bbfd7[_0x12a0('0x28')],qs[_0x12a0('0x2b')](_0xa4a27a['query'][_0x12a0('0x2b')]));_0x476e9c[_0x12a0('0x29')]=_0x476e9c[_0x12a0('0x29')][_0x12a0('0x2c')]?_0x476e9c[_0x12a0('0x29')]:_0x2bbfd7[_0x12a0('0x28')];if(_0xa4a27a[_0x12a0('0x25')]['includeAll']){_0x476e9c[_0x12a0('0x37')]=[{'all':!![]}];}_0x476e9c=_[_0x12a0('0x33')]({},_0x476e9c,_0xa4a27a[_0x12a0('0x34')]);return db[_0x12a0('0x35')][_0x12a0('0x3d')](_0x476e9c)[_0x12a0('0x39')](handleEntityNotFound(_0x27e5ef,null))[_0x12a0('0x39')](respondWithResult(_0x27e5ef,null))['catch'](handleError(_0x27e5ef,null));};exports[_0x12a0('0x3e')]=function(_0x5cb480,_0x39df3a){return db['ZohoConfiguration'][_0x12a0('0x3e')](_0x5cb480[_0x12a0('0x3f')],{})['then'](respondWithResult(_0x39df3a,0xc9))[_0x12a0('0x40')](handleError(_0x39df3a,null));};exports['update']=function(_0x50a8e1,_0x431982){if(_0x50a8e1['body']['id']){delete _0x50a8e1['body']['id'];}return db[_0x12a0('0x35')][_0x12a0('0x3d')]({'where':{'id':_0x50a8e1[_0x12a0('0x3c')]['id']}})[_0x12a0('0x39')](handleEntityNotFound(_0x431982,null))[_0x12a0('0x39')](saveUpdates(_0x50a8e1['body'],null))[_0x12a0('0x39')](respondWithResult(_0x431982,null))['catch'](handleError(_0x431982,null));};exports[_0x12a0('0x41')]=function(_0x28e014,_0x19c1f7){return db[_0x12a0('0x35')][_0x12a0('0x3d')]({'where':{'id':_0x28e014['params']['id']}})[_0x12a0('0x39')](handleEntityNotFound(_0x19c1f7,null))[_0x12a0('0x39')](removeEntity(_0x19c1f7,null))[_0x12a0('0x40')](handleError(_0x19c1f7,null));};exports[_0x12a0('0x42')]=function(_0x1f933d,_0x17c9d5,_0x31f932){var _0x25a49c={};var _0x3813b2={};var _0x3ccf58;var _0x57ba3a;return db[_0x12a0('0x35')][_0x12a0('0x43')]({'where':{'id':_0x1f933d[_0x12a0('0x3c')]['id']}})[_0x12a0('0x39')](handleEntityNotFound(_0x17c9d5,null))['then'](function(_0x4385c4){if(_0x4385c4){_0x3ccf58=_0x4385c4;_0x3813b2[_0x12a0('0x28')]=_[_0x12a0('0x26')](db['ZohoField'][_0x12a0('0x23')]);_0x3813b2[_0x12a0('0x25')]=_[_0x12a0('0x26')](_0x1f933d['query']);_0x3813b2[_0x12a0('0x27')]=_[_0x12a0('0x2a')](_0x3813b2[_0x12a0('0x28')],_0x3813b2[_0x12a0('0x25')]);_0x25a49c[_0x12a0('0x29')]=_[_0x12a0('0x2a')](_0x3813b2[_0x12a0('0x28')],qs[_0x12a0('0x2b')](_0x1f933d[_0x12a0('0x25')]['fields']));_0x25a49c[_0x12a0('0x29')]=_0x25a49c[_0x12a0('0x29')][_0x12a0('0x2c')]?_0x25a49c[_0x12a0('0x29')]:_0x3813b2[_0x12a0('0x28')];_0x25a49c[_0x12a0('0x2f')]=qs[_0x12a0('0x30')](_0x1f933d['query'][_0x12a0('0x30')]);_0x25a49c[_0x12a0('0x31')]=qs[_0x12a0('0x27')](_[_0x12a0('0x44')](_0x1f933d['query'],_0x3813b2[_0x12a0('0x27')]));if(_0x1f933d[_0x12a0('0x25')][_0x12a0('0x32')]){_0x25a49c[_0x12a0('0x31')]=_[_0x12a0('0x33')](_0x25a49c[_0x12a0('0x31')],{'$or':_[_0x12a0('0x22')](_0x25a49c[_0x12a0('0x29')],function(_0x3937a6){var _0x29e76b={};_0x29e76b[_0x3937a6]={'$like':'%'+_0x1f933d['query'][_0x12a0('0x32')]+'%'};return _0x29e76b;})});}_0x25a49c=_[_0x12a0('0x33')]({},_0x25a49c,_0x1f933d[_0x12a0('0x34')]);return _0x3ccf58[_0x12a0('0x42')](_0x25a49c);}})['then'](function(_0x3e8f9d){if(_0x3e8f9d){_0x57ba3a=_0x3e8f9d[_0x12a0('0x2c')];if(!_0x1f933d[_0x12a0('0x25')][_0x12a0('0x2d')](_0x12a0('0x2e'))){_0x25a49c['limit']=qs[_0x12a0('0x19')](_0x1f933d[_0x12a0('0x25')][_0x12a0('0x19')]);_0x25a49c[_0x12a0('0x18')]=qs[_0x12a0('0x18')](_0x1f933d[_0x12a0('0x25')][_0x12a0('0x18')]);}return _0x3ccf58[_0x12a0('0x42')](_0x25a49c);}})[_0x12a0('0x39')](function(_0x3ae464){if(_0x3ae464){return _0x3ae464?{'count':_0x57ba3a,'rows':_0x3ae464}:null;}})[_0x12a0('0x39')](respondWithResult(_0x17c9d5,null))[_0x12a0('0x40')](handleError(_0x17c9d5,null));};exports[_0x12a0('0x45')]=function(_0x541793,_0x56eb4a,_0x11a106){var _0xcd5a9b={};var _0x37fbc5={};var _0x55a837;var _0x20a0bb;return db[_0x12a0('0x35')][_0x12a0('0x43')]({'where':{'id':_0x541793['params']['id']}})[_0x12a0('0x39')](handleEntityNotFound(_0x56eb4a,null))['then'](function(_0x3b7a47){if(_0x3b7a47){_0x55a837=_0x3b7a47;_0x37fbc5['model']=_[_0x12a0('0x26')](db[_0x12a0('0x46')][_0x12a0('0x23')]);_0x37fbc5['query']=_[_0x12a0('0x26')](_0x541793['query']);_0x37fbc5[_0x12a0('0x27')]=_['intersection'](_0x37fbc5[_0x12a0('0x28')],_0x37fbc5[_0x12a0('0x25')]);_0xcd5a9b[_0x12a0('0x29')]=_[_0x12a0('0x2a')](_0x37fbc5[_0x12a0('0x28')],qs[_0x12a0('0x2b')](_0x541793[_0x12a0('0x25')][_0x12a0('0x2b')]));_0xcd5a9b[_0x12a0('0x29')]=_0xcd5a9b[_0x12a0('0x29')][_0x12a0('0x2c')]?_0xcd5a9b[_0x12a0('0x29')]:_0x37fbc5[_0x12a0('0x28')];_0xcd5a9b[_0x12a0('0x2f')]=qs[_0x12a0('0x30')](_0x541793[_0x12a0('0x25')][_0x12a0('0x30')]);_0xcd5a9b['where']=qs[_0x12a0('0x27')](_[_0x12a0('0x44')](_0x541793[_0x12a0('0x25')],_0x37fbc5[_0x12a0('0x27')]));if(_0x541793[_0x12a0('0x25')][_0x12a0('0x32')]){_0xcd5a9b[_0x12a0('0x31')]=_[_0x12a0('0x33')](_0xcd5a9b[_0x12a0('0x31')],{'$or':_[_0x12a0('0x22')](_0xcd5a9b[_0x12a0('0x29')],function(_0x4203b8){var _0x822528={};_0x822528[_0x4203b8]={'$like':'%'+_0x541793[_0x12a0('0x25')][_0x12a0('0x32')]+'%'};return _0x822528;})});}_0xcd5a9b=_[_0x12a0('0x33')]({},_0xcd5a9b,_0x541793[_0x12a0('0x34')]);return _0x55a837[_0x12a0('0x45')](_0xcd5a9b);}})[_0x12a0('0x39')](function(_0x18697e){if(_0x18697e){_0x20a0bb=_0x18697e['length'];if(!_0x541793['query'][_0x12a0('0x2d')](_0x12a0('0x2e'))){_0xcd5a9b[_0x12a0('0x19')]=qs[_0x12a0('0x19')](_0x541793[_0x12a0('0x25')]['limit']);_0xcd5a9b['offset']=qs[_0x12a0('0x18')](_0x541793[_0x12a0('0x25')][_0x12a0('0x18')]);}return _0x55a837[_0x12a0('0x45')](_0xcd5a9b);}})['then'](function(_0x55cc57){if(_0x55cc57){return _0x55cc57?{'count':_0x20a0bb,'rows':_0x55cc57}:null;}})[_0x12a0('0x39')](respondWithResult(_0x56eb4a,null))[_0x12a0('0x40')](handleError(_0x56eb4a,null));};exports[_0x12a0('0x47')]=function(_0x36681c,_0x195eac,_0x6a7303){var _0x42b90a={};var _0x9fccfa={};var _0x443ad8;var _0x26f157;return db[_0x12a0('0x35')]['findOne']({'where':{'id':_0x36681c['params']['id']}})[_0x12a0('0x39')](handleEntityNotFound(_0x195eac,null))[_0x12a0('0x39')](function(_0x564af5){if(_0x564af5){_0x443ad8=_0x564af5;_0x9fccfa['model']=_[_0x12a0('0x26')](db[_0x12a0('0x46')][_0x12a0('0x23')]);_0x9fccfa['query']=_['keys'](_0x36681c[_0x12a0('0x25')]);_0x9fccfa[_0x12a0('0x27')]=_[_0x12a0('0x2a')](_0x9fccfa['model'],_0x9fccfa[_0x12a0('0x25')]);_0x42b90a[_0x12a0('0x29')]=_['intersection'](_0x9fccfa['model'],qs[_0x12a0('0x2b')](_0x36681c[_0x12a0('0x25')][_0x12a0('0x2b')]));_0x42b90a['attributes']=_0x42b90a[_0x12a0('0x29')]['length']?_0x42b90a[_0x12a0('0x29')]:_0x9fccfa[_0x12a0('0x28')];_0x42b90a[_0x12a0('0x2f')]=qs['sort'](_0x36681c[_0x12a0('0x25')][_0x12a0('0x30')]);_0x42b90a['where']=qs['filters'](_[_0x12a0('0x44')](_0x36681c[_0x12a0('0x25')],_0x9fccfa[_0x12a0('0x27')]));if(_0x36681c['query'][_0x12a0('0x32')]){_0x42b90a[_0x12a0('0x31')]=_[_0x12a0('0x33')](_0x42b90a[_0x12a0('0x31')],{'$or':_[_0x12a0('0x22')](_0x42b90a[_0x12a0('0x29')],function(_0x369907){var _0x489e9d={};_0x489e9d[_0x369907]={'$like':'%'+_0x36681c[_0x12a0('0x25')][_0x12a0('0x32')]+'%'};return _0x489e9d;})});}_0x42b90a=_[_0x12a0('0x33')]({},_0x42b90a,_0x36681c['options']);return _0x443ad8['getDescriptions'](_0x42b90a);}})[_0x12a0('0x39')](function(_0x291dc7){if(_0x291dc7){_0x26f157=_0x291dc7[_0x12a0('0x2c')];if(!_0x36681c['query'][_0x12a0('0x2d')](_0x12a0('0x2e'))){_0x42b90a[_0x12a0('0x19')]=qs['limit'](_0x36681c[_0x12a0('0x25')]['limit']);_0x42b90a[_0x12a0('0x18')]=qs[_0x12a0('0x18')](_0x36681c[_0x12a0('0x25')][_0x12a0('0x18')]);}return _0x443ad8[_0x12a0('0x47')](_0x42b90a);}})[_0x12a0('0x39')](function(_0x20dd65){if(_0x20dd65){return _0x20dd65?{'count':_0x26f157,'rows':_0x20dd65}:null;}})[_0x12a0('0x39')](respondWithResult(_0x195eac,null))[_0x12a0('0x40')](handleError(_0x195eac,null));}; \ No newline at end of file diff --git a/server/api/intZohoConfiguration/intZohoConfiguration.model.js b/server/api/intZohoConfiguration/intZohoConfiguration.model.js index 9cedc94..d77fa3c 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 _0x8c25=['../../config/logger','api','moment','bluebird','request-promise','path','../../config/environment','./intZohoConfiguration.attributes','exports','define','ZohoConfiguration','int_zoho_configurations','lodash'];(function(_0x26b74e,_0x28eada){var _0x41f8fa=function(_0x3313d1){while(--_0x3313d1){_0x26b74e['push'](_0x26b74e['shift']());}};_0x41f8fa(++_0x28eada);}(_0x8c25,0x110));var _0x58c2=function(_0x498d79,_0x4a9a67){_0x498d79=_0x498d79-0x0;var _0x331b6f=_0x8c25[_0x498d79];return _0x331b6f;};'use strict';var _=require(_0x58c2('0x0'));var util=require('util');var logger=require(_0x58c2('0x1'))(_0x58c2('0x2'));var moment=require(_0x58c2('0x3'));var BPromise=require(_0x58c2('0x4'));var rp=require(_0x58c2('0x5'));var fs=require('fs');var path=require(_0x58c2('0x6'));var rimraf=require('rimraf');var config=require(_0x58c2('0x7'));var attributes=require(_0x58c2('0x8'));module[_0x58c2('0x9')]=function(_0x5df484,_0x37fc41){return _0x5df484[_0x58c2('0xa')](_0x58c2('0xb'),attributes,{'tableName':_0x58c2('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xe41c=['exports','define','ZohoConfiguration','lodash','util','moment','bluebird','request-promise','path','rimraf','../../config/environment','./intZohoConfiguration.attributes'];(function(_0x297fd3,_0x115406){var _0x2af381=function(_0x1dd31b){while(--_0x1dd31b){_0x297fd3['push'](_0x297fd3['shift']());}};_0x2af381(++_0x115406);}(_0xe41c,0x15f));var _0xce41=function(_0x4030c1,_0x3931e3){_0x4030c1=_0x4030c1-0x0;var _0x5a0723=_0xe41c[_0x4030c1];return _0x5a0723;};'use strict';var _=require(_0xce41('0x0'));var util=require(_0xce41('0x1'));var logger=require('../../config/logger')('api');var moment=require(_0xce41('0x2'));var BPromise=require(_0xce41('0x3'));var rp=require(_0xce41('0x4'));var fs=require('fs');var path=require(_0xce41('0x5'));var rimraf=require(_0xce41('0x6'));var config=require(_0xce41('0x7'));var attributes=require(_0xce41('0x8'));module[_0xce41('0x9')]=function(_0x407a07,_0x4ff953){return _0x407a07[_0xce41('0xa')](_0xce41('0xb'),attributes,{'tableName':'int_zoho_configurations','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 fffa860..0f1cf43 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 _0xd8bd=['info','request\x20sent','debug','ZohoConfiguration,\x20%s,\x20%s,\x20%s','error','ZohoConfiguration,\x20%s,\x20%s','message','result','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then'];(function(_0x5cbd0f,_0x184f29){var _0x6117a5=function(_0x1433e8){while(--_0x1433e8){_0x5cbd0f['push'](_0x5cbd0f['shift']());}};_0x6117a5(++_0x184f29);}(_0xd8bd,0x8c));var _0xdd8b=function(_0x489ba3,_0x120fc1){_0x489ba3=_0x489ba3-0x0;var _0x5a80a0=_0xd8bd[_0x489ba3];return _0x5a80a0;};'use strict';var _=require(_0xdd8b('0x0'));var util=require(_0xdd8b('0x1'));var moment=require(_0xdd8b('0x2'));var BPromise=require('bluebird');var rs=require(_0xdd8b('0x3'));var fs=require('fs');var Redis=require(_0xdd8b('0x4'));var db=require(_0xdd8b('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0xdd8b('0x6'))(_0xdd8b('0x7'));var config=require(_0xdd8b('0x8'));var jayson=require(_0xdd8b('0x9'));var client=jayson[_0xdd8b('0xa')][_0xdd8b('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x4354cf,_0x3ee7b2,_0x498711){return new BPromise(function(_0x3ea881,_0x353379){return client[_0xdd8b('0xc')](_0x4354cf,_0x498711)[_0xdd8b('0xd')](function(_0x174efb){logger[_0xdd8b('0xe')]('ZohoConfiguration,\x20%s,\x20%s',_0x3ee7b2,_0xdd8b('0xf'));logger[_0xdd8b('0x10')](_0xdd8b('0x11'),_0x3ee7b2,_0xdd8b('0xf'),JSON['stringify'](_0x174efb));if(_0x174efb[_0xdd8b('0x12')]){if(_0x174efb['error']['code']===0x1f4){logger[_0xdd8b('0x12')](_0xdd8b('0x13'),_0x3ee7b2,_0x174efb['error'][_0xdd8b('0x14')]);return _0x353379(_0x174efb['error'][_0xdd8b('0x14')]);}logger[_0xdd8b('0x12')](_0xdd8b('0x13'),_0x3ee7b2,_0x174efb[_0xdd8b('0x12')][_0xdd8b('0x14')]);return _0x3ea881(_0x174efb[_0xdd8b('0x12')]['message']);}else{logger[_0xdd8b('0xe')](_0xdd8b('0x13'),_0x3ee7b2,'request\x20sent');_0x3ea881(_0x174efb[_0xdd8b('0x15')]['message']);}})['catch'](function(_0xd6f8a2){logger['error'](_0xdd8b('0x13'),_0x3ee7b2,_0xd6f8a2);_0x353379(_0xd6f8a2);});});} \ No newline at end of file +var _0x1af0=['code','message','result','catch','lodash','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','http','request','info','ZohoConfiguration,\x20%s,\x20%s','request\x20sent','ZohoConfiguration,\x20%s,\x20%s,\x20%s','error'];(function(_0x449842,_0x3d7507){var _0x99e21f=function(_0x29ab8d){while(--_0x29ab8d){_0x449842['push'](_0x449842['shift']());}};_0x99e21f(++_0x3d7507);}(_0x1af0,0x1a8));var _0x01af=function(_0x4b055c,_0x4b870b){_0x4b055c=_0x4b055c-0x0;var _0x4b62bb=_0x1af0[_0x4b055c];return _0x4b62bb;};'use strict';var _=require(_0x01af('0x0'));var util=require('util');var moment=require(_0x01af('0x1'));var BPromise=require('bluebird');var rs=require(_0x01af('0x2'));var fs=require('fs');var Redis=require(_0x01af('0x3'));var db=require(_0x01af('0x4'))['db'];var utils=require(_0x01af('0x5'));var logger=require(_0x01af('0x6'))(_0x01af('0x7'));var config=require('../../config/environment');var jayson=require(_0x01af('0x8'));var client=jayson['client'][_0x01af('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x45fc91,_0x234304,_0x445843){return new BPromise(function(_0x24c407,_0x512c4f){return client[_0x01af('0xa')](_0x45fc91,_0x445843)['then'](function(_0x2badc2){logger[_0x01af('0xb')](_0x01af('0xc'),_0x234304,_0x01af('0xd'));logger['debug'](_0x01af('0xe'),_0x234304,_0x01af('0xd'),JSON['stringify'](_0x2badc2));if(_0x2badc2[_0x01af('0xf')]){if(_0x2badc2['error'][_0x01af('0x10')]===0x1f4){logger[_0x01af('0xf')](_0x01af('0xc'),_0x234304,_0x2badc2[_0x01af('0xf')]['message']);return _0x512c4f(_0x2badc2[_0x01af('0xf')][_0x01af('0x11')]);}logger[_0x01af('0xf')](_0x01af('0xc'),_0x234304,_0x2badc2[_0x01af('0xf')][_0x01af('0x11')]);return _0x24c407(_0x2badc2[_0x01af('0xf')]['message']);}else{logger[_0x01af('0xb')](_0x01af('0xc'),_0x234304,_0x01af('0xd'));_0x24c407(_0x2badc2[_0x01af('0x12')][_0x01af('0x11')]);}})[_0x01af('0x13')](function(_0x1fa55b){logger[_0x01af('0xf')](_0x01af('0xc'),_0x234304,_0x1fa55b);_0x512c4f(_0x1fa55b);});});} \ No newline at end of file diff --git a/server/api/intZohoField/index.js b/server/api/intZohoField/index.js index 15c007c..ca56d16 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 _0xe91e=['connect-timeout','express','fs-extra','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/:id','show','post','create','put','destroy','exports','util','path'];(function(_0x515b8f,_0x36bac5){var _0x8a3c03=function(_0x323def){while(--_0x323def){_0x515b8f['push'](_0x515b8f['shift']());}};_0x8a3c03(++_0x36bac5);}(_0xe91e,0x196));var _0xee91=function(_0x32e264,_0x41cee8){_0x32e264=_0x32e264-0x0;var _0x1d7175=_0xe91e[_0x32e264];return _0x1d7175;};'use strict';var multer=require('multer');var util=require(_0xee91('0x0'));var path=require(_0xee91('0x1'));var timeout=require(_0xee91('0x2'));var express=require(_0xee91('0x3'));var router=express['Router']();var fs_extra=require(_0xee91('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0xee91('0x5'));var config=require(_0xee91('0x6'));var controller=require('./intZohoField.controller');router[_0xee91('0x7')]('/',auth[_0xee91('0x8')](),controller[_0xee91('0x9')]);router[_0xee91('0x7')](_0xee91('0xa'),auth[_0xee91('0x8')](),controller[_0xee91('0xb')]);router[_0xee91('0xc')]('/',auth[_0xee91('0x8')](),controller[_0xee91('0xd')]);router[_0xee91('0xe')](_0xee91('0xa'),auth[_0xee91('0x8')](),controller['update']);router['delete'](_0xee91('0xa'),auth[_0xee91('0x8')](),controller[_0xee91('0xf')]);module[_0xee91('0x10')]=router; \ No newline at end of file +var _0x948a=['destroy','exports','multer','connect-timeout','express','Router','fs-extra','../../components/auth/service','get','isAuthenticated','index','/:id','show','post','create','put','update','delete'];(function(_0xb7f4e,_0x4da983){var _0x2df6ee=function(_0x459eff){while(--_0x459eff){_0xb7f4e['push'](_0xb7f4e['shift']());}};_0x2df6ee(++_0x4da983);}(_0x948a,0x146));var _0xa948=function(_0x1cb568,_0x2cba5f){_0x1cb568=_0x1cb568-0x0;var _0x191caa=_0x948a[_0x1cb568];return _0x191caa;};'use strict';var multer=require(_0xa948('0x0'));var util=require('util');var path=require('path');var timeout=require(_0xa948('0x1'));var express=require(_0xa948('0x2'));var router=express[_0xa948('0x3')]();var fs_extra=require(_0xa948('0x4'));var auth=require(_0xa948('0x5'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require('./intZohoField.controller');router[_0xa948('0x6')]('/',auth[_0xa948('0x7')](),controller[_0xa948('0x8')]);router[_0xa948('0x6')](_0xa948('0x9'),auth[_0xa948('0x7')](),controller[_0xa948('0xa')]);router[_0xa948('0xb')]('/',auth[_0xa948('0x7')](),controller[_0xa948('0xc')]);router[_0xa948('0xd')](_0xa948('0x9'),auth[_0xa948('0x7')](),controller[_0xa948('0xe')]);router[_0xa948('0xf')](_0xa948('0x9'),auth['isAuthenticated'](),controller[_0xa948('0x10')]);module[_0xa948('0x11')]=router; \ No newline at end of file diff --git a/server/api/intZohoField/intZohoField.attributes.js b/server/api/intZohoField/intZohoField.attributes.js index 755102b..e560b6d 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 _0x6c83=['keyValue','STRING','ENUM','variable','BOOLEAN','sequelize','exports','string','customVariable'];(function(_0x21a9d9,_0x4d5ac8){var _0x46adce=function(_0xfdd336){while(--_0xfdd336){_0x21a9d9['push'](_0x21a9d9['shift']());}};_0x46adce(++_0x4d5ac8);}(_0x6c83,0xb9));var _0x36c8=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0x6c83[_0x14add3];return _0x4a174f;};'use strict';var Sequelize=require(_0x36c8('0x0'));module[_0x36c8('0x1')]={'type':{'type':Sequelize['ENUM'](_0x36c8('0x2'),'variable',_0x36c8('0x3'),_0x36c8('0x4'),'picklist'),'defaultValue':_0x36c8('0x2')},'content':{'type':Sequelize[_0x36c8('0x5')]},'key':{'type':Sequelize['STRING']},'keyType':{'type':Sequelize[_0x36c8('0x6')]('string',_0x36c8('0x7'),_0x36c8('0x3'))},'keyContent':{'type':Sequelize[_0x36c8('0x5')]},'idField':{'type':Sequelize[_0x36c8('0x5')]},'nameField':{'type':Sequelize['STRING']},'customField':{'type':Sequelize[_0x36c8('0x8')],'defaultValue':!![]},'variableName':{'type':Sequelize[_0x36c8('0x5')]}}; \ No newline at end of file +var _0x7402=['picklist','STRING','BOOLEAN','exports','ENUM','string','variable','customVariable'];(function(_0x2a6d83,_0x457abf){var _0x8884c2=function(_0x110ccd){while(--_0x110ccd){_0x2a6d83['push'](_0x2a6d83['shift']());}};_0x8884c2(++_0x457abf);}(_0x7402,0x1bb));var _0x2740=function(_0x495054,_0x304104){_0x495054=_0x495054-0x0;var _0x146d2e=_0x7402[_0x495054];return _0x146d2e;};'use strict';var Sequelize=require('sequelize');module[_0x2740('0x0')]={'type':{'type':Sequelize[_0x2740('0x1')](_0x2740('0x2'),_0x2740('0x3'),_0x2740('0x4'),'keyValue',_0x2740('0x5')),'defaultValue':_0x2740('0x2')},'content':{'type':Sequelize[_0x2740('0x6')]},'key':{'type':Sequelize[_0x2740('0x6')]},'keyType':{'type':Sequelize[_0x2740('0x1')](_0x2740('0x2'),_0x2740('0x3'),_0x2740('0x4'))},'keyContent':{'type':Sequelize['STRING']},'idField':{'type':Sequelize[_0x2740('0x6')]},'nameField':{'type':Sequelize[_0x2740('0x6')]},'customField':{'type':Sequelize[_0x2740('0x7')],'defaultValue':!![]},'variableName':{'type':Sequelize[_0x2740('0x6')]}}; \ No newline at end of file diff --git a/server/api/intZohoField/intZohoField.controller.js b/server/api/intZohoField/intZohoField.controller.js index 720cef4..6602233 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 _0x3117=['end','json','offset','limit','undefined','count','set','apply','reject','save','update','then','destroy','error','stack','name','send','index','map','ZohoField','rawAttributes','fieldName','type','key','model','query','intersection','fields','attributes','hasOwnProperty','nolimit','order','sort','where','filters','pick','filter','merge','VIRTUAL','options','includeAll','findAll','show','params','keys','length','include','find','catch','create','body','eml-format','zip-dir','request-promise','moment','bluebird','util','path','to-csv','fs-extra','lodash','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status'];(function(_0xaa6a4,_0x64b067){var _0xdc31a4=function(_0x4269d8){while(--_0x4269d8){_0xaa6a4['push'](_0xaa6a4['shift']());}};_0xdc31a4(++_0x64b067);}(_0x3117,0x1af));var _0x7311=function(_0x576d8a,_0x2d7bde){_0x576d8a=_0x576d8a-0x0;var _0x3dc3ef=_0x3117[_0x576d8a];return _0x3dc3ef;};'use strict';var emlformat=require(_0x7311('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x7311('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0x7311('0x2'));var moment=require(_0x7311('0x3'));var BPromise=require(_0x7311('0x4'));var Mustache=require('mustache');var util=require(_0x7311('0x5'));var path=require(_0x7311('0x6'));var sox=require('sox');var csv=require(_0x7311('0x7'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x7311('0x8'));var _=require(_0x7311('0x9'));var squel=require('squel');var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x7311('0xa'));var toCsv=require(_0x7311('0x7'));var querystring=require(_0x7311('0xb'));var Papa=require(_0x7311('0xc'));var Redis=require(_0x7311('0xd'));var authService=require('../../components/auth/service');var qs=require(_0x7311('0xe'));var as=require(_0x7311('0xf'));var hardwareService=require(_0x7311('0x10'));var logger=require(_0x7311('0x11'))(_0x7311('0x12'));var utils=require(_0x7311('0x13'));var config=require(_0x7311('0x14'));var licenseUtil=require(_0x7311('0x15'));var db=require(_0x7311('0x16'))['db'];function respondWithStatusCode(_0x1370fd,_0x57c5b9){_0x57c5b9=_0x57c5b9||0xcc;return function(_0x14c2be){if(_0x14c2be){return _0x1370fd[_0x7311('0x17')](_0x57c5b9);}return _0x1370fd[_0x7311('0x18')](_0x57c5b9)[_0x7311('0x19')]();};}function respondWithResult(_0x25047f,_0x25ed9d){_0x25ed9d=_0x25ed9d||0xc8;return function(_0xb69d34){if(_0xb69d34){return _0x25047f['status'](_0x25ed9d)[_0x7311('0x1a')](_0xb69d34);}};}function respondWithFilteredResult(_0x1e8c53,_0x514336){return function(_0x3fecb0){if(_0x3fecb0){var _0x1b4d5a=typeof _0x514336[_0x7311('0x1b')]==='undefined'&&typeof _0x514336[_0x7311('0x1c')]===_0x7311('0x1d');var _0x27b961=_0x3fecb0[_0x7311('0x1e')];var _0x1042c4=_0x1b4d5a?0x0:_0x514336['offset'];var _0x2c2cff=_0x1b4d5a?_0x3fecb0[_0x7311('0x1e')]:_0x514336[_0x7311('0x1b')]+_0x514336[_0x7311('0x1c')];var _0x3fb8b7;if(_0x2c2cff>=_0x27b961){_0x2c2cff=_0x27b961;_0x3fb8b7=0xc8;}else{_0x3fb8b7=0xce;}_0x1e8c53[_0x7311('0x18')](_0x3fb8b7);return _0x1e8c53[_0x7311('0x1f')]('Content-Range',_0x1042c4+'-'+_0x2c2cff+'/'+_0x27b961)[_0x7311('0x1a')](_0x3fecb0);}return null;};}function patchUpdates(_0x19c5c5){return function(_0x2d1750){try{jsonpatch[_0x7311('0x20')](_0x2d1750,_0x19c5c5,!![]);}catch(_0x2870eb){return BPromise[_0x7311('0x21')](_0x2870eb);}return _0x2d1750[_0x7311('0x22')]();};}function saveUpdates(_0x2f983b,_0x3617ff){return function(_0x1c621a){if(_0x1c621a){return _0x1c621a[_0x7311('0x23')](_0x2f983b)[_0x7311('0x24')](function(_0x25ba57){return _0x25ba57;});}return null;};}function removeEntity(_0x404351,_0xf2cc8d){return function(_0x1b0f90){if(_0x1b0f90){return _0x1b0f90[_0x7311('0x25')]()[_0x7311('0x24')](function(){_0x404351[_0x7311('0x18')](0xcc)[_0x7311('0x19')]();});}};}function handleEntityNotFound(_0x2df9da,_0x60b56a){return function(_0x9f581f){if(!_0x9f581f){_0x2df9da[_0x7311('0x17')](0x194);}return _0x9f581f;};}function handleError(_0x42b088,_0xc84554){_0xc84554=_0xc84554||0x1f4;return function(_0xe2dcac){logger[_0x7311('0x26')](_0xe2dcac[_0x7311('0x27')]);if(_0xe2dcac[_0x7311('0x28')]){delete _0xe2dcac[_0x7311('0x28')];}_0x42b088[_0x7311('0x18')](_0xc84554)[_0x7311('0x29')](_0xe2dcac);};}exports[_0x7311('0x2a')]=function(_0x5f40ff,_0x1cd7b7){var _0x5c1146={},_0x336436={},_0xf2c94a={'count':0x0,'rows':[]};var _0x1dfdac=_[_0x7311('0x2b')](db[_0x7311('0x2c')][_0x7311('0x2d')],function(_0x11815c){return{'name':_0x11815c[_0x7311('0x2e')],'type':_0x11815c[_0x7311('0x2f')][_0x7311('0x30')]};});_0x336436[_0x7311('0x31')]=_[_0x7311('0x2b')](_0x1dfdac,_0x7311('0x28'));_0x336436[_0x7311('0x32')]=_['keys'](_0x5f40ff[_0x7311('0x32')]);_0x336436['filters']=_[_0x7311('0x33')](_0x336436[_0x7311('0x31')],_0x336436[_0x7311('0x32')]);_0x5c1146['attributes']=_[_0x7311('0x33')](_0x336436[_0x7311('0x31')],qs['fields'](_0x5f40ff[_0x7311('0x32')][_0x7311('0x34')]));_0x5c1146[_0x7311('0x35')]=_0x5c1146[_0x7311('0x35')]['length']?_0x5c1146[_0x7311('0x35')]:_0x336436[_0x7311('0x31')];if(!_0x5f40ff[_0x7311('0x32')][_0x7311('0x36')](_0x7311('0x37'))){_0x5c1146[_0x7311('0x1c')]=qs[_0x7311('0x1c')](_0x5f40ff[_0x7311('0x32')][_0x7311('0x1c')]);_0x5c1146[_0x7311('0x1b')]=qs[_0x7311('0x1b')](_0x5f40ff[_0x7311('0x32')][_0x7311('0x1b')]);}_0x5c1146[_0x7311('0x38')]=qs[_0x7311('0x39')](_0x5f40ff[_0x7311('0x32')][_0x7311('0x39')]);_0x5c1146[_0x7311('0x3a')]=qs[_0x7311('0x3b')](_[_0x7311('0x3c')](_0x5f40ff[_0x7311('0x32')],_0x336436[_0x7311('0x3b')]),_0x1dfdac);if(_0x5f40ff['query'][_0x7311('0x3d')]){_0x5c1146[_0x7311('0x3a')]=_[_0x7311('0x3e')](_0x5c1146[_0x7311('0x3a')],{'$or':_[_0x7311('0x2b')](_0x1dfdac,function(_0x503be1){if(_0x503be1[_0x7311('0x2f')]!==_0x7311('0x3f')){var _0x50d4a9={};_0x50d4a9[_0x503be1[_0x7311('0x28')]]={'$like':'%'+_0x5f40ff['query']['filter']+'%'};return _0x50d4a9;}})});}_0x5c1146=_[_0x7311('0x3e')]({},_0x5c1146,_0x5f40ff[_0x7311('0x40')]);var _0x109880={'where':_0x5c1146[_0x7311('0x3a')]};return db[_0x7311('0x2c')][_0x7311('0x1e')](_0x109880)[_0x7311('0x24')](function(_0x45a9be){_0xf2c94a[_0x7311('0x1e')]=_0x45a9be;if(_0x5f40ff[_0x7311('0x32')][_0x7311('0x41')]){_0x5c1146['include']=[{'all':!![]}];}return db[_0x7311('0x2c')][_0x7311('0x42')](_0x5c1146);})['then'](function(_0x59bef){_0xf2c94a['rows']=_0x59bef;return _0xf2c94a;})[_0x7311('0x24')](respondWithFilteredResult(_0x1cd7b7,_0x5c1146))['catch'](handleError(_0x1cd7b7,null));};exports[_0x7311('0x43')]=function(_0x230469,_0x4d9369){var _0x30dd86={'raw':!![],'where':{'id':_0x230469[_0x7311('0x44')]['id']}},_0x2bfcf6={};_0x2bfcf6[_0x7311('0x31')]=_[_0x7311('0x45')](db[_0x7311('0x2c')][_0x7311('0x2d')]);_0x2bfcf6[_0x7311('0x32')]=_[_0x7311('0x45')](_0x230469[_0x7311('0x32')]);_0x2bfcf6[_0x7311('0x3b')]=_[_0x7311('0x33')](_0x2bfcf6[_0x7311('0x31')],_0x2bfcf6[_0x7311('0x32')]);_0x30dd86['attributes']=_[_0x7311('0x33')](_0x2bfcf6[_0x7311('0x31')],qs['fields'](_0x230469[_0x7311('0x32')][_0x7311('0x34')]));_0x30dd86['attributes']=_0x30dd86[_0x7311('0x35')][_0x7311('0x46')]?_0x30dd86[_0x7311('0x35')]:_0x2bfcf6['model'];if(_0x230469['query'][_0x7311('0x41')]){_0x30dd86[_0x7311('0x47')]=[{'all':!![]}];}_0x30dd86=_['merge']({},_0x30dd86,_0x230469[_0x7311('0x40')]);return db[_0x7311('0x2c')][_0x7311('0x48')](_0x30dd86)[_0x7311('0x24')](handleEntityNotFound(_0x4d9369,null))[_0x7311('0x24')](respondWithResult(_0x4d9369,null))[_0x7311('0x49')](handleError(_0x4d9369,null));};exports[_0x7311('0x4a')]=function(_0x4096c5,_0x37341e){return db[_0x7311('0x2c')]['create'](_0x4096c5[_0x7311('0x4b')],{})[_0x7311('0x24')](respondWithResult(_0x37341e,0xc9))[_0x7311('0x49')](handleError(_0x37341e,null));};exports[_0x7311('0x23')]=function(_0x1112fc,_0x13eb68){if(_0x1112fc[_0x7311('0x4b')]['id']){delete _0x1112fc[_0x7311('0x4b')]['id'];}return db[_0x7311('0x2c')]['find']({'where':{'id':_0x1112fc[_0x7311('0x44')]['id']}})[_0x7311('0x24')](handleEntityNotFound(_0x13eb68,null))[_0x7311('0x24')](saveUpdates(_0x1112fc[_0x7311('0x4b')],null))[_0x7311('0x24')](respondWithResult(_0x13eb68,null))[_0x7311('0x49')](handleError(_0x13eb68,null));};exports[_0x7311('0x25')]=function(_0x5d0218,_0x2b4512){return db[_0x7311('0x2c')][_0x7311('0x48')]({'where':{'id':_0x5d0218[_0x7311('0x44')]['id']}})[_0x7311('0x24')](handleEntityNotFound(_0x2b4512,null))[_0x7311('0x24')](removeEntity(_0x2b4512,null))[_0x7311('0x49')](handleError(_0x2b4512,null));}; \ No newline at end of file +var _0x72a1=['crypto','desk.js','querystring','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/environment','../../config/license/util','sendStatus','status','json','offset','undefined','limit','count','set','reject','save','update','destroy','then','end','error','name','send','index','map','ZohoField','fieldName','type','key','model','filters','query','attributes','intersection','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','findAll','rows','catch','show','params','keys','rawAttributes','include','options','create','body','find','zip-dir','request-promise','bluebird','mustache','util','path','sox','to-csv','ejs','lodash'];(function(_0xd1d19a,_0x1933f0){var _0x52a79d=function(_0x5199e2){while(--_0x5199e2){_0xd1d19a['push'](_0xd1d19a['shift']());}};_0x52a79d(++_0x1933f0);}(_0x72a1,0x159));var _0x172a=function(_0x347567,_0x25f60a){_0x347567=_0x347567-0x0;var _0x48e0ca=_0x72a1[_0x347567];return _0x48e0ca;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0x172a('0x0'));var jsonpatch=require('fast-json-patch');var rp=require(_0x172a('0x1'));var moment=require('moment');var BPromise=require(_0x172a('0x2'));var Mustache=require(_0x172a('0x3'));var util=require(_0x172a('0x4'));var path=require(_0x172a('0x5'));var sox=require(_0x172a('0x6'));var csv=require(_0x172a('0x7'));var ejs=require(_0x172a('0x8'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x172a('0x9'));var squel=require('squel');var crypto=require(_0x172a('0xa'));var jsforce=require('jsforce');var deskjs=require(_0x172a('0xb'));var toCsv=require(_0x172a('0x7'));var querystring=require(_0x172a('0xc'));var Papa=require('papaparse');var Redis=require(_0x172a('0xd'));var authService=require('../../components/auth/service');var qs=require(_0x172a('0xe'));var as=require(_0x172a('0xf'));var hardwareService=require(_0x172a('0x10'));var logger=require('../../config/logger')(_0x172a('0x11'));var utils=require('../../config/utils');var config=require(_0x172a('0x12'));var licenseUtil=require(_0x172a('0x13'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x4167c3,_0x1aee84){_0x1aee84=_0x1aee84||0xcc;return function(_0x512e48){if(_0x512e48){return _0x4167c3[_0x172a('0x14')](_0x1aee84);}return _0x4167c3['status'](_0x1aee84)['end']();};}function respondWithResult(_0x18a07a,_0x3c8985){_0x3c8985=_0x3c8985||0xc8;return function(_0xc47b61){if(_0xc47b61){return _0x18a07a[_0x172a('0x15')](_0x3c8985)[_0x172a('0x16')](_0xc47b61);}};}function respondWithFilteredResult(_0x1ec5f6,_0x101bd5){return function(_0x29af7d){if(_0x29af7d){var _0x3619a8=typeof _0x101bd5[_0x172a('0x17')]===_0x172a('0x18')&&typeof _0x101bd5[_0x172a('0x19')]===_0x172a('0x18');var _0x57f068=_0x29af7d[_0x172a('0x1a')];var _0x5058e7=_0x3619a8?0x0:_0x101bd5[_0x172a('0x17')];var _0x46668c=_0x3619a8?_0x29af7d[_0x172a('0x1a')]:_0x101bd5[_0x172a('0x17')]+_0x101bd5[_0x172a('0x19')];var _0x52aea4;if(_0x46668c>=_0x57f068){_0x46668c=_0x57f068;_0x52aea4=0xc8;}else{_0x52aea4=0xce;}_0x1ec5f6[_0x172a('0x15')](_0x52aea4);return _0x1ec5f6[_0x172a('0x1b')]('Content-Range',_0x5058e7+'-'+_0x46668c+'/'+_0x57f068)['json'](_0x29af7d);}return null;};}function patchUpdates(_0x560ccb){return function(_0xaa4fc2){try{jsonpatch['apply'](_0xaa4fc2,_0x560ccb,!![]);}catch(_0x33155c){return BPromise[_0x172a('0x1c')](_0x33155c);}return _0xaa4fc2[_0x172a('0x1d')]();};}function saveUpdates(_0x233f59,_0x5133b5){return function(_0x588d66){if(_0x588d66){return _0x588d66[_0x172a('0x1e')](_0x233f59)['then'](function(_0x101b7b){return _0x101b7b;});}return null;};}function removeEntity(_0x4aaab6,_0x41e74c){return function(_0x358837){if(_0x358837){return _0x358837[_0x172a('0x1f')]()[_0x172a('0x20')](function(){_0x4aaab6['status'](0xcc)[_0x172a('0x21')]();});}};}function handleEntityNotFound(_0x35ab63,_0x329c7a){return function(_0x530d3e){if(!_0x530d3e){_0x35ab63[_0x172a('0x14')](0x194);}return _0x530d3e;};}function handleError(_0x3b412b,_0x34cae7){_0x34cae7=_0x34cae7||0x1f4;return function(_0x5eb7ad){logger[_0x172a('0x22')](_0x5eb7ad['stack']);if(_0x5eb7ad[_0x172a('0x23')]){delete _0x5eb7ad[_0x172a('0x23')];}_0x3b412b[_0x172a('0x15')](_0x34cae7)[_0x172a('0x24')](_0x5eb7ad);};}exports[_0x172a('0x25')]=function(_0x1497f5,_0x31007c){var _0x50de9d={},_0x23d231={},_0x3e8c2f={'count':0x0,'rows':[]};var _0x316343=_[_0x172a('0x26')](db[_0x172a('0x27')]['rawAttributes'],function(_0x47b06c){return{'name':_0x47b06c[_0x172a('0x28')],'type':_0x47b06c[_0x172a('0x29')][_0x172a('0x2a')]};});_0x23d231[_0x172a('0x2b')]=_[_0x172a('0x26')](_0x316343,_0x172a('0x23'));_0x23d231['query']=_['keys'](_0x1497f5['query']);_0x23d231[_0x172a('0x2c')]=_['intersection'](_0x23d231['model'],_0x23d231[_0x172a('0x2d')]);_0x50de9d[_0x172a('0x2e')]=_[_0x172a('0x2f')](_0x23d231[_0x172a('0x2b')],qs[_0x172a('0x30')](_0x1497f5[_0x172a('0x2d')][_0x172a('0x30')]));_0x50de9d[_0x172a('0x2e')]=_0x50de9d[_0x172a('0x2e')][_0x172a('0x31')]?_0x50de9d[_0x172a('0x2e')]:_0x23d231[_0x172a('0x2b')];if(!_0x1497f5[_0x172a('0x2d')][_0x172a('0x32')](_0x172a('0x33'))){_0x50de9d[_0x172a('0x19')]=qs[_0x172a('0x19')](_0x1497f5[_0x172a('0x2d')]['limit']);_0x50de9d['offset']=qs[_0x172a('0x17')](_0x1497f5['query'][_0x172a('0x17')]);}_0x50de9d[_0x172a('0x34')]=qs[_0x172a('0x35')](_0x1497f5[_0x172a('0x2d')][_0x172a('0x35')]);_0x50de9d[_0x172a('0x36')]=qs['filters'](_[_0x172a('0x37')](_0x1497f5[_0x172a('0x2d')],_0x23d231['filters']),_0x316343);if(_0x1497f5[_0x172a('0x2d')][_0x172a('0x38')]){_0x50de9d[_0x172a('0x36')]=_[_0x172a('0x39')](_0x50de9d[_0x172a('0x36')],{'$or':_[_0x172a('0x26')](_0x316343,function(_0x4802c8){if(_0x4802c8[_0x172a('0x29')]!==_0x172a('0x3a')){var _0x1f0f7b={};_0x1f0f7b[_0x4802c8[_0x172a('0x23')]]={'$like':'%'+_0x1497f5[_0x172a('0x2d')][_0x172a('0x38')]+'%'};return _0x1f0f7b;}})});}_0x50de9d=_[_0x172a('0x39')]({},_0x50de9d,_0x1497f5['options']);var _0x22b5c2={'where':_0x50de9d[_0x172a('0x36')]};return db[_0x172a('0x27')][_0x172a('0x1a')](_0x22b5c2)['then'](function(_0x32aa96){_0x3e8c2f[_0x172a('0x1a')]=_0x32aa96;if(_0x1497f5[_0x172a('0x2d')]['includeAll']){_0x50de9d['include']=[{'all':!![]}];}return db[_0x172a('0x27')][_0x172a('0x3b')](_0x50de9d);})[_0x172a('0x20')](function(_0x32d7f7){_0x3e8c2f[_0x172a('0x3c')]=_0x32d7f7;return _0x3e8c2f;})[_0x172a('0x20')](respondWithFilteredResult(_0x31007c,_0x50de9d))[_0x172a('0x3d')](handleError(_0x31007c,null));};exports[_0x172a('0x3e')]=function(_0x32978a,_0x5d52fa){var _0x2328ba={'raw':!![],'where':{'id':_0x32978a[_0x172a('0x3f')]['id']}},_0x5b169f={};_0x5b169f['model']=_[_0x172a('0x40')](db[_0x172a('0x27')][_0x172a('0x41')]);_0x5b169f[_0x172a('0x2d')]=_['keys'](_0x32978a[_0x172a('0x2d')]);_0x5b169f['filters']=_[_0x172a('0x2f')](_0x5b169f[_0x172a('0x2b')],_0x5b169f['query']);_0x2328ba[_0x172a('0x2e')]=_[_0x172a('0x2f')](_0x5b169f['model'],qs[_0x172a('0x30')](_0x32978a[_0x172a('0x2d')][_0x172a('0x30')]));_0x2328ba['attributes']=_0x2328ba[_0x172a('0x2e')][_0x172a('0x31')]?_0x2328ba[_0x172a('0x2e')]:_0x5b169f[_0x172a('0x2b')];if(_0x32978a['query']['includeAll']){_0x2328ba[_0x172a('0x42')]=[{'all':!![]}];}_0x2328ba=_[_0x172a('0x39')]({},_0x2328ba,_0x32978a[_0x172a('0x43')]);return db[_0x172a('0x27')]['find'](_0x2328ba)[_0x172a('0x20')](handleEntityNotFound(_0x5d52fa,null))[_0x172a('0x20')](respondWithResult(_0x5d52fa,null))[_0x172a('0x3d')](handleError(_0x5d52fa,null));};exports[_0x172a('0x44')]=function(_0x38b7b8,_0x17bcc9){return db[_0x172a('0x27')]['create'](_0x38b7b8[_0x172a('0x45')],{})[_0x172a('0x20')](respondWithResult(_0x17bcc9,0xc9))[_0x172a('0x3d')](handleError(_0x17bcc9,null));};exports['update']=function(_0xad0112,_0x1117c2){if(_0xad0112[_0x172a('0x45')]['id']){delete _0xad0112[_0x172a('0x45')]['id'];}return db[_0x172a('0x27')][_0x172a('0x46')]({'where':{'id':_0xad0112[_0x172a('0x3f')]['id']}})[_0x172a('0x20')](handleEntityNotFound(_0x1117c2,null))[_0x172a('0x20')](saveUpdates(_0xad0112[_0x172a('0x45')],null))['then'](respondWithResult(_0x1117c2,null))[_0x172a('0x3d')](handleError(_0x1117c2,null));};exports['destroy']=function(_0x2801d6,_0x5ad875){return db[_0x172a('0x27')][_0x172a('0x46')]({'where':{'id':_0x2801d6[_0x172a('0x3f')]['id']}})[_0x172a('0x20')](handleEntityNotFound(_0x5ad875,null))[_0x172a('0x20')](removeEntity(_0x5ad875,null))['catch'](handleError(_0x5ad875,null));}; \ No newline at end of file diff --git a/server/api/intZohoField/intZohoField.model.js b/server/api/intZohoField/intZohoField.model.js index 4ffde57..d696fec 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 _0xf2e3=['request-promise','path','rimraf','../../config/environment','./intZohoField.attributes','define','ZohoField','int_zoho_fields','zoho_unique_index','idField','FieldId','lodash','../../config/logger','api','moment','bluebird'];(function(_0x4b7895,_0x3c4f5d){var _0x264180=function(_0xe0e861){while(--_0xe0e861){_0x4b7895['push'](_0x4b7895['shift']());}};_0x264180(++_0x3c4f5d);}(_0xf2e3,0x9b));var _0x3f2e=function(_0x2dadb9,_0x42cfe6){_0x2dadb9=_0x2dadb9-0x0;var _0x2f0097=_0xf2e3[_0x2dadb9];return _0x2f0097;};'use strict';var _=require(_0x3f2e('0x0'));var util=require('util');var logger=require(_0x3f2e('0x1'))(_0x3f2e('0x2'));var moment=require(_0x3f2e('0x3'));var BPromise=require(_0x3f2e('0x4'));var rp=require(_0x3f2e('0x5'));var fs=require('fs');var path=require(_0x3f2e('0x6'));var rimraf=require(_0x3f2e('0x7'));var config=require(_0x3f2e('0x8'));var attributes=require(_0x3f2e('0x9'));module['exports']=function(_0x33a3b7,_0xdd6b3e){return _0x33a3b7[_0x3f2e('0xa')](_0x3f2e('0xb'),attributes,{'tableName':_0x3f2e('0xc'),'paranoid':![],'indexes':[{'name':_0x3f2e('0xd'),'fields':[_0x3f2e('0xe'),_0x3f2e('0xf')],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file +var _0xdb28=['../../config/environment','exports','ZohoField','int_zoho_fields','zoho_unique_index','idField','FieldId','lodash','util','../../config/logger','api','bluebird','request-promise','path','rimraf'];(function(_0x384047,_0x3ce278){var _0x43bf57=function(_0x425adf){while(--_0x425adf){_0x384047['push'](_0x384047['shift']());}};_0x43bf57(++_0x3ce278);}(_0xdb28,0x106));var _0x8db2=function(_0x554c6e,_0x27c404){_0x554c6e=_0x554c6e-0x0;var _0x4d2bd0=_0xdb28[_0x554c6e];return _0x4d2bd0;};'use strict';var _=require(_0x8db2('0x0'));var util=require(_0x8db2('0x1'));var logger=require(_0x8db2('0x2'))(_0x8db2('0x3'));var moment=require('moment');var BPromise=require(_0x8db2('0x4'));var rp=require(_0x8db2('0x5'));var fs=require('fs');var path=require(_0x8db2('0x6'));var rimraf=require(_0x8db2('0x7'));var config=require(_0x8db2('0x8'));var attributes=require('./intZohoField.attributes');module[_0x8db2('0x9')]=function(_0x1d2dd3,_0x5f42ee){return _0x1d2dd3['define'](_0x8db2('0xa'),attributes,{'tableName':_0x8db2('0xb'),'paranoid':![],'indexes':[{'name':_0x8db2('0xc'),'fields':[_0x8db2('0xd'),_0x8db2('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 09d214a..95c862e 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 _0x9f4c=['util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','request','then','info','request\x20sent','debug','ZohoField,\x20%s,\x20%s,\x20%s','error','code','ZohoField,\x20%s,\x20%s','message','result','catch'];(function(_0x3a6e99,_0x2427a1){var _0x17941a=function(_0x805563){while(--_0x805563){_0x3a6e99['push'](_0x3a6e99['shift']());}};_0x17941a(++_0x2427a1);}(_0x9f4c,0xf2));var _0xc9f4=function(_0x114c24,_0x478050){_0x114c24=_0x114c24-0x0;var _0x1d731a=_0x9f4c[_0x114c24];return _0x1d731a;};'use strict';var _=require('lodash');var util=require(_0xc9f4('0x0'));var moment=require(_0xc9f4('0x1'));var BPromise=require(_0xc9f4('0x2'));var rs=require(_0xc9f4('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xc9f4('0x4'))['db'];var utils=require(_0xc9f4('0x5'));var logger=require(_0xc9f4('0x6'))('rpc');var config=require(_0xc9f4('0x7'));var jayson=require(_0xc9f4('0x8'));var client=jayson[_0xc9f4('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0xd40561,_0x5080be,_0x2f38df){return new BPromise(function(_0xcb117,_0x4ab160){return client[_0xc9f4('0xa')](_0xd40561,_0x2f38df)[_0xc9f4('0xb')](function(_0x6ef222){logger[_0xc9f4('0xc')]('ZohoField,\x20%s,\x20%s',_0x5080be,_0xc9f4('0xd'));logger[_0xc9f4('0xe')](_0xc9f4('0xf'),_0x5080be,'request\x20sent',JSON['stringify'](_0x6ef222));if(_0x6ef222[_0xc9f4('0x10')]){if(_0x6ef222['error'][_0xc9f4('0x11')]===0x1f4){logger[_0xc9f4('0x10')](_0xc9f4('0x12'),_0x5080be,_0x6ef222[_0xc9f4('0x10')][_0xc9f4('0x13')]);return _0x4ab160(_0x6ef222[_0xc9f4('0x10')][_0xc9f4('0x13')]);}logger[_0xc9f4('0x10')](_0xc9f4('0x12'),_0x5080be,_0x6ef222[_0xc9f4('0x10')]['message']);return _0xcb117(_0x6ef222[_0xc9f4('0x10')]['message']);}else{logger[_0xc9f4('0xc')](_0xc9f4('0x12'),_0x5080be,_0xc9f4('0xd'));_0xcb117(_0x6ef222[_0xc9f4('0x14')]['message']);}})[_0xc9f4('0x15')](function(_0x8f48a9){logger[_0xc9f4('0x10')](_0xc9f4('0x12'),_0x5080be,_0x8f48a9);_0x4ab160(_0x8f48a9);});});} \ No newline at end of file +var _0x6001=['debug','ZohoField,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','catch','lodash','bluebird','../../mysqldb','../../config/utils','../../config/environment','jayson/promise','http','request','info','ZohoField,\x20%s,\x20%s'];(function(_0x2539e6,_0x595d36){var _0xe83570=function(_0x2a8b2e){while(--_0x2a8b2e){_0x2539e6['push'](_0x2539e6['shift']());}};_0xe83570(++_0x595d36);}(_0x6001,0x1ca));var _0x1600=function(_0x330376,_0x70a3f){_0x330376=_0x330376-0x0;var _0xb7f093=_0x6001[_0x330376];return _0xb7f093;};'use strict';var _=require(_0x1600('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0x1600('0x1'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x1600('0x2'))['db'];var utils=require(_0x1600('0x3'));var logger=require('../../config/logger')('rpc');var config=require(_0x1600('0x4'));var jayson=require(_0x1600('0x5'));var client=jayson['client'][_0x1600('0x6')]({'port':0x232a});function respondWithRpcPromise(_0x53909c,_0x2da394,_0x49e081){return new BPromise(function(_0x31f79e,_0x59607c){return client[_0x1600('0x7')](_0x53909c,_0x49e081)['then'](function(_0x10922d){logger[_0x1600('0x8')](_0x1600('0x9'),_0x2da394,'request\x20sent');logger[_0x1600('0xa')](_0x1600('0xb'),_0x2da394,_0x1600('0xc'),JSON[_0x1600('0xd')](_0x10922d));if(_0x10922d[_0x1600('0xe')]){if(_0x10922d[_0x1600('0xe')][_0x1600('0xf')]===0x1f4){logger['error'](_0x1600('0x9'),_0x2da394,_0x10922d[_0x1600('0xe')][_0x1600('0x10')]);return _0x59607c(_0x10922d[_0x1600('0xe')][_0x1600('0x10')]);}logger['error'](_0x1600('0x9'),_0x2da394,_0x10922d['error'][_0x1600('0x10')]);return _0x31f79e(_0x10922d[_0x1600('0xe')][_0x1600('0x10')]);}else{logger[_0x1600('0x8')](_0x1600('0x9'),_0x2da394,_0x1600('0xc'));_0x31f79e(_0x10922d['result']['message']);}})[_0x1600('0x11')](function(_0x3f2bd3){logger['error']('ZohoField,\x20%s,\x20%s',_0x2da394,_0x3f2bd3);_0x59607c(_0x3f2bd3);});});} \ No newline at end of file diff --git a/server/api/integration/index.js b/server/api/integration/index.js index 442fd86..70b6245 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 _0xedd9=['util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','exports'];(function(_0x3f08f6,_0x1bb8dd){var _0x27a23c=function(_0x2c08a0){while(--_0x2c08a0){_0x3f08f6['push'](_0x3f08f6['shift']());}};_0x27a23c(++_0x1bb8dd);}(_0xedd9,0xfc));var _0x9edd=function(_0x539bea,_0x53eb92){_0x539bea=_0x539bea-0x0;var _0x196e38=_0xedd9[_0x539bea];return _0x196e38;};'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 _0xcb91=['express','Router','../../components/auth/service','../../components/interaction/service','exports','path','connect-timeout'];(function(_0x2acaa1,_0xba5225){var _0x471df3=function(_0x31e5f2){while(--_0x31e5f2){_0x2acaa1['push'](_0x2acaa1['shift']());}};_0x471df3(++_0xba5225);}(_0xcb91,0x1a9));var _0x1cb9=function(_0x4849f6,_0x104836){_0x4849f6=_0x4849f6-0x0;var _0x1a3dcd=_0xcb91[_0x4849f6];return _0x1a3dcd;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x1cb9('0x0'));var timeout=require(_0x1cb9('0x1'));var express=require(_0x1cb9('0x2'));var router=express[_0x1cb9('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x1cb9('0x4'));var interaction=require(_0x1cb9('0x5'));var config=require('../../config/environment');module[_0x1cb9('0x6')]=router; \ No newline at end of file diff --git a/server/api/integration/integration.attributes.js b/server/api/integration/integration.attributes.js index 464f700..c34a4a3 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 _0x21c1=['unique_name_and_version','app.js','INTEGER','BOOLEAN','STRING'];(function(_0x142201,_0x5dbbcd){var _0xc9f994=function(_0x30a743){while(--_0x30a743){_0x142201['push'](_0x142201['shift']());}};_0xc9f994(++_0x5dbbcd);}(_0x21c1,0xef));var _0x121c=function(_0x470e39,_0x4ea849){_0x470e39=_0x470e39-0x0;var _0x5a67b5=_0x21c1[_0x470e39];return _0x5a67b5;};'use strict';var Sequelize=require('sequelize');module['exports']={'name':{'type':Sequelize[_0x121c('0x0')],'allowNull':![],'unique':_0x121c('0x1')},'version':{'type':Sequelize[_0x121c('0x0')],'allowNull':![],'unique':_0x121c('0x1')},'main':{'type':Sequelize[_0x121c('0x0')],'defaultValue':_0x121c('0x2')},'filename':{'type':Sequelize['STRING']},'path':{'type':Sequelize[_0x121c('0x0')]},'type':{'type':Sequelize[_0x121c('0x0')]},'size':{'type':Sequelize[_0x121c('0x3')]},'active':{'type':Sequelize[_0x121c('0x4')],'defaultValue':![]},'author':{'type':Sequelize[_0x121c('0x0')]},'logo':{'type':Sequelize['STRING']},'state':{'type':Sequelize[_0x121c('0x0')],'unique':'state'},'description':{'type':Sequelize[_0x121c('0x0')]},'title':{'type':Sequelize[_0x121c('0x0')]},'remoteUri':{'type':Sequelize[_0x121c('0x0')]},'link':{'type':Sequelize[_0x121c('0x0')],'defaultValue':'#'}}; \ No newline at end of file +var _0x34dc=['STRING','unique_name_and_version','app.js','BOOLEAN','state','sequelize','exports'];(function(_0xbb9dbf,_0x5dafa4){var _0x30223c=function(_0xaa9ca){while(--_0xaa9ca){_0xbb9dbf['push'](_0xbb9dbf['shift']());}};_0x30223c(++_0x5dafa4);}(_0x34dc,0x124));var _0xc34d=function(_0x584728,_0xb0f8ba){_0x584728=_0x584728-0x0;var _0x33d0b0=_0x34dc[_0x584728];return _0x33d0b0;};'use strict';var Sequelize=require(_0xc34d('0x0'));module[_0xc34d('0x1')]={'name':{'type':Sequelize[_0xc34d('0x2')],'allowNull':![],'unique':_0xc34d('0x3')},'version':{'type':Sequelize[_0xc34d('0x2')],'allowNull':![],'unique':_0xc34d('0x3')},'main':{'type':Sequelize['STRING'],'defaultValue':_0xc34d('0x4')},'filename':{'type':Sequelize['STRING']},'path':{'type':Sequelize[_0xc34d('0x2')]},'type':{'type':Sequelize[_0xc34d('0x2')]},'size':{'type':Sequelize['INTEGER']},'active':{'type':Sequelize[_0xc34d('0x5')],'defaultValue':![]},'author':{'type':Sequelize[_0xc34d('0x2')]},'logo':{'type':Sequelize['STRING']},'state':{'type':Sequelize[_0xc34d('0x2')],'unique':_0xc34d('0x6')},'description':{'type':Sequelize[_0xc34d('0x2')]},'title':{'type':Sequelize[_0xc34d('0x2')]},'remoteUri':{'type':Sequelize[_0xc34d('0x2')]},'link':{'type':Sequelize[_0xc34d('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 96b239b..4f3dd0b 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 _0x5fab=['querystring','papaparse','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','status','json','offset','undefined','count','limit','set','Content-Range','apply','reject','save','update','destroy','end','sendStatus','name','send','index','map','Integration','rawAttributes','fieldName','type','key','model','query','keys','filters','attributes','length','hasOwnProperty','nolimit','order','sort','where','pick','VIRTUAL','filter','includeAll','include','findAll','then','rows','show','params','intersection','fields','options','find','catch','create','body','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','squel','crypto','jsforce'];(function(_0x2c5435,_0x1bbff8){var _0x1f7ffe=function(_0x5c6ac3){while(--_0x5c6ac3){_0x2c5435['push'](_0x2c5435['shift']());}};_0x1f7ffe(++_0x1bbff8);}(_0x5fab,0x177));var _0xb5fa=function(_0xdbf14f,_0x4bfcc4){_0xdbf14f=_0xdbf14f-0x0;var _0x3e58a2=_0x5fab[_0xdbf14f];return _0x3e58a2;};'use strict';var emlformat=require(_0xb5fa('0x0'));var rimraf=require(_0xb5fa('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xb5fa('0x2'));var rp=require(_0xb5fa('0x3'));var moment=require(_0xb5fa('0x4'));var BPromise=require(_0xb5fa('0x5'));var Mustache=require(_0xb5fa('0x6'));var util=require(_0xb5fa('0x7'));var path=require(_0xb5fa('0x8'));var sox=require(_0xb5fa('0x9'));var csv=require(_0xb5fa('0xa'));var ejs=require(_0xb5fa('0xb'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0xb5fa('0xc'));var crypto=require(_0xb5fa('0xd'));var jsforce=require(_0xb5fa('0xe'));var deskjs=require('desk.js');var toCsv=require(_0xb5fa('0xa'));var querystring=require(_0xb5fa('0xf'));var Papa=require(_0xb5fa('0x10'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0xb5fa('0x11'));var as=require(_0xb5fa('0x12'));var hardwareService=require(_0xb5fa('0x13'));var logger=require(_0xb5fa('0x14'))(_0xb5fa('0x15'));var utils=require(_0xb5fa('0x16'));var config=require(_0xb5fa('0x17'));var licenseUtil=require(_0xb5fa('0x18'));var db=require(_0xb5fa('0x19'))['db'];function respondWithStatusCode(_0x4d3576,_0x2ad830){_0x2ad830=_0x2ad830||0xcc;return function(_0x3dad4d){if(_0x3dad4d){return _0x4d3576['sendStatus'](_0x2ad830);}return _0x4d3576[_0xb5fa('0x1a')](_0x2ad830)['end']();};}function respondWithResult(_0x265992,_0x3fc372){_0x3fc372=_0x3fc372||0xc8;return function(_0x40c914){if(_0x40c914){return _0x265992[_0xb5fa('0x1a')](_0x3fc372)[_0xb5fa('0x1b')](_0x40c914);}};}function respondWithFilteredResult(_0x5371cf,_0x567f31){return function(_0x38e964){if(_0x38e964){var _0x587043=typeof _0x567f31[_0xb5fa('0x1c')]===_0xb5fa('0x1d')&&typeof _0x567f31['limit']==='undefined';var _0x451a55=_0x38e964[_0xb5fa('0x1e')];var _0x32e9e5=_0x587043?0x0:_0x567f31[_0xb5fa('0x1c')];var _0x324ba5=_0x587043?_0x38e964[_0xb5fa('0x1e')]:_0x567f31[_0xb5fa('0x1c')]+_0x567f31[_0xb5fa('0x1f')];var _0xc14dc4;if(_0x324ba5>=_0x451a55){_0x324ba5=_0x451a55;_0xc14dc4=0xc8;}else{_0xc14dc4=0xce;}_0x5371cf[_0xb5fa('0x1a')](_0xc14dc4);return _0x5371cf[_0xb5fa('0x20')](_0xb5fa('0x21'),_0x32e9e5+'-'+_0x324ba5+'/'+_0x451a55)['json'](_0x38e964);}return null;};}function patchUpdates(_0x432bfa){return function(_0x519e20){try{jsonpatch[_0xb5fa('0x22')](_0x519e20,_0x432bfa,!![]);}catch(_0x4a6c04){return BPromise[_0xb5fa('0x23')](_0x4a6c04);}return _0x519e20[_0xb5fa('0x24')]();};}function saveUpdates(_0x4e05c0,_0x40dfdf){return function(_0x3a2ab9){if(_0x3a2ab9){return _0x3a2ab9[_0xb5fa('0x25')](_0x4e05c0)['then'](function(_0x32a85c){return _0x32a85c;});}return null;};}function removeEntity(_0xec108f,_0x444237){return function(_0x542348){if(_0x542348){return _0x542348[_0xb5fa('0x26')]()['then'](function(){_0xec108f[_0xb5fa('0x1a')](0xcc)[_0xb5fa('0x27')]();});}};}function handleEntityNotFound(_0x11053a,_0x543edf){return function(_0x2dbd22){if(!_0x2dbd22){_0x11053a[_0xb5fa('0x28')](0x194);}return _0x2dbd22;};}function handleError(_0x6a455c,_0x20d649){_0x20d649=_0x20d649||0x1f4;return function(_0x568870){logger['error'](_0x568870['stack']);if(_0x568870['name']){delete _0x568870[_0xb5fa('0x29')];}_0x6a455c[_0xb5fa('0x1a')](_0x20d649)[_0xb5fa('0x2a')](_0x568870);};}exports[_0xb5fa('0x2b')]=function(_0x534884,_0x3506a4){var _0x358549={},_0x353314={},_0x409af9={'count':0x0,'rows':[]};var _0x2a5690=_[_0xb5fa('0x2c')](db[_0xb5fa('0x2d')][_0xb5fa('0x2e')],function(_0x1f4380){return{'name':_0x1f4380[_0xb5fa('0x2f')],'type':_0x1f4380[_0xb5fa('0x30')][_0xb5fa('0x31')]};});_0x353314[_0xb5fa('0x32')]=_[_0xb5fa('0x2c')](_0x2a5690,_0xb5fa('0x29'));_0x353314[_0xb5fa('0x33')]=_[_0xb5fa('0x34')](_0x534884[_0xb5fa('0x33')]);_0x353314[_0xb5fa('0x35')]=_['intersection'](_0x353314[_0xb5fa('0x32')],_0x353314['query']);_0x358549['attributes']=_['intersection'](_0x353314[_0xb5fa('0x32')],qs['fields'](_0x534884[_0xb5fa('0x33')]['fields']));_0x358549['attributes']=_0x358549[_0xb5fa('0x36')][_0xb5fa('0x37')]?_0x358549['attributes']:_0x353314['model'];if(!_0x534884[_0xb5fa('0x33')][_0xb5fa('0x38')](_0xb5fa('0x39'))){_0x358549['limit']=qs[_0xb5fa('0x1f')](_0x534884[_0xb5fa('0x33')]['limit']);_0x358549[_0xb5fa('0x1c')]=qs[_0xb5fa('0x1c')](_0x534884[_0xb5fa('0x33')]['offset']);}_0x358549[_0xb5fa('0x3a')]=qs[_0xb5fa('0x3b')](_0x534884[_0xb5fa('0x33')]['sort']);_0x358549[_0xb5fa('0x3c')]=qs[_0xb5fa('0x35')](_[_0xb5fa('0x3d')](_0x534884[_0xb5fa('0x33')],_0x353314['filters']),_0x2a5690);if(_0x534884['query']['filter']){_0x358549['where']=_['merge'](_0x358549['where'],{'$or':_[_0xb5fa('0x2c')](_0x2a5690,function(_0x4c0a4d){if(_0x4c0a4d[_0xb5fa('0x30')]!==_0xb5fa('0x3e')){var _0x36db1a={};_0x36db1a[_0x4c0a4d[_0xb5fa('0x29')]]={'$like':'%'+_0x534884[_0xb5fa('0x33')][_0xb5fa('0x3f')]+'%'};return _0x36db1a;}})});}_0x358549=_['merge']({},_0x358549,_0x534884['options']);var _0x4c4bf0={'where':_0x358549[_0xb5fa('0x3c')]};return db['Integration'][_0xb5fa('0x1e')](_0x4c4bf0)['then'](function(_0x58aa97){_0x409af9[_0xb5fa('0x1e')]=_0x58aa97;if(_0x534884[_0xb5fa('0x33')][_0xb5fa('0x40')]){_0x358549[_0xb5fa('0x41')]=[{'all':!![]}];}return db[_0xb5fa('0x2d')][_0xb5fa('0x42')](_0x358549);})[_0xb5fa('0x43')](function(_0x83df0b){_0x409af9[_0xb5fa('0x44')]=_0x83df0b;return _0x409af9;})[_0xb5fa('0x43')](respondWithFilteredResult(_0x3506a4,_0x358549))['catch'](handleError(_0x3506a4,null));};exports[_0xb5fa('0x45')]=function(_0x4bc9df,_0x233f90){var _0x39aac3={'raw':![],'where':{'id':_0x4bc9df[_0xb5fa('0x46')]['id']}},_0x2c7c5f={};_0x2c7c5f[_0xb5fa('0x32')]=_[_0xb5fa('0x34')](db[_0xb5fa('0x2d')][_0xb5fa('0x2e')]);_0x2c7c5f['query']=_[_0xb5fa('0x34')](_0x4bc9df[_0xb5fa('0x33')]);_0x2c7c5f['filters']=_[_0xb5fa('0x47')](_0x2c7c5f['model'],_0x2c7c5f[_0xb5fa('0x33')]);_0x39aac3[_0xb5fa('0x36')]=_['intersection'](_0x2c7c5f['model'],qs[_0xb5fa('0x48')](_0x4bc9df[_0xb5fa('0x33')][_0xb5fa('0x48')]));_0x39aac3[_0xb5fa('0x36')]=_0x39aac3[_0xb5fa('0x36')][_0xb5fa('0x37')]?_0x39aac3[_0xb5fa('0x36')]:_0x2c7c5f[_0xb5fa('0x32')];if(_0x4bc9df['query'][_0xb5fa('0x40')]){_0x39aac3[_0xb5fa('0x41')]=[{'all':!![]}];}_0x39aac3=_['merge']({},_0x39aac3,_0x4bc9df[_0xb5fa('0x49')]);return db[_0xb5fa('0x2d')][_0xb5fa('0x4a')](_0x39aac3)[_0xb5fa('0x43')](handleEntityNotFound(_0x233f90,null))[_0xb5fa('0x43')](respondWithResult(_0x233f90,null))[_0xb5fa('0x4b')](handleError(_0x233f90,null));};exports[_0xb5fa('0x4c')]=function(_0x33eb2c,_0x20f5f5){return db[_0xb5fa('0x2d')][_0xb5fa('0x4c')](_0x33eb2c[_0xb5fa('0x4d')],{})[_0xb5fa('0x43')](respondWithResult(_0x20f5f5,0xc9))[_0xb5fa('0x4b')](handleError(_0x20f5f5,null));};exports[_0xb5fa('0x25')]=function(_0x3a39f2,_0x52f5d8){if(_0x3a39f2['body']['id']){delete _0x3a39f2[_0xb5fa('0x4d')]['id'];}return db['Integration'][_0xb5fa('0x4a')]({'where':{'id':_0x3a39f2[_0xb5fa('0x46')]['id']}})['then'](handleEntityNotFound(_0x52f5d8,null))[_0xb5fa('0x43')](saveUpdates(_0x3a39f2[_0xb5fa('0x4d')],null))[_0xb5fa('0x43')](respondWithResult(_0x52f5d8,null))[_0xb5fa('0x4b')](handleError(_0x52f5d8,null));};exports[_0xb5fa('0x26')]=function(_0x3ffee0,_0x51d5f7){return db[_0xb5fa('0x2d')]['find']({'where':{'id':_0x3ffee0[_0xb5fa('0x46')]['id']}})[_0xb5fa('0x43')](handleEntityNotFound(_0x51d5f7,null))[_0xb5fa('0x43')](removeEntity(_0x51d5f7,null))['catch'](handleError(_0x51d5f7,null));}; \ No newline at end of file +var _0x5fab=['querystring','papaparse','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','status','json','offset','undefined','count','limit','set','Content-Range','apply','reject','save','update','destroy','end','sendStatus','name','send','index','map','Integration','rawAttributes','fieldName','type','key','model','query','keys','filters','attributes','length','hasOwnProperty','nolimit','order','sort','where','pick','VIRTUAL','filter','includeAll','include','findAll','then','rows','show','params','intersection','fields','options','find','catch','create','body','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','squel','crypto','jsforce'];(function(_0x2d489a,_0x25ce3c){var _0x11b301=function(_0x2bc6f1){while(--_0x2bc6f1){_0x2d489a['push'](_0x2d489a['shift']());}};_0x11b301(++_0x25ce3c);}(_0x5fab,0x177));var _0xb5fa=function(_0x2d991c,_0x1583d4){_0x2d991c=_0x2d991c-0x0;var _0x3d5af5=_0x5fab[_0x2d991c];return _0x3d5af5;};'use strict';var emlformat=require(_0xb5fa('0x0'));var rimraf=require(_0xb5fa('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xb5fa('0x2'));var rp=require(_0xb5fa('0x3'));var moment=require(_0xb5fa('0x4'));var BPromise=require(_0xb5fa('0x5'));var Mustache=require(_0xb5fa('0x6'));var util=require(_0xb5fa('0x7'));var path=require(_0xb5fa('0x8'));var sox=require(_0xb5fa('0x9'));var csv=require(_0xb5fa('0xa'));var ejs=require(_0xb5fa('0xb'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0xb5fa('0xc'));var crypto=require(_0xb5fa('0xd'));var jsforce=require(_0xb5fa('0xe'));var deskjs=require('desk.js');var toCsv=require(_0xb5fa('0xa'));var querystring=require(_0xb5fa('0xf'));var Papa=require(_0xb5fa('0x10'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0xb5fa('0x11'));var as=require(_0xb5fa('0x12'));var hardwareService=require(_0xb5fa('0x13'));var logger=require(_0xb5fa('0x14'))(_0xb5fa('0x15'));var utils=require(_0xb5fa('0x16'));var config=require(_0xb5fa('0x17'));var licenseUtil=require(_0xb5fa('0x18'));var db=require(_0xb5fa('0x19'))['db'];function respondWithStatusCode(_0x4d3576,_0x2ad830){_0x2ad830=_0x2ad830||0xcc;return function(_0x3dad4d){if(_0x3dad4d){return _0x4d3576['sendStatus'](_0x2ad830);}return _0x4d3576[_0xb5fa('0x1a')](_0x2ad830)['end']();};}function respondWithResult(_0x265992,_0x3fc372){_0x3fc372=_0x3fc372||0xc8;return function(_0x40c914){if(_0x40c914){return _0x265992[_0xb5fa('0x1a')](_0x3fc372)[_0xb5fa('0x1b')](_0x40c914);}};}function respondWithFilteredResult(_0x5371cf,_0x567f31){return function(_0x38e964){if(_0x38e964){var _0x587043=typeof _0x567f31[_0xb5fa('0x1c')]===_0xb5fa('0x1d')&&typeof _0x567f31['limit']==='undefined';var _0x451a55=_0x38e964[_0xb5fa('0x1e')];var _0x32e9e5=_0x587043?0x0:_0x567f31[_0xb5fa('0x1c')];var _0x324ba5=_0x587043?_0x38e964[_0xb5fa('0x1e')]:_0x567f31[_0xb5fa('0x1c')]+_0x567f31[_0xb5fa('0x1f')];var _0xc14dc4;if(_0x324ba5>=_0x451a55){_0x324ba5=_0x451a55;_0xc14dc4=0xc8;}else{_0xc14dc4=0xce;}_0x5371cf[_0xb5fa('0x1a')](_0xc14dc4);return _0x5371cf[_0xb5fa('0x20')](_0xb5fa('0x21'),_0x32e9e5+'-'+_0x324ba5+'/'+_0x451a55)['json'](_0x38e964);}return null;};}function patchUpdates(_0x432bfa){return function(_0x519e20){try{jsonpatch[_0xb5fa('0x22')](_0x519e20,_0x432bfa,!![]);}catch(_0x4a6c04){return BPromise[_0xb5fa('0x23')](_0x4a6c04);}return _0x519e20[_0xb5fa('0x24')]();};}function saveUpdates(_0x4e05c0,_0x40dfdf){return function(_0x3a2ab9){if(_0x3a2ab9){return _0x3a2ab9[_0xb5fa('0x25')](_0x4e05c0)['then'](function(_0x32a85c){return _0x32a85c;});}return null;};}function removeEntity(_0xec108f,_0x444237){return function(_0x542348){if(_0x542348){return _0x542348[_0xb5fa('0x26')]()['then'](function(){_0xec108f[_0xb5fa('0x1a')](0xcc)[_0xb5fa('0x27')]();});}};}function handleEntityNotFound(_0x11053a,_0x543edf){return function(_0x2dbd22){if(!_0x2dbd22){_0x11053a[_0xb5fa('0x28')](0x194);}return _0x2dbd22;};}function handleError(_0x6a455c,_0x20d649){_0x20d649=_0x20d649||0x1f4;return function(_0x568870){logger['error'](_0x568870['stack']);if(_0x568870['name']){delete _0x568870[_0xb5fa('0x29')];}_0x6a455c[_0xb5fa('0x1a')](_0x20d649)[_0xb5fa('0x2a')](_0x568870);};}exports[_0xb5fa('0x2b')]=function(_0x534884,_0x3506a4){var _0x358549={},_0x353314={},_0x409af9={'count':0x0,'rows':[]};var _0x2a5690=_[_0xb5fa('0x2c')](db[_0xb5fa('0x2d')][_0xb5fa('0x2e')],function(_0x1f4380){return{'name':_0x1f4380[_0xb5fa('0x2f')],'type':_0x1f4380[_0xb5fa('0x30')][_0xb5fa('0x31')]};});_0x353314[_0xb5fa('0x32')]=_[_0xb5fa('0x2c')](_0x2a5690,_0xb5fa('0x29'));_0x353314[_0xb5fa('0x33')]=_[_0xb5fa('0x34')](_0x534884[_0xb5fa('0x33')]);_0x353314[_0xb5fa('0x35')]=_['intersection'](_0x353314[_0xb5fa('0x32')],_0x353314['query']);_0x358549['attributes']=_['intersection'](_0x353314[_0xb5fa('0x32')],qs['fields'](_0x534884[_0xb5fa('0x33')]['fields']));_0x358549['attributes']=_0x358549[_0xb5fa('0x36')][_0xb5fa('0x37')]?_0x358549['attributes']:_0x353314['model'];if(!_0x534884[_0xb5fa('0x33')][_0xb5fa('0x38')](_0xb5fa('0x39'))){_0x358549['limit']=qs[_0xb5fa('0x1f')](_0x534884[_0xb5fa('0x33')]['limit']);_0x358549[_0xb5fa('0x1c')]=qs[_0xb5fa('0x1c')](_0x534884[_0xb5fa('0x33')]['offset']);}_0x358549[_0xb5fa('0x3a')]=qs[_0xb5fa('0x3b')](_0x534884[_0xb5fa('0x33')]['sort']);_0x358549[_0xb5fa('0x3c')]=qs[_0xb5fa('0x35')](_[_0xb5fa('0x3d')](_0x534884[_0xb5fa('0x33')],_0x353314['filters']),_0x2a5690);if(_0x534884['query']['filter']){_0x358549['where']=_['merge'](_0x358549['where'],{'$or':_[_0xb5fa('0x2c')](_0x2a5690,function(_0x4c0a4d){if(_0x4c0a4d[_0xb5fa('0x30')]!==_0xb5fa('0x3e')){var _0x36db1a={};_0x36db1a[_0x4c0a4d[_0xb5fa('0x29')]]={'$like':'%'+_0x534884[_0xb5fa('0x33')][_0xb5fa('0x3f')]+'%'};return _0x36db1a;}})});}_0x358549=_['merge']({},_0x358549,_0x534884['options']);var _0x4c4bf0={'where':_0x358549[_0xb5fa('0x3c')]};return db['Integration'][_0xb5fa('0x1e')](_0x4c4bf0)['then'](function(_0x58aa97){_0x409af9[_0xb5fa('0x1e')]=_0x58aa97;if(_0x534884[_0xb5fa('0x33')][_0xb5fa('0x40')]){_0x358549[_0xb5fa('0x41')]=[{'all':!![]}];}return db[_0xb5fa('0x2d')][_0xb5fa('0x42')](_0x358549);})[_0xb5fa('0x43')](function(_0x83df0b){_0x409af9[_0xb5fa('0x44')]=_0x83df0b;return _0x409af9;})[_0xb5fa('0x43')](respondWithFilteredResult(_0x3506a4,_0x358549))['catch'](handleError(_0x3506a4,null));};exports[_0xb5fa('0x45')]=function(_0x4bc9df,_0x233f90){var _0x39aac3={'raw':![],'where':{'id':_0x4bc9df[_0xb5fa('0x46')]['id']}},_0x2c7c5f={};_0x2c7c5f[_0xb5fa('0x32')]=_[_0xb5fa('0x34')](db[_0xb5fa('0x2d')][_0xb5fa('0x2e')]);_0x2c7c5f['query']=_[_0xb5fa('0x34')](_0x4bc9df[_0xb5fa('0x33')]);_0x2c7c5f['filters']=_[_0xb5fa('0x47')](_0x2c7c5f['model'],_0x2c7c5f[_0xb5fa('0x33')]);_0x39aac3[_0xb5fa('0x36')]=_['intersection'](_0x2c7c5f['model'],qs[_0xb5fa('0x48')](_0x4bc9df[_0xb5fa('0x33')][_0xb5fa('0x48')]));_0x39aac3[_0xb5fa('0x36')]=_0x39aac3[_0xb5fa('0x36')][_0xb5fa('0x37')]?_0x39aac3[_0xb5fa('0x36')]:_0x2c7c5f[_0xb5fa('0x32')];if(_0x4bc9df['query'][_0xb5fa('0x40')]){_0x39aac3[_0xb5fa('0x41')]=[{'all':!![]}];}_0x39aac3=_['merge']({},_0x39aac3,_0x4bc9df[_0xb5fa('0x49')]);return db[_0xb5fa('0x2d')][_0xb5fa('0x4a')](_0x39aac3)[_0xb5fa('0x43')](handleEntityNotFound(_0x233f90,null))[_0xb5fa('0x43')](respondWithResult(_0x233f90,null))[_0xb5fa('0x4b')](handleError(_0x233f90,null));};exports[_0xb5fa('0x4c')]=function(_0x33eb2c,_0x20f5f5){return db[_0xb5fa('0x2d')][_0xb5fa('0x4c')](_0x33eb2c[_0xb5fa('0x4d')],{})[_0xb5fa('0x43')](respondWithResult(_0x20f5f5,0xc9))[_0xb5fa('0x4b')](handleError(_0x20f5f5,null));};exports[_0xb5fa('0x25')]=function(_0x3a39f2,_0x52f5d8){if(_0x3a39f2['body']['id']){delete _0x3a39f2[_0xb5fa('0x4d')]['id'];}return db['Integration'][_0xb5fa('0x4a')]({'where':{'id':_0x3a39f2[_0xb5fa('0x46')]['id']}})['then'](handleEntityNotFound(_0x52f5d8,null))[_0xb5fa('0x43')](saveUpdates(_0x3a39f2[_0xb5fa('0x4d')],null))[_0xb5fa('0x43')](respondWithResult(_0x52f5d8,null))[_0xb5fa('0x4b')](handleError(_0x52f5d8,null));};exports[_0xb5fa('0x26')]=function(_0x3ffee0,_0x51d5f7){return db[_0xb5fa('0x2d')]['find']({'where':{'id':_0x3ffee0[_0xb5fa('0x46')]['id']}})[_0xb5fa('0x43')](handleEntityNotFound(_0x51d5f7,null))[_0xb5fa('0x43')](removeEntity(_0x51d5f7,null))['catch'](handleError(_0x51d5f7,null));}; \ No newline at end of file diff --git a/server/api/integration/integration.model.js b/server/api/integration/integration.model.js index 511903f..c9e74e8 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 _0xa0c1=['request-promise','path','rimraf','../../config/environment','./integration.attributes','exports','integrations','api','moment','bluebird'];(function(_0xb855a6,_0x32074a){var _0x5b57bd=function(_0x296c67){while(--_0x296c67){_0xb855a6['push'](_0xb855a6['shift']());}};_0x5b57bd(++_0x32074a);}(_0xa0c1,0x7f));var _0x1a0c=function(_0x4eee0c,_0x5607b9){_0x4eee0c=_0x4eee0c-0x0;var _0x3e8820=_0xa0c1[_0x4eee0c];return _0x3e8820;};'use strict';var _=require('lodash');var util=require('util');var logger=require('../../config/logger')(_0x1a0c('0x0'));var moment=require(_0x1a0c('0x1'));var BPromise=require(_0x1a0c('0x2'));var rp=require(_0x1a0c('0x3'));var fs=require('fs');var path=require(_0x1a0c('0x4'));var rimraf=require(_0x1a0c('0x5'));var config=require(_0x1a0c('0x6'));var attributes=require(_0x1a0c('0x7'));module[_0x1a0c('0x8')]=function(_0x50756,_0x4612d1){return _0x50756['define']('Integration',attributes,{'tableName':_0x1a0c('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xdac1=['exports','define','integrations','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','../../config/environment','./integration.attributes'];(function(_0x111a19,_0x49ea56){var _0x3a7309=function(_0xdc9b32){while(--_0xdc9b32){_0x111a19['push'](_0x111a19['shift']());}};_0x3a7309(++_0x49ea56);}(_0xdac1,0x1bd));var _0x1dac=function(_0x17960b,_0x46b5bf){_0x17960b=_0x17960b-0x0;var _0x2bac0e=_0xdac1[_0x17960b];return _0x2bac0e;};'use strict';var _=require(_0x1dac('0x0'));var util=require(_0x1dac('0x1'));var logger=require(_0x1dac('0x2'))(_0x1dac('0x3'));var moment=require(_0x1dac('0x4'));var BPromise=require(_0x1dac('0x5'));var rp=require(_0x1dac('0x6'));var fs=require('fs');var path=require(_0x1dac('0x7'));var rimraf=require('rimraf');var config=require(_0x1dac('0x8'));var attributes=require(_0x1dac('0x9'));module[_0x1dac('0xa')]=function(_0x42ed3d,_0x17fef2){return _0x42ed3d[_0x1dac('0xb')]('Integration',attributes,{'tableName':_0x1dac('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/integration/integration.rpc.js b/server/api/integration/integration.rpc.js index 517c3fc..131b75d 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 _0x9f0e=['../../config/environment','jayson/promise','request','then','info','Integration,\x20%s,\x20%s','request\x20sent','debug','Integration,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','lodash','util','moment','bluebird','randomstring','../../config/utils','../../config/logger','rpc'];(function(_0x5ce515,_0x2c53bc){var _0xcdb139=function(_0x3c346b){while(--_0x3c346b){_0x5ce515['push'](_0x5ce515['shift']());}};_0xcdb139(++_0x2c53bc);}(_0x9f0e,0x116));var _0xe9f0=function(_0x1823f6,_0x29142a){_0x1823f6=_0x1823f6-0x0;var _0x3eb6f1=_0x9f0e[_0x1823f6];return _0x3eb6f1;};'use strict';var _=require(_0xe9f0('0x0'));var util=require(_0xe9f0('0x1'));var moment=require(_0xe9f0('0x2'));var BPromise=require(_0xe9f0('0x3'));var rs=require(_0xe9f0('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0xe9f0('0x5'));var logger=require(_0xe9f0('0x6'))(_0xe9f0('0x7'));var config=require(_0xe9f0('0x8'));var jayson=require(_0xe9f0('0x9'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x3a17b3,_0x167198,_0xe64a79){return new BPromise(function(_0x4be6a6,_0xf4a256){return client[_0xe9f0('0xa')](_0x3a17b3,_0xe64a79)[_0xe9f0('0xb')](function(_0x3386a8){logger[_0xe9f0('0xc')](_0xe9f0('0xd'),_0x167198,_0xe9f0('0xe'));logger[_0xe9f0('0xf')](_0xe9f0('0x10'),_0x167198,'request\x20sent',JSON[_0xe9f0('0x11')](_0x3386a8));if(_0x3386a8[_0xe9f0('0x12')]){if(_0x3386a8[_0xe9f0('0x12')]['code']===0x1f4){logger[_0xe9f0('0x12')]('Integration,\x20%s,\x20%s',_0x167198,_0x3386a8[_0xe9f0('0x12')][_0xe9f0('0x13')]);return _0xf4a256(_0x3386a8[_0xe9f0('0x12')][_0xe9f0('0x13')]);}logger['error'](_0xe9f0('0xd'),_0x167198,_0x3386a8['error'][_0xe9f0('0x13')]);return _0x4be6a6(_0x3386a8[_0xe9f0('0x12')][_0xe9f0('0x13')]);}else{logger['info'](_0xe9f0('0xd'),_0x167198,_0xe9f0('0xe'));_0x4be6a6(_0x3386a8[_0xe9f0('0x14')]['message']);}})[_0xe9f0('0x15')](function(_0x1e16e0){logger[_0xe9f0('0x12')](_0xe9f0('0xd'),_0x167198,_0x1e16e0);_0xf4a256(_0x1e16e0);});});} \ No newline at end of file +var _0xdb28=['moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','request','then','Integration,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','info','catch','lodash','util'];(function(_0x2650d1,_0x101f96){var _0x440a79=function(_0x22d4fe){while(--_0x22d4fe){_0x2650d1['push'](_0x2650d1['shift']());}};_0x440a79(++_0x101f96);}(_0xdb28,0x106));var _0x8db2=function(_0x360191,_0x1489cc){_0x360191=_0x360191-0x0;var _0x1b6b8d=_0xdb28[_0x360191];return _0x1b6b8d;};'use strict';var _=require(_0x8db2('0x0'));var util=require(_0x8db2('0x1'));var moment=require(_0x8db2('0x2'));var BPromise=require(_0x8db2('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x8db2('0x4'));var db=require(_0x8db2('0x5'))['db'];var utils=require(_0x8db2('0x6'));var logger=require(_0x8db2('0x7'))(_0x8db2('0x8'));var config=require('../../config/environment');var jayson=require(_0x8db2('0x9'));var client=jayson[_0x8db2('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x494b40,_0x477f50,_0x46932f){return new BPromise(function(_0x131537,_0x29f698){return client[_0x8db2('0xb')](_0x494b40,_0x46932f)[_0x8db2('0xc')](function(_0x126c78){logger['info'](_0x8db2('0xd'),_0x477f50,_0x8db2('0xe'));logger[_0x8db2('0xf')]('Integration,\x20%s,\x20%s,\x20%s',_0x477f50,_0x8db2('0xe'),JSON[_0x8db2('0x10')](_0x126c78));if(_0x126c78['error']){if(_0x126c78[_0x8db2('0x11')][_0x8db2('0x12')]===0x1f4){logger[_0x8db2('0x11')](_0x8db2('0xd'),_0x477f50,_0x126c78[_0x8db2('0x11')]['message']);return _0x29f698(_0x126c78['error'][_0x8db2('0x13')]);}logger[_0x8db2('0x11')](_0x8db2('0xd'),_0x477f50,_0x126c78[_0x8db2('0x11')][_0x8db2('0x13')]);return _0x131537(_0x126c78[_0x8db2('0x11')][_0x8db2('0x13')]);}else{logger[_0x8db2('0x14')](_0x8db2('0xd'),_0x477f50,_0x8db2('0xe'));_0x131537(_0x126c78['result'][_0x8db2('0x13')]);}})[_0x8db2('0x15')](function(_0x48101e){logger[_0x8db2('0x11')](_0x8db2('0xd'),_0x477f50,_0x48101e);_0x29f698(_0x48101e);});});} \ No newline at end of file diff --git a/server/api/integrationReport/index.js b/server/api/integrationReport/index.js index 9fd9474..bfbce48 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 _0x7880=['Router','fs-extra','../../components/interaction/service','../../config/environment','./integrationReport.controller','get','isAuthenticated','index','/describe','describe','/:id','show','create','put','delete','destroy','exports','util','path','connect-timeout','express'];(function(_0x383798,_0x4f16fe){var _0x2555b2=function(_0x3f61df){while(--_0x3f61df){_0x383798['push'](_0x383798['shift']());}};_0x2555b2(++_0x4f16fe);}(_0x7880,0x1f4));var _0x0788=function(_0x5c7525,_0x39490f){_0x5c7525=_0x5c7525-0x0;var _0x2e2ec8=_0x7880[_0x5c7525];return _0x2e2ec8;};'use strict';var multer=require('multer');var util=require(_0x0788('0x0'));var path=require(_0x0788('0x1'));var timeout=require(_0x0788('0x2'));var express=require(_0x0788('0x3'));var router=express[_0x0788('0x4')]();var fs_extra=require(_0x0788('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0x0788('0x6'));var config=require(_0x0788('0x7'));var controller=require(_0x0788('0x8'));router[_0x0788('0x9')]('/',auth[_0x0788('0xa')](),controller[_0x0788('0xb')]);router[_0x0788('0x9')](_0x0788('0xc'),auth[_0x0788('0xa')](),controller[_0x0788('0xd')]);router['get'](_0x0788('0xe'),auth['isAuthenticated'](),controller[_0x0788('0xf')]);router['post']('/',auth[_0x0788('0xa')](),controller[_0x0788('0x10')]);router[_0x0788('0x11')](_0x0788('0xe'),auth[_0x0788('0xa')](),controller['update']);router[_0x0788('0x12')](_0x0788('0xe'),auth[_0x0788('0xa')](),controller[_0x0788('0x13')]);module[_0x0788('0x14')]=router; \ No newline at end of file +var _0x5fab=['express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./integrationReport.controller','get','isAuthenticated','/describe','describe','/:id','show','create','put','update','delete','destroy','multer','util','connect-timeout'];(function(_0x4d2315,_0x1ff5f7){var _0x4ea7ae=function(_0x17cf9f){while(--_0x17cf9f){_0x4d2315['push'](_0x4d2315['shift']());}};_0x4ea7ae(++_0x1ff5f7);}(_0x5fab,0x177));var _0xb5fa=function(_0x55b745,_0x36e0fa){_0x55b745=_0x55b745-0x0;var _0x1772a7=_0x5fab[_0x55b745];return _0x1772a7;};'use strict';var multer=require(_0xb5fa('0x0'));var util=require(_0xb5fa('0x1'));var path=require('path');var timeout=require(_0xb5fa('0x2'));var express=require(_0xb5fa('0x3'));var router=express[_0xb5fa('0x4')]();var fs_extra=require(_0xb5fa('0x5'));var auth=require(_0xb5fa('0x6'));var interaction=require(_0xb5fa('0x7'));var config=require(_0xb5fa('0x8'));var controller=require(_0xb5fa('0x9'));router[_0xb5fa('0xa')]('/',auth[_0xb5fa('0xb')](),controller['index']);router['get'](_0xb5fa('0xc'),auth[_0xb5fa('0xb')](),controller[_0xb5fa('0xd')]);router['get'](_0xb5fa('0xe'),auth[_0xb5fa('0xb')](),controller[_0xb5fa('0xf')]);router['post']('/',auth['isAuthenticated'](),controller[_0xb5fa('0x10')]);router[_0xb5fa('0x11')](_0xb5fa('0xe'),auth[_0xb5fa('0xb')](),controller[_0xb5fa('0x12')]);router[_0xb5fa('0x13')](_0xb5fa('0xe'),auth[_0xb5fa('0xb')](),controller[_0xb5fa('0x14')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/integrationReport/integrationReport.attributes.js b/server/api/integrationReport/integrationReport.attributes.js index 01577ca..a9f0953 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 _0x638d=['RECEIVED','FAILED','sequelize','exports','STRING','INTEGER','DATE','BOOLEAN','TEXT','ENUM','SENT','SENDING'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x638d,0x1e2));var _0xd638=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x638d[_0x3dd15e];return _0x231fd0;};'use strict';var Sequelize=require(_0xd638('0x0'));module[_0xd638('0x1')]={'integration':{'type':Sequelize[_0xd638('0x2')]},'eventChannel':{'type':Sequelize[_0xd638('0x2')]},'exitStatus':{'type':Sequelize[_0xd638('0x2')]},'ticketId':{'type':Sequelize['STRING']},'integrationId':{'type':Sequelize[_0xd638('0x3')]},'contacts':{'type':Sequelize[_0xd638('0x2')]},'uniqueid':{'type':Sequelize[_0xd638('0x2')]},'calleridnum':{'type':Sequelize[_0xd638('0x2')]},'calleridname':{'type':Sequelize[_0xd638('0x2')]},'queue':{'type':Sequelize[_0xd638('0x2')]},'interface':{'type':Sequelize[_0xd638('0x2')]},'membername':{'type':Sequelize['STRING']},'agentcalledAt':{'type':Sequelize[_0xd638('0x4')]},'agentconnectAt':{'type':Sequelize['DATE']},'holdtime':{'type':Sequelize[_0xd638('0x3')]},'agentcomplete':{'type':Sequelize[_0xd638('0x5')],'defaultValue':![]},'agentcompleteAt':{'type':Sequelize[_0xd638('0x4')]},'talktime':{'type':Sequelize['INTEGER']},'agentacw':{'type':Sequelize[_0xd638('0x5')],'defaultValue':![]},'acwtime':{'type':Sequelize['INTEGER']},'reason':{'type':Sequelize[_0xd638('0x2')]},'agentringnoanswer':{'type':Sequelize[_0xd638('0x5')],'defaultValue':![]},'agentringnoanswerAt':{'type':Sequelize['DATE']},'agentdump':{'type':Sequelize[_0xd638('0x5')],'defaultValue':![]},'agentdumpAt':{'type':Sequelize['DATE']},'lastevent':{'type':Sequelize[_0xd638('0x2')]},'channel':{'type':Sequelize[_0xd638('0x2')]},'channelstate':{'type':Sequelize['INTEGER']},'channelstatedesc':{'type':Sequelize['STRING']},'connectedlinenum':{'type':Sequelize[_0xd638('0x2')]},'connectedlinename':{'type':Sequelize['STRING']},'language':{'type':Sequelize['STRING']},'accountcode':{'type':Sequelize[_0xd638('0x2')]},'context':{'type':Sequelize[_0xd638('0x2')]},'exten':{'type':Sequelize[_0xd638('0x2')]},'priority':{'type':Sequelize['STRING']},'destchannel':{'type':Sequelize[_0xd638('0x2')]},'destchannelstate':{'type':Sequelize['INTEGER']},'destchannelstatedesc':{'type':Sequelize[_0xd638('0x2')]},'destcalleridnum':{'type':Sequelize['STRING']},'destcalleridname':{'type':Sequelize[_0xd638('0x2')]},'destconnectedlinenum':{'type':Sequelize[_0xd638('0x2')]},'destconnectedlinename':{'type':Sequelize[_0xd638('0x2')]},'destlanguage':{'type':Sequelize[_0xd638('0x2')]},'destaccountcode':{'type':Sequelize[_0xd638('0x2')]},'destcontext':{'type':Sequelize['STRING']},'destexten':{'type':Sequelize[_0xd638('0x2')]},'destpriority':{'type':Sequelize[_0xd638('0x2')]},'destuniqueid':{'type':Sequelize[_0xd638('0x2')]},'messageId':{'type':Sequelize[_0xd638('0x2')]},'inReplyTo':{'type':Sequelize[_0xd638('0x2')]},'subject':{'type':Sequelize['STRING']},'from':{'type':Sequelize[_0xd638('0x2')]},'to':{'type':Sequelize[_0xd638('0x2')]},'cc':{'type':Sequelize[_0xd638('0x2')]},'attachment':{'type':Sequelize[_0xd638('0x6')]},'html':{'type':Sequelize[_0xd638('0x6')]},'text':{'type':Sequelize[_0xd638('0x6')]},'status':{'type':Sequelize[_0xd638('0x7')](_0xd638('0x8'),_0xd638('0x9'),_0xd638('0xa'),_0xd638('0xb'))},'url':{'type':Sequelize[_0xd638('0x2')]},'app':{'type':Sequelize[_0xd638('0x2')]},'appdata':{'type':Sequelize[_0xd638('0x2')]},'projectId':{'type':Sequelize[_0xd638('0x3')]}}; \ No newline at end of file +var _0x11da=['RECEIVED','FAILED','sequelize','exports','STRING','INTEGER','DATE','BOOLEAN','TEXT','SENT'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0x11da,0x12e));var _0xa11d=function(_0x12b423,_0x5f1b2c){_0x12b423=_0x12b423-0x0;var _0x398eb3=_0x11da[_0x12b423];return _0x398eb3;};'use strict';var Sequelize=require(_0xa11d('0x0'));module[_0xa11d('0x1')]={'integration':{'type':Sequelize[_0xa11d('0x2')]},'eventChannel':{'type':Sequelize[_0xa11d('0x2')]},'exitStatus':{'type':Sequelize['STRING']},'ticketId':{'type':Sequelize[_0xa11d('0x2')]},'integrationId':{'type':Sequelize[_0xa11d('0x3')]},'contacts':{'type':Sequelize[_0xa11d('0x2')]},'uniqueid':{'type':Sequelize[_0xa11d('0x2')]},'calleridnum':{'type':Sequelize[_0xa11d('0x2')]},'calleridname':{'type':Sequelize[_0xa11d('0x2')]},'queue':{'type':Sequelize[_0xa11d('0x2')]},'interface':{'type':Sequelize[_0xa11d('0x2')]},'membername':{'type':Sequelize[_0xa11d('0x2')]},'agentcalledAt':{'type':Sequelize[_0xa11d('0x4')]},'agentconnectAt':{'type':Sequelize[_0xa11d('0x4')]},'holdtime':{'type':Sequelize[_0xa11d('0x3')]},'agentcomplete':{'type':Sequelize[_0xa11d('0x5')],'defaultValue':![]},'agentcompleteAt':{'type':Sequelize[_0xa11d('0x4')]},'talktime':{'type':Sequelize[_0xa11d('0x3')]},'agentacw':{'type':Sequelize[_0xa11d('0x5')],'defaultValue':![]},'acwtime':{'type':Sequelize['INTEGER']},'reason':{'type':Sequelize[_0xa11d('0x2')]},'agentringnoanswer':{'type':Sequelize[_0xa11d('0x5')],'defaultValue':![]},'agentringnoanswerAt':{'type':Sequelize[_0xa11d('0x4')]},'agentdump':{'type':Sequelize[_0xa11d('0x5')],'defaultValue':![]},'agentdumpAt':{'type':Sequelize[_0xa11d('0x4')]},'lastevent':{'type':Sequelize[_0xa11d('0x2')]},'channel':{'type':Sequelize['STRING']},'channelstate':{'type':Sequelize[_0xa11d('0x3')]},'channelstatedesc':{'type':Sequelize[_0xa11d('0x2')]},'connectedlinenum':{'type':Sequelize[_0xa11d('0x2')]},'connectedlinename':{'type':Sequelize[_0xa11d('0x2')]},'language':{'type':Sequelize['STRING']},'accountcode':{'type':Sequelize[_0xa11d('0x2')]},'context':{'type':Sequelize['STRING']},'exten':{'type':Sequelize[_0xa11d('0x2')]},'priority':{'type':Sequelize[_0xa11d('0x2')]},'destchannel':{'type':Sequelize['STRING']},'destchannelstate':{'type':Sequelize[_0xa11d('0x3')]},'destchannelstatedesc':{'type':Sequelize['STRING']},'destcalleridnum':{'type':Sequelize[_0xa11d('0x2')]},'destcalleridname':{'type':Sequelize[_0xa11d('0x2')]},'destconnectedlinenum':{'type':Sequelize['STRING']},'destconnectedlinename':{'type':Sequelize[_0xa11d('0x2')]},'destlanguage':{'type':Sequelize['STRING']},'destaccountcode':{'type':Sequelize[_0xa11d('0x2')]},'destcontext':{'type':Sequelize['STRING']},'destexten':{'type':Sequelize[_0xa11d('0x2')]},'destpriority':{'type':Sequelize['STRING']},'destuniqueid':{'type':Sequelize[_0xa11d('0x2')]},'messageId':{'type':Sequelize['STRING']},'inReplyTo':{'type':Sequelize[_0xa11d('0x2')]},'subject':{'type':Sequelize['STRING']},'from':{'type':Sequelize[_0xa11d('0x2')]},'to':{'type':Sequelize[_0xa11d('0x2')]},'cc':{'type':Sequelize[_0xa11d('0x2')]},'attachment':{'type':Sequelize[_0xa11d('0x6')]},'html':{'type':Sequelize[_0xa11d('0x6')]},'text':{'type':Sequelize[_0xa11d('0x6')]},'status':{'type':Sequelize['ENUM'](_0xa11d('0x7'),'SENDING',_0xa11d('0x8'),_0xa11d('0x9'))},'url':{'type':Sequelize[_0xa11d('0x2')]},'app':{'type':Sequelize[_0xa11d('0x2')]},'appdata':{'type':Sequelize[_0xa11d('0x2')]},'projectId':{'type':Sequelize[_0xa11d('0x3')]}}; \ No newline at end of file diff --git a/server/api/integrationReport/integrationReport.controller.js b/server/api/integrationReport/integrationReport.controller.js index f21ea1b..4e31a88 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 _0x727a=['stack','name','map','IntegrationReport','rawAttributes','type','model','query','keys','filters','intersection','fields','attributes','nolimit','order','sort','filter','where','VIRTUAL','merge','options','include','findAll','show','length','includeAll','find','create','catch','body','params','describe','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','json','offset','undefined','limit','count','set','apply','save','update','then','destroy','end','error'];(function(_0x382219,_0x42b9e7){var _0x291eba=function(_0x225760){while(--_0x225760){_0x382219['push'](_0x382219['shift']());}};_0x291eba(++_0x42b9e7);}(_0x727a,0xfe));var _0xa727=function(_0x1190c2,_0x2c078b){_0x1190c2=_0x1190c2-0x0;var _0x6ec988=_0x727a[_0x1190c2];return _0x6ec988;};'use strict';var emlformat=require(_0xa727('0x0'));var rimraf=require(_0xa727('0x1'));var zipdir=require(_0xa727('0x2'));var jsonpatch=require(_0xa727('0x3'));var rp=require(_0xa727('0x4'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0xa727('0x5'));var util=require(_0xa727('0x6'));var path=require(_0xa727('0x7'));var sox=require(_0xa727('0x8'));var csv=require(_0xa727('0x9'));var ejs=require(_0xa727('0xa'));var fs=require('fs');var fs_extra=require(_0xa727('0xb'));var _=require(_0xa727('0xc'));var squel=require(_0xa727('0xd'));var crypto=require(_0xa727('0xe'));var jsforce=require(_0xa727('0xf'));var deskjs=require(_0xa727('0x10'));var toCsv=require(_0xa727('0x9'));var querystring=require(_0xa727('0x11'));var Papa=require(_0xa727('0x12'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0xa727('0x13'));var as=require(_0xa727('0x14'));var hardwareService=require(_0xa727('0x15'));var logger=require(_0xa727('0x16'))('api');var utils=require(_0xa727('0x17'));var config=require(_0xa727('0x18'));var licenseUtil=require(_0xa727('0x19'));var db=require(_0xa727('0x1a'))['db'];function respondWithStatusCode(_0x1d9df9,_0x468d44){_0x468d44=_0x468d44||0xcc;return function(_0x39942f){if(_0x39942f){return _0x1d9df9[_0xa727('0x1b')](_0x468d44);}return _0x1d9df9[_0xa727('0x1c')](_0x468d44)['end']();};}function respondWithResult(_0x9b3b3f,_0x2a1f0b){_0x2a1f0b=_0x2a1f0b||0xc8;return function(_0x807379){if(_0x807379){return _0x9b3b3f[_0xa727('0x1c')](_0x2a1f0b)[_0xa727('0x1d')](_0x807379);}};}function respondWithFilteredResult(_0x5200d7,_0xf15738){return function(_0x236c53){if(_0x236c53){var _0x511c7a=typeof _0xf15738[_0xa727('0x1e')]===_0xa727('0x1f')&&typeof _0xf15738[_0xa727('0x20')]===_0xa727('0x1f');var _0x5bc682=_0x236c53['count'];var _0x11230a=_0x511c7a?0x0:_0xf15738['offset'];var _0x3b46a8=_0x511c7a?_0x236c53[_0xa727('0x21')]:_0xf15738['offset']+_0xf15738[_0xa727('0x20')];var _0x41ac9b;if(_0x3b46a8>=_0x5bc682){_0x3b46a8=_0x5bc682;_0x41ac9b=0xc8;}else{_0x41ac9b=0xce;}_0x5200d7[_0xa727('0x1c')](_0x41ac9b);return _0x5200d7[_0xa727('0x22')]('Content-Range',_0x11230a+'-'+_0x3b46a8+'/'+_0x5bc682)[_0xa727('0x1d')](_0x236c53);}return null;};}function patchUpdates(_0x2b41d2){return function(_0x1b941e){try{jsonpatch[_0xa727('0x23')](_0x1b941e,_0x2b41d2,!![]);}catch(_0x333c0e){return BPromise['reject'](_0x333c0e);}return _0x1b941e[_0xa727('0x24')]();};}function saveUpdates(_0x27ed6f,_0x388344){return function(_0x9a32d2){if(_0x9a32d2){return _0x9a32d2[_0xa727('0x25')](_0x27ed6f)[_0xa727('0x26')](function(_0x4ba6ed){return _0x4ba6ed;});}return null;};}function removeEntity(_0x58f90d,_0x46d522){return function(_0x1d384b){if(_0x1d384b){return _0x1d384b[_0xa727('0x27')]()[_0xa727('0x26')](function(){_0x58f90d[_0xa727('0x1c')](0xcc)[_0xa727('0x28')]();});}};}function handleEntityNotFound(_0x4875ea,_0x205414){return function(_0x3c4702){if(!_0x3c4702){_0x4875ea[_0xa727('0x1b')](0x194);}return _0x3c4702;};}function handleError(_0x45e117,_0x8cc2a1){_0x8cc2a1=_0x8cc2a1||0x1f4;return function(_0x1194cc){logger[_0xa727('0x29')](_0x1194cc[_0xa727('0x2a')]);if(_0x1194cc[_0xa727('0x2b')]){delete _0x1194cc['name'];}_0x45e117[_0xa727('0x1c')](_0x8cc2a1)['send'](_0x1194cc);};}exports['index']=function(_0x3e7eb1,_0x5cc67d){var _0x12e15e={},_0x5d4bf8={},_0x37b650={'count':0x0,'rows':[]};var _0x1c46b8=_[_0xa727('0x2c')](db[_0xa727('0x2d')][_0xa727('0x2e')],function(_0x1f1b23){return{'name':_0x1f1b23['fieldName'],'type':_0x1f1b23[_0xa727('0x2f')]['key']};});_0x5d4bf8[_0xa727('0x30')]=_[_0xa727('0x2c')](_0x1c46b8,_0xa727('0x2b'));_0x5d4bf8[_0xa727('0x31')]=_[_0xa727('0x32')](_0x3e7eb1[_0xa727('0x31')]);_0x5d4bf8[_0xa727('0x33')]=_['intersection'](_0x5d4bf8[_0xa727('0x30')],_0x5d4bf8['query']);_0x12e15e['attributes']=_[_0xa727('0x34')](_0x5d4bf8[_0xa727('0x30')],qs[_0xa727('0x35')](_0x3e7eb1[_0xa727('0x31')][_0xa727('0x35')]));_0x12e15e[_0xa727('0x36')]=_0x12e15e[_0xa727('0x36')]['length']?_0x12e15e['attributes']:_0x5d4bf8[_0xa727('0x30')];if(!_0x3e7eb1[_0xa727('0x31')]['hasOwnProperty'](_0xa727('0x37'))){_0x12e15e[_0xa727('0x20')]=qs[_0xa727('0x20')](_0x3e7eb1[_0xa727('0x31')][_0xa727('0x20')]);_0x12e15e[_0xa727('0x1e')]=qs[_0xa727('0x1e')](_0x3e7eb1['query'][_0xa727('0x1e')]);}_0x12e15e[_0xa727('0x38')]=qs['sort'](_0x3e7eb1[_0xa727('0x31')][_0xa727('0x39')]);_0x12e15e['where']=qs['filters'](_['pick'](_0x3e7eb1[_0xa727('0x31')],_0x5d4bf8[_0xa727('0x33')]),_0x1c46b8);if(_0x3e7eb1[_0xa727('0x31')][_0xa727('0x3a')]){_0x12e15e[_0xa727('0x3b')]=_['merge'](_0x12e15e[_0xa727('0x3b')],{'$or':_[_0xa727('0x2c')](_0x1c46b8,function(_0x4c1b95){if(_0x4c1b95[_0xa727('0x2f')]!==_0xa727('0x3c')){var _0x36495a={};_0x36495a[_0x4c1b95[_0xa727('0x2b')]]={'$like':'%'+_0x3e7eb1[_0xa727('0x31')][_0xa727('0x3a')]+'%'};return _0x36495a;}})});}_0x12e15e=_[_0xa727('0x3d')]({},_0x12e15e,_0x3e7eb1[_0xa727('0x3e')]);var _0x5a3022={'where':_0x12e15e[_0xa727('0x3b')]};return db['IntegrationReport'][_0xa727('0x21')](_0x5a3022)['then'](function(_0x36bc15){_0x37b650[_0xa727('0x21')]=_0x36bc15;if(_0x3e7eb1[_0xa727('0x31')]['includeAll']){_0x12e15e[_0xa727('0x3f')]=[{'all':!![]}];}return db[_0xa727('0x2d')][_0xa727('0x40')](_0x12e15e);})[_0xa727('0x26')](function(_0x355b45){_0x37b650['rows']=_0x355b45;return _0x37b650;})[_0xa727('0x26')](respondWithFilteredResult(_0x5cc67d,_0x12e15e))['catch'](handleError(_0x5cc67d,null));};exports[_0xa727('0x41')]=function(_0xd1b9a6,_0x313db0){var _0x2be648={'raw':![],'where':{'id':_0xd1b9a6['params']['id']}},_0x1c9011={};_0x1c9011[_0xa727('0x30')]=_[_0xa727('0x32')](db['IntegrationReport'][_0xa727('0x2e')]);_0x1c9011[_0xa727('0x31')]=_[_0xa727('0x32')](_0xd1b9a6['query']);_0x1c9011[_0xa727('0x33')]=_['intersection'](_0x1c9011['model'],_0x1c9011[_0xa727('0x31')]);_0x2be648[_0xa727('0x36')]=_[_0xa727('0x34')](_0x1c9011[_0xa727('0x30')],qs[_0xa727('0x35')](_0xd1b9a6[_0xa727('0x31')][_0xa727('0x35')]));_0x2be648[_0xa727('0x36')]=_0x2be648[_0xa727('0x36')][_0xa727('0x42')]?_0x2be648[_0xa727('0x36')]:_0x1c9011[_0xa727('0x30')];if(_0xd1b9a6[_0xa727('0x31')][_0xa727('0x43')]){_0x2be648[_0xa727('0x3f')]=[{'all':!![]}];}_0x2be648=_[_0xa727('0x3d')]({},_0x2be648,_0xd1b9a6[_0xa727('0x3e')]);return db['IntegrationReport'][_0xa727('0x44')](_0x2be648)[_0xa727('0x26')](handleEntityNotFound(_0x313db0,null))[_0xa727('0x26')](respondWithResult(_0x313db0,null))['catch'](handleError(_0x313db0,null));};exports[_0xa727('0x45')]=function(_0x3a958a,_0x2e86b4){return db[_0xa727('0x2d')][_0xa727('0x45')](_0x3a958a['body'],{})[_0xa727('0x26')](respondWithResult(_0x2e86b4,0xc9))[_0xa727('0x46')](handleError(_0x2e86b4,null));};exports[_0xa727('0x25')]=function(_0x4d44d2,_0x469c4d){if(_0x4d44d2[_0xa727('0x47')]['id']){delete _0x4d44d2[_0xa727('0x47')]['id'];}return db['IntegrationReport'][_0xa727('0x44')]({'where':{'id':_0x4d44d2['params']['id']}})[_0xa727('0x26')](handleEntityNotFound(_0x469c4d,null))[_0xa727('0x26')](saveUpdates(_0x4d44d2[_0xa727('0x47')],null))['then'](respondWithResult(_0x469c4d,null))[_0xa727('0x46')](handleError(_0x469c4d,null));};exports[_0xa727('0x27')]=function(_0x3c876b,_0x3fe956){return db[_0xa727('0x2d')][_0xa727('0x44')]({'where':{'id':_0x3c876b[_0xa727('0x48')]['id']}})[_0xa727('0x26')](handleEntityNotFound(_0x3fe956,null))[_0xa727('0x26')](removeEntity(_0x3fe956,null))[_0xa727('0x46')](handleError(_0x3fe956,null));};exports['describe']=function(_0x32cb26,_0x54fab3){return db['IntegrationReport'][_0xa727('0x49')]()[_0xa727('0x26')](respondWithResult(_0x54fab3,null))[_0xa727('0x46')](handleError(_0x54fab3,null));}; \ No newline at end of file +var _0xd678=['../../config/environment','../../config/license/util','sendStatus','status','end','json','undefined','limit','count','offset','set','apply','reject','save','update','then','stack','send','index','map','IntegrationReport','rawAttributes','fieldName','key','name','keys','query','filters','intersection','model','attributes','fields','nolimit','order','sort','where','pick','filter','merge','includeAll','rows','catch','show','params','include','options','create','body','find','describe','eml-format','fast-json-patch','moment','mustache','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/logger','api','../../config/utils'];(function(_0x39fb8f,_0x33e6e5){var _0xffea57=function(_0x270d10){while(--_0x270d10){_0x39fb8f['push'](_0x39fb8f['shift']());}};_0xffea57(++_0x33e6e5);}(_0xd678,0x7b));var _0x8d67=function(_0xb3275c,_0x2623c3){_0xb3275c=_0xb3275c-0x0;var _0x58e50b=_0xd678[_0xb3275c];return _0x58e50b;};'use strict';var emlformat=require(_0x8d67('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0x8d67('0x1'));var rp=require('request-promise');var moment=require(_0x8d67('0x2'));var BPromise=require('bluebird');var Mustache=require(_0x8d67('0x3'));var util=require(_0x8d67('0x4'));var path=require(_0x8d67('0x5'));var sox=require(_0x8d67('0x6'));var csv=require(_0x8d67('0x7'));var ejs=require(_0x8d67('0x8'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0x8d67('0x9'));var crypto=require(_0x8d67('0xa'));var jsforce=require(_0x8d67('0xb'));var deskjs=require(_0x8d67('0xc'));var toCsv=require(_0x8d67('0x7'));var querystring=require(_0x8d67('0xd'));var Papa=require(_0x8d67('0xe'));var Redis=require(_0x8d67('0xf'));var authService=require(_0x8d67('0x10'));var qs=require(_0x8d67('0x11'));var as=require(_0x8d67('0x12'));var hardwareService=require(_0x8d67('0x13'));var logger=require(_0x8d67('0x14'))(_0x8d67('0x15'));var utils=require(_0x8d67('0x16'));var config=require(_0x8d67('0x17'));var licenseUtil=require(_0x8d67('0x18'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x20b405,_0x421185){_0x421185=_0x421185||0xcc;return function(_0xd0cca){if(_0xd0cca){return _0x20b405[_0x8d67('0x19')](_0x421185);}return _0x20b405[_0x8d67('0x1a')](_0x421185)[_0x8d67('0x1b')]();};}function respondWithResult(_0x5388bc,_0x16b32e){_0x16b32e=_0x16b32e||0xc8;return function(_0x4a098c){if(_0x4a098c){return _0x5388bc['status'](_0x16b32e)[_0x8d67('0x1c')](_0x4a098c);}};}function respondWithFilteredResult(_0x3f3f76,_0xbe909e){return function(_0x29c97e){if(_0x29c97e){var _0x249cc5=typeof _0xbe909e['offset']===_0x8d67('0x1d')&&typeof _0xbe909e[_0x8d67('0x1e')]==='undefined';var _0x40f343=_0x29c97e[_0x8d67('0x1f')];var _0x131e32=_0x249cc5?0x0:_0xbe909e[_0x8d67('0x20')];var _0x37559c=_0x249cc5?_0x29c97e[_0x8d67('0x1f')]:_0xbe909e[_0x8d67('0x20')]+_0xbe909e['limit'];var _0x4e63e2;if(_0x37559c>=_0x40f343){_0x37559c=_0x40f343;_0x4e63e2=0xc8;}else{_0x4e63e2=0xce;}_0x3f3f76['status'](_0x4e63e2);return _0x3f3f76[_0x8d67('0x21')]('Content-Range',_0x131e32+'-'+_0x37559c+'/'+_0x40f343)[_0x8d67('0x1c')](_0x29c97e);}return null;};}function patchUpdates(_0x1b8cae){return function(_0x1e381a){try{jsonpatch[_0x8d67('0x22')](_0x1e381a,_0x1b8cae,!![]);}catch(_0x39c3c2){return BPromise[_0x8d67('0x23')](_0x39c3c2);}return _0x1e381a[_0x8d67('0x24')]();};}function saveUpdates(_0x16f525,_0x2446c5){return function(_0x558079){if(_0x558079){return _0x558079[_0x8d67('0x25')](_0x16f525)[_0x8d67('0x26')](function(_0x42af96){return _0x42af96;});}return null;};}function removeEntity(_0x84974e,_0x43fe83){return function(_0x5a7c2d){if(_0x5a7c2d){return _0x5a7c2d['destroy']()[_0x8d67('0x26')](function(){_0x84974e[_0x8d67('0x1a')](0xcc)[_0x8d67('0x1b')]();});}};}function handleEntityNotFound(_0x40a9d2,_0x53c298){return function(_0x461ee8){if(!_0x461ee8){_0x40a9d2['sendStatus'](0x194);}return _0x461ee8;};}function handleError(_0x141d29,_0x356dfd){_0x356dfd=_0x356dfd||0x1f4;return function(_0x4d9430){logger['error'](_0x4d9430[_0x8d67('0x27')]);if(_0x4d9430['name']){delete _0x4d9430['name'];}_0x141d29[_0x8d67('0x1a')](_0x356dfd)[_0x8d67('0x28')](_0x4d9430);};}exports[_0x8d67('0x29')]=function(_0x15ce81,_0x178b7e){var _0x3046c9={},_0x1ca1e5={},_0x5061b1={'count':0x0,'rows':[]};var _0x564ee1=_[_0x8d67('0x2a')](db[_0x8d67('0x2b')][_0x8d67('0x2c')],function(_0x3c7e31){return{'name':_0x3c7e31[_0x8d67('0x2d')],'type':_0x3c7e31['type'][_0x8d67('0x2e')]};});_0x1ca1e5['model']=_[_0x8d67('0x2a')](_0x564ee1,_0x8d67('0x2f'));_0x1ca1e5['query']=_[_0x8d67('0x30')](_0x15ce81[_0x8d67('0x31')]);_0x1ca1e5[_0x8d67('0x32')]=_[_0x8d67('0x33')](_0x1ca1e5[_0x8d67('0x34')],_0x1ca1e5['query']);_0x3046c9[_0x8d67('0x35')]=_[_0x8d67('0x33')](_0x1ca1e5['model'],qs[_0x8d67('0x36')](_0x15ce81[_0x8d67('0x31')][_0x8d67('0x36')]));_0x3046c9[_0x8d67('0x35')]=_0x3046c9['attributes']['length']?_0x3046c9[_0x8d67('0x35')]:_0x1ca1e5[_0x8d67('0x34')];if(!_0x15ce81[_0x8d67('0x31')]['hasOwnProperty'](_0x8d67('0x37'))){_0x3046c9[_0x8d67('0x1e')]=qs[_0x8d67('0x1e')](_0x15ce81['query'][_0x8d67('0x1e')]);_0x3046c9['offset']=qs[_0x8d67('0x20')](_0x15ce81[_0x8d67('0x31')][_0x8d67('0x20')]);}_0x3046c9[_0x8d67('0x38')]=qs['sort'](_0x15ce81['query'][_0x8d67('0x39')]);_0x3046c9[_0x8d67('0x3a')]=qs[_0x8d67('0x32')](_[_0x8d67('0x3b')](_0x15ce81['query'],_0x1ca1e5[_0x8d67('0x32')]),_0x564ee1);if(_0x15ce81['query'][_0x8d67('0x3c')]){_0x3046c9[_0x8d67('0x3a')]=_['merge'](_0x3046c9[_0x8d67('0x3a')],{'$or':_['map'](_0x564ee1,function(_0x5e26cc){if(_0x5e26cc['type']!=='VIRTUAL'){var _0x42719f={};_0x42719f[_0x5e26cc[_0x8d67('0x2f')]]={'$like':'%'+_0x15ce81[_0x8d67('0x31')][_0x8d67('0x3c')]+'%'};return _0x42719f;}})});}_0x3046c9=_[_0x8d67('0x3d')]({},_0x3046c9,_0x15ce81['options']);var _0x13d0d6={'where':_0x3046c9[_0x8d67('0x3a')]};return db[_0x8d67('0x2b')][_0x8d67('0x1f')](_0x13d0d6)['then'](function(_0x350c70){_0x5061b1[_0x8d67('0x1f')]=_0x350c70;if(_0x15ce81[_0x8d67('0x31')][_0x8d67('0x3e')]){_0x3046c9['include']=[{'all':!![]}];}return db[_0x8d67('0x2b')]['findAll'](_0x3046c9);})['then'](function(_0x371c24){_0x5061b1[_0x8d67('0x3f')]=_0x371c24;return _0x5061b1;})[_0x8d67('0x26')](respondWithFilteredResult(_0x178b7e,_0x3046c9))[_0x8d67('0x40')](handleError(_0x178b7e,null));};exports[_0x8d67('0x41')]=function(_0x48022f,_0x5012d2){var _0x4854d3={'raw':![],'where':{'id':_0x48022f[_0x8d67('0x42')]['id']}},_0xdbc48a={};_0xdbc48a['model']=_[_0x8d67('0x30')](db[_0x8d67('0x2b')][_0x8d67('0x2c')]);_0xdbc48a[_0x8d67('0x31')]=_['keys'](_0x48022f[_0x8d67('0x31')]);_0xdbc48a[_0x8d67('0x32')]=_['intersection'](_0xdbc48a[_0x8d67('0x34')],_0xdbc48a[_0x8d67('0x31')]);_0x4854d3[_0x8d67('0x35')]=_[_0x8d67('0x33')](_0xdbc48a[_0x8d67('0x34')],qs[_0x8d67('0x36')](_0x48022f[_0x8d67('0x31')][_0x8d67('0x36')]));_0x4854d3[_0x8d67('0x35')]=_0x4854d3[_0x8d67('0x35')]['length']?_0x4854d3[_0x8d67('0x35')]:_0xdbc48a[_0x8d67('0x34')];if(_0x48022f[_0x8d67('0x31')][_0x8d67('0x3e')]){_0x4854d3[_0x8d67('0x43')]=[{'all':!![]}];}_0x4854d3=_['merge']({},_0x4854d3,_0x48022f[_0x8d67('0x44')]);return db[_0x8d67('0x2b')]['find'](_0x4854d3)['then'](handleEntityNotFound(_0x5012d2,null))[_0x8d67('0x26')](respondWithResult(_0x5012d2,null))[_0x8d67('0x40')](handleError(_0x5012d2,null));};exports[_0x8d67('0x45')]=function(_0x5f428d,_0x4e5c76){return db['IntegrationReport'][_0x8d67('0x45')](_0x5f428d['body'],{})['then'](respondWithResult(_0x4e5c76,0xc9))[_0x8d67('0x40')](handleError(_0x4e5c76,null));};exports[_0x8d67('0x25')]=function(_0x262e81,_0x5e080c){if(_0x262e81[_0x8d67('0x46')]['id']){delete _0x262e81[_0x8d67('0x46')]['id'];}return db['IntegrationReport'][_0x8d67('0x47')]({'where':{'id':_0x262e81[_0x8d67('0x42')]['id']}})[_0x8d67('0x26')](handleEntityNotFound(_0x5e080c,null))[_0x8d67('0x26')](saveUpdates(_0x262e81[_0x8d67('0x46')],null))['then'](respondWithResult(_0x5e080c,null))[_0x8d67('0x40')](handleError(_0x5e080c,null));};exports['destroy']=function(_0x2e3644,_0x16ca3c){return db[_0x8d67('0x2b')][_0x8d67('0x47')]({'where':{'id':_0x2e3644[_0x8d67('0x42')]['id']}})['then'](handleEntityNotFound(_0x16ca3c,null))[_0x8d67('0x26')](removeEntity(_0x16ca3c,null))[_0x8d67('0x40')](handleError(_0x16ca3c,null));};exports[_0x8d67('0x48')]=function(_0x41c956,_0x2b35c0){return db[_0x8d67('0x2b')][_0x8d67('0x48')]()[_0x8d67('0x26')](respondWithResult(_0x2b35c0,null))[_0x8d67('0x40')](handleError(_0x2b35c0,null));}; \ No newline at end of file diff --git a/server/api/integrationReport/integrationReport.model.js b/server/api/integrationReport/integrationReport.model.js index 4e51fce..df999c2 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 _0xb012=['rimraf','../../config/environment','exports','define','IntegrationReport','report_integration','lodash','util','../../config/logger','api','moment','request-promise','path'];(function(_0x334fea,_0x1f1e18){var _0x3c5829=function(_0x4fd6ac){while(--_0x4fd6ac){_0x334fea['push'](_0x334fea['shift']());}};_0x3c5829(++_0x1f1e18);}(_0xb012,0x17f));var _0x2b01=function(_0x2ef72b,_0x1637ca){_0x2ef72b=_0x2ef72b-0x0;var _0x10f8ac=_0xb012[_0x2ef72b];return _0x10f8ac;};'use strict';var _=require(_0x2b01('0x0'));var util=require(_0x2b01('0x1'));var logger=require(_0x2b01('0x2'))(_0x2b01('0x3'));var moment=require(_0x2b01('0x4'));var BPromise=require('bluebird');var rp=require(_0x2b01('0x5'));var fs=require('fs');var path=require(_0x2b01('0x6'));var rimraf=require(_0x2b01('0x7'));var config=require(_0x2b01('0x8'));var attributes=require('./integrationReport.attributes');module[_0x2b01('0x9')]=function(_0x17c9cf,_0x19e37c){return _0x17c9cf[_0x2b01('0xa')](_0x2b01('0xb'),attributes,{'tableName':_0x2b01('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xe3d3=['request-promise','path','rimraf','./integrationReport.attributes','exports','define','IntegrationReport','report_integration','util','../../config/logger','api','bluebird'];(function(_0x372fb1,_0x26dfcd){var _0x3db680=function(_0x24b8c2){while(--_0x24b8c2){_0x372fb1['push'](_0x372fb1['shift']());}};_0x3db680(++_0x26dfcd);}(_0xe3d3,0x134));var _0x3e3d=function(_0x21f5ba,_0x5ef417){_0x21f5ba=_0x21f5ba-0x0;var _0x55983b=_0xe3d3[_0x21f5ba];return _0x55983b;};'use strict';var _=require('lodash');var util=require(_0x3e3d('0x0'));var logger=require(_0x3e3d('0x1'))(_0x3e3d('0x2'));var moment=require('moment');var BPromise=require(_0x3e3d('0x3'));var rp=require(_0x3e3d('0x4'));var fs=require('fs');var path=require(_0x3e3d('0x5'));var rimraf=require(_0x3e3d('0x6'));var config=require('../../config/environment');var attributes=require(_0x3e3d('0x7'));module[_0x3e3d('0x8')]=function(_0x1b55ee,_0x3ec859){return _0x1b55ee[_0x3e3d('0x9')](_0x3e3d('0xa'),attributes,{'tableName':_0x3e3d('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 21581d8..1892e99 100644 --- a/server/api/integrationReport/integrationReport.rpc.js +++ b/server/api/integrationReport/integrationReport.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x7a54=['info','IntegrationReport,\x20%s,\x20%s','debug','stringify','error','code','message','request\x20sent','result','catch','lodash','util','moment','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http'];(function(_0x397e5f,_0x454c8f){var _0x5302b8=function(_0x1a29ef){while(--_0x1a29ef){_0x397e5f['push'](_0x397e5f['shift']());}};_0x5302b8(++_0x454c8f);}(_0x7a54,0x106));var _0x47a5=function(_0x414933,_0x508e49){_0x414933=_0x414933-0x0;var _0x33d114=_0x7a54[_0x414933];return _0x33d114;};'use strict';var _=require(_0x47a5('0x0'));var util=require(_0x47a5('0x1'));var moment=require(_0x47a5('0x2'));var BPromise=require('bluebird');var rs=require(_0x47a5('0x3'));var fs=require('fs');var Redis=require(_0x47a5('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x47a5('0x5'));var logger=require(_0x47a5('0x6'))(_0x47a5('0x7'));var config=require(_0x47a5('0x8'));var jayson=require(_0x47a5('0x9'));var client=jayson['client'][_0x47a5('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x59199c,_0x343372,_0x30e405){return new BPromise(function(_0x506eda,_0x194fb0){return client['request'](_0x59199c,_0x30e405)['then'](function(_0x582352){logger[_0x47a5('0xb')](_0x47a5('0xc'),_0x343372,'request\x20sent');logger[_0x47a5('0xd')]('IntegrationReport,\x20%s,\x20%s,\x20%s',_0x343372,'request\x20sent',JSON[_0x47a5('0xe')](_0x582352));if(_0x582352[_0x47a5('0xf')]){if(_0x582352[_0x47a5('0xf')][_0x47a5('0x10')]===0x1f4){logger[_0x47a5('0xf')](_0x47a5('0xc'),_0x343372,_0x582352[_0x47a5('0xf')]['message']);return _0x194fb0(_0x582352[_0x47a5('0xf')][_0x47a5('0x11')]);}logger[_0x47a5('0xf')](_0x47a5('0xc'),_0x343372,_0x582352[_0x47a5('0xf')][_0x47a5('0x11')]);return _0x506eda(_0x582352[_0x47a5('0xf')][_0x47a5('0x11')]);}else{logger['info'](_0x47a5('0xc'),_0x343372,_0x47a5('0x12'));_0x506eda(_0x582352[_0x47a5('0x13')][_0x47a5('0x11')]);}})[_0x47a5('0x14')](function(_0x574af6){logger['error'](_0x47a5('0xc'),_0x343372,_0x574af6);_0x194fb0(_0x574af6);});});} \ No newline at end of file +var _0x2ef3=['bluebird','randomstring','ioredis','../../config/utils','../../config/logger','../../config/environment','jayson/promise','request','then','info','IntegrationReport,\x20%s,\x20%s','IntegrationReport,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','catch','lodash','util','moment'];(function(_0x209511,_0x231622){var _0x39b937=function(_0x4005a3){while(--_0x4005a3){_0x209511['push'](_0x209511['shift']());}};_0x39b937(++_0x231622);}(_0x2ef3,0xba));var _0x32ef=function(_0x5d52f2,_0x512994){_0x5d52f2=_0x5d52f2-0x0;var _0x25b5e6=_0x2ef3[_0x5d52f2];return _0x25b5e6;};'use strict';var _=require(_0x32ef('0x0'));var util=require(_0x32ef('0x1'));var moment=require(_0x32ef('0x2'));var BPromise=require(_0x32ef('0x3'));var rs=require(_0x32ef('0x4'));var fs=require('fs');var Redis=require(_0x32ef('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0x32ef('0x6'));var logger=require(_0x32ef('0x7'))('rpc');var config=require(_0x32ef('0x8'));var jayson=require(_0x32ef('0x9'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x2c0089,_0x4bfcf8,_0x367c39){return new BPromise(function(_0x2fb8eb,_0x234863){return client[_0x32ef('0xa')](_0x2c0089,_0x367c39)[_0x32ef('0xb')](function(_0x2bbb50){logger[_0x32ef('0xc')](_0x32ef('0xd'),_0x4bfcf8,'request\x20sent');logger['debug'](_0x32ef('0xe'),_0x4bfcf8,_0x32ef('0xf'),JSON[_0x32ef('0x10')](_0x2bbb50));if(_0x2bbb50[_0x32ef('0x11')]){if(_0x2bbb50['error'][_0x32ef('0x12')]===0x1f4){logger['error'](_0x32ef('0xd'),_0x4bfcf8,_0x2bbb50['error'][_0x32ef('0x13')]);return _0x234863(_0x2bbb50[_0x32ef('0x11')]['message']);}logger['error'](_0x32ef('0xd'),_0x4bfcf8,_0x2bbb50['error'][_0x32ef('0x13')]);return _0x2fb8eb(_0x2bbb50[_0x32ef('0x11')][_0x32ef('0x13')]);}else{logger[_0x32ef('0xc')]('IntegrationReport,\x20%s,\x20%s',_0x4bfcf8,'request\x20sent');_0x2fb8eb(_0x2bbb50['result'][_0x32ef('0x13')]);}})[_0x32ef('0x14')](function(_0xb5aed2){logger['error']('IntegrationReport,\x20%s,\x20%s',_0x4bfcf8,_0xb5aed2);_0x234863(_0xb5aed2);});});} \ No newline at end of file diff --git a/server/api/interval/index.js b/server/api/interval/index.js index c5857f4..098a07d 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 _0x2cd0=['express','../../components/auth/service','../../components/interaction/service','../../config/environment','./interval.controller','get','isAuthenticated','index','/:id','/:id/sub_intervals','getIntervals','post','create','/:id/sub_intervals/create_many','update','delete','destroy','exports','multer','util'];(function(_0x13c45f,_0x398dc5){var _0x4533e1=function(_0x408dfd){while(--_0x408dfd){_0x13c45f['push'](_0x13c45f['shift']());}};_0x4533e1(++_0x398dc5);}(_0x2cd0,0x8a));var _0x02cd=function(_0xca11fe,_0x33eb73){_0xca11fe=_0xca11fe-0x0;var _0x55bcd0=_0x2cd0[_0xca11fe];return _0x55bcd0;};'use strict';var multer=require(_0x02cd('0x0'));var util=require(_0x02cd('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0x02cd('0x2'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0x02cd('0x3'));var interaction=require(_0x02cd('0x4'));var config=require(_0x02cd('0x5'));var controller=require(_0x02cd('0x6'));router[_0x02cd('0x7')]('/',auth[_0x02cd('0x8')](),controller[_0x02cd('0x9')]);router[_0x02cd('0x7')](_0x02cd('0xa'),auth[_0x02cd('0x8')](),controller['show']);router[_0x02cd('0x7')](_0x02cd('0xb'),auth[_0x02cd('0x8')](),controller[_0x02cd('0xc')]);router[_0x02cd('0xd')]('/',auth[_0x02cd('0x8')](),controller[_0x02cd('0xe')]);router[_0x02cd('0xd')](_0x02cd('0xb'),auth[_0x02cd('0x8')](),controller['addInterval']);router['post'](_0x02cd('0xf'),auth[_0x02cd('0x8')](),controller['addIntervals']);router['put'](_0x02cd('0xa'),auth['isAuthenticated'](),controller[_0x02cd('0x10')]);router[_0x02cd('0x11')](_0x02cd('0xa'),auth[_0x02cd('0x8')](),controller[_0x02cd('0x12')]);module[_0x02cd('0x13')]=router; \ No newline at end of file +var _0xd051=['express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./interval.controller','get','isAuthenticated','index','/:id','show','/:id/sub_intervals','post','addInterval','/:id/sub_intervals/create_many','addIntervals','put','update','delete','destroy','exports','multer','util','path'];(function(_0x2d792d,_0x51f81d){var _0x4bda1a=function(_0x35c11a){while(--_0x35c11a){_0x2d792d['push'](_0x2d792d['shift']());}};_0x4bda1a(++_0x51f81d);}(_0xd051,0xc5));var _0x1d05=function(_0x5e9823,_0x1ec34c){_0x5e9823=_0x5e9823-0x0;var _0x106fdc=_0xd051[_0x5e9823];return _0x106fdc;};'use strict';var multer=require(_0x1d05('0x0'));var util=require(_0x1d05('0x1'));var path=require(_0x1d05('0x2'));var timeout=require('connect-timeout');var express=require(_0x1d05('0x3'));var router=express[_0x1d05('0x4')]();var fs_extra=require(_0x1d05('0x5'));var auth=require(_0x1d05('0x6'));var interaction=require(_0x1d05('0x7'));var config=require(_0x1d05('0x8'));var controller=require(_0x1d05('0x9'));router[_0x1d05('0xa')]('/',auth[_0x1d05('0xb')](),controller[_0x1d05('0xc')]);router[_0x1d05('0xa')](_0x1d05('0xd'),auth[_0x1d05('0xb')](),controller[_0x1d05('0xe')]);router[_0x1d05('0xa')](_0x1d05('0xf'),auth[_0x1d05('0xb')](),controller['getIntervals']);router['post']('/',auth[_0x1d05('0xb')](),controller['create']);router[_0x1d05('0x10')](_0x1d05('0xf'),auth['isAuthenticated'](),controller[_0x1d05('0x11')]);router['post'](_0x1d05('0x12'),auth[_0x1d05('0xb')](),controller[_0x1d05('0x13')]);router[_0x1d05('0x14')](_0x1d05('0xd'),auth[_0x1d05('0xb')](),controller[_0x1d05('0x15')]);router[_0x1d05('0x16')](_0x1d05('0xd'),auth[_0x1d05('0xb')](),controller[_0x1d05('0x17')]);module[_0x1d05('0x18')]=router; \ No newline at end of file diff --git a/server/api/interval/interval.attributes.js b/server/api/interval/interval.attributes.js index 951453f..1ea492a 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 _0xbbf3=['exports','STRING','sequelize'];(function(_0x342baa,_0x4a110f){var _0x1208f3=function(_0x56a645){while(--_0x56a645){_0x342baa['push'](_0x342baa['shift']());}};_0x1208f3(++_0x4a110f);}(_0xbbf3,0x1d3));var _0x3bbf=function(_0x3f471f,_0x3e2d11){_0x3f471f=_0x3f471f-0x0;var _0x5e167a=_0xbbf3[_0x3f471f];return _0x5e167a;};'use strict';var Sequelize=require(_0x3bbf('0x0'));module[_0x3bbf('0x1')]={'name':{'type':Sequelize[_0x3bbf('0x2')]},'description':{'type':Sequelize[_0x3bbf('0x2')]},'interval':{'type':Sequelize[_0x3bbf('0x2')],'allowNull':!![]}}; \ No newline at end of file +var _0x8126=['sequelize','exports','STRING'];(function(_0x358763,_0x1dca5b){var _0x58b4f4=function(_0xe7da6c){while(--_0xe7da6c){_0x358763['push'](_0x358763['shift']());}};_0x58b4f4(++_0x1dca5b);}(_0x8126,0x18c));var _0x6812=function(_0x14d896,_0x53578b){_0x14d896=_0x14d896-0x0;var _0x28679a=_0x8126[_0x14d896];return _0x28679a;};'use strict';var Sequelize=require(_0x6812('0x0'));module[_0x6812('0x1')]={'name':{'type':Sequelize[_0x6812('0x2')]},'description':{'type':Sequelize[_0x6812('0x2')]},'interval':{'type':Sequelize[_0x6812('0x2')],'allowNull':!![]}}; \ No newline at end of file diff --git a/server/api/interval/interval.controller.js b/server/api/interval/interval.controller.js index d1b82c2..fa3b773 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 _0xcc8b=['offset','undefined','count','set','Content-Range','apply','reject','save','update','then','destroy','get','Intervals','UserProfileResource','end','stack','name','send','index','map','Interval','rawAttributes','key','model','query','keys','filters','intersection','attributes','fields','hasOwnProperty','nolimit','limit','order','sort','where','filter','merge','options','includeAll','include','rows','show','params','length','find','create','body','user','role','UserProfileSection','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','catch','addInterval','IntervalId','getIntervals','findOne','addIntervals','sequelize','bulkCreate','findAll','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/license/util','../../mysqldb','../../components/extensions/rewrite','sendStatus','status','json'];(function(_0x510660,_0x117f9b){var _0x4f7923=function(_0x188921){while(--_0x188921){_0x510660['push'](_0x510660['shift']());}};_0x4f7923(++_0x117f9b);}(_0xcc8b,0x9c));var _0xbcc8=function(_0xab2e6a,_0x23670e){_0xab2e6a=_0xab2e6a-0x0;var _0x2582e7=_0xcc8b[_0xab2e6a];return _0x2582e7;};'use strict';var emlformat=require(_0xbcc8('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xbcc8('0x1'));var jsonpatch=require(_0xbcc8('0x2'));var rp=require(_0xbcc8('0x3'));var moment=require(_0xbcc8('0x4'));var BPromise=require(_0xbcc8('0x5'));var Mustache=require(_0xbcc8('0x6'));var util=require(_0xbcc8('0x7'));var path=require(_0xbcc8('0x8'));var sox=require(_0xbcc8('0x9'));var csv=require(_0xbcc8('0xa'));var ejs=require(_0xbcc8('0xb'));var fs=require('fs');var fs_extra=require(_0xbcc8('0xc'));var _=require(_0xbcc8('0xd'));var squel=require(_0xbcc8('0xe'));var crypto=require(_0xbcc8('0xf'));var jsforce=require(_0xbcc8('0x10'));var deskjs=require(_0xbcc8('0x11'));var toCsv=require('to-csv');var querystring=require(_0xbcc8('0x12'));var Papa=require('papaparse');var Redis=require(_0xbcc8('0x13'));var authService=require(_0xbcc8('0x14'));var qs=require(_0xbcc8('0x15'));var as=require(_0xbcc8('0x16'));var hardwareService=require(_0xbcc8('0x17'));var logger=require('../../config/logger')(_0xbcc8('0x18'));var utils=require(_0xbcc8('0x19'));var config=require('../../config/environment');var licenseUtil=require(_0xbcc8('0x1a'));var db=require(_0xbcc8('0x1b'))['db'];var extensions=require(_0xbcc8('0x1c'));function respondWithStatusCode(_0x4f5e35,_0xc1a2f3){_0xc1a2f3=_0xc1a2f3||0xcc;return function(_0x454b16){if(_0x454b16){return _0x4f5e35[_0xbcc8('0x1d')](_0xc1a2f3);}return _0x4f5e35['status'](_0xc1a2f3)['end']();};}function respondWithResult(_0x234fce,_0x4e825e){_0x4e825e=_0x4e825e||0xc8;return function(_0x33e322){if(_0x33e322){return _0x234fce[_0xbcc8('0x1e')](_0x4e825e)[_0xbcc8('0x1f')](_0x33e322);}};}function respondWithFilteredResult(_0x537bf6,_0x4a48c1){return function(_0x301131){if(_0x301131){var _0x25cc10=typeof _0x4a48c1[_0xbcc8('0x20')]===_0xbcc8('0x21')&&typeof _0x4a48c1['limit']===_0xbcc8('0x21');var _0x1206bf=_0x301131['count'];var _0xb940bf=_0x25cc10?0x0:_0x4a48c1['offset'];var _0x386666=_0x25cc10?_0x301131[_0xbcc8('0x22')]:_0x4a48c1[_0xbcc8('0x20')]+_0x4a48c1['limit'];var _0x1c1bbd;if(_0x386666>=_0x1206bf){_0x386666=_0x1206bf;_0x1c1bbd=0xc8;}else{_0x1c1bbd=0xce;}_0x537bf6[_0xbcc8('0x1e')](_0x1c1bbd);return _0x537bf6[_0xbcc8('0x23')](_0xbcc8('0x24'),_0xb940bf+'-'+_0x386666+'/'+_0x1206bf)[_0xbcc8('0x1f')](_0x301131);}return null;};}function patchUpdates(_0x4630ed){return function(_0x747564){try{jsonpatch[_0xbcc8('0x25')](_0x747564,_0x4630ed,!![]);}catch(_0x495568){return BPromise[_0xbcc8('0x26')](_0x495568);}return _0x747564[_0xbcc8('0x27')]();};}function saveUpdates(_0x12a6dd,_0x3a6dcf){return function(_0x4c134e){if(_0x4c134e){return _0x4c134e[_0xbcc8('0x28')](_0x12a6dd)[_0xbcc8('0x29')](function(_0x24c3ca){return _0x24c3ca;});}return null;};}function removeEntity(_0x47e869,_0x3f96b2){return function(_0x518c86){if(_0x518c86){return _0x518c86[_0xbcc8('0x2a')]()[_0xbcc8('0x29')](function(){var _0x170a9b=_0x518c86[_0xbcc8('0x2b')]({'plain':!![]});var _0x4cfc93=_0xbcc8('0x2c');return db[_0xbcc8('0x2d')][_0xbcc8('0x2a')]({'where':{'type':_0x4cfc93,'resourceId':_0x170a9b['id']}})[_0xbcc8('0x29')](function(){return _0x518c86;});})[_0xbcc8('0x29')](function(){_0x47e869[_0xbcc8('0x1e')](0xcc)[_0xbcc8('0x2e')]();});}};}function handleEntityNotFound(_0x37185c,_0x1b869e){return function(_0x4b87a2){if(!_0x4b87a2){_0x37185c['sendStatus'](0x194);}return _0x4b87a2;};}function handleError(_0x4175f6,_0x593150){_0x593150=_0x593150||0x1f4;return function(_0x143a3c){logger['error'](_0x143a3c[_0xbcc8('0x2f')]);if(_0x143a3c[_0xbcc8('0x30')]){delete _0x143a3c[_0xbcc8('0x30')];}_0x4175f6[_0xbcc8('0x1e')](_0x593150)[_0xbcc8('0x31')](_0x143a3c);};}exports[_0xbcc8('0x32')]=function(_0x303d7a,_0x3ee763){var _0x5b7320={},_0x2c02c5={},_0x275247={'count':0x0,'rows':[]};var _0x880b67=_[_0xbcc8('0x33')](db[_0xbcc8('0x34')][_0xbcc8('0x35')],function(_0x369fc4){return{'name':_0x369fc4['fieldName'],'type':_0x369fc4['type'][_0xbcc8('0x36')]};});_0x2c02c5[_0xbcc8('0x37')]=_[_0xbcc8('0x33')](_0x880b67,_0xbcc8('0x30'));_0x2c02c5[_0xbcc8('0x38')]=_[_0xbcc8('0x39')](_0x303d7a['query']);_0x2c02c5[_0xbcc8('0x3a')]=_[_0xbcc8('0x3b')](_0x2c02c5[_0xbcc8('0x37')],_0x2c02c5[_0xbcc8('0x38')]);_0x5b7320[_0xbcc8('0x3c')]=_[_0xbcc8('0x3b')](_0x2c02c5[_0xbcc8('0x37')],qs['fields'](_0x303d7a['query'][_0xbcc8('0x3d')]));_0x5b7320[_0xbcc8('0x3c')]=_0x5b7320[_0xbcc8('0x3c')]['length']?_0x5b7320['attributes']:_0x2c02c5[_0xbcc8('0x37')];if(!_0x303d7a['query'][_0xbcc8('0x3e')](_0xbcc8('0x3f'))){_0x5b7320[_0xbcc8('0x40')]=qs[_0xbcc8('0x40')](_0x303d7a[_0xbcc8('0x38')][_0xbcc8('0x40')]);_0x5b7320[_0xbcc8('0x20')]=qs[_0xbcc8('0x20')](_0x303d7a['query'][_0xbcc8('0x20')]);}_0x5b7320[_0xbcc8('0x41')]=qs['sort'](_0x303d7a[_0xbcc8('0x38')][_0xbcc8('0x42')]);_0x5b7320[_0xbcc8('0x43')]=qs[_0xbcc8('0x3a')](_['pick'](_0x303d7a[_0xbcc8('0x38')],_0x2c02c5[_0xbcc8('0x3a')]),_0x880b67);if(_0x303d7a[_0xbcc8('0x38')][_0xbcc8('0x44')]){_0x5b7320[_0xbcc8('0x43')]=_[_0xbcc8('0x45')](_0x5b7320[_0xbcc8('0x43')],{'$or':_[_0xbcc8('0x33')](_0x880b67,function(_0x2c614b){if(_0x2c614b['type']!=='VIRTUAL'){var _0x414d22={};_0x414d22[_0x2c614b[_0xbcc8('0x30')]]={'$like':'%'+_0x303d7a[_0xbcc8('0x38')][_0xbcc8('0x44')]+'%'};return _0x414d22;}})});}_0x5b7320=_['merge']({},_0x5b7320,_0x303d7a[_0xbcc8('0x46')]);var _0x4ad6e3={'where':_0x5b7320[_0xbcc8('0x43')]};return db[_0xbcc8('0x34')][_0xbcc8('0x22')](_0x4ad6e3)[_0xbcc8('0x29')](function(_0x1cd2e9){_0x275247['count']=_0x1cd2e9;if(_0x303d7a['query'][_0xbcc8('0x47')]){_0x5b7320[_0xbcc8('0x48')]=[{'all':!![]}];}return db['Interval']['findAll'](_0x5b7320);})[_0xbcc8('0x29')](function(_0x20e783){_0x275247[_0xbcc8('0x49')]=_0x20e783;return _0x275247;})[_0xbcc8('0x29')](respondWithFilteredResult(_0x3ee763,_0x5b7320))['catch'](handleError(_0x3ee763,null));};exports[_0xbcc8('0x4a')]=function(_0x2722c7,_0x3eebd2){var _0x38e4a5={'raw':!![],'where':{'id':_0x2722c7[_0xbcc8('0x4b')]['id']}},_0x19b276={};_0x19b276['model']=_[_0xbcc8('0x39')](db[_0xbcc8('0x34')]['rawAttributes']);_0x19b276[_0xbcc8('0x38')]=_['keys'](_0x2722c7[_0xbcc8('0x38')]);_0x19b276[_0xbcc8('0x3a')]=_[_0xbcc8('0x3b')](_0x19b276[_0xbcc8('0x37')],_0x19b276[_0xbcc8('0x38')]);_0x38e4a5[_0xbcc8('0x3c')]=_['intersection'](_0x19b276[_0xbcc8('0x37')],qs[_0xbcc8('0x3d')](_0x2722c7[_0xbcc8('0x38')][_0xbcc8('0x3d')]));_0x38e4a5[_0xbcc8('0x3c')]=_0x38e4a5[_0xbcc8('0x3c')][_0xbcc8('0x4c')]?_0x38e4a5[_0xbcc8('0x3c')]:_0x19b276['model'];if(_0x2722c7[_0xbcc8('0x38')][_0xbcc8('0x47')]){_0x38e4a5[_0xbcc8('0x48')]=[{'all':!![]}];}_0x38e4a5=_['merge']({},_0x38e4a5,_0x2722c7[_0xbcc8('0x46')]);return db['Interval'][_0xbcc8('0x4d')](_0x38e4a5)[_0xbcc8('0x29')](handleEntityNotFound(_0x3eebd2,null))['then'](respondWithResult(_0x3eebd2,null))['catch'](handleError(_0x3eebd2,null));};exports[_0xbcc8('0x4e')]=function(_0x5ee194,_0x33e4b7){return db[_0xbcc8('0x34')][_0xbcc8('0x4e')](_0x5ee194[_0xbcc8('0x4f')],{})[_0xbcc8('0x29')](function(_0x200aeb){var _0x8fc962=_0x5ee194[_0xbcc8('0x50')][_0xbcc8('0x2b')]({'plain':!![]});if(!_0x8fc962)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x8fc962[_0xbcc8('0x51')]===_0xbcc8('0x50')){var _0x415f88=_0x200aeb['get']({'plain':!![]});var _0x32c36c='Intervals';return db[_0xbcc8('0x52')][_0xbcc8('0x4d')]({'where':{'name':_0x32c36c,'userProfileId':_0x8fc962['userProfileId']},'raw':!![]})['then'](function(_0x14a158){if(_0x14a158&&_0x14a158[_0xbcc8('0x53')]===0x0){return db[_0xbcc8('0x2d')][_0xbcc8('0x4e')]({'name':_0x415f88['name'],'resourceId':_0x415f88['id'],'type':_0x14a158[_0xbcc8('0x30')],'sectionId':_0x14a158['id']},{})[_0xbcc8('0x29')](function(){return _0x200aeb;});}else{return _0x200aeb;}})['catch'](function(_0x5d05e8){logger['error'](_0xbcc8('0x54'),_0x5d05e8);throw _0x5d05e8;});}return _0x200aeb;})['then'](respondWithResult(_0x33e4b7,0xc9))['catch'](handleError(_0x33e4b7,null));};exports[_0xbcc8('0x28')]=function(_0x179c46,_0x2f3e19){if(_0x179c46['body']['id']){delete _0x179c46[_0xbcc8('0x4f')]['id'];}return db[_0xbcc8('0x34')][_0xbcc8('0x4d')]({'where':{'id':_0x179c46[_0xbcc8('0x4b')]['id']}})[_0xbcc8('0x29')](handleEntityNotFound(_0x2f3e19,null))[_0xbcc8('0x29')](saveUpdates(_0x179c46[_0xbcc8('0x4f')],null))[_0xbcc8('0x29')](respondWithResult(_0x2f3e19,null))[_0xbcc8('0x55')](handleError(_0x2f3e19,null));};exports[_0xbcc8('0x2a')]=function(_0x5c715d,_0x21644f){return db['Interval'][_0xbcc8('0x4d')]({'where':{'id':_0x5c715d['params']['id']}})['then'](handleEntityNotFound(_0x21644f,null))[_0xbcc8('0x29')](removeEntity(_0x21644f,null))[_0xbcc8('0x55')](handleError(_0x21644f,null));};exports[_0xbcc8('0x56')]=function(_0x2812de,_0x345dfb,_0x5c9dff){if(_0x2812de[_0xbcc8('0x4f')]['id']){delete _0x2812de[_0xbcc8('0x4f')]['id'];}return db['Interval']['find']({'where':{'id':_0x2812de['params']['id']}})[_0xbcc8('0x29')](handleEntityNotFound(_0x345dfb,null))[_0xbcc8('0x29')](function(_0x3412c4){if(_0x3412c4){_0x2812de[_0xbcc8('0x4f')][_0xbcc8('0x57')]=_0x3412c4['id'];return db[_0xbcc8('0x34')][_0xbcc8('0x4e')](_0x2812de[_0xbcc8('0x4f')]);}})[_0xbcc8('0x29')](respondWithResult(_0x345dfb,null))['catch'](handleError(_0x345dfb,null));};exports[_0xbcc8('0x58')]=function(_0x2672f2,_0x359919,_0x3a19aa){var _0x2ae7f3={};var _0x5cc58d={};var _0x13637d;var _0x151e5f;return db[_0xbcc8('0x34')][_0xbcc8('0x59')]({'where':{'id':_0x2672f2[_0xbcc8('0x4b')]['id']}})[_0xbcc8('0x29')](handleEntityNotFound(_0x359919,null))['then'](function(_0x3deb4a){if(_0x3deb4a){_0x13637d=_0x3deb4a;_0x5cc58d[_0xbcc8('0x37')]=_['keys'](db[_0xbcc8('0x34')][_0xbcc8('0x35')]);_0x5cc58d['query']=_[_0xbcc8('0x39')](_0x2672f2[_0xbcc8('0x38')]);_0x5cc58d[_0xbcc8('0x3a')]=_[_0xbcc8('0x3b')](_0x5cc58d[_0xbcc8('0x37')],_0x5cc58d[_0xbcc8('0x38')]);_0x2ae7f3['attributes']=_[_0xbcc8('0x3b')](_0x5cc58d[_0xbcc8('0x37')],qs[_0xbcc8('0x3d')](_0x2672f2[_0xbcc8('0x38')][_0xbcc8('0x3d')]));_0x2ae7f3[_0xbcc8('0x3c')]=_0x2ae7f3[_0xbcc8('0x3c')][_0xbcc8('0x4c')]?_0x2ae7f3[_0xbcc8('0x3c')]:_0x5cc58d[_0xbcc8('0x37')];_0x2ae7f3[_0xbcc8('0x41')]=qs[_0xbcc8('0x42')](_0x2672f2[_0xbcc8('0x38')][_0xbcc8('0x42')]);_0x2ae7f3[_0xbcc8('0x43')]=qs['filters'](_['pick'](_0x2672f2[_0xbcc8('0x38')],_0x5cc58d[_0xbcc8('0x3a')]));if(_0x2672f2[_0xbcc8('0x38')][_0xbcc8('0x44')]){_0x2ae7f3['where']=_[_0xbcc8('0x45')](_0x2ae7f3[_0xbcc8('0x43')],{'$or':_[_0xbcc8('0x33')](_0x2ae7f3['attributes'],function(_0x25e34b){var _0x48256b={};_0x48256b[_0x25e34b]={'$like':'%'+_0x2672f2[_0xbcc8('0x38')][_0xbcc8('0x44')]+'%'};return _0x48256b;})});}_0x2ae7f3=_['merge']({},_0x2ae7f3,_0x2672f2[_0xbcc8('0x46')]);return _0x13637d[_0xbcc8('0x58')](_0x2ae7f3);}})[_0xbcc8('0x29')](function(_0x168722){if(_0x168722){_0x151e5f=_0x168722['length'];if(!_0x2672f2[_0xbcc8('0x38')][_0xbcc8('0x3e')](_0xbcc8('0x3f'))){_0x2ae7f3[_0xbcc8('0x40')]=qs[_0xbcc8('0x40')](_0x2672f2['query'][_0xbcc8('0x40')]);_0x2ae7f3['offset']=qs[_0xbcc8('0x20')](_0x2672f2['query'][_0xbcc8('0x20')]);}return _0x13637d['getIntervals'](_0x2ae7f3);}})['then'](function(_0x18f62a){if(_0x18f62a){return _0x18f62a?{'count':_0x151e5f,'rows':_0x18f62a}:null;}})[_0xbcc8('0x29')](respondWithResult(_0x359919,null))[_0xbcc8('0x55')](handleError(_0x359919,null));};exports[_0xbcc8('0x5a')]=function(_0x20f08d,_0x2ca5c4,_0x1e6aeb){return db[_0xbcc8('0x34')]['findOne']({'where':{'id':_0x20f08d[_0xbcc8('0x4b')]['id']}})[_0xbcc8('0x29')](handleEntityNotFound(_0x2ca5c4,null))[_0xbcc8('0x29')](function(_0x5687b5){if(_0x5687b5){return db[_0xbcc8('0x5b')]['transaction'](function(_0x518c00){return db[_0xbcc8('0x34')][_0xbcc8('0x2a')]({'where':{'IntervalId':_0x20f08d[_0xbcc8('0x4b')]['id']},'transaction':_0x518c00})[_0xbcc8('0x29')](function(_0x49191a){var _0x543cac=_[_0xbcc8('0x33')](_0x20f08d[_0xbcc8('0x4f')],function(_0x5092d6){delete _0x5092d6['id'];_0x5092d6[_0xbcc8('0x57')]=_0x20f08d[_0xbcc8('0x4b')]['id'];return _0x5092d6;});return db[_0xbcc8('0x34')][_0xbcc8('0x5c')](_0x543cac,{'transaction':_0x518c00});});})[_0xbcc8('0x29')](function(){return db[_0xbcc8('0x34')][_0xbcc8('0x5d')]({'where':{'IntervalId':_0x20f08d[_0xbcc8('0x4b')]['id']}});});}})[_0xbcc8('0x29')](respondWithResult(_0x2ca5c4,null))[_0xbcc8('0x55')](handleError(_0x2ca5c4,null));}; \ No newline at end of file +var _0x653c=['fast-json-patch','request-promise','moment','bluebird','mustache','util','path','to-csv','fs-extra','lodash','squel','crypto','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../components/extensions/rewrite','sendStatus','offset','undefined','limit','count','status','set','apply','reject','save','update','then','destroy','get','Intervals','UserProfileResource','end','error','name','send','map','Interval','rawAttributes','fieldName','type','key','query','intersection','model','attributes','fields','length','hasOwnProperty','order','sort','where','filters','pick','filter','VIRTUAL','merge','options','includeAll','include','rows','show','params','keys','find','catch','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','IntervalId','findOne','getIntervals','addIntervals','sequelize','bulkCreate','findAll','eml-format','rimraf','zip-dir'];(function(_0x5a006a,_0x549751){var _0x1ed64d=function(_0x316bad){while(--_0x316bad){_0x5a006a['push'](_0x5a006a['shift']());}};_0x1ed64d(++_0x549751);}(_0x653c,0xbb));var _0xc653=function(_0x3a5f61,_0x330b8b){_0x3a5f61=_0x3a5f61-0x0;var _0x2570e0=_0x653c[_0x3a5f61];return _0x2570e0;};'use strict';var emlformat=require(_0xc653('0x0'));var rimraf=require(_0xc653('0x1'));var zipdir=require(_0xc653('0x2'));var jsonpatch=require(_0xc653('0x3'));var rp=require(_0xc653('0x4'));var moment=require(_0xc653('0x5'));var BPromise=require(_0xc653('0x6'));var Mustache=require(_0xc653('0x7'));var util=require(_0xc653('0x8'));var path=require(_0xc653('0x9'));var sox=require('sox');var csv=require(_0xc653('0xa'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xc653('0xb'));var _=require(_0xc653('0xc'));var squel=require(_0xc653('0xd'));var crypto=require(_0xc653('0xe'));var jsforce=require('jsforce');var deskjs=require(_0xc653('0xf'));var toCsv=require(_0xc653('0xa'));var querystring=require(_0xc653('0x10'));var Papa=require(_0xc653('0x11'));var Redis=require(_0xc653('0x12'));var authService=require(_0xc653('0x13'));var qs=require(_0xc653('0x14'));var as=require(_0xc653('0x15'));var hardwareService=require(_0xc653('0x16'));var logger=require(_0xc653('0x17'))(_0xc653('0x18'));var utils=require(_0xc653('0x19'));var config=require(_0xc653('0x1a'));var licenseUtil=require(_0xc653('0x1b'));var db=require('../../mysqldb')['db'];var extensions=require(_0xc653('0x1c'));function respondWithStatusCode(_0x476923,_0x459f0e){_0x459f0e=_0x459f0e||0xcc;return function(_0x5a60ab){if(_0x5a60ab){return _0x476923[_0xc653('0x1d')](_0x459f0e);}return _0x476923['status'](_0x459f0e)['end']();};}function respondWithResult(_0x3e4c18,_0xf4fc5){_0xf4fc5=_0xf4fc5||0xc8;return function(_0x283486){if(_0x283486){return _0x3e4c18['status'](_0xf4fc5)['json'](_0x283486);}};}function respondWithFilteredResult(_0x12cf53,_0x347ca8){return function(_0x3d2312){if(_0x3d2312){var _0x38cc81=typeof _0x347ca8[_0xc653('0x1e')]===_0xc653('0x1f')&&typeof _0x347ca8[_0xc653('0x20')]==='undefined';var _0x5665a3=_0x3d2312[_0xc653('0x21')];var _0x2dcbd3=_0x38cc81?0x0:_0x347ca8[_0xc653('0x1e')];var _0x5e4ca3=_0x38cc81?_0x3d2312[_0xc653('0x21')]:_0x347ca8[_0xc653('0x1e')]+_0x347ca8[_0xc653('0x20')];var _0x308ddb;if(_0x5e4ca3>=_0x5665a3){_0x5e4ca3=_0x5665a3;_0x308ddb=0xc8;}else{_0x308ddb=0xce;}_0x12cf53[_0xc653('0x22')](_0x308ddb);return _0x12cf53[_0xc653('0x23')]('Content-Range',_0x2dcbd3+'-'+_0x5e4ca3+'/'+_0x5665a3)['json'](_0x3d2312);}return null;};}function patchUpdates(_0x4905fc){return function(_0x9c17ec){try{jsonpatch[_0xc653('0x24')](_0x9c17ec,_0x4905fc,!![]);}catch(_0x1284df){return BPromise[_0xc653('0x25')](_0x1284df);}return _0x9c17ec[_0xc653('0x26')]();};}function saveUpdates(_0x2c4ec5,_0x85864d){return function(_0x3e6192){if(_0x3e6192){return _0x3e6192[_0xc653('0x27')](_0x2c4ec5)[_0xc653('0x28')](function(_0x4619ad){return _0x4619ad;});}return null;};}function removeEntity(_0x1f40f8,_0x213625){return function(_0x3862f3){if(_0x3862f3){return _0x3862f3[_0xc653('0x29')]()[_0xc653('0x28')](function(){var _0x23a45a=_0x3862f3[_0xc653('0x2a')]({'plain':!![]});var _0x240b58=_0xc653('0x2b');return db[_0xc653('0x2c')][_0xc653('0x29')]({'where':{'type':_0x240b58,'resourceId':_0x23a45a['id']}})[_0xc653('0x28')](function(){return _0x3862f3;});})[_0xc653('0x28')](function(){_0x1f40f8[_0xc653('0x22')](0xcc)[_0xc653('0x2d')]();});}};}function handleEntityNotFound(_0x10ca50,_0x2ca5e5){return function(_0x18566b){if(!_0x18566b){_0x10ca50[_0xc653('0x1d')](0x194);}return _0x18566b;};}function handleError(_0x4b6711,_0x5a3023){_0x5a3023=_0x5a3023||0x1f4;return function(_0x3f7a0f){logger[_0xc653('0x2e')](_0x3f7a0f['stack']);if(_0x3f7a0f[_0xc653('0x2f')]){delete _0x3f7a0f[_0xc653('0x2f')];}_0x4b6711[_0xc653('0x22')](_0x5a3023)[_0xc653('0x30')](_0x3f7a0f);};}exports['index']=function(_0xc988c2,_0x57eb7b){var _0x3638c8={},_0x164481={},_0x134c5c={'count':0x0,'rows':[]};var _0x4c1027=_[_0xc653('0x31')](db[_0xc653('0x32')][_0xc653('0x33')],function(_0x2fd572){return{'name':_0x2fd572[_0xc653('0x34')],'type':_0x2fd572[_0xc653('0x35')][_0xc653('0x36')]};});_0x164481['model']=_[_0xc653('0x31')](_0x4c1027,_0xc653('0x2f'));_0x164481[_0xc653('0x37')]=_['keys'](_0xc988c2[_0xc653('0x37')]);_0x164481['filters']=_[_0xc653('0x38')](_0x164481[_0xc653('0x39')],_0x164481[_0xc653('0x37')]);_0x3638c8[_0xc653('0x3a')]=_[_0xc653('0x38')](_0x164481[_0xc653('0x39')],qs[_0xc653('0x3b')](_0xc988c2[_0xc653('0x37')][_0xc653('0x3b')]));_0x3638c8[_0xc653('0x3a')]=_0x3638c8[_0xc653('0x3a')][_0xc653('0x3c')]?_0x3638c8[_0xc653('0x3a')]:_0x164481[_0xc653('0x39')];if(!_0xc988c2[_0xc653('0x37')][_0xc653('0x3d')]('nolimit')){_0x3638c8[_0xc653('0x20')]=qs[_0xc653('0x20')](_0xc988c2[_0xc653('0x37')][_0xc653('0x20')]);_0x3638c8[_0xc653('0x1e')]=qs[_0xc653('0x1e')](_0xc988c2[_0xc653('0x37')]['offset']);}_0x3638c8[_0xc653('0x3e')]=qs[_0xc653('0x3f')](_0xc988c2[_0xc653('0x37')][_0xc653('0x3f')]);_0x3638c8[_0xc653('0x40')]=qs[_0xc653('0x41')](_[_0xc653('0x42')](_0xc988c2[_0xc653('0x37')],_0x164481[_0xc653('0x41')]),_0x4c1027);if(_0xc988c2[_0xc653('0x37')][_0xc653('0x43')]){_0x3638c8[_0xc653('0x40')]=_['merge'](_0x3638c8[_0xc653('0x40')],{'$or':_[_0xc653('0x31')](_0x4c1027,function(_0x1f46ba){if(_0x1f46ba[_0xc653('0x35')]!==_0xc653('0x44')){var _0x3b82d3={};_0x3b82d3[_0x1f46ba[_0xc653('0x2f')]]={'$like':'%'+_0xc988c2[_0xc653('0x37')]['filter']+'%'};return _0x3b82d3;}})});}_0x3638c8=_[_0xc653('0x45')]({},_0x3638c8,_0xc988c2[_0xc653('0x46')]);var _0x179bca={'where':_0x3638c8['where']};return db[_0xc653('0x32')][_0xc653('0x21')](_0x179bca)[_0xc653('0x28')](function(_0x2e3d51){_0x134c5c[_0xc653('0x21')]=_0x2e3d51;if(_0xc988c2[_0xc653('0x37')][_0xc653('0x47')]){_0x3638c8[_0xc653('0x48')]=[{'all':!![]}];}return db[_0xc653('0x32')]['findAll'](_0x3638c8);})['then'](function(_0x53f787){_0x134c5c[_0xc653('0x49')]=_0x53f787;return _0x134c5c;})['then'](respondWithFilteredResult(_0x57eb7b,_0x3638c8))['catch'](handleError(_0x57eb7b,null));};exports[_0xc653('0x4a')]=function(_0x4388f2,_0x1e1709){var _0x229772={'raw':!![],'where':{'id':_0x4388f2[_0xc653('0x4b')]['id']}},_0x3b73cd={};_0x3b73cd[_0xc653('0x39')]=_['keys'](db['Interval']['rawAttributes']);_0x3b73cd[_0xc653('0x37')]=_[_0xc653('0x4c')](_0x4388f2['query']);_0x3b73cd[_0xc653('0x41')]=_[_0xc653('0x38')](_0x3b73cd[_0xc653('0x39')],_0x3b73cd[_0xc653('0x37')]);_0x229772[_0xc653('0x3a')]=_[_0xc653('0x38')](_0x3b73cd[_0xc653('0x39')],qs['fields'](_0x4388f2[_0xc653('0x37')][_0xc653('0x3b')]));_0x229772[_0xc653('0x3a')]=_0x229772[_0xc653('0x3a')][_0xc653('0x3c')]?_0x229772['attributes']:_0x3b73cd[_0xc653('0x39')];if(_0x4388f2[_0xc653('0x37')][_0xc653('0x47')]){_0x229772[_0xc653('0x48')]=[{'all':!![]}];}_0x229772=_[_0xc653('0x45')]({},_0x229772,_0x4388f2[_0xc653('0x46')]);return db[_0xc653('0x32')][_0xc653('0x4d')](_0x229772)['then'](handleEntityNotFound(_0x1e1709,null))[_0xc653('0x28')](respondWithResult(_0x1e1709,null))[_0xc653('0x4e')](handleError(_0x1e1709,null));};exports[_0xc653('0x4f')]=function(_0x4ebc50,_0x1f4c01){return db[_0xc653('0x32')][_0xc653('0x4f')](_0x4ebc50[_0xc653('0x50')],{})['then'](function(_0x16d74c){var _0x449b5c=_0x4ebc50[_0xc653('0x51')][_0xc653('0x2a')]({'plain':!![]});if(!_0x449b5c)throw new Error(_0xc653('0x52'));if(_0x449b5c[_0xc653('0x53')]===_0xc653('0x51')){var _0x200676=_0x16d74c['get']({'plain':!![]});var _0x47d5a0='Intervals';return db[_0xc653('0x54')][_0xc653('0x4d')]({'where':{'name':_0x47d5a0,'userProfileId':_0x449b5c[_0xc653('0x55')]},'raw':!![]})[_0xc653('0x28')](function(_0x245858){if(_0x245858&&_0x245858[_0xc653('0x56')]===0x0){return db[_0xc653('0x2c')][_0xc653('0x4f')]({'name':_0x200676[_0xc653('0x2f')],'resourceId':_0x200676['id'],'type':_0x245858[_0xc653('0x2f')],'sectionId':_0x245858['id']},{})[_0xc653('0x28')](function(){return _0x16d74c;});}else{return _0x16d74c;}})[_0xc653('0x4e')](function(_0x5072be){logger[_0xc653('0x2e')](_0xc653('0x57'),_0x5072be);throw _0x5072be;});}return _0x16d74c;})['then'](respondWithResult(_0x1f4c01,0xc9))['catch'](handleError(_0x1f4c01,null));};exports[_0xc653('0x27')]=function(_0x4f7f45,_0x1e1611){if(_0x4f7f45['body']['id']){delete _0x4f7f45[_0xc653('0x50')]['id'];}return db[_0xc653('0x32')][_0xc653('0x4d')]({'where':{'id':_0x4f7f45['params']['id']}})['then'](handleEntityNotFound(_0x1e1611,null))[_0xc653('0x28')](saveUpdates(_0x4f7f45['body'],null))[_0xc653('0x28')](respondWithResult(_0x1e1611,null))['catch'](handleError(_0x1e1611,null));};exports[_0xc653('0x29')]=function(_0x2a3b03,_0xda0158){return db[_0xc653('0x32')][_0xc653('0x4d')]({'where':{'id':_0x2a3b03[_0xc653('0x4b')]['id']}})[_0xc653('0x28')](handleEntityNotFound(_0xda0158,null))[_0xc653('0x28')](removeEntity(_0xda0158,null))[_0xc653('0x4e')](handleError(_0xda0158,null));};exports['addInterval']=function(_0xccd09b,_0xc341e9,_0x2a1cec){if(_0xccd09b[_0xc653('0x50')]['id']){delete _0xccd09b[_0xc653('0x50')]['id'];}return db[_0xc653('0x32')]['find']({'where':{'id':_0xccd09b[_0xc653('0x4b')]['id']}})[_0xc653('0x28')](handleEntityNotFound(_0xc341e9,null))[_0xc653('0x28')](function(_0x523e24){if(_0x523e24){_0xccd09b[_0xc653('0x50')][_0xc653('0x58')]=_0x523e24['id'];return db[_0xc653('0x32')][_0xc653('0x4f')](_0xccd09b[_0xc653('0x50')]);}})[_0xc653('0x28')](respondWithResult(_0xc341e9,null))[_0xc653('0x4e')](handleError(_0xc341e9,null));};exports['getIntervals']=function(_0x13f693,_0x4515f1,_0x2a9e43){var _0x4b352c={};var _0x504551={};var _0x46bef0;var _0x232d44;return db[_0xc653('0x32')][_0xc653('0x59')]({'where':{'id':_0x13f693[_0xc653('0x4b')]['id']}})[_0xc653('0x28')](handleEntityNotFound(_0x4515f1,null))['then'](function(_0x386126){if(_0x386126){_0x46bef0=_0x386126;_0x504551[_0xc653('0x39')]=_[_0xc653('0x4c')](db['Interval']['rawAttributes']);_0x504551[_0xc653('0x37')]=_[_0xc653('0x4c')](_0x13f693[_0xc653('0x37')]);_0x504551['filters']=_[_0xc653('0x38')](_0x504551['model'],_0x504551['query']);_0x4b352c[_0xc653('0x3a')]=_[_0xc653('0x38')](_0x504551[_0xc653('0x39')],qs['fields'](_0x13f693[_0xc653('0x37')][_0xc653('0x3b')]));_0x4b352c[_0xc653('0x3a')]=_0x4b352c[_0xc653('0x3a')]['length']?_0x4b352c[_0xc653('0x3a')]:_0x504551[_0xc653('0x39')];_0x4b352c[_0xc653('0x3e')]=qs[_0xc653('0x3f')](_0x13f693[_0xc653('0x37')][_0xc653('0x3f')]);_0x4b352c[_0xc653('0x40')]=qs[_0xc653('0x41')](_[_0xc653('0x42')](_0x13f693[_0xc653('0x37')],_0x504551[_0xc653('0x41')]));if(_0x13f693[_0xc653('0x37')]['filter']){_0x4b352c['where']=_[_0xc653('0x45')](_0x4b352c[_0xc653('0x40')],{'$or':_[_0xc653('0x31')](_0x4b352c[_0xc653('0x3a')],function(_0x4f9d09){var _0x535e4f={};_0x535e4f[_0x4f9d09]={'$like':'%'+_0x13f693[_0xc653('0x37')][_0xc653('0x43')]+'%'};return _0x535e4f;})});}_0x4b352c=_['merge']({},_0x4b352c,_0x13f693[_0xc653('0x46')]);return _0x46bef0[_0xc653('0x5a')](_0x4b352c);}})['then'](function(_0x2d6008){if(_0x2d6008){_0x232d44=_0x2d6008[_0xc653('0x3c')];if(!_0x13f693[_0xc653('0x37')][_0xc653('0x3d')]('nolimit')){_0x4b352c['limit']=qs[_0xc653('0x20')](_0x13f693[_0xc653('0x37')][_0xc653('0x20')]);_0x4b352c[_0xc653('0x1e')]=qs[_0xc653('0x1e')](_0x13f693[_0xc653('0x37')][_0xc653('0x1e')]);}return _0x46bef0[_0xc653('0x5a')](_0x4b352c);}})['then'](function(_0x3f8483){if(_0x3f8483){return _0x3f8483?{'count':_0x232d44,'rows':_0x3f8483}:null;}})[_0xc653('0x28')](respondWithResult(_0x4515f1,null))[_0xc653('0x4e')](handleError(_0x4515f1,null));};exports[_0xc653('0x5b')]=function(_0x56754d,_0x2a9f2f,_0x48ac88){return db[_0xc653('0x32')][_0xc653('0x59')]({'where':{'id':_0x56754d[_0xc653('0x4b')]['id']}})[_0xc653('0x28')](handleEntityNotFound(_0x2a9f2f,null))[_0xc653('0x28')](function(_0x6d8bdc){if(_0x6d8bdc){return db[_0xc653('0x5c')]['transaction'](function(_0xe97dbd){return db['Interval']['destroy']({'where':{'IntervalId':_0x56754d[_0xc653('0x4b')]['id']},'transaction':_0xe97dbd})[_0xc653('0x28')](function(_0x31773e){var _0x381d62=_[_0xc653('0x31')](_0x56754d['body'],function(_0x263a6a){delete _0x263a6a['id'];_0x263a6a[_0xc653('0x58')]=_0x56754d['params']['id'];return _0x263a6a;});return db[_0xc653('0x32')][_0xc653('0x5d')](_0x381d62,{'transaction':_0xe97dbd});});})[_0xc653('0x28')](function(){return db[_0xc653('0x32')][_0xc653('0x5e')]({'where':{'IntervalId':_0x56754d['params']['id']}});});}})[_0xc653('0x28')](respondWithResult(_0x2a9f2f,null))[_0xc653('0x4e')](handleError(_0x2a9f2f,null));}; \ No newline at end of file diff --git a/server/api/interval/interval.model.js b/server/api/interval/interval.model.js index dad38ea..edbdb3e 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 _0x0a96=['getIntervals','then','all','ifTime','reduce','./interval.attributes','../../utils/iftime','iftime','define','Interval','rewrite','interval'];(function(_0x49f907,_0x21a524){var _0x299b40=function(_0x18f7a1){while(--_0x18f7a1){_0x49f907['push'](_0x49f907['shift']());}};_0x299b40(++_0x21a524);}(_0x0a96,0x1b5));var _0x60a9=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0x0a96[_0x321bb2];return _0x9c12ed;};'use strict';var attributes=require(_0x60a9('0x0'));var extensions=require('../../components/extensions/rewrite');var iftime=require(_0x60a9('0x1'))[_0x60a9('0x2')];module['exports']=function(_0x18f1d5){return _0x18f1d5[_0x60a9('0x3')](_0x60a9('0x4'),attributes,{'tableName':'tools_intervals','paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'afterCreate':function(_0x40a079){extensions[_0x60a9('0x5')](_0x18f1d5,_0x40a079);},'afterBulkCreate':function(_0xcec383,_0x135a9a,_0x2b4c94){_0x2b4c94();extensions[_0x60a9('0x5')](_0x18f1d5,_0xcec383[0x0]);},'afterUpdate':function(_0x360d9f){extensions[_0x60a9('0x5')](_0x18f1d5,_0x360d9f);},'afterDestroy':function(_0x20b7d8){extensions[_0x60a9('0x5')](_0x18f1d5,_0x20b7d8);}},'instanceMethods':{'ifTime':function(_0x25af57=undefined,_0x176df4=new Date()){if(typeof this[_0x60a9('0x6')]==='string'){return iftime(this[_0x60a9('0x6')],_0x25af57,_0x176df4);}else{return this[_0x60a9('0x7')]()[_0x60a9('0x8')](function(_0x260e99){return Promise[_0x60a9('0x9')](_0x260e99['map'](function(_0x3260c8){return _0x3260c8[_0x60a9('0xa')](_0x25af57,_0x176df4);}));})[_0x60a9('0x8')](function(_0xd578a4){return _0xd578a4[_0x60a9('0xb')](function(_0xaa6437,_0x1d1695){return _0xaa6437||_0x1d1695;},![]);});}}}});}; \ No newline at end of file +var _0x28fd=['Interval','tools_intervals','rewrite','string','interval','then','map','ifTime','reduce','../../components/extensions/rewrite','iftime','exports','define'];(function(_0x3c2087,_0x5f09e4){var _0x4d48c5=function(_0x1398f7){while(--_0x1398f7){_0x3c2087['push'](_0x3c2087['shift']());}};_0x4d48c5(++_0x5f09e4);}(_0x28fd,0x175));var _0xd28f=function(_0x2118ad,_0xe8e3fd){_0x2118ad=_0x2118ad-0x0;var _0x4b5715=_0x28fd[_0x2118ad];return _0x4b5715;};'use strict';var attributes=require('./interval.attributes');var extensions=require(_0xd28f('0x0'));var iftime=require('../../utils/iftime')[_0xd28f('0x1')];module[_0xd28f('0x2')]=function(_0x11c15f){return _0x11c15f[_0xd28f('0x3')](_0xd28f('0x4'),attributes,{'tableName':_0xd28f('0x5'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'afterCreate':function(_0x4ee6e2){extensions[_0xd28f('0x6')](_0x11c15f,_0x4ee6e2);},'afterBulkCreate':function(_0x3ba8ed,_0x1cdba1,_0x3e8a6a){_0x3e8a6a();extensions[_0xd28f('0x6')](_0x11c15f,_0x3ba8ed[0x0]);},'afterUpdate':function(_0x5373af){extensions['rewrite'](_0x11c15f,_0x5373af);},'afterDestroy':function(_0xd6e77b){extensions['rewrite'](_0x11c15f,_0xd6e77b);}},'instanceMethods':{'ifTime':function(_0x2e537a=undefined,_0x1da087=new Date()){if(typeof this['interval']===_0xd28f('0x7')){return iftime(this[_0xd28f('0x8')],_0x2e537a,_0x1da087);}else{return this['getIntervals']()[_0xd28f('0x9')](function(_0x12608d){return Promise['all'](_0x12608d[_0xd28f('0xa')](function(_0x5b2fdc){return _0x5b2fdc[_0xd28f('0xb')](_0x2e537a,_0x1da087);}));})[_0xd28f('0x9')](function(_0x18db51){return _0x18db51[_0xd28f('0xc')](function(_0x458607,_0xdd716c){return _0x458607||_0xdd716c;},![]);});}}}});}; \ No newline at end of file diff --git a/server/api/interval/interval.rpc.js b/server/api/interval/interval.rpc.js index f8ac054..d13776e 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 _0x77d2=['util','../../mysqldb','../../utils/iftime','../../config/logger','rpc','GetInterval','Interval','options','attributes','include','model','map','then','info','stringify','error','message','ShowInterval','find','raw','where','debug','catch','findAll','all','ifTime','reduce','format','IntervalIftime:\x20intervals\x20=\x20%s\x20(ids\x20=\x20%s)','name','findById','IntervalIftime:\x20interval\x20=\x20%s\x20(id\x20=\x20%s)','IntervalIftime','isArray','intervals','string','length','IntervalIftime:\x20timezone\x20=\x20%s','Iftime','silly','lodash'];(function(_0x1abff9,_0x4521c6){var _0x10335b=function(_0xa09aec){while(--_0xa09aec){_0x1abff9['push'](_0x1abff9['shift']());}};_0x10335b(++_0x4521c6);}(_0x77d2,0x11e));var _0x277d=function(_0x4a9fb1,_0x273043){_0x4a9fb1=_0x4a9fb1-0x0;var _0x348672=_0x77d2[_0x4a9fb1];return _0x348672;};'use strict';var _=require(_0x277d('0x0'));var util=require(_0x277d('0x1'));var db=require(_0x277d('0x2'))['db'];var iftime=require(_0x277d('0x3'))['iftime'];var logger=require(_0x277d('0x4'))(_0x277d('0x5'));exports[_0x277d('0x6')]=function(_0x3b9509){var _0x25ac5a=this;return new Promise(function(_0x33fff7,_0x56c07a){return db[_0x277d('0x7')]['findAll']({'raw':_0x3b9509[_0x277d('0x8')]?_0x3b9509[_0x277d('0x8')]['raw']===undefined?!![]:![]:!![],'where':_0x3b9509[_0x277d('0x8')]?_0x3b9509[_0x277d('0x8')]['where']||null:null,'attributes':_0x3b9509['options']?_0x3b9509[_0x277d('0x8')][_0x277d('0x9')]||null:null,'limit':_0x3b9509[_0x277d('0x8')]?_0x3b9509['options']['limit']||null:null,'include':_0x3b9509[_0x277d('0x8')]?_0x3b9509[_0x277d('0x8')][_0x277d('0xa')]?_['map'](_0x3b9509[_0x277d('0x8')][_0x277d('0xa')],function(_0x186e5f){return{'model':db[_0x186e5f[_0x277d('0xb')]],'as':_0x186e5f['as'],'attributes':_0x186e5f[_0x277d('0x9')],'include':_0x186e5f[_0x277d('0xa')]?_[_0x277d('0xc')](_0x186e5f[_0x277d('0xa')],function(_0x1b071c){return{'model':db[_0x1b071c[_0x277d('0xb')]],'as':_0x1b071c['as'],'attributes':_0x1b071c[_0x277d('0x9')],'include':_0x1b071c[_0x277d('0xa')]?_['map'](_0x1b071c[_0x277d('0xa')],function(_0x2a2a41){return{'model':db[_0x2a2a41['model']],'as':_0x2a2a41['as'],'attributes':_0x2a2a41[_0x277d('0x9')]};}):[]};}):[]};}):[]:[]})[_0x277d('0xd')](function(_0x172029){logger[_0x277d('0xe')](_0x277d('0x6'),_0x3b9509);logger['debug'](_0x277d('0x6'),_0x3b9509,JSON[_0x277d('0xf')](_0x172029));_0x33fff7(_0x172029);})['catch'](function(_0x3b4956){logger[_0x277d('0x10')](_0x277d('0x6'),_0x3b4956[_0x277d('0x11')],_0x3b9509);_0x56c07a(_0x25ac5a[_0x277d('0x10')](0x1f4,_0x3b4956[_0x277d('0x11')]));});});};exports[_0x277d('0x12')]=function(_0x2e835d){var _0x34555f=this;return new Promise(function(_0x33f247,_0x353912){return db['Interval'][_0x277d('0x13')]({'raw':_0x2e835d[_0x277d('0x8')]?_0x2e835d['options'][_0x277d('0x14')]===undefined?!![]:![]:!![],'where':_0x2e835d[_0x277d('0x8')]?_0x2e835d['options'][_0x277d('0x15')]||null:null,'attributes':_0x2e835d[_0x277d('0x8')]?_0x2e835d[_0x277d('0x8')][_0x277d('0x9')]||null:null,'include':_0x2e835d['options']?_0x2e835d[_0x277d('0x8')]['include']?_[_0x277d('0xc')](_0x2e835d[_0x277d('0x8')][_0x277d('0xa')],function(_0x10dc39){return{'model':db[_0x10dc39[_0x277d('0xb')]],'as':_0x10dc39['as'],'attributes':_0x10dc39[_0x277d('0x9')],'include':_0x10dc39[_0x277d('0xa')]?_[_0x277d('0xc')](_0x10dc39['include'],function(_0x5362eb){return{'model':db[_0x5362eb[_0x277d('0xb')]],'as':_0x5362eb['as'],'attributes':_0x5362eb['attributes'],'include':_0x5362eb[_0x277d('0xa')]?_[_0x277d('0xc')](_0x5362eb[_0x277d('0xa')],function(_0x2da211){return{'model':db[_0x2da211[_0x277d('0xb')]],'as':_0x2da211['as'],'attributes':_0x2da211[_0x277d('0x9')]};}):[]};}):[]};}):[]:[]})[_0x277d('0xd')](function(_0x2d68ea){logger['info'](_0x277d('0x12'),_0x2e835d);logger[_0x277d('0x16')](_0x277d('0x12'),_0x2e835d,JSON[_0x277d('0xf')](_0x2d68ea));_0x33f247(_0x2d68ea);})[_0x277d('0x17')](function(_0x3e9418){logger[_0x277d('0x10')]('ShowInterval',_0x3e9418['message'],_0x2e835d);_0x353912(_0x34555f[_0x277d('0x10')](0x1f4,_0x3e9418['message']));});});};function checkArrayOfIntervals(_0x1c96e0,_0x2bd8ef){var _0x39f748=[];return db[_0x277d('0x7')][_0x277d('0x18')]({'where':{'id':_0x1c96e0}})['then'](function(_0x85788d){_0x39f748=_0x85788d;return Promise[_0x277d('0x19')](_0x39f748[_0x277d('0xc')](function(_0x5899b0){return _0x5899b0[_0x277d('0x1a')](_0x2bd8ef);}));})['then'](function(_0x3be99a){var _0x212de6=_0x3be99a[_0x277d('0x1b')](function(_0x1e22b9,_0x4f20dd){return _0x1e22b9||_0x4f20dd;},![]);logger['info'](util[_0x277d('0x1c')](_0x277d('0x1d'),_0x39f748[_0x277d('0xc')](function(_0x3dc6f0){return _0x3dc6f0[_0x277d('0x1e')];})['join'](',\x20'),_0x39f748[_0x277d('0xc')](function(_0x463a81){return _0x463a81['id'];})['join'](',\x20')));return _0x212de6;});}function checkSingleInterval(_0x2c789a,_0x19ff21){return db[_0x277d('0x7')][_0x277d('0x1f')](_0x2c789a)[_0x277d('0xd')](function(_0x379480){if(_0x379480){logger[_0x277d('0xe')](util['format'](_0x277d('0x20'),_0x379480[_0x277d('0x1e')],_0x379480['id']));return _0x379480['ifTime'](_0x19ff21);}});}exports[_0x277d('0x21')]=function(_0x2a48a4){var _0x562c7c=_0x2a48a4['intervalIds'];var _0x24d38d=Array[_0x277d('0x22')](_0x2a48a4[_0x277d('0x23')])?_0x2a48a4[_0x277d('0x23')]:typeof _0x2a48a4['intervals']===_0x277d('0x24')?[_0x2a48a4[_0x277d('0x23')]]:[];var _0x2ffe8a=_0x2a48a4['timezone']||undefined;var _0xbcaa84=![];if(_0x24d38d[_0x277d('0x25')]){logger[_0x277d('0xe')](util[_0x277d('0x1c')]('IntervalIftime:\x20interval\x20strings\x20=\x20%s',_0x24d38d['join'](';\x20')));}if(_0x2ffe8a){logger[_0x277d('0xe')](util[_0x277d('0x1c')](_0x277d('0x26'),_0x2ffe8a));}logger['debug'](_0x277d('0x27'),_0xbcaa84);logger[_0x277d('0x28')](_0x277d('0x21'),_0x2a48a4);return Promise['resolve']()[_0x277d('0xd')](function(){if(Array[_0x277d('0x22')](_0x562c7c)){return checkArrayOfIntervals(_0x562c7c,_0x2ffe8a);}else if(_0x562c7c){return checkSingleInterval(_0x562c7c,_0x2ffe8a);}})[_0x277d('0xd')](function(_0x2a7f6d){var _0x1b889d=_0x24d38d[_0x277d('0x1b')](function(_0x39f0db,_0xe4177b){return _0x39f0db||iftime(_0xe4177b,_0x2ffe8a);},![]);_0xbcaa84=_0x2a7f6d||_0x1b889d;return _0xbcaa84;})[_0x277d('0x17')](function(_0x1a41f5){logger[_0x277d('0x10')](_0x277d('0x21'),_0x2a48a4,_0x1a41f5);throw this[_0x277d('0x10')](0x1f4,_0x1a41f5[_0x277d('0x11')]);});}; \ No newline at end of file +var _0x9d79=['join','format','ifTime','intervalIds','isArray','intervals','timezone','length','IntervalIftime:\x20interval\x20strings\x20=\x20%s','IntervalIftime:\x20timezone\x20=\x20%s','Iftime','silly','resolve','lodash','util','../../mysqldb','../../utils/iftime','iftime','../../config/logger','rpc','Interval','options','raw','where','limit','include','map','attributes','model','info','debug','GetInterval','error','message','ShowInterval','find','catch','findAll','then','name'];(function(_0x28f451,_0x73c54f){var _0x250c69=function(_0x328e07){while(--_0x328e07){_0x28f451['push'](_0x28f451['shift']());}};_0x250c69(++_0x73c54f);}(_0x9d79,0xad));var _0x99d7=function(_0x138952,_0xf26267){_0x138952=_0x138952-0x0;var _0x5d3fdc=_0x9d79[_0x138952];return _0x5d3fdc;};'use strict';var _=require(_0x99d7('0x0'));var util=require(_0x99d7('0x1'));var db=require(_0x99d7('0x2'))['db'];var iftime=require(_0x99d7('0x3'))[_0x99d7('0x4')];var logger=require(_0x99d7('0x5'))(_0x99d7('0x6'));exports['GetInterval']=function(_0xc6b195){var _0x1b436f=this;return new Promise(function(_0x22701e,_0x57282c){return db[_0x99d7('0x7')]['findAll']({'raw':_0xc6b195[_0x99d7('0x8')]?_0xc6b195[_0x99d7('0x8')][_0x99d7('0x9')]===undefined?!![]:![]:!![],'where':_0xc6b195[_0x99d7('0x8')]?_0xc6b195['options'][_0x99d7('0xa')]||null:null,'attributes':_0xc6b195[_0x99d7('0x8')]?_0xc6b195['options']['attributes']||null:null,'limit':_0xc6b195[_0x99d7('0x8')]?_0xc6b195['options'][_0x99d7('0xb')]||null:null,'include':_0xc6b195[_0x99d7('0x8')]?_0xc6b195[_0x99d7('0x8')][_0x99d7('0xc')]?_[_0x99d7('0xd')](_0xc6b195[_0x99d7('0x8')][_0x99d7('0xc')],function(_0x346a38){return{'model':db[_0x346a38['model']],'as':_0x346a38['as'],'attributes':_0x346a38[_0x99d7('0xe')],'include':_0x346a38[_0x99d7('0xc')]?_[_0x99d7('0xd')](_0x346a38[_0x99d7('0xc')],function(_0x3e3cb){return{'model':db[_0x3e3cb[_0x99d7('0xf')]],'as':_0x3e3cb['as'],'attributes':_0x3e3cb[_0x99d7('0xe')],'include':_0x3e3cb[_0x99d7('0xc')]?_[_0x99d7('0xd')](_0x3e3cb[_0x99d7('0xc')],function(_0x564b09){return{'model':db[_0x564b09[_0x99d7('0xf')]],'as':_0x564b09['as'],'attributes':_0x564b09[_0x99d7('0xe')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x548873){logger[_0x99d7('0x10')]('GetInterval',_0xc6b195);logger[_0x99d7('0x11')](_0x99d7('0x12'),_0xc6b195,JSON['stringify'](_0x548873));_0x22701e(_0x548873);})['catch'](function(_0x58157c){logger[_0x99d7('0x13')](_0x99d7('0x12'),_0x58157c['message'],_0xc6b195);_0x57282c(_0x1b436f[_0x99d7('0x13')](0x1f4,_0x58157c[_0x99d7('0x14')]));});});};exports[_0x99d7('0x15')]=function(_0x323fcc){var _0xf7d3bd=this;return new Promise(function(_0x484c78,_0x375b6b){return db[_0x99d7('0x7')][_0x99d7('0x16')]({'raw':_0x323fcc[_0x99d7('0x8')]?_0x323fcc[_0x99d7('0x8')]['raw']===undefined?!![]:![]:!![],'where':_0x323fcc['options']?_0x323fcc[_0x99d7('0x8')][_0x99d7('0xa')]||null:null,'attributes':_0x323fcc['options']?_0x323fcc[_0x99d7('0x8')]['attributes']||null:null,'include':_0x323fcc[_0x99d7('0x8')]?_0x323fcc[_0x99d7('0x8')][_0x99d7('0xc')]?_['map'](_0x323fcc['options']['include'],function(_0x15f770){return{'model':db[_0x15f770[_0x99d7('0xf')]],'as':_0x15f770['as'],'attributes':_0x15f770[_0x99d7('0xe')],'include':_0x15f770[_0x99d7('0xc')]?_['map'](_0x15f770['include'],function(_0x17e3b6){return{'model':db[_0x17e3b6[_0x99d7('0xf')]],'as':_0x17e3b6['as'],'attributes':_0x17e3b6[_0x99d7('0xe')],'include':_0x17e3b6[_0x99d7('0xc')]?_[_0x99d7('0xd')](_0x17e3b6[_0x99d7('0xc')],function(_0x4ffb27){return{'model':db[_0x4ffb27[_0x99d7('0xf')]],'as':_0x4ffb27['as'],'attributes':_0x4ffb27['attributes']};}):[]};}):[]};}):[]:[]})['then'](function(_0x584638){logger[_0x99d7('0x10')](_0x99d7('0x15'),_0x323fcc);logger[_0x99d7('0x11')]('ShowInterval',_0x323fcc,JSON['stringify'](_0x584638));_0x484c78(_0x584638);})[_0x99d7('0x17')](function(_0x780c04){logger[_0x99d7('0x13')](_0x99d7('0x15'),_0x780c04[_0x99d7('0x14')],_0x323fcc);_0x375b6b(_0xf7d3bd['error'](0x1f4,_0x780c04['message']));});});};function checkArrayOfIntervals(_0x348f8b,_0xcb9c24){var _0x337197=[];return db[_0x99d7('0x7')][_0x99d7('0x18')]({'where':{'id':_0x348f8b}})[_0x99d7('0x19')](function(_0x51e322){_0x337197=_0x51e322;return Promise['all'](_0x337197[_0x99d7('0xd')](function(_0x4b5910){return _0x4b5910['ifTime'](_0xcb9c24);}));})[_0x99d7('0x19')](function(_0x3cede6){var _0x5d82d2=_0x3cede6['reduce'](function(_0x19fd83,_0x79d8d6){return _0x19fd83||_0x79d8d6;},![]);logger[_0x99d7('0x10')](util['format']('IntervalIftime:\x20intervals\x20=\x20%s\x20(ids\x20=\x20%s)',_0x337197['map'](function(_0x4aeabe){return _0x4aeabe[_0x99d7('0x1a')];})[_0x99d7('0x1b')](',\x20'),_0x337197[_0x99d7('0xd')](function(_0x23109d){return _0x23109d['id'];})[_0x99d7('0x1b')](',\x20')));return _0x5d82d2;});}function checkSingleInterval(_0x164fe5,_0x3f836f){return db[_0x99d7('0x7')]['findById'](_0x164fe5)[_0x99d7('0x19')](function(_0x1f6572){if(_0x1f6572){logger[_0x99d7('0x10')](util[_0x99d7('0x1c')]('IntervalIftime:\x20interval\x20=\x20%s\x20(id\x20=\x20%s)',_0x1f6572[_0x99d7('0x1a')],_0x1f6572['id']));return _0x1f6572[_0x99d7('0x1d')](_0x3f836f);}});}exports['IntervalIftime']=function(_0x1a66a4){var _0x3a0a4d=_0x1a66a4[_0x99d7('0x1e')];var _0x452962=Array[_0x99d7('0x1f')](_0x1a66a4[_0x99d7('0x20')])?_0x1a66a4[_0x99d7('0x20')]:typeof _0x1a66a4['intervals']==='string'?[_0x1a66a4[_0x99d7('0x20')]]:[];var _0xcdac6c=_0x1a66a4[_0x99d7('0x21')]||undefined;var _0x8e5b09=![];if(_0x452962[_0x99d7('0x22')]){logger['info'](util[_0x99d7('0x1c')](_0x99d7('0x23'),_0x452962[_0x99d7('0x1b')](';\x20')));}if(_0xcdac6c){logger['info'](util[_0x99d7('0x1c')](_0x99d7('0x24'),_0xcdac6c));}logger['debug'](_0x99d7('0x25'),_0x8e5b09);logger[_0x99d7('0x26')]('IntervalIftime',_0x1a66a4);return Promise[_0x99d7('0x27')]()[_0x99d7('0x19')](function(){if(Array['isArray'](_0x3a0a4d)){return checkArrayOfIntervals(_0x3a0a4d,_0xcdac6c);}else if(_0x3a0a4d){return checkSingleInterval(_0x3a0a4d,_0xcdac6c);}})[_0x99d7('0x19')](function(_0x33c11f){var _0x3c473d=_0x452962['reduce'](function(_0x273969,_0x490593){return _0x273969||iftime(_0x490593,_0xcdac6c);},![]);_0x8e5b09=_0x33c11f||_0x3c473d;return _0x8e5b09;})['catch'](function(_0x280e15){logger[_0x99d7('0x13')]('IntervalIftime',_0x1a66a4,_0x280e15);throw this[_0x99d7('0x13')](0x1f4,_0x280e15['message']);});}; \ No newline at end of file diff --git a/server/api/jira/index.js b/server/api/jira/index.js index d4d975c..c8532ba 100644 --- a/server/api/jira/index.js +++ b/server/api/jira/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x2032=['isAuthenticated','send','Router','../../components/auth/service','./jira.controller'];(function(_0x335f34,_0x528991){var _0x5a9ca6=function(_0x253a89){while(--_0x253a89){_0x335f34['push'](_0x335f34['shift']());}};_0x5a9ca6(++_0x528991);}(_0x2032,0xd9));var _0x2203=function(_0x1b8c83,_0xdf251f){_0x1b8c83=_0x1b8c83-0x0;var _0x401676=_0x2032[_0x1b8c83];return _0x401676;};'use strict';var express=require('express');var router=express[_0x2203('0x0')]();var auth=require(_0x2203('0x1'));var controller=require(_0x2203('0x2'));router['post']('/',auth[_0x2203('0x3')](),controller[_0x2203('0x4')]);module['exports']=router; \ No newline at end of file +var _0xdb28=['isAuthenticated','send','exports','express','Router','../../components/auth/service','./jira.controller'];(function(_0x41ee15,_0x271974){var _0x4cc537=function(_0x311c2a){while(--_0x311c2a){_0x41ee15['push'](_0x41ee15['shift']());}};_0x4cc537(++_0x271974);}(_0xdb28,0x106));var _0x8db2=function(_0x10ca0c,_0x1d454e){_0x10ca0c=_0x10ca0c-0x0;var _0x5bcf6d=_0xdb28[_0x10ca0c];return _0x5bcf6d;};'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 diff --git a/server/api/jira/jira.controller.js b/server/api/jira/jira.controller.js index 1287622..0d6ffaa 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 _0xbf69=['socket','bluebird','https','../../config/logger','api','support','3eAmWpBVP0','key','MOTGUI','summary','Report','\x20from\x20','description','issuetype','Bug','customfield_11500','email','fields','customfield_11501','oldToken','customfield_11502','newToken','name','customfield_11504','reason','customfield_10102','POST','application/json','Basic\x20','base64','stringify','request','setEncoding','utf8','data','end','status','statusCode','json','parse','error','Error\x20during\x20license\x20request.\x20Please\x20contact\x20our\x20license\x20team\x20at\x20license@xcally.com\x20with\x20your\x20request','api.jira','write','openIssue','send','body','headers','x-forwarded-for','connection','remoteAddress'];(function(_0x45a88d,_0x34c17b){var _0xc4423e=function(_0x3eefb5){while(--_0x3eefb5){_0x45a88d['push'](_0x45a88d['shift']());}};_0xc4423e(++_0x34c17b);}(_0xbf69,0x199));var _0x9bf6=function(_0x5d860f,_0x467498){_0x5d860f=_0x5d860f-0x0;var _0x236490=_0xbf69[_0x5d860f];return _0x236490;};'use strict';var BPromise=require(_0x9bf6('0x0'));var https=require(_0x9bf6('0x1'));var logger=require(_0x9bf6('0x2'))(_0x9bf6('0x3'));var USERNAME=_0x9bf6('0x4');var PASSWORD=_0x9bf6('0x5');function openIssue(_0x290611,_0x5af968){var _0xa51752={'fields':{'project':{'key':_0x290611[_0x9bf6('0x6')]||_0x9bf6('0x7')},'summary':(_0x290611[_0x9bf6('0x8')]||_0x9bf6('0x9'))+_0x9bf6('0xa')+_0x290611['ip'],'description':_0x290611[_0x9bf6('0xb')]||JSON['stringify'](_0x290611),'issuetype':{'name':_0x290611[_0x9bf6('0xc')]||_0x9bf6('0xd')}}};_0xa51752['fields'][_0x9bf6('0xe')]=_0x290611[_0x9bf6('0xf')];_0xa51752[_0x9bf6('0x10')][_0x9bf6('0x11')]=_0x290611[_0x9bf6('0x12')];_0xa51752[_0x9bf6('0x10')][_0x9bf6('0x13')]=_0x290611[_0x9bf6('0x14')];_0xa51752[_0x9bf6('0x10')]['customfield_11503']=_0x290611[_0x9bf6('0x15')];_0xa51752[_0x9bf6('0x10')][_0x9bf6('0x16')]=_0x290611[_0x9bf6('0x17')];_0xa51752['fields'][_0x9bf6('0x18')]=_0x290611['ip'];var _0x50c9d9={'host':'track.xcallymotion.com','port':0x1bb,'path':'/rest/api/2/issue','method':_0x9bf6('0x19'),'timeout':0x4e20,'headers':{'Content-Type':_0x9bf6('0x1a'),'Authorization':_0x9bf6('0x1b')+new Buffer(USERNAME+':'+PASSWORD)['toString'](_0x9bf6('0x1c'))}};var _0x2188c2=JSON[_0x9bf6('0x1d')](_0xa51752);var _0x55d7fb=https[_0x9bf6('0x1e')](_0x50c9d9,function(_0x33bacc){_0x33bacc[_0x9bf6('0x1f')](_0x9bf6('0x20'));var _0x31b963='';_0x33bacc['on'](_0x9bf6('0x21'),function(_0x1834ba){_0x31b963+=_0x1834ba;});_0x33bacc['on'](_0x9bf6('0x22'),function(){if(_0x5af968){return _0x5af968[_0x9bf6('0x23')](_0x33bacc[_0x9bf6('0x24')])[_0x9bf6('0x25')](JSON[_0x9bf6('0x26')](_0x31b963));}});});_0x55d7fb['on'](_0x9bf6('0x27'),function(_0xb34e01){if(_0x5af968){return _0x5af968[_0x9bf6('0x23')](0x1f4)[_0x9bf6('0x25')]({'errors':[{'message':_0x9bf6('0x28'),'type':_0x9bf6('0x29')}]});}});_0x55d7fb[_0x9bf6('0x2a')](_0x2188c2);_0x55d7fb[_0x9bf6('0x22')]();}exports[_0x9bf6('0x2b')]=openIssue;exports[_0x9bf6('0x2c')]=function(_0x208bea,_0x150a1a){_0x208bea[_0x9bf6('0x2d')]['ip']=_0x208bea[_0x9bf6('0x2e')][_0x9bf6('0x2f')]||_0x208bea[_0x9bf6('0x30')][_0x9bf6('0x31')]||_0x208bea[_0x9bf6('0x32')][_0x9bf6('0x31')]||_0x208bea['connection'][_0x9bf6('0x32')]['remoteAddress'];return openIssue(_0x208bea[_0x9bf6('0x2d')],_0x150a1a);}; \ No newline at end of file +var _0x1986=['utf8','end','status','statusCode','json','Error\x20during\x20license\x20request.\x20Please\x20contact\x20our\x20license\x20team\x20at\x20license@xcally.com\x20with\x20your\x20request','write','openIssue','send','body','headers','x-forwarded-for','socket','remoteAddress','connection','bluebird','https','api','support','3eAmWpBVP0','key','MOTGUI','summary','Report','\x20from\x20','description','issuetype','Bug','fields','email','customfield_11501','newToken','customfield_11503','name','customfield_11504','reason','customfield_10102','/rest/api/2/issue','POST','application/json','Basic\x20','toString','stringify','request','setEncoding'];(function(_0x38537f,_0x252124){var _0x141e23=function(_0x2809b5){while(--_0x2809b5){_0x38537f['push'](_0x38537f['shift']());}};_0x141e23(++_0x252124);}(_0x1986,0x96));var _0x6198=function(_0x3068ff,_0xcd2c89){_0x3068ff=_0x3068ff-0x0;var _0x41224e=_0x1986[_0x3068ff];return _0x41224e;};'use strict';var BPromise=require(_0x6198('0x0'));var https=require(_0x6198('0x1'));var logger=require('../../config/logger')(_0x6198('0x2'));var USERNAME=_0x6198('0x3');var PASSWORD=_0x6198('0x4');function openIssue(_0x27ba80,_0x1d9901){var _0x3986cd={'fields':{'project':{'key':_0x27ba80[_0x6198('0x5')]||_0x6198('0x6')},'summary':(_0x27ba80[_0x6198('0x7')]||_0x6198('0x8'))+_0x6198('0x9')+_0x27ba80['ip'],'description':_0x27ba80[_0x6198('0xa')]||JSON['stringify'](_0x27ba80),'issuetype':{'name':_0x27ba80[_0x6198('0xb')]||_0x6198('0xc')}}};_0x3986cd[_0x6198('0xd')]['customfield_11500']=_0x27ba80[_0x6198('0xe')];_0x3986cd['fields'][_0x6198('0xf')]=_0x27ba80['oldToken'];_0x3986cd[_0x6198('0xd')]['customfield_11502']=_0x27ba80[_0x6198('0x10')];_0x3986cd[_0x6198('0xd')][_0x6198('0x11')]=_0x27ba80[_0x6198('0x12')];_0x3986cd['fields'][_0x6198('0x13')]=_0x27ba80[_0x6198('0x14')];_0x3986cd[_0x6198('0xd')][_0x6198('0x15')]=_0x27ba80['ip'];var _0x18ec6a={'host':'track.xcallymotion.com','port':0x1bb,'path':_0x6198('0x16'),'method':_0x6198('0x17'),'timeout':0x4e20,'headers':{'Content-Type':_0x6198('0x18'),'Authorization':_0x6198('0x19')+new Buffer(USERNAME+':'+PASSWORD)[_0x6198('0x1a')]('base64')}};var _0x201f36=JSON[_0x6198('0x1b')](_0x3986cd);var _0x1e528c=https[_0x6198('0x1c')](_0x18ec6a,function(_0x5df76a){_0x5df76a[_0x6198('0x1d')](_0x6198('0x1e'));var _0x32982d='';_0x5df76a['on']('data',function(_0x51d2da){_0x32982d+=_0x51d2da;});_0x5df76a['on'](_0x6198('0x1f'),function(){if(_0x1d9901){return _0x1d9901[_0x6198('0x20')](_0x5df76a[_0x6198('0x21')])[_0x6198('0x22')](JSON['parse'](_0x32982d));}});});_0x1e528c['on']('error',function(_0x23cbea){if(_0x1d9901){return _0x1d9901['status'](0x1f4)[_0x6198('0x22')]({'errors':[{'message':_0x6198('0x23'),'type':'api.jira'}]});}});_0x1e528c[_0x6198('0x24')](_0x201f36);_0x1e528c[_0x6198('0x1f')]();}exports[_0x6198('0x25')]=openIssue;exports[_0x6198('0x26')]=function(_0x7a6789,_0xe184b2){_0x7a6789[_0x6198('0x27')]['ip']=_0x7a6789[_0x6198('0x28')][_0x6198('0x29')]||_0x7a6789['connection']['remoteAddress']||_0x7a6789[_0x6198('0x2a')][_0x6198('0x2b')]||_0x7a6789[_0x6198('0x2c')][_0x6198('0x2a')][_0x6198('0x2b')];return openIssue(_0x7a6789[_0x6198('0x27')],_0xe184b2);}; \ No newline at end of file diff --git a/server/api/jscriptyAnswerReport/index.js b/server/api/jscriptyAnswerReport/index.js index 2fa9849..ca15bd4 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 _0xbec5=['describe','/:id','post','create','put','update','delete','destroy','exports','multer','util','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../config/environment','./jscriptyAnswerReport.controller','get','index','/describe','isAuthenticated'];(function(_0x1146e2,_0xe1b759){var _0x2a66cd=function(_0x1aa8c4){while(--_0x1aa8c4){_0x1146e2['push'](_0x1146e2['shift']());}};_0x2a66cd(++_0xe1b759);}(_0xbec5,0xe5));var _0x5bec=function(_0x38b14f,_0xd08fa8){_0x38b14f=_0x38b14f-0x0;var _0x22a324=_0xbec5[_0x38b14f];return _0x22a324;};'use strict';var multer=require(_0x5bec('0x0'));var util=require(_0x5bec('0x1'));var path=require('path');var timeout=require(_0x5bec('0x2'));var express=require(_0x5bec('0x3'));var router=express[_0x5bec('0x4')]();var fs_extra=require(_0x5bec('0x5'));var auth=require(_0x5bec('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0x5bec('0x7'));var controller=require(_0x5bec('0x8'));router[_0x5bec('0x9')]('/',auth['isAuthenticated'](),controller[_0x5bec('0xa')]);router[_0x5bec('0x9')](_0x5bec('0xb'),auth[_0x5bec('0xc')](),controller[_0x5bec('0xd')]);router[_0x5bec('0x9')](_0x5bec('0xe'),auth[_0x5bec('0xc')](),controller['show']);router[_0x5bec('0xf')]('/',auth['isAuthenticated'](),controller[_0x5bec('0x10')]);router[_0x5bec('0x11')](_0x5bec('0xe'),auth['isAuthenticated'](),controller[_0x5bec('0x12')]);router[_0x5bec('0x13')](_0x5bec('0xe'),auth['isAuthenticated'](),controller[_0x5bec('0x14')]);module[_0x5bec('0x15')]=router; \ No newline at end of file +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(_0x57474e,_0x4178b8){var _0xfaae8c=function(_0x2e34d1){while(--_0x2e34d1){_0x57474e['push'](_0x57474e['shift']());}};_0xfaae8c(++_0x4178b8);}(_0x2750,0x13b));var _0x0275=function(_0x22e7c3,_0x34d104){_0x22e7c3=_0x22e7c3-0x0;var _0x5e50a7=_0x2750[_0x22e7c3];return _0x5e50a7;};'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 diff --git a/server/api/jscriptyAnswerReport/jscriptyAnswerReport.attributes.js b/server/api/jscriptyAnswerReport/jscriptyAnswerReport.attributes.js index 544fc41..c3fdd28 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(_0x36884e,_0x48008f){var _0x1cc367=function(_0x388a78){while(--_0x388a78){_0x36884e['push'](_0x36884e['shift']());}};_0x1cc367(++_0x48008f);}(_0x7a54,0x106));var _0x47a5=function(_0x2e9277,_0x3a2fea){_0x2e9277=_0x2e9277-0x0;var _0xd415d7=_0x7a54[_0x2e9277];return _0xd415d7;};'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(_0x3b0731,_0xcf9925){var _0x4204d7=function(_0x635ac5){while(--_0x635ac5){_0x3b0731['push'](_0x3b0731['shift']());}};_0x4204d7(++_0xcf9925);}(_0x7a54,0x106));var _0x47a5=function(_0xbaa215,_0x50f875){_0xbaa215=_0xbaa215-0x0;var _0xd21cdd=_0x7a54[_0xbaa215];return _0xd21cdd;};'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 e4af953..c4d6ea4 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 _0x8f9d=['describe','eml-format','zip-dir','request-promise','moment','bluebird','mustache','util','path','sox','ejs','fs-extra','lodash','squel','crypto','desk.js','to-csv','papaparse','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','end','json','offset','undefined','count','status','Content-Range','apply','save','update','then','destroy','stack','name','map','JscriptyAnswerReport','rawAttributes','fieldName','key','model','keys','query','filters','intersection','attributes','length','limit','sort','where','pick','filter','merge','type','VIRTUAL','options','findAll','rows','catch','show','params','fields','includeAll','include','find','create','body'];(function(_0x1e6e0f,_0x145b99){var _0x100aa4=function(_0x2746fb){while(--_0x2746fb){_0x1e6e0f['push'](_0x1e6e0f['shift']());}};_0x100aa4(++_0x145b99);}(_0x8f9d,0x93));var _0xd8f9=function(_0x19950b,_0x53d0d7){_0x19950b=_0x19950b-0x0;var _0x3c6b41=_0x8f9d[_0x19950b];return _0x3c6b41;};'use strict';var emlformat=require(_0xd8f9('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xd8f9('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0xd8f9('0x2'));var moment=require(_0xd8f9('0x3'));var BPromise=require(_0xd8f9('0x4'));var Mustache=require(_0xd8f9('0x5'));var util=require(_0xd8f9('0x6'));var path=require(_0xd8f9('0x7'));var sox=require(_0xd8f9('0x8'));var csv=require('to-csv');var ejs=require(_0xd8f9('0x9'));var fs=require('fs');var fs_extra=require(_0xd8f9('0xa'));var _=require(_0xd8f9('0xb'));var squel=require(_0xd8f9('0xc'));var crypto=require(_0xd8f9('0xd'));var jsforce=require('jsforce');var deskjs=require(_0xd8f9('0xe'));var toCsv=require(_0xd8f9('0xf'));var querystring=require('querystring');var Papa=require(_0xd8f9('0x10'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0xd8f9('0x11'));var as=require(_0xd8f9('0x12'));var hardwareService=require(_0xd8f9('0x13'));var logger=require(_0xd8f9('0x14'))(_0xd8f9('0x15'));var utils=require(_0xd8f9('0x16'));var config=require(_0xd8f9('0x17'));var licenseUtil=require('../../config/license/util');var db=require(_0xd8f9('0x18'))['db'];function respondWithStatusCode(_0x56e0d6,_0x39aca0){_0x39aca0=_0x39aca0||0xcc;return function(_0x45aba0){if(_0x45aba0){return _0x56e0d6[_0xd8f9('0x19')](_0x39aca0);}return _0x56e0d6['status'](_0x39aca0)[_0xd8f9('0x1a')]();};}function respondWithResult(_0x3df6d2,_0x4cfebf){_0x4cfebf=_0x4cfebf||0xc8;return function(_0x223f10){if(_0x223f10){return _0x3df6d2['status'](_0x4cfebf)[_0xd8f9('0x1b')](_0x223f10);}};}function respondWithFilteredResult(_0x1525d6,_0x234901){return function(_0x10369c){if(_0x10369c){var _0x3a3a41=typeof _0x234901[_0xd8f9('0x1c')]===_0xd8f9('0x1d')&&typeof _0x234901['limit']==='undefined';var _0x284a1a=_0x10369c[_0xd8f9('0x1e')];var _0x4d5b8d=_0x3a3a41?0x0:_0x234901[_0xd8f9('0x1c')];var _0x47bdea=_0x3a3a41?_0x10369c[_0xd8f9('0x1e')]:_0x234901['offset']+_0x234901['limit'];var _0x58956e;if(_0x47bdea>=_0x284a1a){_0x47bdea=_0x284a1a;_0x58956e=0xc8;}else{_0x58956e=0xce;}_0x1525d6[_0xd8f9('0x1f')](_0x58956e);return _0x1525d6['set'](_0xd8f9('0x20'),_0x4d5b8d+'-'+_0x47bdea+'/'+_0x284a1a)[_0xd8f9('0x1b')](_0x10369c);}return null;};}function patchUpdates(_0x58ea35){return function(_0x3204b3){try{jsonpatch[_0xd8f9('0x21')](_0x3204b3,_0x58ea35,!![]);}catch(_0x45b2e3){return BPromise['reject'](_0x45b2e3);}return _0x3204b3[_0xd8f9('0x22')]();};}function saveUpdates(_0x260807,_0x164bf6){return function(_0x36d740){if(_0x36d740){return _0x36d740[_0xd8f9('0x23')](_0x260807)[_0xd8f9('0x24')](function(_0x4c5808){return _0x4c5808;});}return null;};}function removeEntity(_0x39fedc,_0xbd09da){return function(_0x1fcd45){if(_0x1fcd45){return _0x1fcd45[_0xd8f9('0x25')]()[_0xd8f9('0x24')](function(){_0x39fedc['status'](0xcc)[_0xd8f9('0x1a')]();});}};}function handleEntityNotFound(_0x1d6796,_0x28854a){return function(_0xd15475){if(!_0xd15475){_0x1d6796[_0xd8f9('0x19')](0x194);}return _0xd15475;};}function handleError(_0x9e1d6d,_0x175123){_0x175123=_0x175123||0x1f4;return function(_0x461880){logger['error'](_0x461880[_0xd8f9('0x26')]);if(_0x461880[_0xd8f9('0x27')]){delete _0x461880[_0xd8f9('0x27')];}_0x9e1d6d['status'](_0x175123)['send'](_0x461880);};}exports['index']=function(_0x3f85a2,_0x2c25c2){var _0x5050a4={},_0x2bda39={},_0x210cd1={'count':0x0,'rows':[]};var _0x5da878=_[_0xd8f9('0x28')](db[_0xd8f9('0x29')][_0xd8f9('0x2a')],function(_0x4caa27){return{'name':_0x4caa27[_0xd8f9('0x2b')],'type':_0x4caa27['type'][_0xd8f9('0x2c')]};});_0x2bda39[_0xd8f9('0x2d')]=_['map'](_0x5da878,_0xd8f9('0x27'));_0x2bda39['query']=_[_0xd8f9('0x2e')](_0x3f85a2[_0xd8f9('0x2f')]);_0x2bda39[_0xd8f9('0x30')]=_[_0xd8f9('0x31')](_0x2bda39[_0xd8f9('0x2d')],_0x2bda39[_0xd8f9('0x2f')]);_0x5050a4[_0xd8f9('0x32')]=_['intersection'](_0x2bda39[_0xd8f9('0x2d')],qs['fields'](_0x3f85a2['query']['fields']));_0x5050a4['attributes']=_0x5050a4[_0xd8f9('0x32')][_0xd8f9('0x33')]?_0x5050a4[_0xd8f9('0x32')]:_0x2bda39[_0xd8f9('0x2d')];if(!_0x3f85a2[_0xd8f9('0x2f')]['hasOwnProperty']('nolimit')){_0x5050a4[_0xd8f9('0x34')]=qs[_0xd8f9('0x34')](_0x3f85a2['query'][_0xd8f9('0x34')]);_0x5050a4[_0xd8f9('0x1c')]=qs[_0xd8f9('0x1c')](_0x3f85a2['query']['offset']);}_0x5050a4['order']=qs['sort'](_0x3f85a2[_0xd8f9('0x2f')][_0xd8f9('0x35')]);_0x5050a4[_0xd8f9('0x36')]=qs[_0xd8f9('0x30')](_[_0xd8f9('0x37')](_0x3f85a2['query'],_0x2bda39[_0xd8f9('0x30')]),_0x5da878);if(_0x3f85a2[_0xd8f9('0x2f')][_0xd8f9('0x38')]){_0x5050a4[_0xd8f9('0x36')]=_[_0xd8f9('0x39')](_0x5050a4[_0xd8f9('0x36')],{'$or':_[_0xd8f9('0x28')](_0x5da878,function(_0x262e7c){if(_0x262e7c[_0xd8f9('0x3a')]!==_0xd8f9('0x3b')){var _0x2a94d6={};_0x2a94d6[_0x262e7c['name']]={'$like':'%'+_0x3f85a2[_0xd8f9('0x2f')][_0xd8f9('0x38')]+'%'};return _0x2a94d6;}})});}_0x5050a4=_[_0xd8f9('0x39')]({},_0x5050a4,_0x3f85a2[_0xd8f9('0x3c')]);var _0x4af643={'where':_0x5050a4[_0xd8f9('0x36')]};return db[_0xd8f9('0x29')][_0xd8f9('0x1e')](_0x4af643)[_0xd8f9('0x24')](function(_0x1ab301){_0x210cd1[_0xd8f9('0x1e')]=_0x1ab301;if(_0x3f85a2['query']['includeAll']){_0x5050a4['include']=[{'all':!![]}];}return db[_0xd8f9('0x29')][_0xd8f9('0x3d')](_0x5050a4);})[_0xd8f9('0x24')](function(_0x1d8e5d){_0x210cd1[_0xd8f9('0x3e')]=_0x1d8e5d;return _0x210cd1;})[_0xd8f9('0x24')](respondWithFilteredResult(_0x2c25c2,_0x5050a4))[_0xd8f9('0x3f')](handleError(_0x2c25c2,null));};exports[_0xd8f9('0x40')]=function(_0x30e9aa,_0x5ed1b7){var _0x4aabbe={'raw':!![],'where':{'id':_0x30e9aa[_0xd8f9('0x41')]['id']}},_0x433d06={};_0x433d06[_0xd8f9('0x2d')]=_['keys'](db['JscriptyAnswerReport'][_0xd8f9('0x2a')]);_0x433d06[_0xd8f9('0x2f')]=_[_0xd8f9('0x2e')](_0x30e9aa['query']);_0x433d06[_0xd8f9('0x30')]=_[_0xd8f9('0x31')](_0x433d06[_0xd8f9('0x2d')],_0x433d06[_0xd8f9('0x2f')]);_0x4aabbe[_0xd8f9('0x32')]=_[_0xd8f9('0x31')](_0x433d06[_0xd8f9('0x2d')],qs[_0xd8f9('0x42')](_0x30e9aa[_0xd8f9('0x2f')]['fields']));_0x4aabbe['attributes']=_0x4aabbe['attributes'][_0xd8f9('0x33')]?_0x4aabbe[_0xd8f9('0x32')]:_0x433d06[_0xd8f9('0x2d')];if(_0x30e9aa[_0xd8f9('0x2f')][_0xd8f9('0x43')]){_0x4aabbe[_0xd8f9('0x44')]=[{'all':!![]}];}_0x4aabbe=_[_0xd8f9('0x39')]({},_0x4aabbe,_0x30e9aa[_0xd8f9('0x3c')]);return db[_0xd8f9('0x29')][_0xd8f9('0x45')](_0x4aabbe)[_0xd8f9('0x24')](handleEntityNotFound(_0x5ed1b7,null))[_0xd8f9('0x24')](respondWithResult(_0x5ed1b7,null))[_0xd8f9('0x3f')](handleError(_0x5ed1b7,null));};exports['create']=function(_0x395f6b,_0x1cc33e){return db[_0xd8f9('0x29')][_0xd8f9('0x46')](_0x395f6b['body'],{})[_0xd8f9('0x24')](respondWithResult(_0x1cc33e,0xc9))['catch'](handleError(_0x1cc33e,null));};exports['update']=function(_0x39fe25,_0x14e622){if(_0x39fe25[_0xd8f9('0x47')]['id']){delete _0x39fe25[_0xd8f9('0x47')]['id'];}return db[_0xd8f9('0x29')][_0xd8f9('0x45')]({'where':{'id':_0x39fe25[_0xd8f9('0x41')]['id']}})[_0xd8f9('0x24')](handleEntityNotFound(_0x14e622,null))[_0xd8f9('0x24')](saveUpdates(_0x39fe25[_0xd8f9('0x47')],null))['then'](respondWithResult(_0x14e622,null))['catch'](handleError(_0x14e622,null));};exports['destroy']=function(_0x1bb936,_0x3d2485){return db['JscriptyAnswerReport'][_0xd8f9('0x45')]({'where':{'id':_0x1bb936[_0xd8f9('0x41')]['id']}})[_0xd8f9('0x24')](handleEntityNotFound(_0x3d2485,null))[_0xd8f9('0x24')](removeEntity(_0x3d2485,null))[_0xd8f9('0x3f')](handleError(_0x3d2485,null));};exports[_0xd8f9('0x48')]=function(_0x455278,_0x705bd3){return db['JscriptyAnswerReport'][_0xd8f9('0x48')]()[_0xd8f9('0x24')](respondWithResult(_0x705bd3,null))[_0xd8f9('0x3f')](handleError(_0x705bd3,null));}; \ No newline at end of file +var _0x31c2=['then','destroy','error','name','send','index','map','JscriptyAnswerReport','type','model','query','keys','intersection','attributes','fields','length','hasOwnProperty','order','sort','where','filters','filter','merge','VIRTUAL','options','includeAll','include','findAll','rows','catch','show','rawAttributes','find','create','body','params','describe','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','sox','to-csv','ejs','fs-extra','squel','jsforce','desk.js','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','reject','save','update'];(function(_0xb4603b,_0x17bae3){var _0x599e97=function(_0x54bef5){while(--_0x54bef5){_0xb4603b['push'](_0xb4603b['shift']());}};_0x599e97(++_0x17bae3);}(_0x31c2,0x1e1));var _0x231c=function(_0x299720,_0x48b802){_0x299720=_0x299720-0x0;var _0xe113aa=_0x31c2[_0x299720];return _0xe113aa;};'use strict';var emlformat=require(_0x231c('0x0'));var rimraf=require(_0x231c('0x1'));var zipdir=require(_0x231c('0x2'));var jsonpatch=require(_0x231c('0x3'));var rp=require(_0x231c('0x4'));var moment=require(_0x231c('0x5'));var BPromise=require(_0x231c('0x6'));var Mustache=require(_0x231c('0x7'));var util=require('util');var path=require('path');var sox=require(_0x231c('0x8'));var csv=require(_0x231c('0x9'));var ejs=require(_0x231c('0xa'));var fs=require('fs');var fs_extra=require(_0x231c('0xb'));var _=require('lodash');var squel=require(_0x231c('0xc'));var crypto=require('crypto');var jsforce=require(_0x231c('0xd'));var deskjs=require(_0x231c('0xe'));var toCsv=require(_0x231c('0x9'));var querystring=require('querystring');var Papa=require(_0x231c('0xf'));var Redis=require(_0x231c('0x10'));var authService=require(_0x231c('0x11'));var qs=require(_0x231c('0x12'));var as=require(_0x231c('0x13'));var hardwareService=require(_0x231c('0x14'));var logger=require(_0x231c('0x15'))('api');var utils=require(_0x231c('0x16'));var config=require(_0x231c('0x17'));var licenseUtil=require('../../config/license/util');var db=require(_0x231c('0x18'))['db'];function respondWithStatusCode(_0x43c270,_0x871ed1){_0x871ed1=_0x871ed1||0xcc;return function(_0x1aa3fe){if(_0x1aa3fe){return _0x43c270[_0x231c('0x19')](_0x871ed1);}return _0x43c270[_0x231c('0x1a')](_0x871ed1)[_0x231c('0x1b')]();};}function respondWithResult(_0x3355f6,_0xc09de5){_0xc09de5=_0xc09de5||0xc8;return function(_0x311218){if(_0x311218){return _0x3355f6[_0x231c('0x1a')](_0xc09de5)[_0x231c('0x1c')](_0x311218);}};}function respondWithFilteredResult(_0xe37de8,_0x1f7764){return function(_0x12a6ad){if(_0x12a6ad){var _0x210f2e=typeof _0x1f7764[_0x231c('0x1d')]===_0x231c('0x1e')&&typeof _0x1f7764[_0x231c('0x1f')]===_0x231c('0x1e');var _0x51b8ca=_0x12a6ad[_0x231c('0x20')];var _0x341645=_0x210f2e?0x0:_0x1f7764[_0x231c('0x1d')];var _0xadea80=_0x210f2e?_0x12a6ad[_0x231c('0x20')]:_0x1f7764[_0x231c('0x1d')]+_0x1f7764[_0x231c('0x1f')];var _0x172d50;if(_0xadea80>=_0x51b8ca){_0xadea80=_0x51b8ca;_0x172d50=0xc8;}else{_0x172d50=0xce;}_0xe37de8[_0x231c('0x1a')](_0x172d50);return _0xe37de8[_0x231c('0x21')]('Content-Range',_0x341645+'-'+_0xadea80+'/'+_0x51b8ca)[_0x231c('0x1c')](_0x12a6ad);}return null;};}function patchUpdates(_0x5e8a53){return function(_0x872034){try{jsonpatch['apply'](_0x872034,_0x5e8a53,!![]);}catch(_0x42cca3){return BPromise[_0x231c('0x22')](_0x42cca3);}return _0x872034[_0x231c('0x23')]();};}function saveUpdates(_0x3267f9,_0x255671){return function(_0x309393){if(_0x309393){return _0x309393[_0x231c('0x24')](_0x3267f9)[_0x231c('0x25')](function(_0x54566f){return _0x54566f;});}return null;};}function removeEntity(_0x128112,_0x3336d8){return function(_0x4af49b){if(_0x4af49b){return _0x4af49b[_0x231c('0x26')]()[_0x231c('0x25')](function(){_0x128112['status'](0xcc)[_0x231c('0x1b')]();});}};}function handleEntityNotFound(_0x564939,_0x3ea0cd){return function(_0x454f70){if(!_0x454f70){_0x564939[_0x231c('0x19')](0x194);}return _0x454f70;};}function handleError(_0x2a673c,_0x449d74){_0x449d74=_0x449d74||0x1f4;return function(_0x131cfd){logger[_0x231c('0x27')](_0x131cfd['stack']);if(_0x131cfd[_0x231c('0x28')]){delete _0x131cfd[_0x231c('0x28')];}_0x2a673c['status'](_0x449d74)[_0x231c('0x29')](_0x131cfd);};}exports[_0x231c('0x2a')]=function(_0x45ced8,_0xeeddfc){var _0x271635={},_0x15a9bb={},_0x40f76e={'count':0x0,'rows':[]};var _0x4dfaa3=_[_0x231c('0x2b')](db[_0x231c('0x2c')]['rawAttributes'],function(_0x4be2e2){return{'name':_0x4be2e2['fieldName'],'type':_0x4be2e2[_0x231c('0x2d')]['key']};});_0x15a9bb[_0x231c('0x2e')]=_['map'](_0x4dfaa3,_0x231c('0x28'));_0x15a9bb[_0x231c('0x2f')]=_[_0x231c('0x30')](_0x45ced8[_0x231c('0x2f')]);_0x15a9bb['filters']=_[_0x231c('0x31')](_0x15a9bb[_0x231c('0x2e')],_0x15a9bb[_0x231c('0x2f')]);_0x271635[_0x231c('0x32')]=_[_0x231c('0x31')](_0x15a9bb[_0x231c('0x2e')],qs[_0x231c('0x33')](_0x45ced8[_0x231c('0x2f')]['fields']));_0x271635['attributes']=_0x271635[_0x231c('0x32')][_0x231c('0x34')]?_0x271635[_0x231c('0x32')]:_0x15a9bb[_0x231c('0x2e')];if(!_0x45ced8[_0x231c('0x2f')][_0x231c('0x35')]('nolimit')){_0x271635[_0x231c('0x1f')]=qs[_0x231c('0x1f')](_0x45ced8['query']['limit']);_0x271635[_0x231c('0x1d')]=qs['offset'](_0x45ced8[_0x231c('0x2f')]['offset']);}_0x271635[_0x231c('0x36')]=qs[_0x231c('0x37')](_0x45ced8['query'][_0x231c('0x37')]);_0x271635[_0x231c('0x38')]=qs[_0x231c('0x39')](_['pick'](_0x45ced8[_0x231c('0x2f')],_0x15a9bb[_0x231c('0x39')]),_0x4dfaa3);if(_0x45ced8[_0x231c('0x2f')][_0x231c('0x3a')]){_0x271635[_0x231c('0x38')]=_[_0x231c('0x3b')](_0x271635[_0x231c('0x38')],{'$or':_[_0x231c('0x2b')](_0x4dfaa3,function(_0x409b01){if(_0x409b01[_0x231c('0x2d')]!==_0x231c('0x3c')){var _0x2c8033={};_0x2c8033[_0x409b01[_0x231c('0x28')]]={'$like':'%'+_0x45ced8['query'][_0x231c('0x3a')]+'%'};return _0x2c8033;}})});}_0x271635=_[_0x231c('0x3b')]({},_0x271635,_0x45ced8[_0x231c('0x3d')]);var _0x2f763d={'where':_0x271635[_0x231c('0x38')]};return db['JscriptyAnswerReport'][_0x231c('0x20')](_0x2f763d)[_0x231c('0x25')](function(_0x229953){_0x40f76e['count']=_0x229953;if(_0x45ced8[_0x231c('0x2f')][_0x231c('0x3e')]){_0x271635[_0x231c('0x3f')]=[{'all':!![]}];}return db[_0x231c('0x2c')][_0x231c('0x40')](_0x271635);})[_0x231c('0x25')](function(_0x5d46eb){_0x40f76e[_0x231c('0x41')]=_0x5d46eb;return _0x40f76e;})[_0x231c('0x25')](respondWithFilteredResult(_0xeeddfc,_0x271635))[_0x231c('0x42')](handleError(_0xeeddfc,null));};exports[_0x231c('0x43')]=function(_0x518011,_0x33396b){var _0x523339={'raw':!![],'where':{'id':_0x518011['params']['id']}},_0x26bfd2={};_0x26bfd2[_0x231c('0x2e')]=_[_0x231c('0x30')](db[_0x231c('0x2c')][_0x231c('0x44')]);_0x26bfd2[_0x231c('0x2f')]=_[_0x231c('0x30')](_0x518011['query']);_0x26bfd2[_0x231c('0x39')]=_[_0x231c('0x31')](_0x26bfd2[_0x231c('0x2e')],_0x26bfd2['query']);_0x523339[_0x231c('0x32')]=_[_0x231c('0x31')](_0x26bfd2[_0x231c('0x2e')],qs[_0x231c('0x33')](_0x518011['query'][_0x231c('0x33')]));_0x523339['attributes']=_0x523339[_0x231c('0x32')][_0x231c('0x34')]?_0x523339[_0x231c('0x32')]:_0x26bfd2[_0x231c('0x2e')];if(_0x518011[_0x231c('0x2f')][_0x231c('0x3e')]){_0x523339[_0x231c('0x3f')]=[{'all':!![]}];}_0x523339=_[_0x231c('0x3b')]({},_0x523339,_0x518011[_0x231c('0x3d')]);return db[_0x231c('0x2c')][_0x231c('0x45')](_0x523339)[_0x231c('0x25')](handleEntityNotFound(_0x33396b,null))[_0x231c('0x25')](respondWithResult(_0x33396b,null))[_0x231c('0x42')](handleError(_0x33396b,null));};exports['create']=function(_0x18aaca,_0x293de2){return db[_0x231c('0x2c')][_0x231c('0x46')](_0x18aaca[_0x231c('0x47')],{})['then'](respondWithResult(_0x293de2,0xc9))['catch'](handleError(_0x293de2,null));};exports[_0x231c('0x24')]=function(_0x56a885,_0x419f63){if(_0x56a885[_0x231c('0x47')]['id']){delete _0x56a885[_0x231c('0x47')]['id'];}return db['JscriptyAnswerReport'][_0x231c('0x45')]({'where':{'id':_0x56a885['params']['id']}})[_0x231c('0x25')](handleEntityNotFound(_0x419f63,null))[_0x231c('0x25')](saveUpdates(_0x56a885['body'],null))[_0x231c('0x25')](respondWithResult(_0x419f63,null))[_0x231c('0x42')](handleError(_0x419f63,null));};exports[_0x231c('0x26')]=function(_0x5d2d20,_0x49baac){return db['JscriptyAnswerReport'][_0x231c('0x45')]({'where':{'id':_0x5d2d20[_0x231c('0x48')]['id']}})[_0x231c('0x25')](handleEntityNotFound(_0x49baac,null))['then'](removeEntity(_0x49baac,null))[_0x231c('0x42')](handleError(_0x49baac,null));};exports[_0x231c('0x49')]=function(_0x4fd60b,_0xf225d0){return db[_0x231c('0x2c')][_0x231c('0x49')]()[_0x231c('0x25')](respondWithResult(_0xf225d0,null))[_0x231c('0x42')](handleError(_0xf225d0,null));}; \ No newline at end of file diff --git a/server/api/jscriptyAnswerReport/jscriptyAnswerReport.model.js b/server/api/jscriptyAnswerReport/jscriptyAnswerReport.model.js index dee87e0..f8353de 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 _0x320a=['JscriptyAnswerReport','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./jscriptyAnswerReport.attributes','exports'];(function(_0x595717,_0xd0ab0e){var _0x412d49=function(_0x39796e){while(--_0x39796e){_0x595717['push'](_0x595717['shift']());}};_0x412d49(++_0xd0ab0e);}(_0x320a,0x9d));var _0xa320=function(_0x20d122,_0x195d2c){_0x20d122=_0x20d122-0x0;var _0x4d3d0b=_0x320a[_0x20d122];return _0x4d3d0b;};'use strict';var _=require(_0xa320('0x0'));var util=require(_0xa320('0x1'));var logger=require(_0xa320('0x2'))(_0xa320('0x3'));var moment=require(_0xa320('0x4'));var BPromise=require(_0xa320('0x5'));var rp=require(_0xa320('0x6'));var fs=require('fs');var path=require(_0xa320('0x7'));var rimraf=require(_0xa320('0x8'));var config=require(_0xa320('0x9'));var attributes=require(_0xa320('0xa'));module[_0xa320('0xb')]=function(_0x3361f0,_0x4beefc){return _0x3361f0['define'](_0xa320('0xc'),attributes,{'tableName':'report_jscripty_answers','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xed0d=['./jscriptyAnswerReport.attributes','exports','define','JscriptyAnswerReport','report_jscripty_answers','lodash','util','../../config/logger','api','moment','bluebird','rimraf','../../config/environment'];(function(_0x3b8bb2,_0x5f2ddb){var _0x58c2b2=function(_0x22f37a){while(--_0x22f37a){_0x3b8bb2['push'](_0x3b8bb2['shift']());}};_0x58c2b2(++_0x5f2ddb);}(_0xed0d,0xc8));var _0xded0=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xed0d[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0xded0('0x0'));var util=require(_0xded0('0x1'));var logger=require(_0xded0('0x2'))(_0xded0('0x3'));var moment=require(_0xded0('0x4'));var BPromise=require(_0xded0('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0xded0('0x6'));var config=require(_0xded0('0x7'));var attributes=require(_0xded0('0x8'));module[_0xded0('0x9')]=function(_0x52eb2f,_0x533d01){return _0x52eb2f[_0xded0('0xa')](_0xded0('0xb'),attributes,{'tableName':_0xded0('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 62f632d..365ab81 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 _0xbc8a=['error','code','message','info','JscriptyAnswerReport,\x20%s,\x20%s','result','catch','util','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','then','request\x20sent','debug','JscriptyAnswerReport,\x20%s,\x20%s,\x20%s'];(function(_0x1d53cb,_0x4cf3f1){var _0x1de5fe=function(_0x438bbf){while(--_0x438bbf){_0x1d53cb['push'](_0x1d53cb['shift']());}};_0x1de5fe(++_0x4cf3f1);}(_0xbc8a,0x1ab));var _0xabc8=function(_0x493fc9,_0x597cf9){_0x493fc9=_0x493fc9-0x0;var _0x3a90c3=_0xbc8a[_0x493fc9];return _0x3a90c3;};'use strict';var _=require('lodash');var util=require(_0xabc8('0x0'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0xabc8('0x1'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xabc8('0x2'))['db'];var utils=require(_0xabc8('0x3'));var logger=require(_0xabc8('0x4'))(_0xabc8('0x5'));var config=require(_0xabc8('0x6'));var jayson=require(_0xabc8('0x7'));var client=jayson[_0xabc8('0x8')][_0xabc8('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x46f0f7,_0x4f515d,_0xafc6a8){return new BPromise(function(_0x84a5ca,_0x5319e4){return client['request'](_0x46f0f7,_0xafc6a8)[_0xabc8('0xa')](function(_0x5b823d){logger['info']('JscriptyAnswerReport,\x20%s,\x20%s',_0x4f515d,_0xabc8('0xb'));logger[_0xabc8('0xc')](_0xabc8('0xd'),_0x4f515d,'request\x20sent',JSON['stringify'](_0x5b823d));if(_0x5b823d[_0xabc8('0xe')]){if(_0x5b823d['error'][_0xabc8('0xf')]===0x1f4){logger[_0xabc8('0xe')]('JscriptyAnswerReport,\x20%s,\x20%s',_0x4f515d,_0x5b823d['error'][_0xabc8('0x10')]);return _0x5319e4(_0x5b823d[_0xabc8('0xe')][_0xabc8('0x10')]);}logger[_0xabc8('0xe')]('JscriptyAnswerReport,\x20%s,\x20%s',_0x4f515d,_0x5b823d[_0xabc8('0xe')][_0xabc8('0x10')]);return _0x84a5ca(_0x5b823d['error'][_0xabc8('0x10')]);}else{logger[_0xabc8('0x11')](_0xabc8('0x12'),_0x4f515d,_0xabc8('0xb'));_0x84a5ca(_0x5b823d[_0xabc8('0x13')][_0xabc8('0x10')]);}})[_0xabc8('0x14')](function(_0x41a1de){logger[_0xabc8('0xe')](_0xabc8('0x12'),_0x4f515d,_0x41a1de);_0x5319e4(_0x41a1de);});});} \ No newline at end of file +var _0x10e7=['info','JscriptyAnswerReport,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','result','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','request','then'];(function(_0x55d679,_0x3ab8a3){var _0x1b90cf=function(_0x397184){while(--_0x397184){_0x55d679['push'](_0x55d679['shift']());}};_0x1b90cf(++_0x3ab8a3);}(_0x10e7,0x195));var _0x710e=function(_0x5c351c,_0x2046d8){_0x5c351c=_0x5c351c-0x0;var _0x26f3b3=_0x10e7[_0x5c351c];return _0x26f3b3;};'use strict';var _=require(_0x710e('0x0'));var util=require(_0x710e('0x1'));var moment=require(_0x710e('0x2'));var BPromise=require('bluebird');var rs=require(_0x710e('0x3'));var fs=require('fs');var Redis=require(_0x710e('0x4'));var db=require(_0x710e('0x5'))['db'];var utils=require(_0x710e('0x6'));var logger=require(_0x710e('0x7'))(_0x710e('0x8'));var config=require(_0x710e('0x9'));var jayson=require(_0x710e('0xa'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x52fc11,_0x24201b,_0xf69d86){return new BPromise(function(_0x3394f6,_0x3f31e9){return client[_0x710e('0xb')](_0x52fc11,_0xf69d86)[_0x710e('0xc')](function(_0x55ebfd){logger[_0x710e('0xd')](_0x710e('0xe'),_0x24201b,_0x710e('0xf'));logger[_0x710e('0x10')]('JscriptyAnswerReport,\x20%s,\x20%s,\x20%s',_0x24201b,_0x710e('0xf'),JSON[_0x710e('0x11')](_0x55ebfd));if(_0x55ebfd['error']){if(_0x55ebfd[_0x710e('0x12')][_0x710e('0x13')]===0x1f4){logger[_0x710e('0x12')]('JscriptyAnswerReport,\x20%s,\x20%s',_0x24201b,_0x55ebfd[_0x710e('0x12')][_0x710e('0x14')]);return _0x3f31e9(_0x55ebfd[_0x710e('0x12')]['message']);}logger[_0x710e('0x12')](_0x710e('0xe'),_0x24201b,_0x55ebfd['error']['message']);return _0x3394f6(_0x55ebfd[_0x710e('0x12')][_0x710e('0x14')]);}else{logger[_0x710e('0xd')](_0x710e('0xe'),_0x24201b,'request\x20sent');_0x3394f6(_0x55ebfd[_0x710e('0x15')]['message']);}})['catch'](function(_0x3501ce){logger[_0x710e('0x12')]('JscriptyAnswerReport,\x20%s,\x20%s',_0x24201b,_0x3501ce);_0x3f31e9(_0x3501ce);});});} \ No newline at end of file diff --git a/server/api/jscriptyProject/index.js b/server/api/jscriptyProject/index.js index e2fde4d..21f3b31 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 _0xd49a=['isAuthenticated','getSessions','/:id/answers','getAnswers','/:id/summary','30s','getSummary','post','/:id/clone','put','delete','destroy','multer','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./jscriptyProject.controller','get','index','/:id','/:id/sessions'];(function(_0x13606d,_0x30f265){var _0x1b85b0=function(_0x285c1b){while(--_0x285c1b){_0x13606d['push'](_0x13606d['shift']());}};_0x1b85b0(++_0x30f265);}(_0xd49a,0x7f));var _0xad49=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0xd49a[_0x14add3];return _0x4a174f;};'use strict';var multer=require(_0xad49('0x0'));var util=require('util');var path=require('path');var timeout=require('connect-timeout');var express=require(_0xad49('0x1'));var router=express[_0xad49('0x2')]();var fs_extra=require(_0xad49('0x3'));var auth=require(_0xad49('0x4'));var interaction=require(_0xad49('0x5'));var config=require('../../config/environment');var controller=require(_0xad49('0x6'));router[_0xad49('0x7')]('/',auth['isAuthenticated'](),controller[_0xad49('0x8')]);router[_0xad49('0x7')](_0xad49('0x9'),auth['isAuthenticated'](),controller['show']);router[_0xad49('0x7')](_0xad49('0xa'),auth[_0xad49('0xb')](),controller[_0xad49('0xc')]);router[_0xad49('0x7')](_0xad49('0xd'),auth['isAuthenticated'](),controller[_0xad49('0xe')]);router['get'](_0xad49('0xf'),auth['isAuthenticated'](),timeout(_0xad49('0x10')),controller[_0xad49('0x11')]);router[_0xad49('0x12')]('/',auth[_0xad49('0xb')](),controller['create']);router[_0xad49('0x12')](_0xad49('0x13'),auth[_0xad49('0xb')](),controller['clone']);router[_0xad49('0x14')](_0xad49('0x9'),auth[_0xad49('0xb')](),controller['update']);router[_0xad49('0x15')](_0xad49('0x9'),auth['isAuthenticated'](),controller[_0xad49('0x16')]);module['exports']=router; \ No newline at end of file +var _0x60f4=['/:id','update','delete','destroy','exports','multer','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./jscriptyProject.controller','get','isAuthenticated','show','/:id/sessions','getSessions','/:id/answers','30s','getSummary','create','post','/:id/clone','clone'];(function(_0x3a0c3a,_0xa1143a){var _0x40b9cc=function(_0x2b53a3){while(--_0x2b53a3){_0x3a0c3a['push'](_0x3a0c3a['shift']());}};_0x40b9cc(++_0xa1143a);}(_0x60f4,0x1f3));var _0x460f=function(_0x2791e3,_0x2558ad){_0x2791e3=_0x2791e3-0x0;var _0x486d8e=_0x60f4[_0x2791e3];return _0x486d8e;};'use strict';var multer=require(_0x460f('0x0'));var util=require('util');var path=require(_0x460f('0x1'));var timeout=require(_0x460f('0x2'));var express=require(_0x460f('0x3'));var router=express[_0x460f('0x4')]();var fs_extra=require(_0x460f('0x5'));var auth=require(_0x460f('0x6'));var interaction=require(_0x460f('0x7'));var config=require('../../config/environment');var controller=require(_0x460f('0x8'));router[_0x460f('0x9')]('/',auth['isAuthenticated'](),controller['index']);router[_0x460f('0x9')]('/:id',auth[_0x460f('0xa')](),controller[_0x460f('0xb')]);router['get'](_0x460f('0xc'),auth['isAuthenticated'](),controller[_0x460f('0xd')]);router['get'](_0x460f('0xe'),auth[_0x460f('0xa')](),controller['getAnswers']);router[_0x460f('0x9')]('/:id/summary',auth[_0x460f('0xa')](),timeout(_0x460f('0xf')),controller[_0x460f('0x10')]);router['post']('/',auth[_0x460f('0xa')](),controller[_0x460f('0x11')]);router[_0x460f('0x12')](_0x460f('0x13'),auth['isAuthenticated'](),controller[_0x460f('0x14')]);router['put'](_0x460f('0x15'),auth['isAuthenticated'](),controller[_0x460f('0x16')]);router[_0x460f('0x17')](_0x460f('0x15'),auth[_0x460f('0xa')](),controller[_0x460f('0x18')]);module[_0x460f('0x19')]=router; \ No newline at end of file diff --git a/server/api/jscriptyProject/jscriptyProject.attributes.js b/server/api/jscriptyProject/jscriptyProject.attributes.js index cf7afb0..f52b70e 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 _0x7724=['BOOLEAN','sequelize','lodash','util','STRING','name','long','isObjectLike','setDataValue','stringify','formData','format','{\x22name\x22:\x22%s\x22,\x22description\x22:\x22%s\x22,\x22pages\x22:[]}','getDataValue','description'];(function(_0x3459be,_0x394a71){var _0x525b72=function(_0x5e0810){while(--_0x5e0810){_0x3459be['push'](_0x3459be['shift']());}};_0x525b72(++_0x394a71);}(_0x7724,0x14b));var _0x4772=function(_0x125eb3,_0x4171a9){_0x125eb3=_0x125eb3-0x0;var _0x1b19c5=_0x7724[_0x125eb3];return _0x1b19c5;};'use strict';var Sequelize=require(_0x4772('0x0'));var _=require(_0x4772('0x1'));var util=require(_0x4772('0x2'));module['exports']={'name':{'type':Sequelize[_0x4772('0x3')],'unique':_0x4772('0x4')},'description':{'type':Sequelize['STRING']},'formData':{'type':Sequelize['TEXT'](_0x4772('0x5')),'set':function(_0x3bd932){if(_[_0x4772('0x6')](_0x3bd932)){this[_0x4772('0x7')]('formData',JSON[_0x4772('0x8')](_0x3bd932));}else if(_['isString'](_0x3bd932)){this[_0x4772('0x7')]('formData',_0x3bd932);}else{this[_0x4772('0x7')](_0x4772('0x9'),util[_0x4772('0xa')](_0x4772('0xb'),this[_0x4772('0xc')]('name')||'',this[_0x4772('0xc')](_0x4772('0xd'))||''));}}},'enableUncompleteSave':{'type':Sequelize[_0x4772('0xe')],'defaultValue':!![]},'sendUnpauseOnSubmit':{'type':Sequelize[_0x4772('0xe')],'defaultValue':![]}}; \ No newline at end of file +var _0xaa0d=['format','{\x22name\x22:\x22%s\x22,\x22description\x22:\x22%s\x22,\x22pages\x22:[]}','getDataValue','description','BOOLEAN','lodash','util','STRING','name','TEXT','long','setDataValue','formData','stringify','isString'];(function(_0x5af591,_0x36b3e3){var _0x5ccec2=function(_0x1b024b){while(--_0x1b024b){_0x5af591['push'](_0x5af591['shift']());}};_0x5ccec2(++_0x36b3e3);}(_0xaa0d,0x6e));var _0xdaa0=function(_0x424241,_0x5674b6){_0x424241=_0x424241-0x0;var _0x17d753=_0xaa0d[_0x424241];return _0x17d753;};'use strict';var Sequelize=require('sequelize');var _=require(_0xdaa0('0x0'));var util=require(_0xdaa0('0x1'));module['exports']={'name':{'type':Sequelize[_0xdaa0('0x2')],'unique':_0xdaa0('0x3')},'description':{'type':Sequelize[_0xdaa0('0x2')]},'formData':{'type':Sequelize[_0xdaa0('0x4')](_0xdaa0('0x5')),'set':function(_0x57eb8d){if(_['isObjectLike'](_0x57eb8d)){this[_0xdaa0('0x6')](_0xdaa0('0x7'),JSON[_0xdaa0('0x8')](_0x57eb8d));}else if(_[_0xdaa0('0x9')](_0x57eb8d)){this['setDataValue']('formData',_0x57eb8d);}else{this[_0xdaa0('0x6')](_0xdaa0('0x7'),util[_0xdaa0('0xa')](_0xdaa0('0xb'),this[_0xdaa0('0xc')](_0xdaa0('0x3'))||'',this[_0xdaa0('0xc')](_0xdaa0('0xd'))||''));}}},'enableUncompleteSave':{'type':Sequelize[_0xdaa0('0xe')],'defaultValue':!![]},'sendUnpauseOnSubmit':{'type':Sequelize[_0xdaa0('0xe')],'defaultValue':![]}}; \ No newline at end of file diff --git a/server/api/jscriptyProject/jscriptyProject.controller.js b/server/api/jscriptyProject/jscriptyProject.controller.js index edd35ad..e857875 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 _0xb921=['squel','crypto','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','end','offset','undefined','limit','count','set','Content-Range','json','reject','update','then','destroy','UserProfileResource','error','name','index','map','JscriptyProject','fieldName','type','key','model','keys','query','intersection','fields','attributes','length','hasOwnProperty','nolimit','sort','where','filters','pick','filter','merge','VIRTUAL','options','include','findAll','rows','catch','show','rawAttributes','find','create','body','user','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','Projects','UserProfileSection','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','clone','params','includeAll','omit','updatedAt','createdAt','userProfileId','getSessions','findOne','JscriptySessionReport','order','ProjectId','getAnswers','JscriptyAnswerReport','number','fromCharCode','apply','indexOf','toString','replace','getSummary','startTime','starttime','parse','-createdAt','questionId','question','format','YYYY-MM-DD\x20HH:mm:ss','SessionId','push','isEmpty','writeFileSync','setHeader','Content-disposition','attachment;\x20filename=','Jscripty_Project_%d_Summary_%s.csv','Content-type','text/csv','/tmp/Jscripty_Project_%d_Summary_%s.csv','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash'];(function(_0x355cc4,_0x1e7d69){var _0x4b740c=function(_0x5dda48){while(--_0x5dda48){_0x355cc4['push'](_0x355cc4['shift']());}};_0x4b740c(++_0x1e7d69);}(_0xb921,0x16a));var _0x1b92=function(_0x16c0a7,_0x1aa7ac){_0x16c0a7=_0x16c0a7-0x0;var _0x5e6020=_0xb921[_0x16c0a7];return _0x5e6020;};'use strict';var emlformat=require(_0x1b92('0x0'));var rimraf=require(_0x1b92('0x1'));var zipdir=require(_0x1b92('0x2'));var jsonpatch=require(_0x1b92('0x3'));var rp=require(_0x1b92('0x4'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0x1b92('0x5'));var util=require(_0x1b92('0x6'));var path=require(_0x1b92('0x7'));var sox=require(_0x1b92('0x8'));var csv=require(_0x1b92('0x9'));var ejs=require(_0x1b92('0xa'));var fs=require('fs');var fs_extra=require(_0x1b92('0xb'));var _=require(_0x1b92('0xc'));var squel=require(_0x1b92('0xd'));var crypto=require(_0x1b92('0xe'));var jsforce=require(_0x1b92('0xf'));var deskjs=require(_0x1b92('0x10'));var toCsv=require(_0x1b92('0x9'));var querystring=require(_0x1b92('0x11'));var Papa=require(_0x1b92('0x12'));var Redis=require('ioredis');var authService=require(_0x1b92('0x13'));var qs=require(_0x1b92('0x14'));var as=require(_0x1b92('0x15'));var hardwareService=require(_0x1b92('0x16'));var logger=require(_0x1b92('0x17'))(_0x1b92('0x18'));var utils=require(_0x1b92('0x19'));var config=require('../../config/environment');var licenseUtil=require(_0x1b92('0x1a'));var db=require(_0x1b92('0x1b'))['db'];function respondWithStatusCode(_0x5a1ca5,_0x81cbe0){_0x81cbe0=_0x81cbe0||0xcc;return function(_0x29a7ed){if(_0x29a7ed){return _0x5a1ca5[_0x1b92('0x1c')](_0x81cbe0);}return _0x5a1ca5[_0x1b92('0x1d')](_0x81cbe0)[_0x1b92('0x1e')]();};}function respondWithResult(_0x290be6,_0x1d33bf){_0x1d33bf=_0x1d33bf||0xc8;return function(_0x4bbb76){if(_0x4bbb76){return _0x290be6[_0x1b92('0x1d')](_0x1d33bf)['json'](_0x4bbb76);}};}function respondWithFilteredResult(_0x1a559b,_0x511a97){return function(_0x694d4f){if(_0x694d4f){var _0x523285=typeof _0x511a97[_0x1b92('0x1f')]===_0x1b92('0x20')&&typeof _0x511a97[_0x1b92('0x21')]==='undefined';var _0x2d171f=_0x694d4f[_0x1b92('0x22')];var _0x289523=_0x523285?0x0:_0x511a97[_0x1b92('0x1f')];var _0x4368dc=_0x523285?_0x694d4f['count']:_0x511a97[_0x1b92('0x1f')]+_0x511a97[_0x1b92('0x21')];var _0x30b0d8;if(_0x4368dc>=_0x2d171f){_0x4368dc=_0x2d171f;_0x30b0d8=0xc8;}else{_0x30b0d8=0xce;}_0x1a559b['status'](_0x30b0d8);return _0x1a559b[_0x1b92('0x23')](_0x1b92('0x24'),_0x289523+'-'+_0x4368dc+'/'+_0x2d171f)[_0x1b92('0x25')](_0x694d4f);}return null;};}function patchUpdates(_0x4bfc51){return function(_0x1d9d28){try{jsonpatch['apply'](_0x1d9d28,_0x4bfc51,!![]);}catch(_0x39ef4e){return BPromise[_0x1b92('0x26')](_0x39ef4e);}return _0x1d9d28['save']();};}function saveUpdates(_0x4ea25f,_0x34c5c9){return function(_0x311487){if(_0x311487){return _0x311487[_0x1b92('0x27')](_0x4ea25f)[_0x1b92('0x28')](function(_0x41fc82){return _0x41fc82;});}return null;};}function removeEntity(_0x186030,_0x48cdf1){return function(_0x3be220){if(_0x3be220){return _0x3be220[_0x1b92('0x29')]()[_0x1b92('0x28')](function(){var _0x39dcaa=_0x3be220['get']({'plain':!![]});var _0x3f0e1b='Projects';return db[_0x1b92('0x2a')][_0x1b92('0x29')]({'where':{'type':_0x3f0e1b,'resourceId':_0x39dcaa['id']}})[_0x1b92('0x28')](function(){return _0x3be220;});})[_0x1b92('0x28')](function(){_0x186030[_0x1b92('0x1d')](0xcc)[_0x1b92('0x1e')]();});}};}function handleEntityNotFound(_0xa56a28,_0x44f379){return function(_0x4edbce){if(!_0x4edbce){_0xa56a28['sendStatus'](0x194);}return _0x4edbce;};}function handleError(_0x54d92c,_0x229c44){_0x229c44=_0x229c44||0x1f4;return function(_0x525d05){logger[_0x1b92('0x2b')](_0x525d05['stack']);if(_0x525d05[_0x1b92('0x2c')]){delete _0x525d05[_0x1b92('0x2c')];}_0x54d92c[_0x1b92('0x1d')](_0x229c44)['send'](_0x525d05);};}exports[_0x1b92('0x2d')]=function(_0x6f9678,_0x55eafd){var _0x544105={},_0x477498={},_0x3740e1={'count':0x0,'rows':[]};var _0x165f93=_[_0x1b92('0x2e')](db[_0x1b92('0x2f')]['rawAttributes'],function(_0x1f38f3){return{'name':_0x1f38f3[_0x1b92('0x30')],'type':_0x1f38f3[_0x1b92('0x31')][_0x1b92('0x32')]};});_0x477498[_0x1b92('0x33')]=_[_0x1b92('0x2e')](_0x165f93,_0x1b92('0x2c'));_0x477498['query']=_[_0x1b92('0x34')](_0x6f9678[_0x1b92('0x35')]);_0x477498['filters']=_[_0x1b92('0x36')](_0x477498[_0x1b92('0x33')],_0x477498[_0x1b92('0x35')]);_0x544105['attributes']=_[_0x1b92('0x36')](_0x477498[_0x1b92('0x33')],qs['fields'](_0x6f9678['query'][_0x1b92('0x37')]));_0x544105[_0x1b92('0x38')]=_0x544105[_0x1b92('0x38')][_0x1b92('0x39')]?_0x544105['attributes']:_0x477498['model'];if(!_0x6f9678['query'][_0x1b92('0x3a')](_0x1b92('0x3b'))){_0x544105[_0x1b92('0x21')]=qs[_0x1b92('0x21')](_0x6f9678[_0x1b92('0x35')][_0x1b92('0x21')]);_0x544105[_0x1b92('0x1f')]=qs['offset'](_0x6f9678[_0x1b92('0x35')][_0x1b92('0x1f')]);}_0x544105['order']=qs[_0x1b92('0x3c')](_0x6f9678[_0x1b92('0x35')][_0x1b92('0x3c')]);_0x544105[_0x1b92('0x3d')]=qs[_0x1b92('0x3e')](_[_0x1b92('0x3f')](_0x6f9678[_0x1b92('0x35')],_0x477498[_0x1b92('0x3e')]),_0x165f93);if(_0x6f9678[_0x1b92('0x35')][_0x1b92('0x40')]){_0x544105['where']=_[_0x1b92('0x41')](_0x544105['where'],{'$or':_[_0x1b92('0x2e')](_0x165f93,function(_0x588b3c){if(_0x588b3c[_0x1b92('0x31')]!==_0x1b92('0x42')){var _0x25e709={};_0x25e709[_0x588b3c[_0x1b92('0x2c')]]={'$like':'%'+_0x6f9678[_0x1b92('0x35')][_0x1b92('0x40')]+'%'};return _0x25e709;}})});}_0x544105=_[_0x1b92('0x41')]({},_0x544105,_0x6f9678[_0x1b92('0x43')]);var _0x46b06b={'where':_0x544105['where']};return db[_0x1b92('0x2f')]['count'](_0x46b06b)[_0x1b92('0x28')](function(_0x1e945){_0x3740e1[_0x1b92('0x22')]=_0x1e945;if(_0x6f9678[_0x1b92('0x35')]['includeAll']){_0x544105[_0x1b92('0x44')]=[{'all':!![]}];}return db[_0x1b92('0x2f')][_0x1b92('0x45')](_0x544105);})[_0x1b92('0x28')](function(_0xd3f7b0){_0x3740e1[_0x1b92('0x46')]=_0xd3f7b0;return _0x3740e1;})['then'](respondWithFilteredResult(_0x55eafd,_0x544105))[_0x1b92('0x47')](handleError(_0x55eafd,null));};exports[_0x1b92('0x48')]=function(_0x2dcd14,_0x1cb316){var _0x3f77c3={'raw':![],'where':{'id':_0x2dcd14['params']['id']}},_0x2bb12f={};_0x2bb12f[_0x1b92('0x33')]=_[_0x1b92('0x34')](db['JscriptyProject'][_0x1b92('0x49')]);_0x2bb12f['query']=_[_0x1b92('0x34')](_0x2dcd14[_0x1b92('0x35')]);_0x2bb12f[_0x1b92('0x3e')]=_['intersection'](_0x2bb12f[_0x1b92('0x33')],_0x2bb12f[_0x1b92('0x35')]);_0x3f77c3['attributes']=_['intersection'](_0x2bb12f['model'],qs[_0x1b92('0x37')](_0x2dcd14[_0x1b92('0x35')][_0x1b92('0x37')]));_0x3f77c3[_0x1b92('0x38')]=_0x3f77c3[_0x1b92('0x38')][_0x1b92('0x39')]?_0x3f77c3['attributes']:_0x2bb12f[_0x1b92('0x33')];if(_0x2dcd14[_0x1b92('0x35')]['includeAll']){_0x3f77c3[_0x1b92('0x44')]=[{'all':!![]}];}_0x3f77c3=_[_0x1b92('0x41')]({},_0x3f77c3,_0x2dcd14[_0x1b92('0x43')]);return db['JscriptyProject'][_0x1b92('0x4a')](_0x3f77c3)[_0x1b92('0x28')](handleEntityNotFound(_0x1cb316,null))[_0x1b92('0x28')](respondWithResult(_0x1cb316,null))[_0x1b92('0x47')](handleError(_0x1cb316,null));};exports[_0x1b92('0x4b')]=function(_0x5ac096,_0x142d28){return db[_0x1b92('0x2f')][_0x1b92('0x4b')](_0x5ac096[_0x1b92('0x4c')],{})[_0x1b92('0x28')](function(_0x515292){var _0x5c5ebf=_0x5ac096[_0x1b92('0x4d')][_0x1b92('0x4e')]({'plain':!![]});if(!_0x5c5ebf)throw new Error(_0x1b92('0x4f'));if(_0x5c5ebf[_0x1b92('0x50')]==='user'){var _0x4e0954=_0x515292[_0x1b92('0x4e')]({'plain':!![]});var _0x5e10fa=_0x1b92('0x51');return db[_0x1b92('0x52')][_0x1b92('0x4a')]({'where':{'name':_0x5e10fa,'userProfileId':_0x5c5ebf['userProfileId']},'raw':!![]})[_0x1b92('0x28')](function(_0x559e3c){if(_0x559e3c&&_0x559e3c[_0x1b92('0x53')]===0x0){return db[_0x1b92('0x2a')][_0x1b92('0x4b')]({'name':_0x4e0954[_0x1b92('0x2c')],'resourceId':_0x4e0954['id'],'type':_0x559e3c[_0x1b92('0x2c')],'sectionId':_0x559e3c['id']},{})[_0x1b92('0x28')](function(){return _0x515292;});}else{return _0x515292;}})['catch'](function(_0x140202){logger['error'](_0x1b92('0x54'),_0x140202);throw _0x140202;});}return _0x515292;})[_0x1b92('0x28')](respondWithResult(_0x142d28,0xc9))[_0x1b92('0x47')](handleError(_0x142d28,null));};exports[_0x1b92('0x55')]=function(_0x376a9c,_0x3cab8e){var _0x306395={'where':{'id':_0x376a9c[_0x1b92('0x56')]['id']}},_0x32d994={};_0x32d994[_0x1b92('0x33')]=_[_0x1b92('0x34')](db[_0x1b92('0x2f')][_0x1b92('0x49')]);_0x306395[_0x1b92('0x38')]=_[_0x1b92('0x36')](_0x32d994[_0x1b92('0x33')],qs[_0x1b92('0x37')](_0x376a9c[_0x1b92('0x35')][_0x1b92('0x37')]));_0x306395[_0x1b92('0x38')]=_0x306395['attributes'][_0x1b92('0x39')]?_0x306395[_0x1b92('0x38')]:_0x32d994['model'];if(_0x376a9c[_0x1b92('0x35')][_0x1b92('0x57')]){_0x306395['include']=[{'all':!![]}];}_0x306395=_['merge']({},_0x306395,_0x376a9c[_0x1b92('0x43')]);return db[_0x1b92('0x2f')]['find'](_0x306395)[_0x1b92('0x28')](handleEntityNotFound(_0x3cab8e,null))[_0x1b92('0x28')](function(_0x1519d7){if(_0x1519d7){var _0x33069d=_0x1519d7[_0x1b92('0x4e')]({'plain':!![]});_0x33069d=qs[_0x1b92('0x58')](_0x33069d,['id','createdAt',_0x1b92('0x59')]);_0x376a9c['body']=_['omit'](_0x376a9c[_0x1b92('0x4c')],['id',_0x1b92('0x5a'),_0x1b92('0x59')]);return db[_0x1b92('0x2f')][_0x1b92('0x4b')](_[_0x1b92('0x41')](_0x33069d,_0x376a9c[_0x1b92('0x4c')]),{'include':_0x376a9c[_0x1b92('0x35')][_0x1b92('0x57')]?[{'all':!![]}]:undefined})[_0x1b92('0x28')](function(_0x587956){var _0x3ad925=_0x376a9c[_0x1b92('0x4d')][_0x1b92('0x4e')]({'plain':!![]});if(!_0x3ad925)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x3ad925['role']===_0x1b92('0x4d')){var _0x1b5c91=_0x587956[_0x1b92('0x4e')]({'plain':!![]});var _0x456f8c=_0x1b92('0x51');return db[_0x1b92('0x52')][_0x1b92('0x4a')]({'where':{'name':_0x456f8c,'userProfileId':_0x3ad925[_0x1b92('0x5b')]},'raw':!![]})[_0x1b92('0x28')](function(_0x406dd4){if(_0x406dd4&&_0x406dd4[_0x1b92('0x53')]===0x0){return db[_0x1b92('0x2a')]['create']({'name':_0x1b5c91[_0x1b92('0x2c')],'resourceId':_0x1b5c91['id'],'type':_0x406dd4[_0x1b92('0x2c')],'sectionId':_0x406dd4['id']},{})['then'](function(){return _0x587956;});}else{return _0x587956;}})[_0x1b92('0x47')](function(_0x46d1e9){logger['error'](_0x1b92('0x54'),_0x46d1e9);throw _0x46d1e9;});}return _0x587956;});}})[_0x1b92('0x28')](respondWithResult(_0x3cab8e,0xc9))[_0x1b92('0x47')](handleError(_0x3cab8e,null));};exports[_0x1b92('0x27')]=function(_0x2540d2,_0x590426){if(_0x2540d2['body']['id']){delete _0x2540d2['body']['id'];}return db['JscriptyProject'][_0x1b92('0x4a')]({'where':{'id':_0x2540d2[_0x1b92('0x56')]['id']}})[_0x1b92('0x28')](handleEntityNotFound(_0x590426,null))[_0x1b92('0x28')](saveUpdates(_0x2540d2['body'],null))[_0x1b92('0x28')](respondWithResult(_0x590426,null))[_0x1b92('0x47')](handleError(_0x590426,null));};exports['destroy']=function(_0x31977e,_0x51a2a1){return db['JscriptyProject'][_0x1b92('0x4a')]({'where':{'id':_0x31977e['params']['id']}})[_0x1b92('0x28')](handleEntityNotFound(_0x51a2a1,null))[_0x1b92('0x28')](removeEntity(_0x51a2a1,null))[_0x1b92('0x47')](handleError(_0x51a2a1,null));};exports[_0x1b92('0x5c')]=function(_0x197a4b,_0xd092bb,_0x5b408e){var _0x1e5951={'raw':!![],'where':{}};var _0x1bab85={};var _0xc0a853={'count':0x0,'rows':[]};return db[_0x1b92('0x2f')][_0x1b92('0x5d')]({'where':{'id':_0x197a4b['params']['id']}})['then'](handleEntityNotFound(_0xd092bb,null))[_0x1b92('0x28')](function(_0x22e1b2){if(_0x22e1b2){_0x1bab85[_0x1b92('0x33')]=_[_0x1b92('0x34')](db[_0x1b92('0x5e')][_0x1b92('0x49')]);_0x1bab85[_0x1b92('0x35')]=_[_0x1b92('0x34')](_0x197a4b[_0x1b92('0x35')]);_0x1bab85['filters']=_[_0x1b92('0x36')](_0x1bab85[_0x1b92('0x33')],_0x1bab85[_0x1b92('0x35')]);_0x1e5951[_0x1b92('0x38')]=_[_0x1b92('0x36')](_0x1bab85[_0x1b92('0x33')],qs[_0x1b92('0x37')](_0x197a4b['query'][_0x1b92('0x37')]));_0x1e5951['attributes']=_0x1e5951['attributes'][_0x1b92('0x39')]?_0x1e5951[_0x1b92('0x38')]:_0x1bab85[_0x1b92('0x33')];if(!_0x197a4b[_0x1b92('0x35')]['hasOwnProperty']('nolimit')){_0x1e5951[_0x1b92('0x21')]=qs[_0x1b92('0x21')](_0x197a4b['query'][_0x1b92('0x21')]);_0x1e5951[_0x1b92('0x1f')]=qs[_0x1b92('0x1f')](_0x197a4b[_0x1b92('0x35')][_0x1b92('0x1f')]);}_0x1e5951[_0x1b92('0x5f')]=qs['sort'](_0x197a4b[_0x1b92('0x35')][_0x1b92('0x3c')]);_0x1e5951[_0x1b92('0x3d')]=qs[_0x1b92('0x3e')](_[_0x1b92('0x3f')](_0x197a4b['query'],_0x1bab85[_0x1b92('0x3e')]));_0x1e5951[_0x1b92('0x3d')][_0x1b92('0x60')]=_0x22e1b2['id'];if(_0x197a4b[_0x1b92('0x35')]['filter']){_0x1e5951[_0x1b92('0x3d')]=_[_0x1b92('0x41')](_0x1e5951['where'],{'$or':_[_0x1b92('0x2e')](_0x1e5951[_0x1b92('0x38')],function(_0x23958a){var _0x2fb82b={};_0x2fb82b[_0x23958a]={'$like':'%'+_0x197a4b[_0x1b92('0x35')][_0x1b92('0x40')]+'%'};return _0x2fb82b;})});}_0x1e5951=_['merge']({},_0x1e5951,_0x197a4b[_0x1b92('0x43')]);return db[_0x1b92('0x5e')][_0x1b92('0x22')]({'where':_0x1e5951[_0x1b92('0x3d')]})[_0x1b92('0x28')](function(_0x2fa5d9){_0xc0a853[_0x1b92('0x22')]=_0x2fa5d9;if(_0x197a4b['query'][_0x1b92('0x57')]){_0x1e5951[_0x1b92('0x44')]=[{'all':!![]}];}return db[_0x1b92('0x5e')]['findAll'](_0x1e5951);})[_0x1b92('0x28')](function(_0x17bde5){_0xc0a853[_0x1b92('0x46')]=_0x17bde5;return _0xc0a853;});}})[_0x1b92('0x28')](respondWithFilteredResult(_0xd092bb,_0x1e5951))[_0x1b92('0x47')](handleError(_0xd092bb,null));};exports[_0x1b92('0x61')]=function(_0x685d82,_0x452284,_0x5c6586){var _0x334e3a={'raw':!![],'where':{}};var _0x558978={};var _0x22b84e={'count':0x0,'rows':[]};return db[_0x1b92('0x2f')][_0x1b92('0x5d')]({'where':{'id':_0x685d82[_0x1b92('0x56')]['id']}})[_0x1b92('0x28')](handleEntityNotFound(_0x452284,null))['then'](function(_0x1b74f3){if(_0x1b74f3){_0x558978[_0x1b92('0x33')]=_[_0x1b92('0x34')](db[_0x1b92('0x62')][_0x1b92('0x49')]);_0x558978[_0x1b92('0x35')]=_[_0x1b92('0x34')](_0x685d82[_0x1b92('0x35')]);_0x558978[_0x1b92('0x3e')]=_[_0x1b92('0x36')](_0x558978['model'],_0x558978[_0x1b92('0x35')]);_0x334e3a[_0x1b92('0x38')]=_[_0x1b92('0x36')](_0x558978['model'],qs[_0x1b92('0x37')](_0x685d82[_0x1b92('0x35')]['fields']));_0x334e3a[_0x1b92('0x38')]=_0x334e3a['attributes'][_0x1b92('0x39')]?_0x334e3a['attributes']:_0x558978['model'];if(!_0x685d82['query'][_0x1b92('0x3a')](_0x1b92('0x3b'))){_0x334e3a[_0x1b92('0x21')]=qs[_0x1b92('0x21')](_0x685d82[_0x1b92('0x35')]['limit']);_0x334e3a[_0x1b92('0x1f')]=qs[_0x1b92('0x1f')](_0x685d82[_0x1b92('0x35')][_0x1b92('0x1f')]);}_0x334e3a[_0x1b92('0x5f')]=qs['sort'](_0x685d82[_0x1b92('0x35')][_0x1b92('0x3c')]);_0x334e3a[_0x1b92('0x3d')]=qs[_0x1b92('0x3e')](_[_0x1b92('0x3f')](_0x685d82[_0x1b92('0x35')],_0x558978[_0x1b92('0x3e')]));_0x334e3a[_0x1b92('0x3d')]['ProjectId']=_0x1b74f3['id'];if(_0x685d82[_0x1b92('0x35')]['filter']){_0x334e3a[_0x1b92('0x3d')]=_['merge'](_0x334e3a[_0x1b92('0x3d')],{'$or':_[_0x1b92('0x2e')](_0x334e3a['attributes'],function(_0xb08603){var _0x21466a={};_0x21466a[_0xb08603]={'$like':'%'+_0x685d82[_0x1b92('0x35')][_0x1b92('0x40')]+'%'};return _0x21466a;})});}_0x334e3a=_[_0x1b92('0x41')]({},_0x334e3a,_0x685d82[_0x1b92('0x43')]);return db[_0x1b92('0x62')][_0x1b92('0x22')]({'where':_0x334e3a[_0x1b92('0x3d')]})['then'](function(_0x159bc8){_0x22b84e[_0x1b92('0x22')]=_0x159bc8;if(_0x685d82[_0x1b92('0x35')]['includeAll']){_0x334e3a['include']=[{'all':!![]}];}return db['JscriptyAnswerReport']['findAll'](_0x334e3a);})[_0x1b92('0x28')](function(_0x22ea06){_0x22b84e[_0x1b92('0x46')]=_0x22ea06;return _0x22b84e;});}})['then'](respondWithFilteredResult(_0x452284,_0x334e3a))[_0x1b92('0x47')](handleError(_0x452284,null));};function char(_0x121aac){return _0x1b92('0x63')===typeof _0x121aac?String[_0x1b92('0x64')][_0x1b92('0x65')](null,arguments):_0x121aac;}function needsEncapsulation(_0x341b0d){return!!_0x341b0d&&(_0x341b0d['toString']()[_0x1b92('0x66')](char(0xd))>=0x0||_0x341b0d[_0x1b92('0x67')]()[_0x1b92('0x66')](char(0xa))>=0x0||_0x341b0d['toString']()[_0x1b92('0x66')](char(0x2c))>=0x0||_0x341b0d[_0x1b92('0x67')]()[_0x1b92('0x66')](char(0x22))>=0x0);}function encapsulate(_0x41b264){var _0x550cb4=char(0x22),_0x4d8dd1='\x5c'+char(0x22),_0x9fd44d=_0x41b264[_0x1b92('0x67')]()[_0x1b92('0x68')](new RegExp(_0x550cb4,'g'),_0x4d8dd1);return _0x550cb4+_0x9fd44d+_0x550cb4;}exports[_0x1b92('0x69')]=function(_0x2624ef,_0x5befe5,_0x43f256){var _0xf2629a,_0x40b0a3;var _0x186d97={'where':{'ProjectId':_0x2624ef[_0x1b92('0x56')]['id']}};if(_0x2624ef[_0x1b92('0x35')][_0x1b92('0x6a')]){_0x186d97[_0x1b92('0x3d')][_0x1b92('0x6b')]=JSON[_0x1b92('0x6c')](_0x2624ef[_0x1b92('0x35')][_0x1b92('0x6a')]);}return db[_0x1b92('0x5e')][_0x1b92('0x45')](_0x186d97)['then'](handleEntityNotFound(_0x5befe5,null))[_0x1b92('0x28')](function(_0x3ab527){if(_0x3ab527){_0xf2629a=_0x3ab527;return db['JscriptyQuestionReport']['findAll']({'where':{'SessionId':{'$in':_['map'](_0xf2629a,'id')},'ProjectId':_0x2624ef[_0x1b92('0x56')]['id']},'order':_0x1b92('0x6d')});}})['then'](handleEntityNotFound(_0x5befe5,null))[_0x1b92('0x28')](function(_0x37c820){if(_0x37c820){_0x40b0a3=_0x37c820;var _0x319aca={};for(var _0x51133b=0x0,_0xdfaaff=_0x40b0a3[_0x1b92('0x39')];_0x51133b<_0xdfaaff;_0x51133b++){if(!_0x319aca[_0x1b92('0x3a')](_0x40b0a3[_0x51133b][_0x1b92('0x6e')])){_0x319aca[_0x40b0a3[_0x51133b][_0x1b92('0x6e')]]=needsEncapsulation(_0x40b0a3[_0x51133b][_0x1b92('0x6f')])?encapsulate(_0x40b0a3[_0x51133b]['question']):_0x40b0a3[_0x51133b][_0x1b92('0x6f')];}}var _0x172083=[],_0x1d7232={};for(var _0x51cd82=0x0,_0x418a0c=_0xf2629a[_0x1b92('0x39')];_0x51cd82<_0x418a0c;_0x51cd82++){_0x1d7232={'ProjectId':_0x2624ef['params']['id'],'SessionId':_0xf2629a[_0x51cd82]['id'],'StartTime':moment(_0xf2629a[_0x51cd82][_0x1b92('0x6b')])[_0x1b92('0x70')](_0x1b92('0x71'))};for(var _0x2b3fa0=0x0,_0x7e13b0=_0x40b0a3[_0x1b92('0x39')];_0x2b3fa0<_0x7e13b0;_0x2b3fa0++){if(_0x40b0a3[_0x2b3fa0][_0x1b92('0x72')]==_0xf2629a[_0x51cd82]['id']&&_0x319aca[_0x1b92('0x3a')](_0x40b0a3[_0x2b3fa0]['questionId'])){_0x1d7232[_0x319aca[_0x40b0a3[_0x2b3fa0][_0x1b92('0x6e')]]]=_0x40b0a3[_0x2b3fa0]['answer'];}}for(var _0x34ad43 in _0x319aca){if(!_0x1d7232['hasOwnProperty'](_0x319aca[_0x34ad43])){_0x1d7232[_0x319aca[_0x34ad43]]=null;}}_0x172083[_0x1b92('0x73')](_0x1d7232);}return _0x172083;}})[_0x1b92('0x28')](function(_0x1bbdb1){if(!_[_0x1b92('0x74')](_0x1bbdb1)){var _0x1b4733=toCsv(_0x1bbdb1);var _0x3573fb=Date['now']();fs[_0x1b92('0x75')](util[_0x1b92('0x70')]('/tmp/Jscripty_Project_%d_Summary_%s.csv',_0x2624ef[_0x1b92('0x56')]['id'],_0x3573fb),_0x1b4733);_0x5befe5[_0x1b92('0x76')](_0x1b92('0x77'),_0x1b92('0x78')+util['format'](_0x1b92('0x79'),_0x2624ef[_0x1b92('0x56')]['id'],_0x3573fb));_0x5befe5[_0x1b92('0x76')](_0x1b92('0x7a'),_0x1b92('0x7b'));return _0x5befe5['download'](util[_0x1b92('0x70')](_0x1b92('0x7c'),_0x2624ef['params']['id'],_0x3573fb));}else{return _0x5befe5[_0x1b92('0x1c')](0xcc);}})['catch'](handleError(_0x5befe5,null));}; \ No newline at end of file +var _0x5987=['name','index','JscriptyProject','fieldName','type','map','query','keys','filters','model','attributes','intersection','fields','length','hasOwnProperty','nolimit','offset','sort','where','filter','merge','includeAll','include','findAll','rows','show','rawAttributes','options','find','catch','create','user','UserProfileSection','autoAssociation','params','omit','createdAt','body','updatedAt','role','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','findOne','JscriptySessionReport','pick','JscriptyAnswerReport','order','ProjectId','fromCharCode','indexOf','toString','replace','getSummary','startTime','starttime','JscriptyQuestionReport','-createdAt','questionId','question','format','YYYY-MM-DD\x20HH:mm:ss','SessionId','answer','push','isEmpty','now','writeFileSync','Content-disposition','attachment;\x20filename=','setHeader','Content-type','download','/tmp/Jscripty_Project_%d_Summary_%s.csv','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','path','sox','to-csv','fs-extra','squel','crypto','jsforce','desk.js','querystring','papaparse','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','undefined','limit','count','Content-Range','json','apply','reject','save','then','destroy','get','UserProfileResource','error','stack'];(function(_0x1fb0f8,_0x229a00){var _0x538679=function(_0x3456a4){while(--_0x3456a4){_0x1fb0f8['push'](_0x1fb0f8['shift']());}};_0x538679(++_0x229a00);}(_0x5987,0x128));var _0x7598=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0x5987[_0x14add3];return _0x4a174f;};'use strict';var emlformat=require(_0x7598('0x0'));var rimraf=require(_0x7598('0x1'));var zipdir=require(_0x7598('0x2'));var jsonpatch=require(_0x7598('0x3'));var rp=require('request-promise');var moment=require(_0x7598('0x4'));var BPromise=require(_0x7598('0x5'));var Mustache=require(_0x7598('0x6'));var util=require(_0x7598('0x7'));var path=require(_0x7598('0x8'));var sox=require(_0x7598('0x9'));var csv=require(_0x7598('0xa'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x7598('0xb'));var _=require('lodash');var squel=require(_0x7598('0xc'));var crypto=require(_0x7598('0xd'));var jsforce=require(_0x7598('0xe'));var deskjs=require(_0x7598('0xf'));var toCsv=require(_0x7598('0xa'));var querystring=require(_0x7598('0x10'));var Papa=require(_0x7598('0x11'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0x7598('0x12'));var hardwareService=require(_0x7598('0x13'));var logger=require(_0x7598('0x14'))('api');var utils=require('../../config/utils');var config=require(_0x7598('0x15'));var licenseUtil=require(_0x7598('0x16'));var db=require(_0x7598('0x17'))['db'];function respondWithStatusCode(_0x1a92e9,_0x22cc20){_0x22cc20=_0x22cc20||0xcc;return function(_0x52bc43){if(_0x52bc43){return _0x1a92e9[_0x7598('0x18')](_0x22cc20);}return _0x1a92e9['status'](_0x22cc20)['end']();};}function respondWithResult(_0x3773cd,_0x16527e){_0x16527e=_0x16527e||0xc8;return function(_0x1608b8){if(_0x1608b8){return _0x3773cd[_0x7598('0x19')](_0x16527e)['json'](_0x1608b8);}};}function respondWithFilteredResult(_0x388b3f,_0x3d80be){return function(_0x353d18){if(_0x353d18){var _0x3282de=typeof _0x3d80be['offset']===_0x7598('0x1a')&&typeof _0x3d80be[_0x7598('0x1b')]===_0x7598('0x1a');var _0x1360bb=_0x353d18[_0x7598('0x1c')];var _0x2a62ed=_0x3282de?0x0:_0x3d80be['offset'];var _0x817355=_0x3282de?_0x353d18[_0x7598('0x1c')]:_0x3d80be['offset']+_0x3d80be[_0x7598('0x1b')];var _0x2bc78d;if(_0x817355>=_0x1360bb){_0x817355=_0x1360bb;_0x2bc78d=0xc8;}else{_0x2bc78d=0xce;}_0x388b3f['status'](_0x2bc78d);return _0x388b3f['set'](_0x7598('0x1d'),_0x2a62ed+'-'+_0x817355+'/'+_0x1360bb)[_0x7598('0x1e')](_0x353d18);}return null;};}function patchUpdates(_0x1ae307){return function(_0x42286f){try{jsonpatch[_0x7598('0x1f')](_0x42286f,_0x1ae307,!![]);}catch(_0x5902a9){return BPromise[_0x7598('0x20')](_0x5902a9);}return _0x42286f[_0x7598('0x21')]();};}function saveUpdates(_0x1d6e1b,_0x87e713){return function(_0xb76cfc){if(_0xb76cfc){return _0xb76cfc['update'](_0x1d6e1b)[_0x7598('0x22')](function(_0x3d7ff0){return _0x3d7ff0;});}return null;};}function removeEntity(_0x3ec8b1,_0x453901){return function(_0x384d1d){if(_0x384d1d){return _0x384d1d[_0x7598('0x23')]()['then'](function(){var _0x4bfac0=_0x384d1d[_0x7598('0x24')]({'plain':!![]});var _0x5b4d1c='Projects';return db[_0x7598('0x25')][_0x7598('0x23')]({'where':{'type':_0x5b4d1c,'resourceId':_0x4bfac0['id']}})[_0x7598('0x22')](function(){return _0x384d1d;});})['then'](function(){_0x3ec8b1['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x9402c7,_0x136d49){return function(_0x2c914c){if(!_0x2c914c){_0x9402c7[_0x7598('0x18')](0x194);}return _0x2c914c;};}function handleError(_0x14ab59,_0x36733a){_0x36733a=_0x36733a||0x1f4;return function(_0x2d36fc){logger[_0x7598('0x26')](_0x2d36fc[_0x7598('0x27')]);if(_0x2d36fc[_0x7598('0x28')]){delete _0x2d36fc['name'];}_0x14ab59['status'](_0x36733a)['send'](_0x2d36fc);};}exports[_0x7598('0x29')]=function(_0x15107d,_0x386ae4){var _0x1654f7={},_0x519e9b={},_0x1d9661={'count':0x0,'rows':[]};var _0x3bd86b=_['map'](db[_0x7598('0x2a')]['rawAttributes'],function(_0x23e126){return{'name':_0x23e126[_0x7598('0x2b')],'type':_0x23e126[_0x7598('0x2c')]['key']};});_0x519e9b['model']=_[_0x7598('0x2d')](_0x3bd86b,'name');_0x519e9b[_0x7598('0x2e')]=_[_0x7598('0x2f')](_0x15107d[_0x7598('0x2e')]);_0x519e9b[_0x7598('0x30')]=_['intersection'](_0x519e9b[_0x7598('0x31')],_0x519e9b[_0x7598('0x2e')]);_0x1654f7[_0x7598('0x32')]=_[_0x7598('0x33')](_0x519e9b[_0x7598('0x31')],qs[_0x7598('0x34')](_0x15107d[_0x7598('0x2e')][_0x7598('0x34')]));_0x1654f7[_0x7598('0x32')]=_0x1654f7['attributes'][_0x7598('0x35')]?_0x1654f7['attributes']:_0x519e9b[_0x7598('0x31')];if(!_0x15107d[_0x7598('0x2e')][_0x7598('0x36')](_0x7598('0x37'))){_0x1654f7[_0x7598('0x1b')]=qs[_0x7598('0x1b')](_0x15107d[_0x7598('0x2e')][_0x7598('0x1b')]);_0x1654f7['offset']=qs['offset'](_0x15107d[_0x7598('0x2e')][_0x7598('0x38')]);}_0x1654f7['order']=qs['sort'](_0x15107d['query'][_0x7598('0x39')]);_0x1654f7[_0x7598('0x3a')]=qs['filters'](_['pick'](_0x15107d[_0x7598('0x2e')],_0x519e9b[_0x7598('0x30')]),_0x3bd86b);if(_0x15107d[_0x7598('0x2e')][_0x7598('0x3b')]){_0x1654f7[_0x7598('0x3a')]=_[_0x7598('0x3c')](_0x1654f7[_0x7598('0x3a')],{'$or':_['map'](_0x3bd86b,function(_0x118bb2){if(_0x118bb2['type']!=='VIRTUAL'){var _0x6308fe={};_0x6308fe[_0x118bb2[_0x7598('0x28')]]={'$like':'%'+_0x15107d[_0x7598('0x2e')]['filter']+'%'};return _0x6308fe;}})});}_0x1654f7=_[_0x7598('0x3c')]({},_0x1654f7,_0x15107d['options']);var _0x42c5a6={'where':_0x1654f7[_0x7598('0x3a')]};return db['JscriptyProject'][_0x7598('0x1c')](_0x42c5a6)[_0x7598('0x22')](function(_0x1ca78c){_0x1d9661['count']=_0x1ca78c;if(_0x15107d[_0x7598('0x2e')][_0x7598('0x3d')]){_0x1654f7[_0x7598('0x3e')]=[{'all':!![]}];}return db[_0x7598('0x2a')][_0x7598('0x3f')](_0x1654f7);})[_0x7598('0x22')](function(_0x102b91){_0x1d9661[_0x7598('0x40')]=_0x102b91;return _0x1d9661;})[_0x7598('0x22')](respondWithFilteredResult(_0x386ae4,_0x1654f7))['catch'](handleError(_0x386ae4,null));};exports[_0x7598('0x41')]=function(_0x553689,_0x14d6d1){var _0x456a24={'raw':![],'where':{'id':_0x553689['params']['id']}},_0x292dca={};_0x292dca[_0x7598('0x31')]=_['keys'](db[_0x7598('0x2a')][_0x7598('0x42')]);_0x292dca[_0x7598('0x2e')]=_[_0x7598('0x2f')](_0x553689[_0x7598('0x2e')]);_0x292dca['filters']=_['intersection'](_0x292dca[_0x7598('0x31')],_0x292dca[_0x7598('0x2e')]);_0x456a24[_0x7598('0x32')]=_[_0x7598('0x33')](_0x292dca['model'],qs[_0x7598('0x34')](_0x553689['query']['fields']));_0x456a24[_0x7598('0x32')]=_0x456a24[_0x7598('0x32')][_0x7598('0x35')]?_0x456a24[_0x7598('0x32')]:_0x292dca['model'];if(_0x553689[_0x7598('0x2e')][_0x7598('0x3d')]){_0x456a24[_0x7598('0x3e')]=[{'all':!![]}];}_0x456a24=_[_0x7598('0x3c')]({},_0x456a24,_0x553689[_0x7598('0x43')]);return db[_0x7598('0x2a')][_0x7598('0x44')](_0x456a24)[_0x7598('0x22')](handleEntityNotFound(_0x14d6d1,null))[_0x7598('0x22')](respondWithResult(_0x14d6d1,null))[_0x7598('0x45')](handleError(_0x14d6d1,null));};exports[_0x7598('0x46')]=function(_0x2efa18,_0x12c6a6){return db['JscriptyProject']['create'](_0x2efa18['body'],{})[_0x7598('0x22')](function(_0x1fae29){var _0x13da32=_0x2efa18[_0x7598('0x47')][_0x7598('0x24')]({'plain':!![]});if(!_0x13da32)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x13da32['role']===_0x7598('0x47')){var _0x33a6a5=_0x1fae29['get']({'plain':!![]});var _0x47cb9d='Projects';return db[_0x7598('0x48')]['find']({'where':{'name':_0x47cb9d,'userProfileId':_0x13da32['userProfileId']},'raw':!![]})[_0x7598('0x22')](function(_0x2a5532){if(_0x2a5532&&_0x2a5532[_0x7598('0x49')]===0x0){return db['UserProfileResource']['create']({'name':_0x33a6a5[_0x7598('0x28')],'resourceId':_0x33a6a5['id'],'type':_0x2a5532[_0x7598('0x28')],'sectionId':_0x2a5532['id']},{})[_0x7598('0x22')](function(){return _0x1fae29;});}else{return _0x1fae29;}})['catch'](function(_0x1ce912){logger[_0x7598('0x26')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x1ce912);throw _0x1ce912;});}return _0x1fae29;})[_0x7598('0x22')](respondWithResult(_0x12c6a6,0xc9))[_0x7598('0x45')](handleError(_0x12c6a6,null));};exports['clone']=function(_0x570d3d,_0x357921){var _0x42486a={'where':{'id':_0x570d3d[_0x7598('0x4a')]['id']}},_0x3891fb={};_0x3891fb['model']=_[_0x7598('0x2f')](db[_0x7598('0x2a')][_0x7598('0x42')]);_0x42486a[_0x7598('0x32')]=_[_0x7598('0x33')](_0x3891fb[_0x7598('0x31')],qs[_0x7598('0x34')](_0x570d3d[_0x7598('0x2e')]['fields']));_0x42486a[_0x7598('0x32')]=_0x42486a['attributes'][_0x7598('0x35')]?_0x42486a[_0x7598('0x32')]:_0x3891fb[_0x7598('0x31')];if(_0x570d3d[_0x7598('0x2e')]['includeAll']){_0x42486a[_0x7598('0x3e')]=[{'all':!![]}];}_0x42486a=_['merge']({},_0x42486a,_0x570d3d['options']);return db[_0x7598('0x2a')][_0x7598('0x44')](_0x42486a)[_0x7598('0x22')](handleEntityNotFound(_0x357921,null))[_0x7598('0x22')](function(_0xfe8ab9){if(_0xfe8ab9){var _0x3f29fc=_0xfe8ab9[_0x7598('0x24')]({'plain':!![]});_0x3f29fc=qs[_0x7598('0x4b')](_0x3f29fc,['id',_0x7598('0x4c'),'updatedAt']);_0x570d3d['body']=_[_0x7598('0x4b')](_0x570d3d[_0x7598('0x4d')],['id',_0x7598('0x4c'),_0x7598('0x4e')]);return db['JscriptyProject'][_0x7598('0x46')](_[_0x7598('0x3c')](_0x3f29fc,_0x570d3d[_0x7598('0x4d')]),{'include':_0x570d3d[_0x7598('0x2e')]['includeAll']?[{'all':!![]}]:undefined})[_0x7598('0x22')](function(_0x2ee0b9){var _0x5e732a=_0x570d3d['user'][_0x7598('0x24')]({'plain':!![]});if(!_0x5e732a)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x5e732a[_0x7598('0x4f')]===_0x7598('0x47')){var _0x4d5e05=_0x2ee0b9['get']({'plain':!![]});var _0x4d130c='Projects';return db[_0x7598('0x48')][_0x7598('0x44')]({'where':{'name':_0x4d130c,'userProfileId':_0x5e732a['userProfileId']},'raw':!![]})['then'](function(_0xc03282){if(_0xc03282&&_0xc03282[_0x7598('0x49')]===0x0){return db[_0x7598('0x25')]['create']({'name':_0x4d5e05[_0x7598('0x28')],'resourceId':_0x4d5e05['id'],'type':_0xc03282[_0x7598('0x28')],'sectionId':_0xc03282['id']},{})['then'](function(){return _0x2ee0b9;});}else{return _0x2ee0b9;}})[_0x7598('0x45')](function(_0x3a26a7){logger[_0x7598('0x26')](_0x7598('0x50'),_0x3a26a7);throw _0x3a26a7;});}return _0x2ee0b9;});}})[_0x7598('0x22')](respondWithResult(_0x357921,0xc9))[_0x7598('0x45')](handleError(_0x357921,null));};exports['update']=function(_0x5d1ffa,_0x41e2fb){if(_0x5d1ffa[_0x7598('0x4d')]['id']){delete _0x5d1ffa[_0x7598('0x4d')]['id'];}return db['JscriptyProject'][_0x7598('0x44')]({'where':{'id':_0x5d1ffa[_0x7598('0x4a')]['id']}})['then'](handleEntityNotFound(_0x41e2fb,null))[_0x7598('0x22')](saveUpdates(_0x5d1ffa[_0x7598('0x4d')],null))[_0x7598('0x22')](respondWithResult(_0x41e2fb,null))[_0x7598('0x45')](handleError(_0x41e2fb,null));};exports['destroy']=function(_0x14467e,_0x46617b){return db[_0x7598('0x2a')][_0x7598('0x44')]({'where':{'id':_0x14467e[_0x7598('0x4a')]['id']}})['then'](handleEntityNotFound(_0x46617b,null))[_0x7598('0x22')](removeEntity(_0x46617b,null))['catch'](handleError(_0x46617b,null));};exports['getSessions']=function(_0x32ed35,_0x182a26,_0x28d96b){var _0x2b729a={'raw':!![],'where':{}};var _0x57c598={};var _0x132f3b={'count':0x0,'rows':[]};return db[_0x7598('0x2a')][_0x7598('0x51')]({'where':{'id':_0x32ed35[_0x7598('0x4a')]['id']}})[_0x7598('0x22')](handleEntityNotFound(_0x182a26,null))[_0x7598('0x22')](function(_0x5d3f49){if(_0x5d3f49){_0x57c598['model']=_[_0x7598('0x2f')](db[_0x7598('0x52')][_0x7598('0x42')]);_0x57c598['query']=_[_0x7598('0x2f')](_0x32ed35['query']);_0x57c598[_0x7598('0x30')]=_[_0x7598('0x33')](_0x57c598[_0x7598('0x31')],_0x57c598[_0x7598('0x2e')]);_0x2b729a[_0x7598('0x32')]=_[_0x7598('0x33')](_0x57c598[_0x7598('0x31')],qs[_0x7598('0x34')](_0x32ed35['query'][_0x7598('0x34')]));_0x2b729a[_0x7598('0x32')]=_0x2b729a[_0x7598('0x32')][_0x7598('0x35')]?_0x2b729a[_0x7598('0x32')]:_0x57c598[_0x7598('0x31')];if(!_0x32ed35[_0x7598('0x2e')][_0x7598('0x36')]('nolimit')){_0x2b729a[_0x7598('0x1b')]=qs['limit'](_0x32ed35[_0x7598('0x2e')][_0x7598('0x1b')]);_0x2b729a['offset']=qs[_0x7598('0x38')](_0x32ed35[_0x7598('0x2e')]['offset']);}_0x2b729a['order']=qs[_0x7598('0x39')](_0x32ed35['query']['sort']);_0x2b729a[_0x7598('0x3a')]=qs['filters'](_[_0x7598('0x53')](_0x32ed35[_0x7598('0x2e')],_0x57c598[_0x7598('0x30')]));_0x2b729a['where']['ProjectId']=_0x5d3f49['id'];if(_0x32ed35[_0x7598('0x2e')][_0x7598('0x3b')]){_0x2b729a[_0x7598('0x3a')]=_['merge'](_0x2b729a['where'],{'$or':_['map'](_0x2b729a['attributes'],function(_0xf05e17){var _0x1d7413={};_0x1d7413[_0xf05e17]={'$like':'%'+_0x32ed35[_0x7598('0x2e')][_0x7598('0x3b')]+'%'};return _0x1d7413;})});}_0x2b729a=_['merge']({},_0x2b729a,_0x32ed35[_0x7598('0x43')]);return db[_0x7598('0x52')]['count']({'where':_0x2b729a[_0x7598('0x3a')]})[_0x7598('0x22')](function(_0x4191dd){_0x132f3b['count']=_0x4191dd;if(_0x32ed35[_0x7598('0x2e')]['includeAll']){_0x2b729a[_0x7598('0x3e')]=[{'all':!![]}];}return db[_0x7598('0x52')]['findAll'](_0x2b729a);})['then'](function(_0x12c235){_0x132f3b[_0x7598('0x40')]=_0x12c235;return _0x132f3b;});}})['then'](respondWithFilteredResult(_0x182a26,_0x2b729a))[_0x7598('0x45')](handleError(_0x182a26,null));};exports['getAnswers']=function(_0x5abcf3,_0x25e149,_0x3b286f){var _0x868882={'raw':!![],'where':{}};var _0x165391={};var _0x8af083={'count':0x0,'rows':[]};return db[_0x7598('0x2a')][_0x7598('0x51')]({'where':{'id':_0x5abcf3[_0x7598('0x4a')]['id']}})[_0x7598('0x22')](handleEntityNotFound(_0x25e149,null))[_0x7598('0x22')](function(_0x99d323){if(_0x99d323){_0x165391['model']=_[_0x7598('0x2f')](db[_0x7598('0x54')][_0x7598('0x42')]);_0x165391['query']=_[_0x7598('0x2f')](_0x5abcf3[_0x7598('0x2e')]);_0x165391['filters']=_[_0x7598('0x33')](_0x165391[_0x7598('0x31')],_0x165391[_0x7598('0x2e')]);_0x868882[_0x7598('0x32')]=_[_0x7598('0x33')](_0x165391[_0x7598('0x31')],qs['fields'](_0x5abcf3[_0x7598('0x2e')][_0x7598('0x34')]));_0x868882[_0x7598('0x32')]=_0x868882['attributes'][_0x7598('0x35')]?_0x868882[_0x7598('0x32')]:_0x165391['model'];if(!_0x5abcf3[_0x7598('0x2e')][_0x7598('0x36')](_0x7598('0x37'))){_0x868882['limit']=qs[_0x7598('0x1b')](_0x5abcf3[_0x7598('0x2e')]['limit']);_0x868882[_0x7598('0x38')]=qs[_0x7598('0x38')](_0x5abcf3[_0x7598('0x2e')][_0x7598('0x38')]);}_0x868882[_0x7598('0x55')]=qs[_0x7598('0x39')](_0x5abcf3['query'][_0x7598('0x39')]);_0x868882['where']=qs[_0x7598('0x30')](_[_0x7598('0x53')](_0x5abcf3['query'],_0x165391['filters']));_0x868882[_0x7598('0x3a')][_0x7598('0x56')]=_0x99d323['id'];if(_0x5abcf3[_0x7598('0x2e')][_0x7598('0x3b')]){_0x868882[_0x7598('0x3a')]=_[_0x7598('0x3c')](_0x868882[_0x7598('0x3a')],{'$or':_[_0x7598('0x2d')](_0x868882['attributes'],function(_0x5b00d3){var _0x50cc05={};_0x50cc05[_0x5b00d3]={'$like':'%'+_0x5abcf3['query'][_0x7598('0x3b')]+'%'};return _0x50cc05;})});}_0x868882=_['merge']({},_0x868882,_0x5abcf3[_0x7598('0x43')]);return db['JscriptyAnswerReport'][_0x7598('0x1c')]({'where':_0x868882[_0x7598('0x3a')]})['then'](function(_0x2442cc){_0x8af083['count']=_0x2442cc;if(_0x5abcf3['query'][_0x7598('0x3d')]){_0x868882[_0x7598('0x3e')]=[{'all':!![]}];}return db[_0x7598('0x54')]['findAll'](_0x868882);})[_0x7598('0x22')](function(_0x3e53fe){_0x8af083[_0x7598('0x40')]=_0x3e53fe;return _0x8af083;});}})[_0x7598('0x22')](respondWithFilteredResult(_0x25e149,_0x868882))[_0x7598('0x45')](handleError(_0x25e149,null));};function char(_0x11b4cc){return'number'===typeof _0x11b4cc?String[_0x7598('0x57')]['apply'](null,arguments):_0x11b4cc;}function needsEncapsulation(_0x1d46ce){return!!_0x1d46ce&&(_0x1d46ce['toString']()[_0x7598('0x58')](char(0xd))>=0x0||_0x1d46ce['toString']()[_0x7598('0x58')](char(0xa))>=0x0||_0x1d46ce[_0x7598('0x59')]()[_0x7598('0x58')](char(0x2c))>=0x0||_0x1d46ce['toString']()['indexOf'](char(0x22))>=0x0);}function encapsulate(_0x1fcba0){var _0x1f09ff=char(0x22),_0x11e52b='\x5c'+char(0x22),_0x39b2d3=_0x1fcba0[_0x7598('0x59')]()[_0x7598('0x5a')](new RegExp(_0x1f09ff,'g'),_0x11e52b);return _0x1f09ff+_0x39b2d3+_0x1f09ff;}exports[_0x7598('0x5b')]=function(_0x12d55c,_0x646f11,_0x36a213){var _0x8589b,_0x24086b;var _0x507ace={'where':{'ProjectId':_0x12d55c[_0x7598('0x4a')]['id']}};if(_0x12d55c[_0x7598('0x2e')][_0x7598('0x5c')]){_0x507ace[_0x7598('0x3a')][_0x7598('0x5d')]=JSON['parse'](_0x12d55c[_0x7598('0x2e')][_0x7598('0x5c')]);}return db[_0x7598('0x52')][_0x7598('0x3f')](_0x507ace)[_0x7598('0x22')](handleEntityNotFound(_0x646f11,null))[_0x7598('0x22')](function(_0x4c8cbf){if(_0x4c8cbf){_0x8589b=_0x4c8cbf;return db[_0x7598('0x5e')]['findAll']({'where':{'SessionId':{'$in':_['map'](_0x8589b,'id')},'ProjectId':_0x12d55c['params']['id']},'order':_0x7598('0x5f')});}})['then'](handleEntityNotFound(_0x646f11,null))[_0x7598('0x22')](function(_0x570a7b){if(_0x570a7b){_0x24086b=_0x570a7b;var _0x4672d4={};for(var _0x532367=0x0,_0x40f122=_0x24086b['length'];_0x532367<_0x40f122;_0x532367++){if(!_0x4672d4[_0x7598('0x36')](_0x24086b[_0x532367][_0x7598('0x60')])){_0x4672d4[_0x24086b[_0x532367][_0x7598('0x60')]]=needsEncapsulation(_0x24086b[_0x532367]['question'])?encapsulate(_0x24086b[_0x532367]['question']):_0x24086b[_0x532367][_0x7598('0x61')];}}var _0x345a9d=[],_0x19e27f={};for(var _0x4a1273=0x0,_0x1f3b63=_0x8589b[_0x7598('0x35')];_0x4a1273<_0x1f3b63;_0x4a1273++){_0x19e27f={'ProjectId':_0x12d55c[_0x7598('0x4a')]['id'],'SessionId':_0x8589b[_0x4a1273]['id'],'StartTime':moment(_0x8589b[_0x4a1273][_0x7598('0x5d')])[_0x7598('0x62')](_0x7598('0x63'))};for(var _0x14cd49=0x0,_0x26c6ae=_0x24086b[_0x7598('0x35')];_0x14cd49<_0x26c6ae;_0x14cd49++){if(_0x24086b[_0x14cd49][_0x7598('0x64')]==_0x8589b[_0x4a1273]['id']&&_0x4672d4['hasOwnProperty'](_0x24086b[_0x14cd49]['questionId'])){_0x19e27f[_0x4672d4[_0x24086b[_0x14cd49]['questionId']]]=_0x24086b[_0x14cd49][_0x7598('0x65')];}}for(var _0x1aaaa4 in _0x4672d4){if(!_0x19e27f[_0x7598('0x36')](_0x4672d4[_0x1aaaa4])){_0x19e27f[_0x4672d4[_0x1aaaa4]]=null;}}_0x345a9d[_0x7598('0x66')](_0x19e27f);}return _0x345a9d;}})[_0x7598('0x22')](function(_0x47d845){if(!_[_0x7598('0x67')](_0x47d845)){var _0x3e87d7=toCsv(_0x47d845);var _0x4b8e6a=Date[_0x7598('0x68')]();fs[_0x7598('0x69')](util[_0x7598('0x62')]('/tmp/Jscripty_Project_%d_Summary_%s.csv',_0x12d55c[_0x7598('0x4a')]['id'],_0x4b8e6a),_0x3e87d7);_0x646f11['setHeader'](_0x7598('0x6a'),_0x7598('0x6b')+util[_0x7598('0x62')]('Jscripty_Project_%d_Summary_%s.csv',_0x12d55c[_0x7598('0x4a')]['id'],_0x4b8e6a));_0x646f11[_0x7598('0x6c')](_0x7598('0x6d'),'text/csv');return _0x646f11[_0x7598('0x6e')](util['format'](_0x7598('0x6f'),_0x12d55c['params']['id'],_0x4b8e6a));}else{return _0x646f11[_0x7598('0x18')](0xcc);}})['catch'](handleError(_0x646f11,null));}; \ No newline at end of file diff --git a/server/api/jscriptyProject/jscriptyProject.model.js b/server/api/jscriptyProject/jscriptyProject.model.js index 84261f0..4852030 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 _0x39b3=['define','JscriptyProject','jscripty_projects','lodash','api','bluebird','path','rimraf','../../config/environment','./jscriptyProject.attributes','exports'];(function(_0x31ed41,_0x223f14){var _0x349a3d=function(_0x1cd0ef){while(--_0x1cd0ef){_0x31ed41['push'](_0x31ed41['shift']());}};_0x349a3d(++_0x223f14);}(_0x39b3,0xc9));var _0x339b=function(_0x3947c9,_0x4d6c97){_0x3947c9=_0x3947c9-0x0;var _0x2e7871=_0x39b3[_0x3947c9];return _0x2e7871;};'use strict';var _=require(_0x339b('0x0'));var util=require('util');var logger=require('../../config/logger')(_0x339b('0x1'));var moment=require('moment');var BPromise=require(_0x339b('0x2'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x339b('0x3'));var rimraf=require(_0x339b('0x4'));var config=require(_0x339b('0x5'));var attributes=require(_0x339b('0x6'));module[_0x339b('0x7')]=function(_0x3021b1,_0x2394e2){return _0x3021b1[_0x339b('0x8')](_0x339b('0x9'),attributes,{'tableName':_0x339b('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x92e0=['exports','define','JscriptyProject','jscripty_projects','lodash','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./jscriptyProject.attributes'];(function(_0x352101,_0xadd4e6){var _0x3b8c83=function(_0x52cdc9){while(--_0x52cdc9){_0x352101['push'](_0x352101['shift']());}};_0x3b8c83(++_0xadd4e6);}(_0x92e0,0x154));var _0x092e=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x92e0[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0x092e('0x0'));var util=require('util');var logger=require(_0x092e('0x1'))(_0x092e('0x2'));var moment=require(_0x092e('0x3'));var BPromise=require(_0x092e('0x4'));var rp=require(_0x092e('0x5'));var fs=require('fs');var path=require(_0x092e('0x6'));var rimraf=require(_0x092e('0x7'));var config=require(_0x092e('0x8'));var attributes=require(_0x092e('0x9'));module[_0x092e('0xa')]=function(_0x51779f,_0x48af76){return _0x51779f[_0x092e('0xb')](_0x092e('0xc'),attributes,{'tableName':_0x092e('0xd'),'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 7666821..644d2d2 100644 --- a/server/api/jscriptyProject/jscriptyProject.rpc.js +++ b/server/api/jscriptyProject/jscriptyProject.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xda3f=['rpc','jayson/promise','client','request','then','info','JscriptyProject,\x20%s,\x20%s','request\x20sent','debug','JscriptyProject,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','util','moment','../../mysqldb','../../config/logger'];(function(_0x32f6b9,_0x2d4aa9){var _0x267d52=function(_0x10f74f){while(--_0x10f74f){_0x32f6b9['push'](_0x32f6b9['shift']());}};_0x267d52(++_0x2d4aa9);}(_0xda3f,0xec));var _0xfda3=function(_0x3ac89d,_0x14e082){_0x3ac89d=_0x3ac89d-0x0;var _0x454fb7=_0xda3f[_0x3ac89d];return _0x454fb7;};'use strict';var _=require('lodash');var util=require(_0xfda3('0x0'));var moment=require(_0xfda3('0x1'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0xfda3('0x2'))['db'];var utils=require('../../config/utils');var logger=require(_0xfda3('0x3'))(_0xfda3('0x4'));var config=require('../../config/environment');var jayson=require(_0xfda3('0x5'));var client=jayson[_0xfda3('0x6')]['http']({'port':0x232a});function respondWithRpcPromise(_0x4e72d1,_0x316792,_0x42476a){return new BPromise(function(_0x125e2a,_0x4018c0){return client[_0xfda3('0x7')](_0x4e72d1,_0x42476a)[_0xfda3('0x8')](function(_0x46655c){logger[_0xfda3('0x9')](_0xfda3('0xa'),_0x316792,_0xfda3('0xb'));logger[_0xfda3('0xc')](_0xfda3('0xd'),_0x316792,'request\x20sent',JSON[_0xfda3('0xe')](_0x46655c));if(_0x46655c[_0xfda3('0xf')]){if(_0x46655c[_0xfda3('0xf')][_0xfda3('0x10')]===0x1f4){logger[_0xfda3('0xf')]('JscriptyProject,\x20%s,\x20%s',_0x316792,_0x46655c[_0xfda3('0xf')]['message']);return _0x4018c0(_0x46655c[_0xfda3('0xf')][_0xfda3('0x11')]);}logger['error']('JscriptyProject,\x20%s,\x20%s',_0x316792,_0x46655c['error'][_0xfda3('0x11')]);return _0x125e2a(_0x46655c[_0xfda3('0xf')]['message']);}else{logger['info']('JscriptyProject,\x20%s,\x20%s',_0x316792,_0xfda3('0xb'));_0x125e2a(_0x46655c[_0xfda3('0x12')][_0xfda3('0x11')]);}})[_0xfda3('0x13')](function(_0x34900d){logger[_0xfda3('0xf')](_0xfda3('0xa'),_0x316792,_0x34900d);_0x4018c0(_0x34900d);});});} \ No newline at end of file +var _0xb7e7=['JscriptyProject,\x20%s,\x20%s','debug','JscriptyProject,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','catch','lodash','moment','randomstring','../../mysqldb','../../config/logger','rpc','../../config/environment','http','request','then','info'];(function(_0xa9d8aa,_0x5b8597){var _0x24ebc4=function(_0x4d08b3){while(--_0x4d08b3){_0xa9d8aa['push'](_0xa9d8aa['shift']());}};_0x24ebc4(++_0x5b8597);}(_0xb7e7,0x121));var _0x7b7e=function(_0x2ec461,_0x5f588a){_0x2ec461=_0x2ec461-0x0;var _0x28603d=_0xb7e7[_0x2ec461];return _0x28603d;};'use strict';var _=require(_0x7b7e('0x0'));var util=require('util');var moment=require(_0x7b7e('0x1'));var BPromise=require('bluebird');var rs=require(_0x7b7e('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x7b7e('0x3'))['db'];var utils=require('../../config/utils');var logger=require(_0x7b7e('0x4'))(_0x7b7e('0x5'));var config=require(_0x7b7e('0x6'));var jayson=require('jayson/promise');var client=jayson['client'][_0x7b7e('0x7')]({'port':0x232a});function respondWithRpcPromise(_0x372bde,_0x7f87e0,_0x55ce81){return new BPromise(function(_0x42b871,_0x223587){return client[_0x7b7e('0x8')](_0x372bde,_0x55ce81)[_0x7b7e('0x9')](function(_0x148964){logger[_0x7b7e('0xa')](_0x7b7e('0xb'),_0x7f87e0,'request\x20sent');logger[_0x7b7e('0xc')](_0x7b7e('0xd'),_0x7f87e0,_0x7b7e('0xe'),JSON[_0x7b7e('0xf')](_0x148964));if(_0x148964[_0x7b7e('0x10')]){if(_0x148964[_0x7b7e('0x10')][_0x7b7e('0x11')]===0x1f4){logger[_0x7b7e('0x10')](_0x7b7e('0xb'),_0x7f87e0,_0x148964['error'][_0x7b7e('0x12')]);return _0x223587(_0x148964[_0x7b7e('0x10')]['message']);}logger[_0x7b7e('0x10')]('JscriptyProject,\x20%s,\x20%s',_0x7f87e0,_0x148964['error'][_0x7b7e('0x12')]);return _0x42b871(_0x148964[_0x7b7e('0x10')][_0x7b7e('0x12')]);}else{logger[_0x7b7e('0xa')](_0x7b7e('0xb'),_0x7f87e0,'request\x20sent');_0x42b871(_0x148964['result'][_0x7b7e('0x12')]);}})[_0x7b7e('0x13')](function(_0x27f999){logger[_0x7b7e('0x10')](_0x7b7e('0xb'),_0x7f87e0,_0x27f999);_0x223587(_0x27f999);});});} \ No newline at end of file diff --git a/server/api/jscriptyQuestionReport/index.js b/server/api/jscriptyQuestionReport/index.js index 01553aa..387e83c 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 _0xeb5b=['delete','util','path','connect-timeout','express','Router','../../components/interaction/service','./jscriptyQuestionReport.controller','get','isAuthenticated','/describe','describe','/:id','show','create','put'];(function(_0x4387e5,_0x186f86){var _0xe4f03c=function(_0x5c8242){while(--_0x5c8242){_0x4387e5['push'](_0x4387e5['shift']());}};_0xe4f03c(++_0x186f86);}(_0xeb5b,0xa1));var _0xbeb5=function(_0x3227b7,_0x5922b5){_0x3227b7=_0x3227b7-0x0;var _0x258c38=_0xeb5b[_0x3227b7];return _0x258c38;};'use strict';var multer=require('multer');var util=require(_0xbeb5('0x0'));var path=require(_0xbeb5('0x1'));var timeout=require(_0xbeb5('0x2'));var express=require(_0xbeb5('0x3'));var router=express[_0xbeb5('0x4')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0xbeb5('0x5'));var config=require('../../config/environment');var controller=require(_0xbeb5('0x6'));router[_0xbeb5('0x7')]('/',auth[_0xbeb5('0x8')](),controller['index']);router[_0xbeb5('0x7')](_0xbeb5('0x9'),auth[_0xbeb5('0x8')](),controller[_0xbeb5('0xa')]);router[_0xbeb5('0x7')](_0xbeb5('0xb'),auth[_0xbeb5('0x8')](),controller[_0xbeb5('0xc')]);router['post']('/',auth[_0xbeb5('0x8')](),controller[_0xbeb5('0xd')]);router[_0xbeb5('0xe')](_0xbeb5('0xb'),auth[_0xbeb5('0x8')](),controller['update']);router[_0xbeb5('0xf')](_0xbeb5('0xb'),auth[_0xbeb5('0x8')](),controller['destroy']);module['exports']=router; \ No newline at end of file +var _0x33f4=['index','/describe','describe','/:id','show','post','create','put','update','delete','destroy','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated'];(function(_0x174c20,_0x474b2){var _0x5ecaec=function(_0x40213a){while(--_0x40213a){_0x174c20['push'](_0x174c20['shift']());}};_0x5ecaec(++_0x474b2);}(_0x33f4,0x14d));var _0x433f=function(_0x443604,_0x2ecb95){_0x443604=_0x443604-0x0;var _0x212383=_0x33f4[_0x443604];return _0x212383;};'use strict';var multer=require(_0x433f('0x0'));var util=require(_0x433f('0x1'));var path=require(_0x433f('0x2'));var timeout=require(_0x433f('0x3'));var express=require(_0x433f('0x4'));var router=express[_0x433f('0x5')]();var fs_extra=require(_0x433f('0x6'));var auth=require(_0x433f('0x7'));var interaction=require(_0x433f('0x8'));var config=require(_0x433f('0x9'));var controller=require('./jscriptyQuestionReport.controller');router[_0x433f('0xa')]('/',auth[_0x433f('0xb')](),controller[_0x433f('0xc')]);router[_0x433f('0xa')](_0x433f('0xd'),auth[_0x433f('0xb')](),controller[_0x433f('0xe')]);router[_0x433f('0xa')](_0x433f('0xf'),auth[_0x433f('0xb')](),controller[_0x433f('0x10')]);router[_0x433f('0x11')]('/',auth[_0x433f('0xb')](),controller[_0x433f('0x12')]);router[_0x433f('0x13')](_0x433f('0xf'),auth[_0x433f('0xb')](),controller[_0x433f('0x14')]);router[_0x433f('0x15')](_0x433f('0xf'),auth[_0x433f('0xb')](),controller[_0x433f('0x16')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/jscriptyQuestionReport/jscriptyQuestionReport.attributes.js b/server/api/jscriptyQuestionReport/jscriptyQuestionReport.attributes.js index d11e421..8263e4a 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(_0x50a0c2,_0x4befab){var _0x5ebadd=function(_0x3a3342){while(--_0x3a3342){_0x50a0c2['push'](_0x50a0c2['shift']());}};_0x5ebadd(++_0x4befab);}(_0x7a54,0x106));var _0x47a5=function(_0x4d24dc,_0x32ba81){_0x4d24dc=_0x4d24dc-0x0;var _0x5dbc30=_0x7a54[_0x4d24dc];return _0x5dbc30;};'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(_0x2e4aa2,_0x11956a){var _0x5e6092=function(_0x4c12c2){while(--_0x4c12c2){_0x2e4aa2['push'](_0x2e4aa2['shift']());}};_0x5e6092(++_0x11956a);}(_0x7a54,0x106));var _0x47a5=function(_0x392e0e,_0x4c0e87){_0x392e0e=_0x392e0e-0x0;var _0x357278=_0x7a54[_0x392e0e];return _0x357278;};'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 5f7de1b..476d2e4 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 _0xcf54=['order','where','filters','pick','filter','JscriptyQuestionReport','includeAll','include','findAll','params','rawAttributes','options','find','create','body','catch','describe','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','path','sox','to-csv','ejs','squel','jsforce','desk.js','papaparse','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','then','destroy','error','name','send','index','map','type','key','model','query','keys','intersection','attributes','fields','length','hasOwnProperty','nolimit'];(function(_0x14eb10,_0x3f39b5){var _0x531df3=function(_0x4d62c6){while(--_0x4d62c6){_0x14eb10['push'](_0x14eb10['shift']());}};_0x531df3(++_0x3f39b5);}(_0xcf54,0x135));var _0x4cf5=function(_0x5c6022,_0x5cd10b){_0x5c6022=_0x5c6022-0x0;var _0x4ab5af=_0xcf54[_0x5c6022];return _0x4ab5af;};'use strict';var emlformat=require(_0x4cf5('0x0'));var rimraf=require(_0x4cf5('0x1'));var zipdir=require(_0x4cf5('0x2'));var jsonpatch=require(_0x4cf5('0x3'));var rp=require('request-promise');var moment=require(_0x4cf5('0x4'));var BPromise=require(_0x4cf5('0x5'));var Mustache=require(_0x4cf5('0x6'));var util=require(_0x4cf5('0x7'));var path=require(_0x4cf5('0x8'));var sox=require(_0x4cf5('0x9'));var csv=require(_0x4cf5('0xa'));var ejs=require(_0x4cf5('0xb'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0x4cf5('0xc'));var crypto=require('crypto');var jsforce=require(_0x4cf5('0xd'));var deskjs=require(_0x4cf5('0xe'));var toCsv=require(_0x4cf5('0xa'));var querystring=require('querystring');var Papa=require(_0x4cf5('0xf'));var Redis=require('ioredis');var authService=require(_0x4cf5('0x10'));var qs=require('../../components/parsers/qs');var as=require(_0x4cf5('0x11'));var hardwareService=require(_0x4cf5('0x12'));var logger=require(_0x4cf5('0x13'))(_0x4cf5('0x14'));var utils=require('../../config/utils');var config=require(_0x4cf5('0x15'));var licenseUtil=require(_0x4cf5('0x16'));var db=require(_0x4cf5('0x17'))['db'];function respondWithStatusCode(_0x2b9ace,_0x492a91){_0x492a91=_0x492a91||0xcc;return function(_0x2cc580){if(_0x2cc580){return _0x2b9ace[_0x4cf5('0x18')](_0x492a91);}return _0x2b9ace[_0x4cf5('0x19')](_0x492a91)[_0x4cf5('0x1a')]();};}function respondWithResult(_0x4f88f1,_0x44adc4){_0x44adc4=_0x44adc4||0xc8;return function(_0x1e884d){if(_0x1e884d){return _0x4f88f1['status'](_0x44adc4)[_0x4cf5('0x1b')](_0x1e884d);}};}function respondWithFilteredResult(_0x42b8cf,_0x1794d2){return function(_0x353776){if(_0x353776){var _0x40f488=typeof _0x1794d2[_0x4cf5('0x1c')]===_0x4cf5('0x1d')&&typeof _0x1794d2[_0x4cf5('0x1e')]==='undefined';var _0x5ef92c=_0x353776[_0x4cf5('0x1f')];var _0x150b9c=_0x40f488?0x0:_0x1794d2[_0x4cf5('0x1c')];var _0x4bd17f=_0x40f488?_0x353776['count']:_0x1794d2[_0x4cf5('0x1c')]+_0x1794d2['limit'];var _0x13fa3a;if(_0x4bd17f>=_0x5ef92c){_0x4bd17f=_0x5ef92c;_0x13fa3a=0xc8;}else{_0x13fa3a=0xce;}_0x42b8cf[_0x4cf5('0x19')](_0x13fa3a);return _0x42b8cf[_0x4cf5('0x20')](_0x4cf5('0x21'),_0x150b9c+'-'+_0x4bd17f+'/'+_0x5ef92c)['json'](_0x353776);}return null;};}function patchUpdates(_0x34599f){return function(_0x564990){try{jsonpatch[_0x4cf5('0x22')](_0x564990,_0x34599f,!![]);}catch(_0x41e86a){return BPromise[_0x4cf5('0x23')](_0x41e86a);}return _0x564990[_0x4cf5('0x24')]();};}function saveUpdates(_0x8dbe92,_0x408cbb){return function(_0x35d042){if(_0x35d042){return _0x35d042[_0x4cf5('0x25')](_0x8dbe92)[_0x4cf5('0x26')](function(_0xba7f38){return _0xba7f38;});}return null;};}function removeEntity(_0x3d7283,_0xd9751a){return function(_0x5b4b09){if(_0x5b4b09){return _0x5b4b09[_0x4cf5('0x27')]()[_0x4cf5('0x26')](function(){_0x3d7283[_0x4cf5('0x19')](0xcc)['end']();});}};}function handleEntityNotFound(_0x32a981,_0x537927){return function(_0x1ab650){if(!_0x1ab650){_0x32a981[_0x4cf5('0x18')](0x194);}return _0x1ab650;};}function handleError(_0x2f4bb9,_0x378557){_0x378557=_0x378557||0x1f4;return function(_0x2c90a1){logger[_0x4cf5('0x28')](_0x2c90a1['stack']);if(_0x2c90a1[_0x4cf5('0x29')]){delete _0x2c90a1['name'];}_0x2f4bb9[_0x4cf5('0x19')](_0x378557)[_0x4cf5('0x2a')](_0x2c90a1);};}exports[_0x4cf5('0x2b')]=function(_0x3da1ec,_0x1b91b2){var _0x235cf7={},_0x43e877={},_0x36e0ab={'count':0x0,'rows':[]};var _0xa8fffe=_[_0x4cf5('0x2c')](db['JscriptyQuestionReport']['rawAttributes'],function(_0x167f7c){return{'name':_0x167f7c['fieldName'],'type':_0x167f7c[_0x4cf5('0x2d')][_0x4cf5('0x2e')]};});_0x43e877[_0x4cf5('0x2f')]=_['map'](_0xa8fffe,'name');_0x43e877[_0x4cf5('0x30')]=_[_0x4cf5('0x31')](_0x3da1ec['query']);_0x43e877['filters']=_[_0x4cf5('0x32')](_0x43e877['model'],_0x43e877[_0x4cf5('0x30')]);_0x235cf7[_0x4cf5('0x33')]=_[_0x4cf5('0x32')](_0x43e877[_0x4cf5('0x2f')],qs[_0x4cf5('0x34')](_0x3da1ec[_0x4cf5('0x30')][_0x4cf5('0x34')]));_0x235cf7[_0x4cf5('0x33')]=_0x235cf7[_0x4cf5('0x33')][_0x4cf5('0x35')]?_0x235cf7[_0x4cf5('0x33')]:_0x43e877[_0x4cf5('0x2f')];if(!_0x3da1ec[_0x4cf5('0x30')][_0x4cf5('0x36')](_0x4cf5('0x37'))){_0x235cf7[_0x4cf5('0x1e')]=qs[_0x4cf5('0x1e')](_0x3da1ec[_0x4cf5('0x30')][_0x4cf5('0x1e')]);_0x235cf7[_0x4cf5('0x1c')]=qs[_0x4cf5('0x1c')](_0x3da1ec['query'][_0x4cf5('0x1c')]);}_0x235cf7[_0x4cf5('0x38')]=qs['sort'](_0x3da1ec[_0x4cf5('0x30')]['sort']);_0x235cf7[_0x4cf5('0x39')]=qs[_0x4cf5('0x3a')](_[_0x4cf5('0x3b')](_0x3da1ec[_0x4cf5('0x30')],_0x43e877[_0x4cf5('0x3a')]),_0xa8fffe);if(_0x3da1ec['query'][_0x4cf5('0x3c')]){_0x235cf7[_0x4cf5('0x39')]=_['merge'](_0x235cf7['where'],{'$or':_[_0x4cf5('0x2c')](_0xa8fffe,function(_0x88615a){if(_0x88615a['type']!=='VIRTUAL'){var _0x54dda4={};_0x54dda4[_0x88615a['name']]={'$like':'%'+_0x3da1ec[_0x4cf5('0x30')][_0x4cf5('0x3c')]+'%'};return _0x54dda4;}})});}_0x235cf7=_['merge']({},_0x235cf7,_0x3da1ec['options']);var _0xe80e4a={'where':_0x235cf7[_0x4cf5('0x39')]};return db[_0x4cf5('0x3d')][_0x4cf5('0x1f')](_0xe80e4a)['then'](function(_0x563c69){_0x36e0ab[_0x4cf5('0x1f')]=_0x563c69;if(_0x3da1ec[_0x4cf5('0x30')][_0x4cf5('0x3e')]){_0x235cf7[_0x4cf5('0x3f')]=[{'all':!![]}];}return db[_0x4cf5('0x3d')][_0x4cf5('0x40')](_0x235cf7);})[_0x4cf5('0x26')](function(_0x4a9216){_0x36e0ab['rows']=_0x4a9216;return _0x36e0ab;})[_0x4cf5('0x26')](respondWithFilteredResult(_0x1b91b2,_0x235cf7))['catch'](handleError(_0x1b91b2,null));};exports['show']=function(_0x5880e1,_0x3eb77a){var _0x5e212e={'raw':!![],'where':{'id':_0x5880e1[_0x4cf5('0x41')]['id']}},_0x423840={};_0x423840[_0x4cf5('0x2f')]=_[_0x4cf5('0x31')](db[_0x4cf5('0x3d')][_0x4cf5('0x42')]);_0x423840[_0x4cf5('0x30')]=_[_0x4cf5('0x31')](_0x5880e1['query']);_0x423840[_0x4cf5('0x3a')]=_[_0x4cf5('0x32')](_0x423840[_0x4cf5('0x2f')],_0x423840[_0x4cf5('0x30')]);_0x5e212e['attributes']=_[_0x4cf5('0x32')](_0x423840[_0x4cf5('0x2f')],qs['fields'](_0x5880e1['query']['fields']));_0x5e212e[_0x4cf5('0x33')]=_0x5e212e['attributes']['length']?_0x5e212e[_0x4cf5('0x33')]:_0x423840['model'];if(_0x5880e1[_0x4cf5('0x30')][_0x4cf5('0x3e')]){_0x5e212e[_0x4cf5('0x3f')]=[{'all':!![]}];}_0x5e212e=_['merge']({},_0x5e212e,_0x5880e1[_0x4cf5('0x43')]);return db['JscriptyQuestionReport'][_0x4cf5('0x44')](_0x5e212e)[_0x4cf5('0x26')](handleEntityNotFound(_0x3eb77a,null))[_0x4cf5('0x26')](respondWithResult(_0x3eb77a,null))['catch'](handleError(_0x3eb77a,null));};exports[_0x4cf5('0x45')]=function(_0x32a55,_0x2ffcc7){return db[_0x4cf5('0x3d')][_0x4cf5('0x45')](_0x32a55[_0x4cf5('0x46')],{})[_0x4cf5('0x26')](respondWithResult(_0x2ffcc7,0xc9))[_0x4cf5('0x47')](handleError(_0x2ffcc7,null));};exports[_0x4cf5('0x25')]=function(_0x22df94,_0x1a7abe){if(_0x22df94[_0x4cf5('0x46')]['id']){delete _0x22df94['body']['id'];}return db[_0x4cf5('0x3d')][_0x4cf5('0x44')]({'where':{'id':_0x22df94[_0x4cf5('0x41')]['id']}})[_0x4cf5('0x26')](handleEntityNotFound(_0x1a7abe,null))[_0x4cf5('0x26')](saveUpdates(_0x22df94['body'],null))[_0x4cf5('0x26')](respondWithResult(_0x1a7abe,null))[_0x4cf5('0x47')](handleError(_0x1a7abe,null));};exports['destroy']=function(_0xe1ddd4,_0x2db0b4){return db[_0x4cf5('0x3d')]['find']({'where':{'id':_0xe1ddd4['params']['id']}})['then'](handleEntityNotFound(_0x2db0b4,null))[_0x4cf5('0x26')](removeEntity(_0x2db0b4,null))[_0x4cf5('0x47')](handleError(_0x2db0b4,null));};exports[_0x4cf5('0x48')]=function(_0x57c846,_0x15bd67){return db[_0x4cf5('0x3d')][_0x4cf5('0x48')]()['then'](respondWithResult(_0x15bd67,null))[_0x4cf5('0x47')](handleError(_0x15bd67,null));}; \ No newline at end of file +var _0x66a3=['rawAttributes','key','query','keys','filters','intersection','model','fields','attributes','length','nolimit','order','sort','pick','filter','where','type','VIRTUAL','merge','options','includeAll','include','JscriptyQuestionReport','findAll','rows','catch','show','params','find','create','body','update','describe','eml-format','zip-dir','fast-json-patch','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','querystring','papaparse','ioredis','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','end','offset','undefined','limit','count','set','Content-Range','json','apply','reject','save','then','destroy','status','error','stack','name','send','index','map'];(function(_0x7a1a50,_0x13593){var _0xe6587d=function(_0x36f8a8){while(--_0x36f8a8){_0x7a1a50['push'](_0x7a1a50['shift']());}};_0xe6587d(++_0x13593);}(_0x66a3,0x15d));var _0x366a=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x66a3[_0x3dd15e];return _0x231fd0;};'use strict';var emlformat=require(_0x366a('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x366a('0x1'));var jsonpatch=require(_0x366a('0x2'));var rp=require('request-promise');var moment=require(_0x366a('0x3'));var BPromise=require(_0x366a('0x4'));var Mustache=require(_0x366a('0x5'));var util=require(_0x366a('0x6'));var path=require(_0x366a('0x7'));var sox=require(_0x366a('0x8'));var csv=require(_0x366a('0x9'));var ejs=require(_0x366a('0xa'));var fs=require('fs');var fs_extra=require(_0x366a('0xb'));var _=require(_0x366a('0xc'));var squel=require(_0x366a('0xd'));var crypto=require(_0x366a('0xe'));var jsforce=require(_0x366a('0xf'));var deskjs=require('desk.js');var toCsv=require(_0x366a('0x9'));var querystring=require(_0x366a('0x10'));var Papa=require(_0x366a('0x11'));var Redis=require(_0x366a('0x12'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0x366a('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x366a('0x14'))(_0x366a('0x15'));var utils=require(_0x366a('0x16'));var config=require(_0x366a('0x17'));var licenseUtil=require('../../config/license/util');var db=require(_0x366a('0x18'))['db'];function respondWithStatusCode(_0x4a70fd,_0x3aefd7){_0x3aefd7=_0x3aefd7||0xcc;return function(_0x4811d9){if(_0x4811d9){return _0x4a70fd[_0x366a('0x19')](_0x3aefd7);}return _0x4a70fd['status'](_0x3aefd7)[_0x366a('0x1a')]();};}function respondWithResult(_0x2c408e,_0x1c1401){_0x1c1401=_0x1c1401||0xc8;return function(_0x17a379){if(_0x17a379){return _0x2c408e['status'](_0x1c1401)['json'](_0x17a379);}};}function respondWithFilteredResult(_0x3a60a2,_0x10fbd8){return function(_0x413bb5){if(_0x413bb5){var _0x593c4b=typeof _0x10fbd8[_0x366a('0x1b')]===_0x366a('0x1c')&&typeof _0x10fbd8[_0x366a('0x1d')]===_0x366a('0x1c');var _0x5ee3a1=_0x413bb5[_0x366a('0x1e')];var _0x29bbf7=_0x593c4b?0x0:_0x10fbd8['offset'];var _0x109d56=_0x593c4b?_0x413bb5[_0x366a('0x1e')]:_0x10fbd8['offset']+_0x10fbd8[_0x366a('0x1d')];var _0x63f91e;if(_0x109d56>=_0x5ee3a1){_0x109d56=_0x5ee3a1;_0x63f91e=0xc8;}else{_0x63f91e=0xce;}_0x3a60a2['status'](_0x63f91e);return _0x3a60a2[_0x366a('0x1f')](_0x366a('0x20'),_0x29bbf7+'-'+_0x109d56+'/'+_0x5ee3a1)[_0x366a('0x21')](_0x413bb5);}return null;};}function patchUpdates(_0x1f102c){return function(_0x28a54f){try{jsonpatch[_0x366a('0x22')](_0x28a54f,_0x1f102c,!![]);}catch(_0x5eac54){return BPromise[_0x366a('0x23')](_0x5eac54);}return _0x28a54f[_0x366a('0x24')]();};}function saveUpdates(_0x52269e,_0xc9c7a3){return function(_0x425ccb){if(_0x425ccb){return _0x425ccb['update'](_0x52269e)[_0x366a('0x25')](function(_0x354787){return _0x354787;});}return null;};}function removeEntity(_0x5595fc,_0x51ac05){return function(_0x1e474f){if(_0x1e474f){return _0x1e474f[_0x366a('0x26')]()[_0x366a('0x25')](function(){_0x5595fc[_0x366a('0x27')](0xcc)['end']();});}};}function handleEntityNotFound(_0x47f8b6,_0x6683d7){return function(_0x466b97){if(!_0x466b97){_0x47f8b6[_0x366a('0x19')](0x194);}return _0x466b97;};}function handleError(_0x7407ca,_0x3dd603){_0x3dd603=_0x3dd603||0x1f4;return function(_0x551671){logger[_0x366a('0x28')](_0x551671[_0x366a('0x29')]);if(_0x551671[_0x366a('0x2a')]){delete _0x551671['name'];}_0x7407ca[_0x366a('0x27')](_0x3dd603)[_0x366a('0x2b')](_0x551671);};}exports[_0x366a('0x2c')]=function(_0x3c81ee,_0xb98e3c){var _0x1f3c39={},_0x362624={},_0x40501a={'count':0x0,'rows':[]};var _0x2cf73c=_[_0x366a('0x2d')](db['JscriptyQuestionReport'][_0x366a('0x2e')],function(_0x2c1442){return{'name':_0x2c1442['fieldName'],'type':_0x2c1442['type'][_0x366a('0x2f')]};});_0x362624['model']=_[_0x366a('0x2d')](_0x2cf73c,_0x366a('0x2a'));_0x362624[_0x366a('0x30')]=_[_0x366a('0x31')](_0x3c81ee[_0x366a('0x30')]);_0x362624[_0x366a('0x32')]=_[_0x366a('0x33')](_0x362624[_0x366a('0x34')],_0x362624[_0x366a('0x30')]);_0x1f3c39['attributes']=_[_0x366a('0x33')](_0x362624[_0x366a('0x34')],qs['fields'](_0x3c81ee[_0x366a('0x30')][_0x366a('0x35')]));_0x1f3c39['attributes']=_0x1f3c39[_0x366a('0x36')][_0x366a('0x37')]?_0x1f3c39[_0x366a('0x36')]:_0x362624['model'];if(!_0x3c81ee['query']['hasOwnProperty'](_0x366a('0x38'))){_0x1f3c39[_0x366a('0x1d')]=qs[_0x366a('0x1d')](_0x3c81ee[_0x366a('0x30')][_0x366a('0x1d')]);_0x1f3c39['offset']=qs['offset'](_0x3c81ee[_0x366a('0x30')]['offset']);}_0x1f3c39[_0x366a('0x39')]=qs[_0x366a('0x3a')](_0x3c81ee[_0x366a('0x30')][_0x366a('0x3a')]);_0x1f3c39['where']=qs[_0x366a('0x32')](_[_0x366a('0x3b')](_0x3c81ee[_0x366a('0x30')],_0x362624[_0x366a('0x32')]),_0x2cf73c);if(_0x3c81ee[_0x366a('0x30')][_0x366a('0x3c')]){_0x1f3c39[_0x366a('0x3d')]=_['merge'](_0x1f3c39[_0x366a('0x3d')],{'$or':_['map'](_0x2cf73c,function(_0x22fc82){if(_0x22fc82[_0x366a('0x3e')]!==_0x366a('0x3f')){var _0x457174={};_0x457174[_0x22fc82[_0x366a('0x2a')]]={'$like':'%'+_0x3c81ee[_0x366a('0x30')][_0x366a('0x3c')]+'%'};return _0x457174;}})});}_0x1f3c39=_[_0x366a('0x40')]({},_0x1f3c39,_0x3c81ee[_0x366a('0x41')]);var _0x4c2b70={'where':_0x1f3c39['where']};return db['JscriptyQuestionReport'][_0x366a('0x1e')](_0x4c2b70)[_0x366a('0x25')](function(_0x44324b){_0x40501a[_0x366a('0x1e')]=_0x44324b;if(_0x3c81ee[_0x366a('0x30')][_0x366a('0x42')]){_0x1f3c39[_0x366a('0x43')]=[{'all':!![]}];}return db[_0x366a('0x44')][_0x366a('0x45')](_0x1f3c39);})[_0x366a('0x25')](function(_0x990e84){_0x40501a[_0x366a('0x46')]=_0x990e84;return _0x40501a;})[_0x366a('0x25')](respondWithFilteredResult(_0xb98e3c,_0x1f3c39))[_0x366a('0x47')](handleError(_0xb98e3c,null));};exports[_0x366a('0x48')]=function(_0x558e60,_0x4054f8){var _0x34bf66={'raw':!![],'where':{'id':_0x558e60[_0x366a('0x49')]['id']}},_0x453cde={};_0x453cde[_0x366a('0x34')]=_[_0x366a('0x31')](db[_0x366a('0x44')][_0x366a('0x2e')]);_0x453cde[_0x366a('0x30')]=_[_0x366a('0x31')](_0x558e60[_0x366a('0x30')]);_0x453cde[_0x366a('0x32')]=_[_0x366a('0x33')](_0x453cde['model'],_0x453cde['query']);_0x34bf66[_0x366a('0x36')]=_[_0x366a('0x33')](_0x453cde[_0x366a('0x34')],qs[_0x366a('0x35')](_0x558e60[_0x366a('0x30')]['fields']));_0x34bf66[_0x366a('0x36')]=_0x34bf66[_0x366a('0x36')][_0x366a('0x37')]?_0x34bf66[_0x366a('0x36')]:_0x453cde[_0x366a('0x34')];if(_0x558e60[_0x366a('0x30')][_0x366a('0x42')]){_0x34bf66[_0x366a('0x43')]=[{'all':!![]}];}_0x34bf66=_['merge']({},_0x34bf66,_0x558e60[_0x366a('0x41')]);return db['JscriptyQuestionReport'][_0x366a('0x4a')](_0x34bf66)['then'](handleEntityNotFound(_0x4054f8,null))['then'](respondWithResult(_0x4054f8,null))[_0x366a('0x47')](handleError(_0x4054f8,null));};exports[_0x366a('0x4b')]=function(_0x13b10c,_0x4df000){return db[_0x366a('0x44')][_0x366a('0x4b')](_0x13b10c[_0x366a('0x4c')],{})[_0x366a('0x25')](respondWithResult(_0x4df000,0xc9))[_0x366a('0x47')](handleError(_0x4df000,null));};exports[_0x366a('0x4d')]=function(_0x4056ee,_0x2eba50){if(_0x4056ee[_0x366a('0x4c')]['id']){delete _0x4056ee['body']['id'];}return db['JscriptyQuestionReport'][_0x366a('0x4a')]({'where':{'id':_0x4056ee['params']['id']}})['then'](handleEntityNotFound(_0x2eba50,null))[_0x366a('0x25')](saveUpdates(_0x4056ee['body'],null))[_0x366a('0x25')](respondWithResult(_0x2eba50,null))[_0x366a('0x47')](handleError(_0x2eba50,null));};exports['destroy']=function(_0x2c232e,_0x5d6542){return db[_0x366a('0x44')][_0x366a('0x4a')]({'where':{'id':_0x2c232e[_0x366a('0x49')]['id']}})[_0x366a('0x25')](handleEntityNotFound(_0x5d6542,null))[_0x366a('0x25')](removeEntity(_0x5d6542,null))[_0x366a('0x47')](handleError(_0x5d6542,null));};exports[_0x366a('0x4e')]=function(_0x2e7dc5,_0x199dd5){return db[_0x366a('0x44')]['describe']()[_0x366a('0x25')](respondWithResult(_0x199dd5,null))[_0x366a('0x47')](handleError(_0x199dd5,null));}; \ No newline at end of file diff --git a/server/api/jscriptyQuestionReport/jscriptyQuestionReport.model.js b/server/api/jscriptyQuestionReport/jscriptyQuestionReport.model.js index 6d41c7c..b5f71ef 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 _0xe2ff=['bluebird','rimraf','./jscriptyQuestionReport.attributes','exports','define','JscriptyQuestionReport','report_jscripty_questions','../../config/logger','api','moment'];(function(_0x4ea127,_0x582710){var _0x6958bd=function(_0x5cfe33){while(--_0x5cfe33){_0x4ea127['push'](_0x4ea127['shift']());}};_0x6958bd(++_0x582710);}(_0xe2ff,0x129));var _0xfe2f=function(_0x2bd8f2,_0x4884df){_0x2bd8f2=_0x2bd8f2-0x0;var _0x559526=_0xe2ff[_0x2bd8f2];return _0x559526;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0xfe2f('0x0'))(_0xfe2f('0x1'));var moment=require(_0xfe2f('0x2'));var BPromise=require(_0xfe2f('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0xfe2f('0x4'));var config=require('../../config/environment');var attributes=require(_0xfe2f('0x5'));module[_0xfe2f('0x6')]=function(_0x4a5b0c,_0x4d3155){return _0x4a5b0c[_0xfe2f('0x7')](_0xfe2f('0x8'),attributes,{'tableName':_0xfe2f('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x438e=['define','JscriptyQuestionReport','lodash','api','moment','rimraf','../../config/environment','./jscriptyQuestionReport.attributes','exports'];(function(_0x898ff8,_0x1d18aa){var _0xe9ffeb=function(_0x562563){while(--_0x562563){_0x898ff8['push'](_0x898ff8['shift']());}};_0xe9ffeb(++_0x1d18aa);}(_0x438e,0xc8));var _0xe438=function(_0x65c903,_0x41e920){_0x65c903=_0x65c903-0x0;var _0x23e1d7=_0x438e[_0x65c903];return _0x23e1d7;};'use strict';var _=require(_0xe438('0x0'));var util=require('util');var logger=require('../../config/logger')(_0xe438('0x1'));var moment=require(_0xe438('0x2'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0xe438('0x3'));var config=require(_0xe438('0x4'));var attributes=require(_0xe438('0x5'));module[_0xe438('0x6')]=function(_0x45b761,_0x57091e){return _0x45b761[_0xe438('0x7')](_0xe438('0x8'),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 5f0a3bc..c5f5335 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 _0xa977=['request\x20sent','debug','JscriptyQuestionReport,\x20%s,\x20%s,\x20%s','stringify','error','JscriptyQuestionReport,\x20%s,\x20%s','message','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','request','info'];(function(_0x3217d3,_0xf66fcf){var _0x260f43=function(_0x2b4a34){while(--_0x2b4a34){_0x3217d3['push'](_0x3217d3['shift']());}};_0x260f43(++_0xf66fcf);}(_0xa977,0x71));var _0x7a97=function(_0x263698,_0x6849d){_0x263698=_0x263698-0x0;var _0x2f7d86=_0xa977[_0x263698];return _0x2f7d86;};'use strict';var _=require(_0x7a97('0x0'));var util=require(_0x7a97('0x1'));var moment=require(_0x7a97('0x2'));var BPromise=require(_0x7a97('0x3'));var rs=require(_0x7a97('0x4'));var fs=require('fs');var Redis=require(_0x7a97('0x5'));var db=require(_0x7a97('0x6'))['db'];var utils=require(_0x7a97('0x7'));var logger=require(_0x7a97('0x8'))('rpc');var config=require(_0x7a97('0x9'));var jayson=require(_0x7a97('0xa'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x513a0e,_0x44b0f5,_0x5cdf25){return new BPromise(function(_0x29fe00,_0x30d15b){return client[_0x7a97('0xb')](_0x513a0e,_0x5cdf25)['then'](function(_0x5acb69){logger[_0x7a97('0xc')]('JscriptyQuestionReport,\x20%s,\x20%s',_0x44b0f5,_0x7a97('0xd'));logger[_0x7a97('0xe')](_0x7a97('0xf'),_0x44b0f5,_0x7a97('0xd'),JSON[_0x7a97('0x10')](_0x5acb69));if(_0x5acb69['error']){if(_0x5acb69[_0x7a97('0x11')]['code']===0x1f4){logger[_0x7a97('0x11')](_0x7a97('0x12'),_0x44b0f5,_0x5acb69[_0x7a97('0x11')]['message']);return _0x30d15b(_0x5acb69['error'][_0x7a97('0x13')]);}logger[_0x7a97('0x11')](_0x7a97('0x12'),_0x44b0f5,_0x5acb69[_0x7a97('0x11')][_0x7a97('0x13')]);return _0x29fe00(_0x5acb69[_0x7a97('0x11')]['message']);}else{logger[_0x7a97('0xc')]('JscriptyQuestionReport,\x20%s,\x20%s',_0x44b0f5,_0x7a97('0xd'));_0x29fe00(_0x5acb69['result'][_0x7a97('0x13')]);}})[_0x7a97('0x14')](function(_0x3c7025){logger[_0x7a97('0x11')](_0x7a97('0x12'),_0x44b0f5,_0x3c7025);_0x30d15b(_0x3c7025);});});} \ No newline at end of file +var _0x86ad=['../../config/environment','jayson/promise','client','http','request','then','JscriptyQuestionReport,\x20%s,\x20%s','debug','JscriptyQuestionReport,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','info','result','catch','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc'];(function(_0x5886a0,_0x3ff105){var _0x1e0d06=function(_0x15fb9a){while(--_0x15fb9a){_0x5886a0['push'](_0x5886a0['shift']());}};_0x1e0d06(++_0x3ff105);}(_0x86ad,0x1ba));var _0xd86a=function(_0x5733ff,_0x3cd13d){_0x5733ff=_0x5733ff-0x0;var _0x2a86e6=_0x86ad[_0x5733ff];return _0x2a86e6;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0xd86a('0x0'));var BPromise=require(_0xd86a('0x1'));var rs=require(_0xd86a('0x2'));var fs=require('fs');var Redis=require(_0xd86a('0x3'));var db=require(_0xd86a('0x4'))['db'];var utils=require(_0xd86a('0x5'));var logger=require(_0xd86a('0x6'))(_0xd86a('0x7'));var config=require(_0xd86a('0x8'));var jayson=require(_0xd86a('0x9'));var client=jayson[_0xd86a('0xa')][_0xd86a('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x56f5d8,_0x54d4ae,_0x1b68fc){return new BPromise(function(_0x3485ee,_0x435e60){return client[_0xd86a('0xc')](_0x56f5d8,_0x1b68fc)[_0xd86a('0xd')](function(_0x9e08c){logger['info'](_0xd86a('0xe'),_0x54d4ae,'request\x20sent');logger[_0xd86a('0xf')](_0xd86a('0x10'),_0x54d4ae,_0xd86a('0x11'),JSON[_0xd86a('0x12')](_0x9e08c));if(_0x9e08c[_0xd86a('0x13')]){if(_0x9e08c['error'][_0xd86a('0x14')]===0x1f4){logger[_0xd86a('0x13')](_0xd86a('0xe'),_0x54d4ae,_0x9e08c[_0xd86a('0x13')]['message']);return _0x435e60(_0x9e08c['error']['message']);}logger[_0xd86a('0x13')](_0xd86a('0xe'),_0x54d4ae,_0x9e08c[_0xd86a('0x13')][_0xd86a('0x15')]);return _0x3485ee(_0x9e08c[_0xd86a('0x13')][_0xd86a('0x15')]);}else{logger[_0xd86a('0x16')](_0xd86a('0xe'),_0x54d4ae,_0xd86a('0x11'));_0x3485ee(_0x9e08c[_0xd86a('0x17')][_0xd86a('0x15')]);}})[_0xd86a('0x18')](function(_0x35bb5d){logger[_0xd86a('0x13')](_0xd86a('0xe'),_0x54d4ae,_0x35bb5d);_0x435e60(_0x35bb5d);});});} \ No newline at end of file diff --git a/server/api/jscriptySessionReport/index.js b/server/api/jscriptySessionReport/index.js index 3c1be5a..cf350b5 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 _0xb0a4=['connect-timeout','fs-extra','../../config/environment','./jscriptySessionReport.controller','isAuthenticated','/describe','describe','get','show','/:id/questions','getQuestions','post','create','put','/:id','update','destroy','exports','util','path'];(function(_0x3ec412,_0x4e05a2){var _0x48a1d1=function(_0x39acc7){while(--_0x39acc7){_0x3ec412['push'](_0x3ec412['shift']());}};_0x48a1d1(++_0x4e05a2);}(_0xb0a4,0x1a2));var _0x4b0a=function(_0x428e09,_0xcc22d4){_0x428e09=_0x428e09-0x0;var _0x52199f=_0xb0a4[_0x428e09];return _0x52199f;};'use strict';var multer=require('multer');var util=require(_0x4b0a('0x0'));var path=require(_0x4b0a('0x1'));var timeout=require(_0x4b0a('0x2'));var express=require('express');var router=express['Router']();var fs_extra=require(_0x4b0a('0x3'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0x4b0a('0x4'));var controller=require(_0x4b0a('0x5'));router['get']('/',auth[_0x4b0a('0x6')](),controller['index']);router['get'](_0x4b0a('0x7'),auth['isAuthenticated'](),controller[_0x4b0a('0x8')]);router[_0x4b0a('0x9')]('/:id',auth[_0x4b0a('0x6')](),controller[_0x4b0a('0xa')]);router[_0x4b0a('0x9')](_0x4b0a('0xb'),auth[_0x4b0a('0x6')](),controller[_0x4b0a('0xc')]);router[_0x4b0a('0xd')]('/',auth['isAuthenticated'](),controller[_0x4b0a('0xe')]);router[_0x4b0a('0xf')](_0x4b0a('0x10'),auth['isAuthenticated'](),controller[_0x4b0a('0x11')]);router['delete']('/:id',auth[_0x4b0a('0x6')](),controller[_0x4b0a('0x12')]);module[_0x4b0a('0x13')]=router; \ No newline at end of file +var _0xb5f0=['destroy','exports','util','connect-timeout','express','Router','fs-extra','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/describe','/:id','show','/:id/questions','getQuestions','post','put','update'];(function(_0x5a4bd8,_0x585c86){var _0x7b2905=function(_0xe42b6c){while(--_0xe42b6c){_0x5a4bd8['push'](_0x5a4bd8['shift']());}};_0x7b2905(++_0x585c86);}(_0xb5f0,0x1a6));var _0x0b5f=function(_0x6a9946,_0x31c445){_0x6a9946=_0x6a9946-0x0;var _0x2c1145=_0xb5f0[_0x6a9946];return _0x2c1145;};'use strict';var multer=require('multer');var util=require(_0x0b5f('0x0'));var path=require('path');var timeout=require(_0x0b5f('0x1'));var express=require(_0x0b5f('0x2'));var router=express[_0x0b5f('0x3')]();var fs_extra=require(_0x0b5f('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0x0b5f('0x5'));var config=require(_0x0b5f('0x6'));var controller=require('./jscriptySessionReport.controller');router[_0x0b5f('0x7')]('/',auth[_0x0b5f('0x8')](),controller[_0x0b5f('0x9')]);router[_0x0b5f('0x7')](_0x0b5f('0xa'),auth[_0x0b5f('0x8')](),controller['describe']);router['get'](_0x0b5f('0xb'),auth['isAuthenticated'](),controller[_0x0b5f('0xc')]);router[_0x0b5f('0x7')](_0x0b5f('0xd'),auth[_0x0b5f('0x8')](),controller[_0x0b5f('0xe')]);router[_0x0b5f('0xf')]('/',auth['isAuthenticated'](),controller['create']);router[_0x0b5f('0x10')]('/:id',auth[_0x0b5f('0x8')](),controller[_0x0b5f('0x11')]);router['delete']('/:id',auth['isAuthenticated'](),controller[_0x0b5f('0x12')]);module[_0x0b5f('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 194e63b..b1df030 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 _0xacfb=['endtime','format','YYYY-MM-DD\x20HH:mm:ss','STRING','BOOLEAN','sequelize','DATE','setDataValue','starttime'];(function(_0x4a232c,_0x4db76b){var _0xb5807f=function(_0x2e1e16){while(--_0x2e1e16){_0x4a232c['push'](_0x4a232c['shift']());}};_0xb5807f(++_0x4db76b);}(_0xacfb,0x95));var _0xbacf=function(_0x57b10c,_0x5aa79d){_0x57b10c=_0x57b10c-0x0;var _0x1778ff=_0xacfb[_0x57b10c];return _0x1778ff;};'use strict';var moment=require('moment');var Sequelize=require(_0xbacf('0x0'));module['exports']={'starttime':{'type':Sequelize[_0xbacf('0x1')],'set':function(_0x44eb05){this[_0xbacf('0x2')](_0xbacf('0x3'),_0x44eb05);this[_0xbacf('0x2')](_0xbacf('0x4'),moment()[_0xbacf('0x5')](_0xbacf('0x6')));}},'endtime':{'type':Sequelize[_0xbacf('0x1')]},'membername':{'type':Sequelize[_0xbacf('0x7')]},'projectname':{'type':Sequelize['STRING']},'queue':{'type':Sequelize[_0xbacf('0x7')]},'uniqueid':{'type':Sequelize[_0xbacf('0x7')]},'calleridname':{'type':Sequelize['STRING']},'calleridnum':{'type':Sequelize[_0xbacf('0x7')]},'completed':{'type':Sequelize[_0xbacf('0x8')],'defaultValue':![]}}; \ No newline at end of file +var _0x3bed=['setDataValue','starttime','endtime','YYYY-MM-DD\x20HH:mm:ss','STRING','BOOLEAN','moment','sequelize','exports','DATE'];(function(_0x4a96d2,_0x689504){var _0x38af04=function(_0x3a67cd){while(--_0x3a67cd){_0x4a96d2['push'](_0x4a96d2['shift']());}};_0x38af04(++_0x689504);}(_0x3bed,0x11e));var _0xd3be=function(_0x3c7868,_0x228093){_0x3c7868=_0x3c7868-0x0;var _0x12e024=_0x3bed[_0x3c7868];return _0x12e024;};'use strict';var moment=require(_0xd3be('0x0'));var Sequelize=require(_0xd3be('0x1'));module[_0xd3be('0x2')]={'starttime':{'type':Sequelize[_0xd3be('0x3')],'set':function(_0x5642d0){this[_0xd3be('0x4')](_0xd3be('0x5'),_0x5642d0);this[_0xd3be('0x4')](_0xd3be('0x6'),moment()['format'](_0xd3be('0x7')));}},'endtime':{'type':Sequelize[_0xd3be('0x3')]},'membername':{'type':Sequelize[_0xd3be('0x8')]},'projectname':{'type':Sequelize[_0xd3be('0x8')]},'queue':{'type':Sequelize[_0xd3be('0x8')]},'uniqueid':{'type':Sequelize[_0xd3be('0x8')]},'calleridname':{'type':Sequelize[_0xd3be('0x8')]},'calleridnum':{'type':Sequelize[_0xd3be('0x8')]},'completed':{'type':Sequelize[_0xd3be('0x9')],'defaultValue':![]}}; \ No newline at end of file diff --git a/server/api/jscriptySessionReport/jscriptySessionReport.controller.js b/server/api/jscriptySessionReport/jscriptySessionReport.controller.js index 53587ce..87667e5 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 _0x7523=['fields','length','hasOwnProperty','order','sort','filter','where','merge','includeAll','JscriptySessionReport','catch','show','params','keys','options','find','create','body','describe','getQuestions','findOne','nolimit','SessionId','JscriptyQuestionReport','include','findAll','eml-format','zip-dir','fast-json-patch','request-promise','moment','sox','ejs','fs-extra','lodash','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','limit','undefined','count','set','Content-Range','apply','reject','update','then','destroy','error','stack','name','send','rawAttributes','fieldName','type','key','map','query','filters','intersection','model','attributes'];(function(_0x1a3396,_0x51bef0){var _0x1e8cc6=function(_0x56be40){while(--_0x56be40){_0x1a3396['push'](_0x1a3396['shift']());}};_0x1e8cc6(++_0x51bef0);}(_0x7523,0x104));var _0x3752=function(_0x53e740,_0xeb56c4){_0x53e740=_0x53e740-0x0;var _0xda0db6=_0x7523[_0x53e740];return _0xda0db6;};'use strict';var emlformat=require(_0x3752('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x3752('0x1'));var jsonpatch=require(_0x3752('0x2'));var rp=require(_0x3752('0x3'));var moment=require(_0x3752('0x4'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require('util');var path=require('path');var sox=require(_0x3752('0x5'));var csv=require('to-csv');var ejs=require(_0x3752('0x6'));var fs=require('fs');var fs_extra=require(_0x3752('0x7'));var _=require(_0x3752('0x8'));var squel=require(_0x3752('0x9'));var crypto=require('crypto');var jsforce=require(_0x3752('0xa'));var deskjs=require(_0x3752('0xb'));var toCsv=require('to-csv');var querystring=require(_0x3752('0xc'));var Papa=require(_0x3752('0xd'));var Redis=require(_0x3752('0xe'));var authService=require('../../components/auth/service');var qs=require(_0x3752('0xf'));var as=require(_0x3752('0x10'));var hardwareService=require(_0x3752('0x11'));var logger=require(_0x3752('0x12'))(_0x3752('0x13'));var utils=require(_0x3752('0x14'));var config=require('../../config/environment');var licenseUtil=require(_0x3752('0x15'));var db=require(_0x3752('0x16'))['db'];function respondWithStatusCode(_0x18038c,_0x24ab67){_0x24ab67=_0x24ab67||0xcc;return function(_0x7a4769){if(_0x7a4769){return _0x18038c[_0x3752('0x17')](_0x24ab67);}return _0x18038c[_0x3752('0x18')](_0x24ab67)[_0x3752('0x19')]();};}function respondWithResult(_0x42f623,_0x63e2e8){_0x63e2e8=_0x63e2e8||0xc8;return function(_0x1ef5f9){if(_0x1ef5f9){return _0x42f623['status'](_0x63e2e8)[_0x3752('0x1a')](_0x1ef5f9);}};}function respondWithFilteredResult(_0x1510de,_0x5e8948){return function(_0x3b86bc){if(_0x3b86bc){var _0x1a0288=typeof _0x5e8948[_0x3752('0x1b')]==='undefined'&&typeof _0x5e8948[_0x3752('0x1c')]===_0x3752('0x1d');var _0x21e4f2=_0x3b86bc['count'];var _0x51a31d=_0x1a0288?0x0:_0x5e8948[_0x3752('0x1b')];var _0x13ddff=_0x1a0288?_0x3b86bc[_0x3752('0x1e')]:_0x5e8948[_0x3752('0x1b')]+_0x5e8948[_0x3752('0x1c')];var _0x59f604;if(_0x13ddff>=_0x21e4f2){_0x13ddff=_0x21e4f2;_0x59f604=0xc8;}else{_0x59f604=0xce;}_0x1510de[_0x3752('0x18')](_0x59f604);return _0x1510de[_0x3752('0x1f')](_0x3752('0x20'),_0x51a31d+'-'+_0x13ddff+'/'+_0x21e4f2)[_0x3752('0x1a')](_0x3b86bc);}return null;};}function patchUpdates(_0x349ce6){return function(_0x4462d7){try{jsonpatch[_0x3752('0x21')](_0x4462d7,_0x349ce6,!![]);}catch(_0x17f8cc){return BPromise[_0x3752('0x22')](_0x17f8cc);}return _0x4462d7['save']();};}function saveUpdates(_0x31937c,_0x4e9644){return function(_0x2c82a2){if(_0x2c82a2){return _0x2c82a2[_0x3752('0x23')](_0x31937c)[_0x3752('0x24')](function(_0x5649e3){return _0x5649e3;});}return null;};}function removeEntity(_0x58ce26,_0x20a117){return function(_0x1ec571){if(_0x1ec571){return _0x1ec571[_0x3752('0x25')]()[_0x3752('0x24')](function(){_0x58ce26[_0x3752('0x18')](0xcc)[_0x3752('0x19')]();});}};}function handleEntityNotFound(_0x7b2676,_0x43cba9){return function(_0x31abe6){if(!_0x31abe6){_0x7b2676['sendStatus'](0x194);}return _0x31abe6;};}function handleError(_0x3127eb,_0x9df465){_0x9df465=_0x9df465||0x1f4;return function(_0x4838d3){logger[_0x3752('0x26')](_0x4838d3[_0x3752('0x27')]);if(_0x4838d3['name']){delete _0x4838d3[_0x3752('0x28')];}_0x3127eb[_0x3752('0x18')](_0x9df465)[_0x3752('0x29')](_0x4838d3);};}exports['index']=function(_0x2bed70,_0x5f484c){var _0x2401e1={},_0x368897={},_0xed157e={'count':0x0,'rows':[]};var _0x3e5c19=_['map'](db['JscriptySessionReport'][_0x3752('0x2a')],function(_0x2b8d3c){return{'name':_0x2b8d3c[_0x3752('0x2b')],'type':_0x2b8d3c[_0x3752('0x2c')][_0x3752('0x2d')]};});_0x368897['model']=_[_0x3752('0x2e')](_0x3e5c19,_0x3752('0x28'));_0x368897[_0x3752('0x2f')]=_['keys'](_0x2bed70[_0x3752('0x2f')]);_0x368897[_0x3752('0x30')]=_[_0x3752('0x31')](_0x368897[_0x3752('0x32')],_0x368897[_0x3752('0x2f')]);_0x2401e1[_0x3752('0x33')]=_['intersection'](_0x368897[_0x3752('0x32')],qs['fields'](_0x2bed70[_0x3752('0x2f')][_0x3752('0x34')]));_0x2401e1[_0x3752('0x33')]=_0x2401e1[_0x3752('0x33')][_0x3752('0x35')]?_0x2401e1['attributes']:_0x368897[_0x3752('0x32')];if(!_0x2bed70[_0x3752('0x2f')][_0x3752('0x36')]('nolimit')){_0x2401e1[_0x3752('0x1c')]=qs[_0x3752('0x1c')](_0x2bed70[_0x3752('0x2f')][_0x3752('0x1c')]);_0x2401e1[_0x3752('0x1b')]=qs[_0x3752('0x1b')](_0x2bed70['query'][_0x3752('0x1b')]);}_0x2401e1[_0x3752('0x37')]=qs['sort'](_0x2bed70[_0x3752('0x2f')][_0x3752('0x38')]);_0x2401e1['where']=qs[_0x3752('0x30')](_['pick'](_0x2bed70[_0x3752('0x2f')],_0x368897[_0x3752('0x30')]),_0x3e5c19);if(_0x2bed70[_0x3752('0x2f')][_0x3752('0x39')]){_0x2401e1[_0x3752('0x3a')]=_['merge'](_0x2401e1[_0x3752('0x3a')],{'$or':_['map'](_0x3e5c19,function(_0x4212cc){if(_0x4212cc[_0x3752('0x2c')]!=='VIRTUAL'){var _0x1732ff={};_0x1732ff[_0x4212cc[_0x3752('0x28')]]={'$like':'%'+_0x2bed70['query']['filter']+'%'};return _0x1732ff;}})});}_0x2401e1=_[_0x3752('0x3b')]({},_0x2401e1,_0x2bed70['options']);var _0x3bbbd1={'where':_0x2401e1['where']};return db['JscriptySessionReport'][_0x3752('0x1e')](_0x3bbbd1)[_0x3752('0x24')](function(_0x1b9a7c){_0xed157e[_0x3752('0x1e')]=_0x1b9a7c;if(_0x2bed70[_0x3752('0x2f')][_0x3752('0x3c')]){_0x2401e1['include']=[{'all':!![]}];}return db[_0x3752('0x3d')]['findAll'](_0x2401e1);})['then'](function(_0x3c7b36){_0xed157e['rows']=_0x3c7b36;return _0xed157e;})['then'](respondWithFilteredResult(_0x5f484c,_0x2401e1))[_0x3752('0x3e')](handleError(_0x5f484c,null));};exports[_0x3752('0x3f')]=function(_0x15d42a,_0x4a885c){var _0x565446={'raw':!![],'where':{'id':_0x15d42a[_0x3752('0x40')]['id']}},_0x15458d={};_0x15458d[_0x3752('0x32')]=_[_0x3752('0x41')](db[_0x3752('0x3d')][_0x3752('0x2a')]);_0x15458d[_0x3752('0x2f')]=_[_0x3752('0x41')](_0x15d42a[_0x3752('0x2f')]);_0x15458d[_0x3752('0x30')]=_['intersection'](_0x15458d[_0x3752('0x32')],_0x15458d[_0x3752('0x2f')]);_0x565446[_0x3752('0x33')]=_['intersection'](_0x15458d[_0x3752('0x32')],qs[_0x3752('0x34')](_0x15d42a['query'][_0x3752('0x34')]));_0x565446[_0x3752('0x33')]=_0x565446['attributes'][_0x3752('0x35')]?_0x565446['attributes']:_0x15458d['model'];if(_0x15d42a[_0x3752('0x2f')]['includeAll']){_0x565446['include']=[{'all':!![]}];}_0x565446=_[_0x3752('0x3b')]({},_0x565446,_0x15d42a[_0x3752('0x42')]);return db[_0x3752('0x3d')][_0x3752('0x43')](_0x565446)['then'](handleEntityNotFound(_0x4a885c,null))['then'](respondWithResult(_0x4a885c,null))['catch'](handleError(_0x4a885c,null));};exports['create']=function(_0x2780d9,_0x4b3ef0){return db[_0x3752('0x3d')][_0x3752('0x44')](_0x2780d9[_0x3752('0x45')],{})[_0x3752('0x24')](respondWithResult(_0x4b3ef0,0xc9))[_0x3752('0x3e')](handleError(_0x4b3ef0,null));};exports['update']=function(_0x205f7c,_0x59fdba){if(_0x205f7c[_0x3752('0x45')]['id']){delete _0x205f7c['body']['id'];}return db[_0x3752('0x3d')]['find']({'where':{'id':_0x205f7c[_0x3752('0x40')]['id']}})['then'](handleEntityNotFound(_0x59fdba,null))['then'](saveUpdates(_0x205f7c[_0x3752('0x45')],null))[_0x3752('0x24')](respondWithResult(_0x59fdba,null))['catch'](handleError(_0x59fdba,null));};exports[_0x3752('0x25')]=function(_0x5854e9,_0x1ca909){return db['JscriptySessionReport'][_0x3752('0x43')]({'where':{'id':_0x5854e9['params']['id']}})[_0x3752('0x24')](handleEntityNotFound(_0x1ca909,null))[_0x3752('0x24')](removeEntity(_0x1ca909,null))['catch'](handleError(_0x1ca909,null));};exports[_0x3752('0x46')]=function(_0x12d966,_0x5a8a4c){return db[_0x3752('0x3d')][_0x3752('0x46')]()['then'](respondWithResult(_0x5a8a4c,null))[_0x3752('0x3e')](handleError(_0x5a8a4c,null));};exports[_0x3752('0x47')]=function(_0x437fa0,_0x2a3e58,_0x557244){var _0x4ddb63={'raw':!![],'where':{}};var _0x59b192={};var _0x5b7235={'count':0x0,'rows':[]};return db[_0x3752('0x3d')][_0x3752('0x48')]({'where':{'id':_0x437fa0[_0x3752('0x40')]['id']}})['then'](handleEntityNotFound(_0x2a3e58,null))[_0x3752('0x24')](function(_0x45d33c){if(_0x45d33c){_0x59b192[_0x3752('0x32')]=_[_0x3752('0x41')](db['JscriptyQuestionReport']['rawAttributes']);_0x59b192[_0x3752('0x2f')]=_[_0x3752('0x41')](_0x437fa0[_0x3752('0x2f')]);_0x59b192[_0x3752('0x30')]=_[_0x3752('0x31')](_0x59b192['model'],_0x59b192[_0x3752('0x2f')]);_0x4ddb63[_0x3752('0x33')]=_['intersection'](_0x59b192[_0x3752('0x32')],qs[_0x3752('0x34')](_0x437fa0[_0x3752('0x2f')][_0x3752('0x34')]));_0x4ddb63['attributes']=_0x4ddb63[_0x3752('0x33')][_0x3752('0x35')]?_0x4ddb63[_0x3752('0x33')]:_0x59b192[_0x3752('0x32')];if(!_0x437fa0[_0x3752('0x2f')][_0x3752('0x36')](_0x3752('0x49'))){_0x4ddb63[_0x3752('0x1c')]=qs[_0x3752('0x1c')](_0x437fa0[_0x3752('0x2f')][_0x3752('0x1c')]);_0x4ddb63[_0x3752('0x1b')]=qs['offset'](_0x437fa0['query'][_0x3752('0x1b')]);}_0x4ddb63[_0x3752('0x37')]=qs['sort'](_0x437fa0[_0x3752('0x2f')][_0x3752('0x38')]);_0x4ddb63[_0x3752('0x3a')]=qs[_0x3752('0x30')](_['pick'](_0x437fa0['query'],_0x59b192[_0x3752('0x30')]));_0x4ddb63[_0x3752('0x3a')][_0x3752('0x4a')]=_0x45d33c['id'];if(_0x437fa0[_0x3752('0x2f')][_0x3752('0x39')]){_0x4ddb63[_0x3752('0x3a')]=_[_0x3752('0x3b')](_0x4ddb63[_0x3752('0x3a')],{'$or':_['map'](_0x4ddb63[_0x3752('0x33')],function(_0x1b3a0e){var _0x46f334={};_0x46f334[_0x1b3a0e]={'$like':'%'+_0x437fa0['query'][_0x3752('0x39')]+'%'};return _0x46f334;})});}_0x4ddb63=_['merge']({},_0x4ddb63,_0x437fa0[_0x3752('0x42')]);return db[_0x3752('0x4b')][_0x3752('0x1e')]({'where':_0x4ddb63[_0x3752('0x3a')]})[_0x3752('0x24')](function(_0x3ae324){_0x5b7235[_0x3752('0x1e')]=_0x3ae324;if(_0x437fa0[_0x3752('0x2f')][_0x3752('0x3c')]){_0x4ddb63[_0x3752('0x4c')]=[{'all':!![]}];}return db[_0x3752('0x4b')][_0x3752('0x4d')](_0x4ddb63);})['then'](function(_0x4507c7){_0x5b7235['rows']=_0x4507c7;return _0x5b7235;});}})['then'](respondWithFilteredResult(_0x2a3e58,_0x4ddb63))['catch'](handleError(_0x2a3e58,null));}; \ No newline at end of file +var _0x14d0=['../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','end','status','json','offset','undefined','count','Content-Range','apply','reject','update','then','destroy','error','stack','name','send','index','JscriptySessionReport','rawAttributes','type','key','model','map','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','limit','order','sort','where','pick','filter','merge','VIRTUAL','options','include','findAll','catch','show','params','keys','includeAll','find','create','body','describe','getQuestions','SessionId','JscriptyQuestionReport','rows','eml-format','zip-dir','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','fs-extra','lodash','squel','crypto','jsforce','querystring','ioredis'];(function(_0x42e596,_0x31cb2d){var _0x2d79ef=function(_0x5e60f0){while(--_0x5e60f0){_0x42e596['push'](_0x42e596['shift']());}};_0x2d79ef(++_0x31cb2d);}(_0x14d0,0x137));var _0x014d=function(_0x3124f8,_0x1a8b23){_0x3124f8=_0x3124f8-0x0;var _0x5bab5f=_0x14d0[_0x3124f8];return _0x5bab5f;};'use strict';var emlformat=require(_0x014d('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x014d('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0x014d('0x2'));var moment=require(_0x014d('0x3'));var BPromise=require(_0x014d('0x4'));var Mustache=require(_0x014d('0x5'));var util=require(_0x014d('0x6'));var path=require(_0x014d('0x7'));var sox=require(_0x014d('0x8'));var csv=require(_0x014d('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x014d('0xa'));var _=require(_0x014d('0xb'));var squel=require(_0x014d('0xc'));var crypto=require(_0x014d('0xd'));var jsforce=require(_0x014d('0xe'));var deskjs=require('desk.js');var toCsv=require(_0x014d('0x9'));var querystring=require(_0x014d('0xf'));var Papa=require('papaparse');var Redis=require(_0x014d('0x10'));var authService=require(_0x014d('0x11'));var qs=require(_0x014d('0x12'));var as=require(_0x014d('0x13'));var hardwareService=require(_0x014d('0x14'));var logger=require(_0x014d('0x15'))('api');var utils=require(_0x014d('0x16'));var config=require(_0x014d('0x17'));var licenseUtil=require(_0x014d('0x18'));var db=require(_0x014d('0x19'))['db'];function respondWithStatusCode(_0x398cbd,_0x566ccc){_0x566ccc=_0x566ccc||0xcc;return function(_0x42e5c0){if(_0x42e5c0){return _0x398cbd[_0x014d('0x1a')](_0x566ccc);}return _0x398cbd['status'](_0x566ccc)[_0x014d('0x1b')]();};}function respondWithResult(_0x1618d8,_0x4f4924){_0x4f4924=_0x4f4924||0xc8;return function(_0x5567bd){if(_0x5567bd){return _0x1618d8[_0x014d('0x1c')](_0x4f4924)[_0x014d('0x1d')](_0x5567bd);}};}function respondWithFilteredResult(_0x571cf1,_0x2557a1){return function(_0x504240){if(_0x504240){var _0x18581c=typeof _0x2557a1[_0x014d('0x1e')]===_0x014d('0x1f')&&typeof _0x2557a1['limit']===_0x014d('0x1f');var _0x2270df=_0x504240[_0x014d('0x20')];var _0x455685=_0x18581c?0x0:_0x2557a1[_0x014d('0x1e')];var _0x39e1aa=_0x18581c?_0x504240[_0x014d('0x20')]:_0x2557a1[_0x014d('0x1e')]+_0x2557a1['limit'];var _0x282f36;if(_0x39e1aa>=_0x2270df){_0x39e1aa=_0x2270df;_0x282f36=0xc8;}else{_0x282f36=0xce;}_0x571cf1[_0x014d('0x1c')](_0x282f36);return _0x571cf1['set'](_0x014d('0x21'),_0x455685+'-'+_0x39e1aa+'/'+_0x2270df)['json'](_0x504240);}return null;};}function patchUpdates(_0x4f65f4){return function(_0x5c7de3){try{jsonpatch[_0x014d('0x22')](_0x5c7de3,_0x4f65f4,!![]);}catch(_0x14a4b4){return BPromise[_0x014d('0x23')](_0x14a4b4);}return _0x5c7de3['save']();};}function saveUpdates(_0x4ac4fa,_0x1d85bc){return function(_0x269d36){if(_0x269d36){return _0x269d36[_0x014d('0x24')](_0x4ac4fa)[_0x014d('0x25')](function(_0x3421bf){return _0x3421bf;});}return null;};}function removeEntity(_0x310126,_0x8ab0be){return function(_0x3c6d75){if(_0x3c6d75){return _0x3c6d75[_0x014d('0x26')]()[_0x014d('0x25')](function(){_0x310126[_0x014d('0x1c')](0xcc)[_0x014d('0x1b')]();});}};}function handleEntityNotFound(_0x493d8f,_0x48f776){return function(_0x1169b3){if(!_0x1169b3){_0x493d8f['sendStatus'](0x194);}return _0x1169b3;};}function handleError(_0x488a53,_0x513054){_0x513054=_0x513054||0x1f4;return function(_0x27763f){logger[_0x014d('0x27')](_0x27763f[_0x014d('0x28')]);if(_0x27763f[_0x014d('0x29')]){delete _0x27763f[_0x014d('0x29')];}_0x488a53[_0x014d('0x1c')](_0x513054)[_0x014d('0x2a')](_0x27763f);};}exports[_0x014d('0x2b')]=function(_0x531c36,_0x38ac3e){var _0x4de580={},_0x326a44={},_0x1ced37={'count':0x0,'rows':[]};var _0xaa3459=_['map'](db[_0x014d('0x2c')][_0x014d('0x2d')],function(_0x4dc9fb){return{'name':_0x4dc9fb['fieldName'],'type':_0x4dc9fb[_0x014d('0x2e')][_0x014d('0x2f')]};});_0x326a44[_0x014d('0x30')]=_[_0x014d('0x31')](_0xaa3459,'name');_0x326a44['query']=_['keys'](_0x531c36[_0x014d('0x32')]);_0x326a44[_0x014d('0x33')]=_[_0x014d('0x34')](_0x326a44[_0x014d('0x30')],_0x326a44[_0x014d('0x32')]);_0x4de580[_0x014d('0x35')]=_['intersection'](_0x326a44[_0x014d('0x30')],qs[_0x014d('0x36')](_0x531c36[_0x014d('0x32')][_0x014d('0x36')]));_0x4de580[_0x014d('0x35')]=_0x4de580[_0x014d('0x35')][_0x014d('0x37')]?_0x4de580[_0x014d('0x35')]:_0x326a44[_0x014d('0x30')];if(!_0x531c36['query'][_0x014d('0x38')](_0x014d('0x39'))){_0x4de580[_0x014d('0x3a')]=qs[_0x014d('0x3a')](_0x531c36['query'][_0x014d('0x3a')]);_0x4de580[_0x014d('0x1e')]=qs[_0x014d('0x1e')](_0x531c36['query'][_0x014d('0x1e')]);}_0x4de580[_0x014d('0x3b')]=qs[_0x014d('0x3c')](_0x531c36[_0x014d('0x32')]['sort']);_0x4de580[_0x014d('0x3d')]=qs['filters'](_[_0x014d('0x3e')](_0x531c36[_0x014d('0x32')],_0x326a44[_0x014d('0x33')]),_0xaa3459);if(_0x531c36[_0x014d('0x32')][_0x014d('0x3f')]){_0x4de580[_0x014d('0x3d')]=_[_0x014d('0x40')](_0x4de580['where'],{'$or':_[_0x014d('0x31')](_0xaa3459,function(_0x60360d){if(_0x60360d[_0x014d('0x2e')]!==_0x014d('0x41')){var _0x42c59e={};_0x42c59e[_0x60360d['name']]={'$like':'%'+_0x531c36['query'][_0x014d('0x3f')]+'%'};return _0x42c59e;}})});}_0x4de580=_[_0x014d('0x40')]({},_0x4de580,_0x531c36[_0x014d('0x42')]);var _0x2bf79c={'where':_0x4de580[_0x014d('0x3d')]};return db[_0x014d('0x2c')][_0x014d('0x20')](_0x2bf79c)[_0x014d('0x25')](function(_0x131c93){_0x1ced37['count']=_0x131c93;if(_0x531c36[_0x014d('0x32')]['includeAll']){_0x4de580[_0x014d('0x43')]=[{'all':!![]}];}return db[_0x014d('0x2c')][_0x014d('0x44')](_0x4de580);})['then'](function(_0x5e3afa){_0x1ced37['rows']=_0x5e3afa;return _0x1ced37;})['then'](respondWithFilteredResult(_0x38ac3e,_0x4de580))[_0x014d('0x45')](handleError(_0x38ac3e,null));};exports[_0x014d('0x46')]=function(_0x23b97a,_0x10c37b){var _0x39a4ff={'raw':!![],'where':{'id':_0x23b97a[_0x014d('0x47')]['id']}},_0x1ff303={};_0x1ff303['model']=_[_0x014d('0x48')](db[_0x014d('0x2c')][_0x014d('0x2d')]);_0x1ff303['query']=_[_0x014d('0x48')](_0x23b97a[_0x014d('0x32')]);_0x1ff303[_0x014d('0x33')]=_[_0x014d('0x34')](_0x1ff303[_0x014d('0x30')],_0x1ff303[_0x014d('0x32')]);_0x39a4ff[_0x014d('0x35')]=_[_0x014d('0x34')](_0x1ff303['model'],qs['fields'](_0x23b97a[_0x014d('0x32')][_0x014d('0x36')]));_0x39a4ff[_0x014d('0x35')]=_0x39a4ff[_0x014d('0x35')][_0x014d('0x37')]?_0x39a4ff[_0x014d('0x35')]:_0x1ff303['model'];if(_0x23b97a[_0x014d('0x32')][_0x014d('0x49')]){_0x39a4ff['include']=[{'all':!![]}];}_0x39a4ff=_[_0x014d('0x40')]({},_0x39a4ff,_0x23b97a[_0x014d('0x42')]);return db['JscriptySessionReport'][_0x014d('0x4a')](_0x39a4ff)[_0x014d('0x25')](handleEntityNotFound(_0x10c37b,null))[_0x014d('0x25')](respondWithResult(_0x10c37b,null))['catch'](handleError(_0x10c37b,null));};exports[_0x014d('0x4b')]=function(_0x2f336b,_0x4a4b00){return db[_0x014d('0x2c')][_0x014d('0x4b')](_0x2f336b[_0x014d('0x4c')],{})['then'](respondWithResult(_0x4a4b00,0xc9))[_0x014d('0x45')](handleError(_0x4a4b00,null));};exports[_0x014d('0x24')]=function(_0x473a5e,_0x51eeb5){if(_0x473a5e[_0x014d('0x4c')]['id']){delete _0x473a5e[_0x014d('0x4c')]['id'];}return db[_0x014d('0x2c')]['find']({'where':{'id':_0x473a5e[_0x014d('0x47')]['id']}})['then'](handleEntityNotFound(_0x51eeb5,null))[_0x014d('0x25')](saveUpdates(_0x473a5e['body'],null))[_0x014d('0x25')](respondWithResult(_0x51eeb5,null))[_0x014d('0x45')](handleError(_0x51eeb5,null));};exports[_0x014d('0x26')]=function(_0xdea757,_0xc914ac){return db[_0x014d('0x2c')][_0x014d('0x4a')]({'where':{'id':_0xdea757[_0x014d('0x47')]['id']}})[_0x014d('0x25')](handleEntityNotFound(_0xc914ac,null))[_0x014d('0x25')](removeEntity(_0xc914ac,null))[_0x014d('0x45')](handleError(_0xc914ac,null));};exports[_0x014d('0x4d')]=function(_0x2d2c77,_0x2b8844){return db[_0x014d('0x2c')][_0x014d('0x4d')]()[_0x014d('0x25')](respondWithResult(_0x2b8844,null))[_0x014d('0x45')](handleError(_0x2b8844,null));};exports[_0x014d('0x4e')]=function(_0x1a8522,_0x4178e7,_0x488d5b){var _0x350d86={'raw':!![],'where':{}};var _0x2d33e1={};var _0x246a0d={'count':0x0,'rows':[]};return db['JscriptySessionReport']['findOne']({'where':{'id':_0x1a8522['params']['id']}})[_0x014d('0x25')](handleEntityNotFound(_0x4178e7,null))[_0x014d('0x25')](function(_0x45261e){if(_0x45261e){_0x2d33e1['model']=_['keys'](db['JscriptyQuestionReport']['rawAttributes']);_0x2d33e1[_0x014d('0x32')]=_['keys'](_0x1a8522[_0x014d('0x32')]);_0x2d33e1[_0x014d('0x33')]=_[_0x014d('0x34')](_0x2d33e1[_0x014d('0x30')],_0x2d33e1[_0x014d('0x32')]);_0x350d86[_0x014d('0x35')]=_[_0x014d('0x34')](_0x2d33e1[_0x014d('0x30')],qs[_0x014d('0x36')](_0x1a8522['query'][_0x014d('0x36')]));_0x350d86[_0x014d('0x35')]=_0x350d86['attributes'][_0x014d('0x37')]?_0x350d86['attributes']:_0x2d33e1[_0x014d('0x30')];if(!_0x1a8522[_0x014d('0x32')][_0x014d('0x38')](_0x014d('0x39'))){_0x350d86[_0x014d('0x3a')]=qs[_0x014d('0x3a')](_0x1a8522[_0x014d('0x32')][_0x014d('0x3a')]);_0x350d86['offset']=qs['offset'](_0x1a8522[_0x014d('0x32')][_0x014d('0x1e')]);}_0x350d86['order']=qs[_0x014d('0x3c')](_0x1a8522[_0x014d('0x32')][_0x014d('0x3c')]);_0x350d86[_0x014d('0x3d')]=qs[_0x014d('0x33')](_[_0x014d('0x3e')](_0x1a8522[_0x014d('0x32')],_0x2d33e1['filters']));_0x350d86[_0x014d('0x3d')][_0x014d('0x4f')]=_0x45261e['id'];if(_0x1a8522['query'][_0x014d('0x3f')]){_0x350d86['where']=_[_0x014d('0x40')](_0x350d86[_0x014d('0x3d')],{'$or':_['map'](_0x350d86[_0x014d('0x35')],function(_0x116331){var _0x566af2={};_0x566af2[_0x116331]={'$like':'%'+_0x1a8522['query'][_0x014d('0x3f')]+'%'};return _0x566af2;})});}_0x350d86=_[_0x014d('0x40')]({},_0x350d86,_0x1a8522[_0x014d('0x42')]);return db[_0x014d('0x50')][_0x014d('0x20')]({'where':_0x350d86[_0x014d('0x3d')]})[_0x014d('0x25')](function(_0xffde91){_0x246a0d[_0x014d('0x20')]=_0xffde91;if(_0x1a8522[_0x014d('0x32')][_0x014d('0x49')]){_0x350d86[_0x014d('0x43')]=[{'all':!![]}];}return db[_0x014d('0x50')]['findAll'](_0x350d86);})[_0x014d('0x25')](function(_0x2213f6){_0x246a0d[_0x014d('0x51')]=_0x2213f6;return _0x246a0d;});}})[_0x014d('0x25')](respondWithFilteredResult(_0x4178e7,_0x350d86))['catch'](handleError(_0x4178e7,null));}; \ No newline at end of file diff --git a/server/api/jscriptySessionReport/jscriptySessionReport.model.js b/server/api/jscriptySessionReport/jscriptySessionReport.model.js index ee87d80..3fe1b6c 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 _0x8f9d=['define','JscriptySessionReport','report_jscripty_sessions','lodash','../../config/logger','moment','bluebird','request-promise','path','rimraf','../../config/environment','./jscriptySessionReport.attributes'];(function(_0x46add2,_0x4346d4){var _0x226d64=function(_0x11ae18){while(--_0x11ae18){_0x46add2['push'](_0x46add2['shift']());}};_0x226d64(++_0x4346d4);}(_0x8f9d,0x93));var _0xd8f9=function(_0x4a9fb1,_0x273043){_0x4a9fb1=_0x4a9fb1-0x0;var _0x348672=_0x8f9d[_0x4a9fb1];return _0x348672;};'use strict';var _=require(_0xd8f9('0x0'));var util=require('util');var logger=require(_0xd8f9('0x1'))('api');var moment=require(_0xd8f9('0x2'));var BPromise=require(_0xd8f9('0x3'));var rp=require(_0xd8f9('0x4'));var fs=require('fs');var path=require(_0xd8f9('0x5'));var rimraf=require(_0xd8f9('0x6'));var config=require(_0xd8f9('0x7'));var attributes=require(_0xd8f9('0x8'));module['exports']=function(_0x1c37be,_0x24dd1e){return _0x1c37be[_0xd8f9('0x9')](_0xd8f9('0xa'),attributes,{'tableName':_0xd8f9('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xb138=['api','moment','bluebird','request-promise','rimraf','../../config/environment','./jscriptySessionReport.attributes','JscriptySessionReport','report_jscripty_sessions','lodash','util','../../config/logger'];(function(_0x1c6b26,_0x21491c){var _0x8b0baf=function(_0x41bfd6){while(--_0x41bfd6){_0x1c6b26['push'](_0x1c6b26['shift']());}};_0x8b0baf(++_0x21491c);}(_0xb138,0x1dd));var _0x8b13=function(_0x1f0e4a,_0x44079d){_0x1f0e4a=_0x1f0e4a-0x0;var _0x5b92df=_0xb138[_0x1f0e4a];return _0x5b92df;};'use strict';var _=require(_0x8b13('0x0'));var util=require(_0x8b13('0x1'));var logger=require(_0x8b13('0x2'))(_0x8b13('0x3'));var moment=require(_0x8b13('0x4'));var BPromise=require(_0x8b13('0x5'));var rp=require(_0x8b13('0x6'));var fs=require('fs');var path=require('path');var rimraf=require(_0x8b13('0x7'));var config=require(_0x8b13('0x8'));var attributes=require(_0x8b13('0x9'));module['exports']=function(_0xd19a0f,_0x13f7bd){return _0xd19a0f['define'](_0x8b13('0xa'),attributes,{'tableName':_0x8b13('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 fac8679..a723063 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 _0x5204=['rpc','jayson/promise','client','http','request','info','JscriptySessionReport,\x20%s,\x20%s','request\x20sent','debug','JscriptySessionReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0x5204,0xdf));var _0x4520=function(_0x5db99b,_0xdee23a){_0x5db99b=_0x5db99b-0x0;var _0x4b2d0e=_0x5204[_0x5db99b];return _0x4b2d0e;};'use strict';var _=require(_0x4520('0x0'));var util=require(_0x4520('0x1'));var moment=require('moment');var BPromise=require(_0x4520('0x2'));var rs=require(_0x4520('0x3'));var fs=require('fs');var Redis=require(_0x4520('0x4'));var db=require(_0x4520('0x5'))['db'];var utils=require(_0x4520('0x6'));var logger=require('../../config/logger')(_0x4520('0x7'));var config=require('../../config/environment');var jayson=require(_0x4520('0x8'));var client=jayson[_0x4520('0x9')][_0x4520('0xa')]({'port':0x232a});function respondWithRpcPromise(_0xe741c2,_0x396d29,_0x446dc9){return new BPromise(function(_0x27890f,_0x55b44f){return client[_0x4520('0xb')](_0xe741c2,_0x446dc9)['then'](function(_0x168e62){logger[_0x4520('0xc')](_0x4520('0xd'),_0x396d29,_0x4520('0xe'));logger[_0x4520('0xf')](_0x4520('0x10'),_0x396d29,_0x4520('0xe'),JSON[_0x4520('0x11')](_0x168e62));if(_0x168e62[_0x4520('0x12')]){if(_0x168e62[_0x4520('0x12')][_0x4520('0x13')]===0x1f4){logger[_0x4520('0x12')](_0x4520('0xd'),_0x396d29,_0x168e62[_0x4520('0x12')][_0x4520('0x14')]);return _0x55b44f(_0x168e62[_0x4520('0x12')][_0x4520('0x14')]);}logger[_0x4520('0x12')](_0x4520('0xd'),_0x396d29,_0x168e62[_0x4520('0x12')][_0x4520('0x14')]);return _0x27890f(_0x168e62['error'][_0x4520('0x14')]);}else{logger[_0x4520('0xc')](_0x4520('0xd'),_0x396d29,_0x4520('0xe'));_0x27890f(_0x168e62[_0x4520('0x15')]['message']);}})[_0x4520('0x16')](function(_0x33ac29){logger[_0x4520('0x12')](_0x4520('0xd'),_0x396d29,_0x33ac29);_0x55b44f(_0x33ac29);});});} \ No newline at end of file +var _0x958a=['randomstring','ioredis','../../mysqldb','../../config/utils','rpc','jayson/promise','client','http','then','info','JscriptySessionReport,\x20%s,\x20%s','request\x20sent','debug','JscriptySessionReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','lodash','util','bluebird'];(function(_0x3f9e1a,_0x3964c2){var _0x5a3e0e=function(_0x18344e){while(--_0x18344e){_0x3f9e1a['push'](_0x3f9e1a['shift']());}};_0x5a3e0e(++_0x3964c2);}(_0x958a,0x128));var _0xa958=function(_0x391f94,_0x48e529){_0x391f94=_0x391f94-0x0;var _0x321871=_0x958a[_0x391f94];return _0x321871;};'use strict';var _=require(_0xa958('0x0'));var util=require(_0xa958('0x1'));var moment=require('moment');var BPromise=require(_0xa958('0x2'));var rs=require(_0xa958('0x3'));var fs=require('fs');var Redis=require(_0xa958('0x4'));var db=require(_0xa958('0x5'))['db'];var utils=require(_0xa958('0x6'));var logger=require('../../config/logger')(_0xa958('0x7'));var config=require('../../config/environment');var jayson=require(_0xa958('0x8'));var client=jayson[_0xa958('0x9')][_0xa958('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x3ddaa9,_0x3ca01f,_0x3b2693){return new BPromise(function(_0x1895da,_0x54c0e0){return client['request'](_0x3ddaa9,_0x3b2693)[_0xa958('0xb')](function(_0x249764){logger[_0xa958('0xc')](_0xa958('0xd'),_0x3ca01f,_0xa958('0xe'));logger[_0xa958('0xf')](_0xa958('0x10'),_0x3ca01f,_0xa958('0xe'),JSON[_0xa958('0x11')](_0x249764));if(_0x249764[_0xa958('0x12')]){if(_0x249764[_0xa958('0x12')][_0xa958('0x13')]===0x1f4){logger[_0xa958('0x12')]('JscriptySessionReport,\x20%s,\x20%s',_0x3ca01f,_0x249764['error']['message']);return _0x54c0e0(_0x249764[_0xa958('0x12')][_0xa958('0x14')]);}logger[_0xa958('0x12')]('JscriptySessionReport,\x20%s,\x20%s',_0x3ca01f,_0x249764[_0xa958('0x12')]['message']);return _0x1895da(_0x249764['error']['message']);}else{logger[_0xa958('0xc')](_0xa958('0xd'),_0x3ca01f,_0xa958('0xe'));_0x1895da(_0x249764[_0xa958('0x15')][_0xa958('0x14')]);}})[_0xa958('0x16')](function(_0x23736f){logger[_0xa958('0x12')]('JscriptySessionReport,\x20%s,\x20%s',_0x3ca01f,_0x23736f);_0x54c0e0(_0x23736f);});});} \ No newline at end of file diff --git a/server/api/license/index.js b/server/api/license/index.js index acef3a8..d5d02cc 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 _0xc8db=['express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','index','put','/:id','isAuthenticated','get','/download_log_file','exports','multer','path','connect-timeout'];(function(_0x44c824,_0x19dd71){var _0x33e86b=function(_0x26a098){while(--_0x26a098){_0x44c824['push'](_0x44c824['shift']());}};_0x33e86b(++_0x19dd71);}(_0xc8db,0xed));var _0xbc8d=function(_0x5d6456,_0x58ecc7){_0x5d6456=_0x5d6456-0x0;var _0x4d66c1=_0xc8db[_0x5d6456];return _0x4d66c1;};'use strict';var multer=require(_0xbc8d('0x0'));var util=require('util');var path=require(_0xbc8d('0x1'));var timeout=require(_0xbc8d('0x2'));var express=require(_0xbc8d('0x3'));var router=express[_0xbc8d('0x4')]();var fs_extra=require(_0xbc8d('0x5'));var auth=require(_0xbc8d('0x6'));var interaction=require(_0xbc8d('0x7'));var config=require(_0xbc8d('0x8'));var controller=require('./license.controller');router['get']('/',controller[_0xbc8d('0x9')]);router[_0xbc8d('0xa')](_0xbc8d('0xb'),auth[_0xbc8d('0xc')](),controller['update']);router[_0xbc8d('0xd')](_0xbc8d('0xe'),auth[_0xbc8d('0xc')](),controller['downloadLogFile']);module[_0xbc8d('0xf')]=router; \ No newline at end of file +var _0xf8fe=['index','/:id','update','get','/download_log_file','isAuthenticated','exports','multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service'];(function(_0x1a28ee,_0x103ece){var _0xd44a61=function(_0x1d0a76){while(--_0x1d0a76){_0x1a28ee['push'](_0x1a28ee['shift']());}};_0xd44a61(++_0x103ece);}(_0xf8fe,0x1d8));var _0xef8f=function(_0x14ee4f,_0x3de84b){_0x14ee4f=_0x14ee4f-0x0;var _0x2a2a49=_0xf8fe[_0x14ee4f];return _0x2a2a49;};'use strict';var multer=require(_0xef8f('0x0'));var util=require(_0xef8f('0x1'));var path=require(_0xef8f('0x2'));var timeout=require(_0xef8f('0x3'));var express=require(_0xef8f('0x4'));var router=express[_0xef8f('0x5')]();var fs_extra=require('fs-extra');var auth=require(_0xef8f('0x6'));var interaction=require(_0xef8f('0x7'));var config=require('../../config/environment');var controller=require('./license.controller');router['get']('/',controller[_0xef8f('0x8')]);router['put'](_0xef8f('0x9'),auth['isAuthenticated'](),controller[_0xef8f('0xa')]);router[_0xef8f('0xb')](_0xef8f('0xc'),auth[_0xef8f('0xd')](),controller['downloadLogFile']);module[_0xef8f('0xe')]=router; \ No newline at end of file diff --git a/server/api/license/license.attributes.js b/server/api/license/license.attributes.js index 528e3c6..62ae54f 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 _0x8ee8=['STRING','exports'];(function(_0x18901b,_0xb5473e){var _0x489aa7=function(_0x267cf1){while(--_0x267cf1){_0x18901b['push'](_0x18901b['shift']());}};_0x489aa7(++_0xb5473e);}(_0x8ee8,0xd9));var _0x88ee=function(_0x215dc8,_0x52c245){_0x215dc8=_0x215dc8-0x0;var _0x583ea3=_0x8ee8[_0x215dc8];return _0x583ea3;};'use strict';var Sequelize=require('sequelize');module[_0x88ee('0x0')]={'license':{'type':Sequelize['TEXT']},'data1':{'type':Sequelize[_0x88ee('0x1')]},'data2':{'type':Sequelize['STRING']},'chatLicenseExceeded':{'type':Sequelize['INTEGER'],'defaultValue':0x0}}; \ No newline at end of file +var _0x0561=['TEXT','STRING','INTEGER','sequelize','exports'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x0561,0xa8));var _0x1056=function(_0x80e5d1,_0x16924f){_0x80e5d1=_0x80e5d1-0x0;var _0x3c7f2b=_0x0561[_0x80e5d1];return _0x3c7f2b;};'use strict';var Sequelize=require(_0x1056('0x0'));module[_0x1056('0x1')]={'license':{'type':Sequelize[_0x1056('0x2')]},'data1':{'type':Sequelize[_0x1056('0x3')]},'data2':{'type':Sequelize['STRING']},'chatLicenseExceeded':{'type':Sequelize[_0x1056('0x4')],'defaultValue':0x0}}; \ No newline at end of file diff --git a/server/api/license/license.controller.js b/server/api/license/license.controller.js index 22fb3bf..d9e628f 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 _0xdb53=['../../config/utils','../../config/environment','../../config/license/util','status','end','json','offset','undefined','limit','count','Content-Range','apply','reject','save','update','destroy','then','sendStatus','error','stack','send','index','model','rawAttributes','query','keys','filters','intersection','attributes','fields','length','merge','options','catch','body','License','find','params','checkLicense','key','downloadLogFile','license-info.log','join','/var','log','setHeader','Content-disposition','attachment;\x20filename=','Content-Type','download','zip-dir','fast-json-patch','bluebird','path','sox','ejs','lodash','crypto','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/logger'];(function(_0x196dad,_0x46c9be){var _0x2a57f9=function(_0x3e2550){while(--_0x3e2550){_0x196dad['push'](_0x196dad['shift']());}};_0x2a57f9(++_0x46c9be);}(_0xdb53,0x177));var _0x3db5=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xdb53[_0x3dd15e];return _0x231fd0;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0x3db5('0x0'));var jsonpatch=require(_0x3db5('0x1'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0x3db5('0x2'));var Mustache=require('mustache');var util=require('util');var path=require(_0x3db5('0x3'));var sox=require(_0x3db5('0x4'));var csv=require('to-csv');var ejs=require(_0x3db5('0x5'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x3db5('0x6'));var squel=require('squel');var crypto=require(_0x3db5('0x7'));var jsforce=require(_0x3db5('0x8'));var deskjs=require(_0x3db5('0x9'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x3db5('0xa'));var Redis=require(_0x3db5('0xb'));var authService=require(_0x3db5('0xc'));var qs=require(_0x3db5('0xd'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0x3db5('0xe'))('api');var utils=require(_0x3db5('0xf'));var config=require(_0x3db5('0x10'));var licenseUtil=require(_0x3db5('0x11'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x3afe82,_0x1e4659){_0x1e4659=_0x1e4659||0xcc;return function(_0x463c57){if(_0x463c57){return _0x3afe82['sendStatus'](_0x1e4659);}return _0x3afe82[_0x3db5('0x12')](_0x1e4659)[_0x3db5('0x13')]();};}function respondWithResult(_0x5d4386,_0x3709ed){_0x3709ed=_0x3709ed||0xc8;return function(_0x14fa67){if(_0x14fa67){return _0x5d4386[_0x3db5('0x12')](_0x3709ed)[_0x3db5('0x14')](_0x14fa67);}};}function respondWithFilteredResult(_0x18a4bd,_0x1e4cd7){return function(_0x3e19ff){if(_0x3e19ff){var _0x22226d=typeof _0x1e4cd7[_0x3db5('0x15')]===_0x3db5('0x16')&&typeof _0x1e4cd7[_0x3db5('0x17')]==='undefined';var _0x28451a=_0x3e19ff[_0x3db5('0x18')];var _0x193240=_0x22226d?0x0:_0x1e4cd7[_0x3db5('0x15')];var _0x32f4aa=_0x22226d?_0x3e19ff[_0x3db5('0x18')]:_0x1e4cd7[_0x3db5('0x15')]+_0x1e4cd7[_0x3db5('0x17')];var _0x28ead0;if(_0x32f4aa>=_0x28451a){_0x32f4aa=_0x28451a;_0x28ead0=0xc8;}else{_0x28ead0=0xce;}_0x18a4bd[_0x3db5('0x12')](_0x28ead0);return _0x18a4bd['set'](_0x3db5('0x19'),_0x193240+'-'+_0x32f4aa+'/'+_0x28451a)[_0x3db5('0x14')](_0x3e19ff);}return null;};}function patchUpdates(_0x166048){return function(_0x1b6936){try{jsonpatch[_0x3db5('0x1a')](_0x1b6936,_0x166048,!![]);}catch(_0x275ef9){return BPromise[_0x3db5('0x1b')](_0x275ef9);}return _0x1b6936[_0x3db5('0x1c')]();};}function saveUpdates(_0x4040b1,_0x641394){return function(_0xda9c1d){if(_0xda9c1d){return _0xda9c1d[_0x3db5('0x1d')](_0x4040b1)['then'](function(_0x24ac32){return _0x24ac32;});}return null;};}function removeEntity(_0x223878,_0x399a86){return function(_0x48658e){if(_0x48658e){return _0x48658e[_0x3db5('0x1e')]()[_0x3db5('0x1f')](function(){_0x223878[_0x3db5('0x12')](0xcc)[_0x3db5('0x13')]();});}};}function handleEntityNotFound(_0x1ed235,_0x4b8105){return function(_0x537e4c){if(!_0x537e4c){_0x1ed235[_0x3db5('0x20')](0x194);}return _0x537e4c;};}function handleError(_0x109bcc,_0x335ce5){_0x335ce5=_0x335ce5||0x1f4;return function(_0x565b53){logger[_0x3db5('0x21')](_0x565b53[_0x3db5('0x22')]);if(_0x565b53['name']){delete _0x565b53['name'];}_0x109bcc[_0x3db5('0x12')](_0x335ce5)[_0x3db5('0x23')](_0x565b53);};}var utilLicense=require('../../config/license/util');exports[_0x3db5('0x24')]=function(_0x1b6460,_0x3a48ca){var _0xb9cee4={'raw':!![],'where':{'id':0x1}},_0x1d905c={};_0x1d905c[_0x3db5('0x25')]=_['keys'](db['License'][_0x3db5('0x26')]);_0x1d905c[_0x3db5('0x27')]=_[_0x3db5('0x28')](_0x1b6460[_0x3db5('0x27')]);_0x1d905c[_0x3db5('0x29')]=_[_0x3db5('0x2a')](_0x1d905c['model'],_0x1d905c[_0x3db5('0x27')]);_0xb9cee4[_0x3db5('0x2b')]=_[_0x3db5('0x2a')](_0x1d905c[_0x3db5('0x25')],qs[_0x3db5('0x2c')](_0x1b6460[_0x3db5('0x27')][_0x3db5('0x2c')]));_0xb9cee4[_0x3db5('0x2b')]=_0xb9cee4[_0x3db5('0x2b')][_0x3db5('0x2d')]?_0xb9cee4[_0x3db5('0x2b')]:_0x1d905c[_0x3db5('0x25')];_0xb9cee4=_[_0x3db5('0x2e')]({},_0xb9cee4,_0x1b6460[_0x3db5('0x2f')]);return utilLicense['getLicense'](_0xb9cee4)[_0x3db5('0x1f')](respondWithResult(_0x3a48ca,null))[_0x3db5('0x30')](handleError(_0x3a48ca,null));};exports[_0x3db5('0x1d')]=function(_0x14d3ae,_0x5ef372){if(_0x14d3ae[_0x3db5('0x31')]['id']){delete _0x14d3ae[_0x3db5('0x31')]['id'];}return db[_0x3db5('0x32')][_0x3db5('0x33')]({'where':{'id':_0x14d3ae[_0x3db5('0x34')]['id']}})[_0x3db5('0x1f')](handleEntityNotFound(_0x5ef372,null))[_0x3db5('0x1f')](function(_0x1ae9f0){var _0x4908ad=_0x1ae9f0['get']({'plain':!![]});return utilLicense[_0x3db5('0x35')](_0x4908ad,_0x14d3ae[_0x3db5('0x31')][_0x3db5('0x36')]);})['then'](function(_0x8ce060){if(!_0x8ce060['demo']){return saveUpdates(_0x14d3ae['body'],null);}return _0x8ce060;})['then'](respondWithResult(_0x5ef372,null))[_0x3db5('0x30')](handleError(_0x5ef372,null));};exports[_0x3db5('0x37')]=function(_0x35c422,_0x3fa2e7){var _0x31ec33=_0x3db5('0x38');var _0x19660f=path[_0x3db5('0x39')](_0x3db5('0x3a'),_0x3db5('0x3b'),'xcally',_0x31ec33);_0x3fa2e7[_0x3db5('0x3c')](_0x3db5('0x3d'),_0x3db5('0x3e')+_0x31ec33);_0x3fa2e7['set'](_0x3db5('0x3f'),'text/plain');_0x3fa2e7[_0x3db5('0x40')](_0x19660f);}; \ No newline at end of file +var _0x9a17=['mustache','util','path','to-csv','ejs','fs-extra','lodash','squel','crypto','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','sendStatus','status','end','json','limit','undefined','count','offset','set','Content-Range','reject','update','then','error','stack','send','index','License','rawAttributes','query','keys','filters','intersection','model','fields','attributes','length','merge','getLicense','catch','body','find','params','get','checkLicense','key','demo','join','/var','log','xcally','setHeader','Content-Type','download','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird'];(function(_0x303a76,_0x1c83bd){var _0x5d415b=function(_0x13499c){while(--_0x13499c){_0x303a76['push'](_0x303a76['shift']());}};_0x5d415b(++_0x1c83bd);}(_0x9a17,0x19e));var _0x79a1=function(_0xa5d0c7,_0x51b88b){_0xa5d0c7=_0xa5d0c7-0x0;var _0x1bbbc4=_0x9a17[_0xa5d0c7];return _0x1bbbc4;};'use strict';var emlformat=require(_0x79a1('0x0'));var rimraf=require(_0x79a1('0x1'));var zipdir=require(_0x79a1('0x2'));var jsonpatch=require(_0x79a1('0x3'));var rp=require(_0x79a1('0x4'));var moment=require('moment');var BPromise=require(_0x79a1('0x5'));var Mustache=require(_0x79a1('0x6'));var util=require(_0x79a1('0x7'));var path=require(_0x79a1('0x8'));var sox=require('sox');var csv=require(_0x79a1('0x9'));var ejs=require(_0x79a1('0xa'));var fs=require('fs');var fs_extra=require(_0x79a1('0xb'));var _=require(_0x79a1('0xc'));var squel=require(_0x79a1('0xd'));var crypto=require(_0x79a1('0xe'));var jsforce=require('jsforce');var deskjs=require(_0x79a1('0xf'));var toCsv=require(_0x79a1('0x9'));var querystring=require(_0x79a1('0x10'));var Papa=require('papaparse');var Redis=require(_0x79a1('0x11'));var authService=require(_0x79a1('0x12'));var qs=require(_0x79a1('0x13'));var as=require(_0x79a1('0x14'));var hardwareService=require(_0x79a1('0x15'));var logger=require('../../config/logger')(_0x79a1('0x16'));var utils=require(_0x79a1('0x17'));var config=require(_0x79a1('0x18'));var licenseUtil=require(_0x79a1('0x19'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x32a559,_0x350815){_0x350815=_0x350815||0xcc;return function(_0x59704b){if(_0x59704b){return _0x32a559[_0x79a1('0x1a')](_0x350815);}return _0x32a559[_0x79a1('0x1b')](_0x350815)[_0x79a1('0x1c')]();};}function respondWithResult(_0x53fbca,_0x54deff){_0x54deff=_0x54deff||0xc8;return function(_0x17bf78){if(_0x17bf78){return _0x53fbca['status'](_0x54deff)[_0x79a1('0x1d')](_0x17bf78);}};}function respondWithFilteredResult(_0x1736ec,_0x32bab4){return function(_0x8148c4){if(_0x8148c4){var _0x3f9718=typeof _0x32bab4['offset']==='undefined'&&typeof _0x32bab4[_0x79a1('0x1e')]===_0x79a1('0x1f');var _0x3b9c7b=_0x8148c4[_0x79a1('0x20')];var _0x51230f=_0x3f9718?0x0:_0x32bab4[_0x79a1('0x21')];var _0x1553db=_0x3f9718?_0x8148c4[_0x79a1('0x20')]:_0x32bab4[_0x79a1('0x21')]+_0x32bab4[_0x79a1('0x1e')];var _0x3dc450;if(_0x1553db>=_0x3b9c7b){_0x1553db=_0x3b9c7b;_0x3dc450=0xc8;}else{_0x3dc450=0xce;}_0x1736ec[_0x79a1('0x1b')](_0x3dc450);return _0x1736ec[_0x79a1('0x22')](_0x79a1('0x23'),_0x51230f+'-'+_0x1553db+'/'+_0x3b9c7b)[_0x79a1('0x1d')](_0x8148c4);}return null;};}function patchUpdates(_0x39cabf){return function(_0x24dd9e){try{jsonpatch['apply'](_0x24dd9e,_0x39cabf,!![]);}catch(_0x3a19c6){return BPromise[_0x79a1('0x24')](_0x3a19c6);}return _0x24dd9e['save']();};}function saveUpdates(_0x16cc55,_0x186b49){return function(_0x5cfb34){if(_0x5cfb34){return _0x5cfb34[_0x79a1('0x25')](_0x16cc55)[_0x79a1('0x26')](function(_0xb7eeaf){return _0xb7eeaf;});}return null;};}function removeEntity(_0x254bf0,_0x2adaf7){return function(_0x55f5ce){if(_0x55f5ce){return _0x55f5ce['destroy']()[_0x79a1('0x26')](function(){_0x254bf0[_0x79a1('0x1b')](0xcc)[_0x79a1('0x1c')]();});}};}function handleEntityNotFound(_0x1c03af,_0x4c1c21){return function(_0x595293){if(!_0x595293){_0x1c03af['sendStatus'](0x194);}return _0x595293;};}function handleError(_0x2fae55,_0x3a1c7e){_0x3a1c7e=_0x3a1c7e||0x1f4;return function(_0x9bc03a){logger[_0x79a1('0x27')](_0x9bc03a[_0x79a1('0x28')]);if(_0x9bc03a['name']){delete _0x9bc03a['name'];}_0x2fae55['status'](_0x3a1c7e)[_0x79a1('0x29')](_0x9bc03a);};}var utilLicense=require(_0x79a1('0x19'));exports[_0x79a1('0x2a')]=function(_0x55a803,_0x3116c4){var _0x47b127={'raw':!![],'where':{'id':0x1}},_0xa07c01={};_0xa07c01['model']=_['keys'](db[_0x79a1('0x2b')][_0x79a1('0x2c')]);_0xa07c01[_0x79a1('0x2d')]=_[_0x79a1('0x2e')](_0x55a803[_0x79a1('0x2d')]);_0xa07c01[_0x79a1('0x2f')]=_[_0x79a1('0x30')](_0xa07c01['model'],_0xa07c01[_0x79a1('0x2d')]);_0x47b127['attributes']=_['intersection'](_0xa07c01[_0x79a1('0x31')],qs[_0x79a1('0x32')](_0x55a803[_0x79a1('0x2d')][_0x79a1('0x32')]));_0x47b127['attributes']=_0x47b127[_0x79a1('0x33')][_0x79a1('0x34')]?_0x47b127['attributes']:_0xa07c01['model'];_0x47b127=_[_0x79a1('0x35')]({},_0x47b127,_0x55a803['options']);return utilLicense[_0x79a1('0x36')](_0x47b127)[_0x79a1('0x26')](respondWithResult(_0x3116c4,null))[_0x79a1('0x37')](handleError(_0x3116c4,null));};exports[_0x79a1('0x25')]=function(_0x3c5e29,_0x60ae31){if(_0x3c5e29[_0x79a1('0x38')]['id']){delete _0x3c5e29['body']['id'];}return db[_0x79a1('0x2b')][_0x79a1('0x39')]({'where':{'id':_0x3c5e29[_0x79a1('0x3a')]['id']}})[_0x79a1('0x26')](handleEntityNotFound(_0x60ae31,null))[_0x79a1('0x26')](function(_0x3069e5){var _0x4bbf9=_0x3069e5[_0x79a1('0x3b')]({'plain':!![]});return utilLicense[_0x79a1('0x3c')](_0x4bbf9,_0x3c5e29[_0x79a1('0x38')][_0x79a1('0x3d')]);})[_0x79a1('0x26')](function(_0x165d26){if(!_0x165d26[_0x79a1('0x3e')]){return saveUpdates(_0x3c5e29['body'],null);}return _0x165d26;})[_0x79a1('0x26')](respondWithResult(_0x60ae31,null))[_0x79a1('0x37')](handleError(_0x60ae31,null));};exports['downloadLogFile']=function(_0x3892c1,_0x5860ed){var _0xa83af7='license-info.log';var _0x4c700c=path[_0x79a1('0x3f')](_0x79a1('0x40'),_0x79a1('0x41'),_0x79a1('0x42'),_0xa83af7);_0x5860ed[_0x79a1('0x43')]('Content-disposition','attachment;\x20filename='+_0xa83af7);_0x5860ed['set'](_0x79a1('0x44'),'text/plain');_0x5860ed[_0x79a1('0x45')](_0x4c700c);}; \ No newline at end of file diff --git a/server/api/license/license.model.js b/server/api/license/license.model.js index 1a4330f..7b88ad4 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 _0xd12d=['lodash','../../config/logger','request-promise','path','rimraf','../../config/environment','./license.attributes','exports','define'];(function(_0x8ce506,_0x517f30){var _0x23c8e5=function(_0x1d048e){while(--_0x1d048e){_0x8ce506['push'](_0x8ce506['shift']());}};_0x23c8e5(++_0x517f30);}(_0xd12d,0x1cb));var _0xdd12=function(_0x5d6456,_0x58ecc7){_0x5d6456=_0x5d6456-0x0;var _0x4d66c1=_0xd12d[_0x5d6456];return _0x4d66c1;};'use strict';var _=require(_0xdd12('0x0'));var util=require('util');var logger=require(_0xdd12('0x1'))('api');var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0xdd12('0x2'));var fs=require('fs');var path=require(_0xdd12('0x3'));var rimraf=require(_0xdd12('0x4'));var config=require(_0xdd12('0x5'));var attributes=require(_0xdd12('0x6'));module[_0xdd12('0x7')]=function(_0x2f3134,_0x58e6bb){return _0x2f3134[_0xdd12('0x8')]('License',attributes,{'tableName':'license','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x6eef=['license','util','../../config/logger','api','moment','bluebird','path','rimraf','../../config/environment','./license.attributes','exports','define','License'];(function(_0x5158f5,_0x19c291){var _0x5d7dc8=function(_0xba92f7){while(--_0xba92f7){_0x5158f5['push'](_0x5158f5['shift']());}};_0x5d7dc8(++_0x19c291);}(_0x6eef,0x153));var _0xf6ee=function(_0x2c2980,_0x34282a){_0x2c2980=_0x2c2980-0x0;var _0x2a20a9=_0x6eef[_0x2c2980];return _0x2a20a9;};'use strict';var _=require('lodash');var util=require(_0xf6ee('0x0'));var logger=require(_0xf6ee('0x1'))(_0xf6ee('0x2'));var moment=require(_0xf6ee('0x3'));var BPromise=require(_0xf6ee('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xf6ee('0x5'));var rimraf=require(_0xf6ee('0x6'));var config=require(_0xf6ee('0x7'));var attributes=require(_0xf6ee('0x8'));module[_0xf6ee('0x9')]=function(_0x2d1579,_0x47f71b){return _0x2d1579[_0xf6ee('0xa')](_0xf6ee('0xb'),attributes,{'tableName':_0xf6ee('0xc'),'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 f53897b..df472dd 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 _0xde17=['catch','lodash','util','moment','bluebird','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','License,\x20%s,\x20%s','request\x20sent','debug','License,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result'];(function(_0x2308a3,_0x3cd7f1){var _0x311322=function(_0x4030be){while(--_0x4030be){_0x2308a3['push'](_0x2308a3['shift']());}};_0x311322(++_0x3cd7f1);}(_0xde17,0x114));var _0x7de1=function(_0x4857e0,_0x1d2fe0){_0x4857e0=_0x4857e0-0x0;var _0x53896e=_0xde17[_0x4857e0];return _0x53896e;};'use strict';var _=require(_0x7de1('0x0'));var util=require(_0x7de1('0x1'));var moment=require(_0x7de1('0x2'));var BPromise=require(_0x7de1('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x7de1('0x4'))['db'];var utils=require(_0x7de1('0x5'));var logger=require(_0x7de1('0x6'))(_0x7de1('0x7'));var config=require(_0x7de1('0x8'));var jayson=require(_0x7de1('0x9'));var client=jayson[_0x7de1('0xa')][_0x7de1('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x19c5ad,_0x255ea5,_0x1bab6b){return new BPromise(function(_0x5aa875,_0xb1a56c){return client[_0x7de1('0xc')](_0x19c5ad,_0x1bab6b)[_0x7de1('0xd')](function(_0x223bcc){logger[_0x7de1('0xe')](_0x7de1('0xf'),_0x255ea5,_0x7de1('0x10'));logger[_0x7de1('0x11')](_0x7de1('0x12'),_0x255ea5,'request\x20sent',JSON[_0x7de1('0x13')](_0x223bcc));if(_0x223bcc[_0x7de1('0x14')]){if(_0x223bcc[_0x7de1('0x14')][_0x7de1('0x15')]===0x1f4){logger[_0x7de1('0x14')]('License,\x20%s,\x20%s',_0x255ea5,_0x223bcc[_0x7de1('0x14')]['message']);return _0xb1a56c(_0x223bcc[_0x7de1('0x14')][_0x7de1('0x16')]);}logger[_0x7de1('0x14')]('License,\x20%s,\x20%s',_0x255ea5,_0x223bcc[_0x7de1('0x14')][_0x7de1('0x16')]);return _0x5aa875(_0x223bcc[_0x7de1('0x14')]['message']);}else{logger[_0x7de1('0xe')]('License,\x20%s,\x20%s',_0x255ea5,_0x7de1('0x10'));_0x5aa875(_0x223bcc[_0x7de1('0x17')][_0x7de1('0x16')]);}})[_0x7de1('0x18')](function(_0x52cc80){logger[_0x7de1('0x14')](_0x7de1('0xf'),_0x255ea5,_0x52cc80);_0xb1a56c(_0x52cc80);});});} \ No newline at end of file +var _0xcb64=['lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','then','info','License,\x20%s,\x20%s','request\x20sent','debug','License,\x20%s,\x20%s,\x20%s','stringify','error','message','result'];(function(_0x397da0,_0x387026){var _0x28b413=function(_0x5d655c){while(--_0x5d655c){_0x397da0['push'](_0x397da0['shift']());}};_0x28b413(++_0x387026);}(_0xcb64,0x1e0));var _0x4cb6=function(_0x482d18,_0x2d1cc2){_0x482d18=_0x482d18-0x0;var _0x9baaf8=_0xcb64[_0x482d18];return _0x9baaf8;};'use strict';var _=require(_0x4cb6('0x0'));var util=require(_0x4cb6('0x1'));var moment=require(_0x4cb6('0x2'));var BPromise=require(_0x4cb6('0x3'));var rs=require(_0x4cb6('0x4'));var fs=require('fs');var Redis=require(_0x4cb6('0x5'));var db=require(_0x4cb6('0x6'))['db'];var utils=require(_0x4cb6('0x7'));var logger=require(_0x4cb6('0x8'))(_0x4cb6('0x9'));var config=require(_0x4cb6('0xa'));var jayson=require(_0x4cb6('0xb'));var client=jayson['client'][_0x4cb6('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x407178,_0x26174d,_0xd7acfb){return new BPromise(function(_0x1557bf,_0x58316b){return client[_0x4cb6('0xd')](_0x407178,_0xd7acfb)[_0x4cb6('0xe')](function(_0x50bd81){logger[_0x4cb6('0xf')](_0x4cb6('0x10'),_0x26174d,_0x4cb6('0x11'));logger[_0x4cb6('0x12')](_0x4cb6('0x13'),_0x26174d,_0x4cb6('0x11'),JSON[_0x4cb6('0x14')](_0x50bd81));if(_0x50bd81['error']){if(_0x50bd81['error']['code']===0x1f4){logger['error'](_0x4cb6('0x10'),_0x26174d,_0x50bd81['error']['message']);return _0x58316b(_0x50bd81['error']['message']);}logger['error'](_0x4cb6('0x10'),_0x26174d,_0x50bd81['error']['message']);return _0x1557bf(_0x50bd81[_0x4cb6('0x15')][_0x4cb6('0x16')]);}else{logger[_0x4cb6('0xf')]('License,\x20%s,\x20%s',_0x26174d,_0x4cb6('0x11'));_0x1557bf(_0x50bd81[_0x4cb6('0x17')][_0x4cb6('0x16')]);}})['catch'](function(_0x2a3fa0){logger['error']('License,\x20%s,\x20%s',_0x26174d,_0x2a3fa0);_0x58316b(_0x2a3fa0);});});} \ No newline at end of file diff --git a/server/api/mailAccount/index.js b/server/api/mailAccount/index.js index dba26bf..0769daf 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 _0xa179=['getImap','/:id/out_servers','getSmtp','/:id/interactions','getInteractions','/:id/applications','/:id/messages','/:id/verify','/:id/users','getAgents','addDisposition','post','addAnswer','addImap','addInteraction','/:id/send','addAgents','removeDispositions','delete','removeAnswers','removeImap','/:id','destroy','removeAgents','exports','multer','util','path','connect-timeout','express','Router','get','isAuthenticated','/describe','describe','show','/:id/dispositions','getDispositions','/:id/canned_answers','/:id/in_servers'];(function(_0x2dcb9a,_0x185507){var _0x48343b=function(_0x106fb9){while(--_0x106fb9){_0x2dcb9a['push'](_0x2dcb9a['shift']());}};_0x48343b(++_0x185507);}(_0xa179,0x131));var _0x9a17=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xa179[_0x3dd15e];return _0x231fd0;};'use strict';var multer=require(_0x9a17('0x0'));var util=require(_0x9a17('0x1'));var path=require(_0x9a17('0x2'));var timeout=require(_0x9a17('0x3'));var express=require(_0x9a17('0x4'));var router=express[_0x9a17('0x5')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require('./mailAccount.controller');router[_0x9a17('0x6')]('/',auth[_0x9a17('0x7')](),controller['index']);router[_0x9a17('0x6')](_0x9a17('0x8'),auth['isAuthenticated'](),controller[_0x9a17('0x9')]);router['get']('/:id',auth[_0x9a17('0x7')](),controller[_0x9a17('0xa')]);router[_0x9a17('0x6')](_0x9a17('0xb'),auth[_0x9a17('0x7')](),controller[_0x9a17('0xc')]);router[_0x9a17('0x6')](_0x9a17('0xd'),auth[_0x9a17('0x7')](),controller['getAnswers']);router['get'](_0x9a17('0xe'),auth[_0x9a17('0x7')](),controller[_0x9a17('0xf')]);router[_0x9a17('0x6')](_0x9a17('0x10'),auth[_0x9a17('0x7')](),controller[_0x9a17('0x11')]);router[_0x9a17('0x6')](_0x9a17('0x12'),auth[_0x9a17('0x7')](),controller[_0x9a17('0x13')]);router[_0x9a17('0x6')](_0x9a17('0x14'),auth['isAuthenticated'](),controller['getApplications']);router['get'](_0x9a17('0x15'),auth[_0x9a17('0x7')](),controller['getMessages']);router[_0x9a17('0x6')](_0x9a17('0x16'),auth[_0x9a17('0x7')](),controller['verifySmtp']);router[_0x9a17('0x6')](_0x9a17('0x17'),auth[_0x9a17('0x7')](),controller[_0x9a17('0x18')]);router['post'](_0x9a17('0xb'),auth[_0x9a17('0x7')](),controller[_0x9a17('0x19')]);router[_0x9a17('0x1a')](_0x9a17('0xd'),auth[_0x9a17('0x7')](),controller[_0x9a17('0x1b')]);router[_0x9a17('0x1a')]('/',auth['isAuthenticated'](),controller['create']);router['post'](_0x9a17('0xe'),auth[_0x9a17('0x7')](),controller[_0x9a17('0x1c')]);router['post'](_0x9a17('0x10'),auth[_0x9a17('0x7')](),controller['addSmtp']);router['post'](_0x9a17('0x12'),auth['isAuthenticated'](),controller[_0x9a17('0x1d')]);router[_0x9a17('0x1a')](_0x9a17('0x14'),auth[_0x9a17('0x7')](),controller['addApplications']);router[_0x9a17('0x1a')](_0x9a17('0x1e'),auth[_0x9a17('0x7')](),controller['send']);router[_0x9a17('0x1a')]('/:id/users',auth[_0x9a17('0x7')](),controller[_0x9a17('0x1f')]);router['put']('/:id',auth[_0x9a17('0x7')](),controller['update']);router['delete'](_0x9a17('0xb'),auth[_0x9a17('0x7')](),controller[_0x9a17('0x20')]);router[_0x9a17('0x21')]('/:id/canned_answers',auth['isAuthenticated'](),controller[_0x9a17('0x22')]);router[_0x9a17('0x21')](_0x9a17('0xe'),auth[_0x9a17('0x7')](),controller[_0x9a17('0x23')]);router[_0x9a17('0x21')](_0x9a17('0x10'),auth[_0x9a17('0x7')](),controller['removeSmtp']);router[_0x9a17('0x21')](_0x9a17('0x24'),auth[_0x9a17('0x7')](),controller[_0x9a17('0x25')]);router['delete'](_0x9a17('0x17'),auth['isAuthenticated'](),controller[_0x9a17('0x26')]);module[_0x9a17('0x27')]=router; \ No newline at end of file +var _0xfd4b=['getMessages','/:id/verify','verifySmtp','/:id/users','getAgents','post','addDisposition','/:id/canned_answers','addAnswer','create','addSmtp','addInteraction','addApplications','/:id/send','addAgents','put','update','delete','removeDispositions','removeAnswers','removeImap','removeSmtp','/:id','removeAgents','exports','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','./mailAccount.controller','isAuthenticated','/describe','describe','show','get','/:id/dispositions','getAnswers','/:id/in_servers','getImap','/:id/out_servers','getSmtp','/:id/interactions','getInteractions','/:id/applications','/:id/messages'];(function(_0x2543d6,_0x3a5e78){var _0x55213c=function(_0x292768){while(--_0x292768){_0x2543d6['push'](_0x2543d6['shift']());}};_0x55213c(++_0x3a5e78);}(_0xfd4b,0x133));var _0xbfd4=function(_0xc3fb2,_0x34bf67){_0xc3fb2=_0xc3fb2-0x0;var _0x7ae811=_0xfd4b[_0xc3fb2];return _0x7ae811;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0xbfd4('0x0'));var timeout=require(_0xbfd4('0x1'));var express=require(_0xbfd4('0x2'));var router=express[_0xbfd4('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0xbfd4('0x4'));var interaction=require(_0xbfd4('0x5'));var config=require('../../config/environment');var controller=require(_0xbfd4('0x6'));router['get']('/',auth[_0xbfd4('0x7')](),controller['index']);router['get'](_0xbfd4('0x8'),auth[_0xbfd4('0x7')](),controller[_0xbfd4('0x9')]);router['get']('/:id',auth[_0xbfd4('0x7')](),controller[_0xbfd4('0xa')]);router[_0xbfd4('0xb')](_0xbfd4('0xc'),auth['isAuthenticated'](),controller['getDispositions']);router[_0xbfd4('0xb')]('/:id/canned_answers',auth[_0xbfd4('0x7')](),controller[_0xbfd4('0xd')]);router[_0xbfd4('0xb')](_0xbfd4('0xe'),auth['isAuthenticated'](),controller[_0xbfd4('0xf')]);router[_0xbfd4('0xb')](_0xbfd4('0x10'),auth[_0xbfd4('0x7')](),controller[_0xbfd4('0x11')]);router['get'](_0xbfd4('0x12'),auth[_0xbfd4('0x7')](),controller[_0xbfd4('0x13')]);router[_0xbfd4('0xb')](_0xbfd4('0x14'),auth[_0xbfd4('0x7')](),controller['getApplications']);router[_0xbfd4('0xb')](_0xbfd4('0x15'),auth[_0xbfd4('0x7')](),controller[_0xbfd4('0x16')]);router[_0xbfd4('0xb')](_0xbfd4('0x17'),auth[_0xbfd4('0x7')](),controller[_0xbfd4('0x18')]);router[_0xbfd4('0xb')](_0xbfd4('0x19'),auth[_0xbfd4('0x7')](),controller[_0xbfd4('0x1a')]);router[_0xbfd4('0x1b')](_0xbfd4('0xc'),auth[_0xbfd4('0x7')](),controller[_0xbfd4('0x1c')]);router[_0xbfd4('0x1b')](_0xbfd4('0x1d'),auth['isAuthenticated'](),controller[_0xbfd4('0x1e')]);router[_0xbfd4('0x1b')]('/',auth[_0xbfd4('0x7')](),controller[_0xbfd4('0x1f')]);router['post'](_0xbfd4('0xe'),auth[_0xbfd4('0x7')](),controller['addImap']);router[_0xbfd4('0x1b')](_0xbfd4('0x10'),auth[_0xbfd4('0x7')](),controller[_0xbfd4('0x20')]);router[_0xbfd4('0x1b')]('/:id/interactions',auth[_0xbfd4('0x7')](),controller[_0xbfd4('0x21')]);router[_0xbfd4('0x1b')](_0xbfd4('0x14'),auth[_0xbfd4('0x7')](),controller[_0xbfd4('0x22')]);router[_0xbfd4('0x1b')](_0xbfd4('0x23'),auth['isAuthenticated'](),controller['send']);router[_0xbfd4('0x1b')](_0xbfd4('0x19'),auth['isAuthenticated'](),controller[_0xbfd4('0x24')]);router[_0xbfd4('0x25')]('/:id',auth['isAuthenticated'](),controller[_0xbfd4('0x26')]);router[_0xbfd4('0x27')](_0xbfd4('0xc'),auth['isAuthenticated'](),controller[_0xbfd4('0x28')]);router[_0xbfd4('0x27')](_0xbfd4('0x1d'),auth['isAuthenticated'](),controller[_0xbfd4('0x29')]);router['delete'](_0xbfd4('0xe'),auth[_0xbfd4('0x7')](),controller[_0xbfd4('0x2a')]);router[_0xbfd4('0x27')](_0xbfd4('0x10'),auth['isAuthenticated'](),controller[_0xbfd4('0x2b')]);router[_0xbfd4('0x27')](_0xbfd4('0x2c'),auth['isAuthenticated'](),controller['destroy']);router[_0xbfd4('0x27')](_0xbfd4('0x19'),auth[_0xbfd4('0x7')](),controller[_0xbfd4('0x2d')]);module[_0xbfd4('0x2e')]=router; \ No newline at end of file diff --git a/server/api/mailAccount/mailAccount.attributes.js b/server/api/mailAccount/mailAccount.attributes.js index a12d1e3..0f2199d 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 _0xae72=['Arial,Helvetica,sans-serif','Account:\x20{{account.name}}
{{#queue}}Queue:\x20{{queue.name}}
{{/queue}}From\x20:\x20{{from}}
Subject\x20:\x20{{message.subject}}','INTEGER','Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled','Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','setDataValue','mandatoryDispositionPauseId','mandatoryDisposition','ENUM','gmail','yahoo','getDataValue','provider','custom','exports','STRING','BOOLEAN','TEXT'];(function(_0x52f802,_0x525f42){var _0x424630=function(_0x1342d7){while(--_0x1342d7){_0x52f802['push'](_0x52f802['shift']());}};_0x424630(++_0x525f42);}(_0xae72,0x11c));var _0x2ae7=function(_0x1956c9,_0x2ad6b4){_0x1956c9=_0x1956c9-0x0;var _0x499d4=_0xae72[_0x1956c9];return _0x499d4;};'use strict';var Sequelize=require('sequelize');module[_0x2ae7('0x0')]={'description':{'type':Sequelize['STRING']},'name':{'type':Sequelize[_0x2ae7('0x1')],'allowNull':![]},'service':{'type':Sequelize[_0x2ae7('0x2')],'defaultValue':![]},'email':{'type':Sequelize[_0x2ae7('0x1')],'validate':{'isEmail':!![]}},'active':{'type':Sequelize[_0x2ae7('0x2')],'defaultValue':!![]},'key':{'type':Sequelize['STRING'],'allowNull':![]},'template':{'type':Sequelize[_0x2ae7('0x3')]},'markAsUnread':{'type':Sequelize[_0x2ae7('0x2')],'defaultValue':![]},'fontFamily':{'type':Sequelize[_0x2ae7('0x1')],'allowNull':![],'defaultValue':_0x2ae7('0x4')},'fontSize':{'type':Sequelize['INTEGER'](0x2)['UNSIGNED'],'defaultValue':0xd,'validate':{'min':0x8,'max':0x48}},'notificationTemplate':{'type':Sequelize[_0x2ae7('0x3')],'defaultValue':function(){return _0x2ae7('0x5');}},'notificationSound':{'type':Sequelize[_0x2ae7('0x2')],'defaultValue':!![]},'notificationShake':{'type':Sequelize[_0x2ae7('0x2')],'defaultValue':![]},'waitForTheAssignedAgent':{'type':Sequelize[_0x2ae7('0x6')],'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[_0x2ae7('0x6')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize[_0x2ae7('0x2')],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize[_0x2ae7('0x6')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'mandatoryDispositionPauseId':{'type':Sequelize[_0x2ae7('0x6')],'allowNull':!![],'defaultValue':null,'comment':_0x2ae7('0x7')},'mandatoryDisposition':{'type':Sequelize[_0x2ae7('0x2')],'defaultValue':![],'comment':_0x2ae7('0x8'),'set':function(_0x5b9dba){if(!_0x5b9dba)this[_0x2ae7('0x9')](_0x2ae7('0xa'),null);this[_0x2ae7('0x9')](_0x2ae7('0xb'),_0x5b9dba);}},'provider':{'type':Sequelize[_0x2ae7('0xc')](_0x2ae7('0xd'),'hotmail',_0x2ae7('0xe'),'outlook365'),'defaultValue':null,'get':function(){if(!this[_0x2ae7('0xf')](_0x2ae7('0x10')))return _0x2ae7('0x11');return this[_0x2ae7('0xf')](_0x2ae7('0x10'));},'set':function(_0x1f1c16){if(_0x1f1c16===_0x2ae7('0x11'))_0x1f1c16=null;return this[_0x2ae7('0x9')](_0x2ae7('0x10'),_0x1f1c16);}}}; \ No newline at end of file +var _0xf144=['mandatoryDispositionPauseId','setDataValue','mandatoryDisposition','ENUM','gmail','hotmail','yahoo','getDataValue','custom','provider','sequelize','exports','STRING','BOOLEAN','TEXT','Arial,Helvetica,sans-serif','INTEGER','UNSIGNED','Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled'];(function(_0x333f73,_0x1fa4b8){var _0x1c8d77=function(_0xb665cb){while(--_0xb665cb){_0x333f73['push'](_0x333f73['shift']());}};_0x1c8d77(++_0x1fa4b8);}(_0xf144,0x101));var _0x4f14=function(_0x20480a,_0x137a6f){_0x20480a=_0x20480a-0x0;var _0x406718=_0xf144[_0x20480a];return _0x406718;};'use strict';var Sequelize=require(_0x4f14('0x0'));module[_0x4f14('0x1')]={'description':{'type':Sequelize[_0x4f14('0x2')]},'name':{'type':Sequelize[_0x4f14('0x2')],'allowNull':![]},'service':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'email':{'type':Sequelize[_0x4f14('0x2')],'validate':{'isEmail':!![]}},'active':{'type':Sequelize[_0x4f14('0x3')],'defaultValue':!![]},'key':{'type':Sequelize['STRING'],'allowNull':![]},'template':{'type':Sequelize[_0x4f14('0x4')]},'markAsUnread':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'fontFamily':{'type':Sequelize[_0x4f14('0x2')],'allowNull':![],'defaultValue':_0x4f14('0x5')},'fontSize':{'type':Sequelize[_0x4f14('0x6')](0x2)[_0x4f14('0x7')],'defaultValue':0xd,'validate':{'min':0x8,'max':0x48}},'notificationTemplate':{'type':Sequelize[_0x4f14('0x4')],'defaultValue':function(){return'Account:\x20{{account.name}}
{{#queue}}Queue:\x20{{queue.name}}
{{/queue}}From\x20:\x20{{from}}
Subject\x20:\x20{{message.subject}}';}},'notificationSound':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'notificationShake':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'waitForTheAssignedAgent':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'waitForTheAssignedQueue':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'queueTransfer':{'type':Sequelize[_0x4f14('0x3')],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize[_0x4f14('0x6')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize[_0x4f14('0x3')],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'mandatoryDispositionPauseId':{'type':Sequelize[_0x4f14('0x6')],'allowNull':!![],'defaultValue':null,'comment':_0x4f14('0x8')},'mandatoryDisposition':{'type':Sequelize[_0x4f14('0x3')],'defaultValue':![],'comment':'Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','set':function(_0x3c51f8){if(!_0x3c51f8)this['setDataValue'](_0x4f14('0x9'),null);this[_0x4f14('0xa')](_0x4f14('0xb'),_0x3c51f8);}},'provider':{'type':Sequelize[_0x4f14('0xc')](_0x4f14('0xd'),_0x4f14('0xe'),_0x4f14('0xf'),'outlook365'),'defaultValue':null,'get':function(){if(!this[_0x4f14('0x10')]('provider'))return'custom';return this[_0x4f14('0x10')]('provider');},'set':function(_0x1d2ea5){if(_0x1d2ea5===_0x4f14('0x11'))_0x1d2ea5=null;return this['setDataValue'](_0x4f14('0x12'),_0x1d2ea5);}}}; \ No newline at end of file diff --git a/server/api/mailAccount/mailAccount.controller.js b/server/api/mailAccount/mailAccount.controller.js index bb3e947..5e5a89f 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 _0xe288=['CmContact','Contact','Owner','fullname','internal','Tag','Tags','color','tag','addApplications','sequelize','transaction','Transaction','ISOLATION_LEVELS','READ_COMMITTED','MailApplication','bulkCreate','findAndCountAll','priority','stack','finally','getApplications','getMessages','$gte','format','YYYY-MM-DD\x20HH:mm:ss','MailMessage','inlineCss','true','split','List','Contacts','DESC','CloudProvider','from','attachments','join','root','basename','getSmtpOptions','SendMail','List\x20not\x20found','attach','out','messageId','Interaction','Messages','verifySmtp','Sequelize','ValidationError','You\x20can\x27t\x20remove\x20the\x20mail\x20service\x20account','addAgents','spread','removeAgents','isArray','emit','userMailAccount:remove','User','getAgents','moment','bluebird','util','path','lodash','juice','ioredis','../../components/parsers/qs','../../config/logger','api','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./mailAccount.socket','register','jayson/promise','client','http','info','MailAccount,\x20%s,\x20%s','request\x20sent','MailAccount,\x20%s,\x20%s,\x20%s','stringify','error','message','result','status','json','offset','limit','undefined','count','set','Content-Range','update','destroy','get','UserProfileResource','then','end','sendStatus','name','send','gmail','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','username','password','modernAuthentication','CloudProviderId','pass','port','host','secure','service','authentication','Imap','Smtp','index','MailServerIn','MailServerOut','Pause','mandatoryDispositionPause','MailAccount','rawAttributes','fieldName','type','key','model','query','keys','intersection','attributes','fields','length','nolimit','order','sort','filters','pick','where','merge','map','VIRTUAL','filter','options','includeAll','findAll','rows','catch','show','include','find','body','provider','params','Mail\x20Account\x20not\x20found','describe','addDisposition','create','getDispositions','findOne','Disposition','hasOwnProperty','MailAccountId','removeDispositions','addAnswer','CannedAnswer','removeAnswers','ids','email','ListId','isNil','active','description','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','MailAccounts','userProfileId','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','getImap','addImap','setImap','getSmtp','addSmtp','removeSmtp','setSmtp','addInteraction','omit','MailInteraction'];(function(_0x59f655,_0x1c12aa){var _0x1dbb6e=function(_0x3f048a){while(--_0x3f048a){_0x59f655['push'](_0x59f655['shift']());}};_0x1dbb6e(++_0x1c12aa);}(_0xe288,0x104));var _0x8e28=function(_0x137e81,_0x3541c4){_0x137e81=_0x137e81-0x0;var _0x5f14e1=_0xe288[_0x137e81];return _0x5f14e1;};'use strict';var moment=require(_0x8e28('0x0'));var BPromise=require(_0x8e28('0x1'));var util=require(_0x8e28('0x2'));var path=require(_0x8e28('0x3'));var _=require(_0x8e28('0x4'));var juice=require(_0x8e28('0x5'));var Redis=require(_0x8e28('0x6'));var qs=require(_0x8e28('0x7'));var logger=require(_0x8e28('0x8'))(_0x8e28('0x9'));var config=require('../../config/environment');var db=require(_0x8e28('0xa'))['db'];config[_0x8e28('0xb')]=_[_0x8e28('0xc')](config[_0x8e28('0xb')],{'host':_0x8e28('0xd'),'port':0x18eb});var socket=require(_0x8e28('0xe'))(new Redis(config['redis']));require(_0x8e28('0xf'))[_0x8e28('0x10')](socket);var jayson=require(_0x8e28('0x11'));var client=jayson[_0x8e28('0x12')][_0x8e28('0x13')]({'port':0x232b});function respondWithRpcPromise(_0x171a63,_0x28bf71,_0x30bd4b,_0x554cab){return new BPromise(function(_0x42cd6b,_0x328375){var _0x1a50d2=_0x554cab||client;return _0x1a50d2['request'](_0x171a63,_0x30bd4b)['then'](function(_0xf00f93){logger[_0x8e28('0x14')](_0x8e28('0x15'),_0x28bf71,_0x8e28('0x16'));logger['debug'](_0x8e28('0x17'),_0x28bf71,'request\x20sent',JSON[_0x8e28('0x18')](_0xf00f93));if(_0xf00f93['error']){if(_0xf00f93[_0x8e28('0x19')]['code']===0x1f4){logger[_0x8e28('0x19')]('MailAccount,\x20%s,\x20%s',_0x28bf71,_0xf00f93[_0x8e28('0x19')][_0x8e28('0x1a')]);return _0x328375(_0xf00f93[_0x8e28('0x19')][_0x8e28('0x1a')]);}logger[_0x8e28('0x19')]('MailAccount,\x20%s,\x20%s',_0x28bf71,_0xf00f93['error'][_0x8e28('0x1a')]);return _0x42cd6b(_0xf00f93[_0x8e28('0x19')]['message']);}else{logger[_0x8e28('0x14')](_0x8e28('0x15'),_0x28bf71,'request\x20sent');_0x42cd6b(_0xf00f93[_0x8e28('0x1b')][_0x8e28('0x1a')]);}})['catch'](function(_0x444dac){logger[_0x8e28('0x19')](_0x8e28('0x15'),_0x28bf71,_0x444dac);_0x328375(_0x444dac);});});}function respondWithStatusCode(_0x3c0faa,_0x2d5b2f){_0x2d5b2f=_0x2d5b2f||0xcc;return function(_0x4e8c7d){if(_0x4e8c7d){return _0x3c0faa['sendStatus'](_0x2d5b2f);}return _0x3c0faa[_0x8e28('0x1c')](_0x2d5b2f)['end']();};}function respondWithResult(_0x3306ab,_0x59aeed){_0x59aeed=_0x59aeed||0xc8;return function(_0x213cd2){if(_0x213cd2){return _0x3306ab[_0x8e28('0x1c')](_0x59aeed)[_0x8e28('0x1d')](_0x213cd2);}};}function respondWithFilteredResult(_0x5a25c8,_0x5eef11){return function(_0x55ac67){if(_0x55ac67){var _0x3b5f5f=typeof _0x5eef11[_0x8e28('0x1e')]==='undefined'&&typeof _0x5eef11[_0x8e28('0x1f')]===_0x8e28('0x20');var _0x59b8b9=_0x55ac67['count'];var _0x949d92=_0x3b5f5f?0x0:_0x5eef11['offset'];var _0x2c2a91=_0x3b5f5f?_0x55ac67[_0x8e28('0x21')]:_0x5eef11[_0x8e28('0x1e')]+_0x5eef11['limit'];var _0x4fa764;if(_0x2c2a91>=_0x59b8b9){_0x2c2a91=_0x59b8b9;_0x4fa764=0xc8;}else{_0x4fa764=0xce;}_0x5a25c8[_0x8e28('0x1c')](_0x4fa764);return _0x5a25c8[_0x8e28('0x22')](_0x8e28('0x23'),_0x949d92+'-'+_0x2c2a91+'/'+_0x59b8b9)[_0x8e28('0x1d')](_0x55ac67);}return null;};}function saveUpdates(_0x45c644){return function(_0x449197){if(_0x449197){return _0x449197[_0x8e28('0x24')](_0x45c644)['then'](function(_0x1eaae8){return _0x1eaae8;});}return null;};}function removeEntity(_0x32f93b){return function(_0x2f6c54){if(_0x2f6c54){return _0x2f6c54[_0x8e28('0x25')]()['then'](function(){var _0x5ebae6=_0x2f6c54[_0x8e28('0x26')]({'plain':!![]});var _0x22d336='MailAccounts';return db[_0x8e28('0x27')][_0x8e28('0x25')]({'where':{'type':_0x22d336,'resourceId':_0x5ebae6['id']}})[_0x8e28('0x28')](function(){return _0x2f6c54;});})[_0x8e28('0x28')](function(){_0x32f93b[_0x8e28('0x1c')](0xcc)[_0x8e28('0x29')]();});}};}function handleEntityNotFound(_0x252b6c){return function(_0xd600ee){if(!_0xd600ee){_0x252b6c[_0x8e28('0x2a')](0x194);}return _0xd600ee;};}function handleError(_0x2b9d35,_0x5c1357){_0x5c1357=_0x5c1357||0x1f4;return function(_0x243fed){logger[_0x8e28('0x19')](_0x243fed['stack']);if(_0x243fed[_0x8e28('0x2b')]){delete _0x243fed[_0x8e28('0x2b')];}_0x2b9d35[_0x8e28('0x1c')](_0x5c1357)[_0x8e28('0x2c')](_0x243fed);};}function getImapHost(_0x987336){switch(_0x987336){case _0x8e28('0x2d'):return'imap.gmail.com';case'yahoo':return'imap.mail.yahoo.com';case _0x8e28('0x2e'):return _0x8e28('0x2f');case _0x8e28('0x30'):return _0x8e28('0x31');}throw new Error(_0x8e28('0x32'),_0x987336);}function getSmtpHost(_0x33e4e7){switch(_0x33e4e7){case _0x8e28('0x2d'):return _0x8e28('0x33');case _0x8e28('0x34'):return _0x8e28('0x35');case'hotmail':return _0x8e28('0x36');case'outlook365':return _0x8e28('0x37');}throw new Error('Unknown\x20email\x20service\x20provider',_0x33e4e7);}function getAuthenticationOptions(_0x7e06a,_0x74d0f6){var _0x274781={};var _0x4d3f52={};if(_0x7e06a){_0x274781[_0x8e28('0x38')]=_0x4d3f52['user']=_0x74d0f6[_0x8e28('0x39')];_0x274781[_0x8e28('0x3a')]=_0x4d3f52['pass']=_0x74d0f6[_0x8e28('0x3a')];if(_0x74d0f6['modernAuthentication']){_0x274781[_0x8e28('0x3b')]=_0x4d3f52[_0x8e28('0x3b')]=!![];_0x274781[_0x8e28('0x3c')]=_0x4d3f52[_0x8e28('0x3c')]=_0x74d0f6['CloudProviderId'];_0x274781[_0x8e28('0x3a')]=_0x4d3f52[_0x8e28('0x3d')]=null;}else{_0x274781[_0x8e28('0x3c')]=_0x4d3f52[_0x8e28('0x3c')]=null;}_0x274781['host']=getImapHost(_0x7e06a);_0x274781[_0x8e28('0x3e')]=0x3e1;_0x4d3f52[_0x8e28('0x3f')]=getSmtpHost(_0x7e06a);_0x4d3f52[_0x8e28('0x3e')]=0x24b;_0x4d3f52[_0x8e28('0x40')]=![];_0x274781['service']=_0x4d3f52[_0x8e28('0x41')]=null;}else{if(_0x74d0f6[_0x8e28('0x42')]){_0x274781['user']=_0x4d3f52[_0x8e28('0x38')]=_0x74d0f6[_0x8e28('0x39')];_0x274781[_0x8e28('0x3a')]=_0x4d3f52[_0x8e28('0x3d')]=_0x74d0f6[_0x8e28('0x3a')];}else{_0x274781[_0x8e28('0x42')]=_0x4d3f52[_0x8e28('0x42')]=![];_0x274781['user']=_0x4d3f52[_0x8e28('0x38')]=null;_0x274781[_0x8e28('0x3a')]=_0x4d3f52[_0x8e28('0x3d')]=null;}_0x274781['host']=_0x74d0f6[_0x8e28('0x43')]['host'];_0x274781[_0x8e28('0x3e')]=_0x74d0f6[_0x8e28('0x43')][_0x8e28('0x3e')];_0x4d3f52[_0x8e28('0x3f')]=_0x74d0f6[_0x8e28('0x44')][_0x8e28('0x3f')];_0x4d3f52[_0x8e28('0x3e')]=_0x74d0f6[_0x8e28('0x44')][_0x8e28('0x3e')];}return{'Imap':_0x274781,'Smtp':_0x4d3f52};}exports[_0x8e28('0x45')]=function(_0x503fe8,_0xeb78f7){var _0x1a3cd6={'include':[{'model':db[_0x8e28('0x46')],'as':_0x8e28('0x43')},{'model':db[_0x8e28('0x47')],'as':_0x8e28('0x44')},{'model':db[_0x8e28('0x48')],'as':_0x8e28('0x49')}]},_0x533dae={},_0x333467={'count':0x0,'rows':[]};var _0x20521d=_['map'](db[_0x8e28('0x4a')][_0x8e28('0x4b')],function(_0x5b59df){return{'name':_0x5b59df[_0x8e28('0x4c')],'type':_0x5b59df[_0x8e28('0x4d')][_0x8e28('0x4e')]};});_0x533dae[_0x8e28('0x4f')]=_['map'](_0x20521d,'name');_0x533dae[_0x8e28('0x50')]=_[_0x8e28('0x51')](_0x503fe8[_0x8e28('0x50')]);_0x533dae['filters']=_[_0x8e28('0x52')](_0x533dae[_0x8e28('0x4f')],_0x533dae[_0x8e28('0x50')]);_0x1a3cd6[_0x8e28('0x53')]=_[_0x8e28('0x52')](_0x533dae[_0x8e28('0x4f')],qs[_0x8e28('0x54')](_0x503fe8[_0x8e28('0x50')]['fields']));_0x1a3cd6['attributes']=_0x1a3cd6[_0x8e28('0x53')][_0x8e28('0x55')]?_0x1a3cd6[_0x8e28('0x53')]:_0x533dae[_0x8e28('0x4f')];if(!_0x503fe8[_0x8e28('0x50')]['hasOwnProperty'](_0x8e28('0x56'))){_0x1a3cd6['limit']=qs[_0x8e28('0x1f')](_0x503fe8[_0x8e28('0x50')][_0x8e28('0x1f')]);_0x1a3cd6[_0x8e28('0x1e')]=qs[_0x8e28('0x1e')](_0x503fe8[_0x8e28('0x50')]['offset']);}_0x1a3cd6[_0x8e28('0x57')]=qs[_0x8e28('0x58')](_0x503fe8['query'][_0x8e28('0x58')]);_0x1a3cd6['where']=qs[_0x8e28('0x59')](_[_0x8e28('0x5a')](_0x503fe8['query'],_0x533dae[_0x8e28('0x59')]),_0x20521d);if(_0x503fe8[_0x8e28('0x50')]['filter']){_0x1a3cd6[_0x8e28('0x5b')]=_[_0x8e28('0x5c')](_0x1a3cd6[_0x8e28('0x5b')],{'$or':_[_0x8e28('0x5d')](_0x20521d,function(_0x55e7e4){if(_0x55e7e4[_0x8e28('0x4d')]!==_0x8e28('0x5e')){var _0x3afadd={};_0x3afadd[_0x55e7e4['name']]={'$like':'%'+_0x503fe8['query'][_0x8e28('0x5f')]+'%'};return _0x3afadd;}})});}_0x1a3cd6=_['merge']({},_0x1a3cd6,_0x503fe8[_0x8e28('0x60')]);var _0x411362={'where':_0x1a3cd6[_0x8e28('0x5b')]};return db[_0x8e28('0x4a')][_0x8e28('0x21')](_0x411362)[_0x8e28('0x28')](function(_0x50f5b4){_0x333467[_0x8e28('0x21')]=_0x50f5b4;if(_0x503fe8[_0x8e28('0x50')][_0x8e28('0x61')]){_0x1a3cd6['include']=[{'all':!![]}];}return db[_0x8e28('0x4a')][_0x8e28('0x62')](_0x1a3cd6);})['then'](function(_0xc5726d){_0x333467[_0x8e28('0x63')]=_0xc5726d;return _0x333467;})[_0x8e28('0x28')](respondWithFilteredResult(_0xeb78f7,_0x1a3cd6))[_0x8e28('0x64')](handleError(_0xeb78f7,null));};exports[_0x8e28('0x65')]=function(_0x26fd22,_0x38f69c){var _0x500625={'raw':![],'where':{'id':_0x26fd22['params']['id']},'include':[{'model':db[_0x8e28('0x46')],'as':_0x8e28('0x43')},{'model':db['MailServerOut'],'as':_0x8e28('0x44')},{'model':db['Pause'],'as':_0x8e28('0x49')}]},_0x36b8a3={};_0x36b8a3[_0x8e28('0x4f')]=_['keys'](db['MailAccount'][_0x8e28('0x4b')]);_0x36b8a3[_0x8e28('0x50')]=_[_0x8e28('0x51')](_0x26fd22['query']);_0x36b8a3[_0x8e28('0x59')]=_['intersection'](_0x36b8a3[_0x8e28('0x4f')],_0x36b8a3[_0x8e28('0x50')]);_0x500625['attributes']=_[_0x8e28('0x52')](_0x36b8a3[_0x8e28('0x4f')],qs[_0x8e28('0x54')](_0x26fd22['query'][_0x8e28('0x54')]));_0x500625[_0x8e28('0x53')]=_0x500625[_0x8e28('0x53')][_0x8e28('0x55')]?_0x500625[_0x8e28('0x53')]:_0x36b8a3[_0x8e28('0x4f')];if(_0x26fd22[_0x8e28('0x50')][_0x8e28('0x61')]){_0x500625[_0x8e28('0x66')]=[{'all':!![]}];}_0x500625=_[_0x8e28('0x5c')]({},_0x500625,_0x26fd22[_0x8e28('0x60')]);return db[_0x8e28('0x4a')][_0x8e28('0x67')](_0x500625)[_0x8e28('0x28')](handleEntityNotFound(_0x38f69c,null))[_0x8e28('0x28')](respondWithResult(_0x38f69c,null))[_0x8e28('0x64')](handleError(_0x38f69c,null));};exports['update']=function(_0x21a7f6,_0x490581){if(_0x21a7f6[_0x8e28('0x68')]['id']){delete _0x21a7f6[_0x8e28('0x68')]['id'];}var _0x273a65=_0x21a7f6[_0x8e28('0x68')][_0x8e28('0x69')]==='custom'?null:_0x21a7f6[_0x8e28('0x68')][_0x8e28('0x69')];var _0x4a8671=_0x21a7f6[_0x8e28('0x68')][_0x8e28('0x43')]||{};var _0xff0500=_0x21a7f6['body'][_0x8e28('0x44')]||{};if(_0x273a65){_0x4a8671[_0x8e28('0x3f')]=getImapHost(_0x273a65);_0x4a8671[_0x8e28('0x3e')]=0x3e1;_0xff0500[_0x8e28('0x3f')]=getSmtpHost(_0x273a65);_0xff0500['port']=0x24b;_0xff0500['secure']=![];}if(_0xff0500[_0x8e28('0x3b')]){_0xff0500[_0x8e28('0x40')]=![];}else{_0xff0500['CloudProviderId']=null;}if(!_0x4a8671[_0x8e28('0x3b')])_0x4a8671['CloudProviderId']=null;_0x21a7f6['body'][_0x8e28('0x43')]=_0x4a8671;_0x21a7f6[_0x8e28('0x68')][_0x8e28('0x44')]=_0xff0500;return db[_0x8e28('0x4a')][_0x8e28('0x67')]({'where':{'id':_0x21a7f6[_0x8e28('0x6a')]['id']},'include':[{'model':db[_0x8e28('0x46')],'as':_0x8e28('0x43')},{'model':db['MailServerOut'],'as':_0x8e28('0x44')},{'model':db[_0x8e28('0x48')],'as':_0x8e28('0x49')}]})[_0x8e28('0x28')](handleEntityNotFound(_0x490581,null))[_0x8e28('0x28')](function(_0x3736ca){if(!_0x3736ca)throw new Error(_0x8e28('0x6b'));if(_0x3736ca['service'])delete _0x21a7f6[_0x8e28('0x68')][_0x8e28('0x43')];return _0x3736ca;})[_0x8e28('0x28')](saveUpdates(_0x21a7f6[_0x8e28('0x68')],null))['then'](function(_0x7dce1){if(!_0x21a7f6[_0x8e28('0x68')][_0x8e28('0x43')])return _0x7dce1;return db[_0x8e28('0x46')][_0x8e28('0x24')](_0x21a7f6['body'][_0x8e28('0x43')],{'where':{'MailAccountId':_0x7dce1['id']}})[_0x8e28('0x28')](function(){return _0x7dce1;});})[_0x8e28('0x28')](function(_0x46dee7){if(!_0x21a7f6[_0x8e28('0x68')]['Smtp'])return _0x46dee7;return db[_0x8e28('0x47')][_0x8e28('0x24')](_0x21a7f6[_0x8e28('0x68')][_0x8e28('0x44')],{'where':{'MailAccountId':_0x46dee7['id']}})[_0x8e28('0x28')](function(){return _0x46dee7;});})[_0x8e28('0x28')](respondWithResult(_0x490581,null))[_0x8e28('0x64')](handleError(_0x490581,null));};exports['describe']=function(_0x2383fa,_0x12ce68){return db[_0x8e28('0x4a')][_0x8e28('0x6c')]()[_0x8e28('0x28')](respondWithResult(_0x12ce68,null))[_0x8e28('0x64')](handleError(_0x12ce68,null));};exports[_0x8e28('0x6d')]=function(_0x46f9c7,_0x140a6a){if(_0x46f9c7['body']['id']){delete _0x46f9c7[_0x8e28('0x68')]['id'];}return db[_0x8e28('0x4a')][_0x8e28('0x67')]({'where':{'id':_0x46f9c7[_0x8e28('0x6a')]['id']}})[_0x8e28('0x28')](handleEntityNotFound(_0x140a6a,null))['then'](function(_0x15ac93){if(_0x15ac93){_0x46f9c7[_0x8e28('0x68')]['MailAccountId']=_0x15ac93['id'];return db['Disposition'][_0x8e28('0x6e')](_0x46f9c7[_0x8e28('0x68')]);}})['then'](respondWithResult(_0x140a6a,null))['catch'](handleError(_0x140a6a,null));};exports[_0x8e28('0x6f')]=function(_0x32492f,_0x3d9907){var _0x59df3c={'raw':![],'where':{}};var _0x1e4ff0={};var _0x2b2fc7={'count':0x0,'rows':[]};return db[_0x8e28('0x4a')][_0x8e28('0x70')]({'where':{'id':_0x32492f['params']['id']}})[_0x8e28('0x28')](handleEntityNotFound(_0x3d9907,null))['then'](function(_0xa55e96){if(_0xa55e96){_0x1e4ff0[_0x8e28('0x4f')]=_[_0x8e28('0x51')](db[_0x8e28('0x71')][_0x8e28('0x4b')]);_0x1e4ff0[_0x8e28('0x50')]=_['keys'](_0x32492f['query']);_0x1e4ff0[_0x8e28('0x59')]=_[_0x8e28('0x52')](_0x1e4ff0[_0x8e28('0x4f')],_0x1e4ff0[_0x8e28('0x50')]);_0x59df3c[_0x8e28('0x53')]=_[_0x8e28('0x52')](_0x1e4ff0[_0x8e28('0x4f')],qs[_0x8e28('0x54')](_0x32492f[_0x8e28('0x50')]['fields']));_0x59df3c[_0x8e28('0x53')]=_0x59df3c[_0x8e28('0x53')]['length']?_0x59df3c['attributes']:_0x1e4ff0[_0x8e28('0x4f')];if(!_0x32492f['query'][_0x8e28('0x72')](_0x8e28('0x56'))){_0x59df3c[_0x8e28('0x1f')]=qs[_0x8e28('0x1f')](_0x32492f['query']['limit']);_0x59df3c['offset']=qs['offset'](_0x32492f['query']['offset']);}_0x59df3c[_0x8e28('0x57')]=qs['sort'](_0x32492f[_0x8e28('0x50')][_0x8e28('0x58')]);_0x59df3c['where']=qs['filters'](_['pick'](_0x32492f[_0x8e28('0x50')],_0x1e4ff0[_0x8e28('0x59')]));_0x59df3c[_0x8e28('0x5b')][_0x8e28('0x73')]=_0xa55e96['id'];if(_0x32492f['query']['filter']){_0x59df3c[_0x8e28('0x5b')]=_[_0x8e28('0x5c')](_0x59df3c[_0x8e28('0x5b')],{'$or':_[_0x8e28('0x5d')](_0x59df3c[_0x8e28('0x53')],function(_0x23f5d3){var _0x5a47f0={};_0x5a47f0[_0x23f5d3]={'$like':'%'+_0x32492f[_0x8e28('0x50')][_0x8e28('0x5f')]+'%'};return _0x5a47f0;})});}_0x59df3c=_[_0x8e28('0x5c')]({},_0x59df3c,_0x32492f['options']);return db[_0x8e28('0x71')][_0x8e28('0x21')]({'where':_0x59df3c[_0x8e28('0x5b')]})[_0x8e28('0x28')](function(_0x320607){_0x2b2fc7[_0x8e28('0x21')]=_0x320607;if(_0x32492f[_0x8e28('0x50')][_0x8e28('0x61')]){_0x59df3c[_0x8e28('0x66')]=[{'all':!![]}];}return db[_0x8e28('0x71')][_0x8e28('0x62')](_0x59df3c);})[_0x8e28('0x28')](function(_0x4ff94d){_0x2b2fc7[_0x8e28('0x63')]=_0x4ff94d;return _0x2b2fc7;});}})[_0x8e28('0x28')](respondWithFilteredResult(_0x3d9907,_0x59df3c))['catch'](handleError(_0x3d9907,null));};exports[_0x8e28('0x74')]=function(_0x10e067,_0x380d93){return db[_0x8e28('0x4a')][_0x8e28('0x67')]({'where':{'id':_0x10e067[_0x8e28('0x6a')]['id']}})[_0x8e28('0x28')](handleEntityNotFound(_0x380d93,null))[_0x8e28('0x28')](function(_0xdfea2){if(_0xdfea2){return _0xdfea2[_0x8e28('0x74')](_0x10e067[_0x8e28('0x50')]['ids']);}})[_0x8e28('0x28')](respondWithStatusCode(_0x380d93,null))['catch'](handleError(_0x380d93,null));};exports[_0x8e28('0x75')]=function(_0x47855f,_0x5ea888){if(_0x47855f[_0x8e28('0x68')]['id']){delete _0x47855f[_0x8e28('0x68')]['id'];}return db[_0x8e28('0x4a')][_0x8e28('0x67')]({'where':{'id':_0x47855f[_0x8e28('0x6a')]['id']}})[_0x8e28('0x28')](handleEntityNotFound(_0x5ea888,null))[_0x8e28('0x28')](function(_0x37a6ef){if(_0x37a6ef){_0x47855f[_0x8e28('0x68')][_0x8e28('0x73')]=_0x37a6ef['id'];return db[_0x8e28('0x76')][_0x8e28('0x6e')](_0x47855f[_0x8e28('0x68')]);}})['then'](respondWithResult(_0x5ea888,null))[_0x8e28('0x64')](handleError(_0x5ea888,null));};exports['getAnswers']=function(_0x5dc4d1,_0x3c3462){var _0xc9dcf7={'raw':![],'where':{}};var _0x4a842e={};var _0x11b714={'count':0x0,'rows':[]};return db[_0x8e28('0x4a')][_0x8e28('0x70')]({'where':{'id':_0x5dc4d1['params']['id']}})[_0x8e28('0x28')](handleEntityNotFound(_0x3c3462,null))[_0x8e28('0x28')](function(_0x5648fd){if(_0x5648fd){_0x4a842e[_0x8e28('0x4f')]=_[_0x8e28('0x51')](db[_0x8e28('0x76')][_0x8e28('0x4b')]);_0x4a842e['query']=_['keys'](_0x5dc4d1[_0x8e28('0x50')]);_0x4a842e[_0x8e28('0x59')]=_[_0x8e28('0x52')](_0x4a842e[_0x8e28('0x4f')],_0x4a842e[_0x8e28('0x50')]);_0xc9dcf7[_0x8e28('0x53')]=_[_0x8e28('0x52')](_0x4a842e[_0x8e28('0x4f')],qs[_0x8e28('0x54')](_0x5dc4d1[_0x8e28('0x50')][_0x8e28('0x54')]));_0xc9dcf7['attributes']=_0xc9dcf7[_0x8e28('0x53')][_0x8e28('0x55')]?_0xc9dcf7[_0x8e28('0x53')]:_0x4a842e[_0x8e28('0x4f')];if(!_0x5dc4d1['query']['hasOwnProperty']('nolimit')){_0xc9dcf7[_0x8e28('0x1f')]=qs['limit'](_0x5dc4d1[_0x8e28('0x50')][_0x8e28('0x1f')]);_0xc9dcf7[_0x8e28('0x1e')]=qs['offset'](_0x5dc4d1[_0x8e28('0x50')][_0x8e28('0x1e')]);}_0xc9dcf7['order']=qs[_0x8e28('0x58')](_0x5dc4d1[_0x8e28('0x50')][_0x8e28('0x58')]);_0xc9dcf7[_0x8e28('0x5b')]=qs[_0x8e28('0x59')](_[_0x8e28('0x5a')](_0x5dc4d1[_0x8e28('0x50')],_0x4a842e[_0x8e28('0x59')]));_0xc9dcf7[_0x8e28('0x5b')]['MailAccountId']=_0x5648fd['id'];if(_0x5dc4d1[_0x8e28('0x50')][_0x8e28('0x5f')]){_0xc9dcf7[_0x8e28('0x5b')]=_['merge'](_0xc9dcf7[_0x8e28('0x5b')],{'$or':_[_0x8e28('0x5d')](_0xc9dcf7[_0x8e28('0x53')],function(_0x8dadfe){var _0x5a9fcb={};_0x5a9fcb[_0x8dadfe]={'$like':'%'+_0x5dc4d1[_0x8e28('0x50')][_0x8e28('0x5f')]+'%'};return _0x5a9fcb;})});}_0xc9dcf7=_[_0x8e28('0x5c')]({},_0xc9dcf7,_0x5dc4d1[_0x8e28('0x60')]);return db['CannedAnswer']['count']({'where':_0xc9dcf7[_0x8e28('0x5b')]})[_0x8e28('0x28')](function(_0x54ef0f){_0x11b714['count']=_0x54ef0f;if(_0x5dc4d1[_0x8e28('0x50')][_0x8e28('0x61')]){_0xc9dcf7[_0x8e28('0x66')]=[{'all':!![]}];}return db[_0x8e28('0x76')][_0x8e28('0x62')](_0xc9dcf7);})[_0x8e28('0x28')](function(_0x4dc39a){_0x11b714[_0x8e28('0x63')]=_0x4dc39a;return _0x11b714;});}})[_0x8e28('0x28')](respondWithFilteredResult(_0x3c3462,_0xc9dcf7))[_0x8e28('0x64')](handleError(_0x3c3462,null));};exports[_0x8e28('0x77')]=function(_0x3af47b,_0x5b5c44){return db[_0x8e28('0x4a')]['find']({'where':{'id':_0x3af47b[_0x8e28('0x6a')]['id']}})['then'](handleEntityNotFound(_0x5b5c44,null))['then'](function(_0x16f9b2){if(_0x16f9b2){return _0x16f9b2[_0x8e28('0x77')](_0x3af47b[_0x8e28('0x50')][_0x8e28('0x78')]);}})[_0x8e28('0x28')](respondWithStatusCode(_0x5b5c44,null))[_0x8e28('0x64')](handleError(_0x5b5c44,null));};exports['create']=function(_0x37c4c1,_0x21e36b){var _0x54a8a2={'name':_0x37c4c1['body'][_0x8e28('0x2b')],'key':_0x37c4c1[_0x8e28('0x68')]['key'],'provider':_0x37c4c1[_0x8e28('0x68')]['provider']==='custom'?null:_0x37c4c1[_0x8e28('0x68')][_0x8e28('0x69')],'email':_0x37c4c1[_0x8e28('0x68')][_0x8e28('0x79')],'ListId':_0x37c4c1[_0x8e28('0x68')][_0x8e28('0x7a')],'active':!_[_0x8e28('0x7b')](_0x37c4c1[_0x8e28('0x68')]['active'])?_0x37c4c1[_0x8e28('0x68')][_0x8e28('0x7c')]:!![],'description':_0x37c4c1[_0x8e28('0x68')][_0x8e28('0x7d')]||null};var _0x1239d9=getAuthenticationOptions(_0x54a8a2[_0x8e28('0x69')],_0x37c4c1[_0x8e28('0x68')]);_0x54a8a2['Imap']=_0x1239d9[_0x8e28('0x43')];_0x54a8a2[_0x8e28('0x44')]=_0x1239d9[_0x8e28('0x44')];return db[_0x8e28('0x4a')][_0x8e28('0x6e')](_0x54a8a2,{'include':[{'model':db['MailServerOut'],'as':'Smtp'},{'model':db[_0x8e28('0x46')],'as':_0x8e28('0x43')}]})[_0x8e28('0x28')](function(_0x52a2c8){var _0x22c977=_0x37c4c1['user'][_0x8e28('0x26')]({'plain':!![]});if(!_0x22c977)throw new Error(_0x8e28('0x7e'));if(_0x22c977[_0x8e28('0x7f')]===_0x8e28('0x38')){var _0x2ad586=_0x52a2c8[_0x8e28('0x26')]({'plain':!![]});return db[_0x8e28('0x80')][_0x8e28('0x67')]({'where':{'name':_0x8e28('0x81'),'userProfileId':_0x22c977[_0x8e28('0x82')]},'raw':!![]})[_0x8e28('0x28')](function(_0x486637){if(_0x486637&&_0x486637['autoAssociation']===0x0){return db[_0x8e28('0x27')][_0x8e28('0x6e')]({'name':_0x2ad586[_0x8e28('0x2b')],'resourceId':_0x2ad586['id'],'type':_0x486637[_0x8e28('0x2b')],'sectionId':_0x486637['id']},{})[_0x8e28('0x28')](function(){return _0x52a2c8;});}else{return _0x52a2c8;}})[_0x8e28('0x64')](function(_0x210941){logger['error'](_0x8e28('0x83'),_0x210941);throw _0x210941;});}return _0x52a2c8;})[_0x8e28('0x28')](respondWithResult(_0x21e36b,0xc9))[_0x8e28('0x64')](handleError(_0x21e36b,null));};exports['getImap']=function(_0xc0ae73,_0x54d50e){return db['MailAccount'][_0x8e28('0x70')]({'where':{'id':_0xc0ae73[_0x8e28('0x6a')]['id']}})['then'](handleEntityNotFound(_0x54d50e,null))[_0x8e28('0x28')](function(_0x2879e6){if(_0x2879e6){return _0x2879e6[_0x8e28('0x84')]();}return null;})[_0x8e28('0x28')](respondWithResult(_0x54d50e,null))['catch'](handleError(_0x54d50e,null));};exports[_0x8e28('0x85')]=function(_0x2acf9c,_0x3f9307){if(_0x2acf9c[_0x8e28('0x68')]['id']){delete _0x2acf9c[_0x8e28('0x68')]['id'];}return db[_0x8e28('0x4a')][_0x8e28('0x67')]({'where':{'id':_0x2acf9c['params']['id']}})[_0x8e28('0x28')](handleEntityNotFound(_0x3f9307,null))[_0x8e28('0x28')](function(_0x2f143a){if(_0x2f143a){_0x2acf9c[_0x8e28('0x68')][_0x8e28('0x73')]=_0x2f143a['id'];return db['MailServerIn'][_0x8e28('0x6e')](_0x2acf9c[_0x8e28('0x68')]);}})[_0x8e28('0x28')](respondWithResult(_0x3f9307,null))['catch'](handleError(_0x3f9307,null));};exports['removeImap']=function(_0x3ed902,_0x633b12){return db[_0x8e28('0x4a')][_0x8e28('0x70')]({'where':{'id':_0x3ed902['params']['id']}})[_0x8e28('0x28')](handleEntityNotFound(_0x633b12,null))[_0x8e28('0x28')](function(_0x3cfb48){if(_0x3cfb48){return _0x3cfb48[_0x8e28('0x86')](null);}return null;})['then'](respondWithStatusCode(_0x633b12,null))[_0x8e28('0x64')](handleError(_0x633b12,null));};exports['getSmtp']=function(_0x1e802a,_0x483df4){return db[_0x8e28('0x4a')][_0x8e28('0x70')]({'where':{'id':_0x1e802a['params']['id']}})['then'](handleEntityNotFound(_0x483df4,null))[_0x8e28('0x28')](function(_0x4e181f){if(_0x4e181f){return _0x4e181f[_0x8e28('0x87')]();}return null;})['then'](respondWithResult(_0x483df4,null))['catch'](handleError(_0x483df4,null));};exports[_0x8e28('0x88')]=function(_0x1eb3e4,_0x2f695a){if(_0x1eb3e4[_0x8e28('0x68')]['id']){delete _0x1eb3e4[_0x8e28('0x68')]['id'];}return db[_0x8e28('0x4a')][_0x8e28('0x67')]({'where':{'id':_0x1eb3e4['params']['id']}})['then'](handleEntityNotFound(_0x2f695a,null))[_0x8e28('0x28')](function(_0x14bb65){if(_0x14bb65){_0x1eb3e4[_0x8e28('0x68')][_0x8e28('0x73')]=_0x14bb65['id'];return db[_0x8e28('0x47')][_0x8e28('0x6e')](_0x1eb3e4['body']);}})[_0x8e28('0x28')](respondWithResult(_0x2f695a,null))[_0x8e28('0x64')](handleError(_0x2f695a,null));};exports[_0x8e28('0x89')]=function(_0x3e2294,_0x48e795){return db[_0x8e28('0x4a')][_0x8e28('0x70')]({'where':{'id':_0x3e2294[_0x8e28('0x6a')]['id']}})[_0x8e28('0x28')](handleEntityNotFound(_0x48e795,null))['then'](function(_0xc01f8e){if(_0xc01f8e){return _0xc01f8e[_0x8e28('0x8a')](null);}return null;})[_0x8e28('0x28')](respondWithStatusCode(_0x48e795,null))[_0x8e28('0x64')](handleError(_0x48e795,null));};exports[_0x8e28('0x8b')]=function(_0x2abbdc,_0x2da065){return db['MailInteraction'][_0x8e28('0x67')]({'where':{'id':_0x2abbdc['params']['id']}})[_0x8e28('0x28')](handleEntityNotFound(_0x2da065,null))[_0x8e28('0x28')](function(_0x4575d9){if(_0x4575d9){return _0x4575d9['addInteraction'](_0x2abbdc[_0x8e28('0x68')]['ids'],_[_0x8e28('0x8c')](_0x2abbdc['body'],['ids','id'])||{});}})[_0x8e28('0x28')](respondWithResult(_0x2da065,null))[_0x8e28('0x64')](handleError(_0x2da065,null));};exports['getInteractions']=function(_0x4a2ad0,_0x2e69e3){var _0x474f5c={'raw':![],'where':{}};var _0x120836={};var _0x4f62d4={'count':0x0,'rows':[]};return db['MailAccount'][_0x8e28('0x70')]({'where':{'id':_0x4a2ad0['params']['id']}})[_0x8e28('0x28')](handleEntityNotFound(_0x2e69e3,null))[_0x8e28('0x28')](function(_0x83832){if(_0x83832){_0x120836[_0x8e28('0x4f')]=_[_0x8e28('0x51')](db[_0x8e28('0x8d')]['rawAttributes']);_0x120836[_0x8e28('0x50')]=_[_0x8e28('0x51')](_0x4a2ad0[_0x8e28('0x50')]);_0x120836[_0x8e28('0x59')]=_[_0x8e28('0x52')](_0x120836[_0x8e28('0x4f')],_0x120836['query']);_0x474f5c['attributes']=_[_0x8e28('0x52')](_0x120836[_0x8e28('0x4f')],qs['fields'](_0x4a2ad0['query'][_0x8e28('0x54')]));_0x474f5c[_0x8e28('0x53')]=_0x474f5c[_0x8e28('0x53')][_0x8e28('0x55')]?_0x474f5c['attributes']:_0x120836['model'];if(!_0x4a2ad0['query'][_0x8e28('0x72')](_0x8e28('0x56'))){_0x474f5c[_0x8e28('0x1f')]=qs[_0x8e28('0x1f')](_0x4a2ad0[_0x8e28('0x50')]['limit']);_0x474f5c['offset']=qs['offset'](_0x4a2ad0['query']['offset']);}_0x474f5c[_0x8e28('0x57')]=qs[_0x8e28('0x58')](_0x4a2ad0[_0x8e28('0x50')]['sort']);_0x474f5c[_0x8e28('0x5b')]=qs['filters'](_[_0x8e28('0x5a')](_0x4a2ad0['query'],_0x120836['filters']));_0x474f5c['where']['MailAccountId']=_0x83832['id'];if(_0x4a2ad0[_0x8e28('0x50')][_0x8e28('0x5f')]){_0x474f5c['where']=_[_0x8e28('0x5c')](_0x474f5c[_0x8e28('0x5b')],{'$or':_['map'](_0x474f5c['attributes'],function(_0x3c3acb){var _0xe90e37={};_0xe90e37[_0x3c3acb]={'$like':'%'+_0x4a2ad0[_0x8e28('0x50')][_0x8e28('0x5f')]+'%'};return _0xe90e37;})});}_0x474f5c=_[_0x8e28('0x5c')]({},_0x474f5c,_0x4a2ad0[_0x8e28('0x60')]);return db[_0x8e28('0x8d')]['count']({'where':_0x474f5c[_0x8e28('0x5b')]})[_0x8e28('0x28')](function(_0xcfcd6f){_0x4f62d4[_0x8e28('0x21')]=_0xcfcd6f;if(_0x4a2ad0[_0x8e28('0x50')][_0x8e28('0x61')]){_0x474f5c['include']=[{'model':db[_0x8e28('0x8e')],'as':_0x8e28('0x8f'),'required':![]},{'model':db['User'],'as':_0x8e28('0x90'),'attributes':[_0x8e28('0x2b'),_0x8e28('0x91'),_0x8e28('0x92')],'required':![]},{'model':db[_0x8e28('0x93')],'as':_0x8e28('0x94'),'attributes':['id','name',_0x8e28('0x95')],'where':_0x4a2ad0[_0x8e28('0x50')][_0x8e28('0x96')]?{'id':_0x4a2ad0[_0x8e28('0x50')]['tag']}:undefined,'required':_0x4a2ad0[_0x8e28('0x50')][_0x8e28('0x96')]?!![]:![]}];}return db['MailInteraction'][_0x8e28('0x62')](_0x474f5c);})[_0x8e28('0x28')](function(_0x3daf39){_0x4f62d4[_0x8e28('0x63')]=_0x3daf39;return _0x4f62d4;});}})[_0x8e28('0x28')](respondWithFilteredResult(_0x2e69e3,_0x474f5c))[_0x8e28('0x64')](handleError(_0x2e69e3,null));};exports[_0x8e28('0x97')]=function addApplications(_0x4017df,_0x1df5be){var _0x2d045e=_0x4017df[_0x8e28('0x6a')]['id'];var _0x3cf2d2=_0x4017df[_0x8e28('0x68')];var _0x7071b9=0xc8;var _0x30660e=null;return db[_0x8e28('0x98')][_0x8e28('0x99')]({'isolationLevel':db[_0x8e28('0x98')][_0x8e28('0x9a')][_0x8e28('0x9b')][_0x8e28('0x9c')]},function(_0x14e607){return db[_0x8e28('0x4a')][_0x8e28('0x70')]({'where':{'id':_0x2d045e},'transaction':_0x14e607})['then'](function(_0x39c4fa){if(_0x39c4fa){return db['MailApplication'][_0x8e28('0x25')]({'where':{'MailAccountId':_0x2d045e},'transaction':_0x14e607})[_0x8e28('0x28')](function(){var _0x1b495d=_[_0x8e28('0x5d')](_0x3cf2d2,function(_0x243726){_0x243726[_0x8e28('0x73')]=_0x2d045e;return _0x243726;});return db[_0x8e28('0x9d')][_0x8e28('0x9e')](_0x1b495d,{'transaction':_0x14e607});});}else{_0x7071b9=0x194;_0x30660e=[];}});})[_0x8e28('0x28')](function(){if(_0x7071b9!==0x194){return db[_0x8e28('0x9d')][_0x8e28('0x9f')]({'where':{'MailAccountId':_0x2d045e},'order':_0x8e28('0xa0')})['then'](function(_0x3ade85){_0x30660e=_0x3ade85;});}})['catch'](function(_0x5e2dfa){_0x7071b9=0x1f4;logger['error'](_0x5e2dfa[_0x8e28('0xa1')]);if(_0x5e2dfa[_0x8e28('0x2b')]){delete _0x5e2dfa[_0x8e28('0x2b')];}_0x30660e=_0x5e2dfa;})[_0x8e28('0xa2')](function(){if(_0x30660e===null){_0x1df5be[_0x8e28('0x2a')](_0x7071b9);}else{if(_0x7071b9===0x1f4){_0x1df5be[_0x8e28('0x1c')](_0x7071b9)[_0x8e28('0x2c')](_0x30660e);}else{_0x1df5be['status'](_0x7071b9)['json'](_0x30660e);}}});};exports['getApplications']=function(_0x349426,_0x2e2a13){var _0x4ace01={};var _0x34e23f={};var _0xf38088;var _0x3c096e;return db[_0x8e28('0x4a')]['findOne']({'where':{'id':_0x349426['params']['id']}})[_0x8e28('0x28')](handleEntityNotFound(_0x2e2a13,null))[_0x8e28('0x28')](function(_0x334f96){if(_0x334f96){_0xf38088=_0x334f96;_0x34e23f['model']=_[_0x8e28('0x51')](db[_0x8e28('0x9d')][_0x8e28('0x4b')]);_0x34e23f[_0x8e28('0x50')]=_[_0x8e28('0x51')](_0x349426['query']);_0x34e23f[_0x8e28('0x59')]=_[_0x8e28('0x52')](_0x34e23f[_0x8e28('0x4f')],_0x34e23f['query']);_0x4ace01[_0x8e28('0x53')]=_[_0x8e28('0x52')](_0x34e23f['model'],qs['fields'](_0x349426[_0x8e28('0x50')]['fields']));_0x4ace01[_0x8e28('0x53')]=_0x4ace01[_0x8e28('0x53')]['length']?_0x4ace01[_0x8e28('0x53')]:_0x34e23f[_0x8e28('0x4f')];_0x4ace01['order']=qs[_0x8e28('0x58')](_0x349426[_0x8e28('0x50')]['sort']);_0x4ace01[_0x8e28('0x5b')]=qs[_0x8e28('0x59')](_['pick'](_0x349426[_0x8e28('0x50')],_0x34e23f['filters']));if(_0x349426[_0x8e28('0x50')][_0x8e28('0x5f')]){_0x4ace01[_0x8e28('0x5b')]=_[_0x8e28('0x5c')](_0x4ace01['where'],{'$or':_['map'](_0x4ace01[_0x8e28('0x53')],function(_0x3a5576){var _0x5a1bc2={};_0x5a1bc2[_0x3a5576]={'$like':'%'+_0x349426[_0x8e28('0x50')]['filter']+'%'};return _0x5a1bc2;})});}_0x4ace01=_['merge']({},_0x4ace01,_0x349426['options']);return _0xf38088['getApplications'](_0x4ace01);}})[_0x8e28('0x28')](function(_0x2eafcc){if(_0x2eafcc){_0x3c096e=_0x2eafcc[_0x8e28('0x55')];if(!_0x349426['query'][_0x8e28('0x72')](_0x8e28('0x56'))){_0x4ace01['limit']=qs[_0x8e28('0x1f')](_0x349426[_0x8e28('0x50')]['limit']);_0x4ace01[_0x8e28('0x1e')]=qs[_0x8e28('0x1e')](_0x349426['query'][_0x8e28('0x1e')]);}return _0xf38088[_0x8e28('0xa3')](_0x4ace01);}})['then'](function(_0x4458cd){if(_0x4458cd){return _0x4458cd?{'count':_0x3c096e,'rows':_0x4458cd}:null;}})[_0x8e28('0x28')](respondWithResult(_0x2e2a13,null))[_0x8e28('0x64')](handleError(_0x2e2a13,null));};exports[_0x8e28('0xa4')]=function(_0x2e39b8,_0x4f22e5){var _0x203954={'raw':!![],'where':{}};var _0x189104={};var _0xf1454c={'count':0x0,'rows':[]};return db[_0x8e28('0x4a')]['findOne']({'where':{'id':_0x2e39b8[_0x8e28('0x6a')]['id']}})[_0x8e28('0x28')](handleEntityNotFound(_0x4f22e5,null))[_0x8e28('0x28')](function(_0x4f7d98){if(_0x4f7d98){_0x189104['model']=_[_0x8e28('0x51')](db['MailMessage'][_0x8e28('0x4b')]);_0x189104['query']=_[_0x8e28('0x51')](_0x2e39b8[_0x8e28('0x50')]);_0x189104['filters']=_[_0x8e28('0x52')](_0x189104['model'],_0x189104[_0x8e28('0x50')]);_0x203954['attributes']=_[_0x8e28('0x52')](_0x189104[_0x8e28('0x4f')],qs[_0x8e28('0x54')](_0x2e39b8['query'][_0x8e28('0x54')]));_0x203954[_0x8e28('0x53')]=_0x203954['attributes'][_0x8e28('0x55')]?_0x203954[_0x8e28('0x53')]:_0x189104[_0x8e28('0x4f')];if(!_0x2e39b8[_0x8e28('0x50')]['hasOwnProperty'](_0x8e28('0x56'))){_0x203954[_0x8e28('0x1f')]=qs[_0x8e28('0x1f')](_0x2e39b8[_0x8e28('0x50')]['limit']);_0x203954['offset']=qs[_0x8e28('0x1e')](_0x2e39b8['query']['offset']);}_0x203954[_0x8e28('0x57')]=qs['sort'](_0x2e39b8['query']['sort']);_0x203954[_0x8e28('0x5b')]=qs[_0x8e28('0x59')](_[_0x8e28('0x5a')](_0x2e39b8['query'],_0x189104[_0x8e28('0x59')]));_0x203954[_0x8e28('0x5b')]['MailAccountId']=_0x4f7d98['id'];if(_0x2e39b8[_0x8e28('0x50')][_0x8e28('0x5f')]){_0x203954[_0x8e28('0x5b')]=_['merge'](_0x203954[_0x8e28('0x5b')],{'$or':_[_0x8e28('0x5d')](_0x203954[_0x8e28('0x53')],function(_0x48881f){var _0x502f26={};_0x502f26[_0x48881f]={'$like':'%'+_0x2e39b8[_0x8e28('0x50')][_0x8e28('0x5f')]+'%'};return _0x502f26;})});}if(_0x2e39b8['query'][_0x8e28('0xa5')]){var _0x1a6d60=_0x2e39b8['query'][_0x8e28('0xa5')]['split'](',');var _0x341f69={};_0x341f69[_0x1a6d60[0x0]]={'$gte':moment(_0x1a6d60[0x1])[_0x8e28('0xa6')](_0x8e28('0xa7'))};_0x203954[_0x8e28('0x5b')]=_[_0x8e28('0x5c')](_0x203954[_0x8e28('0x5b')],_0x341f69);}_0x203954=_[_0x8e28('0x5c')]({},_0x203954,_0x2e39b8[_0x8e28('0x60')]);return db[_0x8e28('0xa8')][_0x8e28('0x21')]({'where':_0x203954[_0x8e28('0x5b')]})['then'](function(_0x15b39c){_0xf1454c[_0x8e28('0x21')]=_0x15b39c;if(_0x2e39b8[_0x8e28('0x50')]['includeAll']){_0x203954['include']=[{'all':!![]}];}return db[_0x8e28('0xa8')][_0x8e28('0x62')](_0x203954);})[_0x8e28('0x28')](function(_0x378d09){if(_0x2e39b8[_0x8e28('0x50')][_0x8e28('0xa9')]===_0x8e28('0xaa')){for(var _0xfcf647=0x0;_0xfcf647<_0x378d09['length'];_0xfcf647++){_0x378d09[_0xfcf647][_0x8e28('0x68')]=juice(_0x378d09[_0xfcf647][_0x8e28('0x68')]);}}_0xf1454c[_0x8e28('0x63')]=_0x378d09;return _0xf1454c;});}})['then'](respondWithFilteredResult(_0x4f22e5,_0x203954))['catch'](handleError(_0x4f22e5,null));};exports['send']=function(_0x25bbf1,_0x188e62){var _0x9687ea,_0x1c9a79={},_0x4c3d1e;if(_0x25bbf1[_0x8e28('0x68')]['to']){_0x4c3d1e=_0x25bbf1[_0x8e28('0x68')]['to'][_0x8e28('0xab')](',')[0x0];}return db['MailAccount'][_0x8e28('0x67')]({'where':{'id':_0x25bbf1[_0x8e28('0x6a')]['id']},'include':[{'model':db['CmList'],'as':_0x8e28('0xac'),'include':[{'model':db[_0x8e28('0x8e')],'as':_0x8e28('0xad'),'where':{'email':_0x4c3d1e},'limit':0x1,'order':[['updatedAt',_0x8e28('0xae')]]}]},{'model':db[_0x8e28('0x47')],'as':'Smtp','raw':!![],'include':[{'model':db[_0x8e28('0xaf')],'as':_0x8e28('0xaf'),'raw':!![]}]}]})[_0x8e28('0x28')](handleEntityNotFound(_0x188e62,null))[_0x8e28('0x28')](function(_0x3075ee){if(!_0x3075ee)return;_0x9687ea=_0x3075ee;if(!_0x3075ee['Smtp'])throw new Error('Smtp\x20configuration\x20not\x20found');if(_[_0x8e28('0x7b')](_0x25bbf1[_0x8e28('0x68')][_0x8e28('0xb0')])){_0x25bbf1[_0x8e28('0x68')][_0x8e28('0xb0')]=util[_0x8e28('0xa6')]('%s\x20<%s>',_0x3075ee[_0x8e28('0x2b')],_0x3075ee['email']||_0x3075ee[_0x8e28('0x44')][_0x8e28('0x38')]);}if(_0x25bbf1[_0x8e28('0x68')][_0x8e28('0xb1')]&&_0x25bbf1[_0x8e28('0x68')][_0x8e28('0xb1')][_0x8e28('0x55')]){for(var _0x110d2d=0x0;_0x110d2d<_0x25bbf1['body'][_0x8e28('0xb1')]['length'];_0x110d2d+=0x1){_0x25bbf1['body'][_0x8e28('0xb1')][_0x110d2d]={'filename':_0x25bbf1['body']['attachments'][_0x110d2d][_0x8e28('0x2b')],'path':path[_0x8e28('0xb2')](config[_0x8e28('0xb3')],'server/files/attachments',_0x25bbf1['body'][_0x8e28('0xb1')][_0x110d2d][_0x8e28('0xb4')])};}}var _0x4ac09a=_0x3075ee[_0x8e28('0xb5')]();return respondWithRpcPromise(_0x8e28('0xb6'),'sendMail',{'account':_0x4ac09a,'message':_0x25bbf1[_0x8e28('0x68')]});})[_0x8e28('0x28')](function(_0x1dbf99){if(!_0x1dbf99)return;_0x1c9a79=_0x1dbf99;if(!_0x9687ea[_0x8e28('0xac')])throw new Error(_0x8e28('0xb7'));if(_0x9687ea[_0x8e28('0xac')][_0x8e28('0xad')][_0x8e28('0x55')])return _0x9687ea[_0x8e28('0xac')][_0x8e28('0xad')][0x0];return db[_0x8e28('0x8e')][_0x8e28('0x6e')](_[_0x8e28('0xc')](_0x25bbf1[_0x8e28('0x68')],{'firstName':_0x25bbf1[_0x8e28('0x68')]['to'],'email':_0x25bbf1['body']['to'],'phone':_0x25bbf1['body']['to'],'ListId':_0x9687ea[_0x8e28('0x7a')]}));})[_0x8e28('0x28')](function(_0xaefea2){if(!_0xaefea2)return;var _0x3dceb7={'UserId':_0x25bbf1[_0x8e28('0x38')]['id'],'ContactId':_0xaefea2['id'],'MailAccountId':_0x9687ea['id'],'inReplyTo':_0x1c9a79['messageId'],'to':_0x25bbf1[_0x8e28('0x68')][_0x8e28('0xb0')],'cc':_0x25bbf1[_0x8e28('0x68')]['cc'],'subject':_0x25bbf1[_0x8e28('0x68')]['subject'],'attach':_0x25bbf1[_0x8e28('0x68')][_0x8e28('0xb8')],'firstMsgDirection':_0x8e28('0xb9'),'lastMsgAt':moment()[_0x8e28('0xa6')](_0x8e28('0xa7')),'lastMsgDirection':_0x8e28('0xb9'),'Messages':[_['merge'](_0x25bbf1[_0x8e28('0x68')],{'messageId':_0x1c9a79[_0x8e28('0xba')],'sentAt':moment()['format'](_0x8e28('0xa7')),'read':!![],'MailAccountId':_0x9687ea['id'],'UserId':_0x25bbf1[_0x8e28('0x38')]['id'],'ContactId':_0xaefea2['id']})]};if(_0x25bbf1[_0x8e28('0x68')][_0x8e28('0xbb')]){_0x3dceb7=_['merge'](_0x3dceb7,_0x25bbf1[_0x8e28('0x68')]['Interaction']);}return db[_0x8e28('0x8d')][_0x8e28('0x6e')](_0x3dceb7,{'include':[{'model':db[_0x8e28('0xa8')],'as':_0x8e28('0xbc')}]});})['then'](respondWithResult(_0x188e62,null))[_0x8e28('0x64')](handleError(_0x188e62,null));};exports[_0x8e28('0xbd')]=function(_0x52e0c2,_0x320bf6){return db['MailAccount'][_0x8e28('0x67')]({'where':{'id':_0x52e0c2[_0x8e28('0x6a')]['id']},'include':[{'model':db[_0x8e28('0x47')],'as':_0x8e28('0x44'),'raw':!![],'include':[{'model':db[_0x8e28('0xaf')],'as':_0x8e28('0xaf'),'raw':!![]}]}]})['then'](handleEntityNotFound(_0x320bf6,null))['then'](function(_0x5792fb){if(!_0x5792fb['Smtp'])return;var _0x2fb3e0=_0x5792fb['getSmtpOptions']();return respondWithRpcPromise('VerifySmtp',_0x8e28('0xbd'),{'account':_0x2fb3e0});})[_0x8e28('0x28')](respondWithResult(_0x320bf6,null))[_0x8e28('0x64')](handleError(_0x320bf6,null));};exports[_0x8e28('0x25')]=function(_0x147b3e,_0x53c9bd){return db[_0x8e28('0x4a')][_0x8e28('0x67')]({'where':{'id':_0x147b3e['params']['id']}})[_0x8e28('0x28')](handleEntityNotFound(_0x53c9bd,null))[_0x8e28('0x28')](function(_0x12b4f8){if(_0x12b4f8&&_0x12b4f8[_0x8e28('0x41')]){throw new db[(_0x8e28('0xbe'))][(_0x8e28('0xbf'))](_0x8e28('0xc0'));}return _0x12b4f8;})[_0x8e28('0x28')](removeEntity(_0x53c9bd,null))[_0x8e28('0x64')](handleError(_0x53c9bd,null));};exports[_0x8e28('0xc1')]=function(_0x308008,_0x1ed2c1){return db[_0x8e28('0x4a')][_0x8e28('0x67')]({'where':{'id':_0x308008[_0x8e28('0x6a')]['id']}})['then'](handleEntityNotFound(_0x1ed2c1,null))[_0x8e28('0x28')](function(_0x72cf4b){if(_0x72cf4b){return _0x72cf4b[_0x8e28('0xc1')](_0x308008[_0x8e28('0x68')][_0x8e28('0x78')],_[_0x8e28('0x8c')](_0x308008[_0x8e28('0x68')],['ids','id'])||{})[_0x8e28('0xc2')](function(_0xa2a09c){for(var _0x57a34d=0x0;_0x57a34d<_0x308008[_0x8e28('0x68')][_0x8e28('0x78')][_0x8e28('0x55')];_0x57a34d+=0x1){socket['emit']('userMailAccount:save',{'UserId':Number(_0x308008[_0x8e28('0x68')]['ids'][_0x57a34d]),'MailAccountId':Number(_0x308008[_0x8e28('0x6a')]['id'])});}return _0xa2a09c;});}})[_0x8e28('0x28')](respondWithResult(_0x1ed2c1,null))[_0x8e28('0x64')](handleError(_0x1ed2c1,null));};exports[_0x8e28('0xc3')]=function(_0xbc539b,_0x32eaf7){return db[_0x8e28('0x4a')][_0x8e28('0x67')]({'where':{'id':_0xbc539b[_0x8e28('0x6a')]['id']}})['then'](handleEntityNotFound(_0x32eaf7,null))[_0x8e28('0x28')](function(_0x1c8bb3){if(_0x1c8bb3){return _0x1c8bb3[_0x8e28('0xc3')](_0xbc539b['query'][_0x8e28('0x78')])[_0x8e28('0x28')](function(){if(_[_0x8e28('0xc4')](_0xbc539b[_0x8e28('0x50')][_0x8e28('0x78')])){for(var _0x3428c2=0x0;_0x3428c2<_0xbc539b[_0x8e28('0x50')]['ids'][_0x8e28('0x55')];_0x3428c2+=0x1){socket[_0x8e28('0xc5')](_0x8e28('0xc6'),{'UserId':Number(_0xbc539b[_0x8e28('0x50')][_0x8e28('0x78')][_0x3428c2]),'MailAccountId':Number(_0xbc539b[_0x8e28('0x6a')]['id'])});}}else{socket[_0x8e28('0xc5')](_0x8e28('0xc6'),{'UserId':Number(_0xbc539b[_0x8e28('0x50')]['ids']),'MailAccountId':Number(_0xbc539b[_0x8e28('0x6a')]['id'])});}});}})['then'](respondWithStatusCode(_0x32eaf7,null))[_0x8e28('0x64')](handleError(_0x32eaf7,null));};exports['getAgents']=function(_0x279ac9,_0x129078){var _0x1e3c40={};var _0x57f343={};var _0x5e0f9f;var _0x143d1f;return db['MailAccount'][_0x8e28('0x70')]({'where':{'id':_0x279ac9[_0x8e28('0x6a')]['id']}})[_0x8e28('0x28')](handleEntityNotFound(_0x129078,null))[_0x8e28('0x28')](function(_0x57a81b){if(_0x57a81b){_0x5e0f9f=_0x57a81b;_0x57f343[_0x8e28('0x4f')]=_['keys'](db[_0x8e28('0xc7')][_0x8e28('0x4b')]);_0x57f343[_0x8e28('0x50')]=_['keys'](_0x279ac9[_0x8e28('0x50')]);_0x57f343[_0x8e28('0x59')]=_[_0x8e28('0x52')](_0x57f343['model'],_0x57f343[_0x8e28('0x50')]);_0x1e3c40['attributes']=_[_0x8e28('0x52')](_0x57f343[_0x8e28('0x4f')],qs[_0x8e28('0x54')](_0x279ac9[_0x8e28('0x50')]['fields']));_0x1e3c40['attributes']=_0x1e3c40[_0x8e28('0x53')][_0x8e28('0x55')]?_0x1e3c40[_0x8e28('0x53')]:_0x57f343[_0x8e28('0x4f')];_0x1e3c40['order']=qs['sort'](_0x279ac9[_0x8e28('0x50')][_0x8e28('0x58')]);_0x1e3c40[_0x8e28('0x5b')]=qs['filters'](_[_0x8e28('0x5a')](_0x279ac9['query'],_0x57f343[_0x8e28('0x59')]));if(_0x279ac9[_0x8e28('0x50')]['filter']){_0x1e3c40[_0x8e28('0x5b')]=_[_0x8e28('0x5c')](_0x1e3c40[_0x8e28('0x5b')],{'$or':_['map'](_0x1e3c40[_0x8e28('0x53')],function(_0x597c89){var _0x15a769={};_0x15a769[_0x597c89]={'$like':'%'+_0x279ac9['query'][_0x8e28('0x5f')]+'%'};return _0x15a769;})});}_0x1e3c40=_['merge']({},_0x1e3c40,_0x279ac9[_0x8e28('0x60')]);return _0x5e0f9f[_0x8e28('0xc8')](_0x1e3c40);}})[_0x8e28('0x28')](function(_0x142a31){if(_0x142a31){_0x143d1f=_0x142a31[_0x8e28('0x55')];if(!_0x279ac9[_0x8e28('0x50')]['hasOwnProperty'](_0x8e28('0x56'))){_0x1e3c40['limit']=qs[_0x8e28('0x1f')](_0x279ac9[_0x8e28('0x50')][_0x8e28('0x1f')]);_0x1e3c40[_0x8e28('0x1e')]=qs[_0x8e28('0x1e')](_0x279ac9[_0x8e28('0x50')]['offset']);}return _0x5e0f9f['getAgents'](_0x1e3c40);}})[_0x8e28('0x28')](function(_0x1b5233){if(_0x1b5233){return _0x1b5233?{'count':_0x143d1f,'rows':_0x1b5233}:null;}})[_0x8e28('0x28')](respondWithResult(_0x129078,null))['catch'](handleError(_0x129078,null));}; \ No newline at end of file +var _0x8089=['addSmtp','removeSmtp','MailInteraction','omit','CmContact','Contact','User','Owner','Tag','Tags','color','tag','addApplications','sequelize','transaction','Transaction','ISOLATION_LEVELS','READ_COMMITTED','MailApplication','bulkCreate','priority','finally','getApplications','getMessages','MailMessage','$gte','split','format','YYYY-MM-DD\x20HH:mm:ss','inlineCss','true','send','CmList','List','CloudProvider','from','%s\x20<%s>','attachments','join','root','getSmtpOptions','sendMail','Contacts','defaults','ListId','messageId','subject','attach','out','Interaction','verifySmtp','VerifySmtp','ValidationError','You\x20can\x27t\x20remove\x20the\x20mail\x20service\x20account','addAgents','spread','emit','userMailAccount:save','removeAgents','isArray','userMailAccount:remove','getAgents','moment','bluebird','util','path','lodash','ioredis','../../components/parsers/qs','../../config/logger','api','../../config/environment','../../mysqldb','redis','localhost','register','jayson/promise','http','request','then','info','MailAccount,\x20%s,\x20%s','request\x20sent','debug','MailAccount,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','sendStatus','status','offset','undefined','count','limit','set','Content-Range','json','update','get','MailAccounts','destroy','end','stack','name','gmail','imap.gmail.com','yahoo','imap.mail.yahoo.com','hotmail','imap-mail.outlook.com','outlook365','outlook.office365.com','smtp.gmail.com','smtp.mail.yahoo.com','smtp-mail.outlook.com','Unknown\x20email\x20service\x20provider','user','username','password','pass','modernAuthentication','CloudProviderId','port','host','secure','service','authentication','Smtp','index','MailServerIn','MailServerOut','Pause','mandatoryDispositionPause','map','MailAccount','rawAttributes','fieldName','type','key','model','query','keys','intersection','attributes','fields','length','nolimit','sort','where','filters','pick','filter','VIRTUAL','options','includeAll','include','params','Imap','merge','find','body','custom','provider','describe','addDisposition','Disposition','hasOwnProperty','order','MailAccountId','findAll','rows','removeDispositions','ids','addAnswer','findOne','CannedAnswer','removeAnswers','email','isNil','active','description','create','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','autoAssociation','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','getImap','addImap','setImap','getSmtp'];(function(_0x330740,_0x58c0c0){var _0x1cb5f2=function(_0xa5c99a){while(--_0xa5c99a){_0x330740['push'](_0x330740['shift']());}};_0x1cb5f2(++_0x58c0c0);}(_0x8089,0x1c2));var _0x9808=function(_0x7adc1a,_0x28d36d){_0x7adc1a=_0x7adc1a-0x0;var _0x462690=_0x8089[_0x7adc1a];return _0x462690;};'use strict';var moment=require(_0x9808('0x0'));var BPromise=require(_0x9808('0x1'));var util=require(_0x9808('0x2'));var path=require(_0x9808('0x3'));var _=require(_0x9808('0x4'));var juice=require('juice');var Redis=require(_0x9808('0x5'));var qs=require(_0x9808('0x6'));var logger=require(_0x9808('0x7'))(_0x9808('0x8'));var config=require(_0x9808('0x9'));var db=require(_0x9808('0xa'))['db'];config[_0x9808('0xb')]=_['defaults'](config[_0x9808('0xb')],{'host':_0x9808('0xc'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x9808('0xb')]));require('./mailAccount.socket')[_0x9808('0xd')](socket);var jayson=require(_0x9808('0xe'));var client=jayson['client'][_0x9808('0xf')]({'port':0x232b});function respondWithRpcPromise(_0x5b8cbe,_0x3d52f9,_0x353488,_0x50f17b){return new BPromise(function(_0xae13d7,_0x6911d5){var _0x10195a=_0x50f17b||client;return _0x10195a[_0x9808('0x10')](_0x5b8cbe,_0x353488)[_0x9808('0x11')](function(_0x21b9d1){logger[_0x9808('0x12')](_0x9808('0x13'),_0x3d52f9,_0x9808('0x14'));logger[_0x9808('0x15')](_0x9808('0x16'),_0x3d52f9,_0x9808('0x14'),JSON['stringify'](_0x21b9d1));if(_0x21b9d1[_0x9808('0x17')]){if(_0x21b9d1[_0x9808('0x17')][_0x9808('0x18')]===0x1f4){logger[_0x9808('0x17')]('MailAccount,\x20%s,\x20%s',_0x3d52f9,_0x21b9d1[_0x9808('0x17')][_0x9808('0x19')]);return _0x6911d5(_0x21b9d1[_0x9808('0x17')][_0x9808('0x19')]);}logger['error'](_0x9808('0x13'),_0x3d52f9,_0x21b9d1[_0x9808('0x17')]['message']);return _0xae13d7(_0x21b9d1[_0x9808('0x17')]['message']);}else{logger['info'](_0x9808('0x13'),_0x3d52f9,_0x9808('0x14'));_0xae13d7(_0x21b9d1[_0x9808('0x1a')][_0x9808('0x19')]);}})[_0x9808('0x1b')](function(_0x3ef513){logger['error']('MailAccount,\x20%s,\x20%s',_0x3d52f9,_0x3ef513);_0x6911d5(_0x3ef513);});});}function respondWithStatusCode(_0x59f8fe,_0x49edcc){_0x49edcc=_0x49edcc||0xcc;return function(_0x833a6e){if(_0x833a6e){return _0x59f8fe[_0x9808('0x1c')](_0x49edcc);}return _0x59f8fe[_0x9808('0x1d')](_0x49edcc)['end']();};}function respondWithResult(_0x195be1,_0x1649ed){_0x1649ed=_0x1649ed||0xc8;return function(_0x20e01b){if(_0x20e01b){return _0x195be1['status'](_0x1649ed)['json'](_0x20e01b);}};}function respondWithFilteredResult(_0x5d3f08,_0x53211b){return function(_0xdede3d){if(_0xdede3d){var _0x442207=typeof _0x53211b[_0x9808('0x1e')]===_0x9808('0x1f')&&typeof _0x53211b['limit']==='undefined';var _0x648c8=_0xdede3d[_0x9808('0x20')];var _0x2e1ae5=_0x442207?0x0:_0x53211b[_0x9808('0x1e')];var _0x42e23c=_0x442207?_0xdede3d[_0x9808('0x20')]:_0x53211b[_0x9808('0x1e')]+_0x53211b[_0x9808('0x21')];var _0x285306;if(_0x42e23c>=_0x648c8){_0x42e23c=_0x648c8;_0x285306=0xc8;}else{_0x285306=0xce;}_0x5d3f08[_0x9808('0x1d')](_0x285306);return _0x5d3f08[_0x9808('0x22')](_0x9808('0x23'),_0x2e1ae5+'-'+_0x42e23c+'/'+_0x648c8)[_0x9808('0x24')](_0xdede3d);}return null;};}function saveUpdates(_0x33c4d4){return function(_0x133dbb){if(_0x133dbb){return _0x133dbb[_0x9808('0x25')](_0x33c4d4)['then'](function(_0x2f344f){return _0x2f344f;});}return null;};}function removeEntity(_0x2c67b0){return function(_0x52285e){if(_0x52285e){return _0x52285e['destroy']()['then'](function(){var _0x268629=_0x52285e[_0x9808('0x26')]({'plain':!![]});var _0x13c990=_0x9808('0x27');return db['UserProfileResource'][_0x9808('0x28')]({'where':{'type':_0x13c990,'resourceId':_0x268629['id']}})['then'](function(){return _0x52285e;});})[_0x9808('0x11')](function(){_0x2c67b0[_0x9808('0x1d')](0xcc)[_0x9808('0x29')]();});}};}function handleEntityNotFound(_0x163438){return function(_0x1d8eee){if(!_0x1d8eee){_0x163438[_0x9808('0x1c')](0x194);}return _0x1d8eee;};}function handleError(_0x487bdc,_0x2dd89f){_0x2dd89f=_0x2dd89f||0x1f4;return function(_0x2f5cad){logger['error'](_0x2f5cad[_0x9808('0x2a')]);if(_0x2f5cad[_0x9808('0x2b')]){delete _0x2f5cad[_0x9808('0x2b')];}_0x487bdc['status'](_0x2dd89f)['send'](_0x2f5cad);};}function getImapHost(_0x144492){switch(_0x144492){case _0x9808('0x2c'):return _0x9808('0x2d');case _0x9808('0x2e'):return _0x9808('0x2f');case _0x9808('0x30'):return _0x9808('0x31');case _0x9808('0x32'):return _0x9808('0x33');}throw new Error('Unknown\x20email\x20service\x20provider',_0x144492);}function getSmtpHost(_0x2b8dae){switch(_0x2b8dae){case _0x9808('0x2c'):return _0x9808('0x34');case _0x9808('0x2e'):return _0x9808('0x35');case'hotmail':return _0x9808('0x36');case _0x9808('0x32'):return'smtp.office365.com';}throw new Error(_0x9808('0x37'),_0x2b8dae);}function getAuthenticationOptions(_0x2bd000,_0x240469){var _0x149da1={};var _0x16faa2={};if(_0x2bd000){_0x149da1['user']=_0x16faa2[_0x9808('0x38')]=_0x240469[_0x9808('0x39')];_0x149da1[_0x9808('0x3a')]=_0x16faa2[_0x9808('0x3b')]=_0x240469[_0x9808('0x3a')];if(_0x240469[_0x9808('0x3c')]){_0x149da1[_0x9808('0x3c')]=_0x16faa2[_0x9808('0x3c')]=!![];_0x149da1[_0x9808('0x3d')]=_0x16faa2[_0x9808('0x3d')]=_0x240469[_0x9808('0x3d')];_0x149da1[_0x9808('0x3a')]=_0x16faa2['pass']=null;}else{_0x149da1[_0x9808('0x3d')]=_0x16faa2[_0x9808('0x3d')]=null;}_0x149da1['host']=getImapHost(_0x2bd000);_0x149da1[_0x9808('0x3e')]=0x3e1;_0x16faa2[_0x9808('0x3f')]=getSmtpHost(_0x2bd000);_0x16faa2['port']=0x24b;_0x16faa2[_0x9808('0x40')]=![];_0x149da1[_0x9808('0x41')]=_0x16faa2['service']=null;}else{if(_0x240469['authentication']){_0x149da1[_0x9808('0x38')]=_0x16faa2[_0x9808('0x38')]=_0x240469[_0x9808('0x39')];_0x149da1[_0x9808('0x3a')]=_0x16faa2[_0x9808('0x3b')]=_0x240469[_0x9808('0x3a')];}else{_0x149da1['authentication']=_0x16faa2[_0x9808('0x42')]=![];_0x149da1[_0x9808('0x38')]=_0x16faa2['user']=null;_0x149da1[_0x9808('0x3a')]=_0x16faa2['pass']=null;}_0x149da1[_0x9808('0x3f')]=_0x240469['Imap'][_0x9808('0x3f')];_0x149da1[_0x9808('0x3e')]=_0x240469['Imap']['port'];_0x16faa2[_0x9808('0x3f')]=_0x240469[_0x9808('0x43')][_0x9808('0x3f')];_0x16faa2[_0x9808('0x3e')]=_0x240469[_0x9808('0x43')][_0x9808('0x3e')];}return{'Imap':_0x149da1,'Smtp':_0x16faa2};}exports[_0x9808('0x44')]=function(_0x5cb824,_0x2da8b6){var _0x5e04c1={'include':[{'model':db[_0x9808('0x45')],'as':'Imap'},{'model':db[_0x9808('0x46')],'as':_0x9808('0x43')},{'model':db[_0x9808('0x47')],'as':_0x9808('0x48')}]},_0x9840={},_0xad5a41={'count':0x0,'rows':[]};var _0x32d2b8=_[_0x9808('0x49')](db[_0x9808('0x4a')][_0x9808('0x4b')],function(_0x488021){return{'name':_0x488021[_0x9808('0x4c')],'type':_0x488021[_0x9808('0x4d')][_0x9808('0x4e')]};});_0x9840[_0x9808('0x4f')]=_[_0x9808('0x49')](_0x32d2b8,_0x9808('0x2b'));_0x9840[_0x9808('0x50')]=_[_0x9808('0x51')](_0x5cb824[_0x9808('0x50')]);_0x9840['filters']=_[_0x9808('0x52')](_0x9840[_0x9808('0x4f')],_0x9840[_0x9808('0x50')]);_0x5e04c1[_0x9808('0x53')]=_[_0x9808('0x52')](_0x9840[_0x9808('0x4f')],qs[_0x9808('0x54')](_0x5cb824[_0x9808('0x50')][_0x9808('0x54')]));_0x5e04c1[_0x9808('0x53')]=_0x5e04c1[_0x9808('0x53')][_0x9808('0x55')]?_0x5e04c1[_0x9808('0x53')]:_0x9840[_0x9808('0x4f')];if(!_0x5cb824[_0x9808('0x50')]['hasOwnProperty'](_0x9808('0x56'))){_0x5e04c1[_0x9808('0x21')]=qs[_0x9808('0x21')](_0x5cb824[_0x9808('0x50')]['limit']);_0x5e04c1[_0x9808('0x1e')]=qs[_0x9808('0x1e')](_0x5cb824['query'][_0x9808('0x1e')]);}_0x5e04c1['order']=qs[_0x9808('0x57')](_0x5cb824['query'][_0x9808('0x57')]);_0x5e04c1[_0x9808('0x58')]=qs[_0x9808('0x59')](_[_0x9808('0x5a')](_0x5cb824[_0x9808('0x50')],_0x9840[_0x9808('0x59')]),_0x32d2b8);if(_0x5cb824['query'][_0x9808('0x5b')]){_0x5e04c1[_0x9808('0x58')]=_['merge'](_0x5e04c1['where'],{'$or':_[_0x9808('0x49')](_0x32d2b8,function(_0x4cbb1d){if(_0x4cbb1d[_0x9808('0x4d')]!==_0x9808('0x5c')){var _0xafb43f={};_0xafb43f[_0x4cbb1d[_0x9808('0x2b')]]={'$like':'%'+_0x5cb824['query'][_0x9808('0x5b')]+'%'};return _0xafb43f;}})});}_0x5e04c1=_['merge']({},_0x5e04c1,_0x5cb824[_0x9808('0x5d')]);var _0x27b49e={'where':_0x5e04c1[_0x9808('0x58')]};return db['MailAccount'][_0x9808('0x20')](_0x27b49e)[_0x9808('0x11')](function(_0x29e43f){_0xad5a41[_0x9808('0x20')]=_0x29e43f;if(_0x5cb824[_0x9808('0x50')][_0x9808('0x5e')]){_0x5e04c1[_0x9808('0x5f')]=[{'all':!![]}];}return db['MailAccount']['findAll'](_0x5e04c1);})[_0x9808('0x11')](function(_0x4b84cb){_0xad5a41['rows']=_0x4b84cb;return _0xad5a41;})[_0x9808('0x11')](respondWithFilteredResult(_0x2da8b6,_0x5e04c1))[_0x9808('0x1b')](handleError(_0x2da8b6,null));};exports['show']=function(_0x433c75,_0xfb8253){var _0x447f1c={'raw':![],'where':{'id':_0x433c75[_0x9808('0x60')]['id']},'include':[{'model':db[_0x9808('0x45')],'as':_0x9808('0x61')},{'model':db[_0x9808('0x46')],'as':_0x9808('0x43')},{'model':db[_0x9808('0x47')],'as':_0x9808('0x48')}]},_0x184ccb={};_0x184ccb[_0x9808('0x4f')]=_['keys'](db['MailAccount'][_0x9808('0x4b')]);_0x184ccb[_0x9808('0x50')]=_[_0x9808('0x51')](_0x433c75[_0x9808('0x50')]);_0x184ccb[_0x9808('0x59')]=_[_0x9808('0x52')](_0x184ccb['model'],_0x184ccb['query']);_0x447f1c['attributes']=_[_0x9808('0x52')](_0x184ccb['model'],qs['fields'](_0x433c75[_0x9808('0x50')][_0x9808('0x54')]));_0x447f1c[_0x9808('0x53')]=_0x447f1c['attributes'][_0x9808('0x55')]?_0x447f1c['attributes']:_0x184ccb['model'];if(_0x433c75[_0x9808('0x50')][_0x9808('0x5e')]){_0x447f1c[_0x9808('0x5f')]=[{'all':!![]}];}_0x447f1c=_[_0x9808('0x62')]({},_0x447f1c,_0x433c75[_0x9808('0x5d')]);return db['MailAccount'][_0x9808('0x63')](_0x447f1c)[_0x9808('0x11')](handleEntityNotFound(_0xfb8253,null))[_0x9808('0x11')](respondWithResult(_0xfb8253,null))[_0x9808('0x1b')](handleError(_0xfb8253,null));};exports[_0x9808('0x25')]=function(_0xa63007,_0x4b5bc7){if(_0xa63007[_0x9808('0x64')]['id']){delete _0xa63007[_0x9808('0x64')]['id'];}var _0x2fb419=_0xa63007['body']['provider']===_0x9808('0x65')?null:_0xa63007[_0x9808('0x64')][_0x9808('0x66')];var _0x5c58c3=_0xa63007[_0x9808('0x64')][_0x9808('0x61')]||{};var _0x5d0608=_0xa63007[_0x9808('0x64')]['Smtp']||{};if(_0x2fb419){_0x5c58c3[_0x9808('0x3f')]=getImapHost(_0x2fb419);_0x5c58c3[_0x9808('0x3e')]=0x3e1;_0x5d0608[_0x9808('0x3f')]=getSmtpHost(_0x2fb419);_0x5d0608[_0x9808('0x3e')]=0x24b;_0x5d0608['secure']=![];}if(_0x5d0608[_0x9808('0x3c')]){_0x5d0608[_0x9808('0x40')]=![];}else{_0x5d0608[_0x9808('0x3d')]=null;}if(!_0x5c58c3['modernAuthentication'])_0x5c58c3['CloudProviderId']=null;_0xa63007['body']['Imap']=_0x5c58c3;_0xa63007[_0x9808('0x64')][_0x9808('0x43')]=_0x5d0608;return db['MailAccount']['find']({'where':{'id':_0xa63007['params']['id']},'include':[{'model':db[_0x9808('0x45')],'as':'Imap'},{'model':db[_0x9808('0x46')],'as':'Smtp'},{'model':db[_0x9808('0x47')],'as':_0x9808('0x48')}]})[_0x9808('0x11')](handleEntityNotFound(_0x4b5bc7,null))[_0x9808('0x11')](function(_0x18f108){if(!_0x18f108)throw new Error('Mail\x20Account\x20not\x20found');if(_0x18f108[_0x9808('0x41')])delete _0xa63007[_0x9808('0x64')][_0x9808('0x61')];return _0x18f108;})['then'](saveUpdates(_0xa63007['body'],null))[_0x9808('0x11')](function(_0x3c5b68){if(!_0xa63007[_0x9808('0x64')][_0x9808('0x61')])return _0x3c5b68;return db[_0x9808('0x45')][_0x9808('0x25')](_0xa63007['body']['Imap'],{'where':{'MailAccountId':_0x3c5b68['id']}})['then'](function(){return _0x3c5b68;});})[_0x9808('0x11')](function(_0x2c03f9){if(!_0xa63007[_0x9808('0x64')]['Smtp'])return _0x2c03f9;return db['MailServerOut']['update'](_0xa63007['body'][_0x9808('0x43')],{'where':{'MailAccountId':_0x2c03f9['id']}})[_0x9808('0x11')](function(){return _0x2c03f9;});})['then'](respondWithResult(_0x4b5bc7,null))[_0x9808('0x1b')](handleError(_0x4b5bc7,null));};exports[_0x9808('0x67')]=function(_0x25f4df,_0x3ec941){return db[_0x9808('0x4a')][_0x9808('0x67')]()[_0x9808('0x11')](respondWithResult(_0x3ec941,null))[_0x9808('0x1b')](handleError(_0x3ec941,null));};exports[_0x9808('0x68')]=function(_0x566652,_0x454111){if(_0x566652[_0x9808('0x64')]['id']){delete _0x566652[_0x9808('0x64')]['id'];}return db[_0x9808('0x4a')][_0x9808('0x63')]({'where':{'id':_0x566652['params']['id']}})[_0x9808('0x11')](handleEntityNotFound(_0x454111,null))[_0x9808('0x11')](function(_0x208a55){if(_0x208a55){_0x566652[_0x9808('0x64')]['MailAccountId']=_0x208a55['id'];return db[_0x9808('0x69')]['create'](_0x566652['body']);}})[_0x9808('0x11')](respondWithResult(_0x454111,null))[_0x9808('0x1b')](handleError(_0x454111,null));};exports['getDispositions']=function(_0x35e001,_0x5c9a81){var _0x3049bb={'raw':![],'where':{}};var _0x106e4b={};var _0x54c377={'count':0x0,'rows':[]};return db[_0x9808('0x4a')]['findOne']({'where':{'id':_0x35e001['params']['id']}})[_0x9808('0x11')](handleEntityNotFound(_0x5c9a81,null))['then'](function(_0x3ce60d){if(_0x3ce60d){_0x106e4b[_0x9808('0x4f')]=_[_0x9808('0x51')](db[_0x9808('0x69')]['rawAttributes']);_0x106e4b[_0x9808('0x50')]=_[_0x9808('0x51')](_0x35e001[_0x9808('0x50')]);_0x106e4b[_0x9808('0x59')]=_[_0x9808('0x52')](_0x106e4b[_0x9808('0x4f')],_0x106e4b[_0x9808('0x50')]);_0x3049bb[_0x9808('0x53')]=_[_0x9808('0x52')](_0x106e4b[_0x9808('0x4f')],qs[_0x9808('0x54')](_0x35e001['query']['fields']));_0x3049bb[_0x9808('0x53')]=_0x3049bb[_0x9808('0x53')][_0x9808('0x55')]?_0x3049bb['attributes']:_0x106e4b[_0x9808('0x4f')];if(!_0x35e001['query'][_0x9808('0x6a')](_0x9808('0x56'))){_0x3049bb[_0x9808('0x21')]=qs[_0x9808('0x21')](_0x35e001[_0x9808('0x50')][_0x9808('0x21')]);_0x3049bb[_0x9808('0x1e')]=qs['offset'](_0x35e001[_0x9808('0x50')][_0x9808('0x1e')]);}_0x3049bb[_0x9808('0x6b')]=qs[_0x9808('0x57')](_0x35e001[_0x9808('0x50')][_0x9808('0x57')]);_0x3049bb[_0x9808('0x58')]=qs['filters'](_[_0x9808('0x5a')](_0x35e001[_0x9808('0x50')],_0x106e4b['filters']));_0x3049bb[_0x9808('0x58')][_0x9808('0x6c')]=_0x3ce60d['id'];if(_0x35e001[_0x9808('0x50')][_0x9808('0x5b')]){_0x3049bb[_0x9808('0x58')]=_[_0x9808('0x62')](_0x3049bb[_0x9808('0x58')],{'$or':_[_0x9808('0x49')](_0x3049bb[_0x9808('0x53')],function(_0x45cdc7){var _0x2af12f={};_0x2af12f[_0x45cdc7]={'$like':'%'+_0x35e001[_0x9808('0x50')][_0x9808('0x5b')]+'%'};return _0x2af12f;})});}_0x3049bb=_['merge']({},_0x3049bb,_0x35e001[_0x9808('0x5d')]);return db[_0x9808('0x69')][_0x9808('0x20')]({'where':_0x3049bb[_0x9808('0x58')]})[_0x9808('0x11')](function(_0x2faffc){_0x54c377[_0x9808('0x20')]=_0x2faffc;if(_0x35e001[_0x9808('0x50')][_0x9808('0x5e')]){_0x3049bb[_0x9808('0x5f')]=[{'all':!![]}];}return db[_0x9808('0x69')][_0x9808('0x6d')](_0x3049bb);})['then'](function(_0x536a2a){_0x54c377[_0x9808('0x6e')]=_0x536a2a;return _0x54c377;});}})[_0x9808('0x11')](respondWithFilteredResult(_0x5c9a81,_0x3049bb))[_0x9808('0x1b')](handleError(_0x5c9a81,null));};exports[_0x9808('0x6f')]=function(_0x4e417d,_0x3e07b7){return db[_0x9808('0x4a')]['find']({'where':{'id':_0x4e417d[_0x9808('0x60')]['id']}})[_0x9808('0x11')](handleEntityNotFound(_0x3e07b7,null))[_0x9808('0x11')](function(_0x5a8a50){if(_0x5a8a50){return _0x5a8a50['removeDispositions'](_0x4e417d[_0x9808('0x50')][_0x9808('0x70')]);}})[_0x9808('0x11')](respondWithStatusCode(_0x3e07b7,null))['catch'](handleError(_0x3e07b7,null));};exports[_0x9808('0x71')]=function(_0x325d74,_0x1af9aa){if(_0x325d74[_0x9808('0x64')]['id']){delete _0x325d74[_0x9808('0x64')]['id'];}return db[_0x9808('0x4a')][_0x9808('0x63')]({'where':{'id':_0x325d74['params']['id']}})[_0x9808('0x11')](handleEntityNotFound(_0x1af9aa,null))[_0x9808('0x11')](function(_0x3b24ff){if(_0x3b24ff){_0x325d74[_0x9808('0x64')][_0x9808('0x6c')]=_0x3b24ff['id'];return db['CannedAnswer']['create'](_0x325d74[_0x9808('0x64')]);}})[_0x9808('0x11')](respondWithResult(_0x1af9aa,null))[_0x9808('0x1b')](handleError(_0x1af9aa,null));};exports['getAnswers']=function(_0x2d692a,_0x1807c5){var _0x57b4c7={'raw':![],'where':{}};var _0x5718aa={};var _0x930a44={'count':0x0,'rows':[]};return db['MailAccount'][_0x9808('0x72')]({'where':{'id':_0x2d692a[_0x9808('0x60')]['id']}})['then'](handleEntityNotFound(_0x1807c5,null))[_0x9808('0x11')](function(_0x5bba11){if(_0x5bba11){_0x5718aa[_0x9808('0x4f')]=_[_0x9808('0x51')](db[_0x9808('0x73')][_0x9808('0x4b')]);_0x5718aa[_0x9808('0x50')]=_[_0x9808('0x51')](_0x2d692a[_0x9808('0x50')]);_0x5718aa[_0x9808('0x59')]=_[_0x9808('0x52')](_0x5718aa[_0x9808('0x4f')],_0x5718aa[_0x9808('0x50')]);_0x57b4c7['attributes']=_[_0x9808('0x52')](_0x5718aa[_0x9808('0x4f')],qs[_0x9808('0x54')](_0x2d692a[_0x9808('0x50')]['fields']));_0x57b4c7[_0x9808('0x53')]=_0x57b4c7['attributes'][_0x9808('0x55')]?_0x57b4c7[_0x9808('0x53')]:_0x5718aa[_0x9808('0x4f')];if(!_0x2d692a['query'][_0x9808('0x6a')](_0x9808('0x56'))){_0x57b4c7['limit']=qs['limit'](_0x2d692a[_0x9808('0x50')]['limit']);_0x57b4c7[_0x9808('0x1e')]=qs[_0x9808('0x1e')](_0x2d692a[_0x9808('0x50')][_0x9808('0x1e')]);}_0x57b4c7[_0x9808('0x6b')]=qs['sort'](_0x2d692a['query'][_0x9808('0x57')]);_0x57b4c7[_0x9808('0x58')]=qs[_0x9808('0x59')](_[_0x9808('0x5a')](_0x2d692a[_0x9808('0x50')],_0x5718aa[_0x9808('0x59')]));_0x57b4c7[_0x9808('0x58')][_0x9808('0x6c')]=_0x5bba11['id'];if(_0x2d692a[_0x9808('0x50')][_0x9808('0x5b')]){_0x57b4c7[_0x9808('0x58')]=_[_0x9808('0x62')](_0x57b4c7[_0x9808('0x58')],{'$or':_[_0x9808('0x49')](_0x57b4c7[_0x9808('0x53')],function(_0x8d0166){var _0x51f802={};_0x51f802[_0x8d0166]={'$like':'%'+_0x2d692a[_0x9808('0x50')][_0x9808('0x5b')]+'%'};return _0x51f802;})});}_0x57b4c7=_['merge']({},_0x57b4c7,_0x2d692a[_0x9808('0x5d')]);return db['CannedAnswer'][_0x9808('0x20')]({'where':_0x57b4c7['where']})['then'](function(_0x5c576e){_0x930a44[_0x9808('0x20')]=_0x5c576e;if(_0x2d692a[_0x9808('0x50')][_0x9808('0x5e')]){_0x57b4c7[_0x9808('0x5f')]=[{'all':!![]}];}return db[_0x9808('0x73')][_0x9808('0x6d')](_0x57b4c7);})['then'](function(_0x5186fb){_0x930a44[_0x9808('0x6e')]=_0x5186fb;return _0x930a44;});}})[_0x9808('0x11')](respondWithFilteredResult(_0x1807c5,_0x57b4c7))[_0x9808('0x1b')](handleError(_0x1807c5,null));};exports['removeAnswers']=function(_0x57bf67,_0x12b68a){return db[_0x9808('0x4a')]['find']({'where':{'id':_0x57bf67['params']['id']}})[_0x9808('0x11')](handleEntityNotFound(_0x12b68a,null))[_0x9808('0x11')](function(_0x4307d9){if(_0x4307d9){return _0x4307d9[_0x9808('0x74')](_0x57bf67[_0x9808('0x50')][_0x9808('0x70')]);}})['then'](respondWithStatusCode(_0x12b68a,null))[_0x9808('0x1b')](handleError(_0x12b68a,null));};exports['create']=function(_0x107507,_0x1f8676){var _0x440d22={'name':_0x107507[_0x9808('0x64')][_0x9808('0x2b')],'key':_0x107507[_0x9808('0x64')][_0x9808('0x4e')],'provider':_0x107507[_0x9808('0x64')][_0x9808('0x66')]==='custom'?null:_0x107507[_0x9808('0x64')]['provider'],'email':_0x107507['body'][_0x9808('0x75')],'ListId':_0x107507['body']['ListId'],'active':!_[_0x9808('0x76')](_0x107507[_0x9808('0x64')][_0x9808('0x77')])?_0x107507[_0x9808('0x64')][_0x9808('0x77')]:!![],'description':_0x107507[_0x9808('0x64')][_0x9808('0x78')]||null};var _0x3851c5=getAuthenticationOptions(_0x440d22['provider'],_0x107507[_0x9808('0x64')]);_0x440d22[_0x9808('0x61')]=_0x3851c5[_0x9808('0x61')];_0x440d22['Smtp']=_0x3851c5[_0x9808('0x43')];return db[_0x9808('0x4a')][_0x9808('0x79')](_0x440d22,{'include':[{'model':db[_0x9808('0x46')],'as':_0x9808('0x43')},{'model':db[_0x9808('0x45')],'as':_0x9808('0x61')}]})[_0x9808('0x11')](function(_0x5994ef){var _0x5ce6b5=_0x107507['user'][_0x9808('0x26')]({'plain':!![]});if(!_0x5ce6b5)throw new Error(_0x9808('0x7a'));if(_0x5ce6b5[_0x9808('0x7b')]===_0x9808('0x38')){var _0x337b02=_0x5994ef[_0x9808('0x26')]({'plain':!![]});return db[_0x9808('0x7c')]['find']({'where':{'name':_0x9808('0x27'),'userProfileId':_0x5ce6b5['userProfileId']},'raw':!![]})[_0x9808('0x11')](function(_0x365e07){if(_0x365e07&&_0x365e07[_0x9808('0x7d')]===0x0){return db[_0x9808('0x7e')][_0x9808('0x79')]({'name':_0x337b02[_0x9808('0x2b')],'resourceId':_0x337b02['id'],'type':_0x365e07[_0x9808('0x2b')],'sectionId':_0x365e07['id']},{})[_0x9808('0x11')](function(){return _0x5994ef;});}else{return _0x5994ef;}})[_0x9808('0x1b')](function(_0x3d74b3){logger[_0x9808('0x17')](_0x9808('0x7f'),_0x3d74b3);throw _0x3d74b3;});}return _0x5994ef;})['then'](respondWithResult(_0x1f8676,0xc9))[_0x9808('0x1b')](handleError(_0x1f8676,null));};exports[_0x9808('0x80')]=function(_0x133579,_0x5731e3){return db[_0x9808('0x4a')][_0x9808('0x72')]({'where':{'id':_0x133579[_0x9808('0x60')]['id']}})[_0x9808('0x11')](handleEntityNotFound(_0x5731e3,null))[_0x9808('0x11')](function(_0x68a10a){if(_0x68a10a){return _0x68a10a[_0x9808('0x80')]();}return null;})[_0x9808('0x11')](respondWithResult(_0x5731e3,null))[_0x9808('0x1b')](handleError(_0x5731e3,null));};exports[_0x9808('0x81')]=function(_0x4ae847,_0x4d1a17){if(_0x4ae847[_0x9808('0x64')]['id']){delete _0x4ae847[_0x9808('0x64')]['id'];}return db['MailAccount'][_0x9808('0x63')]({'where':{'id':_0x4ae847[_0x9808('0x60')]['id']}})[_0x9808('0x11')](handleEntityNotFound(_0x4d1a17,null))['then'](function(_0x25527a){if(_0x25527a){_0x4ae847[_0x9808('0x64')]['MailAccountId']=_0x25527a['id'];return db[_0x9808('0x45')][_0x9808('0x79')](_0x4ae847['body']);}})[_0x9808('0x11')](respondWithResult(_0x4d1a17,null))[_0x9808('0x1b')](handleError(_0x4d1a17,null));};exports['removeImap']=function(_0x344628,_0x473364){return db[_0x9808('0x4a')][_0x9808('0x72')]({'where':{'id':_0x344628[_0x9808('0x60')]['id']}})[_0x9808('0x11')](handleEntityNotFound(_0x473364,null))[_0x9808('0x11')](function(_0x4475bf){if(_0x4475bf){return _0x4475bf[_0x9808('0x82')](null);}return null;})['then'](respondWithStatusCode(_0x473364,null))[_0x9808('0x1b')](handleError(_0x473364,null));};exports[_0x9808('0x83')]=function(_0x5ac17a,_0x39372b){return db[_0x9808('0x4a')][_0x9808('0x72')]({'where':{'id':_0x5ac17a[_0x9808('0x60')]['id']}})[_0x9808('0x11')](handleEntityNotFound(_0x39372b,null))[_0x9808('0x11')](function(_0xfa1832){if(_0xfa1832){return _0xfa1832[_0x9808('0x83')]();}return null;})['then'](respondWithResult(_0x39372b,null))[_0x9808('0x1b')](handleError(_0x39372b,null));};exports[_0x9808('0x84')]=function(_0xdcb2b6,_0x2c8313){if(_0xdcb2b6[_0x9808('0x64')]['id']){delete _0xdcb2b6['body']['id'];}return db[_0x9808('0x4a')]['find']({'where':{'id':_0xdcb2b6[_0x9808('0x60')]['id']}})[_0x9808('0x11')](handleEntityNotFound(_0x2c8313,null))[_0x9808('0x11')](function(_0x2e523c){if(_0x2e523c){_0xdcb2b6[_0x9808('0x64')]['MailAccountId']=_0x2e523c['id'];return db[_0x9808('0x46')][_0x9808('0x79')](_0xdcb2b6[_0x9808('0x64')]);}})[_0x9808('0x11')](respondWithResult(_0x2c8313,null))['catch'](handleError(_0x2c8313,null));};exports[_0x9808('0x85')]=function(_0x351c68,_0x3e2ec5){return db[_0x9808('0x4a')][_0x9808('0x72')]({'where':{'id':_0x351c68[_0x9808('0x60')]['id']}})[_0x9808('0x11')](handleEntityNotFound(_0x3e2ec5,null))[_0x9808('0x11')](function(_0x5be4d4){if(_0x5be4d4){return _0x5be4d4['setSmtp'](null);}return null;})['then'](respondWithStatusCode(_0x3e2ec5,null))[_0x9808('0x1b')](handleError(_0x3e2ec5,null));};exports['addInteraction']=function(_0x3decac,_0x3d6794){return db[_0x9808('0x86')][_0x9808('0x63')]({'where':{'id':_0x3decac['params']['id']}})['then'](handleEntityNotFound(_0x3d6794,null))[_0x9808('0x11')](function(_0x304685){if(_0x304685){return _0x304685['addInteraction'](_0x3decac[_0x9808('0x64')][_0x9808('0x70')],_[_0x9808('0x87')](_0x3decac[_0x9808('0x64')],['ids','id'])||{});}})[_0x9808('0x11')](respondWithResult(_0x3d6794,null))[_0x9808('0x1b')](handleError(_0x3d6794,null));};exports['getInteractions']=function(_0x1632f3,_0x17fecf){var _0x37def2={'raw':![],'where':{}};var _0x101cb8={};var _0x19382d={'count':0x0,'rows':[]};return db[_0x9808('0x4a')]['findOne']({'where':{'id':_0x1632f3[_0x9808('0x60')]['id']}})['then'](handleEntityNotFound(_0x17fecf,null))[_0x9808('0x11')](function(_0x2b0bf6){if(_0x2b0bf6){_0x101cb8[_0x9808('0x4f')]=_[_0x9808('0x51')](db[_0x9808('0x86')][_0x9808('0x4b')]);_0x101cb8[_0x9808('0x50')]=_['keys'](_0x1632f3[_0x9808('0x50')]);_0x101cb8[_0x9808('0x59')]=_[_0x9808('0x52')](_0x101cb8[_0x9808('0x4f')],_0x101cb8[_0x9808('0x50')]);_0x37def2[_0x9808('0x53')]=_[_0x9808('0x52')](_0x101cb8[_0x9808('0x4f')],qs['fields'](_0x1632f3['query'][_0x9808('0x54')]));_0x37def2[_0x9808('0x53')]=_0x37def2[_0x9808('0x53')]['length']?_0x37def2[_0x9808('0x53')]:_0x101cb8['model'];if(!_0x1632f3['query'][_0x9808('0x6a')](_0x9808('0x56'))){_0x37def2[_0x9808('0x21')]=qs[_0x9808('0x21')](_0x1632f3[_0x9808('0x50')][_0x9808('0x21')]);_0x37def2[_0x9808('0x1e')]=qs[_0x9808('0x1e')](_0x1632f3['query'][_0x9808('0x1e')]);}_0x37def2[_0x9808('0x6b')]=qs['sort'](_0x1632f3['query']['sort']);_0x37def2[_0x9808('0x58')]=qs[_0x9808('0x59')](_['pick'](_0x1632f3[_0x9808('0x50')],_0x101cb8[_0x9808('0x59')]));_0x37def2[_0x9808('0x58')]['MailAccountId']=_0x2b0bf6['id'];if(_0x1632f3[_0x9808('0x50')][_0x9808('0x5b')]){_0x37def2[_0x9808('0x58')]=_['merge'](_0x37def2['where'],{'$or':_[_0x9808('0x49')](_0x37def2[_0x9808('0x53')],function(_0x3bfb8e){var _0x269671={};_0x269671[_0x3bfb8e]={'$like':'%'+_0x1632f3[_0x9808('0x50')]['filter']+'%'};return _0x269671;})});}_0x37def2=_[_0x9808('0x62')]({},_0x37def2,_0x1632f3['options']);return db['MailInteraction'][_0x9808('0x20')]({'where':_0x37def2['where']})[_0x9808('0x11')](function(_0x392a02){_0x19382d[_0x9808('0x20')]=_0x392a02;if(_0x1632f3[_0x9808('0x50')]['includeAll']){_0x37def2[_0x9808('0x5f')]=[{'model':db[_0x9808('0x88')],'as':_0x9808('0x89'),'required':![]},{'model':db[_0x9808('0x8a')],'as':_0x9808('0x8b'),'attributes':['name','fullname','internal'],'required':![]},{'model':db[_0x9808('0x8c')],'as':_0x9808('0x8d'),'attributes':['id',_0x9808('0x2b'),_0x9808('0x8e')],'where':_0x1632f3[_0x9808('0x50')]['tag']?{'id':_0x1632f3[_0x9808('0x50')]['tag']}:undefined,'required':_0x1632f3[_0x9808('0x50')][_0x9808('0x8f')]?!![]:![]}];}return db[_0x9808('0x86')]['findAll'](_0x37def2);})[_0x9808('0x11')](function(_0x56ca81){_0x19382d[_0x9808('0x6e')]=_0x56ca81;return _0x19382d;});}})[_0x9808('0x11')](respondWithFilteredResult(_0x17fecf,_0x37def2))[_0x9808('0x1b')](handleError(_0x17fecf,null));};exports[_0x9808('0x90')]=function addApplications(_0x47e0b6,_0x43ef93){var _0x410461=_0x47e0b6[_0x9808('0x60')]['id'];var _0x5ac6f4=_0x47e0b6['body'];var _0x1ab7c0=0xc8;var _0x21d835=null;return db[_0x9808('0x91')][_0x9808('0x92')]({'isolationLevel':db[_0x9808('0x91')][_0x9808('0x93')][_0x9808('0x94')][_0x9808('0x95')]},function(_0x1715e1){return db[_0x9808('0x4a')][_0x9808('0x72')]({'where':{'id':_0x410461},'transaction':_0x1715e1})[_0x9808('0x11')](function(_0x588062){if(_0x588062){return db[_0x9808('0x96')][_0x9808('0x28')]({'where':{'MailAccountId':_0x410461},'transaction':_0x1715e1})['then'](function(){var _0x8b370e=_[_0x9808('0x49')](_0x5ac6f4,function(_0x18c84e){_0x18c84e[_0x9808('0x6c')]=_0x410461;return _0x18c84e;});return db[_0x9808('0x96')][_0x9808('0x97')](_0x8b370e,{'transaction':_0x1715e1});});}else{_0x1ab7c0=0x194;_0x21d835=[];}});})['then'](function(){if(_0x1ab7c0!==0x194){return db[_0x9808('0x96')]['findAndCountAll']({'where':{'MailAccountId':_0x410461},'order':_0x9808('0x98')})['then'](function(_0xda92c2){_0x21d835=_0xda92c2;});}})[_0x9808('0x1b')](function(_0x97fc19){_0x1ab7c0=0x1f4;logger[_0x9808('0x17')](_0x97fc19[_0x9808('0x2a')]);if(_0x97fc19[_0x9808('0x2b')]){delete _0x97fc19[_0x9808('0x2b')];}_0x21d835=_0x97fc19;})[_0x9808('0x99')](function(){if(_0x21d835===null){_0x43ef93['sendStatus'](_0x1ab7c0);}else{if(_0x1ab7c0===0x1f4){_0x43ef93[_0x9808('0x1d')](_0x1ab7c0)['send'](_0x21d835);}else{_0x43ef93[_0x9808('0x1d')](_0x1ab7c0)[_0x9808('0x24')](_0x21d835);}}});};exports[_0x9808('0x9a')]=function(_0x48e9df,_0x10f2fc){var _0x11e566={};var _0x140143={};var _0x3d6842;var _0x473adf;return db[_0x9808('0x4a')][_0x9808('0x72')]({'where':{'id':_0x48e9df['params']['id']}})[_0x9808('0x11')](handleEntityNotFound(_0x10f2fc,null))[_0x9808('0x11')](function(_0x46d448){if(_0x46d448){_0x3d6842=_0x46d448;_0x140143[_0x9808('0x4f')]=_[_0x9808('0x51')](db[_0x9808('0x96')][_0x9808('0x4b')]);_0x140143[_0x9808('0x50')]=_['keys'](_0x48e9df[_0x9808('0x50')]);_0x140143[_0x9808('0x59')]=_[_0x9808('0x52')](_0x140143[_0x9808('0x4f')],_0x140143[_0x9808('0x50')]);_0x11e566['attributes']=_[_0x9808('0x52')](_0x140143['model'],qs[_0x9808('0x54')](_0x48e9df[_0x9808('0x50')]['fields']));_0x11e566[_0x9808('0x53')]=_0x11e566[_0x9808('0x53')]['length']?_0x11e566[_0x9808('0x53')]:_0x140143[_0x9808('0x4f')];_0x11e566[_0x9808('0x6b')]=qs[_0x9808('0x57')](_0x48e9df[_0x9808('0x50')][_0x9808('0x57')]);_0x11e566[_0x9808('0x58')]=qs['filters'](_['pick'](_0x48e9df[_0x9808('0x50')],_0x140143[_0x9808('0x59')]));if(_0x48e9df[_0x9808('0x50')][_0x9808('0x5b')]){_0x11e566[_0x9808('0x58')]=_[_0x9808('0x62')](_0x11e566[_0x9808('0x58')],{'$or':_[_0x9808('0x49')](_0x11e566['attributes'],function(_0x53603c){var _0x44ec57={};_0x44ec57[_0x53603c]={'$like':'%'+_0x48e9df[_0x9808('0x50')][_0x9808('0x5b')]+'%'};return _0x44ec57;})});}_0x11e566=_[_0x9808('0x62')]({},_0x11e566,_0x48e9df[_0x9808('0x5d')]);return _0x3d6842[_0x9808('0x9a')](_0x11e566);}})['then'](function(_0x1325de){if(_0x1325de){_0x473adf=_0x1325de[_0x9808('0x55')];if(!_0x48e9df['query']['hasOwnProperty'](_0x9808('0x56'))){_0x11e566['limit']=qs['limit'](_0x48e9df['query'][_0x9808('0x21')]);_0x11e566[_0x9808('0x1e')]=qs[_0x9808('0x1e')](_0x48e9df[_0x9808('0x50')][_0x9808('0x1e')]);}return _0x3d6842['getApplications'](_0x11e566);}})[_0x9808('0x11')](function(_0xe920b5){if(_0xe920b5){return _0xe920b5?{'count':_0x473adf,'rows':_0xe920b5}:null;}})[_0x9808('0x11')](respondWithResult(_0x10f2fc,null))['catch'](handleError(_0x10f2fc,null));};exports[_0x9808('0x9b')]=function(_0x566c2d,_0x3d35be){var _0x30b83a={'raw':!![],'where':{}};var _0x39c989={};var _0x464c70={'count':0x0,'rows':[]};return db[_0x9808('0x4a')]['findOne']({'where':{'id':_0x566c2d[_0x9808('0x60')]['id']}})['then'](handleEntityNotFound(_0x3d35be,null))[_0x9808('0x11')](function(_0x4a6257){if(_0x4a6257){_0x39c989[_0x9808('0x4f')]=_[_0x9808('0x51')](db[_0x9808('0x9c')][_0x9808('0x4b')]);_0x39c989[_0x9808('0x50')]=_['keys'](_0x566c2d[_0x9808('0x50')]);_0x39c989[_0x9808('0x59')]=_['intersection'](_0x39c989[_0x9808('0x4f')],_0x39c989[_0x9808('0x50')]);_0x30b83a['attributes']=_[_0x9808('0x52')](_0x39c989[_0x9808('0x4f')],qs[_0x9808('0x54')](_0x566c2d[_0x9808('0x50')]['fields']));_0x30b83a[_0x9808('0x53')]=_0x30b83a['attributes'][_0x9808('0x55')]?_0x30b83a[_0x9808('0x53')]:_0x39c989[_0x9808('0x4f')];if(!_0x566c2d[_0x9808('0x50')][_0x9808('0x6a')](_0x9808('0x56'))){_0x30b83a['limit']=qs[_0x9808('0x21')](_0x566c2d[_0x9808('0x50')]['limit']);_0x30b83a[_0x9808('0x1e')]=qs[_0x9808('0x1e')](_0x566c2d[_0x9808('0x50')][_0x9808('0x1e')]);}_0x30b83a[_0x9808('0x6b')]=qs['sort'](_0x566c2d[_0x9808('0x50')][_0x9808('0x57')]);_0x30b83a[_0x9808('0x58')]=qs[_0x9808('0x59')](_[_0x9808('0x5a')](_0x566c2d[_0x9808('0x50')],_0x39c989['filters']));_0x30b83a['where'][_0x9808('0x6c')]=_0x4a6257['id'];if(_0x566c2d[_0x9808('0x50')][_0x9808('0x5b')]){_0x30b83a[_0x9808('0x58')]=_[_0x9808('0x62')](_0x30b83a[_0x9808('0x58')],{'$or':_['map'](_0x30b83a[_0x9808('0x53')],function(_0x6c89dc){var _0x18a9bd={};_0x18a9bd[_0x6c89dc]={'$like':'%'+_0x566c2d[_0x9808('0x50')][_0x9808('0x5b')]+'%'};return _0x18a9bd;})});}if(_0x566c2d[_0x9808('0x50')][_0x9808('0x9d')]){var _0x30d670=_0x566c2d['query'][_0x9808('0x9d')][_0x9808('0x9e')](',');var _0x391597={};_0x391597[_0x30d670[0x0]]={'$gte':moment(_0x30d670[0x1])[_0x9808('0x9f')](_0x9808('0xa0'))};_0x30b83a[_0x9808('0x58')]=_[_0x9808('0x62')](_0x30b83a[_0x9808('0x58')],_0x391597);}_0x30b83a=_[_0x9808('0x62')]({},_0x30b83a,_0x566c2d[_0x9808('0x5d')]);return db['MailMessage'][_0x9808('0x20')]({'where':_0x30b83a[_0x9808('0x58')]})[_0x9808('0x11')](function(_0x4dfcdd){_0x464c70['count']=_0x4dfcdd;if(_0x566c2d[_0x9808('0x50')][_0x9808('0x5e')]){_0x30b83a[_0x9808('0x5f')]=[{'all':!![]}];}return db[_0x9808('0x9c')][_0x9808('0x6d')](_0x30b83a);})[_0x9808('0x11')](function(_0x134d7d){if(_0x566c2d[_0x9808('0x50')][_0x9808('0xa1')]===_0x9808('0xa2')){for(var _0xe5c4d0=0x0;_0xe5c4d0<_0x134d7d[_0x9808('0x55')];_0xe5c4d0++){_0x134d7d[_0xe5c4d0]['body']=juice(_0x134d7d[_0xe5c4d0][_0x9808('0x64')]);}}_0x464c70[_0x9808('0x6e')]=_0x134d7d;return _0x464c70;});}})['then'](respondWithFilteredResult(_0x3d35be,_0x30b83a))[_0x9808('0x1b')](handleError(_0x3d35be,null));};exports[_0x9808('0xa3')]=function(_0xf755,_0x3f1799){var _0x119669,_0x20b868={},_0x1dd2c0;if(_0xf755[_0x9808('0x64')]['to']){_0x1dd2c0=_0xf755[_0x9808('0x64')]['to'][_0x9808('0x9e')](',')[0x0];}return db[_0x9808('0x4a')]['find']({'where':{'id':_0xf755['params']['id']},'include':[{'model':db[_0x9808('0xa4')],'as':_0x9808('0xa5'),'include':[{'model':db[_0x9808('0x88')],'as':'Contacts','where':{'email':_0x1dd2c0},'limit':0x1,'order':[['updatedAt','DESC']]}]},{'model':db[_0x9808('0x46')],'as':_0x9808('0x43'),'raw':!![],'include':[{'model':db['CloudProvider'],'as':_0x9808('0xa6'),'raw':!![]}]}]})[_0x9808('0x11')](handleEntityNotFound(_0x3f1799,null))['then'](function(_0x4e1f81){if(!_0x4e1f81)return;_0x119669=_0x4e1f81;if(!_0x4e1f81[_0x9808('0x43')])throw new Error('Smtp\x20configuration\x20not\x20found');if(_[_0x9808('0x76')](_0xf755[_0x9808('0x64')][_0x9808('0xa7')])){_0xf755[_0x9808('0x64')][_0x9808('0xa7')]=util[_0x9808('0x9f')](_0x9808('0xa8'),_0x4e1f81['name'],_0x4e1f81[_0x9808('0x75')]||_0x4e1f81[_0x9808('0x43')][_0x9808('0x38')]);}if(_0xf755[_0x9808('0x64')][_0x9808('0xa9')]&&_0xf755['body'][_0x9808('0xa9')][_0x9808('0x55')]){for(var _0x32753c=0x0;_0x32753c<_0xf755[_0x9808('0x64')][_0x9808('0xa9')]['length'];_0x32753c+=0x1){_0xf755[_0x9808('0x64')][_0x9808('0xa9')][_0x32753c]={'filename':_0xf755[_0x9808('0x64')][_0x9808('0xa9')][_0x32753c][_0x9808('0x2b')],'path':path[_0x9808('0xaa')](config[_0x9808('0xab')],'server/files/attachments',_0xf755[_0x9808('0x64')][_0x9808('0xa9')][_0x32753c]['basename'])};}}var _0x454332=_0x4e1f81[_0x9808('0xac')]();return respondWithRpcPromise('SendMail',_0x9808('0xad'),{'account':_0x454332,'message':_0xf755[_0x9808('0x64')]});})[_0x9808('0x11')](function(_0xdf1792){if(!_0xdf1792)return;_0x20b868=_0xdf1792;if(!_0x119669[_0x9808('0xa5')])throw new Error('List\x20not\x20found');if(_0x119669[_0x9808('0xa5')][_0x9808('0xae')][_0x9808('0x55')])return _0x119669[_0x9808('0xa5')][_0x9808('0xae')][0x0];return db[_0x9808('0x88')][_0x9808('0x79')](_[_0x9808('0xaf')](_0xf755[_0x9808('0x64')],{'firstName':_0xf755['body']['to'],'email':_0xf755['body']['to'],'phone':_0xf755['body']['to'],'ListId':_0x119669[_0x9808('0xb0')]}));})[_0x9808('0x11')](function(_0x52238c){if(!_0x52238c)return;var _0x69f336={'UserId':_0xf755[_0x9808('0x38')]['id'],'ContactId':_0x52238c['id'],'MailAccountId':_0x119669['id'],'inReplyTo':_0x20b868[_0x9808('0xb1')],'to':_0xf755[_0x9808('0x64')][_0x9808('0xa7')],'cc':_0xf755[_0x9808('0x64')]['cc'],'subject':_0xf755[_0x9808('0x64')][_0x9808('0xb2')],'attach':_0xf755[_0x9808('0x64')][_0x9808('0xb3')],'firstMsgDirection':_0x9808('0xb4'),'lastMsgAt':moment()[_0x9808('0x9f')](_0x9808('0xa0')),'lastMsgDirection':_0x9808('0xb4'),'Messages':[_[_0x9808('0x62')](_0xf755[_0x9808('0x64')],{'messageId':_0x20b868['messageId'],'sentAt':moment()[_0x9808('0x9f')](_0x9808('0xa0')),'read':!![],'MailAccountId':_0x119669['id'],'UserId':_0xf755[_0x9808('0x38')]['id'],'ContactId':_0x52238c['id']})]};if(_0xf755['body'][_0x9808('0xb5')]){_0x69f336=_[_0x9808('0x62')](_0x69f336,_0xf755['body']['Interaction']);}return db[_0x9808('0x86')]['create'](_0x69f336,{'include':[{'model':db[_0x9808('0x9c')],'as':'Messages'}]});})[_0x9808('0x11')](respondWithResult(_0x3f1799,null))['catch'](handleError(_0x3f1799,null));};exports[_0x9808('0xb6')]=function(_0x2b3d24,_0x398bfe){return db[_0x9808('0x4a')][_0x9808('0x63')]({'where':{'id':_0x2b3d24[_0x9808('0x60')]['id']},'include':[{'model':db[_0x9808('0x46')],'as':_0x9808('0x43'),'raw':!![],'include':[{'model':db['CloudProvider'],'as':_0x9808('0xa6'),'raw':!![]}]}]})[_0x9808('0x11')](handleEntityNotFound(_0x398bfe,null))[_0x9808('0x11')](function(_0xcd85d8){if(!_0xcd85d8[_0x9808('0x43')])return;var _0x1812c9=_0xcd85d8[_0x9808('0xac')]();return respondWithRpcPromise(_0x9808('0xb7'),_0x9808('0xb6'),{'account':_0x1812c9});})[_0x9808('0x11')](respondWithResult(_0x398bfe,null))[_0x9808('0x1b')](handleError(_0x398bfe,null));};exports[_0x9808('0x28')]=function(_0x29e298,_0xcb3b32){return db[_0x9808('0x4a')][_0x9808('0x63')]({'where':{'id':_0x29e298[_0x9808('0x60')]['id']}})['then'](handleEntityNotFound(_0xcb3b32,null))[_0x9808('0x11')](function(_0x309cdc){if(_0x309cdc&&_0x309cdc['service']){throw new db['Sequelize'][(_0x9808('0xb8'))](_0x9808('0xb9'));}return _0x309cdc;})[_0x9808('0x11')](removeEntity(_0xcb3b32,null))[_0x9808('0x1b')](handleError(_0xcb3b32,null));};exports[_0x9808('0xba')]=function(_0x41442b,_0x25a7d7){return db[_0x9808('0x4a')]['find']({'where':{'id':_0x41442b[_0x9808('0x60')]['id']}})['then'](handleEntityNotFound(_0x25a7d7,null))[_0x9808('0x11')](function(_0x17b693){if(_0x17b693){return _0x17b693[_0x9808('0xba')](_0x41442b[_0x9808('0x64')]['ids'],_[_0x9808('0x87')](_0x41442b[_0x9808('0x64')],[_0x9808('0x70'),'id'])||{})[_0x9808('0xbb')](function(_0x17bd7d){for(var _0x31abe5=0x0;_0x31abe5<_0x41442b[_0x9808('0x64')][_0x9808('0x70')][_0x9808('0x55')];_0x31abe5+=0x1){socket[_0x9808('0xbc')](_0x9808('0xbd'),{'UserId':Number(_0x41442b['body'][_0x9808('0x70')][_0x31abe5]),'MailAccountId':Number(_0x41442b[_0x9808('0x60')]['id'])});}return _0x17bd7d;});}})['then'](respondWithResult(_0x25a7d7,null))[_0x9808('0x1b')](handleError(_0x25a7d7,null));};exports[_0x9808('0xbe')]=function(_0x12d917,_0x2793d6){return db['MailAccount'][_0x9808('0x63')]({'where':{'id':_0x12d917[_0x9808('0x60')]['id']}})[_0x9808('0x11')](handleEntityNotFound(_0x2793d6,null))[_0x9808('0x11')](function(_0x231653){if(_0x231653){return _0x231653['removeAgents'](_0x12d917['query'][_0x9808('0x70')])[_0x9808('0x11')](function(){if(_[_0x9808('0xbf')](_0x12d917[_0x9808('0x50')][_0x9808('0x70')])){for(var _0x3c9e7e=0x0;_0x3c9e7e<_0x12d917['query'][_0x9808('0x70')][_0x9808('0x55')];_0x3c9e7e+=0x1){socket['emit']('userMailAccount:remove',{'UserId':Number(_0x12d917[_0x9808('0x50')][_0x9808('0x70')][_0x3c9e7e]),'MailAccountId':Number(_0x12d917[_0x9808('0x60')]['id'])});}}else{socket[_0x9808('0xbc')](_0x9808('0xc0'),{'UserId':Number(_0x12d917[_0x9808('0x50')]['ids']),'MailAccountId':Number(_0x12d917[_0x9808('0x60')]['id'])});}});}})[_0x9808('0x11')](respondWithStatusCode(_0x2793d6,null))[_0x9808('0x1b')](handleError(_0x2793d6,null));};exports[_0x9808('0xc1')]=function(_0x1b2594,_0x58c0b1){var _0x54701b={};var _0x233df9={};var _0xd75293;var _0x55a034;return db['MailAccount'][_0x9808('0x72')]({'where':{'id':_0x1b2594[_0x9808('0x60')]['id']}})[_0x9808('0x11')](handleEntityNotFound(_0x58c0b1,null))[_0x9808('0x11')](function(_0x4948e7){if(_0x4948e7){_0xd75293=_0x4948e7;_0x233df9['model']=_[_0x9808('0x51')](db[_0x9808('0x8a')]['rawAttributes']);_0x233df9[_0x9808('0x50')]=_[_0x9808('0x51')](_0x1b2594[_0x9808('0x50')]);_0x233df9['filters']=_[_0x9808('0x52')](_0x233df9[_0x9808('0x4f')],_0x233df9['query']);_0x54701b[_0x9808('0x53')]=_['intersection'](_0x233df9['model'],qs[_0x9808('0x54')](_0x1b2594[_0x9808('0x50')][_0x9808('0x54')]));_0x54701b[_0x9808('0x53')]=_0x54701b[_0x9808('0x53')]['length']?_0x54701b['attributes']:_0x233df9['model'];_0x54701b[_0x9808('0x6b')]=qs[_0x9808('0x57')](_0x1b2594[_0x9808('0x50')][_0x9808('0x57')]);_0x54701b['where']=qs['filters'](_[_0x9808('0x5a')](_0x1b2594[_0x9808('0x50')],_0x233df9[_0x9808('0x59')]));if(_0x1b2594[_0x9808('0x50')][_0x9808('0x5b')]){_0x54701b['where']=_[_0x9808('0x62')](_0x54701b[_0x9808('0x58')],{'$or':_['map'](_0x54701b['attributes'],function(_0x2d6707){var _0x20764d={};_0x20764d[_0x2d6707]={'$like':'%'+_0x1b2594['query'][_0x9808('0x5b')]+'%'};return _0x20764d;})});}_0x54701b=_[_0x9808('0x62')]({},_0x54701b,_0x1b2594['options']);return _0xd75293[_0x9808('0xc1')](_0x54701b);}})[_0x9808('0x11')](function(_0x4c717a){if(_0x4c717a){_0x55a034=_0x4c717a[_0x9808('0x55')];if(!_0x1b2594[_0x9808('0x50')]['hasOwnProperty'](_0x9808('0x56'))){_0x54701b[_0x9808('0x21')]=qs[_0x9808('0x21')](_0x1b2594['query'][_0x9808('0x21')]);_0x54701b[_0x9808('0x1e')]=qs[_0x9808('0x1e')](_0x1b2594[_0x9808('0x50')][_0x9808('0x1e')]);}return _0xd75293[_0x9808('0xc1')](_0x54701b);}})[_0x9808('0x11')](function(_0x7283cc){if(_0x7283cc){return _0x7283cc?{'count':_0x55a034,'rows':_0x7283cc}:null;}})[_0x9808('0x11')](respondWithResult(_0x58c0b1,null))[_0x9808('0x1b')](handleError(_0x58c0b1,null));}; \ No newline at end of file diff --git a/server/api/mailAccount/mailAccount.events.js b/server/api/mailAccount/mailAccount.events.js index 12ad668..027b795 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 _0x8325=['exports','events','MailAccount','save','remove','emit','hasOwnProperty','hook'];(function(_0x174ef5,_0x256e8e){var _0x1cc379=function(_0x3eafcf){while(--_0x3eafcf){_0x174ef5['push'](_0x174ef5['shift']());}};_0x1cc379(++_0x256e8e);}(_0x8325,0x1f1));var _0x5832=function(_0x3d8d9e,_0xc398ec){_0x3d8d9e=_0x3d8d9e-0x0;var _0x37a5ff=_0x8325[_0x3d8d9e];return _0x37a5ff;};'use strict';var EventEmitter=require(_0x5832('0x0'));var MailAccount=require('../../mysqldb')['db'][_0x5832('0x1')];var MailAccountEvents=new EventEmitter();MailAccountEvents['setMaxListeners'](0x0);var events={'afterCreate':_0x5832('0x2'),'afterUpdate':'update','afterDestroy':_0x5832('0x3')};function emitEvent(_0x39ae55){return function(_0x17bd8b,_0x24e83e,_0x5bfa64){MailAccountEvents['emit'](_0x39ae55+':'+_0x17bd8b['id'],_0x17bd8b);MailAccountEvents[_0x5832('0x4')](_0x39ae55,_0x17bd8b);_0x5bfa64(null);};}for(var e in events){if(events[_0x5832('0x5')](e)){var event=events[e];MailAccount[_0x5832('0x6')](e,emitEvent(event));}}module[_0x5832('0x7')]=MailAccountEvents; \ No newline at end of file +var _0x9b97=['setMaxListeners','save','update','remove','emit','hook','exports','events','MailAccount'];(function(_0x4b6778,_0x505a76){var _0x22dbb9=function(_0x4881eb){while(--_0x4881eb){_0x4b6778['push'](_0x4b6778['shift']());}};_0x22dbb9(++_0x505a76);}(_0x9b97,0x11e));var _0x79b9=function(_0x28ae78,_0x3b0806){_0x28ae78=_0x28ae78-0x0;var _0x514b1c=_0x9b97[_0x28ae78];return _0x514b1c;};'use strict';var EventEmitter=require(_0x79b9('0x0'));var MailAccount=require('../../mysqldb')['db'][_0x79b9('0x1')];var MailAccountEvents=new EventEmitter();MailAccountEvents[_0x79b9('0x2')](0x0);var events={'afterCreate':_0x79b9('0x3'),'afterUpdate':_0x79b9('0x4'),'afterDestroy':_0x79b9('0x5')};function emitEvent(_0x10c823){return function(_0x4edfcf,_0x5194ab,_0x1e0ed2){MailAccountEvents[_0x79b9('0x6')](_0x10c823+':'+_0x4edfcf['id'],_0x4edfcf);MailAccountEvents[_0x79b9('0x6')](_0x10c823,_0x4edfcf);_0x1e0ed2(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];MailAccount[_0x79b9('0x7')](e,emitEvent(event));}}module[_0x79b9('0x8')]=MailAccountEvents; \ No newline at end of file diff --git a/server/api/mailAccount/mailAccount.model.js b/server/api/mailAccount/mailAccount.model.js index 7ef3197..3f51e59 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 _0xa28f=['./mailAccount.attributes','exports','MailAccount','provider','service','host','port','Smtp','secure','authentication','auth','user','CloudProvider','data5','pass'];(function(_0x11cadb,_0x110faa){var _0x2fb14b=function(_0x3f2015){while(--_0x3f2015){_0x11cadb['push'](_0x11cadb['shift']());}};_0x2fb14b(++_0x110faa);}(_0xa28f,0x1d1));var _0xfa28=function(_0x3cd005,_0x4c995a){_0x3cd005=_0x3cd005-0x0;var _0x3e7d8b=_0xa28f[_0x3cd005];return _0x3e7d8b;};'use strict';var attributes=require(_0xfa28('0x0'));module[_0xfa28('0x1')]=function(_0xb7a56f){return _0xb7a56f['define'](_0xfa28('0x2'),attributes,{'tableName':'mail_accounts','paranoid':![],'indexes':[],'timestamps':!![],'instanceMethods':{'getSmtpOptions':function(){var _0x34e97d=this;var _0x3fad6b={'id':_0x34e97d['id'],'tls':{'rejectUnauthorized':![]}};if(_0x34e97d[_0xfa28('0x3')]!=='custom'){_0x3fad6b[_0xfa28('0x4')]=_0x34e97d[_0xfa28('0x3')];}else{_0x3fad6b[_0xfa28('0x5')]=_0x34e97d['Smtp']['host'];_0x3fad6b[_0xfa28('0x6')]=_0x34e97d[_0xfa28('0x7')][_0xfa28('0x6')];_0x3fad6b['secure']=_0x34e97d['Smtp'][_0xfa28('0x8')];}if(_0x34e97d[_0xfa28('0x7')][_0xfa28('0x9')]){if(_0x34e97d[_0xfa28('0x7')]['modernAuthentication']){if(!_0x34e97d[_0xfa28('0x7')]['CloudProvider'])throw new Error('Cloud\x20Provider\x20configuration\x20not\x20found');_0x3fad6b[_0xfa28('0xa')]={'type':'OAuth2','user':_0x34e97d[_0xfa28('0x7')][_0xfa28('0xb')],'accessToken':_0x34e97d[_0xfa28('0x7')][_0xfa28('0xc')][_0xfa28('0xd')]};}else{_0x3fad6b[_0xfa28('0xa')]={'user':_0x34e97d[_0xfa28('0x7')]['user'],'pass':_0x34e97d[_0xfa28('0x7')][_0xfa28('0xe')]};}}return _0x3fad6b;}}});}; \ No newline at end of file +var _0x6755=['MailAccount','mail_accounts','provider','custom','host','Smtp','port','secure','authentication','modernAuthentication','CloudProvider','auth','OAuth2','user','pass','exports','define'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x6755,0x11f));var _0x5675=function(_0x30c613,_0x1bb665){_0x30c613=_0x30c613-0x0;var _0x58b3d7=_0x6755[_0x30c613];return _0x58b3d7;};'use strict';var attributes=require('./mailAccount.attributes');module[_0x5675('0x0')]=function(_0x258f9f){return _0x258f9f[_0x5675('0x1')](_0x5675('0x2'),attributes,{'tableName':_0x5675('0x3'),'paranoid':![],'indexes':[],'timestamps':!![],'instanceMethods':{'getSmtpOptions':function(){var _0x3f7d90=this;var _0x47d1eb={'id':_0x3f7d90['id'],'tls':{'rejectUnauthorized':![]}};if(_0x3f7d90[_0x5675('0x4')]!==_0x5675('0x5')){_0x47d1eb['service']=_0x3f7d90['provider'];}else{_0x47d1eb[_0x5675('0x6')]=_0x3f7d90[_0x5675('0x7')][_0x5675('0x6')];_0x47d1eb[_0x5675('0x8')]=_0x3f7d90['Smtp'][_0x5675('0x8')];_0x47d1eb[_0x5675('0x9')]=_0x3f7d90['Smtp'][_0x5675('0x9')];}if(_0x3f7d90[_0x5675('0x7')][_0x5675('0xa')]){if(_0x3f7d90[_0x5675('0x7')][_0x5675('0xb')]){if(!_0x3f7d90[_0x5675('0x7')][_0x5675('0xc')])throw new Error('Cloud\x20Provider\x20configuration\x20not\x20found');_0x47d1eb[_0x5675('0xd')]={'type':_0x5675('0xe'),'user':_0x3f7d90['Smtp']['user'],'accessToken':_0x3f7d90[_0x5675('0x7')][_0x5675('0xc')]['data5']};}else{_0x47d1eb[_0x5675('0xd')]={'user':_0x3f7d90[_0x5675('0x7')][_0x5675('0xf')],'pass':_0x3f7d90['Smtp'][_0x5675('0x10')]};}}return _0x47d1eb;}}});}; \ No newline at end of file diff --git a/server/api/mailAccount/mailAccount.rpc.js b/server/api/mailAccount/mailAccount.rpc.js index 19f41dd..66e30f5 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 _0x0309=['omit','Applications','account','list','applications','orderBy','asc','autoclose','length','close','*,*,*,*','create','List\x20not\x20found','contact','messageId','generate','subject','attach','format','YYYY-MM-DD\x20HH:mm:ss','MailInteraction','MailMessage','Contact\x20not\x20found','spread','update','interaction','attachments','originTo','originCc','ChatWebsiteId','originChannel','Email','Attachment','Attachments','UserId','name','unshift','agent','waitForTheAssignedAgent','queueId','queue','startRouting','lodash','bluebird','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','defaults','redis','socket.io-emitter','./mailAccount.socket','register','then','info','MailAccount,\x20%s,\x20%s','request\x20sent','debug','MailAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','GetMailAccount','MailAccount','findAll','raw','options','where','attributes','include','map','model','ShowMailAccount','find','setDataValue','getSmtpOptions','body','mail','keys','CmContact','rawAttributes','createdAt','updatedAt','ListId','isNil','from','from\x20is\x20mandatory','body\x20is\x20mandatory\x20and\x20not\x20empty','mapKey','mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','includes','CmList','Contacts','DESC','MailApplication','MailServerOut','CloudProvider','List','get'];(function(_0x5ddacc,_0x3ed785){var _0x5b5e21=function(_0xf461d4){while(--_0xf461d4){_0x5ddacc['push'](_0x5ddacc['shift']());}};_0x5b5e21(++_0x3ed785);}(_0x0309,0x165));var _0x9030=function(_0x193be8,_0x2fc916){_0x193be8=_0x193be8-0x0;var _0x4fec40=_0x0309[_0x193be8];return _0x4fec40;};'use strict';var _=require(_0x9030('0x0'));var moment=require('moment');var BPromise=require(_0x9030('0x1'));var rs=require('randomstring');var Redis=require(_0x9030('0x2'));var db=require(_0x9030('0x3'))['db'];var logger=require(_0x9030('0x4'))(_0x9030('0x5'));var config=require(_0x9030('0x6'));var jayson=require(_0x9030('0x7'));var client=jayson[_0x9030('0x8')]['http']({'port':0x232c});config['redis']=_[_0x9030('0x9')](config[_0x9030('0xa')],{'host':'localhost','port':0x18eb});var socket=require(_0x9030('0xb'))(new Redis(config['redis']));require(_0x9030('0xc'))[_0x9030('0xd')](socket);function respondWithRpcPromise(_0x289add,_0x5711b4,_0xe2c28b){return new BPromise(function(_0x1da9ec,_0x337b86){return client['request'](_0x289add,_0xe2c28b)[_0x9030('0xe')](function(_0x21bc06){logger[_0x9030('0xf')](_0x9030('0x10'),_0x5711b4,_0x9030('0x11'));logger[_0x9030('0x12')](_0x9030('0x13'),_0x5711b4,'request\x20sent',JSON[_0x9030('0x14')](_0x21bc06));if(_0x21bc06[_0x9030('0x15')]){if(_0x21bc06[_0x9030('0x15')][_0x9030('0x16')]===0x1f4){logger['error'](_0x9030('0x10'),_0x5711b4,_0x21bc06[_0x9030('0x15')][_0x9030('0x17')]);return _0x337b86(_0x21bc06[_0x9030('0x15')][_0x9030('0x17')]);}logger[_0x9030('0x15')](_0x9030('0x10'),_0x5711b4,_0x21bc06[_0x9030('0x15')][_0x9030('0x17')]);return _0x1da9ec(_0x21bc06['error'][_0x9030('0x17')]);}else{logger[_0x9030('0xf')](_0x9030('0x10'),_0x5711b4,_0x9030('0x11'));_0x1da9ec(_0x21bc06[_0x9030('0x18')][_0x9030('0x17')]);}})[_0x9030('0x19')](function(_0x28c035){logger[_0x9030('0x15')](_0x9030('0x10'),_0x5711b4,_0x28c035);_0x337b86(_0x28c035);});});}exports[_0x9030('0x1a')]=function(_0x41d506){var _0x372716=this;return new Promise(function(_0x243e7d,_0x1e5988){return db[_0x9030('0x1b')][_0x9030('0x1c')]({'raw':_0x41d506['options']?_0x41d506['options'][_0x9030('0x1d')]===undefined?!![]:![]:!![],'where':_0x41d506[_0x9030('0x1e')]?_0x41d506['options'][_0x9030('0x1f')]||null:null,'attributes':_0x41d506[_0x9030('0x1e')]?_0x41d506[_0x9030('0x1e')][_0x9030('0x20')]||null:null,'limit':_0x41d506['options']?_0x41d506[_0x9030('0x1e')]['limit']||null:null,'include':_0x41d506['options']?_0x41d506[_0x9030('0x1e')][_0x9030('0x21')]?_[_0x9030('0x22')](_0x41d506['options'][_0x9030('0x21')],function(_0x408ce6){return{'model':db[_0x408ce6[_0x9030('0x23')]],'as':_0x408ce6['as'],'attributes':_0x408ce6[_0x9030('0x20')],'include':_0x408ce6[_0x9030('0x21')]?_['map'](_0x408ce6[_0x9030('0x21')],function(_0x455eeb){return{'model':db[_0x455eeb[_0x9030('0x23')]],'as':_0x455eeb['as'],'attributes':_0x455eeb[_0x9030('0x20')],'include':_0x455eeb[_0x9030('0x21')]?_[_0x9030('0x22')](_0x455eeb[_0x9030('0x21')],function(_0x2112cf){return{'model':db[_0x2112cf[_0x9030('0x23')]],'as':_0x2112cf['as'],'attributes':_0x2112cf[_0x9030('0x20')]};}):[]};}):[]};}):[]:[]})[_0x9030('0xe')](function(_0x1d0c5c){logger[_0x9030('0xf')](_0x9030('0x1a'),_0x41d506);logger['debug'](_0x9030('0x1a'),_0x41d506,JSON['stringify'](_0x1d0c5c));_0x243e7d(_0x1d0c5c);})[_0x9030('0x19')](function(_0x5b745a){logger[_0x9030('0x15')](_0x9030('0x1a'),_0x5b745a[_0x9030('0x17')],_0x41d506);_0x1e5988(_0x372716['error'](0x1f4,_0x5b745a[_0x9030('0x17')]));});});};exports[_0x9030('0x24')]=function(_0x3b70ff){var _0xb2ff18=this;return new Promise(function(_0xe2f7c1,_0x14619b){return db[_0x9030('0x1b')][_0x9030('0x25')]({'raw':_0x3b70ff[_0x9030('0x1e')]?_0x3b70ff[_0x9030('0x1e')][_0x9030('0x1d')]===undefined?!![]:![]:!![],'where':_0x3b70ff[_0x9030('0x1e')]?_0x3b70ff[_0x9030('0x1e')][_0x9030('0x1f')]||null:null,'attributes':_0x3b70ff[_0x9030('0x1e')]?_0x3b70ff[_0x9030('0x1e')][_0x9030('0x20')]||null:null,'include':_0x3b70ff[_0x9030('0x1e')]?_0x3b70ff['options']['include']?_[_0x9030('0x22')](_0x3b70ff[_0x9030('0x1e')]['include'],function(_0x58cea7){return{'model':db[_0x58cea7[_0x9030('0x23')]],'as':_0x58cea7['as'],'attributes':_0x58cea7[_0x9030('0x20')],'include':_0x58cea7[_0x9030('0x21')]?_[_0x9030('0x22')](_0x58cea7['include'],function(_0xc8123e){return{'model':db[_0xc8123e['model']],'as':_0xc8123e['as'],'attributes':_0xc8123e[_0x9030('0x20')],'include':_0xc8123e[_0x9030('0x21')]?_['map'](_0xc8123e[_0x9030('0x21')],function(_0x19c515){return{'model':db[_0x19c515[_0x9030('0x23')]],'as':_0x19c515['as'],'attributes':_0x19c515['attributes']};}):[]};}):[]};}):[]:[]})[_0x9030('0xe')](function(_0x4864d4){if(_0x3b70ff[_0x9030('0x1e')]['smtp']===!![])_0x4864d4[_0x9030('0x26')]('smtpOptions',_0x4864d4[_0x9030('0x27')]());logger[_0x9030('0xf')](_0x9030('0x24'),_0x3b70ff);logger[_0x9030('0x12')](_0x9030('0x24'),_0x3b70ff,JSON[_0x9030('0x14')](_0x4864d4));_0xe2f7c1(_0x4864d4);})[_0x9030('0x19')](function(_0x429850){logger[_0x9030('0x15')]('ShowMailAccount',_0x429850[_0x9030('0x17')],_0x3b70ff);_0x14619b(_0xb2ff18[_0x9030('0x15')](0x1f4,_0x429850[_0x9030('0x17')]));});});};exports['NotifyMailAccount']=function(_0x72dd20){var _0x281b89=this;return new Promise(function(_0x3ebb74,_0x1a9ee5){var _0x5df7eb={'body':_0x72dd20[_0x9030('0x28')],'channel':_0x9030('0x29')};var _0x2709a8=_['difference'](_[_0x9030('0x2a')](db[_0x9030('0x2b')][_0x9030('0x2c')]),[_0x9030('0x2d'),_0x9030('0x2e'),'CompanyId',_0x9030('0x2f')]);var _0x4c7272=![];if(_0x72dd20[_0x9030('0x28')]['id']){delete _0x72dd20[_0x9030('0x28')]['id'];}if(_[_0x9030('0x30')](_0x72dd20[_0x9030('0x28')][_0x9030('0x31')])){return _0x1a9ee5(_0x281b89[_0x9030('0x15')](0x1f4,_0x9030('0x32')));}if(_[_0x9030('0x30')](_0x72dd20['body'][_0x9030('0x28')])||_0x72dd20[_0x9030('0x28')][_0x9030('0x28')]===''){return _0x1a9ee5(_0x281b89[_0x9030('0x15')](0x1f4,_0x9030('0x33')));}if(_[_0x9030('0x30')](_0x72dd20[_0x9030('0x28')][_0x9030('0x34')])){return _0x1a9ee5(_0x281b89[_0x9030('0x15')](0x1f4,_0x9030('0x35')+_0x2709a8));}if(!_[_0x9030('0x36')](_0x2709a8,_0x72dd20[_0x9030('0x28')][_0x9030('0x34')])){return _0x1a9ee5(_0x281b89[_0x9030('0x15')](0x1f4,'mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20'+_0x2709a8));}var _0x4725e5={};_0x4725e5[_0x72dd20[_0x9030('0x28')]['mapKey']]=_0x72dd20[_0x9030('0x28')][_0x9030('0x31')];return db[_0x9030('0x1b')]['find']({'where':{'id':_0x72dd20['account']['id']},'include':[{'model':db[_0x9030('0x37')],'as':'List','include':[{'model':db['CmContact'],'as':_0x9030('0x38'),'where':_0x4725e5,'limit':0x1,'order':[[_0x9030('0x2e'),_0x9030('0x39')]]}]},{'model':db[_0x9030('0x3a')],'as':'Applications'},{'model':db[_0x9030('0x3b')],'as':'Smtp','include':[{'model':db[_0x9030('0x3c')],'as':_0x9030('0x3c')}]}]})[_0x9030('0xe')](function(_0x513ee4){if(_0x513ee4&&_0x513ee4[_0x9030('0x3d')]){var _0xf54697=_0x513ee4[_0x9030('0x3e')]({'plain':!![]});_0x5df7eb['account']=_[_0x9030('0x3f')](_0xf54697,[_0x9030('0x40'),'List']);_0x5df7eb[_0x9030('0x41')]['smtpOptions']=_0x513ee4[_0x9030('0x27')]();_0x5df7eb['applications']=_0xf54697[_0x9030('0x40')];_0x5df7eb[_0x9030('0x42')]=_0xf54697[_0x9030('0x3d')];_0x5df7eb[_0x9030('0x43')]=_[_0x9030('0x44')](_0x5df7eb[_0x9030('0x43')],['priority'],[_0x9030('0x45')]);if(_0x5df7eb[_0x9030('0x41')]&&_0x5df7eb[_0x9030('0x41')][_0x9030('0x46')]){_0x5df7eb[_0x9030('0x43')]['push']({'id':0x0,'priority':_0x5df7eb['applications'][_0x9030('0x47')]+0x1,'app':_0x9030('0x48'),'appdata':_0x9030('0x46'),'interval':_0x9030('0x49')});}if(_0x5df7eb[_0x9030('0x41')][_0x9030('0x40')]){delete _0x5df7eb[_0x9030('0x41')][_0x9030('0x40')];}if(_0x5df7eb[_0x9030('0x41')][_0x9030('0x3d')]){delete _0x5df7eb[_0x9030('0x41')][_0x9030('0x3d')];}if(_0xf54697[_0x9030('0x3d')]['Contacts'][_0x9030('0x47')]){return _0xf54697[_0x9030('0x3d')]['Contacts'][0x0];}var _0x5c4218=_[_0x9030('0x9')](_0x72dd20[_0x9030('0x28')],{'firstName':_0x72dd20[_0x9030('0x28')][_0x9030('0x31')],'ListId':_0xf54697[_0x9030('0x2f')]});_0x5c4218[_0x72dd20[_0x9030('0x28')]['mapKey']]=_0x72dd20['body'][_0x9030('0x31')];return db[_0x9030('0x2b')][_0x9030('0x4a')](_0x5c4218);}else{throw new Error(_0x9030('0x4b'));}})['then'](function(_0x30710d){_0x5df7eb[_0x9030('0x4c')]=_0x30710d;if(_0x30710d){if(!_0x72dd20[_0x9030('0x28')][_0x9030('0x17')][_0x9030('0x4d')]){_0x72dd20['body']['message'][_0x9030('0x4d')]=rs[_0x9030('0x4e')]()+'\x20'+_0x72dd20[_0x9030('0x28')][_0x9030('0x17')][_0x9030('0x31')];}var _0x17bf72={'ContactId':_0x30710d['id'],'MailAccountId':_0x72dd20[_0x9030('0x41')]['id'],'inReplyTo':_0x72dd20[_0x9030('0x28')][_0x9030('0x17')][_0x9030('0x4d')],'to':_0x72dd20['body'][_0x9030('0x17')][_0x9030('0x31')],'cc':_0x72dd20[_0x9030('0x28')][_0x9030('0x17')]['cc'],'subject':_0x72dd20[_0x9030('0x28')][_0x9030('0x17')][_0x9030('0x4f')],'attach':_0x72dd20['body']['message'][_0x9030('0x50')],'lastMsgAt':moment()[_0x9030('0x51')](_0x9030('0x52')),'lastMsgDirection':'in'};return db[_0x9030('0x53')][_0x9030('0x25')]({'where':{'closed':![],'MailAccountId':_0x72dd20[_0x9030('0x41')]['id']},'include':[{'model':db[_0x9030('0x54')],'as':'Messages','attributes':['messageId'],'where':{'messageId':_0x72dd20['body'][_0x9030('0x17')]['inReplyTo']}}]})[_0x9030('0xe')](function(_0x54f34a){if(_0x54f34a){return[_0x54f34a,![]];}return db[_0x9030('0x53')][_0x9030('0x4a')](_0x17bf72)[_0x9030('0xe')](function(_0xb4b84e){return[_0xb4b84e,!![]];});});}else{throw new Error(_0x9030('0x55'));}})[_0x9030('0x56')](function(_0x3f46de,_0x404d20){if(_0x3f46de){_0x4c7272=_0x404d20;if(!_0x404d20){return _0x3f46de[_0x9030('0x57')]({'inReplyTo':_0x72dd20[_0x9030('0x28')][_0x9030('0x17')][_0x9030('0x4d')],'to':_0x72dd20[_0x9030('0x28')][_0x9030('0x17')]['from'],'cc':_0x72dd20[_0x9030('0x28')][_0x9030('0x17')]['cc'],'subject':_0x72dd20[_0x9030('0x28')][_0x9030('0x17')][_0x9030('0x4f')],'attach':_0x3f46de[_0x9030('0x50')]?_0x3f46de['attach']:_0x72dd20[_0x9030('0x28')][_0x9030('0x17')][_0x9030('0x50')],'substatus':null,'substatusAt':moment()[_0x9030('0x51')](_0x9030('0x52')),'lastMsgAt':moment()['format'](_0x9030('0x52')),'lastMsgDirection':'in'});}else{return _0x3f46de;}}})[_0x9030('0xe')](function(_0x2bea48){_0x5df7eb['interaction']=_0x2bea48[_0x9030('0x3e')]({'plain':!![]});_0x5df7eb[_0x9030('0x58')]['created']=_0x4c7272;return db['MailMessage']['create']({'body':_0x72dd20[_0x9030('0x28')][_0x9030('0x28')],'MailAccountId':_0x72dd20[_0x9030('0x41')]['id'],'MailInteractionId':_0x2bea48['id'],'direction':'in','ContactId':_0x5df7eb[_0x9030('0x4c')]['id'],'messageId':_0x72dd20[_0x9030('0x28')]['message'][_0x9030('0x4d')],'from':_0x72dd20[_0x9030('0x28')][_0x9030('0x17')][_0x9030('0x31')],'to':_0x72dd20['body'][_0x9030('0x17')]['to'],'cc':_0x72dd20[_0x9030('0x28')][_0x9030('0x17')]['cc'],'subject':_0x72dd20['body'][_0x9030('0x17')][_0x9030('0x4f')],'attach':_0x72dd20['body'][_0x9030('0x17')][_0x9030('0x50')],'Attachments':_0x72dd20[_0x9030('0x28')]['message'][_0x9030('0x59')],'originTo':_0x72dd20['body'][_0x9030('0x17')][_0x9030('0x5a')],'originCc':_0x72dd20[_0x9030('0x28')][_0x9030('0x17')][_0x9030('0x5b')],'bcc':_0x72dd20[_0x9030('0x28')][_0x9030('0x17')]['bcc'],'ChatWebsiteId':_0x72dd20[_0x9030('0x28')]['message'][_0x9030('0x5c')]||null,'originChannel':_0x72dd20[_0x9030('0x28')][_0x9030('0x17')][_0x9030('0x5d')]||_0x9030('0x5e'),'ChatOfflineMessageId':_0x72dd20['body']['message']['ChatOfflineMessageId']||null},{'include':[{'model':db[_0x9030('0x5f')],'as':_0x9030('0x60')}]});})[_0x9030('0xe')](function(_0x50fb8c){_0x5df7eb[_0x9030('0x17')]=_0x50fb8c;if(!_0x5df7eb[_0x9030('0x58')][_0x9030('0x61')]){return;}return db['User'][_0x9030('0x25')]({'attributes':['id',_0x9030('0x62')],'where':{'id':_0x5df7eb[_0x9030('0x58')][_0x9030('0x61')]}});})[_0x9030('0xe')](function(_0x588042){if(_0x588042){_0x5df7eb[_0x9030('0x43')][_0x9030('0x63')]({'id':0x0,'priority':0x0,'app':_0x9030('0x64'),'appdata':_0x588042['name']+','+(_0x5df7eb[_0x9030('0x41')][_0x9030('0x65')]||0xa),'interval':_0x9030('0x49')});}if(!_0x5df7eb[_0x9030('0x58')]['queueId']){return;}return db['MailQueue'][_0x9030('0x25')]({'attributes':['id',_0x9030('0x62')],'where':{'id':_0x5df7eb[_0x9030('0x58')][_0x9030('0x66')]}});})[_0x9030('0xe')](function(_0x59e5fe){if(_0x59e5fe){_0x5df7eb[_0x9030('0x43')][_0x9030('0x63')]({'id':0x0,'priority':0x1,'app':_0x9030('0x67'),'appdata':_0x59e5fe[_0x9030('0x62')]+','+(_0x5df7eb[_0x9030('0x41')]['waitForTheAssignedQueue']||0x12c),'interval':_0x9030('0x49')});}return respondWithRpcPromise('Start',_0x9030('0x68'),_0x5df7eb);})[_0x9030('0xe')](function(_0x351265){_0x3ebb74(_0x351265);})['catch'](function(_0x513184){_0x1a9ee5(_0x281b89[_0x9030('0x15')](0x1f4,_0x513184[_0x9030('0x17')]));});});}; \ No newline at end of file +var _0x08d9=['stringify','error','code','message','catch','GetMailAccount','MailAccount','options','raw','attributes','limit','include','map','model','debug','ShowMailAccount','find','where','smtp','setDataValue','smtpOptions','body','difference','keys','rawAttributes','createdAt','updatedAt','CompanyId','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','from','account','CmContact','Contacts','DESC','Smtp','CloudProvider','List','get','omit','getSmtpOptions','list','applications','orderBy','priority','asc','autoclose','push','Applications','length','ListId','create','List\x20not\x20found','contact','messageId','generate','subject','attach','format','MailInteraction','inReplyTo','Contact\x20not\x20found','spread','update','YYYY-MM-DD\x20HH:mm:ss','interaction','originCc','ChatWebsiteId','originChannel','Email','ChatOfflineMessageId','Attachment','Attachments','UserId','User','agent','*,*,*,*','queueId','MailQueue','name','unshift','queue','waitForTheAssignedQueue','lodash','bluebird','ioredis','../../mysqldb','../../config/logger','jayson/promise','client','http','redis','defaults','localhost','socket.io-emitter','./mailAccount.socket','register','then','info','MailAccount,\x20%s,\x20%s','request\x20sent'];(function(_0x95bb68,_0x10c830){var _0x40ddc6=function(_0xe29caf){while(--_0xe29caf){_0x95bb68['push'](_0x95bb68['shift']());}};_0x40ddc6(++_0x10c830);}(_0x08d9,0xc2));var _0x908d=function(_0x13a708,_0x5ce4bb){_0x13a708=_0x13a708-0x0;var _0x31c8f4=_0x08d9[_0x13a708];return _0x31c8f4;};'use strict';var _=require(_0x908d('0x0'));var moment=require('moment');var BPromise=require(_0x908d('0x1'));var rs=require('randomstring');var Redis=require(_0x908d('0x2'));var db=require(_0x908d('0x3'))['db'];var logger=require(_0x908d('0x4'))('rpc');var config=require('../../config/environment');var jayson=require(_0x908d('0x5'));var client=jayson[_0x908d('0x6')][_0x908d('0x7')]({'port':0x232c});config[_0x908d('0x8')]=_[_0x908d('0x9')](config['redis'],{'host':_0x908d('0xa'),'port':0x18eb});var socket=require(_0x908d('0xb'))(new Redis(config[_0x908d('0x8')]));require(_0x908d('0xc'))[_0x908d('0xd')](socket);function respondWithRpcPromise(_0x44b888,_0x86662e,_0x24113f){return new BPromise(function(_0x41b147,_0x2ac2b7){return client['request'](_0x44b888,_0x24113f)[_0x908d('0xe')](function(_0x1a1666){logger[_0x908d('0xf')](_0x908d('0x10'),_0x86662e,_0x908d('0x11'));logger['debug']('MailAccount,\x20%s,\x20%s,\x20%s',_0x86662e,'request\x20sent',JSON[_0x908d('0x12')](_0x1a1666));if(_0x1a1666[_0x908d('0x13')]){if(_0x1a1666[_0x908d('0x13')][_0x908d('0x14')]===0x1f4){logger[_0x908d('0x13')](_0x908d('0x10'),_0x86662e,_0x1a1666[_0x908d('0x13')]['message']);return _0x2ac2b7(_0x1a1666['error'][_0x908d('0x15')]);}logger[_0x908d('0x13')](_0x908d('0x10'),_0x86662e,_0x1a1666[_0x908d('0x13')]['message']);return _0x41b147(_0x1a1666['error'][_0x908d('0x15')]);}else{logger[_0x908d('0xf')](_0x908d('0x10'),_0x86662e,_0x908d('0x11'));_0x41b147(_0x1a1666['result'][_0x908d('0x15')]);}})[_0x908d('0x16')](function(_0x3dea46){logger[_0x908d('0x13')](_0x908d('0x10'),_0x86662e,_0x3dea46);_0x2ac2b7(_0x3dea46);});});}exports[_0x908d('0x17')]=function(_0x10137f){var _0x578bed=this;return new Promise(function(_0x34a524,_0x10848a){return db[_0x908d('0x18')]['findAll']({'raw':_0x10137f[_0x908d('0x19')]?_0x10137f[_0x908d('0x19')][_0x908d('0x1a')]===undefined?!![]:![]:!![],'where':_0x10137f[_0x908d('0x19')]?_0x10137f[_0x908d('0x19')]['where']||null:null,'attributes':_0x10137f[_0x908d('0x19')]?_0x10137f['options'][_0x908d('0x1b')]||null:null,'limit':_0x10137f[_0x908d('0x19')]?_0x10137f[_0x908d('0x19')][_0x908d('0x1c')]||null:null,'include':_0x10137f[_0x908d('0x19')]?_0x10137f[_0x908d('0x19')][_0x908d('0x1d')]?_[_0x908d('0x1e')](_0x10137f['options'][_0x908d('0x1d')],function(_0x1b5514){return{'model':db[_0x1b5514[_0x908d('0x1f')]],'as':_0x1b5514['as'],'attributes':_0x1b5514[_0x908d('0x1b')],'include':_0x1b5514[_0x908d('0x1d')]?_['map'](_0x1b5514['include'],function(_0x4488e8){return{'model':db[_0x4488e8[_0x908d('0x1f')]],'as':_0x4488e8['as'],'attributes':_0x4488e8[_0x908d('0x1b')],'include':_0x4488e8[_0x908d('0x1d')]?_[_0x908d('0x1e')](_0x4488e8['include'],function(_0x3c4157){return{'model':db[_0x3c4157[_0x908d('0x1f')]],'as':_0x3c4157['as'],'attributes':_0x3c4157['attributes']};}):[]};}):[]};}):[]:[]})[_0x908d('0xe')](function(_0x40b418){logger[_0x908d('0xf')](_0x908d('0x17'),_0x10137f);logger[_0x908d('0x20')](_0x908d('0x17'),_0x10137f,JSON[_0x908d('0x12')](_0x40b418));_0x34a524(_0x40b418);})[_0x908d('0x16')](function(_0x2b8fa3){logger[_0x908d('0x13')](_0x908d('0x17'),_0x2b8fa3['message'],_0x10137f);_0x10848a(_0x578bed[_0x908d('0x13')](0x1f4,_0x2b8fa3[_0x908d('0x15')]));});});};exports[_0x908d('0x21')]=function(_0x2d0e55){var _0x4e44b6=this;return new Promise(function(_0x28f130,_0x22e8dd){return db[_0x908d('0x18')][_0x908d('0x22')]({'raw':_0x2d0e55[_0x908d('0x19')]?_0x2d0e55[_0x908d('0x19')][_0x908d('0x1a')]===undefined?!![]:![]:!![],'where':_0x2d0e55[_0x908d('0x19')]?_0x2d0e55[_0x908d('0x19')][_0x908d('0x23')]||null:null,'attributes':_0x2d0e55[_0x908d('0x19')]?_0x2d0e55['options']['attributes']||null:null,'include':_0x2d0e55[_0x908d('0x19')]?_0x2d0e55[_0x908d('0x19')]['include']?_['map'](_0x2d0e55[_0x908d('0x19')][_0x908d('0x1d')],function(_0x359ca4){return{'model':db[_0x359ca4[_0x908d('0x1f')]],'as':_0x359ca4['as'],'attributes':_0x359ca4[_0x908d('0x1b')],'include':_0x359ca4['include']?_[_0x908d('0x1e')](_0x359ca4[_0x908d('0x1d')],function(_0x2a766f){return{'model':db[_0x2a766f[_0x908d('0x1f')]],'as':_0x2a766f['as'],'attributes':_0x2a766f[_0x908d('0x1b')],'include':_0x2a766f['include']?_['map'](_0x2a766f[_0x908d('0x1d')],function(_0x522ef1){return{'model':db[_0x522ef1[_0x908d('0x1f')]],'as':_0x522ef1['as'],'attributes':_0x522ef1[_0x908d('0x1b')]};}):[]};}):[]};}):[]:[]})[_0x908d('0xe')](function(_0x302897){if(_0x2d0e55[_0x908d('0x19')][_0x908d('0x24')]===!![])_0x302897[_0x908d('0x25')](_0x908d('0x26'),_0x302897['getSmtpOptions']());logger['info'](_0x908d('0x21'),_0x2d0e55);logger[_0x908d('0x20')](_0x908d('0x21'),_0x2d0e55,JSON['stringify'](_0x302897));_0x28f130(_0x302897);})['catch'](function(_0x56fd99){logger[_0x908d('0x13')]('ShowMailAccount',_0x56fd99[_0x908d('0x15')],_0x2d0e55);_0x22e8dd(_0x4e44b6[_0x908d('0x13')](0x1f4,_0x56fd99[_0x908d('0x15')]));});});};exports['NotifyMailAccount']=function(_0x53ca81){var _0x48bf10=this;return new Promise(function(_0x1c14fb,_0x136115){var _0x59073d={'body':_0x53ca81[_0x908d('0x27')],'channel':'mail'};var _0x929529=_[_0x908d('0x28')](_[_0x908d('0x29')](db['CmContact'][_0x908d('0x2a')]),[_0x908d('0x2b'),_0x908d('0x2c'),_0x908d('0x2d'),'ListId']);var _0x1b1329=![];if(_0x53ca81[_0x908d('0x27')]['id']){delete _0x53ca81[_0x908d('0x27')]['id'];}if(_[_0x908d('0x2e')](_0x53ca81[_0x908d('0x27')]['from'])){return _0x136115(_0x48bf10[_0x908d('0x13')](0x1f4,_0x908d('0x2f')));}if(_[_0x908d('0x2e')](_0x53ca81[_0x908d('0x27')][_0x908d('0x27')])||_0x53ca81[_0x908d('0x27')]['body']===''){return _0x136115(_0x48bf10['error'](0x1f4,_0x908d('0x30')));}if(_['isNil'](_0x53ca81[_0x908d('0x27')][_0x908d('0x31')])){return _0x136115(_0x48bf10['error'](0x1f4,_0x908d('0x32')+_0x929529));}if(!_[_0x908d('0x33')](_0x929529,_0x53ca81['body'][_0x908d('0x31')])){return _0x136115(_0x48bf10[_0x908d('0x13')](0x1f4,_0x908d('0x34')+_0x929529));}var _0x447f75={};_0x447f75[_0x53ca81['body'][_0x908d('0x31')]]=_0x53ca81['body'][_0x908d('0x35')];return db[_0x908d('0x18')]['find']({'where':{'id':_0x53ca81[_0x908d('0x36')]['id']},'include':[{'model':db['CmList'],'as':'List','include':[{'model':db[_0x908d('0x37')],'as':_0x908d('0x38'),'where':_0x447f75,'limit':0x1,'order':[[_0x908d('0x2c'),_0x908d('0x39')]]}]},{'model':db['MailApplication'],'as':'Applications'},{'model':db['MailServerOut'],'as':_0x908d('0x3a'),'include':[{'model':db[_0x908d('0x3b')],'as':_0x908d('0x3b')}]}]})[_0x908d('0xe')](function(_0x44d091){if(_0x44d091&&_0x44d091[_0x908d('0x3c')]){var _0x3f5d4f=_0x44d091[_0x908d('0x3d')]({'plain':!![]});_0x59073d['account']=_[_0x908d('0x3e')](_0x3f5d4f,['Applications',_0x908d('0x3c')]);_0x59073d[_0x908d('0x36')][_0x908d('0x26')]=_0x44d091[_0x908d('0x3f')]();_0x59073d['applications']=_0x3f5d4f['Applications'];_0x59073d[_0x908d('0x40')]=_0x3f5d4f[_0x908d('0x3c')];_0x59073d[_0x908d('0x41')]=_[_0x908d('0x42')](_0x59073d[_0x908d('0x41')],[_0x908d('0x43')],[_0x908d('0x44')]);if(_0x59073d[_0x908d('0x36')]&&_0x59073d[_0x908d('0x36')][_0x908d('0x45')]){_0x59073d['applications'][_0x908d('0x46')]({'id':0x0,'priority':_0x59073d[_0x908d('0x41')]['length']+0x1,'app':'close','appdata':_0x908d('0x45'),'interval':'*,*,*,*'});}if(_0x59073d[_0x908d('0x36')][_0x908d('0x47')]){delete _0x59073d['account']['Applications'];}if(_0x59073d[_0x908d('0x36')][_0x908d('0x3c')]){delete _0x59073d['account'][_0x908d('0x3c')];}if(_0x3f5d4f[_0x908d('0x3c')][_0x908d('0x38')][_0x908d('0x48')]){return _0x3f5d4f[_0x908d('0x3c')][_0x908d('0x38')][0x0];}var _0x3dca56=_[_0x908d('0x9')](_0x53ca81[_0x908d('0x27')],{'firstName':_0x53ca81[_0x908d('0x27')][_0x908d('0x35')],'ListId':_0x3f5d4f[_0x908d('0x49')]});_0x3dca56[_0x53ca81['body']['mapKey']]=_0x53ca81[_0x908d('0x27')]['from'];return db[_0x908d('0x37')][_0x908d('0x4a')](_0x3dca56);}else{throw new Error(_0x908d('0x4b'));}})[_0x908d('0xe')](function(_0x3e959b){_0x59073d[_0x908d('0x4c')]=_0x3e959b;if(_0x3e959b){if(!_0x53ca81[_0x908d('0x27')][_0x908d('0x15')][_0x908d('0x4d')]){_0x53ca81[_0x908d('0x27')]['message'][_0x908d('0x4d')]=rs[_0x908d('0x4e')]()+'\x20'+_0x53ca81[_0x908d('0x27')][_0x908d('0x15')][_0x908d('0x35')];}var _0x31de32={'ContactId':_0x3e959b['id'],'MailAccountId':_0x53ca81['account']['id'],'inReplyTo':_0x53ca81[_0x908d('0x27')]['message'][_0x908d('0x4d')],'to':_0x53ca81[_0x908d('0x27')][_0x908d('0x15')][_0x908d('0x35')],'cc':_0x53ca81[_0x908d('0x27')][_0x908d('0x15')]['cc'],'subject':_0x53ca81['body'][_0x908d('0x15')][_0x908d('0x4f')],'attach':_0x53ca81[_0x908d('0x27')][_0x908d('0x15')][_0x908d('0x50')],'lastMsgAt':moment()[_0x908d('0x51')]('YYYY-MM-DD\x20HH:mm:ss'),'lastMsgDirection':'in'};return db[_0x908d('0x52')][_0x908d('0x22')]({'where':{'closed':![],'MailAccountId':_0x53ca81[_0x908d('0x36')]['id']},'include':[{'model':db['MailMessage'],'as':'Messages','attributes':['messageId'],'where':{'messageId':_0x53ca81['body'][_0x908d('0x15')][_0x908d('0x53')]}}]})[_0x908d('0xe')](function(_0x57e708){if(_0x57e708){return[_0x57e708,![]];}return db[_0x908d('0x52')][_0x908d('0x4a')](_0x31de32)[_0x908d('0xe')](function(_0xa9b13a){return[_0xa9b13a,!![]];});});}else{throw new Error(_0x908d('0x54'));}})[_0x908d('0x55')](function(_0x488bf8,_0x2ed087){if(_0x488bf8){_0x1b1329=_0x2ed087;if(!_0x2ed087){return _0x488bf8[_0x908d('0x56')]({'inReplyTo':_0x53ca81[_0x908d('0x27')][_0x908d('0x15')][_0x908d('0x4d')],'to':_0x53ca81[_0x908d('0x27')][_0x908d('0x15')][_0x908d('0x35')],'cc':_0x53ca81['body'][_0x908d('0x15')]['cc'],'subject':_0x53ca81[_0x908d('0x27')][_0x908d('0x15')][_0x908d('0x4f')],'attach':_0x488bf8[_0x908d('0x50')]?_0x488bf8[_0x908d('0x50')]:_0x53ca81[_0x908d('0x27')][_0x908d('0x15')][_0x908d('0x50')],'substatus':null,'substatusAt':moment()['format'](_0x908d('0x57')),'lastMsgAt':moment()[_0x908d('0x51')](_0x908d('0x57')),'lastMsgDirection':'in'});}else{return _0x488bf8;}}})['then'](function(_0xf8f571){_0x59073d[_0x908d('0x58')]=_0xf8f571['get']({'plain':!![]});_0x59073d[_0x908d('0x58')]['created']=_0x1b1329;return db['MailMessage'][_0x908d('0x4a')]({'body':_0x53ca81[_0x908d('0x27')]['body'],'MailAccountId':_0x53ca81[_0x908d('0x36')]['id'],'MailInteractionId':_0xf8f571['id'],'direction':'in','ContactId':_0x59073d[_0x908d('0x4c')]['id'],'messageId':_0x53ca81[_0x908d('0x27')][_0x908d('0x15')][_0x908d('0x4d')],'from':_0x53ca81[_0x908d('0x27')][_0x908d('0x15')][_0x908d('0x35')],'to':_0x53ca81[_0x908d('0x27')][_0x908d('0x15')]['to'],'cc':_0x53ca81[_0x908d('0x27')][_0x908d('0x15')]['cc'],'subject':_0x53ca81[_0x908d('0x27')][_0x908d('0x15')][_0x908d('0x4f')],'attach':_0x53ca81[_0x908d('0x27')]['message'][_0x908d('0x50')],'Attachments':_0x53ca81['body'][_0x908d('0x15')]['attachments'],'originTo':_0x53ca81[_0x908d('0x27')][_0x908d('0x15')]['originTo'],'originCc':_0x53ca81[_0x908d('0x27')]['message'][_0x908d('0x59')],'bcc':_0x53ca81[_0x908d('0x27')][_0x908d('0x15')]['bcc'],'ChatWebsiteId':_0x53ca81['body'][_0x908d('0x15')][_0x908d('0x5a')]||null,'originChannel':_0x53ca81[_0x908d('0x27')][_0x908d('0x15')][_0x908d('0x5b')]||_0x908d('0x5c'),'ChatOfflineMessageId':_0x53ca81[_0x908d('0x27')]['message'][_0x908d('0x5d')]||null},{'include':[{'model':db[_0x908d('0x5e')],'as':_0x908d('0x5f')}]});})[_0x908d('0xe')](function(_0x67ced6){_0x59073d[_0x908d('0x15')]=_0x67ced6;if(!_0x59073d['interaction'][_0x908d('0x60')]){return;}return db[_0x908d('0x61')][_0x908d('0x22')]({'attributes':['id','name'],'where':{'id':_0x59073d[_0x908d('0x58')][_0x908d('0x60')]}});})[_0x908d('0xe')](function(_0x32fc44){if(_0x32fc44){_0x59073d['applications']['unshift']({'id':0x0,'priority':0x0,'app':_0x908d('0x62'),'appdata':_0x32fc44['name']+','+(_0x59073d[_0x908d('0x36')]['waitForTheAssignedAgent']||0xa),'interval':_0x908d('0x63')});}if(!_0x59073d[_0x908d('0x58')][_0x908d('0x64')]){return;}return db[_0x908d('0x65')][_0x908d('0x22')]({'attributes':['id',_0x908d('0x66')],'where':{'id':_0x59073d[_0x908d('0x58')][_0x908d('0x64')]}});})[_0x908d('0xe')](function(_0x49b490){if(_0x49b490){_0x59073d[_0x908d('0x41')][_0x908d('0x67')]({'id':0x0,'priority':0x1,'app':_0x908d('0x68'),'appdata':_0x49b490[_0x908d('0x66')]+','+(_0x59073d[_0x908d('0x36')][_0x908d('0x69')]||0x12c),'interval':'*,*,*,*'});}return respondWithRpcPromise('Start','startRouting',_0x59073d);})[_0x908d('0xe')](function(_0x5e6a28){_0x1c14fb(_0x5e6a28);})[_0x908d('0x16')](function(_0x5cb18f){_0x136115(_0x48bf10[_0x908d('0x13')](0x1f4,_0x5cb18f['message']));});});}; \ No newline at end of file diff --git a/server/api/mailAccount/mailAccount.socket.js b/server/api/mailAccount/mailAccount.socket.js index 6919ec3..41cd5b9 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 _0x9652=['mailAccount:','./mailAccount.events','save','update','removeListener','length'];(function(_0x33f31b,_0x550ae9){var _0x33514e=function(_0x266538){while(--_0x266538){_0x33f31b['push'](_0x33f31b['shift']());}};_0x33514e(++_0x550ae9);}(_0x9652,0xaf));var _0x2965=function(_0x360584,_0x4d5cbc){_0x360584=_0x360584-0x0;var _0x3d18c3=_0x9652[_0x360584];return _0x3d18c3;};'use strict';var MailAccountEvents=require(_0x2965('0x0'));var events=[_0x2965('0x1'),'remove',_0x2965('0x2')];function createListener(_0x451968,_0xbf6422){return function(_0x4013e4){_0xbf6422['emit'](_0x451968,_0x4013e4);};}function removeListener(_0x4867df,_0x3e26b6){return function(){MailAccountEvents[_0x2965('0x3')](_0x4867df,_0x3e26b6);};}exports['register']=function(_0x5205c7){for(var _0x4c347e=0x0,_0x694054=events[_0x2965('0x4')];_0x4c347e<_0x694054;_0x4c347e++){var _0x31e39f=events[_0x4c347e];var _0x3be4b1=createListener(_0x2965('0x5')+_0x31e39f,_0x5205c7);MailAccountEvents['on'](_0x31e39f,_0x3be4b1);}}; \ No newline at end of file +var _0x8889=['mailAccount:','./mailAccount.events','save','remove','update','emit','register','length'];(function(_0x598b62,_0x2ae03e){var _0x51ff00=function(_0x49ee3a){while(--_0x49ee3a){_0x598b62['push'](_0x598b62['shift']());}};_0x51ff00(++_0x2ae03e);}(_0x8889,0x1d9));var _0x9888=function(_0x30a8b4,_0x125565){_0x30a8b4=_0x30a8b4-0x0;var _0xeab516=_0x8889[_0x30a8b4];return _0xeab516;};'use strict';var MailAccountEvents=require(_0x9888('0x0'));var events=[_0x9888('0x1'),_0x9888('0x2'),_0x9888('0x3')];function createListener(_0x1350f8,_0x234dd3){return function(_0x7fb77a){_0x234dd3[_0x9888('0x4')](_0x1350f8,_0x7fb77a);};}function removeListener(_0x393744,_0x4b25b1){return function(){MailAccountEvents['removeListener'](_0x393744,_0x4b25b1);};}exports[_0x9888('0x5')]=function(_0x5939b9){for(var _0x427256=0x0,_0x4d59a1=events[_0x9888('0x6')];_0x427256<_0x4d59a1;_0x427256++){var _0x299d46=events[_0x427256];var _0x5b8047=createListener(_0x9888('0x7')+_0x299d46,_0x5939b9);MailAccountEvents['on'](_0x299d46,_0x5b8047);}}; \ No newline at end of file diff --git a/server/api/mailApplication/index.js b/server/api/mailApplication/index.js index 9f9512b..156da8f 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 _0xd26b=['/:id','isAuthenticated','put','update','destroy','exports','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service'];(function(_0x3bec81,_0x1ce782){var _0x28f720=function(_0xb12ac6){while(--_0xb12ac6){_0x3bec81['push'](_0x3bec81['shift']());}};_0x28f720(++_0x1ce782);}(_0xd26b,0x1d4));var _0xbd26=function(_0x4a7e27,_0x1e94fb){_0x4a7e27=_0x4a7e27-0x0;var _0x391f82=_0xd26b[_0x4a7e27];return _0x391f82;};'use strict';var multer=require('multer');var util=require(_0xbd26('0x0'));var path=require(_0xbd26('0x1'));var timeout=require(_0xbd26('0x2'));var express=require(_0xbd26('0x3'));var router=express[_0xbd26('0x4')]();var fs_extra=require(_0xbd26('0x5'));var auth=require(_0xbd26('0x6'));var interaction=require(_0xbd26('0x7'));var config=require('../../config/environment');var controller=require('./mailApplication.controller');router['get'](_0xbd26('0x8'),auth[_0xbd26('0x9')](),controller['show']);router[_0xbd26('0xa')](_0xbd26('0x8'),auth[_0xbd26('0x9')](),controller[_0xbd26('0xb')]);router['delete'](_0xbd26('0x8'),auth[_0xbd26('0x9')](),controller[_0xbd26('0xc')]);module[_0xbd26('0xd')]=router; \ No newline at end of file +var _0xfc72=['delete','destroy','exports','multer','util','path','connect-timeout','express','fs-extra','../../components/interaction/service','../../config/environment','get','/:id','isAuthenticated','show','put','update'];(function(_0x942d1c,_0x130e73){var _0x4c065e=function(_0x4a6d8f){while(--_0x4a6d8f){_0x942d1c['push'](_0x942d1c['shift']());}};_0x4c065e(++_0x130e73);}(_0xfc72,0x1f0));var _0x2fc7=function(_0x5018bd,_0x24b200){_0x5018bd=_0x5018bd-0x0;var _0x5cb7c7=_0xfc72[_0x5018bd];return _0x5cb7c7;};'use strict';var multer=require(_0x2fc7('0x0'));var util=require(_0x2fc7('0x1'));var path=require(_0x2fc7('0x2'));var timeout=require(_0x2fc7('0x3'));var express=require(_0x2fc7('0x4'));var router=express['Router']();var fs_extra=require(_0x2fc7('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0x2fc7('0x6'));var config=require(_0x2fc7('0x7'));var controller=require('./mailApplication.controller');router[_0x2fc7('0x8')](_0x2fc7('0x9'),auth[_0x2fc7('0xa')](),controller[_0x2fc7('0xb')]);router[_0x2fc7('0xc')](_0x2fc7('0x9'),auth[_0x2fc7('0xa')](),controller[_0x2fc7('0xd')]);router[_0x2fc7('0xe')](_0x2fc7('0x9'),auth[_0x2fc7('0xa')](),controller[_0x2fc7('0xf')]);module[_0x2fc7('0x10')]=router; \ No newline at end of file diff --git a/server/api/mailApplication/mailApplication.attributes.js b/server/api/mailApplication/mailApplication.attributes.js index b6e6f32..694c12d 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 _0x2028=['INTEGER','STRING','noop','*,*,*,*'];(function(_0x46698a,_0x8de1e4){var _0x356db0=function(_0x19e83c){while(--_0x19e83c){_0x46698a['push'](_0x46698a['shift']());}};_0x356db0(++_0x8de1e4);}(_0x2028,0x64));var _0x8202=function(_0x38b58f,_0x9586bd){_0x38b58f=_0x38b58f-0x0;var _0x35e3db=_0x2028[_0x38b58f];return _0x35e3db;};'use strict';var Sequelize=require('sequelize');module['exports']={'priority':{'type':Sequelize[_0x8202('0x0')],'allowNull':![]},'app':{'type':Sequelize[_0x8202('0x1')],'allowNull':![],'defaultValue':_0x8202('0x2')},'appdata':{'type':Sequelize['TEXT']()},'description':{'type':Sequelize[_0x8202('0x1')]},'interval':{'type':Sequelize[_0x8202('0x1')],'defaultValue':_0x8202('0x3')}}; \ No newline at end of file +var _0x1a2f=['INTEGER','noop','TEXT','STRING','*,*,*,*','sequelize','exports'];(function(_0x3fdf40,_0xb50ff7){var _0x5c18b4=function(_0x1ee616){while(--_0x1ee616){_0x3fdf40['push'](_0x3fdf40['shift']());}};_0x5c18b4(++_0xb50ff7);}(_0x1a2f,0x1da));var _0xf1a2=function(_0x4ee451,_0x1490c3){_0x4ee451=_0x4ee451-0x0;var _0x153560=_0x1a2f[_0x4ee451];return _0x153560;};'use strict';var Sequelize=require(_0xf1a2('0x0'));module[_0xf1a2('0x1')]={'priority':{'type':Sequelize[_0xf1a2('0x2')],'allowNull':![]},'app':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':_0xf1a2('0x3')},'appdata':{'type':Sequelize[_0xf1a2('0x4')]()},'description':{'type':Sequelize[_0xf1a2('0x5')]},'interval':{'type':Sequelize['STRING'],'defaultValue':_0xf1a2('0x6')}}; \ No newline at end of file diff --git a/server/api/mailApplication/mailApplication.controller.js b/server/api/mailApplication/mailApplication.controller.js index dbdd7d9..6e58897 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 _0x70e0=['util','sox','ejs','crypto','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','end','status','json','offset','undefined','count','limit','set','apply','save','update','then','error','stack','name','send','show','model','keys','MailApplication','query','filters','attributes','intersection','length','includeAll','include','find','catch','body','params','eml-format','rimraf','zip-dir','moment','bluebird','mustache'];(function(_0xb819a5,_0x40af38){var _0x27a3a0=function(_0x12d8ef){while(--_0x12d8ef){_0xb819a5['push'](_0xb819a5['shift']());}};_0x27a3a0(++_0x40af38);}(_0x70e0,0x17b));var _0x070e=function(_0x11df04,_0x23f6b6){_0x11df04=_0x11df04-0x0;var _0x106901=_0x70e0[_0x11df04];return _0x106901;};'use strict';var emlformat=require(_0x070e('0x0'));var rimraf=require(_0x070e('0x1'));var zipdir=require(_0x070e('0x2'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0x070e('0x3'));var BPromise=require(_0x070e('0x4'));var Mustache=require(_0x070e('0x5'));var util=require(_0x070e('0x6'));var path=require('path');var sox=require(_0x070e('0x7'));var csv=require('to-csv');var ejs=require(_0x070e('0x8'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require('squel');var crypto=require(_0x070e('0x9'));var jsforce=require(_0x070e('0xa'));var deskjs=require(_0x070e('0xb'));var toCsv=require(_0x070e('0xc'));var querystring=require(_0x070e('0xd'));var Papa=require(_0x070e('0xe'));var Redis=require(_0x070e('0xf'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0x070e('0x10'));var hardwareService=require(_0x070e('0x11'));var logger=require(_0x070e('0x12'))(_0x070e('0x13'));var utils=require(_0x070e('0x14'));var config=require(_0x070e('0x15'));var licenseUtil=require(_0x070e('0x16'));var db=require(_0x070e('0x17'))['db'];function respondWithStatusCode(_0x39d2b9,_0x5bf079){_0x5bf079=_0x5bf079||0xcc;return function(_0x2930b8){if(_0x2930b8){return _0x39d2b9['sendStatus'](_0x5bf079);}return _0x39d2b9['status'](_0x5bf079)[_0x070e('0x18')]();};}function respondWithResult(_0x56c7ba,_0x4a33d2){_0x4a33d2=_0x4a33d2||0xc8;return function(_0x5bae0f){if(_0x5bae0f){return _0x56c7ba[_0x070e('0x19')](_0x4a33d2)[_0x070e('0x1a')](_0x5bae0f);}};}function respondWithFilteredResult(_0x51d14d,_0x5d3a38){return function(_0x373d86){if(_0x373d86){var _0xeae1a5=typeof _0x5d3a38[_0x070e('0x1b')]===_0x070e('0x1c')&&typeof _0x5d3a38['limit']==='undefined';var _0x17e2e4=_0x373d86[_0x070e('0x1d')];var _0x38f6e6=_0xeae1a5?0x0:_0x5d3a38[_0x070e('0x1b')];var _0x364b3f=_0xeae1a5?_0x373d86['count']:_0x5d3a38[_0x070e('0x1b')]+_0x5d3a38[_0x070e('0x1e')];var _0x1ad3de;if(_0x364b3f>=_0x17e2e4){_0x364b3f=_0x17e2e4;_0x1ad3de=0xc8;}else{_0x1ad3de=0xce;}_0x51d14d[_0x070e('0x19')](_0x1ad3de);return _0x51d14d[_0x070e('0x1f')]('Content-Range',_0x38f6e6+'-'+_0x364b3f+'/'+_0x17e2e4)['json'](_0x373d86);}return null;};}function patchUpdates(_0x4e958f){return function(_0x9907cf){try{jsonpatch[_0x070e('0x20')](_0x9907cf,_0x4e958f,!![]);}catch(_0x20dc60){return BPromise['reject'](_0x20dc60);}return _0x9907cf[_0x070e('0x21')]();};}function saveUpdates(_0x5dc5d2,_0xf8dd5d){return function(_0x3f6985){if(_0x3f6985){return _0x3f6985[_0x070e('0x22')](_0x5dc5d2)[_0x070e('0x23')](function(_0x28a1c3){return _0x28a1c3;});}return null;};}function removeEntity(_0xa86797,_0xe405e){return function(_0x164cdf){if(_0x164cdf){return _0x164cdf['destroy']()[_0x070e('0x23')](function(){_0xa86797[_0x070e('0x19')](0xcc)[_0x070e('0x18')]();});}};}function handleEntityNotFound(_0x503f4d,_0xf17c56){return function(_0x5f3e9d){if(!_0x5f3e9d){_0x503f4d['sendStatus'](0x194);}return _0x5f3e9d;};}function handleError(_0x2ccbd7,_0x25f6e){_0x25f6e=_0x25f6e||0x1f4;return function(_0x41deb1){logger[_0x070e('0x24')](_0x41deb1[_0x070e('0x25')]);if(_0x41deb1['name']){delete _0x41deb1[_0x070e('0x26')];}_0x2ccbd7[_0x070e('0x19')](_0x25f6e)[_0x070e('0x27')](_0x41deb1);};}exports[_0x070e('0x28')]=function(_0x43dd96,_0x28d7f2){var _0x1a1892={'raw':!![],'where':{'id':_0x43dd96['params']['id']}},_0x26373b={};_0x26373b[_0x070e('0x29')]=_[_0x070e('0x2a')](db[_0x070e('0x2b')]['rawAttributes']);_0x26373b['query']=_[_0x070e('0x2a')](_0x43dd96[_0x070e('0x2c')]);_0x26373b[_0x070e('0x2d')]=_['intersection'](_0x26373b[_0x070e('0x29')],_0x26373b[_0x070e('0x2c')]);_0x1a1892[_0x070e('0x2e')]=_[_0x070e('0x2f')](_0x26373b['model'],qs['fields'](_0x43dd96['query']['fields']));_0x1a1892[_0x070e('0x2e')]=_0x1a1892['attributes'][_0x070e('0x30')]?_0x1a1892[_0x070e('0x2e')]:_0x26373b['model'];if(_0x43dd96['query'][_0x070e('0x31')]){_0x1a1892[_0x070e('0x32')]=[{'all':!![]}];}_0x1a1892=_['merge']({},_0x1a1892,_0x43dd96['options']);return db[_0x070e('0x2b')][_0x070e('0x33')](_0x1a1892)[_0x070e('0x23')](handleEntityNotFound(_0x28d7f2,null))[_0x070e('0x23')](respondWithResult(_0x28d7f2,null))[_0x070e('0x34')](handleError(_0x28d7f2,null));};exports['update']=function(_0x482cc2,_0x24d17d){if(_0x482cc2[_0x070e('0x35')]['id']){delete _0x482cc2[_0x070e('0x35')]['id'];}return db[_0x070e('0x2b')][_0x070e('0x33')]({'where':{'id':_0x482cc2['params']['id']}})[_0x070e('0x23')](handleEntityNotFound(_0x24d17d,null))[_0x070e('0x23')](saveUpdates(_0x482cc2['body'],null))[_0x070e('0x23')](respondWithResult(_0x24d17d,null))[_0x070e('0x34')](handleError(_0x24d17d,null));};exports['destroy']=function(_0x4d4ee8,_0x5ddbe9){return db[_0x070e('0x2b')][_0x070e('0x33')]({'where':{'id':_0x4d4ee8[_0x070e('0x36')]['id']}})[_0x070e('0x23')](handleEntityNotFound(_0x5ddbe9,null))[_0x070e('0x23')](removeEntity(_0x5ddbe9,null))['catch'](handleError(_0x5ddbe9,null));}; \ No newline at end of file +var _0xe706=['limit','count','offset','set','Content-Range','json','apply','save','update','then','end','name','send','show','params','model','keys','MailApplication','rawAttributes','query','filters','attributes','intersection','fields','length','includeAll','include','merge','options','find','body','catch','destroy','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','undefined'];(function(_0xd72d83,_0x114be1){var _0x485937=function(_0x55f060){while(--_0x55f060){_0xd72d83['push'](_0xd72d83['shift']());}};_0x485937(++_0x114be1);}(_0xe706,0xa3));var _0x6e70=function(_0x50d77f,_0x1a76da){_0x50d77f=_0x50d77f-0x0;var _0x477ae3=_0xe706[_0x50d77f];return _0x477ae3;};'use strict';var emlformat=require(_0x6e70('0x0'));var rimraf=require(_0x6e70('0x1'));var zipdir=require(_0x6e70('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x6e70('0x3'));var moment=require(_0x6e70('0x4'));var BPromise=require(_0x6e70('0x5'));var Mustache=require(_0x6e70('0x6'));var util=require(_0x6e70('0x7'));var path=require(_0x6e70('0x8'));var sox=require(_0x6e70('0x9'));var csv=require(_0x6e70('0xa'));var ejs=require(_0x6e70('0xb'));var fs=require('fs');var fs_extra=require(_0x6e70('0xc'));var _=require(_0x6e70('0xd'));var squel=require(_0x6e70('0xe'));var crypto=require(_0x6e70('0xf'));var jsforce=require(_0x6e70('0x10'));var deskjs=require(_0x6e70('0x11'));var toCsv=require(_0x6e70('0xa'));var querystring=require(_0x6e70('0x12'));var Papa=require(_0x6e70('0x13'));var Redis=require(_0x6e70('0x14'));var authService=require(_0x6e70('0x15'));var qs=require(_0x6e70('0x16'));var as=require(_0x6e70('0x17'));var hardwareService=require(_0x6e70('0x18'));var logger=require(_0x6e70('0x19'))('api');var utils=require('../../config/utils');var config=require(_0x6e70('0x1a'));var licenseUtil=require(_0x6e70('0x1b'));var db=require(_0x6e70('0x1c'))['db'];function respondWithStatusCode(_0x27dd9b,_0x3b38f3){_0x3b38f3=_0x3b38f3||0xcc;return function(_0x310eb7){if(_0x310eb7){return _0x27dd9b[_0x6e70('0x1d')](_0x3b38f3);}return _0x27dd9b[_0x6e70('0x1e')](_0x3b38f3)['end']();};}function respondWithResult(_0x52737e,_0x48bc72){_0x48bc72=_0x48bc72||0xc8;return function(_0x257e81){if(_0x257e81){return _0x52737e['status'](_0x48bc72)['json'](_0x257e81);}};}function respondWithFilteredResult(_0x304716,_0x22c50c){return function(_0x5d9263){if(_0x5d9263){var _0x24f3ac=typeof _0x22c50c['offset']===_0x6e70('0x1f')&&typeof _0x22c50c[_0x6e70('0x20')]==='undefined';var _0x49029f=_0x5d9263[_0x6e70('0x21')];var _0x5ea7a5=_0x24f3ac?0x0:_0x22c50c[_0x6e70('0x22')];var _0x173afe=_0x24f3ac?_0x5d9263['count']:_0x22c50c['offset']+_0x22c50c[_0x6e70('0x20')];var _0x208e21;if(_0x173afe>=_0x49029f){_0x173afe=_0x49029f;_0x208e21=0xc8;}else{_0x208e21=0xce;}_0x304716[_0x6e70('0x1e')](_0x208e21);return _0x304716[_0x6e70('0x23')](_0x6e70('0x24'),_0x5ea7a5+'-'+_0x173afe+'/'+_0x49029f)[_0x6e70('0x25')](_0x5d9263);}return null;};}function patchUpdates(_0x1b2453){return function(_0x44a49f){try{jsonpatch[_0x6e70('0x26')](_0x44a49f,_0x1b2453,!![]);}catch(_0xb29a2a){return BPromise['reject'](_0xb29a2a);}return _0x44a49f[_0x6e70('0x27')]();};}function saveUpdates(_0x344b65,_0x27b294){return function(_0x502b2d){if(_0x502b2d){return _0x502b2d[_0x6e70('0x28')](_0x344b65)[_0x6e70('0x29')](function(_0x3337a6){return _0x3337a6;});}return null;};}function removeEntity(_0x50da2c,_0x10fc91){return function(_0x538b9c){if(_0x538b9c){return _0x538b9c['destroy']()['then'](function(){_0x50da2c[_0x6e70('0x1e')](0xcc)[_0x6e70('0x2a')]();});}};}function handleEntityNotFound(_0x51d292,_0x3ecdf1){return function(_0x1196ed){if(!_0x1196ed){_0x51d292['sendStatus'](0x194);}return _0x1196ed;};}function handleError(_0x338ad6,_0x67fb43){_0x67fb43=_0x67fb43||0x1f4;return function(_0x2bb231){logger['error'](_0x2bb231['stack']);if(_0x2bb231[_0x6e70('0x2b')]){delete _0x2bb231[_0x6e70('0x2b')];}_0x338ad6[_0x6e70('0x1e')](_0x67fb43)[_0x6e70('0x2c')](_0x2bb231);};}exports[_0x6e70('0x2d')]=function(_0x5d772a,_0x1952ea){var _0x406f29={'raw':!![],'where':{'id':_0x5d772a[_0x6e70('0x2e')]['id']}},_0xecf336={};_0xecf336[_0x6e70('0x2f')]=_[_0x6e70('0x30')](db[_0x6e70('0x31')][_0x6e70('0x32')]);_0xecf336[_0x6e70('0x33')]=_[_0x6e70('0x30')](_0x5d772a['query']);_0xecf336[_0x6e70('0x34')]=_['intersection'](_0xecf336[_0x6e70('0x2f')],_0xecf336['query']);_0x406f29[_0x6e70('0x35')]=_[_0x6e70('0x36')](_0xecf336[_0x6e70('0x2f')],qs['fields'](_0x5d772a[_0x6e70('0x33')][_0x6e70('0x37')]));_0x406f29['attributes']=_0x406f29[_0x6e70('0x35')][_0x6e70('0x38')]?_0x406f29['attributes']:_0xecf336[_0x6e70('0x2f')];if(_0x5d772a[_0x6e70('0x33')][_0x6e70('0x39')]){_0x406f29[_0x6e70('0x3a')]=[{'all':!![]}];}_0x406f29=_[_0x6e70('0x3b')]({},_0x406f29,_0x5d772a[_0x6e70('0x3c')]);return db[_0x6e70('0x31')][_0x6e70('0x3d')](_0x406f29)[_0x6e70('0x29')](handleEntityNotFound(_0x1952ea,null))[_0x6e70('0x29')](respondWithResult(_0x1952ea,null))['catch'](handleError(_0x1952ea,null));};exports[_0x6e70('0x28')]=function(_0x4795a0,_0x23cd1a){if(_0x4795a0[_0x6e70('0x3e')]['id']){delete _0x4795a0[_0x6e70('0x3e')]['id'];}return db[_0x6e70('0x31')][_0x6e70('0x3d')]({'where':{'id':_0x4795a0[_0x6e70('0x2e')]['id']}})[_0x6e70('0x29')](handleEntityNotFound(_0x23cd1a,null))[_0x6e70('0x29')](saveUpdates(_0x4795a0[_0x6e70('0x3e')],null))[_0x6e70('0x29')](respondWithResult(_0x23cd1a,null))[_0x6e70('0x3f')](handleError(_0x23cd1a,null));};exports[_0x6e70('0x40')]=function(_0x5594d3,_0x501b53){return db['MailApplication']['find']({'where':{'id':_0x5594d3[_0x6e70('0x2e')]['id']}})[_0x6e70('0x29')](handleEntityNotFound(_0x501b53,null))[_0x6e70('0x29')](removeEntity(_0x501b53,null))[_0x6e70('0x3f')](handleError(_0x501b53,null));}; \ No newline at end of file diff --git a/server/api/mailApplication/mailApplication.model.js b/server/api/mailApplication/mailApplication.model.js index 483636e..05aac6e 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 _0x6fa6=['../../config/logger','api','request-promise','path','rimraf','../../config/environment','MailApplication','mail_applications','utf8mb4','utf8mb4_unicode_ci','lodash','util'];(function(_0xffd240,_0x8b852a){var _0xb486b9=function(_0x1ced1d){while(--_0x1ced1d){_0xffd240['push'](_0xffd240['shift']());}};_0xb486b9(++_0x8b852a);}(_0x6fa6,0xa6));var _0x66fa=function(_0x225865,_0x5811a4){_0x225865=_0x225865-0x0;var _0x560c35=_0x6fa6[_0x225865];return _0x560c35;};'use strict';var _=require(_0x66fa('0x0'));var util=require(_0x66fa('0x1'));var logger=require(_0x66fa('0x2'))(_0x66fa('0x3'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0x66fa('0x4'));var fs=require('fs');var path=require(_0x66fa('0x5'));var rimraf=require(_0x66fa('0x6'));var config=require(_0x66fa('0x7'));var attributes=require('./mailApplication.attributes');module['exports']=function(_0x395464,_0x1423cc){return _0x395464['define'](_0x66fa('0x8'),attributes,{'tableName':_0x66fa('0x9'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x66fa('0xa'),'collate':_0x66fa('0xb')});}; \ No newline at end of file +var _0xe129=['utf8mb4_unicode_ci','../../config/logger','api','moment','bluebird','request-promise','path','./mailApplication.attributes','exports','define','MailApplication'];(function(_0x19e35c,_0x29cd1e){var _0x3e1fe8=function(_0x17258b){while(--_0x17258b){_0x19e35c['push'](_0x19e35c['shift']());}};_0x3e1fe8(++_0x29cd1e);}(_0xe129,0x135));var _0x9e12=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xe129[_0x3dd15e];return _0x231fd0;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x9e12('0x0'))(_0x9e12('0x1'));var moment=require(_0x9e12('0x2'));var BPromise=require(_0x9e12('0x3'));var rp=require(_0x9e12('0x4'));var fs=require('fs');var path=require(_0x9e12('0x5'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0x9e12('0x6'));module[_0x9e12('0x7')]=function(_0x4bde9c,_0x3c5fd0){return _0x4bde9c[_0x9e12('0x8')](_0x9e12('0x9'),attributes,{'tableName':'mail_applications','paranoid':![],'indexes':[],'timestamps':!![],'charset':'utf8mb4','collate':_0x9e12('0xa')});}; \ No newline at end of file diff --git a/server/api/mailApplication/mailApplication.rpc.js b/server/api/mailApplication/mailApplication.rpc.js index c919ef3..748a2b4 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 _0x21ad=['bluebird','randomstring','../../mysqldb','rpc','../../config/environment','jayson/promise','client','request','info','request\x20sent','debug','MailApplication,\x20%s,\x20%s,\x20%s','stringify','error','code','message','MailApplication,\x20%s,\x20%s','catch','UpdateMailApplication','MailApplication','body','options','where','limit','then','lodash','moment'];(function(_0x2f37e0,_0x393ef9){var _0x43ccce=function(_0x318b51){while(--_0x318b51){_0x2f37e0['push'](_0x2f37e0['shift']());}};_0x43ccce(++_0x393ef9);}(_0x21ad,0x85));var _0xd21a=function(_0x4d07cc,_0x587613){_0x4d07cc=_0x4d07cc-0x0;var _0x42de3b=_0x21ad[_0x4d07cc];return _0x42de3b;};'use strict';var _=require(_0xd21a('0x0'));var util=require('util');var moment=require(_0xd21a('0x1'));var BPromise=require(_0xd21a('0x2'));var rs=require(_0xd21a('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xd21a('0x4'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0xd21a('0x5'));var config=require(_0xd21a('0x6'));var jayson=require(_0xd21a('0x7'));var client=jayson[_0xd21a('0x8')]['http']({'port':0x232a});function respondWithRpcPromise(_0x25e0e4,_0x1c7fe9,_0xd4ad66){return new BPromise(function(_0x5f2195,_0x210f2f){return client[_0xd21a('0x9')](_0x25e0e4,_0xd4ad66)['then'](function(_0xf51795){logger[_0xd21a('0xa')]('MailApplication,\x20%s,\x20%s',_0x1c7fe9,_0xd21a('0xb'));logger[_0xd21a('0xc')](_0xd21a('0xd'),_0x1c7fe9,_0xd21a('0xb'),JSON[_0xd21a('0xe')](_0xf51795));if(_0xf51795[_0xd21a('0xf')]){if(_0xf51795['error'][_0xd21a('0x10')]===0x1f4){logger[_0xd21a('0xf')]('MailApplication,\x20%s,\x20%s',_0x1c7fe9,_0xf51795[_0xd21a('0xf')][_0xd21a('0x11')]);return _0x210f2f(_0xf51795[_0xd21a('0xf')][_0xd21a('0x11')]);}logger[_0xd21a('0xf')](_0xd21a('0x12'),_0x1c7fe9,_0xf51795[_0xd21a('0xf')]['message']);return _0x5f2195(_0xf51795['error'][_0xd21a('0x11')]);}else{logger[_0xd21a('0xa')](_0xd21a('0x12'),_0x1c7fe9,_0xd21a('0xb'));_0x5f2195(_0xf51795['result'][_0xd21a('0x11')]);}})[_0xd21a('0x13')](function(_0x4c6258){logger[_0xd21a('0xf')](_0xd21a('0x12'),_0x1c7fe9,_0x4c6258);_0x210f2f(_0x4c6258);});});}exports[_0xd21a('0x14')]=function(_0x357e71){var _0x3c7ca5=this;return new Promise(function(_0x4c3d6d,_0x2d354a){return db[_0xd21a('0x15')]['update'](_0x357e71[_0xd21a('0x16')],{'raw':_0x357e71[_0xd21a('0x17')]?_0x357e71['options']['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x357e71[_0xd21a('0x17')]?_0x357e71[_0xd21a('0x17')][_0xd21a('0x18')]||null:null,'attributes':_0x357e71[_0xd21a('0x17')]?_0x357e71[_0xd21a('0x17')]['attributes']||null:null,'limit':_0x357e71[_0xd21a('0x17')]?_0x357e71[_0xd21a('0x17')][_0xd21a('0x19')]||null:null})[_0xd21a('0x1a')](function(_0x36f680){logger[_0xd21a('0xa')](_0xd21a('0x14'),_0x357e71);logger[_0xd21a('0xc')](_0xd21a('0x14'),_0x357e71,JSON['stringify'](_0x36f680));_0x4c3d6d(_0x36f680);})[_0xd21a('0x13')](function(_0x10d12c){logger['error']('UpdateMailApplication',_0x10d12c['message'],_0x357e71);_0x2d354a(_0x3c7ca5[_0xd21a('0xf')](0x1f4,_0x10d12c[_0xd21a('0x11')]));});});}; \ No newline at end of file +var _0x52b0=['options','raw','where','attributes','limit','then','debug','UpdateMailApplication','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','info','MailApplication,\x20%s,\x20%s','request\x20sent','MailApplication,\x20%s,\x20%s,\x20%s','stringify','error','message','catch','MailApplication','update','body'];(function(_0x1ba29c,_0x5833e0){var _0x5d3243=function(_0x583b24){while(--_0x583b24){_0x1ba29c['push'](_0x1ba29c['shift']());}};_0x5d3243(++_0x5833e0);}(_0x52b0,0x1bb));var _0x052b=function(_0x22aea7,_0xbaa36d){_0x22aea7=_0x22aea7-0x0;var _0x1d4c39=_0x52b0[_0x22aea7];return _0x1d4c39;};'use strict';var _=require('lodash');var util=require('util');var moment=require('moment');var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x052b('0x0'));var db=require(_0x052b('0x1'))['db'];var utils=require(_0x052b('0x2'));var logger=require(_0x052b('0x3'))(_0x052b('0x4'));var config=require(_0x052b('0x5'));var jayson=require(_0x052b('0x6'));var client=jayson[_0x052b('0x7')][_0x052b('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x5e1b6d,_0x3e1b5e,_0x3399cd){return new BPromise(function(_0x5abb78,_0x1eda7f){return client[_0x052b('0x9')](_0x5e1b6d,_0x3399cd)['then'](function(_0x480141){logger[_0x052b('0xa')](_0x052b('0xb'),_0x3e1b5e,_0x052b('0xc'));logger['debug'](_0x052b('0xd'),_0x3e1b5e,'request\x20sent',JSON[_0x052b('0xe')](_0x480141));if(_0x480141[_0x052b('0xf')]){if(_0x480141[_0x052b('0xf')]['code']===0x1f4){logger['error'](_0x052b('0xb'),_0x3e1b5e,_0x480141[_0x052b('0xf')][_0x052b('0x10')]);return _0x1eda7f(_0x480141[_0x052b('0xf')][_0x052b('0x10')]);}logger[_0x052b('0xf')]('MailApplication,\x20%s,\x20%s',_0x3e1b5e,_0x480141[_0x052b('0xf')][_0x052b('0x10')]);return _0x5abb78(_0x480141[_0x052b('0xf')]['message']);}else{logger['info'](_0x052b('0xb'),_0x3e1b5e,_0x052b('0xc'));_0x5abb78(_0x480141['result'][_0x052b('0x10')]);}})[_0x052b('0x11')](function(_0x3f9fef){logger[_0x052b('0xf')]('MailApplication,\x20%s,\x20%s',_0x3e1b5e,_0x3f9fef);_0x1eda7f(_0x3f9fef);});});}exports['UpdateMailApplication']=function(_0x57a0a1){var _0x44ab5e=this;return new Promise(function(_0x221732,_0x3a0bde){return db[_0x052b('0x12')][_0x052b('0x13')](_0x57a0a1[_0x052b('0x14')],{'raw':_0x57a0a1[_0x052b('0x15')]?_0x57a0a1['options'][_0x052b('0x16')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x57a0a1[_0x052b('0x15')]?_0x57a0a1[_0x052b('0x15')][_0x052b('0x17')]||null:null,'attributes':_0x57a0a1[_0x052b('0x15')]?_0x57a0a1['options'][_0x052b('0x18')]||null:null,'limit':_0x57a0a1[_0x052b('0x15')]?_0x57a0a1[_0x052b('0x15')][_0x052b('0x19')]||null:null})[_0x052b('0x1a')](function(_0x327736){logger[_0x052b('0xa')]('UpdateMailApplication',_0x57a0a1);logger[_0x052b('0x1b')](_0x052b('0x1c'),_0x57a0a1,JSON[_0x052b('0xe')](_0x327736));_0x221732(_0x327736);})['catch'](function(_0x36552d){logger[_0x052b('0xf')](_0x052b('0x1c'),_0x36552d[_0x052b('0x10')],_0x57a0a1);_0x3a0bde(_0x44ab5e['error'](0x1f4,_0x36552d[_0x052b('0x10')]));});});}; \ No newline at end of file diff --git a/server/api/mailInteraction/index.js b/server/api/mailInteraction/index.js index 0425fb3..754dda6 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 _0xab01=['Router','../../components/auth/service','../../components/interaction/service','./mailInteraction.controller','isAuthenticated','index','get','describe','/:id','/:id/messages','getMessages','download','create','post','addMessage','tracked','mail','addTags','put','mailinteraction:update','update','mailinteraction:destroy','destroy','delete','/:id/tags','removeTags','exports'];(function(_0x3025d0,_0x5777a9){var _0x7fbc20=function(_0x229876){while(--_0x229876){_0x3025d0['push'](_0x3025d0['shift']());}};_0x7fbc20(++_0x5777a9);}(_0xab01,0x1cb));var _0x1ab0=function(_0x2e7279,_0x28dd44){_0x2e7279=_0x2e7279-0x0;var _0x2e95a9=_0xab01[_0x2e7279];return _0x2e95a9;};'use strict';var express=require('express');var router=express[_0x1ab0('0x0')]();var auth=require(_0x1ab0('0x1'));var interaction=require(_0x1ab0('0x2'));var controller=require(_0x1ab0('0x3'));router['get']('/',auth[_0x1ab0('0x4')](),controller[_0x1ab0('0x5')]);router[_0x1ab0('0x6')]('/describe',auth['isAuthenticated'](),controller[_0x1ab0('0x7')]);router[_0x1ab0('0x6')](_0x1ab0('0x8'),auth[_0x1ab0('0x4')](),controller['show']);router['get'](_0x1ab0('0x9'),auth[_0x1ab0('0x4')](),controller[_0x1ab0('0xa')]);router[_0x1ab0('0x6')]('/:id/download',auth[_0x1ab0('0x4')](),controller[_0x1ab0('0xb')]);router['post']('/',auth[_0x1ab0('0x4')](),controller[_0x1ab0('0xc')]);router[_0x1ab0('0xd')]('/:id/messages',auth[_0x1ab0('0x4')](),controller[_0x1ab0('0xe')]);router[_0x1ab0('0xd')]('/:id/tags',auth[_0x1ab0('0x4')](),interaction[_0x1ab0('0xf')](_0x1ab0('0x10'),'mailinteraction:addtags'),controller[_0x1ab0('0x11')]);router[_0x1ab0('0x12')]('/:id',auth['isAuthenticated'](),interaction[_0x1ab0('0xf')](_0x1ab0('0x10'),_0x1ab0('0x13')),controller[_0x1ab0('0x14')]);router['delete'](_0x1ab0('0x8'),auth[_0x1ab0('0x4')](),interaction[_0x1ab0('0xf')](_0x1ab0('0x10'),_0x1ab0('0x15')),controller[_0x1ab0('0x16')]);router[_0x1ab0('0x17')](_0x1ab0('0x18'),auth['isAuthenticated'](),controller[_0x1ab0('0x19')]);module[_0x1ab0('0x1a')]=router; \ No newline at end of file +var _0xd319=['delete','mailinteraction:destroy','removeTags','express','Router','get','isAuthenticated','index','/describe','/:id','show','/:id/messages','getMessages','/:id/download','post','/:id/tags','tracked','mail','mailinteraction:addtags','addTags','put','mailinteraction:update','update'];(function(_0x2e087b,_0x3d9dab){var _0x3fd98e=function(_0x5e3ec7){while(--_0x5e3ec7){_0x2e087b['push'](_0x2e087b['shift']());}};_0x3fd98e(++_0x3d9dab);}(_0xd319,0x12e));var _0x9d31=function(_0x42e210,_0x484fa6){_0x42e210=_0x42e210-0x0;var _0x2e68c5=_0xd319[_0x42e210];return _0x2e68c5;};'use strict';var express=require(_0x9d31('0x0'));var router=express[_0x9d31('0x1')]();var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var controller=require('./mailInteraction.controller');router[_0x9d31('0x2')]('/',auth[_0x9d31('0x3')](),controller[_0x9d31('0x4')]);router[_0x9d31('0x2')](_0x9d31('0x5'),auth[_0x9d31('0x3')](),controller['describe']);router[_0x9d31('0x2')](_0x9d31('0x6'),auth[_0x9d31('0x3')](),controller[_0x9d31('0x7')]);router['get'](_0x9d31('0x8'),auth[_0x9d31('0x3')](),controller[_0x9d31('0x9')]);router[_0x9d31('0x2')](_0x9d31('0xa'),auth['isAuthenticated'](),controller['download']);router[_0x9d31('0xb')]('/',auth[_0x9d31('0x3')](),controller['create']);router[_0x9d31('0xb')](_0x9d31('0x8'),auth[_0x9d31('0x3')](),controller['addMessage']);router[_0x9d31('0xb')](_0x9d31('0xc'),auth[_0x9d31('0x3')](),interaction[_0x9d31('0xd')](_0x9d31('0xe'),_0x9d31('0xf')),controller[_0x9d31('0x10')]);router[_0x9d31('0x11')](_0x9d31('0x6'),auth[_0x9d31('0x3')](),interaction[_0x9d31('0xd')](_0x9d31('0xe'),_0x9d31('0x12')),controller[_0x9d31('0x13')]);router[_0x9d31('0x14')](_0x9d31('0x6'),auth[_0x9d31('0x3')](),interaction[_0x9d31('0xd')](_0x9d31('0xe'),_0x9d31('0x15')),controller['destroy']);router['delete']('/:id/tags',auth[_0x9d31('0x3')](),controller[_0x9d31('0x16')]);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 6235cf9..928015d 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 _0xd5b1=['DATE','STRING','TEXT','long','BOOLEAN','ENUM','out','INTEGER','sequelize'];(function(_0x1fbad0,_0x347796){var _0x53bcac=function(_0x2ef1d2){while(--_0x2ef1d2){_0x1fbad0['push'](_0x1fbad0['shift']());}};_0x53bcac(++_0x347796);}(_0xd5b1,0x143));var _0x1d5b=function(_0x25f7c7,_0x1e9498){_0x25f7c7=_0x25f7c7-0x0;var _0x1f7ccf=_0xd5b1[_0x25f7c7];return _0x1f7ccf;};'use strict';var Sequelize=require(_0x1d5b('0x0'));var iconv=require('iconv');module['exports']={'closed':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'closedAt':{'type':Sequelize[_0x1d5b('0x1')]},'disposition':{'type':Sequelize[_0x1d5b('0x2')]},'secondDisposition':{'type':Sequelize['STRING']},'thirdDisposition':{'type':Sequelize[_0x1d5b('0x2')]},'note':{'type':Sequelize['STRING']},'inReplyTo':{'type':Sequelize[_0x1d5b('0x2')](0x1fe)},'to':{'type':Sequelize[_0x1d5b('0x2')]},'cc':{'type':Sequelize[_0x1d5b('0x3')](_0x1d5b('0x4'))},'subject':{'type':Sequelize['TEXT']()},'attach':{'type':Sequelize[_0x1d5b('0x5')],'defaultValue':![]},'read1stAt':{'type':Sequelize[_0x1d5b('0x1')]},'substatus':{'type':Sequelize[_0x1d5b('0x2')](0x3c)},'substatusAt':{'type':Sequelize[_0x1d5b('0x1')]},'firstMsgDirection':{'type':Sequelize[_0x1d5b('0x6')]('in',_0x1d5b('0x7')),'defaultValue':'in','allowNull':![]},'lastMsgAt':{'type':Sequelize[_0x1d5b('0x1')]},'lastMsgDirection':{'type':Sequelize['ENUM']('in',_0x1d5b('0x7')),'defaultValue':'in','allowNull':![]},'autoreplyExecuted':{'type':Sequelize[_0x1d5b('0x5')],'defaultValue':![]},'queueId':{'type':Sequelize[_0x1d5b('0x8')]}}; \ No newline at end of file +var _0x68c4=['TEXT','long','BOOLEAN','out','ENUM','INTEGER','sequelize','iconv','exports','DATE','STRING'];(function(_0x5c99d5,_0x41a4ac){var _0x1e6020=function(_0x51d9c9){while(--_0x51d9c9){_0x5c99d5['push'](_0x5c99d5['shift']());}};_0x1e6020(++_0x41a4ac);}(_0x68c4,0xf8));var _0x468c=function(_0x184e69,_0x39af04){_0x184e69=_0x184e69-0x0;var _0x57d8ad=_0x68c4[_0x184e69];return _0x57d8ad;};'use strict';var Sequelize=require(_0x468c('0x0'));var iconv=require(_0x468c('0x1'));module[_0x468c('0x2')]={'closed':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'closedAt':{'type':Sequelize[_0x468c('0x3')]},'disposition':{'type':Sequelize['STRING']},'secondDisposition':{'type':Sequelize['STRING']},'thirdDisposition':{'type':Sequelize[_0x468c('0x4')]},'note':{'type':Sequelize[_0x468c('0x4')]},'inReplyTo':{'type':Sequelize[_0x468c('0x4')](0x1fe)},'to':{'type':Sequelize['STRING']},'cc':{'type':Sequelize[_0x468c('0x5')](_0x468c('0x6'))},'subject':{'type':Sequelize[_0x468c('0x5')]()},'attach':{'type':Sequelize[_0x468c('0x7')],'defaultValue':![]},'read1stAt':{'type':Sequelize['DATE']},'substatus':{'type':Sequelize[_0x468c('0x4')](0x3c)},'substatusAt':{'type':Sequelize[_0x468c('0x3')]},'firstMsgDirection':{'type':Sequelize['ENUM']('in',_0x468c('0x8')),'defaultValue':'in','allowNull':![]},'lastMsgAt':{'type':Sequelize['DATE']},'lastMsgDirection':{'type':Sequelize[_0x468c('0x9')]('in',_0x468c('0x8')),'defaultValue':'in','allowNull':![]},'autoreplyExecuted':{'type':Sequelize[_0x468c('0x7')],'defaultValue':![]},'queueId':{'type':Sequelize[_0x468c('0xa')]}}; \ No newline at end of file diff --git a/server/api/mailInteraction/mailInteraction.controller.js b/server/api/mailInteraction/mailInteraction.controller.js index 8a8e02d..74d369f 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 _0x79ac=['set','Content-Range','update','then','error','stack','name','index','map','MailInteraction','rawAttributes','fieldName','key','findAll','query','user','catch','show','params','model','keys','intersection','fields','attributes','length','include','merge','create','body','destroy','find','describe','addMessage','MailMessage','omit','ids','filters','hasOwnProperty','nolimit','order','sort','where','MailInteractionId','filter','$gte','split','includeAll','inlineCss','true','rows','addTags','setTags','spread','Tag','color','emit','mailInteractionTags:save','removeTags','download','toString','join','root','server','tmp','files','attachments','format','transcript-%d-%s.zip','push','Attachments','Messages','bcc','subject','createdAt','get','mkdirSync','from','missing.recipient@your.company.com','decode','ddd,\x20DD\x20MMM\x20YYYY\x20HH:mm:ss\x20ZZ','headers','Bcc','basename','existsSync','type','writeFileSync','unlinkSync','rimraf','zip-dir','bluebird','util','path','lodash','juice','ioredis','../../components/interaction/service','../../components/parsers/qs','../../config/logger','../../config/environment','html-entities','redis','defaults','localhost','socket.io-emitter','./mailInteraction.socket','sendStatus','end','status','json','undefined','limit','count','offset'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0x79ac,0x139));var _0xc79a=function(_0xab9e4c,_0x33d184){_0xab9e4c=_0xab9e4c-0x0;var _0x4a94c4=_0x79ac[_0xab9e4c];return _0x4a94c4;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xc79a('0x0'));var zipdir=require(_0xc79a('0x1'));var moment=require('moment');var BPromise=require(_0xc79a('0x2'));var util=require(_0xc79a('0x3'));var path=require(_0xc79a('0x4'));var fs=require('fs');var _=require(_0xc79a('0x5'));var juice=require(_0xc79a('0x6'));var Redis=require(_0xc79a('0x7'));var interaction=require(_0xc79a('0x8'));var qs=require(_0xc79a('0x9'));var logger=require(_0xc79a('0xa'))('api');var config=require(_0xc79a('0xb'));var db=require('../../mysqldb')['db'];var htmlEntities=require(_0xc79a('0xc'));config[_0xc79a('0xd')]=_[_0xc79a('0xe')](config[_0xc79a('0xd')],{'host':_0xc79a('0xf'),'port':0x18eb});var socket=require(_0xc79a('0x10'))(new Redis(config[_0xc79a('0xd')]));require(_0xc79a('0x11'))['register'](socket);function respondWithStatusCode(_0x1ce2d7,_0x12b377){_0x12b377=_0x12b377||0xcc;return function(_0x14fae1){if(_0x14fae1){return _0x1ce2d7[_0xc79a('0x12')](_0x12b377);}return _0x1ce2d7['status'](_0x12b377)[_0xc79a('0x13')]();};}function respondWithResult(_0x406ded,_0x56c659){_0x56c659=_0x56c659||0xc8;return function(_0x420329){if(_0x420329){return _0x406ded[_0xc79a('0x14')](_0x56c659)[_0xc79a('0x15')](_0x420329);}};}function respondWithFilteredResult(_0x2f7700,_0x331f9a){return function(_0x175353){if(_0x175353){var _0x555dd3=typeof _0x331f9a['offset']===_0xc79a('0x16')&&typeof _0x331f9a[_0xc79a('0x17')]===_0xc79a('0x16');var _0xe3d495=_0x175353[_0xc79a('0x18')];var _0x30011d=_0x555dd3?0x0:_0x331f9a[_0xc79a('0x19')];var _0x10225a=_0x555dd3?_0x175353['count']:_0x331f9a[_0xc79a('0x19')]+_0x331f9a[_0xc79a('0x17')];var _0x4fd198;if(_0x10225a>=_0xe3d495){_0x10225a=_0xe3d495;_0x4fd198=0xc8;}else{_0x4fd198=0xce;}_0x2f7700[_0xc79a('0x14')](_0x4fd198);return _0x2f7700[_0xc79a('0x1a')](_0xc79a('0x1b'),_0x30011d+'-'+_0x10225a+'/'+_0xe3d495)[_0xc79a('0x15')](_0x175353);}return null;};}function saveUpdates(_0x35781e){return function(_0x57a5be){if(_0x57a5be){return _0x57a5be[_0xc79a('0x1c')](_0x35781e)[_0xc79a('0x1d')](function(_0x449251){return _0x449251;});}return null;};}function removeEntity(_0x3a04ae){return function(_0x31a2d8){if(_0x31a2d8){return _0x31a2d8['destroy']()[_0xc79a('0x1d')](function(){_0x3a04ae[_0xc79a('0x14')](0xcc)['end']();});}};}function handleEntityNotFound(_0x3e8587){return function(_0x4adf80){if(!_0x4adf80){_0x3e8587['sendStatus'](0x194);}return _0x4adf80;};}function handleError(_0x21c4c8,_0x574c4a){_0x574c4a=_0x574c4a||0x1f4;return function(_0x48f194){logger[_0xc79a('0x1e')](_0x48f194[_0xc79a('0x1f')]);if(_0x48f194[_0xc79a('0x20')]){delete _0x48f194[_0xc79a('0x20')];}_0x21c4c8['status'](_0x574c4a)['send'](_0x48f194);};}exports[_0xc79a('0x21')]=function(_0x5e21b8,_0x34c960){var _0x34dc12={};var _0x14efb2=_[_0xc79a('0x22')](db[_0xc79a('0x23')][_0xc79a('0x24')],function(_0x5ee3a1){return{'name':_0x5ee3a1[_0xc79a('0x25')],'type':_0x5ee3a1['type'][_0xc79a('0x26')]};});_0x34dc12=qs['getOptions'](_0x14efb2,_0x5e21b8);return interaction[_0xc79a('0x27')]('mail',_0x5e21b8[_0xc79a('0x28')],_0x5e21b8[_0xc79a('0x29')],_0x34dc12,_0x14efb2)[_0xc79a('0x1d')](respondWithFilteredResult(_0x34c960,_0x34dc12))[_0xc79a('0x2a')](handleError(_0x34c960,null));};exports[_0xc79a('0x2b')]=function(_0x2064cc,_0x5b14f6){var _0x5935b6={'raw':![],'where':{'id':_0x2064cc[_0xc79a('0x2c')]['id']}},_0x5c9952={};_0x5c9952[_0xc79a('0x2d')]=_[_0xc79a('0x2e')](db[_0xc79a('0x23')][_0xc79a('0x24')]);_0x5c9952[_0xc79a('0x28')]=_[_0xc79a('0x2e')](_0x2064cc[_0xc79a('0x28')]);_0x5c9952['filters']=_[_0xc79a('0x2f')](_0x5c9952[_0xc79a('0x2d')],_0x5c9952['query']);_0x5935b6['attributes']=_[_0xc79a('0x2f')](_0x5c9952['model'],qs[_0xc79a('0x30')](_0x2064cc[_0xc79a('0x28')][_0xc79a('0x30')]));_0x5935b6[_0xc79a('0x31')]=_0x5935b6[_0xc79a('0x31')][_0xc79a('0x32')]?_0x5935b6[_0xc79a('0x31')]:_0x5c9952['model'];if(_0x2064cc[_0xc79a('0x28')]['includeAll']){_0x5935b6[_0xc79a('0x33')]=[{'all':!![]}];}_0x5935b6=_[_0xc79a('0x34')]({},_0x5935b6,_0x2064cc['options']);return db[_0xc79a('0x23')]['find'](_0x5935b6)[_0xc79a('0x1d')](handleEntityNotFound(_0x5b14f6,null))[_0xc79a('0x1d')](respondWithResult(_0x5b14f6,null))['catch'](handleError(_0x5b14f6,null));};exports[_0xc79a('0x35')]=function(_0x171888,_0x45f31c){return db[_0xc79a('0x23')]['create'](_0x171888['body'],{})[_0xc79a('0x1d')](respondWithResult(_0x45f31c,0xc9))[_0xc79a('0x2a')](handleError(_0x45f31c,null));};exports[_0xc79a('0x1c')]=function(_0x2450a0,_0x7c943c){if(_0x2450a0[_0xc79a('0x36')]['id']){delete _0x2450a0[_0xc79a('0x36')]['id'];}return db[_0xc79a('0x23')]['find']({'where':{'id':_0x2450a0['params']['id']}})['then'](handleEntityNotFound(_0x7c943c,null))[_0xc79a('0x1d')](saveUpdates(_0x2450a0[_0xc79a('0x36')],null))[_0xc79a('0x1d')](respondWithResult(_0x7c943c,null))[_0xc79a('0x2a')](handleError(_0x7c943c,null));};exports[_0xc79a('0x37')]=function(_0x41b308,_0x29bd6c){return db[_0xc79a('0x23')][_0xc79a('0x38')]({'where':{'id':_0x41b308[_0xc79a('0x2c')]['id']}})[_0xc79a('0x1d')](handleEntityNotFound(_0x29bd6c,null))[_0xc79a('0x1d')](removeEntity(_0x29bd6c,null))['catch'](handleError(_0x29bd6c,null));};exports[_0xc79a('0x39')]=function(_0x536600,_0x4d0788){return db[_0xc79a('0x23')][_0xc79a('0x39')]()[_0xc79a('0x1d')](respondWithResult(_0x4d0788,null))[_0xc79a('0x2a')](handleError(_0x4d0788,null));};exports[_0xc79a('0x3a')]=function(_0x35bc89,_0x2c5413){return db[_0xc79a('0x3b')][_0xc79a('0x38')]({'where':{'id':_0x35bc89[_0xc79a('0x2c')]['id']}})[_0xc79a('0x1d')](handleEntityNotFound(_0x2c5413,null))[_0xc79a('0x1d')](function(_0x2f6ed1){if(_0x2f6ed1){return _0x2f6ed1['addMessage'](_0x35bc89[_0xc79a('0x36')]['ids'],_[_0xc79a('0x3c')](_0x35bc89[_0xc79a('0x36')],[_0xc79a('0x3d'),'id'])||{});}})['then'](respondWithResult(_0x2c5413,null))[_0xc79a('0x2a')](handleError(_0x2c5413,null));};exports['getMessages']=function(_0x1a264f,_0xd5031f){var _0x3f0e01={'raw':![],'where':{}};var _0xd32401={};var _0x3553f8={'count':0x0,'rows':[]};return db[_0xc79a('0x23')]['findOne']({'where':{'id':_0x1a264f[_0xc79a('0x2c')]['id']}})['then'](handleEntityNotFound(_0xd5031f,null))[_0xc79a('0x1d')](function(_0x473c93){if(_0x473c93){_0xd32401['model']=_['keys'](db['MailMessage'][_0xc79a('0x24')]);_0xd32401[_0xc79a('0x28')]=_['keys'](_0x1a264f[_0xc79a('0x28')]);_0xd32401[_0xc79a('0x3e')]=_['intersection'](_0xd32401[_0xc79a('0x2d')],_0xd32401[_0xc79a('0x28')]);_0x3f0e01[_0xc79a('0x31')]=_[_0xc79a('0x2f')](_0xd32401[_0xc79a('0x2d')],qs['fields'](_0x1a264f[_0xc79a('0x28')][_0xc79a('0x30')]));_0x3f0e01['attributes']=_0x3f0e01[_0xc79a('0x31')][_0xc79a('0x32')]?_0x3f0e01[_0xc79a('0x31')]:_0xd32401['model'];if(!_0x1a264f['query'][_0xc79a('0x3f')](_0xc79a('0x40'))){_0x3f0e01['limit']=qs[_0xc79a('0x17')](_0x1a264f[_0xc79a('0x28')][_0xc79a('0x17')]);_0x3f0e01[_0xc79a('0x19')]=qs[_0xc79a('0x19')](_0x1a264f['query'][_0xc79a('0x19')]);}_0x3f0e01[_0xc79a('0x41')]=qs[_0xc79a('0x42')](_0x1a264f[_0xc79a('0x28')][_0xc79a('0x42')]);_0x3f0e01[_0xc79a('0x43')]=qs[_0xc79a('0x3e')](_['pick'](_0x1a264f[_0xc79a('0x28')],_0xd32401['filters']));_0x3f0e01[_0xc79a('0x43')][_0xc79a('0x44')]=_0x473c93['id'];if(_0x1a264f[_0xc79a('0x28')][_0xc79a('0x45')]){_0x3f0e01['where']=_['merge'](_0x3f0e01[_0xc79a('0x43')],{'$or':_[_0xc79a('0x22')](_0x3f0e01[_0xc79a('0x31')],function(_0x2ae084){var _0x366dfd={};_0x366dfd[_0x2ae084]={'$like':'%'+_0x1a264f['query'][_0xc79a('0x45')]+'%'};return _0x366dfd;})});}if(_0x1a264f[_0xc79a('0x28')]['$gte']){var _0x5beee0=_0x1a264f[_0xc79a('0x28')][_0xc79a('0x46')][_0xc79a('0x47')](',');var _0x3a1454={};_0x3a1454[_0x5beee0[0x0]]={'$gte':moment(_0x5beee0[0x1])['format']('YYYY-MM-DD\x20HH:mm:ss')};_0x3f0e01['where']=_[_0xc79a('0x34')](_0x3f0e01[_0xc79a('0x43')],_0x3a1454);}_0x3f0e01=_[_0xc79a('0x34')]({},_0x3f0e01,_0x1a264f['options']);return db[_0xc79a('0x3b')][_0xc79a('0x18')]({'where':_0x3f0e01[_0xc79a('0x43')]})[_0xc79a('0x1d')](function(_0x5a7e27){_0x3553f8['count']=_0x5a7e27;if(_0x1a264f['query'][_0xc79a('0x48')]){_0x3f0e01[_0xc79a('0x33')]=[{'all':!![]}];}return db[_0xc79a('0x3b')][_0xc79a('0x27')](_0x3f0e01);})[_0xc79a('0x1d')](function(_0x1dd05e){if(_0x1a264f['query'][_0xc79a('0x49')]===_0xc79a('0x4a')){for(var _0x2e71f3=0x0;_0x2e71f3<_0x1dd05e[_0xc79a('0x32')];_0x2e71f3++){_0x1dd05e[_0x2e71f3]['body']=juice(_0x1dd05e[_0x2e71f3][_0xc79a('0x36')]);}}_0x3553f8[_0xc79a('0x4b')]=_0x1dd05e;return _0x3553f8;});}})[_0xc79a('0x1d')](respondWithFilteredResult(_0xd5031f,_0x3f0e01))[_0xc79a('0x2a')](handleError(_0xd5031f,null));};exports[_0xc79a('0x4c')]=function(_0x1936d6,_0x129935){return db[_0xc79a('0x23')][_0xc79a('0x38')]({'where':{'id':_0x1936d6[_0xc79a('0x2c')]['id']}})['then'](handleEntityNotFound(_0x129935,null))[_0xc79a('0x1d')](function(_0x2746aa){if(_0x2746aa){return _0x2746aa[_0xc79a('0x4d')](_0x1936d6['body']['ids'],_[_0xc79a('0x3c')](_0x1936d6['body'],[_0xc79a('0x3d'),'id'])||{})[_0xc79a('0x4e')](function(){return db[_0xc79a('0x4f')]['findAll']({'attributes':['id',_0xc79a('0x20'),_0xc79a('0x50')],'where':{'id':_0x1936d6[_0xc79a('0x36')][_0xc79a('0x3d')]}});})[_0xc79a('0x1d')](function(_0x68949d){socket[_0xc79a('0x51')](_0xc79a('0x52'),{'id':Number(_0x1936d6[_0xc79a('0x2c')]['id']),'tags':_0x68949d||[]});return{'id':Number(_0x1936d6[_0xc79a('0x2c')]['id']),'tags':_0x68949d||[]};});}})['then'](respondWithResult(_0x129935,null))['catch'](handleError(_0x129935,null));};exports['removeTags']=function(_0x25687e,_0xa0577a){return db[_0xc79a('0x23')][_0xc79a('0x38')]({'where':{'id':_0x25687e[_0xc79a('0x2c')]['id']}})[_0xc79a('0x1d')](handleEntityNotFound(_0xa0577a,null))['then'](function(_0x57a02e){if(_0x57a02e){return _0x57a02e[_0xc79a('0x53')](_0x25687e[_0xc79a('0x28')][_0xc79a('0x3d')]);}})['then'](respondWithStatusCode(_0xa0577a,null))[_0xc79a('0x2a')](handleError(_0xa0577a,null));};exports[_0xc79a('0x54')]=function(_0x2f9432,_0x1f2044){var _0x5cf89d=moment()['unix']()[_0xc79a('0x55')]();var _0xd72530=path[_0xc79a('0x56')](config[_0xc79a('0x57')],_0xc79a('0x58'),'files',_0xc79a('0x59'));var _0x242471=path['join'](config['root'],'server',_0xc79a('0x5a'),_0xc79a('0x5b'));var _0x2a90ef=path[_0xc79a('0x56')](_0xd72530,_0x5cf89d);var _0x23f519=util[_0xc79a('0x5c')](_0xc79a('0x5d'),_0x2f9432[_0xc79a('0x2c')]['id'],_0x5cf89d);var _0x5ccd25=path['join'](_0xd72530,_0x23f519);var _0x3f256c=[];if(_0x2f9432['query'][_0xc79a('0x5b')]){_0x3f256c[_0xc79a('0x5e')]({'model':db['Attachment'],'as':_0xc79a('0x5f'),'raw':!![]});}var _0x5689f9=[{'model':db[_0xc79a('0x3b')],'as':_0xc79a('0x60'),'attributes':['id','body','from','to','cc',_0xc79a('0x61'),_0xc79a('0x62'),_0xc79a('0x63')],'where':{'secret':![]},'order':qs[_0xc79a('0x42')]('id'),'include':_0x3f256c}];return db[_0xc79a('0x23')][_0xc79a('0x38')]({'where':{'id':_0x2f9432[_0xc79a('0x2c')]['id']},'include':_0x5689f9})[_0xc79a('0x1d')](handleEntityNotFound(_0x1f2044,null))[_0xc79a('0x1d')](function(_0x5818bd){if(_0x5818bd&&_0x5818bd[_0xc79a('0x60')]){var _0x3ac1ae=_0x5818bd[_0xc79a('0x64')]({'plain':!![]});fs[_0xc79a('0x65')](_0x2a90ef);return BPromise['each'](_0x3ac1ae[_0xc79a('0x60')],function(_0x3c2f20,_0x3edf5a){var _0x593672={'from':_0x3c2f20[_0xc79a('0x66')],'to':_0x3c2f20['to']||_0xc79a('0x67'),'subject':_0x3c2f20[_0xc79a('0x62')],'html':htmlEntities[_0xc79a('0x68')](_0x3c2f20[_0xc79a('0x36')]),'headers':{'Date':moment(_0x3c2f20['createdAt'])[_0xc79a('0x5c')](_0xc79a('0x69'))},'attachments':[]};if(_0x3c2f20['cc']){_0x593672['headers']['Cc']=_0x3c2f20['cc'];}if(_0x3c2f20[_0xc79a('0x61')]){_0x593672[_0xc79a('0x6a')][_0xc79a('0x6b')]=_0x3c2f20[_0xc79a('0x61')];}return new BPromise(function(_0x3a2d3f,_0x5b131a){if(_0x3c2f20[_0xc79a('0x5f')]){for(var _0x250f91=0x0;_0x250f91<_0x3c2f20['Attachments'][_0xc79a('0x32')];_0x250f91++){var _0x132df2=_0x3c2f20[_0xc79a('0x5f')][_0x250f91];var _0x1a19f6=path[_0xc79a('0x56')](_0x242471,_0x132df2[_0xc79a('0x6c')]);if(fs[_0xc79a('0x6d')](_0x1a19f6)){_0x593672[_0xc79a('0x5b')]['push']({'name':_0x132df2['name'],'contentType':_0x132df2[_0xc79a('0x6e')],'data':fs['readFileSync'](_0x1a19f6)});}}}emlformat['build'](_0x593672,function(_0x2a9872,_0x2e99cb){if(_0x2a9872)return _0x5b131a(_0x2a9872);fs[_0xc79a('0x6f')](path['join'](_0x2a90ef,util[_0xc79a('0x5c')]('message%d.eml',_0x3edf5a)),_0x2e99cb);return _0x3a2d3f(_0x2e99cb);});});})[_0xc79a('0x1d')](function(){return new BPromise(function(_0x539268,_0x3ba9e1){zipdir(_0x2a90ef,{'saveTo':_0x5ccd25},function(_0x93c902,_0x5ed9ed){if(_0x93c902)return _0x3ba9e1(_0x93c902);return _0x539268(_0x5ed9ed);});})[_0xc79a('0x1d')](function(){return new BPromise(function(_0x1ec195,_0x49c84d){rimraf(_0x2a90ef,function(_0x8b5be6){if(_0x8b5be6)_0x49c84d(_0x8b5be6);return _0x1ec195();});});})[_0xc79a('0x1d')](function(){return _0x1f2044[_0xc79a('0x54')](_0x5ccd25,_0x23f519,function(_0x2753fe){if(!_0x2753fe)fs[_0xc79a('0x70')](_0x5ccd25);});});});}else{return _0x1f2044[_0xc79a('0x12')](0xc8);}})[_0xc79a('0x2a')](handleError(_0x1f2044,null));}; \ No newline at end of file +var _0x1eeb=['intersection','model','attributes','fields','length','includeAll','include','merge','options','find','create','body','describe','addMessage','MailMessage','ids','omit','getMessages','hasOwnProperty','nolimit','order','sort','where','pick','MailInteractionId','filter','split','format','findAll','inlineCss','rows','addTags','spread','Tag','color','emit','mailInteractionTags:save','removeTags','unix','root','server','files','tmp','join','attachments','transcript-%d-%s.zip','push','Attachment','subject','Messages','missing.recipient@your.company.com','decode','createdAt','headers','Bcc','bcc','Attachments','basename','existsSync','readFileSync','build','writeFileSync','unlinkSync','eml-format','rimraf','zip-dir','moment','util','lodash','juice','ioredis','../../components/interaction/service','../../components/parsers/qs','api','../../config/environment','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./mailInteraction.socket','register','sendStatus','end','status','json','offset','limit','undefined','count','set','Content-Range','update','then','destroy','error','stack','name','send','index','map','MailInteraction','fieldName','type','mail','user','catch','show','params','rawAttributes','query','keys','filters'];(function(_0x4df6fb,_0x46e8db){var _0x49fcdb=function(_0x4744a5){while(--_0x4744a5){_0x4df6fb['push'](_0x4df6fb['shift']());}};_0x49fcdb(++_0x46e8db);}(_0x1eeb,0x121));var _0xb1ee=function(_0x183678,_0x3a89fa){_0x183678=_0x183678-0x0;var _0x4816a0=_0x1eeb[_0x183678];return _0x4816a0;};'use strict';var emlformat=require(_0xb1ee('0x0'));var rimraf=require(_0xb1ee('0x1'));var zipdir=require(_0xb1ee('0x2'));var moment=require(_0xb1ee('0x3'));var BPromise=require('bluebird');var util=require(_0xb1ee('0x4'));var path=require('path');var fs=require('fs');var _=require(_0xb1ee('0x5'));var juice=require(_0xb1ee('0x6'));var Redis=require(_0xb1ee('0x7'));var interaction=require(_0xb1ee('0x8'));var qs=require(_0xb1ee('0x9'));var logger=require('../../config/logger')(_0xb1ee('0xa'));var config=require(_0xb1ee('0xb'));var db=require(_0xb1ee('0xc'))['db'];var htmlEntities=require('html-entities');config[_0xb1ee('0xd')]=_[_0xb1ee('0xe')](config[_0xb1ee('0xd')],{'host':_0xb1ee('0xf'),'port':0x18eb});var socket=require(_0xb1ee('0x10'))(new Redis(config['redis']));require(_0xb1ee('0x11'))[_0xb1ee('0x12')](socket);function respondWithStatusCode(_0x56b9fd,_0x4b30b5){_0x4b30b5=_0x4b30b5||0xcc;return function(_0x2da182){if(_0x2da182){return _0x56b9fd[_0xb1ee('0x13')](_0x4b30b5);}return _0x56b9fd['status'](_0x4b30b5)[_0xb1ee('0x14')]();};}function respondWithResult(_0x3a6c58,_0x2ae59a){_0x2ae59a=_0x2ae59a||0xc8;return function(_0x2b3e67){if(_0x2b3e67){return _0x3a6c58[_0xb1ee('0x15')](_0x2ae59a)[_0xb1ee('0x16')](_0x2b3e67);}};}function respondWithFilteredResult(_0x5a775f,_0x4677c2){return function(_0x1e7e8f){if(_0x1e7e8f){var _0x31a1a4=typeof _0x4677c2[_0xb1ee('0x17')]==='undefined'&&typeof _0x4677c2[_0xb1ee('0x18')]===_0xb1ee('0x19');var _0x30d693=_0x1e7e8f['count'];var _0x4bfe52=_0x31a1a4?0x0:_0x4677c2[_0xb1ee('0x17')];var _0x3bc427=_0x31a1a4?_0x1e7e8f[_0xb1ee('0x1a')]:_0x4677c2['offset']+_0x4677c2['limit'];var _0xd27558;if(_0x3bc427>=_0x30d693){_0x3bc427=_0x30d693;_0xd27558=0xc8;}else{_0xd27558=0xce;}_0x5a775f[_0xb1ee('0x15')](_0xd27558);return _0x5a775f[_0xb1ee('0x1b')](_0xb1ee('0x1c'),_0x4bfe52+'-'+_0x3bc427+'/'+_0x30d693)['json'](_0x1e7e8f);}return null;};}function saveUpdates(_0x16a6c5){return function(_0x5657b0){if(_0x5657b0){return _0x5657b0[_0xb1ee('0x1d')](_0x16a6c5)[_0xb1ee('0x1e')](function(_0x57fefb){return _0x57fefb;});}return null;};}function removeEntity(_0x3ebd5f){return function(_0x1f671b){if(_0x1f671b){return _0x1f671b[_0xb1ee('0x1f')]()['then'](function(){_0x3ebd5f[_0xb1ee('0x15')](0xcc)[_0xb1ee('0x14')]();});}};}function handleEntityNotFound(_0x15d7a6){return function(_0x2c0697){if(!_0x2c0697){_0x15d7a6[_0xb1ee('0x13')](0x194);}return _0x2c0697;};}function handleError(_0x30fa0c,_0x5cadc6){_0x5cadc6=_0x5cadc6||0x1f4;return function(_0x388ccb){logger[_0xb1ee('0x20')](_0x388ccb[_0xb1ee('0x21')]);if(_0x388ccb[_0xb1ee('0x22')]){delete _0x388ccb[_0xb1ee('0x22')];}_0x30fa0c[_0xb1ee('0x15')](_0x5cadc6)[_0xb1ee('0x23')](_0x388ccb);};}exports[_0xb1ee('0x24')]=function(_0xae4330,_0x16fae1){var _0x3cc8d4={};var _0x43cea2=_[_0xb1ee('0x25')](db[_0xb1ee('0x26')]['rawAttributes'],function(_0x111ede){return{'name':_0x111ede[_0xb1ee('0x27')],'type':_0x111ede[_0xb1ee('0x28')]['key']};});_0x3cc8d4=qs['getOptions'](_0x43cea2,_0xae4330);return interaction['findAll'](_0xb1ee('0x29'),_0xae4330['query'],_0xae4330[_0xb1ee('0x2a')],_0x3cc8d4,_0x43cea2)[_0xb1ee('0x1e')](respondWithFilteredResult(_0x16fae1,_0x3cc8d4))[_0xb1ee('0x2b')](handleError(_0x16fae1,null));};exports[_0xb1ee('0x2c')]=function(_0x4ac390,_0x5291cc){var _0x5713ae={'raw':![],'where':{'id':_0x4ac390[_0xb1ee('0x2d')]['id']}},_0x206758={};_0x206758['model']=_['keys'](db[_0xb1ee('0x26')][_0xb1ee('0x2e')]);_0x206758[_0xb1ee('0x2f')]=_[_0xb1ee('0x30')](_0x4ac390['query']);_0x206758[_0xb1ee('0x31')]=_[_0xb1ee('0x32')](_0x206758[_0xb1ee('0x33')],_0x206758[_0xb1ee('0x2f')]);_0x5713ae[_0xb1ee('0x34')]=_[_0xb1ee('0x32')](_0x206758[_0xb1ee('0x33')],qs['fields'](_0x4ac390[_0xb1ee('0x2f')][_0xb1ee('0x35')]));_0x5713ae[_0xb1ee('0x34')]=_0x5713ae['attributes'][_0xb1ee('0x36')]?_0x5713ae['attributes']:_0x206758['model'];if(_0x4ac390[_0xb1ee('0x2f')][_0xb1ee('0x37')]){_0x5713ae[_0xb1ee('0x38')]=[{'all':!![]}];}_0x5713ae=_[_0xb1ee('0x39')]({},_0x5713ae,_0x4ac390[_0xb1ee('0x3a')]);return db[_0xb1ee('0x26')][_0xb1ee('0x3b')](_0x5713ae)[_0xb1ee('0x1e')](handleEntityNotFound(_0x5291cc,null))[_0xb1ee('0x1e')](respondWithResult(_0x5291cc,null))[_0xb1ee('0x2b')](handleError(_0x5291cc,null));};exports[_0xb1ee('0x3c')]=function(_0x4a2b55,_0x531c31){return db[_0xb1ee('0x26')][_0xb1ee('0x3c')](_0x4a2b55[_0xb1ee('0x3d')],{})[_0xb1ee('0x1e')](respondWithResult(_0x531c31,0xc9))['catch'](handleError(_0x531c31,null));};exports[_0xb1ee('0x1d')]=function(_0x241bc7,_0x1e1228){if(_0x241bc7[_0xb1ee('0x3d')]['id']){delete _0x241bc7[_0xb1ee('0x3d')]['id'];}return db['MailInteraction'][_0xb1ee('0x3b')]({'where':{'id':_0x241bc7[_0xb1ee('0x2d')]['id']}})[_0xb1ee('0x1e')](handleEntityNotFound(_0x1e1228,null))[_0xb1ee('0x1e')](saveUpdates(_0x241bc7['body'],null))[_0xb1ee('0x1e')](respondWithResult(_0x1e1228,null))[_0xb1ee('0x2b')](handleError(_0x1e1228,null));};exports['destroy']=function(_0x119cfe,_0x247f51){return db[_0xb1ee('0x26')][_0xb1ee('0x3b')]({'where':{'id':_0x119cfe[_0xb1ee('0x2d')]['id']}})[_0xb1ee('0x1e')](handleEntityNotFound(_0x247f51,null))[_0xb1ee('0x1e')](removeEntity(_0x247f51,null))[_0xb1ee('0x2b')](handleError(_0x247f51,null));};exports[_0xb1ee('0x3e')]=function(_0x19ccfc,_0x389a63){return db[_0xb1ee('0x26')]['describe']()[_0xb1ee('0x1e')](respondWithResult(_0x389a63,null))[_0xb1ee('0x2b')](handleError(_0x389a63,null));};exports[_0xb1ee('0x3f')]=function(_0x4c11ce,_0x21b80d){return db[_0xb1ee('0x40')]['find']({'where':{'id':_0x4c11ce[_0xb1ee('0x2d')]['id']}})[_0xb1ee('0x1e')](handleEntityNotFound(_0x21b80d,null))[_0xb1ee('0x1e')](function(_0xfde37){if(_0xfde37){return _0xfde37[_0xb1ee('0x3f')](_0x4c11ce[_0xb1ee('0x3d')][_0xb1ee('0x41')],_[_0xb1ee('0x42')](_0x4c11ce[_0xb1ee('0x3d')],[_0xb1ee('0x41'),'id'])||{});}})[_0xb1ee('0x1e')](respondWithResult(_0x21b80d,null))[_0xb1ee('0x2b')](handleError(_0x21b80d,null));};exports[_0xb1ee('0x43')]=function(_0xa2db38,_0x35be93){var _0x389fa1={'raw':![],'where':{}};var _0x275068={};var _0x43c6a3={'count':0x0,'rows':[]};return db[_0xb1ee('0x26')]['findOne']({'where':{'id':_0xa2db38['params']['id']}})[_0xb1ee('0x1e')](handleEntityNotFound(_0x35be93,null))[_0xb1ee('0x1e')](function(_0x37b91d){if(_0x37b91d){_0x275068[_0xb1ee('0x33')]=_[_0xb1ee('0x30')](db[_0xb1ee('0x40')][_0xb1ee('0x2e')]);_0x275068[_0xb1ee('0x2f')]=_[_0xb1ee('0x30')](_0xa2db38[_0xb1ee('0x2f')]);_0x275068['filters']=_[_0xb1ee('0x32')](_0x275068[_0xb1ee('0x33')],_0x275068[_0xb1ee('0x2f')]);_0x389fa1['attributes']=_[_0xb1ee('0x32')](_0x275068[_0xb1ee('0x33')],qs[_0xb1ee('0x35')](_0xa2db38[_0xb1ee('0x2f')][_0xb1ee('0x35')]));_0x389fa1['attributes']=_0x389fa1[_0xb1ee('0x34')][_0xb1ee('0x36')]?_0x389fa1[_0xb1ee('0x34')]:_0x275068[_0xb1ee('0x33')];if(!_0xa2db38['query'][_0xb1ee('0x44')](_0xb1ee('0x45'))){_0x389fa1['limit']=qs[_0xb1ee('0x18')](_0xa2db38[_0xb1ee('0x2f')][_0xb1ee('0x18')]);_0x389fa1[_0xb1ee('0x17')]=qs[_0xb1ee('0x17')](_0xa2db38['query']['offset']);}_0x389fa1[_0xb1ee('0x46')]=qs[_0xb1ee('0x47')](_0xa2db38['query'][_0xb1ee('0x47')]);_0x389fa1[_0xb1ee('0x48')]=qs[_0xb1ee('0x31')](_[_0xb1ee('0x49')](_0xa2db38[_0xb1ee('0x2f')],_0x275068[_0xb1ee('0x31')]));_0x389fa1[_0xb1ee('0x48')][_0xb1ee('0x4a')]=_0x37b91d['id'];if(_0xa2db38[_0xb1ee('0x2f')][_0xb1ee('0x4b')]){_0x389fa1['where']=_['merge'](_0x389fa1[_0xb1ee('0x48')],{'$or':_['map'](_0x389fa1[_0xb1ee('0x34')],function(_0x179ddd){var _0x2c5cc0={};_0x2c5cc0[_0x179ddd]={'$like':'%'+_0xa2db38[_0xb1ee('0x2f')]['filter']+'%'};return _0x2c5cc0;})});}if(_0xa2db38['query']['$gte']){var _0x4ce018=_0xa2db38[_0xb1ee('0x2f')]['$gte'][_0xb1ee('0x4c')](',');var _0x33356e={};_0x33356e[_0x4ce018[0x0]]={'$gte':moment(_0x4ce018[0x1])[_0xb1ee('0x4d')]('YYYY-MM-DD\x20HH:mm:ss')};_0x389fa1[_0xb1ee('0x48')]=_['merge'](_0x389fa1[_0xb1ee('0x48')],_0x33356e);}_0x389fa1=_[_0xb1ee('0x39')]({},_0x389fa1,_0xa2db38[_0xb1ee('0x3a')]);return db[_0xb1ee('0x40')][_0xb1ee('0x1a')]({'where':_0x389fa1[_0xb1ee('0x48')]})[_0xb1ee('0x1e')](function(_0x5ae9ce){_0x43c6a3[_0xb1ee('0x1a')]=_0x5ae9ce;if(_0xa2db38['query'][_0xb1ee('0x37')]){_0x389fa1[_0xb1ee('0x38')]=[{'all':!![]}];}return db[_0xb1ee('0x40')][_0xb1ee('0x4e')](_0x389fa1);})['then'](function(_0x150178){if(_0xa2db38[_0xb1ee('0x2f')][_0xb1ee('0x4f')]==='true'){for(var _0x35e416=0x0;_0x35e416<_0x150178[_0xb1ee('0x36')];_0x35e416++){_0x150178[_0x35e416][_0xb1ee('0x3d')]=juice(_0x150178[_0x35e416][_0xb1ee('0x3d')]);}}_0x43c6a3[_0xb1ee('0x50')]=_0x150178;return _0x43c6a3;});}})[_0xb1ee('0x1e')](respondWithFilteredResult(_0x35be93,_0x389fa1))[_0xb1ee('0x2b')](handleError(_0x35be93,null));};exports[_0xb1ee('0x51')]=function(_0x2a615c,_0x2c8685){return db['MailInteraction'][_0xb1ee('0x3b')]({'where':{'id':_0x2a615c[_0xb1ee('0x2d')]['id']}})[_0xb1ee('0x1e')](handleEntityNotFound(_0x2c8685,null))[_0xb1ee('0x1e')](function(_0x583060){if(_0x583060){return _0x583060['setTags'](_0x2a615c[_0xb1ee('0x3d')]['ids'],_[_0xb1ee('0x42')](_0x2a615c[_0xb1ee('0x3d')],[_0xb1ee('0x41'),'id'])||{})[_0xb1ee('0x52')](function(){return db[_0xb1ee('0x53')][_0xb1ee('0x4e')]({'attributes':['id',_0xb1ee('0x22'),_0xb1ee('0x54')],'where':{'id':_0x2a615c[_0xb1ee('0x3d')][_0xb1ee('0x41')]}});})[_0xb1ee('0x1e')](function(_0x2ae101){socket[_0xb1ee('0x55')](_0xb1ee('0x56'),{'id':Number(_0x2a615c[_0xb1ee('0x2d')]['id']),'tags':_0x2ae101||[]});return{'id':Number(_0x2a615c[_0xb1ee('0x2d')]['id']),'tags':_0x2ae101||[]};});}})[_0xb1ee('0x1e')](respondWithResult(_0x2c8685,null))[_0xb1ee('0x2b')](handleError(_0x2c8685,null));};exports[_0xb1ee('0x57')]=function(_0xc43708,_0x475d0c){return db[_0xb1ee('0x26')][_0xb1ee('0x3b')]({'where':{'id':_0xc43708['params']['id']}})['then'](handleEntityNotFound(_0x475d0c,null))['then'](function(_0x50bc48){if(_0x50bc48){return _0x50bc48['removeTags'](_0xc43708[_0xb1ee('0x2f')][_0xb1ee('0x41')]);}})['then'](respondWithStatusCode(_0x475d0c,null))['catch'](handleError(_0x475d0c,null));};exports['download']=function(_0x304093,_0x424a67){var _0x198eec=moment()[_0xb1ee('0x58')]()['toString']();var _0x36bc82=path['join'](config[_0xb1ee('0x59')],_0xb1ee('0x5a'),_0xb1ee('0x5b'),_0xb1ee('0x5c'));var _0x2b84e6=path[_0xb1ee('0x5d')](config[_0xb1ee('0x59')],'server',_0xb1ee('0x5b'),_0xb1ee('0x5e'));var _0x214ff1=path[_0xb1ee('0x5d')](_0x36bc82,_0x198eec);var _0xdf782f=util[_0xb1ee('0x4d')](_0xb1ee('0x5f'),_0x304093[_0xb1ee('0x2d')]['id'],_0x198eec);var _0x245e8e=path['join'](_0x36bc82,_0xdf782f);var _0x45e3ca=[];if(_0x304093['query'][_0xb1ee('0x5e')]){_0x45e3ca[_0xb1ee('0x60')]({'model':db[_0xb1ee('0x61')],'as':'Attachments','raw':!![]});}var _0x32408f=[{'model':db['MailMessage'],'as':'Messages','attributes':['id','body','from','to','cc','bcc',_0xb1ee('0x62'),'createdAt'],'where':{'secret':![]},'order':qs[_0xb1ee('0x47')]('id'),'include':_0x45e3ca}];return db['MailInteraction'][_0xb1ee('0x3b')]({'where':{'id':_0x304093[_0xb1ee('0x2d')]['id']},'include':_0x32408f})['then'](handleEntityNotFound(_0x424a67,null))[_0xb1ee('0x1e')](function(_0x301cb8){if(_0x301cb8&&_0x301cb8[_0xb1ee('0x63')]){var _0x5cc212=_0x301cb8['get']({'plain':!![]});fs['mkdirSync'](_0x214ff1);return BPromise['each'](_0x5cc212['Messages'],function(_0x25f420,_0xbbdc7){var _0xb399ee={'from':_0x25f420['from'],'to':_0x25f420['to']||_0xb1ee('0x64'),'subject':_0x25f420[_0xb1ee('0x62')],'html':htmlEntities[_0xb1ee('0x65')](_0x25f420[_0xb1ee('0x3d')]),'headers':{'Date':moment(_0x25f420[_0xb1ee('0x66')])[_0xb1ee('0x4d')]('ddd,\x20DD\x20MMM\x20YYYY\x20HH:mm:ss\x20ZZ')},'attachments':[]};if(_0x25f420['cc']){_0xb399ee[_0xb1ee('0x67')]['Cc']=_0x25f420['cc'];}if(_0x25f420['bcc']){_0xb399ee[_0xb1ee('0x67')][_0xb1ee('0x68')]=_0x25f420[_0xb1ee('0x69')];}return new BPromise(function(_0x75a46c,_0x21e14f){if(_0x25f420[_0xb1ee('0x6a')]){for(var _0x2e8ae1=0x0;_0x2e8ae1<_0x25f420['Attachments'][_0xb1ee('0x36')];_0x2e8ae1++){var _0x1e9b11=_0x25f420[_0xb1ee('0x6a')][_0x2e8ae1];var _0x3b542e=path[_0xb1ee('0x5d')](_0x2b84e6,_0x1e9b11[_0xb1ee('0x6b')]);if(fs[_0xb1ee('0x6c')](_0x3b542e)){_0xb399ee[_0xb1ee('0x5e')][_0xb1ee('0x60')]({'name':_0x1e9b11['name'],'contentType':_0x1e9b11['type'],'data':fs[_0xb1ee('0x6d')](_0x3b542e)});}}}emlformat[_0xb1ee('0x6e')](_0xb399ee,function(_0x40afc2,_0x4a619b){if(_0x40afc2)return _0x21e14f(_0x40afc2);fs[_0xb1ee('0x6f')](path[_0xb1ee('0x5d')](_0x214ff1,util[_0xb1ee('0x4d')]('message%d.eml',_0xbbdc7)),_0x4a619b);return _0x75a46c(_0x4a619b);});});})[_0xb1ee('0x1e')](function(){return new BPromise(function(_0x30bb0d,_0x37e2e6){zipdir(_0x214ff1,{'saveTo':_0x245e8e},function(_0x16bdbf,_0x4162f9){if(_0x16bdbf)return _0x37e2e6(_0x16bdbf);return _0x30bb0d(_0x4162f9);});})[_0xb1ee('0x1e')](function(){return new BPromise(function(_0x651edf,_0x2afe42){rimraf(_0x214ff1,function(_0xc79e2a){if(_0xc79e2a)_0x2afe42(_0xc79e2a);return _0x651edf();});});})[_0xb1ee('0x1e')](function(){return _0x424a67['download'](_0x245e8e,_0xdf782f,function(_0xadeaa6){if(!_0xadeaa6)fs[_0xb1ee('0x70')](_0x245e8e);});});});}else{return _0x424a67[_0xb1ee('0x13')](0xc8);}})[_0xb1ee('0x2b')](handleError(_0x424a67,null));}; \ No newline at end of file diff --git a/server/api/mailInteraction/mailInteraction.events.js b/server/api/mailInteraction/mailInteraction.events.js index a333a91..0f87401 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 _0x2f3a=['../../mysqldb','MailMessage','setMaxListeners','save','update','remove','then','setDataValue','map','findAll','unreadMessages','length','emit','catch','hasOwnProperty','hook','exports','events'];(function(_0x170310,_0x31acf9){var _0x1b6006=function(_0x294e50){while(--_0x294e50){_0x170310['push'](_0x170310['shift']());}};_0x1b6006(++_0x31acf9);}(_0x2f3a,0x7d));var _0xa2f3=function(_0x21c7d8,_0x594e61){_0x21c7d8=_0x21c7d8-0x0;var _0x5c71ab=_0x2f3a[_0x21c7d8];return _0x5c71ab;};'use strict';var EventEmitter=require(_0xa2f3('0x0'));var MailInteraction=require(_0xa2f3('0x1'))['db']['MailInteraction'];var MailMessage=require('../../mysqldb')['db'][_0xa2f3('0x2')];var MailInteractionEvents=new EventEmitter();MailInteractionEvents[_0xa2f3('0x3')](0x0);var events={'afterCreate':_0xa2f3('0x4'),'afterUpdate':_0xa2f3('0x5'),'afterDestroy':_0xa2f3('0x6')};function emitEvent(_0x430a7d){return function(_0x4cf752,_0x5600c4,_0x1c44fb){_0x4cf752['getUsers']({'attributes':['id'],'raw':!![]})[_0xa2f3('0x7')](function(_0x4e94fe){_0x4cf752[_0xa2f3('0x8')]('Users',_0x4e94fe[_0xa2f3('0x9')](function(_0x21c66e){return{'id':_0x21c66e['id']};}));return MailMessage[_0xa2f3('0xa')]({'where':{'MailInteractionId':_0x4cf752['id'],'direction':'in','read':![]},'raw':!![]});})[_0xa2f3('0x7')](function(_0x1dc19e){_0x4cf752[_0xa2f3('0x8')](_0xa2f3('0xb'),_0x1dc19e[_0xa2f3('0xc')]);MailInteractionEvents[_0xa2f3('0xd')](_0x430a7d+':'+_0x4cf752['id'],_0x4cf752);MailInteractionEvents['emit'](_0x430a7d,_0x4cf752);_0x1c44fb(null);})[_0xa2f3('0xe')](_0x1c44fb(null));};}for(var e in events){if(events[_0xa2f3('0xf')](e)){var event=events[e];MailInteraction[_0xa2f3('0x10')](e,emitEvent(event));}}module[_0xa2f3('0x11')]=MailInteractionEvents; \ No newline at end of file +var _0x0a38=['remove','getUsers','then','setDataValue','Users','map','unreadMessages','length','emit','hasOwnProperty','hook','exports','events','MailInteraction','../../mysqldb','save','update'];(function(_0x513ebf,_0x13661e){var _0x29f712=function(_0x321bb2){while(--_0x321bb2){_0x513ebf['push'](_0x513ebf['shift']());}};_0x29f712(++_0x13661e);}(_0x0a38,0x83));var _0x80a3=function(_0xfd34ca,_0x550407){_0xfd34ca=_0xfd34ca-0x0;var _0x1d35c3=_0x0a38[_0xfd34ca];return _0x1d35c3;};'use strict';var EventEmitter=require(_0x80a3('0x0'));var MailInteraction=require('../../mysqldb')['db'][_0x80a3('0x1')];var MailMessage=require(_0x80a3('0x2'))['db']['MailMessage'];var MailInteractionEvents=new EventEmitter();MailInteractionEvents['setMaxListeners'](0x0);var events={'afterCreate':_0x80a3('0x3'),'afterUpdate':_0x80a3('0x4'),'afterDestroy':_0x80a3('0x5')};function emitEvent(_0x30bcf1){return function(_0x31836c,_0x1d99ea,_0x34f2d7){_0x31836c[_0x80a3('0x6')]({'attributes':['id'],'raw':!![]})[_0x80a3('0x7')](function(_0x4f5130){_0x31836c[_0x80a3('0x8')](_0x80a3('0x9'),_0x4f5130[_0x80a3('0xa')](function(_0x2366fd){return{'id':_0x2366fd['id']};}));return MailMessage['findAll']({'where':{'MailInteractionId':_0x31836c['id'],'direction':'in','read':![]},'raw':!![]});})[_0x80a3('0x7')](function(_0x420475){_0x31836c[_0x80a3('0x8')](_0x80a3('0xb'),_0x420475[_0x80a3('0xc')]);MailInteractionEvents[_0x80a3('0xd')](_0x30bcf1+':'+_0x31836c['id'],_0x31836c);MailInteractionEvents[_0x80a3('0xd')](_0x30bcf1,_0x31836c);_0x34f2d7(null);})['catch'](_0x34f2d7(null));};}for(var e in events){if(events[_0x80a3('0xe')](e)){var event=events[e];MailInteraction[_0x80a3('0xf')](e,emitEvent(event));}}module[_0x80a3('0x10')]=MailInteractionEvents; \ No newline at end of file diff --git a/server/api/mailInteraction/mailInteraction.model.js b/server/api/mailInteraction/mailInteraction.model.js index db04ffe..847816d 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 _0x8353=['api','moment','path','../../config/environment','exports','define','mail_interactions','fti_mail_interactions','subject','substatus','format','YYYY-MM-DD\x20HH:mm:ss','closed','changed','substatusAt','models','MailMessage','then','utf8mb4','utf8mb4_unicode_ci','lodash','util','../../config/logger'];(function(_0x359e72,_0x115705){var _0x192750=function(_0x48c528){while(--_0x48c528){_0x359e72['push'](_0x359e72['shift']());}};_0x192750(++_0x115705);}(_0x8353,0xb5));var _0x3835=function(_0x465028,_0x4570ac){_0x465028=_0x465028-0x0;var _0xb783d4=_0x8353[_0x465028];return _0xb783d4;};'use strict';var _=require(_0x3835('0x0'));var util=require(_0x3835('0x1'));var logger=require(_0x3835('0x2'))(_0x3835('0x3'));var moment=require(_0x3835('0x4'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0x3835('0x5'));var rimraf=require('rimraf');var config=require(_0x3835('0x6'));var attributes=require('./mailInteraction.attributes');module[_0x3835('0x7')]=function(_0x5bf290,_0x5db348){return _0x5bf290[_0x3835('0x8')]('MailInteraction',attributes,{'tableName':_0x3835('0x9'),'paranoid':![],'indexes':[{'name':_0x3835('0xa'),'fields':[_0x3835('0xb'),'to'],'type':'FULLTEXT'}],'timestamps':!![],'hooks':{'beforeCreate':function(_0x3133be,_0x938d40,_0x513247){if(_0x3133be[_0x3835('0xc')]){_0x3133be['substatusAt']=moment()[_0x3835('0xd')](_0x3835('0xe'));}if(_0x3133be[_0x3835('0xf')]){_0x3133be['closedAt']=moment()[_0x3835('0xd')](_0x3835('0xe'));}_0x513247(null,_0x938d40);},'beforeUpdate':function(_0x1926f4,_0x339a11,_0x97811c){if(_0x1926f4['changed']('substatus')){_0x1926f4['substatusAt']=_0x1926f4[_0x3835('0xc')]?moment()[_0x3835('0xd')](_0x3835('0xe')):null;}if(_0x1926f4[_0x3835('0x10')](_0x3835('0xf'))){_0x1926f4['closedAt']=moment()['format'](_0x3835('0xe'));_0x1926f4[_0x3835('0xc')]=null;_0x1926f4[_0x3835('0x11')]=null;}_0x97811c(null,_0x1926f4);},'afterUpdate':function(_0xad04c8,_0x2b607f,_0x483e3d){var _0x258727=_0x5bf290[_0x3835('0x12')];var _0x24b4ea=_0xad04c8['get']({'plain':!![]});if(_0x24b4ea[_0x3835('0xf')]){return _0x258727[_0x3835('0x13')]['update']({'read':!![]},{'where':{'MailInteractionId':_0x24b4ea['id']}})[_0x3835('0x14')](function(){_0x483e3d();})['catch'](function(_0x7d3885){_0x483e3d(_0x7d3885);});}else{_0x483e3d();}}},'charset':_0x3835('0x15'),'collate':_0x3835('0x16')});}; \ No newline at end of file +var _0xc992=['closedAt','MailMessage','update','then','catch','utf8mb4','utf8mb4_unicode_ci','util','moment','bluebird','path','rimraf','../../config/environment','exports','define','MailInteraction','mail_interactions','subject','FULLTEXT','substatus','substatusAt','format','YYYY-MM-DD\x20HH:mm:ss','closed'];(function(_0x22a703,_0x311f8a){var _0x4e6ff5=function(_0xf20ae0){while(--_0xf20ae0){_0x22a703['push'](_0x22a703['shift']());}};_0x4e6ff5(++_0x311f8a);}(_0xc992,0x13f));var _0x2c99=function(_0x18908a,_0x586a0b){_0x18908a=_0x18908a-0x0;var _0x1ce145=_0xc992[_0x18908a];return _0x1ce145;};'use strict';var _=require('lodash');var util=require(_0x2c99('0x0'));var logger=require('../../config/logger')('api');var moment=require(_0x2c99('0x1'));var BPromise=require(_0x2c99('0x2'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x2c99('0x3'));var rimraf=require(_0x2c99('0x4'));var config=require(_0x2c99('0x5'));var attributes=require('./mailInteraction.attributes');module[_0x2c99('0x6')]=function(_0x5d00ef,_0x103965){return _0x5d00ef[_0x2c99('0x7')](_0x2c99('0x8'),attributes,{'tableName':_0x2c99('0x9'),'paranoid':![],'indexes':[{'name':'fti_mail_interactions','fields':[_0x2c99('0xa'),'to'],'type':_0x2c99('0xb')}],'timestamps':!![],'hooks':{'beforeCreate':function(_0x17f1b4,_0x521df4,_0x19b477){if(_0x17f1b4[_0x2c99('0xc')]){_0x17f1b4[_0x2c99('0xd')]=moment()[_0x2c99('0xe')](_0x2c99('0xf'));}if(_0x17f1b4[_0x2c99('0x10')]){_0x17f1b4['closedAt']=moment()[_0x2c99('0xe')](_0x2c99('0xf'));}_0x19b477(null,_0x521df4);},'beforeUpdate':function(_0x5db234,_0x3b5531,_0x727538){if(_0x5db234['changed'](_0x2c99('0xc'))){_0x5db234[_0x2c99('0xd')]=_0x5db234[_0x2c99('0xc')]?moment()['format'](_0x2c99('0xf')):null;}if(_0x5db234['changed'](_0x2c99('0x10'))){_0x5db234[_0x2c99('0x11')]=moment()[_0x2c99('0xe')]('YYYY-MM-DD\x20HH:mm:ss');_0x5db234[_0x2c99('0xc')]=null;_0x5db234['substatusAt']=null;}_0x727538(null,_0x5db234);},'afterUpdate':function(_0x11a9b6,_0x5b91fa,_0x411e27){var _0x5c6aae=_0x5d00ef['models'];var _0x4846df=_0x11a9b6['get']({'plain':!![]});if(_0x4846df['closed']){return _0x5c6aae[_0x2c99('0x12')][_0x2c99('0x13')]({'read':!![]},{'where':{'MailInteractionId':_0x4846df['id']}})[_0x2c99('0x14')](function(){_0x411e27();})[_0x2c99('0x15')](function(_0x5ee23a){_0x411e27(_0x5ee23a);});}else{_0x411e27();}}},'charset':_0x2c99('0x16'),'collate':_0x2c99('0x17')});}; \ No newline at end of file diff --git a/server/api/mailInteraction/mailInteraction.rpc.js b/server/api/mailInteraction/mailInteraction.rpc.js index ea22cde..eb47e6e 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 _0xef96=['UpdateMailInteraction','update','body','options','raw','attributes','limit','AddTagsToMailInteraction','addTags','ids','omit','AddTags','lodash','util','moment','bluebird','randomstring','ioredis','../../config/logger','jayson/promise','client','http','defaults','localhost','socket.io-emitter','redis','register','request','then','info','request\x20sent','debug','MailInteraction,\x20%s,\x20%s,\x20%s','stringify','error','MailInteraction,\x20%s,\x20%s','message','catch'];(function(_0x168bee,_0x3e9972){var _0xdaf476=function(_0x451aa5){while(--_0x451aa5){_0x168bee['push'](_0x168bee['shift']());}};_0xdaf476(++_0x3e9972);}(_0xef96,0x162));var _0x6ef9=function(_0x4b4401,_0x71b9ed){_0x4b4401=_0x4b4401-0x0;var _0x143545=_0xef96[_0x4b4401];return _0x143545;};'use strict';var _=require(_0x6ef9('0x0'));var util=require(_0x6ef9('0x1'));var moment=require(_0x6ef9('0x2'));var BPromise=require(_0x6ef9('0x3'));var rs=require(_0x6ef9('0x4'));var fs=require('fs');var Redis=require(_0x6ef9('0x5'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0x6ef9('0x6'))('rpc');var config=require('../../config/environment');var jayson=require(_0x6ef9('0x7'));var client=jayson[_0x6ef9('0x8')][_0x6ef9('0x9')]({'port':0x232a});config['redis']=_[_0x6ef9('0xa')](config['redis'],{'host':_0x6ef9('0xb'),'port':0x18eb});var socket=require(_0x6ef9('0xc'))(new Redis(config[_0x6ef9('0xd')]));require('./mailInteraction.socket')[_0x6ef9('0xe')](socket);function respondWithRpcPromise(_0x4ccb23,_0xb9346c,_0x418b1d){return new BPromise(function(_0x46734b,_0x5aee3b){return client[_0x6ef9('0xf')](_0x4ccb23,_0x418b1d)[_0x6ef9('0x10')](function(_0xcee555){logger[_0x6ef9('0x11')]('MailInteraction,\x20%s,\x20%s',_0xb9346c,_0x6ef9('0x12'));logger[_0x6ef9('0x13')](_0x6ef9('0x14'),_0xb9346c,_0x6ef9('0x12'),JSON[_0x6ef9('0x15')](_0xcee555));if(_0xcee555[_0x6ef9('0x16')]){if(_0xcee555[_0x6ef9('0x16')]['code']===0x1f4){logger[_0x6ef9('0x16')](_0x6ef9('0x17'),_0xb9346c,_0xcee555[_0x6ef9('0x16')][_0x6ef9('0x18')]);return _0x5aee3b(_0xcee555[_0x6ef9('0x16')][_0x6ef9('0x18')]);}logger[_0x6ef9('0x16')](_0x6ef9('0x17'),_0xb9346c,_0xcee555[_0x6ef9('0x16')]['message']);return _0x46734b(_0xcee555[_0x6ef9('0x16')][_0x6ef9('0x18')]);}else{logger['info']('MailInteraction,\x20%s,\x20%s',_0xb9346c,_0x6ef9('0x12'));_0x46734b(_0xcee555['result'][_0x6ef9('0x18')]);}})[_0x6ef9('0x19')](function(_0x9b792d){logger[_0x6ef9('0x16')](_0x6ef9('0x17'),_0xb9346c,_0x9b792d);_0x5aee3b(_0x9b792d);});});}exports[_0x6ef9('0x1a')]=function(_0x493cdd){var _0x56fabb=this;return new Promise(function(_0x1ac999,_0x243de4){return db['MailInteraction'][_0x6ef9('0x1b')](_0x493cdd[_0x6ef9('0x1c')],{'raw':_0x493cdd[_0x6ef9('0x1d')]?_0x493cdd[_0x6ef9('0x1d')][_0x6ef9('0x1e')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x493cdd[_0x6ef9('0x1d')]?_0x493cdd[_0x6ef9('0x1d')]['where']||null:null,'attributes':_0x493cdd['options']?_0x493cdd[_0x6ef9('0x1d')][_0x6ef9('0x1f')]||null:null,'limit':_0x493cdd['options']?_0x493cdd['options'][_0x6ef9('0x20')]||null:null})['then'](function(_0x19a6c5){logger[_0x6ef9('0x11')](_0x6ef9('0x1a'),_0x493cdd);logger[_0x6ef9('0x13')](_0x6ef9('0x1a'),_0x493cdd,JSON[_0x6ef9('0x15')](_0x19a6c5));_0x1ac999(_0x19a6c5);})[_0x6ef9('0x19')](function(_0x4f6c85){logger[_0x6ef9('0x16')]('UpdateMailInteraction',_0x4f6c85[_0x6ef9('0x18')],_0x493cdd);_0x243de4(_0x56fabb[_0x6ef9('0x16')](0x1f4,_0x4f6c85[_0x6ef9('0x18')]));});});};exports[_0x6ef9('0x21')]=function(_0x351dce){return new Promise(function(_0x205b74,_0x212d32){return db['MailInteraction']['find']({'where':_0x351dce['options']?_0x351dce['options']['where']||null:null})[_0x6ef9('0x10')](function(_0x4fa37c){if(_0x4fa37c){return _0x4fa37c[_0x6ef9('0x22')](_0x351dce['body'][_0x6ef9('0x23')],_[_0x6ef9('0x24')](_0x351dce[_0x6ef9('0x1c')],[_0x6ef9('0x23'),'id'])||{});}})['spread'](function(_0x545bad){logger[_0x6ef9('0x11')](_0x6ef9('0x25'),_0x351dce);logger['debug'](_0x6ef9('0x25'),_0x351dce,JSON['stringify'](_0x545bad));_0x205b74(_0x545bad);})[_0x6ef9('0x19')](function(_0x20bde7){logger[_0x6ef9('0x16')]('AddTags',_0x20bde7[_0x6ef9('0x18')],_0x351dce);_0x212d32(_this[_0x6ef9('0x16')](0x1f4,_0x20bde7['message']));});});}; \ No newline at end of file +var _0xd050=['lodash','util','moment','bluebird','randomstring','../../config/logger','rpc','client','http','redis','defaults','localhost','./mailInteraction.socket','register','request','then','request\x20sent','debug','MailInteraction,\x20%s,\x20%s,\x20%s','stringify','error','MailInteraction,\x20%s,\x20%s','message','result','catch','UpdateMailInteraction','update','body','options','raw','where','attributes','limit','info','AddTagsToMailInteraction','find','addTags','ids','omit','spread','AddTags'];(function(_0x2be8c8,_0x2c82a1){var _0x83965d=function(_0x557337){while(--_0x557337){_0x2be8c8['push'](_0x2be8c8['shift']());}};_0x83965d(++_0x2c82a1);}(_0xd050,0x11f));var _0x0d05=function(_0x5f513d,_0x5745b8){_0x5f513d=_0x5f513d-0x0;var _0x596b14=_0xd050[_0x5f513d];return _0x596b14;};'use strict';var _=require(_0x0d05('0x0'));var util=require(_0x0d05('0x1'));var moment=require(_0x0d05('0x2'));var BPromise=require(_0x0d05('0x3'));var rs=require(_0x0d05('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0x0d05('0x5'))(_0x0d05('0x6'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x0d05('0x7')][_0x0d05('0x8')]({'port':0x232a});config[_0x0d05('0x9')]=_[_0x0d05('0xa')](config[_0x0d05('0x9')],{'host':_0x0d05('0xb'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x0d05('0x9')]));require(_0x0d05('0xc'))[_0x0d05('0xd')](socket);function respondWithRpcPromise(_0x31dcd7,_0x1493ad,_0x507ff8){return new BPromise(function(_0x359b1d,_0x5134e6){return client[_0x0d05('0xe')](_0x31dcd7,_0x507ff8)[_0x0d05('0xf')](function(_0x54598d){logger['info']('MailInteraction,\x20%s,\x20%s',_0x1493ad,_0x0d05('0x10'));logger[_0x0d05('0x11')](_0x0d05('0x12'),_0x1493ad,_0x0d05('0x10'),JSON[_0x0d05('0x13')](_0x54598d));if(_0x54598d[_0x0d05('0x14')]){if(_0x54598d['error']['code']===0x1f4){logger[_0x0d05('0x14')](_0x0d05('0x15'),_0x1493ad,_0x54598d['error'][_0x0d05('0x16')]);return _0x5134e6(_0x54598d[_0x0d05('0x14')][_0x0d05('0x16')]);}logger[_0x0d05('0x14')]('MailInteraction,\x20%s,\x20%s',_0x1493ad,_0x54598d[_0x0d05('0x14')]['message']);return _0x359b1d(_0x54598d[_0x0d05('0x14')][_0x0d05('0x16')]);}else{logger['info'](_0x0d05('0x15'),_0x1493ad,_0x0d05('0x10'));_0x359b1d(_0x54598d[_0x0d05('0x17')]['message']);}})[_0x0d05('0x18')](function(_0x23a6b5){logger[_0x0d05('0x14')](_0x0d05('0x15'),_0x1493ad,_0x23a6b5);_0x5134e6(_0x23a6b5);});});}exports[_0x0d05('0x19')]=function(_0x16bf0e){var _0x16dd12=this;return new Promise(function(_0x43ffb4,_0x39efaa){return db['MailInteraction'][_0x0d05('0x1a')](_0x16bf0e[_0x0d05('0x1b')],{'raw':_0x16bf0e[_0x0d05('0x1c')]?_0x16bf0e['options'][_0x0d05('0x1d')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x16bf0e['options']?_0x16bf0e[_0x0d05('0x1c')][_0x0d05('0x1e')]||null:null,'attributes':_0x16bf0e[_0x0d05('0x1c')]?_0x16bf0e[_0x0d05('0x1c')][_0x0d05('0x1f')]||null:null,'limit':_0x16bf0e[_0x0d05('0x1c')]?_0x16bf0e['options'][_0x0d05('0x20')]||null:null})[_0x0d05('0xf')](function(_0x3fe923){logger[_0x0d05('0x21')](_0x0d05('0x19'),_0x16bf0e);logger[_0x0d05('0x11')]('UpdateMailInteraction',_0x16bf0e,JSON[_0x0d05('0x13')](_0x3fe923));_0x43ffb4(_0x3fe923);})[_0x0d05('0x18')](function(_0x4bda71){logger[_0x0d05('0x14')]('UpdateMailInteraction',_0x4bda71[_0x0d05('0x16')],_0x16bf0e);_0x39efaa(_0x16dd12[_0x0d05('0x14')](0x1f4,_0x4bda71[_0x0d05('0x16')]));});});};exports[_0x0d05('0x22')]=function(_0x5ddcff){return new Promise(function(_0x4d8995,_0x25f994){return db['MailInteraction'][_0x0d05('0x23')]({'where':_0x5ddcff[_0x0d05('0x1c')]?_0x5ddcff[_0x0d05('0x1c')][_0x0d05('0x1e')]||null:null})[_0x0d05('0xf')](function(_0x493634){if(_0x493634){return _0x493634[_0x0d05('0x24')](_0x5ddcff[_0x0d05('0x1b')][_0x0d05('0x25')],_[_0x0d05('0x26')](_0x5ddcff[_0x0d05('0x1b')],[_0x0d05('0x25'),'id'])||{});}})[_0x0d05('0x27')](function(_0xd7c0f){logger['info'](_0x0d05('0x28'),_0x5ddcff);logger[_0x0d05('0x11')]('AddTags',_0x5ddcff,JSON[_0x0d05('0x13')](_0xd7c0f));_0x4d8995(_0xd7c0f);})[_0x0d05('0x18')](function(_0x10cc1e){logger['error']('AddTags',_0x10cc1e[_0x0d05('0x16')],_0x5ddcff);_0x25f994(_this[_0x0d05('0x14')](0x1f4,_0x10cc1e[_0x0d05('0x16')]));});});}; \ No newline at end of file diff --git a/server/api/mailInteraction/mailInteraction.socket.js b/server/api/mailInteraction/mailInteraction.socket.js index b1746fb..17b7c95 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 _0xc615=['save','remove','update','emit','removeListener','register','length','mailInteraction:'];(function(_0x1dd8a4,_0x57f9a){var _0x13fb51=function(_0x2d86d9){while(--_0x2d86d9){_0x1dd8a4['push'](_0x1dd8a4['shift']());}};_0x13fb51(++_0x57f9a);}(_0xc615,0x1a0));var _0x5c61=function(_0x40597a,_0x30410d){_0x40597a=_0x40597a-0x0;var _0x423296=_0xc615[_0x40597a];return _0x423296;};'use strict';var MailInteractionEvents=require('./mailInteraction.events');var events=[_0x5c61('0x0'),_0x5c61('0x1'),_0x5c61('0x2')];function createListener(_0x263d4d,_0x2e43fe){return function(_0x34068c){_0x2e43fe[_0x5c61('0x3')](_0x263d4d,_0x34068c);};}function removeListener(_0x266625,_0x58b030){return function(){MailInteractionEvents[_0x5c61('0x4')](_0x266625,_0x58b030);};}exports[_0x5c61('0x5')]=function(_0x36353e){for(var _0xbcc2a8=0x0,_0x7cf506=events[_0x5c61('0x6')];_0xbcc2a8<_0x7cf506;_0xbcc2a8++){var _0x104e13=events[_0xbcc2a8];var _0x66a627=createListener(_0x5c61('0x7')+_0x104e13,_0x36353e);MailInteractionEvents['on'](_0x104e13,_0x66a627);}}; \ No newline at end of file +var _0x45d8=['./mailInteraction.events','save','remove','update','emit','removeListener','mailInteraction:'];(function(_0x245e2d,_0x1515a6){var _0x2d1b6f=function(_0xd5b890){while(--_0xd5b890){_0x245e2d['push'](_0x245e2d['shift']());}};_0x2d1b6f(++_0x1515a6);}(_0x45d8,0xfc));var _0x845d=function(_0x4685e4,_0x51031f){_0x4685e4=_0x4685e4-0x0;var _0x5abd59=_0x45d8[_0x4685e4];return _0x5abd59;};'use strict';var MailInteractionEvents=require(_0x845d('0x0'));var events=[_0x845d('0x1'),_0x845d('0x2'),_0x845d('0x3')];function createListener(_0x3859f3,_0x2f651d){return function(_0x1c8977){_0x2f651d[_0x845d('0x4')](_0x3859f3,_0x1c8977);};}function removeListener(_0x5ba6f0,_0x40013d){return function(){MailInteractionEvents[_0x845d('0x5')](_0x5ba6f0,_0x40013d);};}exports['register']=function(_0x1ca8dd){for(var _0x2c2b0a=0x0,_0x41f5e0=events['length'];_0x2c2b0a<_0x41f5e0;_0x2c2b0a++){var _0x18b1ce=events[_0x2c2b0a];var _0x6160a4=createListener(_0x845d('0x6')+_0x18b1ce,_0x1ca8dd);MailInteractionEvents['on'](_0x18b1ce,_0x6160a4);}}; \ No newline at end of file diff --git a/server/api/mailMessage/index.js b/server/api/mailMessage/index.js index d634d04..643845f 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 _0xadb4=['/:id/accept','accept','/:id/reject','reject','delete','exports','multer','util','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../config/environment','./mailMessage.controller','get','isAuthenticated','/describe','describe','/:id','show','download','post','tracked','mail','create','put'];(function(_0x446027,_0x4366cf){var _0x59cc01=function(_0x4a1f49){while(--_0x4a1f49){_0x446027['push'](_0x446027['shift']());}};_0x59cc01(++_0x4366cf);}(_0xadb4,0x1b6));var _0x4adb=function(_0x2d4709,_0x58e9e4){_0x2d4709=_0x2d4709-0x0;var _0x3f7d4a=_0xadb4[_0x2d4709];return _0x3f7d4a;};'use strict';var multer=require(_0x4adb('0x0'));var util=require(_0x4adb('0x1'));var path=require('path');var timeout=require(_0x4adb('0x2'));var express=require(_0x4adb('0x3'));var router=express[_0x4adb('0x4')]();var fs_extra=require(_0x4adb('0x5'));var auth=require(_0x4adb('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0x4adb('0x7'));var controller=require(_0x4adb('0x8'));router[_0x4adb('0x9')]('/',auth[_0x4adb('0xa')](),controller['index']);router[_0x4adb('0x9')](_0x4adb('0xb'),auth[_0x4adb('0xa')](),controller[_0x4adb('0xc')]);router[_0x4adb('0x9')](_0x4adb('0xd'),auth['isAuthenticated'](),controller[_0x4adb('0xe')]);router[_0x4adb('0x9')]('/:id/download',auth['isAuthenticated'](),controller[_0x4adb('0xf')]);router[_0x4adb('0x10')]('/',auth[_0x4adb('0xa')](),interaction[_0x4adb('0x11')](_0x4adb('0x12'),'mailmessage:create'),controller[_0x4adb('0x13')]);router[_0x4adb('0x14')](_0x4adb('0xd'),auth[_0x4adb('0xa')](),controller['update']);router[_0x4adb('0x14')](_0x4adb('0x15'),auth[_0x4adb('0xa')](),controller[_0x4adb('0x16')]);router['put'](_0x4adb('0x17'),auth[_0x4adb('0xa')](),controller[_0x4adb('0x18')]);router[_0x4adb('0x19')]('/:id',auth[_0x4adb('0xa')](),controller['destroy']);module[_0x4adb('0x1a')]=router; \ No newline at end of file +var _0x6be1=['../../config/environment','./mailMessage.controller','get','isAuthenticated','index','/describe','describe','/:id','show','/:id/download','download','post','tracked','mail','mailmessage:create','create','put','update','/:id/accept','/:id/reject','reject','destroy','exports','multer','util','fs-extra','../../components/auth/service','../../components/interaction/service'];(function(_0x2b4b9a,_0x14dcef){var _0x5be43b=function(_0x164db9){while(--_0x164db9){_0x2b4b9a['push'](_0x2b4b9a['shift']());}};_0x5be43b(++_0x14dcef);}(_0x6be1,0x12f));var _0x16be=function(_0x3d28b7,_0x6ae858){_0x3d28b7=_0x3d28b7-0x0;var _0x17a0e4=_0x6be1[_0x3d28b7];return _0x17a0e4;};'use strict';var multer=require(_0x16be('0x0'));var util=require(_0x16be('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require('express');var router=express['Router']();var fs_extra=require(_0x16be('0x2'));var auth=require(_0x16be('0x3'));var interaction=require(_0x16be('0x4'));var config=require(_0x16be('0x5'));var controller=require(_0x16be('0x6'));router[_0x16be('0x7')]('/',auth[_0x16be('0x8')](),controller[_0x16be('0x9')]);router[_0x16be('0x7')](_0x16be('0xa'),auth['isAuthenticated'](),controller[_0x16be('0xb')]);router[_0x16be('0x7')](_0x16be('0xc'),auth[_0x16be('0x8')](),controller[_0x16be('0xd')]);router[_0x16be('0x7')](_0x16be('0xe'),auth[_0x16be('0x8')](),controller[_0x16be('0xf')]);router[_0x16be('0x10')]('/',auth[_0x16be('0x8')](),interaction[_0x16be('0x11')](_0x16be('0x12'),_0x16be('0x13')),controller[_0x16be('0x14')]);router[_0x16be('0x15')]('/:id',auth[_0x16be('0x8')](),controller[_0x16be('0x16')]);router[_0x16be('0x15')](_0x16be('0x17'),auth[_0x16be('0x8')](),controller['accept']);router[_0x16be('0x15')](_0x16be('0x18'),auth['isAuthenticated'](),controller[_0x16be('0x19')]);router['delete']('/:id',auth['isAuthenticated'](),controller[_0x16be('0x1a')]);module[_0x16be('0x1b')]=router; \ No newline at end of file diff --git a/server/api/mailMessage/mailMessage.attributes.js b/server/api/mailMessage/mailMessage.attributes.js index eb18851..a74b2a1 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 _0xdbff=['Chat','lodash','exports','TEXT','ENUM','out','STRING','long','DATE','INTEGER','BOOLEAN','Email'];(function(_0x516510,_0x48f18a){var _0x5c5246=function(_0x3ea365){while(--_0x3ea365){_0x516510['push'](_0x516510['shift']());}};_0x5c5246(++_0x48f18a);}(_0xdbff,0x151));var _0xfdbf=function(_0x4bb145,_0x3e7d33){_0x4bb145=_0x4bb145-0x0;var _0x4db596=_0xdbff[_0x4bb145];return _0x4db596;};'use strict';var Sequelize=require('sequelize');var _=require(_0xfdbf('0x0'));module[_0xfdbf('0x1')]={'body':{'type':Sequelize[_0xfdbf('0x2')]('long'),'allowNull':![]},'plainBody':{'type':Sequelize[_0xfdbf('0x2')]('medium')},'read':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'direction':{'type':Sequelize[_0xfdbf('0x3')]('in','out'),'defaultValue':_0xfdbf('0x4'),'allowNull':![]},'messageId':{'type':Sequelize[_0xfdbf('0x5')](0x1fe)},'from':{'type':Sequelize['STRING']},'to':{'type':Sequelize[_0xfdbf('0x2')]('long')},'cc':{'type':Sequelize[_0xfdbf('0x2')](_0xfdbf('0x6'))},'bcc':{'type':Sequelize[_0xfdbf('0x2')]('long')},'subject':{'type':Sequelize[_0xfdbf('0x2')]},'sentAt':{'type':Sequelize[_0xfdbf('0x7')]},'attach':{'type':Sequelize[_0xfdbf('0x8')],'defaultValue':0x0},'secret':{'type':Sequelize[_0xfdbf('0x9')],'defaultValue':![]},'readAt':{'type':Sequelize[_0xfdbf('0x7')]},'originTo':{'type':Sequelize[_0xfdbf('0x2')](_0xfdbf('0x6'))},'originCc':{'type':Sequelize['TEXT'](_0xfdbf('0x6'))},'originChannel':{'type':Sequelize[_0xfdbf('0x3')](_0xfdbf('0xa'),_0xfdbf('0xb')),'defaultValue':_0xfdbf('0xa'),'allowNull':![]}}; \ No newline at end of file +var _0x50a0=['DATE','INTEGER','Chat','Email','sequelize','lodash','exports','TEXT','long','medium','BOOLEAN','ENUM','out','STRING'];(function(_0x18ab2a,_0x4debcd){var _0x16dcee=function(_0x10107a){while(--_0x10107a){_0x18ab2a['push'](_0x18ab2a['shift']());}};_0x16dcee(++_0x4debcd);}(_0x50a0,0xe4));var _0x050a=function(_0x337d1d,_0x2abd41){_0x337d1d=_0x337d1d-0x0;var _0x271e67=_0x50a0[_0x337d1d];return _0x271e67;};'use strict';var Sequelize=require(_0x050a('0x0'));var _=require(_0x050a('0x1'));module[_0x050a('0x2')]={'body':{'type':Sequelize[_0x050a('0x3')](_0x050a('0x4')),'allowNull':![]},'plainBody':{'type':Sequelize[_0x050a('0x3')](_0x050a('0x5'))},'read':{'type':Sequelize[_0x050a('0x6')],'defaultValue':![]},'direction':{'type':Sequelize[_0x050a('0x7')]('in','out'),'defaultValue':_0x050a('0x8'),'allowNull':![]},'messageId':{'type':Sequelize[_0x050a('0x9')](0x1fe)},'from':{'type':Sequelize[_0x050a('0x9')]},'to':{'type':Sequelize[_0x050a('0x3')](_0x050a('0x4'))},'cc':{'type':Sequelize['TEXT'](_0x050a('0x4'))},'bcc':{'type':Sequelize[_0x050a('0x3')](_0x050a('0x4'))},'subject':{'type':Sequelize[_0x050a('0x3')]},'sentAt':{'type':Sequelize[_0x050a('0xa')]},'attach':{'type':Sequelize[_0x050a('0xb')],'defaultValue':0x0},'secret':{'type':Sequelize[_0x050a('0x6')],'defaultValue':![]},'readAt':{'type':Sequelize[_0x050a('0xa')]},'originTo':{'type':Sequelize[_0x050a('0x3')](_0x050a('0x4'))},'originCc':{'type':Sequelize[_0x050a('0x3')]('long')},'originChannel':{'type':Sequelize['ENUM']('Email',_0x050a('0xc')),'defaultValue':_0x050a('0xd'),'allowNull':![]}}; \ No newline at end of file diff --git a/server/api/mailMessage/mailMessage.controller.js b/server/api/mailMessage/mailMessage.controller.js index f57d4c8..a915de5 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 _0x8057=['motionChannel','event','accept','fromString','EventManager','reject','[MAILMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','null','RejectMessage','download','unix','server','files','tmp','message-%s.eml','from','subject','Attachment','Attachments','decode','ddd,\x20DD\x20MMM\x20YYYY\x20HH:mm:ss\x20ZZ','headers','bcc','existsSync','readFileSync','build','writeFileSync','unlinkSync','eml-format','moment','path','lodash','ioredis','html-to-text','../../components/parsers/qs','../../config/logger','api','mail-interactions','../../config/environment','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./mailMessage.socket','register','jayson/promise','http','client','then','info','MailMessage,\x20%s,\x20%s','request\x20sent','debug','MailMessage,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','status','json','offset','undefined','limit','count','set','Content-Range','update','destroy','end','sendStatus','stack','name','send','index','map','MailMessage','rawAttributes','fieldName','type','key','query','keys','filters','intersection','model','fields','attributes','length','hasOwnProperty','nolimit','order','pick','filter','merge','VIRTUAL','options','where','includeAll','findAll','rows','show','include','find','body','params','describe','create','direction','out','secret','split','MailAccount','findOne','MailAccountId','CmContact','Contacts','DESC','MailServerOut','Smtp','CloudProvider','getSmtpOptions','attachments','join','root','basename','List','List\x20not\x20found','SendMail','sendMail','messageId','format','YYYY-MM-DD\x20HH:mm:ss','mail','read','user','agent','UserId','MailInteraction','MailInteractionId','isNil','read1stAt','interaction','get','[MAILMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','role','AcceptMessage','acceptMessage','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','ContactId','sequelize','Sequelize','SELECT','contact','User','fullname','email','internal','interface','SIP/%s','channel'];(function(_0x9390d0,_0x1c1feb){var _0x455bd2=function(_0xe194c7){while(--_0xe194c7){_0x9390d0['push'](_0x9390d0['shift']());}};_0x455bd2(++_0x1c1feb);}(_0x8057,0xbe));var _0x7805=function(_0x42df87,_0x2dd2a9){_0x42df87=_0x42df87-0x0;var _0xebd657=_0x8057[_0x42df87];return _0xebd657;};'use strict';var emlformat=require(_0x7805('0x0'));var moment=require(_0x7805('0x1'));var BPromise=require('bluebird');var util=require('util');var path=require(_0x7805('0x2'));var fs=require('fs');var _=require(_0x7805('0x3'));var Redis=require(_0x7805('0x4'));var htmlToText=require(_0x7805('0x5'));var qs=require(_0x7805('0x6'));var logger=require(_0x7805('0x7'))(_0x7805('0x8'));var interaction_log=require(_0x7805('0x7'))(_0x7805('0x9'));var config=require(_0x7805('0xa'));var db=require(_0x7805('0xb'))['db'];config[_0x7805('0xc')]=_[_0x7805('0xd')](config['redis'],{'host':_0x7805('0xe'),'port':0x18eb});var socket=require(_0x7805('0xf'))(new Redis(config[_0x7805('0xc')]));var htmlEntities=require('html-entities');require(_0x7805('0x10'))[_0x7805('0x11')](socket);var jayson=require(_0x7805('0x12'));var client=jayson['client'][_0x7805('0x13')]({'port':0x232c});var client9003=jayson[_0x7805('0x14')][_0x7805('0x13')]({'port':0x232b});var client9002=jayson[_0x7805('0x14')]['http']({'port':0x232a});function respondWithRpcPromise(_0x2f06c5,_0x4aca50,_0x82bc36,_0x3342f1){return new BPromise(function(_0x30313c,_0x9a63e2){var _0xa57966=_0x3342f1||client;return _0xa57966['request'](_0x2f06c5,_0x82bc36)[_0x7805('0x15')](function(_0x1e61db){logger[_0x7805('0x16')](_0x7805('0x17'),_0x4aca50,_0x7805('0x18'));logger[_0x7805('0x19')](_0x7805('0x1a'),_0x4aca50,_0x7805('0x18'),JSON[_0x7805('0x1b')](_0x1e61db));if(_0x1e61db['error']){if(_0x1e61db[_0x7805('0x1c')]['code']===0x1f4){logger[_0x7805('0x1c')](_0x7805('0x17'),_0x4aca50,_0x1e61db['error'][_0x7805('0x1d')]);return _0x9a63e2(_0x1e61db[_0x7805('0x1c')][_0x7805('0x1d')]);}logger[_0x7805('0x1c')]('MailMessage,\x20%s,\x20%s',_0x4aca50,_0x1e61db[_0x7805('0x1c')]['message']);return _0x30313c(_0x1e61db[_0x7805('0x1c')]['message']);}else{logger[_0x7805('0x16')](_0x7805('0x17'),_0x4aca50,_0x7805('0x18'));_0x30313c(_0x1e61db[_0x7805('0x1e')][_0x7805('0x1d')]);}})[_0x7805('0x1f')](function(_0x1fda88){logger['error'](_0x7805('0x17'),_0x4aca50,_0x1fda88);_0x9a63e2(_0x1fda88);});});}function respondWithResult(_0x18bcf4,_0xd049d0){_0xd049d0=_0xd049d0||0xc8;return function(_0x20db80){if(_0x20db80){return _0x18bcf4[_0x7805('0x20')](_0xd049d0)[_0x7805('0x21')](_0x20db80);}};}function respondWithFilteredResult(_0x90e9d,_0x41b5db){return function(_0x3b3c97){if(_0x3b3c97){var _0x1b5388=typeof _0x41b5db[_0x7805('0x22')]===_0x7805('0x23')&&typeof _0x41b5db[_0x7805('0x24')]===_0x7805('0x23');var _0x55fa0a=_0x3b3c97[_0x7805('0x25')];var _0x416708=_0x1b5388?0x0:_0x41b5db[_0x7805('0x22')];var _0x3ed5ec=_0x1b5388?_0x3b3c97[_0x7805('0x25')]:_0x41b5db['offset']+_0x41b5db[_0x7805('0x24')];var _0x22590e;if(_0x3ed5ec>=_0x55fa0a){_0x3ed5ec=_0x55fa0a;_0x22590e=0xc8;}else{_0x22590e=0xce;}_0x90e9d[_0x7805('0x20')](_0x22590e);return _0x90e9d[_0x7805('0x26')](_0x7805('0x27'),_0x416708+'-'+_0x3ed5ec+'/'+_0x55fa0a)['json'](_0x3b3c97);}return null;};}function saveUpdates(_0x1f8202){return function(_0x8a1ce3){if(_0x8a1ce3){return _0x8a1ce3[_0x7805('0x28')](_0x1f8202)[_0x7805('0x15')](function(_0x4b094b){return _0x4b094b;});}return null;};}function removeEntity(_0x3b6514){return function(_0x17eb26){if(_0x17eb26){return _0x17eb26[_0x7805('0x29')]()[_0x7805('0x15')](function(){_0x3b6514[_0x7805('0x20')](0xcc)[_0x7805('0x2a')]();});}};}function handleEntityNotFound(_0x1b06c1){return function(_0x248680){if(!_0x248680){_0x1b06c1[_0x7805('0x2b')](0x194);}return _0x248680;};}function handleError(_0x5d3fa0,_0x270674){_0x270674=_0x270674||0x1f4;return function(_0x304ff4){logger[_0x7805('0x1c')](_0x304ff4[_0x7805('0x2c')]);if(_0x304ff4[_0x7805('0x2d')]){delete _0x304ff4['name'];}_0x5d3fa0[_0x7805('0x20')](_0x270674)[_0x7805('0x2e')](_0x304ff4);};}exports[_0x7805('0x2f')]=function(_0x21519a,_0x1f632a){var _0x166668={},_0xb56a19={},_0x2b3f97={'count':0x0,'rows':[]};var _0x2ea85e=_[_0x7805('0x30')](db[_0x7805('0x31')][_0x7805('0x32')],function(_0x11e47d){return{'name':_0x11e47d[_0x7805('0x33')],'type':_0x11e47d[_0x7805('0x34')][_0x7805('0x35')]};});_0xb56a19['model']=_[_0x7805('0x30')](_0x2ea85e,_0x7805('0x2d'));_0xb56a19[_0x7805('0x36')]=_[_0x7805('0x37')](_0x21519a[_0x7805('0x36')]);_0xb56a19[_0x7805('0x38')]=_[_0x7805('0x39')](_0xb56a19['model'],_0xb56a19[_0x7805('0x36')]);_0x166668['attributes']=_[_0x7805('0x39')](_0xb56a19[_0x7805('0x3a')],qs[_0x7805('0x3b')](_0x21519a[_0x7805('0x36')][_0x7805('0x3b')]));_0x166668[_0x7805('0x3c')]=_0x166668[_0x7805('0x3c')][_0x7805('0x3d')]?_0x166668['attributes']:_0xb56a19[_0x7805('0x3a')];if(!_0x21519a[_0x7805('0x36')][_0x7805('0x3e')](_0x7805('0x3f'))){_0x166668[_0x7805('0x24')]=qs['limit'](_0x21519a['query'][_0x7805('0x24')]);_0x166668['offset']=qs[_0x7805('0x22')](_0x21519a['query'][_0x7805('0x22')]);}_0x166668[_0x7805('0x40')]=qs['sort'](_0x21519a[_0x7805('0x36')]['sort']);_0x166668['where']=qs[_0x7805('0x38')](_[_0x7805('0x41')](_0x21519a[_0x7805('0x36')],_0xb56a19['filters']),_0x2ea85e);if(_0x21519a[_0x7805('0x36')][_0x7805('0x42')]){_0x166668['where']=_[_0x7805('0x43')](_0x166668['where'],{'$or':_[_0x7805('0x30')](_0x2ea85e,function(_0x16b0eb){if(_0x16b0eb['type']!==_0x7805('0x44')){var _0x47a191={};_0x47a191[_0x16b0eb[_0x7805('0x2d')]]={'$like':'%'+_0x21519a[_0x7805('0x36')][_0x7805('0x42')]+'%'};return _0x47a191;}})});}_0x166668=_[_0x7805('0x43')]({},_0x166668,_0x21519a[_0x7805('0x45')]);var _0x3f915a={'where':_0x166668[_0x7805('0x46')]};return db[_0x7805('0x31')][_0x7805('0x25')](_0x3f915a)[_0x7805('0x15')](function(_0x2a405a){_0x2b3f97['count']=_0x2a405a;if(_0x21519a['query'][_0x7805('0x47')]){_0x166668['include']=[{'all':!![]}];}return db[_0x7805('0x31')][_0x7805('0x48')](_0x166668);})['then'](function(_0x46dd74){_0x2b3f97[_0x7805('0x49')]=_0x46dd74;return _0x2b3f97;})[_0x7805('0x15')](respondWithFilteredResult(_0x1f632a,_0x166668))['catch'](handleError(_0x1f632a,null));};exports[_0x7805('0x4a')]=function(_0x4e8a51,_0x2b8c8e){var _0x542296={'raw':!![],'where':{'id':_0x4e8a51['params']['id']}},_0x4019af={};_0x4019af[_0x7805('0x3a')]=_[_0x7805('0x37')](db[_0x7805('0x31')]['rawAttributes']);_0x4019af['query']=_[_0x7805('0x37')](_0x4e8a51[_0x7805('0x36')]);_0x4019af[_0x7805('0x38')]=_[_0x7805('0x39')](_0x4019af[_0x7805('0x3a')],_0x4019af[_0x7805('0x36')]);_0x542296['attributes']=_[_0x7805('0x39')](_0x4019af['model'],qs[_0x7805('0x3b')](_0x4e8a51[_0x7805('0x36')][_0x7805('0x3b')]));_0x542296[_0x7805('0x3c')]=_0x542296[_0x7805('0x3c')]['length']?_0x542296[_0x7805('0x3c')]:_0x4019af[_0x7805('0x3a')];if(_0x4e8a51[_0x7805('0x36')][_0x7805('0x47')]){_0x542296[_0x7805('0x4b')]=[{'all':!![]}];}_0x542296=_[_0x7805('0x43')]({},_0x542296,_0x4e8a51[_0x7805('0x45')]);return db[_0x7805('0x31')][_0x7805('0x4c')](_0x542296)[_0x7805('0x15')](handleEntityNotFound(_0x2b8c8e,null))['then'](respondWithResult(_0x2b8c8e,null))[_0x7805('0x1f')](handleError(_0x2b8c8e,null));};exports[_0x7805('0x28')]=function(_0x6bd917,_0x275388){if(_0x6bd917['body']['id']){delete _0x6bd917[_0x7805('0x4d')]['id'];}return db[_0x7805('0x31')][_0x7805('0x4c')]({'where':{'id':_0x6bd917[_0x7805('0x4e')]['id']}})['then'](handleEntityNotFound(_0x275388,null))[_0x7805('0x15')](saveUpdates(_0x6bd917['body'],null))[_0x7805('0x15')](respondWithResult(_0x275388,null))[_0x7805('0x1f')](handleError(_0x275388,null));};exports[_0x7805('0x29')]=function(_0x1f4bf7,_0x24cc2a){return db[_0x7805('0x31')][_0x7805('0x4c')]({'where':{'id':_0x1f4bf7[_0x7805('0x4e')]['id']}})['then'](handleEntityNotFound(_0x24cc2a,null))[_0x7805('0x15')](removeEntity(_0x24cc2a,null))['catch'](handleError(_0x24cc2a,null));};exports[_0x7805('0x4f')]=function(_0x384016,_0x4cf16a){return db['MailMessage']['describe']()[_0x7805('0x15')](respondWithResult(_0x4cf16a,null))[_0x7805('0x1f')](handleError(_0x4cf16a,null));};exports[_0x7805('0x50')]=function(_0x20a653,_0x5d8558){return db['MailMessage']['create'](_0x20a653[_0x7805('0x4d')])[_0x7805('0x15')](function(_0x1bab94){if(_0x1bab94){if(_0x1bab94[_0x7805('0x51')]===_0x7805('0x52')&&!_0x1bab94[_0x7805('0x53')]){var _0x1a7208,_0x5a7189,_0x419679;if(_0x20a653[_0x7805('0x4d')]['to']){_0x5a7189=_0x20a653[_0x7805('0x4d')]['to'][_0x7805('0x54')](',')[0x0];}return db[_0x7805('0x55')][_0x7805('0x56')]({'where':{'id':_0x1bab94[_0x7805('0x57')]},'include':[{'model':db['CmList'],'as':'List','include':[{'model':db[_0x7805('0x58')],'as':_0x7805('0x59'),'where':{'email':_0x5a7189},'limit':0x1,'order':[['updatedAt',_0x7805('0x5a')]]}]},{'model':db[_0x7805('0x5b')],'as':_0x7805('0x5c'),'raw':!![],'include':[{'model':db[_0x7805('0x5d')],'as':_0x7805('0x5d'),'raw':!![]}]}]})[_0x7805('0x15')](function(_0x59a007){_0x1a7208=_0x59a007;if(!_0x1a7208||!_0x1a7208[_0x7805('0x5c')])return;var _0x47e17f=_0x1a7208[_0x7805('0x5e')]();if(_0x20a653['body']['attachments']&&_0x20a653[_0x7805('0x4d')][_0x7805('0x5f')][_0x7805('0x3d')]){for(var _0x39a6d7=0x0;_0x39a6d7<_0x20a653['body'][_0x7805('0x5f')]['length'];_0x39a6d7+=0x1){_0x20a653[_0x7805('0x4d')][_0x7805('0x5f')][_0x39a6d7]={'filename':_0x20a653[_0x7805('0x4d')][_0x7805('0x5f')][_0x39a6d7][_0x7805('0x2d')],'path':path[_0x7805('0x60')](config[_0x7805('0x61')],'server/files/attachments',_0x20a653[_0x7805('0x4d')][_0x7805('0x5f')][_0x39a6d7][_0x7805('0x62')])};}}_0x419679={'account':_0x47e17f,'message':_0x20a653[_0x7805('0x4d')]};return;})['then'](function(){if(_0x1a7208['List']){if(_0x1a7208[_0x7805('0x63')][_0x7805('0x59')][_0x7805('0x3d')]){return _0x1a7208[_0x7805('0x63')][_0x7805('0x59')][0x0];}else{return db[_0x7805('0x58')][_0x7805('0x50')](_['defaults'](_0x20a653['body'],{'firstName':_0x20a653[_0x7805('0x4d')]['to'],'email':_0x20a653[_0x7805('0x4d')]['to'],'phone':_0x20a653[_0x7805('0x4d')]['to'],'ListId':_0x1a7208['ListId']}));}}else{throw new Error(_0x7805('0x64'));}})['then'](function(){if(_0x419679){return respondWithRpcPromise(_0x7805('0x65'),_0x7805('0x66'),_0x419679,client9003)[_0x7805('0x15')](function(_0x338dd0){return _0x1bab94[_0x7805('0x28')]({'read':!![],'messageId':_0x338dd0[_0x7805('0x67')],'sentAt':moment()[_0x7805('0x68')](_0x7805('0x69'))});})['catch'](function(_0x491cd1){logger[_0x7805('0x1c')]('%s',JSON['stringify'](_0x491cd1));return _0x1bab94;});}return _0x1bab94;});}return _0x1bab94;}})[_0x7805('0x15')](respondWithResult(_0x5d8558,0xc9))[_0x7805('0x1f')](handleError(_0x5d8558,null));};exports['accept']=function(_0x1a408f,_0xfe35c3){var _0x1164dd={'agent':{},'channel':_0x7805('0x6a')};if(_0x1a408f[_0x7805('0x4d')]['id']){delete _0x1a408f[_0x7805('0x4d')]['id'];}_0x1a408f[_0x7805('0x4d')][_0x7805('0x6b')]=!![];_0x1a408f[_0x7805('0x4d')]['readAt']=moment()[_0x7805('0x68')](_0x7805('0x69'));_0x1a408f[_0x7805('0x4d')]['UserId']=_0x1a408f['body']['UserId']||_0x1a408f[_0x7805('0x6c')]['id'];_0x1164dd[_0x7805('0x6d')]['id']=_0x1a408f[_0x7805('0x4d')][_0x7805('0x6e')];return db['MailMessage'][_0x7805('0x4c')]({'where':{'id':_0x1a408f[_0x7805('0x4e')]['id'],'UserId':null}})[_0x7805('0x15')](handleEntityNotFound(_0xfe35c3,null))['then'](saveUpdates(_0x1a408f['body'],null))['then'](function(_0x3a2a56){if(_0x3a2a56){_0x1164dd[_0x7805('0x1d')]=_0x3a2a56['get']({'plain':!![]});return db[_0x7805('0x6f')][_0x7805('0x4c')]({'where':{'id':_0x3a2a56[_0x7805('0x70')]}});}return null;})[_0x7805('0x15')](handleEntityNotFound(_0xfe35c3,null))[_0x7805('0x15')](function(_0x40e0b6){if(_0x40e0b6){return _0x40e0b6[_0x7805('0x28')]({'UserId':_0x1a408f[_0x7805('0x4d')]['UserId'],'read1stAt':_[_0x7805('0x71')](_0x40e0b6[_0x7805('0x72')])?moment()[_0x7805('0x68')](_0x7805('0x69')):undefined});}return null;})[_0x7805('0x15')](function(_0x109f83){if(_0x109f83){_0x1164dd[_0x7805('0x73')]=_0x109f83[_0x7805('0x74')]({'plain':!![]});interaction_log[_0x7805('0x16')](_0x7805('0x75'),_0x1a408f[_0x7805('0x6c')]['id'],_0x1a408f[_0x7805('0x6c')][_0x7805('0x2d')],_0x1a408f[_0x7805('0x6c')][_0x7805('0x76')],_0x1164dd[_0x7805('0x73')]['id'],_0x1a408f[_0x7805('0x4d')]?JSON[_0x7805('0x1b')](_0x1a408f['body']):'null');return respondWithRpcPromise(_0x7805('0x77'),_0x7805('0x78'),_0x1164dd);}return null;})[_0x7805('0x15')](function(_0xefaf05){var _0x57a59d=_0x7805('0x79')+_0xefaf05[_0x7805('0x1d')][_0x7805('0x7a')];return db[_0x7805('0x7b')][_0x7805('0x36')](_0x57a59d,{'type':db[_0x7805('0x7c')]['QueryTypes'][_0x7805('0x7d')],'raw':!![]})['then'](function(_0x1f0484){return _0x1f0484;});})[_0x7805('0x15')](function(_0x4df845){if(_0x4df845){_0x1164dd[_0x7805('0x1d')][_0x7805('0x7e')]=_0x4df845[0x0];if(!_0x1a408f[_0x7805('0x4d')][_0x7805('0x6e')])return;return db[_0x7805('0x7f')][_0x7805('0x4c')]({'where':{'id':_0x1a408f[_0x7805('0x4d')][_0x7805('0x6e')],'role':_0x7805('0x6d')},'attributes':['id',_0x7805('0x2d'),_0x7805('0x80'),_0x7805('0x81'),_0x7805('0x82')],'raw':!![]});}return null;})['then'](function(_0x7c7755){if(!_0x7c7755)return null;_0x1164dd['message'][_0x7805('0x6d')]=_0x7c7755;return _0x1164dd;})[_0x7805('0x15')](function(_0x18a73e){if(_0x18a73e){if(_0x1a408f['body']['manual']){_0x1164dd[_0x7805('0x1d')][_0x7805('0x83')]=util['format'](_0x7805('0x84'),_0x1a408f[_0x7805('0x6c')][_0x7805('0x2d')]);_0x1164dd[_0x7805('0x1d')]['channel']=_0x1164dd[_0x7805('0x85')];_0x1164dd[_0x7805('0x1d')][_0x7805('0x86')]=_0x1164dd['channel'];_0x1164dd[_0x7805('0x1d')][_0x7805('0x87')]=_0x7805('0x88');_0x1164dd[_0x7805('0x1d')][_0x7805('0x4d')]=htmlToText[_0x7805('0x89')](_0x1164dd[_0x7805('0x1d')]['body']);return respondWithRpcPromise('EventManager',_0x7805('0x8a'),{'event':'acceptmessage','message':_0x1164dd[_0x7805('0x1d')]},client9002)[_0x7805('0x15')](function(){return _0x1164dd;});}return _0x1164dd;}return null;})[_0x7805('0x15')](respondWithResult(_0xfe35c3,null))[_0x7805('0x1f')](handleError(_0xfe35c3,null));};exports[_0x7805('0x8b')]=function(_0x44fa16,_0x3170ea){var _0x2d62fb={'agent':{},'channel':'mail'};if(_0x44fa16[_0x7805('0x4d')]['id']){delete _0x44fa16[_0x7805('0x4d')]['id'];}_0x44fa16[_0x7805('0x4d')][_0x7805('0x6e')]=_0x44fa16['body'][_0x7805('0x6e')]||_0x44fa16[_0x7805('0x6c')]['id'];_0x2d62fb[_0x7805('0x6d')]['id']=_0x44fa16[_0x7805('0x4d')][_0x7805('0x6e')];return db['MailMessage'][_0x7805('0x4c')]({'where':{'id':_0x44fa16[_0x7805('0x4e')]['id'],'UserId':null}})[_0x7805('0x15')](handleEntityNotFound(_0x3170ea,null))[_0x7805('0x15')](function(_0x5cc948){if(_0x5cc948){_0x2d62fb[_0x7805('0x1d')]=_0x5cc948[_0x7805('0x74')]({'plain':!![]});return db[_0x7805('0x6f')][_0x7805('0x4c')]({'where':{'id':_0x5cc948['MailInteractionId']}});}return null;})[_0x7805('0x15')](handleEntityNotFound(_0x3170ea,null))[_0x7805('0x15')](function(_0x56aa2a){if(_0x56aa2a){_0x2d62fb[_0x7805('0x73')]=_0x56aa2a['get']({'plain':!![]});interaction_log[_0x7805('0x16')](_0x7805('0x8c'),_0x44fa16[_0x7805('0x6c')]['id'],_0x44fa16[_0x7805('0x6c')]['name'],_0x44fa16['user'][_0x7805('0x76')],_0x2d62fb[_0x7805('0x73')]['id'],_0x44fa16[_0x7805('0x4d')]?JSON[_0x7805('0x1b')](_0x44fa16[_0x7805('0x4d')]):_0x7805('0x8d'));return respondWithRpcPromise(_0x7805('0x8e'),'rejectMessage',_0x2d62fb);}return null;})[_0x7805('0x15')](function(_0x3de4c8){var _0x3be77a=_0x7805('0x79')+_0x3de4c8[_0x7805('0x1d')][_0x7805('0x7a')];return db[_0x7805('0x7b')][_0x7805('0x36')](_0x3be77a,{'type':db[_0x7805('0x7c')]['QueryTypes'][_0x7805('0x7d')],'raw':!![]})['then'](function(_0x9df108){return _0x9df108;});})[_0x7805('0x15')](function(_0x5cdc1d){if(_0x5cdc1d){_0x2d62fb[_0x7805('0x1d')][_0x7805('0x7e')]=_0x5cdc1d[0x0];if(!_0x44fa16[_0x7805('0x4d')][_0x7805('0x6e')])return;return db['User']['find']({'where':{'id':_0x44fa16[_0x7805('0x4d')][_0x7805('0x6e')],'role':_0x7805('0x6d')},'attributes':['id',_0x7805('0x2d'),_0x7805('0x80'),_0x7805('0x81'),'internal'],'raw':!![]});}return null;})[_0x7805('0x15')](function(_0x292f18){if(!_0x292f18)return null;_0x2d62fb[_0x7805('0x1d')]['agent']=_0x292f18;return _0x2d62fb;})[_0x7805('0x15')](function(_0x562a3b){if(_0x562a3b){_0x562a3b[_0x7805('0x1d')][_0x7805('0x83')]=util[_0x7805('0x68')]('SIP/%s',_0x44fa16['user'][_0x7805('0x2d')]);_0x562a3b[_0x7805('0x1d')][_0x7805('0x85')]=_0x2d62fb[_0x7805('0x85')];_0x562a3b[_0x7805('0x1d')]['motionChannel']=_0x2d62fb[_0x7805('0x85')];_0x562a3b[_0x7805('0x1d')][_0x7805('0x87')]=_0x7805('0x8b');_0x562a3b[_0x7805('0x1d')][_0x7805('0x4d')]=htmlToText[_0x7805('0x89')](_0x2d62fb[_0x7805('0x1d')]['body']);respondWithRpcPromise('EventManager',_0x7805('0x8a'),{'event':'rejectmessage','message':_0x562a3b[_0x7805('0x1d')]},client9002);return _0x2d62fb;}return null;})[_0x7805('0x15')](respondWithResult(_0x3170ea,null))[_0x7805('0x1f')](handleError(_0x3170ea,null));};exports[_0x7805('0x8f')]=function(_0x5dc9ca,_0x94e938){var _0x2d39d8=moment()[_0x7805('0x90')]()['toString']();var _0x3ce195=path[_0x7805('0x60')](config[_0x7805('0x61')],_0x7805('0x91'),_0x7805('0x92'),_0x7805('0x93'));var _0x2a7068=path[_0x7805('0x60')](config['root'],_0x7805('0x91'),_0x7805('0x92'),_0x7805('0x5f'));var _0xfb1749=util[_0x7805('0x68')](_0x7805('0x94'),_0x2d39d8);return db['MailMessage'][_0x7805('0x4c')]({'where':{'id':_0x5dc9ca[_0x7805('0x4e')]['id']},'attributes':['id','body',_0x7805('0x95'),'to','cc','bcc',_0x7805('0x96'),'createdAt'],'include':_0x5dc9ca[_0x7805('0x36')]['attachments']?[{'model':db[_0x7805('0x97')],'as':_0x7805('0x98')}]:undefined})[_0x7805('0x15')](handleEntityNotFound(_0x94e938,null))[_0x7805('0x15')](function(_0x14a495){if(_0x14a495){var _0x331007=_0x14a495;var _0x4cccba={'from':_0x331007[_0x7805('0x95')],'to':_0x331007['to'],'subject':_0x331007[_0x7805('0x96')],'html':htmlEntities[_0x7805('0x99')](_0x331007[_0x7805('0x4d')]),'headers':{'Date':moment(_0x331007['createdAt'])[_0x7805('0x68')](_0x7805('0x9a'))},'attachments':[]};if(_0x14a495['cc']){_0x4cccba[_0x7805('0x9b')]['Cc']=_0x14a495['cc'];}if(_0x14a495[_0x7805('0x9c')]){_0x4cccba[_0x7805('0x9b')]['Bcc']=_0x14a495[_0x7805('0x9c')];}return new BPromise(function(_0x4738ba,_0xd05618){if(_0x14a495['Attachments']){for(var _0x33e5de=0x0;_0x33e5de<_0x14a495[_0x7805('0x98')][_0x7805('0x3d')];_0x33e5de++){var _0x321345=_0x14a495[_0x7805('0x98')][_0x33e5de];var _0x771708=path[_0x7805('0x60')](_0x2a7068,_0x321345['basename']);if(fs[_0x7805('0x9d')](_0x771708)){_0x4cccba[_0x7805('0x5f')]['push']({'name':_0x321345[_0x7805('0x2d')],'contentType':_0x321345[_0x7805('0x34')],'data':fs[_0x7805('0x9e')](_0x771708)});}}}emlformat[_0x7805('0x9f')](_0x4cccba,function(_0x4768f4,_0x2bc002){if(_0x4768f4)return _0xd05618(_0x4768f4);fs[_0x7805('0xa0')](path[_0x7805('0x60')](_0x3ce195,_0xfb1749),_0x2bc002);return _0x4738ba(_0x2bc002);});});}})['then'](function(_0x503e64){if(_0x503e64){return _0x94e938[_0x7805('0x8f')](path['join'](_0x3ce195,_0xfb1749),_0xfb1749,function(_0x609af0){if(!_0x609af0)fs[_0x7805('0xa1')](path['join'](_0x3ce195,_0xfb1749));});}})['catch'](handleError(_0x94e938,null));}; \ No newline at end of file +var _0xa73b=['status','json','offset','undefined','limit','count','update','destroy','end','sendStatus','stack','name','send','index','map','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','type','VIRTUAL','options','MailMessage','include','rows','catch','rawAttributes','includeAll','body','params','find','describe','create','direction','out','secret','split','findOne','List','CmContact','Contacts','updatedAt','DESC','MailServerOut','Smtp','getSmtpOptions','attachments','root','basename','ListId','List\x20not\x20found','SendMail','sendMail','messageId','YYYY-MM-DD\x20HH:mm:ss','accept','mail','readAt','format','UserId','user','agent','get','MailInteraction','MailInteractionId','isNil','read1stAt','interaction','[MAILMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','role','acceptMessage','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','sequelize','Sequelize','SELECT','contact','fullname','email','internal','manual','interface','channel','motionChannel','event','EventManager','acceptmessage','reject','[MAILMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','null','RejectMessage','rejectMessage','QueryTypes','SIP/%s','fromString','rejectmessage','unix','toString','join','files','tmp','server','from','subject','createdAt','Attachment','Attachments','decode','ddd,\x20DD\x20MMM\x20YYYY\x20HH:mm:ss\x20ZZ','bcc','headers','Bcc','existsSync','readFileSync','build','download','unlinkSync','eml-format','moment','bluebird','util','path','../../components/parsers/qs','../../config/logger','api','mail-interactions','../../config/environment','redis','localhost','socket.io-emitter','html-entities','./mailMessage.socket','jayson/promise','client','http','request','then','info','debug','request\x20sent','stringify','error','message','MailMessage,\x20%s,\x20%s','result'];(function(_0xe52657,_0x374354){var _0x4f14ea=function(_0x413ee4){while(--_0x413ee4){_0xe52657['push'](_0xe52657['shift']());}};_0x4f14ea(++_0x374354);}(_0xa73b,0x11e));var _0xba73=function(_0xbcc067,_0x3f29d5){_0xbcc067=_0xbcc067-0x0;var _0x5b1c19=_0xa73b[_0xbcc067];return _0x5b1c19;};'use strict';var emlformat=require(_0xba73('0x0'));var moment=require(_0xba73('0x1'));var BPromise=require(_0xba73('0x2'));var util=require(_0xba73('0x3'));var path=require(_0xba73('0x4'));var fs=require('fs');var _=require('lodash');var Redis=require('ioredis');var htmlToText=require('html-to-text');var qs=require(_0xba73('0x5'));var logger=require(_0xba73('0x6'))(_0xba73('0x7'));var interaction_log=require(_0xba73('0x6'))(_0xba73('0x8'));var config=require(_0xba73('0x9'));var db=require('../../mysqldb')['db'];config[_0xba73('0xa')]=_['defaults'](config[_0xba73('0xa')],{'host':_0xba73('0xb'),'port':0x18eb});var socket=require(_0xba73('0xc'))(new Redis(config[_0xba73('0xa')]));var htmlEntities=require(_0xba73('0xd'));require(_0xba73('0xe'))['register'](socket);var jayson=require(_0xba73('0xf'));var client=jayson[_0xba73('0x10')][_0xba73('0x11')]({'port':0x232c});var client9003=jayson[_0xba73('0x10')][_0xba73('0x11')]({'port':0x232b});var client9002=jayson[_0xba73('0x10')]['http']({'port':0x232a});function respondWithRpcPromise(_0x26029d,_0x1959b2,_0x2415e2,_0x3a7776){return new BPromise(function(_0x450041,_0xbea2f7){var _0x4fadcd=_0x3a7776||client;return _0x4fadcd[_0xba73('0x12')](_0x26029d,_0x2415e2)[_0xba73('0x13')](function(_0x4968d5){logger[_0xba73('0x14')]('MailMessage,\x20%s,\x20%s',_0x1959b2,'request\x20sent');logger[_0xba73('0x15')]('MailMessage,\x20%s,\x20%s,\x20%s',_0x1959b2,_0xba73('0x16'),JSON[_0xba73('0x17')](_0x4968d5));if(_0x4968d5['error']){if(_0x4968d5[_0xba73('0x18')]['code']===0x1f4){logger['error']('MailMessage,\x20%s,\x20%s',_0x1959b2,_0x4968d5[_0xba73('0x18')][_0xba73('0x19')]);return _0xbea2f7(_0x4968d5[_0xba73('0x18')]['message']);}logger[_0xba73('0x18')](_0xba73('0x1a'),_0x1959b2,_0x4968d5[_0xba73('0x18')]['message']);return _0x450041(_0x4968d5[_0xba73('0x18')]['message']);}else{logger['info']('MailMessage,\x20%s,\x20%s',_0x1959b2,_0xba73('0x16'));_0x450041(_0x4968d5[_0xba73('0x1b')][_0xba73('0x19')]);}})['catch'](function(_0x4151b6){logger[_0xba73('0x18')](_0xba73('0x1a'),_0x1959b2,_0x4151b6);_0xbea2f7(_0x4151b6);});});}function respondWithResult(_0xfede0e,_0x10476f){_0x10476f=_0x10476f||0xc8;return function(_0x2eabfa){if(_0x2eabfa){return _0xfede0e[_0xba73('0x1c')](_0x10476f)[_0xba73('0x1d')](_0x2eabfa);}};}function respondWithFilteredResult(_0x1579ca,_0x564f52){return function(_0x2c3318){if(_0x2c3318){var _0x4f7223=typeof _0x564f52[_0xba73('0x1e')]===_0xba73('0x1f')&&typeof _0x564f52[_0xba73('0x20')]===_0xba73('0x1f');var _0x1814ee=_0x2c3318['count'];var _0x41fa8b=_0x4f7223?0x0:_0x564f52['offset'];var _0x2f0818=_0x4f7223?_0x2c3318[_0xba73('0x21')]:_0x564f52[_0xba73('0x1e')]+_0x564f52[_0xba73('0x20')];var _0x95b6eb;if(_0x2f0818>=_0x1814ee){_0x2f0818=_0x1814ee;_0x95b6eb=0xc8;}else{_0x95b6eb=0xce;}_0x1579ca[_0xba73('0x1c')](_0x95b6eb);return _0x1579ca['set']('Content-Range',_0x41fa8b+'-'+_0x2f0818+'/'+_0x1814ee)[_0xba73('0x1d')](_0x2c3318);}return null;};}function saveUpdates(_0x447f19){return function(_0x3062e2){if(_0x3062e2){return _0x3062e2[_0xba73('0x22')](_0x447f19)[_0xba73('0x13')](function(_0x23e009){return _0x23e009;});}return null;};}function removeEntity(_0x86ddc9){return function(_0x5338d3){if(_0x5338d3){return _0x5338d3[_0xba73('0x23')]()[_0xba73('0x13')](function(){_0x86ddc9[_0xba73('0x1c')](0xcc)[_0xba73('0x24')]();});}};}function handleEntityNotFound(_0x1efcdc){return function(_0x36651f){if(!_0x36651f){_0x1efcdc[_0xba73('0x25')](0x194);}return _0x36651f;};}function handleError(_0x580e70,_0x3851cb){_0x3851cb=_0x3851cb||0x1f4;return function(_0xc189e){logger[_0xba73('0x18')](_0xc189e[_0xba73('0x26')]);if(_0xc189e[_0xba73('0x27')]){delete _0xc189e[_0xba73('0x27')];}_0x580e70[_0xba73('0x1c')](_0x3851cb)[_0xba73('0x28')](_0xc189e);};}exports[_0xba73('0x29')]=function(_0x7f1996,_0x4de2bd){var _0x33be4e={},_0x215e64={},_0x2719f5={'count':0x0,'rows':[]};var _0x38f134=_[_0xba73('0x2a')](db['MailMessage']['rawAttributes'],function(_0x113c13){return{'name':_0x113c13['fieldName'],'type':_0x113c13['type'][_0xba73('0x2b')]};});_0x215e64[_0xba73('0x2c')]=_['map'](_0x38f134,_0xba73('0x27'));_0x215e64[_0xba73('0x2d')]=_[_0xba73('0x2e')](_0x7f1996[_0xba73('0x2d')]);_0x215e64[_0xba73('0x2f')]=_[_0xba73('0x30')](_0x215e64['model'],_0x215e64[_0xba73('0x2d')]);_0x33be4e[_0xba73('0x31')]=_[_0xba73('0x30')](_0x215e64['model'],qs['fields'](_0x7f1996['query'][_0xba73('0x32')]));_0x33be4e['attributes']=_0x33be4e[_0xba73('0x31')][_0xba73('0x33')]?_0x33be4e[_0xba73('0x31')]:_0x215e64[_0xba73('0x2c')];if(!_0x7f1996[_0xba73('0x2d')][_0xba73('0x34')](_0xba73('0x35'))){_0x33be4e[_0xba73('0x20')]=qs[_0xba73('0x20')](_0x7f1996[_0xba73('0x2d')][_0xba73('0x20')]);_0x33be4e[_0xba73('0x1e')]=qs[_0xba73('0x1e')](_0x7f1996[_0xba73('0x2d')][_0xba73('0x1e')]);}_0x33be4e[_0xba73('0x36')]=qs[_0xba73('0x37')](_0x7f1996[_0xba73('0x2d')]['sort']);_0x33be4e[_0xba73('0x38')]=qs[_0xba73('0x2f')](_[_0xba73('0x39')](_0x7f1996[_0xba73('0x2d')],_0x215e64[_0xba73('0x2f')]),_0x38f134);if(_0x7f1996['query'][_0xba73('0x3a')]){_0x33be4e['where']=_[_0xba73('0x3b')](_0x33be4e[_0xba73('0x38')],{'$or':_[_0xba73('0x2a')](_0x38f134,function(_0x123e88){if(_0x123e88[_0xba73('0x3c')]!==_0xba73('0x3d')){var _0x62f0ea={};_0x62f0ea[_0x123e88[_0xba73('0x27')]]={'$like':'%'+_0x7f1996[_0xba73('0x2d')][_0xba73('0x3a')]+'%'};return _0x62f0ea;}})});}_0x33be4e=_['merge']({},_0x33be4e,_0x7f1996[_0xba73('0x3e')]);var _0x3b0795={'where':_0x33be4e[_0xba73('0x38')]};return db[_0xba73('0x3f')][_0xba73('0x21')](_0x3b0795)[_0xba73('0x13')](function(_0x505893){_0x2719f5[_0xba73('0x21')]=_0x505893;if(_0x7f1996['query']['includeAll']){_0x33be4e[_0xba73('0x40')]=[{'all':!![]}];}return db[_0xba73('0x3f')]['findAll'](_0x33be4e);})[_0xba73('0x13')](function(_0x165de0){_0x2719f5[_0xba73('0x41')]=_0x165de0;return _0x2719f5;})[_0xba73('0x13')](respondWithFilteredResult(_0x4de2bd,_0x33be4e))[_0xba73('0x42')](handleError(_0x4de2bd,null));};exports['show']=function(_0x213755,_0x47bb7a){var _0x5872aa={'raw':!![],'where':{'id':_0x213755['params']['id']}},_0x18f24c={};_0x18f24c[_0xba73('0x2c')]=_[_0xba73('0x2e')](db[_0xba73('0x3f')][_0xba73('0x43')]);_0x18f24c[_0xba73('0x2d')]=_[_0xba73('0x2e')](_0x213755['query']);_0x18f24c[_0xba73('0x2f')]=_['intersection'](_0x18f24c[_0xba73('0x2c')],_0x18f24c[_0xba73('0x2d')]);_0x5872aa['attributes']=_[_0xba73('0x30')](_0x18f24c[_0xba73('0x2c')],qs[_0xba73('0x32')](_0x213755[_0xba73('0x2d')]['fields']));_0x5872aa[_0xba73('0x31')]=_0x5872aa[_0xba73('0x31')][_0xba73('0x33')]?_0x5872aa[_0xba73('0x31')]:_0x18f24c[_0xba73('0x2c')];if(_0x213755[_0xba73('0x2d')][_0xba73('0x44')]){_0x5872aa[_0xba73('0x40')]=[{'all':!![]}];}_0x5872aa=_[_0xba73('0x3b')]({},_0x5872aa,_0x213755['options']);return db[_0xba73('0x3f')]['find'](_0x5872aa)[_0xba73('0x13')](handleEntityNotFound(_0x47bb7a,null))[_0xba73('0x13')](respondWithResult(_0x47bb7a,null))['catch'](handleError(_0x47bb7a,null));};exports[_0xba73('0x22')]=function(_0x145eee,_0xbc26d2){if(_0x145eee[_0xba73('0x45')]['id']){delete _0x145eee[_0xba73('0x45')]['id'];}return db[_0xba73('0x3f')]['find']({'where':{'id':_0x145eee[_0xba73('0x46')]['id']}})[_0xba73('0x13')](handleEntityNotFound(_0xbc26d2,null))[_0xba73('0x13')](saveUpdates(_0x145eee[_0xba73('0x45')],null))[_0xba73('0x13')](respondWithResult(_0xbc26d2,null))[_0xba73('0x42')](handleError(_0xbc26d2,null));};exports[_0xba73('0x23')]=function(_0x1c1e5d,_0x4d7bc7){return db[_0xba73('0x3f')][_0xba73('0x47')]({'where':{'id':_0x1c1e5d[_0xba73('0x46')]['id']}})[_0xba73('0x13')](handleEntityNotFound(_0x4d7bc7,null))[_0xba73('0x13')](removeEntity(_0x4d7bc7,null))['catch'](handleError(_0x4d7bc7,null));};exports[_0xba73('0x48')]=function(_0x4fd0c6,_0x55ec83){return db[_0xba73('0x3f')][_0xba73('0x48')]()[_0xba73('0x13')](respondWithResult(_0x55ec83,null))[_0xba73('0x42')](handleError(_0x55ec83,null));};exports[_0xba73('0x49')]=function(_0x29adf0,_0x5e50b6){return db[_0xba73('0x3f')]['create'](_0x29adf0[_0xba73('0x45')])[_0xba73('0x13')](function(_0x4ca44e){if(_0x4ca44e){if(_0x4ca44e[_0xba73('0x4a')]===_0xba73('0x4b')&&!_0x4ca44e[_0xba73('0x4c')]){var _0x1cb912,_0xc7a55d,_0x4c69c7;if(_0x29adf0[_0xba73('0x45')]['to']){_0xc7a55d=_0x29adf0[_0xba73('0x45')]['to'][_0xba73('0x4d')](',')[0x0];}return db['MailAccount'][_0xba73('0x4e')]({'where':{'id':_0x4ca44e['MailAccountId']},'include':[{'model':db['CmList'],'as':_0xba73('0x4f'),'include':[{'model':db[_0xba73('0x50')],'as':_0xba73('0x51'),'where':{'email':_0xc7a55d},'limit':0x1,'order':[[_0xba73('0x52'),_0xba73('0x53')]]}]},{'model':db[_0xba73('0x54')],'as':_0xba73('0x55'),'raw':!![],'include':[{'model':db['CloudProvider'],'as':'CloudProvider','raw':!![]}]}]})[_0xba73('0x13')](function(_0x3d5b37){_0x1cb912=_0x3d5b37;if(!_0x1cb912||!_0x1cb912[_0xba73('0x55')])return;var _0x3a1175=_0x1cb912[_0xba73('0x56')]();if(_0x29adf0[_0xba73('0x45')][_0xba73('0x57')]&&_0x29adf0[_0xba73('0x45')]['attachments'][_0xba73('0x33')]){for(var _0x13ae5a=0x0;_0x13ae5a<_0x29adf0[_0xba73('0x45')][_0xba73('0x57')][_0xba73('0x33')];_0x13ae5a+=0x1){_0x29adf0[_0xba73('0x45')][_0xba73('0x57')][_0x13ae5a]={'filename':_0x29adf0[_0xba73('0x45')][_0xba73('0x57')][_0x13ae5a][_0xba73('0x27')],'path':path['join'](config[_0xba73('0x58')],'server/files/attachments',_0x29adf0['body'][_0xba73('0x57')][_0x13ae5a][_0xba73('0x59')])};}}_0x4c69c7={'account':_0x3a1175,'message':_0x29adf0[_0xba73('0x45')]};return;})[_0xba73('0x13')](function(){if(_0x1cb912['List']){if(_0x1cb912[_0xba73('0x4f')]['Contacts'][_0xba73('0x33')]){return _0x1cb912['List'][_0xba73('0x51')][0x0];}else{return db[_0xba73('0x50')][_0xba73('0x49')](_['defaults'](_0x29adf0[_0xba73('0x45')],{'firstName':_0x29adf0['body']['to'],'email':_0x29adf0[_0xba73('0x45')]['to'],'phone':_0x29adf0[_0xba73('0x45')]['to'],'ListId':_0x1cb912[_0xba73('0x5a')]}));}}else{throw new Error(_0xba73('0x5b'));}})[_0xba73('0x13')](function(){if(_0x4c69c7){return respondWithRpcPromise(_0xba73('0x5c'),_0xba73('0x5d'),_0x4c69c7,client9003)[_0xba73('0x13')](function(_0x25d8ad){return _0x4ca44e[_0xba73('0x22')]({'read':!![],'messageId':_0x25d8ad[_0xba73('0x5e')],'sentAt':moment()['format'](_0xba73('0x5f'))});})['catch'](function(_0x51cdfe){logger[_0xba73('0x18')]('%s',JSON[_0xba73('0x17')](_0x51cdfe));return _0x4ca44e;});}return _0x4ca44e;});}return _0x4ca44e;}})[_0xba73('0x13')](respondWithResult(_0x5e50b6,0xc9))[_0xba73('0x42')](handleError(_0x5e50b6,null));};exports[_0xba73('0x60')]=function(_0xa6a085,_0x48188c){var _0x6f2297={'agent':{},'channel':_0xba73('0x61')};if(_0xa6a085[_0xba73('0x45')]['id']){delete _0xa6a085[_0xba73('0x45')]['id'];}_0xa6a085[_0xba73('0x45')]['read']=!![];_0xa6a085[_0xba73('0x45')][_0xba73('0x62')]=moment()[_0xba73('0x63')]('YYYY-MM-DD\x20HH:mm:ss');_0xa6a085['body'][_0xba73('0x64')]=_0xa6a085['body'][_0xba73('0x64')]||_0xa6a085[_0xba73('0x65')]['id'];_0x6f2297[_0xba73('0x66')]['id']=_0xa6a085[_0xba73('0x45')][_0xba73('0x64')];return db['MailMessage'][_0xba73('0x47')]({'where':{'id':_0xa6a085[_0xba73('0x46')]['id'],'UserId':null}})[_0xba73('0x13')](handleEntityNotFound(_0x48188c,null))[_0xba73('0x13')](saveUpdates(_0xa6a085[_0xba73('0x45')],null))['then'](function(_0x447161){if(_0x447161){_0x6f2297[_0xba73('0x19')]=_0x447161[_0xba73('0x67')]({'plain':!![]});return db[_0xba73('0x68')]['find']({'where':{'id':_0x447161[_0xba73('0x69')]}});}return null;})[_0xba73('0x13')](handleEntityNotFound(_0x48188c,null))[_0xba73('0x13')](function(_0x46756a){if(_0x46756a){return _0x46756a[_0xba73('0x22')]({'UserId':_0xa6a085['body'][_0xba73('0x64')],'read1stAt':_[_0xba73('0x6a')](_0x46756a[_0xba73('0x6b')])?moment()['format'](_0xba73('0x5f')):undefined});}return null;})[_0xba73('0x13')](function(_0x554902){if(_0x554902){_0x6f2297[_0xba73('0x6c')]=_0x554902[_0xba73('0x67')]({'plain':!![]});interaction_log[_0xba73('0x14')](_0xba73('0x6d'),_0xa6a085['user']['id'],_0xa6a085[_0xba73('0x65')][_0xba73('0x27')],_0xa6a085[_0xba73('0x65')][_0xba73('0x6e')],_0x6f2297[_0xba73('0x6c')]['id'],_0xa6a085['body']?JSON['stringify'](_0xa6a085[_0xba73('0x45')]):'null');return respondWithRpcPromise('AcceptMessage',_0xba73('0x6f'),_0x6f2297);}return null;})['then'](function(_0x154d02){var _0x3c16a4=_0xba73('0x70')+_0x154d02[_0xba73('0x19')]['ContactId'];return db[_0xba73('0x71')]['query'](_0x3c16a4,{'type':db[_0xba73('0x72')]['QueryTypes'][_0xba73('0x73')],'raw':!![]})[_0xba73('0x13')](function(_0xf9c895){return _0xf9c895;});})['then'](function(_0x4247a3){if(_0x4247a3){_0x6f2297[_0xba73('0x19')][_0xba73('0x74')]=_0x4247a3[0x0];if(!_0xa6a085[_0xba73('0x45')]['UserId'])return;return db['User'][_0xba73('0x47')]({'where':{'id':_0xa6a085['body']['UserId'],'role':_0xba73('0x66')},'attributes':['id','name',_0xba73('0x75'),_0xba73('0x76'),_0xba73('0x77')],'raw':!![]});}return null;})[_0xba73('0x13')](function(_0x22616d){if(!_0x22616d)return null;_0x6f2297[_0xba73('0x19')]['agent']=_0x22616d;return _0x6f2297;})[_0xba73('0x13')](function(_0x46705a){if(_0x46705a){if(_0xa6a085[_0xba73('0x45')][_0xba73('0x78')]){_0x6f2297[_0xba73('0x19')][_0xba73('0x79')]=util[_0xba73('0x63')]('SIP/%s',_0xa6a085['user']['name']);_0x6f2297[_0xba73('0x19')][_0xba73('0x7a')]=_0x6f2297[_0xba73('0x7a')];_0x6f2297[_0xba73('0x19')][_0xba73('0x7b')]=_0x6f2297[_0xba73('0x7a')];_0x6f2297[_0xba73('0x19')][_0xba73('0x7c')]=_0xba73('0x60');_0x6f2297['message']['body']=htmlToText['fromString'](_0x6f2297[_0xba73('0x19')]['body']);return respondWithRpcPromise(_0xba73('0x7d'),_0xba73('0x7d'),{'event':_0xba73('0x7e'),'message':_0x6f2297[_0xba73('0x19')]},client9002)[_0xba73('0x13')](function(){return _0x6f2297;});}return _0x6f2297;}return null;})[_0xba73('0x13')](respondWithResult(_0x48188c,null))['catch'](handleError(_0x48188c,null));};exports[_0xba73('0x7f')]=function(_0x2fc842,_0xea8b69){var _0x37d891={'agent':{},'channel':_0xba73('0x61')};if(_0x2fc842[_0xba73('0x45')]['id']){delete _0x2fc842[_0xba73('0x45')]['id'];}_0x2fc842['body']['UserId']=_0x2fc842[_0xba73('0x45')][_0xba73('0x64')]||_0x2fc842['user']['id'];_0x37d891['agent']['id']=_0x2fc842['body'][_0xba73('0x64')];return db[_0xba73('0x3f')]['find']({'where':{'id':_0x2fc842[_0xba73('0x46')]['id'],'UserId':null}})['then'](handleEntityNotFound(_0xea8b69,null))['then'](function(_0x42c075){if(_0x42c075){_0x37d891['message']=_0x42c075[_0xba73('0x67')]({'plain':!![]});return db[_0xba73('0x68')][_0xba73('0x47')]({'where':{'id':_0x42c075['MailInteractionId']}});}return null;})[_0xba73('0x13')](handleEntityNotFound(_0xea8b69,null))[_0xba73('0x13')](function(_0x32f4c2){if(_0x32f4c2){_0x37d891[_0xba73('0x6c')]=_0x32f4c2['get']({'plain':!![]});interaction_log[_0xba73('0x14')](_0xba73('0x80'),_0x2fc842[_0xba73('0x65')]['id'],_0x2fc842[_0xba73('0x65')][_0xba73('0x27')],_0x2fc842['user'][_0xba73('0x6e')],_0x37d891[_0xba73('0x6c')]['id'],_0x2fc842[_0xba73('0x45')]?JSON[_0xba73('0x17')](_0x2fc842[_0xba73('0x45')]):_0xba73('0x81'));return respondWithRpcPromise(_0xba73('0x82'),_0xba73('0x83'),_0x37d891);}return null;})[_0xba73('0x13')](function(_0x424bfe){var _0x326211=_0xba73('0x70')+_0x424bfe[_0xba73('0x19')]['ContactId'];return db[_0xba73('0x71')][_0xba73('0x2d')](_0x326211,{'type':db['Sequelize'][_0xba73('0x84')][_0xba73('0x73')],'raw':!![]})['then'](function(_0x6204bf){return _0x6204bf;});})['then'](function(_0x358e4d){if(_0x358e4d){_0x37d891['message'][_0xba73('0x74')]=_0x358e4d[0x0];if(!_0x2fc842[_0xba73('0x45')][_0xba73('0x64')])return;return db['User']['find']({'where':{'id':_0x2fc842['body'][_0xba73('0x64')],'role':_0xba73('0x66')},'attributes':['id',_0xba73('0x27'),_0xba73('0x75'),_0xba73('0x76'),'internal'],'raw':!![]});}return null;})[_0xba73('0x13')](function(_0x58b9f3){if(!_0x58b9f3)return null;_0x37d891['message']['agent']=_0x58b9f3;return _0x37d891;})[_0xba73('0x13')](function(_0x582a5a){if(_0x582a5a){_0x582a5a[_0xba73('0x19')][_0xba73('0x79')]=util[_0xba73('0x63')](_0xba73('0x85'),_0x2fc842[_0xba73('0x65')][_0xba73('0x27')]);_0x582a5a['message'][_0xba73('0x7a')]=_0x37d891[_0xba73('0x7a')];_0x582a5a[_0xba73('0x19')][_0xba73('0x7b')]=_0x37d891[_0xba73('0x7a')];_0x582a5a[_0xba73('0x19')][_0xba73('0x7c')]=_0xba73('0x7f');_0x582a5a[_0xba73('0x19')][_0xba73('0x45')]=htmlToText[_0xba73('0x86')](_0x37d891[_0xba73('0x19')][_0xba73('0x45')]);respondWithRpcPromise(_0xba73('0x7d'),_0xba73('0x7d'),{'event':_0xba73('0x87'),'message':_0x582a5a['message']},client9002);return _0x37d891;}return null;})[_0xba73('0x13')](respondWithResult(_0xea8b69,null))[_0xba73('0x42')](handleError(_0xea8b69,null));};exports['download']=function(_0x502551,_0x38dd96){var _0x49ba8f=moment()[_0xba73('0x88')]()[_0xba73('0x89')]();var _0x5d7af=path[_0xba73('0x8a')](config[_0xba73('0x58')],'server',_0xba73('0x8b'),_0xba73('0x8c'));var _0x273d89=path[_0xba73('0x8a')](config['root'],_0xba73('0x8d'),_0xba73('0x8b'),_0xba73('0x57'));var _0x379c7f=util[_0xba73('0x63')]('message-%s.eml',_0x49ba8f);return db[_0xba73('0x3f')]['find']({'where':{'id':_0x502551[_0xba73('0x46')]['id']},'attributes':['id',_0xba73('0x45'),_0xba73('0x8e'),'to','cc','bcc',_0xba73('0x8f'),_0xba73('0x90')],'include':_0x502551[_0xba73('0x2d')][_0xba73('0x57')]?[{'model':db[_0xba73('0x91')],'as':_0xba73('0x92')}]:undefined})[_0xba73('0x13')](handleEntityNotFound(_0x38dd96,null))[_0xba73('0x13')](function(_0xf76574){if(_0xf76574){var _0x5e0dc1=_0xf76574;var _0x425019={'from':_0x5e0dc1[_0xba73('0x8e')],'to':_0x5e0dc1['to'],'subject':_0x5e0dc1[_0xba73('0x8f')],'html':htmlEntities[_0xba73('0x93')](_0x5e0dc1['body']),'headers':{'Date':moment(_0x5e0dc1[_0xba73('0x90')])[_0xba73('0x63')](_0xba73('0x94'))},'attachments':[]};if(_0xf76574['cc']){_0x425019['headers']['Cc']=_0xf76574['cc'];}if(_0xf76574[_0xba73('0x95')]){_0x425019[_0xba73('0x96')][_0xba73('0x97')]=_0xf76574[_0xba73('0x95')];}return new BPromise(function(_0x20e4de,_0x35eb7a){if(_0xf76574[_0xba73('0x92')]){for(var _0x28c27f=0x0;_0x28c27f<_0xf76574[_0xba73('0x92')][_0xba73('0x33')];_0x28c27f++){var _0x5b15d2=_0xf76574[_0xba73('0x92')][_0x28c27f];var _0x125f2f=path['join'](_0x273d89,_0x5b15d2[_0xba73('0x59')]);if(fs[_0xba73('0x98')](_0x125f2f)){_0x425019[_0xba73('0x57')]['push']({'name':_0x5b15d2[_0xba73('0x27')],'contentType':_0x5b15d2[_0xba73('0x3c')],'data':fs[_0xba73('0x99')](_0x125f2f)});}}}emlformat[_0xba73('0x9a')](_0x425019,function(_0x469a9c,_0x1fc669){if(_0x469a9c)return _0x35eb7a(_0x469a9c);fs['writeFileSync'](path[_0xba73('0x8a')](_0x5d7af,_0x379c7f),_0x1fc669);return _0x20e4de(_0x1fc669);});});}})[_0xba73('0x13')](function(_0x26968){if(_0x26968){return _0x38dd96[_0xba73('0x9b')](path[_0xba73('0x8a')](_0x5d7af,_0x379c7f),_0x379c7f,function(_0x51805a){if(!_0x51805a)fs[_0xba73('0x9c')](path['join'](_0x5d7af,_0x379c7f));});}})['catch'](handleError(_0x38dd96,null));}; \ No newline at end of file diff --git a/server/api/mailMessage/mailMessage.events.js b/server/api/mailMessage/mailMessage.events.js index fcb568d..bdaf15b 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 _0x4d29=['hook','exports','MailMessage','update','emit','hasOwnProperty'];(function(_0x44b271,_0x295951){var _0x45d142=function(_0xeb11ac){while(--_0xeb11ac){_0x44b271['push'](_0x44b271['shift']());}};_0x45d142(++_0x295951);}(_0x4d29,0x16a));var _0x94d2=function(_0x3b6ab6,_0xc4cad2){_0x3b6ab6=_0x3b6ab6-0x0;var _0x371847=_0x4d29[_0x3b6ab6];return _0x371847;};'use strict';var EventEmitter=require('events');var MailMessage=require('../../mysqldb')['db'][_0x94d2('0x0')];var MailMessageEvents=new EventEmitter();MailMessageEvents['setMaxListeners'](0x0);var events={'afterCreate':'save','afterUpdate':_0x94d2('0x1'),'afterDestroy':'remove'};function emitEvent(_0x2cbbe8){return function(_0x3005e0,_0xbaad54,_0x551eda){MailMessageEvents[_0x94d2('0x2')](_0x2cbbe8+':'+_0x3005e0['id'],_0x3005e0);MailMessageEvents[_0x94d2('0x2')](_0x2cbbe8,_0x3005e0);_0x551eda(null);};}for(var e in events){if(events[_0x94d2('0x3')](e)){var event=events[e];MailMessage[_0x94d2('0x4')](e,emitEvent(event));}}module[_0x94d2('0x5')]=MailMessageEvents; \ No newline at end of file +var _0x1d17=['hasOwnProperty','hook','events','../../mysqldb','MailMessage','update','emit'];(function(_0x5e52d0,_0x17f8fe){var _0x1f7a7a=function(_0x218b98){while(--_0x218b98){_0x5e52d0['push'](_0x5e52d0['shift']());}};_0x1f7a7a(++_0x17f8fe);}(_0x1d17,0xe2));var _0x71d1=function(_0xd6bd03,_0xbdadd8){_0xd6bd03=_0xd6bd03-0x0;var _0x263c1c=_0x1d17[_0xd6bd03];return _0x263c1c;};'use strict';var EventEmitter=require(_0x71d1('0x0'));var MailMessage=require(_0x71d1('0x1'))['db'][_0x71d1('0x2')];var MailMessageEvents=new EventEmitter();MailMessageEvents['setMaxListeners'](0x0);var events={'afterCreate':'save','afterUpdate':_0x71d1('0x3'),'afterDestroy':'remove'};function emitEvent(_0x33ee1a){return function(_0x219e92,_0x3a127,_0x15ba3d){MailMessageEvents[_0x71d1('0x4')](_0x33ee1a+':'+_0x219e92['id'],_0x219e92);MailMessageEvents[_0x71d1('0x4')](_0x33ee1a,_0x219e92);_0x15ba3d(null);};}for(var e in events){if(events[_0x71d1('0x5')](e)){var event=events[e];MailMessage[_0x71d1('0x6')](e,emitEvent(event));}}module['exports']=MailMessageEvents; \ No newline at end of file diff --git a/server/api/mailMessage/mailMessage.model.js b/server/api/mailMessage/mailMessage.model.js index 9c6fa60..f9770b0 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 _0x0e34=['plainBody','subject','body','fromString','models','get','toLowerCase','direction','out','secret','isNil','UserId','findOne','MailInteractionId','then','update','createdAt','catch','utf8mb4','utf8mb4_unicode_ci','lodash','util','../../config/logger','moment','bluebird','request-promise','html-to-text','path','./mailMessage.attributes','exports','messageId','fti_mail_messages'];(function(_0x157cbe,_0x1175cd){var _0x7299de=function(_0x6e67bd){while(--_0x6e67bd){_0x157cbe['push'](_0x157cbe['shift']());}};_0x7299de(++_0x1175cd);}(_0x0e34,0xf4));var _0x40e3=function(_0x5e11bd,_0x28c83b){_0x5e11bd=_0x5e11bd-0x0;var _0x9a0cf0=_0x0e34[_0x5e11bd];return _0x9a0cf0;};'use strict';var _=require(_0x40e3('0x0'));var util=require(_0x40e3('0x1'));var logger=require(_0x40e3('0x2'))('api');var moment=require(_0x40e3('0x3'));var BPromise=require(_0x40e3('0x4'));var rp=require(_0x40e3('0x5'));var htmlToText=require(_0x40e3('0x6'));var fs=require('fs');var path=require(_0x40e3('0x7'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0x40e3('0x8'));module[_0x40e3('0x9')]=function(_0x3aa3ee,_0x462d58){return _0x3aa3ee['define']('MailMessage',attributes,{'tableName':'mail_messages','paranoid':![],'indexes':[{'name':_0x40e3('0xa'),'fields':[_0x40e3('0xa')]},{'name':_0x40e3('0xb'),'fields':[_0x40e3('0xc'),_0x40e3('0xd')],'type':'FULLTEXT'}],'timestamps':!![],'hooks':{'beforeCreate':function(_0x483463,_0xc62682,_0x141427){if(_0x483463[_0x40e3('0xe')]){_0x483463['plainBody']=htmlToText[_0x40e3('0xf')](_0x483463[_0x40e3('0xe')],{'preserveNewlines':!![],'singleNewLineParagraphs':!![],'uppercaseHeadings':![],'noLinkBrackets':!![],'ignoreImage':!![]});}_0x141427(null,_0xc62682);},'afterCreate':function(_0x2048b9,_0x59fd9d,_0x2357ad){var _0x2e8d0b=_0x3aa3ee[_0x40e3('0x10')];var _0x5848c1=_0x2048b9[_0x40e3('0x11')]({'plain':!![]});if(_0x5848c1['direction'][_0x40e3('0x12')]()==='in'||_0x5848c1[_0x40e3('0x13')][_0x40e3('0x12')]()===_0x40e3('0x14')&&!_0x5848c1[_0x40e3('0x15')]&&!_[_0x40e3('0x16')](_0x5848c1[_0x40e3('0x17')])){_0x2e8d0b['MailInteraction'][_0x40e3('0x18')]({'where':{'id':_0x5848c1[_0x40e3('0x19')]}})[_0x40e3('0x1a')](function(_0x30adaf){if(_0x30adaf){_0x30adaf[_0x40e3('0x1b')]({'lastMsgAt':_0x5848c1[_0x40e3('0x1c')],'lastMsgDirection':_0x5848c1[_0x40e3('0x13')]['toLowerCase']()});}})[_0x40e3('0x1d')](function(_0x3a3c45){console['error'](_0x3a3c45);});}_0x2357ad();}},'charset':_0x40e3('0x1e'),'collate':_0x40e3('0x1f')});}; \ No newline at end of file +var _0xd34f=['MailMessage','mail_messages','messageId','plainBody','subject','FULLTEXT','fromString','models','get','direction','toLowerCase','out','secret','isNil','MailInteraction','findOne','then','update','createdAt','catch','lodash','util','../../config/logger','api','moment','bluebird','request-promise','html-to-text','path','rimraf','../../config/environment','./mailMessage.attributes'];(function(_0x3cb004,_0x25d5d1){var _0x343ec2=function(_0xb9ac0e){while(--_0xb9ac0e){_0x3cb004['push'](_0x3cb004['shift']());}};_0x343ec2(++_0x25d5d1);}(_0xd34f,0x194));var _0xfd34=function(_0xb47fce,_0x4abd1d){_0xb47fce=_0xb47fce-0x0;var _0x2f07d0=_0xd34f[_0xb47fce];return _0x2f07d0;};'use strict';var _=require(_0xfd34('0x0'));var util=require(_0xfd34('0x1'));var logger=require(_0xfd34('0x2'))(_0xfd34('0x3'));var moment=require(_0xfd34('0x4'));var BPromise=require(_0xfd34('0x5'));var rp=require(_0xfd34('0x6'));var htmlToText=require(_0xfd34('0x7'));var fs=require('fs');var path=require(_0xfd34('0x8'));var rimraf=require(_0xfd34('0x9'));var config=require(_0xfd34('0xa'));var attributes=require(_0xfd34('0xb'));module['exports']=function(_0x4a8439,_0x2cfcd9){return _0x4a8439['define'](_0xfd34('0xc'),attributes,{'tableName':_0xfd34('0xd'),'paranoid':![],'indexes':[{'name':_0xfd34('0xe'),'fields':[_0xfd34('0xe')]},{'name':'fti_mail_messages','fields':[_0xfd34('0xf'),_0xfd34('0x10')],'type':_0xfd34('0x11')}],'timestamps':!![],'hooks':{'beforeCreate':function(_0x5be0bd,_0x79cda4,_0x54e1c8){if(_0x5be0bd['body']){_0x5be0bd[_0xfd34('0xf')]=htmlToText[_0xfd34('0x12')](_0x5be0bd['body'],{'preserveNewlines':!![],'singleNewLineParagraphs':!![],'uppercaseHeadings':![],'noLinkBrackets':!![],'ignoreImage':!![]});}_0x54e1c8(null,_0x79cda4);},'afterCreate':function(_0x205895,_0x544285,_0x759437){var _0x426358=_0x4a8439[_0xfd34('0x13')];var _0x3cbd5c=_0x205895[_0xfd34('0x14')]({'plain':!![]});if(_0x3cbd5c[_0xfd34('0x15')]['toLowerCase']()==='in'||_0x3cbd5c[_0xfd34('0x15')][_0xfd34('0x16')]()===_0xfd34('0x17')&&!_0x3cbd5c[_0xfd34('0x18')]&&!_[_0xfd34('0x19')](_0x3cbd5c['UserId'])){_0x426358[_0xfd34('0x1a')][_0xfd34('0x1b')]({'where':{'id':_0x3cbd5c['MailInteractionId']}})[_0xfd34('0x1c')](function(_0x46e671){if(_0x46e671){_0x46e671[_0xfd34('0x1d')]({'lastMsgAt':_0x3cbd5c[_0xfd34('0x1e')],'lastMsgDirection':_0x3cbd5c[_0xfd34('0x15')][_0xfd34('0x16')]()});}})[_0xfd34('0x1f')](function(_0x52e703){console['error'](_0x52e703);});}_0x759437();}},'charset':'utf8mb4','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 a6cfca9..c823284 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 _0x8f59=['redis','localhost','socket.io-emitter','register','info','request\x20sent','debug','MailMessage,\x20%s,\x20%s,\x20%s','stringify','error','code','message','MailMessage,\x20%s,\x20%s','result','catch','create','body','options','raw','then','CreateMailMessage','lodash','util','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','client','http'];(function(_0x16e690,_0x5d4683){var _0x3beb56=function(_0x547cf5){while(--_0x547cf5){_0x16e690['push'](_0x16e690['shift']());}};_0x3beb56(++_0x5d4683);}(_0x8f59,0x11d));var _0x98f5=function(_0x3727ae,_0x165f88){_0x3727ae=_0x3727ae-0x0;var _0x1c3f01=_0x8f59[_0x3727ae];return _0x1c3f01;};'use strict';var _=require(_0x98f5('0x0'));var util=require(_0x98f5('0x1'));var moment=require(_0x98f5('0x2'));var BPromise=require(_0x98f5('0x3'));var rs=require(_0x98f5('0x4'));var fs=require('fs');var Redis=require(_0x98f5('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0x98f5('0x6'));var logger=require(_0x98f5('0x7'))(_0x98f5('0x8'));var config=require(_0x98f5('0x9'));var jayson=require('jayson/promise');var client=jayson[_0x98f5('0xa')][_0x98f5('0xb')]({'port':0x232a});config[_0x98f5('0xc')]=_['defaults'](config['redis'],{'host':_0x98f5('0xd'),'port':0x18eb});var socket=require(_0x98f5('0xe'))(new Redis(config[_0x98f5('0xc')]));require('./mailMessage.socket')[_0x98f5('0xf')](socket);function respondWithRpcPromise(_0x31b669,_0x227cf3,_0x39e85d){return new BPromise(function(_0x4c4abc,_0x26a0fc){return client['request'](_0x31b669,_0x39e85d)['then'](function(_0x3cf4b2){logger[_0x98f5('0x10')]('MailMessage,\x20%s,\x20%s',_0x227cf3,_0x98f5('0x11'));logger[_0x98f5('0x12')](_0x98f5('0x13'),_0x227cf3,_0x98f5('0x11'),JSON[_0x98f5('0x14')](_0x3cf4b2));if(_0x3cf4b2[_0x98f5('0x15')]){if(_0x3cf4b2['error'][_0x98f5('0x16')]===0x1f4){logger[_0x98f5('0x15')]('MailMessage,\x20%s,\x20%s',_0x227cf3,_0x3cf4b2[_0x98f5('0x15')][_0x98f5('0x17')]);return _0x26a0fc(_0x3cf4b2[_0x98f5('0x15')]['message']);}logger[_0x98f5('0x15')](_0x98f5('0x18'),_0x227cf3,_0x3cf4b2[_0x98f5('0x15')]['message']);return _0x4c4abc(_0x3cf4b2[_0x98f5('0x15')][_0x98f5('0x17')]);}else{logger['info'](_0x98f5('0x18'),_0x227cf3,'request\x20sent');_0x4c4abc(_0x3cf4b2[_0x98f5('0x19')][_0x98f5('0x17')]);}})[_0x98f5('0x1a')](function(_0x11b6d4){logger[_0x98f5('0x15')](_0x98f5('0x18'),_0x227cf3,_0x11b6d4);_0x26a0fc(_0x11b6d4);});});}exports['CreateMailMessage']=function(_0xf88f34){var _0x5500a2=this;return new Promise(function(_0xd1209d,_0x191f23){return db['MailMessage'][_0x98f5('0x1b')](_0xf88f34[_0x98f5('0x1c')],{'raw':_0xf88f34[_0x98f5('0x1d')]?_0xf88f34[_0x98f5('0x1d')][_0x98f5('0x1e')]===undefined?!![]:![]:!![]})[_0x98f5('0x1f')](function(_0x38b46d){logger['info'](_0x98f5('0x20'),_0xf88f34);logger['debug'](_0x98f5('0x20'),_0xf88f34,JSON['stringify'](_0x38b46d));_0xd1209d(_0x38b46d);})[_0x98f5('0x1a')](function(_0x40c69b){logger[_0x98f5('0x15')](_0x98f5('0x20'),_0x40c69b[_0x98f5('0x17')],_0xf88f34);_0x191f23(_0x5500a2[_0x98f5('0x15')](0x1f4,_0x40c69b[_0x98f5('0x17')]));});});}; \ No newline at end of file +var _0x056b=['ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','redis','defaults','localhost','socket.io-emitter','register','then','info','MailMessage,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','CreateMailMessage','MailMessage','body','options','debug','catch','util','moment','bluebird','randomstring'];(function(_0x38037f,_0x2b2d00){var _0x5a83d0=function(_0x4125cb){while(--_0x4125cb){_0x38037f['push'](_0x38037f['shift']());}};_0x5a83d0(++_0x2b2d00);}(_0x056b,0xb6));var _0xb056=function(_0xadd855,_0x313dd0){_0xadd855=_0xadd855-0x0;var _0x16a09f=_0x056b[_0xadd855];return _0x16a09f;};'use strict';var _=require('lodash');var util=require(_0xb056('0x0'));var moment=require(_0xb056('0x1'));var BPromise=require(_0xb056('0x2'));var rs=require(_0xb056('0x3'));var fs=require('fs');var Redis=require(_0xb056('0x4'));var db=require(_0xb056('0x5'))['db'];var utils=require(_0xb056('0x6'));var logger=require(_0xb056('0x7'))(_0xb056('0x8'));var config=require(_0xb056('0x9'));var jayson=require(_0xb056('0xa'));var client=jayson['client'][_0xb056('0xb')]({'port':0x232a});config[_0xb056('0xc')]=_[_0xb056('0xd')](config[_0xb056('0xc')],{'host':_0xb056('0xe'),'port':0x18eb});var socket=require(_0xb056('0xf'))(new Redis(config['redis']));require('./mailMessage.socket')[_0xb056('0x10')](socket);function respondWithRpcPromise(_0x160c2a,_0xd33887,_0x290c9e){return new BPromise(function(_0x5ddddb,_0x170e1a){return client['request'](_0x160c2a,_0x290c9e)[_0xb056('0x11')](function(_0x23513f){logger[_0xb056('0x12')](_0xb056('0x13'),_0xd33887,_0xb056('0x14'));logger['debug']('MailMessage,\x20%s,\x20%s,\x20%s',_0xd33887,_0xb056('0x14'),JSON[_0xb056('0x15')](_0x23513f));if(_0x23513f['error']){if(_0x23513f[_0xb056('0x16')][_0xb056('0x17')]===0x1f4){logger[_0xb056('0x16')](_0xb056('0x13'),_0xd33887,_0x23513f[_0xb056('0x16')][_0xb056('0x18')]);return _0x170e1a(_0x23513f[_0xb056('0x16')]['message']);}logger[_0xb056('0x16')](_0xb056('0x13'),_0xd33887,_0x23513f[_0xb056('0x16')][_0xb056('0x18')]);return _0x5ddddb(_0x23513f['error'][_0xb056('0x18')]);}else{logger['info'](_0xb056('0x13'),_0xd33887,_0xb056('0x14'));_0x5ddddb(_0x23513f['result'][_0xb056('0x18')]);}})['catch'](function(_0x45008c){logger[_0xb056('0x16')]('MailMessage,\x20%s,\x20%s',_0xd33887,_0x45008c);_0x170e1a(_0x45008c);});});}exports[_0xb056('0x19')]=function(_0x48cdaf){var _0x2107ee=this;return new Promise(function(_0x225081,_0x457b54){return db[_0xb056('0x1a')]['create'](_0x48cdaf[_0xb056('0x1b')],{'raw':_0x48cdaf['options']?_0x48cdaf[_0xb056('0x1c')]['raw']===undefined?!![]:![]:!![]})[_0xb056('0x11')](function(_0x40ac2d){logger[_0xb056('0x12')](_0xb056('0x19'),_0x48cdaf);logger[_0xb056('0x1d')](_0xb056('0x19'),_0x48cdaf,JSON['stringify'](_0x40ac2d));_0x225081(_0x40ac2d);})[_0xb056('0x1e')](function(_0x18a3f2){logger[_0xb056('0x16')](_0xb056('0x19'),_0x18a3f2['message'],_0x48cdaf);_0x457b54(_0x2107ee[_0xb056('0x16')](0x1f4,_0x18a3f2[_0xb056('0x18')]));});});}; \ No newline at end of file diff --git a/server/api/mailMessage/mailMessage.socket.js b/server/api/mailMessage/mailMessage.socket.js index 72d29c6..d6e39a4 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 _0x64c4=['update','emit','removeListener','register','length','./mailMessage.events','save'];(function(_0xc8f398,_0x181b18){var _0x531f9d=function(_0x5b872b){while(--_0x5b872b){_0xc8f398['push'](_0xc8f398['shift']());}};_0x531f9d(++_0x181b18);}(_0x64c4,0x155));var _0x464c=function(_0x407145,_0x27938e){_0x407145=_0x407145-0x0;var _0x3a2580=_0x64c4[_0x407145];return _0x3a2580;};'use strict';var MailMessageEvents=require(_0x464c('0x0'));var events=[_0x464c('0x1'),'remove',_0x464c('0x2')];function createListener(_0x39b513,_0x5887b4){return function(_0x246dbf){_0x5887b4[_0x464c('0x3')](_0x39b513,_0x246dbf);};}function removeListener(_0x5816da,_0x1ec016){return function(){MailMessageEvents[_0x464c('0x4')](_0x5816da,_0x1ec016);};}exports[_0x464c('0x5')]=function(_0x4dd936){for(var _0x179641=0x0,_0x2613e5=events[_0x464c('0x6')];_0x179641<_0x2613e5;_0x179641++){var _0x114b37=events[_0x179641];var _0x529bec=createListener('mailMessage:'+_0x114b37,_0x4dd936);MailMessageEvents['on'](_0x114b37,_0x529bec);}}; \ No newline at end of file +var _0x1b6d=['length','./mailMessage.events','remove','emit','removeListener'];(function(_0x261b8a,_0x553ec4){var _0x3455e8=function(_0xdf10d4){while(--_0xdf10d4){_0x261b8a['push'](_0x261b8a['shift']());}};_0x3455e8(++_0x553ec4);}(_0x1b6d,0x1e6));var _0xd1b6=function(_0x21a9d9,_0x4d5ac8){_0x21a9d9=_0x21a9d9-0x0;var _0x46adce=_0x1b6d[_0x21a9d9];return _0x46adce;};'use strict';var MailMessageEvents=require(_0xd1b6('0x0'));var events=['save',_0xd1b6('0x1'),'update'];function createListener(_0x3127bd,_0x1e2a75){return function(_0x562baa){_0x1e2a75[_0xd1b6('0x2')](_0x3127bd,_0x562baa);};}function removeListener(_0x2d2850,_0x1b5bbd){return function(){MailMessageEvents[_0xd1b6('0x3')](_0x2d2850,_0x1b5bbd);};}exports['register']=function(_0x206666){for(var _0x4c053c=0x0,_0x5cabf6=events[_0xd1b6('0x4')];_0x4c053c<_0x5cabf6;_0x4c053c++){var _0x36c820=events[_0x4c053c];var _0x5b2e75=createListener('mailMessage:'+_0x36c820,_0x206666);MailMessageEvents['on'](_0x36c820,_0x5b2e75);}}; \ No newline at end of file diff --git a/server/api/mailQueue/index.js b/server/api/mailQueue/index.js index 77f3ee6..0b2fbee 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 _0x041e=['index','/describe','isAuthenticated','describe','/:id','/:id/teams','getTeams','getAgents','post','addTeams','/:id/users','addAgents','put','update','destroy','removeTeams','delete','removeAgents','exports','multer','util','path','connect-timeout','express','../../components/auth/service','../../components/interaction/service','../../config/environment','./mailQueue.controller','get'];(function(_0x1cb0b4,_0x1fd48d){var _0x525b60=function(_0x1efccc){while(--_0x1efccc){_0x1cb0b4['push'](_0x1cb0b4['shift']());}};_0x525b60(++_0x1fd48d);}(_0x041e,0x135));var _0xe041=function(_0x1943e7,_0x4cf8a0){_0x1943e7=_0x1943e7-0x0;var _0x35f579=_0x041e[_0x1943e7];return _0x35f579;};'use strict';var multer=require(_0xe041('0x0'));var util=require(_0xe041('0x1'));var path=require(_0xe041('0x2'));var timeout=require(_0xe041('0x3'));var express=require(_0xe041('0x4'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0xe041('0x5'));var interaction=require(_0xe041('0x6'));var config=require(_0xe041('0x7'));var controller=require(_0xe041('0x8'));router[_0xe041('0x9')]('/',auth['isAuthenticated'](),controller[_0xe041('0xa')]);router[_0xe041('0x9')](_0xe041('0xb'),auth[_0xe041('0xc')](),controller[_0xe041('0xd')]);router['get'](_0xe041('0xe'),auth[_0xe041('0xc')](),controller['show']);router[_0xe041('0x9')]('/:id/members',auth[_0xe041('0xc')](),controller['getMembers']);router[_0xe041('0x9')](_0xe041('0xf'),auth[_0xe041('0xc')](),controller[_0xe041('0x10')]);router[_0xe041('0x9')]('/:id/users',auth[_0xe041('0xc')](),controller[_0xe041('0x11')]);router[_0xe041('0x12')]('/',auth[_0xe041('0xc')](),controller['create']);router[_0xe041('0x12')]('/:id/teams',auth[_0xe041('0xc')](),controller[_0xe041('0x13')]);router['post'](_0xe041('0x14'),auth[_0xe041('0xc')](),controller[_0xe041('0x15')]);router[_0xe041('0x16')](_0xe041('0xe'),auth[_0xe041('0xc')](),controller[_0xe041('0x17')]);router['delete'](_0xe041('0xe'),auth[_0xe041('0xc')](),controller[_0xe041('0x18')]);router['delete']('/:id/teams',auth[_0xe041('0xc')](),controller[_0xe041('0x19')]);router[_0xe041('0x1a')](_0xe041('0x14'),auth[_0xe041('0xc')](),controller[_0xe041('0x1b')]);module[_0xe041('0x1c')]=router; \ No newline at end of file +var _0x94ed=['show','/:id/members','getMembers','/:id/teams','/:id/users','getAgents','post','create','addTeams','addAgents','put','/:id','update','destroy','delete','removeAgents','multer','util','connect-timeout','Router','fs-extra','../../components/auth/service','../../config/environment','get','isAuthenticated','index','/describe'];(function(_0x39ebb0,_0x2bb363){var _0x4f5b83=function(_0x592d84){while(--_0x592d84){_0x39ebb0['push'](_0x39ebb0['shift']());}};_0x4f5b83(++_0x2bb363);}(_0x94ed,0x1c0));var _0xd94e=function(_0x47e7cb,_0x4c1b8d){_0x47e7cb=_0x47e7cb-0x0;var _0x2a8874=_0x94ed[_0x47e7cb];return _0x2a8874;};'use strict';var multer=require(_0xd94e('0x0'));var util=require(_0xd94e('0x1'));var path=require('path');var timeout=require(_0xd94e('0x2'));var express=require('express');var router=express[_0xd94e('0x3')]();var fs_extra=require(_0xd94e('0x4'));var auth=require(_0xd94e('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0xd94e('0x6'));var controller=require('./mailQueue.controller');router[_0xd94e('0x7')]('/',auth[_0xd94e('0x8')](),controller[_0xd94e('0x9')]);router[_0xd94e('0x7')](_0xd94e('0xa'),auth[_0xd94e('0x8')](),controller['describe']);router['get']('/:id',auth[_0xd94e('0x8')](),controller[_0xd94e('0xb')]);router['get'](_0xd94e('0xc'),auth[_0xd94e('0x8')](),controller[_0xd94e('0xd')]);router[_0xd94e('0x7')](_0xd94e('0xe'),auth[_0xd94e('0x8')](),controller['getTeams']);router['get'](_0xd94e('0xf'),auth['isAuthenticated'](),controller[_0xd94e('0x10')]);router[_0xd94e('0x11')]('/',auth['isAuthenticated'](),controller[_0xd94e('0x12')]);router['post'](_0xd94e('0xe'),auth['isAuthenticated'](),controller[_0xd94e('0x13')]);router[_0xd94e('0x11')](_0xd94e('0xf'),auth[_0xd94e('0x8')](),controller[_0xd94e('0x14')]);router[_0xd94e('0x15')](_0xd94e('0x16'),auth['isAuthenticated'](),controller[_0xd94e('0x17')]);router['delete']('/:id',auth[_0xd94e('0x8')](),controller[_0xd94e('0x18')]);router['delete']('/:id/teams',auth[_0xd94e('0x8')](),controller['removeTeams']);router[_0xd94e('0x19')](_0xd94e('0xf'),auth['isAuthenticated'](),controller[_0xd94e('0x1a')]);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 43efe83..275ea9b 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 _0xfc2e=['beepall','roundrobin','sequelize','exports','STRING','name','INTEGER','rrmemory'];(function(_0x4e462d,_0x2c20ad){var _0x5289cf=function(_0x38f4ef){while(--_0x38f4ef){_0x4e462d['push'](_0x4e462d['shift']());}};_0x5289cf(++_0x2c20ad);}(_0xfc2e,0x9a));var _0xefc2=function(_0x7b124c,_0x626296){_0x7b124c=_0x7b124c-0x0;var _0x33ec83=_0xfc2e[_0x7b124c];return _0x33ec83;};'use strict';var Sequelize=require(_0xefc2('0x0'));module[_0xefc2('0x1')]={'name':{'type':Sequelize[_0xefc2('0x2')],'unique':_0xefc2('0x3'),'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize[_0xefc2('0x2')]},'timeout':{'type':Sequelize[_0xefc2('0x4')],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize['ENUM'](_0xefc2('0x5'),_0xefc2('0x6'),_0xefc2('0x7'))}}; \ No newline at end of file +var _0x437c=['roundrobin','exports','STRING','INTEGER','ENUM'];(function(_0x44d6b8,_0xe7e065){var _0x18cbfa=function(_0x1704bc){while(--_0x1704bc){_0x44d6b8['push'](_0x44d6b8['shift']());}};_0x18cbfa(++_0xe7e065);}(_0x437c,0x182));var _0xc437=function(_0x4b4670,_0x399758){_0x4b4670=_0x4b4670-0x0;var _0x5c60f0=_0x437c[_0x4b4670];return _0x5c60f0;};'use strict';var Sequelize=require('sequelize');module[_0xc437('0x0')]={'name':{'type':Sequelize['STRING'],'unique':'name','validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize[_0xc437('0x1')]},'timeout':{'type':Sequelize[_0xc437('0x2')],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize[_0xc437('0x3')]('rrmemory','beepall',_0xc437('0x4'))}}; \ No newline at end of file diff --git a/server/api/mailQueue/mailQueue.controller.js b/server/api/mailQueue/mailQueue.controller.js index 24ba61f..e9b5b77 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 _0xff68=['../../components/parsers/qs','../../config/environment','../../mysqldb','redis','defaults','localhost','socket.io-emitter','register','sendStatus','status','end','json','offset','undefined','count','Content-Range','update','then','destroy','MailQueues','UserProfileResource','error','name','send','index','map','MailQueue','rawAttributes','fieldName','type','key','where','include','query','findAll','rows','show','model','keys','filters','intersection','fields','attributes','length','includeAll','merge','options','find','catch','create','body','user','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','autoAssociation','params','describe','findOne','UserMailQueue','hasOwnProperty','nolimit','limit','order','sort','pick','MailQueueId','filter','User','agent','mailPause','updatedAt','createdAt','format','%s/%s','SIP','getTeams','Team','ids','Agents','online','voicePause','flatMap','sequelize','transaction','addTeams','each','findOrCreate','forEach','emit','field','tq.TeamId','join','user_has_teams','MailQueueId\x20=\x20?','clone','push','toString','QueryTypes','SELECT','every','TeamId','includes','union','compact','removeTeams','isEmpty','userMailQueue:remove','addAgents','omit','spread','userMailQueue:save','removeAgents','isArray','getAgents','bluebird','lodash','squel'];(function(_0x475342,_0x8ed514){var _0xda6666=function(_0xef625a){while(--_0xef625a){_0x475342['push'](_0x475342['shift']());}};_0xda6666(++_0x8ed514);}(_0xff68,0xed));var _0x8ff6=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xff68[_0x3dd15e];return _0x231fd0;};'use strict';var BPromise=require(_0x8ff6('0x0'));var util=require('util');var _=require(_0x8ff6('0x1'));var squel=require(_0x8ff6('0x2'));var Redis=require('ioredis');var qs=require(_0x8ff6('0x3'));var logger=require('../../config/logger')('api');var config=require(_0x8ff6('0x4'));var db=require(_0x8ff6('0x5'))['db'];config[_0x8ff6('0x6')]=_[_0x8ff6('0x7')](config[_0x8ff6('0x6')],{'host':_0x8ff6('0x8'),'port':0x18eb});var socket=require(_0x8ff6('0x9'))(new Redis(config[_0x8ff6('0x6')]));require('./mailQueue.socket')[_0x8ff6('0xa')](socket);function respondWithStatusCode(_0x331529,_0x5342cd){_0x5342cd=_0x5342cd||0xcc;return function(_0x9fbbbc){if(_0x9fbbbc){return _0x331529[_0x8ff6('0xb')](_0x5342cd);}return _0x331529[_0x8ff6('0xc')](_0x5342cd)[_0x8ff6('0xd')]();};}function respondWithResult(_0x19813e,_0x5cdefa){_0x5cdefa=_0x5cdefa||0xc8;return function(_0x318c8d){if(_0x318c8d){return _0x19813e[_0x8ff6('0xc')](_0x5cdefa)[_0x8ff6('0xe')](_0x318c8d);}};}function respondWithFilteredResult(_0x54271a,_0x1f382c){return function(_0x1b1657){if(_0x1b1657){var _0x1651c3=typeof _0x1f382c[_0x8ff6('0xf')]===_0x8ff6('0x10')&&typeof _0x1f382c['limit']===_0x8ff6('0x10');var _0x578e5d=_0x1b1657[_0x8ff6('0x11')];var _0x4266dc=_0x1651c3?0x0:_0x1f382c[_0x8ff6('0xf')];var _0x317334=_0x1651c3?_0x1b1657[_0x8ff6('0x11')]:_0x1f382c[_0x8ff6('0xf')]+_0x1f382c['limit'];var _0x485ef9;if(_0x317334>=_0x578e5d){_0x317334=_0x578e5d;_0x485ef9=0xc8;}else{_0x485ef9=0xce;}_0x54271a[_0x8ff6('0xc')](_0x485ef9);return _0x54271a['set'](_0x8ff6('0x12'),_0x4266dc+'-'+_0x317334+'/'+_0x578e5d)[_0x8ff6('0xe')](_0x1b1657);}return null;};}function saveUpdates(_0x36b7f9){return function(_0x58ba42){if(_0x58ba42){return _0x58ba42[_0x8ff6('0x13')](_0x36b7f9)[_0x8ff6('0x14')](function(_0x26debb){return _0x26debb;});}return null;};}function removeEntity(_0x55a8fb){return function(_0x46cd1b){if(_0x46cd1b){return _0x46cd1b[_0x8ff6('0x15')]()[_0x8ff6('0x14')](function(){var _0x581391=_0x46cd1b['get']({'plain':!![]});var _0x2c24dc=_0x8ff6('0x16');return db[_0x8ff6('0x17')][_0x8ff6('0x15')]({'where':{'type':_0x2c24dc,'resourceId':_0x581391['id']}})[_0x8ff6('0x14')](function(){return _0x46cd1b;});})[_0x8ff6('0x14')](function(){_0x55a8fb[_0x8ff6('0xc')](0xcc)[_0x8ff6('0xd')]();});}};}function handleEntityNotFound(_0x3a27ad){return function(_0x2326a1){if(!_0x2326a1){_0x3a27ad[_0x8ff6('0xb')](0x194);}return _0x2326a1;};}function handleError(_0x34ff57,_0x566c9b){_0x566c9b=_0x566c9b||0x1f4;return function(_0x3a9d3a){logger[_0x8ff6('0x18')](_0x3a9d3a['stack']);if(_0x3a9d3a[_0x8ff6('0x19')]){delete _0x3a9d3a[_0x8ff6('0x19')];}_0x34ff57[_0x8ff6('0xc')](_0x566c9b)[_0x8ff6('0x1a')](_0x3a9d3a);};}exports[_0x8ff6('0x1b')]=function(_0x43a6b8,_0x1f72cb){var _0x3bd02e={};var _0x1e8339={'count':0x0,'rows':[]};var _0x32cd45=_[_0x8ff6('0x1c')](db[_0x8ff6('0x1d')][_0x8ff6('0x1e')],function(_0x389e6a){return{'name':_0x389e6a[_0x8ff6('0x1f')],'type':_0x389e6a[_0x8ff6('0x20')][_0x8ff6('0x21')]};});_0x3bd02e=qs['getOptions'](_0x32cd45,_0x43a6b8);var _0x1dc5fe={'where':_0x3bd02e[_0x8ff6('0x22')]};return db[_0x8ff6('0x1d')][_0x8ff6('0x11')](_0x1dc5fe)['then'](function(_0x20de6e){_0x1e8339[_0x8ff6('0x11')]=_0x20de6e;_0x3bd02e[_0x8ff6('0x23')]=qs[_0x8ff6('0x23')](_0x43a6b8[_0x8ff6('0x24')]);return db[_0x8ff6('0x1d')][_0x8ff6('0x25')](_0x3bd02e);})['then'](function(_0x26be5d){_0x1e8339[_0x8ff6('0x26')]=_0x26be5d;return _0x1e8339;})[_0x8ff6('0x14')](respondWithFilteredResult(_0x1f72cb,_0x3bd02e))['catch'](handleError(_0x1f72cb,null));};exports[_0x8ff6('0x27')]=function(_0x290a39,_0x65458){var _0x148afb={'raw':!![],'where':{'id':_0x290a39['params']['id']}},_0x514070={};_0x514070[_0x8ff6('0x28')]=_[_0x8ff6('0x29')](db['MailQueue']['rawAttributes']);_0x514070[_0x8ff6('0x24')]=_[_0x8ff6('0x29')](_0x290a39[_0x8ff6('0x24')]);_0x514070[_0x8ff6('0x2a')]=_[_0x8ff6('0x2b')](_0x514070[_0x8ff6('0x28')],_0x514070[_0x8ff6('0x24')]);_0x148afb['attributes']=_[_0x8ff6('0x2b')](_0x514070['model'],qs[_0x8ff6('0x2c')](_0x290a39[_0x8ff6('0x24')][_0x8ff6('0x2c')]));_0x148afb[_0x8ff6('0x2d')]=_0x148afb[_0x8ff6('0x2d')][_0x8ff6('0x2e')]?_0x148afb[_0x8ff6('0x2d')]:_0x514070['model'];if(_0x290a39[_0x8ff6('0x24')][_0x8ff6('0x2f')]){_0x148afb[_0x8ff6('0x23')]=[{'all':!![]}];}_0x148afb=_[_0x8ff6('0x30')]({},_0x148afb,_0x290a39[_0x8ff6('0x31')]);return db[_0x8ff6('0x1d')][_0x8ff6('0x32')](_0x148afb)[_0x8ff6('0x14')](handleEntityNotFound(_0x65458,null))[_0x8ff6('0x14')](respondWithResult(_0x65458,null))[_0x8ff6('0x33')](handleError(_0x65458,null));};exports['create']=function(_0x66745f,_0x427b2a){return db['MailQueue'][_0x8ff6('0x34')](_0x66745f[_0x8ff6('0x35')],{})['then'](function(_0x38908e){var _0x249369=_0x66745f[_0x8ff6('0x36')][_0x8ff6('0x37')]({'plain':!![]});if(!_0x249369)throw new Error(_0x8ff6('0x38'));if(_0x249369[_0x8ff6('0x39')]===_0x8ff6('0x36')){var _0x538586=_0x38908e[_0x8ff6('0x37')]({'plain':!![]});var _0x25c140=_0x8ff6('0x16');return db[_0x8ff6('0x3a')]['find']({'where':{'name':_0x25c140,'userProfileId':_0x249369[_0x8ff6('0x3b')]},'raw':!![]})['then'](function(_0x101641){if(_0x101641&&_0x101641[_0x8ff6('0x3c')]===0x0){return db['UserProfileResource'][_0x8ff6('0x34')]({'name':_0x538586[_0x8ff6('0x19')],'resourceId':_0x538586['id'],'type':_0x101641[_0x8ff6('0x19')],'sectionId':_0x101641['id']},{})[_0x8ff6('0x14')](function(){return _0x38908e;});}else{return _0x38908e;}})['catch'](function(_0x250172){logger['error']('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x250172);throw _0x250172;});}return _0x38908e;})[_0x8ff6('0x14')](respondWithResult(_0x427b2a,0xc9))[_0x8ff6('0x33')](handleError(_0x427b2a,null));};exports['update']=function(_0x43b1e2,_0x5a1480){if(_0x43b1e2[_0x8ff6('0x35')]['id']){delete _0x43b1e2[_0x8ff6('0x35')]['id'];}return db[_0x8ff6('0x1d')][_0x8ff6('0x32')]({'where':{'id':_0x43b1e2['params']['id']}})[_0x8ff6('0x14')](handleEntityNotFound(_0x5a1480,null))['then'](saveUpdates(_0x43b1e2[_0x8ff6('0x35')],null))[_0x8ff6('0x14')](respondWithResult(_0x5a1480,null))[_0x8ff6('0x33')](handleError(_0x5a1480,null));};exports[_0x8ff6('0x15')]=function(_0x214951,_0x980933){return db[_0x8ff6('0x1d')]['find']({'where':{'id':_0x214951[_0x8ff6('0x3d')]['id']}})[_0x8ff6('0x14')](handleEntityNotFound(_0x980933,null))[_0x8ff6('0x14')](removeEntity(_0x980933,null))[_0x8ff6('0x33')](handleError(_0x980933,null));};exports[_0x8ff6('0x3e')]=function(_0x9377ca,_0x2cb8a9){return db[_0x8ff6('0x1d')][_0x8ff6('0x3e')]()[_0x8ff6('0x14')](respondWithResult(_0x2cb8a9,null))[_0x8ff6('0x33')](handleError(_0x2cb8a9,null));};exports['getMembers']=function(_0x2d2b04,_0x5f5b4b){var _0x11129c={'raw':!![],'where':{}},_0x3403b4={},_0x2eff36;return db[_0x8ff6('0x1d')][_0x8ff6('0x3f')]({'where':{'id':_0x2d2b04[_0x8ff6('0x3d')]['id']}})['then'](handleEntityNotFound(_0x5f5b4b,null))[_0x8ff6('0x14')](function(_0x490b2e){if(_0x490b2e){_0x2eff36=_0x490b2e[_0x8ff6('0x37')]({'plain':!![]});_0x3403b4[_0x8ff6('0x28')]=_['keys'](db[_0x8ff6('0x40')][_0x8ff6('0x1e')]);_0x3403b4['query']=_[_0x8ff6('0x29')](_0x2d2b04[_0x8ff6('0x24')]);_0x3403b4[_0x8ff6('0x2a')]=_[_0x8ff6('0x2b')](_0x3403b4[_0x8ff6('0x28')],_0x3403b4['query']);_0x11129c[_0x8ff6('0x2d')]=_['intersection'](_0x3403b4[_0x8ff6('0x28')],qs[_0x8ff6('0x2c')](_0x2d2b04[_0x8ff6('0x24')][_0x8ff6('0x2c')]));_0x11129c[_0x8ff6('0x2d')]=_0x11129c['attributes']['length']?_0x11129c['attributes']:_0x3403b4[_0x8ff6('0x28')];if(!_0x2d2b04[_0x8ff6('0x24')][_0x8ff6('0x41')](_0x8ff6('0x42'))){_0x11129c[_0x8ff6('0x43')]=qs[_0x8ff6('0x43')](_0x2d2b04['query'][_0x8ff6('0x43')]);_0x11129c[_0x8ff6('0xf')]=qs[_0x8ff6('0xf')](_0x2d2b04[_0x8ff6('0x24')][_0x8ff6('0xf')]);}_0x11129c[_0x8ff6('0x44')]=qs['sort'](_0x2d2b04['query'][_0x8ff6('0x45')]);_0x11129c[_0x8ff6('0x22')]=qs[_0x8ff6('0x2a')](_[_0x8ff6('0x46')](_0x2d2b04[_0x8ff6('0x24')],_0x3403b4[_0x8ff6('0x2a')]));_0x11129c[_0x8ff6('0x22')][_0x8ff6('0x47')]=_0x490b2e['id'];if(_0x2d2b04[_0x8ff6('0x24')][_0x8ff6('0x48')]){_0x11129c[_0x8ff6('0x22')]=_['merge'](_0x11129c['where'],{'$or':_[_0x8ff6('0x1c')](_0x11129c[_0x8ff6('0x2d')],function(_0x5e92c4){var _0x2c9487={};_0x2c9487[_0x5e92c4]={'$like':'%'+_0x2d2b04[_0x8ff6('0x24')][_0x8ff6('0x48')]+'%'};return _0x2c9487;})});}_0x11129c=_['merge']({},_0x11129c,_0x2d2b04[_0x8ff6('0x31')]);return db[_0x8ff6('0x40')]['findAll'](_0x11129c);}})[_0x8ff6('0x14')](function(_0x4006f3){if(_0x4006f3){return db[_0x8ff6('0x49')]['findAndCountAll']({'where':{'id':_[_0x8ff6('0x1c')](_0x4006f3,'UserId'),'role':_0x8ff6('0x4a')},'attributes':['id',_0x8ff6('0x19'),_0x8ff6('0x4b'),_0x8ff6('0x4c'),_0x8ff6('0x4d')]});}})[_0x8ff6('0x14')](function(_0x3143b4){if(_0x3143b4){return{'count':_0x3143b4[_0x8ff6('0x11')],'rows':_['map'](_0x3143b4[_0x8ff6('0x26')],function(_0x3a74aa){return{'membername':_0x3a74aa[_0x8ff6('0x19')],'UserId':_0x3a74aa['id'],'queue_name':_0x2eff36['name'],'MailQueueId':_0x2eff36['id'],'interface':util[_0x8ff6('0x4e')](_0x8ff6('0x4f'),_0x8ff6('0x50'),_0x3a74aa[_0x8ff6('0x19')]),'penalty':0x0,'paused':_0x3a74aa['mailPause'],'createdAt':_0x3a74aa[_0x8ff6('0x4d')],'updatedAt':_0x3a74aa[_0x8ff6('0x4c')]};})};}else{return{'count':0x0,'rows':[]};}})[_0x8ff6('0x14')](respondWithFilteredResult(_0x5f5b4b,_0x11129c))['catch'](handleError(_0x5f5b4b,null));};exports[_0x8ff6('0x51')]=function(_0x3b4a21,_0x36ac83){var _0x7cdae3={};var _0x368f72={};var _0x2a7416;var _0x719561;return db[_0x8ff6('0x1d')]['findOne']({'where':{'id':_0x3b4a21['params']['id']}})['then'](handleEntityNotFound(_0x36ac83,null))['then'](function(_0x773888){if(_0x773888){_0x2a7416=_0x773888;_0x368f72['model']=_[_0x8ff6('0x29')](db[_0x8ff6('0x52')][_0x8ff6('0x1e')]);_0x368f72[_0x8ff6('0x24')]=_[_0x8ff6('0x29')](_0x3b4a21[_0x8ff6('0x24')]);_0x368f72[_0x8ff6('0x2a')]=_[_0x8ff6('0x2b')](_0x368f72[_0x8ff6('0x28')],_0x368f72[_0x8ff6('0x24')]);_0x7cdae3[_0x8ff6('0x2d')]=_[_0x8ff6('0x2b')](_0x368f72[_0x8ff6('0x28')],qs[_0x8ff6('0x2c')](_0x3b4a21[_0x8ff6('0x24')][_0x8ff6('0x2c')]));_0x7cdae3[_0x8ff6('0x2d')]=_0x7cdae3['attributes']['length']?_0x7cdae3[_0x8ff6('0x2d')]:_0x368f72['model'];_0x7cdae3['order']=qs[_0x8ff6('0x45')](_0x3b4a21[_0x8ff6('0x24')][_0x8ff6('0x45')]);_0x7cdae3[_0x8ff6('0x22')]=qs[_0x8ff6('0x2a')](_['pick'](_0x3b4a21['query'],_0x368f72[_0x8ff6('0x2a')]));if(_0x3b4a21[_0x8ff6('0x24')][_0x8ff6('0x48')]){_0x7cdae3[_0x8ff6('0x22')]=_[_0x8ff6('0x30')](_0x7cdae3['where'],{'$or':_[_0x8ff6('0x1c')](_0x7cdae3['attributes'],function(_0x1b53dd){var _0x4193cb={};_0x4193cb[_0x1b53dd]={'$like':'%'+_0x3b4a21[_0x8ff6('0x24')][_0x8ff6('0x48')]+'%'};return _0x4193cb;})});}_0x7cdae3=_[_0x8ff6('0x30')]({},_0x7cdae3,_0x3b4a21[_0x8ff6('0x31')]);return _0x2a7416[_0x8ff6('0x51')](_0x7cdae3);}})[_0x8ff6('0x14')](function(_0x339f8c){if(_0x339f8c){_0x719561=_0x339f8c[_0x8ff6('0x2e')];if(!_0x3b4a21['query'][_0x8ff6('0x41')](_0x8ff6('0x42'))){_0x7cdae3[_0x8ff6('0x43')]=qs[_0x8ff6('0x43')](_0x3b4a21['query']['limit']);_0x7cdae3[_0x8ff6('0xf')]=qs[_0x8ff6('0xf')](_0x3b4a21['query'][_0x8ff6('0xf')]);}return _0x2a7416['getTeams'](_0x7cdae3);}})[_0x8ff6('0x14')](function(_0x49d81d){if(_0x49d81d){return _0x49d81d?{'count':_0x719561,'rows':_0x49d81d}:null;}})[_0x8ff6('0x14')](respondWithResult(_0x36ac83,null))[_0x8ff6('0x33')](handleError(_0x36ac83,null));};exports['addTeams']=function(_0x286101,_0x56594c){var _0x3362b1=_0x286101[_0x8ff6('0x35')][_0x8ff6('0x53')];return db[_0x8ff6('0x52')]['findAll']({'where':{'id':_0x3362b1},'attributes':['id'],'include':[{'model':db['User'],'as':_0x8ff6('0x54'),'attributes':['id',_0x8ff6('0x19'),_0x8ff6('0x55'),_0x8ff6('0x56'),'interface'],'raw':!![]}]})[_0x8ff6('0x14')](function(_0x5d80e4){if(_0x5d80e4){var _0x58974e=_[_0x8ff6('0x57')](_0x5d80e4,function(_0x92f289){var _0x26067c=_0x92f289[_0x8ff6('0x37')]({'plain':!![]});return _0x26067c[_0x8ff6('0x54')];});return db[_0x8ff6('0x1d')][_0x8ff6('0x32')]({'where':{'id':_0x286101[_0x8ff6('0x3d')]['id']}})[_0x8ff6('0x14')](function(_0x4b17ae){return db[_0x8ff6('0x58')][_0x8ff6('0x59')](function(_0x3c62c8){return _0x4b17ae[_0x8ff6('0x5a')](_0x3362b1,{'transaction':_0x3c62c8})[_0x8ff6('0x14')](function(){return BPromise[_0x8ff6('0x5b')](_0x58974e,function(_0x519bad){return db[_0x8ff6('0x40')][_0x8ff6('0x5c')]({'where':{'UserId':_0x519bad['id'],'MailQueueId':_0x286101[_0x8ff6('0x3d')]['id']},'transaction':_0x3c62c8});});})[_0x8ff6('0x14')](function(){_0x58974e[_0x8ff6('0x5d')](function(_0x420c03){socket[_0x8ff6('0x5e')]('userMailQueue:save',{'UserId':_0x420c03['id'],'MailQueueId':_0x4b17ae['id']});});});});});}})[_0x8ff6('0x14')](respondWithStatusCode(_0x56594c,null))[_0x8ff6('0x33')](handleError(_0x56594c,null));};exports['removeTeams']=function(_0x54d3b4,_0x219bb1){return db[_0x8ff6('0x52')][_0x8ff6('0x25')]({'where':{'id':_0x54d3b4['query'][_0x8ff6('0x53')]},'attributes':['id'],'include':[{'model':db[_0x8ff6('0x49')],'as':'Agents','attributes':['id'],'raw':!![]}]})['then'](handleEntityNotFound(_0x219bb1,null))[_0x8ff6('0x14')](function(_0x28fad4){var _0x123cc6=_['map'](_0x28fad4,'id');var _0x2ea066=[];var _0x29d46a=[];var _0x278574=squel['select']();_0x278574[_0x8ff6('0x5f')](_0x8ff6('0x60'))['from']('team_has_mail_queues','tq')[_0x8ff6('0x61')](_0x8ff6('0x62'),'ut','ut.TeamId\x20=\x20tq.TeamId')['where'](_0x8ff6('0x63'),_0x54d3b4[_0x8ff6('0x3d')]['id']);for(var _0x357afb=0x0;_0x357afb<_0x28fad4[_0x8ff6('0x2e')];_0x357afb+=0x1){let _0x4247fd=_0x28fad4[_0x357afb];for(var _0x4d8453=0x0;_0x4d8453<_0x4247fd[_0x8ff6('0x54')][_0x8ff6('0x2e')];_0x4d8453+=0x1){let _0x33f1cc=_0x4247fd[_0x8ff6('0x54')][_0x4d8453];var _0x4a178d=_0x278574[_0x8ff6('0x64')]();_0x4a178d[_0x8ff6('0x22')]('ut.UserId\x20=\x20?',_0x33f1cc['id']);_0x29d46a[_0x8ff6('0x65')](db['sequelize'][_0x8ff6('0x24')](_0x4a178d[_0x8ff6('0x66')](),{'type':db[_0x8ff6('0x58')][_0x8ff6('0x67')][_0x8ff6('0x68')]})[_0x8ff6('0x14')](function(_0x179d72){if(_0x179d72['length']===0x1){return _0x33f1cc['id'];}else{var _0x51621a=_[_0x8ff6('0x69')](_[_0x8ff6('0x1c')](_0x179d72,_0x8ff6('0x6a')),function(_0x5e878f){return _[_0x8ff6('0x6b')](_0x123cc6,_0x5e878f);});if(_0x51621a){return _0x33f1cc['id'];}}}));}}return BPromise['all'](_0x29d46a)[_0x8ff6('0x14')](function(_0x5c88b4){_0x2ea066=_(_0x2ea066)[_0x8ff6('0x6c')](_0x5c88b4)[_0x8ff6('0x6d')]()['value']();return db[_0x8ff6('0x1d')]['find']({'where':{'id':_0x54d3b4[_0x8ff6('0x3d')]['id']}})['then'](function(_0x23fb4f){return db[_0x8ff6('0x58')]['transaction'](function(_0x4a679){return _0x23fb4f[_0x8ff6('0x6e')](_0x54d3b4['query'][_0x8ff6('0x53')],{'transaction':_0x4a679})[_0x8ff6('0x14')](function(){if(!_[_0x8ff6('0x6f')](_0x2ea066)){return _0x23fb4f['removeAgents'](_0x2ea066,{'transaction':_0x4a679});}})['then'](function(){_0x2ea066[_0x8ff6('0x5d')](function(_0x203784){socket[_0x8ff6('0x5e')](_0x8ff6('0x70'),{'UserId':_0x203784,'MailQueueId':_0x23fb4f['id']});});});});});});})[_0x8ff6('0x14')](respondWithStatusCode(_0x219bb1,null))['catch'](handleError(_0x219bb1,null));};exports[_0x8ff6('0x71')]=function(_0x5e0b19,_0x1b2702){return db[_0x8ff6('0x1d')]['find']({'where':{'id':_0x5e0b19[_0x8ff6('0x3d')]['id']}})[_0x8ff6('0x14')](handleEntityNotFound(_0x1b2702,null))[_0x8ff6('0x14')](function(_0x1699e2){if(_0x1699e2){return _0x1699e2[_0x8ff6('0x71')](_0x5e0b19[_0x8ff6('0x35')][_0x8ff6('0x53')],_[_0x8ff6('0x72')](_0x5e0b19[_0x8ff6('0x35')],[_0x8ff6('0x53'),'id'])||{})[_0x8ff6('0x73')](function(_0x190e5e){for(var _0x1231bf=0x0;_0x1231bf<_0x5e0b19[_0x8ff6('0x35')][_0x8ff6('0x53')][_0x8ff6('0x2e')];_0x1231bf+=0x1){socket['emit'](_0x8ff6('0x74'),{'UserId':Number(_0x5e0b19[_0x8ff6('0x35')]['ids'][_0x1231bf]),'MailQueueId':Number(_0x5e0b19[_0x8ff6('0x3d')]['id'])});}return _0x190e5e;});}})[_0x8ff6('0x14')](respondWithResult(_0x1b2702,null))[_0x8ff6('0x33')](handleError(_0x1b2702,null));};exports[_0x8ff6('0x75')]=function(_0x49a532,_0x4af981){return db[_0x8ff6('0x1d')][_0x8ff6('0x32')]({'where':{'id':_0x49a532[_0x8ff6('0x3d')]['id']}})[_0x8ff6('0x14')](handleEntityNotFound(_0x4af981,null))[_0x8ff6('0x14')](function(_0x36e140){if(_0x36e140){return _0x36e140[_0x8ff6('0x75')](_0x49a532[_0x8ff6('0x24')][_0x8ff6('0x53')])[_0x8ff6('0x14')](function(){if(_[_0x8ff6('0x76')](_0x49a532[_0x8ff6('0x24')]['ids'])){for(var _0x5d706e=0x0;_0x5d706e<_0x49a532[_0x8ff6('0x24')][_0x8ff6('0x53')][_0x8ff6('0x2e')];_0x5d706e+=0x1){socket['emit'](_0x8ff6('0x70'),{'UserId':Number(_0x49a532[_0x8ff6('0x24')][_0x8ff6('0x53')][_0x5d706e]),'MailQueueId':Number(_0x49a532[_0x8ff6('0x3d')]['id'])});}}else{socket['emit'](_0x8ff6('0x70'),{'UserId':Number(_0x49a532['query'][_0x8ff6('0x53')]),'MailQueueId':Number(_0x49a532['params']['id'])});}});}})[_0x8ff6('0x14')](respondWithStatusCode(_0x4af981,null))[_0x8ff6('0x33')](handleError(_0x4af981,null));};exports[_0x8ff6('0x77')]=function(_0x114385,_0x813212){var _0xcbd975={};var _0x2af35b={};var _0x1f9160;var _0x11ce0d;return db[_0x8ff6('0x1d')][_0x8ff6('0x3f')]({'where':{'id':_0x114385['params']['id']}})[_0x8ff6('0x14')](handleEntityNotFound(_0x813212,null))[_0x8ff6('0x14')](function(_0x2ef2df){if(_0x2ef2df){_0x1f9160=_0x2ef2df;_0x2af35b[_0x8ff6('0x28')]=_['keys'](db[_0x8ff6('0x49')][_0x8ff6('0x1e')]);_0x2af35b[_0x8ff6('0x24')]=_['keys'](_0x114385[_0x8ff6('0x24')]);_0x2af35b['filters']=_['intersection'](_0x2af35b[_0x8ff6('0x28')],_0x2af35b['query']);_0xcbd975['attributes']=_['intersection'](_0x2af35b[_0x8ff6('0x28')],qs[_0x8ff6('0x2c')](_0x114385[_0x8ff6('0x24')][_0x8ff6('0x2c')]));_0xcbd975[_0x8ff6('0x2d')]=_0xcbd975['attributes'][_0x8ff6('0x2e')]?_0xcbd975['attributes']:_0x2af35b[_0x8ff6('0x28')];_0xcbd975[_0x8ff6('0x44')]=qs['sort'](_0x114385[_0x8ff6('0x24')][_0x8ff6('0x45')]);_0xcbd975['where']=qs[_0x8ff6('0x2a')](_[_0x8ff6('0x46')](_0x114385['query'],_0x2af35b[_0x8ff6('0x2a')]));if(_0x114385[_0x8ff6('0x24')][_0x8ff6('0x48')]){_0xcbd975[_0x8ff6('0x22')]=_[_0x8ff6('0x30')](_0xcbd975[_0x8ff6('0x22')],{'$or':_[_0x8ff6('0x1c')](_0xcbd975['attributes'],function(_0x41ea45){var _0xc358cd={};_0xc358cd[_0x41ea45]={'$like':'%'+_0x114385[_0x8ff6('0x24')][_0x8ff6('0x48')]+'%'};return _0xc358cd;})});}_0xcbd975=_[_0x8ff6('0x30')]({},_0xcbd975,_0x114385[_0x8ff6('0x31')]);return _0x1f9160['getAgents'](_0xcbd975);}})[_0x8ff6('0x14')](function(_0x250887){if(_0x250887){_0x11ce0d=_0x250887[_0x8ff6('0x2e')];if(!_0x114385[_0x8ff6('0x24')][_0x8ff6('0x41')](_0x8ff6('0x42'))){_0xcbd975[_0x8ff6('0x43')]=qs[_0x8ff6('0x43')](_0x114385[_0x8ff6('0x24')][_0x8ff6('0x43')]);_0xcbd975['offset']=qs[_0x8ff6('0xf')](_0x114385[_0x8ff6('0x24')][_0x8ff6('0xf')]);}return _0x1f9160[_0x8ff6('0x77')](_0xcbd975);}})['then'](function(_0x55518b){if(_0x55518b){return _0x55518b?{'count':_0x11ce0d,'rows':_0x55518b}:null;}})[_0x8ff6('0x14')](respondWithResult(_0x813212,null))[_0x8ff6('0x33')](handleError(_0x813212,null));}; \ No newline at end of file +var _0x1dd7=['UserId','agent','mailPause','updatedAt','createdAt','rows','%s/%s','SIP','getTeams','Team','ids','online','voicePause','interface','flatMap','Agents','sequelize','transaction','each','findOrCreate','forEach','emit','select','field','tq.TeamId','from','team_has_mail_queues','join','ut.TeamId\x20=\x20tq.TeamId','MailQueueId\x20=\x20?','ut.UserId\x20=\x20?','push','QueryTypes','SELECT','every','TeamId','includes','all','union','compact','removeTeams','isEmpty','removeAgents','userMailQueue:remove','addAgents','omit','spread','userMailQueue:save','isArray','getAgents','bluebird','util','lodash','ioredis','api','../../config/environment','../../mysqldb','redis','defaults','socket.io-emitter','./mailQueue.socket','register','sendStatus','end','status','offset','undefined','limit','count','set','json','update','destroy','then','get','MailQueues','stack','name','send','index','MailQueue','rawAttributes','type','key','getOptions','where','include','query','findAll','catch','show','model','keys','filters','intersection','attributes','fields','length','options','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileSection','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','params','describe','getMembers','findOne','UserMailQueue','hasOwnProperty','nolimit','order','sort','pick','filter','merge','User','map'];(function(_0x3c5e98,_0x597783){var _0x36e11f=function(_0xd209d3){while(--_0xd209d3){_0x3c5e98['push'](_0x3c5e98['shift']());}};_0x36e11f(++_0x597783);}(_0x1dd7,0x19d));var _0x71dd=function(_0x5ec453,_0x30b0ba){_0x5ec453=_0x5ec453-0x0;var _0x25548f=_0x1dd7[_0x5ec453];return _0x25548f;};'use strict';var BPromise=require(_0x71dd('0x0'));var util=require(_0x71dd('0x1'));var _=require(_0x71dd('0x2'));var squel=require('squel');var Redis=require(_0x71dd('0x3'));var qs=require('../../components/parsers/qs');var logger=require('../../config/logger')(_0x71dd('0x4'));var config=require(_0x71dd('0x5'));var db=require(_0x71dd('0x6'))['db'];config[_0x71dd('0x7')]=_[_0x71dd('0x8')](config[_0x71dd('0x7')],{'host':'localhost','port':0x18eb});var socket=require(_0x71dd('0x9'))(new Redis(config[_0x71dd('0x7')]));require(_0x71dd('0xa'))[_0x71dd('0xb')](socket);function respondWithStatusCode(_0x2234b7,_0x228432){_0x228432=_0x228432||0xcc;return function(_0x42ffe6){if(_0x42ffe6){return _0x2234b7[_0x71dd('0xc')](_0x228432);}return _0x2234b7['status'](_0x228432)[_0x71dd('0xd')]();};}function respondWithResult(_0x2bad08,_0x5dc6d5){_0x5dc6d5=_0x5dc6d5||0xc8;return function(_0x513938){if(_0x513938){return _0x2bad08[_0x71dd('0xe')](_0x5dc6d5)['json'](_0x513938);}};}function respondWithFilteredResult(_0x57440c,_0x11adc6){return function(_0x4c0dea){if(_0x4c0dea){var _0x21e2a2=typeof _0x11adc6[_0x71dd('0xf')]===_0x71dd('0x10')&&typeof _0x11adc6[_0x71dd('0x11')]==='undefined';var _0x124988=_0x4c0dea[_0x71dd('0x12')];var _0x3dc9c7=_0x21e2a2?0x0:_0x11adc6[_0x71dd('0xf')];var _0x483750=_0x21e2a2?_0x4c0dea[_0x71dd('0x12')]:_0x11adc6[_0x71dd('0xf')]+_0x11adc6[_0x71dd('0x11')];var _0x4027f9;if(_0x483750>=_0x124988){_0x483750=_0x124988;_0x4027f9=0xc8;}else{_0x4027f9=0xce;}_0x57440c['status'](_0x4027f9);return _0x57440c[_0x71dd('0x13')]('Content-Range',_0x3dc9c7+'-'+_0x483750+'/'+_0x124988)[_0x71dd('0x14')](_0x4c0dea);}return null;};}function saveUpdates(_0xb1968e){return function(_0x37269e){if(_0x37269e){return _0x37269e[_0x71dd('0x15')](_0xb1968e)['then'](function(_0x121124){return _0x121124;});}return null;};}function removeEntity(_0x52c636){return function(_0x395a1d){if(_0x395a1d){return _0x395a1d[_0x71dd('0x16')]()[_0x71dd('0x17')](function(){var _0x967bc3=_0x395a1d[_0x71dd('0x18')]({'plain':!![]});var _0x11cc33=_0x71dd('0x19');return db['UserProfileResource'][_0x71dd('0x16')]({'where':{'type':_0x11cc33,'resourceId':_0x967bc3['id']}})[_0x71dd('0x17')](function(){return _0x395a1d;});})['then'](function(){_0x52c636['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x36ba61){return function(_0x440b12){if(!_0x440b12){_0x36ba61[_0x71dd('0xc')](0x194);}return _0x440b12;};}function handleError(_0x547d61,_0x811590){_0x811590=_0x811590||0x1f4;return function(_0xf11e18){logger['error'](_0xf11e18[_0x71dd('0x1a')]);if(_0xf11e18[_0x71dd('0x1b')]){delete _0xf11e18[_0x71dd('0x1b')];}_0x547d61[_0x71dd('0xe')](_0x811590)[_0x71dd('0x1c')](_0xf11e18);};}exports[_0x71dd('0x1d')]=function(_0x3e542d,_0x40a72a){var _0x310abe={};var _0x29623f={'count':0x0,'rows':[]};var _0x4643f1=_['map'](db[_0x71dd('0x1e')][_0x71dd('0x1f')],function(_0x12f876){return{'name':_0x12f876['fieldName'],'type':_0x12f876[_0x71dd('0x20')][_0x71dd('0x21')]};});_0x310abe=qs[_0x71dd('0x22')](_0x4643f1,_0x3e542d);var _0xda0996={'where':_0x310abe[_0x71dd('0x23')]};return db[_0x71dd('0x1e')][_0x71dd('0x12')](_0xda0996)[_0x71dd('0x17')](function(_0x315e7f){_0x29623f['count']=_0x315e7f;_0x310abe[_0x71dd('0x24')]=qs[_0x71dd('0x24')](_0x3e542d[_0x71dd('0x25')]);return db['MailQueue'][_0x71dd('0x26')](_0x310abe);})[_0x71dd('0x17')](function(_0x1c5000){_0x29623f['rows']=_0x1c5000;return _0x29623f;})['then'](respondWithFilteredResult(_0x40a72a,_0x310abe))[_0x71dd('0x27')](handleError(_0x40a72a,null));};exports[_0x71dd('0x28')]=function(_0x3d5292,_0x271893){var _0x332223={'raw':!![],'where':{'id':_0x3d5292['params']['id']}},_0x2c84af={};_0x2c84af[_0x71dd('0x29')]=_['keys'](db[_0x71dd('0x1e')]['rawAttributes']);_0x2c84af[_0x71dd('0x25')]=_[_0x71dd('0x2a')](_0x3d5292[_0x71dd('0x25')]);_0x2c84af[_0x71dd('0x2b')]=_[_0x71dd('0x2c')](_0x2c84af[_0x71dd('0x29')],_0x2c84af[_0x71dd('0x25')]);_0x332223[_0x71dd('0x2d')]=_[_0x71dd('0x2c')](_0x2c84af['model'],qs[_0x71dd('0x2e')](_0x3d5292['query'][_0x71dd('0x2e')]));_0x332223[_0x71dd('0x2d')]=_0x332223[_0x71dd('0x2d')][_0x71dd('0x2f')]?_0x332223[_0x71dd('0x2d')]:_0x2c84af['model'];if(_0x3d5292['query']['includeAll']){_0x332223['include']=[{'all':!![]}];}_0x332223=_['merge']({},_0x332223,_0x3d5292[_0x71dd('0x30')]);return db[_0x71dd('0x1e')][_0x71dd('0x31')](_0x332223)[_0x71dd('0x17')](handleEntityNotFound(_0x271893,null))['then'](respondWithResult(_0x271893,null))['catch'](handleError(_0x271893,null));};exports[_0x71dd('0x32')]=function(_0x5c3729,_0x4b6a0b){return db[_0x71dd('0x1e')]['create'](_0x5c3729[_0x71dd('0x33')],{})[_0x71dd('0x17')](function(_0x341946){var _0x899366=_0x5c3729[_0x71dd('0x34')][_0x71dd('0x18')]({'plain':!![]});if(!_0x899366)throw new Error(_0x71dd('0x35'));if(_0x899366['role']===_0x71dd('0x34')){var _0x353252=_0x341946['get']({'plain':!![]});var _0x14adcd=_0x71dd('0x19');return db[_0x71dd('0x36')][_0x71dd('0x31')]({'where':{'name':_0x14adcd,'userProfileId':_0x899366['userProfileId']},'raw':!![]})[_0x71dd('0x17')](function(_0x160382){if(_0x160382&&_0x160382['autoAssociation']===0x0){return db[_0x71dd('0x37')][_0x71dd('0x32')]({'name':_0x353252[_0x71dd('0x1b')],'resourceId':_0x353252['id'],'type':_0x160382['name'],'sectionId':_0x160382['id']},{})[_0x71dd('0x17')](function(){return _0x341946;});}else{return _0x341946;}})[_0x71dd('0x27')](function(_0x1b5009){logger['error'](_0x71dd('0x38'),_0x1b5009);throw _0x1b5009;});}return _0x341946;})[_0x71dd('0x17')](respondWithResult(_0x4b6a0b,0xc9))[_0x71dd('0x27')](handleError(_0x4b6a0b,null));};exports[_0x71dd('0x15')]=function(_0x32253f,_0x11d348){if(_0x32253f['body']['id']){delete _0x32253f[_0x71dd('0x33')]['id'];}return db[_0x71dd('0x1e')][_0x71dd('0x31')]({'where':{'id':_0x32253f[_0x71dd('0x39')]['id']}})[_0x71dd('0x17')](handleEntityNotFound(_0x11d348,null))[_0x71dd('0x17')](saveUpdates(_0x32253f[_0x71dd('0x33')],null))['then'](respondWithResult(_0x11d348,null))[_0x71dd('0x27')](handleError(_0x11d348,null));};exports['destroy']=function(_0x5c744f,_0x252f16){return db[_0x71dd('0x1e')][_0x71dd('0x31')]({'where':{'id':_0x5c744f[_0x71dd('0x39')]['id']}})[_0x71dd('0x17')](handleEntityNotFound(_0x252f16,null))['then'](removeEntity(_0x252f16,null))[_0x71dd('0x27')](handleError(_0x252f16,null));};exports['describe']=function(_0xb033b3,_0x58354f){return db[_0x71dd('0x1e')][_0x71dd('0x3a')]()[_0x71dd('0x17')](respondWithResult(_0x58354f,null))[_0x71dd('0x27')](handleError(_0x58354f,null));};exports[_0x71dd('0x3b')]=function(_0xcb701f,_0x5eb575){var _0x49d6c1={'raw':!![],'where':{}},_0x323a38={},_0x471779;return db[_0x71dd('0x1e')][_0x71dd('0x3c')]({'where':{'id':_0xcb701f[_0x71dd('0x39')]['id']}})[_0x71dd('0x17')](handleEntityNotFound(_0x5eb575,null))[_0x71dd('0x17')](function(_0x3d1c9f){if(_0x3d1c9f){_0x471779=_0x3d1c9f[_0x71dd('0x18')]({'plain':!![]});_0x323a38[_0x71dd('0x29')]=_[_0x71dd('0x2a')](db[_0x71dd('0x3d')]['rawAttributes']);_0x323a38['query']=_[_0x71dd('0x2a')](_0xcb701f[_0x71dd('0x25')]);_0x323a38['filters']=_[_0x71dd('0x2c')](_0x323a38[_0x71dd('0x29')],_0x323a38[_0x71dd('0x25')]);_0x49d6c1[_0x71dd('0x2d')]=_[_0x71dd('0x2c')](_0x323a38[_0x71dd('0x29')],qs['fields'](_0xcb701f['query'][_0x71dd('0x2e')]));_0x49d6c1['attributes']=_0x49d6c1[_0x71dd('0x2d')]['length']?_0x49d6c1[_0x71dd('0x2d')]:_0x323a38[_0x71dd('0x29')];if(!_0xcb701f[_0x71dd('0x25')][_0x71dd('0x3e')](_0x71dd('0x3f'))){_0x49d6c1[_0x71dd('0x11')]=qs['limit'](_0xcb701f[_0x71dd('0x25')][_0x71dd('0x11')]);_0x49d6c1[_0x71dd('0xf')]=qs['offset'](_0xcb701f['query'][_0x71dd('0xf')]);}_0x49d6c1[_0x71dd('0x40')]=qs['sort'](_0xcb701f[_0x71dd('0x25')][_0x71dd('0x41')]);_0x49d6c1[_0x71dd('0x23')]=qs[_0x71dd('0x2b')](_[_0x71dd('0x42')](_0xcb701f['query'],_0x323a38[_0x71dd('0x2b')]));_0x49d6c1[_0x71dd('0x23')]['MailQueueId']=_0x3d1c9f['id'];if(_0xcb701f[_0x71dd('0x25')][_0x71dd('0x43')]){_0x49d6c1['where']=_[_0x71dd('0x44')](_0x49d6c1[_0x71dd('0x23')],{'$or':_['map'](_0x49d6c1[_0x71dd('0x2d')],function(_0x323660){var _0x5ae47={};_0x5ae47[_0x323660]={'$like':'%'+_0xcb701f[_0x71dd('0x25')][_0x71dd('0x43')]+'%'};return _0x5ae47;})});}_0x49d6c1=_[_0x71dd('0x44')]({},_0x49d6c1,_0xcb701f['options']);return db[_0x71dd('0x3d')][_0x71dd('0x26')](_0x49d6c1);}})[_0x71dd('0x17')](function(_0x45d5d3){if(_0x45d5d3){return db[_0x71dd('0x45')]['findAndCountAll']({'where':{'id':_[_0x71dd('0x46')](_0x45d5d3,_0x71dd('0x47')),'role':_0x71dd('0x48')},'attributes':['id',_0x71dd('0x1b'),_0x71dd('0x49'),_0x71dd('0x4a'),_0x71dd('0x4b')]});}})[_0x71dd('0x17')](function(_0x329415){if(_0x329415){return{'count':_0x329415[_0x71dd('0x12')],'rows':_['map'](_0x329415[_0x71dd('0x4c')],function(_0x41a216){return{'membername':_0x41a216[_0x71dd('0x1b')],'UserId':_0x41a216['id'],'queue_name':_0x471779[_0x71dd('0x1b')],'MailQueueId':_0x471779['id'],'interface':util['format'](_0x71dd('0x4d'),_0x71dd('0x4e'),_0x41a216[_0x71dd('0x1b')]),'penalty':0x0,'paused':_0x41a216[_0x71dd('0x49')],'createdAt':_0x41a216[_0x71dd('0x4b')],'updatedAt':_0x41a216['updatedAt']};})};}else{return{'count':0x0,'rows':[]};}})[_0x71dd('0x17')](respondWithFilteredResult(_0x5eb575,_0x49d6c1))[_0x71dd('0x27')](handleError(_0x5eb575,null));};exports[_0x71dd('0x4f')]=function(_0x1b6831,_0x7b4a6c){var _0xceba01={};var _0x3f287a={};var _0x52046b;var _0xa72be3;return db[_0x71dd('0x1e')][_0x71dd('0x3c')]({'where':{'id':_0x1b6831[_0x71dd('0x39')]['id']}})[_0x71dd('0x17')](handleEntityNotFound(_0x7b4a6c,null))['then'](function(_0x5e81df){if(_0x5e81df){_0x52046b=_0x5e81df;_0x3f287a[_0x71dd('0x29')]=_[_0x71dd('0x2a')](db[_0x71dd('0x50')][_0x71dd('0x1f')]);_0x3f287a[_0x71dd('0x25')]=_['keys'](_0x1b6831[_0x71dd('0x25')]);_0x3f287a[_0x71dd('0x2b')]=_[_0x71dd('0x2c')](_0x3f287a[_0x71dd('0x29')],_0x3f287a[_0x71dd('0x25')]);_0xceba01[_0x71dd('0x2d')]=_[_0x71dd('0x2c')](_0x3f287a[_0x71dd('0x29')],qs[_0x71dd('0x2e')](_0x1b6831[_0x71dd('0x25')][_0x71dd('0x2e')]));_0xceba01[_0x71dd('0x2d')]=_0xceba01[_0x71dd('0x2d')][_0x71dd('0x2f')]?_0xceba01[_0x71dd('0x2d')]:_0x3f287a[_0x71dd('0x29')];_0xceba01[_0x71dd('0x40')]=qs['sort'](_0x1b6831[_0x71dd('0x25')][_0x71dd('0x41')]);_0xceba01[_0x71dd('0x23')]=qs[_0x71dd('0x2b')](_[_0x71dd('0x42')](_0x1b6831[_0x71dd('0x25')],_0x3f287a[_0x71dd('0x2b')]));if(_0x1b6831[_0x71dd('0x25')][_0x71dd('0x43')]){_0xceba01['where']=_['merge'](_0xceba01['where'],{'$or':_[_0x71dd('0x46')](_0xceba01['attributes'],function(_0x487a7){var _0x168fdf={};_0x168fdf[_0x487a7]={'$like':'%'+_0x1b6831[_0x71dd('0x25')][_0x71dd('0x43')]+'%'};return _0x168fdf;})});}_0xceba01=_[_0x71dd('0x44')]({},_0xceba01,_0x1b6831[_0x71dd('0x30')]);return _0x52046b[_0x71dd('0x4f')](_0xceba01);}})[_0x71dd('0x17')](function(_0x55c878){if(_0x55c878){_0xa72be3=_0x55c878[_0x71dd('0x2f')];if(!_0x1b6831[_0x71dd('0x25')][_0x71dd('0x3e')]('nolimit')){_0xceba01[_0x71dd('0x11')]=qs['limit'](_0x1b6831[_0x71dd('0x25')]['limit']);_0xceba01['offset']=qs['offset'](_0x1b6831[_0x71dd('0x25')][_0x71dd('0xf')]);}return _0x52046b[_0x71dd('0x4f')](_0xceba01);}})[_0x71dd('0x17')](function(_0x3f4dfe){if(_0x3f4dfe){return _0x3f4dfe?{'count':_0xa72be3,'rows':_0x3f4dfe}:null;}})[_0x71dd('0x17')](respondWithResult(_0x7b4a6c,null))['catch'](handleError(_0x7b4a6c,null));};exports['addTeams']=function(_0x59185c,_0x3ecbd5){var _0x4aaee2=_0x59185c[_0x71dd('0x33')][_0x71dd('0x51')];return db['Team'][_0x71dd('0x26')]({'where':{'id':_0x4aaee2},'attributes':['id'],'include':[{'model':db[_0x71dd('0x45')],'as':'Agents','attributes':['id',_0x71dd('0x1b'),_0x71dd('0x52'),_0x71dd('0x53'),_0x71dd('0x54')],'raw':!![]}]})['then'](function(_0x5c3e35){if(_0x5c3e35){var _0x25a3f2=_[_0x71dd('0x55')](_0x5c3e35,function(_0x27a7e9){var _0x3e5831=_0x27a7e9[_0x71dd('0x18')]({'plain':!![]});return _0x3e5831[_0x71dd('0x56')];});return db[_0x71dd('0x1e')][_0x71dd('0x31')]({'where':{'id':_0x59185c[_0x71dd('0x39')]['id']}})['then'](function(_0x18d995){return db[_0x71dd('0x57')][_0x71dd('0x58')](function(_0x46603f){return _0x18d995['addTeams'](_0x4aaee2,{'transaction':_0x46603f})[_0x71dd('0x17')](function(){return BPromise[_0x71dd('0x59')](_0x25a3f2,function(_0xae1daf){return db[_0x71dd('0x3d')][_0x71dd('0x5a')]({'where':{'UserId':_0xae1daf['id'],'MailQueueId':_0x59185c['params']['id']},'transaction':_0x46603f});});})[_0x71dd('0x17')](function(){_0x25a3f2[_0x71dd('0x5b')](function(_0x9320c2){socket[_0x71dd('0x5c')]('userMailQueue:save',{'UserId':_0x9320c2['id'],'MailQueueId':_0x18d995['id']});});});});});}})[_0x71dd('0x17')](respondWithStatusCode(_0x3ecbd5,null))[_0x71dd('0x27')](handleError(_0x3ecbd5,null));};exports['removeTeams']=function(_0xe34426,_0x4d31ca){return db[_0x71dd('0x50')][_0x71dd('0x26')]({'where':{'id':_0xe34426['query'][_0x71dd('0x51')]},'attributes':['id'],'include':[{'model':db[_0x71dd('0x45')],'as':'Agents','attributes':['id'],'raw':!![]}]})[_0x71dd('0x17')](handleEntityNotFound(_0x4d31ca,null))['then'](function(_0x2c05a7){var _0xf666d5=_[_0x71dd('0x46')](_0x2c05a7,'id');var _0xd5f3a1=[];var _0x1c2714=[];var _0x1fa207=squel[_0x71dd('0x5d')]();_0x1fa207[_0x71dd('0x5e')](_0x71dd('0x5f'))[_0x71dd('0x60')](_0x71dd('0x61'),'tq')[_0x71dd('0x62')]('user_has_teams','ut',_0x71dd('0x63'))[_0x71dd('0x23')](_0x71dd('0x64'),_0xe34426[_0x71dd('0x39')]['id']);for(var _0x3dc900=0x0;_0x3dc900<_0x2c05a7['length'];_0x3dc900+=0x1){let _0x3ddcc5=_0x2c05a7[_0x3dc900];for(var _0x399f9e=0x0;_0x399f9e<_0x3ddcc5['Agents'][_0x71dd('0x2f')];_0x399f9e+=0x1){let _0x19a1e9=_0x3ddcc5['Agents'][_0x399f9e];var _0x53b5ee=_0x1fa207['clone']();_0x53b5ee[_0x71dd('0x23')](_0x71dd('0x65'),_0x19a1e9['id']);_0x1c2714[_0x71dd('0x66')](db['sequelize']['query'](_0x53b5ee['toString'](),{'type':db['sequelize'][_0x71dd('0x67')][_0x71dd('0x68')]})['then'](function(_0x17b654){if(_0x17b654[_0x71dd('0x2f')]===0x1){return _0x19a1e9['id'];}else{var _0x299768=_[_0x71dd('0x69')](_[_0x71dd('0x46')](_0x17b654,_0x71dd('0x6a')),function(_0xc89ecd){return _[_0x71dd('0x6b')](_0xf666d5,_0xc89ecd);});if(_0x299768){return _0x19a1e9['id'];}}}));}}return BPromise[_0x71dd('0x6c')](_0x1c2714)[_0x71dd('0x17')](function(_0x2c834a){_0xd5f3a1=_(_0xd5f3a1)[_0x71dd('0x6d')](_0x2c834a)[_0x71dd('0x6e')]()['value']();return db[_0x71dd('0x1e')][_0x71dd('0x31')]({'where':{'id':_0xe34426[_0x71dd('0x39')]['id']}})[_0x71dd('0x17')](function(_0x45359b){return db[_0x71dd('0x57')]['transaction'](function(_0x3d5226){return _0x45359b[_0x71dd('0x6f')](_0xe34426[_0x71dd('0x25')]['ids'],{'transaction':_0x3d5226})[_0x71dd('0x17')](function(){if(!_[_0x71dd('0x70')](_0xd5f3a1)){return _0x45359b[_0x71dd('0x71')](_0xd5f3a1,{'transaction':_0x3d5226});}})[_0x71dd('0x17')](function(){_0xd5f3a1[_0x71dd('0x5b')](function(_0x5610e4){socket[_0x71dd('0x5c')](_0x71dd('0x72'),{'UserId':_0x5610e4,'MailQueueId':_0x45359b['id']});});});});});});})[_0x71dd('0x17')](respondWithStatusCode(_0x4d31ca,null))[_0x71dd('0x27')](handleError(_0x4d31ca,null));};exports[_0x71dd('0x73')]=function(_0x132507,_0x3fdfb2){return db[_0x71dd('0x1e')][_0x71dd('0x31')]({'where':{'id':_0x132507[_0x71dd('0x39')]['id']}})['then'](handleEntityNotFound(_0x3fdfb2,null))['then'](function(_0x39da98){if(_0x39da98){return _0x39da98[_0x71dd('0x73')](_0x132507[_0x71dd('0x33')][_0x71dd('0x51')],_[_0x71dd('0x74')](_0x132507[_0x71dd('0x33')],[_0x71dd('0x51'),'id'])||{})[_0x71dd('0x75')](function(_0x330ee2){for(var _0x2419fd=0x0;_0x2419fd<_0x132507[_0x71dd('0x33')][_0x71dd('0x51')][_0x71dd('0x2f')];_0x2419fd+=0x1){socket[_0x71dd('0x5c')](_0x71dd('0x76'),{'UserId':Number(_0x132507[_0x71dd('0x33')]['ids'][_0x2419fd]),'MailQueueId':Number(_0x132507[_0x71dd('0x39')]['id'])});}return _0x330ee2;});}})[_0x71dd('0x17')](respondWithResult(_0x3fdfb2,null))[_0x71dd('0x27')](handleError(_0x3fdfb2,null));};exports['removeAgents']=function(_0x23a570,_0x255574){return db[_0x71dd('0x1e')][_0x71dd('0x31')]({'where':{'id':_0x23a570[_0x71dd('0x39')]['id']}})['then'](handleEntityNotFound(_0x255574,null))[_0x71dd('0x17')](function(_0x2fab6b){if(_0x2fab6b){return _0x2fab6b['removeAgents'](_0x23a570[_0x71dd('0x25')][_0x71dd('0x51')])['then'](function(){if(_[_0x71dd('0x77')](_0x23a570[_0x71dd('0x25')]['ids'])){for(var _0x1bc59d=0x0;_0x1bc59d<_0x23a570[_0x71dd('0x25')][_0x71dd('0x51')][_0x71dd('0x2f')];_0x1bc59d+=0x1){socket[_0x71dd('0x5c')](_0x71dd('0x72'),{'UserId':Number(_0x23a570[_0x71dd('0x25')][_0x71dd('0x51')][_0x1bc59d]),'MailQueueId':Number(_0x23a570[_0x71dd('0x39')]['id'])});}}else{socket['emit'](_0x71dd('0x72'),{'UserId':Number(_0x23a570[_0x71dd('0x25')]['ids']),'MailQueueId':Number(_0x23a570[_0x71dd('0x39')]['id'])});}});}})[_0x71dd('0x17')](respondWithStatusCode(_0x255574,null))['catch'](handleError(_0x255574,null));};exports[_0x71dd('0x78')]=function(_0x497b8d,_0x40cdec){var _0x2b34ea={};var _0x30f98f={};var _0x25066c;var _0x31550e;return db[_0x71dd('0x1e')]['findOne']({'where':{'id':_0x497b8d[_0x71dd('0x39')]['id']}})[_0x71dd('0x17')](handleEntityNotFound(_0x40cdec,null))['then'](function(_0x8fd8ee){if(_0x8fd8ee){_0x25066c=_0x8fd8ee;_0x30f98f['model']=_['keys'](db[_0x71dd('0x45')][_0x71dd('0x1f')]);_0x30f98f[_0x71dd('0x25')]=_[_0x71dd('0x2a')](_0x497b8d[_0x71dd('0x25')]);_0x30f98f['filters']=_[_0x71dd('0x2c')](_0x30f98f[_0x71dd('0x29')],_0x30f98f['query']);_0x2b34ea[_0x71dd('0x2d')]=_[_0x71dd('0x2c')](_0x30f98f[_0x71dd('0x29')],qs[_0x71dd('0x2e')](_0x497b8d[_0x71dd('0x25')][_0x71dd('0x2e')]));_0x2b34ea[_0x71dd('0x2d')]=_0x2b34ea['attributes'][_0x71dd('0x2f')]?_0x2b34ea[_0x71dd('0x2d')]:_0x30f98f[_0x71dd('0x29')];_0x2b34ea[_0x71dd('0x40')]=qs[_0x71dd('0x41')](_0x497b8d[_0x71dd('0x25')][_0x71dd('0x41')]);_0x2b34ea[_0x71dd('0x23')]=qs['filters'](_[_0x71dd('0x42')](_0x497b8d['query'],_0x30f98f['filters']));if(_0x497b8d[_0x71dd('0x25')][_0x71dd('0x43')]){_0x2b34ea[_0x71dd('0x23')]=_[_0x71dd('0x44')](_0x2b34ea[_0x71dd('0x23')],{'$or':_[_0x71dd('0x46')](_0x2b34ea['attributes'],function(_0x56a617){var _0x301fc8={};_0x301fc8[_0x56a617]={'$like':'%'+_0x497b8d[_0x71dd('0x25')][_0x71dd('0x43')]+'%'};return _0x301fc8;})});}_0x2b34ea=_[_0x71dd('0x44')]({},_0x2b34ea,_0x497b8d[_0x71dd('0x30')]);return _0x25066c[_0x71dd('0x78')](_0x2b34ea);}})[_0x71dd('0x17')](function(_0x1e7f1d){if(_0x1e7f1d){_0x31550e=_0x1e7f1d[_0x71dd('0x2f')];if(!_0x497b8d['query'][_0x71dd('0x3e')]('nolimit')){_0x2b34ea[_0x71dd('0x11')]=qs[_0x71dd('0x11')](_0x497b8d[_0x71dd('0x25')][_0x71dd('0x11')]);_0x2b34ea[_0x71dd('0xf')]=qs[_0x71dd('0xf')](_0x497b8d[_0x71dd('0x25')][_0x71dd('0xf')]);}return _0x25066c[_0x71dd('0x78')](_0x2b34ea);}})[_0x71dd('0x17')](function(_0x3b256b){if(_0x3b256b){return _0x3b256b?{'count':_0x31550e,'rows':_0x3b256b}:null;}})['then'](respondWithResult(_0x40cdec,null))[_0x71dd('0x27')](handleError(_0x40cdec,null));}; \ No newline at end of file diff --git a/server/api/mailQueue/mailQueue.events.js b/server/api/mailQueue/mailQueue.events.js index e5f8a13..673c93a 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 _0xcf48=['exports','../../mysqldb','MailQueue','save','remove','emit','hook'];(function(_0x4fa4fd,_0x4c656b){var _0x3c50d0=function(_0x223600){while(--_0x223600){_0x4fa4fd['push'](_0x4fa4fd['shift']());}};_0x3c50d0(++_0x4c656b);}(_0xcf48,0x119));var _0x8cf4=function(_0x444353,_0x3c2897){_0x444353=_0x444353-0x0;var _0x397884=_0xcf48[_0x444353];return _0x397884;};'use strict';var EventEmitter=require('events');var MailQueue=require(_0x8cf4('0x0'))['db'][_0x8cf4('0x1')];var MailQueueEvents=new EventEmitter();MailQueueEvents['setMaxListeners'](0x0);var events={'afterCreate':_0x8cf4('0x2'),'afterUpdate':'update','afterDestroy':_0x8cf4('0x3')};function emitEvent(_0x23d28e){return function(_0x164e8d,_0x145eba,_0xaa3d96){MailQueueEvents[_0x8cf4('0x4')](_0x23d28e+':'+_0x164e8d['id'],_0x164e8d);MailQueueEvents['emit'](_0x23d28e,_0x164e8d);_0xaa3d96(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];MailQueue[_0x8cf4('0x5')](e,emitEvent(event));}}module[_0x8cf4('0x6')]=MailQueueEvents; \ No newline at end of file +var _0x0670=['setMaxListeners','save','remove','emit','hasOwnProperty','exports','events'];(function(_0x2b7764,_0x2606f1){var _0x848dcb=function(_0x1ae85b){while(--_0x1ae85b){_0x2b7764['push'](_0x2b7764['shift']());}};_0x848dcb(++_0x2606f1);}(_0x0670,0x76));var _0x0067=function(_0x49aa7d,_0x5d46d8){_0x49aa7d=_0x49aa7d-0x0;var _0xdd0d26=_0x0670[_0x49aa7d];return _0xdd0d26;};'use strict';var EventEmitter=require(_0x0067('0x0'));var MailQueue=require('../../mysqldb')['db']['MailQueue'];var MailQueueEvents=new EventEmitter();MailQueueEvents[_0x0067('0x1')](0x0);var events={'afterCreate':_0x0067('0x2'),'afterUpdate':'update','afterDestroy':_0x0067('0x3')};function emitEvent(_0x22a89d){return function(_0x1f914b,_0x378239,_0x3af8f4){MailQueueEvents[_0x0067('0x4')](_0x22a89d+':'+_0x1f914b['id'],_0x1f914b);MailQueueEvents[_0x0067('0x4')](_0x22a89d,_0x1f914b);_0x3af8f4(null);};}for(var e in events){if(events[_0x0067('0x5')](e)){var event=events[e];MailQueue['hook'](e,emitEvent(event));}}module[_0x0067('0x6')]=MailQueueEvents; \ No newline at end of file diff --git a/server/api/mailQueue/mailQueue.model.js b/server/api/mailQueue/mailQueue.model.js index cef8682..fb60235 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 _0x94b0=['moment','bluebird','rimraf','../../config/environment','./mailQueue.attributes','define','mail_queues','lodash','../../config/logger','api'];(function(_0x4e6f9f,_0x1a9c5a){var _0x3a4bd9=function(_0x42f509){while(--_0x42f509){_0x4e6f9f['push'](_0x4e6f9f['shift']());}};_0x3a4bd9(++_0x1a9c5a);}(_0x94b0,0x183));var _0x094b=function(_0x3094e9,_0xc47d36){_0x3094e9=_0x3094e9-0x0;var _0x49b1e0=_0x94b0[_0x3094e9];return _0x49b1e0;};'use strict';var _=require(_0x094b('0x0'));var util=require('util');var logger=require(_0x094b('0x1'))(_0x094b('0x2'));var moment=require(_0x094b('0x3'));var BPromise=require(_0x094b('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0x094b('0x5'));var config=require(_0x094b('0x6'));var attributes=require(_0x094b('0x7'));module['exports']=function(_0x18eddd,_0x42fb06){return _0x18eddd[_0x094b('0x8')]('MailQueue',attributes,{'tableName':_0x094b('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xaea1=['mail_queues','lodash','../../config/logger','moment','bluebird','request-promise','rimraf','../../config/environment','define','MailQueue'];(function(_0x2939da,_0x238508){var _0x386e53=function(_0x338e11){while(--_0x338e11){_0x2939da['push'](_0x2939da['shift']());}};_0x386e53(++_0x238508);}(_0xaea1,0x12d));var _0x1aea=function(_0x501510,_0x61caa9){_0x501510=_0x501510-0x0;var _0x1e6ee5=_0xaea1[_0x501510];return _0x1e6ee5;};'use strict';var _=require(_0x1aea('0x0'));var util=require('util');var logger=require(_0x1aea('0x1'))('api');var moment=require(_0x1aea('0x2'));var BPromise=require(_0x1aea('0x3'));var rp=require(_0x1aea('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0x1aea('0x5'));var config=require(_0x1aea('0x6'));var attributes=require('./mailQueue.attributes');module['exports']=function(_0x3710fb,_0xdc453f){return _0x3710fb[_0x1aea('0x7')](_0x1aea('0x8'),attributes,{'tableName':_0x1aea('0x9'),'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 3819ffe..24b0c8c 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 _0x16bf=['message','result','catch','GetMailQueue','findAll','options','raw','attributes','limit','map','include','model','ShowMailQueue','MailQueue','find','where','util','bluebird','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','redis','defaults','localhost','socket.io-emitter','./mailQueue.socket','register','then','info','MailQueue,\x20%s,\x20%s','request\x20sent','debug','MailQueue,\x20%s,\x20%s,\x20%s','stringify','error','code'];(function(_0x3a9f32,_0x3092f4){var _0x473794=function(_0x5e0e8e){while(--_0x5e0e8e){_0x3a9f32['push'](_0x3a9f32['shift']());}};_0x473794(++_0x3092f4);}(_0x16bf,0x178));var _0xf16b=function(_0x22d21b,_0x1da63c){_0x22d21b=_0x22d21b-0x0;var _0x124785=_0x16bf[_0x22d21b];return _0x124785;};'use strict';var _=require('lodash');var util=require(_0xf16b('0x0'));var moment=require('moment');var BPromise=require(_0xf16b('0x1'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xf16b('0x2'));var db=require(_0xf16b('0x3'))['db'];var utils=require('../../config/utils');var logger=require(_0xf16b('0x4'))(_0xf16b('0x5'));var config=require(_0xf16b('0x6'));var jayson=require(_0xf16b('0x7'));var client=jayson[_0xf16b('0x8')]['http']({'port':0x232a});config[_0xf16b('0x9')]=_[_0xf16b('0xa')](config['redis'],{'host':_0xf16b('0xb'),'port':0x18eb});var socket=require(_0xf16b('0xc'))(new Redis(config[_0xf16b('0x9')]));require(_0xf16b('0xd'))[_0xf16b('0xe')](socket);function respondWithRpcPromise(_0x539f86,_0x2f1b6b,_0xf1934e){return new BPromise(function(_0x42ddec,_0x12387f){return client['request'](_0x539f86,_0xf1934e)[_0xf16b('0xf')](function(_0x11eaf4){logger[_0xf16b('0x10')](_0xf16b('0x11'),_0x2f1b6b,_0xf16b('0x12'));logger[_0xf16b('0x13')](_0xf16b('0x14'),_0x2f1b6b,'request\x20sent',JSON[_0xf16b('0x15')](_0x11eaf4));if(_0x11eaf4[_0xf16b('0x16')]){if(_0x11eaf4['error'][_0xf16b('0x17')]===0x1f4){logger[_0xf16b('0x16')]('MailQueue,\x20%s,\x20%s',_0x2f1b6b,_0x11eaf4['error'][_0xf16b('0x18')]);return _0x12387f(_0x11eaf4['error'][_0xf16b('0x18')]);}logger[_0xf16b('0x16')](_0xf16b('0x11'),_0x2f1b6b,_0x11eaf4[_0xf16b('0x16')][_0xf16b('0x18')]);return _0x42ddec(_0x11eaf4['error']['message']);}else{logger['info'](_0xf16b('0x11'),_0x2f1b6b,_0xf16b('0x12'));_0x42ddec(_0x11eaf4[_0xf16b('0x19')][_0xf16b('0x18')]);}})[_0xf16b('0x1a')](function(_0xb313ca){logger['error']('MailQueue,\x20%s,\x20%s',_0x2f1b6b,_0xb313ca);_0x12387f(_0xb313ca);});});}exports[_0xf16b('0x1b')]=function(_0x5a5340){var _0x3f314a=this;return new Promise(function(_0x461d34,_0x349f22){return db['MailQueue'][_0xf16b('0x1c')]({'raw':_0x5a5340[_0xf16b('0x1d')]?_0x5a5340['options'][_0xf16b('0x1e')]===undefined?!![]:![]:!![],'where':_0x5a5340['options']?_0x5a5340[_0xf16b('0x1d')]['where']||null:null,'attributes':_0x5a5340[_0xf16b('0x1d')]?_0x5a5340[_0xf16b('0x1d')][_0xf16b('0x1f')]||null:null,'limit':_0x5a5340['options']?_0x5a5340['options'][_0xf16b('0x20')]||null:null,'include':_0x5a5340[_0xf16b('0x1d')]?_0x5a5340[_0xf16b('0x1d')]['include']?_[_0xf16b('0x21')](_0x5a5340[_0xf16b('0x1d')][_0xf16b('0x22')],function(_0x2e4e83){return{'model':db[_0x2e4e83[_0xf16b('0x23')]],'as':_0x2e4e83['as'],'attributes':_0x2e4e83[_0xf16b('0x1f')],'include':_0x2e4e83['include']?_['map'](_0x2e4e83[_0xf16b('0x22')],function(_0x45f409){return{'model':db[_0x45f409[_0xf16b('0x23')]],'as':_0x45f409['as'],'attributes':_0x45f409[_0xf16b('0x1f')],'include':_0x45f409[_0xf16b('0x22')]?_['map'](_0x45f409[_0xf16b('0x22')],function(_0x138d1a){return{'model':db[_0x138d1a['model']],'as':_0x138d1a['as'],'attributes':_0x138d1a[_0xf16b('0x1f')]};}):[]};}):[]};}):[]:[]})[_0xf16b('0xf')](function(_0x54b4d7){logger[_0xf16b('0x10')](_0xf16b('0x1b'),_0x5a5340);logger[_0xf16b('0x13')](_0xf16b('0x1b'),_0x5a5340,JSON[_0xf16b('0x15')](_0x54b4d7));_0x461d34(_0x54b4d7);})[_0xf16b('0x1a')](function(_0x4601e8){logger['error'](_0xf16b('0x1b'),_0x4601e8[_0xf16b('0x18')],_0x5a5340);_0x349f22(_0x3f314a[_0xf16b('0x16')](0x1f4,_0x4601e8[_0xf16b('0x18')]));});});};exports[_0xf16b('0x24')]=function(_0x34b50c){var _0x4663b5=this;return new Promise(function(_0x232d3c,_0x2f980f){return db[_0xf16b('0x25')][_0xf16b('0x26')]({'raw':_0x34b50c['options']?_0x34b50c[_0xf16b('0x1d')][_0xf16b('0x1e')]===undefined?!![]:![]:!![],'where':_0x34b50c[_0xf16b('0x1d')]?_0x34b50c[_0xf16b('0x1d')][_0xf16b('0x27')]||null:null,'attributes':_0x34b50c['options']?_0x34b50c[_0xf16b('0x1d')]['attributes']||null:null,'include':_0x34b50c[_0xf16b('0x1d')]?_0x34b50c['options'][_0xf16b('0x22')]?_[_0xf16b('0x21')](_0x34b50c['options'][_0xf16b('0x22')],function(_0x19af0f){return{'model':db[_0x19af0f[_0xf16b('0x23')]],'as':_0x19af0f['as'],'attributes':_0x19af0f[_0xf16b('0x1f')],'include':_0x19af0f[_0xf16b('0x22')]?_[_0xf16b('0x21')](_0x19af0f[_0xf16b('0x22')],function(_0x1ef999){return{'model':db[_0x1ef999['model']],'as':_0x1ef999['as'],'attributes':_0x1ef999[_0xf16b('0x1f')],'include':_0x1ef999[_0xf16b('0x22')]?_[_0xf16b('0x21')](_0x1ef999[_0xf16b('0x22')],function(_0x1b759c){return{'model':db[_0x1b759c[_0xf16b('0x23')]],'as':_0x1b759c['as'],'attributes':_0x1b759c['attributes']};}):[]};}):[]};}):[]:[]})['then'](function(_0x53600d){logger[_0xf16b('0x10')](_0xf16b('0x24'),_0x34b50c);logger[_0xf16b('0x13')]('ShowMailQueue',_0x34b50c,JSON[_0xf16b('0x15')](_0x53600d));_0x232d3c(_0x53600d);})['catch'](function(_0x350829){logger[_0xf16b('0x16')](_0xf16b('0x24'),_0x350829[_0xf16b('0x18')],_0x34b50c);_0x2f980f(_0x4663b5['error'](0x1f4,_0x350829['message']));});});}; \ No newline at end of file +var _0x7bad=['MailQueue,\x20%s,\x20%s,\x20%s','error','code','message','catch','GetMailQueue','MailQueue','options','raw','where','attributes','limit','include','map','model','stringify','ShowMailQueue','find','lodash','moment','randomstring','ioredis','../../config/utils','../../config/logger','../../config/environment','jayson/promise','http','defaults','redis','socket.io-emitter','./mailQueue.socket','register','then','info','MailQueue,\x20%s,\x20%s','request\x20sent','debug'];(function(_0x227cfb,_0x4f42cf){var _0x131407=function(_0x37ddbb){while(--_0x37ddbb){_0x227cfb['push'](_0x227cfb['shift']());}};_0x131407(++_0x4f42cf);}(_0x7bad,0x1f3));var _0xd7ba=function(_0x2534b5,_0x46d576){_0x2534b5=_0x2534b5-0x0;var _0x58212c=_0x7bad[_0x2534b5];return _0x58212c;};'use strict';var _=require(_0xd7ba('0x0'));var util=require('util');var moment=require(_0xd7ba('0x1'));var BPromise=require('bluebird');var rs=require(_0xd7ba('0x2'));var fs=require('fs');var Redis=require(_0xd7ba('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0xd7ba('0x4'));var logger=require(_0xd7ba('0x5'))('rpc');var config=require(_0xd7ba('0x6'));var jayson=require(_0xd7ba('0x7'));var client=jayson['client'][_0xd7ba('0x8')]({'port':0x232a});config['redis']=_[_0xd7ba('0x9')](config[_0xd7ba('0xa')],{'host':'localhost','port':0x18eb});var socket=require(_0xd7ba('0xb'))(new Redis(config[_0xd7ba('0xa')]));require(_0xd7ba('0xc'))[_0xd7ba('0xd')](socket);function respondWithRpcPromise(_0x2a65d9,_0x719bc4,_0x5df34b){return new BPromise(function(_0x56c80b,_0x2c81e7){return client['request'](_0x2a65d9,_0x5df34b)[_0xd7ba('0xe')](function(_0x4e659d){logger[_0xd7ba('0xf')](_0xd7ba('0x10'),_0x719bc4,_0xd7ba('0x11'));logger[_0xd7ba('0x12')](_0xd7ba('0x13'),_0x719bc4,_0xd7ba('0x11'),JSON['stringify'](_0x4e659d));if(_0x4e659d[_0xd7ba('0x14')]){if(_0x4e659d[_0xd7ba('0x14')][_0xd7ba('0x15')]===0x1f4){logger['error']('MailQueue,\x20%s,\x20%s',_0x719bc4,_0x4e659d['error'][_0xd7ba('0x16')]);return _0x2c81e7(_0x4e659d['error'][_0xd7ba('0x16')]);}logger[_0xd7ba('0x14')](_0xd7ba('0x10'),_0x719bc4,_0x4e659d[_0xd7ba('0x14')][_0xd7ba('0x16')]);return _0x56c80b(_0x4e659d[_0xd7ba('0x14')][_0xd7ba('0x16')]);}else{logger[_0xd7ba('0xf')](_0xd7ba('0x10'),_0x719bc4,'request\x20sent');_0x56c80b(_0x4e659d['result'][_0xd7ba('0x16')]);}})[_0xd7ba('0x17')](function(_0x2f5317){logger[_0xd7ba('0x14')](_0xd7ba('0x10'),_0x719bc4,_0x2f5317);_0x2c81e7(_0x2f5317);});});}exports[_0xd7ba('0x18')]=function(_0x142b5d){var _0x2c65fd=this;return new Promise(function(_0x23f207,_0x186a21){return db[_0xd7ba('0x19')]['findAll']({'raw':_0x142b5d[_0xd7ba('0x1a')]?_0x142b5d[_0xd7ba('0x1a')][_0xd7ba('0x1b')]===undefined?!![]:![]:!![],'where':_0x142b5d[_0xd7ba('0x1a')]?_0x142b5d[_0xd7ba('0x1a')][_0xd7ba('0x1c')]||null:null,'attributes':_0x142b5d[_0xd7ba('0x1a')]?_0x142b5d['options'][_0xd7ba('0x1d')]||null:null,'limit':_0x142b5d[_0xd7ba('0x1a')]?_0x142b5d[_0xd7ba('0x1a')][_0xd7ba('0x1e')]||null:null,'include':_0x142b5d[_0xd7ba('0x1a')]?_0x142b5d[_0xd7ba('0x1a')][_0xd7ba('0x1f')]?_[_0xd7ba('0x20')](_0x142b5d[_0xd7ba('0x1a')][_0xd7ba('0x1f')],function(_0x1e8192){return{'model':db[_0x1e8192[_0xd7ba('0x21')]],'as':_0x1e8192['as'],'attributes':_0x1e8192[_0xd7ba('0x1d')],'include':_0x1e8192[_0xd7ba('0x1f')]?_[_0xd7ba('0x20')](_0x1e8192['include'],function(_0x2621ea){return{'model':db[_0x2621ea[_0xd7ba('0x21')]],'as':_0x2621ea['as'],'attributes':_0x2621ea[_0xd7ba('0x1d')],'include':_0x2621ea['include']?_[_0xd7ba('0x20')](_0x2621ea[_0xd7ba('0x1f')],function(_0x5648b4){return{'model':db[_0x5648b4['model']],'as':_0x5648b4['as'],'attributes':_0x5648b4[_0xd7ba('0x1d')]};}):[]};}):[]};}):[]:[]})[_0xd7ba('0xe')](function(_0xdc9d73){logger[_0xd7ba('0xf')](_0xd7ba('0x18'),_0x142b5d);logger[_0xd7ba('0x12')](_0xd7ba('0x18'),_0x142b5d,JSON[_0xd7ba('0x22')](_0xdc9d73));_0x23f207(_0xdc9d73);})[_0xd7ba('0x17')](function(_0x484701){logger[_0xd7ba('0x14')](_0xd7ba('0x18'),_0x484701['message'],_0x142b5d);_0x186a21(_0x2c65fd[_0xd7ba('0x14')](0x1f4,_0x484701[_0xd7ba('0x16')]));});});};exports[_0xd7ba('0x23')]=function(_0x2c779b){var _0x185d14=this;return new Promise(function(_0x5c9f9b,_0x1e5f65){return db['MailQueue'][_0xd7ba('0x24')]({'raw':_0x2c779b['options']?_0x2c779b[_0xd7ba('0x1a')][_0xd7ba('0x1b')]===undefined?!![]:![]:!![],'where':_0x2c779b[_0xd7ba('0x1a')]?_0x2c779b[_0xd7ba('0x1a')][_0xd7ba('0x1c')]||null:null,'attributes':_0x2c779b[_0xd7ba('0x1a')]?_0x2c779b[_0xd7ba('0x1a')][_0xd7ba('0x1d')]||null:null,'include':_0x2c779b[_0xd7ba('0x1a')]?_0x2c779b['options']['include']?_[_0xd7ba('0x20')](_0x2c779b[_0xd7ba('0x1a')]['include'],function(_0x3999b6){return{'model':db[_0x3999b6['model']],'as':_0x3999b6['as'],'attributes':_0x3999b6[_0xd7ba('0x1d')],'include':_0x3999b6['include']?_[_0xd7ba('0x20')](_0x3999b6['include'],function(_0x300d29){return{'model':db[_0x300d29[_0xd7ba('0x21')]],'as':_0x300d29['as'],'attributes':_0x300d29['attributes'],'include':_0x300d29['include']?_[_0xd7ba('0x20')](_0x300d29['include'],function(_0x19d4f3){return{'model':db[_0x19d4f3[_0xd7ba('0x21')]],'as':_0x19d4f3['as'],'attributes':_0x19d4f3['attributes']};}):[]};}):[]};}):[]:[]})[_0xd7ba('0xe')](function(_0x43331a){logger['info'](_0xd7ba('0x23'),_0x2c779b);logger['debug'](_0xd7ba('0x23'),_0x2c779b,JSON['stringify'](_0x43331a));_0x5c9f9b(_0x43331a);})[_0xd7ba('0x17')](function(_0x5b16b4){logger[_0xd7ba('0x14')](_0xd7ba('0x23'),_0x5b16b4['message'],_0x2c779b);_0x1e5f65(_0x185d14[_0xd7ba('0x14')](0x1f4,_0x5b16b4[_0xd7ba('0x16')]));});});}; \ No newline at end of file diff --git a/server/api/mailQueue/mailQueue.socket.js b/server/api/mailQueue/mailQueue.socket.js index 26bb102..572ecd0 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 _0x36f9=['remove','update','emit','removeListener','register','length','mailQueue:','save'];(function(_0x295a5c,_0xfd0b5){var _0x53339e=function(_0x5ee71d){while(--_0x5ee71d){_0x295a5c['push'](_0x295a5c['shift']());}};_0x53339e(++_0xfd0b5);}(_0x36f9,0x7f));var _0x936f=function(_0x115cf7,_0x54d11e){_0x115cf7=_0x115cf7-0x0;var _0x4e21aa=_0x36f9[_0x115cf7];return _0x4e21aa;};'use strict';var MailQueueEvents=require('./mailQueue.events');var events=[_0x936f('0x0'),_0x936f('0x1'),_0x936f('0x2')];function createListener(_0x40e389,_0x284fd3){return function(_0x135b83){_0x284fd3[_0x936f('0x3')](_0x40e389,_0x135b83);};}function removeListener(_0x2de60c,_0x1637b3){return function(){MailQueueEvents[_0x936f('0x4')](_0x2de60c,_0x1637b3);};}exports[_0x936f('0x5')]=function(_0x290b95){for(var _0xb2ab68=0x0,_0x361746=events[_0x936f('0x6')];_0xb2ab68<_0x361746;_0xb2ab68++){var _0x15846e=events[_0xb2ab68];var _0x5b5848=createListener(_0x936f('0x7')+_0x15846e,_0x290b95);MailQueueEvents['on'](_0x15846e,_0x5b5848);}}; \ No newline at end of file +var _0x6026=['save','remove','update','emit','removeListener','length','mailQueue:','./mailQueue.events'];(function(_0x28ed4a,_0x474eba){var _0x21c82e=function(_0x1afd8e){while(--_0x1afd8e){_0x28ed4a['push'](_0x28ed4a['shift']());}};_0x21c82e(++_0x474eba);}(_0x6026,0x1bf));var _0x6602=function(_0x57bebb,_0x3a404c){_0x57bebb=_0x57bebb-0x0;var _0x314a0d=_0x6026[_0x57bebb];return _0x314a0d;};'use strict';var MailQueueEvents=require(_0x6602('0x0'));var events=[_0x6602('0x1'),_0x6602('0x2'),_0x6602('0x3')];function createListener(_0x3de24c,_0x2fad57){return function(_0x20e2cb){_0x2fad57[_0x6602('0x4')](_0x3de24c,_0x20e2cb);};}function removeListener(_0x2886df,_0x2ce70f){return function(){MailQueueEvents[_0x6602('0x5')](_0x2886df,_0x2ce70f);};}exports['register']=function(_0x167fa2){for(var _0x265736=0x0,_0x180338=events[_0x6602('0x6')];_0x265736<_0x180338;_0x265736++){var _0x4ecbb2=events[_0x265736];var _0xbe2a27=createListener(_0x6602('0x7')+_0x4ecbb2,_0x167fa2);MailQueueEvents['on'](_0x4ecbb2,_0xbe2a27);}}; \ No newline at end of file diff --git a/server/api/mailQueueReport/index.js b/server/api/mailQueueReport/index.js index 4776422..9d58f61 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 _0x2b75=['express','../../components/interaction/service','../../config/environment','./mailQueueReport.controller','get','isAuthenticated','index','/describe','describe','/:id','create','put','delete','destroy','exports','util','path','connect-timeout'];(function(_0x126bc5,_0x1461e7){var _0x2ab694=function(_0xb62184){while(--_0xb62184){_0x126bc5['push'](_0x126bc5['shift']());}};_0x2ab694(++_0x1461e7);}(_0x2b75,0x141));var _0x52b7=function(_0x49238c,_0x5e67d7){_0x49238c=_0x49238c-0x0;var _0x5271cb=_0x2b75[_0x49238c];return _0x5271cb;};'use strict';var multer=require('multer');var util=require(_0x52b7('0x0'));var path=require(_0x52b7('0x1'));var timeout=require(_0x52b7('0x2'));var express=require(_0x52b7('0x3'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0x52b7('0x4'));var config=require(_0x52b7('0x5'));var controller=require(_0x52b7('0x6'));router[_0x52b7('0x7')]('/',auth[_0x52b7('0x8')](),controller[_0x52b7('0x9')]);router['get'](_0x52b7('0xa'),auth['isAuthenticated'](),controller[_0x52b7('0xb')]);router[_0x52b7('0x7')](_0x52b7('0xc'),auth[_0x52b7('0x8')](),controller['show']);router['post']('/',auth[_0x52b7('0x8')](),controller[_0x52b7('0xd')]);router[_0x52b7('0xe')](_0x52b7('0xc'),auth[_0x52b7('0x8')](),controller['update']);router[_0x52b7('0xf')](_0x52b7('0xc'),auth[_0x52b7('0x8')](),controller[_0x52b7('0x10')]);module[_0x52b7('0x11')]=router; \ No newline at end of file +var _0x68bc=['describe','/:id','isAuthenticated','create','put','exports','multer','util','path','connect-timeout','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./mailQueueReport.controller','get','index'];(function(_0xb7e831,_0x19c2b2){var _0x11bb35=function(_0xebacb6){while(--_0xebacb6){_0xb7e831['push'](_0xb7e831['shift']());}};_0x11bb35(++_0x19c2b2);}(_0x68bc,0x17c));var _0xc68b=function(_0x258a90,_0x2a26d0){_0x258a90=_0x258a90-0x0;var _0x484353=_0x68bc[_0x258a90];return _0x484353;};'use strict';var multer=require(_0xc68b('0x0'));var util=require(_0xc68b('0x1'));var path=require(_0xc68b('0x2'));var timeout=require(_0xc68b('0x3'));var express=require('express');var router=express['Router']();var fs_extra=require(_0xc68b('0x4'));var auth=require(_0xc68b('0x5'));var interaction=require(_0xc68b('0x6'));var config=require(_0xc68b('0x7'));var controller=require(_0xc68b('0x8'));router[_0xc68b('0x9')]('/',auth['isAuthenticated'](),controller[_0xc68b('0xa')]);router[_0xc68b('0x9')]('/describe',auth['isAuthenticated'](),controller[_0xc68b('0xb')]);router[_0xc68b('0x9')](_0xc68b('0xc'),auth['isAuthenticated'](),controller['show']);router['post']('/',auth[_0xc68b('0xd')](),controller[_0xc68b('0xe')]);router[_0xc68b('0xf')]('/:id',auth[_0xc68b('0xd')](),controller['update']);router['delete'](_0xc68b('0xc'),auth['isAuthenticated'](),controller['destroy']);module[_0xc68b('0x10')]=router; \ No newline at end of file diff --git a/server/api/mailQueueReport/mailQueueReport.attributes.js b/server/api/mailQueueReport/mailQueueReport.attributes.js index 16e52cb..d211924 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 _0x6dc0=['moment','exports','STRING','DATE'];(function(_0xa03892,_0x3646d0){var _0x5209be=function(_0x19a7e1){while(--_0x19a7e1){_0xa03892['push'](_0xa03892['shift']());}};_0x5209be(++_0x3646d0);}(_0x6dc0,0x18c));var _0x06dc=function(_0x3306b6,_0x42e90b){_0x3306b6=_0x3306b6-0x0;var _0x47340a=_0x6dc0[_0x3306b6];return _0x47340a;};'use strict';var moment=require(_0x06dc('0x0'));var Sequelize=require('sequelize');module[_0x06dc('0x1')]={'uniqueid':{'type':Sequelize[_0x06dc('0x2')],'allowNull':![]},'from':{'type':Sequelize[_0x06dc('0x2')]},'joinAt':{'type':Sequelize[_0x06dc('0x3')]},'leaveAt':{'type':Sequelize[_0x06dc('0x3')]},'acceptAt':{'type':Sequelize['DATE']},'exitAt':{'type':Sequelize['DATE']},'reason':{'type':Sequelize[_0x06dc('0x2')]}}; \ No newline at end of file +var _0x37a2=['moment','sequelize','exports','STRING','DATE'];(function(_0x3721ec,_0x546ee4){var _0x3ef40f=function(_0x3bcfab){while(--_0x3bcfab){_0x3721ec['push'](_0x3721ec['shift']());}};_0x3ef40f(++_0x546ee4);}(_0x37a2,0x78));var _0x237a=function(_0xccbf3f,_0x53010b){_0xccbf3f=_0xccbf3f-0x0;var _0x3fa69f=_0x37a2[_0xccbf3f];return _0x3fa69f;};'use strict';var moment=require(_0x237a('0x0'));var Sequelize=require(_0x237a('0x1'));module[_0x237a('0x2')]={'uniqueid':{'type':Sequelize[_0x237a('0x3')],'allowNull':![]},'from':{'type':Sequelize['STRING']},'joinAt':{'type':Sequelize[_0x237a('0x4')]},'leaveAt':{'type':Sequelize[_0x237a('0x4')]},'acceptAt':{'type':Sequelize[_0x237a('0x4')]},'exitAt':{'type':Sequelize[_0x237a('0x4')]},'reason':{'type':Sequelize[_0x237a('0x3')]}}; \ No newline at end of file diff --git a/server/api/mailQueueReport/mailQueueReport.controller.js b/server/api/mailQueueReport/mailQueueReport.controller.js index 04686f5..ef0455f 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 _0x8aad=['sort','pick','filter','where','merge','VIRTUAL','options','include','findAll','rows','catch','show','params','includeAll','find','create','body','describe','eml-format','rimraf','fast-json-patch','moment','bluebird','path','ejs','fs-extra','lodash','crypto','jsforce','desk.js','to-csv','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','undefined','limit','count','offset','Content-Range','json','apply','reject','save','update','then','destroy','end','error','stack','name','send','map','MailQueueReport','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','order'];(function(_0x3637ee,_0x3de607){var _0x34633=function(_0x2ffd98){while(--_0x2ffd98){_0x3637ee['push'](_0x3637ee['shift']());}};_0x34633(++_0x3de607);}(_0x8aad,0x146));var _0xd8aa=function(_0x1ed249,_0x1ea53d){_0x1ed249=_0x1ed249-0x0;var _0xc5cac0=_0x8aad[_0x1ed249];return _0xc5cac0;};'use strict';var emlformat=require(_0xd8aa('0x0'));var rimraf=require(_0xd8aa('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xd8aa('0x2'));var rp=require('request-promise');var moment=require(_0xd8aa('0x3'));var BPromise=require(_0xd8aa('0x4'));var Mustache=require('mustache');var util=require('util');var path=require(_0xd8aa('0x5'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0xd8aa('0x6'));var fs=require('fs');var fs_extra=require(_0xd8aa('0x7'));var _=require(_0xd8aa('0x8'));var squel=require('squel');var crypto=require(_0xd8aa('0x9'));var jsforce=require(_0xd8aa('0xa'));var deskjs=require(_0xd8aa('0xb'));var toCsv=require(_0xd8aa('0xc'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0xd8aa('0xd'));var authService=require(_0xd8aa('0xe'));var qs=require(_0xd8aa('0xf'));var as=require(_0xd8aa('0x10'));var hardwareService=require(_0xd8aa('0x11'));var logger=require('../../config/logger')(_0xd8aa('0x12'));var utils=require(_0xd8aa('0x13'));var config=require(_0xd8aa('0x14'));var licenseUtil=require(_0xd8aa('0x15'));var db=require(_0xd8aa('0x16'))['db'];function respondWithStatusCode(_0x6ec0eb,_0x549fad){_0x549fad=_0x549fad||0xcc;return function(_0x1e7db8){if(_0x1e7db8){return _0x6ec0eb[_0xd8aa('0x17')](_0x549fad);}return _0x6ec0eb[_0xd8aa('0x18')](_0x549fad)['end']();};}function respondWithResult(_0x5a8c79,_0x275eff){_0x275eff=_0x275eff||0xc8;return function(_0x319ffe){if(_0x319ffe){return _0x5a8c79[_0xd8aa('0x18')](_0x275eff)['json'](_0x319ffe);}};}function respondWithFilteredResult(_0x2678ed,_0x180c56){return function(_0x39b5bc){if(_0x39b5bc){var _0x404ed6=typeof _0x180c56['offset']===_0xd8aa('0x19')&&typeof _0x180c56[_0xd8aa('0x1a')]==='undefined';var _0x16d5c6=_0x39b5bc[_0xd8aa('0x1b')];var _0x32e2cd=_0x404ed6?0x0:_0x180c56[_0xd8aa('0x1c')];var _0x2d34ac=_0x404ed6?_0x39b5bc['count']:_0x180c56[_0xd8aa('0x1c')]+_0x180c56[_0xd8aa('0x1a')];var _0xb156e6;if(_0x2d34ac>=_0x16d5c6){_0x2d34ac=_0x16d5c6;_0xb156e6=0xc8;}else{_0xb156e6=0xce;}_0x2678ed[_0xd8aa('0x18')](_0xb156e6);return _0x2678ed['set'](_0xd8aa('0x1d'),_0x32e2cd+'-'+_0x2d34ac+'/'+_0x16d5c6)[_0xd8aa('0x1e')](_0x39b5bc);}return null;};}function patchUpdates(_0x46d69b){return function(_0x3588ee){try{jsonpatch[_0xd8aa('0x1f')](_0x3588ee,_0x46d69b,!![]);}catch(_0x4fe5d8){return BPromise[_0xd8aa('0x20')](_0x4fe5d8);}return _0x3588ee[_0xd8aa('0x21')]();};}function saveUpdates(_0xc4f55c,_0x5910b3){return function(_0xa7cf85){if(_0xa7cf85){return _0xa7cf85[_0xd8aa('0x22')](_0xc4f55c)[_0xd8aa('0x23')](function(_0x290849){return _0x290849;});}return null;};}function removeEntity(_0x3ef3a9,_0x16758a){return function(_0x1f64f8){if(_0x1f64f8){return _0x1f64f8[_0xd8aa('0x24')]()[_0xd8aa('0x23')](function(){_0x3ef3a9[_0xd8aa('0x18')](0xcc)[_0xd8aa('0x25')]();});}};}function handleEntityNotFound(_0x370d6f,_0x26cc66){return function(_0x5f1027){if(!_0x5f1027){_0x370d6f[_0xd8aa('0x17')](0x194);}return _0x5f1027;};}function handleError(_0x59eb3f,_0xd4d204){_0xd4d204=_0xd4d204||0x1f4;return function(_0x1f6ab2){logger[_0xd8aa('0x26')](_0x1f6ab2[_0xd8aa('0x27')]);if(_0x1f6ab2[_0xd8aa('0x28')]){delete _0x1f6ab2[_0xd8aa('0x28')];}_0x59eb3f[_0xd8aa('0x18')](_0xd4d204)[_0xd8aa('0x29')](_0x1f6ab2);};}exports['index']=function(_0x1f2a28,_0x34b792){var _0x214393={},_0x49a7c8={},_0x19a59d={'count':0x0,'rows':[]};var _0x51c6f4=_[_0xd8aa('0x2a')](db[_0xd8aa('0x2b')][_0xd8aa('0x2c')],function(_0x168a2e){return{'name':_0x168a2e[_0xd8aa('0x2d')],'type':_0x168a2e[_0xd8aa('0x2e')][_0xd8aa('0x2f')]};});_0x49a7c8[_0xd8aa('0x30')]=_['map'](_0x51c6f4,_0xd8aa('0x28'));_0x49a7c8[_0xd8aa('0x31')]=_[_0xd8aa('0x32')](_0x1f2a28[_0xd8aa('0x31')]);_0x49a7c8[_0xd8aa('0x33')]=_[_0xd8aa('0x34')](_0x49a7c8[_0xd8aa('0x30')],_0x49a7c8[_0xd8aa('0x31')]);_0x214393['attributes']=_[_0xd8aa('0x34')](_0x49a7c8[_0xd8aa('0x30')],qs[_0xd8aa('0x35')](_0x1f2a28['query'][_0xd8aa('0x35')]));_0x214393[_0xd8aa('0x36')]=_0x214393[_0xd8aa('0x36')][_0xd8aa('0x37')]?_0x214393[_0xd8aa('0x36')]:_0x49a7c8[_0xd8aa('0x30')];if(!_0x1f2a28[_0xd8aa('0x31')][_0xd8aa('0x38')](_0xd8aa('0x39'))){_0x214393['limit']=qs[_0xd8aa('0x1a')](_0x1f2a28[_0xd8aa('0x31')][_0xd8aa('0x1a')]);_0x214393[_0xd8aa('0x1c')]=qs[_0xd8aa('0x1c')](_0x1f2a28[_0xd8aa('0x31')][_0xd8aa('0x1c')]);}_0x214393[_0xd8aa('0x3a')]=qs[_0xd8aa('0x3b')](_0x1f2a28['query'][_0xd8aa('0x3b')]);_0x214393['where']=qs[_0xd8aa('0x33')](_[_0xd8aa('0x3c')](_0x1f2a28['query'],_0x49a7c8[_0xd8aa('0x33')]),_0x51c6f4);if(_0x1f2a28[_0xd8aa('0x31')][_0xd8aa('0x3d')]){_0x214393[_0xd8aa('0x3e')]=_[_0xd8aa('0x3f')](_0x214393['where'],{'$or':_['map'](_0x51c6f4,function(_0x25145c){if(_0x25145c['type']!==_0xd8aa('0x40')){var _0x7a6df2={};_0x7a6df2[_0x25145c[_0xd8aa('0x28')]]={'$like':'%'+_0x1f2a28[_0xd8aa('0x31')][_0xd8aa('0x3d')]+'%'};return _0x7a6df2;}})});}_0x214393=_[_0xd8aa('0x3f')]({},_0x214393,_0x1f2a28[_0xd8aa('0x41')]);var _0x3b0220={'where':_0x214393[_0xd8aa('0x3e')]};return db[_0xd8aa('0x2b')][_0xd8aa('0x1b')](_0x3b0220)['then'](function(_0x17ebb4){_0x19a59d[_0xd8aa('0x1b')]=_0x17ebb4;if(_0x1f2a28[_0xd8aa('0x31')]['includeAll']){_0x214393[_0xd8aa('0x42')]=[{'all':!![]}];}return db[_0xd8aa('0x2b')][_0xd8aa('0x43')](_0x214393);})[_0xd8aa('0x23')](function(_0x3a0284){_0x19a59d[_0xd8aa('0x44')]=_0x3a0284;return _0x19a59d;})[_0xd8aa('0x23')](respondWithFilteredResult(_0x34b792,_0x214393))[_0xd8aa('0x45')](handleError(_0x34b792,null));};exports[_0xd8aa('0x46')]=function(_0x3f5857,_0x20c7a0){var _0x3ec42f={'raw':!![],'where':{'id':_0x3f5857[_0xd8aa('0x47')]['id']}},_0x3b26c9={};_0x3b26c9[_0xd8aa('0x30')]=_[_0xd8aa('0x32')](db[_0xd8aa('0x2b')][_0xd8aa('0x2c')]);_0x3b26c9['query']=_[_0xd8aa('0x32')](_0x3f5857[_0xd8aa('0x31')]);_0x3b26c9[_0xd8aa('0x33')]=_[_0xd8aa('0x34')](_0x3b26c9[_0xd8aa('0x30')],_0x3b26c9[_0xd8aa('0x31')]);_0x3ec42f['attributes']=_[_0xd8aa('0x34')](_0x3b26c9['model'],qs[_0xd8aa('0x35')](_0x3f5857['query'][_0xd8aa('0x35')]));_0x3ec42f['attributes']=_0x3ec42f['attributes'][_0xd8aa('0x37')]?_0x3ec42f[_0xd8aa('0x36')]:_0x3b26c9[_0xd8aa('0x30')];if(_0x3f5857[_0xd8aa('0x31')][_0xd8aa('0x48')]){_0x3ec42f[_0xd8aa('0x42')]=[{'all':!![]}];}_0x3ec42f=_['merge']({},_0x3ec42f,_0x3f5857[_0xd8aa('0x41')]);return db[_0xd8aa('0x2b')][_0xd8aa('0x49')](_0x3ec42f)[_0xd8aa('0x23')](handleEntityNotFound(_0x20c7a0,null))[_0xd8aa('0x23')](respondWithResult(_0x20c7a0,null))['catch'](handleError(_0x20c7a0,null));};exports['create']=function(_0x58cf42,_0x1fd1dc){return db[_0xd8aa('0x2b')][_0xd8aa('0x4a')](_0x58cf42[_0xd8aa('0x4b')],{})[_0xd8aa('0x23')](respondWithResult(_0x1fd1dc,0xc9))[_0xd8aa('0x45')](handleError(_0x1fd1dc,null));};exports['update']=function(_0x221e2b,_0x241e23){if(_0x221e2b['body']['id']){delete _0x221e2b[_0xd8aa('0x4b')]['id'];}return db[_0xd8aa('0x2b')][_0xd8aa('0x49')]({'where':{'id':_0x221e2b['params']['id']}})[_0xd8aa('0x23')](handleEntityNotFound(_0x241e23,null))[_0xd8aa('0x23')](saveUpdates(_0x221e2b[_0xd8aa('0x4b')],null))[_0xd8aa('0x23')](respondWithResult(_0x241e23,null))[_0xd8aa('0x45')](handleError(_0x241e23,null));};exports[_0xd8aa('0x24')]=function(_0x4f494d,_0x566d52){return db[_0xd8aa('0x2b')][_0xd8aa('0x49')]({'where':{'id':_0x4f494d[_0xd8aa('0x47')]['id']}})[_0xd8aa('0x23')](handleEntityNotFound(_0x566d52,null))[_0xd8aa('0x23')](removeEntity(_0x566d52,null))[_0xd8aa('0x45')](handleError(_0x566d52,null));};exports[_0xd8aa('0x4c')]=function(_0x4f9d21,_0x9db7e3){return db[_0xd8aa('0x2b')]['describe']()[_0xd8aa('0x23')](respondWithResult(_0x9db7e3,null))['catch'](handleError(_0x9db7e3,null));}; \ No newline at end of file +var _0xfcbb=['destroy','error','stack','name','send','index','MailQueueReport','rawAttributes','fieldName','type','key','model','map','keys','query','filters','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','pick','where','merge','options','include','rows','catch','show','length','includeAll','find','create','body','params','describe','eml-format','rimraf','zip-dir','moment','bluebird','mustache','util','path','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','end','status','json','offset','undefined','limit','count','set','reject','save','update','then'];(function(_0x1f90fa,_0x1fcdfd){var _0x467ea5=function(_0xa35cfd){while(--_0xa35cfd){_0x1f90fa['push'](_0x1f90fa['shift']());}};_0x467ea5(++_0x1fcdfd);}(_0xfcbb,0x10d));var _0xbfcb=function(_0x430612,_0x34e013){_0x430612=_0x430612-0x0;var _0x1fb127=_0xfcbb[_0x430612];return _0x1fb127;};'use strict';var emlformat=require(_0xbfcb('0x0'));var rimraf=require(_0xbfcb('0x1'));var zipdir=require(_0xbfcb('0x2'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0xbfcb('0x3'));var BPromise=require(_0xbfcb('0x4'));var Mustache=require(_0xbfcb('0x5'));var util=require(_0xbfcb('0x6'));var path=require(_0xbfcb('0x7'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0xbfcb('0x8'));var fs=require('fs');var fs_extra=require(_0xbfcb('0x9'));var _=require(_0xbfcb('0xa'));var squel=require(_0xbfcb('0xb'));var crypto=require(_0xbfcb('0xc'));var jsforce=require(_0xbfcb('0xd'));var deskjs=require(_0xbfcb('0xe'));var toCsv=require('to-csv');var querystring=require(_0xbfcb('0xf'));var Papa=require(_0xbfcb('0x10'));var Redis=require(_0xbfcb('0x11'));var authService=require('../../components/auth/service');var qs=require(_0xbfcb('0x12'));var as=require(_0xbfcb('0x13'));var hardwareService=require(_0xbfcb('0x14'));var logger=require(_0xbfcb('0x15'))(_0xbfcb('0x16'));var utils=require(_0xbfcb('0x17'));var config=require('../../config/environment');var licenseUtil=require(_0xbfcb('0x18'));var db=require(_0xbfcb('0x19'))['db'];function respondWithStatusCode(_0xb2f601,_0x2268da){_0x2268da=_0x2268da||0xcc;return function(_0x4ba4f1){if(_0x4ba4f1){return _0xb2f601[_0xbfcb('0x1a')](_0x2268da);}return _0xb2f601['status'](_0x2268da)[_0xbfcb('0x1b')]();};}function respondWithResult(_0x1c52df,_0x44ad6c){_0x44ad6c=_0x44ad6c||0xc8;return function(_0x1047c4){if(_0x1047c4){return _0x1c52df[_0xbfcb('0x1c')](_0x44ad6c)[_0xbfcb('0x1d')](_0x1047c4);}};}function respondWithFilteredResult(_0x71304e,_0x2d314a){return function(_0x90ed8c){if(_0x90ed8c){var _0x339347=typeof _0x2d314a[_0xbfcb('0x1e')]===_0xbfcb('0x1f')&&typeof _0x2d314a[_0xbfcb('0x20')]===_0xbfcb('0x1f');var _0x318d07=_0x90ed8c[_0xbfcb('0x21')];var _0xba1d6=_0x339347?0x0:_0x2d314a[_0xbfcb('0x1e')];var _0x3404aa=_0x339347?_0x90ed8c[_0xbfcb('0x21')]:_0x2d314a[_0xbfcb('0x1e')]+_0x2d314a[_0xbfcb('0x20')];var _0x53c9e0;if(_0x3404aa>=_0x318d07){_0x3404aa=_0x318d07;_0x53c9e0=0xc8;}else{_0x53c9e0=0xce;}_0x71304e[_0xbfcb('0x1c')](_0x53c9e0);return _0x71304e[_0xbfcb('0x22')]('Content-Range',_0xba1d6+'-'+_0x3404aa+'/'+_0x318d07)[_0xbfcb('0x1d')](_0x90ed8c);}return null;};}function patchUpdates(_0x1a7225){return function(_0x48c3c8){try{jsonpatch['apply'](_0x48c3c8,_0x1a7225,!![]);}catch(_0x4199c5){return BPromise[_0xbfcb('0x23')](_0x4199c5);}return _0x48c3c8[_0xbfcb('0x24')]();};}function saveUpdates(_0x45661a,_0x1c5924){return function(_0x56c158){if(_0x56c158){return _0x56c158[_0xbfcb('0x25')](_0x45661a)[_0xbfcb('0x26')](function(_0x2d9288){return _0x2d9288;});}return null;};}function removeEntity(_0xd4d29,_0x1651e5){return function(_0x19616c){if(_0x19616c){return _0x19616c[_0xbfcb('0x27')]()[_0xbfcb('0x26')](function(){_0xd4d29[_0xbfcb('0x1c')](0xcc)[_0xbfcb('0x1b')]();});}};}function handleEntityNotFound(_0x1ca8c3,_0xf6dbb7){return function(_0x3ef71c){if(!_0x3ef71c){_0x1ca8c3[_0xbfcb('0x1a')](0x194);}return _0x3ef71c;};}function handleError(_0x3e954d,_0x2a1272){_0x2a1272=_0x2a1272||0x1f4;return function(_0x5cd703){logger[_0xbfcb('0x28')](_0x5cd703[_0xbfcb('0x29')]);if(_0x5cd703['name']){delete _0x5cd703[_0xbfcb('0x2a')];}_0x3e954d[_0xbfcb('0x1c')](_0x2a1272)[_0xbfcb('0x2b')](_0x5cd703);};}exports[_0xbfcb('0x2c')]=function(_0xf4b944,_0x3542e9){var _0x4069a7={},_0x1a5db2={},_0x434764={'count':0x0,'rows':[]};var _0x27606f=_['map'](db[_0xbfcb('0x2d')][_0xbfcb('0x2e')],function(_0x43c3c3){return{'name':_0x43c3c3[_0xbfcb('0x2f')],'type':_0x43c3c3[_0xbfcb('0x30')][_0xbfcb('0x31')]};});_0x1a5db2[_0xbfcb('0x32')]=_[_0xbfcb('0x33')](_0x27606f,_0xbfcb('0x2a'));_0x1a5db2['query']=_[_0xbfcb('0x34')](_0xf4b944[_0xbfcb('0x35')]);_0x1a5db2[_0xbfcb('0x36')]=_[_0xbfcb('0x37')](_0x1a5db2['model'],_0x1a5db2['query']);_0x4069a7[_0xbfcb('0x38')]=_[_0xbfcb('0x37')](_0x1a5db2[_0xbfcb('0x32')],qs[_0xbfcb('0x39')](_0xf4b944[_0xbfcb('0x35')][_0xbfcb('0x39')]));_0x4069a7[_0xbfcb('0x38')]=_0x4069a7['attributes']['length']?_0x4069a7['attributes']:_0x1a5db2[_0xbfcb('0x32')];if(!_0xf4b944['query'][_0xbfcb('0x3a')](_0xbfcb('0x3b'))){_0x4069a7['limit']=qs['limit'](_0xf4b944[_0xbfcb('0x35')][_0xbfcb('0x20')]);_0x4069a7[_0xbfcb('0x1e')]=qs[_0xbfcb('0x1e')](_0xf4b944['query'][_0xbfcb('0x1e')]);}_0x4069a7[_0xbfcb('0x3c')]=qs['sort'](_0xf4b944['query'][_0xbfcb('0x3d')]);_0x4069a7['where']=qs['filters'](_[_0xbfcb('0x3e')](_0xf4b944[_0xbfcb('0x35')],_0x1a5db2[_0xbfcb('0x36')]),_0x27606f);if(_0xf4b944[_0xbfcb('0x35')]['filter']){_0x4069a7[_0xbfcb('0x3f')]=_[_0xbfcb('0x40')](_0x4069a7[_0xbfcb('0x3f')],{'$or':_[_0xbfcb('0x33')](_0x27606f,function(_0x2289fd){if(_0x2289fd[_0xbfcb('0x30')]!=='VIRTUAL'){var _0x2fc01f={};_0x2fc01f[_0x2289fd['name']]={'$like':'%'+_0xf4b944[_0xbfcb('0x35')]['filter']+'%'};return _0x2fc01f;}})});}_0x4069a7=_[_0xbfcb('0x40')]({},_0x4069a7,_0xf4b944[_0xbfcb('0x41')]);var _0xe719cd={'where':_0x4069a7[_0xbfcb('0x3f')]};return db[_0xbfcb('0x2d')][_0xbfcb('0x21')](_0xe719cd)[_0xbfcb('0x26')](function(_0x149bd5){_0x434764[_0xbfcb('0x21')]=_0x149bd5;if(_0xf4b944[_0xbfcb('0x35')]['includeAll']){_0x4069a7[_0xbfcb('0x42')]=[{'all':!![]}];}return db[_0xbfcb('0x2d')]['findAll'](_0x4069a7);})[_0xbfcb('0x26')](function(_0x306ea4){_0x434764[_0xbfcb('0x43')]=_0x306ea4;return _0x434764;})[_0xbfcb('0x26')](respondWithFilteredResult(_0x3542e9,_0x4069a7))[_0xbfcb('0x44')](handleError(_0x3542e9,null));};exports[_0xbfcb('0x45')]=function(_0x500e7c,_0x96691c){var _0x10ffa0={'raw':!![],'where':{'id':_0x500e7c['params']['id']}},_0x10ea4f={};_0x10ea4f[_0xbfcb('0x32')]=_[_0xbfcb('0x34')](db[_0xbfcb('0x2d')]['rawAttributes']);_0x10ea4f[_0xbfcb('0x35')]=_[_0xbfcb('0x34')](_0x500e7c['query']);_0x10ea4f['filters']=_[_0xbfcb('0x37')](_0x10ea4f[_0xbfcb('0x32')],_0x10ea4f['query']);_0x10ffa0[_0xbfcb('0x38')]=_[_0xbfcb('0x37')](_0x10ea4f['model'],qs[_0xbfcb('0x39')](_0x500e7c[_0xbfcb('0x35')][_0xbfcb('0x39')]));_0x10ffa0[_0xbfcb('0x38')]=_0x10ffa0[_0xbfcb('0x38')][_0xbfcb('0x46')]?_0x10ffa0[_0xbfcb('0x38')]:_0x10ea4f[_0xbfcb('0x32')];if(_0x500e7c[_0xbfcb('0x35')][_0xbfcb('0x47')]){_0x10ffa0[_0xbfcb('0x42')]=[{'all':!![]}];}_0x10ffa0=_[_0xbfcb('0x40')]({},_0x10ffa0,_0x500e7c['options']);return db[_0xbfcb('0x2d')][_0xbfcb('0x48')](_0x10ffa0)[_0xbfcb('0x26')](handleEntityNotFound(_0x96691c,null))['then'](respondWithResult(_0x96691c,null))[_0xbfcb('0x44')](handleError(_0x96691c,null));};exports['create']=function(_0x4a3b40,_0x2dcfb3){return db[_0xbfcb('0x2d')][_0xbfcb('0x49')](_0x4a3b40['body'],{})[_0xbfcb('0x26')](respondWithResult(_0x2dcfb3,0xc9))['catch'](handleError(_0x2dcfb3,null));};exports['update']=function(_0x33725a,_0x588d32){if(_0x33725a[_0xbfcb('0x4a')]['id']){delete _0x33725a[_0xbfcb('0x4a')]['id'];}return db['MailQueueReport'][_0xbfcb('0x48')]({'where':{'id':_0x33725a['params']['id']}})[_0xbfcb('0x26')](handleEntityNotFound(_0x588d32,null))['then'](saveUpdates(_0x33725a[_0xbfcb('0x4a')],null))['then'](respondWithResult(_0x588d32,null))[_0xbfcb('0x44')](handleError(_0x588d32,null));};exports[_0xbfcb('0x27')]=function(_0x5efbe1,_0x131af7){return db['MailQueueReport']['find']({'where':{'id':_0x5efbe1[_0xbfcb('0x4b')]['id']}})[_0xbfcb('0x26')](handleEntityNotFound(_0x131af7,null))[_0xbfcb('0x26')](removeEntity(_0x131af7,null))['catch'](handleError(_0x131af7,null));};exports['describe']=function(_0x19dca9,_0x931bf){return db[_0xbfcb('0x2d')][_0xbfcb('0x4c')]()[_0xbfcb('0x26')](respondWithResult(_0x931bf,null))['catch'](handleError(_0x931bf,null));}; \ No newline at end of file diff --git a/server/api/mailQueueReport/mailQueueReport.model.js b/server/api/mailQueueReport/mailQueueReport.model.js index 39b98bb..cff8ddd 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 _0xa76b=['MailQueueReport','uniqueid','lodash','util','../../config/logger','api','moment','bluebird','path','rimraf','../../config/environment','exports','define'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0xa76b,0xdf));var _0xba76=function(_0x15ce67,_0x2effec){_0x15ce67=_0x15ce67-0x0;var _0x3f8160=_0xa76b[_0x15ce67];return _0x3f8160;};'use strict';var _=require(_0xba76('0x0'));var util=require(_0xba76('0x1'));var logger=require(_0xba76('0x2'))(_0xba76('0x3'));var moment=require(_0xba76('0x4'));var BPromise=require(_0xba76('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xba76('0x6'));var rimraf=require(_0xba76('0x7'));var config=require(_0xba76('0x8'));var attributes=require('./mailQueueReport.attributes');module[_0xba76('0x9')]=function(_0x2ed2db,_0x3858bb){return _0x2ed2db[_0xba76('0xa')](_0xba76('0xb'),attributes,{'tableName':'report_mail_queue','paranoid':![],'indexes':[{'name':_0xba76('0xc'),'fields':[_0xba76('0xc')]}],'timestamps':!![]});}; \ No newline at end of file +var _0xcce2=['util','api','bluebird','request-promise','path','rimraf','exports','define','MailQueueReport','report_mail_queue','uniqueid','lodash'];(function(_0x466aa0,_0x176d70){var _0x27867a=function(_0x5058b7){while(--_0x5058b7){_0x466aa0['push'](_0x466aa0['shift']());}};_0x27867a(++_0x176d70);}(_0xcce2,0x173));var _0x2cce=function(_0x547301,_0x547838){_0x547301=_0x547301-0x0;var _0x395a0b=_0xcce2[_0x547301];return _0x395a0b;};'use strict';var _=require(_0x2cce('0x0'));var util=require(_0x2cce('0x1'));var logger=require('../../config/logger')(_0x2cce('0x2'));var moment=require('moment');var BPromise=require(_0x2cce('0x3'));var rp=require(_0x2cce('0x4'));var fs=require('fs');var path=require(_0x2cce('0x5'));var rimraf=require(_0x2cce('0x6'));var config=require('../../config/environment');var attributes=require('./mailQueueReport.attributes');module[_0x2cce('0x7')]=function(_0x7d3933,_0x10b5f9){return _0x7d3933[_0x2cce('0x8')](_0x2cce('0x9'),attributes,{'tableName':_0x2cce('0xa'),'paranoid':![],'indexes':[{'name':_0x2cce('0xb'),'fields':[_0x2cce('0xb')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/mailQueueReport/mailQueueReport.rpc.js b/server/api/mailQueueReport/mailQueueReport.rpc.js index d4afa5c..88f9ac2 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 _0xc4aa=['create','body','options','raw','update','where','attributes','limit','UpdateMailQueueReport','stringify','lodash','util','moment','bluebird','randomstring','ioredis','rpc','../../config/environment','jayson/promise','client','http','request','then','MailQueueReport,\x20%s,\x20%s','request\x20sent','debug','error','code','message','info','catch','CreateMailQueueReport','MailQueueReport'];(function(_0x1d060f,_0xf00e8e){var _0x5ab952=function(_0x4ea75a){while(--_0x4ea75a){_0x1d060f['push'](_0x1d060f['shift']());}};_0x5ab952(++_0xf00e8e);}(_0xc4aa,0x1b7));var _0xac4a=function(_0x5d2803,_0xf375bd){_0x5d2803=_0x5d2803-0x0;var _0xdcad2c=_0xc4aa[_0x5d2803];return _0xdcad2c;};'use strict';var _=require(_0xac4a('0x0'));var util=require(_0xac4a('0x1'));var moment=require(_0xac4a('0x2'));var BPromise=require(_0xac4a('0x3'));var rs=require(_0xac4a('0x4'));var fs=require('fs');var Redis=require(_0xac4a('0x5'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0xac4a('0x6'));var config=require(_0xac4a('0x7'));var jayson=require(_0xac4a('0x8'));var client=jayson[_0xac4a('0x9')][_0xac4a('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x15cd34,_0x3ef77c,_0x10525b){return new BPromise(function(_0x5c6179,_0x5b8339){return client[_0xac4a('0xb')](_0x15cd34,_0x10525b)[_0xac4a('0xc')](function(_0x26ec84){logger['info'](_0xac4a('0xd'),_0x3ef77c,_0xac4a('0xe'));logger[_0xac4a('0xf')]('MailQueueReport,\x20%s,\x20%s,\x20%s',_0x3ef77c,_0xac4a('0xe'),JSON['stringify'](_0x26ec84));if(_0x26ec84[_0xac4a('0x10')]){if(_0x26ec84['error'][_0xac4a('0x11')]===0x1f4){logger[_0xac4a('0x10')](_0xac4a('0xd'),_0x3ef77c,_0x26ec84['error'][_0xac4a('0x12')]);return _0x5b8339(_0x26ec84[_0xac4a('0x10')][_0xac4a('0x12')]);}logger[_0xac4a('0x10')](_0xac4a('0xd'),_0x3ef77c,_0x26ec84[_0xac4a('0x10')][_0xac4a('0x12')]);return _0x5c6179(_0x26ec84[_0xac4a('0x10')][_0xac4a('0x12')]);}else{logger[_0xac4a('0x13')](_0xac4a('0xd'),_0x3ef77c,_0xac4a('0xe'));_0x5c6179(_0x26ec84['result'][_0xac4a('0x12')]);}})[_0xac4a('0x14')](function(_0x23eb66){logger[_0xac4a('0x10')](_0xac4a('0xd'),_0x3ef77c,_0x23eb66);_0x5b8339(_0x23eb66);});});}exports[_0xac4a('0x15')]=function(_0x28e304){var _0x44ec59=this;return new Promise(function(_0x546c5d,_0x5ac21e){return db[_0xac4a('0x16')][_0xac4a('0x17')](_0x28e304[_0xac4a('0x18')],{'raw':_0x28e304['options']?_0x28e304[_0xac4a('0x19')][_0xac4a('0x1a')]===undefined?!![]:![]:!![]})[_0xac4a('0xc')](function(_0x3a3cdb){logger[_0xac4a('0x13')](_0xac4a('0x15'),_0x28e304);logger[_0xac4a('0xf')](_0xac4a('0x15'),_0x28e304,JSON['stringify'](_0x3a3cdb));_0x546c5d(_0x3a3cdb);})[_0xac4a('0x14')](function(_0x3204ad){logger['error'](_0xac4a('0x15'),_0x3204ad[_0xac4a('0x12')],_0x28e304);_0x5ac21e(_0x44ec59[_0xac4a('0x10')](0x1f4,_0x3204ad[_0xac4a('0x12')]));});});};exports['UpdateMailQueueReport']=function(_0x1b7998){var _0x2503d8=this;return new Promise(function(_0x15435c,_0x412494){return db[_0xac4a('0x16')][_0xac4a('0x1b')](_0x1b7998[_0xac4a('0x18')],{'raw':_0x1b7998[_0xac4a('0x19')]?_0x1b7998[_0xac4a('0x19')][_0xac4a('0x1a')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x1b7998[_0xac4a('0x19')]?_0x1b7998[_0xac4a('0x19')][_0xac4a('0x1c')]||null:null,'attributes':_0x1b7998[_0xac4a('0x19')]?_0x1b7998[_0xac4a('0x19')][_0xac4a('0x1d')]||null:null,'limit':_0x1b7998['options']?_0x1b7998[_0xac4a('0x19')][_0xac4a('0x1e')]||null:null})[_0xac4a('0xc')](function(_0x2772fe){logger[_0xac4a('0x13')]('UpdateMailQueueReport',_0x1b7998);logger['debug'](_0xac4a('0x1f'),_0x1b7998,JSON[_0xac4a('0x20')](_0x2772fe));_0x15435c(_0x2772fe);})[_0xac4a('0x14')](function(_0x546b65){logger['error'](_0xac4a('0x1f'),_0x546b65[_0xac4a('0x12')],_0x1b7998);_0x412494(_0x2503d8[_0xac4a('0x10')](0x1f4,_0x546b65[_0xac4a('0x12')]));});});}; \ No newline at end of file +var _0xc4aa=['create','body','options','raw','update','where','attributes','limit','UpdateMailQueueReport','stringify','lodash','util','moment','bluebird','randomstring','ioredis','rpc','../../config/environment','jayson/promise','client','http','request','then','MailQueueReport,\x20%s,\x20%s','request\x20sent','debug','error','code','message','info','catch','CreateMailQueueReport','MailQueueReport'];(function(_0x270dcc,_0x32caa9){var _0x5b953b=function(_0x216efe){while(--_0x216efe){_0x270dcc['push'](_0x270dcc['shift']());}};_0x5b953b(++_0x32caa9);}(_0xc4aa,0x1b7));var _0xac4a=function(_0x422905,_0x3bce3a){_0x422905=_0x422905-0x0;var _0x33dc6c=_0xc4aa[_0x422905];return _0x33dc6c;};'use strict';var _=require(_0xac4a('0x0'));var util=require(_0xac4a('0x1'));var moment=require(_0xac4a('0x2'));var BPromise=require(_0xac4a('0x3'));var rs=require(_0xac4a('0x4'));var fs=require('fs');var Redis=require(_0xac4a('0x5'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0xac4a('0x6'));var config=require(_0xac4a('0x7'));var jayson=require(_0xac4a('0x8'));var client=jayson[_0xac4a('0x9')][_0xac4a('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x15cd34,_0x3ef77c,_0x10525b){return new BPromise(function(_0x5c6179,_0x5b8339){return client[_0xac4a('0xb')](_0x15cd34,_0x10525b)[_0xac4a('0xc')](function(_0x26ec84){logger['info'](_0xac4a('0xd'),_0x3ef77c,_0xac4a('0xe'));logger[_0xac4a('0xf')]('MailQueueReport,\x20%s,\x20%s,\x20%s',_0x3ef77c,_0xac4a('0xe'),JSON['stringify'](_0x26ec84));if(_0x26ec84[_0xac4a('0x10')]){if(_0x26ec84['error'][_0xac4a('0x11')]===0x1f4){logger[_0xac4a('0x10')](_0xac4a('0xd'),_0x3ef77c,_0x26ec84['error'][_0xac4a('0x12')]);return _0x5b8339(_0x26ec84[_0xac4a('0x10')][_0xac4a('0x12')]);}logger[_0xac4a('0x10')](_0xac4a('0xd'),_0x3ef77c,_0x26ec84[_0xac4a('0x10')][_0xac4a('0x12')]);return _0x5c6179(_0x26ec84[_0xac4a('0x10')][_0xac4a('0x12')]);}else{logger[_0xac4a('0x13')](_0xac4a('0xd'),_0x3ef77c,_0xac4a('0xe'));_0x5c6179(_0x26ec84['result'][_0xac4a('0x12')]);}})[_0xac4a('0x14')](function(_0x23eb66){logger[_0xac4a('0x10')](_0xac4a('0xd'),_0x3ef77c,_0x23eb66);_0x5b8339(_0x23eb66);});});}exports[_0xac4a('0x15')]=function(_0x28e304){var _0x44ec59=this;return new Promise(function(_0x546c5d,_0x5ac21e){return db[_0xac4a('0x16')][_0xac4a('0x17')](_0x28e304[_0xac4a('0x18')],{'raw':_0x28e304['options']?_0x28e304[_0xac4a('0x19')][_0xac4a('0x1a')]===undefined?!![]:![]:!![]})[_0xac4a('0xc')](function(_0x3a3cdb){logger[_0xac4a('0x13')](_0xac4a('0x15'),_0x28e304);logger[_0xac4a('0xf')](_0xac4a('0x15'),_0x28e304,JSON['stringify'](_0x3a3cdb));_0x546c5d(_0x3a3cdb);})[_0xac4a('0x14')](function(_0x3204ad){logger['error'](_0xac4a('0x15'),_0x3204ad[_0xac4a('0x12')],_0x28e304);_0x5ac21e(_0x44ec59[_0xac4a('0x10')](0x1f4,_0x3204ad[_0xac4a('0x12')]));});});};exports['UpdateMailQueueReport']=function(_0x1b7998){var _0x2503d8=this;return new Promise(function(_0x15435c,_0x412494){return db[_0xac4a('0x16')][_0xac4a('0x1b')](_0x1b7998[_0xac4a('0x18')],{'raw':_0x1b7998[_0xac4a('0x19')]?_0x1b7998[_0xac4a('0x19')][_0xac4a('0x1a')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x1b7998[_0xac4a('0x19')]?_0x1b7998[_0xac4a('0x19')][_0xac4a('0x1c')]||null:null,'attributes':_0x1b7998[_0xac4a('0x19')]?_0x1b7998[_0xac4a('0x19')][_0xac4a('0x1d')]||null:null,'limit':_0x1b7998['options']?_0x1b7998[_0xac4a('0x19')][_0xac4a('0x1e')]||null:null})[_0xac4a('0xc')](function(_0x2772fe){logger[_0xac4a('0x13')]('UpdateMailQueueReport',_0x1b7998);logger['debug'](_0xac4a('0x1f'),_0x1b7998,JSON[_0xac4a('0x20')](_0x2772fe));_0x15435c(_0x2772fe);})[_0xac4a('0x14')](function(_0x546b65){logger['error'](_0xac4a('0x1f'),_0x546b65[_0xac4a('0x12')],_0x1b7998);_0x412494(_0x2503d8[_0xac4a('0x10')](0x1f4,_0x546b65[_0xac4a('0x12')]));});});}; \ No newline at end of file diff --git a/server/api/mailServerIn/index.js b/server/api/mailServerIn/index.js index 3181f8b..35576d4 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 _0xcb91=['express','Router','../../components/auth/service','../../components/interaction/service','exports','path','connect-timeout'];(function(_0x10002f,_0xad989){var _0x3b4ef3=function(_0x55782e){while(--_0x55782e){_0x10002f['push'](_0x10002f['shift']());}};_0x3b4ef3(++_0xad989);}(_0xcb91,0x1a9));var _0x1cb9=function(_0x2a5099,_0x329e92){_0x2a5099=_0x2a5099-0x0;var _0x2802f1=_0xcb91[_0x2a5099];return _0x2802f1;};'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 _0xa9e0=['../../components/interaction/service','../../config/environment','exports','multer','util','path','Router','../../components/auth/service'];(function(_0x52d18d,_0x2bdf0d){var _0x3fada0=function(_0x223b8c){while(--_0x223b8c){_0x52d18d['push'](_0x52d18d['shift']());}};_0x3fada0(++_0x2bdf0d);}(_0xa9e0,0x123));var _0x0a9e=function(_0x3b5250,_0x7a0b2c){_0x3b5250=_0x3b5250-0x0;var _0xc844a1=_0xa9e0[_0x3b5250];return _0xc844a1;};'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/mailServerIn/mailServerIn.attributes.js b/server/api/mailServerIn/mailServerIn.attributes.js index a0efdcc..fd984c4 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 _0x9f0a=['BOOLEAN','INTEGER','INBOX','sequelize','STRING'];(function(_0x3f7c0d,_0x883b5){var _0x1d9d40=function(_0x2bf762){while(--_0x2bf762){_0x3f7c0d['push'](_0x3f7c0d['shift']());}};_0x1d9d40(++_0x883b5);}(_0x9f0a,0x1e8));var _0xa9f0=function(_0x435129,_0x496bd6){_0x435129=_0x435129-0x0;var _0x304dc3=_0x9f0a[_0x435129];return _0x304dc3;};'use strict';var Sequelize=require(_0xa9f0('0x0'));module['exports']={'description':{'type':Sequelize[_0xa9f0('0x1')]},'host':{'type':Sequelize[_0xa9f0('0x1')]},'authentication':{'type':Sequelize[_0xa9f0('0x2')],'defaultValue':!![]},'user':{'type':Sequelize[_0xa9f0('0x1')]},'password':{'type':Sequelize[_0xa9f0('0x1')]},'port':{'type':Sequelize[_0xa9f0('0x3')]},'tls':{'type':Sequelize[_0xa9f0('0x2')],'defaultValue':!![]},'mailbox':{'type':Sequelize['STRING'],'defaultValue':_0xa9f0('0x4')},'connTimeout':{'type':Sequelize[_0xa9f0('0x3')],'defaultValue':0xa},'authTimeout':{'type':Sequelize[_0xa9f0('0x3')],'defaultValue':0x5},'service':{'type':Sequelize[_0xa9f0('0x1')]},'modernAuthentication':{'type':Sequelize[_0xa9f0('0x2')],'defaultValue':![]}}; \ No newline at end of file +var _0xd65f=['exports','STRING','BOOLEAN','INTEGER'];(function(_0x289e7a,_0x40b2dc){var _0x47f25d=function(_0x3de664){while(--_0x3de664){_0x289e7a['push'](_0x289e7a['shift']());}};_0x47f25d(++_0x40b2dc);}(_0xd65f,0x198));var _0xfd65=function(_0x41cf04,_0x41e49b){_0x41cf04=_0x41cf04-0x0;var _0x270ada=_0xd65f[_0x41cf04];return _0x270ada;};'use strict';var Sequelize=require('sequelize');module[_0xfd65('0x0')]={'description':{'type':Sequelize['STRING']},'host':{'type':Sequelize[_0xfd65('0x1')]},'authentication':{'type':Sequelize[_0xfd65('0x2')],'defaultValue':!![]},'user':{'type':Sequelize[_0xfd65('0x1')]},'password':{'type':Sequelize[_0xfd65('0x1')]},'port':{'type':Sequelize['INTEGER']},'tls':{'type':Sequelize[_0xfd65('0x2')],'defaultValue':!![]},'mailbox':{'type':Sequelize[_0xfd65('0x1')],'defaultValue':'INBOX'},'connTimeout':{'type':Sequelize['INTEGER'],'defaultValue':0xa},'authTimeout':{'type':Sequelize[_0xfd65('0x3')],'defaultValue':0x5},'service':{'type':Sequelize['STRING']},'modernAuthentication':{'type':Sequelize[_0xfd65('0x2')],'defaultValue':![]}}; \ No newline at end of file diff --git a/server/api/mailServerIn/mailServerIn.model.js b/server/api/mailServerIn/mailServerIn.model.js index dd2337c..848ccfc 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 _0xae5b=['../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./mailServerIn.attributes','define','MailServerIn','mail_servers_in','lodash','util'];(function(_0x59ee6f,_0x450239){var _0x4c0979=function(_0x565e92){while(--_0x565e92){_0x59ee6f['push'](_0x59ee6f['shift']());}};_0x4c0979(++_0x450239);}(_0xae5b,0x15c));var _0xbae5=function(_0x18aa56,_0x1a3f3a){_0x18aa56=_0x18aa56-0x0;var _0x3a1798=_0xae5b[_0x18aa56];return _0x3a1798;};'use strict';var _=require(_0xbae5('0x0'));var util=require(_0xbae5('0x1'));var logger=require(_0xbae5('0x2'))(_0xbae5('0x3'));var moment=require(_0xbae5('0x4'));var BPromise=require(_0xbae5('0x5'));var rp=require(_0xbae5('0x6'));var fs=require('fs');var path=require(_0xbae5('0x7'));var rimraf=require(_0xbae5('0x8'));var config=require(_0xbae5('0x9'));var attributes=require(_0xbae5('0xa'));module['exports']=function(_0x29a277,_0x3fed4d){return _0x29a277[_0xbae5('0xb')](_0xbae5('0xc'),attributes,{'tableName':_0xbae5('0xd'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xeddb=['MailServerIn','mail_servers_in','lodash','util','../../config/logger','api','moment','request-promise','path','../../config/environment','./mailServerIn.attributes','exports','define'];(function(_0x9b7721,_0x36ef2f){var _0x2c92de=function(_0x27e0b4){while(--_0x27e0b4){_0x9b7721['push'](_0x9b7721['shift']());}};_0x2c92de(++_0x36ef2f);}(_0xeddb,0x195));var _0xbedd=function(_0x54d5c8,_0x344ce5){_0x54d5c8=_0x54d5c8-0x0;var _0x525e2e=_0xeddb[_0x54d5c8];return _0x525e2e;};'use strict';var _=require(_0xbedd('0x0'));var util=require(_0xbedd('0x1'));var logger=require(_0xbedd('0x2'))(_0xbedd('0x3'));var moment=require(_0xbedd('0x4'));var BPromise=require('bluebird');var rp=require(_0xbedd('0x5'));var fs=require('fs');var path=require(_0xbedd('0x6'));var rimraf=require('rimraf');var config=require(_0xbedd('0x7'));var attributes=require(_0xbedd('0x8'));module[_0xbedd('0x9')]=function(_0x58f0d1,_0x179b4a){return _0x58f0d1[_0xbedd('0xa')](_0xbedd('0xb'),attributes,{'tableName':_0xbedd('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/mailServerIn/mailServerIn.rpc.js b/server/api/mailServerIn/mailServerIn.rpc.js index 6a662fe..ab03c32 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 _0x51a8=['result','catch','MailServerIn','options','raw','where','attributes','limit','include','model','map','GetMailServerIn','lodash','util','bluebird','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','then','MailServerIn,\x20%s,\x20%s','request\x20sent','MailServerIn,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info'];(function(_0x565c49,_0x54acd0){var _0x20ca34=function(_0x42f7e1){while(--_0x42f7e1){_0x565c49['push'](_0x565c49['shift']());}};_0x20ca34(++_0x54acd0);}(_0x51a8,0xec));var _0x851a=function(_0x4f9edc,_0x260bbe){_0x4f9edc=_0x4f9edc-0x0;var _0x411798=_0x51a8[_0x4f9edc];return _0x411798;};'use strict';var _=require(_0x851a('0x0'));var util=require(_0x851a('0x1'));var moment=require('moment');var BPromise=require(_0x851a('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x851a('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x851a('0x4'));var logger=require(_0x851a('0x5'))(_0x851a('0x6'));var config=require(_0x851a('0x7'));var jayson=require(_0x851a('0x8'));var client=jayson['client'][_0x851a('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x4775c2,_0x233c96,_0x2814c6){return new BPromise(function(_0x16363c,_0x1d16d7){return client[_0x851a('0xa')](_0x4775c2,_0x2814c6)[_0x851a('0xb')](function(_0x1c6dd8){logger['info'](_0x851a('0xc'),_0x233c96,_0x851a('0xd'));logger['debug'](_0x851a('0xe'),_0x233c96,_0x851a('0xd'),JSON[_0x851a('0xf')](_0x1c6dd8));if(_0x1c6dd8[_0x851a('0x10')]){if(_0x1c6dd8['error'][_0x851a('0x11')]===0x1f4){logger[_0x851a('0x10')](_0x851a('0xc'),_0x233c96,_0x1c6dd8[_0x851a('0x10')][_0x851a('0x12')]);return _0x1d16d7(_0x1c6dd8[_0x851a('0x10')][_0x851a('0x12')]);}logger[_0x851a('0x10')](_0x851a('0xc'),_0x233c96,_0x1c6dd8[_0x851a('0x10')][_0x851a('0x12')]);return _0x16363c(_0x1c6dd8[_0x851a('0x10')][_0x851a('0x12')]);}else{logger[_0x851a('0x13')](_0x851a('0xc'),_0x233c96,_0x851a('0xd'));_0x16363c(_0x1c6dd8[_0x851a('0x14')][_0x851a('0x12')]);}})[_0x851a('0x15')](function(_0x1a9141){logger[_0x851a('0x10')](_0x851a('0xc'),_0x233c96,_0x1a9141);_0x1d16d7(_0x1a9141);});});}exports['GetMailServerIn']=function(_0x53b4ce){var _0x41f977=this;return new Promise(function(_0x4c9d2f,_0x467013){return db[_0x851a('0x16')]['findAll']({'raw':_0x53b4ce[_0x851a('0x17')]?_0x53b4ce[_0x851a('0x17')][_0x851a('0x18')]===undefined?!![]:![]:!![],'where':_0x53b4ce[_0x851a('0x17')]?_0x53b4ce[_0x851a('0x17')][_0x851a('0x19')]||null:null,'attributes':_0x53b4ce[_0x851a('0x17')]?_0x53b4ce[_0x851a('0x17')][_0x851a('0x1a')]||null:null,'limit':_0x53b4ce[_0x851a('0x17')]?_0x53b4ce['options'][_0x851a('0x1b')]||null:null,'include':_0x53b4ce[_0x851a('0x17')]?_0x53b4ce[_0x851a('0x17')][_0x851a('0x1c')]?_['map'](_0x53b4ce['options'][_0x851a('0x1c')],function(_0x52d153){return{'model':db[_0x52d153[_0x851a('0x1d')]],'as':_0x52d153['as'],'attributes':_0x52d153[_0x851a('0x1a')],'include':_0x52d153[_0x851a('0x1c')]?_[_0x851a('0x1e')](_0x52d153['include'],function(_0x4ff49c){return{'model':db[_0x4ff49c[_0x851a('0x1d')]],'as':_0x4ff49c['as'],'attributes':_0x4ff49c[_0x851a('0x1a')],'include':_0x4ff49c['include']?_['map'](_0x4ff49c[_0x851a('0x1c')],function(_0x4075bc){return{'model':db[_0x4075bc[_0x851a('0x1d')]],'as':_0x4075bc['as'],'attributes':_0x4075bc[_0x851a('0x1a')]};}):[]};}):[]};}):[]:[]})[_0x851a('0xb')](function(_0x4bce08){logger['info']('GetMailServerIn',_0x53b4ce);logger['debug'](_0x851a('0x1f'),_0x53b4ce,JSON[_0x851a('0xf')](_0x4bce08));_0x4c9d2f(_0x4bce08);})[_0x851a('0x15')](function(_0x40b809){logger[_0x851a('0x10')](_0x851a('0x1f'),_0x40b809[_0x851a('0x12')],_0x53b4ce);_0x467013(_0x41f977[_0x851a('0x10')](0x1f4,_0x40b809[_0x851a('0x12')]));});});}; \ No newline at end of file +var _0xdb94=['request','then','info','MailServerIn,\x20%s,\x20%s','request\x20sent','debug','MailServerIn,\x20%s,\x20%s,\x20%s','error','message','catch','GetMailServerIn','MailServerIn','findAll','options','raw','attributes','limit','include','map','model','stringify','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/environment','http'];(function(_0x266f54,_0xbe0107){var _0x36cea7=function(_0x51e710){while(--_0x51e710){_0x266f54['push'](_0x266f54['shift']());}};_0x36cea7(++_0xbe0107);}(_0xdb94,0xab));var _0x4db9=function(_0x41fdcb,_0x5a843b){_0x41fdcb=_0x41fdcb-0x0;var _0x4e559e=_0xdb94[_0x41fdcb];return _0x4e559e;};'use strict';var _=require(_0x4db9('0x0'));var util=require(_0x4db9('0x1'));var moment=require(_0x4db9('0x2'));var BPromise=require(_0x4db9('0x3'));var rs=require(_0x4db9('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x4db9('0x5'))['db'];var utils=require(_0x4db9('0x6'));var logger=require('../../config/logger')('rpc');var config=require(_0x4db9('0x7'));var jayson=require('jayson/promise');var client=jayson['client'][_0x4db9('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x5d1f45,_0x196ede,_0x50c27a){return new BPromise(function(_0x14deb9,_0x26248b){return client[_0x4db9('0x9')](_0x5d1f45,_0x50c27a)[_0x4db9('0xa')](function(_0x2cacca){logger[_0x4db9('0xb')](_0x4db9('0xc'),_0x196ede,_0x4db9('0xd'));logger[_0x4db9('0xe')](_0x4db9('0xf'),_0x196ede,_0x4db9('0xd'),JSON['stringify'](_0x2cacca));if(_0x2cacca[_0x4db9('0x10')]){if(_0x2cacca[_0x4db9('0x10')]['code']===0x1f4){logger['error'](_0x4db9('0xc'),_0x196ede,_0x2cacca['error']['message']);return _0x26248b(_0x2cacca[_0x4db9('0x10')][_0x4db9('0x11')]);}logger['error'](_0x4db9('0xc'),_0x196ede,_0x2cacca[_0x4db9('0x10')][_0x4db9('0x11')]);return _0x14deb9(_0x2cacca[_0x4db9('0x10')]['message']);}else{logger['info'](_0x4db9('0xc'),_0x196ede,_0x4db9('0xd'));_0x14deb9(_0x2cacca['result'][_0x4db9('0x11')]);}})[_0x4db9('0x12')](function(_0x5d6471){logger['error'](_0x4db9('0xc'),_0x196ede,_0x5d6471);_0x26248b(_0x5d6471);});});}exports[_0x4db9('0x13')]=function(_0x462af3){var _0xa693c4=this;return new Promise(function(_0x1d3c33,_0x55494a){return db[_0x4db9('0x14')][_0x4db9('0x15')]({'raw':_0x462af3[_0x4db9('0x16')]?_0x462af3['options'][_0x4db9('0x17')]===undefined?!![]:![]:!![],'where':_0x462af3[_0x4db9('0x16')]?_0x462af3[_0x4db9('0x16')]['where']||null:null,'attributes':_0x462af3[_0x4db9('0x16')]?_0x462af3[_0x4db9('0x16')][_0x4db9('0x18')]||null:null,'limit':_0x462af3[_0x4db9('0x16')]?_0x462af3[_0x4db9('0x16')][_0x4db9('0x19')]||null:null,'include':_0x462af3[_0x4db9('0x16')]?_0x462af3['options'][_0x4db9('0x1a')]?_[_0x4db9('0x1b')](_0x462af3[_0x4db9('0x16')][_0x4db9('0x1a')],function(_0x4aaa84){return{'model':db[_0x4aaa84[_0x4db9('0x1c')]],'as':_0x4aaa84['as'],'attributes':_0x4aaa84[_0x4db9('0x18')],'include':_0x4aaa84['include']?_[_0x4db9('0x1b')](_0x4aaa84[_0x4db9('0x1a')],function(_0x2987c6){return{'model':db[_0x2987c6['model']],'as':_0x2987c6['as'],'attributes':_0x2987c6[_0x4db9('0x18')],'include':_0x2987c6[_0x4db9('0x1a')]?_[_0x4db9('0x1b')](_0x2987c6[_0x4db9('0x1a')],function(_0x3f9f7e){return{'model':db[_0x3f9f7e[_0x4db9('0x1c')]],'as':_0x3f9f7e['as'],'attributes':_0x3f9f7e[_0x4db9('0x18')]};}):[]};}):[]};}):[]:[]})[_0x4db9('0xa')](function(_0x3d0f12){logger[_0x4db9('0xb')](_0x4db9('0x13'),_0x462af3);logger[_0x4db9('0xe')](_0x4db9('0x13'),_0x462af3,JSON[_0x4db9('0x1d')](_0x3d0f12));_0x1d3c33(_0x3d0f12);})['catch'](function(_0x5031fe){logger[_0x4db9('0x10')](_0x4db9('0x13'),_0x5031fe[_0x4db9('0x11')],_0x462af3);_0x55494a(_0xa693c4[_0x4db9('0x10')](0x1f4,_0x5031fe[_0x4db9('0x11')]));});});}; \ No newline at end of file diff --git a/server/api/mailServerOut/index.js b/server/api/mailServerOut/index.js index befeeaa..39249ca 100644 --- a/server/api/mailServerOut/index.js +++ b/server/api/mailServerOut/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x9957=['multer','util','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./mailServerOut.controller','get','isAuthenticated','index','/:id','show','post','create','put','update','delete','destroy','exports'];(function(_0x1ac595,_0x5d2081){var _0x455fff=function(_0x3043ee){while(--_0x3043ee){_0x1ac595['push'](_0x1ac595['shift']());}};_0x455fff(++_0x5d2081);}(_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('0xe')]('/',auth['isAuthenticated'](),controller[_0x7995('0xf')]);router[_0x7995('0x10')](_0x7995('0xc'),auth[_0x7995('0xa')](),controller[_0x7995('0x11')]);router[_0x7995('0x12')](_0x7995('0xc'),auth['isAuthenticated'](),controller[_0x7995('0x13')]);module[_0x7995('0x14')]=router; \ No newline at end of file +var _0x9957=['multer','util','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./mailServerOut.controller','get','isAuthenticated','index','/:id','show','post','create','put','update','delete','destroy','exports'];(function(_0x3054be,_0x1bdc8b){var _0x3df150=function(_0x56cfbf){while(--_0x56cfbf){_0x3054be['push'](_0x3054be['shift']());}};_0x3df150(++_0x1bdc8b);}(_0x9957,0x93));var _0x7995=function(_0xbca1b1,_0x33f0ce){_0xbca1b1=_0xbca1b1-0x0;var _0x4e1686=_0x9957[_0xbca1b1];return _0x4e1686;};'use strict';var multer=require(_0x7995('0x0'));var util=require(_0x7995('0x1'));var path=require(_0x7995('0x2'));var timeout=require(_0x7995('0x3'));var express=require('express');var router=express[_0x7995('0x4')]();var fs_extra=require(_0x7995('0x5'));var auth=require(_0x7995('0x6'));var interaction=require(_0x7995('0x7'));var config=require('../../config/environment');var controller=require(_0x7995('0x8'));router[_0x7995('0x9')]('/',auth[_0x7995('0xa')](),controller[_0x7995('0xb')]);router[_0x7995('0x9')](_0x7995('0xc'),auth['isAuthenticated'](),controller[_0x7995('0xd')]);router[_0x7995('0xe')]('/',auth['isAuthenticated'](),controller[_0x7995('0xf')]);router[_0x7995('0x10')](_0x7995('0xc'),auth[_0x7995('0xa')](),controller[_0x7995('0x11')]);router[_0x7995('0x12')](_0x7995('0xc'),auth['isAuthenticated'](),controller[_0x7995('0x13')]);module[_0x7995('0x14')]=router; \ No newline at end of file diff --git a/server/api/mailServerOut/mailServerOut.attributes.js b/server/api/mailServerOut/mailServerOut.attributes.js index 5be6dfc..17a1996 100644 --- a/server/api/mailServerOut/mailServerOut.attributes.js +++ b/server/api/mailServerOut/mailServerOut.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xa74f=['BOOLEAN','STRING','INTEGER'];(function(_0x502c7d,_0x2f1285){var _0x30b7ed=function(_0x2d92f3){while(--_0x2d92f3){_0x502c7d['push'](_0x502c7d['shift']());}};_0x30b7ed(++_0x2f1285);}(_0xa74f,0x9a));var _0xfa74=function(_0x416cdc,_0x213b87){_0x416cdc=_0x416cdc-0x0;var _0x1931ce=_0xa74f[_0x416cdc];return _0x1931ce;};'use strict';var Sequelize=require('sequelize');module['exports']={'description':{'type':Sequelize[_0xfa74('0x0')]},'host':{'type':Sequelize['STRING']},'user':{'type':Sequelize['STRING']},'pass':{'type':Sequelize[_0xfa74('0x0')]},'port':{'type':Sequelize[_0xfa74('0x1')]},'secure':{'type':Sequelize[_0xfa74('0x2')],'defaultValue':![]},'service':{'type':Sequelize[_0xfa74('0x0')]},'authentication':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'modernAuthentication':{'type':Sequelize[_0xfa74('0x2')],'defaultValue':![]}}; \ No newline at end of file +var _0x4e81=['exports','STRING','INTEGER','BOOLEAN','sequelize'];(function(_0x57f7ea,_0x54da6b){var _0x54a7e4=function(_0x2c9d4f){while(--_0x2c9d4f){_0x57f7ea['push'](_0x57f7ea['shift']());}};_0x54a7e4(++_0x54da6b);}(_0x4e81,0x1bc));var _0x14e8=function(_0x515283,_0x813dea){_0x515283=_0x515283-0x0;var _0x38f836=_0x4e81[_0x515283];return _0x38f836;};'use strict';var Sequelize=require(_0x14e8('0x0'));module[_0x14e8('0x1')]={'description':{'type':Sequelize[_0x14e8('0x2')]},'host':{'type':Sequelize['STRING']},'user':{'type':Sequelize['STRING']},'pass':{'type':Sequelize['STRING']},'port':{'type':Sequelize[_0x14e8('0x3')]},'secure':{'type':Sequelize[_0x14e8('0x4')],'defaultValue':![]},'service':{'type':Sequelize[_0x14e8('0x2')]},'authentication':{'type':Sequelize[_0x14e8('0x4')],'defaultValue':!![]},'modernAuthentication':{'type':Sequelize[_0x14e8('0x4')],'defaultValue':![]}}; \ No newline at end of file diff --git a/server/api/mailServerOut/mailServerOut.controller.js b/server/api/mailServerOut/mailServerOut.controller.js index 2ed5721..52cb096 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 _0x5c28=['findAll','rows','catch','show','params','find','create','body','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','path','sox','squel','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','api','../../config/environment','../../config/license/util','../../mysqldb','status','end','json','limit','undefined','count','offset','Content-Range','apply','reject','save','update','then','destroy','sendStatus','error','stack','map','fieldName','type','model','query','keys','intersection','fields','attributes','length','nolimit','order','sort','pick','filters','where','merge','VIRTUAL','name','filter','options','MailServerOut','includeAll','include'];(function(_0x1a0396,_0x7ee349){var _0xfefa06=function(_0x2e24a0){while(--_0x2e24a0){_0x1a0396['push'](_0x1a0396['shift']());}};_0xfefa06(++_0x7ee349);}(_0x5c28,0x124));var _0x85c2=function(_0x5baa47,_0x3d1f3d){_0x5baa47=_0x5baa47-0x0;var _0x3cd15f=_0x5c28[_0x5baa47];return _0x3cd15f;};'use strict';var emlformat=require(_0x85c2('0x0'));var rimraf=require(_0x85c2('0x1'));var zipdir=require(_0x85c2('0x2'));var jsonpatch=require(_0x85c2('0x3'));var rp=require(_0x85c2('0x4'));var moment=require('moment');var BPromise=require(_0x85c2('0x5'));var Mustache=require(_0x85c2('0x6'));var util=require('util');var path=require(_0x85c2('0x7'));var sox=require(_0x85c2('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(_0x85c2('0x9'));var crypto=require('crypto');var jsforce=require(_0x85c2('0xa'));var deskjs=require(_0x85c2('0xb'));var toCsv=require(_0x85c2('0xc'));var querystring=require(_0x85c2('0xd'));var Papa=require(_0x85c2('0xe'));var Redis=require(_0x85c2('0xf'));var authService=require(_0x85c2('0x10'));var qs=require(_0x85c2('0x11'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x85c2('0x12'));var utils=require('../../config/utils');var config=require(_0x85c2('0x13'));var licenseUtil=require(_0x85c2('0x14'));var db=require(_0x85c2('0x15'))['db'];function respondWithStatusCode(_0x39ae92,_0x46ee83){_0x46ee83=_0x46ee83||0xcc;return function(_0xd6b594){if(_0xd6b594){return _0x39ae92['sendStatus'](_0x46ee83);}return _0x39ae92[_0x85c2('0x16')](_0x46ee83)[_0x85c2('0x17')]();};}function respondWithResult(_0x18a0de,_0x41533b){_0x41533b=_0x41533b||0xc8;return function(_0x9b062a){if(_0x9b062a){return _0x18a0de['status'](_0x41533b)[_0x85c2('0x18')](_0x9b062a);}};}function respondWithFilteredResult(_0x3d336c,_0x6c9944){return function(_0x277a9a){if(_0x277a9a){var _0x140640=typeof _0x6c9944['offset']==='undefined'&&typeof _0x6c9944[_0x85c2('0x19')]===_0x85c2('0x1a');var _0xdbf0ee=_0x277a9a['count'];var _0x32844f=_0x140640?0x0:_0x6c9944['offset'];var _0x3e55e0=_0x140640?_0x277a9a[_0x85c2('0x1b')]:_0x6c9944[_0x85c2('0x1c')]+_0x6c9944[_0x85c2('0x19')];var _0x23ac2c;if(_0x3e55e0>=_0xdbf0ee){_0x3e55e0=_0xdbf0ee;_0x23ac2c=0xc8;}else{_0x23ac2c=0xce;}_0x3d336c['status'](_0x23ac2c);return _0x3d336c['set'](_0x85c2('0x1d'),_0x32844f+'-'+_0x3e55e0+'/'+_0xdbf0ee)['json'](_0x277a9a);}return null;};}function patchUpdates(_0xf59a77){return function(_0x32e598){try{jsonpatch[_0x85c2('0x1e')](_0x32e598,_0xf59a77,!![]);}catch(_0x31eac6){return BPromise[_0x85c2('0x1f')](_0x31eac6);}return _0x32e598[_0x85c2('0x20')]();};}function saveUpdates(_0x30eeed,_0xcfe362){return function(_0x32b812){if(_0x32b812){return _0x32b812[_0x85c2('0x21')](_0x30eeed)[_0x85c2('0x22')](function(_0x310be8){return _0x310be8;});}return null;};}function removeEntity(_0x5aeefc,_0xcd0f72){return function(_0x574e52){if(_0x574e52){return _0x574e52[_0x85c2('0x23')]()[_0x85c2('0x22')](function(){_0x5aeefc[_0x85c2('0x16')](0xcc)[_0x85c2('0x17')]();});}};}function handleEntityNotFound(_0x39d77d,_0x267a1e){return function(_0x53504f){if(!_0x53504f){_0x39d77d[_0x85c2('0x24')](0x194);}return _0x53504f;};}function handleError(_0x8ecf85,_0x54e9f8){_0x54e9f8=_0x54e9f8||0x1f4;return function(_0x3b34a8){logger[_0x85c2('0x25')](_0x3b34a8[_0x85c2('0x26')]);if(_0x3b34a8['name']){delete _0x3b34a8['name'];}_0x8ecf85[_0x85c2('0x16')](_0x54e9f8)['send'](_0x3b34a8);};}exports['index']=function(_0x25ebe8,_0xc1ba2f){var _0x29ba2e={},_0x2f0517={},_0x2a4d5a={'count':0x0,'rows':[]};var _0x218377=_[_0x85c2('0x27')](db['MailServerOut']['rawAttributes'],function(_0x2d5e5f){return{'name':_0x2d5e5f[_0x85c2('0x28')],'type':_0x2d5e5f[_0x85c2('0x29')]['key']};});_0x2f0517[_0x85c2('0x2a')]=_[_0x85c2('0x27')](_0x218377,'name');_0x2f0517[_0x85c2('0x2b')]=_[_0x85c2('0x2c')](_0x25ebe8[_0x85c2('0x2b')]);_0x2f0517['filters']=_[_0x85c2('0x2d')](_0x2f0517['model'],_0x2f0517[_0x85c2('0x2b')]);_0x29ba2e['attributes']=_['intersection'](_0x2f0517[_0x85c2('0x2a')],qs[_0x85c2('0x2e')](_0x25ebe8[_0x85c2('0x2b')][_0x85c2('0x2e')]));_0x29ba2e[_0x85c2('0x2f')]=_0x29ba2e[_0x85c2('0x2f')][_0x85c2('0x30')]?_0x29ba2e['attributes']:_0x2f0517[_0x85c2('0x2a')];if(!_0x25ebe8[_0x85c2('0x2b')]['hasOwnProperty'](_0x85c2('0x31'))){_0x29ba2e[_0x85c2('0x19')]=qs[_0x85c2('0x19')](_0x25ebe8[_0x85c2('0x2b')][_0x85c2('0x19')]);_0x29ba2e[_0x85c2('0x1c')]=qs[_0x85c2('0x1c')](_0x25ebe8['query']['offset']);}_0x29ba2e[_0x85c2('0x32')]=qs[_0x85c2('0x33')](_0x25ebe8['query'][_0x85c2('0x33')]);_0x29ba2e['where']=qs['filters'](_[_0x85c2('0x34')](_0x25ebe8[_0x85c2('0x2b')],_0x2f0517[_0x85c2('0x35')]),_0x218377);if(_0x25ebe8[_0x85c2('0x2b')]['filter']){_0x29ba2e[_0x85c2('0x36')]=_[_0x85c2('0x37')](_0x29ba2e[_0x85c2('0x36')],{'$or':_[_0x85c2('0x27')](_0x218377,function(_0x37e44d){if(_0x37e44d[_0x85c2('0x29')]!==_0x85c2('0x38')){var _0x5be5a1={};_0x5be5a1[_0x37e44d[_0x85c2('0x39')]]={'$like':'%'+_0x25ebe8[_0x85c2('0x2b')][_0x85c2('0x3a')]+'%'};return _0x5be5a1;}})});}_0x29ba2e=_[_0x85c2('0x37')]({},_0x29ba2e,_0x25ebe8[_0x85c2('0x3b')]);var _0x54556e={'where':_0x29ba2e[_0x85c2('0x36')]};return db[_0x85c2('0x3c')][_0x85c2('0x1b')](_0x54556e)[_0x85c2('0x22')](function(_0x13b176){_0x2a4d5a[_0x85c2('0x1b')]=_0x13b176;if(_0x25ebe8[_0x85c2('0x2b')][_0x85c2('0x3d')]){_0x29ba2e[_0x85c2('0x3e')]=[{'all':!![]}];}return db[_0x85c2('0x3c')][_0x85c2('0x3f')](_0x29ba2e);})[_0x85c2('0x22')](function(_0x505614){_0x2a4d5a[_0x85c2('0x40')]=_0x505614;return _0x2a4d5a;})[_0x85c2('0x22')](respondWithFilteredResult(_0xc1ba2f,_0x29ba2e))[_0x85c2('0x41')](handleError(_0xc1ba2f,null));};exports[_0x85c2('0x42')]=function(_0x28d951,_0x13bbe7){var _0x5901b5={'raw':!![],'where':{'id':_0x28d951[_0x85c2('0x43')]['id']}},_0x4d9f7e={};_0x4d9f7e[_0x85c2('0x2a')]=_[_0x85c2('0x2c')](db[_0x85c2('0x3c')]['rawAttributes']);_0x4d9f7e['query']=_['keys'](_0x28d951[_0x85c2('0x2b')]);_0x4d9f7e[_0x85c2('0x35')]=_[_0x85c2('0x2d')](_0x4d9f7e[_0x85c2('0x2a')],_0x4d9f7e[_0x85c2('0x2b')]);_0x5901b5[_0x85c2('0x2f')]=_[_0x85c2('0x2d')](_0x4d9f7e[_0x85c2('0x2a')],qs[_0x85c2('0x2e')](_0x28d951['query'][_0x85c2('0x2e')]));_0x5901b5[_0x85c2('0x2f')]=_0x5901b5[_0x85c2('0x2f')]['length']?_0x5901b5['attributes']:_0x4d9f7e[_0x85c2('0x2a')];if(_0x28d951[_0x85c2('0x2b')][_0x85c2('0x3d')]){_0x5901b5[_0x85c2('0x3e')]=[{'all':!![]}];}_0x5901b5=_[_0x85c2('0x37')]({},_0x5901b5,_0x28d951[_0x85c2('0x3b')]);return db['MailServerOut'][_0x85c2('0x44')](_0x5901b5)[_0x85c2('0x22')](handleEntityNotFound(_0x13bbe7,null))[_0x85c2('0x22')](respondWithResult(_0x13bbe7,null))['catch'](handleError(_0x13bbe7,null));};exports[_0x85c2('0x45')]=function(_0x4874c4,_0x46edf9){return db[_0x85c2('0x3c')][_0x85c2('0x45')](_0x4874c4[_0x85c2('0x46')],{})['then'](respondWithResult(_0x46edf9,0xc9))[_0x85c2('0x41')](handleError(_0x46edf9,null));};exports[_0x85c2('0x21')]=function(_0x922dfd,_0x2f4ca3){if(_0x922dfd[_0x85c2('0x46')]['id']){delete _0x922dfd[_0x85c2('0x46')]['id'];}return db['MailServerOut']['find']({'where':{'id':_0x922dfd[_0x85c2('0x43')]['id']}})['then'](handleEntityNotFound(_0x2f4ca3,null))['then'](saveUpdates(_0x922dfd[_0x85c2('0x46')],null))[_0x85c2('0x22')](respondWithResult(_0x2f4ca3,null))['catch'](handleError(_0x2f4ca3,null));};exports[_0x85c2('0x23')]=function(_0x441ab6,_0x39bc4c){return db[_0x85c2('0x3c')][_0x85c2('0x44')]({'where':{'id':_0x441ab6[_0x85c2('0x43')]['id']}})[_0x85c2('0x22')](handleEntityNotFound(_0x39bc4c,null))[_0x85c2('0x22')](removeEntity(_0x39bc4c,null))[_0x85c2('0x41')](handleError(_0x39bc4c,null));}; \ No newline at end of file +var _0x9ccc=['rawAttributes','fieldName','type','key','model','query','keys','filters','attributes','intersection','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','merge','options','includeAll','include','findAll','rows','catch','show','find','create','body','update','params','eml-format','rimraf','zip-dir','request-promise','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','Content-Range','save','then','destroy','error','name','map','MailServerOut'];(function(_0x4a8f28,_0x35a00c){var _0x44afb3=function(_0x420ff8){while(--_0x420ff8){_0x4a8f28['push'](_0x4a8f28['shift']());}};_0x44afb3(++_0x35a00c);}(_0x9ccc,0x1db));var _0xc9cc=function(_0x4e127a,_0x4cbf14){_0x4e127a=_0x4e127a-0x0;var _0x3d13e8=_0x9ccc[_0x4e127a];return _0x3d13e8;};'use strict';var emlformat=require(_0xc9cc('0x0'));var rimraf=require(_0xc9cc('0x1'));var zipdir=require(_0xc9cc('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0xc9cc('0x3'));var moment=require('moment');var BPromise=require(_0xc9cc('0x4'));var Mustache=require(_0xc9cc('0x5'));var util=require(_0xc9cc('0x6'));var path=require(_0xc9cc('0x7'));var sox=require(_0xc9cc('0x8'));var csv=require(_0xc9cc('0x9'));var ejs=require(_0xc9cc('0xa'));var fs=require('fs');var fs_extra=require(_0xc9cc('0xb'));var _=require(_0xc9cc('0xc'));var squel=require(_0xc9cc('0xd'));var crypto=require(_0xc9cc('0xe'));var jsforce=require(_0xc9cc('0xf'));var deskjs=require(_0xc9cc('0x10'));var toCsv=require(_0xc9cc('0x9'));var querystring=require(_0xc9cc('0x11'));var Papa=require(_0xc9cc('0x12'));var Redis=require(_0xc9cc('0x13'));var authService=require(_0xc9cc('0x14'));var qs=require(_0xc9cc('0x15'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xc9cc('0x16'));var logger=require(_0xc9cc('0x17'))('api');var utils=require(_0xc9cc('0x18'));var config=require('../../config/environment');var licenseUtil=require(_0xc9cc('0x19'));var db=require(_0xc9cc('0x1a'))['db'];function respondWithStatusCode(_0x50513b,_0x3ee905){_0x3ee905=_0x3ee905||0xcc;return function(_0x11b5a1){if(_0x11b5a1){return _0x50513b[_0xc9cc('0x1b')](_0x3ee905);}return _0x50513b[_0xc9cc('0x1c')](_0x3ee905)[_0xc9cc('0x1d')]();};}function respondWithResult(_0x18decc,_0x49d33b){_0x49d33b=_0x49d33b||0xc8;return function(_0x45c19d){if(_0x45c19d){return _0x18decc[_0xc9cc('0x1c')](_0x49d33b)[_0xc9cc('0x1e')](_0x45c19d);}};}function respondWithFilteredResult(_0xfd1da2,_0xc057d4){return function(_0x2e4d75){if(_0x2e4d75){var _0x2fa91f=typeof _0xc057d4[_0xc9cc('0x1f')]===_0xc9cc('0x20')&&typeof _0xc057d4[_0xc9cc('0x21')]===_0xc9cc('0x20');var _0x458558=_0x2e4d75[_0xc9cc('0x22')];var _0xa738f=_0x2fa91f?0x0:_0xc057d4[_0xc9cc('0x1f')];var _0x3c2260=_0x2fa91f?_0x2e4d75[_0xc9cc('0x22')]:_0xc057d4[_0xc9cc('0x1f')]+_0xc057d4[_0xc9cc('0x21')];var _0x205973;if(_0x3c2260>=_0x458558){_0x3c2260=_0x458558;_0x205973=0xc8;}else{_0x205973=0xce;}_0xfd1da2[_0xc9cc('0x1c')](_0x205973);return _0xfd1da2['set'](_0xc9cc('0x23'),_0xa738f+'-'+_0x3c2260+'/'+_0x458558)[_0xc9cc('0x1e')](_0x2e4d75);}return null;};}function patchUpdates(_0x383c3c){return function(_0x1c2396){try{jsonpatch['apply'](_0x1c2396,_0x383c3c,!![]);}catch(_0x5e0a2b){return BPromise['reject'](_0x5e0a2b);}return _0x1c2396[_0xc9cc('0x24')]();};}function saveUpdates(_0x47e7e5,_0x45f915){return function(_0xb926c5){if(_0xb926c5){return _0xb926c5['update'](_0x47e7e5)[_0xc9cc('0x25')](function(_0x110fa4){return _0x110fa4;});}return null;};}function removeEntity(_0x34c8dd,_0x735f96){return function(_0x59b15f){if(_0x59b15f){return _0x59b15f[_0xc9cc('0x26')]()[_0xc9cc('0x25')](function(){_0x34c8dd[_0xc9cc('0x1c')](0xcc)[_0xc9cc('0x1d')]();});}};}function handleEntityNotFound(_0x3194aa,_0x129f4a){return function(_0x192812){if(!_0x192812){_0x3194aa[_0xc9cc('0x1b')](0x194);}return _0x192812;};}function handleError(_0x358941,_0x37eba6){_0x37eba6=_0x37eba6||0x1f4;return function(_0x2d84c9){logger[_0xc9cc('0x27')](_0x2d84c9['stack']);if(_0x2d84c9[_0xc9cc('0x28')]){delete _0x2d84c9[_0xc9cc('0x28')];}_0x358941[_0xc9cc('0x1c')](_0x37eba6)['send'](_0x2d84c9);};}exports['index']=function(_0x26e686,_0x3f87a0){var _0x169c7d={},_0x29667c={},_0x28b9bd={'count':0x0,'rows':[]};var _0x426560=_[_0xc9cc('0x29')](db[_0xc9cc('0x2a')][_0xc9cc('0x2b')],function(_0x10385b){return{'name':_0x10385b[_0xc9cc('0x2c')],'type':_0x10385b[_0xc9cc('0x2d')][_0xc9cc('0x2e')]};});_0x29667c[_0xc9cc('0x2f')]=_[_0xc9cc('0x29')](_0x426560,'name');_0x29667c[_0xc9cc('0x30')]=_[_0xc9cc('0x31')](_0x26e686[_0xc9cc('0x30')]);_0x29667c[_0xc9cc('0x32')]=_['intersection'](_0x29667c['model'],_0x29667c['query']);_0x169c7d[_0xc9cc('0x33')]=_[_0xc9cc('0x34')](_0x29667c[_0xc9cc('0x2f')],qs[_0xc9cc('0x35')](_0x26e686['query'][_0xc9cc('0x35')]));_0x169c7d['attributes']=_0x169c7d[_0xc9cc('0x33')][_0xc9cc('0x36')]?_0x169c7d[_0xc9cc('0x33')]:_0x29667c[_0xc9cc('0x2f')];if(!_0x26e686[_0xc9cc('0x30')][_0xc9cc('0x37')](_0xc9cc('0x38'))){_0x169c7d[_0xc9cc('0x21')]=qs[_0xc9cc('0x21')](_0x26e686[_0xc9cc('0x30')][_0xc9cc('0x21')]);_0x169c7d[_0xc9cc('0x1f')]=qs[_0xc9cc('0x1f')](_0x26e686['query'][_0xc9cc('0x1f')]);}_0x169c7d[_0xc9cc('0x39')]=qs[_0xc9cc('0x3a')](_0x26e686[_0xc9cc('0x30')]['sort']);_0x169c7d[_0xc9cc('0x3b')]=qs[_0xc9cc('0x32')](_[_0xc9cc('0x3c')](_0x26e686[_0xc9cc('0x30')],_0x29667c[_0xc9cc('0x32')]),_0x426560);if(_0x26e686[_0xc9cc('0x30')]['filter']){_0x169c7d['where']=_[_0xc9cc('0x3d')](_0x169c7d[_0xc9cc('0x3b')],{'$or':_['map'](_0x426560,function(_0x1a7a98){if(_0x1a7a98[_0xc9cc('0x2d')]!=='VIRTUAL'){var _0x391a59={};_0x391a59[_0x1a7a98[_0xc9cc('0x28')]]={'$like':'%'+_0x26e686['query']['filter']+'%'};return _0x391a59;}})});}_0x169c7d=_['merge']({},_0x169c7d,_0x26e686[_0xc9cc('0x3e')]);var _0x28535f={'where':_0x169c7d[_0xc9cc('0x3b')]};return db['MailServerOut'][_0xc9cc('0x22')](_0x28535f)['then'](function(_0x4c21bc){_0x28b9bd[_0xc9cc('0x22')]=_0x4c21bc;if(_0x26e686['query'][_0xc9cc('0x3f')]){_0x169c7d[_0xc9cc('0x40')]=[{'all':!![]}];}return db[_0xc9cc('0x2a')][_0xc9cc('0x41')](_0x169c7d);})[_0xc9cc('0x25')](function(_0x3c51b1){_0x28b9bd[_0xc9cc('0x42')]=_0x3c51b1;return _0x28b9bd;})['then'](respondWithFilteredResult(_0x3f87a0,_0x169c7d))[_0xc9cc('0x43')](handleError(_0x3f87a0,null));};exports[_0xc9cc('0x44')]=function(_0x12aa81,_0x551263){var _0x1050eb={'raw':!![],'where':{'id':_0x12aa81['params']['id']}},_0x71be5e={};_0x71be5e['model']=_[_0xc9cc('0x31')](db['MailServerOut'][_0xc9cc('0x2b')]);_0x71be5e[_0xc9cc('0x30')]=_[_0xc9cc('0x31')](_0x12aa81['query']);_0x71be5e[_0xc9cc('0x32')]=_['intersection'](_0x71be5e[_0xc9cc('0x2f')],_0x71be5e[_0xc9cc('0x30')]);_0x1050eb[_0xc9cc('0x33')]=_[_0xc9cc('0x34')](_0x71be5e['model'],qs[_0xc9cc('0x35')](_0x12aa81[_0xc9cc('0x30')]['fields']));_0x1050eb[_0xc9cc('0x33')]=_0x1050eb['attributes'][_0xc9cc('0x36')]?_0x1050eb[_0xc9cc('0x33')]:_0x71be5e[_0xc9cc('0x2f')];if(_0x12aa81['query'][_0xc9cc('0x3f')]){_0x1050eb['include']=[{'all':!![]}];}_0x1050eb=_['merge']({},_0x1050eb,_0x12aa81['options']);return db[_0xc9cc('0x2a')][_0xc9cc('0x45')](_0x1050eb)['then'](handleEntityNotFound(_0x551263,null))['then'](respondWithResult(_0x551263,null))[_0xc9cc('0x43')](handleError(_0x551263,null));};exports['create']=function(_0x5bd9ff,_0x39c58c){return db[_0xc9cc('0x2a')][_0xc9cc('0x46')](_0x5bd9ff[_0xc9cc('0x47')],{})[_0xc9cc('0x25')](respondWithResult(_0x39c58c,0xc9))[_0xc9cc('0x43')](handleError(_0x39c58c,null));};exports[_0xc9cc('0x48')]=function(_0x2ddc4a,_0x424198){if(_0x2ddc4a[_0xc9cc('0x47')]['id']){delete _0x2ddc4a['body']['id'];}return db[_0xc9cc('0x2a')]['find']({'where':{'id':_0x2ddc4a[_0xc9cc('0x49')]['id']}})[_0xc9cc('0x25')](handleEntityNotFound(_0x424198,null))['then'](saveUpdates(_0x2ddc4a[_0xc9cc('0x47')],null))[_0xc9cc('0x25')](respondWithResult(_0x424198,null))[_0xc9cc('0x43')](handleError(_0x424198,null));};exports[_0xc9cc('0x26')]=function(_0x9ad37d,_0x1f4bb4){return db[_0xc9cc('0x2a')]['find']({'where':{'id':_0x9ad37d['params']['id']}})['then'](handleEntityNotFound(_0x1f4bb4,null))[_0xc9cc('0x25')](removeEntity(_0x1f4bb4,null))['catch'](handleError(_0x1f4bb4,null));}; \ No newline at end of file diff --git a/server/api/mailServerOut/mailServerOut.model.js b/server/api/mailServerOut/mailServerOut.model.js index 9ffc0fe..983ef33 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 _0x3224=['../../config/environment','./mailServerOut.attributes','exports','define','MailServerOut','mail_servers_out','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path'];(function(_0x3bd058,_0x589e62){var _0x49a71a=function(_0x3a65ee){while(--_0x3a65ee){_0x3bd058['push'](_0x3bd058['shift']());}};_0x49a71a(++_0x589e62);}(_0x3224,0x148));var _0x4322=function(_0x47568e,_0x5ccdaf){_0x47568e=_0x47568e-0x0;var _0x33815b=_0x3224[_0x47568e];return _0x33815b;};'use strict';var _=require(_0x4322('0x0'));var util=require(_0x4322('0x1'));var logger=require(_0x4322('0x2'))(_0x4322('0x3'));var moment=require(_0x4322('0x4'));var BPromise=require(_0x4322('0x5'));var rp=require(_0x4322('0x6'));var fs=require('fs');var path=require(_0x4322('0x7'));var rimraf=require('rimraf');var config=require(_0x4322('0x8'));var attributes=require(_0x4322('0x9'));module[_0x4322('0xa')]=function(_0x383e1e,_0x4336fe){return _0x383e1e[_0x4322('0xb')](_0x4322('0xc'),attributes,{'tableName':_0x4322('0xd'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xed0e=['rimraf','../../config/environment','./mailServerOut.attributes','exports','MailServerOut','lodash','util','api','moment','path'];(function(_0x18f64a,_0x1c8248){var _0x44687f=function(_0x1234ad){while(--_0x1234ad){_0x18f64a['push'](_0x18f64a['shift']());}};_0x44687f(++_0x1c8248);}(_0xed0e,0x1d1));var _0xeed0=function(_0x23e7c1,_0x35110c){_0x23e7c1=_0x23e7c1-0x0;var _0x1add43=_0xed0e[_0x23e7c1];return _0x1add43;};'use strict';var _=require(_0xeed0('0x0'));var util=require(_0xeed0('0x1'));var logger=require('../../config/logger')(_0xeed0('0x2'));var moment=require(_0xeed0('0x3'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0xeed0('0x4'));var rimraf=require(_0xeed0('0x5'));var config=require(_0xeed0('0x6'));var attributes=require(_0xeed0('0x7'));module[_0xeed0('0x8')]=function(_0x36535f,_0x1148c2){return _0x36535f['define'](_0xeed0('0x9'),attributes,{'tableName':'mail_servers_out','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/mailServerOut/mailServerOut.rpc.js b/server/api/mailServerOut/mailServerOut.rpc.js index 2d786bc..090fa08 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(_0x605980,_0x324097){var _0x3eb7b2=function(_0x57fb70){while(--_0x57fb70){_0x605980['push'](_0x605980['shift']());}};_0x3eb7b2(++_0x324097);}(_0xc4aa,0x1b7));var _0xac4a=function(_0x5f09c5,_0x2bfca0){_0x5f09c5=_0x5f09c5-0x0;var _0x426ad9=_0xc4aa[_0x5f09c5];return _0x426ad9;};'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 _0x1261=['then','info','MailServerOut,\x20%s,\x20%s','request\x20sent','MailServerOut,\x20%s,\x20%s,\x20%s','error','code','message','catch','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','http','request'];(function(_0x503b5a,_0x1b6199){var _0x8db1d2=function(_0x76ac6d){while(--_0x76ac6d){_0x503b5a['push'](_0x503b5a['shift']());}};_0x8db1d2(++_0x1b6199);}(_0x1261,0x144));var _0x1126=function(_0x4ca89a,_0x33ffb8){_0x4ca89a=_0x4ca89a-0x0;var _0xfeb04d=_0x1261[_0x4ca89a];return _0xfeb04d;};'use strict';var _=require('lodash');var util=require(_0x1126('0x0'));var moment=require(_0x1126('0x1'));var BPromise=require(_0x1126('0x2'));var rs=require(_0x1126('0x3'));var fs=require('fs');var Redis=require(_0x1126('0x4'));var db=require(_0x1126('0x5'))['db'];var utils=require(_0x1126('0x6'));var logger=require(_0x1126('0x7'))(_0x1126('0x8'));var config=require(_0x1126('0x9'));var jayson=require('jayson/promise');var client=jayson['client'][_0x1126('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x907180,_0x4f239c,_0x17e5f0){return new BPromise(function(_0x28772d,_0x245be9){return client[_0x1126('0xb')](_0x907180,_0x17e5f0)[_0x1126('0xc')](function(_0x59cfa1){logger[_0x1126('0xd')](_0x1126('0xe'),_0x4f239c,_0x1126('0xf'));logger['debug'](_0x1126('0x10'),_0x4f239c,'request\x20sent',JSON['stringify'](_0x59cfa1));if(_0x59cfa1[_0x1126('0x11')]){if(_0x59cfa1['error'][_0x1126('0x12')]===0x1f4){logger[_0x1126('0x11')](_0x1126('0xe'),_0x4f239c,_0x59cfa1[_0x1126('0x11')][_0x1126('0x13')]);return _0x245be9(_0x59cfa1[_0x1126('0x11')][_0x1126('0x13')]);}logger[_0x1126('0x11')](_0x1126('0xe'),_0x4f239c,_0x59cfa1['error']['message']);return _0x28772d(_0x59cfa1[_0x1126('0x11')][_0x1126('0x13')]);}else{logger[_0x1126('0xd')]('MailServerOut,\x20%s,\x20%s',_0x4f239c,_0x1126('0xf'));_0x28772d(_0x59cfa1['result'][_0x1126('0x13')]);}})[_0x1126('0x14')](function(_0x257b5f){logger['error'](_0x1126('0xe'),_0x4f239c,_0x257b5f);_0x245be9(_0x257b5f);});});} \ No newline at end of file diff --git a/server/api/mailSubstatus/index.js b/server/api/mailSubstatus/index.js index ad0f2bb..5238411 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 _0x1367=['../../components/auth/service','../../components/interaction/service','../../config/environment','./mailSubstatus.controller','get','isAuthenticated','index','/describe','describe','/:id','show','post','create','put','update','delete','destroy','exports','util','path','connect-timeout','express','Router','fs-extra'];(function(_0x14477e,_0x44d4da){var _0x5d4a05=function(_0x5e0fa3){while(--_0x5e0fa3){_0x14477e['push'](_0x14477e['shift']());}};_0x5d4a05(++_0x44d4da);}(_0x1367,0x1f2));var _0x7136=function(_0x90f34f,_0x404021){_0x90f34f=_0x90f34f-0x0;var _0x4b18cf=_0x1367[_0x90f34f];return _0x4b18cf;};'use strict';var multer=require('multer');var util=require(_0x7136('0x0'));var path=require(_0x7136('0x1'));var timeout=require(_0x7136('0x2'));var express=require(_0x7136('0x3'));var router=express[_0x7136('0x4')]();var fs_extra=require(_0x7136('0x5'));var auth=require(_0x7136('0x6'));var interaction=require(_0x7136('0x7'));var config=require(_0x7136('0x8'));var controller=require(_0x7136('0x9'));router[_0x7136('0xa')]('/',auth[_0x7136('0xb')](),controller[_0x7136('0xc')]);router[_0x7136('0xa')](_0x7136('0xd'),auth[_0x7136('0xb')](),controller[_0x7136('0xe')]);router[_0x7136('0xa')](_0x7136('0xf'),auth[_0x7136('0xb')](),controller[_0x7136('0x10')]);router[_0x7136('0x11')]('/',auth['isAuthenticated'](),controller[_0x7136('0x12')]);router[_0x7136('0x13')]('/:id',auth['isAuthenticated'](),controller[_0x7136('0x14')]);router[_0x7136('0x15')](_0x7136('0xf'),auth['isAuthenticated'](),controller[_0x7136('0x16')]);module[_0x7136('0x17')]=router; \ No newline at end of file +var _0x6bd9=['get','isAuthenticated','index','/describe','describe','/:id','post','create','put','delete','exports','multer','util','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../config/environment','./mailSubstatus.controller'];(function(_0x26e845,_0x3e6ffd){var _0x29e209=function(_0x3e0556){while(--_0x3e0556){_0x26e845['push'](_0x26e845['shift']());}};_0x29e209(++_0x3e6ffd);}(_0x6bd9,0x83));var _0x96bd=function(_0x5f4805,_0x5be086){_0x5f4805=_0x5f4805-0x0;var _0x3c5ca6=_0x6bd9[_0x5f4805];return _0x3c5ca6;};'use strict';var multer=require(_0x96bd('0x0'));var util=require(_0x96bd('0x1'));var path=require(_0x96bd('0x2'));var timeout=require(_0x96bd('0x3'));var express=require('express');var router=express[_0x96bd('0x4')]();var fs_extra=require(_0x96bd('0x5'));var auth=require(_0x96bd('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0x96bd('0x7'));var controller=require(_0x96bd('0x8'));router[_0x96bd('0x9')]('/',auth[_0x96bd('0xa')](),controller[_0x96bd('0xb')]);router['get'](_0x96bd('0xc'),auth[_0x96bd('0xa')](),controller[_0x96bd('0xd')]);router[_0x96bd('0x9')](_0x96bd('0xe'),auth[_0x96bd('0xa')](),controller['show']);router[_0x96bd('0xf')]('/',auth[_0x96bd('0xa')](),controller[_0x96bd('0x10')]);router[_0x96bd('0x11')](_0x96bd('0xe'),auth[_0x96bd('0xa')](),controller['update']);router[_0x96bd('0x12')](_0x96bd('0xe'),auth[_0x96bd('0xa')](),controller['destroy']);module[_0x96bd('0x13')]=router; \ No newline at end of file diff --git a/server/api/mailSubstatus/mailSubstatus.attributes.js b/server/api/mailSubstatus/mailSubstatus.attributes.js index f606e77..6eaa6b7 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 _0x27a0=['STRING','name','exports'];(function(_0x789b06,_0x38e1b0){var _0x22ff8b=function(_0x1bccb2){while(--_0x1bccb2){_0x789b06['push'](_0x789b06['shift']());}};_0x22ff8b(++_0x38e1b0);}(_0x27a0,0xbf));var _0x027a=function(_0x124397,_0x20709){_0x124397=_0x124397-0x0;var _0x14ecc7=_0x27a0[_0x124397];return _0x14ecc7;};'use strict';var Sequelize=require('sequelize');module[_0x027a('0x0')]={'name':{'type':Sequelize[_0x027a('0x1')],'unique':_0x027a('0x2'),'allowNull':![],'validate':{'notEmpty':!![]}},'description':{'type':Sequelize[_0x027a('0x1')]}}; \ No newline at end of file +var _0x90b5=['name','sequelize','STRING'];(function(_0xea8947,_0x1b573d){var _0x2455e9=function(_0x18771e){while(--_0x18771e){_0xea8947['push'](_0xea8947['shift']());}};_0x2455e9(++_0x1b573d);}(_0x90b5,0x139));var _0x590b=function(_0x398cdf,_0x38cff0){_0x398cdf=_0x398cdf-0x0;var _0x5a5b66=_0x90b5[_0x398cdf];return _0x5a5b66;};'use strict';var Sequelize=require(_0x590b('0x0'));module['exports']={'name':{'type':Sequelize[_0x590b('0x1')],'unique':_0x590b('0x2'),'allowNull':![],'validate':{'notEmpty':!![]}},'description':{'type':Sequelize[_0x590b('0x1')]}}; \ No newline at end of file diff --git a/server/api/mailSubstatus/mailSubstatus.controller.js b/server/api/mailSubstatus/mailSubstatus.controller.js index 0f50de7..5b743fc 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 _0xdf7f=['moment','bluebird','util','sox','to-csv','ejs','fs-extra','lodash','crypto','jsforce','desk.js','papaparse','../../components/auth/service','../../components/parsers/qs','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','update','destroy','error','name','send','map','rawAttributes','type','key','model','query','keys','filters','intersection','attributes','fields','length','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','MailSubstatus','then','include','rows','catch','show','params','includeAll','find','create','body','describe','eml-format','rimraf','zip-dir','fast-json-patch','request-promise'];(function(_0x31aaa0,_0x1b3e80){var _0x23d27b=function(_0x24cf39){while(--_0x24cf39){_0x31aaa0['push'](_0x31aaa0['shift']());}};_0x23d27b(++_0x1b3e80);}(_0xdf7f,0x123));var _0xfdf7=function(_0x4a8e20,_0x4a1d74){_0x4a8e20=_0x4a8e20-0x0;var _0x11be0f=_0xdf7f[_0x4a8e20];return _0x11be0f;};'use strict';var emlformat=require(_0xfdf7('0x0'));var rimraf=require(_0xfdf7('0x1'));var zipdir=require(_0xfdf7('0x2'));var jsonpatch=require(_0xfdf7('0x3'));var rp=require(_0xfdf7('0x4'));var moment=require(_0xfdf7('0x5'));var BPromise=require(_0xfdf7('0x6'));var Mustache=require('mustache');var util=require(_0xfdf7('0x7'));var path=require('path');var sox=require(_0xfdf7('0x8'));var csv=require(_0xfdf7('0x9'));var ejs=require(_0xfdf7('0xa'));var fs=require('fs');var fs_extra=require(_0xfdf7('0xb'));var _=require(_0xfdf7('0xc'));var squel=require('squel');var crypto=require(_0xfdf7('0xd'));var jsforce=require(_0xfdf7('0xe'));var deskjs=require(_0xfdf7('0xf'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0xfdf7('0x10'));var Redis=require('ioredis');var authService=require(_0xfdf7('0x11'));var qs=require(_0xfdf7('0x12'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0xfdf7('0x13'))(_0xfdf7('0x14'));var utils=require(_0xfdf7('0x15'));var config=require(_0xfdf7('0x16'));var licenseUtil=require('../../config/license/util');var db=require(_0xfdf7('0x17'))['db'];function respondWithStatusCode(_0x2628a9,_0x2844e2){_0x2844e2=_0x2844e2||0xcc;return function(_0x5b6bc3){if(_0x5b6bc3){return _0x2628a9[_0xfdf7('0x18')](_0x2844e2);}return _0x2628a9[_0xfdf7('0x19')](_0x2844e2)[_0xfdf7('0x1a')]();};}function respondWithResult(_0x24bd1a,_0x10a0cc){_0x10a0cc=_0x10a0cc||0xc8;return function(_0x273857){if(_0x273857){return _0x24bd1a['status'](_0x10a0cc)[_0xfdf7('0x1b')](_0x273857);}};}function respondWithFilteredResult(_0x49acc5,_0x248469){return function(_0x13a23b){if(_0x13a23b){var _0x482638=typeof _0x248469[_0xfdf7('0x1c')]===_0xfdf7('0x1d')&&typeof _0x248469[_0xfdf7('0x1e')]===_0xfdf7('0x1d');var _0x8db126=_0x13a23b[_0xfdf7('0x1f')];var _0x42b374=_0x482638?0x0:_0x248469[_0xfdf7('0x1c')];var _0x43e200=_0x482638?_0x13a23b['count']:_0x248469[_0xfdf7('0x1c')]+_0x248469[_0xfdf7('0x1e')];var _0x2746d2;if(_0x43e200>=_0x8db126){_0x43e200=_0x8db126;_0x2746d2=0xc8;}else{_0x2746d2=0xce;}_0x49acc5['status'](_0x2746d2);return _0x49acc5[_0xfdf7('0x20')](_0xfdf7('0x21'),_0x42b374+'-'+_0x43e200+'/'+_0x8db126)[_0xfdf7('0x1b')](_0x13a23b);}return null;};}function patchUpdates(_0x1ea708){return function(_0x4bdc3d){try{jsonpatch[_0xfdf7('0x22')](_0x4bdc3d,_0x1ea708,!![]);}catch(_0x3d0d75){return BPromise[_0xfdf7('0x23')](_0x3d0d75);}return _0x4bdc3d['save']();};}function saveUpdates(_0x1e6e01,_0x544a95){return function(_0x1996e1){if(_0x1996e1){return _0x1996e1[_0xfdf7('0x24')](_0x1e6e01)['then'](function(_0x40f1f8){return _0x40f1f8;});}return null;};}function removeEntity(_0x3a32b0,_0x306167){return function(_0x2e8116){if(_0x2e8116){return _0x2e8116[_0xfdf7('0x25')]()['then'](function(){_0x3a32b0[_0xfdf7('0x19')](0xcc)[_0xfdf7('0x1a')]();});}};}function handleEntityNotFound(_0xc9f94e,_0x2e4ae0){return function(_0xe05ad6){if(!_0xe05ad6){_0xc9f94e[_0xfdf7('0x18')](0x194);}return _0xe05ad6;};}function handleError(_0x4227c6,_0x4e2c78){_0x4e2c78=_0x4e2c78||0x1f4;return function(_0x46e3ab){logger[_0xfdf7('0x26')](_0x46e3ab['stack']);if(_0x46e3ab[_0xfdf7('0x27')]){delete _0x46e3ab[_0xfdf7('0x27')];}_0x4227c6[_0xfdf7('0x19')](_0x4e2c78)[_0xfdf7('0x28')](_0x46e3ab);};}exports['index']=function(_0x32b3c6,_0x3d4fe3){var _0x1cdd9b={},_0x3230c={},_0x2296ae={'count':0x0,'rows':[]};var _0x165db0=_[_0xfdf7('0x29')](db['MailSubstatus'][_0xfdf7('0x2a')],function(_0x3bf03c){return{'name':_0x3bf03c['fieldName'],'type':_0x3bf03c[_0xfdf7('0x2b')][_0xfdf7('0x2c')]};});_0x3230c[_0xfdf7('0x2d')]=_[_0xfdf7('0x29')](_0x165db0,'name');_0x3230c[_0xfdf7('0x2e')]=_[_0xfdf7('0x2f')](_0x32b3c6['query']);_0x3230c[_0xfdf7('0x30')]=_[_0xfdf7('0x31')](_0x3230c['model'],_0x3230c[_0xfdf7('0x2e')]);_0x1cdd9b[_0xfdf7('0x32')]=_[_0xfdf7('0x31')](_0x3230c[_0xfdf7('0x2d')],qs[_0xfdf7('0x33')](_0x32b3c6[_0xfdf7('0x2e')][_0xfdf7('0x33')]));_0x1cdd9b['attributes']=_0x1cdd9b[_0xfdf7('0x32')][_0xfdf7('0x34')]?_0x1cdd9b[_0xfdf7('0x32')]:_0x3230c['model'];if(!_0x32b3c6[_0xfdf7('0x2e')]['hasOwnProperty'](_0xfdf7('0x35'))){_0x1cdd9b[_0xfdf7('0x1e')]=qs[_0xfdf7('0x1e')](_0x32b3c6[_0xfdf7('0x2e')][_0xfdf7('0x1e')]);_0x1cdd9b[_0xfdf7('0x1c')]=qs[_0xfdf7('0x1c')](_0x32b3c6[_0xfdf7('0x2e')][_0xfdf7('0x1c')]);}_0x1cdd9b[_0xfdf7('0x36')]=qs[_0xfdf7('0x37')](_0x32b3c6[_0xfdf7('0x2e')]['sort']);_0x1cdd9b[_0xfdf7('0x38')]=qs[_0xfdf7('0x30')](_[_0xfdf7('0x39')](_0x32b3c6[_0xfdf7('0x2e')],_0x3230c[_0xfdf7('0x30')]),_0x165db0);if(_0x32b3c6[_0xfdf7('0x2e')][_0xfdf7('0x3a')]){_0x1cdd9b[_0xfdf7('0x38')]=_[_0xfdf7('0x3b')](_0x1cdd9b[_0xfdf7('0x38')],{'$or':_[_0xfdf7('0x29')](_0x165db0,function(_0x3b5785){if(_0x3b5785[_0xfdf7('0x2b')]!==_0xfdf7('0x3c')){var _0x1f7f1f={};_0x1f7f1f[_0x3b5785[_0xfdf7('0x27')]]={'$like':'%'+_0x32b3c6['query']['filter']+'%'};return _0x1f7f1f;}})});}_0x1cdd9b=_['merge']({},_0x1cdd9b,_0x32b3c6[_0xfdf7('0x3d')]);var _0x35849d={'where':_0x1cdd9b[_0xfdf7('0x38')]};return db[_0xfdf7('0x3e')][_0xfdf7('0x1f')](_0x35849d)[_0xfdf7('0x3f')](function(_0x163885){_0x2296ae[_0xfdf7('0x1f')]=_0x163885;if(_0x32b3c6[_0xfdf7('0x2e')]['includeAll']){_0x1cdd9b[_0xfdf7('0x40')]=[{'all':!![]}];}return db[_0xfdf7('0x3e')]['findAll'](_0x1cdd9b);})[_0xfdf7('0x3f')](function(_0x1e748f){_0x2296ae[_0xfdf7('0x41')]=_0x1e748f;return _0x2296ae;})[_0xfdf7('0x3f')](respondWithFilteredResult(_0x3d4fe3,_0x1cdd9b))[_0xfdf7('0x42')](handleError(_0x3d4fe3,null));};exports[_0xfdf7('0x43')]=function(_0x3e2f87,_0x32b640){var _0x1a4101={'raw':!![],'where':{'id':_0x3e2f87[_0xfdf7('0x44')]['id']}},_0x2f434={};_0x2f434[_0xfdf7('0x2d')]=_[_0xfdf7('0x2f')](db['MailSubstatus'][_0xfdf7('0x2a')]);_0x2f434[_0xfdf7('0x2e')]=_[_0xfdf7('0x2f')](_0x3e2f87[_0xfdf7('0x2e')]);_0x2f434[_0xfdf7('0x30')]=_[_0xfdf7('0x31')](_0x2f434[_0xfdf7('0x2d')],_0x2f434['query']);_0x1a4101['attributes']=_[_0xfdf7('0x31')](_0x2f434['model'],qs['fields'](_0x3e2f87[_0xfdf7('0x2e')][_0xfdf7('0x33')]));_0x1a4101[_0xfdf7('0x32')]=_0x1a4101[_0xfdf7('0x32')]['length']?_0x1a4101[_0xfdf7('0x32')]:_0x2f434[_0xfdf7('0x2d')];if(_0x3e2f87[_0xfdf7('0x2e')][_0xfdf7('0x45')]){_0x1a4101[_0xfdf7('0x40')]=[{'all':!![]}];}_0x1a4101=_[_0xfdf7('0x3b')]({},_0x1a4101,_0x3e2f87[_0xfdf7('0x3d')]);return db[_0xfdf7('0x3e')][_0xfdf7('0x46')](_0x1a4101)['then'](handleEntityNotFound(_0x32b640,null))['then'](respondWithResult(_0x32b640,null))['catch'](handleError(_0x32b640,null));};exports[_0xfdf7('0x47')]=function(_0x52ab89,_0x14041b){return db[_0xfdf7('0x3e')]['create'](_0x52ab89[_0xfdf7('0x48')],{})[_0xfdf7('0x3f')](respondWithResult(_0x14041b,0xc9))[_0xfdf7('0x42')](handleError(_0x14041b,null));};exports[_0xfdf7('0x24')]=function(_0x2367f1,_0x150388){if(_0x2367f1[_0xfdf7('0x48')]['id']){delete _0x2367f1[_0xfdf7('0x48')]['id'];}return db[_0xfdf7('0x3e')][_0xfdf7('0x46')]({'where':{'id':_0x2367f1['params']['id']}})[_0xfdf7('0x3f')](handleEntityNotFound(_0x150388,null))[_0xfdf7('0x3f')](saveUpdates(_0x2367f1['body'],null))[_0xfdf7('0x3f')](respondWithResult(_0x150388,null))[_0xfdf7('0x42')](handleError(_0x150388,null));};exports[_0xfdf7('0x25')]=function(_0x4b6659,_0x2d5ff1){return db[_0xfdf7('0x3e')]['find']({'where':{'id':_0x4b6659[_0xfdf7('0x44')]['id']}})[_0xfdf7('0x3f')](handleEntityNotFound(_0x2d5ff1,null))[_0xfdf7('0x3f')](removeEntity(_0x2d5ff1,null))[_0xfdf7('0x42')](handleError(_0x2d5ff1,null));};exports[_0xfdf7('0x49')]=function(_0x5d9c8d,_0x44c94c){return db['MailSubstatus']['describe']()[_0xfdf7('0x3f')](respondWithResult(_0x44c94c,null))[_0xfdf7('0x42')](handleError(_0x44c94c,null));}; \ No newline at end of file +var _0x7e67=['map','rawAttributes','type','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','where','pick','filter','merge','VIRTUAL','options','includeAll','include','MailSubstatus','findAll','rows','catch','show','params','create','body','find','destroy','describe','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','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','end','status','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','then','sendStatus','error','name','send','index'];(function(_0x462146,_0x41d08a){var _0x45c179=function(_0x3d5d79){while(--_0x3d5d79){_0x462146['push'](_0x462146['shift']());}};_0x45c179(++_0x41d08a);}(_0x7e67,0x165));var _0x77e6=function(_0x5f3fb9,_0x1968ef){_0x5f3fb9=_0x5f3fb9-0x0;var _0x468a7f=_0x7e67[_0x5f3fb9];return _0x468a7f;};'use strict';var emlformat=require(_0x77e6('0x0'));var rimraf=require(_0x77e6('0x1'));var zipdir=require(_0x77e6('0x2'));var jsonpatch=require(_0x77e6('0x3'));var rp=require(_0x77e6('0x4'));var moment=require('moment');var BPromise=require(_0x77e6('0x5'));var Mustache=require(_0x77e6('0x6'));var util=require(_0x77e6('0x7'));var path=require(_0x77e6('0x8'));var sox=require(_0x77e6('0x9'));var csv=require(_0x77e6('0xa'));var ejs=require(_0x77e6('0xb'));var fs=require('fs');var fs_extra=require(_0x77e6('0xc'));var _=require(_0x77e6('0xd'));var squel=require(_0x77e6('0xe'));var crypto=require(_0x77e6('0xf'));var jsforce=require(_0x77e6('0x10'));var deskjs=require(_0x77e6('0x11'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x77e6('0x12'));var Redis=require(_0x77e6('0x13'));var authService=require(_0x77e6('0x14'));var qs=require(_0x77e6('0x15'));var as=require(_0x77e6('0x16'));var hardwareService=require(_0x77e6('0x17'));var logger=require(_0x77e6('0x18'))(_0x77e6('0x19'));var utils=require(_0x77e6('0x1a'));var config=require('../../config/environment');var licenseUtil=require(_0x77e6('0x1b'));var db=require(_0x77e6('0x1c'))['db'];function respondWithStatusCode(_0x2f7395,_0x2234d0){_0x2234d0=_0x2234d0||0xcc;return function(_0x7bfe21){if(_0x7bfe21){return _0x2f7395['sendStatus'](_0x2234d0);}return _0x2f7395['status'](_0x2234d0)[_0x77e6('0x1d')]();};}function respondWithResult(_0x13907d,_0x4eb1a0){_0x4eb1a0=_0x4eb1a0||0xc8;return function(_0x577188){if(_0x577188){return _0x13907d[_0x77e6('0x1e')](_0x4eb1a0)[_0x77e6('0x1f')](_0x577188);}};}function respondWithFilteredResult(_0xa47274,_0x23a0f3){return function(_0x192af2){if(_0x192af2){var _0x312935=typeof _0x23a0f3[_0x77e6('0x20')]===_0x77e6('0x21')&&typeof _0x23a0f3[_0x77e6('0x22')]===_0x77e6('0x21');var _0x2535f8=_0x192af2[_0x77e6('0x23')];var _0x4ff015=_0x312935?0x0:_0x23a0f3[_0x77e6('0x20')];var _0x51c933=_0x312935?_0x192af2[_0x77e6('0x23')]:_0x23a0f3[_0x77e6('0x20')]+_0x23a0f3[_0x77e6('0x22')];var _0x2c219b;if(_0x51c933>=_0x2535f8){_0x51c933=_0x2535f8;_0x2c219b=0xc8;}else{_0x2c219b=0xce;}_0xa47274['status'](_0x2c219b);return _0xa47274[_0x77e6('0x24')](_0x77e6('0x25'),_0x4ff015+'-'+_0x51c933+'/'+_0x2535f8)['json'](_0x192af2);}return null;};}function patchUpdates(_0x122322){return function(_0x539fb9){try{jsonpatch[_0x77e6('0x26')](_0x539fb9,_0x122322,!![]);}catch(_0x2ab4c8){return BPromise[_0x77e6('0x27')](_0x2ab4c8);}return _0x539fb9[_0x77e6('0x28')]();};}function saveUpdates(_0x32c216,_0x2978ba){return function(_0x21399f){if(_0x21399f){return _0x21399f[_0x77e6('0x29')](_0x32c216)[_0x77e6('0x2a')](function(_0x67d858){return _0x67d858;});}return null;};}function removeEntity(_0x20c66a,_0x13ac1b){return function(_0x3d8ee6){if(_0x3d8ee6){return _0x3d8ee6['destroy']()[_0x77e6('0x2a')](function(){_0x20c66a[_0x77e6('0x1e')](0xcc)[_0x77e6('0x1d')]();});}};}function handleEntityNotFound(_0x2f2aff,_0x45b324){return function(_0x3f11ec){if(!_0x3f11ec){_0x2f2aff[_0x77e6('0x2b')](0x194);}return _0x3f11ec;};}function handleError(_0x11df55,_0x164362){_0x164362=_0x164362||0x1f4;return function(_0x3428a4){logger[_0x77e6('0x2c')](_0x3428a4['stack']);if(_0x3428a4[_0x77e6('0x2d')]){delete _0x3428a4[_0x77e6('0x2d')];}_0x11df55[_0x77e6('0x1e')](_0x164362)[_0x77e6('0x2e')](_0x3428a4);};}exports[_0x77e6('0x2f')]=function(_0xbc513f,_0x273d33){var _0xa96c4d={},_0x5dd0bc={},_0x186d95={'count':0x0,'rows':[]};var _0x2c33da=_[_0x77e6('0x30')](db['MailSubstatus'][_0x77e6('0x31')],function(_0x2677b7){return{'name':_0x2677b7['fieldName'],'type':_0x2677b7[_0x77e6('0x32')]['key']};});_0x5dd0bc[_0x77e6('0x33')]=_['map'](_0x2c33da,_0x77e6('0x2d'));_0x5dd0bc[_0x77e6('0x34')]=_[_0x77e6('0x35')](_0xbc513f[_0x77e6('0x34')]);_0x5dd0bc[_0x77e6('0x36')]=_[_0x77e6('0x37')](_0x5dd0bc[_0x77e6('0x33')],_0x5dd0bc[_0x77e6('0x34')]);_0xa96c4d[_0x77e6('0x38')]=_['intersection'](_0x5dd0bc[_0x77e6('0x33')],qs['fields'](_0xbc513f[_0x77e6('0x34')][_0x77e6('0x39')]));_0xa96c4d[_0x77e6('0x38')]=_0xa96c4d[_0x77e6('0x38')][_0x77e6('0x3a')]?_0xa96c4d[_0x77e6('0x38')]:_0x5dd0bc[_0x77e6('0x33')];if(!_0xbc513f[_0x77e6('0x34')][_0x77e6('0x3b')](_0x77e6('0x3c'))){_0xa96c4d[_0x77e6('0x22')]=qs['limit'](_0xbc513f['query'][_0x77e6('0x22')]);_0xa96c4d['offset']=qs[_0x77e6('0x20')](_0xbc513f[_0x77e6('0x34')]['offset']);}_0xa96c4d[_0x77e6('0x3d')]=qs['sort'](_0xbc513f[_0x77e6('0x34')]['sort']);_0xa96c4d[_0x77e6('0x3e')]=qs[_0x77e6('0x36')](_[_0x77e6('0x3f')](_0xbc513f[_0x77e6('0x34')],_0x5dd0bc[_0x77e6('0x36')]),_0x2c33da);if(_0xbc513f['query'][_0x77e6('0x40')]){_0xa96c4d[_0x77e6('0x3e')]=_[_0x77e6('0x41')](_0xa96c4d[_0x77e6('0x3e')],{'$or':_[_0x77e6('0x30')](_0x2c33da,function(_0x3f9327){if(_0x3f9327[_0x77e6('0x32')]!==_0x77e6('0x42')){var _0x2e37c5={};_0x2e37c5[_0x3f9327[_0x77e6('0x2d')]]={'$like':'%'+_0xbc513f[_0x77e6('0x34')][_0x77e6('0x40')]+'%'};return _0x2e37c5;}})});}_0xa96c4d=_[_0x77e6('0x41')]({},_0xa96c4d,_0xbc513f[_0x77e6('0x43')]);var _0x15da54={'where':_0xa96c4d['where']};return db['MailSubstatus'][_0x77e6('0x23')](_0x15da54)['then'](function(_0x5625f6){_0x186d95[_0x77e6('0x23')]=_0x5625f6;if(_0xbc513f[_0x77e6('0x34')][_0x77e6('0x44')]){_0xa96c4d[_0x77e6('0x45')]=[{'all':!![]}];}return db[_0x77e6('0x46')][_0x77e6('0x47')](_0xa96c4d);})['then'](function(_0x5ceb4c){_0x186d95[_0x77e6('0x48')]=_0x5ceb4c;return _0x186d95;})['then'](respondWithFilteredResult(_0x273d33,_0xa96c4d))[_0x77e6('0x49')](handleError(_0x273d33,null));};exports[_0x77e6('0x4a')]=function(_0x26fd7c,_0x1fc3f4){var _0x5d6c68={'raw':!![],'where':{'id':_0x26fd7c[_0x77e6('0x4b')]['id']}},_0x4dda14={};_0x4dda14[_0x77e6('0x33')]=_[_0x77e6('0x35')](db[_0x77e6('0x46')][_0x77e6('0x31')]);_0x4dda14[_0x77e6('0x34')]=_[_0x77e6('0x35')](_0x26fd7c[_0x77e6('0x34')]);_0x4dda14[_0x77e6('0x36')]=_[_0x77e6('0x37')](_0x4dda14['model'],_0x4dda14[_0x77e6('0x34')]);_0x5d6c68[_0x77e6('0x38')]=_[_0x77e6('0x37')](_0x4dda14[_0x77e6('0x33')],qs[_0x77e6('0x39')](_0x26fd7c[_0x77e6('0x34')][_0x77e6('0x39')]));_0x5d6c68[_0x77e6('0x38')]=_0x5d6c68[_0x77e6('0x38')][_0x77e6('0x3a')]?_0x5d6c68[_0x77e6('0x38')]:_0x4dda14[_0x77e6('0x33')];if(_0x26fd7c[_0x77e6('0x34')][_0x77e6('0x44')]){_0x5d6c68[_0x77e6('0x45')]=[{'all':!![]}];}_0x5d6c68=_[_0x77e6('0x41')]({},_0x5d6c68,_0x26fd7c[_0x77e6('0x43')]);return db[_0x77e6('0x46')]['find'](_0x5d6c68)['then'](handleEntityNotFound(_0x1fc3f4,null))[_0x77e6('0x2a')](respondWithResult(_0x1fc3f4,null))['catch'](handleError(_0x1fc3f4,null));};exports[_0x77e6('0x4c')]=function(_0x1a09db,_0x5cdabc){return db[_0x77e6('0x46')][_0x77e6('0x4c')](_0x1a09db['body'],{})['then'](respondWithResult(_0x5cdabc,0xc9))[_0x77e6('0x49')](handleError(_0x5cdabc,null));};exports[_0x77e6('0x29')]=function(_0x268a1d,_0x2a7831){if(_0x268a1d['body']['id']){delete _0x268a1d[_0x77e6('0x4d')]['id'];}return db[_0x77e6('0x46')][_0x77e6('0x4e')]({'where':{'id':_0x268a1d[_0x77e6('0x4b')]['id']}})['then'](handleEntityNotFound(_0x2a7831,null))[_0x77e6('0x2a')](saveUpdates(_0x268a1d[_0x77e6('0x4d')],null))[_0x77e6('0x2a')](respondWithResult(_0x2a7831,null))['catch'](handleError(_0x2a7831,null));};exports[_0x77e6('0x4f')]=function(_0x25d182,_0x320de1){return db['MailSubstatus']['find']({'where':{'id':_0x25d182[_0x77e6('0x4b')]['id']}})['then'](handleEntityNotFound(_0x320de1,null))['then'](removeEntity(_0x320de1,null))[_0x77e6('0x49')](handleError(_0x320de1,null));};exports[_0x77e6('0x50')]=function(_0x52607c,_0x2d8e8b){return db[_0x77e6('0x46')][_0x77e6('0x50')]()[_0x77e6('0x2a')](respondWithResult(_0x2d8e8b,null))[_0x77e6('0x49')](handleError(_0x2d8e8b,null));}; \ No newline at end of file diff --git a/server/api/mailSubstatus/mailSubstatus.events.js b/server/api/mailSubstatus/mailSubstatus.events.js index a5eb537..02f4e83 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 _0x4463=['MailSubstatus','update','emit','hasOwnProperty','hook','events'];(function(_0x2958f8,_0x1b8fda){var _0x1a02c0=function(_0x47642c){while(--_0x47642c){_0x2958f8['push'](_0x2958f8['shift']());}};_0x1a02c0(++_0x1b8fda);}(_0x4463,0x1bb));var _0x3446=function(_0x3f2031,_0x2dbd6f){_0x3f2031=_0x3f2031-0x0;var _0x37eaf4=_0x4463[_0x3f2031];return _0x37eaf4;};'use strict';var EventEmitter=require(_0x3446('0x0'));var MailSubstatus=require('../../mysqldb')['db'][_0x3446('0x1')];var MailSubstatusEvents=new EventEmitter();MailSubstatusEvents['setMaxListeners'](0x0);var events={'afterUpdate':_0x3446('0x2')};function emitEvent(_0x229dea){return function(_0x5824ad,_0x152f9e,_0x2a24a8){MailSubstatusEvents[_0x3446('0x3')](_0x229dea+':'+_0x5824ad['id'],_0x5824ad);MailSubstatusEvents[_0x3446('0x3')](_0x229dea,_0x5824ad);_0x2a24a8(null);};}for(var e in events){if(events[_0x3446('0x4')](e)){var event=events[e];MailSubstatus[_0x3446('0x5')](e,emitEvent(event));}}module['exports']=MailSubstatusEvents; \ No newline at end of file +var _0x1972=['exports','events','setMaxListeners','emit','hasOwnProperty'];(function(_0xf50820,_0x56f041){var _0x2a9b10=function(_0x33f0f4){while(--_0x33f0f4){_0xf50820['push'](_0xf50820['shift']());}};_0x2a9b10(++_0x56f041);}(_0x1972,0x65));var _0x2197=function(_0x9eef15,_0x58a7eb){_0x9eef15=_0x9eef15-0x0;var _0x847a64=_0x1972[_0x9eef15];return _0x847a64;};'use strict';var EventEmitter=require(_0x2197('0x0'));var MailSubstatus=require('../../mysqldb')['db']['MailSubstatus'];var MailSubstatusEvents=new EventEmitter();MailSubstatusEvents[_0x2197('0x1')](0x0);var events={'afterUpdate':'update'};function emitEvent(_0x458fe7){return function(_0x5b835a,_0x53e79d,_0x43cf27){MailSubstatusEvents[_0x2197('0x2')](_0x458fe7+':'+_0x5b835a['id'],_0x5b835a);MailSubstatusEvents['emit'](_0x458fe7,_0x5b835a);_0x43cf27(null);};}for(var e in events){if(events[_0x2197('0x3')](e)){var event=events[e];MailSubstatus['hook'](e,emitEvent(event));}}module[_0x2197('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 747a20a..d923cdc 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 _0x2807=['./mailSubstatus.attributes','exports','models','define','MailSubstatus','update','name','mailSubstatus','_previousDataValues','catch'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x2807,0x154));var _0x7280=function(_0x2263cc,_0x2e1dc9){_0x2263cc=_0x2263cc-0x0;var _0x1ba214=_0x2807[_0x2263cc];return _0x1ba214;};'use strict';var attributes=require(_0x7280('0x0'));module[_0x7280('0x1')]=function(_0x243876){var _0x1b6c57=_0x243876[_0x7280('0x2')];return _0x243876[_0x7280('0x3')](_0x7280('0x4'),attributes,{'tableName':'mail_substatuses','paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'afterUpdate':function(_0x1deba4,_0x2d0150,_0xf9f011){return _0x1b6c57['Condition'][_0x7280('0x5')]({'value':_0x1deba4[_0x7280('0x6')]},{'where':{'field':_0x7280('0x7'),'value':_0x1deba4[_0x7280('0x8')][_0x7280('0x6')]}})['then'](function(){_0xf9f011();})[_0x7280('0x9')](function(_0x53145f){_0xf9f011(_0x53145f);});}}});}; \ No newline at end of file +var _0xf12f=['./mailSubstatus.attributes','exports','define','mail_substatuses','Condition','update','name','_previousDataValues','then','catch'];(function(_0x5c8824,_0x52b2e1){var _0x5b5037=function(_0x260fc4){while(--_0x260fc4){_0x5c8824['push'](_0x5c8824['shift']());}};_0x5b5037(++_0x52b2e1);}(_0xf12f,0x104));var _0xff12=function(_0x48718f,_0x287fe8){_0x48718f=_0x48718f-0x0;var _0x3860a6=_0xf12f[_0x48718f];return _0x3860a6;};'use strict';var attributes=require(_0xff12('0x0'));module[_0xff12('0x1')]=function(_0x165f59){var _0x341c4f=_0x165f59['models'];return _0x165f59[_0xff12('0x2')]('MailSubstatus',attributes,{'tableName':_0xff12('0x3'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'afterUpdate':function(_0x2e224d,_0x124bd2,_0x1cef01){return _0x341c4f[_0xff12('0x4')][_0xff12('0x5')]({'value':_0x2e224d[_0xff12('0x6')]},{'where':{'field':'mailSubstatus','value':_0x2e224d[_0xff12('0x7')]['name']}})[_0xff12('0x8')](function(){_0x1cef01();})[_0xff12('0x9')](function(_0x9ab8f1){_0x1cef01(_0x9ab8f1);});}}});}; \ No newline at end of file diff --git a/server/api/mailSubstatus/mailSubstatus.rpc.js b/server/api/mailSubstatus/mailSubstatus.rpc.js index 8cb273e..631baf6 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 _0x7523=['../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','MailSubstatus,\x20%s,\x20%s','request\x20sent','MailSubstatus,\x20%s,\x20%s,\x20%s','error','code','message','info','result','lodash','util','moment','randomstring','ioredis','../../mysqldb'];(function(_0x4dc4a8,_0x4b99a6){var _0x3cab18=function(_0x5ee5a8){while(--_0x5ee5a8){_0x4dc4a8['push'](_0x4dc4a8['shift']());}};_0x3cab18(++_0x4b99a6);}(_0x7523,0x189));var _0x3752=function(_0x19f2a9,_0x5ccbc4){_0x19f2a9=_0x19f2a9-0x0;var _0xb1bb3f=_0x7523[_0x19f2a9];return _0xb1bb3f;};'use strict';var _=require(_0x3752('0x0'));var util=require(_0x3752('0x1'));var moment=require(_0x3752('0x2'));var BPromise=require('bluebird');var rs=require(_0x3752('0x3'));var fs=require('fs');var Redis=require(_0x3752('0x4'));var db=require(_0x3752('0x5'))['db'];var utils=require(_0x3752('0x6'));var logger=require(_0x3752('0x7'))(_0x3752('0x8'));var config=require(_0x3752('0x9'));var jayson=require(_0x3752('0xa'));var client=jayson[_0x3752('0xb')][_0x3752('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x21a91e,_0x5b5865,_0x3fc628){return new BPromise(function(_0x224262,_0x385f7e){return client['request'](_0x21a91e,_0x3fc628)['then'](function(_0xda3d47){logger['info'](_0x3752('0xd'),_0x5b5865,_0x3752('0xe'));logger['debug'](_0x3752('0xf'),_0x5b5865,_0x3752('0xe'),JSON['stringify'](_0xda3d47));if(_0xda3d47[_0x3752('0x10')]){if(_0xda3d47['error'][_0x3752('0x11')]===0x1f4){logger[_0x3752('0x10')](_0x3752('0xd'),_0x5b5865,_0xda3d47['error']['message']);return _0x385f7e(_0xda3d47[_0x3752('0x10')][_0x3752('0x12')]);}logger['error'](_0x3752('0xd'),_0x5b5865,_0xda3d47[_0x3752('0x10')][_0x3752('0x12')]);return _0x224262(_0xda3d47[_0x3752('0x10')][_0x3752('0x12')]);}else{logger[_0x3752('0x13')]('MailSubstatus,\x20%s,\x20%s',_0x5b5865,_0x3752('0xe'));_0x224262(_0xda3d47[_0x3752('0x14')][_0x3752('0x12')]);}})['catch'](function(_0x4f6cd8){logger[_0x3752('0x10')](_0x3752('0xd'),_0x5b5865,_0x4f6cd8);_0x385f7e(_0x4f6cd8);});});} \ No newline at end of file +var _0x2975=['MailSubstatus,\x20%s,\x20%s','request\x20sent','debug','MailSubstatus,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','rpc','jayson/promise','http','then','info'];(function(_0x5b7788,_0x309ae5){var _0x573871=function(_0x5c79fd){while(--_0x5c79fd){_0x5b7788['push'](_0x5b7788['shift']());}};_0x573871(++_0x309ae5);}(_0x2975,0x159));var _0x5297=function(_0x41df32,_0x5f2c44){_0x41df32=_0x41df32-0x0;var _0x5e72f4=_0x2975[_0x41df32];return _0x5e72f4;};'use strict';var _=require(_0x5297('0x0'));var util=require(_0x5297('0x1'));var moment=require(_0x5297('0x2'));var BPromise=require(_0x5297('0x3'));var rs=require(_0x5297('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x5297('0x5'))['db'];var utils=require(_0x5297('0x6'));var logger=require('../../config/logger')(_0x5297('0x7'));var config=require('../../config/environment');var jayson=require(_0x5297('0x8'));var client=jayson['client'][_0x5297('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x52b98f,_0x4c9231,_0x4dc90e){return new BPromise(function(_0x1f816a,_0x2f2eed){return client['request'](_0x52b98f,_0x4dc90e)[_0x5297('0xa')](function(_0x539aee){logger[_0x5297('0xb')](_0x5297('0xc'),_0x4c9231,_0x5297('0xd'));logger[_0x5297('0xe')](_0x5297('0xf'),_0x4c9231,_0x5297('0xd'),JSON[_0x5297('0x10')](_0x539aee));if(_0x539aee[_0x5297('0x11')]){if(_0x539aee[_0x5297('0x11')][_0x5297('0x12')]===0x1f4){logger['error'](_0x5297('0xc'),_0x4c9231,_0x539aee[_0x5297('0x11')][_0x5297('0x13')]);return _0x2f2eed(_0x539aee[_0x5297('0x11')]['message']);}logger[_0x5297('0x11')]('MailSubstatus,\x20%s,\x20%s',_0x4c9231,_0x539aee[_0x5297('0x11')][_0x5297('0x13')]);return _0x1f816a(_0x539aee[_0x5297('0x11')][_0x5297('0x13')]);}else{logger[_0x5297('0xb')]('MailSubstatus,\x20%s,\x20%s',_0x4c9231,_0x5297('0xd'));_0x1f816a(_0x539aee[_0x5297('0x14')][_0x5297('0x13')]);}})['catch'](function(_0x595c45){logger[_0x5297('0x11')]('MailSubstatus,\x20%s,\x20%s',_0x4c9231,_0x595c45);_0x2f2eed(_0x595c45);});});} \ No newline at end of file diff --git a/server/api/mailTransferReport/index.js b/server/api/mailTransferReport/index.js index 0d76fce..cfb0024 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 _0xc4ec=['index','/describe','describe','show','create','put','/:id','update','multer','util','connect-timeout','express','fs-extra','../../components/interaction/service','./mailTransferReport.controller','get','isAuthenticated'];(function(_0x5e0bde,_0x4b112b){var _0x5b95ff=function(_0x4c519e){while(--_0x4c519e){_0x5e0bde['push'](_0x5e0bde['shift']());}};_0x5b95ff(++_0x4b112b);}(_0xc4ec,0x1a0));var _0xcc4e=function(_0x4de1b1,_0x18c64c){_0x4de1b1=_0x4de1b1-0x0;var _0x639f27=_0xc4ec[_0x4de1b1];return _0x639f27;};'use strict';var multer=require(_0xcc4e('0x0'));var util=require(_0xcc4e('0x1'));var path=require('path');var timeout=require(_0xcc4e('0x2'));var express=require(_0xcc4e('0x3'));var router=express['Router']();var fs_extra=require(_0xcc4e('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0xcc4e('0x5'));var config=require('../../config/environment');var controller=require(_0xcc4e('0x6'));router[_0xcc4e('0x7')]('/',auth[_0xcc4e('0x8')](),controller[_0xcc4e('0x9')]);router[_0xcc4e('0x7')](_0xcc4e('0xa'),auth[_0xcc4e('0x8')](),controller[_0xcc4e('0xb')]);router['get']('/:id',auth[_0xcc4e('0x8')](),controller[_0xcc4e('0xc')]);router['post']('/',auth['isAuthenticated'](),controller[_0xcc4e('0xd')]);router[_0xcc4e('0xe')](_0xcc4e('0xf'),auth[_0xcc4e('0x8')](),controller[_0xcc4e('0x10')]);router['delete'](_0xcc4e('0xf'),auth['isAuthenticated'](),controller['destroy']);module['exports']=router; \ No newline at end of file +var _0xaf08=['path','express','Router','../../components/auth/service','../../config/environment','./mailTransferReport.controller','get','/describe','isAuthenticated','describe','/:id','show','post','create','put','update','delete','exports','multer','util'];(function(_0x29733b,_0x579000){var _0x37d166=function(_0xe3e98d){while(--_0xe3e98d){_0x29733b['push'](_0x29733b['shift']());}};_0x37d166(++_0x579000);}(_0xaf08,0x116));var _0x8af0=function(_0x4f4c2a,_0x5f5a28){_0x4f4c2a=_0x4f4c2a-0x0;var _0xd15be6=_0xaf08[_0x4f4c2a];return _0xd15be6;};'use strict';var multer=require(_0x8af0('0x0'));var util=require(_0x8af0('0x1'));var path=require(_0x8af0('0x2'));var timeout=require('connect-timeout');var express=require(_0x8af0('0x3'));var router=express[_0x8af0('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0x8af0('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0x8af0('0x6'));var controller=require(_0x8af0('0x7'));router[_0x8af0('0x8')]('/',auth['isAuthenticated'](),controller['index']);router[_0x8af0('0x8')](_0x8af0('0x9'),auth[_0x8af0('0xa')](),controller[_0x8af0('0xb')]);router[_0x8af0('0x8')](_0x8af0('0xc'),auth[_0x8af0('0xa')](),controller[_0x8af0('0xd')]);router[_0x8af0('0xe')]('/',auth[_0x8af0('0xa')](),controller[_0x8af0('0xf')]);router[_0x8af0('0x10')](_0x8af0('0xc'),auth[_0x8af0('0xa')](),controller[_0x8af0('0x11')]);router[_0x8af0('0x12')]('/:id',auth[_0x8af0('0xa')](),controller['destroy']);module[_0x8af0('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 804da6d..efa18c6 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 _0x9c44=['ENUM','account','agent','queue','NOW','exports','STRING'];(function(_0x522ae8,_0x3b637e){var _0x3189b9=function(_0x3115d4){while(--_0x3115d4){_0x522ae8['push'](_0x522ae8['shift']());}};_0x3189b9(++_0x3b637e);}(_0x9c44,0x178));var _0x49c4=function(_0x1035c1,_0x2d8583){_0x1035c1=_0x1035c1-0x0;var _0x308d67=_0x9c44[_0x1035c1];return _0x308d67;};'use strict';var moment=require('moment');var Sequelize=require('sequelize');module[_0x49c4('0x0')]={'uniqueid':{'type':Sequelize[_0x49c4('0x1')],'allowNull':![]},'type':{'type':Sequelize[_0x49c4('0x2')](_0x49c4('0x3'),_0x49c4('0x4'),_0x49c4('0x5')),'allowNull':![],'defaultValue':'queue'},'transferredAt':{'type':Sequelize['DATE'],'allowNull':![],'defaultValue':Sequelize[_0x49c4('0x6')]}}; \ No newline at end of file +var _0x34e8=['queue','DATE','NOW','moment','sequelize','exports','STRING','account','agent'];(function(_0x4f13f8,_0x5e13c5){var _0x1e6b83=function(_0x26e15b){while(--_0x26e15b){_0x4f13f8['push'](_0x4f13f8['shift']());}};_0x1e6b83(++_0x5e13c5);}(_0x34e8,0x12c));var _0x834e=function(_0x566da5,_0xe48c35){_0x566da5=_0x566da5-0x0;var _0x280891=_0x34e8[_0x566da5];return _0x280891;};'use strict';var moment=require(_0x834e('0x0'));var Sequelize=require(_0x834e('0x1'));module[_0x834e('0x2')]={'uniqueid':{'type':Sequelize[_0x834e('0x3')],'allowNull':![]},'type':{'type':Sequelize['ENUM'](_0x834e('0x4'),_0x834e('0x5'),_0x834e('0x6')),'allowNull':![],'defaultValue':_0x834e('0x6')},'transferredAt':{'type':Sequelize[_0x834e('0x7')],'allowNull':![],'defaultValue':Sequelize[_0x834e('0x8')]}}; \ No newline at end of file diff --git a/server/api/mailTransferReport/mailTransferReport.controller.js b/server/api/mailTransferReport/mailTransferReport.controller.js index b258f31..b0d2295 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 _0xd8ec=['fast-json-patch','request-promise','moment','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','papaparse','ioredis','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','apply','reject','save','destroy','then','error','name','index','map','MailTransferReport','fieldName','key','query','filters','intersection','model','attributes','fields','length','nolimit','order','sort','pick','filter','where','merge','type','VIRTUAL','options','includeAll','include','rows','catch','params','rawAttributes','find','create','body','update','describe','rimraf','zip-dir'];(function(_0x13d58b,_0x4ed10e){var _0x40eca1=function(_0x19b101){while(--_0x19b101){_0x13d58b['push'](_0x13d58b['shift']());}};_0x40eca1(++_0x4ed10e);}(_0xd8ec,0x116));var _0xcd8e=function(_0x36f99f,_0x10dfa2){_0x36f99f=_0x36f99f-0x0;var _0x85cb3b=_0xd8ec[_0x36f99f];return _0x85cb3b;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xcd8e('0x0'));var zipdir=require(_0xcd8e('0x1'));var jsonpatch=require(_0xcd8e('0x2'));var rp=require(_0xcd8e('0x3'));var moment=require(_0xcd8e('0x4'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0xcd8e('0x5'));var path=require(_0xcd8e('0x6'));var sox=require(_0xcd8e('0x7'));var csv=require(_0xcd8e('0x8'));var ejs=require(_0xcd8e('0x9'));var fs=require('fs');var fs_extra=require(_0xcd8e('0xa'));var _=require(_0xcd8e('0xb'));var squel=require(_0xcd8e('0xc'));var crypto=require(_0xcd8e('0xd'));var jsforce=require(_0xcd8e('0xe'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0xcd8e('0xf'));var Redis=require(_0xcd8e('0x10'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0xcd8e('0x11'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xcd8e('0x12'))(_0xcd8e('0x13'));var utils=require(_0xcd8e('0x14'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0xcd8e('0x15'))['db'];function respondWithStatusCode(_0x39e800,_0xb7dfe4){_0xb7dfe4=_0xb7dfe4||0xcc;return function(_0x54ce15){if(_0x54ce15){return _0x39e800[_0xcd8e('0x16')](_0xb7dfe4);}return _0x39e800[_0xcd8e('0x17')](_0xb7dfe4)[_0xcd8e('0x18')]();};}function respondWithResult(_0x10ee67,_0x38625a){_0x38625a=_0x38625a||0xc8;return function(_0x2ec172){if(_0x2ec172){return _0x10ee67['status'](_0x38625a)[_0xcd8e('0x19')](_0x2ec172);}};}function respondWithFilteredResult(_0x570a9d,_0x4ba3ef){return function(_0x588c74){if(_0x588c74){var _0x4f2047=typeof _0x4ba3ef[_0xcd8e('0x1a')]===_0xcd8e('0x1b')&&typeof _0x4ba3ef[_0xcd8e('0x1c')]==='undefined';var _0x458df2=_0x588c74[_0xcd8e('0x1d')];var _0x77936f=_0x4f2047?0x0:_0x4ba3ef[_0xcd8e('0x1a')];var _0x3b1fdd=_0x4f2047?_0x588c74[_0xcd8e('0x1d')]:_0x4ba3ef[_0xcd8e('0x1a')]+_0x4ba3ef['limit'];var _0x44e015;if(_0x3b1fdd>=_0x458df2){_0x3b1fdd=_0x458df2;_0x44e015=0xc8;}else{_0x44e015=0xce;}_0x570a9d['status'](_0x44e015);return _0x570a9d['set']('Content-Range',_0x77936f+'-'+_0x3b1fdd+'/'+_0x458df2)[_0xcd8e('0x19')](_0x588c74);}return null;};}function patchUpdates(_0x482d71){return function(_0x5a690b){try{jsonpatch[_0xcd8e('0x1e')](_0x5a690b,_0x482d71,!![]);}catch(_0x40c2b5){return BPromise[_0xcd8e('0x1f')](_0x40c2b5);}return _0x5a690b[_0xcd8e('0x20')]();};}function saveUpdates(_0x2ab59,_0x3ecb58){return function(_0x9c6c20){if(_0x9c6c20){return _0x9c6c20['update'](_0x2ab59)['then'](function(_0xe1a671){return _0xe1a671;});}return null;};}function removeEntity(_0x58ef98,_0x563aa6){return function(_0x17c000){if(_0x17c000){return _0x17c000[_0xcd8e('0x21')]()[_0xcd8e('0x22')](function(){_0x58ef98[_0xcd8e('0x17')](0xcc)['end']();});}};}function handleEntityNotFound(_0x54a123,_0x4f0b5a){return function(_0x145371){if(!_0x145371){_0x54a123['sendStatus'](0x194);}return _0x145371;};}function handleError(_0x3244e2,_0x77049e){_0x77049e=_0x77049e||0x1f4;return function(_0x2ea5f0){logger[_0xcd8e('0x23')](_0x2ea5f0['stack']);if(_0x2ea5f0[_0xcd8e('0x24')]){delete _0x2ea5f0[_0xcd8e('0x24')];}_0x3244e2[_0xcd8e('0x17')](_0x77049e)['send'](_0x2ea5f0);};}exports[_0xcd8e('0x25')]=function(_0x51c1a4,_0x3e0eaf){var _0xa6d43f={},_0x435b6a={},_0xef7de8={'count':0x0,'rows':[]};var _0x28f70a=_[_0xcd8e('0x26')](db[_0xcd8e('0x27')]['rawAttributes'],function(_0x7dfbbb){return{'name':_0x7dfbbb[_0xcd8e('0x28')],'type':_0x7dfbbb['type'][_0xcd8e('0x29')]};});_0x435b6a['model']=_[_0xcd8e('0x26')](_0x28f70a,'name');_0x435b6a[_0xcd8e('0x2a')]=_['keys'](_0x51c1a4[_0xcd8e('0x2a')]);_0x435b6a[_0xcd8e('0x2b')]=_[_0xcd8e('0x2c')](_0x435b6a[_0xcd8e('0x2d')],_0x435b6a[_0xcd8e('0x2a')]);_0xa6d43f[_0xcd8e('0x2e')]=_['intersection'](_0x435b6a[_0xcd8e('0x2d')],qs['fields'](_0x51c1a4[_0xcd8e('0x2a')][_0xcd8e('0x2f')]));_0xa6d43f[_0xcd8e('0x2e')]=_0xa6d43f[_0xcd8e('0x2e')][_0xcd8e('0x30')]?_0xa6d43f[_0xcd8e('0x2e')]:_0x435b6a[_0xcd8e('0x2d')];if(!_0x51c1a4[_0xcd8e('0x2a')]['hasOwnProperty'](_0xcd8e('0x31'))){_0xa6d43f['limit']=qs[_0xcd8e('0x1c')](_0x51c1a4[_0xcd8e('0x2a')][_0xcd8e('0x1c')]);_0xa6d43f[_0xcd8e('0x1a')]=qs[_0xcd8e('0x1a')](_0x51c1a4[_0xcd8e('0x2a')][_0xcd8e('0x1a')]);}_0xa6d43f[_0xcd8e('0x32')]=qs[_0xcd8e('0x33')](_0x51c1a4[_0xcd8e('0x2a')][_0xcd8e('0x33')]);_0xa6d43f['where']=qs[_0xcd8e('0x2b')](_[_0xcd8e('0x34')](_0x51c1a4[_0xcd8e('0x2a')],_0x435b6a[_0xcd8e('0x2b')]),_0x28f70a);if(_0x51c1a4[_0xcd8e('0x2a')][_0xcd8e('0x35')]){_0xa6d43f[_0xcd8e('0x36')]=_[_0xcd8e('0x37')](_0xa6d43f[_0xcd8e('0x36')],{'$or':_[_0xcd8e('0x26')](_0x28f70a,function(_0x39bfdb){if(_0x39bfdb[_0xcd8e('0x38')]!==_0xcd8e('0x39')){var _0x414759={};_0x414759[_0x39bfdb['name']]={'$like':'%'+_0x51c1a4[_0xcd8e('0x2a')][_0xcd8e('0x35')]+'%'};return _0x414759;}})});}_0xa6d43f=_['merge']({},_0xa6d43f,_0x51c1a4[_0xcd8e('0x3a')]);var _0x50e435={'where':_0xa6d43f[_0xcd8e('0x36')]};return db[_0xcd8e('0x27')][_0xcd8e('0x1d')](_0x50e435)[_0xcd8e('0x22')](function(_0x246ad4){_0xef7de8[_0xcd8e('0x1d')]=_0x246ad4;if(_0x51c1a4[_0xcd8e('0x2a')][_0xcd8e('0x3b')]){_0xa6d43f[_0xcd8e('0x3c')]=[{'all':!![]}];}return db[_0xcd8e('0x27')]['findAll'](_0xa6d43f);})[_0xcd8e('0x22')](function(_0x1ff9df){_0xef7de8[_0xcd8e('0x3d')]=_0x1ff9df;return _0xef7de8;})[_0xcd8e('0x22')](respondWithFilteredResult(_0x3e0eaf,_0xa6d43f))[_0xcd8e('0x3e')](handleError(_0x3e0eaf,null));};exports['show']=function(_0xaec6af,_0x33050c){var _0x346722={'raw':!![],'where':{'id':_0xaec6af[_0xcd8e('0x3f')]['id']}},_0x53b1bc={};_0x53b1bc['model']=_['keys'](db[_0xcd8e('0x27')][_0xcd8e('0x40')]);_0x53b1bc['query']=_['keys'](_0xaec6af[_0xcd8e('0x2a')]);_0x53b1bc['filters']=_['intersection'](_0x53b1bc[_0xcd8e('0x2d')],_0x53b1bc[_0xcd8e('0x2a')]);_0x346722[_0xcd8e('0x2e')]=_['intersection'](_0x53b1bc['model'],qs[_0xcd8e('0x2f')](_0xaec6af[_0xcd8e('0x2a')][_0xcd8e('0x2f')]));_0x346722[_0xcd8e('0x2e')]=_0x346722['attributes']['length']?_0x346722[_0xcd8e('0x2e')]:_0x53b1bc['model'];if(_0xaec6af[_0xcd8e('0x2a')][_0xcd8e('0x3b')]){_0x346722[_0xcd8e('0x3c')]=[{'all':!![]}];}_0x346722=_[_0xcd8e('0x37')]({},_0x346722,_0xaec6af['options']);return db[_0xcd8e('0x27')][_0xcd8e('0x41')](_0x346722)['then'](handleEntityNotFound(_0x33050c,null))['then'](respondWithResult(_0x33050c,null))[_0xcd8e('0x3e')](handleError(_0x33050c,null));};exports[_0xcd8e('0x42')]=function(_0x14cae6,_0x36bc12){return db[_0xcd8e('0x27')][_0xcd8e('0x42')](_0x14cae6[_0xcd8e('0x43')],{})['then'](respondWithResult(_0x36bc12,0xc9))['catch'](handleError(_0x36bc12,null));};exports[_0xcd8e('0x44')]=function(_0x52737c,_0x357ce0){if(_0x52737c[_0xcd8e('0x43')]['id']){delete _0x52737c[_0xcd8e('0x43')]['id'];}return db['MailTransferReport'][_0xcd8e('0x41')]({'where':{'id':_0x52737c[_0xcd8e('0x3f')]['id']}})[_0xcd8e('0x22')](handleEntityNotFound(_0x357ce0,null))[_0xcd8e('0x22')](saveUpdates(_0x52737c['body'],null))[_0xcd8e('0x22')](respondWithResult(_0x357ce0,null))[_0xcd8e('0x3e')](handleError(_0x357ce0,null));};exports[_0xcd8e('0x21')]=function(_0x47ccf7,_0x14fa97){return db[_0xcd8e('0x27')][_0xcd8e('0x41')]({'where':{'id':_0x47ccf7[_0xcd8e('0x3f')]['id']}})[_0xcd8e('0x22')](handleEntityNotFound(_0x14fa97,null))[_0xcd8e('0x22')](removeEntity(_0x14fa97,null))[_0xcd8e('0x3e')](handleError(_0x14fa97,null));};exports[_0xcd8e('0x45')]=function(_0x3a8b52,_0x36a9b2){return db[_0xcd8e('0x27')][_0xcd8e('0x45')]()[_0xcd8e('0x22')](respondWithResult(_0x36a9b2,null))[_0xcd8e('0x3e')](handleError(_0x36a9b2,null));}; \ No newline at end of file +var _0xd3d6=['describe','eml-format','zip-dir','fast-json-patch','mustache','util','sox','ejs','fs-extra','squel','crypto','jsforce','desk.js','to-csv','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/environment','../../mysqldb','sendStatus','status','end','offset','undefined','count','set','Content-Range','json','apply','reject','save','then','destroy','error','stack','send','map','rawAttributes','fieldName','type','key','query','keys','filters','intersection','model','fields','attributes','hasOwnProperty','nolimit','limit','order','sort','where','pick','VIRTUAL','filter','merge','includeAll','include','findAll','catch','params','MailTransferReport','length','create','body','update','find'];(function(_0x12dfc2,_0x34470e){var _0x22b892=function(_0x3ab0e4){while(--_0x3ab0e4){_0x12dfc2['push'](_0x12dfc2['shift']());}};_0x22b892(++_0x34470e);}(_0xd3d6,0x1eb));var _0x6d3d=function(_0xe1441d,_0x36fb8e){_0xe1441d=_0xe1441d-0x0;var _0x2ef242=_0xd3d6[_0xe1441d];return _0x2ef242;};'use strict';var emlformat=require(_0x6d3d('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x6d3d('0x1'));var jsonpatch=require(_0x6d3d('0x2'));var rp=require('request-promise');var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0x6d3d('0x3'));var util=require(_0x6d3d('0x4'));var path=require('path');var sox=require(_0x6d3d('0x5'));var csv=require('to-csv');var ejs=require(_0x6d3d('0x6'));var fs=require('fs');var fs_extra=require(_0x6d3d('0x7'));var _=require('lodash');var squel=require(_0x6d3d('0x8'));var crypto=require(_0x6d3d('0x9'));var jsforce=require(_0x6d3d('0xa'));var deskjs=require(_0x6d3d('0xb'));var toCsv=require(_0x6d3d('0xc'));var querystring=require(_0x6d3d('0xd'));var Papa=require('papaparse');var Redis=require(_0x6d3d('0xe'));var authService=require(_0x6d3d('0xf'));var qs=require(_0x6d3d('0x10'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')('api');var utils=require('../../config/utils');var config=require(_0x6d3d('0x11'));var licenseUtil=require('../../config/license/util');var db=require(_0x6d3d('0x12'))['db'];function respondWithStatusCode(_0x53a827,_0x218093){_0x218093=_0x218093||0xcc;return function(_0x402e92){if(_0x402e92){return _0x53a827[_0x6d3d('0x13')](_0x218093);}return _0x53a827[_0x6d3d('0x14')](_0x218093)[_0x6d3d('0x15')]();};}function respondWithResult(_0x33cba5,_0x1e65f5){_0x1e65f5=_0x1e65f5||0xc8;return function(_0x8a25f2){if(_0x8a25f2){return _0x33cba5[_0x6d3d('0x14')](_0x1e65f5)['json'](_0x8a25f2);}};}function respondWithFilteredResult(_0x4d7a9a,_0x391538){return function(_0xd50150){if(_0xd50150){var _0x26d666=typeof _0x391538[_0x6d3d('0x16')]===_0x6d3d('0x17')&&typeof _0x391538['limit']===_0x6d3d('0x17');var _0x4bd6fa=_0xd50150[_0x6d3d('0x18')];var _0x5302fb=_0x26d666?0x0:_0x391538[_0x6d3d('0x16')];var _0x501260=_0x26d666?_0xd50150['count']:_0x391538[_0x6d3d('0x16')]+_0x391538['limit'];var _0x1ebb4c;if(_0x501260>=_0x4bd6fa){_0x501260=_0x4bd6fa;_0x1ebb4c=0xc8;}else{_0x1ebb4c=0xce;}_0x4d7a9a[_0x6d3d('0x14')](_0x1ebb4c);return _0x4d7a9a[_0x6d3d('0x19')](_0x6d3d('0x1a'),_0x5302fb+'-'+_0x501260+'/'+_0x4bd6fa)[_0x6d3d('0x1b')](_0xd50150);}return null;};}function patchUpdates(_0x5acb07){return function(_0x27a95f){try{jsonpatch[_0x6d3d('0x1c')](_0x27a95f,_0x5acb07,!![]);}catch(_0x1eb804){return BPromise[_0x6d3d('0x1d')](_0x1eb804);}return _0x27a95f[_0x6d3d('0x1e')]();};}function saveUpdates(_0x151307,_0x48738c){return function(_0x35f064){if(_0x35f064){return _0x35f064['update'](_0x151307)[_0x6d3d('0x1f')](function(_0x103f3c){return _0x103f3c;});}return null;};}function removeEntity(_0x375e8d,_0x49f21e){return function(_0x5521ab){if(_0x5521ab){return _0x5521ab[_0x6d3d('0x20')]()[_0x6d3d('0x1f')](function(){_0x375e8d[_0x6d3d('0x14')](0xcc)['end']();});}};}function handleEntityNotFound(_0x74dee4,_0x5c42f7){return function(_0x340a7c){if(!_0x340a7c){_0x74dee4[_0x6d3d('0x13')](0x194);}return _0x340a7c;};}function handleError(_0x550708,_0x2a6d2e){_0x2a6d2e=_0x2a6d2e||0x1f4;return function(_0x4bd142){logger[_0x6d3d('0x21')](_0x4bd142[_0x6d3d('0x22')]);if(_0x4bd142['name']){delete _0x4bd142['name'];}_0x550708[_0x6d3d('0x14')](_0x2a6d2e)[_0x6d3d('0x23')](_0x4bd142);};}exports['index']=function(_0x5a2b34,_0x23c7df){var _0x435e85={},_0x5a3538={},_0x2b1daa={'count':0x0,'rows':[]};var _0x47a03d=_[_0x6d3d('0x24')](db['MailTransferReport'][_0x6d3d('0x25')],function(_0x1935ee){return{'name':_0x1935ee[_0x6d3d('0x26')],'type':_0x1935ee[_0x6d3d('0x27')][_0x6d3d('0x28')]};});_0x5a3538['model']=_[_0x6d3d('0x24')](_0x47a03d,'name');_0x5a3538[_0x6d3d('0x29')]=_[_0x6d3d('0x2a')](_0x5a2b34[_0x6d3d('0x29')]);_0x5a3538[_0x6d3d('0x2b')]=_[_0x6d3d('0x2c')](_0x5a3538[_0x6d3d('0x2d')],_0x5a3538[_0x6d3d('0x29')]);_0x435e85['attributes']=_[_0x6d3d('0x2c')](_0x5a3538[_0x6d3d('0x2d')],qs[_0x6d3d('0x2e')](_0x5a2b34['query'][_0x6d3d('0x2e')]));_0x435e85[_0x6d3d('0x2f')]=_0x435e85[_0x6d3d('0x2f')]['length']?_0x435e85[_0x6d3d('0x2f')]:_0x5a3538[_0x6d3d('0x2d')];if(!_0x5a2b34['query'][_0x6d3d('0x30')](_0x6d3d('0x31'))){_0x435e85['limit']=qs[_0x6d3d('0x32')](_0x5a2b34[_0x6d3d('0x29')][_0x6d3d('0x32')]);_0x435e85['offset']=qs['offset'](_0x5a2b34[_0x6d3d('0x29')][_0x6d3d('0x16')]);}_0x435e85[_0x6d3d('0x33')]=qs[_0x6d3d('0x34')](_0x5a2b34['query'][_0x6d3d('0x34')]);_0x435e85[_0x6d3d('0x35')]=qs[_0x6d3d('0x2b')](_[_0x6d3d('0x36')](_0x5a2b34[_0x6d3d('0x29')],_0x5a3538[_0x6d3d('0x2b')]),_0x47a03d);if(_0x5a2b34[_0x6d3d('0x29')]['filter']){_0x435e85[_0x6d3d('0x35')]=_['merge'](_0x435e85[_0x6d3d('0x35')],{'$or':_[_0x6d3d('0x24')](_0x47a03d,function(_0x3aa328){if(_0x3aa328[_0x6d3d('0x27')]!==_0x6d3d('0x37')){var _0x3c6a3c={};_0x3c6a3c[_0x3aa328['name']]={'$like':'%'+_0x5a2b34[_0x6d3d('0x29')][_0x6d3d('0x38')]+'%'};return _0x3c6a3c;}})});}_0x435e85=_[_0x6d3d('0x39')]({},_0x435e85,_0x5a2b34['options']);var _0x49d827={'where':_0x435e85[_0x6d3d('0x35')]};return db['MailTransferReport'][_0x6d3d('0x18')](_0x49d827)[_0x6d3d('0x1f')](function(_0x470750){_0x2b1daa['count']=_0x470750;if(_0x5a2b34[_0x6d3d('0x29')][_0x6d3d('0x3a')]){_0x435e85[_0x6d3d('0x3b')]=[{'all':!![]}];}return db['MailTransferReport'][_0x6d3d('0x3c')](_0x435e85);})[_0x6d3d('0x1f')](function(_0xf8aff){_0x2b1daa['rows']=_0xf8aff;return _0x2b1daa;})[_0x6d3d('0x1f')](respondWithFilteredResult(_0x23c7df,_0x435e85))[_0x6d3d('0x3d')](handleError(_0x23c7df,null));};exports['show']=function(_0x1ca6e8,_0x1e9255){var _0x438528={'raw':!![],'where':{'id':_0x1ca6e8[_0x6d3d('0x3e')]['id']}},_0x2194e4={};_0x2194e4['model']=_[_0x6d3d('0x2a')](db[_0x6d3d('0x3f')][_0x6d3d('0x25')]);_0x2194e4[_0x6d3d('0x29')]=_[_0x6d3d('0x2a')](_0x1ca6e8[_0x6d3d('0x29')]);_0x2194e4[_0x6d3d('0x2b')]=_[_0x6d3d('0x2c')](_0x2194e4[_0x6d3d('0x2d')],_0x2194e4[_0x6d3d('0x29')]);_0x438528[_0x6d3d('0x2f')]=_[_0x6d3d('0x2c')](_0x2194e4['model'],qs[_0x6d3d('0x2e')](_0x1ca6e8[_0x6d3d('0x29')][_0x6d3d('0x2e')]));_0x438528[_0x6d3d('0x2f')]=_0x438528['attributes'][_0x6d3d('0x40')]?_0x438528[_0x6d3d('0x2f')]:_0x2194e4[_0x6d3d('0x2d')];if(_0x1ca6e8['query'][_0x6d3d('0x3a')]){_0x438528[_0x6d3d('0x3b')]=[{'all':!![]}];}_0x438528=_['merge']({},_0x438528,_0x1ca6e8['options']);return db[_0x6d3d('0x3f')]['find'](_0x438528)[_0x6d3d('0x1f')](handleEntityNotFound(_0x1e9255,null))['then'](respondWithResult(_0x1e9255,null))[_0x6d3d('0x3d')](handleError(_0x1e9255,null));};exports[_0x6d3d('0x41')]=function(_0x3c529d,_0x5871d1){return db[_0x6d3d('0x3f')][_0x6d3d('0x41')](_0x3c529d[_0x6d3d('0x42')],{})['then'](respondWithResult(_0x5871d1,0xc9))['catch'](handleError(_0x5871d1,null));};exports[_0x6d3d('0x43')]=function(_0x4fd9de,_0x5e23f2){if(_0x4fd9de[_0x6d3d('0x42')]['id']){delete _0x4fd9de[_0x6d3d('0x42')]['id'];}return db[_0x6d3d('0x3f')][_0x6d3d('0x44')]({'where':{'id':_0x4fd9de[_0x6d3d('0x3e')]['id']}})[_0x6d3d('0x1f')](handleEntityNotFound(_0x5e23f2,null))[_0x6d3d('0x1f')](saveUpdates(_0x4fd9de[_0x6d3d('0x42')],null))[_0x6d3d('0x1f')](respondWithResult(_0x5e23f2,null))[_0x6d3d('0x3d')](handleError(_0x5e23f2,null));};exports['destroy']=function(_0x2e7838,_0x2bc4af){return db['MailTransferReport']['find']({'where':{'id':_0x2e7838[_0x6d3d('0x3e')]['id']}})['then'](handleEntityNotFound(_0x2bc4af,null))[_0x6d3d('0x1f')](removeEntity(_0x2bc4af,null))[_0x6d3d('0x3d')](handleError(_0x2bc4af,null));};exports[_0x6d3d('0x45')]=function(_0x53a22e,_0x5a59a4){return db['MailTransferReport'][_0x6d3d('0x45')]()['then'](respondWithResult(_0x5a59a4,null))['catch'](handleError(_0x5a59a4,null));}; \ No newline at end of file diff --git a/server/api/mailTransferReport/mailTransferReport.model.js b/server/api/mailTransferReport/mailTransferReport.model.js index 13f38a2..dff1781 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 _0x919e=['MailTransferReport','report_mail_transfer','uniqueid','lodash','util','../../config/logger','moment','path','rimraf','../../config/environment','./mailTransferReport.attributes','exports'];(function(_0xc7ac70,_0x3576e9){var _0x566465=function(_0x5c5988){while(--_0x5c5988){_0xc7ac70['push'](_0xc7ac70['shift']());}};_0x566465(++_0x3576e9);}(_0x919e,0x1d7));var _0xe919=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x919e[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0xe919('0x0'));var util=require(_0xe919('0x1'));var logger=require(_0xe919('0x2'))('api');var moment=require(_0xe919('0x3'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0xe919('0x4'));var rimraf=require(_0xe919('0x5'));var config=require(_0xe919('0x6'));var attributes=require(_0xe919('0x7'));module[_0xe919('0x8')]=function(_0x5a27ad,_0x1225a5){return _0x5a27ad['define'](_0xe919('0x9'),attributes,{'tableName':_0xe919('0xa'),'paranoid':![],'indexes':[{'name':'uniqueid','fields':[_0xe919('0xb')]}],'timestamps':!![]});}; \ No newline at end of file +var _0xb56f=['util','../../config/logger','moment','bluebird','path','rimraf','./mailTransferReport.attributes','exports','define','MailTransferReport','uniqueid','lodash'];(function(_0x1c8285,_0x50c0d4){var _0x3d166f=function(_0x415e20){while(--_0x415e20){_0x1c8285['push'](_0x1c8285['shift']());}};_0x3d166f(++_0x50c0d4);}(_0xb56f,0x113));var _0xfb56=function(_0x59e4bc,_0x5da4c9){_0x59e4bc=_0x59e4bc-0x0;var _0x10186f=_0xb56f[_0x59e4bc];return _0x10186f;};'use strict';var _=require(_0xfb56('0x0'));var util=require(_0xfb56('0x1'));var logger=require(_0xfb56('0x2'))('api');var moment=require(_0xfb56('0x3'));var BPromise=require(_0xfb56('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xfb56('0x5'));var rimraf=require(_0xfb56('0x6'));var config=require('../../config/environment');var attributes=require(_0xfb56('0x7'));module[_0xfb56('0x8')]=function(_0x1c4e41,_0x38a9ac){return _0x1c4e41[_0xfb56('0x9')](_0xfb56('0xa'),attributes,{'tableName':'report_mail_transfer','paranoid':![],'indexes':[{'name':'uniqueid','fields':[_0xfb56('0xb')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/mailTransferReport/mailTransferReport.rpc.js b/server/api/mailTransferReport/mailTransferReport.rpc.js index edebb7c..e80df77 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 _0x549c=['http','request','then','info','request\x20sent','debug','MailTransferReport,\x20%s,\x20%s,\x20%s','stringify','error','MailTransferReport,\x20%s,\x20%s','message','lodash','util','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client'];(function(_0x2ded5f,_0x1a5f3b){var _0x38375f=function(_0x32f28b){while(--_0x32f28b){_0x2ded5f['push'](_0x2ded5f['shift']());}};_0x38375f(++_0x1a5f3b);}(_0x549c,0x13f));var _0xc549=function(_0x4ac946,_0x3d8fab){_0x4ac946=_0x4ac946-0x0;var _0xfe1b85=_0x549c[_0x4ac946];return _0xfe1b85;};'use strict';var _=require(_0xc549('0x0'));var util=require(_0xc549('0x1'));var moment=require('moment');var BPromise=require(_0xc549('0x2'));var rs=require(_0xc549('0x3'));var fs=require('fs');var Redis=require(_0xc549('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0xc549('0x5'));var logger=require(_0xc549('0x6'))(_0xc549('0x7'));var config=require(_0xc549('0x8'));var jayson=require(_0xc549('0x9'));var client=jayson[_0xc549('0xa')][_0xc549('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x1c27ee,_0x41728b,_0x2df4db){return new BPromise(function(_0x11ebfa,_0x593614){return client[_0xc549('0xc')](_0x1c27ee,_0x2df4db)[_0xc549('0xd')](function(_0x129827){logger[_0xc549('0xe')]('MailTransferReport,\x20%s,\x20%s',_0x41728b,_0xc549('0xf'));logger[_0xc549('0x10')](_0xc549('0x11'),_0x41728b,'request\x20sent',JSON[_0xc549('0x12')](_0x129827));if(_0x129827[_0xc549('0x13')]){if(_0x129827[_0xc549('0x13')]['code']===0x1f4){logger[_0xc549('0x13')](_0xc549('0x14'),_0x41728b,_0x129827[_0xc549('0x13')][_0xc549('0x15')]);return _0x593614(_0x129827[_0xc549('0x13')]['message']);}logger[_0xc549('0x13')](_0xc549('0x14'),_0x41728b,_0x129827['error'][_0xc549('0x15')]);return _0x11ebfa(_0x129827[_0xc549('0x13')][_0xc549('0x15')]);}else{logger[_0xc549('0xe')](_0xc549('0x14'),_0x41728b,_0xc549('0xf'));_0x11ebfa(_0x129827['result'][_0xc549('0x15')]);}})['catch'](function(_0x2bd3f5){logger[_0xc549('0x13')]('MailTransferReport,\x20%s,\x20%s',_0x41728b,_0x2bd3f5);_0x593614(_0x2bd3f5);});});} \ No newline at end of file +var _0xd572=['request','then','MailTransferReport,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','info','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','../../config/environment','jayson/promise','client','http'];(function(_0x695b76,_0x551526){var _0x1dc21f=function(_0x5fdb1c){while(--_0x5fdb1c){_0x695b76['push'](_0x695b76['shift']());}};_0x1dc21f(++_0x551526);}(_0xd572,0xc7));var _0x2d57=function(_0x5e61aa,_0x1650fd){_0x5e61aa=_0x5e61aa-0x0;var _0x360b50=_0xd572[_0x5e61aa];return _0x360b50;};'use strict';var _=require('lodash');var util=require(_0x2d57('0x0'));var moment=require(_0x2d57('0x1'));var BPromise=require(_0x2d57('0x2'));var rs=require(_0x2d57('0x3'));var fs=require('fs');var Redis=require(_0x2d57('0x4'));var db=require(_0x2d57('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0x2d57('0x6'))('rpc');var config=require(_0x2d57('0x7'));var jayson=require(_0x2d57('0x8'));var client=jayson[_0x2d57('0x9')][_0x2d57('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x54c7af,_0x36fedb,_0x3454a1){return new BPromise(function(_0x52db0e,_0x26e510){return client[_0x2d57('0xb')](_0x54c7af,_0x3454a1)[_0x2d57('0xc')](function(_0x381833){logger['info'](_0x2d57('0xd'),_0x36fedb,_0x2d57('0xe'));logger[_0x2d57('0xf')]('MailTransferReport,\x20%s,\x20%s,\x20%s',_0x36fedb,'request\x20sent',JSON[_0x2d57('0x10')](_0x381833));if(_0x381833['error']){if(_0x381833[_0x2d57('0x11')][_0x2d57('0x12')]===0x1f4){logger['error']('MailTransferReport,\x20%s,\x20%s',_0x36fedb,_0x381833[_0x2d57('0x11')][_0x2d57('0x13')]);return _0x26e510(_0x381833['error'][_0x2d57('0x13')]);}logger['error'](_0x2d57('0xd'),_0x36fedb,_0x381833[_0x2d57('0x11')][_0x2d57('0x13')]);return _0x52db0e(_0x381833['error'][_0x2d57('0x13')]);}else{logger[_0x2d57('0x14')](_0x2d57('0xd'),_0x36fedb,_0x2d57('0xe'));_0x52db0e(_0x381833['result']['message']);}})['catch'](function(_0x583a20){logger[_0x2d57('0x11')](_0x2d57('0xd'),_0x36fedb,_0x583a20);_0x26e510(_0x583a20);});});} \ No newline at end of file diff --git a/server/api/memberReport/index.js b/server/api/memberReport/index.js index d8cae0d..8de8dbf 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 _0x2542=['Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','/describe','describe','show','post','create','put','/:id','update','destroy','exports','multer','util','path','express'];(function(_0x525c7b,_0x488fcc){var _0x27b33e=function(_0x56d43b){while(--_0x56d43b){_0x525c7b['push'](_0x525c7b['shift']());}};_0x27b33e(++_0x488fcc);}(_0x2542,0x1b5));var _0x2254=function(_0x876408,_0x2df29f){_0x876408=_0x876408-0x0;var _0x1fa441=_0x2542[_0x876408];return _0x1fa441;};'use strict';var multer=require(_0x2254('0x0'));var util=require(_0x2254('0x1'));var path=require(_0x2254('0x2'));var timeout=require('connect-timeout');var express=require(_0x2254('0x3'));var router=express[_0x2254('0x4')]();var fs_extra=require(_0x2254('0x5'));var auth=require(_0x2254('0x6'));var interaction=require(_0x2254('0x7'));var config=require(_0x2254('0x8'));var controller=require('./memberReport.controller');router[_0x2254('0x9')]('/',auth[_0x2254('0xa')](),controller['index']);router['get'](_0x2254('0xb'),auth[_0x2254('0xa')](),controller[_0x2254('0xc')]);router[_0x2254('0x9')]('/:id',auth[_0x2254('0xa')](),controller[_0x2254('0xd')]);router[_0x2254('0xe')]('/',auth[_0x2254('0xa')](),controller[_0x2254('0xf')]);router[_0x2254('0x10')](_0x2254('0x11'),auth[_0x2254('0xa')](),controller[_0x2254('0x12')]);router['delete'](_0x2254('0x11'),auth[_0x2254('0xa')](),controller[_0x2254('0x13')]);module[_0x2254('0x14')]=router; \ No newline at end of file +var _0x0769=['../../components/interaction/service','./memberReport.controller','isAuthenticated','index','get','/describe','describe','/:id','show','post','create','put','update','delete','multer','path','connect-timeout','fs-extra'];(function(_0x12d7e6,_0x2bdea6){var _0x1639c3=function(_0x335b72){while(--_0x335b72){_0x12d7e6['push'](_0x12d7e6['shift']());}};_0x1639c3(++_0x2bdea6);}(_0x0769,0x140));var _0x9076=function(_0x56eafe,_0x427600){_0x56eafe=_0x56eafe-0x0;var _0x5c27af=_0x0769[_0x56eafe];return _0x5c27af;};'use strict';var multer=require(_0x9076('0x0'));var util=require('util');var path=require(_0x9076('0x1'));var timeout=require(_0x9076('0x2'));var express=require('express');var router=express['Router']();var fs_extra=require(_0x9076('0x3'));var auth=require('../../components/auth/service');var interaction=require(_0x9076('0x4'));var config=require('../../config/environment');var controller=require(_0x9076('0x5'));router['get']('/',auth[_0x9076('0x6')](),controller[_0x9076('0x7')]);router[_0x9076('0x8')](_0x9076('0x9'),auth['isAuthenticated'](),controller[_0x9076('0xa')]);router[_0x9076('0x8')](_0x9076('0xb'),auth[_0x9076('0x6')](),controller[_0x9076('0xc')]);router[_0x9076('0xd')]('/',auth[_0x9076('0x6')](),controller[_0x9076('0xe')]);router[_0x9076('0xf')](_0x9076('0xb'),auth[_0x9076('0x6')](),controller[_0x9076('0x10')]);router[_0x9076('0x11')]('/:id',auth['isAuthenticated'](),controller['destroy']);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 14236d5..ed39288 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 _0x0ae5=['exitAt','talk:[start]','talk:[destination]','talk:[dial\x20string]','talk:[queue]','sequelize','exports','STRING','LOGIN,\x20PAUSE,\x20TALKING','INTEGER','DATE','getDataValue','enterAt','seconds'];(function(_0x3fa59c,_0x2302f9){var _0x239a2c=function(_0x410d0f){while(--_0x410d0f){_0x3fa59c['push'](_0x3fa59c['shift']());}};_0x239a2c(++_0x2302f9);}(_0x0ae5,0x1b7));var _0x50ae=function(_0x20de98,_0x2ef701){_0x20de98=_0x20de98-0x0;var _0xdc9590=_0x0ae5[_0x20de98];return _0xdc9590;};'use strict';var Sequelize=require(_0x50ae('0x0'));var moment=require('moment');module[_0x50ae('0x1')]={'channel':{'type':Sequelize[_0x50ae('0x2')]},'membername':{'type':Sequelize['STRING']},'interface':{'type':Sequelize[_0x50ae('0x2')]},'type':{'type':Sequelize[_0x50ae('0x2')],'defaultValue':'DEFAULT\x20PAUSE','comment':_0x50ae('0x3')},'duration':{'type':Sequelize[_0x50ae('0x4')]},'enterAt':{'type':Sequelize[_0x50ae('0x5')]},'exitAt':{'type':Sequelize['DATE'],'set':function(_0x5b9909){var _0x462195=moment(_0x5b9909);var _0x4be5d6=moment(this[_0x50ae('0x6')](_0x50ae('0x7')));var _0x58c884=_0x462195['diff'](_0x4be5d6,_0x50ae('0x8'));this['setDataValue'](_0x50ae('0x9'),_0x5b9909);this['setDataValue']('duration',_0x58c884>=0x0?_0x58c884:null);}},'data1':{'type':Sequelize[_0x50ae('0x2')],'comment':'talk:[inbound,\x20outbound],\x20pause:[reason]'},'data2':{'type':Sequelize[_0x50ae('0x2')],'comment':_0x50ae('0xa')},'data3':{'type':Sequelize[_0x50ae('0x2')],'comment':_0x50ae('0xb')},'data4':{'type':Sequelize['STRING'],'comment':_0x50ae('0xc')},'data5':{'type':Sequelize[_0x50ae('0x2')],'comment':_0x50ae('0xd')},'role':{'type':Sequelize[_0x50ae('0x2')]},'internal':{'type':Sequelize['INTEGER']},'uniqueid':{'type':Sequelize[_0x50ae('0x2')]}}; \ No newline at end of file +var _0x8668=['moment','exports','STRING','LOGIN,\x20PAUSE,\x20TALKING','DATE','getDataValue','enterAt','diff','seconds','setDataValue','exitAt','talk:[inbound,\x20outbound],\x20pause:[reason]','talk:[start]','talk:[destination]','talk:[dial\x20string]','talk:[queue]','sequelize'];(function(_0xd764c8,_0x2b0666){var _0x495c4b=function(_0x5e9769){while(--_0x5e9769){_0xd764c8['push'](_0xd764c8['shift']());}};_0x495c4b(++_0x2b0666);}(_0x8668,0x131));var _0x8866=function(_0xd51cc4,_0x253ca0){_0xd51cc4=_0xd51cc4-0x0;var _0x3e1d7c=_0x8668[_0xd51cc4];return _0x3e1d7c;};'use strict';var Sequelize=require(_0x8866('0x0'));var moment=require(_0x8866('0x1'));module[_0x8866('0x2')]={'channel':{'type':Sequelize['STRING']},'membername':{'type':Sequelize[_0x8866('0x3')]},'interface':{'type':Sequelize[_0x8866('0x3')]},'type':{'type':Sequelize[_0x8866('0x3')],'defaultValue':'DEFAULT\x20PAUSE','comment':_0x8866('0x4')},'duration':{'type':Sequelize['INTEGER']},'enterAt':{'type':Sequelize[_0x8866('0x5')]},'exitAt':{'type':Sequelize['DATE'],'set':function(_0x510dd1){var _0x34feab=moment(_0x510dd1);var _0x5589bb=moment(this[_0x8866('0x6')](_0x8866('0x7')));var _0x5aa034=_0x34feab[_0x8866('0x8')](_0x5589bb,_0x8866('0x9'));this[_0x8866('0xa')](_0x8866('0xb'),_0x510dd1);this['setDataValue']('duration',_0x5aa034>=0x0?_0x5aa034:null);}},'data1':{'type':Sequelize['STRING'],'comment':_0x8866('0xc')},'data2':{'type':Sequelize['STRING'],'comment':_0x8866('0xd')},'data3':{'type':Sequelize[_0x8866('0x3')],'comment':_0x8866('0xe')},'data4':{'type':Sequelize['STRING'],'comment':_0x8866('0xf')},'data5':{'type':Sequelize['STRING'],'comment':_0x8866('0x10')},'role':{'type':Sequelize[_0x8866('0x3')]},'internal':{'type':Sequelize['INTEGER']},'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 fe50cf9..573280a 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(_0x8c43de,_0x90ff31){var _0xa6591b=function(_0x469716){while(--_0x469716){_0x8c43de['push'](_0x8c43de['shift']());}};_0xa6591b(++_0x90ff31);}(_0x55ca,0x126));var _0xa55c=function(_0x315d84,_0x3dacc3){_0x315d84=_0x315d84-0x0;var _0x560da1=_0x55ca[_0x315d84];return _0x560da1;};'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 _0x9c44=['catch','params','find','create','body','describe','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','sox','ejs','fs-extra','lodash','squel','crypto','desk.js','to-csv','querystring','papaparse','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/license/util','../../mysqldb','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','destroy','sendStatus','stack','name','send','index','map','MemberReport','rawAttributes','fieldName','type','query','keys','filters','model','attributes','intersection','fields','length','hasOwnProperty','order','sort','pick','filter','where','merge','VIRTUAL','options','then','includeAll','include','findAll','rows'];(function(_0x32e6d3,_0x102df4){var _0x1a1696=function(_0xc3a0b1){while(--_0xc3a0b1){_0x32e6d3['push'](_0x32e6d3['shift']());}};_0x1a1696(++_0x102df4);}(_0x9c44,0x178));var _0x49c4=function(_0x3ff085,_0x27c92e){_0x3ff085=_0x3ff085-0x0;var _0x2b68c3=_0x9c44[_0x3ff085];return _0x2b68c3;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0x49c4('0x0'));var jsonpatch=require(_0x49c4('0x1'));var rp=require(_0x49c4('0x2'));var moment=require(_0x49c4('0x3'));var BPromise=require(_0x49c4('0x4'));var Mustache=require(_0x49c4('0x5'));var util=require('util');var path=require('path');var sox=require(_0x49c4('0x6'));var csv=require('to-csv');var ejs=require(_0x49c4('0x7'));var fs=require('fs');var fs_extra=require(_0x49c4('0x8'));var _=require(_0x49c4('0x9'));var squel=require(_0x49c4('0xa'));var crypto=require(_0x49c4('0xb'));var jsforce=require('jsforce');var deskjs=require(_0x49c4('0xc'));var toCsv=require(_0x49c4('0xd'));var querystring=require(_0x49c4('0xe'));var Papa=require(_0x49c4('0xf'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0x49c4('0x10'));var as=require(_0x49c4('0x11'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x49c4('0x12'))(_0x49c4('0x13'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0x49c4('0x14'));var db=require(_0x49c4('0x15'))['db'];function respondWithStatusCode(_0x5487cd,_0x7df3a9){_0x7df3a9=_0x7df3a9||0xcc;return function(_0x403bfb){if(_0x403bfb){return _0x5487cd['sendStatus'](_0x7df3a9);}return _0x5487cd[_0x49c4('0x16')](_0x7df3a9)[_0x49c4('0x17')]();};}function respondWithResult(_0x21f15a,_0x2decee){_0x2decee=_0x2decee||0xc8;return function(_0x12777c){if(_0x12777c){return _0x21f15a[_0x49c4('0x16')](_0x2decee)[_0x49c4('0x18')](_0x12777c);}};}function respondWithFilteredResult(_0x3de397,_0x58d177){return function(_0x3acd06){if(_0x3acd06){var _0x141003=typeof _0x58d177[_0x49c4('0x19')]===_0x49c4('0x1a')&&typeof _0x58d177[_0x49c4('0x1b')]==='undefined';var _0x44e607=_0x3acd06[_0x49c4('0x1c')];var _0x4c3253=_0x141003?0x0:_0x58d177['offset'];var _0x3c782d=_0x141003?_0x3acd06[_0x49c4('0x1c')]:_0x58d177[_0x49c4('0x19')]+_0x58d177['limit'];var _0x24856d;if(_0x3c782d>=_0x44e607){_0x3c782d=_0x44e607;_0x24856d=0xc8;}else{_0x24856d=0xce;}_0x3de397['status'](_0x24856d);return _0x3de397[_0x49c4('0x1d')](_0x49c4('0x1e'),_0x4c3253+'-'+_0x3c782d+'/'+_0x44e607)[_0x49c4('0x18')](_0x3acd06);}return null;};}function patchUpdates(_0x291526){return function(_0x382040){try{jsonpatch[_0x49c4('0x1f')](_0x382040,_0x291526,!![]);}catch(_0x280893){return BPromise[_0x49c4('0x20')](_0x280893);}return _0x382040[_0x49c4('0x21')]();};}function saveUpdates(_0x578447,_0x527126){return function(_0x57f502){if(_0x57f502){return _0x57f502[_0x49c4('0x22')](_0x578447)['then'](function(_0x592bb8){return _0x592bb8;});}return null;};}function removeEntity(_0x2263ae,_0x15581b){return function(_0x26c640){if(_0x26c640){return _0x26c640[_0x49c4('0x23')]()['then'](function(){_0x2263ae['status'](0xcc)[_0x49c4('0x17')]();});}};}function handleEntityNotFound(_0x9cb797,_0x565423){return function(_0x207358){if(!_0x207358){_0x9cb797[_0x49c4('0x24')](0x194);}return _0x207358;};}function handleError(_0x210159,_0xa7a826){_0xa7a826=_0xa7a826||0x1f4;return function(_0x531d92){logger['error'](_0x531d92[_0x49c4('0x25')]);if(_0x531d92['name']){delete _0x531d92[_0x49c4('0x26')];}_0x210159[_0x49c4('0x16')](_0xa7a826)[_0x49c4('0x27')](_0x531d92);};}exports[_0x49c4('0x28')]=function(_0x5987ae,_0x889909){var _0x2b2793={},_0x46e04d={},_0x4f28a2={'count':0x0,'rows':[]};var _0x6329b3=_[_0x49c4('0x29')](db[_0x49c4('0x2a')][_0x49c4('0x2b')],function(_0x17b50f){return{'name':_0x17b50f[_0x49c4('0x2c')],'type':_0x17b50f[_0x49c4('0x2d')]['key']};});_0x46e04d['model']=_['map'](_0x6329b3,_0x49c4('0x26'));_0x46e04d[_0x49c4('0x2e')]=_[_0x49c4('0x2f')](_0x5987ae[_0x49c4('0x2e')]);_0x46e04d[_0x49c4('0x30')]=_['intersection'](_0x46e04d[_0x49c4('0x31')],_0x46e04d[_0x49c4('0x2e')]);_0x2b2793[_0x49c4('0x32')]=_[_0x49c4('0x33')](_0x46e04d['model'],qs['fields'](_0x5987ae[_0x49c4('0x2e')][_0x49c4('0x34')]));_0x2b2793[_0x49c4('0x32')]=_0x2b2793[_0x49c4('0x32')][_0x49c4('0x35')]?_0x2b2793['attributes']:_0x46e04d[_0x49c4('0x31')];if(!_0x5987ae[_0x49c4('0x2e')][_0x49c4('0x36')]('nolimit')){_0x2b2793['limit']=qs[_0x49c4('0x1b')](_0x5987ae[_0x49c4('0x2e')][_0x49c4('0x1b')]);_0x2b2793[_0x49c4('0x19')]=qs[_0x49c4('0x19')](_0x5987ae[_0x49c4('0x2e')][_0x49c4('0x19')]);}_0x2b2793[_0x49c4('0x37')]=qs[_0x49c4('0x38')](_0x5987ae['query'][_0x49c4('0x38')]);_0x2b2793['where']=qs[_0x49c4('0x30')](_[_0x49c4('0x39')](_0x5987ae[_0x49c4('0x2e')],_0x46e04d[_0x49c4('0x30')]),_0x6329b3);if(_0x5987ae['query'][_0x49c4('0x3a')]){_0x2b2793[_0x49c4('0x3b')]=_[_0x49c4('0x3c')](_0x2b2793['where'],{'$or':_[_0x49c4('0x29')](_0x6329b3,function(_0x21d8c7){if(_0x21d8c7[_0x49c4('0x2d')]!==_0x49c4('0x3d')){var _0x1ba7a0={};_0x1ba7a0[_0x21d8c7[_0x49c4('0x26')]]={'$like':'%'+_0x5987ae[_0x49c4('0x2e')][_0x49c4('0x3a')]+'%'};return _0x1ba7a0;}})});}_0x2b2793=_[_0x49c4('0x3c')]({},_0x2b2793,_0x5987ae[_0x49c4('0x3e')]);var _0x1e506a={'where':_0x2b2793['where']};return db[_0x49c4('0x2a')][_0x49c4('0x1c')](_0x1e506a)[_0x49c4('0x3f')](function(_0x23aa32){_0x4f28a2[_0x49c4('0x1c')]=_0x23aa32;if(_0x5987ae[_0x49c4('0x2e')][_0x49c4('0x40')]){_0x2b2793[_0x49c4('0x41')]=[{'all':!![]}];}return db[_0x49c4('0x2a')][_0x49c4('0x42')](_0x2b2793);})[_0x49c4('0x3f')](function(_0xa3d59e){_0x4f28a2[_0x49c4('0x43')]=_0xa3d59e;return _0x4f28a2;})['then'](respondWithFilteredResult(_0x889909,_0x2b2793))[_0x49c4('0x44')](handleError(_0x889909,null));};exports['show']=function(_0x104efb,_0x4915bc){var _0x28d4fb={'raw':!![],'where':{'id':_0x104efb[_0x49c4('0x45')]['id']}},_0x1480da={};_0x1480da[_0x49c4('0x31')]=_['keys'](db['MemberReport'][_0x49c4('0x2b')]);_0x1480da[_0x49c4('0x2e')]=_[_0x49c4('0x2f')](_0x104efb[_0x49c4('0x2e')]);_0x1480da['filters']=_[_0x49c4('0x33')](_0x1480da[_0x49c4('0x31')],_0x1480da[_0x49c4('0x2e')]);_0x28d4fb[_0x49c4('0x32')]=_[_0x49c4('0x33')](_0x1480da[_0x49c4('0x31')],qs[_0x49c4('0x34')](_0x104efb[_0x49c4('0x2e')][_0x49c4('0x34')]));_0x28d4fb['attributes']=_0x28d4fb[_0x49c4('0x32')]['length']?_0x28d4fb[_0x49c4('0x32')]:_0x1480da[_0x49c4('0x31')];if(_0x104efb[_0x49c4('0x2e')][_0x49c4('0x40')]){_0x28d4fb[_0x49c4('0x41')]=[{'all':!![]}];}_0x28d4fb=_['merge']({},_0x28d4fb,_0x104efb[_0x49c4('0x3e')]);return db[_0x49c4('0x2a')][_0x49c4('0x46')](_0x28d4fb)[_0x49c4('0x3f')](handleEntityNotFound(_0x4915bc,null))[_0x49c4('0x3f')](respondWithResult(_0x4915bc,null))[_0x49c4('0x44')](handleError(_0x4915bc,null));};exports[_0x49c4('0x47')]=function(_0x4d89e0,_0x3bac1b){return db['MemberReport'][_0x49c4('0x47')](_0x4d89e0[_0x49c4('0x48')],{})[_0x49c4('0x3f')](respondWithResult(_0x3bac1b,0xc9))[_0x49c4('0x44')](handleError(_0x3bac1b,null));};exports[_0x49c4('0x22')]=function(_0x30bea5,_0x2c6be1){if(_0x30bea5['body']['id']){delete _0x30bea5[_0x49c4('0x48')]['id'];}return db[_0x49c4('0x2a')]['find']({'where':{'id':_0x30bea5[_0x49c4('0x45')]['id']}})[_0x49c4('0x3f')](handleEntityNotFound(_0x2c6be1,null))[_0x49c4('0x3f')](saveUpdates(_0x30bea5[_0x49c4('0x48')],null))['then'](respondWithResult(_0x2c6be1,null))['catch'](handleError(_0x2c6be1,null));};exports[_0x49c4('0x23')]=function(_0x4e8221,_0x4597c3){return db[_0x49c4('0x2a')][_0x49c4('0x46')]({'where':{'id':_0x4e8221[_0x49c4('0x45')]['id']}})[_0x49c4('0x3f')](handleEntityNotFound(_0x4597c3,null))[_0x49c4('0x3f')](removeEntity(_0x4597c3,null))[_0x49c4('0x44')](handleError(_0x4597c3,null));};exports['describe']=function(_0x1f26c2,_0x1550ce){return db[_0x49c4('0x2a')][_0x49c4('0x49')]()[_0x49c4('0x3f')](respondWithResult(_0x1550ce,null))[_0x49c4('0x44')](handleError(_0x1550ce,null));}; \ No newline at end of file diff --git a/server/api/memberReport/memberReport.model.js b/server/api/memberReport/memberReport.model.js index 476ca76..a0f4840 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 _0x8caf=['request-promise','path','rimraf','MemberReport','report_member','membername_interface','membername','lodash','util','api','moment','bluebird'];(function(_0x432682,_0x253044){var _0x463d05=function(_0xa73403){while(--_0xa73403){_0x432682['push'](_0x432682['shift']());}};_0x463d05(++_0x253044);}(_0x8caf,0x16f));var _0xf8ca=function(_0x2d2f17,_0x2bd8a9){_0x2d2f17=_0x2d2f17-0x0;var _0x5a49ae=_0x8caf[_0x2d2f17];return _0x5a49ae;};'use strict';var _=require(_0xf8ca('0x0'));var util=require(_0xf8ca('0x1'));var logger=require('../../config/logger')(_0xf8ca('0x2'));var moment=require(_0xf8ca('0x3'));var BPromise=require(_0xf8ca('0x4'));var rp=require(_0xf8ca('0x5'));var fs=require('fs');var path=require(_0xf8ca('0x6'));var rimraf=require(_0xf8ca('0x7'));var config=require('../../config/environment');var attributes=require('./memberReport.attributes');module['exports']=function(_0x5808d5,_0x1ebd7e){return _0x5808d5['define'](_0xf8ca('0x8'),attributes,{'tableName':_0xf8ca('0x9'),'paranoid':![],'indexes':[{'name':_0xf8ca('0xa'),'fields':[_0xf8ca('0xb'),'interface']}],'timestamps':!![]});}; \ No newline at end of file +var _0xbc75=['./memberReport.attributes','define','MemberReport','report_member','interface','lodash','../../config/logger','api','moment','bluebird','rimraf','../../config/environment'];(function(_0x4cc37b,_0x509fe7){var _0x39f25d=function(_0x32e92e){while(--_0x32e92e){_0x4cc37b['push'](_0x4cc37b['shift']());}};_0x39f25d(++_0x509fe7);}(_0xbc75,0xad));var _0x5bc7=function(_0x26d332,_0x4c47ed){_0x26d332=_0x26d332-0x0;var _0x2d4780=_0xbc75[_0x26d332];return _0x2d4780;};'use strict';var _=require(_0x5bc7('0x0'));var util=require('util');var logger=require(_0x5bc7('0x1'))(_0x5bc7('0x2'));var moment=require(_0x5bc7('0x3'));var BPromise=require(_0x5bc7('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0x5bc7('0x5'));var config=require(_0x5bc7('0x6'));var attributes=require(_0x5bc7('0x7'));module['exports']=function(_0x43812f,_0xaa2ea0){return _0x43812f[_0x5bc7('0x8')](_0x5bc7('0x9'),attributes,{'tableName':_0x5bc7('0xa'),'paranoid':![],'indexes':[{'name':'membername_interface','fields':['membername',_0x5bc7('0xb')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/memberReport/memberReport.rpc.js b/server/api/memberReport/memberReport.rpc.js index bc13268..e871e03 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 _0xcfcb=['create','body','UpdateMemberReport','update','where','lodash','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','debug','MemberReport,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','MemberReport,\x20%s,\x20%s','info','result','catch','GetMemberReport','MemberReport','options','raw','attributes','limit','include','map','model','CreateMemberReport'];(function(_0x1d1779,_0x284147){var _0x2377e9=function(_0x299f6f){while(--_0x299f6f){_0x1d1779['push'](_0x1d1779['shift']());}};_0x2377e9(++_0x284147);}(_0xcfcb,0x7a));var _0xbcfc=function(_0x5e4563,_0x3ff918){_0x5e4563=_0x5e4563-0x0;var _0x8d1bf5=_0xcfcb[_0x5e4563];return _0x8d1bf5;};'use strict';var _=require(_0xbcfc('0x0'));var util=require('util');var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0xbcfc('0x1'));var fs=require('fs');var Redis=require(_0xbcfc('0x2'));var db=require(_0xbcfc('0x3'))['db'];var utils=require(_0xbcfc('0x4'));var logger=require(_0xbcfc('0x5'))(_0xbcfc('0x6'));var config=require(_0xbcfc('0x7'));var jayson=require(_0xbcfc('0x8'));var client=jayson[_0xbcfc('0x9')][_0xbcfc('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x4056a8,_0x42052a,_0x2a57ad){return new BPromise(function(_0x349e53,_0x29b308){return client[_0xbcfc('0xb')](_0x4056a8,_0x2a57ad)[_0xbcfc('0xc')](function(_0x47c569){logger['info']('MemberReport,\x20%s,\x20%s',_0x42052a,'request\x20sent');logger[_0xbcfc('0xd')](_0xbcfc('0xe'),_0x42052a,_0xbcfc('0xf'),JSON[_0xbcfc('0x10')](_0x47c569));if(_0x47c569[_0xbcfc('0x11')]){if(_0x47c569[_0xbcfc('0x11')][_0xbcfc('0x12')]===0x1f4){logger['error']('MemberReport,\x20%s,\x20%s',_0x42052a,_0x47c569[_0xbcfc('0x11')][_0xbcfc('0x13')]);return _0x29b308(_0x47c569['error'][_0xbcfc('0x13')]);}logger['error'](_0xbcfc('0x14'),_0x42052a,_0x47c569[_0xbcfc('0x11')]['message']);return _0x349e53(_0x47c569[_0xbcfc('0x11')][_0xbcfc('0x13')]);}else{logger[_0xbcfc('0x15')](_0xbcfc('0x14'),_0x42052a,_0xbcfc('0xf'));_0x349e53(_0x47c569[_0xbcfc('0x16')]['message']);}})[_0xbcfc('0x17')](function(_0x125773){logger['error'](_0xbcfc('0x14'),_0x42052a,_0x125773);_0x29b308(_0x125773);});});}exports[_0xbcfc('0x18')]=function(_0x521978){var _0x5550a6=this;return new Promise(function(_0x15abcf,_0x1f581d){return db[_0xbcfc('0x19')]['findAll']({'raw':_0x521978[_0xbcfc('0x1a')]?_0x521978[_0xbcfc('0x1a')][_0xbcfc('0x1b')]===undefined?!![]:![]:!![],'where':_0x521978[_0xbcfc('0x1a')]?_0x521978[_0xbcfc('0x1a')]['where']||null:null,'attributes':_0x521978[_0xbcfc('0x1a')]?_0x521978[_0xbcfc('0x1a')][_0xbcfc('0x1c')]||null:null,'limit':_0x521978['options']?_0x521978['options'][_0xbcfc('0x1d')]||null:null,'include':_0x521978[_0xbcfc('0x1a')]?_0x521978[_0xbcfc('0x1a')][_0xbcfc('0x1e')]?_[_0xbcfc('0x1f')](_0x521978[_0xbcfc('0x1a')][_0xbcfc('0x1e')],function(_0x52f9c4){return{'model':db[_0x52f9c4[_0xbcfc('0x20')]],'as':_0x52f9c4['as'],'attributes':_0x52f9c4[_0xbcfc('0x1c')],'include':_0x52f9c4['include']?_[_0xbcfc('0x1f')](_0x52f9c4['include'],function(_0x9a013f){return{'model':db[_0x9a013f[_0xbcfc('0x20')]],'as':_0x9a013f['as'],'attributes':_0x9a013f['attributes'],'include':_0x9a013f[_0xbcfc('0x1e')]?_[_0xbcfc('0x1f')](_0x9a013f[_0xbcfc('0x1e')],function(_0x3db2ec){return{'model':db[_0x3db2ec[_0xbcfc('0x20')]],'as':_0x3db2ec['as'],'attributes':_0x3db2ec[_0xbcfc('0x1c')]};}):[]};}):[]};}):[]:[]})['then'](function(_0xcf366e){logger['info'](_0xbcfc('0x18'),_0x521978);logger['debug'](_0xbcfc('0x18'),_0x521978,JSON[_0xbcfc('0x10')](_0xcf366e));_0x15abcf(_0xcf366e);})[_0xbcfc('0x17')](function(_0x2d5219){logger[_0xbcfc('0x11')](_0xbcfc('0x18'),_0x2d5219[_0xbcfc('0x13')],_0x521978);_0x1f581d(_0x5550a6[_0xbcfc('0x11')](0x1f4,_0x2d5219[_0xbcfc('0x13')]));});});};exports[_0xbcfc('0x21')]=function(_0xfc665d){var _0x580ecc=this;return new Promise(function(_0x183cdb,_0x4f1b94){return db[_0xbcfc('0x19')][_0xbcfc('0x22')](_0xfc665d[_0xbcfc('0x23')],{'raw':_0xfc665d[_0xbcfc('0x1a')]?_0xfc665d[_0xbcfc('0x1a')]['raw']===undefined?!![]:![]:!![]})[_0xbcfc('0xc')](function(_0x236637){logger[_0xbcfc('0x15')](_0xbcfc('0x21'),_0xfc665d);logger[_0xbcfc('0xd')]('CreateMemberReport',_0xfc665d,JSON[_0xbcfc('0x10')](_0x236637));_0x183cdb(_0x236637);})[_0xbcfc('0x17')](function(_0x5e57b3){logger[_0xbcfc('0x11')](_0xbcfc('0x21'),_0x5e57b3['message'],_0xfc665d);_0x4f1b94(_0x580ecc['error'](0x1f4,_0x5e57b3[_0xbcfc('0x13')]));});});};exports[_0xbcfc('0x24')]=function(_0x257024){var _0x2cbdac=this;return new Promise(function(_0x18d520,_0xd85c5d){return db[_0xbcfc('0x19')][_0xbcfc('0x25')](_0x257024[_0xbcfc('0x23')],{'raw':_0x257024[_0xbcfc('0x1a')]?_0x257024['options'][_0xbcfc('0x1b')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x257024[_0xbcfc('0x1a')]?_0x257024['options'][_0xbcfc('0x26')]||null:null,'attributes':_0x257024['options']?_0x257024[_0xbcfc('0x1a')][_0xbcfc('0x1c')]||null:null,'limit':_0x257024[_0xbcfc('0x1a')]?_0x257024['options']['limit']||null:null})[_0xbcfc('0xc')](function(_0xfe8fdd){logger[_0xbcfc('0x15')]('UpdateMemberReport',_0x257024);logger[_0xbcfc('0xd')](_0xbcfc('0x24'),_0x257024,JSON['stringify'](_0xfe8fdd));_0x18d520(_0xfe8fdd);})['catch'](function(_0x4c9fb4){logger['error']('UpdateMemberReport',_0x4c9fb4['message'],_0x257024);_0xd85c5d(_0x2cbdac['error'](0x1f4,_0x4c9fb4[_0xbcfc('0x13')]));});});}; \ No newline at end of file +var _0xfa9f=['catch','GetMemberReport','findAll','options','raw','attributes','limit','include','model','map','CreateMemberReport','MemberReport','create','UpdateMemberReport','update','util','moment','bluebird','randomstring','ioredis','../../config/utils','rpc','../../config/environment','client','then','info','MemberReport,\x20%s,\x20%s','request\x20sent','debug','MemberReport,\x20%s,\x20%s,\x20%s','stringify','error','message'];(function(_0x4dbb52,_0x2f240e){var _0x56062b=function(_0x4eaa07){while(--_0x4eaa07){_0x4dbb52['push'](_0x4dbb52['shift']());}};_0x56062b(++_0x2f240e);}(_0xfa9f,0x93));var _0xffa9=function(_0xf34109,_0x380779){_0xf34109=_0xf34109-0x0;var _0x570bfc=_0xfa9f[_0xf34109];return _0x570bfc;};'use strict';var _=require('lodash');var util=require(_0xffa9('0x0'));var moment=require(_0xffa9('0x1'));var BPromise=require(_0xffa9('0x2'));var rs=require(_0xffa9('0x3'));var fs=require('fs');var Redis=require(_0xffa9('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0xffa9('0x5'));var logger=require('../../config/logger')(_0xffa9('0x6'));var config=require(_0xffa9('0x7'));var jayson=require('jayson/promise');var client=jayson[_0xffa9('0x8')]['http']({'port':0x232a});function respondWithRpcPromise(_0x4948c0,_0x1fe01a,_0x1fe931){return new BPromise(function(_0x249501,_0x13c3d0){return client['request'](_0x4948c0,_0x1fe931)[_0xffa9('0x9')](function(_0x1685c7){logger[_0xffa9('0xa')](_0xffa9('0xb'),_0x1fe01a,_0xffa9('0xc'));logger[_0xffa9('0xd')](_0xffa9('0xe'),_0x1fe01a,_0xffa9('0xc'),JSON[_0xffa9('0xf')](_0x1685c7));if(_0x1685c7[_0xffa9('0x10')]){if(_0x1685c7[_0xffa9('0x10')]['code']===0x1f4){logger[_0xffa9('0x10')](_0xffa9('0xb'),_0x1fe01a,_0x1685c7[_0xffa9('0x10')][_0xffa9('0x11')]);return _0x13c3d0(_0x1685c7[_0xffa9('0x10')][_0xffa9('0x11')]);}logger[_0xffa9('0x10')](_0xffa9('0xb'),_0x1fe01a,_0x1685c7[_0xffa9('0x10')][_0xffa9('0x11')]);return _0x249501(_0x1685c7['error'][_0xffa9('0x11')]);}else{logger['info'](_0xffa9('0xb'),_0x1fe01a,_0xffa9('0xc'));_0x249501(_0x1685c7['result'][_0xffa9('0x11')]);}})[_0xffa9('0x12')](function(_0x1ce6c3){logger['error'](_0xffa9('0xb'),_0x1fe01a,_0x1ce6c3);_0x13c3d0(_0x1ce6c3);});});}exports[_0xffa9('0x13')]=function(_0x3cd552){var _0x2e87a8=this;return new Promise(function(_0x4fbe1c,_0x2ee445){return db['MemberReport'][_0xffa9('0x14')]({'raw':_0x3cd552[_0xffa9('0x15')]?_0x3cd552[_0xffa9('0x15')][_0xffa9('0x16')]===undefined?!![]:![]:!![],'where':_0x3cd552[_0xffa9('0x15')]?_0x3cd552[_0xffa9('0x15')]['where']||null:null,'attributes':_0x3cd552[_0xffa9('0x15')]?_0x3cd552[_0xffa9('0x15')][_0xffa9('0x17')]||null:null,'limit':_0x3cd552[_0xffa9('0x15')]?_0x3cd552[_0xffa9('0x15')][_0xffa9('0x18')]||null:null,'include':_0x3cd552[_0xffa9('0x15')]?_0x3cd552[_0xffa9('0x15')][_0xffa9('0x19')]?_['map'](_0x3cd552['options'][_0xffa9('0x19')],function(_0x19655d){return{'model':db[_0x19655d[_0xffa9('0x1a')]],'as':_0x19655d['as'],'attributes':_0x19655d['attributes'],'include':_0x19655d['include']?_[_0xffa9('0x1b')](_0x19655d[_0xffa9('0x19')],function(_0xb22ae3){return{'model':db[_0xb22ae3['model']],'as':_0xb22ae3['as'],'attributes':_0xb22ae3['attributes'],'include':_0xb22ae3[_0xffa9('0x19')]?_['map'](_0xb22ae3[_0xffa9('0x19')],function(_0x2a2ceb){return{'model':db[_0x2a2ceb[_0xffa9('0x1a')]],'as':_0x2a2ceb['as'],'attributes':_0x2a2ceb[_0xffa9('0x17')]};}):[]};}):[]};}):[]:[]})[_0xffa9('0x9')](function(_0x1aa814){logger[_0xffa9('0xa')]('GetMemberReport',_0x3cd552);logger[_0xffa9('0xd')](_0xffa9('0x13'),_0x3cd552,JSON[_0xffa9('0xf')](_0x1aa814));_0x4fbe1c(_0x1aa814);})[_0xffa9('0x12')](function(_0x5ee60d){logger[_0xffa9('0x10')]('GetMemberReport',_0x5ee60d['message'],_0x3cd552);_0x2ee445(_0x2e87a8[_0xffa9('0x10')](0x1f4,_0x5ee60d[_0xffa9('0x11')]));});});};exports[_0xffa9('0x1c')]=function(_0x45a8a4){var _0xd353c4=this;return new Promise(function(_0x1a8703,_0x70cf75){return db[_0xffa9('0x1d')][_0xffa9('0x1e')](_0x45a8a4['body'],{'raw':_0x45a8a4[_0xffa9('0x15')]?_0x45a8a4[_0xffa9('0x15')][_0xffa9('0x16')]===undefined?!![]:![]:!![]})['then'](function(_0x475eba){logger[_0xffa9('0xa')](_0xffa9('0x1c'),_0x45a8a4);logger['debug'](_0xffa9('0x1c'),_0x45a8a4,JSON[_0xffa9('0xf')](_0x475eba));_0x1a8703(_0x475eba);})[_0xffa9('0x12')](function(_0x4c06e5){logger[_0xffa9('0x10')]('CreateMemberReport',_0x4c06e5['message'],_0x45a8a4);_0x70cf75(_0xd353c4[_0xffa9('0x10')](0x1f4,_0x4c06e5['message']));});});};exports[_0xffa9('0x1f')]=function(_0x14b965){var _0x31a325=this;return new Promise(function(_0x35babd,_0x2f7cce){return db['MemberReport'][_0xffa9('0x20')](_0x14b965['body'],{'raw':_0x14b965['options']?_0x14b965[_0xffa9('0x15')]['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x14b965[_0xffa9('0x15')]?_0x14b965[_0xffa9('0x15')]['where']||null:null,'attributes':_0x14b965['options']?_0x14b965[_0xffa9('0x15')]['attributes']||null:null,'limit':_0x14b965[_0xffa9('0x15')]?_0x14b965[_0xffa9('0x15')]['limit']||null:null})['then'](function(_0x4827a6){logger['info'](_0xffa9('0x1f'),_0x14b965);logger[_0xffa9('0xd')](_0xffa9('0x1f'),_0x14b965,JSON['stringify'](_0x4827a6));_0x35babd(_0x4827a6);})[_0xffa9('0x12')](function(_0x3d9cd7){logger[_0xffa9('0x10')](_0xffa9('0x1f'),_0x3d9cd7[_0xffa9('0x11')],_0x14b965);_0x2f7cce(_0x31a325['error'](0x1f4,_0x3d9cd7['message']));});});}; \ No newline at end of file diff --git a/server/api/migration/index.js b/server/api/migration/index.js index df26cd8..95ab4d7 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 _0x6a56=['index','multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','./migration.controller','get'];(function(_0x15c03f,_0x3e201d){var _0x5b9ff1=function(_0x1df280){while(--_0x1df280){_0x15c03f['push'](_0x15c03f['shift']());}};_0x5b9ff1(++_0x3e201d);}(_0x6a56,0x182));var _0x66a5=function(_0x5a95fa,_0x4a2fc9){_0x5a95fa=_0x5a95fa-0x0;var _0x1a61b8=_0x6a56[_0x5a95fa];return _0x1a61b8;};'use strict';var multer=require(_0x66a5('0x0'));var util=require(_0x66a5('0x1'));var path=require(_0x66a5('0x2'));var timeout=require(_0x66a5('0x3'));var express=require(_0x66a5('0x4'));var router=express[_0x66a5('0x5')]();var fs_extra=require('fs-extra');var auth=require(_0x66a5('0x6'));var interaction=require(_0x66a5('0x7'));var config=require('../../config/environment');var controller=require(_0x66a5('0x8'));router[_0x66a5('0x9')]('/',controller[_0x66a5('0xa')]);module['exports']=router; \ No newline at end of file +var _0x09f3=['connect-timeout','express','Router','../../components/auth/service','../../config/environment','./migration.controller','get','index','exports','multer','util','path'];(function(_0x51e58f,_0x1a355f){var _0x3dbe54=function(_0x200443){while(--_0x200443){_0x51e58f['push'](_0x51e58f['shift']());}};_0x3dbe54(++_0x1a355f);}(_0x09f3,0x1c5));var _0x309f=function(_0x310448,_0x59f6bd){_0x310448=_0x310448-0x0;var _0xc0124b=_0x09f3[_0x310448];return _0xc0124b;};'use strict';var multer=require(_0x309f('0x0'));var util=require(_0x309f('0x1'));var path=require(_0x309f('0x2'));var timeout=require(_0x309f('0x3'));var express=require(_0x309f('0x4'));var router=express[_0x309f('0x5')]();var fs_extra=require('fs-extra');var auth=require(_0x309f('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0x309f('0x7'));var controller=require(_0x309f('0x8'));router[_0x309f('0x9')]('/',controller[_0x309f('0xa')]);module[_0x309f('0xb')]=router; \ No newline at end of file diff --git a/server/api/migration/migration.attributes.js b/server/api/migration/migration.attributes.js index 6a45f09..64d7177 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 _0x8da1=['exports','STRING','version'];(function(_0x29696a,_0x29c101){var _0x35d205=function(_0x3bf8b1){while(--_0x3bf8b1){_0x29696a['push'](_0x29696a['shift']());}};_0x35d205(++_0x29c101);}(_0x8da1,0xc9));var _0x18da=function(_0x545150,_0x2c2b6c){_0x545150=_0x545150-0x0;var _0xff7fd6=_0x8da1[_0x545150];return _0xff7fd6;};'use strict';var Sequelize=require('sequelize');module[_0x18da('0x0')]={'version':{'type':Sequelize[_0x18da('0x1')],'unique':_0x18da('0x2')}}; \ No newline at end of file +var _0xb6e2=['version','exports','STRING'];(function(_0x39d451,_0x26d9c8){var _0x5fe6d9=function(_0x15f168){while(--_0x15f168){_0x39d451['push'](_0x39d451['shift']());}};_0x5fe6d9(++_0x26d9c8);}(_0xb6e2,0x142));var _0x2b6e=function(_0x4ac181,_0x564878){_0x4ac181=_0x4ac181-0x0;var _0x52baf5=_0xb6e2[_0x4ac181];return _0x52baf5;};'use strict';var Sequelize=require('sequelize');module[_0x2b6e('0x0')]={'version':{'type':Sequelize[_0x2b6e('0x1')],'unique':_0x2b6e('0x2')}}; \ No newline at end of file diff --git a/server/api/migration/migration.controller.js b/server/api/migration/migration.controller.js index be74ef1..2014eb7 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 _0x4d45=['include','findAll','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','path','sox','ejs','fs-extra','lodash','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','api','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','end','status','offset','undefined','count','limit','set','json','apply','reject','save','update','then','destroy','error','name','send','index','map','Migration','rawAttributes','fieldName','type','model','keys','query','filters','attributes','intersection','fields','length','hasOwnProperty','nolimit','sort','where','pick','merge','filter','options','includeAll'];(function(_0x30f761,_0x5a7c56){var _0x16bbc9=function(_0x4880e4){while(--_0x4880e4){_0x30f761['push'](_0x30f761['shift']());}};_0x16bbc9(++_0x5a7c56);}(_0x4d45,0x19a));var _0x54d4=function(_0x2d7f0e,_0x3e6fbd){_0x2d7f0e=_0x2d7f0e-0x0;var _0x110b07=_0x4d45[_0x2d7f0e];return _0x110b07;};'use strict';var emlformat=require(_0x54d4('0x0'));var rimraf=require(_0x54d4('0x1'));var zipdir=require(_0x54d4('0x2'));var jsonpatch=require(_0x54d4('0x3'));var rp=require('request-promise');var moment=require(_0x54d4('0x4'));var BPromise=require(_0x54d4('0x5'));var Mustache=require(_0x54d4('0x6'));var util=require(_0x54d4('0x7'));var path=require(_0x54d4('0x8'));var sox=require(_0x54d4('0x9'));var csv=require('to-csv');var ejs=require(_0x54d4('0xa'));var fs=require('fs');var fs_extra=require(_0x54d4('0xb'));var _=require(_0x54d4('0xc'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0x54d4('0xd'));var deskjs=require(_0x54d4('0xe'));var toCsv=require(_0x54d4('0xf'));var querystring=require(_0x54d4('0x10'));var Papa=require(_0x54d4('0x11'));var Redis=require(_0x54d4('0x12'));var authService=require(_0x54d4('0x13'));var qs=require('../../components/parsers/qs');var as=require(_0x54d4('0x14'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x54d4('0x15'));var utils=require('../../config/utils');var config=require(_0x54d4('0x16'));var licenseUtil=require(_0x54d4('0x17'));var db=require(_0x54d4('0x18'))['db'];function respondWithStatusCode(_0x9c386d,_0x365ac0){_0x365ac0=_0x365ac0||0xcc;return function(_0x4869a1){if(_0x4869a1){return _0x9c386d[_0x54d4('0x19')](_0x365ac0);}return _0x9c386d['status'](_0x365ac0)[_0x54d4('0x1a')]();};}function respondWithResult(_0x58c54f,_0x1ef214){_0x1ef214=_0x1ef214||0xc8;return function(_0x110a6b){if(_0x110a6b){return _0x58c54f[_0x54d4('0x1b')](_0x1ef214)['json'](_0x110a6b);}};}function respondWithFilteredResult(_0x416c5c,_0x10571f){return function(_0x38fb77){if(_0x38fb77){var _0x25d9e3=typeof _0x10571f[_0x54d4('0x1c')]===_0x54d4('0x1d')&&typeof _0x10571f['limit']===_0x54d4('0x1d');var _0xcf67d2=_0x38fb77[_0x54d4('0x1e')];var _0x21066e=_0x25d9e3?0x0:_0x10571f[_0x54d4('0x1c')];var _0x8e25bc=_0x25d9e3?_0x38fb77[_0x54d4('0x1e')]:_0x10571f['offset']+_0x10571f[_0x54d4('0x1f')];var _0xd784c3;if(_0x8e25bc>=_0xcf67d2){_0x8e25bc=_0xcf67d2;_0xd784c3=0xc8;}else{_0xd784c3=0xce;}_0x416c5c['status'](_0xd784c3);return _0x416c5c[_0x54d4('0x20')]('Content-Range',_0x21066e+'-'+_0x8e25bc+'/'+_0xcf67d2)[_0x54d4('0x21')](_0x38fb77);}return null;};}function patchUpdates(_0x15ab39){return function(_0x2b91a1){try{jsonpatch[_0x54d4('0x22')](_0x2b91a1,_0x15ab39,!![]);}catch(_0x45edff){return BPromise[_0x54d4('0x23')](_0x45edff);}return _0x2b91a1[_0x54d4('0x24')]();};}function saveUpdates(_0x15fa97,_0x2fa838){return function(_0x418f78){if(_0x418f78){return _0x418f78[_0x54d4('0x25')](_0x15fa97)[_0x54d4('0x26')](function(_0x2dd664){return _0x2dd664;});}return null;};}function removeEntity(_0x2048b8,_0x452a02){return function(_0x322304){if(_0x322304){return _0x322304[_0x54d4('0x27')]()[_0x54d4('0x26')](function(){_0x2048b8['status'](0xcc)[_0x54d4('0x1a')]();});}};}function handleEntityNotFound(_0x674563,_0x5e57a0){return function(_0x1eb335){if(!_0x1eb335){_0x674563[_0x54d4('0x19')](0x194);}return _0x1eb335;};}function handleError(_0x43649d,_0x5bdc9e){_0x5bdc9e=_0x5bdc9e||0x1f4;return function(_0x122e9c){logger[_0x54d4('0x28')](_0x122e9c['stack']);if(_0x122e9c['name']){delete _0x122e9c[_0x54d4('0x29')];}_0x43649d['status'](_0x5bdc9e)[_0x54d4('0x2a')](_0x122e9c);};}exports[_0x54d4('0x2b')]=function(_0x12d90b,_0x36df6c){var _0x53592a={},_0x6f6d8e={},_0x3847b6={'count':0x0,'rows':[]};var _0xa351f=_[_0x54d4('0x2c')](db[_0x54d4('0x2d')][_0x54d4('0x2e')],function(_0x1cb3ae){return{'name':_0x1cb3ae[_0x54d4('0x2f')],'type':_0x1cb3ae[_0x54d4('0x30')]['key']};});_0x6f6d8e[_0x54d4('0x31')]=_[_0x54d4('0x2c')](_0xa351f,'name');_0x6f6d8e['query']=_[_0x54d4('0x32')](_0x12d90b[_0x54d4('0x33')]);_0x6f6d8e[_0x54d4('0x34')]=_['intersection'](_0x6f6d8e[_0x54d4('0x31')],_0x6f6d8e[_0x54d4('0x33')]);_0x53592a[_0x54d4('0x35')]=_[_0x54d4('0x36')](_0x6f6d8e['model'],qs[_0x54d4('0x37')](_0x12d90b[_0x54d4('0x33')][_0x54d4('0x37')]));_0x53592a['attributes']=_0x53592a['attributes'][_0x54d4('0x38')]?_0x53592a[_0x54d4('0x35')]:_0x6f6d8e[_0x54d4('0x31')];if(!_0x12d90b[_0x54d4('0x33')][_0x54d4('0x39')](_0x54d4('0x3a'))){_0x53592a[_0x54d4('0x1f')]=qs[_0x54d4('0x1f')](_0x12d90b['query'][_0x54d4('0x1f')]);_0x53592a['offset']=qs[_0x54d4('0x1c')](_0x12d90b[_0x54d4('0x33')][_0x54d4('0x1c')]);}_0x53592a['order']=qs['sort'](_0x12d90b['query'][_0x54d4('0x3b')]);_0x53592a[_0x54d4('0x3c')]=qs['filters'](_[_0x54d4('0x3d')](_0x12d90b[_0x54d4('0x33')],_0x6f6d8e['filters']),_0xa351f);if(_0x12d90b['query']['filter']){_0x53592a[_0x54d4('0x3c')]=_[_0x54d4('0x3e')](_0x53592a[_0x54d4('0x3c')],{'$or':_['map'](_0xa351f,function(_0x6ccce){if(_0x6ccce[_0x54d4('0x30')]!=='VIRTUAL'){var _0x5751c8={};_0x5751c8[_0x6ccce[_0x54d4('0x29')]]={'$like':'%'+_0x12d90b[_0x54d4('0x33')][_0x54d4('0x3f')]+'%'};return _0x5751c8;}})});}_0x53592a=_[_0x54d4('0x3e')]({},_0x53592a,_0x12d90b[_0x54d4('0x40')]);var _0x382374={'where':_0x53592a[_0x54d4('0x3c')]};return db[_0x54d4('0x2d')][_0x54d4('0x1e')](_0x382374)[_0x54d4('0x26')](function(_0x5bfe31){_0x3847b6[_0x54d4('0x1e')]=_0x5bfe31;if(_0x12d90b['query'][_0x54d4('0x41')]){_0x53592a[_0x54d4('0x42')]=[{'all':!![]}];}return db['Migration'][_0x54d4('0x43')](_0x53592a);})[_0x54d4('0x26')](function(_0x59a4a6){_0x3847b6['rows']=_0x59a4a6;return _0x3847b6;})[_0x54d4('0x26')](respondWithFilteredResult(_0x36df6c,_0x53592a))['catch'](handleError(_0x36df6c,null));}; \ No newline at end of file +var _0x2430=['options','includeAll','include','findAll','rows','catch','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','sox','fs-extra','lodash','squel','crypto','jsforce','querystring','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','Content-Range','apply','reject','save','then','destroy','stack','name','send','map','Migration','rawAttributes','fieldName','type','query','keys','filters','intersection','model','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL'];(function(_0x928a02,_0x2257cd){var _0x30705c=function(_0x5879a1){while(--_0x5879a1){_0x928a02['push'](_0x928a02['shift']());}};_0x30705c(++_0x2257cd);}(_0x2430,0x155));var _0x0243=function(_0x432682,_0x253044){_0x432682=_0x432682-0x0;var _0x463d05=_0x2430[_0x432682];return _0x463d05;};'use strict';var emlformat=require(_0x0243('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x0243('0x1'));var jsonpatch=require(_0x0243('0x2'));var rp=require(_0x0243('0x3'));var moment=require(_0x0243('0x4'));var BPromise=require(_0x0243('0x5'));var Mustache=require('mustache');var util=require(_0x0243('0x6'));var path=require('path');var sox=require(_0x0243('0x7'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x0243('0x8'));var _=require(_0x0243('0x9'));var squel=require(_0x0243('0xa'));var crypto=require(_0x0243('0xb'));var jsforce=require(_0x0243('0xc'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0x0243('0xd'));var Papa=require('papaparse');var Redis=require(_0x0243('0xe'));var authService=require('../../components/auth/service');var qs=require(_0x0243('0xf'));var as=require(_0x0243('0x10'));var hardwareService=require(_0x0243('0x11'));var logger=require(_0x0243('0x12'))('api');var utils=require(_0x0243('0x13'));var config=require('../../config/environment');var licenseUtil=require(_0x0243('0x14'));var db=require(_0x0243('0x15'))['db'];function respondWithStatusCode(_0x46b1aa,_0x51de23){_0x51de23=_0x51de23||0xcc;return function(_0x53ad54){if(_0x53ad54){return _0x46b1aa[_0x0243('0x16')](_0x51de23);}return _0x46b1aa[_0x0243('0x17')](_0x51de23)[_0x0243('0x18')]();};}function respondWithResult(_0x524a3c,_0x3d0197){_0x3d0197=_0x3d0197||0xc8;return function(_0x5d05cb){if(_0x5d05cb){return _0x524a3c['status'](_0x3d0197)[_0x0243('0x19')](_0x5d05cb);}};}function respondWithFilteredResult(_0x14119e,_0x4421ce){return function(_0x39ca07){if(_0x39ca07){var _0x13696e=typeof _0x4421ce[_0x0243('0x1a')]===_0x0243('0x1b')&&typeof _0x4421ce[_0x0243('0x1c')]===_0x0243('0x1b');var _0x544298=_0x39ca07[_0x0243('0x1d')];var _0x5636ea=_0x13696e?0x0:_0x4421ce[_0x0243('0x1a')];var _0x40ccb4=_0x13696e?_0x39ca07[_0x0243('0x1d')]:_0x4421ce[_0x0243('0x1a')]+_0x4421ce[_0x0243('0x1c')];var _0x31c237;if(_0x40ccb4>=_0x544298){_0x40ccb4=_0x544298;_0x31c237=0xc8;}else{_0x31c237=0xce;}_0x14119e[_0x0243('0x17')](_0x31c237);return _0x14119e['set'](_0x0243('0x1e'),_0x5636ea+'-'+_0x40ccb4+'/'+_0x544298)[_0x0243('0x19')](_0x39ca07);}return null;};}function patchUpdates(_0x4c4d8f){return function(_0x191bb3){try{jsonpatch[_0x0243('0x1f')](_0x191bb3,_0x4c4d8f,!![]);}catch(_0x3efbfb){return BPromise[_0x0243('0x20')](_0x3efbfb);}return _0x191bb3[_0x0243('0x21')]();};}function saveUpdates(_0x1f090a,_0x4edaa0){return function(_0x11f393){if(_0x11f393){return _0x11f393['update'](_0x1f090a)[_0x0243('0x22')](function(_0x15e528){return _0x15e528;});}return null;};}function removeEntity(_0x2040c7,_0x49706e){return function(_0x4eac34){if(_0x4eac34){return _0x4eac34[_0x0243('0x23')]()[_0x0243('0x22')](function(){_0x2040c7[_0x0243('0x17')](0xcc)[_0x0243('0x18')]();});}};}function handleEntityNotFound(_0x519bdc,_0x35c190){return function(_0x41d1d3){if(!_0x41d1d3){_0x519bdc[_0x0243('0x16')](0x194);}return _0x41d1d3;};}function handleError(_0x471b85,_0x13b31b){_0x13b31b=_0x13b31b||0x1f4;return function(_0x33cf0b){logger['error'](_0x33cf0b[_0x0243('0x24')]);if(_0x33cf0b[_0x0243('0x25')]){delete _0x33cf0b['name'];}_0x471b85[_0x0243('0x17')](_0x13b31b)[_0x0243('0x26')](_0x33cf0b);};}exports['index']=function(_0x4c80a2,_0x3f3afd){var _0x562fdd={},_0x56db92={},_0x17ca5d={'count':0x0,'rows':[]};var _0x3e04de=_[_0x0243('0x27')](db[_0x0243('0x28')][_0x0243('0x29')],function(_0x211bc4){return{'name':_0x211bc4[_0x0243('0x2a')],'type':_0x211bc4[_0x0243('0x2b')]['key']};});_0x56db92['model']=_[_0x0243('0x27')](_0x3e04de,_0x0243('0x25'));_0x56db92[_0x0243('0x2c')]=_[_0x0243('0x2d')](_0x4c80a2['query']);_0x56db92[_0x0243('0x2e')]=_[_0x0243('0x2f')](_0x56db92[_0x0243('0x30')],_0x56db92[_0x0243('0x2c')]);_0x562fdd['attributes']=_[_0x0243('0x2f')](_0x56db92[_0x0243('0x30')],qs[_0x0243('0x31')](_0x4c80a2[_0x0243('0x2c')][_0x0243('0x31')]));_0x562fdd[_0x0243('0x32')]=_0x562fdd['attributes'][_0x0243('0x33')]?_0x562fdd['attributes']:_0x56db92[_0x0243('0x30')];if(!_0x4c80a2['query'][_0x0243('0x34')](_0x0243('0x35'))){_0x562fdd[_0x0243('0x1c')]=qs['limit'](_0x4c80a2[_0x0243('0x2c')][_0x0243('0x1c')]);_0x562fdd[_0x0243('0x1a')]=qs[_0x0243('0x1a')](_0x4c80a2[_0x0243('0x2c')]['offset']);}_0x562fdd[_0x0243('0x36')]=qs['sort'](_0x4c80a2[_0x0243('0x2c')][_0x0243('0x37')]);_0x562fdd[_0x0243('0x38')]=qs[_0x0243('0x2e')](_[_0x0243('0x39')](_0x4c80a2[_0x0243('0x2c')],_0x56db92['filters']),_0x3e04de);if(_0x4c80a2[_0x0243('0x2c')][_0x0243('0x3a')]){_0x562fdd[_0x0243('0x38')]=_[_0x0243('0x3b')](_0x562fdd[_0x0243('0x38')],{'$or':_['map'](_0x3e04de,function(_0x34d65b){if(_0x34d65b[_0x0243('0x2b')]!==_0x0243('0x3c')){var _0x58506e={};_0x58506e[_0x34d65b[_0x0243('0x25')]]={'$like':'%'+_0x4c80a2['query'][_0x0243('0x3a')]+'%'};return _0x58506e;}})});}_0x562fdd=_[_0x0243('0x3b')]({},_0x562fdd,_0x4c80a2[_0x0243('0x3d')]);var _0x3d39b3={'where':_0x562fdd[_0x0243('0x38')]};return db[_0x0243('0x28')][_0x0243('0x1d')](_0x3d39b3)['then'](function(_0x5653b6){_0x17ca5d['count']=_0x5653b6;if(_0x4c80a2['query'][_0x0243('0x3e')]){_0x562fdd[_0x0243('0x3f')]=[{'all':!![]}];}return db[_0x0243('0x28')][_0x0243('0x40')](_0x562fdd);})['then'](function(_0x32a6de){_0x17ca5d[_0x0243('0x41')]=_0x32a6de;return _0x17ca5d;})[_0x0243('0x22')](respondWithFilteredResult(_0x3f3afd,_0x562fdd))[_0x0243('0x42')](handleError(_0x3f3afd,null));}; \ No newline at end of file diff --git a/server/api/migration/migration.model.js b/server/api/migration/migration.model.js index e86dcab..9d0f892 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 _0x9730=['bluebird','request-promise','path','rimraf','../../config/environment','./migration.attributes','Migration','migrations','../../config/logger'];(function(_0x2fbb8c,_0x15bc93){var _0x1005b4=function(_0x1a3f97){while(--_0x1a3f97){_0x2fbb8c['push'](_0x2fbb8c['shift']());}};_0x1005b4(++_0x15bc93);}(_0x9730,0x179));var _0x0973=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0x9730[_0x321bb2];return _0x9c12ed;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x0973('0x0'))('api');var moment=require('moment');var BPromise=require(_0x0973('0x1'));var rp=require(_0x0973('0x2'));var fs=require('fs');var path=require(_0x0973('0x3'));var rimraf=require(_0x0973('0x4'));var config=require(_0x0973('0x5'));var attributes=require(_0x0973('0x6'));module['exports']=function(_0x2d1b15,_0x2615b9){return _0x2d1b15['define'](_0x0973('0x7'),attributes,{'tableName':_0x0973('0x8'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x8b2b=['../../config/environment','exports','define','lodash','util','../../config/logger','moment','bluebird','request-promise','path','rimraf'];(function(_0x5c14f6,_0x2979d8){var _0x4949b3=function(_0xcc4206){while(--_0xcc4206){_0x5c14f6['push'](_0x5c14f6['shift']());}};_0x4949b3(++_0x2979d8);}(_0x8b2b,0x7c));var _0xb8b2=function(_0x5bd126,_0x488c54){_0x5bd126=_0x5bd126-0x0;var _0x4d40b1=_0x8b2b[_0x5bd126];return _0x4d40b1;};'use strict';var _=require(_0xb8b2('0x0'));var util=require(_0xb8b2('0x1'));var logger=require(_0xb8b2('0x2'))('api');var moment=require(_0xb8b2('0x3'));var BPromise=require(_0xb8b2('0x4'));var rp=require(_0xb8b2('0x5'));var fs=require('fs');var path=require(_0xb8b2('0x6'));var rimraf=require(_0xb8b2('0x7'));var config=require(_0xb8b2('0x8'));var attributes=require('./migration.attributes');module[_0xb8b2('0x9')]=function(_0x451557,_0x14c4a4){return _0x451557[_0xb8b2('0xa')]('Migration',attributes,{'tableName':'migrations','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/migration/migration.rpc.js b/server/api/migration/migration.rpc.js index fb7e59b..ea48d60 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 _0x97f5=['code','message','result','catch','lodash','util','moment','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','Migration,\x20%s,\x20%s','request\x20sent','error'];(function(_0x4e8792,_0x57650d){var _0x40eb4e=function(_0x94d30e){while(--_0x94d30e){_0x4e8792['push'](_0x4e8792['shift']());}};_0x40eb4e(++_0x57650d);}(_0x97f5,0x72));var _0x597f=function(_0x573e12,_0x474369){_0x573e12=_0x573e12-0x0;var _0xf362c6=_0x97f5[_0x573e12];return _0xf362c6;};'use strict';var _=require(_0x597f('0x0'));var util=require(_0x597f('0x1'));var moment=require(_0x597f('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x597f('0x3'));var db=require(_0x597f('0x4'))['db'];var utils=require(_0x597f('0x5'));var logger=require(_0x597f('0x6'))(_0x597f('0x7'));var config=require(_0x597f('0x8'));var jayson=require(_0x597f('0x9'));var client=jayson[_0x597f('0xa')][_0x597f('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x5f4eb9,_0x22b5d0,_0x20f0fc){return new BPromise(function(_0x1098e6,_0x40b1cd){return client[_0x597f('0xc')](_0x5f4eb9,_0x20f0fc)[_0x597f('0xd')](function(_0x5b293a){logger[_0x597f('0xe')](_0x597f('0xf'),_0x22b5d0,_0x597f('0x10'));logger['debug']('Migration,\x20%s,\x20%s,\x20%s',_0x22b5d0,_0x597f('0x10'),JSON['stringify'](_0x5b293a));if(_0x5b293a[_0x597f('0x11')]){if(_0x5b293a[_0x597f('0x11')][_0x597f('0x12')]===0x1f4){logger['error'](_0x597f('0xf'),_0x22b5d0,_0x5b293a[_0x597f('0x11')][_0x597f('0x13')]);return _0x40b1cd(_0x5b293a[_0x597f('0x11')][_0x597f('0x13')]);}logger[_0x597f('0x11')](_0x597f('0xf'),_0x22b5d0,_0x5b293a[_0x597f('0x11')][_0x597f('0x13')]);return _0x1098e6(_0x5b293a[_0x597f('0x11')][_0x597f('0x13')]);}else{logger[_0x597f('0xe')](_0x597f('0xf'),_0x22b5d0,'request\x20sent');_0x1098e6(_0x5b293a[_0x597f('0x14')][_0x597f('0x13')]);}})[_0x597f('0x15')](function(_0x55eed9){logger[_0x597f('0x11')]('Migration,\x20%s,\x20%s',_0x22b5d0,_0x55eed9);_0x40b1cd(_0x55eed9);});});} \ No newline at end of file +var _0xc125=['util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','Migration,\x20%s,\x20%s','request\x20sent','debug','Migration,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0xc125,0x150));var _0x5c12=function(_0x22936b,_0x46ad51){_0x22936b=_0x22936b-0x0;var _0x56276a=_0xc125[_0x22936b];return _0x56276a;};'use strict';var _=require('lodash');var util=require(_0x5c12('0x0'));var moment=require('moment');var BPromise=require(_0x5c12('0x1'));var rs=require(_0x5c12('0x2'));var fs=require('fs');var Redis=require(_0x5c12('0x3'));var db=require(_0x5c12('0x4'))['db'];var utils=require(_0x5c12('0x5'));var logger=require(_0x5c12('0x6'))(_0x5c12('0x7'));var config=require(_0x5c12('0x8'));var jayson=require(_0x5c12('0x9'));var client=jayson[_0x5c12('0xa')][_0x5c12('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x11ace0,_0x4cab65,_0x1d0635){return new BPromise(function(_0x4465e3,_0x52a111){return client[_0x5c12('0xc')](_0x11ace0,_0x1d0635)[_0x5c12('0xd')](function(_0x3f7347){logger[_0x5c12('0xe')](_0x5c12('0xf'),_0x4cab65,_0x5c12('0x10'));logger[_0x5c12('0x11')](_0x5c12('0x12'),_0x4cab65,'request\x20sent',JSON[_0x5c12('0x13')](_0x3f7347));if(_0x3f7347[_0x5c12('0x14')]){if(_0x3f7347[_0x5c12('0x14')][_0x5c12('0x15')]===0x1f4){logger[_0x5c12('0x14')]('Migration,\x20%s,\x20%s',_0x4cab65,_0x3f7347['error'][_0x5c12('0x16')]);return _0x52a111(_0x3f7347['error'][_0x5c12('0x16')]);}logger[_0x5c12('0x14')](_0x5c12('0xf'),_0x4cab65,_0x3f7347['error']['message']);return _0x4465e3(_0x3f7347[_0x5c12('0x14')][_0x5c12('0x16')]);}else{logger['info'](_0x5c12('0xf'),_0x4cab65,_0x5c12('0x10'));_0x4465e3(_0x3f7347[_0x5c12('0x17')]['message']);}})['catch'](function(_0x1d6487){logger[_0x5c12('0x14')](_0x5c12('0xf'),_0x4cab65,_0x1d6487);_0x52a111(_0x1d6487);});});} \ No newline at end of file diff --git a/server/api/network/index.js b/server/api/network/index.js index 4c5f253..e49989b 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 _0x3157=['../../components/interaction/service','get','isAuthenticated','index','/:id','post','create','put','update','delete','destroy','exports','multer','util','path','connect-timeout','Router','../../components/auth/service'];(function(_0x552e59,_0x5c4591){var _0x5e15ad=function(_0x1af238){while(--_0x1af238){_0x552e59['push'](_0x552e59['shift']());}};_0x5e15ad(++_0x5c4591);}(_0x3157,0x198));var _0x7315=function(_0x1aa3f2,_0x46c393){_0x1aa3f2=_0x1aa3f2-0x0;var _0x71bc9e=_0x3157[_0x1aa3f2];return _0x71bc9e;};'use strict';var multer=require(_0x7315('0x0'));var util=require(_0x7315('0x1'));var path=require(_0x7315('0x2'));var timeout=require(_0x7315('0x3'));var express=require('express');var router=express[_0x7315('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0x7315('0x5'));var interaction=require(_0x7315('0x6'));var config=require('../../config/environment');var controller=require('./network.controller');router[_0x7315('0x7')]('/',auth[_0x7315('0x8')](),controller[_0x7315('0x9')]);router['get'](_0x7315('0xa'),auth[_0x7315('0x8')](),controller['show']);router[_0x7315('0xb')]('/',auth[_0x7315('0x8')](),controller[_0x7315('0xc')]);router[_0x7315('0xd')]('/:id',auth[_0x7315('0x8')](),controller[_0x7315('0xe')]);router[_0x7315('0xf')](_0x7315('0xa'),auth['isAuthenticated'](),controller[_0x7315('0x10')]);module[_0x7315('0x11')]=router; \ No newline at end of file +var _0x4f00=['update','delete','destroy','exports','multer','util','path','connect-timeout','express','fs-extra','../../components/auth/service','./network.controller','isAuthenticated','index','/:id','post','create','put'];(function(_0x576e0f,_0x3da50b){var _0x2f78dc=function(_0x2d7e85){while(--_0x2d7e85){_0x576e0f['push'](_0x576e0f['shift']());}};_0x2f78dc(++_0x3da50b);}(_0x4f00,0x1ea));var _0x04f0=function(_0x6c993a,_0x5ea3ab){_0x6c993a=_0x6c993a-0x0;var _0x27f547=_0x4f00[_0x6c993a];return _0x27f547;};'use strict';var multer=require(_0x04f0('0x0'));var util=require(_0x04f0('0x1'));var path=require(_0x04f0('0x2'));var timeout=require(_0x04f0('0x3'));var express=require(_0x04f0('0x4'));var router=express['Router']();var fs_extra=require(_0x04f0('0x5'));var auth=require(_0x04f0('0x6'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0x04f0('0x7'));router['get']('/',auth[_0x04f0('0x8')](),controller[_0x04f0('0x9')]);router['get'](_0x04f0('0xa'),auth[_0x04f0('0x8')](),controller['show']);router[_0x04f0('0xb')]('/',auth['isAuthenticated'](),controller[_0x04f0('0xc')]);router[_0x04f0('0xd')](_0x04f0('0xa'),auth[_0x04f0('0x8')](),controller[_0x04f0('0xe')]);router[_0x04f0('0xf')](_0x04f0('0xa'),auth['isAuthenticated'](),controller[_0x04f0('0x10')]);module[_0x04f0('0x11')]=router; \ No newline at end of file diff --git a/server/api/network/network.attributes.js b/server/api/network/network.attributes.js index 6f25043..40b791c 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 _0x6b56=['ENUM','localnet','stun','turn','STRING','exports'];(function(_0x17c8cc,_0x5e5647){var _0x3db4eb=function(_0x2082db){while(--_0x2082db){_0x17c8cc['push'](_0x17c8cc['shift']());}};_0x3db4eb(++_0x5e5647);}(_0x6b56,0x149));var _0x66b5=function(_0x9d9558,_0x35c6fc){_0x9d9558=_0x9d9558-0x0;var _0x3f2690=_0x6b56[_0x9d9558];return _0x3f2690;};'use strict';var Sequelize=require('sequelize');module[_0x66b5('0x0')]={'type':{'type':Sequelize[_0x66b5('0x1')](_0x66b5('0x2'),'externip',_0x66b5('0x3'),_0x66b5('0x4'))},'value':{'type':Sequelize[_0x66b5('0x5')]},'username':{'type':Sequelize[_0x66b5('0x5')]},'password':{'type':Sequelize[_0x66b5('0x5')]}}; \ No newline at end of file +var _0xef34=['stun','turn','STRING','sequelize','exports','ENUM','localnet','externip'];(function(_0x2ad008,_0x45c253){var _0x4538cf=function(_0xe143e4){while(--_0xe143e4){_0x2ad008['push'](_0x2ad008['shift']());}};_0x4538cf(++_0x45c253);}(_0xef34,0x1f3));var _0x4ef3=function(_0x5d74b5,_0x140062){_0x5d74b5=_0x5d74b5-0x0;var _0x11429b=_0xef34[_0x5d74b5];return _0x11429b;};'use strict';var Sequelize=require(_0x4ef3('0x0'));module[_0x4ef3('0x1')]={'type':{'type':Sequelize[_0x4ef3('0x2')](_0x4ef3('0x3'),_0x4ef3('0x4'),_0x4ef3('0x5'),_0x4ef3('0x6'))},'value':{'type':Sequelize['STRING']},'username':{'type':Sequelize[_0x4ef3('0x7')]},'password':{'type':Sequelize[_0x4ef3('0x7')]}}; \ No newline at end of file diff --git a/server/api/network/network.controller.js b/server/api/network/network.controller.js index 6f92f39..a3bb3fe 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 _0x799e=['Network,\x20%s,\x20%s','message','result','catch','status','json','offset','undefined','limit','count','update','destroy','sendStatus','stack','name','send','index','map','rawAttributes','fieldName','type','key','model','query','attributes','intersection','fields','length','hasOwnProperty','nolimit','order','pick','filters','filter','where','VIRTUAL','merge','Network','includeAll','include','show','params','keys','options','body','toUpperCase','readFileSync','server/files/templates/stun_multiple.ejs','utf8','render','writeFileSync','/etc/asterisk/stun_xcally.conf','Reload','create','TURN','root','/etc/asterisk/turn_xcally.conf','res_stun_monitor.so','join','server/files/templates/network.ejs','format','/etc/asterisk/sip_xcally_%s.conf','toLowerCase','find','findAll','server/files/templates/turn_multiple.ejs','chan_sip.so','path','ejs','../../components/parsers/qs','../../config/logger','api','../../mysqldb','jayson/promise','client','then','info','request\x20sent','debug','Network,\x20%s,\x20%s,\x20%s','stringify','error'];(function(_0x1ccbcc,_0x5c948b){var _0x1e873f=function(_0x4f232e){while(--_0x4f232e){_0x1ccbcc['push'](_0x1ccbcc['shift']());}};_0x1e873f(++_0x5c948b);}(_0x799e,0x18b));var _0xe799=function(_0x3b6388,_0x4d787e){_0x3b6388=_0x3b6388-0x0;var _0x445216=_0x799e[_0x3b6388];return _0x445216;};'use strict';var util=require('util');var path=require(_0xe799('0x0'));var ejs=require(_0xe799('0x1'));var fs=require('fs');var _=require('lodash');var qs=require(_0xe799('0x2'));var logger=require(_0xe799('0x3'))(_0xe799('0x4'));var config=require('../../config/environment');var db=require(_0xe799('0x5'))['db'];var jayson=require(_0xe799('0x6'));var client=jayson[_0xe799('0x7')]['http']({'port':0x232a});function respondWithRpcPromise(_0x25f747,_0x105482,_0x2312a9,_0x4e26b0){return new Promise(function(_0x127cf3,_0x151722){var _0xd4b0b8=_0x4e26b0||client;return _0xd4b0b8['request'](_0x25f747,_0x2312a9)[_0xe799('0x8')](function(_0x5379a0){logger[_0xe799('0x9')]('Network,\x20%s,\x20%s',_0x105482,_0xe799('0xa'));logger[_0xe799('0xb')](_0xe799('0xc'),_0x105482,'request\x20sent',JSON[_0xe799('0xd')](_0x5379a0));if(_0x5379a0[_0xe799('0xe')]){if(_0x5379a0[_0xe799('0xe')]['code']===0x1f4){logger[_0xe799('0xe')](_0xe799('0xf'),_0x105482,_0x5379a0[_0xe799('0xe')][_0xe799('0x10')]);return _0x151722(_0x5379a0[_0xe799('0xe')]['message']);}logger[_0xe799('0xe')](_0xe799('0xf'),_0x105482,_0x5379a0['error'][_0xe799('0x10')]);return _0x127cf3(_0x5379a0['error'][_0xe799('0x10')]);}else{logger[_0xe799('0x9')](_0xe799('0xf'),_0x105482,_0xe799('0xa'));_0x127cf3(_0x5379a0[_0xe799('0x11')][_0xe799('0x10')]);}})[_0xe799('0x12')](function(_0x3ff8b7){logger[_0xe799('0xe')](_0xe799('0xf'),_0x105482,_0x3ff8b7);_0x151722(_0x3ff8b7);});});}function respondWithResult(_0x289641,_0x2fdffb){_0x2fdffb=_0x2fdffb||0xc8;return function(_0x3729d6){if(_0x3729d6){return _0x289641[_0xe799('0x13')](_0x2fdffb)[_0xe799('0x14')](_0x3729d6);}};}function respondWithFilteredResult(_0x10def2,_0x4bc910){return function(_0x34ddb8){if(_0x34ddb8){var _0x328794=typeof _0x4bc910[_0xe799('0x15')]===_0xe799('0x16')&&typeof _0x4bc910[_0xe799('0x17')]==='undefined';var _0x27c4cf=_0x34ddb8[_0xe799('0x18')];var _0x2c05bb=_0x328794?0x0:_0x4bc910[_0xe799('0x15')];var _0x1677dc=_0x328794?_0x34ddb8[_0xe799('0x18')]:_0x4bc910[_0xe799('0x15')]+_0x4bc910[_0xe799('0x17')];var _0x2f3ebf;if(_0x1677dc>=_0x27c4cf){_0x1677dc=_0x27c4cf;_0x2f3ebf=0xc8;}else{_0x2f3ebf=0xce;}_0x10def2['status'](_0x2f3ebf);return _0x10def2['set']('Content-Range',_0x2c05bb+'-'+_0x1677dc+'/'+_0x27c4cf)[_0xe799('0x14')](_0x34ddb8);}return null;};}function saveUpdates(_0x5074fd){return function(_0x325ee1){if(_0x325ee1){return _0x325ee1[_0xe799('0x19')](_0x5074fd)[_0xe799('0x8')](function(_0x5f454b){return _0x5f454b;});}return null;};}function removeEntity(_0x5d2d9d){return function(_0x3de31e){if(_0x3de31e){return _0x3de31e[_0xe799('0x1a')]()['then'](function(){_0x5d2d9d[_0xe799('0x13')](0xcc)['end']();});}};}function handleEntityNotFound(_0x1fa3c3){return function(_0x47a33d){if(!_0x47a33d){_0x1fa3c3[_0xe799('0x1b')](0x194);}return _0x47a33d;};}function handleError(_0x157419,_0x2668c4){_0x2668c4=_0x2668c4||0x1f4;return function(_0x34d255){logger[_0xe799('0xe')](_0x34d255[_0xe799('0x1c')]);if(_0x34d255[_0xe799('0x1d')]){delete _0x34d255[_0xe799('0x1d')];}_0x157419[_0xe799('0x13')](_0x2668c4)[_0xe799('0x1e')](_0x34d255);};}exports[_0xe799('0x1f')]=function(_0x247cec,_0x907b65){var _0x50414d={},_0x49b7e6={},_0x143c42={'count':0x0,'rows':[]};var _0x77c3aa=_[_0xe799('0x20')](db['Network'][_0xe799('0x21')],function(_0x2bffff){return{'name':_0x2bffff[_0xe799('0x22')],'type':_0x2bffff[_0xe799('0x23')][_0xe799('0x24')]};});_0x49b7e6[_0xe799('0x25')]=_[_0xe799('0x20')](_0x77c3aa,_0xe799('0x1d'));_0x49b7e6[_0xe799('0x26')]=_['keys'](_0x247cec['query']);_0x49b7e6['filters']=_['intersection'](_0x49b7e6[_0xe799('0x25')],_0x49b7e6[_0xe799('0x26')]);_0x50414d[_0xe799('0x27')]=_[_0xe799('0x28')](_0x49b7e6[_0xe799('0x25')],qs[_0xe799('0x29')](_0x247cec[_0xe799('0x26')]['fields']));_0x50414d[_0xe799('0x27')]=_0x50414d['attributes'][_0xe799('0x2a')]?_0x50414d[_0xe799('0x27')]:_0x49b7e6[_0xe799('0x25')];if(!_0x247cec[_0xe799('0x26')][_0xe799('0x2b')](_0xe799('0x2c'))){_0x50414d[_0xe799('0x17')]=qs['limit'](_0x247cec['query']['limit']);_0x50414d[_0xe799('0x15')]=qs[_0xe799('0x15')](_0x247cec['query'][_0xe799('0x15')]);}_0x50414d[_0xe799('0x2d')]=qs['sort'](_0x247cec['query']['sort']);_0x50414d['where']=qs['filters'](_[_0xe799('0x2e')](_0x247cec[_0xe799('0x26')],_0x49b7e6[_0xe799('0x2f')]),_0x77c3aa);if(_0x247cec['query'][_0xe799('0x30')]){_0x50414d['where']=_['merge'](_0x50414d[_0xe799('0x31')],{'$or':_['map'](_0x77c3aa,function(_0x5372fc){if(_0x5372fc['type']!==_0xe799('0x32')){var _0x52e670={};_0x52e670[_0x5372fc[_0xe799('0x1d')]]={'$like':'%'+_0x247cec[_0xe799('0x26')][_0xe799('0x30')]+'%'};return _0x52e670;}})});}_0x50414d=_[_0xe799('0x33')]({},_0x50414d,_0x247cec['options']);var _0x43f182={'where':_0x50414d[_0xe799('0x31')]};return db[_0xe799('0x34')][_0xe799('0x18')](_0x43f182)['then'](function(_0x678087){_0x143c42[_0xe799('0x18')]=_0x678087;if(_0x247cec['query'][_0xe799('0x35')]){_0x50414d[_0xe799('0x36')]=[{'all':!![]}];}return db[_0xe799('0x34')]['findAll'](_0x50414d);})[_0xe799('0x8')](function(_0x162693){_0x143c42['rows']=_0x162693;return _0x143c42;})[_0xe799('0x8')](respondWithFilteredResult(_0x907b65,_0x50414d))[_0xe799('0x12')](handleError(_0x907b65,null));};exports[_0xe799('0x37')]=function(_0xe69ccc,_0x353f65){var _0x3921e1={'raw':!![],'where':{'id':_0xe69ccc[_0xe799('0x38')]['id']}},_0x2a2fd3={};_0x2a2fd3[_0xe799('0x25')]=_[_0xe799('0x39')](db['Network']['rawAttributes']);_0x2a2fd3[_0xe799('0x26')]=_[_0xe799('0x39')](_0xe69ccc[_0xe799('0x26')]);_0x2a2fd3[_0xe799('0x2f')]=_[_0xe799('0x28')](_0x2a2fd3[_0xe799('0x25')],_0x2a2fd3[_0xe799('0x26')]);_0x3921e1[_0xe799('0x27')]=_[_0xe799('0x28')](_0x2a2fd3[_0xe799('0x25')],qs['fields'](_0xe69ccc[_0xe799('0x26')][_0xe799('0x29')]));_0x3921e1['attributes']=_0x3921e1[_0xe799('0x27')][_0xe799('0x2a')]?_0x3921e1[_0xe799('0x27')]:_0x2a2fd3[_0xe799('0x25')];if(_0xe69ccc['query']['includeAll']){_0x3921e1['include']=[{'all':!![]}];}_0x3921e1=_[_0xe799('0x33')]({},_0x3921e1,_0xe69ccc[_0xe799('0x3a')]);return db['Network']['find'](_0x3921e1)[_0xe799('0x8')](handleEntityNotFound(_0x353f65,null))[_0xe799('0x8')](respondWithResult(_0x353f65,null))[_0xe799('0x12')](handleError(_0x353f65,null));};exports['create']=function(_0x27b1cd,_0x57a96d){var _0x5d453f;return db[_0xe799('0x34')]['create'](_0x27b1cd[_0xe799('0x3b')],{'raw':!![]})[_0xe799('0x8')](function(_0x5b0909){_0x5d453f=_0x5b0909;return db[_0xe799('0x34')]['findAll']({'where':{'type':_0x27b1cd['body'][_0xe799('0x23')]},'raw':!![]});})['then'](function(_0x351900){if(_0x5d453f[_0xe799('0x23')][_0xe799('0x3c')]()=='STUN'){var _0x13bea3=fs[_0xe799('0x3d')](path['join'](config['root'],_0xe799('0x3e')),_0xe799('0x3f'));var _0x58abf9=ejs[_0xe799('0x40')](_0x13bea3,{'networks':_0x351900||[]});fs[_0xe799('0x41')](_0xe799('0x42'),_0x58abf9);return respondWithRpcPromise(_0xe799('0x43'),_0xe799('0x44'),{'module':'res_stun_monitor.so'});}else if(_0x5d453f[_0xe799('0x23')][_0xe799('0x3c')]()==_0xe799('0x45')){var _0x1fa792=fs[_0xe799('0x3d')](path['join'](config[_0xe799('0x46')],'server/files/templates/turn_multiple.ejs'),_0xe799('0x3f'));var _0x576d6d=ejs[_0xe799('0x40')](_0x1fa792,{'networks':_0x351900||[]});fs[_0xe799('0x41')](_0xe799('0x47'),_0x576d6d);return respondWithRpcPromise(_0xe799('0x43'),_0xe799('0x44'),{'module':_0xe799('0x48')});}else{var _0x11fbb0=fs[_0xe799('0x3d')](path[_0xe799('0x49')](config[_0xe799('0x46')],_0xe799('0x4a')),_0xe799('0x3f'));var _0x32d4f7=ejs['render'](_0x11fbb0,{'networks':_0x351900||[]});fs['writeFileSync'](util[_0xe799('0x4b')](_0xe799('0x4c'),_0x27b1cd[_0xe799('0x3b')][_0xe799('0x23')][_0xe799('0x4d')]()),_0x32d4f7);return respondWithRpcPromise('Reload',_0xe799('0x44'),{'module':'chan_sip.so'});}})[_0xe799('0x8')](function(){return _0x5d453f;})[_0xe799('0x8')](respondWithResult(_0x57a96d,0xc9))[_0xe799('0x12')](handleError(_0x57a96d,null));};exports['update']=function(_0x54260f,_0x49602e){var _0x10abb7;return db[_0xe799('0x34')][_0xe799('0x4e')]({'where':{'id':_0x54260f[_0xe799('0x38')]['id']}})[_0xe799('0x8')](handleEntityNotFound(_0x49602e,null))[_0xe799('0x8')](saveUpdates(_0x54260f[_0xe799('0x3b')],null))[_0xe799('0x8')](function(_0x222398){if(_0x222398){_0x10abb7=_0x222398;return db[_0xe799('0x34')][_0xe799('0x4f')]({'where':{'type':_0x10abb7[_0xe799('0x23')]},'raw':!![]});}return null;})[_0xe799('0x8')](function(_0x5349ea){if(_0x10abb7[_0xe799('0x23')][_0xe799('0x3c')]()=='STUN'){var _0x4c391e=fs[_0xe799('0x3d')](path[_0xe799('0x49')](config[_0xe799('0x46')],_0xe799('0x3e')),_0xe799('0x3f'));var _0x4520d1=ejs['render'](_0x4c391e,{'networks':_0x5349ea||[]});fs[_0xe799('0x41')](_0xe799('0x42'),_0x4520d1);return respondWithRpcPromise('Reload',_0xe799('0x19'),{'module':_0xe799('0x48')});}else if(_0x10abb7[_0xe799('0x23')][_0xe799('0x3c')]()==_0xe799('0x45')){var _0x3688e2=fs[_0xe799('0x3d')](path[_0xe799('0x49')](config[_0xe799('0x46')],_0xe799('0x50')),_0xe799('0x3f'));var _0x6bc7c3=ejs[_0xe799('0x40')](_0x3688e2,{'networks':_0x5349ea||[]});fs[_0xe799('0x41')]('/etc/asterisk/turn_xcally.conf',_0x6bc7c3);return respondWithRpcPromise(_0xe799('0x43'),_0xe799('0x19'),{'module':_0xe799('0x48')});}else{var _0x2e3c3d=fs['readFileSync'](path['join'](config['root'],_0xe799('0x4a')),'utf8');var _0x3ac454=ejs[_0xe799('0x40')](_0x2e3c3d,{'networks':_0x5349ea||[]});fs[_0xe799('0x41')](util[_0xe799('0x4b')](_0xe799('0x4c'),_0x54260f[_0xe799('0x3b')][_0xe799('0x23')][_0xe799('0x4d')]()),_0x3ac454);return respondWithRpcPromise(_0xe799('0x43'),_0xe799('0x19'),{'module':_0xe799('0x51')});}})['then'](function(_0x100863){if(_0x100863){return _0x10abb7;}return null;})[_0xe799('0x8')](respondWithResult(_0x49602e,null))[_0xe799('0x12')](handleError(_0x49602e,null));};exports['destroy']=function(_0x6cc937,_0x3bdef6){var _0x3f2e66;return db['Network'][_0xe799('0x4e')]({'where':{'id':_0x6cc937[_0xe799('0x38')]['id']}})[_0xe799('0x8')](function(_0x12b30d){_0x3f2e66=_0x12b30d;return _0x12b30d;})[_0xe799('0x8')](handleEntityNotFound(_0x3bdef6,null))[_0xe799('0x8')](removeEntity(_0x3bdef6,null))[_0xe799('0x8')](function(){if(_0x3f2e66){return db['Network'][_0xe799('0x4f')]({'where':{'type':_0x3f2e66[_0xe799('0x23')]},'raw':!![]});}})[_0xe799('0x8')](function(_0x2e4376){if(_0x3f2e66[_0xe799('0x23')][_0xe799('0x3c')]()=='STUN'){var _0x2d218c=fs[_0xe799('0x3d')](path['join'](config[_0xe799('0x46')],'server/files/templates/stun_multiple.ejs'),_0xe799('0x3f'));var _0x24d34d=ejs[_0xe799('0x40')](_0x2d218c,{'networks':_0x2e4376||[]});fs['writeFileSync'](_0xe799('0x42'),_0x24d34d);return respondWithRpcPromise(_0xe799('0x43'),_0xe799('0x1a'),{'module':'res_stun_monitor.so'});}else if(_0x3f2e66[_0xe799('0x23')][_0xe799('0x3c')]()==_0xe799('0x45')){var _0x10ae82=fs[_0xe799('0x3d')](path[_0xe799('0x49')](config[_0xe799('0x46')],'server/files/templates/turn_multiple.ejs'),_0xe799('0x3f'));var _0x3baa2c=ejs['render'](_0x10ae82,{'networks':_0x2e4376||[]});fs[_0xe799('0x41')](_0xe799('0x47'),_0x3baa2c);return respondWithRpcPromise('Reload',_0xe799('0x1a'),{'module':_0xe799('0x48')});}else{var _0x4a7e9c=fs[_0xe799('0x3d')](path['join'](config[_0xe799('0x46')],'server/files/templates/network.ejs'),'utf8');var _0xefd3c3=ejs[_0xe799('0x40')](_0x4a7e9c,{'networks':_0x2e4376||[]});fs[_0xe799('0x41')](util[_0xe799('0x4b')]('/etc/asterisk/sip_xcally_%s.conf',_0x3f2e66[_0xe799('0x23')]['toLowerCase']()),_0xefd3c3);return respondWithRpcPromise(_0xe799('0x43'),_0xe799('0x1a'),{'module':_0xe799('0x51')});}})[_0xe799('0x12')](handleError(_0x3bdef6,null));}; \ No newline at end of file +var _0x2bac=['type','query','keys','filters','intersection','model','attributes','fields','length','limit','order','sort','pick','filter','where','VIRTUAL','merge','options','includeAll','include','show','find','create','body','findAll','STUN','readFileSync','join','root','server/files/templates/stun_multiple.ejs','utf8','render','writeFileSync','/etc/asterisk/stun_xcally.conf','Reload','res_stun_monitor.so','toUpperCase','TURN','server/files/templates/turn_multiple.ejs','/etc/asterisk/turn_xcally.conf','format','/etc/asterisk/sip_xcally_%s.conf','toLowerCase','chan_sip.so','server/files/templates/network.ejs','params','util','ejs','lodash','../../components/parsers/qs','../../config/logger','api','../../config/environment','jayson/promise','client','request','then','info','debug','Network,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','Network,\x20%s,\x20%s','message','result','catch','status','json','offset','undefined','count','set','Content-Range','update','destroy','end','sendStatus','stack','name','map','Network','fieldName'];(function(_0xdc574b,_0x5b3863){var _0x12515c=function(_0x27f8e3){while(--_0x27f8e3){_0xdc574b['push'](_0xdc574b['shift']());}};_0x12515c(++_0x5b3863);}(_0x2bac,0x127));var _0xc2ba=function(_0x191fcb,_0xc82b8d){_0x191fcb=_0x191fcb-0x0;var _0x566394=_0x2bac[_0x191fcb];return _0x566394;};'use strict';var util=require(_0xc2ba('0x0'));var path=require('path');var ejs=require(_0xc2ba('0x1'));var fs=require('fs');var _=require(_0xc2ba('0x2'));var qs=require(_0xc2ba('0x3'));var logger=require(_0xc2ba('0x4'))(_0xc2ba('0x5'));var config=require(_0xc2ba('0x6'));var db=require('../../mysqldb')['db'];var jayson=require(_0xc2ba('0x7'));var client=jayson[_0xc2ba('0x8')]['http']({'port':0x232a});function respondWithRpcPromise(_0x3378a4,_0x1fd312,_0x5bdb40,_0x237cc3){return new Promise(function(_0x2a2dbf,_0x144ae3){var _0x5c175a=_0x237cc3||client;return _0x5c175a[_0xc2ba('0x9')](_0x3378a4,_0x5bdb40)[_0xc2ba('0xa')](function(_0x528f41){logger[_0xc2ba('0xb')]('Network,\x20%s,\x20%s',_0x1fd312,'request\x20sent');logger[_0xc2ba('0xc')](_0xc2ba('0xd'),_0x1fd312,_0xc2ba('0xe'),JSON[_0xc2ba('0xf')](_0x528f41));if(_0x528f41['error']){if(_0x528f41[_0xc2ba('0x10')]['code']===0x1f4){logger[_0xc2ba('0x10')](_0xc2ba('0x11'),_0x1fd312,_0x528f41[_0xc2ba('0x10')][_0xc2ba('0x12')]);return _0x144ae3(_0x528f41[_0xc2ba('0x10')][_0xc2ba('0x12')]);}logger[_0xc2ba('0x10')](_0xc2ba('0x11'),_0x1fd312,_0x528f41[_0xc2ba('0x10')][_0xc2ba('0x12')]);return _0x2a2dbf(_0x528f41['error']['message']);}else{logger[_0xc2ba('0xb')](_0xc2ba('0x11'),_0x1fd312,_0xc2ba('0xe'));_0x2a2dbf(_0x528f41[_0xc2ba('0x13')][_0xc2ba('0x12')]);}})[_0xc2ba('0x14')](function(_0x20615b){logger[_0xc2ba('0x10')](_0xc2ba('0x11'),_0x1fd312,_0x20615b);_0x144ae3(_0x20615b);});});}function respondWithResult(_0x366ec2,_0x2c2eee){_0x2c2eee=_0x2c2eee||0xc8;return function(_0x2a2135){if(_0x2a2135){return _0x366ec2[_0xc2ba('0x15')](_0x2c2eee)[_0xc2ba('0x16')](_0x2a2135);}};}function respondWithFilteredResult(_0xc78239,_0x14cecd){return function(_0x319192){if(_0x319192){var _0x5c1f84=typeof _0x14cecd[_0xc2ba('0x17')]===_0xc2ba('0x18')&&typeof _0x14cecd['limit']===_0xc2ba('0x18');var _0x5ed916=_0x319192[_0xc2ba('0x19')];var _0x53acf4=_0x5c1f84?0x0:_0x14cecd[_0xc2ba('0x17')];var _0x1caa29=_0x5c1f84?_0x319192[_0xc2ba('0x19')]:_0x14cecd[_0xc2ba('0x17')]+_0x14cecd['limit'];var _0x4b8cad;if(_0x1caa29>=_0x5ed916){_0x1caa29=_0x5ed916;_0x4b8cad=0xc8;}else{_0x4b8cad=0xce;}_0xc78239[_0xc2ba('0x15')](_0x4b8cad);return _0xc78239[_0xc2ba('0x1a')](_0xc2ba('0x1b'),_0x53acf4+'-'+_0x1caa29+'/'+_0x5ed916)['json'](_0x319192);}return null;};}function saveUpdates(_0x5325e2){return function(_0xd1e2cf){if(_0xd1e2cf){return _0xd1e2cf[_0xc2ba('0x1c')](_0x5325e2)[_0xc2ba('0xa')](function(_0x5103bf){return _0x5103bf;});}return null;};}function removeEntity(_0x1ec306){return function(_0x1bc1f9){if(_0x1bc1f9){return _0x1bc1f9[_0xc2ba('0x1d')]()[_0xc2ba('0xa')](function(){_0x1ec306['status'](0xcc)[_0xc2ba('0x1e')]();});}};}function handleEntityNotFound(_0x25c16b){return function(_0x13d16d){if(!_0x13d16d){_0x25c16b[_0xc2ba('0x1f')](0x194);}return _0x13d16d;};}function handleError(_0x26ef9c,_0x28c234){_0x28c234=_0x28c234||0x1f4;return function(_0x20876a){logger[_0xc2ba('0x10')](_0x20876a[_0xc2ba('0x20')]);if(_0x20876a[_0xc2ba('0x21')]){delete _0x20876a[_0xc2ba('0x21')];}_0x26ef9c[_0xc2ba('0x15')](_0x28c234)['send'](_0x20876a);};}exports['index']=function(_0x46013d,_0x3ac25f){var _0x47590c={},_0x234d9d={},_0x1c0413={'count':0x0,'rows':[]};var _0x24132d=_[_0xc2ba('0x22')](db[_0xc2ba('0x23')]['rawAttributes'],function(_0x163aae){return{'name':_0x163aae[_0xc2ba('0x24')],'type':_0x163aae[_0xc2ba('0x25')]['key']};});_0x234d9d['model']=_['map'](_0x24132d,_0xc2ba('0x21'));_0x234d9d[_0xc2ba('0x26')]=_[_0xc2ba('0x27')](_0x46013d[_0xc2ba('0x26')]);_0x234d9d[_0xc2ba('0x28')]=_[_0xc2ba('0x29')](_0x234d9d[_0xc2ba('0x2a')],_0x234d9d[_0xc2ba('0x26')]);_0x47590c[_0xc2ba('0x2b')]=_[_0xc2ba('0x29')](_0x234d9d[_0xc2ba('0x2a')],qs['fields'](_0x46013d['query'][_0xc2ba('0x2c')]));_0x47590c[_0xc2ba('0x2b')]=_0x47590c['attributes'][_0xc2ba('0x2d')]?_0x47590c[_0xc2ba('0x2b')]:_0x234d9d[_0xc2ba('0x2a')];if(!_0x46013d[_0xc2ba('0x26')]['hasOwnProperty']('nolimit')){_0x47590c[_0xc2ba('0x2e')]=qs[_0xc2ba('0x2e')](_0x46013d[_0xc2ba('0x26')]['limit']);_0x47590c[_0xc2ba('0x17')]=qs[_0xc2ba('0x17')](_0x46013d[_0xc2ba('0x26')][_0xc2ba('0x17')]);}_0x47590c[_0xc2ba('0x2f')]=qs[_0xc2ba('0x30')](_0x46013d[_0xc2ba('0x26')][_0xc2ba('0x30')]);_0x47590c['where']=qs[_0xc2ba('0x28')](_[_0xc2ba('0x31')](_0x46013d[_0xc2ba('0x26')],_0x234d9d[_0xc2ba('0x28')]),_0x24132d);if(_0x46013d[_0xc2ba('0x26')][_0xc2ba('0x32')]){_0x47590c[_0xc2ba('0x33')]=_['merge'](_0x47590c['where'],{'$or':_['map'](_0x24132d,function(_0xce56a9){if(_0xce56a9[_0xc2ba('0x25')]!==_0xc2ba('0x34')){var _0x548025={};_0x548025[_0xce56a9[_0xc2ba('0x21')]]={'$like':'%'+_0x46013d['query'][_0xc2ba('0x32')]+'%'};return _0x548025;}})});}_0x47590c=_[_0xc2ba('0x35')]({},_0x47590c,_0x46013d[_0xc2ba('0x36')]);var _0xafbd97={'where':_0x47590c['where']};return db[_0xc2ba('0x23')][_0xc2ba('0x19')](_0xafbd97)[_0xc2ba('0xa')](function(_0x716478){_0x1c0413[_0xc2ba('0x19')]=_0x716478;if(_0x46013d['query'][_0xc2ba('0x37')]){_0x47590c[_0xc2ba('0x38')]=[{'all':!![]}];}return db['Network']['findAll'](_0x47590c);})['then'](function(_0x1902cb){_0x1c0413['rows']=_0x1902cb;return _0x1c0413;})[_0xc2ba('0xa')](respondWithFilteredResult(_0x3ac25f,_0x47590c))[_0xc2ba('0x14')](handleError(_0x3ac25f,null));};exports[_0xc2ba('0x39')]=function(_0x7497e2,_0x3cee87){var _0x21c502={'raw':!![],'where':{'id':_0x7497e2['params']['id']}},_0x154d6e={};_0x154d6e[_0xc2ba('0x2a')]=_[_0xc2ba('0x27')](db[_0xc2ba('0x23')]['rawAttributes']);_0x154d6e['query']=_[_0xc2ba('0x27')](_0x7497e2[_0xc2ba('0x26')]);_0x154d6e[_0xc2ba('0x28')]=_[_0xc2ba('0x29')](_0x154d6e[_0xc2ba('0x2a')],_0x154d6e[_0xc2ba('0x26')]);_0x21c502['attributes']=_['intersection'](_0x154d6e[_0xc2ba('0x2a')],qs[_0xc2ba('0x2c')](_0x7497e2[_0xc2ba('0x26')][_0xc2ba('0x2c')]));_0x21c502[_0xc2ba('0x2b')]=_0x21c502['attributes'][_0xc2ba('0x2d')]?_0x21c502[_0xc2ba('0x2b')]:_0x154d6e[_0xc2ba('0x2a')];if(_0x7497e2[_0xc2ba('0x26')][_0xc2ba('0x37')]){_0x21c502['include']=[{'all':!![]}];}_0x21c502=_[_0xc2ba('0x35')]({},_0x21c502,_0x7497e2[_0xc2ba('0x36')]);return db[_0xc2ba('0x23')][_0xc2ba('0x3a')](_0x21c502)[_0xc2ba('0xa')](handleEntityNotFound(_0x3cee87,null))[_0xc2ba('0xa')](respondWithResult(_0x3cee87,null))[_0xc2ba('0x14')](handleError(_0x3cee87,null));};exports['create']=function(_0x5a9892,_0x428b62){var _0x23170d;return db[_0xc2ba('0x23')][_0xc2ba('0x3b')](_0x5a9892[_0xc2ba('0x3c')],{'raw':!![]})[_0xc2ba('0xa')](function(_0x3c9114){_0x23170d=_0x3c9114;return db['Network'][_0xc2ba('0x3d')]({'where':{'type':_0x5a9892[_0xc2ba('0x3c')][_0xc2ba('0x25')]},'raw':!![]});})['then'](function(_0x4d9263){if(_0x23170d[_0xc2ba('0x25')]['toUpperCase']()==_0xc2ba('0x3e')){var _0x3a940c=fs[_0xc2ba('0x3f')](path[_0xc2ba('0x40')](config[_0xc2ba('0x41')],_0xc2ba('0x42')),_0xc2ba('0x43'));var _0x36abe9=ejs[_0xc2ba('0x44')](_0x3a940c,{'networks':_0x4d9263||[]});fs[_0xc2ba('0x45')](_0xc2ba('0x46'),_0x36abe9);return respondWithRpcPromise(_0xc2ba('0x47'),_0xc2ba('0x3b'),{'module':_0xc2ba('0x48')});}else if(_0x23170d[_0xc2ba('0x25')][_0xc2ba('0x49')]()==_0xc2ba('0x4a')){var _0x25a49e=fs[_0xc2ba('0x3f')](path['join'](config[_0xc2ba('0x41')],_0xc2ba('0x4b')),_0xc2ba('0x43'));var _0x6fb275=ejs[_0xc2ba('0x44')](_0x25a49e,{'networks':_0x4d9263||[]});fs['writeFileSync'](_0xc2ba('0x4c'),_0x6fb275);return respondWithRpcPromise('Reload','create',{'module':_0xc2ba('0x48')});}else{var _0x574a46=fs[_0xc2ba('0x3f')](path[_0xc2ba('0x40')](config[_0xc2ba('0x41')],'server/files/templates/network.ejs'),_0xc2ba('0x43'));var _0x24a9f5=ejs[_0xc2ba('0x44')](_0x574a46,{'networks':_0x4d9263||[]});fs[_0xc2ba('0x45')](util[_0xc2ba('0x4d')](_0xc2ba('0x4e'),_0x5a9892[_0xc2ba('0x3c')]['type'][_0xc2ba('0x4f')]()),_0x24a9f5);return respondWithRpcPromise(_0xc2ba('0x47'),_0xc2ba('0x3b'),{'module':_0xc2ba('0x50')});}})[_0xc2ba('0xa')](function(){return _0x23170d;})[_0xc2ba('0xa')](respondWithResult(_0x428b62,0xc9))['catch'](handleError(_0x428b62,null));};exports[_0xc2ba('0x1c')]=function(_0x1bd7c5,_0x15ea3d){var _0x1da33e;return db[_0xc2ba('0x23')][_0xc2ba('0x3a')]({'where':{'id':_0x1bd7c5['params']['id']}})[_0xc2ba('0xa')](handleEntityNotFound(_0x15ea3d,null))[_0xc2ba('0xa')](saveUpdates(_0x1bd7c5[_0xc2ba('0x3c')],null))[_0xc2ba('0xa')](function(_0x2e41f7){if(_0x2e41f7){_0x1da33e=_0x2e41f7;return db[_0xc2ba('0x23')]['findAll']({'where':{'type':_0x1da33e[_0xc2ba('0x25')]},'raw':!![]});}return null;})[_0xc2ba('0xa')](function(_0x3647dd){if(_0x1da33e[_0xc2ba('0x25')][_0xc2ba('0x49')]()=='STUN'){var _0x47c72e=fs[_0xc2ba('0x3f')](path[_0xc2ba('0x40')](config[_0xc2ba('0x41')],'server/files/templates/stun_multiple.ejs'),_0xc2ba('0x43'));var _0xb5e42b=ejs[_0xc2ba('0x44')](_0x47c72e,{'networks':_0x3647dd||[]});fs[_0xc2ba('0x45')]('/etc/asterisk/stun_xcally.conf',_0xb5e42b);return respondWithRpcPromise(_0xc2ba('0x47'),_0xc2ba('0x1c'),{'module':_0xc2ba('0x48')});}else if(_0x1da33e[_0xc2ba('0x25')][_0xc2ba('0x49')]()==_0xc2ba('0x4a')){var _0x51b396=fs['readFileSync'](path[_0xc2ba('0x40')](config[_0xc2ba('0x41')],_0xc2ba('0x4b')),_0xc2ba('0x43'));var _0x5ce547=ejs['render'](_0x51b396,{'networks':_0x3647dd||[]});fs[_0xc2ba('0x45')](_0xc2ba('0x4c'),_0x5ce547);return respondWithRpcPromise(_0xc2ba('0x47'),_0xc2ba('0x1c'),{'module':'res_stun_monitor.so'});}else{var _0x1a1ca6=fs[_0xc2ba('0x3f')](path[_0xc2ba('0x40')](config['root'],_0xc2ba('0x51')),_0xc2ba('0x43'));var _0x1f763a=ejs[_0xc2ba('0x44')](_0x1a1ca6,{'networks':_0x3647dd||[]});fs[_0xc2ba('0x45')](util[_0xc2ba('0x4d')]('/etc/asterisk/sip_xcally_%s.conf',_0x1bd7c5[_0xc2ba('0x3c')][_0xc2ba('0x25')]['toLowerCase']()),_0x1f763a);return respondWithRpcPromise(_0xc2ba('0x47'),_0xc2ba('0x1c'),{'module':_0xc2ba('0x50')});}})['then'](function(_0x238bdd){if(_0x238bdd){return _0x1da33e;}return null;})[_0xc2ba('0xa')](respondWithResult(_0x15ea3d,null))[_0xc2ba('0x14')](handleError(_0x15ea3d,null));};exports[_0xc2ba('0x1d')]=function(_0x47969b,_0x56ef20){var _0x1a634c;return db[_0xc2ba('0x23')]['find']({'where':{'id':_0x47969b[_0xc2ba('0x52')]['id']}})[_0xc2ba('0xa')](function(_0x222345){_0x1a634c=_0x222345;return _0x222345;})[_0xc2ba('0xa')](handleEntityNotFound(_0x56ef20,null))['then'](removeEntity(_0x56ef20,null))['then'](function(){if(_0x1a634c){return db[_0xc2ba('0x23')][_0xc2ba('0x3d')]({'where':{'type':_0x1a634c['type']},'raw':!![]});}})[_0xc2ba('0xa')](function(_0x2112d5){if(_0x1a634c[_0xc2ba('0x25')]['toUpperCase']()==_0xc2ba('0x3e')){var _0x2e3f34=fs['readFileSync'](path['join'](config[_0xc2ba('0x41')],'server/files/templates/stun_multiple.ejs'),_0xc2ba('0x43'));var _0x46ce99=ejs['render'](_0x2e3f34,{'networks':_0x2112d5||[]});fs['writeFileSync'](_0xc2ba('0x46'),_0x46ce99);return respondWithRpcPromise(_0xc2ba('0x47'),_0xc2ba('0x1d'),{'module':_0xc2ba('0x48')});}else if(_0x1a634c[_0xc2ba('0x25')][_0xc2ba('0x49')]()=='TURN'){var _0x3c09b4=fs[_0xc2ba('0x3f')](path['join'](config[_0xc2ba('0x41')],_0xc2ba('0x4b')),_0xc2ba('0x43'));var _0x516055=ejs[_0xc2ba('0x44')](_0x3c09b4,{'networks':_0x2112d5||[]});fs[_0xc2ba('0x45')](_0xc2ba('0x4c'),_0x516055);return respondWithRpcPromise(_0xc2ba('0x47'),_0xc2ba('0x1d'),{'module':'res_stun_monitor.so'});}else{var _0x5d811b=fs[_0xc2ba('0x3f')](path[_0xc2ba('0x40')](config[_0xc2ba('0x41')],_0xc2ba('0x51')),_0xc2ba('0x43'));var _0x2a2809=ejs[_0xc2ba('0x44')](_0x5d811b,{'networks':_0x2112d5||[]});fs['writeFileSync'](util[_0xc2ba('0x4d')](_0xc2ba('0x4e'),_0x1a634c[_0xc2ba('0x25')][_0xc2ba('0x4f')]()),_0x2a2809);return respondWithRpcPromise('Reload',_0xc2ba('0x1d'),{'module':_0xc2ba('0x50')});}})[_0xc2ba('0x14')](handleError(_0x56ef20,null));}; \ No newline at end of file diff --git a/server/api/network/network.model.js b/server/api/network/network.model.js index 8edf0cd..654252b 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 _0xd382=['request-promise','path','rimraf','../../config/environment','define','network','lodash','util','../../config/logger','api','moment','bluebird'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xd382,0x1b6));var _0x2d38=function(_0x5b3193,_0x4e9ba6){_0x5b3193=_0x5b3193-0x0;var _0x4d2687=_0xd382[_0x5b3193];return _0x4d2687;};'use strict';var _=require(_0x2d38('0x0'));var util=require(_0x2d38('0x1'));var logger=require(_0x2d38('0x2'))(_0x2d38('0x3'));var moment=require(_0x2d38('0x4'));var BPromise=require(_0x2d38('0x5'));var rp=require(_0x2d38('0x6'));var fs=require('fs');var path=require(_0x2d38('0x7'));var rimraf=require(_0x2d38('0x8'));var config=require(_0x2d38('0x9'));var attributes=require('./network.attributes');module['exports']=function(_0x5a8219,_0x30106c){return _0x5a8219[_0x2d38('0xa')]('Network',attributes,{'tableName':_0x2d38('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x13f6=['request-promise','rimraf','../../config/environment','./network.attributes','lodash','util','moment','bluebird'];(function(_0x533332,_0x192d65){var _0x1cc467=function(_0xeefa56){while(--_0xeefa56){_0x533332['push'](_0x533332['shift']());}};_0x1cc467(++_0x192d65);}(_0x13f6,0x124));var _0x613f=function(_0x4ac347,_0x28506a){_0x4ac347=_0x4ac347-0x0;var _0x415172=_0x13f6[_0x4ac347];return _0x415172;};'use strict';var _=require(_0x613f('0x0'));var util=require(_0x613f('0x1'));var logger=require('../../config/logger')('api');var moment=require(_0x613f('0x2'));var BPromise=require(_0x613f('0x3'));var rp=require(_0x613f('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0x613f('0x5'));var config=require(_0x613f('0x6'));var attributes=require(_0x613f('0x7'));module['exports']=function(_0x3f3525,_0x2367b3){return _0x3f3525['define']('Network',attributes,{'tableName':'network','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/network/network.rpc.js b/server/api/network/network.rpc.js index 6ec25fb..59f7725 100644 --- a/server/api/network/network.rpc.js +++ b/server/api/network/network.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x7a54=['info','Network,\x20%s,\x20%s','debug','stringify','error','code','message','request\x20sent','result','catch','lodash','util','moment','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http'];(function(_0x3ab51d,_0x2fa01d){var _0x29a04e=function(_0x7807b0){while(--_0x7807b0){_0x3ab51d['push'](_0x3ab51d['shift']());}};_0x29a04e(++_0x2fa01d);}(_0x7a54,0x106));var _0x47a5=function(_0xb33b93,_0x7b67a){_0xb33b93=_0xb33b93-0x0;var _0x1cc0d2=_0x7a54[_0xb33b93];return _0x1cc0d2;};'use strict';var _=require(_0x47a5('0x0'));var util=require(_0x47a5('0x1'));var moment=require(_0x47a5('0x2'));var BPromise=require('bluebird');var rs=require(_0x47a5('0x3'));var fs=require('fs');var Redis=require(_0x47a5('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x47a5('0x5'));var logger=require(_0x47a5('0x6'))(_0x47a5('0x7'));var config=require(_0x47a5('0x8'));var jayson=require(_0x47a5('0x9'));var client=jayson['client'][_0x47a5('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x59199c,_0x343372,_0x30e405){return new BPromise(function(_0x506eda,_0x194fb0){return client['request'](_0x59199c,_0x30e405)['then'](function(_0x582352){logger[_0x47a5('0xb')](_0x47a5('0xc'),_0x343372,'request\x20sent');logger[_0x47a5('0xd')]('Network,\x20%s,\x20%s,\x20%s',_0x343372,'request\x20sent',JSON[_0x47a5('0xe')](_0x582352));if(_0x582352[_0x47a5('0xf')]){if(_0x582352[_0x47a5('0xf')][_0x47a5('0x10')]===0x1f4){logger[_0x47a5('0xf')](_0x47a5('0xc'),_0x343372,_0x582352[_0x47a5('0xf')]['message']);return _0x194fb0(_0x582352[_0x47a5('0xf')][_0x47a5('0x11')]);}logger[_0x47a5('0xf')](_0x47a5('0xc'),_0x343372,_0x582352[_0x47a5('0xf')][_0x47a5('0x11')]);return _0x506eda(_0x582352[_0x47a5('0xf')][_0x47a5('0x11')]);}else{logger['info'](_0x47a5('0xc'),_0x343372,_0x47a5('0x12'));_0x506eda(_0x582352[_0x47a5('0x13')][_0x47a5('0x11')]);}})[_0x47a5('0x14')](function(_0x574af6){logger['error'](_0x47a5('0xc'),_0x343372,_0x574af6);_0x194fb0(_0x574af6);});});} \ No newline at end of file +var _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(_0x5ef273,_0x3e5c01){var _0x548361=function(_0x44b564){while(--_0x44b564){_0x5ef273['push'](_0x5ef273['shift']());}};_0x548361(++_0x3e5c01);}(_0x9957,0x93));var _0x7995=function(_0x5ddb1c,_0x5ea4df){_0x5ddb1c=_0x5ddb1c-0x0;var _0x354adc=_0x9957[_0x5ddb1c];return _0x354adc;};'use strict';var _=require(_0x7995('0x0'));var util=require(_0x7995('0x1'));var 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 d874278..6703248 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 _0x60ca=['../../config/environment','./openchannelAccount.controller','get','isAuthenticated','index','describe','/:id','/:id/dispositions','getDispositions','/:id/canned_answers','/:id/applications','getApplications','/:id/interactions','getInteractions','/:id/users','post','create','addDisposition','/:id/notify','notify','addApplications','addAgents','/:id/send','put','update','delete','destroy','removeDispositions','removeAnswers','removeAgents','util','path','connect-timeout','express','Router','fs-extra'];(function(_0x315f08,_0x868d9b){var _0x183d0b=function(_0x538592){while(--_0x538592){_0x315f08['push'](_0x315f08['shift']());}};_0x183d0b(++_0x868d9b);}(_0x60ca,0xae));var _0xa60c=function(_0x58491e,_0x17a969){_0x58491e=_0x58491e-0x0;var _0x31b99a=_0x60ca[_0x58491e];return _0x31b99a;};'use strict';var multer=require('multer');var util=require(_0xa60c('0x0'));var path=require(_0xa60c('0x1'));var timeout=require(_0xa60c('0x2'));var express=require(_0xa60c('0x3'));var router=express[_0xa60c('0x4')]();var fs_extra=require(_0xa60c('0x5'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0xa60c('0x6'));var controller=require(_0xa60c('0x7'));router[_0xa60c('0x8')]('/',auth[_0xa60c('0x9')](),controller[_0xa60c('0xa')]);router[_0xa60c('0x8')]('/describe',auth[_0xa60c('0x9')](),controller[_0xa60c('0xb')]);router['get'](_0xa60c('0xc'),auth['isAuthenticated'](),controller['show']);router[_0xa60c('0x8')](_0xa60c('0xd'),auth[_0xa60c('0x9')](),controller[_0xa60c('0xe')]);router[_0xa60c('0x8')](_0xa60c('0xf'),auth[_0xa60c('0x9')](),controller['getAnswers']);router[_0xa60c('0x8')](_0xa60c('0x10'),auth[_0xa60c('0x9')](),controller[_0xa60c('0x11')]);router[_0xa60c('0x8')](_0xa60c('0x12'),auth[_0xa60c('0x9')](),controller[_0xa60c('0x13')]);router[_0xa60c('0x8')](_0xa60c('0x14'),auth['isAuthenticated'](),controller['getAgents']);router[_0xa60c('0x15')]('/',auth['isAuthenticated'](),controller[_0xa60c('0x16')]);router[_0xa60c('0x15')](_0xa60c('0xd'),auth[_0xa60c('0x9')](),controller[_0xa60c('0x17')]);router[_0xa60c('0x15')]('/:id/canned_answers',auth[_0xa60c('0x9')](),controller['addAnswer']);router[_0xa60c('0x15')](_0xa60c('0x18'),controller[_0xa60c('0x19')]);router[_0xa60c('0x15')](_0xa60c('0x10'),auth['isAuthenticated'](),controller[_0xa60c('0x1a')]);router[_0xa60c('0x15')](_0xa60c('0x14'),auth[_0xa60c('0x9')](),controller[_0xa60c('0x1b')]);router[_0xa60c('0x15')](_0xa60c('0x1c'),auth[_0xa60c('0x9')](),controller['send']);router[_0xa60c('0x1d')]('/:id',auth[_0xa60c('0x9')](),controller[_0xa60c('0x1e')]);router[_0xa60c('0x1f')]('/:id',auth[_0xa60c('0x9')](),controller[_0xa60c('0x20')]);router[_0xa60c('0x1f')](_0xa60c('0xd'),auth['isAuthenticated'](),controller[_0xa60c('0x21')]);router[_0xa60c('0x1f')](_0xa60c('0xf'),auth[_0xa60c('0x9')](),controller[_0xa60c('0x22')]);router['delete']('/:id/users',auth['isAuthenticated'](),controller[_0xa60c('0x23')]);module['exports']=router; \ No newline at end of file +var _0x44c3=['util','path','express','Router','fs-extra','../../components/auth/service','./openchannelAccount.controller','get','isAuthenticated','index','/describe','describe','/:id','/:id/dispositions','getDispositions','/:id/canned_answers','getAnswers','getApplications','/:id/interactions','/:id/users','post','create','addDisposition','addAnswer','notify','/:id/applications','addApplications','addAgents','/:id/send','send','put','delete','destroy','removeDispositions','removeAgents','exports','multer'];(function(_0x2c2e2f,_0x1387a8){var _0x1928fe=function(_0x4c7890){while(--_0x4c7890){_0x2c2e2f['push'](_0x2c2e2f['shift']());}};_0x1928fe(++_0x1387a8);}(_0x44c3,0x1bb));var _0x344c=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x44c3[_0x3dd15e];return _0x231fd0;};'use strict';var multer=require(_0x344c('0x0'));var util=require(_0x344c('0x1'));var path=require(_0x344c('0x2'));var timeout=require('connect-timeout');var express=require(_0x344c('0x3'));var router=express[_0x344c('0x4')]();var fs_extra=require(_0x344c('0x5'));var auth=require(_0x344c('0x6'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0x344c('0x7'));router[_0x344c('0x8')]('/',auth[_0x344c('0x9')](),controller[_0x344c('0xa')]);router['get'](_0x344c('0xb'),auth[_0x344c('0x9')](),controller[_0x344c('0xc')]);router[_0x344c('0x8')](_0x344c('0xd'),auth[_0x344c('0x9')](),controller['show']);router[_0x344c('0x8')](_0x344c('0xe'),auth[_0x344c('0x9')](),controller[_0x344c('0xf')]);router[_0x344c('0x8')](_0x344c('0x10'),auth[_0x344c('0x9')](),controller[_0x344c('0x11')]);router[_0x344c('0x8')]('/:id/applications',auth[_0x344c('0x9')](),controller[_0x344c('0x12')]);router['get'](_0x344c('0x13'),auth[_0x344c('0x9')](),controller['getInteractions']);router['get'](_0x344c('0x14'),auth[_0x344c('0x9')](),controller['getAgents']);router[_0x344c('0x15')]('/',auth[_0x344c('0x9')](),controller[_0x344c('0x16')]);router[_0x344c('0x15')](_0x344c('0xe'),auth[_0x344c('0x9')](),controller[_0x344c('0x17')]);router[_0x344c('0x15')](_0x344c('0x10'),auth[_0x344c('0x9')](),controller[_0x344c('0x18')]);router[_0x344c('0x15')]('/:id/notify',controller[_0x344c('0x19')]);router[_0x344c('0x15')](_0x344c('0x1a'),auth[_0x344c('0x9')](),controller[_0x344c('0x1b')]);router['post'](_0x344c('0x14'),auth[_0x344c('0x9')](),controller[_0x344c('0x1c')]);router[_0x344c('0x15')](_0x344c('0x1d'),auth[_0x344c('0x9')](),controller[_0x344c('0x1e')]);router[_0x344c('0x1f')](_0x344c('0xd'),auth[_0x344c('0x9')](),controller['update']);router[_0x344c('0x20')](_0x344c('0xd'),auth[_0x344c('0x9')](),controller[_0x344c('0x21')]);router['delete'](_0x344c('0xe'),auth[_0x344c('0x9')](),controller[_0x344c('0x22')]);router['delete'](_0x344c('0x10'),auth[_0x344c('0x9')](),controller['removeAnswers']);router[_0x344c('0x20')](_0x344c('0x14'),auth['isAuthenticated'](),controller[_0x344c('0x23')]);module[_0x344c('0x24')]=router; \ No newline at end of file diff --git a/server/api/openchannelAccount/openchannelAccount.attributes.js b/server/api/openchannelAccount/openchannelAccount.attributes.js index 9959cf6..e95f186 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 _0x59c7=['randomstring','exports','name','STRING','TEXT','BOOLEAN','INTEGER','Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled','mandatoryDispositionPauseId','setDataValue','mandatoryDisposition','sequelize'];(function(_0x1694f5,_0x49b7c3){var _0x5b4321=function(_0x58c183){while(--_0x58c183){_0x1694f5['push'](_0x1694f5['shift']());}};_0x5b4321(++_0x49b7c3);}(_0x59c7,0x6b));var _0x759c=function(_0x784a26,_0x1c5dd6){_0x784a26=_0x784a26-0x0;var _0x31d14d=_0x59c7[_0x784a26];return _0x31d14d;};'use strict';var Sequelize=require(_0x759c('0x0'));var rs=require(_0x759c('0x1'));module[_0x759c('0x2')]={'name':{'type':Sequelize['STRING'],'unique':_0x759c('0x3'),'allowNull':![]},'description':{'type':Sequelize['STRING']},'token':{'type':Sequelize[_0x759c('0x4')],'defaultValue':function(){return rs['generate']();}},'replyUri':{'type':Sequelize[_0x759c('0x4')],'validate':{'isUrl':!![]}},'key':{'type':Sequelize[_0x759c('0x4')],'allowNull':![]},'notificationTemplate':{'type':Sequelize[_0x759c('0x5')],'defaultValue':function(){return'Account:\x20{{account.name}}
{{#queue}}Queue:\x20{{queue.name}}
{{/queue}}From\x20:\x20{{from}}';}},'notificationSound':{'type':Sequelize[_0x759c('0x6')],'defaultValue':!![]},'notificationShake':{'type':Sequelize[_0x759c('0x6')],'defaultValue':![]},'waitForTheAssignedAgent':{'type':Sequelize[_0x759c('0x7')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'waitForTheAssignedQueue':{'type':Sequelize[_0x759c('0x7')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'mapKey':{'type':Sequelize[_0x759c('0x4')]},'queueTransfer':{'type':Sequelize[_0x759c('0x6')],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize[_0x759c('0x6')],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize[_0x759c('0x7')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'mandatoryDispositionPauseId':{'type':Sequelize[_0x759c('0x7')],'allowNull':!![],'defaultValue':null,'comment':_0x759c('0x8')},'mandatoryDisposition':{'type':Sequelize['BOOLEAN'],'defaultValue':![],'comment':'Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','set':function(_0x9666b8){if(!_0x9666b8)this['setDataValue'](_0x759c('0x9'),null);this[_0x759c('0xa')](_0x759c('0xb'),_0x9666b8);}}}; \ No newline at end of file +var _0xa11c=['mandatoryDispositionPauseId','mandatoryDisposition','sequelize','randomstring','STRING','name','BOOLEAN','INTEGER','Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled','Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','setDataValue'];(function(_0x1501e2,_0x271210){var _0xfce8c5=function(_0x343f12){while(--_0x343f12){_0x1501e2['push'](_0x1501e2['shift']());}};_0xfce8c5(++_0x271210);}(_0xa11c,0x1e6));var _0xca11=function(_0x3947c9,_0x4d6c97){_0x3947c9=_0x3947c9-0x0;var _0x2e7871=_0xa11c[_0x3947c9];return _0x2e7871;};'use strict';var Sequelize=require(_0xca11('0x0'));var rs=require(_0xca11('0x1'));module['exports']={'name':{'type':Sequelize[_0xca11('0x2')],'unique':_0xca11('0x3'),'allowNull':![]},'description':{'type':Sequelize['STRING']},'token':{'type':Sequelize[_0xca11('0x2')],'defaultValue':function(){return rs['generate']();}},'replyUri':{'type':Sequelize['STRING'],'validate':{'isUrl':!![]}},'key':{'type':Sequelize[_0xca11('0x2')],'allowNull':![]},'notificationTemplate':{'type':Sequelize['TEXT'],'defaultValue':function(){return'Account:\x20{{account.name}}
{{#queue}}Queue:\x20{{queue.name}}
{{/queue}}From\x20:\x20{{from}}';}},'notificationSound':{'type':Sequelize[_0xca11('0x4')],'defaultValue':!![]},'notificationShake':{'type':Sequelize[_0xca11('0x4')],'defaultValue':![]},'waitForTheAssignedAgent':{'type':Sequelize[_0xca11('0x5')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'waitForTheAssignedQueue':{'type':Sequelize[_0xca11('0x5')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'mapKey':{'type':Sequelize[_0xca11('0x2')]},'queueTransfer':{'type':Sequelize[_0xca11('0x4')],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize[_0xca11('0x5')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize[_0xca11('0x4')],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize[_0xca11('0x5')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'mandatoryDispositionPauseId':{'type':Sequelize[_0xca11('0x5')],'allowNull':!![],'defaultValue':null,'comment':_0xca11('0x6')},'mandatoryDisposition':{'type':Sequelize[_0xca11('0x4')],'defaultValue':![],'comment':_0xca11('0x7'),'set':function(_0x282b48){if(!_0x282b48)this[_0xca11('0x8')](_0xca11('0x9'),null);this['setDataValue'](_0xca11('0xa'),_0x282b48);}}}; \ No newline at end of file diff --git a/server/api/openchannelAccount/openchannelAccount.controller.js b/server/api/openchannelAccount/openchannelAccount.controller.js index 089530d..3a881bb 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 _0x933c=['end','undefined','limit','count','offset','set','Content-Range','json','reject','save','update','destroy','get','OpenchannelAccounts','UserProfileResource','sendStatus','stack','name','send','index','Pause','OpenchannelAccount','fieldName','type','key','map','query','filters','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','options','includeAll','include','findAll','rows','show','mandatoryDispositionPause','keys','rawAttributes','find','create','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','params','describe','addDisposition','OpenchannelAccountId','Disposition','getDispositions','findOne','removeDispositions','ids','addAnswer','CannedAnswer','getAnswers','removeAnswers','openchannel','CmContact','ValidationError','no\x20available\x20attributes','difference','updatedAt','createdAt','CompanyId','ListId','isNil','Sequelize','from\x20is\x20mandatory','mapKey','mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','includes','mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','from','CmList','Contacts','DESC','OpenchannelApplication','List','applications','Applications','list','orderBy','priority','asc','account','contact','firstName','lastName','threadId','OpenchannelInteraction','externalUrl','spread','messageId','interaction','created','autoclose','push','close','*,*,*,*','OpenchannelMessage','AttachmentId','UserId','User','unshift','queueId','OpenchannelQueue','queue','waitForTheAssignedQueue','Start','startRouting','EventManager','addApplications','sequelize','Transaction','ISOLATION_LEVELS','READ_COMMITTED','bulkCreate','findAndCountAll','finally','getApplications','Contact','Owner','internal','Tag','Tags','tag','addAgents','omit','userOpenchannelAccount:save','removeAgents','isArray','emit','getAgents','body\x20is\x20mandatory\x20and\x20not\x20empty','out','Messages','dataValues','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','mustache','util','path','sox','to-csv','ejs','lodash','crypto','jsforce','querystring','papaparse','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','defaults','redis','localhost','socket.io-emitter','register','client','http','request','then','info','OpenchannelAccount,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','catch','status'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x933c,0x99));var _0xc933=function(_0xc12aa8,_0x583423){_0xc12aa8=_0xc12aa8-0x0;var _0x2802bc=_0x933c[_0xc12aa8];return _0x2802bc;};'use strict';var emlformat=require(_0xc933('0x0'));var rimraf=require(_0xc933('0x1'));var zipdir=require(_0xc933('0x2'));var jsonpatch=require(_0xc933('0x3'));var rp=require(_0xc933('0x4'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0xc933('0x5'));var util=require(_0xc933('0x6'));var path=require(_0xc933('0x7'));var sox=require(_0xc933('0x8'));var csv=require(_0xc933('0x9'));var ejs=require(_0xc933('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xc933('0xb'));var squel=require('squel');var crypto=require(_0xc933('0xc'));var jsforce=require(_0xc933('0xd'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0xc933('0xe'));var Papa=require(_0xc933('0xf'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0xc933('0x10'));var as=require(_0xc933('0x11'));var hardwareService=require(_0xc933('0x12'));var logger=require(_0xc933('0x13'))(_0xc933('0x14'));var utils=require(_0xc933('0x15'));var config=require(_0xc933('0x16'));var licenseUtil=require(_0xc933('0x17'));var db=require('../../mysqldb')['db'];config['redis']=_[_0xc933('0x18')](config[_0xc933('0x19')],{'host':_0xc933('0x1a'),'port':0x18eb});var socket=require(_0xc933('0x1b'))(new Redis(config[_0xc933('0x19')]));require('./openchannelAccount.socket')[_0xc933('0x1c')](socket);var jayson=require('jayson/promise');var client=jayson[_0xc933('0x1d')][_0xc933('0x1e')]({'port':0x232c});var client9002=jayson[_0xc933('0x1d')][_0xc933('0x1e')]({'port':0x232a});function respondWithRpcPromise(_0x490452,_0x12a97b,_0x4d8f14,_0x4bdbe8){return new BPromise(function(_0x776634,_0x42b06a){var _0xb76659=_0x4bdbe8||client;return _0xb76659[_0xc933('0x1f')](_0x490452,_0x4d8f14)[_0xc933('0x20')](function(_0x2ba124){logger[_0xc933('0x21')](_0xc933('0x22'),_0x12a97b,_0xc933('0x23'));logger[_0xc933('0x24')]('OpenchannelAccount,\x20%s,\x20%s,\x20%s',_0x12a97b,_0xc933('0x23'),JSON[_0xc933('0x25')](_0x2ba124));if(_0x2ba124[_0xc933('0x26')]){if(_0x2ba124[_0xc933('0x26')][_0xc933('0x27')]===0x1f4){logger[_0xc933('0x26')](_0xc933('0x22'),_0x12a97b,_0x2ba124[_0xc933('0x26')]['message']);return _0x42b06a(_0x2ba124[_0xc933('0x26')][_0xc933('0x28')]);}logger[_0xc933('0x26')](_0xc933('0x22'),_0x12a97b,_0x2ba124[_0xc933('0x26')]['message']);return _0x776634(_0x2ba124[_0xc933('0x26')][_0xc933('0x28')]);}else{logger[_0xc933('0x21')](_0xc933('0x22'),_0x12a97b,_0xc933('0x23'));_0x776634(_0x2ba124['result'][_0xc933('0x28')]);}})[_0xc933('0x29')](function(_0x5ede22){logger['error'](_0xc933('0x22'),_0x12a97b,_0x5ede22);_0x42b06a(_0x5ede22);});});}function respondWithStatusCode(_0x454715,_0x31ac8b){_0x31ac8b=_0x31ac8b||0xcc;return function(_0x1afada){if(_0x1afada){return _0x454715['sendStatus'](_0x31ac8b);}return _0x454715[_0xc933('0x2a')](_0x31ac8b)[_0xc933('0x2b')]();};}function respondWithResult(_0x519ede,_0x1a9004){_0x1a9004=_0x1a9004||0xc8;return function(_0x202244){if(_0x202244){return _0x519ede['status'](_0x1a9004)['json'](_0x202244);}};}function respondWithFilteredResult(_0x4628ec,_0x5d7b77){return function(_0x8598f7){if(_0x8598f7){var _0xaad361=typeof _0x5d7b77['offset']===_0xc933('0x2c')&&typeof _0x5d7b77[_0xc933('0x2d')]===_0xc933('0x2c');var _0x5055c7=_0x8598f7[_0xc933('0x2e')];var _0x39e652=_0xaad361?0x0:_0x5d7b77[_0xc933('0x2f')];var _0x5ab52a=_0xaad361?_0x8598f7[_0xc933('0x2e')]:_0x5d7b77[_0xc933('0x2f')]+_0x5d7b77[_0xc933('0x2d')];var _0x21fcd1;if(_0x5ab52a>=_0x5055c7){_0x5ab52a=_0x5055c7;_0x21fcd1=0xc8;}else{_0x21fcd1=0xce;}_0x4628ec[_0xc933('0x2a')](_0x21fcd1);return _0x4628ec[_0xc933('0x30')](_0xc933('0x31'),_0x39e652+'-'+_0x5ab52a+'/'+_0x5055c7)[_0xc933('0x32')](_0x8598f7);}return null;};}function patchUpdates(_0x594503){return function(_0x12e1af){try{jsonpatch['apply'](_0x12e1af,_0x594503,!![]);}catch(_0x2ceaff){return BPromise[_0xc933('0x33')](_0x2ceaff);}return _0x12e1af[_0xc933('0x34')]();};}function saveUpdates(_0x45fa89,_0x56eb1f){return function(_0x5c04a8){if(_0x5c04a8){return _0x5c04a8[_0xc933('0x35')](_0x45fa89)[_0xc933('0x20')](function(_0x3a7471){return _0x3a7471;});}return null;};}function removeEntity(_0x4ce9f7,_0x2831e4){return function(_0x1d559a){if(_0x1d559a){return _0x1d559a[_0xc933('0x36')]()[_0xc933('0x20')](function(){var _0x6f737f=_0x1d559a[_0xc933('0x37')]({'plain':!![]});var _0xa48d70=_0xc933('0x38');return db[_0xc933('0x39')]['destroy']({'where':{'type':_0xa48d70,'resourceId':_0x6f737f['id']}})[_0xc933('0x20')](function(){return _0x1d559a;});})[_0xc933('0x20')](function(){_0x4ce9f7[_0xc933('0x2a')](0xcc)[_0xc933('0x2b')]();});}};}function handleEntityNotFound(_0x566635,_0x1530eb){return function(_0x42dc86){if(!_0x42dc86){_0x566635[_0xc933('0x3a')](0x194);}return _0x42dc86;};}function handleError(_0x204347,_0x8769b6){_0x8769b6=_0x8769b6||0x1f4;return function(_0x4652fb){logger[_0xc933('0x26')](_0x4652fb[_0xc933('0x3b')]);if(_0x4652fb[_0xc933('0x3c')]){delete _0x4652fb[_0xc933('0x3c')];}_0x204347['status'](_0x8769b6)[_0xc933('0x3d')](_0x4652fb);};}exports[_0xc933('0x3e')]=function(_0x2087af,_0x3905fc){var _0x4d7ed7={'include':[{'model':db[_0xc933('0x3f')],'as':'mandatoryDispositionPause'}]},_0x2b39ae={},_0x59138a={'count':0x0,'rows':[]};var _0xc053cb=_['map'](db[_0xc933('0x40')]['rawAttributes'],function(_0x4c06da){return{'name':_0x4c06da[_0xc933('0x41')],'type':_0x4c06da[_0xc933('0x42')][_0xc933('0x43')]};});_0x2b39ae['model']=_[_0xc933('0x44')](_0xc053cb,_0xc933('0x3c'));_0x2b39ae[_0xc933('0x45')]=_['keys'](_0x2087af[_0xc933('0x45')]);_0x2b39ae[_0xc933('0x46')]=_[_0xc933('0x47')](_0x2b39ae[_0xc933('0x48')],_0x2b39ae[_0xc933('0x45')]);_0x4d7ed7[_0xc933('0x49')]=_[_0xc933('0x47')](_0x2b39ae['model'],qs[_0xc933('0x4a')](_0x2087af[_0xc933('0x45')]['fields']));_0x4d7ed7[_0xc933('0x49')]=_0x4d7ed7[_0xc933('0x49')][_0xc933('0x4b')]?_0x4d7ed7[_0xc933('0x49')]:_0x2b39ae[_0xc933('0x48')];if(!_0x2087af[_0xc933('0x45')][_0xc933('0x4c')](_0xc933('0x4d'))){_0x4d7ed7[_0xc933('0x2d')]=qs[_0xc933('0x2d')](_0x2087af['query'][_0xc933('0x2d')]);_0x4d7ed7[_0xc933('0x2f')]=qs[_0xc933('0x2f')](_0x2087af[_0xc933('0x45')][_0xc933('0x2f')]);}_0x4d7ed7[_0xc933('0x4e')]=qs[_0xc933('0x4f')](_0x2087af[_0xc933('0x45')]['sort']);_0x4d7ed7[_0xc933('0x50')]=qs[_0xc933('0x46')](_[_0xc933('0x51')](_0x2087af['query'],_0x2b39ae[_0xc933('0x46')]),_0xc053cb);if(_0x2087af[_0xc933('0x45')][_0xc933('0x52')]){_0x4d7ed7[_0xc933('0x50')]=_[_0xc933('0x53')](_0x4d7ed7[_0xc933('0x50')],{'$or':_[_0xc933('0x44')](_0xc053cb,function(_0x382c7d){if(_0x382c7d['type']!=='VIRTUAL'){var _0x33c6f2={};_0x33c6f2[_0x382c7d[_0xc933('0x3c')]]={'$like':'%'+_0x2087af['query'][_0xc933('0x52')]+'%'};return _0x33c6f2;}})});}_0x4d7ed7=_[_0xc933('0x53')]({},_0x4d7ed7,_0x2087af[_0xc933('0x54')]);var _0x72884f={'where':_0x4d7ed7[_0xc933('0x50')]};return db['OpenchannelAccount'][_0xc933('0x2e')](_0x72884f)['then'](function(_0x5d81bc){_0x59138a[_0xc933('0x2e')]=_0x5d81bc;if(_0x2087af['query'][_0xc933('0x55')]){_0x4d7ed7[_0xc933('0x56')]=[{'all':!![]}];}return db[_0xc933('0x40')][_0xc933('0x57')](_0x4d7ed7);})[_0xc933('0x20')](function(_0x5a2e8e){_0x59138a[_0xc933('0x58')]=_0x5a2e8e;return _0x59138a;})['then'](respondWithFilteredResult(_0x3905fc,_0x4d7ed7))[_0xc933('0x29')](handleError(_0x3905fc,null));};exports[_0xc933('0x59')]=function(_0x389f04,_0x2b2eab){var _0x293946={'raw':![],'where':{'id':_0x389f04['params']['id']},'include':[{'model':db['Pause'],'as':_0xc933('0x5a')}]},_0x4b0215={};_0x4b0215[_0xc933('0x48')]=_[_0xc933('0x5b')](db['OpenchannelAccount'][_0xc933('0x5c')]);_0x4b0215[_0xc933('0x45')]=_[_0xc933('0x5b')](_0x389f04[_0xc933('0x45')]);_0x4b0215[_0xc933('0x46')]=_[_0xc933('0x47')](_0x4b0215['model'],_0x4b0215[_0xc933('0x45')]);_0x293946[_0xc933('0x49')]=_['intersection'](_0x4b0215[_0xc933('0x48')],qs[_0xc933('0x4a')](_0x389f04[_0xc933('0x45')][_0xc933('0x4a')]));_0x293946['attributes']=_0x293946[_0xc933('0x49')][_0xc933('0x4b')]?_0x293946[_0xc933('0x49')]:_0x4b0215['model'];if(_0x389f04[_0xc933('0x45')]['includeAll']){_0x293946[_0xc933('0x56')]=[{'all':!![]}];}_0x293946=_[_0xc933('0x53')]({},_0x293946,_0x389f04[_0xc933('0x54')]);return db['OpenchannelAccount'][_0xc933('0x5d')](_0x293946)[_0xc933('0x20')](handleEntityNotFound(_0x2b2eab,null))[_0xc933('0x20')](respondWithResult(_0x2b2eab,null))[_0xc933('0x29')](handleError(_0x2b2eab,null));};exports[_0xc933('0x5e')]=function(_0xe89b60,_0x5a3f7e){return db['OpenchannelAccount'][_0xc933('0x5e')](_0xe89b60['body'],{})[_0xc933('0x20')](function(_0x583d99){var _0x1a828e=_0xe89b60[_0xc933('0x5f')][_0xc933('0x37')]({'plain':!![]});if(!_0x1a828e)throw new Error(_0xc933('0x60'));if(_0x1a828e['role']===_0xc933('0x5f')){var _0x5c23a4=_0x583d99[_0xc933('0x37')]({'plain':!![]});var _0x4ed421='OpenchannelAccounts';return db[_0xc933('0x61')]['find']({'where':{'name':_0x4ed421,'userProfileId':_0x1a828e[_0xc933('0x62')]},'raw':!![]})[_0xc933('0x20')](function(_0x83e284){if(_0x83e284&&_0x83e284[_0xc933('0x63')]===0x0){return db[_0xc933('0x39')][_0xc933('0x5e')]({'name':_0x5c23a4[_0xc933('0x3c')],'resourceId':_0x5c23a4['id'],'type':_0x83e284[_0xc933('0x3c')],'sectionId':_0x83e284['id']},{})['then'](function(){return _0x583d99;});}else{return _0x583d99;}})[_0xc933('0x29')](function(_0x53c0ac){logger['error'](_0xc933('0x64'),_0x53c0ac);throw _0x53c0ac;});}return _0x583d99;})[_0xc933('0x20')](respondWithResult(_0x5a3f7e,0xc9))[_0xc933('0x29')](handleError(_0x5a3f7e,null));};exports[_0xc933('0x35')]=function(_0x5b21d7,_0xc02ec0){if(_0x5b21d7[_0xc933('0x65')]['id']){delete _0x5b21d7['body']['id'];}return db[_0xc933('0x40')][_0xc933('0x5d')]({'where':{'id':_0x5b21d7[_0xc933('0x66')]['id']},'include':[{'model':db[_0xc933('0x3f')],'as':_0xc933('0x5a')}]})[_0xc933('0x20')](handleEntityNotFound(_0xc02ec0,null))[_0xc933('0x20')](saveUpdates(_0x5b21d7[_0xc933('0x65')],null))[_0xc933('0x20')](respondWithResult(_0xc02ec0,null))['catch'](handleError(_0xc02ec0,null));};exports[_0xc933('0x36')]=function(_0xca7a9e,_0x544887){return db[_0xc933('0x40')]['find']({'where':{'id':_0xca7a9e[_0xc933('0x66')]['id']}})[_0xc933('0x20')](handleEntityNotFound(_0x544887,null))['then'](removeEntity(_0x544887,null))[_0xc933('0x29')](handleError(_0x544887,null));};exports[_0xc933('0x67')]=function(_0xf2efbe,_0x2d01e7){return db[_0xc933('0x40')][_0xc933('0x67')]()[_0xc933('0x20')](respondWithResult(_0x2d01e7,null))['catch'](handleError(_0x2d01e7,null));};exports[_0xc933('0x68')]=function(_0x32eef3,_0x57ea90,_0xb3ea8d){if(_0x32eef3[_0xc933('0x65')]['id']){delete _0x32eef3[_0xc933('0x65')]['id'];}return db[_0xc933('0x40')][_0xc933('0x5d')]({'where':{'id':_0x32eef3[_0xc933('0x66')]['id']}})[_0xc933('0x20')](handleEntityNotFound(_0x57ea90,null))['then'](function(_0x5dbd81){if(_0x5dbd81){_0x32eef3[_0xc933('0x65')][_0xc933('0x69')]=_0x5dbd81['id'];return db[_0xc933('0x6a')][_0xc933('0x5e')](_0x32eef3[_0xc933('0x65')]);}})[_0xc933('0x20')](respondWithResult(_0x57ea90,null))['catch'](handleError(_0x57ea90,null));};exports[_0xc933('0x6b')]=function(_0x1a2521,_0x143c0f,_0x3aefad){var _0x319677={'raw':![],'where':{}};var _0x1c0704={};var _0x3285b7={'count':0x0,'rows':[]};return db['OpenchannelAccount'][_0xc933('0x6c')]({'where':{'id':_0x1a2521['params']['id']}})[_0xc933('0x20')](handleEntityNotFound(_0x143c0f,null))['then'](function(_0xa897e){if(_0xa897e){_0x1c0704[_0xc933('0x48')]=_['keys'](db[_0xc933('0x6a')][_0xc933('0x5c')]);_0x1c0704['query']=_[_0xc933('0x5b')](_0x1a2521[_0xc933('0x45')]);_0x1c0704[_0xc933('0x46')]=_[_0xc933('0x47')](_0x1c0704[_0xc933('0x48')],_0x1c0704[_0xc933('0x45')]);_0x319677[_0xc933('0x49')]=_[_0xc933('0x47')](_0x1c0704['model'],qs[_0xc933('0x4a')](_0x1a2521['query'][_0xc933('0x4a')]));_0x319677['attributes']=_0x319677[_0xc933('0x49')][_0xc933('0x4b')]?_0x319677[_0xc933('0x49')]:_0x1c0704[_0xc933('0x48')];if(!_0x1a2521[_0xc933('0x45')][_0xc933('0x4c')](_0xc933('0x4d'))){_0x319677['limit']=qs[_0xc933('0x2d')](_0x1a2521[_0xc933('0x45')][_0xc933('0x2d')]);_0x319677[_0xc933('0x2f')]=qs['offset'](_0x1a2521[_0xc933('0x45')][_0xc933('0x2f')]);}_0x319677[_0xc933('0x4e')]=qs[_0xc933('0x4f')](_0x1a2521[_0xc933('0x45')]['sort']);_0x319677[_0xc933('0x50')]=qs[_0xc933('0x46')](_[_0xc933('0x51')](_0x1a2521[_0xc933('0x45')],_0x1c0704[_0xc933('0x46')]));_0x319677['where']['OpenchannelAccountId']=_0xa897e['id'];if(_0x1a2521[_0xc933('0x45')]['filter']){_0x319677[_0xc933('0x50')]=_[_0xc933('0x53')](_0x319677['where'],{'$or':_[_0xc933('0x44')](_0x319677[_0xc933('0x49')],function(_0x46c24c){var _0x3ccce3={};_0x3ccce3[_0x46c24c]={'$like':'%'+_0x1a2521[_0xc933('0x45')]['filter']+'%'};return _0x3ccce3;})});}_0x319677=_['merge']({},_0x319677,_0x1a2521[_0xc933('0x54')]);return db[_0xc933('0x6a')]['count']({'where':_0x319677[_0xc933('0x50')]})[_0xc933('0x20')](function(_0x45a4c5){_0x3285b7[_0xc933('0x2e')]=_0x45a4c5;if(_0x1a2521[_0xc933('0x45')][_0xc933('0x55')]){_0x319677[_0xc933('0x56')]=[{'all':!![]}];}return db['Disposition'][_0xc933('0x57')](_0x319677);})[_0xc933('0x20')](function(_0xedbdb1){_0x3285b7['rows']=_0xedbdb1;return _0x3285b7;});}})[_0xc933('0x20')](respondWithFilteredResult(_0x143c0f,_0x319677))[_0xc933('0x29')](handleError(_0x143c0f,null));};exports['removeDispositions']=function(_0x4439ee,_0x4df710,_0x12174f){return db[_0xc933('0x40')][_0xc933('0x5d')]({'where':{'id':_0x4439ee[_0xc933('0x66')]['id']}})[_0xc933('0x20')](handleEntityNotFound(_0x4df710,null))[_0xc933('0x20')](function(_0x4a42ec){if(_0x4a42ec){return _0x4a42ec[_0xc933('0x6d')](_0x4439ee[_0xc933('0x45')][_0xc933('0x6e')]);}})[_0xc933('0x20')](respondWithStatusCode(_0x4df710,null))[_0xc933('0x29')](handleError(_0x4df710,null));};exports[_0xc933('0x6f')]=function(_0x33a263,_0x5eb105,_0x1af35e){if(_0x33a263[_0xc933('0x65')]['id']){delete _0x33a263[_0xc933('0x65')]['id'];}return db[_0xc933('0x40')]['find']({'where':{'id':_0x33a263[_0xc933('0x66')]['id']}})[_0xc933('0x20')](handleEntityNotFound(_0x5eb105,null))[_0xc933('0x20')](function(_0xf36671){if(_0xf36671){_0x33a263[_0xc933('0x65')][_0xc933('0x69')]=_0xf36671['id'];return db[_0xc933('0x70')][_0xc933('0x5e')](_0x33a263[_0xc933('0x65')]);}})[_0xc933('0x20')](respondWithResult(_0x5eb105,null))[_0xc933('0x29')](handleError(_0x5eb105,null));};exports[_0xc933('0x71')]=function(_0x282731,_0x33d2e0,_0x3b0f18){var _0x190f4a={'raw':![],'where':{}};var _0x4bae4a={};var _0xb40750={'count':0x0,'rows':[]};return db[_0xc933('0x40')][_0xc933('0x6c')]({'where':{'id':_0x282731[_0xc933('0x66')]['id']}})[_0xc933('0x20')](handleEntityNotFound(_0x33d2e0,null))[_0xc933('0x20')](function(_0x2d219a){if(_0x2d219a){_0x4bae4a[_0xc933('0x48')]=_[_0xc933('0x5b')](db[_0xc933('0x70')]['rawAttributes']);_0x4bae4a[_0xc933('0x45')]=_[_0xc933('0x5b')](_0x282731[_0xc933('0x45')]);_0x4bae4a[_0xc933('0x46')]=_[_0xc933('0x47')](_0x4bae4a[_0xc933('0x48')],_0x4bae4a[_0xc933('0x45')]);_0x190f4a['attributes']=_[_0xc933('0x47')](_0x4bae4a[_0xc933('0x48')],qs[_0xc933('0x4a')](_0x282731[_0xc933('0x45')][_0xc933('0x4a')]));_0x190f4a[_0xc933('0x49')]=_0x190f4a['attributes'][_0xc933('0x4b')]?_0x190f4a['attributes']:_0x4bae4a[_0xc933('0x48')];if(!_0x282731[_0xc933('0x45')][_0xc933('0x4c')](_0xc933('0x4d'))){_0x190f4a[_0xc933('0x2d')]=qs[_0xc933('0x2d')](_0x282731[_0xc933('0x45')]['limit']);_0x190f4a[_0xc933('0x2f')]=qs[_0xc933('0x2f')](_0x282731[_0xc933('0x45')]['offset']);}_0x190f4a[_0xc933('0x4e')]=qs[_0xc933('0x4f')](_0x282731['query'][_0xc933('0x4f')]);_0x190f4a[_0xc933('0x50')]=qs[_0xc933('0x46')](_[_0xc933('0x51')](_0x282731[_0xc933('0x45')],_0x4bae4a[_0xc933('0x46')]));_0x190f4a[_0xc933('0x50')]['OpenchannelAccountId']=_0x2d219a['id'];if(_0x282731['query']['filter']){_0x190f4a[_0xc933('0x50')]=_['merge'](_0x190f4a['where'],{'$or':_[_0xc933('0x44')](_0x190f4a[_0xc933('0x49')],function(_0x4989c5){var _0x3f58f5={};_0x3f58f5[_0x4989c5]={'$like':'%'+_0x282731[_0xc933('0x45')][_0xc933('0x52')]+'%'};return _0x3f58f5;})});}_0x190f4a=_[_0xc933('0x53')]({},_0x190f4a,_0x282731['options']);return db[_0xc933('0x70')]['count']({'where':_0x190f4a[_0xc933('0x50')]})[_0xc933('0x20')](function(_0x69336){_0xb40750['count']=_0x69336;if(_0x282731[_0xc933('0x45')][_0xc933('0x55')]){_0x190f4a[_0xc933('0x56')]=[{'all':!![]}];}return db[_0xc933('0x70')][_0xc933('0x57')](_0x190f4a);})['then'](function(_0x16fc0a){_0xb40750['rows']=_0x16fc0a;return _0xb40750;});}})['then'](respondWithFilteredResult(_0x33d2e0,_0x190f4a))[_0xc933('0x29')](handleError(_0x33d2e0,null));};exports[_0xc933('0x72')]=function(_0x52a1a3,_0x30b19f,_0x45aaf5){return db[_0xc933('0x40')][_0xc933('0x5d')]({'where':{'id':_0x52a1a3[_0xc933('0x66')]['id']}})[_0xc933('0x20')](handleEntityNotFound(_0x30b19f,null))[_0xc933('0x20')](function(_0x4d32fe){if(_0x4d32fe){return _0x4d32fe[_0xc933('0x72')](_0x52a1a3[_0xc933('0x45')][_0xc933('0x6e')]);}})[_0xc933('0x20')](respondWithStatusCode(_0x30b19f,null))[_0xc933('0x29')](handleError(_0x30b19f,null));};exports['notify']=function(_0x423074,_0x59e515,_0x204f0f){var _0x137e02={'body':_0x423074[_0xc933('0x65')],'channel':_0xc933('0x73')};var _0x4b4380=[];var _0x9e7db6=[];var _0x37da6f={};var _0x5bfd94=![];return db[_0xc933('0x74')][_0xc933('0x67')]()[_0xc933('0x20')](function(_0x420081){if(!_0x420081){throw new db['Sequelize'][(_0xc933('0x75'))](_0xc933('0x76'));}_0x4b4380=_[_0xc933('0x77')](_['keys'](_0x420081),['createdAt',_0xc933('0x78')]);_0x9e7db6=_[_0xc933('0x77')](_[_0xc933('0x5b')](_0x420081),[_0xc933('0x79'),_0xc933('0x78'),_0xc933('0x7a'),_0xc933('0x7b')]);if(_0x423074['body']['id']){delete _0x423074[_0xc933('0x65')]['id'];}if(_[_0xc933('0x7c')](_0x423074[_0xc933('0x65')]['from'])){throw new db[(_0xc933('0x7d'))][(_0xc933('0x75'))](_0xc933('0x7e'));}if(_['isNil'](_0x423074['body']['body'])||_0x423074[_0xc933('0x65')][_0xc933('0x65')]===''){throw new db[(_0xc933('0x7d'))][(_0xc933('0x75'))]('body\x20is\x20mandatory\x20and\x20not\x20empty');}if(_[_0xc933('0x7c')](_0x423074[_0xc933('0x65')][_0xc933('0x7f')])){throw new db[(_0xc933('0x7d'))][(_0xc933('0x75'))](_0xc933('0x80')+_0x9e7db6);}if(!_[_0xc933('0x81')](_0x9e7db6,_0x423074[_0xc933('0x65')][_0xc933('0x7f')])){throw new db[(_0xc933('0x7d'))]['ValidationError'](_0xc933('0x82')+_0x9e7db6);}_0x37da6f[_0x423074['body']['mapKey']]=_0x423074[_0xc933('0x65')][_0xc933('0x83')];})[_0xc933('0x20')](function(){return db[_0xc933('0x40')]['find']({'where':{'id':_0x423074[_0xc933('0x66')]['id']},'include':[{'model':db[_0xc933('0x84')],'as':'List','include':[{'model':db['CmContact'],'as':_0xc933('0x85'),'where':_0x37da6f,'limit':0x1,'order':[[_0xc933('0x78'),_0xc933('0x86')]]}]},{'model':db[_0xc933('0x87')],'as':'Applications'}]});})[_0xc933('0x20')](handleEntityNotFound(_0x59e515,null))[_0xc933('0x20')](function(_0x20c47a){if(_0x20c47a&&_0x20c47a[_0xc933('0x88')]){_0x137e02['account']=_0x20c47a;_0x137e02[_0xc933('0x89')]=_0x20c47a[_0xc933('0x8a')];_0x137e02[_0xc933('0x8b')]=_0x20c47a['List'];_0x137e02['applications']=_[_0xc933('0x8c')](_0x137e02[_0xc933('0x89')],[_0xc933('0x8d')],[_0xc933('0x8e')]);if(_0x137e02[_0xc933('0x8f')][_0xc933('0x8a')]){delete _0x137e02[_0xc933('0x8f')][_0xc933('0x8a')];}if(_0x137e02[_0xc933('0x8f')]['List']&&_0x137e02['account']['List'][_0xc933('0x85')][_0xc933('0x4b')]){return _0x137e02[_0xc933('0x8f')][_0xc933('0x88')]['Contacts'][0x0];}var _0x2f482c=_[_0xc933('0x18')](_0x423074[_0xc933('0x65')],{'firstName':_0x423074[_0xc933('0x65')][_0xc933('0x83')],'ListId':_0x20c47a[_0xc933('0x7b')]});_0x2f482c[_0x423074[_0xc933('0x65')][_0xc933('0x7f')]]=_0x423074[_0xc933('0x65')]['from'];return db[_0xc933('0x74')][_0xc933('0x5e')](_0x2f482c,{'fields':_0x4b4380,'raw':!![]});}})['then'](handleEntityNotFound(_0x59e515,null))[_0xc933('0x20')](function(_0x28dbf6){_0x137e02[_0xc933('0x90')]=_0x28dbf6;if(_0x28dbf6){var _0x24839b={'ContactId':_0x28dbf6['id'],'OpenchannelAccountId':_0x423074[_0xc933('0x66')]['id'],'from':(_0x28dbf6[_0xc933('0x91')]||'')+'\x20'+(_0x28dbf6[_0xc933('0x92')]||'')};var _0x5de9d1={'OpenchannelAccountId':_0x423074[_0xc933('0x66')]['id'],'closed':![]};if(_0x423074[_0xc933('0x65')][_0xc933('0x93')]){_0x5de9d1[_0xc933('0x93')]=_0x423074[_0xc933('0x65')]['threadId'];return db[_0xc933('0x94')][_0xc933('0x5d')]({'where':_0x5de9d1})[_0xc933('0x20')](function(_0x191cce){if(_0x191cce){return[_0x191cce,![]];}_0x24839b[_0xc933('0x93')]=_0x423074[_0xc933('0x65')]['threadId'];_0x24839b['externalUrl']=_0x423074[_0xc933('0x65')][_0xc933('0x95')];return db[_0xc933('0x94')][_0xc933('0x5e')](_0x24839b)[_0xc933('0x20')](function(_0x56d032){return[_0x56d032,!![]];});});}else{_0x5de9d1[_0xc933('0x93')]=null;}_0x5de9d1['ContactId']=_0x28dbf6['id'];return db[_0xc933('0x94')][_0xc933('0x5d')]({'where':_0x5de9d1})[_0xc933('0x20')](function(_0x21b064){if(_0x21b064){return[_0x21b064,![]];}return db['OpenchannelInteraction'][_0xc933('0x5e')](_0x24839b)[_0xc933('0x20')](function(_0x2946a7){return[_0x2946a7,!![]];});});}})[_0xc933('0x96')](function(_0x24fa4c,_0x262285){if(_0x24fa4c){_0x5bfd94=_0x262285;if(!_0x262285){var _0x3402e6={'from':(_0x137e02['contact'][_0xc933('0x91')]||'')+'\x20'+(_0x137e02[_0xc933('0x90')][_0xc933('0x92')]||'')};if(_0x423074['body'][_0xc933('0x93')]&&_0x423074[_0xc933('0x65')][_0xc933('0x97')]&&_0x423074[_0xc933('0x65')][_0xc933('0x93')]!=_0x423074['body'][_0xc933('0x97')]){_0x3402e6[_0xc933('0x93')]=_0x423074[_0xc933('0x65')][_0xc933('0x97')];}return _0x24fa4c[_0xc933('0x35')](_0x3402e6);}else{return _0x24fa4c;}}})[_0xc933('0x20')](function(_0x29dbc5){_0x137e02[_0xc933('0x98')]=_0x29dbc5['get']({'plain':!![]});_0x137e02[_0xc933('0x98')][_0xc933('0x99')]=_0x5bfd94;if(_0x137e02[_0xc933('0x98')][_0xc933('0x99')]){if(_0x137e02[_0xc933('0x8f')][_0xc933('0x9a')]){_0x137e02[_0xc933('0x89')][_0xc933('0x9b')]({'id':0x0,'priority':_0x137e02['applications'][_0xc933('0x4b')]+0x1,'app':_0xc933('0x9c'),'appdata':'unmanaged','interval':_0xc933('0x9d')});}}return db[_0xc933('0x9e')][_0xc933('0x5e')]({'body':_0x423074[_0xc933('0x65')][_0xc933('0x65')],'OpenchannelAccountId':_0x423074['params']['id'],'OpenchannelInteractionId':_0x29dbc5['id'],'direction':'in','ContactId':_0x137e02['contact']['id'],'AttachmentId':_0x423074['body'][_0xc933('0x9f')]});})['then'](function(_0x1f7709){_0x137e02[_0xc933('0x28')]=_0x1f7709;if(!_0x137e02[_0xc933('0x98')][_0xc933('0xa0')])return;return db[_0xc933('0xa1')][_0xc933('0x5d')]({'attributes':['id',_0xc933('0x3c')],'where':{'id':_0x137e02['interaction']['UserId']}});})[_0xc933('0x20')](function(_0x4b8a16){if(_0x4b8a16){_0x137e02[_0xc933('0x89')][_0xc933('0xa2')]({'id':0x0,'priority':0x0,'app':'agent','appdata':_0x4b8a16[_0xc933('0x3c')]+','+(_0x137e02[_0xc933('0x8f')]['waitForTheAssignedAgent']||0xa),'interval':_0xc933('0x9d')});}if(!_0x137e02['interaction'][_0xc933('0xa3')])return;return db[_0xc933('0xa4')][_0xc933('0x5d')]({'attributes':['id','name'],'where':{'id':_0x137e02[_0xc933('0x98')]['queueId']}});})[_0xc933('0x20')](function(_0x309872){if(_0x309872){_0x137e02[_0xc933('0x89')][_0xc933('0xa2')]({'id':0x0,'priority':0x1,'app':_0xc933('0xa5'),'appdata':_0x309872[_0xc933('0x3c')]+','+(_0x137e02['account'][_0xc933('0xa6')]||0x12c),'interval':'*,*,*,*'});}return respondWithRpcPromise(_0xc933('0xa7'),_0xc933('0xa8'),_0x137e02);})[_0xc933('0x20')](function(_0x5922bc){respondWithRpcPromise(_0xc933('0xa9'),_0xc933('0xa9'),{'event':'notify','message':_0x5922bc},client9002);return _0x5922bc;})[_0xc933('0x20')](respondWithResult(_0x59e515,null))['catch'](handleError(_0x59e515,null));};exports[_0xc933('0xaa')]=function(_0x32538e,_0x4b6c04){var _0x11e3c8=_0x32538e[_0xc933('0x66')]['id'];var _0x26638d=_0x32538e[_0xc933('0x65')];var _0x2ce7b2=0xc8;var _0x3df96c=null;return db[_0xc933('0xab')]['transaction']({'isolationLevel':db[_0xc933('0xab')][_0xc933('0xac')][_0xc933('0xad')][_0xc933('0xae')]},function(_0x432f4d){return db[_0xc933('0x40')][_0xc933('0x6c')]({'where':{'id':_0x11e3c8},'transaction':_0x432f4d})[_0xc933('0x20')](function(_0x40c1c1){if(_0x40c1c1){return db[_0xc933('0x87')][_0xc933('0x36')]({'where':{'OpenchannelAccountId':_0x11e3c8},'transaction':_0x432f4d})['then'](function(){var _0x153ea8=_[_0xc933('0x44')](_0x26638d,function(_0x3d42b7){_0x3d42b7[_0xc933('0x69')]=_0x11e3c8;return _0x3d42b7;});return db[_0xc933('0x87')][_0xc933('0xaf')](_0x153ea8,{'transaction':_0x432f4d});});}else{_0x2ce7b2=0x194;_0x3df96c=[];}});})[_0xc933('0x20')](function(){if(_0x2ce7b2!==0x194){return db['OpenchannelApplication'][_0xc933('0xb0')]({'where':{'OpenchannelAccountId':_0x11e3c8},'order':'priority'})[_0xc933('0x20')](function(_0x55b73b){_0x3df96c=_0x55b73b;});}})[_0xc933('0x29')](function(_0x5d463d){_0x2ce7b2=0x1f4;logger[_0xc933('0x26')](_0x5d463d['stack']);if(_0x5d463d['name']){delete _0x5d463d['name'];}_0x3df96c=_0x5d463d;})[_0xc933('0xb1')](function(){if(_0x3df96c===null){_0x4b6c04[_0xc933('0x3a')](_0x2ce7b2);}else{if(_0x2ce7b2===0x1f4){_0x4b6c04[_0xc933('0x2a')](_0x2ce7b2)['send'](_0x3df96c);}else{_0x4b6c04[_0xc933('0x2a')](_0x2ce7b2)['json'](_0x3df96c);}}});};exports[_0xc933('0xb2')]=function(_0x5426a7,_0x1682ef,_0x2ec4bd){var _0x98f1c3={};var _0x5c1a5e={};var _0x261d5f;var _0x3a8ddb;return db[_0xc933('0x40')][_0xc933('0x6c')]({'where':{'id':_0x5426a7[_0xc933('0x66')]['id']}})['then'](handleEntityNotFound(_0x1682ef,null))[_0xc933('0x20')](function(_0x4c8c3f){if(_0x4c8c3f){_0x261d5f=_0x4c8c3f;_0x5c1a5e[_0xc933('0x48')]=_[_0xc933('0x5b')](db[_0xc933('0x87')][_0xc933('0x5c')]);_0x5c1a5e['query']=_[_0xc933('0x5b')](_0x5426a7[_0xc933('0x45')]);_0x5c1a5e['filters']=_['intersection'](_0x5c1a5e[_0xc933('0x48')],_0x5c1a5e[_0xc933('0x45')]);_0x98f1c3[_0xc933('0x49')]=_[_0xc933('0x47')](_0x5c1a5e[_0xc933('0x48')],qs[_0xc933('0x4a')](_0x5426a7['query'][_0xc933('0x4a')]));_0x98f1c3['attributes']=_0x98f1c3['attributes']['length']?_0x98f1c3['attributes']:_0x5c1a5e['model'];_0x98f1c3[_0xc933('0x4e')]=qs[_0xc933('0x4f')](_0x5426a7[_0xc933('0x45')][_0xc933('0x4f')]);_0x98f1c3['where']=qs['filters'](_['pick'](_0x5426a7['query'],_0x5c1a5e[_0xc933('0x46')]));if(_0x5426a7[_0xc933('0x45')][_0xc933('0x52')]){_0x98f1c3[_0xc933('0x50')]=_['merge'](_0x98f1c3['where'],{'$or':_[_0xc933('0x44')](_0x98f1c3[_0xc933('0x49')],function(_0x5d1c2b){var _0x37622f={};_0x37622f[_0x5d1c2b]={'$like':'%'+_0x5426a7[_0xc933('0x45')][_0xc933('0x52')]+'%'};return _0x37622f;})});}_0x98f1c3=_[_0xc933('0x53')]({},_0x98f1c3,_0x5426a7['options']);return _0x261d5f[_0xc933('0xb2')](_0x98f1c3);}})[_0xc933('0x20')](function(_0x4b7d01){if(_0x4b7d01){_0x3a8ddb=_0x4b7d01[_0xc933('0x4b')];if(!_0x5426a7[_0xc933('0x45')][_0xc933('0x4c')](_0xc933('0x4d'))){_0x98f1c3[_0xc933('0x2d')]=qs['limit'](_0x5426a7['query'][_0xc933('0x2d')]);_0x98f1c3['offset']=qs[_0xc933('0x2f')](_0x5426a7['query'][_0xc933('0x2f')]);}return _0x261d5f[_0xc933('0xb2')](_0x98f1c3);}})[_0xc933('0x20')](function(_0x148acd){if(_0x148acd){return _0x148acd?{'count':_0x3a8ddb,'rows':_0x148acd}:null;}})['then'](respondWithResult(_0x1682ef,null))['catch'](handleError(_0x1682ef,null));};exports['getInteractions']=function(_0x14f5d2,_0x9b86d9,_0x5b03b8){var _0x111b68={'raw':![],'where':{}};var _0x2c997e={};var _0x5accbb={'count':0x0,'rows':[]};return db[_0xc933('0x40')][_0xc933('0x6c')]({'where':{'id':_0x14f5d2[_0xc933('0x66')]['id']}})[_0xc933('0x20')](handleEntityNotFound(_0x9b86d9,null))[_0xc933('0x20')](function(_0x684c9a){if(_0x684c9a){_0x2c997e['model']=_['keys'](db[_0xc933('0x94')][_0xc933('0x5c')]);_0x2c997e[_0xc933('0x45')]=_[_0xc933('0x5b')](_0x14f5d2[_0xc933('0x45')]);_0x2c997e[_0xc933('0x46')]=_[_0xc933('0x47')](_0x2c997e[_0xc933('0x48')],_0x2c997e[_0xc933('0x45')]);_0x111b68['attributes']=_[_0xc933('0x47')](_0x2c997e[_0xc933('0x48')],qs['fields'](_0x14f5d2[_0xc933('0x45')][_0xc933('0x4a')]));_0x111b68[_0xc933('0x49')]=_0x111b68[_0xc933('0x49')]['length']?_0x111b68[_0xc933('0x49')]:_0x2c997e[_0xc933('0x48')];if(!_0x14f5d2[_0xc933('0x45')]['hasOwnProperty'](_0xc933('0x4d'))){_0x111b68[_0xc933('0x2d')]=qs[_0xc933('0x2d')](_0x14f5d2['query'][_0xc933('0x2d')]);_0x111b68[_0xc933('0x2f')]=qs[_0xc933('0x2f')](_0x14f5d2['query'][_0xc933('0x2f')]);}_0x111b68[_0xc933('0x4e')]=qs[_0xc933('0x4f')](_0x14f5d2[_0xc933('0x45')][_0xc933('0x4f')]);_0x111b68[_0xc933('0x50')]=qs['filters'](_[_0xc933('0x51')](_0x14f5d2['query'],_0x2c997e[_0xc933('0x46')]));_0x111b68['where'][_0xc933('0x69')]=_0x684c9a['id'];if(_0x14f5d2['query'][_0xc933('0x52')]){_0x111b68['where']=_[_0xc933('0x53')](_0x111b68[_0xc933('0x50')],{'$or':_[_0xc933('0x44')](_0x111b68[_0xc933('0x49')],function(_0x23d083){var _0x4a4bee={};_0x4a4bee[_0x23d083]={'$like':'%'+_0x14f5d2[_0xc933('0x45')][_0xc933('0x52')]+'%'};return _0x4a4bee;})});}_0x111b68=_[_0xc933('0x53')]({},_0x111b68,_0x14f5d2[_0xc933('0x54')]);return db[_0xc933('0x94')][_0xc933('0x2e')]({'where':_0x111b68[_0xc933('0x50')]})[_0xc933('0x20')](function(_0x3bd320){_0x5accbb[_0xc933('0x2e')]=_0x3bd320;if(_0x14f5d2[_0xc933('0x45')]['includeAll']){_0x111b68[_0xc933('0x56')]=[{'model':db['CmContact'],'as':_0xc933('0xb3'),'required':![]},{'model':db['User'],'as':_0xc933('0xb4'),'attributes':['name','fullname',_0xc933('0xb5')],'required':![]},{'model':db[_0xc933('0xb6')],'as':_0xc933('0xb7'),'attributes':['id',_0xc933('0x3c'),'color'],'where':_0x14f5d2[_0xc933('0x45')][_0xc933('0xb8')]?{'id':_0x14f5d2[_0xc933('0x45')][_0xc933('0xb8')]}:undefined,'required':_0x14f5d2['query'][_0xc933('0xb8')]?!![]:![]}];}return db[_0xc933('0x94')][_0xc933('0x57')](_0x111b68);})[_0xc933('0x20')](function(_0x4a261d){_0x5accbb[_0xc933('0x58')]=_0x4a261d;return _0x5accbb;});}})[_0xc933('0x20')](respondWithFilteredResult(_0x9b86d9,_0x111b68))[_0xc933('0x29')](handleError(_0x9b86d9,null));};exports[_0xc933('0xb9')]=function(_0x395e0a,_0x39e4ee,_0x2af5bf){return db['OpenchannelAccount'][_0xc933('0x5d')]({'where':{'id':_0x395e0a[_0xc933('0x66')]['id']}})[_0xc933('0x20')](handleEntityNotFound(_0x39e4ee,null))[_0xc933('0x20')](function(_0x5569db){if(_0x5569db){return _0x5569db[_0xc933('0xb9')](_0x395e0a[_0xc933('0x65')][_0xc933('0x6e')],_[_0xc933('0xba')](_0x395e0a[_0xc933('0x65')],['ids','id'])||{})[_0xc933('0x96')](function(_0x28eba4){for(var _0x4d50bf=0x0;_0x4d50bf<_0x395e0a[_0xc933('0x65')][_0xc933('0x6e')][_0xc933('0x4b')];_0x4d50bf+=0x1){socket['emit'](_0xc933('0xbb'),{'UserId':Number(_0x395e0a[_0xc933('0x65')][_0xc933('0x6e')][_0x4d50bf]),'OpenchannelAccountId':Number(_0x395e0a[_0xc933('0x66')]['id'])});}return _0x28eba4;});}})[_0xc933('0x20')](respondWithResult(_0x39e4ee,null))[_0xc933('0x29')](handleError(_0x39e4ee,null));};exports[_0xc933('0xbc')]=function(_0xbaea1b,_0x12bff7,_0x48dd36){return db[_0xc933('0x40')][_0xc933('0x5d')]({'where':{'id':_0xbaea1b[_0xc933('0x66')]['id']}})[_0xc933('0x20')](handleEntityNotFound(_0x12bff7,null))[_0xc933('0x20')](function(_0x35000f){if(_0x35000f){return _0x35000f['removeAgents'](_0xbaea1b['query'][_0xc933('0x6e')])[_0xc933('0x20')](function(){if(_[_0xc933('0xbd')](_0xbaea1b['query'][_0xc933('0x6e')])){for(var _0x207833=0x0;_0x207833<_0xbaea1b['query'][_0xc933('0x6e')][_0xc933('0x4b')];_0x207833+=0x1){socket[_0xc933('0xbe')]('userOpenchannelAccount:remove',{'UserId':Number(_0xbaea1b[_0xc933('0x45')][_0xc933('0x6e')][_0x207833]),'OpenchannelAccountId':Number(_0xbaea1b[_0xc933('0x66')]['id'])});}}else{socket[_0xc933('0xbe')]('userOpenchannelAccount:remove',{'UserId':Number(_0xbaea1b[_0xc933('0x45')]['ids']),'OpenchannelAccountId':Number(_0xbaea1b['params']['id'])});}});}})[_0xc933('0x20')](respondWithStatusCode(_0x12bff7,null))[_0xc933('0x29')](handleError(_0x12bff7,null));};exports[_0xc933('0xbf')]=function(_0x7fc2d,_0x2f9a09,_0x93e9ce){var _0x42634f={};var _0x48bed3={};var _0x42afc6;var _0x34c661;return db[_0xc933('0x40')][_0xc933('0x6c')]({'where':{'id':_0x7fc2d[_0xc933('0x66')]['id']}})[_0xc933('0x20')](handleEntityNotFound(_0x2f9a09,null))[_0xc933('0x20')](function(_0x4aacef){if(_0x4aacef){_0x42afc6=_0x4aacef;_0x48bed3[_0xc933('0x48')]=_[_0xc933('0x5b')](db['User'][_0xc933('0x5c')]);_0x48bed3[_0xc933('0x45')]=_[_0xc933('0x5b')](_0x7fc2d['query']);_0x48bed3['filters']=_[_0xc933('0x47')](_0x48bed3[_0xc933('0x48')],_0x48bed3[_0xc933('0x45')]);_0x42634f[_0xc933('0x49')]=_['intersection'](_0x48bed3[_0xc933('0x48')],qs[_0xc933('0x4a')](_0x7fc2d[_0xc933('0x45')][_0xc933('0x4a')]));_0x42634f[_0xc933('0x49')]=_0x42634f[_0xc933('0x49')][_0xc933('0x4b')]?_0x42634f[_0xc933('0x49')]:_0x48bed3[_0xc933('0x48')];_0x42634f[_0xc933('0x4e')]=qs[_0xc933('0x4f')](_0x7fc2d['query'][_0xc933('0x4f')]);_0x42634f[_0xc933('0x50')]=qs[_0xc933('0x46')](_[_0xc933('0x51')](_0x7fc2d[_0xc933('0x45')],_0x48bed3['filters']));if(_0x7fc2d[_0xc933('0x45')][_0xc933('0x52')]){_0x42634f[_0xc933('0x50')]=_[_0xc933('0x53')](_0x42634f['where'],{'$or':_[_0xc933('0x44')](_0x42634f[_0xc933('0x49')],function(_0x279533){var _0x24132b={};_0x24132b[_0x279533]={'$like':'%'+_0x7fc2d[_0xc933('0x45')]['filter']+'%'};return _0x24132b;})});}_0x42634f=_['merge']({},_0x42634f,_0x7fc2d[_0xc933('0x54')]);return _0x42afc6[_0xc933('0xbf')](_0x42634f);}})[_0xc933('0x20')](function(_0x4e0dde){if(_0x4e0dde){_0x34c661=_0x4e0dde['length'];if(!_0x7fc2d['query'][_0xc933('0x4c')](_0xc933('0x4d'))){_0x42634f[_0xc933('0x2d')]=qs['limit'](_0x7fc2d[_0xc933('0x45')][_0xc933('0x2d')]);_0x42634f['offset']=qs[_0xc933('0x2f')](_0x7fc2d[_0xc933('0x45')][_0xc933('0x2f')]);}return _0x42afc6[_0xc933('0xbf')](_0x42634f);}})[_0xc933('0x20')](function(_0x35c9ab){if(_0x35c9ab){return _0x35c9ab?{'count':_0x34c661,'rows':_0x35c9ab}:null;}})[_0xc933('0x20')](respondWithResult(_0x2f9a09,null))[_0xc933('0x29')](handleError(_0x2f9a09,null));};exports[_0xc933('0x3d')]=function(_0x2cc6d0,_0x34c218,_0x4748f9){var _0x46fe62,_0x58a662,_0x4a38d0;if(_['isNil'](_0x2cc6d0[_0xc933('0x65')]['body'])||_0x2cc6d0[_0xc933('0x65')][_0xc933('0x65')]===''){throw new db[(_0xc933('0x7d'))][(_0xc933('0x75'))](_0xc933('0xc0'));}if(_[_0xc933('0x7c')](_0x2cc6d0[_0xc933('0x65')]['to'])){}_0x46fe62=_0x2cc6d0[_0xc933('0x65')]['to'];return db[_0xc933('0x40')][_0xc933('0x6c')]({'where':{'id':_0x2cc6d0[_0xc933('0x66')]['id']}})['then'](handleEntityNotFound(_0x34c218,null))[_0xc933('0x20')](function(_0x175165){if(_0x175165){return db[_0xc933('0x40')][_0xc933('0x5d')]({'where':{'id':_0x175165['id']},'include':[{'model':db[_0xc933('0x84')],'as':_0xc933('0x88'),'include':[{'model':db[_0xc933('0x74')],'as':_0xc933('0x85'),'where':{[_0x175165[_0xc933('0x7f')]]:_0x46fe62},'limit':0x1,'order':[['updatedAt','DESC']]}]}]})[_0xc933('0x20')](handleEntityNotFound(_0x34c218,null))['then'](function(_0x1b15f8){if(_0x1b15f8&&_0x1b15f8[_0xc933('0x88')]){_0x58a662=_0x1b15f8[_0xc933('0x37')]({'plain':!![]});if(_0x58a662['List']&&_0x58a662[_0xc933('0x88')][_0xc933('0x85')][_0xc933('0x4b')]){return _0x58a662['List'][_0xc933('0x85')][0x0];}return db['CmContact'][_0xc933('0x5e')](_[_0xc933('0x18')](_0x2cc6d0[_0xc933('0x65')],{'firstName':_0x46fe62,[_0x1b15f8[_0xc933('0x7f')]]:_0x46fe62,'phone':_0x46fe62,'ListId':_0x58a662[_0xc933('0x7b')]}));}})[_0xc933('0x20')](handleEntityNotFound(_0x34c218,null))[_0xc933('0x20')](function(_0x56a0d6){if(_0x56a0d6){_0x4a38d0=_0x56a0d6;return db['OpenchannelInteraction'][_0xc933('0x5d')]({'where':{'ContactId':_0x4a38d0['id'],'closed':![],'OpenchannelAccountId':_0x58a662['id']}})[_0xc933('0x20')](function(_0x4818dc){if(_0x4818dc){return[_0x4818dc,![]];}return db[_0xc933('0x94')][_0xc933('0x5e')]({'UserId':_0x2cc6d0[_0xc933('0x5f')]['id'],'ContactId':_0x4a38d0['id'],'OpenchannelAccountId':_0x58a662['id'],'lastMsgDirection':'out','firstMsgDirection':_0xc933('0xc1'),'Messages':[_[_0xc933('0x53')](_0x2cc6d0['body'],{'read':![],'body':_0x2cc6d0[_0xc933('0x65')][_0xc933('0x65')],'OpenchannelAccountId':_0x58a662['id'],'UserId':_0x2cc6d0[_0xc933('0x5f')]['id'],'ContactId':_0x4a38d0['id']})]},{'include':[{'model':db[_0xc933('0x9e')],'as':_0xc933('0xc2')}]})[_0xc933('0x20')](function(_0x202845){return[_0x202845,!![]];});});}})[_0xc933('0x96')](function(_0x4bdf26,_0x4bdf17){if(_0x4bdf17){return _0x4bdf26;}return db[_0xc933('0x9e')][_0xc933('0x5e')](_[_0xc933('0x53')](_0x2cc6d0[_0xc933('0x65')],{'read':![],'body':_0x2cc6d0[_0xc933('0x65')][_0xc933('0x65')],'OpenchannelAccountId':_0x58a662['id'],'OpenchannelInteractionId':_0x4bdf26['id'],'UserId':_0x2cc6d0['user']['id'],'ContactId':_0x4a38d0['id']}))[_0xc933('0x20')](function(_0x1177b5){_0x4bdf26[_0xc933('0xc3')][_0xc933('0xc2')]=[];_0x4bdf26[_0xc933('0xc3')][_0xc933('0xc2')][_0xc933('0x9b')](_0x1177b5[_0xc933('0xc3')]);return _0x4bdf26;});});}})[_0xc933('0x20')](respondWithResult(_0x34c218,null))[_0xc933('0x29')](handleError(_0x34c218,null));}; \ No newline at end of file +var _0xfe91=['READ_COMMITTED','bulkCreate','findAndCountAll','getApplications','Contact','User','Owner','internal','Tag','Tags','color','tag','addAgents','emit','userOpenchannelAccount:save','removeAgents','userOpenchannelAccount:remove','getAgents','out','OpenchannelMessage','Messages','dataValues','push','eml-format','fast-json-patch','moment','bluebird','mustache','util','path','sox','to-csv','fs-extra','lodash','squel','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','redis','defaults','localhost','socket.io-emitter','./openchannelAccount.socket','register','jayson/promise','client','http','request','then','info','request\x20sent','debug','stringify','error','code','message','OpenchannelAccount,\x20%s,\x20%s','result','sendStatus','status','end','json','offset','limit','undefined','count','set','Content-Range','apply','reject','save','update','destroy','get','OpenchannelAccounts','UserProfileResource','stack','name','send','mandatoryDispositionPause','map','OpenchannelAccount','rawAttributes','fieldName','keys','query','filters','intersection','model','attributes','fields','hasOwnProperty','order','sort','where','pick','filter','type','VIRTUAL','merge','options','includeAll','findAll','catch','show','Pause','include','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','userProfileId','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','params','describe','addDisposition','OpenchannelAccountId','Disposition','findOne','length','nolimit','rows','removeDispositions','ids','CannedAnswer','getAnswers','removeAnswers','notify','openchannel','createdAt','updatedAt','difference','CompanyId','ListId','from','Sequelize','from\x20is\x20mandatory','isNil','ValidationError','body\x20is\x20mandatory\x20and\x20not\x20empty','mapKey','mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','includes','mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','CmList','List','CmContact','DESC','OpenchannelApplication','account','applications','Applications','priority','Contacts','contact','firstName','lastName','threadId','OpenchannelInteraction','externalUrl','ContactId','spread','messageId','interaction','created','autoclose','close','unmanaged','*,*,*,*','UserId','unshift','waitForTheAssignedAgent','queueId','queue','waitForTheAssignedQueue','Start','startRouting','EventManager','Transaction','ISOLATION_LEVELS'];(function(_0x4920f2,_0xa4bfbf){var _0x1f27cf=function(_0x4d94ad){while(--_0x4d94ad){_0x4920f2['push'](_0x4920f2['shift']());}};_0x1f27cf(++_0xa4bfbf);}(_0xfe91,0xd4));var _0x1fe9=function(_0x4178af,_0x388652){_0x4178af=_0x4178af-0x0;var _0x20f4b1=_0xfe91[_0x4178af];return _0x20f4b1;};'use strict';var emlformat=require(_0x1fe9('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0x1fe9('0x1'));var rp=require('request-promise');var moment=require(_0x1fe9('0x2'));var BPromise=require(_0x1fe9('0x3'));var Mustache=require(_0x1fe9('0x4'));var util=require(_0x1fe9('0x5'));var path=require(_0x1fe9('0x6'));var sox=require(_0x1fe9('0x7'));var csv=require(_0x1fe9('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x1fe9('0x9'));var _=require(_0x1fe9('0xa'));var squel=require(_0x1fe9('0xb'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x1fe9('0xc'));var toCsv=require(_0x1fe9('0x8'));var querystring=require('querystring');var Papa=require(_0x1fe9('0xd'));var Redis=require(_0x1fe9('0xe'));var authService=require(_0x1fe9('0xf'));var qs=require(_0x1fe9('0x10'));var as=require(_0x1fe9('0x11'));var hardwareService=require(_0x1fe9('0x12'));var logger=require(_0x1fe9('0x13'))(_0x1fe9('0x14'));var utils=require('../../config/utils');var config=require(_0x1fe9('0x15'));var licenseUtil=require(_0x1fe9('0x16'));var db=require('../../mysqldb')['db'];config[_0x1fe9('0x17')]=_[_0x1fe9('0x18')](config[_0x1fe9('0x17')],{'host':_0x1fe9('0x19'),'port':0x18eb});var socket=require(_0x1fe9('0x1a'))(new Redis(config['redis']));require(_0x1fe9('0x1b'))[_0x1fe9('0x1c')](socket);var jayson=require(_0x1fe9('0x1d'));var client=jayson[_0x1fe9('0x1e')]['http']({'port':0x232c});var client9002=jayson[_0x1fe9('0x1e')][_0x1fe9('0x1f')]({'port':0x232a});function respondWithRpcPromise(_0x2f62a8,_0x5da3c1,_0x2d2068,_0x15bfab){return new BPromise(function(_0x827331,_0x5da384){var _0x440e0a=_0x15bfab||client;return _0x440e0a[_0x1fe9('0x20')](_0x2f62a8,_0x2d2068)[_0x1fe9('0x21')](function(_0x4cd11f){logger[_0x1fe9('0x22')]('OpenchannelAccount,\x20%s,\x20%s',_0x5da3c1,_0x1fe9('0x23'));logger[_0x1fe9('0x24')]('OpenchannelAccount,\x20%s,\x20%s,\x20%s',_0x5da3c1,_0x1fe9('0x23'),JSON[_0x1fe9('0x25')](_0x4cd11f));if(_0x4cd11f[_0x1fe9('0x26')]){if(_0x4cd11f[_0x1fe9('0x26')][_0x1fe9('0x27')]===0x1f4){logger[_0x1fe9('0x26')]('OpenchannelAccount,\x20%s,\x20%s',_0x5da3c1,_0x4cd11f[_0x1fe9('0x26')]['message']);return _0x5da384(_0x4cd11f['error'][_0x1fe9('0x28')]);}logger[_0x1fe9('0x26')](_0x1fe9('0x29'),_0x5da3c1,_0x4cd11f[_0x1fe9('0x26')][_0x1fe9('0x28')]);return _0x827331(_0x4cd11f[_0x1fe9('0x26')]['message']);}else{logger[_0x1fe9('0x22')](_0x1fe9('0x29'),_0x5da3c1,'request\x20sent');_0x827331(_0x4cd11f[_0x1fe9('0x2a')][_0x1fe9('0x28')]);}})['catch'](function(_0x2e492f){logger[_0x1fe9('0x26')]('OpenchannelAccount,\x20%s,\x20%s',_0x5da3c1,_0x2e492f);_0x5da384(_0x2e492f);});});}function respondWithStatusCode(_0x35cb4f,_0x44ae36){_0x44ae36=_0x44ae36||0xcc;return function(_0x5206a0){if(_0x5206a0){return _0x35cb4f[_0x1fe9('0x2b')](_0x44ae36);}return _0x35cb4f[_0x1fe9('0x2c')](_0x44ae36)[_0x1fe9('0x2d')]();};}function respondWithResult(_0x477229,_0x36b7f4){_0x36b7f4=_0x36b7f4||0xc8;return function(_0x31cf2b){if(_0x31cf2b){return _0x477229[_0x1fe9('0x2c')](_0x36b7f4)[_0x1fe9('0x2e')](_0x31cf2b);}};}function respondWithFilteredResult(_0xed426c,_0x1828ca){return function(_0x2aea20){if(_0x2aea20){var _0x11f374=typeof _0x1828ca[_0x1fe9('0x2f')]==='undefined'&&typeof _0x1828ca[_0x1fe9('0x30')]===_0x1fe9('0x31');var _0x1d95a5=_0x2aea20[_0x1fe9('0x32')];var _0x216ed4=_0x11f374?0x0:_0x1828ca[_0x1fe9('0x2f')];var _0x4865f9=_0x11f374?_0x2aea20[_0x1fe9('0x32')]:_0x1828ca['offset']+_0x1828ca[_0x1fe9('0x30')];var _0x22b736;if(_0x4865f9>=_0x1d95a5){_0x4865f9=_0x1d95a5;_0x22b736=0xc8;}else{_0x22b736=0xce;}_0xed426c[_0x1fe9('0x2c')](_0x22b736);return _0xed426c[_0x1fe9('0x33')](_0x1fe9('0x34'),_0x216ed4+'-'+_0x4865f9+'/'+_0x1d95a5)[_0x1fe9('0x2e')](_0x2aea20);}return null;};}function patchUpdates(_0x40f53d){return function(_0xfdb4fb){try{jsonpatch[_0x1fe9('0x35')](_0xfdb4fb,_0x40f53d,!![]);}catch(_0x576b7d){return BPromise[_0x1fe9('0x36')](_0x576b7d);}return _0xfdb4fb[_0x1fe9('0x37')]();};}function saveUpdates(_0x54a80e,_0x37fda5){return function(_0x26d5e1){if(_0x26d5e1){return _0x26d5e1[_0x1fe9('0x38')](_0x54a80e)[_0x1fe9('0x21')](function(_0x34a250){return _0x34a250;});}return null;};}function removeEntity(_0x41de31,_0x487fea){return function(_0x5ba591){if(_0x5ba591){return _0x5ba591[_0x1fe9('0x39')]()['then'](function(){var _0x4b14cd=_0x5ba591[_0x1fe9('0x3a')]({'plain':!![]});var _0x266956=_0x1fe9('0x3b');return db[_0x1fe9('0x3c')]['destroy']({'where':{'type':_0x266956,'resourceId':_0x4b14cd['id']}})[_0x1fe9('0x21')](function(){return _0x5ba591;});})['then'](function(){_0x41de31[_0x1fe9('0x2c')](0xcc)[_0x1fe9('0x2d')]();});}};}function handleEntityNotFound(_0x582c23,_0x3288a){return function(_0x58ece6){if(!_0x58ece6){_0x582c23[_0x1fe9('0x2b')](0x194);}return _0x58ece6;};}function handleError(_0x1385cb,_0x444c23){_0x444c23=_0x444c23||0x1f4;return function(_0x527b9e){logger[_0x1fe9('0x26')](_0x527b9e[_0x1fe9('0x3d')]);if(_0x527b9e[_0x1fe9('0x3e')]){delete _0x527b9e['name'];}_0x1385cb[_0x1fe9('0x2c')](_0x444c23)[_0x1fe9('0x3f')](_0x527b9e);};}exports['index']=function(_0x782f5b,_0x36ef35){var _0x3816ee={'include':[{'model':db['Pause'],'as':_0x1fe9('0x40')}]},_0x458ad6={},_0x4716be={'count':0x0,'rows':[]};var _0xcb61ae=_[_0x1fe9('0x41')](db[_0x1fe9('0x42')][_0x1fe9('0x43')],function(_0x31e6b2){return{'name':_0x31e6b2[_0x1fe9('0x44')],'type':_0x31e6b2['type']['key']};});_0x458ad6['model']=_[_0x1fe9('0x41')](_0xcb61ae,'name');_0x458ad6['query']=_[_0x1fe9('0x45')](_0x782f5b[_0x1fe9('0x46')]);_0x458ad6[_0x1fe9('0x47')]=_[_0x1fe9('0x48')](_0x458ad6[_0x1fe9('0x49')],_0x458ad6[_0x1fe9('0x46')]);_0x3816ee[_0x1fe9('0x4a')]=_[_0x1fe9('0x48')](_0x458ad6[_0x1fe9('0x49')],qs[_0x1fe9('0x4b')](_0x782f5b[_0x1fe9('0x46')][_0x1fe9('0x4b')]));_0x3816ee['attributes']=_0x3816ee[_0x1fe9('0x4a')]['length']?_0x3816ee['attributes']:_0x458ad6[_0x1fe9('0x49')];if(!_0x782f5b[_0x1fe9('0x46')][_0x1fe9('0x4c')]('nolimit')){_0x3816ee['limit']=qs[_0x1fe9('0x30')](_0x782f5b[_0x1fe9('0x46')][_0x1fe9('0x30')]);_0x3816ee['offset']=qs[_0x1fe9('0x2f')](_0x782f5b[_0x1fe9('0x46')][_0x1fe9('0x2f')]);}_0x3816ee[_0x1fe9('0x4d')]=qs[_0x1fe9('0x4e')](_0x782f5b[_0x1fe9('0x46')][_0x1fe9('0x4e')]);_0x3816ee[_0x1fe9('0x4f')]=qs[_0x1fe9('0x47')](_[_0x1fe9('0x50')](_0x782f5b[_0x1fe9('0x46')],_0x458ad6[_0x1fe9('0x47')]),_0xcb61ae);if(_0x782f5b[_0x1fe9('0x46')][_0x1fe9('0x51')]){_0x3816ee['where']=_['merge'](_0x3816ee['where'],{'$or':_[_0x1fe9('0x41')](_0xcb61ae,function(_0x4499f8){if(_0x4499f8[_0x1fe9('0x52')]!==_0x1fe9('0x53')){var _0x298ee8={};_0x298ee8[_0x4499f8[_0x1fe9('0x3e')]]={'$like':'%'+_0x782f5b[_0x1fe9('0x46')][_0x1fe9('0x51')]+'%'};return _0x298ee8;}})});}_0x3816ee=_[_0x1fe9('0x54')]({},_0x3816ee,_0x782f5b[_0x1fe9('0x55')]);var _0x3f9a18={'where':_0x3816ee[_0x1fe9('0x4f')]};return db[_0x1fe9('0x42')][_0x1fe9('0x32')](_0x3f9a18)[_0x1fe9('0x21')](function(_0x3422c8){_0x4716be['count']=_0x3422c8;if(_0x782f5b[_0x1fe9('0x46')][_0x1fe9('0x56')]){_0x3816ee['include']=[{'all':!![]}];}return db[_0x1fe9('0x42')][_0x1fe9('0x57')](_0x3816ee);})[_0x1fe9('0x21')](function(_0x85d38e){_0x4716be['rows']=_0x85d38e;return _0x4716be;})[_0x1fe9('0x21')](respondWithFilteredResult(_0x36ef35,_0x3816ee))[_0x1fe9('0x58')](handleError(_0x36ef35,null));};exports[_0x1fe9('0x59')]=function(_0x4124eb,_0x2a4c2a){var _0x2e744c={'raw':![],'where':{'id':_0x4124eb['params']['id']},'include':[{'model':db[_0x1fe9('0x5a')],'as':_0x1fe9('0x40')}]},_0x477c44={};_0x477c44['model']=_[_0x1fe9('0x45')](db[_0x1fe9('0x42')][_0x1fe9('0x43')]);_0x477c44[_0x1fe9('0x46')]=_[_0x1fe9('0x45')](_0x4124eb[_0x1fe9('0x46')]);_0x477c44['filters']=_[_0x1fe9('0x48')](_0x477c44[_0x1fe9('0x49')],_0x477c44[_0x1fe9('0x46')]);_0x2e744c[_0x1fe9('0x4a')]=_[_0x1fe9('0x48')](_0x477c44['model'],qs[_0x1fe9('0x4b')](_0x4124eb['query'][_0x1fe9('0x4b')]));_0x2e744c[_0x1fe9('0x4a')]=_0x2e744c[_0x1fe9('0x4a')]['length']?_0x2e744c[_0x1fe9('0x4a')]:_0x477c44[_0x1fe9('0x49')];if(_0x4124eb[_0x1fe9('0x46')][_0x1fe9('0x56')]){_0x2e744c[_0x1fe9('0x5b')]=[{'all':!![]}];}_0x2e744c=_[_0x1fe9('0x54')]({},_0x2e744c,_0x4124eb['options']);return db[_0x1fe9('0x42')][_0x1fe9('0x5c')](_0x2e744c)[_0x1fe9('0x21')](handleEntityNotFound(_0x2a4c2a,null))[_0x1fe9('0x21')](respondWithResult(_0x2a4c2a,null))[_0x1fe9('0x58')](handleError(_0x2a4c2a,null));};exports['create']=function(_0x34efcd,_0x70b4cd){return db[_0x1fe9('0x42')][_0x1fe9('0x5d')](_0x34efcd[_0x1fe9('0x5e')],{})[_0x1fe9('0x21')](function(_0x2ad48c){var _0x434e56=_0x34efcd[_0x1fe9('0x5f')]['get']({'plain':!![]});if(!_0x434e56)throw new Error(_0x1fe9('0x60'));if(_0x434e56['role']===_0x1fe9('0x5f')){var _0x10e9c2=_0x2ad48c[_0x1fe9('0x3a')]({'plain':!![]});var _0x20d399=_0x1fe9('0x3b');return db['UserProfileSection']['find']({'where':{'name':_0x20d399,'userProfileId':_0x434e56[_0x1fe9('0x61')]},'raw':!![]})[_0x1fe9('0x21')](function(_0x4f0551){if(_0x4f0551&&_0x4f0551['autoAssociation']===0x0){return db[_0x1fe9('0x3c')][_0x1fe9('0x5d')]({'name':_0x10e9c2[_0x1fe9('0x3e')],'resourceId':_0x10e9c2['id'],'type':_0x4f0551['name'],'sectionId':_0x4f0551['id']},{})['then'](function(){return _0x2ad48c;});}else{return _0x2ad48c;}})[_0x1fe9('0x58')](function(_0x1f0317){logger[_0x1fe9('0x26')](_0x1fe9('0x62'),_0x1f0317);throw _0x1f0317;});}return _0x2ad48c;})['then'](respondWithResult(_0x70b4cd,0xc9))[_0x1fe9('0x58')](handleError(_0x70b4cd,null));};exports[_0x1fe9('0x38')]=function(_0x4e13cb,_0x12d1cb){if(_0x4e13cb[_0x1fe9('0x5e')]['id']){delete _0x4e13cb[_0x1fe9('0x5e')]['id'];}return db['OpenchannelAccount'][_0x1fe9('0x5c')]({'where':{'id':_0x4e13cb['params']['id']},'include':[{'model':db[_0x1fe9('0x5a')],'as':_0x1fe9('0x40')}]})[_0x1fe9('0x21')](handleEntityNotFound(_0x12d1cb,null))['then'](saveUpdates(_0x4e13cb[_0x1fe9('0x5e')],null))[_0x1fe9('0x21')](respondWithResult(_0x12d1cb,null))[_0x1fe9('0x58')](handleError(_0x12d1cb,null));};exports[_0x1fe9('0x39')]=function(_0x432392,_0x1450cd){return db['OpenchannelAccount'][_0x1fe9('0x5c')]({'where':{'id':_0x432392[_0x1fe9('0x63')]['id']}})['then'](handleEntityNotFound(_0x1450cd,null))['then'](removeEntity(_0x1450cd,null))[_0x1fe9('0x58')](handleError(_0x1450cd,null));};exports[_0x1fe9('0x64')]=function(_0x25cc6d,_0x278ed5){return db[_0x1fe9('0x42')][_0x1fe9('0x64')]()[_0x1fe9('0x21')](respondWithResult(_0x278ed5,null))[_0x1fe9('0x58')](handleError(_0x278ed5,null));};exports[_0x1fe9('0x65')]=function(_0x5e69ab,_0x5e0bf6,_0x10e946){if(_0x5e69ab[_0x1fe9('0x5e')]['id']){delete _0x5e69ab['body']['id'];}return db[_0x1fe9('0x42')][_0x1fe9('0x5c')]({'where':{'id':_0x5e69ab['params']['id']}})[_0x1fe9('0x21')](handleEntityNotFound(_0x5e0bf6,null))[_0x1fe9('0x21')](function(_0x1753d0){if(_0x1753d0){_0x5e69ab[_0x1fe9('0x5e')][_0x1fe9('0x66')]=_0x1753d0['id'];return db[_0x1fe9('0x67')][_0x1fe9('0x5d')](_0x5e69ab[_0x1fe9('0x5e')]);}})[_0x1fe9('0x21')](respondWithResult(_0x5e0bf6,null))[_0x1fe9('0x58')](handleError(_0x5e0bf6,null));};exports['getDispositions']=function(_0x35c519,_0x2e2eb9,_0x3fb7f6){var _0x3c053f={'raw':![],'where':{}};var _0x2e4cf2={};var _0x448732={'count':0x0,'rows':[]};return db[_0x1fe9('0x42')][_0x1fe9('0x68')]({'where':{'id':_0x35c519['params']['id']}})[_0x1fe9('0x21')](handleEntityNotFound(_0x2e2eb9,null))['then'](function(_0x280664){if(_0x280664){_0x2e4cf2[_0x1fe9('0x49')]=_[_0x1fe9('0x45')](db[_0x1fe9('0x67')][_0x1fe9('0x43')]);_0x2e4cf2[_0x1fe9('0x46')]=_[_0x1fe9('0x45')](_0x35c519[_0x1fe9('0x46')]);_0x2e4cf2[_0x1fe9('0x47')]=_['intersection'](_0x2e4cf2[_0x1fe9('0x49')],_0x2e4cf2[_0x1fe9('0x46')]);_0x3c053f[_0x1fe9('0x4a')]=_[_0x1fe9('0x48')](_0x2e4cf2[_0x1fe9('0x49')],qs[_0x1fe9('0x4b')](_0x35c519[_0x1fe9('0x46')][_0x1fe9('0x4b')]));_0x3c053f[_0x1fe9('0x4a')]=_0x3c053f[_0x1fe9('0x4a')][_0x1fe9('0x69')]?_0x3c053f[_0x1fe9('0x4a')]:_0x2e4cf2[_0x1fe9('0x49')];if(!_0x35c519[_0x1fe9('0x46')][_0x1fe9('0x4c')](_0x1fe9('0x6a'))){_0x3c053f[_0x1fe9('0x30')]=qs['limit'](_0x35c519[_0x1fe9('0x46')][_0x1fe9('0x30')]);_0x3c053f[_0x1fe9('0x2f')]=qs['offset'](_0x35c519[_0x1fe9('0x46')]['offset']);}_0x3c053f[_0x1fe9('0x4d')]=qs['sort'](_0x35c519[_0x1fe9('0x46')][_0x1fe9('0x4e')]);_0x3c053f[_0x1fe9('0x4f')]=qs[_0x1fe9('0x47')](_[_0x1fe9('0x50')](_0x35c519[_0x1fe9('0x46')],_0x2e4cf2[_0x1fe9('0x47')]));_0x3c053f[_0x1fe9('0x4f')]['OpenchannelAccountId']=_0x280664['id'];if(_0x35c519[_0x1fe9('0x46')][_0x1fe9('0x51')]){_0x3c053f['where']=_['merge'](_0x3c053f[_0x1fe9('0x4f')],{'$or':_[_0x1fe9('0x41')](_0x3c053f[_0x1fe9('0x4a')],function(_0x1d7b7e){var _0x405339={};_0x405339[_0x1d7b7e]={'$like':'%'+_0x35c519[_0x1fe9('0x46')]['filter']+'%'};return _0x405339;})});}_0x3c053f=_[_0x1fe9('0x54')]({},_0x3c053f,_0x35c519['options']);return db[_0x1fe9('0x67')][_0x1fe9('0x32')]({'where':_0x3c053f['where']})[_0x1fe9('0x21')](function(_0xca3741){_0x448732[_0x1fe9('0x32')]=_0xca3741;if(_0x35c519[_0x1fe9('0x46')][_0x1fe9('0x56')]){_0x3c053f[_0x1fe9('0x5b')]=[{'all':!![]}];}return db['Disposition'][_0x1fe9('0x57')](_0x3c053f);})[_0x1fe9('0x21')](function(_0x3da35a){_0x448732[_0x1fe9('0x6b')]=_0x3da35a;return _0x448732;});}})[_0x1fe9('0x21')](respondWithFilteredResult(_0x2e2eb9,_0x3c053f))[_0x1fe9('0x58')](handleError(_0x2e2eb9,null));};exports[_0x1fe9('0x6c')]=function(_0x375ca6,_0x14a7e3,_0x1a1680){return db['OpenchannelAccount']['find']({'where':{'id':_0x375ca6[_0x1fe9('0x63')]['id']}})[_0x1fe9('0x21')](handleEntityNotFound(_0x14a7e3,null))[_0x1fe9('0x21')](function(_0x50ac25){if(_0x50ac25){return _0x50ac25[_0x1fe9('0x6c')](_0x375ca6[_0x1fe9('0x46')][_0x1fe9('0x6d')]);}})[_0x1fe9('0x21')](respondWithStatusCode(_0x14a7e3,null))[_0x1fe9('0x58')](handleError(_0x14a7e3,null));};exports['addAnswer']=function(_0x1fbe8c,_0x4246c2,_0x4bb0bc){if(_0x1fbe8c[_0x1fe9('0x5e')]['id']){delete _0x1fbe8c[_0x1fe9('0x5e')]['id'];}return db[_0x1fe9('0x42')][_0x1fe9('0x5c')]({'where':{'id':_0x1fbe8c['params']['id']}})['then'](handleEntityNotFound(_0x4246c2,null))[_0x1fe9('0x21')](function(_0xbc6c06){if(_0xbc6c06){_0x1fbe8c[_0x1fe9('0x5e')]['OpenchannelAccountId']=_0xbc6c06['id'];return db[_0x1fe9('0x6e')][_0x1fe9('0x5d')](_0x1fbe8c['body']);}})['then'](respondWithResult(_0x4246c2,null))['catch'](handleError(_0x4246c2,null));};exports[_0x1fe9('0x6f')]=function(_0x406938,_0x4d19b8,_0xe3770f){var _0x4d04e2={'raw':![],'where':{}};var _0x2fe19c={};var _0x50c38a={'count':0x0,'rows':[]};return db[_0x1fe9('0x42')][_0x1fe9('0x68')]({'where':{'id':_0x406938[_0x1fe9('0x63')]['id']}})[_0x1fe9('0x21')](handleEntityNotFound(_0x4d19b8,null))['then'](function(_0x3d65d3){if(_0x3d65d3){_0x2fe19c[_0x1fe9('0x49')]=_[_0x1fe9('0x45')](db[_0x1fe9('0x6e')]['rawAttributes']);_0x2fe19c[_0x1fe9('0x46')]=_[_0x1fe9('0x45')](_0x406938[_0x1fe9('0x46')]);_0x2fe19c[_0x1fe9('0x47')]=_[_0x1fe9('0x48')](_0x2fe19c[_0x1fe9('0x49')],_0x2fe19c[_0x1fe9('0x46')]);_0x4d04e2[_0x1fe9('0x4a')]=_[_0x1fe9('0x48')](_0x2fe19c[_0x1fe9('0x49')],qs['fields'](_0x406938['query']['fields']));_0x4d04e2[_0x1fe9('0x4a')]=_0x4d04e2[_0x1fe9('0x4a')]['length']?_0x4d04e2['attributes']:_0x2fe19c[_0x1fe9('0x49')];if(!_0x406938[_0x1fe9('0x46')][_0x1fe9('0x4c')](_0x1fe9('0x6a'))){_0x4d04e2[_0x1fe9('0x30')]=qs[_0x1fe9('0x30')](_0x406938[_0x1fe9('0x46')][_0x1fe9('0x30')]);_0x4d04e2[_0x1fe9('0x2f')]=qs[_0x1fe9('0x2f')](_0x406938[_0x1fe9('0x46')][_0x1fe9('0x2f')]);}_0x4d04e2[_0x1fe9('0x4d')]=qs[_0x1fe9('0x4e')](_0x406938[_0x1fe9('0x46')][_0x1fe9('0x4e')]);_0x4d04e2[_0x1fe9('0x4f')]=qs['filters'](_['pick'](_0x406938[_0x1fe9('0x46')],_0x2fe19c[_0x1fe9('0x47')]));_0x4d04e2[_0x1fe9('0x4f')][_0x1fe9('0x66')]=_0x3d65d3['id'];if(_0x406938[_0x1fe9('0x46')][_0x1fe9('0x51')]){_0x4d04e2[_0x1fe9('0x4f')]=_[_0x1fe9('0x54')](_0x4d04e2[_0x1fe9('0x4f')],{'$or':_['map'](_0x4d04e2['attributes'],function(_0x551fdc){var _0x1a7b49={};_0x1a7b49[_0x551fdc]={'$like':'%'+_0x406938[_0x1fe9('0x46')]['filter']+'%'};return _0x1a7b49;})});}_0x4d04e2=_[_0x1fe9('0x54')]({},_0x4d04e2,_0x406938[_0x1fe9('0x55')]);return db[_0x1fe9('0x6e')]['count']({'where':_0x4d04e2[_0x1fe9('0x4f')]})[_0x1fe9('0x21')](function(_0x380fb7){_0x50c38a['count']=_0x380fb7;if(_0x406938[_0x1fe9('0x46')][_0x1fe9('0x56')]){_0x4d04e2['include']=[{'all':!![]}];}return db['CannedAnswer'][_0x1fe9('0x57')](_0x4d04e2);})['then'](function(_0x503f8d){_0x50c38a['rows']=_0x503f8d;return _0x50c38a;});}})[_0x1fe9('0x21')](respondWithFilteredResult(_0x4d19b8,_0x4d04e2))[_0x1fe9('0x58')](handleError(_0x4d19b8,null));};exports['removeAnswers']=function(_0x3cc16e,_0x30db5c,_0x1833cd){return db[_0x1fe9('0x42')][_0x1fe9('0x5c')]({'where':{'id':_0x3cc16e[_0x1fe9('0x63')]['id']}})[_0x1fe9('0x21')](handleEntityNotFound(_0x30db5c,null))[_0x1fe9('0x21')](function(_0x4d98fd){if(_0x4d98fd){return _0x4d98fd[_0x1fe9('0x70')](_0x3cc16e[_0x1fe9('0x46')]['ids']);}})[_0x1fe9('0x21')](respondWithStatusCode(_0x30db5c,null))[_0x1fe9('0x58')](handleError(_0x30db5c,null));};exports[_0x1fe9('0x71')]=function(_0x32d33d,_0x38f19b,_0x457261){var _0x4ca97a={'body':_0x32d33d['body'],'channel':_0x1fe9('0x72')};var _0x19ac9f=[];var _0x2fda2f=[];var _0x996f33={};var _0x4df119=![];return db['CmContact'][_0x1fe9('0x64')]()['then'](function(_0x28d27e){if(!_0x28d27e){throw new db['Sequelize']['ValidationError']('no\x20available\x20attributes');}_0x19ac9f=_['difference'](_[_0x1fe9('0x45')](_0x28d27e),[_0x1fe9('0x73'),_0x1fe9('0x74')]);_0x2fda2f=_[_0x1fe9('0x75')](_[_0x1fe9('0x45')](_0x28d27e),[_0x1fe9('0x73'),_0x1fe9('0x74'),_0x1fe9('0x76'),_0x1fe9('0x77')]);if(_0x32d33d[_0x1fe9('0x5e')]['id']){delete _0x32d33d[_0x1fe9('0x5e')]['id'];}if(_['isNil'](_0x32d33d['body'][_0x1fe9('0x78')])){throw new db[(_0x1fe9('0x79'))]['ValidationError'](_0x1fe9('0x7a'));}if(_[_0x1fe9('0x7b')](_0x32d33d['body'][_0x1fe9('0x5e')])||_0x32d33d[_0x1fe9('0x5e')][_0x1fe9('0x5e')]===''){throw new db[(_0x1fe9('0x79'))][(_0x1fe9('0x7c'))](_0x1fe9('0x7d'));}if(_[_0x1fe9('0x7b')](_0x32d33d['body'][_0x1fe9('0x7e')])){throw new db['Sequelize'][(_0x1fe9('0x7c'))](_0x1fe9('0x7f')+_0x2fda2f);}if(!_[_0x1fe9('0x80')](_0x2fda2f,_0x32d33d[_0x1fe9('0x5e')][_0x1fe9('0x7e')])){throw new db['Sequelize']['ValidationError'](_0x1fe9('0x81')+_0x2fda2f);}_0x996f33[_0x32d33d[_0x1fe9('0x5e')][_0x1fe9('0x7e')]]=_0x32d33d[_0x1fe9('0x5e')]['from'];})[_0x1fe9('0x21')](function(){return db[_0x1fe9('0x42')]['find']({'where':{'id':_0x32d33d[_0x1fe9('0x63')]['id']},'include':[{'model':db[_0x1fe9('0x82')],'as':_0x1fe9('0x83'),'include':[{'model':db[_0x1fe9('0x84')],'as':'Contacts','where':_0x996f33,'limit':0x1,'order':[[_0x1fe9('0x74'),_0x1fe9('0x85')]]}]},{'model':db[_0x1fe9('0x86')],'as':'Applications'}]});})[_0x1fe9('0x21')](handleEntityNotFound(_0x38f19b,null))[_0x1fe9('0x21')](function(_0x29aa02){if(_0x29aa02&&_0x29aa02[_0x1fe9('0x83')]){_0x4ca97a[_0x1fe9('0x87')]=_0x29aa02;_0x4ca97a[_0x1fe9('0x88')]=_0x29aa02[_0x1fe9('0x89')];_0x4ca97a['list']=_0x29aa02[_0x1fe9('0x83')];_0x4ca97a[_0x1fe9('0x88')]=_['orderBy'](_0x4ca97a['applications'],[_0x1fe9('0x8a')],['asc']);if(_0x4ca97a[_0x1fe9('0x87')]['Applications']){delete _0x4ca97a[_0x1fe9('0x87')]['Applications'];}if(_0x4ca97a[_0x1fe9('0x87')][_0x1fe9('0x83')]&&_0x4ca97a[_0x1fe9('0x87')][_0x1fe9('0x83')][_0x1fe9('0x8b')][_0x1fe9('0x69')]){return _0x4ca97a['account'][_0x1fe9('0x83')][_0x1fe9('0x8b')][0x0];}var _0x2782eb=_['defaults'](_0x32d33d[_0x1fe9('0x5e')],{'firstName':_0x32d33d[_0x1fe9('0x5e')][_0x1fe9('0x78')],'ListId':_0x29aa02['ListId']});_0x2782eb[_0x32d33d[_0x1fe9('0x5e')][_0x1fe9('0x7e')]]=_0x32d33d['body'][_0x1fe9('0x78')];return db[_0x1fe9('0x84')][_0x1fe9('0x5d')](_0x2782eb,{'fields':_0x19ac9f,'raw':!![]});}})[_0x1fe9('0x21')](handleEntityNotFound(_0x38f19b,null))[_0x1fe9('0x21')](function(_0x28f6a1){_0x4ca97a[_0x1fe9('0x8c')]=_0x28f6a1;if(_0x28f6a1){var _0x2c1e48={'ContactId':_0x28f6a1['id'],'OpenchannelAccountId':_0x32d33d[_0x1fe9('0x63')]['id'],'from':(_0x28f6a1[_0x1fe9('0x8d')]||'')+'\x20'+(_0x28f6a1[_0x1fe9('0x8e')]||'')};var _0x132a4a={'OpenchannelAccountId':_0x32d33d['params']['id'],'closed':![]};if(_0x32d33d[_0x1fe9('0x5e')]['threadId']){_0x132a4a['threadId']=_0x32d33d[_0x1fe9('0x5e')][_0x1fe9('0x8f')];return db[_0x1fe9('0x90')][_0x1fe9('0x5c')]({'where':_0x132a4a})[_0x1fe9('0x21')](function(_0x45e2e0){if(_0x45e2e0){return[_0x45e2e0,![]];}_0x2c1e48[_0x1fe9('0x8f')]=_0x32d33d[_0x1fe9('0x5e')][_0x1fe9('0x8f')];_0x2c1e48[_0x1fe9('0x91')]=_0x32d33d[_0x1fe9('0x5e')][_0x1fe9('0x91')];return db['OpenchannelInteraction'][_0x1fe9('0x5d')](_0x2c1e48)[_0x1fe9('0x21')](function(_0x86ad30){return[_0x86ad30,!![]];});});}else{_0x132a4a[_0x1fe9('0x8f')]=null;}_0x132a4a[_0x1fe9('0x92')]=_0x28f6a1['id'];return db[_0x1fe9('0x90')][_0x1fe9('0x5c')]({'where':_0x132a4a})[_0x1fe9('0x21')](function(_0x142735){if(_0x142735){return[_0x142735,![]];}return db[_0x1fe9('0x90')][_0x1fe9('0x5d')](_0x2c1e48)[_0x1fe9('0x21')](function(_0x138304){return[_0x138304,!![]];});});}})[_0x1fe9('0x93')](function(_0x2eafad,_0x1cc19a){if(_0x2eafad){_0x4df119=_0x1cc19a;if(!_0x1cc19a){var _0x1bdff8={'from':(_0x4ca97a[_0x1fe9('0x8c')][_0x1fe9('0x8d')]||'')+'\x20'+(_0x4ca97a['contact'][_0x1fe9('0x8e')]||'')};if(_0x32d33d[_0x1fe9('0x5e')][_0x1fe9('0x8f')]&&_0x32d33d[_0x1fe9('0x5e')][_0x1fe9('0x94')]&&_0x32d33d[_0x1fe9('0x5e')][_0x1fe9('0x8f')]!=_0x32d33d[_0x1fe9('0x5e')][_0x1fe9('0x94')]){_0x1bdff8[_0x1fe9('0x8f')]=_0x32d33d[_0x1fe9('0x5e')][_0x1fe9('0x94')];}return _0x2eafad[_0x1fe9('0x38')](_0x1bdff8);}else{return _0x2eafad;}}})[_0x1fe9('0x21')](function(_0x23d27d){_0x4ca97a['interaction']=_0x23d27d[_0x1fe9('0x3a')]({'plain':!![]});_0x4ca97a[_0x1fe9('0x95')]['created']=_0x4df119;if(_0x4ca97a[_0x1fe9('0x95')][_0x1fe9('0x96')]){if(_0x4ca97a[_0x1fe9('0x87')][_0x1fe9('0x97')]){_0x4ca97a[_0x1fe9('0x88')]['push']({'id':0x0,'priority':_0x4ca97a['applications'][_0x1fe9('0x69')]+0x1,'app':_0x1fe9('0x98'),'appdata':_0x1fe9('0x99'),'interval':_0x1fe9('0x9a')});}}return db['OpenchannelMessage'][_0x1fe9('0x5d')]({'body':_0x32d33d['body'][_0x1fe9('0x5e')],'OpenchannelAccountId':_0x32d33d['params']['id'],'OpenchannelInteractionId':_0x23d27d['id'],'direction':'in','ContactId':_0x4ca97a['contact']['id'],'AttachmentId':_0x32d33d[_0x1fe9('0x5e')]['AttachmentId']});})['then'](function(_0x3b5c6a){_0x4ca97a[_0x1fe9('0x28')]=_0x3b5c6a;if(!_0x4ca97a[_0x1fe9('0x95')][_0x1fe9('0x9b')])return;return db['User'][_0x1fe9('0x5c')]({'attributes':['id',_0x1fe9('0x3e')],'where':{'id':_0x4ca97a[_0x1fe9('0x95')][_0x1fe9('0x9b')]}});})[_0x1fe9('0x21')](function(_0x207b2d){if(_0x207b2d){_0x4ca97a[_0x1fe9('0x88')][_0x1fe9('0x9c')]({'id':0x0,'priority':0x0,'app':'agent','appdata':_0x207b2d[_0x1fe9('0x3e')]+','+(_0x4ca97a[_0x1fe9('0x87')][_0x1fe9('0x9d')]||0xa),'interval':'*,*,*,*'});}if(!_0x4ca97a[_0x1fe9('0x95')][_0x1fe9('0x9e')])return;return db['OpenchannelQueue'][_0x1fe9('0x5c')]({'attributes':['id',_0x1fe9('0x3e')],'where':{'id':_0x4ca97a[_0x1fe9('0x95')][_0x1fe9('0x9e')]}});})[_0x1fe9('0x21')](function(_0x917471){if(_0x917471){_0x4ca97a[_0x1fe9('0x88')]['unshift']({'id':0x0,'priority':0x1,'app':_0x1fe9('0x9f'),'appdata':_0x917471['name']+','+(_0x4ca97a[_0x1fe9('0x87')][_0x1fe9('0xa0')]||0x12c),'interval':_0x1fe9('0x9a')});}return respondWithRpcPromise(_0x1fe9('0xa1'),_0x1fe9('0xa2'),_0x4ca97a);})[_0x1fe9('0x21')](function(_0x5dfc86){respondWithRpcPromise(_0x1fe9('0xa3'),_0x1fe9('0xa3'),{'event':_0x1fe9('0x71'),'message':_0x5dfc86},client9002);return _0x5dfc86;})['then'](respondWithResult(_0x38f19b,null))['catch'](handleError(_0x38f19b,null));};exports['addApplications']=function(_0x3d915a,_0x223a60){var _0x1e5617=_0x3d915a[_0x1fe9('0x63')]['id'];var _0x1d7ab1=_0x3d915a['body'];var _0x5440d4=0xc8;var _0x27ad47=null;return db['sequelize']['transaction']({'isolationLevel':db['sequelize'][_0x1fe9('0xa4')][_0x1fe9('0xa5')][_0x1fe9('0xa6')]},function(_0x5a2d4d){return db[_0x1fe9('0x42')]['findOne']({'where':{'id':_0x1e5617},'transaction':_0x5a2d4d})['then'](function(_0x76fccd){if(_0x76fccd){return db['OpenchannelApplication']['destroy']({'where':{'OpenchannelAccountId':_0x1e5617},'transaction':_0x5a2d4d})[_0x1fe9('0x21')](function(){var _0x21906f=_['map'](_0x1d7ab1,function(_0x32fe66){_0x32fe66[_0x1fe9('0x66')]=_0x1e5617;return _0x32fe66;});return db['OpenchannelApplication'][_0x1fe9('0xa7')](_0x21906f,{'transaction':_0x5a2d4d});});}else{_0x5440d4=0x194;_0x27ad47=[];}});})[_0x1fe9('0x21')](function(){if(_0x5440d4!==0x194){return db[_0x1fe9('0x86')][_0x1fe9('0xa8')]({'where':{'OpenchannelAccountId':_0x1e5617},'order':_0x1fe9('0x8a')})['then'](function(_0x1ea2b2){_0x27ad47=_0x1ea2b2;});}})[_0x1fe9('0x58')](function(_0x219022){_0x5440d4=0x1f4;logger[_0x1fe9('0x26')](_0x219022[_0x1fe9('0x3d')]);if(_0x219022[_0x1fe9('0x3e')]){delete _0x219022[_0x1fe9('0x3e')];}_0x27ad47=_0x219022;})['finally'](function(){if(_0x27ad47===null){_0x223a60[_0x1fe9('0x2b')](_0x5440d4);}else{if(_0x5440d4===0x1f4){_0x223a60[_0x1fe9('0x2c')](_0x5440d4)['send'](_0x27ad47);}else{_0x223a60['status'](_0x5440d4)[_0x1fe9('0x2e')](_0x27ad47);}}});};exports[_0x1fe9('0xa9')]=function(_0x22ec6c,_0x241218,_0x12c4d4){var _0xb2357={};var _0x5af377={};var _0xaef05a;var _0x2713a3;return db[_0x1fe9('0x42')][_0x1fe9('0x68')]({'where':{'id':_0x22ec6c[_0x1fe9('0x63')]['id']}})[_0x1fe9('0x21')](handleEntityNotFound(_0x241218,null))['then'](function(_0xe1102a){if(_0xe1102a){_0xaef05a=_0xe1102a;_0x5af377[_0x1fe9('0x49')]=_[_0x1fe9('0x45')](db[_0x1fe9('0x86')][_0x1fe9('0x43')]);_0x5af377[_0x1fe9('0x46')]=_['keys'](_0x22ec6c[_0x1fe9('0x46')]);_0x5af377[_0x1fe9('0x47')]=_['intersection'](_0x5af377[_0x1fe9('0x49')],_0x5af377[_0x1fe9('0x46')]);_0xb2357[_0x1fe9('0x4a')]=_[_0x1fe9('0x48')](_0x5af377[_0x1fe9('0x49')],qs['fields'](_0x22ec6c['query'][_0x1fe9('0x4b')]));_0xb2357[_0x1fe9('0x4a')]=_0xb2357['attributes'][_0x1fe9('0x69')]?_0xb2357[_0x1fe9('0x4a')]:_0x5af377[_0x1fe9('0x49')];_0xb2357[_0x1fe9('0x4d')]=qs[_0x1fe9('0x4e')](_0x22ec6c[_0x1fe9('0x46')][_0x1fe9('0x4e')]);_0xb2357[_0x1fe9('0x4f')]=qs[_0x1fe9('0x47')](_[_0x1fe9('0x50')](_0x22ec6c[_0x1fe9('0x46')],_0x5af377[_0x1fe9('0x47')]));if(_0x22ec6c[_0x1fe9('0x46')]['filter']){_0xb2357['where']=_[_0x1fe9('0x54')](_0xb2357[_0x1fe9('0x4f')],{'$or':_[_0x1fe9('0x41')](_0xb2357[_0x1fe9('0x4a')],function(_0xc1e124){var _0x36420b={};_0x36420b[_0xc1e124]={'$like':'%'+_0x22ec6c['query'][_0x1fe9('0x51')]+'%'};return _0x36420b;})});}_0xb2357=_[_0x1fe9('0x54')]({},_0xb2357,_0x22ec6c[_0x1fe9('0x55')]);return _0xaef05a[_0x1fe9('0xa9')](_0xb2357);}})[_0x1fe9('0x21')](function(_0xa9011){if(_0xa9011){_0x2713a3=_0xa9011['length'];if(!_0x22ec6c[_0x1fe9('0x46')][_0x1fe9('0x4c')](_0x1fe9('0x6a'))){_0xb2357[_0x1fe9('0x30')]=qs[_0x1fe9('0x30')](_0x22ec6c['query']['limit']);_0xb2357[_0x1fe9('0x2f')]=qs[_0x1fe9('0x2f')](_0x22ec6c[_0x1fe9('0x46')][_0x1fe9('0x2f')]);}return _0xaef05a['getApplications'](_0xb2357);}})['then'](function(_0x5815b6){if(_0x5815b6){return _0x5815b6?{'count':_0x2713a3,'rows':_0x5815b6}:null;}})[_0x1fe9('0x21')](respondWithResult(_0x241218,null))[_0x1fe9('0x58')](handleError(_0x241218,null));};exports['getInteractions']=function(_0x316e73,_0xe81508,_0x14e0f1){var _0x1a0372={'raw':![],'where':{}};var _0x1f439d={};var _0x1cbfe7={'count':0x0,'rows':[]};return db[_0x1fe9('0x42')][_0x1fe9('0x68')]({'where':{'id':_0x316e73['params']['id']}})[_0x1fe9('0x21')](handleEntityNotFound(_0xe81508,null))[_0x1fe9('0x21')](function(_0x214340){if(_0x214340){_0x1f439d[_0x1fe9('0x49')]=_[_0x1fe9('0x45')](db['OpenchannelInteraction'][_0x1fe9('0x43')]);_0x1f439d['query']=_['keys'](_0x316e73[_0x1fe9('0x46')]);_0x1f439d['filters']=_['intersection'](_0x1f439d['model'],_0x1f439d[_0x1fe9('0x46')]);_0x1a0372['attributes']=_[_0x1fe9('0x48')](_0x1f439d[_0x1fe9('0x49')],qs['fields'](_0x316e73[_0x1fe9('0x46')][_0x1fe9('0x4b')]));_0x1a0372['attributes']=_0x1a0372[_0x1fe9('0x4a')][_0x1fe9('0x69')]?_0x1a0372[_0x1fe9('0x4a')]:_0x1f439d[_0x1fe9('0x49')];if(!_0x316e73[_0x1fe9('0x46')][_0x1fe9('0x4c')](_0x1fe9('0x6a'))){_0x1a0372['limit']=qs['limit'](_0x316e73[_0x1fe9('0x46')]['limit']);_0x1a0372[_0x1fe9('0x2f')]=qs[_0x1fe9('0x2f')](_0x316e73['query'][_0x1fe9('0x2f')]);}_0x1a0372[_0x1fe9('0x4d')]=qs['sort'](_0x316e73['query']['sort']);_0x1a0372[_0x1fe9('0x4f')]=qs['filters'](_['pick'](_0x316e73[_0x1fe9('0x46')],_0x1f439d['filters']));_0x1a0372[_0x1fe9('0x4f')]['OpenchannelAccountId']=_0x214340['id'];if(_0x316e73[_0x1fe9('0x46')]['filter']){_0x1a0372['where']=_['merge'](_0x1a0372[_0x1fe9('0x4f')],{'$or':_[_0x1fe9('0x41')](_0x1a0372[_0x1fe9('0x4a')],function(_0x653eb3){var _0x5b97c2={};_0x5b97c2[_0x653eb3]={'$like':'%'+_0x316e73[_0x1fe9('0x46')][_0x1fe9('0x51')]+'%'};return _0x5b97c2;})});}_0x1a0372=_[_0x1fe9('0x54')]({},_0x1a0372,_0x316e73[_0x1fe9('0x55')]);return db[_0x1fe9('0x90')]['count']({'where':_0x1a0372[_0x1fe9('0x4f')]})[_0x1fe9('0x21')](function(_0x35563f){_0x1cbfe7[_0x1fe9('0x32')]=_0x35563f;if(_0x316e73[_0x1fe9('0x46')][_0x1fe9('0x56')]){_0x1a0372['include']=[{'model':db[_0x1fe9('0x84')],'as':_0x1fe9('0xaa'),'required':![]},{'model':db[_0x1fe9('0xab')],'as':_0x1fe9('0xac'),'attributes':['name','fullname',_0x1fe9('0xad')],'required':![]},{'model':db[_0x1fe9('0xae')],'as':_0x1fe9('0xaf'),'attributes':['id',_0x1fe9('0x3e'),_0x1fe9('0xb0')],'where':_0x316e73[_0x1fe9('0x46')]['tag']?{'id':_0x316e73[_0x1fe9('0x46')][_0x1fe9('0xb1')]}:undefined,'required':_0x316e73['query'][_0x1fe9('0xb1')]?!![]:![]}];}return db[_0x1fe9('0x90')]['findAll'](_0x1a0372);})[_0x1fe9('0x21')](function(_0x407e87){_0x1cbfe7[_0x1fe9('0x6b')]=_0x407e87;return _0x1cbfe7;});}})[_0x1fe9('0x21')](respondWithFilteredResult(_0xe81508,_0x1a0372))[_0x1fe9('0x58')](handleError(_0xe81508,null));};exports['addAgents']=function(_0xa48d4,_0x26a7b8,_0x1e4276){return db[_0x1fe9('0x42')][_0x1fe9('0x5c')]({'where':{'id':_0xa48d4[_0x1fe9('0x63')]['id']}})[_0x1fe9('0x21')](handleEntityNotFound(_0x26a7b8,null))[_0x1fe9('0x21')](function(_0x5797a8){if(_0x5797a8){return _0x5797a8[_0x1fe9('0xb2')](_0xa48d4[_0x1fe9('0x5e')][_0x1fe9('0x6d')],_['omit'](_0xa48d4['body'],[_0x1fe9('0x6d'),'id'])||{})[_0x1fe9('0x93')](function(_0x5580c6){for(var _0x538085=0x0;_0x538085<_0xa48d4[_0x1fe9('0x5e')][_0x1fe9('0x6d')][_0x1fe9('0x69')];_0x538085+=0x1){socket[_0x1fe9('0xb3')](_0x1fe9('0xb4'),{'UserId':Number(_0xa48d4['body'][_0x1fe9('0x6d')][_0x538085]),'OpenchannelAccountId':Number(_0xa48d4[_0x1fe9('0x63')]['id'])});}return _0x5580c6;});}})[_0x1fe9('0x21')](respondWithResult(_0x26a7b8,null))[_0x1fe9('0x58')](handleError(_0x26a7b8,null));};exports[_0x1fe9('0xb5')]=function(_0x2f55a2,_0x18696e,_0x582608){return db[_0x1fe9('0x42')]['find']({'where':{'id':_0x2f55a2[_0x1fe9('0x63')]['id']}})[_0x1fe9('0x21')](handleEntityNotFound(_0x18696e,null))[_0x1fe9('0x21')](function(_0xcdb7cf){if(_0xcdb7cf){return _0xcdb7cf[_0x1fe9('0xb5')](_0x2f55a2[_0x1fe9('0x46')][_0x1fe9('0x6d')])['then'](function(){if(_['isArray'](_0x2f55a2['query']['ids'])){for(var _0x3f6b41=0x0;_0x3f6b41<_0x2f55a2[_0x1fe9('0x46')][_0x1fe9('0x6d')]['length'];_0x3f6b41+=0x1){socket[_0x1fe9('0xb3')](_0x1fe9('0xb6'),{'UserId':Number(_0x2f55a2[_0x1fe9('0x46')]['ids'][_0x3f6b41]),'OpenchannelAccountId':Number(_0x2f55a2[_0x1fe9('0x63')]['id'])});}}else{socket[_0x1fe9('0xb3')]('userOpenchannelAccount:remove',{'UserId':Number(_0x2f55a2[_0x1fe9('0x46')][_0x1fe9('0x6d')]),'OpenchannelAccountId':Number(_0x2f55a2[_0x1fe9('0x63')]['id'])});}});}})['then'](respondWithStatusCode(_0x18696e,null))['catch'](handleError(_0x18696e,null));};exports[_0x1fe9('0xb7')]=function(_0x913f69,_0x268869,_0x161ec5){var _0x3301e7={};var _0x21dfd0={};var _0x50cd8f;var _0xc193b2;return db['OpenchannelAccount'][_0x1fe9('0x68')]({'where':{'id':_0x913f69[_0x1fe9('0x63')]['id']}})[_0x1fe9('0x21')](handleEntityNotFound(_0x268869,null))['then'](function(_0x27ae9f){if(_0x27ae9f){_0x50cd8f=_0x27ae9f;_0x21dfd0['model']=_[_0x1fe9('0x45')](db['User']['rawAttributes']);_0x21dfd0[_0x1fe9('0x46')]=_['keys'](_0x913f69['query']);_0x21dfd0[_0x1fe9('0x47')]=_[_0x1fe9('0x48')](_0x21dfd0[_0x1fe9('0x49')],_0x21dfd0[_0x1fe9('0x46')]);_0x3301e7[_0x1fe9('0x4a')]=_['intersection'](_0x21dfd0['model'],qs['fields'](_0x913f69[_0x1fe9('0x46')][_0x1fe9('0x4b')]));_0x3301e7[_0x1fe9('0x4a')]=_0x3301e7['attributes'][_0x1fe9('0x69')]?_0x3301e7[_0x1fe9('0x4a')]:_0x21dfd0[_0x1fe9('0x49')];_0x3301e7[_0x1fe9('0x4d')]=qs[_0x1fe9('0x4e')](_0x913f69[_0x1fe9('0x46')][_0x1fe9('0x4e')]);_0x3301e7[_0x1fe9('0x4f')]=qs[_0x1fe9('0x47')](_['pick'](_0x913f69[_0x1fe9('0x46')],_0x21dfd0[_0x1fe9('0x47')]));if(_0x913f69['query']['filter']){_0x3301e7[_0x1fe9('0x4f')]=_[_0x1fe9('0x54')](_0x3301e7[_0x1fe9('0x4f')],{'$or':_[_0x1fe9('0x41')](_0x3301e7[_0x1fe9('0x4a')],function(_0x31e3b4){var _0x57288f={};_0x57288f[_0x31e3b4]={'$like':'%'+_0x913f69[_0x1fe9('0x46')]['filter']+'%'};return _0x57288f;})});}_0x3301e7=_[_0x1fe9('0x54')]({},_0x3301e7,_0x913f69[_0x1fe9('0x55')]);return _0x50cd8f[_0x1fe9('0xb7')](_0x3301e7);}})[_0x1fe9('0x21')](function(_0x16dacc){if(_0x16dacc){_0xc193b2=_0x16dacc[_0x1fe9('0x69')];if(!_0x913f69[_0x1fe9('0x46')]['hasOwnProperty'](_0x1fe9('0x6a'))){_0x3301e7['limit']=qs[_0x1fe9('0x30')](_0x913f69[_0x1fe9('0x46')]['limit']);_0x3301e7[_0x1fe9('0x2f')]=qs[_0x1fe9('0x2f')](_0x913f69['query']['offset']);}return _0x50cd8f[_0x1fe9('0xb7')](_0x3301e7);}})[_0x1fe9('0x21')](function(_0x5d4c9e){if(_0x5d4c9e){return _0x5d4c9e?{'count':_0xc193b2,'rows':_0x5d4c9e}:null;}})[_0x1fe9('0x21')](respondWithResult(_0x268869,null))[_0x1fe9('0x58')](handleError(_0x268869,null));};exports[_0x1fe9('0x3f')]=function(_0x113ef6,_0x27e9a9,_0x48faba){var _0x1953c2,_0x5cab2f,_0x5f09ae;if(_[_0x1fe9('0x7b')](_0x113ef6[_0x1fe9('0x5e')][_0x1fe9('0x5e')])||_0x113ef6['body'][_0x1fe9('0x5e')]===''){throw new db[(_0x1fe9('0x79'))][(_0x1fe9('0x7c'))](_0x1fe9('0x7d'));}if(_[_0x1fe9('0x7b')](_0x113ef6[_0x1fe9('0x5e')]['to'])){}_0x1953c2=_0x113ef6[_0x1fe9('0x5e')]['to'];return db['OpenchannelAccount'][_0x1fe9('0x68')]({'where':{'id':_0x113ef6['params']['id']}})[_0x1fe9('0x21')](handleEntityNotFound(_0x27e9a9,null))[_0x1fe9('0x21')](function(_0x23dfed){if(_0x23dfed){return db[_0x1fe9('0x42')][_0x1fe9('0x5c')]({'where':{'id':_0x23dfed['id']},'include':[{'model':db[_0x1fe9('0x82')],'as':_0x1fe9('0x83'),'include':[{'model':db[_0x1fe9('0x84')],'as':_0x1fe9('0x8b'),'where':{[_0x23dfed[_0x1fe9('0x7e')]]:_0x1953c2},'limit':0x1,'order':[['updatedAt',_0x1fe9('0x85')]]}]}]})[_0x1fe9('0x21')](handleEntityNotFound(_0x27e9a9,null))[_0x1fe9('0x21')](function(_0x4aad17){if(_0x4aad17&&_0x4aad17[_0x1fe9('0x83')]){_0x5cab2f=_0x4aad17[_0x1fe9('0x3a')]({'plain':!![]});if(_0x5cab2f[_0x1fe9('0x83')]&&_0x5cab2f[_0x1fe9('0x83')][_0x1fe9('0x8b')][_0x1fe9('0x69')]){return _0x5cab2f['List'][_0x1fe9('0x8b')][0x0];}return db['CmContact'][_0x1fe9('0x5d')](_[_0x1fe9('0x18')](_0x113ef6[_0x1fe9('0x5e')],{'firstName':_0x1953c2,[_0x4aad17['mapKey']]:_0x1953c2,'phone':_0x1953c2,'ListId':_0x5cab2f[_0x1fe9('0x77')]}));}})[_0x1fe9('0x21')](handleEntityNotFound(_0x27e9a9,null))[_0x1fe9('0x21')](function(_0x36012a){if(_0x36012a){_0x5f09ae=_0x36012a;return db[_0x1fe9('0x90')]['find']({'where':{'ContactId':_0x5f09ae['id'],'closed':![],'OpenchannelAccountId':_0x5cab2f['id']}})['then'](function(_0x2d816b){if(_0x2d816b){return[_0x2d816b,![]];}return db[_0x1fe9('0x90')][_0x1fe9('0x5d')]({'UserId':_0x113ef6[_0x1fe9('0x5f')]['id'],'ContactId':_0x5f09ae['id'],'OpenchannelAccountId':_0x5cab2f['id'],'lastMsgDirection':_0x1fe9('0xb8'),'firstMsgDirection':'out','Messages':[_[_0x1fe9('0x54')](_0x113ef6[_0x1fe9('0x5e')],{'read':![],'body':_0x113ef6[_0x1fe9('0x5e')]['body'],'OpenchannelAccountId':_0x5cab2f['id'],'UserId':_0x113ef6[_0x1fe9('0x5f')]['id'],'ContactId':_0x5f09ae['id']})]},{'include':[{'model':db[_0x1fe9('0xb9')],'as':_0x1fe9('0xba')}]})[_0x1fe9('0x21')](function(_0x3b7ab9){return[_0x3b7ab9,!![]];});});}})[_0x1fe9('0x93')](function(_0x1cabc3,_0x28d4a4){if(_0x28d4a4){return _0x1cabc3;}return db[_0x1fe9('0xb9')][_0x1fe9('0x5d')](_[_0x1fe9('0x54')](_0x113ef6['body'],{'read':![],'body':_0x113ef6[_0x1fe9('0x5e')][_0x1fe9('0x5e')],'OpenchannelAccountId':_0x5cab2f['id'],'OpenchannelInteractionId':_0x1cabc3['id'],'UserId':_0x113ef6[_0x1fe9('0x5f')]['id'],'ContactId':_0x5f09ae['id']}))[_0x1fe9('0x21')](function(_0x1cb98c){_0x1cabc3[_0x1fe9('0xbb')][_0x1fe9('0xba')]=[];_0x1cabc3[_0x1fe9('0xbb')][_0x1fe9('0xba')][_0x1fe9('0xbc')](_0x1cb98c[_0x1fe9('0xbb')]);return _0x1cabc3;});});}})['then'](respondWithResult(_0x27e9a9,null))[_0x1fe9('0x58')](handleError(_0x27e9a9,null));}; \ No newline at end of file diff --git a/server/api/openchannelAccount/openchannelAccount.events.js b/server/api/openchannelAccount/openchannelAccount.events.js index af9ac5f..9b655ad 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 _0xa75b=['setMaxListeners','save','update','remove','emit','hasOwnProperty','hook','exports','events'];(function(_0x26063d,_0x5c9abc){var _0x4b2809=function(_0x3e623e){while(--_0x3e623e){_0x26063d['push'](_0x26063d['shift']());}};_0x4b2809(++_0x5c9abc);}(_0xa75b,0x170));var _0xba75=function(_0x2e1d14,_0x28d1c1){_0x2e1d14=_0x2e1d14-0x0;var _0x3fe405=_0xa75b[_0x2e1d14];return _0x3fe405;};'use strict';var EventEmitter=require(_0xba75('0x0'));var OpenchannelAccount=require('../../mysqldb')['db']['OpenchannelAccount'];var OpenchannelAccountEvents=new EventEmitter();OpenchannelAccountEvents[_0xba75('0x1')](0x0);var events={'afterCreate':_0xba75('0x2'),'afterUpdate':_0xba75('0x3'),'afterDestroy':_0xba75('0x4')};function emitEvent(_0x1760c0){return function(_0x336606,_0x152269,_0x398bd5){OpenchannelAccountEvents[_0xba75('0x5')](_0x1760c0+':'+_0x336606['id'],_0x336606);OpenchannelAccountEvents[_0xba75('0x5')](_0x1760c0,_0x336606);_0x398bd5(null);};}for(var e in events){if(events[_0xba75('0x6')](e)){var event=events[e];OpenchannelAccount[_0xba75('0x7')](e,emitEvent(event));}}module[_0xba75('0x8')]=OpenchannelAccountEvents; \ No newline at end of file +var _0xf4eb=['hook','events','update','emit','hasOwnProperty'];(function(_0x4d550a,_0x1ac0b0){var _0x5c2a80=function(_0x344bff){while(--_0x344bff){_0x4d550a['push'](_0x4d550a['shift']());}};_0x5c2a80(++_0x1ac0b0);}(_0xf4eb,0xec));var _0xbf4e=function(_0x456a65,_0x40d301){_0x456a65=_0x456a65-0x0;var _0x3fb836=_0xf4eb[_0x456a65];return _0x3fb836;};'use strict';var EventEmitter=require(_0xbf4e('0x0'));var OpenchannelAccount=require('../../mysqldb')['db']['OpenchannelAccount'];var OpenchannelAccountEvents=new EventEmitter();OpenchannelAccountEvents['setMaxListeners'](0x0);var events={'afterCreate':'save','afterUpdate':_0xbf4e('0x1'),'afterDestroy':'remove'};function emitEvent(_0x4e7fa7){return function(_0x2e3070,_0x1c7606,_0x32d1d7){OpenchannelAccountEvents[_0xbf4e('0x2')](_0x4e7fa7+':'+_0x2e3070['id'],_0x2e3070);OpenchannelAccountEvents[_0xbf4e('0x2')](_0x4e7fa7,_0x2e3070);_0x32d1d7(null);};}for(var e in events){if(events[_0xbf4e('0x3')](e)){var event=events[e];OpenchannelAccount[_0xbf4e('0x4')](e,emitEvent(event));}}module['exports']=OpenchannelAccountEvents; \ No newline at end of file diff --git a/server/api/openchannelAccount/openchannelAccount.model.js b/server/api/openchannelAccount/openchannelAccount.model.js index fbac767..e179a04 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(_0x424332,_0x30d8fd){var _0x19f650=function(_0x57c3da){while(--_0x57c3da){_0x424332['push'](_0x424332['shift']());}};_0x19f650(++_0x30d8fd);}(_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 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(_0x5854e9,_0x2b7169){var _0x2c6ba6=function(_0x1306bf){while(--_0x1306bf){_0x5854e9['push'](_0x5854e9['shift']());}};_0x2c6ba6(++_0x2b7169);}(_0xa9e0,0x123));var _0x0a9e=function(_0x18a79d,_0x57bd2c){_0x18a79d=_0x18a79d-0x0;var _0x4f8848=_0xa9e0[_0x18a79d];return _0x4f8848;};'use strict';var _=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var 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 9866dc2..15b719f 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 _0x7d25=['util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','client','redis','defaults','register','request','then','info','OpenchannelAccount,\x20%s,\x20%s','request\x20sent','debug','OpenchannelAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result'];(function(_0xb33744,_0x1f0251){var _0x4472a0=function(_0x4a323c){while(--_0x4a323c){_0xb33744['push'](_0xb33744['shift']());}};_0x4472a0(++_0x1f0251);}(_0x7d25,0x8a));var _0x57d2=function(_0x565ed7,_0x398228){_0x565ed7=_0x565ed7-0x0;var _0x183ad7=_0x7d25[_0x565ed7];return _0x183ad7;};'use strict';var _=require('lodash');var util=require(_0x57d2('0x0'));var moment=require(_0x57d2('0x1'));var BPromise=require(_0x57d2('0x2'));var rs=require(_0x57d2('0x3'));var fs=require('fs');var Redis=require(_0x57d2('0x4'));var db=require(_0x57d2('0x5'))['db'];var utils=require(_0x57d2('0x6'));var logger=require('../../config/logger')('rpc');var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x57d2('0x7')]['http']({'port':0x232a});config[_0x57d2('0x8')]=_[_0x57d2('0x9')](config[_0x57d2('0x8')],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x57d2('0x8')]));require('./openchannelAccount.socket')[_0x57d2('0xa')](socket);function respondWithRpcPromise(_0x5153c2,_0xa04872,_0x485438){return new BPromise(function(_0x429301,_0x1a86db){return client[_0x57d2('0xb')](_0x5153c2,_0x485438)[_0x57d2('0xc')](function(_0x2e8e12){logger[_0x57d2('0xd')](_0x57d2('0xe'),_0xa04872,_0x57d2('0xf'));logger[_0x57d2('0x10')](_0x57d2('0x11'),_0xa04872,_0x57d2('0xf'),JSON[_0x57d2('0x12')](_0x2e8e12));if(_0x2e8e12[_0x57d2('0x13')]){if(_0x2e8e12[_0x57d2('0x13')][_0x57d2('0x14')]===0x1f4){logger[_0x57d2('0x13')]('OpenchannelAccount,\x20%s,\x20%s',_0xa04872,_0x2e8e12['error'][_0x57d2('0x15')]);return _0x1a86db(_0x2e8e12[_0x57d2('0x13')]['message']);}logger[_0x57d2('0x13')](_0x57d2('0xe'),_0xa04872,_0x2e8e12['error'][_0x57d2('0x15')]);return _0x429301(_0x2e8e12['error'][_0x57d2('0x15')]);}else{logger['info'](_0x57d2('0xe'),_0xa04872,_0x57d2('0xf'));_0x429301(_0x2e8e12[_0x57d2('0x16')]['message']);}})['catch'](function(_0xbaeda8){logger[_0x57d2('0x13')](_0x57d2('0xe'),_0xa04872,_0xbaeda8);_0x1a86db(_0xbaeda8);});});} \ No newline at end of file +var _0x351d=['rpc','jayson/promise','client','http','defaults','redis','socket.io-emitter','request','then','info','debug','OpenchannelAccount,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','OpenchannelAccount,\x20%s,\x20%s','message','catch','lodash','moment','bluebird','randomstring','../../mysqldb','../../config/logger'];(function(_0x14d428,_0x50d3ef){var _0xe165f6=function(_0x2eb1a2){while(--_0x2eb1a2){_0x14d428['push'](_0x14d428['shift']());}};_0xe165f6(++_0x50d3ef);}(_0x351d,0x90));var _0xd351=function(_0x104e62,_0x4c7f28){_0x104e62=_0x104e62-0x0;var _0x51f84c=_0x351d[_0x104e62];return _0x51f84c;};'use strict';var _=require(_0xd351('0x0'));var util=require('util');var moment=require(_0xd351('0x1'));var BPromise=require(_0xd351('0x2'));var rs=require(_0xd351('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xd351('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0xd351('0x5'))(_0xd351('0x6'));var config=require('../../config/environment');var jayson=require(_0xd351('0x7'));var client=jayson[_0xd351('0x8')][_0xd351('0x9')]({'port':0x232a});config['redis']=_[_0xd351('0xa')](config[_0xd351('0xb')],{'host':'localhost','port':0x18eb});var socket=require(_0xd351('0xc'))(new Redis(config[_0xd351('0xb')]));require('./openchannelAccount.socket')['register'](socket);function respondWithRpcPromise(_0x44bf81,_0x4904b4,_0x34cfc7){return new BPromise(function(_0x39b8c8,_0x5949a4){return client[_0xd351('0xd')](_0x44bf81,_0x34cfc7)[_0xd351('0xe')](function(_0x4ebca1){logger[_0xd351('0xf')]('OpenchannelAccount,\x20%s,\x20%s',_0x4904b4,'request\x20sent');logger[_0xd351('0x10')](_0xd351('0x11'),_0x4904b4,_0xd351('0x12'),JSON[_0xd351('0x13')](_0x4ebca1));if(_0x4ebca1['error']){if(_0x4ebca1[_0xd351('0x14')][_0xd351('0x15')]===0x1f4){logger['error'](_0xd351('0x16'),_0x4904b4,_0x4ebca1[_0xd351('0x14')][_0xd351('0x17')]);return _0x5949a4(_0x4ebca1[_0xd351('0x14')][_0xd351('0x17')]);}logger['error'](_0xd351('0x16'),_0x4904b4,_0x4ebca1['error']['message']);return _0x39b8c8(_0x4ebca1[_0xd351('0x14')]['message']);}else{logger[_0xd351('0xf')](_0xd351('0x16'),_0x4904b4,_0xd351('0x12'));_0x39b8c8(_0x4ebca1['result'][_0xd351('0x17')]);}})[_0xd351('0x18')](function(_0x77985a){logger[_0xd351('0x14')]('OpenchannelAccount,\x20%s,\x20%s',_0x4904b4,_0x77985a);_0x5949a4(_0x77985a);});});} \ No newline at end of file diff --git a/server/api/openchannelAccount/openchannelAccount.socket.js b/server/api/openchannelAccount/openchannelAccount.socket.js index 4427d04..dc7ad25 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 _0xfecd=['removeListener','register','length','openchannelAccount:','./openchannelAccount.events','remove','update'];(function(_0x3d3d60,_0x249f5a){var _0xfe2809=function(_0x584ef2){while(--_0x584ef2){_0x3d3d60['push'](_0x3d3d60['shift']());}};_0xfe2809(++_0x249f5a);}(_0xfecd,0x107));var _0xdfec=function(_0x3942e8,_0xd52464){_0x3942e8=_0x3942e8-0x0;var _0x2d98cf=_0xfecd[_0x3942e8];return _0x2d98cf;};'use strict';var OpenchannelAccountEvents=require(_0xdfec('0x0'));var events=['save',_0xdfec('0x1'),_0xdfec('0x2')];function createListener(_0x5a23aa,_0x412b00){return function(_0x2fb9f4){_0x412b00['emit'](_0x5a23aa,_0x2fb9f4);};}function removeListener(_0x46bda1,_0x51658b){return function(){OpenchannelAccountEvents[_0xdfec('0x3')](_0x46bda1,_0x51658b);};}exports[_0xdfec('0x4')]=function(_0x10ca9b){for(var _0x4d0fa6=0x0,_0x2f35a8=events[_0xdfec('0x5')];_0x4d0fa6<_0x2f35a8;_0x4d0fa6++){var _0x40782c=events[_0x4d0fa6];var _0x81175c=createListener(_0xdfec('0x6')+_0x40782c,_0x10ca9b);OpenchannelAccountEvents['on'](_0x40782c,_0x81175c);}}; \ No newline at end of file +var _0x4156=['emit','removeListener','register','./openchannelAccount.events','save','remove','update'];(function(_0x38c814,_0x489779){var _0x5bb0bd=function(_0x16a8fc){while(--_0x16a8fc){_0x38c814['push'](_0x38c814['shift']());}};_0x5bb0bd(++_0x489779);}(_0x4156,0xf1));var _0x6415=function(_0x43572c,_0x3a8377){_0x43572c=_0x43572c-0x0;var _0x39590b=_0x4156[_0x43572c];return _0x39590b;};'use strict';var OpenchannelAccountEvents=require(_0x6415('0x0'));var events=[_0x6415('0x1'),_0x6415('0x2'),_0x6415('0x3')];function createListener(_0x9e13c0,_0x5438c5){return function(_0x138d73){_0x5438c5[_0x6415('0x4')](_0x9e13c0,_0x138d73);};}function removeListener(_0xfd06c2,_0x25732f){return function(){OpenchannelAccountEvents[_0x6415('0x5')](_0xfd06c2,_0x25732f);};}exports[_0x6415('0x6')]=function(_0x192a98){for(var _0x496a42=0x0,_0x24cb0=events['length'];_0x496a42<_0x24cb0;_0x496a42++){var _0x4045ec=events[_0x496a42];var _0x266237=createListener('openchannelAccount:'+_0x4045ec,_0x192a98);OpenchannelAccountEvents['on'](_0x4045ec,_0x266237);}}; \ No newline at end of file diff --git a/server/api/openchannelApplication/index.js b/server/api/openchannelApplication/index.js index 7584523..20b8bc4 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 _0x75f7=['express','Router','../../components/auth/service','../../config/environment','./openchannelApplication.controller','get','isAuthenticated','index','/:id','show','post','put','update','delete','exports','multer','util','path','connect-timeout'];(function(_0x49ab4d,_0x56ef29){var _0x678fed=function(_0x2566d0){while(--_0x2566d0){_0x49ab4d['push'](_0x49ab4d['shift']());}};_0x678fed(++_0x56ef29);}(_0x75f7,0x1ea));var _0x775f=function(_0x260915,_0x1450e7){_0x260915=_0x260915-0x0;var _0x301463=_0x75f7[_0x260915];return _0x301463;};'use strict';var multer=require(_0x775f('0x0'));var util=require(_0x775f('0x1'));var path=require(_0x775f('0x2'));var timeout=require(_0x775f('0x3'));var express=require(_0x775f('0x4'));var router=express[_0x775f('0x5')]();var fs_extra=require('fs-extra');var auth=require(_0x775f('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0x775f('0x7'));var controller=require(_0x775f('0x8'));router[_0x775f('0x9')]('/',auth[_0x775f('0xa')](),controller[_0x775f('0xb')]);router[_0x775f('0x9')](_0x775f('0xc'),auth[_0x775f('0xa')](),controller[_0x775f('0xd')]);router[_0x775f('0xe')]('/',auth['isAuthenticated'](),controller['create']);router[_0x775f('0xf')]('/:id',auth[_0x775f('0xa')](),controller[_0x775f('0x10')]);router[_0x775f('0x11')](_0x775f('0xc'),auth[_0x775f('0xa')](),controller['destroy']);module[_0x775f('0x12')]=router; \ No newline at end of file +var _0x1a49=['../../components/auth/service','../../components/interaction/service','../../config/environment','./openchannelApplication.controller','get','isAuthenticated','show','post','create','delete','/:id','exports','util','path','express','Router','fs-extra'];(function(_0x224c70,_0x33a87f){var _0x3fb760=function(_0x1bfe4a){while(--_0x1bfe4a){_0x224c70['push'](_0x224c70['shift']());}};_0x3fb760(++_0x33a87f);}(_0x1a49,0x72));var _0x91a4=function(_0xad6f8d,_0x232bec){_0xad6f8d=_0xad6f8d-0x0;var _0x59cbc0=_0x1a49[_0xad6f8d];return _0x59cbc0;};'use strict';var multer=require('multer');var util=require(_0x91a4('0x0'));var path=require(_0x91a4('0x1'));var timeout=require('connect-timeout');var express=require(_0x91a4('0x2'));var router=express[_0x91a4('0x3')]();var fs_extra=require(_0x91a4('0x4'));var auth=require(_0x91a4('0x5'));var interaction=require(_0x91a4('0x6'));var config=require(_0x91a4('0x7'));var controller=require(_0x91a4('0x8'));router[_0x91a4('0x9')]('/',auth['isAuthenticated'](),controller['index']);router[_0x91a4('0x9')]('/:id',auth[_0x91a4('0xa')](),controller[_0x91a4('0xb')]);router[_0x91a4('0xc')]('/',auth['isAuthenticated'](),controller[_0x91a4('0xd')]);router['put']('/:id',auth[_0x91a4('0xa')](),controller['update']);router[_0x91a4('0xe')](_0x91a4('0xf'),auth['isAuthenticated'](),controller['destroy']);module[_0x91a4('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 de364e1..3318277 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 _0x84cf=['TEXT','*,*,*,*','INTEGER','STRING','noop'];(function(_0x3f374c,_0xa8508f){var _0x40180b=function(_0x17f97c){while(--_0x17f97c){_0x3f374c['push'](_0x3f374c['shift']());}};_0x40180b(++_0xa8508f);}(_0x84cf,0x13d));var _0xf84c=function(_0x258b00,_0x28e9b0){_0x258b00=_0x258b00-0x0;var _0x3ca676=_0x84cf[_0x258b00];return _0x3ca676;};'use strict';var Sequelize=require('sequelize');module['exports']={'priority':{'type':Sequelize[_0xf84c('0x0')],'allowNull':![]},'app':{'type':Sequelize[_0xf84c('0x1')],'allowNull':![],'defaultValue':_0xf84c('0x2')},'appdata':{'type':Sequelize[_0xf84c('0x3')]()},'description':{'type':Sequelize[_0xf84c('0x1')]},'interval':{'type':Sequelize[_0xf84c('0x1')],'defaultValue':_0xf84c('0x4')}}; \ No newline at end of file +var _0x73f5=['*,*,*,*','sequelize','INTEGER','STRING','noop','TEXT'];(function(_0x24259d,_0x64a194){var _0x5a701=function(_0x204516){while(--_0x204516){_0x24259d['push'](_0x24259d['shift']());}};_0x5a701(++_0x64a194);}(_0x73f5,0xe5));var _0x573f=function(_0x2ff9a,_0x4d2e32){_0x2ff9a=_0x2ff9a-0x0;var _0xb3382f=_0x73f5[_0x2ff9a];return _0xb3382f;};'use strict';var Sequelize=require(_0x573f('0x0'));module['exports']={'priority':{'type':Sequelize[_0x573f('0x1')],'allowNull':![]},'app':{'type':Sequelize[_0x573f('0x2')],'allowNull':![],'defaultValue':_0x573f('0x3')},'appdata':{'type':Sequelize[_0x573f('0x4')]()},'description':{'type':Sequelize[_0x573f('0x2')]},'interval':{'type':Sequelize[_0x573f('0x2')],'defaultValue':_0x573f('0x5')}}; \ No newline at end of file diff --git a/server/api/openchannelApplication/openchannelApplication.controller.js b/server/api/openchannelApplication/openchannelApplication.controller.js index 6a16780..daba582 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 _0xf99d=['merge','VIRTUAL','options','then','include','findAll','rows','catch','show','length','includeAll','find','create','body','params','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','util','sox','to-csv','lodash','squel','jsforce','desk.js','querystring','papaparse','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','sendStatus','status','limit','undefined','count','offset','set','json','save','update','destroy','end','error','stack','name','map','OpenchannelApplication','rawAttributes','fieldName','type','key','model','query','keys','intersection','attributes','fields','hasOwnProperty','order','sort','where','filters','filter'];(function(_0x819464,_0x46fc91){var _0x49dcc0=function(_0x36b2b2){while(--_0x36b2b2){_0x819464['push'](_0x819464['shift']());}};_0x49dcc0(++_0x46fc91);}(_0xf99d,0x1bf));var _0xdf99=function(_0x166742,_0x55520c){_0x166742=_0x166742-0x0;var _0xb7814a=_0xf99d[_0x166742];return _0xb7814a;};'use strict';var emlformat=require(_0xdf99('0x0'));var rimraf=require(_0xdf99('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xdf99('0x2'));var rp=require(_0xdf99('0x3'));var moment=require(_0xdf99('0x4'));var BPromise=require(_0xdf99('0x5'));var Mustache=require(_0xdf99('0x6'));var util=require(_0xdf99('0x7'));var path=require('path');var sox=require(_0xdf99('0x8'));var csv=require(_0xdf99('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xdf99('0xa'));var squel=require(_0xdf99('0xb'));var crypto=require('crypto');var jsforce=require(_0xdf99('0xc'));var deskjs=require(_0xdf99('0xd'));var toCsv=require(_0xdf99('0x9'));var querystring=require(_0xdf99('0xe'));var Papa=require(_0xdf99('0xf'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0xdf99('0x10'));var as=require(_0xdf99('0x11'));var hardwareService=require(_0xdf99('0x12'));var logger=require(_0xdf99('0x13'))(_0xdf99('0x14'));var utils=require(_0xdf99('0x15'));var config=require(_0xdf99('0x16'));var licenseUtil=require(_0xdf99('0x17'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x26e19a,_0x53dd17){_0x53dd17=_0x53dd17||0xcc;return function(_0x2fbc54){if(_0x2fbc54){return _0x26e19a[_0xdf99('0x18')](_0x53dd17);}return _0x26e19a[_0xdf99('0x19')](_0x53dd17)['end']();};}function respondWithResult(_0x133ed0,_0x3f5ae7){_0x3f5ae7=_0x3f5ae7||0xc8;return function(_0x54efd9){if(_0x54efd9){return _0x133ed0[_0xdf99('0x19')](_0x3f5ae7)['json'](_0x54efd9);}};}function respondWithFilteredResult(_0xc7e65c,_0x306916){return function(_0x20c847){if(_0x20c847){var _0x1689e3=typeof _0x306916['offset']==='undefined'&&typeof _0x306916[_0xdf99('0x1a')]===_0xdf99('0x1b');var _0x37cb84=_0x20c847['count'];var _0x48f0bf=_0x1689e3?0x0:_0x306916['offset'];var _0x4af2be=_0x1689e3?_0x20c847[_0xdf99('0x1c')]:_0x306916[_0xdf99('0x1d')]+_0x306916[_0xdf99('0x1a')];var _0x221572;if(_0x4af2be>=_0x37cb84){_0x4af2be=_0x37cb84;_0x221572=0xc8;}else{_0x221572=0xce;}_0xc7e65c[_0xdf99('0x19')](_0x221572);return _0xc7e65c[_0xdf99('0x1e')]('Content-Range',_0x48f0bf+'-'+_0x4af2be+'/'+_0x37cb84)[_0xdf99('0x1f')](_0x20c847);}return null;};}function patchUpdates(_0x14b0aa){return function(_0xfb3da1){try{jsonpatch['apply'](_0xfb3da1,_0x14b0aa,!![]);}catch(_0x4d6cf7){return BPromise['reject'](_0x4d6cf7);}return _0xfb3da1[_0xdf99('0x20')]();};}function saveUpdates(_0x39f8a2,_0x2524df){return function(_0x378354){if(_0x378354){return _0x378354[_0xdf99('0x21')](_0x39f8a2)['then'](function(_0x20c4de){return _0x20c4de;});}return null;};}function removeEntity(_0x4e8799,_0x4fe887){return function(_0x57c046){if(_0x57c046){return _0x57c046[_0xdf99('0x22')]()['then'](function(){_0x4e8799[_0xdf99('0x19')](0xcc)[_0xdf99('0x23')]();});}};}function handleEntityNotFound(_0x45aada,_0x4ddcc8){return function(_0x2d187e){if(!_0x2d187e){_0x45aada['sendStatus'](0x194);}return _0x2d187e;};}function handleError(_0x5ebeca,_0x5b1bd4){_0x5b1bd4=_0x5b1bd4||0x1f4;return function(_0x2193a1){logger[_0xdf99('0x24')](_0x2193a1[_0xdf99('0x25')]);if(_0x2193a1[_0xdf99('0x26')]){delete _0x2193a1[_0xdf99('0x26')];}_0x5ebeca[_0xdf99('0x19')](_0x5b1bd4)['send'](_0x2193a1);};}exports['index']=function(_0x2e26f3,_0x47b020){var _0xf196b0={},_0x222e6a={},_0x2c3520={'count':0x0,'rows':[]};var _0x3b4685=_[_0xdf99('0x27')](db[_0xdf99('0x28')][_0xdf99('0x29')],function(_0x182bd8){return{'name':_0x182bd8[_0xdf99('0x2a')],'type':_0x182bd8[_0xdf99('0x2b')][_0xdf99('0x2c')]};});_0x222e6a[_0xdf99('0x2d')]=_['map'](_0x3b4685,_0xdf99('0x26'));_0x222e6a[_0xdf99('0x2e')]=_[_0xdf99('0x2f')](_0x2e26f3['query']);_0x222e6a['filters']=_[_0xdf99('0x30')](_0x222e6a[_0xdf99('0x2d')],_0x222e6a['query']);_0xf196b0[_0xdf99('0x31')]=_[_0xdf99('0x30')](_0x222e6a[_0xdf99('0x2d')],qs[_0xdf99('0x32')](_0x2e26f3[_0xdf99('0x2e')][_0xdf99('0x32')]));_0xf196b0[_0xdf99('0x31')]=_0xf196b0['attributes']['length']?_0xf196b0[_0xdf99('0x31')]:_0x222e6a['model'];if(!_0x2e26f3['query'][_0xdf99('0x33')]('nolimit')){_0xf196b0[_0xdf99('0x1a')]=qs[_0xdf99('0x1a')](_0x2e26f3[_0xdf99('0x2e')][_0xdf99('0x1a')]);_0xf196b0[_0xdf99('0x1d')]=qs['offset'](_0x2e26f3[_0xdf99('0x2e')][_0xdf99('0x1d')]);}_0xf196b0[_0xdf99('0x34')]=qs['sort'](_0x2e26f3[_0xdf99('0x2e')][_0xdf99('0x35')]);_0xf196b0[_0xdf99('0x36')]=qs[_0xdf99('0x37')](_['pick'](_0x2e26f3[_0xdf99('0x2e')],_0x222e6a['filters']),_0x3b4685);if(_0x2e26f3[_0xdf99('0x2e')][_0xdf99('0x38')]){_0xf196b0[_0xdf99('0x36')]=_[_0xdf99('0x39')](_0xf196b0[_0xdf99('0x36')],{'$or':_[_0xdf99('0x27')](_0x3b4685,function(_0x11ce1c){if(_0x11ce1c[_0xdf99('0x2b')]!==_0xdf99('0x3a')){var _0xa1b124={};_0xa1b124[_0x11ce1c['name']]={'$like':'%'+_0x2e26f3[_0xdf99('0x2e')][_0xdf99('0x38')]+'%'};return _0xa1b124;}})});}_0xf196b0=_['merge']({},_0xf196b0,_0x2e26f3[_0xdf99('0x3b')]);var _0x460ca5={'where':_0xf196b0[_0xdf99('0x36')]};return db['OpenchannelApplication'][_0xdf99('0x1c')](_0x460ca5)[_0xdf99('0x3c')](function(_0x3627e5){_0x2c3520[_0xdf99('0x1c')]=_0x3627e5;if(_0x2e26f3[_0xdf99('0x2e')]['includeAll']){_0xf196b0[_0xdf99('0x3d')]=[{'all':!![]}];}return db[_0xdf99('0x28')][_0xdf99('0x3e')](_0xf196b0);})[_0xdf99('0x3c')](function(_0x5ef773){_0x2c3520[_0xdf99('0x3f')]=_0x5ef773;return _0x2c3520;})[_0xdf99('0x3c')](respondWithFilteredResult(_0x47b020,_0xf196b0))[_0xdf99('0x40')](handleError(_0x47b020,null));};exports[_0xdf99('0x41')]=function(_0x11aa63,_0x1e01a5){var _0xc5b8e1={'raw':!![],'where':{'id':_0x11aa63['params']['id']}},_0x3a770e={};_0x3a770e[_0xdf99('0x2d')]=_[_0xdf99('0x2f')](db['OpenchannelApplication'][_0xdf99('0x29')]);_0x3a770e[_0xdf99('0x2e')]=_[_0xdf99('0x2f')](_0x11aa63[_0xdf99('0x2e')]);_0x3a770e[_0xdf99('0x37')]=_[_0xdf99('0x30')](_0x3a770e['model'],_0x3a770e['query']);_0xc5b8e1[_0xdf99('0x31')]=_[_0xdf99('0x30')](_0x3a770e[_0xdf99('0x2d')],qs[_0xdf99('0x32')](_0x11aa63[_0xdf99('0x2e')][_0xdf99('0x32')]));_0xc5b8e1[_0xdf99('0x31')]=_0xc5b8e1['attributes'][_0xdf99('0x42')]?_0xc5b8e1[_0xdf99('0x31')]:_0x3a770e[_0xdf99('0x2d')];if(_0x11aa63[_0xdf99('0x2e')][_0xdf99('0x43')]){_0xc5b8e1[_0xdf99('0x3d')]=[{'all':!![]}];}_0xc5b8e1=_[_0xdf99('0x39')]({},_0xc5b8e1,_0x11aa63[_0xdf99('0x3b')]);return db[_0xdf99('0x28')][_0xdf99('0x44')](_0xc5b8e1)['then'](handleEntityNotFound(_0x1e01a5,null))['then'](respondWithResult(_0x1e01a5,null))[_0xdf99('0x40')](handleError(_0x1e01a5,null));};exports[_0xdf99('0x45')]=function(_0x1b6797,_0x16787e){return db[_0xdf99('0x28')][_0xdf99('0x45')](_0x1b6797[_0xdf99('0x46')],{})[_0xdf99('0x3c')](respondWithResult(_0x16787e,0xc9))[_0xdf99('0x40')](handleError(_0x16787e,null));};exports['update']=function(_0x1b5662,_0x2e02de){if(_0x1b5662['body']['id']){delete _0x1b5662[_0xdf99('0x46')]['id'];}return db[_0xdf99('0x28')][_0xdf99('0x44')]({'where':{'id':_0x1b5662[_0xdf99('0x47')]['id']}})[_0xdf99('0x3c')](handleEntityNotFound(_0x2e02de,null))[_0xdf99('0x3c')](saveUpdates(_0x1b5662['body'],null))[_0xdf99('0x3c')](respondWithResult(_0x2e02de,null))[_0xdf99('0x40')](handleError(_0x2e02de,null));};exports[_0xdf99('0x22')]=function(_0x266276,_0x27e2a5){return db['OpenchannelApplication']['find']({'where':{'id':_0x266276[_0xdf99('0x47')]['id']}})[_0xdf99('0x3c')](handleEntityNotFound(_0x27e2a5,null))[_0xdf99('0x3c')](removeEntity(_0x27e2a5,null))['catch'](handleError(_0x27e2a5,null));}; \ No newline at end of file +var _0x3108=['bluebird','mustache','util','path','sox','ejs','fs-extra','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','../../mysqldb','status','end','offset','undefined','limit','count','set','Content-Range','json','apply','reject','update','then','destroy','sendStatus','error','index','map','rawAttributes','fieldName','type','query','keys','filters','intersection','model','attributes','fields','length','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','OpenchannelApplication','findAll','rows','catch','show','params','find','create','body','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment'];(function(_0x5f1d13,_0x352dfc){var _0x486fa8=function(_0x278be8){while(--_0x278be8){_0x5f1d13['push'](_0x5f1d13['shift']());}};_0x486fa8(++_0x352dfc);}(_0x3108,0xd8));var _0x8310=function(_0x534b7b,_0x5dbc1d){_0x534b7b=_0x534b7b-0x0;var _0x3469fd=_0x3108[_0x534b7b];return _0x3469fd;};'use strict';var emlformat=require(_0x8310('0x0'));var rimraf=require(_0x8310('0x1'));var zipdir=require(_0x8310('0x2'));var jsonpatch=require(_0x8310('0x3'));var rp=require(_0x8310('0x4'));var moment=require(_0x8310('0x5'));var BPromise=require(_0x8310('0x6'));var Mustache=require(_0x8310('0x7'));var util=require(_0x8310('0x8'));var path=require(_0x8310('0x9'));var sox=require(_0x8310('0xa'));var csv=require('to-csv');var ejs=require(_0x8310('0xb'));var fs=require('fs');var fs_extra=require(_0x8310('0xc'));var _=require('lodash');var squel=require(_0x8310('0xd'));var crypto=require(_0x8310('0xe'));var jsforce=require(_0x8310('0xf'));var deskjs=require(_0x8310('0x10'));var toCsv=require(_0x8310('0x11'));var querystring=require('querystring');var Papa=require(_0x8310('0x12'));var Redis=require(_0x8310('0x13'));var authService=require(_0x8310('0x14'));var qs=require('../../components/parsers/qs');var as=require(_0x8310('0x15'));var hardwareService=require(_0x8310('0x16'));var logger=require(_0x8310('0x17'))(_0x8310('0x18'));var utils=require(_0x8310('0x19'));var config=require('../../config/environment');var licenseUtil=require(_0x8310('0x1a'));var db=require(_0x8310('0x1b'))['db'];function respondWithStatusCode(_0x55eccb,_0x4833c9){_0x4833c9=_0x4833c9||0xcc;return function(_0x41962c){if(_0x41962c){return _0x55eccb['sendStatus'](_0x4833c9);}return _0x55eccb[_0x8310('0x1c')](_0x4833c9)[_0x8310('0x1d')]();};}function respondWithResult(_0x34339e,_0x5abea8){_0x5abea8=_0x5abea8||0xc8;return function(_0x25fa10){if(_0x25fa10){return _0x34339e['status'](_0x5abea8)['json'](_0x25fa10);}};}function respondWithFilteredResult(_0x3f87ff,_0x38652e){return function(_0x2ef446){if(_0x2ef446){var _0x2694a6=typeof _0x38652e[_0x8310('0x1e')]===_0x8310('0x1f')&&typeof _0x38652e[_0x8310('0x20')]===_0x8310('0x1f');var _0x4f022b=_0x2ef446[_0x8310('0x21')];var _0x2ab773=_0x2694a6?0x0:_0x38652e[_0x8310('0x1e')];var _0xd8e02c=_0x2694a6?_0x2ef446['count']:_0x38652e[_0x8310('0x1e')]+_0x38652e[_0x8310('0x20')];var _0xed625c;if(_0xd8e02c>=_0x4f022b){_0xd8e02c=_0x4f022b;_0xed625c=0xc8;}else{_0xed625c=0xce;}_0x3f87ff[_0x8310('0x1c')](_0xed625c);return _0x3f87ff[_0x8310('0x22')](_0x8310('0x23'),_0x2ab773+'-'+_0xd8e02c+'/'+_0x4f022b)[_0x8310('0x24')](_0x2ef446);}return null;};}function patchUpdates(_0x51eb94){return function(_0x404c0a){try{jsonpatch[_0x8310('0x25')](_0x404c0a,_0x51eb94,!![]);}catch(_0xa19403){return BPromise[_0x8310('0x26')](_0xa19403);}return _0x404c0a['save']();};}function saveUpdates(_0x9ecdef,_0x9a1433){return function(_0x56a0d8){if(_0x56a0d8){return _0x56a0d8[_0x8310('0x27')](_0x9ecdef)[_0x8310('0x28')](function(_0x2c9613){return _0x2c9613;});}return null;};}function removeEntity(_0x154883,_0x2b9f05){return function(_0x3b678c){if(_0x3b678c){return _0x3b678c[_0x8310('0x29')]()[_0x8310('0x28')](function(){_0x154883['status'](0xcc)[_0x8310('0x1d')]();});}};}function handleEntityNotFound(_0xcd778e,_0x32bb38){return function(_0x9df518){if(!_0x9df518){_0xcd778e[_0x8310('0x2a')](0x194);}return _0x9df518;};}function handleError(_0x5d60fe,_0x24bbab){_0x24bbab=_0x24bbab||0x1f4;return function(_0x19b70c){logger[_0x8310('0x2b')](_0x19b70c['stack']);if(_0x19b70c['name']){delete _0x19b70c['name'];}_0x5d60fe['status'](_0x24bbab)['send'](_0x19b70c);};}exports[_0x8310('0x2c')]=function(_0x5099b2,_0x3de78e){var _0x890ca9={},_0x53a045={},_0x4ba8fd={'count':0x0,'rows':[]};var _0x30d2f7=_[_0x8310('0x2d')](db['OpenchannelApplication'][_0x8310('0x2e')],function(_0x12344b){return{'name':_0x12344b[_0x8310('0x2f')],'type':_0x12344b[_0x8310('0x30')]['key']};});_0x53a045['model']=_[_0x8310('0x2d')](_0x30d2f7,'name');_0x53a045[_0x8310('0x31')]=_[_0x8310('0x32')](_0x5099b2[_0x8310('0x31')]);_0x53a045[_0x8310('0x33')]=_[_0x8310('0x34')](_0x53a045[_0x8310('0x35')],_0x53a045[_0x8310('0x31')]);_0x890ca9[_0x8310('0x36')]=_[_0x8310('0x34')](_0x53a045[_0x8310('0x35')],qs[_0x8310('0x37')](_0x5099b2[_0x8310('0x31')][_0x8310('0x37')]));_0x890ca9[_0x8310('0x36')]=_0x890ca9[_0x8310('0x36')][_0x8310('0x38')]?_0x890ca9[_0x8310('0x36')]:_0x53a045['model'];if(!_0x5099b2['query']['hasOwnProperty']('nolimit')){_0x890ca9['limit']=qs[_0x8310('0x20')](_0x5099b2[_0x8310('0x31')][_0x8310('0x20')]);_0x890ca9[_0x8310('0x1e')]=qs[_0x8310('0x1e')](_0x5099b2[_0x8310('0x31')][_0x8310('0x1e')]);}_0x890ca9['order']=qs[_0x8310('0x39')](_0x5099b2['query'][_0x8310('0x39')]);_0x890ca9[_0x8310('0x3a')]=qs['filters'](_[_0x8310('0x3b')](_0x5099b2[_0x8310('0x31')],_0x53a045[_0x8310('0x33')]),_0x30d2f7);if(_0x5099b2[_0x8310('0x31')][_0x8310('0x3c')]){_0x890ca9[_0x8310('0x3a')]=_[_0x8310('0x3d')](_0x890ca9[_0x8310('0x3a')],{'$or':_[_0x8310('0x2d')](_0x30d2f7,function(_0x305939){if(_0x305939[_0x8310('0x30')]!==_0x8310('0x3e')){var _0x13d6c7={};_0x13d6c7[_0x305939['name']]={'$like':'%'+_0x5099b2[_0x8310('0x31')]['filter']+'%'};return _0x13d6c7;}})});}_0x890ca9=_['merge']({},_0x890ca9,_0x5099b2[_0x8310('0x3f')]);var _0x2b7be4={'where':_0x890ca9['where']};return db['OpenchannelApplication'][_0x8310('0x21')](_0x2b7be4)['then'](function(_0x286a96){_0x4ba8fd[_0x8310('0x21')]=_0x286a96;if(_0x5099b2[_0x8310('0x31')][_0x8310('0x40')]){_0x890ca9['include']=[{'all':!![]}];}return db[_0x8310('0x41')][_0x8310('0x42')](_0x890ca9);})[_0x8310('0x28')](function(_0x3259e4){_0x4ba8fd[_0x8310('0x43')]=_0x3259e4;return _0x4ba8fd;})[_0x8310('0x28')](respondWithFilteredResult(_0x3de78e,_0x890ca9))[_0x8310('0x44')](handleError(_0x3de78e,null));};exports[_0x8310('0x45')]=function(_0x3e7326,_0x2b5c46){var _0xdb42e2={'raw':!![],'where':{'id':_0x3e7326[_0x8310('0x46')]['id']}},_0x432e39={};_0x432e39['model']=_[_0x8310('0x32')](db[_0x8310('0x41')][_0x8310('0x2e')]);_0x432e39[_0x8310('0x31')]=_['keys'](_0x3e7326['query']);_0x432e39[_0x8310('0x33')]=_[_0x8310('0x34')](_0x432e39['model'],_0x432e39[_0x8310('0x31')]);_0xdb42e2[_0x8310('0x36')]=_[_0x8310('0x34')](_0x432e39[_0x8310('0x35')],qs[_0x8310('0x37')](_0x3e7326[_0x8310('0x31')][_0x8310('0x37')]));_0xdb42e2[_0x8310('0x36')]=_0xdb42e2[_0x8310('0x36')][_0x8310('0x38')]?_0xdb42e2[_0x8310('0x36')]:_0x432e39[_0x8310('0x35')];if(_0x3e7326['query'][_0x8310('0x40')]){_0xdb42e2['include']=[{'all':!![]}];}_0xdb42e2=_[_0x8310('0x3d')]({},_0xdb42e2,_0x3e7326[_0x8310('0x3f')]);return db[_0x8310('0x41')][_0x8310('0x47')](_0xdb42e2)[_0x8310('0x28')](handleEntityNotFound(_0x2b5c46,null))[_0x8310('0x28')](respondWithResult(_0x2b5c46,null))[_0x8310('0x44')](handleError(_0x2b5c46,null));};exports['create']=function(_0x9f4e01,_0x2e5453){return db[_0x8310('0x41')][_0x8310('0x48')](_0x9f4e01['body'],{})[_0x8310('0x28')](respondWithResult(_0x2e5453,0xc9))[_0x8310('0x44')](handleError(_0x2e5453,null));};exports[_0x8310('0x27')]=function(_0xe4cc3a,_0x3cb4f9){if(_0xe4cc3a[_0x8310('0x49')]['id']){delete _0xe4cc3a[_0x8310('0x49')]['id'];}return db[_0x8310('0x41')][_0x8310('0x47')]({'where':{'id':_0xe4cc3a[_0x8310('0x46')]['id']}})[_0x8310('0x28')](handleEntityNotFound(_0x3cb4f9,null))['then'](saveUpdates(_0xe4cc3a['body'],null))[_0x8310('0x28')](respondWithResult(_0x3cb4f9,null))[_0x8310('0x44')](handleError(_0x3cb4f9,null));};exports['destroy']=function(_0x4554ec,_0x448c98){return db['OpenchannelApplication'][_0x8310('0x47')]({'where':{'id':_0x4554ec[_0x8310('0x46')]['id']}})[_0x8310('0x28')](handleEntityNotFound(_0x448c98,null))['then'](removeEntity(_0x448c98,null))['catch'](handleError(_0x448c98,null));}; \ No newline at end of file diff --git a/server/api/openchannelApplication/openchannelApplication.model.js b/server/api/openchannelApplication/openchannelApplication.model.js index 5338bf0..2c8178f 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 _0xea00=['moment','request-promise','path','rimraf','../../config/environment','./openchannelApplication.attributes','exports','define','OpenchannelApplication','openchannel_applications','utf8mb4','utf8mb4_unicode_ci','lodash','util','api'];(function(_0x5e6bec,_0x1eb54d){var _0x5dc5cf=function(_0x59429a){while(--_0x59429a){_0x5e6bec['push'](_0x5e6bec['shift']());}};_0x5dc5cf(++_0x1eb54d);}(_0xea00,0x129));var _0x0ea0=function(_0x2bc6aa,_0x58bbcb){_0x2bc6aa=_0x2bc6aa-0x0;var _0x2145ea=_0xea00[_0x2bc6aa];return _0x2145ea;};'use strict';var _=require(_0x0ea0('0x0'));var util=require(_0x0ea0('0x1'));var logger=require('../../config/logger')(_0x0ea0('0x2'));var moment=require(_0x0ea0('0x3'));var BPromise=require('bluebird');var rp=require(_0x0ea0('0x4'));var fs=require('fs');var path=require(_0x0ea0('0x5'));var rimraf=require(_0x0ea0('0x6'));var config=require(_0x0ea0('0x7'));var attributes=require(_0x0ea0('0x8'));module[_0x0ea0('0x9')]=function(_0x1f500f,_0x4bdc45){return _0x1f500f[_0x0ea0('0xa')](_0x0ea0('0xb'),attributes,{'tableName':_0x0ea0('0xc'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x0ea0('0xd'),'collate':_0x0ea0('0xe')});}; \ No newline at end of file +var _0xb524=['rimraf','../../config/environment','OpenchannelApplication','util','../../config/logger','api','moment','bluebird','request-promise'];(function(_0x3b20c2,_0x888661){var _0x5b4482=function(_0x15b274){while(--_0x15b274){_0x3b20c2['push'](_0x3b20c2['shift']());}};_0x5b4482(++_0x888661);}(_0xb524,0x111));var _0x4b52=function(_0x3646e3,_0x5d9312){_0x3646e3=_0x3646e3-0x0;var _0x5f2736=_0xb524[_0x3646e3];return _0x5f2736;};'use strict';var _=require('lodash');var util=require(_0x4b52('0x0'));var logger=require(_0x4b52('0x1'))(_0x4b52('0x2'));var moment=require(_0x4b52('0x3'));var BPromise=require(_0x4b52('0x4'));var rp=require(_0x4b52('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x4b52('0x6'));var config=require(_0x4b52('0x7'));var attributes=require('./openchannelApplication.attributes');module['exports']=function(_0x43d592,_0x5ebf35){return _0x43d592['define'](_0x4b52('0x8'),attributes,{'tableName':'openchannel_applications','paranoid':![],'indexes':[],'timestamps':!![],'charset':'utf8mb4','collate':'utf8mb4_unicode_ci'});}; \ No newline at end of file diff --git a/server/api/openchannelApplication/openchannelApplication.rpc.js b/server/api/openchannelApplication/openchannelApplication.rpc.js index 7aa057f..6745733 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 _0xae73=['debug','util','bluebird','ioredis','../../config/logger','../../config/environment','jayson/promise','http','then','request\x20sent','OpenchannelApplication,\x20%s,\x20%s,\x20%s','stringify','error','code','OpenchannelApplication,\x20%s,\x20%s','message','catch','UpdateOpenchannelApplication','OpenchannelApplication','update','body','options','raw','where','attributes','limit','info'];(function(_0x11b58d,_0x555c55){var _0xc2811b=function(_0x396d22){while(--_0x396d22){_0x11b58d['push'](_0x11b58d['shift']());}};_0xc2811b(++_0x555c55);}(_0xae73,0x1cc));var _0x3ae7=function(_0x2159e6,_0x55c285){_0x2159e6=_0x2159e6-0x0;var _0x355dbb=_0xae73[_0x2159e6];return _0x355dbb;};'use strict';var _=require('lodash');var util=require(_0x3ae7('0x0'));var moment=require('moment');var BPromise=require(_0x3ae7('0x1'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x3ae7('0x2'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0x3ae7('0x3'))('rpc');var config=require(_0x3ae7('0x4'));var jayson=require(_0x3ae7('0x5'));var client=jayson['client'][_0x3ae7('0x6')]({'port':0x232a});function respondWithRpcPromise(_0x843d57,_0x35db98,_0x475f65){return new BPromise(function(_0x53db7c,_0x28a313){return client['request'](_0x843d57,_0x475f65)[_0x3ae7('0x7')](function(_0x1a1493){logger['info']('OpenchannelApplication,\x20%s,\x20%s',_0x35db98,_0x3ae7('0x8'));logger['debug'](_0x3ae7('0x9'),_0x35db98,_0x3ae7('0x8'),JSON[_0x3ae7('0xa')](_0x1a1493));if(_0x1a1493[_0x3ae7('0xb')]){if(_0x1a1493[_0x3ae7('0xb')][_0x3ae7('0xc')]===0x1f4){logger[_0x3ae7('0xb')](_0x3ae7('0xd'),_0x35db98,_0x1a1493['error']['message']);return _0x28a313(_0x1a1493[_0x3ae7('0xb')][_0x3ae7('0xe')]);}logger[_0x3ae7('0xb')](_0x3ae7('0xd'),_0x35db98,_0x1a1493['error'][_0x3ae7('0xe')]);return _0x53db7c(_0x1a1493[_0x3ae7('0xb')]['message']);}else{logger['info'](_0x3ae7('0xd'),_0x35db98,_0x3ae7('0x8'));_0x53db7c(_0x1a1493['result']['message']);}})[_0x3ae7('0xf')](function(_0x5e1f07){logger[_0x3ae7('0xb')](_0x3ae7('0xd'),_0x35db98,_0x5e1f07);_0x28a313(_0x5e1f07);});});}exports[_0x3ae7('0x10')]=function(_0x10323e){var _0x34e041=this;return new Promise(function(_0x2ee5cd,_0x3bccd6){return db[_0x3ae7('0x11')][_0x3ae7('0x12')](_0x10323e[_0x3ae7('0x13')],{'raw':_0x10323e[_0x3ae7('0x14')]?_0x10323e[_0x3ae7('0x14')][_0x3ae7('0x15')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x10323e[_0x3ae7('0x14')]?_0x10323e[_0x3ae7('0x14')][_0x3ae7('0x16')]||null:null,'attributes':_0x10323e[_0x3ae7('0x14')]?_0x10323e[_0x3ae7('0x14')][_0x3ae7('0x17')]||null:null,'limit':_0x10323e[_0x3ae7('0x14')]?_0x10323e[_0x3ae7('0x14')][_0x3ae7('0x18')]||null:null})[_0x3ae7('0x7')](function(_0x2fad82){logger[_0x3ae7('0x19')](_0x3ae7('0x10'),_0x10323e);logger[_0x3ae7('0x1a')](_0x3ae7('0x10'),_0x10323e,JSON[_0x3ae7('0xa')](_0x2fad82));_0x2ee5cd(_0x2fad82);})[_0x3ae7('0xf')](function(_0xf6ac13){logger[_0x3ae7('0xb')]('UpdateOpenchannelApplication',_0xf6ac13[_0x3ae7('0xe')],_0x10323e);_0x3bccd6(_0x34e041[_0x3ae7('0xb')](0x1f4,_0xf6ac13[_0x3ae7('0xe')]));});});}; \ No newline at end of file +var _0xa749=['options','raw','where','attributes','UpdateOpenchannelApplication','stringify','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','jayson/promise','client','request','then','OpenchannelApplication,\x20%s,\x20%s','request\x20sent','debug','error','code','message','info','result','catch','body'];(function(_0x1f7d94,_0x2312a6){var _0x2bd359=function(_0x35d528){while(--_0x35d528){_0x1f7d94['push'](_0x1f7d94['shift']());}};_0x2bd359(++_0x2312a6);}(_0xa749,0x92));var _0x9a74=function(_0x1ea76a,_0xa7be89){_0x1ea76a=_0x1ea76a-0x0;var _0x519ae9=_0xa749[_0x1ea76a];return _0x519ae9;};'use strict';var _=require('lodash');var util=require(_0x9a74('0x0'));var moment=require(_0x9a74('0x1'));var BPromise=require(_0x9a74('0x2'));var rs=require(_0x9a74('0x3'));var fs=require('fs');var Redis=require(_0x9a74('0x4'));var db=require(_0x9a74('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0x9a74('0x6'))(_0x9a74('0x7'));var config=require('../../config/environment');var jayson=require(_0x9a74('0x8'));var client=jayson[_0x9a74('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x56ee8b,_0x11e703,_0x3dc78e){return new BPromise(function(_0xc8e38e,_0x18da65){return client[_0x9a74('0xa')](_0x56ee8b,_0x3dc78e)[_0x9a74('0xb')](function(_0x1e579a){logger['info'](_0x9a74('0xc'),_0x11e703,_0x9a74('0xd'));logger[_0x9a74('0xe')]('OpenchannelApplication,\x20%s,\x20%s,\x20%s',_0x11e703,'request\x20sent',JSON['stringify'](_0x1e579a));if(_0x1e579a[_0x9a74('0xf')]){if(_0x1e579a[_0x9a74('0xf')][_0x9a74('0x10')]===0x1f4){logger[_0x9a74('0xf')](_0x9a74('0xc'),_0x11e703,_0x1e579a[_0x9a74('0xf')][_0x9a74('0x11')]);return _0x18da65(_0x1e579a['error'][_0x9a74('0x11')]);}logger['error'](_0x9a74('0xc'),_0x11e703,_0x1e579a[_0x9a74('0xf')][_0x9a74('0x11')]);return _0xc8e38e(_0x1e579a[_0x9a74('0xf')][_0x9a74('0x11')]);}else{logger[_0x9a74('0x12')](_0x9a74('0xc'),_0x11e703,_0x9a74('0xd'));_0xc8e38e(_0x1e579a[_0x9a74('0x13')]['message']);}})[_0x9a74('0x14')](function(_0xd06fed){logger[_0x9a74('0xf')](_0x9a74('0xc'),_0x11e703,_0xd06fed);_0x18da65(_0xd06fed);});});}exports['UpdateOpenchannelApplication']=function(_0x308c94){var _0x463d13=this;return new Promise(function(_0x518d5c,_0x246ae1){return db['OpenchannelApplication']['update'](_0x308c94[_0x9a74('0x15')],{'raw':_0x308c94[_0x9a74('0x16')]?_0x308c94['options'][_0x9a74('0x17')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x308c94[_0x9a74('0x16')]?_0x308c94['options'][_0x9a74('0x18')]||null:null,'attributes':_0x308c94[_0x9a74('0x16')]?_0x308c94[_0x9a74('0x16')][_0x9a74('0x19')]||null:null,'limit':_0x308c94[_0x9a74('0x16')]?_0x308c94[_0x9a74('0x16')]['limit']||null:null})['then'](function(_0x52e108){logger[_0x9a74('0x12')]('UpdateOpenchannelApplication',_0x308c94);logger[_0x9a74('0xe')](_0x9a74('0x1a'),_0x308c94,JSON[_0x9a74('0x1b')](_0x52e108));_0x518d5c(_0x52e108);})['catch'](function(_0x396f6c){logger['error'](_0x9a74('0x1a'),_0x396f6c[_0x9a74('0x11')],_0x308c94);_0x246ae1(_0x463d13[_0x9a74('0xf')](0x1f4,_0x396f6c[_0x9a74('0x11')]));});});}; \ No newline at end of file diff --git a/server/api/openchannelInteraction/index.js b/server/api/openchannelInteraction/index.js index 630b16b..9fc9228 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 _0x5f48=['/:id/download','download','post','create','/:id/tags','openchannel','openchannelinteraction:addtags','put','openchannelinteraction:update','update','destroy','delete','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/describe','describe','/:id','/:id/messages','getMessages'];(function(_0x32e280,_0x22380f){var _0x16ef29=function(_0xc0a589){while(--_0xc0a589){_0x32e280['push'](_0x32e280['shift']());}};_0x16ef29(++_0x22380f);}(_0x5f48,0x194));var _0x85f4=function(_0x422024,_0x28e3b1){_0x422024=_0x422024-0x0;var _0x5d3330=_0x5f48[_0x422024];return _0x5d3330;};'use strict';var multer=require('multer');var util=require(_0x85f4('0x0'));var path=require(_0x85f4('0x1'));var timeout=require(_0x85f4('0x2'));var express=require(_0x85f4('0x3'));var router=express[_0x85f4('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0x85f4('0x5'));var interaction=require(_0x85f4('0x6'));var config=require(_0x85f4('0x7'));var controller=require('./openchannelInteraction.controller');router[_0x85f4('0x8')]('/',auth[_0x85f4('0x9')](),controller[_0x85f4('0xa')]);router[_0x85f4('0x8')](_0x85f4('0xb'),auth[_0x85f4('0x9')](),controller[_0x85f4('0xc')]);router[_0x85f4('0x8')](_0x85f4('0xd'),auth[_0x85f4('0x9')](),controller['show']);router['get'](_0x85f4('0xe'),auth['isAuthenticated'](),controller[_0x85f4('0xf')]);router[_0x85f4('0x8')](_0x85f4('0x10'),auth[_0x85f4('0x9')](),controller[_0x85f4('0x11')]);router[_0x85f4('0x12')]('/',auth[_0x85f4('0x9')](),controller[_0x85f4('0x13')]);router[_0x85f4('0x12')](_0x85f4('0xe'),auth[_0x85f4('0x9')](),controller['addMessage']);router[_0x85f4('0x12')](_0x85f4('0x14'),auth[_0x85f4('0x9')](),interaction['tracked'](_0x85f4('0x15'),_0x85f4('0x16')),controller['addTags']);router[_0x85f4('0x17')]('/:id',auth[_0x85f4('0x9')](),interaction['tracked'](_0x85f4('0x15'),_0x85f4('0x18')),controller[_0x85f4('0x19')]);router['delete'](_0x85f4('0xd'),auth[_0x85f4('0x9')](),interaction['tracked'](_0x85f4('0x15'),'openchannelinteraction:destroy'),controller[_0x85f4('0x1a')]);router[_0x85f4('0x1b')](_0x85f4('0x14'),auth['isAuthenticated'](),controller['removeTags']);module['exports']=router; \ No newline at end of file +var _0xc030=['../../config/environment','./openchannelInteraction.controller','index','get','describe','/:id','isAuthenticated','/:id/download','download','post','/:id/messages','/:id/tags','tracked','openchannelinteraction:addtags','addTags','put','openchannel','openchannelinteraction:update','update','delete','destroy','removeTags','multer','path','connect-timeout','fs-extra','../../components/auth/service','../../components/interaction/service'];(function(_0x22aed0,_0x291aec){var _0x19de69=function(_0x196785){while(--_0x196785){_0x22aed0['push'](_0x22aed0['shift']());}};_0x19de69(++_0x291aec);}(_0xc030,0x14a));var _0x0c03=function(_0x1b2507,_0x214fcb){_0x1b2507=_0x1b2507-0x0;var _0x5e2f6d=_0xc030[_0x1b2507];return _0x5e2f6d;};'use strict';var multer=require(_0x0c03('0x0'));var util=require('util');var path=require(_0x0c03('0x1'));var timeout=require(_0x0c03('0x2'));var express=require('express');var router=express['Router']();var fs_extra=require(_0x0c03('0x3'));var auth=require(_0x0c03('0x4'));var interaction=require(_0x0c03('0x5'));var config=require(_0x0c03('0x6'));var controller=require(_0x0c03('0x7'));router['get']('/',auth['isAuthenticated'](),controller[_0x0c03('0x8')]);router[_0x0c03('0x9')]('/describe',auth['isAuthenticated'](),controller[_0x0c03('0xa')]);router[_0x0c03('0x9')](_0x0c03('0xb'),auth['isAuthenticated'](),controller['show']);router[_0x0c03('0x9')]('/:id/messages',auth[_0x0c03('0xc')](),controller['getMessages']);router['get'](_0x0c03('0xd'),auth[_0x0c03('0xc')](),controller[_0x0c03('0xe')]);router[_0x0c03('0xf')]('/',auth[_0x0c03('0xc')](),controller['create']);router[_0x0c03('0xf')](_0x0c03('0x10'),auth[_0x0c03('0xc')](),controller['addMessage']);router['post'](_0x0c03('0x11'),auth[_0x0c03('0xc')](),interaction[_0x0c03('0x12')]('openchannel',_0x0c03('0x13')),controller[_0x0c03('0x14')]);router[_0x0c03('0x15')](_0x0c03('0xb'),auth[_0x0c03('0xc')](),interaction[_0x0c03('0x12')](_0x0c03('0x16'),_0x0c03('0x17')),controller[_0x0c03('0x18')]);router[_0x0c03('0x19')](_0x0c03('0xb'),auth['isAuthenticated'](),interaction[_0x0c03('0x12')](_0x0c03('0x16'),'openchannelinteraction:destroy'),controller[_0x0c03('0x1a')]);router[_0x0c03('0x19')](_0x0c03('0x11'),auth[_0x0c03('0xc')](),controller[_0x0c03('0x1b')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/openchannelInteraction/openchannelInteraction.attributes.js b/server/api/openchannelInteraction/openchannelInteraction.attributes.js index ba94ad9..375c4d8 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 _0x7d06=['sequelize','exports','BOOLEAN','DATE','STRING','ENUM','out','INTEGER'];(function(_0x47a7d0,_0x4e182d){var _0xb9bd08=function(_0x588ee2){while(--_0x588ee2){_0x47a7d0['push'](_0x47a7d0['shift']());}};_0xb9bd08(++_0x4e182d);}(_0x7d06,0x158));var _0x67d0=function(_0x12f173,_0xca653a){_0x12f173=_0x12f173-0x0;var _0x475297=_0x7d06[_0x12f173];return _0x475297;};'use strict';var Sequelize=require(_0x67d0('0x0'));module[_0x67d0('0x1')]={'closed':{'type':Sequelize[_0x67d0('0x2')],'defaultValue':![]},'closedAt':{'type':Sequelize[_0x67d0('0x3')]},'disposition':{'type':Sequelize[_0x67d0('0x4')]},'secondDisposition':{'type':Sequelize['STRING']},'thirdDisposition':{'type':Sequelize[_0x67d0('0x4')]},'note':{'type':Sequelize[_0x67d0('0x4')]},'read1stAt':{'type':Sequelize[_0x67d0('0x3')]},'threadId':{'type':Sequelize['STRING']},'externalUrl':{'type':Sequelize[_0x67d0('0x4')]},'lastMsgAt':{'type':Sequelize['DATE']},'firstMsgDirection':{'type':Sequelize[_0x67d0('0x5')]('in',_0x67d0('0x6')),'defaultValue':'in','allowNull':![]},'lastMsgDirection':{'type':Sequelize[_0x67d0('0x5')]('in',_0x67d0('0x6')),'defaultValue':'in','allowNull':![]},'from':{'type':Sequelize[_0x67d0('0x4')]},'autoreplyExecuted':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'queueId':{'type':Sequelize[_0x67d0('0x7')]}}; \ No newline at end of file +var _0xe5b5=['ENUM','out','INTEGER','sequelize','exports','BOOLEAN','DATE','STRING'];(function(_0x3da832,_0x2133f1){var _0xe602f2=function(_0xb7b2f){while(--_0xb7b2f){_0x3da832['push'](_0x3da832['shift']());}};_0xe602f2(++_0x2133f1);}(_0xe5b5,0x12b));var _0x5e5b=function(_0x13ea00,_0x12f610){_0x13ea00=_0x13ea00-0x0;var _0x1f7347=_0xe5b5[_0x13ea00];return _0x1f7347;};'use strict';var Sequelize=require(_0x5e5b('0x0'));module[_0x5e5b('0x1')]={'closed':{'type':Sequelize[_0x5e5b('0x2')],'defaultValue':![]},'closedAt':{'type':Sequelize[_0x5e5b('0x3')]},'disposition':{'type':Sequelize[_0x5e5b('0x4')]},'secondDisposition':{'type':Sequelize[_0x5e5b('0x4')]},'thirdDisposition':{'type':Sequelize[_0x5e5b('0x4')]},'note':{'type':Sequelize[_0x5e5b('0x4')]},'read1stAt':{'type':Sequelize[_0x5e5b('0x3')]},'threadId':{'type':Sequelize[_0x5e5b('0x4')]},'externalUrl':{'type':Sequelize[_0x5e5b('0x4')]},'lastMsgAt':{'type':Sequelize[_0x5e5b('0x3')]},'firstMsgDirection':{'type':Sequelize[_0x5e5b('0x5')]('in',_0x5e5b('0x6')),'defaultValue':'in','allowNull':![]},'lastMsgDirection':{'type':Sequelize[_0x5e5b('0x5')]('in',_0x5e5b('0x6')),'defaultValue':'in','allowNull':![]},'from':{'type':Sequelize[_0x5e5b('0x4')]},'autoreplyExecuted':{'type':Sequelize[_0x5e5b('0x2')],'defaultValue':![]},'queueId':{'type':Sequelize[_0x5e5b('0x7')]}}; \ No newline at end of file diff --git a/server/api/openchannelInteraction/openchannelInteraction.controller.js b/server/api/openchannelInteraction/openchannelInteraction.controller.js index defb1a9..157b7d0 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 _0x47be=['lastName','push','Attachment','createdAt','direction','read','Account','Owner','get','mkdirSync','N.A.','closed','closedAt','toString','disposition','threadId','Private','Messages','basename','existsSync','createReadStream','pipe','createWriteStream','out','System','Contact','firstName','secret','views','transcript-','.pdf','Openchannel','error','unlinkSync','rimraf','zip-dir','path','lodash','ioredis','../../components/interaction/service','../../components/parsers/qs','../../components/export/pdf','../../config/logger','api','../../mysqldb','defaults','redis','localhost','./openchannelInteraction.socket','status','end','json','offset','undefined','count','set','Content-Range','update','then','destroy','sendStatus','stack','name','send','index','map','rawAttributes','fieldName','type','key','getOptions','query','user','catch','show','from','params','OpenchannelInteraction','keys','filters','intersection','model','attributes','length','includeAll','include','merge','options','find','create','body','describe','addMessage','OpenchannelMessage','ids','getMessages','findOne','fields','nolimit','limit','order','sort','where','pick','filter','$gte','format','YYYY-MM-DD\x20HH:mm:ss','findAll','addTags','setTags','omit','spread','Tag','color','emit','openchannelInteractionTags:save','removeTags','download','unix','join','root','server','files','tmp','attachments','transcript-%d-%s.zip','User','fullname'];(function(_0x3a8b22,_0x1fc614){var _0x303f29=function(_0x27e77e){while(--_0x27e77e){_0x3a8b22['push'](_0x3a8b22['shift']());}};_0x303f29(++_0x1fc614);}(_0x47be,0x1a5));var _0xe47b=function(_0x4e9310,_0x5296e4){_0x4e9310=_0x4e9310-0x0;var _0x346b79=_0x47be[_0x4e9310];return _0x346b79;};'use strict';var rimraf=require(_0xe47b('0x0'));var zipdir=require(_0xe47b('0x1'));var moment=require('moment');var util=require('util');var path=require(_0xe47b('0x2'));var ejs=require('ejs');var fs=require('fs');var _=require(_0xe47b('0x3'));var Redis=require(_0xe47b('0x4'));var interaction=require(_0xe47b('0x5'));var qs=require(_0xe47b('0x6'));var pdf=require(_0xe47b('0x7'));var logger=require(_0xe47b('0x8'))(_0xe47b('0x9'));var config=require('../../config/environment');var db=require(_0xe47b('0xa'))['db'];config['redis']=_[_0xe47b('0xb')](config[_0xe47b('0xc')],{'host':_0xe47b('0xd'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xe47b('0xc')]));require(_0xe47b('0xe'))['register'](socket);function respondWithStatusCode(_0x309e7f,_0x4f46da){_0x4f46da=_0x4f46da||0xcc;return function(_0x55f4b2){if(_0x55f4b2){return _0x309e7f['sendStatus'](_0x4f46da);}return _0x309e7f[_0xe47b('0xf')](_0x4f46da)[_0xe47b('0x10')]();};}function respondWithResult(_0x18cb48,_0x17adab){_0x17adab=_0x17adab||0xc8;return function(_0x208345){if(_0x208345){return _0x18cb48[_0xe47b('0xf')](_0x17adab)[_0xe47b('0x11')](_0x208345);}};}function respondWithFilteredResult(_0x35943e,_0x49a920){return function(_0x211c00){if(_0x211c00){var _0x3f3a73=typeof _0x49a920[_0xe47b('0x12')]===_0xe47b('0x13')&&typeof _0x49a920['limit']===_0xe47b('0x13');var _0xae99c3=_0x211c00[_0xe47b('0x14')];var _0x15caf7=_0x3f3a73?0x0:_0x49a920[_0xe47b('0x12')];var _0x4476c1=_0x3f3a73?_0x211c00[_0xe47b('0x14')]:_0x49a920[_0xe47b('0x12')]+_0x49a920['limit'];var _0x18312f;if(_0x4476c1>=_0xae99c3){_0x4476c1=_0xae99c3;_0x18312f=0xc8;}else{_0x18312f=0xce;}_0x35943e[_0xe47b('0xf')](_0x18312f);return _0x35943e[_0xe47b('0x15')](_0xe47b('0x16'),_0x15caf7+'-'+_0x4476c1+'/'+_0xae99c3)[_0xe47b('0x11')](_0x211c00);}return null;};}function saveUpdates(_0x9d4805){return function(_0xb116e2){if(_0xb116e2){return _0xb116e2[_0xe47b('0x17')](_0x9d4805)[_0xe47b('0x18')](function(_0x2cbf85){return _0x2cbf85;});}return null;};}function removeEntity(_0x2c903e){return function(_0x5ace7b){if(_0x5ace7b){return _0x5ace7b[_0xe47b('0x19')]()['then'](function(){_0x2c903e['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x40b4d8){return function(_0x361a34){if(!_0x361a34){_0x40b4d8[_0xe47b('0x1a')](0x194);}return _0x361a34;};}function handleError(_0x3a0564,_0x412315){_0x412315=_0x412315||0x1f4;return function(_0x22860f){logger['error'](_0x22860f[_0xe47b('0x1b')]);if(_0x22860f['name']){delete _0x22860f[_0xe47b('0x1c')];}_0x3a0564[_0xe47b('0xf')](_0x412315)[_0xe47b('0x1d')](_0x22860f);};}exports[_0xe47b('0x1e')]=function(_0x4111ef,_0x131f40){var _0x2e2616={};var _0x8505b8=_[_0xe47b('0x1f')](db['OpenchannelInteraction'][_0xe47b('0x20')],function(_0xe8d73a){return{'name':_0xe8d73a[_0xe47b('0x21')],'type':_0xe8d73a[_0xe47b('0x22')][_0xe47b('0x23')]};});_0x2e2616=qs[_0xe47b('0x24')](_0x8505b8,_0x4111ef);return interaction['findAll']('openchannel',_0x4111ef[_0xe47b('0x25')],_0x4111ef[_0xe47b('0x26')],_0x2e2616,_0x8505b8)[_0xe47b('0x18')](respondWithFilteredResult(_0x131f40,_0x2e2616))[_0xe47b('0x27')](handleError(_0x131f40,null));};exports[_0xe47b('0x28')]=function(_0x1b0ed3,_0x44829c){var _0x47244c={};if(_0x1b0ed3[_0xe47b('0x25')][_0xe47b('0x22')]&&_0x1b0ed3[_0xe47b('0x25')]['type']==='from'){_0x47244c[_0xe47b('0x29')]=_0x1b0ed3[_0xe47b('0x2a')]['id'];}else{_0x47244c['id']=_0x1b0ed3[_0xe47b('0x2a')]['id'];}var _0x594a97={'raw':![],'where':_0x47244c},_0x11d65d={};_0x11d65d['model']=_['keys'](db[_0xe47b('0x2b')][_0xe47b('0x20')]);_0x11d65d[_0xe47b('0x25')]=_[_0xe47b('0x2c')](_0x1b0ed3[_0xe47b('0x25')]);_0x11d65d[_0xe47b('0x2d')]=_[_0xe47b('0x2e')](_0x11d65d[_0xe47b('0x2f')],_0x11d65d[_0xe47b('0x25')]);_0x594a97['attributes']=_[_0xe47b('0x2e')](_0x11d65d[_0xe47b('0x2f')],qs['fields'](_0x1b0ed3[_0xe47b('0x25')]['fields']));_0x594a97[_0xe47b('0x30')]=_0x594a97['attributes'][_0xe47b('0x31')]?_0x594a97[_0xe47b('0x30')]:_0x11d65d['model'];if(_0x1b0ed3[_0xe47b('0x25')][_0xe47b('0x32')]){_0x594a97[_0xe47b('0x33')]=[{'all':!![]}];}_0x594a97=_[_0xe47b('0x34')]({},_0x594a97,_0x1b0ed3[_0xe47b('0x35')]);return db[_0xe47b('0x2b')][_0xe47b('0x36')](_0x594a97)[_0xe47b('0x18')](handleEntityNotFound(_0x44829c,null))[_0xe47b('0x18')](respondWithResult(_0x44829c,null))[_0xe47b('0x27')](handleError(_0x44829c,null));};exports[_0xe47b('0x37')]=function(_0x2ebff0,_0x42e862){return db[_0xe47b('0x2b')][_0xe47b('0x37')](_0x2ebff0[_0xe47b('0x38')],{})['then'](respondWithResult(_0x42e862,0xc9))[_0xe47b('0x27')](handleError(_0x42e862,null));};exports[_0xe47b('0x17')]=function(_0x48b0f6,_0x3e8209){if(_0x48b0f6[_0xe47b('0x38')]['id']){delete _0x48b0f6[_0xe47b('0x38')]['id'];}return db['OpenchannelInteraction']['find']({'where':{'id':_0x48b0f6['params']['id']}})[_0xe47b('0x18')](handleEntityNotFound(_0x3e8209,null))[_0xe47b('0x18')](saveUpdates(_0x48b0f6[_0xe47b('0x38')],null))[_0xe47b('0x18')](respondWithResult(_0x3e8209,null))['catch'](handleError(_0x3e8209,null));};exports[_0xe47b('0x19')]=function(_0x115a15,_0x6471db){return db[_0xe47b('0x2b')][_0xe47b('0x36')]({'where':{'id':_0x115a15[_0xe47b('0x2a')]['id']}})[_0xe47b('0x18')](handleEntityNotFound(_0x6471db,null))[_0xe47b('0x18')](removeEntity(_0x6471db,null))[_0xe47b('0x27')](handleError(_0x6471db,null));};exports[_0xe47b('0x39')]=function(_0x1968eb,_0x35c608){return db[_0xe47b('0x2b')]['describe']()[_0xe47b('0x18')](respondWithResult(_0x35c608,null))[_0xe47b('0x27')](handleError(_0x35c608,null));};exports[_0xe47b('0x3a')]=function(_0x3f7854,_0x2ab7b8){return db[_0xe47b('0x3b')][_0xe47b('0x36')]({'where':{'id':_0x3f7854[_0xe47b('0x2a')]['id']}})['then'](handleEntityNotFound(_0x2ab7b8,null))[_0xe47b('0x18')](function(_0x37a236){if(_0x37a236){return _0x37a236['addMessage'](_0x3f7854['body'][_0xe47b('0x3c')],_['omit'](_0x3f7854[_0xe47b('0x38')],[_0xe47b('0x3c'),'id'])||{});}})[_0xe47b('0x18')](respondWithResult(_0x2ab7b8,null))['catch'](handleError(_0x2ab7b8,null));};exports[_0xe47b('0x3d')]=function(_0x3024c6,_0x5ad336){var _0x489479={'raw':![],'where':{}};var _0x342732={};var _0x154d33={'count':0x0,'rows':[]};return db['OpenchannelInteraction'][_0xe47b('0x3e')]({'where':{'id':_0x3024c6[_0xe47b('0x2a')]['id']}})[_0xe47b('0x18')](handleEntityNotFound(_0x5ad336,null))[_0xe47b('0x18')](function(_0x553bad){if(_0x553bad){_0x342732[_0xe47b('0x2f')]=_[_0xe47b('0x2c')](db[_0xe47b('0x3b')][_0xe47b('0x20')]);_0x342732[_0xe47b('0x25')]=_[_0xe47b('0x2c')](_0x3024c6[_0xe47b('0x25')]);_0x342732[_0xe47b('0x2d')]=_[_0xe47b('0x2e')](_0x342732['model'],_0x342732['query']);_0x489479[_0xe47b('0x30')]=_[_0xe47b('0x2e')](_0x342732['model'],qs[_0xe47b('0x3f')](_0x3024c6[_0xe47b('0x25')][_0xe47b('0x3f')]));_0x489479[_0xe47b('0x30')]=_0x489479['attributes']['length']?_0x489479[_0xe47b('0x30')]:_0x342732['model'];if(!_0x3024c6['query']['hasOwnProperty'](_0xe47b('0x40'))){_0x489479[_0xe47b('0x41')]=qs[_0xe47b('0x41')](_0x3024c6[_0xe47b('0x25')][_0xe47b('0x41')]);_0x489479['offset']=qs['offset'](_0x3024c6[_0xe47b('0x25')]['offset']);}_0x489479[_0xe47b('0x42')]=qs[_0xe47b('0x43')](_0x3024c6['query'][_0xe47b('0x43')]);_0x489479[_0xe47b('0x44')]=qs['filters'](_[_0xe47b('0x45')](_0x3024c6[_0xe47b('0x25')],_0x342732['filters']));_0x489479[_0xe47b('0x44')]['OpenchannelInteractionId']=_0x553bad['id'];if(_0x3024c6[_0xe47b('0x25')][_0xe47b('0x46')]){_0x489479[_0xe47b('0x44')]=_[_0xe47b('0x34')](_0x489479[_0xe47b('0x44')],{'$or':_['map'](_0x489479[_0xe47b('0x30')],function(_0x480800){var _0x1f334d={};_0x1f334d[_0x480800]={'$like':'%'+_0x3024c6[_0xe47b('0x25')][_0xe47b('0x46')]+'%'};return _0x1f334d;})});}if(_0x3024c6[_0xe47b('0x25')][_0xe47b('0x47')]){var _0x358152=_0x3024c6[_0xe47b('0x25')]['$gte']['split'](',');var _0x532116={};_0x532116[_0x358152[0x0]]={'$gte':moment(_0x358152[0x1])[_0xe47b('0x48')](_0xe47b('0x49'))};_0x489479['where']=_['merge'](_0x489479['where'],_0x532116);}_0x489479=_[_0xe47b('0x34')]({},_0x489479,_0x3024c6[_0xe47b('0x35')]);return db['OpenchannelMessage']['count']({'where':_0x489479[_0xe47b('0x44')]})[_0xe47b('0x18')](function(_0x27f6c7){_0x154d33['count']=_0x27f6c7;if(_0x3024c6['query'][_0xe47b('0x32')]){_0x489479['include']=[{'all':!![]}];}return db[_0xe47b('0x3b')][_0xe47b('0x4a')](_0x489479);})[_0xe47b('0x18')](function(_0x3fd929){_0x154d33['rows']=_0x3fd929;return _0x154d33;});}})['then'](respondWithFilteredResult(_0x5ad336,_0x489479))[_0xe47b('0x27')](handleError(_0x5ad336,null));};exports[_0xe47b('0x4b')]=function(_0x1fa11e,_0x42204c){return db['OpenchannelInteraction']['find']({'where':{'id':_0x1fa11e['params']['id']}})[_0xe47b('0x18')](handleEntityNotFound(_0x42204c,null))[_0xe47b('0x18')](function(_0x19b12b){if(_0x19b12b){return _0x19b12b[_0xe47b('0x4c')](_0x1fa11e[_0xe47b('0x38')]['ids'],_[_0xe47b('0x4d')](_0x1fa11e[_0xe47b('0x38')],[_0xe47b('0x3c'),'id'])||{})[_0xe47b('0x4e')](function(){return db[_0xe47b('0x4f')][_0xe47b('0x4a')]({'attributes':['id',_0xe47b('0x1c'),_0xe47b('0x50')],'where':{'id':_0x1fa11e['body'][_0xe47b('0x3c')]}});})[_0xe47b('0x18')](function(_0x46fba1){socket[_0xe47b('0x51')](_0xe47b('0x52'),{'id':Number(_0x1fa11e['params']['id']),'tags':_0x46fba1||[]});return{'id':Number(_0x1fa11e[_0xe47b('0x2a')]['id']),'tags':_0x46fba1||[]};});}})[_0xe47b('0x18')](respondWithResult(_0x42204c,null))[_0xe47b('0x27')](handleError(_0x42204c,null));};exports[_0xe47b('0x53')]=function(_0x2a61b1,_0x13880c){return db[_0xe47b('0x2b')][_0xe47b('0x36')]({'where':{'id':_0x2a61b1[_0xe47b('0x2a')]['id']}})[_0xe47b('0x18')](handleEntityNotFound(_0x13880c,null))['then'](function(_0x351129){if(_0x351129){return _0x351129[_0xe47b('0x53')](_0x2a61b1[_0xe47b('0x25')][_0xe47b('0x3c')]);}})[_0xe47b('0x18')](respondWithStatusCode(_0x13880c,null))[_0xe47b('0x27')](handleError(_0x13880c,null));};exports[_0xe47b('0x54')]=function(_0xfe53f0,_0x52ba07){var _0x1fdbcd=moment()[_0xe47b('0x55')]()['toString']();var _0x4833bb=path[_0xe47b('0x56')](config[_0xe47b('0x57')],_0xe47b('0x58'),_0xe47b('0x59'),_0xe47b('0x5a'));var _0x1de5eb=path[_0xe47b('0x56')](config[_0xe47b('0x57')],_0xe47b('0x58'),_0xe47b('0x59'),_0xe47b('0x5b'));var _0x29a750=path[_0xe47b('0x56')](_0x4833bb,_0x1fdbcd);var _0x350d62=util['format'](_0xe47b('0x5c'),_0xfe53f0[_0xe47b('0x2a')]['id'],_0x1fdbcd);var _0x47d97f=path[_0xe47b('0x56')](_0x4833bb,_0x350d62);var _0x521ba7=[];_0x521ba7['push']({'model':db[_0xe47b('0x5d')],'as':'User','attributes':['id',_0xe47b('0x5e')],'raw':!![]});_0x521ba7['push']({'model':db['CmContact'],'as':'Contact','attributes':['id','firstName',_0xe47b('0x5f')],'raw':!![]});if(_0xfe53f0[_0xe47b('0x25')][_0xe47b('0x5b')]){_0x521ba7[_0xe47b('0x60')]({'model':db[_0xe47b('0x61')],'as':'Attachment','raw':!![]});}var _0x242620=[{'model':db[_0xe47b('0x3b')],'as':'Messages','attributes':['id',_0xe47b('0x38'),_0xe47b('0x62'),_0xe47b('0x63'),'secret',_0xe47b('0x64')],'include':_0x521ba7}];_0x242620[_0xe47b('0x60')]({'model':db['OpenchannelAccount'],'as':_0xe47b('0x65'),'attributes':['id',_0xe47b('0x1c')]});_0x242620[_0xe47b('0x60')]({'model':db[_0xe47b('0x5d')],'as':_0xe47b('0x66'),'attributes':['id',_0xe47b('0x5e')]});return db[_0xe47b('0x2b')][_0xe47b('0x36')]({'where':{'id':_0xfe53f0[_0xe47b('0x2a')]['id']},'include':_0x242620})[_0xe47b('0x18')](handleEntityNotFound(_0x52ba07,null))[_0xe47b('0x18')](function(_0x148578){if(_0x148578){var _0x6a7c02=_0x148578[_0xe47b('0x67')]({'plain':!![]});fs[_0xe47b('0x68')](_0x29a750);var _0x56277a={'channel':'Openchannel','account':_0x6a7c02[_0xe47b('0x65')]['name'],'agent':_0x6a7c02[_0xe47b('0x66')]?_0x6a7c02[_0xe47b('0x66')][_0xe47b('0x5e')]:_0xe47b('0x69'),'createdAt':moment(_0x6a7c02[_0xe47b('0x62')])[_0xe47b('0x48')](_0xe47b('0x49'))['toString'](),'closedAt':_0x6a7c02[_0xe47b('0x6a')]?moment(_0x6a7c02[_0xe47b('0x6b')])[_0xe47b('0x48')](_0xe47b('0x49'))[_0xe47b('0x6c')]():'','disposition':_0x6a7c02[_0xe47b('0x6d')],'visibility':_0x6a7c02[_0xe47b('0x6e')]?'Public':_0xe47b('0x6f'),'messages':_(_0x6a7c02[_0xe47b('0x70')])[_0xe47b('0x46')]({'secret':![]})[_0xe47b('0x1f')](function(_0x5ec2ff){if(_0x5ec2ff[_0xe47b('0x61')]){var _0x154a7a=path[_0xe47b('0x56')](_0x1de5eb,_0x5ec2ff[_0xe47b('0x61')][_0xe47b('0x71')]);if(fs[_0xe47b('0x72')](_0x154a7a)){fs[_0xe47b('0x73')](_0x154a7a)[_0xe47b('0x74')](fs[_0xe47b('0x75')](path[_0xe47b('0x56')](_0x29a750,_0x5ec2ff[_0xe47b('0x61')][_0xe47b('0x71')])));}}return{'date':moment(_0x5ec2ff[_0xe47b('0x62')])[_0xe47b('0x48')]('YYYY-MM-DD\x20HH:mm:ss')[_0xe47b('0x6c')](),'sender':_0x5ec2ff[_0xe47b('0x63')]===_0xe47b('0x76')?_0x5ec2ff['User']?_0x5ec2ff[_0xe47b('0x5d')]['fullname']:_0xe47b('0x77'):_0x5ec2ff[_0xe47b('0x78')][_0xe47b('0x79')]+(_0x5ec2ff[_0xe47b('0x78')][_0xe47b('0x5f')]?'\x20'+_0x5ec2ff['Contact']['lastName']:''),'body':_0x5ec2ff[_0xe47b('0x61')]?_0x5ec2ff[_0xe47b('0x61')][_0xe47b('0x71')]:_0x5ec2ff['body'],'direction':_0x5ec2ff[_0xe47b('0x63')]===_0xe47b('0x76')?'A':'C','secret':_0x5ec2ff[_0xe47b('0x7a')],'read':_0x5ec2ff['read'],'attachment':_0x5ec2ff['Attachment']};})['value']()};return ejs['renderFile'](path['join'](config[_0xe47b('0x57')],_0xe47b('0x58'),_0xe47b('0x7b'),'downloadInteraction.ejs'),{'interaction':_0x56277a})[_0xe47b('0x18')](function(_0x367e1b){var _0xc02496=path[_0xe47b('0x56')](_0x29a750,_0xe47b('0x7c')+_0x6a7c02['id']+'-'+_0x1fdbcd+_0xe47b('0x7d'));var _0x1ba23e={'path':_0xc02496,'channel':_0xe47b('0x7e'),'interactionId':_0x6a7c02['id']};return pdf['createPdfFromHTML'](_0x367e1b,_0x1ba23e);})[_0xe47b('0x18')](function(){return new Promise(function(_0x48c2a6,_0x3eec45){zipdir(_0x29a750,{'saveTo':_0x47d97f},function(_0x3db9ec,_0x3c0b2c){if(_0x3db9ec)return _0x3eec45(_0x3db9ec);return _0x48c2a6(_0x3c0b2c);});})[_0xe47b('0x18')](function(){return new Promise(function(_0x2a7f7e,_0x348ded){rimraf(_0x29a750,function(_0x4e0c44){if(_0x4e0c44)_0x348ded(_0x4e0c44);return _0x2a7f7e();});});})[_0xe47b('0x18')](function(){return _0x52ba07[_0xe47b('0x54')](_0x47d97f,_0x350d62,function(_0x47b038){if(_0x47b038){logger[_0xe47b('0x7f')]('Unable\x20to\x20delete\x20zip\x20file',_0x47b038);}else{fs[_0xe47b('0x80')](_0x47d97f);}});});});}else{return _0x52ba07[_0xe47b('0x1a')](0xc8);}})[_0xe47b('0x27')](handleError(_0x52ba07,null));}; \ No newline at end of file +var _0x297b=['$gte','split','format','YYYY-MM-DD\x20HH:mm:ss','options','setTags','spread','Tag','color','emit','openchannelInteractionTags:save','removeTags','download','unix','toString','server','files','tmp','join','root','attachments','transcript-%d-%s.zip','push','User','fullname','CmContact','Contact','firstName','lastName','Messages','createdAt','Account','get','mkdirSync','Openchannel','Owner','closedAt','threadId','Public','Private','filter','Attachment','existsSync','createReadStream','pipe','createWriteStream','basename','direction','out','secret','read','value','renderFile','views','downloadInteraction.ejs','.pdf','Unable\x20to\x20delete\x20zip\x20file','unlinkSync','rimraf','zip-dir','moment','util','path','ejs','lodash','ioredis','../../components/interaction/service','../../components/parsers/qs','../../components/export/pdf','../../config/logger','../../config/environment','redis','localhost','socket.io-emitter','register','sendStatus','end','json','offset','undefined','limit','count','status','set','Content-Range','error','stack','name','send','index','map','rawAttributes','fieldName','key','getOptions','findAll','openchannel','user','catch','show','query','type','from','params','model','keys','filters','intersection','fields','attributes','length','includeAll','include','OpenchannelInteraction','find','then','create','body','update','destroy','describe','OpenchannelMessage','addMessage','omit','ids','getMessages','findOne','order','sort','where','pick','OpenchannelInteractionId','merge'];(function(_0x482815,_0x3601b1){var _0x272d11=function(_0x414e63){while(--_0x414e63){_0x482815['push'](_0x482815['shift']());}};_0x272d11(++_0x3601b1);}(_0x297b,0x144));var _0xb297=function(_0x2112d4,_0x3c863c){_0x2112d4=_0x2112d4-0x0;var _0x434972=_0x297b[_0x2112d4];return _0x434972;};'use strict';var rimraf=require(_0xb297('0x0'));var zipdir=require(_0xb297('0x1'));var moment=require(_0xb297('0x2'));var util=require(_0xb297('0x3'));var path=require(_0xb297('0x4'));var ejs=require(_0xb297('0x5'));var fs=require('fs');var _=require(_0xb297('0x6'));var Redis=require(_0xb297('0x7'));var interaction=require(_0xb297('0x8'));var qs=require(_0xb297('0x9'));var pdf=require(_0xb297('0xa'));var logger=require(_0xb297('0xb'))('api');var config=require(_0xb297('0xc'));var db=require('../../mysqldb')['db'];config['redis']=_['defaults'](config[_0xb297('0xd')],{'host':_0xb297('0xe'),'port':0x18eb});var socket=require(_0xb297('0xf'))(new Redis(config['redis']));require('./openchannelInteraction.socket')[_0xb297('0x10')](socket);function respondWithStatusCode(_0x53a0b3,_0x43671e){_0x43671e=_0x43671e||0xcc;return function(_0x1f3618){if(_0x1f3618){return _0x53a0b3[_0xb297('0x11')](_0x43671e);}return _0x53a0b3['status'](_0x43671e)[_0xb297('0x12')]();};}function respondWithResult(_0x10f569,_0x3d299b){_0x3d299b=_0x3d299b||0xc8;return function(_0x504441){if(_0x504441){return _0x10f569['status'](_0x3d299b)[_0xb297('0x13')](_0x504441);}};}function respondWithFilteredResult(_0x37d32c,_0x534471){return function(_0x57496d){if(_0x57496d){var _0x40d516=typeof _0x534471[_0xb297('0x14')]===_0xb297('0x15')&&typeof _0x534471[_0xb297('0x16')]==='undefined';var _0x1fa593=_0x57496d[_0xb297('0x17')];var _0xb3460d=_0x40d516?0x0:_0x534471[_0xb297('0x14')];var _0x316b7e=_0x40d516?_0x57496d[_0xb297('0x17')]:_0x534471[_0xb297('0x14')]+_0x534471[_0xb297('0x16')];var _0x4cb779;if(_0x316b7e>=_0x1fa593){_0x316b7e=_0x1fa593;_0x4cb779=0xc8;}else{_0x4cb779=0xce;}_0x37d32c[_0xb297('0x18')](_0x4cb779);return _0x37d32c[_0xb297('0x19')](_0xb297('0x1a'),_0xb3460d+'-'+_0x316b7e+'/'+_0x1fa593)['json'](_0x57496d);}return null;};}function saveUpdates(_0x4cd5e8){return function(_0x7abfd){if(_0x7abfd){return _0x7abfd['update'](_0x4cd5e8)['then'](function(_0x538b43){return _0x538b43;});}return null;};}function removeEntity(_0x1d0791){return function(_0x462e62){if(_0x462e62){return _0x462e62['destroy']()['then'](function(){_0x1d0791[_0xb297('0x18')](0xcc)[_0xb297('0x12')]();});}};}function handleEntityNotFound(_0x757dc8){return function(_0x8d4796){if(!_0x8d4796){_0x757dc8[_0xb297('0x11')](0x194);}return _0x8d4796;};}function handleError(_0x3858c9,_0x15f30f){_0x15f30f=_0x15f30f||0x1f4;return function(_0x1a6825){logger[_0xb297('0x1b')](_0x1a6825[_0xb297('0x1c')]);if(_0x1a6825[_0xb297('0x1d')]){delete _0x1a6825['name'];}_0x3858c9[_0xb297('0x18')](_0x15f30f)[_0xb297('0x1e')](_0x1a6825);};}exports[_0xb297('0x1f')]=function(_0x310541,_0x48f8fa){var _0x35f0a4={};var _0x1ec3ba=_[_0xb297('0x20')](db['OpenchannelInteraction'][_0xb297('0x21')],function(_0x16d6bb){return{'name':_0x16d6bb[_0xb297('0x22')],'type':_0x16d6bb['type'][_0xb297('0x23')]};});_0x35f0a4=qs[_0xb297('0x24')](_0x1ec3ba,_0x310541);return interaction[_0xb297('0x25')](_0xb297('0x26'),_0x310541['query'],_0x310541[_0xb297('0x27')],_0x35f0a4,_0x1ec3ba)['then'](respondWithFilteredResult(_0x48f8fa,_0x35f0a4))[_0xb297('0x28')](handleError(_0x48f8fa,null));};exports[_0xb297('0x29')]=function(_0x1d9ae1,_0x1bb8e5){var _0x5a9eae={};if(_0x1d9ae1[_0xb297('0x2a')]['type']&&_0x1d9ae1['query'][_0xb297('0x2b')]===_0xb297('0x2c')){_0x5a9eae[_0xb297('0x2c')]=_0x1d9ae1[_0xb297('0x2d')]['id'];}else{_0x5a9eae['id']=_0x1d9ae1[_0xb297('0x2d')]['id'];}var _0x2388a6={'raw':![],'where':_0x5a9eae},_0x1b5b6c={};_0x1b5b6c[_0xb297('0x2e')]=_[_0xb297('0x2f')](db['OpenchannelInteraction'][_0xb297('0x21')]);_0x1b5b6c[_0xb297('0x2a')]=_[_0xb297('0x2f')](_0x1d9ae1[_0xb297('0x2a')]);_0x1b5b6c[_0xb297('0x30')]=_[_0xb297('0x31')](_0x1b5b6c[_0xb297('0x2e')],_0x1b5b6c['query']);_0x2388a6['attributes']=_['intersection'](_0x1b5b6c[_0xb297('0x2e')],qs[_0xb297('0x32')](_0x1d9ae1[_0xb297('0x2a')][_0xb297('0x32')]));_0x2388a6['attributes']=_0x2388a6[_0xb297('0x33')][_0xb297('0x34')]?_0x2388a6[_0xb297('0x33')]:_0x1b5b6c['model'];if(_0x1d9ae1[_0xb297('0x2a')][_0xb297('0x35')]){_0x2388a6[_0xb297('0x36')]=[{'all':!![]}];}_0x2388a6=_['merge']({},_0x2388a6,_0x1d9ae1['options']);return db[_0xb297('0x37')][_0xb297('0x38')](_0x2388a6)[_0xb297('0x39')](handleEntityNotFound(_0x1bb8e5,null))['then'](respondWithResult(_0x1bb8e5,null))[_0xb297('0x28')](handleError(_0x1bb8e5,null));};exports['create']=function(_0x4a5f3c,_0x4d0395){return db[_0xb297('0x37')][_0xb297('0x3a')](_0x4a5f3c[_0xb297('0x3b')],{})['then'](respondWithResult(_0x4d0395,0xc9))['catch'](handleError(_0x4d0395,null));};exports[_0xb297('0x3c')]=function(_0x18f65d,_0x58571f){if(_0x18f65d[_0xb297('0x3b')]['id']){delete _0x18f65d[_0xb297('0x3b')]['id'];}return db[_0xb297('0x37')][_0xb297('0x38')]({'where':{'id':_0x18f65d['params']['id']}})[_0xb297('0x39')](handleEntityNotFound(_0x58571f,null))[_0xb297('0x39')](saveUpdates(_0x18f65d[_0xb297('0x3b')],null))[_0xb297('0x39')](respondWithResult(_0x58571f,null))['catch'](handleError(_0x58571f,null));};exports[_0xb297('0x3d')]=function(_0x25d2f6,_0x4b753b){return db[_0xb297('0x37')]['find']({'where':{'id':_0x25d2f6[_0xb297('0x2d')]['id']}})['then'](handleEntityNotFound(_0x4b753b,null))['then'](removeEntity(_0x4b753b,null))[_0xb297('0x28')](handleError(_0x4b753b,null));};exports[_0xb297('0x3e')]=function(_0x31c152,_0x3a7c9d){return db[_0xb297('0x37')][_0xb297('0x3e')]()[_0xb297('0x39')](respondWithResult(_0x3a7c9d,null))[_0xb297('0x28')](handleError(_0x3a7c9d,null));};exports['addMessage']=function(_0x3d564f,_0x1fedda){return db[_0xb297('0x3f')][_0xb297('0x38')]({'where':{'id':_0x3d564f[_0xb297('0x2d')]['id']}})[_0xb297('0x39')](handleEntityNotFound(_0x1fedda,null))[_0xb297('0x39')](function(_0x5c4161){if(_0x5c4161){return _0x5c4161[_0xb297('0x40')](_0x3d564f['body']['ids'],_[_0xb297('0x41')](_0x3d564f[_0xb297('0x3b')],[_0xb297('0x42'),'id'])||{});}})[_0xb297('0x39')](respondWithResult(_0x1fedda,null))[_0xb297('0x28')](handleError(_0x1fedda,null));};exports[_0xb297('0x43')]=function(_0x546b57,_0x24ee04){var _0x16faa4={'raw':![],'where':{}};var _0x3ddf49={};var _0x98cf1e={'count':0x0,'rows':[]};return db[_0xb297('0x37')][_0xb297('0x44')]({'where':{'id':_0x546b57['params']['id']}})[_0xb297('0x39')](handleEntityNotFound(_0x24ee04,null))[_0xb297('0x39')](function(_0x2ff29c){if(_0x2ff29c){_0x3ddf49[_0xb297('0x2e')]=_['keys'](db[_0xb297('0x3f')]['rawAttributes']);_0x3ddf49[_0xb297('0x2a')]=_['keys'](_0x546b57[_0xb297('0x2a')]);_0x3ddf49[_0xb297('0x30')]=_[_0xb297('0x31')](_0x3ddf49[_0xb297('0x2e')],_0x3ddf49[_0xb297('0x2a')]);_0x16faa4[_0xb297('0x33')]=_[_0xb297('0x31')](_0x3ddf49[_0xb297('0x2e')],qs['fields'](_0x546b57[_0xb297('0x2a')][_0xb297('0x32')]));_0x16faa4[_0xb297('0x33')]=_0x16faa4[_0xb297('0x33')][_0xb297('0x34')]?_0x16faa4[_0xb297('0x33')]:_0x3ddf49[_0xb297('0x2e')];if(!_0x546b57[_0xb297('0x2a')]['hasOwnProperty']('nolimit')){_0x16faa4[_0xb297('0x16')]=qs['limit'](_0x546b57[_0xb297('0x2a')][_0xb297('0x16')]);_0x16faa4[_0xb297('0x14')]=qs[_0xb297('0x14')](_0x546b57[_0xb297('0x2a')][_0xb297('0x14')]);}_0x16faa4[_0xb297('0x45')]=qs[_0xb297('0x46')](_0x546b57[_0xb297('0x2a')][_0xb297('0x46')]);_0x16faa4[_0xb297('0x47')]=qs[_0xb297('0x30')](_[_0xb297('0x48')](_0x546b57[_0xb297('0x2a')],_0x3ddf49[_0xb297('0x30')]));_0x16faa4[_0xb297('0x47')][_0xb297('0x49')]=_0x2ff29c['id'];if(_0x546b57[_0xb297('0x2a')]['filter']){_0x16faa4[_0xb297('0x47')]=_[_0xb297('0x4a')](_0x16faa4[_0xb297('0x47')],{'$or':_['map'](_0x16faa4['attributes'],function(_0x23cce3){var _0x281460={};_0x281460[_0x23cce3]={'$like':'%'+_0x546b57[_0xb297('0x2a')]['filter']+'%'};return _0x281460;})});}if(_0x546b57[_0xb297('0x2a')][_0xb297('0x4b')]){var _0x498bdd=_0x546b57[_0xb297('0x2a')]['$gte'][_0xb297('0x4c')](',');var _0x3597bc={};_0x3597bc[_0x498bdd[0x0]]={'$gte':moment(_0x498bdd[0x1])[_0xb297('0x4d')](_0xb297('0x4e'))};_0x16faa4[_0xb297('0x47')]=_[_0xb297('0x4a')](_0x16faa4['where'],_0x3597bc);}_0x16faa4=_[_0xb297('0x4a')]({},_0x16faa4,_0x546b57[_0xb297('0x4f')]);return db[_0xb297('0x3f')][_0xb297('0x17')]({'where':_0x16faa4[_0xb297('0x47')]})[_0xb297('0x39')](function(_0x47f9af){_0x98cf1e[_0xb297('0x17')]=_0x47f9af;if(_0x546b57['query'][_0xb297('0x35')]){_0x16faa4[_0xb297('0x36')]=[{'all':!![]}];}return db[_0xb297('0x3f')][_0xb297('0x25')](_0x16faa4);})[_0xb297('0x39')](function(_0x12c801){_0x98cf1e['rows']=_0x12c801;return _0x98cf1e;});}})[_0xb297('0x39')](respondWithFilteredResult(_0x24ee04,_0x16faa4))[_0xb297('0x28')](handleError(_0x24ee04,null));};exports['addTags']=function(_0xc6948b,_0x541930){return db[_0xb297('0x37')]['find']({'where':{'id':_0xc6948b[_0xb297('0x2d')]['id']}})[_0xb297('0x39')](handleEntityNotFound(_0x541930,null))['then'](function(_0x452942){if(_0x452942){return _0x452942[_0xb297('0x50')](_0xc6948b[_0xb297('0x3b')][_0xb297('0x42')],_[_0xb297('0x41')](_0xc6948b[_0xb297('0x3b')],[_0xb297('0x42'),'id'])||{})[_0xb297('0x51')](function(){return db[_0xb297('0x52')][_0xb297('0x25')]({'attributes':['id',_0xb297('0x1d'),_0xb297('0x53')],'where':{'id':_0xc6948b[_0xb297('0x3b')]['ids']}});})[_0xb297('0x39')](function(_0x4a0a1c){socket[_0xb297('0x54')](_0xb297('0x55'),{'id':Number(_0xc6948b[_0xb297('0x2d')]['id']),'tags':_0x4a0a1c||[]});return{'id':Number(_0xc6948b[_0xb297('0x2d')]['id']),'tags':_0x4a0a1c||[]};});}})[_0xb297('0x39')](respondWithResult(_0x541930,null))[_0xb297('0x28')](handleError(_0x541930,null));};exports[_0xb297('0x56')]=function(_0x1b1a69,_0x415a4c){return db[_0xb297('0x37')][_0xb297('0x38')]({'where':{'id':_0x1b1a69[_0xb297('0x2d')]['id']}})[_0xb297('0x39')](handleEntityNotFound(_0x415a4c,null))[_0xb297('0x39')](function(_0xcb3f4f){if(_0xcb3f4f){return _0xcb3f4f[_0xb297('0x56')](_0x1b1a69['query'][_0xb297('0x42')]);}})[_0xb297('0x39')](respondWithStatusCode(_0x415a4c,null))[_0xb297('0x28')](handleError(_0x415a4c,null));};exports[_0xb297('0x57')]=function(_0x43fc96,_0x1e919b){var _0x18b17e=moment()[_0xb297('0x58')]()[_0xb297('0x59')]();var _0x1007dd=path['join'](config['root'],_0xb297('0x5a'),_0xb297('0x5b'),_0xb297('0x5c'));var _0x256aa6=path[_0xb297('0x5d')](config[_0xb297('0x5e')],_0xb297('0x5a'),'files',_0xb297('0x5f'));var _0x5583f7=path[_0xb297('0x5d')](_0x1007dd,_0x18b17e);var _0x526d2d=util[_0xb297('0x4d')](_0xb297('0x60'),_0x43fc96[_0xb297('0x2d')]['id'],_0x18b17e);var _0x5959c3=path[_0xb297('0x5d')](_0x1007dd,_0x526d2d);var _0x1e1ec2=[];_0x1e1ec2[_0xb297('0x61')]({'model':db[_0xb297('0x62')],'as':_0xb297('0x62'),'attributes':['id',_0xb297('0x63')],'raw':!![]});_0x1e1ec2[_0xb297('0x61')]({'model':db[_0xb297('0x64')],'as':_0xb297('0x65'),'attributes':['id',_0xb297('0x66'),_0xb297('0x67')],'raw':!![]});if(_0x43fc96[_0xb297('0x2a')][_0xb297('0x5f')]){_0x1e1ec2[_0xb297('0x61')]({'model':db['Attachment'],'as':'Attachment','raw':!![]});}var _0x597107=[{'model':db[_0xb297('0x3f')],'as':_0xb297('0x68'),'attributes':['id',_0xb297('0x3b'),_0xb297('0x69'),'direction','secret','read'],'include':_0x1e1ec2}];_0x597107[_0xb297('0x61')]({'model':db['OpenchannelAccount'],'as':_0xb297('0x6a'),'attributes':['id','name']});_0x597107['push']({'model':db['User'],'as':'Owner','attributes':['id','fullname']});return db[_0xb297('0x37')][_0xb297('0x38')]({'where':{'id':_0x43fc96[_0xb297('0x2d')]['id']},'include':_0x597107})[_0xb297('0x39')](handleEntityNotFound(_0x1e919b,null))['then'](function(_0x3af4e9){if(_0x3af4e9){var _0x3e169b=_0x3af4e9[_0xb297('0x6b')]({'plain':!![]});fs[_0xb297('0x6c')](_0x5583f7);var _0x12e746={'channel':_0xb297('0x6d'),'account':_0x3e169b['Account'][_0xb297('0x1d')],'agent':_0x3e169b[_0xb297('0x6e')]?_0x3e169b[_0xb297('0x6e')]['fullname']:'N.A.','createdAt':moment(_0x3e169b[_0xb297('0x69')])['format']('YYYY-MM-DD\x20HH:mm:ss')[_0xb297('0x59')](),'closedAt':_0x3e169b['closed']?moment(_0x3e169b[_0xb297('0x6f')])[_0xb297('0x4d')](_0xb297('0x4e'))[_0xb297('0x59')]():'','disposition':_0x3e169b['disposition'],'visibility':_0x3e169b[_0xb297('0x70')]?_0xb297('0x71'):_0xb297('0x72'),'messages':_(_0x3e169b['Messages'])[_0xb297('0x73')]({'secret':![]})['map'](function(_0xc1ee15){if(_0xc1ee15[_0xb297('0x74')]){var _0xf0da14=path[_0xb297('0x5d')](_0x256aa6,_0xc1ee15[_0xb297('0x74')]['basename']);if(fs[_0xb297('0x75')](_0xf0da14)){fs[_0xb297('0x76')](_0xf0da14)[_0xb297('0x77')](fs[_0xb297('0x78')](path[_0xb297('0x5d')](_0x5583f7,_0xc1ee15[_0xb297('0x74')][_0xb297('0x79')])));}}return{'date':moment(_0xc1ee15[_0xb297('0x69')])[_0xb297('0x4d')](_0xb297('0x4e'))['toString'](),'sender':_0xc1ee15[_0xb297('0x7a')]==='out'?_0xc1ee15[_0xb297('0x62')]?_0xc1ee15[_0xb297('0x62')][_0xb297('0x63')]:'System':_0xc1ee15[_0xb297('0x65')]['firstName']+(_0xc1ee15[_0xb297('0x65')][_0xb297('0x67')]?'\x20'+_0xc1ee15[_0xb297('0x65')][_0xb297('0x67')]:''),'body':_0xc1ee15[_0xb297('0x74')]?_0xc1ee15[_0xb297('0x74')]['basename']:_0xc1ee15[_0xb297('0x3b')],'direction':_0xc1ee15[_0xb297('0x7a')]===_0xb297('0x7b')?'A':'C','secret':_0xc1ee15[_0xb297('0x7c')],'read':_0xc1ee15[_0xb297('0x7d')],'attachment':_0xc1ee15[_0xb297('0x74')]};})[_0xb297('0x7e')]()};return ejs[_0xb297('0x7f')](path[_0xb297('0x5d')](config[_0xb297('0x5e')],_0xb297('0x5a'),_0xb297('0x80'),_0xb297('0x81')),{'interaction':_0x12e746})[_0xb297('0x39')](function(_0x169d96){var _0xd5b2e2=path['join'](_0x5583f7,'transcript-'+_0x3e169b['id']+'-'+_0x18b17e+_0xb297('0x82'));var _0xb7a00d={'path':_0xd5b2e2,'channel':'Openchannel','interactionId':_0x3e169b['id']};return pdf['createPdfFromHTML'](_0x169d96,_0xb7a00d);})['then'](function(){return new Promise(function(_0x59fcdd,_0x4f4028){zipdir(_0x5583f7,{'saveTo':_0x5959c3},function(_0x1de2e2,_0x15807c){if(_0x1de2e2)return _0x4f4028(_0x1de2e2);return _0x59fcdd(_0x15807c);});})[_0xb297('0x39')](function(){return new Promise(function(_0x3e902b,_0x584b4d){rimraf(_0x5583f7,function(_0x3df887){if(_0x3df887)_0x584b4d(_0x3df887);return _0x3e902b();});});})['then'](function(){return _0x1e919b[_0xb297('0x57')](_0x5959c3,_0x526d2d,function(_0x2d6367){if(_0x2d6367){logger[_0xb297('0x1b')](_0xb297('0x83'),_0x2d6367);}else{fs[_0xb297('0x84')](_0x5959c3);}});});});}else{return _0x1e919b[_0xb297('0x11')](0xc8);}})[_0xb297('0x28')](handleError(_0x1e919b,null));}; \ No newline at end of file diff --git a/server/api/openchannelInteraction/openchannelInteraction.events.js b/server/api/openchannelInteraction/openchannelInteraction.events.js index b8be92f..e9ecfdf 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 _0x33d8=['getUsers','then','map','setDataValue','unreadMessages','length','emit','catch','hasOwnProperty','hook','exports','events','../../mysqldb','OpenchannelInteraction','OpenchannelMessage','setMaxListeners','save','update','remove'];(function(_0x2a453b,_0x479c50){var _0x132f79=function(_0x5e3d83){while(--_0x5e3d83){_0x2a453b['push'](_0x2a453b['shift']());}};_0x132f79(++_0x479c50);}(_0x33d8,0x1e6));var _0x833d=function(_0x1928c9,_0x13a6d1){_0x1928c9=_0x1928c9-0x0;var _0x51b5fb=_0x33d8[_0x1928c9];return _0x51b5fb;};'use strict';var EventEmitter=require(_0x833d('0x0'));var OpenchannelInteraction=require(_0x833d('0x1'))['db'][_0x833d('0x2')];var OpenchannelMessage=require(_0x833d('0x1'))['db'][_0x833d('0x3')];var OpenchannelInteractionEvents=new EventEmitter();OpenchannelInteractionEvents[_0x833d('0x4')](0x0);var events={'afterCreate':_0x833d('0x5'),'afterUpdate':_0x833d('0x6'),'afterDestroy':_0x833d('0x7')};function emitEvent(_0x4564e1){return function(_0xe674d2,_0x41d19,_0x98846b){_0xe674d2[_0x833d('0x8')]({'attributes':['id'],'raw':!![]})[_0x833d('0x9')](function(_0x324eb3){_0xe674d2['setDataValue']('Users',_0x324eb3[_0x833d('0xa')](function(_0x22a1fe){return{'id':_0x22a1fe['id']};}));return OpenchannelMessage['findAll']({'where':{'OpenchannelInteractionId':_0xe674d2['id'],'direction':'in','read':![]},'raw':!![]});})[_0x833d('0x9')](function(_0x1093ca){_0xe674d2[_0x833d('0xb')](_0x833d('0xc'),_0x1093ca[_0x833d('0xd')]);OpenchannelInteractionEvents[_0x833d('0xe')](_0x4564e1+':'+_0xe674d2['id'],_0xe674d2);OpenchannelInteractionEvents[_0x833d('0xe')](_0x4564e1,_0xe674d2);_0x98846b(null);})[_0x833d('0xf')](_0x98846b(null));};}for(var e in events){if(events[_0x833d('0x10')](e)){var event=events[e];OpenchannelInteraction[_0x833d('0x11')](e,emitEvent(event));}}module[_0x833d('0x12')]=OpenchannelInteractionEvents; \ No newline at end of file +var _0xaad6=['update','getUsers','then','setDataValue','Users','map','length','emit','catch','hasOwnProperty','exports','events','../../mysqldb','OpenchannelMessage','setMaxListeners'];(function(_0x362c97,_0xa5c98d){var _0x5e1648=function(_0x2506f5){while(--_0x2506f5){_0x362c97['push'](_0x362c97['shift']());}};_0x5e1648(++_0xa5c98d);}(_0xaad6,0xa1));var _0x6aad=function(_0x994997,_0x47445c){_0x994997=_0x994997-0x0;var _0x43f046=_0xaad6[_0x994997];return _0x43f046;};'use strict';var EventEmitter=require(_0x6aad('0x0'));var OpenchannelInteraction=require(_0x6aad('0x1'))['db']['OpenchannelInteraction'];var OpenchannelMessage=require(_0x6aad('0x1'))['db'][_0x6aad('0x2')];var OpenchannelInteractionEvents=new EventEmitter();OpenchannelInteractionEvents[_0x6aad('0x3')](0x0);var events={'afterCreate':'save','afterUpdate':_0x6aad('0x4'),'afterDestroy':'remove'};function emitEvent(_0x3c3b28){return function(_0x24f350,_0x2e7d22,_0x2202f2){_0x24f350[_0x6aad('0x5')]({'attributes':['id'],'raw':!![]})[_0x6aad('0x6')](function(_0x5a6012){_0x24f350[_0x6aad('0x7')](_0x6aad('0x8'),_0x5a6012[_0x6aad('0x9')](function(_0x5394ab){return{'id':_0x5394ab['id']};}));return OpenchannelMessage['findAll']({'where':{'OpenchannelInteractionId':_0x24f350['id'],'direction':'in','read':![]},'raw':!![]});})[_0x6aad('0x6')](function(_0x5d136a){_0x24f350[_0x6aad('0x7')]('unreadMessages',_0x5d136a[_0x6aad('0xa')]);OpenchannelInteractionEvents[_0x6aad('0xb')](_0x3c3b28+':'+_0x24f350['id'],_0x24f350);OpenchannelInteractionEvents[_0x6aad('0xb')](_0x3c3b28,_0x24f350);_0x2202f2(null);})[_0x6aad('0xc')](_0x2202f2(null));};}for(var e in events){if(events[_0x6aad('0xd')](e)){var event=events[e];OpenchannelInteraction['hook'](e,emitEvent(event));}}module[_0x6aad('0xe')]=OpenchannelInteractionEvents; \ No newline at end of file diff --git a/server/api/openchannelInteraction/openchannelInteraction.model.js b/server/api/openchannelInteraction/openchannelInteraction.model.js index d016180..3bb8cd1 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 _0x7b14=['format','YYYY-MM-DD\x20HH:mm:ss','lodash','bluebird','request-promise','path','rimraf','exports','define','OpenchannelInteraction','openchannel_interactions','utf8mb4','utf8mb4_unicode_ci'];(function(_0xd22d95,_0xc59f8f){var _0x15d7a3=function(_0x3db95c){while(--_0x3db95c){_0xd22d95['push'](_0xd22d95['shift']());}};_0x15d7a3(++_0xc59f8f);}(_0x7b14,0x91));var _0x47b1=function(_0x2ce6cd,_0x4d3a8d){_0x2ce6cd=_0x2ce6cd-0x0;var _0x1543a8=_0x7b14[_0x2ce6cd];return _0x1543a8;};'use strict';var _=require(_0x47b1('0x0'));var util=require('util');var logger=require('../../config/logger')('api');var moment=require('moment');var BPromise=require(_0x47b1('0x1'));var rp=require(_0x47b1('0x2'));var fs=require('fs');var path=require(_0x47b1('0x3'));var rimraf=require(_0x47b1('0x4'));var config=require('../../config/environment');var attributes=require('./openchannelInteraction.attributes');module[_0x47b1('0x5')]=function(_0x317a11,_0x465170){return _0x317a11[_0x47b1('0x6')](_0x47b1('0x7'),attributes,{'tableName':_0x47b1('0x8'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x47b1('0x9'),'collate':_0x47b1('0xa'),'hooks':{'beforeUpdate':function(_0x1f1926,_0x1d3f8a,_0x248b22){if(_0x1f1926['changed']('closed')){_0x1f1926['closedAt']=moment()[_0x47b1('0xb')](_0x47b1('0xc'));}_0x248b22(null,_0x1f1926);}}});}; \ No newline at end of file +var _0xb296=['./openchannelInteraction.attributes','exports','define','OpenchannelInteraction','openchannel_interactions','utf8mb4','changed','closed','closedAt','format','YYYY-MM-DD\x20HH:mm:ss','lodash','util','../../config/logger','api','moment','bluebird','request-promise','rimraf'];(function(_0xd1d19a,_0x1933f0){var _0x52a79d=function(_0x5199e2){while(--_0x5199e2){_0xd1d19a['push'](_0xd1d19a['shift']());}};_0x52a79d(++_0x1933f0);}(_0xb296,0xa3));var _0x6b29=function(_0x1db019,_0xb53012){_0x1db019=_0x1db019-0x0;var _0x51c39d=_0xb296[_0x1db019];return _0x51c39d;};'use strict';var _=require(_0x6b29('0x0'));var util=require(_0x6b29('0x1'));var logger=require(_0x6b29('0x2'))(_0x6b29('0x3'));var moment=require(_0x6b29('0x4'));var BPromise=require(_0x6b29('0x5'));var rp=require(_0x6b29('0x6'));var fs=require('fs');var path=require('path');var rimraf=require(_0x6b29('0x7'));var config=require('../../config/environment');var attributes=require(_0x6b29('0x8'));module[_0x6b29('0x9')]=function(_0x5e0aa1,_0x327329){return _0x5e0aa1[_0x6b29('0xa')](_0x6b29('0xb'),attributes,{'tableName':_0x6b29('0xc'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x6b29('0xd'),'collate':'utf8mb4_unicode_ci','hooks':{'beforeUpdate':function(_0x533b28,_0x13ed7f,_0x40a217){if(_0x533b28[_0x6b29('0xe')](_0x6b29('0xf'))){_0x533b28[_0x6b29('0x10')]=moment()[_0x6b29('0x11')](_0x6b29('0x12'));}_0x40a217(null,_0x533b28);}}});}; \ No newline at end of file diff --git a/server/api/openchannelInteraction/openchannelInteraction.rpc.js b/server/api/openchannelInteraction/openchannelInteraction.rpc.js index c6b842f..bf3bdca 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 _0x4130=['request','then','request\x20sent','OpenchannelInteraction,\x20%s,\x20%s,\x20%s','stringify','error','code','OpenchannelInteraction,\x20%s,\x20%s','message','info','result','UpdateOpenchannelInteraction','OpenchannelInteraction','update','body','options','where','attributes','limit','debug','catch','find','addTags','ids','omit','AddTags','lodash','util','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','http','defaults','redis','localhost','socket.io-emitter','./openchannelInteraction.socket','register'];(function(_0x4baae2,_0x487ab6){var _0x1a2285=function(_0x1cea47){while(--_0x1cea47){_0x4baae2['push'](_0x4baae2['shift']());}};_0x1a2285(++_0x487ab6);}(_0x4130,0x95));var _0x0413=function(_0x2ab62c,_0x25f22a){_0x2ab62c=_0x2ab62c-0x0;var _0x3aef43=_0x4130[_0x2ab62c];return _0x3aef43;};'use strict';var _=require(_0x0413('0x0'));var util=require(_0x0413('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x0413('0x2'));var db=require(_0x0413('0x3'))['db'];var utils=require('../../config/utils');var logger=require(_0x0413('0x4'))(_0x0413('0x5'));var config=require(_0x0413('0x6'));var jayson=require(_0x0413('0x7'));var client=jayson['client'][_0x0413('0x8')]({'port':0x232a});config['redis']=_[_0x0413('0x9')](config[_0x0413('0xa')],{'host':_0x0413('0xb'),'port':0x18eb});var socket=require(_0x0413('0xc'))(new Redis(config['redis']));require(_0x0413('0xd'))[_0x0413('0xe')](socket);function respondWithRpcPromise(_0x468a46,_0x433eab,_0x2eb90f){return new BPromise(function(_0x3effc8,_0x46967a){return client[_0x0413('0xf')](_0x468a46,_0x2eb90f)[_0x0413('0x10')](function(_0x574404){logger['info']('OpenchannelInteraction,\x20%s,\x20%s',_0x433eab,_0x0413('0x11'));logger['debug'](_0x0413('0x12'),_0x433eab,_0x0413('0x11'),JSON[_0x0413('0x13')](_0x574404));if(_0x574404[_0x0413('0x14')]){if(_0x574404[_0x0413('0x14')][_0x0413('0x15')]===0x1f4){logger[_0x0413('0x14')](_0x0413('0x16'),_0x433eab,_0x574404[_0x0413('0x14')][_0x0413('0x17')]);return _0x46967a(_0x574404[_0x0413('0x14')][_0x0413('0x17')]);}logger['error'](_0x0413('0x16'),_0x433eab,_0x574404['error']['message']);return _0x3effc8(_0x574404[_0x0413('0x14')][_0x0413('0x17')]);}else{logger[_0x0413('0x18')]('OpenchannelInteraction,\x20%s,\x20%s',_0x433eab,_0x0413('0x11'));_0x3effc8(_0x574404[_0x0413('0x19')][_0x0413('0x17')]);}})['catch'](function(_0x538159){logger[_0x0413('0x14')]('OpenchannelInteraction,\x20%s,\x20%s',_0x433eab,_0x538159);_0x46967a(_0x538159);});});}exports[_0x0413('0x1a')]=function(_0x1689ce){var _0x436e58=this;return new Promise(function(_0x528f8a,_0x3a7706){return db[_0x0413('0x1b')][_0x0413('0x1c')](_0x1689ce[_0x0413('0x1d')],{'raw':_0x1689ce[_0x0413('0x1e')]?_0x1689ce[_0x0413('0x1e')]['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x1689ce[_0x0413('0x1e')]?_0x1689ce[_0x0413('0x1e')][_0x0413('0x1f')]||null:null,'attributes':_0x1689ce[_0x0413('0x1e')]?_0x1689ce['options'][_0x0413('0x20')]||null:null,'limit':_0x1689ce[_0x0413('0x1e')]?_0x1689ce[_0x0413('0x1e')][_0x0413('0x21')]||null:null})[_0x0413('0x10')](function(_0xd5c999){logger[_0x0413('0x18')](_0x0413('0x1a'),_0x1689ce);logger[_0x0413('0x22')](_0x0413('0x1a'),_0x1689ce,JSON[_0x0413('0x13')](_0xd5c999));_0x528f8a(_0xd5c999);})[_0x0413('0x23')](function(_0x1c0aa1){logger[_0x0413('0x14')](_0x0413('0x1a'),_0x1c0aa1[_0x0413('0x17')],_0x1689ce);_0x3a7706(_0x436e58[_0x0413('0x14')](0x1f4,_0x1c0aa1[_0x0413('0x17')]));});});};exports['AddTagsToOpenchannelInteraction']=function(_0x42fb5c){return new Promise(function(_0x1a042d,_0x1dda8d){return db['OpenchannelInteraction'][_0x0413('0x24')]({'where':_0x42fb5c[_0x0413('0x1e')]?_0x42fb5c[_0x0413('0x1e')]['where']||null:null})[_0x0413('0x10')](function(_0x59d0f6){if(_0x59d0f6){return _0x59d0f6[_0x0413('0x25')](_0x42fb5c[_0x0413('0x1d')][_0x0413('0x26')],_[_0x0413('0x27')](_0x42fb5c[_0x0413('0x1d')],['ids','id'])||{});}})['spread'](function(_0x1db1c9){logger[_0x0413('0x18')](_0x0413('0x28'),_0x42fb5c);logger[_0x0413('0x22')](_0x0413('0x28'),_0x42fb5c,JSON[_0x0413('0x13')](_0x1db1c9));_0x1a042d(_0x1db1c9);})[_0x0413('0x23')](function(_0x367354){logger[_0x0413('0x14')](_0x0413('0x28'),_0x367354[_0x0413('0x17')],_0x42fb5c);_0x1dda8d(_this[_0x0413('0x14')](0x1f4,_0x367354[_0x0413('0x17')]));});});}; \ No newline at end of file +var _0xbbeb=['catch','lodash','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis','defaults','localhost','socket.io-emitter','./openchannelInteraction.socket','register','request','then','info','OpenchannelInteraction,\x20%s,\x20%s','request\x20sent','debug','OpenchannelInteraction,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','UpdateOpenchannelInteraction','update','body','options','raw','attributes','limit','AddTagsToOpenchannelInteraction','OpenchannelInteraction','find','addTags','ids','AddTags'];(function(_0x26a74d,_0x37ecfc){var _0xcbb1a3=function(_0x24b978){while(--_0x24b978){_0x26a74d['push'](_0x26a74d['shift']());}};_0xcbb1a3(++_0x37ecfc);}(_0xbbeb,0x161));var _0xbbbe=function(_0x5ae8f7,_0x330d91){_0x5ae8f7=_0x5ae8f7-0x0;var _0x54c636=_0xbbeb[_0x5ae8f7];return _0x54c636;};'use strict';var _=require(_0xbbbe('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0xbbbe('0x1'));var rs=require(_0xbbbe('0x2'));var fs=require('fs');var Redis=require(_0xbbbe('0x3'));var db=require(_0xbbbe('0x4'))['db'];var utils=require(_0xbbbe('0x5'));var logger=require(_0xbbbe('0x6'))(_0xbbbe('0x7'));var config=require(_0xbbbe('0x8'));var jayson=require(_0xbbbe('0x9'));var client=jayson[_0xbbbe('0xa')][_0xbbbe('0xb')]({'port':0x232a});config[_0xbbbe('0xc')]=_[_0xbbbe('0xd')](config['redis'],{'host':_0xbbbe('0xe'),'port':0x18eb});var socket=require(_0xbbbe('0xf'))(new Redis(config['redis']));require(_0xbbbe('0x10'))[_0xbbbe('0x11')](socket);function respondWithRpcPromise(_0x511056,_0x47f7c0,_0x19ac8d){return new BPromise(function(_0x16ef6c,_0xd6cdd5){return client[_0xbbbe('0x12')](_0x511056,_0x19ac8d)[_0xbbbe('0x13')](function(_0x53e5aa){logger[_0xbbbe('0x14')](_0xbbbe('0x15'),_0x47f7c0,_0xbbbe('0x16'));logger[_0xbbbe('0x17')](_0xbbbe('0x18'),_0x47f7c0,_0xbbbe('0x16'),JSON[_0xbbbe('0x19')](_0x53e5aa));if(_0x53e5aa[_0xbbbe('0x1a')]){if(_0x53e5aa['error'][_0xbbbe('0x1b')]===0x1f4){logger[_0xbbbe('0x1a')](_0xbbbe('0x15'),_0x47f7c0,_0x53e5aa[_0xbbbe('0x1a')]['message']);return _0xd6cdd5(_0x53e5aa['error']['message']);}logger[_0xbbbe('0x1a')](_0xbbbe('0x15'),_0x47f7c0,_0x53e5aa['error'][_0xbbbe('0x1c')]);return _0x16ef6c(_0x53e5aa[_0xbbbe('0x1a')]['message']);}else{logger[_0xbbbe('0x14')](_0xbbbe('0x15'),_0x47f7c0,_0xbbbe('0x16'));_0x16ef6c(_0x53e5aa[_0xbbbe('0x1d')][_0xbbbe('0x1c')]);}})['catch'](function(_0x27df27){logger[_0xbbbe('0x1a')](_0xbbbe('0x15'),_0x47f7c0,_0x27df27);_0xd6cdd5(_0x27df27);});});}exports[_0xbbbe('0x1e')]=function(_0x365614){var _0x66f73e=this;return new Promise(function(_0x431e77,_0x2d1254){return db['OpenchannelInteraction'][_0xbbbe('0x1f')](_0x365614[_0xbbbe('0x20')],{'raw':_0x365614[_0xbbbe('0x21')]?_0x365614[_0xbbbe('0x21')][_0xbbbe('0x22')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x365614[_0xbbbe('0x21')]?_0x365614[_0xbbbe('0x21')]['where']||null:null,'attributes':_0x365614[_0xbbbe('0x21')]?_0x365614[_0xbbbe('0x21')][_0xbbbe('0x23')]||null:null,'limit':_0x365614[_0xbbbe('0x21')]?_0x365614[_0xbbbe('0x21')][_0xbbbe('0x24')]||null:null})['then'](function(_0x58bec9){logger['info'](_0xbbbe('0x1e'),_0x365614);logger[_0xbbbe('0x17')]('UpdateOpenchannelInteraction',_0x365614,JSON[_0xbbbe('0x19')](_0x58bec9));_0x431e77(_0x58bec9);})['catch'](function(_0x485e1a){logger[_0xbbbe('0x1a')](_0xbbbe('0x1e'),_0x485e1a['message'],_0x365614);_0x2d1254(_0x66f73e[_0xbbbe('0x1a')](0x1f4,_0x485e1a[_0xbbbe('0x1c')]));});});};exports[_0xbbbe('0x25')]=function(_0x2477da){return new Promise(function(_0x29476f,_0x24fa11){return db[_0xbbbe('0x26')][_0xbbbe('0x27')]({'where':_0x2477da['options']?_0x2477da[_0xbbbe('0x21')]['where']||null:null})[_0xbbbe('0x13')](function(_0x2ab6be){if(_0x2ab6be){return _0x2ab6be[_0xbbbe('0x28')](_0x2477da['body'][_0xbbbe('0x29')],_['omit'](_0x2477da[_0xbbbe('0x20')],['ids','id'])||{});}})['spread'](function(_0x3b861f){logger[_0xbbbe('0x14')](_0xbbbe('0x2a'),_0x2477da);logger['debug'](_0xbbbe('0x2a'),_0x2477da,JSON['stringify'](_0x3b861f));_0x29476f(_0x3b861f);})[_0xbbbe('0x2b')](function(_0x204171){logger[_0xbbbe('0x1a')]('AddTags',_0x204171['message'],_0x2477da);_0x24fa11(_this['error'](0x1f4,_0x204171[_0xbbbe('0x1c')]));});});}; \ No newline at end of file diff --git a/server/api/openchannelInteraction/openchannelInteraction.socket.js b/server/api/openchannelInteraction/openchannelInteraction.socket.js index a42d01a..56dd4ee 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 _0x62a0=['save','remove','update','emit','register','./openchannelInteraction.events'];(function(_0x551ec8,_0xa8e43d){var _0x1e8b9b=function(_0x19aeba){while(--_0x19aeba){_0x551ec8['push'](_0x551ec8['shift']());}};_0x1e8b9b(++_0xa8e43d);}(_0x62a0,0x143));var _0x062a=function(_0x17e652,_0x16a06e){_0x17e652=_0x17e652-0x0;var _0x48bcf2=_0x62a0[_0x17e652];return _0x48bcf2;};'use strict';var OpenchannelInteractionEvents=require(_0x062a('0x0'));var events=[_0x062a('0x1'),_0x062a('0x2'),_0x062a('0x3')];function createListener(_0x1945b4,_0x47091c){return function(_0x33dfcf){_0x47091c[_0x062a('0x4')](_0x1945b4,_0x33dfcf);};}function removeListener(_0x29635a,_0x100dcb){return function(){OpenchannelInteractionEvents['removeListener'](_0x29635a,_0x100dcb);};}exports[_0x062a('0x5')]=function(_0x44687d){for(var _0x31ea49=0x0,_0x1d5df6=events['length'];_0x31ea49<_0x1d5df6;_0x31ea49++){var _0x44680c=events[_0x31ea49];var _0x441636=createListener('openchannelInteraction:'+_0x44680c,_0x44687d);OpenchannelInteractionEvents['on'](_0x44680c,_0x441636);}}; \ No newline at end of file +var _0xcdd0=['update','removeListener','register','length','openchannelInteraction:','./openchannelInteraction.events','save','remove'];(function(_0x492aa1,_0x4749c9){var _0x49716b=function(_0x2678bd){while(--_0x2678bd){_0x492aa1['push'](_0x492aa1['shift']());}};_0x49716b(++_0x4749c9);}(_0xcdd0,0x7d));var _0x0cdd=function(_0x3b5250,_0x7a0b2c){_0x3b5250=_0x3b5250-0x0;var _0xc844a1=_0xcdd0[_0x3b5250];return _0xc844a1;};'use strict';var OpenchannelInteractionEvents=require(_0x0cdd('0x0'));var events=[_0x0cdd('0x1'),_0x0cdd('0x2'),_0x0cdd('0x3')];function createListener(_0x517120,_0x567796){return function(_0x1f7585){_0x567796['emit'](_0x517120,_0x1f7585);};}function removeListener(_0x3a20d9,_0x1e4515){return function(){OpenchannelInteractionEvents[_0x0cdd('0x4')](_0x3a20d9,_0x1e4515);};}exports[_0x0cdd('0x5')]=function(_0x170976){for(var _0x343a65=0x0,_0x29ce0c=events[_0x0cdd('0x6')];_0x343a65<_0x29ce0c;_0x343a65++){var _0x219f81=events[_0x343a65];var _0x442c0b=createListener(_0x0cdd('0x7')+_0x219f81,_0x170976);OpenchannelInteractionEvents['on'](_0x219f81,_0x442c0b);}}; \ No newline at end of file diff --git a/server/api/openchannelMessage/index.js b/server/api/openchannelMessage/index.js index 15d39c2..47772f5 100644 --- a/server/api/openchannelMessage/index.js +++ b/server/api/openchannelMessage/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xd8b0=['Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','isAuthenticated','index','get','describe','/:id','show','post','tracked','openchannel','openchannelmessage:create','put','update','/:id/accept','accept','/:id/reject','reject','delete','destroy','multer','util'];(function(_0x1ea1e8,_0x5aa4ad){var _0xd2c012=function(_0x42f8c8){while(--_0x42f8c8){_0x1ea1e8['push'](_0x1ea1e8['shift']());}};_0xd2c012(++_0x5aa4ad);}(_0xd8b0,0xad));var _0x0d8b=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0xd8b0[_0x20a584];return _0x4b41a8;};'use strict';var multer=require(_0x0d8b('0x0'));var util=require(_0x0d8b('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require('express');var router=express[_0x0d8b('0x2')]();var fs_extra=require(_0x0d8b('0x3'));var auth=require(_0x0d8b('0x4'));var interaction=require(_0x0d8b('0x5'));var config=require(_0x0d8b('0x6'));var controller=require('./openchannelMessage.controller');router['get']('/',auth[_0x0d8b('0x7')](),controller[_0x0d8b('0x8')]);router[_0x0d8b('0x9')]('/describe',auth[_0x0d8b('0x7')](),controller[_0x0d8b('0xa')]);router['get'](_0x0d8b('0xb'),auth[_0x0d8b('0x7')](),controller[_0x0d8b('0xc')]);router[_0x0d8b('0xd')]('/',auth[_0x0d8b('0x7')](),interaction[_0x0d8b('0xe')](_0x0d8b('0xf'),_0x0d8b('0x10')),controller['create']);router[_0x0d8b('0x11')]('/:id',auth[_0x0d8b('0x7')](),controller[_0x0d8b('0x12')]);router[_0x0d8b('0x11')](_0x0d8b('0x13'),auth[_0x0d8b('0x7')](),controller[_0x0d8b('0x14')]);router[_0x0d8b('0x11')](_0x0d8b('0x15'),auth[_0x0d8b('0x7')](),controller[_0x0d8b('0x16')]);router[_0x0d8b('0x17')](_0x0d8b('0xb'),auth[_0x0d8b('0x7')](),controller[_0x0d8b('0x18')]);module['exports']=router; \ No newline at end of file +var _0xa9e0=['index','/describe','show','post','isAuthenticated','tracked','openchannel','openchannelmessage:create','update','put','/:id/accept','accept','reject','delete','/:id','destroy','multer','util','path','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./openchannelMessage.controller','get'];(function(_0x290e5b,_0x1a3b80){var _0x264805=function(_0x5728a7){while(--_0x5728a7){_0x290e5b['push'](_0x290e5b['shift']());}};_0x264805(++_0x1a3b80);}(_0xa9e0,0x123));var _0x0a9e=function(_0x3054be,_0x1bdc8b){_0x3054be=_0x3054be-0x0;var _0x3df150=_0xa9e0[_0x3054be];return _0x3df150;};'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')](),interaction[_0x0a9e('0xe')](_0x0a9e('0xf'),_0x0a9e('0x10')),controller['create']);router['put']('/:id',auth['isAuthenticated'](),controller[_0x0a9e('0x11')]);router[_0x0a9e('0x12')](_0x0a9e('0x13'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x14')]);router[_0x0a9e('0x12')]('/:id/reject',auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x15')]);router[_0x0a9e('0x16')](_0x0a9e('0x17'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x18')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/openchannelMessage/openchannelMessage.attributes.js b/server/api/openchannelMessage/openchannelMessage.attributes.js index 89eea6a..0dc1617 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 _0xf69c=['BOOLEAN','ENUM','out','DATE','STRING','sequelize','exports','TEXT','medium'];(function(_0x896187,_0x3854e5){var _0x1a55ef=function(_0x443404){while(--_0x443404){_0x896187['push'](_0x896187['shift']());}};_0x1a55ef(++_0x3854e5);}(_0xf69c,0x1e2));var _0xcf69=function(_0x5b4303,_0x225e71){_0x5b4303=_0x5b4303-0x0;var _0x1aacba=_0xf69c[_0x5b4303];return _0x1aacba;};'use strict';var Sequelize=require(_0xcf69('0x0'));module[_0xcf69('0x1')]={'body':{'type':Sequelize[_0xcf69('0x2')](_0xcf69('0x3')),'allowNull':![]},'read':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'secret':{'type':Sequelize[_0xcf69('0x4')],'defaultValue':![]},'direction':{'type':Sequelize[_0xcf69('0x5')]('in',_0xcf69('0x6')),'defaultValue':'out','allowNull':![]},'readAt':{'type':Sequelize[_0xcf69('0x7')]},'providerName':{'type':Sequelize[_0xcf69('0x8')]},'providerResponse':{'type':Sequelize[_0xcf69('0x2')]}}; \ No newline at end of file +var _0x3306=['exports','TEXT','medium','BOOLEAN','ENUM','out','DATE','sequelize'];(function(_0x39e283,_0x247e6b){var _0x7de89f=function(_0x2f8c50){while(--_0x2f8c50){_0x39e283['push'](_0x39e283['shift']());}};_0x7de89f(++_0x247e6b);}(_0x3306,0x107));var _0x6330=function(_0x43c562,_0x395497){_0x43c562=_0x43c562-0x0;var _0x48ab2b=_0x3306[_0x43c562];return _0x48ab2b;};'use strict';var Sequelize=require(_0x6330('0x0'));module[_0x6330('0x1')]={'body':{'type':Sequelize[_0x6330('0x2')](_0x6330('0x3')),'allowNull':![]},'read':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'secret':{'type':Sequelize[_0x6330('0x4')],'defaultValue':![]},'direction':{'type':Sequelize[_0x6330('0x5')]('in',_0x6330('0x6')),'defaultValue':_0x6330('0x6'),'allowNull':![]},'readAt':{'type':Sequelize[_0x6330('0x7')]},'providerName':{'type':Sequelize['STRING']},'providerResponse':{'type':Sequelize[_0x6330('0x2')]}}; \ No newline at end of file diff --git a/server/api/openchannelMessage/openchannelMessage.controller.js b/server/api/openchannelMessage/openchannelMessage.controller.js index 5107621..3e49792 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 _0xdd9e=['catch','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','save','update','destroy','name','send','map','OpenchannelMessage','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','length','sort','where','pick','filter','VIRTUAL','includeAll','include','findAll','show','params','merge','options','find','create','body','describe','openchannel-interactions','accept','openchannel','read','readAt','YYYY-MM-DD\x20HH:mm:ss','UserId','user','get','OpenchannelInteractionId','isNil','read1stAt','interaction','role','null','AcceptMessage','acceptMessage','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','ContactId','sequelize','Sequelize','SELECT','contact','User','agent','internal','interface','format','SIP/%s','channel','motionChannel','event','EventManager','acceptmessage','reject','OpenchannelInteraction','[OPENCHANNELMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','RejectMessage','rejectMessage','fullname','email','rejectmessage','eml-format','fast-json-patch','bluebird','mustache','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/license/util','../../mysqldb','redis','localhost','socket.io-emitter','register','jayson/promise','client','http','request','then','info','OpenchannelMessage,\x20%s,\x20%s','debug','request\x20sent','stringify','error','code','message'];(function(_0x83838,_0x3dbe19){var _0x4ba21d=function(_0x536cc0){while(--_0x536cc0){_0x83838['push'](_0x83838['shift']());}};_0x4ba21d(++_0x3dbe19);}(_0xdd9e,0x1e2));var _0xedd9=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0xdd9e[_0x321bb2];return _0x9c12ed;};'use strict';var emlformat=require(_0xedd9('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0xedd9('0x1'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0xedd9('0x2'));var Mustache=require(_0xedd9('0x3'));var util=require('util');var path=require(_0xedd9('0x4'));var sox=require(_0xedd9('0x5'));var csv=require('to-csv');var ejs=require(_0xedd9('0x6'));var fs=require('fs');var fs_extra=require(_0xedd9('0x7'));var _=require(_0xedd9('0x8'));var squel=require(_0xedd9('0x9'));var crypto=require(_0xedd9('0xa'));var jsforce=require(_0xedd9('0xb'));var deskjs=require(_0xedd9('0xc'));var toCsv=require(_0xedd9('0xd'));var querystring=require(_0xedd9('0xe'));var Papa=require(_0xedd9('0xf'));var Redis=require('ioredis');var authService=require(_0xedd9('0x10'));var qs=require(_0xedd9('0x11'));var as=require(_0xedd9('0x12'));var hardwareService=require(_0xedd9('0x13'));var logger=require(_0xedd9('0x14'))(_0xedd9('0x15'));var utils=require(_0xedd9('0x16'));var config=require('../../config/environment');var licenseUtil=require(_0xedd9('0x17'));var db=require(_0xedd9('0x18'))['db'];config[_0xedd9('0x19')]=_['defaults'](config['redis'],{'host':_0xedd9('0x1a'),'port':0x18eb});var socket=require(_0xedd9('0x1b'))(new Redis(config[_0xedd9('0x19')]));require('./openchannelMessage.socket')[_0xedd9('0x1c')](socket);var jayson=require(_0xedd9('0x1d'));var client=jayson[_0xedd9('0x1e')][_0xedd9('0x1f')]({'port':0x232c});var client9002=jayson[_0xedd9('0x1e')][_0xedd9('0x1f')]({'port':0x232a});function respondWithRpcPromise(_0x50f9d2,_0x2178d9,_0x4f23db,_0x356b7a){return new BPromise(function(_0xc6e926,_0x48d9b9){var _0x3fcd78=_0x356b7a||client;return _0x3fcd78[_0xedd9('0x20')](_0x50f9d2,_0x4f23db)[_0xedd9('0x21')](function(_0x25c581){logger[_0xedd9('0x22')](_0xedd9('0x23'),_0x2178d9,'request\x20sent');logger[_0xedd9('0x24')]('OpenchannelMessage,\x20%s,\x20%s,\x20%s',_0x2178d9,_0xedd9('0x25'),JSON[_0xedd9('0x26')](_0x25c581));if(_0x25c581[_0xedd9('0x27')]){if(_0x25c581[_0xedd9('0x27')][_0xedd9('0x28')]===0x1f4){logger[_0xedd9('0x27')](_0xedd9('0x23'),_0x2178d9,_0x25c581[_0xedd9('0x27')][_0xedd9('0x29')]);return _0x48d9b9(_0x25c581['error']['message']);}logger['error']('OpenchannelMessage,\x20%s,\x20%s',_0x2178d9,_0x25c581[_0xedd9('0x27')][_0xedd9('0x29')]);return _0xc6e926(_0x25c581[_0xedd9('0x27')][_0xedd9('0x29')]);}else{logger[_0xedd9('0x22')](_0xedd9('0x23'),_0x2178d9,_0xedd9('0x25'));_0xc6e926(_0x25c581['result'][_0xedd9('0x29')]);}})[_0xedd9('0x2a')](function(_0x1b4e01){logger[_0xedd9('0x27')](_0xedd9('0x23'),_0x2178d9,_0x1b4e01);_0x48d9b9(_0x1b4e01);});});}function respondWithStatusCode(_0x385b5b,_0x70166d){_0x70166d=_0x70166d||0xcc;return function(_0x367b1e){if(_0x367b1e){return _0x385b5b[_0xedd9('0x2b')](_0x70166d);}return _0x385b5b[_0xedd9('0x2c')](_0x70166d)[_0xedd9('0x2d')]();};}function respondWithResult(_0xa7007,_0x2a8edf){_0x2a8edf=_0x2a8edf||0xc8;return function(_0x412299){if(_0x412299){return _0xa7007['status'](_0x2a8edf)[_0xedd9('0x2e')](_0x412299);}};}function respondWithFilteredResult(_0x58a08a,_0x3fd360){return function(_0x57131d){if(_0x57131d){var _0x569773=typeof _0x3fd360[_0xedd9('0x2f')]===_0xedd9('0x30')&&typeof _0x3fd360[_0xedd9('0x31')]===_0xedd9('0x30');var _0x5da1e0=_0x57131d[_0xedd9('0x32')];var _0x29cac0=_0x569773?0x0:_0x3fd360[_0xedd9('0x2f')];var _0x26a19e=_0x569773?_0x57131d[_0xedd9('0x32')]:_0x3fd360['offset']+_0x3fd360[_0xedd9('0x31')];var _0x3b8b02;if(_0x26a19e>=_0x5da1e0){_0x26a19e=_0x5da1e0;_0x3b8b02=0xc8;}else{_0x3b8b02=0xce;}_0x58a08a[_0xedd9('0x2c')](_0x3b8b02);return _0x58a08a[_0xedd9('0x33')](_0xedd9('0x34'),_0x29cac0+'-'+_0x26a19e+'/'+_0x5da1e0)[_0xedd9('0x2e')](_0x57131d);}return null;};}function patchUpdates(_0x311f6d){return function(_0x5b19a4){try{jsonpatch[_0xedd9('0x35')](_0x5b19a4,_0x311f6d,!![]);}catch(_0x341c80){return BPromise['reject'](_0x341c80);}return _0x5b19a4[_0xedd9('0x36')]();};}function saveUpdates(_0x44b2c2,_0x4183dc){return function(_0x5daa62){if(_0x5daa62){return _0x5daa62[_0xedd9('0x37')](_0x44b2c2)['then'](function(_0x321862){return _0x321862;});}return null;};}function removeEntity(_0x595616,_0xc8d356){return function(_0x2308f1){if(_0x2308f1){return _0x2308f1[_0xedd9('0x38')]()[_0xedd9('0x21')](function(){_0x595616[_0xedd9('0x2c')](0xcc)[_0xedd9('0x2d')]();});}};}function handleEntityNotFound(_0x5507c0,_0x22616b){return function(_0x12591c){if(!_0x12591c){_0x5507c0[_0xedd9('0x2b')](0x194);}return _0x12591c;};}function handleError(_0x2da21a,_0x31b32e){_0x31b32e=_0x31b32e||0x1f4;return function(_0x15d971){logger[_0xedd9('0x27')](_0x15d971['stack']);if(_0x15d971[_0xedd9('0x39')]){delete _0x15d971[_0xedd9('0x39')];}_0x2da21a['status'](_0x31b32e)[_0xedd9('0x3a')](_0x15d971);};}exports['index']=function(_0x3d5802,_0x2ba738){var _0x397e38={},_0x22bd7e={},_0x36a5c1={'count':0x0,'rows':[]};var _0x430592=_[_0xedd9('0x3b')](db[_0xedd9('0x3c')][_0xedd9('0x3d')],function(_0x4f6154){return{'name':_0x4f6154[_0xedd9('0x3e')],'type':_0x4f6154[_0xedd9('0x3f')][_0xedd9('0x40')]};});_0x22bd7e[_0xedd9('0x41')]=_[_0xedd9('0x3b')](_0x430592,_0xedd9('0x39'));_0x22bd7e[_0xedd9('0x42')]=_[_0xedd9('0x43')](_0x3d5802[_0xedd9('0x42')]);_0x22bd7e[_0xedd9('0x44')]=_[_0xedd9('0x45')](_0x22bd7e[_0xedd9('0x41')],_0x22bd7e[_0xedd9('0x42')]);_0x397e38[_0xedd9('0x46')]=_[_0xedd9('0x45')](_0x22bd7e[_0xedd9('0x41')],qs[_0xedd9('0x47')](_0x3d5802[_0xedd9('0x42')][_0xedd9('0x47')]));_0x397e38[_0xedd9('0x46')]=_0x397e38[_0xedd9('0x46')][_0xedd9('0x48')]?_0x397e38[_0xedd9('0x46')]:_0x22bd7e[_0xedd9('0x41')];if(!_0x3d5802[_0xedd9('0x42')]['hasOwnProperty']('nolimit')){_0x397e38[_0xedd9('0x31')]=qs[_0xedd9('0x31')](_0x3d5802[_0xedd9('0x42')][_0xedd9('0x31')]);_0x397e38['offset']=qs[_0xedd9('0x2f')](_0x3d5802[_0xedd9('0x42')]['offset']);}_0x397e38['order']=qs['sort'](_0x3d5802['query'][_0xedd9('0x49')]);_0x397e38[_0xedd9('0x4a')]=qs[_0xedd9('0x44')](_[_0xedd9('0x4b')](_0x3d5802['query'],_0x22bd7e[_0xedd9('0x44')]),_0x430592);if(_0x3d5802[_0xedd9('0x42')][_0xedd9('0x4c')]){_0x397e38[_0xedd9('0x4a')]=_['merge'](_0x397e38[_0xedd9('0x4a')],{'$or':_[_0xedd9('0x3b')](_0x430592,function(_0x41286e){if(_0x41286e[_0xedd9('0x3f')]!==_0xedd9('0x4d')){var _0x5e2f8f={};_0x5e2f8f[_0x41286e[_0xedd9('0x39')]]={'$like':'%'+_0x3d5802[_0xedd9('0x42')]['filter']+'%'};return _0x5e2f8f;}})});}_0x397e38=_['merge']({},_0x397e38,_0x3d5802['options']);var _0x227cd6={'where':_0x397e38['where']};return db['OpenchannelMessage'][_0xedd9('0x32')](_0x227cd6)['then'](function(_0x5ee99f){_0x36a5c1['count']=_0x5ee99f;if(_0x3d5802[_0xedd9('0x42')][_0xedd9('0x4e')]){_0x397e38[_0xedd9('0x4f')]=[{'all':!![]}];}return db[_0xedd9('0x3c')][_0xedd9('0x50')](_0x397e38);})['then'](function(_0x35f0e1){_0x36a5c1['rows']=_0x35f0e1;return _0x36a5c1;})[_0xedd9('0x21')](respondWithFilteredResult(_0x2ba738,_0x397e38))[_0xedd9('0x2a')](handleError(_0x2ba738,null));};exports[_0xedd9('0x51')]=function(_0x5e7bd2,_0x28ab0a){var _0x4eaec4={'raw':!![],'where':{'id':_0x5e7bd2[_0xedd9('0x52')]['id']}},_0x336334={};_0x336334['model']=_['keys'](db[_0xedd9('0x3c')][_0xedd9('0x3d')]);_0x336334[_0xedd9('0x42')]=_[_0xedd9('0x43')](_0x5e7bd2[_0xedd9('0x42')]);_0x336334[_0xedd9('0x44')]=_['intersection'](_0x336334[_0xedd9('0x41')],_0x336334[_0xedd9('0x42')]);_0x4eaec4[_0xedd9('0x46')]=_[_0xedd9('0x45')](_0x336334['model'],qs[_0xedd9('0x47')](_0x5e7bd2[_0xedd9('0x42')]['fields']));_0x4eaec4[_0xedd9('0x46')]=_0x4eaec4['attributes'][_0xedd9('0x48')]?_0x4eaec4[_0xedd9('0x46')]:_0x336334[_0xedd9('0x41')];if(_0x5e7bd2['query'][_0xedd9('0x4e')]){_0x4eaec4[_0xedd9('0x4f')]=[{'all':!![]}];}_0x4eaec4=_[_0xedd9('0x53')]({},_0x4eaec4,_0x5e7bd2[_0xedd9('0x54')]);return db[_0xedd9('0x3c')][_0xedd9('0x55')](_0x4eaec4)[_0xedd9('0x21')](handleEntityNotFound(_0x28ab0a,null))[_0xedd9('0x21')](respondWithResult(_0x28ab0a,null))['catch'](handleError(_0x28ab0a,null));};exports[_0xedd9('0x56')]=function(_0xd3daa6,_0x1f78b7){return db['OpenchannelMessage']['create'](_0xd3daa6[_0xedd9('0x57')],{})['then'](respondWithResult(_0x1f78b7,0xc9))[_0xedd9('0x2a')](handleError(_0x1f78b7,null));};exports['update']=function(_0x30f0cb,_0xcdf353){if(_0x30f0cb[_0xedd9('0x57')]['id']){delete _0x30f0cb[_0xedd9('0x57')]['id'];}return db[_0xedd9('0x3c')][_0xedd9('0x55')]({'where':{'id':_0x30f0cb['params']['id']}})[_0xedd9('0x21')](handleEntityNotFound(_0xcdf353,null))[_0xedd9('0x21')](saveUpdates(_0x30f0cb[_0xedd9('0x57')],null))[_0xedd9('0x21')](respondWithResult(_0xcdf353,null))[_0xedd9('0x2a')](handleError(_0xcdf353,null));};exports[_0xedd9('0x38')]=function(_0x2af261,_0x38a8c2){return db[_0xedd9('0x3c')][_0xedd9('0x55')]({'where':{'id':_0x2af261[_0xedd9('0x52')]['id']}})[_0xedd9('0x21')](handleEntityNotFound(_0x38a8c2,null))['then'](removeEntity(_0x38a8c2,null))[_0xedd9('0x2a')](handleError(_0x38a8c2,null));};exports[_0xedd9('0x58')]=function(_0x4e9109,_0x428ba8){return db[_0xedd9('0x3c')][_0xedd9('0x58')]()[_0xedd9('0x21')](respondWithResult(_0x428ba8,null))[_0xedd9('0x2a')](handleError(_0x428ba8,null));};var interaction_log=require(_0xedd9('0x14'))(_0xedd9('0x59'));exports[_0xedd9('0x5a')]=function(_0x7b3393,_0x3806e9,_0x28311b){var _0x2670c1={'agent':{},'channel':_0xedd9('0x5b')};if(_0x7b3393['body']['id']){delete _0x7b3393[_0xedd9('0x57')]['id'];}_0x7b3393[_0xedd9('0x57')][_0xedd9('0x5c')]=!![];_0x7b3393[_0xedd9('0x57')][_0xedd9('0x5d')]=moment()['format'](_0xedd9('0x5e'));_0x7b3393[_0xedd9('0x57')][_0xedd9('0x5f')]=_0x7b3393[_0xedd9('0x57')][_0xedd9('0x5f')]||_0x7b3393[_0xedd9('0x60')]['id'];_0x2670c1['agent']['id']=_0x7b3393['body'][_0xedd9('0x5f')];return db['OpenchannelMessage']['find']({'where':{'id':_0x7b3393[_0xedd9('0x52')]['id'],'UserId':null}})['then'](handleEntityNotFound(_0x3806e9,null))[_0xedd9('0x21')](saveUpdates(_0x7b3393[_0xedd9('0x57')],null))[_0xedd9('0x21')](function(_0x26badd){if(_0x26badd){_0x2670c1[_0xedd9('0x29')]=_0x26badd[_0xedd9('0x61')]({'plain':!![]});return db['OpenchannelInteraction'][_0xedd9('0x55')]({'where':{'id':_0x26badd[_0xedd9('0x62')]}});}return null;})[_0xedd9('0x21')](handleEntityNotFound(_0x3806e9,null))[_0xedd9('0x21')](function(_0x1411b6){if(_0x1411b6){return _0x1411b6['update']({'UserId':_0x7b3393[_0xedd9('0x57')][_0xedd9('0x5f')],'read1stAt':_[_0xedd9('0x63')](_0x1411b6[_0xedd9('0x64')])?moment()['format'](_0xedd9('0x5e')):undefined});}return null;})[_0xedd9('0x21')](function(_0x35c567){if(_0x35c567){_0x2670c1[_0xedd9('0x65')]=_0x35c567[_0xedd9('0x61')]({'plain':!![]});interaction_log['info']('[OPENCHANNELMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s',_0x7b3393[_0xedd9('0x60')]['id'],_0x7b3393[_0xedd9('0x60')]['name'],_0x7b3393['user'][_0xedd9('0x66')],_0x2670c1[_0xedd9('0x65')]['id'],_0x7b3393['body']?JSON[_0xedd9('0x26')](_0x7b3393[_0xedd9('0x57')]):_0xedd9('0x67'));return respondWithRpcPromise(_0xedd9('0x68'),_0xedd9('0x69'),_0x2670c1);}return null;})[_0xedd9('0x21')](function(_0x5b363e){var _0x1cf866=_0xedd9('0x6a')+_0x5b363e[_0xedd9('0x29')][_0xedd9('0x6b')];return db[_0xedd9('0x6c')]['query'](_0x1cf866,{'type':db[_0xedd9('0x6d')]['QueryTypes'][_0xedd9('0x6e')],'raw':!![]})[_0xedd9('0x21')](function(_0x4c0bef){return _0x4c0bef;});})['then'](function(_0x3c4813){if(_0x3c4813){_0x2670c1[_0xedd9('0x29')][_0xedd9('0x6f')]=_0x3c4813[0x0];if(!_0x7b3393['body']['UserId'])return;return db[_0xedd9('0x70')]['find']({'where':{'id':_0x7b3393[_0xedd9('0x57')][_0xedd9('0x5f')],'role':_0xedd9('0x71')},'attributes':['id',_0xedd9('0x39'),'fullname','email',_0xedd9('0x72')],'raw':!![]});}return null;})[_0xedd9('0x21')](function(_0x2a0088){if(!_0x2a0088)return null;_0x2670c1[_0xedd9('0x29')]['agent']=_0x2a0088;return _0x2670c1;})[_0xedd9('0x21')](function(_0x23391e){if(_0x23391e){if(_0x7b3393[_0xedd9('0x57')]['manual']){_0x2670c1[_0xedd9('0x29')][_0xedd9('0x73')]=util[_0xedd9('0x74')](_0xedd9('0x75'),_0x7b3393['user'][_0xedd9('0x39')]);_0x2670c1[_0xedd9('0x29')][_0xedd9('0x76')]=_0x2670c1[_0xedd9('0x76')];_0x2670c1[_0xedd9('0x29')][_0xedd9('0x77')]=_0x2670c1[_0xedd9('0x76')];_0x2670c1[_0xedd9('0x29')][_0xedd9('0x78')]=_0xedd9('0x5a');return respondWithRpcPromise(_0xedd9('0x79'),_0xedd9('0x79'),{'event':_0xedd9('0x7a'),'message':_0x2670c1['message']},client9002)[_0xedd9('0x21')](function(){return _0x2670c1;});}return _0x2670c1;}return null;})['then'](respondWithResult(_0x3806e9,null))['catch'](handleError(_0x3806e9,null));};var interaction_log=require(_0xedd9('0x14'))(_0xedd9('0x59'));exports[_0xedd9('0x7b')]=function(_0x9c12aa,_0x1418fd,_0x49d6f5){var _0x622f41={'agent':{},'channel':_0xedd9('0x5b')};if(_0x9c12aa[_0xedd9('0x57')]['id']){delete _0x9c12aa['body']['id'];}_0x9c12aa[_0xedd9('0x57')][_0xedd9('0x5f')]=_0x9c12aa[_0xedd9('0x57')][_0xedd9('0x5f')]||_0x9c12aa[_0xedd9('0x60')]['id'];_0x622f41[_0xedd9('0x71')]['id']=_0x9c12aa[_0xedd9('0x57')][_0xedd9('0x5f')];return db['OpenchannelMessage']['find']({'where':{'id':_0x9c12aa[_0xedd9('0x52')]['id'],'UserId':null}})[_0xedd9('0x21')](handleEntityNotFound(_0x1418fd,null))[_0xedd9('0x21')](function(_0x48f40e){if(_0x48f40e){_0x622f41[_0xedd9('0x29')]=_0x48f40e[_0xedd9('0x61')]({'plain':!![]});return db[_0xedd9('0x7c')][_0xedd9('0x55')]({'where':{'id':_0x48f40e[_0xedd9('0x62')]}});}return null;})[_0xedd9('0x21')](handleEntityNotFound(_0x1418fd,null))[_0xedd9('0x21')](function(_0xc7c785){if(_0xc7c785){_0x622f41[_0xedd9('0x65')]=_0xc7c785['get']({'plain':!![]});interaction_log[_0xedd9('0x22')](_0xedd9('0x7d'),_0x9c12aa[_0xedd9('0x60')]['id'],_0x9c12aa[_0xedd9('0x60')][_0xedd9('0x39')],_0x9c12aa[_0xedd9('0x60')][_0xedd9('0x66')],_0x622f41[_0xedd9('0x65')]['id'],_0x9c12aa[_0xedd9('0x57')]?JSON[_0xedd9('0x26')](_0x9c12aa[_0xedd9('0x57')]):_0xedd9('0x67'));return respondWithRpcPromise(_0xedd9('0x7e'),_0xedd9('0x7f'),_0x622f41);}return null;})['then'](function(_0x33345c){var _0x5a075d=_0xedd9('0x6a')+_0x33345c[_0xedd9('0x29')]['ContactId'];return db[_0xedd9('0x6c')][_0xedd9('0x42')](_0x5a075d,{'type':db[_0xedd9('0x6d')]['QueryTypes'][_0xedd9('0x6e')],'raw':!![]})[_0xedd9('0x21')](function(_0x8376a5){return _0x8376a5;});})['then'](function(_0x445a8e){if(_0x445a8e){_0x622f41[_0xedd9('0x29')][_0xedd9('0x6f')]=_0x445a8e[0x0];if(!_0x9c12aa[_0xedd9('0x57')][_0xedd9('0x5f')])return;return db[_0xedd9('0x70')][_0xedd9('0x55')]({'where':{'id':_0x9c12aa[_0xedd9('0x57')][_0xedd9('0x5f')],'role':_0xedd9('0x71')},'attributes':['id','name',_0xedd9('0x80'),_0xedd9('0x81'),_0xedd9('0x72')],'raw':!![]});}return null;})['then'](function(_0x1bbb5c){if(!_0x1bbb5c)return null;_0x622f41['message']['agent']=_0x1bbb5c;return _0x622f41;})[_0xedd9('0x21')](function(_0x2a5f8d){if(_0x2a5f8d){_0x2a5f8d[_0xedd9('0x29')][_0xedd9('0x73')]=util[_0xedd9('0x74')](_0xedd9('0x75'),_0x9c12aa[_0xedd9('0x60')][_0xedd9('0x39')]);_0x2a5f8d['message']['channel']=_0x622f41[_0xedd9('0x76')];_0x2a5f8d[_0xedd9('0x29')][_0xedd9('0x77')]=_0x622f41[_0xedd9('0x76')];_0x2a5f8d['message']['event']=_0xedd9('0x7b');respondWithRpcPromise(_0xedd9('0x79'),'EventManager',{'event':_0xedd9('0x82'),'message':_0x2a5f8d[_0xedd9('0x29')]},client9002);return _0x622f41;}return null;})[_0xedd9('0x21')](respondWithResult(_0x1418fd,null))[_0xedd9('0x2a')](handleError(_0x1418fd,null));}; \ No newline at end of file +var _0xe056=['send','index','map','OpenchannelMessage','rawAttributes','fieldName','model','query','filters','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','where','pick','merge','filter','options','includeAll','include','findAll','rows','catch','params','keys','length','find','create','body','describe','openchannel-interactions','accept','read','YYYY-MM-DD\x20HH:mm:ss','UserId','user','get','OpenchannelInteractionId','isNil','read1stAt','interaction','role','null','AcceptMessage','acceptMessage','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','ContactId','sequelize','QueryTypes','SELECT','contact','agent','fullname','internal','manual','interface','SIP/%s','channel','motionChannel','event','EventManager','openchannel','OpenchannelInteraction','[OPENCHANNELMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','RejectMessage','User','format','eml-format','rimraf','zip-dir','moment','bluebird','mustache','util','path','to-csv','ejs','fs-extra','lodash','squel','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./openchannelMessage.socket','jayson/promise','client','http','then','info','request\x20sent','debug','stringify','error','OpenchannelMessage,\x20%s,\x20%s','message','result','sendStatus','status','end','json','undefined','limit','count','offset','set','Content-Range','reject','save','update','destroy','stack','name'];(function(_0x2f1865,_0x50025b){var _0x2fd27f=function(_0x5d25a6){while(--_0x5d25a6){_0x2f1865['push'](_0x2f1865['shift']());}};_0x2fd27f(++_0x50025b);}(_0xe056,0xc5));var _0x6e05=function(_0x31dde9,_0x12e816){_0x31dde9=_0x31dde9-0x0;var _0x1fbf2d=_0xe056[_0x31dde9];return _0x1fbf2d;};'use strict';var emlformat=require(_0x6e05('0x0'));var rimraf=require(_0x6e05('0x1'));var zipdir=require(_0x6e05('0x2'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0x6e05('0x3'));var BPromise=require(_0x6e05('0x4'));var Mustache=require(_0x6e05('0x5'));var util=require(_0x6e05('0x6'));var path=require(_0x6e05('0x7'));var sox=require('sox');var csv=require(_0x6e05('0x8'));var ejs=require(_0x6e05('0x9'));var fs=require('fs');var fs_extra=require(_0x6e05('0xa'));var _=require(_0x6e05('0xb'));var squel=require(_0x6e05('0xc'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0x6e05('0x8'));var querystring=require(_0x6e05('0xd'));var Papa=require(_0x6e05('0xe'));var Redis=require(_0x6e05('0xf'));var authService=require(_0x6e05('0x10'));var qs=require(_0x6e05('0x11'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x6e05('0x12'));var logger=require(_0x6e05('0x13'))(_0x6e05('0x14'));var utils=require(_0x6e05('0x15'));var config=require(_0x6e05('0x16'));var licenseUtil=require('../../config/license/util');var db=require(_0x6e05('0x17'))['db'];config[_0x6e05('0x18')]=_[_0x6e05('0x19')](config['redis'],{'host':_0x6e05('0x1a'),'port':0x18eb});var socket=require(_0x6e05('0x1b'))(new Redis(config['redis']));require(_0x6e05('0x1c'))['register'](socket);var jayson=require(_0x6e05('0x1d'));var client=jayson[_0x6e05('0x1e')][_0x6e05('0x1f')]({'port':0x232c});var client9002=jayson[_0x6e05('0x1e')]['http']({'port':0x232a});function respondWithRpcPromise(_0x18a656,_0x3052d0,_0x318106,_0x4e86d3){return new BPromise(function(_0x530b00,_0x5bf401){var _0xe6a7e5=_0x4e86d3||client;return _0xe6a7e5['request'](_0x18a656,_0x318106)[_0x6e05('0x20')](function(_0x343239){logger[_0x6e05('0x21')]('OpenchannelMessage,\x20%s,\x20%s',_0x3052d0,_0x6e05('0x22'));logger[_0x6e05('0x23')]('OpenchannelMessage,\x20%s,\x20%s,\x20%s',_0x3052d0,'request\x20sent',JSON[_0x6e05('0x24')](_0x343239));if(_0x343239['error']){if(_0x343239[_0x6e05('0x25')]['code']===0x1f4){logger[_0x6e05('0x25')](_0x6e05('0x26'),_0x3052d0,_0x343239[_0x6e05('0x25')][_0x6e05('0x27')]);return _0x5bf401(_0x343239[_0x6e05('0x25')]['message']);}logger['error']('OpenchannelMessage,\x20%s,\x20%s',_0x3052d0,_0x343239['error'][_0x6e05('0x27')]);return _0x530b00(_0x343239[_0x6e05('0x25')][_0x6e05('0x27')]);}else{logger[_0x6e05('0x21')](_0x6e05('0x26'),_0x3052d0,_0x6e05('0x22'));_0x530b00(_0x343239[_0x6e05('0x28')][_0x6e05('0x27')]);}})['catch'](function(_0x7a1cc2){logger[_0x6e05('0x25')](_0x6e05('0x26'),_0x3052d0,_0x7a1cc2);_0x5bf401(_0x7a1cc2);});});}function respondWithStatusCode(_0x462487,_0x342dd1){_0x342dd1=_0x342dd1||0xcc;return function(_0x126232){if(_0x126232){return _0x462487[_0x6e05('0x29')](_0x342dd1);}return _0x462487[_0x6e05('0x2a')](_0x342dd1)[_0x6e05('0x2b')]();};}function respondWithResult(_0x4cfb23,_0x36a042){_0x36a042=_0x36a042||0xc8;return function(_0xdc7f72){if(_0xdc7f72){return _0x4cfb23[_0x6e05('0x2a')](_0x36a042)[_0x6e05('0x2c')](_0xdc7f72);}};}function respondWithFilteredResult(_0x1fe825,_0xe3a4c8){return function(_0x3fbca5){if(_0x3fbca5){var _0x4d1b2c=typeof _0xe3a4c8['offset']===_0x6e05('0x2d')&&typeof _0xe3a4c8[_0x6e05('0x2e')]===_0x6e05('0x2d');var _0x3f9668=_0x3fbca5[_0x6e05('0x2f')];var _0x2b4ce7=_0x4d1b2c?0x0:_0xe3a4c8[_0x6e05('0x30')];var _0x159f77=_0x4d1b2c?_0x3fbca5['count']:_0xe3a4c8[_0x6e05('0x30')]+_0xe3a4c8[_0x6e05('0x2e')];var _0x477523;if(_0x159f77>=_0x3f9668){_0x159f77=_0x3f9668;_0x477523=0xc8;}else{_0x477523=0xce;}_0x1fe825[_0x6e05('0x2a')](_0x477523);return _0x1fe825[_0x6e05('0x31')](_0x6e05('0x32'),_0x2b4ce7+'-'+_0x159f77+'/'+_0x3f9668)['json'](_0x3fbca5);}return null;};}function patchUpdates(_0x43fb7b){return function(_0x383c69){try{jsonpatch['apply'](_0x383c69,_0x43fb7b,!![]);}catch(_0x42c2a8){return BPromise[_0x6e05('0x33')](_0x42c2a8);}return _0x383c69[_0x6e05('0x34')]();};}function saveUpdates(_0x5cef27,_0x4ed619){return function(_0x47d8b0){if(_0x47d8b0){return _0x47d8b0[_0x6e05('0x35')](_0x5cef27)[_0x6e05('0x20')](function(_0x2791b3){return _0x2791b3;});}return null;};}function removeEntity(_0x15a20b,_0x16a343){return function(_0x10c3ce){if(_0x10c3ce){return _0x10c3ce[_0x6e05('0x36')]()[_0x6e05('0x20')](function(){_0x15a20b[_0x6e05('0x2a')](0xcc)[_0x6e05('0x2b')]();});}};}function handleEntityNotFound(_0x360576,_0x23f3f7){return function(_0x188260){if(!_0x188260){_0x360576[_0x6e05('0x29')](0x194);}return _0x188260;};}function handleError(_0x28c249,_0x506cfd){_0x506cfd=_0x506cfd||0x1f4;return function(_0x33d042){logger[_0x6e05('0x25')](_0x33d042[_0x6e05('0x37')]);if(_0x33d042[_0x6e05('0x38')]){delete _0x33d042[_0x6e05('0x38')];}_0x28c249[_0x6e05('0x2a')](_0x506cfd)[_0x6e05('0x39')](_0x33d042);};}exports[_0x6e05('0x3a')]=function(_0x1e7d7e,_0x4cb470){var _0x2c2131={},_0x545f3c={},_0x440d21={'count':0x0,'rows':[]};var _0x245147=_[_0x6e05('0x3b')](db[_0x6e05('0x3c')][_0x6e05('0x3d')],function(_0x123cb0){return{'name':_0x123cb0[_0x6e05('0x3e')],'type':_0x123cb0['type']['key']};});_0x545f3c[_0x6e05('0x3f')]=_[_0x6e05('0x3b')](_0x245147,'name');_0x545f3c[_0x6e05('0x40')]=_['keys'](_0x1e7d7e[_0x6e05('0x40')]);_0x545f3c[_0x6e05('0x41')]=_[_0x6e05('0x42')](_0x545f3c['model'],_0x545f3c[_0x6e05('0x40')]);_0x2c2131[_0x6e05('0x43')]=_['intersection'](_0x545f3c['model'],qs[_0x6e05('0x44')](_0x1e7d7e[_0x6e05('0x40')]['fields']));_0x2c2131['attributes']=_0x2c2131[_0x6e05('0x43')]['length']?_0x2c2131['attributes']:_0x545f3c['model'];if(!_0x1e7d7e[_0x6e05('0x40')][_0x6e05('0x45')](_0x6e05('0x46'))){_0x2c2131[_0x6e05('0x2e')]=qs[_0x6e05('0x2e')](_0x1e7d7e['query'][_0x6e05('0x2e')]);_0x2c2131[_0x6e05('0x30')]=qs[_0x6e05('0x30')](_0x1e7d7e[_0x6e05('0x40')][_0x6e05('0x30')]);}_0x2c2131[_0x6e05('0x47')]=qs['sort'](_0x1e7d7e[_0x6e05('0x40')][_0x6e05('0x48')]);_0x2c2131[_0x6e05('0x49')]=qs[_0x6e05('0x41')](_[_0x6e05('0x4a')](_0x1e7d7e[_0x6e05('0x40')],_0x545f3c['filters']),_0x245147);if(_0x1e7d7e['query']['filter']){_0x2c2131[_0x6e05('0x49')]=_[_0x6e05('0x4b')](_0x2c2131[_0x6e05('0x49')],{'$or':_[_0x6e05('0x3b')](_0x245147,function(_0x5d88d9){if(_0x5d88d9['type']!=='VIRTUAL'){var _0x29d61e={};_0x29d61e[_0x5d88d9[_0x6e05('0x38')]]={'$like':'%'+_0x1e7d7e[_0x6e05('0x40')][_0x6e05('0x4c')]+'%'};return _0x29d61e;}})});}_0x2c2131=_[_0x6e05('0x4b')]({},_0x2c2131,_0x1e7d7e[_0x6e05('0x4d')]);var _0x17c3c9={'where':_0x2c2131[_0x6e05('0x49')]};return db['OpenchannelMessage'][_0x6e05('0x2f')](_0x17c3c9)[_0x6e05('0x20')](function(_0x59ca3c){_0x440d21[_0x6e05('0x2f')]=_0x59ca3c;if(_0x1e7d7e[_0x6e05('0x40')][_0x6e05('0x4e')]){_0x2c2131[_0x6e05('0x4f')]=[{'all':!![]}];}return db[_0x6e05('0x3c')][_0x6e05('0x50')](_0x2c2131);})['then'](function(_0x54d9e4){_0x440d21[_0x6e05('0x51')]=_0x54d9e4;return _0x440d21;})['then'](respondWithFilteredResult(_0x4cb470,_0x2c2131))[_0x6e05('0x52')](handleError(_0x4cb470,null));};exports['show']=function(_0xb8391c,_0x300f22){var _0x5632e4={'raw':!![],'where':{'id':_0xb8391c[_0x6e05('0x53')]['id']}},_0x166fa8={};_0x166fa8[_0x6e05('0x3f')]=_[_0x6e05('0x54')](db[_0x6e05('0x3c')][_0x6e05('0x3d')]);_0x166fa8[_0x6e05('0x40')]=_[_0x6e05('0x54')](_0xb8391c[_0x6e05('0x40')]);_0x166fa8['filters']=_['intersection'](_0x166fa8[_0x6e05('0x3f')],_0x166fa8[_0x6e05('0x40')]);_0x5632e4['attributes']=_['intersection'](_0x166fa8[_0x6e05('0x3f')],qs[_0x6e05('0x44')](_0xb8391c[_0x6e05('0x40')][_0x6e05('0x44')]));_0x5632e4['attributes']=_0x5632e4['attributes'][_0x6e05('0x55')]?_0x5632e4[_0x6e05('0x43')]:_0x166fa8[_0x6e05('0x3f')];if(_0xb8391c[_0x6e05('0x40')][_0x6e05('0x4e')]){_0x5632e4[_0x6e05('0x4f')]=[{'all':!![]}];}_0x5632e4=_[_0x6e05('0x4b')]({},_0x5632e4,_0xb8391c[_0x6e05('0x4d')]);return db[_0x6e05('0x3c')][_0x6e05('0x56')](_0x5632e4)[_0x6e05('0x20')](handleEntityNotFound(_0x300f22,null))['then'](respondWithResult(_0x300f22,null))[_0x6e05('0x52')](handleError(_0x300f22,null));};exports[_0x6e05('0x57')]=function(_0x5aedb2,_0x11da4f){return db['OpenchannelMessage'][_0x6e05('0x57')](_0x5aedb2[_0x6e05('0x58')],{})[_0x6e05('0x20')](respondWithResult(_0x11da4f,0xc9))['catch'](handleError(_0x11da4f,null));};exports['update']=function(_0x1ae2a7,_0x1c6fc6){if(_0x1ae2a7[_0x6e05('0x58')]['id']){delete _0x1ae2a7['body']['id'];}return db[_0x6e05('0x3c')]['find']({'where':{'id':_0x1ae2a7[_0x6e05('0x53')]['id']}})[_0x6e05('0x20')](handleEntityNotFound(_0x1c6fc6,null))[_0x6e05('0x20')](saveUpdates(_0x1ae2a7[_0x6e05('0x58')],null))['then'](respondWithResult(_0x1c6fc6,null))[_0x6e05('0x52')](handleError(_0x1c6fc6,null));};exports['destroy']=function(_0x31e7c6,_0xad9135){return db[_0x6e05('0x3c')][_0x6e05('0x56')]({'where':{'id':_0x31e7c6[_0x6e05('0x53')]['id']}})[_0x6e05('0x20')](handleEntityNotFound(_0xad9135,null))['then'](removeEntity(_0xad9135,null))['catch'](handleError(_0xad9135,null));};exports['describe']=function(_0x14e9ac,_0x4ee0da){return db['OpenchannelMessage'][_0x6e05('0x59')]()[_0x6e05('0x20')](respondWithResult(_0x4ee0da,null))[_0x6e05('0x52')](handleError(_0x4ee0da,null));};var interaction_log=require('../../config/logger')(_0x6e05('0x5a'));exports[_0x6e05('0x5b')]=function(_0x1d7a02,_0x4f9254,_0x18e781){var _0xcdfa5f={'agent':{},'channel':'openchannel'};if(_0x1d7a02['body']['id']){delete _0x1d7a02[_0x6e05('0x58')]['id'];}_0x1d7a02[_0x6e05('0x58')][_0x6e05('0x5c')]=!![];_0x1d7a02[_0x6e05('0x58')]['readAt']=moment()['format'](_0x6e05('0x5d'));_0x1d7a02[_0x6e05('0x58')][_0x6e05('0x5e')]=_0x1d7a02[_0x6e05('0x58')][_0x6e05('0x5e')]||_0x1d7a02[_0x6e05('0x5f')]['id'];_0xcdfa5f['agent']['id']=_0x1d7a02[_0x6e05('0x58')][_0x6e05('0x5e')];return db[_0x6e05('0x3c')][_0x6e05('0x56')]({'where':{'id':_0x1d7a02[_0x6e05('0x53')]['id'],'UserId':null}})[_0x6e05('0x20')](handleEntityNotFound(_0x4f9254,null))[_0x6e05('0x20')](saveUpdates(_0x1d7a02['body'],null))[_0x6e05('0x20')](function(_0x409693){if(_0x409693){_0xcdfa5f[_0x6e05('0x27')]=_0x409693[_0x6e05('0x60')]({'plain':!![]});return db['OpenchannelInteraction'][_0x6e05('0x56')]({'where':{'id':_0x409693[_0x6e05('0x61')]}});}return null;})[_0x6e05('0x20')](handleEntityNotFound(_0x4f9254,null))[_0x6e05('0x20')](function(_0x1c6b67){if(_0x1c6b67){return _0x1c6b67[_0x6e05('0x35')]({'UserId':_0x1d7a02['body']['UserId'],'read1stAt':_[_0x6e05('0x62')](_0x1c6b67[_0x6e05('0x63')])?moment()['format'](_0x6e05('0x5d')):undefined});}return null;})[_0x6e05('0x20')](function(_0x28bf3d){if(_0x28bf3d){_0xcdfa5f[_0x6e05('0x64')]=_0x28bf3d[_0x6e05('0x60')]({'plain':!![]});interaction_log[_0x6e05('0x21')]('[OPENCHANNELMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s',_0x1d7a02[_0x6e05('0x5f')]['id'],_0x1d7a02['user'][_0x6e05('0x38')],_0x1d7a02['user'][_0x6e05('0x65')],_0xcdfa5f[_0x6e05('0x64')]['id'],_0x1d7a02['body']?JSON[_0x6e05('0x24')](_0x1d7a02[_0x6e05('0x58')]):_0x6e05('0x66'));return respondWithRpcPromise(_0x6e05('0x67'),_0x6e05('0x68'),_0xcdfa5f);}return null;})['then'](function(_0x3e2284){var _0x3b9f25=_0x6e05('0x69')+_0x3e2284[_0x6e05('0x27')][_0x6e05('0x6a')];return db[_0x6e05('0x6b')][_0x6e05('0x40')](_0x3b9f25,{'type':db['Sequelize'][_0x6e05('0x6c')][_0x6e05('0x6d')],'raw':!![]})[_0x6e05('0x20')](function(_0x53d98c){return _0x53d98c;});})[_0x6e05('0x20')](function(_0x546308){if(_0x546308){_0xcdfa5f[_0x6e05('0x27')][_0x6e05('0x6e')]=_0x546308[0x0];if(!_0x1d7a02[_0x6e05('0x58')]['UserId'])return;return db['User']['find']({'where':{'id':_0x1d7a02[_0x6e05('0x58')][_0x6e05('0x5e')],'role':_0x6e05('0x6f')},'attributes':['id','name',_0x6e05('0x70'),'email',_0x6e05('0x71')],'raw':!![]});}return null;})[_0x6e05('0x20')](function(_0x555928){if(!_0x555928)return null;_0xcdfa5f[_0x6e05('0x27')][_0x6e05('0x6f')]=_0x555928;return _0xcdfa5f;})[_0x6e05('0x20')](function(_0x35dce8){if(_0x35dce8){if(_0x1d7a02[_0x6e05('0x58')][_0x6e05('0x72')]){_0xcdfa5f['message'][_0x6e05('0x73')]=util['format'](_0x6e05('0x74'),_0x1d7a02[_0x6e05('0x5f')][_0x6e05('0x38')]);_0xcdfa5f[_0x6e05('0x27')][_0x6e05('0x75')]=_0xcdfa5f[_0x6e05('0x75')];_0xcdfa5f[_0x6e05('0x27')][_0x6e05('0x76')]=_0xcdfa5f[_0x6e05('0x75')];_0xcdfa5f[_0x6e05('0x27')][_0x6e05('0x77')]=_0x6e05('0x5b');return respondWithRpcPromise(_0x6e05('0x78'),_0x6e05('0x78'),{'event':'acceptmessage','message':_0xcdfa5f['message']},client9002)[_0x6e05('0x20')](function(){return _0xcdfa5f;});}return _0xcdfa5f;}return null;})[_0x6e05('0x20')](respondWithResult(_0x4f9254,null))[_0x6e05('0x52')](handleError(_0x4f9254,null));};var interaction_log=require(_0x6e05('0x13'))(_0x6e05('0x5a'));exports['reject']=function(_0x11a2e1,_0x3b701b,_0x5a395b){var _0xafb628={'agent':{},'channel':_0x6e05('0x79')};if(_0x11a2e1[_0x6e05('0x58')]['id']){delete _0x11a2e1[_0x6e05('0x58')]['id'];}_0x11a2e1[_0x6e05('0x58')][_0x6e05('0x5e')]=_0x11a2e1['body'][_0x6e05('0x5e')]||_0x11a2e1['user']['id'];_0xafb628[_0x6e05('0x6f')]['id']=_0x11a2e1[_0x6e05('0x58')]['UserId'];return db[_0x6e05('0x3c')][_0x6e05('0x56')]({'where':{'id':_0x11a2e1['params']['id'],'UserId':null}})['then'](handleEntityNotFound(_0x3b701b,null))['then'](function(_0x5e7f73){if(_0x5e7f73){_0xafb628[_0x6e05('0x27')]=_0x5e7f73[_0x6e05('0x60')]({'plain':!![]});return db[_0x6e05('0x7a')][_0x6e05('0x56')]({'where':{'id':_0x5e7f73[_0x6e05('0x61')]}});}return null;})['then'](handleEntityNotFound(_0x3b701b,null))[_0x6e05('0x20')](function(_0x580a80){if(_0x580a80){_0xafb628[_0x6e05('0x64')]=_0x580a80[_0x6e05('0x60')]({'plain':!![]});interaction_log[_0x6e05('0x21')](_0x6e05('0x7b'),_0x11a2e1['user']['id'],_0x11a2e1[_0x6e05('0x5f')][_0x6e05('0x38')],_0x11a2e1[_0x6e05('0x5f')][_0x6e05('0x65')],_0xafb628[_0x6e05('0x64')]['id'],_0x11a2e1['body']?JSON['stringify'](_0x11a2e1['body']):_0x6e05('0x66'));return respondWithRpcPromise(_0x6e05('0x7c'),'rejectMessage',_0xafb628);}return null;})[_0x6e05('0x20')](function(_0x47f2b8){var _0x2ebb7b=_0x6e05('0x69')+_0x47f2b8[_0x6e05('0x27')][_0x6e05('0x6a')];return db[_0x6e05('0x6b')]['query'](_0x2ebb7b,{'type':db['Sequelize']['QueryTypes'][_0x6e05('0x6d')],'raw':!![]})[_0x6e05('0x20')](function(_0x7ea4d9){return _0x7ea4d9;});})[_0x6e05('0x20')](function(_0x511202){if(_0x511202){_0xafb628[_0x6e05('0x27')][_0x6e05('0x6e')]=_0x511202[0x0];if(!_0x11a2e1['body']['UserId'])return;return db[_0x6e05('0x7d')]['find']({'where':{'id':_0x11a2e1['body'][_0x6e05('0x5e')],'role':_0x6e05('0x6f')},'attributes':['id',_0x6e05('0x38'),_0x6e05('0x70'),'email',_0x6e05('0x71')],'raw':!![]});}return null;})[_0x6e05('0x20')](function(_0xcb84fc){if(!_0xcb84fc)return null;_0xafb628[_0x6e05('0x27')]['agent']=_0xcb84fc;return _0xafb628;})[_0x6e05('0x20')](function(_0x45e980){if(_0x45e980){_0x45e980[_0x6e05('0x27')][_0x6e05('0x73')]=util[_0x6e05('0x7e')](_0x6e05('0x74'),_0x11a2e1[_0x6e05('0x5f')]['name']);_0x45e980['message']['channel']=_0xafb628[_0x6e05('0x75')];_0x45e980[_0x6e05('0x27')][_0x6e05('0x76')]=_0xafb628[_0x6e05('0x75')];_0x45e980[_0x6e05('0x27')][_0x6e05('0x77')]=_0x6e05('0x33');respondWithRpcPromise(_0x6e05('0x78'),_0x6e05('0x78'),{'event':'rejectmessage','message':_0x45e980[_0x6e05('0x27')]},client9002);return _0xafb628;}return null;})[_0x6e05('0x20')](respondWithResult(_0x3b701b,null))[_0x6e05('0x52')](handleError(_0x3b701b,null));}; \ No newline at end of file diff --git a/server/api/openchannelMessage/openchannelMessage.events.js b/server/api/openchannelMessage/openchannelMessage.events.js index b0e7e15..8f66f64 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 _0x183d=['update','remove','emit','hook','exports','events','../../mysqldb','OpenchannelMessage'];(function(_0x39cd89,_0x55c240){var _0xc3d16d=function(_0x52469b){while(--_0x52469b){_0x39cd89['push'](_0x39cd89['shift']());}};_0xc3d16d(++_0x55c240);}(_0x183d,0x1ed));var _0xd183=function(_0xb29bef,_0x45aff1){_0xb29bef=_0xb29bef-0x0;var _0x878163=_0x183d[_0xb29bef];return _0x878163;};'use strict';var EventEmitter=require(_0xd183('0x0'));var OpenchannelMessage=require(_0xd183('0x1'))['db'][_0xd183('0x2')];var OpenchannelMessageEvents=new EventEmitter();OpenchannelMessageEvents['setMaxListeners'](0x0);var events={'afterCreate':'save','afterUpdate':_0xd183('0x3'),'afterDestroy':_0xd183('0x4')};function emitEvent(_0x5a087a){return function(_0x3bea64,_0x13db65,_0xe535e2){OpenchannelMessageEvents[_0xd183('0x5')](_0x5a087a+':'+_0x3bea64['id'],_0x3bea64);OpenchannelMessageEvents['emit'](_0x5a087a,_0x3bea64);_0xe535e2(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];OpenchannelMessage[_0xd183('0x6')](e,emitEvent(event));}}module[_0xd183('0x7')]=OpenchannelMessageEvents; \ No newline at end of file +var _0x6138=['../../mysqldb','setMaxListeners','update','remove','emit','hook','events'];(function(_0x8c2f84,_0x5c00f0){var _0x1b8ec1=function(_0x339945){while(--_0x339945){_0x8c2f84['push'](_0x8c2f84['shift']());}};_0x1b8ec1(++_0x5c00f0);}(_0x6138,0x125));var _0x8613=function(_0x4243a3,_0x447337){_0x4243a3=_0x4243a3-0x0;var _0x1b2a33=_0x6138[_0x4243a3];return _0x1b2a33;};'use strict';var EventEmitter=require(_0x8613('0x0'));var OpenchannelMessage=require(_0x8613('0x1'))['db']['OpenchannelMessage'];var OpenchannelMessageEvents=new EventEmitter();OpenchannelMessageEvents[_0x8613('0x2')](0x0);var events={'afterCreate':'save','afterUpdate':_0x8613('0x3'),'afterDestroy':_0x8613('0x4')};function emitEvent(_0x14aa25){return function(_0x528986,_0x4a3203,_0x2b4a02){OpenchannelMessageEvents[_0x8613('0x5')](_0x14aa25+':'+_0x528986['id'],_0x528986);OpenchannelMessageEvents[_0x8613('0x5')](_0x14aa25,_0x528986);_0x2b4a02(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];OpenchannelMessage[_0x8613('0x6')](e,emitEvent(event));}}module['exports']=OpenchannelMessageEvents; \ No newline at end of file diff --git a/server/api/openchannelMessage/openchannelMessage.model.js b/server/api/openchannelMessage/openchannelMessage.model.js index 4464c98..531ac1e 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 _0x804b=['Contact','POST','replyUri','GET','then','afterCreate','Message\x20%d\x20forwarded\x20to\x20%s','threadId','update','error','inspect','finally','utf8mb4','utf8mb4_unicode_ci','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','exports','OpenchannelMessage','openchannel_messages','fti_openchannel_messages','body','FULLTEXT','get','direction','toLowerCase','out','secret','isNil','UserId','OpenchannelInteraction','findOne','OpenchannelInteractionId','createdAt','CmContact','OpenchannelAccount','find','OpenchannelAccountId','keys','info','OpenchannelMessage,\x20%s,\x20%s','format','Forwarding\x20message\x20%d\x20to\x20%s','Interactions','length','Interaction','omit'];(function(_0xc74170,_0x2cbde8){var _0x34c7bb=function(_0x59b8f3){while(--_0x59b8f3){_0xc74170['push'](_0xc74170['shift']());}};_0x34c7bb(++_0x2cbde8);}(_0x804b,0x140));var _0xb804=function(_0x234a12,_0x5e6df3){_0x234a12=_0x234a12-0x0;var _0x359624=_0x804b[_0x234a12];return _0x359624;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0xb804('0x0'))(_0xb804('0x1'));var moment=require(_0xb804('0x2'));var BPromise=require(_0xb804('0x3'));var rp=require(_0xb804('0x4'));var fs=require('fs');var path=require(_0xb804('0x5'));var rimraf=require(_0xb804('0x6'));var config=require('../../config/environment');var attributes=require('./openchannelMessage.attributes');module[_0xb804('0x7')]=function(_0x27b5ab,_0x3b1bac){return _0x27b5ab['define'](_0xb804('0x8'),attributes,{'tableName':_0xb804('0x9'),'paranoid':![],'indexes':[{'name':_0xb804('0xa'),'fields':[_0xb804('0xb')],'type':_0xb804('0xc')}],'timestamps':!![],'hooks':{'afterCreate':function(_0xf8ae7f,_0x23c796,_0x4c43ec){var _0x1b71e0=_0x27b5ab['models'];var _0x4b35e8=_0xf8ae7f[_0xb804('0xd')]({'plain':!![]});if(_0x4b35e8[_0xb804('0xe')][_0xb804('0xf')]()==='in'||_0x4b35e8['direction']['toLowerCase']()===_0xb804('0x10')&&!_0x4b35e8[_0xb804('0x11')]&&!_[_0xb804('0x12')](_0x4b35e8[_0xb804('0x13')])){_0x1b71e0[_0xb804('0x14')][_0xb804('0x15')]({'where':{'id':_0x4b35e8[_0xb804('0x16')]}})['then'](function(_0x57bc8b){if(_0x57bc8b){_0x57bc8b['update']({'lastMsgAt':_0x4b35e8[_0xb804('0x17')],'lastMsgDirection':_0x4b35e8[_0xb804('0xe')][_0xb804('0xf')]()});}})['catch'](function(_0xa357f0){console['error'](_0xa357f0);});}if(_0x4b35e8[_0xb804('0xe')]===_0xb804('0x10')&&!_0x4b35e8[_0xb804('0x11')]){var _0x107e7f;_0x1b71e0[_0xb804('0x18')]['describe']()['then'](function(_0x1d8e7b){return _0x1b71e0[_0xb804('0x19')][_0xb804('0x1a')]({'where':{'id':_0x4b35e8[_0xb804('0x1b')]},'include':[{'model':_0x1b71e0[_0xb804('0x14')],'as':'Interactions','where':{'id':_0x4b35e8[_0xb804('0x16')]},'limit':0x1,'include':[{'model':_0x1b71e0['CmContact'],'as':'Contact','attributes':_[_0xb804('0x1c')](_0x1d8e7b)}]}]});})['then'](function(_0x40dca9){_0x107e7f=_0x40dca9[_0xb804('0xd')]({'plain':!![]});if(_0x107e7f&&_0x107e7f['replyUri']){logger[_0xb804('0x1d')](_0xb804('0x1e'),'afterCreate',util[_0xb804('0x1f')](_0xb804('0x20'),_0x4b35e8['id'],_0x107e7f['replyUri']));if(_0x107e7f[_0xb804('0x21')]&&_0x107e7f['Interactions'][_0xb804('0x22')]){_0x4b35e8[_0xb804('0x23')]=_[_0xb804('0x24')](_0x107e7f[_0xb804('0x21')][0x0],_0xb804('0x25'));_0x4b35e8[_0xb804('0x25')]=_0x107e7f[_0xb804('0x21')][0x0][_0xb804('0x25')];}var _0x23c796={'method':_0xb804('0x26'),'uri':encodeURI(_0x107e7f[_0xb804('0x27')]),'json':!![],'resolveWithFullResponse':!![]};switch(_0x23c796['method']){case _0xb804('0x28'):_0x23c796['qs']=_0x4b35e8;break;case _0xb804('0x26'):_0x23c796[_0xb804('0xb')]=_0x4b35e8;break;}return rp(_0x23c796)[_0xb804('0x29')](function(_0x19cc16){logger['info'](_0xb804('0x1e'),_0xb804('0x2a'),util['format'](_0xb804('0x2b'),_0x4b35e8['id'],_0x107e7f[_0xb804('0x27')]));if(_0x19cc16[_0xb804('0xb')][_0xb804('0x2c')]&&_0x19cc16[_0xb804('0xb')][_0xb804('0x2c')]!=_0x4b35e8[_0xb804('0x23')][_0xb804('0x2c')]){return _0x1b71e0[_0xb804('0x14')][_0xb804('0x2d')]({'threadId':_0x19cc16['body']['threadId']},{'where':{'id':_0x4b35e8['Interaction']['id']}});}else{return;}})['then'](function(){return _0xf8ae7f[_0xb804('0x2d')]({'read':!![]});})['catch'](function(_0x4a2e80){logger[_0xb804('0x2e')](_0xb804('0x1e'),'afterCreate',util[_0xb804('0x2f')](_0x4a2e80,{'showHidden':![],'depth':null}));_0x4c43ec();});}else{_0x4c43ec();}})[_0xb804('0x30')](function(){_0x4c43ec();});}else{_0x4c43ec();}}},'charset':_0xb804('0x31'),'collate':_0xb804('0x32')});}; \ No newline at end of file +var _0x1ea4=['catch','error','secret','OpenchannelAccountId','OpenchannelInteraction','Interactions','CmContact','Contact','keys','info','afterCreate','replyUri','omit','POST','method','GET','OpenchannelMessage,\x20%s,\x20%s','format','threadId','Interaction','utf8mb4','utf8mb4_unicode_ci','lodash','../../config/logger','api','moment','request-promise','./openchannelMessage.attributes','exports','define','OpenchannelMessage','openchannel_messages','fti_openchannel_messages','body','FULLTEXT','models','get','toLowerCase','out','isNil','UserId','findOne','OpenchannelInteractionId','then','update','createdAt','direction'];(function(_0x2d77da,_0x322fdf){var _0x10531a=function(_0x2ef79c){while(--_0x2ef79c){_0x2d77da['push'](_0x2d77da['shift']());}};_0x10531a(++_0x322fdf);}(_0x1ea4,0xa3));var _0x41ea=function(_0x44e72d,_0x54a45c){_0x44e72d=_0x44e72d-0x0;var _0x47cd90=_0x1ea4[_0x44e72d];return _0x47cd90;};'use strict';var _=require(_0x41ea('0x0'));var util=require('util');var logger=require(_0x41ea('0x1'))(_0x41ea('0x2'));var moment=require(_0x41ea('0x3'));var BPromise=require('bluebird');var rp=require(_0x41ea('0x4'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0x41ea('0x5'));module[_0x41ea('0x6')]=function(_0x4ede76,_0xcb2f62){return _0x4ede76[_0x41ea('0x7')](_0x41ea('0x8'),attributes,{'tableName':_0x41ea('0x9'),'paranoid':![],'indexes':[{'name':_0x41ea('0xa'),'fields':[_0x41ea('0xb')],'type':_0x41ea('0xc')}],'timestamps':!![],'hooks':{'afterCreate':function(_0x54c6ff,_0x40dc9e,_0x9c1ef){var _0x15db8f=_0x4ede76[_0x41ea('0xd')];var _0x165705=_0x54c6ff[_0x41ea('0xe')]({'plain':!![]});if(_0x165705['direction'][_0x41ea('0xf')]()==='in'||_0x165705['direction'][_0x41ea('0xf')]()===_0x41ea('0x10')&&!_0x165705['secret']&&!_[_0x41ea('0x11')](_0x165705[_0x41ea('0x12')])){_0x15db8f['OpenchannelInteraction'][_0x41ea('0x13')]({'where':{'id':_0x165705[_0x41ea('0x14')]}})[_0x41ea('0x15')](function(_0x2e730b){if(_0x2e730b){_0x2e730b[_0x41ea('0x16')]({'lastMsgAt':_0x165705[_0x41ea('0x17')],'lastMsgDirection':_0x165705[_0x41ea('0x18')][_0x41ea('0xf')]()});}})[_0x41ea('0x19')](function(_0x38131a){console[_0x41ea('0x1a')](_0x38131a);});}if(_0x165705[_0x41ea('0x18')]===_0x41ea('0x10')&&!_0x165705[_0x41ea('0x1b')]){var _0x520637;_0x15db8f['CmContact']['describe']()[_0x41ea('0x15')](function(_0x45abd8){return _0x15db8f['OpenchannelAccount']['find']({'where':{'id':_0x165705[_0x41ea('0x1c')]},'include':[{'model':_0x15db8f[_0x41ea('0x1d')],'as':_0x41ea('0x1e'),'where':{'id':_0x165705['OpenchannelInteractionId']},'limit':0x1,'include':[{'model':_0x15db8f[_0x41ea('0x1f')],'as':_0x41ea('0x20'),'attributes':_[_0x41ea('0x21')](_0x45abd8)}]}]});})[_0x41ea('0x15')](function(_0x3e8696){_0x520637=_0x3e8696[_0x41ea('0xe')]({'plain':!![]});if(_0x520637&&_0x520637['replyUri']){logger[_0x41ea('0x22')]('OpenchannelMessage,\x20%s,\x20%s',_0x41ea('0x23'),util['format']('Forwarding\x20message\x20%d\x20to\x20%s',_0x165705['id'],_0x520637[_0x41ea('0x24')]));if(_0x520637['Interactions']&&_0x520637[_0x41ea('0x1e')]['length']){_0x165705['Interaction']=_[_0x41ea('0x25')](_0x520637['Interactions'][0x0],_0x41ea('0x20'));_0x165705[_0x41ea('0x20')]=_0x520637[_0x41ea('0x1e')][0x0][_0x41ea('0x20')];}var _0x40dc9e={'method':_0x41ea('0x26'),'uri':encodeURI(_0x520637['replyUri']),'json':!![],'resolveWithFullResponse':!![]};switch(_0x40dc9e[_0x41ea('0x27')]){case _0x41ea('0x28'):_0x40dc9e['qs']=_0x165705;break;case _0x41ea('0x26'):_0x40dc9e[_0x41ea('0xb')]=_0x165705;break;}return rp(_0x40dc9e)[_0x41ea('0x15')](function(_0x2a8d75){logger[_0x41ea('0x22')](_0x41ea('0x29'),_0x41ea('0x23'),util[_0x41ea('0x2a')]('Message\x20%d\x20forwarded\x20to\x20%s',_0x165705['id'],_0x520637[_0x41ea('0x24')]));if(_0x2a8d75[_0x41ea('0xb')][_0x41ea('0x2b')]&&_0x2a8d75[_0x41ea('0xb')]['threadId']!=_0x165705[_0x41ea('0x2c')][_0x41ea('0x2b')]){return _0x15db8f[_0x41ea('0x1d')]['update']({'threadId':_0x2a8d75['body'][_0x41ea('0x2b')]},{'where':{'id':_0x165705[_0x41ea('0x2c')]['id']}});}else{return;}})[_0x41ea('0x15')](function(){return _0x54c6ff[_0x41ea('0x16')]({'read':!![]});})[_0x41ea('0x19')](function(_0x3cbef1){logger[_0x41ea('0x1a')](_0x41ea('0x29'),_0x41ea('0x23'),util['inspect'](_0x3cbef1,{'showHidden':![],'depth':null}));_0x9c1ef();});}else{_0x9c1ef();}})['finally'](function(){_0x9c1ef();});}else{_0x9c1ef();}}},'charset':_0x41ea('0x2d'),'collate':_0x41ea('0x2e')});}; \ No newline at end of file diff --git a/server/api/openchannelMessage/openchannelMessage.rpc.js b/server/api/openchannelMessage/openchannelMessage.rpc.js index 134e8db..1c76be7 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 _0xadb5=['debug','request\x20sent','stringify','error','code','message','info','result','catch','OpenchannelMessage','body','raw','CreateOpenchannelMessage','util','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','redis','defaults','localhost','socket.io-emitter','./openchannelMessage.socket','register','request','then','OpenchannelMessage,\x20%s,\x20%s'];(function(_0x46e64f,_0x46d4ec){var _0xc7c58e=function(_0x93a452){while(--_0x93a452){_0x46e64f['push'](_0x46e64f['shift']());}};_0xc7c58e(++_0x46d4ec);}(_0xadb5,0xad));var _0x5adb=function(_0x1f4f37,_0x3c810d){_0x1f4f37=_0x1f4f37-0x0;var _0xa21194=_0xadb5[_0x1f4f37];return _0xa21194;};'use strict';var _=require('lodash');var util=require(_0x5adb('0x0'));var moment=require('moment');var BPromise=require(_0x5adb('0x1'));var rs=require(_0x5adb('0x2'));var fs=require('fs');var Redis=require(_0x5adb('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x5adb('0x4'));var logger=require(_0x5adb('0x5'))(_0x5adb('0x6'));var config=require('../../config/environment');var jayson=require(_0x5adb('0x7'));var client=jayson[_0x5adb('0x8')][_0x5adb('0x9')]({'port':0x232a});config[_0x5adb('0xa')]=_[_0x5adb('0xb')](config[_0x5adb('0xa')],{'host':_0x5adb('0xc'),'port':0x18eb});var socket=require(_0x5adb('0xd'))(new Redis(config[_0x5adb('0xa')]));require(_0x5adb('0xe'))[_0x5adb('0xf')](socket);function respondWithRpcPromise(_0x336bad,_0x129f5a,_0x275428){return new BPromise(function(_0x563d86,_0x4c268d){return client[_0x5adb('0x10')](_0x336bad,_0x275428)[_0x5adb('0x11')](function(_0x82e67e){logger['info'](_0x5adb('0x12'),_0x129f5a,'request\x20sent');logger[_0x5adb('0x13')]('OpenchannelMessage,\x20%s,\x20%s,\x20%s',_0x129f5a,_0x5adb('0x14'),JSON[_0x5adb('0x15')](_0x82e67e));if(_0x82e67e[_0x5adb('0x16')]){if(_0x82e67e['error'][_0x5adb('0x17')]===0x1f4){logger[_0x5adb('0x16')](_0x5adb('0x12'),_0x129f5a,_0x82e67e['error'][_0x5adb('0x18')]);return _0x4c268d(_0x82e67e['error'][_0x5adb('0x18')]);}logger[_0x5adb('0x16')](_0x5adb('0x12'),_0x129f5a,_0x82e67e[_0x5adb('0x16')][_0x5adb('0x18')]);return _0x563d86(_0x82e67e[_0x5adb('0x16')][_0x5adb('0x18')]);}else{logger[_0x5adb('0x19')](_0x5adb('0x12'),_0x129f5a,'request\x20sent');_0x563d86(_0x82e67e[_0x5adb('0x1a')]['message']);}})[_0x5adb('0x1b')](function(_0x558f76){logger[_0x5adb('0x16')]('OpenchannelMessage,\x20%s,\x20%s',_0x129f5a,_0x558f76);_0x4c268d(_0x558f76);});});}exports['CreateOpenchannelMessage']=function(_0x1fbaa5){var _0x1bed20=this;return new Promise(function(_0x438671,_0x1fd4a7){return db[_0x5adb('0x1c')]['create'](_0x1fbaa5[_0x5adb('0x1d')],{'raw':_0x1fbaa5['options']?_0x1fbaa5['options'][_0x5adb('0x1e')]===undefined?!![]:![]:!![]})[_0x5adb('0x11')](function(_0x1a38d3){logger[_0x5adb('0x19')](_0x5adb('0x1f'),_0x1fbaa5);logger[_0x5adb('0x13')](_0x5adb('0x1f'),_0x1fbaa5,JSON['stringify'](_0x1a38d3));_0x438671(_0x1a38d3);})[_0x5adb('0x1b')](function(_0x373cc3){logger[_0x5adb('0x16')](_0x5adb('0x1f'),_0x373cc3[_0x5adb('0x18')],_0x1fbaa5);_0x1fd4a7(_0x1bed20['error'](0x1f4,_0x373cc3[_0x5adb('0x18')]));});});}; \ No newline at end of file +var _0xadb5=['debug','request\x20sent','stringify','error','code','message','info','result','catch','OpenchannelMessage','body','raw','CreateOpenchannelMessage','util','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','redis','defaults','localhost','socket.io-emitter','./openchannelMessage.socket','register','request','then','OpenchannelMessage,\x20%s,\x20%s'];(function(_0x186de2,_0x5814c5){var _0xa68b3e=function(_0x39e155){while(--_0x39e155){_0x186de2['push'](_0x186de2['shift']());}};_0xa68b3e(++_0x5814c5);}(_0xadb5,0xad));var _0x5adb=function(_0x2eb49d,_0x1ce493){_0x2eb49d=_0x2eb49d-0x0;var _0x2eaff9=_0xadb5[_0x2eb49d];return _0x2eaff9;};'use strict';var _=require('lodash');var util=require(_0x5adb('0x0'));var moment=require('moment');var BPromise=require(_0x5adb('0x1'));var rs=require(_0x5adb('0x2'));var fs=require('fs');var Redis=require(_0x5adb('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x5adb('0x4'));var logger=require(_0x5adb('0x5'))(_0x5adb('0x6'));var config=require('../../config/environment');var jayson=require(_0x5adb('0x7'));var client=jayson[_0x5adb('0x8')][_0x5adb('0x9')]({'port':0x232a});config[_0x5adb('0xa')]=_[_0x5adb('0xb')](config[_0x5adb('0xa')],{'host':_0x5adb('0xc'),'port':0x18eb});var socket=require(_0x5adb('0xd'))(new Redis(config[_0x5adb('0xa')]));require(_0x5adb('0xe'))[_0x5adb('0xf')](socket);function respondWithRpcPromise(_0x336bad,_0x129f5a,_0x275428){return new BPromise(function(_0x563d86,_0x4c268d){return client[_0x5adb('0x10')](_0x336bad,_0x275428)[_0x5adb('0x11')](function(_0x82e67e){logger['info'](_0x5adb('0x12'),_0x129f5a,'request\x20sent');logger[_0x5adb('0x13')]('OpenchannelMessage,\x20%s,\x20%s,\x20%s',_0x129f5a,_0x5adb('0x14'),JSON[_0x5adb('0x15')](_0x82e67e));if(_0x82e67e[_0x5adb('0x16')]){if(_0x82e67e['error'][_0x5adb('0x17')]===0x1f4){logger[_0x5adb('0x16')](_0x5adb('0x12'),_0x129f5a,_0x82e67e['error'][_0x5adb('0x18')]);return _0x4c268d(_0x82e67e['error'][_0x5adb('0x18')]);}logger[_0x5adb('0x16')](_0x5adb('0x12'),_0x129f5a,_0x82e67e[_0x5adb('0x16')][_0x5adb('0x18')]);return _0x563d86(_0x82e67e[_0x5adb('0x16')][_0x5adb('0x18')]);}else{logger[_0x5adb('0x19')](_0x5adb('0x12'),_0x129f5a,'request\x20sent');_0x563d86(_0x82e67e[_0x5adb('0x1a')]['message']);}})[_0x5adb('0x1b')](function(_0x558f76){logger[_0x5adb('0x16')]('OpenchannelMessage,\x20%s,\x20%s',_0x129f5a,_0x558f76);_0x4c268d(_0x558f76);});});}exports['CreateOpenchannelMessage']=function(_0x1fbaa5){var _0x1bed20=this;return new Promise(function(_0x438671,_0x1fd4a7){return db[_0x5adb('0x1c')]['create'](_0x1fbaa5[_0x5adb('0x1d')],{'raw':_0x1fbaa5['options']?_0x1fbaa5['options'][_0x5adb('0x1e')]===undefined?!![]:![]:!![]})[_0x5adb('0x11')](function(_0x1a38d3){logger[_0x5adb('0x19')](_0x5adb('0x1f'),_0x1fbaa5);logger[_0x5adb('0x13')](_0x5adb('0x1f'),_0x1fbaa5,JSON['stringify'](_0x1a38d3));_0x438671(_0x1a38d3);})[_0x5adb('0x1b')](function(_0x373cc3){logger[_0x5adb('0x16')](_0x5adb('0x1f'),_0x373cc3[_0x5adb('0x18')],_0x1fbaa5);_0x1fd4a7(_0x1bed20['error'](0x1f4,_0x373cc3[_0x5adb('0x18')]));});});}; \ No newline at end of file diff --git a/server/api/openchannelMessage/openchannelMessage.socket.js b/server/api/openchannelMessage/openchannelMessage.socket.js index ddc0a45..05c04c5 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 _0x5502=['openchannelMessage:','./openchannelMessage.events','save','remove','update','emit','removeListener','register'];(function(_0x29ef0d,_0x1c1ff7){var _0x1f928d=function(_0x266f4f){while(--_0x266f4f){_0x29ef0d['push'](_0x29ef0d['shift']());}};_0x1f928d(++_0x1c1ff7);}(_0x5502,0x69));var _0x2550=function(_0x3e112d,_0x2bb132){_0x3e112d=_0x3e112d-0x0;var _0x531c31=_0x5502[_0x3e112d];return _0x531c31;};'use strict';var OpenchannelMessageEvents=require(_0x2550('0x0'));var events=[_0x2550('0x1'),_0x2550('0x2'),_0x2550('0x3')];function createListener(_0x27c601,_0x426d22){return function(_0x185ad3){_0x426d22[_0x2550('0x4')](_0x27c601,_0x185ad3);};}function removeListener(_0x18739d,_0x30a166){return function(){OpenchannelMessageEvents[_0x2550('0x5')](_0x18739d,_0x30a166);};}exports[_0x2550('0x6')]=function(_0x5f76a9){for(var _0x507b52=0x0,_0x1fdfc5=events['length'];_0x507b52<_0x1fdfc5;_0x507b52++){var _0x51a38d=events[_0x507b52];var _0x410692=createListener(_0x2550('0x7')+_0x51a38d,_0x5f76a9);OpenchannelMessageEvents['on'](_0x51a38d,_0x410692);}}; \ No newline at end of file +var _0x5977=['./openchannelMessage.events','save','remove','update','emit','removeListener','register','length','openchannelMessage:'];(function(_0x6f148b,_0xad3e97){var _0x310d50=function(_0x56a979){while(--_0x56a979){_0x6f148b['push'](_0x6f148b['shift']());}};_0x310d50(++_0xad3e97);}(_0x5977,0xe1));var _0x7597=function(_0x1acb58,_0x58a552){_0x1acb58=_0x1acb58-0x0;var _0x1b5088=_0x5977[_0x1acb58];return _0x1b5088;};'use strict';var OpenchannelMessageEvents=require(_0x7597('0x0'));var events=[_0x7597('0x1'),_0x7597('0x2'),_0x7597('0x3')];function createListener(_0x5f0d35,_0x4afdb1){return function(_0x1970b0){_0x4afdb1[_0x7597('0x4')](_0x5f0d35,_0x1970b0);};}function removeListener(_0x536908,_0x402e4d){return function(){OpenchannelMessageEvents[_0x7597('0x5')](_0x536908,_0x402e4d);};}exports[_0x7597('0x6')]=function(_0x3bd23e){for(var _0xe9bf18=0x0,_0x151a59=events[_0x7597('0x7')];_0xe9bf18<_0x151a59;_0xe9bf18++){var _0x43c863=events[_0xe9bf18];var _0x1039e2=createListener(_0x7597('0x8')+_0x43c863,_0x3bd23e);OpenchannelMessageEvents['on'](_0x43c863,_0x1039e2);}}; \ No newline at end of file diff --git a/server/api/openchannelQueue/index.js b/server/api/openchannelQueue/index.js index e610030..5e62028 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 _0x9311=['getTeams','/:id/users','getAgents','post','create','addTeams','/:id','update','destroy','delete','removeTeams','removeAgents','exports','path','connect-timeout','express','Router','../../components/auth/service','../../config/environment','./openchannelQueue.controller','get','/describe','isAuthenticated','describe','show','/:id/members','getMembers','/:id/teams'];(function(_0xaef393,_0x3bb479){var _0x180e7e=function(_0x50ab2b){while(--_0x50ab2b){_0xaef393['push'](_0xaef393['shift']());}};_0x180e7e(++_0x3bb479);}(_0x9311,0x141));var _0x1931=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x9311[_0x3dd15e];return _0x231fd0;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x1931('0x0'));var timeout=require(_0x1931('0x1'));var express=require(_0x1931('0x2'));var router=express[_0x1931('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x1931('0x4'));var interaction=require('../../components/interaction/service');var config=require(_0x1931('0x5'));var controller=require(_0x1931('0x6'));router['get']('/',auth['isAuthenticated'](),controller['index']);router[_0x1931('0x7')](_0x1931('0x8'),auth[_0x1931('0x9')](),controller[_0x1931('0xa')]);router['get']('/:id',auth[_0x1931('0x9')](),controller[_0x1931('0xb')]);router['get'](_0x1931('0xc'),auth[_0x1931('0x9')](),controller[_0x1931('0xd')]);router[_0x1931('0x7')](_0x1931('0xe'),auth[_0x1931('0x9')](),controller[_0x1931('0xf')]);router[_0x1931('0x7')](_0x1931('0x10'),auth[_0x1931('0x9')](),controller[_0x1931('0x11')]);router[_0x1931('0x12')]('/',auth['isAuthenticated'](),controller[_0x1931('0x13')]);router[_0x1931('0x12')](_0x1931('0xe'),auth['isAuthenticated'](),controller[_0x1931('0x14')]);router['post'](_0x1931('0x10'),auth[_0x1931('0x9')](),controller['addAgents']);router['put'](_0x1931('0x15'),auth[_0x1931('0x9')](),controller[_0x1931('0x16')]);router['delete']('/:id',auth['isAuthenticated'](),controller[_0x1931('0x17')]);router[_0x1931('0x18')](_0x1931('0xe'),auth[_0x1931('0x9')](),controller[_0x1931('0x19')]);router[_0x1931('0x18')](_0x1931('0x10'),auth[_0x1931('0x9')](),controller[_0x1931('0x1a')]);module[_0x1931('0x1b')]=router; \ No newline at end of file +var _0x1064=['removeAgents','exports','multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../config/environment','get','isAuthenticated','index','/describe','describe','/:id','show','/:id/members','getMembers','getTeams','/:id/users','getAgents','post','create','/:id/teams','addTeams','addAgents','put','update','delete','destroy'];(function(_0x594e02,_0x43a47e){var _0x17d400=function(_0x452aa5){while(--_0x452aa5){_0x594e02['push'](_0x594e02['shift']());}};_0x17d400(++_0x43a47e);}(_0x1064,0x195));var _0x4106=function(_0x5ad314,_0x229de2){_0x5ad314=_0x5ad314-0x0;var _0x1b8805=_0x1064[_0x5ad314];return _0x1b8805;};'use strict';var multer=require(_0x4106('0x0'));var util=require(_0x4106('0x1'));var path=require(_0x4106('0x2'));var timeout=require(_0x4106('0x3'));var express=require(_0x4106('0x4'));var router=express[_0x4106('0x5')]();var fs_extra=require('fs-extra');var auth=require(_0x4106('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0x4106('0x7'));var controller=require('./openchannelQueue.controller');router[_0x4106('0x8')]('/',auth[_0x4106('0x9')](),controller[_0x4106('0xa')]);router[_0x4106('0x8')](_0x4106('0xb'),auth['isAuthenticated'](),controller[_0x4106('0xc')]);router[_0x4106('0x8')](_0x4106('0xd'),auth[_0x4106('0x9')](),controller[_0x4106('0xe')]);router[_0x4106('0x8')](_0x4106('0xf'),auth[_0x4106('0x9')](),controller[_0x4106('0x10')]);router['get']('/:id/teams',auth[_0x4106('0x9')](),controller[_0x4106('0x11')]);router[_0x4106('0x8')](_0x4106('0x12'),auth[_0x4106('0x9')](),controller[_0x4106('0x13')]);router[_0x4106('0x14')]('/',auth[_0x4106('0x9')](),controller[_0x4106('0x15')]);router[_0x4106('0x14')](_0x4106('0x16'),auth[_0x4106('0x9')](),controller[_0x4106('0x17')]);router[_0x4106('0x14')](_0x4106('0x12'),auth[_0x4106('0x9')](),controller[_0x4106('0x18')]);router[_0x4106('0x19')](_0x4106('0xd'),auth[_0x4106('0x9')](),controller[_0x4106('0x1a')]);router[_0x4106('0x1b')](_0x4106('0xd'),auth[_0x4106('0x9')](),controller[_0x4106('0x1c')]);router[_0x4106('0x1b')]('/:id/teams',auth[_0x4106('0x9')](),controller['removeTeams']);router[_0x4106('0x1b')](_0x4106('0x12'),auth[_0x4106('0x9')](),controller[_0x4106('0x1d')]);module[_0x4106('0x1e')]=router; \ No newline at end of file diff --git a/server/api/openchannelQueue/openchannelQueue.attributes.js b/server/api/openchannelQueue/openchannelQueue.attributes.js index c4cd150..5cdfcf5 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 _0x77f6=['INTEGER','ENUM','rrmemory','beepall','roundrobin','exports','STRING','name'];(function(_0x426ccf,_0x4fbf52){var _0x243f84=function(_0x4e2e15){while(--_0x4e2e15){_0x426ccf['push'](_0x426ccf['shift']());}};_0x243f84(++_0x4fbf52);}(_0x77f6,0xcd));var _0x677f=function(_0x531d8a,_0x14a0f0){_0x531d8a=_0x531d8a-0x0;var _0x32fabf=_0x77f6[_0x531d8a];return _0x32fabf;};'use strict';var Sequelize=require('sequelize');module[_0x677f('0x0')]={'name':{'type':Sequelize[_0x677f('0x1')],'unique':_0x677f('0x2'),'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize['STRING']},'timeout':{'type':Sequelize[_0x677f('0x3')],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize[_0x677f('0x4')](_0x677f('0x5'),_0x677f('0x6'),_0x677f('0x7'))}}; \ No newline at end of file +var _0x2593=['beepall','roundrobin','exports','name','STRING','ENUM','rrmemory'];(function(_0x4ddfe9,_0x11daa8){var _0xb09fb7=function(_0x78002){while(--_0x78002){_0x4ddfe9['push'](_0x4ddfe9['shift']());}};_0xb09fb7(++_0x11daa8);}(_0x2593,0x136));var _0x3259=function(_0x39e283,_0x247e6b){_0x39e283=_0x39e283-0x0;var _0x7de89f=_0x2593[_0x39e283];return _0x7de89f;};'use strict';var Sequelize=require('sequelize');module[_0x3259('0x0')]={'name':{'type':Sequelize['STRING'],'unique':_0x3259('0x1'),'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize[_0x3259('0x2')]},'timeout':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize[_0x3259('0x3')](_0x3259('0x4'),_0x3259('0x5'),_0x3259('0x6'))}}; \ No newline at end of file diff --git a/server/api/openchannelQueue/openchannelQueue.controller.js b/server/api/openchannelQueue/openchannelQueue.controller.js index 664132a..e4abf41 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 _0x222a=['join','OpenchannelQueueId\x20=\x20?','ut.UserId\x20=\x20?','push','sequelize','toString','SELECT','every','TeamId','includes','all','compact','value','isEmpty','removeAgents','emit','addAgents','omit','spread','isArray','userOpenchannelQueue:remove','getAgents','bluebird','util','lodash','squel','../../config/logger','api','redis','localhost','socket.io-emitter','./openchannelQueue.socket','register','sendStatus','status','json','offset','undefined','limit','count','set','Content-Range','update','then','get','UserProfileResource','destroy','end','stack','name','send','index','OpenchannelQueue','rawAttributes','type','key','getOptions','where','include','query','findAll','rows','catch','params','model','keys','filters','attributes','intersection','fields','length','merge','create','user','role','OpenchannelQueues','UserProfileSection','find','userProfileId','autoAssociation','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','describe','getMembers','UserOpenchannelQueue','hasOwnProperty','nolimit','order','sort','pick','OpenchannelQueueId','map','filter','options','User','findAndCountAll','UserId','agent','openchannelPause','createdAt','format','%s/%s','SIP','updatedAt','findOne','Team','getTeams','addTeams','ids','online','voicePause','interface','Agents','transaction','each','findOrCreate','forEach','userOpenchannelQueue:save','removeTeams','field','from','team_has_openchannel_queues'];(function(_0x18ab2a,_0x4debcd){var _0x16dcee=function(_0x10107a){while(--_0x10107a){_0x18ab2a['push'](_0x18ab2a['shift']());}};_0x16dcee(++_0x4debcd);}(_0x222a,0x187));var _0xa222=function(_0x59ac38,_0x33fa6f){_0x59ac38=_0x59ac38-0x0;var _0x5ec474=_0x222a[_0x59ac38];return _0x5ec474;};'use strict';var BPromise=require(_0xa222('0x0'));var util=require(_0xa222('0x1'));var _=require(_0xa222('0x2'));var squel=require(_0xa222('0x3'));var Redis=require('ioredis');var qs=require('../../components/parsers/qs');var logger=require(_0xa222('0x4'))(_0xa222('0x5'));var config=require('../../config/environment');var db=require('../../mysqldb')['db'];config[_0xa222('0x6')]=_['defaults'](config[_0xa222('0x6')],{'host':_0xa222('0x7'),'port':0x18eb});var socket=require(_0xa222('0x8'))(new Redis(config[_0xa222('0x6')]));require(_0xa222('0x9'))[_0xa222('0xa')](socket);function respondWithStatusCode(_0x94b6ed,_0x10ce14){_0x10ce14=_0x10ce14||0xcc;return function(_0x39f760){if(_0x39f760){return _0x94b6ed[_0xa222('0xb')](_0x10ce14);}return _0x94b6ed[_0xa222('0xc')](_0x10ce14)['end']();};}function respondWithResult(_0x2777c0,_0x37ee2d){_0x37ee2d=_0x37ee2d||0xc8;return function(_0x50ab97){if(_0x50ab97){return _0x2777c0[_0xa222('0xc')](_0x37ee2d)[_0xa222('0xd')](_0x50ab97);}};}function respondWithFilteredResult(_0x171368,_0x533e93){return function(_0x221912){if(_0x221912){var _0x541fbd=typeof _0x533e93[_0xa222('0xe')]===_0xa222('0xf')&&typeof _0x533e93[_0xa222('0x10')]===_0xa222('0xf');var _0x4b4605=_0x221912[_0xa222('0x11')];var _0x5da47c=_0x541fbd?0x0:_0x533e93[_0xa222('0xe')];var _0x3fba0c=_0x541fbd?_0x221912[_0xa222('0x11')]:_0x533e93[_0xa222('0xe')]+_0x533e93[_0xa222('0x10')];var _0x5da38e;if(_0x3fba0c>=_0x4b4605){_0x3fba0c=_0x4b4605;_0x5da38e=0xc8;}else{_0x5da38e=0xce;}_0x171368[_0xa222('0xc')](_0x5da38e);return _0x171368[_0xa222('0x12')](_0xa222('0x13'),_0x5da47c+'-'+_0x3fba0c+'/'+_0x4b4605)['json'](_0x221912);}return null;};}function saveUpdates(_0xbbecf3){return function(_0x1ad205){if(_0x1ad205){return _0x1ad205[_0xa222('0x14')](_0xbbecf3)[_0xa222('0x15')](function(_0x1100c5){return _0x1100c5;});}return null;};}function removeEntity(_0x48eb5c){return function(_0x18ba90){if(_0x18ba90){return _0x18ba90['destroy']()['then'](function(){var _0x13390e=_0x18ba90[_0xa222('0x16')]({'plain':!![]});var _0x34927e='OpenchannelQueues';return db[_0xa222('0x17')][_0xa222('0x18')]({'where':{'type':_0x34927e,'resourceId':_0x13390e['id']}})['then'](function(){return _0x18ba90;});})['then'](function(){_0x48eb5c[_0xa222('0xc')](0xcc)[_0xa222('0x19')]();});}};}function handleEntityNotFound(_0x284a1b){return function(_0x1ffb83){if(!_0x1ffb83){_0x284a1b[_0xa222('0xb')](0x194);}return _0x1ffb83;};}function handleError(_0x1c735a,_0x101ac2){_0x101ac2=_0x101ac2||0x1f4;return function(_0x1fd135){logger['error'](_0x1fd135[_0xa222('0x1a')]);if(_0x1fd135['name']){delete _0x1fd135[_0xa222('0x1b')];}_0x1c735a['status'](_0x101ac2)[_0xa222('0x1c')](_0x1fd135);};}exports[_0xa222('0x1d')]=function(_0x6c0070,_0x5b93bc){var _0x28bc56={};var _0x31468d={'count':0x0,'rows':[]};var _0x295d25=_['map'](db[_0xa222('0x1e')][_0xa222('0x1f')],function(_0xdf5816){return{'name':_0xdf5816['fieldName'],'type':_0xdf5816[_0xa222('0x20')][_0xa222('0x21')]};});_0x28bc56=qs[_0xa222('0x22')](_0x295d25,_0x6c0070);var _0x5e3677={'where':_0x28bc56[_0xa222('0x23')]};return db[_0xa222('0x1e')][_0xa222('0x11')](_0x5e3677)[_0xa222('0x15')](function(_0x594b2a){_0x31468d[_0xa222('0x11')]=_0x594b2a;_0x28bc56[_0xa222('0x24')]=qs[_0xa222('0x24')](_0x6c0070[_0xa222('0x25')]);return db[_0xa222('0x1e')][_0xa222('0x26')](_0x28bc56);})[_0xa222('0x15')](function(_0x4cad14){_0x31468d[_0xa222('0x27')]=_0x4cad14;return _0x31468d;})[_0xa222('0x15')](respondWithFilteredResult(_0x5b93bc,_0x28bc56))[_0xa222('0x28')](handleError(_0x5b93bc,null));};exports['show']=function(_0x43f6a8,_0x4ac6ec){var _0x471962={'raw':!![],'where':{'id':_0x43f6a8[_0xa222('0x29')]['id']}},_0x4a5e61={};_0x4a5e61[_0xa222('0x2a')]=_[_0xa222('0x2b')](db[_0xa222('0x1e')][_0xa222('0x1f')]);_0x4a5e61[_0xa222('0x25')]=_[_0xa222('0x2b')](_0x43f6a8['query']);_0x4a5e61[_0xa222('0x2c')]=_['intersection'](_0x4a5e61[_0xa222('0x2a')],_0x4a5e61[_0xa222('0x25')]);_0x471962[_0xa222('0x2d')]=_[_0xa222('0x2e')](_0x4a5e61[_0xa222('0x2a')],qs[_0xa222('0x2f')](_0x43f6a8[_0xa222('0x25')][_0xa222('0x2f')]));_0x471962[_0xa222('0x2d')]=_0x471962[_0xa222('0x2d')][_0xa222('0x30')]?_0x471962[_0xa222('0x2d')]:_0x4a5e61[_0xa222('0x2a')];if(_0x43f6a8['query']['includeAll']){_0x471962[_0xa222('0x24')]=[{'all':!![]}];}_0x471962=_[_0xa222('0x31')]({},_0x471962,_0x43f6a8['options']);return db['OpenchannelQueue']['find'](_0x471962)[_0xa222('0x15')](handleEntityNotFound(_0x4ac6ec,null))[_0xa222('0x15')](respondWithResult(_0x4ac6ec,null))[_0xa222('0x28')](handleError(_0x4ac6ec,null));};exports[_0xa222('0x32')]=function(_0x42d386,_0x4d2876){return db[_0xa222('0x1e')][_0xa222('0x32')](_0x42d386['body'],{})[_0xa222('0x15')](function(_0x44d49e){var _0x5739f0=_0x42d386[_0xa222('0x33')][_0xa222('0x16')]({'plain':!![]});if(!_0x5739f0)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x5739f0[_0xa222('0x34')]===_0xa222('0x33')){var _0x5109ac=_0x44d49e[_0xa222('0x16')]({'plain':!![]});var _0x3bd899=_0xa222('0x35');return db[_0xa222('0x36')][_0xa222('0x37')]({'where':{'name':_0x3bd899,'userProfileId':_0x5739f0[_0xa222('0x38')]},'raw':!![]})['then'](function(_0x29e6c3){if(_0x29e6c3&&_0x29e6c3[_0xa222('0x39')]===0x0){return db[_0xa222('0x17')][_0xa222('0x32')]({'name':_0x5109ac['name'],'resourceId':_0x5109ac['id'],'type':_0x29e6c3[_0xa222('0x1b')],'sectionId':_0x29e6c3['id']},{})[_0xa222('0x15')](function(){return _0x44d49e;});}else{return _0x44d49e;}})[_0xa222('0x28')](function(_0x3d6386){logger[_0xa222('0x3a')](_0xa222('0x3b'),_0x3d6386);throw _0x3d6386;});}return _0x44d49e;})['then'](respondWithResult(_0x4d2876,0xc9))['catch'](handleError(_0x4d2876,null));};exports[_0xa222('0x14')]=function(_0xcfe2dc,_0x5b8aea){if(_0xcfe2dc[_0xa222('0x3c')]['id']){delete _0xcfe2dc[_0xa222('0x3c')]['id'];}return db[_0xa222('0x1e')]['find']({'where':{'id':_0xcfe2dc[_0xa222('0x29')]['id']}})['then'](handleEntityNotFound(_0x5b8aea,null))[_0xa222('0x15')](saveUpdates(_0xcfe2dc[_0xa222('0x3c')],null))[_0xa222('0x15')](respondWithResult(_0x5b8aea,null))['catch'](handleError(_0x5b8aea,null));};exports['destroy']=function(_0x5ae011,_0x517488){return db['OpenchannelQueue']['find']({'where':{'id':_0x5ae011['params']['id']}})[_0xa222('0x15')](handleEntityNotFound(_0x517488,null))['then'](removeEntity(_0x517488,null))[_0xa222('0x28')](handleError(_0x517488,null));};exports[_0xa222('0x3d')]=function(_0x23fd22,_0x2492ee){return db[_0xa222('0x1e')][_0xa222('0x3d')]()['then'](respondWithResult(_0x2492ee,null))[_0xa222('0x28')](handleError(_0x2492ee,null));};exports[_0xa222('0x3e')]=function(_0x44cc53,_0x350d56){var _0x41cb90={'raw':!![],'where':{}},_0x3de45e={},_0xf4e1b9;return db[_0xa222('0x1e')]['findOne']({'where':{'id':_0x44cc53[_0xa222('0x29')]['id']}})[_0xa222('0x15')](handleEntityNotFound(_0x350d56,null))[_0xa222('0x15')](function(_0x221ff0){if(_0x221ff0){_0xf4e1b9=_0x221ff0[_0xa222('0x16')]({'plain':!![]});_0x3de45e['model']=_['keys'](db[_0xa222('0x3f')][_0xa222('0x1f')]);_0x3de45e[_0xa222('0x25')]=_[_0xa222('0x2b')](_0x44cc53[_0xa222('0x25')]);_0x3de45e[_0xa222('0x2c')]=_[_0xa222('0x2e')](_0x3de45e[_0xa222('0x2a')],_0x3de45e[_0xa222('0x25')]);_0x41cb90['attributes']=_['intersection'](_0x3de45e[_0xa222('0x2a')],qs[_0xa222('0x2f')](_0x44cc53[_0xa222('0x25')][_0xa222('0x2f')]));_0x41cb90[_0xa222('0x2d')]=_0x41cb90['attributes'][_0xa222('0x30')]?_0x41cb90[_0xa222('0x2d')]:_0x3de45e[_0xa222('0x2a')];if(!_0x44cc53[_0xa222('0x25')][_0xa222('0x40')](_0xa222('0x41'))){_0x41cb90[_0xa222('0x10')]=qs[_0xa222('0x10')](_0x44cc53[_0xa222('0x25')][_0xa222('0x10')]);_0x41cb90[_0xa222('0xe')]=qs[_0xa222('0xe')](_0x44cc53[_0xa222('0x25')]['offset']);}_0x41cb90[_0xa222('0x42')]=qs[_0xa222('0x43')](_0x44cc53['query'][_0xa222('0x43')]);_0x41cb90[_0xa222('0x23')]=qs[_0xa222('0x2c')](_[_0xa222('0x44')](_0x44cc53[_0xa222('0x25')],_0x3de45e['filters']));_0x41cb90[_0xa222('0x23')][_0xa222('0x45')]=_0x221ff0['id'];if(_0x44cc53[_0xa222('0x25')]['filter']){_0x41cb90[_0xa222('0x23')]=_[_0xa222('0x31')](_0x41cb90[_0xa222('0x23')],{'$or':_[_0xa222('0x46')](_0x41cb90[_0xa222('0x2d')],function(_0x52c4a2){var _0x5c88e6={};_0x5c88e6[_0x52c4a2]={'$like':'%'+_0x44cc53['query'][_0xa222('0x47')]+'%'};return _0x5c88e6;})});}_0x41cb90=_['merge']({},_0x41cb90,_0x44cc53[_0xa222('0x48')]);return db['UserOpenchannelQueue']['findAll'](_0x41cb90);}})[_0xa222('0x15')](function(_0x4fd5d7){if(_0x4fd5d7){return db[_0xa222('0x49')][_0xa222('0x4a')]({'where':{'id':_[_0xa222('0x46')](_0x4fd5d7,_0xa222('0x4b')),'role':_0xa222('0x4c')},'attributes':['id','name',_0xa222('0x4d'),'updatedAt',_0xa222('0x4e')]});}})['then'](function(_0x3620f0){if(_0x3620f0){return{'count':_0x3620f0[_0xa222('0x11')],'rows':_[_0xa222('0x46')](_0x3620f0['rows'],function(_0x403745){return{'membername':_0x403745[_0xa222('0x1b')],'UserId':_0x403745['id'],'queue_name':_0xf4e1b9[_0xa222('0x1b')],'OpenchannelQueueId':_0xf4e1b9['id'],'interface':util[_0xa222('0x4f')](_0xa222('0x50'),_0xa222('0x51'),_0x403745[_0xa222('0x1b')]),'penalty':0x0,'paused':_0x403745['openchannelPause'],'createdAt':_0x403745[_0xa222('0x4e')],'updatedAt':_0x403745[_0xa222('0x52')]};})};}else{return{'count':0x0,'rows':[]};}})[_0xa222('0x15')](respondWithFilteredResult(_0x350d56,_0x41cb90))[_0xa222('0x28')](handleError(_0x350d56,null));};exports['getTeams']=function(_0x363809,_0x237631){var _0x1a0414={};var _0x1a41e8={};var _0x4a222b;var _0x5679fb;return db['OpenchannelQueue'][_0xa222('0x53')]({'where':{'id':_0x363809['params']['id']}})[_0xa222('0x15')](handleEntityNotFound(_0x237631,null))['then'](function(_0x2757bb){if(_0x2757bb){_0x4a222b=_0x2757bb;_0x1a41e8[_0xa222('0x2a')]=_[_0xa222('0x2b')](db[_0xa222('0x54')][_0xa222('0x1f')]);_0x1a41e8[_0xa222('0x25')]=_[_0xa222('0x2b')](_0x363809[_0xa222('0x25')]);_0x1a41e8[_0xa222('0x2c')]=_[_0xa222('0x2e')](_0x1a41e8['model'],_0x1a41e8[_0xa222('0x25')]);_0x1a0414[_0xa222('0x2d')]=_[_0xa222('0x2e')](_0x1a41e8[_0xa222('0x2a')],qs[_0xa222('0x2f')](_0x363809[_0xa222('0x25')][_0xa222('0x2f')]));_0x1a0414[_0xa222('0x2d')]=_0x1a0414[_0xa222('0x2d')][_0xa222('0x30')]?_0x1a0414[_0xa222('0x2d')]:_0x1a41e8[_0xa222('0x2a')];_0x1a0414[_0xa222('0x42')]=qs['sort'](_0x363809[_0xa222('0x25')][_0xa222('0x43')]);_0x1a0414[_0xa222('0x23')]=qs['filters'](_[_0xa222('0x44')](_0x363809[_0xa222('0x25')],_0x1a41e8[_0xa222('0x2c')]));if(_0x363809[_0xa222('0x25')][_0xa222('0x47')]){_0x1a0414[_0xa222('0x23')]=_[_0xa222('0x31')](_0x1a0414['where'],{'$or':_[_0xa222('0x46')](_0x1a0414[_0xa222('0x2d')],function(_0x45112c){var _0x585e17={};_0x585e17[_0x45112c]={'$like':'%'+_0x363809[_0xa222('0x25')]['filter']+'%'};return _0x585e17;})});}_0x1a0414=_[_0xa222('0x31')]({},_0x1a0414,_0x363809['options']);return _0x4a222b[_0xa222('0x55')](_0x1a0414);}})[_0xa222('0x15')](function(_0x1d6c42){if(_0x1d6c42){_0x5679fb=_0x1d6c42[_0xa222('0x30')];if(!_0x363809['query'][_0xa222('0x40')](_0xa222('0x41'))){_0x1a0414[_0xa222('0x10')]=qs['limit'](_0x363809[_0xa222('0x25')]['limit']);_0x1a0414[_0xa222('0xe')]=qs['offset'](_0x363809[_0xa222('0x25')][_0xa222('0xe')]);}return _0x4a222b['getTeams'](_0x1a0414);}})[_0xa222('0x15')](function(_0x5d0cf3){if(_0x5d0cf3){return _0x5d0cf3?{'count':_0x5679fb,'rows':_0x5d0cf3}:null;}})[_0xa222('0x15')](respondWithResult(_0x237631,null))[_0xa222('0x28')](handleError(_0x237631,null));};exports[_0xa222('0x56')]=function(_0x25f870,_0x32075f){var _0x1ba4c7=_0x25f870[_0xa222('0x3c')][_0xa222('0x57')];return db['Team'][_0xa222('0x26')]({'where':{'id':_0x1ba4c7},'attributes':['id'],'include':[{'model':db[_0xa222('0x49')],'as':'Agents','attributes':['id',_0xa222('0x1b'),_0xa222('0x58'),_0xa222('0x59'),_0xa222('0x5a')],'raw':!![]}]})[_0xa222('0x15')](function(_0x13d5fd){if(_0x13d5fd){var _0x1c2148=_['flatMap'](_0x13d5fd,function(_0x31e353){var _0x3f1ef2=_0x31e353[_0xa222('0x16')]({'plain':!![]});return _0x3f1ef2[_0xa222('0x5b')];});return db[_0xa222('0x1e')]['find']({'where':{'id':_0x25f870[_0xa222('0x29')]['id']}})['then'](function(_0x55d05e){return db['sequelize'][_0xa222('0x5c')](function(_0x48191d){return _0x55d05e[_0xa222('0x56')](_0x1ba4c7,{'transaction':_0x48191d})[_0xa222('0x15')](function(){return BPromise[_0xa222('0x5d')](_0x1c2148,function(_0x530c8f){return db['UserOpenchannelQueue'][_0xa222('0x5e')]({'where':{'UserId':_0x530c8f['id'],'OpenchannelQueueId':_0x25f870['params']['id']},'transaction':_0x48191d});});})[_0xa222('0x15')](function(){_0x1c2148[_0xa222('0x5f')](function(_0x27edba){socket['emit'](_0xa222('0x60'),{'UserId':_0x27edba['id'],'OpenchannelQueueId':_0x55d05e['id']});});});});});}})[_0xa222('0x15')](respondWithStatusCode(_0x32075f,null))[_0xa222('0x28')](handleError(_0x32075f,null));};exports[_0xa222('0x61')]=function(_0x38ef4d,_0x5df07f){return db[_0xa222('0x54')][_0xa222('0x26')]({'where':{'id':_0x38ef4d[_0xa222('0x25')][_0xa222('0x57')]},'attributes':['id'],'include':[{'model':db[_0xa222('0x49')],'as':_0xa222('0x5b'),'attributes':['id'],'raw':!![]}]})[_0xa222('0x15')](handleEntityNotFound(_0x5df07f,null))[_0xa222('0x15')](function(_0x4e2cd0){var _0x2081db=_[_0xa222('0x46')](_0x4e2cd0,'id');var _0x466f81=[];var _0x219391=[];var _0x3bbab3=squel['select']();_0x3bbab3[_0xa222('0x62')]('tq.TeamId')[_0xa222('0x63')](_0xa222('0x64'),'tq')[_0xa222('0x65')]('user_has_teams','ut','ut.TeamId\x20=\x20tq.TeamId')[_0xa222('0x23')](_0xa222('0x66'),_0x38ef4d[_0xa222('0x29')]['id']);for(var _0xa2013e=0x0;_0xa2013e<_0x4e2cd0['length'];_0xa2013e+=0x1){let _0x1a55c0=_0x4e2cd0[_0xa2013e];for(var _0x2b5404=0x0;_0x2b5404<_0x1a55c0[_0xa222('0x5b')]['length'];_0x2b5404+=0x1){let _0x4b522a=_0x1a55c0['Agents'][_0x2b5404];var _0x1b0162=_0x3bbab3['clone']();_0x1b0162['where'](_0xa222('0x67'),_0x4b522a['id']);_0x219391[_0xa222('0x68')](db[_0xa222('0x69')]['query'](_0x1b0162[_0xa222('0x6a')](),{'type':db[_0xa222('0x69')]['QueryTypes'][_0xa222('0x6b')]})[_0xa222('0x15')](function(_0x4ec4ee){if(_0x4ec4ee[_0xa222('0x30')]===0x1){return _0x4b522a['id'];}else{var _0x3bcb59=_[_0xa222('0x6c')](_[_0xa222('0x46')](_0x4ec4ee,_0xa222('0x6d')),function(_0x2984b5){return _[_0xa222('0x6e')](_0x2081db,_0x2984b5);});if(_0x3bcb59){return _0x4b522a['id'];}}}));}}return BPromise[_0xa222('0x6f')](_0x219391)['then'](function(_0x52c191){_0x466f81=_(_0x466f81)['union'](_0x52c191)[_0xa222('0x70')]()[_0xa222('0x71')]();return db['OpenchannelQueue'][_0xa222('0x37')]({'where':{'id':_0x38ef4d['params']['id']}})[_0xa222('0x15')](function(_0x1dce55){return db[_0xa222('0x69')][_0xa222('0x5c')](function(_0x4587db){return _0x1dce55[_0xa222('0x61')](_0x38ef4d[_0xa222('0x25')][_0xa222('0x57')],{'transaction':_0x4587db})[_0xa222('0x15')](function(){if(!_[_0xa222('0x72')](_0x466f81)){return _0x1dce55[_0xa222('0x73')](_0x466f81,{'transaction':_0x4587db});}})[_0xa222('0x15')](function(){_0x466f81['forEach'](function(_0x2c60e6){socket[_0xa222('0x74')]('userOpenchannelQueue:remove',{'UserId':_0x2c60e6,'OpenchannelQueueId':_0x1dce55['id']});});});});});});})[_0xa222('0x15')](respondWithStatusCode(_0x5df07f,null))['catch'](handleError(_0x5df07f,null));};exports[_0xa222('0x75')]=function(_0x49436f,_0x472a05){return db['OpenchannelQueue']['find']({'where':{'id':_0x49436f[_0xa222('0x29')]['id']}})[_0xa222('0x15')](handleEntityNotFound(_0x472a05,null))['then'](function(_0x482f8c){if(_0x482f8c){return _0x482f8c[_0xa222('0x75')](_0x49436f[_0xa222('0x3c')][_0xa222('0x57')],_[_0xa222('0x76')](_0x49436f['body'],[_0xa222('0x57'),'id'])||{})[_0xa222('0x77')](function(_0x1bc3b3){for(var _0x4a793e=0x0;_0x4a793e<_0x49436f['body'][_0xa222('0x57')]['length'];_0x4a793e+=0x1){socket[_0xa222('0x74')](_0xa222('0x60'),{'UserId':Number(_0x49436f[_0xa222('0x3c')]['ids'][_0x4a793e]),'OpenchannelQueueId':Number(_0x49436f['params']['id'])});}return _0x1bc3b3;});}})[_0xa222('0x15')](respondWithResult(_0x472a05,null))[_0xa222('0x28')](handleError(_0x472a05,null));};exports[_0xa222('0x73')]=function(_0x1927d2,_0x1b8bdd){return db[_0xa222('0x1e')][_0xa222('0x37')]({'where':{'id':_0x1927d2['params']['id']}})[_0xa222('0x15')](handleEntityNotFound(_0x1b8bdd,null))[_0xa222('0x15')](function(_0x51c5e7){if(_0x51c5e7){return _0x51c5e7[_0xa222('0x73')](_0x1927d2['query'][_0xa222('0x57')])['then'](function(){if(_[_0xa222('0x78')](_0x1927d2[_0xa222('0x25')][_0xa222('0x57')])){for(var _0x28aba1=0x0;_0x28aba1<_0x1927d2[_0xa222('0x25')]['ids'][_0xa222('0x30')];_0x28aba1+=0x1){socket['emit'](_0xa222('0x79'),{'UserId':Number(_0x1927d2['query']['ids'][_0x28aba1]),'OpenchannelQueueId':Number(_0x1927d2[_0xa222('0x29')]['id'])});}}else{socket['emit'](_0xa222('0x79'),{'UserId':Number(_0x1927d2['query'][_0xa222('0x57')]),'OpenchannelQueueId':Number(_0x1927d2[_0xa222('0x29')]['id'])});}});}})[_0xa222('0x15')](respondWithStatusCode(_0x1b8bdd,null))[_0xa222('0x28')](handleError(_0x1b8bdd,null));};exports[_0xa222('0x7a')]=function(_0x553bbf,_0x3b87e4){var _0x15c377={};var _0x4243f4={};var _0x57e97d;var _0x45eca6;return db['OpenchannelQueue']['findOne']({'where':{'id':_0x553bbf['params']['id']}})[_0xa222('0x15')](handleEntityNotFound(_0x3b87e4,null))['then'](function(_0x226454){if(_0x226454){_0x57e97d=_0x226454;_0x4243f4[_0xa222('0x2a')]=_['keys'](db[_0xa222('0x49')][_0xa222('0x1f')]);_0x4243f4['query']=_[_0xa222('0x2b')](_0x553bbf[_0xa222('0x25')]);_0x4243f4[_0xa222('0x2c')]=_[_0xa222('0x2e')](_0x4243f4['model'],_0x4243f4[_0xa222('0x25')]);_0x15c377[_0xa222('0x2d')]=_[_0xa222('0x2e')](_0x4243f4[_0xa222('0x2a')],qs[_0xa222('0x2f')](_0x553bbf[_0xa222('0x25')][_0xa222('0x2f')]));_0x15c377[_0xa222('0x2d')]=_0x15c377[_0xa222('0x2d')][_0xa222('0x30')]?_0x15c377[_0xa222('0x2d')]:_0x4243f4[_0xa222('0x2a')];_0x15c377[_0xa222('0x42')]=qs['sort'](_0x553bbf[_0xa222('0x25')][_0xa222('0x43')]);_0x15c377['where']=qs['filters'](_[_0xa222('0x44')](_0x553bbf[_0xa222('0x25')],_0x4243f4[_0xa222('0x2c')]));if(_0x553bbf[_0xa222('0x25')]['filter']){_0x15c377['where']=_['merge'](_0x15c377[_0xa222('0x23')],{'$or':_[_0xa222('0x46')](_0x15c377['attributes'],function(_0x3a1eb6){var _0xca922c={};_0xca922c[_0x3a1eb6]={'$like':'%'+_0x553bbf[_0xa222('0x25')][_0xa222('0x47')]+'%'};return _0xca922c;})});}_0x15c377=_[_0xa222('0x31')]({},_0x15c377,_0x553bbf[_0xa222('0x48')]);return _0x57e97d[_0xa222('0x7a')](_0x15c377);}})[_0xa222('0x15')](function(_0x30dafc){if(_0x30dafc){_0x45eca6=_0x30dafc[_0xa222('0x30')];if(!_0x553bbf[_0xa222('0x25')][_0xa222('0x40')]('nolimit')){_0x15c377[_0xa222('0x10')]=qs[_0xa222('0x10')](_0x553bbf['query'][_0xa222('0x10')]);_0x15c377[_0xa222('0xe')]=qs['offset'](_0x553bbf['query'][_0xa222('0xe')]);}return _0x57e97d[_0xa222('0x7a')](_0x15c377);}})['then'](function(_0x2402dd){if(_0x2402dd){return _0x2402dd?{'count':_0x45eca6,'rows':_0x2402dd}:null;}})[_0xa222('0x15')](respondWithResult(_0x3b87e4,null))[_0xa222('0x28')](handleError(_0x3b87e4,null));}; \ No newline at end of file +var _0xaa92=['describe','getMembers','findOne','UserOpenchannelQueue','hasOwnProperty','limit','order','sort','pick','OpenchannelQueueId','filter','merge','map','User','findAndCountAll','openchannelPause','createdAt','rows','format','%s/%s','SIP','getTeams','Team','addTeams','Agents','online','voicePause','interface','flatMap','sequelize','transaction','each','forEach','emit','removeTeams','ids','select','field','tq.TeamId','from','team_has_openchannel_queues','join','user_has_teams','ut.TeamId\x20=\x20tq.TeamId','OpenchannelQueueId\x20=\x20?','clone','ut.UserId\x20=\x20?','push','toString','QueryTypes','every','TeamId','includes','all','union','compact','removeAgents','userOpenchannelQueue:remove','addAgents','omit','userOpenchannelQueue:save','isArray','getAgents','nolimit','bluebird','lodash','squel','../../config/logger','api','../../config/environment','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./openchannelQueue.socket','register','sendStatus','status','end','json','offset','count','then','get','OpenchannelQueues','UserProfileResource','destroy','error','name','send','index','rawAttributes','fieldName','type','key','getOptions','where','OpenchannelQueue','include','findAll','show','params','model','keys','filters','attributes','intersection','query','fields','length','includeAll','options','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','autoAssociation','catch','update'];(function(_0x3947c9,_0x4d6c97){var _0x2e7871=function(_0x1236cc){while(--_0x1236cc){_0x3947c9['push'](_0x3947c9['shift']());}};_0x2e7871(++_0x4d6c97);}(_0xaa92,0x136));var _0x2aa9=function(_0x38ff1e,_0x3b9385){_0x38ff1e=_0x38ff1e-0x0;var _0x3755d4=_0xaa92[_0x38ff1e];return _0x3755d4;};'use strict';var BPromise=require(_0x2aa9('0x0'));var util=require('util');var _=require(_0x2aa9('0x1'));var squel=require(_0x2aa9('0x2'));var Redis=require('ioredis');var qs=require('../../components/parsers/qs');var logger=require(_0x2aa9('0x3'))(_0x2aa9('0x4'));var config=require(_0x2aa9('0x5'));var db=require(_0x2aa9('0x6'))['db'];config[_0x2aa9('0x7')]=_[_0x2aa9('0x8')](config[_0x2aa9('0x7')],{'host':_0x2aa9('0x9'),'port':0x18eb});var socket=require(_0x2aa9('0xa'))(new Redis(config['redis']));require(_0x2aa9('0xb'))[_0x2aa9('0xc')](socket);function respondWithStatusCode(_0x4acaf7,_0x23ebf6){_0x23ebf6=_0x23ebf6||0xcc;return function(_0x488909){if(_0x488909){return _0x4acaf7[_0x2aa9('0xd')](_0x23ebf6);}return _0x4acaf7[_0x2aa9('0xe')](_0x23ebf6)[_0x2aa9('0xf')]();};}function respondWithResult(_0x3bbcf6,_0x2a638b){_0x2a638b=_0x2a638b||0xc8;return function(_0x48a897){if(_0x48a897){return _0x3bbcf6['status'](_0x2a638b)[_0x2aa9('0x10')](_0x48a897);}};}function respondWithFilteredResult(_0x514e6e,_0x60c5){return function(_0x31b687){if(_0x31b687){var _0x20b5ea=typeof _0x60c5[_0x2aa9('0x11')]==='undefined'&&typeof _0x60c5['limit']==='undefined';var _0x1af8a=_0x31b687[_0x2aa9('0x12')];var _0x357474=_0x20b5ea?0x0:_0x60c5['offset'];var _0x4a20ea=_0x20b5ea?_0x31b687['count']:_0x60c5[_0x2aa9('0x11')]+_0x60c5['limit'];var _0x147890;if(_0x4a20ea>=_0x1af8a){_0x4a20ea=_0x1af8a;_0x147890=0xc8;}else{_0x147890=0xce;}_0x514e6e[_0x2aa9('0xe')](_0x147890);return _0x514e6e['set']('Content-Range',_0x357474+'-'+_0x4a20ea+'/'+_0x1af8a)[_0x2aa9('0x10')](_0x31b687);}return null;};}function saveUpdates(_0x389c1d){return function(_0x1657b4){if(_0x1657b4){return _0x1657b4['update'](_0x389c1d)[_0x2aa9('0x13')](function(_0x1f15dd){return _0x1f15dd;});}return null;};}function removeEntity(_0x554ec5){return function(_0x204ecc){if(_0x204ecc){return _0x204ecc['destroy']()[_0x2aa9('0x13')](function(){var _0x3fe551=_0x204ecc[_0x2aa9('0x14')]({'plain':!![]});var _0x1e7f32=_0x2aa9('0x15');return db[_0x2aa9('0x16')][_0x2aa9('0x17')]({'where':{'type':_0x1e7f32,'resourceId':_0x3fe551['id']}})['then'](function(){return _0x204ecc;});})[_0x2aa9('0x13')](function(){_0x554ec5[_0x2aa9('0xe')](0xcc)[_0x2aa9('0xf')]();});}};}function handleEntityNotFound(_0x1ab1b5){return function(_0x3f28f3){if(!_0x3f28f3){_0x1ab1b5['sendStatus'](0x194);}return _0x3f28f3;};}function handleError(_0x3157d5,_0x111577){_0x111577=_0x111577||0x1f4;return function(_0x467c8c){logger[_0x2aa9('0x18')](_0x467c8c['stack']);if(_0x467c8c[_0x2aa9('0x19')]){delete _0x467c8c['name'];}_0x3157d5[_0x2aa9('0xe')](_0x111577)[_0x2aa9('0x1a')](_0x467c8c);};}exports[_0x2aa9('0x1b')]=function(_0x232a2f,_0x27c634){var _0x4fb5fb={};var _0x2a0e6c={'count':0x0,'rows':[]};var _0x38fdf7=_['map'](db['OpenchannelQueue'][_0x2aa9('0x1c')],function(_0xb063d4){return{'name':_0xb063d4[_0x2aa9('0x1d')],'type':_0xb063d4[_0x2aa9('0x1e')][_0x2aa9('0x1f')]};});_0x4fb5fb=qs[_0x2aa9('0x20')](_0x38fdf7,_0x232a2f);var _0x5a5033={'where':_0x4fb5fb[_0x2aa9('0x21')]};return db[_0x2aa9('0x22')]['count'](_0x5a5033)[_0x2aa9('0x13')](function(_0x2dc09c){_0x2a0e6c[_0x2aa9('0x12')]=_0x2dc09c;_0x4fb5fb[_0x2aa9('0x23')]=qs[_0x2aa9('0x23')](_0x232a2f['query']);return db['OpenchannelQueue'][_0x2aa9('0x24')](_0x4fb5fb);})[_0x2aa9('0x13')](function(_0x193c8c){_0x2a0e6c['rows']=_0x193c8c;return _0x2a0e6c;})[_0x2aa9('0x13')](respondWithFilteredResult(_0x27c634,_0x4fb5fb))['catch'](handleError(_0x27c634,null));};exports[_0x2aa9('0x25')]=function(_0x13693a,_0x20e28a){var _0x5071d3={'raw':!![],'where':{'id':_0x13693a[_0x2aa9('0x26')]['id']}},_0x38646d={};_0x38646d[_0x2aa9('0x27')]=_[_0x2aa9('0x28')](db['OpenchannelQueue'][_0x2aa9('0x1c')]);_0x38646d['query']=_[_0x2aa9('0x28')](_0x13693a['query']);_0x38646d[_0x2aa9('0x29')]=_['intersection'](_0x38646d[_0x2aa9('0x27')],_0x38646d['query']);_0x5071d3[_0x2aa9('0x2a')]=_[_0x2aa9('0x2b')](_0x38646d[_0x2aa9('0x27')],qs['fields'](_0x13693a[_0x2aa9('0x2c')][_0x2aa9('0x2d')]));_0x5071d3[_0x2aa9('0x2a')]=_0x5071d3['attributes'][_0x2aa9('0x2e')]?_0x5071d3[_0x2aa9('0x2a')]:_0x38646d['model'];if(_0x13693a['query'][_0x2aa9('0x2f')]){_0x5071d3['include']=[{'all':!![]}];}_0x5071d3=_['merge']({},_0x5071d3,_0x13693a[_0x2aa9('0x30')]);return db[_0x2aa9('0x22')][_0x2aa9('0x31')](_0x5071d3)[_0x2aa9('0x13')](handleEntityNotFound(_0x20e28a,null))['then'](respondWithResult(_0x20e28a,null))['catch'](handleError(_0x20e28a,null));};exports[_0x2aa9('0x32')]=function(_0xe32509,_0x533d86){return db[_0x2aa9('0x22')][_0x2aa9('0x32')](_0xe32509[_0x2aa9('0x33')],{})[_0x2aa9('0x13')](function(_0x486995){var _0x202474=_0xe32509[_0x2aa9('0x34')][_0x2aa9('0x14')]({'plain':!![]});if(!_0x202474)throw new Error(_0x2aa9('0x35'));if(_0x202474[_0x2aa9('0x36')]===_0x2aa9('0x34')){var _0x1aa09a=_0x486995[_0x2aa9('0x14')]({'plain':!![]});var _0x2ae869=_0x2aa9('0x15');return db[_0x2aa9('0x37')][_0x2aa9('0x31')]({'where':{'name':_0x2ae869,'userProfileId':_0x202474['userProfileId']},'raw':!![]})[_0x2aa9('0x13')](function(_0x78537){if(_0x78537&&_0x78537[_0x2aa9('0x38')]===0x0){return db[_0x2aa9('0x16')]['create']({'name':_0x1aa09a['name'],'resourceId':_0x1aa09a['id'],'type':_0x78537['name'],'sectionId':_0x78537['id']},{})[_0x2aa9('0x13')](function(){return _0x486995;});}else{return _0x486995;}})[_0x2aa9('0x39')](function(_0x290bd2){logger[_0x2aa9('0x18')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x290bd2);throw _0x290bd2;});}return _0x486995;})['then'](respondWithResult(_0x533d86,0xc9))[_0x2aa9('0x39')](handleError(_0x533d86,null));};exports[_0x2aa9('0x3a')]=function(_0x3308b7,_0x3ec904){if(_0x3308b7['body']['id']){delete _0x3308b7[_0x2aa9('0x33')]['id'];}return db[_0x2aa9('0x22')][_0x2aa9('0x31')]({'where':{'id':_0x3308b7[_0x2aa9('0x26')]['id']}})[_0x2aa9('0x13')](handleEntityNotFound(_0x3ec904,null))[_0x2aa9('0x13')](saveUpdates(_0x3308b7[_0x2aa9('0x33')],null))[_0x2aa9('0x13')](respondWithResult(_0x3ec904,null))[_0x2aa9('0x39')](handleError(_0x3ec904,null));};exports['destroy']=function(_0x4e3c77,_0x23ff5e){return db[_0x2aa9('0x22')][_0x2aa9('0x31')]({'where':{'id':_0x4e3c77[_0x2aa9('0x26')]['id']}})[_0x2aa9('0x13')](handleEntityNotFound(_0x23ff5e,null))[_0x2aa9('0x13')](removeEntity(_0x23ff5e,null))[_0x2aa9('0x39')](handleError(_0x23ff5e,null));};exports[_0x2aa9('0x3b')]=function(_0x19eadc,_0x436113){return db['OpenchannelQueue'][_0x2aa9('0x3b')]()[_0x2aa9('0x13')](respondWithResult(_0x436113,null))[_0x2aa9('0x39')](handleError(_0x436113,null));};exports[_0x2aa9('0x3c')]=function(_0x5c32dc,_0x451945){var _0x470e56={'raw':!![],'where':{}},_0x512687={},_0x3a03a6;return db[_0x2aa9('0x22')][_0x2aa9('0x3d')]({'where':{'id':_0x5c32dc['params']['id']}})['then'](handleEntityNotFound(_0x451945,null))[_0x2aa9('0x13')](function(_0x4d470d){if(_0x4d470d){_0x3a03a6=_0x4d470d['get']({'plain':!![]});_0x512687[_0x2aa9('0x27')]=_[_0x2aa9('0x28')](db[_0x2aa9('0x3e')][_0x2aa9('0x1c')]);_0x512687[_0x2aa9('0x2c')]=_[_0x2aa9('0x28')](_0x5c32dc[_0x2aa9('0x2c')]);_0x512687[_0x2aa9('0x29')]=_[_0x2aa9('0x2b')](_0x512687[_0x2aa9('0x27')],_0x512687[_0x2aa9('0x2c')]);_0x470e56[_0x2aa9('0x2a')]=_[_0x2aa9('0x2b')](_0x512687[_0x2aa9('0x27')],qs[_0x2aa9('0x2d')](_0x5c32dc[_0x2aa9('0x2c')][_0x2aa9('0x2d')]));_0x470e56[_0x2aa9('0x2a')]=_0x470e56[_0x2aa9('0x2a')][_0x2aa9('0x2e')]?_0x470e56[_0x2aa9('0x2a')]:_0x512687[_0x2aa9('0x27')];if(!_0x5c32dc['query'][_0x2aa9('0x3f')]('nolimit')){_0x470e56[_0x2aa9('0x40')]=qs[_0x2aa9('0x40')](_0x5c32dc['query']['limit']);_0x470e56[_0x2aa9('0x11')]=qs['offset'](_0x5c32dc[_0x2aa9('0x2c')]['offset']);}_0x470e56[_0x2aa9('0x41')]=qs[_0x2aa9('0x42')](_0x5c32dc['query'][_0x2aa9('0x42')]);_0x470e56[_0x2aa9('0x21')]=qs[_0x2aa9('0x29')](_[_0x2aa9('0x43')](_0x5c32dc[_0x2aa9('0x2c')],_0x512687[_0x2aa9('0x29')]));_0x470e56[_0x2aa9('0x21')][_0x2aa9('0x44')]=_0x4d470d['id'];if(_0x5c32dc[_0x2aa9('0x2c')][_0x2aa9('0x45')]){_0x470e56[_0x2aa9('0x21')]=_[_0x2aa9('0x46')](_0x470e56[_0x2aa9('0x21')],{'$or':_[_0x2aa9('0x47')](_0x470e56['attributes'],function(_0x67fd06){var _0x404100={};_0x404100[_0x67fd06]={'$like':'%'+_0x5c32dc['query'][_0x2aa9('0x45')]+'%'};return _0x404100;})});}_0x470e56=_[_0x2aa9('0x46')]({},_0x470e56,_0x5c32dc['options']);return db[_0x2aa9('0x3e')][_0x2aa9('0x24')](_0x470e56);}})['then'](function(_0x2435b7){if(_0x2435b7){return db[_0x2aa9('0x48')][_0x2aa9('0x49')]({'where':{'id':_[_0x2aa9('0x47')](_0x2435b7,'UserId'),'role':'agent'},'attributes':['id',_0x2aa9('0x19'),_0x2aa9('0x4a'),'updatedAt',_0x2aa9('0x4b')]});}})[_0x2aa9('0x13')](function(_0x297dab){if(_0x297dab){return{'count':_0x297dab[_0x2aa9('0x12')],'rows':_[_0x2aa9('0x47')](_0x297dab[_0x2aa9('0x4c')],function(_0x451b5d){return{'membername':_0x451b5d[_0x2aa9('0x19')],'UserId':_0x451b5d['id'],'queue_name':_0x3a03a6['name'],'OpenchannelQueueId':_0x3a03a6['id'],'interface':util[_0x2aa9('0x4d')](_0x2aa9('0x4e'),_0x2aa9('0x4f'),_0x451b5d[_0x2aa9('0x19')]),'penalty':0x0,'paused':_0x451b5d[_0x2aa9('0x4a')],'createdAt':_0x451b5d[_0x2aa9('0x4b')],'updatedAt':_0x451b5d['updatedAt']};})};}else{return{'count':0x0,'rows':[]};}})[_0x2aa9('0x13')](respondWithFilteredResult(_0x451945,_0x470e56))[_0x2aa9('0x39')](handleError(_0x451945,null));};exports[_0x2aa9('0x50')]=function(_0x30a241,_0x55028d){var _0x4b3db2={};var _0xa54ff8={};var _0x726367;var _0x434ebd;return db[_0x2aa9('0x22')][_0x2aa9('0x3d')]({'where':{'id':_0x30a241['params']['id']}})[_0x2aa9('0x13')](handleEntityNotFound(_0x55028d,null))['then'](function(_0x6a48a9){if(_0x6a48a9){_0x726367=_0x6a48a9;_0xa54ff8['model']=_[_0x2aa9('0x28')](db[_0x2aa9('0x51')][_0x2aa9('0x1c')]);_0xa54ff8[_0x2aa9('0x2c')]=_[_0x2aa9('0x28')](_0x30a241[_0x2aa9('0x2c')]);_0xa54ff8[_0x2aa9('0x29')]=_[_0x2aa9('0x2b')](_0xa54ff8[_0x2aa9('0x27')],_0xa54ff8['query']);_0x4b3db2[_0x2aa9('0x2a')]=_['intersection'](_0xa54ff8[_0x2aa9('0x27')],qs['fields'](_0x30a241['query']['fields']));_0x4b3db2['attributes']=_0x4b3db2[_0x2aa9('0x2a')][_0x2aa9('0x2e')]?_0x4b3db2[_0x2aa9('0x2a')]:_0xa54ff8[_0x2aa9('0x27')];_0x4b3db2[_0x2aa9('0x41')]=qs['sort'](_0x30a241[_0x2aa9('0x2c')][_0x2aa9('0x42')]);_0x4b3db2[_0x2aa9('0x21')]=qs['filters'](_['pick'](_0x30a241[_0x2aa9('0x2c')],_0xa54ff8[_0x2aa9('0x29')]));if(_0x30a241[_0x2aa9('0x2c')][_0x2aa9('0x45')]){_0x4b3db2[_0x2aa9('0x21')]=_[_0x2aa9('0x46')](_0x4b3db2[_0x2aa9('0x21')],{'$or':_['map'](_0x4b3db2[_0x2aa9('0x2a')],function(_0x2953af){var _0x669040={};_0x669040[_0x2953af]={'$like':'%'+_0x30a241[_0x2aa9('0x2c')][_0x2aa9('0x45')]+'%'};return _0x669040;})});}_0x4b3db2=_['merge']({},_0x4b3db2,_0x30a241[_0x2aa9('0x30')]);return _0x726367[_0x2aa9('0x50')](_0x4b3db2);}})[_0x2aa9('0x13')](function(_0xd381a6){if(_0xd381a6){_0x434ebd=_0xd381a6[_0x2aa9('0x2e')];if(!_0x30a241[_0x2aa9('0x2c')][_0x2aa9('0x3f')]('nolimit')){_0x4b3db2['limit']=qs['limit'](_0x30a241['query']['limit']);_0x4b3db2['offset']=qs['offset'](_0x30a241['query'][_0x2aa9('0x11')]);}return _0x726367[_0x2aa9('0x50')](_0x4b3db2);}})['then'](function(_0x2fe119){if(_0x2fe119){return _0x2fe119?{'count':_0x434ebd,'rows':_0x2fe119}:null;}})[_0x2aa9('0x13')](respondWithResult(_0x55028d,null))[_0x2aa9('0x39')](handleError(_0x55028d,null));};exports[_0x2aa9('0x52')]=function(_0x5afbb3,_0x4a280c){var _0x8b1b15=_0x5afbb3[_0x2aa9('0x33')]['ids'];return db[_0x2aa9('0x51')][_0x2aa9('0x24')]({'where':{'id':_0x8b1b15},'attributes':['id'],'include':[{'model':db[_0x2aa9('0x48')],'as':_0x2aa9('0x53'),'attributes':['id',_0x2aa9('0x19'),_0x2aa9('0x54'),_0x2aa9('0x55'),_0x2aa9('0x56')],'raw':!![]}]})[_0x2aa9('0x13')](function(_0x5bc080){if(_0x5bc080){var _0x18718e=_[_0x2aa9('0x57')](_0x5bc080,function(_0x416e81){var _0x14c0cf=_0x416e81[_0x2aa9('0x14')]({'plain':!![]});return _0x14c0cf[_0x2aa9('0x53')];});return db[_0x2aa9('0x22')]['find']({'where':{'id':_0x5afbb3[_0x2aa9('0x26')]['id']}})[_0x2aa9('0x13')](function(_0x517681){return db[_0x2aa9('0x58')][_0x2aa9('0x59')](function(_0x51b3d9){return _0x517681[_0x2aa9('0x52')](_0x8b1b15,{'transaction':_0x51b3d9})['then'](function(){return BPromise[_0x2aa9('0x5a')](_0x18718e,function(_0x25242f){return db[_0x2aa9('0x3e')]['findOrCreate']({'where':{'UserId':_0x25242f['id'],'OpenchannelQueueId':_0x5afbb3[_0x2aa9('0x26')]['id']},'transaction':_0x51b3d9});});})['then'](function(){_0x18718e[_0x2aa9('0x5b')](function(_0x5f004c){socket[_0x2aa9('0x5c')]('userOpenchannelQueue:save',{'UserId':_0x5f004c['id'],'OpenchannelQueueId':_0x517681['id']});});});});});}})[_0x2aa9('0x13')](respondWithStatusCode(_0x4a280c,null))['catch'](handleError(_0x4a280c,null));};exports[_0x2aa9('0x5d')]=function(_0x8367e7,_0x528cb6){return db['Team']['findAll']({'where':{'id':_0x8367e7[_0x2aa9('0x2c')][_0x2aa9('0x5e')]},'attributes':['id'],'include':[{'model':db[_0x2aa9('0x48')],'as':_0x2aa9('0x53'),'attributes':['id'],'raw':!![]}]})['then'](handleEntityNotFound(_0x528cb6,null))[_0x2aa9('0x13')](function(_0x52a244){var _0x382835=_[_0x2aa9('0x47')](_0x52a244,'id');var _0x36798c=[];var _0x17ea4f=[];var _0x5c31aa=squel[_0x2aa9('0x5f')]();_0x5c31aa[_0x2aa9('0x60')](_0x2aa9('0x61'))[_0x2aa9('0x62')](_0x2aa9('0x63'),'tq')[_0x2aa9('0x64')](_0x2aa9('0x65'),'ut',_0x2aa9('0x66'))[_0x2aa9('0x21')](_0x2aa9('0x67'),_0x8367e7[_0x2aa9('0x26')]['id']);for(var _0x32ffca=0x0;_0x32ffca<_0x52a244[_0x2aa9('0x2e')];_0x32ffca+=0x1){let _0x360765=_0x52a244[_0x32ffca];for(var _0x3e20ba=0x0;_0x3e20ba<_0x360765[_0x2aa9('0x53')][_0x2aa9('0x2e')];_0x3e20ba+=0x1){let _0x5080b0=_0x360765['Agents'][_0x3e20ba];var _0x59842e=_0x5c31aa[_0x2aa9('0x68')]();_0x59842e[_0x2aa9('0x21')](_0x2aa9('0x69'),_0x5080b0['id']);_0x17ea4f[_0x2aa9('0x6a')](db[_0x2aa9('0x58')][_0x2aa9('0x2c')](_0x59842e[_0x2aa9('0x6b')](),{'type':db[_0x2aa9('0x58')][_0x2aa9('0x6c')]['SELECT']})['then'](function(_0x127afb){if(_0x127afb[_0x2aa9('0x2e')]===0x1){return _0x5080b0['id'];}else{var _0x5d2e42=_[_0x2aa9('0x6d')](_[_0x2aa9('0x47')](_0x127afb,_0x2aa9('0x6e')),function(_0x370cf4){return _[_0x2aa9('0x6f')](_0x382835,_0x370cf4);});if(_0x5d2e42){return _0x5080b0['id'];}}}));}}return BPromise[_0x2aa9('0x70')](_0x17ea4f)['then'](function(_0x5276df){_0x36798c=_(_0x36798c)[_0x2aa9('0x71')](_0x5276df)[_0x2aa9('0x72')]()['value']();return db['OpenchannelQueue'][_0x2aa9('0x31')]({'where':{'id':_0x8367e7['params']['id']}})['then'](function(_0x52f293){return db['sequelize']['transaction'](function(_0x1cc1d9){return _0x52f293['removeTeams'](_0x8367e7[_0x2aa9('0x2c')]['ids'],{'transaction':_0x1cc1d9})[_0x2aa9('0x13')](function(){if(!_['isEmpty'](_0x36798c)){return _0x52f293[_0x2aa9('0x73')](_0x36798c,{'transaction':_0x1cc1d9});}})[_0x2aa9('0x13')](function(){_0x36798c[_0x2aa9('0x5b')](function(_0xad2bb5){socket[_0x2aa9('0x5c')](_0x2aa9('0x74'),{'UserId':_0xad2bb5,'OpenchannelQueueId':_0x52f293['id']});});});});});});})[_0x2aa9('0x13')](respondWithStatusCode(_0x528cb6,null))[_0x2aa9('0x39')](handleError(_0x528cb6,null));};exports[_0x2aa9('0x75')]=function(_0x418824,_0x4c4c79){return db['OpenchannelQueue'][_0x2aa9('0x31')]({'where':{'id':_0x418824[_0x2aa9('0x26')]['id']}})[_0x2aa9('0x13')](handleEntityNotFound(_0x4c4c79,null))[_0x2aa9('0x13')](function(_0x31f19d){if(_0x31f19d){return _0x31f19d[_0x2aa9('0x75')](_0x418824[_0x2aa9('0x33')][_0x2aa9('0x5e')],_[_0x2aa9('0x76')](_0x418824['body'],[_0x2aa9('0x5e'),'id'])||{})['spread'](function(_0x4fcd4c){for(var _0x2e0e42=0x0;_0x2e0e42<_0x418824[_0x2aa9('0x33')][_0x2aa9('0x5e')][_0x2aa9('0x2e')];_0x2e0e42+=0x1){socket[_0x2aa9('0x5c')](_0x2aa9('0x77'),{'UserId':Number(_0x418824[_0x2aa9('0x33')][_0x2aa9('0x5e')][_0x2e0e42]),'OpenchannelQueueId':Number(_0x418824[_0x2aa9('0x26')]['id'])});}return _0x4fcd4c;});}})[_0x2aa9('0x13')](respondWithResult(_0x4c4c79,null))[_0x2aa9('0x39')](handleError(_0x4c4c79,null));};exports[_0x2aa9('0x73')]=function(_0x242609,_0x1880d5){return db[_0x2aa9('0x22')][_0x2aa9('0x31')]({'where':{'id':_0x242609[_0x2aa9('0x26')]['id']}})[_0x2aa9('0x13')](handleEntityNotFound(_0x1880d5,null))[_0x2aa9('0x13')](function(_0x44be48){if(_0x44be48){return _0x44be48['removeAgents'](_0x242609[_0x2aa9('0x2c')][_0x2aa9('0x5e')])[_0x2aa9('0x13')](function(){if(_[_0x2aa9('0x78')](_0x242609[_0x2aa9('0x2c')][_0x2aa9('0x5e')])){for(var _0x1cea18=0x0;_0x1cea18<_0x242609[_0x2aa9('0x2c')][_0x2aa9('0x5e')]['length'];_0x1cea18+=0x1){socket[_0x2aa9('0x5c')](_0x2aa9('0x74'),{'UserId':Number(_0x242609[_0x2aa9('0x2c')]['ids'][_0x1cea18]),'OpenchannelQueueId':Number(_0x242609['params']['id'])});}}else{socket['emit'](_0x2aa9('0x74'),{'UserId':Number(_0x242609[_0x2aa9('0x2c')]['ids']),'OpenchannelQueueId':Number(_0x242609[_0x2aa9('0x26')]['id'])});}});}})[_0x2aa9('0x13')](respondWithStatusCode(_0x1880d5,null))['catch'](handleError(_0x1880d5,null));};exports[_0x2aa9('0x79')]=function(_0x21c5e9,_0x41d4e7){var _0x8f59d7={};var _0x275eac={};var _0x25fd72;var _0x509304;return db[_0x2aa9('0x22')][_0x2aa9('0x3d')]({'where':{'id':_0x21c5e9['params']['id']}})['then'](handleEntityNotFound(_0x41d4e7,null))[_0x2aa9('0x13')](function(_0x460802){if(_0x460802){_0x25fd72=_0x460802;_0x275eac[_0x2aa9('0x27')]=_[_0x2aa9('0x28')](db[_0x2aa9('0x48')][_0x2aa9('0x1c')]);_0x275eac[_0x2aa9('0x2c')]=_['keys'](_0x21c5e9['query']);_0x275eac[_0x2aa9('0x29')]=_[_0x2aa9('0x2b')](_0x275eac['model'],_0x275eac[_0x2aa9('0x2c')]);_0x8f59d7['attributes']=_[_0x2aa9('0x2b')](_0x275eac[_0x2aa9('0x27')],qs[_0x2aa9('0x2d')](_0x21c5e9['query'][_0x2aa9('0x2d')]));_0x8f59d7['attributes']=_0x8f59d7[_0x2aa9('0x2a')]['length']?_0x8f59d7[_0x2aa9('0x2a')]:_0x275eac[_0x2aa9('0x27')];_0x8f59d7[_0x2aa9('0x41')]=qs['sort'](_0x21c5e9[_0x2aa9('0x2c')][_0x2aa9('0x42')]);_0x8f59d7[_0x2aa9('0x21')]=qs['filters'](_[_0x2aa9('0x43')](_0x21c5e9[_0x2aa9('0x2c')],_0x275eac[_0x2aa9('0x29')]));if(_0x21c5e9['query']['filter']){_0x8f59d7[_0x2aa9('0x21')]=_[_0x2aa9('0x46')](_0x8f59d7[_0x2aa9('0x21')],{'$or':_[_0x2aa9('0x47')](_0x8f59d7['attributes'],function(_0x40ea1a){var _0x1d0913={};_0x1d0913[_0x40ea1a]={'$like':'%'+_0x21c5e9[_0x2aa9('0x2c')]['filter']+'%'};return _0x1d0913;})});}_0x8f59d7=_[_0x2aa9('0x46')]({},_0x8f59d7,_0x21c5e9['options']);return _0x25fd72[_0x2aa9('0x79')](_0x8f59d7);}})['then'](function(_0x374297){if(_0x374297){_0x509304=_0x374297[_0x2aa9('0x2e')];if(!_0x21c5e9[_0x2aa9('0x2c')][_0x2aa9('0x3f')](_0x2aa9('0x7a'))){_0x8f59d7['limit']=qs['limit'](_0x21c5e9[_0x2aa9('0x2c')]['limit']);_0x8f59d7[_0x2aa9('0x11')]=qs[_0x2aa9('0x11')](_0x21c5e9[_0x2aa9('0x2c')][_0x2aa9('0x11')]);}return _0x25fd72[_0x2aa9('0x79')](_0x8f59d7);}})[_0x2aa9('0x13')](function(_0x12db80){if(_0x12db80){return _0x12db80?{'count':_0x509304,'rows':_0x12db80}:null;}})[_0x2aa9('0x13')](respondWithResult(_0x41d4e7,null))[_0x2aa9('0x39')](handleError(_0x41d4e7,null));}; \ No newline at end of file diff --git a/server/api/openchannelQueue/openchannelQueue.events.js b/server/api/openchannelQueue/openchannelQueue.events.js index 6f1a62d..6dc501f 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 _0xe0e6=['OpenchannelQueue','setMaxListeners','save','update','emit','hook','events','../../mysqldb'];(function(_0x2563b7,_0x313b3a){var _0x5b1ffe=function(_0x312065){while(--_0x312065){_0x2563b7['push'](_0x2563b7['shift']());}};_0x5b1ffe(++_0x313b3a);}(_0xe0e6,0xb6));var _0x6e0e=function(_0x1b2e6b,_0x2f97fb){_0x1b2e6b=_0x1b2e6b-0x0;var _0x1dd2aa=_0xe0e6[_0x1b2e6b];return _0x1dd2aa;};'use strict';var EventEmitter=require(_0x6e0e('0x0'));var OpenchannelQueue=require(_0x6e0e('0x1'))['db'][_0x6e0e('0x2')];var OpenchannelQueueEvents=new EventEmitter();OpenchannelQueueEvents[_0x6e0e('0x3')](0x0);var events={'afterCreate':_0x6e0e('0x4'),'afterUpdate':_0x6e0e('0x5'),'afterDestroy':'remove'};function emitEvent(_0xc63c62){return function(_0x16fa44,_0x26e546,_0x59e21f){OpenchannelQueueEvents[_0x6e0e('0x6')](_0xc63c62+':'+_0x16fa44['id'],_0x16fa44);OpenchannelQueueEvents[_0x6e0e('0x6')](_0xc63c62,_0x16fa44);_0x59e21f(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];OpenchannelQueue[_0x6e0e('0x7')](e,emitEvent(event));}}module['exports']=OpenchannelQueueEvents; \ No newline at end of file +var _0xd1ec=['exports','events','../../mysqldb','save','update','remove','emit','hasOwnProperty','hook'];(function(_0x167cc1,_0x56ef5a){var _0x10bc4b=function(_0xd6a255){while(--_0xd6a255){_0x167cc1['push'](_0x167cc1['shift']());}};_0x10bc4b(++_0x56ef5a);}(_0xd1ec,0x1cc));var _0xcd1e=function(_0x396d02,_0x1d609d){_0x396d02=_0x396d02-0x0;var _0x5416be=_0xd1ec[_0x396d02];return _0x5416be;};'use strict';var EventEmitter=require(_0xcd1e('0x0'));var OpenchannelQueue=require(_0xcd1e('0x1'))['db']['OpenchannelQueue'];var OpenchannelQueueEvents=new EventEmitter();OpenchannelQueueEvents['setMaxListeners'](0x0);var events={'afterCreate':_0xcd1e('0x2'),'afterUpdate':_0xcd1e('0x3'),'afterDestroy':_0xcd1e('0x4')};function emitEvent(_0x3cda08){return function(_0x12bde8,_0x80949b,_0x5b8328){OpenchannelQueueEvents[_0xcd1e('0x5')](_0x3cda08+':'+_0x12bde8['id'],_0x12bde8);OpenchannelQueueEvents[_0xcd1e('0x5')](_0x3cda08,_0x12bde8);_0x5b8328(null);};}for(var e in events){if(events[_0xcd1e('0x6')](e)){var event=events[e];OpenchannelQueue[_0xcd1e('0x7')](e,emitEvent(event));}}module[_0xcd1e('0x8')]=OpenchannelQueueEvents; \ No newline at end of file diff --git a/server/api/openchannelQueue/openchannelQueue.model.js b/server/api/openchannelQueue/openchannelQueue.model.js index 0c9a091..9acc060 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 _0xba93=['openchannel_queues','lodash','util','request-promise','path','rimraf','../../config/environment','./openchannelQueue.attributes','exports','define'];(function(_0x406fbe,_0x5d3bd3){var _0x48a9e3=function(_0x525a2b){while(--_0x525a2b){_0x406fbe['push'](_0x406fbe['shift']());}};_0x48a9e3(++_0x5d3bd3);}(_0xba93,0xd3));var _0x3ba9=function(_0x168584,_0x4c1f48){_0x168584=_0x168584-0x0;var _0x3a764d=_0xba93[_0x168584];return _0x3a764d;};'use strict';var _=require(_0x3ba9('0x0'));var util=require(_0x3ba9('0x1'));var logger=require('../../config/logger')('api');var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0x3ba9('0x2'));var fs=require('fs');var path=require(_0x3ba9('0x3'));var rimraf=require(_0x3ba9('0x4'));var config=require(_0x3ba9('0x5'));var attributes=require(_0x3ba9('0x6'));module[_0x3ba9('0x7')]=function(_0x49050d,_0x55c5d6){return _0x49050d[_0x3ba9('0x8')]('OpenchannelQueue',attributes,{'tableName':_0x3ba9('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xf0c3=['api','moment','request-promise','path','rimraf','../../config/environment','./openchannelQueue.attributes','exports','OpenchannelQueue','openchannel_queues','lodash'];(function(_0x4fc9e6,_0xc51915){var _0x551d28=function(_0x1a603b){while(--_0x1a603b){_0x4fc9e6['push'](_0x4fc9e6['shift']());}};_0x551d28(++_0xc51915);}(_0xf0c3,0x1a1));var _0x3f0c=function(_0x4895ac,_0x448c33){_0x4895ac=_0x4895ac-0x0;var _0x363291=_0xf0c3[_0x4895ac];return _0x363291;};'use strict';var _=require(_0x3f0c('0x0'));var util=require('util');var logger=require('../../config/logger')(_0x3f0c('0x1'));var moment=require(_0x3f0c('0x2'));var BPromise=require('bluebird');var rp=require(_0x3f0c('0x3'));var fs=require('fs');var path=require(_0x3f0c('0x4'));var rimraf=require(_0x3f0c('0x5'));var config=require(_0x3f0c('0x6'));var attributes=require(_0x3f0c('0x7'));module[_0x3f0c('0x8')]=function(_0x55bf4b,_0x51b66d){return _0x55bf4b['define'](_0x3f0c('0x9'),attributes,{'tableName':_0x3f0c('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 bf363f8..e12199f 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 _0x633c=['http','redis','defaults','socket.io-emitter','register','then','OpenchannelQueue,\x20%s,\x20%s','request\x20sent','debug','OpenchannelQueue,\x20%s,\x20%s,\x20%s','error','message','info','result','OpenchannelQueue','findAll','options','raw','where','attributes','include','model','map','GetOpenchannelQueue','stringify','catch','ShowOpenchannelQueue','find','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','jayson/promise','client'];(function(_0x512e14,_0x28ca0c){var _0x3a2ca2=function(_0x31f501){while(--_0x31f501){_0x512e14['push'](_0x512e14['shift']());}};_0x3a2ca2(++_0x28ca0c);}(_0x633c,0xb4));var _0xc633=function(_0x3c8b28,_0xb14056){_0x3c8b28=_0x3c8b28-0x0;var _0x4bbf60=_0x633c[_0x3c8b28];return _0x4bbf60;};'use strict';var _=require(_0xc633('0x0'));var util=require(_0xc633('0x1'));var moment=require('moment');var BPromise=require(_0xc633('0x2'));var rs=require(_0xc633('0x3'));var fs=require('fs');var Redis=require(_0xc633('0x4'));var db=require(_0xc633('0x5'))['db'];var utils=require(_0xc633('0x6'));var logger=require(_0xc633('0x7'))('rpc');var config=require('../../config/environment');var jayson=require(_0xc633('0x8'));var client=jayson[_0xc633('0x9')][_0xc633('0xa')]({'port':0x232a});config[_0xc633('0xb')]=_[_0xc633('0xc')](config[_0xc633('0xb')],{'host':'localhost','port':0x18eb});var socket=require(_0xc633('0xd'))(new Redis(config[_0xc633('0xb')]));require('./openchannelQueue.socket')[_0xc633('0xe')](socket);function respondWithRpcPromise(_0x4f8dc5,_0x31824e,_0x546dff){return new BPromise(function(_0x57539f,_0x1a6427){return client['request'](_0x4f8dc5,_0x546dff)[_0xc633('0xf')](function(_0x4a2e79){logger['info'](_0xc633('0x10'),_0x31824e,_0xc633('0x11'));logger[_0xc633('0x12')](_0xc633('0x13'),_0x31824e,_0xc633('0x11'),JSON['stringify'](_0x4a2e79));if(_0x4a2e79[_0xc633('0x14')]){if(_0x4a2e79['error']['code']===0x1f4){logger[_0xc633('0x14')](_0xc633('0x10'),_0x31824e,_0x4a2e79[_0xc633('0x14')]['message']);return _0x1a6427(_0x4a2e79[_0xc633('0x14')][_0xc633('0x15')]);}logger['error'](_0xc633('0x10'),_0x31824e,_0x4a2e79[_0xc633('0x14')]['message']);return _0x57539f(_0x4a2e79[_0xc633('0x14')][_0xc633('0x15')]);}else{logger[_0xc633('0x16')]('OpenchannelQueue,\x20%s,\x20%s',_0x31824e,_0xc633('0x11'));_0x57539f(_0x4a2e79[_0xc633('0x17')][_0xc633('0x15')]);}})['catch'](function(_0x29037b){logger[_0xc633('0x14')](_0xc633('0x10'),_0x31824e,_0x29037b);_0x1a6427(_0x29037b);});});}exports['GetOpenchannelQueue']=function(_0x106000){var _0x2e41bd=this;return new Promise(function(_0x195311,_0x4e61ac){return db[_0xc633('0x18')][_0xc633('0x19')]({'raw':_0x106000[_0xc633('0x1a')]?_0x106000['options'][_0xc633('0x1b')]===undefined?!![]:![]:!![],'where':_0x106000[_0xc633('0x1a')]?_0x106000[_0xc633('0x1a')][_0xc633('0x1c')]||null:null,'attributes':_0x106000[_0xc633('0x1a')]?_0x106000['options'][_0xc633('0x1d')]||null:null,'limit':_0x106000[_0xc633('0x1a')]?_0x106000[_0xc633('0x1a')]['limit']||null:null,'include':_0x106000[_0xc633('0x1a')]?_0x106000[_0xc633('0x1a')][_0xc633('0x1e')]?_['map'](_0x106000['options']['include'],function(_0x8e21dc){return{'model':db[_0x8e21dc[_0xc633('0x1f')]],'as':_0x8e21dc['as'],'attributes':_0x8e21dc[_0xc633('0x1d')],'include':_0x8e21dc[_0xc633('0x1e')]?_[_0xc633('0x20')](_0x8e21dc['include'],function(_0x5000c9){return{'model':db[_0x5000c9[_0xc633('0x1f')]],'as':_0x5000c9['as'],'attributes':_0x5000c9[_0xc633('0x1d')],'include':_0x5000c9[_0xc633('0x1e')]?_[_0xc633('0x20')](_0x5000c9['include'],function(_0x234473){return{'model':db[_0x234473[_0xc633('0x1f')]],'as':_0x234473['as'],'attributes':_0x234473[_0xc633('0x1d')]};}):[]};}):[]};}):[]:[]})[_0xc633('0xf')](function(_0x5712ff){logger[_0xc633('0x16')](_0xc633('0x21'),_0x106000);logger[_0xc633('0x12')]('GetOpenchannelQueue',_0x106000,JSON[_0xc633('0x22')](_0x5712ff));_0x195311(_0x5712ff);})[_0xc633('0x23')](function(_0x57e361){logger['error'](_0xc633('0x21'),_0x57e361[_0xc633('0x15')],_0x106000);_0x4e61ac(_0x2e41bd[_0xc633('0x14')](0x1f4,_0x57e361[_0xc633('0x15')]));});});};exports[_0xc633('0x24')]=function(_0x10c659){var _0x523433=this;return new Promise(function(_0x3c41cf,_0x1c83d6){return db[_0xc633('0x18')][_0xc633('0x25')]({'raw':_0x10c659[_0xc633('0x1a')]?_0x10c659[_0xc633('0x1a')][_0xc633('0x1b')]===undefined?!![]:![]:!![],'where':_0x10c659[_0xc633('0x1a')]?_0x10c659[_0xc633('0x1a')]['where']||null:null,'attributes':_0x10c659[_0xc633('0x1a')]?_0x10c659['options']['attributes']||null:null,'include':_0x10c659[_0xc633('0x1a')]?_0x10c659['options'][_0xc633('0x1e')]?_[_0xc633('0x20')](_0x10c659['options'][_0xc633('0x1e')],function(_0x16ad7a){return{'model':db[_0x16ad7a['model']],'as':_0x16ad7a['as'],'attributes':_0x16ad7a[_0xc633('0x1d')],'include':_0x16ad7a[_0xc633('0x1e')]?_[_0xc633('0x20')](_0x16ad7a[_0xc633('0x1e')],function(_0x4a2381){return{'model':db[_0x4a2381['model']],'as':_0x4a2381['as'],'attributes':_0x4a2381[_0xc633('0x1d')],'include':_0x4a2381['include']?_[_0xc633('0x20')](_0x4a2381['include'],function(_0x4c8b09){return{'model':db[_0x4c8b09[_0xc633('0x1f')]],'as':_0x4c8b09['as'],'attributes':_0x4c8b09[_0xc633('0x1d')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x1a3b34){logger[_0xc633('0x16')](_0xc633('0x24'),_0x10c659);logger[_0xc633('0x12')]('ShowOpenchannelQueue',_0x10c659,JSON[_0xc633('0x22')](_0x1a3b34));_0x3c41cf(_0x1a3b34);})[_0xc633('0x23')](function(_0x35b313){logger['error'](_0xc633('0x24'),_0x35b313[_0xc633('0x15')],_0x10c659);_0x1c83d6(_0x523433[_0xc633('0x14')](0x1f4,_0x35b313[_0xc633('0x15')]));});});}; \ No newline at end of file +var _0x5b1d=['ShowOpenchannelQueue','OpenchannelQueue','where','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','rpc','../../config/environment','client','http','redis','defaults','localhost','socket.io-emitter','./openchannelQueue.socket','request','then','info','OpenchannelQueue,\x20%s,\x20%s','request\x20sent','debug','OpenchannelQueue,\x20%s,\x20%s,\x20%s','stringify','error','message','GetOpenchannelQueue','findAll','options','raw','attributes','include','map','model','catch'];(function(_0x173918,_0x4a6bde){var _0x82ada1=function(_0x6fcd9b){while(--_0x6fcd9b){_0x173918['push'](_0x173918['shift']());}};_0x82ada1(++_0x4a6bde);}(_0x5b1d,0x133));var _0xd5b1=function(_0x5b843a,_0x253f9d){_0x5b843a=_0x5b843a-0x0;var _0x141291=_0x5b1d[_0x5b843a];return _0x141291;};'use strict';var _=require(_0xd5b1('0x0'));var util=require(_0xd5b1('0x1'));var moment=require(_0xd5b1('0x2'));var BPromise=require(_0xd5b1('0x3'));var rs=require(_0xd5b1('0x4'));var fs=require('fs');var Redis=require(_0xd5b1('0x5'));var db=require(_0xd5b1('0x6'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0xd5b1('0x7'));var config=require(_0xd5b1('0x8'));var jayson=require('jayson/promise');var client=jayson[_0xd5b1('0x9')][_0xd5b1('0xa')]({'port':0x232a});config[_0xd5b1('0xb')]=_[_0xd5b1('0xc')](config[_0xd5b1('0xb')],{'host':_0xd5b1('0xd'),'port':0x18eb});var socket=require(_0xd5b1('0xe'))(new Redis(config[_0xd5b1('0xb')]));require(_0xd5b1('0xf'))['register'](socket);function respondWithRpcPromise(_0x25238d,_0x41d75c,_0x38ed6c){return new BPromise(function(_0x5130e3,_0x3e5592){return client[_0xd5b1('0x10')](_0x25238d,_0x38ed6c)[_0xd5b1('0x11')](function(_0x2a4bf0){logger[_0xd5b1('0x12')](_0xd5b1('0x13'),_0x41d75c,_0xd5b1('0x14'));logger[_0xd5b1('0x15')](_0xd5b1('0x16'),_0x41d75c,'request\x20sent',JSON[_0xd5b1('0x17')](_0x2a4bf0));if(_0x2a4bf0[_0xd5b1('0x18')]){if(_0x2a4bf0[_0xd5b1('0x18')]['code']===0x1f4){logger['error']('OpenchannelQueue,\x20%s,\x20%s',_0x41d75c,_0x2a4bf0['error'][_0xd5b1('0x19')]);return _0x3e5592(_0x2a4bf0[_0xd5b1('0x18')][_0xd5b1('0x19')]);}logger[_0xd5b1('0x18')](_0xd5b1('0x13'),_0x41d75c,_0x2a4bf0[_0xd5b1('0x18')][_0xd5b1('0x19')]);return _0x5130e3(_0x2a4bf0[_0xd5b1('0x18')][_0xd5b1('0x19')]);}else{logger[_0xd5b1('0x12')](_0xd5b1('0x13'),_0x41d75c,_0xd5b1('0x14'));_0x5130e3(_0x2a4bf0['result']['message']);}})['catch'](function(_0x196b87){logger[_0xd5b1('0x18')](_0xd5b1('0x13'),_0x41d75c,_0x196b87);_0x3e5592(_0x196b87);});});}exports[_0xd5b1('0x1a')]=function(_0x2dcf69){var _0x36aef9=this;return new Promise(function(_0xad1138,_0x203e3d){return db['OpenchannelQueue'][_0xd5b1('0x1b')]({'raw':_0x2dcf69[_0xd5b1('0x1c')]?_0x2dcf69[_0xd5b1('0x1c')][_0xd5b1('0x1d')]===undefined?!![]:![]:!![],'where':_0x2dcf69[_0xd5b1('0x1c')]?_0x2dcf69['options']['where']||null:null,'attributes':_0x2dcf69[_0xd5b1('0x1c')]?_0x2dcf69[_0xd5b1('0x1c')][_0xd5b1('0x1e')]||null:null,'limit':_0x2dcf69[_0xd5b1('0x1c')]?_0x2dcf69[_0xd5b1('0x1c')]['limit']||null:null,'include':_0x2dcf69['options']?_0x2dcf69['options'][_0xd5b1('0x1f')]?_[_0xd5b1('0x20')](_0x2dcf69[_0xd5b1('0x1c')][_0xd5b1('0x1f')],function(_0x27d5f9){return{'model':db[_0x27d5f9[_0xd5b1('0x21')]],'as':_0x27d5f9['as'],'attributes':_0x27d5f9[_0xd5b1('0x1e')],'include':_0x27d5f9['include']?_[_0xd5b1('0x20')](_0x27d5f9[_0xd5b1('0x1f')],function(_0x465dad){return{'model':db[_0x465dad['model']],'as':_0x465dad['as'],'attributes':_0x465dad[_0xd5b1('0x1e')],'include':_0x465dad[_0xd5b1('0x1f')]?_['map'](_0x465dad[_0xd5b1('0x1f')],function(_0x12caf0){return{'model':db[_0x12caf0[_0xd5b1('0x21')]],'as':_0x12caf0['as'],'attributes':_0x12caf0[_0xd5b1('0x1e')]};}):[]};}):[]};}):[]:[]})[_0xd5b1('0x11')](function(_0x12ac20){logger[_0xd5b1('0x12')](_0xd5b1('0x1a'),_0x2dcf69);logger['debug'](_0xd5b1('0x1a'),_0x2dcf69,JSON[_0xd5b1('0x17')](_0x12ac20));_0xad1138(_0x12ac20);})[_0xd5b1('0x22')](function(_0x42e5e0){logger[_0xd5b1('0x18')]('GetOpenchannelQueue',_0x42e5e0[_0xd5b1('0x19')],_0x2dcf69);_0x203e3d(_0x36aef9[_0xd5b1('0x18')](0x1f4,_0x42e5e0['message']));});});};exports[_0xd5b1('0x23')]=function(_0xb7793e){var _0x1c174a=this;return new Promise(function(_0x1e037d,_0x27c46d){return db[_0xd5b1('0x24')]['find']({'raw':_0xb7793e[_0xd5b1('0x1c')]?_0xb7793e[_0xd5b1('0x1c')][_0xd5b1('0x1d')]===undefined?!![]:![]:!![],'where':_0xb7793e[_0xd5b1('0x1c')]?_0xb7793e[_0xd5b1('0x1c')][_0xd5b1('0x25')]||null:null,'attributes':_0xb7793e[_0xd5b1('0x1c')]?_0xb7793e[_0xd5b1('0x1c')][_0xd5b1('0x1e')]||null:null,'include':_0xb7793e[_0xd5b1('0x1c')]?_0xb7793e[_0xd5b1('0x1c')][_0xd5b1('0x1f')]?_[_0xd5b1('0x20')](_0xb7793e[_0xd5b1('0x1c')][_0xd5b1('0x1f')],function(_0xde6be9){return{'model':db[_0xde6be9[_0xd5b1('0x21')]],'as':_0xde6be9['as'],'attributes':_0xde6be9['attributes'],'include':_0xde6be9[_0xd5b1('0x1f')]?_[_0xd5b1('0x20')](_0xde6be9[_0xd5b1('0x1f')],function(_0xd71359){return{'model':db[_0xd71359[_0xd5b1('0x21')]],'as':_0xd71359['as'],'attributes':_0xd71359[_0xd5b1('0x1e')],'include':_0xd71359['include']?_[_0xd5b1('0x20')](_0xd71359[_0xd5b1('0x1f')],function(_0x4d80fa){return{'model':db[_0x4d80fa['model']],'as':_0x4d80fa['as'],'attributes':_0x4d80fa[_0xd5b1('0x1e')]};}):[]};}):[]};}):[]:[]})[_0xd5b1('0x11')](function(_0x42aa52){logger['info']('ShowOpenchannelQueue',_0xb7793e);logger[_0xd5b1('0x15')](_0xd5b1('0x23'),_0xb7793e,JSON['stringify'](_0x42aa52));_0x1e037d(_0x42aa52);})[_0xd5b1('0x22')](function(_0x855f52){logger['error'](_0xd5b1('0x23'),_0x855f52['message'],_0xb7793e);_0x27c46d(_0x1c174a[_0xd5b1('0x18')](0x1f4,_0x855f52['message']));});});}; \ No newline at end of file diff --git a/server/api/openchannelQueue/openchannelQueue.socket.js b/server/api/openchannelQueue/openchannelQueue.socket.js index 522af6f..ef09615 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 _0x65d4=['removeListener','length','openchannelQueue:','remove','update'];(function(_0x4b369d,_0x265eb8){var _0x571a98=function(_0x56341a){while(--_0x56341a){_0x4b369d['push'](_0x4b369d['shift']());}};_0x571a98(++_0x265eb8);}(_0x65d4,0x8a));var _0x465d=function(_0x9c82d7,_0x350568){_0x9c82d7=_0x9c82d7-0x0;var _0x54ae25=_0x65d4[_0x9c82d7];return _0x54ae25;};'use strict';var OpenchannelQueueEvents=require('./openchannelQueue.events');var events=['save',_0x465d('0x0'),_0x465d('0x1')];function createListener(_0x17788c,_0x40292f){return function(_0x2a125c){_0x40292f['emit'](_0x17788c,_0x2a125c);};}function removeListener(_0x3b7d2a,_0x36da70){return function(){OpenchannelQueueEvents[_0x465d('0x2')](_0x3b7d2a,_0x36da70);};}exports['register']=function(_0xc3907d){for(var _0x1133d6=0x0,_0x5967dd=events[_0x465d('0x3')];_0x1133d6<_0x5967dd;_0x1133d6++){var _0x7e5a19=events[_0x1133d6];var _0xa9e28d=createListener(_0x465d('0x4')+_0x7e5a19,_0xc3907d);OpenchannelQueueEvents['on'](_0x7e5a19,_0xa9e28d);}}; \ No newline at end of file +var _0xdd58=['remove','update','emit','removeListener','register','length','openchannelQueue:','./openchannelQueue.events'];(function(_0x10cf57,_0x1db3dc){var _0x1ab1dd=function(_0x15b881){while(--_0x15b881){_0x10cf57['push'](_0x10cf57['shift']());}};_0x1ab1dd(++_0x1db3dc);}(_0xdd58,0x8f));var _0x8dd5=function(_0x4cbf97,_0x58c02d){_0x4cbf97=_0x4cbf97-0x0;var _0x2ee505=_0xdd58[_0x4cbf97];return _0x2ee505;};'use strict';var OpenchannelQueueEvents=require(_0x8dd5('0x0'));var events=['save',_0x8dd5('0x1'),_0x8dd5('0x2')];function createListener(_0x3d69d4,_0x17e809){return function(_0x1d223f){_0x17e809[_0x8dd5('0x3')](_0x3d69d4,_0x1d223f);};}function removeListener(_0x4e0c80,_0x42a5d2){return function(){OpenchannelQueueEvents[_0x8dd5('0x4')](_0x4e0c80,_0x42a5d2);};}exports[_0x8dd5('0x5')]=function(_0x386f00){for(var _0x571f7c=0x0,_0x39aaf6=events[_0x8dd5('0x6')];_0x571f7c<_0x39aaf6;_0x571f7c++){var _0x238642=events[_0x571f7c];var _0x5e9d9b=createListener(_0x8dd5('0x7')+_0x238642,_0x386f00);OpenchannelQueueEvents['on'](_0x238642,_0x5e9d9b);}}; \ No newline at end of file diff --git a/server/api/openchannelQueueReport/index.js b/server/api/openchannelQueueReport/index.js index 8aef53f..0041282 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 _0x9aca=['Router','fs-extra','../../config/environment','get','index','/describe','isAuthenticated','/:id','put','update','delete','exports','path'];(function(_0x5dacda,_0x1cb632){var _0x362c74=function(_0x5d4769){while(--_0x5d4769){_0x5dacda['push'](_0x5dacda['shift']());}};_0x362c74(++_0x1cb632);}(_0x9aca,0x15e));var _0xa9ac=function(_0x202041,_0x46419d){_0x202041=_0x202041-0x0;var _0x30e996=_0x9aca[_0x202041];return _0x30e996;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0xa9ac('0x0'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0xa9ac('0x1')]();var fs_extra=require(_0xa9ac('0x2'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0xa9ac('0x3'));var controller=require('./openchannelQueueReport.controller');router[_0xa9ac('0x4')]('/',auth['isAuthenticated'](),controller[_0xa9ac('0x5')]);router[_0xa9ac('0x4')](_0xa9ac('0x6'),auth[_0xa9ac('0x7')](),controller['describe']);router[_0xa9ac('0x4')](_0xa9ac('0x8'),auth[_0xa9ac('0x7')](),controller['show']);router['post']('/',auth[_0xa9ac('0x7')](),controller['create']);router[_0xa9ac('0x9')](_0xa9ac('0x8'),auth['isAuthenticated'](),controller[_0xa9ac('0xa')]);router[_0xa9ac('0xb')]('/:id',auth[_0xa9ac('0x7')](),controller['destroy']);module[_0xa9ac('0xc')]=router; \ No newline at end of file +var _0x922f=['./openchannelQueueReport.controller','get','isAuthenticated','index','/describe','/:id','create','exports','multer','util','path','connect-timeout','Router','../../components/auth/service','../../components/interaction/service'];(function(_0x3ab51d,_0x2fa01d){var _0x29a04e=function(_0x7807b0){while(--_0x7807b0){_0x3ab51d['push'](_0x3ab51d['shift']());}};_0x29a04e(++_0x2fa01d);}(_0x922f,0xbc));var _0xf922=function(_0x3db5b7,_0x4199da){_0x3db5b7=_0x3db5b7-0x0;var _0x1b91d9=_0x922f[_0x3db5b7];return _0x1b91d9;};'use strict';var multer=require(_0xf922('0x0'));var util=require(_0xf922('0x1'));var path=require(_0xf922('0x2'));var timeout=require(_0xf922('0x3'));var express=require('express');var router=express[_0xf922('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0xf922('0x5'));var interaction=require(_0xf922('0x6'));var config=require('../../config/environment');var controller=require(_0xf922('0x7'));router[_0xf922('0x8')]('/',auth[_0xf922('0x9')](),controller[_0xf922('0xa')]);router[_0xf922('0x8')](_0xf922('0xb'),auth[_0xf922('0x9')](),controller['describe']);router[_0xf922('0x8')](_0xf922('0xc'),auth[_0xf922('0x9')](),controller['show']);router['post']('/',auth[_0xf922('0x9')](),controller[_0xf922('0xd')]);router['put']('/:id',auth['isAuthenticated'](),controller['update']);router['delete'](_0xf922('0xc'),auth[_0xf922('0x9')](),controller['destroy']);module[_0xf922('0xe')]=router; \ No newline at end of file diff --git a/server/api/openchannelQueueReport/openchannelQueueReport.attributes.js b/server/api/openchannelQueueReport/openchannelQueueReport.attributes.js index a936d03..a1298dd 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 _0x16cc=['sequelize','exports','STRING','DATE'];(function(_0x5dfdb5,_0xef1e0c){var _0x1299d8=function(_0x5248c2){while(--_0x5248c2){_0x5dfdb5['push'](_0x5dfdb5['shift']());}};_0x1299d8(++_0xef1e0c);}(_0x16cc,0x120));var _0xc16c=function(_0x266c78,_0x3a8b1d){_0x266c78=_0x266c78-0x0;var _0x2a86ff=_0x16cc[_0x266c78];return _0x2a86ff;};'use strict';var moment=require('moment');var Sequelize=require(_0xc16c('0x0'));module[_0xc16c('0x1')]={'uniqueid':{'type':Sequelize[_0xc16c('0x2')],'allowNull':![]},'from':{'type':Sequelize[_0xc16c('0x2')]},'joinAt':{'type':Sequelize[_0xc16c('0x3')]},'leaveAt':{'type':Sequelize[_0xc16c('0x3')]},'acceptAt':{'type':Sequelize[_0xc16c('0x3')]},'exitAt':{'type':Sequelize['DATE']},'reason':{'type':Sequelize[_0xc16c('0x2')]}}; \ No newline at end of file +var _0x5d5f=['moment','sequelize','exports','STRING','DATE'];(function(_0x34a873,_0x5501b3){var _0x5890d3=function(_0x391a18){while(--_0x391a18){_0x34a873['push'](_0x34a873['shift']());}};_0x5890d3(++_0x5501b3);}(_0x5d5f,0x1ef));var _0xf5d5=function(_0x488146,_0x4dc597){_0x488146=_0x488146-0x0;var _0x4f42bd=_0x5d5f[_0x488146];return _0x4f42bd;};'use strict';var moment=require(_0xf5d5('0x0'));var Sequelize=require(_0xf5d5('0x1'));module[_0xf5d5('0x2')]={'uniqueid':{'type':Sequelize[_0xf5d5('0x3')],'allowNull':![]},'from':{'type':Sequelize[_0xf5d5('0x3')]},'joinAt':{'type':Sequelize['DATE']},'leaveAt':{'type':Sequelize[_0xf5d5('0x4')]},'acceptAt':{'type':Sequelize['DATE']},'exitAt':{'type':Sequelize[_0xf5d5('0x4')]},'reason':{'type':Sequelize[_0xf5d5('0x3')]}}; \ No newline at end of file diff --git a/server/api/openchannelQueueReport/openchannelQueueReport.controller.js b/server/api/openchannelQueueReport/openchannelQueueReport.controller.js index 2f86fb5..ea78ced 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 _0x21f6=['name','send','index','map','OpenchannelQueueReport','rawAttributes','fieldName','model','query','keys','filters','intersection','fields','attributes','length','hasOwnProperty','order','sort','filter','where','type','VIRTUAL','merge','options','includeAll','include','findAll','rows','show','params','catch','create','body','find','eml-format','zip-dir','fast-json-patch','bluebird','mustache','util','path','sox','to-csv','ejs','lodash','squel','jsforce','papaparse','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','json','offset','limit','undefined','count','set','Content-Range','apply','reject','save','update','then','destroy','end','error','stack'];(function(_0x3951e0,_0x2fa78){var _0x2da38e=function(_0x282f6a){while(--_0x282f6a){_0x3951e0['push'](_0x3951e0['shift']());}};_0x2da38e(++_0x2fa78);}(_0x21f6,0x199));var _0x621f=function(_0x5f01f2,_0x69bb43){_0x5f01f2=_0x5f01f2-0x0;var _0x724c18=_0x21f6[_0x5f01f2];return _0x724c18;};'use strict';var emlformat=require(_0x621f('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x621f('0x1'));var jsonpatch=require(_0x621f('0x2'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0x621f('0x3'));var Mustache=require(_0x621f('0x4'));var util=require(_0x621f('0x5'));var path=require(_0x621f('0x6'));var sox=require(_0x621f('0x7'));var csv=require(_0x621f('0x8'));var ejs=require(_0x621f('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x621f('0xa'));var squel=require(_0x621f('0xb'));var crypto=require('crypto');var jsforce=require(_0x621f('0xc'));var deskjs=require('desk.js');var toCsv=require(_0x621f('0x8'));var querystring=require('querystring');var Papa=require(_0x621f('0xd'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0x621f('0xe'));var as=require(_0x621f('0xf'));var hardwareService=require(_0x621f('0x10'));var logger=require(_0x621f('0x11'))(_0x621f('0x12'));var utils=require(_0x621f('0x13'));var config=require(_0x621f('0x14'));var licenseUtil=require(_0x621f('0x15'));var db=require(_0x621f('0x16'))['db'];function respondWithStatusCode(_0x152b25,_0x4f7fa0){_0x4f7fa0=_0x4f7fa0||0xcc;return function(_0x35e3f6){if(_0x35e3f6){return _0x152b25[_0x621f('0x17')](_0x4f7fa0);}return _0x152b25[_0x621f('0x18')](_0x4f7fa0)['end']();};}function respondWithResult(_0x507887,_0x3d739e){_0x3d739e=_0x3d739e||0xc8;return function(_0x2265db){if(_0x2265db){return _0x507887[_0x621f('0x18')](_0x3d739e)[_0x621f('0x19')](_0x2265db);}};}function respondWithFilteredResult(_0x54b1a9,_0xae9f7c){return function(_0x4fde94){if(_0x4fde94){var _0x71a30b=typeof _0xae9f7c[_0x621f('0x1a')]==='undefined'&&typeof _0xae9f7c[_0x621f('0x1b')]===_0x621f('0x1c');var _0x1237e6=_0x4fde94[_0x621f('0x1d')];var _0x54a255=_0x71a30b?0x0:_0xae9f7c[_0x621f('0x1a')];var _0x3d1b2e=_0x71a30b?_0x4fde94[_0x621f('0x1d')]:_0xae9f7c[_0x621f('0x1a')]+_0xae9f7c[_0x621f('0x1b')];var _0x210be9;if(_0x3d1b2e>=_0x1237e6){_0x3d1b2e=_0x1237e6;_0x210be9=0xc8;}else{_0x210be9=0xce;}_0x54b1a9['status'](_0x210be9);return _0x54b1a9[_0x621f('0x1e')](_0x621f('0x1f'),_0x54a255+'-'+_0x3d1b2e+'/'+_0x1237e6)[_0x621f('0x19')](_0x4fde94);}return null;};}function patchUpdates(_0x9734ed){return function(_0x4f0fbf){try{jsonpatch[_0x621f('0x20')](_0x4f0fbf,_0x9734ed,!![]);}catch(_0x32ad2b){return BPromise[_0x621f('0x21')](_0x32ad2b);}return _0x4f0fbf[_0x621f('0x22')]();};}function saveUpdates(_0x5c703a,_0x287f4d){return function(_0x428073){if(_0x428073){return _0x428073[_0x621f('0x23')](_0x5c703a)[_0x621f('0x24')](function(_0x2e52da){return _0x2e52da;});}return null;};}function removeEntity(_0x23a956,_0x166b8b){return function(_0x8ebce4){if(_0x8ebce4){return _0x8ebce4[_0x621f('0x25')]()['then'](function(){_0x23a956[_0x621f('0x18')](0xcc)[_0x621f('0x26')]();});}};}function handleEntityNotFound(_0x464dcc,_0x4d5409){return function(_0x53c54f){if(!_0x53c54f){_0x464dcc[_0x621f('0x17')](0x194);}return _0x53c54f;};}function handleError(_0x3f839f,_0x18c12d){_0x18c12d=_0x18c12d||0x1f4;return function(_0x3e95f8){logger[_0x621f('0x27')](_0x3e95f8[_0x621f('0x28')]);if(_0x3e95f8[_0x621f('0x29')]){delete _0x3e95f8['name'];}_0x3f839f[_0x621f('0x18')](_0x18c12d)[_0x621f('0x2a')](_0x3e95f8);};}exports[_0x621f('0x2b')]=function(_0x3283ca,_0x2e24f4){var _0x309479={},_0x277040={},_0x541b8b={'count':0x0,'rows':[]};var _0x4a8aa4=_[_0x621f('0x2c')](db[_0x621f('0x2d')][_0x621f('0x2e')],function(_0xfe02a0){return{'name':_0xfe02a0[_0x621f('0x2f')],'type':_0xfe02a0['type']['key']};});_0x277040[_0x621f('0x30')]=_[_0x621f('0x2c')](_0x4a8aa4,_0x621f('0x29'));_0x277040[_0x621f('0x31')]=_[_0x621f('0x32')](_0x3283ca[_0x621f('0x31')]);_0x277040[_0x621f('0x33')]=_['intersection'](_0x277040[_0x621f('0x30')],_0x277040['query']);_0x309479['attributes']=_[_0x621f('0x34')](_0x277040[_0x621f('0x30')],qs[_0x621f('0x35')](_0x3283ca[_0x621f('0x31')][_0x621f('0x35')]));_0x309479[_0x621f('0x36')]=_0x309479[_0x621f('0x36')][_0x621f('0x37')]?_0x309479[_0x621f('0x36')]:_0x277040['model'];if(!_0x3283ca['query'][_0x621f('0x38')]('nolimit')){_0x309479['limit']=qs[_0x621f('0x1b')](_0x3283ca[_0x621f('0x31')]['limit']);_0x309479[_0x621f('0x1a')]=qs[_0x621f('0x1a')](_0x3283ca[_0x621f('0x31')]['offset']);}_0x309479[_0x621f('0x39')]=qs[_0x621f('0x3a')](_0x3283ca[_0x621f('0x31')][_0x621f('0x3a')]);_0x309479['where']=qs[_0x621f('0x33')](_['pick'](_0x3283ca[_0x621f('0x31')],_0x277040[_0x621f('0x33')]),_0x4a8aa4);if(_0x3283ca[_0x621f('0x31')][_0x621f('0x3b')]){_0x309479[_0x621f('0x3c')]=_['merge'](_0x309479[_0x621f('0x3c')],{'$or':_['map'](_0x4a8aa4,function(_0x1ad4ed){if(_0x1ad4ed[_0x621f('0x3d')]!==_0x621f('0x3e')){var _0x1aca89={};_0x1aca89[_0x1ad4ed[_0x621f('0x29')]]={'$like':'%'+_0x3283ca[_0x621f('0x31')][_0x621f('0x3b')]+'%'};return _0x1aca89;}})});}_0x309479=_[_0x621f('0x3f')]({},_0x309479,_0x3283ca[_0x621f('0x40')]);var _0x1600f9={'where':_0x309479[_0x621f('0x3c')]};return db[_0x621f('0x2d')][_0x621f('0x1d')](_0x1600f9)[_0x621f('0x24')](function(_0x391d9d){_0x541b8b[_0x621f('0x1d')]=_0x391d9d;if(_0x3283ca['query'][_0x621f('0x41')]){_0x309479[_0x621f('0x42')]=[{'all':!![]}];}return db[_0x621f('0x2d')][_0x621f('0x43')](_0x309479);})[_0x621f('0x24')](function(_0x1e8387){_0x541b8b[_0x621f('0x44')]=_0x1e8387;return _0x541b8b;})[_0x621f('0x24')](respondWithFilteredResult(_0x2e24f4,_0x309479))['catch'](handleError(_0x2e24f4,null));};exports[_0x621f('0x45')]=function(_0x23185a,_0x5928bc){var _0x31ca8e={'raw':!![],'where':{'id':_0x23185a[_0x621f('0x46')]['id']}},_0x46e683={};_0x46e683[_0x621f('0x30')]=_[_0x621f('0x32')](db[_0x621f('0x2d')][_0x621f('0x2e')]);_0x46e683[_0x621f('0x31')]=_[_0x621f('0x32')](_0x23185a['query']);_0x46e683[_0x621f('0x33')]=_[_0x621f('0x34')](_0x46e683[_0x621f('0x30')],_0x46e683[_0x621f('0x31')]);_0x31ca8e[_0x621f('0x36')]=_[_0x621f('0x34')](_0x46e683[_0x621f('0x30')],qs[_0x621f('0x35')](_0x23185a['query']['fields']));_0x31ca8e[_0x621f('0x36')]=_0x31ca8e[_0x621f('0x36')]['length']?_0x31ca8e[_0x621f('0x36')]:_0x46e683[_0x621f('0x30')];if(_0x23185a[_0x621f('0x31')]['includeAll']){_0x31ca8e[_0x621f('0x42')]=[{'all':!![]}];}_0x31ca8e=_[_0x621f('0x3f')]({},_0x31ca8e,_0x23185a[_0x621f('0x40')]);return db[_0x621f('0x2d')]['find'](_0x31ca8e)[_0x621f('0x24')](handleEntityNotFound(_0x5928bc,null))[_0x621f('0x24')](respondWithResult(_0x5928bc,null))[_0x621f('0x47')](handleError(_0x5928bc,null));};exports[_0x621f('0x48')]=function(_0x157cfd,_0x262e4f){return db[_0x621f('0x2d')][_0x621f('0x48')](_0x157cfd[_0x621f('0x49')],{})[_0x621f('0x24')](respondWithResult(_0x262e4f,0xc9))[_0x621f('0x47')](handleError(_0x262e4f,null));};exports[_0x621f('0x23')]=function(_0x2b0b46,_0x454f8e){if(_0x2b0b46[_0x621f('0x49')]['id']){delete _0x2b0b46[_0x621f('0x49')]['id'];}return db[_0x621f('0x2d')][_0x621f('0x4a')]({'where':{'id':_0x2b0b46[_0x621f('0x46')]['id']}})[_0x621f('0x24')](handleEntityNotFound(_0x454f8e,null))[_0x621f('0x24')](saveUpdates(_0x2b0b46[_0x621f('0x49')],null))[_0x621f('0x24')](respondWithResult(_0x454f8e,null))[_0x621f('0x47')](handleError(_0x454f8e,null));};exports[_0x621f('0x25')]=function(_0x57152e,_0x1b9140){return db[_0x621f('0x2d')][_0x621f('0x4a')]({'where':{'id':_0x57152e[_0x621f('0x46')]['id']}})[_0x621f('0x24')](handleEntityNotFound(_0x1b9140,null))[_0x621f('0x24')](removeEntity(_0x1b9140,null))[_0x621f('0x47')](handleError(_0x1b9140,null));};exports['describe']=function(_0x47ad0a,_0x5f36ba){return db[_0x621f('0x2d')]['describe']()[_0x621f('0x24')](respondWithResult(_0x5f36ba,null))[_0x621f('0x47')](handleError(_0x5f36ba,null));}; \ No newline at end of file +var _0x36e2=['../../components/auth/service','../../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','error','stack','name','send','index','map','OpenchannelQueueReport','rawAttributes','fieldName','type','key','model','query','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','pick','filter','where','merge','VIRTUAL','includeAll','findAll','rows','catch','show','params','keys','include','options','find','body','describe','eml-format','rimraf','zip-dir','fast-json-patch','moment','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','jsforce','desk.js','querystring','papaparse'];(function(_0x525dda,_0x42210e){var _0x2e7397=function(_0x52e1f1){while(--_0x52e1f1){_0x525dda['push'](_0x525dda['shift']());}};_0x2e7397(++_0x42210e);}(_0x36e2,0x16a));var _0x236e=function(_0x12348a,_0x5e6818){_0x12348a=_0x12348a-0x0;var _0xb0c5e6=_0x36e2[_0x12348a];return _0xb0c5e6;};'use strict';var emlformat=require(_0x236e('0x0'));var rimraf=require(_0x236e('0x1'));var zipdir=require(_0x236e('0x2'));var jsonpatch=require(_0x236e('0x3'));var rp=require('request-promise');var moment=require(_0x236e('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x236e('0x5'));var util=require(_0x236e('0x6'));var path=require(_0x236e('0x7'));var sox=require(_0x236e('0x8'));var csv=require(_0x236e('0x9'));var ejs=require(_0x236e('0xa'));var fs=require('fs');var fs_extra=require(_0x236e('0xb'));var _=require(_0x236e('0xc'));var squel=require(_0x236e('0xd'));var crypto=require('crypto');var jsforce=require(_0x236e('0xe'));var deskjs=require(_0x236e('0xf'));var toCsv=require(_0x236e('0x9'));var querystring=require(_0x236e('0x10'));var Papa=require(_0x236e('0x11'));var Redis=require('ioredis');var authService=require(_0x236e('0x12'));var qs=require(_0x236e('0x13'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x236e('0x14'));var logger=require(_0x236e('0x15'))(_0x236e('0x16'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0x236e('0x17'))['db'];function respondWithStatusCode(_0xa43988,_0x55e2e4){_0x55e2e4=_0x55e2e4||0xcc;return function(_0x4e861d){if(_0x4e861d){return _0xa43988['sendStatus'](_0x55e2e4);}return _0xa43988[_0x236e('0x18')](_0x55e2e4)[_0x236e('0x19')]();};}function respondWithResult(_0x253f21,_0x595c1c){_0x595c1c=_0x595c1c||0xc8;return function(_0x2910be){if(_0x2910be){return _0x253f21[_0x236e('0x18')](_0x595c1c)[_0x236e('0x1a')](_0x2910be);}};}function respondWithFilteredResult(_0x264047,_0x18fbfb){return function(_0x5d4424){if(_0x5d4424){var _0x2fa39f=typeof _0x18fbfb[_0x236e('0x1b')]===_0x236e('0x1c')&&typeof _0x18fbfb[_0x236e('0x1d')]===_0x236e('0x1c');var _0x246c48=_0x5d4424['count'];var _0x31065a=_0x2fa39f?0x0:_0x18fbfb['offset'];var _0x2c0fd2=_0x2fa39f?_0x5d4424[_0x236e('0x1e')]:_0x18fbfb['offset']+_0x18fbfb[_0x236e('0x1d')];var _0x15d5dd;if(_0x2c0fd2>=_0x246c48){_0x2c0fd2=_0x246c48;_0x15d5dd=0xc8;}else{_0x15d5dd=0xce;}_0x264047[_0x236e('0x18')](_0x15d5dd);return _0x264047['set'](_0x236e('0x1f'),_0x31065a+'-'+_0x2c0fd2+'/'+_0x246c48)['json'](_0x5d4424);}return null;};}function patchUpdates(_0x20b92c){return function(_0x50abdb){try{jsonpatch[_0x236e('0x20')](_0x50abdb,_0x20b92c,!![]);}catch(_0x2a4f15){return BPromise[_0x236e('0x21')](_0x2a4f15);}return _0x50abdb[_0x236e('0x22')]();};}function saveUpdates(_0x1f5200,_0x140653){return function(_0x4c5742){if(_0x4c5742){return _0x4c5742[_0x236e('0x23')](_0x1f5200)[_0x236e('0x24')](function(_0x1b3989){return _0x1b3989;});}return null;};}function removeEntity(_0x383506,_0x35469a){return function(_0x2c16b7){if(_0x2c16b7){return _0x2c16b7[_0x236e('0x25')]()[_0x236e('0x24')](function(){_0x383506['status'](0xcc)[_0x236e('0x19')]();});}};}function handleEntityNotFound(_0x599361,_0x29e3a5){return function(_0x2c1c64){if(!_0x2c1c64){_0x599361['sendStatus'](0x194);}return _0x2c1c64;};}function handleError(_0x1f03f5,_0x17568e){_0x17568e=_0x17568e||0x1f4;return function(_0x5e5932){logger[_0x236e('0x26')](_0x5e5932[_0x236e('0x27')]);if(_0x5e5932[_0x236e('0x28')]){delete _0x5e5932[_0x236e('0x28')];}_0x1f03f5['status'](_0x17568e)[_0x236e('0x29')](_0x5e5932);};}exports[_0x236e('0x2a')]=function(_0x5b1d74,_0x43749a){var _0x1fa5ac={},_0x12b211={},_0x5dd030={'count':0x0,'rows':[]};var _0x4afe4d=_[_0x236e('0x2b')](db[_0x236e('0x2c')][_0x236e('0x2d')],function(_0x367f2b){return{'name':_0x367f2b[_0x236e('0x2e')],'type':_0x367f2b[_0x236e('0x2f')][_0x236e('0x30')]};});_0x12b211[_0x236e('0x31')]=_['map'](_0x4afe4d,_0x236e('0x28'));_0x12b211[_0x236e('0x32')]=_['keys'](_0x5b1d74[_0x236e('0x32')]);_0x12b211[_0x236e('0x33')]=_[_0x236e('0x34')](_0x12b211[_0x236e('0x31')],_0x12b211[_0x236e('0x32')]);_0x1fa5ac['attributes']=_[_0x236e('0x34')](_0x12b211[_0x236e('0x31')],qs[_0x236e('0x35')](_0x5b1d74['query']['fields']));_0x1fa5ac['attributes']=_0x1fa5ac[_0x236e('0x36')][_0x236e('0x37')]?_0x1fa5ac['attributes']:_0x12b211[_0x236e('0x31')];if(!_0x5b1d74[_0x236e('0x32')][_0x236e('0x38')](_0x236e('0x39'))){_0x1fa5ac['limit']=qs['limit'](_0x5b1d74[_0x236e('0x32')][_0x236e('0x1d')]);_0x1fa5ac[_0x236e('0x1b')]=qs['offset'](_0x5b1d74[_0x236e('0x32')][_0x236e('0x1b')]);}_0x1fa5ac[_0x236e('0x3a')]=qs['sort'](_0x5b1d74['query']['sort']);_0x1fa5ac['where']=qs[_0x236e('0x33')](_[_0x236e('0x3b')](_0x5b1d74[_0x236e('0x32')],_0x12b211[_0x236e('0x33')]),_0x4afe4d);if(_0x5b1d74[_0x236e('0x32')][_0x236e('0x3c')]){_0x1fa5ac[_0x236e('0x3d')]=_[_0x236e('0x3e')](_0x1fa5ac['where'],{'$or':_[_0x236e('0x2b')](_0x4afe4d,function(_0x3d7f53){if(_0x3d7f53[_0x236e('0x2f')]!==_0x236e('0x3f')){var _0x3b4930={};_0x3b4930[_0x3d7f53[_0x236e('0x28')]]={'$like':'%'+_0x5b1d74[_0x236e('0x32')][_0x236e('0x3c')]+'%'};return _0x3b4930;}})});}_0x1fa5ac=_[_0x236e('0x3e')]({},_0x1fa5ac,_0x5b1d74['options']);var _0x5e7b84={'where':_0x1fa5ac[_0x236e('0x3d')]};return db[_0x236e('0x2c')][_0x236e('0x1e')](_0x5e7b84)[_0x236e('0x24')](function(_0x395cdd){_0x5dd030['count']=_0x395cdd;if(_0x5b1d74['query'][_0x236e('0x40')]){_0x1fa5ac['include']=[{'all':!![]}];}return db[_0x236e('0x2c')][_0x236e('0x41')](_0x1fa5ac);})[_0x236e('0x24')](function(_0x213a31){_0x5dd030[_0x236e('0x42')]=_0x213a31;return _0x5dd030;})[_0x236e('0x24')](respondWithFilteredResult(_0x43749a,_0x1fa5ac))[_0x236e('0x43')](handleError(_0x43749a,null));};exports[_0x236e('0x44')]=function(_0x528467,_0x176d9f){var _0x53108d={'raw':!![],'where':{'id':_0x528467[_0x236e('0x45')]['id']}},_0x140f2c={};_0x140f2c[_0x236e('0x31')]=_['keys'](db[_0x236e('0x2c')][_0x236e('0x2d')]);_0x140f2c[_0x236e('0x32')]=_[_0x236e('0x46')](_0x528467[_0x236e('0x32')]);_0x140f2c[_0x236e('0x33')]=_[_0x236e('0x34')](_0x140f2c[_0x236e('0x31')],_0x140f2c[_0x236e('0x32')]);_0x53108d['attributes']=_['intersection'](_0x140f2c[_0x236e('0x31')],qs[_0x236e('0x35')](_0x528467[_0x236e('0x32')][_0x236e('0x35')]));_0x53108d[_0x236e('0x36')]=_0x53108d[_0x236e('0x36')][_0x236e('0x37')]?_0x53108d[_0x236e('0x36')]:_0x140f2c[_0x236e('0x31')];if(_0x528467[_0x236e('0x32')][_0x236e('0x40')]){_0x53108d[_0x236e('0x47')]=[{'all':!![]}];}_0x53108d=_[_0x236e('0x3e')]({},_0x53108d,_0x528467[_0x236e('0x48')]);return db[_0x236e('0x2c')][_0x236e('0x49')](_0x53108d)[_0x236e('0x24')](handleEntityNotFound(_0x176d9f,null))[_0x236e('0x24')](respondWithResult(_0x176d9f,null))['catch'](handleError(_0x176d9f,null));};exports['create']=function(_0xdac33e,_0x3880db){return db['OpenchannelQueueReport']['create'](_0xdac33e['body'],{})[_0x236e('0x24')](respondWithResult(_0x3880db,0xc9))['catch'](handleError(_0x3880db,null));};exports[_0x236e('0x23')]=function(_0x26b016,_0x5c9564){if(_0x26b016[_0x236e('0x4a')]['id']){delete _0x26b016['body']['id'];}return db['OpenchannelQueueReport'][_0x236e('0x49')]({'where':{'id':_0x26b016[_0x236e('0x45')]['id']}})[_0x236e('0x24')](handleEntityNotFound(_0x5c9564,null))[_0x236e('0x24')](saveUpdates(_0x26b016[_0x236e('0x4a')],null))['then'](respondWithResult(_0x5c9564,null))['catch'](handleError(_0x5c9564,null));};exports[_0x236e('0x25')]=function(_0x1efa2d,_0x56be45){return db[_0x236e('0x2c')]['find']({'where':{'id':_0x1efa2d['params']['id']}})['then'](handleEntityNotFound(_0x56be45,null))[_0x236e('0x24')](removeEntity(_0x56be45,null))[_0x236e('0x43')](handleError(_0x56be45,null));};exports[_0x236e('0x4b')]=function(_0x5205d0,_0x3755c0){return db[_0x236e('0x2c')]['describe']()[_0x236e('0x24')](respondWithResult(_0x3755c0,null))[_0x236e('0x43')](handleError(_0x3755c0,null));}; \ No newline at end of file diff --git a/server/api/openchannelQueueReport/openchannelQueueReport.model.js b/server/api/openchannelQueueReport/openchannelQueueReport.model.js index 351a47b..28b15b3 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 _0xe14b=['bluebird','path','./openchannelQueueReport.attributes','exports','define','OpenchannelQueueReport','report_openchannel_queue','lodash','util','moment'];(function(_0x360735,_0x19bd01){var _0x271b6f=function(_0x2dc59d){while(--_0x2dc59d){_0x360735['push'](_0x360735['shift']());}};_0x271b6f(++_0x19bd01);}(_0xe14b,0x93));var _0xbe14=function(_0x14afaf,_0x1ae7d8){_0x14afaf=_0x14afaf-0x0;var _0x321165=_0xe14b[_0x14afaf];return _0x321165;};'use strict';var _=require(_0xbe14('0x0'));var util=require(_0xbe14('0x1'));var logger=require('../../config/logger')('api');var moment=require(_0xbe14('0x2'));var BPromise=require(_0xbe14('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xbe14('0x4'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0xbe14('0x5'));module[_0xbe14('0x6')]=function(_0x1fe204,_0x1ff100){return _0x1fe204[_0xbe14('0x7')](_0xbe14('0x8'),attributes,{'tableName':_0xbe14('0x9'),'paranoid':![],'indexes':[{'name':'uniqueid','fields':['uniqueid']}],'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(_0x29e4ce,_0x3f294c){var _0x266d40=function(_0x32bdc7){while(--_0x32bdc7){_0x29e4ce['push'](_0x29e4ce['shift']());}};_0x266d40(++_0x3f294c);}(_0xc4aa,0x1b7));var _0xac4a=function(_0x4b369d,_0x265eb8){_0x4b369d=_0x4b369d-0x0;var _0x571a98=_0xc4aa[_0x4b369d];return _0x571a98;};'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 4e6841f..140d4f9 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 _0x49f8=['client','http','info','OpenchannelQueueReport,\x20%s,\x20%s','request\x20sent','debug','OpenchannelQueueReport,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','CreateOpenchannelQueueReport','OpenchannelQueueReport','body','options','then','stringify','update','raw','where','limit','UpdateOpenchannelQueueReport','lodash','bluebird','randomstring','../../mysqldb','../../config/logger','../../config/environment'];(function(_0x2c347a,_0x320ac4){var _0x1520f8=function(_0x5779be){while(--_0x5779be){_0x2c347a['push'](_0x2c347a['shift']());}};_0x1520f8(++_0x320ac4);}(_0x49f8,0xff));var _0x849f=function(_0x17ee38,_0x5bdff4){_0x17ee38=_0x17ee38-0x0;var _0x439a4e=_0x49f8[_0x17ee38];return _0x439a4e;};'use strict';var _=require(_0x849f('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0x849f('0x1'));var rs=require(_0x849f('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x849f('0x3'))['db'];var utils=require('../../config/utils');var logger=require(_0x849f('0x4'))('rpc');var config=require(_0x849f('0x5'));var jayson=require('jayson/promise');var client=jayson[_0x849f('0x6')][_0x849f('0x7')]({'port':0x232a});function respondWithRpcPromise(_0x21f577,_0xb4c798,_0x33b630){return new BPromise(function(_0xc6443e,_0x565438){return client['request'](_0x21f577,_0x33b630)['then'](function(_0x306c11){logger[_0x849f('0x8')](_0x849f('0x9'),_0xb4c798,_0x849f('0xa'));logger[_0x849f('0xb')](_0x849f('0xc'),_0xb4c798,_0x849f('0xa'),JSON['stringify'](_0x306c11));if(_0x306c11[_0x849f('0xd')]){if(_0x306c11['error'][_0x849f('0xe')]===0x1f4){logger[_0x849f('0xd')](_0x849f('0x9'),_0xb4c798,_0x306c11[_0x849f('0xd')]['message']);return _0x565438(_0x306c11[_0x849f('0xd')][_0x849f('0xf')]);}logger[_0x849f('0xd')](_0x849f('0x9'),_0xb4c798,_0x306c11[_0x849f('0xd')]['message']);return _0xc6443e(_0x306c11['error'][_0x849f('0xf')]);}else{logger['info'](_0x849f('0x9'),_0xb4c798,_0x849f('0xa'));_0xc6443e(_0x306c11[_0x849f('0x10')][_0x849f('0xf')]);}})[_0x849f('0x11')](function(_0x19ba28){logger[_0x849f('0xd')]('OpenchannelQueueReport,\x20%s,\x20%s',_0xb4c798,_0x19ba28);_0x565438(_0x19ba28);});});}exports[_0x849f('0x12')]=function(_0x20bea7){var _0x189529=this;return new Promise(function(_0x541cd6,_0x1e4017){return db[_0x849f('0x13')]['create'](_0x20bea7[_0x849f('0x14')],{'raw':_0x20bea7[_0x849f('0x15')]?_0x20bea7['options']['raw']===undefined?!![]:![]:!![]})[_0x849f('0x16')](function(_0x11d183){logger[_0x849f('0x8')](_0x849f('0x12'),_0x20bea7);logger[_0x849f('0xb')](_0x849f('0x12'),_0x20bea7,JSON[_0x849f('0x17')](_0x11d183));_0x541cd6(_0x11d183);})[_0x849f('0x11')](function(_0x4b29f1){logger[_0x849f('0xd')](_0x849f('0x12'),_0x4b29f1[_0x849f('0xf')],_0x20bea7);_0x1e4017(_0x189529[_0x849f('0xd')](0x1f4,_0x4b29f1[_0x849f('0xf')]));});});};exports['UpdateOpenchannelQueueReport']=function(_0x3a5724){var _0x32be69=this;return new Promise(function(_0x15a41c,_0xe404c6){return db[_0x849f('0x13')][_0x849f('0x18')](_0x3a5724[_0x849f('0x14')],{'raw':_0x3a5724[_0x849f('0x15')]?_0x3a5724[_0x849f('0x15')][_0x849f('0x19')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x3a5724[_0x849f('0x15')]?_0x3a5724[_0x849f('0x15')][_0x849f('0x1a')]||null:null,'attributes':_0x3a5724['options']?_0x3a5724[_0x849f('0x15')]['attributes']||null:null,'limit':_0x3a5724[_0x849f('0x15')]?_0x3a5724[_0x849f('0x15')][_0x849f('0x1b')]||null:null})[_0x849f('0x16')](function(_0xf0e21f){logger[_0x849f('0x8')]('UpdateOpenchannelQueueReport',_0x3a5724);logger[_0x849f('0xb')](_0x849f('0x1c'),_0x3a5724,JSON[_0x849f('0x17')](_0xf0e21f));_0x15a41c(_0xf0e21f);})['catch'](function(_0x347c93){logger['error'](_0x849f('0x1c'),_0x347c93[_0x849f('0xf')],_0x3a5724);_0xe404c6(_0x32be69[_0x849f('0xd')](0x1f4,_0x347c93[_0x849f('0xf')]));});});}; \ No newline at end of file +var _0x4b0f=['rpc','../../config/environment','jayson/promise','client','http','request','then','info','OpenchannelQueueReport,\x20%s,\x20%s','request\x20sent','debug','OpenchannelQueueReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','CreateOpenchannelQueueReport','OpenchannelQueueReport','create','options','raw','UpdateOpenchannelQueueReport','body','attributes','limit','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger'];(function(_0x13ffab,_0x449a1c){var _0x11cfda=function(_0x2cd296){while(--_0x2cd296){_0x13ffab['push'](_0x13ffab['shift']());}};_0x11cfda(++_0x449a1c);}(_0x4b0f,0xa3));var _0xf4b0=function(_0x1b2b6a,_0x1ca7c7){_0x1b2b6a=_0x1b2b6a-0x0;var _0x122ea7=_0x4b0f[_0x1b2b6a];return _0x122ea7;};'use strict';var _=require('lodash');var util=require(_0xf4b0('0x0'));var moment=require(_0xf4b0('0x1'));var BPromise=require(_0xf4b0('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xf4b0('0x3'));var db=require(_0xf4b0('0x4'))['db'];var utils=require(_0xf4b0('0x5'));var logger=require(_0xf4b0('0x6'))(_0xf4b0('0x7'));var config=require(_0xf4b0('0x8'));var jayson=require(_0xf4b0('0x9'));var client=jayson[_0xf4b0('0xa')][_0xf4b0('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x373042,_0x300b64,_0x35160f){return new BPromise(function(_0x3a2236,_0xd132d8){return client[_0xf4b0('0xc')](_0x373042,_0x35160f)[_0xf4b0('0xd')](function(_0x4906e9){logger[_0xf4b0('0xe')](_0xf4b0('0xf'),_0x300b64,_0xf4b0('0x10'));logger[_0xf4b0('0x11')](_0xf4b0('0x12'),_0x300b64,_0xf4b0('0x10'),JSON[_0xf4b0('0x13')](_0x4906e9));if(_0x4906e9[_0xf4b0('0x14')]){if(_0x4906e9[_0xf4b0('0x14')][_0xf4b0('0x15')]===0x1f4){logger[_0xf4b0('0x14')](_0xf4b0('0xf'),_0x300b64,_0x4906e9[_0xf4b0('0x14')][_0xf4b0('0x16')]);return _0xd132d8(_0x4906e9[_0xf4b0('0x14')][_0xf4b0('0x16')]);}logger[_0xf4b0('0x14')](_0xf4b0('0xf'),_0x300b64,_0x4906e9[_0xf4b0('0x14')][_0xf4b0('0x16')]);return _0x3a2236(_0x4906e9[_0xf4b0('0x14')][_0xf4b0('0x16')]);}else{logger['info'](_0xf4b0('0xf'),_0x300b64,_0xf4b0('0x10'));_0x3a2236(_0x4906e9[_0xf4b0('0x17')]['message']);}})[_0xf4b0('0x18')](function(_0x1f2d74){logger[_0xf4b0('0x14')]('OpenchannelQueueReport,\x20%s,\x20%s',_0x300b64,_0x1f2d74);_0xd132d8(_0x1f2d74);});});}exports[_0xf4b0('0x19')]=function(_0x390dbd){var _0x3e8ade=this;return new Promise(function(_0x543c88,_0x4cffc2){return db[_0xf4b0('0x1a')][_0xf4b0('0x1b')](_0x390dbd['body'],{'raw':_0x390dbd['options']?_0x390dbd[_0xf4b0('0x1c')][_0xf4b0('0x1d')]===undefined?!![]:![]:!![]})[_0xf4b0('0xd')](function(_0x4e65cd){logger[_0xf4b0('0xe')](_0xf4b0('0x19'),_0x390dbd);logger[_0xf4b0('0x11')](_0xf4b0('0x19'),_0x390dbd,JSON[_0xf4b0('0x13')](_0x4e65cd));_0x543c88(_0x4e65cd);})[_0xf4b0('0x18')](function(_0x221b1d){logger['error'](_0xf4b0('0x19'),_0x221b1d[_0xf4b0('0x16')],_0x390dbd);_0x4cffc2(_0x3e8ade[_0xf4b0('0x14')](0x1f4,_0x221b1d[_0xf4b0('0x16')]));});});};exports[_0xf4b0('0x1e')]=function(_0x338975){var _0x28ecb0=this;return new Promise(function(_0x3d054e,_0x4a0da1){return db[_0xf4b0('0x1a')]['update'](_0x338975[_0xf4b0('0x1f')],{'raw':_0x338975[_0xf4b0('0x1c')]?_0x338975[_0xf4b0('0x1c')][_0xf4b0('0x1d')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x338975[_0xf4b0('0x1c')]?_0x338975[_0xf4b0('0x1c')]['where']||null:null,'attributes':_0x338975[_0xf4b0('0x1c')]?_0x338975[_0xf4b0('0x1c')][_0xf4b0('0x20')]||null:null,'limit':_0x338975['options']?_0x338975[_0xf4b0('0x1c')][_0xf4b0('0x21')]||null:null})[_0xf4b0('0xd')](function(_0x55bdc8){logger[_0xf4b0('0xe')](_0xf4b0('0x1e'),_0x338975);logger[_0xf4b0('0x11')](_0xf4b0('0x1e'),_0x338975,JSON[_0xf4b0('0x13')](_0x55bdc8));_0x3d054e(_0x55bdc8);})[_0xf4b0('0x18')](function(_0xd94c81){logger[_0xf4b0('0x14')]('UpdateOpenchannelQueueReport',_0xd94c81[_0xf4b0('0x16')],_0x338975);_0x4a0da1(_0x28ecb0[_0xf4b0('0x14')](0x1f4,_0xd94c81[_0xf4b0('0x16')]));});});}; \ No newline at end of file diff --git a/server/api/openchannelTransferReport/index.js b/server/api/openchannelTransferReport/index.js index feba363..3ed3665 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 _0x230f=['get','/:id','create','delete','exports','multer','util','path','connect-timeout','express','../../components/auth/service','../../components/interaction/service','./openchannelTransferReport.controller','isAuthenticated','describe'];(function(_0xcee512,_0x687e2b){var _0x222da6=function(_0x65ce4d){while(--_0x65ce4d){_0xcee512['push'](_0xcee512['shift']());}};_0x222da6(++_0x687e2b);}(_0x230f,0x1a9));var _0xf230=function(_0x2f89c0,_0x455702){_0x2f89c0=_0x2f89c0-0x0;var _0x164223=_0x230f[_0x2f89c0];return _0x164223;};'use strict';var multer=require(_0xf230('0x0'));var util=require(_0xf230('0x1'));var path=require(_0xf230('0x2'));var timeout=require(_0xf230('0x3'));var express=require(_0xf230('0x4'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0xf230('0x5'));var interaction=require(_0xf230('0x6'));var config=require('../../config/environment');var controller=require(_0xf230('0x7'));router['get']('/',auth[_0xf230('0x8')](),controller['index']);router['get']('/describe',auth['isAuthenticated'](),controller[_0xf230('0x9')]);router[_0xf230('0xa')](_0xf230('0xb'),auth['isAuthenticated'](),controller['show']);router['post']('/',auth['isAuthenticated'](),controller[_0xf230('0xc')]);router['put']('/:id',auth[_0xf230('0x8')](),controller['update']);router[_0xf230('0xd')](_0xf230('0xb'),auth[_0xf230('0x8')](),controller['destroy']);module[_0xf230('0xe')]=router; \ No newline at end of file +var _0xd14c=['path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./openchannelTransferReport.controller','get','isAuthenticated','/describe','/:id','show','create','put','update','destroy','exports','multer','util'];(function(_0x30e30f,_0x360be5){var _0xb30f49=function(_0x282d57){while(--_0x282d57){_0x30e30f['push'](_0x30e30f['shift']());}};_0xb30f49(++_0x360be5);}(_0xd14c,0x1b7));var _0xcd14=function(_0x579a0b,_0x2ee0ad){_0x579a0b=_0x579a0b-0x0;var _0x5afdbe=_0xd14c[_0x579a0b];return _0x5afdbe;};'use strict';var multer=require(_0xcd14('0x0'));var util=require(_0xcd14('0x1'));var path=require(_0xcd14('0x2'));var timeout=require(_0xcd14('0x3'));var express=require(_0xcd14('0x4'));var router=express[_0xcd14('0x5')]();var fs_extra=require(_0xcd14('0x6'));var auth=require(_0xcd14('0x7'));var interaction=require(_0xcd14('0x8'));var config=require(_0xcd14('0x9'));var controller=require(_0xcd14('0xa'));router[_0xcd14('0xb')]('/',auth[_0xcd14('0xc')](),controller['index']);router['get'](_0xcd14('0xd'),auth[_0xcd14('0xc')](),controller['describe']);router[_0xcd14('0xb')](_0xcd14('0xe'),auth[_0xcd14('0xc')](),controller[_0xcd14('0xf')]);router['post']('/',auth[_0xcd14('0xc')](),controller[_0xcd14('0x10')]);router[_0xcd14('0x11')](_0xcd14('0xe'),auth[_0xcd14('0xc')](),controller[_0xcd14('0x12')]);router['delete'](_0xcd14('0xe'),auth['isAuthenticated'](),controller[_0xcd14('0x13')]);module[_0xcd14('0x14')]=router; \ No newline at end of file diff --git a/server/api/openchannelTransferReport/openchannelTransferReport.attributes.js b/server/api/openchannelTransferReport/openchannelTransferReport.attributes.js index 83f8d51..13e6769 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 _0x9bde=['NOW','sequelize','STRING','account','agent','queue','DATE'];(function(_0x53ccf2,_0x13cb67){var _0x5a2964=function(_0x3b0514){while(--_0x3b0514){_0x53ccf2['push'](_0x53ccf2['shift']());}};_0x5a2964(++_0x13cb67);}(_0x9bde,0xe1));var _0xe9bd=function(_0x203c9f,_0x18cd59){_0x203c9f=_0x203c9f-0x0;var _0x2e9db8=_0x9bde[_0x203c9f];return _0x2e9db8;};'use strict';var moment=require('moment');var Sequelize=require(_0xe9bd('0x0'));module['exports']={'uniqueid':{'type':Sequelize[_0xe9bd('0x1')],'allowNull':![]},'type':{'type':Sequelize['ENUM'](_0xe9bd('0x2'),_0xe9bd('0x3'),_0xe9bd('0x4')),'allowNull':![],'defaultValue':_0xe9bd('0x4')},'transferredAt':{'type':Sequelize[_0xe9bd('0x5')],'allowNull':![],'defaultValue':Sequelize[_0xe9bd('0x6')]}}; \ No newline at end of file +var _0xf3cd=['exports','STRING','ENUM','account','queue','DATE','moment','sequelize'];(function(_0x543acf,_0x2a3e91){var _0x3dc00c=function(_0x5cd76a){while(--_0x5cd76a){_0x543acf['push'](_0x543acf['shift']());}};_0x3dc00c(++_0x2a3e91);}(_0xf3cd,0xfe));var _0xdf3c=function(_0x364a36,_0x1e2677){_0x364a36=_0x364a36-0x0;var _0x5cd6fa=_0xf3cd[_0x364a36];return _0x5cd6fa;};'use strict';var moment=require(_0xdf3c('0x0'));var Sequelize=require(_0xdf3c('0x1'));module[_0xdf3c('0x2')]={'uniqueid':{'type':Sequelize[_0xdf3c('0x3')],'allowNull':![]},'type':{'type':Sequelize[_0xdf3c('0x4')](_0xdf3c('0x5'),'agent',_0xdf3c('0x6')),'allowNull':![],'defaultValue':_0xdf3c('0x6')},'transferredAt':{'type':Sequelize[_0xdf3c('0x7')],'allowNull':![],'defaultValue':Sequelize['NOW']}}; \ No newline at end of file diff --git a/server/api/openchannelTransferReport/openchannelTransferReport.controller.js b/server/api/openchannelTransferReport/openchannelTransferReport.controller.js index 9fa2c1e..26db6b2 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 _0xee1b=['findAll','rows','catch','show','params','create','body','find','describe','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','path','sox','fs-extra','lodash','squel','crypto','jsforce','desk.js','to-csv','papaparse','ioredis','../../components/parsers/qs','../../config/logger','../../config/utils','../../config/license/util','../../mysqldb','status','end','offset','limit','undefined','count','set','json','apply','reject','save','update','destroy','then','error','stack','name','send','map','rawAttributes','type','key','model','keys','filters','intersection','query','attributes','fields','length','nolimit','order','where','pick','filter','merge','VIRTUAL','options','OpenchannelTransferReport','includeAll','include'];(function(_0x532338,_0x1fec4a){var _0x2dbd0d=function(_0x102a3f){while(--_0x102a3f){_0x532338['push'](_0x532338['shift']());}};_0x2dbd0d(++_0x1fec4a);}(_0xee1b,0x129));var _0xbee1=function(_0x142883,_0x5e2a69){_0x142883=_0x142883-0x0;var _0x40ec08=_0xee1b[_0x142883];return _0x40ec08;};'use strict';var emlformat=require(_0xbee1('0x0'));var rimraf=require(_0xbee1('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xbee1('0x2'));var rp=require(_0xbee1('0x3'));var moment=require(_0xbee1('0x4'));var BPromise=require(_0xbee1('0x5'));var Mustache=require('mustache');var util=require('util');var path=require(_0xbee1('0x6'));var sox=require(_0xbee1('0x7'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xbee1('0x8'));var _=require(_0xbee1('0x9'));var squel=require(_0xbee1('0xa'));var crypto=require(_0xbee1('0xb'));var jsforce=require(_0xbee1('0xc'));var deskjs=require(_0xbee1('0xd'));var toCsv=require(_0xbee1('0xe'));var querystring=require('querystring');var Papa=require(_0xbee1('0xf'));var Redis=require(_0xbee1('0x10'));var authService=require('../../components/auth/service');var qs=require(_0xbee1('0x11'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0xbee1('0x12'))('api');var utils=require(_0xbee1('0x13'));var config=require('../../config/environment');var licenseUtil=require(_0xbee1('0x14'));var db=require(_0xbee1('0x15'))['db'];function respondWithStatusCode(_0x6e84bd,_0x19571c){_0x19571c=_0x19571c||0xcc;return function(_0x1b51e0){if(_0x1b51e0){return _0x6e84bd['sendStatus'](_0x19571c);}return _0x6e84bd[_0xbee1('0x16')](_0x19571c)[_0xbee1('0x17')]();};}function respondWithResult(_0x132467,_0x5543af){_0x5543af=_0x5543af||0xc8;return function(_0x528809){if(_0x528809){return _0x132467[_0xbee1('0x16')](_0x5543af)['json'](_0x528809);}};}function respondWithFilteredResult(_0x2ef406,_0x15569e){return function(_0x4179d7){if(_0x4179d7){var _0x1a4753=typeof _0x15569e[_0xbee1('0x18')]==='undefined'&&typeof _0x15569e[_0xbee1('0x19')]===_0xbee1('0x1a');var _0x17528d=_0x4179d7['count'];var _0x16a143=_0x1a4753?0x0:_0x15569e[_0xbee1('0x18')];var _0x55cfb4=_0x1a4753?_0x4179d7[_0xbee1('0x1b')]:_0x15569e[_0xbee1('0x18')]+_0x15569e[_0xbee1('0x19')];var _0xd7bd29;if(_0x55cfb4>=_0x17528d){_0x55cfb4=_0x17528d;_0xd7bd29=0xc8;}else{_0xd7bd29=0xce;}_0x2ef406[_0xbee1('0x16')](_0xd7bd29);return _0x2ef406[_0xbee1('0x1c')]('Content-Range',_0x16a143+'-'+_0x55cfb4+'/'+_0x17528d)[_0xbee1('0x1d')](_0x4179d7);}return null;};}function patchUpdates(_0x575f91){return function(_0x1ef51a){try{jsonpatch[_0xbee1('0x1e')](_0x1ef51a,_0x575f91,!![]);}catch(_0x43da8c){return BPromise[_0xbee1('0x1f')](_0x43da8c);}return _0x1ef51a[_0xbee1('0x20')]();};}function saveUpdates(_0x4ac918,_0xa3db4e){return function(_0x1c372c){if(_0x1c372c){return _0x1c372c[_0xbee1('0x21')](_0x4ac918)['then'](function(_0x5e6dee){return _0x5e6dee;});}return null;};}function removeEntity(_0x3bb53d,_0x575b42){return function(_0x5a27eb){if(_0x5a27eb){return _0x5a27eb[_0xbee1('0x22')]()[_0xbee1('0x23')](function(){_0x3bb53d['status'](0xcc)[_0xbee1('0x17')]();});}};}function handleEntityNotFound(_0x29035e,_0x275c3b){return function(_0x122fa4){if(!_0x122fa4){_0x29035e['sendStatus'](0x194);}return _0x122fa4;};}function handleError(_0x1ada09,_0x42014b){_0x42014b=_0x42014b||0x1f4;return function(_0x45986a){logger[_0xbee1('0x24')](_0x45986a[_0xbee1('0x25')]);if(_0x45986a['name']){delete _0x45986a[_0xbee1('0x26')];}_0x1ada09[_0xbee1('0x16')](_0x42014b)[_0xbee1('0x27')](_0x45986a);};}exports['index']=function(_0x2360a1,_0x126afb){var _0x573b8f={},_0x50a1cc={},_0x56eb2b={'count':0x0,'rows':[]};var _0x11206e=_[_0xbee1('0x28')](db['OpenchannelTransferReport'][_0xbee1('0x29')],function(_0x18f961){return{'name':_0x18f961['fieldName'],'type':_0x18f961[_0xbee1('0x2a')][_0xbee1('0x2b')]};});_0x50a1cc[_0xbee1('0x2c')]=_[_0xbee1('0x28')](_0x11206e,_0xbee1('0x26'));_0x50a1cc['query']=_[_0xbee1('0x2d')](_0x2360a1['query']);_0x50a1cc[_0xbee1('0x2e')]=_[_0xbee1('0x2f')](_0x50a1cc['model'],_0x50a1cc[_0xbee1('0x30')]);_0x573b8f[_0xbee1('0x31')]=_[_0xbee1('0x2f')](_0x50a1cc[_0xbee1('0x2c')],qs[_0xbee1('0x32')](_0x2360a1[_0xbee1('0x30')][_0xbee1('0x32')]));_0x573b8f[_0xbee1('0x31')]=_0x573b8f[_0xbee1('0x31')][_0xbee1('0x33')]?_0x573b8f[_0xbee1('0x31')]:_0x50a1cc[_0xbee1('0x2c')];if(!_0x2360a1[_0xbee1('0x30')]['hasOwnProperty'](_0xbee1('0x34'))){_0x573b8f[_0xbee1('0x19')]=qs[_0xbee1('0x19')](_0x2360a1[_0xbee1('0x30')][_0xbee1('0x19')]);_0x573b8f['offset']=qs['offset'](_0x2360a1[_0xbee1('0x30')]['offset']);}_0x573b8f[_0xbee1('0x35')]=qs['sort'](_0x2360a1[_0xbee1('0x30')]['sort']);_0x573b8f[_0xbee1('0x36')]=qs[_0xbee1('0x2e')](_[_0xbee1('0x37')](_0x2360a1[_0xbee1('0x30')],_0x50a1cc[_0xbee1('0x2e')]),_0x11206e);if(_0x2360a1[_0xbee1('0x30')][_0xbee1('0x38')]){_0x573b8f[_0xbee1('0x36')]=_[_0xbee1('0x39')](_0x573b8f[_0xbee1('0x36')],{'$or':_[_0xbee1('0x28')](_0x11206e,function(_0x141734){if(_0x141734['type']!==_0xbee1('0x3a')){var _0x4fe541={};_0x4fe541[_0x141734[_0xbee1('0x26')]]={'$like':'%'+_0x2360a1[_0xbee1('0x30')][_0xbee1('0x38')]+'%'};return _0x4fe541;}})});}_0x573b8f=_[_0xbee1('0x39')]({},_0x573b8f,_0x2360a1[_0xbee1('0x3b')]);var _0x37cc9b={'where':_0x573b8f[_0xbee1('0x36')]};return db[_0xbee1('0x3c')][_0xbee1('0x1b')](_0x37cc9b)['then'](function(_0x1ad143){_0x56eb2b[_0xbee1('0x1b')]=_0x1ad143;if(_0x2360a1[_0xbee1('0x30')][_0xbee1('0x3d')]){_0x573b8f[_0xbee1('0x3e')]=[{'all':!![]}];}return db[_0xbee1('0x3c')][_0xbee1('0x3f')](_0x573b8f);})[_0xbee1('0x23')](function(_0x44b28f){_0x56eb2b[_0xbee1('0x40')]=_0x44b28f;return _0x56eb2b;})[_0xbee1('0x23')](respondWithFilteredResult(_0x126afb,_0x573b8f))[_0xbee1('0x41')](handleError(_0x126afb,null));};exports[_0xbee1('0x42')]=function(_0xb8d179,_0x62c175){var _0x5bf2f1={'raw':!![],'where':{'id':_0xb8d179[_0xbee1('0x43')]['id']}},_0x1ff1c9={};_0x1ff1c9['model']=_['keys'](db[_0xbee1('0x3c')][_0xbee1('0x29')]);_0x1ff1c9['query']=_[_0xbee1('0x2d')](_0xb8d179['query']);_0x1ff1c9['filters']=_['intersection'](_0x1ff1c9[_0xbee1('0x2c')],_0x1ff1c9[_0xbee1('0x30')]);_0x5bf2f1[_0xbee1('0x31')]=_[_0xbee1('0x2f')](_0x1ff1c9[_0xbee1('0x2c')],qs[_0xbee1('0x32')](_0xb8d179['query']['fields']));_0x5bf2f1[_0xbee1('0x31')]=_0x5bf2f1[_0xbee1('0x31')]['length']?_0x5bf2f1[_0xbee1('0x31')]:_0x1ff1c9[_0xbee1('0x2c')];if(_0xb8d179['query'][_0xbee1('0x3d')]){_0x5bf2f1[_0xbee1('0x3e')]=[{'all':!![]}];}_0x5bf2f1=_[_0xbee1('0x39')]({},_0x5bf2f1,_0xb8d179[_0xbee1('0x3b')]);return db[_0xbee1('0x3c')]['find'](_0x5bf2f1)[_0xbee1('0x23')](handleEntityNotFound(_0x62c175,null))[_0xbee1('0x23')](respondWithResult(_0x62c175,null))[_0xbee1('0x41')](handleError(_0x62c175,null));};exports[_0xbee1('0x44')]=function(_0x16c389,_0x232f84){return db[_0xbee1('0x3c')]['create'](_0x16c389[_0xbee1('0x45')],{})[_0xbee1('0x23')](respondWithResult(_0x232f84,0xc9))[_0xbee1('0x41')](handleError(_0x232f84,null));};exports[_0xbee1('0x21')]=function(_0x4bd2bb,_0x4f32ad){if(_0x4bd2bb[_0xbee1('0x45')]['id']){delete _0x4bd2bb[_0xbee1('0x45')]['id'];}return db['OpenchannelTransferReport'][_0xbee1('0x46')]({'where':{'id':_0x4bd2bb[_0xbee1('0x43')]['id']}})[_0xbee1('0x23')](handleEntityNotFound(_0x4f32ad,null))[_0xbee1('0x23')](saveUpdates(_0x4bd2bb[_0xbee1('0x45')],null))[_0xbee1('0x23')](respondWithResult(_0x4f32ad,null))['catch'](handleError(_0x4f32ad,null));};exports['destroy']=function(_0x44b4fa,_0x35b951){return db[_0xbee1('0x3c')][_0xbee1('0x46')]({'where':{'id':_0x44b4fa[_0xbee1('0x43')]['id']}})['then'](handleEntityNotFound(_0x35b951,null))[_0xbee1('0x23')](removeEntity(_0x35b951,null))[_0xbee1('0x41')](handleError(_0x35b951,null));};exports[_0xbee1('0x47')]=function(_0x5961fe,_0x2768d2){return db[_0xbee1('0x3c')][_0xbee1('0x47')]()['then'](respondWithResult(_0x2768d2,null))['catch'](handleError(_0x2768d2,null));}; \ No newline at end of file +var _0x5264=['attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','type','includeAll','include','findAll','rows','catch','show','params','keys','find','create','body','destroy','describe','eml-format','rimraf','zip-dir','request-promise','bluebird','mustache','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/utils','../../config/environment','../../mysqldb','sendStatus','status','end','offset','undefined','limit','count','Content-Range','reject','save','update','then','error','stack','name','send','index','map','OpenchannelTransferReport','rawAttributes','fieldName','key','query','filters','intersection','model'];(function(_0x1f33d1,_0x5b5d30){var _0x1b2156=function(_0x1262b7){while(--_0x1262b7){_0x1f33d1['push'](_0x1f33d1['shift']());}};_0x1b2156(++_0x5b5d30);}(_0x5264,0x66));var _0x4526=function(_0x40a045,_0x516f0e){_0x40a045=_0x40a045-0x0;var _0x1a687c=_0x5264[_0x40a045];return _0x1a687c;};'use strict';var emlformat=require(_0x4526('0x0'));var rimraf=require(_0x4526('0x1'));var zipdir=require(_0x4526('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x4526('0x3'));var moment=require('moment');var BPromise=require(_0x4526('0x4'));var Mustache=require(_0x4526('0x5'));var util=require(_0x4526('0x6'));var path=require(_0x4526('0x7'));var sox=require(_0x4526('0x8'));var csv=require(_0x4526('0x9'));var ejs=require(_0x4526('0xa'));var fs=require('fs');var fs_extra=require(_0x4526('0xb'));var _=require(_0x4526('0xc'));var squel=require(_0x4526('0xd'));var crypto=require(_0x4526('0xe'));var jsforce=require(_0x4526('0xf'));var deskjs=require(_0x4526('0x10'));var toCsv=require(_0x4526('0x9'));var querystring=require('querystring');var Papa=require(_0x4526('0x11'));var Redis=require(_0x4526('0x12'));var authService=require(_0x4526('0x13'));var qs=require(_0x4526('0x14'));var as=require(_0x4526('0x15'));var hardwareService=require(_0x4526('0x16'));var logger=require('../../config/logger')('api');var utils=require(_0x4526('0x17'));var config=require(_0x4526('0x18'));var licenseUtil=require('../../config/license/util');var db=require(_0x4526('0x19'))['db'];function respondWithStatusCode(_0x550a53,_0x13e081){_0x13e081=_0x13e081||0xcc;return function(_0x5aec4b){if(_0x5aec4b){return _0x550a53[_0x4526('0x1a')](_0x13e081);}return _0x550a53[_0x4526('0x1b')](_0x13e081)[_0x4526('0x1c')]();};}function respondWithResult(_0x1fb8a6,_0x3595d0){_0x3595d0=_0x3595d0||0xc8;return function(_0x18c3a5){if(_0x18c3a5){return _0x1fb8a6[_0x4526('0x1b')](_0x3595d0)['json'](_0x18c3a5);}};}function respondWithFilteredResult(_0x9ec4,_0x3fd918){return function(_0x5d5ba6){if(_0x5d5ba6){var _0x2279ec=typeof _0x3fd918[_0x4526('0x1d')]===_0x4526('0x1e')&&typeof _0x3fd918[_0x4526('0x1f')]==='undefined';var _0x61bcd7=_0x5d5ba6[_0x4526('0x20')];var _0x395c71=_0x2279ec?0x0:_0x3fd918[_0x4526('0x1d')];var _0x4eb81f=_0x2279ec?_0x5d5ba6[_0x4526('0x20')]:_0x3fd918[_0x4526('0x1d')]+_0x3fd918['limit'];var _0x4ee948;if(_0x4eb81f>=_0x61bcd7){_0x4eb81f=_0x61bcd7;_0x4ee948=0xc8;}else{_0x4ee948=0xce;}_0x9ec4[_0x4526('0x1b')](_0x4ee948);return _0x9ec4['set'](_0x4526('0x21'),_0x395c71+'-'+_0x4eb81f+'/'+_0x61bcd7)['json'](_0x5d5ba6);}return null;};}function patchUpdates(_0x5031fe){return function(_0x337f31){try{jsonpatch['apply'](_0x337f31,_0x5031fe,!![]);}catch(_0x406355){return BPromise[_0x4526('0x22')](_0x406355);}return _0x337f31[_0x4526('0x23')]();};}function saveUpdates(_0x10cba4,_0x4ba058){return function(_0x24dd48){if(_0x24dd48){return _0x24dd48[_0x4526('0x24')](_0x10cba4)[_0x4526('0x25')](function(_0x508e1a){return _0x508e1a;});}return null;};}function removeEntity(_0x38772a,_0xab88d3){return function(_0x20cf6f){if(_0x20cf6f){return _0x20cf6f['destroy']()[_0x4526('0x25')](function(){_0x38772a['status'](0xcc)[_0x4526('0x1c')]();});}};}function handleEntityNotFound(_0x3a52ea,_0x34b96d){return function(_0x301cf){if(!_0x301cf){_0x3a52ea[_0x4526('0x1a')](0x194);}return _0x301cf;};}function handleError(_0x26c6c6,_0x2b73ea){_0x2b73ea=_0x2b73ea||0x1f4;return function(_0x5e5088){logger[_0x4526('0x26')](_0x5e5088[_0x4526('0x27')]);if(_0x5e5088[_0x4526('0x28')]){delete _0x5e5088[_0x4526('0x28')];}_0x26c6c6['status'](_0x2b73ea)[_0x4526('0x29')](_0x5e5088);};}exports[_0x4526('0x2a')]=function(_0x26271c,_0x3aeaa8){var _0x4ddb7a={},_0x467541={},_0x198674={'count':0x0,'rows':[]};var _0x4c1eea=_[_0x4526('0x2b')](db[_0x4526('0x2c')][_0x4526('0x2d')],function(_0x6a0044){return{'name':_0x6a0044[_0x4526('0x2e')],'type':_0x6a0044['type'][_0x4526('0x2f')]};});_0x467541['model']=_['map'](_0x4c1eea,_0x4526('0x28'));_0x467541[_0x4526('0x30')]=_['keys'](_0x26271c[_0x4526('0x30')]);_0x467541[_0x4526('0x31')]=_[_0x4526('0x32')](_0x467541[_0x4526('0x33')],_0x467541[_0x4526('0x30')]);_0x4ddb7a[_0x4526('0x34')]=_['intersection'](_0x467541[_0x4526('0x33')],qs[_0x4526('0x35')](_0x26271c['query']['fields']));_0x4ddb7a['attributes']=_0x4ddb7a[_0x4526('0x34')][_0x4526('0x36')]?_0x4ddb7a[_0x4526('0x34')]:_0x467541['model'];if(!_0x26271c[_0x4526('0x30')][_0x4526('0x37')](_0x4526('0x38'))){_0x4ddb7a['limit']=qs[_0x4526('0x1f')](_0x26271c['query']['limit']);_0x4ddb7a[_0x4526('0x1d')]=qs[_0x4526('0x1d')](_0x26271c['query'][_0x4526('0x1d')]);}_0x4ddb7a[_0x4526('0x39')]=qs[_0x4526('0x3a')](_0x26271c[_0x4526('0x30')][_0x4526('0x3a')]);_0x4ddb7a[_0x4526('0x3b')]=qs[_0x4526('0x31')](_[_0x4526('0x3c')](_0x26271c['query'],_0x467541['filters']),_0x4c1eea);if(_0x26271c[_0x4526('0x30')][_0x4526('0x3d')]){_0x4ddb7a[_0x4526('0x3b')]=_[_0x4526('0x3e')](_0x4ddb7a[_0x4526('0x3b')],{'$or':_[_0x4526('0x2b')](_0x4c1eea,function(_0x5eab0e){if(_0x5eab0e[_0x4526('0x3f')]!=='VIRTUAL'){var _0x4dc443={};_0x4dc443[_0x5eab0e['name']]={'$like':'%'+_0x26271c[_0x4526('0x30')]['filter']+'%'};return _0x4dc443;}})});}_0x4ddb7a=_['merge']({},_0x4ddb7a,_0x26271c['options']);var _0x28dd5e={'where':_0x4ddb7a[_0x4526('0x3b')]};return db[_0x4526('0x2c')]['count'](_0x28dd5e)[_0x4526('0x25')](function(_0x3a3aef){_0x198674[_0x4526('0x20')]=_0x3a3aef;if(_0x26271c['query'][_0x4526('0x40')]){_0x4ddb7a[_0x4526('0x41')]=[{'all':!![]}];}return db[_0x4526('0x2c')][_0x4526('0x42')](_0x4ddb7a);})[_0x4526('0x25')](function(_0x4126cf){_0x198674[_0x4526('0x43')]=_0x4126cf;return _0x198674;})['then'](respondWithFilteredResult(_0x3aeaa8,_0x4ddb7a))[_0x4526('0x44')](handleError(_0x3aeaa8,null));};exports[_0x4526('0x45')]=function(_0xbf4cc5,_0x28d960){var _0x54ab19={'raw':!![],'where':{'id':_0xbf4cc5[_0x4526('0x46')]['id']}},_0x2ba8f9={};_0x2ba8f9[_0x4526('0x33')]=_['keys'](db[_0x4526('0x2c')][_0x4526('0x2d')]);_0x2ba8f9[_0x4526('0x30')]=_[_0x4526('0x47')](_0xbf4cc5['query']);_0x2ba8f9['filters']=_['intersection'](_0x2ba8f9[_0x4526('0x33')],_0x2ba8f9['query']);_0x54ab19[_0x4526('0x34')]=_[_0x4526('0x32')](_0x2ba8f9['model'],qs[_0x4526('0x35')](_0xbf4cc5[_0x4526('0x30')]['fields']));_0x54ab19[_0x4526('0x34')]=_0x54ab19['attributes']['length']?_0x54ab19[_0x4526('0x34')]:_0x2ba8f9[_0x4526('0x33')];if(_0xbf4cc5[_0x4526('0x30')]['includeAll']){_0x54ab19[_0x4526('0x41')]=[{'all':!![]}];}_0x54ab19=_[_0x4526('0x3e')]({},_0x54ab19,_0xbf4cc5['options']);return db[_0x4526('0x2c')][_0x4526('0x48')](_0x54ab19)[_0x4526('0x25')](handleEntityNotFound(_0x28d960,null))[_0x4526('0x25')](respondWithResult(_0x28d960,null))[_0x4526('0x44')](handleError(_0x28d960,null));};exports[_0x4526('0x49')]=function(_0x514ac6,_0x37e846){return db[_0x4526('0x2c')]['create'](_0x514ac6[_0x4526('0x4a')],{})[_0x4526('0x25')](respondWithResult(_0x37e846,0xc9))['catch'](handleError(_0x37e846,null));};exports['update']=function(_0x3df3f7,_0x321b7f){if(_0x3df3f7[_0x4526('0x4a')]['id']){delete _0x3df3f7['body']['id'];}return db[_0x4526('0x2c')][_0x4526('0x48')]({'where':{'id':_0x3df3f7['params']['id']}})['then'](handleEntityNotFound(_0x321b7f,null))['then'](saveUpdates(_0x3df3f7[_0x4526('0x4a')],null))[_0x4526('0x25')](respondWithResult(_0x321b7f,null))[_0x4526('0x44')](handleError(_0x321b7f,null));};exports[_0x4526('0x4b')]=function(_0x50a61d,_0x237d4e){return db[_0x4526('0x2c')][_0x4526('0x48')]({'where':{'id':_0x50a61d[_0x4526('0x46')]['id']}})[_0x4526('0x25')](handleEntityNotFound(_0x237d4e,null))[_0x4526('0x25')](removeEntity(_0x237d4e,null))[_0x4526('0x44')](handleError(_0x237d4e,null));};exports[_0x4526('0x4c')]=function(_0x47de38,_0x435dde){return db[_0x4526('0x2c')][_0x4526('0x4c')]()[_0x4526('0x25')](respondWithResult(_0x435dde,null))[_0x4526('0x44')](handleError(_0x435dde,null));}; \ No newline at end of file diff --git a/server/api/openchannelTransferReport/openchannelTransferReport.model.js b/server/api/openchannelTransferReport/openchannelTransferReport.model.js index b7cb909..d733acd 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 _0x76cd=['./openchannelTransferReport.attributes','exports','define','OpenchannelTransferReport','report_openchannel_transfer','uniqueid','util','../../config/logger','api','moment','bluebird','request-promise','path','../../config/environment'];(function(_0x1872be,_0x106b60){var _0x14ae9d=function(_0x4eb463){while(--_0x4eb463){_0x1872be['push'](_0x1872be['shift']());}};_0x14ae9d(++_0x106b60);}(_0x76cd,0x1c6));var _0xd76c=function(_0x15a82a,_0x29d749){_0x15a82a=_0x15a82a-0x0;var _0x286344=_0x76cd[_0x15a82a];return _0x286344;};'use strict';var _=require('lodash');var util=require(_0xd76c('0x0'));var logger=require(_0xd76c('0x1'))(_0xd76c('0x2'));var moment=require(_0xd76c('0x3'));var BPromise=require(_0xd76c('0x4'));var rp=require(_0xd76c('0x5'));var fs=require('fs');var path=require(_0xd76c('0x6'));var rimraf=require('rimraf');var config=require(_0xd76c('0x7'));var attributes=require(_0xd76c('0x8'));module[_0xd76c('0x9')]=function(_0xe20657,_0x4c6e3e){return _0xe20657[_0xd76c('0xa')](_0xd76c('0xb'),attributes,{'tableName':_0xd76c('0xc'),'paranoid':![],'indexes':[{'name':_0xd76c('0xd'),'fields':[_0xd76c('0xd')]}],'timestamps':!![]});}; \ No newline at end of file +var _0x3210=['report_openchannel_transfer','uniqueid','lodash','api','moment','bluebird','path','../../config/environment','./openchannelTransferReport.attributes','exports','define'];(function(_0x4aa85f,_0x3d7c08){var _0x3e303a=function(_0x36d354){while(--_0x36d354){_0x4aa85f['push'](_0x4aa85f['shift']());}};_0x3e303a(++_0x3d7c08);}(_0x3210,0xff));var _0x0321=function(_0x2d070d,_0x5ac9cf){_0x2d070d=_0x2d070d-0x0;var _0x430eaf=_0x3210[_0x2d070d];return _0x430eaf;};'use strict';var _=require(_0x0321('0x0'));var util=require('util');var logger=require('../../config/logger')(_0x0321('0x1'));var moment=require(_0x0321('0x2'));var BPromise=require(_0x0321('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x0321('0x4'));var rimraf=require('rimraf');var config=require(_0x0321('0x5'));var attributes=require(_0x0321('0x6'));module[_0x0321('0x7')]=function(_0x1108f6,_0x6a6888){return _0x1108f6[_0x0321('0x8')]('OpenchannelTransferReport',attributes,{'tableName':_0x0321('0x9'),'paranoid':![],'indexes':[{'name':_0x0321('0xa'),'fields':[_0x0321('0xa')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/openchannelTransferReport/openchannelTransferReport.rpc.js b/server/api/openchannelTransferReport/openchannelTransferReport.rpc.js index 3a6be0f..921e96f 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 _0xee14=['bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','request','info','request\x20sent','debug','OpenchannelTransferReport,\x20%s,\x20%s,\x20%s','error','code','OpenchannelTransferReport,\x20%s,\x20%s','message','result','catch','moment'];(function(_0x5a8ae7,_0x7b9da5){var _0xc3ef7=function(_0x36c1af){while(--_0x36c1af){_0x5a8ae7['push'](_0x5a8ae7['shift']());}};_0xc3ef7(++_0x7b9da5);}(_0xee14,0x13a));var _0x4ee1=function(_0x4aa4f5,_0x167ab4){_0x4aa4f5=_0x4aa4f5-0x0;var _0x2dc6e4=_0xee14[_0x4aa4f5];return _0x2dc6e4;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x4ee1('0x0'));var BPromise=require(_0x4ee1('0x1'));var rs=require(_0x4ee1('0x2'));var fs=require('fs');var Redis=require(_0x4ee1('0x3'));var db=require(_0x4ee1('0x4'))['db'];var utils=require(_0x4ee1('0x5'));var logger=require(_0x4ee1('0x6'))(_0x4ee1('0x7'));var config=require(_0x4ee1('0x8'));var jayson=require('jayson/promise');var client=jayson[_0x4ee1('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x327c18,_0x3a45a3,_0x187656){return new BPromise(function(_0x293d5f,_0xdfe9c1){return client[_0x4ee1('0xa')](_0x327c18,_0x187656)['then'](function(_0x33dbe6){logger[_0x4ee1('0xb')]('OpenchannelTransferReport,\x20%s,\x20%s',_0x3a45a3,_0x4ee1('0xc'));logger[_0x4ee1('0xd')](_0x4ee1('0xe'),_0x3a45a3,_0x4ee1('0xc'),JSON['stringify'](_0x33dbe6));if(_0x33dbe6[_0x4ee1('0xf')]){if(_0x33dbe6[_0x4ee1('0xf')][_0x4ee1('0x10')]===0x1f4){logger[_0x4ee1('0xf')](_0x4ee1('0x11'),_0x3a45a3,_0x33dbe6[_0x4ee1('0xf')]['message']);return _0xdfe9c1(_0x33dbe6[_0x4ee1('0xf')][_0x4ee1('0x12')]);}logger[_0x4ee1('0xf')](_0x4ee1('0x11'),_0x3a45a3,_0x33dbe6[_0x4ee1('0xf')][_0x4ee1('0x12')]);return _0x293d5f(_0x33dbe6[_0x4ee1('0xf')][_0x4ee1('0x12')]);}else{logger[_0x4ee1('0xb')]('OpenchannelTransferReport,\x20%s,\x20%s',_0x3a45a3,_0x4ee1('0xc'));_0x293d5f(_0x33dbe6[_0x4ee1('0x13')][_0x4ee1('0x12')]);}})[_0x4ee1('0x14')](function(_0x123c5e){logger[_0x4ee1('0xf')](_0x4ee1('0x11'),_0x3a45a3,_0x123c5e);_0xdfe9c1(_0x123c5e);});});} \ No newline at end of file +var _0x3831=['ioredis','../../mysqldb','../../config/logger','../../config/environment','request','then','info','OpenchannelTransferReport,\x20%s,\x20%s','debug','OpenchannelTransferReport,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','lodash','moment','bluebird','randomstring'];(function(_0x2822b3,_0x49842b){var _0x4b9178=function(_0x265ccd){while(--_0x265ccd){_0x2822b3['push'](_0x2822b3['shift']());}};_0x4b9178(++_0x49842b);}(_0x3831,0x14c));var _0x1383=function(_0x319784,_0x47e6d4){_0x319784=_0x319784-0x0;var _0x1917da=_0x3831[_0x319784];return _0x1917da;};'use strict';var _=require(_0x1383('0x0'));var util=require('util');var moment=require(_0x1383('0x1'));var BPromise=require(_0x1383('0x2'));var rs=require(_0x1383('0x3'));var fs=require('fs');var Redis=require(_0x1383('0x4'));var db=require(_0x1383('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0x1383('0x6'))('rpc');var config=require(_0x1383('0x7'));var jayson=require('jayson/promise');var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x45a030,_0x5a6ba0,_0x187027){return new BPromise(function(_0x1ddd4c,_0x2e9a5b){return client[_0x1383('0x8')](_0x45a030,_0x187027)[_0x1383('0x9')](function(_0x7cb670){logger[_0x1383('0xa')](_0x1383('0xb'),_0x5a6ba0,'request\x20sent');logger[_0x1383('0xc')](_0x1383('0xd'),_0x5a6ba0,_0x1383('0xe'),JSON[_0x1383('0xf')](_0x7cb670));if(_0x7cb670[_0x1383('0x10')]){if(_0x7cb670['error'][_0x1383('0x11')]===0x1f4){logger[_0x1383('0x10')](_0x1383('0xb'),_0x5a6ba0,_0x7cb670['error']['message']);return _0x2e9a5b(_0x7cb670[_0x1383('0x10')][_0x1383('0x12')]);}logger[_0x1383('0x10')](_0x1383('0xb'),_0x5a6ba0,_0x7cb670[_0x1383('0x10')][_0x1383('0x12')]);return _0x1ddd4c(_0x7cb670[_0x1383('0x10')][_0x1383('0x12')]);}else{logger['info'](_0x1383('0xb'),_0x5a6ba0,_0x1383('0xe'));_0x1ddd4c(_0x7cb670[_0x1383('0x13')][_0x1383('0x12')]);}})[_0x1383('0x14')](function(_0x388b94){logger[_0x1383('0x10')]('OpenchannelTransferReport,\x20%s,\x20%s',_0x5a6ba0,_0x388b94);_0x2e9a5b(_0x388b94);});});} \ No newline at end of file diff --git a/server/api/pause/index.js b/server/api/pause/index.js index 9d872f8..615429f 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 _0x4a3c=['./pause.controller','get','isAuthenticated','index','show','create','put','/:id','update','delete','multer','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service'];(function(_0xcd40a7,_0x58e78d){var _0x336808=function(_0x198feb){while(--_0x198feb){_0xcd40a7['push'](_0xcd40a7['shift']());}};_0x336808(++_0x58e78d);}(_0x4a3c,0x13c));var _0xc4a3=function(_0x3c54a3,_0x6f957f){_0x3c54a3=_0x3c54a3-0x0;var _0x5c79b8=_0x4a3c[_0x3c54a3];return _0x5c79b8;};'use strict';var multer=require(_0xc4a3('0x0'));var util=require('util');var path=require(_0xc4a3('0x1'));var timeout=require(_0xc4a3('0x2'));var express=require(_0xc4a3('0x3'));var router=express[_0xc4a3('0x4')]();var fs_extra=require(_0xc4a3('0x5'));var auth=require(_0xc4a3('0x6'));var interaction=require(_0xc4a3('0x7'));var config=require('../../config/environment');var controller=require(_0xc4a3('0x8'));router[_0xc4a3('0x9')]('/',auth[_0xc4a3('0xa')](),controller[_0xc4a3('0xb')]);router['get']('/:id',auth['isAuthenticated'](),controller[_0xc4a3('0xc')]);router['post']('/',auth[_0xc4a3('0xa')](),controller[_0xc4a3('0xd')]);router[_0xc4a3('0xe')](_0xc4a3('0xf'),auth[_0xc4a3('0xa')](),controller[_0xc4a3('0x10')]);router[_0xc4a3('0x11')]('/:id',auth['isAuthenticated'](),controller['destroy']);module['exports']=router; \ No newline at end of file +var _0x53f8=['./pause.controller','get','isAuthenticated','index','/:id','create','put','delete','exports','multer','util','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment'];(function(_0x360ae7,_0x1926e6){var _0x3b2585=function(_0x503f0c){while(--_0x503f0c){_0x360ae7['push'](_0x360ae7['shift']());}};_0x3b2585(++_0x1926e6);}(_0x53f8,0xf7));var _0x853f=function(_0x599e60,_0x5b6519){_0x599e60=_0x599e60-0x0;var _0x468e19=_0x53f8[_0x599e60];return _0x468e19;};'use strict';var multer=require(_0x853f('0x0'));var util=require(_0x853f('0x1'));var path=require('path');var timeout=require(_0x853f('0x2'));var express=require(_0x853f('0x3'));var router=express['Router']();var fs_extra=require(_0x853f('0x4'));var auth=require(_0x853f('0x5'));var interaction=require(_0x853f('0x6'));var config=require(_0x853f('0x7'));var controller=require(_0x853f('0x8'));router[_0x853f('0x9')]('/',auth[_0x853f('0xa')](),controller[_0x853f('0xb')]);router[_0x853f('0x9')](_0x853f('0xc'),auth['isAuthenticated'](),controller['show']);router['post']('/',auth['isAuthenticated'](),controller[_0x853f('0xd')]);router[_0x853f('0xe')](_0x853f('0xc'),auth[_0x853f('0xa')](),controller['update']);router[_0x853f('0xf')](_0x853f('0xc'),auth['isAuthenticated'](),controller['destroy']);module[_0x853f('0x10')]=router; \ No newline at end of file diff --git a/server/api/pause/pause.attributes.js b/server/api/pause/pause.attributes.js index d535189..2ec95fd 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 _0x198a=['STRING'];(function(_0x1be6ed,_0x5ce971){var _0x2c08de=function(_0x3f6772){while(--_0x3f6772){_0x1be6ed['push'](_0x1be6ed['shift']());}};_0x2c08de(++_0x5ce971);}(_0x198a,0x12d));var _0xa198=function(_0x2838dd,_0x44832b){_0x2838dd=_0x2838dd-0x0;var _0x3ddfb7=_0x198a[_0x2838dd];return _0x3ddfb7;};'use strict';var Sequelize=require('sequelize');module['exports']={'name':{'type':Sequelize[_0xa198('0x0')],'unique':'name','allowNull':![]},'description':{'type':Sequelize[_0xa198('0x0')]}}; \ No newline at end of file +var _0x2787=['exports','STRING','name','sequelize'];(function(_0x500c7d,_0x1584ab){var _0x560f26=function(_0x2cca85){while(--_0x2cca85){_0x500c7d['push'](_0x500c7d['shift']());}};_0x560f26(++_0x1584ab);}(_0x2787,0xab));var _0x7278=function(_0x17d9e3,_0x1f969c){_0x17d9e3=_0x17d9e3-0x0;var _0x14192d=_0x2787[_0x17d9e3];return _0x14192d;};'use strict';var Sequelize=require(_0x7278('0x0'));module[_0x7278('0x1')]={'name':{'type':Sequelize[_0x7278('0x2')],'unique':_0x7278('0x3'),'allowNull':![]},'description':{'type':Sequelize[_0x7278('0x2')]}}; \ No newline at end of file diff --git a/server/api/pause/pause.controller.js b/server/api/pause/pause.controller.js index 50662f7..b7084ad 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 _0x3575=['../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','limit','undefined','count','set','Content-Range','apply','save','update','then','get','Pauses','UserProfileResource','destroy','error','stack','name','index','map','Pause','rawAttributes','fieldName','type','key','model','query','keys','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','filters','pick','filter','merge','options','includeAll','include','findAll','show','params','intersection','find','catch','create','Unable\x20to\x20retrieve\x20the\x20current\x20user','user','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','eml-format','rimraf','zip-dir','fast-json-patch','bluebird','mustache','util','path','sox','ejs','lodash','squel','crypto','jsforce','desk.js','to-csv','querystring','papaparse','../../components/parsers/advancedSearch','../../config/license/hardware'];(function(_0x575b5e,_0x369ce9){var _0x3110b6=function(_0x3371cb){while(--_0x3371cb){_0x575b5e['push'](_0x575b5e['shift']());}};_0x3110b6(++_0x369ce9);}(_0x3575,0x1ea));var _0x5357=function(_0x5dde9b,_0x203652){_0x5dde9b=_0x5dde9b-0x0;var _0x315c22=_0x3575[_0x5dde9b];return _0x315c22;};'use strict';var emlformat=require(_0x5357('0x0'));var rimraf=require(_0x5357('0x1'));var zipdir=require(_0x5357('0x2'));var jsonpatch=require(_0x5357('0x3'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0x5357('0x4'));var Mustache=require(_0x5357('0x5'));var util=require(_0x5357('0x6'));var path=require(_0x5357('0x7'));var sox=require(_0x5357('0x8'));var csv=require('to-csv');var ejs=require(_0x5357('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x5357('0xa'));var squel=require(_0x5357('0xb'));var crypto=require(_0x5357('0xc'));var jsforce=require(_0x5357('0xd'));var deskjs=require(_0x5357('0xe'));var toCsv=require(_0x5357('0xf'));var querystring=require(_0x5357('0x10'));var Papa=require(_0x5357('0x11'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0x5357('0x12'));var hardwareService=require(_0x5357('0x13'));var logger=require(_0x5357('0x14'))(_0x5357('0x15'));var utils=require(_0x5357('0x16'));var config=require('../../config/environment');var licenseUtil=require(_0x5357('0x17'));var db=require(_0x5357('0x18'))['db'];function respondWithStatusCode(_0x485aee,_0x4769e8){_0x4769e8=_0x4769e8||0xcc;return function(_0x1f1156){if(_0x1f1156){return _0x485aee[_0x5357('0x19')](_0x4769e8);}return _0x485aee[_0x5357('0x1a')](_0x4769e8)[_0x5357('0x1b')]();};}function respondWithResult(_0x45940a,_0x350b4f){_0x350b4f=_0x350b4f||0xc8;return function(_0x258b61){if(_0x258b61){return _0x45940a[_0x5357('0x1a')](_0x350b4f)[_0x5357('0x1c')](_0x258b61);}};}function respondWithFilteredResult(_0x357707,_0x301c65){return function(_0x5afbe5){if(_0x5afbe5){var _0x5babfa=typeof _0x301c65[_0x5357('0x1d')]==='undefined'&&typeof _0x301c65[_0x5357('0x1e')]===_0x5357('0x1f');var _0xd40021=_0x5afbe5[_0x5357('0x20')];var _0x38d254=_0x5babfa?0x0:_0x301c65[_0x5357('0x1d')];var _0x31a801=_0x5babfa?_0x5afbe5[_0x5357('0x20')]:_0x301c65[_0x5357('0x1d')]+_0x301c65[_0x5357('0x1e')];var _0x1600a7;if(_0x31a801>=_0xd40021){_0x31a801=_0xd40021;_0x1600a7=0xc8;}else{_0x1600a7=0xce;}_0x357707[_0x5357('0x1a')](_0x1600a7);return _0x357707[_0x5357('0x21')](_0x5357('0x22'),_0x38d254+'-'+_0x31a801+'/'+_0xd40021)['json'](_0x5afbe5);}return null;};}function patchUpdates(_0x479b72){return function(_0x40fea4){try{jsonpatch[_0x5357('0x23')](_0x40fea4,_0x479b72,!![]);}catch(_0x3a1157){return BPromise['reject'](_0x3a1157);}return _0x40fea4[_0x5357('0x24')]();};}function saveUpdates(_0x16b955,_0x2369cc){return function(_0x48d55d){if(_0x48d55d){return _0x48d55d[_0x5357('0x25')](_0x16b955)['then'](function(_0x482bbf){return _0x482bbf;});}return null;};}function removeEntity(_0x5d8b25,_0x2e8507){return function(_0x7486d4){if(_0x7486d4){return _0x7486d4['destroy']()[_0x5357('0x26')](function(){var _0x28283b=_0x7486d4[_0x5357('0x27')]({'plain':!![]});var _0x4939e3=_0x5357('0x28');return db[_0x5357('0x29')][_0x5357('0x2a')]({'where':{'type':_0x4939e3,'resourceId':_0x28283b['id']}})['then'](function(){return _0x7486d4;});})[_0x5357('0x26')](function(){_0x5d8b25[_0x5357('0x1a')](0xcc)[_0x5357('0x1b')]();});}};}function handleEntityNotFound(_0x6036e9,_0x32d871){return function(_0x328a54){if(!_0x328a54){_0x6036e9[_0x5357('0x19')](0x194);}return _0x328a54;};}function handleError(_0x2fc3a1,_0x1e6f4a){_0x1e6f4a=_0x1e6f4a||0x1f4;return function(_0x5469cf){logger[_0x5357('0x2b')](_0x5469cf[_0x5357('0x2c')]);if(_0x5469cf[_0x5357('0x2d')]){delete _0x5469cf[_0x5357('0x2d')];}_0x2fc3a1[_0x5357('0x1a')](_0x1e6f4a)['send'](_0x5469cf);};}exports[_0x5357('0x2e')]=function(_0x25975e,_0x470ec1){var _0x30435d={},_0x4dc1d9={},_0x9144ec={'count':0x0,'rows':[]};var _0x5558a2=_[_0x5357('0x2f')](db[_0x5357('0x30')][_0x5357('0x31')],function(_0x52c6b7){return{'name':_0x52c6b7[_0x5357('0x32')],'type':_0x52c6b7[_0x5357('0x33')][_0x5357('0x34')]};});_0x4dc1d9[_0x5357('0x35')]=_[_0x5357('0x2f')](_0x5558a2,_0x5357('0x2d'));_0x4dc1d9[_0x5357('0x36')]=_[_0x5357('0x37')](_0x25975e[_0x5357('0x36')]);_0x4dc1d9['filters']=_['intersection'](_0x4dc1d9[_0x5357('0x35')],_0x4dc1d9[_0x5357('0x36')]);_0x30435d['attributes']=_['intersection'](_0x4dc1d9[_0x5357('0x35')],qs[_0x5357('0x38')](_0x25975e[_0x5357('0x36')][_0x5357('0x38')]));_0x30435d[_0x5357('0x39')]=_0x30435d[_0x5357('0x39')][_0x5357('0x3a')]?_0x30435d[_0x5357('0x39')]:_0x4dc1d9[_0x5357('0x35')];if(!_0x25975e[_0x5357('0x36')][_0x5357('0x3b')](_0x5357('0x3c'))){_0x30435d[_0x5357('0x1e')]=qs[_0x5357('0x1e')](_0x25975e[_0x5357('0x36')][_0x5357('0x1e')]);_0x30435d[_0x5357('0x1d')]=qs[_0x5357('0x1d')](_0x25975e[_0x5357('0x36')]['offset']);}_0x30435d[_0x5357('0x3d')]=qs[_0x5357('0x3e')](_0x25975e['query'][_0x5357('0x3e')]);_0x30435d[_0x5357('0x3f')]=qs[_0x5357('0x40')](_[_0x5357('0x41')](_0x25975e[_0x5357('0x36')],_0x4dc1d9[_0x5357('0x40')]),_0x5558a2);if(_0x25975e[_0x5357('0x36')][_0x5357('0x42')]){_0x30435d[_0x5357('0x3f')]=_[_0x5357('0x43')](_0x30435d[_0x5357('0x3f')],{'$or':_['map'](_0x5558a2,function(_0x2d48c7){if(_0x2d48c7[_0x5357('0x33')]!=='VIRTUAL'){var _0x3f0252={};_0x3f0252[_0x2d48c7[_0x5357('0x2d')]]={'$like':'%'+_0x25975e[_0x5357('0x36')][_0x5357('0x42')]+'%'};return _0x3f0252;}})});}_0x30435d=_[_0x5357('0x43')]({},_0x30435d,_0x25975e[_0x5357('0x44')]);var _0x3b599c={'where':_0x30435d['where']};return db['Pause'][_0x5357('0x20')](_0x3b599c)[_0x5357('0x26')](function(_0x41386d){_0x9144ec[_0x5357('0x20')]=_0x41386d;if(_0x25975e[_0x5357('0x36')][_0x5357('0x45')]){_0x30435d[_0x5357('0x46')]=[{'all':!![]}];}return db[_0x5357('0x30')][_0x5357('0x47')](_0x30435d);})[_0x5357('0x26')](function(_0x34caca){_0x9144ec['rows']=_0x34caca;return _0x9144ec;})[_0x5357('0x26')](respondWithFilteredResult(_0x470ec1,_0x30435d))['catch'](handleError(_0x470ec1,null));};exports[_0x5357('0x48')]=function(_0x309f32,_0x49292e){var _0x358191={'raw':!![],'where':{'id':_0x309f32[_0x5357('0x49')]['id']}},_0x4d01f1={};_0x4d01f1[_0x5357('0x35')]=_[_0x5357('0x37')](db[_0x5357('0x30')]['rawAttributes']);_0x4d01f1[_0x5357('0x36')]=_['keys'](_0x309f32[_0x5357('0x36')]);_0x4d01f1[_0x5357('0x40')]=_[_0x5357('0x4a')](_0x4d01f1[_0x5357('0x35')],_0x4d01f1['query']);_0x358191['attributes']=_[_0x5357('0x4a')](_0x4d01f1[_0x5357('0x35')],qs[_0x5357('0x38')](_0x309f32[_0x5357('0x36')][_0x5357('0x38')]));_0x358191[_0x5357('0x39')]=_0x358191['attributes'][_0x5357('0x3a')]?_0x358191[_0x5357('0x39')]:_0x4d01f1['model'];if(_0x309f32[_0x5357('0x36')][_0x5357('0x45')]){_0x358191[_0x5357('0x46')]=[{'all':!![]}];}_0x358191=_[_0x5357('0x43')]({},_0x358191,_0x309f32[_0x5357('0x44')]);return db[_0x5357('0x30')][_0x5357('0x4b')](_0x358191)['then'](handleEntityNotFound(_0x49292e,null))[_0x5357('0x26')](respondWithResult(_0x49292e,null))[_0x5357('0x4c')](handleError(_0x49292e,null));};exports[_0x5357('0x4d')]=function(_0xe6ab6e,_0x5ae9a6){return db['Pause'][_0x5357('0x4d')](_0xe6ab6e['body'],{})['then'](function(_0x2648a){var _0x14ce5d=_0xe6ab6e['user'][_0x5357('0x27')]({'plain':!![]});if(!_0x14ce5d)throw new Error(_0x5357('0x4e'));if(_0x14ce5d['role']===_0x5357('0x4f')){var _0x319fee=_0x2648a['get']({'plain':!![]});var _0x4442a3='Pauses';return db[_0x5357('0x50')][_0x5357('0x4b')]({'where':{'name':_0x4442a3,'userProfileId':_0x14ce5d[_0x5357('0x51')]},'raw':!![]})[_0x5357('0x26')](function(_0x28a119){if(_0x28a119&&_0x28a119[_0x5357('0x52')]===0x0){return db[_0x5357('0x29')]['create']({'name':_0x319fee[_0x5357('0x2d')],'resourceId':_0x319fee['id'],'type':_0x28a119[_0x5357('0x2d')],'sectionId':_0x28a119['id']},{})[_0x5357('0x26')](function(){return _0x2648a;});}else{return _0x2648a;}})[_0x5357('0x4c')](function(_0x3d135a){logger[_0x5357('0x2b')](_0x5357('0x53'),_0x3d135a);throw _0x3d135a;});}return _0x2648a;})[_0x5357('0x26')](respondWithResult(_0x5ae9a6,0xc9))[_0x5357('0x4c')](handleError(_0x5ae9a6,null));};exports[_0x5357('0x25')]=function(_0x48f4ee,_0x3b84f1){if(_0x48f4ee[_0x5357('0x54')]['id']){delete _0x48f4ee[_0x5357('0x54')]['id'];}return db[_0x5357('0x30')][_0x5357('0x4b')]({'where':{'id':_0x48f4ee[_0x5357('0x49')]['id']}})[_0x5357('0x26')](handleEntityNotFound(_0x3b84f1,null))[_0x5357('0x26')](saveUpdates(_0x48f4ee['body'],null))[_0x5357('0x26')](respondWithResult(_0x3b84f1,null))[_0x5357('0x4c')](handleError(_0x3b84f1,null));};exports[_0x5357('0x2a')]=function(_0x511fd8,_0x48ff89){return db[_0x5357('0x30')][_0x5357('0x4b')]({'where':{'id':_0x511fd8['params']['id']}})['then'](handleEntityNotFound(_0x48ff89,null))[_0x5357('0x26')](removeEntity(_0x48ff89,null))[_0x5357('0x4c')](handleError(_0x48ff89,null));}; \ No newline at end of file +var _0x74d4=['name','send','index','map','Pause','rawAttributes','fieldName','type','key','model','query','keys','filters','attributes','intersection','fields','length','hasOwnProperty','nolimit','order','sort','pick','where','merge','VIRTUAL','filter','includeAll','include','catch','show','params','options','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','Pauses','UserProfileSection','userProfileId','autoAssociation','UserProfileResource','eml-format','zip-dir','request-promise','moment','bluebird','mustache','util','path','ejs','lodash','squel','crypto','jsforce','desk.js','to-csv','papaparse','ioredis','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','then','destroy','get','error','stack'];(function(_0x194370,_0x3ed0e6){var _0x32e21d=function(_0x564422){while(--_0x564422){_0x194370['push'](_0x194370['shift']());}};_0x32e21d(++_0x3ed0e6);}(_0x74d4,0x17f));var _0x474d=function(_0x11fd21,_0x2ece18){_0x11fd21=_0x11fd21-0x0;var _0x4a209b=_0x74d4[_0x11fd21];return _0x4a209b;};'use strict';var emlformat=require(_0x474d('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x474d('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0x474d('0x2'));var moment=require(_0x474d('0x3'));var BPromise=require(_0x474d('0x4'));var Mustache=require(_0x474d('0x5'));var util=require(_0x474d('0x6'));var path=require(_0x474d('0x7'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0x474d('0x8'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x474d('0x9'));var squel=require(_0x474d('0xa'));var crypto=require(_0x474d('0xb'));var jsforce=require(_0x474d('0xc'));var deskjs=require(_0x474d('0xd'));var toCsv=require(_0x474d('0xe'));var querystring=require('querystring');var Papa=require(_0x474d('0xf'));var Redis=require(_0x474d('0x10'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0x474d('0x11'));var hardwareService=require(_0x474d('0x12'));var logger=require(_0x474d('0x13'))(_0x474d('0x14'));var utils=require('../../config/utils');var config=require(_0x474d('0x15'));var licenseUtil=require(_0x474d('0x16'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x156e51,_0x10d1a8){_0x10d1a8=_0x10d1a8||0xcc;return function(_0x447db1){if(_0x447db1){return _0x156e51[_0x474d('0x17')](_0x10d1a8);}return _0x156e51[_0x474d('0x18')](_0x10d1a8)[_0x474d('0x19')]();};}function respondWithResult(_0x57eb3b,_0x5c6aac){_0x5c6aac=_0x5c6aac||0xc8;return function(_0x31ff2f){if(_0x31ff2f){return _0x57eb3b[_0x474d('0x18')](_0x5c6aac)[_0x474d('0x1a')](_0x31ff2f);}};}function respondWithFilteredResult(_0x27cca9,_0x261f8b){return function(_0x2c528e){if(_0x2c528e){var _0x543b8c=typeof _0x261f8b[_0x474d('0x1b')]===_0x474d('0x1c')&&typeof _0x261f8b[_0x474d('0x1d')]==='undefined';var _0x20d76e=_0x2c528e[_0x474d('0x1e')];var _0xe4e779=_0x543b8c?0x0:_0x261f8b[_0x474d('0x1b')];var _0xc6e2ee=_0x543b8c?_0x2c528e[_0x474d('0x1e')]:_0x261f8b[_0x474d('0x1b')]+_0x261f8b['limit'];var _0x4c65af;if(_0xc6e2ee>=_0x20d76e){_0xc6e2ee=_0x20d76e;_0x4c65af=0xc8;}else{_0x4c65af=0xce;}_0x27cca9[_0x474d('0x18')](_0x4c65af);return _0x27cca9[_0x474d('0x1f')](_0x474d('0x20'),_0xe4e779+'-'+_0xc6e2ee+'/'+_0x20d76e)['json'](_0x2c528e);}return null;};}function patchUpdates(_0x4058a0){return function(_0x30484a){try{jsonpatch[_0x474d('0x21')](_0x30484a,_0x4058a0,!![]);}catch(_0x31b1bc){return BPromise[_0x474d('0x22')](_0x31b1bc);}return _0x30484a[_0x474d('0x23')]();};}function saveUpdates(_0x4bbef3,_0x2d7fcb){return function(_0x92e608){if(_0x92e608){return _0x92e608[_0x474d('0x24')](_0x4bbef3)[_0x474d('0x25')](function(_0x41cd32){return _0x41cd32;});}return null;};}function removeEntity(_0x1a0fb1,_0x8323a4){return function(_0xaf2d3c){if(_0xaf2d3c){return _0xaf2d3c[_0x474d('0x26')]()[_0x474d('0x25')](function(){var _0x14db58=_0xaf2d3c[_0x474d('0x27')]({'plain':!![]});var _0x5247bd='Pauses';return db['UserProfileResource'][_0x474d('0x26')]({'where':{'type':_0x5247bd,'resourceId':_0x14db58['id']}})[_0x474d('0x25')](function(){return _0xaf2d3c;});})[_0x474d('0x25')](function(){_0x1a0fb1[_0x474d('0x18')](0xcc)[_0x474d('0x19')]();});}};}function handleEntityNotFound(_0x154b67,_0x3a9e7e){return function(_0x3e5afa){if(!_0x3e5afa){_0x154b67['sendStatus'](0x194);}return _0x3e5afa;};}function handleError(_0x546850,_0xbddfc7){_0xbddfc7=_0xbddfc7||0x1f4;return function(_0x50b228){logger[_0x474d('0x28')](_0x50b228[_0x474d('0x29')]);if(_0x50b228[_0x474d('0x2a')]){delete _0x50b228['name'];}_0x546850[_0x474d('0x18')](_0xbddfc7)[_0x474d('0x2b')](_0x50b228);};}exports[_0x474d('0x2c')]=function(_0xc1709d,_0x542fdc){var _0x2bf7c1={},_0x5d1f3a={},_0x22f1bd={'count':0x0,'rows':[]};var _0x101a61=_[_0x474d('0x2d')](db[_0x474d('0x2e')][_0x474d('0x2f')],function(_0x11d533){return{'name':_0x11d533[_0x474d('0x30')],'type':_0x11d533[_0x474d('0x31')][_0x474d('0x32')]};});_0x5d1f3a[_0x474d('0x33')]=_[_0x474d('0x2d')](_0x101a61,'name');_0x5d1f3a[_0x474d('0x34')]=_[_0x474d('0x35')](_0xc1709d['query']);_0x5d1f3a[_0x474d('0x36')]=_['intersection'](_0x5d1f3a[_0x474d('0x33')],_0x5d1f3a[_0x474d('0x34')]);_0x2bf7c1[_0x474d('0x37')]=_[_0x474d('0x38')](_0x5d1f3a[_0x474d('0x33')],qs[_0x474d('0x39')](_0xc1709d[_0x474d('0x34')][_0x474d('0x39')]));_0x2bf7c1[_0x474d('0x37')]=_0x2bf7c1[_0x474d('0x37')][_0x474d('0x3a')]?_0x2bf7c1[_0x474d('0x37')]:_0x5d1f3a[_0x474d('0x33')];if(!_0xc1709d[_0x474d('0x34')][_0x474d('0x3b')](_0x474d('0x3c'))){_0x2bf7c1[_0x474d('0x1d')]=qs['limit'](_0xc1709d[_0x474d('0x34')]['limit']);_0x2bf7c1[_0x474d('0x1b')]=qs['offset'](_0xc1709d['query'][_0x474d('0x1b')]);}_0x2bf7c1[_0x474d('0x3d')]=qs['sort'](_0xc1709d[_0x474d('0x34')][_0x474d('0x3e')]);_0x2bf7c1['where']=qs['filters'](_[_0x474d('0x3f')](_0xc1709d[_0x474d('0x34')],_0x5d1f3a[_0x474d('0x36')]),_0x101a61);if(_0xc1709d[_0x474d('0x34')]['filter']){_0x2bf7c1[_0x474d('0x40')]=_[_0x474d('0x41')](_0x2bf7c1[_0x474d('0x40')],{'$or':_['map'](_0x101a61,function(_0x1691e6){if(_0x1691e6[_0x474d('0x31')]!==_0x474d('0x42')){var _0x3fa55c={};_0x3fa55c[_0x1691e6['name']]={'$like':'%'+_0xc1709d['query'][_0x474d('0x43')]+'%'};return _0x3fa55c;}})});}_0x2bf7c1=_[_0x474d('0x41')]({},_0x2bf7c1,_0xc1709d['options']);var _0x120487={'where':_0x2bf7c1[_0x474d('0x40')]};return db[_0x474d('0x2e')][_0x474d('0x1e')](_0x120487)[_0x474d('0x25')](function(_0x5ecf17){_0x22f1bd[_0x474d('0x1e')]=_0x5ecf17;if(_0xc1709d[_0x474d('0x34')][_0x474d('0x44')]){_0x2bf7c1[_0x474d('0x45')]=[{'all':!![]}];}return db[_0x474d('0x2e')]['findAll'](_0x2bf7c1);})['then'](function(_0x23a15e){_0x22f1bd['rows']=_0x23a15e;return _0x22f1bd;})[_0x474d('0x25')](respondWithFilteredResult(_0x542fdc,_0x2bf7c1))[_0x474d('0x46')](handleError(_0x542fdc,null));};exports[_0x474d('0x47')]=function(_0x28e616,_0x44cc22){var _0x4d2ede={'raw':!![],'where':{'id':_0x28e616[_0x474d('0x48')]['id']}},_0x2dd828={};_0x2dd828['model']=_[_0x474d('0x35')](db[_0x474d('0x2e')][_0x474d('0x2f')]);_0x2dd828[_0x474d('0x34')]=_[_0x474d('0x35')](_0x28e616[_0x474d('0x34')]);_0x2dd828[_0x474d('0x36')]=_[_0x474d('0x38')](_0x2dd828[_0x474d('0x33')],_0x2dd828[_0x474d('0x34')]);_0x4d2ede[_0x474d('0x37')]=_[_0x474d('0x38')](_0x2dd828[_0x474d('0x33')],qs[_0x474d('0x39')](_0x28e616['query'][_0x474d('0x39')]));_0x4d2ede['attributes']=_0x4d2ede[_0x474d('0x37')][_0x474d('0x3a')]?_0x4d2ede[_0x474d('0x37')]:_0x2dd828[_0x474d('0x33')];if(_0x28e616[_0x474d('0x34')]['includeAll']){_0x4d2ede[_0x474d('0x45')]=[{'all':!![]}];}_0x4d2ede=_[_0x474d('0x41')]({},_0x4d2ede,_0x28e616[_0x474d('0x49')]);return db['Pause'][_0x474d('0x4a')](_0x4d2ede)[_0x474d('0x25')](handleEntityNotFound(_0x44cc22,null))[_0x474d('0x25')](respondWithResult(_0x44cc22,null))['catch'](handleError(_0x44cc22,null));};exports[_0x474d('0x4b')]=function(_0xb12c39,_0xa985d5){return db[_0x474d('0x2e')][_0x474d('0x4b')](_0xb12c39[_0x474d('0x4c')],{})['then'](function(_0x125539){var _0x94c34e=_0xb12c39[_0x474d('0x4d')][_0x474d('0x27')]({'plain':!![]});if(!_0x94c34e)throw new Error(_0x474d('0x4e'));if(_0x94c34e[_0x474d('0x4f')]===_0x474d('0x4d')){var _0x42240c=_0x125539[_0x474d('0x27')]({'plain':!![]});var _0x520dc0=_0x474d('0x50');return db[_0x474d('0x51')][_0x474d('0x4a')]({'where':{'name':_0x520dc0,'userProfileId':_0x94c34e[_0x474d('0x52')]},'raw':!![]})['then'](function(_0x2073b8){if(_0x2073b8&&_0x2073b8[_0x474d('0x53')]===0x0){return db[_0x474d('0x54')]['create']({'name':_0x42240c[_0x474d('0x2a')],'resourceId':_0x42240c['id'],'type':_0x2073b8['name'],'sectionId':_0x2073b8['id']},{})[_0x474d('0x25')](function(){return _0x125539;});}else{return _0x125539;}})[_0x474d('0x46')](function(_0x31ea16){logger[_0x474d('0x28')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x31ea16);throw _0x31ea16;});}return _0x125539;})[_0x474d('0x25')](respondWithResult(_0xa985d5,0xc9))['catch'](handleError(_0xa985d5,null));};exports[_0x474d('0x24')]=function(_0x4a73bb,_0x1a2a53){if(_0x4a73bb[_0x474d('0x4c')]['id']){delete _0x4a73bb[_0x474d('0x4c')]['id'];}return db['Pause']['find']({'where':{'id':_0x4a73bb[_0x474d('0x48')]['id']}})[_0x474d('0x25')](handleEntityNotFound(_0x1a2a53,null))['then'](saveUpdates(_0x4a73bb[_0x474d('0x4c')],null))[_0x474d('0x25')](respondWithResult(_0x1a2a53,null))[_0x474d('0x46')](handleError(_0x1a2a53,null));};exports[_0x474d('0x26')]=function(_0x19ca71,_0x1a2574){return db['Pause']['find']({'where':{'id':_0x19ca71['params']['id']}})['then'](handleEntityNotFound(_0x1a2574,null))[_0x474d('0x25')](removeEntity(_0x1a2574,null))[_0x474d('0x46')](handleError(_0x1a2574,null));}; \ No newline at end of file diff --git a/server/api/pause/pause.model.js b/server/api/pause/pause.model.js index 4407f36..7a11b37 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 _0x1cb9=['./pause.attributes','exports','define','Pause','lodash','../../config/logger','api','moment','bluebird','path','rimraf'];(function(_0x19b083,_0x5a3b02){var _0x4b8428=function(_0x5ab4d0){while(--_0x5ab4d0){_0x19b083['push'](_0x19b083['shift']());}};_0x4b8428(++_0x5a3b02);}(_0x1cb9,0x14e));var _0x91cb=function(_0x3dcee8,_0x38beb0){_0x3dcee8=_0x3dcee8-0x0;var _0x3a2390=_0x1cb9[_0x3dcee8];return _0x3a2390;};'use strict';var _=require(_0x91cb('0x0'));var util=require('util');var logger=require(_0x91cb('0x1'))(_0x91cb('0x2'));var moment=require(_0x91cb('0x3'));var BPromise=require(_0x91cb('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x91cb('0x5'));var rimraf=require(_0x91cb('0x6'));var config=require('../../config/environment');var attributes=require(_0x91cb('0x7'));module[_0x91cb('0x8')]=function(_0x186dc3,_0x28543e){return _0x186dc3[_0x91cb('0x9')](_0x91cb('0xa'),attributes,{'tableName':'tools_pauses','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x7fbe=['../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./pause.attributes','exports','define','Pause'];(function(_0x122ef9,_0x451d2a){var _0x42fba0=function(_0x17c9d3){while(--_0x17c9d3){_0x122ef9['push'](_0x122ef9['shift']());}};_0x42fba0(++_0x451d2a);}(_0x7fbe,0x1ec));var _0xe7fb=function(_0x324d02,_0x6d9c0b){_0x324d02=_0x324d02-0x0;var _0x3d4f59=_0x7fbe[_0x324d02];return _0x3d4f59;};'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':'tools_pauses','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/pause/pause.rpc.js b/server/api/pause/pause.rpc.js index 8b591cb..b31b485 100644 --- a/server/api/pause/pause.rpc.js +++ b/server/api/pause/pause.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x7a54=['message','request\x20sent','result','catch','Pause','find','options','raw','where','attributes','map','include','model','ShowPause','lodash','util','moment','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','info','Pause,\x20%s,\x20%s','debug','stringify','error','code'];(function(_0x57a95a,_0x1a5e2e){var _0x114915=function(_0x45014d){while(--_0x45014d){_0x57a95a['push'](_0x57a95a['shift']());}};_0x114915(++_0x1a5e2e);}(_0x7a54,0x106));var _0x47a5=function(_0x41381a,_0x198478){_0x41381a=_0x41381a-0x0;var _0x72d30b=_0x7a54[_0x41381a];return _0x72d30b;};'use strict';var _=require(_0x47a5('0x0'));var util=require(_0x47a5('0x1'));var moment=require(_0x47a5('0x2'));var BPromise=require('bluebird');var rs=require(_0x47a5('0x3'));var fs=require('fs');var Redis=require(_0x47a5('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x47a5('0x5'));var logger=require(_0x47a5('0x6'))(_0x47a5('0x7'));var config=require(_0x47a5('0x8'));var jayson=require(_0x47a5('0x9'));var client=jayson['client'][_0x47a5('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x59199c,_0x343372,_0x30e405){return new BPromise(function(_0x506eda,_0x194fb0){return client['request'](_0x59199c,_0x30e405)['then'](function(_0x582352){logger[_0x47a5('0xb')](_0x47a5('0xc'),_0x343372,'request\x20sent');logger[_0x47a5('0xd')]('Pause,\x20%s,\x20%s,\x20%s',_0x343372,'request\x20sent',JSON[_0x47a5('0xe')](_0x582352));if(_0x582352[_0x47a5('0xf')]){if(_0x582352[_0x47a5('0xf')][_0x47a5('0x10')]===0x1f4){logger[_0x47a5('0xf')](_0x47a5('0xc'),_0x343372,_0x582352[_0x47a5('0xf')]['message']);return _0x194fb0(_0x582352[_0x47a5('0xf')][_0x47a5('0x11')]);}logger[_0x47a5('0xf')](_0x47a5('0xc'),_0x343372,_0x582352[_0x47a5('0xf')][_0x47a5('0x11')]);return _0x506eda(_0x582352[_0x47a5('0xf')][_0x47a5('0x11')]);}else{logger['info'](_0x47a5('0xc'),_0x343372,_0x47a5('0x12'));_0x506eda(_0x582352[_0x47a5('0x13')][_0x47a5('0x11')]);}})[_0x47a5('0x14')](function(_0x574af6){logger['error'](_0x47a5('0xc'),_0x343372,_0x574af6);_0x194fb0(_0x574af6);});});}exports['ShowPause']=function(_0x5247fd){var _0x423a81=this;return new Promise(function(_0xaf70a6,_0x2ce454){return db[_0x47a5('0x15')][_0x47a5('0x16')]({'raw':_0x5247fd[_0x47a5('0x17')]?_0x5247fd[_0x47a5('0x17')][_0x47a5('0x18')]===undefined?!![]:![]:!![],'where':_0x5247fd[_0x47a5('0x17')]?_0x5247fd['options'][_0x47a5('0x19')]||null:null,'attributes':_0x5247fd[_0x47a5('0x17')]?_0x5247fd['options'][_0x47a5('0x1a')]||null:null,'include':_0x5247fd[_0x47a5('0x17')]?_0x5247fd[_0x47a5('0x17')]['include']?_[_0x47a5('0x1b')](_0x5247fd[_0x47a5('0x17')][_0x47a5('0x1c')],function(_0x7a9f9e){return{'model':db[_0x7a9f9e['model']],'as':_0x7a9f9e['as'],'attributes':_0x7a9f9e[_0x47a5('0x1a')],'include':_0x7a9f9e[_0x47a5('0x1c')]?_['map'](_0x7a9f9e[_0x47a5('0x1c')],function(_0xc4cd63){return{'model':db[_0xc4cd63[_0x47a5('0x1d')]],'as':_0xc4cd63['as'],'attributes':_0xc4cd63[_0x47a5('0x1a')],'include':_0xc4cd63[_0x47a5('0x1c')]?_['map'](_0xc4cd63['include'],function(_0x136745){return{'model':db[_0x136745['model']],'as':_0x136745['as'],'attributes':_0x136745[_0x47a5('0x1a')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x23cb77){logger[_0x47a5('0xb')](_0x47a5('0x1e'),_0x5247fd);logger[_0x47a5('0xd')](_0x47a5('0x1e'),_0x5247fd,JSON[_0x47a5('0xe')](_0x23cb77));_0xaf70a6(_0x23cb77);})[_0x47a5('0x14')](function(_0x136b14){logger[_0x47a5('0xf')](_0x47a5('0x1e'),_0x136b14[_0x47a5('0x11')],_0x5247fd);_0x2ce454(_0x423a81[_0x47a5('0xf')](0x1f4,_0x136b14[_0x47a5('0x11')]));});});}; \ No newline at end of file +var _0xb10b=['catch','lodash','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','then','info','Pause,\x20%s,\x20%s','Pause,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','message','result','ShowPause','Pause','find','options','raw','where','attributes','map','include','model','debug'];(function(_0x13f73e,_0x3c2643){var _0x3225a1=function(_0x1de2ac){while(--_0x1de2ac){_0x13f73e['push'](_0x13f73e['shift']());}};_0x3225a1(++_0x3c2643);}(_0xb10b,0x12a));var _0xbb10=function(_0xffa302,_0xfd695c){_0xffa302=_0xffa302-0x0;var _0x38ea4b=_0xb10b[_0xffa302];return _0x38ea4b;};'use strict';var _=require(_0xbb10('0x0'));var util=require('util');var moment=require(_0xbb10('0x1'));var BPromise=require(_0xbb10('0x2'));var rs=require(_0xbb10('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xbb10('0x4'))['db'];var utils=require(_0xbb10('0x5'));var logger=require(_0xbb10('0x6'))(_0xbb10('0x7'));var config=require(_0xbb10('0x8'));var jayson=require(_0xbb10('0x9'));var client=jayson['client'][_0xbb10('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x3cdd53,_0x513741,_0x1b9e94){return new BPromise(function(_0x3fb675,_0x21370f){return client[_0xbb10('0xb')](_0x3cdd53,_0x1b9e94)[_0xbb10('0xc')](function(_0x1ce33e){logger[_0xbb10('0xd')](_0xbb10('0xe'),_0x513741,'request\x20sent');logger['debug'](_0xbb10('0xf'),_0x513741,_0xbb10('0x10'),JSON[_0xbb10('0x11')](_0x1ce33e));if(_0x1ce33e['error']){if(_0x1ce33e[_0xbb10('0x12')]['code']===0x1f4){logger[_0xbb10('0x12')](_0xbb10('0xe'),_0x513741,_0x1ce33e[_0xbb10('0x12')][_0xbb10('0x13')]);return _0x21370f(_0x1ce33e[_0xbb10('0x12')][_0xbb10('0x13')]);}logger['error'](_0xbb10('0xe'),_0x513741,_0x1ce33e[_0xbb10('0x12')][_0xbb10('0x13')]);return _0x3fb675(_0x1ce33e[_0xbb10('0x12')][_0xbb10('0x13')]);}else{logger[_0xbb10('0xd')](_0xbb10('0xe'),_0x513741,_0xbb10('0x10'));_0x3fb675(_0x1ce33e[_0xbb10('0x14')][_0xbb10('0x13')]);}})['catch'](function(_0x2eca0f){logger[_0xbb10('0x12')](_0xbb10('0xe'),_0x513741,_0x2eca0f);_0x21370f(_0x2eca0f);});});}exports[_0xbb10('0x15')]=function(_0x378da8){var _0x1682a4=this;return new Promise(function(_0x575cca,_0x30efc6){return db[_0xbb10('0x16')][_0xbb10('0x17')]({'raw':_0x378da8['options']?_0x378da8[_0xbb10('0x18')][_0xbb10('0x19')]===undefined?!![]:![]:!![],'where':_0x378da8[_0xbb10('0x18')]?_0x378da8[_0xbb10('0x18')][_0xbb10('0x1a')]||null:null,'attributes':_0x378da8[_0xbb10('0x18')]?_0x378da8['options'][_0xbb10('0x1b')]||null:null,'include':_0x378da8[_0xbb10('0x18')]?_0x378da8['options']['include']?_[_0xbb10('0x1c')](_0x378da8[_0xbb10('0x18')][_0xbb10('0x1d')],function(_0x317da4){return{'model':db[_0x317da4[_0xbb10('0x1e')]],'as':_0x317da4['as'],'attributes':_0x317da4[_0xbb10('0x1b')],'include':_0x317da4[_0xbb10('0x1d')]?_[_0xbb10('0x1c')](_0x317da4[_0xbb10('0x1d')],function(_0x395404){return{'model':db[_0x395404[_0xbb10('0x1e')]],'as':_0x395404['as'],'attributes':_0x395404[_0xbb10('0x1b')],'include':_0x395404['include']?_['map'](_0x395404['include'],function(_0xc93a04){return{'model':db[_0xc93a04[_0xbb10('0x1e')]],'as':_0xc93a04['as'],'attributes':_0xc93a04[_0xbb10('0x1b')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x2fdde9){logger[_0xbb10('0xd')](_0xbb10('0x15'),_0x378da8);logger[_0xbb10('0x1f')](_0xbb10('0x15'),_0x378da8,JSON[_0xbb10('0x11')](_0x2fdde9));_0x575cca(_0x2fdde9);})[_0xbb10('0x20')](function(_0x4aabb9){logger[_0xbb10('0x12')](_0xbb10('0x15'),_0x4aabb9[_0xbb10('0x13')],_0x378da8);_0x30efc6(_0x1682a4[_0xbb10('0x12')](0x1f4,_0x4aabb9[_0xbb10('0x13')]));});});}; \ No newline at end of file diff --git a/server/api/plugin/index.js b/server/api/plugin/index.js index 170d001..5a48d3e 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 _0x9c44=['index','get','/webhook','webhookGet','/:id','show','download','diskStorage','server/files/plugins','originalname','replace','format','%s-%s%s','basename','extname','now','post','single','file','upload','webhookPost','update','delete','exports','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','./plugin.controller','isAuthenticated'];(function(_0x459cf3,_0xe42796){var _0x1a7d1a=function(_0x419950){while(--_0x419950){_0x459cf3['push'](_0x459cf3['shift']());}};_0x1a7d1a(++_0xe42796);}(_0x9c44,0x178));var _0x49c4=function(_0x13e741,_0x5d3c24){_0x13e741=_0x13e741-0x0;var _0x3f8bb3=_0x9c44[_0x13e741];return _0x3f8bb3;};'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'),controller[_0x49c4('0xb')]);router['get'](_0x49c4('0xc'),auth[_0x49c4('0x7')](),controller[_0x49c4('0xd')]);router[_0x49c4('0x9')]('/:id/download',auth['isAuthenticated'](),controller[_0x49c4('0xe')]);var upload=multer({'storage':multer[_0x49c4('0xf')]({'destination':function(_0x58cad7,_0xb611a1,_0x459d09){_0x459d09(null,path['join'](config['root'],_0x49c4('0x10')));},'filename':function(_0x6d1b08,_0x5487cd,_0x7df3a9){_0x5487cd[_0x49c4('0x11')]=_0x5487cd['originalname'][_0x49c4('0x12')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-');_0x7df3a9(null,util[_0x49c4('0x13')](_0x49c4('0x14'),path[_0x49c4('0x15')](_0x5487cd[_0x49c4('0x11')],path[_0x49c4('0x16')](_0x5487cd[_0x49c4('0x11')])),Date[_0x49c4('0x17')](),path['extname'](_0x5487cd[_0x49c4('0x11')])));}})});router[_0x49c4('0x18')]('/',upload[_0x49c4('0x19')](_0x49c4('0x1a')),controller[_0x49c4('0x1b')]);router['post'](_0x49c4('0xa'),controller[_0x49c4('0x1c')]);router['put']('/:id',auth[_0x49c4('0x7')](),controller[_0x49c4('0x1d')]);router[_0x49c4('0x1e')]('/:id',auth[_0x49c4('0x7')](),controller['delete']);module[_0x49c4('0x1f')]=router; \ No newline at end of file +var _0x57d4=['../../config/environment','./plugin.controller','get','isAuthenticated','index','/webhook','webhookGet','show','diskStorage','join','root','server/files/plugins','originalname','%s-%s%s','basename','extname','now','single','file','upload','webhookPost','/:id','delete','exports','multer','util','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service'];(function(_0x1b92a6,_0x14444b){var _0x24be5b=function(_0x3a5fb5){while(--_0x3a5fb5){_0x1b92a6['push'](_0x1b92a6['shift']());}};_0x24be5b(++_0x14444b);}(_0x57d4,0x78));var _0x457d=function(_0x3d9bea,_0x1f2b31){_0x3d9bea=_0x3d9bea-0x0;var _0xbebee2=_0x57d4[_0x3d9bea];return _0xbebee2;};'use strict';var multer=require(_0x457d('0x0'));var util=require(_0x457d('0x1'));var path=require('path');var timeout=require(_0x457d('0x2'));var express=require(_0x457d('0x3'));var router=express[_0x457d('0x4')]();var fs_extra=require(_0x457d('0x5'));var auth=require(_0x457d('0x6'));var interaction=require(_0x457d('0x7'));var config=require(_0x457d('0x8'));var controller=require(_0x457d('0x9'));router[_0x457d('0xa')]('/',auth[_0x457d('0xb')](),controller[_0x457d('0xc')]);router['get'](_0x457d('0xd'),controller[_0x457d('0xe')]);router['get']('/:id',auth[_0x457d('0xb')](),controller[_0x457d('0xf')]);router[_0x457d('0xa')]('/:id/download',auth['isAuthenticated'](),controller['download']);var upload=multer({'storage':multer[_0x457d('0x10')]({'destination':function(_0x38ec93,_0x449f48,_0x128e09){_0x128e09(null,path[_0x457d('0x11')](config[_0x457d('0x12')],_0x457d('0x13')));},'filename':function(_0x24cf65,_0xe7d200,_0x5abf49){_0xe7d200[_0x457d('0x14')]=_0xe7d200[_0x457d('0x14')]['replace'](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-');_0x5abf49(null,util['format'](_0x457d('0x15'),path[_0x457d('0x16')](_0xe7d200[_0x457d('0x14')],path[_0x457d('0x17')](_0xe7d200[_0x457d('0x14')])),Date[_0x457d('0x18')](),path[_0x457d('0x17')](_0xe7d200[_0x457d('0x14')])));}})});router['post']('/',upload[_0x457d('0x19')](_0x457d('0x1a')),controller[_0x457d('0x1b')]);router['post']('/webhook',controller[_0x457d('0x1c')]);router['put'](_0x457d('0x1d'),auth[_0x457d('0xb')](),controller['update']);router[_0x457d('0x1e')]('/:id',auth['isAuthenticated'](),controller[_0x457d('0x1e')]);module[_0x457d('0x1f')]=router; \ No newline at end of file diff --git a/server/api/plugin/plugin.attributes.js b/server/api/plugin/plugin.attributes.js index 7683eba..57603b2 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 _0x818b=['STRING','ENUM','html','script','TEXT','BOOLEAN','adminOnly','agentOnly','always','never','Indicates\x20whether\x20to\x20display\x20the\x20plugin\x20in\x20the\x20sidebar.','sequelize','exports'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0x818b,0xc1));var _0xb818=function(_0x2606d1,_0x4e0d9a){_0x2606d1=_0x2606d1-0x0;var _0x143a82=_0x818b[_0x2606d1];return _0x143a82;};'use strict';var Sequelize=require(_0xb818('0x0'));module[_0xb818('0x1')]={'name':{'type':Sequelize[_0xb818('0x2')]},'type':{'type':Sequelize[_0xb818('0x3')](_0xb818('0x4'),_0xb818('0x5'))},'description':{'type':Sequelize[_0xb818('0x6')]},'version':{'type':Sequelize[_0xb818('0x6')]},'path':{'type':Sequelize[_0xb818('0x2')],'comment':'The\x20physical\x20path\x20where\x20the\x20plugin\x20is\x20stored.'},'active':{'type':Sequelize[_0xb818('0x7')],'defaultValue':0x0,'comment':'Indicates\x20whether\x20the\x20plugin\x20is\x20installed.\x20Updated\x20when\x20the\x20plugin\x20is\x20installed/uninstalled.'},'sidebar':{'type':Sequelize[_0xb818('0x3')](_0xb818('0x8'),_0xb818('0x9'),_0xb818('0xa'),_0xb818('0xb')),'defaultValue':_0xb818('0xa'),'comment':_0xb818('0xc')},'icon':{'type':Sequelize['STRING']},'adminUrl':{'type':Sequelize[_0xb818('0x2')]},'agentUrl':{'type':Sequelize['STRING']},'scriptName':{'type':Sequelize[_0xb818('0x2')]},'scriptPath':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0xa164=['The\x20physical\x20path\x20where\x20the\x20plugin\x20is\x20stored.','Indicates\x20whether\x20the\x20plugin\x20is\x20installed.\x20Updated\x20when\x20the\x20plugin\x20is\x20installed/uninstalled.','ENUM','always','never','Indicates\x20whether\x20to\x20display\x20the\x20plugin\x20in\x20the\x20sidebar.','sequelize','exports','STRING','html','script','TEXT'];(function(_0xef9a,_0x2996a8){var _0x20f0e6=function(_0x19b1dc){while(--_0x19b1dc){_0xef9a['push'](_0xef9a['shift']());}};_0x20f0e6(++_0x2996a8);}(_0xa164,0x66));var _0x4a16=function(_0x2a3257,_0x170ea2){_0x2a3257=_0x2a3257-0x0;var _0x1f9128=_0xa164[_0x2a3257];return _0x1f9128;};'use strict';var Sequelize=require(_0x4a16('0x0'));module[_0x4a16('0x1')]={'name':{'type':Sequelize[_0x4a16('0x2')]},'type':{'type':Sequelize['ENUM'](_0x4a16('0x3'),_0x4a16('0x4'))},'description':{'type':Sequelize[_0x4a16('0x5')]},'version':{'type':Sequelize['TEXT']},'path':{'type':Sequelize[_0x4a16('0x2')],'comment':_0x4a16('0x6')},'active':{'type':Sequelize['BOOLEAN'],'defaultValue':0x0,'comment':_0x4a16('0x7')},'sidebar':{'type':Sequelize[_0x4a16('0x8')]('adminOnly','agentOnly',_0x4a16('0x9'),_0x4a16('0xa')),'defaultValue':_0x4a16('0x9'),'comment':_0x4a16('0xb')},'icon':{'type':Sequelize[_0x4a16('0x2')]},'adminUrl':{'type':Sequelize['STRING']},'agentUrl':{'type':Sequelize[_0x4a16('0x2')]},'scriptName':{'type':Sequelize[_0x4a16('0x2')]},'scriptPath':{'type':Sequelize[_0x4a16('0x2')]}}; \ No newline at end of file diff --git a/server/api/plugin/plugin.controller.js b/server/api/plugin/plugin.controller.js index b49aa40..ff7c93c 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 _0x6e3d=['extname','Plugin\x20upload\x20filepath:\x20%s','chmodSync','Invalid\x20plugin\x20structure','lstatSync','isFile','readdirSync','some','manifest.json','Plugin\x20manifest\x20missing','readFileSync','parse','Invalid\x20manifest:\x20name\x20missing','Invalid\x20manifest:\x20type\x20missing','version','parameters','Invalid\x20manifest:\x20parameters\x20missing','html','Invalid\x20manifest:\x20views\x20missing','agent','Invalid\x20manifest:\x20no\x20view\x20specified','scriptName','Invalid\x20manifest:\x20script\x20name\x20missing','description','sidebar','always','icon','views','admin','test','plugins','Warning:\x20agent\x20view\x20not\x20specified','script','scriptPath','body','role','userProfileId','Unable\x20to\x20retrieve\x20the\x20current\x20user','user','UserProfileSection','autoAssociation','create','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','unlinkSync','Zip\x20archive\x20removed','Extracted\x20folder\x20removed','delete','webhookGet','resolve','\x27PATH\x27\x20parameter\x20not\x20specified','hostname','port','http://localhost:','encoding','method','%s%s','headers','content-length','content-type','endsWith','statusCode','webhookPost','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','fs-extra','lodash','crypto','jsforce','desk.js','querystring','papaparse','extract-zip','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','defaults','redis','localhost','socket.io-emitter','./plugin.socket','register','sendStatus','status','end','json','offset','undefined','count','limit','set','Content-Range','apply','reject','update','then','destroy','get','Plugins','UserProfileResource','error','stack','name','send','index','map','Plugin','fieldName','type','key','model','query','filters','intersection','attributes','fields','length','hasOwnProperty','order','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','include','findAll','rows','catch','show','keys','rawAttributes','find','params','join','root','%s.zip','basename','createWriteStream','warning','code','ENOENT','Sequelize','Error','Error\x20while\x20generating\x20the\x20zip\x20archive','pipe','glob','**/*','server/files/plugins','dirname','node_modules/**/*','attachments/**/*','finalize','close','existsSync','Plugin\x20not\x20found','download','format','Error\x20while\x20downloading\x20the\x20plugin','info','Download\x20completed','upload','file','filename'];(function(_0x318229,_0x31f172){var _0x15aa68=function(_0x15c655){while(--_0x15c655){_0x318229['push'](_0x318229['shift']());}};_0x15aa68(++_0x31f172);}(_0x6e3d,0xf3));var _0xd6e3=function(_0x3ab51d,_0x2fa01d){_0x3ab51d=_0x3ab51d-0x0;var _0x29a04e=_0x6e3d[_0x3ab51d];return _0x29a04e;};'use strict';var emlformat=require(_0xd6e3('0x0'));var rimraf=require(_0xd6e3('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xd6e3('0x2'));var rp=require(_0xd6e3('0x3'));var moment=require(_0xd6e3('0x4'));var BPromise=require(_0xd6e3('0x5'));var Mustache=require(_0xd6e3('0x6'));var util=require(_0xd6e3('0x7'));var path=require(_0xd6e3('0x8'));var sox=require(_0xd6e3('0x9'));var csv=require(_0xd6e3('0xa'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xd6e3('0xb'));var _=require(_0xd6e3('0xc'));var squel=require('squel');var crypto=require(_0xd6e3('0xd'));var jsforce=require(_0xd6e3('0xe'));var deskjs=require(_0xd6e3('0xf'));var toCsv=require(_0xd6e3('0xa'));var querystring=require(_0xd6e3('0x10'));var Papa=require(_0xd6e3('0x11'));var extract=require(_0xd6e3('0x12'));var rimraf=require(_0xd6e3('0x1'));var archiver=require('archiver');var Redis=require(_0xd6e3('0x13'));var authService=require(_0xd6e3('0x14'));var qs=require(_0xd6e3('0x15'));var as=require(_0xd6e3('0x16'));var hardwareService=require(_0xd6e3('0x17'));var logger=require(_0xd6e3('0x18'))(_0xd6e3('0x19'));var utils=require(_0xd6e3('0x1a'));var config=require(_0xd6e3('0x1b'));var licenseUtil=require('../../config/license/util');var db=require(_0xd6e3('0x1c'))['db'];config['redis']=_[_0xd6e3('0x1d')](config[_0xd6e3('0x1e')],{'host':_0xd6e3('0x1f'),'port':0x18eb});var socket=require(_0xd6e3('0x20'))(new Redis(config[_0xd6e3('0x1e')]));require(_0xd6e3('0x21'))[_0xd6e3('0x22')](socket);function respondWithStatusCode(_0x60a8cc,_0x2f544e){_0x2f544e=_0x2f544e||0xcc;return function(_0x434a78){if(_0x434a78){return _0x60a8cc[_0xd6e3('0x23')](_0x2f544e);}return _0x60a8cc[_0xd6e3('0x24')](_0x2f544e)[_0xd6e3('0x25')]();};}function respondWithResult(_0x5aab23,_0x32afde){_0x32afde=_0x32afde||0xc8;return function(_0x321781){if(_0x321781){return _0x5aab23['status'](_0x32afde)[_0xd6e3('0x26')](_0x321781);}};}function respondWithFilteredResult(_0x43f1eb,_0x1ddcd9){return function(_0x4de056){if(_0x4de056){var _0x4bf54b=typeof _0x1ddcd9[_0xd6e3('0x27')]===_0xd6e3('0x28')&&typeof _0x1ddcd9['limit']===_0xd6e3('0x28');var _0x170e3c=_0x4de056[_0xd6e3('0x29')];var _0x503e6e=_0x4bf54b?0x0:_0x1ddcd9[_0xd6e3('0x27')];var _0x3b81e6=_0x4bf54b?_0x4de056[_0xd6e3('0x29')]:_0x1ddcd9[_0xd6e3('0x27')]+_0x1ddcd9[_0xd6e3('0x2a')];var _0x4cc7d4;if(_0x3b81e6>=_0x170e3c){_0x3b81e6=_0x170e3c;_0x4cc7d4=0xc8;}else{_0x4cc7d4=0xce;}_0x43f1eb[_0xd6e3('0x24')](_0x4cc7d4);return _0x43f1eb[_0xd6e3('0x2b')](_0xd6e3('0x2c'),_0x503e6e+'-'+_0x3b81e6+'/'+_0x170e3c)['json'](_0x4de056);}return null;};}function patchUpdates(_0x586654){return function(_0x3ac2df){try{jsonpatch[_0xd6e3('0x2d')](_0x3ac2df,_0x586654,!![]);}catch(_0x861efb){return BPromise[_0xd6e3('0x2e')](_0x861efb);}return _0x3ac2df['save']();};}function saveUpdates(_0x16be8f,_0x2d336e){return function(_0x1a74a2){if(_0x1a74a2){return _0x1a74a2[_0xd6e3('0x2f')](_0x16be8f)[_0xd6e3('0x30')](function(_0x26483c){return _0x26483c;});}return null;};}function removeEntity(_0x588e9e,_0x45330c){return function(_0x11b4ba){if(_0x11b4ba){return _0x11b4ba[_0xd6e3('0x31')]()[_0xd6e3('0x30')](function(){var _0x1043a5=_0x11b4ba[_0xd6e3('0x32')]({'plain':!![]});var _0x39be38=_0xd6e3('0x33');return db[_0xd6e3('0x34')][_0xd6e3('0x31')]({'where':{'type':_0x39be38,'resourceId':_0x1043a5['id']}})['then'](function(){return _0x11b4ba;});})[_0xd6e3('0x30')](function(){_0x588e9e[_0xd6e3('0x24')](0xcc)[_0xd6e3('0x25')]();});}};}function handleEntityNotFound(_0x1e74b0,_0x4417da){return function(_0x352e18){if(!_0x352e18){_0x1e74b0[_0xd6e3('0x23')](0x194);}return _0x352e18;};}function handleError(_0x2353fe,_0x348ad5){_0x348ad5=_0x348ad5||0x1f4;return function(_0x4d2ae0){logger[_0xd6e3('0x35')](_0x4d2ae0[_0xd6e3('0x36')]);if(_0x4d2ae0['name']){delete _0x4d2ae0[_0xd6e3('0x37')];}_0x2353fe[_0xd6e3('0x24')](_0x348ad5)[_0xd6e3('0x38')](_0x4d2ae0);};}exports[_0xd6e3('0x39')]=function(_0x399f03,_0x4283e9){var _0x21e947={},_0x13f2ee={},_0x456db9={'count':0x0,'rows':[]};var _0xf489fc=_[_0xd6e3('0x3a')](db[_0xd6e3('0x3b')]['rawAttributes'],function(_0x589e99){return{'name':_0x589e99[_0xd6e3('0x3c')],'type':_0x589e99[_0xd6e3('0x3d')][_0xd6e3('0x3e')]};});_0x13f2ee[_0xd6e3('0x3f')]=_[_0xd6e3('0x3a')](_0xf489fc,'name');_0x13f2ee[_0xd6e3('0x40')]=_['keys'](_0x399f03[_0xd6e3('0x40')]);_0x13f2ee[_0xd6e3('0x41')]=_[_0xd6e3('0x42')](_0x13f2ee[_0xd6e3('0x3f')],_0x13f2ee[_0xd6e3('0x40')]);_0x21e947[_0xd6e3('0x43')]=_['intersection'](_0x13f2ee[_0xd6e3('0x3f')],qs[_0xd6e3('0x44')](_0x399f03[_0xd6e3('0x40')][_0xd6e3('0x44')]));_0x21e947[_0xd6e3('0x43')]=_0x21e947[_0xd6e3('0x43')][_0xd6e3('0x45')]?_0x21e947[_0xd6e3('0x43')]:_0x13f2ee[_0xd6e3('0x3f')];if(!_0x399f03['query'][_0xd6e3('0x46')]('nolimit')){_0x21e947[_0xd6e3('0x2a')]=qs[_0xd6e3('0x2a')](_0x399f03[_0xd6e3('0x40')][_0xd6e3('0x2a')]);_0x21e947[_0xd6e3('0x27')]=qs[_0xd6e3('0x27')](_0x399f03[_0xd6e3('0x40')][_0xd6e3('0x27')]);}_0x21e947[_0xd6e3('0x47')]=qs[_0xd6e3('0x48')](_0x399f03[_0xd6e3('0x40')][_0xd6e3('0x48')]);_0x21e947[_0xd6e3('0x49')]=qs[_0xd6e3('0x41')](_[_0xd6e3('0x4a')](_0x399f03[_0xd6e3('0x40')],_0x13f2ee[_0xd6e3('0x41')]),_0xf489fc);if(_0x399f03[_0xd6e3('0x40')][_0xd6e3('0x4b')]){_0x21e947[_0xd6e3('0x49')]=_[_0xd6e3('0x4c')](_0x21e947[_0xd6e3('0x49')],{'$or':_[_0xd6e3('0x3a')](_0xf489fc,function(_0x4f2efc){if(_0x4f2efc[_0xd6e3('0x3d')]!==_0xd6e3('0x4d')){var _0x2d2b54={};_0x2d2b54[_0x4f2efc['name']]={'$like':'%'+_0x399f03[_0xd6e3('0x40')][_0xd6e3('0x4b')]+'%'};return _0x2d2b54;}})});}_0x21e947=_[_0xd6e3('0x4c')]({},_0x21e947,_0x399f03[_0xd6e3('0x4e')]);var _0x927578={'where':_0x21e947[_0xd6e3('0x49')]};return db['Plugin'][_0xd6e3('0x29')](_0x927578)[_0xd6e3('0x30')](function(_0xdc7bc0){_0x456db9[_0xd6e3('0x29')]=_0xdc7bc0;if(_0x399f03[_0xd6e3('0x40')][_0xd6e3('0x4f')]){_0x21e947[_0xd6e3('0x50')]=[{'all':!![]}];}return db['Plugin'][_0xd6e3('0x51')](_0x21e947);})[_0xd6e3('0x30')](function(_0x17052c){_0x456db9[_0xd6e3('0x52')]=_0x17052c;return _0x456db9;})[_0xd6e3('0x30')](respondWithFilteredResult(_0x4283e9,_0x21e947))[_0xd6e3('0x53')](handleError(_0x4283e9,null));};exports[_0xd6e3('0x54')]=function(_0xfdb1cb,_0x38383e){var _0x38c378={'raw':!![],'where':{'id':_0xfdb1cb['params']['id']}},_0x5c1c97={};_0x5c1c97[_0xd6e3('0x3f')]=_[_0xd6e3('0x55')](db['Plugin'][_0xd6e3('0x56')]);_0x5c1c97[_0xd6e3('0x40')]=_[_0xd6e3('0x55')](_0xfdb1cb[_0xd6e3('0x40')]);_0x5c1c97[_0xd6e3('0x41')]=_[_0xd6e3('0x42')](_0x5c1c97[_0xd6e3('0x3f')],_0x5c1c97[_0xd6e3('0x40')]);_0x38c378[_0xd6e3('0x43')]=_[_0xd6e3('0x42')](_0x5c1c97[_0xd6e3('0x3f')],qs['fields'](_0xfdb1cb[_0xd6e3('0x40')]['fields']));_0x38c378[_0xd6e3('0x43')]=_0x38c378[_0xd6e3('0x43')][_0xd6e3('0x45')]?_0x38c378[_0xd6e3('0x43')]:_0x5c1c97['model'];if(_0xfdb1cb[_0xd6e3('0x40')][_0xd6e3('0x4f')]){_0x38c378['include']=[{'all':!![]}];}_0x38c378=_[_0xd6e3('0x4c')]({},_0x38c378,_0xfdb1cb['options']);return db['Plugin'][_0xd6e3('0x57')](_0x38c378)[_0xd6e3('0x30')](handleEntityNotFound(_0x38383e,null))[_0xd6e3('0x30')](respondWithResult(_0x38383e,null))[_0xd6e3('0x53')](handleError(_0x38383e,null));};exports['download']=function(_0x3eb7bf,_0x33b3ac,_0x3b4d6f){return db[_0xd6e3('0x3b')][_0xd6e3('0x57')]({'where':{'id':_0x3eb7bf[_0xd6e3('0x58')]['id']},'attributes':[_0xd6e3('0x37'),_0xd6e3('0x8')],'raw':!![]})[_0xd6e3('0x30')](handleEntityNotFound(_0x33b3ac,null))['then'](function(_0x1d0fe5){if(_0x1d0fe5){var _0x42b111=path[_0xd6e3('0x59')](config[_0xd6e3('0x5a')],'server/files/plugins',util['format'](_0xd6e3('0x5b'),path[_0xd6e3('0x5c')](_0x1d0fe5[_0xd6e3('0x8')])));var _0x99b0b6=fs[_0xd6e3('0x5d')](_0x42b111);var _0x47cd4a=archiver('zip',{'zlib':{'level':0x9}});_0x47cd4a['on'](_0xd6e3('0x5e'),function(_0x5340e2){if(_0x5340e2[_0xd6e3('0x5f')]===_0xd6e3('0x60')){logger[_0xd6e3('0x35')](_0x5340e2);}else{throw new db[(_0xd6e3('0x61'))][(_0xd6e3('0x62'))](_0xd6e3('0x63'));}});_0x47cd4a['on'](_0xd6e3('0x35'),function(_0x1969e4){throw new db[(_0xd6e3('0x61'))]['Error'](_0xd6e3('0x63'));});_0x47cd4a[_0xd6e3('0x64')](_0x99b0b6);_0x47cd4a[_0xd6e3('0x65')](_0xd6e3('0x66'),{'cwd':path[_0xd6e3('0x59')](config[_0xd6e3('0x5a')],_0xd6e3('0x67'),path[_0xd6e3('0x68')](_0x1d0fe5[_0xd6e3('0x8')])),'ignore':[path['join'](path[_0xd6e3('0x5c')](_0x1d0fe5['path']),_0xd6e3('0x69')),path[_0xd6e3('0x59')](path[_0xd6e3('0x5c')](_0x1d0fe5[_0xd6e3('0x8')]),_0xd6e3('0x6a'))],'nodir':!![]})[_0xd6e3('0x6b')]();_0x99b0b6['on'](_0xd6e3('0x6c'),function(){if(!fs[_0xd6e3('0x6d')](_0x42b111)){throw new db[(_0xd6e3('0x61'))][(_0xd6e3('0x62'))](_0xd6e3('0x6e'));}return _0x33b3ac[_0xd6e3('0x6f')](_0x42b111,util[_0xd6e3('0x70')](_0xd6e3('0x5b'),path[_0xd6e3('0x5c')](_0x1d0fe5[_0xd6e3('0x8')])),function(_0x1e23fa){if(_0x1e23fa){throw new db[(_0xd6e3('0x61'))][(_0xd6e3('0x62'))](_0xd6e3('0x71'));}fs['unlinkSync'](_0x42b111);logger[_0xd6e3('0x72')](_0xd6e3('0x73'));logger[_0xd6e3('0x72')]('Temporary\x20file\x20removed');});});}return null;})[_0xd6e3('0x53')](handleError(_0x33b3ac,null));};exports[_0xd6e3('0x74')]=function(_0x336808,_0x55d656,_0x40faff){var _0x55c155=path[_0xd6e3('0x5c')](_0x336808[_0xd6e3('0x75')][_0xd6e3('0x76')],path[_0xd6e3('0x77')](_0x336808[_0xd6e3('0x75')][_0xd6e3('0x76')]));var _0x3e6257=path[_0xd6e3('0x59')](config[_0xd6e3('0x5a')],_0xd6e3('0x67'),_0x336808[_0xd6e3('0x75')]['filename']);var _0x33230b=path[_0xd6e3('0x59')](config[_0xd6e3('0x5a')],_0xd6e3('0x67'),_0x55c155);logger[_0xd6e3('0x72')](_0xd6e3('0x78'),_0x3e6257);logger[_0xd6e3('0x72')]('Plugin\x20upload\x20destination:\x20%s',_0x33230b);try{fs[_0xd6e3('0x79')](_0x3e6257,parseInt('0777',0x8));extract(_0x3e6257,{'dir':_0x33230b},function(_0x186bb5){if(_0x186bb5){logger['error'](_0x186bb5);handleError(_0x186bb5,!![]);};var _0x307961=fs['readdirSync'](_0x33230b);if(_0x307961[_0xd6e3('0x45')]>0x1){removeReferences(_0x3e6257,_0x33230b);logger[_0xd6e3('0x35')](_0xd6e3('0x7a'));return _0x40faff(new Error(_0xd6e3('0x7a')));}var _0x543d14=fs[_0xd6e3('0x7b')](path['join'](_0x33230b,_0x307961[0x0]));if(_0x543d14[_0xd6e3('0x7c')]()){removeReferences(_0x3e6257,_0x33230b);logger['error'](_0xd6e3('0x7a'));return _0x40faff(new Error('Invalid\x20plugin\x20structure'));}if(_0x543d14['isDirectory']()){var _0x2a38a8=fs[_0xd6e3('0x7d')](path[_0xd6e3('0x59')](_0x33230b,_0x307961[0x0]));if(_0x2a38a8[_0xd6e3('0x45')]===0x0){removeReferences(_0x3e6257,_0x33230b);logger[_0xd6e3('0x35')](_0xd6e3('0x7a'));return _0x40faff(new Error(_0xd6e3('0x7a')));}var _0x3993f5=_0x2a38a8[_0xd6e3('0x7e')](function(_0x5baec2){return _0x5baec2===_0xd6e3('0x7f');});if(!_0x3993f5){return _0x40faff(new Error(_0xd6e3('0x80')));}var _0x375636=fs[_0xd6e3('0x81')](path[_0xd6e3('0x59')](_0x33230b,_0x307961[0x0],_0xd6e3('0x7f')));var _0x14096b=JSON[_0xd6e3('0x82')](_0x375636);if(_0xd6e3('0x28')==typeof _0x14096b['name']){return _0x40faff(new Error(_0xd6e3('0x83')));}if(_0xd6e3('0x28')==typeof _0x14096b[_0xd6e3('0x3d')]){return _0x40faff(new Error(_0xd6e3('0x84')));}if('undefined'==typeof _0x14096b[_0xd6e3('0x85')]){return _0x40faff(new Error('Invalid\x20manifest:\x20version\x20not\x20specified'));}if('undefined'==typeof _0x14096b[_0xd6e3('0x86')]){return _0x40faff(new Error(_0xd6e3('0x87')));}if(_0x14096b[_0xd6e3('0x3d')]===_0xd6e3('0x88')){if('undefined'==typeof _0x14096b[_0xd6e3('0x86')]['views']){return _0x40faff(new Error(_0xd6e3('0x89')));}if(_0xd6e3('0x28')==typeof _0x14096b[_0xd6e3('0x86')]['views']['admin']&&_0xd6e3('0x28')==typeof _0x14096b[_0xd6e3('0x86')]['views'][_0xd6e3('0x8a')]){return _0x40faff(new Error(_0xd6e3('0x8b')));}}else if(_0x14096b[_0xd6e3('0x3d')]==='script'){if(_0xd6e3('0x28')==typeof _0x14096b[_0xd6e3('0x86')][_0xd6e3('0x8c')]){return _0x40faff(new Error(_0xd6e3('0x8d')));}if(_0xd6e3('0x28')==typeof _0x14096b[_0xd6e3('0x86')]['scriptPath']){return _0x40faff(new Error('Invalid\x20manifest:\x20script\x20path\x20missing'));}}else{return _0x40faff(new Error('Invalid\x20manifest:\x20invalid\x20type'));}var _0x138222=_0x14096b[_0xd6e3('0x37')];var _0x236699=_0x14096b[_0xd6e3('0x8e')];var _0x4a0d9d=_0x14096b['type'];var _0x19fed5=_0x14096b['sidebar']?_0x14096b[_0xd6e3('0x8f')]:_0xd6e3('0x90');var _0x3cf95a=_0x14096b[_0xd6e3('0x91')]?_0x14096b[_0xd6e3('0x91')]:'icon-apps';var _0x10bb43='';var _0x147bfb='';var _0x36ef37='';var _0x445275='';var _0x4a64c3=_0x14096b[_0xd6e3('0x85')];if(_0x4a0d9d===_0xd6e3('0x88')){if(_0xd6e3('0x28')!=typeof _0x14096b[_0xd6e3('0x86')][_0xd6e3('0x92')][_0xd6e3('0x93')]){var _0xd5d699=_0x14096b[_0xd6e3('0x86')]['views'][_0xd6e3('0x93')];if(!/^(f|ht)tps?:\/\//i[_0xd6e3('0x94')](_0xd5d699)){_0x10bb43=path[_0xd6e3('0x59')](_0xd6e3('0x95'),_0x55c155,_0x307961[0x0],_0xd5d699);}else{_0x10bb43=_0xd5d699;}}else{logger[_0xd6e3('0x72')]('Warning:\x20admin\x20view\x20not\x20specified');}if(_0xd6e3('0x28')!=typeof _0x14096b['parameters'][_0xd6e3('0x92')]['agent']){var _0x72c881=_0x14096b[_0xd6e3('0x86')]['views'][_0xd6e3('0x8a')];if(!/^(f|ht)tps?:\/\//i[_0xd6e3('0x94')](_0x72c881)){_0x147bfb=path[_0xd6e3('0x59')]('plugins',_0x55c155,_0x307961[0x0],_0x72c881);}else{_0x147bfb=_0x72c881;}}else{logger[_0xd6e3('0x72')](_0xd6e3('0x96'));}}else if(_0x4a0d9d===_0xd6e3('0x97')){_0x36ef37=_0x14096b[_0xd6e3('0x86')]['scriptName'];_0x445275=_0x14096b[_0xd6e3('0x86')][_0xd6e3('0x98')];if(_0xd6e3('0x28')!=typeof _0x14096b['parameters'][_0xd6e3('0x92')]){if(_0xd6e3('0x28')!=typeof _0x14096b[_0xd6e3('0x86')][_0xd6e3('0x92')][_0xd6e3('0x93')]){var _0xd5d699=_0x14096b[_0xd6e3('0x86')][_0xd6e3('0x92')][_0xd6e3('0x93')];if(!/^(f|ht)tps?:\/\//i[_0xd6e3('0x94')](_0xd5d699)){_0x10bb43=path[_0xd6e3('0x59')](_0xd6e3('0x95'),_0x55c155,_0x307961[0x0],_0xd5d699);}else{_0x10bb43=_0xd5d699;}}if(_0xd6e3('0x28')!=typeof _0x14096b['parameters'][_0xd6e3('0x92')]['agent']){var _0x72c881=_0x14096b[_0xd6e3('0x86')][_0xd6e3('0x92')][_0xd6e3('0x8a')];if(!/^(f|ht)tps?:\/\//i['test'](_0x72c881)){_0x147bfb=path['join'](_0xd6e3('0x95'),_0x55c155,_0x307961[0x0],_0x72c881);}else{_0x147bfb=_0x72c881;}}}}var _0x4870dc={'name':_0x138222,'description':_0x236699,'path':path[_0xd6e3('0x59')](_0x55c155,_0x307961[0x0]),'type':_0x4a0d9d,'sidebar':_0x19fed5,'icon':_0x3cf95a,'adminUrl':_0x10bb43,'agentUrl':_0x147bfb,'scriptName':_0x36ef37,'scriptPath':_0x445275,'version':_0x4a64c3};removeReferences(_0x3e6257,null);return db[_0xd6e3('0x3b')]['create'](_0x4870dc)[_0xd6e3('0x30')](function(_0x457731){var _0x3f5d28={'role':_0x336808[_0xd6e3('0x99')][_0xd6e3('0x9a')],'userProfileId':_0x336808[_0xd6e3('0x99')][_0xd6e3('0x9b')]};if(!_0x3f5d28)throw new Error(_0xd6e3('0x9c'));if(_0x3f5d28['role']===_0xd6e3('0x9d')){var _0x5add8d=_0x457731[_0xd6e3('0x32')]({'plain':!![]});return db[_0xd6e3('0x9e')][_0xd6e3('0x57')]({'where':{'name':_0xd6e3('0x33'),'userProfileId':_0x3f5d28[_0xd6e3('0x9b')]},'raw':!![]})[_0xd6e3('0x30')](function(_0x1c5220){if(_0x1c5220&&_0x1c5220[_0xd6e3('0x9f')]===0x0){return db['UserProfileResource'][_0xd6e3('0xa0')]({'name':_0x5add8d['name'],'resourceId':_0x5add8d['id'],'type':_0x1c5220[_0xd6e3('0x37')],'sectionId':_0x1c5220['id']},{})[_0xd6e3('0x30')](function(){return _0x457731;});}else{return _0x457731;}})[_0xd6e3('0x53')](function(_0x143606){logger['error'](_0xd6e3('0xa1'),_0x143606);throw _0x143606;});}return _0x457731;})[_0xd6e3('0x30')](respondWithResult(_0x55d656,null))[_0xd6e3('0x53')](handleError(_0x55d656,null));}});}catch(_0x137b1a){_0x55d656[_0xd6e3('0x24')](0x1f4)[_0xd6e3('0x38')](_0x137b1a);}};function removeReferences(_0x3e415f,_0x2a9b3a){try{if(_0x3e415f){fs[_0xd6e3('0xa2')](_0x3e415f);logger[_0xd6e3('0x72')](_0xd6e3('0xa3'));}if(_0x2a9b3a){rimraf(_0x2a9b3a,function(){});logger[_0xd6e3('0x72')](_0xd6e3('0xa4'));}}catch(_0x435063){logger[_0xd6e3('0x35')](_0x435063);}}exports[_0xd6e3('0x2f')]=function(_0x1821fc,_0x5d832f,_0x509d03){return db[_0xd6e3('0x3b')][_0xd6e3('0x57')]({'where':{'id':_0x1821fc[_0xd6e3('0x58')]['id']}})[_0xd6e3('0x30')](handleEntityNotFound(_0x5d832f,null))[_0xd6e3('0x30')](saveUpdates(_0x1821fc[_0xd6e3('0x99')],null))[_0xd6e3('0x30')](respondWithResult(_0x5d832f,null))[_0xd6e3('0x53')](handleError(_0x5d832f,null));};exports[_0xd6e3('0xa5')]=function(_0x563b43,_0x13d66d,_0x494cea){return db['Plugin'][_0xd6e3('0x57')]({'where':{'id':_0x563b43[_0xd6e3('0x58')]['id']}})[_0xd6e3('0x30')](function(_0x4a55fc){if(_0x4a55fc){return _0x4a55fc[_0xd6e3('0x31')]();}})[_0xd6e3('0x30')](function(_0xf087c4){rimraf(path['join'](config[_0xd6e3('0x5a')],_0xd6e3('0x67'),path[_0xd6e3('0x68')](_0xf087c4[_0xd6e3('0x8')])),function(){});return _0xf087c4;})['then'](handleEntityNotFound(_0x13d66d,null))[_0xd6e3('0x30')](respondWithStatusCode(_0x13d66d,null))['catch'](handleError(_0x13d66d,null));};exports[_0xd6e3('0xa6')]=function(_0x4c86ef,_0x3136ef,_0x512d8e){return BPromise[_0xd6e3('0xa7')]()[_0xd6e3('0x30')](function(){if(!_0x4c86ef[_0xd6e3('0x40')][_0xd6e3('0x8')]){throw new Error(_0xd6e3('0xa8'));}if(!_0x4c86ef[_0xd6e3('0x40')]['port']){throw new Error('\x27PORT\x27\x20parameter\x20not\x20specified');}var _0x170081=_0x4c86ef[_0xd6e3('0x40')][_0xd6e3('0xa9')]?_0x4c86ef[_0xd6e3('0x40')][_0xd6e3('0xa9')]+':'+_0x4c86ef[_0xd6e3('0x40')][_0xd6e3('0xaa')]:_0xd6e3('0xab')+_0x4c86ef[_0xd6e3('0x40')][_0xd6e3('0xaa')];var _0x96926f=_0x4c86ef[_0xd6e3('0x40')][_0xd6e3('0x26')]?_0x4c86ef[_0xd6e3('0x40')]['json']:!![];var _0x115255=_0x4c86ef[_0xd6e3('0x40')][_0xd6e3('0xac')]?_0x4c86ef[_0xd6e3('0x40')][_0xd6e3('0xac')]:null;var _0x250106={'method':_0x4c86ef[_0xd6e3('0xad')],'uri':util[_0xd6e3('0x70')](_0xd6e3('0xae'),_0x170081,_0x4c86ef[_0xd6e3('0x40')][_0xd6e3('0x8')]),'json':_0x96926f,'resolveWithFullResponse':!![],'encoding':_0x115255,'qs':_0x4c86ef['query']};if(_0x4c86ef[_0xd6e3('0xaf')]){_0x250106['headers']=_0x4c86ef['headers'];if(_0x250106[_0xd6e3('0xaf')][_0xd6e3('0xb0')]){delete _0x250106[_0xd6e3('0xaf')][_0xd6e3('0xb0')];}}if(_0x250106[_0xd6e3('0xaf')][_0xd6e3('0xb1')]){delete _0x250106[_0xd6e3('0xaf')]['content-type'];}return rp(_0x250106);})['then'](function(_0x5adc1e){if(_0x5adc1e){_0x3136ef[_0xd6e3('0x2b')](_0x5adc1e[_0xd6e3('0xaf')]);logger['info'](_0x5adc1e[_0xd6e3('0x99')]);if(_[_0xd6e3('0xb2')](_0x4c86ef[_0xd6e3('0x40')][_0xd6e3('0x8')],_0xd6e3('0x6f'))&&_0x5adc1e['statusCode']==0x1f4){return _0x3136ef[_0xd6e3('0x23')](_0x5adc1e[_0xd6e3('0xb3')]);}else{return _0x3136ef[_0xd6e3('0x24')](_0x5adc1e['statusCode'])[_0xd6e3('0x38')](_0x5adc1e[_0xd6e3('0x99')]);}}else{return _0x3136ef[_0xd6e3('0x23')](0xc8);}})[_0xd6e3('0x53')](handleError(_0x3136ef,null));};exports[_0xd6e3('0xb4')]=function(_0x478c8a,_0x249dd1,_0x38b59b){return BPromise[_0xd6e3('0xa7')]()[_0xd6e3('0x30')](function(){if(!_0x478c8a[_0xd6e3('0x40')][_0xd6e3('0x8')]){throw new Error(_0xd6e3('0xa8'));}if(!_0x478c8a[_0xd6e3('0x40')][_0xd6e3('0xaa')]){throw new Error('\x27PORT\x27\x20parameter\x20not\x20specified');}var _0x17b0a3=_0x478c8a['query']['hostname']?_0x478c8a['query'][_0xd6e3('0xa9')]+':'+_0x478c8a[_0xd6e3('0x40')][_0xd6e3('0xaa')]:_0xd6e3('0xab')+_0x478c8a['query'][_0xd6e3('0xaa')];var _0x59b973=_0x478c8a[_0xd6e3('0x40')][_0xd6e3('0x26')]?_0x478c8a[_0xd6e3('0x40')][_0xd6e3('0x26')]:!![];var _0x147fa4=_0x478c8a[_0xd6e3('0x40')][_0xd6e3('0xac')]?_0x478c8a['query'][_0xd6e3('0xac')]:null;var _0x5333d3={'method':_0x478c8a[_0xd6e3('0xad')],'uri':util[_0xd6e3('0x70')]('%s%s',_0x17b0a3,_0x478c8a[_0xd6e3('0x40')][_0xd6e3('0x8')]),'json':_0x59b973,'resolveWithFullResponse':!![],'encoding':_0x147fa4,'body':_0x478c8a[_0xd6e3('0x99')]};if(_0x478c8a['headers']){_0x5333d3['headers']=_0x478c8a[_0xd6e3('0xaf')];if(_0x5333d3[_0xd6e3('0xaf')][_0xd6e3('0xb0')]){delete _0x5333d3[_0xd6e3('0xaf')]['content-length'];}}if(_0x5333d3['headers']['content-type']){delete _0x5333d3[_0xd6e3('0xaf')][_0xd6e3('0xb1')];}return rp(_0x5333d3);})[_0xd6e3('0x30')](function(_0x2fc58b){if(_0x2fc58b){_0x249dd1['set'](_0x2fc58b[_0xd6e3('0xaf')]);logger[_0xd6e3('0x72')](_0x2fc58b[_0xd6e3('0x99')]);return _0x249dd1[_0xd6e3('0x24')](_0x2fc58b[_0xd6e3('0xb3')])['send'](_0x2fc58b[_0xd6e3('0x99')]);}else{return _0x249dd1[_0xd6e3('0x23')](0xc8);}})[_0xd6e3('0x53')](handleError(_0x249dd1,null));}; \ No newline at end of file +var _0x909b=['type','key','query','keys','filters','intersection','model','fields','attributes','hasOwnProperty','nolimit','pick','merge','VIRTUAL','filter','where','Plugin','includeAll','include','rows','catch','show','length','options','download','find','params','path','join','root','server/files/plugins','format','basename','zip','warning','ENOENT','Sequelize','Error','Error\x20while\x20generating\x20the\x20zip\x20archive','pipe','glob','dirname','node_modules/**/*','attachments/**/*','finalize','close','existsSync','Plugin\x20not\x20found','Error\x20while\x20downloading\x20the\x20plugin','unlinkSync','info','Download\x20completed','Temporary\x20file\x20removed','filename','extname','file','Plugin\x20upload\x20filepath:\x20%s','Plugin\x20upload\x20destination:\x20%s','chmodSync','0777','readdirSync','Invalid\x20plugin\x20structure','lstatSync','isFile','isDirectory','some','manifest.json','readFileSync','parse','Invalid\x20manifest:\x20type\x20missing','version','parameters','Invalid\x20manifest:\x20parameters\x20missing','html','Invalid\x20manifest:\x20views\x20missing','admin','views','agent','Invalid\x20manifest:\x20no\x20view\x20specified','script','scriptName','scriptPath','Invalid\x20manifest:\x20script\x20path\x20missing','Invalid\x20manifest:\x20invalid\x20type','description','sidebar','icon','icon-apps','test','plugins','Warning:\x20admin\x20view\x20not\x20specified','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','update','delete','destroy','resolve','\x27PATH\x27\x20parameter\x20not\x20specified','port','hostname','http://localhost:','encoding','method','headers','content-length','content-type','statusCode','\x27PORT\x27\x20parameter\x20not\x20specified','%s%s','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','sox','to-csv','fs-extra','lodash','squel','jsforce','desk.js','querystring','papaparse','extract-zip','archiver','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/environment','../../config/license/util','redis','defaults','localhost','socket.io-emitter','./plugin.socket','register','sendStatus','end','status','json','offset','undefined','limit','count','set','apply','reject','save','then','get','Plugins','UserProfileResource','error','stack','name','send','map','rawAttributes','fieldName'];(function(_0x2c9a1f,_0x286e15){var _0x3ecc48=function(_0x4a79f3){while(--_0x4a79f3){_0x2c9a1f['push'](_0x2c9a1f['shift']());}};_0x3ecc48(++_0x286e15);}(_0x909b,0x1d0));var _0xb909=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0x909b[_0x20a584];return _0x4b41a8;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xb909('0x0'));var zipdir=require(_0xb909('0x1'));var jsonpatch=require(_0xb909('0x2'));var rp=require(_0xb909('0x3'));var moment=require(_0xb909('0x4'));var BPromise=require(_0xb909('0x5'));var Mustache=require(_0xb909('0x6'));var util=require(_0xb909('0x7'));var path=require('path');var sox=require(_0xb909('0x8'));var csv=require(_0xb909('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xb909('0xa'));var _=require(_0xb909('0xb'));var squel=require(_0xb909('0xc'));var crypto=require('crypto');var jsforce=require(_0xb909('0xd'));var deskjs=require(_0xb909('0xe'));var toCsv=require(_0xb909('0x9'));var querystring=require(_0xb909('0xf'));var Papa=require(_0xb909('0x10'));var extract=require(_0xb909('0x11'));var rimraf=require('rimraf');var archiver=require(_0xb909('0x12'));var Redis=require(_0xb909('0x13'));var authService=require('../../components/auth/service');var qs=require(_0xb909('0x14'));var as=require(_0xb909('0x15'));var hardwareService=require(_0xb909('0x16'));var logger=require('../../config/logger')(_0xb909('0x17'));var utils=require('../../config/utils');var config=require(_0xb909('0x18'));var licenseUtil=require(_0xb909('0x19'));var db=require('../../mysqldb')['db'];config[_0xb909('0x1a')]=_[_0xb909('0x1b')](config['redis'],{'host':_0xb909('0x1c'),'port':0x18eb});var socket=require(_0xb909('0x1d'))(new Redis(config['redis']));require(_0xb909('0x1e'))[_0xb909('0x1f')](socket);function respondWithStatusCode(_0x41467f,_0x19c39c){_0x19c39c=_0x19c39c||0xcc;return function(_0x4cf361){if(_0x4cf361){return _0x41467f[_0xb909('0x20')](_0x19c39c);}return _0x41467f['status'](_0x19c39c)[_0xb909('0x21')]();};}function respondWithResult(_0x3f7b09,_0x2aaffc){_0x2aaffc=_0x2aaffc||0xc8;return function(_0x434dfc){if(_0x434dfc){return _0x3f7b09[_0xb909('0x22')](_0x2aaffc)[_0xb909('0x23')](_0x434dfc);}};}function respondWithFilteredResult(_0x2b4779,_0x3f94dc){return function(_0x196940){if(_0x196940){var _0xeba481=typeof _0x3f94dc[_0xb909('0x24')]===_0xb909('0x25')&&typeof _0x3f94dc[_0xb909('0x26')]==='undefined';var _0x1d1d0d=_0x196940['count'];var _0x2d759a=_0xeba481?0x0:_0x3f94dc['offset'];var _0x1b504e=_0xeba481?_0x196940[_0xb909('0x27')]:_0x3f94dc[_0xb909('0x24')]+_0x3f94dc[_0xb909('0x26')];var _0x4b3c74;if(_0x1b504e>=_0x1d1d0d){_0x1b504e=_0x1d1d0d;_0x4b3c74=0xc8;}else{_0x4b3c74=0xce;}_0x2b4779[_0xb909('0x22')](_0x4b3c74);return _0x2b4779[_0xb909('0x28')]('Content-Range',_0x2d759a+'-'+_0x1b504e+'/'+_0x1d1d0d)[_0xb909('0x23')](_0x196940);}return null;};}function patchUpdates(_0xf34f80){return function(_0x31f38e){try{jsonpatch[_0xb909('0x29')](_0x31f38e,_0xf34f80,!![]);}catch(_0x217b20){return BPromise[_0xb909('0x2a')](_0x217b20);}return _0x31f38e[_0xb909('0x2b')]();};}function saveUpdates(_0x292eea,_0x483025){return function(_0x4d1e31){if(_0x4d1e31){return _0x4d1e31['update'](_0x292eea)[_0xb909('0x2c')](function(_0x1f7f7a){return _0x1f7f7a;});}return null;};}function removeEntity(_0x55fb5c,_0x3908fa){return function(_0x33678b){if(_0x33678b){return _0x33678b['destroy']()[_0xb909('0x2c')](function(){var _0x4cb9ae=_0x33678b[_0xb909('0x2d')]({'plain':!![]});var _0x558132=_0xb909('0x2e');return db[_0xb909('0x2f')]['destroy']({'where':{'type':_0x558132,'resourceId':_0x4cb9ae['id']}})[_0xb909('0x2c')](function(){return _0x33678b;});})[_0xb909('0x2c')](function(){_0x55fb5c['status'](0xcc)[_0xb909('0x21')]();});}};}function handleEntityNotFound(_0x20fb42,_0x43dc99){return function(_0x3ee97a){if(!_0x3ee97a){_0x20fb42['sendStatus'](0x194);}return _0x3ee97a;};}function handleError(_0x1c8ced,_0x4733f1){_0x4733f1=_0x4733f1||0x1f4;return function(_0x1ea2c7){logger[_0xb909('0x30')](_0x1ea2c7[_0xb909('0x31')]);if(_0x1ea2c7['name']){delete _0x1ea2c7[_0xb909('0x32')];}_0x1c8ced[_0xb909('0x22')](_0x4733f1)[_0xb909('0x33')](_0x1ea2c7);};}exports['index']=function(_0x581b90,_0x5c5213){var _0x2f8a04={},_0x1daa9={},_0x4dbd34={'count':0x0,'rows':[]};var _0x106509=_[_0xb909('0x34')](db['Plugin'][_0xb909('0x35')],function(_0xe0c55c){return{'name':_0xe0c55c[_0xb909('0x36')],'type':_0xe0c55c[_0xb909('0x37')][_0xb909('0x38')]};});_0x1daa9['model']=_[_0xb909('0x34')](_0x106509,_0xb909('0x32'));_0x1daa9[_0xb909('0x39')]=_[_0xb909('0x3a')](_0x581b90[_0xb909('0x39')]);_0x1daa9[_0xb909('0x3b')]=_[_0xb909('0x3c')](_0x1daa9[_0xb909('0x3d')],_0x1daa9['query']);_0x2f8a04['attributes']=_[_0xb909('0x3c')](_0x1daa9[_0xb909('0x3d')],qs[_0xb909('0x3e')](_0x581b90['query'][_0xb909('0x3e')]));_0x2f8a04[_0xb909('0x3f')]=_0x2f8a04[_0xb909('0x3f')]['length']?_0x2f8a04[_0xb909('0x3f')]:_0x1daa9[_0xb909('0x3d')];if(!_0x581b90['query'][_0xb909('0x40')](_0xb909('0x41'))){_0x2f8a04[_0xb909('0x26')]=qs['limit'](_0x581b90[_0xb909('0x39')][_0xb909('0x26')]);_0x2f8a04[_0xb909('0x24')]=qs['offset'](_0x581b90[_0xb909('0x39')][_0xb909('0x24')]);}_0x2f8a04['order']=qs['sort'](_0x581b90[_0xb909('0x39')]['sort']);_0x2f8a04['where']=qs[_0xb909('0x3b')](_[_0xb909('0x42')](_0x581b90[_0xb909('0x39')],_0x1daa9[_0xb909('0x3b')]),_0x106509);if(_0x581b90[_0xb909('0x39')]['filter']){_0x2f8a04['where']=_[_0xb909('0x43')](_0x2f8a04['where'],{'$or':_['map'](_0x106509,function(_0x38e491){if(_0x38e491['type']!==_0xb909('0x44')){var _0x117be4={};_0x117be4[_0x38e491['name']]={'$like':'%'+_0x581b90[_0xb909('0x39')][_0xb909('0x45')]+'%'};return _0x117be4;}})});}_0x2f8a04=_[_0xb909('0x43')]({},_0x2f8a04,_0x581b90['options']);var _0x5727e8={'where':_0x2f8a04[_0xb909('0x46')]};return db[_0xb909('0x47')][_0xb909('0x27')](_0x5727e8)[_0xb909('0x2c')](function(_0x449ae6){_0x4dbd34['count']=_0x449ae6;if(_0x581b90[_0xb909('0x39')][_0xb909('0x48')]){_0x2f8a04[_0xb909('0x49')]=[{'all':!![]}];}return db[_0xb909('0x47')]['findAll'](_0x2f8a04);})[_0xb909('0x2c')](function(_0x20a1e4){_0x4dbd34[_0xb909('0x4a')]=_0x20a1e4;return _0x4dbd34;})[_0xb909('0x2c')](respondWithFilteredResult(_0x5c5213,_0x2f8a04))[_0xb909('0x4b')](handleError(_0x5c5213,null));};exports[_0xb909('0x4c')]=function(_0x2b7f13,_0x12614a){var _0x5a1513={'raw':!![],'where':{'id':_0x2b7f13['params']['id']}},_0x509603={};_0x509603[_0xb909('0x3d')]=_[_0xb909('0x3a')](db[_0xb909('0x47')][_0xb909('0x35')]);_0x509603[_0xb909('0x39')]=_['keys'](_0x2b7f13[_0xb909('0x39')]);_0x509603[_0xb909('0x3b')]=_['intersection'](_0x509603[_0xb909('0x3d')],_0x509603[_0xb909('0x39')]);_0x5a1513[_0xb909('0x3f')]=_[_0xb909('0x3c')](_0x509603[_0xb909('0x3d')],qs[_0xb909('0x3e')](_0x2b7f13[_0xb909('0x39')][_0xb909('0x3e')]));_0x5a1513[_0xb909('0x3f')]=_0x5a1513['attributes'][_0xb909('0x4d')]?_0x5a1513[_0xb909('0x3f')]:_0x509603['model'];if(_0x2b7f13[_0xb909('0x39')][_0xb909('0x48')]){_0x5a1513[_0xb909('0x49')]=[{'all':!![]}];}_0x5a1513=_[_0xb909('0x43')]({},_0x5a1513,_0x2b7f13[_0xb909('0x4e')]);return db['Plugin']['find'](_0x5a1513)['then'](handleEntityNotFound(_0x12614a,null))['then'](respondWithResult(_0x12614a,null))['catch'](handleError(_0x12614a,null));};exports[_0xb909('0x4f')]=function(_0x49dbac,_0x1bb5f5,_0x3e74e1){return db[_0xb909('0x47')][_0xb909('0x50')]({'where':{'id':_0x49dbac[_0xb909('0x51')]['id']},'attributes':[_0xb909('0x32'),_0xb909('0x52')],'raw':!![]})[_0xb909('0x2c')](handleEntityNotFound(_0x1bb5f5,null))[_0xb909('0x2c')](function(_0x30b7d4){if(_0x30b7d4){var _0x8df4dc=path[_0xb909('0x53')](config[_0xb909('0x54')],_0xb909('0x55'),util[_0xb909('0x56')]('%s.zip',path[_0xb909('0x57')](_0x30b7d4[_0xb909('0x52')])));var _0x5aca53=fs['createWriteStream'](_0x8df4dc);var _0x3c8490=archiver(_0xb909('0x58'),{'zlib':{'level':0x9}});_0x3c8490['on'](_0xb909('0x59'),function(_0x2bc069){if(_0x2bc069['code']===_0xb909('0x5a')){logger['error'](_0x2bc069);}else{throw new db[(_0xb909('0x5b'))][(_0xb909('0x5c'))](_0xb909('0x5d'));}});_0x3c8490['on'](_0xb909('0x30'),function(_0x4c27bc){throw new db[(_0xb909('0x5b'))][(_0xb909('0x5c'))]('Error\x20while\x20generating\x20the\x20zip\x20archive');});_0x3c8490[_0xb909('0x5e')](_0x5aca53);_0x3c8490[_0xb909('0x5f')]('**/*',{'cwd':path[_0xb909('0x53')](config[_0xb909('0x54')],'server/files/plugins',path[_0xb909('0x60')](_0x30b7d4[_0xb909('0x52')])),'ignore':[path['join'](path['basename'](_0x30b7d4['path']),_0xb909('0x61')),path['join'](path[_0xb909('0x57')](_0x30b7d4[_0xb909('0x52')]),_0xb909('0x62'))],'nodir':!![]})[_0xb909('0x63')]();_0x5aca53['on'](_0xb909('0x64'),function(){if(!fs[_0xb909('0x65')](_0x8df4dc)){throw new db[(_0xb909('0x5b'))]['Error'](_0xb909('0x66'));}return _0x1bb5f5[_0xb909('0x4f')](_0x8df4dc,util[_0xb909('0x56')]('%s.zip',path[_0xb909('0x57')](_0x30b7d4[_0xb909('0x52')])),function(_0x4cd9ca){if(_0x4cd9ca){throw new db['Sequelize'][(_0xb909('0x5c'))](_0xb909('0x67'));}fs[_0xb909('0x68')](_0x8df4dc);logger[_0xb909('0x69')](_0xb909('0x6a'));logger[_0xb909('0x69')](_0xb909('0x6b'));});});}return null;})[_0xb909('0x4b')](handleError(_0x1bb5f5,null));};exports['upload']=function(_0x294ef1,_0x5e236f,_0x46f83f){var _0x1fe26e=path[_0xb909('0x57')](_0x294ef1['file'][_0xb909('0x6c')],path[_0xb909('0x6d')](_0x294ef1[_0xb909('0x6e')][_0xb909('0x6c')]));var _0x2150bb=path[_0xb909('0x53')](config[_0xb909('0x54')],_0xb909('0x55'),_0x294ef1[_0xb909('0x6e')]['filename']);var _0x6c2c85=path['join'](config[_0xb909('0x54')],_0xb909('0x55'),_0x1fe26e);logger[_0xb909('0x69')](_0xb909('0x6f'),_0x2150bb);logger['info'](_0xb909('0x70'),_0x6c2c85);try{fs[_0xb909('0x71')](_0x2150bb,parseInt(_0xb909('0x72'),0x8));extract(_0x2150bb,{'dir':_0x6c2c85},function(_0x4551d1){if(_0x4551d1){logger['error'](_0x4551d1);handleError(_0x4551d1,!![]);};var _0x27a2ef=fs[_0xb909('0x73')](_0x6c2c85);if(_0x27a2ef[_0xb909('0x4d')]>0x1){removeReferences(_0x2150bb,_0x6c2c85);logger[_0xb909('0x30')](_0xb909('0x74'));return _0x46f83f(new Error('Invalid\x20plugin\x20structure'));}var _0x627ad9=fs[_0xb909('0x75')](path[_0xb909('0x53')](_0x6c2c85,_0x27a2ef[0x0]));if(_0x627ad9[_0xb909('0x76')]()){removeReferences(_0x2150bb,_0x6c2c85);logger['error']('Invalid\x20plugin\x20structure');return _0x46f83f(new Error(_0xb909('0x74')));}if(_0x627ad9[_0xb909('0x77')]()){var _0x23989b=fs[_0xb909('0x73')](path[_0xb909('0x53')](_0x6c2c85,_0x27a2ef[0x0]));if(_0x23989b[_0xb909('0x4d')]===0x0){removeReferences(_0x2150bb,_0x6c2c85);logger['error'](_0xb909('0x74'));return _0x46f83f(new Error(_0xb909('0x74')));}var _0x37761b=_0x23989b[_0xb909('0x78')](function(_0x37a10b){return _0x37a10b===_0xb909('0x79');});if(!_0x37761b){return _0x46f83f(new Error('Plugin\x20manifest\x20missing'));}var _0x45416e=fs[_0xb909('0x7a')](path['join'](_0x6c2c85,_0x27a2ef[0x0],_0xb909('0x79')));var _0x373e73=JSON[_0xb909('0x7b')](_0x45416e);if(_0xb909('0x25')==typeof _0x373e73['name']){return _0x46f83f(new Error('Invalid\x20manifest:\x20name\x20missing'));}if(_0xb909('0x25')==typeof _0x373e73['type']){return _0x46f83f(new Error(_0xb909('0x7c')));}if('undefined'==typeof _0x373e73[_0xb909('0x7d')]){return _0x46f83f(new Error('Invalid\x20manifest:\x20version\x20not\x20specified'));}if('undefined'==typeof _0x373e73[_0xb909('0x7e')]){return _0x46f83f(new Error(_0xb909('0x7f')));}if(_0x373e73['type']===_0xb909('0x80')){if(_0xb909('0x25')==typeof _0x373e73[_0xb909('0x7e')]['views']){return _0x46f83f(new Error(_0xb909('0x81')));}if(_0xb909('0x25')==typeof _0x373e73[_0xb909('0x7e')]['views'][_0xb909('0x82')]&&_0xb909('0x25')==typeof _0x373e73['parameters'][_0xb909('0x83')][_0xb909('0x84')]){return _0x46f83f(new Error(_0xb909('0x85')));}}else if(_0x373e73[_0xb909('0x37')]===_0xb909('0x86')){if(_0xb909('0x25')==typeof _0x373e73[_0xb909('0x7e')][_0xb909('0x87')]){return _0x46f83f(new Error('Invalid\x20manifest:\x20script\x20name\x20missing'));}if(_0xb909('0x25')==typeof _0x373e73[_0xb909('0x7e')][_0xb909('0x88')]){return _0x46f83f(new Error(_0xb909('0x89')));}}else{return _0x46f83f(new Error(_0xb909('0x8a')));}var _0x6828ed=_0x373e73['name'];var _0x485d92=_0x373e73[_0xb909('0x8b')];var _0x2347b7=_0x373e73['type'];var _0xc03a8d=_0x373e73[_0xb909('0x8c')]?_0x373e73[_0xb909('0x8c')]:'always';var _0x296284=_0x373e73['icon']?_0x373e73[_0xb909('0x8d')]:_0xb909('0x8e');var _0x469cd1='';var _0x5c27cf='';var _0x51313c='';var _0x3155e9='';var _0x139bee=_0x373e73['version'];if(_0x2347b7==='html'){if(_0xb909('0x25')!=typeof _0x373e73[_0xb909('0x7e')][_0xb909('0x83')]['admin']){var _0x205e1b=_0x373e73[_0xb909('0x7e')][_0xb909('0x83')][_0xb909('0x82')];if(!/^(f|ht)tps?:\/\//i[_0xb909('0x8f')](_0x205e1b)){_0x469cd1=path['join'](_0xb909('0x90'),_0x1fe26e,_0x27a2ef[0x0],_0x205e1b);}else{_0x469cd1=_0x205e1b;}}else{logger['info'](_0xb909('0x91'));}if(_0xb909('0x25')!=typeof _0x373e73[_0xb909('0x7e')][_0xb909('0x83')][_0xb909('0x84')]){var _0x592a7b=_0x373e73[_0xb909('0x7e')]['views']['agent'];if(!/^(f|ht)tps?:\/\//i[_0xb909('0x8f')](_0x592a7b)){_0x5c27cf=path[_0xb909('0x53')](_0xb909('0x90'),_0x1fe26e,_0x27a2ef[0x0],_0x592a7b);}else{_0x5c27cf=_0x592a7b;}}else{logger[_0xb909('0x69')]('Warning:\x20agent\x20view\x20not\x20specified');}}else if(_0x2347b7===_0xb909('0x86')){_0x51313c=_0x373e73['parameters'][_0xb909('0x87')];_0x3155e9=_0x373e73[_0xb909('0x7e')]['scriptPath'];if(_0xb909('0x25')!=typeof _0x373e73[_0xb909('0x7e')][_0xb909('0x83')]){if('undefined'!=typeof _0x373e73[_0xb909('0x7e')][_0xb909('0x83')][_0xb909('0x82')]){var _0x205e1b=_0x373e73['parameters'][_0xb909('0x83')][_0xb909('0x82')];if(!/^(f|ht)tps?:\/\//i[_0xb909('0x8f')](_0x205e1b)){_0x469cd1=path['join']('plugins',_0x1fe26e,_0x27a2ef[0x0],_0x205e1b);}else{_0x469cd1=_0x205e1b;}}if(_0xb909('0x25')!=typeof _0x373e73['parameters'][_0xb909('0x83')][_0xb909('0x84')]){var _0x592a7b=_0x373e73[_0xb909('0x7e')]['views'][_0xb909('0x84')];if(!/^(f|ht)tps?:\/\//i[_0xb909('0x8f')](_0x592a7b)){_0x5c27cf=path['join'](_0xb909('0x90'),_0x1fe26e,_0x27a2ef[0x0],_0x592a7b);}else{_0x5c27cf=_0x592a7b;}}}}var _0x11df57={'name':_0x6828ed,'description':_0x485d92,'path':path[_0xb909('0x53')](_0x1fe26e,_0x27a2ef[0x0]),'type':_0x2347b7,'sidebar':_0xc03a8d,'icon':_0x296284,'adminUrl':_0x469cd1,'agentUrl':_0x5c27cf,'scriptName':_0x51313c,'scriptPath':_0x3155e9,'version':_0x139bee};removeReferences(_0x2150bb,null);return db[_0xb909('0x47')][_0xb909('0x92')](_0x11df57)[_0xb909('0x2c')](function(_0x4e8bb3){var _0x480ee2={'role':_0x294ef1[_0xb909('0x93')][_0xb909('0x94')],'userProfileId':_0x294ef1[_0xb909('0x93')][_0xb909('0x95')]};if(!_0x480ee2)throw new Error(_0xb909('0x96'));if(_0x480ee2['role']===_0xb909('0x97')){var _0x5750d2=_0x4e8bb3['get']({'plain':!![]});return db[_0xb909('0x98')][_0xb909('0x50')]({'where':{'name':_0xb909('0x2e'),'userProfileId':_0x480ee2[_0xb909('0x95')]},'raw':!![]})[_0xb909('0x2c')](function(_0x2a0c9e){if(_0x2a0c9e&&_0x2a0c9e[_0xb909('0x99')]===0x0){return db[_0xb909('0x2f')]['create']({'name':_0x5750d2['name'],'resourceId':_0x5750d2['id'],'type':_0x2a0c9e[_0xb909('0x32')],'sectionId':_0x2a0c9e['id']},{})['then'](function(){return _0x4e8bb3;});}else{return _0x4e8bb3;}})[_0xb909('0x4b')](function(_0x5588c9){logger['error'](_0xb909('0x9a'),_0x5588c9);throw _0x5588c9;});}return _0x4e8bb3;})['then'](respondWithResult(_0x5e236f,null))[_0xb909('0x4b')](handleError(_0x5e236f,null));}});}catch(_0x44baef){_0x5e236f[_0xb909('0x22')](0x1f4)[_0xb909('0x33')](_0x44baef);}};function removeReferences(_0x3cc925,_0x1ad9c5){try{if(_0x3cc925){fs[_0xb909('0x68')](_0x3cc925);logger['info'](_0xb909('0x9b'));}if(_0x1ad9c5){rimraf(_0x1ad9c5,function(){});logger['info'](_0xb909('0x9c'));}}catch(_0x2fcb95){logger[_0xb909('0x30')](_0x2fcb95);}}exports[_0xb909('0x9d')]=function(_0x5e3464,_0x42f645,_0x4e1166){return db[_0xb909('0x47')][_0xb909('0x50')]({'where':{'id':_0x5e3464[_0xb909('0x51')]['id']}})[_0xb909('0x2c')](handleEntityNotFound(_0x42f645,null))[_0xb909('0x2c')](saveUpdates(_0x5e3464[_0xb909('0x93')],null))['then'](respondWithResult(_0x42f645,null))[_0xb909('0x4b')](handleError(_0x42f645,null));};exports[_0xb909('0x9e')]=function(_0xd317a2,_0x1739a7,_0xe91977){return db[_0xb909('0x47')][_0xb909('0x50')]({'where':{'id':_0xd317a2['params']['id']}})[_0xb909('0x2c')](function(_0x354cf1){if(_0x354cf1){return _0x354cf1[_0xb909('0x9f')]();}})['then'](function(_0x8cb933){rimraf(path[_0xb909('0x53')](config[_0xb909('0x54')],_0xb909('0x55'),path[_0xb909('0x60')](_0x8cb933[_0xb909('0x52')])),function(){});return _0x8cb933;})[_0xb909('0x2c')](handleEntityNotFound(_0x1739a7,null))[_0xb909('0x2c')](respondWithStatusCode(_0x1739a7,null))['catch'](handleError(_0x1739a7,null));};exports['webhookGet']=function(_0x5c1d05,_0x54ac93,_0x2dd030){return BPromise[_0xb909('0xa0')]()[_0xb909('0x2c')](function(){if(!_0x5c1d05[_0xb909('0x39')][_0xb909('0x52')]){throw new Error(_0xb909('0xa1'));}if(!_0x5c1d05[_0xb909('0x39')][_0xb909('0xa2')]){throw new Error('\x27PORT\x27\x20parameter\x20not\x20specified');}var _0x18fd6d=_0x5c1d05[_0xb909('0x39')]['hostname']?_0x5c1d05[_0xb909('0x39')][_0xb909('0xa3')]+':'+_0x5c1d05[_0xb909('0x39')][_0xb909('0xa2')]:_0xb909('0xa4')+_0x5c1d05[_0xb909('0x39')][_0xb909('0xa2')];var _0x28b2b9=_0x5c1d05[_0xb909('0x39')]['json']?_0x5c1d05['query'][_0xb909('0x23')]:!![];var _0x54c20d=_0x5c1d05[_0xb909('0x39')][_0xb909('0xa5')]?_0x5c1d05[_0xb909('0x39')][_0xb909('0xa5')]:null;var _0x2a5b9c={'method':_0x5c1d05[_0xb909('0xa6')],'uri':util[_0xb909('0x56')]('%s%s',_0x18fd6d,_0x5c1d05[_0xb909('0x39')][_0xb909('0x52')]),'json':_0x28b2b9,'resolveWithFullResponse':!![],'encoding':_0x54c20d,'qs':_0x5c1d05[_0xb909('0x39')]};if(_0x5c1d05[_0xb909('0xa7')]){_0x2a5b9c[_0xb909('0xa7')]=_0x5c1d05[_0xb909('0xa7')];if(_0x2a5b9c[_0xb909('0xa7')][_0xb909('0xa8')]){delete _0x2a5b9c['headers'][_0xb909('0xa8')];}}if(_0x2a5b9c[_0xb909('0xa7')][_0xb909('0xa9')]){delete _0x2a5b9c['headers'][_0xb909('0xa9')];}return rp(_0x2a5b9c);})[_0xb909('0x2c')](function(_0xff04c5){if(_0xff04c5){_0x54ac93[_0xb909('0x28')](_0xff04c5[_0xb909('0xa7')]);logger[_0xb909('0x69')](_0xff04c5[_0xb909('0x93')]);if(_['endsWith'](_0x5c1d05[_0xb909('0x39')]['path'],_0xb909('0x4f'))&&_0xff04c5[_0xb909('0xaa')]==0x1f4){return _0x54ac93['sendStatus'](_0xff04c5[_0xb909('0xaa')]);}else{return _0x54ac93[_0xb909('0x22')](_0xff04c5[_0xb909('0xaa')])['send'](_0xff04c5[_0xb909('0x93')]);}}else{return _0x54ac93[_0xb909('0x20')](0xc8);}})['catch'](handleError(_0x54ac93,null));};exports['webhookPost']=function(_0x205d63,_0x4bc398,_0x47d811){return BPromise[_0xb909('0xa0')]()['then'](function(){if(!_0x205d63[_0xb909('0x39')][_0xb909('0x52')]){throw new Error(_0xb909('0xa1'));}if(!_0x205d63[_0xb909('0x39')]['port']){throw new Error(_0xb909('0xab'));}var _0x1fb219=_0x205d63[_0xb909('0x39')][_0xb909('0xa3')]?_0x205d63[_0xb909('0x39')][_0xb909('0xa3')]+':'+_0x205d63['query'][_0xb909('0xa2')]:'http://localhost:'+_0x205d63[_0xb909('0x39')][_0xb909('0xa2')];var _0xff7c36=_0x205d63[_0xb909('0x39')][_0xb909('0x23')]?_0x205d63[_0xb909('0x39')][_0xb909('0x23')]:!![];var _0x188432=_0x205d63['query'][_0xb909('0xa5')]?_0x205d63[_0xb909('0x39')]['encoding']:null;var _0x142778={'method':_0x205d63[_0xb909('0xa6')],'uri':util[_0xb909('0x56')](_0xb909('0xac'),_0x1fb219,_0x205d63[_0xb909('0x39')][_0xb909('0x52')]),'json':_0xff7c36,'resolveWithFullResponse':!![],'encoding':_0x188432,'body':_0x205d63[_0xb909('0x93')]};if(_0x205d63[_0xb909('0xa7')]){_0x142778[_0xb909('0xa7')]=_0x205d63[_0xb909('0xa7')];if(_0x142778[_0xb909('0xa7')]['content-length']){delete _0x142778[_0xb909('0xa7')][_0xb909('0xa8')];}}if(_0x142778['headers'][_0xb909('0xa9')]){delete _0x142778[_0xb909('0xa7')]['content-type'];}return rp(_0x142778);})[_0xb909('0x2c')](function(_0x1a51af){if(_0x1a51af){_0x4bc398[_0xb909('0x28')](_0x1a51af[_0xb909('0xa7')]);logger['info'](_0x1a51af[_0xb909('0x93')]);return _0x4bc398[_0xb909('0x22')](_0x1a51af[_0xb909('0xaa')])['send'](_0x1a51af[_0xb909('0x93')]);}else{return _0x4bc398[_0xb909('0x20')](0xc8);}})['catch'](handleError(_0x4bc398,null));}; \ No newline at end of file diff --git a/server/api/plugin/plugin.events.js b/server/api/plugin/plugin.events.js index 35ac3d6..e377038 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 _0xd9ef=['hook','exports','events','../../mysqldb','setMaxListeners','emit','hasOwnProperty'];(function(_0x416d75,_0x2c8e81){var _0x10af66=function(_0x48f136){while(--_0x48f136){_0x416d75['push'](_0x416d75['shift']());}};_0x10af66(++_0x2c8e81);}(_0xd9ef,0x95));var _0xfd9e=function(_0x7f5123,_0x3062c5){_0x7f5123=_0x7f5123-0x0;var _0x10a02a=_0xd9ef[_0x7f5123];return _0x10a02a;};'use strict';var EventEmitter=require(_0xfd9e('0x0'));var Plugin=require(_0xfd9e('0x1'))['db']['Plugin'];var PluginEvents=new EventEmitter();PluginEvents[_0xfd9e('0x2')](0x0);var events={'afterCreate':'save','afterUpdate':'update','afterDestroy':'remove'};function emitEvent(_0xdce9ae){return function(_0x28cfac,_0xe6990b,_0x1b2b0c){PluginEvents[_0xfd9e('0x3')](_0xdce9ae+':'+_0x28cfac['id'],_0x28cfac);PluginEvents[_0xfd9e('0x3')](_0xdce9ae,_0x28cfac);_0x1b2b0c(null);};}for(var e in events){if(events[_0xfd9e('0x4')](e)){var event=events[e];Plugin[_0xfd9e('0x5')](e,emitEvent(event));}}module[_0xfd9e('0x6')]=PluginEvents; \ No newline at end of file +var _0x2cd0=['exports','events','../../mysqldb','Plugin','setMaxListeners','save','update','remove','emit','hook'];(function(_0xe9a6c8,_0x1a50e0){var _0x2183d3=function(_0x19155e){while(--_0x19155e){_0xe9a6c8['push'](_0xe9a6c8['shift']());}};_0x2183d3(++_0x1a50e0);}(_0x2cd0,0x10f));var _0x02cd=function(_0x270c25,_0x2f0ed7){_0x270c25=_0x270c25-0x0;var _0x3c8aa2=_0x2cd0[_0x270c25];return _0x3c8aa2;};'use strict';var EventEmitter=require(_0x02cd('0x0'));var Plugin=require(_0x02cd('0x1'))['db'][_0x02cd('0x2')];var PluginEvents=new EventEmitter();PluginEvents[_0x02cd('0x3')](0x0);var events={'afterCreate':_0x02cd('0x4'),'afterUpdate':_0x02cd('0x5'),'afterDestroy':_0x02cd('0x6')};function emitEvent(_0x215b17){return function(_0x4fecc3,_0x3dfd49,_0x3c4a73){PluginEvents[_0x02cd('0x7')](_0x215b17+':'+_0x4fecc3['id'],_0x4fecc3);PluginEvents[_0x02cd('0x7')](_0x215b17,_0x4fecc3);_0x3c4a73(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];Plugin[_0x02cd('0x8')](e,emitEvent(event));}}module[_0x02cd('0x9')]=PluginEvents; \ No newline at end of file diff --git a/server/api/plugin/plugin.model.js b/server/api/plugin/plugin.model.js index f828c56..6ef385b 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 _0xcb8b=['rimraf','../../config/environment','./plugin.attributes','exports','define','Plugin','plugins','util','../../config/logger','moment','bluebird','path'];(function(_0x387777,_0x356171){var _0x3f84c0=function(_0x4d4423){while(--_0x4d4423){_0x387777['push'](_0x387777['shift']());}};_0x3f84c0(++_0x356171);}(_0xcb8b,0xc7));var _0xbcb8=function(_0x38e391,_0x5adde7){_0x38e391=_0x38e391-0x0;var _0x244319=_0xcb8b[_0x38e391];return _0x244319;};'use strict';var _=require('lodash');var util=require(_0xbcb8('0x0'));var logger=require(_0xbcb8('0x1'))('api');var moment=require(_0xbcb8('0x2'));var BPromise=require(_0xbcb8('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xbcb8('0x4'));var rimraf=require(_0xbcb8('0x5'));var config=require(_0xbcb8('0x6'));var attributes=require(_0xbcb8('0x7'));module[_0xbcb8('0x8')]=function(_0x429636,_0x29fbcd){return _0x429636[_0xbcb8('0x9')](_0xbcb8('0xa'),attributes,{'tableName':_0xbcb8('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x2f9a=['lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','../../config/environment','exports','define','Plugin','plugins'];(function(_0x5db569,_0x25707b){var _0x247b44=function(_0x4b7dfd){while(--_0x4b7dfd){_0x5db569['push'](_0x5db569['shift']());}};_0x247b44(++_0x25707b);}(_0x2f9a,0x186));var _0xa2f9=function(_0x435850,_0x32aa47){_0x435850=_0x435850-0x0;var _0x5453e4=_0x2f9a[_0x435850];return _0x5453e4;};'use strict';var _=require(_0xa2f9('0x0'));var util=require(_0xa2f9('0x1'));var logger=require(_0xa2f9('0x2'))(_0xa2f9('0x3'));var moment=require(_0xa2f9('0x4'));var BPromise=require(_0xa2f9('0x5'));var rp=require(_0xa2f9('0x6'));var fs=require('fs');var path=require(_0xa2f9('0x7'));var rimraf=require('rimraf');var config=require(_0xa2f9('0x8'));var attributes=require('./plugin.attributes');module[_0xa2f9('0x9')]=function(_0x432c26,_0x26b9ef){return _0x432c26[_0xa2f9('0xa')](_0xa2f9('0xb'),attributes,{'tableName':_0xa2f9('0xc'),'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 807543c..78e2082 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 _0xbf73=['localhost','socket.io-emitter','register','then','Plugin,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','info','catch','CreatePlugin','create','body','options','raw','util','moment','bluebird','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','redis','defaults'];(function(_0x525595,_0x5a70f1){var _0x30c04f=function(_0x219b29){while(--_0x219b29){_0x525595['push'](_0x525595['shift']());}};_0x30c04f(++_0x5a70f1);}(_0xbf73,0x1dc));var _0x3bf7=function(_0x2641f9,_0x26715f){_0x2641f9=_0x2641f9-0x0;var _0x585741=_0xbf73[_0x2641f9];return _0x585741;};'use strict';var _=require('lodash');var util=require(_0x3bf7('0x0'));var moment=require(_0x3bf7('0x1'));var BPromise=require(_0x3bf7('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x3bf7('0x3'))['db'];var utils=require(_0x3bf7('0x4'));var logger=require(_0x3bf7('0x5'))(_0x3bf7('0x6'));var config=require(_0x3bf7('0x7'));var jayson=require('jayson/promise');var client=jayson['client']['http']({'port':0x232a});config[_0x3bf7('0x8')]=_[_0x3bf7('0x9')](config['redis'],{'host':_0x3bf7('0xa'),'port':0x18eb});var socket=require(_0x3bf7('0xb'))(new Redis(config['redis']));require('./plugin.socket')[_0x3bf7('0xc')](socket);function respondWithRpcPromise(_0x33c476,_0x1a9f5a,_0x50a1cb){return new BPromise(function(_0x4eb8c5,_0x532304){return client['request'](_0x33c476,_0x50a1cb)[_0x3bf7('0xd')](function(_0x588cbb){logger['info'](_0x3bf7('0xe'),_0x1a9f5a,_0x3bf7('0xf'));logger['debug']('Plugin,\x20%s,\x20%s,\x20%s',_0x1a9f5a,_0x3bf7('0xf'),JSON[_0x3bf7('0x10')](_0x588cbb));if(_0x588cbb[_0x3bf7('0x11')]){if(_0x588cbb[_0x3bf7('0x11')][_0x3bf7('0x12')]===0x1f4){logger['error'](_0x3bf7('0xe'),_0x1a9f5a,_0x588cbb[_0x3bf7('0x11')][_0x3bf7('0x13')]);return _0x532304(_0x588cbb[_0x3bf7('0x11')][_0x3bf7('0x13')]);}logger[_0x3bf7('0x11')](_0x3bf7('0xe'),_0x1a9f5a,_0x588cbb['error'][_0x3bf7('0x13')]);return _0x4eb8c5(_0x588cbb['error'][_0x3bf7('0x13')]);}else{logger[_0x3bf7('0x14')](_0x3bf7('0xe'),_0x1a9f5a,_0x3bf7('0xf'));_0x4eb8c5(_0x588cbb['result'][_0x3bf7('0x13')]);}})[_0x3bf7('0x15')](function(_0x56f13c){logger[_0x3bf7('0x11')](_0x3bf7('0xe'),_0x1a9f5a,_0x56f13c);_0x532304(_0x56f13c);});});}exports[_0x3bf7('0x16')]=function(_0x3a922e){var _0x19a96d=this;return new Promise(function(_0x1a93e9,_0x3c44cc){return db['Plugin'][_0x3bf7('0x17')](_0x3a922e[_0x3bf7('0x18')],{'raw':_0x3a922e[_0x3bf7('0x19')]?_0x3a922e['options'][_0x3bf7('0x1a')]===undefined?!![]:![]:!![]})[_0x3bf7('0xd')](function(_0x3067c6){logger[_0x3bf7('0x14')](_0x3bf7('0x16'),_0x3a922e);logger['debug'](_0x3bf7('0x16'),_0x3a922e,JSON['stringify'](_0x3067c6));_0x1a93e9(_0x3067c6);})[_0x3bf7('0x15')](function(_0x2eef3d){logger['error'](_0x3bf7('0x16'),_0x2eef3d['message'],_0x3a922e);_0x3c44cc(_0x19a96d['error'](0x1f4,_0x2eef3d[_0x3bf7('0x13')]));});});}; \ No newline at end of file +var _0xea7c=['redis','localhost','socket.io-emitter','./plugin.socket','request','then','Plugin,\x20%s,\x20%s','request\x20sent','stringify','code','error','message','info','result','catch','CreatePlugin','Plugin','body','options','debug','moment','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http'];(function(_0x5d2d6b,_0x261c09){var _0x1fa7e4=function(_0x89c96f){while(--_0x89c96f){_0x5d2d6b['push'](_0x5d2d6b['shift']());}};_0x1fa7e4(++_0x261c09);}(_0xea7c,0xe6));var _0xcea7=function(_0x19950b,_0x53d0d7){_0x19950b=_0x19950b-0x0;var _0x3c6b41=_0xea7c[_0x19950b];return _0x3c6b41;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0xcea7('0x0'));var BPromise=require('bluebird');var rs=require(_0xcea7('0x1'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xcea7('0x2'))['db'];var utils=require(_0xcea7('0x3'));var logger=require(_0xcea7('0x4'))(_0xcea7('0x5'));var config=require(_0xcea7('0x6'));var jayson=require(_0xcea7('0x7'));var client=jayson[_0xcea7('0x8')][_0xcea7('0x9')]({'port':0x232a});config[_0xcea7('0xa')]=_['defaults'](config[_0xcea7('0xa')],{'host':_0xcea7('0xb'),'port':0x18eb});var socket=require(_0xcea7('0xc'))(new Redis(config[_0xcea7('0xa')]));require(_0xcea7('0xd'))['register'](socket);function respondWithRpcPromise(_0x260938,_0x4fc8a2,_0x39f75d){return new BPromise(function(_0x274578,_0x52739d){return client[_0xcea7('0xe')](_0x260938,_0x39f75d)[_0xcea7('0xf')](function(_0x110812){logger['info'](_0xcea7('0x10'),_0x4fc8a2,_0xcea7('0x11'));logger['debug']('Plugin,\x20%s,\x20%s,\x20%s',_0x4fc8a2,_0xcea7('0x11'),JSON[_0xcea7('0x12')](_0x110812));if(_0x110812['error']){if(_0x110812['error'][_0xcea7('0x13')]===0x1f4){logger[_0xcea7('0x14')](_0xcea7('0x10'),_0x4fc8a2,_0x110812[_0xcea7('0x14')]['message']);return _0x52739d(_0x110812[_0xcea7('0x14')][_0xcea7('0x15')]);}logger[_0xcea7('0x14')](_0xcea7('0x10'),_0x4fc8a2,_0x110812['error'][_0xcea7('0x15')]);return _0x274578(_0x110812['error'][_0xcea7('0x15')]);}else{logger[_0xcea7('0x16')](_0xcea7('0x10'),_0x4fc8a2,_0xcea7('0x11'));_0x274578(_0x110812[_0xcea7('0x17')][_0xcea7('0x15')]);}})[_0xcea7('0x18')](function(_0x3f60eb){logger[_0xcea7('0x14')](_0xcea7('0x10'),_0x4fc8a2,_0x3f60eb);_0x52739d(_0x3f60eb);});});}exports[_0xcea7('0x19')]=function(_0x437894){var _0x589b30=this;return new Promise(function(_0x2c4f52,_0x4e406){return db[_0xcea7('0x1a')]['create'](_0x437894[_0xcea7('0x1b')],{'raw':_0x437894[_0xcea7('0x1c')]?_0x437894['options']['raw']===undefined?!![]:![]:!![]})[_0xcea7('0xf')](function(_0x42b0e4){logger[_0xcea7('0x16')](_0xcea7('0x19'),_0x437894);logger[_0xcea7('0x1d')](_0xcea7('0x19'),_0x437894,JSON[_0xcea7('0x12')](_0x42b0e4));_0x2c4f52(_0x42b0e4);})[_0xcea7('0x18')](function(_0x917584){logger[_0xcea7('0x14')](_0xcea7('0x19'),_0x917584[_0xcea7('0x15')],_0x437894);_0x4e406(_0x589b30[_0xcea7('0x14')](0x1f4,_0x917584['message']));});});}; \ No newline at end of file diff --git a/server/api/plugin/plugin.socket.js b/server/api/plugin/plugin.socket.js index 314927e..b1a5c24 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 _0xee56=['plugin:','./plugin.events','save','remove','emit','removeListener','register'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0xee56,0x1e4));var _0x6ee5=function(_0x4cc492,_0x162c85){_0x4cc492=_0x4cc492-0x0;var _0x1f36b9=_0xee56[_0x4cc492];return _0x1f36b9;};'use strict';var PluginEvents=require(_0x6ee5('0x0'));var events=[_0x6ee5('0x1'),_0x6ee5('0x2'),'update'];function createListener(_0x50439c,_0x2c74a3){return function(_0x362e9a){_0x2c74a3[_0x6ee5('0x3')](_0x50439c,_0x362e9a);};}function removeListener(_0x3c0da7,_0x18658d){return function(){PluginEvents[_0x6ee5('0x4')](_0x3c0da7,_0x18658d);};}exports[_0x6ee5('0x5')]=function(_0x2356aa){for(var _0x1d2e7a=0x0,_0x44428e=events['length'];_0x1d2e7a<_0x44428e;_0x1d2e7a++){var _0x26ddc0=events[_0x1d2e7a];var _0x15212c=createListener(_0x6ee5('0x6')+_0x26ddc0,_0x2356aa);PluginEvents['on'](_0x26ddc0,_0x15212c);}}; \ No newline at end of file +var _0x65b4=['update','emit','removeListener','register','length','plugin:','remove'];(function(_0x4a9fb1,_0x273043){var _0x348672=function(_0x142b69){while(--_0x142b69){_0x4a9fb1['push'](_0x4a9fb1['shift']());}};_0x348672(++_0x273043);}(_0x65b4,0x1c6));var _0x465b=function(_0x178b79,_0x26c7e6){_0x178b79=_0x178b79-0x0;var _0x542454=_0x65b4[_0x178b79];return _0x542454;};'use strict';var PluginEvents=require('./plugin.events');var events=['save',_0x465b('0x0'),_0x465b('0x1')];function createListener(_0x288f16,_0x2c5e43){return function(_0xaa2009){_0x2c5e43[_0x465b('0x2')](_0x288f16,_0xaa2009);};}function removeListener(_0x49b27c,_0x1bac18){return function(){PluginEvents[_0x465b('0x3')](_0x49b27c,_0x1bac18);};}exports[_0x465b('0x4')]=function(_0x2254ec){for(var _0x37d2ab=0x0,_0x41346f=events[_0x465b('0x5')];_0x37d2ab<_0x41346f;_0x37d2ab++){var _0x513fbc=events[_0x37d2ab];var _0x4f63bd=createListener(_0x465b('0x6')+_0x513fbc,_0x2254ec);PluginEvents['on'](_0x513fbc,_0x4f63bd);}}; \ No newline at end of file diff --git a/server/api/pm2/index.js b/server/api/pm2/index.js index 50ac260..1565bc3 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(_0x5e4194,_0x33719b){var _0x9eb876=function(_0x2d26dd){while(--_0x2d26dd){_0x5e4194['push'](_0x5e4194['shift']());}};_0x9eb876(++_0x33719b);}(_0xa9e0,0x123));var _0x0a9e=function(_0x3b5250,_0x7a0b2c){_0x3b5250=_0x3b5250-0x0;var _0xc844a1=_0xa9e0[_0x3b5250];return _0xc844a1;};'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(_0x109a4a,_0x44e37b){var _0x34d616=function(_0x1997ed){while(--_0x1997ed){_0x109a4a['push'](_0x109a4a['shift']());}};_0x34d616(++_0x44e37b);}(_0xa9e0,0x123));var _0x0a9e=function(_0x187ee1,_0x3fd1e6){_0x187ee1=_0x187ee1-0x0;var _0x388160=_0xa9e0[_0x187ee1];return _0x388160;};'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 7bf47c8..4976ec5 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 _0x4ded=['name','express','motion2','catch','show','create','body','script','../../files/plugins','cwd','chdir','dirname','dump','Missing\x20name\x20and/or\x20path','update','restart','hasOwnProperty','params','delete','lodash','../../config/pm2','../../config/logger','api','path','child_process','exec','bluebird','sendStatus','status','json','error','send','info','index','list','then','reject'];(function(_0x574deb,_0x4e0b8e){var _0x3fee34=function(_0x4f52c2){while(--_0x4f52c2){_0x574deb['push'](_0x574deb['shift']());}};_0x3fee34(++_0x4e0b8e);}(_0x4ded,0x116));var _0xd4de=function(_0x4b8dc3,_0x365d55){_0x4b8dc3=_0x4b8dc3-0x0;var _0x45472c=_0x4ded[_0x4b8dc3];return _0x45472c;};'use strict';var _=require(_0xd4de('0x0'));var pm2=require(_0xd4de('0x1'));var logger=require(_0xd4de('0x2'))(_0xd4de('0x3'));var path=require(_0xd4de('0x4'));var exec=require(_0xd4de('0x5'))[_0xd4de('0x6')];var BPromise=require(_0xd4de('0x7'));function handleEntityNotFound(_0x20930f,_0x36d4dd){return function(_0x2e8d86){if(!_0x2e8d86){_0x20930f[_0xd4de('0x8')](0x194);;}return _0x2e8d86;};}function respondWithResult(_0x554a51,_0x23e5b9){_0x23e5b9=_0x23e5b9||0xc8;return function(_0x2433b8){if(_0x2433b8){return _0x554a51[_0xd4de('0x9')](_0x23e5b9)[_0xd4de('0xa')](_0x2433b8);}return null;};}function handleError(_0x4453c2,_0x1e8c35){_0x1e8c35=_0x1e8c35||0x1f4;return function(_0x5c612f){logger[_0xd4de('0xb')](_0x5c612f['stack']);if(_0x5c612f['name']){delete _0x5c612f['name'];}_0x4453c2[_0xd4de('0x9')](_0x1e8c35)[_0xd4de('0xc')](_0x5c612f);};}function execChildProcess(){return new BPromise(function(_0x4e5b10,_0x5b6dc4){exec('npm\x20install',function(_0x29e265,_0x49d931,_0x38ac13){logger[_0xd4de('0xd')](_0x49d931);logger[_0xd4de('0xd')](_0x38ac13);if(_0x29e265){logger[_0xd4de('0xb')](_0x29e265);return _0x5b6dc4(_0x29e265);}return _0x4e5b10(_0x49d931);});});}exports[_0xd4de('0xe')]=function(_0x3af6e0,_0x1dc9d5){return pm2[_0xd4de('0xf')]()[_0xd4de('0x10')](function(_0x37cb9f){if(_0x37cb9f){var _0x691ba9=_[_0xd4de('0x11')](_0x37cb9f,function(_0x164ca0){return _0x164ca0[_0xd4de('0x12')]===_0xd4de('0x13')||_0x164ca0[_0xd4de('0x12')]===_0xd4de('0x14');});return{'rows':_0x691ba9,'count':_0x691ba9['length']};}return null;})['then'](respondWithResult(_0x1dc9d5,null))[_0xd4de('0x15')](handleError(_0x1dc9d5,null));};exports[_0xd4de('0x16')]=function(_0x17b377,_0x428aa2){return pm2['describe'](_0x17b377['params']['id'])[_0xd4de('0x10')](respondWithResult(_0x428aa2,null))['then'](handleEntityNotFound(_0x428aa2,null))[_0xd4de('0x15')](handleError(_0x428aa2,null));};exports[_0xd4de('0x17')]=function(_0x50b9e3,_0xc15081){if(_0x50b9e3['body'][_0xd4de('0x12')]&&_0x50b9e3[_0xd4de('0x18')][_0xd4de('0x19')]){var _0x8e8712=path['join'](__dirname,_0xd4de('0x1a'),_0x50b9e3[_0xd4de('0x18')][_0xd4de('0x19')]);var _0xdb3fc=process[_0xd4de('0x1b')]();process[_0xd4de('0x1c')](path[_0xd4de('0x1d')](_0x8e8712));return execChildProcess()[_0xd4de('0x10')](function(_0x2f9de6){process[_0xd4de('0x1c')](_0xdb3fc);return pm2['start']({'name':_0x50b9e3[_0xd4de('0x18')][_0xd4de('0x12')],'script':_0x8e8712});})[_0xd4de('0x10')](function(_0x22970c){pm2[_0xd4de('0x1e')]();return _0x22970c[0x0];})[_0xd4de('0x10')](respondWithResult(_0xc15081,0xc9))[_0xd4de('0x15')](handleError(_0xc15081,null));}else{return _0xc15081[_0xd4de('0x9')](0x1f4)[_0xd4de('0xc')]({'message':_0xd4de('0x1f')});}};exports[_0xd4de('0x20')]=function(_0xb2d8a1,_0x586126){if(_0xb2d8a1[_0xd4de('0x18')]['id']){delete _0xb2d8a1[_0xd4de('0x18')]['id'];}var _0x5005b0={'online':_0xd4de('0x21'),'stopped':'stop'};if(_0x5005b0[_0xd4de('0x22')](_0xb2d8a1[_0xd4de('0x18')][_0xd4de('0x9')])){return pm2[_0x5005b0[_0xb2d8a1['body'][_0xd4de('0x9')]]](_0xb2d8a1[_0xd4de('0x23')]['id'])[_0xd4de('0x10')](respondWithResult(_0x586126,0xc8))['catch'](handleError(_0x586126,null));}else{return _0x586126[_0xd4de('0x9')](0x1f4)[_0xd4de('0xc')]({'message':'Unknown\x20status'});}};exports['destroy']=function(_0x5706fe,_0x3f6491){if(_0x5706fe['body']['id']){delete _0x5706fe[_0xd4de('0x18')]['id'];}if(_0x5706fe[_0xd4de('0x23')]['id']){return pm2[_0xd4de('0x24')](_0x5706fe[_0xd4de('0x23')]['id'])['then'](function(_0x3fe6c8){pm2[_0xd4de('0x1e')]();return _0x3fe6c8[0x0];})['then'](respondWithResult(_0x3f6491,null))[_0xd4de('0x15')](handleError(_0x3f6491,null));}else{return _0x3f6491[_0xd4de('0x9')](0x1f4)['send']({'message':'Unknown\x20id'});}}; \ No newline at end of file +var _0x54ef=['bluebird','status','error','name','send','npm\x20install','info','index','list','reject','express','motion2','catch','show','describe','params','then','create','script','join','../../files/plugins','body','cwd','chdir','dirname','dump','Missing\x20name\x20and/or\x20path','update','restart','hasOwnProperty','Unknown\x20status','destroy','delete','Unknown\x20id','lodash','../../config/pm2','../../config/logger','path','child_process','exec'];(function(_0x2867d8,_0xef3ee0){var _0x3b8176=function(_0x2b9eb8){while(--_0x2b9eb8){_0x2867d8['push'](_0x2867d8['shift']());}};_0x3b8176(++_0xef3ee0);}(_0x54ef,0x112));var _0xf54e=function(_0x2ca2c9,_0x47c42c){_0x2ca2c9=_0x2ca2c9-0x0;var _0x92127a=_0x54ef[_0x2ca2c9];return _0x92127a;};'use strict';var _=require(_0xf54e('0x0'));var pm2=require(_0xf54e('0x1'));var logger=require(_0xf54e('0x2'))('api');var path=require(_0xf54e('0x3'));var exec=require(_0xf54e('0x4'))[_0xf54e('0x5')];var BPromise=require(_0xf54e('0x6'));function handleEntityNotFound(_0x8b6bb6,_0x431e36){return function(_0x12d43f){if(!_0x12d43f){_0x8b6bb6['sendStatus'](0x194);;}return _0x12d43f;};}function respondWithResult(_0x55e611,_0x18e84e){_0x18e84e=_0x18e84e||0xc8;return function(_0x99cf9){if(_0x99cf9){return _0x55e611[_0xf54e('0x7')](_0x18e84e)['json'](_0x99cf9);}return null;};}function handleError(_0x27e69b,_0x57a1ce){_0x57a1ce=_0x57a1ce||0x1f4;return function(_0x40a75d){logger[_0xf54e('0x8')](_0x40a75d['stack']);if(_0x40a75d[_0xf54e('0x9')]){delete _0x40a75d[_0xf54e('0x9')];}_0x27e69b[_0xf54e('0x7')](_0x57a1ce)[_0xf54e('0xa')](_0x40a75d);};}function execChildProcess(){return new BPromise(function(_0x5f232a,_0x558502){exec(_0xf54e('0xb'),function(_0x143d66,_0x326eef,_0x553759){logger[_0xf54e('0xc')](_0x326eef);logger['info'](_0x553759);if(_0x143d66){logger['error'](_0x143d66);return _0x558502(_0x143d66);}return _0x5f232a(_0x326eef);});});}exports[_0xf54e('0xd')]=function(_0x2033e9,_0x28f776){return pm2[_0xf54e('0xe')]()['then'](function(_0x331732){if(_0x331732){var _0x1bbeaa=_[_0xf54e('0xf')](_0x331732,function(_0x15f639){return _0x15f639['name']===_0xf54e('0x10')||_0x15f639[_0xf54e('0x9')]===_0xf54e('0x11');});return{'rows':_0x1bbeaa,'count':_0x1bbeaa['length']};}return null;})['then'](respondWithResult(_0x28f776,null))[_0xf54e('0x12')](handleError(_0x28f776,null));};exports[_0xf54e('0x13')]=function(_0x1c02e7,_0x9647f){return pm2[_0xf54e('0x14')](_0x1c02e7[_0xf54e('0x15')]['id'])[_0xf54e('0x16')](respondWithResult(_0x9647f,null))[_0xf54e('0x16')](handleEntityNotFound(_0x9647f,null))[_0xf54e('0x12')](handleError(_0x9647f,null));};exports[_0xf54e('0x17')]=function(_0x226c96,_0x50fc66){if(_0x226c96['body'][_0xf54e('0x9')]&&_0x226c96['body'][_0xf54e('0x18')]){var _0x1bfe99=path[_0xf54e('0x19')](__dirname,_0xf54e('0x1a'),_0x226c96[_0xf54e('0x1b')][_0xf54e('0x18')]);var _0x388aa0=process[_0xf54e('0x1c')]();process[_0xf54e('0x1d')](path[_0xf54e('0x1e')](_0x1bfe99));return execChildProcess()[_0xf54e('0x16')](function(_0x5b83df){process[_0xf54e('0x1d')](_0x388aa0);return pm2['start']({'name':_0x226c96[_0xf54e('0x1b')][_0xf54e('0x9')],'script':_0x1bfe99});})[_0xf54e('0x16')](function(_0x474b61){pm2[_0xf54e('0x1f')]();return _0x474b61[0x0];})[_0xf54e('0x16')](respondWithResult(_0x50fc66,0xc9))[_0xf54e('0x12')](handleError(_0x50fc66,null));}else{return _0x50fc66[_0xf54e('0x7')](0x1f4)[_0xf54e('0xa')]({'message':_0xf54e('0x20')});}};exports[_0xf54e('0x21')]=function(_0x39c0ae,_0x2ea001){if(_0x39c0ae['body']['id']){delete _0x39c0ae[_0xf54e('0x1b')]['id'];}var _0x4cbf7c={'online':_0xf54e('0x22'),'stopped':'stop'};if(_0x4cbf7c[_0xf54e('0x23')](_0x39c0ae[_0xf54e('0x1b')][_0xf54e('0x7')])){return pm2[_0x4cbf7c[_0x39c0ae[_0xf54e('0x1b')][_0xf54e('0x7')]]](_0x39c0ae[_0xf54e('0x15')]['id'])[_0xf54e('0x16')](respondWithResult(_0x2ea001,0xc8))['catch'](handleError(_0x2ea001,null));}else{return _0x2ea001['status'](0x1f4)[_0xf54e('0xa')]({'message':_0xf54e('0x24')});}};exports[_0xf54e('0x25')]=function(_0x16d00f,_0xb2d4c4){if(_0x16d00f[_0xf54e('0x1b')]['id']){delete _0x16d00f[_0xf54e('0x1b')]['id'];}if(_0x16d00f[_0xf54e('0x15')]['id']){return pm2[_0xf54e('0x26')](_0x16d00f[_0xf54e('0x15')]['id'])['then'](function(_0x5f29d3){pm2[_0xf54e('0x1f')]();return _0x5f29d3[0x0];})[_0xf54e('0x16')](respondWithResult(_0xb2d4c4,null))['catch'](handleError(_0xb2d4c4,null));}else{return _0xb2d4c4[_0xf54e('0x7')](0x1f4)[_0xf54e('0xa')]({'message':_0xf54e('0x27')});}}; \ No newline at end of file diff --git a/server/api/realtime/index.js b/server/api/realtime/index.js index cc4ec85..06a0da3 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 _0xd6d1=['get','/agents','isAuthenticated','getAgents','/queues','getQueues','express','Router','../../components/auth/service','./realtime.controller'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xd6d1,0x6a));var _0x1d6d=function(_0x630c54,_0x12c462){_0x630c54=_0x630c54-0x0;var _0x496c56=_0xd6d1[_0x630c54];return _0x496c56;};'use strict';var express=require(_0x1d6d('0x0'));var router=express[_0x1d6d('0x1')]();var auth=require(_0x1d6d('0x2'));var controller=require(_0x1d6d('0x3'));router[_0x1d6d('0x4')](_0x1d6d('0x5'),auth[_0x1d6d('0x6')](),controller[_0x1d6d('0x7')]);router['get'](_0x1d6d('0x8'),auth['isAuthenticated'](),controller[_0x1d6d('0x9')]);module['exports']=router; \ No newline at end of file +var _0xd016=['express','../../components/auth/service','get','isAuthenticated','getAgents','exports'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0xd016,0x66));var _0x6d01=function(_0x3ee48d,_0x3395ae){_0x3ee48d=_0x3ee48d-0x0;var _0x1c3cea=_0xd016[_0x3ee48d];return _0x1c3cea;};'use strict';var express=require(_0x6d01('0x0'));var router=express['Router']();var auth=require(_0x6d01('0x1'));var controller=require('./realtime.controller');router[_0x6d01('0x2')]('/agents',auth[_0x6d01('0x3')](),controller[_0x6d01('0x4')]);router[_0x6d01('0x2')]('/queues',auth[_0x6d01('0x3')](),controller['getQueues']);module[_0x6d01('0x5')]=router; \ No newline at end of file diff --git a/server/api/realtime/realtime.controller.js b/server/api/realtime/realtime.controller.js index ab65d09..f36431c 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 _0x7219=['getChannels','query','globalStatusFilter','pauseTypeFilter','pause','*pause','resolve','then','channel','isValidChannel','format','toLowerCase','globalStatus','sort','validateSortParameter','fields','join','order','getSortedAgentsIdsByStatus','getAgentIdsByStatus','User','rawAttributes','fieldName','type','role','agent','length','push','sequelize','forEach','Pause','merge','where','user','userProfileId','Agents','online','extraQueryConditions','assign','UserProfile','getResources','rows','map','find','includes','voice','voiceStatus','Status','sortAgentsByStatus','getRealtimeAgentsQueryFields','pick','catch','getQueues','Channel\x20parameter\x20%s\x20is\x20invalid','startCase','Queue','key','name','outbound','dialMethod','getOptions','Queues','filter','findAndCountAll','getRealtimeQueues','initializeQueues','../../components/realtime/agents','../../components/realtime/queues','../../components/parsers/qs','../../config/utils','../../mysqldb','../../errors/api','APIBadRequestError','handleError','undefined','limit','count','offset','status','set','json','getAgents'];(function(_0x3a7634,_0x2db384){var _0x23bbe9=function(_0x226734){while(--_0x226734){_0x3a7634['push'](_0x3a7634['shift']());}};_0x23bbe9(++_0x2db384);}(_0x7219,0xe6));var _0x9721=function(_0x2e68c4,_0x56fc8d){_0x2e68c4=_0x2e68c4-0x0;var _0xb5006a=_0x7219[_0x2e68c4];return _0xb5006a;};'use strict';var _=require('lodash');var util=require('util');var rta=require(_0x9721('0x0'));var rtq=require(_0x9721('0x1'));var qs=require(_0x9721('0x2'));var utils=require(_0x9721('0x3'));var db=require(_0x9721('0x4'))['db'];var APIBadRequestError=require(_0x9721('0x5'))[_0x9721('0x6')];var APIHandleError=require(_0x9721('0x5'))[_0x9721('0x7')];function respondWithFilteredResult(_0x52731f,_0x5122f4){return function(_0x3e9612){if(_0x3e9612){var _0x5f2783=typeof _0x5122f4['offset']===_0x9721('0x8')&&typeof _0x5122f4[_0x9721('0x9')]===_0x9721('0x8');var _0x245fe9=_0x3e9612[_0x9721('0xa')];var _0x52f705=_0x5f2783?0x0:_0x5122f4['offset'];var _0x23883f=_0x5f2783?_0x3e9612['count']:_0x5122f4[_0x9721('0xb')]+_0x5122f4[_0x9721('0x9')];var _0x5f1984;if(_0x23883f>=_0x245fe9){_0x23883f=_0x245fe9;_0x5f1984=0xc8;}else{_0x5f1984=0xce;}_0x52731f[_0x9721('0xc')](_0x5f1984);return _0x52731f[_0x9721('0xd')]('Content-Range',_0x52f705+'-'+_0x23883f+'/'+_0x245fe9)[_0x9721('0xe')](_0x3e9612);}return null;};}exports[_0x9721('0xf')]=function(_0x51e853,_0x4f8291){var _0x42c8de={'count':0x0,'rows':[]};var _0x20ccdf={};var _0x31400a;var _0x83f645=utils[_0x9721('0x10')]();var _0x398364;var _0x224938;var _0x4b8f1b=_0x51e853[_0x9721('0x11')]['globalQueueFilter'];var _0xfb9c5e=_0x51e853[_0x9721('0x11')][_0x9721('0x12')];var _0x484979=_0x51e853[_0x9721('0x11')][_0x9721('0x13')];var _0x1d2aa6=_0xfb9c5e===_0x9721('0x14')||_0xfb9c5e===_0x9721('0x15')?!![]:![];var _0x2ca45d=[];var _0x3a094d;var _0x35d006;Promise[_0x9721('0x16')]()[_0x9721('0x17')](function(){if(_0x51e853[_0x9721('0x11')][_0x9721('0x18')]){if(!utils[_0x9721('0x19')](_0x51e853['query'][_0x9721('0x18')])){throw new APIBadRequestError(util[_0x9721('0x1a')]('Channel\x20parameter\x20%s\x20is\x20invalid',_0x51e853['query']['channel']));}_0x31400a=_0x51e853[_0x9721('0x11')][_0x9721('0x18')][_0x9721('0x1b')]();}if(!_0x51e853[_0x9721('0x11')]['sort']||!_0x51e853[_0x9721('0x11')]['sort']['includes'](_0x9721('0x1c'))){_0x51e853['query'][_0x9721('0x1d')]=rta[_0x9721('0x1e')](_0x51e853[_0x9721('0x11')][_0x9721('0x1d')]);return;}var _0x58e9d2=rta['getUpdatedSortOptions'](_0x51e853[_0x9721('0x11')][_0x9721('0x1d')]);_0x51e853[_0x9721('0x11')][_0x9721('0x1d')]=_0x58e9d2[_0x9721('0x1f')][_0x9721('0x20')](',');_0x3a094d=_0x58e9d2[_0x9721('0x21')];})[_0x9721('0x17')](function(){if(!_0x4b8f1b){return[];}return rta['getAgentIdsByQueues'](_0x4b8f1b,_0x31400a);})[_0x9721('0x17')](function(_0x5e1d26){_0x2ca45d=_0x5e1d26;return rta['getRealtimeAgents']();})[_0x9721('0x17')](function(_0x2ec697){_0x224938=_0x2ec697['rows'];if((!_0xfb9c5e||_0x1d2aa6)&&!_0x3a094d){return _0x2ca45d;}if(_0x3a094d&&!_0xfb9c5e){return rta[_0x9721('0x22')](_0x224938,_0x2ca45d,_0x3a094d);}else{return rta[_0x9721('0x23')](_0x224938,_0x2ca45d,_0xfb9c5e);}})[_0x9721('0x17')](function(_0x33bd18){_0x2ca45d=_0x33bd18;var _0x352607=![];if(_0x2ca45d['length']===0x0){if(_0x4b8f1b||_0xfb9c5e){_0x352607=!![];}if(_0x1d2aa6){_0x352607=![];}}if(_0x352607){return _0x42c8de;}var _0x4b9c74=_['map'](db[_0x9721('0x24')][_0x9721('0x25')],function(_0x2c5554){return{'name':_0x2c5554[_0x9721('0x26')],'type':_0x2c5554[_0x9721('0x27')]['key']};});_0x51e853[_0x9721('0x11')][_0x9721('0x28')]=_0x9721('0x29');_0x20ccdf=qs['getOptions'](_0x4b9c74,_0x51e853);_0x20ccdf['raw']=!![];var _0x2bdf90=[];if(_0x2ca45d[_0x9721('0x2a')]>0x0){_0x2bdf90[_0x9721('0x2b')]({'id':{'$in':_0x2ca45d}});if(_0x3a094d&&!_0xfb9c5e){_0x35d006=[db[_0x9721('0x2c')]['literal']('FIELD(id,'+_0x2ca45d+')')];_0x20ccdf[_0x9721('0x21')]=_0x35d006;}}if(_0x1d2aa6){_0x83f645[_0x9721('0x2d')](function(_0x4d313a){var _0x5173b6=!![];if(_0xfb9c5e===_0x9721('0x15')&&_0x31400a!==_0x4d313a){_0x5173b6=![];}_0x2bdf90[_0x9721('0x2b')]({[_0x4d313a+_0x9721('0x2e')]:_0x5173b6});});if(_0x484979){_0x2bdf90[_0x9721('0x2b')]({'pauseType':_0x484979});}}else if(_0xfb9c5e){_0x83f645[_0x9721('0x2d')](function(_0x7dfc19){_0x2bdf90[_0x9721('0x2b')]({[_0x7dfc19+_0x9721('0x2e')]:![]});});}_0x20ccdf['where']=_[_0x9721('0x2f')](_0x20ccdf[_0x9721('0x30')],{'$and':_0x2bdf90});if(_0x51e853['user'][_0x9721('0x28')]===_0x9721('0x31')){var _0x210cdc={'params':{'id':_0x51e853[_0x9721('0x31')][_0x9721('0x32')]},'query':{'section':_0x9721('0x33'),'role':_0x9721('0x29'),'raw':!![],'ids':_0x2ca45d,'customSorting':_0x35d006}};if(_0x51e853[_0x9721('0x11')]['online']){_0x210cdc['query'][_0x9721('0x34')]=!![];}if(_0x1d2aa6){_0x210cdc[_0x9721('0x11')][_0x9721('0x35')]=_0x2bdf90;}_0x210cdc['query']=Object[_0x9721('0x36')](_0x210cdc['query'],_0x51e853[_0x9721('0x11')]);return db[_0x9721('0x37')][_0x9721('0x38')](_0x210cdc);}return db[_0x9721('0x24')]['findAndCountAll'](_0x20ccdf);})[_0x9721('0x17')](function(_0x30d0c5){_0x42c8de[_0x9721('0xa')]=_0x30d0c5[_0x9721('0xa')];_0x398364=_0x30d0c5[_0x9721('0x39')];return _0x398364[_0x9721('0x3a')](function(_0x32d58c){var _0x3ac30f=_[_0x9721('0x3b')](_0x224938,['id',_0x32d58c['id']]);if(_0x3ac30f){var _0x209e85=rta['filterAgentAttributes'](_0x3ac30f);_[_0x9721('0x2f')](_0x32d58c,_0x209e85);}_0x32d58c['globalStatus']=rta['getAgentStatus'](_0x32d58c);if(_0x32d58c['globalStatus'][_0x9721('0x3c')](_0x9721('0x14'))){_0x83f645['forEach'](function(_0x15f1f1){if(_0x32d58c[_0x15f1f1+_0x9721('0x2e')]){if(_0x15f1f1===_0x9721('0x3d')){if(_0x32d58c[_0x9721('0x3e')]!=='talking'){_0x32d58c['voiceStatus']='pause';}}else{_0x32d58c[_0x15f1f1+_0x9721('0x3f')]=_0x9721('0x14');}}});}return _0x32d58c;});})[_0x9721('0x17')](function(_0x84cc34){if(!_0x3a094d||_0x35d006){return _0x84cc34;}return rta[_0x9721('0x40')](_0x84cc34,_0x3a094d);})[_0x9721('0x17')](function(_0x492d04){var _0x7641e8=rta[_0x9721('0x41')]();_0x42c8de[_0x9721('0x39')]=_0x492d04[_0x9721('0x3a')](function(_0x418211){return _[_0x9721('0x42')](_0x418211,_0x7641e8);});return _0x42c8de;})[_0x9721('0x17')](respondWithFilteredResult(_0x4f8291,_0x20ccdf))[_0x9721('0x43')](APIHandleError(_0x4f8291));};exports[_0x9721('0x44')]=function(_0x22da70,_0x57daf5){var _0x1f559f={'count':0x0,'rows':[]};var _0x577a57={};var _0x22d480;var _0x570e9d;var _0x25a417;Promise[_0x9721('0x16')]()[_0x9721('0x17')](function(){if(_0x22da70[_0x9721('0x11')]['channel']){if(!utils['isValidChannel'](_0x22da70['query'][_0x9721('0x18')])){throw new APIBadRequestError(util[_0x9721('0x1a')](_0x9721('0x45'),_0x22da70['query'][_0x9721('0x18')]));}_0x22d480=_0x22da70[_0x9721('0x11')]['channel'][_0x9721('0x1b')]();}var _0x57d4fa=_[_0x9721('0x46')](_0x22d480)+_0x9721('0x47');var _0x1dcb9b=_[_0x9721('0x3a')](db[_0x57d4fa]['rawAttributes'],function(_0x1c4908){return{'name':_0x1c4908['fieldName'],'type':_0x1c4908[_0x9721('0x27')][_0x9721('0x48')]};});if(!_0x22da70[_0x9721('0x11')]['fields']){var _0xf2088a=['id',_0x9721('0x49')];if(_0x22d480===_0x9721('0x3d')){_0xf2088a[_0x9721('0x2b')](_0x9721('0x27'));if(_0x22da70[_0x9721('0x11')][_0x9721('0x27')]===_0x9721('0x4a')){_0xf2088a['push'](['dialActive',_0x9721('0x4b')]);}}_0x22da70[_0x9721('0x11')]['fields']=_0xf2088a[_0x9721('0x20')](',');}_0x577a57=qs[_0x9721('0x4c')](_0x1dcb9b,_0x22da70);if(_0x22da70['user'][_0x9721('0x28')]===_0x9721('0x31')){var _0x5d02ed={'params':{'id':_0x22da70[_0x9721('0x31')]['userProfileId']},'query':{'section':_0x22d480===_0x9721('0x3d')&&_0x22da70['query'][_0x9721('0x27')]==='outbound'?'QueueCampaigns':_[_0x9721('0x46')](_0x22d480)+_0x9721('0x4d'),'type':_0x22da70[_0x9721('0x11')][_0x9721('0x27')],'nolimit':!![],'sort':_0x9721('0x49'),'filter':_0x22da70['query'][_0x9721('0x4e')]}};_0x5d02ed[_0x9721('0x11')]=Object[_0x9721('0x36')](_0x5d02ed[_0x9721('0x11')],_0x22da70['query']);delete _0x5d02ed[_0x9721('0x11')]['id'];return db['UserProfile'][_0x9721('0x38')](_0x5d02ed);}return db[_0x57d4fa][_0x9721('0x4f')](_0x577a57);})[_0x9721('0x17')](function(_0xb5ac34){_0x1f559f[_0x9721('0xa')]=_0xb5ac34[_0x9721('0xa')];_0x570e9d=_0xb5ac34[_0x9721('0x39')];return rtq[_0x9721('0x50')](_0x22da70,_0x22d480);})[_0x9721('0x17')](function(_0x47c15a){_0x25a417=_0x47c15a[_0x9721('0x39')];return rtq[_0x9721('0x51')](_0x570e9d,_0x25a417,_0x22d480,_0x22da70['query'][_0x9721('0x27')]);})['then'](function(_0x5d68bb){_0x1f559f['rows']=_0x5d68bb;return _0x1f559f;})[_0x9721('0x17')](respondWithFilteredResult(_0x57daf5,_0x577a57))[_0x9721('0x43')](APIHandleError(_0x57daf5));}; \ No newline at end of file +var _0xe458=['getOptions','raw','sequelize','literal','FIELD(id,','order','push','Pause','forEach','where','merge','user','userProfileId','Agents','online','extraQueryConditions','assign','UserProfile','getResources','findAndCountAll','rows','filterAgentAttributes','getAgentStatus','includes','voice','voiceStatus','talking','Status','getRealtimeAgentsQueryFields','pick','catch','getQueues','fields','name','outbound','dialActive','dialMethod','QueueCampaigns','filter','initializeQueues','lodash','util','../../components/realtime/agents','../../components/realtime/queues','../../components/parsers/qs','../../config/utils','../../mysqldb','APIBadRequestError','handleError','offset','undefined','limit','count','status','Content-Range','getAgents','query','globalQueueFilter','globalStatusFilter','pauseTypeFilter','pause','*pause','resolve','then','isValidChannel','channel','format','Channel\x20parameter\x20%s\x20is\x20invalid','toLowerCase','sort','globalStatus','getUpdatedSortOptions','join','getAgentIdsByQueues','getSortedAgentsIdsByStatus','getAgentIdsByStatus','length','map','rawAttributes','fieldName','type','key','role','agent'];(function(_0x3a891d,_0xb8a0){var _0xcbbb0e=function(_0x46a943){while(--_0x46a943){_0x3a891d['push'](_0x3a891d['shift']());}};_0xcbbb0e(++_0xb8a0);}(_0xe458,0x7c));var _0x8e45=function(_0x2de4a7,_0x48906e){_0x2de4a7=_0x2de4a7-0x0;var _0x269013=_0xe458[_0x2de4a7];return _0x269013;};'use strict';var _=require(_0x8e45('0x0'));var util=require(_0x8e45('0x1'));var rta=require(_0x8e45('0x2'));var rtq=require(_0x8e45('0x3'));var qs=require(_0x8e45('0x4'));var utils=require(_0x8e45('0x5'));var db=require(_0x8e45('0x6'))['db'];var APIBadRequestError=require('../../errors/api')[_0x8e45('0x7')];var APIHandleError=require('../../errors/api')[_0x8e45('0x8')];function respondWithFilteredResult(_0x296425,_0x708a68){return function(_0x295776){if(_0x295776){var _0x310350=typeof _0x708a68[_0x8e45('0x9')]===_0x8e45('0xa')&&typeof _0x708a68[_0x8e45('0xb')]===_0x8e45('0xa');var _0x53b153=_0x295776[_0x8e45('0xc')];var _0x28f17e=_0x310350?0x0:_0x708a68[_0x8e45('0x9')];var _0x4fef8c=_0x310350?_0x295776['count']:_0x708a68[_0x8e45('0x9')]+_0x708a68['limit'];var _0x2c0462;if(_0x4fef8c>=_0x53b153){_0x4fef8c=_0x53b153;_0x2c0462=0xc8;}else{_0x2c0462=0xce;}_0x296425[_0x8e45('0xd')](_0x2c0462);return _0x296425['set'](_0x8e45('0xe'),_0x28f17e+'-'+_0x4fef8c+'/'+_0x53b153)['json'](_0x295776);}return null;};}exports[_0x8e45('0xf')]=function(_0x2d2443,_0x5c4db5){var _0x5ade32={'count':0x0,'rows':[]};var _0x56de4d={};var _0x281a32;var _0x12387c=utils['getChannels']();var _0x1c0dbf;var _0x4255dc;var _0xf38b5e=_0x2d2443[_0x8e45('0x10')][_0x8e45('0x11')];var _0x15c91a=_0x2d2443[_0x8e45('0x10')][_0x8e45('0x12')];var _0x495062=_0x2d2443[_0x8e45('0x10')][_0x8e45('0x13')];var _0x181ee9=_0x15c91a===_0x8e45('0x14')||_0x15c91a===_0x8e45('0x15')?!![]:![];var _0x15717c=[];var _0x244ab5;var _0x5d8240;Promise[_0x8e45('0x16')]()[_0x8e45('0x17')](function(){if(_0x2d2443[_0x8e45('0x10')]['channel']){if(!utils[_0x8e45('0x18')](_0x2d2443[_0x8e45('0x10')][_0x8e45('0x19')])){throw new APIBadRequestError(util[_0x8e45('0x1a')](_0x8e45('0x1b'),_0x2d2443['query'][_0x8e45('0x19')]));}_0x281a32=_0x2d2443['query']['channel'][_0x8e45('0x1c')]();}if(!_0x2d2443[_0x8e45('0x10')]['sort']||!_0x2d2443[_0x8e45('0x10')][_0x8e45('0x1d')]['includes'](_0x8e45('0x1e'))){_0x2d2443[_0x8e45('0x10')]['sort']=rta['validateSortParameter'](_0x2d2443[_0x8e45('0x10')]['sort']);return;}var _0x1eccbc=rta[_0x8e45('0x1f')](_0x2d2443[_0x8e45('0x10')]['sort']);_0x2d2443[_0x8e45('0x10')]['sort']=_0x1eccbc['fields'][_0x8e45('0x20')](',');_0x244ab5=_0x1eccbc['order'];})[_0x8e45('0x17')](function(){if(!_0xf38b5e){return[];}return rta[_0x8e45('0x21')](_0xf38b5e,_0x281a32);})[_0x8e45('0x17')](function(_0x18ec95){_0x15717c=_0x18ec95;return rta['getRealtimeAgents']();})['then'](function(_0x4a2257){_0x4255dc=_0x4a2257['rows'];if((!_0x15c91a||_0x181ee9)&&!_0x244ab5){return _0x15717c;}if(_0x244ab5&&!_0x15c91a){return rta[_0x8e45('0x22')](_0x4255dc,_0x15717c,_0x244ab5);}else{return rta[_0x8e45('0x23')](_0x4255dc,_0x15717c,_0x15c91a);}})[_0x8e45('0x17')](function(_0x3aaf29){_0x15717c=_0x3aaf29;var _0x29f0a7=![];if(_0x15717c[_0x8e45('0x24')]===0x0){if(_0xf38b5e||_0x15c91a){_0x29f0a7=!![];}if(_0x181ee9){_0x29f0a7=![];}}if(_0x29f0a7){return _0x5ade32;}var _0x248de8=_[_0x8e45('0x25')](db['User'][_0x8e45('0x26')],function(_0x166e93){return{'name':_0x166e93[_0x8e45('0x27')],'type':_0x166e93[_0x8e45('0x28')][_0x8e45('0x29')]};});_0x2d2443[_0x8e45('0x10')][_0x8e45('0x2a')]=_0x8e45('0x2b');_0x56de4d=qs[_0x8e45('0x2c')](_0x248de8,_0x2d2443);_0x56de4d[_0x8e45('0x2d')]=!![];var _0x5d38cd=[];if(_0x15717c[_0x8e45('0x24')]>0x0){_0x5d38cd['push']({'id':{'$in':_0x15717c}});if(_0x244ab5&&!_0x15c91a){_0x5d8240=[db[_0x8e45('0x2e')][_0x8e45('0x2f')](_0x8e45('0x30')+_0x15717c+')')];_0x56de4d[_0x8e45('0x31')]=_0x5d8240;}}if(_0x181ee9){_0x12387c['forEach'](function(_0x166951){var _0x55ba92=!![];if(_0x15c91a===_0x8e45('0x15')&&_0x281a32!==_0x166951){_0x55ba92=![];}_0x5d38cd[_0x8e45('0x32')]({[_0x166951+_0x8e45('0x33')]:_0x55ba92});});if(_0x495062){_0x5d38cd[_0x8e45('0x32')]({'pauseType':_0x495062});}}else if(_0x15c91a){_0x12387c[_0x8e45('0x34')](function(_0x245aa2){_0x5d38cd['push']({[_0x245aa2+_0x8e45('0x33')]:![]});});}_0x56de4d[_0x8e45('0x35')]=_[_0x8e45('0x36')](_0x56de4d['where'],{'$and':_0x5d38cd});if(_0x2d2443['user'][_0x8e45('0x2a')]===_0x8e45('0x37')){var _0x14ec54={'params':{'id':_0x2d2443[_0x8e45('0x37')][_0x8e45('0x38')]},'query':{'section':_0x8e45('0x39'),'role':'agent','raw':!![],'ids':_0x15717c,'customSorting':_0x5d8240}};if(_0x2d2443[_0x8e45('0x10')]['online']){_0x14ec54[_0x8e45('0x10')][_0x8e45('0x3a')]=!![];}if(_0x181ee9){_0x14ec54[_0x8e45('0x10')][_0x8e45('0x3b')]=_0x5d38cd;}_0x14ec54[_0x8e45('0x10')]=Object[_0x8e45('0x3c')](_0x14ec54[_0x8e45('0x10')],_0x2d2443[_0x8e45('0x10')]);return db[_0x8e45('0x3d')][_0x8e45('0x3e')](_0x14ec54);}return db['User'][_0x8e45('0x3f')](_0x56de4d);})[_0x8e45('0x17')](function(_0x648f89){_0x5ade32[_0x8e45('0xc')]=_0x648f89['count'];_0x1c0dbf=_0x648f89[_0x8e45('0x40')];return _0x1c0dbf[_0x8e45('0x25')](function(_0xbaf3f2){var _0x45495f=_['find'](_0x4255dc,['id',_0xbaf3f2['id']]);if(_0x45495f){var _0x49eb28=rta[_0x8e45('0x41')](_0x45495f);_['merge'](_0xbaf3f2,_0x49eb28);}_0xbaf3f2[_0x8e45('0x1e')]=rta[_0x8e45('0x42')](_0xbaf3f2);if(_0xbaf3f2[_0x8e45('0x1e')][_0x8e45('0x43')](_0x8e45('0x14'))){_0x12387c['forEach'](function(_0x1794a8){if(_0xbaf3f2[_0x1794a8+_0x8e45('0x33')]){if(_0x1794a8===_0x8e45('0x44')){if(_0xbaf3f2[_0x8e45('0x45')]!==_0x8e45('0x46')){_0xbaf3f2[_0x8e45('0x45')]=_0x8e45('0x14');}}else{_0xbaf3f2[_0x1794a8+_0x8e45('0x47')]=_0x8e45('0x14');}}});}return _0xbaf3f2;});})[_0x8e45('0x17')](function(_0x85205){if(!_0x244ab5||_0x5d8240){return _0x85205;}return rta['sortAgentsByStatus'](_0x85205,_0x244ab5);})[_0x8e45('0x17')](function(_0xe8f317){var _0x716833=rta[_0x8e45('0x48')]();_0x5ade32['rows']=_0xe8f317[_0x8e45('0x25')](function(_0x49399f){return _[_0x8e45('0x49')](_0x49399f,_0x716833);});return _0x5ade32;})['then'](respondWithFilteredResult(_0x5c4db5,_0x56de4d))[_0x8e45('0x4a')](APIHandleError(_0x5c4db5));};exports[_0x8e45('0x4b')]=function(_0x15f17b,_0x3a6d8b){var _0x267279={'count':0x0,'rows':[]};var _0x491688={};var _0x13c365;var _0x13de6f;var _0x188ba0;Promise[_0x8e45('0x16')]()[_0x8e45('0x17')](function(){if(_0x15f17b[_0x8e45('0x10')][_0x8e45('0x19')]){if(!utils[_0x8e45('0x18')](_0x15f17b[_0x8e45('0x10')][_0x8e45('0x19')])){throw new APIBadRequestError(util[_0x8e45('0x1a')](_0x8e45('0x1b'),_0x15f17b[_0x8e45('0x10')][_0x8e45('0x19')]));}_0x13c365=_0x15f17b[_0x8e45('0x10')]['channel'][_0x8e45('0x1c')]();}var _0x1908ed=_['startCase'](_0x13c365)+'Queue';var _0x4aa952=_[_0x8e45('0x25')](db[_0x1908ed]['rawAttributes'],function(_0x3ecb03){return{'name':_0x3ecb03[_0x8e45('0x27')],'type':_0x3ecb03['type'][_0x8e45('0x29')]};});if(!_0x15f17b[_0x8e45('0x10')][_0x8e45('0x4c')]){var _0x3557cd=['id',_0x8e45('0x4d')];if(_0x13c365==='voice'){_0x3557cd[_0x8e45('0x32')](_0x8e45('0x28'));if(_0x15f17b[_0x8e45('0x10')][_0x8e45('0x28')]===_0x8e45('0x4e')){_0x3557cd[_0x8e45('0x32')]([_0x8e45('0x4f'),_0x8e45('0x50')]);}}_0x15f17b[_0x8e45('0x10')][_0x8e45('0x4c')]=_0x3557cd[_0x8e45('0x20')](',');}_0x491688=qs[_0x8e45('0x2c')](_0x4aa952,_0x15f17b);if(_0x15f17b[_0x8e45('0x37')][_0x8e45('0x2a')]===_0x8e45('0x37')){var _0x52efe5={'params':{'id':_0x15f17b[_0x8e45('0x37')][_0x8e45('0x38')]},'query':{'section':_0x13c365===_0x8e45('0x44')&&_0x15f17b['query']['type']==='outbound'?_0x8e45('0x51'):_['startCase'](_0x13c365)+'Queues','type':_0x15f17b[_0x8e45('0x10')]['type'],'nolimit':!![],'sort':_0x8e45('0x4d'),'filter':_0x15f17b[_0x8e45('0x10')][_0x8e45('0x52')]}};_0x52efe5[_0x8e45('0x10')]=Object['assign'](_0x52efe5[_0x8e45('0x10')],_0x15f17b['query']);delete _0x52efe5[_0x8e45('0x10')]['id'];return db[_0x8e45('0x3d')][_0x8e45('0x3e')](_0x52efe5);}return db[_0x1908ed]['findAndCountAll'](_0x491688);})['then'](function(_0x4fc219){_0x267279[_0x8e45('0xc')]=_0x4fc219[_0x8e45('0xc')];_0x13de6f=_0x4fc219['rows'];return rtq['getRealtimeQueues'](_0x15f17b,_0x13c365);})[_0x8e45('0x17')](function(_0xdb3fcc){_0x188ba0=_0xdb3fcc['rows'];return rtq[_0x8e45('0x53')](_0x13de6f,_0x188ba0,_0x13c365,_0x15f17b[_0x8e45('0x10')][_0x8e45('0x28')]);})['then'](function(_0x13cbc2){_0x267279[_0x8e45('0x40')]=_0x13cbc2;return _0x267279;})[_0x8e45('0x17')](respondWithFilteredResult(_0x3a6d8b,_0x491688))[_0x8e45('0x4a')](APIHandleError(_0x3a6d8b));}; \ No newline at end of file diff --git a/server/api/reportAgentPreview/index.js b/server/api/reportAgentPreview/index.js index 3ad251e..74700a1 100644 --- a/server/api/reportAgentPreview/index.js +++ b/server/api/reportAgentPreview/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x70e0=['../../components/auth/service','../../components/interaction/service','exports','multer','util','path','Router','fs-extra'];(function(_0x21f993,_0x4ef8d4){var _0x292585=function(_0x5296ba){while(--_0x5296ba){_0x21f993['push'](_0x21f993['shift']());}};_0x292585(++_0x4ef8d4);}(_0x70e0,0x17b));var _0x070e=function(_0x44060b,_0x374f1f){_0x44060b=_0x44060b-0x0;var _0x57b6d1=_0x70e0[_0x44060b];return _0x57b6d1;};'use strict';var multer=require(_0x070e('0x0'));var util=require(_0x070e('0x1'));var path=require(_0x070e('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x070e('0x3')]();var fs_extra=require(_0x070e('0x4'));var auth=require(_0x070e('0x5'));var interaction=require(_0x070e('0x6'));var config=require('../../config/environment');module[_0x070e('0x7')]=router; \ No newline at end of file +var _0xe706=['../../components/interaction/service','../../config/environment','exports','multer','util','path','express','Router','fs-extra','../../components/auth/service'];(function(_0x28b3e5,_0x665e48){var _0x541968=function(_0x1e5876){while(--_0x1e5876){_0x28b3e5['push'](_0x28b3e5['shift']());}};_0x541968(++_0x665e48);}(_0xe706,0xa3));var _0x6e70=function(_0x1317ed,_0x57217d){_0x1317ed=_0x1317ed-0x0;var _0xbaeca=_0xe706[_0x1317ed];return _0xbaeca;};'use strict';var multer=require(_0x6e70('0x0'));var util=require(_0x6e70('0x1'));var path=require(_0x6e70('0x2'));var timeout=require('connect-timeout');var express=require(_0x6e70('0x3'));var router=express[_0x6e70('0x4')]();var fs_extra=require(_0x6e70('0x5'));var auth=require(_0x6e70('0x6'));var interaction=require(_0x6e70('0x7'));var config=require(_0x6e70('0x8'));module[_0x6e70('0x9')]=router; \ No newline at end of file diff --git a/server/api/reportAgentPreview/reportAgentPreview.attributes.js b/server/api/reportAgentPreview/reportAgentPreview.attributes.js index 4c3bf88..79933f7 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 _0xc051=['STRING','sequelize','exports','DATE'];(function(_0x48d783,_0xa6344a){var _0x5d4118=function(_0xfd4232){while(--_0xfd4232){_0x48d783['push'](_0x48d783['shift']());}};_0x5d4118(++_0xa6344a);}(_0xc051,0xb5));var _0x1c05=function(_0x254570,_0x3139f5){_0x254570=_0x254570-0x0;var _0x516d5b=_0xc051[_0x254570];return _0x516d5b;};'use strict';var Sequelize=require(_0x1c05('0x0'));module[_0x1c05('0x1')]={'state':{'type':Sequelize['INTEGER'](0x2)},'statedesc':{'type':Sequelize['STRING']},'scheduledat':{'type':Sequelize[_0x1c05('0x2')]},'uniqueid':{'type':Sequelize[_0x1c05('0x3')]},'starttime':{'type':Sequelize[_0x1c05('0x2')]},'responsetime':{'type':Sequelize[_0x1c05('0x2')]},'ringtime':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'campaign':{'type':Sequelize[_0x1c05('0x3')]},'campaigntype':{'type':Sequelize[_0x1c05('0x3')]},'membername':{'type':Sequelize[_0x1c05('0x3')]}}; \ No newline at end of file +var _0x812d=['STRING','DATE','exports','INTEGER'];(function(_0x2c91e9,_0x2fb965){var _0x13f0ff=function(_0xb39edf){while(--_0xb39edf){_0x2c91e9['push'](_0x2c91e9['shift']());}};_0x13f0ff(++_0x2fb965);}(_0x812d,0x6e));var _0xd812=function(_0x3130ee,_0x1e802a){_0x3130ee=_0x3130ee-0x0;var _0x57bae0=_0x812d[_0x3130ee];return _0x57bae0;};'use strict';var Sequelize=require('sequelize');module[_0xd812('0x0')]={'state':{'type':Sequelize[_0xd812('0x1')](0x2)},'statedesc':{'type':Sequelize[_0xd812('0x2')]},'scheduledat':{'type':Sequelize[_0xd812('0x3')]},'uniqueid':{'type':Sequelize[_0xd812('0x2')]},'starttime':{'type':Sequelize[_0xd812('0x3')]},'responsetime':{'type':Sequelize[_0xd812('0x3')]},'ringtime':{'type':Sequelize[_0xd812('0x1')],'defaultValue':0x0},'campaign':{'type':Sequelize['STRING']},'campaigntype':{'type':Sequelize[_0xd812('0x2')]},'membername':{'type':Sequelize[_0xd812('0x2')]}}; \ No newline at end of file diff --git a/server/api/reportAgentPreview/reportAgentPreview.model.js b/server/api/reportAgentPreview/reportAgentPreview.model.js index 3fde66a..b2a423f 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 _0xdf18=['api','moment','bluebird','path','rimraf','../../config/environment','exports','ReportAgentPreview','report_agent_preview','lodash','util','../../config/logger'];(function(_0x42bdad,_0x12836c){var _0x122626=function(_0x2eb29c){while(--_0x2eb29c){_0x42bdad['push'](_0x42bdad['shift']());}};_0x122626(++_0x12836c);}(_0xdf18,0x1c5));var _0x8df1=function(_0x41bf49,_0x5956e5){_0x41bf49=_0x41bf49-0x0;var _0x29b3c3=_0xdf18[_0x41bf49];return _0x29b3c3;};'use strict';var _=require(_0x8df1('0x0'));var util=require(_0x8df1('0x1'));var logger=require(_0x8df1('0x2'))(_0x8df1('0x3'));var moment=require(_0x8df1('0x4'));var BPromise=require(_0x8df1('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x8df1('0x6'));var rimraf=require(_0x8df1('0x7'));var config=require(_0x8df1('0x8'));var attributes=require('./reportAgentPreview.attributes');module[_0x8df1('0x9')]=function(_0x281ef6,_0x19428c){return _0x281ef6['define'](_0x8df1('0xa'),attributes,{'tableName':_0x8df1('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xde48=['moment','bluebird','path','rimraf','../../config/environment','exports','define','ReportAgentPreview','lodash','util','../../config/logger','api'];(function(_0x420c63,_0x1be485){var _0x4b05ba=function(_0x5c0736){while(--_0x5c0736){_0x420c63['push'](_0x420c63['shift']());}};_0x4b05ba(++_0x1be485);}(_0xde48,0x194));var _0x8de4=function(_0x543084,_0x4337f5){_0x543084=_0x543084-0x0;var _0x306a57=_0xde48[_0x543084];return _0x306a57;};'use strict';var _=require(_0x8de4('0x0'));var util=require(_0x8de4('0x1'));var logger=require(_0x8de4('0x2'))(_0x8de4('0x3'));var moment=require(_0x8de4('0x4'));var BPromise=require(_0x8de4('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x8de4('0x6'));var rimraf=require(_0x8de4('0x7'));var config=require(_0x8de4('0x8'));var attributes=require('./reportAgentPreview.attributes');module[_0x8de4('0x9')]=function(_0x428f7b,_0x5af40f){return _0x428f7b[_0x8de4('0xa')](_0x8de4('0xb'),attributes,{'tableName':'report_agent_preview','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/reportAgentPreview/reportAgentPreview.rpc.js b/server/api/reportAgentPreview/reportAgentPreview.rpc.js index d2f907e..2bb003c 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 _0xb76c=['code','message','result','catch','CreateReportAgentPreview','ReportAgentPreview','create','body','raw','lodash','util','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','request','then','info','ReportAgentPreview,\x20%s,\x20%s','debug','ReportAgentPreview,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error'];(function(_0x5712f8,_0x17156b){var _0x14a364=function(_0x1da9de){while(--_0x1da9de){_0x5712f8['push'](_0x5712f8['shift']());}};_0x14a364(++_0x17156b);}(_0xb76c,0x81));var _0xcb76=function(_0x1a8f86,_0x5ed9c4){_0x1a8f86=_0x1a8f86-0x0;var _0x20d876=_0xb76c[_0x1a8f86];return _0x20d876;};'use strict';var _=require(_0xcb76('0x0'));var util=require(_0xcb76('0x1'));var moment=require(_0xcb76('0x2'));var BPromise=require(_0xcb76('0x3'));var rs=require(_0xcb76('0x4'));var fs=require('fs');var Redis=require(_0xcb76('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0xcb76('0x6'));var logger=require(_0xcb76('0x7'))('rpc');var config=require(_0xcb76('0x8'));var jayson=require(_0xcb76('0x9'));var client=jayson[_0xcb76('0xa')][_0xcb76('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x5b2780,_0x298ffc,_0x441764){return new BPromise(function(_0x4b929b,_0x5c5eaa){return client[_0xcb76('0xc')](_0x5b2780,_0x441764)[_0xcb76('0xd')](function(_0x4aed67){logger[_0xcb76('0xe')](_0xcb76('0xf'),_0x298ffc,'request\x20sent');logger[_0xcb76('0x10')](_0xcb76('0x11'),_0x298ffc,_0xcb76('0x12'),JSON[_0xcb76('0x13')](_0x4aed67));if(_0x4aed67[_0xcb76('0x14')]){if(_0x4aed67[_0xcb76('0x14')][_0xcb76('0x15')]===0x1f4){logger[_0xcb76('0x14')](_0xcb76('0xf'),_0x298ffc,_0x4aed67['error'][_0xcb76('0x16')]);return _0x5c5eaa(_0x4aed67[_0xcb76('0x14')][_0xcb76('0x16')]);}logger['error'](_0xcb76('0xf'),_0x298ffc,_0x4aed67[_0xcb76('0x14')]['message']);return _0x4b929b(_0x4aed67[_0xcb76('0x14')][_0xcb76('0x16')]);}else{logger[_0xcb76('0xe')](_0xcb76('0xf'),_0x298ffc,_0xcb76('0x12'));_0x4b929b(_0x4aed67[_0xcb76('0x17')][_0xcb76('0x16')]);}})[_0xcb76('0x18')](function(_0x27c49b){logger[_0xcb76('0x14')](_0xcb76('0xf'),_0x298ffc,_0x27c49b);_0x5c5eaa(_0x27c49b);});});}exports[_0xcb76('0x19')]=function(_0x17c767){var _0x5177a4=this;return new Promise(function(_0x48e6b7,_0x1b43d4){return db[_0xcb76('0x1a')][_0xcb76('0x1b')](_0x17c767[_0xcb76('0x1c')],{'raw':_0x17c767['options']?_0x17c767['options'][_0xcb76('0x1d')]===undefined?!![]:![]:!![]})[_0xcb76('0xd')](function(_0x5b77e0){logger[_0xcb76('0xe')]('CreateReportAgentPreview',_0x17c767);logger[_0xcb76('0x10')]('CreateReportAgentPreview',_0x17c767,JSON[_0xcb76('0x13')](_0x5b77e0));_0x48e6b7(_0x5b77e0);})[_0xcb76('0x18')](function(_0x1edfce){logger[_0xcb76('0x14')](_0xcb76('0x19'),_0x1edfce[_0xcb76('0x16')],_0x17c767);_0x1b43d4(_0x5177a4['error'](0x1f4,_0x1edfce[_0xcb76('0x16')]));});});}; \ No newline at end of file +var _0x6968=['options','raw','util','moment','randomstring','../../mysqldb','../../config/utils','../../config/logger','jayson/promise','client','http','request','then','info','ReportAgentPreview,\x20%s,\x20%s','request\x20sent','debug','ReportAgentPreview,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','CreateReportAgentPreview','create','body'];(function(_0xf740a0,_0x4f95af){var _0x24bca7=function(_0xde6c72){while(--_0xde6c72){_0xf740a0['push'](_0xf740a0['shift']());}};_0x24bca7(++_0x4f95af);}(_0x6968,0x6e));var _0x8696=function(_0x315d84,_0x3dacc3){_0x315d84=_0x315d84-0x0;var _0x560da1=_0x6968[_0x315d84];return _0x560da1;};'use strict';var _=require('lodash');var util=require(_0x8696('0x0'));var moment=require(_0x8696('0x1'));var BPromise=require('bluebird');var rs=require(_0x8696('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x8696('0x3'))['db'];var utils=require(_0x8696('0x4'));var logger=require(_0x8696('0x5'))('rpc');var config=require('../../config/environment');var jayson=require(_0x8696('0x6'));var client=jayson[_0x8696('0x7')][_0x8696('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x1d146b,_0xcdc4cb,_0x582444){return new BPromise(function(_0x3e7e18,_0x4936c1){return client[_0x8696('0x9')](_0x1d146b,_0x582444)[_0x8696('0xa')](function(_0x5024b8){logger[_0x8696('0xb')](_0x8696('0xc'),_0xcdc4cb,_0x8696('0xd'));logger[_0x8696('0xe')](_0x8696('0xf'),_0xcdc4cb,_0x8696('0xd'),JSON[_0x8696('0x10')](_0x5024b8));if(_0x5024b8[_0x8696('0x11')]){if(_0x5024b8[_0x8696('0x11')][_0x8696('0x12')]===0x1f4){logger[_0x8696('0x11')](_0x8696('0xc'),_0xcdc4cb,_0x5024b8[_0x8696('0x11')]['message']);return _0x4936c1(_0x5024b8[_0x8696('0x11')]['message']);}logger[_0x8696('0x11')](_0x8696('0xc'),_0xcdc4cb,_0x5024b8[_0x8696('0x11')][_0x8696('0x13')]);return _0x3e7e18(_0x5024b8[_0x8696('0x11')][_0x8696('0x13')]);}else{logger[_0x8696('0xb')](_0x8696('0xc'),_0xcdc4cb,_0x8696('0xd'));_0x3e7e18(_0x5024b8[_0x8696('0x14')][_0x8696('0x13')]);}})[_0x8696('0x15')](function(_0x3256b8){logger[_0x8696('0x11')](_0x8696('0xc'),_0xcdc4cb,_0x3256b8);_0x4936c1(_0x3256b8);});});}exports[_0x8696('0x16')]=function(_0x2603f0){var _0x321eb9=this;return new Promise(function(_0x1e39db,_0x2ecd6b){return db['ReportAgentPreview'][_0x8696('0x17')](_0x2603f0[_0x8696('0x18')],{'raw':_0x2603f0[_0x8696('0x19')]?_0x2603f0['options'][_0x8696('0x1a')]===undefined?!![]:![]:!![]})['then'](function(_0x745d06){logger[_0x8696('0xb')](_0x8696('0x16'),_0x2603f0);logger[_0x8696('0xe')](_0x8696('0x16'),_0x2603f0,JSON[_0x8696('0x10')](_0x745d06));_0x1e39db(_0x745d06);})[_0x8696('0x15')](function(_0x12166c){logger['error'](_0x8696('0x16'),_0x12166c['message'],_0x2603f0);_0x2ecd6b(_0x321eb9[_0x8696('0x11')](0x1f4,_0x12166c[_0x8696('0x13')]));});});}; \ No newline at end of file diff --git a/server/api/rpc/index.js b/server/api/rpc/index.js index 48b19e5..f70704a 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 _0x7c07=['openchannelQueues','/sms/queues','smsQueues','/whatsapp/queues','whatsappQueues','/fax/queues','faxQueues','/voice/queues/preview/:id','voiceQueuesPreview','/voice/queues/channels','voiceQueuesChannels','/voice/queues/channels/:uniqueid/hangup','/voice/queues/channels/:uniqueid/redirect/:exten','voiceQueuesChannelRedirect','/voice/queues/:id','showVoiceQueues','put','/outbound','outboundChannels','/agents','agents','/agents/:id/capacity','agentCapacity','/telephones','telephones','/trunks','trunks','campaigns','/fax/accounts','faxAccounts','/chat/queues/waitinginteractions','chatQueuesWaitingInteractions','/mail/queues/waitinginteractions','mailQueuesWaitingInteractions','/openchannel/queues/waitinginteractions','openchannelQueuesWaitingInteractions','/sms/queues/waitinginteractions','smsQueuesWaitingInteractions','whatsappQueuesWaitingInteractions','/fax/queues/waitinginteractions','post','/mail/queues/:id','/chat/queues/:id/notify','chat','/chat/queues/:id','showChatQueues','/fax/queues/:id/notify','queueNotify','fax','/fax/queues/:id','showFaxQueues','/openchannel/queues/:id/notify','openchannel','/openchannel/queues/:id','showOpenchannelQueues','/sms/queues/:id/notify','/whatsapp/queues/:id/notify','whatsapp','/whatsapp/queues/:id','showWhatsappQueues','agentNotify','exports','multer','util','path','express','./rpc.controller','get','/voice/channels','voiceChannels','/voice/channels/:uniqueid/mixmonitor','isAuthenticated','voiceChannelMixMonitor','/voice/channels/:uniqueid/stopmixmonitor','/voice/queues','voiceQueues','/chat/queues','chatQueues','/mail/queues','mailQueues','/mail/accounts','mailAccounts'];(function(_0x1b962e,_0x349a19){var _0x25a543=function(_0x5f57ac){while(--_0x5f57ac){_0x1b962e['push'](_0x1b962e['shift']());}};_0x25a543(++_0x349a19);}(_0x7c07,0xe2));var _0x77c0=function(_0x2a6809,_0x44edde){_0x2a6809=_0x2a6809-0x0;var _0x11c371=_0x7c07[_0x2a6809];return _0x11c371;};'use strict';var multer=require(_0x77c0('0x0'));var util=require(_0x77c0('0x1'));var path=require(_0x77c0('0x2'));var express=require(_0x77c0('0x3'));var router=express['Router']();var auth=require('../../components/auth/service');var controller=require(_0x77c0('0x4'));router[_0x77c0('0x5')](_0x77c0('0x6'),auth['isAuthenticated'](),controller[_0x77c0('0x7')]);router[_0x77c0('0x5')](_0x77c0('0x8'),auth[_0x77c0('0x9')](),controller[_0x77c0('0xa')]);router[_0x77c0('0x5')](_0x77c0('0xb'),auth[_0x77c0('0x9')](),controller['voiceChannelStopMixMonitor']);router[_0x77c0('0x5')](_0x77c0('0xc'),auth['isAuthenticated'](),controller[_0x77c0('0xd')]);router['get'](_0x77c0('0xe'),auth['isAuthenticated'](),controller[_0x77c0('0xf')]);router['get'](_0x77c0('0x10'),auth['isAuthenticated'](),controller[_0x77c0('0x11')]);router[_0x77c0('0x5')](_0x77c0('0x12'),auth['isAuthenticated'](),controller[_0x77c0('0x13')]);router[_0x77c0('0x5')]('/openchannel/queues',auth[_0x77c0('0x9')](),controller[_0x77c0('0x14')]);router['get'](_0x77c0('0x15'),auth[_0x77c0('0x9')](),controller[_0x77c0('0x16')]);router[_0x77c0('0x5')](_0x77c0('0x17'),auth[_0x77c0('0x9')](),controller[_0x77c0('0x18')]);router[_0x77c0('0x5')](_0x77c0('0x19'),auth[_0x77c0('0x9')](),controller[_0x77c0('0x1a')]);router[_0x77c0('0x5')](_0x77c0('0x1b'),auth[_0x77c0('0x9')](),controller[_0x77c0('0x1c')]);router[_0x77c0('0x5')](_0x77c0('0x1d'),auth[_0x77c0('0x9')](),controller[_0x77c0('0x1e')]);router[_0x77c0('0x5')]('/voice/queues/channels/:uniqueid',auth[_0x77c0('0x9')](),controller['voiceQueuesChannel']);router[_0x77c0('0x5')](_0x77c0('0x1f'),auth['isAuthenticated'](),controller['voiceQueuesChannelHangup']);router[_0x77c0('0x5')](_0x77c0('0x20'),auth[_0x77c0('0x9')](),controller[_0x77c0('0x21')]);router[_0x77c0('0x5')](_0x77c0('0x22'),auth['isAuthenticated'](),controller[_0x77c0('0x23')]);router[_0x77c0('0x24')]('/voice/queues/:id',auth[_0x77c0('0x9')](),controller['updateVoiceQueue']);router[_0x77c0('0x5')](_0x77c0('0x25'),auth[_0x77c0('0x9')](),controller['outbound']);router['get']('/outbound/channels',auth[_0x77c0('0x9')](),controller[_0x77c0('0x26')]);router['get'](_0x77c0('0x27'),auth['isAuthenticated'](),controller[_0x77c0('0x28')]);router[_0x77c0('0x24')](_0x77c0('0x29'),auth['isAuthenticated'](),controller[_0x77c0('0x2a')]);router['get'](_0x77c0('0x2b'),auth[_0x77c0('0x9')](),controller[_0x77c0('0x2c')]);router['get'](_0x77c0('0x2d'),auth[_0x77c0('0x9')](),controller[_0x77c0('0x2e')]);router[_0x77c0('0x5')]('/campaigns',auth[_0x77c0('0x9')](),controller[_0x77c0('0x2f')]);router['get'](_0x77c0('0x30'),auth[_0x77c0('0x9')](),controller[_0x77c0('0x31')]);router[_0x77c0('0x5')](_0x77c0('0x32'),auth['isAuthenticated'](),controller[_0x77c0('0x33')]);router[_0x77c0('0x5')](_0x77c0('0x34'),auth[_0x77c0('0x9')](),controller[_0x77c0('0x35')]);router[_0x77c0('0x5')](_0x77c0('0x36'),auth['isAuthenticated'](),controller[_0x77c0('0x37')]);router[_0x77c0('0x5')]('/openchannel/queues/:id/waitinginteractions',auth[_0x77c0('0x9')](),controller['openchannelQueuesIdWaitingInteractions']);router[_0x77c0('0x5')](_0x77c0('0x38'),auth[_0x77c0('0x9')](),controller[_0x77c0('0x39')]);router[_0x77c0('0x5')]('/whatsapp/queues/waitinginteractions',auth[_0x77c0('0x9')](),controller[_0x77c0('0x3a')]);router[_0x77c0('0x5')](_0x77c0('0x3b'),auth['isAuthenticated'](),controller['faxQueuesWaitingInteractions']);router[_0x77c0('0x3c')]('/mail/queues/:id/notify',auth[_0x77c0('0x9')](),controller['queueNotify']('mail'));router[_0x77c0('0x5')](_0x77c0('0x3d'),auth[_0x77c0('0x9')](),controller['showMailQueues']);router[_0x77c0('0x3c')](_0x77c0('0x3e'),auth['isAuthenticated'](),controller['queueNotify'](_0x77c0('0x3f')));router[_0x77c0('0x5')](_0x77c0('0x40'),auth[_0x77c0('0x9')](),controller[_0x77c0('0x41')]);router[_0x77c0('0x3c')](_0x77c0('0x42'),auth['isAuthenticated'](),controller[_0x77c0('0x43')](_0x77c0('0x44')));router[_0x77c0('0x5')](_0x77c0('0x45'),auth[_0x77c0('0x9')](),controller[_0x77c0('0x46')]);router['post'](_0x77c0('0x47'),auth[_0x77c0('0x9')](),controller[_0x77c0('0x43')](_0x77c0('0x48')));router['get'](_0x77c0('0x49'),auth[_0x77c0('0x9')](),controller[_0x77c0('0x4a')]);router[_0x77c0('0x3c')](_0x77c0('0x4b'),auth[_0x77c0('0x9')](),controller[_0x77c0('0x43')]('sms'));router[_0x77c0('0x3c')](_0x77c0('0x4c'),auth[_0x77c0('0x9')](),controller[_0x77c0('0x43')](_0x77c0('0x4d')));router['get']('/sms/queues/:id',auth['isAuthenticated'](),controller['showSmsQueues']);router[_0x77c0('0x5')](_0x77c0('0x4e'),auth['isAuthenticated'](),controller[_0x77c0('0x4f')]);router['post']('/agents/:id/notify',auth[_0x77c0('0x9')](),controller[_0x77c0('0x50')]);module[_0x77c0('0x51')]=router; \ No newline at end of file +var _0xeaa6=['mailQueues','/mail/accounts','mailAccounts','/openchannel/queues','openchannelQueues','/sms/queues','smsQueues','/whatsapp/queues','whatsappQueues','/fax/queues','faxQueues','/voice/queues/preview/:id','voiceQueuesPreview','/voice/queues/channels/:uniqueid','voiceQueuesChannel','/voice/queues/channels/:uniqueid/hangup','/voice/queues/channels/:uniqueid/redirect/:exten','voiceQueuesChannelRedirect','/voice/queues/:id','showVoiceQueues','put','updateVoiceQueue','/outbound','outbound','/outbound/channels','/agents','agents','agentCapacity','/telephones','telephones','trunks','campaigns','faxAccounts','/chat/queues/waitinginteractions','chatQueuesWaitingInteractions','/mail/queues/waitinginteractions','mailQueuesWaitingInteractions','/openchannel/queues/waitinginteractions','/sms/queues/waitinginteractions','smsQueuesWaitingInteractions','/whatsapp/queues/waitinginteractions','whatsappQueuesWaitingInteractions','/fax/queues/waitinginteractions','faxQueuesWaitingInteractions','post','/mail/queues/:id/notify','mail','/mail/queues/:id','showMailQueues','/chat/queues/:id/notify','queueNotify','chat','/chat/queues/:id','showChatQueues','/fax/queues/:id/notify','fax','/fax/queues/:id','showFaxQueues','/openchannel/queues/:id/notify','openchannel','/openchannel/queues/:id','sms','/whatsapp/queues/:id/notify','whatsapp','/sms/queues/:id','showSmsQueues','/whatsapp/queues/:id','showWhatsappQueues','/agents/:id/notify','agentNotify','multer','path','express','../../components/auth/service','./rpc.controller','get','/voice/channels','voiceChannels','/voice/channels/:uniqueid/mixmonitor','isAuthenticated','voiceChannelMixMonitor','/voice/channels/:uniqueid/stopmixmonitor','voiceChannelStopMixMonitor','/voice/queues','/chat/queues','chatQueues','/mail/queues'];(function(_0x5c9008,_0x4ee966){var _0x4a3816=function(_0x212249){while(--_0x212249){_0x5c9008['push'](_0x5c9008['shift']());}};_0x4a3816(++_0x4ee966);}(_0xeaa6,0x1a2));var _0x6eaa=function(_0x400eca,_0x19038b){_0x400eca=_0x400eca-0x0;var _0xb4129b=_0xeaa6[_0x400eca];return _0xb4129b;};'use strict';var multer=require(_0x6eaa('0x0'));var util=require('util');var path=require(_0x6eaa('0x1'));var express=require(_0x6eaa('0x2'));var router=express['Router']();var auth=require(_0x6eaa('0x3'));var controller=require(_0x6eaa('0x4'));router[_0x6eaa('0x5')](_0x6eaa('0x6'),auth['isAuthenticated'](),controller[_0x6eaa('0x7')]);router['get'](_0x6eaa('0x8'),auth[_0x6eaa('0x9')](),controller[_0x6eaa('0xa')]);router[_0x6eaa('0x5')](_0x6eaa('0xb'),auth[_0x6eaa('0x9')](),controller[_0x6eaa('0xc')]);router[_0x6eaa('0x5')](_0x6eaa('0xd'),auth['isAuthenticated'](),controller['voiceQueues']);router[_0x6eaa('0x5')](_0x6eaa('0xe'),auth['isAuthenticated'](),controller[_0x6eaa('0xf')]);router[_0x6eaa('0x5')](_0x6eaa('0x10'),auth['isAuthenticated'](),controller[_0x6eaa('0x11')]);router['get'](_0x6eaa('0x12'),auth[_0x6eaa('0x9')](),controller[_0x6eaa('0x13')]);router[_0x6eaa('0x5')](_0x6eaa('0x14'),auth[_0x6eaa('0x9')](),controller[_0x6eaa('0x15')]);router[_0x6eaa('0x5')](_0x6eaa('0x16'),auth[_0x6eaa('0x9')](),controller[_0x6eaa('0x17')]);router[_0x6eaa('0x5')](_0x6eaa('0x18'),auth[_0x6eaa('0x9')](),controller[_0x6eaa('0x19')]);router[_0x6eaa('0x5')](_0x6eaa('0x1a'),auth['isAuthenticated'](),controller[_0x6eaa('0x1b')]);router[_0x6eaa('0x5')](_0x6eaa('0x1c'),auth[_0x6eaa('0x9')](),controller[_0x6eaa('0x1d')]);router[_0x6eaa('0x5')]('/voice/queues/channels',auth[_0x6eaa('0x9')](),controller['voiceQueuesChannels']);router[_0x6eaa('0x5')](_0x6eaa('0x1e'),auth[_0x6eaa('0x9')](),controller[_0x6eaa('0x1f')]);router['get'](_0x6eaa('0x20'),auth[_0x6eaa('0x9')](),controller['voiceQueuesChannelHangup']);router[_0x6eaa('0x5')](_0x6eaa('0x21'),auth[_0x6eaa('0x9')](),controller[_0x6eaa('0x22')]);router[_0x6eaa('0x5')](_0x6eaa('0x23'),auth[_0x6eaa('0x9')](),controller[_0x6eaa('0x24')]);router[_0x6eaa('0x25')](_0x6eaa('0x23'),auth[_0x6eaa('0x9')](),controller[_0x6eaa('0x26')]);router[_0x6eaa('0x5')](_0x6eaa('0x27'),auth[_0x6eaa('0x9')](),controller[_0x6eaa('0x28')]);router['get'](_0x6eaa('0x29'),auth[_0x6eaa('0x9')](),controller['outboundChannels']);router[_0x6eaa('0x5')](_0x6eaa('0x2a'),auth['isAuthenticated'](),controller[_0x6eaa('0x2b')]);router[_0x6eaa('0x25')]('/agents/:id/capacity',auth[_0x6eaa('0x9')](),controller[_0x6eaa('0x2c')]);router['get'](_0x6eaa('0x2d'),auth[_0x6eaa('0x9')](),controller[_0x6eaa('0x2e')]);router['get']('/trunks',auth[_0x6eaa('0x9')](),controller[_0x6eaa('0x2f')]);router[_0x6eaa('0x5')]('/campaigns',auth[_0x6eaa('0x9')](),controller[_0x6eaa('0x30')]);router['get']('/fax/accounts',auth[_0x6eaa('0x9')](),controller[_0x6eaa('0x31')]);router[_0x6eaa('0x5')](_0x6eaa('0x32'),auth[_0x6eaa('0x9')](),controller[_0x6eaa('0x33')]);router['get'](_0x6eaa('0x34'),auth['isAuthenticated'](),controller[_0x6eaa('0x35')]);router[_0x6eaa('0x5')](_0x6eaa('0x36'),auth[_0x6eaa('0x9')](),controller['openchannelQueuesWaitingInteractions']);router[_0x6eaa('0x5')]('/openchannel/queues/:id/waitinginteractions',auth[_0x6eaa('0x9')](),controller['openchannelQueuesIdWaitingInteractions']);router['get'](_0x6eaa('0x37'),auth[_0x6eaa('0x9')](),controller[_0x6eaa('0x38')]);router['get'](_0x6eaa('0x39'),auth['isAuthenticated'](),controller[_0x6eaa('0x3a')]);router[_0x6eaa('0x5')](_0x6eaa('0x3b'),auth[_0x6eaa('0x9')](),controller[_0x6eaa('0x3c')]);router[_0x6eaa('0x3d')](_0x6eaa('0x3e'),auth[_0x6eaa('0x9')](),controller['queueNotify'](_0x6eaa('0x3f')));router[_0x6eaa('0x5')](_0x6eaa('0x40'),auth['isAuthenticated'](),controller[_0x6eaa('0x41')]);router[_0x6eaa('0x3d')](_0x6eaa('0x42'),auth[_0x6eaa('0x9')](),controller[_0x6eaa('0x43')](_0x6eaa('0x44')));router['get'](_0x6eaa('0x45'),auth['isAuthenticated'](),controller[_0x6eaa('0x46')]);router['post'](_0x6eaa('0x47'),auth[_0x6eaa('0x9')](),controller[_0x6eaa('0x43')](_0x6eaa('0x48')));router['get'](_0x6eaa('0x49'),auth[_0x6eaa('0x9')](),controller[_0x6eaa('0x4a')]);router[_0x6eaa('0x3d')](_0x6eaa('0x4b'),auth[_0x6eaa('0x9')](),controller[_0x6eaa('0x43')](_0x6eaa('0x4c')));router[_0x6eaa('0x5')](_0x6eaa('0x4d'),auth[_0x6eaa('0x9')](),controller['showOpenchannelQueues']);router[_0x6eaa('0x3d')]('/sms/queues/:id/notify',auth[_0x6eaa('0x9')](),controller[_0x6eaa('0x43')](_0x6eaa('0x4e')));router['post'](_0x6eaa('0x4f'),auth['isAuthenticated'](),controller[_0x6eaa('0x43')](_0x6eaa('0x50')));router[_0x6eaa('0x5')](_0x6eaa('0x51'),auth['isAuthenticated'](),controller[_0x6eaa('0x52')]);router[_0x6eaa('0x5')](_0x6eaa('0x53'),auth[_0x6eaa('0x9')](),controller[_0x6eaa('0x54')]);router[_0x6eaa('0x3d')](_0x6eaa('0x55'),auth[_0x6eaa('0x9')](),controller[_0x6eaa('0x56')]);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 77a4fcd..8f63906 100644 --- a/server/api/rpc/rpc.controller.js +++ b/server/api/rpc/rpc.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xe706=['indexOf','queue_id','smsQueuesWaitingInteractions','SmsQueuesWaitingInteractions','whatsappQueuesWaitingInteractions','WhatsappQueuesWaitingInteractions','faxQueuesWaitingInteractions','FaxQueuesWaitingInteractions','queueNotify','capitalize','Website','Queue','\x20Queue\x20not\x20found','Message','findOne','Interaction','Account','update','queue','MessageId','InteractionId','TransferReport','*,*,*,*','agentNotify','channel','Channel\x20field\x20is\x20mandatory','chat','User','Agent\x20not\x20found','messageId','\x20Message\x20not\x20found','From','create','Start','agentTransferTimeout','bluebird','moment','lodash','../../mysqldb','../../config/logger','api','jayson/promise','client','http','request','then','error','code','message','result','catch','status','json','name','send','isNil','rows','VoiceChannels','query','voiceChannelMixMonitor','VoiceChannelMixMonitor','merge','params','VoiceChannelStopMixMonitor','voiceQueues','VoiceQueues','showVoiceQueues','UpdateVoiceQueue','body','voiceQueuesPreview','VoiceQueuesPreview','voiceQueuesChannels','VoiceQueuesChannels','VoiceQueuesChannel','voiceQueuesChannelHangup','VoiceQueuesChannelHangup','voiceQueuesChannelRedirect','VoiceQueuesChannelRedirect','Outbound','outboundChannels','OutboundChannels','agents','Agents','agentCapacity','user','hasOwnProperty','MemberReport','findAll','INTERACTION','interaction','length','format','YYYY-MM-DD\x20HH:mm:ss','updateAttributes','SIP/%s','interface','agent','internal','capacity','Telephones','trunks','Trunks','campaigns','Campaigns','chatQueues','ChatQueues','showChatQueues','mailQueues','MailQueues','showMailQueues','OpenchannelQueues','showOpenchannelQueues','showSmsQueues','SmsQueues','whatsappQueues','WhatsappQueues','faxQueues','showFaxQueues','faxAccounts','FaxAccounts','chatQueuesWaitingInteractions','ChatQueuesWaitingInteractions','mailQueuesWaitingInteractions','openchannelQueuesWaitingInteractions','OpenchannelQueuesWaitingInteractions','type','filter','uniq'];(function(_0x2a97f0,_0x4ea4a2){var _0x4a4dea=function(_0x2e696f){while(--_0x2e696f){_0x2a97f0['push'](_0x2a97f0['shift']());}};_0x4a4dea(++_0x4ea4a2);}(_0xe706,0xa3));var _0x6e70=function(_0x30f5bb,_0x4db4bd){_0x30f5bb=_0x30f5bb-0x0;var _0x1cfc00=_0xe706[_0x30f5bb];return _0x1cfc00;};'use strict';var BPromise=require(_0x6e70('0x0'));var moment=require(_0x6e70('0x1'));var _=require(_0x6e70('0x2'));var util=require('util');var db=require(_0x6e70('0x3'))['db'];var logger=require(_0x6e70('0x4'))(_0x6e70('0x5'));var jayson=require(_0x6e70('0x6'));var amiClient=jayson[_0x6e70('0x7')][_0x6e70('0x8')]({'port':0x232a});var mailClient=jayson[_0x6e70('0x7')][_0x6e70('0x8')]({'port':0x232b});var routingClient=jayson[_0x6e70('0x7')][_0x6e70('0x8')]({'port':0x232c});function respondWithRpcPromise(_0x36357b,_0x293ce7,_0x45a2d4){return new BPromise(function(_0x188ed3,_0x3c4843){var _0x449b48=_0x45a2d4?_0x45a2d4:amiClient;return _0x449b48[_0x6e70('0x9')](_0x36357b,_0x293ce7)[_0x6e70('0xa')](function(_0x100eb7){if(_0x100eb7[_0x6e70('0xb')]){if(_0x100eb7[_0x6e70('0xb')][_0x6e70('0xc')]===0x1f4){return _0x3c4843(_0x100eb7[_0x6e70('0xb')][_0x6e70('0xd')]);}return _0x188ed3(_0x100eb7['error']['message']);}else{_0x188ed3(_0x100eb7[_0x6e70('0xe')]);}})[_0x6e70('0xf')](function(_0x18cf27){_0x3c4843(_0x18cf27);});});}function respondWithResult(_0x27dd9b,_0x3b38f3){_0x3b38f3=_0x3b38f3||0xc8;return function(_0x310eb7){if(_0x310eb7){return _0x27dd9b[_0x6e70('0x10')](_0x3b38f3)[_0x6e70('0x11')](_0x310eb7);}return _0x27dd9b['sendStatus'](0x194);};}function handleError(_0x52737e,_0x48bc72){_0x48bc72=_0x48bc72||0x1f4;return function(_0x257e81){logger['error'](_0x257e81['stack']);if(_0x257e81[_0x6e70('0x12')]){delete _0x257e81[_0x6e70('0x12')];}_0x52737e['status'](_0x48bc72)[_0x6e70('0x13')](_0x257e81);};}function findById(_0x5c3fe7){return function(_0x2efc0f){if(!_[_0x6e70('0x14')](_0x5c3fe7)&&!_['isNil'](_0x2efc0f)&&!_['isNil'](_0x2efc0f[_0x6e70('0x15')])){return _['find'](_0x2efc0f[_0x6e70('0x15')],function(_0x173afe){return _0x173afe['id']==_0x5c3fe7;});}return null;};}exports['voiceChannels']=function(_0x497d61,_0xc238ba){return respondWithRpcPromise(_0x6e70('0x16'),_0x497d61[_0x6e70('0x17')])[_0x6e70('0xa')](respondWithResult(_0xc238ba,null))[_0x6e70('0xf')](handleError(_0xc238ba,null));};exports[_0x6e70('0x18')]=function(_0x1b2453,_0x44a49f){return respondWithRpcPromise(_0x6e70('0x19'),_[_0x6e70('0x1a')](_0x1b2453['query'],_0x1b2453[_0x6e70('0x1b')]))[_0x6e70('0xa')](respondWithResult(_0x44a49f,null))[_0x6e70('0xf')](handleError(_0x44a49f,null));};exports['voiceChannelStopMixMonitor']=function(_0x3ccd87,_0xa5d49){return respondWithRpcPromise(_0x6e70('0x1c'),_['merge'](_0x3ccd87[_0x6e70('0x17')],_0x3ccd87['params']))['then'](respondWithResult(_0xa5d49,null))['catch'](handleError(_0xa5d49,null));};exports[_0x6e70('0x1d')]=function(_0x19c5ae,_0x51d292){return respondWithRpcPromise(_0x6e70('0x1e'),_0x19c5ae[_0x6e70('0x17')])['then'](respondWithResult(_0x51d292,null))[_0x6e70('0xf')](handleError(_0x51d292,null));};exports[_0x6e70('0x1f')]=function(_0x2bb231,_0x4a67ac){return respondWithRpcPromise('VoiceQueues',_0x2bb231[_0x6e70('0x17')])[_0x6e70('0xa')](findById(_0x2bb231[_0x6e70('0x1b')]['id']))[_0x6e70('0xa')](respondWithResult(_0x4a67ac,null))[_0x6e70('0xf')](handleError(_0x4a67ac,null));};exports['updateVoiceQueue']=function(_0x1952ea,_0x406f29){return respondWithRpcPromise(_0x6e70('0x20'),_[_0x6e70('0x1a')](_0x1952ea[_0x6e70('0x21')],_0x1952ea[_0x6e70('0x1b')]))[_0x6e70('0xa')](respondWithResult(_0x406f29,null))[_0x6e70('0xf')](handleError(_0x406f29,null));};exports[_0x6e70('0x22')]=function(_0x3a5d30,_0x4b1229){return respondWithRpcPromise(_0x6e70('0x23'),_['merge'](_0x3a5d30[_0x6e70('0x17')],_0x3a5d30['params']))[_0x6e70('0xa')](respondWithResult(_0x4b1229,null))[_0x6e70('0xf')](handleError(_0x4b1229,null));};exports[_0x6e70('0x24')]=function(_0x56f6f7,_0x38c40d){return respondWithRpcPromise(_0x6e70('0x25'),_0x56f6f7['query'])[_0x6e70('0xa')](respondWithResult(_0x38c40d,null))[_0x6e70('0xf')](handleError(_0x38c40d,null));};exports['voiceQueuesChannel']=function(_0x10d8f6,_0x3665a1){return respondWithRpcPromise(_0x6e70('0x26'),_[_0x6e70('0x1a')](_0x10d8f6[_0x6e70('0x17')],_0x10d8f6[_0x6e70('0x1b')]))[_0x6e70('0xa')](respondWithResult(_0x3665a1,null))[_0x6e70('0xf')](handleError(_0x3665a1,null));};exports[_0x6e70('0x27')]=function(_0x419a41,_0x4d32d8){return respondWithRpcPromise(_0x6e70('0x28'),_['merge'](_0x419a41[_0x6e70('0x17')],_0x419a41[_0x6e70('0x1b')]))[_0x6e70('0xa')](respondWithResult(_0x4d32d8,null))[_0x6e70('0xf')](handleError(_0x4d32d8,null));};exports[_0x6e70('0x29')]=function(_0x989b80,_0x2440be){return respondWithRpcPromise(_0x6e70('0x2a'),_[_0x6e70('0x1a')](_0x989b80[_0x6e70('0x17')],_0x989b80[_0x6e70('0x1b')]))[_0x6e70('0xa')](respondWithResult(_0x2440be,null))[_0x6e70('0xf')](handleError(_0x2440be,null));};exports['outbound']=function(_0x5446a2,_0x5424eb){return respondWithRpcPromise(_0x6e70('0x2b'),_0x5446a2[_0x6e70('0x17')])[_0x6e70('0xa')](respondWithResult(_0x5424eb,null))[_0x6e70('0xf')](handleError(_0x5424eb,null));};exports[_0x6e70('0x2c')]=function(_0x3bdd87,_0x572a71){return respondWithRpcPromise(_0x6e70('0x2d'),_0x3bdd87[_0x6e70('0x17')])[_0x6e70('0xa')](respondWithResult(_0x572a71,null))[_0x6e70('0xf')](handleError(_0x572a71,null));};exports[_0x6e70('0x2e')]=function(_0x37bf46,_0x246e61){var _0x16fc7d;return respondWithRpcPromise('Agents',_0x37bf46[_0x6e70('0x17')])[_0x6e70('0xa')](function(_0x22fce9){_0x16fc7d=_0x22fce9;return respondWithRpcPromise(_0x6e70('0x2f'),_0x37bf46[_0x6e70('0x17')],routingClient);})[_0x6e70('0xa')](function(_0x21b0e7){return _['merge']({},_0x21b0e7,_0x16fc7d);})['then'](respondWithResult(_0x246e61,null))['catch'](handleError(_0x246e61,null));};exports[_0x6e70('0x30')]=function(_0x2b63cc,_0x83847b){if(_0x2b63cc[_0x6e70('0x21')]&&_0x2b63cc[_0x6e70('0x21')]['interaction']&&_0x2b63cc[_0x6e70('0x31')]&&_0x2b63cc[_0x6e70('0x31')][_0x6e70('0x12')]){for(var _0x52b197 in _0x2b63cc['body']['interaction']){if(_0x2b63cc[_0x6e70('0x21')]['interaction'][_0x6e70('0x32')](_0x52b197)){db[_0x6e70('0x33')][_0x6e70('0x34')]({'where':{'channel':_0x52b197,'membername':_0x2b63cc[_0x6e70('0x31')]['name'],'type':_0x6e70('0x35'),'exitAt':null,'uniqueid':_0x2b63cc['body'][_0x6e70('0x36')][_0x52b197]&&_0x2b63cc[_0x6e70('0x21')][_0x6e70('0x36')][_0x52b197][_0x6e70('0x37')]?{'$notIn':_0x2b63cc['body'][_0x6e70('0x36')][_0x52b197]}:{'$ne':null}}})[_0x6e70('0xa')](function(_0x3d39c3){var _0xac87d6=moment()[_0x6e70('0x38')](_0x6e70('0x39'));for(var _0x3d9c5=0x0,_0x552e7e=_0x3d39c3[_0x6e70('0x37')];_0x3d9c5<_0x552e7e;_0x3d9c5+=0x1){_0x3d39c3[_0x3d9c5][_0x6e70('0x3a')]({'exitAt':_0xac87d6});}});for(var _0x10de2a=0x0;_0x10de2a<_0x2b63cc[_0x6e70('0x21')][_0x6e70('0x36')][_0x52b197][_0x6e70('0x37')];_0x10de2a+=0x1){db[_0x6e70('0x33')]['findOrCreate']({'where':{'channel':_0x52b197,'membername':_0x2b63cc[_0x6e70('0x31')]['name'],'type':_0x6e70('0x35'),'uniqueid':_0x2b63cc[_0x6e70('0x21')]['interaction'][_0x52b197][_0x10de2a],'exitAt':null},'defaults':{'channel':_0x52b197,'membername':_0x2b63cc['user'][_0x6e70('0x12')],'interface':_[_0x6e70('0x14')](_0x2b63cc[_0x6e70('0x31')]['interface'])?util['format'](_0x6e70('0x3b'),_0x2b63cc[_0x6e70('0x31')][_0x6e70('0x12')]):_0x2b63cc[_0x6e70('0x31')][_0x6e70('0x3c')],'type':_0x6e70('0x35'),'enterAt':moment()['format'](_0x6e70('0x39')),'role':_0x6e70('0x3d'),'internal':_0x2b63cc[_0x6e70('0x31')][_0x6e70('0x3e')],'uniqueid':_0x2b63cc[_0x6e70('0x21')]['interaction'][_0x52b197][_0x10de2a]}});}}}}return respondWithRpcPromise('AgentCapacity',{'id':_0x2b63cc[_0x6e70('0x1b')]['id'],'capacity':_0x2b63cc[_0x6e70('0x21')][_0x6e70('0x3f')]},routingClient)[_0x6e70('0xa')](respondWithResult(_0x83847b,null))[_0x6e70('0xf')](handleError(_0x83847b,null));};exports['telephones']=function(_0x41bd0b,_0x232366){return respondWithRpcPromise(_0x6e70('0x40'),_0x41bd0b[_0x6e70('0x17')])[_0x6e70('0xa')](respondWithResult(_0x232366,null))['catch'](handleError(_0x232366,null));};exports[_0x6e70('0x41')]=function(_0x1dd242,_0x2c20d3){return respondWithRpcPromise(_0x6e70('0x42'),_0x1dd242[_0x6e70('0x17')])[_0x6e70('0xa')](respondWithResult(_0x2c20d3,null))['catch'](handleError(_0x2c20d3,null));};exports[_0x6e70('0x43')]=function(_0x8d425d,_0x5c2396){return respondWithRpcPromise(_0x6e70('0x44'),_0x8d425d[_0x6e70('0x17')])['then'](respondWithResult(_0x5c2396,null))[_0x6e70('0xf')](handleError(_0x5c2396,null));};exports[_0x6e70('0x45')]=function(_0x2134c4,_0x46d536){return respondWithRpcPromise(_0x6e70('0x46'),_0x2134c4['query'],routingClient)[_0x6e70('0xa')](respondWithResult(_0x46d536,null))[_0x6e70('0xf')](handleError(_0x46d536,null));};exports[_0x6e70('0x47')]=function(_0x13be81,_0x1c02d7){return respondWithRpcPromise(_0x6e70('0x46'),_0x13be81[_0x6e70('0x17')],routingClient)[_0x6e70('0xa')](findById(_0x13be81[_0x6e70('0x1b')]['id']))[_0x6e70('0xa')](respondWithResult(_0x1c02d7,null))[_0x6e70('0xf')](handleError(_0x1c02d7,null));};exports[_0x6e70('0x48')]=function(_0xb8f78,_0x1fd9a6){return respondWithRpcPromise(_0x6e70('0x49'),_0xb8f78[_0x6e70('0x17')],routingClient)[_0x6e70('0xa')](respondWithResult(_0x1fd9a6,null))[_0x6e70('0xf')](handleError(_0x1fd9a6,null));};exports[_0x6e70('0x4a')]=function(_0x1c7dca,_0x4c6aab){return respondWithRpcPromise(_0x6e70('0x49'),_0x1c7dca[_0x6e70('0x17')],routingClient)[_0x6e70('0xa')](findById(_0x1c7dca[_0x6e70('0x1b')]['id']))[_0x6e70('0xa')](respondWithResult(_0x4c6aab,null))[_0x6e70('0xf')](handleError(_0x4c6aab,null));};exports['mailAccounts']=function(_0x42bd85,_0x6cabf0){return respondWithRpcPromise('MailAccounts',_0x42bd85[_0x6e70('0x17')],mailClient)[_0x6e70('0xa')](respondWithResult(_0x6cabf0,null))[_0x6e70('0xf')](handleError(_0x6cabf0,null));};exports['openchannelQueues']=function(_0x51f268,_0x2f9be4){return respondWithRpcPromise(_0x6e70('0x4b'),_0x51f268[_0x6e70('0x17')],routingClient)[_0x6e70('0xa')](respondWithResult(_0x2f9be4,null))[_0x6e70('0xf')](handleError(_0x2f9be4,null));};exports[_0x6e70('0x4c')]=function(_0x30cd88,_0x57bfe5){return respondWithRpcPromise('OpenchannelQueues',_0x30cd88[_0x6e70('0x17')],routingClient)[_0x6e70('0xa')](findById(_0x30cd88[_0x6e70('0x1b')]['id']))[_0x6e70('0xa')](respondWithResult(_0x57bfe5,null))['catch'](handleError(_0x57bfe5,null));};exports['smsQueues']=function(_0x2e972b,_0x4e5545){return respondWithRpcPromise('SmsQueues',_0x2e972b['query'],routingClient)[_0x6e70('0xa')](respondWithResult(_0x4e5545,null))['catch'](handleError(_0x4e5545,null));};exports[_0x6e70('0x4d')]=function(_0x23900b,_0x3b4da0){return respondWithRpcPromise(_0x6e70('0x4e'),_0x23900b[_0x6e70('0x17')],routingClient)[_0x6e70('0xa')](findById(_0x23900b[_0x6e70('0x1b')]['id']))[_0x6e70('0xa')](respondWithResult(_0x3b4da0,null))['catch'](handleError(_0x3b4da0,null));};exports[_0x6e70('0x4f')]=function(_0x6a560f,_0x22c836){return respondWithRpcPromise(_0x6e70('0x50'),_0x6a560f[_0x6e70('0x17')],routingClient)['then'](respondWithResult(_0x22c836,null))['catch'](handleError(_0x22c836,null));};exports['showWhatsappQueues']=function(_0x1bb338,_0xd91b9){return respondWithRpcPromise(_0x6e70('0x50'),_0x1bb338['query'],routingClient)['then'](findById(_0x1bb338[_0x6e70('0x1b')]['id']))[_0x6e70('0xa')](respondWithResult(_0xd91b9,null))[_0x6e70('0xf')](handleError(_0xd91b9,null));};exports[_0x6e70('0x51')]=function(_0x2285f1,_0x32b884){return respondWithRpcPromise('FaxQueues',_0x2285f1[_0x6e70('0x17')],routingClient)[_0x6e70('0xa')](respondWithResult(_0x32b884,null))[_0x6e70('0xf')](handleError(_0x32b884,null));};exports[_0x6e70('0x52')]=function(_0x515c0c,_0xce964b){return respondWithRpcPromise('FaxQueues',_0x515c0c['query'],routingClient)[_0x6e70('0xa')](findById(_0x515c0c[_0x6e70('0x1b')]['id']))[_0x6e70('0xa')](respondWithResult(_0xce964b,null))[_0x6e70('0xf')](handleError(_0xce964b,null));};exports[_0x6e70('0x53')]=function(_0x2be0fc,_0x4b5b19){return respondWithRpcPromise(_0x6e70('0x54'),_0x2be0fc[_0x6e70('0x17')])[_0x6e70('0xa')](respondWithResult(_0x4b5b19,null))[_0x6e70('0xf')](handleError(_0x4b5b19,null));};exports[_0x6e70('0x55')]=function(_0x13c092,_0x363722){return respondWithRpcPromise(_0x6e70('0x56'),_0x13c092[_0x6e70('0x17')],routingClient)[_0x6e70('0xa')](respondWithResult(_0x363722,null))['catch'](handleError(_0x363722,null));};exports[_0x6e70('0x57')]=function(_0x303c5a,_0x577c3b){return respondWithRpcPromise('MailQueuesWaitingInteractions',_0x303c5a['query'],routingClient)[_0x6e70('0xa')](respondWithResult(_0x577c3b,null))[_0x6e70('0xf')](handleError(_0x577c3b,null));};exports[_0x6e70('0x58')]=function(_0x14bb74,_0x5a3dcb){return respondWithRpcPromise('OpenchannelQueuesWaitingInteractions',_0x14bb74['query'],routingClient)[_0x6e70('0xa')](respondWithResult(_0x5a3dcb,null))[_0x6e70('0xf')](handleError(_0x5a3dcb,null));};exports['openchannelQueuesIdWaitingInteractions']=function(_0x58666a,_0x1c7c5f){return respondWithRpcPromise(_0x6e70('0x59'),_0x58666a[_0x6e70('0x17')],routingClient)[_0x6e70('0xa')](function(_0x44bf96){if(_0x58666a[_0x6e70('0x17')][_0x6e70('0x5a')]!==undefined){var _0x3650e9=_(_0x44bf96[_0x6e70('0x15')])[_0x6e70('0x5b')]([_0x58666a[_0x6e70('0x17')][_0x6e70('0x5a')],_0x58666a[_0x6e70('0x1b')]['id']])['map']('queue_id')[_0x6e70('0x5c')]()['value']();return _0x44bf96[_0x6e70('0x15')]['filter'](function(_0x5b5471){return _0x3650e9[_0x6e70('0x5d')](_0x5b5471['queue_id'])>-0x1;});}else{return _0x44bf96['rows'][_0x6e70('0x5b')](function(_0x21e4c2){return _0x21e4c2[_0x6e70('0x5e')]===parseInt(_0x58666a['params']['id']);});}})['then'](respondWithResult(_0x1c7c5f,null))['catch'](handleError(_0x1c7c5f,null));};exports[_0x6e70('0x5f')]=function(_0x512b0a,_0x2e8ed3){return respondWithRpcPromise(_0x6e70('0x60'),_0x512b0a[_0x6e70('0x17')],routingClient)[_0x6e70('0xa')](respondWithResult(_0x2e8ed3,null))[_0x6e70('0xf')](handleError(_0x2e8ed3,null));};exports[_0x6e70('0x61')]=function(_0x214a8f,_0x50046a){return respondWithRpcPromise(_0x6e70('0x62'),_0x214a8f[_0x6e70('0x17')],routingClient)[_0x6e70('0xa')](respondWithResult(_0x50046a,null))['catch'](handleError(_0x50046a,null));};exports[_0x6e70('0x63')]=function(_0x227d94,_0x11a615){return respondWithRpcPromise(_0x6e70('0x64'),_0x227d94[_0x6e70('0x17')],routingClient)[_0x6e70('0xa')](respondWithResult(_0x11a615,null))[_0x6e70('0xf')](handleError(_0x11a615,null));};exports[_0x6e70('0x65')]=function(_0x461ec0){return function(_0x48f6fd,_0x463eed){var _0x39e6db,_0x53acc8;var _0x252f07=_[_0x6e70('0x66')](_0x461ec0);var _0x51be27=_0x461ec0==='chat'?_0x6e70('0x67'):'Account';return db[_0x252f07+_0x6e70('0x68')]['findOne']({'raw':!![],'where':{'id':_0x48f6fd[_0x6e70('0x1b')]['id']}})[_0x6e70('0xa')](function(_0x106f32){if(_[_0x6e70('0x14')](_0x106f32)){throw new Error(_0x252f07+_0x6e70('0x69'));}_0x39e6db=_0x106f32;return db[_0x252f07+_0x6e70('0x6a')][_0x6e70('0x6b')]({'where':{'id':_0x48f6fd['body']['messageId']},'include':[{'model':db[_0x252f07+_0x6e70('0x6c')],'as':'Interaction'},{'model':db[_0x252f07+_0x51be27],'as':_0x6e70('0x6d')}]});})[_0x6e70('0xa')](function(_0x28e5b1){if(_[_0x6e70('0x14')](_0x28e5b1)){throw new Error(_0x252f07+'\x20Message\x20not\x20found');}_0x53acc8=_0x28e5b1;return _0x28e5b1[_0x6e70('0x6e')]({'read':0x0,'readAt':null,'UserId':null});})['then'](function(){var _0x260dfa={'uniqueid':_0x461ec0+'.'+_0x53acc8['id']+'.'+_0x53acc8[_0x6e70('0x6c')]['id'],'FromUserId':_0x48f6fd[_0x6e70('0x31')]['id'],'type':_0x6e70('0x6f')};_0x260dfa[_0x252f07+_0x6e70('0x70')]=_0x53acc8['id'];_0x260dfa[_0x252f07+_0x6e70('0x71')]=_0x53acc8[_0x6e70('0x6c')]['id'];_0x260dfa['From'+_0x252f07+_0x51be27+'Id']=_0x53acc8[_0x6e70('0x6d')]['id'];_0x260dfa['To'+_0x252f07+'QueueId']=_0x39e6db['id'];return db[_0x252f07+_0x6e70('0x72')]['create'](_0x260dfa);})['then'](function(){return respondWithRpcPromise('Start',{'channel':_0x461ec0,'interaction':_0x53acc8[_0x6e70('0x6c')],'message':_0x53acc8,'account':_0x53acc8[_0x6e70('0x6d')],'applications':[{'id':0x0,'priority':0x1,'app':_0x6e70('0x6f'),'appdata':_0x39e6db[_0x6e70('0x12')]+','+(_0x53acc8[_0x6e70('0x6d')]['queueTransferTimeout']||0x12c),'interval':_0x6e70('0x73')}],'transfer':!![]},routingClient);})[_0x6e70('0xa')](respondWithResult(_0x463eed,null))['catch'](handleError(_0x463eed,null));};};exports[_0x6e70('0x74')]=function(_0x50e494,_0x17d3a4){var _0x5d0585,_0x4a87e2;if(_[_0x6e70('0x14')](_0x50e494[_0x6e70('0x21')][_0x6e70('0x75')])){throw new Error(_0x6e70('0x76'));}var _0x3e6661=_0x50e494[_0x6e70('0x21')][_0x6e70('0x75')];var _0x5c0276=_[_0x6e70('0x66')](_0x3e6661);var _0x4f4a16=_0x3e6661===_0x6e70('0x77')?_0x6e70('0x67'):_0x6e70('0x6d');return db[_0x6e70('0x78')][_0x6e70('0x6b')]({'raw':!![],'where':{'id':_0x50e494[_0x6e70('0x1b')]['id'],'role':_0x6e70('0x3d')}})['then'](function(_0x4466f0){if(_['isNil'](_0x4466f0)){throw new Error(_0x6e70('0x79'));}_0x5d0585=_0x4466f0;return db[_0x5c0276+_0x6e70('0x6a')][_0x6e70('0x6b')]({'where':{'id':_0x50e494[_0x6e70('0x21')][_0x6e70('0x7a')]},'include':[{'model':db[_0x5c0276+_0x6e70('0x6c')],'as':_0x6e70('0x6c')},{'model':db[_0x5c0276+_0x4f4a16],'as':_0x6e70('0x6d')}]});})[_0x6e70('0xa')](function(_0x162bc3){if(_['isNil'](_0x162bc3)){throw new Error(_0x5c0276+_0x6e70('0x7b'));}_0x4a87e2=_0x162bc3;return _0x162bc3[_0x6e70('0x6e')]({'read':0x0,'readAt':null,'UserId':null});})[_0x6e70('0xa')](function(){var _0x181802={'uniqueid':_0x3e6661+'.'+_0x4a87e2['id']+'.'+_0x4a87e2[_0x6e70('0x6c')]['id'],'FromUserId':_0x50e494['user']['id'],'type':'agent','ToUserId':_0x5d0585['id']};_0x181802[_0x5c0276+'MessageId']=_0x4a87e2['id'];_0x181802[_0x5c0276+_0x6e70('0x71')]=_0x4a87e2[_0x6e70('0x6c')]['id'];_0x181802[_0x6e70('0x7c')+_0x5c0276+_0x4f4a16+'Id']=_0x4a87e2[_0x6e70('0x6d')]['id'];return db[_0x5c0276+_0x6e70('0x72')][_0x6e70('0x7d')](_0x181802);})[_0x6e70('0xa')](function(){return respondWithRpcPromise(_0x6e70('0x7e'),{'channel':_0x3e6661,'interaction':_0x4a87e2[_0x6e70('0x6c')],'message':_0x4a87e2,'account':_0x4a87e2[_0x6e70('0x6d')],'applications':[{'id':0x0,'priority':0x1,'app':_0x6e70('0x3d'),'appdata':_0x5d0585[_0x6e70('0x12')]+','+(_0x4a87e2[_0x6e70('0x6d')][_0x6e70('0x7f')]||0x12c),'interval':_0x6e70('0x73')}],'transfer':!![]},routingClient);})['then'](respondWithResult(_0x17d3a4,null))[_0x6e70('0xf')](handleError(_0x17d3a4,null));}; \ No newline at end of file +var _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(_0x32590d,_0x17366a){var _0x3c1828=function(_0x5d1a53){while(--_0x5d1a53){_0x32590d['push'](_0x32590d['shift']());}};_0x3c1828(++_0x17366a);}(_0xbaf0,0x12a));var _0x0baf=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0xbaf0[_0x14add3];return _0x4a174f;};'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 433185f..b513949 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 _0x0e75=['put','update','delete','destroy','exports','path','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','get','index','/:id','isAuthenticated','show','/:id/run','run','post','create'];(function(_0x1d0499,_0x23e22f){var _0x153fb3=function(_0x40c19c){while(--_0x40c19c){_0x1d0499['push'](_0x1d0499['shift']());}};_0x153fb3(++_0x23e22f);}(_0x0e75,0x1d1));var _0x50e7=function(_0x5c70d0,_0xfeac42){_0x5c70d0=_0x5c70d0-0x0;var _0x484491=_0x0e75[_0x5c70d0];return _0x484491;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x50e7('0x0'));var timeout=require('connect-timeout');var express=require(_0x50e7('0x1'));var router=express[_0x50e7('0x2')]();var fs_extra=require(_0x50e7('0x3'));var auth=require(_0x50e7('0x4'));var interaction=require(_0x50e7('0x5'));var config=require('../../config/environment');var controller=require('./schedule.controller');router[_0x50e7('0x6')]('/',auth['isAuthenticated'](),controller[_0x50e7('0x7')]);router['get'](_0x50e7('0x8'),auth[_0x50e7('0x9')](),controller[_0x50e7('0xa')]);router[_0x50e7('0x6')](_0x50e7('0xb'),auth[_0x50e7('0x9')](),controller[_0x50e7('0xc')]);router[_0x50e7('0xd')]('/',auth[_0x50e7('0x9')](),controller[_0x50e7('0xe')]);router[_0x50e7('0xf')](_0x50e7('0x8'),auth['isAuthenticated'](),controller[_0x50e7('0x10')]);router[_0x50e7('0x11')](_0x50e7('0x8'),auth[_0x50e7('0x9')](),controller[_0x50e7('0x12')]);module[_0x50e7('0x13')]=router; \ No newline at end of file +var _0x7a84=['../../components/auth/service','../../components/interaction/service','../../config/environment','./schedule.controller','get','index','/:id','isAuthenticated','show','/:id/run','run','post','create','destroy','exports','multer','util','connect-timeout','express','Router','fs-extra'];(function(_0x143368,_0x5d0b64){var _0x44c10a=function(_0x30c90c){while(--_0x30c90c){_0x143368['push'](_0x143368['shift']());}};_0x44c10a(++_0x5d0b64);}(_0x7a84,0x1c8));var _0x47a8=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0x7a84[_0x20a584];return _0x4b41a8;};'use strict';var multer=require(_0x47a8('0x0'));var util=require(_0x47a8('0x1'));var path=require('path');var timeout=require(_0x47a8('0x2'));var express=require(_0x47a8('0x3'));var router=express[_0x47a8('0x4')]();var fs_extra=require(_0x47a8('0x5'));var auth=require(_0x47a8('0x6'));var interaction=require(_0x47a8('0x7'));var config=require(_0x47a8('0x8'));var controller=require(_0x47a8('0x9'));router[_0x47a8('0xa')]('/',auth['isAuthenticated'](),controller[_0x47a8('0xb')]);router[_0x47a8('0xa')](_0x47a8('0xc'),auth[_0x47a8('0xd')](),controller[_0x47a8('0xe')]);router[_0x47a8('0xa')](_0x47a8('0xf'),auth[_0x47a8('0xd')](),controller[_0x47a8('0x10')]);router[_0x47a8('0x11')]('/',auth[_0x47a8('0xd')](),controller[_0x47a8('0x12')]);router['put'](_0x47a8('0xc'),auth[_0x47a8('0xd')](),controller['update']);router['delete']('/:id',auth[_0x47a8('0xd')](),controller[_0x47a8('0x13')]);module[_0x47a8('0x14')]=router; \ No newline at end of file diff --git a/server/api/schedule/schedule.attributes.js b/server/api/schedule/schedule.attributes.js index 8a7381b..1c0d888 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 _0xa94d=['exports','BOOLEAN','0\x200\x20*\x20*\x20*','DATE','INTEGER','years','quarters','months','weeks','days','hours','minutes','ENUM','csv','xlsx','custom','default','STRING','TEXT','sequelize'];(function(_0x5b9b16,_0x130bc5){var _0x3cb207=function(_0x4d46c3){while(--_0x4d46c3){_0x5b9b16['push'](_0x5b9b16['shift']());}};_0x3cb207(++_0x130bc5);}(_0xa94d,0x1a3));var _0xda94=function(_0x25771a,_0x5cee97){_0x25771a=_0x25771a-0x0;var _0x588979=_0xa94d[_0x25771a];return _0x588979;};'use strict';var Sequelize=require(_0xda94('0x0'));module[_0xda94('0x1')]={'name':{'type':Sequelize['STRING'],'allowNull':![]},'description':{'type':Sequelize['STRING']},'active':{'type':Sequelize[_0xda94('0x2')],'allowNull':![],'defaultValue':![]},'cron':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':_0xda94('0x3')},'startAt':{'type':Sequelize['DATE'],'allowNull':![]},'endAt':{'type':Sequelize[_0xda94('0x4')],'allowNull':![]},'subtractNumber':{'type':Sequelize[_0xda94('0x5')],'allowNull':![],'defaultValue':0x1,'validate':{'min':0x1}},'subtractUnit':{'type':Sequelize['ENUM'](_0xda94('0x6'),_0xda94('0x7'),_0xda94('0x8'),_0xda94('0x9'),_0xda94('0xa'),_0xda94('0xb'),_0xda94('0xc')),'allowNull':![],'defaultValue':_0xda94('0xa')},'output':{'type':Sequelize[_0xda94('0xd')](_0xda94('0xe'),'pdf',_0xda94('0xf')),'allowNull':![],'defaultValue':'csv'},'type':{'type':Sequelize[_0xda94('0xd')](_0xda94('0x10'),_0xda94('0x11')),'allowNull':![],'defaultValue':_0xda94('0x10')},'sendMail':{'type':Sequelize[_0xda94('0x2')],'defaultValue':![]},'email':{'type':Sequelize[_0xda94('0x12')]},'cc':{'type':Sequelize['TEXT']},'bcc':{'type':Sequelize[_0xda94('0x13')]},'sendIfEmpty':{'type':Sequelize[_0xda94('0x2')],'defaultValue':!![]}}; \ No newline at end of file +var _0xdfb0=['BOOLEAN','0\x200\x20*\x20*\x20*','DATE','INTEGER','ENUM','quarters','weeks','days','hours','pdf','xlsx','csv','default','custom','sequelize','exports','STRING'];(function(_0x2ac4af,_0x288c53){var _0x3a36df=function(_0x271b11){while(--_0x271b11){_0x2ac4af['push'](_0x2ac4af['shift']());}};_0x3a36df(++_0x288c53);}(_0xdfb0,0xeb));var _0x0dfb=function(_0x2ed7fc,_0x3c44ea){_0x2ed7fc=_0x2ed7fc-0x0;var _0x404986=_0xdfb0[_0x2ed7fc];return _0x404986;};'use strict';var Sequelize=require(_0x0dfb('0x0'));module[_0x0dfb('0x1')]={'name':{'type':Sequelize[_0x0dfb('0x2')],'allowNull':![]},'description':{'type':Sequelize[_0x0dfb('0x2')]},'active':{'type':Sequelize[_0x0dfb('0x3')],'allowNull':![],'defaultValue':![]},'cron':{'type':Sequelize[_0x0dfb('0x2')],'allowNull':![],'defaultValue':_0x0dfb('0x4')},'startAt':{'type':Sequelize['DATE'],'allowNull':![]},'endAt':{'type':Sequelize[_0x0dfb('0x5')],'allowNull':![]},'subtractNumber':{'type':Sequelize[_0x0dfb('0x6')],'allowNull':![],'defaultValue':0x1,'validate':{'min':0x1}},'subtractUnit':{'type':Sequelize[_0x0dfb('0x7')]('years',_0x0dfb('0x8'),'months',_0x0dfb('0x9'),_0x0dfb('0xa'),_0x0dfb('0xb'),'minutes'),'allowNull':![],'defaultValue':_0x0dfb('0xa')},'output':{'type':Sequelize[_0x0dfb('0x7')]('csv',_0x0dfb('0xc'),_0x0dfb('0xd')),'allowNull':![],'defaultValue':_0x0dfb('0xe')},'type':{'type':Sequelize[_0x0dfb('0x7')]('custom',_0x0dfb('0xf')),'allowNull':![],'defaultValue':_0x0dfb('0x10')},'sendMail':{'type':Sequelize[_0x0dfb('0x3')],'defaultValue':![]},'email':{'type':Sequelize['STRING']},'cc':{'type':Sequelize['TEXT']},'bcc':{'type':Sequelize['TEXT']},'sendIfEmpty':{'type':Sequelize[_0x0dfb('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 afcfc6a..04511c2 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 _0x1cf8=['offset','set','Content-Range','apply','reject','update','then','destroy','get','Scheduler','UserProfileResource','stack','name','index','map','Schedule','rawAttributes','fieldName','type','key','query','filters','intersection','model','attributes','hasOwnProperty','limit','order','sort','where','pick','filter','merge','VIRTUAL','includeAll','findAll','catch','show','keys','fields','length','include','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileSection','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','params','run','../../config/schedule','rimraf','zip-dir','moment','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','json','undefined','count'];(function(_0x2f3794,_0x3c3bec){var _0x1c9fbe=function(_0x2d2eac){while(--_0x2d2eac){_0x2f3794['push'](_0x2f3794['shift']());}};_0x1c9fbe(++_0x3c3bec);}(_0x1cf8,0x83));var _0x81cf=function(_0x295b61,_0x808c6c){_0x295b61=_0x295b61-0x0;var _0x1f9558=_0x1cf8[_0x295b61];return _0x1f9558;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x81cf('0x0'));var zipdir=require(_0x81cf('0x1'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0x81cf('0x2'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require('util');var path=require(_0x81cf('0x3'));var sox=require(_0x81cf('0x4'));var csv=require(_0x81cf('0x5'));var ejs=require(_0x81cf('0x6'));var fs=require('fs');var fs_extra=require(_0x81cf('0x7'));var _=require(_0x81cf('0x8'));var squel=require(_0x81cf('0x9'));var crypto=require(_0x81cf('0xa'));var jsforce=require(_0x81cf('0xb'));var deskjs=require('desk.js');var toCsv=require(_0x81cf('0x5'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x81cf('0xc'));var authService=require(_0x81cf('0xd'));var qs=require('../../components/parsers/qs');var as=require(_0x81cf('0xe'));var hardwareService=require(_0x81cf('0xf'));var logger=require(_0x81cf('0x10'))('api');var utils=require(_0x81cf('0x11'));var config=require(_0x81cf('0x12'));var licenseUtil=require('../../config/license/util');var db=require(_0x81cf('0x13'))['db'];function respondWithStatusCode(_0x58cf49,_0x38d6d4){_0x38d6d4=_0x38d6d4||0xcc;return function(_0x443690){if(_0x443690){return _0x58cf49[_0x81cf('0x14')](_0x38d6d4);}return _0x58cf49[_0x81cf('0x15')](_0x38d6d4)['end']();};}function respondWithResult(_0x42b8b6,_0xe29784){_0xe29784=_0xe29784||0xc8;return function(_0xb37355){if(_0xb37355){return _0x42b8b6[_0x81cf('0x15')](_0xe29784)[_0x81cf('0x16')](_0xb37355);}};}function respondWithFilteredResult(_0xb1df26,_0x38e532){return function(_0x5eb419){if(_0x5eb419){var _0x20db77=typeof _0x38e532['offset']===_0x81cf('0x17')&&typeof _0x38e532['limit']==='undefined';var _0x191d4f=_0x5eb419[_0x81cf('0x18')];var _0x3949ee=_0x20db77?0x0:_0x38e532[_0x81cf('0x19')];var _0x460a72=_0x20db77?_0x5eb419[_0x81cf('0x18')]:_0x38e532[_0x81cf('0x19')]+_0x38e532['limit'];var _0x4ef3f9;if(_0x460a72>=_0x191d4f){_0x460a72=_0x191d4f;_0x4ef3f9=0xc8;}else{_0x4ef3f9=0xce;}_0xb1df26['status'](_0x4ef3f9);return _0xb1df26[_0x81cf('0x1a')](_0x81cf('0x1b'),_0x3949ee+'-'+_0x460a72+'/'+_0x191d4f)[_0x81cf('0x16')](_0x5eb419);}return null;};}function patchUpdates(_0x2926e8){return function(_0x2f1a3c){try{jsonpatch[_0x81cf('0x1c')](_0x2f1a3c,_0x2926e8,!![]);}catch(_0x3cbd16){return BPromise[_0x81cf('0x1d')](_0x3cbd16);}return _0x2f1a3c['save']();};}function saveUpdates(_0x2c2333,_0x1214fc){return function(_0x3d9a1b){if(_0x3d9a1b){return _0x3d9a1b[_0x81cf('0x1e')](_0x2c2333)[_0x81cf('0x1f')](function(_0x42bc8d){return _0x42bc8d;});}return null;};}function removeEntity(_0x557eba,_0x440e9a){return function(_0x25484f){if(_0x25484f){return _0x25484f[_0x81cf('0x20')]()[_0x81cf('0x1f')](function(){var _0x22015a=_0x25484f[_0x81cf('0x21')]({'plain':!![]});var _0x16bd6b=_0x81cf('0x22');return db[_0x81cf('0x23')][_0x81cf('0x20')]({'where':{'type':_0x16bd6b,'resourceId':_0x22015a['id']}})[_0x81cf('0x1f')](function(){return _0x25484f;});})[_0x81cf('0x1f')](function(){_0x557eba[_0x81cf('0x15')](0xcc)['end']();});}};}function handleEntityNotFound(_0x2641dd,_0xc9a3bb){return function(_0x24e5b3){if(!_0x24e5b3){_0x2641dd[_0x81cf('0x14')](0x194);}return _0x24e5b3;};}function handleError(_0x300325,_0x3a671e){_0x3a671e=_0x3a671e||0x1f4;return function(_0x4b811a){logger['error'](_0x4b811a[_0x81cf('0x24')]);if(_0x4b811a[_0x81cf('0x25')]){delete _0x4b811a[_0x81cf('0x25')];}_0x300325['status'](_0x3a671e)['send'](_0x4b811a);};}exports[_0x81cf('0x26')]=function(_0x582932,_0x4e86b6){var _0x24a825={},_0x42aee8={},_0x17cf26={'count':0x0,'rows':[]};var _0x548ed6=_[_0x81cf('0x27')](db[_0x81cf('0x28')][_0x81cf('0x29')],function(_0x423056){return{'name':_0x423056[_0x81cf('0x2a')],'type':_0x423056[_0x81cf('0x2b')][_0x81cf('0x2c')]};});_0x42aee8['model']=_[_0x81cf('0x27')](_0x548ed6,_0x81cf('0x25'));_0x42aee8[_0x81cf('0x2d')]=_['keys'](_0x582932[_0x81cf('0x2d')]);_0x42aee8[_0x81cf('0x2e')]=_[_0x81cf('0x2f')](_0x42aee8[_0x81cf('0x30')],_0x42aee8[_0x81cf('0x2d')]);_0x24a825['attributes']=_[_0x81cf('0x2f')](_0x42aee8[_0x81cf('0x30')],qs['fields'](_0x582932[_0x81cf('0x2d')]['fields']));_0x24a825[_0x81cf('0x31')]=_0x24a825['attributes']['length']?_0x24a825[_0x81cf('0x31')]:_0x42aee8[_0x81cf('0x30')];if(!_0x582932[_0x81cf('0x2d')][_0x81cf('0x32')]('nolimit')){_0x24a825[_0x81cf('0x33')]=qs[_0x81cf('0x33')](_0x582932[_0x81cf('0x2d')][_0x81cf('0x33')]);_0x24a825[_0x81cf('0x19')]=qs[_0x81cf('0x19')](_0x582932['query'][_0x81cf('0x19')]);}_0x24a825[_0x81cf('0x34')]=qs['sort'](_0x582932[_0x81cf('0x2d')][_0x81cf('0x35')]);_0x24a825[_0x81cf('0x36')]=qs[_0x81cf('0x2e')](_[_0x81cf('0x37')](_0x582932[_0x81cf('0x2d')],_0x42aee8['filters']),_0x548ed6);if(_0x582932[_0x81cf('0x2d')][_0x81cf('0x38')]){_0x24a825[_0x81cf('0x36')]=_[_0x81cf('0x39')](_0x24a825[_0x81cf('0x36')],{'$or':_[_0x81cf('0x27')](_0x548ed6,function(_0x477a43){if(_0x477a43['type']!==_0x81cf('0x3a')){var _0x570a82={};_0x570a82[_0x477a43[_0x81cf('0x25')]]={'$like':'%'+_0x582932[_0x81cf('0x2d')][_0x81cf('0x38')]+'%'};return _0x570a82;}})});}_0x24a825=_[_0x81cf('0x39')]({},_0x24a825,_0x582932['options']);var _0x2a50dd={'where':_0x24a825['where']};return db[_0x81cf('0x28')][_0x81cf('0x18')](_0x2a50dd)[_0x81cf('0x1f')](function(_0x2945df){_0x17cf26[_0x81cf('0x18')]=_0x2945df;if(_0x582932[_0x81cf('0x2d')][_0x81cf('0x3b')]){_0x24a825['include']=[{'all':!![]}];}return db[_0x81cf('0x28')][_0x81cf('0x3c')](_0x24a825);})[_0x81cf('0x1f')](function(_0x3148fd){_0x17cf26['rows']=_0x3148fd;return _0x17cf26;})[_0x81cf('0x1f')](respondWithFilteredResult(_0x4e86b6,_0x24a825))[_0x81cf('0x3d')](handleError(_0x4e86b6,null));};exports[_0x81cf('0x3e')]=function(_0xdb1e9d,_0x2b243e){var _0x3bffb7={'raw':![],'where':{'id':_0xdb1e9d['params']['id']}},_0x4ff2e2={};_0x4ff2e2[_0x81cf('0x30')]=_[_0x81cf('0x3f')](db[_0x81cf('0x28')][_0x81cf('0x29')]);_0x4ff2e2['query']=_[_0x81cf('0x3f')](_0xdb1e9d[_0x81cf('0x2d')]);_0x4ff2e2[_0x81cf('0x2e')]=_[_0x81cf('0x2f')](_0x4ff2e2['model'],_0x4ff2e2[_0x81cf('0x2d')]);_0x3bffb7['attributes']=_[_0x81cf('0x2f')](_0x4ff2e2[_0x81cf('0x30')],qs[_0x81cf('0x40')](_0xdb1e9d[_0x81cf('0x2d')][_0x81cf('0x40')]));_0x3bffb7[_0x81cf('0x31')]=_0x3bffb7[_0x81cf('0x31')][_0x81cf('0x41')]?_0x3bffb7[_0x81cf('0x31')]:_0x4ff2e2[_0x81cf('0x30')];if(_0xdb1e9d['query'][_0x81cf('0x3b')]){_0x3bffb7[_0x81cf('0x42')]=[{'all':!![]}];}_0x3bffb7=_[_0x81cf('0x39')]({},_0x3bffb7,_0xdb1e9d['options']);return db[_0x81cf('0x28')][_0x81cf('0x43')](_0x3bffb7)[_0x81cf('0x1f')](handleEntityNotFound(_0x2b243e,null))[_0x81cf('0x1f')](respondWithResult(_0x2b243e,null))[_0x81cf('0x3d')](handleError(_0x2b243e,null));};exports[_0x81cf('0x44')]=function(_0x53bc5b,_0x5f2c7b){return db[_0x81cf('0x28')][_0x81cf('0x44')](_0x53bc5b[_0x81cf('0x45')],{})[_0x81cf('0x1f')](function(_0x55cf4a){var _0x4a657e=_0x53bc5b[_0x81cf('0x46')][_0x81cf('0x21')]({'plain':!![]});if(!_0x4a657e)throw new Error(_0x81cf('0x47'));if(_0x4a657e['role']===_0x81cf('0x46')){var _0x24ca24=_0x55cf4a[_0x81cf('0x21')]({'plain':!![]});var _0x3bc798=_0x81cf('0x22');return db[_0x81cf('0x48')][_0x81cf('0x43')]({'where':{'name':_0x3bc798,'userProfileId':_0x4a657e['userProfileId']},'raw':!![]})[_0x81cf('0x1f')](function(_0x24992b){if(_0x24992b&&_0x24992b[_0x81cf('0x49')]===0x0){return db[_0x81cf('0x23')][_0x81cf('0x44')]({'name':_0x24ca24[_0x81cf('0x25')],'resourceId':_0x24ca24['id'],'type':_0x24992b[_0x81cf('0x25')],'sectionId':_0x24992b['id']},{})[_0x81cf('0x1f')](function(){return _0x55cf4a;});}else{return _0x55cf4a;}})[_0x81cf('0x3d')](function(_0x1ef093){logger['error'](_0x81cf('0x4a'),_0x1ef093);throw _0x1ef093;});}return _0x55cf4a;})[_0x81cf('0x1f')](respondWithResult(_0x5f2c7b,0xc9))[_0x81cf('0x3d')](handleError(_0x5f2c7b,null));};exports[_0x81cf('0x1e')]=function(_0x1312bf,_0x57aa0e){if(_0x1312bf[_0x81cf('0x45')]['id']){delete _0x1312bf[_0x81cf('0x45')]['id'];}return db[_0x81cf('0x28')][_0x81cf('0x43')]({'where':{'id':_0x1312bf[_0x81cf('0x4b')]['id']}})[_0x81cf('0x1f')](handleEntityNotFound(_0x57aa0e,null))[_0x81cf('0x1f')](saveUpdates(_0x1312bf[_0x81cf('0x45')],null))[_0x81cf('0x1f')](respondWithResult(_0x57aa0e,null))[_0x81cf('0x3d')](handleError(_0x57aa0e,null));};exports['destroy']=function(_0x4f9916,_0x15a2ed){return db['Schedule'][_0x81cf('0x43')]({'where':{'id':_0x4f9916[_0x81cf('0x4b')]['id']}})[_0x81cf('0x1f')](handleEntityNotFound(_0x15a2ed,null))[_0x81cf('0x1f')](removeEntity(_0x15a2ed,null))[_0x81cf('0x3d')](handleError(_0x15a2ed,null));};exports[_0x81cf('0x4c')]=function(_0x489277,_0x30a220,_0x357e2b){var _0x30a96e=require(_0x81cf('0x4d'));return db['Schedule']['find']({'where':{'id':_0x489277[_0x81cf('0x4b')]['id']},'raw':!![]})[_0x81cf('0x1f')](handleEntityNotFound(_0x30a220,null))[_0x81cf('0x1f')](function(){_0x30a96e[_0x81cf('0x4c')](_0x489277['params']['id']);})['then'](respondWithStatusCode(_0x30a220,null))[_0x81cf('0x3d')](handleError(_0x30a220,null));}; \ No newline at end of file +var _0x3f96=['count','status','set','Content-Range','apply','reject','then','destroy','Scheduler','UserProfileResource','sendStatus','stack','name','send','index','map','Schedule','rawAttributes','fieldName','key','keys','query','filters','intersection','model','attributes','fields','hasOwnProperty','nolimit','order','sort','filter','where','merge','type','includeAll','rows','catch','show','options','create','body','user','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileSection','find','userProfileId','autoAssociation','error','update','params','../../config/schedule','run','eml-format','zip-dir','request-promise','mustache','util','sox','to-csv','ejs','fs-extra','crypto','jsforce','papaparse','ioredis','../../components/auth/service','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','end','json','offset','limit'];(function(_0x37f1eb,_0x3ad355){var _0x5594f2=function(_0x522eb4){while(--_0x522eb4){_0x37f1eb['push'](_0x37f1eb['shift']());}};_0x5594f2(++_0x3ad355);}(_0x3f96,0x1bc));var _0x63f9=function(_0x58d0b3,_0x2ba142){_0x58d0b3=_0x58d0b3-0x0;var _0x21c6bb=_0x3f96[_0x58d0b3];return _0x21c6bb;};'use strict';var emlformat=require(_0x63f9('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x63f9('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0x63f9('0x2'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0x63f9('0x3'));var util=require(_0x63f9('0x4'));var path=require('path');var sox=require(_0x63f9('0x5'));var csv=require(_0x63f9('0x6'));var ejs=require(_0x63f9('0x7'));var fs=require('fs');var fs_extra=require(_0x63f9('0x8'));var _=require('lodash');var squel=require('squel');var crypto=require(_0x63f9('0x9'));var jsforce=require(_0x63f9('0xa'));var deskjs=require('desk.js');var toCsv=require(_0x63f9('0x6'));var querystring=require('querystring');var Papa=require(_0x63f9('0xb'));var Redis=require(_0x63f9('0xc'));var authService=require(_0x63f9('0xd'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x63f9('0xe'));var logger=require(_0x63f9('0xf'))('api');var utils=require(_0x63f9('0x10'));var config=require(_0x63f9('0x11'));var licenseUtil=require(_0x63f9('0x12'));var db=require(_0x63f9('0x13'))['db'];function respondWithStatusCode(_0x222a75,_0x2ebba4){_0x2ebba4=_0x2ebba4||0xcc;return function(_0x335b33){if(_0x335b33){return _0x222a75['sendStatus'](_0x2ebba4);}return _0x222a75['status'](_0x2ebba4)[_0x63f9('0x14')]();};}function respondWithResult(_0x16349c,_0x4a4b94){_0x4a4b94=_0x4a4b94||0xc8;return function(_0x2b3ce8){if(_0x2b3ce8){return _0x16349c['status'](_0x4a4b94)[_0x63f9('0x15')](_0x2b3ce8);}};}function respondWithFilteredResult(_0x260b1b,_0x232300){return function(_0x26339a){if(_0x26339a){var _0x5bceb3=typeof _0x232300[_0x63f9('0x16')]==='undefined'&&typeof _0x232300[_0x63f9('0x17')]==='undefined';var _0x211d07=_0x26339a[_0x63f9('0x18')];var _0x421d3e=_0x5bceb3?0x0:_0x232300[_0x63f9('0x16')];var _0x51137a=_0x5bceb3?_0x26339a[_0x63f9('0x18')]:_0x232300['offset']+_0x232300['limit'];var _0x43c949;if(_0x51137a>=_0x211d07){_0x51137a=_0x211d07;_0x43c949=0xc8;}else{_0x43c949=0xce;}_0x260b1b[_0x63f9('0x19')](_0x43c949);return _0x260b1b[_0x63f9('0x1a')](_0x63f9('0x1b'),_0x421d3e+'-'+_0x51137a+'/'+_0x211d07)[_0x63f9('0x15')](_0x26339a);}return null;};}function patchUpdates(_0x10e09b){return function(_0x3e4896){try{jsonpatch[_0x63f9('0x1c')](_0x3e4896,_0x10e09b,!![]);}catch(_0x4270fc){return BPromise[_0x63f9('0x1d')](_0x4270fc);}return _0x3e4896['save']();};}function saveUpdates(_0x4cc706,_0x137c5e){return function(_0x18ae78){if(_0x18ae78){return _0x18ae78['update'](_0x4cc706)[_0x63f9('0x1e')](function(_0xdb9480){return _0xdb9480;});}return null;};}function removeEntity(_0x18f4ca,_0x3039df){return function(_0x5269b0){if(_0x5269b0){return _0x5269b0[_0x63f9('0x1f')]()[_0x63f9('0x1e')](function(){var _0x5abd4c=_0x5269b0['get']({'plain':!![]});var _0x382792=_0x63f9('0x20');return db[_0x63f9('0x21')]['destroy']({'where':{'type':_0x382792,'resourceId':_0x5abd4c['id']}})[_0x63f9('0x1e')](function(){return _0x5269b0;});})[_0x63f9('0x1e')](function(){_0x18f4ca[_0x63f9('0x19')](0xcc)['end']();});}};}function handleEntityNotFound(_0x3452b5,_0x488a59){return function(_0x3722ff){if(!_0x3722ff){_0x3452b5[_0x63f9('0x22')](0x194);}return _0x3722ff;};}function handleError(_0x2e8116,_0x35fa3d){_0x35fa3d=_0x35fa3d||0x1f4;return function(_0x26cf1f){logger['error'](_0x26cf1f[_0x63f9('0x23')]);if(_0x26cf1f[_0x63f9('0x24')]){delete _0x26cf1f[_0x63f9('0x24')];}_0x2e8116[_0x63f9('0x19')](_0x35fa3d)[_0x63f9('0x25')](_0x26cf1f);};}exports[_0x63f9('0x26')]=function(_0x198643,_0x2a9caf){var _0xf13bc1={},_0x2ea774={},_0x48299d={'count':0x0,'rows':[]};var _0xceda96=_[_0x63f9('0x27')](db[_0x63f9('0x28')][_0x63f9('0x29')],function(_0x54d983){return{'name':_0x54d983[_0x63f9('0x2a')],'type':_0x54d983['type'][_0x63f9('0x2b')]};});_0x2ea774['model']=_[_0x63f9('0x27')](_0xceda96,'name');_0x2ea774['query']=_[_0x63f9('0x2c')](_0x198643[_0x63f9('0x2d')]);_0x2ea774[_0x63f9('0x2e')]=_[_0x63f9('0x2f')](_0x2ea774[_0x63f9('0x30')],_0x2ea774[_0x63f9('0x2d')]);_0xf13bc1[_0x63f9('0x31')]=_[_0x63f9('0x2f')](_0x2ea774['model'],qs[_0x63f9('0x32')](_0x198643[_0x63f9('0x2d')]['fields']));_0xf13bc1['attributes']=_0xf13bc1[_0x63f9('0x31')]['length']?_0xf13bc1[_0x63f9('0x31')]:_0x2ea774[_0x63f9('0x30')];if(!_0x198643[_0x63f9('0x2d')][_0x63f9('0x33')](_0x63f9('0x34'))){_0xf13bc1[_0x63f9('0x17')]=qs['limit'](_0x198643['query'][_0x63f9('0x17')]);_0xf13bc1[_0x63f9('0x16')]=qs[_0x63f9('0x16')](_0x198643[_0x63f9('0x2d')][_0x63f9('0x16')]);}_0xf13bc1[_0x63f9('0x35')]=qs[_0x63f9('0x36')](_0x198643[_0x63f9('0x2d')][_0x63f9('0x36')]);_0xf13bc1['where']=qs[_0x63f9('0x2e')](_['pick'](_0x198643[_0x63f9('0x2d')],_0x2ea774['filters']),_0xceda96);if(_0x198643['query'][_0x63f9('0x37')]){_0xf13bc1[_0x63f9('0x38')]=_[_0x63f9('0x39')](_0xf13bc1['where'],{'$or':_['map'](_0xceda96,function(_0x14d87a){if(_0x14d87a[_0x63f9('0x3a')]!=='VIRTUAL'){var _0x2b0363={};_0x2b0363[_0x14d87a[_0x63f9('0x24')]]={'$like':'%'+_0x198643[_0x63f9('0x2d')][_0x63f9('0x37')]+'%'};return _0x2b0363;}})});}_0xf13bc1=_[_0x63f9('0x39')]({},_0xf13bc1,_0x198643['options']);var _0x268205={'where':_0xf13bc1[_0x63f9('0x38')]};return db[_0x63f9('0x28')][_0x63f9('0x18')](_0x268205)[_0x63f9('0x1e')](function(_0x181b23){_0x48299d[_0x63f9('0x18')]=_0x181b23;if(_0x198643[_0x63f9('0x2d')][_0x63f9('0x3b')]){_0xf13bc1['include']=[{'all':!![]}];}return db[_0x63f9('0x28')]['findAll'](_0xf13bc1);})[_0x63f9('0x1e')](function(_0x37acad){_0x48299d[_0x63f9('0x3c')]=_0x37acad;return _0x48299d;})[_0x63f9('0x1e')](respondWithFilteredResult(_0x2a9caf,_0xf13bc1))[_0x63f9('0x3d')](handleError(_0x2a9caf,null));};exports[_0x63f9('0x3e')]=function(_0x1937c5,_0x6dd429){var _0x152db4={'raw':![],'where':{'id':_0x1937c5['params']['id']}},_0x57a282={};_0x57a282[_0x63f9('0x30')]=_[_0x63f9('0x2c')](db[_0x63f9('0x28')][_0x63f9('0x29')]);_0x57a282[_0x63f9('0x2d')]=_[_0x63f9('0x2c')](_0x1937c5[_0x63f9('0x2d')]);_0x57a282['filters']=_[_0x63f9('0x2f')](_0x57a282['model'],_0x57a282[_0x63f9('0x2d')]);_0x152db4[_0x63f9('0x31')]=_[_0x63f9('0x2f')](_0x57a282[_0x63f9('0x30')],qs['fields'](_0x1937c5[_0x63f9('0x2d')][_0x63f9('0x32')]));_0x152db4[_0x63f9('0x31')]=_0x152db4[_0x63f9('0x31')]['length']?_0x152db4[_0x63f9('0x31')]:_0x57a282[_0x63f9('0x30')];if(_0x1937c5[_0x63f9('0x2d')][_0x63f9('0x3b')]){_0x152db4['include']=[{'all':!![]}];}_0x152db4=_['merge']({},_0x152db4,_0x1937c5[_0x63f9('0x3f')]);return db[_0x63f9('0x28')]['find'](_0x152db4)[_0x63f9('0x1e')](handleEntityNotFound(_0x6dd429,null))[_0x63f9('0x1e')](respondWithResult(_0x6dd429,null))[_0x63f9('0x3d')](handleError(_0x6dd429,null));};exports[_0x63f9('0x40')]=function(_0x48ca06,_0x5ac627){return db['Schedule'][_0x63f9('0x40')](_0x48ca06[_0x63f9('0x41')],{})[_0x63f9('0x1e')](function(_0x5bd0a8){var _0x23b3e4=_0x48ca06[_0x63f9('0x42')][_0x63f9('0x43')]({'plain':!![]});if(!_0x23b3e4)throw new Error(_0x63f9('0x44'));if(_0x23b3e4['role']===_0x63f9('0x42')){var _0x328b2c=_0x5bd0a8[_0x63f9('0x43')]({'plain':!![]});var _0x2da835=_0x63f9('0x20');return db[_0x63f9('0x45')][_0x63f9('0x46')]({'where':{'name':_0x2da835,'userProfileId':_0x23b3e4[_0x63f9('0x47')]},'raw':!![]})[_0x63f9('0x1e')](function(_0x44cab6){if(_0x44cab6&&_0x44cab6[_0x63f9('0x48')]===0x0){return db[_0x63f9('0x21')][_0x63f9('0x40')]({'name':_0x328b2c[_0x63f9('0x24')],'resourceId':_0x328b2c['id'],'type':_0x44cab6[_0x63f9('0x24')],'sectionId':_0x44cab6['id']},{})[_0x63f9('0x1e')](function(){return _0x5bd0a8;});}else{return _0x5bd0a8;}})[_0x63f9('0x3d')](function(_0x472076){logger[_0x63f9('0x49')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x472076);throw _0x472076;});}return _0x5bd0a8;})[_0x63f9('0x1e')](respondWithResult(_0x5ac627,0xc9))[_0x63f9('0x3d')](handleError(_0x5ac627,null));};exports[_0x63f9('0x4a')]=function(_0x3e0ddc,_0x2aee6b){if(_0x3e0ddc[_0x63f9('0x41')]['id']){delete _0x3e0ddc[_0x63f9('0x41')]['id'];}return db[_0x63f9('0x28')][_0x63f9('0x46')]({'where':{'id':_0x3e0ddc[_0x63f9('0x4b')]['id']}})[_0x63f9('0x1e')](handleEntityNotFound(_0x2aee6b,null))[_0x63f9('0x1e')](saveUpdates(_0x3e0ddc[_0x63f9('0x41')],null))[_0x63f9('0x1e')](respondWithResult(_0x2aee6b,null))[_0x63f9('0x3d')](handleError(_0x2aee6b,null));};exports['destroy']=function(_0x522932,_0x55db44){return db[_0x63f9('0x28')][_0x63f9('0x46')]({'where':{'id':_0x522932['params']['id']}})[_0x63f9('0x1e')](handleEntityNotFound(_0x55db44,null))[_0x63f9('0x1e')](removeEntity(_0x55db44,null))[_0x63f9('0x3d')](handleError(_0x55db44,null));};exports['run']=function(_0x3de11d,_0x12b30b,_0x58f3d6){var _0x2531e4=require(_0x63f9('0x4c'));return db[_0x63f9('0x28')]['find']({'where':{'id':_0x3de11d[_0x63f9('0x4b')]['id']},'raw':!![]})[_0x63f9('0x1e')](handleEntityNotFound(_0x12b30b,null))[_0x63f9('0x1e')](function(){_0x2531e4[_0x63f9('0x4d')](_0x3de11d['params']['id']);})[_0x63f9('0x1e')](respondWithStatusCode(_0x12b30b,null))['catch'](handleError(_0x12b30b,null));}; \ No newline at end of file diff --git a/server/api/schedule/schedule.model.js b/server/api/schedule/schedule.model.js index 66335d4..2a50f16 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 _0xe2a9=['../../config/logger','api','moment','path','rimraf','../../config/environment','./schedule.attributes','exports','define','Schedule','tools_schedules','util'];(function(_0x1b6186,_0x1ec7f2){var _0x186121=function(_0x1748a8){while(--_0x1748a8){_0x1b6186['push'](_0x1b6186['shift']());}};_0x186121(++_0x1ec7f2);}(_0xe2a9,0x143));var _0x9e2a=function(_0x52d73d,_0x310285){_0x52d73d=_0x52d73d-0x0;var _0x2d47b9=_0xe2a9[_0x52d73d];return _0x2d47b9;};'use strict';var _=require('lodash');var util=require(_0x9e2a('0x0'));var logger=require(_0x9e2a('0x1'))(_0x9e2a('0x2'));var moment=require(_0x9e2a('0x3'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0x9e2a('0x4'));var rimraf=require(_0x9e2a('0x5'));var config=require(_0x9e2a('0x6'));var attributes=require(_0x9e2a('0x7'));module[_0x9e2a('0x8')]=function(_0x11e548,_0xd17e83){return _0x11e548[_0x9e2a('0x9')](_0x9e2a('0xa'),attributes,{'tableName':_0x9e2a('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xfdc8=['../../config/environment','exports','tools_schedules','lodash','util','api','moment','bluebird','request-promise','rimraf'];(function(_0x1a750f,_0x37d916){var _0x26a742=function(_0x109a49){while(--_0x109a49){_0x1a750f['push'](_0x1a750f['shift']());}};_0x26a742(++_0x37d916);}(_0xfdc8,0x8f));var _0x8fdc=function(_0x3db122,_0x5e6bee){_0x3db122=_0x3db122-0x0;var _0x325b67=_0xfdc8[_0x3db122];return _0x325b67;};'use strict';var _=require(_0x8fdc('0x0'));var util=require(_0x8fdc('0x1'));var logger=require('../../config/logger')(_0x8fdc('0x2'));var moment=require(_0x8fdc('0x3'));var BPromise=require(_0x8fdc('0x4'));var rp=require(_0x8fdc('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x8fdc('0x6'));var config=require(_0x8fdc('0x7'));var attributes=require('./schedule.attributes');module[_0x8fdc('0x8')]=function(_0x507f6f,_0x1f551b){return _0x507f6f['define']('Schedule',attributes,{'tableName':_0x8fdc('0x9'),'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 168d470..547eebc 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 _0x54e1=['ioredis','../../mysqldb','rpc','../../config/environment','jayson/promise','client','http','request','Schedule,\x20%s,\x20%s','request\x20sent','debug','Schedule,\x20%s,\x20%s,\x20%s','error','message','result','catch','lodash','moment','bluebird'];(function(_0x1d5c43,_0x328375){var _0x4d785b=function(_0x53cbc9){while(--_0x53cbc9){_0x1d5c43['push'](_0x1d5c43['shift']());}};_0x4d785b(++_0x328375);}(_0x54e1,0x11a));var _0x154e=function(_0x47aa05,_0x637516){_0x47aa05=_0x47aa05-0x0;var _0x4630a0=_0x54e1[_0x47aa05];return _0x4630a0;};'use strict';var _=require(_0x154e('0x0'));var util=require('util');var moment=require(_0x154e('0x1'));var BPromise=require(_0x154e('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x154e('0x3'));var db=require(_0x154e('0x4'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0x154e('0x5'));var config=require(_0x154e('0x6'));var jayson=require(_0x154e('0x7'));var client=jayson[_0x154e('0x8')][_0x154e('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x4c2e36,_0x3f73c1,_0x352c15){return new BPromise(function(_0x137949,_0x28b955){return client[_0x154e('0xa')](_0x4c2e36,_0x352c15)['then'](function(_0x38a231){logger['info'](_0x154e('0xb'),_0x3f73c1,_0x154e('0xc'));logger[_0x154e('0xd')](_0x154e('0xe'),_0x3f73c1,_0x154e('0xc'),JSON['stringify'](_0x38a231));if(_0x38a231[_0x154e('0xf')]){if(_0x38a231[_0x154e('0xf')]['code']===0x1f4){logger[_0x154e('0xf')](_0x154e('0xb'),_0x3f73c1,_0x38a231[_0x154e('0xf')][_0x154e('0x10')]);return _0x28b955(_0x38a231[_0x154e('0xf')][_0x154e('0x10')]);}logger[_0x154e('0xf')](_0x154e('0xb'),_0x3f73c1,_0x38a231['error'][_0x154e('0x10')]);return _0x137949(_0x38a231['error'][_0x154e('0x10')]);}else{logger['info'](_0x154e('0xb'),_0x3f73c1,_0x154e('0xc'));_0x137949(_0x38a231[_0x154e('0x11')][_0x154e('0x10')]);}})[_0x154e('0x12')](function(_0x55550b){logger[_0x154e('0xf')](_0x154e('0xb'),_0x3f73c1,_0x55550b);_0x28b955(_0x55550b);});});} \ No newline at end of file +var _0xe046=['util','ioredis','../../config/utils','../../config/logger','jayson/promise','client','http','request','then','info','Schedule,\x20%s,\x20%s','request\x20sent','debug','Schedule,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch'];(function(_0x23d1f6,_0x34845d){var _0x136ebb=function(_0x22dad2){while(--_0x22dad2){_0x23d1f6['push'](_0x23d1f6['shift']());}};_0x136ebb(++_0x34845d);}(_0xe046,0x1e0));var _0x6e04=function(_0x2d2089,_0x3917d3){_0x2d2089=_0x2d2089-0x0;var _0xa11ee1=_0xe046[_0x2d2089];return _0xa11ee1;};'use strict';var _=require('lodash');var util=require(_0x6e04('0x0'));var moment=require('moment');var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x6e04('0x1'));var db=require('../../mysqldb')['db'];var utils=require(_0x6e04('0x2'));var logger=require(_0x6e04('0x3'))('rpc');var config=require('../../config/environment');var jayson=require(_0x6e04('0x4'));var client=jayson[_0x6e04('0x5')][_0x6e04('0x6')]({'port':0x232a});function respondWithRpcPromise(_0x1f7f2c,_0x2878bd,_0x4143d7){return new BPromise(function(_0x514eac,_0xfddf9){return client[_0x6e04('0x7')](_0x1f7f2c,_0x4143d7)[_0x6e04('0x8')](function(_0x5ea5c1){logger[_0x6e04('0x9')](_0x6e04('0xa'),_0x2878bd,_0x6e04('0xb'));logger[_0x6e04('0xc')](_0x6e04('0xd'),_0x2878bd,_0x6e04('0xb'),JSON[_0x6e04('0xe')](_0x5ea5c1));if(_0x5ea5c1[_0x6e04('0xf')]){if(_0x5ea5c1[_0x6e04('0xf')][_0x6e04('0x10')]===0x1f4){logger[_0x6e04('0xf')](_0x6e04('0xa'),_0x2878bd,_0x5ea5c1[_0x6e04('0xf')][_0x6e04('0x11')]);return _0xfddf9(_0x5ea5c1['error'][_0x6e04('0x11')]);}logger[_0x6e04('0xf')](_0x6e04('0xa'),_0x2878bd,_0x5ea5c1[_0x6e04('0xf')]['message']);return _0x514eac(_0x5ea5c1['error']['message']);}else{logger[_0x6e04('0x9')](_0x6e04('0xa'),_0x2878bd,_0x6e04('0xb'));_0x514eac(_0x5ea5c1[_0x6e04('0x12')][_0x6e04('0x11')]);}})[_0x6e04('0x13')](function(_0x42fa2d){logger['error']('Schedule,\x20%s,\x20%s',_0x2878bd,_0x42fa2d);_0xfddf9(_0x42fa2d);});});} \ No newline at end of file diff --git a/server/api/screenRecording/index.js b/server/api/screenRecording/index.js index 0eea109..1b3fa3a 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 _0x8ba4=['put','/:id','update','delete','destroy','multer','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./screenRecording.controller','get','/describe','isAuthenticated','describe','download','post','create'];(function(_0x146c5c,_0x5ede3c){var _0x177d13=function(_0x543350){while(--_0x543350){_0x146c5c['push'](_0x146c5c['shift']());}};_0x177d13(++_0x5ede3c);}(_0x8ba4,0x140));var _0x48ba=function(_0x3e2fcf,_0x579110){_0x3e2fcf=_0x3e2fcf-0x0;var _0x497db7=_0x8ba4[_0x3e2fcf];return _0x497db7;};'use strict';var multer=require(_0x48ba('0x0'));var util=require('util');var path=require('path');var timeout=require(_0x48ba('0x1'));var express=require(_0x48ba('0x2'));var router=express[_0x48ba('0x3')]();var fs_extra=require(_0x48ba('0x4'));var auth=require(_0x48ba('0x5'));var interaction=require(_0x48ba('0x6'));var config=require(_0x48ba('0x7'));var controller=require(_0x48ba('0x8'));router[_0x48ba('0x9')]('/',auth['isAuthenticated'](),controller['index']);router['get'](_0x48ba('0xa'),auth[_0x48ba('0xb')](),controller[_0x48ba('0xc')]);router[_0x48ba('0x9')]('/:id',auth[_0x48ba('0xb')](),controller['show']);router['get']('/:id/download',auth[_0x48ba('0xb')](),controller[_0x48ba('0xd')]);router[_0x48ba('0xe')]('/',auth[_0x48ba('0xb')](),controller[_0x48ba('0xf')]);router[_0x48ba('0x10')](_0x48ba('0x11'),auth[_0x48ba('0xb')](),controller[_0x48ba('0x12')]);router[_0x48ba('0x13')](_0x48ba('0x11'),auth[_0x48ba('0xb')](),controller[_0x48ba('0x14')]);module['exports']=router; \ No newline at end of file +var _0xf3f8=['../../config/environment','./screenRecording.controller','get','index','/describe','isAuthenticated','describe','show','/:id/download','download','post','put','delete','/:id','exports','util','path','connect-timeout','express'];(function(_0xbca1b1,_0x33f0ce){var _0x4e1686=function(_0x58a80c){while(--_0x58a80c){_0xbca1b1['push'](_0xbca1b1['shift']());}};_0x4e1686(++_0x33f0ce);}(_0xf3f8,0xf3));var _0x8f3f=function(_0x41fbee,_0x284a12){_0x41fbee=_0x41fbee-0x0;var _0x148ab1=_0xf3f8[_0x41fbee];return _0x148ab1;};'use strict';var multer=require('multer');var util=require(_0x8f3f('0x0'));var path=require(_0x8f3f('0x1'));var timeout=require(_0x8f3f('0x2'));var express=require(_0x8f3f('0x3'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0x8f3f('0x4'));var controller=require(_0x8f3f('0x5'));router[_0x8f3f('0x6')]('/',auth['isAuthenticated'](),controller[_0x8f3f('0x7')]);router[_0x8f3f('0x6')](_0x8f3f('0x8'),auth[_0x8f3f('0x9')](),controller[_0x8f3f('0xa')]);router['get']('/:id',auth[_0x8f3f('0x9')](),controller[_0x8f3f('0xb')]);router[_0x8f3f('0x6')](_0x8f3f('0xc'),auth[_0x8f3f('0x9')](),controller[_0x8f3f('0xd')]);router[_0x8f3f('0xe')]('/',auth[_0x8f3f('0x9')](),controller['create']);router[_0x8f3f('0xf')]('/:id',auth[_0x8f3f('0x9')](),controller['update']);router[_0x8f3f('0x10')](_0x8f3f('0x11'),auth[_0x8f3f('0x9')](),controller['destroy']);module[_0x8f3f('0x12')]=router; \ No newline at end of file diff --git a/server/api/screenRecording/screenRecording.attributes.js b/server/api/screenRecording/screenRecording.attributes.js index 63fa948..02fac64 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 _0xd070=['startedAt','subtract','duration','DATE','MM-DD-YYYY\x20HH:mm','toString','closedAt','format','createdAt','updatedAt','sequelize','path','../../config/environment','exports','VIRTUAL','getDataValue','value','extname','STRING','replace','setDataValue','INTEGER'];(function(_0x592cea,_0x4e72f1){var _0x1e9cc6=function(_0x166217){while(--_0x166217){_0x592cea['push'](_0x592cea['shift']());}};_0x1e9cc6(++_0x4e72f1);}(_0xd070,0x8e));var _0x0d07=function(_0x210a24,_0x33f94d){_0x210a24=_0x210a24-0x0;var _0x7d90f1=_0xd070[_0x210a24];return _0x7d90f1;};'use strict';var Sequelize=require(_0x0d07('0x0'));var moment=require('moment');var path=require(_0x0d07('0x1'));var config=require(_0x0d07('0x2'));module[_0x0d07('0x3')]={'format':{'type':Sequelize[_0x0d07('0x4')],'get':function(){return this[_0x0d07('0x5')](_0x0d07('0x6'))?path[_0x0d07('0x7')](this[_0x0d07('0x5')](_0x0d07('0x6'))):undefined;}},'interactionid':{'type':Sequelize[_0x0d07('0x8')]},'channel':{'type':Sequelize[_0x0d07('0x8')]},'value':{'type':Sequelize['STRING'],'set':function(_0x13d75a){var _0x5a4366=_0x13d75a[_0x0d07('0x9')](/\\/g,'/');this[_0x0d07('0xa')](_0x0d07('0x6'),_0x5a4366);}},'rating':{'type':Sequelize[_0x0d07('0xb')],'validate':{'max':0x5,'min':0x0}},'duration':{'type':Sequelize[_0x0d07('0xb')],'set':function(_0xc5b04d){this[_0x0d07('0xa')](_0x0d07('0xc'),moment()[_0x0d07('0xd')](_0xc5b04d,'ms'));this[_0x0d07('0xa')]('closedAt',moment());this['setDataValue'](_0x0d07('0xe'),_0xc5b04d);}},'startedAt':{'type':Sequelize[_0x0d07('0xf')],'get':function(){return moment(this['getDataValue'](_0x0d07('0xc')))['format'](_0x0d07('0x10'))[_0x0d07('0x11')]();}},'closedAt':{'type':Sequelize['DATE'],'get':function(){return moment(this[_0x0d07('0x5')](_0x0d07('0x12')))[_0x0d07('0x13')](_0x0d07('0x10'))[_0x0d07('0x11')]();}},'createdAt':{'type':Sequelize[_0x0d07('0xf')],'get':function(){return moment(this['getDataValue'](_0x0d07('0x14')))['format']('MM-DD-YYYY\x20HH:mm')[_0x0d07('0x11')]();}},'updatedAt':{'type':Sequelize[_0x0d07('0xf')],'get':function(){return moment(this[_0x0d07('0x5')](_0x0d07('0x15')))[_0x0d07('0x13')]('MM-DD-YYYY\x20HH:mm')['toString']();}}}; \ No newline at end of file +var _0x6931=['DATE','format','MM-DD-YYYY\x20HH:mm','toString','createdAt','sequelize','moment','path','../../config/environment','exports','VIRTUAL','getDataValue','value','STRING','replace','setDataValue','INTEGER','startedAt','subtract','closedAt','duration'];(function(_0x3d774b,_0x58e02f){var _0x2ccfd1=function(_0x4e5bf5){while(--_0x4e5bf5){_0x3d774b['push'](_0x3d774b['shift']());}};_0x2ccfd1(++_0x58e02f);}(_0x6931,0x1a9));var _0x1693=function(_0xe6c5ad,_0xb3fb70){_0xe6c5ad=_0xe6c5ad-0x0;var _0x4fcc9f=_0x6931[_0xe6c5ad];return _0x4fcc9f;};'use strict';var Sequelize=require(_0x1693('0x0'));var moment=require(_0x1693('0x1'));var path=require(_0x1693('0x2'));var config=require(_0x1693('0x3'));module[_0x1693('0x4')]={'format':{'type':Sequelize[_0x1693('0x5')],'get':function(){return this[_0x1693('0x6')](_0x1693('0x7'))?path['extname'](this[_0x1693('0x6')](_0x1693('0x7'))):undefined;}},'interactionid':{'type':Sequelize[_0x1693('0x8')]},'channel':{'type':Sequelize[_0x1693('0x8')]},'value':{'type':Sequelize[_0x1693('0x8')],'set':function(_0x5de567){var _0x3ab149=_0x5de567[_0x1693('0x9')](/\\/g,'/');this[_0x1693('0xa')]('value',_0x3ab149);}},'rating':{'type':Sequelize[_0x1693('0xb')],'validate':{'max':0x5,'min':0x0}},'duration':{'type':Sequelize[_0x1693('0xb')],'set':function(_0x356ec3){this[_0x1693('0xa')](_0x1693('0xc'),moment()[_0x1693('0xd')](_0x356ec3,'ms'));this[_0x1693('0xa')](_0x1693('0xe'),moment());this[_0x1693('0xa')](_0x1693('0xf'),_0x356ec3);}},'startedAt':{'type':Sequelize[_0x1693('0x10')],'get':function(){return moment(this['getDataValue'](_0x1693('0xc')))[_0x1693('0x11')](_0x1693('0x12'))[_0x1693('0x13')]();}},'closedAt':{'type':Sequelize[_0x1693('0x10')],'get':function(){return moment(this[_0x1693('0x6')](_0x1693('0xe')))['format'](_0x1693('0x12'))['toString']();}},'createdAt':{'type':Sequelize[_0x1693('0x10')],'get':function(){return moment(this['getDataValue'](_0x1693('0x14')))[_0x1693('0x11')]('MM-DD-YYYY\x20HH:mm')['toString']();}},'updatedAt':{'type':Sequelize[_0x1693('0x10')],'get':function(){return moment(this['getDataValue']('updatedAt'))['format'](_0x1693('0x12'))['toString']();}}}; \ No newline at end of file diff --git a/server/api/screenRecording/screenRecording.controller.js b/server/api/screenRecording/screenRecording.controller.js index 418f754..aa1439a 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 _0xe5b3=['info','cancellazione\x20fisica\x20documento\x20%s','isNil','File:\x20\x22','\x22\x20trovato\x20eseguo\x20la\x20cancellazione','unlinkSync','.cypher','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','fs-extra','lodash','crypto','jsforce','desk.js','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','end','status','json','undefined','limit','count','offset','set','Content-Range','apply','reject','save','update','then','error','name','index','map','ScreenRecording','rawAttributes','type','key','model','differenceBy','format','keys','intersection','attributes','fields','query','length','nolimit','order','where','filters','filter','merge','options','include','findAll','rows','catch','show','create','body','duration','createdAt','closedAt','value','find','params','describe','download','uniqueid','join','%s.cypher','existsSync','root','server/files/screen_recordings','ValidationError','ScreenRecording\x20not\x20found','filename','unlink','send','Not\x20found','destroy','Entity\x20not\x20found'];(function(_0x1834e4,_0x29af18){var _0x24a0df=function(_0x59b1bb){while(--_0x59b1bb){_0x1834e4['push'](_0x1834e4['shift']());}};_0x24a0df(++_0x29af18);}(_0xe5b3,0x133));var _0x3e5b=function(_0x2ac255,_0x62dd05){_0x2ac255=_0x2ac255-0x0;var _0x8f79c=_0xe5b3[_0x2ac255];return _0x8f79c;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x3e5b('0x0'));var zipdir=require(_0x3e5b('0x1'));var jsonpatch=require(_0x3e5b('0x2'));var rp=require(_0x3e5b('0x3'));var moment=require(_0x3e5b('0x4'));var BPromise=require(_0x3e5b('0x5'));var Mustache=require(_0x3e5b('0x6'));var util=require(_0x3e5b('0x7'));var path=require(_0x3e5b('0x8'));var sox=require(_0x3e5b('0x9'));var csv=require(_0x3e5b('0xa'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x3e5b('0xb'));var _=require(_0x3e5b('0xc'));var squel=require('squel');var crypto=require(_0x3e5b('0xd'));var jsforce=require(_0x3e5b('0xe'));var deskjs=require(_0x3e5b('0xf'));var toCsv=require(_0x3e5b('0xa'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x3e5b('0x10'));var authService=require(_0x3e5b('0x11'));var qs=require(_0x3e5b('0x12'));var as=require(_0x3e5b('0x13'));var hardwareService=require(_0x3e5b('0x14'));var logger=require('../../config/logger')(_0x3e5b('0x15'));var utils=require('../../config/utils');var config=require(_0x3e5b('0x16'));var licenseUtil=require(_0x3e5b('0x17'));var db=require(_0x3e5b('0x18'))['db'];function respondWithStatusCode(_0x374068,_0x20b97b){_0x20b97b=_0x20b97b||0xcc;return function(_0x3c4eb1){if(_0x3c4eb1){return _0x374068[_0x3e5b('0x19')](_0x20b97b);}return _0x374068['status'](_0x20b97b)[_0x3e5b('0x1a')]();};}function respondWithResult(_0x5f2f9c,_0x51a188){_0x51a188=_0x51a188||0xc8;return function(_0x4d71a3){if(_0x4d71a3){return _0x5f2f9c[_0x3e5b('0x1b')](_0x51a188)[_0x3e5b('0x1c')](_0x4d71a3);}};}function respondWithFilteredResult(_0x17aaa3,_0x4fb471){return function(_0x1f81a7){if(_0x1f81a7){var _0x59ddc0=typeof _0x4fb471['offset']===_0x3e5b('0x1d')&&typeof _0x4fb471[_0x3e5b('0x1e')]==='undefined';var _0x3d58a4=_0x1f81a7[_0x3e5b('0x1f')];var _0x555002=_0x59ddc0?0x0:_0x4fb471[_0x3e5b('0x20')];var _0x3365dd=_0x59ddc0?_0x1f81a7['count']:_0x4fb471['offset']+_0x4fb471[_0x3e5b('0x1e')];var _0x20806a;if(_0x3365dd>=_0x3d58a4){_0x3365dd=_0x3d58a4;_0x20806a=0xc8;}else{_0x20806a=0xce;}_0x17aaa3[_0x3e5b('0x1b')](_0x20806a);return _0x17aaa3[_0x3e5b('0x21')](_0x3e5b('0x22'),_0x555002+'-'+_0x3365dd+'/'+_0x3d58a4)[_0x3e5b('0x1c')](_0x1f81a7);}return null;};}function patchUpdates(_0x447d36){return function(_0x21fc32){try{jsonpatch[_0x3e5b('0x23')](_0x21fc32,_0x447d36,!![]);}catch(_0x3d95f3){return BPromise[_0x3e5b('0x24')](_0x3d95f3);}return _0x21fc32[_0x3e5b('0x25')]();};}function saveUpdates(_0x2d77cc,_0x402873){return function(_0x5b46d4){if(_0x5b46d4){return _0x5b46d4[_0x3e5b('0x26')](_0x2d77cc)[_0x3e5b('0x27')](function(_0x2146d4){return _0x2146d4;});}return null;};}function removeEntity(_0x150674,_0x50039b){return function(_0x1eb80f){if(_0x1eb80f){return _0x1eb80f['destroy']()[_0x3e5b('0x27')](function(){_0x150674[_0x3e5b('0x1b')](0xcc)['end']();});}};}function handleEntityNotFound(_0x41b684,_0x2f6368){return function(_0x42d7e9){if(!_0x42d7e9){_0x41b684[_0x3e5b('0x19')](0x194);}return _0x42d7e9;};}function handleError(_0x3bb749,_0x26c7f2){_0x26c7f2=_0x26c7f2||0x1f4;return function(_0x160e87){logger[_0x3e5b('0x28')](_0x160e87['stack']);if(_0x160e87[_0x3e5b('0x29')]){delete _0x160e87['name'];}_0x3bb749[_0x3e5b('0x1b')](_0x26c7f2)['send'](_0x160e87);};}exports[_0x3e5b('0x2a')]=function(_0x1f6473,_0x1296ec){var _0x475b39={},_0x10d2ed={},_0x3cfaf6={'count':0x0,'rows':[]};var _0x307091=_[_0x3e5b('0x2b')](db[_0x3e5b('0x2c')][_0x3e5b('0x2d')],function(_0x1e1565){return{'name':_0x1e1565['fieldName'],'type':_0x1e1565[_0x3e5b('0x2e')][_0x3e5b('0x2f')]};});_0x10d2ed[_0x3e5b('0x30')]=_[_0x3e5b('0x31')](_[_0x3e5b('0x2b')](_0x307091,_0x3e5b('0x29')),[_0x3e5b('0x32')]);_0x10d2ed['query']=_[_0x3e5b('0x33')](_0x1f6473['query']);_0x10d2ed['filters']=_[_0x3e5b('0x34')](_0x10d2ed[_0x3e5b('0x30')],_0x10d2ed['query']);_0x475b39[_0x3e5b('0x35')]=_[_0x3e5b('0x34')](_0x10d2ed[_0x3e5b('0x30')],qs[_0x3e5b('0x36')](_0x1f6473[_0x3e5b('0x37')][_0x3e5b('0x36')]));_0x475b39[_0x3e5b('0x35')]=_0x475b39[_0x3e5b('0x35')][_0x3e5b('0x38')]?_0x475b39[_0x3e5b('0x35')]:_0x10d2ed[_0x3e5b('0x30')];if(!_0x1f6473[_0x3e5b('0x37')]['hasOwnProperty'](_0x3e5b('0x39'))){_0x475b39[_0x3e5b('0x1e')]=qs['limit'](_0x1f6473['query'][_0x3e5b('0x1e')]);_0x475b39['offset']=qs[_0x3e5b('0x20')](_0x1f6473[_0x3e5b('0x37')][_0x3e5b('0x20')]);}_0x475b39[_0x3e5b('0x3a')]=qs['sort'](_0x1f6473[_0x3e5b('0x37')]['sort']);_0x475b39[_0x3e5b('0x3b')]=qs['filters'](_['pick'](_0x1f6473['query'],_0x10d2ed[_0x3e5b('0x3c')]),_0x307091);if(_0x1f6473[_0x3e5b('0x37')][_0x3e5b('0x3d')]){_0x475b39[_0x3e5b('0x3b')]=_[_0x3e5b('0x3e')](_0x475b39[_0x3e5b('0x3b')],{'$or':_['map'](_0x307091,function(_0x5d0c59){if(_0x5d0c59['type']!=='VIRTUAL'){var _0x5f0271={};_0x5f0271[_0x5d0c59['name']]={'$like':'%'+_0x1f6473['query'][_0x3e5b('0x3d')]+'%'};return _0x5f0271;}})});}_0x475b39=_[_0x3e5b('0x3e')]({},_0x475b39,_0x1f6473[_0x3e5b('0x3f')]);var _0x1aafd5={'where':_0x475b39[_0x3e5b('0x3b')]};return db[_0x3e5b('0x2c')][_0x3e5b('0x1f')](_0x1aafd5)[_0x3e5b('0x27')](function(_0x222d0f){_0x3cfaf6[_0x3e5b('0x1f')]=_0x222d0f;if(_0x1f6473[_0x3e5b('0x37')]['includeAll']){_0x475b39[_0x3e5b('0x40')]=[{'all':!![]}];}return db[_0x3e5b('0x2c')][_0x3e5b('0x41')](_0x475b39);})[_0x3e5b('0x27')](function(_0xa262e0){_0x3cfaf6[_0x3e5b('0x42')]=_0xa262e0;return _0x3cfaf6;})[_0x3e5b('0x27')](respondWithFilteredResult(_0x1296ec,_0x475b39))[_0x3e5b('0x43')](handleError(_0x1296ec,null));};exports[_0x3e5b('0x44')]=function(_0x39da3f,_0x13c8d5){var _0x559056={'raw':![],'where':{'id':_0x39da3f['params']['id']}},_0x598ab4={};_0x598ab4['model']=_[_0x3e5b('0x33')](db[_0x3e5b('0x2c')][_0x3e5b('0x2d')]);_0x598ab4[_0x3e5b('0x37')]=_[_0x3e5b('0x33')](_0x39da3f[_0x3e5b('0x37')]);_0x598ab4[_0x3e5b('0x3c')]=_[_0x3e5b('0x34')](_0x598ab4[_0x3e5b('0x30')],_0x598ab4[_0x3e5b('0x37')]);_0x559056['attributes']=_[_0x3e5b('0x34')](_0x598ab4[_0x3e5b('0x30')],qs[_0x3e5b('0x36')](_0x39da3f[_0x3e5b('0x37')][_0x3e5b('0x36')]));_0x559056['attributes']=_0x559056['attributes']['length']?_0x559056[_0x3e5b('0x35')]:_0x598ab4[_0x3e5b('0x30')];if(_0x39da3f[_0x3e5b('0x37')]['includeAll']){_0x559056['include']=[{'all':!![]}];}_0x559056=_[_0x3e5b('0x3e')]({},_0x559056,_0x39da3f[_0x3e5b('0x3f')]);return db[_0x3e5b('0x2c')]['find'](_0x559056)['then'](handleEntityNotFound(_0x13c8d5,null))[_0x3e5b('0x27')](respondWithResult(_0x13c8d5,null))['catch'](handleError(_0x13c8d5,null));};exports[_0x3e5b('0x45')]=function(_0x3379a1,_0x3f5835){return db[_0x3e5b('0x2c')][_0x3e5b('0x45')](_0x3379a1[_0x3e5b('0x46')],{})[_0x3e5b('0x27')](respondWithResult(_0x3f5835,0xc9))[_0x3e5b('0x43')](handleError(_0x3f5835,null));};exports[_0x3e5b('0x26')]=function(_0x4a2ae1,_0x223185){if(_0x4a2ae1['body']['id']){delete _0x4a2ae1[_0x3e5b('0x46')]['id'];}delete _0x4a2ae1[_0x3e5b('0x46')][_0x3e5b('0x47')];delete _0x4a2ae1[_0x3e5b('0x46')][_0x3e5b('0x48')];delete _0x4a2ae1[_0x3e5b('0x46')][_0x3e5b('0x49')];delete _0x4a2ae1[_0x3e5b('0x46')][_0x3e5b('0x4a')];return db[_0x3e5b('0x2c')][_0x3e5b('0x4b')]({'where':{'id':_0x4a2ae1[_0x3e5b('0x4c')]['id']}})[_0x3e5b('0x27')](handleEntityNotFound(_0x223185,null))['then'](saveUpdates(_0x4a2ae1[_0x3e5b('0x46')],null))[_0x3e5b('0x27')](respondWithResult(_0x223185,null))[_0x3e5b('0x43')](handleError(_0x223185,null));};exports[_0x3e5b('0x4d')]=function(_0x16c9f9,_0x2cecd3){return db['ScreenRecording'][_0x3e5b('0x4d')]()[_0x3e5b('0x27')](respondWithResult(_0x2cecd3,null))[_0x3e5b('0x43')](handleError(_0x2cecd3,null));};exports[_0x3e5b('0x4e')]=function(_0x3f8646,_0x449d0f,_0x216600){var _0x437430=require('../../components/encryptor');var _0x1e6403=![];var _0x5e702f={};if(_0x3f8646['query'][_0x3e5b('0x2e')]&&_0x3f8646['query'][_0x3e5b('0x2e')]===_0x3e5b('0x4f')){_0x5e702f[_0x3e5b('0x4f')]=_0x3f8646[_0x3e5b('0x4c')]['id'];}else{_0x5e702f['id']=_0x3f8646['params']['id'];}return db['ScreenRecording']['find']({'where':_0x5e702f,'attributes':['id','value'],'raw':!![]})[_0x3e5b('0x27')](handleEntityNotFound(_0x449d0f,null))[_0x3e5b('0x27')](function(_0x1ea02a){if(_0x1ea02a){var _0x4149c8=path[_0x3e5b('0x50')](config['root'],'server/files/screen_recordings',_0x1ea02a[_0x3e5b('0x4a')]);var _0x1b0b32=util[_0x3e5b('0x32')](_0x3e5b('0x51'),_0x4149c8);if(fs[_0x3e5b('0x52')](_0x1b0b32)){_0x1e6403=!![];return _0x437430['decryptFile'](_0x1b0b32,_0x4149c8,config['secrets']['recording'])['then'](function(){return _0x1ea02a;});}return _0x1ea02a;}})[_0x3e5b('0x27')](function(_0x3e3115){if(_0x3e3115){var _0x3088d4=path[_0x3e5b('0x50')](config[_0x3e5b('0x53')],_0x3e5b('0x54'),_0x3e3115[_0x3e5b('0x4a')]);if(!fs[_0x3e5b('0x52')](_0x3088d4)){throw new db['Sequelize'][(_0x3e5b('0x55'))](_0x3e5b('0x56'));}if(_0x3e3115[_0x3e5b('0x57')]){return _0x449d0f[_0x3e5b('0x4e')](_0x3088d4,_0x3e3115[_0x3e5b('0x57')]+path['extname'](_0x3088d4),function(){if(_0x1e6403){fs[_0x3e5b('0x58')](_0x3088d4);}});}else{return _0x449d0f['download'](_0x3088d4,function(_0x45ca16){if(_0x1e6403){fs[_0x3e5b('0x58')](_0x3088d4);}});}}})['catch'](function(_0x4a7d8e){if(_0x4a7d8e['message']===_0x3e5b('0x56')){_0x449d0f['status'](0x194)[_0x3e5b('0x59')](_0x3e5b('0x5a'));}else{return handleError(_0x449d0f,null);}});};exports[_0x3e5b('0x5b')]=function(_0x40197c,_0x14f187){return db['ScreenRecording']['find']({'where':{'id':_0x40197c[_0x3e5b('0x4c')]['id']}})[_0x3e5b('0x27')](function(_0x3f7f71){if(_['isNil'](_0x3f7f71)){throw new ReferenceError(_0x3e5b('0x5c'));}return _0x3f7f71;})[_0x3e5b('0x27')](function(_0x32a42f){var _0x1c9526=path[_0x3e5b('0x50')](config[_0x3e5b('0x53')],_0x3e5b('0x54'),_0x32a42f[_0x3e5b('0x4a')]);logger[_0x3e5b('0x5d')](_0x3e5b('0x5e'),_0x1c9526);if(!_[_0x3e5b('0x5f')](_0x32a42f[_0x3e5b('0x4a')])&&fs[_0x3e5b('0x52')](_0x1c9526)){logger[_0x3e5b('0x5d')](_0x3e5b('0x60')+_0x1c9526+_0x3e5b('0x61'));fs[_0x3e5b('0x62')](_0x1c9526);}_0x1c9526=_0x1c9526+_0x3e5b('0x63');if(!_['isNil'](_0x32a42f[_0x3e5b('0x4a')])&&fs[_0x3e5b('0x52')](_0x1c9526)){logger['info'](_0x3e5b('0x60')+_0x1c9526+_0x3e5b('0x61'));fs['unlinkSync'](_0x1c9526);}return _0x32a42f;})['then'](function(_0x4f67d1){if(!_0x4f67d1)throw new InternalError();return _0x4f67d1[_0x3e5b('0x5b')]();})[_0x3e5b('0x27')](function(){_0x14f187['status'](0xcc)[_0x3e5b('0x1a')]();})[_0x3e5b('0x43')](handleError(_0x14f187,null));}; \ No newline at end of file +var _0xee14=['path','sox','ejs','lodash','squel','crypto','jsforce','desk.js','to-csv','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','destroy','then','error','stack','name','send','map','rawAttributes','fieldName','type','key','model','differenceBy','format','query','keys','filters','attributes','intersection','fields','length','hasOwnProperty','nolimit','order','sort','pick','filter','where','merge','VIRTUAL','options','ScreenRecording','includeAll','include','findAll','rows','catch','params','find','create','body','duration','describe','../../components/encryptor','uniqueid','value','server/files/screen_recordings','existsSync','decryptFile','secrets','recording','root','Sequelize','ValidationError','filename','download','unlink','ScreenRecording\x20not\x20found','isNil','Entity\x20not\x20found','join','info','cancellazione\x20fisica\x20documento\x20%s','File:\x20\x22','\x22\x20trovato\x20eseguo\x20la\x20cancellazione','unlinkSync','.cypher','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util'];(function(_0x54b52b,_0xb1e6e2){var _0x359603=function(_0x206418){while(--_0x206418){_0x54b52b['push'](_0x54b52b['shift']());}};_0x359603(++_0xb1e6e2);}(_0xee14,0x13a));var _0x4ee1=function(_0x21ecdf,_0x3e47c1){_0x21ecdf=_0x21ecdf-0x0;var _0x555d3a=_0xee14[_0x21ecdf];return _0x555d3a;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0x4ee1('0x0'));var jsonpatch=require(_0x4ee1('0x1'));var rp=require(_0x4ee1('0x2'));var moment=require(_0x4ee1('0x3'));var BPromise=require(_0x4ee1('0x4'));var Mustache=require(_0x4ee1('0x5'));var util=require(_0x4ee1('0x6'));var path=require(_0x4ee1('0x7'));var sox=require(_0x4ee1('0x8'));var csv=require('to-csv');var ejs=require(_0x4ee1('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x4ee1('0xa'));var squel=require(_0x4ee1('0xb'));var crypto=require(_0x4ee1('0xc'));var jsforce=require(_0x4ee1('0xd'));var deskjs=require(_0x4ee1('0xe'));var toCsv=require(_0x4ee1('0xf'));var querystring=require('querystring');var Papa=require(_0x4ee1('0x10'));var Redis=require(_0x4ee1('0x11'));var authService=require('../../components/auth/service');var qs=require(_0x4ee1('0x12'));var as=require(_0x4ee1('0x13'));var hardwareService=require(_0x4ee1('0x14'));var logger=require(_0x4ee1('0x15'))('api');var utils=require(_0x4ee1('0x16'));var config=require(_0x4ee1('0x17'));var licenseUtil=require(_0x4ee1('0x18'));var db=require(_0x4ee1('0x19'))['db'];function respondWithStatusCode(_0x2f864e,_0x174427){_0x174427=_0x174427||0xcc;return function(_0x5616d6){if(_0x5616d6){return _0x2f864e[_0x4ee1('0x1a')](_0x174427);}return _0x2f864e[_0x4ee1('0x1b')](_0x174427)[_0x4ee1('0x1c')]();};}function respondWithResult(_0x24a915,_0x46d2c2){_0x46d2c2=_0x46d2c2||0xc8;return function(_0x1c342a){if(_0x1c342a){return _0x24a915[_0x4ee1('0x1b')](_0x46d2c2)[_0x4ee1('0x1d')](_0x1c342a);}};}function respondWithFilteredResult(_0xb7eafd,_0x4e3490){return function(_0x2f9194){if(_0x2f9194){var _0x38008f=typeof _0x4e3490[_0x4ee1('0x1e')]===_0x4ee1('0x1f')&&typeof _0x4e3490[_0x4ee1('0x20')]===_0x4ee1('0x1f');var _0x2eff91=_0x2f9194[_0x4ee1('0x21')];var _0x360056=_0x38008f?0x0:_0x4e3490[_0x4ee1('0x1e')];var _0x274de5=_0x38008f?_0x2f9194['count']:_0x4e3490[_0x4ee1('0x1e')]+_0x4e3490[_0x4ee1('0x20')];var _0x173388;if(_0x274de5>=_0x2eff91){_0x274de5=_0x2eff91;_0x173388=0xc8;}else{_0x173388=0xce;}_0xb7eafd[_0x4ee1('0x1b')](_0x173388);return _0xb7eafd[_0x4ee1('0x22')](_0x4ee1('0x23'),_0x360056+'-'+_0x274de5+'/'+_0x2eff91)['json'](_0x2f9194);}return null;};}function patchUpdates(_0x8a631f){return function(_0x333e96){try{jsonpatch[_0x4ee1('0x24')](_0x333e96,_0x8a631f,!![]);}catch(_0x3f0d59){return BPromise[_0x4ee1('0x25')](_0x3f0d59);}return _0x333e96[_0x4ee1('0x26')]();};}function saveUpdates(_0x328f21,_0x40fd98){return function(_0x1dc1a8){if(_0x1dc1a8){return _0x1dc1a8[_0x4ee1('0x27')](_0x328f21)['then'](function(_0x53d43f){return _0x53d43f;});}return null;};}function removeEntity(_0x14110c,_0x459e2e){return function(_0xaf87e7){if(_0xaf87e7){return _0xaf87e7[_0x4ee1('0x28')]()[_0x4ee1('0x29')](function(){_0x14110c[_0x4ee1('0x1b')](0xcc)['end']();});}};}function handleEntityNotFound(_0x5cc0b5,_0x442c71){return function(_0x28b7e1){if(!_0x28b7e1){_0x5cc0b5['sendStatus'](0x194);}return _0x28b7e1;};}function handleError(_0x35900d,_0x213db8){_0x213db8=_0x213db8||0x1f4;return function(_0x36654c){logger[_0x4ee1('0x2a')](_0x36654c[_0x4ee1('0x2b')]);if(_0x36654c[_0x4ee1('0x2c')]){delete _0x36654c[_0x4ee1('0x2c')];}_0x35900d['status'](_0x213db8)[_0x4ee1('0x2d')](_0x36654c);};}exports['index']=function(_0x4746c2,_0x4ec408){var _0x3dc870={},_0x1d91be={},_0x59a34e={'count':0x0,'rows':[]};var _0x13944c=_[_0x4ee1('0x2e')](db['ScreenRecording'][_0x4ee1('0x2f')],function(_0x5b3792){return{'name':_0x5b3792[_0x4ee1('0x30')],'type':_0x5b3792[_0x4ee1('0x31')][_0x4ee1('0x32')]};});_0x1d91be[_0x4ee1('0x33')]=_[_0x4ee1('0x34')](_['map'](_0x13944c,_0x4ee1('0x2c')),[_0x4ee1('0x35')]);_0x1d91be[_0x4ee1('0x36')]=_[_0x4ee1('0x37')](_0x4746c2[_0x4ee1('0x36')]);_0x1d91be[_0x4ee1('0x38')]=_['intersection'](_0x1d91be['model'],_0x1d91be[_0x4ee1('0x36')]);_0x3dc870[_0x4ee1('0x39')]=_[_0x4ee1('0x3a')](_0x1d91be['model'],qs[_0x4ee1('0x3b')](_0x4746c2[_0x4ee1('0x36')][_0x4ee1('0x3b')]));_0x3dc870[_0x4ee1('0x39')]=_0x3dc870[_0x4ee1('0x39')][_0x4ee1('0x3c')]?_0x3dc870[_0x4ee1('0x39')]:_0x1d91be[_0x4ee1('0x33')];if(!_0x4746c2[_0x4ee1('0x36')][_0x4ee1('0x3d')](_0x4ee1('0x3e'))){_0x3dc870[_0x4ee1('0x20')]=qs[_0x4ee1('0x20')](_0x4746c2['query'][_0x4ee1('0x20')]);_0x3dc870[_0x4ee1('0x1e')]=qs[_0x4ee1('0x1e')](_0x4746c2['query']['offset']);}_0x3dc870[_0x4ee1('0x3f')]=qs[_0x4ee1('0x40')](_0x4746c2[_0x4ee1('0x36')][_0x4ee1('0x40')]);_0x3dc870['where']=qs[_0x4ee1('0x38')](_[_0x4ee1('0x41')](_0x4746c2[_0x4ee1('0x36')],_0x1d91be[_0x4ee1('0x38')]),_0x13944c);if(_0x4746c2[_0x4ee1('0x36')][_0x4ee1('0x42')]){_0x3dc870[_0x4ee1('0x43')]=_[_0x4ee1('0x44')](_0x3dc870['where'],{'$or':_[_0x4ee1('0x2e')](_0x13944c,function(_0x1116b4){if(_0x1116b4[_0x4ee1('0x31')]!==_0x4ee1('0x45')){var _0x45bb22={};_0x45bb22[_0x1116b4[_0x4ee1('0x2c')]]={'$like':'%'+_0x4746c2['query'][_0x4ee1('0x42')]+'%'};return _0x45bb22;}})});}_0x3dc870=_[_0x4ee1('0x44')]({},_0x3dc870,_0x4746c2[_0x4ee1('0x46')]);var _0x333690={'where':_0x3dc870[_0x4ee1('0x43')]};return db[_0x4ee1('0x47')][_0x4ee1('0x21')](_0x333690)[_0x4ee1('0x29')](function(_0x23bb5f){_0x59a34e[_0x4ee1('0x21')]=_0x23bb5f;if(_0x4746c2[_0x4ee1('0x36')][_0x4ee1('0x48')]){_0x3dc870[_0x4ee1('0x49')]=[{'all':!![]}];}return db['ScreenRecording'][_0x4ee1('0x4a')](_0x3dc870);})[_0x4ee1('0x29')](function(_0x5ee7b4){_0x59a34e[_0x4ee1('0x4b')]=_0x5ee7b4;return _0x59a34e;})['then'](respondWithFilteredResult(_0x4ec408,_0x3dc870))[_0x4ee1('0x4c')](handleError(_0x4ec408,null));};exports['show']=function(_0x14c333,_0xc7580c){var _0x557126={'raw':![],'where':{'id':_0x14c333[_0x4ee1('0x4d')]['id']}},_0x25d683={};_0x25d683[_0x4ee1('0x33')]=_[_0x4ee1('0x37')](db['ScreenRecording'][_0x4ee1('0x2f')]);_0x25d683[_0x4ee1('0x36')]=_[_0x4ee1('0x37')](_0x14c333['query']);_0x25d683['filters']=_[_0x4ee1('0x3a')](_0x25d683[_0x4ee1('0x33')],_0x25d683[_0x4ee1('0x36')]);_0x557126[_0x4ee1('0x39')]=_[_0x4ee1('0x3a')](_0x25d683['model'],qs['fields'](_0x14c333[_0x4ee1('0x36')][_0x4ee1('0x3b')]));_0x557126[_0x4ee1('0x39')]=_0x557126[_0x4ee1('0x39')]['length']?_0x557126[_0x4ee1('0x39')]:_0x25d683[_0x4ee1('0x33')];if(_0x14c333['query'][_0x4ee1('0x48')]){_0x557126[_0x4ee1('0x49')]=[{'all':!![]}];}_0x557126=_[_0x4ee1('0x44')]({},_0x557126,_0x14c333[_0x4ee1('0x46')]);return db[_0x4ee1('0x47')][_0x4ee1('0x4e')](_0x557126)[_0x4ee1('0x29')](handleEntityNotFound(_0xc7580c,null))[_0x4ee1('0x29')](respondWithResult(_0xc7580c,null))[_0x4ee1('0x4c')](handleError(_0xc7580c,null));};exports['create']=function(_0x49b667,_0x1a972b){return db[_0x4ee1('0x47')][_0x4ee1('0x4f')](_0x49b667[_0x4ee1('0x50')],{})['then'](respondWithResult(_0x1a972b,0xc9))[_0x4ee1('0x4c')](handleError(_0x1a972b,null));};exports[_0x4ee1('0x27')]=function(_0x42dd8d,_0x2bc77f){if(_0x42dd8d[_0x4ee1('0x50')]['id']){delete _0x42dd8d['body']['id'];}delete _0x42dd8d[_0x4ee1('0x50')][_0x4ee1('0x51')];delete _0x42dd8d[_0x4ee1('0x50')]['createdAt'];delete _0x42dd8d[_0x4ee1('0x50')]['closedAt'];delete _0x42dd8d[_0x4ee1('0x50')]['value'];return db[_0x4ee1('0x47')]['find']({'where':{'id':_0x42dd8d[_0x4ee1('0x4d')]['id']}})['then'](handleEntityNotFound(_0x2bc77f,null))[_0x4ee1('0x29')](saveUpdates(_0x42dd8d[_0x4ee1('0x50')],null))[_0x4ee1('0x29')](respondWithResult(_0x2bc77f,null))['catch'](handleError(_0x2bc77f,null));};exports[_0x4ee1('0x52')]=function(_0x4118d7,_0xcdb873){return db[_0x4ee1('0x47')][_0x4ee1('0x52')]()[_0x4ee1('0x29')](respondWithResult(_0xcdb873,null))[_0x4ee1('0x4c')](handleError(_0xcdb873,null));};exports['download']=function(_0x4c4178,_0x1feb78,_0xcddc5d){var _0xf58cd8=require(_0x4ee1('0x53'));var _0x44e65f=![];var _0x31e82d={};if(_0x4c4178[_0x4ee1('0x36')][_0x4ee1('0x31')]&&_0x4c4178[_0x4ee1('0x36')][_0x4ee1('0x31')]===_0x4ee1('0x54')){_0x31e82d[_0x4ee1('0x54')]=_0x4c4178[_0x4ee1('0x4d')]['id'];}else{_0x31e82d['id']=_0x4c4178['params']['id'];}return db[_0x4ee1('0x47')]['find']({'where':_0x31e82d,'attributes':['id',_0x4ee1('0x55')],'raw':!![]})[_0x4ee1('0x29')](handleEntityNotFound(_0x1feb78,null))['then'](function(_0x1e0aac){if(_0x1e0aac){var _0x184e36=path['join'](config['root'],_0x4ee1('0x56'),_0x1e0aac['value']);var _0x1ce99e=util[_0x4ee1('0x35')]('%s.cypher',_0x184e36);if(fs[_0x4ee1('0x57')](_0x1ce99e)){_0x44e65f=!![];return _0xf58cd8[_0x4ee1('0x58')](_0x1ce99e,_0x184e36,config[_0x4ee1('0x59')][_0x4ee1('0x5a')])[_0x4ee1('0x29')](function(){return _0x1e0aac;});}return _0x1e0aac;}})[_0x4ee1('0x29')](function(_0x11f619){if(_0x11f619){var _0x5f5694=path['join'](config[_0x4ee1('0x5b')],_0x4ee1('0x56'),_0x11f619['value']);if(!fs[_0x4ee1('0x57')](_0x5f5694)){throw new db[(_0x4ee1('0x5c'))][(_0x4ee1('0x5d'))]('ScreenRecording\x20not\x20found');}if(_0x11f619[_0x4ee1('0x5e')]){return _0x1feb78['download'](_0x5f5694,_0x11f619[_0x4ee1('0x5e')]+path['extname'](_0x5f5694),function(){if(_0x44e65f){fs['unlink'](_0x5f5694);}});}else{return _0x1feb78[_0x4ee1('0x5f')](_0x5f5694,function(_0x16fcd0){if(_0x44e65f){fs[_0x4ee1('0x60')](_0x5f5694);}});}}})[_0x4ee1('0x4c')](function(_0x38e889){if(_0x38e889['message']===_0x4ee1('0x61')){_0x1feb78[_0x4ee1('0x1b')](0x194)[_0x4ee1('0x2d')]('Not\x20found');}else{return handleError(_0x1feb78,null);}});};exports[_0x4ee1('0x28')]=function(_0x109dc6,_0x3fdd61){return db[_0x4ee1('0x47')][_0x4ee1('0x4e')]({'where':{'id':_0x109dc6[_0x4ee1('0x4d')]['id']}})[_0x4ee1('0x29')](function(_0x20ca0b){if(_[_0x4ee1('0x62')](_0x20ca0b)){throw new ReferenceError(_0x4ee1('0x63'));}return _0x20ca0b;})[_0x4ee1('0x29')](function(_0x38e86f){var _0x5d396c=path[_0x4ee1('0x64')](config['root'],_0x4ee1('0x56'),_0x38e86f['value']);logger[_0x4ee1('0x65')](_0x4ee1('0x66'),_0x5d396c);if(!_[_0x4ee1('0x62')](_0x38e86f[_0x4ee1('0x55')])&&fs[_0x4ee1('0x57')](_0x5d396c)){logger[_0x4ee1('0x65')](_0x4ee1('0x67')+_0x5d396c+_0x4ee1('0x68'));fs[_0x4ee1('0x69')](_0x5d396c);}_0x5d396c=_0x5d396c+_0x4ee1('0x6a');if(!_[_0x4ee1('0x62')](_0x38e86f[_0x4ee1('0x55')])&&fs['existsSync'](_0x5d396c)){logger[_0x4ee1('0x65')](_0x4ee1('0x67')+_0x5d396c+_0x4ee1('0x68'));fs['unlinkSync'](_0x5d396c);}return _0x38e86f;})['then'](function(_0x40dac3){if(!_0x40dac3)throw new InternalError();return _0x40dac3[_0x4ee1('0x28')]();})['then'](function(){_0x3fdd61[_0x4ee1('0x1b')](0xcc)[_0x4ee1('0x1c')]();})[_0x4ee1('0x4c')](handleError(_0x3fdd61,null));}; \ No newline at end of file diff --git a/server/api/screenRecording/screenRecording.model.js b/server/api/screenRecording/screenRecording.model.js index ef3892f..4aae8ad 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 _0x9ea5=['api','moment','bluebird','request-promise','../../config/environment','./screenRecording.attributes','exports','screen_recordings','interactionid','lodash','../../config/logger'];(function(_0x5df0a2,_0xdb8989){var _0x236e84=function(_0x335887){while(--_0x335887){_0x5df0a2['push'](_0x5df0a2['shift']());}};_0x236e84(++_0xdb8989);}(_0x9ea5,0x82));var _0x59ea=function(_0x2a51c7,_0x1665de){_0x2a51c7=_0x2a51c7-0x0;var _0x4c2aa9=_0x9ea5[_0x2a51c7];return _0x4c2aa9;};'use strict';var _=require(_0x59ea('0x0'));var util=require('util');var logger=require(_0x59ea('0x1'))(_0x59ea('0x2'));var moment=require(_0x59ea('0x3'));var BPromise=require(_0x59ea('0x4'));var rp=require(_0x59ea('0x5'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0x59ea('0x6'));var attributes=require(_0x59ea('0x7'));module[_0x59ea('0x8')]=function(_0x2c8bcd,_0x2abc27){return _0x2c8bcd['define']('ScreenRecording',attributes,{'tableName':_0x59ea('0x9'),'paranoid':![],'indexes':[{'name':'interactionid','fields':[_0x59ea('0xa')]}],'timestamps':!![]});}; \ No newline at end of file +var _0x2023=['define','ScreenRecording','interactionid','lodash','api','moment','bluebird','request-promise','path','../../config/environment','./screenRecording.attributes','exports'];(function(_0x1c546c,_0x5c57cb){var _0x2cc384=function(_0x4dee11){while(--_0x4dee11){_0x1c546c['push'](_0x1c546c['shift']());}};_0x2cc384(++_0x5c57cb);}(_0x2023,0x1d7));var _0x3202=function(_0x7872fa,_0x2f588d){_0x7872fa=_0x7872fa-0x0;var _0xf2b96f=_0x2023[_0x7872fa];return _0xf2b96f;};'use strict';var _=require(_0x3202('0x0'));var util=require('util');var logger=require('../../config/logger')(_0x3202('0x1'));var moment=require(_0x3202('0x2'));var BPromise=require(_0x3202('0x3'));var rp=require(_0x3202('0x4'));var fs=require('fs');var path=require(_0x3202('0x5'));var rimraf=require('rimraf');var config=require(_0x3202('0x6'));var attributes=require(_0x3202('0x7'));module[_0x3202('0x8')]=function(_0x3bc118,_0x3a2bba){return _0x3bc118[_0x3202('0x9')](_0x3202('0xa'),attributes,{'tableName':'screen_recordings','paranoid':![],'indexes':[{'name':'interactionid','fields':[_0x3202('0xb')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/screenRecording/screenRecording.rpc.js b/server/api/screenRecording/screenRecording.rpc.js index 7198500..714dd1e 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 _0xb5af=['client','then','info','ScreenRecording,\x20%s,\x20%s','request\x20sent','debug','ScreenRecording,\x20%s,\x20%s,\x20%s','error','code','message','result','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise'];(function(_0x1ff1f6,_0x5baec3){var _0x62f7ba=function(_0x2d2f16){while(--_0x2d2f16){_0x1ff1f6['push'](_0x1ff1f6['shift']());}};_0x62f7ba(++_0x5baec3);}(_0xb5af,0x129));var _0xfb5a=function(_0x5eeb09,_0x17e4c8){_0x5eeb09=_0x5eeb09-0x0;var _0x2bf7ec=_0xb5af[_0x5eeb09];return _0x2bf7ec;};'use strict';var _=require('lodash');var util=require(_0xfb5a('0x0'));var moment=require(_0xfb5a('0x1'));var BPromise=require(_0xfb5a('0x2'));var rs=require(_0xfb5a('0x3'));var fs=require('fs');var Redis=require(_0xfb5a('0x4'));var db=require(_0xfb5a('0x5'))['db'];var utils=require(_0xfb5a('0x6'));var logger=require(_0xfb5a('0x7'))(_0xfb5a('0x8'));var config=require(_0xfb5a('0x9'));var jayson=require(_0xfb5a('0xa'));var client=jayson[_0xfb5a('0xb')]['http']({'port':0x232a});function respondWithRpcPromise(_0x1f67c6,_0x145756,_0xef785d){return new BPromise(function(_0x9eec3b,_0x5182cd){return client['request'](_0x1f67c6,_0xef785d)[_0xfb5a('0xc')](function(_0x3f7856){logger[_0xfb5a('0xd')](_0xfb5a('0xe'),_0x145756,_0xfb5a('0xf'));logger[_0xfb5a('0x10')](_0xfb5a('0x11'),_0x145756,_0xfb5a('0xf'),JSON['stringify'](_0x3f7856));if(_0x3f7856[_0xfb5a('0x12')]){if(_0x3f7856['error'][_0xfb5a('0x13')]===0x1f4){logger[_0xfb5a('0x12')](_0xfb5a('0xe'),_0x145756,_0x3f7856[_0xfb5a('0x12')][_0xfb5a('0x14')]);return _0x5182cd(_0x3f7856[_0xfb5a('0x12')][_0xfb5a('0x14')]);}logger[_0xfb5a('0x12')]('ScreenRecording,\x20%s,\x20%s',_0x145756,_0x3f7856[_0xfb5a('0x12')][_0xfb5a('0x14')]);return _0x9eec3b(_0x3f7856[_0xfb5a('0x12')][_0xfb5a('0x14')]);}else{logger[_0xfb5a('0xd')](_0xfb5a('0xe'),_0x145756,'request\x20sent');_0x9eec3b(_0x3f7856[_0xfb5a('0x15')][_0xfb5a('0x14')]);}})['catch'](function(_0x3e563e){logger[_0xfb5a('0x12')]('ScreenRecording,\x20%s,\x20%s',_0x145756,_0x3e563e);_0x5182cd(_0x3e563e);});});} \ No newline at end of file +var _0x1165=['rpc','../../config/environment','jayson/promise','info','ScreenRecording,\x20%s,\x20%s','debug','ScreenRecording,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger'];(function(_0x264a58,_0x31d451){var _0x137f2a=function(_0x15bfc5){while(--_0x15bfc5){_0x264a58['push'](_0x264a58['shift']());}};_0x137f2a(++_0x31d451);}(_0x1165,0x195));var _0x5116=function(_0x3ce2ff,_0x4433f7){_0x3ce2ff=_0x3ce2ff-0x0;var _0x50384c=_0x1165[_0x3ce2ff];return _0x50384c;};'use strict';var _=require(_0x5116('0x0'));var util=require(_0x5116('0x1'));var moment=require(_0x5116('0x2'));var BPromise=require(_0x5116('0x3'));var rs=require(_0x5116('0x4'));var fs=require('fs');var Redis=require(_0x5116('0x5'));var db=require(_0x5116('0x6'))['db'];var utils=require(_0x5116('0x7'));var logger=require(_0x5116('0x8'))(_0x5116('0x9'));var config=require(_0x5116('0xa'));var jayson=require(_0x5116('0xb'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x299952,_0x133c22,_0x850b02){return new BPromise(function(_0xf1ed1a,_0x26cce6){return client['request'](_0x299952,_0x850b02)['then'](function(_0x762ebc){logger[_0x5116('0xc')](_0x5116('0xd'),_0x133c22,'request\x20sent');logger[_0x5116('0xe')](_0x5116('0xf'),_0x133c22,_0x5116('0x10'),JSON[_0x5116('0x11')](_0x762ebc));if(_0x762ebc[_0x5116('0x12')]){if(_0x762ebc[_0x5116('0x12')][_0x5116('0x13')]===0x1f4){logger[_0x5116('0x12')](_0x5116('0xd'),_0x133c22,_0x762ebc['error'][_0x5116('0x14')]);return _0x26cce6(_0x762ebc[_0x5116('0x12')][_0x5116('0x14')]);}logger[_0x5116('0x12')](_0x5116('0xd'),_0x133c22,_0x762ebc[_0x5116('0x12')][_0x5116('0x14')]);return _0xf1ed1a(_0x762ebc['error'][_0x5116('0x14')]);}else{logger[_0x5116('0xc')]('ScreenRecording,\x20%s,\x20%s',_0x133c22,_0x5116('0x10'));_0xf1ed1a(_0x762ebc[_0x5116('0x15')][_0x5116('0x14')]);}})[_0x5116('0x16')](function(_0x4d3312){logger['error'](_0x5116('0xd'),_0x133c22,_0x4d3312);_0x26cce6(_0x4d3312);});});} \ No newline at end of file diff --git a/server/api/setting/index.js b/server/api/setting/index.js index d50e4cd..95406a9 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 _0x5557=['update','exports','multer','path','express','Router','../../components/auth/service','../../config/environment','./setting.controller','get','isAuthenticated','index','/now','getDate','/:id','show','/:id/logo','/:id/logo_login','getLogoLogin','gdpr','getPreferred','getFavicon','diskStorage','join','root','server/files/images/logos/','format','%s%s','post','single','file','addLogo','logologin','originalname','addLogoLogin','preferred','extname','favicon','addFavicon','put'];(function(_0x3f7681,_0x47022e){var _0x51feae=function(_0x9586d6){while(--_0x9586d6){_0x3f7681['push'](_0x3f7681['shift']());}};_0x51feae(++_0x47022e);}(_0x5557,0x1ba));var _0x7555=function(_0x414e73,_0x57569f){_0x414e73=_0x414e73-0x0;var _0x5c3cba=_0x5557[_0x414e73];return _0x5c3cba;};'use strict';var multer=require(_0x7555('0x0'));var util=require('util');var path=require(_0x7555('0x1'));var timeout=require('connect-timeout');var express=require(_0x7555('0x2'));var router=express[_0x7555('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x7555('0x4'));var interaction=require('../../components/interaction/service');var config=require(_0x7555('0x5'));var controller=require(_0x7555('0x6'));router[_0x7555('0x7')]('/',auth[_0x7555('0x8')](),controller[_0x7555('0x9')]);router[_0x7555('0x7')](_0x7555('0xa'),controller[_0x7555('0xb')]);router[_0x7555('0x7')](_0x7555('0xc'),controller[_0x7555('0xd')]);router[_0x7555('0x7')](_0x7555('0xe'),controller['getLogo']);router[_0x7555('0x7')](_0x7555('0xf'),controller[_0x7555('0x10')]);router['get']('/:id/gdpr',controller[_0x7555('0x11')]);router['get']('/:id/preferred',controller[_0x7555('0x12')]);router[_0x7555('0x7')]('/:id/favicon',controller[_0x7555('0x13')]);var upload=multer({'storage':multer[_0x7555('0x14')]({'destination':function(_0x5a395c,_0x369e60,_0x2a6e3d){_0x2a6e3d(null,path[_0x7555('0x15')](config[_0x7555('0x16')],_0x7555('0x17')));},'filename':function(_0x128621,_0x572a7c,_0xd91fdc){_0xd91fdc(null,util[_0x7555('0x18')](_0x7555('0x19'),'logo',path['extname'](_0x572a7c['originalname'])));}})});router[_0x7555('0x1a')]('/:id/logo',upload[_0x7555('0x1b')](_0x7555('0x1c')),controller[_0x7555('0x1d')]);var upload=multer({'storage':multer[_0x7555('0x14')]({'destination':function(_0x4a6fb2,_0x20160e,_0x295a9f){_0x295a9f(null,path[_0x7555('0x15')](config[_0x7555('0x16')],'server/files/images/logos/'));},'filename':function(_0x59d32a,_0xa6b572,_0x46a5b2){_0x46a5b2(null,util['format'](_0x7555('0x19'),_0x7555('0x1e'),path['extname'](_0xa6b572[_0x7555('0x1f')])));}})});router['post']('/:id/logo_login',upload[_0x7555('0x1b')](_0x7555('0x1c')),controller[_0x7555('0x20')]);var upload=multer({'storage':multer[_0x7555('0x14')]({'destination':function(_0x531c67,_0x7fb1b5,_0x44dadf){_0x44dadf(null,path[_0x7555('0x15')](config[_0x7555('0x16')],_0x7555('0x17')));},'filename':function(_0x4d9517,_0x458a88,_0x439361){_0x439361(null,util[_0x7555('0x18')]('%s%s',_0x7555('0x21'),path[_0x7555('0x22')](_0x458a88[_0x7555('0x1f')])));}})});router[_0x7555('0x1a')]('/:id/preferred',upload[_0x7555('0x1b')]('file'),controller['addPreferred']);var upload=multer({'storage':multer[_0x7555('0x14')]({'destination':function(_0xcfbf24,_0x1330cc,_0x212da6){_0x212da6(null,path[_0x7555('0x15')](config[_0x7555('0x16')],_0x7555('0x17')));},'filename':function(_0x26d5d6,_0x241edf,_0x1b69f8){_0x1b69f8(null,util[_0x7555('0x18')](_0x7555('0x19'),_0x7555('0x23'),path['extname'](_0x241edf[_0x7555('0x1f')])));}})});router[_0x7555('0x1a')]('/:id/favicon',upload[_0x7555('0x1b')](_0x7555('0x1c')),controller[_0x7555('0x24')]);router[_0x7555('0x25')]('/:id',auth[_0x7555('0x8')](),controller[_0x7555('0x26')]);module[_0x7555('0x27')]=router; \ No newline at end of file +var _0x5f74=['%s%s','logo','extname','originalname','post','single','file','addLogo','server/files/images/logos/','format','logologin','addLogoLogin','join','addPreferred','favicon','update','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../config/environment','get','/now','getDate','/:id','show','/:id/logo','getLogo','/:id/logo_login','getLogoLogin','/:id/gdpr','gdpr','/:id/preferred','getPreferred','/:id/favicon','getFavicon','diskStorage','root'];(function(_0x424c8a,_0x3a8285){var _0x299826=function(_0x101c75){while(--_0x101c75){_0x424c8a['push'](_0x424c8a['shift']());}};_0x299826(++_0x3a8285);}(_0x5f74,0x169));var _0x45f7=function(_0x42172b,_0x1b04dd){_0x42172b=_0x42172b-0x0;var _0x1297f7=_0x5f74[_0x42172b];return _0x1297f7;};'use strict';var multer=require(_0x45f7('0x0'));var util=require(_0x45f7('0x1'));var path=require(_0x45f7('0x2'));var timeout=require(_0x45f7('0x3'));var express=require(_0x45f7('0x4'));var router=express[_0x45f7('0x5')]();var fs_extra=require(_0x45f7('0x6'));var auth=require(_0x45f7('0x7'));var interaction=require('../../components/interaction/service');var config=require(_0x45f7('0x8'));var controller=require('./setting.controller');router[_0x45f7('0x9')]('/',auth['isAuthenticated'](),controller['index']);router[_0x45f7('0x9')](_0x45f7('0xa'),controller[_0x45f7('0xb')]);router[_0x45f7('0x9')](_0x45f7('0xc'),controller[_0x45f7('0xd')]);router[_0x45f7('0x9')](_0x45f7('0xe'),controller[_0x45f7('0xf')]);router[_0x45f7('0x9')](_0x45f7('0x10'),controller[_0x45f7('0x11')]);router[_0x45f7('0x9')](_0x45f7('0x12'),controller[_0x45f7('0x13')]);router[_0x45f7('0x9')](_0x45f7('0x14'),controller[_0x45f7('0x15')]);router[_0x45f7('0x9')](_0x45f7('0x16'),controller[_0x45f7('0x17')]);var upload=multer({'storage':multer[_0x45f7('0x18')]({'destination':function(_0x289a22,_0x259aca,_0x43725d){_0x43725d(null,path['join'](config[_0x45f7('0x19')],'server/files/images/logos/'));},'filename':function(_0x397ea6,_0x4033f3,_0x46285d){_0x46285d(null,util['format'](_0x45f7('0x1a'),_0x45f7('0x1b'),path[_0x45f7('0x1c')](_0x4033f3[_0x45f7('0x1d')])));}})});router[_0x45f7('0x1e')](_0x45f7('0xe'),upload[_0x45f7('0x1f')](_0x45f7('0x20')),controller[_0x45f7('0x21')]);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0x101ffa,_0x240a96,_0x5f230a){_0x5f230a(null,path['join'](config[_0x45f7('0x19')],_0x45f7('0x22')));},'filename':function(_0x5a5571,_0x414ee6,_0x4e9080){_0x4e9080(null,util[_0x45f7('0x23')](_0x45f7('0x1a'),_0x45f7('0x24'),path['extname'](_0x414ee6[_0x45f7('0x1d')])));}})});router[_0x45f7('0x1e')](_0x45f7('0x10'),upload['single']('file'),controller[_0x45f7('0x25')]);var upload=multer({'storage':multer[_0x45f7('0x18')]({'destination':function(_0x41ad65,_0x3674f4,_0x29d431){_0x29d431(null,path[_0x45f7('0x26')](config[_0x45f7('0x19')],_0x45f7('0x22')));},'filename':function(_0x34d45d,_0x517db6,_0x6dd856){_0x6dd856(null,util[_0x45f7('0x23')](_0x45f7('0x1a'),'preferred',path[_0x45f7('0x1c')](_0x517db6[_0x45f7('0x1d')])));}})});router[_0x45f7('0x1e')](_0x45f7('0x14'),upload[_0x45f7('0x1f')]('file'),controller[_0x45f7('0x27')]);var upload=multer({'storage':multer[_0x45f7('0x18')]({'destination':function(_0x10df58,_0x451b6f,_0x43f91e){_0x43f91e(null,path[_0x45f7('0x26')](config['root'],'server/files/images/logos/'));},'filename':function(_0x3b6828,_0x5e99c3,_0x10ff96){_0x10ff96(null,util['format'](_0x45f7('0x1a'),_0x45f7('0x28'),path[_0x45f7('0x1c')](_0x5e99c3[_0x45f7('0x1d')])));}})});router['post'](_0x45f7('0x16'),upload[_0x45f7('0x1f')]('file'),controller['addFavicon']);router['put'](_0x45f7('0xc'),auth['isAuthenticated'](),controller[_0x45f7('0x29')]);module[_0x45f7('0x2a')]=router; \ No newline at end of file diff --git a/server/api/setting/setting.attributes.js b/server/api/setting/setting.attributes.js index 6f3c43b..bc67820 100644 --- a/server/api/setting/setting.attributes.js +++ b/server/api/setting/setting.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xa9e0=['BOOLEAN','alternate','UNSIGNED','sequelize','exports','INTEGER','min_mailbox','STRING','/var/opt/motion2/server/files/sounds/converted'];(function(_0x30c0ab,_0x5e60df){var _0x7d821=function(_0x367c1d){while(--_0x367c1d){_0x30c0ab['push'](_0x30c0ab['shift']());}};_0x7d821(++_0x5e60df);}(_0xa9e0,0x123));var _0x0a9e=function(_0xa1e3e3,_0x29fe0e){_0xa1e3e3=_0xa1e3e3-0x0;var _0xc980e9=_0xa9e0[_0xa1e3e3];return _0xc980e9;};'use strict';var Sequelize=require(_0x0a9e('0x0'));module[_0x0a9e('0x1')]={'min_internal':{'type':Sequelize[_0x0a9e('0x2')](0xb),'unique':'min_internal','defaultValue':0x3e8},'min_mailbox':{'type':Sequelize['INTEGER'](0xb),'unique':_0x0a9e('0x3'),'defaultValue':0x3e8},'agi_port':{'type':Sequelize['INTEGER'](0xb),'defaultValue':0x11dd},'soundPath':{'type':Sequelize[_0x0a9e('0x4')],'defaultValue':_0x0a9e('0x5')},'logo':{'type':Sequelize[_0x0a9e('0x4')]},'defaultLogo':{'type':Sequelize[_0x0a9e('0x6')],'defaultValue':!![]},'loginLogo':{'type':Sequelize[_0x0a9e('0x4')]},'defaultLoginLogo':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'headerWhiteLabel':{'type':Sequelize[_0x0a9e('0x4')]},'defaultHeaderWhiteLabel':{'type':Sequelize[_0x0a9e('0x6')],'defaultValue':!![]},'securePassword':{'type':Sequelize[_0x0a9e('0x6')],'defaultValue':!![]},'firstSetup':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'stunaddr':{'type':Sequelize['STRING']},'turnaddr':{'type':Sequelize[_0x0a9e('0x4')]},'turnusername':{'type':Sequelize['STRING']},'turnpassword':{'type':Sequelize['STRING']},'pageTitle':{'type':Sequelize[_0x0a9e('0x4')]},'defaultPageTitle':{'type':Sequelize[_0x0a9e('0x6')],'defaultValue':!![]},'callRecordingEncryption':{'type':Sequelize[_0x0a9e('0x6')],'defaultValue':![]},'passwordExpiresDays':{'type':Sequelize[_0x0a9e('0x2')](0xb),'defaultValue':0x5a},'phoneBarAutoUpdater':{'type':Sequelize[_0x0a9e('0x6')],'defaultValue':!![]},'phoneBarAutoUpdaterUrl':{'type':Sequelize[_0x0a9e('0x4')],'defaultValue':'https://www.xcally.com/bar/phonebar/autoupdater.xml'},'enableEmailPreview':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'split':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'splitSizeCsv':{'type':Sequelize['INTEGER'],'defaultValue':0x1388},'splitSizePdf':{'type':Sequelize[_0x0a9e('0x2')],'defaultValue':0x1388},'splitSizeXlsx':{'type':Sequelize[_0x0a9e('0x2')],'defaultValue':0x1388},'messagesAlignment':{'type':Sequelize[_0x0a9e('0x4')],'defaultValue':_0x0a9e('0x7')},'chatTimeout':{'type':Sequelize[_0x0a9e('0x2')],'defaultValue':0x1e},'phoneBarRememberMeEnabled':{'type':Sequelize[_0x0a9e('0x6')],'defaultValue':!![]},'preferred':{'type':Sequelize['STRING']},'defaultPreferred':{'type':Sequelize[_0x0a9e('0x6')],'defaultValue':!![]},'rtlSupport':{'type':Sequelize[_0x0a9e('0x6')],'defaultValue':![]},'defaultScreenRecordingPath':{'type':Sequelize[_0x0a9e('0x4')]},'allowedLoginAttempts':{'type':Sequelize[_0x0a9e('0x2')],'defaultValue':0x5},'blockDuration':{'type':Sequelize[_0x0a9e('0x2')],'defaultValue':0xa},'favicon':{'type':Sequelize[_0x0a9e('0x4')]},'defaultFavicon':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'loginMailFrequency':{'type':Sequelize[_0x0a9e('0x2')],'defaultValue':0xa,'validate':{'min':0xa}},'transcribe':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'automaticTranscribe':{'type':Sequelize[_0x0a9e('0x6')],'defaultValue':![]},'transcribeAccountId':{'type':Sequelize['INTEGER']},'transcribeRegion':{'type':Sequelize[_0x0a9e('0x4')]},'sentiment':{'type':Sequelize[_0x0a9e('0x6')],'defaultValue':![]},'automaticSentiment':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'sentimentAccountId':{'type':Sequelize[_0x0a9e('0x2')]},'sentimentRegion':{'type':Sequelize['STRING']},'language':{'type':Sequelize[_0x0a9e('0x4')]},'bucket':{'type':Sequelize[_0x0a9e('0x4')]},'googleSsoEnabled':{'type':Sequelize[_0x0a9e('0x6')],'defaultValue':![]},'adSsoEnabled':{'type':Sequelize[_0x0a9e('0x6')],'defaultValue':![]},'enforcePasswordHistory':{'type':Sequelize[_0x0a9e('0x6')],'defaultValue':!![]},'passwordHistoryLimit':{'type':Sequelize[_0x0a9e('0x2')](0x2)[_0x0a9e('0x8')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x5}},'privacyPolicyEmail':{'type':Sequelize[_0x0a9e('0x2')](0x2)[_0x0a9e('0x8')],'defaultValue':0x0},'privacyPolicyName':{'type':Sequelize[_0x0a9e('0x2')](0x2)[_0x0a9e('0x8')],'defaultValue':0x0},'privacyPolicyNumber':{'type':Sequelize[_0x0a9e('0x2')](0x2)['UNSIGNED'],'defaultValue':0x0},'searchOnEnterKey':{'type':Sequelize[_0x0a9e('0x6')],'defaultValue':!![]},'chatInteractionsReloadTimeout':{'type':Sequelize[_0x0a9e('0x2')],'defaultValue':0x0},'mailInteractionsReloadTimeout':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'openchannelInteractionsReloadTimeout':{'type':Sequelize[_0x0a9e('0x2')],'defaultValue':0x0},'smsInteractionsReloadTimeout':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'whatsappInteractionsReloadTimeout':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'stopRecordingOnTransfer':{'type':Sequelize[_0x0a9e('0x6')],'defaultValue':![]},'secureCookieEnabled':{'type':Sequelize[_0x0a9e('0x6')],'defaultValue':!![]},'viewHelpSection':{'type':Sequelize[_0x0a9e('0x6')],'defaultValue':!![]},'previewRecallmeReminderInterval':{'type':Sequelize[_0x0a9e('0x2')],'defaultValue':0x5,'validate':{'min':0x1}},'disabledCookie':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'limitTabs':{'type':Sequelize[_0x0a9e('0x2')],'defaultValue':0x14}}; \ No newline at end of file +var _0xa9e0=['BOOLEAN','alternate','UNSIGNED','sequelize','exports','INTEGER','min_mailbox','STRING','/var/opt/motion2/server/files/sounds/converted'];(function(_0xe0e4a0,_0x1a7a27){var _0x1d57ea=function(_0x4cd1ea){while(--_0x4cd1ea){_0xe0e4a0['push'](_0xe0e4a0['shift']());}};_0x1d57ea(++_0x1a7a27);}(_0xa9e0,0x123));var _0x0a9e=function(_0x4e1d03,_0x786f3a){_0x4e1d03=_0x4e1d03-0x0;var _0x362d4b=_0xa9e0[_0x4e1d03];return _0x362d4b;};'use strict';var Sequelize=require(_0x0a9e('0x0'));module[_0x0a9e('0x1')]={'min_internal':{'type':Sequelize[_0x0a9e('0x2')](0xb),'unique':'min_internal','defaultValue':0x3e8},'min_mailbox':{'type':Sequelize['INTEGER'](0xb),'unique':_0x0a9e('0x3'),'defaultValue':0x3e8},'agi_port':{'type':Sequelize['INTEGER'](0xb),'defaultValue':0x11dd},'soundPath':{'type':Sequelize[_0x0a9e('0x4')],'defaultValue':_0x0a9e('0x5')},'logo':{'type':Sequelize[_0x0a9e('0x4')]},'defaultLogo':{'type':Sequelize[_0x0a9e('0x6')],'defaultValue':!![]},'loginLogo':{'type':Sequelize[_0x0a9e('0x4')]},'defaultLoginLogo':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'headerWhiteLabel':{'type':Sequelize[_0x0a9e('0x4')]},'defaultHeaderWhiteLabel':{'type':Sequelize[_0x0a9e('0x6')],'defaultValue':!![]},'securePassword':{'type':Sequelize[_0x0a9e('0x6')],'defaultValue':!![]},'firstSetup':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'stunaddr':{'type':Sequelize['STRING']},'turnaddr':{'type':Sequelize[_0x0a9e('0x4')]},'turnusername':{'type':Sequelize['STRING']},'turnpassword':{'type':Sequelize['STRING']},'pageTitle':{'type':Sequelize[_0x0a9e('0x4')]},'defaultPageTitle':{'type':Sequelize[_0x0a9e('0x6')],'defaultValue':!![]},'callRecordingEncryption':{'type':Sequelize[_0x0a9e('0x6')],'defaultValue':![]},'passwordExpiresDays':{'type':Sequelize[_0x0a9e('0x2')](0xb),'defaultValue':0x5a},'phoneBarAutoUpdater':{'type':Sequelize[_0x0a9e('0x6')],'defaultValue':!![]},'phoneBarAutoUpdaterUrl':{'type':Sequelize[_0x0a9e('0x4')],'defaultValue':'https://www.xcally.com/bar/phonebar/autoupdater.xml'},'enableEmailPreview':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'split':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'splitSizeCsv':{'type':Sequelize['INTEGER'],'defaultValue':0x1388},'splitSizePdf':{'type':Sequelize[_0x0a9e('0x2')],'defaultValue':0x1388},'splitSizeXlsx':{'type':Sequelize[_0x0a9e('0x2')],'defaultValue':0x1388},'messagesAlignment':{'type':Sequelize[_0x0a9e('0x4')],'defaultValue':_0x0a9e('0x7')},'chatTimeout':{'type':Sequelize[_0x0a9e('0x2')],'defaultValue':0x1e},'phoneBarRememberMeEnabled':{'type':Sequelize[_0x0a9e('0x6')],'defaultValue':!![]},'preferred':{'type':Sequelize['STRING']},'defaultPreferred':{'type':Sequelize[_0x0a9e('0x6')],'defaultValue':!![]},'rtlSupport':{'type':Sequelize[_0x0a9e('0x6')],'defaultValue':![]},'defaultScreenRecordingPath':{'type':Sequelize[_0x0a9e('0x4')]},'allowedLoginAttempts':{'type':Sequelize[_0x0a9e('0x2')],'defaultValue':0x5},'blockDuration':{'type':Sequelize[_0x0a9e('0x2')],'defaultValue':0xa},'favicon':{'type':Sequelize[_0x0a9e('0x4')]},'defaultFavicon':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'loginMailFrequency':{'type':Sequelize[_0x0a9e('0x2')],'defaultValue':0xa,'validate':{'min':0xa}},'transcribe':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'automaticTranscribe':{'type':Sequelize[_0x0a9e('0x6')],'defaultValue':![]},'transcribeAccountId':{'type':Sequelize['INTEGER']},'transcribeRegion':{'type':Sequelize[_0x0a9e('0x4')]},'sentiment':{'type':Sequelize[_0x0a9e('0x6')],'defaultValue':![]},'automaticSentiment':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'sentimentAccountId':{'type':Sequelize[_0x0a9e('0x2')]},'sentimentRegion':{'type':Sequelize['STRING']},'language':{'type':Sequelize[_0x0a9e('0x4')]},'bucket':{'type':Sequelize[_0x0a9e('0x4')]},'googleSsoEnabled':{'type':Sequelize[_0x0a9e('0x6')],'defaultValue':![]},'adSsoEnabled':{'type':Sequelize[_0x0a9e('0x6')],'defaultValue':![]},'enforcePasswordHistory':{'type':Sequelize[_0x0a9e('0x6')],'defaultValue':!![]},'passwordHistoryLimit':{'type':Sequelize[_0x0a9e('0x2')](0x2)[_0x0a9e('0x8')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x5}},'privacyPolicyEmail':{'type':Sequelize[_0x0a9e('0x2')](0x2)[_0x0a9e('0x8')],'defaultValue':0x0},'privacyPolicyName':{'type':Sequelize[_0x0a9e('0x2')](0x2)[_0x0a9e('0x8')],'defaultValue':0x0},'privacyPolicyNumber':{'type':Sequelize[_0x0a9e('0x2')](0x2)['UNSIGNED'],'defaultValue':0x0},'searchOnEnterKey':{'type':Sequelize[_0x0a9e('0x6')],'defaultValue':!![]},'chatInteractionsReloadTimeout':{'type':Sequelize[_0x0a9e('0x2')],'defaultValue':0x0},'mailInteractionsReloadTimeout':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'openchannelInteractionsReloadTimeout':{'type':Sequelize[_0x0a9e('0x2')],'defaultValue':0x0},'smsInteractionsReloadTimeout':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'whatsappInteractionsReloadTimeout':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'stopRecordingOnTransfer':{'type':Sequelize[_0x0a9e('0x6')],'defaultValue':![]},'secureCookieEnabled':{'type':Sequelize[_0x0a9e('0x6')],'defaultValue':!![]},'viewHelpSection':{'type':Sequelize[_0x0a9e('0x6')],'defaultValue':!![]},'previewRecallmeReminderInterval':{'type':Sequelize[_0x0a9e('0x2')],'defaultValue':0x5,'validate':{'min':0x1}},'disabledCookie':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'limitTabs':{'type':Sequelize[_0x0a9e('0x2')],'defaultValue':0x14}}; \ No newline at end of file diff --git a/server/api/setting/setting.controller.js b/server/api/setting/setting.controller.js index e4b5fa1..bd18948 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 _0xd3bd=['includeAll','catch','show','length','find','update','body','addLogo','file','filename','logo','params','addLogoLogin','loginLogo','getLogo','server/files/images/logos','getLicense','preferred','favicon','defaultPreferred','existsSync','join','root','toLower','default','default_logo.svg','Sequelize','upperFirst','download','getLogoLogin','defaultLogo','defaultFavicon','default_loginLogo.svg','ValidationError','\x20not\x20found','gdpr','addPreferred','getPreferred','defaultLoginLogo','default_preferred.png','custom','addFavicon','getFavicon','default_favicon.ico','getDate','utcOffset','now','YYYY-MM-DD\x20HH:mm:ss:SSS','fast-json-patch','request-promise','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','squel','crypto','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/license/util','../../mysqldb','jayson/promise','client','http','request','then','info','Setting,\x20%s,\x20%s','request\x20sent','Setting,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','sendStatus','status','json','offset','limit','undefined','count','set','Content-Range','apply','reject','destroy','end','stack','name','send','index','Setting','rawAttributes','fieldName','key','keys','query','filters','intersection','attributes','model','fields','hasOwnProperty','order','sort','where','filter','merge','map','options'];(function(_0x29f77f,_0x579ae6){var _0xa49181=function(_0x51b1a8){while(--_0x51b1a8){_0x29f77f['push'](_0x29f77f['shift']());}};_0xa49181(++_0x579ae6);}(_0xd3bd,0xa9));var _0xdd3b=function(_0x6131cd,_0x4c26a1){_0x6131cd=_0x6131cd-0x0;var _0x47e916=_0xd3bd[_0x6131cd];return _0x47e916;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0xdd3b('0x0'));var rp=require(_0xdd3b('0x1'));var moment=require('moment');var BPromise=require(_0xdd3b('0x2'));var Mustache=require(_0xdd3b('0x3'));var util=require(_0xdd3b('0x4'));var path=require(_0xdd3b('0x5'));var sox=require(_0xdd3b('0x6'));var csv=require(_0xdd3b('0x7'));var ejs=require(_0xdd3b('0x8'));var fs=require('fs');var fs_extra=require(_0xdd3b('0x9'));var _=require('lodash');var squel=require(_0xdd3b('0xa'));var crypto=require(_0xdd3b('0xb'));var jsforce=require(_0xdd3b('0xc'));var deskjs=require(_0xdd3b('0xd'));var toCsv=require(_0xdd3b('0x7'));var querystring=require(_0xdd3b('0xe'));var Papa=require(_0xdd3b('0xf'));var Redis=require('ioredis');var authService=require(_0xdd3b('0x10'));var qs=require(_0xdd3b('0x11'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xdd3b('0x12'));var logger=require(_0xdd3b('0x13'))(_0xdd3b('0x14'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0xdd3b('0x15'));var db=require(_0xdd3b('0x16'))['db'];var jayson=require(_0xdd3b('0x17'));var client=jayson[_0xdd3b('0x18')][_0xdd3b('0x19')]({'port':0x232a});function respondWithRpcPromise(_0x37fa5b,_0xc31f73,_0x3fae20,_0x3abef0){return new BPromise(function(_0x52df88,_0x33ee8d){var _0x4fda32=_0x3abef0||client;return _0x4fda32[_0xdd3b('0x1a')](_0x37fa5b,_0x3fae20)[_0xdd3b('0x1b')](function(_0x13943a){logger[_0xdd3b('0x1c')](_0xdd3b('0x1d'),_0xc31f73,_0xdd3b('0x1e'));logger['debug'](_0xdd3b('0x1f'),_0xc31f73,_0xdd3b('0x1e'),JSON[_0xdd3b('0x20')](_0x13943a));if(_0x13943a['error']){if(_0x13943a[_0xdd3b('0x21')][_0xdd3b('0x22')]===0x1f4){logger[_0xdd3b('0x21')]('Setting,\x20%s,\x20%s',_0xc31f73,_0x13943a[_0xdd3b('0x21')][_0xdd3b('0x23')]);return _0x33ee8d(_0x13943a['error']['message']);}logger[_0xdd3b('0x21')](_0xdd3b('0x1d'),_0xc31f73,_0x13943a[_0xdd3b('0x21')][_0xdd3b('0x23')]);return _0x52df88(_0x13943a['error'][_0xdd3b('0x23')]);}else{logger[_0xdd3b('0x1c')]('Setting,\x20%s,\x20%s',_0xc31f73,_0xdd3b('0x1e'));_0x52df88(_0x13943a[_0xdd3b('0x24')][_0xdd3b('0x23')]);}})['catch'](function(_0x595e30){logger[_0xdd3b('0x21')](_0xdd3b('0x1d'),_0xc31f73,_0x595e30);_0x33ee8d(_0x595e30);});});}function respondWithStatusCode(_0x227bf8,_0x2365ae){_0x2365ae=_0x2365ae||0xcc;return function(_0x18e363){if(_0x18e363){return _0x227bf8[_0xdd3b('0x25')](_0x2365ae);}return _0x227bf8[_0xdd3b('0x26')](_0x2365ae)['end']();};}function respondWithResult(_0x359c8d,_0x25d27f){_0x25d27f=_0x25d27f||0xc8;return function(_0x43daea){if(_0x43daea){return _0x359c8d[_0xdd3b('0x26')](_0x25d27f)[_0xdd3b('0x27')](_0x43daea);}};}function respondWithFilteredResult(_0x20986,_0x4d0e52){return function(_0x594306){if(_0x594306){var _0x3811cf=typeof _0x4d0e52[_0xdd3b('0x28')]==='undefined'&&typeof _0x4d0e52[_0xdd3b('0x29')]===_0xdd3b('0x2a');var _0x47612a=_0x594306[_0xdd3b('0x2b')];var _0x20154e=_0x3811cf?0x0:_0x4d0e52[_0xdd3b('0x28')];var _0x26a268=_0x3811cf?_0x594306[_0xdd3b('0x2b')]:_0x4d0e52['offset']+_0x4d0e52[_0xdd3b('0x29')];var _0xfdcca8;if(_0x26a268>=_0x47612a){_0x26a268=_0x47612a;_0xfdcca8=0xc8;}else{_0xfdcca8=0xce;}_0x20986[_0xdd3b('0x26')](_0xfdcca8);return _0x20986[_0xdd3b('0x2c')](_0xdd3b('0x2d'),_0x20154e+'-'+_0x26a268+'/'+_0x47612a)['json'](_0x594306);}return null;};}function patchUpdates(_0x4016a6){return function(_0x62429c){try{jsonpatch[_0xdd3b('0x2e')](_0x62429c,_0x4016a6,!![]);}catch(_0x2034d8){return BPromise[_0xdd3b('0x2f')](_0x2034d8);}return _0x62429c['save']();};}function saveUpdates(_0x3d7780,_0x31be26){return function(_0x1d1cce){if(_0x1d1cce){return _0x1d1cce['update'](_0x3d7780)[_0xdd3b('0x1b')](function(_0x51bf2c){return _0x51bf2c;});}return null;};}function removeEntity(_0x3e655c,_0x4d31fa){return function(_0x49f05e){if(_0x49f05e){return _0x49f05e[_0xdd3b('0x30')]()[_0xdd3b('0x1b')](function(){_0x3e655c['status'](0xcc)[_0xdd3b('0x31')]();});}};}function handleEntityNotFound(_0xa9a21a,_0x420e6c){return function(_0x16dc8b){if(!_0x16dc8b){_0xa9a21a[_0xdd3b('0x25')](0x194);}return _0x16dc8b;};}function handleError(_0xe2fb7e,_0x313e49){_0x313e49=_0x313e49||0x1f4;return function(_0xcb297){logger[_0xdd3b('0x21')](_0xcb297[_0xdd3b('0x32')]);if(_0xcb297[_0xdd3b('0x33')]){delete _0xcb297['name'];}_0xe2fb7e[_0xdd3b('0x26')](_0x313e49)[_0xdd3b('0x34')](_0xcb297);};}exports[_0xdd3b('0x35')]=function(_0x521648,_0x103a39){var _0x35c29a={},_0x55a23a={},_0x3778b4={'count':0x0,'rows':[]};var _0x43f8ba=_['map'](db[_0xdd3b('0x36')][_0xdd3b('0x37')],function(_0x4f0caf){return{'name':_0x4f0caf[_0xdd3b('0x38')],'type':_0x4f0caf['type'][_0xdd3b('0x39')]};});_0x55a23a['model']=_['map'](_0x43f8ba,_0xdd3b('0x33'));_0x55a23a['query']=_[_0xdd3b('0x3a')](_0x521648[_0xdd3b('0x3b')]);_0x55a23a[_0xdd3b('0x3c')]=_[_0xdd3b('0x3d')](_0x55a23a['model'],_0x55a23a[_0xdd3b('0x3b')]);_0x35c29a[_0xdd3b('0x3e')]=_['intersection'](_0x55a23a[_0xdd3b('0x3f')],qs[_0xdd3b('0x40')](_0x521648['query'][_0xdd3b('0x40')]));_0x35c29a[_0xdd3b('0x3e')]=_0x35c29a[_0xdd3b('0x3e')]['length']?_0x35c29a['attributes']:_0x55a23a[_0xdd3b('0x3f')];if(!_0x521648[_0xdd3b('0x3b')][_0xdd3b('0x41')]('nolimit')){_0x35c29a['limit']=qs[_0xdd3b('0x29')](_0x521648[_0xdd3b('0x3b')][_0xdd3b('0x29')]);_0x35c29a['offset']=qs['offset'](_0x521648[_0xdd3b('0x3b')][_0xdd3b('0x28')]);}_0x35c29a[_0xdd3b('0x42')]=qs[_0xdd3b('0x43')](_0x521648[_0xdd3b('0x3b')][_0xdd3b('0x43')]);_0x35c29a[_0xdd3b('0x44')]=qs[_0xdd3b('0x3c')](_['pick'](_0x521648[_0xdd3b('0x3b')],_0x55a23a[_0xdd3b('0x3c')]),_0x43f8ba);if(_0x521648[_0xdd3b('0x3b')][_0xdd3b('0x45')]){_0x35c29a[_0xdd3b('0x44')]=_[_0xdd3b('0x46')](_0x35c29a[_0xdd3b('0x44')],{'$or':_[_0xdd3b('0x47')](_0x43f8ba,function(_0x243c66){if(_0x243c66['type']!=='VIRTUAL'){var _0x1cb4d4={};_0x1cb4d4[_0x243c66['name']]={'$like':'%'+_0x521648[_0xdd3b('0x3b')][_0xdd3b('0x45')]+'%'};return _0x1cb4d4;}})});}_0x35c29a=_[_0xdd3b('0x46')]({},_0x35c29a,_0x521648[_0xdd3b('0x48')]);var _0x21a8c4={'where':_0x35c29a['where']};return db[_0xdd3b('0x36')][_0xdd3b('0x2b')](_0x21a8c4)[_0xdd3b('0x1b')](function(_0x524a78){_0x3778b4['count']=_0x524a78;if(_0x521648['query'][_0xdd3b('0x49')]){_0x35c29a['include']=[{'all':!![]}];}return db[_0xdd3b('0x36')]['findAll'](_0x35c29a);})[_0xdd3b('0x1b')](function(_0x4966f1){_0x3778b4['rows']=_0x4966f1;return _0x3778b4;})['then'](respondWithFilteredResult(_0x103a39,_0x35c29a))[_0xdd3b('0x4a')](handleError(_0x103a39,null));};exports[_0xdd3b('0x4b')]=function(_0x1f8ca2,_0x1d4dab){var _0x4b00b0={'raw':![],'where':{'id':_0x1f8ca2['params']['id']}},_0x28fb6b={};_0x28fb6b[_0xdd3b('0x3f')]=_['keys'](db[_0xdd3b('0x36')][_0xdd3b('0x37')]);_0x28fb6b[_0xdd3b('0x3b')]=_['keys'](_0x1f8ca2[_0xdd3b('0x3b')]);_0x28fb6b[_0xdd3b('0x3c')]=_[_0xdd3b('0x3d')](_0x28fb6b['model'],_0x28fb6b[_0xdd3b('0x3b')]);_0x4b00b0['attributes']=_['intersection'](_0x28fb6b[_0xdd3b('0x3f')],qs['fields'](_0x1f8ca2[_0xdd3b('0x3b')]['fields']));_0x4b00b0['attributes']=_0x4b00b0[_0xdd3b('0x3e')][_0xdd3b('0x4c')]?_0x4b00b0[_0xdd3b('0x3e')]:_0x28fb6b[_0xdd3b('0x3f')];if(_0x1f8ca2[_0xdd3b('0x3b')]['includeAll']){_0x4b00b0['include']=[{'all':!![]}];}_0x4b00b0=_[_0xdd3b('0x46')]({},_0x4b00b0,_0x1f8ca2[_0xdd3b('0x48')]);return db[_0xdd3b('0x36')][_0xdd3b('0x4d')](_0x4b00b0)['then'](handleEntityNotFound(_0x1d4dab,null))['then'](respondWithResult(_0x1d4dab,null))[_0xdd3b('0x4a')](handleError(_0x1d4dab,null));};exports[_0xdd3b('0x4e')]=function(_0x48b9c6,_0x20c241){if(_0x48b9c6[_0xdd3b('0x4f')]['id']){delete _0x48b9c6['body']['id'];}return db[_0xdd3b('0x36')][_0xdd3b('0x4d')]({'where':{'id':_0x48b9c6['params']['id']}})[_0xdd3b('0x1b')](handleEntityNotFound(_0x20c241,null))[_0xdd3b('0x1b')](saveUpdates(_0x48b9c6[_0xdd3b('0x4f')],null))[_0xdd3b('0x1b')](respondWithResult(_0x20c241,null))[_0xdd3b('0x4a')](handleError(_0x20c241,null));};exports[_0xdd3b('0x50')]=function(_0x3c234a,_0x24bcdc,_0x5c7c61){if(_0x3c234a['file']&&_0x3c234a[_0xdd3b('0x51')][_0xdd3b('0x52')]){_0x3c234a[_0xdd3b('0x4f')][_0xdd3b('0x53')]=_0x3c234a[_0xdd3b('0x51')][_0xdd3b('0x52')];}return db['Setting'][_0xdd3b('0x4d')]({'where':{'id':_0x3c234a[_0xdd3b('0x54')]['id']}})[_0xdd3b('0x1b')](handleEntityNotFound(_0x24bcdc,null))[_0xdd3b('0x1b')](saveUpdates(_0x3c234a[_0xdd3b('0x4f')],null))[_0xdd3b('0x1b')](respondWithResult(_0x24bcdc,null))[_0xdd3b('0x4a')](handleError(_0x24bcdc,null));};exports[_0xdd3b('0x55')]=function(_0x3cd9f8,_0x5ca2a4,_0x72f22d){if(_0x3cd9f8[_0xdd3b('0x51')]&&_0x3cd9f8[_0xdd3b('0x51')][_0xdd3b('0x52')]){_0x3cd9f8[_0xdd3b('0x4f')][_0xdd3b('0x56')]=_0x3cd9f8[_0xdd3b('0x51')][_0xdd3b('0x52')];}return db[_0xdd3b('0x36')][_0xdd3b('0x4d')]({'where':{'id':_0x3cd9f8[_0xdd3b('0x54')]['id']}})['then'](handleEntityNotFound(_0x5ca2a4,null))[_0xdd3b('0x1b')](saveUpdates(_0x3cd9f8[_0xdd3b('0x4f')],null))[_0xdd3b('0x1b')](respondWithResult(_0x5ca2a4,null))[_0xdd3b('0x4a')](handleError(_0x5ca2a4,null));};var utilLicense=require(_0xdd3b('0x15'));exports[_0xdd3b('0x57')]=function(_0x48a348,_0x3cc78e,_0x404cf7){var _0x3766e5=_0xdd3b('0x58');var _0x25c65a={'custom':![]};return utilLicense[_0xdd3b('0x59')]()[_0xdd3b('0x1b')](function(_0x5f4271){if(_0x5f4271){_0x25c65a=_0x5f4271;}return db[_0xdd3b('0x36')][_0xdd3b('0x4d')]({'where':{'id':_0x48a348[_0xdd3b('0x54')]['id']},'attributes':[_0xdd3b('0x53'),_0xdd3b('0x56'),_0xdd3b('0x5a'),_0xdd3b('0x5b'),'defaultLogo','defaultLoginLogo',_0xdd3b('0x5c'),'defaultFavicon'],'raw':!![]});})[_0xdd3b('0x1b')](handleEntityNotFound(_0x3cc78e,null))[_0xdd3b('0x1b')](function(_0x50556e){if(_0x50556e){var _0x5db2c8=_0x50556e[_0xdd3b('0x53')]&&fs[_0xdd3b('0x5d')](path[_0xdd3b('0x5e')](config[_0xdd3b('0x5f')],_0x3766e5,_[_0xdd3b('0x60')](_0x50556e[_0xdd3b('0x53')])))?path['join'](config[_0xdd3b('0x5f')],_0x3766e5,_[_0xdd3b('0x60')](_0x50556e[_0xdd3b('0x53')])):path['join'](config[_0xdd3b('0x5f')],_0x3766e5,_['toLower']('default_logo.svg'));var _0x3cfd69=_0xdd3b('0x61')+_['upperFirst'](_0xdd3b('0x53'));if(_0x50556e[_0x3cfd69]||!_0x25c65a['custom']){_0x5db2c8=path[_0xdd3b('0x5e')](config['root'],_0x3766e5,_[_0xdd3b('0x60')](_0xdd3b('0x62')));}if(!fs[_0xdd3b('0x5d')](_0x5db2c8)){throw new db[(_0xdd3b('0x63'))]['ValidationError'](_[_0xdd3b('0x64')](_0xdd3b('0x53'))+'\x20not\x20found');}return _0x3cc78e[_0xdd3b('0x65')](_0x5db2c8);}})['catch'](handleError(_0x3cc78e,null));};var utilLicense=require(_0xdd3b('0x15'));exports[_0xdd3b('0x66')]=function(_0xa28ae,_0xd78c0c,_0x4575fe){var _0x2d0cf9='server/files/images/logos';var _0x4bc1ba={'custom':![]};return utilLicense[_0xdd3b('0x59')]()[_0xdd3b('0x1b')](function(_0x2fab1c){if(_0x2fab1c){_0x4bc1ba=_0x2fab1c;}return db[_0xdd3b('0x36')][_0xdd3b('0x4d')]({'where':{'id':_0xa28ae[_0xdd3b('0x54')]['id']},'attributes':[_0xdd3b('0x53'),'loginLogo',_0xdd3b('0x5a'),_0xdd3b('0x5b'),_0xdd3b('0x67'),'defaultLoginLogo','defaultPreferred',_0xdd3b('0x68')],'raw':!![]});})[_0xdd3b('0x1b')](handleEntityNotFound(_0xd78c0c,null))[_0xdd3b('0x1b')](function(_0xf94d05){if(_0xf94d05){var _0x111a2f=_0xf94d05['loginLogo']&&fs[_0xdd3b('0x5d')](path[_0xdd3b('0x5e')](config[_0xdd3b('0x5f')],_0x2d0cf9,_[_0xdd3b('0x60')](_0xf94d05[_0xdd3b('0x56')])))?path[_0xdd3b('0x5e')](config['root'],_0x2d0cf9,_['toLower'](_0xf94d05['loginLogo'])):path[_0xdd3b('0x5e')](config['root'],_0x2d0cf9,_[_0xdd3b('0x60')]('default_loginLogo.svg'));var _0x4379ee=_0xdd3b('0x61')+_[_0xdd3b('0x64')](_0xdd3b('0x56'));if(_0xf94d05[_0x4379ee]||!_0x4bc1ba['custom']){_0x111a2f=path['join'](config[_0xdd3b('0x5f')],_0x2d0cf9,_[_0xdd3b('0x60')](_0xdd3b('0x69')));}if(!fs['existsSync'](_0x111a2f)){throw new db[(_0xdd3b('0x63'))][(_0xdd3b('0x6a'))](_[_0xdd3b('0x64')](_0xdd3b('0x56'))+_0xdd3b('0x6b'));}return _0xd78c0c[_0xdd3b('0x65')](_0x111a2f);}})[_0xdd3b('0x4a')](handleError(_0xd78c0c,null));};exports[_0xdd3b('0x6c')]=function(_0x53dcfa,_0x8fba0e){return db['Setting']['find']({'where':{'id':_0x53dcfa['params']['id']},'attributes':['securePassword']})['then'](respondWithResult(_0x8fba0e,null))[_0xdd3b('0x4a')](handleError(_0x8fba0e,null));};exports[_0xdd3b('0x6d')]=function(_0x2efb3f,_0x51a076,_0x12f5fa){if(_0x2efb3f[_0xdd3b('0x51')]&&_0x2efb3f[_0xdd3b('0x51')][_0xdd3b('0x52')]){_0x2efb3f[_0xdd3b('0x4f')][_0xdd3b('0x5a')]=_0x2efb3f[_0xdd3b('0x51')]['filename'];}return db[_0xdd3b('0x36')]['find']({'where':{'id':_0x2efb3f['params']['id']}})[_0xdd3b('0x1b')](handleEntityNotFound(_0x51a076,null))[_0xdd3b('0x1b')](saveUpdates(_0x2efb3f[_0xdd3b('0x4f')],null))[_0xdd3b('0x1b')](respondWithResult(_0x51a076,null))[_0xdd3b('0x4a')](handleError(_0x51a076,null));};var utilLicense=require(_0xdd3b('0x15'));exports[_0xdd3b('0x6e')]=function(_0x3f8b08,_0xdb0b1f,_0x117692){var _0x4eb30f='server/files/images/logos';var _0x2d4873={'custom':![]};return utilLicense[_0xdd3b('0x59')]()[_0xdd3b('0x1b')](function(_0x3cbf19){if(_0x3cbf19){_0x2d4873=_0x3cbf19;}return db[_0xdd3b('0x36')][_0xdd3b('0x4d')]({'where':{'id':_0x3f8b08[_0xdd3b('0x54')]['id']},'attributes':[_0xdd3b('0x53'),_0xdd3b('0x56'),_0xdd3b('0x5a'),_0xdd3b('0x5b'),_0xdd3b('0x67'),_0xdd3b('0x6f'),_0xdd3b('0x5c'),_0xdd3b('0x68')],'raw':!![]});})[_0xdd3b('0x1b')](handleEntityNotFound(_0xdb0b1f,null))['then'](function(_0x56e3f0){if(_0x56e3f0){var _0x9fd357=_0x56e3f0['preferred']&&fs['existsSync'](path[_0xdd3b('0x5e')](config[_0xdd3b('0x5f')],_0x4eb30f,_[_0xdd3b('0x60')](_0x56e3f0[_0xdd3b('0x5a')])))?path['join'](config[_0xdd3b('0x5f')],_0x4eb30f,_[_0xdd3b('0x60')](_0x56e3f0[_0xdd3b('0x5a')])):path[_0xdd3b('0x5e')](config[_0xdd3b('0x5f')],_0x4eb30f,_[_0xdd3b('0x60')](_0xdd3b('0x70')));var _0xe897f9='default'+_[_0xdd3b('0x64')](_0xdd3b('0x5a'));if(_0x56e3f0[_0xe897f9]||!_0x2d4873[_0xdd3b('0x71')]||!_0x2d4873[_0xdd3b('0x5a')]){_0x9fd357=path[_0xdd3b('0x5e')](config[_0xdd3b('0x5f')],_0x4eb30f,_['toLower'](_0xdd3b('0x70')));}if(!fs[_0xdd3b('0x5d')](_0x9fd357)){throw new db[(_0xdd3b('0x63'))][(_0xdd3b('0x6a'))](_[_0xdd3b('0x64')](_0xdd3b('0x5a'))+_0xdd3b('0x6b'));}return _0xdb0b1f[_0xdd3b('0x65')](_0x9fd357);}})[_0xdd3b('0x4a')](handleError(_0xdb0b1f,null));};exports[_0xdd3b('0x72')]=function(_0x1d2216,_0x4ead3d,_0xcc1eab){if(_0x1d2216[_0xdd3b('0x51')]&&_0x1d2216[_0xdd3b('0x51')]['filename']){_0x1d2216[_0xdd3b('0x4f')][_0xdd3b('0x5b')]=_0x1d2216[_0xdd3b('0x51')][_0xdd3b('0x52')];}return db[_0xdd3b('0x36')][_0xdd3b('0x4d')]({'where':{'id':_0x1d2216[_0xdd3b('0x54')]['id']}})['then'](handleEntityNotFound(_0x4ead3d,null))[_0xdd3b('0x1b')](saveUpdates(_0x1d2216[_0xdd3b('0x4f')],null))[_0xdd3b('0x1b')](respondWithResult(_0x4ead3d,null))[_0xdd3b('0x4a')](handleError(_0x4ead3d,null));};var utilLicense=require(_0xdd3b('0x15'));exports[_0xdd3b('0x73')]=function(_0x3359af,_0x161f23,_0x1245b9){var _0x2c3315=_0xdd3b('0x58');var _0x1e3fb6={'custom':![]};return utilLicense['getLicense']()[_0xdd3b('0x1b')](function(_0x58899b){if(_0x58899b){_0x1e3fb6=_0x58899b;}return db[_0xdd3b('0x36')]['find']({'where':{'id':_0x3359af[_0xdd3b('0x54')]['id']},'attributes':[_0xdd3b('0x53'),_0xdd3b('0x56'),_0xdd3b('0x5a'),'favicon',_0xdd3b('0x67'),_0xdd3b('0x6f'),_0xdd3b('0x5c'),'defaultFavicon'],'raw':!![]});})[_0xdd3b('0x1b')](handleEntityNotFound(_0x161f23,null))[_0xdd3b('0x1b')](function(_0x1c4958){if(_0x1c4958){var _0x9ab619=_0x1c4958[_0xdd3b('0x5b')]&&fs['existsSync'](path[_0xdd3b('0x5e')](config[_0xdd3b('0x5f')],_0x2c3315,_[_0xdd3b('0x60')](_0x1c4958[_0xdd3b('0x5b')])))?path[_0xdd3b('0x5e')](config[_0xdd3b('0x5f')],_0x2c3315,_[_0xdd3b('0x60')](_0x1c4958[_0xdd3b('0x5b')])):path[_0xdd3b('0x5e')](config[_0xdd3b('0x5f')],_0x2c3315,_['toLower'](_0xdd3b('0x74')));var _0x59d40f=_0xdd3b('0x61')+_['upperFirst'](_0xdd3b('0x5b'));if(_0x1c4958[_0x59d40f]||!_0x1e3fb6[_0xdd3b('0x71')]){_0x9ab619=path[_0xdd3b('0x5e')](config['root'],_0x2c3315,_[_0xdd3b('0x60')](_0xdd3b('0x74')));}if(!fs[_0xdd3b('0x5d')](_0x9ab619)){throw new db['Sequelize'][(_0xdd3b('0x6a'))](_[_0xdd3b('0x64')]('favicon')+_0xdd3b('0x6b'));}return _0x161f23[_0xdd3b('0x65')](_0x9ab619);}})['catch'](handleError(_0x161f23,null));};exports[_0xdd3b('0x75')]=function(_0x4be43e,_0x15018d){var _0x5d1279={'offset':moment()[_0xdd3b('0x76')]()};_0x5d1279[_0xdd3b('0x77')]=moment()[_0xdd3b('0x76')](_0x5d1279[_0xdd3b('0x28')])['format'](_0xdd3b('0x78'));return _0x15018d[_0xdd3b('0x26')](0xc8)['send'](_0x5d1279);}; \ No newline at end of file +var _0x0604=['offset','limit','undefined','set','Content-Range','apply','reject','save','update','destroy','stack','name','send','map','rawAttributes','fieldName','key','model','query','filters','intersection','fields','attributes','length','hasOwnProperty','order','sort','pick','filter','merge','where','type','VIRTUAL','Setting','count','includeAll','include','findAll','catch','show','body','find','addLogo','file','filename','logo','params','addLogoLogin','getLogo','server/files/images/logos','getLicense','loginLogo','preferred','favicon','defaultLogo','defaultLoginLogo','defaultFavicon','existsSync','join','root','toLower','default_logo.svg','default','upperFirst','custom','Sequelize','ValidationError','\x20not\x20found','download','getLogoLogin','defaultPreferred','default_loginLogo.svg','gdpr','securePassword','getPreferred','default_preferred.png','addFavicon','getFavicon','default_favicon.ico','getDate','utcOffset','now','format','YYYY-MM-DD\x20HH:mm:ss:SSS','eml-format','rimraf','fast-json-patch','moment','bluebird','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/environment','../../config/license/util','jayson/promise','client','request','then','info','Setting,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','result','sendStatus','status','end','json'];(function(_0x1a7cdc,_0x260153){var _0x3fdf60=function(_0x4f7792){while(--_0x4f7792){_0x1a7cdc['push'](_0x1a7cdc['shift']());}};_0x3fdf60(++_0x260153);}(_0x0604,0xd3));var _0x4060=function(_0xb3cb33,_0x298859){_0xb3cb33=_0xb3cb33-0x0;var _0x4a7df0=_0x0604[_0xb3cb33];return _0x4a7df0;};'use strict';var emlformat=require(_0x4060('0x0'));var rimraf=require(_0x4060('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x4060('0x2'));var rp=require('request-promise');var moment=require(_0x4060('0x3'));var BPromise=require(_0x4060('0x4'));var Mustache=require('mustache');var util=require(_0x4060('0x5'));var path=require(_0x4060('0x6'));var sox=require(_0x4060('0x7'));var csv=require(_0x4060('0x8'));var ejs=require(_0x4060('0x9'));var fs=require('fs');var fs_extra=require(_0x4060('0xa'));var _=require(_0x4060('0xb'));var squel=require(_0x4060('0xc'));var crypto=require(_0x4060('0xd'));var jsforce=require(_0x4060('0xe'));var deskjs=require(_0x4060('0xf'));var toCsv=require(_0x4060('0x8'));var querystring=require(_0x4060('0x10'));var Papa=require(_0x4060('0x11'));var Redis=require(_0x4060('0x12'));var authService=require(_0x4060('0x13'));var qs=require(_0x4060('0x14'));var as=require(_0x4060('0x15'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x4060('0x16'))(_0x4060('0x17'));var utils=require('../../config/utils');var config=require(_0x4060('0x18'));var licenseUtil=require(_0x4060('0x19'));var db=require('../../mysqldb')['db'];var jayson=require(_0x4060('0x1a'));var client=jayson[_0x4060('0x1b')]['http']({'port':0x232a});function respondWithRpcPromise(_0x418c66,_0x1bf9bd,_0x34b849,_0x52cb9b){return new BPromise(function(_0x58e240,_0x1165da){var _0x31a8b4=_0x52cb9b||client;return _0x31a8b4[_0x4060('0x1c')](_0x418c66,_0x34b849)[_0x4060('0x1d')](function(_0x444d73){logger[_0x4060('0x1e')](_0x4060('0x1f'),_0x1bf9bd,_0x4060('0x20'));logger[_0x4060('0x21')]('Setting,\x20%s,\x20%s,\x20%s',_0x1bf9bd,_0x4060('0x20'),JSON[_0x4060('0x22')](_0x444d73));if(_0x444d73[_0x4060('0x23')]){if(_0x444d73[_0x4060('0x23')][_0x4060('0x24')]===0x1f4){logger[_0x4060('0x23')](_0x4060('0x1f'),_0x1bf9bd,_0x444d73[_0x4060('0x23')][_0x4060('0x25')]);return _0x1165da(_0x444d73[_0x4060('0x23')][_0x4060('0x25')]);}logger[_0x4060('0x23')](_0x4060('0x1f'),_0x1bf9bd,_0x444d73[_0x4060('0x23')][_0x4060('0x25')]);return _0x58e240(_0x444d73[_0x4060('0x23')][_0x4060('0x25')]);}else{logger[_0x4060('0x1e')]('Setting,\x20%s,\x20%s',_0x1bf9bd,_0x4060('0x20'));_0x58e240(_0x444d73[_0x4060('0x26')][_0x4060('0x25')]);}})['catch'](function(_0x3f6ff3){logger[_0x4060('0x23')](_0x4060('0x1f'),_0x1bf9bd,_0x3f6ff3);_0x1165da(_0x3f6ff3);});});}function respondWithStatusCode(_0x27ad78,_0x4f4206){_0x4f4206=_0x4f4206||0xcc;return function(_0x53852b){if(_0x53852b){return _0x27ad78[_0x4060('0x27')](_0x4f4206);}return _0x27ad78[_0x4060('0x28')](_0x4f4206)[_0x4060('0x29')]();};}function respondWithResult(_0x1a4518,_0x514ab4){_0x514ab4=_0x514ab4||0xc8;return function(_0x44af62){if(_0x44af62){return _0x1a4518['status'](_0x514ab4)[_0x4060('0x2a')](_0x44af62);}};}function respondWithFilteredResult(_0x4bf897,_0x11c518){return function(_0x239474){if(_0x239474){var _0x2e7c36=typeof _0x11c518[_0x4060('0x2b')]==='undefined'&&typeof _0x11c518[_0x4060('0x2c')]===_0x4060('0x2d');var _0xe94b9=_0x239474['count'];var _0xe52b17=_0x2e7c36?0x0:_0x11c518['offset'];var _0x2ca631=_0x2e7c36?_0x239474['count']:_0x11c518[_0x4060('0x2b')]+_0x11c518[_0x4060('0x2c')];var _0x57063d;if(_0x2ca631>=_0xe94b9){_0x2ca631=_0xe94b9;_0x57063d=0xc8;}else{_0x57063d=0xce;}_0x4bf897[_0x4060('0x28')](_0x57063d);return _0x4bf897[_0x4060('0x2e')](_0x4060('0x2f'),_0xe52b17+'-'+_0x2ca631+'/'+_0xe94b9)[_0x4060('0x2a')](_0x239474);}return null;};}function patchUpdates(_0x43aa23){return function(_0x312bc4){try{jsonpatch[_0x4060('0x30')](_0x312bc4,_0x43aa23,!![]);}catch(_0x54801b){return BPromise[_0x4060('0x31')](_0x54801b);}return _0x312bc4[_0x4060('0x32')]();};}function saveUpdates(_0x3e075f,_0x302c61){return function(_0x2847ed){if(_0x2847ed){return _0x2847ed[_0x4060('0x33')](_0x3e075f)[_0x4060('0x1d')](function(_0x4d8f2d){return _0x4d8f2d;});}return null;};}function removeEntity(_0x1ddc37,_0x10ad21){return function(_0x158356){if(_0x158356){return _0x158356[_0x4060('0x34')]()[_0x4060('0x1d')](function(){_0x1ddc37[_0x4060('0x28')](0xcc)[_0x4060('0x29')]();});}};}function handleEntityNotFound(_0x2d95d8,_0x2eb285){return function(_0x5368e5){if(!_0x5368e5){_0x2d95d8[_0x4060('0x27')](0x194);}return _0x5368e5;};}function handleError(_0x43f0f4,_0x270843){_0x270843=_0x270843||0x1f4;return function(_0x332e00){logger[_0x4060('0x23')](_0x332e00[_0x4060('0x35')]);if(_0x332e00[_0x4060('0x36')]){delete _0x332e00[_0x4060('0x36')];}_0x43f0f4[_0x4060('0x28')](_0x270843)[_0x4060('0x37')](_0x332e00);};}exports['index']=function(_0xe1606,_0x3c9717){var _0x306036={},_0x529663={},_0x4a5acb={'count':0x0,'rows':[]};var _0x1fcf09=_[_0x4060('0x38')](db['Setting'][_0x4060('0x39')],function(_0x1923be){return{'name':_0x1923be[_0x4060('0x3a')],'type':_0x1923be['type'][_0x4060('0x3b')]};});_0x529663[_0x4060('0x3c')]=_[_0x4060('0x38')](_0x1fcf09,_0x4060('0x36'));_0x529663[_0x4060('0x3d')]=_['keys'](_0xe1606[_0x4060('0x3d')]);_0x529663[_0x4060('0x3e')]=_[_0x4060('0x3f')](_0x529663['model'],_0x529663[_0x4060('0x3d')]);_0x306036['attributes']=_['intersection'](_0x529663[_0x4060('0x3c')],qs[_0x4060('0x40')](_0xe1606[_0x4060('0x3d')][_0x4060('0x40')]));_0x306036[_0x4060('0x41')]=_0x306036[_0x4060('0x41')][_0x4060('0x42')]?_0x306036[_0x4060('0x41')]:_0x529663[_0x4060('0x3c')];if(!_0xe1606[_0x4060('0x3d')][_0x4060('0x43')]('nolimit')){_0x306036[_0x4060('0x2c')]=qs[_0x4060('0x2c')](_0xe1606[_0x4060('0x3d')][_0x4060('0x2c')]);_0x306036[_0x4060('0x2b')]=qs[_0x4060('0x2b')](_0xe1606['query'][_0x4060('0x2b')]);}_0x306036[_0x4060('0x44')]=qs[_0x4060('0x45')](_0xe1606['query']['sort']);_0x306036['where']=qs['filters'](_[_0x4060('0x46')](_0xe1606['query'],_0x529663[_0x4060('0x3e')]),_0x1fcf09);if(_0xe1606[_0x4060('0x3d')][_0x4060('0x47')]){_0x306036['where']=_[_0x4060('0x48')](_0x306036[_0x4060('0x49')],{'$or':_[_0x4060('0x38')](_0x1fcf09,function(_0xa2bf60){if(_0xa2bf60[_0x4060('0x4a')]!==_0x4060('0x4b')){var _0x54ab5c={};_0x54ab5c[_0xa2bf60[_0x4060('0x36')]]={'$like':'%'+_0xe1606[_0x4060('0x3d')][_0x4060('0x47')]+'%'};return _0x54ab5c;}})});}_0x306036=_[_0x4060('0x48')]({},_0x306036,_0xe1606['options']);var _0xe5be72={'where':_0x306036['where']};return db[_0x4060('0x4c')][_0x4060('0x4d')](_0xe5be72)['then'](function(_0x29dee8){_0x4a5acb[_0x4060('0x4d')]=_0x29dee8;if(_0xe1606[_0x4060('0x3d')][_0x4060('0x4e')]){_0x306036[_0x4060('0x4f')]=[{'all':!![]}];}return db[_0x4060('0x4c')][_0x4060('0x50')](_0x306036);})[_0x4060('0x1d')](function(_0x1f2830){_0x4a5acb['rows']=_0x1f2830;return _0x4a5acb;})[_0x4060('0x1d')](respondWithFilteredResult(_0x3c9717,_0x306036))[_0x4060('0x51')](handleError(_0x3c9717,null));};exports[_0x4060('0x52')]=function(_0x23cca4,_0x3e8667){var _0x29f28e={'raw':![],'where':{'id':_0x23cca4['params']['id']}},_0x291837={};_0x291837[_0x4060('0x3c')]=_['keys'](db[_0x4060('0x4c')][_0x4060('0x39')]);_0x291837[_0x4060('0x3d')]=_['keys'](_0x23cca4['query']);_0x291837['filters']=_['intersection'](_0x291837[_0x4060('0x3c')],_0x291837['query']);_0x29f28e[_0x4060('0x41')]=_[_0x4060('0x3f')](_0x291837[_0x4060('0x3c')],qs[_0x4060('0x40')](_0x23cca4[_0x4060('0x3d')][_0x4060('0x40')]));_0x29f28e[_0x4060('0x41')]=_0x29f28e[_0x4060('0x41')]['length']?_0x29f28e[_0x4060('0x41')]:_0x291837[_0x4060('0x3c')];if(_0x23cca4['query']['includeAll']){_0x29f28e[_0x4060('0x4f')]=[{'all':!![]}];}_0x29f28e=_[_0x4060('0x48')]({},_0x29f28e,_0x23cca4['options']);return db['Setting']['find'](_0x29f28e)['then'](handleEntityNotFound(_0x3e8667,null))[_0x4060('0x1d')](respondWithResult(_0x3e8667,null))[_0x4060('0x51')](handleError(_0x3e8667,null));};exports[_0x4060('0x33')]=function(_0x389690,_0x51853c){if(_0x389690[_0x4060('0x53')]['id']){delete _0x389690['body']['id'];}return db['Setting'][_0x4060('0x54')]({'where':{'id':_0x389690['params']['id']}})['then'](handleEntityNotFound(_0x51853c,null))['then'](saveUpdates(_0x389690[_0x4060('0x53')],null))['then'](respondWithResult(_0x51853c,null))['catch'](handleError(_0x51853c,null));};exports[_0x4060('0x55')]=function(_0x3f71ae,_0x186af1,_0xbbd7f2){if(_0x3f71ae[_0x4060('0x56')]&&_0x3f71ae[_0x4060('0x56')][_0x4060('0x57')]){_0x3f71ae[_0x4060('0x53')][_0x4060('0x58')]=_0x3f71ae[_0x4060('0x56')]['filename'];}return db[_0x4060('0x4c')][_0x4060('0x54')]({'where':{'id':_0x3f71ae[_0x4060('0x59')]['id']}})['then'](handleEntityNotFound(_0x186af1,null))[_0x4060('0x1d')](saveUpdates(_0x3f71ae[_0x4060('0x53')],null))[_0x4060('0x1d')](respondWithResult(_0x186af1,null))['catch'](handleError(_0x186af1,null));};exports[_0x4060('0x5a')]=function(_0x49f4ce,_0x334100,_0x5d8ece){if(_0x49f4ce['file']&&_0x49f4ce[_0x4060('0x56')][_0x4060('0x57')]){_0x49f4ce[_0x4060('0x53')]['loginLogo']=_0x49f4ce[_0x4060('0x56')][_0x4060('0x57')];}return db[_0x4060('0x4c')]['find']({'where':{'id':_0x49f4ce[_0x4060('0x59')]['id']}})[_0x4060('0x1d')](handleEntityNotFound(_0x334100,null))['then'](saveUpdates(_0x49f4ce[_0x4060('0x53')],null))[_0x4060('0x1d')](respondWithResult(_0x334100,null))[_0x4060('0x51')](handleError(_0x334100,null));};var utilLicense=require(_0x4060('0x19'));exports[_0x4060('0x5b')]=function(_0x512305,_0x4c301a,_0x41408f){var _0x20f46f=_0x4060('0x5c');var _0x434f7a={'custom':![]};return utilLicense[_0x4060('0x5d')]()[_0x4060('0x1d')](function(_0x597e21){if(_0x597e21){_0x434f7a=_0x597e21;}return db[_0x4060('0x4c')][_0x4060('0x54')]({'where':{'id':_0x512305[_0x4060('0x59')]['id']},'attributes':[_0x4060('0x58'),_0x4060('0x5e'),_0x4060('0x5f'),_0x4060('0x60'),_0x4060('0x61'),_0x4060('0x62'),'defaultPreferred',_0x4060('0x63')],'raw':!![]});})[_0x4060('0x1d')](handleEntityNotFound(_0x4c301a,null))[_0x4060('0x1d')](function(_0x4b35c7){if(_0x4b35c7){var _0x7b7cfb=_0x4b35c7[_0x4060('0x58')]&&fs[_0x4060('0x64')](path[_0x4060('0x65')](config[_0x4060('0x66')],_0x20f46f,_['toLower'](_0x4b35c7[_0x4060('0x58')])))?path[_0x4060('0x65')](config[_0x4060('0x66')],_0x20f46f,_['toLower'](_0x4b35c7[_0x4060('0x58')])):path[_0x4060('0x65')](config[_0x4060('0x66')],_0x20f46f,_[_0x4060('0x67')](_0x4060('0x68')));var _0x49b45a=_0x4060('0x69')+_[_0x4060('0x6a')]('logo');if(_0x4b35c7[_0x49b45a]||!_0x434f7a[_0x4060('0x6b')]){_0x7b7cfb=path[_0x4060('0x65')](config[_0x4060('0x66')],_0x20f46f,_[_0x4060('0x67')](_0x4060('0x68')));}if(!fs['existsSync'](_0x7b7cfb)){throw new db[(_0x4060('0x6c'))][(_0x4060('0x6d'))](_['upperFirst'](_0x4060('0x58'))+_0x4060('0x6e'));}return _0x4c301a[_0x4060('0x6f')](_0x7b7cfb);}})[_0x4060('0x51')](handleError(_0x4c301a,null));};var utilLicense=require(_0x4060('0x19'));exports[_0x4060('0x70')]=function(_0x18314c,_0x2be488,_0x419a39){var _0x554401=_0x4060('0x5c');var _0x399018={'custom':![]};return utilLicense[_0x4060('0x5d')]()[_0x4060('0x1d')](function(_0x1a1012){if(_0x1a1012){_0x399018=_0x1a1012;}return db[_0x4060('0x4c')][_0x4060('0x54')]({'where':{'id':_0x18314c[_0x4060('0x59')]['id']},'attributes':['logo',_0x4060('0x5e'),_0x4060('0x5f'),'favicon',_0x4060('0x61'),_0x4060('0x62'),_0x4060('0x71'),_0x4060('0x63')],'raw':!![]});})[_0x4060('0x1d')](handleEntityNotFound(_0x2be488,null))['then'](function(_0xf08c17){if(_0xf08c17){var _0x169d0c=_0xf08c17[_0x4060('0x5e')]&&fs[_0x4060('0x64')](path[_0x4060('0x65')](config[_0x4060('0x66')],_0x554401,_[_0x4060('0x67')](_0xf08c17[_0x4060('0x5e')])))?path['join'](config['root'],_0x554401,_[_0x4060('0x67')](_0xf08c17[_0x4060('0x5e')])):path[_0x4060('0x65')](config['root'],_0x554401,_['toLower'](_0x4060('0x72')));var _0xe595dd='default'+_[_0x4060('0x6a')](_0x4060('0x5e'));if(_0xf08c17[_0xe595dd]||!_0x399018[_0x4060('0x6b')]){_0x169d0c=path[_0x4060('0x65')](config[_0x4060('0x66')],_0x554401,_[_0x4060('0x67')](_0x4060('0x72')));}if(!fs[_0x4060('0x64')](_0x169d0c)){throw new db[(_0x4060('0x6c'))][(_0x4060('0x6d'))](_[_0x4060('0x6a')](_0x4060('0x5e'))+_0x4060('0x6e'));}return _0x2be488[_0x4060('0x6f')](_0x169d0c);}})[_0x4060('0x51')](handleError(_0x2be488,null));};exports[_0x4060('0x73')]=function(_0x2a5e8a,_0x46ee6e){return db[_0x4060('0x4c')]['find']({'where':{'id':_0x2a5e8a[_0x4060('0x59')]['id']},'attributes':[_0x4060('0x74')]})[_0x4060('0x1d')](respondWithResult(_0x46ee6e,null))['catch'](handleError(_0x46ee6e,null));};exports['addPreferred']=function(_0x3754b5,_0x3ddf6f,_0x23308f){if(_0x3754b5[_0x4060('0x56')]&&_0x3754b5[_0x4060('0x56')][_0x4060('0x57')]){_0x3754b5[_0x4060('0x53')][_0x4060('0x5f')]=_0x3754b5[_0x4060('0x56')][_0x4060('0x57')];}return db[_0x4060('0x4c')][_0x4060('0x54')]({'where':{'id':_0x3754b5[_0x4060('0x59')]['id']}})[_0x4060('0x1d')](handleEntityNotFound(_0x3ddf6f,null))[_0x4060('0x1d')](saveUpdates(_0x3754b5[_0x4060('0x53')],null))[_0x4060('0x1d')](respondWithResult(_0x3ddf6f,null))[_0x4060('0x51')](handleError(_0x3ddf6f,null));};var utilLicense=require(_0x4060('0x19'));exports[_0x4060('0x75')]=function(_0x5c3480,_0x58587e,_0x18e002){var _0xedb9d2='server/files/images/logos';var _0x1014a7={'custom':![]};return utilLicense[_0x4060('0x5d')]()['then'](function(_0x3400ff){if(_0x3400ff){_0x1014a7=_0x3400ff;}return db[_0x4060('0x4c')][_0x4060('0x54')]({'where':{'id':_0x5c3480[_0x4060('0x59')]['id']},'attributes':['logo','loginLogo',_0x4060('0x5f'),_0x4060('0x60'),'defaultLogo','defaultLoginLogo',_0x4060('0x71'),'defaultFavicon'],'raw':!![]});})[_0x4060('0x1d')](handleEntityNotFound(_0x58587e,null))[_0x4060('0x1d')](function(_0x54f679){if(_0x54f679){var _0x675096=_0x54f679[_0x4060('0x5f')]&&fs[_0x4060('0x64')](path[_0x4060('0x65')](config[_0x4060('0x66')],_0xedb9d2,_[_0x4060('0x67')](_0x54f679[_0x4060('0x5f')])))?path[_0x4060('0x65')](config[_0x4060('0x66')],_0xedb9d2,_[_0x4060('0x67')](_0x54f679[_0x4060('0x5f')])):path[_0x4060('0x65')](config[_0x4060('0x66')],_0xedb9d2,_[_0x4060('0x67')](_0x4060('0x76')));var _0x1cbb0b=_0x4060('0x69')+_[_0x4060('0x6a')](_0x4060('0x5f'));if(_0x54f679[_0x1cbb0b]||!_0x1014a7[_0x4060('0x6b')]||!_0x1014a7[_0x4060('0x5f')]){_0x675096=path['join'](config[_0x4060('0x66')],_0xedb9d2,_[_0x4060('0x67')](_0x4060('0x76')));}if(!fs[_0x4060('0x64')](_0x675096)){throw new db[(_0x4060('0x6c'))][(_0x4060('0x6d'))](_[_0x4060('0x6a')](_0x4060('0x5f'))+_0x4060('0x6e'));}return _0x58587e['download'](_0x675096);}})['catch'](handleError(_0x58587e,null));};exports[_0x4060('0x77')]=function(_0x19c8a0,_0x509ca9,_0x18034a){if(_0x19c8a0['file']&&_0x19c8a0[_0x4060('0x56')][_0x4060('0x57')]){_0x19c8a0[_0x4060('0x53')]['favicon']=_0x19c8a0[_0x4060('0x56')][_0x4060('0x57')];}return db[_0x4060('0x4c')][_0x4060('0x54')]({'where':{'id':_0x19c8a0[_0x4060('0x59')]['id']}})[_0x4060('0x1d')](handleEntityNotFound(_0x509ca9,null))[_0x4060('0x1d')](saveUpdates(_0x19c8a0[_0x4060('0x53')],null))[_0x4060('0x1d')](respondWithResult(_0x509ca9,null))[_0x4060('0x51')](handleError(_0x509ca9,null));};var utilLicense=require(_0x4060('0x19'));exports[_0x4060('0x78')]=function(_0x4b1831,_0x78e402,_0x4c3201){var _0x31ddd7=_0x4060('0x5c');var _0x2c6dda={'custom':![]};return utilLicense[_0x4060('0x5d')]()[_0x4060('0x1d')](function(_0x524df9){if(_0x524df9){_0x2c6dda=_0x524df9;}return db['Setting']['find']({'where':{'id':_0x4b1831[_0x4060('0x59')]['id']},'attributes':['logo',_0x4060('0x5e'),_0x4060('0x5f'),_0x4060('0x60'),_0x4060('0x61'),_0x4060('0x62'),_0x4060('0x71'),'defaultFavicon'],'raw':!![]});})[_0x4060('0x1d')](handleEntityNotFound(_0x78e402,null))['then'](function(_0x35b053){if(_0x35b053){var _0xea2ff4=_0x35b053['favicon']&&fs['existsSync'](path[_0x4060('0x65')](config[_0x4060('0x66')],_0x31ddd7,_[_0x4060('0x67')](_0x35b053[_0x4060('0x60')])))?path[_0x4060('0x65')](config[_0x4060('0x66')],_0x31ddd7,_[_0x4060('0x67')](_0x35b053[_0x4060('0x60')])):path[_0x4060('0x65')](config[_0x4060('0x66')],_0x31ddd7,_[_0x4060('0x67')](_0x4060('0x79')));var _0x3b049c='default'+_[_0x4060('0x6a')](_0x4060('0x60'));if(_0x35b053[_0x3b049c]||!_0x2c6dda[_0x4060('0x6b')]){_0xea2ff4=path[_0x4060('0x65')](config['root'],_0x31ddd7,_['toLower'](_0x4060('0x79')));}if(!fs['existsSync'](_0xea2ff4)){throw new db[(_0x4060('0x6c'))]['ValidationError'](_['upperFirst']('favicon')+_0x4060('0x6e'));}return _0x78e402[_0x4060('0x6f')](_0xea2ff4);}})[_0x4060('0x51')](handleError(_0x78e402,null));};exports[_0x4060('0x7a')]=function(_0x2a5ef4,_0x34486d){var _0x3dde0d={'offset':moment()[_0x4060('0x7b')]()};_0x3dde0d[_0x4060('0x7c')]=moment()[_0x4060('0x7b')](_0x3dde0d[_0x4060('0x2b')])[_0x4060('0x7d')](_0x4060('0x7e'));return _0x34486d['status'](0xc8)[_0x4060('0x37')](_0x3dde0d);}; \ No newline at end of file diff --git a/server/api/setting/setting.model.js b/server/api/setting/setting.model.js index 7c26dff..0c9c541 100644 --- a/server/api/setting/setting.model.js +++ b/server/api/setting/setting.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x008c=['define','settings','lodash','util','../../config/logger','api','moment','request-promise','path','rimraf','../../config/environment','./setting.attributes','exports'];(function(_0x58952f,_0xeed25f){var _0x3217ca=function(_0x3fda09){while(--_0x3fda09){_0x58952f['push'](_0x58952f['shift']());}};_0x3217ca(++_0xeed25f);}(_0x008c,0x188));var _0xc008=function(_0x49ca95,_0x50c62b){_0x49ca95=_0x49ca95-0x0;var _0x4699f9=_0x008c[_0x49ca95];return _0x4699f9;};'use strict';var _=require(_0xc008('0x0'));var util=require(_0xc008('0x1'));var logger=require(_0xc008('0x2'))(_0xc008('0x3'));var moment=require(_0xc008('0x4'));var BPromise=require('bluebird');var rp=require(_0xc008('0x5'));var fs=require('fs');var path=require(_0xc008('0x6'));var rimraf=require(_0xc008('0x7'));var config=require(_0xc008('0x8'));var attributes=require(_0xc008('0x9'));module[_0xc008('0xa')]=function(_0x13aa7,_0x39bb5e){return _0x13aa7[_0xc008('0xb')]('Setting',attributes,{'tableName':_0xc008('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x008c=['define','settings','lodash','util','../../config/logger','api','moment','request-promise','path','rimraf','../../config/environment','./setting.attributes','exports'];(function(_0xbc9917,_0x479324){var _0x20ab5a=function(_0x43951d){while(--_0x43951d){_0xbc9917['push'](_0xbc9917['shift']());}};_0x20ab5a(++_0x479324);}(_0x008c,0x188));var _0xc008=function(_0x7148a3,_0x1c6652){_0x7148a3=_0x7148a3-0x0;var _0x52f31d=_0x008c[_0x7148a3];return _0x52f31d;};'use strict';var _=require(_0xc008('0x0'));var util=require(_0xc008('0x1'));var logger=require(_0xc008('0x2'))(_0xc008('0x3'));var moment=require(_0xc008('0x4'));var BPromise=require('bluebird');var rp=require(_0xc008('0x5'));var fs=require('fs');var path=require(_0xc008('0x6'));var rimraf=require(_0xc008('0x7'));var config=require(_0xc008('0x8'));var attributes=require(_0xc008('0x9'));module[_0xc008('0xa')]=function(_0x13aa7,_0x39bb5e){return _0x13aa7[_0xc008('0xb')]('Setting',attributes,{'tableName':_0xc008('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/setting/setting.rpc.js b/server/api/setting/setting.rpc.js index 0c0948e..fb5de7d 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 _0x08b6=['moment','bluebird','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','then','info','Setting,\x20%s,\x20%s','request\x20sent','debug','Setting,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','ShowSetting','Setting','find','options','raw','where','attributes','include','map','model','catch','util'];(function(_0x288129,_0x4c92a4){var _0xd73f38=function(_0x37aa17){while(--_0x37aa17){_0x288129['push'](_0x288129['shift']());}};_0xd73f38(++_0x4c92a4);}(_0x08b6,0x128));var _0x608b=function(_0x22d841,_0x3df28a){_0x22d841=_0x22d841-0x0;var _0x23c8bf=_0x08b6[_0x22d841];return _0x23c8bf;};'use strict';var _=require('lodash');var util=require(_0x608b('0x0'));var moment=require(_0x608b('0x1'));var BPromise=require(_0x608b('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x608b('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x608b('0x4'));var logger=require(_0x608b('0x5'))(_0x608b('0x6'));var config=require(_0x608b('0x7'));var jayson=require(_0x608b('0x8'));var client=jayson['client'][_0x608b('0x9')]({'port':0x232a});function respondWithRpcPromise(_0xa7f0ca,_0x775fcc,_0x59a4b7){return new BPromise(function(_0x5e8156,_0x5f2090){return client[_0x608b('0xa')](_0xa7f0ca,_0x59a4b7)[_0x608b('0xb')](function(_0x14234a){logger[_0x608b('0xc')](_0x608b('0xd'),_0x775fcc,_0x608b('0xe'));logger[_0x608b('0xf')](_0x608b('0x10'),_0x775fcc,_0x608b('0xe'),JSON[_0x608b('0x11')](_0x14234a));if(_0x14234a[_0x608b('0x12')]){if(_0x14234a[_0x608b('0x12')][_0x608b('0x13')]===0x1f4){logger['error']('Setting,\x20%s,\x20%s',_0x775fcc,_0x14234a['error'][_0x608b('0x14')]);return _0x5f2090(_0x14234a[_0x608b('0x12')][_0x608b('0x14')]);}logger[_0x608b('0x12')](_0x608b('0xd'),_0x775fcc,_0x14234a[_0x608b('0x12')][_0x608b('0x14')]);return _0x5e8156(_0x14234a[_0x608b('0x12')][_0x608b('0x14')]);}else{logger[_0x608b('0xc')]('Setting,\x20%s,\x20%s',_0x775fcc,_0x608b('0xe'));_0x5e8156(_0x14234a[_0x608b('0x15')][_0x608b('0x14')]);}})['catch'](function(_0x10614d){logger[_0x608b('0x12')](_0x608b('0xd'),_0x775fcc,_0x10614d);_0x5f2090(_0x10614d);});});}exports[_0x608b('0x16')]=function(_0x572d4c){var _0x2ae5e4=this;return new Promise(function(_0x568fc2,_0x32e2f3){return db[_0x608b('0x17')][_0x608b('0x18')]({'raw':_0x572d4c[_0x608b('0x19')]?_0x572d4c[_0x608b('0x19')][_0x608b('0x1a')]===undefined?!![]:![]:!![],'where':_0x572d4c['options']?_0x572d4c[_0x608b('0x19')][_0x608b('0x1b')]||null:null,'attributes':_0x572d4c[_0x608b('0x19')]?_0x572d4c[_0x608b('0x19')][_0x608b('0x1c')]||null:null,'include':_0x572d4c[_0x608b('0x19')]?_0x572d4c[_0x608b('0x19')][_0x608b('0x1d')]?_[_0x608b('0x1e')](_0x572d4c['options'][_0x608b('0x1d')],function(_0x22c5dc){return{'model':db[_0x22c5dc['model']],'as':_0x22c5dc['as'],'attributes':_0x22c5dc[_0x608b('0x1c')],'include':_0x22c5dc[_0x608b('0x1d')]?_[_0x608b('0x1e')](_0x22c5dc[_0x608b('0x1d')],function(_0xd37004){return{'model':db[_0xd37004[_0x608b('0x1f')]],'as':_0xd37004['as'],'attributes':_0xd37004[_0x608b('0x1c')],'include':_0xd37004[_0x608b('0x1d')]?_[_0x608b('0x1e')](_0xd37004[_0x608b('0x1d')],function(_0x3edd79){return{'model':db[_0x3edd79['model']],'as':_0x3edd79['as'],'attributes':_0x3edd79[_0x608b('0x1c')]};}):[]};}):[]};}):[]:[]})[_0x608b('0xb')](function(_0x540adb){logger[_0x608b('0xc')](_0x608b('0x16'),_0x572d4c);logger[_0x608b('0xf')]('ShowSetting',_0x572d4c,JSON[_0x608b('0x11')](_0x540adb));_0x568fc2(_0x540adb);})[_0x608b('0x20')](function(_0x58a434){logger[_0x608b('0x12')]('ShowSetting',_0x58a434['message'],_0x572d4c);_0x32e2f3(_0x2ae5e4['error'](0x1f4,_0x58a434['message']));});});}; \ No newline at end of file +var _0x626b=['http','then','info','request\x20sent','debug','stringify','error','code','Setting,\x20%s,\x20%s','message','catch','Setting','find','options','raw','include','attributes','map','ShowSetting','lodash','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client'];(function(_0x1aafe,_0x4d7655){var _0x223eda=function(_0x212826){while(--_0x212826){_0x1aafe['push'](_0x1aafe['shift']());}};_0x223eda(++_0x4d7655);}(_0x626b,0x172));var _0xb626=function(_0xbeeb20,_0x381883){_0xbeeb20=_0xbeeb20-0x0;var _0x37a883=_0x626b[_0xbeeb20];return _0x37a883;};'use strict';var _=require(_0xb626('0x0'));var util=require('util');var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0xb626('0x1'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xb626('0x2'))['db'];var utils=require(_0xb626('0x3'));var logger=require(_0xb626('0x4'))(_0xb626('0x5'));var config=require(_0xb626('0x6'));var jayson=require('jayson/promise');var client=jayson[_0xb626('0x7')][_0xb626('0x8')]({'port':0x232a});function respondWithRpcPromise(_0xadeafc,_0x10ae2b,_0x4ffa01){return new BPromise(function(_0x2f8bbb,_0x2a6a70){return client['request'](_0xadeafc,_0x4ffa01)[_0xb626('0x9')](function(_0xeb8542){logger[_0xb626('0xa')]('Setting,\x20%s,\x20%s',_0x10ae2b,_0xb626('0xb'));logger[_0xb626('0xc')]('Setting,\x20%s,\x20%s,\x20%s',_0x10ae2b,'request\x20sent',JSON[_0xb626('0xd')](_0xeb8542));if(_0xeb8542[_0xb626('0xe')]){if(_0xeb8542[_0xb626('0xe')][_0xb626('0xf')]===0x1f4){logger['error'](_0xb626('0x10'),_0x10ae2b,_0xeb8542[_0xb626('0xe')][_0xb626('0x11')]);return _0x2a6a70(_0xeb8542[_0xb626('0xe')][_0xb626('0x11')]);}logger[_0xb626('0xe')]('Setting,\x20%s,\x20%s',_0x10ae2b,_0xeb8542[_0xb626('0xe')][_0xb626('0x11')]);return _0x2f8bbb(_0xeb8542[_0xb626('0xe')][_0xb626('0x11')]);}else{logger['info'](_0xb626('0x10'),_0x10ae2b,_0xb626('0xb'));_0x2f8bbb(_0xeb8542['result'][_0xb626('0x11')]);}})[_0xb626('0x12')](function(_0x530d5c){logger[_0xb626('0xe')](_0xb626('0x10'),_0x10ae2b,_0x530d5c);_0x2a6a70(_0x530d5c);});});}exports['ShowSetting']=function(_0x337209){var _0x290940=this;return new Promise(function(_0x52d5f3,_0xca0f27){return db[_0xb626('0x13')][_0xb626('0x14')]({'raw':_0x337209['options']?_0x337209[_0xb626('0x15')][_0xb626('0x16')]===undefined?!![]:![]:!![],'where':_0x337209[_0xb626('0x15')]?_0x337209[_0xb626('0x15')]['where']||null:null,'attributes':_0x337209['options']?_0x337209[_0xb626('0x15')]['attributes']||null:null,'include':_0x337209[_0xb626('0x15')]?_0x337209['options']['include']?_['map'](_0x337209[_0xb626('0x15')][_0xb626('0x17')],function(_0x5dc15a){return{'model':db[_0x5dc15a['model']],'as':_0x5dc15a['as'],'attributes':_0x5dc15a[_0xb626('0x18')],'include':_0x5dc15a[_0xb626('0x17')]?_[_0xb626('0x19')](_0x5dc15a[_0xb626('0x17')],function(_0x337803){return{'model':db[_0x337803['model']],'as':_0x337803['as'],'attributes':_0x337803['attributes'],'include':_0x337803[_0xb626('0x17')]?_[_0xb626('0x19')](_0x337803[_0xb626('0x17')],function(_0xde000){return{'model':db[_0xde000['model']],'as':_0xde000['as'],'attributes':_0xde000[_0xb626('0x18')]};}):[]};}):[]};}):[]:[]})[_0xb626('0x9')](function(_0x4721de){logger[_0xb626('0xa')](_0xb626('0x1a'),_0x337209);logger[_0xb626('0xc')](_0xb626('0x1a'),_0x337209,JSON['stringify'](_0x4721de));_0x52d5f3(_0x4721de);})[_0xb626('0x12')](function(_0x24d328){logger[_0xb626('0xe')](_0xb626('0x1a'),_0x24d328[_0xb626('0x11')],_0x337209);_0xca0f27(_0x290940[_0xb626('0xe')](0x1f4,_0x24d328['message']));});});}; \ No newline at end of file diff --git a/server/api/smsAccount/index.js b/server/api/smsAccount/index.js index bfd7b39..d8924db 100644 --- a/server/api/smsAccount/index.js +++ b/server/api/smsAccount/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x7a54=['getInteractions','/:id/status','statusGet','/:id/users','post','create','addAnswer','/:id/notify','notify','addApplications','send','status','addAgents','put','/:id','update','delete','destroy','/:id/canned_answers','removeAnswers','removeAgents','exports','multer','util','path','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./smsAccount.controller','get','index','/describe','isAuthenticated','/:id/dispositions','getDispositions','getAnswers','/:id/applications','getApplications'];(function(_0x480900,_0x27d4c2){var _0x209064=function(_0x3b6e53){while(--_0x3b6e53){_0x480900['push'](_0x480900['shift']());}};_0x209064(++_0x27d4c2);}(_0x7a54,0x106));var _0x47a5=function(_0x1da152,_0x3f1668){_0x1da152=_0x1da152-0x0;var _0xfaeaf1=_0x7a54[_0x1da152];return _0xfaeaf1;};'use strict';var multer=require(_0x47a5('0x0'));var util=require(_0x47a5('0x1'));var path=require(_0x47a5('0x2'));var timeout=require('connect-timeout');var express=require(_0x47a5('0x3'));var router=express[_0x47a5('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0x47a5('0x5'));var interaction=require(_0x47a5('0x6'));var config=require(_0x47a5('0x7'));var controller=require(_0x47a5('0x8'));router[_0x47a5('0x9')]('/',auth['isAuthenticated'](),controller[_0x47a5('0xa')]);router['get'](_0x47a5('0xb'),auth[_0x47a5('0xc')](),controller['describe']);router[_0x47a5('0x9')]('/:id',auth['isAuthenticated'](),controller['show']);router[_0x47a5('0x9')](_0x47a5('0xd'),auth['isAuthenticated'](),controller[_0x47a5('0xe')]);router['get']('/:id/canned_answers',auth[_0x47a5('0xc')](),controller[_0x47a5('0xf')]);router[_0x47a5('0x9')](_0x47a5('0x10'),auth[_0x47a5('0xc')](),controller[_0x47a5('0x11')]);router[_0x47a5('0x9')]('/:id/interactions',auth[_0x47a5('0xc')](),controller[_0x47a5('0x12')]);router[_0x47a5('0x9')](_0x47a5('0x13'),controller[_0x47a5('0x14')]);router[_0x47a5('0x9')](_0x47a5('0x15'),auth[_0x47a5('0xc')](),controller['getAgents']);router[_0x47a5('0x16')]('/',auth[_0x47a5('0xc')](),controller[_0x47a5('0x17')]);router[_0x47a5('0x16')](_0x47a5('0xd'),auth['isAuthenticated'](),controller['addDisposition']);router[_0x47a5('0x16')]('/:id/canned_answers',auth['isAuthenticated'](),controller[_0x47a5('0x18')]);router[_0x47a5('0x16')](_0x47a5('0x19'),controller[_0x47a5('0x1a')]);router[_0x47a5('0x16')](_0x47a5('0x10'),auth[_0x47a5('0xc')](),controller[_0x47a5('0x1b')]);router[_0x47a5('0x16')]('/:id/send',auth[_0x47a5('0xc')](),controller[_0x47a5('0x1c')]);router['post'](_0x47a5('0x13'),controller[_0x47a5('0x1d')]);router[_0x47a5('0x16')]('/:id/users',auth[_0x47a5('0xc')](),controller[_0x47a5('0x1e')]);router[_0x47a5('0x1f')](_0x47a5('0x20'),auth['isAuthenticated'](),controller[_0x47a5('0x21')]);router[_0x47a5('0x22')]('/:id',auth[_0x47a5('0xc')](),controller[_0x47a5('0x23')]);router[_0x47a5('0x22')](_0x47a5('0xd'),auth[_0x47a5('0xc')](),controller['removeDispositions']);router['delete'](_0x47a5('0x24'),auth['isAuthenticated'](),controller[_0x47a5('0x25')]);router['delete'](_0x47a5('0x15'),auth[_0x47a5('0xc')](),controller[_0x47a5('0x26')]);module[_0x47a5('0x27')]=router; \ No newline at end of file +var _0x9957=['getInteractions','statusGet','/:id/users','getAgents','post','create','addDisposition','/:id/canned_answers','addAnswer','addApplications','/:id/status','status','addAgents','/:id','update','delete','destroy','removeDispositions','removeAnswers','removeAgents','exports','multer','util','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./smsAccount.controller','get','isAuthenticated','index','/describe','describe','show','/:id/dispositions','getDispositions','getAnswers','/:id/applications','getApplications','/:id/interactions'];(function(_0x3541f6,_0x2e5e9f){var _0x108803=function(_0x4ebbd6){while(--_0x4ebbd6){_0x3541f6['push'](_0x3541f6['shift']());}};_0x108803(++_0x2e5e9f);}(_0x9957,0x93));var _0x7995=function(_0x1ac595,_0x5d2081){_0x1ac595=_0x1ac595-0x0;var _0x455fff=_0x9957[_0x1ac595];return _0x455fff;};'use strict';var multer=require(_0x7995('0x0'));var util=require(_0x7995('0x1'));var path=require(_0x7995('0x2'));var timeout=require(_0x7995('0x3'));var express=require('express');var router=express[_0x7995('0x4')]();var fs_extra=require(_0x7995('0x5'));var auth=require(_0x7995('0x6'));var interaction=require(_0x7995('0x7'));var config=require('../../config/environment');var controller=require(_0x7995('0x8'));router[_0x7995('0x9')]('/',auth[_0x7995('0xa')](),controller[_0x7995('0xb')]);router[_0x7995('0x9')](_0x7995('0xc'),auth['isAuthenticated'](),controller[_0x7995('0xd')]);router[_0x7995('0x9')]('/:id',auth[_0x7995('0xa')](),controller[_0x7995('0xe')]);router[_0x7995('0x9')](_0x7995('0xf'),auth[_0x7995('0xa')](),controller[_0x7995('0x10')]);router[_0x7995('0x9')]('/:id/canned_answers',auth[_0x7995('0xa')](),controller[_0x7995('0x11')]);router['get'](_0x7995('0x12'),auth[_0x7995('0xa')](),controller[_0x7995('0x13')]);router[_0x7995('0x9')](_0x7995('0x14'),auth[_0x7995('0xa')](),controller[_0x7995('0x15')]);router['get']('/:id/status',controller[_0x7995('0x16')]);router[_0x7995('0x9')](_0x7995('0x17'),auth[_0x7995('0xa')](),controller[_0x7995('0x18')]);router[_0x7995('0x19')]('/',auth[_0x7995('0xa')](),controller[_0x7995('0x1a')]);router['post'](_0x7995('0xf'),auth['isAuthenticated'](),controller[_0x7995('0x1b')]);router[_0x7995('0x19')](_0x7995('0x1c'),auth[_0x7995('0xa')](),controller[_0x7995('0x1d')]);router[_0x7995('0x19')]('/:id/notify',controller['notify']);router[_0x7995('0x19')]('/:id/applications',auth['isAuthenticated'](),controller[_0x7995('0x1e')]);router[_0x7995('0x19')]('/:id/send',auth[_0x7995('0xa')](),controller['send']);router['post'](_0x7995('0x1f'),controller[_0x7995('0x20')]);router[_0x7995('0x19')](_0x7995('0x17'),auth[_0x7995('0xa')](),controller[_0x7995('0x21')]);router['put'](_0x7995('0x22'),auth[_0x7995('0xa')](),controller[_0x7995('0x23')]);router[_0x7995('0x24')](_0x7995('0x22'),auth[_0x7995('0xa')](),controller[_0x7995('0x25')]);router[_0x7995('0x24')]('/:id/dispositions',auth[_0x7995('0xa')](),controller[_0x7995('0x26')]);router[_0x7995('0x24')](_0x7995('0x1c'),auth[_0x7995('0xa')](),controller[_0x7995('0x27')]);router['delete'](_0x7995('0x17'),auth['isAuthenticated'](),controller[_0x7995('0x28')]);module[_0x7995('0x29')]=router; \ No newline at end of file diff --git a/server/api/smsAccount/smsAccount.attributes.js b/server/api/smsAccount/smsAccount.attributes.js index 174944f..a5a67a7 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 _0x2133=['INTEGER','Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled','setDataValue','mandatoryDisposition','sequelize','randomstring','exports','name','STRING','ENUM','skebby','connectel','clicksend','clickatell','intelepeer','BOOLEAN','TEXT','Account:\x20{{account.name}}
{{#queue}}Queue:\x20{{queue.name}}
{{/queue}}From\x20:\x20{{from}}'];(function(_0x4baae2,_0x487ab6){var _0x1a2285=function(_0x1cea47){while(--_0x1cea47){_0x4baae2['push'](_0x4baae2['shift']());}};_0x1a2285(++_0x487ab6);}(_0x2133,0x190));var _0x3213=function(_0x19571f,_0x15a027){_0x19571f=_0x19571f-0x0;var _0x328708=_0x2133[_0x19571f];return _0x328708;};'use strict';var Sequelize=require(_0x3213('0x0'));var rs=require(_0x3213('0x1'));module[_0x3213('0x2')]={'name':{'type':Sequelize['STRING'],'unique':_0x3213('0x3'),'allowNull':![]},'key':{'type':Sequelize[_0x3213('0x4')],'allowNull':![]},'remote':{'type':Sequelize[_0x3213('0x4')],'allowNull':![]},'token':{'type':Sequelize[_0x3213('0x4')],'defaultValue':function(){return rs['generate']();}},'phone':{'type':Sequelize['STRING']},'type':{'type':Sequelize[_0x3213('0x5')]('twilio',_0x3213('0x6'),_0x3213('0x7'),_0x3213('0x8'),'plivo',_0x3213('0x9'),'bandwidth','csc','infobip',_0x3213('0xa'))},'accountSid':{'type':Sequelize[_0x3213('0x4')]},'authId':{'type':Sequelize['STRING']},'authToken':{'type':Sequelize[_0x3213('0x4')]},'smsMethod':{'type':Sequelize[_0x3213('0x5')]('SI','TI','GP')},'username':{'type':Sequelize[_0x3213('0x4')]},'password':{'type':Sequelize[_0x3213('0x4')]},'apiKey':{'type':Sequelize['STRING']},'applicationId':{'type':Sequelize['STRING']},'accountId':{'type':Sequelize[_0x3213('0x4')]},'senderString':{'type':Sequelize[_0x3213('0x4')]},'deliveryReport':{'type':Sequelize[_0x3213('0xb')],'defaultValue':![]},'description':{'type':Sequelize[_0x3213('0x4')]},'notificationTemplate':{'type':Sequelize[_0x3213('0xc')],'defaultValue':function(){return _0x3213('0xd');}},'notificationSound':{'type':Sequelize[_0x3213('0xb')],'defaultValue':!![]},'notificationShake':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'waitForTheAssignedAgent':{'type':Sequelize[_0x3213('0xe')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'waitForTheAssignedQueue':{'type':Sequelize[_0x3213('0xe')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'queueTransfer':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize[_0x3213('0xe')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize[_0x3213('0xb')],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize[_0x3213('0xe')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'baseUrl':{'type':Sequelize[_0x3213('0x4')]},'mandatoryDispositionPauseId':{'type':Sequelize[_0x3213('0xe')],'comment':_0x3213('0xf')},'mandatoryDisposition':{'type':Sequelize[_0x3213('0xb')],'defaultValue':![],'comment':'Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','set':function(_0x341aa3){if(!_0x341aa3)this[_0x3213('0x10')]('mandatoryDispositionPauseId',null);this[_0x3213('0x10')](_0x3213('0x11'),_0x341aa3);}}}; \ No newline at end of file +var _0x758c=['bandwidth','csc','infobip','intelepeer','BOOLEAN','Account:\x20{{account.name}}
{{#queue}}Queue:\x20{{queue.name}}
{{/queue}}From\x20:\x20{{from}}','INTEGER','setDataValue','randomstring','exports','STRING','name','generate','ENUM','twilio','skebby','clicksend','clickatell'];(function(_0x3598bb,_0x24befa){var _0x13c837=function(_0x3de578){while(--_0x3de578){_0x3598bb['push'](_0x3598bb['shift']());}};_0x13c837(++_0x24befa);}(_0x758c,0x128));var _0xc758=function(_0x6baaca,_0x1b3694){_0x6baaca=_0x6baaca-0x0;var _0xb6735b=_0x758c[_0x6baaca];return _0xb6735b;};'use strict';var Sequelize=require('sequelize');var rs=require(_0xc758('0x0'));module[_0xc758('0x1')]={'name':{'type':Sequelize[_0xc758('0x2')],'unique':_0xc758('0x3'),'allowNull':![]},'key':{'type':Sequelize[_0xc758('0x2')],'allowNull':![]},'remote':{'type':Sequelize[_0xc758('0x2')],'allowNull':![]},'token':{'type':Sequelize['STRING'],'defaultValue':function(){return rs[_0xc758('0x4')]();}},'phone':{'type':Sequelize[_0xc758('0x2')]},'type':{'type':Sequelize[_0xc758('0x5')](_0xc758('0x6'),_0xc758('0x7'),'connectel',_0xc758('0x8'),'plivo',_0xc758('0x9'),_0xc758('0xa'),_0xc758('0xb'),_0xc758('0xc'),_0xc758('0xd'))},'accountSid':{'type':Sequelize[_0xc758('0x2')]},'authId':{'type':Sequelize[_0xc758('0x2')]},'authToken':{'type':Sequelize['STRING']},'smsMethod':{'type':Sequelize[_0xc758('0x5')]('SI','TI','GP')},'username':{'type':Sequelize['STRING']},'password':{'type':Sequelize['STRING']},'apiKey':{'type':Sequelize['STRING']},'applicationId':{'type':Sequelize[_0xc758('0x2')]},'accountId':{'type':Sequelize[_0xc758('0x2')]},'senderString':{'type':Sequelize[_0xc758('0x2')]},'deliveryReport':{'type':Sequelize[_0xc758('0xe')],'defaultValue':![]},'description':{'type':Sequelize[_0xc758('0x2')]},'notificationTemplate':{'type':Sequelize['TEXT'],'defaultValue':function(){return _0xc758('0xf');}},'notificationSound':{'type':Sequelize[_0xc758('0xe')],'defaultValue':!![]},'notificationShake':{'type':Sequelize[_0xc758('0xe')],'defaultValue':![]},'waitForTheAssignedAgent':{'type':Sequelize[_0xc758('0x10')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'waitForTheAssignedQueue':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'queueTransfer':{'type':Sequelize[_0xc758('0xe')],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize[_0xc758('0x10')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize[_0xc758('0xe')],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize[_0xc758('0x10')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'baseUrl':{'type':Sequelize['STRING']},'mandatoryDispositionPauseId':{'type':Sequelize[_0xc758('0x10')],'comment':'Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled'},'mandatoryDisposition':{'type':Sequelize[_0xc758('0xe')],'defaultValue':![],'comment':'Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','set':function(_0x4243f3){if(!_0x4243f3)this['setDataValue']('mandatoryDispositionPauseId',null);this[_0xc758('0x11')]('mandatoryDisposition',_0x4243f3);}}}; \ No newline at end of file diff --git a/server/api/smsAccount/smsAccount.controller.js b/server/api/smsAccount/smsAccount.controller.js index 0fb34a8..e5d8ed9 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 _0xf969=['Tag','Tags','color','tag','List','user','out','Messages','dataValues','push','inspect','skebby_dispatch_id','requestid','statusInt','status_code','DELIVERED','groupName','redif','infobip','DELIVERED_TO_GATEWAY','message-delivered','DELIVRD','ACCEPTD','statusGet','received\x20delivery\x20report\x20from','message-id','addAgents','emit','userSmsAccount:save','removeAgents','isArray','userSmsAccount:remove','getAgents','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','path','sox','to-csv','lodash','jsforce','desk.js','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/license/util','../../mysqldb','redis','localhost','socket.io-emitter','register','jayson/promise','client','http','request','then','request\x20sent','SmsAccount,\x20%s,\x20%s,\x20%s','stringify','error','SmsAccount,\x20%s,\x20%s','message','info','catch','status','end','offset','undefined','limit','count','json','apply','update','destroy','UserProfileResource','sendStatus','name','send','index','mandatoryDispositionPause','SmsAccount','rawAttributes','fieldName','type','key','model','map','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','pick','filter','where','merge','VIRTUAL','options','include','findAll','rows','Pause','create','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','get','SmsAccounts','UserProfileSection','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','find','params','describe','addDisposition','SmsAccountId','Disposition','findOne','includeAll','ids','addAnswer','getAnswers','CannedAnswer','removeAnswers','notify','SmsApplication','account','applications','orderBy','Applications','priority','asc','CmContact','Sequelize','ValidationError','no\x20available\x20attributes','difference','updatedAt','createdAt','CompanyId','ListId','mobile','twilio','from','Body','messageId','MessageSid','skebby','sender','text','connectel','clicksend','message_id','plivo','From','MessageUUID','results','csc','originatingAddress','segmentedMessage','clickatell','fromNumber','replyMessageId','bandwidth','intelepeer','refid','isNil','from\x20is\x20mandatory','body\x20is\x20mandatory\x20and\x20not\x20empty','mapKey','mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','includes','CmList','DESC','list','omit','Contacts','defaults','contact','SmsInteraction','spread','interaction','autoclose','close','unmanaged','*,*,*,*','created','SmsMessage','ContactId','AttachmentId','UserId','User','unshift','agent','SmsQueue','queueId','queue','waitForTheAssignedQueue','Start','startRouting','receiveMessage','debug','SmsAccount,\x20%s,\x20%s,\x20%s,\x20%s','text/xml','\x0a','addApplications','transaction','Transaction','ISOLATION_LEVELS','READ_COMMITTED','getApplications','getInteractions','Contact','fullname'];(function(_0x4de4d5,_0x273848){var _0xe3db20=function(_0x5423f5){while(--_0x5423f5){_0x4de4d5['push'](_0x4de4d5['shift']());}};_0xe3db20(++_0x273848);}(_0xf969,0x1eb));var _0x9f96=function(_0x3588d0,_0x50cbb8){_0x3588d0=_0x3588d0-0x0;var _0xc3897f=_0xf969[_0x3588d0];return _0xc3897f;};'use strict';var emlformat=require(_0x9f96('0x0'));var rimraf=require(_0x9f96('0x1'));var zipdir=require(_0x9f96('0x2'));var jsonpatch=require(_0x9f96('0x3'));var rp=require(_0x9f96('0x4'));var moment=require(_0x9f96('0x5'));var BPromise=require(_0x9f96('0x6'));var Mustache=require('mustache');var util=require(_0x9f96('0x7'));var path=require(_0x9f96('0x8'));var sox=require(_0x9f96('0x9'));var csv=require(_0x9f96('0xa'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x9f96('0xb'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0x9f96('0xc'));var deskjs=require(_0x9f96('0xd'));var toCsv=require(_0x9f96('0xa'));var querystring=require('querystring');var Papa=require(_0x9f96('0xe'));var Redis=require(_0x9f96('0xf'));var authService=require('../../components/auth/service');var qs=require(_0x9f96('0x10'));var as=require(_0x9f96('0x11'));var hardwareService=require(_0x9f96('0x12'));var logger=require('../../config/logger')(_0x9f96('0x13'));var utils=require(_0x9f96('0x14'));var config=require('../../config/environment');var licenseUtil=require(_0x9f96('0x15'));var db=require(_0x9f96('0x16'))['db'];config[_0x9f96('0x17')]=_['defaults'](config[_0x9f96('0x17')],{'host':_0x9f96('0x18'),'port':0x18eb});var socket=require(_0x9f96('0x19'))(new Redis(config['redis']));require('./smsAccount.socket')[_0x9f96('0x1a')](socket);var jayson=require(_0x9f96('0x1b'));var client=jayson[_0x9f96('0x1c')][_0x9f96('0x1d')]({'port':0x232c});function respondWithRpcPromise(_0x8621aa,_0x2a0695,_0x3bd690,_0x57b494){return new BPromise(function(_0x1b15f3,_0x550016){var _0x185206=_0x57b494||client;return _0x185206[_0x9f96('0x1e')](_0x8621aa,_0x3bd690)[_0x9f96('0x1f')](function(_0x4cc22e){logger['info']('SmsAccount,\x20%s,\x20%s',_0x2a0695,_0x9f96('0x20'));logger['debug'](_0x9f96('0x21'),_0x2a0695,_0x9f96('0x20'),JSON[_0x9f96('0x22')](_0x4cc22e));if(_0x4cc22e[_0x9f96('0x23')]){if(_0x4cc22e[_0x9f96('0x23')]['code']===0x1f4){logger['error'](_0x9f96('0x24'),_0x2a0695,_0x4cc22e['error'][_0x9f96('0x25')]);return _0x550016(_0x4cc22e[_0x9f96('0x23')][_0x9f96('0x25')]);}logger[_0x9f96('0x23')](_0x9f96('0x24'),_0x2a0695,_0x4cc22e[_0x9f96('0x23')][_0x9f96('0x25')]);return _0x1b15f3(_0x4cc22e[_0x9f96('0x23')][_0x9f96('0x25')]);}else{logger[_0x9f96('0x26')](_0x9f96('0x24'),_0x2a0695,_0x9f96('0x20'));_0x1b15f3(_0x4cc22e['result'][_0x9f96('0x25')]);}})[_0x9f96('0x27')](function(_0x5a1e38){logger[_0x9f96('0x23')](_0x9f96('0x24'),_0x2a0695,_0x5a1e38);_0x550016(_0x5a1e38);});});}function respondWithStatusCode(_0x2e7dac,_0x171eb7){_0x171eb7=_0x171eb7||0xcc;return function(_0xd6753c){if(_0xd6753c){return _0x2e7dac['sendStatus'](_0x171eb7);}return _0x2e7dac[_0x9f96('0x28')](_0x171eb7)[_0x9f96('0x29')]();};}function respondWithResult(_0xfe8cae,_0x3bc12b){_0x3bc12b=_0x3bc12b||0xc8;return function(_0x23d5d4){if(_0x23d5d4){return _0xfe8cae[_0x9f96('0x28')](_0x3bc12b)['json'](_0x23d5d4);}};}function respondWithFilteredResult(_0x45ea7d,_0x5e3d4b){return function(_0xd677de){if(_0xd677de){var _0x597733=typeof _0x5e3d4b[_0x9f96('0x2a')]===_0x9f96('0x2b')&&typeof _0x5e3d4b[_0x9f96('0x2c')]===_0x9f96('0x2b');var _0x1df39b=_0xd677de[_0x9f96('0x2d')];var _0x5e153a=_0x597733?0x0:_0x5e3d4b[_0x9f96('0x2a')];var _0x2c1509=_0x597733?_0xd677de[_0x9f96('0x2d')]:_0x5e3d4b[_0x9f96('0x2a')]+_0x5e3d4b[_0x9f96('0x2c')];var _0x18a272;if(_0x2c1509>=_0x1df39b){_0x2c1509=_0x1df39b;_0x18a272=0xc8;}else{_0x18a272=0xce;}_0x45ea7d['status'](_0x18a272);return _0x45ea7d['set']('Content-Range',_0x5e153a+'-'+_0x2c1509+'/'+_0x1df39b)[_0x9f96('0x2e')](_0xd677de);}return null;};}function patchUpdates(_0x40b196){return function(_0x263bf7){try{jsonpatch[_0x9f96('0x2f')](_0x263bf7,_0x40b196,!![]);}catch(_0x51b194){return BPromise['reject'](_0x51b194);}return _0x263bf7['save']();};}function saveUpdates(_0x5c5085,_0x33168f){return function(_0x34981a){if(_0x34981a){return _0x34981a[_0x9f96('0x30')](_0x5c5085)[_0x9f96('0x1f')](function(_0x1d62ef){return _0x1d62ef;});}return null;};}function removeEntity(_0x3df00a,_0x17350f){return function(_0x16b6e4){if(_0x16b6e4){return _0x16b6e4[_0x9f96('0x31')]()[_0x9f96('0x1f')](function(){var _0x495ff7=_0x16b6e4['get']({'plain':!![]});var _0x5356bc='SmsAccounts';return db[_0x9f96('0x32')][_0x9f96('0x31')]({'where':{'type':_0x5356bc,'resourceId':_0x495ff7['id']}})[_0x9f96('0x1f')](function(){return _0x16b6e4;});})[_0x9f96('0x1f')](function(){_0x3df00a[_0x9f96('0x28')](0xcc)[_0x9f96('0x29')]();});}};}function handleEntityNotFound(_0x593271,_0x220810){return function(_0x486fa8){if(!_0x486fa8){_0x593271[_0x9f96('0x33')](0x194);}return _0x486fa8;};}function handleError(_0x117914,_0x4d05e0){_0x4d05e0=_0x4d05e0||0x1f4;return function(_0x3e683b){logger[_0x9f96('0x23')](_0x3e683b['stack']);if(_0x3e683b[_0x9f96('0x34')]){delete _0x3e683b[_0x9f96('0x34')];}_0x117914[_0x9f96('0x28')](_0x4d05e0)[_0x9f96('0x35')](_0x3e683b);};}exports[_0x9f96('0x36')]=function(_0x2fc1be,_0x5672c0){var _0x48953b={'include':[{'model':db['Pause'],'as':_0x9f96('0x37')}]},_0x729e33={},_0x4e9d97={'count':0x0,'rows':[]};var _0x5d47af=_['map'](db[_0x9f96('0x38')][_0x9f96('0x39')],function(_0x40f97b){return{'name':_0x40f97b[_0x9f96('0x3a')],'type':_0x40f97b[_0x9f96('0x3b')][_0x9f96('0x3c')]};});_0x729e33[_0x9f96('0x3d')]=_[_0x9f96('0x3e')](_0x5d47af,'name');_0x729e33[_0x9f96('0x3f')]=_[_0x9f96('0x40')](_0x2fc1be[_0x9f96('0x3f')]);_0x729e33[_0x9f96('0x41')]=_[_0x9f96('0x42')](_0x729e33['model'],_0x729e33[_0x9f96('0x3f')]);_0x48953b[_0x9f96('0x43')]=_[_0x9f96('0x42')](_0x729e33[_0x9f96('0x3d')],qs[_0x9f96('0x44')](_0x2fc1be[_0x9f96('0x3f')][_0x9f96('0x44')]));_0x48953b[_0x9f96('0x43')]=_0x48953b[_0x9f96('0x43')][_0x9f96('0x45')]?_0x48953b[_0x9f96('0x43')]:_0x729e33[_0x9f96('0x3d')];if(!_0x2fc1be[_0x9f96('0x3f')][_0x9f96('0x46')](_0x9f96('0x47'))){_0x48953b[_0x9f96('0x2c')]=qs[_0x9f96('0x2c')](_0x2fc1be[_0x9f96('0x3f')][_0x9f96('0x2c')]);_0x48953b[_0x9f96('0x2a')]=qs[_0x9f96('0x2a')](_0x2fc1be[_0x9f96('0x3f')][_0x9f96('0x2a')]);}_0x48953b[_0x9f96('0x48')]=qs[_0x9f96('0x49')](_0x2fc1be['query'][_0x9f96('0x49')]);_0x48953b['where']=qs['filters'](_[_0x9f96('0x4a')](_0x2fc1be[_0x9f96('0x3f')],_0x729e33[_0x9f96('0x41')]),_0x5d47af);if(_0x2fc1be[_0x9f96('0x3f')][_0x9f96('0x4b')]){_0x48953b[_0x9f96('0x4c')]=_[_0x9f96('0x4d')](_0x48953b[_0x9f96('0x4c')],{'$or':_[_0x9f96('0x3e')](_0x5d47af,function(_0x16cd16){if(_0x16cd16[_0x9f96('0x3b')]!==_0x9f96('0x4e')){var _0x2f9daa={};_0x2f9daa[_0x16cd16['name']]={'$like':'%'+_0x2fc1be['query']['filter']+'%'};return _0x2f9daa;}})});}_0x48953b=_['merge']({},_0x48953b,_0x2fc1be[_0x9f96('0x4f')]);var _0x4b8715={'where':_0x48953b['where']};return db[_0x9f96('0x38')]['count'](_0x4b8715)[_0x9f96('0x1f')](function(_0x4d7a08){_0x4e9d97[_0x9f96('0x2d')]=_0x4d7a08;if(_0x2fc1be[_0x9f96('0x3f')]['includeAll']){_0x48953b[_0x9f96('0x50')]=[{'all':!![]}];}return db['SmsAccount'][_0x9f96('0x51')](_0x48953b);})['then'](function(_0x43dc03){_0x4e9d97[_0x9f96('0x52')]=_0x43dc03;return _0x4e9d97;})[_0x9f96('0x1f')](respondWithFilteredResult(_0x5672c0,_0x48953b))[_0x9f96('0x27')](handleError(_0x5672c0,null));};exports['show']=function(_0x669286,_0x2c6e68){var _0x29878e={'raw':![],'where':{'id':_0x669286['params']['id']},'include':[{'model':db[_0x9f96('0x53')],'as':_0x9f96('0x37')}]},_0x3e70d5={};_0x3e70d5[_0x9f96('0x3d')]=_[_0x9f96('0x40')](db[_0x9f96('0x38')][_0x9f96('0x39')]);_0x3e70d5[_0x9f96('0x3f')]=_[_0x9f96('0x40')](_0x669286[_0x9f96('0x3f')]);_0x3e70d5[_0x9f96('0x41')]=_[_0x9f96('0x42')](_0x3e70d5['model'],_0x3e70d5[_0x9f96('0x3f')]);_0x29878e['attributes']=_[_0x9f96('0x42')](_0x3e70d5[_0x9f96('0x3d')],qs['fields'](_0x669286[_0x9f96('0x3f')][_0x9f96('0x44')]));_0x29878e[_0x9f96('0x43')]=_0x29878e[_0x9f96('0x43')]['length']?_0x29878e[_0x9f96('0x43')]:_0x3e70d5[_0x9f96('0x3d')];if(_0x669286[_0x9f96('0x3f')]['includeAll']){_0x29878e[_0x9f96('0x50')]=[{'all':!![]}];}_0x29878e=_[_0x9f96('0x4d')]({},_0x29878e,_0x669286['options']);return db[_0x9f96('0x38')]['find'](_0x29878e)[_0x9f96('0x1f')](handleEntityNotFound(_0x2c6e68,null))['then'](respondWithResult(_0x2c6e68,null))[_0x9f96('0x27')](handleError(_0x2c6e68,null));};exports[_0x9f96('0x54')]=function(_0x109b85,_0x4e8eda){return db[_0x9f96('0x38')]['create'](_0x109b85['body'],{})[_0x9f96('0x1f')](function(_0x3d6cdd){var _0x261d72=_0x109b85['user']['get']({'plain':!![]});if(!_0x261d72)throw new Error(_0x9f96('0x55'));if(_0x261d72[_0x9f96('0x56')]==='user'){var _0x403cf3=_0x3d6cdd[_0x9f96('0x57')]({'plain':!![]});var _0x23298b=_0x9f96('0x58');return db[_0x9f96('0x59')]['find']({'where':{'name':_0x23298b,'userProfileId':_0x261d72['userProfileId']},'raw':!![]})['then'](function(_0x2b3b3e){if(_0x2b3b3e&&_0x2b3b3e[_0x9f96('0x5a')]===0x0){return db[_0x9f96('0x32')][_0x9f96('0x54')]({'name':_0x403cf3[_0x9f96('0x34')],'resourceId':_0x403cf3['id'],'type':_0x2b3b3e['name'],'sectionId':_0x2b3b3e['id']},{})[_0x9f96('0x1f')](function(){return _0x3d6cdd;});}else{return _0x3d6cdd;}})[_0x9f96('0x27')](function(_0x5584ef){logger[_0x9f96('0x23')](_0x9f96('0x5b'),_0x5584ef);throw _0x5584ef;});}return _0x3d6cdd;})['then'](respondWithResult(_0x4e8eda,0xc9))[_0x9f96('0x27')](handleError(_0x4e8eda,null));};exports[_0x9f96('0x30')]=function(_0x2e79a4,_0x5592af){if(_0x2e79a4[_0x9f96('0x5c')]['id']){delete _0x2e79a4[_0x9f96('0x5c')]['id'];}return db['SmsAccount'][_0x9f96('0x5d')]({'where':{'id':_0x2e79a4[_0x9f96('0x5e')]['id']},'include':[{'model':db[_0x9f96('0x53')],'as':_0x9f96('0x37')}]})[_0x9f96('0x1f')](handleEntityNotFound(_0x5592af,null))[_0x9f96('0x1f')](saveUpdates(_0x2e79a4['body'],null))['then'](respondWithResult(_0x5592af,null))[_0x9f96('0x27')](handleError(_0x5592af,null));};exports[_0x9f96('0x31')]=function(_0x439ac7,_0x1df2d4){return db[_0x9f96('0x38')][_0x9f96('0x5d')]({'where':{'id':_0x439ac7[_0x9f96('0x5e')]['id']}})[_0x9f96('0x1f')](handleEntityNotFound(_0x1df2d4,null))[_0x9f96('0x1f')](removeEntity(_0x1df2d4,null))[_0x9f96('0x27')](handleError(_0x1df2d4,null));};exports['describe']=function(_0x5e0dd8,_0x29aed2){return db[_0x9f96('0x38')][_0x9f96('0x5f')]()[_0x9f96('0x1f')](respondWithResult(_0x29aed2,null))[_0x9f96('0x27')](handleError(_0x29aed2,null));};exports[_0x9f96('0x60')]=function(_0x293b24,_0x4c4ba5,_0x209e9a){if(_0x293b24['body']['id']){delete _0x293b24[_0x9f96('0x5c')]['id'];}return db['SmsAccount'][_0x9f96('0x5d')]({'where':{'id':_0x293b24[_0x9f96('0x5e')]['id']}})[_0x9f96('0x1f')](handleEntityNotFound(_0x4c4ba5,null))[_0x9f96('0x1f')](function(_0x4636ee){if(_0x4636ee){_0x293b24[_0x9f96('0x5c')][_0x9f96('0x61')]=_0x4636ee['id'];return db[_0x9f96('0x62')][_0x9f96('0x54')](_0x293b24[_0x9f96('0x5c')]);}})[_0x9f96('0x1f')](respondWithResult(_0x4c4ba5,null))[_0x9f96('0x27')](handleError(_0x4c4ba5,null));};exports['getDispositions']=function(_0x3f0974,_0x325fc7,_0x6e3a87){var _0x5da913={'raw':![],'where':{}};var _0x4f7d2f={};var _0x469517={'count':0x0,'rows':[]};return db[_0x9f96('0x38')][_0x9f96('0x63')]({'where':{'id':_0x3f0974[_0x9f96('0x5e')]['id']}})['then'](handleEntityNotFound(_0x325fc7,null))[_0x9f96('0x1f')](function(_0x21b3bd){if(_0x21b3bd){_0x4f7d2f[_0x9f96('0x3d')]=_[_0x9f96('0x40')](db[_0x9f96('0x62')][_0x9f96('0x39')]);_0x4f7d2f[_0x9f96('0x3f')]=_[_0x9f96('0x40')](_0x3f0974['query']);_0x4f7d2f[_0x9f96('0x41')]=_['intersection'](_0x4f7d2f[_0x9f96('0x3d')],_0x4f7d2f[_0x9f96('0x3f')]);_0x5da913[_0x9f96('0x43')]=_[_0x9f96('0x42')](_0x4f7d2f[_0x9f96('0x3d')],qs['fields'](_0x3f0974[_0x9f96('0x3f')]['fields']));_0x5da913['attributes']=_0x5da913[_0x9f96('0x43')]['length']?_0x5da913[_0x9f96('0x43')]:_0x4f7d2f[_0x9f96('0x3d')];if(!_0x3f0974[_0x9f96('0x3f')][_0x9f96('0x46')](_0x9f96('0x47'))){_0x5da913[_0x9f96('0x2c')]=qs['limit'](_0x3f0974[_0x9f96('0x3f')]['limit']);_0x5da913[_0x9f96('0x2a')]=qs['offset'](_0x3f0974['query'][_0x9f96('0x2a')]);}_0x5da913[_0x9f96('0x48')]=qs['sort'](_0x3f0974[_0x9f96('0x3f')][_0x9f96('0x49')]);_0x5da913[_0x9f96('0x4c')]=qs[_0x9f96('0x41')](_[_0x9f96('0x4a')](_0x3f0974[_0x9f96('0x3f')],_0x4f7d2f[_0x9f96('0x41')]));_0x5da913[_0x9f96('0x4c')]['SmsAccountId']=_0x21b3bd['id'];if(_0x3f0974[_0x9f96('0x3f')][_0x9f96('0x4b')]){_0x5da913['where']=_[_0x9f96('0x4d')](_0x5da913['where'],{'$or':_['map'](_0x5da913[_0x9f96('0x43')],function(_0x227e6e){var _0x2fcc29={};_0x2fcc29[_0x227e6e]={'$like':'%'+_0x3f0974['query'][_0x9f96('0x4b')]+'%'};return _0x2fcc29;})});}_0x5da913=_[_0x9f96('0x4d')]({},_0x5da913,_0x3f0974[_0x9f96('0x4f')]);return db[_0x9f96('0x62')][_0x9f96('0x2d')]({'where':_0x5da913[_0x9f96('0x4c')]})[_0x9f96('0x1f')](function(_0x4609c4){_0x469517[_0x9f96('0x2d')]=_0x4609c4;if(_0x3f0974['query'][_0x9f96('0x64')]){_0x5da913['include']=[{'all':!![]}];}return db[_0x9f96('0x62')][_0x9f96('0x51')](_0x5da913);})['then'](function(_0x5079e6){_0x469517[_0x9f96('0x52')]=_0x5079e6;return _0x469517;});}})[_0x9f96('0x1f')](respondWithFilteredResult(_0x325fc7,_0x5da913))[_0x9f96('0x27')](handleError(_0x325fc7,null));};exports['removeDispositions']=function(_0x7cbd19,_0x31b2ba,_0x665a37){return db[_0x9f96('0x38')]['find']({'where':{'id':_0x7cbd19[_0x9f96('0x5e')]['id']}})[_0x9f96('0x1f')](handleEntityNotFound(_0x31b2ba,null))['then'](function(_0x2b00ab){if(_0x2b00ab){return _0x2b00ab['removeDispositions'](_0x7cbd19[_0x9f96('0x3f')][_0x9f96('0x65')]);}})[_0x9f96('0x1f')](respondWithStatusCode(_0x31b2ba,null))[_0x9f96('0x27')](handleError(_0x31b2ba,null));};exports[_0x9f96('0x66')]=function(_0x3061f0,_0x13b65e,_0x280e42){if(_0x3061f0[_0x9f96('0x5c')]['id']){delete _0x3061f0[_0x9f96('0x5c')]['id'];}return db['SmsAccount'][_0x9f96('0x5d')]({'where':{'id':_0x3061f0['params']['id']}})[_0x9f96('0x1f')](handleEntityNotFound(_0x13b65e,null))['then'](function(_0x14034f){if(_0x14034f){_0x3061f0['body'][_0x9f96('0x61')]=_0x14034f['id'];return db['CannedAnswer']['create'](_0x3061f0[_0x9f96('0x5c')]);}})[_0x9f96('0x1f')](respondWithResult(_0x13b65e,null))[_0x9f96('0x27')](handleError(_0x13b65e,null));};exports[_0x9f96('0x67')]=function(_0x3e5053,_0x594c42,_0x2fc531){var _0x286713={'raw':![],'where':{}};var _0x283421={};var _0xe65528={'count':0x0,'rows':[]};return db[_0x9f96('0x38')][_0x9f96('0x63')]({'where':{'id':_0x3e5053[_0x9f96('0x5e')]['id']}})[_0x9f96('0x1f')](handleEntityNotFound(_0x594c42,null))[_0x9f96('0x1f')](function(_0x2c0a1a){if(_0x2c0a1a){_0x283421['model']=_[_0x9f96('0x40')](db[_0x9f96('0x68')][_0x9f96('0x39')]);_0x283421[_0x9f96('0x3f')]=_['keys'](_0x3e5053[_0x9f96('0x3f')]);_0x283421[_0x9f96('0x41')]=_[_0x9f96('0x42')](_0x283421[_0x9f96('0x3d')],_0x283421[_0x9f96('0x3f')]);_0x286713['attributes']=_[_0x9f96('0x42')](_0x283421['model'],qs[_0x9f96('0x44')](_0x3e5053[_0x9f96('0x3f')]['fields']));_0x286713[_0x9f96('0x43')]=_0x286713['attributes'][_0x9f96('0x45')]?_0x286713['attributes']:_0x283421[_0x9f96('0x3d')];if(!_0x3e5053[_0x9f96('0x3f')][_0x9f96('0x46')](_0x9f96('0x47'))){_0x286713['limit']=qs[_0x9f96('0x2c')](_0x3e5053['query'][_0x9f96('0x2c')]);_0x286713[_0x9f96('0x2a')]=qs[_0x9f96('0x2a')](_0x3e5053['query'][_0x9f96('0x2a')]);}_0x286713['order']=qs['sort'](_0x3e5053[_0x9f96('0x3f')][_0x9f96('0x49')]);_0x286713[_0x9f96('0x4c')]=qs['filters'](_[_0x9f96('0x4a')](_0x3e5053[_0x9f96('0x3f')],_0x283421[_0x9f96('0x41')]));_0x286713[_0x9f96('0x4c')]['SmsAccountId']=_0x2c0a1a['id'];if(_0x3e5053['query']['filter']){_0x286713[_0x9f96('0x4c')]=_[_0x9f96('0x4d')](_0x286713[_0x9f96('0x4c')],{'$or':_[_0x9f96('0x3e')](_0x286713['attributes'],function(_0x589a00){var _0x4df581={};_0x4df581[_0x589a00]={'$like':'%'+_0x3e5053[_0x9f96('0x3f')][_0x9f96('0x4b')]+'%'};return _0x4df581;})});}_0x286713=_[_0x9f96('0x4d')]({},_0x286713,_0x3e5053['options']);return db[_0x9f96('0x68')]['count']({'where':_0x286713[_0x9f96('0x4c')]})['then'](function(_0x31eb08){_0xe65528[_0x9f96('0x2d')]=_0x31eb08;if(_0x3e5053[_0x9f96('0x3f')][_0x9f96('0x64')]){_0x286713[_0x9f96('0x50')]=[{'all':!![]}];}return db[_0x9f96('0x68')][_0x9f96('0x51')](_0x286713);})[_0x9f96('0x1f')](function(_0x3d46f0){_0xe65528[_0x9f96('0x52')]=_0x3d46f0;return _0xe65528;});}})[_0x9f96('0x1f')](respondWithFilteredResult(_0x594c42,_0x286713))[_0x9f96('0x27')](handleError(_0x594c42,null));};exports['removeAnswers']=function(_0x25d705,_0x1a3667,_0x24358a){return db['SmsAccount'][_0x9f96('0x5d')]({'where':{'id':_0x25d705[_0x9f96('0x5e')]['id']}})[_0x9f96('0x1f')](handleEntityNotFound(_0x1a3667,null))[_0x9f96('0x1f')](function(_0x538d7b){if(_0x538d7b){return _0x538d7b[_0x9f96('0x69')](_0x25d705[_0x9f96('0x3f')][_0x9f96('0x65')]);}})['then'](respondWithStatusCode(_0x1a3667,null))[_0x9f96('0x27')](handleError(_0x1a3667,null));};exports[_0x9f96('0x6a')]=function(_0x273b82,_0x25f707,_0x204a1e){var _0x57c40c={'channel':'sms'};var _0xfca15f=[];var _0x3b8a82=[];var _0x395519={};return db[_0x9f96('0x38')]['find']({'where':{'id':_0x273b82[_0x9f96('0x5e')]['id']},'include':[{'model':db[_0x9f96('0x6b')],'as':'Applications'}]})['then'](handleEntityNotFound(_0x25f707,null))[_0x9f96('0x1f')](function(_0x1cd1f2){_0x57c40c[_0x9f96('0x6c')]=_0x1cd1f2;_0x57c40c[_0x9f96('0x6d')]=_[_0x9f96('0x6e')](_0x1cd1f2[_0x9f96('0x6f')],[_0x9f96('0x70')],[_0x9f96('0x71')]);if(_0x57c40c[_0x9f96('0x6c')]['Applications']){delete _0x57c40c[_0x9f96('0x6c')][_0x9f96('0x6f')];}return db[_0x9f96('0x72')][_0x9f96('0x5f')]();})[_0x9f96('0x1f')](function(_0x1d5f8a){if(!_0x1d5f8a){throw new db[(_0x9f96('0x73'))][(_0x9f96('0x74'))](_0x9f96('0x75'));}_0xfca15f=_[_0x9f96('0x76')](_[_0x9f96('0x40')](_0x1d5f8a),['createdAt',_0x9f96('0x77')]);_0x3b8a82=_[_0x9f96('0x76')](_[_0x9f96('0x40')](_0x1d5f8a),[_0x9f96('0x78'),_0x9f96('0x77'),_0x9f96('0x79'),_0x9f96('0x7a')]);_0x57c40c[_0x9f96('0x5c')]={'mapKey':_0x9f96('0x7b')};if(_0x57c40c[_0x9f96('0x6c')][_0x9f96('0x3b')]){switch(_0x57c40c[_0x9f96('0x6c')]['type']){case _0x9f96('0x7c'):_0x57c40c[_0x9f96('0x5c')][_0x9f96('0x7d')]=_0x273b82['body']['From'];_0x57c40c['body'][_0x9f96('0x5c')]=_0x273b82['body'][_0x9f96('0x7e')];_0x57c40c[_0x9f96('0x5c')][_0x9f96('0x7f')]=_0x273b82['body'][_0x9f96('0x80')];break;case _0x9f96('0x81'):_0x57c40c[_0x9f96('0x5c')][_0x9f96('0x7d')]='+'+_0x273b82[_0x9f96('0x5c')][_0x9f96('0x82')];_0x57c40c[_0x9f96('0x5c')][_0x9f96('0x5c')]=_0x273b82[_0x9f96('0x5c')][_0x9f96('0x83')];break;case _0x9f96('0x84'):_0x57c40c[_0x9f96('0x5c')]['from']=_0x273b82[_0x9f96('0x5c')]['from'];_0x57c40c[_0x9f96('0x5c')][_0x9f96('0x5c')]=_0x273b82[_0x9f96('0x5c')][_0x9f96('0x25')];break;case _0x9f96('0x85'):_0x57c40c[_0x9f96('0x5c')]['from']=_0x273b82[_0x9f96('0x5c')][_0x9f96('0x7d')];_0x57c40c[_0x9f96('0x5c')][_0x9f96('0x5c')]=_0x273b82['body']['body'];_0x57c40c[_0x9f96('0x5c')][_0x9f96('0x7f')]=_0x273b82[_0x9f96('0x5c')][_0x9f96('0x86')];break;case _0x9f96('0x87'):_0x57c40c[_0x9f96('0x5c')]['from']=_0x273b82[_0x9f96('0x5c')][_0x9f96('0x88')];_0x57c40c[_0x9f96('0x5c')]['body']=_0x273b82[_0x9f96('0x5c')]['Text'];_0x57c40c[_0x9f96('0x5c')]['messageId']=_0x273b82[_0x9f96('0x5c')][_0x9f96('0x89')];break;case'infobip':_0x57c40c[_0x9f96('0x5c')][_0x9f96('0x7d')]='+'+_0x273b82[_0x9f96('0x5c')][_0x9f96('0x8a')][0x0][_0x9f96('0x7d')];_0x57c40c[_0x9f96('0x5c')][_0x9f96('0x5c')]=_0x273b82[_0x9f96('0x5c')][_0x9f96('0x8a')][0x0][_0x9f96('0x83')];_0x57c40c[_0x9f96('0x5c')][_0x9f96('0x7f')]=_0x273b82[_0x9f96('0x5c')][_0x9f96('0x8a')][0x0][_0x9f96('0x7f')];break;case _0x9f96('0x8b'):_0x57c40c[_0x9f96('0x5c')][_0x9f96('0x7d')]=_0x273b82[_0x9f96('0x5c')][_0x9f96('0x8c')];_0x57c40c[_0x9f96('0x5c')]['body']=_0x273b82[_0x9f96('0x5c')][_0x9f96('0x8d')][_0x9f96('0x25')];break;case _0x9f96('0x8e'):_0x57c40c[_0x9f96('0x5c')][_0x9f96('0x7d')]=_0x273b82['body'][_0x9f96('0x8f')];_0x57c40c['body'][_0x9f96('0x5c')]=_0x273b82[_0x9f96('0x5c')][_0x9f96('0x83')];_0x57c40c[_0x9f96('0x5c')]['messageId']=_0x273b82[_0x9f96('0x5c')][_0x9f96('0x90')];break;case _0x9f96('0x91'):_0x57c40c[_0x9f96('0x5c')]['messageId']=_0x273b82[_0x9f96('0x5c')][0x0][_0x9f96('0x25')]['id'];_0x57c40c[_0x9f96('0x5c')][_0x9f96('0x7d')]=_0x273b82[_0x9f96('0x5c')][0x0]['message'][_0x9f96('0x7d')];_0x57c40c['body'][_0x9f96('0x5c')]=_0x273b82[_0x9f96('0x5c')][0x0][_0x9f96('0x25')][_0x9f96('0x83')];break;case _0x9f96('0x92'):_0x57c40c['body']['from']=_0x273b82[_0x9f96('0x5c')][_0x9f96('0x7d')];_0x57c40c[_0x9f96('0x5c')]['body']=_0x273b82[_0x9f96('0x5c')][_0x9f96('0x25')];_0x57c40c[_0x9f96('0x5c')]['messageId']=_0x273b82[_0x9f96('0x5c')][_0x9f96('0x93')];break;}}if(_0x57c40c[_0x9f96('0x5c')]['id']){delete _0x57c40c[_0x9f96('0x5c')]['id'];}if(_[_0x9f96('0x94')](_0x57c40c['body'][_0x9f96('0x7d')])){throw new db['Sequelize'][(_0x9f96('0x74'))](_0x9f96('0x95'));}if(_[_0x9f96('0x94')](_0x57c40c[_0x9f96('0x5c')][_0x9f96('0x5c')])||_0x57c40c[_0x9f96('0x5c')]['body']===''){throw new db[(_0x9f96('0x73'))][(_0x9f96('0x74'))](_0x9f96('0x96'));}if(_[_0x9f96('0x94')](_0x57c40c[_0x9f96('0x5c')][_0x9f96('0x97')])){throw new db[(_0x9f96('0x73'))][(_0x9f96('0x74'))](_0x9f96('0x98')+_0x3b8a82);}if(!_[_0x9f96('0x99')](_0x3b8a82,_0x57c40c[_0x9f96('0x5c')]['mapKey'])){throw new db[(_0x9f96('0x73'))]['ValidationError']('mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20'+_0x3b8a82);}_0x395519[_0x57c40c[_0x9f96('0x5c')]['mapKey']]=_0x57c40c[_0x9f96('0x5c')][_0x9f96('0x7d')];return db[_0x9f96('0x9a')][_0x9f96('0x5d')]({'where':{'id':_0x57c40c[_0x9f96('0x6c')][_0x9f96('0x7a')]},'include':[{'model':db[_0x9f96('0x72')],'as':'Contacts','where':_0x395519,'limit':0x1,'order':[[_0x9f96('0x77'),_0x9f96('0x9b')]]}]});})[_0x9f96('0x1f')](handleEntityNotFound(_0x25f707,null))[_0x9f96('0x1f')](function(_0x122b75){if(_0x122b75){_0x57c40c[_0x9f96('0x9c')]=_[_0x9f96('0x9d')](_0x122b75,[_0x9f96('0x9e')]);if(_0x122b75[_0x9f96('0x9e')][_0x9f96('0x45')]){return _0x122b75['Contacts'][0x0];}var _0x4e031d=_[_0x9f96('0x9f')](_0x57c40c[_0x9f96('0x5c')],{'firstName':_0x57c40c[_0x9f96('0x5c')][_0x9f96('0x7d')],'ListId':_0x122b75['id']});_0x4e031d[_0x57c40c['body']['mapKey']]=_0x57c40c[_0x9f96('0x5c')][_0x9f96('0x7d')];return db[_0x9f96('0x72')][_0x9f96('0x54')](_0x4e031d,{'fields':_0xfca15f,'raw':!![]});}})[_0x9f96('0x1f')](handleEntityNotFound(_0x25f707,null))[_0x9f96('0x1f')](function(_0x3ba109){if(_0x3ba109){_0x57c40c[_0x9f96('0xa0')]=_0x3ba109;var _0x1879c8={'ContactId':_0x3ba109['id'],'phone':_0x57c40c[_0x9f96('0x5c')]['from'],'SmsAccountId':_0x273b82[_0x9f96('0x5e')]['id']};var _0x10039b={'ContactId':_0x3ba109['id'],'SmsAccountId':_0x273b82[_0x9f96('0x5e')]['id'],'closed':![]};return db[_0x9f96('0xa1')][_0x9f96('0x5d')]({'where':_0x10039b})[_0x9f96('0x1f')](function(_0x52c37d){if(_0x52c37d){return[_0x52c37d,![]];}return db[_0x9f96('0xa1')]['create'](_0x1879c8)[_0x9f96('0x1f')](function(_0x2a87c2){return[_0x2a87c2,!![]];});});}})[_0x9f96('0xa2')](function(_0x16167b,_0x3fb574){_0x57c40c['interaction']=_0x16167b[_0x9f96('0x57')]({'plain':!![]});_0x57c40c[_0x9f96('0xa3')]['created']=![];if(_0x3fb574){if(_0x57c40c[_0x9f96('0x6c')][_0x9f96('0xa4')]){_0x57c40c[_0x9f96('0x6d')]['push']({'id':0x0,'priority':_0x57c40c['applications'][_0x9f96('0x45')]+0x1,'app':_0x9f96('0xa5'),'appdata':_0x9f96('0xa6'),'interval':_0x9f96('0xa7')});}_0x57c40c['interaction'][_0x9f96('0xa8')]=!![];}return db[_0x9f96('0xa9')][_0x9f96('0x54')]({'phone':_0x57c40c['body'][_0x9f96('0x7d')],'messageId':_0x57c40c[_0x9f96('0x5c')][_0x9f96('0x7f')],'body':_0x57c40c[_0x9f96('0x5c')][_0x9f96('0x5c')],'SmsAccountId':_0x273b82[_0x9f96('0x5e')]['id'],'SmsInteractionId':_0x16167b['id'],'direction':'in','ContactId':_0x16167b[_0x9f96('0xaa')],'AttachmentId':_0x57c40c[_0x9f96('0x5c')][_0x9f96('0xab')]});})[_0x9f96('0x1f')](function(_0x862e93){_0x57c40c[_0x9f96('0x25')]=_0x862e93;if(!_0x57c40c[_0x9f96('0xa3')][_0x9f96('0xac')])return;return db[_0x9f96('0xad')][_0x9f96('0x5d')]({'attributes':['id',_0x9f96('0x34')],'where':{'id':_0x57c40c[_0x9f96('0xa3')][_0x9f96('0xac')]}});})[_0x9f96('0x1f')](function(_0x1303e7){if(_0x1303e7){_0x57c40c[_0x9f96('0x6d')][_0x9f96('0xae')]({'id':0x0,'priority':0x0,'app':_0x9f96('0xaf'),'appdata':_0x1303e7['name']+','+(_0x57c40c['account']['waitForTheAssignedAgent']||0xa),'interval':_0x9f96('0xa7')});}if(!_0x57c40c['interaction']['queueId'])return;return db[_0x9f96('0xb0')]['find']({'attributes':['id','name'],'where':{'id':_0x57c40c[_0x9f96('0xa3')][_0x9f96('0xb1')]}});})[_0x9f96('0x1f')](function(_0x34f4c4){if(_0x34f4c4){_0x57c40c[_0x9f96('0x6d')][_0x9f96('0xae')]({'id':0x0,'priority':0x1,'app':_0x9f96('0xb2'),'appdata':_0x34f4c4[_0x9f96('0x34')]+','+(_0x57c40c[_0x9f96('0x6c')][_0x9f96('0xb3')]||0x12c),'interval':_0x9f96('0xa7')});}return respondWithRpcPromise(_0x9f96('0xb4'),_0x9f96('0xb5'),_0x57c40c);})[_0x9f96('0x1f')](function(_0x3f7d84){if(_0x3f7d84){var _0x2ebf13=0xc8;var _0x7923eb=_0x9f96('0xb6');logger[_0x9f96('0x26')](_0x9f96('0x21'),_0x7923eb,_0x2ebf13,'entity\x20found');logger[_0x9f96('0xb7')](_0x9f96('0xb8'),_0x7923eb,_0x2ebf13,'entity\x20found',JSON['stringify'](_0x3f7d84));if(_0x57c40c[_0x9f96('0x6c')][_0x9f96('0x3b')]===_0x9f96('0x7c')){return _0x25f707[_0x9f96('0x28')](_0x2ebf13)['set']('Content-Type',_0x9f96('0xb9'))['send'](_0x9f96('0xba'));}else{return _0x25f707['status'](_0x2ebf13)[_0x9f96('0x2e')](_0x3f7d84);}}})[_0x9f96('0x27')](handleError(_0x25f707,null));};exports[_0x9f96('0xbb')]=function(_0x5cb8c0,_0x4e931e){var _0x19bd78=_0x5cb8c0['params']['id'];var _0x571f60=_0x5cb8c0[_0x9f96('0x5c')];var _0x94bdf4=0xc8;var _0xdd3fb=null;return db['sequelize'][_0x9f96('0xbc')]({'isolationLevel':db['sequelize'][_0x9f96('0xbd')][_0x9f96('0xbe')][_0x9f96('0xbf')]},function(_0x157d64){return db[_0x9f96('0x38')][_0x9f96('0x63')]({'where':{'id':_0x19bd78},'transaction':_0x157d64})['then'](function(_0x3547e9){if(_0x3547e9){return db['SmsApplication'][_0x9f96('0x31')]({'where':{'SmsAccountId':_0x19bd78},'transaction':_0x157d64})[_0x9f96('0x1f')](function(){var _0x1d8d6f=_['map'](_0x571f60,function(_0x2a8bf0){_0x2a8bf0[_0x9f96('0x61')]=_0x19bd78;return _0x2a8bf0;});return db[_0x9f96('0x6b')]['bulkCreate'](_0x1d8d6f,{'transaction':_0x157d64});});}else{_0x94bdf4=0x194;_0xdd3fb=[];}});})['then'](function(){if(_0x94bdf4!==0x194){return db[_0x9f96('0x6b')]['findAndCountAll']({'where':{'SmsAccountId':_0x19bd78},'order':_0x9f96('0x70')})[_0x9f96('0x1f')](function(_0x3a7855){_0xdd3fb=_0x3a7855;});}})[_0x9f96('0x27')](function(_0x213769){_0x94bdf4=0x1f4;logger['error'](_0x213769['stack']);if(_0x213769[_0x9f96('0x34')]){delete _0x213769[_0x9f96('0x34')];}_0xdd3fb=_0x213769;})['finally'](function(){if(_0xdd3fb===null){_0x4e931e[_0x9f96('0x33')](_0x94bdf4);}else{if(_0x94bdf4===0x1f4){_0x4e931e[_0x9f96('0x28')](_0x94bdf4)[_0x9f96('0x35')](_0xdd3fb);}else{_0x4e931e['status'](_0x94bdf4)[_0x9f96('0x2e')](_0xdd3fb);}}});};exports[_0x9f96('0xc0')]=function(_0x55630f,_0x7c0ab0,_0x2cb5b5){var _0x4b3e10={};var _0x583b47={};var _0x11e262;var _0x48e900;return db[_0x9f96('0x38')][_0x9f96('0x63')]({'where':{'id':_0x55630f['params']['id']}})[_0x9f96('0x1f')](handleEntityNotFound(_0x7c0ab0,null))['then'](function(_0x47f7cb){if(_0x47f7cb){_0x11e262=_0x47f7cb;_0x583b47[_0x9f96('0x3d')]=_[_0x9f96('0x40')](db[_0x9f96('0x6b')]['rawAttributes']);_0x583b47[_0x9f96('0x3f')]=_['keys'](_0x55630f[_0x9f96('0x3f')]);_0x583b47[_0x9f96('0x41')]=_['intersection'](_0x583b47[_0x9f96('0x3d')],_0x583b47[_0x9f96('0x3f')]);_0x4b3e10[_0x9f96('0x43')]=_[_0x9f96('0x42')](_0x583b47[_0x9f96('0x3d')],qs[_0x9f96('0x44')](_0x55630f[_0x9f96('0x3f')][_0x9f96('0x44')]));_0x4b3e10[_0x9f96('0x43')]=_0x4b3e10[_0x9f96('0x43')][_0x9f96('0x45')]?_0x4b3e10[_0x9f96('0x43')]:_0x583b47[_0x9f96('0x3d')];_0x4b3e10[_0x9f96('0x48')]=qs['sort'](_0x55630f[_0x9f96('0x3f')][_0x9f96('0x49')]);_0x4b3e10[_0x9f96('0x4c')]=qs[_0x9f96('0x41')](_[_0x9f96('0x4a')](_0x55630f[_0x9f96('0x3f')],_0x583b47[_0x9f96('0x41')]));if(_0x55630f['query'][_0x9f96('0x4b')]){_0x4b3e10[_0x9f96('0x4c')]=_['merge'](_0x4b3e10[_0x9f96('0x4c')],{'$or':_[_0x9f96('0x3e')](_0x4b3e10[_0x9f96('0x43')],function(_0x3287c6){var _0x2a7da4={};_0x2a7da4[_0x3287c6]={'$like':'%'+_0x55630f[_0x9f96('0x3f')][_0x9f96('0x4b')]+'%'};return _0x2a7da4;})});}_0x4b3e10=_[_0x9f96('0x4d')]({},_0x4b3e10,_0x55630f[_0x9f96('0x4f')]);return _0x11e262[_0x9f96('0xc0')](_0x4b3e10);}})[_0x9f96('0x1f')](function(_0x31e6ff){if(_0x31e6ff){_0x48e900=_0x31e6ff[_0x9f96('0x45')];if(!_0x55630f[_0x9f96('0x3f')][_0x9f96('0x46')](_0x9f96('0x47'))){_0x4b3e10['limit']=qs[_0x9f96('0x2c')](_0x55630f[_0x9f96('0x3f')][_0x9f96('0x2c')]);_0x4b3e10[_0x9f96('0x2a')]=qs[_0x9f96('0x2a')](_0x55630f[_0x9f96('0x3f')]['offset']);}return _0x11e262['getApplications'](_0x4b3e10);}})[_0x9f96('0x1f')](function(_0x3ac5fe){if(_0x3ac5fe){return _0x3ac5fe?{'count':_0x48e900,'rows':_0x3ac5fe}:null;}})[_0x9f96('0x1f')](respondWithResult(_0x7c0ab0,null))[_0x9f96('0x27')](handleError(_0x7c0ab0,null));};exports[_0x9f96('0xc1')]=function(_0x5e9156,_0x2d5c43,_0x26cc5f){var _0x488324={'raw':![],'where':{}};var _0x389eb9={};var _0x36e01c={'count':0x0,'rows':[]};return db[_0x9f96('0x38')]['findOne']({'where':{'id':_0x5e9156[_0x9f96('0x5e')]['id']}})[_0x9f96('0x1f')](handleEntityNotFound(_0x2d5c43,null))[_0x9f96('0x1f')](function(_0x117c77){if(_0x117c77){_0x389eb9[_0x9f96('0x3d')]=_[_0x9f96('0x40')](db[_0x9f96('0xa1')][_0x9f96('0x39')]);_0x389eb9[_0x9f96('0x3f')]=_[_0x9f96('0x40')](_0x5e9156[_0x9f96('0x3f')]);_0x389eb9[_0x9f96('0x41')]=_[_0x9f96('0x42')](_0x389eb9[_0x9f96('0x3d')],_0x389eb9[_0x9f96('0x3f')]);_0x488324[_0x9f96('0x43')]=_[_0x9f96('0x42')](_0x389eb9[_0x9f96('0x3d')],qs[_0x9f96('0x44')](_0x5e9156[_0x9f96('0x3f')][_0x9f96('0x44')]));_0x488324['attributes']=_0x488324[_0x9f96('0x43')][_0x9f96('0x45')]?_0x488324[_0x9f96('0x43')]:_0x389eb9[_0x9f96('0x3d')];if(!_0x5e9156['query'][_0x9f96('0x46')](_0x9f96('0x47'))){_0x488324[_0x9f96('0x2c')]=qs['limit'](_0x5e9156[_0x9f96('0x3f')][_0x9f96('0x2c')]);_0x488324[_0x9f96('0x2a')]=qs['offset'](_0x5e9156['query'][_0x9f96('0x2a')]);}_0x488324[_0x9f96('0x48')]=qs[_0x9f96('0x49')](_0x5e9156[_0x9f96('0x3f')][_0x9f96('0x49')]);_0x488324[_0x9f96('0x4c')]=qs['filters'](_['pick'](_0x5e9156[_0x9f96('0x3f')],_0x389eb9[_0x9f96('0x41')]));_0x488324[_0x9f96('0x4c')][_0x9f96('0x61')]=_0x117c77['id'];if(_0x5e9156[_0x9f96('0x3f')][_0x9f96('0x4b')]){_0x488324[_0x9f96('0x4c')]=_[_0x9f96('0x4d')](_0x488324[_0x9f96('0x4c')],{'$or':_['map'](_0x488324[_0x9f96('0x43')],function(_0x4e56fd){var _0x219df5={};_0x219df5[_0x4e56fd]={'$like':'%'+_0x5e9156['query'][_0x9f96('0x4b')]+'%'};return _0x219df5;})});}_0x488324=_[_0x9f96('0x4d')]({},_0x488324,_0x5e9156['options']);return db[_0x9f96('0xa1')]['count']({'where':_0x488324[_0x9f96('0x4c')]})['then'](function(_0x4ea5ca){_0x36e01c[_0x9f96('0x2d')]=_0x4ea5ca;if(_0x5e9156[_0x9f96('0x3f')][_0x9f96('0x64')]){_0x488324[_0x9f96('0x50')]=[{'model':db[_0x9f96('0x72')],'as':_0x9f96('0xc2'),'required':![]},{'model':db[_0x9f96('0xad')],'as':'Owner','attributes':[_0x9f96('0x34'),_0x9f96('0xc3'),'internal'],'required':![]},{'model':db[_0x9f96('0xc4')],'as':_0x9f96('0xc5'),'attributes':['id',_0x9f96('0x34'),_0x9f96('0xc6')],'where':_0x5e9156[_0x9f96('0x3f')]['tag']?{'id':_0x5e9156[_0x9f96('0x3f')][_0x9f96('0xc7')]}:undefined,'required':_0x5e9156[_0x9f96('0x3f')][_0x9f96('0xc7')]?!![]:![]}];}return db[_0x9f96('0xa1')]['findAll'](_0x488324);})[_0x9f96('0x1f')](function(_0x806dfc){_0x36e01c[_0x9f96('0x52')]=_0x806dfc;return _0x36e01c;});}})[_0x9f96('0x1f')](respondWithFilteredResult(_0x2d5c43,_0x488324))[_0x9f96('0x27')](handleError(_0x2d5c43,null));};exports[_0x9f96('0x35')]=function(_0x117347,_0x1e7406,_0x1f9c4a){var _0xacc907,_0x3de328,_0x48df74;if(_[_0x9f96('0x94')](_0x117347[_0x9f96('0x5c')][_0x9f96('0x5c')])||_0x117347['body'][_0x9f96('0x5c')]===''){throw new db[(_0x9f96('0x73'))][(_0x9f96('0x74'))]('body\x20is\x20mandatory\x20and\x20not\x20empty');}if(_[_0x9f96('0x94')](_0x117347[_0x9f96('0x5c')]['to'])){throw new db[(_0x9f96('0x73'))][(_0x9f96('0x74'))]('to\x20is\x20mandatory');}_0xacc907=_0x117347[_0x9f96('0x5c')]['to'];return db[_0x9f96('0x38')][_0x9f96('0x5d')]({'where':{'id':_0x117347['params']['id']},'include':[{'model':db[_0x9f96('0x9a')],'as':_0x9f96('0xc8'),'include':[{'model':db[_0x9f96('0x72')],'as':_0x9f96('0x9e'),'where':{'mobile':_0xacc907},'limit':0x1,'order':[['updatedAt',_0x9f96('0x9b')]]}]}]})[_0x9f96('0x1f')](handleEntityNotFound(_0x1e7406,null))[_0x9f96('0x1f')](function(_0x4c4da2){if(_0x4c4da2&&_0x4c4da2['List']){_0x3de328=_0x4c4da2['get']({'plain':!![]});if(_0x3de328['List']&&_0x3de328['List']['Contacts'][_0x9f96('0x45')]){return _0x3de328[_0x9f96('0xc8')][_0x9f96('0x9e')][0x0];}return db[_0x9f96('0x72')][_0x9f96('0x54')](_[_0x9f96('0x9f')](_0x117347[_0x9f96('0x5c')],{'firstName':_0xacc907,'mobile':_0xacc907,'phone':_0xacc907,'ListId':_0x3de328[_0x9f96('0x7a')]}));}})[_0x9f96('0x1f')](handleEntityNotFound(_0x1e7406,null))['then'](function(_0x40fcaf){if(_0x40fcaf){_0x48df74=_0x40fcaf;return db['SmsInteraction'][_0x9f96('0x5d')]({'where':{'ContactId':_0x48df74['id'],'closed':![],'SmsAccountId':_0x3de328['id']}})[_0x9f96('0x1f')](function(_0xf2d673){if(_0xf2d673){return[_0xf2d673,![]];}return db[_0x9f96('0xa1')]['create']({'UserId':_0x117347[_0x9f96('0xc9')]['id'],'ContactId':_0x48df74['id'],'SmsAccountId':_0x3de328['id'],'phone':_0xacc907,'firstMsgDirection':_0x9f96('0xca'),'Messages':[_['merge'](_0x117347['body'],{'read':![],'body':_0x117347[_0x9f96('0x5c')][_0x9f96('0x5c')],'phone':_0xacc907,'SmsAccountId':_0x3de328['id'],'UserId':_0x117347['user']['id'],'ContactId':_0x48df74['id']})]},{'include':[{'model':db[_0x9f96('0xa9')],'as':_0x9f96('0xcb')}]})['then'](function(_0x5b354d){return[_0x5b354d,!![]];});});}})[_0x9f96('0xa2')](function(_0x300d23,_0x30e244){if(_0x30e244){return _0x300d23;}return db[_0x9f96('0xa9')][_0x9f96('0x54')](_['merge'](_0x117347[_0x9f96('0x5c')],{'read':![],'body':_0x117347[_0x9f96('0x5c')][_0x9f96('0x5c')],'phone':_0xacc907,'SmsAccountId':_0x3de328['id'],'SmsInteractionId':_0x300d23['id'],'UserId':_0x117347['user']['id'],'ContactId':_0x48df74['id']}))[_0x9f96('0x1f')](function(_0x3ae055){_0x300d23[_0x9f96('0xcc')]['Messages']=[];_0x300d23[_0x9f96('0xcc')][_0x9f96('0xcb')][_0x9f96('0xcd')](_0x3ae055[_0x9f96('0xcc')]);return _0x300d23;});})[_0x9f96('0x1f')](respondWithResult(_0x1e7406,null))[_0x9f96('0x27')](handleError(_0x1e7406,null));};exports[_0x9f96('0x28')]=function(_0x4507d5,_0x5af6a6,_0x30b058){if(_0x4507d5['body']['id']){delete _0x4507d5[_0x9f96('0x5c')]['id'];}var _0x11b48e,_0x37d188,_0x59a84a;return db[_0x9f96('0x38')][_0x9f96('0x5d')]({'where':{'id':_0x4507d5[_0x9f96('0x5e')]['id']}})['then'](handleEntityNotFound(_0x5af6a6,null))['then'](function(_0xa9f444){if(_0xa9f444){_0x59a84a=_0xa9f444;logger['debug'](_0x9f96('0x21'),_0x9f96('0x28'),'received\x20delivery\x20report\x20from',_0xa9f444['type'],util[_0x9f96('0xce')](_0x4507d5[_0x9f96('0x5c')],{'showHidden':![],'depth':null}));switch(_0xa9f444[_0x9f96('0x3b')]){case _0x9f96('0x81'):if(_0x4507d5[_0x9f96('0x5c')][_0x9f96('0xcf')]&&_0x4507d5[_0x9f96('0x5c')][_0x9f96('0x28')]){_0x37d188=_0x4507d5[_0x9f96('0x5c')][_0x9f96('0x28')];return db[_0x9f96('0xa9')][_0x9f96('0x5d')]({'where':{'messageId':_0x4507d5[_0x9f96('0x5c')][_0x9f96('0xcf')]}});}break;case _0x9f96('0x84'):if(_0x4507d5[_0x9f96('0x5c')][_0x9f96('0xd0')]&&_0x4507d5[_0x9f96('0x5c')][_0x9f96('0xd1')]){_0x37d188=_0x4507d5[_0x9f96('0x5c')][_0x9f96('0xd1')];return db[_0x9f96('0xa9')][_0x9f96('0x5d')]({'where':{'messageId':_0x4507d5[_0x9f96('0x5c')][_0x9f96('0xd0')]}});}break;case'clicksend':if(_0x4507d5['body'][_0x9f96('0x86')]&&_0x4507d5[_0x9f96('0x5c')][_0x9f96('0xd2')]){_0x37d188=_0x4507d5[_0x9f96('0x5c')][_0x9f96('0xd2')];return db['SmsMessage'][_0x9f96('0x5d')]({'where':{'messageId':_0x4507d5['body'][_0x9f96('0x86')]}});}break;case'infobip':var _0x4bde3b=_0x4507d5[_0x9f96('0x5c')][_0x9f96('0x8a')][0x0];if(_0x4bde3b['messageId']&&_0x4bde3b[_0x9f96('0x28')]['groupName']===_0x9f96('0xd3')){_0x37d188=_0x4bde3b[_0x9f96('0x28')][_0x9f96('0xd4')];return db[_0x9f96('0xa9')][_0x9f96('0x5d')]({'where':{'messageId':_0x4bde3b['messageId']}});}break;case'clickatell':if(_0x4507d5[_0x9f96('0x5c')]['messageId']&&_0x4507d5[_0x9f96('0x5c')][_0x9f96('0x28')]){_0x37d188=_0x4507d5[_0x9f96('0x5c')][_0x9f96('0x28')];return db['SmsMessage'][_0x9f96('0x5d')]({'where':{'messageId':_0x4507d5[_0x9f96('0x5c')][_0x9f96('0x7f')]}});}break;case _0x9f96('0x91'):if(_0x4507d5[_0x9f96('0x5c')][0x0][_0x9f96('0x25')]['id']){_0x37d188=_0x4507d5[_0x9f96('0x5c')][0x0]['type'];return db[_0x9f96('0xa9')][_0x9f96('0x5d')]({'where':{'messageId':_0x4507d5['body'][0x0][_0x9f96('0x25')]['id']}});}break;case _0x9f96('0x92'):if(_0x4507d5['body']['redif']&&_0x4507d5[_0x9f96('0x5c')]['status']){_0x37d188=_0x4507d5[_0x9f96('0x5c')][_0x9f96('0x28')];return db[_0x9f96('0xa9')][_0x9f96('0x5d')]({'where':{'messageId':_0x4507d5[_0x9f96('0x5c')][_0x9f96('0xd5')]}});}break;}}})['then'](handleEntityNotFound(_0x5af6a6,null))['then'](function(_0x2038ec){if(_0x2038ec){_0x11b48e=_0x2038ec;switch(_0x59a84a[_0x9f96('0x3b')]){case _0x9f96('0x81'):if(_0x37d188==='DELIVERED'){return _0x11b48e['update']({'read':!![]});}else{logger[_0x9f96('0x23')](_0x9f96('0x21'),'status',_0x9f96('0x81'),util[_0x9f96('0xce')](_0x4507d5[_0x9f96('0x5c')],{'showHidden':![],'depth':null}));}break;case _0x9f96('0x84'):if(_0x37d188==='1'){return _0x11b48e[_0x9f96('0x30')]({'read':!![]});}else{logger[_0x9f96('0x23')](_0x9f96('0x21'),_0x9f96('0x28'),_0x9f96('0x81'),util[_0x9f96('0xce')](_0x4507d5[_0x9f96('0x5c')],{'showHidden':![],'depth':null}));}break;case _0x9f96('0x85'):if(!_0x4507d5[_0x9f96('0x5c')]['error_code']&&_0x37d188>=0xc8&&_0x37d188<=0xce){return _0x11b48e['update']({'read':!![]});}else{logger[_0x9f96('0x23')](_0x9f96('0x21'),_0x9f96('0x28'),'clicksend',util[_0x9f96('0xce')](_0x4507d5[_0x9f96('0x5c')],{'showHidden':![],'depth':null}));}break;case _0x9f96('0xd6'):var _0x1977e5=_0x4507d5[_0x9f96('0x5c')][_0x9f96('0x8a')][0x0];if(_0x1977e5[_0x9f96('0x28')][_0x9f96('0xd4')]===_0x9f96('0xd3')){return _0x11b48e[_0x9f96('0x30')]({'read':!![]});}else{logger[_0x9f96('0x23')](_0x9f96('0x21'),_0x9f96('0x28'),'infobip',util[_0x9f96('0xce')](_0x4507d5['body'],{'showHidden':![],'depth':null}));}break;case'clickatell':if(_0x37d188==_0x9f96('0xd7')||_0x37d188=='RECEIVED_BY_RECIPIENT'){return _0x11b48e[_0x9f96('0x30')]({'read':!![]});}else{logger[_0x9f96('0x23')](_0x9f96('0x21'),_0x9f96('0x28'),_0x9f96('0x8e'),util[_0x9f96('0xce')](_0x4507d5[_0x9f96('0x5c')],{'showHidden':![],'depth':null}));}break;case _0x9f96('0x91'):if(_0x37d188==_0x9f96('0xd8')){return _0x11b48e[_0x9f96('0x30')]({'read':!![]});}else{logger[_0x9f96('0x23')](_0x9f96('0x21'),_0x9f96('0x28'),'bandwidth',util[_0x9f96('0xce')](_0x4507d5['body'],{'showHidden':![],'depth':null}));}break;case'intelepeer':if(_0x37d188===_0x9f96('0xd9')||_0x37d188===_0x9f96('0xda')){return _0x11b48e[_0x9f96('0x30')]({'read':!![]});}else{logger[_0x9f96('0x23')]('SmsAccount,\x20%s,\x20%s,\x20%s','status',_0x9f96('0x92'),util[_0x9f96('0xce')](_0x4507d5[_0x9f96('0x5c')],{'showHidden':![],'depth':null}));}break;}return _0x11b48e;}})[_0x9f96('0x1f')](respondWithResult(_0x5af6a6,null))[_0x9f96('0x27')](handleError(_0x5af6a6,null));};exports[_0x9f96('0xdb')]=function(_0x42df0c,_0x234c76,_0x6f7096){var _0x1b6fd2,_0x5ef98d,_0x38b980;return db['SmsAccount'][_0x9f96('0x5d')]({'where':{'id':_0x42df0c[_0x9f96('0x5e')]['id']}})[_0x9f96('0x1f')](handleEntityNotFound(_0x234c76,null))[_0x9f96('0x1f')](function(_0x1eaa97){if(_0x1eaa97){_0x38b980=_0x1eaa97;logger[_0x9f96('0xb7')](_0x9f96('0x21'),_0x9f96('0x28'),_0x9f96('0xdc'),_0x1eaa97[_0x9f96('0x3b')],util[_0x9f96('0xce')](_0x42df0c[_0x9f96('0x3f')],{'showHidden':![],'depth':null}));switch(_0x1eaa97[_0x9f96('0x3b')]){case _0x9f96('0x8b'):if(_0x42df0c['query'][_0x9f96('0xdd')]&&_0x42df0c[_0x9f96('0x3f')]['state']){_0x5ef98d=_0x42df0c[_0x9f96('0x3f')]['state'];return db['SmsMessage'][_0x9f96('0x5d')]({'where':{'messageId':_0x42df0c['query'][_0x9f96('0xdd')]}});}break;}}})[_0x9f96('0x1f')](handleEntityNotFound(_0x234c76,null))[_0x9f96('0x1f')](function(_0x1f2eae){if(_0x1f2eae){_0x1b6fd2=_0x1f2eae;switch(_0x38b980['type']){case'csc':if(_0x5ef98d==='2'||_0x5ef98d==='6'){return _0x1b6fd2['update']({'read':!![]});}else{logger[_0x9f96('0x23')](_0x9f96('0x21'),_0x9f96('0x28'),'csc',util[_0x9f96('0xce')](_0x42df0c[_0x9f96('0x3f')],{'showHidden':![],'depth':null}));};break;}return _0x1b6fd2;}})[_0x9f96('0x1f')](respondWithResult(_0x234c76,null))[_0x9f96('0x27')](handleError(_0x234c76,null));};exports[_0x9f96('0xde')]=function(_0x41a68e,_0x14a8c5,_0x9cf4a4){return db[_0x9f96('0x38')]['find']({'where':{'id':_0x41a68e[_0x9f96('0x5e')]['id']}})[_0x9f96('0x1f')](handleEntityNotFound(_0x14a8c5,null))[_0x9f96('0x1f')](function(_0x57df49){if(_0x57df49){return _0x57df49['addAgents'](_0x41a68e[_0x9f96('0x5c')][_0x9f96('0x65')],_[_0x9f96('0x9d')](_0x41a68e['body'],[_0x9f96('0x65'),'id'])||{})[_0x9f96('0xa2')](function(_0xd0641b){for(var _0x5a02a0=0x0;_0x5a02a0<_0x41a68e[_0x9f96('0x5c')][_0x9f96('0x65')][_0x9f96('0x45')];_0x5a02a0+=0x1){socket[_0x9f96('0xdf')](_0x9f96('0xe0'),{'UserId':Number(_0x41a68e['body'][_0x9f96('0x65')][_0x5a02a0]),'SmsAccountId':Number(_0x41a68e[_0x9f96('0x5e')]['id'])});}return _0xd0641b;});}})[_0x9f96('0x1f')](respondWithResult(_0x14a8c5,null))[_0x9f96('0x27')](handleError(_0x14a8c5,null));};exports[_0x9f96('0xe1')]=function(_0x3e0c07,_0x7745aa,_0x314c8a){return db[_0x9f96('0x38')][_0x9f96('0x5d')]({'where':{'id':_0x3e0c07[_0x9f96('0x5e')]['id']}})[_0x9f96('0x1f')](handleEntityNotFound(_0x7745aa,null))[_0x9f96('0x1f')](function(_0x1db600){if(_0x1db600){return _0x1db600[_0x9f96('0xe1')](_0x3e0c07['query'][_0x9f96('0x65')])['then'](function(){if(_[_0x9f96('0xe2')](_0x3e0c07[_0x9f96('0x3f')][_0x9f96('0x65')])){for(var _0x421997=0x0;_0x421997<_0x3e0c07['query']['ids'][_0x9f96('0x45')];_0x421997+=0x1){socket[_0x9f96('0xdf')](_0x9f96('0xe3'),{'UserId':Number(_0x3e0c07[_0x9f96('0x3f')][_0x9f96('0x65')][_0x421997]),'SmsAccountId':Number(_0x3e0c07[_0x9f96('0x5e')]['id'])});}}else{socket[_0x9f96('0xdf')](_0x9f96('0xe3'),{'UserId':Number(_0x3e0c07[_0x9f96('0x3f')][_0x9f96('0x65')]),'SmsAccountId':Number(_0x3e0c07[_0x9f96('0x5e')]['id'])});}});}})[_0x9f96('0x1f')](respondWithStatusCode(_0x7745aa,null))[_0x9f96('0x27')](handleError(_0x7745aa,null));};exports[_0x9f96('0xe4')]=function(_0x360384,_0x1daf15,_0x14ca59){var _0x333e99={};var _0x598b18={};var _0xff9245;var _0x46dd9f;return db[_0x9f96('0x38')][_0x9f96('0x63')]({'where':{'id':_0x360384[_0x9f96('0x5e')]['id']}})[_0x9f96('0x1f')](handleEntityNotFound(_0x1daf15,null))[_0x9f96('0x1f')](function(_0x40ee81){if(_0x40ee81){_0xff9245=_0x40ee81;_0x598b18[_0x9f96('0x3d')]=_[_0x9f96('0x40')](db[_0x9f96('0xad')][_0x9f96('0x39')]);_0x598b18['query']=_[_0x9f96('0x40')](_0x360384[_0x9f96('0x3f')]);_0x598b18['filters']=_[_0x9f96('0x42')](_0x598b18[_0x9f96('0x3d')],_0x598b18[_0x9f96('0x3f')]);_0x333e99[_0x9f96('0x43')]=_[_0x9f96('0x42')](_0x598b18['model'],qs[_0x9f96('0x44')](_0x360384[_0x9f96('0x3f')][_0x9f96('0x44')]));_0x333e99[_0x9f96('0x43')]=_0x333e99[_0x9f96('0x43')][_0x9f96('0x45')]?_0x333e99[_0x9f96('0x43')]:_0x598b18[_0x9f96('0x3d')];_0x333e99['order']=qs['sort'](_0x360384[_0x9f96('0x3f')][_0x9f96('0x49')]);_0x333e99[_0x9f96('0x4c')]=qs['filters'](_[_0x9f96('0x4a')](_0x360384['query'],_0x598b18['filters']));if(_0x360384['query'][_0x9f96('0x4b')]){_0x333e99[_0x9f96('0x4c')]=_[_0x9f96('0x4d')](_0x333e99[_0x9f96('0x4c')],{'$or':_['map'](_0x333e99['attributes'],function(_0x519632){var _0xfc9c21={};_0xfc9c21[_0x519632]={'$like':'%'+_0x360384[_0x9f96('0x3f')][_0x9f96('0x4b')]+'%'};return _0xfc9c21;})});}_0x333e99=_['merge']({},_0x333e99,_0x360384['options']);return _0xff9245[_0x9f96('0xe4')](_0x333e99);}})[_0x9f96('0x1f')](function(_0x2555ce){if(_0x2555ce){_0x46dd9f=_0x2555ce[_0x9f96('0x45')];if(!_0x360384[_0x9f96('0x3f')][_0x9f96('0x46')](_0x9f96('0x47'))){_0x333e99[_0x9f96('0x2c')]=qs['limit'](_0x360384['query'][_0x9f96('0x2c')]);_0x333e99[_0x9f96('0x2a')]=qs[_0x9f96('0x2a')](_0x360384[_0x9f96('0x3f')][_0x9f96('0x2a')]);}return _0xff9245[_0x9f96('0xe4')](_0x333e99);}})[_0x9f96('0x1f')](function(_0x52f530){if(_0x52f530){return _0x52f530?{'count':_0x46dd9f,'rows':_0x52f530}:null;}})[_0x9f96('0x1f')](respondWithResult(_0x1daf15,null))['catch'](handleError(_0x1daf15,null));}; \ No newline at end of file +var _0xfc00=['ejs','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./smsAccount.socket','register','jayson/promise','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','sendStatus','end','json','offset','undefined','limit','count','Content-Range','reject','save','update','SmsAccounts','destroy','status','stack','name','Pause','mandatoryDispositionPause','map','SmsAccount','rawAttributes','fieldName','model','query','keys','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','pick','type','VIRTUAL','filter','merge','options','findAll','rows','params','includeAll','find','create','body','user','get','role','UserProfileSection','userProfileId','UserProfileResource','describe','addDisposition','SmsAccountId','getDispositions','findOne','Disposition','include','removeDispositions','ids','CannedAnswer','getAnswers','removeAnswers','notify','sms','SmsApplication','Applications','account','applications','orderBy','priority','asc','CmContact','Sequelize','ValidationError','createdAt','difference','updatedAt','ListId','twilio','from','From','messageId','MessageSid','skebby','sender','text','connectel','clicksend','Text','MessageUUID','infobip','results','csc','originatingAddress','segmentedMessage','fromNumber','refid','isNil','body\x20is\x20mandatory\x20and\x20not\x20empty','mapKey','includes','mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','CmList','Contacts','list','omit','SmsInteraction','spread','interaction','created','autoclose','close','unmanaged','*,*,*,*','SmsMessage','ContactId','UserId','User','unshift','agent','queueId','SmsQueue','queue','waitForTheAssignedQueue','Start','startRouting','receiveMessage','entity\x20found','set','Content-Type','text/xml','send','\x0a','sequelize','READ_COMMITTED','bulkCreate','findAndCountAll','getApplications','getInteractions','Contact','fullname','internal','Tag','Tags','color','tag','to\x20is\x20mandatory','List','DESC','dataValues','Messages','push','received\x20delivery\x20report\x20from','inspect','statusInt','message_id','status_code','DELIVERED','clickatell','bandwidth','redif','groupName','DELIVERED_TO_GATEWAY','RECEIVED_BY_RECIPIENT','message-delivered','intelepeer','ACCEPTD','statusGet','state','addAgents','emit','removeAgents','isArray','userSmsAccount:remove','getAgents','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','mustache','path','sox'];(function(_0x5d30b4,_0x199248){var _0x1acfb8=function(_0x3544b2){while(--_0x3544b2){_0x5d30b4['push'](_0x5d30b4['shift']());}};_0x1acfb8(++_0x199248);}(_0xfc00,0xd9));var _0x0fc0=function(_0x102ff9,_0x907658){_0x102ff9=_0x102ff9-0x0;var _0x24fa97=_0xfc00[_0x102ff9];return _0x24fa97;};'use strict';var emlformat=require(_0x0fc0('0x0'));var rimraf=require(_0x0fc0('0x1'));var zipdir=require(_0x0fc0('0x2'));var jsonpatch=require(_0x0fc0('0x3'));var rp=require(_0x0fc0('0x4'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0x0fc0('0x5'));var util=require('util');var path=require(_0x0fc0('0x6'));var sox=require(_0x0fc0('0x7'));var csv=require('to-csv');var ejs=require(_0x0fc0('0x8'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0x0fc0('0x9'));var crypto=require(_0x0fc0('0xa'));var jsforce=require(_0x0fc0('0xb'));var deskjs=require(_0x0fc0('0xc'));var toCsv=require('to-csv');var querystring=require(_0x0fc0('0xd'));var Papa=require(_0x0fc0('0xe'));var Redis=require(_0x0fc0('0xf'));var authService=require(_0x0fc0('0x10'));var qs=require(_0x0fc0('0x11'));var as=require(_0x0fc0('0x12'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x0fc0('0x13'))('api');var utils=require(_0x0fc0('0x14'));var config=require(_0x0fc0('0x15'));var licenseUtil=require(_0x0fc0('0x16'));var db=require(_0x0fc0('0x17'))['db'];config[_0x0fc0('0x18')]=_[_0x0fc0('0x19')](config[_0x0fc0('0x18')],{'host':_0x0fc0('0x1a'),'port':0x18eb});var socket=require(_0x0fc0('0x1b'))(new Redis(config[_0x0fc0('0x18')]));require(_0x0fc0('0x1c'))[_0x0fc0('0x1d')](socket);var jayson=require(_0x0fc0('0x1e'));var client=jayson[_0x0fc0('0x1f')][_0x0fc0('0x20')]({'port':0x232c});function respondWithRpcPromise(_0x1898a9,_0x3ab66e,_0x3efe09,_0x5d6487){return new BPromise(function(_0x13cdca,_0x3bd5a3){var _0xb3f8c9=_0x5d6487||client;return _0xb3f8c9[_0x0fc0('0x21')](_0x1898a9,_0x3efe09)[_0x0fc0('0x22')](function(_0x56db2b){logger[_0x0fc0('0x23')](_0x0fc0('0x24'),_0x3ab66e,_0x0fc0('0x25'));logger[_0x0fc0('0x26')](_0x0fc0('0x27'),_0x3ab66e,_0x0fc0('0x25'),JSON[_0x0fc0('0x28')](_0x56db2b));if(_0x56db2b[_0x0fc0('0x29')]){if(_0x56db2b[_0x0fc0('0x29')][_0x0fc0('0x2a')]===0x1f4){logger['error'](_0x0fc0('0x24'),_0x3ab66e,_0x56db2b[_0x0fc0('0x29')][_0x0fc0('0x2b')]);return _0x3bd5a3(_0x56db2b['error'][_0x0fc0('0x2b')]);}logger[_0x0fc0('0x29')]('SmsAccount,\x20%s,\x20%s',_0x3ab66e,_0x56db2b['error'][_0x0fc0('0x2b')]);return _0x13cdca(_0x56db2b[_0x0fc0('0x29')]['message']);}else{logger[_0x0fc0('0x23')](_0x0fc0('0x24'),_0x3ab66e,_0x0fc0('0x25'));_0x13cdca(_0x56db2b[_0x0fc0('0x2c')][_0x0fc0('0x2b')]);}})[_0x0fc0('0x2d')](function(_0x280ea3){logger[_0x0fc0('0x29')](_0x0fc0('0x24'),_0x3ab66e,_0x280ea3);_0x3bd5a3(_0x280ea3);});});}function respondWithStatusCode(_0x11b3d9,_0x437673){_0x437673=_0x437673||0xcc;return function(_0x253dd2){if(_0x253dd2){return _0x11b3d9[_0x0fc0('0x2e')](_0x437673);}return _0x11b3d9['status'](_0x437673)[_0x0fc0('0x2f')]();};}function respondWithResult(_0x2689fd,_0x59f250){_0x59f250=_0x59f250||0xc8;return function(_0x4ab837){if(_0x4ab837){return _0x2689fd['status'](_0x59f250)[_0x0fc0('0x30')](_0x4ab837);}};}function respondWithFilteredResult(_0x3d4fe1,_0x400f5c){return function(_0x4bd1de){if(_0x4bd1de){var _0x15ac51=typeof _0x400f5c[_0x0fc0('0x31')]===_0x0fc0('0x32')&&typeof _0x400f5c[_0x0fc0('0x33')]===_0x0fc0('0x32');var _0x47cf09=_0x4bd1de[_0x0fc0('0x34')];var _0x435125=_0x15ac51?0x0:_0x400f5c[_0x0fc0('0x31')];var _0x4fa3b5=_0x15ac51?_0x4bd1de[_0x0fc0('0x34')]:_0x400f5c[_0x0fc0('0x31')]+_0x400f5c[_0x0fc0('0x33')];var _0x1ebcef;if(_0x4fa3b5>=_0x47cf09){_0x4fa3b5=_0x47cf09;_0x1ebcef=0xc8;}else{_0x1ebcef=0xce;}_0x3d4fe1['status'](_0x1ebcef);return _0x3d4fe1['set'](_0x0fc0('0x35'),_0x435125+'-'+_0x4fa3b5+'/'+_0x47cf09)[_0x0fc0('0x30')](_0x4bd1de);}return null;};}function patchUpdates(_0x34c44f){return function(_0x293e50){try{jsonpatch['apply'](_0x293e50,_0x34c44f,!![]);}catch(_0x1f4709){return BPromise[_0x0fc0('0x36')](_0x1f4709);}return _0x293e50[_0x0fc0('0x37')]();};}function saveUpdates(_0x4905d4,_0x46e933){return function(_0x49abc9){if(_0x49abc9){return _0x49abc9[_0x0fc0('0x38')](_0x4905d4)[_0x0fc0('0x22')](function(_0x2f9a99){return _0x2f9a99;});}return null;};}function removeEntity(_0xbc73ff,_0x2d40bb){return function(_0x220c38){if(_0x220c38){return _0x220c38['destroy']()[_0x0fc0('0x22')](function(){var _0x2b18cc=_0x220c38['get']({'plain':!![]});var _0x5f1753=_0x0fc0('0x39');return db['UserProfileResource'][_0x0fc0('0x3a')]({'where':{'type':_0x5f1753,'resourceId':_0x2b18cc['id']}})['then'](function(){return _0x220c38;});})[_0x0fc0('0x22')](function(){_0xbc73ff[_0x0fc0('0x3b')](0xcc)[_0x0fc0('0x2f')]();});}};}function handleEntityNotFound(_0x1ecfe1,_0x10ef23){return function(_0x5cfa07){if(!_0x5cfa07){_0x1ecfe1[_0x0fc0('0x2e')](0x194);}return _0x5cfa07;};}function handleError(_0x2036ff,_0x5a4ffd){_0x5a4ffd=_0x5a4ffd||0x1f4;return function(_0x100e31){logger[_0x0fc0('0x29')](_0x100e31[_0x0fc0('0x3c')]);if(_0x100e31[_0x0fc0('0x3d')]){delete _0x100e31[_0x0fc0('0x3d')];}_0x2036ff[_0x0fc0('0x3b')](_0x5a4ffd)['send'](_0x100e31);};}exports['index']=function(_0x2a08cf,_0x4e7a6f){var _0x5094e8={'include':[{'model':db[_0x0fc0('0x3e')],'as':_0x0fc0('0x3f')}]},_0x413b33={},_0x294bad={'count':0x0,'rows':[]};var _0x3cad2c=_[_0x0fc0('0x40')](db[_0x0fc0('0x41')][_0x0fc0('0x42')],function(_0x1addb1){return{'name':_0x1addb1[_0x0fc0('0x43')],'type':_0x1addb1['type']['key']};});_0x413b33[_0x0fc0('0x44')]=_['map'](_0x3cad2c,_0x0fc0('0x3d'));_0x413b33[_0x0fc0('0x45')]=_[_0x0fc0('0x46')](_0x2a08cf['query']);_0x413b33[_0x0fc0('0x47')]=_[_0x0fc0('0x48')](_0x413b33[_0x0fc0('0x44')],_0x413b33['query']);_0x5094e8['attributes']=_[_0x0fc0('0x48')](_0x413b33['model'],qs['fields'](_0x2a08cf[_0x0fc0('0x45')][_0x0fc0('0x49')]));_0x5094e8[_0x0fc0('0x4a')]=_0x5094e8[_0x0fc0('0x4a')][_0x0fc0('0x4b')]?_0x5094e8['attributes']:_0x413b33[_0x0fc0('0x44')];if(!_0x2a08cf['query'][_0x0fc0('0x4c')](_0x0fc0('0x4d'))){_0x5094e8[_0x0fc0('0x33')]=qs[_0x0fc0('0x33')](_0x2a08cf[_0x0fc0('0x45')]['limit']);_0x5094e8[_0x0fc0('0x31')]=qs[_0x0fc0('0x31')](_0x2a08cf['query']['offset']);}_0x5094e8[_0x0fc0('0x4e')]=qs[_0x0fc0('0x4f')](_0x2a08cf[_0x0fc0('0x45')][_0x0fc0('0x4f')]);_0x5094e8[_0x0fc0('0x50')]=qs['filters'](_[_0x0fc0('0x51')](_0x2a08cf[_0x0fc0('0x45')],_0x413b33['filters']),_0x3cad2c);if(_0x2a08cf[_0x0fc0('0x45')]['filter']){_0x5094e8[_0x0fc0('0x50')]=_['merge'](_0x5094e8['where'],{'$or':_[_0x0fc0('0x40')](_0x3cad2c,function(_0x20dd9b){if(_0x20dd9b[_0x0fc0('0x52')]!==_0x0fc0('0x53')){var _0x214606={};_0x214606[_0x20dd9b[_0x0fc0('0x3d')]]={'$like':'%'+_0x2a08cf[_0x0fc0('0x45')][_0x0fc0('0x54')]+'%'};return _0x214606;}})});}_0x5094e8=_[_0x0fc0('0x55')]({},_0x5094e8,_0x2a08cf[_0x0fc0('0x56')]);var _0x49ece={'where':_0x5094e8[_0x0fc0('0x50')]};return db['SmsAccount'][_0x0fc0('0x34')](_0x49ece)[_0x0fc0('0x22')](function(_0x41c85d){_0x294bad[_0x0fc0('0x34')]=_0x41c85d;if(_0x2a08cf['query']['includeAll']){_0x5094e8['include']=[{'all':!![]}];}return db[_0x0fc0('0x41')][_0x0fc0('0x57')](_0x5094e8);})['then'](function(_0x1fbf4d){_0x294bad[_0x0fc0('0x58')]=_0x1fbf4d;return _0x294bad;})[_0x0fc0('0x22')](respondWithFilteredResult(_0x4e7a6f,_0x5094e8))['catch'](handleError(_0x4e7a6f,null));};exports['show']=function(_0x2e87dc,_0x54daf0){var _0x444d37={'raw':![],'where':{'id':_0x2e87dc[_0x0fc0('0x59')]['id']},'include':[{'model':db['Pause'],'as':_0x0fc0('0x3f')}]},_0x1b71a4={};_0x1b71a4[_0x0fc0('0x44')]=_[_0x0fc0('0x46')](db[_0x0fc0('0x41')]['rawAttributes']);_0x1b71a4[_0x0fc0('0x45')]=_[_0x0fc0('0x46')](_0x2e87dc[_0x0fc0('0x45')]);_0x1b71a4[_0x0fc0('0x47')]=_['intersection'](_0x1b71a4[_0x0fc0('0x44')],_0x1b71a4[_0x0fc0('0x45')]);_0x444d37['attributes']=_[_0x0fc0('0x48')](_0x1b71a4['model'],qs[_0x0fc0('0x49')](_0x2e87dc[_0x0fc0('0x45')][_0x0fc0('0x49')]));_0x444d37['attributes']=_0x444d37[_0x0fc0('0x4a')][_0x0fc0('0x4b')]?_0x444d37['attributes']:_0x1b71a4['model'];if(_0x2e87dc[_0x0fc0('0x45')][_0x0fc0('0x5a')]){_0x444d37['include']=[{'all':!![]}];}_0x444d37=_[_0x0fc0('0x55')]({},_0x444d37,_0x2e87dc[_0x0fc0('0x56')]);return db[_0x0fc0('0x41')][_0x0fc0('0x5b')](_0x444d37)[_0x0fc0('0x22')](handleEntityNotFound(_0x54daf0,null))[_0x0fc0('0x22')](respondWithResult(_0x54daf0,null))[_0x0fc0('0x2d')](handleError(_0x54daf0,null));};exports['create']=function(_0x5dd77c,_0x2cabd1){return db[_0x0fc0('0x41')][_0x0fc0('0x5c')](_0x5dd77c[_0x0fc0('0x5d')],{})[_0x0fc0('0x22')](function(_0x1c1ee8){var _0x3928e0=_0x5dd77c[_0x0fc0('0x5e')][_0x0fc0('0x5f')]({'plain':!![]});if(!_0x3928e0)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x3928e0[_0x0fc0('0x60')]===_0x0fc0('0x5e')){var _0x5e8a43=_0x1c1ee8[_0x0fc0('0x5f')]({'plain':!![]});var _0x3ce8e2='SmsAccounts';return db[_0x0fc0('0x61')][_0x0fc0('0x5b')]({'where':{'name':_0x3ce8e2,'userProfileId':_0x3928e0[_0x0fc0('0x62')]},'raw':!![]})[_0x0fc0('0x22')](function(_0x4c1ea2){if(_0x4c1ea2&&_0x4c1ea2['autoAssociation']===0x0){return db[_0x0fc0('0x63')][_0x0fc0('0x5c')]({'name':_0x5e8a43[_0x0fc0('0x3d')],'resourceId':_0x5e8a43['id'],'type':_0x4c1ea2[_0x0fc0('0x3d')],'sectionId':_0x4c1ea2['id']},{})['then'](function(){return _0x1c1ee8;});}else{return _0x1c1ee8;}})[_0x0fc0('0x2d')](function(_0x4888f6){logger[_0x0fc0('0x29')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x4888f6);throw _0x4888f6;});}return _0x1c1ee8;})['then'](respondWithResult(_0x2cabd1,0xc9))[_0x0fc0('0x2d')](handleError(_0x2cabd1,null));};exports['update']=function(_0x2c59d1,_0x5497ff){if(_0x2c59d1[_0x0fc0('0x5d')]['id']){delete _0x2c59d1['body']['id'];}return db[_0x0fc0('0x41')]['find']({'where':{'id':_0x2c59d1['params']['id']},'include':[{'model':db[_0x0fc0('0x3e')],'as':_0x0fc0('0x3f')}]})[_0x0fc0('0x22')](handleEntityNotFound(_0x5497ff,null))[_0x0fc0('0x22')](saveUpdates(_0x2c59d1[_0x0fc0('0x5d')],null))[_0x0fc0('0x22')](respondWithResult(_0x5497ff,null))[_0x0fc0('0x2d')](handleError(_0x5497ff,null));};exports[_0x0fc0('0x3a')]=function(_0x15d5f8,_0x3d919c){return db[_0x0fc0('0x41')][_0x0fc0('0x5b')]({'where':{'id':_0x15d5f8['params']['id']}})[_0x0fc0('0x22')](handleEntityNotFound(_0x3d919c,null))[_0x0fc0('0x22')](removeEntity(_0x3d919c,null))[_0x0fc0('0x2d')](handleError(_0x3d919c,null));};exports[_0x0fc0('0x64')]=function(_0x12a759,_0x29047d){return db[_0x0fc0('0x41')]['describe']()[_0x0fc0('0x22')](respondWithResult(_0x29047d,null))[_0x0fc0('0x2d')](handleError(_0x29047d,null));};exports[_0x0fc0('0x65')]=function(_0x2935ef,_0x1aadd0,_0x3ebfef){if(_0x2935ef[_0x0fc0('0x5d')]['id']){delete _0x2935ef['body']['id'];}return db[_0x0fc0('0x41')][_0x0fc0('0x5b')]({'where':{'id':_0x2935ef[_0x0fc0('0x59')]['id']}})[_0x0fc0('0x22')](handleEntityNotFound(_0x1aadd0,null))[_0x0fc0('0x22')](function(_0x346f2d){if(_0x346f2d){_0x2935ef[_0x0fc0('0x5d')][_0x0fc0('0x66')]=_0x346f2d['id'];return db['Disposition'][_0x0fc0('0x5c')](_0x2935ef[_0x0fc0('0x5d')]);}})[_0x0fc0('0x22')](respondWithResult(_0x1aadd0,null))[_0x0fc0('0x2d')](handleError(_0x1aadd0,null));};exports[_0x0fc0('0x67')]=function(_0x232ba6,_0x57c032,_0x106048){var _0x19daba={'raw':![],'where':{}};var _0x3a4992={};var _0x326b2d={'count':0x0,'rows':[]};return db[_0x0fc0('0x41')][_0x0fc0('0x68')]({'where':{'id':_0x232ba6['params']['id']}})[_0x0fc0('0x22')](handleEntityNotFound(_0x57c032,null))[_0x0fc0('0x22')](function(_0x5ab892){if(_0x5ab892){_0x3a4992[_0x0fc0('0x44')]=_[_0x0fc0('0x46')](db[_0x0fc0('0x69')]['rawAttributes']);_0x3a4992[_0x0fc0('0x45')]=_[_0x0fc0('0x46')](_0x232ba6[_0x0fc0('0x45')]);_0x3a4992[_0x0fc0('0x47')]=_[_0x0fc0('0x48')](_0x3a4992[_0x0fc0('0x44')],_0x3a4992[_0x0fc0('0x45')]);_0x19daba[_0x0fc0('0x4a')]=_[_0x0fc0('0x48')](_0x3a4992[_0x0fc0('0x44')],qs[_0x0fc0('0x49')](_0x232ba6[_0x0fc0('0x45')][_0x0fc0('0x49')]));_0x19daba[_0x0fc0('0x4a')]=_0x19daba['attributes']['length']?_0x19daba['attributes']:_0x3a4992[_0x0fc0('0x44')];if(!_0x232ba6[_0x0fc0('0x45')][_0x0fc0('0x4c')]('nolimit')){_0x19daba[_0x0fc0('0x33')]=qs[_0x0fc0('0x33')](_0x232ba6[_0x0fc0('0x45')]['limit']);_0x19daba[_0x0fc0('0x31')]=qs[_0x0fc0('0x31')](_0x232ba6[_0x0fc0('0x45')][_0x0fc0('0x31')]);}_0x19daba[_0x0fc0('0x4e')]=qs[_0x0fc0('0x4f')](_0x232ba6[_0x0fc0('0x45')][_0x0fc0('0x4f')]);_0x19daba['where']=qs[_0x0fc0('0x47')](_[_0x0fc0('0x51')](_0x232ba6[_0x0fc0('0x45')],_0x3a4992[_0x0fc0('0x47')]));_0x19daba[_0x0fc0('0x50')]['SmsAccountId']=_0x5ab892['id'];if(_0x232ba6['query'][_0x0fc0('0x54')]){_0x19daba[_0x0fc0('0x50')]=_[_0x0fc0('0x55')](_0x19daba[_0x0fc0('0x50')],{'$or':_[_0x0fc0('0x40')](_0x19daba[_0x0fc0('0x4a')],function(_0x35719e){var _0x3900f3={};_0x3900f3[_0x35719e]={'$like':'%'+_0x232ba6[_0x0fc0('0x45')][_0x0fc0('0x54')]+'%'};return _0x3900f3;})});}_0x19daba=_[_0x0fc0('0x55')]({},_0x19daba,_0x232ba6[_0x0fc0('0x56')]);return db[_0x0fc0('0x69')][_0x0fc0('0x34')]({'where':_0x19daba[_0x0fc0('0x50')]})[_0x0fc0('0x22')](function(_0x21a88c){_0x326b2d[_0x0fc0('0x34')]=_0x21a88c;if(_0x232ba6[_0x0fc0('0x45')]['includeAll']){_0x19daba[_0x0fc0('0x6a')]=[{'all':!![]}];}return db[_0x0fc0('0x69')][_0x0fc0('0x57')](_0x19daba);})['then'](function(_0x16624a){_0x326b2d[_0x0fc0('0x58')]=_0x16624a;return _0x326b2d;});}})['then'](respondWithFilteredResult(_0x57c032,_0x19daba))[_0x0fc0('0x2d')](handleError(_0x57c032,null));};exports[_0x0fc0('0x6b')]=function(_0x4cd05f,_0x14c7be,_0x44940d){return db[_0x0fc0('0x41')][_0x0fc0('0x5b')]({'where':{'id':_0x4cd05f[_0x0fc0('0x59')]['id']}})[_0x0fc0('0x22')](handleEntityNotFound(_0x14c7be,null))[_0x0fc0('0x22')](function(_0x15de4e){if(_0x15de4e){return _0x15de4e[_0x0fc0('0x6b')](_0x4cd05f[_0x0fc0('0x45')][_0x0fc0('0x6c')]);}})[_0x0fc0('0x22')](respondWithStatusCode(_0x14c7be,null))[_0x0fc0('0x2d')](handleError(_0x14c7be,null));};exports['addAnswer']=function(_0x11506c,_0x30f59e,_0x2f4e41){if(_0x11506c[_0x0fc0('0x5d')]['id']){delete _0x11506c[_0x0fc0('0x5d')]['id'];}return db[_0x0fc0('0x41')]['find']({'where':{'id':_0x11506c[_0x0fc0('0x59')]['id']}})[_0x0fc0('0x22')](handleEntityNotFound(_0x30f59e,null))[_0x0fc0('0x22')](function(_0x469921){if(_0x469921){_0x11506c[_0x0fc0('0x5d')][_0x0fc0('0x66')]=_0x469921['id'];return db[_0x0fc0('0x6d')]['create'](_0x11506c['body']);}})[_0x0fc0('0x22')](respondWithResult(_0x30f59e,null))[_0x0fc0('0x2d')](handleError(_0x30f59e,null));};exports[_0x0fc0('0x6e')]=function(_0x1fd51b,_0x3d5e93,_0x2a73fa){var _0x505bc9={'raw':![],'where':{}};var _0x3cc79f={};var _0x1d7779={'count':0x0,'rows':[]};return db[_0x0fc0('0x41')][_0x0fc0('0x68')]({'where':{'id':_0x1fd51b[_0x0fc0('0x59')]['id']}})[_0x0fc0('0x22')](handleEntityNotFound(_0x3d5e93,null))[_0x0fc0('0x22')](function(_0x14410c){if(_0x14410c){_0x3cc79f[_0x0fc0('0x44')]=_[_0x0fc0('0x46')](db[_0x0fc0('0x6d')][_0x0fc0('0x42')]);_0x3cc79f['query']=_[_0x0fc0('0x46')](_0x1fd51b[_0x0fc0('0x45')]);_0x3cc79f[_0x0fc0('0x47')]=_[_0x0fc0('0x48')](_0x3cc79f[_0x0fc0('0x44')],_0x3cc79f[_0x0fc0('0x45')]);_0x505bc9[_0x0fc0('0x4a')]=_[_0x0fc0('0x48')](_0x3cc79f[_0x0fc0('0x44')],qs[_0x0fc0('0x49')](_0x1fd51b[_0x0fc0('0x45')][_0x0fc0('0x49')]));_0x505bc9[_0x0fc0('0x4a')]=_0x505bc9[_0x0fc0('0x4a')]['length']?_0x505bc9['attributes']:_0x3cc79f[_0x0fc0('0x44')];if(!_0x1fd51b[_0x0fc0('0x45')]['hasOwnProperty'](_0x0fc0('0x4d'))){_0x505bc9[_0x0fc0('0x33')]=qs[_0x0fc0('0x33')](_0x1fd51b[_0x0fc0('0x45')]['limit']);_0x505bc9[_0x0fc0('0x31')]=qs[_0x0fc0('0x31')](_0x1fd51b['query'][_0x0fc0('0x31')]);}_0x505bc9[_0x0fc0('0x4e')]=qs[_0x0fc0('0x4f')](_0x1fd51b['query']['sort']);_0x505bc9[_0x0fc0('0x50')]=qs[_0x0fc0('0x47')](_[_0x0fc0('0x51')](_0x1fd51b[_0x0fc0('0x45')],_0x3cc79f[_0x0fc0('0x47')]));_0x505bc9[_0x0fc0('0x50')][_0x0fc0('0x66')]=_0x14410c['id'];if(_0x1fd51b[_0x0fc0('0x45')][_0x0fc0('0x54')]){_0x505bc9['where']=_[_0x0fc0('0x55')](_0x505bc9[_0x0fc0('0x50')],{'$or':_[_0x0fc0('0x40')](_0x505bc9[_0x0fc0('0x4a')],function(_0x43e199){var _0x13edc5={};_0x13edc5[_0x43e199]={'$like':'%'+_0x1fd51b['query']['filter']+'%'};return _0x13edc5;})});}_0x505bc9=_['merge']({},_0x505bc9,_0x1fd51b[_0x0fc0('0x56')]);return db[_0x0fc0('0x6d')]['count']({'where':_0x505bc9['where']})[_0x0fc0('0x22')](function(_0x24e4d2){_0x1d7779['count']=_0x24e4d2;if(_0x1fd51b['query'][_0x0fc0('0x5a')]){_0x505bc9[_0x0fc0('0x6a')]=[{'all':!![]}];}return db[_0x0fc0('0x6d')][_0x0fc0('0x57')](_0x505bc9);})[_0x0fc0('0x22')](function(_0x39e649){_0x1d7779[_0x0fc0('0x58')]=_0x39e649;return _0x1d7779;});}})[_0x0fc0('0x22')](respondWithFilteredResult(_0x3d5e93,_0x505bc9))[_0x0fc0('0x2d')](handleError(_0x3d5e93,null));};exports[_0x0fc0('0x6f')]=function(_0xec1ac6,_0x564847,_0x2e64d8){return db[_0x0fc0('0x41')][_0x0fc0('0x5b')]({'where':{'id':_0xec1ac6[_0x0fc0('0x59')]['id']}})['then'](handleEntityNotFound(_0x564847,null))[_0x0fc0('0x22')](function(_0x17e7fd){if(_0x17e7fd){return _0x17e7fd[_0x0fc0('0x6f')](_0xec1ac6[_0x0fc0('0x45')][_0x0fc0('0x6c')]);}})[_0x0fc0('0x22')](respondWithStatusCode(_0x564847,null))[_0x0fc0('0x2d')](handleError(_0x564847,null));};exports[_0x0fc0('0x70')]=function(_0x4dc35a,_0x1afe3d,_0x507474){var _0x36f148={'channel':_0x0fc0('0x71')};var _0x43759c=[];var _0xd336a7=[];var _0x2e3aae={};return db[_0x0fc0('0x41')][_0x0fc0('0x5b')]({'where':{'id':_0x4dc35a[_0x0fc0('0x59')]['id']},'include':[{'model':db[_0x0fc0('0x72')],'as':_0x0fc0('0x73')}]})[_0x0fc0('0x22')](handleEntityNotFound(_0x1afe3d,null))[_0x0fc0('0x22')](function(_0xde46d2){_0x36f148[_0x0fc0('0x74')]=_0xde46d2;_0x36f148[_0x0fc0('0x75')]=_[_0x0fc0('0x76')](_0xde46d2[_0x0fc0('0x73')],[_0x0fc0('0x77')],[_0x0fc0('0x78')]);if(_0x36f148['account'][_0x0fc0('0x73')]){delete _0x36f148[_0x0fc0('0x74')][_0x0fc0('0x73')];}return db[_0x0fc0('0x79')][_0x0fc0('0x64')]();})[_0x0fc0('0x22')](function(_0x211a87){if(!_0x211a87){throw new db[(_0x0fc0('0x7a'))][(_0x0fc0('0x7b'))]('no\x20available\x20attributes');}_0x43759c=_['difference'](_[_0x0fc0('0x46')](_0x211a87),[_0x0fc0('0x7c'),'updatedAt']);_0xd336a7=_[_0x0fc0('0x7d')](_[_0x0fc0('0x46')](_0x211a87),[_0x0fc0('0x7c'),_0x0fc0('0x7e'),'CompanyId',_0x0fc0('0x7f')]);_0x36f148[_0x0fc0('0x5d')]={'mapKey':'mobile'};if(_0x36f148[_0x0fc0('0x74')]['type']){switch(_0x36f148[_0x0fc0('0x74')]['type']){case _0x0fc0('0x80'):_0x36f148[_0x0fc0('0x5d')][_0x0fc0('0x81')]=_0x4dc35a[_0x0fc0('0x5d')][_0x0fc0('0x82')];_0x36f148[_0x0fc0('0x5d')][_0x0fc0('0x5d')]=_0x4dc35a[_0x0fc0('0x5d')]['Body'];_0x36f148[_0x0fc0('0x5d')][_0x0fc0('0x83')]=_0x4dc35a['body'][_0x0fc0('0x84')];break;case _0x0fc0('0x85'):_0x36f148['body']['from']='+'+_0x4dc35a[_0x0fc0('0x5d')][_0x0fc0('0x86')];_0x36f148[_0x0fc0('0x5d')][_0x0fc0('0x5d')]=_0x4dc35a[_0x0fc0('0x5d')][_0x0fc0('0x87')];break;case _0x0fc0('0x88'):_0x36f148['body']['from']=_0x4dc35a[_0x0fc0('0x5d')][_0x0fc0('0x81')];_0x36f148['body'][_0x0fc0('0x5d')]=_0x4dc35a[_0x0fc0('0x5d')]['message'];break;case _0x0fc0('0x89'):_0x36f148[_0x0fc0('0x5d')]['from']=_0x4dc35a['body'][_0x0fc0('0x81')];_0x36f148['body']['body']=_0x4dc35a['body']['body'];_0x36f148[_0x0fc0('0x5d')][_0x0fc0('0x83')]=_0x4dc35a['body']['message_id'];break;case'plivo':_0x36f148[_0x0fc0('0x5d')][_0x0fc0('0x81')]=_0x4dc35a[_0x0fc0('0x5d')][_0x0fc0('0x82')];_0x36f148[_0x0fc0('0x5d')]['body']=_0x4dc35a[_0x0fc0('0x5d')][_0x0fc0('0x8a')];_0x36f148[_0x0fc0('0x5d')]['messageId']=_0x4dc35a['body'][_0x0fc0('0x8b')];break;case _0x0fc0('0x8c'):_0x36f148[_0x0fc0('0x5d')][_0x0fc0('0x81')]='+'+_0x4dc35a['body'][_0x0fc0('0x8d')][0x0][_0x0fc0('0x81')];_0x36f148[_0x0fc0('0x5d')]['body']=_0x4dc35a[_0x0fc0('0x5d')]['results'][0x0][_0x0fc0('0x87')];_0x36f148[_0x0fc0('0x5d')][_0x0fc0('0x83')]=_0x4dc35a['body'][_0x0fc0('0x8d')][0x0]['messageId'];break;case _0x0fc0('0x8e'):_0x36f148[_0x0fc0('0x5d')][_0x0fc0('0x81')]=_0x4dc35a['body'][_0x0fc0('0x8f')];_0x36f148['body'][_0x0fc0('0x5d')]=_0x4dc35a['body'][_0x0fc0('0x90')][_0x0fc0('0x2b')];break;case'clickatell':_0x36f148[_0x0fc0('0x5d')][_0x0fc0('0x81')]=_0x4dc35a[_0x0fc0('0x5d')][_0x0fc0('0x91')];_0x36f148['body'][_0x0fc0('0x5d')]=_0x4dc35a[_0x0fc0('0x5d')][_0x0fc0('0x87')];_0x36f148[_0x0fc0('0x5d')][_0x0fc0('0x83')]=_0x4dc35a[_0x0fc0('0x5d')]['replyMessageId'];break;case'bandwidth':_0x36f148['body'][_0x0fc0('0x83')]=_0x4dc35a[_0x0fc0('0x5d')][0x0][_0x0fc0('0x2b')]['id'];_0x36f148['body'][_0x0fc0('0x81')]=_0x4dc35a[_0x0fc0('0x5d')][0x0][_0x0fc0('0x2b')][_0x0fc0('0x81')];_0x36f148['body']['body']=_0x4dc35a[_0x0fc0('0x5d')][0x0]['message'][_0x0fc0('0x87')];break;case'intelepeer':_0x36f148[_0x0fc0('0x5d')]['from']=_0x4dc35a[_0x0fc0('0x5d')][_0x0fc0('0x81')];_0x36f148['body'][_0x0fc0('0x5d')]=_0x4dc35a['body']['message'];_0x36f148['body']['messageId']=_0x4dc35a[_0x0fc0('0x5d')][_0x0fc0('0x92')];break;}}if(_0x36f148[_0x0fc0('0x5d')]['id']){delete _0x36f148['body']['id'];}if(_[_0x0fc0('0x93')](_0x36f148[_0x0fc0('0x5d')][_0x0fc0('0x81')])){throw new db[(_0x0fc0('0x7a'))]['ValidationError']('from\x20is\x20mandatory');}if(_['isNil'](_0x36f148[_0x0fc0('0x5d')][_0x0fc0('0x5d')])||_0x36f148['body'][_0x0fc0('0x5d')]===''){throw new db['Sequelize'][(_0x0fc0('0x7b'))](_0x0fc0('0x94'));}if(_[_0x0fc0('0x93')](_0x36f148[_0x0fc0('0x5d')][_0x0fc0('0x95')])){throw new db[(_0x0fc0('0x7a'))]['ValidationError']('mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20'+_0xd336a7);}if(!_[_0x0fc0('0x96')](_0xd336a7,_0x36f148[_0x0fc0('0x5d')]['mapKey'])){throw new db[(_0x0fc0('0x7a'))][(_0x0fc0('0x7b'))](_0x0fc0('0x97')+_0xd336a7);}_0x2e3aae[_0x36f148[_0x0fc0('0x5d')]['mapKey']]=_0x36f148[_0x0fc0('0x5d')][_0x0fc0('0x81')];return db[_0x0fc0('0x98')][_0x0fc0('0x5b')]({'where':{'id':_0x36f148[_0x0fc0('0x74')]['ListId']},'include':[{'model':db[_0x0fc0('0x79')],'as':_0x0fc0('0x99'),'where':_0x2e3aae,'limit':0x1,'order':[[_0x0fc0('0x7e'),'DESC']]}]});})[_0x0fc0('0x22')](handleEntityNotFound(_0x1afe3d,null))['then'](function(_0x4bbb47){if(_0x4bbb47){_0x36f148[_0x0fc0('0x9a')]=_[_0x0fc0('0x9b')](_0x4bbb47,[_0x0fc0('0x99')]);if(_0x4bbb47['Contacts']['length']){return _0x4bbb47[_0x0fc0('0x99')][0x0];}var _0x571f8c=_[_0x0fc0('0x19')](_0x36f148[_0x0fc0('0x5d')],{'firstName':_0x36f148['body'][_0x0fc0('0x81')],'ListId':_0x4bbb47['id']});_0x571f8c[_0x36f148[_0x0fc0('0x5d')]['mapKey']]=_0x36f148[_0x0fc0('0x5d')][_0x0fc0('0x81')];return db[_0x0fc0('0x79')]['create'](_0x571f8c,{'fields':_0x43759c,'raw':!![]});}})[_0x0fc0('0x22')](handleEntityNotFound(_0x1afe3d,null))[_0x0fc0('0x22')](function(_0x989a2f){if(_0x989a2f){_0x36f148['contact']=_0x989a2f;var _0x180009={'ContactId':_0x989a2f['id'],'phone':_0x36f148[_0x0fc0('0x5d')][_0x0fc0('0x81')],'SmsAccountId':_0x4dc35a[_0x0fc0('0x59')]['id']};var _0x3d26fe={'ContactId':_0x989a2f['id'],'SmsAccountId':_0x4dc35a['params']['id'],'closed':![]};return db['SmsInteraction']['find']({'where':_0x3d26fe})[_0x0fc0('0x22')](function(_0x561536){if(_0x561536){return[_0x561536,![]];}return db[_0x0fc0('0x9c')]['create'](_0x180009)['then'](function(_0x5e14ec){return[_0x5e14ec,!![]];});});}})[_0x0fc0('0x9d')](function(_0x3118d1,_0x1fb686){_0x36f148[_0x0fc0('0x9e')]=_0x3118d1[_0x0fc0('0x5f')]({'plain':!![]});_0x36f148[_0x0fc0('0x9e')][_0x0fc0('0x9f')]=![];if(_0x1fb686){if(_0x36f148[_0x0fc0('0x74')][_0x0fc0('0xa0')]){_0x36f148[_0x0fc0('0x75')]['push']({'id':0x0,'priority':_0x36f148[_0x0fc0('0x75')]['length']+0x1,'app':_0x0fc0('0xa1'),'appdata':_0x0fc0('0xa2'),'interval':_0x0fc0('0xa3')});}_0x36f148[_0x0fc0('0x9e')][_0x0fc0('0x9f')]=!![];}return db[_0x0fc0('0xa4')][_0x0fc0('0x5c')]({'phone':_0x36f148[_0x0fc0('0x5d')]['from'],'messageId':_0x36f148[_0x0fc0('0x5d')][_0x0fc0('0x83')],'body':_0x36f148['body'][_0x0fc0('0x5d')],'SmsAccountId':_0x4dc35a[_0x0fc0('0x59')]['id'],'SmsInteractionId':_0x3118d1['id'],'direction':'in','ContactId':_0x3118d1[_0x0fc0('0xa5')],'AttachmentId':_0x36f148[_0x0fc0('0x5d')]['AttachmentId']});})[_0x0fc0('0x22')](function(_0x315fcb){_0x36f148['message']=_0x315fcb;if(!_0x36f148['interaction'][_0x0fc0('0xa6')])return;return db[_0x0fc0('0xa7')][_0x0fc0('0x5b')]({'attributes':['id',_0x0fc0('0x3d')],'where':{'id':_0x36f148[_0x0fc0('0x9e')][_0x0fc0('0xa6')]}});})['then'](function(_0x3631eb){if(_0x3631eb){_0x36f148[_0x0fc0('0x75')][_0x0fc0('0xa8')]({'id':0x0,'priority':0x0,'app':_0x0fc0('0xa9'),'appdata':_0x3631eb[_0x0fc0('0x3d')]+','+(_0x36f148[_0x0fc0('0x74')]['waitForTheAssignedAgent']||0xa),'interval':_0x0fc0('0xa3')});}if(!_0x36f148['interaction'][_0x0fc0('0xaa')])return;return db[_0x0fc0('0xab')][_0x0fc0('0x5b')]({'attributes':['id',_0x0fc0('0x3d')],'where':{'id':_0x36f148[_0x0fc0('0x9e')][_0x0fc0('0xaa')]}});})[_0x0fc0('0x22')](function(_0x16e9bb){if(_0x16e9bb){_0x36f148[_0x0fc0('0x75')][_0x0fc0('0xa8')]({'id':0x0,'priority':0x1,'app':_0x0fc0('0xac'),'appdata':_0x16e9bb['name']+','+(_0x36f148[_0x0fc0('0x74')][_0x0fc0('0xad')]||0x12c),'interval':_0x0fc0('0xa3')});}return respondWithRpcPromise(_0x0fc0('0xae'),_0x0fc0('0xaf'),_0x36f148);})[_0x0fc0('0x22')](function(_0x398ead){if(_0x398ead){var _0xa15c1e=0xc8;var _0x3e7aa8=_0x0fc0('0xb0');logger[_0x0fc0('0x23')](_0x0fc0('0x27'),_0x3e7aa8,_0xa15c1e,_0x0fc0('0xb1'));logger[_0x0fc0('0x26')]('SmsAccount,\x20%s,\x20%s,\x20%s,\x20%s',_0x3e7aa8,_0xa15c1e,_0x0fc0('0xb1'),JSON[_0x0fc0('0x28')](_0x398ead));if(_0x36f148[_0x0fc0('0x74')][_0x0fc0('0x52')]===_0x0fc0('0x80')){return _0x1afe3d[_0x0fc0('0x3b')](_0xa15c1e)[_0x0fc0('0xb2')](_0x0fc0('0xb3'),_0x0fc0('0xb4'))[_0x0fc0('0xb5')](_0x0fc0('0xb6'));}else{return _0x1afe3d['status'](_0xa15c1e)['json'](_0x398ead);}}})[_0x0fc0('0x2d')](handleError(_0x1afe3d,null));};exports['addApplications']=function(_0x46a087,_0x1df174){var _0x2b9332=_0x46a087[_0x0fc0('0x59')]['id'];var _0x3aa526=_0x46a087[_0x0fc0('0x5d')];var _0x1cba12=0xc8;var _0xe781f3=null;return db[_0x0fc0('0xb7')]['transaction']({'isolationLevel':db[_0x0fc0('0xb7')]['Transaction']['ISOLATION_LEVELS'][_0x0fc0('0xb8')]},function(_0x27a091){return db['SmsAccount'][_0x0fc0('0x68')]({'where':{'id':_0x2b9332},'transaction':_0x27a091})[_0x0fc0('0x22')](function(_0x301bb8){if(_0x301bb8){return db[_0x0fc0('0x72')][_0x0fc0('0x3a')]({'where':{'SmsAccountId':_0x2b9332},'transaction':_0x27a091})[_0x0fc0('0x22')](function(){var _0x443c84=_[_0x0fc0('0x40')](_0x3aa526,function(_0x3ae762){_0x3ae762['SmsAccountId']=_0x2b9332;return _0x3ae762;});return db[_0x0fc0('0x72')][_0x0fc0('0xb9')](_0x443c84,{'transaction':_0x27a091});});}else{_0x1cba12=0x194;_0xe781f3=[];}});})[_0x0fc0('0x22')](function(){if(_0x1cba12!==0x194){return db['SmsApplication'][_0x0fc0('0xba')]({'where':{'SmsAccountId':_0x2b9332},'order':_0x0fc0('0x77')})['then'](function(_0x137648){_0xe781f3=_0x137648;});}})[_0x0fc0('0x2d')](function(_0x140068){_0x1cba12=0x1f4;logger['error'](_0x140068[_0x0fc0('0x3c')]);if(_0x140068['name']){delete _0x140068['name'];}_0xe781f3=_0x140068;})['finally'](function(){if(_0xe781f3===null){_0x1df174[_0x0fc0('0x2e')](_0x1cba12);}else{if(_0x1cba12===0x1f4){_0x1df174[_0x0fc0('0x3b')](_0x1cba12)['send'](_0xe781f3);}else{_0x1df174[_0x0fc0('0x3b')](_0x1cba12)[_0x0fc0('0x30')](_0xe781f3);}}});};exports[_0x0fc0('0xbb')]=function(_0x1dc465,_0x22938f,_0x938ab4){var _0x447e77={};var _0x2cb44f={};var _0x4ad7dd;var _0x4930bd;return db['SmsAccount'][_0x0fc0('0x68')]({'where':{'id':_0x1dc465[_0x0fc0('0x59')]['id']}})[_0x0fc0('0x22')](handleEntityNotFound(_0x22938f,null))[_0x0fc0('0x22')](function(_0x28720f){if(_0x28720f){_0x4ad7dd=_0x28720f;_0x2cb44f['model']=_['keys'](db[_0x0fc0('0x72')]['rawAttributes']);_0x2cb44f[_0x0fc0('0x45')]=_[_0x0fc0('0x46')](_0x1dc465[_0x0fc0('0x45')]);_0x2cb44f[_0x0fc0('0x47')]=_[_0x0fc0('0x48')](_0x2cb44f[_0x0fc0('0x44')],_0x2cb44f['query']);_0x447e77['attributes']=_['intersection'](_0x2cb44f[_0x0fc0('0x44')],qs[_0x0fc0('0x49')](_0x1dc465[_0x0fc0('0x45')]['fields']));_0x447e77[_0x0fc0('0x4a')]=_0x447e77[_0x0fc0('0x4a')][_0x0fc0('0x4b')]?_0x447e77[_0x0fc0('0x4a')]:_0x2cb44f[_0x0fc0('0x44')];_0x447e77[_0x0fc0('0x4e')]=qs[_0x0fc0('0x4f')](_0x1dc465['query'][_0x0fc0('0x4f')]);_0x447e77[_0x0fc0('0x50')]=qs['filters'](_[_0x0fc0('0x51')](_0x1dc465[_0x0fc0('0x45')],_0x2cb44f[_0x0fc0('0x47')]));if(_0x1dc465['query']['filter']){_0x447e77[_0x0fc0('0x50')]=_['merge'](_0x447e77[_0x0fc0('0x50')],{'$or':_[_0x0fc0('0x40')](_0x447e77['attributes'],function(_0x352eee){var _0x556601={};_0x556601[_0x352eee]={'$like':'%'+_0x1dc465[_0x0fc0('0x45')][_0x0fc0('0x54')]+'%'};return _0x556601;})});}_0x447e77=_['merge']({},_0x447e77,_0x1dc465[_0x0fc0('0x56')]);return _0x4ad7dd['getApplications'](_0x447e77);}})[_0x0fc0('0x22')](function(_0x3a9476){if(_0x3a9476){_0x4930bd=_0x3a9476[_0x0fc0('0x4b')];if(!_0x1dc465[_0x0fc0('0x45')]['hasOwnProperty'](_0x0fc0('0x4d'))){_0x447e77[_0x0fc0('0x33')]=qs[_0x0fc0('0x33')](_0x1dc465[_0x0fc0('0x45')][_0x0fc0('0x33')]);_0x447e77[_0x0fc0('0x31')]=qs[_0x0fc0('0x31')](_0x1dc465[_0x0fc0('0x45')][_0x0fc0('0x31')]);}return _0x4ad7dd[_0x0fc0('0xbb')](_0x447e77);}})[_0x0fc0('0x22')](function(_0x14bcb2){if(_0x14bcb2){return _0x14bcb2?{'count':_0x4930bd,'rows':_0x14bcb2}:null;}})['then'](respondWithResult(_0x22938f,null))['catch'](handleError(_0x22938f,null));};exports[_0x0fc0('0xbc')]=function(_0x15b47c,_0xad5140,_0x6e3454){var _0x19b63a={'raw':![],'where':{}};var _0x334d8c={};var _0x1121e0={'count':0x0,'rows':[]};return db[_0x0fc0('0x41')][_0x0fc0('0x68')]({'where':{'id':_0x15b47c['params']['id']}})['then'](handleEntityNotFound(_0xad5140,null))[_0x0fc0('0x22')](function(_0x5186ec){if(_0x5186ec){_0x334d8c[_0x0fc0('0x44')]=_[_0x0fc0('0x46')](db[_0x0fc0('0x9c')][_0x0fc0('0x42')]);_0x334d8c[_0x0fc0('0x45')]=_['keys'](_0x15b47c['query']);_0x334d8c[_0x0fc0('0x47')]=_[_0x0fc0('0x48')](_0x334d8c[_0x0fc0('0x44')],_0x334d8c[_0x0fc0('0x45')]);_0x19b63a[_0x0fc0('0x4a')]=_[_0x0fc0('0x48')](_0x334d8c[_0x0fc0('0x44')],qs[_0x0fc0('0x49')](_0x15b47c['query'][_0x0fc0('0x49')]));_0x19b63a['attributes']=_0x19b63a[_0x0fc0('0x4a')]['length']?_0x19b63a[_0x0fc0('0x4a')]:_0x334d8c['model'];if(!_0x15b47c[_0x0fc0('0x45')]['hasOwnProperty'](_0x0fc0('0x4d'))){_0x19b63a[_0x0fc0('0x33')]=qs[_0x0fc0('0x33')](_0x15b47c[_0x0fc0('0x45')][_0x0fc0('0x33')]);_0x19b63a['offset']=qs[_0x0fc0('0x31')](_0x15b47c[_0x0fc0('0x45')]['offset']);}_0x19b63a['order']=qs[_0x0fc0('0x4f')](_0x15b47c[_0x0fc0('0x45')]['sort']);_0x19b63a[_0x0fc0('0x50')]=qs['filters'](_[_0x0fc0('0x51')](_0x15b47c['query'],_0x334d8c[_0x0fc0('0x47')]));_0x19b63a[_0x0fc0('0x50')][_0x0fc0('0x66')]=_0x5186ec['id'];if(_0x15b47c['query'][_0x0fc0('0x54')]){_0x19b63a[_0x0fc0('0x50')]=_[_0x0fc0('0x55')](_0x19b63a[_0x0fc0('0x50')],{'$or':_['map'](_0x19b63a[_0x0fc0('0x4a')],function(_0x1caf93){var _0x4d0856={};_0x4d0856[_0x1caf93]={'$like':'%'+_0x15b47c[_0x0fc0('0x45')][_0x0fc0('0x54')]+'%'};return _0x4d0856;})});}_0x19b63a=_[_0x0fc0('0x55')]({},_0x19b63a,_0x15b47c[_0x0fc0('0x56')]);return db[_0x0fc0('0x9c')][_0x0fc0('0x34')]({'where':_0x19b63a[_0x0fc0('0x50')]})[_0x0fc0('0x22')](function(_0x47d72f){_0x1121e0[_0x0fc0('0x34')]=_0x47d72f;if(_0x15b47c[_0x0fc0('0x45')][_0x0fc0('0x5a')]){_0x19b63a['include']=[{'model':db[_0x0fc0('0x79')],'as':_0x0fc0('0xbd'),'required':![]},{'model':db[_0x0fc0('0xa7')],'as':'Owner','attributes':['name',_0x0fc0('0xbe'),_0x0fc0('0xbf')],'required':![]},{'model':db[_0x0fc0('0xc0')],'as':_0x0fc0('0xc1'),'attributes':['id','name',_0x0fc0('0xc2')],'where':_0x15b47c['query'][_0x0fc0('0xc3')]?{'id':_0x15b47c[_0x0fc0('0x45')][_0x0fc0('0xc3')]}:undefined,'required':_0x15b47c[_0x0fc0('0x45')][_0x0fc0('0xc3')]?!![]:![]}];}return db['SmsInteraction']['findAll'](_0x19b63a);})[_0x0fc0('0x22')](function(_0x10fc70){_0x1121e0['rows']=_0x10fc70;return _0x1121e0;});}})[_0x0fc0('0x22')](respondWithFilteredResult(_0xad5140,_0x19b63a))[_0x0fc0('0x2d')](handleError(_0xad5140,null));};exports[_0x0fc0('0xb5')]=function(_0x54dcbb,_0x1c5494,_0x3d1371){var _0x3fc12f,_0xf13098,_0x2197a6;if(_['isNil'](_0x54dcbb[_0x0fc0('0x5d')][_0x0fc0('0x5d')])||_0x54dcbb[_0x0fc0('0x5d')][_0x0fc0('0x5d')]===''){throw new db['Sequelize'][(_0x0fc0('0x7b'))](_0x0fc0('0x94'));}if(_['isNil'](_0x54dcbb[_0x0fc0('0x5d')]['to'])){throw new db[(_0x0fc0('0x7a'))][(_0x0fc0('0x7b'))](_0x0fc0('0xc4'));}_0x3fc12f=_0x54dcbb['body']['to'];return db[_0x0fc0('0x41')][_0x0fc0('0x5b')]({'where':{'id':_0x54dcbb[_0x0fc0('0x59')]['id']},'include':[{'model':db['CmList'],'as':_0x0fc0('0xc5'),'include':[{'model':db[_0x0fc0('0x79')],'as':_0x0fc0('0x99'),'where':{'mobile':_0x3fc12f},'limit':0x1,'order':[['updatedAt',_0x0fc0('0xc6')]]}]}]})[_0x0fc0('0x22')](handleEntityNotFound(_0x1c5494,null))[_0x0fc0('0x22')](function(_0x27f363){if(_0x27f363&&_0x27f363[_0x0fc0('0xc5')]){_0xf13098=_0x27f363[_0x0fc0('0x5f')]({'plain':!![]});if(_0xf13098['List']&&_0xf13098['List'][_0x0fc0('0x99')]['length']){return _0xf13098[_0x0fc0('0xc5')][_0x0fc0('0x99')][0x0];}return db[_0x0fc0('0x79')][_0x0fc0('0x5c')](_[_0x0fc0('0x19')](_0x54dcbb['body'],{'firstName':_0x3fc12f,'mobile':_0x3fc12f,'phone':_0x3fc12f,'ListId':_0xf13098[_0x0fc0('0x7f')]}));}})[_0x0fc0('0x22')](handleEntityNotFound(_0x1c5494,null))['then'](function(_0x4a3b27){if(_0x4a3b27){_0x2197a6=_0x4a3b27;return db[_0x0fc0('0x9c')][_0x0fc0('0x5b')]({'where':{'ContactId':_0x2197a6['id'],'closed':![],'SmsAccountId':_0xf13098['id']}})[_0x0fc0('0x22')](function(_0x3b9304){if(_0x3b9304){return[_0x3b9304,![]];}return db['SmsInteraction'][_0x0fc0('0x5c')]({'UserId':_0x54dcbb[_0x0fc0('0x5e')]['id'],'ContactId':_0x2197a6['id'],'SmsAccountId':_0xf13098['id'],'phone':_0x3fc12f,'firstMsgDirection':'out','Messages':[_[_0x0fc0('0x55')](_0x54dcbb[_0x0fc0('0x5d')],{'read':![],'body':_0x54dcbb[_0x0fc0('0x5d')][_0x0fc0('0x5d')],'phone':_0x3fc12f,'SmsAccountId':_0xf13098['id'],'UserId':_0x54dcbb[_0x0fc0('0x5e')]['id'],'ContactId':_0x2197a6['id']})]},{'include':[{'model':db[_0x0fc0('0xa4')],'as':'Messages'}]})[_0x0fc0('0x22')](function(_0x27963d){return[_0x27963d,!![]];});});}})[_0x0fc0('0x9d')](function(_0x4b4c09,_0x56a052){if(_0x56a052){return _0x4b4c09;}return db[_0x0fc0('0xa4')][_0x0fc0('0x5c')](_[_0x0fc0('0x55')](_0x54dcbb[_0x0fc0('0x5d')],{'read':![],'body':_0x54dcbb[_0x0fc0('0x5d')][_0x0fc0('0x5d')],'phone':_0x3fc12f,'SmsAccountId':_0xf13098['id'],'SmsInteractionId':_0x4b4c09['id'],'UserId':_0x54dcbb[_0x0fc0('0x5e')]['id'],'ContactId':_0x2197a6['id']}))[_0x0fc0('0x22')](function(_0x8fe387){_0x4b4c09[_0x0fc0('0xc7')][_0x0fc0('0xc8')]=[];_0x4b4c09[_0x0fc0('0xc7')][_0x0fc0('0xc8')][_0x0fc0('0xc9')](_0x8fe387['dataValues']);return _0x4b4c09;});})[_0x0fc0('0x22')](respondWithResult(_0x1c5494,null))[_0x0fc0('0x2d')](handleError(_0x1c5494,null));};exports['status']=function(_0x54515c,_0x56de7b,_0x46f69b){if(_0x54515c['body']['id']){delete _0x54515c[_0x0fc0('0x5d')]['id'];}var _0xf7df5c,_0xe25fc6,_0x25d305;return db[_0x0fc0('0x41')][_0x0fc0('0x5b')]({'where':{'id':_0x54515c['params']['id']}})[_0x0fc0('0x22')](handleEntityNotFound(_0x56de7b,null))['then'](function(_0x4d02f3){if(_0x4d02f3){_0x25d305=_0x4d02f3;logger[_0x0fc0('0x26')]('SmsAccount,\x20%s,\x20%s,\x20%s',_0x0fc0('0x3b'),_0x0fc0('0xca'),_0x4d02f3[_0x0fc0('0x52')],util[_0x0fc0('0xcb')](_0x54515c[_0x0fc0('0x5d')],{'showHidden':![],'depth':null}));switch(_0x4d02f3['type']){case _0x0fc0('0x85'):if(_0x54515c[_0x0fc0('0x5d')]['skebby_dispatch_id']&&_0x54515c['body'][_0x0fc0('0x3b')]){_0xe25fc6=_0x54515c['body'][_0x0fc0('0x3b')];return db['SmsMessage']['find']({'where':{'messageId':_0x54515c[_0x0fc0('0x5d')]['skebby_dispatch_id']}});}break;case _0x0fc0('0x88'):if(_0x54515c[_0x0fc0('0x5d')]['requestid']&&_0x54515c[_0x0fc0('0x5d')]['statusInt']){_0xe25fc6=_0x54515c[_0x0fc0('0x5d')][_0x0fc0('0xcc')];return db[_0x0fc0('0xa4')][_0x0fc0('0x5b')]({'where':{'messageId':_0x54515c['body']['requestid']}});}break;case _0x0fc0('0x89'):if(_0x54515c[_0x0fc0('0x5d')][_0x0fc0('0xcd')]&&_0x54515c[_0x0fc0('0x5d')]['status_code']){_0xe25fc6=_0x54515c[_0x0fc0('0x5d')][_0x0fc0('0xce')];return db['SmsMessage'][_0x0fc0('0x5b')]({'where':{'messageId':_0x54515c['body'][_0x0fc0('0xcd')]}});}break;case _0x0fc0('0x8c'):var _0x555a74=_0x54515c[_0x0fc0('0x5d')][_0x0fc0('0x8d')][0x0];if(_0x555a74['messageId']&&_0x555a74['status']['groupName']===_0x0fc0('0xcf')){_0xe25fc6=_0x555a74['status']['groupName'];return db[_0x0fc0('0xa4')][_0x0fc0('0x5b')]({'where':{'messageId':_0x555a74[_0x0fc0('0x83')]}});}break;case _0x0fc0('0xd0'):if(_0x54515c[_0x0fc0('0x5d')][_0x0fc0('0x83')]&&_0x54515c['body']['status']){_0xe25fc6=_0x54515c[_0x0fc0('0x5d')][_0x0fc0('0x3b')];return db[_0x0fc0('0xa4')][_0x0fc0('0x5b')]({'where':{'messageId':_0x54515c[_0x0fc0('0x5d')]['messageId']}});}break;case _0x0fc0('0xd1'):if(_0x54515c[_0x0fc0('0x5d')][0x0][_0x0fc0('0x2b')]['id']){_0xe25fc6=_0x54515c['body'][0x0][_0x0fc0('0x52')];return db[_0x0fc0('0xa4')]['find']({'where':{'messageId':_0x54515c['body'][0x0]['message']['id']}});}break;case'intelepeer':if(_0x54515c[_0x0fc0('0x5d')][_0x0fc0('0xd2')]&&_0x54515c['body'][_0x0fc0('0x3b')]){_0xe25fc6=_0x54515c[_0x0fc0('0x5d')][_0x0fc0('0x3b')];return db['SmsMessage'][_0x0fc0('0x5b')]({'where':{'messageId':_0x54515c['body'][_0x0fc0('0xd2')]}});}break;}}})[_0x0fc0('0x22')](handleEntityNotFound(_0x56de7b,null))['then'](function(_0x5cfb22){if(_0x5cfb22){_0xf7df5c=_0x5cfb22;switch(_0x25d305[_0x0fc0('0x52')]){case _0x0fc0('0x85'):if(_0xe25fc6===_0x0fc0('0xcf')){return _0xf7df5c[_0x0fc0('0x38')]({'read':!![]});}else{logger[_0x0fc0('0x29')](_0x0fc0('0x27'),_0x0fc0('0x3b'),_0x0fc0('0x85'),util[_0x0fc0('0xcb')](_0x54515c['body'],{'showHidden':![],'depth':null}));}break;case _0x0fc0('0x88'):if(_0xe25fc6==='1'){return _0xf7df5c['update']({'read':!![]});}else{logger['error'](_0x0fc0('0x27'),_0x0fc0('0x3b'),'skebby',util[_0x0fc0('0xcb')](_0x54515c['body'],{'showHidden':![],'depth':null}));}break;case _0x0fc0('0x89'):if(!_0x54515c['body']['error_code']&&_0xe25fc6>=0xc8&&_0xe25fc6<=0xce){return _0xf7df5c[_0x0fc0('0x38')]({'read':!![]});}else{logger[_0x0fc0('0x29')]('SmsAccount,\x20%s,\x20%s,\x20%s','status',_0x0fc0('0x89'),util[_0x0fc0('0xcb')](_0x54515c[_0x0fc0('0x5d')],{'showHidden':![],'depth':null}));}break;case'infobip':var _0x1ac39f=_0x54515c[_0x0fc0('0x5d')]['results'][0x0];if(_0x1ac39f[_0x0fc0('0x3b')][_0x0fc0('0xd3')]==='DELIVERED'){return _0xf7df5c[_0x0fc0('0x38')]({'read':!![]});}else{logger['error'](_0x0fc0('0x27'),_0x0fc0('0x3b'),_0x0fc0('0x8c'),util[_0x0fc0('0xcb')](_0x54515c[_0x0fc0('0x5d')],{'showHidden':![],'depth':null}));}break;case _0x0fc0('0xd0'):if(_0xe25fc6==_0x0fc0('0xd4')||_0xe25fc6==_0x0fc0('0xd5')){return _0xf7df5c[_0x0fc0('0x38')]({'read':!![]});}else{logger[_0x0fc0('0x29')]('SmsAccount,\x20%s,\x20%s,\x20%s',_0x0fc0('0x3b'),'clickatell',util[_0x0fc0('0xcb')](_0x54515c[_0x0fc0('0x5d')],{'showHidden':![],'depth':null}));}break;case'bandwidth':if(_0xe25fc6==_0x0fc0('0xd6')){return _0xf7df5c['update']({'read':!![]});}else{logger['error']('SmsAccount,\x20%s,\x20%s,\x20%s','status',_0x0fc0('0xd1'),util[_0x0fc0('0xcb')](_0x54515c[_0x0fc0('0x5d')],{'showHidden':![],'depth':null}));}break;case _0x0fc0('0xd7'):if(_0xe25fc6==='DELIVRD'||_0xe25fc6===_0x0fc0('0xd8')){return _0xf7df5c[_0x0fc0('0x38')]({'read':!![]});}else{logger['error'](_0x0fc0('0x27'),'status',_0x0fc0('0xd7'),util[_0x0fc0('0xcb')](_0x54515c['body'],{'showHidden':![],'depth':null}));}break;}return _0xf7df5c;}})[_0x0fc0('0x22')](respondWithResult(_0x56de7b,null))['catch'](handleError(_0x56de7b,null));};exports[_0x0fc0('0xd9')]=function(_0x36b26c,_0x27aa0a,_0x551a14){var _0xaf3b7f,_0x24c207,_0x4c52bd;return db['SmsAccount'][_0x0fc0('0x5b')]({'where':{'id':_0x36b26c[_0x0fc0('0x59')]['id']}})['then'](handleEntityNotFound(_0x27aa0a,null))['then'](function(_0x3cff40){if(_0x3cff40){_0x4c52bd=_0x3cff40;logger[_0x0fc0('0x26')]('SmsAccount,\x20%s,\x20%s,\x20%s',_0x0fc0('0x3b'),_0x0fc0('0xca'),_0x3cff40[_0x0fc0('0x52')],util[_0x0fc0('0xcb')](_0x36b26c[_0x0fc0('0x45')],{'showHidden':![],'depth':null}));switch(_0x3cff40[_0x0fc0('0x52')]){case'csc':if(_0x36b26c[_0x0fc0('0x45')]['message-id']&&_0x36b26c[_0x0fc0('0x45')][_0x0fc0('0xda')]){_0x24c207=_0x36b26c[_0x0fc0('0x45')][_0x0fc0('0xda')];return db[_0x0fc0('0xa4')]['find']({'where':{'messageId':_0x36b26c[_0x0fc0('0x45')]['message-id']}});}break;}}})[_0x0fc0('0x22')](handleEntityNotFound(_0x27aa0a,null))['then'](function(_0x23c936){if(_0x23c936){_0xaf3b7f=_0x23c936;switch(_0x4c52bd[_0x0fc0('0x52')]){case'csc':if(_0x24c207==='2'||_0x24c207==='6'){return _0xaf3b7f[_0x0fc0('0x38')]({'read':!![]});}else{logger[_0x0fc0('0x29')](_0x0fc0('0x27'),'status',_0x0fc0('0x8e'),util[_0x0fc0('0xcb')](_0x36b26c[_0x0fc0('0x45')],{'showHidden':![],'depth':null}));};break;}return _0xaf3b7f;}})['then'](respondWithResult(_0x27aa0a,null))[_0x0fc0('0x2d')](handleError(_0x27aa0a,null));};exports[_0x0fc0('0xdb')]=function(_0x47eef8,_0x540412,_0x48bd5c){return db[_0x0fc0('0x41')][_0x0fc0('0x5b')]({'where':{'id':_0x47eef8[_0x0fc0('0x59')]['id']}})[_0x0fc0('0x22')](handleEntityNotFound(_0x540412,null))['then'](function(_0x50df6f){if(_0x50df6f){return _0x50df6f[_0x0fc0('0xdb')](_0x47eef8['body'][_0x0fc0('0x6c')],_['omit'](_0x47eef8[_0x0fc0('0x5d')],[_0x0fc0('0x6c'),'id'])||{})[_0x0fc0('0x9d')](function(_0x242a23){for(var _0x356696=0x0;_0x356696<_0x47eef8[_0x0fc0('0x5d')][_0x0fc0('0x6c')][_0x0fc0('0x4b')];_0x356696+=0x1){socket[_0x0fc0('0xdc')]('userSmsAccount:save',{'UserId':Number(_0x47eef8[_0x0fc0('0x5d')][_0x0fc0('0x6c')][_0x356696]),'SmsAccountId':Number(_0x47eef8[_0x0fc0('0x59')]['id'])});}return _0x242a23;});}})[_0x0fc0('0x22')](respondWithResult(_0x540412,null))[_0x0fc0('0x2d')](handleError(_0x540412,null));};exports[_0x0fc0('0xdd')]=function(_0x3e785b,_0x36ff27,_0x18083d){return db[_0x0fc0('0x41')][_0x0fc0('0x5b')]({'where':{'id':_0x3e785b['params']['id']}})[_0x0fc0('0x22')](handleEntityNotFound(_0x36ff27,null))[_0x0fc0('0x22')](function(_0x1e1c78){if(_0x1e1c78){return _0x1e1c78['removeAgents'](_0x3e785b[_0x0fc0('0x45')][_0x0fc0('0x6c')])[_0x0fc0('0x22')](function(){if(_[_0x0fc0('0xde')](_0x3e785b[_0x0fc0('0x45')]['ids'])){for(var _0x48c118=0x0;_0x48c118<_0x3e785b[_0x0fc0('0x45')][_0x0fc0('0x6c')][_0x0fc0('0x4b')];_0x48c118+=0x1){socket['emit'](_0x0fc0('0xdf'),{'UserId':Number(_0x3e785b['query'][_0x0fc0('0x6c')][_0x48c118]),'SmsAccountId':Number(_0x3e785b[_0x0fc0('0x59')]['id'])});}}else{socket[_0x0fc0('0xdc')]('userSmsAccount:remove',{'UserId':Number(_0x3e785b['query'][_0x0fc0('0x6c')]),'SmsAccountId':Number(_0x3e785b[_0x0fc0('0x59')]['id'])});}});}})[_0x0fc0('0x22')](respondWithStatusCode(_0x36ff27,null))['catch'](handleError(_0x36ff27,null));};exports['getAgents']=function(_0x35eca2,_0x142f77,_0x3fe4b2){var _0xd60332={};var _0x3b3a32={};var _0x57d776;var _0x57425c;return db[_0x0fc0('0x41')][_0x0fc0('0x68')]({'where':{'id':_0x35eca2[_0x0fc0('0x59')]['id']}})[_0x0fc0('0x22')](handleEntityNotFound(_0x142f77,null))[_0x0fc0('0x22')](function(_0x14428a){if(_0x14428a){_0x57d776=_0x14428a;_0x3b3a32[_0x0fc0('0x44')]=_[_0x0fc0('0x46')](db[_0x0fc0('0xa7')][_0x0fc0('0x42')]);_0x3b3a32['query']=_[_0x0fc0('0x46')](_0x35eca2['query']);_0x3b3a32[_0x0fc0('0x47')]=_[_0x0fc0('0x48')](_0x3b3a32[_0x0fc0('0x44')],_0x3b3a32['query']);_0xd60332['attributes']=_[_0x0fc0('0x48')](_0x3b3a32[_0x0fc0('0x44')],qs['fields'](_0x35eca2[_0x0fc0('0x45')][_0x0fc0('0x49')]));_0xd60332[_0x0fc0('0x4a')]=_0xd60332[_0x0fc0('0x4a')][_0x0fc0('0x4b')]?_0xd60332[_0x0fc0('0x4a')]:_0x3b3a32[_0x0fc0('0x44')];_0xd60332[_0x0fc0('0x4e')]=qs[_0x0fc0('0x4f')](_0x35eca2[_0x0fc0('0x45')][_0x0fc0('0x4f')]);_0xd60332['where']=qs[_0x0fc0('0x47')](_[_0x0fc0('0x51')](_0x35eca2[_0x0fc0('0x45')],_0x3b3a32[_0x0fc0('0x47')]));if(_0x35eca2[_0x0fc0('0x45')]['filter']){_0xd60332[_0x0fc0('0x50')]=_[_0x0fc0('0x55')](_0xd60332[_0x0fc0('0x50')],{'$or':_[_0x0fc0('0x40')](_0xd60332[_0x0fc0('0x4a')],function(_0x50d969){var _0x1f757b={};_0x1f757b[_0x50d969]={'$like':'%'+_0x35eca2[_0x0fc0('0x45')]['filter']+'%'};return _0x1f757b;})});}_0xd60332=_[_0x0fc0('0x55')]({},_0xd60332,_0x35eca2['options']);return _0x57d776['getAgents'](_0xd60332);}})[_0x0fc0('0x22')](function(_0x1d384f){if(_0x1d384f){_0x57425c=_0x1d384f[_0x0fc0('0x4b')];if(!_0x35eca2[_0x0fc0('0x45')][_0x0fc0('0x4c')](_0x0fc0('0x4d'))){_0xd60332[_0x0fc0('0x33')]=qs[_0x0fc0('0x33')](_0x35eca2[_0x0fc0('0x45')][_0x0fc0('0x33')]);_0xd60332['offset']=qs[_0x0fc0('0x31')](_0x35eca2['query']['offset']);}return _0x57d776[_0x0fc0('0xe0')](_0xd60332);}})[_0x0fc0('0x22')](function(_0x3f7753){if(_0x3f7753){return _0x3f7753?{'count':_0x57425c,'rows':_0x3f7753}:null;}})['then'](respondWithResult(_0x142f77,null))[_0x0fc0('0x2d')](handleError(_0x142f77,null));}; \ No newline at end of file diff --git a/server/api/smsAccount/smsAccount.events.js b/server/api/smsAccount/smsAccount.events.js index 07a9fb7..61b81b0 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 _0x335e=['exports','events','../../mysqldb','SmsAccount','remove','emit','hasOwnProperty','hook'];(function(_0x7185f7,_0x37065){var _0x182e45=function(_0x519e0d){while(--_0x519e0d){_0x7185f7['push'](_0x7185f7['shift']());}};_0x182e45(++_0x37065);}(_0x335e,0xa9));var _0xe335=function(_0x50b0ea,_0x206b9a){_0x50b0ea=_0x50b0ea-0x0;var _0x35c57e=_0x335e[_0x50b0ea];return _0x35c57e;};'use strict';var EventEmitter=require(_0xe335('0x0'));var SmsAccount=require(_0xe335('0x1'))['db'][_0xe335('0x2')];var SmsAccountEvents=new EventEmitter();SmsAccountEvents['setMaxListeners'](0x0);var events={'afterCreate':'save','afterUpdate':'update','afterDestroy':_0xe335('0x3')};function emitEvent(_0x3cc642){return function(_0x492665,_0x4ad2cb,_0x24f4a9){SmsAccountEvents[_0xe335('0x4')](_0x3cc642+':'+_0x492665['id'],_0x492665);SmsAccountEvents[_0xe335('0x4')](_0x3cc642,_0x492665);_0x24f4a9(null);};}for(var e in events){if(events[_0xe335('0x5')](e)){var event=events[e];SmsAccount[_0xe335('0x6')](e,emitEvent(event));}}module[_0xe335('0x7')]=SmsAccountEvents; \ No newline at end of file +var _0xd563=['../../mysqldb','setMaxListeners','save','update','remove','emit','exports','events'];(function(_0x4edcdc,_0x438f3e){var _0x231150=function(_0x1d156e){while(--_0x1d156e){_0x4edcdc['push'](_0x4edcdc['shift']());}};_0x231150(++_0x438f3e);}(_0xd563,0x107));var _0x3d56=function(_0x859abb,_0x3e208c){_0x859abb=_0x859abb-0x0;var _0x8304fe=_0xd563[_0x859abb];return _0x8304fe;};'use strict';var EventEmitter=require(_0x3d56('0x0'));var SmsAccount=require(_0x3d56('0x1'))['db']['SmsAccount'];var SmsAccountEvents=new EventEmitter();SmsAccountEvents[_0x3d56('0x2')](0x0);var events={'afterCreate':_0x3d56('0x3'),'afterUpdate':_0x3d56('0x4'),'afterDestroy':_0x3d56('0x5')};function emitEvent(_0x2f7c3a){return function(_0x4bc053,_0x456555,_0x473bfd){SmsAccountEvents[_0x3d56('0x6')](_0x2f7c3a+':'+_0x4bc053['id'],_0x4bc053);SmsAccountEvents[_0x3d56('0x6')](_0x2f7c3a,_0x4bc053);_0x473bfd(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];SmsAccount['hook'](e,emitEvent(event));}}module[_0x3d56('0x7')]=SmsAccountEvents; \ No newline at end of file diff --git a/server/api/smsAccount/smsAccount.model.js b/server/api/smsAccount/smsAccount.model.js index e66c223..2ee1e7d 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 _0xd2cb=['../../config/environment','./smsAccount.attributes','exports','define','SmsAccount','lodash','util','../../config/logger','api','moment','request-promise','path','rimraf'];(function(_0x8e4d5b,_0x3bc92d){var _0x508e9b=function(_0x46e4bd){while(--_0x46e4bd){_0x8e4d5b['push'](_0x8e4d5b['shift']());}};_0x508e9b(++_0x3bc92d);}(_0xd2cb,0x109));var _0xbd2c=function(_0x43130c,_0x1a0e3e){_0x43130c=_0x43130c-0x0;var _0x570f1a=_0xd2cb[_0x43130c];return _0x570f1a;};'use strict';var _=require(_0xbd2c('0x0'));var util=require(_0xbd2c('0x1'));var logger=require(_0xbd2c('0x2'))(_0xbd2c('0x3'));var moment=require(_0xbd2c('0x4'));var BPromise=require('bluebird');var rp=require(_0xbd2c('0x5'));var fs=require('fs');var path=require(_0xbd2c('0x6'));var rimraf=require(_0xbd2c('0x7'));var config=require(_0xbd2c('0x8'));var attributes=require(_0xbd2c('0x9'));module[_0xbd2c('0xa')]=function(_0x15b275,_0x162325){return _0x15b275[_0xbd2c('0xb')](_0xbd2c('0xc'),attributes,{'tableName':'sms_accounts','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x9228=['SmsAccount','sms_accounts','util','bluebird','path','rimraf','../../config/environment','exports','define'];(function(_0x2dd185,_0x2acdb1){var _0x5f31e4=function(_0x45194e){while(--_0x45194e){_0x2dd185['push'](_0x2dd185['shift']());}};_0x5f31e4(++_0x2acdb1);}(_0x9228,0x146));var _0x8922=function(_0x4906c7,_0x5e2ae3){_0x4906c7=_0x4906c7-0x0;var _0x44f12d=_0x9228[_0x4906c7];return _0x44f12d;};'use strict';var _=require('lodash');var util=require(_0x8922('0x0'));var logger=require('../../config/logger')('api');var moment=require('moment');var BPromise=require(_0x8922('0x1'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x8922('0x2'));var rimraf=require(_0x8922('0x3'));var config=require(_0x8922('0x4'));var attributes=require('./smsAccount.attributes');module[_0x8922('0x5')]=function(_0x36ca43,_0x240566){return _0x36ca43[_0x8922('0x6')](_0x8922('0x7'),attributes,{'tableName':_0x8922('0x8'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/smsAccount/smsAccount.rpc.js b/server/api/smsAccount/smsAccount.rpc.js index 9c453de..0a8ae11 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 _0x705a=['info','SmsAccount,\x20%s,\x20%s','request\x20sent','SmsAccount,\x20%s,\x20%s,\x20%s','error','code','message','ShowSmsAccount','SmsAccount','find','options','raw','where','attributes','include','map','model','debug','catch','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','http','redis','localhost','./smsAccount.socket','register','request','then'];(function(_0x15f752,_0x57a664){var _0xc880ae=function(_0x4e53eb){while(--_0x4e53eb){_0x15f752['push'](_0x15f752['shift']());}};_0xc880ae(++_0x57a664);}(_0x705a,0x1e7));var _0xa705=function(_0x217cff,_0x4f4924){_0x217cff=_0x217cff-0x0;var _0x3ba9c5=_0x705a[_0x217cff];return _0x3ba9c5;};'use strict';var _=require(_0xa705('0x0'));var util=require(_0xa705('0x1'));var moment=require('moment');var BPromise=require(_0xa705('0x2'));var rs=require(_0xa705('0x3'));var fs=require('fs');var Redis=require(_0xa705('0x4'));var db=require(_0xa705('0x5'))['db'];var utils=require(_0xa705('0x6'));var logger=require(_0xa705('0x7'))(_0xa705('0x8'));var config=require(_0xa705('0x9'));var jayson=require('jayson/promise');var client=jayson['client'][_0xa705('0xa')]({'port':0x232a});config[_0xa705('0xb')]=_['defaults'](config[_0xa705('0xb')],{'host':_0xa705('0xc'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xa705('0xb')]));require(_0xa705('0xd'))[_0xa705('0xe')](socket);function respondWithRpcPromise(_0x256d5f,_0x46d92b,_0x298d39){return new BPromise(function(_0x214080,_0x2a78c0){return client[_0xa705('0xf')](_0x256d5f,_0x298d39)[_0xa705('0x10')](function(_0x236b7c){logger[_0xa705('0x11')](_0xa705('0x12'),_0x46d92b,_0xa705('0x13'));logger['debug'](_0xa705('0x14'),_0x46d92b,_0xa705('0x13'),JSON['stringify'](_0x236b7c));if(_0x236b7c[_0xa705('0x15')]){if(_0x236b7c[_0xa705('0x15')][_0xa705('0x16')]===0x1f4){logger['error'](_0xa705('0x12'),_0x46d92b,_0x236b7c[_0xa705('0x15')][_0xa705('0x17')]);return _0x2a78c0(_0x236b7c[_0xa705('0x15')][_0xa705('0x17')]);}logger[_0xa705('0x15')](_0xa705('0x12'),_0x46d92b,_0x236b7c[_0xa705('0x15')]['message']);return _0x214080(_0x236b7c[_0xa705('0x15')][_0xa705('0x17')]);}else{logger[_0xa705('0x11')](_0xa705('0x12'),_0x46d92b,_0xa705('0x13'));_0x214080(_0x236b7c['result'][_0xa705('0x17')]);}})['catch'](function(_0x5889d2){logger[_0xa705('0x15')]('SmsAccount,\x20%s,\x20%s',_0x46d92b,_0x5889d2);_0x2a78c0(_0x5889d2);});});}exports[_0xa705('0x18')]=function(_0x1d176d){var _0x28d279=this;return new Promise(function(_0x148375,_0x1cfc8f){return db[_0xa705('0x19')][_0xa705('0x1a')]({'raw':_0x1d176d['options']?_0x1d176d[_0xa705('0x1b')][_0xa705('0x1c')]===undefined?!![]:![]:!![],'where':_0x1d176d[_0xa705('0x1b')]?_0x1d176d[_0xa705('0x1b')][_0xa705('0x1d')]||null:null,'attributes':_0x1d176d[_0xa705('0x1b')]?_0x1d176d[_0xa705('0x1b')][_0xa705('0x1e')]||null:null,'include':_0x1d176d['options']?_0x1d176d[_0xa705('0x1b')]['include']?_['map'](_0x1d176d['options'][_0xa705('0x1f')],function(_0x55d4c6){return{'model':db[_0x55d4c6['model']],'as':_0x55d4c6['as'],'attributes':_0x55d4c6['attributes'],'include':_0x55d4c6['include']?_['map'](_0x55d4c6['include'],function(_0xdc0040){return{'model':db[_0xdc0040['model']],'as':_0xdc0040['as'],'attributes':_0xdc0040[_0xa705('0x1e')],'include':_0xdc0040[_0xa705('0x1f')]?_[_0xa705('0x20')](_0xdc0040[_0xa705('0x1f')],function(_0x1644c8){return{'model':db[_0x1644c8[_0xa705('0x21')]],'as':_0x1644c8['as'],'attributes':_0x1644c8[_0xa705('0x1e')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x2c3633){logger['info'](_0xa705('0x18'),_0x1d176d);logger[_0xa705('0x22')](_0xa705('0x18'),_0x1d176d,JSON['stringify'](_0x2c3633));_0x148375(_0x2c3633);})[_0xa705('0x23')](function(_0xb95335){logger[_0xa705('0x15')](_0xa705('0x18'),_0xb95335[_0xa705('0x17')],_0x1d176d);_0x1cfc8f(_0x28d279[_0xa705('0x15')](0x1f4,_0xb95335[_0xa705('0x17')]));});});}; \ No newline at end of file +var _0x69bb=['client','http','defaults','localhost','socket.io-emitter','./smsAccount.socket','request','info','SmsAccount,\x20%s,\x20%s','request\x20sent','debug','SmsAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','SmsAccount','find','options','attributes','include','map','model','ShowSmsAccount','lodash','util','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise'];(function(_0xc63307,_0x2c4887){var _0x135245=function(_0x1bfe66){while(--_0x1bfe66){_0xc63307['push'](_0xc63307['shift']());}};_0x135245(++_0x2c4887);}(_0x69bb,0x132));var _0xb69b=function(_0x1cdcab,_0x491825){_0x1cdcab=_0x1cdcab-0x0;var _0x15b57f=_0x69bb[_0x1cdcab];return _0x15b57f;};'use strict';var _=require(_0xb69b('0x0'));var util=require(_0xb69b('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0xb69b('0x2'));var fs=require('fs');var Redis=require(_0xb69b('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0xb69b('0x4'));var logger=require(_0xb69b('0x5'))(_0xb69b('0x6'));var config=require(_0xb69b('0x7'));var jayson=require(_0xb69b('0x8'));var client=jayson[_0xb69b('0x9')][_0xb69b('0xa')]({'port':0x232a});config['redis']=_[_0xb69b('0xb')](config['redis'],{'host':_0xb69b('0xc'),'port':0x18eb});var socket=require(_0xb69b('0xd'))(new Redis(config['redis']));require(_0xb69b('0xe'))['register'](socket);function respondWithRpcPromise(_0x105d08,_0x371899,_0x1b868b){return new BPromise(function(_0x1301a7,_0x33e77f){return client[_0xb69b('0xf')](_0x105d08,_0x1b868b)['then'](function(_0x29d6a7){logger[_0xb69b('0x10')](_0xb69b('0x11'),_0x371899,_0xb69b('0x12'));logger[_0xb69b('0x13')](_0xb69b('0x14'),_0x371899,_0xb69b('0x12'),JSON[_0xb69b('0x15')](_0x29d6a7));if(_0x29d6a7[_0xb69b('0x16')]){if(_0x29d6a7[_0xb69b('0x16')][_0xb69b('0x17')]===0x1f4){logger[_0xb69b('0x16')](_0xb69b('0x11'),_0x371899,_0x29d6a7[_0xb69b('0x16')][_0xb69b('0x18')]);return _0x33e77f(_0x29d6a7[_0xb69b('0x16')][_0xb69b('0x18')]);}logger[_0xb69b('0x16')]('SmsAccount,\x20%s,\x20%s',_0x371899,_0x29d6a7[_0xb69b('0x16')]['message']);return _0x1301a7(_0x29d6a7[_0xb69b('0x16')][_0xb69b('0x18')]);}else{logger[_0xb69b('0x10')]('SmsAccount,\x20%s,\x20%s',_0x371899,_0xb69b('0x12'));_0x1301a7(_0x29d6a7[_0xb69b('0x19')][_0xb69b('0x18')]);}})[_0xb69b('0x1a')](function(_0x132d50){logger[_0xb69b('0x16')](_0xb69b('0x11'),_0x371899,_0x132d50);_0x33e77f(_0x132d50);});});}exports['ShowSmsAccount']=function(_0xb29f66){var _0x5cb7ee=this;return new Promise(function(_0xcfb39,_0x3b77fe){return db[_0xb69b('0x1b')][_0xb69b('0x1c')]({'raw':_0xb29f66[_0xb69b('0x1d')]?_0xb29f66['options']['raw']===undefined?!![]:![]:!![],'where':_0xb29f66['options']?_0xb29f66[_0xb69b('0x1d')]['where']||null:null,'attributes':_0xb29f66[_0xb69b('0x1d')]?_0xb29f66[_0xb69b('0x1d')][_0xb69b('0x1e')]||null:null,'include':_0xb29f66[_0xb69b('0x1d')]?_0xb29f66[_0xb69b('0x1d')][_0xb69b('0x1f')]?_[_0xb69b('0x20')](_0xb29f66[_0xb69b('0x1d')][_0xb69b('0x1f')],function(_0x49f9e6){return{'model':db[_0x49f9e6[_0xb69b('0x21')]],'as':_0x49f9e6['as'],'attributes':_0x49f9e6[_0xb69b('0x1e')],'include':_0x49f9e6[_0xb69b('0x1f')]?_['map'](_0x49f9e6['include'],function(_0x298fba){return{'model':db[_0x298fba[_0xb69b('0x21')]],'as':_0x298fba['as'],'attributes':_0x298fba[_0xb69b('0x1e')],'include':_0x298fba[_0xb69b('0x1f')]?_['map'](_0x298fba[_0xb69b('0x1f')],function(_0x2b8d62){return{'model':db[_0x2b8d62['model']],'as':_0x2b8d62['as'],'attributes':_0x2b8d62['attributes']};}):[]};}):[]};}):[]:[]})['then'](function(_0x40708c){logger[_0xb69b('0x10')](_0xb69b('0x22'),_0xb29f66);logger[_0xb69b('0x13')](_0xb69b('0x22'),_0xb29f66,JSON[_0xb69b('0x15')](_0x40708c));_0xcfb39(_0x40708c);})[_0xb69b('0x1a')](function(_0x28bf9e){logger[_0xb69b('0x16')]('ShowSmsAccount',_0x28bf9e[_0xb69b('0x18')],_0xb29f66);_0x3b77fe(_0x5cb7ee[_0xb69b('0x16')](0x1f4,_0x28bf9e[_0xb69b('0x18')]));});});}; \ No newline at end of file diff --git a/server/api/smsAccount/smsAccount.socket.js b/server/api/smsAccount/smsAccount.socket.js index 668fbfe..3329393 100644 --- a/server/api/smsAccount/smsAccount.socket.js +++ b/server/api/smsAccount/smsAccount.socket.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xa9e0=['register','length','smsAccount:','./smsAccount.events','save','remove','emit','removeListener'];(function(_0x19950b,_0x53d0d7){var _0x3c6b41=function(_0x3924ad){while(--_0x3924ad){_0x19950b['push'](_0x19950b['shift']());}};_0x3c6b41(++_0x53d0d7);}(_0xa9e0,0x123));var _0x0a9e=function(_0x297fd3,_0x115406){_0x297fd3=_0x297fd3-0x0;var _0x2af381=_0xa9e0[_0x297fd3];return _0x2af381;};'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(_0x19950b,_0x53d0d7){var _0x3c6b41=function(_0x3924ad){while(--_0x3924ad){_0x19950b['push'](_0x19950b['shift']());}};_0x3c6b41(++_0x53d0d7);}(_0xa9e0,0x123));var _0x0a9e=function(_0x9df060,_0x253d33){_0x9df060=_0x9df060-0x0;var _0x338dfe=_0xa9e0[_0x9df060];return _0x338dfe;};'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 d47117f..ee381a4 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(_0x40ac5e,_0x2de228){var _0x2839d6=function(_0x123d47){while(--_0x123d47){_0x40ac5e['push'](_0x40ac5e['shift']());}};_0x2839d6(++_0x2de228);}(_0x9957,0x93));var _0x7995=function(_0x6c993a,_0x5ea3ab){_0x6c993a=_0x6c993a-0x0;var _0x27f547=_0x9957[_0x6c993a];return _0x27f547;};'use strict';var multer=require(_0x7995('0x0'));var util=require(_0x7995('0x1'));var path=require(_0x7995('0x2'));var timeout=require(_0x7995('0x3'));var express=require('express');var router=express[_0x7995('0x4')]();var fs_extra=require(_0x7995('0x5'));var auth=require(_0x7995('0x6'));var interaction=require(_0x7995('0x7'));var config=require('../../config/environment');var controller=require(_0x7995('0x8'));router[_0x7995('0x9')]('/',auth[_0x7995('0xa')](),controller[_0x7995('0xb')]);router[_0x7995('0x9')](_0x7995('0xc'),auth['isAuthenticated'](),controller[_0x7995('0xd')]);router[_0x7995('0xe')]('/',auth['isAuthenticated'](),controller[_0x7995('0xf')]);router[_0x7995('0x10')](_0x7995('0xc'),auth[_0x7995('0xa')](),controller[_0x7995('0x11')]);router[_0x7995('0x12')](_0x7995('0xc'),auth['isAuthenticated'](),controller[_0x7995('0x13')]);module[_0x7995('0x14')]=router; \ No newline at end of file +var _0x9957=['multer','util','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./smsApplication.controller','get','isAuthenticated','index','/:id','show','post','create','put','update','delete','destroy','exports'];(function(_0x2bf141,_0x31eac7){var _0x48277b=function(_0x9fe560){while(--_0x9fe560){_0x2bf141['push'](_0x2bf141['shift']());}};_0x48277b(++_0x31eac7);}(_0x9957,0x93));var _0x7995=function(_0x3947c9,_0x4d6c97){_0x3947c9=_0x3947c9-0x0;var _0x2e7871=_0x9957[_0x3947c9];return _0x2e7871;};'use strict';var multer=require(_0x7995('0x0'));var util=require(_0x7995('0x1'));var path=require(_0x7995('0x2'));var timeout=require(_0x7995('0x3'));var express=require('express');var router=express[_0x7995('0x4')]();var fs_extra=require(_0x7995('0x5'));var auth=require(_0x7995('0x6'));var interaction=require(_0x7995('0x7'));var config=require('../../config/environment');var controller=require(_0x7995('0x8'));router[_0x7995('0x9')]('/',auth[_0x7995('0xa')](),controller[_0x7995('0xb')]);router[_0x7995('0x9')](_0x7995('0xc'),auth['isAuthenticated'](),controller[_0x7995('0xd')]);router[_0x7995('0xe')]('/',auth['isAuthenticated'](),controller[_0x7995('0xf')]);router[_0x7995('0x10')](_0x7995('0xc'),auth[_0x7995('0xa')](),controller[_0x7995('0x11')]);router[_0x7995('0x12')](_0x7995('0xc'),auth['isAuthenticated'](),controller[_0x7995('0x13')]);module[_0x7995('0x14')]=router; \ No newline at end of file diff --git a/server/api/smsApplication/smsApplication.attributes.js b/server/api/smsApplication/smsApplication.attributes.js index c8ad938..6c32e7b 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 _0x3f54=['*,*,*,*','sequelize','exports','INTEGER','STRING','noop'];(function(_0xd09668,_0x1435b2){var _0x68726=function(_0x54a030){while(--_0x54a030){_0xd09668['push'](_0xd09668['shift']());}};_0x68726(++_0x1435b2);}(_0x3f54,0x139));var _0x43f5=function(_0x39bc44,_0x1d4373){_0x39bc44=_0x39bc44-0x0;var _0x2916d8=_0x3f54[_0x39bc44];return _0x2916d8;};'use strict';var Sequelize=require(_0x43f5('0x0'));module[_0x43f5('0x1')]={'priority':{'type':Sequelize[_0x43f5('0x2')],'allowNull':![]},'app':{'type':Sequelize[_0x43f5('0x3')],'allowNull':![],'defaultValue':_0x43f5('0x4')},'appdata':{'type':Sequelize['TEXT']()},'description':{'type':Sequelize[_0x43f5('0x3')]},'interval':{'type':Sequelize[_0x43f5('0x3')],'defaultValue':_0x43f5('0x5')}}; \ No newline at end of file +var _0x46a2=['noop','TEXT','STRING','*,*,*,*','sequelize'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0x46a2,0x144));var _0x246a=function(_0x470bfb,_0x389787){_0x470bfb=_0x470bfb-0x0;var _0x2f5d97=_0x46a2[_0x470bfb];return _0x2f5d97;};'use strict';var Sequelize=require(_0x246a('0x0'));module['exports']={'priority':{'type':Sequelize['INTEGER'],'allowNull':![]},'app':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':_0x246a('0x1')},'appdata':{'type':Sequelize[_0x246a('0x2')]()},'description':{'type':Sequelize['STRING']},'interval':{'type':Sequelize[_0x246a('0x3')],'defaultValue':_0x246a('0x4')}}; \ No newline at end of file diff --git a/server/api/smsApplication/smsApplication.controller.js b/server/api/smsApplication/smsApplication.controller.js index 1687bdd..568c522 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 _0xbc45=['fs-extra','lodash','squel','crypto','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','end','status','json','limit','undefined','count','offset','set','Content-Range','apply','reject','save','then','error','stack','name','send','index','map','SmsApplication','type','key','model','query','filters','intersection','fields','attributes','length','hasOwnProperty','order','sort','pick','filter','where','merge','VIRTUAL','options','includeAll','findAll','rows','catch','show','params','keys','rawAttributes','include','create','body','destroy','find','eml-format','zip-dir','request-promise','moment','mustache','util','path','sox','to-csv','ejs'];(function(_0x5bae95,_0x2aed2a){var _0x5ca520=function(_0x2e2df9){while(--_0x2e2df9){_0x5bae95['push'](_0x5bae95['shift']());}};_0x5ca520(++_0x2aed2a);}(_0xbc45,0x1be));var _0x5bc4=function(_0x21c9c7,_0x5c95c1){_0x21c9c7=_0x21c9c7-0x0;var _0x3dfe2c=_0xbc45[_0x21c9c7];return _0x3dfe2c;};'use strict';var emlformat=require(_0x5bc4('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x5bc4('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0x5bc4('0x2'));var moment=require(_0x5bc4('0x3'));var BPromise=require('bluebird');var Mustache=require(_0x5bc4('0x4'));var util=require(_0x5bc4('0x5'));var path=require(_0x5bc4('0x6'));var sox=require(_0x5bc4('0x7'));var csv=require(_0x5bc4('0x8'));var ejs=require(_0x5bc4('0x9'));var fs=require('fs');var fs_extra=require(_0x5bc4('0xa'));var _=require(_0x5bc4('0xb'));var squel=require(_0x5bc4('0xc'));var crypto=require(_0x5bc4('0xd'));var jsforce=require(_0x5bc4('0xe'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0x5bc4('0xf'));var Papa=require(_0x5bc4('0x10'));var Redis=require(_0x5bc4('0x11'));var authService=require(_0x5bc4('0x12'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0x5bc4('0x13'))(_0x5bc4('0x14'));var utils=require(_0x5bc4('0x15'));var config=require('../../config/environment');var licenseUtil=require(_0x5bc4('0x16'));var db=require(_0x5bc4('0x17'))['db'];function respondWithStatusCode(_0x514660,_0xe6700){_0xe6700=_0xe6700||0xcc;return function(_0x6dc068){if(_0x6dc068){return _0x514660[_0x5bc4('0x18')](_0xe6700);}return _0x514660['status'](_0xe6700)[_0x5bc4('0x19')]();};}function respondWithResult(_0x59a105,_0x44a409){_0x44a409=_0x44a409||0xc8;return function(_0x3bc2fd){if(_0x3bc2fd){return _0x59a105[_0x5bc4('0x1a')](_0x44a409)[_0x5bc4('0x1b')](_0x3bc2fd);}};}function respondWithFilteredResult(_0x181939,_0x1b47f){return function(_0x5d2fec){if(_0x5d2fec){var _0x38f682=typeof _0x1b47f['offset']==='undefined'&&typeof _0x1b47f[_0x5bc4('0x1c')]===_0x5bc4('0x1d');var _0x135ba1=_0x5d2fec[_0x5bc4('0x1e')];var _0x10c946=_0x38f682?0x0:_0x1b47f[_0x5bc4('0x1f')];var _0x27a9b7=_0x38f682?_0x5d2fec[_0x5bc4('0x1e')]:_0x1b47f['offset']+_0x1b47f[_0x5bc4('0x1c')];var _0x242563;if(_0x27a9b7>=_0x135ba1){_0x27a9b7=_0x135ba1;_0x242563=0xc8;}else{_0x242563=0xce;}_0x181939['status'](_0x242563);return _0x181939[_0x5bc4('0x20')](_0x5bc4('0x21'),_0x10c946+'-'+_0x27a9b7+'/'+_0x135ba1)[_0x5bc4('0x1b')](_0x5d2fec);}return null;};}function patchUpdates(_0x20609d){return function(_0x2ebff3){try{jsonpatch[_0x5bc4('0x22')](_0x2ebff3,_0x20609d,!![]);}catch(_0x1f97e4){return BPromise[_0x5bc4('0x23')](_0x1f97e4);}return _0x2ebff3[_0x5bc4('0x24')]();};}function saveUpdates(_0x2a6318,_0xa25b80){return function(_0x5c62f9){if(_0x5c62f9){return _0x5c62f9['update'](_0x2a6318)[_0x5bc4('0x25')](function(_0x2c2793){return _0x2c2793;});}return null;};}function removeEntity(_0x17e423,_0x5f428a){return function(_0x1bf998){if(_0x1bf998){return _0x1bf998['destroy']()['then'](function(){_0x17e423[_0x5bc4('0x1a')](0xcc)[_0x5bc4('0x19')]();});}};}function handleEntityNotFound(_0x5a415b,_0x21d3b7){return function(_0x4babea){if(!_0x4babea){_0x5a415b[_0x5bc4('0x18')](0x194);}return _0x4babea;};}function handleError(_0x6985d2,_0x11a006){_0x11a006=_0x11a006||0x1f4;return function(_0xe3f10f){logger[_0x5bc4('0x26')](_0xe3f10f[_0x5bc4('0x27')]);if(_0xe3f10f['name']){delete _0xe3f10f[_0x5bc4('0x28')];}_0x6985d2[_0x5bc4('0x1a')](_0x11a006)[_0x5bc4('0x29')](_0xe3f10f);};}exports[_0x5bc4('0x2a')]=function(_0xefbfda,_0x14873b){var _0x4ab654={},_0x3b389f={},_0x2a9ceb={'count':0x0,'rows':[]};var _0x348e9c=_[_0x5bc4('0x2b')](db[_0x5bc4('0x2c')]['rawAttributes'],function(_0x2870f5){return{'name':_0x2870f5['fieldName'],'type':_0x2870f5[_0x5bc4('0x2d')][_0x5bc4('0x2e')]};});_0x3b389f[_0x5bc4('0x2f')]=_[_0x5bc4('0x2b')](_0x348e9c,'name');_0x3b389f['query']=_['keys'](_0xefbfda[_0x5bc4('0x30')]);_0x3b389f[_0x5bc4('0x31')]=_[_0x5bc4('0x32')](_0x3b389f[_0x5bc4('0x2f')],_0x3b389f[_0x5bc4('0x30')]);_0x4ab654['attributes']=_[_0x5bc4('0x32')](_0x3b389f[_0x5bc4('0x2f')],qs['fields'](_0xefbfda[_0x5bc4('0x30')][_0x5bc4('0x33')]));_0x4ab654[_0x5bc4('0x34')]=_0x4ab654['attributes'][_0x5bc4('0x35')]?_0x4ab654['attributes']:_0x3b389f[_0x5bc4('0x2f')];if(!_0xefbfda[_0x5bc4('0x30')][_0x5bc4('0x36')]('nolimit')){_0x4ab654[_0x5bc4('0x1c')]=qs[_0x5bc4('0x1c')](_0xefbfda[_0x5bc4('0x30')][_0x5bc4('0x1c')]);_0x4ab654[_0x5bc4('0x1f')]=qs['offset'](_0xefbfda[_0x5bc4('0x30')][_0x5bc4('0x1f')]);}_0x4ab654[_0x5bc4('0x37')]=qs[_0x5bc4('0x38')](_0xefbfda[_0x5bc4('0x30')][_0x5bc4('0x38')]);_0x4ab654['where']=qs[_0x5bc4('0x31')](_[_0x5bc4('0x39')](_0xefbfda[_0x5bc4('0x30')],_0x3b389f[_0x5bc4('0x31')]),_0x348e9c);if(_0xefbfda[_0x5bc4('0x30')][_0x5bc4('0x3a')]){_0x4ab654[_0x5bc4('0x3b')]=_[_0x5bc4('0x3c')](_0x4ab654[_0x5bc4('0x3b')],{'$or':_[_0x5bc4('0x2b')](_0x348e9c,function(_0x6b9879){if(_0x6b9879[_0x5bc4('0x2d')]!==_0x5bc4('0x3d')){var _0x50b7d1={};_0x50b7d1[_0x6b9879['name']]={'$like':'%'+_0xefbfda['query']['filter']+'%'};return _0x50b7d1;}})});}_0x4ab654=_['merge']({},_0x4ab654,_0xefbfda[_0x5bc4('0x3e')]);var _0x351359={'where':_0x4ab654[_0x5bc4('0x3b')]};return db['SmsApplication'][_0x5bc4('0x1e')](_0x351359)['then'](function(_0x203f11){_0x2a9ceb['count']=_0x203f11;if(_0xefbfda[_0x5bc4('0x30')][_0x5bc4('0x3f')]){_0x4ab654['include']=[{'all':!![]}];}return db[_0x5bc4('0x2c')][_0x5bc4('0x40')](_0x4ab654);})[_0x5bc4('0x25')](function(_0x5f356d){_0x2a9ceb[_0x5bc4('0x41')]=_0x5f356d;return _0x2a9ceb;})['then'](respondWithFilteredResult(_0x14873b,_0x4ab654))[_0x5bc4('0x42')](handleError(_0x14873b,null));};exports[_0x5bc4('0x43')]=function(_0x13d4bc,_0x31b980){var _0x56aa24={'raw':!![],'where':{'id':_0x13d4bc[_0x5bc4('0x44')]['id']}},_0xc13b66={};_0xc13b66['model']=_[_0x5bc4('0x45')](db['SmsApplication'][_0x5bc4('0x46')]);_0xc13b66[_0x5bc4('0x30')]=_['keys'](_0x13d4bc[_0x5bc4('0x30')]);_0xc13b66['filters']=_[_0x5bc4('0x32')](_0xc13b66[_0x5bc4('0x2f')],_0xc13b66[_0x5bc4('0x30')]);_0x56aa24[_0x5bc4('0x34')]=_[_0x5bc4('0x32')](_0xc13b66[_0x5bc4('0x2f')],qs[_0x5bc4('0x33')](_0x13d4bc[_0x5bc4('0x30')][_0x5bc4('0x33')]));_0x56aa24[_0x5bc4('0x34')]=_0x56aa24[_0x5bc4('0x34')]['length']?_0x56aa24[_0x5bc4('0x34')]:_0xc13b66[_0x5bc4('0x2f')];if(_0x13d4bc['query'][_0x5bc4('0x3f')]){_0x56aa24[_0x5bc4('0x47')]=[{'all':!![]}];}_0x56aa24=_[_0x5bc4('0x3c')]({},_0x56aa24,_0x13d4bc[_0x5bc4('0x3e')]);return db['SmsApplication']['find'](_0x56aa24)[_0x5bc4('0x25')](handleEntityNotFound(_0x31b980,null))['then'](respondWithResult(_0x31b980,null))['catch'](handleError(_0x31b980,null));};exports[_0x5bc4('0x48')]=function(_0x5d93a0,_0x26d96b){return db[_0x5bc4('0x2c')][_0x5bc4('0x48')](_0x5d93a0['body'],{})[_0x5bc4('0x25')](respondWithResult(_0x26d96b,0xc9))[_0x5bc4('0x42')](handleError(_0x26d96b,null));};exports['update']=function(_0x460374,_0x7fc330){if(_0x460374['body']['id']){delete _0x460374[_0x5bc4('0x49')]['id'];}return db[_0x5bc4('0x2c')]['find']({'where':{'id':_0x460374['params']['id']}})[_0x5bc4('0x25')](handleEntityNotFound(_0x7fc330,null))[_0x5bc4('0x25')](saveUpdates(_0x460374[_0x5bc4('0x49')],null))[_0x5bc4('0x25')](respondWithResult(_0x7fc330,null))[_0x5bc4('0x42')](handleError(_0x7fc330,null));};exports[_0x5bc4('0x4a')]=function(_0x147182,_0x9c8b8e){return db[_0x5bc4('0x2c')][_0x5bc4('0x4b')]({'where':{'id':_0x147182[_0x5bc4('0x44')]['id']}})['then'](handleEntityNotFound(_0x9c8b8e,null))['then'](removeEntity(_0x9c8b8e,null))['catch'](handleError(_0x9c8b8e,null));}; \ No newline at end of file +var _0x3ff8=['name','send','index','map','SmsApplication','rawAttributes','fieldName','key','keys','query','intersection','model','attributes','fields','length','nolimit','sort','where','filters','filter','type','merge','include','findAll','rows','catch','show','params','includeAll','options','create','body','find','zip-dir','fast-json-patch','moment','bluebird','mustache','util','path','to-csv','ejs','fs-extra','lodash','squel','crypto','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','offset','limit','count','set','Content-Range','apply','reject','save','update','then','error'];(function(_0x4710eb,_0x579717){var _0x3158c6=function(_0x4b1cd7){while(--_0x4b1cd7){_0x4710eb['push'](_0x4710eb['shift']());}};_0x3158c6(++_0x579717);}(_0x3ff8,0x1dd));var _0x83ff=function(_0x180b68,_0x5d1ec6){_0x180b68=_0x180b68-0x0;var _0x2d0366=_0x3ff8[_0x180b68];return _0x2d0366;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0x83ff('0x0'));var jsonpatch=require(_0x83ff('0x1'));var rp=require('request-promise');var moment=require(_0x83ff('0x2'));var BPromise=require(_0x83ff('0x3'));var Mustache=require(_0x83ff('0x4'));var util=require(_0x83ff('0x5'));var path=require(_0x83ff('0x6'));var sox=require('sox');var csv=require(_0x83ff('0x7'));var ejs=require(_0x83ff('0x8'));var fs=require('fs');var fs_extra=require(_0x83ff('0x9'));var _=require(_0x83ff('0xa'));var squel=require(_0x83ff('0xb'));var crypto=require(_0x83ff('0xc'));var jsforce=require('jsforce');var deskjs=require(_0x83ff('0xd'));var toCsv=require(_0x83ff('0x7'));var querystring=require(_0x83ff('0xe'));var Papa=require(_0x83ff('0xf'));var Redis=require(_0x83ff('0x10'));var authService=require(_0x83ff('0x11'));var qs=require(_0x83ff('0x12'));var as=require(_0x83ff('0x13'));var hardwareService=require(_0x83ff('0x14'));var logger=require(_0x83ff('0x15'))(_0x83ff('0x16'));var utils=require(_0x83ff('0x17'));var config=require(_0x83ff('0x18'));var licenseUtil=require(_0x83ff('0x19'));var db=require(_0x83ff('0x1a'))['db'];function respondWithStatusCode(_0x2de294,_0x46fd39){_0x46fd39=_0x46fd39||0xcc;return function(_0x77e0){if(_0x77e0){return _0x2de294[_0x83ff('0x1b')](_0x46fd39);}return _0x2de294[_0x83ff('0x1c')](_0x46fd39)[_0x83ff('0x1d')]();};}function respondWithResult(_0x2b1495,_0x565416){_0x565416=_0x565416||0xc8;return function(_0x4bff56){if(_0x4bff56){return _0x2b1495[_0x83ff('0x1c')](_0x565416)['json'](_0x4bff56);}};}function respondWithFilteredResult(_0x205cdd,_0x3c7466){return function(_0x431ec2){if(_0x431ec2){var _0x5d2c60=typeof _0x3c7466[_0x83ff('0x1e')]==='undefined'&&typeof _0x3c7466[_0x83ff('0x1f')]==='undefined';var _0x182c40=_0x431ec2[_0x83ff('0x20')];var _0x583c6b=_0x5d2c60?0x0:_0x3c7466[_0x83ff('0x1e')];var _0x4d8a10=_0x5d2c60?_0x431ec2[_0x83ff('0x20')]:_0x3c7466[_0x83ff('0x1e')]+_0x3c7466[_0x83ff('0x1f')];var _0xccfc10;if(_0x4d8a10>=_0x182c40){_0x4d8a10=_0x182c40;_0xccfc10=0xc8;}else{_0xccfc10=0xce;}_0x205cdd[_0x83ff('0x1c')](_0xccfc10);return _0x205cdd[_0x83ff('0x21')](_0x83ff('0x22'),_0x583c6b+'-'+_0x4d8a10+'/'+_0x182c40)['json'](_0x431ec2);}return null;};}function patchUpdates(_0x5a1f88){return function(_0x52229b){try{jsonpatch[_0x83ff('0x23')](_0x52229b,_0x5a1f88,!![]);}catch(_0x5574d3){return BPromise[_0x83ff('0x24')](_0x5574d3);}return _0x52229b[_0x83ff('0x25')]();};}function saveUpdates(_0x585066,_0x5987b0){return function(_0x1a3d4c){if(_0x1a3d4c){return _0x1a3d4c[_0x83ff('0x26')](_0x585066)[_0x83ff('0x27')](function(_0x232850){return _0x232850;});}return null;};}function removeEntity(_0x1fc528,_0x548ce7){return function(_0x2f7b56){if(_0x2f7b56){return _0x2f7b56['destroy']()[_0x83ff('0x27')](function(){_0x1fc528[_0x83ff('0x1c')](0xcc)['end']();});}};}function handleEntityNotFound(_0x36417e,_0x2b763e){return function(_0x236904){if(!_0x236904){_0x36417e['sendStatus'](0x194);}return _0x236904;};}function handleError(_0x186765,_0x3675ee){_0x3675ee=_0x3675ee||0x1f4;return function(_0x207cf4){logger[_0x83ff('0x28')](_0x207cf4['stack']);if(_0x207cf4[_0x83ff('0x29')]){delete _0x207cf4[_0x83ff('0x29')];}_0x186765['status'](_0x3675ee)[_0x83ff('0x2a')](_0x207cf4);};}exports[_0x83ff('0x2b')]=function(_0x29e3e1,_0x3447b0){var _0x27f7bf={},_0x2175ff={},_0x47adec={'count':0x0,'rows':[]};var _0x4195f7=_[_0x83ff('0x2c')](db[_0x83ff('0x2d')][_0x83ff('0x2e')],function(_0x52fba8){return{'name':_0x52fba8[_0x83ff('0x2f')],'type':_0x52fba8['type'][_0x83ff('0x30')]};});_0x2175ff['model']=_[_0x83ff('0x2c')](_0x4195f7,'name');_0x2175ff['query']=_[_0x83ff('0x31')](_0x29e3e1[_0x83ff('0x32')]);_0x2175ff['filters']=_[_0x83ff('0x33')](_0x2175ff[_0x83ff('0x34')],_0x2175ff[_0x83ff('0x32')]);_0x27f7bf[_0x83ff('0x35')]=_['intersection'](_0x2175ff['model'],qs['fields'](_0x29e3e1[_0x83ff('0x32')][_0x83ff('0x36')]));_0x27f7bf[_0x83ff('0x35')]=_0x27f7bf[_0x83ff('0x35')][_0x83ff('0x37')]?_0x27f7bf[_0x83ff('0x35')]:_0x2175ff['model'];if(!_0x29e3e1[_0x83ff('0x32')]['hasOwnProperty'](_0x83ff('0x38'))){_0x27f7bf[_0x83ff('0x1f')]=qs[_0x83ff('0x1f')](_0x29e3e1['query'][_0x83ff('0x1f')]);_0x27f7bf['offset']=qs[_0x83ff('0x1e')](_0x29e3e1[_0x83ff('0x32')][_0x83ff('0x1e')]);}_0x27f7bf['order']=qs[_0x83ff('0x39')](_0x29e3e1[_0x83ff('0x32')][_0x83ff('0x39')]);_0x27f7bf[_0x83ff('0x3a')]=qs[_0x83ff('0x3b')](_['pick'](_0x29e3e1[_0x83ff('0x32')],_0x2175ff['filters']),_0x4195f7);if(_0x29e3e1[_0x83ff('0x32')][_0x83ff('0x3c')]){_0x27f7bf[_0x83ff('0x3a')]=_['merge'](_0x27f7bf['where'],{'$or':_['map'](_0x4195f7,function(_0x587faf){if(_0x587faf[_0x83ff('0x3d')]!=='VIRTUAL'){var _0x3b029f={};_0x3b029f[_0x587faf[_0x83ff('0x29')]]={'$like':'%'+_0x29e3e1[_0x83ff('0x32')][_0x83ff('0x3c')]+'%'};return _0x3b029f;}})});}_0x27f7bf=_[_0x83ff('0x3e')]({},_0x27f7bf,_0x29e3e1['options']);var _0x387712={'where':_0x27f7bf[_0x83ff('0x3a')]};return db[_0x83ff('0x2d')]['count'](_0x387712)['then'](function(_0x5afefa){_0x47adec[_0x83ff('0x20')]=_0x5afefa;if(_0x29e3e1[_0x83ff('0x32')]['includeAll']){_0x27f7bf[_0x83ff('0x3f')]=[{'all':!![]}];}return db[_0x83ff('0x2d')][_0x83ff('0x40')](_0x27f7bf);})[_0x83ff('0x27')](function(_0x4e7787){_0x47adec[_0x83ff('0x41')]=_0x4e7787;return _0x47adec;})[_0x83ff('0x27')](respondWithFilteredResult(_0x3447b0,_0x27f7bf))[_0x83ff('0x42')](handleError(_0x3447b0,null));};exports[_0x83ff('0x43')]=function(_0x135d05,_0x50d71e){var _0x862bd2={'raw':!![],'where':{'id':_0x135d05[_0x83ff('0x44')]['id']}},_0x53ce3f={};_0x53ce3f[_0x83ff('0x34')]=_['keys'](db[_0x83ff('0x2d')]['rawAttributes']);_0x53ce3f[_0x83ff('0x32')]=_[_0x83ff('0x31')](_0x135d05[_0x83ff('0x32')]);_0x53ce3f['filters']=_['intersection'](_0x53ce3f[_0x83ff('0x34')],_0x53ce3f[_0x83ff('0x32')]);_0x862bd2[_0x83ff('0x35')]=_['intersection'](_0x53ce3f[_0x83ff('0x34')],qs['fields'](_0x135d05[_0x83ff('0x32')][_0x83ff('0x36')]));_0x862bd2['attributes']=_0x862bd2['attributes'][_0x83ff('0x37')]?_0x862bd2[_0x83ff('0x35')]:_0x53ce3f[_0x83ff('0x34')];if(_0x135d05['query'][_0x83ff('0x45')]){_0x862bd2[_0x83ff('0x3f')]=[{'all':!![]}];}_0x862bd2=_['merge']({},_0x862bd2,_0x135d05[_0x83ff('0x46')]);return db[_0x83ff('0x2d')]['find'](_0x862bd2)[_0x83ff('0x27')](handleEntityNotFound(_0x50d71e,null))[_0x83ff('0x27')](respondWithResult(_0x50d71e,null))[_0x83ff('0x42')](handleError(_0x50d71e,null));};exports[_0x83ff('0x47')]=function(_0x3243f2,_0x35a47e){return db[_0x83ff('0x2d')]['create'](_0x3243f2[_0x83ff('0x48')],{})[_0x83ff('0x27')](respondWithResult(_0x35a47e,0xc9))[_0x83ff('0x42')](handleError(_0x35a47e,null));};exports['update']=function(_0x10cc39,_0x36d106){if(_0x10cc39['body']['id']){delete _0x10cc39[_0x83ff('0x48')]['id'];}return db['SmsApplication'][_0x83ff('0x49')]({'where':{'id':_0x10cc39['params']['id']}})[_0x83ff('0x27')](handleEntityNotFound(_0x36d106,null))[_0x83ff('0x27')](saveUpdates(_0x10cc39[_0x83ff('0x48')],null))['then'](respondWithResult(_0x36d106,null))[_0x83ff('0x42')](handleError(_0x36d106,null));};exports['destroy']=function(_0x544a1e,_0x2db7dd){return db[_0x83ff('0x2d')][_0x83ff('0x49')]({'where':{'id':_0x544a1e['params']['id']}})['then'](handleEntityNotFound(_0x2db7dd,null))[_0x83ff('0x27')](removeEntity(_0x2db7dd,null))['catch'](handleError(_0x2db7dd,null));}; \ No newline at end of file diff --git a/server/api/smsApplication/smsApplication.model.js b/server/api/smsApplication/smsApplication.model.js index cc4fc90..c67b9f7 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 _0xedb4=['path','rimraf','../../config/environment','./smsApplication.attributes','exports','define','SmsApplication','utf8mb4','utf8mb4_unicode_ci','lodash','util','api','bluebird'];(function(_0x266da8,_0x47419a){var _0x5cdbe0=function(_0x3a8782){while(--_0x3a8782){_0x266da8['push'](_0x266da8['shift']());}};_0x5cdbe0(++_0x47419a);}(_0xedb4,0x15b));var _0x4edb=function(_0x45096e,_0x17e82d){_0x45096e=_0x45096e-0x0;var _0xba1fa3=_0xedb4[_0x45096e];return _0xba1fa3;};'use strict';var _=require(_0x4edb('0x0'));var util=require(_0x4edb('0x1'));var logger=require('../../config/logger')(_0x4edb('0x2'));var moment=require('moment');var BPromise=require(_0x4edb('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x4edb('0x4'));var rimraf=require(_0x4edb('0x5'));var config=require(_0x4edb('0x6'));var attributes=require(_0x4edb('0x7'));module[_0x4edb('0x8')]=function(_0x19f666,_0xc67836){return _0x19f666[_0x4edb('0x9')](_0x4edb('0xa'),attributes,{'tableName':'sms_applications','paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x4edb('0xb'),'collate':_0x4edb('0xc')});}; \ No newline at end of file +var _0x8d2b=['utf8mb4_unicode_ci','util','moment','bluebird','request-promise','../../config/environment','./smsApplication.attributes','exports','define','SmsApplication','sms_applications','utf8mb4'];(function(_0x4a682e,_0x47ccc1){var _0x56808f=function(_0x8afa52){while(--_0x8afa52){_0x4a682e['push'](_0x4a682e['shift']());}};_0x56808f(++_0x47ccc1);}(_0x8d2b,0xfd));var _0xb8d2=function(_0x1d558c,_0x1e497c){_0x1d558c=_0x1d558c-0x0;var _0x15767d=_0x8d2b[_0x1d558c];return _0x15767d;};'use strict';var _=require('lodash');var util=require(_0xb8d2('0x0'));var logger=require('../../config/logger')('api');var moment=require(_0xb8d2('0x1'));var BPromise=require(_0xb8d2('0x2'));var rp=require(_0xb8d2('0x3'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0xb8d2('0x4'));var attributes=require(_0xb8d2('0x5'));module[_0xb8d2('0x6')]=function(_0x447c56,_0x5a4fb4){return _0x447c56[_0xb8d2('0x7')](_0xb8d2('0x8'),attributes,{'tableName':_0xb8d2('0x9'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0xb8d2('0xa'),'collate':_0xb8d2('0xb')});}; \ No newline at end of file diff --git a/server/api/smsApplication/smsApplication.rpc.js b/server/api/smsApplication/smsApplication.rpc.js index 8c8acb4..52fa714 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 _0x29b6=['SmsApplication,\x20%s,\x20%s,\x20%s','stringify','error','message','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','http','request','info','SmsApplication,\x20%s,\x20%s','request\x20sent','debug'];(function(_0x202434,_0x1ccc96){var _0x9f27c5=function(_0x429ded){while(--_0x429ded){_0x202434['push'](_0x202434['shift']());}};_0x9f27c5(++_0x1ccc96);}(_0x29b6,0x17e));var _0x629b=function(_0x15dacd,_0x8b58e4){_0x15dacd=_0x15dacd-0x0;var _0x30f78c=_0x29b6[_0x15dacd];return _0x30f78c;};'use strict';var _=require(_0x629b('0x0'));var util=require(_0x629b('0x1'));var moment=require(_0x629b('0x2'));var BPromise=require(_0x629b('0x3'));var rs=require(_0x629b('0x4'));var fs=require('fs');var Redis=require(_0x629b('0x5'));var db=require(_0x629b('0x6'))['db'];var utils=require(_0x629b('0x7'));var logger=require(_0x629b('0x8'))(_0x629b('0x9'));var config=require('../../config/environment');var jayson=require(_0x629b('0xa'));var client=jayson['client'][_0x629b('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x4acc5a,_0x26e439,_0x398ecb){return new BPromise(function(_0x4e90cd,_0xc44b27){return client[_0x629b('0xc')](_0x4acc5a,_0x398ecb)['then'](function(_0x28c152){logger[_0x629b('0xd')](_0x629b('0xe'),_0x26e439,_0x629b('0xf'));logger[_0x629b('0x10')](_0x629b('0x11'),_0x26e439,_0x629b('0xf'),JSON[_0x629b('0x12')](_0x28c152));if(_0x28c152[_0x629b('0x13')]){if(_0x28c152[_0x629b('0x13')]['code']===0x1f4){logger['error'](_0x629b('0xe'),_0x26e439,_0x28c152[_0x629b('0x13')][_0x629b('0x14')]);return _0xc44b27(_0x28c152['error'][_0x629b('0x14')]);}logger[_0x629b('0x13')](_0x629b('0xe'),_0x26e439,_0x28c152[_0x629b('0x13')]['message']);return _0x4e90cd(_0x28c152[_0x629b('0x13')][_0x629b('0x14')]);}else{logger[_0x629b('0xd')](_0x629b('0xe'),_0x26e439,_0x629b('0xf'));_0x4e90cd(_0x28c152['result'][_0x629b('0x14')]);}})['catch'](function(_0x151b93){logger[_0x629b('0x13')](_0x629b('0xe'),_0x26e439,_0x151b93);_0xc44b27(_0x151b93);});});} \ No newline at end of file +var _0x7382=['message','result','catch','util','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','info','SmsApplication,\x20%s,\x20%s','debug','SmsApplication,\x20%s,\x20%s,\x20%s','request\x20sent','error','code'];(function(_0x4426df,_0x16ca67){var _0x35f87e=function(_0x5ae461){while(--_0x5ae461){_0x4426df['push'](_0x4426df['shift']());}};_0x35f87e(++_0x16ca67);}(_0x7382,0x111));var _0x2738=function(_0x4b8f6a,_0x41d140){_0x4b8f6a=_0x4b8f6a-0x0;var _0xeb3534=_0x7382[_0x4b8f6a];return _0xeb3534;};'use strict';var _=require('lodash');var util=require(_0x2738('0x0'));var moment=require('moment');var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0x2738('0x1'));var logger=require(_0x2738('0x2'))(_0x2738('0x3'));var config=require(_0x2738('0x4'));var jayson=require(_0x2738('0x5'));var client=jayson['client'][_0x2738('0x6')]({'port':0x232a});function respondWithRpcPromise(_0x2bc38a,_0xd74b07,_0x523aef){return new BPromise(function(_0x4235e7,_0x487d14){return client[_0x2738('0x7')](_0x2bc38a,_0x523aef)['then'](function(_0x476864){logger[_0x2738('0x8')](_0x2738('0x9'),_0xd74b07,'request\x20sent');logger[_0x2738('0xa')](_0x2738('0xb'),_0xd74b07,_0x2738('0xc'),JSON['stringify'](_0x476864));if(_0x476864['error']){if(_0x476864[_0x2738('0xd')][_0x2738('0xe')]===0x1f4){logger[_0x2738('0xd')](_0x2738('0x9'),_0xd74b07,_0x476864[_0x2738('0xd')][_0x2738('0xf')]);return _0x487d14(_0x476864[_0x2738('0xd')][_0x2738('0xf')]);}logger[_0x2738('0xd')](_0x2738('0x9'),_0xd74b07,_0x476864[_0x2738('0xd')]['message']);return _0x4235e7(_0x476864[_0x2738('0xd')][_0x2738('0xf')]);}else{logger['info'](_0x2738('0x9'),_0xd74b07,'request\x20sent');_0x4235e7(_0x476864[_0x2738('0x10')]['message']);}})[_0x2738('0x11')](function(_0x568065){logger[_0x2738('0xd')](_0x2738('0x9'),_0xd74b07,_0x568065);_0x487d14(_0x568065);});});} \ No newline at end of file diff --git a/server/api/smsInteraction/index.js b/server/api/smsInteraction/index.js index 8f20ef0..087c93c 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 _0x3c81=['express','../../config/environment','./smsInteraction.controller','get','isAuthenticated','index','/describe','describe','/:id','show','/:id/messages','getMessages','/:id/download','download','post','create','addMessage','addTags','tracked','sms','update','delete','smsinteraction:destroy','destroy','/:id/tags','exports','multer','util','connect-timeout'];(function(_0x2f8d3e,_0x5752b1){var _0x5bfcb1=function(_0xea7a9d){while(--_0xea7a9d){_0x2f8d3e['push'](_0x2f8d3e['shift']());}};_0x5bfcb1(++_0x5752b1);}(_0x3c81,0x102));var _0x13c8=function(_0x46f440,_0x2bcb26){_0x46f440=_0x46f440-0x0;var _0x3fa64c=_0x3c81[_0x46f440];return _0x3fa64c;};'use strict';var multer=require(_0x13c8('0x0'));var util=require(_0x13c8('0x1'));var path=require('path');var timeout=require(_0x13c8('0x2'));var express=require(_0x13c8('0x3'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0x13c8('0x4'));var controller=require(_0x13c8('0x5'));router[_0x13c8('0x6')]('/',auth[_0x13c8('0x7')](),controller[_0x13c8('0x8')]);router[_0x13c8('0x6')](_0x13c8('0x9'),auth['isAuthenticated'](),controller[_0x13c8('0xa')]);router['get'](_0x13c8('0xb'),auth[_0x13c8('0x7')](),controller[_0x13c8('0xc')]);router[_0x13c8('0x6')](_0x13c8('0xd'),auth[_0x13c8('0x7')](),controller[_0x13c8('0xe')]);router[_0x13c8('0x6')](_0x13c8('0xf'),auth[_0x13c8('0x7')](),controller[_0x13c8('0x10')]);router[_0x13c8('0x11')]('/',auth[_0x13c8('0x7')](),controller[_0x13c8('0x12')]);router['post'](_0x13c8('0xd'),auth[_0x13c8('0x7')](),controller[_0x13c8('0x13')]);router[_0x13c8('0x11')]('/:id/tags',auth[_0x13c8('0x7')](),interaction['tracked']('sms','smsinteraction:addtags'),controller[_0x13c8('0x14')]);router['put'](_0x13c8('0xb'),auth[_0x13c8('0x7')](),interaction[_0x13c8('0x15')](_0x13c8('0x16'),'smsinteraction:update'),controller[_0x13c8('0x17')]);router[_0x13c8('0x18')](_0x13c8('0xb'),auth[_0x13c8('0x7')](),interaction[_0x13c8('0x15')](_0x13c8('0x16'),_0x13c8('0x19')),controller[_0x13c8('0x1a')]);router[_0x13c8('0x18')](_0x13c8('0x1b'),auth[_0x13c8('0x7')](),controller['removeTags']);module[_0x13c8('0x1c')]=router; \ No newline at end of file +var _0x8603=['sms','addTags','put','/:id','smsinteraction:update','update','delete','destroy','removeTags','exports','util','path','connect-timeout','fs-extra','../../components/auth/service','../../components/interaction/service','./smsInteraction.controller','isAuthenticated','index','get','/describe','show','/:id/messages','/:id/download','download','post','create','addMessage','/:id/tags','tracked'];(function(_0x305779,_0x57891f){var _0x41c696=function(_0x53f33c){while(--_0x53f33c){_0x305779['push'](_0x305779['shift']());}};_0x41c696(++_0x57891f);}(_0x8603,0x190));var _0x3860=function(_0x5ef1e4,_0x343c2c){_0x5ef1e4=_0x5ef1e4-0x0;var _0x612531=_0x8603[_0x5ef1e4];return _0x612531;};'use strict';var multer=require('multer');var util=require(_0x3860('0x0'));var path=require(_0x3860('0x1'));var timeout=require(_0x3860('0x2'));var express=require('express');var router=express['Router']();var fs_extra=require(_0x3860('0x3'));var auth=require(_0x3860('0x4'));var interaction=require(_0x3860('0x5'));var config=require('../../config/environment');var controller=require(_0x3860('0x6'));router['get']('/',auth[_0x3860('0x7')](),controller[_0x3860('0x8')]);router[_0x3860('0x9')](_0x3860('0xa'),auth[_0x3860('0x7')](),controller['describe']);router['get']('/:id',auth[_0x3860('0x7')](),controller[_0x3860('0xb')]);router['get'](_0x3860('0xc'),auth[_0x3860('0x7')](),controller['getMessages']);router[_0x3860('0x9')](_0x3860('0xd'),auth['isAuthenticated'](),controller[_0x3860('0xe')]);router[_0x3860('0xf')]('/',auth['isAuthenticated'](),controller[_0x3860('0x10')]);router[_0x3860('0xf')](_0x3860('0xc'),auth[_0x3860('0x7')](),controller[_0x3860('0x11')]);router[_0x3860('0xf')](_0x3860('0x12'),auth[_0x3860('0x7')](),interaction[_0x3860('0x13')](_0x3860('0x14'),'smsinteraction:addtags'),controller[_0x3860('0x15')]);router[_0x3860('0x16')](_0x3860('0x17'),auth[_0x3860('0x7')](),interaction[_0x3860('0x13')](_0x3860('0x14'),_0x3860('0x18')),controller[_0x3860('0x19')]);router[_0x3860('0x1a')](_0x3860('0x17'),auth[_0x3860('0x7')](),interaction[_0x3860('0x13')]('sms','smsinteraction:destroy'),controller[_0x3860('0x1b')]);router[_0x3860('0x1a')](_0x3860('0x12'),auth['isAuthenticated'](),controller[_0x3860('0x1c')]);module[_0x3860('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 d3d38d5..e20d9d7 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 _0xa486=['STRING','ENUM','out','BOOLEAN','INTEGER','sequelize','exports','DATE'];(function(_0x46428c,_0x20ab75){var _0x16a677=function(_0x2b0817){while(--_0x2b0817){_0x46428c['push'](_0x46428c['shift']());}};_0x16a677(++_0x20ab75);}(_0xa486,0x17d));var _0x6a48=function(_0x50ffc0,_0x2cdc34){_0x50ffc0=_0x50ffc0-0x0;var _0x474732=_0xa486[_0x50ffc0];return _0x474732;};'use strict';var Sequelize=require(_0x6a48('0x0'));var moment=require('moment');module[_0x6a48('0x1')]={'closed':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'closedAt':{'type':Sequelize[_0x6a48('0x2')]},'disposition':{'type':Sequelize['STRING']},'secondDisposition':{'type':Sequelize[_0x6a48('0x3')]},'thirdDisposition':{'type':Sequelize[_0x6a48('0x3')]},'note':{'type':Sequelize[_0x6a48('0x3')]},'phone':{'type':Sequelize[_0x6a48('0x3')]},'read1stAt':{'type':Sequelize[_0x6a48('0x2')]},'firstMsgDirection':{'type':Sequelize[_0x6a48('0x4')]('in',_0x6a48('0x5')),'defaultValue':'in','allowNull':![]},'lastMsgAt':{'type':Sequelize[_0x6a48('0x2')]},'lastMsgDirection':{'type':Sequelize[_0x6a48('0x4')]('in',_0x6a48('0x5')),'defaultValue':'in','allowNull':![]},'autoreplyExecuted':{'type':Sequelize[_0x6a48('0x6')],'defaultValue':![]},'queueId':{'type':Sequelize[_0x6a48('0x7')]}}; \ No newline at end of file +var _0x0c2b=['BOOLEAN','DATE','STRING','ENUM','out','sequelize','moment'];(function(_0x49b287,_0x12a060){var _0x140d50=function(_0x227af4){while(--_0x227af4){_0x49b287['push'](_0x49b287['shift']());}};_0x140d50(++_0x12a060);}(_0x0c2b,0x194));var _0xb0c2=function(_0x2aa781,_0x6d1628){_0x2aa781=_0x2aa781-0x0;var _0x409efc=_0x0c2b[_0x2aa781];return _0x409efc;};'use strict';var Sequelize=require(_0xb0c2('0x0'));var moment=require(_0xb0c2('0x1'));module['exports']={'closed':{'type':Sequelize[_0xb0c2('0x2')],'defaultValue':![]},'closedAt':{'type':Sequelize[_0xb0c2('0x3')]},'disposition':{'type':Sequelize[_0xb0c2('0x4')]},'secondDisposition':{'type':Sequelize['STRING']},'thirdDisposition':{'type':Sequelize['STRING']},'note':{'type':Sequelize[_0xb0c2('0x4')]},'phone':{'type':Sequelize[_0xb0c2('0x4')]},'read1stAt':{'type':Sequelize[_0xb0c2('0x3')]},'firstMsgDirection':{'type':Sequelize[_0xb0c2('0x5')]('in',_0xb0c2('0x6')),'defaultValue':'in','allowNull':![]},'lastMsgAt':{'type':Sequelize['DATE']},'lastMsgDirection':{'type':Sequelize[_0xb0c2('0x5')]('in',_0xb0c2('0x6')),'defaultValue':'in','allowNull':![]},'autoreplyExecuted':{'type':Sequelize[_0xb0c2('0x2')],'defaultValue':![]},'queueId':{'type':Sequelize['INTEGER']}}; \ No newline at end of file diff --git a/server/api/smsInteraction/smsInteraction.controller.js b/server/api/smsInteraction/smsInteraction.controller.js index 8548cdb..cda83c3 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 _0xbaad=['err','unlinkSync','rimraf','bluebird','util','ejs','lodash','../../components/interaction/service','../../components/parsers/qs','api','../../config/environment','redis','defaults','socket.io-emitter','./smsInteraction.socket','register','sendStatus','status','end','json','offset','undefined','count','limit','Content-Range','update','then','error','name','index','map','SmsInteraction','type','key','findAll','sms','query','show','model','keys','filters','intersection','attributes','fields','length','includeAll','include','merge','options','find','create','body','catch','params','describe','addMessage','SmsMessage','ids','omit','findOne','rawAttributes','hasOwnProperty','order','pick','where','SmsInteractionId','filter','$gte','split','format','YYYY-MM-DD\x20HH:mm:ss','setTags','spread','Tag','color','emit','removeTags','unix','toString','root','server','files','join','transcript-%d-%s.zip','push','User','fullname','CmContact','Contact','firstName','Messages','secret','read','SmsAccount','Account','Owner','get','mkdirSync','Sms','N.A.','createdAt','closed','closedAt','direction','out','System','lastName','value','views'];(function(_0x34021d,_0x753aa6){var _0x16597b=function(_0x2d040a){while(--_0x2d040a){_0x34021d['push'](_0x34021d['shift']());}};_0x16597b(++_0x753aa6);}(_0xbaad,0x1b6));var _0xdbaa=function(_0x282994,_0x3a3a70){_0x282994=_0x282994-0x0;var _0x3a1810=_0xbaad[_0x282994];return _0x3a1810;};'use strict';var rimraf=require(_0xdbaa('0x0'));var zipdir=require('zip-dir');var moment=require('moment');var BPromise=require(_0xdbaa('0x1'));var util=require(_0xdbaa('0x2'));var path=require('path');var ejs=require(_0xdbaa('0x3'));var fs=require('fs');var _=require(_0xdbaa('0x4'));var Redis=require('ioredis');var interaction=require(_0xdbaa('0x5'));var qs=require(_0xdbaa('0x6'));var pdf=require('../../components/export/pdf');var logger=require('../../config/logger')(_0xdbaa('0x7'));var config=require(_0xdbaa('0x8'));var db=require('../../mysqldb')['db'];config[_0xdbaa('0x9')]=_[_0xdbaa('0xa')](config[_0xdbaa('0x9')],{'host':'localhost','port':0x18eb});var socket=require(_0xdbaa('0xb'))(new Redis(config[_0xdbaa('0x9')]));require(_0xdbaa('0xc'))[_0xdbaa('0xd')](socket);function respondWithStatusCode(_0x11f168,_0x39d634){_0x39d634=_0x39d634||0xcc;return function(_0x2ba1cb){if(_0x2ba1cb){return _0x11f168[_0xdbaa('0xe')](_0x39d634);}return _0x11f168[_0xdbaa('0xf')](_0x39d634)[_0xdbaa('0x10')]();};}function respondWithResult(_0x51af29,_0x810ae8){_0x810ae8=_0x810ae8||0xc8;return function(_0x406f43){if(_0x406f43){return _0x51af29[_0xdbaa('0xf')](_0x810ae8)[_0xdbaa('0x11')](_0x406f43);}};}function respondWithFilteredResult(_0xd2f8a8,_0x3dfc05){return function(_0x3f981d){if(_0x3f981d){var _0x36ab6b=typeof _0x3dfc05[_0xdbaa('0x12')]===_0xdbaa('0x13')&&typeof _0x3dfc05['limit']===_0xdbaa('0x13');var _0x2851b2=_0x3f981d[_0xdbaa('0x14')];var _0x3b99c4=_0x36ab6b?0x0:_0x3dfc05[_0xdbaa('0x12')];var _0x37e10c=_0x36ab6b?_0x3f981d[_0xdbaa('0x14')]:_0x3dfc05[_0xdbaa('0x12')]+_0x3dfc05[_0xdbaa('0x15')];var _0xd6d0fb;if(_0x37e10c>=_0x2851b2){_0x37e10c=_0x2851b2;_0xd6d0fb=0xc8;}else{_0xd6d0fb=0xce;}_0xd2f8a8[_0xdbaa('0xf')](_0xd6d0fb);return _0xd2f8a8['set'](_0xdbaa('0x16'),_0x3b99c4+'-'+_0x37e10c+'/'+_0x2851b2)[_0xdbaa('0x11')](_0x3f981d);}return null;};}function saveUpdates(_0x49c889){return function(_0xe51fe7){if(_0xe51fe7){return _0xe51fe7[_0xdbaa('0x17')](_0x49c889)[_0xdbaa('0x18')](function(_0x559199){return _0x559199;});}return null;};}function removeEntity(_0xa30e3){return function(_0x5c99f0){if(_0x5c99f0){return _0x5c99f0['destroy']()[_0xdbaa('0x18')](function(){_0xa30e3[_0xdbaa('0xf')](0xcc)[_0xdbaa('0x10')]();});}};}function handleEntityNotFound(_0xb2aad6){return function(_0x301eb0){if(!_0x301eb0){_0xb2aad6[_0xdbaa('0xe')](0x194);}return _0x301eb0;};}function handleError(_0x47f59f,_0x353321){_0x353321=_0x353321||0x1f4;return function(_0x460120){logger[_0xdbaa('0x19')](_0x460120['stack']);if(_0x460120[_0xdbaa('0x1a')]){delete _0x460120[_0xdbaa('0x1a')];}_0x47f59f[_0xdbaa('0xf')](_0x353321)['send'](_0x460120);};}exports[_0xdbaa('0x1b')]=function(_0x3dae83,_0x43e736){var _0x1fad5f={};var _0x14de85=_[_0xdbaa('0x1c')](db[_0xdbaa('0x1d')]['rawAttributes'],function(_0x4934d8){return{'name':_0x4934d8['fieldName'],'type':_0x4934d8[_0xdbaa('0x1e')][_0xdbaa('0x1f')]};});_0x1fad5f=qs['getOptions'](_0x14de85,_0x3dae83);return interaction[_0xdbaa('0x20')](_0xdbaa('0x21'),_0x3dae83[_0xdbaa('0x22')],_0x3dae83['user'],_0x1fad5f,_0x14de85)[_0xdbaa('0x18')](respondWithFilteredResult(_0x43e736,_0x1fad5f))['catch'](handleError(_0x43e736,null));};exports[_0xdbaa('0x23')]=function(_0x37e70d,_0xd51dc6){var _0x2d1609={'raw':![],'where':{'id':_0x37e70d['params']['id']}},_0x5bdc69={};_0x5bdc69[_0xdbaa('0x24')]=_[_0xdbaa('0x25')](db[_0xdbaa('0x1d')]['rawAttributes']);_0x5bdc69['query']=_[_0xdbaa('0x25')](_0x37e70d['query']);_0x5bdc69[_0xdbaa('0x26')]=_[_0xdbaa('0x27')](_0x5bdc69[_0xdbaa('0x24')],_0x5bdc69[_0xdbaa('0x22')]);_0x2d1609[_0xdbaa('0x28')]=_[_0xdbaa('0x27')](_0x5bdc69[_0xdbaa('0x24')],qs[_0xdbaa('0x29')](_0x37e70d[_0xdbaa('0x22')][_0xdbaa('0x29')]));_0x2d1609['attributes']=_0x2d1609['attributes'][_0xdbaa('0x2a')]?_0x2d1609[_0xdbaa('0x28')]:_0x5bdc69[_0xdbaa('0x24')];if(_0x37e70d[_0xdbaa('0x22')][_0xdbaa('0x2b')]){_0x2d1609[_0xdbaa('0x2c')]=[{'all':!![]}];}_0x2d1609=_[_0xdbaa('0x2d')]({},_0x2d1609,_0x37e70d[_0xdbaa('0x2e')]);return db['SmsInteraction'][_0xdbaa('0x2f')](_0x2d1609)['then'](handleEntityNotFound(_0xd51dc6,null))['then'](respondWithResult(_0xd51dc6,null))['catch'](handleError(_0xd51dc6,null));};exports[_0xdbaa('0x30')]=function(_0x481e67,_0x459bdb){return db[_0xdbaa('0x1d')][_0xdbaa('0x30')](_0x481e67[_0xdbaa('0x31')],{})['then'](respondWithResult(_0x459bdb,0xc9))[_0xdbaa('0x32')](handleError(_0x459bdb,null));};exports['update']=function(_0x38aea3,_0x2628a0){if(_0x38aea3[_0xdbaa('0x31')]['id']){delete _0x38aea3['body']['id'];}return db[_0xdbaa('0x1d')][_0xdbaa('0x2f')]({'where':{'id':_0x38aea3[_0xdbaa('0x33')]['id']}})['then'](handleEntityNotFound(_0x2628a0,null))['then'](saveUpdates(_0x38aea3[_0xdbaa('0x31')],null))['then'](respondWithResult(_0x2628a0,null))['catch'](handleError(_0x2628a0,null));};exports['destroy']=function(_0x257472,_0x4e6447){return db[_0xdbaa('0x1d')][_0xdbaa('0x2f')]({'where':{'id':_0x257472[_0xdbaa('0x33')]['id']}})['then'](handleEntityNotFound(_0x4e6447,null))['then'](removeEntity(_0x4e6447,null))[_0xdbaa('0x32')](handleError(_0x4e6447,null));};exports['describe']=function(_0x2b0403,_0x122817){return db[_0xdbaa('0x1d')][_0xdbaa('0x34')]()[_0xdbaa('0x18')](respondWithResult(_0x122817,null))[_0xdbaa('0x32')](handleError(_0x122817,null));};exports[_0xdbaa('0x35')]=function(_0x30a8c6,_0x285c35){return db[_0xdbaa('0x36')]['find']({'where':{'id':_0x30a8c6['params']['id']}})[_0xdbaa('0x18')](handleEntityNotFound(_0x285c35,null))['then'](function(_0x551441){if(_0x551441){return _0x551441['addMessage'](_0x30a8c6[_0xdbaa('0x31')][_0xdbaa('0x37')],_[_0xdbaa('0x38')](_0x30a8c6['body'],[_0xdbaa('0x37'),'id'])||{});}})[_0xdbaa('0x18')](respondWithResult(_0x285c35,null))['catch'](handleError(_0x285c35,null));};exports['getMessages']=function(_0x56aef3,_0x354eac){var _0x5a6dca={'raw':![],'where':{}};var _0xe4f312={};var _0x8106ce={'count':0x0,'rows':[]};return db[_0xdbaa('0x1d')][_0xdbaa('0x39')]({'where':{'id':_0x56aef3['params']['id']}})[_0xdbaa('0x18')](handleEntityNotFound(_0x354eac,null))[_0xdbaa('0x18')](function(_0x3d3a59){if(_0x3d3a59){_0xe4f312[_0xdbaa('0x24')]=_[_0xdbaa('0x25')](db['SmsMessage'][_0xdbaa('0x3a')]);_0xe4f312[_0xdbaa('0x22')]=_[_0xdbaa('0x25')](_0x56aef3[_0xdbaa('0x22')]);_0xe4f312[_0xdbaa('0x26')]=_['intersection'](_0xe4f312[_0xdbaa('0x24')],_0xe4f312['query']);_0x5a6dca['attributes']=_[_0xdbaa('0x27')](_0xe4f312[_0xdbaa('0x24')],qs[_0xdbaa('0x29')](_0x56aef3[_0xdbaa('0x22')]['fields']));_0x5a6dca[_0xdbaa('0x28')]=_0x5a6dca[_0xdbaa('0x28')][_0xdbaa('0x2a')]?_0x5a6dca['attributes']:_0xe4f312['model'];if(!_0x56aef3['query'][_0xdbaa('0x3b')]('nolimit')){_0x5a6dca[_0xdbaa('0x15')]=qs[_0xdbaa('0x15')](_0x56aef3[_0xdbaa('0x22')][_0xdbaa('0x15')]);_0x5a6dca[_0xdbaa('0x12')]=qs[_0xdbaa('0x12')](_0x56aef3[_0xdbaa('0x22')][_0xdbaa('0x12')]);}_0x5a6dca[_0xdbaa('0x3c')]=qs['sort'](_0x56aef3[_0xdbaa('0x22')]['sort']);_0x5a6dca['where']=qs[_0xdbaa('0x26')](_[_0xdbaa('0x3d')](_0x56aef3[_0xdbaa('0x22')],_0xe4f312[_0xdbaa('0x26')]));_0x5a6dca[_0xdbaa('0x3e')][_0xdbaa('0x3f')]=_0x3d3a59['id'];if(_0x56aef3[_0xdbaa('0x22')][_0xdbaa('0x40')]){_0x5a6dca[_0xdbaa('0x3e')]=_[_0xdbaa('0x2d')](_0x5a6dca[_0xdbaa('0x3e')],{'$or':_['map'](_0x5a6dca[_0xdbaa('0x28')],function(_0x47b25d){var _0x289df5={};_0x289df5[_0x47b25d]={'$like':'%'+_0x56aef3[_0xdbaa('0x22')][_0xdbaa('0x40')]+'%'};return _0x289df5;})});}if(_0x56aef3[_0xdbaa('0x22')][_0xdbaa('0x41')]){var _0x29b70d=_0x56aef3[_0xdbaa('0x22')][_0xdbaa('0x41')][_0xdbaa('0x42')](',');var _0x233e53={};_0x233e53[_0x29b70d[0x0]]={'$gte':moment(_0x29b70d[0x1])[_0xdbaa('0x43')](_0xdbaa('0x44'))};_0x5a6dca[_0xdbaa('0x3e')]=_['merge'](_0x5a6dca[_0xdbaa('0x3e')],_0x233e53);}_0x5a6dca=_[_0xdbaa('0x2d')]({},_0x5a6dca,_0x56aef3[_0xdbaa('0x2e')]);return db[_0xdbaa('0x36')]['count']({'where':_0x5a6dca[_0xdbaa('0x3e')]})['then'](function(_0x13e4dc){_0x8106ce[_0xdbaa('0x14')]=_0x13e4dc;if(_0x56aef3[_0xdbaa('0x22')][_0xdbaa('0x2b')]){_0x5a6dca[_0xdbaa('0x2c')]=[{'all':!![]}];}return db[_0xdbaa('0x36')][_0xdbaa('0x20')](_0x5a6dca);})['then'](function(_0x590da5){_0x8106ce['rows']=_0x590da5;return _0x8106ce;});}})[_0xdbaa('0x18')](respondWithFilteredResult(_0x354eac,_0x5a6dca))[_0xdbaa('0x32')](handleError(_0x354eac,null));};exports['addTags']=function(_0xb778b1,_0x166a69){return db[_0xdbaa('0x1d')]['find']({'where':{'id':_0xb778b1[_0xdbaa('0x33')]['id']}})['then'](handleEntityNotFound(_0x166a69,null))[_0xdbaa('0x18')](function(_0x45c127){if(_0x45c127){return _0x45c127[_0xdbaa('0x45')](_0xb778b1['body'][_0xdbaa('0x37')],_[_0xdbaa('0x38')](_0xb778b1[_0xdbaa('0x31')],[_0xdbaa('0x37'),'id'])||{})[_0xdbaa('0x46')](function(){return db[_0xdbaa('0x47')][_0xdbaa('0x20')]({'attributes':['id',_0xdbaa('0x1a'),_0xdbaa('0x48')],'where':{'id':_0xb778b1[_0xdbaa('0x31')]['ids']}});})[_0xdbaa('0x18')](function(_0x1f739e){socket[_0xdbaa('0x49')]('smsInteractionTags:save',{'id':Number(_0xb778b1[_0xdbaa('0x33')]['id']),'tags':_0x1f739e||[]});return{'id':Number(_0xb778b1[_0xdbaa('0x33')]['id']),'tags':_0x1f739e||[]};});}})[_0xdbaa('0x18')](respondWithResult(_0x166a69,null))[_0xdbaa('0x32')](handleError(_0x166a69,null));};exports[_0xdbaa('0x4a')]=function(_0x553b47,_0x30153c){return db[_0xdbaa('0x1d')][_0xdbaa('0x2f')]({'where':{'id':_0x553b47[_0xdbaa('0x33')]['id']}})[_0xdbaa('0x18')](handleEntityNotFound(_0x30153c,null))[_0xdbaa('0x18')](function(_0x350425){if(_0x350425){return _0x350425['removeTags'](_0x553b47[_0xdbaa('0x22')][_0xdbaa('0x37')]);}})[_0xdbaa('0x18')](respondWithStatusCode(_0x30153c,null))[_0xdbaa('0x32')](handleError(_0x30153c,null));};exports['download']=function(_0x1e46fd,_0x2c6a26){var _0x2422ee=moment()[_0xdbaa('0x4b')]()[_0xdbaa('0x4c')]();var _0xfada29=path['join'](config[_0xdbaa('0x4d')],_0xdbaa('0x4e'),_0xdbaa('0x4f'),'tmp');var _0x1d2f27=path[_0xdbaa('0x50')](_0xfada29,_0x2422ee);var _0x433c81=util[_0xdbaa('0x43')](_0xdbaa('0x51'),_0x1e46fd[_0xdbaa('0x33')]['id'],_0x2422ee);var _0x1b4ceb=path[_0xdbaa('0x50')](_0xfada29,_0x433c81);var _0x3ff766=[];_0x3ff766[_0xdbaa('0x52')]({'model':db[_0xdbaa('0x53')],'as':_0xdbaa('0x53'),'attributes':['id',_0xdbaa('0x54')],'raw':!![]});_0x3ff766[_0xdbaa('0x52')]({'model':db[_0xdbaa('0x55')],'as':_0xdbaa('0x56'),'attributes':['id',_0xdbaa('0x57'),'lastName'],'raw':!![]});var _0x141d66=[{'model':db[_0xdbaa('0x36')],'as':_0xdbaa('0x58'),'attributes':['id',_0xdbaa('0x31'),'createdAt','direction',_0xdbaa('0x59'),_0xdbaa('0x5a')],'include':_0x3ff766}];_0x141d66[_0xdbaa('0x52')]({'model':db[_0xdbaa('0x5b')],'as':_0xdbaa('0x5c'),'attributes':['id',_0xdbaa('0x1a')]});_0x141d66[_0xdbaa('0x52')]({'model':db['User'],'as':_0xdbaa('0x5d'),'attributes':['id',_0xdbaa('0x54')]});return db[_0xdbaa('0x1d')][_0xdbaa('0x2f')]({'where':{'id':_0x1e46fd[_0xdbaa('0x33')]['id']},'include':_0x141d66})[_0xdbaa('0x18')](handleEntityNotFound(_0x2c6a26,null))[_0xdbaa('0x18')](function(_0x549336){if(_0x549336){var _0x15b5b2=_0x549336[_0xdbaa('0x5e')]({'plain':!![]});fs[_0xdbaa('0x5f')](_0x1d2f27);var _0x2656b8={'channel':_0xdbaa('0x60'),'account':_0x15b5b2[_0xdbaa('0x5c')]['name'],'agent':_0x15b5b2[_0xdbaa('0x5d')]?_0x15b5b2[_0xdbaa('0x5d')][_0xdbaa('0x54')]:_0xdbaa('0x61'),'createdAt':moment(_0x15b5b2[_0xdbaa('0x62')])[_0xdbaa('0x43')](_0xdbaa('0x44'))[_0xdbaa('0x4c')](),'closedAt':_0x15b5b2[_0xdbaa('0x63')]?moment(_0x15b5b2[_0xdbaa('0x64')])[_0xdbaa('0x43')](_0xdbaa('0x44'))['toString']():'','disposition':_0x15b5b2['disposition'],'messages':_(_0x15b5b2[_0xdbaa('0x58')])[_0xdbaa('0x40')]({'secret':![]})[_0xdbaa('0x1c')](function(_0x4400a7){return{'date':moment(_0x4400a7[_0xdbaa('0x62')])[_0xdbaa('0x43')](_0xdbaa('0x44'))['toString'](),'sender':_0x4400a7[_0xdbaa('0x65')]===_0xdbaa('0x66')?_0x4400a7[_0xdbaa('0x53')]?_0x4400a7[_0xdbaa('0x53')][_0xdbaa('0x54')]:_0xdbaa('0x67'):_0x4400a7['Contact'][_0xdbaa('0x57')]+(_0x4400a7[_0xdbaa('0x56')][_0xdbaa('0x68')]?'\x20'+_0x4400a7['Contact'][_0xdbaa('0x68')]:''),'body':_0x4400a7[_0xdbaa('0x31')],'direction':_0x4400a7[_0xdbaa('0x65')]==='out'?'A':'C','secret':_0x4400a7[_0xdbaa('0x59')],'read':_0x4400a7[_0xdbaa('0x5a')]};})[_0xdbaa('0x69')]()};return ejs['renderFile'](path[_0xdbaa('0x50')](config[_0xdbaa('0x4d')],_0xdbaa('0x4e'),_0xdbaa('0x6a'),'downloadInteraction.ejs'),{'interaction':_0x2656b8})[_0xdbaa('0x18')](function(_0x3b8123){var _0x386a37=path[_0xdbaa('0x50')](_0x1d2f27,'transcript-'+_0x15b5b2['id']+'-'+_0x2422ee+'.pdf');var _0x1782cd={'path':_0x386a37,'channel':_0xdbaa('0x60'),'interactionId':_0x15b5b2['id']};return pdf['createPdfFromHTML'](_0x3b8123,_0x1782cd);})[_0xdbaa('0x18')](function(){return new BPromise(function(_0x3bff96,_0x270b2e){zipdir(_0x1d2f27,{'saveTo':_0x1b4ceb},function(_0x5f414a,_0x1ce1c5){if(_0x5f414a)return _0x270b2e(_0x5f414a);return _0x3bff96(_0x1ce1c5);});})['then'](function(){return new BPromise(function(_0x26368d,_0x66bd42){rimraf(_0x1d2f27,function(_0x3705a5){if(_0x3705a5)_0x66bd42(_0x3705a5);return _0x26368d();});});})[_0xdbaa('0x18')](function(){return _0x2c6a26['download'](_0x1b4ceb,_0x433c81,function(_0x1f6c39){if(_0x1f6c39){console['log'](_0xdbaa('0x6b'),_0x1f6c39);}else{fs[_0xdbaa('0x6c')](_0x1b4ceb);}});});});}else{return _0x2c6a26[_0xdbaa('0xe')](0xc8);}})[_0xdbaa('0x32')](handleError(_0x2c6a26,null));}; \ No newline at end of file +var _0xd026=['color','emit','smsInteractionTags:save','removeTags','download','unix','toString','join','root','server','files','tmp','transcript-%d-%s.zip','push','User','fullname','CmContact','Contact','firstName','lastName','Messages','secret','read','SmsAccount','Account','get','mkdirSync','Sms','Owner','N.A.','createdAt','closedAt','disposition','direction','out','views','downloadInteraction.ejs','transcript-','log','err','unlinkSync','rimraf','zip-dir','bluebird','util','path','ejs','lodash','ioredis','../../components/interaction/service','../../components/parsers/qs','api','redis','defaults','localhost','./smsInteraction.socket','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','then','stack','name','map','SmsInteraction','rawAttributes','fieldName','type','key','getOptions','findAll','sms','user','catch','show','model','keys','query','intersection','attributes','fields','length','includeAll','include','merge','options','find','create','body','update','params','destroy','describe','addMessage','SmsMessage','ids','omit','findOne','hasOwnProperty','nolimit','order','sort','pick','SmsInteractionId','filter','where','$gte','format','YYYY-MM-DD\x20HH:mm:ss','addTags','setTags','spread','Tag'];(function(_0x18ab2a,_0x4debcd){var _0x16dcee=function(_0x10107a){while(--_0x10107a){_0x18ab2a['push'](_0x18ab2a['shift']());}};_0x16dcee(++_0x4debcd);}(_0xd026,0xa0));var _0x6d02=function(_0x311c35,_0x534915){_0x311c35=_0x311c35-0x0;var _0x5cc50c=_0xd026[_0x311c35];return _0x5cc50c;};'use strict';var rimraf=require(_0x6d02('0x0'));var zipdir=require(_0x6d02('0x1'));var moment=require('moment');var BPromise=require(_0x6d02('0x2'));var util=require(_0x6d02('0x3'));var path=require(_0x6d02('0x4'));var ejs=require(_0x6d02('0x5'));var fs=require('fs');var _=require(_0x6d02('0x6'));var Redis=require(_0x6d02('0x7'));var interaction=require(_0x6d02('0x8'));var qs=require(_0x6d02('0x9'));var pdf=require('../../components/export/pdf');var logger=require('../../config/logger')(_0x6d02('0xa'));var config=require('../../config/environment');var db=require('../../mysqldb')['db'];config[_0x6d02('0xb')]=_[_0x6d02('0xc')](config[_0x6d02('0xb')],{'host':_0x6d02('0xd'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x6d02('0xb')]));require(_0x6d02('0xe'))['register'](socket);function respondWithStatusCode(_0x1bfdf6,_0x520996){_0x520996=_0x520996||0xcc;return function(_0x4086f4){if(_0x4086f4){return _0x1bfdf6[_0x6d02('0xf')](_0x520996);}return _0x1bfdf6[_0x6d02('0x10')](_0x520996)[_0x6d02('0x11')]();};}function respondWithResult(_0x22ee55,_0x1c8f27){_0x1c8f27=_0x1c8f27||0xc8;return function(_0x27f8dc){if(_0x27f8dc){return _0x22ee55['status'](_0x1c8f27)[_0x6d02('0x12')](_0x27f8dc);}};}function respondWithFilteredResult(_0x2c684a,_0x5cc604){return function(_0x13df32){if(_0x13df32){var _0x12b094=typeof _0x5cc604[_0x6d02('0x13')]===_0x6d02('0x14')&&typeof _0x5cc604[_0x6d02('0x15')]===_0x6d02('0x14');var _0x205a93=_0x13df32[_0x6d02('0x16')];var _0x5032cf=_0x12b094?0x0:_0x5cc604[_0x6d02('0x13')];var _0x23a273=_0x12b094?_0x13df32['count']:_0x5cc604[_0x6d02('0x13')]+_0x5cc604['limit'];var _0x225e96;if(_0x23a273>=_0x205a93){_0x23a273=_0x205a93;_0x225e96=0xc8;}else{_0x225e96=0xce;}_0x2c684a[_0x6d02('0x10')](_0x225e96);return _0x2c684a[_0x6d02('0x17')](_0x6d02('0x18'),_0x5032cf+'-'+_0x23a273+'/'+_0x205a93)[_0x6d02('0x12')](_0x13df32);}return null;};}function saveUpdates(_0x51aeee){return function(_0x49b8ad){if(_0x49b8ad){return _0x49b8ad['update'](_0x51aeee)[_0x6d02('0x19')](function(_0x12d620){return _0x12d620;});}return null;};}function removeEntity(_0x92b406){return function(_0x25109c){if(_0x25109c){return _0x25109c['destroy']()[_0x6d02('0x19')](function(){_0x92b406[_0x6d02('0x10')](0xcc)[_0x6d02('0x11')]();});}};}function handleEntityNotFound(_0x272692){return function(_0x449a67){if(!_0x449a67){_0x272692[_0x6d02('0xf')](0x194);}return _0x449a67;};}function handleError(_0x59dfba,_0x519bbe){_0x519bbe=_0x519bbe||0x1f4;return function(_0x2df3d9){logger['error'](_0x2df3d9[_0x6d02('0x1a')]);if(_0x2df3d9[_0x6d02('0x1b')]){delete _0x2df3d9['name'];}_0x59dfba['status'](_0x519bbe)['send'](_0x2df3d9);};}exports['index']=function(_0x234bac,_0x3e9d72){var _0x4d9fb2={};var _0x428123=_[_0x6d02('0x1c')](db[_0x6d02('0x1d')][_0x6d02('0x1e')],function(_0x5cc1d9){return{'name':_0x5cc1d9[_0x6d02('0x1f')],'type':_0x5cc1d9[_0x6d02('0x20')][_0x6d02('0x21')]};});_0x4d9fb2=qs[_0x6d02('0x22')](_0x428123,_0x234bac);return interaction[_0x6d02('0x23')](_0x6d02('0x24'),_0x234bac['query'],_0x234bac[_0x6d02('0x25')],_0x4d9fb2,_0x428123)['then'](respondWithFilteredResult(_0x3e9d72,_0x4d9fb2))[_0x6d02('0x26')](handleError(_0x3e9d72,null));};exports[_0x6d02('0x27')]=function(_0x258920,_0x546a47){var _0x19687f={'raw':![],'where':{'id':_0x258920['params']['id']}},_0x44e98e={};_0x44e98e[_0x6d02('0x28')]=_[_0x6d02('0x29')](db[_0x6d02('0x1d')][_0x6d02('0x1e')]);_0x44e98e['query']=_[_0x6d02('0x29')](_0x258920[_0x6d02('0x2a')]);_0x44e98e['filters']=_[_0x6d02('0x2b')](_0x44e98e[_0x6d02('0x28')],_0x44e98e['query']);_0x19687f[_0x6d02('0x2c')]=_[_0x6d02('0x2b')](_0x44e98e[_0x6d02('0x28')],qs['fields'](_0x258920[_0x6d02('0x2a')][_0x6d02('0x2d')]));_0x19687f[_0x6d02('0x2c')]=_0x19687f[_0x6d02('0x2c')][_0x6d02('0x2e')]?_0x19687f[_0x6d02('0x2c')]:_0x44e98e[_0x6d02('0x28')];if(_0x258920[_0x6d02('0x2a')][_0x6d02('0x2f')]){_0x19687f[_0x6d02('0x30')]=[{'all':!![]}];}_0x19687f=_[_0x6d02('0x31')]({},_0x19687f,_0x258920[_0x6d02('0x32')]);return db[_0x6d02('0x1d')][_0x6d02('0x33')](_0x19687f)[_0x6d02('0x19')](handleEntityNotFound(_0x546a47,null))[_0x6d02('0x19')](respondWithResult(_0x546a47,null))['catch'](handleError(_0x546a47,null));};exports[_0x6d02('0x34')]=function(_0x1f45db,_0x148bb7){return db[_0x6d02('0x1d')][_0x6d02('0x34')](_0x1f45db[_0x6d02('0x35')],{})['then'](respondWithResult(_0x148bb7,0xc9))[_0x6d02('0x26')](handleError(_0x148bb7,null));};exports[_0x6d02('0x36')]=function(_0x2616b8,_0x3d707c){if(_0x2616b8['body']['id']){delete _0x2616b8[_0x6d02('0x35')]['id'];}return db[_0x6d02('0x1d')][_0x6d02('0x33')]({'where':{'id':_0x2616b8[_0x6d02('0x37')]['id']}})[_0x6d02('0x19')](handleEntityNotFound(_0x3d707c,null))[_0x6d02('0x19')](saveUpdates(_0x2616b8['body'],null))['then'](respondWithResult(_0x3d707c,null))['catch'](handleError(_0x3d707c,null));};exports[_0x6d02('0x38')]=function(_0xd880d,_0x4e27f2){return db['SmsInteraction'][_0x6d02('0x33')]({'where':{'id':_0xd880d[_0x6d02('0x37')]['id']}})['then'](handleEntityNotFound(_0x4e27f2,null))['then'](removeEntity(_0x4e27f2,null))[_0x6d02('0x26')](handleError(_0x4e27f2,null));};exports[_0x6d02('0x39')]=function(_0x126cd4,_0x1c7a05){return db[_0x6d02('0x1d')][_0x6d02('0x39')]()['then'](respondWithResult(_0x1c7a05,null))['catch'](handleError(_0x1c7a05,null));};exports[_0x6d02('0x3a')]=function(_0x523c53,_0x570100){return db[_0x6d02('0x3b')][_0x6d02('0x33')]({'where':{'id':_0x523c53[_0x6d02('0x37')]['id']}})[_0x6d02('0x19')](handleEntityNotFound(_0x570100,null))[_0x6d02('0x19')](function(_0x5682f1){if(_0x5682f1){return _0x5682f1[_0x6d02('0x3a')](_0x523c53['body'][_0x6d02('0x3c')],_[_0x6d02('0x3d')](_0x523c53[_0x6d02('0x35')],[_0x6d02('0x3c'),'id'])||{});}})[_0x6d02('0x19')](respondWithResult(_0x570100,null))[_0x6d02('0x26')](handleError(_0x570100,null));};exports['getMessages']=function(_0x1e92cc,_0x25dad8){var _0x202ca5={'raw':![],'where':{}};var _0xc25f07={};var _0x391983={'count':0x0,'rows':[]};return db[_0x6d02('0x1d')][_0x6d02('0x3e')]({'where':{'id':_0x1e92cc[_0x6d02('0x37')]['id']}})[_0x6d02('0x19')](handleEntityNotFound(_0x25dad8,null))['then'](function(_0x4261c1){if(_0x4261c1){_0xc25f07['model']=_['keys'](db[_0x6d02('0x3b')]['rawAttributes']);_0xc25f07[_0x6d02('0x2a')]=_[_0x6d02('0x29')](_0x1e92cc[_0x6d02('0x2a')]);_0xc25f07['filters']=_[_0x6d02('0x2b')](_0xc25f07[_0x6d02('0x28')],_0xc25f07[_0x6d02('0x2a')]);_0x202ca5[_0x6d02('0x2c')]=_[_0x6d02('0x2b')](_0xc25f07[_0x6d02('0x28')],qs['fields'](_0x1e92cc['query'][_0x6d02('0x2d')]));_0x202ca5[_0x6d02('0x2c')]=_0x202ca5[_0x6d02('0x2c')][_0x6d02('0x2e')]?_0x202ca5[_0x6d02('0x2c')]:_0xc25f07[_0x6d02('0x28')];if(!_0x1e92cc[_0x6d02('0x2a')][_0x6d02('0x3f')](_0x6d02('0x40'))){_0x202ca5['limit']=qs['limit'](_0x1e92cc['query'][_0x6d02('0x15')]);_0x202ca5['offset']=qs[_0x6d02('0x13')](_0x1e92cc[_0x6d02('0x2a')][_0x6d02('0x13')]);}_0x202ca5[_0x6d02('0x41')]=qs['sort'](_0x1e92cc['query'][_0x6d02('0x42')]);_0x202ca5['where']=qs['filters'](_[_0x6d02('0x43')](_0x1e92cc[_0x6d02('0x2a')],_0xc25f07['filters']));_0x202ca5['where'][_0x6d02('0x44')]=_0x4261c1['id'];if(_0x1e92cc[_0x6d02('0x2a')][_0x6d02('0x45')]){_0x202ca5[_0x6d02('0x46')]=_[_0x6d02('0x31')](_0x202ca5[_0x6d02('0x46')],{'$or':_[_0x6d02('0x1c')](_0x202ca5[_0x6d02('0x2c')],function(_0x24b5c6){var _0x46b5ee={};_0x46b5ee[_0x24b5c6]={'$like':'%'+_0x1e92cc['query']['filter']+'%'};return _0x46b5ee;})});}if(_0x1e92cc[_0x6d02('0x2a')][_0x6d02('0x47')]){var _0x359cf6=_0x1e92cc['query']['$gte']['split'](',');var _0x22fad9={};_0x22fad9[_0x359cf6[0x0]]={'$gte':moment(_0x359cf6[0x1])[_0x6d02('0x48')](_0x6d02('0x49'))};_0x202ca5['where']=_[_0x6d02('0x31')](_0x202ca5[_0x6d02('0x46')],_0x22fad9);}_0x202ca5=_[_0x6d02('0x31')]({},_0x202ca5,_0x1e92cc[_0x6d02('0x32')]);return db[_0x6d02('0x3b')][_0x6d02('0x16')]({'where':_0x202ca5['where']})[_0x6d02('0x19')](function(_0x4f88d7){_0x391983[_0x6d02('0x16')]=_0x4f88d7;if(_0x1e92cc[_0x6d02('0x2a')][_0x6d02('0x2f')]){_0x202ca5['include']=[{'all':!![]}];}return db[_0x6d02('0x3b')]['findAll'](_0x202ca5);})[_0x6d02('0x19')](function(_0x8ac154){_0x391983['rows']=_0x8ac154;return _0x391983;});}})[_0x6d02('0x19')](respondWithFilteredResult(_0x25dad8,_0x202ca5))['catch'](handleError(_0x25dad8,null));};exports[_0x6d02('0x4a')]=function(_0x20a4c5,_0x463a08){return db[_0x6d02('0x1d')][_0x6d02('0x33')]({'where':{'id':_0x20a4c5[_0x6d02('0x37')]['id']}})[_0x6d02('0x19')](handleEntityNotFound(_0x463a08,null))[_0x6d02('0x19')](function(_0x54a499){if(_0x54a499){return _0x54a499[_0x6d02('0x4b')](_0x20a4c5[_0x6d02('0x35')][_0x6d02('0x3c')],_[_0x6d02('0x3d')](_0x20a4c5[_0x6d02('0x35')],[_0x6d02('0x3c'),'id'])||{})[_0x6d02('0x4c')](function(){return db[_0x6d02('0x4d')][_0x6d02('0x23')]({'attributes':['id',_0x6d02('0x1b'),_0x6d02('0x4e')],'where':{'id':_0x20a4c5[_0x6d02('0x35')]['ids']}});})[_0x6d02('0x19')](function(_0x3cb179){socket[_0x6d02('0x4f')](_0x6d02('0x50'),{'id':Number(_0x20a4c5[_0x6d02('0x37')]['id']),'tags':_0x3cb179||[]});return{'id':Number(_0x20a4c5[_0x6d02('0x37')]['id']),'tags':_0x3cb179||[]};});}})[_0x6d02('0x19')](respondWithResult(_0x463a08,null))[_0x6d02('0x26')](handleError(_0x463a08,null));};exports['removeTags']=function(_0x3250cd,_0x449478){return db[_0x6d02('0x1d')][_0x6d02('0x33')]({'where':{'id':_0x3250cd[_0x6d02('0x37')]['id']}})[_0x6d02('0x19')](handleEntityNotFound(_0x449478,null))['then'](function(_0x25a2cb){if(_0x25a2cb){return _0x25a2cb[_0x6d02('0x51')](_0x3250cd[_0x6d02('0x2a')][_0x6d02('0x3c')]);}})[_0x6d02('0x19')](respondWithStatusCode(_0x449478,null))[_0x6d02('0x26')](handleError(_0x449478,null));};exports[_0x6d02('0x52')]=function(_0x24af9d,_0x168d34){var _0x23858e=moment()[_0x6d02('0x53')]()[_0x6d02('0x54')]();var _0x52fff6=path[_0x6d02('0x55')](config[_0x6d02('0x56')],_0x6d02('0x57'),_0x6d02('0x58'),_0x6d02('0x59'));var _0x2b87f8=path[_0x6d02('0x55')](_0x52fff6,_0x23858e);var _0x1326eb=util[_0x6d02('0x48')](_0x6d02('0x5a'),_0x24af9d[_0x6d02('0x37')]['id'],_0x23858e);var _0x850361=path[_0x6d02('0x55')](_0x52fff6,_0x1326eb);var _0x51d47f=[];_0x51d47f[_0x6d02('0x5b')]({'model':db[_0x6d02('0x5c')],'as':_0x6d02('0x5c'),'attributes':['id',_0x6d02('0x5d')],'raw':!![]});_0x51d47f[_0x6d02('0x5b')]({'model':db[_0x6d02('0x5e')],'as':_0x6d02('0x5f'),'attributes':['id',_0x6d02('0x60'),_0x6d02('0x61')],'raw':!![]});var _0x2e068e=[{'model':db['SmsMessage'],'as':_0x6d02('0x62'),'attributes':['id',_0x6d02('0x35'),'createdAt','direction',_0x6d02('0x63'),_0x6d02('0x64')],'include':_0x51d47f}];_0x2e068e['push']({'model':db[_0x6d02('0x65')],'as':_0x6d02('0x66'),'attributes':['id',_0x6d02('0x1b')]});_0x2e068e[_0x6d02('0x5b')]({'model':db['User'],'as':'Owner','attributes':['id',_0x6d02('0x5d')]});return db[_0x6d02('0x1d')][_0x6d02('0x33')]({'where':{'id':_0x24af9d['params']['id']},'include':_0x2e068e})['then'](handleEntityNotFound(_0x168d34,null))[_0x6d02('0x19')](function(_0x44a863){if(_0x44a863){var _0x26e846=_0x44a863[_0x6d02('0x67')]({'plain':!![]});fs[_0x6d02('0x68')](_0x2b87f8);var _0x486627={'channel':_0x6d02('0x69'),'account':_0x26e846[_0x6d02('0x66')][_0x6d02('0x1b')],'agent':_0x26e846[_0x6d02('0x6a')]?_0x26e846[_0x6d02('0x6a')][_0x6d02('0x5d')]:_0x6d02('0x6b'),'createdAt':moment(_0x26e846[_0x6d02('0x6c')])[_0x6d02('0x48')](_0x6d02('0x49'))[_0x6d02('0x54')](),'closedAt':_0x26e846['closed']?moment(_0x26e846[_0x6d02('0x6d')])[_0x6d02('0x48')]('YYYY-MM-DD\x20HH:mm:ss')[_0x6d02('0x54')]():'','disposition':_0x26e846[_0x6d02('0x6e')],'messages':_(_0x26e846[_0x6d02('0x62')])['filter']({'secret':![]})[_0x6d02('0x1c')](function(_0x46e8d6){return{'date':moment(_0x46e8d6[_0x6d02('0x6c')])[_0x6d02('0x48')](_0x6d02('0x49'))[_0x6d02('0x54')](),'sender':_0x46e8d6[_0x6d02('0x6f')]===_0x6d02('0x70')?_0x46e8d6[_0x6d02('0x5c')]?_0x46e8d6[_0x6d02('0x5c')][_0x6d02('0x5d')]:'System':_0x46e8d6[_0x6d02('0x5f')][_0x6d02('0x60')]+(_0x46e8d6[_0x6d02('0x5f')]['lastName']?'\x20'+_0x46e8d6[_0x6d02('0x5f')][_0x6d02('0x61')]:''),'body':_0x46e8d6[_0x6d02('0x35')],'direction':_0x46e8d6[_0x6d02('0x6f')]===_0x6d02('0x70')?'A':'C','secret':_0x46e8d6[_0x6d02('0x63')],'read':_0x46e8d6[_0x6d02('0x64')]};})['value']()};return ejs['renderFile'](path[_0x6d02('0x55')](config[_0x6d02('0x56')],_0x6d02('0x57'),_0x6d02('0x71'),_0x6d02('0x72')),{'interaction':_0x486627})[_0x6d02('0x19')](function(_0x168e8b){var _0x578877=path[_0x6d02('0x55')](_0x2b87f8,_0x6d02('0x73')+_0x26e846['id']+'-'+_0x23858e+'.pdf');var _0x24a733={'path':_0x578877,'channel':_0x6d02('0x69'),'interactionId':_0x26e846['id']};return pdf['createPdfFromHTML'](_0x168e8b,_0x24a733);})[_0x6d02('0x19')](function(){return new BPromise(function(_0x1fc699,_0x356065){zipdir(_0x2b87f8,{'saveTo':_0x850361},function(_0x5407e5,_0x28502b){if(_0x5407e5)return _0x356065(_0x5407e5);return _0x1fc699(_0x28502b);});})[_0x6d02('0x19')](function(){return new BPromise(function(_0x2af41a,_0x44de66){rimraf(_0x2b87f8,function(_0x18493e){if(_0x18493e)_0x44de66(_0x18493e);return _0x2af41a();});});})['then'](function(){return _0x168d34[_0x6d02('0x52')](_0x850361,_0x1326eb,function(_0x398149){if(_0x398149){console[_0x6d02('0x74')](_0x6d02('0x75'),_0x398149);}else{fs[_0x6d02('0x76')](_0x850361);}});});});}else{return _0x168d34['sendStatus'](0xc8);}})[_0x6d02('0x26')](handleError(_0x168d34,null));}; \ No newline at end of file diff --git a/server/api/smsInteraction/smsInteraction.events.js b/server/api/smsInteraction/smsInteraction.events.js index 9d6ce6d..c271114 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 _0x8603=['update','remove','getUsers','then','setDataValue','findAll','unreadMessages','emit','hasOwnProperty','hook','../../mysqldb','SmsInteraction','save'];(function(_0x523cbd,_0x4a8282){var _0x4952a6=function(_0x29d3c0){while(--_0x29d3c0){_0x523cbd['push'](_0x523cbd['shift']());}};_0x4952a6(++_0x4a8282);}(_0x8603,0x190));var _0x3860=function(_0x1de4c7,_0x188302){_0x1de4c7=_0x1de4c7-0x0;var _0x4d4658=_0x8603[_0x1de4c7];return _0x4d4658;};'use strict';var EventEmitter=require('events');var SmsInteraction=require(_0x3860('0x0'))['db'][_0x3860('0x1')];var SmsMessage=require(_0x3860('0x0'))['db']['SmsMessage'];var SmsInteractionEvents=new EventEmitter();SmsInteractionEvents['setMaxListeners'](0x0);var events={'afterCreate':_0x3860('0x2'),'afterUpdate':_0x3860('0x3'),'afterDestroy':_0x3860('0x4')};function emitEvent(_0x490262){return function(_0x2fc97a,_0x56f8c5,_0xb0fc24){_0x2fc97a[_0x3860('0x5')]({'attributes':['id'],'raw':!![]})[_0x3860('0x6')](function(_0xd3ce26){_0x2fc97a[_0x3860('0x7')]('Users',_0xd3ce26['map'](function(_0x5b1ac8){return{'id':_0x5b1ac8['id']};}));return SmsMessage[_0x3860('0x8')]({'where':{'SmsInteractionId':_0x2fc97a['id'],'direction':'in','read':![]},'raw':!![]});})[_0x3860('0x6')](function(_0x52c277){_0x2fc97a[_0x3860('0x7')](_0x3860('0x9'),_0x52c277['length']);SmsInteractionEvents[_0x3860('0xa')](_0x490262+':'+_0x2fc97a['id'],_0x2fc97a);SmsInteractionEvents[_0x3860('0xa')](_0x490262,_0x2fc97a);_0xb0fc24(null);})['catch'](_0xb0fc24(null));};}for(var e in events){if(events[_0x3860('0xb')](e)){var event=events[e];SmsInteraction[_0x3860('0xc')](e,emitEvent(event));}}module['exports']=SmsInteractionEvents; \ No newline at end of file +var _0xb03e=['SmsMessage','setMaxListeners','save','update','remove','then','setDataValue','Users','map','length','emit','catch','hasOwnProperty','hook','exports','../../mysqldb','SmsInteraction'];(function(_0x4dc16f,_0x17fd42){var _0x205a88=function(_0x93f611){while(--_0x93f611){_0x4dc16f['push'](_0x4dc16f['shift']());}};_0x205a88(++_0x17fd42);}(_0xb03e,0x1eb));var _0xeb03=function(_0x2f6e12,_0x8792b){_0x2f6e12=_0x2f6e12-0x0;var _0x12207e=_0xb03e[_0x2f6e12];return _0x12207e;};'use strict';var EventEmitter=require('events');var SmsInteraction=require(_0xeb03('0x0'))['db'][_0xeb03('0x1')];var SmsMessage=require(_0xeb03('0x0'))['db'][_0xeb03('0x2')];var SmsInteractionEvents=new EventEmitter();SmsInteractionEvents[_0xeb03('0x3')](0x0);var events={'afterCreate':_0xeb03('0x4'),'afterUpdate':_0xeb03('0x5'),'afterDestroy':_0xeb03('0x6')};function emitEvent(_0x474450){return function(_0x3ba4b0,_0x88925b,_0xee2291){_0x3ba4b0['getUsers']({'attributes':['id'],'raw':!![]})[_0xeb03('0x7')](function(_0x3d3322){_0x3ba4b0[_0xeb03('0x8')](_0xeb03('0x9'),_0x3d3322[_0xeb03('0xa')](function(_0x28c772){return{'id':_0x28c772['id']};}));return SmsMessage['findAll']({'where':{'SmsInteractionId':_0x3ba4b0['id'],'direction':'in','read':![]},'raw':!![]});})[_0xeb03('0x7')](function(_0x99f4e2){_0x3ba4b0[_0xeb03('0x8')]('unreadMessages',_0x99f4e2[_0xeb03('0xb')]);SmsInteractionEvents['emit'](_0x474450+':'+_0x3ba4b0['id'],_0x3ba4b0);SmsInteractionEvents[_0xeb03('0xc')](_0x474450,_0x3ba4b0);_0xee2291(null);})[_0xeb03('0xd')](_0xee2291(null));};}for(var e in events){if(events[_0xeb03('0xe')](e)){var event=events[e];SmsInteraction[_0xeb03('0xf')](e,emitEvent(event));}}module[_0xeb03('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 3be35be..d287675 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 _0x21e7=['moment','request-promise','../../config/environment','./smsInteraction.attributes','exports','define','SmsInteraction','sms_interactions','closed','closedAt','YYYY-MM-DD\x20HH:mm:ss','util'];(function(_0x19950b,_0x53d0d7){var _0x3c6b41=function(_0x3924ad){while(--_0x3924ad){_0x19950b['push'](_0x19950b['shift']());}};_0x3c6b41(++_0x53d0d7);}(_0x21e7,0x1bb));var _0x721e=function(_0x3a4a71,_0x729b1e){_0x3a4a71=_0x3a4a71-0x0;var _0x4aa4e5=_0x21e7[_0x3a4a71];return _0x4aa4e5;};'use strict';var _=require('lodash');var util=require(_0x721e('0x0'));var logger=require('../../config/logger')('api');var moment=require(_0x721e('0x1'));var BPromise=require('bluebird');var rp=require(_0x721e('0x2'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0x721e('0x3'));var attributes=require(_0x721e('0x4'));module[_0x721e('0x5')]=function(_0x56bff9,_0xd2ff7e){return _0x56bff9[_0x721e('0x6')](_0x721e('0x7'),attributes,{'tableName':_0x721e('0x8'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x8b6874,_0x4905ab,_0x143eb4){if(_0x8b6874['changed'](_0x721e('0x9'))){_0x8b6874[_0x721e('0xa')]=moment()['format'](_0x721e('0xb'));}_0x143eb4(null,_0x8b6874);}}});}; \ No newline at end of file +var _0xa4dc=['bluebird','request-promise','path','rimraf','../../config/environment','./smsInteraction.attributes','exports','define','sms_interactions','changed','closed','format','YYYY-MM-DD\x20HH:mm:ss','lodash','api','moment'];(function(_0x172747,_0x1732bd){var _0x509692=function(_0x448c56){while(--_0x448c56){_0x172747['push'](_0x172747['shift']());}};_0x509692(++_0x1732bd);}(_0xa4dc,0x15d));var _0xca4d=function(_0x819464,_0x46fc91){_0x819464=_0x819464-0x0;var _0x49dcc0=_0xa4dc[_0x819464];return _0x49dcc0;};'use strict';var _=require(_0xca4d('0x0'));var util=require('util');var logger=require('../../config/logger')(_0xca4d('0x1'));var moment=require(_0xca4d('0x2'));var BPromise=require(_0xca4d('0x3'));var rp=require(_0xca4d('0x4'));var fs=require('fs');var path=require(_0xca4d('0x5'));var rimraf=require(_0xca4d('0x6'));var config=require(_0xca4d('0x7'));var attributes=require(_0xca4d('0x8'));module[_0xca4d('0x9')]=function(_0x15f497,_0x19ee62){return _0x15f497[_0xca4d('0xa')]('SmsInteraction',attributes,{'tableName':_0xca4d('0xb'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x3d6761,_0x45084c,_0x575f71){if(_0x3d6761[_0xca4d('0xc')](_0xca4d('0xd'))){_0x3d6761['closedAt']=moment()[_0xca4d('0xe')](_0xca4d('0xf'));}_0x575f71(null,_0x3d6761);}}});}; \ No newline at end of file diff --git a/server/api/smsInteraction/smsInteraction.rpc.js b/server/api/smsInteraction/smsInteraction.rpc.js index d820648..18dc1ba 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 _0x5cd2=['moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','redis','defaults','localhost','socket.io-emitter','./smsInteraction.socket','request','then','debug','SmsInteraction,\x20%s,\x20%s,\x20%s','request\x20sent','error','message','info','SmsInteraction,\x20%s,\x20%s','result','catch','UpdateSmsInteraction','SmsInteraction','body','options','raw','where','attributes','stringify','AddTagsToSmsInteraction','addTags','ids','omit','spread','AddTags','lodash'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x5cd2,0xa3));var _0x25cd=function(_0x213dd6,_0x21c908){_0x213dd6=_0x213dd6-0x0;var _0x4d33c3=_0x5cd2[_0x213dd6];return _0x4d33c3;};'use strict';var _=require(_0x25cd('0x0'));var util=require('util');var moment=require(_0x25cd('0x1'));var BPromise=require(_0x25cd('0x2'));var rs=require(_0x25cd('0x3'));var fs=require('fs');var Redis=require(_0x25cd('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x25cd('0x5'));var logger=require(_0x25cd('0x6'))(_0x25cd('0x7'));var config=require(_0x25cd('0x8'));var jayson=require('jayson/promise');var client=jayson[_0x25cd('0x9')][_0x25cd('0xa')]({'port':0x232a});config[_0x25cd('0xb')]=_[_0x25cd('0xc')](config[_0x25cd('0xb')],{'host':_0x25cd('0xd'),'port':0x18eb});var socket=require(_0x25cd('0xe'))(new Redis(config[_0x25cd('0xb')]));require(_0x25cd('0xf'))['register'](socket);function respondWithRpcPromise(_0x53b999,_0x3dfa21,_0x79074){return new BPromise(function(_0x544e89,_0x20509b){return client[_0x25cd('0x10')](_0x53b999,_0x79074)[_0x25cd('0x11')](function(_0x2261e5){logger['info']('SmsInteraction,\x20%s,\x20%s',_0x3dfa21,'request\x20sent');logger[_0x25cd('0x12')](_0x25cd('0x13'),_0x3dfa21,_0x25cd('0x14'),JSON['stringify'](_0x2261e5));if(_0x2261e5[_0x25cd('0x15')]){if(_0x2261e5[_0x25cd('0x15')]['code']===0x1f4){logger[_0x25cd('0x15')]('SmsInteraction,\x20%s,\x20%s',_0x3dfa21,_0x2261e5[_0x25cd('0x15')][_0x25cd('0x16')]);return _0x20509b(_0x2261e5[_0x25cd('0x15')]['message']);}logger['error']('SmsInteraction,\x20%s,\x20%s',_0x3dfa21,_0x2261e5['error'][_0x25cd('0x16')]);return _0x544e89(_0x2261e5[_0x25cd('0x15')]['message']);}else{logger[_0x25cd('0x17')](_0x25cd('0x18'),_0x3dfa21,'request\x20sent');_0x544e89(_0x2261e5[_0x25cd('0x19')][_0x25cd('0x16')]);}})[_0x25cd('0x1a')](function(_0x426e92){logger['error'](_0x25cd('0x18'),_0x3dfa21,_0x426e92);_0x20509b(_0x426e92);});});}exports[_0x25cd('0x1b')]=function(_0x2d2916){var _0x2389df=this;return new Promise(function(_0x533fed,_0x7f0291){return db[_0x25cd('0x1c')]['update'](_0x2d2916[_0x25cd('0x1d')],{'raw':_0x2d2916['options']?_0x2d2916[_0x25cd('0x1e')][_0x25cd('0x1f')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x2d2916[_0x25cd('0x1e')]?_0x2d2916[_0x25cd('0x1e')][_0x25cd('0x20')]||null:null,'attributes':_0x2d2916['options']?_0x2d2916[_0x25cd('0x1e')][_0x25cd('0x21')]||null:null,'limit':_0x2d2916[_0x25cd('0x1e')]?_0x2d2916[_0x25cd('0x1e')]['limit']||null:null})[_0x25cd('0x11')](function(_0x1fcf2e){logger[_0x25cd('0x17')](_0x25cd('0x1b'),_0x2d2916);logger[_0x25cd('0x12')](_0x25cd('0x1b'),_0x2d2916,JSON[_0x25cd('0x22')](_0x1fcf2e));_0x533fed(_0x1fcf2e);})[_0x25cd('0x1a')](function(_0x193540){logger[_0x25cd('0x15')](_0x25cd('0x1b'),_0x193540[_0x25cd('0x16')],_0x2d2916);_0x7f0291(_0x2389df['error'](0x1f4,_0x193540[_0x25cd('0x16')]));});});};exports[_0x25cd('0x23')]=function(_0x354a50){return new Promise(function(_0x11dba3,_0x121a50){return db['SmsInteraction']['find']({'where':_0x354a50['options']?_0x354a50[_0x25cd('0x1e')][_0x25cd('0x20')]||null:null})[_0x25cd('0x11')](function(_0x3e0247){if(_0x3e0247){return _0x3e0247[_0x25cd('0x24')](_0x354a50[_0x25cd('0x1d')][_0x25cd('0x25')],_[_0x25cd('0x26')](_0x354a50[_0x25cd('0x1d')],[_0x25cd('0x25'),'id'])||{});}})[_0x25cd('0x27')](function(_0x12f041){logger[_0x25cd('0x17')](_0x25cd('0x28'),_0x354a50);logger[_0x25cd('0x12')](_0x25cd('0x28'),_0x354a50,JSON[_0x25cd('0x22')](_0x12f041));_0x11dba3(_0x12f041);})['catch'](function(_0x53929d){logger[_0x25cd('0x15')]('AddTags',_0x53929d[_0x25cd('0x16')],_0x354a50);_0x121a50(_this[_0x25cd('0x15')](0x1f4,_0x53929d[_0x25cd('0x16')]));});});}; \ No newline at end of file +var _0x2106=['AddTagsToSmsInteraction','find','addTags','omit','ids','spread','AddTags','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','redis','defaults','localhost','socket.io-emitter','register','request','then','info','SmsInteraction,\x20%s,\x20%s','request\x20sent','debug','SmsInteraction,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','UpdateSmsInteraction','SmsInteraction','options','raw','where','attributes'];(function(_0x221540,_0x5b9790){var _0x35ce0b=function(_0xedb3ca){while(--_0xedb3ca){_0x221540['push'](_0x221540['shift']());}};_0x35ce0b(++_0x5b9790);}(_0x2106,0x88));var _0x6210=function(_0x282ae8,_0x3347b8){_0x282ae8=_0x282ae8-0x0;var _0x10f6bd=_0x2106[_0x282ae8];return _0x10f6bd;};'use strict';var _=require(_0x6210('0x0'));var util=require(_0x6210('0x1'));var moment=require(_0x6210('0x2'));var BPromise=require(_0x6210('0x3'));var rs=require(_0x6210('0x4'));var fs=require('fs');var Redis=require(_0x6210('0x5'));var db=require(_0x6210('0x6'))['db'];var utils=require(_0x6210('0x7'));var logger=require(_0x6210('0x8'))('rpc');var config=require(_0x6210('0x9'));var jayson=require(_0x6210('0xa'));var client=jayson[_0x6210('0xb')]['http']({'port':0x232a});config[_0x6210('0xc')]=_[_0x6210('0xd')](config['redis'],{'host':_0x6210('0xe'),'port':0x18eb});var socket=require(_0x6210('0xf'))(new Redis(config['redis']));require('./smsInteraction.socket')[_0x6210('0x10')](socket);function respondWithRpcPromise(_0x12ff81,_0x5a92a6,_0x24d9f4){return new BPromise(function(_0x100e50,_0x92c1b5){return client[_0x6210('0x11')](_0x12ff81,_0x24d9f4)[_0x6210('0x12')](function(_0x5cd236){logger[_0x6210('0x13')](_0x6210('0x14'),_0x5a92a6,_0x6210('0x15'));logger[_0x6210('0x16')](_0x6210('0x17'),_0x5a92a6,'request\x20sent',JSON[_0x6210('0x18')](_0x5cd236));if(_0x5cd236[_0x6210('0x19')]){if(_0x5cd236[_0x6210('0x19')][_0x6210('0x1a')]===0x1f4){logger[_0x6210('0x19')]('SmsInteraction,\x20%s,\x20%s',_0x5a92a6,_0x5cd236[_0x6210('0x19')][_0x6210('0x1b')]);return _0x92c1b5(_0x5cd236['error'][_0x6210('0x1b')]);}logger[_0x6210('0x19')](_0x6210('0x14'),_0x5a92a6,_0x5cd236[_0x6210('0x19')][_0x6210('0x1b')]);return _0x100e50(_0x5cd236['error'][_0x6210('0x1b')]);}else{logger[_0x6210('0x13')](_0x6210('0x14'),_0x5a92a6,'request\x20sent');_0x100e50(_0x5cd236[_0x6210('0x1c')][_0x6210('0x1b')]);}})[_0x6210('0x1d')](function(_0x596f6f){logger[_0x6210('0x19')]('SmsInteraction,\x20%s,\x20%s',_0x5a92a6,_0x596f6f);_0x92c1b5(_0x596f6f);});});}exports[_0x6210('0x1e')]=function(_0x563258){var _0x2de548=this;return new Promise(function(_0xfc0814,_0x181579){return db[_0x6210('0x1f')]['update'](_0x563258['body'],{'raw':_0x563258[_0x6210('0x20')]?_0x563258[_0x6210('0x20')][_0x6210('0x21')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x563258[_0x6210('0x20')]?_0x563258['options'][_0x6210('0x22')]||null:null,'attributes':_0x563258[_0x6210('0x20')]?_0x563258['options'][_0x6210('0x23')]||null:null,'limit':_0x563258[_0x6210('0x20')]?_0x563258[_0x6210('0x20')]['limit']||null:null})[_0x6210('0x12')](function(_0x2d65dc){logger[_0x6210('0x13')](_0x6210('0x1e'),_0x563258);logger['debug'](_0x6210('0x1e'),_0x563258,JSON[_0x6210('0x18')](_0x2d65dc));_0xfc0814(_0x2d65dc);})[_0x6210('0x1d')](function(_0x1c735c){logger['error'](_0x6210('0x1e'),_0x1c735c[_0x6210('0x1b')],_0x563258);_0x181579(_0x2de548[_0x6210('0x19')](0x1f4,_0x1c735c[_0x6210('0x1b')]));});});};exports[_0x6210('0x24')]=function(_0x4cf60){return new Promise(function(_0x229fdf,_0xe9bc88){return db[_0x6210('0x1f')][_0x6210('0x25')]({'where':_0x4cf60[_0x6210('0x20')]?_0x4cf60['options'][_0x6210('0x22')]||null:null})[_0x6210('0x12')](function(_0x30b5d1){if(_0x30b5d1){return _0x30b5d1[_0x6210('0x26')](_0x4cf60['body']['ids'],_[_0x6210('0x27')](_0x4cf60['body'],[_0x6210('0x28'),'id'])||{});}})[_0x6210('0x29')](function(_0x3166ee){logger[_0x6210('0x13')]('AddTags',_0x4cf60);logger[_0x6210('0x16')](_0x6210('0x2a'),_0x4cf60,JSON['stringify'](_0x3166ee));_0x229fdf(_0x3166ee);})[_0x6210('0x1d')](function(_0x2704ba){logger['error'](_0x6210('0x2a'),_0x2704ba[_0x6210('0x1b')],_0x4cf60);_0xe9bc88(_this[_0x6210('0x19')](0x1f4,_0x2704ba[_0x6210('0x1b')]));});});}; \ No newline at end of file diff --git a/server/api/smsInteraction/smsInteraction.socket.js b/server/api/smsInteraction/smsInteraction.socket.js index 94abcdf..1151387 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 _0x3e49=['emit','register','length','save','remove','update'];(function(_0x14223b,_0x50dda7){var _0x443a4c=function(_0x204f34){while(--_0x204f34){_0x14223b['push'](_0x14223b['shift']());}};_0x443a4c(++_0x50dda7);}(_0x3e49,0x17d));var _0x93e4=function(_0x31779a,_0x23a359){_0x31779a=_0x31779a-0x0;var _0x24794e=_0x3e49[_0x31779a];return _0x24794e;};'use strict';var SmsInteractionEvents=require('./smsInteraction.events');var events=[_0x93e4('0x0'),_0x93e4('0x1'),_0x93e4('0x2')];function createListener(_0x1cff9d,_0x1d32fb){return function(_0x46e1ff){_0x1d32fb[_0x93e4('0x3')](_0x1cff9d,_0x46e1ff);};}function removeListener(_0x248ee4,_0x4111b1){return function(){SmsInteractionEvents['removeListener'](_0x248ee4,_0x4111b1);};}exports[_0x93e4('0x4')]=function(_0x1bfd8b){for(var _0x34dd82=0x0,_0x14c4d1=events[_0x93e4('0x5')];_0x34dd82<_0x14c4d1;_0x34dd82++){var _0x4c133f=events[_0x34dd82];var _0x3ae586=createListener('smsInteraction:'+_0x4c133f,_0x1bfd8b);SmsInteractionEvents['on'](_0x4c133f,_0x3ae586);}}; \ No newline at end of file +var _0x5880=['update','emit','removeListener','register','smsInteraction:','save','remove'];(function(_0x33dc6e,_0x2d7adf){var _0x30f31a=function(_0x3715c3){while(--_0x3715c3){_0x33dc6e['push'](_0x33dc6e['shift']());}};_0x30f31a(++_0x2d7adf);}(_0x5880,0x108));var _0x0588=function(_0x35336d,_0x139c6d){_0x35336d=_0x35336d-0x0;var _0x504b01=_0x5880[_0x35336d];return _0x504b01;};'use strict';var SmsInteractionEvents=require('./smsInteraction.events');var events=[_0x0588('0x0'),_0x0588('0x1'),_0x0588('0x2')];function createListener(_0x38cdbb,_0x4656a9){return function(_0x3cd199){_0x4656a9[_0x0588('0x3')](_0x38cdbb,_0x3cd199);};}function removeListener(_0x591357,_0x25a5e1){return function(){SmsInteractionEvents[_0x0588('0x4')](_0x591357,_0x25a5e1);};}exports[_0x0588('0x5')]=function(_0x214b95){for(var _0x5d4e29=0x0,_0x238a38=events['length'];_0x5d4e29<_0x238a38;_0x5d4e29++){var _0x1cd345=events[_0x5d4e29];var _0x4f65c0=createListener(_0x0588('0x6')+_0x1cd345,_0x214b95);SmsInteractionEvents['on'](_0x1cd345,_0x4f65c0);}}; \ No newline at end of file diff --git a/server/api/smsMessage/index.js b/server/api/smsMessage/index.js index c0ee62c..75cd007 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 _0x7229=['tracked','create','/:id/status','status','update','put','accept','/:id/reject','delete','exports','multer','util','path','connect-timeout','express','../../components/auth/service','../../components/interaction/service','../../config/environment','./smsMessage.controller','get','isAuthenticated','index','/describe','describe','/:id','show','post'];(function(_0x278e3c,_0x1c9cfd){var _0x3e2d9b=function(_0x34d928){while(--_0x34d928){_0x278e3c['push'](_0x278e3c['shift']());}};_0x3e2d9b(++_0x1c9cfd);}(_0x7229,0x76));var _0x9722=function(_0x4bb66f,_0x3cd682){_0x4bb66f=_0x4bb66f-0x0;var _0xf2772f=_0x7229[_0x4bb66f];return _0xf2772f;};'use strict';var multer=require(_0x9722('0x0'));var util=require(_0x9722('0x1'));var path=require(_0x9722('0x2'));var timeout=require(_0x9722('0x3'));var express=require(_0x9722('0x4'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0x9722('0x5'));var interaction=require(_0x9722('0x6'));var config=require(_0x9722('0x7'));var controller=require(_0x9722('0x8'));router[_0x9722('0x9')]('/',auth[_0x9722('0xa')](),controller[_0x9722('0xb')]);router['get'](_0x9722('0xc'),auth['isAuthenticated'](),controller[_0x9722('0xd')]);router[_0x9722('0x9')](_0x9722('0xe'),auth[_0x9722('0xa')](),controller[_0x9722('0xf')]);router[_0x9722('0x10')]('/',auth[_0x9722('0xa')](),interaction[_0x9722('0x11')]('sms','smsmessage:create'),controller[_0x9722('0x12')]);router[_0x9722('0x10')](_0x9722('0x13'),controller[_0x9722('0x14')]);router['put'](_0x9722('0xe'),auth[_0x9722('0xa')](),controller[_0x9722('0x15')]);router[_0x9722('0x16')]('/:id/accept',auth[_0x9722('0xa')](),controller[_0x9722('0x17')]);router[_0x9722('0x16')](_0x9722('0x18'),auth[_0x9722('0xa')](),controller['reject']);router[_0x9722('0x19')](_0x9722('0xe'),auth[_0x9722('0xa')](),controller['destroy']);module[_0x9722('0x1a')]=router; \ No newline at end of file +var _0x8d04=['show','post','tracked','sms','create','/:id/status','status','put','/:id/accept','accept','/:id/reject','exports','multer','util','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','get','isAuthenticated','index','/describe','describe','/:id'];(function(_0x23b655,_0x4feb2b){var _0x364b32=function(_0x4e41ac){while(--_0x4e41ac){_0x23b655['push'](_0x23b655['shift']());}};_0x364b32(++_0x4feb2b);}(_0x8d04,0xc2));var _0x48d0=function(_0x5d3f05,_0x39e0ba){_0x5d3f05=_0x5d3f05-0x0;var _0x1b35fc=_0x8d04[_0x5d3f05];return _0x1b35fc;};'use strict';var multer=require(_0x48d0('0x0'));var util=require(_0x48d0('0x1'));var path=require('path');var timeout=require(_0x48d0('0x2'));var express=require(_0x48d0('0x3'));var router=express[_0x48d0('0x4')]();var fs_extra=require(_0x48d0('0x5'));var auth=require(_0x48d0('0x6'));var interaction=require(_0x48d0('0x7'));var config=require('../../config/environment');var controller=require('./smsMessage.controller');router[_0x48d0('0x8')]('/',auth[_0x48d0('0x9')](),controller[_0x48d0('0xa')]);router[_0x48d0('0x8')](_0x48d0('0xb'),auth[_0x48d0('0x9')](),controller[_0x48d0('0xc')]);router[_0x48d0('0x8')](_0x48d0('0xd'),auth[_0x48d0('0x9')](),controller[_0x48d0('0xe')]);router[_0x48d0('0xf')]('/',auth[_0x48d0('0x9')](),interaction[_0x48d0('0x10')](_0x48d0('0x11'),'smsmessage:create'),controller[_0x48d0('0x12')]);router[_0x48d0('0xf')](_0x48d0('0x13'),controller[_0x48d0('0x14')]);router[_0x48d0('0x15')](_0x48d0('0xd'),auth[_0x48d0('0x9')](),controller['update']);router[_0x48d0('0x15')](_0x48d0('0x16'),auth['isAuthenticated'](),controller[_0x48d0('0x17')]);router['put'](_0x48d0('0x18'),auth[_0x48d0('0x9')](),controller['reject']);router['delete']('/:id',auth['isAuthenticated'](),controller['destroy']);module[_0x48d0('0x19')]=router; \ No newline at end of file diff --git a/server/api/smsMessage/smsMessage.attributes.js b/server/api/smsMessage/smsMessage.attributes.js index f265884..728adb2 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 _0x9ac9=['DATE','sequelize','TEXT','medium','BOOLEAN','ENUM','out','STRING'];(function(_0x16486e,_0x5b56dc){var _0x4da6b6=function(_0x100ee6){while(--_0x100ee6){_0x16486e['push'](_0x16486e['shift']());}};_0x4da6b6(++_0x5b56dc);}(_0x9ac9,0x1b9));var _0x99ac=function(_0x275e4e,_0x278c1f){_0x275e4e=_0x275e4e-0x0;var _0xb475a9=_0x9ac9[_0x275e4e];return _0xb475a9;};'use strict';var Sequelize=require(_0x99ac('0x0'));module['exports']={'body':{'type':Sequelize[_0x99ac('0x1')](_0x99ac('0x2')),'allowNull':![]},'read':{'type':Sequelize[_0x99ac('0x3')],'defaultValue':![]},'direction':{'type':Sequelize[_0x99ac('0x4')]('in','out'),'defaultValue':_0x99ac('0x5'),'allowNull':![]},'messageId':{'type':Sequelize['STRING'](0xbe)},'phone':{'type':Sequelize[_0x99ac('0x6')]},'readAt':{'type':Sequelize[_0x99ac('0x7')]},'secret':{'type':Sequelize[_0x99ac('0x3')],'defaultValue':![]},'providerName':{'type':Sequelize[_0x99ac('0x6')]},'providerResponse':{'type':Sequelize[_0x99ac('0x1')]}}; \ No newline at end of file +var _0x6010=['STRING','DATE','sequelize','TEXT','medium','BOOLEAN','ENUM','out'];(function(_0x1d2c0c,_0x40dc5a){var _0x423cef=function(_0x3bc1c3){while(--_0x3bc1c3){_0x1d2c0c['push'](_0x1d2c0c['shift']());}};_0x423cef(++_0x40dc5a);}(_0x6010,0xca));var _0x0601=function(_0x47d62d,_0x4cb736){_0x47d62d=_0x47d62d-0x0;var _0x55a2d9=_0x6010[_0x47d62d];return _0x55a2d9;};'use strict';var Sequelize=require(_0x0601('0x0'));module['exports']={'body':{'type':Sequelize[_0x0601('0x1')](_0x0601('0x2')),'allowNull':![]},'read':{'type':Sequelize[_0x0601('0x3')],'defaultValue':![]},'direction':{'type':Sequelize[_0x0601('0x4')]('in',_0x0601('0x5')),'defaultValue':_0x0601('0x5'),'allowNull':![]},'messageId':{'type':Sequelize[_0x0601('0x6')](0xbe)},'phone':{'type':Sequelize[_0x0601('0x6')]},'readAt':{'type':Sequelize[_0x0601('0x7')]},'secret':{'type':Sequelize[_0x0601('0x3')],'defaultValue':![]},'providerName':{'type':Sequelize[_0x0601('0x6')]},'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 9ddf679..59788f3 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 _0x34bd=['debug','received\x20delivery\x20report\x20from','inspect','twilio','MessageSid','messageId','SmsAccount,\x20%s,\x20%s,\x20%s','plivo','MessageUUID','sent','delivered','Status','infobip','results','groupName','DELIVERED','eml-format','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','to-csv','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','socket.io-emitter','register','jayson/promise','client','http','request','then','info','SmsMessage,\x20%s,\x20%s','SmsMessage,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','sendStatus','status','json','undefined','count','offset','limit','set','Content-Range','apply','reject','save','update','destroy','stack','send','map','SmsMessage','rawAttributes','type','key','model','query','keys','intersection','attributes','fields','hasOwnProperty','order','sort','where','filters','pick','merge','name','options','includeAll','include','findAll','rows','catch','show','params','length','find','create','body','describe','../../config/logger','sms-interactions','accept','sms','read','readAt','format','YYYY-MM-DD\x20HH:mm:ss','UserId','agent','get','SmsInteraction','isNil','read1stAt','interaction','[SMSMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','user','role','AcceptMessage','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','sequelize','Sequelize','SELECT','User','fullname','manual','SIP/%s','channel','motionChannel','event','EventManager','acceptmessage','SmsInteractionId','[SMSMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','null','RejectMessage','rejectMessage','ContactId','contact','email','interface','rejectmessage','SmsAccount','SmsAccountId'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0x34bd,0x1d2));var _0xd34b=function(_0x4fab09,_0x2e343b){_0x4fab09=_0x4fab09-0x0;var _0xf457df=_0x34bd[_0x4fab09];return _0xf457df;};'use strict';var emlformat=require(_0xd34b('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0xd34b('0x1'));var rp=require(_0xd34b('0x2'));var moment=require(_0xd34b('0x3'));var BPromise=require(_0xd34b('0x4'));var Mustache=require(_0xd34b('0x5'));var util=require(_0xd34b('0x6'));var path=require(_0xd34b('0x7'));var sox=require('sox');var csv=require(_0xd34b('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0xd34b('0x9'));var crypto=require(_0xd34b('0xa'));var jsforce=require(_0xd34b('0xb'));var deskjs=require(_0xd34b('0xc'));var toCsv=require(_0xd34b('0x8'));var querystring=require(_0xd34b('0xd'));var Papa=require(_0xd34b('0xe'));var Redis=require(_0xd34b('0xf'));var authService=require(_0xd34b('0x10'));var qs=require(_0xd34b('0x11'));var as=require(_0xd34b('0x12'));var hardwareService=require(_0xd34b('0x13'));var logger=require('../../config/logger')(_0xd34b('0x14'));var utils=require('../../config/utils');var config=require(_0xd34b('0x15'));var licenseUtil=require(_0xd34b('0x16'));var db=require(_0xd34b('0x17'))['db'];config[_0xd34b('0x18')]=_[_0xd34b('0x19')](config[_0xd34b('0x18')],{'host':'localhost','port':0x18eb});var socket=require(_0xd34b('0x1a'))(new Redis(config[_0xd34b('0x18')]));require('./smsMessage.socket')[_0xd34b('0x1b')](socket);var jayson=require(_0xd34b('0x1c'));var client=jayson[_0xd34b('0x1d')]['http']({'port':0x232c});var client9002=jayson[_0xd34b('0x1d')][_0xd34b('0x1e')]({'port':0x232a});function respondWithRpcPromise(_0x5a46be,_0x3c74e2,_0x4ce87b,_0xe11907){return new BPromise(function(_0x438b61,_0x2ace5a){var _0x56ea27=_0xe11907||client;return _0x56ea27[_0xd34b('0x1f')](_0x5a46be,_0x4ce87b)[_0xd34b('0x20')](function(_0x1bbbb1){logger[_0xd34b('0x21')](_0xd34b('0x22'),_0x3c74e2,'request\x20sent');logger['debug'](_0xd34b('0x23'),_0x3c74e2,_0xd34b('0x24'),JSON[_0xd34b('0x25')](_0x1bbbb1));if(_0x1bbbb1[_0xd34b('0x26')]){if(_0x1bbbb1[_0xd34b('0x26')][_0xd34b('0x27')]===0x1f4){logger['error'](_0xd34b('0x22'),_0x3c74e2,_0x1bbbb1[_0xd34b('0x26')][_0xd34b('0x28')]);return _0x2ace5a(_0x1bbbb1[_0xd34b('0x26')]['message']);}logger[_0xd34b('0x26')](_0xd34b('0x22'),_0x3c74e2,_0x1bbbb1[_0xd34b('0x26')][_0xd34b('0x28')]);return _0x438b61(_0x1bbbb1[_0xd34b('0x26')][_0xd34b('0x28')]);}else{logger['info'](_0xd34b('0x22'),_0x3c74e2,'request\x20sent');_0x438b61(_0x1bbbb1[_0xd34b('0x29')][_0xd34b('0x28')]);}})['catch'](function(_0x5f3325){logger['error'](_0xd34b('0x22'),_0x3c74e2,_0x5f3325);_0x2ace5a(_0x5f3325);});});}function respondWithStatusCode(_0x187b33,_0x14b8b9){_0x14b8b9=_0x14b8b9||0xcc;return function(_0x594413){if(_0x594413){return _0x187b33[_0xd34b('0x2a')](_0x14b8b9);}return _0x187b33[_0xd34b('0x2b')](_0x14b8b9)['end']();};}function respondWithResult(_0x21a653,_0x38637f){_0x38637f=_0x38637f||0xc8;return function(_0x342885){if(_0x342885){return _0x21a653['status'](_0x38637f)[_0xd34b('0x2c')](_0x342885);}};}function respondWithFilteredResult(_0x4f047d,_0x182266){return function(_0x27c392){if(_0x27c392){var _0x28e20c=typeof _0x182266['offset']===_0xd34b('0x2d')&&typeof _0x182266['limit']===_0xd34b('0x2d');var _0x47c0b3=_0x27c392[_0xd34b('0x2e')];var _0x567b74=_0x28e20c?0x0:_0x182266[_0xd34b('0x2f')];var _0x3f3ff0=_0x28e20c?_0x27c392['count']:_0x182266[_0xd34b('0x2f')]+_0x182266[_0xd34b('0x30')];var _0xc3beb1;if(_0x3f3ff0>=_0x47c0b3){_0x3f3ff0=_0x47c0b3;_0xc3beb1=0xc8;}else{_0xc3beb1=0xce;}_0x4f047d['status'](_0xc3beb1);return _0x4f047d[_0xd34b('0x31')](_0xd34b('0x32'),_0x567b74+'-'+_0x3f3ff0+'/'+_0x47c0b3)[_0xd34b('0x2c')](_0x27c392);}return null;};}function patchUpdates(_0x4db5d7){return function(_0x39f442){try{jsonpatch[_0xd34b('0x33')](_0x39f442,_0x4db5d7,!![]);}catch(_0x247b2d){return BPromise[_0xd34b('0x34')](_0x247b2d);}return _0x39f442[_0xd34b('0x35')]();};}function saveUpdates(_0x42b4e6,_0x392a60){return function(_0x53b5c7){if(_0x53b5c7){return _0x53b5c7[_0xd34b('0x36')](_0x42b4e6)[_0xd34b('0x20')](function(_0x389444){return _0x389444;});}return null;};}function removeEntity(_0x466129,_0x1ae71e){return function(_0x51e40c){if(_0x51e40c){return _0x51e40c[_0xd34b('0x37')]()[_0xd34b('0x20')](function(){_0x466129[_0xd34b('0x2b')](0xcc)['end']();});}};}function handleEntityNotFound(_0x5789b4,_0xcaf02){return function(_0x278322){if(!_0x278322){_0x5789b4[_0xd34b('0x2a')](0x194);}return _0x278322;};}function handleError(_0x4caae8,_0x33eadf){_0x33eadf=_0x33eadf||0x1f4;return function(_0x91e8ba){logger[_0xd34b('0x26')](_0x91e8ba[_0xd34b('0x38')]);if(_0x91e8ba['name']){delete _0x91e8ba['name'];}_0x4caae8[_0xd34b('0x2b')](_0x33eadf)[_0xd34b('0x39')](_0x91e8ba);};}exports['index']=function(_0x4a4da0,_0x4e72cf){var _0x64acdf={},_0x474855={},_0x5245e7={'count':0x0,'rows':[]};var _0x1538c3=_[_0xd34b('0x3a')](db[_0xd34b('0x3b')][_0xd34b('0x3c')],function(_0x11f707){return{'name':_0x11f707['fieldName'],'type':_0x11f707[_0xd34b('0x3d')][_0xd34b('0x3e')]};});_0x474855[_0xd34b('0x3f')]=_[_0xd34b('0x3a')](_0x1538c3,'name');_0x474855[_0xd34b('0x40')]=_[_0xd34b('0x41')](_0x4a4da0['query']);_0x474855['filters']=_[_0xd34b('0x42')](_0x474855[_0xd34b('0x3f')],_0x474855[_0xd34b('0x40')]);_0x64acdf[_0xd34b('0x43')]=_['intersection'](_0x474855[_0xd34b('0x3f')],qs[_0xd34b('0x44')](_0x4a4da0['query']['fields']));_0x64acdf['attributes']=_0x64acdf[_0xd34b('0x43')]['length']?_0x64acdf['attributes']:_0x474855[_0xd34b('0x3f')];if(!_0x4a4da0['query'][_0xd34b('0x45')]('nolimit')){_0x64acdf[_0xd34b('0x30')]=qs[_0xd34b('0x30')](_0x4a4da0[_0xd34b('0x40')][_0xd34b('0x30')]);_0x64acdf[_0xd34b('0x2f')]=qs['offset'](_0x4a4da0[_0xd34b('0x40')][_0xd34b('0x2f')]);}_0x64acdf[_0xd34b('0x46')]=qs[_0xd34b('0x47')](_0x4a4da0[_0xd34b('0x40')][_0xd34b('0x47')]);_0x64acdf[_0xd34b('0x48')]=qs[_0xd34b('0x49')](_[_0xd34b('0x4a')](_0x4a4da0[_0xd34b('0x40')],_0x474855[_0xd34b('0x49')]),_0x1538c3);if(_0x4a4da0[_0xd34b('0x40')]['filter']){_0x64acdf['where']=_[_0xd34b('0x4b')](_0x64acdf[_0xd34b('0x48')],{'$or':_['map'](_0x1538c3,function(_0x3dc3f8){if(_0x3dc3f8[_0xd34b('0x3d')]!=='VIRTUAL'){var _0x36847={};_0x36847[_0x3dc3f8[_0xd34b('0x4c')]]={'$like':'%'+_0x4a4da0['query']['filter']+'%'};return _0x36847;}})});}_0x64acdf=_[_0xd34b('0x4b')]({},_0x64acdf,_0x4a4da0[_0xd34b('0x4d')]);var _0x297d30={'where':_0x64acdf['where']};return db[_0xd34b('0x3b')]['count'](_0x297d30)[_0xd34b('0x20')](function(_0x560834){_0x5245e7[_0xd34b('0x2e')]=_0x560834;if(_0x4a4da0['query'][_0xd34b('0x4e')]){_0x64acdf[_0xd34b('0x4f')]=[{'all':!![]}];}return db[_0xd34b('0x3b')][_0xd34b('0x50')](_0x64acdf);})[_0xd34b('0x20')](function(_0x1a64e2){_0x5245e7[_0xd34b('0x51')]=_0x1a64e2;return _0x5245e7;})[_0xd34b('0x20')](respondWithFilteredResult(_0x4e72cf,_0x64acdf))[_0xd34b('0x52')](handleError(_0x4e72cf,null));};exports[_0xd34b('0x53')]=function(_0x9b5b9d,_0x3a7d82){var _0x13c5f6={'raw':!![],'where':{'id':_0x9b5b9d[_0xd34b('0x54')]['id']}},_0x5f3f40={};_0x5f3f40[_0xd34b('0x3f')]=_['keys'](db[_0xd34b('0x3b')][_0xd34b('0x3c')]);_0x5f3f40[_0xd34b('0x40')]=_[_0xd34b('0x41')](_0x9b5b9d[_0xd34b('0x40')]);_0x5f3f40[_0xd34b('0x49')]=_[_0xd34b('0x42')](_0x5f3f40[_0xd34b('0x3f')],_0x5f3f40['query']);_0x13c5f6[_0xd34b('0x43')]=_[_0xd34b('0x42')](_0x5f3f40[_0xd34b('0x3f')],qs[_0xd34b('0x44')](_0x9b5b9d['query'][_0xd34b('0x44')]));_0x13c5f6[_0xd34b('0x43')]=_0x13c5f6[_0xd34b('0x43')][_0xd34b('0x55')]?_0x13c5f6[_0xd34b('0x43')]:_0x5f3f40[_0xd34b('0x3f')];if(_0x9b5b9d[_0xd34b('0x40')][_0xd34b('0x4e')]){_0x13c5f6[_0xd34b('0x4f')]=[{'all':!![]}];}_0x13c5f6=_[_0xd34b('0x4b')]({},_0x13c5f6,_0x9b5b9d[_0xd34b('0x4d')]);return db[_0xd34b('0x3b')][_0xd34b('0x56')](_0x13c5f6)[_0xd34b('0x20')](handleEntityNotFound(_0x3a7d82,null))[_0xd34b('0x20')](respondWithResult(_0x3a7d82,null))['catch'](handleError(_0x3a7d82,null));};exports[_0xd34b('0x57')]=function(_0x18eaf4,_0x158003){return db['SmsMessage'][_0xd34b('0x57')](_0x18eaf4[_0xd34b('0x58')],{})[_0xd34b('0x20')](respondWithResult(_0x158003,0xc9))[_0xd34b('0x52')](handleError(_0x158003,null));};exports[_0xd34b('0x36')]=function(_0x153ed7,_0x6e42e1){if(_0x153ed7['body']['id']){delete _0x153ed7[_0xd34b('0x58')]['id'];}return db[_0xd34b('0x3b')][_0xd34b('0x56')]({'where':{'id':_0x153ed7['params']['id']}})[_0xd34b('0x20')](handleEntityNotFound(_0x6e42e1,null))[_0xd34b('0x20')](saveUpdates(_0x153ed7[_0xd34b('0x58')],null))[_0xd34b('0x20')](respondWithResult(_0x6e42e1,null))[_0xd34b('0x52')](handleError(_0x6e42e1,null));};exports[_0xd34b('0x37')]=function(_0xb6a848,_0x29d018){return db['SmsMessage'][_0xd34b('0x56')]({'where':{'id':_0xb6a848[_0xd34b('0x54')]['id']}})['then'](handleEntityNotFound(_0x29d018,null))[_0xd34b('0x20')](removeEntity(_0x29d018,null))[_0xd34b('0x52')](handleError(_0x29d018,null));};exports['describe']=function(_0x5b8151,_0x3097be){return db[_0xd34b('0x3b')][_0xd34b('0x59')]()[_0xd34b('0x20')](respondWithResult(_0x3097be,null))['catch'](handleError(_0x3097be,null));};var interaction_log=require(_0xd34b('0x5a'))(_0xd34b('0x5b'));exports[_0xd34b('0x5c')]=function(_0x1ed288,_0x5f0ce4,_0x55baf2){var _0x1a33e1={'agent':{},'channel':_0xd34b('0x5d')};if(_0x1ed288[_0xd34b('0x58')]['id']){delete _0x1ed288['body']['id'];}_0x1ed288[_0xd34b('0x58')][_0xd34b('0x5e')]=!![];_0x1ed288[_0xd34b('0x58')][_0xd34b('0x5f')]=moment()[_0xd34b('0x60')](_0xd34b('0x61'));_0x1ed288[_0xd34b('0x58')]['UserId']=_0x1ed288['body'][_0xd34b('0x62')]||_0x1ed288['user']['id'];_0x1a33e1[_0xd34b('0x63')]['id']=_0x1ed288[_0xd34b('0x58')][_0xd34b('0x62')];return db['SmsMessage']['find']({'where':{'id':_0x1ed288[_0xd34b('0x54')]['id'],'UserId':null}})[_0xd34b('0x20')](handleEntityNotFound(_0x5f0ce4,null))[_0xd34b('0x20')](saveUpdates(_0x1ed288[_0xd34b('0x58')],null))['then'](function(_0x59d4a4){if(_0x59d4a4){_0x1a33e1[_0xd34b('0x28')]=_0x59d4a4[_0xd34b('0x64')]({'plain':!![]});return db[_0xd34b('0x65')]['find']({'where':{'id':_0x59d4a4['SmsInteractionId']}});}return null;})[_0xd34b('0x20')](handleEntityNotFound(_0x5f0ce4,null))[_0xd34b('0x20')](function(_0x18068b){if(_0x18068b){return _0x18068b[_0xd34b('0x36')]({'UserId':_0x1ed288[_0xd34b('0x58')][_0xd34b('0x62')],'read1stAt':_[_0xd34b('0x66')](_0x18068b[_0xd34b('0x67')])?moment()[_0xd34b('0x60')](_0xd34b('0x61')):undefined});}return null;})['then'](function(_0x235a18){if(_0x235a18){_0x1a33e1[_0xd34b('0x68')]=_0x235a18[_0xd34b('0x64')]({'plain':!![]});interaction_log[_0xd34b('0x21')](_0xd34b('0x69'),_0x1ed288[_0xd34b('0x6a')]['id'],_0x1ed288[_0xd34b('0x6a')][_0xd34b('0x4c')],_0x1ed288[_0xd34b('0x6a')][_0xd34b('0x6b')],_0x1a33e1[_0xd34b('0x68')]['id'],_0x1ed288[_0xd34b('0x58')]?JSON['stringify'](_0x1ed288['body']):'null');return respondWithRpcPromise(_0xd34b('0x6c'),'acceptMessage',_0x1a33e1);}return null;})[_0xd34b('0x20')](function(_0x3ca97a){var _0x56c94e=_0xd34b('0x6d')+_0x3ca97a[_0xd34b('0x28')]['ContactId'];return db[_0xd34b('0x6e')]['query'](_0x56c94e,{'type':db[_0xd34b('0x6f')]['QueryTypes'][_0xd34b('0x70')],'raw':!![]})[_0xd34b('0x20')](function(_0x9be403){return _0x9be403;});})[_0xd34b('0x20')](function(_0x155668){if(_0x155668){_0x1a33e1[_0xd34b('0x28')]['contact']=_0x155668[0x0];if(!_0x1ed288['body']['UserId'])return;return db[_0xd34b('0x71')][_0xd34b('0x56')]({'where':{'id':_0x1ed288[_0xd34b('0x58')][_0xd34b('0x62')],'role':'agent'},'attributes':['id',_0xd34b('0x4c'),_0xd34b('0x72'),'email','internal'],'raw':!![]});}return null;})[_0xd34b('0x20')](function(_0x45eace){if(!_0x45eace)return null;_0x1a33e1[_0xd34b('0x28')][_0xd34b('0x63')]=_0x45eace;return _0x1a33e1;})[_0xd34b('0x20')](function(_0x322600){if(_0x322600){if(_0x1ed288['body'][_0xd34b('0x73')]){_0x1a33e1['message']['interface']=util[_0xd34b('0x60')](_0xd34b('0x74'),_0x1ed288[_0xd34b('0x6a')][_0xd34b('0x4c')]);_0x1a33e1[_0xd34b('0x28')][_0xd34b('0x75')]=_0x1a33e1[_0xd34b('0x75')];_0x1a33e1[_0xd34b('0x28')][_0xd34b('0x76')]=_0x1a33e1[_0xd34b('0x75')];_0x1a33e1[_0xd34b('0x28')][_0xd34b('0x77')]=_0xd34b('0x5c');return respondWithRpcPromise(_0xd34b('0x78'),'EventManager',{'event':_0xd34b('0x79'),'message':_0x1a33e1[_0xd34b('0x28')]},client9002)[_0xd34b('0x20')](function(){return _0x1a33e1;});}return _0x1a33e1;}return null;})[_0xd34b('0x20')](respondWithResult(_0x5f0ce4,null))['catch'](handleError(_0x5f0ce4,null));};var interaction_log=require(_0xd34b('0x5a'))(_0xd34b('0x5b'));exports[_0xd34b('0x34')]=function(_0x59910f,_0x92d639,_0x4825a7){var _0x50b6a0={'agent':{},'channel':'sms'};if(_0x59910f['body']['id']){delete _0x59910f[_0xd34b('0x58')]['id'];}_0x59910f['body'][_0xd34b('0x62')]=_0x59910f[_0xd34b('0x58')][_0xd34b('0x62')]||_0x59910f['user']['id'];_0x50b6a0[_0xd34b('0x63')]['id']=_0x59910f[_0xd34b('0x58')][_0xd34b('0x62')];return db[_0xd34b('0x3b')][_0xd34b('0x56')]({'where':{'id':_0x59910f['params']['id'],'UserId':null}})[_0xd34b('0x20')](handleEntityNotFound(_0x92d639,null))[_0xd34b('0x20')](function(_0x3a3f22){if(_0x3a3f22){_0x50b6a0[_0xd34b('0x28')]=_0x3a3f22['get']({'plain':!![]});return db[_0xd34b('0x65')][_0xd34b('0x56')]({'where':{'id':_0x3a3f22[_0xd34b('0x7a')]}});}return null;})[_0xd34b('0x20')](handleEntityNotFound(_0x92d639,null))['then'](function(_0x45d0ab){if(_0x45d0ab){_0x50b6a0[_0xd34b('0x68')]=_0x45d0ab[_0xd34b('0x64')]({'plain':!![]});interaction_log[_0xd34b('0x21')](_0xd34b('0x7b'),_0x59910f[_0xd34b('0x6a')]['id'],_0x59910f[_0xd34b('0x6a')][_0xd34b('0x4c')],_0x59910f['user'][_0xd34b('0x6b')],_0x50b6a0[_0xd34b('0x68')]['id'],_0x59910f[_0xd34b('0x58')]?JSON['stringify'](_0x59910f[_0xd34b('0x58')]):_0xd34b('0x7c'));return respondWithRpcPromise(_0xd34b('0x7d'),_0xd34b('0x7e'),_0x50b6a0);}return null;})[_0xd34b('0x20')](function(_0x3dd21d){var _0x191878=_0xd34b('0x6d')+_0x3dd21d[_0xd34b('0x28')][_0xd34b('0x7f')];return db[_0xd34b('0x6e')][_0xd34b('0x40')](_0x191878,{'type':db[_0xd34b('0x6f')]['QueryTypes']['SELECT'],'raw':!![]})['then'](function(_0x56502e){return _0x56502e;});})[_0xd34b('0x20')](function(_0xaf6ebc){if(_0xaf6ebc){_0x50b6a0['message'][_0xd34b('0x80')]=_0xaf6ebc[0x0];if(!_0x59910f[_0xd34b('0x58')][_0xd34b('0x62')])return;return db[_0xd34b('0x71')]['find']({'where':{'id':_0x59910f[_0xd34b('0x58')][_0xd34b('0x62')],'role':_0xd34b('0x63')},'attributes':['id',_0xd34b('0x4c'),_0xd34b('0x72'),_0xd34b('0x81'),'internal'],'raw':!![]});}return null;})[_0xd34b('0x20')](function(_0x71f4d9){if(!_0x71f4d9)return null;_0x50b6a0[_0xd34b('0x28')][_0xd34b('0x63')]=_0x71f4d9;return _0x50b6a0;})[_0xd34b('0x20')](function(_0x2d76a7){if(_0x2d76a7){_0x2d76a7['message'][_0xd34b('0x82')]=util[_0xd34b('0x60')](_0xd34b('0x74'),_0x59910f[_0xd34b('0x6a')][_0xd34b('0x4c')]);_0x2d76a7[_0xd34b('0x28')]['channel']=_0x50b6a0[_0xd34b('0x75')];_0x2d76a7[_0xd34b('0x28')][_0xd34b('0x76')]=_0x50b6a0[_0xd34b('0x75')];_0x2d76a7[_0xd34b('0x28')][_0xd34b('0x77')]=_0xd34b('0x34');respondWithRpcPromise(_0xd34b('0x78'),_0xd34b('0x78'),{'event':_0xd34b('0x83'),'message':_0x2d76a7[_0xd34b('0x28')]},client9002);return _0x50b6a0;}return null;})[_0xd34b('0x20')](respondWithResult(_0x92d639,null))['catch'](handleError(_0x92d639,null));};exports[_0xd34b('0x2b')]=function(_0x350cc6,_0x414e00,_0x1cc0d2){if(_0x350cc6[_0xd34b('0x58')]['id']){delete _0x350cc6[_0xd34b('0x58')]['id'];}var _0xcad989;return db[_0xd34b('0x3b')][_0xd34b('0x56')]({'where':{'id':_0x350cc6[_0xd34b('0x54')]['id']}})[_0xd34b('0x20')](handleEntityNotFound(_0x414e00,null))[_0xd34b('0x20')](function(_0x164816){if(_0x164816){_0xcad989=_0x164816;return db[_0xd34b('0x84')][_0xd34b('0x56')]({'where':{'id':_0x164816[_0xd34b('0x85')]}});}})[_0xd34b('0x20')](handleEntityNotFound(_0x414e00,null))[_0xd34b('0x20')](function(_0x1bc678){if(_0x1bc678){logger[_0xd34b('0x86')](_0xd34b('0x23'),_0xd34b('0x2b'),_0xd34b('0x87'),_0x1bc678['type'],util[_0xd34b('0x88')](_0x350cc6[_0xd34b('0x58')],{'showHidden':![],'depth':null}));switch(_0x1bc678[_0xd34b('0x3d')]){case _0xd34b('0x89'):if(_0x350cc6[_0xd34b('0x58')]['MessageSid']&&_0x350cc6[_0xd34b('0x58')][_0xd34b('0x8a')]===_0xcad989[_0xd34b('0x8b')]){return _0xcad989[_0xd34b('0x36')]({'read':!![]});}else{logger['error'](_0xd34b('0x8c'),'status',_0xd34b('0x89'),util['inspect'](_0x350cc6[_0xd34b('0x58')],{'showHidden':![],'depth':null}));}break;case _0xd34b('0x8d'):if(_0x350cc6[_0xd34b('0x58')][_0xd34b('0x8e')]&&_0x350cc6['body']['MessageUUID']===_0xcad989[_0xd34b('0x8b')]&&_['indexOf']([_0xd34b('0x8f'),_0xd34b('0x90')],_0x350cc6[_0xd34b('0x58')][_0xd34b('0x91')])>=0x0){return _0xcad989['update']({'read':!![]});}else{logger['error'](_0xd34b('0x8c'),_0xd34b('0x2b'),'plivio',util[_0xd34b('0x88')](_0x350cc6['body'],{'showHidden':![],'depth':null}));}break;case _0xd34b('0x92'):var _0x3cadd7=_0x350cc6['body'][_0xd34b('0x93')][0x0];if(_0x3cadd7[_0xd34b('0x2b')][_0xd34b('0x94')]===_0xd34b('0x95')){return _0xcad989['update']({'read':!![]});}else{logger[_0xd34b('0x26')](_0xd34b('0x8c'),_0xd34b('0x2b'),_0xd34b('0x92'),util['inspect'](_0x350cc6[_0xd34b('0x58')],{'showHidden':![],'depth':null}));}break;}return _0xcad989;}})[_0xd34b('0x20')](respondWithResult(_0x414e00,null))['catch'](handleError(_0x414e00,null));}; \ No newline at end of file +var _0x023d=['json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','destroy','name','send','index','map','SmsMessage','fieldName','type','key','model','query','keys','attributes','intersection','fields','hasOwnProperty','nolimit','order','sort','where','filters','pick','filter','merge','VIRTUAL','options','includeAll','rows','catch','show','params','rawAttributes','length','include','find','create','body','describe','accept','sms','read','readAt','format','YYYY-MM-DD\x20HH:mm:ss','UserId','user','agent','get','isNil','read1stAt','role','null','AcceptMessage','acceptMessage','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','ContactId','sequelize','Sequelize','QueryTypes','SELECT','User','fullname','email','internal','manual','interface','channel','motionChannel','event','EventManager','acceptmessage','SmsInteraction','SmsInteractionId','interaction','RejectMessage','rejectMessage','rejectmessage','SmsAccount','received\x20delivery\x20report\x20from','inspect','twilio','MessageSid','messageId','SmsAccount,\x20%s,\x20%s,\x20%s','plivo','MessageUUID','indexOf','sent','infobip','results','groupName','DELIVERED','rimraf','fast-json-patch','request-promise','mustache','path','sox','to-csv','ejs','fs-extra','lodash','squel','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','redis','defaults','localhost','./smsMessage.socket','register','client','http','request','then','info','request\x20sent','debug','SmsMessage,\x20%s,\x20%s,\x20%s','stringify','error','code','SmsMessage,\x20%s,\x20%s','message','sendStatus','status','end'];(function(_0x1d394a,_0x2496eb){var _0x39958f=function(_0x45d3d0){while(--_0x45d3d0){_0x1d394a['push'](_0x1d394a['shift']());}};_0x39958f(++_0x2496eb);}(_0x023d,0x67));var _0xd023=function(_0x45106e,_0x573022){_0x45106e=_0x45106e-0x0;var _0x3369a7=_0x023d[_0x45106e];return _0x3369a7;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xd023('0x0'));var zipdir=require('zip-dir');var jsonpatch=require(_0xd023('0x1'));var rp=require(_0xd023('0x2'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0xd023('0x3'));var util=require('util');var path=require(_0xd023('0x4'));var sox=require(_0xd023('0x5'));var csv=require(_0xd023('0x6'));var ejs=require(_0xd023('0x7'));var fs=require('fs');var fs_extra=require(_0xd023('0x8'));var _=require(_0xd023('0x9'));var squel=require(_0xd023('0xa'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0xd023('0xb'));var toCsv=require('to-csv');var querystring=require(_0xd023('0xc'));var Papa=require(_0xd023('0xd'));var Redis=require('ioredis');var authService=require(_0xd023('0xe'));var qs=require(_0xd023('0xf'));var as=require(_0xd023('0x10'));var hardwareService=require(_0xd023('0x11'));var logger=require(_0xd023('0x12'))(_0xd023('0x13'));var utils=require(_0xd023('0x14'));var config=require('../../config/environment');var licenseUtil=require(_0xd023('0x15'));var db=require('../../mysqldb')['db'];config[_0xd023('0x16')]=_[_0xd023('0x17')](config[_0xd023('0x16')],{'host':_0xd023('0x18'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require(_0xd023('0x19'))[_0xd023('0x1a')](socket);var jayson=require('jayson/promise');var client=jayson[_0xd023('0x1b')][_0xd023('0x1c')]({'port':0x232c});var client9002=jayson['client'][_0xd023('0x1c')]({'port':0x232a});function respondWithRpcPromise(_0x552c9e,_0x43f2cf,_0x484c3b,_0x400d25){return new BPromise(function(_0xad58b8,_0x25ca61){var _0x1b2974=_0x400d25||client;return _0x1b2974[_0xd023('0x1d')](_0x552c9e,_0x484c3b)[_0xd023('0x1e')](function(_0x2446d4){logger[_0xd023('0x1f')]('SmsMessage,\x20%s,\x20%s',_0x43f2cf,_0xd023('0x20'));logger[_0xd023('0x21')](_0xd023('0x22'),_0x43f2cf,_0xd023('0x20'),JSON[_0xd023('0x23')](_0x2446d4));if(_0x2446d4[_0xd023('0x24')]){if(_0x2446d4[_0xd023('0x24')][_0xd023('0x25')]===0x1f4){logger['error'](_0xd023('0x26'),_0x43f2cf,_0x2446d4[_0xd023('0x24')][_0xd023('0x27')]);return _0x25ca61(_0x2446d4[_0xd023('0x24')][_0xd023('0x27')]);}logger['error'](_0xd023('0x26'),_0x43f2cf,_0x2446d4['error'][_0xd023('0x27')]);return _0xad58b8(_0x2446d4[_0xd023('0x24')][_0xd023('0x27')]);}else{logger[_0xd023('0x1f')](_0xd023('0x26'),_0x43f2cf,_0xd023('0x20'));_0xad58b8(_0x2446d4['result']['message']);}})['catch'](function(_0xd14642){logger[_0xd023('0x24')](_0xd023('0x26'),_0x43f2cf,_0xd14642);_0x25ca61(_0xd14642);});});}function respondWithStatusCode(_0x5e58d2,_0x35c6f2){_0x35c6f2=_0x35c6f2||0xcc;return function(_0x351d3a){if(_0x351d3a){return _0x5e58d2[_0xd023('0x28')](_0x35c6f2);}return _0x5e58d2[_0xd023('0x29')](_0x35c6f2)[_0xd023('0x2a')]();};}function respondWithResult(_0x47df89,_0x1959ee){_0x1959ee=_0x1959ee||0xc8;return function(_0xbdf895){if(_0xbdf895){return _0x47df89[_0xd023('0x29')](_0x1959ee)[_0xd023('0x2b')](_0xbdf895);}};}function respondWithFilteredResult(_0x2155e4,_0x1ddabe){return function(_0x5b49ca){if(_0x5b49ca){var _0x181a94=typeof _0x1ddabe[_0xd023('0x2c')]===_0xd023('0x2d')&&typeof _0x1ddabe[_0xd023('0x2e')]===_0xd023('0x2d');var _0x5860de=_0x5b49ca[_0xd023('0x2f')];var _0x26c7c4=_0x181a94?0x0:_0x1ddabe[_0xd023('0x2c')];var _0x3dcc41=_0x181a94?_0x5b49ca[_0xd023('0x2f')]:_0x1ddabe[_0xd023('0x2c')]+_0x1ddabe[_0xd023('0x2e')];var _0x5a6be9;if(_0x3dcc41>=_0x5860de){_0x3dcc41=_0x5860de;_0x5a6be9=0xc8;}else{_0x5a6be9=0xce;}_0x2155e4[_0xd023('0x29')](_0x5a6be9);return _0x2155e4[_0xd023('0x30')](_0xd023('0x31'),_0x26c7c4+'-'+_0x3dcc41+'/'+_0x5860de)[_0xd023('0x2b')](_0x5b49ca);}return null;};}function patchUpdates(_0x2468b3){return function(_0x449364){try{jsonpatch[_0xd023('0x32')](_0x449364,_0x2468b3,!![]);}catch(_0x14d01b){return BPromise[_0xd023('0x33')](_0x14d01b);}return _0x449364[_0xd023('0x34')]();};}function saveUpdates(_0x58f6c0,_0x45dfbc){return function(_0x5c0653){if(_0x5c0653){return _0x5c0653[_0xd023('0x35')](_0x58f6c0)[_0xd023('0x1e')](function(_0x49abf6){return _0x49abf6;});}return null;};}function removeEntity(_0x32e33d,_0x577fee){return function(_0xee2493){if(_0xee2493){return _0xee2493[_0xd023('0x36')]()[_0xd023('0x1e')](function(){_0x32e33d['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x343a88,_0x55ddb1){return function(_0x2f07a1){if(!_0x2f07a1){_0x343a88['sendStatus'](0x194);}return _0x2f07a1;};}function handleError(_0xc57f7d,_0x550ddc){_0x550ddc=_0x550ddc||0x1f4;return function(_0x42c757){logger[_0xd023('0x24')](_0x42c757['stack']);if(_0x42c757[_0xd023('0x37')]){delete _0x42c757['name'];}_0xc57f7d[_0xd023('0x29')](_0x550ddc)[_0xd023('0x38')](_0x42c757);};}exports[_0xd023('0x39')]=function(_0x57f943,_0x165e4c){var _0x3a9e67={},_0x5ac7ae={},_0x11ede0={'count':0x0,'rows':[]};var _0x25ce4e=_[_0xd023('0x3a')](db[_0xd023('0x3b')]['rawAttributes'],function(_0x5d31de){return{'name':_0x5d31de[_0xd023('0x3c')],'type':_0x5d31de[_0xd023('0x3d')][_0xd023('0x3e')]};});_0x5ac7ae[_0xd023('0x3f')]=_['map'](_0x25ce4e,_0xd023('0x37'));_0x5ac7ae[_0xd023('0x40')]=_[_0xd023('0x41')](_0x57f943[_0xd023('0x40')]);_0x5ac7ae['filters']=_['intersection'](_0x5ac7ae['model'],_0x5ac7ae['query']);_0x3a9e67[_0xd023('0x42')]=_[_0xd023('0x43')](_0x5ac7ae[_0xd023('0x3f')],qs[_0xd023('0x44')](_0x57f943[_0xd023('0x40')][_0xd023('0x44')]));_0x3a9e67[_0xd023('0x42')]=_0x3a9e67[_0xd023('0x42')]['length']?_0x3a9e67[_0xd023('0x42')]:_0x5ac7ae['model'];if(!_0x57f943[_0xd023('0x40')][_0xd023('0x45')](_0xd023('0x46'))){_0x3a9e67[_0xd023('0x2e')]=qs[_0xd023('0x2e')](_0x57f943['query'][_0xd023('0x2e')]);_0x3a9e67[_0xd023('0x2c')]=qs[_0xd023('0x2c')](_0x57f943[_0xd023('0x40')]['offset']);}_0x3a9e67[_0xd023('0x47')]=qs['sort'](_0x57f943[_0xd023('0x40')][_0xd023('0x48')]);_0x3a9e67[_0xd023('0x49')]=qs[_0xd023('0x4a')](_[_0xd023('0x4b')](_0x57f943[_0xd023('0x40')],_0x5ac7ae[_0xd023('0x4a')]),_0x25ce4e);if(_0x57f943[_0xd023('0x40')][_0xd023('0x4c')]){_0x3a9e67['where']=_[_0xd023('0x4d')](_0x3a9e67[_0xd023('0x49')],{'$or':_[_0xd023('0x3a')](_0x25ce4e,function(_0x46bf10){if(_0x46bf10[_0xd023('0x3d')]!==_0xd023('0x4e')){var _0x273535={};_0x273535[_0x46bf10[_0xd023('0x37')]]={'$like':'%'+_0x57f943[_0xd023('0x40')][_0xd023('0x4c')]+'%'};return _0x273535;}})});}_0x3a9e67=_['merge']({},_0x3a9e67,_0x57f943[_0xd023('0x4f')]);var _0x367690={'where':_0x3a9e67['where']};return db['SmsMessage'][_0xd023('0x2f')](_0x367690)[_0xd023('0x1e')](function(_0x5a36e2){_0x11ede0['count']=_0x5a36e2;if(_0x57f943[_0xd023('0x40')][_0xd023('0x50')]){_0x3a9e67['include']=[{'all':!![]}];}return db[_0xd023('0x3b')]['findAll'](_0x3a9e67);})[_0xd023('0x1e')](function(_0x2639a3){_0x11ede0[_0xd023('0x51')]=_0x2639a3;return _0x11ede0;})[_0xd023('0x1e')](respondWithFilteredResult(_0x165e4c,_0x3a9e67))[_0xd023('0x52')](handleError(_0x165e4c,null));};exports[_0xd023('0x53')]=function(_0x4e52d5,_0x4c1b35){var _0x36512c={'raw':!![],'where':{'id':_0x4e52d5[_0xd023('0x54')]['id']}},_0x4d9650={};_0x4d9650[_0xd023('0x3f')]=_['keys'](db['SmsMessage'][_0xd023('0x55')]);_0x4d9650[_0xd023('0x40')]=_['keys'](_0x4e52d5[_0xd023('0x40')]);_0x4d9650[_0xd023('0x4a')]=_['intersection'](_0x4d9650[_0xd023('0x3f')],_0x4d9650[_0xd023('0x40')]);_0x36512c['attributes']=_[_0xd023('0x43')](_0x4d9650['model'],qs[_0xd023('0x44')](_0x4e52d5[_0xd023('0x40')][_0xd023('0x44')]));_0x36512c['attributes']=_0x36512c[_0xd023('0x42')][_0xd023('0x56')]?_0x36512c[_0xd023('0x42')]:_0x4d9650[_0xd023('0x3f')];if(_0x4e52d5[_0xd023('0x40')][_0xd023('0x50')]){_0x36512c[_0xd023('0x57')]=[{'all':!![]}];}_0x36512c=_[_0xd023('0x4d')]({},_0x36512c,_0x4e52d5[_0xd023('0x4f')]);return db[_0xd023('0x3b')][_0xd023('0x58')](_0x36512c)[_0xd023('0x1e')](handleEntityNotFound(_0x4c1b35,null))[_0xd023('0x1e')](respondWithResult(_0x4c1b35,null))[_0xd023('0x52')](handleError(_0x4c1b35,null));};exports[_0xd023('0x59')]=function(_0x3ef24e,_0xc1a8cf){return db[_0xd023('0x3b')][_0xd023('0x59')](_0x3ef24e[_0xd023('0x5a')],{})[_0xd023('0x1e')](respondWithResult(_0xc1a8cf,0xc9))[_0xd023('0x52')](handleError(_0xc1a8cf,null));};exports[_0xd023('0x35')]=function(_0x168b8b,_0x1a193f){if(_0x168b8b[_0xd023('0x5a')]['id']){delete _0x168b8b[_0xd023('0x5a')]['id'];}return db['SmsMessage'][_0xd023('0x58')]({'where':{'id':_0x168b8b[_0xd023('0x54')]['id']}})[_0xd023('0x1e')](handleEntityNotFound(_0x1a193f,null))[_0xd023('0x1e')](saveUpdates(_0x168b8b[_0xd023('0x5a')],null))[_0xd023('0x1e')](respondWithResult(_0x1a193f,null))[_0xd023('0x52')](handleError(_0x1a193f,null));};exports[_0xd023('0x36')]=function(_0x339c36,_0x2144e6){return db[_0xd023('0x3b')][_0xd023('0x58')]({'where':{'id':_0x339c36[_0xd023('0x54')]['id']}})['then'](handleEntityNotFound(_0x2144e6,null))['then'](removeEntity(_0x2144e6,null))[_0xd023('0x52')](handleError(_0x2144e6,null));};exports[_0xd023('0x5b')]=function(_0xa0839c,_0x3dd4a2){return db[_0xd023('0x3b')][_0xd023('0x5b')]()[_0xd023('0x1e')](respondWithResult(_0x3dd4a2,null))[_0xd023('0x52')](handleError(_0x3dd4a2,null));};var interaction_log=require(_0xd023('0x12'))('sms-interactions');exports[_0xd023('0x5c')]=function(_0x48b0f3,_0x412b05,_0x31ef89){var _0x3dddfb={'agent':{},'channel':_0xd023('0x5d')};if(_0x48b0f3[_0xd023('0x5a')]['id']){delete _0x48b0f3[_0xd023('0x5a')]['id'];}_0x48b0f3[_0xd023('0x5a')][_0xd023('0x5e')]=!![];_0x48b0f3[_0xd023('0x5a')][_0xd023('0x5f')]=moment()[_0xd023('0x60')](_0xd023('0x61'));_0x48b0f3['body'][_0xd023('0x62')]=_0x48b0f3[_0xd023('0x5a')][_0xd023('0x62')]||_0x48b0f3[_0xd023('0x63')]['id'];_0x3dddfb[_0xd023('0x64')]['id']=_0x48b0f3['body']['UserId'];return db[_0xd023('0x3b')][_0xd023('0x58')]({'where':{'id':_0x48b0f3[_0xd023('0x54')]['id'],'UserId':null}})[_0xd023('0x1e')](handleEntityNotFound(_0x412b05,null))[_0xd023('0x1e')](saveUpdates(_0x48b0f3['body'],null))[_0xd023('0x1e')](function(_0x179757){if(_0x179757){_0x3dddfb[_0xd023('0x27')]=_0x179757[_0xd023('0x65')]({'plain':!![]});return db['SmsInteraction'][_0xd023('0x58')]({'where':{'id':_0x179757['SmsInteractionId']}});}return null;})[_0xd023('0x1e')](handleEntityNotFound(_0x412b05,null))[_0xd023('0x1e')](function(_0x74358b){if(_0x74358b){return _0x74358b[_0xd023('0x35')]({'UserId':_0x48b0f3['body'][_0xd023('0x62')],'read1stAt':_[_0xd023('0x66')](_0x74358b[_0xd023('0x67')])?moment()[_0xd023('0x60')](_0xd023('0x61')):undefined});}return null;})['then'](function(_0x5bed9a){if(_0x5bed9a){_0x3dddfb['interaction']=_0x5bed9a[_0xd023('0x65')]({'plain':!![]});interaction_log[_0xd023('0x1f')]('[SMSMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s',_0x48b0f3[_0xd023('0x63')]['id'],_0x48b0f3[_0xd023('0x63')][_0xd023('0x37')],_0x48b0f3[_0xd023('0x63')][_0xd023('0x68')],_0x3dddfb['interaction']['id'],_0x48b0f3[_0xd023('0x5a')]?JSON[_0xd023('0x23')](_0x48b0f3[_0xd023('0x5a')]):_0xd023('0x69'));return respondWithRpcPromise(_0xd023('0x6a'),_0xd023('0x6b'),_0x3dddfb);}return null;})[_0xd023('0x1e')](function(_0x204585){var _0x33210d=_0xd023('0x6c')+_0x204585['message'][_0xd023('0x6d')];return db[_0xd023('0x6e')][_0xd023('0x40')](_0x33210d,{'type':db[_0xd023('0x6f')][_0xd023('0x70')][_0xd023('0x71')],'raw':!![]})['then'](function(_0x2aba98){return _0x2aba98;});})[_0xd023('0x1e')](function(_0x2deb9e){if(_0x2deb9e){_0x3dddfb['message']['contact']=_0x2deb9e[0x0];if(!_0x48b0f3[_0xd023('0x5a')][_0xd023('0x62')])return;return db[_0xd023('0x72')][_0xd023('0x58')]({'where':{'id':_0x48b0f3[_0xd023('0x5a')][_0xd023('0x62')],'role':_0xd023('0x64')},'attributes':['id',_0xd023('0x37'),_0xd023('0x73'),_0xd023('0x74'),_0xd023('0x75')],'raw':!![]});}return null;})[_0xd023('0x1e')](function(_0x11a6c5){if(!_0x11a6c5)return null;_0x3dddfb[_0xd023('0x27')][_0xd023('0x64')]=_0x11a6c5;return _0x3dddfb;})[_0xd023('0x1e')](function(_0x9c1f5b){if(_0x9c1f5b){if(_0x48b0f3['body'][_0xd023('0x76')]){_0x3dddfb[_0xd023('0x27')][_0xd023('0x77')]=util['format']('SIP/%s',_0x48b0f3[_0xd023('0x63')]['name']);_0x3dddfb[_0xd023('0x27')][_0xd023('0x78')]=_0x3dddfb['channel'];_0x3dddfb[_0xd023('0x27')][_0xd023('0x79')]=_0x3dddfb[_0xd023('0x78')];_0x3dddfb[_0xd023('0x27')][_0xd023('0x7a')]='accept';return respondWithRpcPromise(_0xd023('0x7b'),_0xd023('0x7b'),{'event':_0xd023('0x7c'),'message':_0x3dddfb[_0xd023('0x27')]},client9002)[_0xd023('0x1e')](function(){return _0x3dddfb;});}return _0x3dddfb;}return null;})[_0xd023('0x1e')](respondWithResult(_0x412b05,null))[_0xd023('0x52')](handleError(_0x412b05,null));};var interaction_log=require(_0xd023('0x12'))('sms-interactions');exports[_0xd023('0x33')]=function(_0x25c1cf,_0x125712,_0x362754){var _0x24e651={'agent':{},'channel':'sms'};if(_0x25c1cf['body']['id']){delete _0x25c1cf[_0xd023('0x5a')]['id'];}_0x25c1cf['body']['UserId']=_0x25c1cf[_0xd023('0x5a')]['UserId']||_0x25c1cf[_0xd023('0x63')]['id'];_0x24e651[_0xd023('0x64')]['id']=_0x25c1cf[_0xd023('0x5a')][_0xd023('0x62')];return db[_0xd023('0x3b')][_0xd023('0x58')]({'where':{'id':_0x25c1cf[_0xd023('0x54')]['id'],'UserId':null}})[_0xd023('0x1e')](handleEntityNotFound(_0x125712,null))['then'](function(_0x340c71){if(_0x340c71){_0x24e651[_0xd023('0x27')]=_0x340c71['get']({'plain':!![]});return db[_0xd023('0x7d')][_0xd023('0x58')]({'where':{'id':_0x340c71[_0xd023('0x7e')]}});}return null;})[_0xd023('0x1e')](handleEntityNotFound(_0x125712,null))[_0xd023('0x1e')](function(_0xb0a942){if(_0xb0a942){_0x24e651[_0xd023('0x7f')]=_0xb0a942[_0xd023('0x65')]({'plain':!![]});interaction_log[_0xd023('0x1f')]('[SMSMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s',_0x25c1cf['user']['id'],_0x25c1cf[_0xd023('0x63')][_0xd023('0x37')],_0x25c1cf[_0xd023('0x63')][_0xd023('0x68')],_0x24e651[_0xd023('0x7f')]['id'],_0x25c1cf['body']?JSON[_0xd023('0x23')](_0x25c1cf[_0xd023('0x5a')]):_0xd023('0x69'));return respondWithRpcPromise(_0xd023('0x80'),_0xd023('0x81'),_0x24e651);}return null;})['then'](function(_0x42c356){var _0x49aa84=_0xd023('0x6c')+_0x42c356[_0xd023('0x27')]['ContactId'];return db['sequelize'][_0xd023('0x40')](_0x49aa84,{'type':db[_0xd023('0x6f')]['QueryTypes'][_0xd023('0x71')],'raw':!![]})[_0xd023('0x1e')](function(_0x4dafd5){return _0x4dafd5;});})[_0xd023('0x1e')](function(_0x33cab0){if(_0x33cab0){_0x24e651[_0xd023('0x27')]['contact']=_0x33cab0[0x0];if(!_0x25c1cf['body']['UserId'])return;return db[_0xd023('0x72')][_0xd023('0x58')]({'where':{'id':_0x25c1cf['body'][_0xd023('0x62')],'role':_0xd023('0x64')},'attributes':['id',_0xd023('0x37'),_0xd023('0x73'),_0xd023('0x74'),_0xd023('0x75')],'raw':!![]});}return null;})['then'](function(_0x1d06fd){if(!_0x1d06fd)return null;_0x24e651[_0xd023('0x27')][_0xd023('0x64')]=_0x1d06fd;return _0x24e651;})[_0xd023('0x1e')](function(_0x2be076){if(_0x2be076){_0x2be076[_0xd023('0x27')][_0xd023('0x77')]=util[_0xd023('0x60')]('SIP/%s',_0x25c1cf[_0xd023('0x63')][_0xd023('0x37')]);_0x2be076[_0xd023('0x27')][_0xd023('0x78')]=_0x24e651[_0xd023('0x78')];_0x2be076[_0xd023('0x27')][_0xd023('0x79')]=_0x24e651[_0xd023('0x78')];_0x2be076[_0xd023('0x27')]['event']='reject';respondWithRpcPromise(_0xd023('0x7b'),_0xd023('0x7b'),{'event':_0xd023('0x82'),'message':_0x2be076['message']},client9002);return _0x24e651;}return null;})[_0xd023('0x1e')](respondWithResult(_0x125712,null))[_0xd023('0x52')](handleError(_0x125712,null));};exports['status']=function(_0x3f4dea,_0x485321,_0x4b5f6d){if(_0x3f4dea[_0xd023('0x5a')]['id']){delete _0x3f4dea[_0xd023('0x5a')]['id'];}var _0x17eac2;return db['SmsMessage'][_0xd023('0x58')]({'where':{'id':_0x3f4dea[_0xd023('0x54')]['id']}})[_0xd023('0x1e')](handleEntityNotFound(_0x485321,null))['then'](function(_0xcc4d0f){if(_0xcc4d0f){_0x17eac2=_0xcc4d0f;return db[_0xd023('0x83')][_0xd023('0x58')]({'where':{'id':_0xcc4d0f['SmsAccountId']}});}})['then'](handleEntityNotFound(_0x485321,null))['then'](function(_0x5c99a2){if(_0x5c99a2){logger[_0xd023('0x21')]('SmsMessage,\x20%s,\x20%s,\x20%s',_0xd023('0x29'),_0xd023('0x84'),_0x5c99a2[_0xd023('0x3d')],util[_0xd023('0x85')](_0x3f4dea[_0xd023('0x5a')],{'showHidden':![],'depth':null}));switch(_0x5c99a2[_0xd023('0x3d')]){case _0xd023('0x86'):if(_0x3f4dea[_0xd023('0x5a')][_0xd023('0x87')]&&_0x3f4dea['body'][_0xd023('0x87')]===_0x17eac2[_0xd023('0x88')]){return _0x17eac2[_0xd023('0x35')]({'read':!![]});}else{logger[_0xd023('0x24')](_0xd023('0x89'),'status',_0xd023('0x86'),util[_0xd023('0x85')](_0x3f4dea[_0xd023('0x5a')],{'showHidden':![],'depth':null}));}break;case _0xd023('0x8a'):if(_0x3f4dea[_0xd023('0x5a')][_0xd023('0x8b')]&&_0x3f4dea[_0xd023('0x5a')][_0xd023('0x8b')]===_0x17eac2[_0xd023('0x88')]&&_[_0xd023('0x8c')]([_0xd023('0x8d'),'delivered'],_0x3f4dea['body']['Status'])>=0x0){return _0x17eac2[_0xd023('0x35')]({'read':!![]});}else{logger[_0xd023('0x24')](_0xd023('0x89'),'status','plivio',util['inspect'](_0x3f4dea[_0xd023('0x5a')],{'showHidden':![],'depth':null}));}break;case _0xd023('0x8e'):var _0x3be710=_0x3f4dea['body'][_0xd023('0x8f')][0x0];if(_0x3be710[_0xd023('0x29')][_0xd023('0x90')]===_0xd023('0x91')){return _0x17eac2[_0xd023('0x35')]({'read':!![]});}else{logger[_0xd023('0x24')](_0xd023('0x89'),'status','infobip',util[_0xd023('0x85')](_0x3f4dea[_0xd023('0x5a')],{'showHidden':![],'depth':null}));}break;}return _0x17eac2;}})[_0xd023('0x1e')](respondWithResult(_0x485321,null))[_0xd023('0x52')](handleError(_0x485321,null));}; \ No newline at end of file diff --git a/server/api/smsMessage/smsMessage.events.js b/server/api/smsMessage/smsMessage.events.js index 8cecbcf..9ae381a 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 _0x96f5=['update','remove','emit','hasOwnProperty','events','SmsMessage','setMaxListeners','save'];(function(_0x42f009,_0x5e27b1){var _0x22a1e0=function(_0x297993){while(--_0x297993){_0x42f009['push'](_0x42f009['shift']());}};_0x22a1e0(++_0x5e27b1);}(_0x96f5,0x1ec));var _0x596f=function(_0x3df946,_0xc2277d){_0x3df946=_0x3df946-0x0;var _0x12eded=_0x96f5[_0x3df946];return _0x12eded;};'use strict';var EventEmitter=require(_0x596f('0x0'));var SmsMessage=require('../../mysqldb')['db'][_0x596f('0x1')];var SmsMessageEvents=new EventEmitter();SmsMessageEvents[_0x596f('0x2')](0x0);var events={'afterCreate':_0x596f('0x3'),'afterUpdate':_0x596f('0x4'),'afterDestroy':_0x596f('0x5')};function emitEvent(_0x2654d8){return function(_0x32c01a,_0x53a8ad,_0xe8cd10){SmsMessageEvents[_0x596f('0x6')](_0x2654d8+':'+_0x32c01a['id'],_0x32c01a);SmsMessageEvents[_0x596f('0x6')](_0x2654d8,_0x32c01a);_0xe8cd10(null);};}for(var e in events){if(events[_0x596f('0x7')](e)){var event=events[e];SmsMessage['hook'](e,emitEvent(event));}}module['exports']=SmsMessageEvents; \ No newline at end of file +var _0x9921=['../../mysqldb','setMaxListeners','remove','emit','hasOwnProperty','hook','exports','events'];(function(_0x177f9f,_0x36a05f){var _0x57d134=function(_0x5e4aeb){while(--_0x5e4aeb){_0x177f9f['push'](_0x177f9f['shift']());}};_0x57d134(++_0x36a05f);}(_0x9921,0x1df));var _0x1992=function(_0x4f1448,_0x3f599b){_0x4f1448=_0x4f1448-0x0;var _0x16afcc=_0x9921[_0x4f1448];return _0x16afcc;};'use strict';var EventEmitter=require(_0x1992('0x0'));var SmsMessage=require(_0x1992('0x1'))['db']['SmsMessage'];var SmsMessageEvents=new EventEmitter();SmsMessageEvents[_0x1992('0x2')](0x0);var events={'afterCreate':'save','afterUpdate':'update','afterDestroy':_0x1992('0x3')};function emitEvent(_0x2c8329){return function(_0x499632,_0x2410d8,_0x1550b4){SmsMessageEvents['emit'](_0x2c8329+':'+_0x499632['id'],_0x499632);SmsMessageEvents[_0x1992('0x4')](_0x2c8329,_0x499632);_0x1550b4(null);};}for(var e in events){if(events[_0x1992('0x5')](e)){var event=events[e];SmsMessage[_0x1992('0x6')](e,emitEvent(event));}}module[_0x1992('0x7')]=SmsMessageEvents; \ No newline at end of file diff --git a/server/api/smsMessage/smsMessage.model.js b/server/api/smsMessage/smsMessage.model.js index ac3492e..8027a82 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 _0xa8b9=['length','md5','hex','GET','Missing\x20parameters:\x20apiKey','clickatell','https://platform.clickatell.com/messages','uuid','UTF-8','apiMessageId','bandwidth','https://messaging.bandwidth.com/api/v2/users/','/messages','intelepeer','https://api.intelepeer.com/_rest/v4/app/sms/mdr','Bearer\x20','application/json','message','status','refid','Token\x20not\x20received','finally','utf8mb4','utf8mb4_unicode_ci','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./smsMessage.attributes','exports','define','SmsMessage','sms_messages','messageId','fti_sms_messages','body','FULLTEXT','models','get','direction','toLowerCase','isNil','SmsInteractionId','findOne','then','update','error','out','secret','SmsAccount','find','SmsAccountId','twilio','accountSid','authToken','messages','create','phone','remote','/api/sms/messages/','/status?token=','token','sid','SmsMessage,\x20%s,\x20%s,\x20%s','afterCreate','inspect','Missing\x20parameters:\x20phone,\x20accountSid\x20or\x20authToken','skebby','https://api.skebby.it/API/v1.0/REST/','username','password','smsMethod','sender','login?username=','&password=','split','sms','POST','user_key','total_sent','internal_order_id','deliveryReport','Missing\x20parameters:\x20username,\x20password','connectel','requestid','read','Missing\x20parameters:\x20authToken','clicksend','format','%s:%s','https://rest.clicksend.com/v3/sms/send','Basic\x20%s','toString','base64','http_code','data','queued_count','head','clickSend','catch','plivo','authId','senderString','https://api.plivo.com/v1/Account/%s/Message/','message_uuid','Missing\x20parameters:\x20authId,\x20authToken','infobip','baseUrl','/sms/2/text/advanced','IBSSO\x20','Missing\x20parameters:\x20base_url','csc','crypto','apiKey','login','timestamp','keys','sort'];(function(_0x4ae6ef,_0xc2af80){var _0x3cbb4e=function(_0x569ad5){while(--_0x569ad5){_0x4ae6ef['push'](_0x4ae6ef['shift']());}};_0x3cbb4e(++_0xc2af80);}(_0xa8b9,0x10e));var _0x9a8b=function(_0x4a458f,_0x31766d){_0x4a458f=_0x4a458f-0x0;var _0x430d96=_0xa8b9[_0x4a458f];return _0x430d96;};'use strict';var _=require('lodash');var util=require(_0x9a8b('0x0'));var logger=require(_0x9a8b('0x1'))(_0x9a8b('0x2'));var moment=require(_0x9a8b('0x3'));var BPromise=require(_0x9a8b('0x4'));var rp=require(_0x9a8b('0x5'));var fs=require('fs');var path=require(_0x9a8b('0x6'));var rimraf=require(_0x9a8b('0x7'));var config=require(_0x9a8b('0x8'));var attributes=require(_0x9a8b('0x9'));module[_0x9a8b('0xa')]=function(_0x36d43b,_0x4c4acd){return _0x36d43b[_0x9a8b('0xb')](_0x9a8b('0xc'),attributes,{'tableName':_0x9a8b('0xd'),'paranoid':![],'indexes':[{'name':_0x9a8b('0xe'),'fields':['messageId']},{'name':_0x9a8b('0xf'),'fields':[_0x9a8b('0x10')],'type':_0x9a8b('0x11')}],'timestamps':!![],'hooks':{'afterCreate':function(_0x8e0517,_0x306a38,_0x1b873e){var _0x1326a2=_0x36d43b[_0x9a8b('0x12')];var _0x642611=_0x8e0517[_0x9a8b('0x13')]({'plain':!![]});if(_0x642611[_0x9a8b('0x14')][_0x9a8b('0x15')]()==='in'||_0x642611['direction'][_0x9a8b('0x15')]()==='out'&&!_0x642611['secret']&&!_[_0x9a8b('0x16')](_0x642611['UserId'])&&!_['isNil'](_0x642611[_0x9a8b('0x17')])){_0x1326a2['SmsInteraction'][_0x9a8b('0x18')]({'where':{'id':_0x642611['SmsInteractionId']}})[_0x9a8b('0x19')](function(_0xd6484c){if(_0xd6484c){_0xd6484c[_0x9a8b('0x1a')]({'lastMsgAt':_0x642611['createdAt'],'lastMsgDirection':_0x642611[_0x9a8b('0x14')][_0x9a8b('0x15')]()});}})['catch'](function(_0x2f2f02){console[_0x9a8b('0x1b')](_0x2f2f02);});}if(_0x642611[_0x9a8b('0x14')]===_0x9a8b('0x1c')&&!_0x642611[_0x9a8b('0x1d')]){var _0x5cdfc3;_0x1326a2[_0x9a8b('0x1e')][_0x9a8b('0x1f')]({'where':{'id':_0x642611[_0x9a8b('0x20')]},'raw':!![]})['then'](function(_0x2fca63){_0x5cdfc3=_0x2fca63;if(_0x5cdfc3&&_0x5cdfc3['type']){switch(_0x5cdfc3['type']){case _0x9a8b('0x21'):var _0x1961b8=require(_0x9a8b('0x21'));if(_0x5cdfc3[_0x9a8b('0x22')]&&_0x5cdfc3[_0x9a8b('0x23')]&&_0x5cdfc3['phone']){var _0x4d4847=new _0x1961b8(_0x5cdfc3['accountSid'],_0x5cdfc3['authToken']);_0x4d4847[_0x9a8b('0x24')][_0x9a8b('0x25')]({'body':_0x642611[_0x9a8b('0x10')],'to':_0x642611[_0x9a8b('0x26')],'from':_0x5cdfc3[_0x9a8b('0x26')],'statusCallback':_0x5cdfc3[_0x9a8b('0x27')]+_0x9a8b('0x28')+_0x642611['id']+_0x9a8b('0x29')+_0x5cdfc3[_0x9a8b('0x2a')]})['then'](function(_0xac99a6){if(_0xac99a6['sid']){return _0x8e0517[_0x9a8b('0x1a')]({'messageId':_0xac99a6[_0x9a8b('0x2b')]});}})['catch'](function(_0x546433){logger[_0x9a8b('0x1b')](_0x9a8b('0x2c'),_0x9a8b('0x2d'),_0x9a8b('0x21'),util[_0x9a8b('0x2e')](_0x546433,{'showHidden':![],'depth':null}));});}else{logger[_0x9a8b('0x1b')](_0x9a8b('0x2c'),_0x9a8b('0x2d'),_0x9a8b('0x21'),_0x9a8b('0x2f'));}break;case _0x9a8b('0x30'):var _0x3c3ec6=_0x9a8b('0x31');if(_0x5cdfc3[_0x9a8b('0x32')]&&_0x5cdfc3[_0x9a8b('0x33')]){var _0x47ce98={'recipient':[_0x642611[_0x9a8b('0x26')]],'message':_0x642611[_0x9a8b('0x10')],'message_type':_0x5cdfc3[_0x9a8b('0x34')]};if(_0x5cdfc3['smsMethod']&&_0x5cdfc3[_0x9a8b('0x34')]!=='SI'){_0x47ce98[_0x9a8b('0x35')]=_0x5cdfc3[_0x9a8b('0x26')];}var _0x2b79d4={'url':_0x3c3ec6+_0x9a8b('0x36')+_0x5cdfc3[_0x9a8b('0x32')]+_0x9a8b('0x37')+_0x5cdfc3[_0x9a8b('0x33')],'method':'GET'};rp(_0x2b79d4)[_0x9a8b('0x19')](function(_0x4fa2e1){var _0x23ce0d=_0x4fa2e1[_0x9a8b('0x38')](';');var _0xe3aaac={'user_key':_0x23ce0d[0x0],'session_key':_0x23ce0d[0x1]};_0x2b79d4={'url':_0x3c3ec6+_0x9a8b('0x39'),'method':_0x9a8b('0x3a'),'headers':{'user_key':_0xe3aaac[_0x9a8b('0x3b')],'Session_key':_0xe3aaac['session_key']},'json':!![],'body':_0x47ce98};return rp(_0x2b79d4);})['then'](function(_0x5aa761){if(_0x5aa761[_0x9a8b('0x3c')]>=0x1){var _0x195cc4={'messageId':_0x5aa761[_0x9a8b('0x3d')]};if(_0x5cdfc3[_0x9a8b('0x34')]!=='GP'||!_0x5cdfc3[_0x9a8b('0x3e')]){_0x195cc4['read']=!![];}return _0x8e0517[_0x9a8b('0x1a')](_0x195cc4);}else{return logger[_0x9a8b('0x1b')]('SmsMessage,\x20%s,\x20%s,\x20%s',_0x9a8b('0x2d'),_0x9a8b('0x30'),util['inspect'](_0x5aa761,{'showHidden':![],'depth':null}));}})['catch'](function(_0x33d2d2){return logger[_0x9a8b('0x1b')](_0x9a8b('0x2c'),_0x9a8b('0x2d'),_0x9a8b('0x30'),util[_0x9a8b('0x2e')](_0x33d2d2,{'showHidden':![],'depth':null}));});}else{logger[_0x9a8b('0x1b')]('SmsMessage,\x20%s,\x20%s,\x20%s',_0x9a8b('0x2d'),_0x9a8b('0x30'),_0x9a8b('0x3f'));}break;case _0x9a8b('0x40'):if(_0x5cdfc3['authToken']){var _0x33c84b={'recipient':_0x642611['phone'],'message':_0x642611[_0x9a8b('0x10')],'sender':_0x5cdfc3['senderString']||_0x5cdfc3[_0x9a8b('0x26')],'authorization':_0x5cdfc3['authToken']};var _0x306a38={'method':_0x9a8b('0x3a'),'uri':'https://smsapi.connectel.se/api/v2/send/','body':_0x33c84b,'json':!![]};rp(_0x306a38)[_0x9a8b('0x19')](function(_0x4a33b5){var _0x4f191f={'messageId':_0x4a33b5[_0x9a8b('0x41')]};if(!_0x5cdfc3[_0x9a8b('0x3e')]){_0x4f191f[_0x9a8b('0x42')]=!![];}return _0x8e0517[_0x9a8b('0x1a')](_0x4f191f);})['catch'](function(_0x5d601a){logger[_0x9a8b('0x1b')](_0x9a8b('0x2c'),_0x9a8b('0x2d'),_0x9a8b('0x40'),util[_0x9a8b('0x2e')](_0x5d601a,{'showHidden':![],'depth':null}));});}else{logger[_0x9a8b('0x1b')](_0x9a8b('0x2c'),_0x9a8b('0x2d'),_0x9a8b('0x40'),_0x9a8b('0x43'));}break;case _0x9a8b('0x44'):if(_0x5cdfc3[_0x9a8b('0x32')]&&_0x5cdfc3[_0x9a8b('0x33')]){var _0x33c84b={'messages':[{'source':'xCALLY\x20Motion','to':_0x642611[_0x9a8b('0x26')],'body':_0x642611['body'],'from':_0x5cdfc3['senderString']||_0x5cdfc3[_0x9a8b('0x26')]}]};var _0x4f3043=util[_0x9a8b('0x45')](_0x9a8b('0x46'),_0x5cdfc3[_0x9a8b('0x32')],_0x5cdfc3['password']);var _0x306a38={'method':_0x9a8b('0x3a'),'uri':_0x9a8b('0x47'),'body':_0x33c84b,'headers':{'Authorization':util[_0x9a8b('0x45')](_0x9a8b('0x48'),new Buffer(_0x4f3043)[_0x9a8b('0x49')](_0x9a8b('0x4a')))},'json':!![]};rp(_0x306a38)[_0x9a8b('0x19')](function(_0x233db7){if(_0x233db7[_0x9a8b('0x4b')]>=0xc8&&_0x233db7['http_code']<=0xce){if(_0x233db7[_0x9a8b('0x4c')]&&_0x233db7[_0x9a8b('0x4c')][_0x9a8b('0x4d')]>0x0){var _0x5330ed=_[_0x9a8b('0x4e')](_0x233db7['data'][_0x9a8b('0x24')]);var _0x4f9bf0={'messageId':_0x5330ed['message_id']};if(!_0x5cdfc3['deliveryReport']){_0x4f9bf0['read']=!![];}return _0x8e0517[_0x9a8b('0x1a')](_0x4f9bf0);}else{logger['error'](_0x9a8b('0x2c'),_0x9a8b('0x2d'),_0x9a8b('0x4f'),util[_0x9a8b('0x2e')](_0x233db7,{'showHidden':![],'depth':null}));}}else{logger[_0x9a8b('0x1b')](_0x9a8b('0x2c'),_0x9a8b('0x2d'),'clickSend',util[_0x9a8b('0x2e')](_0x233db7,{'showHidden':![],'depth':null}));}})[_0x9a8b('0x50')](function(_0x3dabd6){logger[_0x9a8b('0x1b')]('SmsMessage,\x20%s,\x20%s,\x20%s','afterCreate',_0x9a8b('0x4f'),util['inspect'](_0x3dabd6,{'showHidden':![],'depth':null}));});}else{logger[_0x9a8b('0x1b')](_0x9a8b('0x2c'),_0x9a8b('0x2d'),_0x9a8b('0x4f'),_0x9a8b('0x3f'));}break;case _0x9a8b('0x51'):if(_0x5cdfc3[_0x9a8b('0x52')]&&_0x5cdfc3[_0x9a8b('0x23')]){var _0x33c84b={'dst':_0x642611[_0x9a8b('0x26')],'text':_0x642611['body'],'src':_0x5cdfc3[_0x9a8b('0x53')]||_0x5cdfc3['phone'],'url':_0x5cdfc3['remote']+_0x9a8b('0x28')+_0x642611['id']+_0x9a8b('0x29')+_0x5cdfc3[_0x9a8b('0x2a')]};var _0x4f3043=util[_0x9a8b('0x45')](_0x9a8b('0x46'),_0x5cdfc3['authId'],_0x5cdfc3[_0x9a8b('0x23')]);var _0x306a38={'method':_0x9a8b('0x3a'),'uri':util[_0x9a8b('0x45')](_0x9a8b('0x54'),_0x5cdfc3[_0x9a8b('0x52')]),'body':_0x33c84b,'headers':{'Authorization':util['format'](_0x9a8b('0x48'),new Buffer(_0x4f3043)[_0x9a8b('0x49')](_0x9a8b('0x4a')))},'json':!![]};rp(_0x306a38)[_0x9a8b('0x19')](function(_0x1d6d86){var _0x1a2415={'messageId':_0x1d6d86[_0x9a8b('0x55')][0x0]};return _0x8e0517[_0x9a8b('0x1a')](_0x1a2415);})[_0x9a8b('0x50')](function(_0x342e34){logger[_0x9a8b('0x1b')](_0x9a8b('0x2c'),_0x9a8b('0x2d'),_0x9a8b('0x51'),util[_0x9a8b('0x2e')](_0x342e34,{'showHidden':![],'depth':null}));});}else{logger[_0x9a8b('0x1b')](_0x9a8b('0x2c'),_0x9a8b('0x2d'),'plivo',_0x9a8b('0x56'));}break;case _0x9a8b('0x57'):if(_0x5cdfc3[_0x9a8b('0x32')]&&_0x5cdfc3['password']){if(_0x5cdfc3[_0x9a8b('0x58')]){var _0x5b5d61={'method':_0x9a8b('0x3a'),'uri':_0x5cdfc3[_0x9a8b('0x58')]+'/auth/1/session','body':{'username':_0x5cdfc3[_0x9a8b('0x32')],'password':_0x5cdfc3['password']},'json':!![]};return rp(_0x5b5d61)['then'](function(_0x1c021d){var _0x18df0d={'method':_0x9a8b('0x3a'),'uri':_0x5cdfc3['baseUrl']+_0x9a8b('0x59'),'body':{'messages':[{'from':_0x5cdfc3[_0x9a8b('0x26')],'destinations':[{'to':_0x642611[_0x9a8b('0x26')]}],'text':_0x642611[_0x9a8b('0x10')],'notifyUrl':_0x5cdfc3['remote']+_0x9a8b('0x28')+_0x642611['id']+_0x9a8b('0x29')+_0x5cdfc3['token'],'notifyContentType':'application/json','callbackData':_0x5cdfc3['phone']+';'+_0x642611['body']}]},'headers':{'Authorization':_0x9a8b('0x5a')+_0x1c021d[_0x9a8b('0x2a')]},'json':!![]};return rp(_0x18df0d)[_0x9a8b('0x19')](function(_0x15a732){if(_0x15a732[_0x9a8b('0x24')]){var _0x1c61f4={'messageId':_0x15a732['messages'][0x0][_0x9a8b('0xe')]};if(!_0x5cdfc3[_0x9a8b('0x3e')]){_0x1c61f4[_0x9a8b('0x42')]=!![];}return _0x8e0517[_0x9a8b('0x1a')](_0x1c61f4);}else{return logger['error'](_0x9a8b('0x2c'),_0x9a8b('0x2d'),_0x9a8b('0x57'),util['inspect'](_0x15a732,{'showHidden':![],'depth':null}));}});})[_0x9a8b('0x50')](function(_0xa51af2){return logger[_0x9a8b('0x1b')](_0x9a8b('0x2c'),_0x9a8b('0x2d'),_0x9a8b('0x57'),util[_0x9a8b('0x2e')](_0xa51af2,{'showHidden':![],'depth':null}));});}else{logger['error'](_0x9a8b('0x2c'),_0x9a8b('0x2d'),_0x9a8b('0x57'),_0x9a8b('0x5b'));}}else{logger['error'](_0x9a8b('0x2c'),_0x9a8b('0x2d'),_0x9a8b('0x57'),_0x9a8b('0x3f'));}break;case _0x9a8b('0x5c'):var _0x34256f=require(_0x9a8b('0x5d'));if(_0x5cdfc3[_0x9a8b('0x5e')]){var _0x45718e={};_0x45718e[_0x9a8b('0x5f')]=_0x5cdfc3['username'];_0x45718e[_0x9a8b('0x26')]=_0x642611[_0x9a8b('0x26')];_0x45718e[_0x9a8b('0x35')]=_0x5cdfc3[_0x9a8b('0x26')];_0x45718e['text']=_0x642611[_0x9a8b('0x10')];_0x45718e[_0x9a8b('0x60')]=+new Date();var _0x3902b4='';var _0x169f43='';var _0x311f48=Object[_0x9a8b('0x61')](_0x45718e);_0x311f48[_0x9a8b('0x62')]();for(var _0x3eba23=0x0;_0x3eba23<_0x311f48[_0x9a8b('0x63')];_0x3eba23++){if(_0x3902b4!=''){_0x3902b4+='&';}_0x3902b4+=_0x311f48[_0x3eba23]+'='+encodeURIComponent(_0x45718e[_0x311f48[_0x3eba23]]);_0x169f43+=_0x45718e[_0x311f48[_0x3eba23]];}_0x169f43+=_0x5cdfc3['apiKey'];_0x169f43=_0x34256f['createHash'](_0x9a8b('0x64'))[_0x9a8b('0x1a')](_0x169f43)['digest'](_0x9a8b('0x65'));if(_0x3902b4!==''){_0x3902b4+='&';}_0x3902b4+='signature='+_0x169f43;var _0x2b79d4={'method':_0x9a8b('0x66'),'uri':_0x5cdfc3[_0x9a8b('0x58')]+'/external/get/send.php?'+_0x3902b4,'json':!![]};return rp(_0x2b79d4)[_0x9a8b('0x19')](function(_0x99bbf2){var _0x28ed40=Object[_0x9a8b('0x61')](_0x99bbf2);if(_0x99bbf2[_0x28ed40[0x0]][_0x9a8b('0x1b')]&&parseInt(_0x99bbf2[_0x28ed40[0x0]][_0x9a8b('0x1b')])===0x0){var _0x5650f4={'messageId':_0x99bbf2[_0x28ed40[0x0]]['id_sms']};if(!_0x5cdfc3[_0x9a8b('0x3e')]){_0x5650f4[_0x9a8b('0x42')]=!![];}return _0x8e0517[_0x9a8b('0x1a')](_0x5650f4);}else{return logger[_0x9a8b('0x1b')](_0x9a8b('0x2c'),_0x9a8b('0x2d'),_0x9a8b('0x5c'),util[_0x9a8b('0x2e')](_0x99bbf2[_0x9a8b('0x1b')],{'showHidden':![],'depth':null}));}})[_0x9a8b('0x50')](function(_0x177726){return logger['error']('SmsMessage,\x20%s,\x20%s,\x20%s',_0x9a8b('0x2d'),'csc',util[_0x9a8b('0x2e')](_0x177726,{'showHidden':![],'depth':null}));});}else{logger['error'](_0x9a8b('0x2c'),_0x9a8b('0x2d'),_0x9a8b('0x5c'),_0x9a8b('0x67'));}break;case _0x9a8b('0x68'):if(_0x5cdfc3[_0x9a8b('0x5e')]){var _0x301f1f={'method':_0x9a8b('0x3a'),'uri':_0x9a8b('0x69'),'headers':{'Authorization':_0x5cdfc3[_0x9a8b('0x5e')]},'body':{'content':_0x642611['body'],'to':[_0x642611[_0x9a8b('0x26')]],'from':_0x5cdfc3[_0x9a8b('0x26')],'binary':![],'clientMessageId':_0x9a8b('0x6a'),'charset':_0x9a8b('0x6b')},'json':!![]};rp(_0x301f1f)[_0x9a8b('0x19')](function(_0x31640b){if(!_0x31640b['error']){var _0x373520={'messageId':_0x31640b[_0x9a8b('0x24')][0x0][_0x9a8b('0x6c')]};if(!_0x5cdfc3['deliveryReport']){_0x373520[_0x9a8b('0x42')]=!![];}return _0x8e0517[_0x9a8b('0x1a')](_0x373520);}else{return logger[_0x9a8b('0x1b')](_0x9a8b('0x2c'),_0x9a8b('0x2d'),_0x9a8b('0x68'),util[_0x9a8b('0x2e')](_0x31640b[_0x9a8b('0x1b')],{'showHidden':![],'depth':null}));}})[_0x9a8b('0x50')](function(_0x858f6a){return logger['error'](_0x9a8b('0x2c'),'afterCreate',_0x9a8b('0x68'),util[_0x9a8b('0x2e')](_0x858f6a,{'showHidden':![],'depth':null}));});}else{logger['error'](_0x9a8b('0x2c'),_0x9a8b('0x2d'),_0x9a8b('0x68'),_0x9a8b('0x67'));}break;case _0x9a8b('0x6d'):if(_0x5cdfc3[_0x9a8b('0x32')]&&_0x5cdfc3[_0x9a8b('0x33')]){var _0x4f3043=util[_0x9a8b('0x45')](_0x9a8b('0x46'),_0x5cdfc3[_0x9a8b('0x32')],_0x5cdfc3[_0x9a8b('0x33')]);var _0x306a38={'method':_0x9a8b('0x3a'),'uri':_0x9a8b('0x6e')+_0x5cdfc3['accountId']+_0x9a8b('0x6f'),'body':{'to':[_0x642611[_0x9a8b('0x26')]],'text':_0x642611[_0x9a8b('0x10')],'from':_0x5cdfc3[_0x9a8b('0x26')],'applicationId':_0x5cdfc3['applicationId']},'headers':{'Authorization':util[_0x9a8b('0x45')](_0x9a8b('0x48'),new Buffer(_0x4f3043)[_0x9a8b('0x49')](_0x9a8b('0x4a')))},'json':!![]};rp(_0x306a38)[_0x9a8b('0x19')](function(_0x1b536c){if(_0x1b536c['id']){var _0x14e679={'messageId':_0x1b536c['id']};return _0x8e0517[_0x9a8b('0x1a')](_0x14e679);}else{logger['error'](_0x9a8b('0x2c'),'afterCreate',_0x9a8b('0x6d'),util[_0x9a8b('0x2e')](_0x1b536c,{'showHidden':![],'depth':null}));}})[_0x9a8b('0x50')](function(_0x17d8e4){logger[_0x9a8b('0x1b')](_0x9a8b('0x2c'),_0x9a8b('0x2d'),_0x9a8b('0x6d'),util['inspect'](_0x17d8e4,{'showHidden':![],'depth':null}));});}else{logger[_0x9a8b('0x1b')](_0x9a8b('0x2c'),_0x9a8b('0x2d'),_0x9a8b('0x6d'),_0x9a8b('0x3f'));}break;case _0x9a8b('0x70'):if(_0x5cdfc3[_0x9a8b('0x5e')]){var _0x1a686={};var _0x2b79d4={'method':_0x9a8b('0x3a'),'uri':'https://api.intelepeer.com/_rest/v4/app/sms/send','headers':{'Authorization':'Bearer\x20'+_0x5cdfc3[_0x9a8b('0x5e')],'Content-Type':'application/json'},'body':{'from':_0x5cdfc3[_0x9a8b('0x26')],'to':_0x642611['phone'],'text':_0x642611['body']},'json':!![]};return rp(_0x2b79d4)['then'](function(_0x1fddc2){if(_0x1fddc2['code']==0xca){_0x1a686['message']=_0x1fddc2;var _0x37aaad={'method':_0x9a8b('0x3a'),'uri':_0x9a8b('0x71'),'headers':{'Authorization':_0x9a8b('0x72')+_0x5cdfc3['apiKey'],'Content-Type':_0x9a8b('0x73')},'body':{'refid':_0x1a686[_0x9a8b('0x74')]['refid']},'json':!![]};return rp(_0x37aaad)['then'](function(_0x6bf034){_0x1a686[_0x9a8b('0x75')]=_0x6bf034;var _0x1e5519={'messageId':_0x1a686[_0x9a8b('0x74')][_0x9a8b('0x76')],'read':!![]};return _0x8e0517[_0x9a8b('0x1a')](_0x1e5519);});}else{return logger[_0x9a8b('0x1b')](_0x9a8b('0x2c'),_0x9a8b('0x2d'),_0x9a8b('0x70'),util[_0x9a8b('0x2e')](_0x1fddc2,{'showHidden':![],'depth':null}));}})[_0x9a8b('0x50')](function(_0x1a011e){return logger['error'](_0x9a8b('0x2c'),'afterCreate',_0x9a8b('0x70'),util[_0x9a8b('0x2e')](_0x1a011e,{'showHidden':![],'depth':null}));});}else{return logger[_0x9a8b('0x1b')](_0x9a8b('0x2c'),_0x9a8b('0x2d'),_0x9a8b('0x70'),_0x9a8b('0x77'));}break;}}})[_0x9a8b('0x78')](function(){_0x1b873e();});}else{_0x1b873e();}}},'charset':_0x9a8b('0x79'),'collate':_0x9a8b('0x7a')});}; \ No newline at end of file +var _0xcd1b=['api','moment','bluebird','path','./smsMessage.attributes','exports','define','SmsMessage','sms_messages','messageId','fti_sms_messages','body','FULLTEXT','models','get','direction','toLowerCase','secret','isNil','UserId','SmsInteraction','findOne','SmsInteractionId','then','update','createdAt','catch','error','out','find','SmsAccountId','type','twilio','authToken','phone','messages','create','remote','/status?token=','sid','afterCreate','inspect','SmsMessage,\x20%s,\x20%s,\x20%s','skebby','password','smsMethod','username','&password=','GET','split','sms','POST','user_key','session_key','total_sent','read','Missing\x20parameters:\x20username,\x20password','connectel','senderString','requestid','deliveryReport','clicksend','xCALLY\x20Motion','format','%s:%s','Basic\x20%s','toString','http_code','data','queued_count','head','message_id','clickSend','plivo','authId','/api/sms/messages/','token','https://api.plivo.com/v1/Account/%s/Message/','base64','Missing\x20parameters:\x20authId,\x20authToken','baseUrl','/auth/1/session','/sms/2/text/advanced','application/json','IBSSO\x20','infobip','Missing\x20parameters:\x20base_url','csc','crypto','apiKey','login','sender','text','keys','sort','createHash','md5','digest','hex','id_sms','Missing\x20parameters:\x20apiKey','clickatell','https://platform.clickatell.com/messages','uuid','UTF-8','apiMessageId','bandwidth','https://messaging.bandwidth.com/api/v2/users/','accountId','applicationId','intelepeer','https://api.intelepeer.com/_rest/v4/app/sms/send','code','message','https://api.intelepeer.com/_rest/v4/app/sms/mdr','refid','status','Token\x20not\x20received','finally','utf8mb4','lodash'];(function(_0x443b1e,_0xf7ffe9){var _0x3beb6f=function(_0x1cd133){while(--_0x1cd133){_0x443b1e['push'](_0x443b1e['shift']());}};_0x3beb6f(++_0xf7ffe9);}(_0xcd1b,0x16a));var _0xbcd1=function(_0x1a7da8,_0xb46af5){_0x1a7da8=_0x1a7da8-0x0;var _0x1841fd=_0xcd1b[_0x1a7da8];return _0x1841fd;};'use strict';var _=require(_0xbcd1('0x0'));var util=require('util');var logger=require('../../config/logger')(_0xbcd1('0x1'));var moment=require(_0xbcd1('0x2'));var BPromise=require(_0xbcd1('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xbcd1('0x4'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0xbcd1('0x5'));module[_0xbcd1('0x6')]=function(_0x487e8c,_0x5c9cc0){return _0x487e8c[_0xbcd1('0x7')](_0xbcd1('0x8'),attributes,{'tableName':_0xbcd1('0x9'),'paranoid':![],'indexes':[{'name':_0xbcd1('0xa'),'fields':[_0xbcd1('0xa')]},{'name':_0xbcd1('0xb'),'fields':[_0xbcd1('0xc')],'type':_0xbcd1('0xd')}],'timestamps':!![],'hooks':{'afterCreate':function(_0x383071,_0x5b23e2,_0x2946ec){var _0x54e7c2=_0x487e8c[_0xbcd1('0xe')];var _0x19a58e=_0x383071[_0xbcd1('0xf')]({'plain':!![]});if(_0x19a58e[_0xbcd1('0x10')]['toLowerCase']()==='in'||_0x19a58e['direction'][_0xbcd1('0x11')]()==='out'&&!_0x19a58e[_0xbcd1('0x12')]&&!_[_0xbcd1('0x13')](_0x19a58e[_0xbcd1('0x14')])&&!_[_0xbcd1('0x13')](_0x19a58e['SmsInteractionId'])){_0x54e7c2[_0xbcd1('0x15')][_0xbcd1('0x16')]({'where':{'id':_0x19a58e[_0xbcd1('0x17')]}})[_0xbcd1('0x18')](function(_0x45799f){if(_0x45799f){_0x45799f[_0xbcd1('0x19')]({'lastMsgAt':_0x19a58e[_0xbcd1('0x1a')],'lastMsgDirection':_0x19a58e[_0xbcd1('0x10')][_0xbcd1('0x11')]()});}})[_0xbcd1('0x1b')](function(_0x2937d1){console[_0xbcd1('0x1c')](_0x2937d1);});}if(_0x19a58e[_0xbcd1('0x10')]===_0xbcd1('0x1d')&&!_0x19a58e[_0xbcd1('0x12')]){var _0x12da8f;_0x54e7c2['SmsAccount'][_0xbcd1('0x1e')]({'where':{'id':_0x19a58e[_0xbcd1('0x1f')]},'raw':!![]})['then'](function(_0x586bc4){_0x12da8f=_0x586bc4;if(_0x12da8f&&_0x12da8f[_0xbcd1('0x20')]){switch(_0x12da8f[_0xbcd1('0x20')]){case _0xbcd1('0x21'):var _0x2d2fbc=require(_0xbcd1('0x21'));if(_0x12da8f['accountSid']&&_0x12da8f[_0xbcd1('0x22')]&&_0x12da8f[_0xbcd1('0x23')]){var _0x1d7bcc=new _0x2d2fbc(_0x12da8f['accountSid'],_0x12da8f[_0xbcd1('0x22')]);_0x1d7bcc[_0xbcd1('0x24')][_0xbcd1('0x25')]({'body':_0x19a58e[_0xbcd1('0xc')],'to':_0x19a58e[_0xbcd1('0x23')],'from':_0x12da8f[_0xbcd1('0x23')],'statusCallback':_0x12da8f[_0xbcd1('0x26')]+'/api/sms/messages/'+_0x19a58e['id']+_0xbcd1('0x27')+_0x12da8f['token']})[_0xbcd1('0x18')](function(_0x9b2fac){if(_0x9b2fac['sid']){return _0x383071['update']({'messageId':_0x9b2fac[_0xbcd1('0x28')]});}})[_0xbcd1('0x1b')](function(_0x5ec6f7){logger[_0xbcd1('0x1c')]('SmsMessage,\x20%s,\x20%s,\x20%s',_0xbcd1('0x29'),'twilio',util[_0xbcd1('0x2a')](_0x5ec6f7,{'showHidden':![],'depth':null}));});}else{logger['error'](_0xbcd1('0x2b'),_0xbcd1('0x29'),_0xbcd1('0x21'),'Missing\x20parameters:\x20phone,\x20accountSid\x20or\x20authToken');}break;case _0xbcd1('0x2c'):var _0x5b9ae1='https://api.skebby.it/API/v1.0/REST/';if(_0x12da8f['username']&&_0x12da8f[_0xbcd1('0x2d')]){var _0x47900d={'recipient':[_0x19a58e[_0xbcd1('0x23')]],'message':_0x19a58e[_0xbcd1('0xc')],'message_type':_0x12da8f[_0xbcd1('0x2e')]};if(_0x12da8f[_0xbcd1('0x2e')]&&_0x12da8f[_0xbcd1('0x2e')]!=='SI'){_0x47900d['sender']=_0x12da8f['phone'];}var _0x105488={'url':_0x5b9ae1+'login?username='+_0x12da8f[_0xbcd1('0x2f')]+_0xbcd1('0x30')+_0x12da8f[_0xbcd1('0x2d')],'method':_0xbcd1('0x31')};rp(_0x105488)[_0xbcd1('0x18')](function(_0x20bb25){var _0x41edb5=_0x20bb25[_0xbcd1('0x32')](';');var _0x3c8091={'user_key':_0x41edb5[0x0],'session_key':_0x41edb5[0x1]};_0x105488={'url':_0x5b9ae1+_0xbcd1('0x33'),'method':_0xbcd1('0x34'),'headers':{'user_key':_0x3c8091[_0xbcd1('0x35')],'Session_key':_0x3c8091[_0xbcd1('0x36')]},'json':!![],'body':_0x47900d};return rp(_0x105488);})[_0xbcd1('0x18')](function(_0x53a59e){if(_0x53a59e[_0xbcd1('0x37')]>=0x1){var _0x11a350={'messageId':_0x53a59e['internal_order_id']};if(_0x12da8f[_0xbcd1('0x2e')]!=='GP'||!_0x12da8f['deliveryReport']){_0x11a350[_0xbcd1('0x38')]=!![];}return _0x383071['update'](_0x11a350);}else{return logger[_0xbcd1('0x1c')]('SmsMessage,\x20%s,\x20%s,\x20%s',_0xbcd1('0x29'),_0xbcd1('0x2c'),util[_0xbcd1('0x2a')](_0x53a59e,{'showHidden':![],'depth':null}));}})['catch'](function(_0x536598){return logger[_0xbcd1('0x1c')](_0xbcd1('0x2b'),_0xbcd1('0x29'),_0xbcd1('0x2c'),util['inspect'](_0x536598,{'showHidden':![],'depth':null}));});}else{logger['error'](_0xbcd1('0x2b'),_0xbcd1('0x29'),'skebby',_0xbcd1('0x39'));}break;case _0xbcd1('0x3a'):if(_0x12da8f[_0xbcd1('0x22')]){var _0x34bcfa={'recipient':_0x19a58e[_0xbcd1('0x23')],'message':_0x19a58e[_0xbcd1('0xc')],'sender':_0x12da8f[_0xbcd1('0x3b')]||_0x12da8f['phone'],'authorization':_0x12da8f[_0xbcd1('0x22')]};var _0x5b23e2={'method':_0xbcd1('0x34'),'uri':'https://smsapi.connectel.se/api/v2/send/','body':_0x34bcfa,'json':!![]};rp(_0x5b23e2)['then'](function(_0x70107e){var _0x33209f={'messageId':_0x70107e[_0xbcd1('0x3c')]};if(!_0x12da8f[_0xbcd1('0x3d')]){_0x33209f[_0xbcd1('0x38')]=!![];}return _0x383071[_0xbcd1('0x19')](_0x33209f);})[_0xbcd1('0x1b')](function(_0x9a8648){logger['error']('SmsMessage,\x20%s,\x20%s,\x20%s',_0xbcd1('0x29'),_0xbcd1('0x3a'),util[_0xbcd1('0x2a')](_0x9a8648,{'showHidden':![],'depth':null}));});}else{logger[_0xbcd1('0x1c')](_0xbcd1('0x2b'),_0xbcd1('0x29'),_0xbcd1('0x3a'),'Missing\x20parameters:\x20authToken');}break;case _0xbcd1('0x3e'):if(_0x12da8f[_0xbcd1('0x2f')]&&_0x12da8f[_0xbcd1('0x2d')]){var _0x34bcfa={'messages':[{'source':_0xbcd1('0x3f'),'to':_0x19a58e[_0xbcd1('0x23')],'body':_0x19a58e[_0xbcd1('0xc')],'from':_0x12da8f[_0xbcd1('0x3b')]||_0x12da8f[_0xbcd1('0x23')]}]};var _0x38419d=util[_0xbcd1('0x40')](_0xbcd1('0x41'),_0x12da8f[_0xbcd1('0x2f')],_0x12da8f[_0xbcd1('0x2d')]);var _0x5b23e2={'method':_0xbcd1('0x34'),'uri':'https://rest.clicksend.com/v3/sms/send','body':_0x34bcfa,'headers':{'Authorization':util['format'](_0xbcd1('0x42'),new Buffer(_0x38419d)[_0xbcd1('0x43')]('base64'))},'json':!![]};rp(_0x5b23e2)[_0xbcd1('0x18')](function(_0x35c871){if(_0x35c871['http_code']>=0xc8&&_0x35c871[_0xbcd1('0x44')]<=0xce){if(_0x35c871[_0xbcd1('0x45')]&&_0x35c871[_0xbcd1('0x45')][_0xbcd1('0x46')]>0x0){var _0x1d5956=_[_0xbcd1('0x47')](_0x35c871[_0xbcd1('0x45')][_0xbcd1('0x24')]);var _0x1190c9={'messageId':_0x1d5956[_0xbcd1('0x48')]};if(!_0x12da8f[_0xbcd1('0x3d')]){_0x1190c9[_0xbcd1('0x38')]=!![];}return _0x383071[_0xbcd1('0x19')](_0x1190c9);}else{logger['error'](_0xbcd1('0x2b'),'afterCreate',_0xbcd1('0x49'),util[_0xbcd1('0x2a')](_0x35c871,{'showHidden':![],'depth':null}));}}else{logger['error'](_0xbcd1('0x2b'),'afterCreate',_0xbcd1('0x49'),util[_0xbcd1('0x2a')](_0x35c871,{'showHidden':![],'depth':null}));}})['catch'](function(_0x20ffe2){logger[_0xbcd1('0x1c')]('SmsMessage,\x20%s,\x20%s,\x20%s',_0xbcd1('0x29'),_0xbcd1('0x49'),util[_0xbcd1('0x2a')](_0x20ffe2,{'showHidden':![],'depth':null}));});}else{logger[_0xbcd1('0x1c')](_0xbcd1('0x2b'),_0xbcd1('0x29'),'clickSend',_0xbcd1('0x39'));}break;case _0xbcd1('0x4a'):if(_0x12da8f[_0xbcd1('0x4b')]&&_0x12da8f['authToken']){var _0x34bcfa={'dst':_0x19a58e[_0xbcd1('0x23')],'text':_0x19a58e[_0xbcd1('0xc')],'src':_0x12da8f[_0xbcd1('0x3b')]||_0x12da8f[_0xbcd1('0x23')],'url':_0x12da8f[_0xbcd1('0x26')]+_0xbcd1('0x4c')+_0x19a58e['id']+'/status?token='+_0x12da8f[_0xbcd1('0x4d')]};var _0x38419d=util['format']('%s:%s',_0x12da8f[_0xbcd1('0x4b')],_0x12da8f[_0xbcd1('0x22')]);var _0x5b23e2={'method':_0xbcd1('0x34'),'uri':util[_0xbcd1('0x40')](_0xbcd1('0x4e'),_0x12da8f[_0xbcd1('0x4b')]),'body':_0x34bcfa,'headers':{'Authorization':util['format'](_0xbcd1('0x42'),new Buffer(_0x38419d)[_0xbcd1('0x43')](_0xbcd1('0x4f')))},'json':!![]};rp(_0x5b23e2)[_0xbcd1('0x18')](function(_0x1c7c86){var _0x23b9f8={'messageId':_0x1c7c86['message_uuid'][0x0]};return _0x383071[_0xbcd1('0x19')](_0x23b9f8);})[_0xbcd1('0x1b')](function(_0x5ecfc2){logger[_0xbcd1('0x1c')](_0xbcd1('0x2b'),_0xbcd1('0x29'),_0xbcd1('0x4a'),util[_0xbcd1('0x2a')](_0x5ecfc2,{'showHidden':![],'depth':null}));});}else{logger[_0xbcd1('0x1c')](_0xbcd1('0x2b'),_0xbcd1('0x29'),'plivo',_0xbcd1('0x50'));}break;case'infobip':if(_0x12da8f[_0xbcd1('0x2f')]&&_0x12da8f[_0xbcd1('0x2d')]){if(_0x12da8f[_0xbcd1('0x51')]){var _0x53d0bb={'method':'POST','uri':_0x12da8f[_0xbcd1('0x51')]+_0xbcd1('0x52'),'body':{'username':_0x12da8f[_0xbcd1('0x2f')],'password':_0x12da8f['password']},'json':!![]};return rp(_0x53d0bb)[_0xbcd1('0x18')](function(_0x2d2aac){var _0x48687c={'method':_0xbcd1('0x34'),'uri':_0x12da8f[_0xbcd1('0x51')]+_0xbcd1('0x53'),'body':{'messages':[{'from':_0x12da8f[_0xbcd1('0x23')],'destinations':[{'to':_0x19a58e[_0xbcd1('0x23')]}],'text':_0x19a58e[_0xbcd1('0xc')],'notifyUrl':_0x12da8f[_0xbcd1('0x26')]+_0xbcd1('0x4c')+_0x19a58e['id']+'/status?token='+_0x12da8f[_0xbcd1('0x4d')],'notifyContentType':_0xbcd1('0x54'),'callbackData':_0x12da8f[_0xbcd1('0x23')]+';'+_0x19a58e[_0xbcd1('0xc')]}]},'headers':{'Authorization':_0xbcd1('0x55')+_0x2d2aac[_0xbcd1('0x4d')]},'json':!![]};return rp(_0x48687c)[_0xbcd1('0x18')](function(_0x404ee0){if(_0x404ee0[_0xbcd1('0x24')]){var _0x5ab375={'messageId':_0x404ee0[_0xbcd1('0x24')][0x0][_0xbcd1('0xa')]};if(!_0x12da8f[_0xbcd1('0x3d')]){_0x5ab375['read']=!![];}return _0x383071[_0xbcd1('0x19')](_0x5ab375);}else{return logger['error']('SmsMessage,\x20%s,\x20%s,\x20%s',_0xbcd1('0x29'),'infobip',util[_0xbcd1('0x2a')](_0x404ee0,{'showHidden':![],'depth':null}));}});})[_0xbcd1('0x1b')](function(_0x4041a8){return logger[_0xbcd1('0x1c')]('SmsMessage,\x20%s,\x20%s,\x20%s',_0xbcd1('0x29'),_0xbcd1('0x56'),util['inspect'](_0x4041a8,{'showHidden':![],'depth':null}));});}else{logger[_0xbcd1('0x1c')]('SmsMessage,\x20%s,\x20%s,\x20%s',_0xbcd1('0x29'),_0xbcd1('0x56'),_0xbcd1('0x57'));}}else{logger[_0xbcd1('0x1c')]('SmsMessage,\x20%s,\x20%s,\x20%s',_0xbcd1('0x29'),_0xbcd1('0x56'),_0xbcd1('0x39'));}break;case _0xbcd1('0x58'):var _0x1574c6=require(_0xbcd1('0x59'));if(_0x12da8f[_0xbcd1('0x5a')]){var _0x15a486={};_0x15a486[_0xbcd1('0x5b')]=_0x12da8f[_0xbcd1('0x2f')];_0x15a486[_0xbcd1('0x23')]=_0x19a58e[_0xbcd1('0x23')];_0x15a486[_0xbcd1('0x5c')]=_0x12da8f[_0xbcd1('0x23')];_0x15a486[_0xbcd1('0x5d')]=_0x19a58e[_0xbcd1('0xc')];_0x15a486['timestamp']=+new Date();var _0x12dad6='';var _0x52ae4a='';var _0x2b1fff=Object[_0xbcd1('0x5e')](_0x15a486);_0x2b1fff[_0xbcd1('0x5f')]();for(var _0x48df87=0x0;_0x48df87<_0x2b1fff['length'];_0x48df87++){if(_0x12dad6!=''){_0x12dad6+='&';}_0x12dad6+=_0x2b1fff[_0x48df87]+'='+encodeURIComponent(_0x15a486[_0x2b1fff[_0x48df87]]);_0x52ae4a+=_0x15a486[_0x2b1fff[_0x48df87]];}_0x52ae4a+=_0x12da8f[_0xbcd1('0x5a')];_0x52ae4a=_0x1574c6[_0xbcd1('0x60')](_0xbcd1('0x61'))['update'](_0x52ae4a)[_0xbcd1('0x62')](_0xbcd1('0x63'));if(_0x12dad6!==''){_0x12dad6+='&';}_0x12dad6+='signature='+_0x52ae4a;var _0x105488={'method':'GET','uri':_0x12da8f[_0xbcd1('0x51')]+'/external/get/send.php?'+_0x12dad6,'json':!![]};return rp(_0x105488)[_0xbcd1('0x18')](function(_0x2d6971){var _0x1d981d=Object[_0xbcd1('0x5e')](_0x2d6971);if(_0x2d6971[_0x1d981d[0x0]][_0xbcd1('0x1c')]&&parseInt(_0x2d6971[_0x1d981d[0x0]][_0xbcd1('0x1c')])===0x0){var _0x2685fd={'messageId':_0x2d6971[_0x1d981d[0x0]][_0xbcd1('0x64')]};if(!_0x12da8f[_0xbcd1('0x3d')]){_0x2685fd[_0xbcd1('0x38')]=!![];}return _0x383071[_0xbcd1('0x19')](_0x2685fd);}else{return logger[_0xbcd1('0x1c')]('SmsMessage,\x20%s,\x20%s,\x20%s',_0xbcd1('0x29'),'csc',util[_0xbcd1('0x2a')](_0x2d6971[_0xbcd1('0x1c')],{'showHidden':![],'depth':null}));}})[_0xbcd1('0x1b')](function(_0x11729f){return logger[_0xbcd1('0x1c')](_0xbcd1('0x2b'),'afterCreate','csc',util[_0xbcd1('0x2a')](_0x11729f,{'showHidden':![],'depth':null}));});}else{logger[_0xbcd1('0x1c')]('SmsMessage,\x20%s,\x20%s,\x20%s','afterCreate',_0xbcd1('0x58'),_0xbcd1('0x65'));}break;case _0xbcd1('0x66'):if(_0x12da8f[_0xbcd1('0x5a')]){var _0x51228b={'method':'POST','uri':_0xbcd1('0x67'),'headers':{'Authorization':_0x12da8f[_0xbcd1('0x5a')]},'body':{'content':_0x19a58e[_0xbcd1('0xc')],'to':[_0x19a58e[_0xbcd1('0x23')]],'from':_0x12da8f[_0xbcd1('0x23')],'binary':![],'clientMessageId':_0xbcd1('0x68'),'charset':_0xbcd1('0x69')},'json':!![]};rp(_0x51228b)['then'](function(_0x427739){if(!_0x427739['error']){var _0x1126a9={'messageId':_0x427739[_0xbcd1('0x24')][0x0][_0xbcd1('0x6a')]};if(!_0x12da8f['deliveryReport']){_0x1126a9[_0xbcd1('0x38')]=!![];}return _0x383071[_0xbcd1('0x19')](_0x1126a9);}else{return logger['error'](_0xbcd1('0x2b'),_0xbcd1('0x29'),_0xbcd1('0x66'),util[_0xbcd1('0x2a')](_0x427739[_0xbcd1('0x1c')],{'showHidden':![],'depth':null}));}})[_0xbcd1('0x1b')](function(_0x4e8f04){return logger['error'](_0xbcd1('0x2b'),_0xbcd1('0x29'),_0xbcd1('0x66'),util['inspect'](_0x4e8f04,{'showHidden':![],'depth':null}));});}else{logger[_0xbcd1('0x1c')]('SmsMessage,\x20%s,\x20%s,\x20%s',_0xbcd1('0x29'),_0xbcd1('0x66'),'Missing\x20parameters:\x20apiKey');}break;case _0xbcd1('0x6b'):if(_0x12da8f[_0xbcd1('0x2f')]&&_0x12da8f['password']){var _0x38419d=util['format'](_0xbcd1('0x41'),_0x12da8f[_0xbcd1('0x2f')],_0x12da8f[_0xbcd1('0x2d')]);var _0x5b23e2={'method':'POST','uri':_0xbcd1('0x6c')+_0x12da8f[_0xbcd1('0x6d')]+'/messages','body':{'to':[_0x19a58e['phone']],'text':_0x19a58e[_0xbcd1('0xc')],'from':_0x12da8f[_0xbcd1('0x23')],'applicationId':_0x12da8f[_0xbcd1('0x6e')]},'headers':{'Authorization':util[_0xbcd1('0x40')](_0xbcd1('0x42'),new Buffer(_0x38419d)[_0xbcd1('0x43')](_0xbcd1('0x4f')))},'json':!![]};rp(_0x5b23e2)[_0xbcd1('0x18')](function(_0x5cba03){if(_0x5cba03['id']){var _0x4ccc36={'messageId':_0x5cba03['id']};return _0x383071[_0xbcd1('0x19')](_0x4ccc36);}else{logger['error'](_0xbcd1('0x2b'),_0xbcd1('0x29'),'bandwidth',util[_0xbcd1('0x2a')](_0x5cba03,{'showHidden':![],'depth':null}));}})[_0xbcd1('0x1b')](function(_0x542094){logger['error'](_0xbcd1('0x2b'),'afterCreate',_0xbcd1('0x6b'),util['inspect'](_0x542094,{'showHidden':![],'depth':null}));});}else{logger[_0xbcd1('0x1c')]('SmsMessage,\x20%s,\x20%s,\x20%s',_0xbcd1('0x29'),'bandwidth',_0xbcd1('0x39'));}break;case _0xbcd1('0x6f'):if(_0x12da8f[_0xbcd1('0x5a')]){var _0x5a93de={};var _0x105488={'method':_0xbcd1('0x34'),'uri':_0xbcd1('0x70'),'headers':{'Authorization':'Bearer\x20'+_0x12da8f[_0xbcd1('0x5a')],'Content-Type':_0xbcd1('0x54')},'body':{'from':_0x12da8f[_0xbcd1('0x23')],'to':_0x19a58e[_0xbcd1('0x23')],'text':_0x19a58e[_0xbcd1('0xc')]},'json':!![]};return rp(_0x105488)[_0xbcd1('0x18')](function(_0x422ccd){if(_0x422ccd[_0xbcd1('0x71')]==0xca){_0x5a93de[_0xbcd1('0x72')]=_0x422ccd;var _0x1cd145={'method':'POST','uri':_0xbcd1('0x73'),'headers':{'Authorization':'Bearer\x20'+_0x12da8f[_0xbcd1('0x5a')],'Content-Type':_0xbcd1('0x54')},'body':{'refid':_0x5a93de[_0xbcd1('0x72')][_0xbcd1('0x74')]},'json':!![]};return rp(_0x1cd145)[_0xbcd1('0x18')](function(_0x2cd90e){_0x5a93de[_0xbcd1('0x75')]=_0x2cd90e;var _0x72b511={'messageId':_0x5a93de[_0xbcd1('0x72')][_0xbcd1('0x74')],'read':!![]};return _0x383071[_0xbcd1('0x19')](_0x72b511);});}else{return logger[_0xbcd1('0x1c')]('SmsMessage,\x20%s,\x20%s,\x20%s','afterCreate',_0xbcd1('0x6f'),util['inspect'](_0x422ccd,{'showHidden':![],'depth':null}));}})['catch'](function(_0x491049){return logger[_0xbcd1('0x1c')](_0xbcd1('0x2b'),_0xbcd1('0x29'),_0xbcd1('0x6f'),util[_0xbcd1('0x2a')](_0x491049,{'showHidden':![],'depth':null}));});}else{return logger[_0xbcd1('0x1c')]('SmsMessage,\x20%s,\x20%s,\x20%s',_0xbcd1('0x29'),'intelepeer',_0xbcd1('0x76'));}break;}}})[_0xbcd1('0x77')](function(){_0x2946ec();});}else{_0x2946ec();}}},'charset':_0xbcd1('0x78'),'collate':'utf8mb4_unicode_ci'});}; \ No newline at end of file diff --git a/server/api/smsMessage/smsMessage.rpc.js b/server/api/smsMessage/smsMessage.rpc.js index 39ddf34..4826d99 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 _0xed0f=['moment','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','defaults','redis','socket.io-emitter','register','request','then','info','SmsMessage,\x20%s,\x20%s','request\x20sent','SmsMessage,\x20%s,\x20%s,\x20%s','error','message','result','catch','CreateSmsMessage','SmsMessage','body','options','raw','lodash','util'];(function(_0x55387b,_0x85625b){var _0x2a376d=function(_0x22e575){while(--_0x22e575){_0x55387b['push'](_0x55387b['shift']());}};_0x2a376d(++_0x85625b);}(_0xed0f,0x1c0));var _0xfed0=function(_0x799387,_0x29efec){_0x799387=_0x799387-0x0;var _0x1309e0=_0xed0f[_0x799387];return _0x1309e0;};'use strict';var _=require(_0xfed0('0x0'));var util=require(_0xfed0('0x1'));var moment=require(_0xfed0('0x2'));var BPromise=require('bluebird');var rs=require(_0xfed0('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xfed0('0x4'))['db'];var utils=require(_0xfed0('0x5'));var logger=require(_0xfed0('0x6'))(_0xfed0('0x7'));var config=require(_0xfed0('0x8'));var jayson=require(_0xfed0('0x9'));var client=jayson[_0xfed0('0xa')]['http']({'port':0x232a});config['redis']=_[_0xfed0('0xb')](config[_0xfed0('0xc')],{'host':'localhost','port':0x18eb});var socket=require(_0xfed0('0xd'))(new Redis(config['redis']));require('./smsMessage.socket')[_0xfed0('0xe')](socket);function respondWithRpcPromise(_0x27ff16,_0xbf7cdf,_0x24f188){return new BPromise(function(_0x556a8b,_0x464c47){return client[_0xfed0('0xf')](_0x27ff16,_0x24f188)[_0xfed0('0x10')](function(_0x3cdfc0){logger[_0xfed0('0x11')](_0xfed0('0x12'),_0xbf7cdf,_0xfed0('0x13'));logger['debug'](_0xfed0('0x14'),_0xbf7cdf,'request\x20sent',JSON['stringify'](_0x3cdfc0));if(_0x3cdfc0[_0xfed0('0x15')]){if(_0x3cdfc0[_0xfed0('0x15')]['code']===0x1f4){logger[_0xfed0('0x15')](_0xfed0('0x12'),_0xbf7cdf,_0x3cdfc0[_0xfed0('0x15')][_0xfed0('0x16')]);return _0x464c47(_0x3cdfc0['error']['message']);}logger[_0xfed0('0x15')](_0xfed0('0x12'),_0xbf7cdf,_0x3cdfc0['error'][_0xfed0('0x16')]);return _0x556a8b(_0x3cdfc0['error']['message']);}else{logger['info'](_0xfed0('0x12'),_0xbf7cdf,'request\x20sent');_0x556a8b(_0x3cdfc0[_0xfed0('0x17')][_0xfed0('0x16')]);}})[_0xfed0('0x18')](function(_0x121e5f){logger[_0xfed0('0x15')](_0xfed0('0x12'),_0xbf7cdf,_0x121e5f);_0x464c47(_0x121e5f);});});}exports[_0xfed0('0x19')]=function(_0x12d3d2){var _0x4e82b3=this;return new Promise(function(_0x316e66,_0x4d66a9){return db[_0xfed0('0x1a')]['create'](_0x12d3d2[_0xfed0('0x1b')],{'raw':_0x12d3d2[_0xfed0('0x1c')]?_0x12d3d2[_0xfed0('0x1c')][_0xfed0('0x1d')]===undefined?!![]:![]:!![]})['then'](function(_0x581d7d){logger[_0xfed0('0x11')](_0xfed0('0x19'),_0x12d3d2);logger['debug'](_0xfed0('0x19'),_0x12d3d2,JSON['stringify'](_0x581d7d));_0x316e66(_0x581d7d);})['catch'](function(_0x228f0e){logger['error'](_0xfed0('0x19'),_0x228f0e[_0xfed0('0x16')],_0x12d3d2);_0x4d66a9(_0x4e82b3['error'](0x1f4,_0x228f0e[_0xfed0('0x16')]));});});}; \ No newline at end of file +var _0xe261=['SmsMessage,\x20%s,\x20%s','request\x20sent','debug','SmsMessage,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','CreateSmsMessage','options','raw','catch','util','moment','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','redis','defaults','socket.io-emitter','register','request','then','info'];(function(_0x2cfb58,_0x3d9412){var _0xd99951=function(_0x329afa){while(--_0x329afa){_0x2cfb58['push'](_0x2cfb58['shift']());}};_0xd99951(++_0x3d9412);}(_0xe261,0x11b));var _0x1e26=function(_0x382595,_0x2b1352){_0x382595=_0x382595-0x0;var _0x6599e0=_0xe261[_0x382595];return _0x6599e0;};'use strict';var _=require('lodash');var util=require(_0x1e26('0x0'));var moment=require(_0x1e26('0x1'));var BPromise=require('bluebird');var rs=require(_0x1e26('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x1e26('0x3'))['db'];var utils=require(_0x1e26('0x4'));var logger=require(_0x1e26('0x5'))(_0x1e26('0x6'));var config=require('../../config/environment');var jayson=require(_0x1e26('0x7'));var client=jayson[_0x1e26('0x8')][_0x1e26('0x9')]({'port':0x232a});config[_0x1e26('0xa')]=_[_0x1e26('0xb')](config[_0x1e26('0xa')],{'host':'localhost','port':0x18eb});var socket=require(_0x1e26('0xc'))(new Redis(config[_0x1e26('0xa')]));require('./smsMessage.socket')[_0x1e26('0xd')](socket);function respondWithRpcPromise(_0x586022,_0x5aa1ac,_0x8d2e7a){return new BPromise(function(_0x5afc15,_0x43c96e){return client[_0x1e26('0xe')](_0x586022,_0x8d2e7a)[_0x1e26('0xf')](function(_0x176ef0){logger[_0x1e26('0x10')](_0x1e26('0x11'),_0x5aa1ac,_0x1e26('0x12'));logger[_0x1e26('0x13')](_0x1e26('0x14'),_0x5aa1ac,_0x1e26('0x12'),JSON[_0x1e26('0x15')](_0x176ef0));if(_0x176ef0[_0x1e26('0x16')]){if(_0x176ef0[_0x1e26('0x16')][_0x1e26('0x17')]===0x1f4){logger[_0x1e26('0x16')](_0x1e26('0x11'),_0x5aa1ac,_0x176ef0[_0x1e26('0x16')][_0x1e26('0x18')]);return _0x43c96e(_0x176ef0[_0x1e26('0x16')][_0x1e26('0x18')]);}logger[_0x1e26('0x16')](_0x1e26('0x11'),_0x5aa1ac,_0x176ef0[_0x1e26('0x16')][_0x1e26('0x18')]);return _0x5afc15(_0x176ef0[_0x1e26('0x16')][_0x1e26('0x18')]);}else{logger[_0x1e26('0x10')](_0x1e26('0x11'),_0x5aa1ac,_0x1e26('0x12'));_0x5afc15(_0x176ef0[_0x1e26('0x19')][_0x1e26('0x18')]);}})['catch'](function(_0x3f8231){logger[_0x1e26('0x16')](_0x1e26('0x11'),_0x5aa1ac,_0x3f8231);_0x43c96e(_0x3f8231);});});}exports[_0x1e26('0x1a')]=function(_0x4942fc){var _0xb7fe5d=this;return new Promise(function(_0x30a924,_0x252848){return db['SmsMessage']['create'](_0x4942fc['body'],{'raw':_0x4942fc[_0x1e26('0x1b')]?_0x4942fc[_0x1e26('0x1b')][_0x1e26('0x1c')]===undefined?!![]:![]:!![]})[_0x1e26('0xf')](function(_0x3f642b){logger[_0x1e26('0x10')](_0x1e26('0x1a'),_0x4942fc);logger[_0x1e26('0x13')](_0x1e26('0x1a'),_0x4942fc,JSON['stringify'](_0x3f642b));_0x30a924(_0x3f642b);})[_0x1e26('0x1d')](function(_0x5df4dd){logger[_0x1e26('0x16')](_0x1e26('0x1a'),_0x5df4dd['message'],_0x4942fc);_0x252848(_0xb7fe5d[_0x1e26('0x16')](0x1f4,_0x5df4dd[_0x1e26('0x18')]));});});}; \ No newline at end of file diff --git a/server/api/smsMessage/smsMessage.socket.js b/server/api/smsMessage/smsMessage.socket.js index 4e1f170..f65c0f6 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 _0xabb4=['register','length','./smsMessage.events','remove','update','emit','removeListener'];(function(_0x266ac7,_0x1d3ea9){var _0x3eb0f1=function(_0x50648f){while(--_0x50648f){_0x266ac7['push'](_0x266ac7['shift']());}};_0x3eb0f1(++_0x1d3ea9);}(_0xabb4,0x79));var _0x4abb=function(_0x55be64,_0x3bc0e9){_0x55be64=_0x55be64-0x0;var _0x434049=_0xabb4[_0x55be64];return _0x434049;};'use strict';var SmsMessageEvents=require(_0x4abb('0x0'));var events=['save',_0x4abb('0x1'),_0x4abb('0x2')];function createListener(_0x2a70ce,_0x40a89a){return function(_0x6b1d24){_0x40a89a[_0x4abb('0x3')](_0x2a70ce,_0x6b1d24);};}function removeListener(_0x7fec11,_0x5a2e5c){return function(){SmsMessageEvents[_0x4abb('0x4')](_0x7fec11,_0x5a2e5c);};}exports[_0x4abb('0x5')]=function(_0x4526d7){for(var _0x3e6237=0x0,_0x275a2b=events[_0x4abb('0x6')];_0x3e6237<_0x275a2b;_0x3e6237++){var _0x5b5478=events[_0x3e6237];var _0x589803=createListener('smsMessage:'+_0x5b5478,_0x4526d7);SmsMessageEvents['on'](_0x5b5478,_0x589803);}}; \ No newline at end of file +var _0x0282=['removeListener','register','length','smsMessage:','./smsMessage.events','save','remove'];(function(_0x2de322,_0x2c601b){var _0x54ba40=function(_0x50a5a1){while(--_0x50a5a1){_0x2de322['push'](_0x2de322['shift']());}};_0x54ba40(++_0x2c601b);}(_0x0282,0x1ee));var _0x2028=function(_0x392ef5,_0x4a18e8){_0x392ef5=_0x392ef5-0x0;var _0x2990e1=_0x0282[_0x392ef5];return _0x2990e1;};'use strict';var SmsMessageEvents=require(_0x2028('0x0'));var events=[_0x2028('0x1'),_0x2028('0x2'),'update'];function createListener(_0x10c83c,_0x1c79c3){return function(_0x3617b0){_0x1c79c3['emit'](_0x10c83c,_0x3617b0);};}function removeListener(_0x5803da,_0x40e397){return function(){SmsMessageEvents[_0x2028('0x3')](_0x5803da,_0x40e397);};}exports[_0x2028('0x4')]=function(_0x9a9b16){for(var _0x266b25=0x0,_0x343f80=events[_0x2028('0x5')];_0x266b25<_0x343f80;_0x266b25++){var _0x392c1d=events[_0x266b25];var _0x35daa6=createListener(_0x2028('0x6')+_0x392c1d,_0x9a9b16);SmsMessageEvents['on'](_0x392c1d,_0x35daa6);}}; \ No newline at end of file diff --git a/server/api/smsQueue/index.js b/server/api/smsQueue/index.js index fcae8f8..a180e25 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 _0x8aa3=['delete','destroy','removeTeams','removeAgents','exports','util','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./smsQueue.controller','get','index','/describe','describe','/:id','isAuthenticated','show','/:id/members','/:id/teams','/:id/users','getAgents','post','create','addTeams','addAgents','put','update'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0x8aa3,0xde));var _0x38aa=function(_0x5b028c,_0x23dfd5){_0x5b028c=_0x5b028c-0x0;var _0x209095=_0x8aa3[_0x5b028c];return _0x209095;};'use strict';var multer=require('multer');var util=require(_0x38aa('0x0'));var path=require('path');var timeout=require(_0x38aa('0x1'));var express=require(_0x38aa('0x2'));var router=express[_0x38aa('0x3')]();var fs_extra=require(_0x38aa('0x4'));var auth=require(_0x38aa('0x5'));var interaction=require(_0x38aa('0x6'));var config=require(_0x38aa('0x7'));var controller=require(_0x38aa('0x8'));router[_0x38aa('0x9')]('/',auth['isAuthenticated'](),controller[_0x38aa('0xa')]);router[_0x38aa('0x9')](_0x38aa('0xb'),auth['isAuthenticated'](),controller[_0x38aa('0xc')]);router[_0x38aa('0x9')](_0x38aa('0xd'),auth[_0x38aa('0xe')](),controller[_0x38aa('0xf')]);router[_0x38aa('0x9')](_0x38aa('0x10'),auth[_0x38aa('0xe')](),controller['getMembers']);router[_0x38aa('0x9')](_0x38aa('0x11'),auth[_0x38aa('0xe')](),controller['getTeams']);router[_0x38aa('0x9')](_0x38aa('0x12'),auth[_0x38aa('0xe')](),controller[_0x38aa('0x13')]);router[_0x38aa('0x14')]('/',auth['isAuthenticated'](),controller[_0x38aa('0x15')]);router[_0x38aa('0x14')]('/:id/teams',auth[_0x38aa('0xe')](),controller[_0x38aa('0x16')]);router[_0x38aa('0x14')](_0x38aa('0x12'),auth[_0x38aa('0xe')](),controller[_0x38aa('0x17')]);router[_0x38aa('0x18')](_0x38aa('0xd'),auth[_0x38aa('0xe')](),controller[_0x38aa('0x19')]);router[_0x38aa('0x1a')]('/:id',auth[_0x38aa('0xe')](),controller[_0x38aa('0x1b')]);router[_0x38aa('0x1a')](_0x38aa('0x11'),auth['isAuthenticated'](),controller[_0x38aa('0x1c')]);router['delete']('/:id/users',auth['isAuthenticated'](),controller[_0x38aa('0x1d')]);module[_0x38aa('0x1e')]=router; \ No newline at end of file +var _0x6302=['removeAgents','exports','multer','path','connect-timeout','fs-extra','../../components/auth/service','../../components/interaction/service','./smsQueue.controller','index','get','/describe','describe','/:id','isAuthenticated','show','/:id/members','getMembers','/:id/teams','getTeams','/:id/users','getAgents','post','create','addTeams','addAgents','delete','destroy','removeTeams'];(function(_0x30462c,_0x198360){var _0x21bdfa=function(_0x829d91){while(--_0x829d91){_0x30462c['push'](_0x30462c['shift']());}};_0x21bdfa(++_0x198360);}(_0x6302,0x17b));var _0x2630=function(_0x34ac1e,_0x40305a){_0x34ac1e=_0x34ac1e-0x0;var _0x1a42a8=_0x6302[_0x34ac1e];return _0x1a42a8;};'use strict';var multer=require(_0x2630('0x0'));var util=require('util');var path=require(_0x2630('0x1'));var timeout=require(_0x2630('0x2'));var express=require('express');var router=express['Router']();var fs_extra=require(_0x2630('0x3'));var auth=require(_0x2630('0x4'));var interaction=require(_0x2630('0x5'));var config=require('../../config/environment');var controller=require(_0x2630('0x6'));router['get']('/',auth['isAuthenticated'](),controller[_0x2630('0x7')]);router[_0x2630('0x8')](_0x2630('0x9'),auth['isAuthenticated'](),controller[_0x2630('0xa')]);router['get'](_0x2630('0xb'),auth[_0x2630('0xc')](),controller[_0x2630('0xd')]);router[_0x2630('0x8')](_0x2630('0xe'),auth[_0x2630('0xc')](),controller[_0x2630('0xf')]);router['get'](_0x2630('0x10'),auth['isAuthenticated'](),controller[_0x2630('0x11')]);router[_0x2630('0x8')](_0x2630('0x12'),auth['isAuthenticated'](),controller[_0x2630('0x13')]);router[_0x2630('0x14')]('/',auth[_0x2630('0xc')](),controller[_0x2630('0x15')]);router[_0x2630('0x14')](_0x2630('0x10'),auth[_0x2630('0xc')](),controller[_0x2630('0x16')]);router[_0x2630('0x14')](_0x2630('0x12'),auth[_0x2630('0xc')](),controller[_0x2630('0x17')]);router['put']('/:id',auth[_0x2630('0xc')](),controller['update']);router[_0x2630('0x18')](_0x2630('0xb'),auth['isAuthenticated'](),controller[_0x2630('0x19')]);router[_0x2630('0x18')](_0x2630('0x10'),auth[_0x2630('0xc')](),controller[_0x2630('0x1a')]);router[_0x2630('0x18')](_0x2630('0x12'),auth[_0x2630('0xc')](),controller[_0x2630('0x1b')]);module[_0x2630('0x1c')]=router; \ No newline at end of file diff --git a/server/api/smsQueue/smsQueue.attributes.js b/server/api/smsQueue/smsQueue.attributes.js index 5800e72..0aa74b8 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 _0x04a1=['rrmemory','beepall','sequelize','exports','STRING','name','INTEGER'];(function(_0x30eb36,_0x4f7dab){var _0x1b33d1=function(_0x4ab0ff){while(--_0x4ab0ff){_0x30eb36['push'](_0x30eb36['shift']());}};_0x1b33d1(++_0x4f7dab);}(_0x04a1,0x1de));var _0x104a=function(_0x10848c,_0x47f899){_0x10848c=_0x10848c-0x0;var _0x66609e=_0x04a1[_0x10848c];return _0x66609e;};'use strict';var Sequelize=require(_0x104a('0x0'));module[_0x104a('0x1')]={'name':{'type':Sequelize[_0x104a('0x2')],'unique':_0x104a('0x3'),'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize[_0x104a('0x2')]},'timeout':{'type':Sequelize[_0x104a('0x4')],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize['ENUM'](_0x104a('0x5'),_0x104a('0x6'),'roundrobin')}}; \ No newline at end of file +var _0x4299=['ENUM','rrmemory','beepall','roundrobin','name','STRING','INTEGER'];(function(_0x24a140,_0x3dd520){var _0x36b2bc=function(_0x33860d){while(--_0x33860d){_0x24a140['push'](_0x24a140['shift']());}};_0x36b2bc(++_0x3dd520);}(_0x4299,0xc1));var _0x9429=function(_0x3513a0,_0x3bdc88){_0x3513a0=_0x3513a0-0x0;var _0x2bdeb9=_0x4299[_0x3513a0];return _0x2bdeb9;};'use strict';var Sequelize=require('sequelize');module['exports']={'name':{'type':Sequelize['STRING'],'unique':_0x9429('0x0'),'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize[_0x9429('0x1')]},'timeout':{'type':Sequelize[_0x9429('0x2')],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize[_0x9429('0x3')](_0x9429('0x4'),_0x9429('0x5'),_0x9429('0x6'))}}; \ No newline at end of file diff --git a/server/api/smsQueue/smsQueue.controller.js b/server/api/smsQueue/smsQueue.controller.js index 8d45e9d..6034f47 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 _0x0b0e=['userSmsQueue:save','removeTeams','select','field','tq.TeamId','from','team_has_sms_queues','join','clone','ut.UserId\x20=\x20?','push','QueryTypes','every','TeamId','union','value','removeAgents','forEach','userSmsQueue:remove','addAgents','omit','spread','isArray','getAgents','hasOwnProperty','bluebird','lodash','ioredis','../../components/parsers/qs','../../config/logger','api','../../config/environment','../../mysqldb','redis','defaults','localhost','socket.io-emitter','register','status','end','json','offset','undefined','limit','count','set','update','SmsQueues','destroy','then','error','stack','name','send','SmsQueue','fieldName','type','key','getOptions','include','query','findAll','rows','show','model','keys','rawAttributes','filters','intersection','attributes','fields','length','includeAll','merge','options','find','body','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','user','UserProfileSection','userProfileId','autoAssociation','UserProfileResource','create','catch','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','describe','getMembers','params','nolimit','order','sort','where','SmsQueueId','filter','map','UserSmsQueue','User','findAndCountAll','UserId','agent','smsPause','updatedAt','createdAt','%s/%s','SIP','findOne','Team','pick','getTeams','ids','Agents','online','voicePause','interface','flatMap','sequelize','transaction','each','emit'];(function(_0x1b349a,_0x22222c){var _0x5d1f7c=function(_0x368d7c){while(--_0x368d7c){_0x1b349a['push'](_0x1b349a['shift']());}};_0x5d1f7c(++_0x22222c);}(_0x0b0e,0x187));var _0xe0b0=function(_0x149ca0,_0x2ac7f5){_0x149ca0=_0x149ca0-0x0;var _0x56b6b9=_0x0b0e[_0x149ca0];return _0x56b6b9;};'use strict';var BPromise=require(_0xe0b0('0x0'));var util=require('util');var _=require(_0xe0b0('0x1'));var squel=require('squel');var Redis=require(_0xe0b0('0x2'));var qs=require(_0xe0b0('0x3'));var logger=require(_0xe0b0('0x4'))(_0xe0b0('0x5'));var config=require(_0xe0b0('0x6'));var db=require(_0xe0b0('0x7'))['db'];config[_0xe0b0('0x8')]=_[_0xe0b0('0x9')](config[_0xe0b0('0x8')],{'host':_0xe0b0('0xa'),'port':0x18eb});var socket=require(_0xe0b0('0xb'))(new Redis(config['redis']));require('./smsQueue.socket')[_0xe0b0('0xc')](socket);function respondWithStatusCode(_0x435060,_0xc4a085){_0xc4a085=_0xc4a085||0xcc;return function(_0x2ac27e){if(_0x2ac27e){return _0x435060['sendStatus'](_0xc4a085);}return _0x435060[_0xe0b0('0xd')](_0xc4a085)[_0xe0b0('0xe')]();};}function respondWithResult(_0x553d4f,_0x1fef28){_0x1fef28=_0x1fef28||0xc8;return function(_0x2f32b6){if(_0x2f32b6){return _0x553d4f['status'](_0x1fef28)[_0xe0b0('0xf')](_0x2f32b6);}};}function respondWithFilteredResult(_0x2cdad2,_0x39b1c2){return function(_0x585615){if(_0x585615){var _0x3068c0=typeof _0x39b1c2[_0xe0b0('0x10')]===_0xe0b0('0x11')&&typeof _0x39b1c2[_0xe0b0('0x12')]===_0xe0b0('0x11');var _0x4d2bf7=_0x585615[_0xe0b0('0x13')];var _0x154de6=_0x3068c0?0x0:_0x39b1c2[_0xe0b0('0x10')];var _0x24babd=_0x3068c0?_0x585615[_0xe0b0('0x13')]:_0x39b1c2['offset']+_0x39b1c2[_0xe0b0('0x12')];var _0x5adb01;if(_0x24babd>=_0x4d2bf7){_0x24babd=_0x4d2bf7;_0x5adb01=0xc8;}else{_0x5adb01=0xce;}_0x2cdad2[_0xe0b0('0xd')](_0x5adb01);return _0x2cdad2[_0xe0b0('0x14')]('Content-Range',_0x154de6+'-'+_0x24babd+'/'+_0x4d2bf7)[_0xe0b0('0xf')](_0x585615);}return null;};}function saveUpdates(_0x4a4cc0){return function(_0x2d6fb6){if(_0x2d6fb6){return _0x2d6fb6[_0xe0b0('0x15')](_0x4a4cc0)['then'](function(_0x54a3eb){return _0x54a3eb;});}return null;};}function removeEntity(_0x46bb44){return function(_0x50a441){if(_0x50a441){return _0x50a441['destroy']()['then'](function(){var _0x1920ee=_0x50a441['get']({'plain':!![]});var _0x52598b=_0xe0b0('0x16');return db['UserProfileResource'][_0xe0b0('0x17')]({'where':{'type':_0x52598b,'resourceId':_0x1920ee['id']}})['then'](function(){return _0x50a441;});})[_0xe0b0('0x18')](function(){_0x46bb44[_0xe0b0('0xd')](0xcc)[_0xe0b0('0xe')]();});}};}function handleEntityNotFound(_0x310a6d){return function(_0x2cf6a1){if(!_0x2cf6a1){_0x310a6d['sendStatus'](0x194);}return _0x2cf6a1;};}function handleError(_0x4cae54,_0x2fa820){_0x2fa820=_0x2fa820||0x1f4;return function(_0x5512bb){logger[_0xe0b0('0x19')](_0x5512bb[_0xe0b0('0x1a')]);if(_0x5512bb['name']){delete _0x5512bb[_0xe0b0('0x1b')];}_0x4cae54['status'](_0x2fa820)[_0xe0b0('0x1c')](_0x5512bb);};}exports['index']=function(_0x28586d,_0x576352){var _0x3e5c88={};var _0x4de537={'count':0x0,'rows':[]};var _0x4700cc=_['map'](db[_0xe0b0('0x1d')]['rawAttributes'],function(_0x362aba){return{'name':_0x362aba[_0xe0b0('0x1e')],'type':_0x362aba[_0xe0b0('0x1f')][_0xe0b0('0x20')]};});_0x3e5c88=qs[_0xe0b0('0x21')](_0x4700cc,_0x28586d);var _0x10745d={'where':_0x3e5c88['where']};return db[_0xe0b0('0x1d')][_0xe0b0('0x13')](_0x10745d)['then'](function(_0x15e13b){_0x4de537[_0xe0b0('0x13')]=_0x15e13b;_0x3e5c88[_0xe0b0('0x22')]=qs[_0xe0b0('0x22')](_0x28586d[_0xe0b0('0x23')]);return db[_0xe0b0('0x1d')][_0xe0b0('0x24')](_0x3e5c88);})['then'](function(_0x1854b8){_0x4de537[_0xe0b0('0x25')]=_0x1854b8;return _0x4de537;})['then'](respondWithFilteredResult(_0x576352,_0x3e5c88))['catch'](handleError(_0x576352,null));};exports[_0xe0b0('0x26')]=function(_0x33e672,_0x422575){var _0x3f81d5={'raw':!![],'where':{'id':_0x33e672['params']['id']}},_0x2ab1b1={};_0x2ab1b1[_0xe0b0('0x27')]=_[_0xe0b0('0x28')](db[_0xe0b0('0x1d')][_0xe0b0('0x29')]);_0x2ab1b1[_0xe0b0('0x23')]=_['keys'](_0x33e672[_0xe0b0('0x23')]);_0x2ab1b1[_0xe0b0('0x2a')]=_[_0xe0b0('0x2b')](_0x2ab1b1[_0xe0b0('0x27')],_0x2ab1b1[_0xe0b0('0x23')]);_0x3f81d5[_0xe0b0('0x2c')]=_[_0xe0b0('0x2b')](_0x2ab1b1[_0xe0b0('0x27')],qs[_0xe0b0('0x2d')](_0x33e672[_0xe0b0('0x23')][_0xe0b0('0x2d')]));_0x3f81d5[_0xe0b0('0x2c')]=_0x3f81d5[_0xe0b0('0x2c')][_0xe0b0('0x2e')]?_0x3f81d5[_0xe0b0('0x2c')]:_0x2ab1b1['model'];if(_0x33e672[_0xe0b0('0x23')][_0xe0b0('0x2f')]){_0x3f81d5[_0xe0b0('0x22')]=[{'all':!![]}];}_0x3f81d5=_[_0xe0b0('0x30')]({},_0x3f81d5,_0x33e672[_0xe0b0('0x31')]);return db[_0xe0b0('0x1d')][_0xe0b0('0x32')](_0x3f81d5)['then'](handleEntityNotFound(_0x422575,null))['then'](respondWithResult(_0x422575,null))['catch'](handleError(_0x422575,null));};exports['create']=function(_0x26137c,_0xc3d967){return db[_0xe0b0('0x1d')]['create'](_0x26137c[_0xe0b0('0x33')],{})[_0xe0b0('0x18')](function(_0x1cd705){var _0x297c64=_0x26137c['user'][_0xe0b0('0x34')]({'plain':!![]});if(!_0x297c64)throw new Error(_0xe0b0('0x35'));if(_0x297c64[_0xe0b0('0x36')]===_0xe0b0('0x37')){var _0x4265e3=_0x1cd705[_0xe0b0('0x34')]({'plain':!![]});var _0x8b745=_0xe0b0('0x16');return db[_0xe0b0('0x38')]['find']({'where':{'name':_0x8b745,'userProfileId':_0x297c64[_0xe0b0('0x39')]},'raw':!![]})['then'](function(_0x34178d){if(_0x34178d&&_0x34178d[_0xe0b0('0x3a')]===0x0){return db[_0xe0b0('0x3b')][_0xe0b0('0x3c')]({'name':_0x4265e3['name'],'resourceId':_0x4265e3['id'],'type':_0x34178d[_0xe0b0('0x1b')],'sectionId':_0x34178d['id']},{})[_0xe0b0('0x18')](function(){return _0x1cd705;});}else{return _0x1cd705;}})[_0xe0b0('0x3d')](function(_0x402a0e){logger[_0xe0b0('0x19')](_0xe0b0('0x3e'),_0x402a0e);throw _0x402a0e;});}return _0x1cd705;})[_0xe0b0('0x18')](respondWithResult(_0xc3d967,0xc9))[_0xe0b0('0x3d')](handleError(_0xc3d967,null));};exports['update']=function(_0x2aad80,_0x309bbf){if(_0x2aad80['body']['id']){delete _0x2aad80['body']['id'];}return db[_0xe0b0('0x1d')][_0xe0b0('0x32')]({'where':{'id':_0x2aad80['params']['id']}})[_0xe0b0('0x18')](handleEntityNotFound(_0x309bbf,null))[_0xe0b0('0x18')](saveUpdates(_0x2aad80[_0xe0b0('0x33')],null))[_0xe0b0('0x18')](respondWithResult(_0x309bbf,null))[_0xe0b0('0x3d')](handleError(_0x309bbf,null));};exports['destroy']=function(_0x5d2fa2,_0x51c580){return db[_0xe0b0('0x1d')][_0xe0b0('0x32')]({'where':{'id':_0x5d2fa2['params']['id']}})[_0xe0b0('0x18')](handleEntityNotFound(_0x51c580,null))[_0xe0b0('0x18')](removeEntity(_0x51c580,null))[_0xe0b0('0x3d')](handleError(_0x51c580,null));};exports[_0xe0b0('0x3f')]=function(_0x16ccca,_0x5c6f94){return db['SmsQueue'][_0xe0b0('0x3f')]()[_0xe0b0('0x18')](respondWithResult(_0x5c6f94,null))[_0xe0b0('0x3d')](handleError(_0x5c6f94,null));};exports[_0xe0b0('0x40')]=function(_0x1bf77d,_0x575c7d){var _0x3b1474={'raw':!![],'where':{}},_0x11d4fd={},_0x534340;return db['SmsQueue']['findOne']({'where':{'id':_0x1bf77d[_0xe0b0('0x41')]['id']}})[_0xe0b0('0x18')](handleEntityNotFound(_0x575c7d,null))[_0xe0b0('0x18')](function(_0x364877){if(_0x364877){_0x534340=_0x364877['get']({'plain':!![]});_0x11d4fd[_0xe0b0('0x27')]=_[_0xe0b0('0x28')](db['UserSmsQueue']['rawAttributes']);_0x11d4fd[_0xe0b0('0x23')]=_[_0xe0b0('0x28')](_0x1bf77d['query']);_0x11d4fd[_0xe0b0('0x2a')]=_[_0xe0b0('0x2b')](_0x11d4fd['model'],_0x11d4fd['query']);_0x3b1474[_0xe0b0('0x2c')]=_['intersection'](_0x11d4fd[_0xe0b0('0x27')],qs[_0xe0b0('0x2d')](_0x1bf77d[_0xe0b0('0x23')][_0xe0b0('0x2d')]));_0x3b1474[_0xe0b0('0x2c')]=_0x3b1474[_0xe0b0('0x2c')]['length']?_0x3b1474['attributes']:_0x11d4fd[_0xe0b0('0x27')];if(!_0x1bf77d['query']['hasOwnProperty'](_0xe0b0('0x42'))){_0x3b1474[_0xe0b0('0x12')]=qs['limit'](_0x1bf77d['query'][_0xe0b0('0x12')]);_0x3b1474[_0xe0b0('0x10')]=qs[_0xe0b0('0x10')](_0x1bf77d[_0xe0b0('0x23')][_0xe0b0('0x10')]);}_0x3b1474[_0xe0b0('0x43')]=qs[_0xe0b0('0x44')](_0x1bf77d['query'][_0xe0b0('0x44')]);_0x3b1474['where']=qs[_0xe0b0('0x2a')](_['pick'](_0x1bf77d['query'],_0x11d4fd[_0xe0b0('0x2a')]));_0x3b1474[_0xe0b0('0x45')][_0xe0b0('0x46')]=_0x364877['id'];if(_0x1bf77d[_0xe0b0('0x23')][_0xe0b0('0x47')]){_0x3b1474[_0xe0b0('0x45')]=_[_0xe0b0('0x30')](_0x3b1474[_0xe0b0('0x45')],{'$or':_[_0xe0b0('0x48')](_0x3b1474['attributes'],function(_0x253ab0){var _0x57ccc9={};_0x57ccc9[_0x253ab0]={'$like':'%'+_0x1bf77d[_0xe0b0('0x23')][_0xe0b0('0x47')]+'%'};return _0x57ccc9;})});}_0x3b1474=_[_0xe0b0('0x30')]({},_0x3b1474,_0x1bf77d[_0xe0b0('0x31')]);return db[_0xe0b0('0x49')][_0xe0b0('0x24')](_0x3b1474);}})['then'](function(_0x1a057c){if(_0x1a057c){return db[_0xe0b0('0x4a')][_0xe0b0('0x4b')]({'where':{'id':_[_0xe0b0('0x48')](_0x1a057c,_0xe0b0('0x4c')),'role':_0xe0b0('0x4d')},'attributes':['id',_0xe0b0('0x1b'),_0xe0b0('0x4e'),_0xe0b0('0x4f'),_0xe0b0('0x50')]});}})[_0xe0b0('0x18')](function(_0x18ab99){if(_0x18ab99){return{'count':_0x18ab99[_0xe0b0('0x13')],'rows':_[_0xe0b0('0x48')](_0x18ab99[_0xe0b0('0x25')],function(_0x34c642){return{'membername':_0x34c642[_0xe0b0('0x1b')],'UserId':_0x34c642['id'],'queue_name':_0x534340[_0xe0b0('0x1b')],'SmsQueueId':_0x534340['id'],'interface':util['format'](_0xe0b0('0x51'),_0xe0b0('0x52'),_0x34c642[_0xe0b0('0x1b')]),'penalty':0x0,'paused':_0x34c642[_0xe0b0('0x4e')],'createdAt':_0x34c642[_0xe0b0('0x50')],'updatedAt':_0x34c642[_0xe0b0('0x4f')]};})};}else{return{'count':0x0,'rows':[]};}})[_0xe0b0('0x18')](respondWithFilteredResult(_0x575c7d,_0x3b1474))['catch'](handleError(_0x575c7d,null));};exports['getTeams']=function(_0x139014,_0x2a0415){var _0x157556={};var _0x47ecc1={};var _0x117d20;var _0x13fb4b;return db[_0xe0b0('0x1d')][_0xe0b0('0x53')]({'where':{'id':_0x139014[_0xe0b0('0x41')]['id']}})['then'](handleEntityNotFound(_0x2a0415,null))[_0xe0b0('0x18')](function(_0x242120){if(_0x242120){_0x117d20=_0x242120;_0x47ecc1[_0xe0b0('0x27')]=_['keys'](db[_0xe0b0('0x54')][_0xe0b0('0x29')]);_0x47ecc1['query']=_[_0xe0b0('0x28')](_0x139014['query']);_0x47ecc1['filters']=_[_0xe0b0('0x2b')](_0x47ecc1['model'],_0x47ecc1['query']);_0x157556[_0xe0b0('0x2c')]=_[_0xe0b0('0x2b')](_0x47ecc1[_0xe0b0('0x27')],qs[_0xe0b0('0x2d')](_0x139014['query'][_0xe0b0('0x2d')]));_0x157556[_0xe0b0('0x2c')]=_0x157556[_0xe0b0('0x2c')][_0xe0b0('0x2e')]?_0x157556[_0xe0b0('0x2c')]:_0x47ecc1[_0xe0b0('0x27')];_0x157556[_0xe0b0('0x43')]=qs[_0xe0b0('0x44')](_0x139014['query']['sort']);_0x157556[_0xe0b0('0x45')]=qs[_0xe0b0('0x2a')](_[_0xe0b0('0x55')](_0x139014['query'],_0x47ecc1['filters']));if(_0x139014[_0xe0b0('0x23')][_0xe0b0('0x47')]){_0x157556['where']=_['merge'](_0x157556[_0xe0b0('0x45')],{'$or':_[_0xe0b0('0x48')](_0x157556[_0xe0b0('0x2c')],function(_0x29175a){var _0x3b263f={};_0x3b263f[_0x29175a]={'$like':'%'+_0x139014[_0xe0b0('0x23')][_0xe0b0('0x47')]+'%'};return _0x3b263f;})});}_0x157556=_[_0xe0b0('0x30')]({},_0x157556,_0x139014['options']);return _0x117d20[_0xe0b0('0x56')](_0x157556);}})[_0xe0b0('0x18')](function(_0x1673bc){if(_0x1673bc){_0x13fb4b=_0x1673bc['length'];if(!_0x139014['query']['hasOwnProperty']('nolimit')){_0x157556['limit']=qs['limit'](_0x139014[_0xe0b0('0x23')]['limit']);_0x157556['offset']=qs[_0xe0b0('0x10')](_0x139014[_0xe0b0('0x23')][_0xe0b0('0x10')]);}return _0x117d20[_0xe0b0('0x56')](_0x157556);}})[_0xe0b0('0x18')](function(_0xd0629e){if(_0xd0629e){return _0xd0629e?{'count':_0x13fb4b,'rows':_0xd0629e}:null;}})[_0xe0b0('0x18')](respondWithResult(_0x2a0415,null))[_0xe0b0('0x3d')](handleError(_0x2a0415,null));};exports['addTeams']=function(_0x3097fb,_0x5da8fd){var _0x86e90=_0x3097fb[_0xe0b0('0x33')][_0xe0b0('0x57')];return db[_0xe0b0('0x54')][_0xe0b0('0x24')]({'where':{'id':_0x86e90},'attributes':['id'],'include':[{'model':db['User'],'as':_0xe0b0('0x58'),'attributes':['id','name',_0xe0b0('0x59'),_0xe0b0('0x5a'),_0xe0b0('0x5b')],'raw':!![]}]})[_0xe0b0('0x18')](function(_0x4a78f8){if(_0x4a78f8){var _0x311f79=_[_0xe0b0('0x5c')](_0x4a78f8,function(_0x49deef){var _0x4cf60a=_0x49deef[_0xe0b0('0x34')]({'plain':!![]});return _0x4cf60a[_0xe0b0('0x58')];});return db[_0xe0b0('0x1d')][_0xe0b0('0x32')]({'where':{'id':_0x3097fb[_0xe0b0('0x41')]['id']}})[_0xe0b0('0x18')](function(_0x34f4ff){return db[_0xe0b0('0x5d')][_0xe0b0('0x5e')](function(_0x24571b){return _0x34f4ff['addTeams'](_0x86e90,{'transaction':_0x24571b})['then'](function(){return BPromise[_0xe0b0('0x5f')](_0x311f79,function(_0x4880d5){return db['UserSmsQueue']['findOrCreate']({'where':{'UserId':_0x4880d5['id'],'SmsQueueId':_0x3097fb['params']['id']},'transaction':_0x24571b});});})[_0xe0b0('0x18')](function(){_0x311f79['forEach'](function(_0x654d2b){socket[_0xe0b0('0x60')](_0xe0b0('0x61'),{'UserId':_0x654d2b['id'],'SmsQueueId':_0x34f4ff['id']});});});});});}})[_0xe0b0('0x18')](respondWithStatusCode(_0x5da8fd,null))['catch'](handleError(_0x5da8fd,null));};exports[_0xe0b0('0x62')]=function(_0x948708,_0x5a0817){return db[_0xe0b0('0x54')][_0xe0b0('0x24')]({'where':{'id':_0x948708[_0xe0b0('0x23')][_0xe0b0('0x57')]},'attributes':['id'],'include':[{'model':db[_0xe0b0('0x4a')],'as':'Agents','attributes':['id'],'raw':!![]}]})['then'](handleEntityNotFound(_0x5a0817,null))['then'](function(_0x545694){var _0x5c258b=_[_0xe0b0('0x48')](_0x545694,'id');var _0x567e1a=[];var _0x3c09af=[];var _0x5f4aaf=squel[_0xe0b0('0x63')]();_0x5f4aaf[_0xe0b0('0x64')](_0xe0b0('0x65'))[_0xe0b0('0x66')](_0xe0b0('0x67'),'tq')[_0xe0b0('0x68')]('user_has_teams','ut','ut.TeamId\x20=\x20tq.TeamId')['where']('SmsQueueId\x20=\x20?',_0x948708[_0xe0b0('0x41')]['id']);for(var _0x261381=0x0;_0x261381<_0x545694[_0xe0b0('0x2e')];_0x261381+=0x1){let _0x4377f7=_0x545694[_0x261381];for(var _0x2c1149=0x0;_0x2c1149<_0x4377f7['Agents'][_0xe0b0('0x2e')];_0x2c1149+=0x1){let _0x39a07b=_0x4377f7[_0xe0b0('0x58')][_0x2c1149];var _0xc6090e=_0x5f4aaf[_0xe0b0('0x69')]();_0xc6090e[_0xe0b0('0x45')](_0xe0b0('0x6a'),_0x39a07b['id']);_0x3c09af[_0xe0b0('0x6b')](db[_0xe0b0('0x5d')]['query'](_0xc6090e['toString'](),{'type':db[_0xe0b0('0x5d')][_0xe0b0('0x6c')]['SELECT']})[_0xe0b0('0x18')](function(_0x4593f1){if(_0x4593f1[_0xe0b0('0x2e')]===0x1){return _0x39a07b['id'];}else{var _0x3fcffd=_[_0xe0b0('0x6d')](_[_0xe0b0('0x48')](_0x4593f1,_0xe0b0('0x6e')),function(_0xc8eba3){return _['includes'](_0x5c258b,_0xc8eba3);});if(_0x3fcffd){return _0x39a07b['id'];}}}));}}return BPromise['all'](_0x3c09af)['then'](function(_0xc19743){_0x567e1a=_(_0x567e1a)[_0xe0b0('0x6f')](_0xc19743)['compact']()[_0xe0b0('0x70')]();return db[_0xe0b0('0x1d')][_0xe0b0('0x32')]({'where':{'id':_0x948708[_0xe0b0('0x41')]['id']}})['then'](function(_0x56c4b9){return db['sequelize'][_0xe0b0('0x5e')](function(_0x266835){return _0x56c4b9['removeTeams'](_0x948708[_0xe0b0('0x23')][_0xe0b0('0x57')],{'transaction':_0x266835})['then'](function(){if(!_['isEmpty'](_0x567e1a)){return _0x56c4b9[_0xe0b0('0x71')](_0x567e1a,{'transaction':_0x266835});}})['then'](function(){_0x567e1a[_0xe0b0('0x72')](function(_0x5f06c0){socket[_0xe0b0('0x60')](_0xe0b0('0x73'),{'UserId':_0x5f06c0,'SmsQueueId':_0x56c4b9['id']});});});});});});})[_0xe0b0('0x18')](respondWithStatusCode(_0x5a0817,null))[_0xe0b0('0x3d')](handleError(_0x5a0817,null));};exports[_0xe0b0('0x74')]=function(_0x1ec7c2,_0x434dfa){return db[_0xe0b0('0x1d')][_0xe0b0('0x32')]({'where':{'id':_0x1ec7c2['params']['id']}})[_0xe0b0('0x18')](handleEntityNotFound(_0x434dfa,null))[_0xe0b0('0x18')](function(_0x2b40eb){if(_0x2b40eb){return _0x2b40eb['addAgents'](_0x1ec7c2[_0xe0b0('0x33')]['ids'],_[_0xe0b0('0x75')](_0x1ec7c2[_0xe0b0('0x33')],['ids','id'])||{})[_0xe0b0('0x76')](function(_0x4e4b45){for(var _0x528932=0x0;_0x528932<_0x1ec7c2[_0xe0b0('0x33')]['ids']['length'];_0x528932+=0x1){socket[_0xe0b0('0x60')](_0xe0b0('0x61'),{'UserId':Number(_0x1ec7c2[_0xe0b0('0x33')][_0xe0b0('0x57')][_0x528932]),'SmsQueueId':Number(_0x1ec7c2[_0xe0b0('0x41')]['id'])});}return _0x4e4b45;});}})[_0xe0b0('0x18')](respondWithResult(_0x434dfa,null))['catch'](handleError(_0x434dfa,null));};exports[_0xe0b0('0x71')]=function(_0x4609d5,_0x421b3b){return db['SmsQueue'][_0xe0b0('0x32')]({'where':{'id':_0x4609d5[_0xe0b0('0x41')]['id']}})['then'](handleEntityNotFound(_0x421b3b,null))['then'](function(_0x33f89a){if(_0x33f89a){return _0x33f89a['removeAgents'](_0x4609d5[_0xe0b0('0x23')][_0xe0b0('0x57')])[_0xe0b0('0x18')](function(){if(_[_0xe0b0('0x77')](_0x4609d5[_0xe0b0('0x23')][_0xe0b0('0x57')])){for(var _0x3d70d7=0x0;_0x3d70d7<_0x4609d5['query'][_0xe0b0('0x57')][_0xe0b0('0x2e')];_0x3d70d7+=0x1){socket[_0xe0b0('0x60')](_0xe0b0('0x73'),{'UserId':Number(_0x4609d5[_0xe0b0('0x23')]['ids'][_0x3d70d7]),'SmsQueueId':Number(_0x4609d5['params']['id'])});}}else{socket[_0xe0b0('0x60')](_0xe0b0('0x73'),{'UserId':Number(_0x4609d5[_0xe0b0('0x23')][_0xe0b0('0x57')]),'SmsQueueId':Number(_0x4609d5[_0xe0b0('0x41')]['id'])});}});}})[_0xe0b0('0x18')](respondWithStatusCode(_0x421b3b,null))[_0xe0b0('0x3d')](handleError(_0x421b3b,null));};exports[_0xe0b0('0x78')]=function(_0x932e,_0x1b3f4d){var _0x4fe048={};var _0xac45e6={};var _0x401c4b;var _0x3e18a3;return db[_0xe0b0('0x1d')]['findOne']({'where':{'id':_0x932e[_0xe0b0('0x41')]['id']}})[_0xe0b0('0x18')](handleEntityNotFound(_0x1b3f4d,null))[_0xe0b0('0x18')](function(_0x116c16){if(_0x116c16){_0x401c4b=_0x116c16;_0xac45e6[_0xe0b0('0x27')]=_['keys'](db[_0xe0b0('0x4a')]['rawAttributes']);_0xac45e6[_0xe0b0('0x23')]=_[_0xe0b0('0x28')](_0x932e[_0xe0b0('0x23')]);_0xac45e6[_0xe0b0('0x2a')]=_[_0xe0b0('0x2b')](_0xac45e6['model'],_0xac45e6['query']);_0x4fe048[_0xe0b0('0x2c')]=_['intersection'](_0xac45e6[_0xe0b0('0x27')],qs['fields'](_0x932e[_0xe0b0('0x23')][_0xe0b0('0x2d')]));_0x4fe048[_0xe0b0('0x2c')]=_0x4fe048[_0xe0b0('0x2c')][_0xe0b0('0x2e')]?_0x4fe048[_0xe0b0('0x2c')]:_0xac45e6[_0xe0b0('0x27')];_0x4fe048['order']=qs['sort'](_0x932e[_0xe0b0('0x23')][_0xe0b0('0x44')]);_0x4fe048[_0xe0b0('0x45')]=qs[_0xe0b0('0x2a')](_[_0xe0b0('0x55')](_0x932e[_0xe0b0('0x23')],_0xac45e6[_0xe0b0('0x2a')]));if(_0x932e[_0xe0b0('0x23')][_0xe0b0('0x47')]){_0x4fe048[_0xe0b0('0x45')]=_['merge'](_0x4fe048['where'],{'$or':_[_0xe0b0('0x48')](_0x4fe048[_0xe0b0('0x2c')],function(_0x187465){var _0x3f9e6b={};_0x3f9e6b[_0x187465]={'$like':'%'+_0x932e[_0xe0b0('0x23')][_0xe0b0('0x47')]+'%'};return _0x3f9e6b;})});}_0x4fe048=_[_0xe0b0('0x30')]({},_0x4fe048,_0x932e['options']);return _0x401c4b['getAgents'](_0x4fe048);}})[_0xe0b0('0x18')](function(_0x1ea4d5){if(_0x1ea4d5){_0x3e18a3=_0x1ea4d5[_0xe0b0('0x2e')];if(!_0x932e[_0xe0b0('0x23')][_0xe0b0('0x79')](_0xe0b0('0x42'))){_0x4fe048[_0xe0b0('0x12')]=qs[_0xe0b0('0x12')](_0x932e[_0xe0b0('0x23')][_0xe0b0('0x12')]);_0x4fe048['offset']=qs[_0xe0b0('0x10')](_0x932e[_0xe0b0('0x23')]['offset']);}return _0x401c4b[_0xe0b0('0x78')](_0x4fe048);}})[_0xe0b0('0x18')](function(_0x3615f9){if(_0x3615f9){return _0x3615f9?{'count':_0x3e18a3,'rows':_0x3615f9}:null;}})[_0xe0b0('0x18')](respondWithResult(_0x1b3f4d,null))[_0xe0b0('0x3d')](handleError(_0x1b3f4d,null));}; \ No newline at end of file +var _0x5f2f=['redis','defaults','localhost','socket.io-emitter','register','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','update','then','destroy','get','SmsQueues','UserProfileResource','error','stack','name','map','SmsQueue','rawAttributes','type','key','getOptions','where','include','findAll','rows','show','params','model','keys','query','filters','intersection','attributes','fields','includeAll','options','find','create','body','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','user','userProfileId','autoAssociation','catch','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','describe','getMembers','findOne','UserSmsQueue','length','hasOwnProperty','nolimit','order','sort','pick','filter','merge','findAndCountAll','UserId','agent','smsPause','updatedAt','createdAt','format','%s/%s','SIP','getTeams','Team','addTeams','ids','User','Agents','online','voicePause','interface','flatMap','findOrCreate','forEach','emit','userSmsQueue:save','removeTeams','field','SmsQueueId\x20=\x20?','ut.UserId\x20=\x20?','push','toString','QueryTypes','SELECT','every','TeamId','includes','all','union','compact','value','sequelize','transaction','isEmpty','removeAgents','addAgents','omit','spread','isArray','userSmsQueue:remove','getAgents','bluebird','util','lodash','squel','ioredis','../../components/parsers/qs','../../config/logger','api'];(function(_0x55ef8b,_0x5deb5e){var _0x359c84=function(_0x437673){while(--_0x437673){_0x55ef8b['push'](_0x55ef8b['shift']());}};_0x359c84(++_0x5deb5e);}(_0x5f2f,0x73));var _0xf5f2=function(_0x7d8fff,_0x3c5889){_0x7d8fff=_0x7d8fff-0x0;var _0x1813be=_0x5f2f[_0x7d8fff];return _0x1813be;};'use strict';var BPromise=require(_0xf5f2('0x0'));var util=require(_0xf5f2('0x1'));var _=require(_0xf5f2('0x2'));var squel=require(_0xf5f2('0x3'));var Redis=require(_0xf5f2('0x4'));var qs=require(_0xf5f2('0x5'));var logger=require(_0xf5f2('0x6'))(_0xf5f2('0x7'));var config=require('../../config/environment');var db=require('../../mysqldb')['db'];config[_0xf5f2('0x8')]=_[_0xf5f2('0x9')](config[_0xf5f2('0x8')],{'host':_0xf5f2('0xa'),'port':0x18eb});var socket=require(_0xf5f2('0xb'))(new Redis(config[_0xf5f2('0x8')]));require('./smsQueue.socket')[_0xf5f2('0xc')](socket);function respondWithStatusCode(_0x46cd9c,_0x2ec345){_0x2ec345=_0x2ec345||0xcc;return function(_0x56a69f){if(_0x56a69f){return _0x46cd9c[_0xf5f2('0xd')](_0x2ec345);}return _0x46cd9c[_0xf5f2('0xe')](_0x2ec345)[_0xf5f2('0xf')]();};}function respondWithResult(_0x4e0e6b,_0x977a59){_0x977a59=_0x977a59||0xc8;return function(_0x4ebbbe){if(_0x4ebbbe){return _0x4e0e6b['status'](_0x977a59)[_0xf5f2('0x10')](_0x4ebbbe);}};}function respondWithFilteredResult(_0x151aba,_0x4b78cd){return function(_0x336f6b){if(_0x336f6b){var _0x14b51f=typeof _0x4b78cd[_0xf5f2('0x11')]===_0xf5f2('0x12')&&typeof _0x4b78cd[_0xf5f2('0x13')]===_0xf5f2('0x12');var _0x5c01b8=_0x336f6b[_0xf5f2('0x14')];var _0xea612c=_0x14b51f?0x0:_0x4b78cd[_0xf5f2('0x11')];var _0x1c1a5c=_0x14b51f?_0x336f6b[_0xf5f2('0x14')]:_0x4b78cd['offset']+_0x4b78cd[_0xf5f2('0x13')];var _0x286197;if(_0x1c1a5c>=_0x5c01b8){_0x1c1a5c=_0x5c01b8;_0x286197=0xc8;}else{_0x286197=0xce;}_0x151aba[_0xf5f2('0xe')](_0x286197);return _0x151aba[_0xf5f2('0x15')](_0xf5f2('0x16'),_0xea612c+'-'+_0x1c1a5c+'/'+_0x5c01b8)[_0xf5f2('0x10')](_0x336f6b);}return null;};}function saveUpdates(_0xdb61b3){return function(_0x395a5a){if(_0x395a5a){return _0x395a5a[_0xf5f2('0x17')](_0xdb61b3)[_0xf5f2('0x18')](function(_0x20fccd){return _0x20fccd;});}return null;};}function removeEntity(_0x28e097){return function(_0x4ff59b){if(_0x4ff59b){return _0x4ff59b[_0xf5f2('0x19')]()[_0xf5f2('0x18')](function(){var _0x626999=_0x4ff59b[_0xf5f2('0x1a')]({'plain':!![]});var _0x56acc5=_0xf5f2('0x1b');return db[_0xf5f2('0x1c')]['destroy']({'where':{'type':_0x56acc5,'resourceId':_0x626999['id']}})['then'](function(){return _0x4ff59b;});})[_0xf5f2('0x18')](function(){_0x28e097[_0xf5f2('0xe')](0xcc)['end']();});}};}function handleEntityNotFound(_0x45b74f){return function(_0x170042){if(!_0x170042){_0x45b74f[_0xf5f2('0xd')](0x194);}return _0x170042;};}function handleError(_0x39c024,_0x36f1cb){_0x36f1cb=_0x36f1cb||0x1f4;return function(_0x4c691a){logger[_0xf5f2('0x1d')](_0x4c691a[_0xf5f2('0x1e')]);if(_0x4c691a[_0xf5f2('0x1f')]){delete _0x4c691a[_0xf5f2('0x1f')];}_0x39c024[_0xf5f2('0xe')](_0x36f1cb)['send'](_0x4c691a);};}exports['index']=function(_0x5f1124,_0x3f79d5){var _0x13da6f={};var _0x1a5bb3={'count':0x0,'rows':[]};var _0xf6c58d=_[_0xf5f2('0x20')](db[_0xf5f2('0x21')][_0xf5f2('0x22')],function(_0x294414){return{'name':_0x294414['fieldName'],'type':_0x294414[_0xf5f2('0x23')][_0xf5f2('0x24')]};});_0x13da6f=qs[_0xf5f2('0x25')](_0xf6c58d,_0x5f1124);var _0x31bfcb={'where':_0x13da6f[_0xf5f2('0x26')]};return db[_0xf5f2('0x21')]['count'](_0x31bfcb)['then'](function(_0x22c826){_0x1a5bb3[_0xf5f2('0x14')]=_0x22c826;_0x13da6f[_0xf5f2('0x27')]=qs['include'](_0x5f1124['query']);return db[_0xf5f2('0x21')][_0xf5f2('0x28')](_0x13da6f);})[_0xf5f2('0x18')](function(_0x153924){_0x1a5bb3[_0xf5f2('0x29')]=_0x153924;return _0x1a5bb3;})['then'](respondWithFilteredResult(_0x3f79d5,_0x13da6f))['catch'](handleError(_0x3f79d5,null));};exports[_0xf5f2('0x2a')]=function(_0x4e19cb,_0xb744b9){var _0x58a4df={'raw':!![],'where':{'id':_0x4e19cb[_0xf5f2('0x2b')]['id']}},_0x45b643={};_0x45b643[_0xf5f2('0x2c')]=_[_0xf5f2('0x2d')](db[_0xf5f2('0x21')][_0xf5f2('0x22')]);_0x45b643[_0xf5f2('0x2e')]=_[_0xf5f2('0x2d')](_0x4e19cb['query']);_0x45b643[_0xf5f2('0x2f')]=_[_0xf5f2('0x30')](_0x45b643[_0xf5f2('0x2c')],_0x45b643[_0xf5f2('0x2e')]);_0x58a4df[_0xf5f2('0x31')]=_[_0xf5f2('0x30')](_0x45b643[_0xf5f2('0x2c')],qs['fields'](_0x4e19cb[_0xf5f2('0x2e')][_0xf5f2('0x32')]));_0x58a4df['attributes']=_0x58a4df[_0xf5f2('0x31')]['length']?_0x58a4df[_0xf5f2('0x31')]:_0x45b643[_0xf5f2('0x2c')];if(_0x4e19cb[_0xf5f2('0x2e')][_0xf5f2('0x33')]){_0x58a4df['include']=[{'all':!![]}];}_0x58a4df=_['merge']({},_0x58a4df,_0x4e19cb[_0xf5f2('0x34')]);return db[_0xf5f2('0x21')][_0xf5f2('0x35')](_0x58a4df)['then'](handleEntityNotFound(_0xb744b9,null))[_0xf5f2('0x18')](respondWithResult(_0xb744b9,null))['catch'](handleError(_0xb744b9,null));};exports[_0xf5f2('0x36')]=function(_0x566c47,_0x46f464){return db[_0xf5f2('0x21')]['create'](_0x566c47[_0xf5f2('0x37')],{})[_0xf5f2('0x18')](function(_0x5a4441){var _0x35f738=_0x566c47['user']['get']({'plain':!![]});if(!_0x35f738)throw new Error(_0xf5f2('0x38'));if(_0x35f738[_0xf5f2('0x39')]===_0xf5f2('0x3a')){var _0x2d4400=_0x5a4441[_0xf5f2('0x1a')]({'plain':!![]});var _0xe62b57=_0xf5f2('0x1b');return db['UserProfileSection'][_0xf5f2('0x35')]({'where':{'name':_0xe62b57,'userProfileId':_0x35f738[_0xf5f2('0x3b')]},'raw':!![]})['then'](function(_0xc6a1ae){if(_0xc6a1ae&&_0xc6a1ae[_0xf5f2('0x3c')]===0x0){return db[_0xf5f2('0x1c')][_0xf5f2('0x36')]({'name':_0x2d4400[_0xf5f2('0x1f')],'resourceId':_0x2d4400['id'],'type':_0xc6a1ae[_0xf5f2('0x1f')],'sectionId':_0xc6a1ae['id']},{})[_0xf5f2('0x18')](function(){return _0x5a4441;});}else{return _0x5a4441;}})[_0xf5f2('0x3d')](function(_0x574f24){logger[_0xf5f2('0x1d')](_0xf5f2('0x3e'),_0x574f24);throw _0x574f24;});}return _0x5a4441;})[_0xf5f2('0x18')](respondWithResult(_0x46f464,0xc9))['catch'](handleError(_0x46f464,null));};exports['update']=function(_0x59eb00,_0x76d21b){if(_0x59eb00[_0xf5f2('0x37')]['id']){delete _0x59eb00['body']['id'];}return db[_0xf5f2('0x21')][_0xf5f2('0x35')]({'where':{'id':_0x59eb00[_0xf5f2('0x2b')]['id']}})[_0xf5f2('0x18')](handleEntityNotFound(_0x76d21b,null))[_0xf5f2('0x18')](saveUpdates(_0x59eb00[_0xf5f2('0x37')],null))[_0xf5f2('0x18')](respondWithResult(_0x76d21b,null))[_0xf5f2('0x3d')](handleError(_0x76d21b,null));};exports[_0xf5f2('0x19')]=function(_0x106062,_0x444317){return db[_0xf5f2('0x21')][_0xf5f2('0x35')]({'where':{'id':_0x106062[_0xf5f2('0x2b')]['id']}})['then'](handleEntityNotFound(_0x444317,null))[_0xf5f2('0x18')](removeEntity(_0x444317,null))['catch'](handleError(_0x444317,null));};exports[_0xf5f2('0x3f')]=function(_0xc04f44,_0x218def){return db[_0xf5f2('0x21')][_0xf5f2('0x3f')]()[_0xf5f2('0x18')](respondWithResult(_0x218def,null))['catch'](handleError(_0x218def,null));};exports[_0xf5f2('0x40')]=function(_0x2e7193,_0x1c1497){var _0x29b108={'raw':!![],'where':{}},_0x12124d={},_0x10753a;return db[_0xf5f2('0x21')][_0xf5f2('0x41')]({'where':{'id':_0x2e7193['params']['id']}})[_0xf5f2('0x18')](handleEntityNotFound(_0x1c1497,null))[_0xf5f2('0x18')](function(_0x45db9a){if(_0x45db9a){_0x10753a=_0x45db9a['get']({'plain':!![]});_0x12124d[_0xf5f2('0x2c')]=_[_0xf5f2('0x2d')](db[_0xf5f2('0x42')]['rawAttributes']);_0x12124d['query']=_[_0xf5f2('0x2d')](_0x2e7193[_0xf5f2('0x2e')]);_0x12124d['filters']=_[_0xf5f2('0x30')](_0x12124d['model'],_0x12124d[_0xf5f2('0x2e')]);_0x29b108['attributes']=_[_0xf5f2('0x30')](_0x12124d['model'],qs[_0xf5f2('0x32')](_0x2e7193[_0xf5f2('0x2e')][_0xf5f2('0x32')]));_0x29b108[_0xf5f2('0x31')]=_0x29b108['attributes'][_0xf5f2('0x43')]?_0x29b108[_0xf5f2('0x31')]:_0x12124d['model'];if(!_0x2e7193['query'][_0xf5f2('0x44')](_0xf5f2('0x45'))){_0x29b108['limit']=qs[_0xf5f2('0x13')](_0x2e7193[_0xf5f2('0x2e')][_0xf5f2('0x13')]);_0x29b108[_0xf5f2('0x11')]=qs['offset'](_0x2e7193['query'][_0xf5f2('0x11')]);}_0x29b108[_0xf5f2('0x46')]=qs['sort'](_0x2e7193[_0xf5f2('0x2e')][_0xf5f2('0x47')]);_0x29b108[_0xf5f2('0x26')]=qs[_0xf5f2('0x2f')](_[_0xf5f2('0x48')](_0x2e7193[_0xf5f2('0x2e')],_0x12124d[_0xf5f2('0x2f')]));_0x29b108['where']['SmsQueueId']=_0x45db9a['id'];if(_0x2e7193[_0xf5f2('0x2e')][_0xf5f2('0x49')]){_0x29b108[_0xf5f2('0x26')]=_[_0xf5f2('0x4a')](_0x29b108[_0xf5f2('0x26')],{'$or':_['map'](_0x29b108[_0xf5f2('0x31')],function(_0x20ba91){var _0x18b124={};_0x18b124[_0x20ba91]={'$like':'%'+_0x2e7193['query'][_0xf5f2('0x49')]+'%'};return _0x18b124;})});}_0x29b108=_['merge']({},_0x29b108,_0x2e7193[_0xf5f2('0x34')]);return db[_0xf5f2('0x42')][_0xf5f2('0x28')](_0x29b108);}})[_0xf5f2('0x18')](function(_0x4afa4d){if(_0x4afa4d){return db['User'][_0xf5f2('0x4b')]({'where':{'id':_['map'](_0x4afa4d,_0xf5f2('0x4c')),'role':_0xf5f2('0x4d')},'attributes':['id','name',_0xf5f2('0x4e'),_0xf5f2('0x4f'),_0xf5f2('0x50')]});}})['then'](function(_0x397b99){if(_0x397b99){return{'count':_0x397b99[_0xf5f2('0x14')],'rows':_[_0xf5f2('0x20')](_0x397b99[_0xf5f2('0x29')],function(_0x51fa7e){return{'membername':_0x51fa7e[_0xf5f2('0x1f')],'UserId':_0x51fa7e['id'],'queue_name':_0x10753a['name'],'SmsQueueId':_0x10753a['id'],'interface':util[_0xf5f2('0x51')](_0xf5f2('0x52'),_0xf5f2('0x53'),_0x51fa7e[_0xf5f2('0x1f')]),'penalty':0x0,'paused':_0x51fa7e[_0xf5f2('0x4e')],'createdAt':_0x51fa7e['createdAt'],'updatedAt':_0x51fa7e[_0xf5f2('0x4f')]};})};}else{return{'count':0x0,'rows':[]};}})[_0xf5f2('0x18')](respondWithFilteredResult(_0x1c1497,_0x29b108))[_0xf5f2('0x3d')](handleError(_0x1c1497,null));};exports[_0xf5f2('0x54')]=function(_0x2c5733,_0x5359b5){var _0x31e16b={};var _0x5ee6bc={};var _0x4c96ee;var _0xd4f6ef;return db['SmsQueue'][_0xf5f2('0x41')]({'where':{'id':_0x2c5733[_0xf5f2('0x2b')]['id']}})[_0xf5f2('0x18')](handleEntityNotFound(_0x5359b5,null))[_0xf5f2('0x18')](function(_0x5767fc){if(_0x5767fc){_0x4c96ee=_0x5767fc;_0x5ee6bc[_0xf5f2('0x2c')]=_[_0xf5f2('0x2d')](db[_0xf5f2('0x55')][_0xf5f2('0x22')]);_0x5ee6bc[_0xf5f2('0x2e')]=_[_0xf5f2('0x2d')](_0x2c5733[_0xf5f2('0x2e')]);_0x5ee6bc['filters']=_[_0xf5f2('0x30')](_0x5ee6bc[_0xf5f2('0x2c')],_0x5ee6bc[_0xf5f2('0x2e')]);_0x31e16b[_0xf5f2('0x31')]=_['intersection'](_0x5ee6bc[_0xf5f2('0x2c')],qs['fields'](_0x2c5733[_0xf5f2('0x2e')][_0xf5f2('0x32')]));_0x31e16b['attributes']=_0x31e16b[_0xf5f2('0x31')][_0xf5f2('0x43')]?_0x31e16b[_0xf5f2('0x31')]:_0x5ee6bc[_0xf5f2('0x2c')];_0x31e16b[_0xf5f2('0x46')]=qs['sort'](_0x2c5733[_0xf5f2('0x2e')][_0xf5f2('0x47')]);_0x31e16b[_0xf5f2('0x26')]=qs[_0xf5f2('0x2f')](_[_0xf5f2('0x48')](_0x2c5733[_0xf5f2('0x2e')],_0x5ee6bc['filters']));if(_0x2c5733[_0xf5f2('0x2e')][_0xf5f2('0x49')]){_0x31e16b['where']=_[_0xf5f2('0x4a')](_0x31e16b[_0xf5f2('0x26')],{'$or':_[_0xf5f2('0x20')](_0x31e16b['attributes'],function(_0x551cc9){var _0x4f3df6={};_0x4f3df6[_0x551cc9]={'$like':'%'+_0x2c5733[_0xf5f2('0x2e')][_0xf5f2('0x49')]+'%'};return _0x4f3df6;})});}_0x31e16b=_[_0xf5f2('0x4a')]({},_0x31e16b,_0x2c5733[_0xf5f2('0x34')]);return _0x4c96ee[_0xf5f2('0x54')](_0x31e16b);}})['then'](function(_0x278b76){if(_0x278b76){_0xd4f6ef=_0x278b76[_0xf5f2('0x43')];if(!_0x2c5733[_0xf5f2('0x2e')][_0xf5f2('0x44')](_0xf5f2('0x45'))){_0x31e16b[_0xf5f2('0x13')]=qs[_0xf5f2('0x13')](_0x2c5733[_0xf5f2('0x2e')][_0xf5f2('0x13')]);_0x31e16b[_0xf5f2('0x11')]=qs[_0xf5f2('0x11')](_0x2c5733['query']['offset']);}return _0x4c96ee['getTeams'](_0x31e16b);}})[_0xf5f2('0x18')](function(_0xafba8e){if(_0xafba8e){return _0xafba8e?{'count':_0xd4f6ef,'rows':_0xafba8e}:null;}})[_0xf5f2('0x18')](respondWithResult(_0x5359b5,null))[_0xf5f2('0x3d')](handleError(_0x5359b5,null));};exports[_0xf5f2('0x56')]=function(_0x5c6959,_0x9d943f){var _0x43c732=_0x5c6959[_0xf5f2('0x37')][_0xf5f2('0x57')];return db[_0xf5f2('0x55')]['findAll']({'where':{'id':_0x43c732},'attributes':['id'],'include':[{'model':db[_0xf5f2('0x58')],'as':_0xf5f2('0x59'),'attributes':['id','name',_0xf5f2('0x5a'),_0xf5f2('0x5b'),_0xf5f2('0x5c')],'raw':!![]}]})[_0xf5f2('0x18')](function(_0x588434){if(_0x588434){var _0x40b36e=_[_0xf5f2('0x5d')](_0x588434,function(_0x19602d){var _0x2adeb4=_0x19602d[_0xf5f2('0x1a')]({'plain':!![]});return _0x2adeb4['Agents'];});return db['SmsQueue'][_0xf5f2('0x35')]({'where':{'id':_0x5c6959[_0xf5f2('0x2b')]['id']}})[_0xf5f2('0x18')](function(_0xe3ea1e){return db['sequelize']['transaction'](function(_0x16048e){return _0xe3ea1e['addTeams'](_0x43c732,{'transaction':_0x16048e})['then'](function(){return BPromise['each'](_0x40b36e,function(_0x57cb18){return db[_0xf5f2('0x42')][_0xf5f2('0x5e')]({'where':{'UserId':_0x57cb18['id'],'SmsQueueId':_0x5c6959[_0xf5f2('0x2b')]['id']},'transaction':_0x16048e});});})[_0xf5f2('0x18')](function(){_0x40b36e[_0xf5f2('0x5f')](function(_0x9f941e){socket[_0xf5f2('0x60')](_0xf5f2('0x61'),{'UserId':_0x9f941e['id'],'SmsQueueId':_0xe3ea1e['id']});});});});});}})[_0xf5f2('0x18')](respondWithStatusCode(_0x9d943f,null))[_0xf5f2('0x3d')](handleError(_0x9d943f,null));};exports[_0xf5f2('0x62')]=function(_0x2afeac,_0x1ba503){return db[_0xf5f2('0x55')][_0xf5f2('0x28')]({'where':{'id':_0x2afeac[_0xf5f2('0x2e')][_0xf5f2('0x57')]},'attributes':['id'],'include':[{'model':db[_0xf5f2('0x58')],'as':'Agents','attributes':['id'],'raw':!![]}]})[_0xf5f2('0x18')](handleEntityNotFound(_0x1ba503,null))[_0xf5f2('0x18')](function(_0x21043b){var _0x2811ad=_[_0xf5f2('0x20')](_0x21043b,'id');var _0x308220=[];var _0x16491c=[];var _0xcf48eb=squel['select']();_0xcf48eb[_0xf5f2('0x63')]('tq.TeamId')['from']('team_has_sms_queues','tq')['join']('user_has_teams','ut','ut.TeamId\x20=\x20tq.TeamId')[_0xf5f2('0x26')](_0xf5f2('0x64'),_0x2afeac[_0xf5f2('0x2b')]['id']);for(var _0x375bc9=0x0;_0x375bc9<_0x21043b[_0xf5f2('0x43')];_0x375bc9+=0x1){let _0x3cf857=_0x21043b[_0x375bc9];for(var _0x5dc63f=0x0;_0x5dc63f<_0x3cf857['Agents'][_0xf5f2('0x43')];_0x5dc63f+=0x1){let _0x578a22=_0x3cf857[_0xf5f2('0x59')][_0x5dc63f];var _0x186fdd=_0xcf48eb['clone']();_0x186fdd['where'](_0xf5f2('0x65'),_0x578a22['id']);_0x16491c[_0xf5f2('0x66')](db['sequelize'][_0xf5f2('0x2e')](_0x186fdd[_0xf5f2('0x67')](),{'type':db['sequelize'][_0xf5f2('0x68')][_0xf5f2('0x69')]})[_0xf5f2('0x18')](function(_0x4c1678){if(_0x4c1678[_0xf5f2('0x43')]===0x1){return _0x578a22['id'];}else{var _0xc28adc=_[_0xf5f2('0x6a')](_[_0xf5f2('0x20')](_0x4c1678,_0xf5f2('0x6b')),function(_0x3e0288){return _[_0xf5f2('0x6c')](_0x2811ad,_0x3e0288);});if(_0xc28adc){return _0x578a22['id'];}}}));}}return BPromise[_0xf5f2('0x6d')](_0x16491c)[_0xf5f2('0x18')](function(_0x3a6f60){_0x308220=_(_0x308220)[_0xf5f2('0x6e')](_0x3a6f60)[_0xf5f2('0x6f')]()[_0xf5f2('0x70')]();return db[_0xf5f2('0x21')][_0xf5f2('0x35')]({'where':{'id':_0x2afeac[_0xf5f2('0x2b')]['id']}})[_0xf5f2('0x18')](function(_0x29a9d4){return db[_0xf5f2('0x71')][_0xf5f2('0x72')](function(_0x800f42){return _0x29a9d4['removeTeams'](_0x2afeac[_0xf5f2('0x2e')][_0xf5f2('0x57')],{'transaction':_0x800f42})['then'](function(){if(!_[_0xf5f2('0x73')](_0x308220)){return _0x29a9d4[_0xf5f2('0x74')](_0x308220,{'transaction':_0x800f42});}})['then'](function(){_0x308220[_0xf5f2('0x5f')](function(_0x2f54eb){socket[_0xf5f2('0x60')]('userSmsQueue:remove',{'UserId':_0x2f54eb,'SmsQueueId':_0x29a9d4['id']});});});});});});})['then'](respondWithStatusCode(_0x1ba503,null))[_0xf5f2('0x3d')](handleError(_0x1ba503,null));};exports[_0xf5f2('0x75')]=function(_0x213ade,_0x5ba275){return db['SmsQueue'][_0xf5f2('0x35')]({'where':{'id':_0x213ade[_0xf5f2('0x2b')]['id']}})[_0xf5f2('0x18')](handleEntityNotFound(_0x5ba275,null))['then'](function(_0x4cde64){if(_0x4cde64){return _0x4cde64['addAgents'](_0x213ade['body']['ids'],_[_0xf5f2('0x76')](_0x213ade['body'],[_0xf5f2('0x57'),'id'])||{})[_0xf5f2('0x77')](function(_0xec3c35){for(var _0x43a167=0x0;_0x43a167<_0x213ade[_0xf5f2('0x37')][_0xf5f2('0x57')][_0xf5f2('0x43')];_0x43a167+=0x1){socket[_0xf5f2('0x60')](_0xf5f2('0x61'),{'UserId':Number(_0x213ade[_0xf5f2('0x37')][_0xf5f2('0x57')][_0x43a167]),'SmsQueueId':Number(_0x213ade[_0xf5f2('0x2b')]['id'])});}return _0xec3c35;});}})[_0xf5f2('0x18')](respondWithResult(_0x5ba275,null))['catch'](handleError(_0x5ba275,null));};exports[_0xf5f2('0x74')]=function(_0x2a4fed,_0x5783e2){return db[_0xf5f2('0x21')][_0xf5f2('0x35')]({'where':{'id':_0x2a4fed['params']['id']}})[_0xf5f2('0x18')](handleEntityNotFound(_0x5783e2,null))[_0xf5f2('0x18')](function(_0x281f61){if(_0x281f61){return _0x281f61['removeAgents'](_0x2a4fed[_0xf5f2('0x2e')][_0xf5f2('0x57')])['then'](function(){if(_[_0xf5f2('0x78')](_0x2a4fed[_0xf5f2('0x2e')][_0xf5f2('0x57')])){for(var _0x517aa8=0x0;_0x517aa8<_0x2a4fed[_0xf5f2('0x2e')]['ids'][_0xf5f2('0x43')];_0x517aa8+=0x1){socket['emit'](_0xf5f2('0x79'),{'UserId':Number(_0x2a4fed[_0xf5f2('0x2e')][_0xf5f2('0x57')][_0x517aa8]),'SmsQueueId':Number(_0x2a4fed[_0xf5f2('0x2b')]['id'])});}}else{socket['emit'](_0xf5f2('0x79'),{'UserId':Number(_0x2a4fed['query']['ids']),'SmsQueueId':Number(_0x2a4fed['params']['id'])});}});}})[_0xf5f2('0x18')](respondWithStatusCode(_0x5783e2,null))[_0xf5f2('0x3d')](handleError(_0x5783e2,null));};exports['getAgents']=function(_0x3c8a1b,_0x15025d){var _0x35790b={};var _0x3962b2={};var _0x28873e;var _0x1fc5ae;return db['SmsQueue'][_0xf5f2('0x41')]({'where':{'id':_0x3c8a1b[_0xf5f2('0x2b')]['id']}})['then'](handleEntityNotFound(_0x15025d,null))[_0xf5f2('0x18')](function(_0x19cbff){if(_0x19cbff){_0x28873e=_0x19cbff;_0x3962b2['model']=_[_0xf5f2('0x2d')](db[_0xf5f2('0x58')][_0xf5f2('0x22')]);_0x3962b2[_0xf5f2('0x2e')]=_[_0xf5f2('0x2d')](_0x3c8a1b[_0xf5f2('0x2e')]);_0x3962b2['filters']=_[_0xf5f2('0x30')](_0x3962b2[_0xf5f2('0x2c')],_0x3962b2[_0xf5f2('0x2e')]);_0x35790b[_0xf5f2('0x31')]=_[_0xf5f2('0x30')](_0x3962b2[_0xf5f2('0x2c')],qs[_0xf5f2('0x32')](_0x3c8a1b[_0xf5f2('0x2e')][_0xf5f2('0x32')]));_0x35790b['attributes']=_0x35790b[_0xf5f2('0x31')][_0xf5f2('0x43')]?_0x35790b[_0xf5f2('0x31')]:_0x3962b2[_0xf5f2('0x2c')];_0x35790b[_0xf5f2('0x46')]=qs[_0xf5f2('0x47')](_0x3c8a1b[_0xf5f2('0x2e')][_0xf5f2('0x47')]);_0x35790b[_0xf5f2('0x26')]=qs[_0xf5f2('0x2f')](_['pick'](_0x3c8a1b['query'],_0x3962b2[_0xf5f2('0x2f')]));if(_0x3c8a1b[_0xf5f2('0x2e')][_0xf5f2('0x49')]){_0x35790b[_0xf5f2('0x26')]=_['merge'](_0x35790b[_0xf5f2('0x26')],{'$or':_[_0xf5f2('0x20')](_0x35790b[_0xf5f2('0x31')],function(_0x3d7f53){var _0x456a1e={};_0x456a1e[_0x3d7f53]={'$like':'%'+_0x3c8a1b['query'][_0xf5f2('0x49')]+'%'};return _0x456a1e;})});}_0x35790b=_[_0xf5f2('0x4a')]({},_0x35790b,_0x3c8a1b['options']);return _0x28873e[_0xf5f2('0x7a')](_0x35790b);}})[_0xf5f2('0x18')](function(_0x2563fa){if(_0x2563fa){_0x1fc5ae=_0x2563fa[_0xf5f2('0x43')];if(!_0x3c8a1b['query'][_0xf5f2('0x44')](_0xf5f2('0x45'))){_0x35790b[_0xf5f2('0x13')]=qs['limit'](_0x3c8a1b['query'][_0xf5f2('0x13')]);_0x35790b[_0xf5f2('0x11')]=qs[_0xf5f2('0x11')](_0x3c8a1b[_0xf5f2('0x2e')][_0xf5f2('0x11')]);}return _0x28873e[_0xf5f2('0x7a')](_0x35790b);}})['then'](function(_0x39dee8){if(_0x39dee8){return _0x39dee8?{'count':_0x1fc5ae,'rows':_0x39dee8}:null;}})['then'](respondWithResult(_0x15025d,null))[_0xf5f2('0x3d')](handleError(_0x15025d,null));}; \ No newline at end of file diff --git a/server/api/smsQueue/smsQueue.events.js b/server/api/smsQueue/smsQueue.events.js index 9434129..6622b66 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 _0xace1=['exports','events','SmsQueue','update','remove','emit','hasOwnProperty','hook'];(function(_0x315c67,_0x2ca2fa){var _0x6b82b=function(_0x156797){while(--_0x156797){_0x315c67['push'](_0x315c67['shift']());}};_0x6b82b(++_0x2ca2fa);}(_0xace1,0x159));var _0x1ace=function(_0x438ce6,_0x1e5b94){_0x438ce6=_0x438ce6-0x0;var _0x8cd45c=_0xace1[_0x438ce6];return _0x8cd45c;};'use strict';var EventEmitter=require(_0x1ace('0x0'));var SmsQueue=require('../../mysqldb')['db'][_0x1ace('0x1')];var SmsQueueEvents=new EventEmitter();SmsQueueEvents['setMaxListeners'](0x0);var events={'afterCreate':'save','afterUpdate':_0x1ace('0x2'),'afterDestroy':_0x1ace('0x3')};function emitEvent(_0x310423){return function(_0xed64a9,_0x295647,_0x4ab17c){SmsQueueEvents[_0x1ace('0x4')](_0x310423+':'+_0xed64a9['id'],_0xed64a9);SmsQueueEvents[_0x1ace('0x4')](_0x310423,_0xed64a9);_0x4ab17c(null);};}for(var e in events){if(events[_0x1ace('0x5')](e)){var event=events[e];SmsQueue[_0x1ace('0x6')](e,emitEvent(event));}}module[_0x1ace('0x7')]=SmsQueueEvents; \ No newline at end of file +var _0xdd38=['emit','hasOwnProperty','hook','exports','events','SmsQueue','setMaxListeners','save','update','remove'];(function(_0x123ac8,_0xbc2e00){var _0x41d330=function(_0x16ed80){while(--_0x16ed80){_0x123ac8['push'](_0x123ac8['shift']());}};_0x41d330(++_0xbc2e00);}(_0xdd38,0xf4));var _0x8dd3=function(_0x25e754,_0x200eba){_0x25e754=_0x25e754-0x0;var _0x1d991e=_0xdd38[_0x25e754];return _0x1d991e;};'use strict';var EventEmitter=require(_0x8dd3('0x0'));var SmsQueue=require('../../mysqldb')['db'][_0x8dd3('0x1')];var SmsQueueEvents=new EventEmitter();SmsQueueEvents[_0x8dd3('0x2')](0x0);var events={'afterCreate':_0x8dd3('0x3'),'afterUpdate':_0x8dd3('0x4'),'afterDestroy':_0x8dd3('0x5')};function emitEvent(_0x2de902){return function(_0x3714f4,_0x142872,_0x6a494c){SmsQueueEvents[_0x8dd3('0x6')](_0x2de902+':'+_0x3714f4['id'],_0x3714f4);SmsQueueEvents[_0x8dd3('0x6')](_0x2de902,_0x3714f4);_0x6a494c(null);};}for(var e in events){if(events[_0x8dd3('0x7')](e)){var event=events[e];SmsQueue[_0x8dd3('0x8')](e,emitEvent(event));}}module[_0x8dd3('0x9')]=SmsQueueEvents; \ No newline at end of file diff --git a/server/api/smsQueue/smsQueue.model.js b/server/api/smsQueue/smsQueue.model.js index 7eb03b3..0826bf7 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 _0x068c=['sms_queues','lodash','util','moment','bluebird','request-promise','path','rimraf','../../config/environment','./smsQueue.attributes','exports','SmsQueue'];(function(_0x5ea60d,_0xf1b6f3){var _0x1d14eb=function(_0x5a348d){while(--_0x5a348d){_0x5ea60d['push'](_0x5ea60d['shift']());}};_0x1d14eb(++_0xf1b6f3);}(_0x068c,0x91));var _0xc068=function(_0x44e30a,_0x8250ca){_0x44e30a=_0x44e30a-0x0;var _0x50d154=_0x068c[_0x44e30a];return _0x50d154;};'use strict';var _=require(_0xc068('0x0'));var util=require(_0xc068('0x1'));var logger=require('../../config/logger')('api');var moment=require(_0xc068('0x2'));var BPromise=require(_0xc068('0x3'));var rp=require(_0xc068('0x4'));var fs=require('fs');var path=require(_0xc068('0x5'));var rimraf=require(_0xc068('0x6'));var config=require(_0xc068('0x7'));var attributes=require(_0xc068('0x8'));module[_0xc068('0x9')]=function(_0x10e90c,_0x1785e1){return _0x10e90c['define'](_0xc068('0xa'),attributes,{'tableName':_0xc068('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x2593=['api','bluebird','path','rimraf','../../config/environment','exports','SmsQueue','sms_queues','lodash','util','../../config/logger'];(function(_0x8530f,_0x85d308){var _0x280b35=function(_0x455e63){while(--_0x455e63){_0x8530f['push'](_0x8530f['shift']());}};_0x280b35(++_0x85d308);}(_0x2593,0x1e1));var _0x3259=function(_0x58e469,_0x95ee3e){_0x58e469=_0x58e469-0x0;var _0x4c01c5=_0x2593[_0x58e469];return _0x4c01c5;};'use strict';var _=require(_0x3259('0x0'));var util=require(_0x3259('0x1'));var logger=require(_0x3259('0x2'))(_0x3259('0x3'));var moment=require('moment');var BPromise=require(_0x3259('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x3259('0x5'));var rimraf=require(_0x3259('0x6'));var config=require(_0x3259('0x7'));var attributes=require('./smsQueue.attributes');module[_0x3259('0x8')]=function(_0x12352f,_0x5e69a1){return _0x12352f['define'](_0x3259('0x9'),attributes,{'tableName':_0x3259('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/smsQueue/smsQueue.rpc.js b/server/api/smsQueue/smsQueue.rpc.js index 3d548d3..bf9691c 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 _0x45e5=['util','bluebird','ioredis','../../config/utils','../../config/logger','rpc','client','http','redis','defaults','localhost','socket.io-emitter','./smsQueue.socket','register','request','info','SmsQueue,\x20%s,\x20%s','request\x20sent','debug','SmsQueue,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','GetSmsQueue','SmsQueue','findAll','options','raw','where','attributes','limit','include','model','map','then','ShowSmsQueue','lodash'];(function(_0x820867,_0x64e498){var _0x1efea4=function(_0x52c426){while(--_0x52c426){_0x820867['push'](_0x820867['shift']());}};_0x1efea4(++_0x64e498);}(_0x45e5,0x13f));var _0x545e=function(_0x489544,_0x1c54b5){_0x489544=_0x489544-0x0;var _0x42f404=_0x45e5[_0x489544];return _0x42f404;};'use strict';var _=require(_0x545e('0x0'));var util=require(_0x545e('0x1'));var moment=require('moment');var BPromise=require(_0x545e('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x545e('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x545e('0x4'));var logger=require(_0x545e('0x5'))(_0x545e('0x6'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x545e('0x7')][_0x545e('0x8')]({'port':0x232a});config[_0x545e('0x9')]=_[_0x545e('0xa')](config['redis'],{'host':_0x545e('0xb'),'port':0x18eb});var socket=require(_0x545e('0xc'))(new Redis(config['redis']));require(_0x545e('0xd'))[_0x545e('0xe')](socket);function respondWithRpcPromise(_0x1a9f31,_0x17cd60,_0x3ea283){return new BPromise(function(_0x2d16e9,_0x4012aa){return client[_0x545e('0xf')](_0x1a9f31,_0x3ea283)['then'](function(_0x58f200){logger[_0x545e('0x10')](_0x545e('0x11'),_0x17cd60,_0x545e('0x12'));logger[_0x545e('0x13')](_0x545e('0x14'),_0x17cd60,_0x545e('0x12'),JSON[_0x545e('0x15')](_0x58f200));if(_0x58f200[_0x545e('0x16')]){if(_0x58f200[_0x545e('0x16')][_0x545e('0x17')]===0x1f4){logger['error'](_0x545e('0x11'),_0x17cd60,_0x58f200[_0x545e('0x16')][_0x545e('0x18')]);return _0x4012aa(_0x58f200[_0x545e('0x16')][_0x545e('0x18')]);}logger[_0x545e('0x16')](_0x545e('0x11'),_0x17cd60,_0x58f200[_0x545e('0x16')][_0x545e('0x18')]);return _0x2d16e9(_0x58f200[_0x545e('0x16')][_0x545e('0x18')]);}else{logger[_0x545e('0x10')]('SmsQueue,\x20%s,\x20%s',_0x17cd60,_0x545e('0x12'));_0x2d16e9(_0x58f200[_0x545e('0x19')][_0x545e('0x18')]);}})[_0x545e('0x1a')](function(_0x57e24d){logger[_0x545e('0x16')](_0x545e('0x11'),_0x17cd60,_0x57e24d);_0x4012aa(_0x57e24d);});});}exports[_0x545e('0x1b')]=function(_0x135cd9){var _0x360f40=this;return new Promise(function(_0x3e3966,_0x2a7de0){return db[_0x545e('0x1c')][_0x545e('0x1d')]({'raw':_0x135cd9[_0x545e('0x1e')]?_0x135cd9['options'][_0x545e('0x1f')]===undefined?!![]:![]:!![],'where':_0x135cd9['options']?_0x135cd9[_0x545e('0x1e')][_0x545e('0x20')]||null:null,'attributes':_0x135cd9[_0x545e('0x1e')]?_0x135cd9[_0x545e('0x1e')][_0x545e('0x21')]||null:null,'limit':_0x135cd9[_0x545e('0x1e')]?_0x135cd9['options'][_0x545e('0x22')]||null:null,'include':_0x135cd9[_0x545e('0x1e')]?_0x135cd9[_0x545e('0x1e')]['include']?_['map'](_0x135cd9[_0x545e('0x1e')][_0x545e('0x23')],function(_0x312008){return{'model':db[_0x312008[_0x545e('0x24')]],'as':_0x312008['as'],'attributes':_0x312008['attributes'],'include':_0x312008['include']?_['map'](_0x312008[_0x545e('0x23')],function(_0x4cdb6e){return{'model':db[_0x4cdb6e[_0x545e('0x24')]],'as':_0x4cdb6e['as'],'attributes':_0x4cdb6e[_0x545e('0x21')],'include':_0x4cdb6e[_0x545e('0x23')]?_[_0x545e('0x25')](_0x4cdb6e[_0x545e('0x23')],function(_0x48047f){return{'model':db[_0x48047f[_0x545e('0x24')]],'as':_0x48047f['as'],'attributes':_0x48047f[_0x545e('0x21')]};}):[]};}):[]};}):[]:[]})[_0x545e('0x26')](function(_0x1a8d31){logger[_0x545e('0x10')](_0x545e('0x1b'),_0x135cd9);logger['debug'](_0x545e('0x1b'),_0x135cd9,JSON['stringify'](_0x1a8d31));_0x3e3966(_0x1a8d31);})[_0x545e('0x1a')](function(_0x4a698a){logger['error'](_0x545e('0x1b'),_0x4a698a[_0x545e('0x18')],_0x135cd9);_0x2a7de0(_0x360f40[_0x545e('0x16')](0x1f4,_0x4a698a[_0x545e('0x18')]));});});};exports[_0x545e('0x27')]=function(_0x5b6f18){var _0x3ce1e4=this;return new Promise(function(_0x2f33ed,_0xdff3a){return db[_0x545e('0x1c')]['find']({'raw':_0x5b6f18[_0x545e('0x1e')]?_0x5b6f18[_0x545e('0x1e')][_0x545e('0x1f')]===undefined?!![]:![]:!![],'where':_0x5b6f18[_0x545e('0x1e')]?_0x5b6f18[_0x545e('0x1e')]['where']||null:null,'attributes':_0x5b6f18[_0x545e('0x1e')]?_0x5b6f18[_0x545e('0x1e')][_0x545e('0x21')]||null:null,'include':_0x5b6f18[_0x545e('0x1e')]?_0x5b6f18[_0x545e('0x1e')][_0x545e('0x23')]?_[_0x545e('0x25')](_0x5b6f18[_0x545e('0x1e')]['include'],function(_0x30ead5){return{'model':db[_0x30ead5[_0x545e('0x24')]],'as':_0x30ead5['as'],'attributes':_0x30ead5[_0x545e('0x21')],'include':_0x30ead5['include']?_[_0x545e('0x25')](_0x30ead5[_0x545e('0x23')],function(_0xc52d5b){return{'model':db[_0xc52d5b[_0x545e('0x24')]],'as':_0xc52d5b['as'],'attributes':_0xc52d5b[_0x545e('0x21')],'include':_0xc52d5b[_0x545e('0x23')]?_[_0x545e('0x25')](_0xc52d5b[_0x545e('0x23')],function(_0x31af81){return{'model':db[_0x31af81[_0x545e('0x24')]],'as':_0x31af81['as'],'attributes':_0x31af81[_0x545e('0x21')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x51c0a3){logger['info'](_0x545e('0x27'),_0x5b6f18);logger[_0x545e('0x13')]('ShowSmsQueue',_0x5b6f18,JSON['stringify'](_0x51c0a3));_0x2f33ed(_0x51c0a3);})[_0x545e('0x1a')](function(_0x4a95c8){logger[_0x545e('0x16')]('ShowSmsQueue',_0x4a95c8[_0x545e('0x18')],_0x5b6f18);_0xdff3a(_0x3ce1e4[_0x545e('0x16')](0x1f4,_0x4a95c8[_0x545e('0x18')]));});});}; \ No newline at end of file +var _0xe57c=['SmsQueue,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result','catch','GetSmsQueue','findAll','options','attributes','limit','map','model','include','then','ShowSmsQueue','SmsQueue','find','raw','where','lodash','util','bluebird','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis','defaults','socket.io-emitter','./smsQueue.socket','register','SmsQueue,\x20%s,\x20%s','request\x20sent','debug'];(function(_0x414cd2,_0x4b4ae1){var _0x29be9f=function(_0x80b3c){while(--_0x80b3c){_0x414cd2['push'](_0x414cd2['shift']());}};_0x29be9f(++_0x4b4ae1);}(_0xe57c,0x91));var _0xce57=function(_0x336cc0,_0x428e7c){_0x336cc0=_0x336cc0-0x0;var _0x2fbdaa=_0xe57c[_0x336cc0];return _0x2fbdaa;};'use strict';var _=require(_0xce57('0x0'));var util=require(_0xce57('0x1'));var moment=require('moment');var BPromise=require(_0xce57('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xce57('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0xce57('0x4'));var logger=require(_0xce57('0x5'))(_0xce57('0x6'));var config=require(_0xce57('0x7'));var jayson=require(_0xce57('0x8'));var client=jayson[_0xce57('0x9')][_0xce57('0xa')]({'port':0x232a});config[_0xce57('0xb')]=_[_0xce57('0xc')](config[_0xce57('0xb')],{'host':'localhost','port':0x18eb});var socket=require(_0xce57('0xd'))(new Redis(config[_0xce57('0xb')]));require(_0xce57('0xe'))[_0xce57('0xf')](socket);function respondWithRpcPromise(_0x58f760,_0x35ddeb,_0x3892aa){return new BPromise(function(_0x248cb6,_0x4a047c){return client['request'](_0x58f760,_0x3892aa)['then'](function(_0x219500){logger['info'](_0xce57('0x10'),_0x35ddeb,_0xce57('0x11'));logger[_0xce57('0x12')](_0xce57('0x13'),_0x35ddeb,'request\x20sent',JSON[_0xce57('0x14')](_0x219500));if(_0x219500[_0xce57('0x15')]){if(_0x219500['error'][_0xce57('0x16')]===0x1f4){logger[_0xce57('0x15')](_0xce57('0x10'),_0x35ddeb,_0x219500['error'][_0xce57('0x17')]);return _0x4a047c(_0x219500[_0xce57('0x15')][_0xce57('0x17')]);}logger['error'](_0xce57('0x10'),_0x35ddeb,_0x219500[_0xce57('0x15')][_0xce57('0x17')]);return _0x248cb6(_0x219500['error']['message']);}else{logger[_0xce57('0x18')]('SmsQueue,\x20%s,\x20%s',_0x35ddeb,'request\x20sent');_0x248cb6(_0x219500[_0xce57('0x19')]['message']);}})[_0xce57('0x1a')](function(_0x8cc1eb){logger[_0xce57('0x15')](_0xce57('0x10'),_0x35ddeb,_0x8cc1eb);_0x4a047c(_0x8cc1eb);});});}exports[_0xce57('0x1b')]=function(_0x43c67e){var _0xac2692=this;return new Promise(function(_0x4d72c9,_0x4544eb){return db['SmsQueue'][_0xce57('0x1c')]({'raw':_0x43c67e['options']?_0x43c67e[_0xce57('0x1d')]['raw']===undefined?!![]:![]:!![],'where':_0x43c67e[_0xce57('0x1d')]?_0x43c67e[_0xce57('0x1d')]['where']||null:null,'attributes':_0x43c67e[_0xce57('0x1d')]?_0x43c67e[_0xce57('0x1d')][_0xce57('0x1e')]||null:null,'limit':_0x43c67e[_0xce57('0x1d')]?_0x43c67e[_0xce57('0x1d')][_0xce57('0x1f')]||null:null,'include':_0x43c67e[_0xce57('0x1d')]?_0x43c67e[_0xce57('0x1d')]['include']?_[_0xce57('0x20')](_0x43c67e[_0xce57('0x1d')]['include'],function(_0x1cc019){return{'model':db[_0x1cc019[_0xce57('0x21')]],'as':_0x1cc019['as'],'attributes':_0x1cc019[_0xce57('0x1e')],'include':_0x1cc019[_0xce57('0x22')]?_[_0xce57('0x20')](_0x1cc019[_0xce57('0x22')],function(_0x1c2710){return{'model':db[_0x1c2710[_0xce57('0x21')]],'as':_0x1c2710['as'],'attributes':_0x1c2710[_0xce57('0x1e')],'include':_0x1c2710[_0xce57('0x22')]?_[_0xce57('0x20')](_0x1c2710[_0xce57('0x22')],function(_0x5f838a){return{'model':db[_0x5f838a['model']],'as':_0x5f838a['as'],'attributes':_0x5f838a[_0xce57('0x1e')]};}):[]};}):[]};}):[]:[]})[_0xce57('0x23')](function(_0x5ec08d){logger['info'](_0xce57('0x1b'),_0x43c67e);logger[_0xce57('0x12')](_0xce57('0x1b'),_0x43c67e,JSON[_0xce57('0x14')](_0x5ec08d));_0x4d72c9(_0x5ec08d);})['catch'](function(_0x5548ef){logger[_0xce57('0x15')]('GetSmsQueue',_0x5548ef[_0xce57('0x17')],_0x43c67e);_0x4544eb(_0xac2692[_0xce57('0x15')](0x1f4,_0x5548ef[_0xce57('0x17')]));});});};exports[_0xce57('0x24')]=function(_0x4bcd56){var _0x1d111c=this;return new Promise(function(_0x18bf87,_0x4c5edb){return db[_0xce57('0x25')][_0xce57('0x26')]({'raw':_0x4bcd56[_0xce57('0x1d')]?_0x4bcd56[_0xce57('0x1d')][_0xce57('0x27')]===undefined?!![]:![]:!![],'where':_0x4bcd56[_0xce57('0x1d')]?_0x4bcd56[_0xce57('0x1d')][_0xce57('0x28')]||null:null,'attributes':_0x4bcd56[_0xce57('0x1d')]?_0x4bcd56['options'][_0xce57('0x1e')]||null:null,'include':_0x4bcd56[_0xce57('0x1d')]?_0x4bcd56[_0xce57('0x1d')]['include']?_[_0xce57('0x20')](_0x4bcd56[_0xce57('0x1d')][_0xce57('0x22')],function(_0x34c4b7){return{'model':db[_0x34c4b7['model']],'as':_0x34c4b7['as'],'attributes':_0x34c4b7[_0xce57('0x1e')],'include':_0x34c4b7[_0xce57('0x22')]?_['map'](_0x34c4b7[_0xce57('0x22')],function(_0x146344){return{'model':db[_0x146344[_0xce57('0x21')]],'as':_0x146344['as'],'attributes':_0x146344[_0xce57('0x1e')],'include':_0x146344['include']?_[_0xce57('0x20')](_0x146344[_0xce57('0x22')],function(_0x21cc8f){return{'model':db[_0x21cc8f['model']],'as':_0x21cc8f['as'],'attributes':_0x21cc8f['attributes']};}):[]};}):[]};}):[]:[]})['then'](function(_0x5f5d88){logger[_0xce57('0x18')](_0xce57('0x24'),_0x4bcd56);logger[_0xce57('0x12')]('ShowSmsQueue',_0x4bcd56,JSON[_0xce57('0x14')](_0x5f5d88));_0x18bf87(_0x5f5d88);})['catch'](function(_0x3a0189){logger[_0xce57('0x15')]('ShowSmsQueue',_0x3a0189[_0xce57('0x17')],_0x4bcd56);_0x4c5edb(_0x1d111c[_0xce57('0x15')](0x1f4,_0x3a0189['message']));});});}; \ No newline at end of file diff --git a/server/api/smsQueue/smsQueue.socket.js b/server/api/smsQueue/smsQueue.socket.js index 94e8d77..712064f 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 _0xb0db=['emit','length','./smsQueue.events','save','remove'];(function(_0x2a8879,_0x1aff4f){var _0xff5dc9=function(_0x1e13f4){while(--_0x1e13f4){_0x2a8879['push'](_0x2a8879['shift']());}};_0xff5dc9(++_0x1aff4f);}(_0xb0db,0x106));var _0xbb0d=function(_0x9b6975,_0x63c435){_0x9b6975=_0x9b6975-0x0;var _0x3f3132=_0xb0db[_0x9b6975];return _0x3f3132;};'use strict';var SmsQueueEvents=require(_0xbb0d('0x0'));var events=[_0xbb0d('0x1'),_0xbb0d('0x2'),'update'];function createListener(_0x26c2fb,_0x539043){return function(_0x4b4a6f){_0x539043[_0xbb0d('0x3')](_0x26c2fb,_0x4b4a6f);};}function removeListener(_0x15fcf1,_0x9c40f5){return function(){SmsQueueEvents['removeListener'](_0x15fcf1,_0x9c40f5);};}exports['register']=function(_0x4a1a39){for(var _0x5bc212=0x0,_0x44572a=events[_0xbb0d('0x4')];_0x5bc212<_0x44572a;_0x5bc212++){var _0x1c5f78=events[_0x5bc212];var _0x2275dc=createListener('smsQueue:'+_0x1c5f78,_0x4a1a39);SmsQueueEvents['on'](_0x1c5f78,_0x2275dc);}}; \ No newline at end of file +var _0xa36c=['update','emit','register','length','smsQueue:','./smsQueue.events'];(function(_0x498c78,_0x2eab48){var _0xb7697f=function(_0x1f6da7){while(--_0x1f6da7){_0x498c78['push'](_0x498c78['shift']());}};_0xb7697f(++_0x2eab48);}(_0xa36c,0x1d3));var _0xca36=function(_0x5b644e,_0x2e5e07){_0x5b644e=_0x5b644e-0x0;var _0x49c6bf=_0xa36c[_0x5b644e];return _0x49c6bf;};'use strict';var SmsQueueEvents=require(_0xca36('0x0'));var events=['save','remove',_0xca36('0x1')];function createListener(_0x5dae6d,_0x4b382c){return function(_0x1ff9bb){_0x4b382c[_0xca36('0x2')](_0x5dae6d,_0x1ff9bb);};}function removeListener(_0x4efc65,_0x2d4347){return function(){SmsQueueEvents['removeListener'](_0x4efc65,_0x2d4347);};}exports[_0xca36('0x3')]=function(_0x235441){for(var _0x11cdc9=0x0,_0x250678=events[_0xca36('0x4')];_0x11cdc9<_0x250678;_0x11cdc9++){var _0x4eaa8d=events[_0x11cdc9];var _0x42e7ba=createListener(_0xca36('0x5')+_0x4eaa8d,_0x235441);SmsQueueEvents['on'](_0x4eaa8d,_0x42e7ba);}}; \ No newline at end of file diff --git a/server/api/smsQueueReport/index.js b/server/api/smsQueueReport/index.js index 7bb2cfb..075fa7d 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 _0x15ad=['connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','isAuthenticated','get','/describe','describe','/:id','show','create','delete','destroy','exports','multer','util','path'];(function(_0x5ca44a,_0x4865c9){var _0x9372b9=function(_0x1301ea){while(--_0x1301ea){_0x5ca44a['push'](_0x5ca44a['shift']());}};_0x9372b9(++_0x4865c9);}(_0x15ad,0x19b));var _0xd15a=function(_0x346651,_0x55ce9e){_0x346651=_0x346651-0x0;var _0x1d6106=_0x15ad[_0x346651];return _0x1d6106;};'use strict';var multer=require(_0xd15a('0x0'));var util=require(_0xd15a('0x1'));var path=require(_0xd15a('0x2'));var timeout=require(_0xd15a('0x3'));var express=require(_0xd15a('0x4'));var router=express['Router']();var fs_extra=require(_0xd15a('0x5'));var auth=require(_0xd15a('0x6'));var interaction=require(_0xd15a('0x7'));var config=require('../../config/environment');var controller=require('./smsQueueReport.controller');router['get']('/',auth[_0xd15a('0x8')](),controller['index']);router[_0xd15a('0x9')](_0xd15a('0xa'),auth['isAuthenticated'](),controller[_0xd15a('0xb')]);router[_0xd15a('0x9')](_0xd15a('0xc'),auth[_0xd15a('0x8')](),controller[_0xd15a('0xd')]);router['post']('/',auth[_0xd15a('0x8')](),controller[_0xd15a('0xe')]);router['put'](_0xd15a('0xc'),auth['isAuthenticated'](),controller['update']);router[_0xd15a('0xf')](_0xd15a('0xc'),auth['isAuthenticated'](),controller[_0xd15a('0x10')]);module[_0xd15a('0x11')]=router; \ No newline at end of file +var _0x5a63=['util','express','../../components/auth/service','../../components/interaction/service','../../config/environment','./smsQueueReport.controller','get','index','/describe','describe','/:id','isAuthenticated','show','post','put','delete','destroy','exports','multer'];(function(_0x11d72f,_0x38723a){var _0x26c028=function(_0x4dd2e4){while(--_0x4dd2e4){_0x11d72f['push'](_0x11d72f['shift']());}};_0x26c028(++_0x38723a);}(_0x5a63,0xe3));var _0x35a6=function(_0x277162,_0x96df18){_0x277162=_0x277162-0x0;var _0x19472e=_0x5a63[_0x277162];return _0x19472e;};'use strict';var multer=require(_0x35a6('0x0'));var util=require(_0x35a6('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0x35a6('0x2'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0x35a6('0x3'));var interaction=require(_0x35a6('0x4'));var config=require(_0x35a6('0x5'));var controller=require(_0x35a6('0x6'));router[_0x35a6('0x7')]('/',auth['isAuthenticated'](),controller[_0x35a6('0x8')]);router['get'](_0x35a6('0x9'),auth['isAuthenticated'](),controller[_0x35a6('0xa')]);router['get'](_0x35a6('0xb'),auth[_0x35a6('0xc')](),controller[_0x35a6('0xd')]);router[_0x35a6('0xe')]('/',auth[_0x35a6('0xc')](),controller['create']);router[_0x35a6('0xf')](_0x35a6('0xb'),auth[_0x35a6('0xc')](),controller['update']);router[_0x35a6('0x10')]('/:id',auth[_0x35a6('0xc')](),controller[_0x35a6('0x11')]);module[_0x35a6('0x12')]=router; \ No newline at end of file diff --git a/server/api/smsQueueReport/smsQueueReport.attributes.js b/server/api/smsQueueReport/smsQueueReport.attributes.js index 32c7e79..6ac672c 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 _0x8d8e=['STRING','DATE','moment','sequelize','exports'];(function(_0x37182a,_0x2c4cfd){var _0x360384=function(_0x54ec95){while(--_0x54ec95){_0x37182a['push'](_0x37182a['shift']());}};_0x360384(++_0x2c4cfd);}(_0x8d8e,0xd9));var _0xe8d8=function(_0x46aff0,_0x122890){_0x46aff0=_0x46aff0-0x0;var _0x9d78cf=_0x8d8e[_0x46aff0];return _0x9d78cf;};'use strict';var moment=require(_0xe8d8('0x0'));var Sequelize=require(_0xe8d8('0x1'));module[_0xe8d8('0x2')]={'uniqueid':{'type':Sequelize['STRING'],'allowNull':![]},'from':{'type':Sequelize[_0xe8d8('0x3')]},'joinAt':{'type':Sequelize[_0xe8d8('0x4')]},'leaveAt':{'type':Sequelize['DATE']},'acceptAt':{'type':Sequelize[_0xe8d8('0x4')]},'exitAt':{'type':Sequelize[_0xe8d8('0x4')]},'reason':{'type':Sequelize[_0xe8d8('0x3')]}}; \ No newline at end of file +var _0x5d38=['DATE','moment','exports','STRING'];(function(_0x2f64b0,_0xdfd89){var _0x5d4014=function(_0x5bc70b){while(--_0x5bc70b){_0x2f64b0['push'](_0x2f64b0['shift']());}};_0x5d4014(++_0xdfd89);}(_0x5d38,0xdd));var _0x85d3=function(_0x160c73,_0x2ee678){_0x160c73=_0x160c73-0x0;var _0xd9302=_0x5d38[_0x160c73];return _0xd9302;};'use strict';var moment=require(_0x85d3('0x0'));var Sequelize=require('sequelize');module[_0x85d3('0x1')]={'uniqueid':{'type':Sequelize[_0x85d3('0x2')],'allowNull':![]},'from':{'type':Sequelize[_0x85d3('0x2')]},'joinAt':{'type':Sequelize[_0x85d3('0x3')]},'leaveAt':{'type':Sequelize['DATE']},'acceptAt':{'type':Sequelize[_0x85d3('0x3')]},'exitAt':{'type':Sequelize[_0x85d3('0x3')]},'reason':{'type':Sequelize[_0x85d3('0x2')]}}; \ No newline at end of file diff --git a/server/api/smsQueueReport/smsQueueReport.controller.js b/server/api/smsQueueReport/smsQueueReport.controller.js index 77c218b..ee36070 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 _0xe756=['stack','name','send','index','map','SmsQueueReport','fieldName','type','key','model','query','filters','intersection','attributes','fields','hasOwnProperty','sort','where','pick','merge','VIRTUAL','options','includeAll','findAll','catch','show','params','keys','find','create','update','body','destroy','describe','eml-format','zip-dir','fast-json-patch','bluebird','mustache','util','sox','fs-extra','lodash','squel','crypto','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/environment','../../config/license/util','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','then','error'];(function(_0x4c99ee,_0x2d8768){var _0x24bc5f=function(_0x9b00c1){while(--_0x9b00c1){_0x4c99ee['push'](_0x4c99ee['shift']());}};_0x24bc5f(++_0x2d8768);}(_0xe756,0x13e));var _0x6e75=function(_0x24d032,_0xb53d6b){_0x24d032=_0x24d032-0x0;var _0x2bd0da=_0xe756[_0x24d032];return _0x2bd0da;};'use strict';var emlformat=require(_0x6e75('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x6e75('0x1'));var jsonpatch=require(_0x6e75('0x2'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0x6e75('0x3'));var Mustache=require(_0x6e75('0x4'));var util=require(_0x6e75('0x5'));var path=require('path');var sox=require(_0x6e75('0x6'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x6e75('0x7'));var _=require(_0x6e75('0x8'));var squel=require(_0x6e75('0x9'));var crypto=require(_0x6e75('0xa'));var jsforce=require(_0x6e75('0xb'));var deskjs=require(_0x6e75('0xc'));var toCsv=require(_0x6e75('0xd'));var querystring=require(_0x6e75('0xe'));var Papa=require(_0x6e75('0xf'));var Redis=require(_0x6e75('0x10'));var authService=require(_0x6e75('0x11'));var qs=require('../../components/parsers/qs');var as=require(_0x6e75('0x12'));var hardwareService=require(_0x6e75('0x13'));var logger=require('../../config/logger')('api');var utils=require('../../config/utils');var config=require(_0x6e75('0x14'));var licenseUtil=require(_0x6e75('0x15'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x211aca,_0x96fa5d){_0x96fa5d=_0x96fa5d||0xcc;return function(_0x10c073){if(_0x10c073){return _0x211aca[_0x6e75('0x16')](_0x96fa5d);}return _0x211aca[_0x6e75('0x17')](_0x96fa5d)[_0x6e75('0x18')]();};}function respondWithResult(_0x42d017,_0x4b1400){_0x4b1400=_0x4b1400||0xc8;return function(_0x52b01c){if(_0x52b01c){return _0x42d017[_0x6e75('0x17')](_0x4b1400)[_0x6e75('0x19')](_0x52b01c);}};}function respondWithFilteredResult(_0x316473,_0x48d20){return function(_0x48c4af){if(_0x48c4af){var _0x16d808=typeof _0x48d20[_0x6e75('0x1a')]===_0x6e75('0x1b')&&typeof _0x48d20[_0x6e75('0x1c')]===_0x6e75('0x1b');var _0x29bebb=_0x48c4af[_0x6e75('0x1d')];var _0x544949=_0x16d808?0x0:_0x48d20[_0x6e75('0x1a')];var _0x2a142e=_0x16d808?_0x48c4af['count']:_0x48d20[_0x6e75('0x1a')]+_0x48d20[_0x6e75('0x1c')];var _0x14ca21;if(_0x2a142e>=_0x29bebb){_0x2a142e=_0x29bebb;_0x14ca21=0xc8;}else{_0x14ca21=0xce;}_0x316473[_0x6e75('0x17')](_0x14ca21);return _0x316473[_0x6e75('0x1e')](_0x6e75('0x1f'),_0x544949+'-'+_0x2a142e+'/'+_0x29bebb)[_0x6e75('0x19')](_0x48c4af);}return null;};}function patchUpdates(_0x45f166){return function(_0x1c7037){try{jsonpatch[_0x6e75('0x20')](_0x1c7037,_0x45f166,!![]);}catch(_0x2fd20e){return BPromise[_0x6e75('0x21')](_0x2fd20e);}return _0x1c7037[_0x6e75('0x22')]();};}function saveUpdates(_0x28b36e,_0x3782c4){return function(_0x5c5f37){if(_0x5c5f37){return _0x5c5f37['update'](_0x28b36e)[_0x6e75('0x23')](function(_0x1d4850){return _0x1d4850;});}return null;};}function removeEntity(_0x144469,_0x257734){return function(_0x5abfe4){if(_0x5abfe4){return _0x5abfe4['destroy']()[_0x6e75('0x23')](function(){_0x144469[_0x6e75('0x17')](0xcc)[_0x6e75('0x18')]();});}};}function handleEntityNotFound(_0x2f5955,_0x2d5450){return function(_0x55b667){if(!_0x55b667){_0x2f5955['sendStatus'](0x194);}return _0x55b667;};}function handleError(_0x555a44,_0x53ba48){_0x53ba48=_0x53ba48||0x1f4;return function(_0x2d2d48){logger[_0x6e75('0x24')](_0x2d2d48[_0x6e75('0x25')]);if(_0x2d2d48[_0x6e75('0x26')]){delete _0x2d2d48['name'];}_0x555a44[_0x6e75('0x17')](_0x53ba48)[_0x6e75('0x27')](_0x2d2d48);};}exports[_0x6e75('0x28')]=function(_0x27115d,_0x18492f){var _0x188c63={},_0x398210={},_0x5bb8d0={'count':0x0,'rows':[]};var _0x13d652=_[_0x6e75('0x29')](db[_0x6e75('0x2a')]['rawAttributes'],function(_0x4336d7){return{'name':_0x4336d7[_0x6e75('0x2b')],'type':_0x4336d7[_0x6e75('0x2c')][_0x6e75('0x2d')]};});_0x398210[_0x6e75('0x2e')]=_['map'](_0x13d652,_0x6e75('0x26'));_0x398210[_0x6e75('0x2f')]=_['keys'](_0x27115d['query']);_0x398210[_0x6e75('0x30')]=_[_0x6e75('0x31')](_0x398210[_0x6e75('0x2e')],_0x398210[_0x6e75('0x2f')]);_0x188c63[_0x6e75('0x32')]=_['intersection'](_0x398210[_0x6e75('0x2e')],qs['fields'](_0x27115d[_0x6e75('0x2f')][_0x6e75('0x33')]));_0x188c63[_0x6e75('0x32')]=_0x188c63['attributes']['length']?_0x188c63[_0x6e75('0x32')]:_0x398210[_0x6e75('0x2e')];if(!_0x27115d[_0x6e75('0x2f')][_0x6e75('0x34')]('nolimit')){_0x188c63[_0x6e75('0x1c')]=qs[_0x6e75('0x1c')](_0x27115d[_0x6e75('0x2f')]['limit']);_0x188c63['offset']=qs[_0x6e75('0x1a')](_0x27115d[_0x6e75('0x2f')][_0x6e75('0x1a')]);}_0x188c63['order']=qs[_0x6e75('0x35')](_0x27115d[_0x6e75('0x2f')][_0x6e75('0x35')]);_0x188c63[_0x6e75('0x36')]=qs[_0x6e75('0x30')](_[_0x6e75('0x37')](_0x27115d[_0x6e75('0x2f')],_0x398210[_0x6e75('0x30')]),_0x13d652);if(_0x27115d[_0x6e75('0x2f')]['filter']){_0x188c63['where']=_[_0x6e75('0x38')](_0x188c63[_0x6e75('0x36')],{'$or':_['map'](_0x13d652,function(_0x4cc736){if(_0x4cc736['type']!==_0x6e75('0x39')){var _0x2ab4f8={};_0x2ab4f8[_0x4cc736[_0x6e75('0x26')]]={'$like':'%'+_0x27115d['query']['filter']+'%'};return _0x2ab4f8;}})});}_0x188c63=_[_0x6e75('0x38')]({},_0x188c63,_0x27115d[_0x6e75('0x3a')]);var _0x367abb={'where':_0x188c63[_0x6e75('0x36')]};return db[_0x6e75('0x2a')]['count'](_0x367abb)[_0x6e75('0x23')](function(_0x399b7a){_0x5bb8d0['count']=_0x399b7a;if(_0x27115d[_0x6e75('0x2f')][_0x6e75('0x3b')]){_0x188c63['include']=[{'all':!![]}];}return db[_0x6e75('0x2a')][_0x6e75('0x3c')](_0x188c63);})[_0x6e75('0x23')](function(_0x33666b){_0x5bb8d0['rows']=_0x33666b;return _0x5bb8d0;})[_0x6e75('0x23')](respondWithFilteredResult(_0x18492f,_0x188c63))[_0x6e75('0x3d')](handleError(_0x18492f,null));};exports[_0x6e75('0x3e')]=function(_0xff6ba0,_0x590fc1){var _0x2e508e={'raw':!![],'where':{'id':_0xff6ba0[_0x6e75('0x3f')]['id']}},_0x125547={};_0x125547[_0x6e75('0x2e')]=_[_0x6e75('0x40')](db[_0x6e75('0x2a')]['rawAttributes']);_0x125547['query']=_[_0x6e75('0x40')](_0xff6ba0[_0x6e75('0x2f')]);_0x125547[_0x6e75('0x30')]=_['intersection'](_0x125547[_0x6e75('0x2e')],_0x125547[_0x6e75('0x2f')]);_0x2e508e[_0x6e75('0x32')]=_[_0x6e75('0x31')](_0x125547['model'],qs['fields'](_0xff6ba0[_0x6e75('0x2f')][_0x6e75('0x33')]));_0x2e508e['attributes']=_0x2e508e['attributes']['length']?_0x2e508e['attributes']:_0x125547['model'];if(_0xff6ba0[_0x6e75('0x2f')]['includeAll']){_0x2e508e['include']=[{'all':!![]}];}_0x2e508e=_['merge']({},_0x2e508e,_0xff6ba0[_0x6e75('0x3a')]);return db['SmsQueueReport'][_0x6e75('0x41')](_0x2e508e)['then'](handleEntityNotFound(_0x590fc1,null))[_0x6e75('0x23')](respondWithResult(_0x590fc1,null))[_0x6e75('0x3d')](handleError(_0x590fc1,null));};exports['create']=function(_0x93e96a,_0x41a1ab){return db['SmsQueueReport'][_0x6e75('0x42')](_0x93e96a['body'],{})[_0x6e75('0x23')](respondWithResult(_0x41a1ab,0xc9))[_0x6e75('0x3d')](handleError(_0x41a1ab,null));};exports[_0x6e75('0x43')]=function(_0x487eb7,_0x51ea9a){if(_0x487eb7[_0x6e75('0x44')]['id']){delete _0x487eb7[_0x6e75('0x44')]['id'];}return db[_0x6e75('0x2a')]['find']({'where':{'id':_0x487eb7[_0x6e75('0x3f')]['id']}})[_0x6e75('0x23')](handleEntityNotFound(_0x51ea9a,null))[_0x6e75('0x23')](saveUpdates(_0x487eb7[_0x6e75('0x44')],null))['then'](respondWithResult(_0x51ea9a,null))[_0x6e75('0x3d')](handleError(_0x51ea9a,null));};exports[_0x6e75('0x45')]=function(_0x3205f4,_0x313955){return db[_0x6e75('0x2a')]['find']({'where':{'id':_0x3205f4[_0x6e75('0x3f')]['id']}})[_0x6e75('0x23')](handleEntityNotFound(_0x313955,null))[_0x6e75('0x23')](removeEntity(_0x313955,null))[_0x6e75('0x3d')](handleError(_0x313955,null));};exports[_0x6e75('0x46')]=function(_0x3392ae,_0x134c74){return db['SmsQueueReport'][_0x6e75('0x46')]()[_0x6e75('0x23')](respondWithResult(_0x134c74,null))[_0x6e75('0x3d')](handleError(_0x134c74,null));}; \ No newline at end of file +var _0x1ca0=['../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','then','destroy','error','name','send','index','map','SmsQueueReport','rawAttributes','fieldName','type','model','query','attributes','intersection','length','order','sort','where','filters','filter','VIRTUAL','options','includeAll','include','catch','show','params','keys','fields','merge','find','create','body','update','describe','eml-format','zip-dir','fast-json-patch','moment','mustache','sox','to-csv','ejs','fs-extra','lodash','jsforce','desk.js','querystring','papaparse'];(function(_0x5427c8,_0x18f384){var _0x33a129=function(_0x1940e8){while(--_0x1940e8){_0x5427c8['push'](_0x5427c8['shift']());}};_0x33a129(++_0x18f384);}(_0x1ca0,0x80));var _0x01ca=function(_0x5922f7,_0x23885e){_0x5922f7=_0x5922f7-0x0;var _0x145529=_0x1ca0[_0x5922f7];return _0x145529;};'use strict';var emlformat=require(_0x01ca('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x01ca('0x1'));var jsonpatch=require(_0x01ca('0x2'));var rp=require('request-promise');var moment=require(_0x01ca('0x3'));var BPromise=require('bluebird');var Mustache=require(_0x01ca('0x4'));var util=require('util');var path=require('path');var sox=require(_0x01ca('0x5'));var csv=require(_0x01ca('0x6'));var ejs=require(_0x01ca('0x7'));var fs=require('fs');var fs_extra=require(_0x01ca('0x8'));var _=require(_0x01ca('0x9'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0x01ca('0xa'));var deskjs=require(_0x01ca('0xb'));var toCsv=require(_0x01ca('0x6'));var querystring=require(_0x01ca('0xc'));var Papa=require(_0x01ca('0xd'));var Redis=require('ioredis');var authService=require(_0x01ca('0xe'));var qs=require(_0x01ca('0xf'));var as=require(_0x01ca('0x10'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x01ca('0x11'))(_0x01ca('0x12'));var utils=require(_0x01ca('0x13'));var config=require(_0x01ca('0x14'));var licenseUtil=require('../../config/license/util');var db=require(_0x01ca('0x15'))['db'];function respondWithStatusCode(_0xada345,_0x59ea15){_0x59ea15=_0x59ea15||0xcc;return function(_0x4a16ca){if(_0x4a16ca){return _0xada345[_0x01ca('0x16')](_0x59ea15);}return _0xada345[_0x01ca('0x17')](_0x59ea15)[_0x01ca('0x18')]();};}function respondWithResult(_0x68228e,_0x5de4cd){_0x5de4cd=_0x5de4cd||0xc8;return function(_0x4b195a){if(_0x4b195a){return _0x68228e[_0x01ca('0x17')](_0x5de4cd)[_0x01ca('0x19')](_0x4b195a);}};}function respondWithFilteredResult(_0x3b21ff,_0x5eefcd){return function(_0x8787f7){if(_0x8787f7){var _0x691a05=typeof _0x5eefcd[_0x01ca('0x1a')]===_0x01ca('0x1b')&&typeof _0x5eefcd[_0x01ca('0x1c')]==='undefined';var _0x1885cb=_0x8787f7[_0x01ca('0x1d')];var _0x5d0f8d=_0x691a05?0x0:_0x5eefcd[_0x01ca('0x1a')];var _0x54beaf=_0x691a05?_0x8787f7[_0x01ca('0x1d')]:_0x5eefcd['offset']+_0x5eefcd[_0x01ca('0x1c')];var _0x4dd0ab;if(_0x54beaf>=_0x1885cb){_0x54beaf=_0x1885cb;_0x4dd0ab=0xc8;}else{_0x4dd0ab=0xce;}_0x3b21ff[_0x01ca('0x17')](_0x4dd0ab);return _0x3b21ff[_0x01ca('0x1e')](_0x01ca('0x1f'),_0x5d0f8d+'-'+_0x54beaf+'/'+_0x1885cb)[_0x01ca('0x19')](_0x8787f7);}return null;};}function patchUpdates(_0x9a3413){return function(_0x2714fe){try{jsonpatch[_0x01ca('0x20')](_0x2714fe,_0x9a3413,!![]);}catch(_0x3a75f6){return BPromise[_0x01ca('0x21')](_0x3a75f6);}return _0x2714fe[_0x01ca('0x22')]();};}function saveUpdates(_0x3ae1b1,_0x129bde){return function(_0x1cf08c){if(_0x1cf08c){return _0x1cf08c['update'](_0x3ae1b1)[_0x01ca('0x23')](function(_0x49fbfe){return _0x49fbfe;});}return null;};}function removeEntity(_0x2c0f9f,_0x3db4ca){return function(_0x29f73c){if(_0x29f73c){return _0x29f73c[_0x01ca('0x24')]()[_0x01ca('0x23')](function(){_0x2c0f9f[_0x01ca('0x17')](0xcc)[_0x01ca('0x18')]();});}};}function handleEntityNotFound(_0x23388d,_0x16f16e){return function(_0xde07a4){if(!_0xde07a4){_0x23388d[_0x01ca('0x16')](0x194);}return _0xde07a4;};}function handleError(_0x58e2ce,_0x1bc4da){_0x1bc4da=_0x1bc4da||0x1f4;return function(_0x4b697b){logger[_0x01ca('0x25')](_0x4b697b['stack']);if(_0x4b697b[_0x01ca('0x26')]){delete _0x4b697b[_0x01ca('0x26')];}_0x58e2ce['status'](_0x1bc4da)[_0x01ca('0x27')](_0x4b697b);};}exports[_0x01ca('0x28')]=function(_0x3e5a35,_0x2b5e39){var _0x4915a0={},_0x11588e={},_0x302e14={'count':0x0,'rows':[]};var _0x658c18=_[_0x01ca('0x29')](db[_0x01ca('0x2a')][_0x01ca('0x2b')],function(_0xc532af){return{'name':_0xc532af[_0x01ca('0x2c')],'type':_0xc532af[_0x01ca('0x2d')]['key']};});_0x11588e[_0x01ca('0x2e')]=_[_0x01ca('0x29')](_0x658c18,_0x01ca('0x26'));_0x11588e[_0x01ca('0x2f')]=_['keys'](_0x3e5a35[_0x01ca('0x2f')]);_0x11588e['filters']=_['intersection'](_0x11588e[_0x01ca('0x2e')],_0x11588e[_0x01ca('0x2f')]);_0x4915a0[_0x01ca('0x30')]=_[_0x01ca('0x31')](_0x11588e[_0x01ca('0x2e')],qs['fields'](_0x3e5a35['query']['fields']));_0x4915a0[_0x01ca('0x30')]=_0x4915a0[_0x01ca('0x30')][_0x01ca('0x32')]?_0x4915a0[_0x01ca('0x30')]:_0x11588e[_0x01ca('0x2e')];if(!_0x3e5a35[_0x01ca('0x2f')]['hasOwnProperty']('nolimit')){_0x4915a0[_0x01ca('0x1c')]=qs[_0x01ca('0x1c')](_0x3e5a35['query']['limit']);_0x4915a0[_0x01ca('0x1a')]=qs[_0x01ca('0x1a')](_0x3e5a35['query'][_0x01ca('0x1a')]);}_0x4915a0[_0x01ca('0x33')]=qs[_0x01ca('0x34')](_0x3e5a35[_0x01ca('0x2f')]['sort']);_0x4915a0[_0x01ca('0x35')]=qs[_0x01ca('0x36')](_['pick'](_0x3e5a35['query'],_0x11588e[_0x01ca('0x36')]),_0x658c18);if(_0x3e5a35[_0x01ca('0x2f')][_0x01ca('0x37')]){_0x4915a0[_0x01ca('0x35')]=_['merge'](_0x4915a0[_0x01ca('0x35')],{'$or':_[_0x01ca('0x29')](_0x658c18,function(_0x21adac){if(_0x21adac[_0x01ca('0x2d')]!==_0x01ca('0x38')){var _0x4d4dbc={};_0x4d4dbc[_0x21adac[_0x01ca('0x26')]]={'$like':'%'+_0x3e5a35[_0x01ca('0x2f')]['filter']+'%'};return _0x4d4dbc;}})});}_0x4915a0=_['merge']({},_0x4915a0,_0x3e5a35[_0x01ca('0x39')]);var _0x4e2262={'where':_0x4915a0[_0x01ca('0x35')]};return db[_0x01ca('0x2a')][_0x01ca('0x1d')](_0x4e2262)['then'](function(_0x2b9800){_0x302e14[_0x01ca('0x1d')]=_0x2b9800;if(_0x3e5a35[_0x01ca('0x2f')][_0x01ca('0x3a')]){_0x4915a0[_0x01ca('0x3b')]=[{'all':!![]}];}return db['SmsQueueReport']['findAll'](_0x4915a0);})[_0x01ca('0x23')](function(_0x50e1d2){_0x302e14['rows']=_0x50e1d2;return _0x302e14;})[_0x01ca('0x23')](respondWithFilteredResult(_0x2b5e39,_0x4915a0))[_0x01ca('0x3c')](handleError(_0x2b5e39,null));};exports[_0x01ca('0x3d')]=function(_0x23b08d,_0x4260b7){var _0x3db33a={'raw':!![],'where':{'id':_0x23b08d[_0x01ca('0x3e')]['id']}},_0xdead1f={};_0xdead1f[_0x01ca('0x2e')]=_['keys'](db[_0x01ca('0x2a')]['rawAttributes']);_0xdead1f[_0x01ca('0x2f')]=_[_0x01ca('0x3f')](_0x23b08d['query']);_0xdead1f['filters']=_[_0x01ca('0x31')](_0xdead1f[_0x01ca('0x2e')],_0xdead1f[_0x01ca('0x2f')]);_0x3db33a[_0x01ca('0x30')]=_[_0x01ca('0x31')](_0xdead1f[_0x01ca('0x2e')],qs[_0x01ca('0x40')](_0x23b08d[_0x01ca('0x2f')][_0x01ca('0x40')]));_0x3db33a[_0x01ca('0x30')]=_0x3db33a['attributes'][_0x01ca('0x32')]?_0x3db33a[_0x01ca('0x30')]:_0xdead1f['model'];if(_0x23b08d[_0x01ca('0x2f')][_0x01ca('0x3a')]){_0x3db33a['include']=[{'all':!![]}];}_0x3db33a=_[_0x01ca('0x41')]({},_0x3db33a,_0x23b08d[_0x01ca('0x39')]);return db[_0x01ca('0x2a')][_0x01ca('0x42')](_0x3db33a)[_0x01ca('0x23')](handleEntityNotFound(_0x4260b7,null))[_0x01ca('0x23')](respondWithResult(_0x4260b7,null))['catch'](handleError(_0x4260b7,null));};exports[_0x01ca('0x43')]=function(_0xc7a49c,_0x296fab){return db['SmsQueueReport'][_0x01ca('0x43')](_0xc7a49c[_0x01ca('0x44')],{})[_0x01ca('0x23')](respondWithResult(_0x296fab,0xc9))[_0x01ca('0x3c')](handleError(_0x296fab,null));};exports[_0x01ca('0x45')]=function(_0x531205,_0x577303){if(_0x531205[_0x01ca('0x44')]['id']){delete _0x531205[_0x01ca('0x44')]['id'];}return db[_0x01ca('0x2a')][_0x01ca('0x42')]({'where':{'id':_0x531205[_0x01ca('0x3e')]['id']}})['then'](handleEntityNotFound(_0x577303,null))[_0x01ca('0x23')](saveUpdates(_0x531205[_0x01ca('0x44')],null))[_0x01ca('0x23')](respondWithResult(_0x577303,null))['catch'](handleError(_0x577303,null));};exports[_0x01ca('0x24')]=function(_0x359f60,_0x5d7e34){return db[_0x01ca('0x2a')][_0x01ca('0x42')]({'where':{'id':_0x359f60[_0x01ca('0x3e')]['id']}})['then'](handleEntityNotFound(_0x5d7e34,null))[_0x01ca('0x23')](removeEntity(_0x5d7e34,null))[_0x01ca('0x3c')](handleError(_0x5d7e34,null));};exports['describe']=function(_0x17532a,_0x437538){return db[_0x01ca('0x2a')][_0x01ca('0x46')]()['then'](respondWithResult(_0x437538,null))[_0x01ca('0x3c')](handleError(_0x437538,null));}; \ No newline at end of file diff --git a/server/api/smsQueueReport/smsQueueReport.model.js b/server/api/smsQueueReport/smsQueueReport.model.js index f8cd9b9..d9df430 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 _0xcb91=['path','rimraf','./smsQueueReport.attributes','exports','define','report_sms_queue','uniqueid','../../config/logger','api','moment','bluebird'];(function(_0x28713b,_0x4ed965){var _0x39b010=function(_0x4286f5){while(--_0x4286f5){_0x28713b['push'](_0x28713b['shift']());}};_0x39b010(++_0x4ed965);}(_0xcb91,0x1a9));var _0x1cb9=function(_0x47e93d,_0x26bbdd){_0x47e93d=_0x47e93d-0x0;var _0xe86c46=_0xcb91[_0x47e93d];return _0xe86c46;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x1cb9('0x0'))(_0x1cb9('0x1'));var moment=require(_0x1cb9('0x2'));var BPromise=require(_0x1cb9('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x1cb9('0x4'));var rimraf=require(_0x1cb9('0x5'));var config=require('../../config/environment');var attributes=require(_0x1cb9('0x6'));module[_0x1cb9('0x7')]=function(_0x53ffbd,_0x226b69){return _0x53ffbd[_0x1cb9('0x8')]('SmsQueueReport',attributes,{'tableName':_0x1cb9('0x9'),'paranoid':![],'indexes':[{'name':_0x1cb9('0xa'),'fields':['uniqueid']}],'timestamps':!![]});}; \ No newline at end of file +var _0xa9e0=['define','SmsQueueReport','uniqueid','lodash','util','../../config/logger','bluebird','path','rimraf','../../config/environment','./smsQueueReport.attributes','exports'];(function(_0x19950b,_0x53d0d7){var _0x3c6b41=function(_0x3924ad){while(--_0x3924ad){_0x19950b['push'](_0x19950b['shift']());}};_0x3c6b41(++_0x53d0d7);}(_0xa9e0,0x123));var _0x0a9e=function(_0x4dbaad,_0x730318){_0x4dbaad=_0x4dbaad-0x0;var _0x226c72=_0xa9e0[_0x4dbaad];return _0x226c72;};'use strict';var _=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var 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 diff --git a/server/api/smsQueueReport/smsQueueReport.rpc.js b/server/api/smsQueueReport/smsQueueReport.rpc.js index 15e1f95..78f549f 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 _0xe5aa=['result','catch','CreateSmsQueueReport','create','options','stringify','UpdateSmsQueueReport','SmsQueueReport','update','where','attributes','util','moment','bluebird','randomstring','ioredis','rpc','jayson/promise','client','http','request','then','SmsQueueReport,\x20%s,\x20%s','request\x20sent','debug','SmsQueueReport,\x20%s,\x20%s,\x20%s','error','code','message','info'];(function(_0x3ee935,_0x293a98){var _0x586db7=function(_0x18db5c){while(--_0x18db5c){_0x3ee935['push'](_0x3ee935['shift']());}};_0x586db7(++_0x293a98);}(_0xe5aa,0x119));var _0xae5a=function(_0x53d268,_0x56846c){_0x53d268=_0x53d268-0x0;var _0x4f39f2=_0xe5aa[_0x53d268];return _0x4f39f2;};'use strict';var _=require('lodash');var util=require(_0xae5a('0x0'));var moment=require(_0xae5a('0x1'));var BPromise=require(_0xae5a('0x2'));var rs=require(_0xae5a('0x3'));var fs=require('fs');var Redis=require(_0xae5a('0x4'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0xae5a('0x5'));var config=require('../../config/environment');var jayson=require(_0xae5a('0x6'));var client=jayson[_0xae5a('0x7')][_0xae5a('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x1f0440,_0x48ec8d,_0x5124e1){return new BPromise(function(_0x29eeb3,_0x4822b8){return client[_0xae5a('0x9')](_0x1f0440,_0x5124e1)[_0xae5a('0xa')](function(_0x56c9ae){logger['info'](_0xae5a('0xb'),_0x48ec8d,_0xae5a('0xc'));logger[_0xae5a('0xd')](_0xae5a('0xe'),_0x48ec8d,'request\x20sent',JSON['stringify'](_0x56c9ae));if(_0x56c9ae[_0xae5a('0xf')]){if(_0x56c9ae[_0xae5a('0xf')][_0xae5a('0x10')]===0x1f4){logger[_0xae5a('0xf')]('SmsQueueReport,\x20%s,\x20%s',_0x48ec8d,_0x56c9ae['error'][_0xae5a('0x11')]);return _0x4822b8(_0x56c9ae[_0xae5a('0xf')][_0xae5a('0x11')]);}logger[_0xae5a('0xf')](_0xae5a('0xb'),_0x48ec8d,_0x56c9ae[_0xae5a('0xf')][_0xae5a('0x11')]);return _0x29eeb3(_0x56c9ae[_0xae5a('0xf')][_0xae5a('0x11')]);}else{logger[_0xae5a('0x12')](_0xae5a('0xb'),_0x48ec8d,_0xae5a('0xc'));_0x29eeb3(_0x56c9ae[_0xae5a('0x13')][_0xae5a('0x11')]);}})[_0xae5a('0x14')](function(_0x13a1de){logger[_0xae5a('0xf')]('SmsQueueReport,\x20%s,\x20%s',_0x48ec8d,_0x13a1de);_0x4822b8(_0x13a1de);});});}exports[_0xae5a('0x15')]=function(_0xa9c6ca){var _0x2dad52=this;return new Promise(function(_0x2115f7,_0x4fc7f1){return db['SmsQueueReport'][_0xae5a('0x16')](_0xa9c6ca['body'],{'raw':_0xa9c6ca[_0xae5a('0x17')]?_0xa9c6ca[_0xae5a('0x17')]['raw']===undefined?!![]:![]:!![]})[_0xae5a('0xa')](function(_0x430ca3){logger[_0xae5a('0x12')](_0xae5a('0x15'),_0xa9c6ca);logger[_0xae5a('0xd')](_0xae5a('0x15'),_0xa9c6ca,JSON[_0xae5a('0x18')](_0x430ca3));_0x2115f7(_0x430ca3);})[_0xae5a('0x14')](function(_0x58405a){logger['error'](_0xae5a('0x15'),_0x58405a[_0xae5a('0x11')],_0xa9c6ca);_0x4fc7f1(_0x2dad52[_0xae5a('0xf')](0x1f4,_0x58405a['message']));});});};exports[_0xae5a('0x19')]=function(_0x228bb8){var _0x46a843=this;return new Promise(function(_0x5403f8,_0x2637fa){return db[_0xae5a('0x1a')][_0xae5a('0x1b')](_0x228bb8['body'],{'raw':_0x228bb8['options']?_0x228bb8[_0xae5a('0x17')]['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x228bb8[_0xae5a('0x17')]?_0x228bb8[_0xae5a('0x17')][_0xae5a('0x1c')]||null:null,'attributes':_0x228bb8[_0xae5a('0x17')]?_0x228bb8[_0xae5a('0x17')][_0xae5a('0x1d')]||null:null,'limit':_0x228bb8['options']?_0x228bb8[_0xae5a('0x17')]['limit']||null:null})[_0xae5a('0xa')](function(_0x13766d){logger[_0xae5a('0x12')](_0xae5a('0x19'),_0x228bb8);logger['debug'](_0xae5a('0x19'),_0x228bb8,JSON[_0xae5a('0x18')](_0x13766d));_0x5403f8(_0x13766d);})[_0xae5a('0x14')](function(_0x567ae7){logger[_0xae5a('0xf')]('UpdateSmsQueueReport',_0x567ae7[_0xae5a('0x11')],_0x228bb8);_0x2637fa(_0x46a843[_0xae5a('0xf')](0x1f4,_0x567ae7['message']));});});}; \ No newline at end of file +var _0x4694=['message','info','result','catch','CreateSmsQueueReport','SmsQueueReport','options','update','body','raw','where','attributes','limit','UpdateSmsQueueReport','lodash','util','moment','randomstring','ioredis','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','SmsQueueReport,\x20%s,\x20%s','debug','request\x20sent','error','code'];(function(_0x1a1116,_0x5ca1f9){var _0x34753c=function(_0x45ac7e){while(--_0x45ac7e){_0x1a1116['push'](_0x1a1116['shift']());}};_0x34753c(++_0x5ca1f9);}(_0x4694,0x8e));var _0x4469=function(_0x754ab4,_0x56daa7){_0x754ab4=_0x754ab4-0x0;var _0x34079a=_0x4694[_0x754ab4];return _0x34079a;};'use strict';var _=require(_0x4469('0x0'));var util=require(_0x4469('0x1'));var moment=require(_0x4469('0x2'));var BPromise=require('bluebird');var rs=require(_0x4469('0x3'));var fs=require('fs');var Redis=require(_0x4469('0x4'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0x4469('0x5'))(_0x4469('0x6'));var config=require(_0x4469('0x7'));var jayson=require(_0x4469('0x8'));var client=jayson[_0x4469('0x9')][_0x4469('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x4df817,_0x351bf0,_0x237a1f){return new BPromise(function(_0xfd4ce7,_0x5e064c){return client[_0x4469('0xb')](_0x4df817,_0x237a1f)[_0x4469('0xc')](function(_0x18dc74){logger['info'](_0x4469('0xd'),_0x351bf0,'request\x20sent');logger[_0x4469('0xe')]('SmsQueueReport,\x20%s,\x20%s,\x20%s',_0x351bf0,_0x4469('0xf'),JSON['stringify'](_0x18dc74));if(_0x18dc74[_0x4469('0x10')]){if(_0x18dc74[_0x4469('0x10')][_0x4469('0x11')]===0x1f4){logger[_0x4469('0x10')]('SmsQueueReport,\x20%s,\x20%s',_0x351bf0,_0x18dc74[_0x4469('0x10')][_0x4469('0x12')]);return _0x5e064c(_0x18dc74[_0x4469('0x10')][_0x4469('0x12')]);}logger[_0x4469('0x10')](_0x4469('0xd'),_0x351bf0,_0x18dc74['error'][_0x4469('0x12')]);return _0xfd4ce7(_0x18dc74[_0x4469('0x10')][_0x4469('0x12')]);}else{logger[_0x4469('0x13')](_0x4469('0xd'),_0x351bf0,_0x4469('0xf'));_0xfd4ce7(_0x18dc74[_0x4469('0x14')][_0x4469('0x12')]);}})[_0x4469('0x15')](function(_0x56c521){logger['error']('SmsQueueReport,\x20%s,\x20%s',_0x351bf0,_0x56c521);_0x5e064c(_0x56c521);});});}exports[_0x4469('0x16')]=function(_0x2423bd){var _0x235ea0=this;return new Promise(function(_0x3f2a4a,_0x5ea6d7){return db[_0x4469('0x17')]['create'](_0x2423bd['body'],{'raw':_0x2423bd['options']?_0x2423bd[_0x4469('0x18')]['raw']===undefined?!![]:![]:!![]})[_0x4469('0xc')](function(_0x560f47){logger[_0x4469('0x13')]('CreateSmsQueueReport',_0x2423bd);logger[_0x4469('0xe')](_0x4469('0x16'),_0x2423bd,JSON['stringify'](_0x560f47));_0x3f2a4a(_0x560f47);})['catch'](function(_0x3b0527){logger[_0x4469('0x10')]('CreateSmsQueueReport',_0x3b0527[_0x4469('0x12')],_0x2423bd);_0x5ea6d7(_0x235ea0[_0x4469('0x10')](0x1f4,_0x3b0527[_0x4469('0x12')]));});});};exports['UpdateSmsQueueReport']=function(_0x118251){var _0x4ff09c=this;return new Promise(function(_0x3b7284,_0x74437a){return db[_0x4469('0x17')][_0x4469('0x19')](_0x118251[_0x4469('0x1a')],{'raw':_0x118251[_0x4469('0x18')]?_0x118251['options'][_0x4469('0x1b')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x118251[_0x4469('0x18')]?_0x118251['options'][_0x4469('0x1c')]||null:null,'attributes':_0x118251[_0x4469('0x18')]?_0x118251[_0x4469('0x18')][_0x4469('0x1d')]||null:null,'limit':_0x118251[_0x4469('0x18')]?_0x118251[_0x4469('0x18')][_0x4469('0x1e')]||null:null})['then'](function(_0x8d7162){logger[_0x4469('0x13')](_0x4469('0x1f'),_0x118251);logger[_0x4469('0xe')](_0x4469('0x1f'),_0x118251,JSON['stringify'](_0x8d7162));_0x3b7284(_0x8d7162);})[_0x4469('0x15')](function(_0x225291){logger['error'](_0x4469('0x1f'),_0x225291[_0x4469('0x12')],_0x118251);_0x74437a(_0x4ff09c[_0x4469('0x10')](0x1f4,_0x225291[_0x4469('0x12')]));});});}; \ No newline at end of file diff --git a/server/api/smsTransferReport/index.js b/server/api/smsTransferReport/index.js index 49ed530..6cb9dde 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 _0x2b83=['/describe','describe','/:id','put','update','util','path','express','Router','fs-extra','../../config/environment','./smsTransferReport.controller','isAuthenticated','get'];(function(_0x255c48,_0x2a4449){var _0xaebda3=function(_0x12a04e){while(--_0x12a04e){_0x255c48['push'](_0x255c48['shift']());}};_0xaebda3(++_0x2a4449);}(_0x2b83,0x1d3));var _0x32b8=function(_0x37dd92,_0x415ab9){_0x37dd92=_0x37dd92-0x0;var _0x3c2719=_0x2b83[_0x37dd92];return _0x3c2719;};'use strict';var multer=require('multer');var util=require(_0x32b8('0x0'));var path=require(_0x32b8('0x1'));var timeout=require('connect-timeout');var express=require(_0x32b8('0x2'));var router=express[_0x32b8('0x3')]();var fs_extra=require(_0x32b8('0x4'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0x32b8('0x5'));var controller=require(_0x32b8('0x6'));router['get']('/',auth[_0x32b8('0x7')](),controller['index']);router[_0x32b8('0x8')](_0x32b8('0x9'),auth[_0x32b8('0x7')](),controller[_0x32b8('0xa')]);router['get'](_0x32b8('0xb'),auth[_0x32b8('0x7')](),controller['show']);router['post']('/',auth[_0x32b8('0x7')](),controller['create']);router[_0x32b8('0xc')](_0x32b8('0xb'),auth[_0x32b8('0x7')](),controller[_0x32b8('0xd')]);router['delete'](_0x32b8('0xb'),auth[_0x32b8('0x7')](),controller['destroy']);module['exports']=router; \ No newline at end of file +var _0x8ce1=['express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./smsTransferReport.controller','get','isAuthenticated','index','/describe','describe','/:id','post','create','put','update','delete','destroy','multer','util','path','connect-timeout'];(function(_0x4b46aa,_0x371901){var _0x4164f7=function(_0x37d48f){while(--_0x37d48f){_0x4b46aa['push'](_0x4b46aa['shift']());}};_0x4164f7(++_0x371901);}(_0x8ce1,0x183));var _0x18ce=function(_0x2d8542,_0x1e6bd9){_0x2d8542=_0x2d8542-0x0;var _0x8e4142=_0x8ce1[_0x2d8542];return _0x8e4142;};'use strict';var multer=require(_0x18ce('0x0'));var util=require(_0x18ce('0x1'));var path=require(_0x18ce('0x2'));var timeout=require(_0x18ce('0x3'));var express=require(_0x18ce('0x4'));var router=express[_0x18ce('0x5')]();var fs_extra=require(_0x18ce('0x6'));var auth=require(_0x18ce('0x7'));var interaction=require(_0x18ce('0x8'));var config=require(_0x18ce('0x9'));var controller=require(_0x18ce('0xa'));router[_0x18ce('0xb')]('/',auth[_0x18ce('0xc')](),controller[_0x18ce('0xd')]);router[_0x18ce('0xb')](_0x18ce('0xe'),auth['isAuthenticated'](),controller[_0x18ce('0xf')]);router[_0x18ce('0xb')](_0x18ce('0x10'),auth[_0x18ce('0xc')](),controller['show']);router[_0x18ce('0x11')]('/',auth[_0x18ce('0xc')](),controller[_0x18ce('0x12')]);router[_0x18ce('0x13')]('/:id',auth['isAuthenticated'](),controller[_0x18ce('0x14')]);router[_0x18ce('0x15')](_0x18ce('0x10'),auth[_0x18ce('0xc')](),controller[_0x18ce('0x16')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/smsTransferReport/smsTransferReport.attributes.js b/server/api/smsTransferReport/smsTransferReport.attributes.js index c0a4f15..36a4abf 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 _0xaa88=['account','agent','queue','DATE','NOW','moment','sequelize','exports','STRING'];(function(_0x1ba576,_0x397070){var _0x48b26c=function(_0x13799c){while(--_0x13799c){_0x1ba576['push'](_0x1ba576['shift']());}};_0x48b26c(++_0x397070);}(_0xaa88,0x137));var _0x8aa8=function(_0x203d64,_0x1ec79c){_0x203d64=_0x203d64-0x0;var _0x462ab3=_0xaa88[_0x203d64];return _0x462ab3;};'use strict';var moment=require(_0x8aa8('0x0'));var Sequelize=require(_0x8aa8('0x1'));module[_0x8aa8('0x2')]={'uniqueid':{'type':Sequelize[_0x8aa8('0x3')],'allowNull':![]},'type':{'type':Sequelize['ENUM'](_0x8aa8('0x4'),_0x8aa8('0x5'),_0x8aa8('0x6')),'allowNull':![],'defaultValue':_0x8aa8('0x6')},'transferredAt':{'type':Sequelize[_0x8aa8('0x7')],'allowNull':![],'defaultValue':Sequelize[_0x8aa8('0x8')]}}; \ No newline at end of file +var _0xedd9=['account','agent','queue','NOW','sequelize','exports','STRING','ENUM'];(function(_0x248569,_0xbf5f24){var _0x568232=function(_0x1b21f9){while(--_0x1b21f9){_0x248569['push'](_0x248569['shift']());}};_0x568232(++_0xbf5f24);}(_0xedd9,0xfc));var _0x9edd=function(_0x5af55a,_0xecd971){_0x5af55a=_0x5af55a-0x0;var _0x20d7a9=_0xedd9[_0x5af55a];return _0x20d7a9;};'use strict';var moment=require('moment');var Sequelize=require(_0x9edd('0x0'));module[_0x9edd('0x1')]={'uniqueid':{'type':Sequelize[_0x9edd('0x2')],'allowNull':![]},'type':{'type':Sequelize[_0x9edd('0x3')](_0x9edd('0x4'),_0x9edd('0x5'),_0x9edd('0x6')),'allowNull':![],'defaultValue':_0x9edd('0x6')},'transferredAt':{'type':Sequelize['DATE'],'allowNull':![],'defaultValue':Sequelize[_0x9edd('0x7')]}}; \ No newline at end of file diff --git a/server/api/smsTransferReport/smsTransferReport.controller.js b/server/api/smsTransferReport/smsTransferReport.controller.js index 80d393e..ee02aea 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 _0x3427=['offset','undefined','limit','count','set','reject','save','update','destroy','then','sendStatus','error','stack','name','send','index','map','SmsTransferReport','rawAttributes','fieldName','key','model','query','keys','intersection','attributes','fields','hasOwnProperty','nolimit','sort','where','filters','pick','filter','merge','type','options','includeAll','include','findAll','rows','catch','show','params','length','find','create','body','describe','eml-format','rimraf','zip-dir','fast-json-patch','moment','sox','to-csv','ejs','fs-extra','squel','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','status','end','json'];(function(_0x578111,_0x3bd10c){var _0x3356a0=function(_0x1dd0f1){while(--_0x1dd0f1){_0x578111['push'](_0x578111['shift']());}};_0x3356a0(++_0x3bd10c);}(_0x3427,0x1f3));var _0x7342=function(_0x1fa62f,_0x5ba625){_0x1fa62f=_0x1fa62f-0x0;var _0x269984=_0x3427[_0x1fa62f];return _0x269984;};'use strict';var emlformat=require(_0x7342('0x0'));var rimraf=require(_0x7342('0x1'));var zipdir=require(_0x7342('0x2'));var jsonpatch=require(_0x7342('0x3'));var rp=require('request-promise');var moment=require(_0x7342('0x4'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require('util');var path=require('path');var sox=require(_0x7342('0x5'));var csv=require(_0x7342('0x6'));var ejs=require(_0x7342('0x7'));var fs=require('fs');var fs_extra=require(_0x7342('0x8'));var _=require('lodash');var squel=require(_0x7342('0x9'));var crypto=require('crypto');var jsforce=require(_0x7342('0xa'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0x7342('0xb'));var Papa=require(_0x7342('0xc'));var Redis=require(_0x7342('0xd'));var authService=require(_0x7342('0xe'));var qs=require(_0x7342('0xf'));var as=require(_0x7342('0x10'));var hardwareService=require(_0x7342('0x11'));var logger=require(_0x7342('0x12'))(_0x7342('0x13'));var utils=require(_0x7342('0x14'));var config=require('../../config/environment');var licenseUtil=require(_0x7342('0x15'));var db=require(_0x7342('0x16'))['db'];function respondWithStatusCode(_0xa7f07b,_0x4fcaf7){_0x4fcaf7=_0x4fcaf7||0xcc;return function(_0x904e8d){if(_0x904e8d){return _0xa7f07b['sendStatus'](_0x4fcaf7);}return _0xa7f07b[_0x7342('0x17')](_0x4fcaf7)[_0x7342('0x18')]();};}function respondWithResult(_0x2b2f4f,_0x3b23af){_0x3b23af=_0x3b23af||0xc8;return function(_0x14db02){if(_0x14db02){return _0x2b2f4f['status'](_0x3b23af)[_0x7342('0x19')](_0x14db02);}};}function respondWithFilteredResult(_0x5657c2,_0x2f7c2d){return function(_0x825508){if(_0x825508){var _0x4d9df9=typeof _0x2f7c2d[_0x7342('0x1a')]===_0x7342('0x1b')&&typeof _0x2f7c2d[_0x7342('0x1c')]==='undefined';var _0x2bae67=_0x825508[_0x7342('0x1d')];var _0x4ba44d=_0x4d9df9?0x0:_0x2f7c2d[_0x7342('0x1a')];var _0x367837=_0x4d9df9?_0x825508[_0x7342('0x1d')]:_0x2f7c2d[_0x7342('0x1a')]+_0x2f7c2d[_0x7342('0x1c')];var _0x14754c;if(_0x367837>=_0x2bae67){_0x367837=_0x2bae67;_0x14754c=0xc8;}else{_0x14754c=0xce;}_0x5657c2[_0x7342('0x17')](_0x14754c);return _0x5657c2[_0x7342('0x1e')]('Content-Range',_0x4ba44d+'-'+_0x367837+'/'+_0x2bae67)['json'](_0x825508);}return null;};}function patchUpdates(_0x51e6e9){return function(_0x5c6de9){try{jsonpatch['apply'](_0x5c6de9,_0x51e6e9,!![]);}catch(_0x20bf46){return BPromise[_0x7342('0x1f')](_0x20bf46);}return _0x5c6de9[_0x7342('0x20')]();};}function saveUpdates(_0x2489f1,_0x399020){return function(_0x556630){if(_0x556630){return _0x556630[_0x7342('0x21')](_0x2489f1)['then'](function(_0x3a0202){return _0x3a0202;});}return null;};}function removeEntity(_0x4889e4,_0x438516){return function(_0x2ac3b1){if(_0x2ac3b1){return _0x2ac3b1[_0x7342('0x22')]()[_0x7342('0x23')](function(){_0x4889e4[_0x7342('0x17')](0xcc)[_0x7342('0x18')]();});}};}function handleEntityNotFound(_0x5bc2ee,_0x1f7ff0){return function(_0x26a25a){if(!_0x26a25a){_0x5bc2ee[_0x7342('0x24')](0x194);}return _0x26a25a;};}function handleError(_0x5ab173,_0x49f29e){_0x49f29e=_0x49f29e||0x1f4;return function(_0x1a542a){logger[_0x7342('0x25')](_0x1a542a[_0x7342('0x26')]);if(_0x1a542a[_0x7342('0x27')]){delete _0x1a542a[_0x7342('0x27')];}_0x5ab173[_0x7342('0x17')](_0x49f29e)[_0x7342('0x28')](_0x1a542a);};}exports[_0x7342('0x29')]=function(_0x136b9d,_0x135acc){var _0x747e8={},_0x4d7643={},_0x49eb50={'count':0x0,'rows':[]};var _0xf47152=_[_0x7342('0x2a')](db[_0x7342('0x2b')][_0x7342('0x2c')],function(_0x4db81b){return{'name':_0x4db81b[_0x7342('0x2d')],'type':_0x4db81b['type'][_0x7342('0x2e')]};});_0x4d7643[_0x7342('0x2f')]=_[_0x7342('0x2a')](_0xf47152,_0x7342('0x27'));_0x4d7643[_0x7342('0x30')]=_[_0x7342('0x31')](_0x136b9d[_0x7342('0x30')]);_0x4d7643['filters']=_[_0x7342('0x32')](_0x4d7643[_0x7342('0x2f')],_0x4d7643[_0x7342('0x30')]);_0x747e8[_0x7342('0x33')]=_['intersection'](_0x4d7643[_0x7342('0x2f')],qs[_0x7342('0x34')](_0x136b9d[_0x7342('0x30')]['fields']));_0x747e8[_0x7342('0x33')]=_0x747e8[_0x7342('0x33')]['length']?_0x747e8[_0x7342('0x33')]:_0x4d7643[_0x7342('0x2f')];if(!_0x136b9d[_0x7342('0x30')][_0x7342('0x35')](_0x7342('0x36'))){_0x747e8[_0x7342('0x1c')]=qs[_0x7342('0x1c')](_0x136b9d[_0x7342('0x30')][_0x7342('0x1c')]);_0x747e8['offset']=qs[_0x7342('0x1a')](_0x136b9d[_0x7342('0x30')]['offset']);}_0x747e8['order']=qs[_0x7342('0x37')](_0x136b9d[_0x7342('0x30')][_0x7342('0x37')]);_0x747e8[_0x7342('0x38')]=qs[_0x7342('0x39')](_[_0x7342('0x3a')](_0x136b9d[_0x7342('0x30')],_0x4d7643[_0x7342('0x39')]),_0xf47152);if(_0x136b9d[_0x7342('0x30')][_0x7342('0x3b')]){_0x747e8['where']=_[_0x7342('0x3c')](_0x747e8[_0x7342('0x38')],{'$or':_[_0x7342('0x2a')](_0xf47152,function(_0x3b0827){if(_0x3b0827[_0x7342('0x3d')]!=='VIRTUAL'){var _0xdf6d24={};_0xdf6d24[_0x3b0827[_0x7342('0x27')]]={'$like':'%'+_0x136b9d[_0x7342('0x30')][_0x7342('0x3b')]+'%'};return _0xdf6d24;}})});}_0x747e8=_[_0x7342('0x3c')]({},_0x747e8,_0x136b9d[_0x7342('0x3e')]);var _0x358766={'where':_0x747e8[_0x7342('0x38')]};return db[_0x7342('0x2b')][_0x7342('0x1d')](_0x358766)['then'](function(_0xe989c){_0x49eb50['count']=_0xe989c;if(_0x136b9d['query'][_0x7342('0x3f')]){_0x747e8[_0x7342('0x40')]=[{'all':!![]}];}return db[_0x7342('0x2b')][_0x7342('0x41')](_0x747e8);})[_0x7342('0x23')](function(_0x91065d){_0x49eb50[_0x7342('0x42')]=_0x91065d;return _0x49eb50;})[_0x7342('0x23')](respondWithFilteredResult(_0x135acc,_0x747e8))[_0x7342('0x43')](handleError(_0x135acc,null));};exports[_0x7342('0x44')]=function(_0x19af68,_0x226f2b){var _0x1b9ed4={'raw':!![],'where':{'id':_0x19af68[_0x7342('0x45')]['id']}},_0x2ded7c={};_0x2ded7c[_0x7342('0x2f')]=_[_0x7342('0x31')](db['SmsTransferReport']['rawAttributes']);_0x2ded7c[_0x7342('0x30')]=_[_0x7342('0x31')](_0x19af68[_0x7342('0x30')]);_0x2ded7c[_0x7342('0x39')]=_[_0x7342('0x32')](_0x2ded7c[_0x7342('0x2f')],_0x2ded7c[_0x7342('0x30')]);_0x1b9ed4[_0x7342('0x33')]=_[_0x7342('0x32')](_0x2ded7c[_0x7342('0x2f')],qs[_0x7342('0x34')](_0x19af68['query'][_0x7342('0x34')]));_0x1b9ed4[_0x7342('0x33')]=_0x1b9ed4[_0x7342('0x33')][_0x7342('0x46')]?_0x1b9ed4[_0x7342('0x33')]:_0x2ded7c[_0x7342('0x2f')];if(_0x19af68['query'][_0x7342('0x3f')]){_0x1b9ed4[_0x7342('0x40')]=[{'all':!![]}];}_0x1b9ed4=_[_0x7342('0x3c')]({},_0x1b9ed4,_0x19af68[_0x7342('0x3e')]);return db[_0x7342('0x2b')][_0x7342('0x47')](_0x1b9ed4)['then'](handleEntityNotFound(_0x226f2b,null))['then'](respondWithResult(_0x226f2b,null))[_0x7342('0x43')](handleError(_0x226f2b,null));};exports[_0x7342('0x48')]=function(_0x1db4bd,_0x57fbfd){return db[_0x7342('0x2b')][_0x7342('0x48')](_0x1db4bd[_0x7342('0x49')],{})['then'](respondWithResult(_0x57fbfd,0xc9))[_0x7342('0x43')](handleError(_0x57fbfd,null));};exports[_0x7342('0x21')]=function(_0x4eede0,_0x598e4){if(_0x4eede0[_0x7342('0x49')]['id']){delete _0x4eede0[_0x7342('0x49')]['id'];}return db[_0x7342('0x2b')][_0x7342('0x47')]({'where':{'id':_0x4eede0[_0x7342('0x45')]['id']}})['then'](handleEntityNotFound(_0x598e4,null))[_0x7342('0x23')](saveUpdates(_0x4eede0[_0x7342('0x49')],null))['then'](respondWithResult(_0x598e4,null))[_0x7342('0x43')](handleError(_0x598e4,null));};exports[_0x7342('0x22')]=function(_0x3cd2d8,_0x4748cc){return db[_0x7342('0x2b')][_0x7342('0x47')]({'where':{'id':_0x3cd2d8[_0x7342('0x45')]['id']}})[_0x7342('0x23')](handleEntityNotFound(_0x4748cc,null))[_0x7342('0x23')](removeEntity(_0x4748cc,null))[_0x7342('0x43')](handleError(_0x4748cc,null));};exports[_0x7342('0x4a')]=function(_0x4bd165,_0x54c429){return db[_0x7342('0x2b')][_0x7342('0x4a')]()[_0x7342('0x23')](respondWithResult(_0x54c429,null))['catch'](handleError(_0x54c429,null));}; \ No newline at end of file +var _0x3bd8=['update','then','destroy','sendStatus','error','stack','name','send','index','map','SmsTransferReport','fieldName','type','key','model','query','filters','attributes','intersection','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','VIRTUAL','merge','options','count','includeAll','include','findAll','show','params','keys','rawAttributes','find','catch','create','body','describe','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','ejs','fs-extra','lodash','squel','jsforce','desk.js','querystring','papaparse','../../components/parsers/qs','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','status','end','json','offset','undefined','limit','set','Content-Range','apply','reject','save'];(function(_0x1b4002,_0x5b4094){var _0x1716f3=function(_0x47cfd1){while(--_0x47cfd1){_0x1b4002['push'](_0x1b4002['shift']());}};_0x1716f3(++_0x5b4094);}(_0x3bd8,0x164));var _0x83bd=function(_0x483102,_0x54e93d){_0x483102=_0x483102-0x0;var _0x5cc885=_0x3bd8[_0x483102];return _0x5cc885;};'use strict';var emlformat=require(_0x83bd('0x0'));var rimraf=require(_0x83bd('0x1'));var zipdir=require(_0x83bd('0x2'));var jsonpatch=require(_0x83bd('0x3'));var rp=require(_0x83bd('0x4'));var moment=require(_0x83bd('0x5'));var BPromise=require(_0x83bd('0x6'));var Mustache=require('mustache');var util=require(_0x83bd('0x7'));var path=require('path');var sox=require('sox');var csv=require('to-csv');var ejs=require(_0x83bd('0x8'));var fs=require('fs');var fs_extra=require(_0x83bd('0x9'));var _=require(_0x83bd('0xa'));var squel=require(_0x83bd('0xb'));var crypto=require('crypto');var jsforce=require(_0x83bd('0xc'));var deskjs=require(_0x83bd('0xd'));var toCsv=require('to-csv');var querystring=require(_0x83bd('0xe'));var Papa=require(_0x83bd('0xf'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0x83bd('0x10'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0x83bd('0x11'))(_0x83bd('0x12'));var utils=require(_0x83bd('0x13'));var config=require(_0x83bd('0x14'));var licenseUtil=require(_0x83bd('0x15'));var db=require(_0x83bd('0x16'))['db'];function respondWithStatusCode(_0x2e7c88,_0x32e7b9){_0x32e7b9=_0x32e7b9||0xcc;return function(_0x47b60c){if(_0x47b60c){return _0x2e7c88['sendStatus'](_0x32e7b9);}return _0x2e7c88[_0x83bd('0x17')](_0x32e7b9)[_0x83bd('0x18')]();};}function respondWithResult(_0x14c2b8,_0x58b303){_0x58b303=_0x58b303||0xc8;return function(_0x70ccf2){if(_0x70ccf2){return _0x14c2b8[_0x83bd('0x17')](_0x58b303)[_0x83bd('0x19')](_0x70ccf2);}};}function respondWithFilteredResult(_0x217fba,_0x4818cb){return function(_0x2ef85e){if(_0x2ef85e){var _0x9057bd=typeof _0x4818cb[_0x83bd('0x1a')]===_0x83bd('0x1b')&&typeof _0x4818cb['limit']===_0x83bd('0x1b');var _0x51710e=_0x2ef85e['count'];var _0x4a4e6b=_0x9057bd?0x0:_0x4818cb[_0x83bd('0x1a')];var _0x4cd42a=_0x9057bd?_0x2ef85e['count']:_0x4818cb[_0x83bd('0x1a')]+_0x4818cb[_0x83bd('0x1c')];var _0x5d91b1;if(_0x4cd42a>=_0x51710e){_0x4cd42a=_0x51710e;_0x5d91b1=0xc8;}else{_0x5d91b1=0xce;}_0x217fba[_0x83bd('0x17')](_0x5d91b1);return _0x217fba[_0x83bd('0x1d')](_0x83bd('0x1e'),_0x4a4e6b+'-'+_0x4cd42a+'/'+_0x51710e)['json'](_0x2ef85e);}return null;};}function patchUpdates(_0x1d6d43){return function(_0x4de40e){try{jsonpatch[_0x83bd('0x1f')](_0x4de40e,_0x1d6d43,!![]);}catch(_0x241d04){return BPromise[_0x83bd('0x20')](_0x241d04);}return _0x4de40e[_0x83bd('0x21')]();};}function saveUpdates(_0x5a51b0,_0x13d3a4){return function(_0x28d1c5){if(_0x28d1c5){return _0x28d1c5[_0x83bd('0x22')](_0x5a51b0)[_0x83bd('0x23')](function(_0x14bb80){return _0x14bb80;});}return null;};}function removeEntity(_0x4cc88d,_0x3d43da){return function(_0x22896c){if(_0x22896c){return _0x22896c[_0x83bd('0x24')]()[_0x83bd('0x23')](function(){_0x4cc88d[_0x83bd('0x17')](0xcc)['end']();});}};}function handleEntityNotFound(_0x1785e9,_0x16b640){return function(_0x48552b){if(!_0x48552b){_0x1785e9[_0x83bd('0x25')](0x194);}return _0x48552b;};}function handleError(_0x27c403,_0x15efd0){_0x15efd0=_0x15efd0||0x1f4;return function(_0x563df0){logger[_0x83bd('0x26')](_0x563df0[_0x83bd('0x27')]);if(_0x563df0[_0x83bd('0x28')]){delete _0x563df0[_0x83bd('0x28')];}_0x27c403['status'](_0x15efd0)[_0x83bd('0x29')](_0x563df0);};}exports[_0x83bd('0x2a')]=function(_0x5530fa,_0x4632c8){var _0x5455ae={},_0x1c464c={},_0x3c9ff3={'count':0x0,'rows':[]};var _0x4906df=_[_0x83bd('0x2b')](db[_0x83bd('0x2c')]['rawAttributes'],function(_0x681cbc){return{'name':_0x681cbc[_0x83bd('0x2d')],'type':_0x681cbc[_0x83bd('0x2e')][_0x83bd('0x2f')]};});_0x1c464c[_0x83bd('0x30')]=_[_0x83bd('0x2b')](_0x4906df,'name');_0x1c464c[_0x83bd('0x31')]=_['keys'](_0x5530fa[_0x83bd('0x31')]);_0x1c464c[_0x83bd('0x32')]=_['intersection'](_0x1c464c[_0x83bd('0x30')],_0x1c464c['query']);_0x5455ae[_0x83bd('0x33')]=_[_0x83bd('0x34')](_0x1c464c[_0x83bd('0x30')],qs[_0x83bd('0x35')](_0x5530fa[_0x83bd('0x31')][_0x83bd('0x35')]));_0x5455ae[_0x83bd('0x33')]=_0x5455ae['attributes'][_0x83bd('0x36')]?_0x5455ae['attributes']:_0x1c464c[_0x83bd('0x30')];if(!_0x5530fa['query'][_0x83bd('0x37')](_0x83bd('0x38'))){_0x5455ae[_0x83bd('0x1c')]=qs[_0x83bd('0x1c')](_0x5530fa[_0x83bd('0x31')][_0x83bd('0x1c')]);_0x5455ae['offset']=qs[_0x83bd('0x1a')](_0x5530fa[_0x83bd('0x31')]['offset']);}_0x5455ae[_0x83bd('0x39')]=qs['sort'](_0x5530fa['query'][_0x83bd('0x3a')]);_0x5455ae[_0x83bd('0x3b')]=qs[_0x83bd('0x32')](_[_0x83bd('0x3c')](_0x5530fa['query'],_0x1c464c[_0x83bd('0x32')]),_0x4906df);if(_0x5530fa[_0x83bd('0x31')][_0x83bd('0x3d')]){_0x5455ae[_0x83bd('0x3b')]=_['merge'](_0x5455ae['where'],{'$or':_[_0x83bd('0x2b')](_0x4906df,function(_0x44933d){if(_0x44933d['type']!==_0x83bd('0x3e')){var _0x261a87={};_0x261a87[_0x44933d['name']]={'$like':'%'+_0x5530fa[_0x83bd('0x31')][_0x83bd('0x3d')]+'%'};return _0x261a87;}})});}_0x5455ae=_[_0x83bd('0x3f')]({},_0x5455ae,_0x5530fa[_0x83bd('0x40')]);var _0x5802c9={'where':_0x5455ae[_0x83bd('0x3b')]};return db['SmsTransferReport']['count'](_0x5802c9)[_0x83bd('0x23')](function(_0x4cd76f){_0x3c9ff3[_0x83bd('0x41')]=_0x4cd76f;if(_0x5530fa['query'][_0x83bd('0x42')]){_0x5455ae[_0x83bd('0x43')]=[{'all':!![]}];}return db[_0x83bd('0x2c')][_0x83bd('0x44')](_0x5455ae);})[_0x83bd('0x23')](function(_0x21c10d){_0x3c9ff3['rows']=_0x21c10d;return _0x3c9ff3;})['then'](respondWithFilteredResult(_0x4632c8,_0x5455ae))['catch'](handleError(_0x4632c8,null));};exports[_0x83bd('0x45')]=function(_0x286421,_0x2ad614){var _0x31a97f={'raw':!![],'where':{'id':_0x286421[_0x83bd('0x46')]['id']}},_0x431f5b={};_0x431f5b['model']=_[_0x83bd('0x47')](db['SmsTransferReport'][_0x83bd('0x48')]);_0x431f5b[_0x83bd('0x31')]=_[_0x83bd('0x47')](_0x286421[_0x83bd('0x31')]);_0x431f5b['filters']=_['intersection'](_0x431f5b[_0x83bd('0x30')],_0x431f5b[_0x83bd('0x31')]);_0x31a97f[_0x83bd('0x33')]=_[_0x83bd('0x34')](_0x431f5b['model'],qs['fields'](_0x286421[_0x83bd('0x31')][_0x83bd('0x35')]));_0x31a97f[_0x83bd('0x33')]=_0x31a97f[_0x83bd('0x33')][_0x83bd('0x36')]?_0x31a97f[_0x83bd('0x33')]:_0x431f5b[_0x83bd('0x30')];if(_0x286421[_0x83bd('0x31')][_0x83bd('0x42')]){_0x31a97f[_0x83bd('0x43')]=[{'all':!![]}];}_0x31a97f=_[_0x83bd('0x3f')]({},_0x31a97f,_0x286421[_0x83bd('0x40')]);return db[_0x83bd('0x2c')][_0x83bd('0x49')](_0x31a97f)[_0x83bd('0x23')](handleEntityNotFound(_0x2ad614,null))[_0x83bd('0x23')](respondWithResult(_0x2ad614,null))[_0x83bd('0x4a')](handleError(_0x2ad614,null));};exports[_0x83bd('0x4b')]=function(_0x1d1511,_0x48ed3f){return db[_0x83bd('0x2c')][_0x83bd('0x4b')](_0x1d1511[_0x83bd('0x4c')],{})['then'](respondWithResult(_0x48ed3f,0xc9))['catch'](handleError(_0x48ed3f,null));};exports[_0x83bd('0x22')]=function(_0xf8fd56,_0x21dfa8){if(_0xf8fd56['body']['id']){delete _0xf8fd56[_0x83bd('0x4c')]['id'];}return db['SmsTransferReport'][_0x83bd('0x49')]({'where':{'id':_0xf8fd56['params']['id']}})[_0x83bd('0x23')](handleEntityNotFound(_0x21dfa8,null))[_0x83bd('0x23')](saveUpdates(_0xf8fd56[_0x83bd('0x4c')],null))['then'](respondWithResult(_0x21dfa8,null))[_0x83bd('0x4a')](handleError(_0x21dfa8,null));};exports[_0x83bd('0x24')]=function(_0x2bc2c4,_0x4e97f9){return db[_0x83bd('0x2c')][_0x83bd('0x49')]({'where':{'id':_0x2bc2c4['params']['id']}})[_0x83bd('0x23')](handleEntityNotFound(_0x4e97f9,null))['then'](removeEntity(_0x4e97f9,null))[_0x83bd('0x4a')](handleError(_0x4e97f9,null));};exports[_0x83bd('0x4d')]=function(_0x3e9601,_0x48c88a){return db[_0x83bd('0x2c')][_0x83bd('0x4d')]()[_0x83bd('0x23')](respondWithResult(_0x48c88a,null))[_0x83bd('0x4a')](handleError(_0x48c88a,null));}; \ No newline at end of file diff --git a/server/api/smsTransferReport/smsTransferReport.model.js b/server/api/smsTransferReport/smsTransferReport.model.js index 54280e9..f781e4c 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 _0xef89=['path','rimraf','../../config/environment','./smsTransferReport.attributes','report_sms_transfer','uniqueid','lodash','util','../../config/logger','api','moment','request-promise'];(function(_0x32cd2a,_0x5bf464){var _0x34d548=function(_0x5192f1){while(--_0x5192f1){_0x32cd2a['push'](_0x32cd2a['shift']());}};_0x34d548(++_0x5bf464);}(_0xef89,0xf6));var _0x9ef8=function(_0x22535f,_0x45d62b){_0x22535f=_0x22535f-0x0;var _0x14e2ef=_0xef89[_0x22535f];return _0x14e2ef;};'use strict';var _=require(_0x9ef8('0x0'));var util=require(_0x9ef8('0x1'));var logger=require(_0x9ef8('0x2'))(_0x9ef8('0x3'));var moment=require(_0x9ef8('0x4'));var BPromise=require('bluebird');var rp=require(_0x9ef8('0x5'));var fs=require('fs');var path=require(_0x9ef8('0x6'));var rimraf=require(_0x9ef8('0x7'));var config=require(_0x9ef8('0x8'));var attributes=require(_0x9ef8('0x9'));module['exports']=function(_0x1698c3,_0x5d40f7){return _0x1698c3['define']('SmsTransferReport',attributes,{'tableName':_0x9ef8('0xa'),'paranoid':![],'indexes':[{'name':_0x9ef8('0xb'),'fields':[_0x9ef8('0xb')]}],'timestamps':!![]});}; \ No newline at end of file +var _0x404f=['util','../../config/logger','moment','request-promise','path','rimraf','../../config/environment','./smsTransferReport.attributes','exports','define','SmsTransferReport','report_sms_transfer','uniqueid'];(function(_0x1a5258,_0x21edbc){var _0x508df3=function(_0x35e251){while(--_0x35e251){_0x1a5258['push'](_0x1a5258['shift']());}};_0x508df3(++_0x21edbc);}(_0x404f,0xf7));var _0xf404=function(_0x4f6b23,_0x236d78){_0x4f6b23=_0x4f6b23-0x0;var _0x429e98=_0x404f[_0x4f6b23];return _0x429e98;};'use strict';var _=require('lodash');var util=require(_0xf404('0x0'));var logger=require(_0xf404('0x1'))('api');var moment=require(_0xf404('0x2'));var BPromise=require('bluebird');var rp=require(_0xf404('0x3'));var fs=require('fs');var path=require(_0xf404('0x4'));var rimraf=require(_0xf404('0x5'));var config=require(_0xf404('0x6'));var attributes=require(_0xf404('0x7'));module[_0xf404('0x8')]=function(_0x30e9d7,_0x4fc282){return _0x30e9d7[_0xf404('0x9')](_0xf404('0xa'),attributes,{'tableName':_0xf404('0xb'),'paranoid':![],'indexes':[{'name':_0xf404('0xc'),'fields':[_0xf404('0xc')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/smsTransferReport/smsTransferReport.rpc.js b/server/api/smsTransferReport/smsTransferReport.rpc.js index f4295c1..eb79e61 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 _0xa990=['../../mysqldb','../../config/utils','../../config/environment','jayson/promise','client','http','request','then','info','SmsTransferReport,\x20%s,\x20%s','SmsTransferReport,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','message','result','catch','lodash','util','moment','bluebird','randomstring','ioredis'];(function(_0x432fca,_0xb0b1b5){var _0x3adba4=function(_0x5e3ae4){while(--_0x5e3ae4){_0x432fca['push'](_0x432fca['shift']());}};_0x3adba4(++_0xb0b1b5);}(_0xa990,0xc9));var _0x0a99=function(_0x43b1ff,_0xf30023){_0x43b1ff=_0x43b1ff-0x0;var _0x347a49=_0xa990[_0x43b1ff];return _0x347a49;};'use strict';var _=require(_0x0a99('0x0'));var util=require(_0x0a99('0x1'));var moment=require(_0x0a99('0x2'));var BPromise=require(_0x0a99('0x3'));var rs=require(_0x0a99('0x4'));var fs=require('fs');var Redis=require(_0x0a99('0x5'));var db=require(_0x0a99('0x6'))['db'];var utils=require(_0x0a99('0x7'));var logger=require('../../config/logger')('rpc');var config=require(_0x0a99('0x8'));var jayson=require(_0x0a99('0x9'));var client=jayson[_0x0a99('0xa')][_0x0a99('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x45b195,_0x398d95,_0xc6001b){return new BPromise(function(_0x599c7,_0x3cf0ef){return client[_0x0a99('0xc')](_0x45b195,_0xc6001b)[_0x0a99('0xd')](function(_0x56810b){logger[_0x0a99('0xe')](_0x0a99('0xf'),_0x398d95,'request\x20sent');logger['debug'](_0x0a99('0x10'),_0x398d95,_0x0a99('0x11'),JSON[_0x0a99('0x12')](_0x56810b));if(_0x56810b[_0x0a99('0x13')]){if(_0x56810b[_0x0a99('0x13')]['code']===0x1f4){logger[_0x0a99('0x13')](_0x0a99('0xf'),_0x398d95,_0x56810b['error'][_0x0a99('0x14')]);return _0x3cf0ef(_0x56810b[_0x0a99('0x13')][_0x0a99('0x14')]);}logger[_0x0a99('0x13')](_0x0a99('0xf'),_0x398d95,_0x56810b[_0x0a99('0x13')][_0x0a99('0x14')]);return _0x599c7(_0x56810b[_0x0a99('0x13')]['message']);}else{logger['info'](_0x0a99('0xf'),_0x398d95,_0x0a99('0x11'));_0x599c7(_0x56810b[_0x0a99('0x15')]['message']);}})[_0x0a99('0x16')](function(_0x5c91f9){logger['error'](_0x0a99('0xf'),_0x398d95,_0x5c91f9);_0x3cf0ef(_0x5c91f9);});});} \ No newline at end of file +var _0xd307=['request\x20sent','debug','stringify','error','code','message','SmsTransferReport,\x20%s,\x20%s','result','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','client','http','request','info'];(function(_0x56a871,_0x18b7fe){var _0x124954=function(_0x39b7a1){while(--_0x39b7a1){_0x56a871['push'](_0x56a871['shift']());}};_0x124954(++_0x18b7fe);}(_0xd307,0x110));var _0x7d30=function(_0x1cfc6b,_0x394a5b){_0x1cfc6b=_0x1cfc6b-0x0;var _0x31c6f0=_0xd307[_0x1cfc6b];return _0x31c6f0;};'use strict';var _=require(_0x7d30('0x0'));var util=require(_0x7d30('0x1'));var moment=require(_0x7d30('0x2'));var BPromise=require(_0x7d30('0x3'));var rs=require(_0x7d30('0x4'));var fs=require('fs');var Redis=require(_0x7d30('0x5'));var db=require(_0x7d30('0x6'))['db'];var utils=require(_0x7d30('0x7'));var logger=require('../../config/logger')(_0x7d30('0x8'));var config=require(_0x7d30('0x9'));var jayson=require('jayson/promise');var client=jayson[_0x7d30('0xa')][_0x7d30('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x9451ed,_0x35c861,_0x43b35e){return new BPromise(function(_0x1ef3e7,_0x1eb28c){return client[_0x7d30('0xc')](_0x9451ed,_0x43b35e)['then'](function(_0x3cd180){logger[_0x7d30('0xd')]('SmsTransferReport,\x20%s,\x20%s',_0x35c861,_0x7d30('0xe'));logger[_0x7d30('0xf')]('SmsTransferReport,\x20%s,\x20%s,\x20%s',_0x35c861,'request\x20sent',JSON[_0x7d30('0x10')](_0x3cd180));if(_0x3cd180[_0x7d30('0x11')]){if(_0x3cd180[_0x7d30('0x11')][_0x7d30('0x12')]===0x1f4){logger[_0x7d30('0x11')]('SmsTransferReport,\x20%s,\x20%s',_0x35c861,_0x3cd180[_0x7d30('0x11')][_0x7d30('0x13')]);return _0x1eb28c(_0x3cd180['error'][_0x7d30('0x13')]);}logger[_0x7d30('0x11')]('SmsTransferReport,\x20%s,\x20%s',_0x35c861,_0x3cd180[_0x7d30('0x11')][_0x7d30('0x13')]);return _0x1ef3e7(_0x3cd180[_0x7d30('0x11')][_0x7d30('0x13')]);}else{logger['info'](_0x7d30('0x14'),_0x35c861,_0x7d30('0xe'));_0x1ef3e7(_0x3cd180[_0x7d30('0x15')]['message']);}})['catch'](function(_0x5027b3){logger[_0x7d30('0x11')](_0x7d30('0x14'),_0x35c861,_0x5027b3);_0x1eb28c(_0x5027b3);});});} \ No newline at end of file diff --git a/server/api/sound/index.js b/server/api/sound/index.js index 3522e4f..a71acde 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 _0xdfc1=['express','Router','../../components/auth/service','../../components/interaction/service','./sound.controller','get','isAuthenticated','index','diskStorage','server/files/sounds/original/','originalname','replace','format','%s-%s%s','basename','extname','now','post','single','file','create','put','/:id','update','delete','exports','multer','connect-timeout'];(function(_0x12fc8d,_0x19ee33){var _0x3f9d04=function(_0x52e51c){while(--_0x52e51c){_0x12fc8d['push'](_0x12fc8d['shift']());}};_0x3f9d04(++_0x19ee33);}(_0xdfc1,0xde));var _0x1dfc=function(_0x23c31a,_0xdc4107){_0x23c31a=_0x23c31a-0x0;var _0x4d5585=_0xdfc1[_0x23c31a];return _0x4d5585;};'use strict';var multer=require(_0x1dfc('0x0'));var util=require('util');var path=require('path');var timeout=require(_0x1dfc('0x1'));var express=require(_0x1dfc('0x2'));var router=express[_0x1dfc('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x1dfc('0x4'));var interaction=require(_0x1dfc('0x5'));var config=require('../../config/environment');var controller=require(_0x1dfc('0x6'));router[_0x1dfc('0x7')]('/',auth[_0x1dfc('0x8')](),controller[_0x1dfc('0x9')]);router[_0x1dfc('0x7')]('/:id',auth[_0x1dfc('0x8')](),controller['show']);router['get']('/:id/download',auth[_0x1dfc('0x8')](),controller['download']);var upload=multer({'storage':multer[_0x1dfc('0xa')]({'destination':function(_0x59804b,_0xf8ecb,_0x43c844){_0x43c844(null,path['join'](config['root'],_0x1dfc('0xb')));},'filename':function(_0x31457a,_0x53b2b6,_0xd76bbf){_0x53b2b6[_0x1dfc('0xc')]=_0x53b2b6[_0x1dfc('0xc')][_0x1dfc('0xd')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-');_0xd76bbf(null,util[_0x1dfc('0xe')](_0x1dfc('0xf'),path[_0x1dfc('0x10')](_0x53b2b6[_0x1dfc('0xc')],path[_0x1dfc('0x11')](_0x53b2b6[_0x1dfc('0xc')])),Date[_0x1dfc('0x12')](),path['extname'](_0x53b2b6[_0x1dfc('0xc')])));}})});router[_0x1dfc('0x13')]('/',upload[_0x1dfc('0x14')](_0x1dfc('0x15')),controller[_0x1dfc('0x16')]);router[_0x1dfc('0x17')](_0x1dfc('0x18'),auth[_0x1dfc('0x8')](),controller[_0x1dfc('0x19')]);router[_0x1dfc('0x1a')](_0x1dfc('0x18'),auth[_0x1dfc('0x8')](),controller['delete']);module[_0x1dfc('0x1b')]=router; \ No newline at end of file +var _0x8f4c=['express','Router','fs-extra','../../components/auth/service','../../config/environment','./sound.controller','get','isAuthenticated','index','/:id','show','/:id/download','join','server/files/sounds/original/','originalname','format','%s-%s%s','basename','extname','file','create','put','delete','multer','util','path','connect-timeout'];(function(_0x37ffea,_0x25b006){var _0x2e2615=function(_0x5e6c74){while(--_0x5e6c74){_0x37ffea['push'](_0x37ffea['shift']());}};_0x2e2615(++_0x25b006);}(_0x8f4c,0x140));var _0xc8f4=function(_0x193461,_0x42ce71){_0x193461=_0x193461-0x0;var _0x4c237c=_0x8f4c[_0x193461];return _0x4c237c;};'use strict';var multer=require(_0xc8f4('0x0'));var util=require(_0xc8f4('0x1'));var path=require(_0xc8f4('0x2'));var timeout=require(_0xc8f4('0x3'));var express=require(_0xc8f4('0x4'));var router=express[_0xc8f4('0x5')]();var fs_extra=require(_0xc8f4('0x6'));var auth=require(_0xc8f4('0x7'));var interaction=require('../../components/interaction/service');var config=require(_0xc8f4('0x8'));var controller=require(_0xc8f4('0x9'));router[_0xc8f4('0xa')]('/',auth[_0xc8f4('0xb')](),controller[_0xc8f4('0xc')]);router[_0xc8f4('0xa')](_0xc8f4('0xd'),auth[_0xc8f4('0xb')](),controller[_0xc8f4('0xe')]);router[_0xc8f4('0xa')](_0xc8f4('0xf'),auth['isAuthenticated'](),controller['download']);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0x38fbc7,_0xc7f908,_0x548bdd){_0x548bdd(null,path[_0xc8f4('0x10')](config['root'],_0xc8f4('0x11')));},'filename':function(_0xc4c9a6,_0x54bb75,_0x459a2b){_0x54bb75[_0xc8f4('0x12')]=_0x54bb75[_0xc8f4('0x12')]['replace'](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-');_0x459a2b(null,util[_0xc8f4('0x13')](_0xc8f4('0x14'),path[_0xc8f4('0x15')](_0x54bb75['originalname'],path[_0xc8f4('0x16')](_0x54bb75[_0xc8f4('0x12')])),Date['now'](),path['extname'](_0x54bb75[_0xc8f4('0x12')])));}})});router['post']('/',upload['single'](_0xc8f4('0x17')),controller[_0xc8f4('0x18')]);router[_0xc8f4('0x19')](_0xc8f4('0xd'),auth[_0xc8f4('0xb')](),controller['update']);router[_0xc8f4('0x1a')]('/:id',auth[_0xc8f4('0xb')](),controller['delete']);module['exports']=router; \ No newline at end of file diff --git a/server/api/sound/sound.attributes.js b/server/api/sound/sound.attributes.js index 3d26e61..0427864 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 _0x03c0=['STRING','BIGINT','INTEGER','FLOAT','sequelize','name'];(function(_0x17eafb,_0x3b4894){var _0x32bad7=function(_0x3ff06d){while(--_0x3ff06d){_0x17eafb['push'](_0x17eafb['shift']());}};_0x32bad7(++_0x3b4894);}(_0x03c0,0xee));var _0x003c=function(_0x3e61d4,_0x224d2d){_0x3e61d4=_0x3e61d4-0x0;var _0x40bd4e=_0x03c0[_0x3e61d4];return _0x40bd4e;};'use strict';var Sequelize=require(_0x003c('0x0'));module['exports']={'name':{'type':Sequelize['STRING'],'unique':_0x003c('0x1'),'allowNull':![]},'save_name':{'type':Sequelize[_0x003c('0x2')]},'display_name':{'type':Sequelize[_0x003c('0x2')],'defaultValue':''},'description':{'type':Sequelize[_0x003c('0x2')]},'original_format':{'type':Sequelize[_0x003c('0x2')]},'original_duration':{'type':Sequelize['FLOAT']},'original_sampleCount':{'type':Sequelize[_0x003c('0x3')]},'original_channelCount':{'type':Sequelize[_0x003c('0x4')]},'original_bitRate':{'type':Sequelize['BIGINT']},'original_sampleRate':{'type':Sequelize[_0x003c('0x4')]},'converted_format':{'type':Sequelize[_0x003c('0x2')]},'converted_duration':{'type':Sequelize[_0x003c('0x5')]},'converted_sampleCount':{'type':Sequelize[_0x003c('0x3')]},'converted_channelCount':{'type':Sequelize[_0x003c('0x4')]},'converted_bitRate':{'type':Sequelize[_0x003c('0x3')]},'converted_sampleRate':{'type':Sequelize[_0x003c('0x4')]}}; \ No newline at end of file +var _0x440f=['exports','STRING','FLOAT','BIGINT','INTEGER','sequelize'];(function(_0x12a554,_0x3d7ef8){var _0x244ba0=function(_0x5eb5ff){while(--_0x5eb5ff){_0x12a554['push'](_0x12a554['shift']());}};_0x244ba0(++_0x3d7ef8);}(_0x440f,0x15b));var _0xf440=function(_0x984806,_0x4b295d){_0x984806=_0x984806-0x0;var _0x6ab781=_0x440f[_0x984806];return _0x6ab781;};'use strict';var Sequelize=require(_0xf440('0x0'));module[_0xf440('0x1')]={'name':{'type':Sequelize['STRING'],'unique':'name','allowNull':![]},'save_name':{'type':Sequelize[_0xf440('0x2')]},'display_name':{'type':Sequelize[_0xf440('0x2')],'defaultValue':''},'description':{'type':Sequelize[_0xf440('0x2')]},'original_format':{'type':Sequelize[_0xf440('0x2')]},'original_duration':{'type':Sequelize[_0xf440('0x3')]},'original_sampleCount':{'type':Sequelize[_0xf440('0x4')]},'original_channelCount':{'type':Sequelize[_0xf440('0x5')]},'original_bitRate':{'type':Sequelize['BIGINT']},'original_sampleRate':{'type':Sequelize[_0xf440('0x5')]},'converted_format':{'type':Sequelize['STRING']},'converted_duration':{'type':Sequelize['FLOAT']},'converted_sampleCount':{'type':Sequelize['BIGINT']},'converted_channelCount':{'type':Sequelize[_0xf440('0x5')]},'converted_bitRate':{'type':Sequelize[_0xf440('0x4')]},'converted_sampleRate':{'type':Sequelize[_0xf440('0x5')]}}; \ No newline at end of file diff --git a/server/api/sound/sound.controller.js b/server/api/sound/sound.controller.js index e9cfee6..b5d35a9 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 _0x3b4a=['basename','file','filename','wav','Sound\x20upload\x20filepath:\x20%s','chmodSync','0777','transcode','error','src','original_duration','duration','original_sampleCount','sampleCount','channelCount','original_bitRate','bitRate','original_sampleRate','sampleRate','dest','converted_duration','converted_sampleCount','converted_bitRate','body','role','userProfileId','Unable\x20to\x20retrieve\x20the\x20current\x20user','get','UserProfileSection','autoAssociation','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','start','description','delete','server/files/sounds/original','original_format','unlinkSync','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','mustache','util','path','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','end','status','json','offset','undefined','limit','count','set','Content-Range','reject','save','destroy','then','Sounds','stack','name','send','map','rawAttributes','type','model','query','keys','filters','attributes','intersection','fields','hasOwnProperty','nolimit','sort','where','pick','filter','merge','Sound','includeAll','include','findAll','rows','catch','show','length','find','download','params','converted_format','existsSync','join','server/files/sounds/converted','save_name','Sequelize','root','format','%s.%s','create','originalname','extname'];(function(_0x1ecec5,_0x33173b){var _0x1bc0a4=function(_0x2d9435){while(--_0x2d9435){_0x1ecec5['push'](_0x1ecec5['shift']());}};_0x1bc0a4(++_0x33173b);}(_0x3b4a,0x11c));var _0xa3b4=function(_0x54c2d8,_0x6f1180){_0x54c2d8=_0x54c2d8-0x0;var _0x321a6a=_0x3b4a[_0x54c2d8];return _0x321a6a;};'use strict';var emlformat=require(_0xa3b4('0x0'));var rimraf=require(_0xa3b4('0x1'));var zipdir=require(_0xa3b4('0x2'));var jsonpatch=require(_0xa3b4('0x3'));var rp=require(_0xa3b4('0x4'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0xa3b4('0x5'));var util=require(_0xa3b4('0x6'));var path=require(_0xa3b4('0x7'));var sox=require('sox');var csv=require(_0xa3b4('0x8'));var ejs=require(_0xa3b4('0x9'));var fs=require('fs');var fs_extra=require(_0xa3b4('0xa'));var _=require(_0xa3b4('0xb'));var squel=require(_0xa3b4('0xc'));var crypto=require(_0xa3b4('0xd'));var jsforce=require(_0xa3b4('0xe'));var deskjs=require(_0xa3b4('0xf'));var toCsv=require(_0xa3b4('0x8'));var querystring=require('querystring');var Papa=require(_0xa3b4('0x10'));var Redis=require(_0xa3b4('0x11'));var authService=require('../../components/auth/service');var qs=require(_0xa3b4('0x12'));var as=require(_0xa3b4('0x13'));var hardwareService=require(_0xa3b4('0x14'));var logger=require(_0xa3b4('0x15'))(_0xa3b4('0x16'));var utils=require(_0xa3b4('0x17'));var config=require(_0xa3b4('0x18'));var licenseUtil=require(_0xa3b4('0x19'));var db=require(_0xa3b4('0x1a'))['db'];function respondWithStatusCode(_0x2cf10a,_0x15ec05){_0x15ec05=_0x15ec05||0xcc;return function(_0x460d34){if(_0x460d34){return _0x2cf10a[_0xa3b4('0x1b')](_0x15ec05);}return _0x2cf10a['status'](_0x15ec05)[_0xa3b4('0x1c')]();};}function respondWithResult(_0x1af386,_0x5b2e57){_0x5b2e57=_0x5b2e57||0xc8;return function(_0x45d156){if(_0x45d156){return _0x1af386[_0xa3b4('0x1d')](_0x5b2e57)[_0xa3b4('0x1e')](_0x45d156);}};}function respondWithFilteredResult(_0x272714,_0x1f79ee){return function(_0x5b0c53){if(_0x5b0c53){var _0x2333d6=typeof _0x1f79ee[_0xa3b4('0x1f')]===_0xa3b4('0x20')&&typeof _0x1f79ee[_0xa3b4('0x21')]===_0xa3b4('0x20');var _0x5e6c9d=_0x5b0c53[_0xa3b4('0x22')];var _0x390975=_0x2333d6?0x0:_0x1f79ee[_0xa3b4('0x1f')];var _0x3de60a=_0x2333d6?_0x5b0c53[_0xa3b4('0x22')]:_0x1f79ee[_0xa3b4('0x1f')]+_0x1f79ee[_0xa3b4('0x21')];var _0x5207ea;if(_0x3de60a>=_0x5e6c9d){_0x3de60a=_0x5e6c9d;_0x5207ea=0xc8;}else{_0x5207ea=0xce;}_0x272714[_0xa3b4('0x1d')](_0x5207ea);return _0x272714[_0xa3b4('0x23')](_0xa3b4('0x24'),_0x390975+'-'+_0x3de60a+'/'+_0x5e6c9d)['json'](_0x5b0c53);}return null;};}function patchUpdates(_0x199164){return function(_0x337b20){try{jsonpatch['apply'](_0x337b20,_0x199164,!![]);}catch(_0x9eeb7f){return BPromise[_0xa3b4('0x25')](_0x9eeb7f);}return _0x337b20[_0xa3b4('0x26')]();};}function saveUpdates(_0x4947ba,_0x424181){return function(_0x3db279){if(_0x3db279){return _0x3db279['update'](_0x4947ba)['then'](function(_0x50065a){return _0x50065a;});}return null;};}function removeEntity(_0x2f146f,_0x4d5179){return function(_0x16c05a){if(_0x16c05a){return _0x16c05a[_0xa3b4('0x27')]()[_0xa3b4('0x28')](function(){var _0x133645=_0x16c05a['get']({'plain':!![]});var _0x1e51b2=_0xa3b4('0x29');return db['UserProfileResource'][_0xa3b4('0x27')]({'where':{'type':_0x1e51b2,'resourceId':_0x133645['id']}})[_0xa3b4('0x28')](function(){return _0x16c05a;});})[_0xa3b4('0x28')](function(){_0x2f146f[_0xa3b4('0x1d')](0xcc)[_0xa3b4('0x1c')]();});}};}function handleEntityNotFound(_0x29b9c6,_0x3fdd2d){return function(_0x23101d){if(!_0x23101d){_0x29b9c6[_0xa3b4('0x1b')](0x194);}return _0x23101d;};}function handleError(_0x15963a,_0x4f6f67){_0x4f6f67=_0x4f6f67||0x1f4;return function(_0x4be2e0){logger['error'](_0x4be2e0[_0xa3b4('0x2a')]);if(_0x4be2e0[_0xa3b4('0x2b')]){delete _0x4be2e0[_0xa3b4('0x2b')];}_0x15963a[_0xa3b4('0x1d')](_0x4f6f67)[_0xa3b4('0x2c')](_0x4be2e0);};}exports['index']=function(_0x51fd19,_0x833325){var _0x5633aa={},_0x2059c7={},_0x142190={'count':0x0,'rows':[]};var _0x51e021=_[_0xa3b4('0x2d')](db['Sound'][_0xa3b4('0x2e')],function(_0x1e6578){return{'name':_0x1e6578['fieldName'],'type':_0x1e6578[_0xa3b4('0x2f')]['key']};});_0x2059c7[_0xa3b4('0x30')]=_[_0xa3b4('0x2d')](_0x51e021,_0xa3b4('0x2b'));_0x2059c7[_0xa3b4('0x31')]=_[_0xa3b4('0x32')](_0x51fd19[_0xa3b4('0x31')]);_0x2059c7[_0xa3b4('0x33')]=_['intersection'](_0x2059c7[_0xa3b4('0x30')],_0x2059c7[_0xa3b4('0x31')]);_0x5633aa[_0xa3b4('0x34')]=_[_0xa3b4('0x35')](_0x2059c7[_0xa3b4('0x30')],qs[_0xa3b4('0x36')](_0x51fd19[_0xa3b4('0x31')][_0xa3b4('0x36')]));_0x5633aa[_0xa3b4('0x34')]=_0x5633aa[_0xa3b4('0x34')]['length']?_0x5633aa[_0xa3b4('0x34')]:_0x2059c7[_0xa3b4('0x30')];if(!_0x51fd19[_0xa3b4('0x31')][_0xa3b4('0x37')](_0xa3b4('0x38'))){_0x5633aa[_0xa3b4('0x21')]=qs[_0xa3b4('0x21')](_0x51fd19[_0xa3b4('0x31')][_0xa3b4('0x21')]);_0x5633aa[_0xa3b4('0x1f')]=qs[_0xa3b4('0x1f')](_0x51fd19[_0xa3b4('0x31')][_0xa3b4('0x1f')]);}_0x5633aa['order']=qs[_0xa3b4('0x39')](_0x51fd19[_0xa3b4('0x31')]['sort']);_0x5633aa[_0xa3b4('0x3a')]=qs[_0xa3b4('0x33')](_[_0xa3b4('0x3b')](_0x51fd19['query'],_0x2059c7[_0xa3b4('0x33')]),_0x51e021);if(_0x51fd19[_0xa3b4('0x31')][_0xa3b4('0x3c')]){_0x5633aa[_0xa3b4('0x3a')]=_[_0xa3b4('0x3d')](_0x5633aa['where'],{'$or':_['map'](_0x51e021,function(_0x5dff94){if(_0x5dff94[_0xa3b4('0x2f')]!=='VIRTUAL'){var _0x24dd45={};_0x24dd45[_0x5dff94['name']]={'$like':'%'+_0x51fd19['query'][_0xa3b4('0x3c')]+'%'};return _0x24dd45;}})});}_0x5633aa=_[_0xa3b4('0x3d')]({},_0x5633aa,_0x51fd19['options']);var _0x1fea4c={'where':_0x5633aa[_0xa3b4('0x3a')]};return db[_0xa3b4('0x3e')][_0xa3b4('0x22')](_0x1fea4c)[_0xa3b4('0x28')](function(_0xad76cd){_0x142190[_0xa3b4('0x22')]=_0xad76cd;if(_0x51fd19[_0xa3b4('0x31')][_0xa3b4('0x3f')]){_0x5633aa[_0xa3b4('0x40')]=[{'all':!![]}];}return db[_0xa3b4('0x3e')][_0xa3b4('0x41')](_0x5633aa);})[_0xa3b4('0x28')](function(_0x2ac0af){_0x142190[_0xa3b4('0x42')]=_0x2ac0af;return _0x142190;})[_0xa3b4('0x28')](respondWithFilteredResult(_0x833325,_0x5633aa))[_0xa3b4('0x43')](handleError(_0x833325,null));};exports[_0xa3b4('0x44')]=function(_0x3e8c34,_0x16fca9){var _0x2b84e7={'raw':!![],'where':{'id':_0x3e8c34['params']['id']}},_0x217531={};_0x217531[_0xa3b4('0x30')]=_[_0xa3b4('0x32')](db[_0xa3b4('0x3e')][_0xa3b4('0x2e')]);_0x217531[_0xa3b4('0x31')]=_[_0xa3b4('0x32')](_0x3e8c34['query']);_0x217531[_0xa3b4('0x33')]=_[_0xa3b4('0x35')](_0x217531[_0xa3b4('0x30')],_0x217531[_0xa3b4('0x31')]);_0x2b84e7[_0xa3b4('0x34')]=_[_0xa3b4('0x35')](_0x217531['model'],qs['fields'](_0x3e8c34[_0xa3b4('0x31')][_0xa3b4('0x36')]));_0x2b84e7[_0xa3b4('0x34')]=_0x2b84e7[_0xa3b4('0x34')][_0xa3b4('0x45')]?_0x2b84e7[_0xa3b4('0x34')]:_0x217531['model'];if(_0x3e8c34[_0xa3b4('0x31')]['includeAll']){_0x2b84e7[_0xa3b4('0x40')]=[{'all':!![]}];}_0x2b84e7=_['merge']({},_0x2b84e7,_0x3e8c34['options']);return db['Sound'][_0xa3b4('0x46')](_0x2b84e7)[_0xa3b4('0x28')](handleEntityNotFound(_0x16fca9,null))[_0xa3b4('0x28')](respondWithResult(_0x16fca9,null))[_0xa3b4('0x43')](handleError(_0x16fca9,null));};exports[_0xa3b4('0x47')]=function(_0x2d6f96,_0x332b8c,_0x2c1f37){return db[_0xa3b4('0x3e')][_0xa3b4('0x46')]({'where':{'id':_0x2d6f96[_0xa3b4('0x48')]['id']},'attributes':[_0xa3b4('0x2b'),'save_name',_0xa3b4('0x49')],'raw':!![]})[_0xa3b4('0x28')](handleEntityNotFound(_0x332b8c,null))['then'](function(_0x4849df){if(_0x4849df){if(!fs[_0xa3b4('0x4a')](path[_0xa3b4('0x4b')](config['root'],_0xa3b4('0x4c'),_0x4849df[_0xa3b4('0x4d')]+'.'+_0x4849df['converted_format']))){throw new db[(_0xa3b4('0x4e'))]['ValidationError']('Sound\x20not\x20found');}return _0x332b8c[_0xa3b4('0x47')](path['join'](config[_0xa3b4('0x4f')],'server/files/sounds/converted',util[_0xa3b4('0x50')](_0xa3b4('0x51'),_0x4849df['save_name'],_0x4849df[_0xa3b4('0x49')])),util[_0xa3b4('0x50')]('%s.%s',_0x4849df['name'],_0x4849df[_0xa3b4('0x49')]));}return null;})[_0xa3b4('0x43')](handleError(_0x332b8c,null));};exports[_0xa3b4('0x52')]=function(_0x1e03b6,_0x1800f3,_0x4650c7){var _0x1775d0={'name':path['basename'](_0x1e03b6['file'][_0xa3b4('0x53')],path[_0xa3b4('0x54')](_0x1e03b6['file'][_0xa3b4('0x53')])),'save_name':path[_0xa3b4('0x55')](_0x1e03b6[_0xa3b4('0x56')][_0xa3b4('0x57')],path[_0xa3b4('0x54')](_0x1e03b6['file'][_0xa3b4('0x57')])),'original_format':path[_0xa3b4('0x54')](_0x1e03b6[_0xa3b4('0x56')]['originalname'])['substring'](0x1),'converted_format':_0xa3b4('0x58')};var _0x4c9587=path[_0xa3b4('0x4b')](config[_0xa3b4('0x4f')],'server/files/sounds/original',_0x1e03b6['file'][_0xa3b4('0x57')]);var _0x3a372c=path[_0xa3b4('0x4b')](config[_0xa3b4('0x4f')],_0xa3b4('0x4c'),util[_0xa3b4('0x50')](_0xa3b4('0x51'),path[_0xa3b4('0x55')](_0x1e03b6['file'][_0xa3b4('0x57')],path[_0xa3b4('0x54')](_0x1e03b6[_0xa3b4('0x56')][_0xa3b4('0x57')])),_0x1775d0[_0xa3b4('0x49')]));logger['info'](_0xa3b4('0x59'),_0x4c9587);logger['info']('Sound\x20upload\x20destination:\x20%s',_0x3a372c);try{fs[_0xa3b4('0x5a')](_0x4c9587,parseInt(_0xa3b4('0x5b'),0x8));var _0x448f95=sox[_0xa3b4('0x5c')](_0x4c9587,_0x3a372c,{'sampleRate':0x1f40,'format':_0xa3b4('0x58'),'channelCount':0x1,'bitRate':0xc0*0x400,'compressionQuality':0x5});_0x448f95['on'](_0xa3b4('0x5d'),function(_0x1c6573){fs['unlinkSync'](_0x4c9587);_0x1800f3[_0xa3b4('0x1d')](0x1f4)['send'](_0x1c6573);});_0x448f95['on'](_0xa3b4('0x5e'),function(_0x22469a){_0x1775d0[_0xa3b4('0x5f')]=isNaN(_0x22469a[_0xa3b4('0x60')])?null:_0x22469a['duration']*0x3e8;_0x1775d0[_0xa3b4('0x61')]=isNaN(_0x22469a[_0xa3b4('0x62')])?null:_0x22469a[_0xa3b4('0x62')];_0x1775d0['original_channelCount']=isNaN(_0x22469a['channelCount'])?null:_0x22469a[_0xa3b4('0x63')];_0x1775d0[_0xa3b4('0x64')]=isNaN(_0x22469a['bitRate'])?null:_0x22469a[_0xa3b4('0x65')];_0x1775d0[_0xa3b4('0x66')]=isNaN(_0x22469a[_0xa3b4('0x67')])?null:_0x22469a[_0xa3b4('0x67')];});_0x448f95['on'](_0xa3b4('0x68'),function(_0xc18fab){_0x1775d0[_0xa3b4('0x69')]=isNaN(_0xc18fab[_0xa3b4('0x60')])?null:_0xc18fab[_0xa3b4('0x60')]*0x3e8;_0x1775d0[_0xa3b4('0x6a')]=isNaN(_0xc18fab[_0xa3b4('0x62')])?null:_0xc18fab[_0xa3b4('0x62')];_0x1775d0['converted_channelCount']=isNaN(_0xc18fab['channelCount'])?null:_0xc18fab['channelCount'];_0x1775d0[_0xa3b4('0x6b')]=isNaN(_0xc18fab[_0xa3b4('0x65')])?null:_0xc18fab['bitRate'];_0x1775d0['converted_sampleRate']=isNaN(_0xc18fab[_0xa3b4('0x67')])?null:_0xc18fab[_0xa3b4('0x67')];});_0x448f95['on'](_0xa3b4('0x1c'),function(){fs[_0xa3b4('0x5a')](_0x3a372c,parseInt(_0xa3b4('0x5b'),0x8));return db[_0xa3b4('0x3e')]['create'](_0x1775d0)['then'](function(_0x10d50c){var _0x10e623={'role':_0x1e03b6[_0xa3b4('0x6c')][_0xa3b4('0x6d')],'userProfileId':_0x1e03b6[_0xa3b4('0x6c')][_0xa3b4('0x6e')]};if(!_0x10e623)throw new Error(_0xa3b4('0x6f'));if(_0x10e623[_0xa3b4('0x6d')]==='user'){var _0x3b3cf1=_0x10d50c[_0xa3b4('0x70')]({'plain':!![]});return db[_0xa3b4('0x71')]['find']({'where':{'name':_0xa3b4('0x29'),'userProfileId':_0x10e623[_0xa3b4('0x6e')]},'raw':!![]})['then'](function(_0x5897e0){if(_0x5897e0&&_0x5897e0[_0xa3b4('0x72')]===0x0){return db[_0xa3b4('0x73')][_0xa3b4('0x52')]({'name':_0x3b3cf1['name'],'resourceId':_0x3b3cf1['id'],'type':_0x5897e0[_0xa3b4('0x2b')],'sectionId':_0x5897e0['id']},{})['then'](function(){return _0x10d50c;});}else{return _0x10d50c;}})['catch'](function(_0x2b644f){logger[_0xa3b4('0x5d')](_0xa3b4('0x74'),_0x2b644f);throw _0x2b644f;});}return _0x10d50c;})[_0xa3b4('0x28')](respondWithResult(_0x1800f3,null))[_0xa3b4('0x43')](handleError(_0x1800f3,null));});_0x448f95[_0xa3b4('0x75')]();}catch(_0x76876a){_0x1800f3[_0xa3b4('0x1d')](0x1f4)[_0xa3b4('0x2c')](_0x76876a);}};exports['update']=function(_0xd10b06,_0x5c9799,_0x423017){return db[_0xa3b4('0x3e')]['find']({'where':{'id':_0xd10b06[_0xa3b4('0x48')]['id']}})[_0xa3b4('0x28')](handleEntityNotFound(_0x5c9799,null))[_0xa3b4('0x28')](saveUpdates(_[_0xa3b4('0x3b')](_0xd10b06[_0xa3b4('0x6c')],[_0xa3b4('0x2b'),_0xa3b4('0x76')]),null))[_0xa3b4('0x28')](respondWithResult(_0x5c9799,null))[_0xa3b4('0x43')](handleError(_0x5c9799,null));};exports[_0xa3b4('0x77')]=function(_0x108ea5,_0x45fd94,_0x4b32f4){return db['Sound'][_0xa3b4('0x46')]({'where':{'id':_0x108ea5['params']['id']}})['then'](function(_0x178d1e){if(_0x178d1e){return _0x178d1e[_0xa3b4('0x27')]();}})['then'](function(_0x3d98b7){var _0x10da98=path['join'](config[_0xa3b4('0x4f')],_0xa3b4('0x78'),util[_0xa3b4('0x50')](_0xa3b4('0x51'),_0x3d98b7['save_name'],_0x3d98b7[_0xa3b4('0x79')]));var _0x4b2d3d=path[_0xa3b4('0x4b')](config[_0xa3b4('0x4f')],_0xa3b4('0x4c'),util['format'](_0xa3b4('0x51'),_0x3d98b7[_0xa3b4('0x4d')],_0x3d98b7[_0xa3b4('0x49')]));fs['unlinkSync'](_0x10da98);fs[_0xa3b4('0x7a')](_0x4b2d3d);return _0x3d98b7;})[_0xa3b4('0x28')](function(_0x4d0e67){if(_0x4d0e67){return _0x45fd94[_0xa3b4('0x1d')](0xcc)[_0xa3b4('0x1c')]();}})['then'](handleEntityNotFound(_0x45fd94,null))[_0xa3b4('0x43')](handleError(_0x45fd94,null));}; \ No newline at end of file +var _0xc98c=['papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','sendStatus','status','json','offset','undefined','count','limit','set','Content-Range','apply','reject','save','then','destroy','get','Sounds','UserProfileResource','end','error','stack','name','send','index','map','Sound','rawAttributes','fieldName','type','key','model','keys','query','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','sort','where','VIRTUAL','options','includeAll','findAll','rows','show','params','include','find','catch','existsSync','join','root','converted_format','Sequelize','ValidationError','Sound\x20not\x20found','download','server/files/sounds/converted','format','%s.%s','save_name','create','file','originalname','extname','filename','substring','wav','server/files/sounds/original','basename','info','Sound\x20upload\x20destination:\x20%s','chmodSync','0777','unlinkSync','src','original_duration','duration','sampleCount','channelCount','original_bitRate','bitRate','sampleRate','dest','converted_duration','converted_channelCount','converted_bitRate','converted_sampleRate','body','role','userProfileId','Unable\x20to\x20retrieve\x20the\x20current\x20user','user','UserProfileSection','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','start','update','pick','description','eml-format','rimraf','fast-json-patch','request-promise','bluebird','mustache','util','path','sox','to-csv','fs-extra','lodash','squel','jsforce','querystring'];(function(_0x236c89,_0xd76ba9){var _0x3b2a15=function(_0x89e4f9){while(--_0x89e4f9){_0x236c89['push'](_0x236c89['shift']());}};_0x3b2a15(++_0xd76ba9);}(_0xc98c,0xed));var _0xcc98=function(_0x2a86ff,_0x39958b){_0x2a86ff=_0x2a86ff-0x0;var _0x559227=_0xc98c[_0x2a86ff];return _0x559227;};'use strict';var emlformat=require(_0xcc98('0x0'));var rimraf=require(_0xcc98('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xcc98('0x2'));var rp=require(_0xcc98('0x3'));var moment=require('moment');var BPromise=require(_0xcc98('0x4'));var Mustache=require(_0xcc98('0x5'));var util=require(_0xcc98('0x6'));var path=require(_0xcc98('0x7'));var sox=require(_0xcc98('0x8'));var csv=require(_0xcc98('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xcc98('0xa'));var _=require(_0xcc98('0xb'));var squel=require(_0xcc98('0xc'));var crypto=require('crypto');var jsforce=require(_0xcc98('0xd'));var deskjs=require('desk.js');var toCsv=require(_0xcc98('0x9'));var querystring=require(_0xcc98('0xe'));var Papa=require(_0xcc98('0xf'));var Redis=require(_0xcc98('0x10'));var authService=require(_0xcc98('0x11'));var qs=require(_0xcc98('0x12'));var as=require(_0xcc98('0x13'));var hardwareService=require(_0xcc98('0x14'));var logger=require(_0xcc98('0x15'))('api');var utils=require(_0xcc98('0x16'));var config=require(_0xcc98('0x17'));var licenseUtil=require(_0xcc98('0x18'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x21a3cc,_0x154fd0){_0x154fd0=_0x154fd0||0xcc;return function(_0x2a6e35){if(_0x2a6e35){return _0x21a3cc[_0xcc98('0x19')](_0x154fd0);}return _0x21a3cc[_0xcc98('0x1a')](_0x154fd0)['end']();};}function respondWithResult(_0x52a4bd,_0x3103e7){_0x3103e7=_0x3103e7||0xc8;return function(_0x50e63d){if(_0x50e63d){return _0x52a4bd[_0xcc98('0x1a')](_0x3103e7)[_0xcc98('0x1b')](_0x50e63d);}};}function respondWithFilteredResult(_0x17b775,_0x19a00d){return function(_0x22fba1){if(_0x22fba1){var _0x97698c=typeof _0x19a00d[_0xcc98('0x1c')]===_0xcc98('0x1d')&&typeof _0x19a00d['limit']===_0xcc98('0x1d');var _0x4cfe4c=_0x22fba1[_0xcc98('0x1e')];var _0x3473d9=_0x97698c?0x0:_0x19a00d[_0xcc98('0x1c')];var _0x3dd3e5=_0x97698c?_0x22fba1[_0xcc98('0x1e')]:_0x19a00d[_0xcc98('0x1c')]+_0x19a00d[_0xcc98('0x1f')];var _0xac1227;if(_0x3dd3e5>=_0x4cfe4c){_0x3dd3e5=_0x4cfe4c;_0xac1227=0xc8;}else{_0xac1227=0xce;}_0x17b775['status'](_0xac1227);return _0x17b775[_0xcc98('0x20')](_0xcc98('0x21'),_0x3473d9+'-'+_0x3dd3e5+'/'+_0x4cfe4c)[_0xcc98('0x1b')](_0x22fba1);}return null;};}function patchUpdates(_0x599030){return function(_0x24f03e){try{jsonpatch[_0xcc98('0x22')](_0x24f03e,_0x599030,!![]);}catch(_0x43ace8){return BPromise[_0xcc98('0x23')](_0x43ace8);}return _0x24f03e[_0xcc98('0x24')]();};}function saveUpdates(_0x5e2091,_0x5b08ce){return function(_0x2c9324){if(_0x2c9324){return _0x2c9324['update'](_0x5e2091)[_0xcc98('0x25')](function(_0x5011dc){return _0x5011dc;});}return null;};}function removeEntity(_0x43052b,_0x4abec5){return function(_0x15c782){if(_0x15c782){return _0x15c782[_0xcc98('0x26')]()[_0xcc98('0x25')](function(){var _0x324e3b=_0x15c782[_0xcc98('0x27')]({'plain':!![]});var _0x9c6d2e=_0xcc98('0x28');return db[_0xcc98('0x29')][_0xcc98('0x26')]({'where':{'type':_0x9c6d2e,'resourceId':_0x324e3b['id']}})[_0xcc98('0x25')](function(){return _0x15c782;});})['then'](function(){_0x43052b[_0xcc98('0x1a')](0xcc)[_0xcc98('0x2a')]();});}};}function handleEntityNotFound(_0x4d0c29,_0x3e4862){return function(_0x319a7b){if(!_0x319a7b){_0x4d0c29[_0xcc98('0x19')](0x194);}return _0x319a7b;};}function handleError(_0xa506e0,_0x5e03e5){_0x5e03e5=_0x5e03e5||0x1f4;return function(_0x412044){logger[_0xcc98('0x2b')](_0x412044[_0xcc98('0x2c')]);if(_0x412044[_0xcc98('0x2d')]){delete _0x412044[_0xcc98('0x2d')];}_0xa506e0['status'](_0x5e03e5)[_0xcc98('0x2e')](_0x412044);};}exports[_0xcc98('0x2f')]=function(_0xc3767,_0x2e4b7f){var _0x2cc148={},_0x358aa0={},_0x24f7b4={'count':0x0,'rows':[]};var _0x45538f=_[_0xcc98('0x30')](db[_0xcc98('0x31')][_0xcc98('0x32')],function(_0x3a982c){return{'name':_0x3a982c[_0xcc98('0x33')],'type':_0x3a982c[_0xcc98('0x34')][_0xcc98('0x35')]};});_0x358aa0[_0xcc98('0x36')]=_[_0xcc98('0x30')](_0x45538f,'name');_0x358aa0['query']=_[_0xcc98('0x37')](_0xc3767[_0xcc98('0x38')]);_0x358aa0[_0xcc98('0x39')]=_[_0xcc98('0x3a')](_0x358aa0[_0xcc98('0x36')],_0x358aa0[_0xcc98('0x38')]);_0x2cc148['attributes']=_[_0xcc98('0x3a')](_0x358aa0[_0xcc98('0x36')],qs[_0xcc98('0x3b')](_0xc3767['query'][_0xcc98('0x3b')]));_0x2cc148[_0xcc98('0x3c')]=_0x2cc148[_0xcc98('0x3c')][_0xcc98('0x3d')]?_0x2cc148[_0xcc98('0x3c')]:_0x358aa0[_0xcc98('0x36')];if(!_0xc3767[_0xcc98('0x38')][_0xcc98('0x3e')](_0xcc98('0x3f'))){_0x2cc148[_0xcc98('0x1f')]=qs[_0xcc98('0x1f')](_0xc3767['query'][_0xcc98('0x1f')]);_0x2cc148['offset']=qs[_0xcc98('0x1c')](_0xc3767[_0xcc98('0x38')][_0xcc98('0x1c')]);}_0x2cc148['order']=qs[_0xcc98('0x40')](_0xc3767['query']['sort']);_0x2cc148[_0xcc98('0x41')]=qs[_0xcc98('0x39')](_['pick'](_0xc3767[_0xcc98('0x38')],_0x358aa0['filters']),_0x45538f);if(_0xc3767[_0xcc98('0x38')]['filter']){_0x2cc148[_0xcc98('0x41')]=_['merge'](_0x2cc148['where'],{'$or':_['map'](_0x45538f,function(_0x52456b){if(_0x52456b['type']!==_0xcc98('0x42')){var _0x5b5180={};_0x5b5180[_0x52456b[_0xcc98('0x2d')]]={'$like':'%'+_0xc3767[_0xcc98('0x38')]['filter']+'%'};return _0x5b5180;}})});}_0x2cc148=_['merge']({},_0x2cc148,_0xc3767[_0xcc98('0x43')]);var _0x16e380={'where':_0x2cc148[_0xcc98('0x41')]};return db[_0xcc98('0x31')][_0xcc98('0x1e')](_0x16e380)['then'](function(_0x106742){_0x24f7b4[_0xcc98('0x1e')]=_0x106742;if(_0xc3767['query'][_0xcc98('0x44')]){_0x2cc148['include']=[{'all':!![]}];}return db[_0xcc98('0x31')][_0xcc98('0x45')](_0x2cc148);})['then'](function(_0x119078){_0x24f7b4[_0xcc98('0x46')]=_0x119078;return _0x24f7b4;})[_0xcc98('0x25')](respondWithFilteredResult(_0x2e4b7f,_0x2cc148))['catch'](handleError(_0x2e4b7f,null));};exports[_0xcc98('0x47')]=function(_0x4275fe,_0xfdd5ea){var _0xab2c8a={'raw':!![],'where':{'id':_0x4275fe[_0xcc98('0x48')]['id']}},_0x1a559a={};_0x1a559a[_0xcc98('0x36')]=_[_0xcc98('0x37')](db['Sound'][_0xcc98('0x32')]);_0x1a559a[_0xcc98('0x38')]=_[_0xcc98('0x37')](_0x4275fe[_0xcc98('0x38')]);_0x1a559a['filters']=_[_0xcc98('0x3a')](_0x1a559a[_0xcc98('0x36')],_0x1a559a[_0xcc98('0x38')]);_0xab2c8a[_0xcc98('0x3c')]=_[_0xcc98('0x3a')](_0x1a559a[_0xcc98('0x36')],qs[_0xcc98('0x3b')](_0x4275fe['query'][_0xcc98('0x3b')]));_0xab2c8a[_0xcc98('0x3c')]=_0xab2c8a[_0xcc98('0x3c')][_0xcc98('0x3d')]?_0xab2c8a['attributes']:_0x1a559a[_0xcc98('0x36')];if(_0x4275fe[_0xcc98('0x38')][_0xcc98('0x44')]){_0xab2c8a[_0xcc98('0x49')]=[{'all':!![]}];}_0xab2c8a=_['merge']({},_0xab2c8a,_0x4275fe[_0xcc98('0x43')]);return db['Sound'][_0xcc98('0x4a')](_0xab2c8a)[_0xcc98('0x25')](handleEntityNotFound(_0xfdd5ea,null))[_0xcc98('0x25')](respondWithResult(_0xfdd5ea,null))[_0xcc98('0x4b')](handleError(_0xfdd5ea,null));};exports['download']=function(_0xd4f776,_0x570386,_0x1a8b49){return db[_0xcc98('0x31')][_0xcc98('0x4a')]({'where':{'id':_0xd4f776[_0xcc98('0x48')]['id']},'attributes':[_0xcc98('0x2d'),'save_name','converted_format'],'raw':!![]})[_0xcc98('0x25')](handleEntityNotFound(_0x570386,null))[_0xcc98('0x25')](function(_0x4b7d5a){if(_0x4b7d5a){if(!fs[_0xcc98('0x4c')](path[_0xcc98('0x4d')](config[_0xcc98('0x4e')],'server/files/sounds/converted',_0x4b7d5a['save_name']+'.'+_0x4b7d5a[_0xcc98('0x4f')]))){throw new db[(_0xcc98('0x50'))][(_0xcc98('0x51'))](_0xcc98('0x52'));}return _0x570386[_0xcc98('0x53')](path['join'](config['root'],_0xcc98('0x54'),util[_0xcc98('0x55')](_0xcc98('0x56'),_0x4b7d5a[_0xcc98('0x57')],_0x4b7d5a[_0xcc98('0x4f')])),util[_0xcc98('0x55')](_0xcc98('0x56'),_0x4b7d5a[_0xcc98('0x2d')],_0x4b7d5a[_0xcc98('0x4f')]));}return null;})[_0xcc98('0x4b')](handleError(_0x570386,null));};exports[_0xcc98('0x58')]=function(_0x2fc136,_0x379595,_0x2f16d9){var _0x35738d={'name':path['basename'](_0x2fc136[_0xcc98('0x59')][_0xcc98('0x5a')],path[_0xcc98('0x5b')](_0x2fc136[_0xcc98('0x59')][_0xcc98('0x5a')])),'save_name':path['basename'](_0x2fc136[_0xcc98('0x59')][_0xcc98('0x5c')],path[_0xcc98('0x5b')](_0x2fc136[_0xcc98('0x59')][_0xcc98('0x5c')])),'original_format':path[_0xcc98('0x5b')](_0x2fc136[_0xcc98('0x59')][_0xcc98('0x5a')])[_0xcc98('0x5d')](0x1),'converted_format':_0xcc98('0x5e')};var _0x3c1808=path[_0xcc98('0x4d')](config['root'],_0xcc98('0x5f'),_0x2fc136[_0xcc98('0x59')][_0xcc98('0x5c')]);var _0x3b195f=path[_0xcc98('0x4d')](config[_0xcc98('0x4e')],_0xcc98('0x54'),util[_0xcc98('0x55')]('%s.%s',path[_0xcc98('0x60')](_0x2fc136[_0xcc98('0x59')][_0xcc98('0x5c')],path['extname'](_0x2fc136['file'][_0xcc98('0x5c')])),_0x35738d[_0xcc98('0x4f')]));logger[_0xcc98('0x61')]('Sound\x20upload\x20filepath:\x20%s',_0x3c1808);logger['info'](_0xcc98('0x62'),_0x3b195f);try{fs[_0xcc98('0x63')](_0x3c1808,parseInt(_0xcc98('0x64'),0x8));var _0x5bf85f=sox['transcode'](_0x3c1808,_0x3b195f,{'sampleRate':0x1f40,'format':_0xcc98('0x5e'),'channelCount':0x1,'bitRate':0xc0*0x400,'compressionQuality':0x5});_0x5bf85f['on'](_0xcc98('0x2b'),function(_0x279ffa){fs[_0xcc98('0x65')](_0x3c1808);_0x379595[_0xcc98('0x1a')](0x1f4)[_0xcc98('0x2e')](_0x279ffa);});_0x5bf85f['on'](_0xcc98('0x66'),function(_0x144710){_0x35738d[_0xcc98('0x67')]=isNaN(_0x144710['duration'])?null:_0x144710[_0xcc98('0x68')]*0x3e8;_0x35738d['original_sampleCount']=isNaN(_0x144710[_0xcc98('0x69')])?null:_0x144710['sampleCount'];_0x35738d['original_channelCount']=isNaN(_0x144710['channelCount'])?null:_0x144710[_0xcc98('0x6a')];_0x35738d[_0xcc98('0x6b')]=isNaN(_0x144710[_0xcc98('0x6c')])?null:_0x144710[_0xcc98('0x6c')];_0x35738d['original_sampleRate']=isNaN(_0x144710[_0xcc98('0x6d')])?null:_0x144710[_0xcc98('0x6d')];});_0x5bf85f['on'](_0xcc98('0x6e'),function(_0xf2abcf){_0x35738d[_0xcc98('0x6f')]=isNaN(_0xf2abcf[_0xcc98('0x68')])?null:_0xf2abcf[_0xcc98('0x68')]*0x3e8;_0x35738d['converted_sampleCount']=isNaN(_0xf2abcf['sampleCount'])?null:_0xf2abcf[_0xcc98('0x69')];_0x35738d[_0xcc98('0x70')]=isNaN(_0xf2abcf['channelCount'])?null:_0xf2abcf[_0xcc98('0x6a')];_0x35738d[_0xcc98('0x71')]=isNaN(_0xf2abcf[_0xcc98('0x6c')])?null:_0xf2abcf[_0xcc98('0x6c')];_0x35738d[_0xcc98('0x72')]=isNaN(_0xf2abcf[_0xcc98('0x6d')])?null:_0xf2abcf['sampleRate'];});_0x5bf85f['on'](_0xcc98('0x2a'),function(){fs[_0xcc98('0x63')](_0x3b195f,parseInt(_0xcc98('0x64'),0x8));return db[_0xcc98('0x31')][_0xcc98('0x58')](_0x35738d)[_0xcc98('0x25')](function(_0x357b70){var _0x537202={'role':_0x2fc136[_0xcc98('0x73')][_0xcc98('0x74')],'userProfileId':_0x2fc136[_0xcc98('0x73')][_0xcc98('0x75')]};if(!_0x537202)throw new Error(_0xcc98('0x76'));if(_0x537202[_0xcc98('0x74')]===_0xcc98('0x77')){var _0x467554=_0x357b70['get']({'plain':!![]});return db[_0xcc98('0x78')][_0xcc98('0x4a')]({'where':{'name':'Sounds','userProfileId':_0x537202[_0xcc98('0x75')]},'raw':!![]})['then'](function(_0x412a38){if(_0x412a38&&_0x412a38['autoAssociation']===0x0){return db[_0xcc98('0x29')][_0xcc98('0x58')]({'name':_0x467554['name'],'resourceId':_0x467554['id'],'type':_0x412a38[_0xcc98('0x2d')],'sectionId':_0x412a38['id']},{})[_0xcc98('0x25')](function(){return _0x357b70;});}else{return _0x357b70;}})[_0xcc98('0x4b')](function(_0x20ca8d){logger['error'](_0xcc98('0x79'),_0x20ca8d);throw _0x20ca8d;});}return _0x357b70;})[_0xcc98('0x25')](respondWithResult(_0x379595,null))[_0xcc98('0x4b')](handleError(_0x379595,null));});_0x5bf85f[_0xcc98('0x7a')]();}catch(_0x322179){_0x379595['status'](0x1f4)['send'](_0x322179);}};exports[_0xcc98('0x7b')]=function(_0x24bfa0,_0x5b1bf6,_0x3f4e83){return db[_0xcc98('0x31')][_0xcc98('0x4a')]({'where':{'id':_0x24bfa0['params']['id']}})[_0xcc98('0x25')](handleEntityNotFound(_0x5b1bf6,null))[_0xcc98('0x25')](saveUpdates(_[_0xcc98('0x7c')](_0x24bfa0[_0xcc98('0x73')],['name',_0xcc98('0x7d')]),null))['then'](respondWithResult(_0x5b1bf6,null))[_0xcc98('0x4b')](handleError(_0x5b1bf6,null));};exports['delete']=function(_0x53e655,_0x42f6c0,_0x4c995c){return db[_0xcc98('0x31')][_0xcc98('0x4a')]({'where':{'id':_0x53e655[_0xcc98('0x48')]['id']}})[_0xcc98('0x25')](function(_0x4ab9a6){if(_0x4ab9a6){return _0x4ab9a6[_0xcc98('0x26')]();}})['then'](function(_0x460e5a){var _0x6f2e4f=path[_0xcc98('0x4d')](config[_0xcc98('0x4e')],_0xcc98('0x5f'),util[_0xcc98('0x55')]('%s.%s',_0x460e5a[_0xcc98('0x57')],_0x460e5a['original_format']));var _0x189f08=path[_0xcc98('0x4d')](config[_0xcc98('0x4e')],_0xcc98('0x54'),util[_0xcc98('0x55')]('%s.%s',_0x460e5a[_0xcc98('0x57')],_0x460e5a[_0xcc98('0x4f')]));fs[_0xcc98('0x65')](_0x6f2e4f);fs[_0xcc98('0x65')](_0x189f08);return _0x460e5a;})['then'](function(_0x3ef229){if(_0x3ef229){return _0x42f6c0[_0xcc98('0x1a')](0xcc)[_0xcc98('0x2a')]();}})[_0xcc98('0x25')](handleEntityNotFound(_0x42f6c0,null))['catch'](handleError(_0x42f6c0,null));}; \ No newline at end of file diff --git a/server/api/sound/sound.model.js b/server/api/sound/sound.model.js index 8954e3a..c38c3cd 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 _0x85f3=['api','moment','bluebird','request-promise','path','../../config/environment','exports','Sound','lodash'];(function(_0x4825e6,_0x43f514){var _0x250937=function(_0x32904e){while(--_0x32904e){_0x4825e6['push'](_0x4825e6['shift']());}};_0x250937(++_0x43f514);}(_0x85f3,0x128));var _0x385f=function(_0x5b27da,_0x4a6532){_0x5b27da=_0x5b27da-0x0;var _0x3254f4=_0x85f3[_0x5b27da];return _0x3254f4;};'use strict';var _=require(_0x385f('0x0'));var util=require('util');var logger=require('../../config/logger')(_0x385f('0x1'));var moment=require(_0x385f('0x2'));var BPromise=require(_0x385f('0x3'));var rp=require(_0x385f('0x4'));var fs=require('fs');var path=require(_0x385f('0x5'));var rimraf=require('rimraf');var config=require(_0x385f('0x6'));var attributes=require('./sound.attributes');module[_0x385f('0x7')]=function(_0x1afc4c,_0x22351f){return _0x1afc4c['define'](_0x385f('0x8'),attributes,{'tableName':'tools_sounds','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xde75=['../../config/environment','./sound.attributes','exports','define','Sound','lodash','util','../../config/logger','api','moment','bluebird','path'];(function(_0x5d2ed9,_0x16c436){var _0x4262c5=function(_0x124aee){while(--_0x124aee){_0x5d2ed9['push'](_0x5d2ed9['shift']());}};_0x4262c5(++_0x16c436);}(_0xde75,0x1d9));var _0x5de7=function(_0x440589,_0x2cc34d){_0x440589=_0x440589-0x0;var _0x38f5c3=_0xde75[_0x440589];return _0x38f5c3;};'use strict';var _=require(_0x5de7('0x0'));var util=require(_0x5de7('0x1'));var logger=require(_0x5de7('0x2'))(_0x5de7('0x3'));var moment=require(_0x5de7('0x4'));var BPromise=require(_0x5de7('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x5de7('0x6'));var rimraf=require('rimraf');var config=require(_0x5de7('0x7'));var attributes=require(_0x5de7('0x8'));module[_0x5de7('0x9')]=function(_0x16d27e,_0x69f65c){return _0x16d27e[_0x5de7('0xa')](_0x5de7('0xb'),attributes,{'tableName':'tools_sounds','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/sound/sound.rpc.js b/server/api/sound/sound.rpc.js index d190948..b35f9ca 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 _0x52b4=['ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','http','then','Sound,\x20%s,\x20%s','request\x20sent','Sound,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','ShowSound','find','options','where','attributes','include','map','model','info','debug','stringify','util','bluebird','randomstring'];(function(_0x5c2b1f,_0x266443){var _0x55d367=function(_0xeb5790){while(--_0xeb5790){_0x5c2b1f['push'](_0x5c2b1f['shift']());}};_0x55d367(++_0x266443);}(_0x52b4,0x193));var _0x452b=function(_0x34f6af,_0x679d84){_0x34f6af=_0x34f6af-0x0;var _0x4c7c2e=_0x52b4[_0x34f6af];return _0x4c7c2e;};'use strict';var _=require('lodash');var util=require(_0x452b('0x0'));var moment=require('moment');var BPromise=require(_0x452b('0x1'));var rs=require(_0x452b('0x2'));var fs=require('fs');var Redis=require(_0x452b('0x3'));var db=require(_0x452b('0x4'))['db'];var utils=require(_0x452b('0x5'));var logger=require(_0x452b('0x6'))(_0x452b('0x7'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson['client'][_0x452b('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x50d591,_0x491b12,_0x57b505){return new BPromise(function(_0x55035e,_0x15c042){return client['request'](_0x50d591,_0x57b505)[_0x452b('0x9')](function(_0x400d97){logger['info'](_0x452b('0xa'),_0x491b12,_0x452b('0xb'));logger['debug'](_0x452b('0xc'),_0x491b12,_0x452b('0xb'),JSON['stringify'](_0x400d97));if(_0x400d97[_0x452b('0xd')]){if(_0x400d97[_0x452b('0xd')][_0x452b('0xe')]===0x1f4){logger[_0x452b('0xd')](_0x452b('0xa'),_0x491b12,_0x400d97[_0x452b('0xd')][_0x452b('0xf')]);return _0x15c042(_0x400d97[_0x452b('0xd')][_0x452b('0xf')]);}logger[_0x452b('0xd')](_0x452b('0xa'),_0x491b12,_0x400d97[_0x452b('0xd')]['message']);return _0x55035e(_0x400d97[_0x452b('0xd')][_0x452b('0xf')]);}else{logger['info']('Sound,\x20%s,\x20%s',_0x491b12,_0x452b('0xb'));_0x55035e(_0x400d97[_0x452b('0x10')][_0x452b('0xf')]);}})[_0x452b('0x11')](function(_0x49cec4){logger['error'](_0x452b('0xa'),_0x491b12,_0x49cec4);_0x15c042(_0x49cec4);});});}exports[_0x452b('0x12')]=function(_0x402ab3){var _0x2343b3=this;return new Promise(function(_0x50e35e,_0xe088d0){return db['Sound'][_0x452b('0x13')]({'raw':_0x402ab3['options']?_0x402ab3[_0x452b('0x14')]['raw']===undefined?!![]:![]:!![],'where':_0x402ab3['options']?_0x402ab3['options'][_0x452b('0x15')]||null:null,'attributes':_0x402ab3[_0x452b('0x14')]?_0x402ab3['options'][_0x452b('0x16')]||null:null,'include':_0x402ab3[_0x452b('0x14')]?_0x402ab3[_0x452b('0x14')][_0x452b('0x17')]?_[_0x452b('0x18')](_0x402ab3['options']['include'],function(_0x41ea7d){return{'model':db[_0x41ea7d['model']],'as':_0x41ea7d['as'],'attributes':_0x41ea7d[_0x452b('0x16')],'include':_0x41ea7d[_0x452b('0x17')]?_[_0x452b('0x18')](_0x41ea7d['include'],function(_0x519438){return{'model':db[_0x519438[_0x452b('0x19')]],'as':_0x519438['as'],'attributes':_0x519438[_0x452b('0x16')],'include':_0x519438[_0x452b('0x17')]?_['map'](_0x519438[_0x452b('0x17')],function(_0x480039){return{'model':db[_0x480039['model']],'as':_0x480039['as'],'attributes':_0x480039[_0x452b('0x16')]};}):[]};}):[]};}):[]:[]})[_0x452b('0x9')](function(_0x25b9b8){logger[_0x452b('0x1a')](_0x452b('0x12'),_0x402ab3);logger[_0x452b('0x1b')](_0x452b('0x12'),_0x402ab3,JSON[_0x452b('0x1c')](_0x25b9b8));_0x50e35e(_0x25b9b8);})['catch'](function(_0x2219df){logger[_0x452b('0xd')](_0x452b('0x12'),_0x2219df[_0x452b('0xf')],_0x402ab3);_0xe088d0(_0x2343b3[_0x452b('0xd')](0x1f4,_0x2219df[_0x452b('0xf')]));});});}; \ No newline at end of file +var _0xb1cd=['map','model','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','request','then','info','Sound,\x20%s,\x20%s','request\x20sent','debug','Sound,\x20%s,\x20%s,\x20%s','stringify','error','message','catch','ShowSound','Sound','find','options','where','attributes','include'];(function(_0x17c450,_0x12d086){var _0x2fff75=function(_0x14101d){while(--_0x14101d){_0x17c450['push'](_0x17c450['shift']());}};_0x2fff75(++_0x12d086);}(_0xb1cd,0x82));var _0xdb1c=function(_0xb8eac,_0x576343){_0xb8eac=_0xb8eac-0x0;var _0x920f0=_0xb1cd[_0xb8eac];return _0x920f0;};'use strict';var _=require(_0xdb1c('0x0'));var util=require(_0xdb1c('0x1'));var moment=require(_0xdb1c('0x2'));var BPromise=require(_0xdb1c('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xdb1c('0x4'));var db=require(_0xdb1c('0x5'))['db'];var utils=require(_0xdb1c('0x6'));var logger=require(_0xdb1c('0x7'))(_0xdb1c('0x8'));var config=require('../../config/environment');var jayson=require(_0xdb1c('0x9'));var client=jayson[_0xdb1c('0xa')][_0xdb1c('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x45a43e,_0x33a001,_0x4708a8){return new BPromise(function(_0x5be6ae,_0x1158c0){return client[_0xdb1c('0xc')](_0x45a43e,_0x4708a8)[_0xdb1c('0xd')](function(_0x7e26cd){logger[_0xdb1c('0xe')](_0xdb1c('0xf'),_0x33a001,_0xdb1c('0x10'));logger[_0xdb1c('0x11')](_0xdb1c('0x12'),_0x33a001,'request\x20sent',JSON[_0xdb1c('0x13')](_0x7e26cd));if(_0x7e26cd[_0xdb1c('0x14')]){if(_0x7e26cd['error']['code']===0x1f4){logger[_0xdb1c('0x14')](_0xdb1c('0xf'),_0x33a001,_0x7e26cd[_0xdb1c('0x14')][_0xdb1c('0x15')]);return _0x1158c0(_0x7e26cd[_0xdb1c('0x14')][_0xdb1c('0x15')]);}logger[_0xdb1c('0x14')]('Sound,\x20%s,\x20%s',_0x33a001,_0x7e26cd[_0xdb1c('0x14')][_0xdb1c('0x15')]);return _0x5be6ae(_0x7e26cd['error'][_0xdb1c('0x15')]);}else{logger[_0xdb1c('0xe')](_0xdb1c('0xf'),_0x33a001,'request\x20sent');_0x5be6ae(_0x7e26cd['result'][_0xdb1c('0x15')]);}})[_0xdb1c('0x16')](function(_0x4b7856){logger[_0xdb1c('0x14')]('Sound,\x20%s,\x20%s',_0x33a001,_0x4b7856);_0x1158c0(_0x4b7856);});});}exports[_0xdb1c('0x17')]=function(_0x17dc49){var _0xa805c7=this;return new Promise(function(_0x150f04,_0x5b78b8){return db[_0xdb1c('0x18')][_0xdb1c('0x19')]({'raw':_0x17dc49[_0xdb1c('0x1a')]?_0x17dc49[_0xdb1c('0x1a')]['raw']===undefined?!![]:![]:!![],'where':_0x17dc49['options']?_0x17dc49[_0xdb1c('0x1a')][_0xdb1c('0x1b')]||null:null,'attributes':_0x17dc49['options']?_0x17dc49[_0xdb1c('0x1a')][_0xdb1c('0x1c')]||null:null,'include':_0x17dc49['options']?_0x17dc49['options'][_0xdb1c('0x1d')]?_['map'](_0x17dc49[_0xdb1c('0x1a')][_0xdb1c('0x1d')],function(_0x20116a){return{'model':db[_0x20116a['model']],'as':_0x20116a['as'],'attributes':_0x20116a[_0xdb1c('0x1c')],'include':_0x20116a[_0xdb1c('0x1d')]?_[_0xdb1c('0x1e')](_0x20116a['include'],function(_0x14dd6d){return{'model':db[_0x14dd6d[_0xdb1c('0x1f')]],'as':_0x14dd6d['as'],'attributes':_0x14dd6d[_0xdb1c('0x1c')],'include':_0x14dd6d[_0xdb1c('0x1d')]?_['map'](_0x14dd6d[_0xdb1c('0x1d')],function(_0xad1a80){return{'model':db[_0xad1a80[_0xdb1c('0x1f')]],'as':_0xad1a80['as'],'attributes':_0xad1a80[_0xdb1c('0x1c')]};}):[]};}):[]};}):[]:[]})[_0xdb1c('0xd')](function(_0x3fc4c3){logger[_0xdb1c('0xe')](_0xdb1c('0x17'),_0x17dc49);logger[_0xdb1c('0x11')](_0xdb1c('0x17'),_0x17dc49,JSON[_0xdb1c('0x13')](_0x3fc4c3));_0x150f04(_0x3fc4c3);})['catch'](function(_0x11695a){logger[_0xdb1c('0x14')](_0xdb1c('0x17'),_0x11695a['message'],_0x17dc49);_0x5b78b8(_0xa805c7[_0xdb1c('0x14')](0x1f4,_0x11695a[_0xdb1c('0x15')]));});});}; \ No newline at end of file diff --git a/server/api/squareMessage/index.js b/server/api/squareMessage/index.js index ea0d98c..24cfdac 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 _0x8603=['../../components/interaction/service','./squareMessage.controller','isAuthenticated','index','get','/:id','create','put','update','exports','util','path','connect-timeout','fs-extra','../../components/auth/service'];(function(_0x32056c,_0x1b6db7){var _0x317313=function(_0x6456b6){while(--_0x6456b6){_0x32056c['push'](_0x32056c['shift']());}};_0x317313(++_0x1b6db7);}(_0x8603,0x190));var _0x3860=function(_0x271d10,_0x5348db){_0x271d10=_0x271d10-0x0;var _0x479491=_0x8603[_0x271d10];return _0x479491;};'use strict';var multer=require('multer');var util=require(_0x3860('0x0'));var path=require(_0x3860('0x1'));var timeout=require(_0x3860('0x2'));var express=require('express');var router=express['Router']();var fs_extra=require(_0x3860('0x3'));var auth=require(_0x3860('0x4'));var interaction=require(_0x3860('0x5'));var config=require('../../config/environment');var controller=require(_0x3860('0x6'));router['get']('/',auth[_0x3860('0x7')](),controller[_0x3860('0x8')]);router[_0x3860('0x9')](_0x3860('0xa'),auth[_0x3860('0x7')](),controller['show']);router['post']('/',auth['isAuthenticated'](),controller[_0x3860('0xb')]);router[_0x3860('0xc')]('/:id',auth[_0x3860('0x7')](),controller[_0x3860('0xd')]);router['delete'](_0x3860('0xa'),auth[_0x3860('0x7')](),controller['destroy']);module[_0x3860('0xe')]=router; \ No newline at end of file +var _0xac4a=['express','Router','../../components/interaction/service','../../config/environment','./squareMessage.controller','isAuthenticated','get','show','create','/:id','delete','destroy','exports','multer','util','path','connect-timeout'];(function(_0x136ace,_0x251e7b){var _0x20a9bc=function(_0x4aa33e){while(--_0x4aa33e){_0x136ace['push'](_0x136ace['shift']());}};_0x20a9bc(++_0x251e7b);}(_0xac4a,0x13f));var _0xaac4=function(_0x5dd718,_0x20df54){_0x5dd718=_0x5dd718-0x0;var _0x486b22=_0xac4a[_0x5dd718];return _0x486b22;};'use strict';var multer=require(_0xaac4('0x0'));var util=require(_0xaac4('0x1'));var path=require(_0xaac4('0x2'));var timeout=require(_0xaac4('0x3'));var express=require(_0xaac4('0x4'));var router=express[_0xaac4('0x5')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0xaac4('0x6'));var config=require(_0xaac4('0x7'));var controller=require(_0xaac4('0x8'));router['get']('/',auth[_0xaac4('0x9')](),controller['index']);router[_0xaac4('0xa')]('/:id',auth[_0xaac4('0x9')](),controller[_0xaac4('0xb')]);router['post']('/',auth['isAuthenticated'](),controller[_0xaac4('0xc')]);router['put'](_0xaac4('0xd'),auth['isAuthenticated'](),controller['update']);router[_0xaac4('0xe')](_0xaac4('0xd'),auth[_0xaac4('0x9')](),controller[_0xaac4('0xf')]);module[_0xaac4('0x10')]=router; \ No newline at end of file diff --git a/server/api/squareMessage/squareMessage.attributes.js b/server/api/squareMessage/squareMessage.attributes.js index a4571db..fa92829 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 _0xc1f5=['medium','ENUM','out','STRING','TEXT','exports'];(function(_0x432fca,_0xb0b1b5){var _0x3adba4=function(_0x5e3ae4){while(--_0x5e3ae4){_0x432fca['push'](_0x432fca['shift']());}};_0x3adba4(++_0xb0b1b5);}(_0xc1f5,0xb9));var _0x5c1f=function(_0x1ef246,_0x42e40){_0x1ef246=_0x1ef246-0x0;var _0x229a28=_0xc1f5[_0x1ef246];return _0x229a28;};'use strict';var Sequelize=require('sequelize');module[_0x5c1f('0x0')]={'uniqueid':{'type':Sequelize['STRING']},'body':{'type':Sequelize['TEXT'](_0x5c1f('0x1')),'allowNull':![]},'direction':{'type':Sequelize[_0x5c1f('0x2')]('in',_0x5c1f('0x3')),'defaultValue':'out','allowNull':![]},'providerName':{'type':Sequelize[_0x5c1f('0x4')]},'providerResponse':{'type':Sequelize[_0x5c1f('0x5')]}}; \ No newline at end of file +var _0x2a17=['exports','STRING','ENUM','out','TEXT','sequelize'];(function(_0x141706,_0x293ddc){var _0x2da78c=function(_0x88963d){while(--_0x88963d){_0x141706['push'](_0x141706['shift']());}};_0x2da78c(++_0x293ddc);}(_0x2a17,0x1c7));var _0x72a1=function(_0x18608b,_0x2cb8d5){_0x18608b=_0x18608b-0x0;var _0x36f70b=_0x2a17[_0x18608b];return _0x36f70b;};'use strict';var Sequelize=require(_0x72a1('0x0'));module[_0x72a1('0x1')]={'uniqueid':{'type':Sequelize[_0x72a1('0x2')]},'body':{'type':Sequelize['TEXT']('medium'),'allowNull':![]},'direction':{'type':Sequelize[_0x72a1('0x3')]('in',_0x72a1('0x4')),'defaultValue':_0x72a1('0x4'),'allowNull':![]},'providerName':{'type':Sequelize[_0x72a1('0x2')]},'providerResponse':{'type':Sequelize[_0x72a1('0x5')]}}; \ No newline at end of file diff --git a/server/api/squareMessage/squareMessage.controller.js b/server/api/squareMessage/squareMessage.controller.js index aa5bb29..9e665d9 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 _0x1c52=['../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','json','offset','limit','count','Content-Range','apply','reject','save','update','then','destroy','end','error','send','index','map','fieldName','type','key','model','name','query','keys','attributes','intersection','fields','nolimit','order','sort','filters','pick','filter','where','merge','SquareMessage','includeAll','include','findAll','rows','catch','params','rawAttributes','length','options','find','create','body','eml-format','rimraf','zip-dir','fast-json-patch','mustache','util','sox','to-csv','ejs','fs-extra','squel','crypto','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','../../config/utils'];(function(_0x996bc8,_0x291e01){var _0x20b0ea=function(_0x5ba992){while(--_0x5ba992){_0x996bc8['push'](_0x996bc8['shift']());}};_0x20b0ea(++_0x291e01);}(_0x1c52,0x7c));var _0x21c5=function(_0x106a60,_0x5d5e2e){_0x106a60=_0x106a60-0x0;var _0x54b226=_0x1c52[_0x106a60];return _0x54b226;};'use strict';var emlformat=require(_0x21c5('0x0'));var rimraf=require(_0x21c5('0x1'));var zipdir=require(_0x21c5('0x2'));var jsonpatch=require(_0x21c5('0x3'));var rp=require('request-promise');var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0x21c5('0x4'));var util=require(_0x21c5('0x5'));var path=require('path');var sox=require(_0x21c5('0x6'));var csv=require(_0x21c5('0x7'));var ejs=require(_0x21c5('0x8'));var fs=require('fs');var fs_extra=require(_0x21c5('0x9'));var _=require('lodash');var squel=require(_0x21c5('0xa'));var crypto=require(_0x21c5('0xb'));var jsforce=require('jsforce');var deskjs=require(_0x21c5('0xc'));var toCsv=require(_0x21c5('0x7'));var querystring=require(_0x21c5('0xd'));var Papa=require(_0x21c5('0xe'));var Redis=require('ioredis');var authService=require(_0x21c5('0xf'));var qs=require(_0x21c5('0x10'));var as=require(_0x21c5('0x11'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x21c5('0x12'))('api');var utils=require(_0x21c5('0x13'));var config=require(_0x21c5('0x14'));var licenseUtil=require(_0x21c5('0x15'));var db=require(_0x21c5('0x16'))['db'];function respondWithStatusCode(_0x511e96,_0x36b869){_0x36b869=_0x36b869||0xcc;return function(_0x59bfc2){if(_0x59bfc2){return _0x511e96[_0x21c5('0x17')](_0x36b869);}return _0x511e96[_0x21c5('0x18')](_0x36b869)['end']();};}function respondWithResult(_0x17be3d,_0x4afb87){_0x4afb87=_0x4afb87||0xc8;return function(_0x4791f7){if(_0x4791f7){return _0x17be3d[_0x21c5('0x18')](_0x4afb87)[_0x21c5('0x19')](_0x4791f7);}};}function respondWithFilteredResult(_0x47030b,_0x20902a){return function(_0x15de0c){if(_0x15de0c){var _0x102433=typeof _0x20902a[_0x21c5('0x1a')]==='undefined'&&typeof _0x20902a[_0x21c5('0x1b')]==='undefined';var _0x495f5c=_0x15de0c[_0x21c5('0x1c')];var _0x56696e=_0x102433?0x0:_0x20902a['offset'];var _0x1bc8a4=_0x102433?_0x15de0c['count']:_0x20902a[_0x21c5('0x1a')]+_0x20902a['limit'];var _0x30fb8a;if(_0x1bc8a4>=_0x495f5c){_0x1bc8a4=_0x495f5c;_0x30fb8a=0xc8;}else{_0x30fb8a=0xce;}_0x47030b['status'](_0x30fb8a);return _0x47030b['set'](_0x21c5('0x1d'),_0x56696e+'-'+_0x1bc8a4+'/'+_0x495f5c)[_0x21c5('0x19')](_0x15de0c);}return null;};}function patchUpdates(_0x2840b7){return function(_0x300178){try{jsonpatch[_0x21c5('0x1e')](_0x300178,_0x2840b7,!![]);}catch(_0x1fb82d){return BPromise[_0x21c5('0x1f')](_0x1fb82d);}return _0x300178[_0x21c5('0x20')]();};}function saveUpdates(_0x1905a9,_0x493fbf){return function(_0x8021db){if(_0x8021db){return _0x8021db[_0x21c5('0x21')](_0x1905a9)[_0x21c5('0x22')](function(_0x1aa54e){return _0x1aa54e;});}return null;};}function removeEntity(_0x123a7a,_0x4bf186){return function(_0x251c9d){if(_0x251c9d){return _0x251c9d[_0x21c5('0x23')]()[_0x21c5('0x22')](function(){_0x123a7a[_0x21c5('0x18')](0xcc)[_0x21c5('0x24')]();});}};}function handleEntityNotFound(_0x4d3215,_0x51c0b1){return function(_0x4f877c){if(!_0x4f877c){_0x4d3215[_0x21c5('0x17')](0x194);}return _0x4f877c;};}function handleError(_0x200bc4,_0x442fac){_0x442fac=_0x442fac||0x1f4;return function(_0x2ae029){logger[_0x21c5('0x25')](_0x2ae029['stack']);if(_0x2ae029['name']){delete _0x2ae029['name'];}_0x200bc4[_0x21c5('0x18')](_0x442fac)[_0x21c5('0x26')](_0x2ae029);};}exports[_0x21c5('0x27')]=function(_0x3f056f,_0x52d551){var _0x887b={},_0x428b60={},_0x26dc04={'count':0x0,'rows':[]};var _0x1f3892=_[_0x21c5('0x28')](db['SquareMessage']['rawAttributes'],function(_0xda0d70){return{'name':_0xda0d70[_0x21c5('0x29')],'type':_0xda0d70[_0x21c5('0x2a')][_0x21c5('0x2b')]};});_0x428b60[_0x21c5('0x2c')]=_[_0x21c5('0x28')](_0x1f3892,_0x21c5('0x2d'));_0x428b60[_0x21c5('0x2e')]=_[_0x21c5('0x2f')](_0x3f056f[_0x21c5('0x2e')]);_0x428b60['filters']=_['intersection'](_0x428b60[_0x21c5('0x2c')],_0x428b60['query']);_0x887b[_0x21c5('0x30')]=_[_0x21c5('0x31')](_0x428b60[_0x21c5('0x2c')],qs[_0x21c5('0x32')](_0x3f056f['query'][_0x21c5('0x32')]));_0x887b['attributes']=_0x887b[_0x21c5('0x30')]['length']?_0x887b[_0x21c5('0x30')]:_0x428b60[_0x21c5('0x2c')];if(!_0x3f056f[_0x21c5('0x2e')]['hasOwnProperty'](_0x21c5('0x33'))){_0x887b['limit']=qs[_0x21c5('0x1b')](_0x3f056f[_0x21c5('0x2e')][_0x21c5('0x1b')]);_0x887b['offset']=qs[_0x21c5('0x1a')](_0x3f056f['query']['offset']);}_0x887b[_0x21c5('0x34')]=qs[_0x21c5('0x35')](_0x3f056f[_0x21c5('0x2e')][_0x21c5('0x35')]);_0x887b['where']=qs[_0x21c5('0x36')](_[_0x21c5('0x37')](_0x3f056f[_0x21c5('0x2e')],_0x428b60[_0x21c5('0x36')]),_0x1f3892);if(_0x3f056f[_0x21c5('0x2e')][_0x21c5('0x38')]){_0x887b[_0x21c5('0x39')]=_[_0x21c5('0x3a')](_0x887b['where'],{'$or':_[_0x21c5('0x28')](_0x1f3892,function(_0x29f3c1){if(_0x29f3c1[_0x21c5('0x2a')]!=='VIRTUAL'){var _0x44d12e={};_0x44d12e[_0x29f3c1[_0x21c5('0x2d')]]={'$like':'%'+_0x3f056f[_0x21c5('0x2e')][_0x21c5('0x38')]+'%'};return _0x44d12e;}})});}_0x887b=_[_0x21c5('0x3a')]({},_0x887b,_0x3f056f['options']);var _0x5a08ad={'where':_0x887b[_0x21c5('0x39')]};return db[_0x21c5('0x3b')][_0x21c5('0x1c')](_0x5a08ad)[_0x21c5('0x22')](function(_0x59a2fb){_0x26dc04[_0x21c5('0x1c')]=_0x59a2fb;if(_0x3f056f[_0x21c5('0x2e')][_0x21c5('0x3c')]){_0x887b[_0x21c5('0x3d')]=[{'all':!![]}];}return db['SquareMessage'][_0x21c5('0x3e')](_0x887b);})[_0x21c5('0x22')](function(_0x4f0e0b){_0x26dc04[_0x21c5('0x3f')]=_0x4f0e0b;return _0x26dc04;})[_0x21c5('0x22')](respondWithFilteredResult(_0x52d551,_0x887b))[_0x21c5('0x40')](handleError(_0x52d551,null));};exports['show']=function(_0x22af70,_0x35693c){var _0x19d698={'raw':!![],'where':{'id':_0x22af70[_0x21c5('0x41')]['id']}},_0x56547e={};_0x56547e['model']=_[_0x21c5('0x2f')](db[_0x21c5('0x3b')][_0x21c5('0x42')]);_0x56547e[_0x21c5('0x2e')]=_[_0x21c5('0x2f')](_0x22af70['query']);_0x56547e['filters']=_['intersection'](_0x56547e[_0x21c5('0x2c')],_0x56547e['query']);_0x19d698[_0x21c5('0x30')]=_[_0x21c5('0x31')](_0x56547e[_0x21c5('0x2c')],qs[_0x21c5('0x32')](_0x22af70['query'][_0x21c5('0x32')]));_0x19d698[_0x21c5('0x30')]=_0x19d698[_0x21c5('0x30')][_0x21c5('0x43')]?_0x19d698[_0x21c5('0x30')]:_0x56547e[_0x21c5('0x2c')];if(_0x22af70[_0x21c5('0x2e')][_0x21c5('0x3c')]){_0x19d698[_0x21c5('0x3d')]=[{'all':!![]}];}_0x19d698=_['merge']({},_0x19d698,_0x22af70[_0x21c5('0x44')]);return db['SquareMessage'][_0x21c5('0x45')](_0x19d698)[_0x21c5('0x22')](handleEntityNotFound(_0x35693c,null))[_0x21c5('0x22')](respondWithResult(_0x35693c,null))[_0x21c5('0x40')](handleError(_0x35693c,null));};exports[_0x21c5('0x46')]=function(_0x24242a,_0x29e4d3){return db[_0x21c5('0x3b')][_0x21c5('0x46')](_0x24242a[_0x21c5('0x47')],{})[_0x21c5('0x22')](respondWithResult(_0x29e4d3,0xc9))[_0x21c5('0x40')](handleError(_0x29e4d3,null));};exports['update']=function(_0x5e4586,_0x5513c5){if(_0x5e4586[_0x21c5('0x47')]['id']){delete _0x5e4586[_0x21c5('0x47')]['id'];}return db[_0x21c5('0x3b')]['find']({'where':{'id':_0x5e4586[_0x21c5('0x41')]['id']}})[_0x21c5('0x22')](handleEntityNotFound(_0x5513c5,null))[_0x21c5('0x22')](saveUpdates(_0x5e4586['body'],null))['then'](respondWithResult(_0x5513c5,null))[_0x21c5('0x40')](handleError(_0x5513c5,null));};exports[_0x21c5('0x23')]=function(_0x3fa0c4,_0x2b3ebc){return db['SquareMessage'][_0x21c5('0x45')]({'where':{'id':_0x3fa0c4[_0x21c5('0x41')]['id']}})[_0x21c5('0x22')](handleEntityNotFound(_0x2b3ebc,null))[_0x21c5('0x22')](removeEntity(_0x2b3ebc,null))['catch'](handleError(_0x2b3ebc,null));}; \ No newline at end of file +var _0x69b5=['where','merge','VIRTUAL','options','includeAll','include','findAll','rows','catch','show','params','SquareMessage','find','create','body','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','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','status','end','json','offset','limit','undefined','count','set','Content-Range','reject','save','update','then','sendStatus','error','name','send','map','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','length','nolimit','order','sort','filter'];(function(_0x3cb3b3,_0x3757d1){var _0x4e6ae8=function(_0x236f52){while(--_0x236f52){_0x3cb3b3['push'](_0x3cb3b3['shift']());}};_0x4e6ae8(++_0x3757d1);}(_0x69b5,0x18b));var _0x569b=function(_0xdbd4f7,_0x4e3bdd){_0xdbd4f7=_0xdbd4f7-0x0;var _0x5c3f9d=_0x69b5[_0xdbd4f7];return _0x5c3f9d;};'use strict';var emlformat=require(_0x569b('0x0'));var rimraf=require(_0x569b('0x1'));var zipdir=require(_0x569b('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x569b('0x3'));var moment=require(_0x569b('0x4'));var BPromise=require(_0x569b('0x5'));var Mustache=require(_0x569b('0x6'));var util=require(_0x569b('0x7'));var path=require(_0x569b('0x8'));var sox=require(_0x569b('0x9'));var csv=require(_0x569b('0xa'));var ejs=require(_0x569b('0xb'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x569b('0xc'));var squel=require(_0x569b('0xd'));var crypto=require('crypto');var jsforce=require(_0x569b('0xe'));var deskjs=require('desk.js');var toCsv=require(_0x569b('0xa'));var querystring=require(_0x569b('0xf'));var Papa=require(_0x569b('0x10'));var Redis=require('ioredis');var authService=require(_0x569b('0x11'));var qs=require(_0x569b('0x12'));var as=require(_0x569b('0x13'));var hardwareService=require(_0x569b('0x14'));var logger=require(_0x569b('0x15'))(_0x569b('0x16'));var utils=require(_0x569b('0x17'));var config=require(_0x569b('0x18'));var licenseUtil=require(_0x569b('0x19'));var db=require(_0x569b('0x1a'))['db'];function respondWithStatusCode(_0x2e443a,_0x2dd7e6){_0x2dd7e6=_0x2dd7e6||0xcc;return function(_0x53603f){if(_0x53603f){return _0x2e443a['sendStatus'](_0x2dd7e6);}return _0x2e443a[_0x569b('0x1b')](_0x2dd7e6)[_0x569b('0x1c')]();};}function respondWithResult(_0x2778bf,_0x1d6c8f){_0x1d6c8f=_0x1d6c8f||0xc8;return function(_0x70b64f){if(_0x70b64f){return _0x2778bf['status'](_0x1d6c8f)[_0x569b('0x1d')](_0x70b64f);}};}function respondWithFilteredResult(_0x4bbbf7,_0x2544a8){return function(_0x4355c3){if(_0x4355c3){var _0x4bcca9=typeof _0x2544a8[_0x569b('0x1e')]==='undefined'&&typeof _0x2544a8[_0x569b('0x1f')]===_0x569b('0x20');var _0x193342=_0x4355c3[_0x569b('0x21')];var _0x435299=_0x4bcca9?0x0:_0x2544a8[_0x569b('0x1e')];var _0x4157e7=_0x4bcca9?_0x4355c3['count']:_0x2544a8[_0x569b('0x1e')]+_0x2544a8[_0x569b('0x1f')];var _0x5e5d14;if(_0x4157e7>=_0x193342){_0x4157e7=_0x193342;_0x5e5d14=0xc8;}else{_0x5e5d14=0xce;}_0x4bbbf7[_0x569b('0x1b')](_0x5e5d14);return _0x4bbbf7[_0x569b('0x22')](_0x569b('0x23'),_0x435299+'-'+_0x4157e7+'/'+_0x193342)[_0x569b('0x1d')](_0x4355c3);}return null;};}function patchUpdates(_0x5c022b){return function(_0x43cb99){try{jsonpatch['apply'](_0x43cb99,_0x5c022b,!![]);}catch(_0x153033){return BPromise[_0x569b('0x24')](_0x153033);}return _0x43cb99[_0x569b('0x25')]();};}function saveUpdates(_0x5b1f5c,_0x14f757){return function(_0x464c94){if(_0x464c94){return _0x464c94[_0x569b('0x26')](_0x5b1f5c)['then'](function(_0x45aa0d){return _0x45aa0d;});}return null;};}function removeEntity(_0x12bc74,_0x37852f){return function(_0x34e8ca){if(_0x34e8ca){return _0x34e8ca['destroy']()[_0x569b('0x27')](function(){_0x12bc74['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x5c6f8b,_0x522719){return function(_0x594b44){if(!_0x594b44){_0x5c6f8b[_0x569b('0x28')](0x194);}return _0x594b44;};}function handleError(_0x2801a1,_0x1cf5f1){_0x1cf5f1=_0x1cf5f1||0x1f4;return function(_0x3e631d){logger[_0x569b('0x29')](_0x3e631d['stack']);if(_0x3e631d[_0x569b('0x2a')]){delete _0x3e631d['name'];}_0x2801a1[_0x569b('0x1b')](_0x1cf5f1)[_0x569b('0x2b')](_0x3e631d);};}exports['index']=function(_0x2be410,_0x4ca5e1){var _0x35d7e5={},_0x326cef={},_0x159c91={'count':0x0,'rows':[]};var _0xd900a6=_[_0x569b('0x2c')](db['SquareMessage'][_0x569b('0x2d')],function(_0x48180d){return{'name':_0x48180d[_0x569b('0x2e')],'type':_0x48180d[_0x569b('0x2f')][_0x569b('0x30')]};});_0x326cef[_0x569b('0x31')]=_[_0x569b('0x2c')](_0xd900a6,'name');_0x326cef[_0x569b('0x32')]=_[_0x569b('0x33')](_0x2be410[_0x569b('0x32')]);_0x326cef[_0x569b('0x34')]=_[_0x569b('0x35')](_0x326cef['model'],_0x326cef[_0x569b('0x32')]);_0x35d7e5[_0x569b('0x36')]=_[_0x569b('0x35')](_0x326cef[_0x569b('0x31')],qs[_0x569b('0x37')](_0x2be410[_0x569b('0x32')]['fields']));_0x35d7e5['attributes']=_0x35d7e5[_0x569b('0x36')][_0x569b('0x38')]?_0x35d7e5[_0x569b('0x36')]:_0x326cef[_0x569b('0x31')];if(!_0x2be410['query']['hasOwnProperty'](_0x569b('0x39'))){_0x35d7e5[_0x569b('0x1f')]=qs[_0x569b('0x1f')](_0x2be410[_0x569b('0x32')][_0x569b('0x1f')]);_0x35d7e5['offset']=qs[_0x569b('0x1e')](_0x2be410[_0x569b('0x32')][_0x569b('0x1e')]);}_0x35d7e5[_0x569b('0x3a')]=qs['sort'](_0x2be410[_0x569b('0x32')][_0x569b('0x3b')]);_0x35d7e5['where']=qs[_0x569b('0x34')](_['pick'](_0x2be410[_0x569b('0x32')],_0x326cef[_0x569b('0x34')]),_0xd900a6);if(_0x2be410[_0x569b('0x32')][_0x569b('0x3c')]){_0x35d7e5[_0x569b('0x3d')]=_[_0x569b('0x3e')](_0x35d7e5['where'],{'$or':_['map'](_0xd900a6,function(_0x3533f2){if(_0x3533f2[_0x569b('0x2f')]!==_0x569b('0x3f')){var _0x3e70e8={};_0x3e70e8[_0x3533f2[_0x569b('0x2a')]]={'$like':'%'+_0x2be410[_0x569b('0x32')][_0x569b('0x3c')]+'%'};return _0x3e70e8;}})});}_0x35d7e5=_[_0x569b('0x3e')]({},_0x35d7e5,_0x2be410[_0x569b('0x40')]);var _0x1c2635={'where':_0x35d7e5['where']};return db['SquareMessage'][_0x569b('0x21')](_0x1c2635)[_0x569b('0x27')](function(_0x378721){_0x159c91['count']=_0x378721;if(_0x2be410[_0x569b('0x32')][_0x569b('0x41')]){_0x35d7e5[_0x569b('0x42')]=[{'all':!![]}];}return db['SquareMessage'][_0x569b('0x43')](_0x35d7e5);})[_0x569b('0x27')](function(_0x309f07){_0x159c91[_0x569b('0x44')]=_0x309f07;return _0x159c91;})[_0x569b('0x27')](respondWithFilteredResult(_0x4ca5e1,_0x35d7e5))[_0x569b('0x45')](handleError(_0x4ca5e1,null));};exports[_0x569b('0x46')]=function(_0x53d606,_0x4333ba){var _0x7c2a00={'raw':!![],'where':{'id':_0x53d606[_0x569b('0x47')]['id']}},_0x42d694={};_0x42d694['model']=_[_0x569b('0x33')](db[_0x569b('0x48')]['rawAttributes']);_0x42d694[_0x569b('0x32')]=_[_0x569b('0x33')](_0x53d606[_0x569b('0x32')]);_0x42d694[_0x569b('0x34')]=_[_0x569b('0x35')](_0x42d694[_0x569b('0x31')],_0x42d694[_0x569b('0x32')]);_0x7c2a00[_0x569b('0x36')]=_['intersection'](_0x42d694['model'],qs['fields'](_0x53d606[_0x569b('0x32')]['fields']));_0x7c2a00[_0x569b('0x36')]=_0x7c2a00[_0x569b('0x36')]['length']?_0x7c2a00['attributes']:_0x42d694[_0x569b('0x31')];if(_0x53d606['query'][_0x569b('0x41')]){_0x7c2a00['include']=[{'all':!![]}];}_0x7c2a00=_['merge']({},_0x7c2a00,_0x53d606[_0x569b('0x40')]);return db[_0x569b('0x48')][_0x569b('0x49')](_0x7c2a00)[_0x569b('0x27')](handleEntityNotFound(_0x4333ba,null))[_0x569b('0x27')](respondWithResult(_0x4333ba,null))['catch'](handleError(_0x4333ba,null));};exports[_0x569b('0x4a')]=function(_0x597f98,_0x290b8d){return db['SquareMessage'][_0x569b('0x4a')](_0x597f98['body'],{})[_0x569b('0x27')](respondWithResult(_0x290b8d,0xc9))[_0x569b('0x45')](handleError(_0x290b8d,null));};exports[_0x569b('0x26')]=function(_0x4120d0,_0x158520){if(_0x4120d0['body']['id']){delete _0x4120d0[_0x569b('0x4b')]['id'];}return db['SquareMessage'][_0x569b('0x49')]({'where':{'id':_0x4120d0['params']['id']}})['then'](handleEntityNotFound(_0x158520,null))['then'](saveUpdates(_0x4120d0['body'],null))[_0x569b('0x27')](respondWithResult(_0x158520,null))['catch'](handleError(_0x158520,null));};exports['destroy']=function(_0x545d41,_0x4c9d8e){return db[_0x569b('0x48')]['find']({'where':{'id':_0x545d41[_0x569b('0x47')]['id']}})[_0x569b('0x27')](handleEntityNotFound(_0x4c9d8e,null))['then'](removeEntity(_0x4c9d8e,null))[_0x569b('0x45')](handleError(_0x4c9d8e,null));}; \ No newline at end of file diff --git a/server/api/squareMessage/squareMessage.model.js b/server/api/squareMessage/squareMessage.model.js index 66bb8ad..0877e9b 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 _0x6d00=['../../config/environment','./squareMessage.attributes','define','SquareMessage','square_messages','lodash','util','bluebird','path','rimraf'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0x6d00,0x1c7));var _0x06d0=function(_0x18ecae,_0x2bf366){_0x18ecae=_0x18ecae-0x0;var _0x2fe95b=_0x6d00[_0x18ecae];return _0x2fe95b;};'use strict';var _=require(_0x06d0('0x0'));var util=require(_0x06d0('0x1'));var logger=require('../../config/logger')('api');var moment=require('moment');var BPromise=require(_0x06d0('0x2'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x06d0('0x3'));var rimraf=require(_0x06d0('0x4'));var config=require(_0x06d0('0x5'));var attributes=require(_0x06d0('0x6'));module['exports']=function(_0x875730,_0x3f642e){return _0x875730[_0x06d0('0x7')](_0x06d0('0x8'),attributes,{'tableName':_0x06d0('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x889e=['request-promise','rimraf','./squareMessage.attributes','exports','square_messages','lodash','../../config/logger','api','bluebird'];(function(_0x2f88ee,_0x52bedf){var _0x1ef9fb=function(_0x2ec74e){while(--_0x2ec74e){_0x2f88ee['push'](_0x2f88ee['shift']());}};_0x1ef9fb(++_0x52bedf);}(_0x889e,0x83));var _0xe889=function(_0x5ba5f6,_0x3daff0){_0x5ba5f6=_0x5ba5f6-0x0;var _0x4f21a8=_0x889e[_0x5ba5f6];return _0x4f21a8;};'use strict';var _=require(_0xe889('0x0'));var util=require('util');var logger=require(_0xe889('0x1'))(_0xe889('0x2'));var moment=require('moment');var BPromise=require(_0xe889('0x3'));var rp=require(_0xe889('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0xe889('0x5'));var config=require('../../config/environment');var attributes=require(_0xe889('0x6'));module[_0xe889('0x7')]=function(_0x37ecf6,_0x5a2f6d){return _0x37ecf6['define']('SquareMessage',attributes,{'tableName':_0xe889('0x8'),'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 b7b12a9..7cdedeb 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 _0xa0eb=['result','catch','CreateSquareMessage','SquareMessage','create','options','raw','lodash','util','bluebird','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','SquareMessage,\x20%s,\x20%s','request\x20sent','debug','SquareMessage,\x20%s,\x20%s,\x20%s','stringify','error','message'];(function(_0x3a2c03,_0x1f945a){var _0x4f6540=function(_0x435e48){while(--_0x435e48){_0x3a2c03['push'](_0x3a2c03['shift']());}};_0x4f6540(++_0x1f945a);}(_0xa0eb,0x1e3));var _0xba0e=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0xa0eb[_0x321bb2];return _0x9c12ed;};'use strict';var _=require(_0xba0e('0x0'));var util=require(_0xba0e('0x1'));var moment=require('moment');var BPromise=require(_0xba0e('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xba0e('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0xba0e('0x4'));var logger=require(_0xba0e('0x5'))(_0xba0e('0x6'));var config=require(_0xba0e('0x7'));var jayson=require(_0xba0e('0x8'));var client=jayson[_0xba0e('0x9')][_0xba0e('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x21fa12,_0x571943,_0x5872be){return new BPromise(function(_0x575ff0,_0x5ccb46){return client[_0xba0e('0xb')](_0x21fa12,_0x5872be)[_0xba0e('0xc')](function(_0x115dc9){logger[_0xba0e('0xd')](_0xba0e('0xe'),_0x571943,_0xba0e('0xf'));logger[_0xba0e('0x10')](_0xba0e('0x11'),_0x571943,'request\x20sent',JSON[_0xba0e('0x12')](_0x115dc9));if(_0x115dc9[_0xba0e('0x13')]){if(_0x115dc9[_0xba0e('0x13')]['code']===0x1f4){logger[_0xba0e('0x13')](_0xba0e('0xe'),_0x571943,_0x115dc9[_0xba0e('0x13')][_0xba0e('0x14')]);return _0x5ccb46(_0x115dc9[_0xba0e('0x13')][_0xba0e('0x14')]);}logger[_0xba0e('0x13')](_0xba0e('0xe'),_0x571943,_0x115dc9['error'][_0xba0e('0x14')]);return _0x575ff0(_0x115dc9[_0xba0e('0x13')][_0xba0e('0x14')]);}else{logger['info'](_0xba0e('0xe'),_0x571943,_0xba0e('0xf'));_0x575ff0(_0x115dc9[_0xba0e('0x15')]['message']);}})[_0xba0e('0x16')](function(_0x5af7ad){logger['error'](_0xba0e('0xe'),_0x571943,_0x5af7ad);_0x5ccb46(_0x5af7ad);});});}exports[_0xba0e('0x17')]=function(_0x409171){var _0x55e4d3=this;return new Promise(function(_0x167803,_0x3a735b){return db[_0xba0e('0x18')][_0xba0e('0x19')](_0x409171['body'],{'raw':_0x409171[_0xba0e('0x1a')]?_0x409171[_0xba0e('0x1a')][_0xba0e('0x1b')]===undefined?!![]:![]:!![]})[_0xba0e('0xc')](function(_0x2db2b0){logger[_0xba0e('0xd')]('CreateSquareMessage',_0x409171);logger['debug'](_0xba0e('0x17'),_0x409171,JSON[_0xba0e('0x12')](_0x2db2b0));_0x167803(_0x2db2b0);})['catch'](function(_0x551cc6){logger['error'](_0xba0e('0x17'),_0x551cc6[_0xba0e('0x14')],_0x409171);_0x3a735b(_0x55e4d3[_0xba0e('0x13')](0x1f4,_0x551cc6[_0xba0e('0x14')]));});});}; \ No newline at end of file +var _0x9314=['request\x20sent','SquareMessage,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','CreateSquareMessage','SquareMessage','create','body','options','raw','then','debug','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','info','SquareMessage,\x20%s,\x20%s'];(function(_0x57a430,_0x281e18){var _0x533e30=function(_0x30f094){while(--_0x30f094){_0x57a430['push'](_0x57a430['shift']());}};_0x533e30(++_0x281e18);}(_0x9314,0x69));var _0x4931=function(_0x397e5f,_0x454c8f){_0x397e5f=_0x397e5f-0x0;var _0x5302b8=_0x9314[_0x397e5f];return _0x5302b8;};'use strict';var _=require(_0x4931('0x0'));var util=require('util');var moment=require(_0x4931('0x1'));var BPromise=require(_0x4931('0x2'));var rs=require(_0x4931('0x3'));var fs=require('fs');var Redis=require(_0x4931('0x4'));var db=require(_0x4931('0x5'))['db'];var utils=require(_0x4931('0x6'));var logger=require(_0x4931('0x7'))(_0x4931('0x8'));var config=require(_0x4931('0x9'));var jayson=require(_0x4931('0xa'));var client=jayson[_0x4931('0xb')][_0x4931('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x4fee97,_0x2364ce,_0x3d0859){return new BPromise(function(_0x34956f,_0x54b926){return client['request'](_0x4fee97,_0x3d0859)['then'](function(_0x1d7d2a){logger[_0x4931('0xd')](_0x4931('0xe'),_0x2364ce,_0x4931('0xf'));logger['debug'](_0x4931('0x10'),_0x2364ce,_0x4931('0xf'),JSON[_0x4931('0x11')](_0x1d7d2a));if(_0x1d7d2a[_0x4931('0x12')]){if(_0x1d7d2a[_0x4931('0x12')]['code']===0x1f4){logger['error'](_0x4931('0xe'),_0x2364ce,_0x1d7d2a[_0x4931('0x12')][_0x4931('0x13')]);return _0x54b926(_0x1d7d2a[_0x4931('0x12')][_0x4931('0x13')]);}logger[_0x4931('0x12')](_0x4931('0xe'),_0x2364ce,_0x1d7d2a['error'][_0x4931('0x13')]);return _0x34956f(_0x1d7d2a['error'][_0x4931('0x13')]);}else{logger[_0x4931('0xd')](_0x4931('0xe'),_0x2364ce,_0x4931('0xf'));_0x34956f(_0x1d7d2a[_0x4931('0x14')][_0x4931('0x13')]);}})[_0x4931('0x15')](function(_0x74c22d){logger['error'](_0x4931('0xe'),_0x2364ce,_0x74c22d);_0x54b926(_0x74c22d);});});}exports[_0x4931('0x16')]=function(_0x4898ca){var _0x5d7f28=this;return new Promise(function(_0xe0a849,_0x328aee){return db[_0x4931('0x17')][_0x4931('0x18')](_0x4898ca[_0x4931('0x19')],{'raw':_0x4898ca['options']?_0x4898ca[_0x4931('0x1a')][_0x4931('0x1b')]===undefined?!![]:![]:!![]})[_0x4931('0x1c')](function(_0x75bd67){logger[_0x4931('0xd')](_0x4931('0x16'),_0x4898ca);logger[_0x4931('0x1d')](_0x4931('0x16'),_0x4898ca,JSON[_0x4931('0x11')](_0x75bd67));_0xe0a849(_0x75bd67);})[_0x4931('0x15')](function(_0x5eeefa){logger[_0x4931('0x12')]('CreateSquareMessage',_0x5eeefa[_0x4931('0x13')],_0x4898ca);_0x328aee(_0x5d7f28[_0x4931('0x12')](0x1f4,_0x5eeefa[_0x4931('0x13')]));});});}; \ No newline at end of file diff --git a/server/api/squareOdbc/index.js b/server/api/squareOdbc/index.js index d691b4b..6b7dca2 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 _0x42b1=['./squareOdbc.controller','get','isAuthenticated','index','/:id','/:id/test','15s','post','create','put','update','delete','exports','multer','util','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment'];(function(_0x40a045,_0x516f0e){var _0x1a687c=function(_0x48c9fe){while(--_0x48c9fe){_0x40a045['push'](_0x40a045['shift']());}};_0x1a687c(++_0x516f0e);}(_0x42b1,0xbd));var _0x142b=function(_0x3c1e47,_0x327090){_0x3c1e47=_0x3c1e47-0x0;var _0x30aa3c=_0x42b1[_0x3c1e47];return _0x30aa3c;};'use strict';var multer=require(_0x142b('0x0'));var util=require(_0x142b('0x1'));var path=require('path');var timeout=require(_0x142b('0x2'));var express=require(_0x142b('0x3'));var router=express[_0x142b('0x4')]();var fs_extra=require(_0x142b('0x5'));var auth=require(_0x142b('0x6'));var interaction=require(_0x142b('0x7'));var config=require(_0x142b('0x8'));var controller=require(_0x142b('0x9'));router[_0x142b('0xa')]('/',auth[_0x142b('0xb')](),controller[_0x142b('0xc')]);router['get'](_0x142b('0xd'),auth[_0x142b('0xb')](),controller['show']);router['get'](_0x142b('0xe'),auth[_0x142b('0xb')](),timeout(_0x142b('0xf')),controller['test']);router[_0x142b('0x10')]('/',auth[_0x142b('0xb')](),controller[_0x142b('0x11')]);router[_0x142b('0x12')](_0x142b('0xd'),auth['isAuthenticated'](),controller[_0x142b('0x13')]);router[_0x142b('0x14')](_0x142b('0xd'),auth[_0x142b('0xb')](),controller['destroy']);module[_0x142b('0x15')]=router; \ No newline at end of file +var _0xff80=['delete','destroy','exports','multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./squareOdbc.controller','isAuthenticated','index','get','/:id','show','/:id/test','15s','test','post','put','update'];(function(_0x355fcd,_0x3c6a3e){var _0x56c8ad=function(_0x1d5e99){while(--_0x1d5e99){_0x355fcd['push'](_0x355fcd['shift']());}};_0x56c8ad(++_0x3c6a3e);}(_0xff80,0x123));var _0x0ff8=function(_0x1d5b7f,_0x594f5e){_0x1d5b7f=_0x1d5b7f-0x0;var _0xb78c52=_0xff80[_0x1d5b7f];return _0xb78c52;};'use strict';var multer=require(_0x0ff8('0x0'));var util=require(_0x0ff8('0x1'));var path=require(_0x0ff8('0x2'));var timeout=require(_0x0ff8('0x3'));var express=require(_0x0ff8('0x4'));var router=express[_0x0ff8('0x5')]();var fs_extra=require('fs-extra');var auth=require(_0x0ff8('0x6'));var interaction=require(_0x0ff8('0x7'));var config=require(_0x0ff8('0x8'));var controller=require(_0x0ff8('0x9'));router['get']('/',auth[_0x0ff8('0xa')](),controller[_0x0ff8('0xb')]);router[_0x0ff8('0xc')](_0x0ff8('0xd'),auth['isAuthenticated'](),controller[_0x0ff8('0xe')]);router[_0x0ff8('0xc')](_0x0ff8('0xf'),auth['isAuthenticated'](),timeout(_0x0ff8('0x10')),controller[_0x0ff8('0x11')]);router[_0x0ff8('0x12')]('/',auth['isAuthenticated'](),controller['create']);router[_0x0ff8('0x13')](_0x0ff8('0xd'),auth[_0x0ff8('0xa')](),controller[_0x0ff8('0x14')]);router[_0x0ff8('0x15')](_0x0ff8('0xd'),auth[_0x0ff8('0xa')](),controller[_0x0ff8('0x16')]);module[_0x0ff8('0x17')]=router; \ No newline at end of file diff --git a/server/api/squareOdbc/squareOdbc.attributes.js b/server/api/squareOdbc/squareOdbc.attributes.js index 713e94f..4e18b65 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 _0xed26=['sequelize','STRING','name'];(function(_0x32e4de,_0x7da1c5){var _0x51ba2a=function(_0x2a7322){while(--_0x2a7322){_0x32e4de['push'](_0x32e4de['shift']());}};_0x51ba2a(++_0x7da1c5);}(_0xed26,0x6c));var _0x6ed2=function(_0x14668c,_0x51edb0){_0x14668c=_0x14668c-0x0;var _0x47d86c=_0xed26[_0x14668c];return _0x47d86c;};'use strict';var Sequelize=require(_0x6ed2('0x0'));module['exports']={'name':{'type':Sequelize[_0x6ed2('0x1')],'unique':_0x6ed2('0x2'),'allowNull':![]},'dsn':{'type':Sequelize[_0x6ed2('0x1')]},'description':{'type':Sequelize[_0x6ed2('0x1')]}}; \ No newline at end of file +var _0x962d=['name','STRING','exports'];(function(_0xef0ce4,_0x5c2cba){var _0x4193c3=function(_0x3aebe9){while(--_0x3aebe9){_0xef0ce4['push'](_0xef0ce4['shift']());}};_0x4193c3(++_0x5c2cba);}(_0x962d,0x185));var _0xd962=function(_0x457b64,_0x49a219){_0x457b64=_0x457b64-0x0;var _0x437111=_0x962d[_0x457b64];return _0x437111;};'use strict';var Sequelize=require('sequelize');module[_0xd962('0x0')]={'name':{'type':Sequelize['STRING'],'unique':_0xd962('0x1'),'allowNull':![]},'dsn':{'type':Sequelize[_0xd962('0x2')]},'description':{'type':Sequelize[_0xd962('0x2')]}}; \ No newline at end of file diff --git a/server/api/squareOdbc/squareOdbc.controller.js b/server/api/squareOdbc/squareOdbc.controller.js index bae7df9..28236eb 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 _0x6a4d=['limit','offset','set','Content-Range','save','destroy','get','then','error','stack','name','send','map','SquareOdbc','fieldName','type','model','query','filters','intersection','fields','length','attributes','hasOwnProperty','nolimit','order','sort','where','pick','VIRTUAL','filter','merge','options','count','include','findAll','catch','show','keys','rawAttributes','includeAll','find','create','body','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','user','ODBC','UserProfileSection','userProfileId','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','params','test','dsn','odbc','openSync','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','util','path','ejs','fs-extra','lodash','squel','crypto','desk.js','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','status','end','json','undefined'];(function(_0x514460,_0x2f2e70){var _0x3b67c1=function(_0x48ea04){while(--_0x48ea04){_0x514460['push'](_0x514460['shift']());}};_0x3b67c1(++_0x2f2e70);}(_0x6a4d,0x141));var _0xd6a4=function(_0x31cb5f,_0x2df766){_0x31cb5f=_0x31cb5f-0x0;var _0x586042=_0x6a4d[_0x31cb5f];return _0x586042;};'use strict';var emlformat=require(_0xd6a4('0x0'));var rimraf=require(_0xd6a4('0x1'));var zipdir=require(_0xd6a4('0x2'));var jsonpatch=require(_0xd6a4('0x3'));var rp=require('request-promise');var moment=require(_0xd6a4('0x4'));var BPromise=require(_0xd6a4('0x5'));var Mustache=require('mustache');var util=require(_0xd6a4('0x6'));var path=require(_0xd6a4('0x7'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0xd6a4('0x8'));var fs=require('fs');var fs_extra=require(_0xd6a4('0x9'));var _=require(_0xd6a4('0xa'));var squel=require(_0xd6a4('0xb'));var crypto=require(_0xd6a4('0xc'));var jsforce=require('jsforce');var deskjs=require(_0xd6a4('0xd'));var toCsv=require(_0xd6a4('0xe'));var querystring=require(_0xd6a4('0xf'));var Papa=require(_0xd6a4('0x10'));var Redis=require(_0xd6a4('0x11'));var authService=require(_0xd6a4('0x12'));var qs=require(_0xd6a4('0x13'));var as=require(_0xd6a4('0x14'));var hardwareService=require(_0xd6a4('0x15'));var logger=require('../../config/logger')(_0xd6a4('0x16'));var utils=require(_0xd6a4('0x17'));var config=require(_0xd6a4('0x18'));var licenseUtil=require(_0xd6a4('0x19'));var db=require(_0xd6a4('0x1a'))['db'];function respondWithStatusCode(_0x43076b,_0x2b50df){_0x2b50df=_0x2b50df||0xcc;return function(_0x2eda29){if(_0x2eda29){return _0x43076b['sendStatus'](_0x2b50df);}return _0x43076b[_0xd6a4('0x1b')](_0x2b50df)[_0xd6a4('0x1c')]();};}function respondWithResult(_0x3ae3a4,_0x1e3f7e){_0x1e3f7e=_0x1e3f7e||0xc8;return function(_0x566e81){if(_0x566e81){return _0x3ae3a4[_0xd6a4('0x1b')](_0x1e3f7e)[_0xd6a4('0x1d')](_0x566e81);}};}function respondWithFilteredResult(_0x24eedd,_0x4f98f6){return function(_0x5891d8){if(_0x5891d8){var _0x5883fe=typeof _0x4f98f6['offset']===_0xd6a4('0x1e')&&typeof _0x4f98f6[_0xd6a4('0x1f')]===_0xd6a4('0x1e');var _0x2bd499=_0x5891d8['count'];var _0x5ca04c=_0x5883fe?0x0:_0x4f98f6[_0xd6a4('0x20')];var _0x49c0f9=_0x5883fe?_0x5891d8['count']:_0x4f98f6[_0xd6a4('0x20')]+_0x4f98f6['limit'];var _0x2975af;if(_0x49c0f9>=_0x2bd499){_0x49c0f9=_0x2bd499;_0x2975af=0xc8;}else{_0x2975af=0xce;}_0x24eedd[_0xd6a4('0x1b')](_0x2975af);return _0x24eedd[_0xd6a4('0x21')](_0xd6a4('0x22'),_0x5ca04c+'-'+_0x49c0f9+'/'+_0x2bd499)[_0xd6a4('0x1d')](_0x5891d8);}return null;};}function patchUpdates(_0x5b4862){return function(_0x4ad4b4){try{jsonpatch['apply'](_0x4ad4b4,_0x5b4862,!![]);}catch(_0x4b3eb2){return BPromise['reject'](_0x4b3eb2);}return _0x4ad4b4[_0xd6a4('0x23')]();};}function saveUpdates(_0x3e6855,_0xbf73cf){return function(_0x4425d6){if(_0x4425d6){return _0x4425d6['update'](_0x3e6855)['then'](function(_0x2286c5){return _0x2286c5;});}return null;};}function removeEntity(_0x4aaa7e,_0x545bac){return function(_0x463011){if(_0x463011){return _0x463011[_0xd6a4('0x24')]()['then'](function(){var _0x2e60e1=_0x463011[_0xd6a4('0x25')]({'plain':!![]});var _0x2d4263='ODBC';return db['UserProfileResource'][_0xd6a4('0x24')]({'where':{'type':_0x2d4263,'resourceId':_0x2e60e1['id']}})[_0xd6a4('0x26')](function(){return _0x463011;});})[_0xd6a4('0x26')](function(){_0x4aaa7e['status'](0xcc)[_0xd6a4('0x1c')]();});}};}function handleEntityNotFound(_0x261c9e,_0x14ef98){return function(_0x2f69bf){if(!_0x2f69bf){_0x261c9e['sendStatus'](0x194);}return _0x2f69bf;};}function handleError(_0x256318,_0x25e55e){_0x25e55e=_0x25e55e||0x1f4;return function(_0x10c81b){logger[_0xd6a4('0x27')](_0x10c81b[_0xd6a4('0x28')]);if(_0x10c81b['name']){delete _0x10c81b[_0xd6a4('0x29')];}_0x256318[_0xd6a4('0x1b')](_0x25e55e)[_0xd6a4('0x2a')](_0x10c81b);};}exports['index']=function(_0x53a8b2,_0x558991){var _0x45a4fb={},_0x13fcec={},_0x2593c1={'count':0x0,'rows':[]};var _0x104121=_[_0xd6a4('0x2b')](db[_0xd6a4('0x2c')]['rawAttributes'],function(_0x188dc6){return{'name':_0x188dc6[_0xd6a4('0x2d')],'type':_0x188dc6[_0xd6a4('0x2e')]['key']};});_0x13fcec[_0xd6a4('0x2f')]=_[_0xd6a4('0x2b')](_0x104121,_0xd6a4('0x29'));_0x13fcec[_0xd6a4('0x30')]=_['keys'](_0x53a8b2[_0xd6a4('0x30')]);_0x13fcec[_0xd6a4('0x31')]=_[_0xd6a4('0x32')](_0x13fcec['model'],_0x13fcec[_0xd6a4('0x30')]);_0x45a4fb['attributes']=_[_0xd6a4('0x32')](_0x13fcec[_0xd6a4('0x2f')],qs['fields'](_0x53a8b2['query'][_0xd6a4('0x33')]));_0x45a4fb['attributes']=_0x45a4fb['attributes'][_0xd6a4('0x34')]?_0x45a4fb[_0xd6a4('0x35')]:_0x13fcec['model'];if(!_0x53a8b2[_0xd6a4('0x30')][_0xd6a4('0x36')](_0xd6a4('0x37'))){_0x45a4fb['limit']=qs[_0xd6a4('0x1f')](_0x53a8b2[_0xd6a4('0x30')][_0xd6a4('0x1f')]);_0x45a4fb[_0xd6a4('0x20')]=qs['offset'](_0x53a8b2[_0xd6a4('0x30')]['offset']);}_0x45a4fb[_0xd6a4('0x38')]=qs[_0xd6a4('0x39')](_0x53a8b2['query'][_0xd6a4('0x39')]);_0x45a4fb[_0xd6a4('0x3a')]=qs['filters'](_[_0xd6a4('0x3b')](_0x53a8b2[_0xd6a4('0x30')],_0x13fcec[_0xd6a4('0x31')]),_0x104121);if(_0x53a8b2['query']['filter']){_0x45a4fb[_0xd6a4('0x3a')]=_['merge'](_0x45a4fb[_0xd6a4('0x3a')],{'$or':_[_0xd6a4('0x2b')](_0x104121,function(_0x45a455){if(_0x45a455[_0xd6a4('0x2e')]!==_0xd6a4('0x3c')){var _0x8dd63d={};_0x8dd63d[_0x45a455[_0xd6a4('0x29')]]={'$like':'%'+_0x53a8b2[_0xd6a4('0x30')][_0xd6a4('0x3d')]+'%'};return _0x8dd63d;}})});}_0x45a4fb=_[_0xd6a4('0x3e')]({},_0x45a4fb,_0x53a8b2[_0xd6a4('0x3f')]);var _0x11d0a4={'where':_0x45a4fb[_0xd6a4('0x3a')]};return db['SquareOdbc'][_0xd6a4('0x40')](_0x11d0a4)[_0xd6a4('0x26')](function(_0x33a395){_0x2593c1['count']=_0x33a395;if(_0x53a8b2[_0xd6a4('0x30')]['includeAll']){_0x45a4fb[_0xd6a4('0x41')]=[{'all':!![]}];}return db[_0xd6a4('0x2c')][_0xd6a4('0x42')](_0x45a4fb);})[_0xd6a4('0x26')](function(_0x5f1540){_0x2593c1['rows']=_0x5f1540;return _0x2593c1;})['then'](respondWithFilteredResult(_0x558991,_0x45a4fb))[_0xd6a4('0x43')](handleError(_0x558991,null));};exports[_0xd6a4('0x44')]=function(_0x3de053,_0x571887){var _0x4d41ae={'raw':!![],'where':{'id':_0x3de053['params']['id']}},_0x59216c={};_0x59216c[_0xd6a4('0x2f')]=_[_0xd6a4('0x45')](db[_0xd6a4('0x2c')][_0xd6a4('0x46')]);_0x59216c[_0xd6a4('0x30')]=_['keys'](_0x3de053['query']);_0x59216c[_0xd6a4('0x31')]=_[_0xd6a4('0x32')](_0x59216c[_0xd6a4('0x2f')],_0x59216c[_0xd6a4('0x30')]);_0x4d41ae[_0xd6a4('0x35')]=_['intersection'](_0x59216c[_0xd6a4('0x2f')],qs[_0xd6a4('0x33')](_0x3de053[_0xd6a4('0x30')]['fields']));_0x4d41ae[_0xd6a4('0x35')]=_0x4d41ae[_0xd6a4('0x35')][_0xd6a4('0x34')]?_0x4d41ae[_0xd6a4('0x35')]:_0x59216c['model'];if(_0x3de053[_0xd6a4('0x30')][_0xd6a4('0x47')]){_0x4d41ae[_0xd6a4('0x41')]=[{'all':!![]}];}_0x4d41ae=_[_0xd6a4('0x3e')]({},_0x4d41ae,_0x3de053[_0xd6a4('0x3f')]);return db['SquareOdbc'][_0xd6a4('0x48')](_0x4d41ae)[_0xd6a4('0x26')](handleEntityNotFound(_0x571887,null))[_0xd6a4('0x26')](respondWithResult(_0x571887,null))[_0xd6a4('0x43')](handleError(_0x571887,null));};exports[_0xd6a4('0x49')]=function(_0x1cdd46,_0xb483c){return db[_0xd6a4('0x2c')][_0xd6a4('0x49')](_0x1cdd46[_0xd6a4('0x4a')],{})[_0xd6a4('0x26')](function(_0x4075dd){var _0x275bbf=_0x1cdd46['user'][_0xd6a4('0x25')]({'plain':!![]});if(!_0x275bbf)throw new Error(_0xd6a4('0x4b'));if(_0x275bbf[_0xd6a4('0x4c')]===_0xd6a4('0x4d')){var _0x445cde=_0x4075dd[_0xd6a4('0x25')]({'plain':!![]});var _0x323676=_0xd6a4('0x4e');return db[_0xd6a4('0x4f')][_0xd6a4('0x48')]({'where':{'name':_0x323676,'userProfileId':_0x275bbf[_0xd6a4('0x50')]},'raw':!![]})[_0xd6a4('0x26')](function(_0xd69550){if(_0xd69550&&_0xd69550['autoAssociation']===0x0){return db['UserProfileResource'][_0xd6a4('0x49')]({'name':_0x445cde[_0xd6a4('0x29')],'resourceId':_0x445cde['id'],'type':_0xd69550['name'],'sectionId':_0xd69550['id']},{})[_0xd6a4('0x26')](function(){return _0x4075dd;});}else{return _0x4075dd;}})['catch'](function(_0x111ba8){logger[_0xd6a4('0x27')](_0xd6a4('0x51'),_0x111ba8);throw _0x111ba8;});}return _0x4075dd;})[_0xd6a4('0x26')](respondWithResult(_0xb483c,0xc9))['catch'](handleError(_0xb483c,null));};exports[_0xd6a4('0x52')]=function(_0x413a8f,_0xaa367){if(_0x413a8f[_0xd6a4('0x4a')]['id']){delete _0x413a8f['body']['id'];}return db[_0xd6a4('0x2c')][_0xd6a4('0x48')]({'where':{'id':_0x413a8f[_0xd6a4('0x53')]['id']}})[_0xd6a4('0x26')](handleEntityNotFound(_0xaa367,null))[_0xd6a4('0x26')](saveUpdates(_0x413a8f[_0xd6a4('0x4a')],null))[_0xd6a4('0x26')](respondWithResult(_0xaa367,null))[_0xd6a4('0x43')](handleError(_0xaa367,null));};exports[_0xd6a4('0x24')]=function(_0x38b7b4,_0x432473){return db[_0xd6a4('0x2c')]['find']({'where':{'id':_0x38b7b4[_0xd6a4('0x53')]['id']}})[_0xd6a4('0x26')](handleEntityNotFound(_0x432473,null))[_0xd6a4('0x26')](removeEntity(_0x432473,null))['catch'](handleError(_0x432473,null));};exports[_0xd6a4('0x54')]=function(_0xddaf38,_0x983990,_0x34cc08){var _0x16c43d;return db[_0xd6a4('0x2c')][_0xd6a4('0x48')]({'where':{'id':_0xddaf38[_0xd6a4('0x53')]['id']},'attributes':['id',_0xd6a4('0x55')]})[_0xd6a4('0x26')](handleEntityNotFound(_0x983990,null))['then'](function(_0x537fc){if(_0x537fc){var _0x2d805c=require(_0xd6a4('0x56'))();_0x2d805c[_0xd6a4('0x57')](_0x537fc[_0xd6a4('0x55')]);_0x2d805c['closeSync']();return _0x537fc;}})[_0xd6a4('0x26')](respondWithResult(_0x983990,null))['catch'](handleError(_0x983990,null));}; \ No newline at end of file +var _0x0d50=['rows','catch','show','params','rawAttributes','find','create','body','user','role','UserProfileSection','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','test','odbc','openSync','dsn','closeSync','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','util','path','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','save','update','then','destroy','get','ODBC','UserProfileResource','sendStatus','error','stack','name','send','index','map','SquareOdbc','fieldName','type','key','query','keys','filters','intersection','model','attributes','fields','length','order','sort','pick','filter','where','merge','VIRTUAL','options','include','findAll'];(function(_0xa130ba,_0x192636){var _0x5edb08=function(_0x19b045){while(--_0x19b045){_0xa130ba['push'](_0xa130ba['shift']());}};_0x5edb08(++_0x192636);}(_0x0d50,0x6b));var _0x00d5=function(_0x2675da,_0x5a250e){_0x2675da=_0x2675da-0x0;var _0x5e6153=_0x0d50[_0x2675da];return _0x5e6153;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x00d5('0x0'));var zipdir=require(_0x00d5('0x1'));var jsonpatch=require(_0x00d5('0x2'));var rp=require(_0x00d5('0x3'));var moment=require('moment');var BPromise=require(_0x00d5('0x4'));var Mustache=require('mustache');var util=require(_0x00d5('0x5'));var path=require(_0x00d5('0x6'));var sox=require('sox');var csv=require(_0x00d5('0x7'));var ejs=require(_0x00d5('0x8'));var fs=require('fs');var fs_extra=require(_0x00d5('0x9'));var _=require(_0x00d5('0xa'));var squel=require(_0x00d5('0xb'));var crypto=require(_0x00d5('0xc'));var jsforce=require(_0x00d5('0xd'));var deskjs=require(_0x00d5('0xe'));var toCsv=require(_0x00d5('0x7'));var querystring=require(_0x00d5('0xf'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0x00d5('0x10'));var qs=require(_0x00d5('0x11'));var as=require(_0x00d5('0x12'));var hardwareService=require(_0x00d5('0x13'));var logger=require(_0x00d5('0x14'))(_0x00d5('0x15'));var utils=require('../../config/utils');var config=require(_0x00d5('0x16'));var licenseUtil=require(_0x00d5('0x17'));var db=require(_0x00d5('0x18'))['db'];function respondWithStatusCode(_0x27d7fd,_0x22115f){_0x22115f=_0x22115f||0xcc;return function(_0x5e6c4b){if(_0x5e6c4b){return _0x27d7fd['sendStatus'](_0x22115f);}return _0x27d7fd[_0x00d5('0x19')](_0x22115f)[_0x00d5('0x1a')]();};}function respondWithResult(_0x3ec439,_0xb4682e){_0xb4682e=_0xb4682e||0xc8;return function(_0x363af1){if(_0x363af1){return _0x3ec439[_0x00d5('0x19')](_0xb4682e)[_0x00d5('0x1b')](_0x363af1);}};}function respondWithFilteredResult(_0x3797ed,_0x165a35){return function(_0x4b70dc){if(_0x4b70dc){var _0x3659e9=typeof _0x165a35[_0x00d5('0x1c')]===_0x00d5('0x1d')&&typeof _0x165a35[_0x00d5('0x1e')]===_0x00d5('0x1d');var _0x520982=_0x4b70dc[_0x00d5('0x1f')];var _0x23960d=_0x3659e9?0x0:_0x165a35[_0x00d5('0x1c')];var _0x5086be=_0x3659e9?_0x4b70dc[_0x00d5('0x1f')]:_0x165a35[_0x00d5('0x1c')]+_0x165a35[_0x00d5('0x1e')];var _0x1bc56f;if(_0x5086be>=_0x520982){_0x5086be=_0x520982;_0x1bc56f=0xc8;}else{_0x1bc56f=0xce;}_0x3797ed[_0x00d5('0x19')](_0x1bc56f);return _0x3797ed[_0x00d5('0x20')](_0x00d5('0x21'),_0x23960d+'-'+_0x5086be+'/'+_0x520982)[_0x00d5('0x1b')](_0x4b70dc);}return null;};}function patchUpdates(_0x31e8b3){return function(_0x13bd0b){try{jsonpatch[_0x00d5('0x22')](_0x13bd0b,_0x31e8b3,!![]);}catch(_0x1d48cb){return BPromise['reject'](_0x1d48cb);}return _0x13bd0b[_0x00d5('0x23')]();};}function saveUpdates(_0x448d48,_0x416bbe){return function(_0x172a7f){if(_0x172a7f){return _0x172a7f[_0x00d5('0x24')](_0x448d48)[_0x00d5('0x25')](function(_0x3cabde){return _0x3cabde;});}return null;};}function removeEntity(_0x2272a7,_0x8e6ff9){return function(_0x72a531){if(_0x72a531){return _0x72a531[_0x00d5('0x26')]()['then'](function(){var _0xcaf5a1=_0x72a531[_0x00d5('0x27')]({'plain':!![]});var _0x3ae0b4=_0x00d5('0x28');return db[_0x00d5('0x29')][_0x00d5('0x26')]({'where':{'type':_0x3ae0b4,'resourceId':_0xcaf5a1['id']}})[_0x00d5('0x25')](function(){return _0x72a531;});})[_0x00d5('0x25')](function(){_0x2272a7[_0x00d5('0x19')](0xcc)[_0x00d5('0x1a')]();});}};}function handleEntityNotFound(_0x5d9e7e,_0x5174d1){return function(_0x13214c){if(!_0x13214c){_0x5d9e7e[_0x00d5('0x2a')](0x194);}return _0x13214c;};}function handleError(_0x4494b4,_0x3951ce){_0x3951ce=_0x3951ce||0x1f4;return function(_0x37dab1){logger[_0x00d5('0x2b')](_0x37dab1[_0x00d5('0x2c')]);if(_0x37dab1[_0x00d5('0x2d')]){delete _0x37dab1['name'];}_0x4494b4[_0x00d5('0x19')](_0x3951ce)[_0x00d5('0x2e')](_0x37dab1);};}exports[_0x00d5('0x2f')]=function(_0x2986da,_0x258b83){var _0x2d9d57={},_0x347e37={},_0x3d55a0={'count':0x0,'rows':[]};var _0xa84462=_[_0x00d5('0x30')](db[_0x00d5('0x31')]['rawAttributes'],function(_0x20b624){return{'name':_0x20b624[_0x00d5('0x32')],'type':_0x20b624[_0x00d5('0x33')][_0x00d5('0x34')]};});_0x347e37['model']=_[_0x00d5('0x30')](_0xa84462,_0x00d5('0x2d'));_0x347e37[_0x00d5('0x35')]=_[_0x00d5('0x36')](_0x2986da[_0x00d5('0x35')]);_0x347e37[_0x00d5('0x37')]=_[_0x00d5('0x38')](_0x347e37[_0x00d5('0x39')],_0x347e37[_0x00d5('0x35')]);_0x2d9d57[_0x00d5('0x3a')]=_[_0x00d5('0x38')](_0x347e37[_0x00d5('0x39')],qs[_0x00d5('0x3b')](_0x2986da[_0x00d5('0x35')][_0x00d5('0x3b')]));_0x2d9d57[_0x00d5('0x3a')]=_0x2d9d57[_0x00d5('0x3a')][_0x00d5('0x3c')]?_0x2d9d57[_0x00d5('0x3a')]:_0x347e37['model'];if(!_0x2986da['query']['hasOwnProperty']('nolimit')){_0x2d9d57[_0x00d5('0x1e')]=qs['limit'](_0x2986da[_0x00d5('0x35')]['limit']);_0x2d9d57[_0x00d5('0x1c')]=qs[_0x00d5('0x1c')](_0x2986da[_0x00d5('0x35')][_0x00d5('0x1c')]);}_0x2d9d57[_0x00d5('0x3d')]=qs[_0x00d5('0x3e')](_0x2986da[_0x00d5('0x35')]['sort']);_0x2d9d57['where']=qs[_0x00d5('0x37')](_[_0x00d5('0x3f')](_0x2986da['query'],_0x347e37['filters']),_0xa84462);if(_0x2986da['query'][_0x00d5('0x40')]){_0x2d9d57[_0x00d5('0x41')]=_[_0x00d5('0x42')](_0x2d9d57[_0x00d5('0x41')],{'$or':_[_0x00d5('0x30')](_0xa84462,function(_0x3139b8){if(_0x3139b8[_0x00d5('0x33')]!==_0x00d5('0x43')){var _0x3605b8={};_0x3605b8[_0x3139b8[_0x00d5('0x2d')]]={'$like':'%'+_0x2986da[_0x00d5('0x35')]['filter']+'%'};return _0x3605b8;}})});}_0x2d9d57=_[_0x00d5('0x42')]({},_0x2d9d57,_0x2986da[_0x00d5('0x44')]);var _0x6adfa9={'where':_0x2d9d57['where']};return db[_0x00d5('0x31')]['count'](_0x6adfa9)[_0x00d5('0x25')](function(_0x169000){_0x3d55a0[_0x00d5('0x1f')]=_0x169000;if(_0x2986da[_0x00d5('0x35')]['includeAll']){_0x2d9d57[_0x00d5('0x45')]=[{'all':!![]}];}return db[_0x00d5('0x31')][_0x00d5('0x46')](_0x2d9d57);})[_0x00d5('0x25')](function(_0x4a312d){_0x3d55a0[_0x00d5('0x47')]=_0x4a312d;return _0x3d55a0;})[_0x00d5('0x25')](respondWithFilteredResult(_0x258b83,_0x2d9d57))[_0x00d5('0x48')](handleError(_0x258b83,null));};exports[_0x00d5('0x49')]=function(_0x2b18b7,_0x4408b7){var _0x4f4a18={'raw':!![],'where':{'id':_0x2b18b7[_0x00d5('0x4a')]['id']}},_0x529230={};_0x529230[_0x00d5('0x39')]=_[_0x00d5('0x36')](db['SquareOdbc'][_0x00d5('0x4b')]);_0x529230['query']=_['keys'](_0x2b18b7[_0x00d5('0x35')]);_0x529230[_0x00d5('0x37')]=_[_0x00d5('0x38')](_0x529230[_0x00d5('0x39')],_0x529230[_0x00d5('0x35')]);_0x4f4a18[_0x00d5('0x3a')]=_['intersection'](_0x529230[_0x00d5('0x39')],qs[_0x00d5('0x3b')](_0x2b18b7[_0x00d5('0x35')][_0x00d5('0x3b')]));_0x4f4a18[_0x00d5('0x3a')]=_0x4f4a18[_0x00d5('0x3a')][_0x00d5('0x3c')]?_0x4f4a18['attributes']:_0x529230['model'];if(_0x2b18b7['query']['includeAll']){_0x4f4a18[_0x00d5('0x45')]=[{'all':!![]}];}_0x4f4a18=_['merge']({},_0x4f4a18,_0x2b18b7[_0x00d5('0x44')]);return db[_0x00d5('0x31')][_0x00d5('0x4c')](_0x4f4a18)['then'](handleEntityNotFound(_0x4408b7,null))[_0x00d5('0x25')](respondWithResult(_0x4408b7,null))[_0x00d5('0x48')](handleError(_0x4408b7,null));};exports[_0x00d5('0x4d')]=function(_0x54b456,_0x29447b){return db[_0x00d5('0x31')][_0x00d5('0x4d')](_0x54b456[_0x00d5('0x4e')],{})[_0x00d5('0x25')](function(_0xe76723){var _0x4325c1=_0x54b456[_0x00d5('0x4f')]['get']({'plain':!![]});if(!_0x4325c1)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x4325c1[_0x00d5('0x50')]===_0x00d5('0x4f')){var _0x28cb05=_0xe76723['get']({'plain':!![]});var _0x557dc5=_0x00d5('0x28');return db[_0x00d5('0x51')]['find']({'where':{'name':_0x557dc5,'userProfileId':_0x4325c1['userProfileId']},'raw':!![]})[_0x00d5('0x25')](function(_0x1a3e15){if(_0x1a3e15&&_0x1a3e15[_0x00d5('0x52')]===0x0){return db['UserProfileResource'][_0x00d5('0x4d')]({'name':_0x28cb05[_0x00d5('0x2d')],'resourceId':_0x28cb05['id'],'type':_0x1a3e15[_0x00d5('0x2d')],'sectionId':_0x1a3e15['id']},{})[_0x00d5('0x25')](function(){return _0xe76723;});}else{return _0xe76723;}})['catch'](function(_0x5f1f4d){logger[_0x00d5('0x2b')](_0x00d5('0x53'),_0x5f1f4d);throw _0x5f1f4d;});}return _0xe76723;})['then'](respondWithResult(_0x29447b,0xc9))[_0x00d5('0x48')](handleError(_0x29447b,null));};exports[_0x00d5('0x24')]=function(_0x4ecf41,_0x439482){if(_0x4ecf41[_0x00d5('0x4e')]['id']){delete _0x4ecf41[_0x00d5('0x4e')]['id'];}return db[_0x00d5('0x31')][_0x00d5('0x4c')]({'where':{'id':_0x4ecf41[_0x00d5('0x4a')]['id']}})[_0x00d5('0x25')](handleEntityNotFound(_0x439482,null))[_0x00d5('0x25')](saveUpdates(_0x4ecf41[_0x00d5('0x4e')],null))[_0x00d5('0x25')](respondWithResult(_0x439482,null))['catch'](handleError(_0x439482,null));};exports[_0x00d5('0x26')]=function(_0x47437d,_0xb233f7){return db[_0x00d5('0x31')][_0x00d5('0x4c')]({'where':{'id':_0x47437d[_0x00d5('0x4a')]['id']}})[_0x00d5('0x25')](handleEntityNotFound(_0xb233f7,null))['then'](removeEntity(_0xb233f7,null))[_0x00d5('0x48')](handleError(_0xb233f7,null));};exports[_0x00d5('0x54')]=function(_0x3e6fb9,_0x3a0352,_0x5e6f33){var _0x11df09;return db[_0x00d5('0x31')][_0x00d5('0x4c')]({'where':{'id':_0x3e6fb9[_0x00d5('0x4a')]['id']},'attributes':['id','dsn']})[_0x00d5('0x25')](handleEntityNotFound(_0x3a0352,null))[_0x00d5('0x25')](function(_0x28c407){if(_0x28c407){var _0x16a8a2=require(_0x00d5('0x55'))();_0x16a8a2[_0x00d5('0x56')](_0x28c407[_0x00d5('0x57')]);_0x16a8a2[_0x00d5('0x58')]();return _0x28c407;}})['then'](respondWithResult(_0x3a0352,null))['catch'](handleError(_0x3a0352,null));}; \ No newline at end of file diff --git a/server/api/squareOdbc/squareOdbc.model.js b/server/api/squareOdbc/squareOdbc.model.js index 8baef20..2ed9b26 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 _0x063e=['util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./squareOdbc.attributes','exports','define','SquareOdbc','square_odbc','lodash'];(function(_0xe29419,_0x5ef504){var _0xe9260a=function(_0x2dea26){while(--_0x2dea26){_0xe29419['push'](_0xe29419['shift']());}};_0xe9260a(++_0x5ef504);}(_0x063e,0x194));var _0xe063=function(_0x16b9ed,_0x56517a){_0x16b9ed=_0x16b9ed-0x0;var _0x66b1f8=_0x063e[_0x16b9ed];return _0x66b1f8;};'use strict';var _=require(_0xe063('0x0'));var util=require(_0xe063('0x1'));var logger=require(_0xe063('0x2'))(_0xe063('0x3'));var moment=require(_0xe063('0x4'));var BPromise=require(_0xe063('0x5'));var rp=require(_0xe063('0x6'));var fs=require('fs');var path=require(_0xe063('0x7'));var rimraf=require(_0xe063('0x8'));var config=require(_0xe063('0x9'));var attributes=require(_0xe063('0xa'));module[_0xe063('0xb')]=function(_0x3deaa2,_0x3239fa){return _0x3deaa2[_0xe063('0xc')](_0xe063('0xd'),attributes,{'tableName':_0xe063('0xe'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xf5fc=['exports','define','SquareOdbc','lodash','util','../../config/logger','api','moment','request-promise','path','rimraf','../../config/environment','./squareOdbc.attributes'];(function(_0x14e680,_0x3b9036){var _0x3b79a6=function(_0x285cad){while(--_0x285cad){_0x14e680['push'](_0x14e680['shift']());}};_0x3b79a6(++_0x3b9036);}(_0xf5fc,0x6b));var _0xcf5f=function(_0x109dc3,_0xf6b661){_0x109dc3=_0x109dc3-0x0;var _0x41a1c=_0xf5fc[_0x109dc3];return _0x41a1c;};'use strict';var _=require(_0xcf5f('0x0'));var util=require(_0xcf5f('0x1'));var logger=require(_0xcf5f('0x2'))(_0xcf5f('0x3'));var moment=require(_0xcf5f('0x4'));var BPromise=require('bluebird');var rp=require(_0xcf5f('0x5'));var fs=require('fs');var path=require(_0xcf5f('0x6'));var rimraf=require(_0xcf5f('0x7'));var config=require(_0xcf5f('0x8'));var attributes=require(_0xcf5f('0x9'));module[_0xcf5f('0xa')]=function(_0x18e0a4,_0x3a7bdc){return _0x18e0a4[_0xcf5f('0xb')](_0xcf5f('0xc'),attributes,{'tableName':'square_odbc','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/squareOdbc/squareOdbc.rpc.js b/server/api/squareOdbc/squareOdbc.rpc.js index 9ab3a34..122be96 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 _0x877b=['error','message','result','catch','ShowSquareOdbc','find','options','raw','where','attributes','include','model','map','stringify','lodash','util','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','jayson/promise','http','then','info','SquareOdbc,\x20%s,\x20%s','request\x20sent','debug','SquareOdbc,\x20%s,\x20%s,\x20%s'];(function(_0x502c7d,_0x2f1285){var _0x30b7ed=function(_0x2d92f3){while(--_0x2d92f3){_0x502c7d['push'](_0x502c7d['shift']());}};_0x30b7ed(++_0x2f1285);}(_0x877b,0xa9));var _0xb877=function(_0x3c74b3,_0x53645f){_0x3c74b3=_0x3c74b3-0x0;var _0x2250a2=_0x877b[_0x3c74b3];return _0x2250a2;};'use strict';var _=require(_0xb877('0x0'));var util=require(_0xb877('0x1'));var moment=require(_0xb877('0x2'));var BPromise=require(_0xb877('0x3'));var rs=require(_0xb877('0x4'));var fs=require('fs');var Redis=require(_0xb877('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0xb877('0x6'));var logger=require(_0xb877('0x7'))(_0xb877('0x8'));var config=require('../../config/environment');var jayson=require(_0xb877('0x9'));var client=jayson['client'][_0xb877('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x3aff44,_0x26ee63,_0x559932){return new BPromise(function(_0x12cdb1,_0x40ecd8){return client['request'](_0x3aff44,_0x559932)[_0xb877('0xb')](function(_0x5ef230){logger[_0xb877('0xc')](_0xb877('0xd'),_0x26ee63,_0xb877('0xe'));logger[_0xb877('0xf')](_0xb877('0x10'),_0x26ee63,'request\x20sent',JSON['stringify'](_0x5ef230));if(_0x5ef230['error']){if(_0x5ef230[_0xb877('0x11')]['code']===0x1f4){logger[_0xb877('0x11')]('SquareOdbc,\x20%s,\x20%s',_0x26ee63,_0x5ef230[_0xb877('0x11')][_0xb877('0x12')]);return _0x40ecd8(_0x5ef230[_0xb877('0x11')][_0xb877('0x12')]);}logger[_0xb877('0x11')](_0xb877('0xd'),_0x26ee63,_0x5ef230['error'][_0xb877('0x12')]);return _0x12cdb1(_0x5ef230[_0xb877('0x11')]['message']);}else{logger[_0xb877('0xc')](_0xb877('0xd'),_0x26ee63,_0xb877('0xe'));_0x12cdb1(_0x5ef230[_0xb877('0x13')][_0xb877('0x12')]);}})[_0xb877('0x14')](function(_0x147750){logger[_0xb877('0x11')]('SquareOdbc,\x20%s,\x20%s',_0x26ee63,_0x147750);_0x40ecd8(_0x147750);});});}exports[_0xb877('0x15')]=function(_0x3cc706){var _0x1dc5ef=this;return new Promise(function(_0x24f3b2,_0x28b4fa){return db['SquareOdbc'][_0xb877('0x16')]({'raw':_0x3cc706[_0xb877('0x17')]?_0x3cc706[_0xb877('0x17')][_0xb877('0x18')]===undefined?!![]:![]:!![],'where':_0x3cc706['options']?_0x3cc706[_0xb877('0x17')][_0xb877('0x19')]||null:null,'attributes':_0x3cc706[_0xb877('0x17')]?_0x3cc706['options'][_0xb877('0x1a')]||null:null,'include':_0x3cc706[_0xb877('0x17')]?_0x3cc706[_0xb877('0x17')][_0xb877('0x1b')]?_['map'](_0x3cc706['options'][_0xb877('0x1b')],function(_0x3ea19a){return{'model':db[_0x3ea19a[_0xb877('0x1c')]],'as':_0x3ea19a['as'],'attributes':_0x3ea19a[_0xb877('0x1a')],'include':_0x3ea19a[_0xb877('0x1b')]?_[_0xb877('0x1d')](_0x3ea19a[_0xb877('0x1b')],function(_0x57fee7){return{'model':db[_0x57fee7[_0xb877('0x1c')]],'as':_0x57fee7['as'],'attributes':_0x57fee7[_0xb877('0x1a')],'include':_0x57fee7[_0xb877('0x1b')]?_['map'](_0x57fee7[_0xb877('0x1b')],function(_0x3102ff){return{'model':db[_0x3102ff['model']],'as':_0x3102ff['as'],'attributes':_0x3102ff[_0xb877('0x1a')]};}):[]};}):[]};}):[]:[]})[_0xb877('0xb')](function(_0xb0c85e){logger[_0xb877('0xc')](_0xb877('0x15'),_0x3cc706);logger[_0xb877('0xf')](_0xb877('0x15'),_0x3cc706,JSON[_0xb877('0x1e')](_0xb0c85e));_0x24f3b2(_0xb0c85e);})[_0xb877('0x14')](function(_0x24c20f){logger[_0xb877('0x11')](_0xb877('0x15'),_0x24c20f[_0xb877('0x12')],_0x3cc706);_0x28b4fa(_0x1dc5ef[_0xb877('0x11')](0x1f4,_0x24c20f['message']));});});}; \ No newline at end of file +var _0x988b=['then','info','SquareOdbc,\x20%s,\x20%s','debug','SquareOdbc,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','ShowSquareOdbc','SquareOdbc','options','where','attributes','include','map','model','bluebird','ioredis','../../config/utils','rpc','../../config/environment','jayson/promise','client','http'];(function(_0x2b6dbe,_0x562268){var _0x47442d=function(_0x382a54){while(--_0x382a54){_0x2b6dbe['push'](_0x2b6dbe['shift']());}};_0x47442d(++_0x562268);}(_0x988b,0x64));var _0xb988=function(_0x4851c7,_0x1cb4a0){_0x4851c7=_0x4851c7-0x0;var _0x56a7d4=_0x988b[_0x4851c7];return _0x56a7d4;};'use strict';var _=require('lodash');var util=require('util');var moment=require('moment');var BPromise=require(_0xb988('0x0'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xb988('0x1'));var db=require('../../mysqldb')['db'];var utils=require(_0xb988('0x2'));var logger=require('../../config/logger')(_0xb988('0x3'));var config=require(_0xb988('0x4'));var jayson=require(_0xb988('0x5'));var client=jayson[_0xb988('0x6')][_0xb988('0x7')]({'port':0x232a});function respondWithRpcPromise(_0xf0802e,_0x32b193,_0x4a2e4a){return new BPromise(function(_0xf734ec,_0x4cec20){return client['request'](_0xf0802e,_0x4a2e4a)[_0xb988('0x8')](function(_0x35d59f){logger[_0xb988('0x9')](_0xb988('0xa'),_0x32b193,'request\x20sent');logger[_0xb988('0xb')](_0xb988('0xc'),_0x32b193,'request\x20sent',JSON[_0xb988('0xd')](_0x35d59f));if(_0x35d59f[_0xb988('0xe')]){if(_0x35d59f[_0xb988('0xe')][_0xb988('0xf')]===0x1f4){logger[_0xb988('0xe')]('SquareOdbc,\x20%s,\x20%s',_0x32b193,_0x35d59f[_0xb988('0xe')]['message']);return _0x4cec20(_0x35d59f['error'][_0xb988('0x10')]);}logger[_0xb988('0xe')]('SquareOdbc,\x20%s,\x20%s',_0x32b193,_0x35d59f[_0xb988('0xe')][_0xb988('0x10')]);return _0xf734ec(_0x35d59f['error']['message']);}else{logger[_0xb988('0x9')](_0xb988('0xa'),_0x32b193,'request\x20sent');_0xf734ec(_0x35d59f[_0xb988('0x11')][_0xb988('0x10')]);}})[_0xb988('0x12')](function(_0x6dc3e6){logger[_0xb988('0xe')]('SquareOdbc,\x20%s,\x20%s',_0x32b193,_0x6dc3e6);_0x4cec20(_0x6dc3e6);});});}exports[_0xb988('0x13')]=function(_0x4d0aa6){var _0x5e80e9=this;return new Promise(function(_0xca0c0b,_0x2fd2f9){return db[_0xb988('0x14')]['find']({'raw':_0x4d0aa6[_0xb988('0x15')]?_0x4d0aa6[_0xb988('0x15')]['raw']===undefined?!![]:![]:!![],'where':_0x4d0aa6[_0xb988('0x15')]?_0x4d0aa6['options'][_0xb988('0x16')]||null:null,'attributes':_0x4d0aa6[_0xb988('0x15')]?_0x4d0aa6[_0xb988('0x15')][_0xb988('0x17')]||null:null,'include':_0x4d0aa6[_0xb988('0x15')]?_0x4d0aa6[_0xb988('0x15')][_0xb988('0x18')]?_[_0xb988('0x19')](_0x4d0aa6[_0xb988('0x15')][_0xb988('0x18')],function(_0x10e428){return{'model':db[_0x10e428[_0xb988('0x1a')]],'as':_0x10e428['as'],'attributes':_0x10e428['attributes'],'include':_0x10e428['include']?_[_0xb988('0x19')](_0x10e428[_0xb988('0x18')],function(_0x5895f7){return{'model':db[_0x5895f7[_0xb988('0x1a')]],'as':_0x5895f7['as'],'attributes':_0x5895f7['attributes'],'include':_0x5895f7[_0xb988('0x18')]?_['map'](_0x5895f7[_0xb988('0x18')],function(_0x5d4961){return{'model':db[_0x5d4961[_0xb988('0x1a')]],'as':_0x5d4961['as'],'attributes':_0x5d4961[_0xb988('0x17')]};}):[]};}):[]};}):[]:[]})[_0xb988('0x8')](function(_0x517f1a){logger['info']('ShowSquareOdbc',_0x4d0aa6);logger['debug']('ShowSquareOdbc',_0x4d0aa6,JSON['stringify'](_0x517f1a));_0xca0c0b(_0x517f1a);})[_0xb988('0x12')](function(_0xaa0470){logger[_0xb988('0xe')](_0xb988('0x13'),_0xaa0470[_0xb988('0x10')],_0x4d0aa6);_0x2fd2f9(_0x5e80e9[_0xb988('0xe')](0x1f4,_0xaa0470[_0xb988('0x10')]));});});}; \ No newline at end of file diff --git a/server/api/squareProject/index.js b/server/api/squareProject/index.js index 3622546..828089b 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 _0x6878=['create','update','delete','destroy','exports','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./squareProject.controller','isAuthenticated','index','get','/:id','show'];(function(_0x5cd846,_0x186e21){var _0x138fa3=function(_0x507acd){while(--_0x507acd){_0x5cd846['push'](_0x5cd846['shift']());}};_0x138fa3(++_0x186e21);}(_0x6878,0x148));var _0x8687=function(_0x4a3484,_0xe07a66){_0x4a3484=_0x4a3484-0x0;var _0x1113b1=_0x6878[_0x4a3484];return _0x1113b1;};'use strict';var multer=require('multer');var util=require('util');var path=require('path');var timeout=require(_0x8687('0x0'));var express=require(_0x8687('0x1'));var router=express['Router']();var fs_extra=require(_0x8687('0x2'));var auth=require(_0x8687('0x3'));var interaction=require(_0x8687('0x4'));var config=require(_0x8687('0x5'));var controller=require(_0x8687('0x6'));router['get']('/',auth[_0x8687('0x7')](),controller[_0x8687('0x8')]);router[_0x8687('0x9')](_0x8687('0xa'),auth['isAuthenticated'](),controller[_0x8687('0xb')]);router['post']('/',auth[_0x8687('0x7')](),controller[_0x8687('0xc')]);router['put'](_0x8687('0xa'),auth[_0x8687('0x7')](),controller[_0x8687('0xd')]);router[_0x8687('0xe')](_0x8687('0xa'),auth[_0x8687('0x7')](),controller[_0x8687('0xf')]);module[_0x8687('0x10')]=router; \ No newline at end of file +var _0x7a73=['multer','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./squareProject.controller','get','isAuthenticated','index','/:id','show','create','put','update','destroy'];(function(_0x251a5b,_0x4362c8){var _0x2c590f=function(_0x55e03a){while(--_0x55e03a){_0x251a5b['push'](_0x251a5b['shift']());}};_0x2c590f(++_0x4362c8);}(_0x7a73,0x18c));var _0x37a7=function(_0x124fa6,_0x5d0ead){_0x124fa6=_0x124fa6-0x0;var _0x227bcc=_0x7a73[_0x124fa6];return _0x227bcc;};'use strict';var multer=require(_0x37a7('0x0'));var util=require('util');var path=require(_0x37a7('0x1'));var timeout=require(_0x37a7('0x2'));var express=require(_0x37a7('0x3'));var router=express[_0x37a7('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0x37a7('0x5'));var interaction=require(_0x37a7('0x6'));var config=require(_0x37a7('0x7'));var controller=require(_0x37a7('0x8'));router[_0x37a7('0x9')]('/',auth[_0x37a7('0xa')](),controller[_0x37a7('0xb')]);router[_0x37a7('0x9')](_0x37a7('0xc'),auth[_0x37a7('0xa')](),controller[_0x37a7('0xd')]);router['post']('/',auth[_0x37a7('0xa')](),controller[_0x37a7('0xe')]);router[_0x37a7('0xf')]('/:id',auth[_0x37a7('0xa')](),controller[_0x37a7('0x10')]);router['delete'](_0x37a7('0xc'),auth[_0x37a7('0xa')](),controller[_0x37a7('0x11')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/squareProject/squareProject.attributes.js b/server/api/squareProject/squareProject.attributes.js index 8a0fb94..f9fd3d0 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 _0xebc4=['STRING','name','BLOB','long','getDataValue','toString','production','utf8','DATE','exports'];(function(_0x560ae1,_0x25e921){var _0x2636fa=function(_0x5df0e0){while(--_0x5df0e0){_0x560ae1['push'](_0x560ae1['shift']());}};_0x2636fa(++_0x25e921);}(_0xebc4,0xf9));var _0x4ebc=function(_0x28149d,_0x3f3ba6){_0x28149d=_0x28149d-0x0;var _0x38236d=_0xebc4[_0x28149d];return _0x38236d;};'use strict';var Sequelize=require('sequelize');module[_0x4ebc('0x0')]={'name':{'type':Sequelize[_0x4ebc('0x1')],'unique':_0x4ebc('0x2'),'allowNull':![]},'description':{'type':Sequelize[_0x4ebc('0x1')]},'notes':{'type':Sequelize['TEXT']},'preproduction':{'type':Sequelize[_0x4ebc('0x3')](_0x4ebc('0x4')),'get':function(){if(this['getDataValue']('preproduction')){return this[_0x4ebc('0x5')]('preproduction')[_0x4ebc('0x6')]('utf8');}}},'production':{'type':Sequelize[_0x4ebc('0x3')]('long'),'get':function(){if(this['getDataValue']('production')){return this[_0x4ebc('0x5')](_0x4ebc('0x7'))[_0x4ebc('0x6')](_0x4ebc('0x8'));}}},'savedAt':{'type':Sequelize[_0x4ebc('0x9')]},'publishedAt':{'type':Sequelize[_0x4ebc('0x9')]}}; \ No newline at end of file +var _0xd386=['utf8','BLOB','production','DATE','sequelize','exports','STRING','TEXT','long','getDataValue','preproduction','toString'];(function(_0x319e85,_0x3f84fd){var _0x126457=function(_0x3a5c1c){while(--_0x3a5c1c){_0x319e85['push'](_0x319e85['shift']());}};_0x126457(++_0x3f84fd);}(_0xd386,0x10c));var _0x6d38=function(_0x452bed,_0x128e55){_0x452bed=_0x452bed-0x0;var _0x4bb2cf=_0xd386[_0x452bed];return _0x4bb2cf;};'use strict';var Sequelize=require(_0x6d38('0x0'));module[_0x6d38('0x1')]={'name':{'type':Sequelize[_0x6d38('0x2')],'unique':'name','allowNull':![]},'description':{'type':Sequelize[_0x6d38('0x2')]},'notes':{'type':Sequelize[_0x6d38('0x3')]},'preproduction':{'type':Sequelize['BLOB'](_0x6d38('0x4')),'get':function(){if(this[_0x6d38('0x5')](_0x6d38('0x6'))){return this[_0x6d38('0x5')]('preproduction')[_0x6d38('0x7')](_0x6d38('0x8'));}}},'production':{'type':Sequelize[_0x6d38('0x9')](_0x6d38('0x4')),'get':function(){if(this[_0x6d38('0x5')](_0x6d38('0xa'))){return this['getDataValue'](_0x6d38('0xa'))['toString'](_0x6d38('0x8'));}}},'savedAt':{'type':Sequelize['DATE']},'publishedAt':{'type':Sequelize[_0x6d38('0xb')]}}; \ No newline at end of file diff --git a/server/api/squareProject/squareProject.controller.js b/server/api/squareProject/squareProject.controller.js index b7a5044..114363a 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 _0x8f2d=['then','destroy','get','SquareProjects','UserProfileResource','agi','stringify','status','sendStatus','error','stack','name','send','index','map','SquareProject','rawAttributes','type','key','query','keys','filters','intersection','model','attributes','fields','length','hasOwnProperty','sort','where','pick','merge','VIRTUAL','filter','options','includeAll','include','findAll','rows','params','find','catch','create','body','role','user','UserProfileSection','userProfileId','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','production','ioredis','../../components/parsers/qs','../../config/logger','api','../../config/environment','../../mysqldb','defaults','redis','localhost','socket.io-emitter','./squareProject.socket','register','offset','undefined','count','limit','set','Content-Range','json','update'];(function(_0x5ac791,_0x504d37){var _0x9e3a19=function(_0x2d4821){while(--_0x2d4821){_0x5ac791['push'](_0x5ac791['shift']());}};_0x9e3a19(++_0x504d37);}(_0x8f2d,0x14a));var _0xd8f2=function(_0x4103f2,_0x5ecf1f){_0x4103f2=_0x4103f2-0x0;var _0x387ba8=_0x8f2d[_0x4103f2];return _0x387ba8;};'use strict';var _=require('lodash');var Redis=require(_0xd8f2('0x0'));var qs=require(_0xd8f2('0x1'));var logger=require(_0xd8f2('0x2'))(_0xd8f2('0x3'));var config=require(_0xd8f2('0x4'));var db=require(_0xd8f2('0x5'))['db'];config['redis']=_[_0xd8f2('0x6')](config[_0xd8f2('0x7')],{'host':_0xd8f2('0x8'),'port':0x18eb});var socket=require(_0xd8f2('0x9'))(new Redis(config[_0xd8f2('0x7')]));require(_0xd8f2('0xa'))[_0xd8f2('0xb')](socket);function respondWithResult(_0xa62ecd,_0x45e445){_0x45e445=_0x45e445||0xc8;return function(_0x44a834){if(_0x44a834){return _0xa62ecd['status'](_0x45e445)['json'](_0x44a834);}};}function respondWithFilteredResult(_0x50eadd,_0x4b7165){return function(_0xc8bc43){if(_0xc8bc43){var _0x461f78=typeof _0x4b7165[_0xd8f2('0xc')]==='undefined'&&typeof _0x4b7165['limit']===_0xd8f2('0xd');var _0x45c3d5=_0xc8bc43[_0xd8f2('0xe')];var _0x5ac60d=_0x461f78?0x0:_0x4b7165['offset'];var _0xcefc3b=_0x461f78?_0xc8bc43[_0xd8f2('0xe')]:_0x4b7165[_0xd8f2('0xc')]+_0x4b7165[_0xd8f2('0xf')];var _0x4a1123;if(_0xcefc3b>=_0x45c3d5){_0xcefc3b=_0x45c3d5;_0x4a1123=0xc8;}else{_0x4a1123=0xce;}_0x50eadd['status'](_0x4a1123);return _0x50eadd[_0xd8f2('0x10')](_0xd8f2('0x11'),_0x5ac60d+'-'+_0xcefc3b+'/'+_0x45c3d5)[_0xd8f2('0x12')](_0xc8bc43);}return null;};}function saveUpdates(_0x37563b){return function(_0xc339a2){if(_0xc339a2){return _0xc339a2[_0xd8f2('0x13')](_0x37563b)[_0xd8f2('0x14')](function(_0x10ad49){return _0x10ad49;});}return null;};}function removeEntity(_0x16e146){return function(_0x54ef8e){if(_0x54ef8e){return _0x54ef8e[_0xd8f2('0x15')]()[_0xd8f2('0x14')](function(){var _0x417125=_0x54ef8e[_0xd8f2('0x16')]({'plain':!![]});var _0x55d7a4=_0xd8f2('0x17');return db[_0xd8f2('0x18')][_0xd8f2('0x15')]({'where':{'type':_0x55d7a4,'resourceId':_0x417125['id']}})['then'](function(){return _0x54ef8e;});})[_0xd8f2('0x14')](function(){var _0x4c4fea=new Redis(config[_0xd8f2('0x7')]);_0x4c4fea['publish'](_0xd8f2('0x19'),JSON[_0xd8f2('0x1a')]({'id':_0x54ef8e['id'],'deleted':!![]}));})[_0xd8f2('0x14')](function(){_0x16e146[_0xd8f2('0x1b')](0xcc)['end']();});}};}function handleEntityNotFound(_0xddf0f7){return function(_0x50ab1d){if(!_0x50ab1d){_0xddf0f7[_0xd8f2('0x1c')](0x194);}return _0x50ab1d;};}function handleError(_0x26c252,_0x2967dc){_0x2967dc=_0x2967dc||0x1f4;return function(_0x2b4fdc){logger[_0xd8f2('0x1d')](_0x2b4fdc[_0xd8f2('0x1e')]);if(_0x2b4fdc[_0xd8f2('0x1f')]){delete _0x2b4fdc[_0xd8f2('0x1f')];}_0x26c252[_0xd8f2('0x1b')](_0x2967dc)[_0xd8f2('0x20')](_0x2b4fdc);};}exports[_0xd8f2('0x21')]=function(_0x7bc165,_0x283a87){var _0x1e3cbc={},_0x57fb0={},_0x1264a2={'count':0x0,'rows':[]};var _0x4776fe=_[_0xd8f2('0x22')](db[_0xd8f2('0x23')][_0xd8f2('0x24')],function(_0x22c84f){return{'name':_0x22c84f['fieldName'],'type':_0x22c84f[_0xd8f2('0x25')][_0xd8f2('0x26')]};});_0x57fb0['model']=_[_0xd8f2('0x22')](_0x4776fe,_0xd8f2('0x1f'));_0x57fb0[_0xd8f2('0x27')]=_[_0xd8f2('0x28')](_0x7bc165[_0xd8f2('0x27')]);_0x57fb0[_0xd8f2('0x29')]=_[_0xd8f2('0x2a')](_0x57fb0[_0xd8f2('0x2b')],_0x57fb0[_0xd8f2('0x27')]);_0x1e3cbc[_0xd8f2('0x2c')]=_[_0xd8f2('0x2a')](_0x57fb0[_0xd8f2('0x2b')],qs['fields'](_0x7bc165[_0xd8f2('0x27')][_0xd8f2('0x2d')]));_0x1e3cbc[_0xd8f2('0x2c')]=_0x1e3cbc[_0xd8f2('0x2c')][_0xd8f2('0x2e')]?_0x1e3cbc[_0xd8f2('0x2c')]:_0x57fb0[_0xd8f2('0x2b')];if(!_0x7bc165[_0xd8f2('0x27')][_0xd8f2('0x2f')]('nolimit')){_0x1e3cbc[_0xd8f2('0xf')]=qs[_0xd8f2('0xf')](_0x7bc165['query'][_0xd8f2('0xf')]);_0x1e3cbc[_0xd8f2('0xc')]=qs[_0xd8f2('0xc')](_0x7bc165[_0xd8f2('0x27')][_0xd8f2('0xc')]);}_0x1e3cbc['order']=qs['sort'](_0x7bc165[_0xd8f2('0x27')][_0xd8f2('0x30')]);_0x1e3cbc[_0xd8f2('0x31')]=qs[_0xd8f2('0x29')](_[_0xd8f2('0x32')](_0x7bc165[_0xd8f2('0x27')],_0x57fb0['filters']),_0x4776fe);if(_0x7bc165[_0xd8f2('0x27')]['filter']){_0x1e3cbc[_0xd8f2('0x31')]=_[_0xd8f2('0x33')](_0x1e3cbc[_0xd8f2('0x31')],{'$or':_[_0xd8f2('0x22')](_0x4776fe,function(_0x2758cd){if(_0x2758cd[_0xd8f2('0x25')]!==_0xd8f2('0x34')){var _0x349c54={};_0x349c54[_0x2758cd[_0xd8f2('0x1f')]]={'$like':'%'+_0x7bc165[_0xd8f2('0x27')][_0xd8f2('0x35')]+'%'};return _0x349c54;}})});}_0x1e3cbc=_['merge']({},_0x1e3cbc,_0x7bc165[_0xd8f2('0x36')]);var _0x1c904e={'where':_0x1e3cbc[_0xd8f2('0x31')]};return db[_0xd8f2('0x23')][_0xd8f2('0xe')](_0x1c904e)[_0xd8f2('0x14')](function(_0x51ee39){_0x1264a2[_0xd8f2('0xe')]=_0x51ee39;if(_0x7bc165[_0xd8f2('0x27')][_0xd8f2('0x37')]){_0x1e3cbc[_0xd8f2('0x38')]=[{'all':!![]}];}return db['SquareProject'][_0xd8f2('0x39')](_0x1e3cbc);})['then'](function(_0x415690){_0x1264a2[_0xd8f2('0x3a')]=_0x415690;return _0x1264a2;})['then'](respondWithFilteredResult(_0x283a87,_0x1e3cbc))['catch'](handleError(_0x283a87,null));};exports['show']=function(_0xd5470a,_0x222cdd){var _0x1f1c9d={'raw':![],'where':{'id':_0xd5470a[_0xd8f2('0x3b')]['id']}},_0x3b4810={};_0x3b4810[_0xd8f2('0x2b')]=_[_0xd8f2('0x28')](db['SquareProject'][_0xd8f2('0x24')]);_0x3b4810['query']=_['keys'](_0xd5470a[_0xd8f2('0x27')]);_0x3b4810['filters']=_[_0xd8f2('0x2a')](_0x3b4810[_0xd8f2('0x2b')],_0x3b4810[_0xd8f2('0x27')]);_0x1f1c9d[_0xd8f2('0x2c')]=_['intersection'](_0x3b4810[_0xd8f2('0x2b')],qs[_0xd8f2('0x2d')](_0xd5470a['query'][_0xd8f2('0x2d')]));_0x1f1c9d[_0xd8f2('0x2c')]=_0x1f1c9d['attributes'][_0xd8f2('0x2e')]?_0x1f1c9d['attributes']:_0x3b4810['model'];if(_0xd5470a['query'][_0xd8f2('0x37')]){_0x1f1c9d[_0xd8f2('0x38')]=[{'all':!![]}];}_0x1f1c9d=_['merge']({},_0x1f1c9d,_0xd5470a['options']);return db[_0xd8f2('0x23')][_0xd8f2('0x3c')](_0x1f1c9d)['then'](handleEntityNotFound(_0x222cdd,null))['then'](respondWithResult(_0x222cdd,null))[_0xd8f2('0x3d')](handleError(_0x222cdd,null));};exports[_0xd8f2('0x3e')]=function(_0x2aa001,_0x5e7ffe){return db[_0xd8f2('0x23')][_0xd8f2('0x3e')](_0x2aa001[_0xd8f2('0x3f')],{})[_0xd8f2('0x14')](function(_0x4d501f){var _0x11e0ac=_0x2aa001['user'][_0xd8f2('0x16')]({'plain':!![]});if(!_0x11e0ac)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x11e0ac[_0xd8f2('0x40')]===_0xd8f2('0x41')){var _0x43f19e=_0x4d501f['get']({'plain':!![]});var _0x1cb7d3=_0xd8f2('0x17');return db[_0xd8f2('0x42')][_0xd8f2('0x3c')]({'where':{'name':_0x1cb7d3,'userProfileId':_0x11e0ac[_0xd8f2('0x43')]},'raw':!![]})[_0xd8f2('0x14')](function(_0x1cd209){if(_0x1cd209&&_0x1cd209['autoAssociation']===0x0){return db[_0xd8f2('0x18')]['create']({'name':_0x43f19e[_0xd8f2('0x1f')],'resourceId':_0x43f19e['id'],'type':_0x1cd209[_0xd8f2('0x1f')],'sectionId':_0x1cd209['id']},{})[_0xd8f2('0x14')](function(){return _0x4d501f;});}else{return _0x4d501f;}})[_0xd8f2('0x3d')](function(_0x2ee2dd){logger[_0xd8f2('0x1d')](_0xd8f2('0x44'),_0x2ee2dd);throw _0x2ee2dd;});}return _0x4d501f;})[_0xd8f2('0x14')](respondWithResult(_0x5e7ffe,0xc9))[_0xd8f2('0x3d')](handleError(_0x5e7ffe,null));};exports['update']=function(_0x50ca08,_0x2ebcfb){if(_0x50ca08[_0xd8f2('0x3f')]['id']){delete _0x50ca08[_0xd8f2('0x3f')]['id'];}return db[_0xd8f2('0x23')][_0xd8f2('0x3c')]({'where':{'id':_0x50ca08['params']['id']}})[_0xd8f2('0x14')](handleEntityNotFound(_0x2ebcfb,null))[_0xd8f2('0x14')](saveUpdates(_0x50ca08[_0xd8f2('0x3f')],null))[_0xd8f2('0x14')](function(_0x4cf6b7){if(!_0x4cf6b7)return;var _0x1dc038=_0x4cf6b7[_0xd8f2('0x16')]({'plain':!![]});return _0x1dc038;})[_0xd8f2('0x14')](function(_0x30ecf5){var _0x393730=new Redis(config['redis']);_0x393730['publish'](_0xd8f2('0x19'),JSON[_0xd8f2('0x1a')](_[_0xd8f2('0x32')](_0x30ecf5,['id','name',_0xd8f2('0x45')])));return _0x30ecf5;})[_0xd8f2('0x14')](respondWithResult(_0x2ebcfb,null))[_0xd8f2('0x3d')](handleError(_0x2ebcfb,null));};exports[_0xd8f2('0x15')]=function(_0x1370db,_0x3f2375){return db['SquareProject'][_0xd8f2('0x3c')]({'where':{'id':_0x1370db[_0xd8f2('0x3b')]['id']}})[_0xd8f2('0x14')](handleEntityNotFound(_0x3f2375,null))[_0xd8f2('0x14')](removeEntity(_0x3f2375,null))[_0xd8f2('0x3d')](handleError(_0x3f2375,null));}; \ No newline at end of file +var _0xefa7=['agi','stringify','production','lodash','../../components/parsers/qs','../../config/logger','api','../../config/environment','redis','localhost','socket.io-emitter','./squareProject.socket','json','offset','undefined','limit','count','status','set','Content-Range','update','destroy','then','get','SquareProjects','UserProfileResource','publish','end','error','stack','name','send','index','SquareProject','rawAttributes','fieldName','type','key','map','query','keys','filters','intersection','attributes','model','fields','length','nolimit','order','sort','where','pick','merge','VIRTUAL','filter','includeAll','findAll','rows','catch','params','options','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','autoAssociation'];(function(_0x276c16,_0xdf24a2){var _0x10c4eb=function(_0x58393a){while(--_0x58393a){_0x276c16['push'](_0x276c16['shift']());}};_0x10c4eb(++_0xdf24a2);}(_0xefa7,0xd5));var _0x7efa=function(_0x2431a4,_0x385157){_0x2431a4=_0x2431a4-0x0;var _0x4b62ad=_0xefa7[_0x2431a4];return _0x4b62ad;};'use strict';var _=require(_0x7efa('0x0'));var Redis=require('ioredis');var qs=require(_0x7efa('0x1'));var logger=require(_0x7efa('0x2'))(_0x7efa('0x3'));var config=require(_0x7efa('0x4'));var db=require('../../mysqldb')['db'];config[_0x7efa('0x5')]=_['defaults'](config[_0x7efa('0x5')],{'host':_0x7efa('0x6'),'port':0x18eb});var socket=require(_0x7efa('0x7'))(new Redis(config['redis']));require(_0x7efa('0x8'))['register'](socket);function respondWithResult(_0x6d4097,_0x18b91d){_0x18b91d=_0x18b91d||0xc8;return function(_0xdbd820){if(_0xdbd820){return _0x6d4097['status'](_0x18b91d)[_0x7efa('0x9')](_0xdbd820);}};}function respondWithFilteredResult(_0x2f7014,_0x2dc43a){return function(_0x5a7c50){if(_0x5a7c50){var _0x5f22d5=typeof _0x2dc43a[_0x7efa('0xa')]===_0x7efa('0xb')&&typeof _0x2dc43a[_0x7efa('0xc')]===_0x7efa('0xb');var _0x49827d=_0x5a7c50[_0x7efa('0xd')];var _0x3fba26=_0x5f22d5?0x0:_0x2dc43a[_0x7efa('0xa')];var _0x10ae12=_0x5f22d5?_0x5a7c50[_0x7efa('0xd')]:_0x2dc43a[_0x7efa('0xa')]+_0x2dc43a[_0x7efa('0xc')];var _0x1a6d62;if(_0x10ae12>=_0x49827d){_0x10ae12=_0x49827d;_0x1a6d62=0xc8;}else{_0x1a6d62=0xce;}_0x2f7014[_0x7efa('0xe')](_0x1a6d62);return _0x2f7014[_0x7efa('0xf')](_0x7efa('0x10'),_0x3fba26+'-'+_0x10ae12+'/'+_0x49827d)[_0x7efa('0x9')](_0x5a7c50);}return null;};}function saveUpdates(_0x4c3c04){return function(_0x133dde){if(_0x133dde){return _0x133dde[_0x7efa('0x11')](_0x4c3c04)['then'](function(_0x580665){return _0x580665;});}return null;};}function removeEntity(_0x12da7e){return function(_0x1b7021){if(_0x1b7021){return _0x1b7021[_0x7efa('0x12')]()[_0x7efa('0x13')](function(){var _0x3000ff=_0x1b7021[_0x7efa('0x14')]({'plain':!![]});var _0x48ebcf=_0x7efa('0x15');return db[_0x7efa('0x16')][_0x7efa('0x12')]({'where':{'type':_0x48ebcf,'resourceId':_0x3000ff['id']}})[_0x7efa('0x13')](function(){return _0x1b7021;});})[_0x7efa('0x13')](function(){var _0x4abf60=new Redis(config[_0x7efa('0x5')]);_0x4abf60[_0x7efa('0x17')]('agi',JSON['stringify']({'id':_0x1b7021['id'],'deleted':!![]}));})['then'](function(){_0x12da7e[_0x7efa('0xe')](0xcc)[_0x7efa('0x18')]();});}};}function handleEntityNotFound(_0x156367){return function(_0x5b1fc4){if(!_0x5b1fc4){_0x156367['sendStatus'](0x194);}return _0x5b1fc4;};}function handleError(_0x5f3702,_0x1aa74a){_0x1aa74a=_0x1aa74a||0x1f4;return function(_0x1f4454){logger[_0x7efa('0x19')](_0x1f4454[_0x7efa('0x1a')]);if(_0x1f4454['name']){delete _0x1f4454[_0x7efa('0x1b')];}_0x5f3702[_0x7efa('0xe')](_0x1aa74a)[_0x7efa('0x1c')](_0x1f4454);};}exports[_0x7efa('0x1d')]=function(_0xc6319d,_0x386032){var _0x4a973b={},_0x50b7b3={},_0x228278={'count':0x0,'rows':[]};var _0x5d3861=_['map'](db[_0x7efa('0x1e')][_0x7efa('0x1f')],function(_0x3d64a9){return{'name':_0x3d64a9[_0x7efa('0x20')],'type':_0x3d64a9[_0x7efa('0x21')][_0x7efa('0x22')]};});_0x50b7b3['model']=_[_0x7efa('0x23')](_0x5d3861,_0x7efa('0x1b'));_0x50b7b3[_0x7efa('0x24')]=_[_0x7efa('0x25')](_0xc6319d['query']);_0x50b7b3[_0x7efa('0x26')]=_[_0x7efa('0x27')](_0x50b7b3['model'],_0x50b7b3[_0x7efa('0x24')]);_0x4a973b[_0x7efa('0x28')]=_[_0x7efa('0x27')](_0x50b7b3[_0x7efa('0x29')],qs[_0x7efa('0x2a')](_0xc6319d[_0x7efa('0x24')][_0x7efa('0x2a')]));_0x4a973b[_0x7efa('0x28')]=_0x4a973b['attributes'][_0x7efa('0x2b')]?_0x4a973b['attributes']:_0x50b7b3[_0x7efa('0x29')];if(!_0xc6319d[_0x7efa('0x24')]['hasOwnProperty'](_0x7efa('0x2c'))){_0x4a973b[_0x7efa('0xc')]=qs[_0x7efa('0xc')](_0xc6319d[_0x7efa('0x24')][_0x7efa('0xc')]);_0x4a973b[_0x7efa('0xa')]=qs[_0x7efa('0xa')](_0xc6319d[_0x7efa('0x24')][_0x7efa('0xa')]);}_0x4a973b[_0x7efa('0x2d')]=qs[_0x7efa('0x2e')](_0xc6319d[_0x7efa('0x24')][_0x7efa('0x2e')]);_0x4a973b[_0x7efa('0x2f')]=qs['filters'](_[_0x7efa('0x30')](_0xc6319d[_0x7efa('0x24')],_0x50b7b3['filters']),_0x5d3861);if(_0xc6319d[_0x7efa('0x24')]['filter']){_0x4a973b[_0x7efa('0x2f')]=_[_0x7efa('0x31')](_0x4a973b['where'],{'$or':_['map'](_0x5d3861,function(_0x10f0ea){if(_0x10f0ea[_0x7efa('0x21')]!==_0x7efa('0x32')){var _0x1a7820={};_0x1a7820[_0x10f0ea[_0x7efa('0x1b')]]={'$like':'%'+_0xc6319d[_0x7efa('0x24')][_0x7efa('0x33')]+'%'};return _0x1a7820;}})});}_0x4a973b=_['merge']({},_0x4a973b,_0xc6319d['options']);var _0x1261c4={'where':_0x4a973b[_0x7efa('0x2f')]};return db[_0x7efa('0x1e')]['count'](_0x1261c4)['then'](function(_0x5f2b7e){_0x228278['count']=_0x5f2b7e;if(_0xc6319d[_0x7efa('0x24')][_0x7efa('0x34')]){_0x4a973b['include']=[{'all':!![]}];}return db[_0x7efa('0x1e')][_0x7efa('0x35')](_0x4a973b);})[_0x7efa('0x13')](function(_0x441811){_0x228278[_0x7efa('0x36')]=_0x441811;return _0x228278;})[_0x7efa('0x13')](respondWithFilteredResult(_0x386032,_0x4a973b))[_0x7efa('0x37')](handleError(_0x386032,null));};exports['show']=function(_0x20da58,_0x279b46){var _0x75ad3={'raw':![],'where':{'id':_0x20da58[_0x7efa('0x38')]['id']}},_0x1b5d95={};_0x1b5d95[_0x7efa('0x29')]=_[_0x7efa('0x25')](db['SquareProject'][_0x7efa('0x1f')]);_0x1b5d95[_0x7efa('0x24')]=_[_0x7efa('0x25')](_0x20da58['query']);_0x1b5d95['filters']=_['intersection'](_0x1b5d95['model'],_0x1b5d95['query']);_0x75ad3[_0x7efa('0x28')]=_['intersection'](_0x1b5d95[_0x7efa('0x29')],qs[_0x7efa('0x2a')](_0x20da58['query'][_0x7efa('0x2a')]));_0x75ad3[_0x7efa('0x28')]=_0x75ad3[_0x7efa('0x28')][_0x7efa('0x2b')]?_0x75ad3[_0x7efa('0x28')]:_0x1b5d95['model'];if(_0x20da58['query']['includeAll']){_0x75ad3['include']=[{'all':!![]}];}_0x75ad3=_[_0x7efa('0x31')]({},_0x75ad3,_0x20da58[_0x7efa('0x39')]);return db['SquareProject'][_0x7efa('0x3a')](_0x75ad3)[_0x7efa('0x13')](handleEntityNotFound(_0x279b46,null))[_0x7efa('0x13')](respondWithResult(_0x279b46,null))[_0x7efa('0x37')](handleError(_0x279b46,null));};exports[_0x7efa('0x3b')]=function(_0x489089,_0xf87322){return db[_0x7efa('0x1e')][_0x7efa('0x3b')](_0x489089[_0x7efa('0x3c')],{})[_0x7efa('0x13')](function(_0x42cb05){var _0x2a3ae6=_0x489089[_0x7efa('0x3d')][_0x7efa('0x14')]({'plain':!![]});if(!_0x2a3ae6)throw new Error(_0x7efa('0x3e'));if(_0x2a3ae6[_0x7efa('0x3f')]===_0x7efa('0x3d')){var _0x2be48d=_0x42cb05[_0x7efa('0x14')]({'plain':!![]});var _0x38cf11=_0x7efa('0x15');return db[_0x7efa('0x40')][_0x7efa('0x3a')]({'where':{'name':_0x38cf11,'userProfileId':_0x2a3ae6[_0x7efa('0x41')]},'raw':!![]})[_0x7efa('0x13')](function(_0x4e2de5){if(_0x4e2de5&&_0x4e2de5[_0x7efa('0x42')]===0x0){return db[_0x7efa('0x16')][_0x7efa('0x3b')]({'name':_0x2be48d[_0x7efa('0x1b')],'resourceId':_0x2be48d['id'],'type':_0x4e2de5['name'],'sectionId':_0x4e2de5['id']},{})[_0x7efa('0x13')](function(){return _0x42cb05;});}else{return _0x42cb05;}})[_0x7efa('0x37')](function(_0x3904e2){logger['error']('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x3904e2);throw _0x3904e2;});}return _0x42cb05;})[_0x7efa('0x13')](respondWithResult(_0xf87322,0xc9))['catch'](handleError(_0xf87322,null));};exports[_0x7efa('0x11')]=function(_0x4df6e5,_0x2d8915){if(_0x4df6e5[_0x7efa('0x3c')]['id']){delete _0x4df6e5['body']['id'];}return db[_0x7efa('0x1e')][_0x7efa('0x3a')]({'where':{'id':_0x4df6e5[_0x7efa('0x38')]['id']}})[_0x7efa('0x13')](handleEntityNotFound(_0x2d8915,null))[_0x7efa('0x13')](saveUpdates(_0x4df6e5[_0x7efa('0x3c')],null))[_0x7efa('0x13')](function(_0x32a9e8){if(!_0x32a9e8)return;var _0x41126a=_0x32a9e8[_0x7efa('0x14')]({'plain':!![]});return _0x41126a;})[_0x7efa('0x13')](function(_0x41c488){var _0x1e664c=new Redis(config[_0x7efa('0x5')]);_0x1e664c[_0x7efa('0x17')](_0x7efa('0x43'),JSON[_0x7efa('0x44')](_[_0x7efa('0x30')](_0x41c488,['id',_0x7efa('0x1b'),_0x7efa('0x45')])));return _0x41c488;})['then'](respondWithResult(_0x2d8915,null))[_0x7efa('0x37')](handleError(_0x2d8915,null));};exports[_0x7efa('0x12')]=function(_0x45e487,_0x515fe7){return db[_0x7efa('0x1e')][_0x7efa('0x3a')]({'where':{'id':_0x45e487[_0x7efa('0x38')]['id']}})[_0x7efa('0x13')](handleEntityNotFound(_0x515fe7,null))[_0x7efa('0x13')](removeEntity(_0x515fe7,null))[_0x7efa('0x37')](handleError(_0x515fe7,null));}; \ No newline at end of file diff --git a/server/api/squareProject/squareProject.events.js b/server/api/squareProject/squareProject.events.js index 9f404d1..31dc6ae 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 _0x3c5f=['save','update','remove','emit','hasOwnProperty','hook','exports','events','../../mysqldb','SquareProject','setMaxListeners'];(function(_0x46437e,_0x20c7d8){var _0x1189bd=function(_0xc1e31f){while(--_0xc1e31f){_0x46437e['push'](_0x46437e['shift']());}};_0x1189bd(++_0x20c7d8);}(_0x3c5f,0x75));var _0xf3c5=function(_0x33b31a,_0x2e5b9d){_0x33b31a=_0x33b31a-0x0;var _0x26f5a6=_0x3c5f[_0x33b31a];return _0x26f5a6;};'use strict';var EventEmitter=require(_0xf3c5('0x0'));var SquareProject=require(_0xf3c5('0x1'))['db'][_0xf3c5('0x2')];var SquareProjectEvents=new EventEmitter();SquareProjectEvents[_0xf3c5('0x3')](0x0);var events={'afterCreate':_0xf3c5('0x4'),'afterUpdate':_0xf3c5('0x5'),'afterDestroy':_0xf3c5('0x6')};function emitEvent(_0x296255){return function(_0x1e077f,_0x2f7c49,_0x5494c4){SquareProjectEvents[_0xf3c5('0x7')](_0x296255+':'+_0x1e077f['id'],_0x1e077f);SquareProjectEvents['emit'](_0x296255,_0x1e077f);_0x5494c4(null);};}for(var e in events){if(events[_0xf3c5('0x8')](e)){var event=events[e];SquareProject[_0xf3c5('0x9')](e,emitEvent(event));}}module[_0xf3c5('0xa')]=SquareProjectEvents; \ No newline at end of file +var _0x229f=['emit','hook','events','../../mysqldb','save','update'];(function(_0x52ce82,_0x5d4fed){var _0x6f15db=function(_0x1e99bd){while(--_0x1e99bd){_0x52ce82['push'](_0x52ce82['shift']());}};_0x6f15db(++_0x5d4fed);}(_0x229f,0x12e));var _0xf229=function(_0x1f9596,_0xc4a16b){_0x1f9596=_0x1f9596-0x0;var _0x1f1a84=_0x229f[_0x1f9596];return _0x1f1a84;};'use strict';var EventEmitter=require(_0xf229('0x0'));var SquareProject=require(_0xf229('0x1'))['db']['SquareProject'];var SquareProjectEvents=new EventEmitter();SquareProjectEvents['setMaxListeners'](0x0);var events={'afterCreate':_0xf229('0x2'),'afterUpdate':_0xf229('0x3'),'afterDestroy':'remove'};function emitEvent(_0x40639d){return function(_0x285d58,_0x2e8257,_0x11c141){SquareProjectEvents[_0xf229('0x4')](_0x40639d+':'+_0x285d58['id'],_0x285d58);SquareProjectEvents[_0xf229('0x4')](_0x40639d,_0x285d58);_0x11c141(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];SquareProject[_0xf229('0x5')](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 317c4ff..c6a687f 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 _0xe43a=['define','square_projects','changed','preproduction','savedAt','format','production','publishedAt','YYYY-MM-DD\x20HH:mm:ss','lodash','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./squareProject.attributes'];(function(_0xc8bdaa,_0x53a105){var _0x20fa64=function(_0x2e602c){while(--_0x2e602c){_0xc8bdaa['push'](_0xc8bdaa['shift']());}};_0x20fa64(++_0x53a105);}(_0xe43a,0xed));var _0xae43=function(_0x4e6ceb,_0x17e571){_0x4e6ceb=_0x4e6ceb-0x0;var _0xa2dba7=_0xe43a[_0x4e6ceb];return _0xa2dba7;};'use strict';var _=require(_0xae43('0x0'));var util=require('util');var logger=require(_0xae43('0x1'))(_0xae43('0x2'));var moment=require(_0xae43('0x3'));var BPromise=require(_0xae43('0x4'));var rp=require(_0xae43('0x5'));var fs=require('fs');var path=require(_0xae43('0x6'));var rimraf=require(_0xae43('0x7'));var config=require(_0xae43('0x8'));var attributes=require(_0xae43('0x9'));module['exports']=function(_0x397f89,_0x48f656){return _0x397f89[_0xae43('0xa')]('SquareProject',attributes,{'tableName':_0xae43('0xb'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x5a0b90,_0x346ff7,_0x53480a){if(_0x5a0b90[_0xae43('0xc')](_0xae43('0xd'))){_0x5a0b90[_0xae43('0xe')]=moment()[_0xae43('0xf')]('YYYY-MM-DD\x20HH:mm:ss');}if(_0x5a0b90[_0xae43('0xc')](_0xae43('0x10'))){_0x5a0b90[_0xae43('0x11')]=moment()[_0xae43('0xf')](_0xae43('0x12'));}_0x53480a(null,_0x5a0b90);}}});}; \ No newline at end of file +var _0x5711=['exports','define','SquareProject','preproduction','savedAt','format','YYYY-MM-DD\x20HH:mm:ss','production','publishedAt','lodash','util','../../config/logger','api','moment','bluebird','path','rimraf','../../config/environment','./squareProject.attributes'];(function(_0x4c12ec,_0x2e9103){var _0x3ae42c=function(_0x5a728f){while(--_0x5a728f){_0x4c12ec['push'](_0x4c12ec['shift']());}};_0x3ae42c(++_0x2e9103);}(_0x5711,0xb4));var _0x1571=function(_0x10c16d,_0x2b3e14){_0x10c16d=_0x10c16d-0x0;var _0x5896f4=_0x5711[_0x10c16d];return _0x5896f4;};'use strict';var _=require(_0x1571('0x0'));var util=require(_0x1571('0x1'));var logger=require(_0x1571('0x2'))(_0x1571('0x3'));var moment=require(_0x1571('0x4'));var BPromise=require(_0x1571('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x1571('0x6'));var rimraf=require(_0x1571('0x7'));var config=require(_0x1571('0x8'));var attributes=require(_0x1571('0x9'));module[_0x1571('0xa')]=function(_0x29f11a,_0x460496){return _0x29f11a[_0x1571('0xb')](_0x1571('0xc'),attributes,{'tableName':'square_projects','paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x44dc9b,_0xda8da7,_0x4ec23f){if(_0x44dc9b['changed'](_0x1571('0xd'))){_0x44dc9b[_0x1571('0xe')]=moment()[_0x1571('0xf')](_0x1571('0x10'));}if(_0x44dc9b['changed'](_0x1571('0x11'))){_0x44dc9b[_0x1571('0x12')]=moment()['format']('YYYY-MM-DD\x20HH:mm:ss');}_0x4ec23f(null,_0x44dc9b);}}});}; \ No newline at end of file diff --git a/server/api/squareProject/squareProject.rpc.js b/server/api/squareProject/squareProject.rpc.js index 105cc7e..88b448e 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 _0x4ff3=['info','debug','stringify','lodash','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','redis','defaults','localhost','socket.io-emitter','./squareProject.socket','register','GetSquareProjects','SquareProject','options','raw','where','attributes','limit','include','map','model','then','catch','error','message','ShowSquareProject','find'];(function(_0x26b2b3,_0x2fcba7){var _0x3ee842=function(_0x3c1474){while(--_0x3c1474){_0x26b2b3['push'](_0x26b2b3['shift']());}};_0x3ee842(++_0x2fcba7);}(_0x4ff3,0x196));var _0x34ff=function(_0xbed702,_0x2d0842){_0xbed702=_0xbed702-0x0;var _0x2799d4=_0x4ff3[_0xbed702];return _0x2799d4;};'use strict';var _=require(_0x34ff('0x0'));var Redis=require(_0x34ff('0x1'));var db=require(_0x34ff('0x2'))['db'];var logger=require(_0x34ff('0x3'))(_0x34ff('0x4'));var config=require(_0x34ff('0x5'));config[_0x34ff('0x6')]=_[_0x34ff('0x7')](config[_0x34ff('0x6')],{'host':_0x34ff('0x8'),'port':0x18eb});var socket=require(_0x34ff('0x9'))(new Redis(config[_0x34ff('0x6')]));require(_0x34ff('0xa'))[_0x34ff('0xb')](socket);exports[_0x34ff('0xc')]=function(_0x485c02){var _0x6fdb95=this;return new Promise(function(_0x180309,_0x16ebff){return db[_0x34ff('0xd')]['findAll']({'raw':_0x485c02[_0x34ff('0xe')]?_0x485c02[_0x34ff('0xe')][_0x34ff('0xf')]===undefined?!![]:![]:!![],'where':_0x485c02[_0x34ff('0xe')]?_0x485c02[_0x34ff('0xe')][_0x34ff('0x10')]||null:null,'attributes':_0x485c02[_0x34ff('0xe')]?_0x485c02[_0x34ff('0xe')][_0x34ff('0x11')]||null:null,'limit':_0x485c02[_0x34ff('0xe')]?_0x485c02[_0x34ff('0xe')][_0x34ff('0x12')]||null:null,'include':_0x485c02['options']?_0x485c02[_0x34ff('0xe')][_0x34ff('0x13')]?_[_0x34ff('0x14')](_0x485c02[_0x34ff('0xe')][_0x34ff('0x13')],function(_0x2c8a3a){return{'model':db[_0x2c8a3a[_0x34ff('0x15')]],'as':_0x2c8a3a['as'],'attributes':_0x2c8a3a[_0x34ff('0x11')],'include':_0x2c8a3a[_0x34ff('0x13')]?_[_0x34ff('0x14')](_0x2c8a3a[_0x34ff('0x13')],function(_0x2b4773){return{'model':db[_0x2b4773[_0x34ff('0x15')]],'as':_0x2b4773['as'],'attributes':_0x2b4773[_0x34ff('0x11')],'include':_0x2b4773['include']?_['map'](_0x2b4773[_0x34ff('0x13')],function(_0x4d16d5){return{'model':db[_0x4d16d5[_0x34ff('0x15')]],'as':_0x4d16d5['as'],'attributes':_0x4d16d5['attributes']};}):[]};}):[]};}):[]:[]})[_0x34ff('0x16')](function(_0x267579){logger['info'](_0x34ff('0xc'),_0x485c02);logger['debug']('GetSquareProjects',_0x485c02,JSON['stringify'](_0x267579));_0x180309(_0x267579);})[_0x34ff('0x17')](function(_0x46eafa){logger['error'](_0x34ff('0xc'),_0x46eafa['message'],_0x485c02);_0x16ebff(_0x6fdb95[_0x34ff('0x18')](0x1f4,_0x46eafa[_0x34ff('0x19')]));});});};exports[_0x34ff('0x1a')]=function(_0x15c095){var _0x3402d8=this;return new Promise(function(_0x5bd639,_0x3c4075){return db['SquareProject'][_0x34ff('0x1b')]({'raw':_0x15c095[_0x34ff('0xe')]?_0x15c095[_0x34ff('0xe')][_0x34ff('0xf')]===undefined?!![]:![]:!![],'where':_0x15c095[_0x34ff('0xe')]?_0x15c095[_0x34ff('0xe')][_0x34ff('0x10')]||null:null,'attributes':_0x15c095['options']?_0x15c095[_0x34ff('0xe')][_0x34ff('0x11')]||null:null,'include':_0x15c095[_0x34ff('0xe')]?_0x15c095[_0x34ff('0xe')][_0x34ff('0x13')]?_['map'](_0x15c095['options']['include'],function(_0x1432cf){return{'model':db[_0x1432cf[_0x34ff('0x15')]],'as':_0x1432cf['as'],'attributes':_0x1432cf[_0x34ff('0x11')],'include':_0x1432cf[_0x34ff('0x13')]?_[_0x34ff('0x14')](_0x1432cf['include'],function(_0x5d3c07){return{'model':db[_0x5d3c07[_0x34ff('0x15')]],'as':_0x5d3c07['as'],'attributes':_0x5d3c07[_0x34ff('0x11')],'include':_0x5d3c07[_0x34ff('0x13')]?_[_0x34ff('0x14')](_0x5d3c07['include'],function(_0x8479a8){return{'model':db[_0x8479a8[_0x34ff('0x15')]],'as':_0x8479a8['as'],'attributes':_0x8479a8[_0x34ff('0x11')]};}):[]};}):[]};}):[]:[]})[_0x34ff('0x16')](function(_0x3de2ee){logger[_0x34ff('0x1c')]('ShowSquareProject',_0x15c095);logger[_0x34ff('0x1d')](_0x34ff('0x1a'),_0x15c095,JSON[_0x34ff('0x1e')](_0x3de2ee));_0x5bd639(_0x3de2ee);})[_0x34ff('0x17')](function(_0x249dfd){logger[_0x34ff('0x18')](_0x34ff('0x1a'),_0x249dfd['message'],_0x15c095);_0x3c4075(_0x3402d8['error'](0x1f4,_0x249dfd[_0x34ff('0x19')]));});});}; \ No newline at end of file +var _0xff8c=['rpc','../../config/environment','redis','localhost','./squareProject.socket','register','GetSquareProjects','SquareProject','findAll','options','raw','where','attributes','include','map','model','then','info','stringify','catch','error','message','ShowSquareProject','find','debug'];(function(_0x31dc8d,_0x4efb8){var _0x25738c=function(_0x300b9d){while(--_0x300b9d){_0x31dc8d['push'](_0x31dc8d['shift']());}};_0x25738c(++_0x4efb8);}(_0xff8c,0x113));var _0xcff8=function(_0x11c221,_0x65c6a5){_0x11c221=_0x11c221-0x0;var _0x26deef=_0xff8c[_0x11c221];return _0x26deef;};'use strict';var _=require('lodash');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var logger=require('../../config/logger')(_0xcff8('0x0'));var config=require(_0xcff8('0x1'));config[_0xcff8('0x2')]=_['defaults'](config[_0xcff8('0x2')],{'host':_0xcff8('0x3'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xcff8('0x2')]));require(_0xcff8('0x4'))[_0xcff8('0x5')](socket);exports[_0xcff8('0x6')]=function(_0x255636){var _0x482244=this;return new Promise(function(_0x2aef68,_0x47321e){return db[_0xcff8('0x7')][_0xcff8('0x8')]({'raw':_0x255636[_0xcff8('0x9')]?_0x255636['options'][_0xcff8('0xa')]===undefined?!![]:![]:!![],'where':_0x255636[_0xcff8('0x9')]?_0x255636[_0xcff8('0x9')][_0xcff8('0xb')]||null:null,'attributes':_0x255636['options']?_0x255636[_0xcff8('0x9')][_0xcff8('0xc')]||null:null,'limit':_0x255636[_0xcff8('0x9')]?_0x255636['options']['limit']||null:null,'include':_0x255636[_0xcff8('0x9')]?_0x255636[_0xcff8('0x9')][_0xcff8('0xd')]?_[_0xcff8('0xe')](_0x255636['options']['include'],function(_0x46d273){return{'model':db[_0x46d273['model']],'as':_0x46d273['as'],'attributes':_0x46d273[_0xcff8('0xc')],'include':_0x46d273[_0xcff8('0xd')]?_[_0xcff8('0xe')](_0x46d273[_0xcff8('0xd')],function(_0xb0eaca){return{'model':db[_0xb0eaca[_0xcff8('0xf')]],'as':_0xb0eaca['as'],'attributes':_0xb0eaca[_0xcff8('0xc')],'include':_0xb0eaca[_0xcff8('0xd')]?_[_0xcff8('0xe')](_0xb0eaca[_0xcff8('0xd')],function(_0x2c9a32){return{'model':db[_0x2c9a32[_0xcff8('0xf')]],'as':_0x2c9a32['as'],'attributes':_0x2c9a32[_0xcff8('0xc')]};}):[]};}):[]};}):[]:[]})[_0xcff8('0x10')](function(_0x13d715){logger[_0xcff8('0x11')]('GetSquareProjects',_0x255636);logger['debug'](_0xcff8('0x6'),_0x255636,JSON[_0xcff8('0x12')](_0x13d715));_0x2aef68(_0x13d715);})[_0xcff8('0x13')](function(_0x1c137e){logger[_0xcff8('0x14')]('GetSquareProjects',_0x1c137e['message'],_0x255636);_0x47321e(_0x482244['error'](0x1f4,_0x1c137e[_0xcff8('0x15')]));});});};exports[_0xcff8('0x16')]=function(_0x5cac68){var _0x52b935=this;return new Promise(function(_0x88f883,_0x2795a7){return db['SquareProject'][_0xcff8('0x17')]({'raw':_0x5cac68[_0xcff8('0x9')]?_0x5cac68['options'][_0xcff8('0xa')]===undefined?!![]:![]:!![],'where':_0x5cac68['options']?_0x5cac68[_0xcff8('0x9')][_0xcff8('0xb')]||null:null,'attributes':_0x5cac68[_0xcff8('0x9')]?_0x5cac68[_0xcff8('0x9')][_0xcff8('0xc')]||null:null,'include':_0x5cac68[_0xcff8('0x9')]?_0x5cac68['options']['include']?_[_0xcff8('0xe')](_0x5cac68[_0xcff8('0x9')][_0xcff8('0xd')],function(_0x4eb4c7){return{'model':db[_0x4eb4c7['model']],'as':_0x4eb4c7['as'],'attributes':_0x4eb4c7[_0xcff8('0xc')],'include':_0x4eb4c7[_0xcff8('0xd')]?_[_0xcff8('0xe')](_0x4eb4c7['include'],function(_0x3afd56){return{'model':db[_0x3afd56[_0xcff8('0xf')]],'as':_0x3afd56['as'],'attributes':_0x3afd56['attributes'],'include':_0x3afd56[_0xcff8('0xd')]?_['map'](_0x3afd56[_0xcff8('0xd')],function(_0x3559c1){return{'model':db[_0x3559c1[_0xcff8('0xf')]],'as':_0x3559c1['as'],'attributes':_0x3559c1[_0xcff8('0xc')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x428c66){logger['info'](_0xcff8('0x16'),_0x5cac68);logger[_0xcff8('0x18')](_0xcff8('0x16'),_0x5cac68,JSON[_0xcff8('0x12')](_0x428c66));_0x88f883(_0x428c66);})['catch'](function(_0x23bc0d){logger[_0xcff8('0x14')](_0xcff8('0x16'),_0x23bc0d['message'],_0x5cac68);_0x2795a7(_0x52b935[_0xcff8('0x14')](0x1f4,_0x23bc0d[_0xcff8('0x15')]));});});}; \ No newline at end of file diff --git a/server/api/squareProject/squareProject.socket.js b/server/api/squareProject/squareProject.socket.js index 7d6fc46..7b2bd5d 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 _0x2863=['register','squareProject:','./squareProject.events','save','remove','update','removeListener'];(function(_0xfe5bd6,_0xe53ffc){var _0x42896e=function(_0x551b81){while(--_0x551b81){_0xfe5bd6['push'](_0xfe5bd6['shift']());}};_0x42896e(++_0xe53ffc);}(_0x2863,0xdb));var _0x3286=function(_0x8e00e5,_0x1cae41){_0x8e00e5=_0x8e00e5-0x0;var _0x5d8c62=_0x2863[_0x8e00e5];return _0x5d8c62;};'use strict';var SquareProjectEvents=require(_0x3286('0x0'));var events=[_0x3286('0x1'),_0x3286('0x2'),_0x3286('0x3')];function createListener(_0x546bbb,_0x4bfc5f){return function(_0x3597cf){_0x4bfc5f['emit'](_0x546bbb,_0x3597cf);};}function removeListener(_0xc2e9c8,_0x358cb8){return function(){SquareProjectEvents[_0x3286('0x4')](_0xc2e9c8,_0x358cb8);};}exports[_0x3286('0x5')]=function(_0x2a952d){for(var _0x53bfda=0x0,_0x5379be=events['length'];_0x53bfda<_0x5379be;_0x53bfda++){var _0x36cca5=events[_0x53bfda];var _0x9e94fb=createListener(_0x3286('0x6')+_0x36cca5,_0x2a952d);SquareProjectEvents['on'](_0x36cca5,_0x9e94fb);}}; \ No newline at end of file +var _0x5f97=['update','removeListener','register'];(function(_0x4db631,_0x4a82b6){var _0x46a3a9=function(_0xa2537d){while(--_0xa2537d){_0x4db631['push'](_0x4db631['shift']());}};_0x46a3a9(++_0x4a82b6);}(_0x5f97,0x1d1));var _0x75f9=function(_0xa464c9,_0x7c86d8){_0xa464c9=_0xa464c9-0x0;var _0x3d73c4=_0x5f97[_0xa464c9];return _0x3d73c4;};'use strict';var SquareProjectEvents=require('./squareProject.events');var events=['save','remove',_0x75f9('0x0')];function createListener(_0x53b63e,_0x351ce4){return function(_0x5113a4){_0x351ce4['emit'](_0x53b63e,_0x5113a4);};}function removeListener(_0x40fb67,_0x3fbb29){return function(){SquareProjectEvents[_0x75f9('0x1')](_0x40fb67,_0x3fbb29);};}exports[_0x75f9('0x2')]=function(_0x1444b8){for(var _0x20a2ae=0x0,_0x4ec4ec=events['length'];_0x20a2ae<_0x4ec4ec;_0x20a2ae++){var _0x3ee4e9=events[_0x20a2ae];var _0x1f6ecc=createListener('squareProject:'+_0x3ee4e9,_0x1444b8);SquareProjectEvents['on'](_0x3ee4e9,_0x1f6ecc);}}; \ No newline at end of file diff --git a/server/api/squareRecording/index.js b/server/api/squareRecording/index.js index c9c554c..fface01 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 _0xf494=['../../config/environment','./squareRecording.controller','get','isAuthenticated','index','show','/:id/download','download','post','create','/:id','delete','destroy','exports','multer','util','path','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service'];(function(_0x2e5c22,_0x1e450e){var _0x348888=function(_0x2e1499){while(--_0x2e1499){_0x2e5c22['push'](_0x2e5c22['shift']());}};_0x348888(++_0x1e450e);}(_0xf494,0x1c6));var _0x4f49=function(_0x58dda8,_0x2b5c7a){_0x58dda8=_0x58dda8-0x0;var _0xffa0c3=_0xf494[_0x58dda8];return _0xffa0c3;};'use strict';var multer=require(_0x4f49('0x0'));var util=require(_0x4f49('0x1'));var path=require(_0x4f49('0x2'));var timeout=require('connect-timeout');var express=require(_0x4f49('0x3'));var router=express[_0x4f49('0x4')]();var fs_extra=require(_0x4f49('0x5'));var auth=require(_0x4f49('0x6'));var interaction=require(_0x4f49('0x7'));var config=require(_0x4f49('0x8'));var controller=require(_0x4f49('0x9'));router[_0x4f49('0xa')]('/',auth[_0x4f49('0xb')](),controller[_0x4f49('0xc')]);router[_0x4f49('0xa')]('/:id',auth['isAuthenticated'](),controller[_0x4f49('0xd')]);router[_0x4f49('0xa')](_0x4f49('0xe'),auth[_0x4f49('0xb')](),controller[_0x4f49('0xf')]);router[_0x4f49('0x10')]('/',auth[_0x4f49('0xb')](),controller[_0x4f49('0x11')]);router['put'](_0x4f49('0x12'),auth[_0x4f49('0xb')](),controller['update']);router[_0x4f49('0x13')]('/:id',auth['isAuthenticated'](),controller[_0x4f49('0x14')]);module[_0x4f49('0x15')]=router; \ No newline at end of file +var _0x326f=['multer','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./squareRecording.controller','get','isAuthenticated','/:id','show','download','post','create','put','delete','exports'];(function(_0x3da612,_0x332456){var _0x1a9d1d=function(_0x5ca0d0){while(--_0x5ca0d0){_0x3da612['push'](_0x3da612['shift']());}};_0x1a9d1d(++_0x332456);}(_0x326f,0xd1));var _0xf326=function(_0x68c8ca,_0x3225fd){_0x68c8ca=_0x68c8ca-0x0;var _0x221c07=_0x326f[_0x68c8ca];return _0x221c07;};'use strict';var multer=require(_0xf326('0x0'));var util=require('util');var path=require('path');var timeout=require(_0xf326('0x1'));var express=require(_0xf326('0x2'));var router=express[_0xf326('0x3')]();var fs_extra=require(_0xf326('0x4'));var auth=require(_0xf326('0x5'));var interaction=require(_0xf326('0x6'));var config=require(_0xf326('0x7'));var controller=require(_0xf326('0x8'));router[_0xf326('0x9')]('/',auth[_0xf326('0xa')](),controller['index']);router[_0xf326('0x9')](_0xf326('0xb'),auth[_0xf326('0xa')](),controller[_0xf326('0xc')]);router['get']('/:id/download',auth['isAuthenticated'](),controller[_0xf326('0xd')]);router[_0xf326('0xe')]('/',auth[_0xf326('0xa')](),controller[_0xf326('0xf')]);router[_0xf326('0x10')]('/:id',auth[_0xf326('0xa')](),controller['update']);router[_0xf326('0x11')]('/:id',auth[_0xf326('0xa')](),controller['destroy']);module[_0xf326('0x12')]=router; \ No newline at end of file diff --git a/server/api/squareRecording/squareRecording.attributes.js b/server/api/squareRecording/squareRecording.attributes.js index 5dd5567..37cacbb 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 _0x2675=['getDataValue','savePath','lastIndexOf','sequelize','STRING','VIRTUAL'];(function(_0x13cd99,_0x50bd8d){var _0x1d42c7=function(_0x1fa433){while(--_0x1fa433){_0x13cd99['push'](_0x13cd99['shift']());}};_0x1d42c7(++_0x50bd8d);}(_0x2675,0x75));var _0x5267=function(_0x572997,_0x323709){_0x572997=_0x572997-0x0;var _0x1de5ae=_0x2675[_0x572997];return _0x1de5ae;};'use strict';var Sequelize=require(_0x5267('0x0'));module['exports']={'uniqueid':{'type':Sequelize['STRING']},'callerid':{'type':Sequelize['STRING']},'calleridname':{'type':Sequelize[_0x5267('0x1')]},'context':{'type':Sequelize[_0x5267('0x1')]},'extension':{'type':Sequelize['STRING']},'priority':{'type':Sequelize[_0x5267('0x1')]},'accountcode':{'type':Sequelize[_0x5267('0x1')]},'dnid':{'type':Sequelize['STRING']},'projectName':{'type':Sequelize[_0x5267('0x1')]},'saveName':{'type':Sequelize[_0x5267('0x1')]},'filename':{'type':Sequelize[_0x5267('0x1')]},'savePath':{'type':Sequelize[_0x5267('0x1')]},'format':{'type':Sequelize[_0x5267('0x2')],'get':function(){var _0xc56cd5='';var _0x527c16=this[_0x5267('0x3')](_0x5267('0x4'));if(_0x527c16){_0xc56cd5=_0x527c16['substring'](_0x527c16[_0x5267('0x5')]('.'));}return _0xc56cd5;}}}; \ No newline at end of file +var _0xbd51=['VIRTUAL','getDataValue','savePath','lastIndexOf','sequelize','STRING'];(function(_0x412c84,_0x36a420){var _0x576d39=function(_0x27050a){while(--_0x27050a){_0x412c84['push'](_0x412c84['shift']());}};_0x576d39(++_0x36a420);}(_0xbd51,0x1a8));var _0x1bd5=function(_0x599f6a,_0x1db119){_0x599f6a=_0x599f6a-0x0;var _0x16ffb2=_0xbd51[_0x599f6a];return _0x16ffb2;};'use strict';var Sequelize=require(_0x1bd5('0x0'));module['exports']={'uniqueid':{'type':Sequelize[_0x1bd5('0x1')]},'callerid':{'type':Sequelize[_0x1bd5('0x1')]},'calleridname':{'type':Sequelize[_0x1bd5('0x1')]},'context':{'type':Sequelize[_0x1bd5('0x1')]},'extension':{'type':Sequelize['STRING']},'priority':{'type':Sequelize['STRING']},'accountcode':{'type':Sequelize['STRING']},'dnid':{'type':Sequelize['STRING']},'projectName':{'type':Sequelize[_0x1bd5('0x1')]},'saveName':{'type':Sequelize[_0x1bd5('0x1')]},'filename':{'type':Sequelize[_0x1bd5('0x1')]},'savePath':{'type':Sequelize['STRING']},'format':{'type':Sequelize[_0x1bd5('0x2')],'get':function(){var _0x30a385='';var _0x19077c=this[_0x1bd5('0x3')](_0x1bd5('0x4'));if(_0x19077c){_0x30a385=_0x19077c['substring'](_0x19077c[_0x1bd5('0x5')]('.'));}return _0x30a385;}}}; \ No newline at end of file diff --git a/server/api/squareRecording/squareRecording.controller.js b/server/api/squareRecording/squareRecording.controller.js index ed24372..80fcca3 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 _0xe460=['include','findAll','rows','catch','show','params','create','body','update','find','download','type','savePath','filename','existsSync','decryptFile','secrets','Sequelize','ValidationError','SquareRecording\x20not\x20found','unlink','message','Not\x20found','destroy','isNil','Entity\x20not\x20found','info','cancellazione\x20fisica\x20documento\x20%s','\x22\x20trovato\x20eseguo\x20la\x20cancellazione','unlinkSync','.cypher','File:\x20\x22','eml-format','fast-json-patch','request-promise','bluebird','mustache','util','path','ejs','fs-extra','lodash','jsforce','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/environment','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','reject','save','then','name','send','index','map','rawAttributes','key','model','query','keys','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','pick','VIRTUAL','filter','merge','options','SquareRecording'];(function(_0x57abcd,_0x20104c){var _0x3cfb7e=function(_0x32672c){while(--_0x32672c){_0x57abcd['push'](_0x57abcd['shift']());}};_0x3cfb7e(++_0x20104c);}(_0xe460,0x188));var _0x0e46=function(_0x38c632,_0x14e8e6){_0x38c632=_0x38c632-0x0;var _0x12737e=_0xe460[_0x38c632];return _0x12737e;};'use strict';var emlformat=require(_0x0e46('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0x0e46('0x1'));var rp=require(_0x0e46('0x2'));var moment=require('moment');var BPromise=require(_0x0e46('0x3'));var Mustache=require(_0x0e46('0x4'));var util=require(_0x0e46('0x5'));var path=require(_0x0e46('0x6'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0x0e46('0x7'));var fs=require('fs');var fs_extra=require(_0x0e46('0x8'));var _=require(_0x0e46('0x9'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0x0e46('0xa'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0x0e46('0xb'));var Papa=require('papaparse');var Redis=require(_0x0e46('0xc'));var authService=require(_0x0e46('0xd'));var qs=require(_0x0e46('0xe'));var as=require(_0x0e46('0xf'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x0e46('0x10'))(_0x0e46('0x11'));var utils=require('../../config/utils');var config=require(_0x0e46('0x12'));var licenseUtil=require('../../config/license/util');var db=require(_0x0e46('0x13'))['db'];function respondWithStatusCode(_0x5f50f8,_0x53d381){_0x53d381=_0x53d381||0xcc;return function(_0x11a0c9){if(_0x11a0c9){return _0x5f50f8[_0x0e46('0x14')](_0x53d381);}return _0x5f50f8[_0x0e46('0x15')](_0x53d381)[_0x0e46('0x16')]();};}function respondWithResult(_0x49d9a2,_0x233bdb){_0x233bdb=_0x233bdb||0xc8;return function(_0x1a0984){if(_0x1a0984){return _0x49d9a2[_0x0e46('0x15')](_0x233bdb)[_0x0e46('0x17')](_0x1a0984);}};}function respondWithFilteredResult(_0x42e779,_0x273d7b){return function(_0xbf95){if(_0xbf95){var _0x395797=typeof _0x273d7b[_0x0e46('0x18')]===_0x0e46('0x19')&&typeof _0x273d7b[_0x0e46('0x1a')]===_0x0e46('0x19');var _0x10adec=_0xbf95[_0x0e46('0x1b')];var _0x56bfc4=_0x395797?0x0:_0x273d7b[_0x0e46('0x18')];var _0xdaccf5=_0x395797?_0xbf95['count']:_0x273d7b[_0x0e46('0x18')]+_0x273d7b['limit'];var _0x225cc4;if(_0xdaccf5>=_0x10adec){_0xdaccf5=_0x10adec;_0x225cc4=0xc8;}else{_0x225cc4=0xce;}_0x42e779[_0x0e46('0x15')](_0x225cc4);return _0x42e779[_0x0e46('0x1c')](_0x0e46('0x1d'),_0x56bfc4+'-'+_0xdaccf5+'/'+_0x10adec)['json'](_0xbf95);}return null;};}function patchUpdates(_0x3d9199){return function(_0x57ede0){try{jsonpatch['apply'](_0x57ede0,_0x3d9199,!![]);}catch(_0x2f7859){return BPromise[_0x0e46('0x1e')](_0x2f7859);}return _0x57ede0[_0x0e46('0x1f')]();};}function saveUpdates(_0xb774e6,_0x445368){return function(_0x42e863){if(_0x42e863){return _0x42e863['update'](_0xb774e6)[_0x0e46('0x20')](function(_0x144a59){return _0x144a59;});}return null;};}function removeEntity(_0x24a355,_0x203921){return function(_0x40f09e){if(_0x40f09e){return _0x40f09e['destroy']()[_0x0e46('0x20')](function(){_0x24a355[_0x0e46('0x15')](0xcc)[_0x0e46('0x16')]();});}};}function handleEntityNotFound(_0x29b43,_0x337a47){return function(_0x362dda){if(!_0x362dda){_0x29b43[_0x0e46('0x14')](0x194);}return _0x362dda;};}function handleError(_0x2d99b8,_0x54c611){_0x54c611=_0x54c611||0x1f4;return function(_0x99a8b1){logger['error'](_0x99a8b1['stack']);if(_0x99a8b1[_0x0e46('0x21')]){delete _0x99a8b1[_0x0e46('0x21')];}_0x2d99b8[_0x0e46('0x15')](_0x54c611)[_0x0e46('0x22')](_0x99a8b1);};}exports[_0x0e46('0x23')]=function(_0x3274a4,_0x44d992){var _0x43eaf8={},_0x309a4f={},_0x2ae69={'count':0x0,'rows':[]};var _0x4ecc96=_[_0x0e46('0x24')](db['SquareRecording'][_0x0e46('0x25')],function(_0x46f006){return{'name':_0x46f006['fieldName'],'type':_0x46f006['type'][_0x0e46('0x26')]};});_0x309a4f[_0x0e46('0x27')]=_['map'](_0x4ecc96,'name');_0x309a4f[_0x0e46('0x28')]=_[_0x0e46('0x29')](_0x3274a4[_0x0e46('0x28')]);_0x309a4f[_0x0e46('0x2a')]=_['intersection'](_0x309a4f[_0x0e46('0x27')],_0x309a4f[_0x0e46('0x28')]);_0x43eaf8['attributes']=_[_0x0e46('0x2b')](_0x309a4f[_0x0e46('0x27')],qs[_0x0e46('0x2c')](_0x3274a4[_0x0e46('0x28')][_0x0e46('0x2c')]));_0x43eaf8[_0x0e46('0x2d')]=_0x43eaf8[_0x0e46('0x2d')][_0x0e46('0x2e')]?_0x43eaf8['attributes']:_0x309a4f[_0x0e46('0x27')];if(!_0x3274a4[_0x0e46('0x28')][_0x0e46('0x2f')](_0x0e46('0x30'))){_0x43eaf8[_0x0e46('0x1a')]=qs['limit'](_0x3274a4[_0x0e46('0x28')]['limit']);_0x43eaf8['offset']=qs[_0x0e46('0x18')](_0x3274a4[_0x0e46('0x28')]['offset']);}_0x43eaf8[_0x0e46('0x31')]=qs[_0x0e46('0x32')](_0x3274a4[_0x0e46('0x28')][_0x0e46('0x32')]);_0x43eaf8[_0x0e46('0x33')]=qs[_0x0e46('0x2a')](_[_0x0e46('0x34')](_0x3274a4['query'],_0x309a4f['filters']),_0x4ecc96);if(_0x3274a4['query']['filter']){_0x43eaf8['where']=_['merge'](_0x43eaf8[_0x0e46('0x33')],{'$or':_[_0x0e46('0x24')](_0x4ecc96,function(_0x445dc3){if(_0x445dc3['type']!==_0x0e46('0x35')){var _0x34ea43={};_0x34ea43[_0x445dc3[_0x0e46('0x21')]]={'$like':'%'+_0x3274a4[_0x0e46('0x28')][_0x0e46('0x36')]+'%'};return _0x34ea43;}})});}_0x43eaf8=_[_0x0e46('0x37')]({},_0x43eaf8,_0x3274a4[_0x0e46('0x38')]);var _0x489f44={'where':_0x43eaf8[_0x0e46('0x33')]};return db[_0x0e46('0x39')]['count'](_0x489f44)[_0x0e46('0x20')](function(_0x46bc38){_0x2ae69[_0x0e46('0x1b')]=_0x46bc38;if(_0x3274a4[_0x0e46('0x28')]['includeAll']){_0x43eaf8[_0x0e46('0x3a')]=[{'all':!![]}];}return db['SquareRecording'][_0x0e46('0x3b')](_0x43eaf8);})['then'](function(_0x437c60){_0x2ae69[_0x0e46('0x3c')]=_0x437c60;return _0x2ae69;})[_0x0e46('0x20')](respondWithFilteredResult(_0x44d992,_0x43eaf8))[_0x0e46('0x3d')](handleError(_0x44d992,null));};exports[_0x0e46('0x3e')]=function(_0x4a3938,_0x547923){var _0x585a88={'raw':!![],'where':{'id':_0x4a3938[_0x0e46('0x3f')]['id']}},_0x579175={};_0x579175[_0x0e46('0x27')]=_['keys'](db['SquareRecording'][_0x0e46('0x25')]);_0x579175['query']=_['keys'](_0x4a3938[_0x0e46('0x28')]);_0x579175[_0x0e46('0x2a')]=_[_0x0e46('0x2b')](_0x579175[_0x0e46('0x27')],_0x579175[_0x0e46('0x28')]);_0x585a88[_0x0e46('0x2d')]=_[_0x0e46('0x2b')](_0x579175[_0x0e46('0x27')],qs[_0x0e46('0x2c')](_0x4a3938[_0x0e46('0x28')][_0x0e46('0x2c')]));_0x585a88['attributes']=_0x585a88[_0x0e46('0x2d')][_0x0e46('0x2e')]?_0x585a88[_0x0e46('0x2d')]:_0x579175[_0x0e46('0x27')];if(_0x4a3938[_0x0e46('0x28')]['includeAll']){_0x585a88['include']=[{'all':!![]}];}_0x585a88=_['merge']({},_0x585a88,_0x4a3938[_0x0e46('0x38')]);return db[_0x0e46('0x39')]['find'](_0x585a88)[_0x0e46('0x20')](handleEntityNotFound(_0x547923,null))[_0x0e46('0x20')](respondWithResult(_0x547923,null))[_0x0e46('0x3d')](handleError(_0x547923,null));};exports[_0x0e46('0x40')]=function(_0x55bd59,_0x43f8d2){return db[_0x0e46('0x39')][_0x0e46('0x40')](_0x55bd59[_0x0e46('0x41')],{})['then'](respondWithResult(_0x43f8d2,0xc9))['catch'](handleError(_0x43f8d2,null));};exports[_0x0e46('0x42')]=function(_0x57aab,_0x1b5784){if(_0x57aab['body']['id']){delete _0x57aab['body']['id'];}return db[_0x0e46('0x39')][_0x0e46('0x43')]({'where':{'id':_0x57aab[_0x0e46('0x3f')]['id']}})[_0x0e46('0x20')](handleEntityNotFound(_0x1b5784,null))[_0x0e46('0x20')](saveUpdates(_0x57aab['body'],null))[_0x0e46('0x20')](respondWithResult(_0x1b5784,null))[_0x0e46('0x3d')](handleError(_0x1b5784,null));};exports[_0x0e46('0x44')]=function(_0x2f2b26,_0xd455e0,_0x1b8c3d){var _0x1b291a=require('../../components/encryptor');var _0x587cda=![];var _0x461c00={};if(_0x2f2b26['query'][_0x0e46('0x45')]&&_0x2f2b26[_0x0e46('0x28')][_0x0e46('0x45')]==='uniqueid'){_0x461c00['uniqueid']=_0x2f2b26[_0x0e46('0x3f')]['id'];}else{_0x461c00['id']=_0x2f2b26[_0x0e46('0x3f')]['id'];}return db[_0x0e46('0x39')]['find']({'where':_0x461c00,'attributes':['id',_0x0e46('0x46'),_0x0e46('0x47')],'raw':!![]})[_0x0e46('0x20')](handleEntityNotFound(_0xd455e0,null))[_0x0e46('0x20')](function(_0x2b2f50){if(_0x2b2f50){var _0x3bf90e=_0x2b2f50[_0x0e46('0x46')];var _0x258cb9=util['format']('%s.cypher',_0x3bf90e);if(fs[_0x0e46('0x48')](_0x258cb9)){_0x587cda=!![];return _0x1b291a[_0x0e46('0x49')](_0x258cb9,_0x3bf90e,config[_0x0e46('0x4a')]['recording'])[_0x0e46('0x20')](function(){return _0x2b2f50;});}return _0x2b2f50;}})['then'](function(_0x255e24){if(_0x255e24){var _0x2003fe=_0x255e24['savePath'];if(!fs[_0x0e46('0x48')](_0x2003fe)){throw new db[(_0x0e46('0x4b'))][(_0x0e46('0x4c'))](_0x0e46('0x4d'));}if(_0x255e24[_0x0e46('0x47')]){return _0xd455e0[_0x0e46('0x44')](_0x2003fe,_0x255e24[_0x0e46('0x47')]+path['extname'](_0x2003fe),function(){if(_0x587cda){fs[_0x0e46('0x4e')](_0x2003fe);}});}else{return _0xd455e0['download'](_0x2003fe,function(_0x4d2249){if(_0x587cda){fs['unlink'](_0x2003fe);}});}}})[_0x0e46('0x3d')](function(_0x5a079a){if(_0x5a079a[_0x0e46('0x4f')]==='SquareRecording\x20not\x20found'){_0xd455e0[_0x0e46('0x15')](0x194)[_0x0e46('0x22')](_0x0e46('0x50'));}else{return handleError(_0xd455e0,null);}});};exports[_0x0e46('0x51')]=function(_0x2cf413,_0x13d7e5){return db[_0x0e46('0x39')][_0x0e46('0x43')]({'where':{'id':_0x2cf413[_0x0e46('0x3f')]['id']}})['then'](function(_0x23ce1d){if(_[_0x0e46('0x52')](_0x23ce1d)){throw new ReferenceError(_0x0e46('0x53'));}return _0x23ce1d;})[_0x0e46('0x20')](function(_0x433ef7){var _0x3365fd=_0x433ef7['savePath'];logger[_0x0e46('0x54')](_0x0e46('0x55'),_0x3365fd);if(!_[_0x0e46('0x52')](_0x433ef7[_0x0e46('0x46')])&&fs[_0x0e46('0x48')](_0x3365fd)){logger[_0x0e46('0x54')]('File:\x20\x22'+_0x3365fd+_0x0e46('0x56'));fs[_0x0e46('0x57')](_0x3365fd);}_0x3365fd=_0x3365fd+_0x0e46('0x58');if(!_[_0x0e46('0x52')](_0x433ef7[_0x0e46('0x46')])&&fs[_0x0e46('0x48')](_0x3365fd)){logger[_0x0e46('0x54')](_0x0e46('0x59')+_0x3365fd+_0x0e46('0x56'));fs[_0x0e46('0x57')](_0x3365fd);}return _0x433ef7;})[_0x0e46('0x20')](function(_0x2c16e1){if(!_0x2c16e1)throw new InternalError();return _0x2c16e1['destroy']();})[_0x0e46('0x20')](function(){_0x13d7e5['status'](0xcc)[_0x0e46('0x16')]();})[_0x0e46('0x3d')](handleError(_0x13d7e5,null));}; \ No newline at end of file +var _0x88e6=['rows','catch','show','params','rawAttributes','length','find','create','body','download','../../components/encryptor','uniqueid','savePath','filename','format','%s.cypher','existsSync','decryptFile','secrets','recording','ValidationError','SquareRecording\x20not\x20found','extname','unlink','message','Not\x20found','Entity\x20not\x20found','info','isNil','File:\x20\x22','\x22\x20trovato\x20eseguo\x20la\x20cancellazione','.cypher','destroy','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','sox','to-csv','lodash','crypto','desk.js','querystring','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','status','end','offset','limit','count','json','apply','reject','then','sendStatus','error','name','index','map','SquareRecording','fieldName','key','model','query','keys','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','filters','pick','filter','where','merge','type','VIRTUAL','options','includeAll','findAll'];(function(_0x21b359,_0x4dc80e){var _0x57b8e7=function(_0x135adb){while(--_0x135adb){_0x21b359['push'](_0x21b359['shift']());}};_0x57b8e7(++_0x4dc80e);}(_0x88e6,0x7d));var _0x688e=function(_0x58d873,_0xf41b71){_0x58d873=_0x58d873-0x0;var _0x5ce794=_0x88e6[_0x58d873];return _0x5ce794;};'use strict';var emlformat=require(_0x688e('0x0'));var rimraf=require(_0x688e('0x1'));var zipdir=require(_0x688e('0x2'));var jsonpatch=require(_0x688e('0x3'));var rp=require(_0x688e('0x4'));var moment=require(_0x688e('0x5'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require('util');var path=require('path');var sox=require(_0x688e('0x6'));var csv=require(_0x688e('0x7'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x688e('0x8'));var squel=require('squel');var crypto=require(_0x688e('0x9'));var jsforce=require('jsforce');var deskjs=require(_0x688e('0xa'));var toCsv=require(_0x688e('0x7'));var querystring=require(_0x688e('0xb'));var Papa=require('papaparse');var Redis=require(_0x688e('0xc'));var authService=require('../../components/auth/service');var qs=require(_0x688e('0xd'));var as=require(_0x688e('0xe'));var hardwareService=require(_0x688e('0xf'));var logger=require(_0x688e('0x10'))(_0x688e('0x11'));var utils=require(_0x688e('0x12'));var config=require(_0x688e('0x13'));var licenseUtil=require(_0x688e('0x14'));var db=require(_0x688e('0x15'))['db'];function respondWithStatusCode(_0x11eda9,_0x42fd7a){_0x42fd7a=_0x42fd7a||0xcc;return function(_0x392776){if(_0x392776){return _0x11eda9['sendStatus'](_0x42fd7a);}return _0x11eda9[_0x688e('0x16')](_0x42fd7a)[_0x688e('0x17')]();};}function respondWithResult(_0x42b070,_0x52a2d4){_0x52a2d4=_0x52a2d4||0xc8;return function(_0x4447c9){if(_0x4447c9){return _0x42b070[_0x688e('0x16')](_0x52a2d4)['json'](_0x4447c9);}};}function respondWithFilteredResult(_0x4d2380,_0x573a1c){return function(_0x5b39c7){if(_0x5b39c7){var _0x4b0c7d=typeof _0x573a1c[_0x688e('0x18')]==='undefined'&&typeof _0x573a1c[_0x688e('0x19')]==='undefined';var _0x22c838=_0x5b39c7[_0x688e('0x1a')];var _0x242ed5=_0x4b0c7d?0x0:_0x573a1c['offset'];var _0x1ba2be=_0x4b0c7d?_0x5b39c7[_0x688e('0x1a')]:_0x573a1c[_0x688e('0x18')]+_0x573a1c[_0x688e('0x19')];var _0x11da24;if(_0x1ba2be>=_0x22c838){_0x1ba2be=_0x22c838;_0x11da24=0xc8;}else{_0x11da24=0xce;}_0x4d2380[_0x688e('0x16')](_0x11da24);return _0x4d2380['set']('Content-Range',_0x242ed5+'-'+_0x1ba2be+'/'+_0x22c838)[_0x688e('0x1b')](_0x5b39c7);}return null;};}function patchUpdates(_0x1c5197){return function(_0x3a6778){try{jsonpatch[_0x688e('0x1c')](_0x3a6778,_0x1c5197,!![]);}catch(_0x2333c9){return BPromise[_0x688e('0x1d')](_0x2333c9);}return _0x3a6778['save']();};}function saveUpdates(_0xcd5533,_0x3b8b90){return function(_0x41fb3b){if(_0x41fb3b){return _0x41fb3b['update'](_0xcd5533)[_0x688e('0x1e')](function(_0x5ee1ea){return _0x5ee1ea;});}return null;};}function removeEntity(_0x502fdb,_0x559165){return function(_0x21693b){if(_0x21693b){return _0x21693b['destroy']()[_0x688e('0x1e')](function(){_0x502fdb[_0x688e('0x16')](0xcc)['end']();});}};}function handleEntityNotFound(_0x24613c,_0x5e4df4){return function(_0x3fa713){if(!_0x3fa713){_0x24613c[_0x688e('0x1f')](0x194);}return _0x3fa713;};}function handleError(_0x2bd8a0,_0x40a5c0){_0x40a5c0=_0x40a5c0||0x1f4;return function(_0x4e5ab5){logger[_0x688e('0x20')](_0x4e5ab5['stack']);if(_0x4e5ab5['name']){delete _0x4e5ab5[_0x688e('0x21')];}_0x2bd8a0['status'](_0x40a5c0)['send'](_0x4e5ab5);};}exports[_0x688e('0x22')]=function(_0x30397c,_0x267deb){var _0x37b01e={},_0x165fd1={},_0x1ed227={'count':0x0,'rows':[]};var _0xe09d38=_[_0x688e('0x23')](db[_0x688e('0x24')]['rawAttributes'],function(_0x2d9653){return{'name':_0x2d9653[_0x688e('0x25')],'type':_0x2d9653['type'][_0x688e('0x26')]};});_0x165fd1[_0x688e('0x27')]=_[_0x688e('0x23')](_0xe09d38,'name');_0x165fd1[_0x688e('0x28')]=_[_0x688e('0x29')](_0x30397c[_0x688e('0x28')]);_0x165fd1['filters']=_[_0x688e('0x2a')](_0x165fd1[_0x688e('0x27')],_0x165fd1[_0x688e('0x28')]);_0x37b01e[_0x688e('0x2b')]=_['intersection'](_0x165fd1[_0x688e('0x27')],qs[_0x688e('0x2c')](_0x30397c['query'][_0x688e('0x2c')]));_0x37b01e['attributes']=_0x37b01e[_0x688e('0x2b')]['length']?_0x37b01e[_0x688e('0x2b')]:_0x165fd1[_0x688e('0x27')];if(!_0x30397c[_0x688e('0x28')][_0x688e('0x2d')](_0x688e('0x2e'))){_0x37b01e['limit']=qs[_0x688e('0x19')](_0x30397c['query']['limit']);_0x37b01e['offset']=qs['offset'](_0x30397c[_0x688e('0x28')]['offset']);}_0x37b01e[_0x688e('0x2f')]=qs[_0x688e('0x30')](_0x30397c['query'][_0x688e('0x30')]);_0x37b01e['where']=qs[_0x688e('0x31')](_[_0x688e('0x32')](_0x30397c[_0x688e('0x28')],_0x165fd1[_0x688e('0x31')]),_0xe09d38);if(_0x30397c[_0x688e('0x28')][_0x688e('0x33')]){_0x37b01e[_0x688e('0x34')]=_[_0x688e('0x35')](_0x37b01e[_0x688e('0x34')],{'$or':_[_0x688e('0x23')](_0xe09d38,function(_0x47e0bf){if(_0x47e0bf[_0x688e('0x36')]!==_0x688e('0x37')){var _0x5755b2={};_0x5755b2[_0x47e0bf[_0x688e('0x21')]]={'$like':'%'+_0x30397c[_0x688e('0x28')]['filter']+'%'};return _0x5755b2;}})});}_0x37b01e=_[_0x688e('0x35')]({},_0x37b01e,_0x30397c[_0x688e('0x38')]);var _0x47df1d={'where':_0x37b01e['where']};return db[_0x688e('0x24')][_0x688e('0x1a')](_0x47df1d)['then'](function(_0x135bcd){_0x1ed227['count']=_0x135bcd;if(_0x30397c['query'][_0x688e('0x39')]){_0x37b01e['include']=[{'all':!![]}];}return db[_0x688e('0x24')][_0x688e('0x3a')](_0x37b01e);})[_0x688e('0x1e')](function(_0x9f4637){_0x1ed227[_0x688e('0x3b')]=_0x9f4637;return _0x1ed227;})[_0x688e('0x1e')](respondWithFilteredResult(_0x267deb,_0x37b01e))[_0x688e('0x3c')](handleError(_0x267deb,null));};exports[_0x688e('0x3d')]=function(_0x5c109a,_0x39186e){var _0x3e722e={'raw':!![],'where':{'id':_0x5c109a[_0x688e('0x3e')]['id']}},_0x4d0127={};_0x4d0127[_0x688e('0x27')]=_[_0x688e('0x29')](db[_0x688e('0x24')][_0x688e('0x3f')]);_0x4d0127[_0x688e('0x28')]=_[_0x688e('0x29')](_0x5c109a['query']);_0x4d0127[_0x688e('0x31')]=_[_0x688e('0x2a')](_0x4d0127[_0x688e('0x27')],_0x4d0127[_0x688e('0x28')]);_0x3e722e['attributes']=_[_0x688e('0x2a')](_0x4d0127[_0x688e('0x27')],qs[_0x688e('0x2c')](_0x5c109a[_0x688e('0x28')][_0x688e('0x2c')]));_0x3e722e[_0x688e('0x2b')]=_0x3e722e['attributes'][_0x688e('0x40')]?_0x3e722e['attributes']:_0x4d0127[_0x688e('0x27')];if(_0x5c109a['query']['includeAll']){_0x3e722e['include']=[{'all':!![]}];}_0x3e722e=_['merge']({},_0x3e722e,_0x5c109a[_0x688e('0x38')]);return db['SquareRecording'][_0x688e('0x41')](_0x3e722e)[_0x688e('0x1e')](handleEntityNotFound(_0x39186e,null))[_0x688e('0x1e')](respondWithResult(_0x39186e,null))[_0x688e('0x3c')](handleError(_0x39186e,null));};exports[_0x688e('0x42')]=function(_0x38ab95,_0x2db429){return db['SquareRecording'][_0x688e('0x42')](_0x38ab95['body'],{})['then'](respondWithResult(_0x2db429,0xc9))[_0x688e('0x3c')](handleError(_0x2db429,null));};exports['update']=function(_0x18c591,_0x56593a){if(_0x18c591[_0x688e('0x43')]['id']){delete _0x18c591[_0x688e('0x43')]['id'];}return db['SquareRecording'][_0x688e('0x41')]({'where':{'id':_0x18c591[_0x688e('0x3e')]['id']}})[_0x688e('0x1e')](handleEntityNotFound(_0x56593a,null))[_0x688e('0x1e')](saveUpdates(_0x18c591[_0x688e('0x43')],null))[_0x688e('0x1e')](respondWithResult(_0x56593a,null))[_0x688e('0x3c')](handleError(_0x56593a,null));};exports[_0x688e('0x44')]=function(_0xb71ec7,_0x269fef,_0xb5bd6f){var _0x3e9f38=require(_0x688e('0x45'));var _0x513aca=![];var _0x404a5a={};if(_0xb71ec7['query'][_0x688e('0x36')]&&_0xb71ec7['query']['type']===_0x688e('0x46')){_0x404a5a[_0x688e('0x46')]=_0xb71ec7[_0x688e('0x3e')]['id'];}else{_0x404a5a['id']=_0xb71ec7[_0x688e('0x3e')]['id'];}return db[_0x688e('0x24')][_0x688e('0x41')]({'where':_0x404a5a,'attributes':['id',_0x688e('0x47'),_0x688e('0x48')],'raw':!![]})[_0x688e('0x1e')](handleEntityNotFound(_0x269fef,null))[_0x688e('0x1e')](function(_0x1fcf5a){if(_0x1fcf5a){var _0xa86abf=_0x1fcf5a[_0x688e('0x47')];var _0x1d90c4=util[_0x688e('0x49')](_0x688e('0x4a'),_0xa86abf);if(fs[_0x688e('0x4b')](_0x1d90c4)){_0x513aca=!![];return _0x3e9f38[_0x688e('0x4c')](_0x1d90c4,_0xa86abf,config[_0x688e('0x4d')][_0x688e('0x4e')])['then'](function(){return _0x1fcf5a;});}return _0x1fcf5a;}})[_0x688e('0x1e')](function(_0x30aa40){if(_0x30aa40){var _0x7d518b=_0x30aa40[_0x688e('0x47')];if(!fs['existsSync'](_0x7d518b)){throw new db['Sequelize'][(_0x688e('0x4f'))](_0x688e('0x50'));}if(_0x30aa40[_0x688e('0x48')]){return _0x269fef[_0x688e('0x44')](_0x7d518b,_0x30aa40[_0x688e('0x48')]+path[_0x688e('0x51')](_0x7d518b),function(){if(_0x513aca){fs[_0x688e('0x52')](_0x7d518b);}});}else{return _0x269fef[_0x688e('0x44')](_0x7d518b,function(_0x2550bb){if(_0x513aca){fs[_0x688e('0x52')](_0x7d518b);}});}}})[_0x688e('0x3c')](function(_0x111501){if(_0x111501[_0x688e('0x53')]===_0x688e('0x50')){_0x269fef[_0x688e('0x16')](0x194)['send'](_0x688e('0x54'));}else{return handleError(_0x269fef,null);}});};exports['destroy']=function(_0x56ad44,_0x217901){return db[_0x688e('0x24')][_0x688e('0x41')]({'where':{'id':_0x56ad44[_0x688e('0x3e')]['id']}})[_0x688e('0x1e')](function(_0x8ea5e6){if(_['isNil'](_0x8ea5e6)){throw new ReferenceError(_0x688e('0x55'));}return _0x8ea5e6;})[_0x688e('0x1e')](function(_0x153344){var _0x477a53=_0x153344[_0x688e('0x47')];logger[_0x688e('0x56')]('cancellazione\x20fisica\x20documento\x20%s',_0x477a53);if(!_[_0x688e('0x57')](_0x153344['savePath'])&&fs[_0x688e('0x4b')](_0x477a53)){logger[_0x688e('0x56')](_0x688e('0x58')+_0x477a53+_0x688e('0x59'));fs['unlinkSync'](_0x477a53);}_0x477a53=_0x477a53+_0x688e('0x5a');if(!_['isNil'](_0x153344['savePath'])&&fs['existsSync'](_0x477a53)){logger[_0x688e('0x56')](_0x688e('0x58')+_0x477a53+_0x688e('0x59'));fs['unlinkSync'](_0x477a53);}return _0x153344;})[_0x688e('0x1e')](function(_0x59f1d){if(!_0x59f1d)throw new InternalError();return _0x59f1d[_0x688e('0x5b')]();})[_0x688e('0x1e')](function(){_0x217901['status'](0xcc)[_0x688e('0x17')]();})['catch'](handleError(_0x217901,null));}; \ No newline at end of file diff --git a/server/api/squareRecording/squareRecording.model.js b/server/api/squareRecording/squareRecording.model.js index 575bb0e..e9a7a1a 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 _0x1893=['rimraf','./squareRecording.attributes','exports','define','SquareRecording','square_recordings','../../config/logger','api','moment','bluebird','request-promise','path'];(function(_0x481cba,_0x2def2d){var _0x3c5a1b=function(_0x28a3ef){while(--_0x28a3ef){_0x481cba['push'](_0x481cba['shift']());}};_0x3c5a1b(++_0x2def2d);}(_0x1893,0xa2));var _0x3189=function(_0x48961c,_0x280e9d){_0x48961c=_0x48961c-0x0;var _0x1d895d=_0x1893[_0x48961c];return _0x1d895d;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x3189('0x0'))(_0x3189('0x1'));var moment=require(_0x3189('0x2'));var BPromise=require(_0x3189('0x3'));var rp=require(_0x3189('0x4'));var fs=require('fs');var path=require(_0x3189('0x5'));var rimraf=require(_0x3189('0x6'));var config=require('../../config/environment');var attributes=require(_0x3189('0x7'));module[_0x3189('0x8')]=function(_0x2333e6,_0x4080a9){return _0x2333e6[_0x3189('0x9')](_0x3189('0xa'),attributes,{'tableName':_0x3189('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xe829=['define','SquareRecording','util','../../config/logger','api','moment','bluebird','request-promise','rimraf','../../config/environment'];(function(_0x367e89,_0xd42c9){var _0x1685bf=function(_0x521c91){while(--_0x521c91){_0x367e89['push'](_0x367e89['shift']());}};_0x1685bf(++_0xd42c9);}(_0xe829,0xde));var _0x9e82=function(_0x5c8a11,_0x10805f){_0x5c8a11=_0x5c8a11-0x0;var _0x116b22=_0xe829[_0x5c8a11];return _0x116b22;};'use strict';var _=require('lodash');var util=require(_0x9e82('0x0'));var logger=require(_0x9e82('0x1'))(_0x9e82('0x2'));var moment=require(_0x9e82('0x3'));var BPromise=require(_0x9e82('0x4'));var rp=require(_0x9e82('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x9e82('0x6'));var config=require(_0x9e82('0x7'));var attributes=require('./squareRecording.attributes');module['exports']=function(_0x4b8d53,_0x46f5db){return _0x4b8d53[_0x9e82('0x8')](_0x9e82('0x9'),attributes,{'tableName':'square_recordings','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/squareRecording/squareRecording.rpc.js b/server/api/squareRecording/squareRecording.rpc.js index 78f8731..70522b0 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 _0x0374=['message','catch','CreateSquareRecording','SquareRecording','create','options','raw','debug','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','then','info','SquareRecording,\x20%s,\x20%s','request\x20sent','SquareRecording,\x20%s,\x20%s,\x20%s','stringify','error','code'];(function(_0x23acaf,_0x406d90){var _0x16015d=function(_0x1c2066){while(--_0x1c2066){_0x23acaf['push'](_0x23acaf['shift']());}};_0x16015d(++_0x406d90);}(_0x0374,0xf8));var _0x4037=function(_0x1bc180,_0x100e5a){_0x1bc180=_0x1bc180-0x0;var _0x244a4d=_0x0374[_0x1bc180];return _0x244a4d;};'use strict';var _=require(_0x4037('0x0'));var util=require(_0x4037('0x1'));var moment=require(_0x4037('0x2'));var BPromise=require(_0x4037('0x3'));var rs=require(_0x4037('0x4'));var fs=require('fs');var Redis=require(_0x4037('0x5'));var db=require(_0x4037('0x6'))['db'];var utils=require(_0x4037('0x7'));var logger=require(_0x4037('0x8'))(_0x4037('0x9'));var config=require(_0x4037('0xa'));var jayson=require(_0x4037('0xb'));var client=jayson[_0x4037('0xc')][_0x4037('0xd')]({'port':0x232a});function respondWithRpcPromise(_0x448be1,_0xecda1d,_0x1517ef){return new BPromise(function(_0x43928f,_0x6f9a86){return client['request'](_0x448be1,_0x1517ef)[_0x4037('0xe')](function(_0x499089){logger[_0x4037('0xf')](_0x4037('0x10'),_0xecda1d,_0x4037('0x11'));logger['debug'](_0x4037('0x12'),_0xecda1d,_0x4037('0x11'),JSON[_0x4037('0x13')](_0x499089));if(_0x499089[_0x4037('0x14')]){if(_0x499089[_0x4037('0x14')][_0x4037('0x15')]===0x1f4){logger['error'](_0x4037('0x10'),_0xecda1d,_0x499089[_0x4037('0x14')][_0x4037('0x16')]);return _0x6f9a86(_0x499089[_0x4037('0x14')]['message']);}logger[_0x4037('0x14')](_0x4037('0x10'),_0xecda1d,_0x499089['error'][_0x4037('0x16')]);return _0x43928f(_0x499089['error'][_0x4037('0x16')]);}else{logger[_0x4037('0xf')](_0x4037('0x10'),_0xecda1d,_0x4037('0x11'));_0x43928f(_0x499089['result'][_0x4037('0x16')]);}})[_0x4037('0x17')](function(_0x270a62){logger[_0x4037('0x14')]('SquareRecording,\x20%s,\x20%s',_0xecda1d,_0x270a62);_0x6f9a86(_0x270a62);});});}exports[_0x4037('0x18')]=function(_0x23af45){var _0x67effe=this;return new Promise(function(_0x48f259,_0x43fbc9){return db[_0x4037('0x19')][_0x4037('0x1a')](_0x23af45['body'],{'raw':_0x23af45['options']?_0x23af45[_0x4037('0x1b')][_0x4037('0x1c')]===undefined?!![]:![]:!![]})[_0x4037('0xe')](function(_0x18f960){logger[_0x4037('0xf')](_0x4037('0x18'),_0x23af45);logger[_0x4037('0x1d')](_0x4037('0x18'),_0x23af45,JSON[_0x4037('0x13')](_0x18f960));_0x48f259(_0x18f960);})[_0x4037('0x17')](function(_0x52a284){logger[_0x4037('0x14')](_0x4037('0x18'),_0x52a284[_0x4037('0x16')],_0x23af45);_0x43fbc9(_0x67effe['error'](0x1f4,_0x52a284[_0x4037('0x16')]));});});}; \ No newline at end of file +var _0x93a4=['request\x20sent','stringify','error','code','message','info','SquareRecording','create','body','options','raw','then','CreateSquareRecording','debug','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','../../config/environment','jayson/promise','client','request','SquareRecording,\x20%s,\x20%s'];(function(_0x10e91,_0x2d1410){var _0x21c91b=function(_0x355d52){while(--_0x355d52){_0x10e91['push'](_0x10e91['shift']());}};_0x21c91b(++_0x2d1410);}(_0x93a4,0x112));var _0x493a=function(_0x5deac4,_0x4273b6){_0x5deac4=_0x5deac4-0x0;var _0x319b1e=_0x93a4[_0x5deac4];return _0x319b1e;};'use strict';var _=require('lodash');var util=require(_0x493a('0x0'));var moment=require(_0x493a('0x1'));var BPromise=require(_0x493a('0x2'));var rs=require(_0x493a('0x3'));var fs=require('fs');var Redis=require(_0x493a('0x4'));var db=require(_0x493a('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0x493a('0x6'))('rpc');var config=require(_0x493a('0x7'));var jayson=require(_0x493a('0x8'));var client=jayson[_0x493a('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x1ca4d3,_0x1e31f8,_0x4ee08c){return new BPromise(function(_0x389c37,_0x425b20){return client[_0x493a('0xa')](_0x1ca4d3,_0x4ee08c)['then'](function(_0x4448d7){logger['info'](_0x493a('0xb'),_0x1e31f8,_0x493a('0xc'));logger['debug']('SquareRecording,\x20%s,\x20%s,\x20%s',_0x1e31f8,_0x493a('0xc'),JSON[_0x493a('0xd')](_0x4448d7));if(_0x4448d7[_0x493a('0xe')]){if(_0x4448d7[_0x493a('0xe')][_0x493a('0xf')]===0x1f4){logger[_0x493a('0xe')](_0x493a('0xb'),_0x1e31f8,_0x4448d7[_0x493a('0xe')][_0x493a('0x10')]);return _0x425b20(_0x4448d7[_0x493a('0xe')]['message']);}logger[_0x493a('0xe')](_0x493a('0xb'),_0x1e31f8,_0x4448d7['error']['message']);return _0x389c37(_0x4448d7[_0x493a('0xe')][_0x493a('0x10')]);}else{logger[_0x493a('0x11')](_0x493a('0xb'),_0x1e31f8,_0x493a('0xc'));_0x389c37(_0x4448d7['result'][_0x493a('0x10')]);}})['catch'](function(_0x28f150){logger[_0x493a('0xe')](_0x493a('0xb'),_0x1e31f8,_0x28f150);_0x425b20(_0x28f150);});});}exports['CreateSquareRecording']=function(_0x42fa43){var _0x3baa07=this;return new Promise(function(_0x4284c1,_0x3e046b){return db[_0x493a('0x12')][_0x493a('0x13')](_0x42fa43[_0x493a('0x14')],{'raw':_0x42fa43[_0x493a('0x15')]?_0x42fa43['options'][_0x493a('0x16')]===undefined?!![]:![]:!![]})[_0x493a('0x17')](function(_0x5d15c2){logger[_0x493a('0x11')](_0x493a('0x18'),_0x42fa43);logger[_0x493a('0x19')](_0x493a('0x18'),_0x42fa43,JSON[_0x493a('0xd')](_0x5d15c2));_0x4284c1(_0x5d15c2);})['catch'](function(_0xe509d){logger[_0x493a('0xe')](_0x493a('0x18'),_0xe509d[_0x493a('0x10')],_0x42fa43);_0x3e046b(_0x3baa07[_0x493a('0xe')](0x1f4,_0xe509d[_0x493a('0x10')]));});});}; \ No newline at end of file diff --git a/server/api/squareReport/index.js b/server/api/squareReport/index.js index fd934c8..af711df 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(_0x25cc3e,_0x71799b){var _0x13235a=function(_0x8a52ab){while(--_0x8a52ab){_0x25cc3e['push'](_0x25cc3e['shift']());}};_0x13235a(++_0x71799b);}(_0xe706,0xa3));var _0x6e70=function(_0x2ddfd9,_0x5877d0){_0x2ddfd9=_0x2ddfd9-0x0;var _0x2668f0=_0xe706[_0x2ddfd9];return _0x2668f0;};'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(_0x4fdc5f,_0x242ef2){var _0x29e83c=function(_0x14015f){while(--_0x14015f){_0x4fdc5f['push'](_0x4fdc5f['shift']());}};_0x29e83c(++_0x242ef2);}(_0xe706,0xa3));var _0x6e70=function(_0x1f2422,_0x125fd2){_0x1f2422=_0x1f2422-0x0;var _0x4fb420=_0xe706[_0x1f2422];return _0x4fb420;};'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 ecc115b..33d25e9 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 _0x0f07=['DATE','BOOLEAN','sequelize','exports','STRING'];(function(_0x3f3183,_0x1cde60){var _0xae525e=function(_0x3153e7){while(--_0x3153e7){_0x3f3183['push'](_0x3f3183['shift']());}};_0xae525e(++_0x1cde60);}(_0x0f07,0x11a));var _0x70f0=function(_0x559c5e,_0x338b75){_0x559c5e=_0x559c5e-0x0;var _0xa30a50=_0x0f07[_0x559c5e];return _0xa30a50;};'use strict';var Sequelize=require(_0x70f0('0x0'));module[_0x70f0('0x1')]={'network':{'type':Sequelize[_0x70f0('0x2')]},'network_script':{'type':Sequelize[_0x70f0('0x2')]},'request':{'type':Sequelize['STRING']},'channel':{'type':Sequelize[_0x70f0('0x2')]},'language':{'type':Sequelize[_0x70f0('0x2')]},'type':{'type':Sequelize[_0x70f0('0x2')]},'uniqueid':{'type':Sequelize[_0x70f0('0x2')]},'version':{'type':Sequelize[_0x70f0('0x2')]},'callerid':{'type':Sequelize[_0x70f0('0x2')]},'calleridname':{'type':Sequelize[_0x70f0('0x2')]},'callingpres':{'type':Sequelize[_0x70f0('0x2')]},'callingani2':{'type':Sequelize[_0x70f0('0x2')]},'callington':{'type':Sequelize[_0x70f0('0x2')]},'callingtns':{'type':Sequelize['STRING']},'dnid':{'type':Sequelize['STRING']},'rdnis':{'type':Sequelize[_0x70f0('0x2')]},'context':{'type':Sequelize[_0x70f0('0x2')]},'extension':{'type':Sequelize[_0x70f0('0x2')]},'priority':{'type':Sequelize['STRING']},'enhanced':{'type':Sequelize[_0x70f0('0x2')]},'accountcode':{'type':Sequelize[_0x70f0('0x2')]},'threadid':{'type':Sequelize[_0x70f0('0x2')]},'project_name':{'type':Sequelize[_0x70f0('0x2')]},'joinAt':{'type':Sequelize[_0x70f0('0x3')]},'leaveAt':{'type':Sequelize[_0x70f0('0x3')]},'bot':{'type':Sequelize[_0x70f0('0x4')],'defaultValue':![]}}; \ No newline at end of file +var _0xb9bb=['STRING','DATE','sequelize','exports'];(function(_0x19b709,_0x373b44){var _0x29eb28=function(_0x4a66c4){while(--_0x4a66c4){_0x19b709['push'](_0x19b709['shift']());}};_0x29eb28(++_0x373b44);}(_0xb9bb,0x1da));var _0xbb9b=function(_0x19950b,_0x53d0d7){_0x19950b=_0x19950b-0x0;var _0x3c6b41=_0xb9bb[_0x19950b];return _0x3c6b41;};'use strict';var Sequelize=require(_0xbb9b('0x0'));module[_0xbb9b('0x1')]={'network':{'type':Sequelize[_0xbb9b('0x2')]},'network_script':{'type':Sequelize['STRING']},'request':{'type':Sequelize[_0xbb9b('0x2')]},'channel':{'type':Sequelize[_0xbb9b('0x2')]},'language':{'type':Sequelize[_0xbb9b('0x2')]},'type':{'type':Sequelize['STRING']},'uniqueid':{'type':Sequelize[_0xbb9b('0x2')]},'version':{'type':Sequelize[_0xbb9b('0x2')]},'callerid':{'type':Sequelize[_0xbb9b('0x2')]},'calleridname':{'type':Sequelize[_0xbb9b('0x2')]},'callingpres':{'type':Sequelize[_0xbb9b('0x2')]},'callingani2':{'type':Sequelize[_0xbb9b('0x2')]},'callington':{'type':Sequelize['STRING']},'callingtns':{'type':Sequelize[_0xbb9b('0x2')]},'dnid':{'type':Sequelize['STRING']},'rdnis':{'type':Sequelize[_0xbb9b('0x2')]},'context':{'type':Sequelize['STRING']},'extension':{'type':Sequelize[_0xbb9b('0x2')]},'priority':{'type':Sequelize['STRING']},'enhanced':{'type':Sequelize[_0xbb9b('0x2')]},'accountcode':{'type':Sequelize[_0xbb9b('0x2')]},'threadid':{'type':Sequelize[_0xbb9b('0x2')]},'project_name':{'type':Sequelize[_0xbb9b('0x2')]},'joinAt':{'type':Sequelize[_0xbb9b('0x3')]},'leaveAt':{'type':Sequelize[_0xbb9b('0x3')]},'bot':{'type':Sequelize['BOOLEAN'],'defaultValue':![]}}; \ No newline at end of file diff --git a/server/api/squareReport/squareReport.controller.js b/server/api/squareReport/squareReport.controller.js index e65b391..0440f35 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 _0xf972=['../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','status','json','offset','limit','undefined','count','set','Content-Range','apply','update','then','destroy','sendStatus','error','name','send','map','rawAttributes','fieldName','type','model','query','keys','filters','attributes','hasOwnProperty','order','sort','where','pick','filter','merge','SquareReport','includeAll','rows','catch','show','params','intersection','fields','include','options','find','create','body','describe','rimraf','zip-dir','fast-json-patch','request-promise','moment','util','sox','to-csv','lodash','squel','jsforce','desk.js','querystring','ioredis','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api'];(function(_0x3d605e,_0x221c20){var _0xe58b15=function(_0x2266ea){while(--_0x2266ea){_0x3d605e['push'](_0x3d605e['shift']());}};_0xe58b15(++_0x221c20);}(_0xf972,0x76));var _0x2f97=function(_0x121c11,_0x572563){_0x121c11=_0x121c11-0x0;var _0x1c7690=_0xf972[_0x121c11];return _0x1c7690;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x2f97('0x0'));var zipdir=require(_0x2f97('0x1'));var jsonpatch=require(_0x2f97('0x2'));var rp=require(_0x2f97('0x3'));var moment=require(_0x2f97('0x4'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0x2f97('0x5'));var path=require('path');var sox=require(_0x2f97('0x6'));var csv=require(_0x2f97('0x7'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x2f97('0x8'));var squel=require(_0x2f97('0x9'));var crypto=require('crypto');var jsforce=require(_0x2f97('0xa'));var deskjs=require(_0x2f97('0xb'));var toCsv=require('to-csv');var querystring=require(_0x2f97('0xc'));var Papa=require('papaparse');var Redis=require(_0x2f97('0xd'));var authService=require('../../components/auth/service');var qs=require(_0x2f97('0xe'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x2f97('0xf'));var logger=require(_0x2f97('0x10'))(_0x2f97('0x11'));var utils=require(_0x2f97('0x12'));var config=require(_0x2f97('0x13'));var licenseUtil=require(_0x2f97('0x14'));var db=require(_0x2f97('0x15'))['db'];function respondWithStatusCode(_0xbb9925,_0x4f6c3c){_0x4f6c3c=_0x4f6c3c||0xcc;return function(_0x396b2){if(_0x396b2){return _0xbb9925['sendStatus'](_0x4f6c3c);}return _0xbb9925[_0x2f97('0x16')](_0x4f6c3c)['end']();};}function respondWithResult(_0x2530bf,_0x4c2144){_0x4c2144=_0x4c2144||0xc8;return function(_0x1cd895){if(_0x1cd895){return _0x2530bf[_0x2f97('0x16')](_0x4c2144)[_0x2f97('0x17')](_0x1cd895);}};}function respondWithFilteredResult(_0x1cbc4e,_0x2867ce){return function(_0x256c51){if(_0x256c51){var _0xc09dd4=typeof _0x2867ce[_0x2f97('0x18')]==='undefined'&&typeof _0x2867ce[_0x2f97('0x19')]===_0x2f97('0x1a');var _0x13aa8a=_0x256c51['count'];var _0xb437b7=_0xc09dd4?0x0:_0x2867ce[_0x2f97('0x18')];var _0x4aa4d8=_0xc09dd4?_0x256c51[_0x2f97('0x1b')]:_0x2867ce[_0x2f97('0x18')]+_0x2867ce[_0x2f97('0x19')];var _0x3b5d9c;if(_0x4aa4d8>=_0x13aa8a){_0x4aa4d8=_0x13aa8a;_0x3b5d9c=0xc8;}else{_0x3b5d9c=0xce;}_0x1cbc4e[_0x2f97('0x16')](_0x3b5d9c);return _0x1cbc4e[_0x2f97('0x1c')](_0x2f97('0x1d'),_0xb437b7+'-'+_0x4aa4d8+'/'+_0x13aa8a)[_0x2f97('0x17')](_0x256c51);}return null;};}function patchUpdates(_0x1ed358){return function(_0x5c854a){try{jsonpatch[_0x2f97('0x1e')](_0x5c854a,_0x1ed358,!![]);}catch(_0x52456a){return BPromise['reject'](_0x52456a);}return _0x5c854a['save']();};}function saveUpdates(_0x597df4,_0x302b49){return function(_0x56e8ec){if(_0x56e8ec){return _0x56e8ec[_0x2f97('0x1f')](_0x597df4)[_0x2f97('0x20')](function(_0x170e24){return _0x170e24;});}return null;};}function removeEntity(_0x46afff,_0x5b33e7){return function(_0x4b71d5){if(_0x4b71d5){return _0x4b71d5[_0x2f97('0x21')]()[_0x2f97('0x20')](function(){_0x46afff[_0x2f97('0x16')](0xcc)['end']();});}};}function handleEntityNotFound(_0x511b33,_0x2e4436){return function(_0x23de13){if(!_0x23de13){_0x511b33[_0x2f97('0x22')](0x194);}return _0x23de13;};}function handleError(_0x26bf8e,_0x4dfa8f){_0x4dfa8f=_0x4dfa8f||0x1f4;return function(_0x453578){logger[_0x2f97('0x23')](_0x453578['stack']);if(_0x453578[_0x2f97('0x24')]){delete _0x453578[_0x2f97('0x24')];}_0x26bf8e['status'](_0x4dfa8f)[_0x2f97('0x25')](_0x453578);};}exports['index']=function(_0x162208,_0x58a3ef){var _0x253fa6={},_0x275f67={},_0x122f42={'count':0x0,'rows':[]};var _0x4ade9c=_[_0x2f97('0x26')](db['SquareReport'][_0x2f97('0x27')],function(_0x70006){return{'name':_0x70006[_0x2f97('0x28')],'type':_0x70006[_0x2f97('0x29')]['key']};});_0x275f67[_0x2f97('0x2a')]=_[_0x2f97('0x26')](_0x4ade9c,_0x2f97('0x24'));_0x275f67[_0x2f97('0x2b')]=_[_0x2f97('0x2c')](_0x162208[_0x2f97('0x2b')]);_0x275f67[_0x2f97('0x2d')]=_['intersection'](_0x275f67['model'],_0x275f67['query']);_0x253fa6[_0x2f97('0x2e')]=_['intersection'](_0x275f67[_0x2f97('0x2a')],qs['fields'](_0x162208[_0x2f97('0x2b')]['fields']));_0x253fa6[_0x2f97('0x2e')]=_0x253fa6[_0x2f97('0x2e')]['length']?_0x253fa6['attributes']:_0x275f67['model'];if(!_0x162208[_0x2f97('0x2b')][_0x2f97('0x2f')]('nolimit')){_0x253fa6[_0x2f97('0x19')]=qs[_0x2f97('0x19')](_0x162208['query'][_0x2f97('0x19')]);_0x253fa6[_0x2f97('0x18')]=qs[_0x2f97('0x18')](_0x162208[_0x2f97('0x2b')]['offset']);}_0x253fa6[_0x2f97('0x30')]=qs[_0x2f97('0x31')](_0x162208[_0x2f97('0x2b')][_0x2f97('0x31')]);_0x253fa6[_0x2f97('0x32')]=qs['filters'](_[_0x2f97('0x33')](_0x162208['query'],_0x275f67['filters']),_0x4ade9c);if(_0x162208[_0x2f97('0x2b')][_0x2f97('0x34')]){_0x253fa6[_0x2f97('0x32')]=_[_0x2f97('0x35')](_0x253fa6['where'],{'$or':_[_0x2f97('0x26')](_0x4ade9c,function(_0x813219){if(_0x813219[_0x2f97('0x29')]!=='VIRTUAL'){var _0x465ef8={};_0x465ef8[_0x813219['name']]={'$like':'%'+_0x162208[_0x2f97('0x2b')]['filter']+'%'};return _0x465ef8;}})});}_0x253fa6=_[_0x2f97('0x35')]({},_0x253fa6,_0x162208['options']);var _0x30319f={'where':_0x253fa6[_0x2f97('0x32')]};return db[_0x2f97('0x36')][_0x2f97('0x1b')](_0x30319f)[_0x2f97('0x20')](function(_0x4f4af9){_0x122f42[_0x2f97('0x1b')]=_0x4f4af9;if(_0x162208[_0x2f97('0x2b')][_0x2f97('0x37')]){_0x253fa6['include']=[{'all':!![]}];}return db[_0x2f97('0x36')]['findAll'](_0x253fa6);})[_0x2f97('0x20')](function(_0x30edfb){_0x122f42[_0x2f97('0x38')]=_0x30edfb;return _0x122f42;})['then'](respondWithFilteredResult(_0x58a3ef,_0x253fa6))[_0x2f97('0x39')](handleError(_0x58a3ef,null));};exports[_0x2f97('0x3a')]=function(_0x57e1f9,_0x18c726){var _0x387da1={'raw':!![],'where':{'id':_0x57e1f9[_0x2f97('0x3b')]['id']}},_0x3ad9ff={};_0x3ad9ff['model']=_[_0x2f97('0x2c')](db[_0x2f97('0x36')]['rawAttributes']);_0x3ad9ff[_0x2f97('0x2b')]=_['keys'](_0x57e1f9[_0x2f97('0x2b')]);_0x3ad9ff[_0x2f97('0x2d')]=_[_0x2f97('0x3c')](_0x3ad9ff['model'],_0x3ad9ff[_0x2f97('0x2b')]);_0x387da1[_0x2f97('0x2e')]=_[_0x2f97('0x3c')](_0x3ad9ff['model'],qs[_0x2f97('0x3d')](_0x57e1f9[_0x2f97('0x2b')]['fields']));_0x387da1[_0x2f97('0x2e')]=_0x387da1[_0x2f97('0x2e')]['length']?_0x387da1[_0x2f97('0x2e')]:_0x3ad9ff[_0x2f97('0x2a')];if(_0x57e1f9[_0x2f97('0x2b')][_0x2f97('0x37')]){_0x387da1[_0x2f97('0x3e')]=[{'all':!![]}];}_0x387da1=_[_0x2f97('0x35')]({},_0x387da1,_0x57e1f9[_0x2f97('0x3f')]);return db['SquareReport'][_0x2f97('0x40')](_0x387da1)['then'](handleEntityNotFound(_0x18c726,null))[_0x2f97('0x20')](respondWithResult(_0x18c726,null))[_0x2f97('0x39')](handleError(_0x18c726,null));};exports[_0x2f97('0x41')]=function(_0x22fa6f,_0x546e73){return db[_0x2f97('0x36')][_0x2f97('0x41')](_0x22fa6f[_0x2f97('0x42')],{})[_0x2f97('0x20')](respondWithResult(_0x546e73,0xc9))[_0x2f97('0x39')](handleError(_0x546e73,null));};exports[_0x2f97('0x1f')]=function(_0x15b1b8,_0x2268e4){if(_0x15b1b8['body']['id']){delete _0x15b1b8[_0x2f97('0x42')]['id'];}return db[_0x2f97('0x36')]['find']({'where':{'id':_0x15b1b8[_0x2f97('0x3b')]['id']}})['then'](handleEntityNotFound(_0x2268e4,null))[_0x2f97('0x20')](saveUpdates(_0x15b1b8[_0x2f97('0x42')],null))[_0x2f97('0x20')](respondWithResult(_0x2268e4,null))['catch'](handleError(_0x2268e4,null));};exports[_0x2f97('0x21')]=function(_0x3c8250,_0x33d435){return db[_0x2f97('0x36')][_0x2f97('0x40')]({'where':{'id':_0x3c8250[_0x2f97('0x3b')]['id']}})[_0x2f97('0x20')](handleEntityNotFound(_0x33d435,null))['then'](removeEntity(_0x33d435,null))['catch'](handleError(_0x33d435,null));};exports[_0x2f97('0x43')]=function(_0x526db8,_0x3ea43c){return db['SquareReport']['describe']()[_0x2f97('0x20')](respondWithResult(_0x3ea43c,null))[_0x2f97('0x39')](handleError(_0x3ea43c,null));}; \ No newline at end of file +var _0x7dc1=['intersection','attributes','fields','length','nolimit','order','sort','where','filter','merge','VIRTUAL','includeAll','include','findAll','rows','catch','show','options','find','create','body','update','params','destroy','describe','eml-format','rimraf','zip-dir','moment','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','json','offset','undefined','count','limit','set','Content-Range','apply','then','error','stack','name','index','map','SquareReport','rawAttributes','fieldName','type','key','model','query','keys','filters'];(function(_0x3c2851,_0x153c2e){var _0x2d5b4d=function(_0x48b2e7){while(--_0x48b2e7){_0x3c2851['push'](_0x3c2851['shift']());}};_0x2d5b4d(++_0x153c2e);}(_0x7dc1,0x18b));var _0x17dc=function(_0x4e26ff,_0x74df5d){_0x4e26ff=_0x4e26ff-0x0;var _0x37d037=_0x7dc1[_0x4e26ff];return _0x37d037;};'use strict';var emlformat=require(_0x17dc('0x0'));var rimraf=require(_0x17dc('0x1'));var zipdir=require(_0x17dc('0x2'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0x17dc('0x3'));var BPromise=require('bluebird');var Mustache=require(_0x17dc('0x4'));var util=require(_0x17dc('0x5'));var path=require(_0x17dc('0x6'));var sox=require(_0x17dc('0x7'));var csv=require(_0x17dc('0x8'));var ejs=require(_0x17dc('0x9'));var fs=require('fs');var fs_extra=require(_0x17dc('0xa'));var _=require(_0x17dc('0xb'));var squel=require(_0x17dc('0xc'));var crypto=require(_0x17dc('0xd'));var jsforce=require('jsforce');var deskjs=require(_0x17dc('0xe'));var toCsv=require(_0x17dc('0x8'));var querystring=require(_0x17dc('0xf'));var Papa=require(_0x17dc('0x10'));var Redis=require(_0x17dc('0x11'));var authService=require(_0x17dc('0x12'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0x17dc('0x13'))(_0x17dc('0x14'));var utils=require('../../config/utils');var config=require(_0x17dc('0x15'));var licenseUtil=require(_0x17dc('0x16'));var db=require(_0x17dc('0x17'))['db'];function respondWithStatusCode(_0x2bdb05,_0x42fc0d){_0x42fc0d=_0x42fc0d||0xcc;return function(_0x47944a){if(_0x47944a){return _0x2bdb05[_0x17dc('0x18')](_0x42fc0d);}return _0x2bdb05[_0x17dc('0x19')](_0x42fc0d)['end']();};}function respondWithResult(_0x51fffb,_0x52a3f0){_0x52a3f0=_0x52a3f0||0xc8;return function(_0x3e7a89){if(_0x3e7a89){return _0x51fffb[_0x17dc('0x19')](_0x52a3f0)[_0x17dc('0x1a')](_0x3e7a89);}};}function respondWithFilteredResult(_0x413d05,_0x2191fb){return function(_0xb4f678){if(_0xb4f678){var _0x214616=typeof _0x2191fb[_0x17dc('0x1b')]===_0x17dc('0x1c')&&typeof _0x2191fb['limit']==='undefined';var _0x1ded30=_0xb4f678[_0x17dc('0x1d')];var _0x41d379=_0x214616?0x0:_0x2191fb[_0x17dc('0x1b')];var _0x18f90a=_0x214616?_0xb4f678[_0x17dc('0x1d')]:_0x2191fb['offset']+_0x2191fb[_0x17dc('0x1e')];var _0x407fe2;if(_0x18f90a>=_0x1ded30){_0x18f90a=_0x1ded30;_0x407fe2=0xc8;}else{_0x407fe2=0xce;}_0x413d05['status'](_0x407fe2);return _0x413d05[_0x17dc('0x1f')](_0x17dc('0x20'),_0x41d379+'-'+_0x18f90a+'/'+_0x1ded30)[_0x17dc('0x1a')](_0xb4f678);}return null;};}function patchUpdates(_0x9e7689){return function(_0x16b3f4){try{jsonpatch[_0x17dc('0x21')](_0x16b3f4,_0x9e7689,!![]);}catch(_0x14314b){return BPromise['reject'](_0x14314b);}return _0x16b3f4['save']();};}function saveUpdates(_0x4f20a9,_0x460029){return function(_0x9783fe){if(_0x9783fe){return _0x9783fe['update'](_0x4f20a9)['then'](function(_0x588f87){return _0x588f87;});}return null;};}function removeEntity(_0xcc12b0,_0x320cdd){return function(_0x1e1cc1){if(_0x1e1cc1){return _0x1e1cc1['destroy']()[_0x17dc('0x22')](function(){_0xcc12b0[_0x17dc('0x19')](0xcc)['end']();});}};}function handleEntityNotFound(_0x385c82,_0x4535ab){return function(_0x146371){if(!_0x146371){_0x385c82[_0x17dc('0x18')](0x194);}return _0x146371;};}function handleError(_0x2d40e0,_0x3104b0){_0x3104b0=_0x3104b0||0x1f4;return function(_0x3c33f3){logger[_0x17dc('0x23')](_0x3c33f3[_0x17dc('0x24')]);if(_0x3c33f3[_0x17dc('0x25')]){delete _0x3c33f3[_0x17dc('0x25')];}_0x2d40e0[_0x17dc('0x19')](_0x3104b0)['send'](_0x3c33f3);};}exports[_0x17dc('0x26')]=function(_0x196c64,_0x278c50){var _0xb3b9c3={},_0xd84dbc={},_0x3a2709={'count':0x0,'rows':[]};var _0x4494be=_[_0x17dc('0x27')](db[_0x17dc('0x28')][_0x17dc('0x29')],function(_0x3367fb){return{'name':_0x3367fb[_0x17dc('0x2a')],'type':_0x3367fb[_0x17dc('0x2b')][_0x17dc('0x2c')]};});_0xd84dbc[_0x17dc('0x2d')]=_[_0x17dc('0x27')](_0x4494be,_0x17dc('0x25'));_0xd84dbc[_0x17dc('0x2e')]=_[_0x17dc('0x2f')](_0x196c64[_0x17dc('0x2e')]);_0xd84dbc[_0x17dc('0x30')]=_[_0x17dc('0x31')](_0xd84dbc['model'],_0xd84dbc['query']);_0xb3b9c3[_0x17dc('0x32')]=_['intersection'](_0xd84dbc[_0x17dc('0x2d')],qs[_0x17dc('0x33')](_0x196c64[_0x17dc('0x2e')][_0x17dc('0x33')]));_0xb3b9c3['attributes']=_0xb3b9c3['attributes'][_0x17dc('0x34')]?_0xb3b9c3[_0x17dc('0x32')]:_0xd84dbc['model'];if(!_0x196c64[_0x17dc('0x2e')]['hasOwnProperty'](_0x17dc('0x35'))){_0xb3b9c3['limit']=qs[_0x17dc('0x1e')](_0x196c64['query'][_0x17dc('0x1e')]);_0xb3b9c3[_0x17dc('0x1b')]=qs[_0x17dc('0x1b')](_0x196c64[_0x17dc('0x2e')][_0x17dc('0x1b')]);}_0xb3b9c3[_0x17dc('0x36')]=qs[_0x17dc('0x37')](_0x196c64[_0x17dc('0x2e')]['sort']);_0xb3b9c3[_0x17dc('0x38')]=qs[_0x17dc('0x30')](_['pick'](_0x196c64[_0x17dc('0x2e')],_0xd84dbc['filters']),_0x4494be);if(_0x196c64[_0x17dc('0x2e')][_0x17dc('0x39')]){_0xb3b9c3[_0x17dc('0x38')]=_[_0x17dc('0x3a')](_0xb3b9c3[_0x17dc('0x38')],{'$or':_[_0x17dc('0x27')](_0x4494be,function(_0x573e21){if(_0x573e21[_0x17dc('0x2b')]!==_0x17dc('0x3b')){var _0x145e01={};_0x145e01[_0x573e21['name']]={'$like':'%'+_0x196c64[_0x17dc('0x2e')][_0x17dc('0x39')]+'%'};return _0x145e01;}})});}_0xb3b9c3=_['merge']({},_0xb3b9c3,_0x196c64['options']);var _0x30cdda={'where':_0xb3b9c3[_0x17dc('0x38')]};return db[_0x17dc('0x28')]['count'](_0x30cdda)[_0x17dc('0x22')](function(_0x1b53bb){_0x3a2709[_0x17dc('0x1d')]=_0x1b53bb;if(_0x196c64[_0x17dc('0x2e')][_0x17dc('0x3c')]){_0xb3b9c3[_0x17dc('0x3d')]=[{'all':!![]}];}return db[_0x17dc('0x28')][_0x17dc('0x3e')](_0xb3b9c3);})[_0x17dc('0x22')](function(_0x2d4b8d){_0x3a2709[_0x17dc('0x3f')]=_0x2d4b8d;return _0x3a2709;})[_0x17dc('0x22')](respondWithFilteredResult(_0x278c50,_0xb3b9c3))[_0x17dc('0x40')](handleError(_0x278c50,null));};exports[_0x17dc('0x41')]=function(_0x29c653,_0x31048a){var _0x1b287d={'raw':!![],'where':{'id':_0x29c653['params']['id']}},_0x213bd2={};_0x213bd2[_0x17dc('0x2d')]=_[_0x17dc('0x2f')](db['SquareReport']['rawAttributes']);_0x213bd2[_0x17dc('0x2e')]=_[_0x17dc('0x2f')](_0x29c653['query']);_0x213bd2[_0x17dc('0x30')]=_[_0x17dc('0x31')](_0x213bd2['model'],_0x213bd2[_0x17dc('0x2e')]);_0x1b287d[_0x17dc('0x32')]=_[_0x17dc('0x31')](_0x213bd2[_0x17dc('0x2d')],qs[_0x17dc('0x33')](_0x29c653['query'][_0x17dc('0x33')]));_0x1b287d[_0x17dc('0x32')]=_0x1b287d[_0x17dc('0x32')][_0x17dc('0x34')]?_0x1b287d[_0x17dc('0x32')]:_0x213bd2[_0x17dc('0x2d')];if(_0x29c653[_0x17dc('0x2e')]['includeAll']){_0x1b287d['include']=[{'all':!![]}];}_0x1b287d=_[_0x17dc('0x3a')]({},_0x1b287d,_0x29c653[_0x17dc('0x42')]);return db[_0x17dc('0x28')][_0x17dc('0x43')](_0x1b287d)[_0x17dc('0x22')](handleEntityNotFound(_0x31048a,null))['then'](respondWithResult(_0x31048a,null))[_0x17dc('0x40')](handleError(_0x31048a,null));};exports[_0x17dc('0x44')]=function(_0x562118,_0x4d1abd){return db[_0x17dc('0x28')][_0x17dc('0x44')](_0x562118[_0x17dc('0x45')],{})['then'](respondWithResult(_0x4d1abd,0xc9))[_0x17dc('0x40')](handleError(_0x4d1abd,null));};exports[_0x17dc('0x46')]=function(_0x1023e2,_0x2fa411){if(_0x1023e2[_0x17dc('0x45')]['id']){delete _0x1023e2[_0x17dc('0x45')]['id'];}return db[_0x17dc('0x28')][_0x17dc('0x43')]({'where':{'id':_0x1023e2[_0x17dc('0x47')]['id']}})['then'](handleEntityNotFound(_0x2fa411,null))[_0x17dc('0x22')](saveUpdates(_0x1023e2[_0x17dc('0x45')],null))[_0x17dc('0x22')](respondWithResult(_0x2fa411,null))[_0x17dc('0x40')](handleError(_0x2fa411,null));};exports[_0x17dc('0x48')]=function(_0x573431,_0x2e9642){return db[_0x17dc('0x28')][_0x17dc('0x43')]({'where':{'id':_0x573431[_0x17dc('0x47')]['id']}})[_0x17dc('0x22')](handleEntityNotFound(_0x2e9642,null))[_0x17dc('0x22')](removeEntity(_0x2e9642,null))['catch'](handleError(_0x2e9642,null));};exports[_0x17dc('0x49')]=function(_0x77f7f1,_0x4989d0){return db[_0x17dc('0x28')][_0x17dc('0x49')]()[_0x17dc('0x22')](respondWithResult(_0x4989d0,null))['catch'](handleError(_0x4989d0,null));}; \ No newline at end of file diff --git a/server/api/squareReport/squareReport.model.js b/server/api/squareReport/squareReport.model.js index 5d77e3f..dfabfa3 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 _0x07aa=['leaveAt','lodash','util','../../config/logger','request-promise','path','rimraf','../../config/environment','./squareReport.attributes','exports','define','SquareReport','report_square','uid_pname','uniqueid','project_name'];(function(_0x70c97a,_0xd4d263){var _0x5cb362=function(_0x163f30){while(--_0x163f30){_0x70c97a['push'](_0x70c97a['shift']());}};_0x5cb362(++_0xd4d263);}(_0x07aa,0x91));var _0xa07a=function(_0x89133b,_0x16e7b0){_0x89133b=_0x89133b-0x0;var _0x13cee4=_0x07aa[_0x89133b];return _0x13cee4;};'use strict';var _=require(_0xa07a('0x0'));var util=require(_0xa07a('0x1'));var logger=require(_0xa07a('0x2'))('api');var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0xa07a('0x3'));var fs=require('fs');var path=require(_0xa07a('0x4'));var rimraf=require(_0xa07a('0x5'));var config=require(_0xa07a('0x6'));var attributes=require(_0xa07a('0x7'));module[_0xa07a('0x8')]=function(_0x155e8f,_0x41d16c){return _0x155e8f[_0xa07a('0x9')](_0xa07a('0xa'),attributes,{'tableName':_0xa07a('0xb'),'paranoid':![],'indexes':[{'name':_0xa07a('0xc'),'fields':[_0xa07a('0xd'),_0xa07a('0xe')]},{'name':_0xa07a('0xf'),'fields':['leaveAt']}],'timestamps':!![]});}; \ No newline at end of file +var _0x8ad9=['uniqueid','leaveAt','lodash','../../config/logger','moment','bluebird','request-promise','path','rimraf','exports','report_square'];(function(_0x44ab4a,_0x28b2c4){var _0x382314=function(_0x4bb4d3){while(--_0x4bb4d3){_0x44ab4a['push'](_0x44ab4a['shift']());}};_0x382314(++_0x28b2c4);}(_0x8ad9,0x65));var _0x98ad=function(_0x31a371,_0x50828e){_0x31a371=_0x31a371-0x0;var _0x2a5bd6=_0x8ad9[_0x31a371];return _0x2a5bd6;};'use strict';var _=require(_0x98ad('0x0'));var util=require('util');var logger=require(_0x98ad('0x1'))('api');var moment=require(_0x98ad('0x2'));var BPromise=require(_0x98ad('0x3'));var rp=require(_0x98ad('0x4'));var fs=require('fs');var path=require(_0x98ad('0x5'));var rimraf=require(_0x98ad('0x6'));var config=require('../../config/environment');var attributes=require('./squareReport.attributes');module[_0x98ad('0x7')]=function(_0x4b6996,_0x17e15c){return _0x4b6996['define']('SquareReport',attributes,{'tableName':_0x98ad('0x8'),'paranoid':![],'indexes':[{'name':'uid_pname','fields':[_0x98ad('0x9'),'project_name']},{'name':_0x98ad('0xa'),'fields':[_0x98ad('0xa')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/squareReport/squareReport.rpc.js b/server/api/squareReport/squareReport.rpc.js index f619d32..5ed2fd1 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 _0x1ef1=['where','limit','util','randomstring','ioredis','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','request','info','SquareReport,\x20%s,\x20%s','request\x20sent','debug','SquareReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','SquareReport','create','body','options','then','CreateSquareReport','UpdateSquareReport','update','raw'];(function(_0x27af45,_0x1b57aa){var _0x18df21=function(_0x4b7679){while(--_0x4b7679){_0x27af45['push'](_0x27af45['shift']());}};_0x18df21(++_0x1b57aa);}(_0x1ef1,0xc2));var _0x11ef=function(_0x2d9ef9,_0x40182b){_0x2d9ef9=_0x2d9ef9-0x0;var _0x35ffd1=_0x1ef1[_0x2d9ef9];return _0x35ffd1;};'use strict';var _=require('lodash');var util=require(_0x11ef('0x0'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0x11ef('0x1'));var fs=require('fs');var Redis=require(_0x11ef('0x2'));var db=require('../../mysqldb')['db'];var utils=require(_0x11ef('0x3'));var logger=require('../../config/logger')(_0x11ef('0x4'));var config=require(_0x11ef('0x5'));var jayson=require(_0x11ef('0x6'));var client=jayson[_0x11ef('0x7')][_0x11ef('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x20acaa,_0x16288d,_0x427547){return new BPromise(function(_0xaacf40,_0x14db5b){return client[_0x11ef('0x9')](_0x20acaa,_0x427547)['then'](function(_0x1947d9){logger[_0x11ef('0xa')](_0x11ef('0xb'),_0x16288d,_0x11ef('0xc'));logger[_0x11ef('0xd')](_0x11ef('0xe'),_0x16288d,'request\x20sent',JSON[_0x11ef('0xf')](_0x1947d9));if(_0x1947d9[_0x11ef('0x10')]){if(_0x1947d9[_0x11ef('0x10')][_0x11ef('0x11')]===0x1f4){logger[_0x11ef('0x10')](_0x11ef('0xb'),_0x16288d,_0x1947d9['error'][_0x11ef('0x12')]);return _0x14db5b(_0x1947d9['error'][_0x11ef('0x12')]);}logger[_0x11ef('0x10')]('SquareReport,\x20%s,\x20%s',_0x16288d,_0x1947d9[_0x11ef('0x10')][_0x11ef('0x12')]);return _0xaacf40(_0x1947d9['error'][_0x11ef('0x12')]);}else{logger[_0x11ef('0xa')](_0x11ef('0xb'),_0x16288d,_0x11ef('0xc'));_0xaacf40(_0x1947d9[_0x11ef('0x13')]['message']);}})[_0x11ef('0x14')](function(_0x3e4e35){logger['error']('SquareReport,\x20%s,\x20%s',_0x16288d,_0x3e4e35);_0x14db5b(_0x3e4e35);});});}exports['CreateSquareReport']=function(_0x5e588b){var _0x1e8ba7=this;return new Promise(function(_0x43abb2,_0xa03f34){return db[_0x11ef('0x15')][_0x11ef('0x16')](_0x5e588b[_0x11ef('0x17')],{'raw':_0x5e588b[_0x11ef('0x18')]?_0x5e588b[_0x11ef('0x18')]['raw']===undefined?!![]:![]:!![]})[_0x11ef('0x19')](function(_0x348ba2){logger[_0x11ef('0xa')]('CreateSquareReport',_0x5e588b);logger[_0x11ef('0xd')](_0x11ef('0x1a'),_0x5e588b,JSON['stringify'](_0x348ba2));_0x43abb2(_0x348ba2);})['catch'](function(_0x36dbe6){logger[_0x11ef('0x10')](_0x11ef('0x1a'),_0x36dbe6[_0x11ef('0x12')],_0x5e588b);_0xa03f34(_0x1e8ba7[_0x11ef('0x10')](0x1f4,_0x36dbe6[_0x11ef('0x12')]));});});};exports[_0x11ef('0x1b')]=function(_0x57a588){var _0x1dea87=this;return new Promise(function(_0x29b320,_0x1e3a9a){return db[_0x11ef('0x15')][_0x11ef('0x1c')](_0x57a588[_0x11ef('0x17')],{'raw':_0x57a588[_0x11ef('0x18')]?_0x57a588[_0x11ef('0x18')][_0x11ef('0x1d')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x57a588[_0x11ef('0x18')]?_0x57a588['options'][_0x11ef('0x1e')]||null:null,'attributes':_0x57a588[_0x11ef('0x18')]?_0x57a588[_0x11ef('0x18')]['attributes']||null:null,'limit':_0x57a588[_0x11ef('0x18')]?_0x57a588['options'][_0x11ef('0x1f')]||null:null})[_0x11ef('0x19')](function(_0x2e42eb){logger[_0x11ef('0xa')](_0x11ef('0x1b'),_0x57a588);logger['debug']('UpdateSquareReport',_0x57a588,JSON[_0x11ef('0xf')](_0x2e42eb));_0x29b320(_0x2e42eb);})['catch'](function(_0x576f4f){logger[_0x11ef('0x10')](_0x11ef('0x1b'),_0x576f4f[_0x11ef('0x12')],_0x57a588);_0x1e3a9a(_0x1dea87[_0x11ef('0x10')](0x1f4,_0x576f4f[_0x11ef('0x12')]));});});}; \ No newline at end of file +var _0xd0f4=['bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','request','then','info','SquareReport,\x20%s,\x20%s','debug','SquareReport,\x20%s,\x20%s,\x20%s','stringify','code','error','message','result','catch','CreateSquareReport','create','body','options','raw','where','UpdateSquareReport','lodash','util','moment'];(function(_0x6d8984,_0x1f9164){var _0x43ea50=function(_0x50d4b1){while(--_0x50d4b1){_0x6d8984['push'](_0x6d8984['shift']());}};_0x43ea50(++_0x1f9164);}(_0xd0f4,0x13d));var _0x4d0f=function(_0x5572ea,_0xb0a1f6){_0x5572ea=_0x5572ea-0x0;var _0x4397cd=_0xd0f4[_0x5572ea];return _0x4397cd;};'use strict';var _=require(_0x4d0f('0x0'));var util=require(_0x4d0f('0x1'));var moment=require(_0x4d0f('0x2'));var BPromise=require(_0x4d0f('0x3'));var rs=require(_0x4d0f('0x4'));var fs=require('fs');var Redis=require(_0x4d0f('0x5'));var db=require(_0x4d0f('0x6'))['db'];var utils=require(_0x4d0f('0x7'));var logger=require(_0x4d0f('0x8'))(_0x4d0f('0x9'));var config=require('../../config/environment');var jayson=require(_0x4d0f('0xa'));var client=jayson[_0x4d0f('0xb')][_0x4d0f('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x1db863,_0x1842ab,_0x8994b4){return new BPromise(function(_0x1b872a,_0x1f1a50){return client[_0x4d0f('0xd')](_0x1db863,_0x8994b4)[_0x4d0f('0xe')](function(_0x100ee2){logger[_0x4d0f('0xf')](_0x4d0f('0x10'),_0x1842ab,'request\x20sent');logger[_0x4d0f('0x11')](_0x4d0f('0x12'),_0x1842ab,'request\x20sent',JSON[_0x4d0f('0x13')](_0x100ee2));if(_0x100ee2['error']){if(_0x100ee2['error'][_0x4d0f('0x14')]===0x1f4){logger[_0x4d0f('0x15')](_0x4d0f('0x10'),_0x1842ab,_0x100ee2['error'][_0x4d0f('0x16')]);return _0x1f1a50(_0x100ee2[_0x4d0f('0x15')][_0x4d0f('0x16')]);}logger[_0x4d0f('0x15')](_0x4d0f('0x10'),_0x1842ab,_0x100ee2[_0x4d0f('0x15')][_0x4d0f('0x16')]);return _0x1b872a(_0x100ee2[_0x4d0f('0x15')]['message']);}else{logger[_0x4d0f('0xf')](_0x4d0f('0x10'),_0x1842ab,'request\x20sent');_0x1b872a(_0x100ee2[_0x4d0f('0x17')][_0x4d0f('0x16')]);}})[_0x4d0f('0x18')](function(_0x53c41d){logger['error'](_0x4d0f('0x10'),_0x1842ab,_0x53c41d);_0x1f1a50(_0x53c41d);});});}exports[_0x4d0f('0x19')]=function(_0x13fedf){var _0x59fcb2=this;return new Promise(function(_0x47184f,_0x5cfea6){return db['SquareReport'][_0x4d0f('0x1a')](_0x13fedf[_0x4d0f('0x1b')],{'raw':_0x13fedf[_0x4d0f('0x1c')]?_0x13fedf[_0x4d0f('0x1c')]['raw']===undefined?!![]:![]:!![]})[_0x4d0f('0xe')](function(_0x4a058c){logger[_0x4d0f('0xf')](_0x4d0f('0x19'),_0x13fedf);logger[_0x4d0f('0x11')](_0x4d0f('0x19'),_0x13fedf,JSON['stringify'](_0x4a058c));_0x47184f(_0x4a058c);})[_0x4d0f('0x18')](function(_0x5bbf9f){logger['error'](_0x4d0f('0x19'),_0x5bbf9f[_0x4d0f('0x16')],_0x13fedf);_0x5cfea6(_0x59fcb2[_0x4d0f('0x15')](0x1f4,_0x5bbf9f[_0x4d0f('0x16')]));});});};exports['UpdateSquareReport']=function(_0x335744){var _0x297d75=this;return new Promise(function(_0x3bd3f1,_0x296cee){return db['SquareReport']['update'](_0x335744[_0x4d0f('0x1b')],{'raw':_0x335744[_0x4d0f('0x1c')]?_0x335744['options'][_0x4d0f('0x1d')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x335744['options']?_0x335744['options'][_0x4d0f('0x1e')]||null:null,'attributes':_0x335744[_0x4d0f('0x1c')]?_0x335744['options']['attributes']||null:null,'limit':_0x335744['options']?_0x335744['options']['limit']||null:null})['then'](function(_0x1a4cd7){logger['info'](_0x4d0f('0x1f'),_0x335744);logger[_0x4d0f('0x11')](_0x4d0f('0x1f'),_0x335744,JSON[_0x4d0f('0x13')](_0x1a4cd7));_0x3bd3f1(_0x1a4cd7);})['catch'](function(_0x3149c9){logger[_0x4d0f('0x15')](_0x4d0f('0x1f'),_0x3149c9[_0x4d0f('0x16')],_0x335744);_0x296cee(_0x297d75[_0x4d0f('0x15')](0x1f4,_0x3149c9[_0x4d0f('0x16')]));});});}; \ No newline at end of file diff --git a/server/api/squareReportDetail/index.js b/server/api/squareReportDetail/index.js index c0ac1fa..79ad5a1 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 _0xbc8f=['update','destroy','exports','multer','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../config/environment','./squareReportDetail.controller','get','isAuthenticated','index','/describe','describe','show','create','/:id'];(function(_0x4e9ff6,_0x28642d){var _0x59c86f=function(_0x255969){while(--_0x255969){_0x4e9ff6['push'](_0x4e9ff6['shift']());}};_0x59c86f(++_0x28642d);}(_0xbc8f,0xc1));var _0xfbc8=function(_0xb99709,_0x126f51){_0xb99709=_0xb99709-0x0;var _0x487f55=_0xbc8f[_0xb99709];return _0x487f55;};'use strict';var multer=require(_0xfbc8('0x0'));var util=require('util');var path=require(_0xfbc8('0x1'));var timeout=require(_0xfbc8('0x2'));var express=require('express');var router=express[_0xfbc8('0x3')]();var fs_extra=require(_0xfbc8('0x4'));var auth=require(_0xfbc8('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0xfbc8('0x6'));var controller=require(_0xfbc8('0x7'));router[_0xfbc8('0x8')]('/',auth[_0xfbc8('0x9')](),controller[_0xfbc8('0xa')]);router[_0xfbc8('0x8')](_0xfbc8('0xb'),auth[_0xfbc8('0x9')](),controller[_0xfbc8('0xc')]);router['get']('/:id',auth[_0xfbc8('0x9')](),controller[_0xfbc8('0xd')]);router['post']('/',auth[_0xfbc8('0x9')](),controller[_0xfbc8('0xe')]);router['put'](_0xfbc8('0xf'),auth[_0xfbc8('0x9')](),controller[_0xfbc8('0x10')]);router['delete'](_0xfbc8('0xf'),auth['isAuthenticated'](),controller[_0xfbc8('0x11')]);module[_0xfbc8('0x12')]=router; \ No newline at end of file +var _0x0b97=['connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./squareReportDetail.controller','isAuthenticated','index','get','/describe','describe','/:id','show','post','put','update','delete','destroy','exports','multer','path'];(function(_0x57b54c,_0x54ce0d){var _0x59cc19=function(_0xa33bc6){while(--_0xa33bc6){_0x57b54c['push'](_0x57b54c['shift']());}};_0x59cc19(++_0x54ce0d);}(_0x0b97,0x15e));var _0x70b9=function(_0x19e35c,_0x29cd1e){_0x19e35c=_0x19e35c-0x0;var _0x3e1fe8=_0x0b97[_0x19e35c];return _0x3e1fe8;};'use strict';var multer=require(_0x70b9('0x0'));var util=require('util');var path=require(_0x70b9('0x1'));var timeout=require(_0x70b9('0x2'));var express=require(_0x70b9('0x3'));var router=express['Router']();var fs_extra=require(_0x70b9('0x4'));var auth=require(_0x70b9('0x5'));var interaction=require(_0x70b9('0x6'));var config=require(_0x70b9('0x7'));var controller=require(_0x70b9('0x8'));router['get']('/',auth[_0x70b9('0x9')](),controller[_0x70b9('0xa')]);router[_0x70b9('0xb')](_0x70b9('0xc'),auth[_0x70b9('0x9')](),controller[_0x70b9('0xd')]);router[_0x70b9('0xb')](_0x70b9('0xe'),auth[_0x70b9('0x9')](),controller[_0x70b9('0xf')]);router[_0x70b9('0x10')]('/',auth[_0x70b9('0x9')](),controller['create']);router[_0x70b9('0x11')](_0x70b9('0xe'),auth[_0x70b9('0x9')](),controller[_0x70b9('0x12')]);router[_0x70b9('0x13')]('/:id',auth[_0x70b9('0x9')](),controller[_0x70b9('0x14')]);module[_0x70b9('0x15')]=router; \ No newline at end of file diff --git a/server/api/squareReportDetail/squareReportDetail.attributes.js b/server/api/squareReportDetail/squareReportDetail.attributes.js index ca0a5ff..37faf88 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 _0xb89a=['sequelize','exports','STRING','TEXT'];(function(_0x541820,_0x21b860){var _0x3603e2=function(_0x4137fa){while(--_0x4137fa){_0x541820['push'](_0x541820['shift']());}};_0x3603e2(++_0x21b860);}(_0xb89a,0x9c));var _0xab89=function(_0x262c39,_0x14b574){_0x262c39=_0x262c39-0x0;var _0x371d00=_0xb89a[_0x262c39];return _0x371d00;};'use strict';var Sequelize=require(_0xab89('0x0'));module[_0xab89('0x1')]={'uniqueid':{'type':Sequelize[_0xab89('0x2')]},'node':{'type':Sequelize[_0xab89('0x2')]},'application':{'type':Sequelize[_0xab89('0x2')]},'data':{'type':Sequelize[_0xab89('0x3')]},'project_name':{'type':Sequelize[_0xab89('0x2')]},'callerid':{'type':Sequelize[_0xab89('0x2')]}}; \ No newline at end of file +var _0xaf9a=['STRING','TEXT','exports'];(function(_0x1dfbf0,_0x25aa11){var _0x248732=function(_0x322ab7){while(--_0x322ab7){_0x1dfbf0['push'](_0x1dfbf0['shift']());}};_0x248732(++_0x25aa11);}(_0xaf9a,0x98));var _0xaaf9=function(_0x1b2f4f,_0x327750){_0x1b2f4f=_0x1b2f4f-0x0;var _0x2bee31=_0xaf9a[_0x1b2f4f];return _0x2bee31;};'use strict';var Sequelize=require('sequelize');module[_0xaaf9('0x0')]={'uniqueid':{'type':Sequelize['STRING']},'node':{'type':Sequelize[_0xaaf9('0x1')]},'application':{'type':Sequelize[_0xaaf9('0x1')]},'data':{'type':Sequelize[_0xaaf9('0x2')]},'project_name':{'type':Sequelize['STRING']},'callerid':{'type':Sequelize[_0xaaf9('0x1')]}}; \ No newline at end of file diff --git a/server/api/squareReportDetail/squareReportDetail.controller.js b/server/api/squareReportDetail/squareReportDetail.controller.js index 3dfad5f..8b8b5f1 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 _0x621a=['save','update','destroy','then','error','send','index','SquareDetailsReport','rawAttributes','type','key','model','map','name','query','filters','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','where','pick','filter','VIRTUAL','merge','options','include','findAll','rows','catch','show','params','length','includeAll','create','body','find','describe','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','jsforce','desk.js','querystring','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','api','../../config/utils','../../config/environment','../../mysqldb','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject'];(function(_0x12572d,_0x1d44c3){var _0x14bdfa=function(_0x364fde){while(--_0x364fde){_0x12572d['push'](_0x12572d['shift']());}};_0x14bdfa(++_0x1d44c3);}(_0x621a,0x76));var _0xa621=function(_0x11c30d,_0x566175){_0x11c30d=_0x11c30d-0x0;var _0x43c1b3=_0x621a[_0x11c30d];return _0x43c1b3;};'use strict';var emlformat=require(_0xa621('0x0'));var rimraf=require(_0xa621('0x1'));var zipdir=require(_0xa621('0x2'));var jsonpatch=require(_0xa621('0x3'));var rp=require(_0xa621('0x4'));var moment=require(_0xa621('0x5'));var BPromise=require('bluebird');var Mustache=require(_0xa621('0x6'));var util=require(_0xa621('0x7'));var path=require(_0xa621('0x8'));var sox=require(_0xa621('0x9'));var csv=require(_0xa621('0xa'));var ejs=require(_0xa621('0xb'));var fs=require('fs');var fs_extra=require(_0xa621('0xc'));var _=require(_0xa621('0xd'));var squel=require(_0xa621('0xe'));var crypto=require('crypto');var jsforce=require(_0xa621('0xf'));var deskjs=require(_0xa621('0x10'));var toCsv=require('to-csv');var querystring=require(_0xa621('0x11'));var Papa=require('papaparse');var Redis=require(_0xa621('0x12'));var authService=require('../../components/auth/service');var qs=require(_0xa621('0x13'));var as=require(_0xa621('0x14'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0xa621('0x15'));var utils=require(_0xa621('0x16'));var config=require(_0xa621('0x17'));var licenseUtil=require('../../config/license/util');var db=require(_0xa621('0x18'))['db'];function respondWithStatusCode(_0x1d9eda,_0x418ec5){_0x418ec5=_0x418ec5||0xcc;return function(_0x469504){if(_0x469504){return _0x1d9eda['sendStatus'](_0x418ec5);}return _0x1d9eda[_0xa621('0x19')](_0x418ec5)[_0xa621('0x1a')]();};}function respondWithResult(_0x5bbea4,_0x13cbde){_0x13cbde=_0x13cbde||0xc8;return function(_0x7f1f7c){if(_0x7f1f7c){return _0x5bbea4[_0xa621('0x19')](_0x13cbde)[_0xa621('0x1b')](_0x7f1f7c);}};}function respondWithFilteredResult(_0xb68dae,_0x48ccd6){return function(_0x149d5a){if(_0x149d5a){var _0x23d37c=typeof _0x48ccd6[_0xa621('0x1c')]===_0xa621('0x1d')&&typeof _0x48ccd6[_0xa621('0x1e')]===_0xa621('0x1d');var _0x42f75a=_0x149d5a[_0xa621('0x1f')];var _0x15e589=_0x23d37c?0x0:_0x48ccd6[_0xa621('0x1c')];var _0x2ee36d=_0x23d37c?_0x149d5a[_0xa621('0x1f')]:_0x48ccd6[_0xa621('0x1c')]+_0x48ccd6[_0xa621('0x1e')];var _0x16f82b;if(_0x2ee36d>=_0x42f75a){_0x2ee36d=_0x42f75a;_0x16f82b=0xc8;}else{_0x16f82b=0xce;}_0xb68dae[_0xa621('0x19')](_0x16f82b);return _0xb68dae[_0xa621('0x20')](_0xa621('0x21'),_0x15e589+'-'+_0x2ee36d+'/'+_0x42f75a)['json'](_0x149d5a);}return null;};}function patchUpdates(_0x56747f){return function(_0x1bef88){try{jsonpatch[_0xa621('0x22')](_0x1bef88,_0x56747f,!![]);}catch(_0xafefe1){return BPromise[_0xa621('0x23')](_0xafefe1);}return _0x1bef88[_0xa621('0x24')]();};}function saveUpdates(_0x67f021,_0x1fa3ce){return function(_0x15191e){if(_0x15191e){return _0x15191e[_0xa621('0x25')](_0x67f021)['then'](function(_0x30d55a){return _0x30d55a;});}return null;};}function removeEntity(_0x3aa39f,_0x40aa59){return function(_0x1ae2cb){if(_0x1ae2cb){return _0x1ae2cb[_0xa621('0x26')]()[_0xa621('0x27')](function(){_0x3aa39f[_0xa621('0x19')](0xcc)[_0xa621('0x1a')]();});}};}function handleEntityNotFound(_0x26f976,_0x3146a0){return function(_0x404647){if(!_0x404647){_0x26f976['sendStatus'](0x194);}return _0x404647;};}function handleError(_0x32f05a,_0x573cb4){_0x573cb4=_0x573cb4||0x1f4;return function(_0x39d61b){logger[_0xa621('0x28')](_0x39d61b['stack']);if(_0x39d61b['name']){delete _0x39d61b['name'];}_0x32f05a[_0xa621('0x19')](_0x573cb4)[_0xa621('0x29')](_0x39d61b);};}exports[_0xa621('0x2a')]=function(_0x37cc1d,_0x42561a){var _0x27dc1b={},_0x2dd4b6={},_0x261053={'count':0x0,'rows':[]};var _0x11a0d6=_['map'](db[_0xa621('0x2b')][_0xa621('0x2c')],function(_0x4fefc3){return{'name':_0x4fefc3['fieldName'],'type':_0x4fefc3[_0xa621('0x2d')][_0xa621('0x2e')]};});_0x2dd4b6[_0xa621('0x2f')]=_[_0xa621('0x30')](_0x11a0d6,_0xa621('0x31'));_0x2dd4b6['query']=_['keys'](_0x37cc1d[_0xa621('0x32')]);_0x2dd4b6[_0xa621('0x33')]=_[_0xa621('0x34')](_0x2dd4b6[_0xa621('0x2f')],_0x2dd4b6['query']);_0x27dc1b[_0xa621('0x35')]=_[_0xa621('0x34')](_0x2dd4b6[_0xa621('0x2f')],qs[_0xa621('0x36')](_0x37cc1d[_0xa621('0x32')][_0xa621('0x36')]));_0x27dc1b['attributes']=_0x27dc1b[_0xa621('0x35')]['length']?_0x27dc1b[_0xa621('0x35')]:_0x2dd4b6[_0xa621('0x2f')];if(!_0x37cc1d[_0xa621('0x32')][_0xa621('0x37')](_0xa621('0x38'))){_0x27dc1b[_0xa621('0x1e')]=qs['limit'](_0x37cc1d[_0xa621('0x32')][_0xa621('0x1e')]);_0x27dc1b[_0xa621('0x1c')]=qs[_0xa621('0x1c')](_0x37cc1d['query']['offset']);}_0x27dc1b[_0xa621('0x39')]=qs[_0xa621('0x3a')](_0x37cc1d[_0xa621('0x32')][_0xa621('0x3a')]);_0x27dc1b[_0xa621('0x3b')]=qs[_0xa621('0x33')](_[_0xa621('0x3c')](_0x37cc1d['query'],_0x2dd4b6[_0xa621('0x33')]),_0x11a0d6);if(_0x37cc1d[_0xa621('0x32')][_0xa621('0x3d')]){_0x27dc1b[_0xa621('0x3b')]=_['merge'](_0x27dc1b[_0xa621('0x3b')],{'$or':_[_0xa621('0x30')](_0x11a0d6,function(_0xc71042){if(_0xc71042[_0xa621('0x2d')]!==_0xa621('0x3e')){var _0x47f15b={};_0x47f15b[_0xc71042[_0xa621('0x31')]]={'$like':'%'+_0x37cc1d[_0xa621('0x32')]['filter']+'%'};return _0x47f15b;}})});}_0x27dc1b=_[_0xa621('0x3f')]({},_0x27dc1b,_0x37cc1d[_0xa621('0x40')]);var _0xc8c380={'where':_0x27dc1b[_0xa621('0x3b')]};return db[_0xa621('0x2b')][_0xa621('0x1f')](_0xc8c380)[_0xa621('0x27')](function(_0x31aa04){_0x261053[_0xa621('0x1f')]=_0x31aa04;if(_0x37cc1d['query']['includeAll']){_0x27dc1b[_0xa621('0x41')]=[{'all':!![]}];}return db['SquareDetailsReport'][_0xa621('0x42')](_0x27dc1b);})['then'](function(_0x204a7c){_0x261053[_0xa621('0x43')]=_0x204a7c;return _0x261053;})[_0xa621('0x27')](respondWithFilteredResult(_0x42561a,_0x27dc1b))[_0xa621('0x44')](handleError(_0x42561a,null));};exports[_0xa621('0x45')]=function(_0x2b4fd7,_0x4e2cb9){var _0x4513b4={'raw':!![],'where':{'id':_0x2b4fd7[_0xa621('0x46')]['id']}},_0x563270={};_0x563270[_0xa621('0x2f')]=_['keys'](db[_0xa621('0x2b')]['rawAttributes']);_0x563270[_0xa621('0x32')]=_['keys'](_0x2b4fd7['query']);_0x563270[_0xa621('0x33')]=_[_0xa621('0x34')](_0x563270[_0xa621('0x2f')],_0x563270[_0xa621('0x32')]);_0x4513b4[_0xa621('0x35')]=_['intersection'](_0x563270['model'],qs[_0xa621('0x36')](_0x2b4fd7[_0xa621('0x32')][_0xa621('0x36')]));_0x4513b4[_0xa621('0x35')]=_0x4513b4[_0xa621('0x35')][_0xa621('0x47')]?_0x4513b4[_0xa621('0x35')]:_0x563270[_0xa621('0x2f')];if(_0x2b4fd7[_0xa621('0x32')][_0xa621('0x48')]){_0x4513b4['include']=[{'all':!![]}];}_0x4513b4=_[_0xa621('0x3f')]({},_0x4513b4,_0x2b4fd7[_0xa621('0x40')]);return db[_0xa621('0x2b')]['find'](_0x4513b4)['then'](handleEntityNotFound(_0x4e2cb9,null))[_0xa621('0x27')](respondWithResult(_0x4e2cb9,null))[_0xa621('0x44')](handleError(_0x4e2cb9,null));};exports['create']=function(_0x4f6198,_0x1d764d){return db[_0xa621('0x2b')][_0xa621('0x49')](_0x4f6198[_0xa621('0x4a')],{})[_0xa621('0x27')](respondWithResult(_0x1d764d,0xc9))['catch'](handleError(_0x1d764d,null));};exports['update']=function(_0x208891,_0x3e8265){if(_0x208891[_0xa621('0x4a')]['id']){delete _0x208891[_0xa621('0x4a')]['id'];}return db[_0xa621('0x2b')][_0xa621('0x4b')]({'where':{'id':_0x208891[_0xa621('0x46')]['id']}})[_0xa621('0x27')](handleEntityNotFound(_0x3e8265,null))[_0xa621('0x27')](saveUpdates(_0x208891[_0xa621('0x4a')],null))[_0xa621('0x27')](respondWithResult(_0x3e8265,null))['catch'](handleError(_0x3e8265,null));};exports[_0xa621('0x26')]=function(_0x78b6d1,_0x2b6675){return db[_0xa621('0x2b')][_0xa621('0x4b')]({'where':{'id':_0x78b6d1[_0xa621('0x46')]['id']}})[_0xa621('0x27')](handleEntityNotFound(_0x2b6675,null))[_0xa621('0x27')](removeEntity(_0x2b6675,null))['catch'](handleError(_0x2b6675,null));};exports[_0xa621('0x4c')]=function(_0x267740,_0x55fa6e){return db['SquareDetailsReport'][_0xa621('0x4c')]()['then'](respondWithResult(_0x55fa6e,null))[_0xa621('0x44')](handleError(_0x55fa6e,null));}; \ No newline at end of file +var _0x1f3d=['fieldName','model','query','intersection','fields','attributes','length','nolimit','order','sort','where','pick','filter','merge','type','VIRTUAL','options','includeAll','include','findAll','rows','catch','keys','filters','find','create','body','update','params','describe','eml-format','rimraf','fast-json-patch','request-promise','bluebird','mustache','util','path','sox','to-csv','fs-extra','lodash','squel','crypto','jsforce','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','Content-Range','apply','reject','save','then','destroy','error','stack','name','send','index','map','SquareDetailsReport','rawAttributes'];(function(_0x5b1273,_0x3b6ab9){var _0x4905d9=function(_0x4f25e0){while(--_0x4f25e0){_0x5b1273['push'](_0x5b1273['shift']());}};_0x4905d9(++_0x3b6ab9);}(_0x1f3d,0x14e));var _0xd1f3=function(_0x3f553a,_0x4880c7){_0x3f553a=_0x3f553a-0x0;var _0x5b5e06=_0x1f3d[_0x3f553a];return _0x5b5e06;};'use strict';var emlformat=require(_0xd1f3('0x0'));var rimraf=require(_0xd1f3('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xd1f3('0x2'));var rp=require(_0xd1f3('0x3'));var moment=require('moment');var BPromise=require(_0xd1f3('0x4'));var Mustache=require(_0xd1f3('0x5'));var util=require(_0xd1f3('0x6'));var path=require(_0xd1f3('0x7'));var sox=require(_0xd1f3('0x8'));var csv=require(_0xd1f3('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xd1f3('0xa'));var _=require(_0xd1f3('0xb'));var squel=require(_0xd1f3('0xc'));var crypto=require(_0xd1f3('0xd'));var jsforce=require(_0xd1f3('0xe'));var deskjs=require('desk.js');var toCsv=require(_0xd1f3('0x9'));var querystring=require('querystring');var Papa=require(_0xd1f3('0xf'));var Redis=require('ioredis');var authService=require(_0xd1f3('0x10'));var qs=require(_0xd1f3('0x11'));var as=require(_0xd1f3('0x12'));var hardwareService=require(_0xd1f3('0x13'));var logger=require(_0xd1f3('0x14'))(_0xd1f3('0x15'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0xd1f3('0x16'));var db=require(_0xd1f3('0x17'))['db'];function respondWithStatusCode(_0x23c3a8,_0x44a795){_0x44a795=_0x44a795||0xcc;return function(_0xd680c6){if(_0xd680c6){return _0x23c3a8[_0xd1f3('0x18')](_0x44a795);}return _0x23c3a8[_0xd1f3('0x19')](_0x44a795)[_0xd1f3('0x1a')]();};}function respondWithResult(_0xb60057,_0xf75daa){_0xf75daa=_0xf75daa||0xc8;return function(_0xeeffcf){if(_0xeeffcf){return _0xb60057[_0xd1f3('0x19')](_0xf75daa)[_0xd1f3('0x1b')](_0xeeffcf);}};}function respondWithFilteredResult(_0x35150c,_0x29d8ef){return function(_0x3ee907){if(_0x3ee907){var _0x4bcfb7=typeof _0x29d8ef[_0xd1f3('0x1c')]===_0xd1f3('0x1d')&&typeof _0x29d8ef[_0xd1f3('0x1e')]===_0xd1f3('0x1d');var _0x1d9d9b=_0x3ee907[_0xd1f3('0x1f')];var _0x47b88a=_0x4bcfb7?0x0:_0x29d8ef[_0xd1f3('0x1c')];var _0x1fd2a5=_0x4bcfb7?_0x3ee907[_0xd1f3('0x1f')]:_0x29d8ef[_0xd1f3('0x1c')]+_0x29d8ef[_0xd1f3('0x1e')];var _0x409942;if(_0x1fd2a5>=_0x1d9d9b){_0x1fd2a5=_0x1d9d9b;_0x409942=0xc8;}else{_0x409942=0xce;}_0x35150c['status'](_0x409942);return _0x35150c['set'](_0xd1f3('0x20'),_0x47b88a+'-'+_0x1fd2a5+'/'+_0x1d9d9b)['json'](_0x3ee907);}return null;};}function patchUpdates(_0x24ec10){return function(_0xefa96b){try{jsonpatch[_0xd1f3('0x21')](_0xefa96b,_0x24ec10,!![]);}catch(_0x43e56b){return BPromise[_0xd1f3('0x22')](_0x43e56b);}return _0xefa96b[_0xd1f3('0x23')]();};}function saveUpdates(_0x28278b,_0xdb7e06){return function(_0x2c1bd0){if(_0x2c1bd0){return _0x2c1bd0['update'](_0x28278b)[_0xd1f3('0x24')](function(_0xa8630a){return _0xa8630a;});}return null;};}function removeEntity(_0x59059f,_0x2a25c8){return function(_0x2e32b5){if(_0x2e32b5){return _0x2e32b5[_0xd1f3('0x25')]()[_0xd1f3('0x24')](function(){_0x59059f['status'](0xcc)[_0xd1f3('0x1a')]();});}};}function handleEntityNotFound(_0x481b7f,_0x4a9cab){return function(_0x14d55a){if(!_0x14d55a){_0x481b7f[_0xd1f3('0x18')](0x194);}return _0x14d55a;};}function handleError(_0x3ccac1,_0x200f70){_0x200f70=_0x200f70||0x1f4;return function(_0x35510b){logger[_0xd1f3('0x26')](_0x35510b[_0xd1f3('0x27')]);if(_0x35510b['name']){delete _0x35510b[_0xd1f3('0x28')];}_0x3ccac1[_0xd1f3('0x19')](_0x200f70)[_0xd1f3('0x29')](_0x35510b);};}exports[_0xd1f3('0x2a')]=function(_0x5f31ca,_0x182893){var _0x205d62={},_0xf1b0ee={},_0x4ad0fc={'count':0x0,'rows':[]};var _0x1230f1=_[_0xd1f3('0x2b')](db[_0xd1f3('0x2c')][_0xd1f3('0x2d')],function(_0x1a23e3){return{'name':_0x1a23e3[_0xd1f3('0x2e')],'type':_0x1a23e3['type']['key']};});_0xf1b0ee[_0xd1f3('0x2f')]=_[_0xd1f3('0x2b')](_0x1230f1,'name');_0xf1b0ee[_0xd1f3('0x30')]=_['keys'](_0x5f31ca[_0xd1f3('0x30')]);_0xf1b0ee['filters']=_[_0xd1f3('0x31')](_0xf1b0ee[_0xd1f3('0x2f')],_0xf1b0ee[_0xd1f3('0x30')]);_0x205d62['attributes']=_[_0xd1f3('0x31')](_0xf1b0ee[_0xd1f3('0x2f')],qs[_0xd1f3('0x32')](_0x5f31ca['query'][_0xd1f3('0x32')]));_0x205d62[_0xd1f3('0x33')]=_0x205d62[_0xd1f3('0x33')][_0xd1f3('0x34')]?_0x205d62[_0xd1f3('0x33')]:_0xf1b0ee[_0xd1f3('0x2f')];if(!_0x5f31ca[_0xd1f3('0x30')]['hasOwnProperty'](_0xd1f3('0x35'))){_0x205d62['limit']=qs['limit'](_0x5f31ca[_0xd1f3('0x30')][_0xd1f3('0x1e')]);_0x205d62[_0xd1f3('0x1c')]=qs[_0xd1f3('0x1c')](_0x5f31ca[_0xd1f3('0x30')][_0xd1f3('0x1c')]);}_0x205d62[_0xd1f3('0x36')]=qs[_0xd1f3('0x37')](_0x5f31ca[_0xd1f3('0x30')]['sort']);_0x205d62[_0xd1f3('0x38')]=qs['filters'](_[_0xd1f3('0x39')](_0x5f31ca[_0xd1f3('0x30')],_0xf1b0ee['filters']),_0x1230f1);if(_0x5f31ca[_0xd1f3('0x30')][_0xd1f3('0x3a')]){_0x205d62[_0xd1f3('0x38')]=_[_0xd1f3('0x3b')](_0x205d62[_0xd1f3('0x38')],{'$or':_[_0xd1f3('0x2b')](_0x1230f1,function(_0x814d1a){if(_0x814d1a[_0xd1f3('0x3c')]!==_0xd1f3('0x3d')){var _0x17fd6c={};_0x17fd6c[_0x814d1a[_0xd1f3('0x28')]]={'$like':'%'+_0x5f31ca[_0xd1f3('0x30')][_0xd1f3('0x3a')]+'%'};return _0x17fd6c;}})});}_0x205d62=_['merge']({},_0x205d62,_0x5f31ca[_0xd1f3('0x3e')]);var _0x23391b={'where':_0x205d62[_0xd1f3('0x38')]};return db[_0xd1f3('0x2c')][_0xd1f3('0x1f')](_0x23391b)[_0xd1f3('0x24')](function(_0xd0cb93){_0x4ad0fc['count']=_0xd0cb93;if(_0x5f31ca[_0xd1f3('0x30')][_0xd1f3('0x3f')]){_0x205d62[_0xd1f3('0x40')]=[{'all':!![]}];}return db[_0xd1f3('0x2c')][_0xd1f3('0x41')](_0x205d62);})[_0xd1f3('0x24')](function(_0x3ca37c){_0x4ad0fc[_0xd1f3('0x42')]=_0x3ca37c;return _0x4ad0fc;})[_0xd1f3('0x24')](respondWithFilteredResult(_0x182893,_0x205d62))[_0xd1f3('0x43')](handleError(_0x182893,null));};exports['show']=function(_0x53572f,_0x395511){var _0x251b73={'raw':!![],'where':{'id':_0x53572f['params']['id']}},_0x5ceedc={};_0x5ceedc[_0xd1f3('0x2f')]=_[_0xd1f3('0x44')](db[_0xd1f3('0x2c')][_0xd1f3('0x2d')]);_0x5ceedc['query']=_[_0xd1f3('0x44')](_0x53572f[_0xd1f3('0x30')]);_0x5ceedc[_0xd1f3('0x45')]=_[_0xd1f3('0x31')](_0x5ceedc[_0xd1f3('0x2f')],_0x5ceedc[_0xd1f3('0x30')]);_0x251b73['attributes']=_[_0xd1f3('0x31')](_0x5ceedc[_0xd1f3('0x2f')],qs[_0xd1f3('0x32')](_0x53572f['query'][_0xd1f3('0x32')]));_0x251b73[_0xd1f3('0x33')]=_0x251b73[_0xd1f3('0x33')][_0xd1f3('0x34')]?_0x251b73[_0xd1f3('0x33')]:_0x5ceedc[_0xd1f3('0x2f')];if(_0x53572f[_0xd1f3('0x30')][_0xd1f3('0x3f')]){_0x251b73[_0xd1f3('0x40')]=[{'all':!![]}];}_0x251b73=_[_0xd1f3('0x3b')]({},_0x251b73,_0x53572f[_0xd1f3('0x3e')]);return db[_0xd1f3('0x2c')][_0xd1f3('0x46')](_0x251b73)[_0xd1f3('0x24')](handleEntityNotFound(_0x395511,null))['then'](respondWithResult(_0x395511,null))[_0xd1f3('0x43')](handleError(_0x395511,null));};exports[_0xd1f3('0x47')]=function(_0x549202,_0x39a1c3){return db[_0xd1f3('0x2c')][_0xd1f3('0x47')](_0x549202[_0xd1f3('0x48')],{})[_0xd1f3('0x24')](respondWithResult(_0x39a1c3,0xc9))[_0xd1f3('0x43')](handleError(_0x39a1c3,null));};exports[_0xd1f3('0x49')]=function(_0x19616d,_0x39b9a6){if(_0x19616d['body']['id']){delete _0x19616d[_0xd1f3('0x48')]['id'];}return db['SquareDetailsReport'][_0xd1f3('0x46')]({'where':{'id':_0x19616d[_0xd1f3('0x4a')]['id']}})[_0xd1f3('0x24')](handleEntityNotFound(_0x39b9a6,null))[_0xd1f3('0x24')](saveUpdates(_0x19616d['body'],null))[_0xd1f3('0x24')](respondWithResult(_0x39b9a6,null))[_0xd1f3('0x43')](handleError(_0x39b9a6,null));};exports[_0xd1f3('0x25')]=function(_0x111aff,_0x1f6bb7){return db[_0xd1f3('0x2c')][_0xd1f3('0x46')]({'where':{'id':_0x111aff[_0xd1f3('0x4a')]['id']}})[_0xd1f3('0x24')](handleEntityNotFound(_0x1f6bb7,null))[_0xd1f3('0x24')](removeEntity(_0x1f6bb7,null))[_0xd1f3('0x43')](handleError(_0x1f6bb7,null));};exports[_0xd1f3('0x4b')]=function(_0x1697c4,_0x3c0ce6){return db[_0xd1f3('0x2c')]['describe']()[_0xd1f3('0x24')](respondWithResult(_0x3c0ce6,null))[_0xd1f3('0x43')](handleError(_0x3c0ce6,null));}; \ No newline at end of file diff --git a/server/api/squareReportDetail/squareReportDetail.model.js b/server/api/squareReportDetail/squareReportDetail.model.js index de91e1f..874f125 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 _0x4007=['../../config/environment','./squareReportDetail.attributes','exports','report_square_details','lodash','util','../../config/logger','bluebird','request-promise','path','rimraf'];(function(_0x6131cd,_0x4c26a1){var _0x47e916=function(_0x1f2bce){while(--_0x1f2bce){_0x6131cd['push'](_0x6131cd['shift']());}};_0x47e916(++_0x4c26a1);}(_0x4007,0x1bc));var _0x7400=function(_0x3bf83f,_0x181cac){_0x3bf83f=_0x3bf83f-0x0;var _0x22c4a9=_0x4007[_0x3bf83f];return _0x22c4a9;};'use strict';var _=require(_0x7400('0x0'));var util=require(_0x7400('0x1'));var logger=require(_0x7400('0x2'))('api');var moment=require('moment');var BPromise=require(_0x7400('0x3'));var rp=require(_0x7400('0x4'));var fs=require('fs');var path=require(_0x7400('0x5'));var rimraf=require(_0x7400('0x6'));var config=require(_0x7400('0x7'));var attributes=require(_0x7400('0x8'));module[_0x7400('0x9')]=function(_0x16e551,_0x51111c){return _0x16e551['define']('SquareDetailsReport',attributes,{'tableName':_0x7400('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x15a6=['define','SquareDetailsReport','report_square_details','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','./squareReportDetail.attributes','exports'];(function(_0x1c1b89,_0x10c526){var _0x2ce3ae=function(_0x26f528){while(--_0x26f528){_0x1c1b89['push'](_0x1c1b89['shift']());}};_0x2ce3ae(++_0x10c526);}(_0x15a6,0x155));var _0x615a=function(_0xbca1b1,_0x33f0ce){_0xbca1b1=_0xbca1b1-0x0;var _0x4e1686=_0x15a6[_0xbca1b1];return _0x4e1686;};'use strict';var _=require(_0x615a('0x0'));var util=require(_0x615a('0x1'));var logger=require(_0x615a('0x2'))(_0x615a('0x3'));var moment=require(_0x615a('0x4'));var BPromise=require(_0x615a('0x5'));var rp=require(_0x615a('0x6'));var fs=require('fs');var path=require(_0x615a('0x7'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0x615a('0x8'));module[_0x615a('0x9')]=function(_0x15b372,_0xb395b5){return _0x15b372[_0x615a('0xa')](_0x615a('0xb'),attributes,{'tableName':_0x615a('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/squareReportDetail/squareReportDetail.rpc.js b/server/api/squareReportDetail/squareReportDetail.rpc.js index 75dc35e..0e50978 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 _0xc901=['../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','SquareDetailsReport,\x20%s,\x20%s','request\x20sent','debug','SquareDetailsReport,\x20%s,\x20%s,\x20%s','error','code','message','CreateSquareDetailsReport','SquareDetailsReport','create','body','options','raw','stringify','catch','lodash','ioredis'];(function(_0x3a29b4,_0x2f9cc5){var _0x5f538b=function(_0x5b3f93){while(--_0x5b3f93){_0x3a29b4['push'](_0x3a29b4['shift']());}};_0x5f538b(++_0x2f9cc5);}(_0xc901,0x142));var _0x1c90=function(_0x19950b,_0x53d0d7){_0x19950b=_0x19950b-0x0;var _0x3c6b41=_0xc901[_0x19950b];return _0x3c6b41;};'use strict';var _=require(_0x1c90('0x0'));var util=require('util');var moment=require('moment');var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x1c90('0x1'));var db=require(_0x1c90('0x2'))['db'];var utils=require('../../config/utils');var logger=require(_0x1c90('0x3'))(_0x1c90('0x4'));var config=require(_0x1c90('0x5'));var jayson=require(_0x1c90('0x6'));var client=jayson[_0x1c90('0x7')][_0x1c90('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x912860,_0x12c07d,_0x423cfb){return new BPromise(function(_0x19196f,_0x514386){return client[_0x1c90('0x9')](_0x912860,_0x423cfb)[_0x1c90('0xa')](function(_0x38cd18){logger[_0x1c90('0xb')](_0x1c90('0xc'),_0x12c07d,_0x1c90('0xd'));logger[_0x1c90('0xe')](_0x1c90('0xf'),_0x12c07d,'request\x20sent',JSON['stringify'](_0x38cd18));if(_0x38cd18[_0x1c90('0x10')]){if(_0x38cd18[_0x1c90('0x10')][_0x1c90('0x11')]===0x1f4){logger['error']('SquareDetailsReport,\x20%s,\x20%s',_0x12c07d,_0x38cd18[_0x1c90('0x10')][_0x1c90('0x12')]);return _0x514386(_0x38cd18['error'][_0x1c90('0x12')]);}logger[_0x1c90('0x10')](_0x1c90('0xc'),_0x12c07d,_0x38cd18['error'][_0x1c90('0x12')]);return _0x19196f(_0x38cd18['error'][_0x1c90('0x12')]);}else{logger[_0x1c90('0xb')](_0x1c90('0xc'),_0x12c07d,_0x1c90('0xd'));_0x19196f(_0x38cd18['result'][_0x1c90('0x12')]);}})['catch'](function(_0x2d3c90){logger[_0x1c90('0x10')]('SquareDetailsReport,\x20%s,\x20%s',_0x12c07d,_0x2d3c90);_0x514386(_0x2d3c90);});});}exports[_0x1c90('0x13')]=function(_0x4ec354){var _0x582246=this;return new Promise(function(_0x128bf0,_0x5dd488){return db[_0x1c90('0x14')][_0x1c90('0x15')](_0x4ec354[_0x1c90('0x16')],{'raw':_0x4ec354[_0x1c90('0x17')]?_0x4ec354['options'][_0x1c90('0x18')]===undefined?!![]:![]:!![]})['then'](function(_0x525997){logger[_0x1c90('0xb')](_0x1c90('0x13'),_0x4ec354);logger['debug'](_0x1c90('0x13'),_0x4ec354,JSON[_0x1c90('0x19')](_0x525997));_0x128bf0(_0x525997);})[_0x1c90('0x1a')](function(_0x4074fd){logger[_0x1c90('0x10')](_0x1c90('0x13'),_0x4074fd['message'],_0x4ec354);_0x5dd488(_0x582246[_0x1c90('0x10')](0x1f4,_0x4074fd[_0x1c90('0x12')]));});});}; \ No newline at end of file +var _0x55f1=['SquareDetailsReport,\x20%s,\x20%s','request\x20sent','debug','SquareDetailsReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','CreateSquareDetailsReport','SquareDetailsReport','create','body','options','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','jayson/promise','http','request','then','info'];(function(_0x1f8287,_0x2aed28){var _0x178dd8=function(_0x185e27){while(--_0x185e27){_0x1f8287['push'](_0x1f8287['shift']());}};_0x178dd8(++_0x2aed28);}(_0x55f1,0x9b));var _0x155f=function(_0x3da8d6,_0x5c47f1){_0x3da8d6=_0x3da8d6-0x0;var _0x49ca7f=_0x55f1[_0x3da8d6];return _0x49ca7f;};'use strict';var _=require(_0x155f('0x0'));var util=require('util');var moment=require(_0x155f('0x1'));var BPromise=require(_0x155f('0x2'));var rs=require(_0x155f('0x3'));var fs=require('fs');var Redis=require(_0x155f('0x4'));var db=require(_0x155f('0x5'))['db'];var utils=require(_0x155f('0x6'));var logger=require(_0x155f('0x7'))('rpc');var config=require('../../config/environment');var jayson=require(_0x155f('0x8'));var client=jayson['client'][_0x155f('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x22e07f,_0x39b14d,_0x1bcf84){return new BPromise(function(_0x2a0a02,_0x9fc06e){return client[_0x155f('0xa')](_0x22e07f,_0x1bcf84)[_0x155f('0xb')](function(_0x100e9a){logger[_0x155f('0xc')](_0x155f('0xd'),_0x39b14d,_0x155f('0xe'));logger[_0x155f('0xf')](_0x155f('0x10'),_0x39b14d,_0x155f('0xe'),JSON[_0x155f('0x11')](_0x100e9a));if(_0x100e9a[_0x155f('0x12')]){if(_0x100e9a['error'][_0x155f('0x13')]===0x1f4){logger[_0x155f('0x12')](_0x155f('0xd'),_0x39b14d,_0x100e9a['error']['message']);return _0x9fc06e(_0x100e9a[_0x155f('0x12')][_0x155f('0x14')]);}logger[_0x155f('0x12')](_0x155f('0xd'),_0x39b14d,_0x100e9a[_0x155f('0x12')][_0x155f('0x14')]);return _0x2a0a02(_0x100e9a[_0x155f('0x12')]['message']);}else{logger[_0x155f('0xc')](_0x155f('0xd'),_0x39b14d,'request\x20sent');_0x2a0a02(_0x100e9a[_0x155f('0x15')][_0x155f('0x14')]);}})[_0x155f('0x16')](function(_0x7ad1c2){logger[_0x155f('0x12')](_0x155f('0xd'),_0x39b14d,_0x7ad1c2);_0x9fc06e(_0x7ad1c2);});});}exports[_0x155f('0x17')]=function(_0x343a1e){var _0x2f5b83=this;return new Promise(function(_0x407e26,_0x2e248d){return db[_0x155f('0x18')][_0x155f('0x19')](_0x343a1e[_0x155f('0x1a')],{'raw':_0x343a1e[_0x155f('0x1b')]?_0x343a1e[_0x155f('0x1b')]['raw']===undefined?!![]:![]:!![]})[_0x155f('0xb')](function(_0x26a322){logger[_0x155f('0xc')](_0x155f('0x17'),_0x343a1e);logger['debug']('CreateSquareDetailsReport',_0x343a1e,JSON['stringify'](_0x26a322));_0x407e26(_0x26a322);})[_0x155f('0x16')](function(_0x3a40b4){logger[_0x155f('0x12')](_0x155f('0x17'),_0x3a40b4[_0x155f('0x14')],_0x343a1e);_0x2e248d(_0x2f5b83['error'](0x1f4,_0x3a40b4[_0x155f('0x14')]));});});}; \ No newline at end of file diff --git a/server/api/system/index.js b/server/api/system/index.js index 97a0463..e15fd49 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 _0x65fc=['express','Router','../../components/auth/service','./system.controller','get','isAuthenticated','index','/process/:pid/kill'];(function(_0x149247,_0x5eb16a){var _0x2d52fa=function(_0x287845){while(--_0x287845){_0x149247['push'](_0x149247['shift']());}};_0x2d52fa(++_0x5eb16a);}(_0x65fc,0x160));var _0xc65f=function(_0x3e198d,_0x28ccc9){_0x3e198d=_0x3e198d-0x0;var _0x530a85=_0x65fc[_0x3e198d];return _0x530a85;};'use strict';var express=require(_0xc65f('0x0'));var router=express[_0xc65f('0x1')]();var auth=require(_0xc65f('0x2'));var controller=require(_0xc65f('0x3'));router[_0xc65f('0x4')]('/',auth[_0xc65f('0x5')](),controller[_0xc65f('0x6')]);router['get'](_0xc65f('0x7'),auth[_0xc65f('0x5')](),controller['killProcess']);module['exports']=router; \ No newline at end of file +var _0xddc8=['./system.controller','get','isAuthenticated','killProcess','express','Router','../../components/auth/service'];(function(_0x167a6a,_0x3cd734){var _0x9a162d=function(_0x385895){while(--_0x385895){_0x167a6a['push'](_0x167a6a['shift']());}};_0x9a162d(++_0x3cd734);}(_0xddc8,0xb3));var _0x8ddc=function(_0x43f18a,_0x8d3de7){_0x43f18a=_0x43f18a-0x0;var _0x8b106f=_0xddc8[_0x43f18a];return _0x8b106f;};'use strict';var express=require(_0x8ddc('0x0'));var router=express[_0x8ddc('0x1')]();var auth=require(_0x8ddc('0x2'));var controller=require(_0x8ddc('0x3'));router[_0x8ddc('0x4')]('/',auth[_0x8ddc('0x5')](),controller['index']);router[_0x8ddc('0x4')]('/process/:pid/kill',auth['isAuthenticated'](),controller[_0x8ddc('0x6')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/system/system.controller.js b/server/api/system/system.controller.js index 7651834..979bb00 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 _0xc298=['pid','kill','Process\x20with\x20pid\x20%s\x20killed\x20correctly','catch','child_process','../../config/logger','util','bluebird','lodash','<%-\x20name\x20%>,\x20%s,\x20%s,\x20%s','inspect','name','status','send','index','then','json','killProcess','components/import/cm','format','split','length','indexOf','Process\x20with\x20pid\x20%s\x20not\x20found!','params'];(function(_0x5347de,_0x5170c8){var _0x1b6852=function(_0x30611b){while(--_0x30611b){_0x5347de['push'](_0x5347de['shift']());}};_0x1b6852(++_0x5170c8);}(_0xc298,0x68));var _0x8c29=function(_0x2136ff,_0x3cacfa){_0x2136ff=_0x2136ff-0x0;var _0x23b9a5=_0xc298[_0x2136ff];return _0x23b9a5;};'use strict';var info=require('systeminformation');var exec=require(_0x8c29('0x0'))['exec'];var logger=require(_0x8c29('0x1'))('api');var util=require(_0x8c29('0x2'));var BPromise=require(_0x8c29('0x3'));var _=require(_0x8c29('0x4'));function handleError(_0x1dc8f8,_0x522044,_0x352a2e){_0x522044=_0x522044||0x1f4;return function(_0x1d947c){logger['error'](_0x8c29('0x5'),_0x352a2e,_0x522044,util[_0x8c29('0x6')](_0x1d947c,{'showHidden':![],'depth':null}));delete _0x1d947c[_0x8c29('0x7')];_0x1dc8f8[_0x8c29('0x8')](_0x522044)[_0x8c29('0x9')](_0x1d947c);};}exports[_0x8c29('0xa')]=function(_0x3a8a32,_0x56f4d5){return info['getAllData']()[_0x8c29('0xb')](function(_0x25b06f){return _0x56f4d5[_0x8c29('0x8')](0xc8)['json'](_0x25b06f);})['catch'](function(_0x4a2fdc){return _0x56f4d5['status'](0x1f4)[_0x8c29('0xc')](_0x4a2fdc);});};exports[_0x8c29('0xd')]=function(_0x50a35d,_0x58f139){var _0x583213=[_0x8c29('0xe')];return new BPromise(function(_0xc19bbb,_0x20c629){return exec(util[_0x8c29('0xf')]('ps\x20-p\x20%s\x20-ww\x20-o\x20args',_0x50a35d['params']['pid']),function(_0x276c6f,_0x2d8249,_0x4fc82f){if(_0x276c6f){return _0x20c629(_0x276c6f);}return _0xc19bbb(_0x2d8249);});})['then'](function(_0x545dbb){var _0x32d0cb=![];var _0x45e4d7=_0x545dbb[_0x8c29('0x10')](/\n/);for(var _0x1ebdfb=0x0,_0x5efe51=_0x583213[_0x8c29('0x11')];_0x1ebdfb<_0x5efe51,_0x32d0cb===![];_0x1ebdfb+=0x1){if(_0x545dbb[_0x8c29('0x12')](_0x583213[_0x1ebdfb])>=0x0){_0x32d0cb=!![];}}if(!_0x32d0cb){throw new Error(util['format'](_0x8c29('0x13'),_0x50a35d[_0x8c29('0x14')][_0x8c29('0x15')]));}process[_0x8c29('0x16')](_0x50a35d[_0x8c29('0x14')]['pid'],'SIGINT');return _0x58f139['status'](0xc8)['json']({'message':util[_0x8c29('0xf')](_0x8c29('0x17'),_0x50a35d['params']['pid'])});})[_0x8c29('0x18')](handleError(_0x58f139,null,_0x8c29('0xd')));}; \ No newline at end of file +var _0x9501=['util','bluebird','lodash','error','<%-\x20name\x20%>,\x20%s,\x20%s,\x20%s','inspect','name','status','index','getAllData','then','catch','killProcess','components/import/cm','format','ps\x20-p\x20%s\x20-ww\x20-o\x20args','params','pid','split','length','Process\x20with\x20pid\x20%s\x20not\x20found!','Process\x20with\x20pid\x20%s\x20killed\x20correctly','systeminformation','child_process','exec','../../config/logger','api'];(function(_0x47a7d0,_0x4e182d){var _0xb9bd08=function(_0x588ee2){while(--_0x588ee2){_0x47a7d0['push'](_0x47a7d0['shift']());}};_0xb9bd08(++_0x4e182d);}(_0x9501,0x175));var _0x1950=function(_0x59287a,_0x270094){_0x59287a=_0x59287a-0x0;var _0x4b3ebc=_0x9501[_0x59287a];return _0x4b3ebc;};'use strict';var info=require(_0x1950('0x0'));var exec=require(_0x1950('0x1'))[_0x1950('0x2')];var logger=require(_0x1950('0x3'))(_0x1950('0x4'));var util=require(_0x1950('0x5'));var BPromise=require(_0x1950('0x6'));var _=require(_0x1950('0x7'));function handleError(_0x23d267,_0x2c19da,_0x33f225){_0x2c19da=_0x2c19da||0x1f4;return function(_0xb8f352){logger[_0x1950('0x8')](_0x1950('0x9'),_0x33f225,_0x2c19da,util[_0x1950('0xa')](_0xb8f352,{'showHidden':![],'depth':null}));delete _0xb8f352[_0x1950('0xb')];_0x23d267[_0x1950('0xc')](_0x2c19da)['send'](_0xb8f352);};}exports[_0x1950('0xd')]=function(_0x292d43,_0x191232){return info[_0x1950('0xe')]()[_0x1950('0xf')](function(_0x996464){return _0x191232[_0x1950('0xc')](0xc8)['json'](_0x996464);})[_0x1950('0x10')](function(_0x56b9fa){return _0x191232[_0x1950('0xc')](0x1f4)['json'](_0x56b9fa);});};exports[_0x1950('0x11')]=function(_0x488666,_0x49d842){var _0x4bc00b=[_0x1950('0x12')];return new BPromise(function(_0x23c460,_0x30f6d7){return exec(util[_0x1950('0x13')](_0x1950('0x14'),_0x488666[_0x1950('0x15')][_0x1950('0x16')]),function(_0x12a4aa,_0x266497,_0x39202a){if(_0x12a4aa){return _0x30f6d7(_0x12a4aa);}return _0x23c460(_0x266497);});})[_0x1950('0xf')](function(_0x3bf2f7){var _0x38d18e=![];var _0x17c97d=_0x3bf2f7[_0x1950('0x17')](/\n/);for(var _0x34d1cd=0x0,_0x47d757=_0x4bc00b[_0x1950('0x18')];_0x34d1cd<_0x47d757,_0x38d18e===![];_0x34d1cd+=0x1){if(_0x3bf2f7['indexOf'](_0x4bc00b[_0x34d1cd])>=0x0){_0x38d18e=!![];}}if(!_0x38d18e){throw new Error(util[_0x1950('0x13')](_0x1950('0x19'),_0x488666[_0x1950('0x15')][_0x1950('0x16')]));}process['kill'](_0x488666['params'][_0x1950('0x16')],'SIGINT');return _0x49d842[_0x1950('0xc')](0xc8)['json']({'message':util[_0x1950('0x13')](_0x1950('0x1a'),_0x488666[_0x1950('0x15')]['pid'])});})[_0x1950('0x10')](handleError(_0x49d842,null,'killProcess'));}; \ No newline at end of file diff --git a/server/api/tag/index.js b/server/api/tag/index.js index c225101..fb26a9e 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 _0x7295=['isAuthenticated','show','post','create','put','update','delete','destroy','exports','util','connect-timeout','express','Router','fs-extra','../../components/interaction/service','../../config/environment','./tag.controller','get','index','/:id'];(function(_0x2a6809,_0x44edde){var _0x11c371=function(_0x1a4888){while(--_0x1a4888){_0x2a6809['push'](_0x2a6809['shift']());}};_0x11c371(++_0x44edde);}(_0x7295,0x199));var _0x5729=function(_0x22cb10,_0x20db4f){_0x22cb10=_0x22cb10-0x0;var _0x38a6f8=_0x7295[_0x22cb10];return _0x38a6f8;};'use strict';var multer=require('multer');var util=require(_0x5729('0x0'));var path=require('path');var timeout=require(_0x5729('0x1'));var express=require(_0x5729('0x2'));var router=express[_0x5729('0x3')]();var fs_extra=require(_0x5729('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0x5729('0x5'));var config=require(_0x5729('0x6'));var controller=require(_0x5729('0x7'));router[_0x5729('0x8')]('/',auth['isAuthenticated'](),controller[_0x5729('0x9')]);router['get'](_0x5729('0xa'),auth[_0x5729('0xb')](),controller[_0x5729('0xc')]);router[_0x5729('0xd')]('/',auth['isAuthenticated'](),controller[_0x5729('0xe')]);router[_0x5729('0xf')](_0x5729('0xa'),auth['isAuthenticated'](),controller[_0x5729('0x10')]);router[_0x5729('0x11')](_0x5729('0xa'),auth[_0x5729('0xb')](),controller[_0x5729('0x12')]);module[_0x5729('0x13')]=router; \ No newline at end of file +var _0xebb6=['../../components/auth/service','../../components/interaction/service','../../config/environment','./tag.controller','get','index','/:id','isAuthenticated','show','put','update','delete','destroy','multer','util','path','connect-timeout','express','Router'];(function(_0x5f14c6,_0x40a5a2){var _0xcae47f=function(_0x5d8c3c){while(--_0x5d8c3c){_0x5f14c6['push'](_0x5f14c6['shift']());}};_0xcae47f(++_0x40a5a2);}(_0xebb6,0x7f));var _0x6ebb=function(_0x110c3d,_0x12ee06){_0x110c3d=_0x110c3d-0x0;var _0x226d67=_0xebb6[_0x110c3d];return _0x226d67;};'use strict';var multer=require(_0x6ebb('0x0'));var util=require(_0x6ebb('0x1'));var path=require(_0x6ebb('0x2'));var timeout=require(_0x6ebb('0x3'));var express=require(_0x6ebb('0x4'));var router=express[_0x6ebb('0x5')]();var fs_extra=require('fs-extra');var auth=require(_0x6ebb('0x6'));var interaction=require(_0x6ebb('0x7'));var config=require(_0x6ebb('0x8'));var controller=require(_0x6ebb('0x9'));router[_0x6ebb('0xa')]('/',auth['isAuthenticated'](),controller[_0x6ebb('0xb')]);router[_0x6ebb('0xa')](_0x6ebb('0xc'),auth[_0x6ebb('0xd')](),controller[_0x6ebb('0xe')]);router['post']('/',auth[_0x6ebb('0xd')](),controller['create']);router[_0x6ebb('0xf')](_0x6ebb('0xc'),auth[_0x6ebb('0xd')](),controller[_0x6ebb('0x10')]);router[_0x6ebb('0x11')](_0x6ebb('0xc'),auth[_0x6ebb('0xd')](),controller[_0x6ebb('0x12')]);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 d5af532..70bb30b 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 _0xceb0=['STRING'];(function(_0x397e5f,_0x454c8f){var _0x5302b8=function(_0x1a29ef){while(--_0x1a29ef){_0x397e5f['push'](_0x397e5f['shift']());}};_0x5302b8(++_0x454c8f);}(_0xceb0,0x173));var _0x0ceb=function(_0x1cb815,_0x2c2e89){_0x1cb815=_0x1cb815-0x0;var _0x543ddc=_0xceb0[_0x1cb815];return _0x543ddc;};'use strict';var Sequelize=require('sequelize');module['exports']={'name':{'type':Sequelize['STRING'],'unique':'name','allowNull':![],'validate':{'is':/[A-Za-z0-9._\\+*!-]+/,'notEmpty':!![]}},'color':{'type':Sequelize[_0x0ceb('0x0')],'defaultValue':'#0091EA'},'description':{'type':Sequelize[_0x0ceb('0x0')]}}; \ No newline at end of file +var _0x0ca5=['name','#0091EA','sequelize','exports','STRING'];(function(_0xa5ea5f,_0x60e663){var _0x288865=function(_0x289a56){while(--_0x289a56){_0xa5ea5f['push'](_0xa5ea5f['shift']());}};_0x288865(++_0x60e663);}(_0x0ca5,0xfc));var _0x50ca=function(_0x76cee,_0x39fce5){_0x76cee=_0x76cee-0x0;var _0x1b2ac9=_0x0ca5[_0x76cee];return _0x1b2ac9;};'use strict';var Sequelize=require(_0x50ca('0x0'));module[_0x50ca('0x1')]={'name':{'type':Sequelize[_0x50ca('0x2')],'unique':_0x50ca('0x3'),'allowNull':![],'validate':{'is':/[A-Za-z0-9._\\+*!-]+/,'notEmpty':!![]}},'color':{'type':Sequelize[_0x50ca('0x2')],'defaultValue':_0x50ca('0x4')},'description':{'type':Sequelize[_0x50ca('0x2')]}}; \ No newline at end of file diff --git a/server/api/tag/tag.controller.js b/server/api/tag/tag.controller.js index 1f9d16a..51de4f7 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 _0x9aea=['status','Content-Range','apply','reject','destroy','then','get','Tags','UserProfileResource','error','stack','name','send','index','map','Tag','rawAttributes','fieldName','type','key','model','keys','query','filters','attributes','intersection','fields','hasOwnProperty','order','sort','where','pick','VIRTUAL','filter','options','count','includeAll','include','findAll','rows','catch','show','params','length','merge','find','create','body','user','role','userProfileId','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','eml-format','zip-dir','request-promise','moment','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/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','end','json','offset','limit','undefined'];(function(_0x12bfa4,_0x3d340f){var _0x1b1d88=function(_0x14ba53){while(--_0x14ba53){_0x12bfa4['push'](_0x12bfa4['shift']());}};_0x1b1d88(++_0x3d340f);}(_0x9aea,0xdd));var _0xa9ae=function(_0x2b207a,_0x5da40a){_0x2b207a=_0x2b207a-0x0;var _0x2197f3=_0x9aea[_0x2b207a];return _0x2197f3;};'use strict';var emlformat=require(_0xa9ae('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xa9ae('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0xa9ae('0x2'));var moment=require(_0xa9ae('0x3'));var BPromise=require('bluebird');var Mustache=require(_0xa9ae('0x4'));var util=require(_0xa9ae('0x5'));var path=require(_0xa9ae('0x6'));var sox=require(_0xa9ae('0x7'));var csv=require(_0xa9ae('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xa9ae('0x9'));var _=require(_0xa9ae('0xa'));var squel=require(_0xa9ae('0xb'));var crypto=require('crypto');var jsforce=require(_0xa9ae('0xc'));var deskjs=require(_0xa9ae('0xd'));var toCsv=require(_0xa9ae('0x8'));var querystring=require(_0xa9ae('0xe'));var Papa=require(_0xa9ae('0xf'));var Redis=require(_0xa9ae('0x10'));var authService=require(_0xa9ae('0x11'));var qs=require(_0xa9ae('0x12'));var as=require(_0xa9ae('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xa9ae('0x14'))('api');var utils=require(_0xa9ae('0x15'));var config=require(_0xa9ae('0x16'));var licenseUtil=require(_0xa9ae('0x17'));var db=require(_0xa9ae('0x18'))['db'];function respondWithStatusCode(_0x35f861,_0x33a72f){_0x33a72f=_0x33a72f||0xcc;return function(_0xa34271){if(_0xa34271){return _0x35f861[_0xa9ae('0x19')](_0x33a72f);}return _0x35f861['status'](_0x33a72f)[_0xa9ae('0x1a')]();};}function respondWithResult(_0x365e90,_0x10882e){_0x10882e=_0x10882e||0xc8;return function(_0x3f7f61){if(_0x3f7f61){return _0x365e90['status'](_0x10882e)[_0xa9ae('0x1b')](_0x3f7f61);}};}function respondWithFilteredResult(_0x1ec742,_0x31c03e){return function(_0x40b756){if(_0x40b756){var _0x77b0a4=typeof _0x31c03e[_0xa9ae('0x1c')]==='undefined'&&typeof _0x31c03e[_0xa9ae('0x1d')]===_0xa9ae('0x1e');var _0x3e31d9=_0x40b756['count'];var _0x4dbb30=_0x77b0a4?0x0:_0x31c03e[_0xa9ae('0x1c')];var _0x581345=_0x77b0a4?_0x40b756['count']:_0x31c03e[_0xa9ae('0x1c')]+_0x31c03e[_0xa9ae('0x1d')];var _0xbfd2ff;if(_0x581345>=_0x3e31d9){_0x581345=_0x3e31d9;_0xbfd2ff=0xc8;}else{_0xbfd2ff=0xce;}_0x1ec742[_0xa9ae('0x1f')](_0xbfd2ff);return _0x1ec742['set'](_0xa9ae('0x20'),_0x4dbb30+'-'+_0x581345+'/'+_0x3e31d9)[_0xa9ae('0x1b')](_0x40b756);}return null;};}function patchUpdates(_0x39f133){return function(_0x688153){try{jsonpatch[_0xa9ae('0x21')](_0x688153,_0x39f133,!![]);}catch(_0x2e204d){return BPromise[_0xa9ae('0x22')](_0x2e204d);}return _0x688153['save']();};}function saveUpdates(_0xc021cf,_0x4ca9a9){return function(_0x49dca9){if(_0x49dca9){return _0x49dca9['update'](_0xc021cf)['then'](function(_0x1afd07){return _0x1afd07;});}return null;};}function removeEntity(_0x4edd55,_0x13fb05){return function(_0x5093ad){if(_0x5093ad){return _0x5093ad[_0xa9ae('0x23')]()[_0xa9ae('0x24')](function(){var _0x93d637=_0x5093ad[_0xa9ae('0x25')]({'plain':!![]});var _0x12b061=_0xa9ae('0x26');return db[_0xa9ae('0x27')]['destroy']({'where':{'type':_0x12b061,'resourceId':_0x93d637['id']}})[_0xa9ae('0x24')](function(){return _0x5093ad;});})[_0xa9ae('0x24')](function(){_0x4edd55[_0xa9ae('0x1f')](0xcc)[_0xa9ae('0x1a')]();});}};}function handleEntityNotFound(_0x222db7,_0x428934){return function(_0xb12fa8){if(!_0xb12fa8){_0x222db7['sendStatus'](0x194);}return _0xb12fa8;};}function handleError(_0x489e88,_0x2f1a9f){_0x2f1a9f=_0x2f1a9f||0x1f4;return function(_0x3c324e){logger[_0xa9ae('0x28')](_0x3c324e[_0xa9ae('0x29')]);if(_0x3c324e[_0xa9ae('0x2a')]){delete _0x3c324e['name'];}_0x489e88['status'](_0x2f1a9f)[_0xa9ae('0x2b')](_0x3c324e);};}exports[_0xa9ae('0x2c')]=function(_0x372ec7,_0x3a48b7){var _0x314969={},_0x36bc28={},_0x5d0c84={'count':0x0,'rows':[]};var _0x5415f1=_[_0xa9ae('0x2d')](db[_0xa9ae('0x2e')][_0xa9ae('0x2f')],function(_0x3cd87a){return{'name':_0x3cd87a[_0xa9ae('0x30')],'type':_0x3cd87a[_0xa9ae('0x31')][_0xa9ae('0x32')]};});_0x36bc28[_0xa9ae('0x33')]=_['map'](_0x5415f1,_0xa9ae('0x2a'));_0x36bc28['query']=_[_0xa9ae('0x34')](_0x372ec7[_0xa9ae('0x35')]);_0x36bc28[_0xa9ae('0x36')]=_['intersection'](_0x36bc28[_0xa9ae('0x33')],_0x36bc28[_0xa9ae('0x35')]);_0x314969[_0xa9ae('0x37')]=_[_0xa9ae('0x38')](_0x36bc28[_0xa9ae('0x33')],qs['fields'](_0x372ec7[_0xa9ae('0x35')][_0xa9ae('0x39')]));_0x314969[_0xa9ae('0x37')]=_0x314969['attributes']['length']?_0x314969[_0xa9ae('0x37')]:_0x36bc28[_0xa9ae('0x33')];if(!_0x372ec7[_0xa9ae('0x35')][_0xa9ae('0x3a')]('nolimit')){_0x314969[_0xa9ae('0x1d')]=qs[_0xa9ae('0x1d')](_0x372ec7[_0xa9ae('0x35')][_0xa9ae('0x1d')]);_0x314969[_0xa9ae('0x1c')]=qs['offset'](_0x372ec7[_0xa9ae('0x35')]['offset']);}_0x314969[_0xa9ae('0x3b')]=qs[_0xa9ae('0x3c')](_0x372ec7[_0xa9ae('0x35')]['sort']);_0x314969[_0xa9ae('0x3d')]=qs[_0xa9ae('0x36')](_[_0xa9ae('0x3e')](_0x372ec7['query'],_0x36bc28[_0xa9ae('0x36')]),_0x5415f1);if(_0x372ec7[_0xa9ae('0x35')]['filter']){_0x314969[_0xa9ae('0x3d')]=_['merge'](_0x314969[_0xa9ae('0x3d')],{'$or':_[_0xa9ae('0x2d')](_0x5415f1,function(_0x4bbc74){if(_0x4bbc74[_0xa9ae('0x31')]!==_0xa9ae('0x3f')){var _0x234da5={};_0x234da5[_0x4bbc74[_0xa9ae('0x2a')]]={'$like':'%'+_0x372ec7[_0xa9ae('0x35')][_0xa9ae('0x40')]+'%'};return _0x234da5;}})});}_0x314969=_['merge']({},_0x314969,_0x372ec7[_0xa9ae('0x41')]);var _0xa12887={'where':_0x314969['where']};return db['Tag'][_0xa9ae('0x42')](_0xa12887)[_0xa9ae('0x24')](function(_0xc4f775){_0x5d0c84[_0xa9ae('0x42')]=_0xc4f775;if(_0x372ec7['query'][_0xa9ae('0x43')]){_0x314969[_0xa9ae('0x44')]=[{'all':!![]}];}return db[_0xa9ae('0x2e')][_0xa9ae('0x45')](_0x314969);})[_0xa9ae('0x24')](function(_0x2bef06){_0x5d0c84[_0xa9ae('0x46')]=_0x2bef06;return _0x5d0c84;})['then'](respondWithFilteredResult(_0x3a48b7,_0x314969))[_0xa9ae('0x47')](handleError(_0x3a48b7,null));};exports[_0xa9ae('0x48')]=function(_0x566cb0,_0x419ba7){var _0x542477={'raw':!![],'where':{'id':_0x566cb0[_0xa9ae('0x49')]['id']}},_0xb51a6c={};_0xb51a6c[_0xa9ae('0x33')]=_[_0xa9ae('0x34')](db[_0xa9ae('0x2e')][_0xa9ae('0x2f')]);_0xb51a6c[_0xa9ae('0x35')]=_['keys'](_0x566cb0[_0xa9ae('0x35')]);_0xb51a6c[_0xa9ae('0x36')]=_['intersection'](_0xb51a6c[_0xa9ae('0x33')],_0xb51a6c[_0xa9ae('0x35')]);_0x542477[_0xa9ae('0x37')]=_[_0xa9ae('0x38')](_0xb51a6c[_0xa9ae('0x33')],qs[_0xa9ae('0x39')](_0x566cb0['query'][_0xa9ae('0x39')]));_0x542477['attributes']=_0x542477[_0xa9ae('0x37')][_0xa9ae('0x4a')]?_0x542477['attributes']:_0xb51a6c['model'];if(_0x566cb0[_0xa9ae('0x35')][_0xa9ae('0x43')]){_0x542477[_0xa9ae('0x44')]=[{'all':!![]}];}_0x542477=_[_0xa9ae('0x4b')]({},_0x542477,_0x566cb0[_0xa9ae('0x41')]);return db[_0xa9ae('0x2e')][_0xa9ae('0x4c')](_0x542477)[_0xa9ae('0x24')](handleEntityNotFound(_0x419ba7,null))['then'](respondWithResult(_0x419ba7,null))['catch'](handleError(_0x419ba7,null));};exports[_0xa9ae('0x4d')]=function(_0x3cf89c,_0x4efe55){return db[_0xa9ae('0x2e')][_0xa9ae('0x4d')](_0x3cf89c[_0xa9ae('0x4e')],{})[_0xa9ae('0x24')](function(_0x36636f){var _0x104af2=_0x3cf89c[_0xa9ae('0x4f')][_0xa9ae('0x25')]({'plain':!![]});if(!_0x104af2)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x104af2[_0xa9ae('0x50')]===_0xa9ae('0x4f')){var _0x5ea18d=_0x36636f[_0xa9ae('0x25')]({'plain':!![]});var _0x4abe30='Tags';return db['UserProfileSection'][_0xa9ae('0x4c')]({'where':{'name':_0x4abe30,'userProfileId':_0x104af2[_0xa9ae('0x51')]},'raw':!![]})['then'](function(_0x4840ea){if(_0x4840ea&&_0x4840ea['autoAssociation']===0x0){return db[_0xa9ae('0x27')]['create']({'name':_0x5ea18d[_0xa9ae('0x2a')],'resourceId':_0x5ea18d['id'],'type':_0x4840ea[_0xa9ae('0x2a')],'sectionId':_0x4840ea['id']},{})['then'](function(){return _0x36636f;});}else{return _0x36636f;}})[_0xa9ae('0x47')](function(_0x5cebe3){logger[_0xa9ae('0x28')](_0xa9ae('0x52'),_0x5cebe3);throw _0x5cebe3;});}return _0x36636f;})[_0xa9ae('0x24')](respondWithResult(_0x4efe55,0xc9))[_0xa9ae('0x47')](handleError(_0x4efe55,null));};exports[_0xa9ae('0x53')]=function(_0x233dd6,_0x1a04d4){if(_0x233dd6[_0xa9ae('0x4e')]['id']){delete _0x233dd6[_0xa9ae('0x4e')]['id'];}return db[_0xa9ae('0x2e')][_0xa9ae('0x4c')]({'where':{'id':_0x233dd6[_0xa9ae('0x49')]['id']}})['then'](handleEntityNotFound(_0x1a04d4,null))[_0xa9ae('0x24')](saveUpdates(_0x233dd6[_0xa9ae('0x4e')],null))[_0xa9ae('0x24')](respondWithResult(_0x1a04d4,null))[_0xa9ae('0x47')](handleError(_0x1a04d4,null));};exports[_0xa9ae('0x23')]=function(_0x59de12,_0x4fe9e7){return db[_0xa9ae('0x2e')][_0xa9ae('0x4c')]({'where':{'id':_0x59de12['params']['id']}})['then'](handleEntityNotFound(_0x4fe9e7,null))[_0xa9ae('0x24')](removeEntity(_0x4fe9e7,null))['catch'](handleError(_0x4fe9e7,null));}; \ No newline at end of file +var _0xc368=['error','name','map','Tag','rawAttributes','fieldName','type','key','model','query','intersection','attributes','fields','nolimit','order','sort','where','filters','pick','merge','VIRTUAL','includeAll','include','rows','catch','params','keys','length','options','create','body','user','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','Tags','UserProfileSection','find','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','path','sox','to-csv','ejs','squel','crypto','jsforce','desk.js','querystring','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','offset','undefined','limit','count','set','Content-Range','json','apply','reject','save','destroy','then','UserProfileResource'];(function(_0x126a6f,_0x390a17){var _0x3988db=function(_0x162d81){while(--_0x162d81){_0x126a6f['push'](_0x126a6f['shift']());}};_0x3988db(++_0x390a17);}(_0xc368,0x7b));var _0x8c36=function(_0x142b08,_0x28f242){_0x142b08=_0x142b08-0x0;var _0x595d31=_0xc368[_0x142b08];return _0x595d31;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x8c36('0x0'));var zipdir=require('zip-dir');var jsonpatch=require(_0x8c36('0x1'));var rp=require(_0x8c36('0x2'));var moment=require(_0x8c36('0x3'));var BPromise=require(_0x8c36('0x4'));var Mustache=require(_0x8c36('0x5'));var util=require('util');var path=require(_0x8c36('0x6'));var sox=require(_0x8c36('0x7'));var csv=require(_0x8c36('0x8'));var ejs=require(_0x8c36('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0x8c36('0xa'));var crypto=require(_0x8c36('0xb'));var jsforce=require(_0x8c36('0xc'));var deskjs=require(_0x8c36('0xd'));var toCsv=require(_0x8c36('0x8'));var querystring=require(_0x8c36('0xe'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0x8c36('0xf'));var as=require(_0x8c36('0x10'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x8c36('0x11'))(_0x8c36('0x12'));var utils=require(_0x8c36('0x13'));var config=require(_0x8c36('0x14'));var licenseUtil=require(_0x8c36('0x15'));var db=require(_0x8c36('0x16'))['db'];function respondWithStatusCode(_0xa09884,_0x23eb71){_0x23eb71=_0x23eb71||0xcc;return function(_0x205d5c){if(_0x205d5c){return _0xa09884[_0x8c36('0x17')](_0x23eb71);}return _0xa09884[_0x8c36('0x18')](_0x23eb71)[_0x8c36('0x19')]();};}function respondWithResult(_0x3c824b,_0x220f18){_0x220f18=_0x220f18||0xc8;return function(_0x5dfcd5){if(_0x5dfcd5){return _0x3c824b[_0x8c36('0x18')](_0x220f18)['json'](_0x5dfcd5);}};}function respondWithFilteredResult(_0xea7509,_0x3f83aa){return function(_0x29e791){if(_0x29e791){var _0x1fc68e=typeof _0x3f83aa[_0x8c36('0x1a')]===_0x8c36('0x1b')&&typeof _0x3f83aa[_0x8c36('0x1c')]===_0x8c36('0x1b');var _0x30229e=_0x29e791['count'];var _0x2be9b0=_0x1fc68e?0x0:_0x3f83aa[_0x8c36('0x1a')];var _0x47832a=_0x1fc68e?_0x29e791[_0x8c36('0x1d')]:_0x3f83aa[_0x8c36('0x1a')]+_0x3f83aa['limit'];var _0x15100f;if(_0x47832a>=_0x30229e){_0x47832a=_0x30229e;_0x15100f=0xc8;}else{_0x15100f=0xce;}_0xea7509[_0x8c36('0x18')](_0x15100f);return _0xea7509[_0x8c36('0x1e')](_0x8c36('0x1f'),_0x2be9b0+'-'+_0x47832a+'/'+_0x30229e)[_0x8c36('0x20')](_0x29e791);}return null;};}function patchUpdates(_0x2b07ad){return function(_0xfb9763){try{jsonpatch[_0x8c36('0x21')](_0xfb9763,_0x2b07ad,!![]);}catch(_0x153735){return BPromise[_0x8c36('0x22')](_0x153735);}return _0xfb9763[_0x8c36('0x23')]();};}function saveUpdates(_0x14ee6b,_0x46645d){return function(_0x51fd6c){if(_0x51fd6c){return _0x51fd6c['update'](_0x14ee6b)['then'](function(_0x55b844){return _0x55b844;});}return null;};}function removeEntity(_0x2269f5,_0x7effb8){return function(_0x2088aa){if(_0x2088aa){return _0x2088aa[_0x8c36('0x24')]()[_0x8c36('0x25')](function(){var _0x27c0df=_0x2088aa['get']({'plain':!![]});var _0x1d39ca='Tags';return db[_0x8c36('0x26')]['destroy']({'where':{'type':_0x1d39ca,'resourceId':_0x27c0df['id']}})[_0x8c36('0x25')](function(){return _0x2088aa;});})[_0x8c36('0x25')](function(){_0x2269f5[_0x8c36('0x18')](0xcc)[_0x8c36('0x19')]();});}};}function handleEntityNotFound(_0x50aa48,_0x55cbfb){return function(_0x7e7e56){if(!_0x7e7e56){_0x50aa48[_0x8c36('0x17')](0x194);}return _0x7e7e56;};}function handleError(_0x5ad933,_0x4fc3ba){_0x4fc3ba=_0x4fc3ba||0x1f4;return function(_0x418663){logger[_0x8c36('0x27')](_0x418663['stack']);if(_0x418663[_0x8c36('0x28')]){delete _0x418663[_0x8c36('0x28')];}_0x5ad933[_0x8c36('0x18')](_0x4fc3ba)['send'](_0x418663);};}exports['index']=function(_0x46b72f,_0x1531fc){var _0x3d7056={},_0x192ce3={},_0x3ae970={'count':0x0,'rows':[]};var _0x2e8855=_[_0x8c36('0x29')](db[_0x8c36('0x2a')][_0x8c36('0x2b')],function(_0x2d6476){return{'name':_0x2d6476[_0x8c36('0x2c')],'type':_0x2d6476[_0x8c36('0x2d')][_0x8c36('0x2e')]};});_0x192ce3[_0x8c36('0x2f')]=_[_0x8c36('0x29')](_0x2e8855,_0x8c36('0x28'));_0x192ce3[_0x8c36('0x30')]=_['keys'](_0x46b72f['query']);_0x192ce3['filters']=_[_0x8c36('0x31')](_0x192ce3[_0x8c36('0x2f')],_0x192ce3[_0x8c36('0x30')]);_0x3d7056[_0x8c36('0x32')]=_[_0x8c36('0x31')](_0x192ce3[_0x8c36('0x2f')],qs[_0x8c36('0x33')](_0x46b72f['query'][_0x8c36('0x33')]));_0x3d7056['attributes']=_0x3d7056[_0x8c36('0x32')]['length']?_0x3d7056[_0x8c36('0x32')]:_0x192ce3[_0x8c36('0x2f')];if(!_0x46b72f[_0x8c36('0x30')]['hasOwnProperty'](_0x8c36('0x34'))){_0x3d7056[_0x8c36('0x1c')]=qs[_0x8c36('0x1c')](_0x46b72f[_0x8c36('0x30')][_0x8c36('0x1c')]);_0x3d7056[_0x8c36('0x1a')]=qs[_0x8c36('0x1a')](_0x46b72f[_0x8c36('0x30')][_0x8c36('0x1a')]);}_0x3d7056[_0x8c36('0x35')]=qs[_0x8c36('0x36')](_0x46b72f[_0x8c36('0x30')][_0x8c36('0x36')]);_0x3d7056[_0x8c36('0x37')]=qs[_0x8c36('0x38')](_[_0x8c36('0x39')](_0x46b72f[_0x8c36('0x30')],_0x192ce3['filters']),_0x2e8855);if(_0x46b72f[_0x8c36('0x30')]['filter']){_0x3d7056[_0x8c36('0x37')]=_[_0x8c36('0x3a')](_0x3d7056[_0x8c36('0x37')],{'$or':_[_0x8c36('0x29')](_0x2e8855,function(_0x4da574){if(_0x4da574['type']!==_0x8c36('0x3b')){var _0x15a553={};_0x15a553[_0x4da574[_0x8c36('0x28')]]={'$like':'%'+_0x46b72f['query']['filter']+'%'};return _0x15a553;}})});}_0x3d7056=_[_0x8c36('0x3a')]({},_0x3d7056,_0x46b72f['options']);var _0x568290={'where':_0x3d7056[_0x8c36('0x37')]};return db[_0x8c36('0x2a')][_0x8c36('0x1d')](_0x568290)[_0x8c36('0x25')](function(_0x2a0272){_0x3ae970[_0x8c36('0x1d')]=_0x2a0272;if(_0x46b72f[_0x8c36('0x30')][_0x8c36('0x3c')]){_0x3d7056[_0x8c36('0x3d')]=[{'all':!![]}];}return db[_0x8c36('0x2a')]['findAll'](_0x3d7056);})[_0x8c36('0x25')](function(_0x24505c){_0x3ae970[_0x8c36('0x3e')]=_0x24505c;return _0x3ae970;})[_0x8c36('0x25')](respondWithFilteredResult(_0x1531fc,_0x3d7056))[_0x8c36('0x3f')](handleError(_0x1531fc,null));};exports['show']=function(_0xb1f8ac,_0x3dde7b){var _0x31699c={'raw':!![],'where':{'id':_0xb1f8ac[_0x8c36('0x40')]['id']}},_0x18e28e={};_0x18e28e[_0x8c36('0x2f')]=_['keys'](db[_0x8c36('0x2a')][_0x8c36('0x2b')]);_0x18e28e[_0x8c36('0x30')]=_[_0x8c36('0x41')](_0xb1f8ac[_0x8c36('0x30')]);_0x18e28e[_0x8c36('0x38')]=_[_0x8c36('0x31')](_0x18e28e['model'],_0x18e28e[_0x8c36('0x30')]);_0x31699c[_0x8c36('0x32')]=_[_0x8c36('0x31')](_0x18e28e[_0x8c36('0x2f')],qs[_0x8c36('0x33')](_0xb1f8ac[_0x8c36('0x30')][_0x8c36('0x33')]));_0x31699c[_0x8c36('0x32')]=_0x31699c[_0x8c36('0x32')][_0x8c36('0x42')]?_0x31699c[_0x8c36('0x32')]:_0x18e28e[_0x8c36('0x2f')];if(_0xb1f8ac['query']['includeAll']){_0x31699c[_0x8c36('0x3d')]=[{'all':!![]}];}_0x31699c=_[_0x8c36('0x3a')]({},_0x31699c,_0xb1f8ac[_0x8c36('0x43')]);return db[_0x8c36('0x2a')]['find'](_0x31699c)[_0x8c36('0x25')](handleEntityNotFound(_0x3dde7b,null))[_0x8c36('0x25')](respondWithResult(_0x3dde7b,null))['catch'](handleError(_0x3dde7b,null));};exports['create']=function(_0x4edf8e,_0xb4ebae){return db[_0x8c36('0x2a')][_0x8c36('0x44')](_0x4edf8e[_0x8c36('0x45')],{})[_0x8c36('0x25')](function(_0x2778b3){var _0x4dd393=_0x4edf8e[_0x8c36('0x46')][_0x8c36('0x47')]({'plain':!![]});if(!_0x4dd393)throw new Error(_0x8c36('0x48'));if(_0x4dd393[_0x8c36('0x49')]==='user'){var _0x5e668d=_0x2778b3['get']({'plain':!![]});var _0x3887e4=_0x8c36('0x4a');return db[_0x8c36('0x4b')][_0x8c36('0x4c')]({'where':{'name':_0x3887e4,'userProfileId':_0x4dd393[_0x8c36('0x4d')]},'raw':!![]})[_0x8c36('0x25')](function(_0x43b5e2){if(_0x43b5e2&&_0x43b5e2[_0x8c36('0x4e')]===0x0){return db[_0x8c36('0x26')]['create']({'name':_0x5e668d['name'],'resourceId':_0x5e668d['id'],'type':_0x43b5e2[_0x8c36('0x28')],'sectionId':_0x43b5e2['id']},{})['then'](function(){return _0x2778b3;});}else{return _0x2778b3;}})['catch'](function(_0x9955bc){logger['error'](_0x8c36('0x4f'),_0x9955bc);throw _0x9955bc;});}return _0x2778b3;})[_0x8c36('0x25')](respondWithResult(_0xb4ebae,0xc9))['catch'](handleError(_0xb4ebae,null));};exports[_0x8c36('0x50')]=function(_0x5af860,_0x31fbde){if(_0x5af860[_0x8c36('0x45')]['id']){delete _0x5af860[_0x8c36('0x45')]['id'];}return db['Tag'][_0x8c36('0x4c')]({'where':{'id':_0x5af860[_0x8c36('0x40')]['id']}})[_0x8c36('0x25')](handleEntityNotFound(_0x31fbde,null))[_0x8c36('0x25')](saveUpdates(_0x5af860[_0x8c36('0x45')],null))[_0x8c36('0x25')](respondWithResult(_0x31fbde,null))[_0x8c36('0x3f')](handleError(_0x31fbde,null));};exports[_0x8c36('0x24')]=function(_0x20f1d9,_0x4cd57c){return db['Tag']['find']({'where':{'id':_0x20f1d9[_0x8c36('0x40')]['id']}})['then'](handleEntityNotFound(_0x4cd57c,null))['then'](removeEntity(_0x4cd57c,null))[_0x8c36('0x3f')](handleError(_0x4cd57c,null));}; \ No newline at end of file diff --git a/server/api/tag/tag.model.js b/server/api/tag/tag.model.js index 8270a8c..2e8bf46 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 _0xa73a=['util','../../config/logger','api','moment','bluebird','../../config/environment','./tag.attributes','exports','define','Tag'];(function(_0x1ce724,_0xbab0da){var _0xbc64d4=function(_0x46a731){while(--_0x46a731){_0x1ce724['push'](_0x1ce724['shift']());}};_0xbc64d4(++_0xbab0da);}(_0xa73a,0x82));var _0xaa73=function(_0x166742,_0x55520c){_0x166742=_0x166742-0x0;var _0xb7814a=_0xa73a[_0x166742];return _0xb7814a;};'use strict';var _=require('lodash');var util=require(_0xaa73('0x0'));var logger=require(_0xaa73('0x1'))(_0xaa73('0x2'));var moment=require(_0xaa73('0x3'));var BPromise=require(_0xaa73('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0xaa73('0x5'));var attributes=require(_0xaa73('0x6'));module[_0xaa73('0x7')]=function(_0x15d1c6,_0xf84c2e){return _0x15d1c6[_0xaa73('0x8')](_0xaa73('0x9'),attributes,{'tableName':'tools_tags','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xcda6=['./tag.attributes','exports','define','Tag','tools_tags','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment'];(function(_0xf35bd4,_0x51ff64){var _0x47912b=function(_0x269818){while(--_0x269818){_0xf35bd4['push'](_0xf35bd4['shift']());}};_0x47912b(++_0x51ff64);}(_0xcda6,0x1f3));var _0x6cda=function(_0x19ab21,_0x32105b){_0x19ab21=_0x19ab21-0x0;var _0x4207b9=_0xcda6[_0x19ab21];return _0x4207b9;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x6cda('0x0'))(_0x6cda('0x1'));var moment=require(_0x6cda('0x2'));var BPromise=require(_0x6cda('0x3'));var rp=require(_0x6cda('0x4'));var fs=require('fs');var path=require(_0x6cda('0x5'));var rimraf=require(_0x6cda('0x6'));var config=require(_0x6cda('0x7'));var attributes=require(_0x6cda('0x8'));module[_0x6cda('0x9')]=function(_0x4c9d9c,_0x1b9fa7){return _0x4c9d9c[_0x6cda('0xa')](_0x6cda('0xb'),attributes,{'tableName':_0x6cda('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/tag/tag.rpc.js b/server/api/tag/tag.rpc.js index a90877b..4fffca1 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 _0xb7c8=['error','Tag,\x20%s,\x20%s','message','result','catch','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','request','then','info','request\x20sent','debug','stringify'];(function(_0x32ce39,_0x368c80){var _0x249979=function(_0x3cb3ec){while(--_0x3cb3ec){_0x32ce39['push'](_0x32ce39['shift']());}};_0x249979(++_0x368c80);}(_0xb7c8,0x119));var _0x8b7c=function(_0x144906,_0x3b8034){_0x144906=_0x144906-0x0;var _0x5ad130=_0xb7c8[_0x144906];return _0x5ad130;};'use strict';var _=require('lodash');var util=require(_0x8b7c('0x0'));var moment=require(_0x8b7c('0x1'));var BPromise=require(_0x8b7c('0x2'));var rs=require(_0x8b7c('0x3'));var fs=require('fs');var Redis=require(_0x8b7c('0x4'));var db=require(_0x8b7c('0x5'))['db'];var utils=require(_0x8b7c('0x6'));var logger=require('../../config/logger')(_0x8b7c('0x7'));var config=require(_0x8b7c('0x8'));var jayson=require(_0x8b7c('0x9'));var client=jayson[_0x8b7c('0xa')][_0x8b7c('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x12665c,_0x7a3850,_0x3c8fd6){return new BPromise(function(_0x6afb55,_0x30a924){return client[_0x8b7c('0xc')](_0x12665c,_0x3c8fd6)[_0x8b7c('0xd')](function(_0x48370e){logger[_0x8b7c('0xe')]('Tag,\x20%s,\x20%s',_0x7a3850,_0x8b7c('0xf'));logger[_0x8b7c('0x10')]('Tag,\x20%s,\x20%s,\x20%s',_0x7a3850,_0x8b7c('0xf'),JSON[_0x8b7c('0x11')](_0x48370e));if(_0x48370e[_0x8b7c('0x12')]){if(_0x48370e['error']['code']===0x1f4){logger[_0x8b7c('0x12')](_0x8b7c('0x13'),_0x7a3850,_0x48370e[_0x8b7c('0x12')][_0x8b7c('0x14')]);return _0x30a924(_0x48370e[_0x8b7c('0x12')][_0x8b7c('0x14')]);}logger[_0x8b7c('0x12')]('Tag,\x20%s,\x20%s',_0x7a3850,_0x48370e[_0x8b7c('0x12')][_0x8b7c('0x14')]);return _0x6afb55(_0x48370e[_0x8b7c('0x12')]['message']);}else{logger[_0x8b7c('0xe')](_0x8b7c('0x13'),_0x7a3850,'request\x20sent');_0x6afb55(_0x48370e[_0x8b7c('0x15')][_0x8b7c('0x14')]);}})[_0x8b7c('0x16')](function(_0x1682fd){logger[_0x8b7c('0x12')]('Tag,\x20%s,\x20%s',_0x7a3850,_0x1682fd);_0x30a924(_0x1682fd);});});} \ No newline at end of file +var _0xa8a8=['stringify','error','code','Tag,\x20%s,\x20%s','message','catch','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','info','request\x20sent','debug'];(function(_0x163515,_0x3d219b){var _0x135b90=function(_0x4a914d){while(--_0x4a914d){_0x163515['push'](_0x163515['shift']());}};_0x135b90(++_0x3d219b);}(_0xa8a8,0xec));var _0x8a8a=function(_0x49cb88,_0x21363a){_0x49cb88=_0x49cb88-0x0;var _0x5bdccb=_0xa8a8[_0x49cb88];return _0x5bdccb;};'use strict';var _=require(_0x8a8a('0x0'));var util=require(_0x8a8a('0x1'));var moment=require(_0x8a8a('0x2'));var BPromise=require(_0x8a8a('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x8a8a('0x4'));var db=require(_0x8a8a('0x5'))['db'];var utils=require(_0x8a8a('0x6'));var logger=require(_0x8a8a('0x7'))(_0x8a8a('0x8'));var config=require(_0x8a8a('0x9'));var jayson=require(_0x8a8a('0xa'));var client=jayson[_0x8a8a('0xb')][_0x8a8a('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x315fe9,_0x1d7121,_0x8e7aa0){return new BPromise(function(_0x4225b9,_0xecaa6f){return client[_0x8a8a('0xd')](_0x315fe9,_0x8e7aa0)['then'](function(_0x576ef9){logger[_0x8a8a('0xe')]('Tag,\x20%s,\x20%s',_0x1d7121,_0x8a8a('0xf'));logger[_0x8a8a('0x10')]('Tag,\x20%s,\x20%s,\x20%s',_0x1d7121,_0x8a8a('0xf'),JSON[_0x8a8a('0x11')](_0x576ef9));if(_0x576ef9[_0x8a8a('0x12')]){if(_0x576ef9['error'][_0x8a8a('0x13')]===0x1f4){logger[_0x8a8a('0x12')](_0x8a8a('0x14'),_0x1d7121,_0x576ef9[_0x8a8a('0x12')]['message']);return _0xecaa6f(_0x576ef9[_0x8a8a('0x12')]['message']);}logger[_0x8a8a('0x12')](_0x8a8a('0x14'),_0x1d7121,_0x576ef9[_0x8a8a('0x12')][_0x8a8a('0x15')]);return _0x4225b9(_0x576ef9[_0x8a8a('0x12')][_0x8a8a('0x15')]);}else{logger[_0x8a8a('0xe')]('Tag,\x20%s,\x20%s',_0x1d7121,_0x8a8a('0xf'));_0x4225b9(_0x576ef9['result'][_0x8a8a('0x15')]);}})[_0x8a8a('0x16')](function(_0x46a4f4){logger[_0x8a8a('0x12')](_0x8a8a('0x14'),_0x1d7121,_0x46a4f4);_0xecaa6f(_0x46a4f4);});});} \ No newline at end of file diff --git a/server/api/team/index.js b/server/api/team/index.js index b66b13e..4a2b9c9 100644 --- a/server/api/team/index.js +++ b/server/api/team/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xa9e0=['Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./team.controller','get','index','/:id','getQueues','/:id/users','isAuthenticated','getAgents','post','addQueues','addAgents','update','delete','removeAgents','multer','util','path'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0xa9e0,0x123));var _0x0a9e=function(_0xf50820,_0x56f041){_0xf50820=_0xf50820-0x0;var _0x2a9b10=_0xa9e0[_0xf50820];return _0x2a9b10;};'use strict';var multer=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var path=require(_0x0a9e('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x0a9e('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x0a9e('0x4'));var interaction=require(_0x0a9e('0x5'));var config=require(_0x0a9e('0x6'));var controller=require(_0x0a9e('0x7'));router[_0x0a9e('0x8')]('/',auth['isAuthenticated'](),controller[_0x0a9e('0x9')]);router[_0x0a9e('0x8')](_0x0a9e('0xa'),auth['isAuthenticated'](),controller['show']);router[_0x0a9e('0x8')]('/:id/queues',auth['isAuthenticated'](),controller[_0x0a9e('0xb')]);router[_0x0a9e('0x8')](_0x0a9e('0xc'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0xe')]);router[_0x0a9e('0xf')]('/',auth['isAuthenticated'](),controller['create']);router['post']('/:id/queues',auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x10')]);router[_0x0a9e('0xf')](_0x0a9e('0xc'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x11')]);router['put'](_0x0a9e('0xa'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x12')]);router[_0x0a9e('0x13')](_0x0a9e('0xa'),auth[_0x0a9e('0xd')](),controller['destroy']);router[_0x0a9e('0x13')]('/:id/queues',auth[_0x0a9e('0xd')](),controller['removeQueues']);router[_0x0a9e('0x13')](_0x0a9e('0xc'),auth['isAuthenticated'](),controller[_0x0a9e('0x14')]);module['exports']=router; \ No newline at end of file +var _0xa9e0=['Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./team.controller','get','index','/:id','getQueues','/:id/users','isAuthenticated','getAgents','post','addQueues','addAgents','update','delete','removeAgents','multer','util','path'];(function(_0x46e363,_0x45d7e2){var _0x3fb059=function(_0x5e6274){while(--_0x5e6274){_0x46e363['push'](_0x46e363['shift']());}};_0x3fb059(++_0x45d7e2);}(_0xa9e0,0x123));var _0x0a9e=function(_0x139a3c,_0x4fc883){_0x139a3c=_0x139a3c-0x0;var _0x2b375b=_0xa9e0[_0x139a3c];return _0x2b375b;};'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 80fe91b..5692fc9 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(_0x5a7103,_0x4d72dc){var _0x296a97=function(_0x35337c){while(--_0x35337c){_0x5a7103['push'](_0x5a7103['shift']());}};_0x296a97(++_0x4d72dc);}(_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 _0xb10b=['name','sequelize','STRING'];(function(_0x159eb8,_0x4952eb){var _0x3381ad=function(_0x460687){while(--_0x460687){_0x159eb8['push'](_0x159eb8['shift']());}};_0x3381ad(++_0x4952eb);}(_0xb10b,0x12a));var _0xbb10=function(_0x1b4943,_0x48bd8d){_0x1b4943=_0x1b4943-0x0;var _0x1e91f0=_0xb10b[_0x1b4943];return _0x1e91f0;};'use strict';var Sequelize=require(_0xbb10('0x0'));module['exports']={'name':{'type':Sequelize[_0xbb10('0x1')],'allowNull':![],'unique':_0xbb10('0x2')},'description':{'type':Sequelize[_0xbb10('0x1')]}}; \ No newline at end of file diff --git a/server/api/team/team.controller.js b/server/api/team/team.controller.js index 9a5e531..4137b88 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 _0x1bea=['query','keys','filters','intersection','fields','attributes','length','nolimit','limit','order','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','catch','show','include','find','create','body','user','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','Teams','UserProfileSection','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','params','destroy','sequelize','transaction','SELECT\x20UserId\x20FROM\x20user_has_teams\x20WHERE\x20TeamId\x20=\x20','Sequelize','QueryTypes','UserId','SELECT\x20VoiceQueueId\x20FROM\x20team_has_voice_queues\x20WHERE\x20TeamId\x20=\x20','SELECT','VoiceQueueId','UserVoiceQueue','SELECT\x20MailQueueId\x20FROM\x20team_has_mail_queues\x20WHERE\x20TeamId\x20=\x20','MailQueueId','SmsQueueId','SELECT\x20ChatQueueId\x20FROM\x20team_has_chat_queues\x20WHERE\x20TeamId\x20=\x20','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','UserOpenchannelQueue','SELECT\x20WhatsappQueueId\x20FROM\x20team_has_whatsapp_queues\x20WHERE\x20TeamId\x20=\x20','WhatsappQueueId','UserWhatsappQueue','TeamVoicePrefix','UserVoicePrefix','VoicePrefixId','UserProfileResource','getQueues','channel','ValidationError','capitalize','toLowerCase','Queue','Queues','addQueues','findOne','Unknown\x20channel','add','removeQueues','isValidChannel','remove','addAgents','isArray','ids','Chat','Sms','Fax','Whatsapp','Voice','through','QueueId','penalty','User','findOrCreate','emit','Queue:save','findAll','online','voicePause','UserVoiceQueueRt','isNil','interface','format','SIP/%s','TeamVoiceQueue','all','upsert','removeAgents','Mail','Openchannel','getAgents','hasOwnProperty','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/license/util','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./team.socket','sendStatus','status','end','json','offset','undefined','count','set','Content-Range','reject','save','update','then','name','send','index','map','Team','rawAttributes','fieldName','type','model'];(function(_0x5d11c1,_0x155e3d){var _0x379505=function(_0x582bc8){while(--_0x582bc8){_0x5d11c1['push'](_0x5d11c1['shift']());}};_0x379505(++_0x155e3d);}(_0x1bea,0x1af));var _0xa1be=function(_0x5408b1,_0x258270){_0x5408b1=_0x5408b1-0x0;var _0x322910=_0x1bea[_0x5408b1];return _0x322910;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xa1be('0x0'));var zipdir=require(_0xa1be('0x1'));var jsonpatch=require(_0xa1be('0x2'));var rp=require(_0xa1be('0x3'));var moment=require(_0xa1be('0x4'));var BPromise=require(_0xa1be('0x5'));var Mustache=require(_0xa1be('0x6'));var util=require(_0xa1be('0x7'));var path=require(_0xa1be('0x8'));var sox=require(_0xa1be('0x9'));var csv=require(_0xa1be('0xa'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xa1be('0xb'));var _=require(_0xa1be('0xc'));var squel=require(_0xa1be('0xd'));var crypto=require(_0xa1be('0xe'));var jsforce=require(_0xa1be('0xf'));var deskjs=require(_0xa1be('0x10'));var toCsv=require('to-csv');var querystring=require(_0xa1be('0x11'));var Papa=require(_0xa1be('0x12'));var Redis=require(_0xa1be('0x13'));var authService=require(_0xa1be('0x14'));var qs=require(_0xa1be('0x15'));var as=require(_0xa1be('0x16'));var hardwareService=require(_0xa1be('0x17'));var logger=require(_0xa1be('0x18'))('api');var utils=require(_0xa1be('0x19'));var config=require('../../config/environment');var licenseUtil=require(_0xa1be('0x1a'));var db=require(_0xa1be('0x1b'))['db'];config[_0xa1be('0x1c')]=_[_0xa1be('0x1d')](config[_0xa1be('0x1c')],{'host':_0xa1be('0x1e'),'port':0x18eb});var socket=require(_0xa1be('0x1f'))(new Redis(config[_0xa1be('0x1c')]));require(_0xa1be('0x20'))['register'](socket);function respondWithStatusCode(_0x10060c,_0x1d278c){_0x1d278c=_0x1d278c||0xcc;return function(_0x2a01e0){if(_0x2a01e0){return _0x10060c[_0xa1be('0x21')](_0x1d278c);}return _0x10060c[_0xa1be('0x22')](_0x1d278c)[_0xa1be('0x23')]();};}function respondWithResult(_0x4cc6f1,_0xee518b){_0xee518b=_0xee518b||0xc8;return function(_0x4888b1){if(_0x4888b1){return _0x4cc6f1[_0xa1be('0x22')](_0xee518b)[_0xa1be('0x24')](_0x4888b1);}};}function respondWithFilteredResult(_0x23222e,_0x52d566){return function(_0x3aef3b){if(_0x3aef3b){var _0x26bfd5=typeof _0x52d566[_0xa1be('0x25')]===_0xa1be('0x26')&&typeof _0x52d566['limit']===_0xa1be('0x26');var _0x5e80db=_0x3aef3b[_0xa1be('0x27')];var _0x48dbaf=_0x26bfd5?0x0:_0x52d566['offset'];var _0xd599c7=_0x26bfd5?_0x3aef3b[_0xa1be('0x27')]:_0x52d566['offset']+_0x52d566['limit'];var _0x1687dd;if(_0xd599c7>=_0x5e80db){_0xd599c7=_0x5e80db;_0x1687dd=0xc8;}else{_0x1687dd=0xce;}_0x23222e[_0xa1be('0x22')](_0x1687dd);return _0x23222e[_0xa1be('0x28')](_0xa1be('0x29'),_0x48dbaf+'-'+_0xd599c7+'/'+_0x5e80db)[_0xa1be('0x24')](_0x3aef3b);}return null;};}function patchUpdates(_0x56bfab){return function(_0x319db9){try{jsonpatch['apply'](_0x319db9,_0x56bfab,!![]);}catch(_0x27de21){return BPromise[_0xa1be('0x2a')](_0x27de21);}return _0x319db9[_0xa1be('0x2b')]();};}function saveUpdates(_0x5e059a,_0x36c4d2){return function(_0x2362d6){if(_0x2362d6){return _0x2362d6[_0xa1be('0x2c')](_0x5e059a)[_0xa1be('0x2d')](function(_0x2987c2){return _0x2987c2;});}return null;};}function handleEntityNotFound(_0x405ff6,_0x2ad51d){return function(_0x33a29a){if(!_0x33a29a){_0x405ff6[_0xa1be('0x21')](0x194);}return _0x33a29a;};}function handleError(_0x56eff5,_0x37d771){_0x37d771=_0x37d771||0x1f4;return function(_0x2095a5){logger['error'](_0x2095a5['stack']);if(_0x2095a5[_0xa1be('0x2e')]){delete _0x2095a5[_0xa1be('0x2e')];}_0x56eff5[_0xa1be('0x22')](_0x37d771)[_0xa1be('0x2f')](_0x2095a5);};}exports[_0xa1be('0x30')]=function(_0x79e1a6,_0x50d2d1){var _0x548ee3={},_0x574b7e={},_0x49fb80={'count':0x0,'rows':[]};var _0x7446f7=_[_0xa1be('0x31')](db[_0xa1be('0x32')][_0xa1be('0x33')],function(_0x50a6f3){return{'name':_0x50a6f3[_0xa1be('0x34')],'type':_0x50a6f3[_0xa1be('0x35')]['key']};});_0x574b7e[_0xa1be('0x36')]=_[_0xa1be('0x31')](_0x7446f7,_0xa1be('0x2e'));_0x574b7e[_0xa1be('0x37')]=_[_0xa1be('0x38')](_0x79e1a6[_0xa1be('0x37')]);_0x574b7e[_0xa1be('0x39')]=_[_0xa1be('0x3a')](_0x574b7e[_0xa1be('0x36')],_0x574b7e[_0xa1be('0x37')]);_0x548ee3['attributes']=_[_0xa1be('0x3a')](_0x574b7e[_0xa1be('0x36')],qs['fields'](_0x79e1a6[_0xa1be('0x37')][_0xa1be('0x3b')]));_0x548ee3[_0xa1be('0x3c')]=_0x548ee3['attributes'][_0xa1be('0x3d')]?_0x548ee3[_0xa1be('0x3c')]:_0x574b7e['model'];if(!_0x79e1a6[_0xa1be('0x37')]['hasOwnProperty'](_0xa1be('0x3e'))){_0x548ee3[_0xa1be('0x3f')]=qs[_0xa1be('0x3f')](_0x79e1a6['query'][_0xa1be('0x3f')]);_0x548ee3[_0xa1be('0x25')]=qs['offset'](_0x79e1a6[_0xa1be('0x37')][_0xa1be('0x25')]);}_0x548ee3[_0xa1be('0x40')]=qs[_0xa1be('0x41')](_0x79e1a6[_0xa1be('0x37')][_0xa1be('0x41')]);_0x548ee3[_0xa1be('0x42')]=qs[_0xa1be('0x39')](_[_0xa1be('0x43')](_0x79e1a6[_0xa1be('0x37')],_0x574b7e[_0xa1be('0x39')]),_0x7446f7);if(_0x79e1a6['query'][_0xa1be('0x44')]){_0x548ee3[_0xa1be('0x42')]=_[_0xa1be('0x45')](_0x548ee3[_0xa1be('0x42')],{'$or':_[_0xa1be('0x31')](_0x7446f7,function(_0x47b99b){if(_0x47b99b[_0xa1be('0x35')]!==_0xa1be('0x46')){var _0x570077={};_0x570077[_0x47b99b[_0xa1be('0x2e')]]={'$like':'%'+_0x79e1a6[_0xa1be('0x37')][_0xa1be('0x44')]+'%'};return _0x570077;}})});}_0x548ee3=_[_0xa1be('0x45')]({},_0x548ee3,_0x79e1a6[_0xa1be('0x47')]);var _0x4739ce={'where':_0x548ee3['where']};return db[_0xa1be('0x32')][_0xa1be('0x27')](_0x4739ce)[_0xa1be('0x2d')](function(_0x2f4c56){_0x49fb80[_0xa1be('0x27')]=_0x2f4c56;if(_0x79e1a6[_0xa1be('0x37')][_0xa1be('0x48')]){_0x548ee3['include']=[{'all':!![]}];}return db[_0xa1be('0x32')]['findAll'](_0x548ee3);})[_0xa1be('0x2d')](function(_0x2ba28b){_0x49fb80['rows']=_0x2ba28b;return _0x49fb80;})[_0xa1be('0x2d')](respondWithFilteredResult(_0x50d2d1,_0x548ee3))[_0xa1be('0x49')](handleError(_0x50d2d1,null));};exports[_0xa1be('0x4a')]=function(_0x4d93bf,_0x1e00af){var _0x357e2b={'raw':![],'where':{'id':_0x4d93bf['params']['id']}},_0x2a8706={};_0x2a8706['model']=_[_0xa1be('0x38')](db['Team'][_0xa1be('0x33')]);_0x2a8706[_0xa1be('0x37')]=_[_0xa1be('0x38')](_0x4d93bf['query']);_0x2a8706[_0xa1be('0x39')]=_[_0xa1be('0x3a')](_0x2a8706[_0xa1be('0x36')],_0x2a8706['query']);_0x357e2b[_0xa1be('0x3c')]=_[_0xa1be('0x3a')](_0x2a8706[_0xa1be('0x36')],qs[_0xa1be('0x3b')](_0x4d93bf[_0xa1be('0x37')][_0xa1be('0x3b')]));_0x357e2b[_0xa1be('0x3c')]=_0x357e2b[_0xa1be('0x3c')][_0xa1be('0x3d')]?_0x357e2b['attributes']:_0x2a8706[_0xa1be('0x36')];if(_0x4d93bf[_0xa1be('0x37')][_0xa1be('0x48')]){_0x357e2b[_0xa1be('0x4b')]=[{'all':!![]}];}_0x357e2b=_['merge']({},_0x357e2b,_0x4d93bf['options']);return db[_0xa1be('0x32')][_0xa1be('0x4c')](_0x357e2b)['then'](handleEntityNotFound(_0x1e00af,null))[_0xa1be('0x2d')](respondWithResult(_0x1e00af,null))[_0xa1be('0x49')](handleError(_0x1e00af,null));};exports['create']=function(_0x5763fc,_0x27c893){return db['Team'][_0xa1be('0x4d')](_0x5763fc[_0xa1be('0x4e')],{})['then'](function(_0x5d8ff9){var _0x1a710d=_0x5763fc[_0xa1be('0x4f')][_0xa1be('0x50')]({'plain':!![]});if(!_0x1a710d)throw new Error(_0xa1be('0x51'));if(_0x1a710d[_0xa1be('0x52')]==='user'){var _0x5d3efb=_0x5d8ff9['get']({'plain':!![]});var _0xf12e84=_0xa1be('0x53');return db[_0xa1be('0x54')][_0xa1be('0x4c')]({'where':{'name':_0xf12e84,'userProfileId':_0x1a710d['userProfileId']},'raw':!![]})[_0xa1be('0x2d')](function(_0x382c03){if(_0x382c03&&_0x382c03['autoAssociation']===0x0){return db['UserProfileResource'][_0xa1be('0x4d')]({'name':_0x5d3efb[_0xa1be('0x2e')],'resourceId':_0x5d3efb['id'],'type':_0x382c03[_0xa1be('0x2e')],'sectionId':_0x382c03['id']},{})[_0xa1be('0x2d')](function(){return _0x5d8ff9;});}else{return _0x5d8ff9;}})['catch'](function(_0x232e8d){logger[_0xa1be('0x55')](_0xa1be('0x56'),_0x232e8d);throw _0x232e8d;});}return _0x5d8ff9;})[_0xa1be('0x2d')](respondWithResult(_0x27c893,0xc9))['catch'](handleError(_0x27c893,null));};exports[_0xa1be('0x2c')]=function(_0x50c3a5,_0x461d9b){if(_0x50c3a5[_0xa1be('0x4e')]['id']){delete _0x50c3a5[_0xa1be('0x4e')]['id'];}return db['Team']['find']({'where':{'id':_0x50c3a5[_0xa1be('0x57')]['id']}})[_0xa1be('0x2d')](handleEntityNotFound(_0x461d9b,null))[_0xa1be('0x2d')](saveUpdates(_0x50c3a5[_0xa1be('0x4e')],null))['then'](respondWithResult(_0x461d9b,null))['catch'](handleError(_0x461d9b,null));};exports[_0xa1be('0x58')]=function(_0x315065,_0x19673a){var _0x24fa7f=_0x315065[_0xa1be('0x57')]['id'];var _0x1f5c44=[];return db[_0xa1be('0x59')][_0xa1be('0x5a')](function(_0x3929fd){var _0x1ccbf2=_0xa1be('0x5b')+_0x24fa7f;return db['sequelize']['query'](_0x1ccbf2,{'type':db[_0xa1be('0x5c')][_0xa1be('0x5d')]['SELECT'],'raw':!![],'transaction':_0x3929fd})[_0xa1be('0x2d')](function(_0x21306a){_0x1f5c44=_[_0xa1be('0x31')](_0x21306a,function(_0x1dd6e7){return Number(_0x1dd6e7[_0xa1be('0x5e')]);});})['then'](function(){var _0x151786=_0xa1be('0x5f')+_0x24fa7f;return db[_0xa1be('0x59')][_0xa1be('0x37')](_0x151786,{'type':db[_0xa1be('0x5c')][_0xa1be('0x5d')][_0xa1be('0x60')],'raw':!![],'transaction':_0x3929fd});})[_0xa1be('0x2d')](function(_0x196a6d){var _0x2f87e6=_[_0xa1be('0x31')](_0x196a6d,function(_0x53d5e9){return Number(_0x53d5e9[_0xa1be('0x61')]);});return db[_0xa1be('0x62')][_0xa1be('0x58')]({'where':{'UserId':{'$in':_0x1f5c44},'VoiceQueueId':{'$in':_0x2f87e6}},'transaction':_0x3929fd});})[_0xa1be('0x2d')](function(){var _0x545455=_0xa1be('0x63')+_0x24fa7f;return db['sequelize']['query'](_0x545455,{'type':db['Sequelize'][_0xa1be('0x5d')][_0xa1be('0x60')],'raw':!![],'transaction':_0x3929fd});})['then'](function(_0x894dd3){var _0x3fa50e=_[_0xa1be('0x31')](_0x894dd3,function(_0x35af34){return Number(_0x35af34[_0xa1be('0x64')]);});return db['UserMailQueue']['destroy']({'where':{'UserId':{'$in':_0x1f5c44},'MailQueueId':{'$in':_0x3fa50e}},'transaction':_0x3929fd});})[_0xa1be('0x2d')](function(){var _0x953d10='SELECT\x20SmsQueueId\x20FROM\x20team_has_sms_queues\x20WHERE\x20TeamId\x20=\x20'+_0x24fa7f;return db[_0xa1be('0x59')]['query'](_0x953d10,{'type':db[_0xa1be('0x5c')]['QueryTypes'][_0xa1be('0x60')],'raw':!![],'transaction':_0x3929fd});})[_0xa1be('0x2d')](function(_0x458180){var _0x4f4d77=_[_0xa1be('0x31')](_0x458180,function(_0x4f0b0b){return Number(_0x4f0b0b[_0xa1be('0x65')]);});return db['UserSmsQueue'][_0xa1be('0x58')]({'where':{'UserId':{'$in':_0x1f5c44},'SmsQueueId':{'$in':_0x4f4d77}},'transaction':_0x3929fd});})[_0xa1be('0x2d')](function(){var _0x50be65=_0xa1be('0x66')+_0x24fa7f;return db['sequelize'][_0xa1be('0x37')](_0x50be65,{'type':db[_0xa1be('0x5c')]['QueryTypes'][_0xa1be('0x60')],'raw':!![],'transaction':_0x3929fd});})[_0xa1be('0x2d')](function(_0x5c4535){var _0xcd70c3=_[_0xa1be('0x31')](_0x5c4535,function(_0x4585a3){return Number(_0x4585a3[_0xa1be('0x67')]);});return db[_0xa1be('0x68')][_0xa1be('0x58')]({'where':{'UserId':{'$in':_0x1f5c44},'ChatQueueId':{'$in':_0xcd70c3}},'transaction':_0x3929fd});})[_0xa1be('0x2d')](function(){var _0x25fa9e=_0xa1be('0x69')+_0x24fa7f;return db[_0xa1be('0x59')][_0xa1be('0x37')](_0x25fa9e,{'type':db[_0xa1be('0x5c')]['QueryTypes'][_0xa1be('0x60')],'raw':!![],'transaction':_0x3929fd});})[_0xa1be('0x2d')](function(_0x5c4cd5){var _0x51d0de=_[_0xa1be('0x31')](_0x5c4cd5,function(_0x4f474d){return Number(_0x4f474d[_0xa1be('0x6a')]);});return db['UserFaxQueue'][_0xa1be('0x58')]({'where':{'UserId':{'$in':_0x1f5c44},'FaxQueueId':{'$in':_0x51d0de}},'transaction':_0x3929fd});})[_0xa1be('0x2d')](function(){var _0xe08679=_0xa1be('0x6b')+_0x24fa7f;return db[_0xa1be('0x59')][_0xa1be('0x37')](_0xe08679,{'type':db[_0xa1be('0x5c')][_0xa1be('0x5d')][_0xa1be('0x60')],'raw':!![],'transaction':_0x3929fd});})[_0xa1be('0x2d')](function(_0x5d3245){var _0x6ddf45=_[_0xa1be('0x31')](_0x5d3245,function(_0x3b0c5e){return Number(_0x3b0c5e[_0xa1be('0x6c')]);});return db[_0xa1be('0x6d')][_0xa1be('0x58')]({'where':{'UserId':{'$in':_0x1f5c44},'OpenchannelQueueId':{'$in':_0x6ddf45}},'transaction':_0x3929fd});})['then'](function(){var _0x4bdd4a=_0xa1be('0x6e')+_0x24fa7f;return db[_0xa1be('0x59')][_0xa1be('0x37')](_0x4bdd4a,{'type':db['Sequelize']['QueryTypes'][_0xa1be('0x60')],'raw':!![],'transaction':_0x3929fd});})['then'](function(_0x3c1922){var _0x139f89=_[_0xa1be('0x31')](_0x3c1922,function(_0x24b9d4){return Number(_0x24b9d4[_0xa1be('0x6f')]);});return db[_0xa1be('0x70')][_0xa1be('0x58')]({'where':{'UserId':{'$in':_0x1f5c44},'WhatsappQueueId':{'$in':_0x139f89}},'transaction':_0x3929fd});})['then'](function(){return db[_0xa1be('0x71')]['find']({'where':{'TeamId':_0x24fa7f}});})[_0xa1be('0x2d')](function(_0x1c91cd){if(_0x1c91cd===null){return;}return db[_0xa1be('0x72')][_0xa1be('0x58')]({'where':{'UserId':{'$in':_0x1f5c44},'VoicePrefixId':_0x1c91cd[_0xa1be('0x73')]},'transaction':_0x3929fd});})[_0xa1be('0x2d')](function(){return db[_0xa1be('0x32')]['destroy']({'where':{'id':_0x24fa7f},'cascade':!![],'transaction':_0x3929fd});})['then'](function(_0x38f545){if(_0x38f545===0x0){_0x19673a[_0xa1be('0x21')](0x194);}else{return db[_0xa1be('0x74')][_0xa1be('0x58')]({'where':{'type':_0xa1be('0x53'),'resourceId':_0x24fa7f},'cascade':!![],'transaction':_0x3929fd})[_0xa1be('0x2d')](function(){_0x19673a['status'](0xcc)['end']();});}})['catch'](function(_0x4da3d6){_0x19673a[_0xa1be('0x22')](0x1f4)[_0xa1be('0x2f')](_0x4da3d6);});});};exports[_0xa1be('0x75')]=function(_0x11d985,_0x1aeb1,_0xa2e4ae){return db[_0xa1be('0x32')]['findOne']({'where':{'id':_0x11d985[_0xa1be('0x57')]['id']}})[_0xa1be('0x2d')](handleEntityNotFound(_0x1aeb1,null))[_0xa1be('0x2d')](function(_0x5d8266){if(!_0x11d985['query']['channel']||!utils['isValidChannel'](_0x11d985[_0xa1be('0x37')][_0xa1be('0x76')])){throw new db['Sequelize'][(_0xa1be('0x77'))]('Unknown\x20channel');}var _0xee5edb={};var _0xdfec49={};_0xdfec49[_0xa1be('0x36')]=_[_0xa1be('0x38')](db[_[_0xa1be('0x78')](_0x11d985[_0xa1be('0x37')][_0xa1be('0x76')][_0xa1be('0x79')]())+_0xa1be('0x7a')][_0xa1be('0x33')]);_0xdfec49['query']=_[_0xa1be('0x38')](_0x11d985['query']);_0xdfec49['filters']=_['intersection'](_0xdfec49[_0xa1be('0x36')],_0xdfec49[_0xa1be('0x37')]);_0xee5edb[_0xa1be('0x3c')]=_[_0xa1be('0x3a')](_0xdfec49[_0xa1be('0x36')],qs[_0xa1be('0x3b')](_0x11d985[_0xa1be('0x37')][_0xa1be('0x3b')]));_0xee5edb[_0xa1be('0x3c')]=_0xee5edb[_0xa1be('0x3c')][_0xa1be('0x3d')]?_0xee5edb[_0xa1be('0x3c')]:_0xdfec49[_0xa1be('0x36')];_0xee5edb['limit']=qs[_0xa1be('0x3f')](_0x11d985[_0xa1be('0x37')]['limit']);_0xee5edb[_0xa1be('0x25')]=qs[_0xa1be('0x25')](_0x11d985['query'][_0xa1be('0x25')]);_0xee5edb['order']=qs['sort'](_0x11d985[_0xa1be('0x37')]['sort']);_0xee5edb[_0xa1be('0x42')]=qs['filters'](_[_0xa1be('0x43')](_0x11d985[_0xa1be('0x37')],_0xdfec49[_0xa1be('0x39')]));_0xee5edb=_[_0xa1be('0x45')]({},_0xee5edb,_0x11d985[_0xa1be('0x47')]);return _0x5d8266[_0xa1be('0x50')+_[_0xa1be('0x78')](_0x11d985[_0xa1be('0x37')][_0xa1be('0x76')][_0xa1be('0x79')]())+_0xa1be('0x7b')](_0xee5edb);})['then'](respondWithResult(_0x1aeb1,null))[_0xa1be('0x49')](handleError(_0x1aeb1,null));};exports[_0xa1be('0x7c')]=function(_0x44aa02,_0x6a6867,_0x339dba){return db[_0xa1be('0x32')][_0xa1be('0x7d')]({'where':{'id':_0x44aa02[_0xa1be('0x57')]['id']}})['then'](function(_0x47c622){if(_0x47c622){if(!_0x44aa02[_0xa1be('0x4e')]['channel']||!utils['isValidChannel'](_0x44aa02[_0xa1be('0x4e')]['channel'])){throw new db[(_0xa1be('0x5c'))][(_0xa1be('0x77'))](_0xa1be('0x7e'));}return _0x47c622[_0xa1be('0x7f')+_['capitalize'](_0x44aa02[_0xa1be('0x4e')][_0xa1be('0x76')][_0xa1be('0x79')]())+_0xa1be('0x7b')](_0x44aa02['body']['ids']);}return null;})[_0xa1be('0x2d')](handleEntityNotFound(_0x6a6867,null))[_0xa1be('0x2d')](respondWithStatusCode(_0x6a6867,null))[_0xa1be('0x49')](handleError(_0x6a6867,null));};exports[_0xa1be('0x80')]=function(_0x202852,_0x8ac248,_0x31293f){return db['Team'][_0xa1be('0x7d')]({'where':{'id':_0x202852[_0xa1be('0x57')]['id']}})[_0xa1be('0x2d')](function(_0x309496){if(_0x309496){if(!_0x202852['query'][_0xa1be('0x76')]||!utils[_0xa1be('0x81')](_0x202852['query'][_0xa1be('0x76')])){throw new db[(_0xa1be('0x5c'))][(_0xa1be('0x77'))](_0xa1be('0x7e'));}return _0x309496[_0xa1be('0x82')+_[_0xa1be('0x78')](_0x202852[_0xa1be('0x37')][_0xa1be('0x76')][_0xa1be('0x79')]())+'Queues'](_0x202852[_0xa1be('0x37')]['ids']);}return null;})['then'](handleEntityNotFound(_0x8ac248,null))[_0xa1be('0x2d')](respondWithStatusCode(_0x8ac248,null))[_0xa1be('0x49')](handleError(_0x8ac248,null));};exports[_0xa1be('0x83')]=function(_0x52b371,_0x4099c2){var _0x348c85=_[_0xa1be('0x84')](_0x52b371[_0xa1be('0x4e')][_0xa1be('0x85')])?_0x52b371[_0xa1be('0x4e')][_0xa1be('0x85')]:[_0x52b371[_0xa1be('0x4e')][_0xa1be('0x85')]];var _0x41ce8b=_0x52b371['params']['id'];return db['Team'][_0xa1be('0x4c')]({'where':{'id':_0x41ce8b}})[_0xa1be('0x2d')](handleEntityNotFound(_0x4099c2,null))[_0xa1be('0x2d')](function(_0x3b553a){if(_0x3b553a){var _0x20f841=['Voice',_0xa1be('0x86'),'Mail',_0xa1be('0x87'),_0xa1be('0x88'),'Openchannel',_0xa1be('0x89')];return db['sequelize']['transaction'](function(_0x2bce4b){var _0x584e92=_[_0xa1be('0x31')](_0x20f841,function(_0x349731){var _0x6025ae={'attributes':['id',_0xa1be('0x2e')]};if(_0x349731===_0xa1be('0x8a')){_0x6025ae[_0xa1be('0x8b')]={'attributes':['penalty']};}return _0x3b553a[_0xa1be('0x50')+_0x349731+_0xa1be('0x7b')](_0x6025ae)[_0xa1be('0x2d')](function(_0x1eceb9){var _0x63414f=_[_0xa1be('0x31')](_0x1eceb9,function(_0xc61a0b){var _0xaeeb50=_[_0xa1be('0x31')](_0x348c85,function(_0x11da5f){var _0x4de727={'where':{'UserId':_0x11da5f,[_0x349731+_0xa1be('0x8c')]:_0xc61a0b['id']},'transaction':_0x2bce4b};if(_0x349731==='Voice'){_0x4de727['defaults']={'penalty':_0xc61a0b['TeamVoiceQueue'][_0xa1be('0x8d')]};}return db[_0xa1be('0x8e')+_0x349731+_0xa1be('0x7a')][_0xa1be('0x8f')](_0x4de727)[_0xa1be('0x2d')](function(){socket[_0xa1be('0x90')](_0xa1be('0x4f')+_0x349731+_0xa1be('0x91'),{'UserId':_0x11da5f,[_0x349731+_0xa1be('0x8c')]:_0xc61a0b['id']});if(_0x349731!=='Voice'){return;}return db[_0xa1be('0x8e')][_0xa1be('0x92')]({'where':{'id':_0x348c85,'online':0x1},'attributes':['id',_0xa1be('0x2e'),_0xa1be('0x93'),_0xa1be('0x94'),'interface'],'raw':!![]})[_0xa1be('0x2d')](function(_0x29c6ff){var _0x5b861b=_[_0xa1be('0x31')](_0x29c6ff,function(_0x1072a2){return db[_0xa1be('0x95')]['upsert']({'membername':_0x1072a2[_0xa1be('0x2e')],'UserId':_0x1072a2['id'],'queue_name':_0xc61a0b[_0xa1be('0x2e')],'VoiceQueueId':_0xc61a0b['id'],'interface':_[_0xa1be('0x96')](_0x1072a2[_0xa1be('0x97')])?util[_0xa1be('0x98')](_0xa1be('0x99'),_0x1072a2[_0xa1be('0x2e')]):_0x1072a2[_0xa1be('0x97')],'paused':_0x1072a2[_0xa1be('0x94')]||![],'penalty':_0xc61a0b[_0xa1be('0x9a')][_0xa1be('0x8d')]},{'transaction':_0x2bce4b});});return Promise[_0xa1be('0x9b')](_0x5b861b);});});});return Promise['all'](_0xaeeb50);});return Promise['all'](_0x63414f);})[_0xa1be('0x2d')](function(){return db[_0xa1be('0x71')][_0xa1be('0x7d')]({'where':{'teamId':_0x41ce8b}})[_0xa1be('0x2d')](function(_0x23dc9b){if(_0x23dc9b){var _0x486137=_[_0xa1be('0x31')](_0x348c85,function(_0x3283b8){db[_0xa1be('0x72')][_0xa1be('0x9c')]({'UserId':_0x3283b8,'VoicePrefixId':_0x23dc9b[_0xa1be('0x73')]});});return Promise[_0xa1be('0x9b')](_0x486137);}});});});return Promise[_0xa1be('0x9b')](_0x584e92)['then'](function(){return _0x3b553a['addAgents'](_0x348c85,{'transaction':_0x2bce4b})['spread'](function(_0x2450fd){return _0x2450fd;});});});}})['then'](respondWithResult(_0x4099c2,null))['catch'](handleError(_0x4099c2,null));};exports[_0xa1be('0x9d')]=function(_0x56489f,_0x5d513a){var _0x1335be=_[_0xa1be('0x84')](_0x56489f[_0xa1be('0x37')][_0xa1be('0x85')])?_0x56489f['query'][_0xa1be('0x85')]:[_0x56489f['query'][_0xa1be('0x85')]];var _0x537b1e=_0x56489f[_0xa1be('0x57')]['id'];return db[_0xa1be('0x32')][_0xa1be('0x4c')]({'where':{'id':_0x537b1e}})[_0xa1be('0x2d')](handleEntityNotFound(_0x5d513a,null))[_0xa1be('0x2d')](function(_0x8814ed){if(_0x8814ed){var _0x139fa1=[_0xa1be('0x8a'),_0xa1be('0x86'),_0xa1be('0x9e'),_0xa1be('0x87'),_0xa1be('0x88'),_0xa1be('0x9f'),_0xa1be('0x89')];return db['sequelize'][_0xa1be('0x5a')](function(_0x2def79){var _0x4e78a6=_['map'](_0x139fa1,function(_0x33696f){var _0x2298ac={'attributes':['id',_0xa1be('0x2e')]};return _0x8814ed[_0xa1be('0x50')+_0x33696f+_0xa1be('0x7b')](_0x2298ac)[_0xa1be('0x2d')](function(_0xe1ef39){var _0x349b71=_[_0xa1be('0x31')](_0xe1ef39,function(_0x109a31){return _0x109a31[_0xa1be('0x9d')](_0x1335be,{'transaction':_0x2def79})[_0xa1be('0x2d')](function(){var _0xeaeb6d=_[_0xa1be('0x31')](_0x1335be,function(_0x17443a){socket[_0xa1be('0x90')](_0xa1be('0x4f')+_0x33696f+'Queue:remove',{'UserId':Number(_0x17443a),[_0x33696f+_0xa1be('0x8c')]:_0x109a31['id']});if(_0x33696f!==_0xa1be('0x8a')){return;}return db[_0xa1be('0x95')][_0xa1be('0x58')]({'where':{'VoiceQueueId':_0x109a31['id'],'UserId':_0x17443a},'transaction':_0x2def79});});return Promise[_0xa1be('0x9b')](_0xeaeb6d);});});return Promise[_0xa1be('0x9b')](_0x349b71);});});return Promise[_0xa1be('0x9b')](_0x4e78a6)[_0xa1be('0x2d')](function(){return _0x8814ed['removeAgents'](_0x1335be,{'transaction':_0x2def79});})[_0xa1be('0x2d')](function(){return db[_0xa1be('0x71')][_0xa1be('0x7d')]({'where':{'teamId':_0x537b1e}})[_0xa1be('0x2d')](function(_0x58b1a4){if(_0x58b1a4){var _0x33502f=_[_0xa1be('0x31')](_0x1335be,function(_0x2257f4){db[_0xa1be('0x72')][_0xa1be('0x58')]({'where':{'UserId':_0x2257f4,'VoicePrefixId':_0x58b1a4[_0xa1be('0x73')]}});});return Promise[_0xa1be('0x9b')](_0x33502f);}});});});}})['then'](respondWithStatusCode(_0x5d513a,null))['catch'](handleError(_0x5d513a,null));};exports[_0xa1be('0xa0')]=function(_0x56fe43,_0x22e833,_0x176c32){var _0x4c162b={};var _0x33106b={};var _0x3cc30f;var _0x2681e4;return db[_0xa1be('0x32')][_0xa1be('0x7d')]({'where':{'id':_0x56fe43['params']['id']}})['then'](handleEntityNotFound(_0x22e833,null))[_0xa1be('0x2d')](function(_0x3144c8){if(_0x3144c8){_0x3cc30f=_0x3144c8;_0x33106b['model']=_[_0xa1be('0x38')](db[_0xa1be('0x8e')][_0xa1be('0x33')]);_0x33106b[_0xa1be('0x37')]=_[_0xa1be('0x38')](_0x56fe43['query']);_0x33106b[_0xa1be('0x39')]=_[_0xa1be('0x3a')](_0x33106b['model'],_0x33106b[_0xa1be('0x37')]);_0x4c162b[_0xa1be('0x3c')]=_['intersection'](_0x33106b[_0xa1be('0x36')],qs[_0xa1be('0x3b')](_0x56fe43[_0xa1be('0x37')][_0xa1be('0x3b')]));_0x4c162b[_0xa1be('0x3c')]=_0x4c162b[_0xa1be('0x3c')][_0xa1be('0x3d')]?_0x4c162b[_0xa1be('0x3c')]:_0x33106b[_0xa1be('0x36')];_0x4c162b[_0xa1be('0x40')]=qs[_0xa1be('0x41')](_0x56fe43[_0xa1be('0x37')][_0xa1be('0x41')]);_0x4c162b['where']=qs[_0xa1be('0x39')](_[_0xa1be('0x43')](_0x56fe43[_0xa1be('0x37')],_0x33106b[_0xa1be('0x39')]));if(_0x56fe43[_0xa1be('0x37')][_0xa1be('0x44')]){_0x4c162b[_0xa1be('0x42')]=_[_0xa1be('0x45')](_0x4c162b['where'],{'$or':_[_0xa1be('0x31')](_0x4c162b[_0xa1be('0x3c')],function(_0x5ad1e1){var _0x192baf={};_0x192baf[_0x5ad1e1]={'$like':'%'+_0x56fe43['query'][_0xa1be('0x44')]+'%'};return _0x192baf;})});}_0x4c162b=_[_0xa1be('0x45')]({},_0x4c162b,_0x56fe43[_0xa1be('0x47')]);return _0x3cc30f[_0xa1be('0xa0')](_0x4c162b);}})['then'](function(_0x32c710){if(_0x32c710){_0x2681e4=_0x32c710[_0xa1be('0x3d')];if(!_0x56fe43['query'][_0xa1be('0xa1')]('nolimit')){_0x4c162b[_0xa1be('0x3f')]=qs[_0xa1be('0x3f')](_0x56fe43['query'][_0xa1be('0x3f')]);_0x4c162b[_0xa1be('0x25')]=qs[_0xa1be('0x25')](_0x56fe43['query'][_0xa1be('0x25')]);}return _0x3cc30f[_0xa1be('0xa0')](_0x4c162b);}})[_0xa1be('0x2d')](function(_0x24ade4){if(_0x24ade4){return _0x24ade4?{'count':_0x2681e4,'rows':_0x24ade4}:null;}})[_0xa1be('0x2d')](respondWithResult(_0x22e833,null))[_0xa1be('0x49')](handleError(_0x22e833,null));}; \ No newline at end of file +var _0xabdc=['moment','mustache','util','path','sox','to-csv','ejs','fs-extra','squel','crypto','jsforce','desk.js','querystring','../../components/auth/service','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','localhost','./team.socket','sendStatus','status','end','json','undefined','limit','count','set','Content-Range','apply','reject','save','update','error','name','send','index','map','Team','rawAttributes','type','key','model','query','keys','filters','intersection','fields','attributes','nolimit','offset','order','sort','where','pick','filter','merge','VIRTUAL','options','then','includeAll','include','rows','catch','find','create','user','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','Teams','userProfileId','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','destroy','params','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','MailQueueId','UserMailQueue','UserSmsQueue','SELECT\x20ChatQueueId\x20FROM\x20team_has_chat_queues\x20WHERE\x20TeamId\x20=\x20','ChatQueueId','UserChatQueue','SELECT\x20FaxQueueId\x20FROM\x20team_has_fax_queues\x20WHERE\x20TeamId\x20=\x20','FaxQueueId','OpenchannelQueueId','UserOpenchannelQueue','SELECT\x20WhatsappQueueId\x20FROM\x20team_has_whatsapp_queues\x20WHERE\x20TeamId\x20=\x20','WhatsappQueueId','UserWhatsappQueue','TeamVoicePrefix','UserProfileResource','getQueues','findOne','channel','isValidChannel','ValidationError','Unknown\x20channel','toLowerCase','Queue','capitalize','Queues','add','ids','removeQueues','remove','addAgents','isArray','Mail','Sms','Fax','Openchannel','Whatsapp','Voice','penalty','QueueId','TeamVoiceQueue','User','findOrCreate','emit','Queue:save','findAll','online','voicePause','UserVoiceQueueRt','isNil','interface','format','SIP/%s','all','UserVoicePrefix','upsert','removeAgents','Queue:remove','getAgents','length','hasOwnProperty','eml-format','rimraf','zip-dir','fast-json-patch','request-promise'];(function(_0x3c8128,_0x1879d0){var _0xd15768=function(_0x14c8a8){while(--_0x14c8a8){_0x3c8128['push'](_0x3c8128['shift']());}};_0xd15768(++_0x1879d0);}(_0xabdc,0x131));var _0xcabd=function(_0x23c78e,_0x1f4dff){_0x23c78e=_0x23c78e-0x0;var _0x246c05=_0xabdc[_0x23c78e];return _0x246c05;};'use strict';var emlformat=require(_0xcabd('0x0'));var rimraf=require(_0xcabd('0x1'));var zipdir=require(_0xcabd('0x2'));var jsonpatch=require(_0xcabd('0x3'));var rp=require(_0xcabd('0x4'));var moment=require(_0xcabd('0x5'));var BPromise=require('bluebird');var Mustache=require(_0xcabd('0x6'));var util=require(_0xcabd('0x7'));var path=require(_0xcabd('0x8'));var sox=require(_0xcabd('0x9'));var csv=require(_0xcabd('0xa'));var ejs=require(_0xcabd('0xb'));var fs=require('fs');var fs_extra=require(_0xcabd('0xc'));var _=require('lodash');var squel=require(_0xcabd('0xd'));var crypto=require(_0xcabd('0xe'));var jsforce=require(_0xcabd('0xf'));var deskjs=require(_0xcabd('0x10'));var toCsv=require('to-csv');var querystring=require(_0xcabd('0x11'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0xcabd('0x12'));var qs=require('../../components/parsers/qs');var as=require(_0xcabd('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xcabd('0x14'))(_0xcabd('0x15'));var utils=require(_0xcabd('0x16'));var config=require(_0xcabd('0x17'));var licenseUtil=require(_0xcabd('0x18'));var db=require(_0xcabd('0x19'))['db'];config[_0xcabd('0x1a')]=_[_0xcabd('0x1b')](config[_0xcabd('0x1a')],{'host':_0xcabd('0x1c'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require(_0xcabd('0x1d'))['register'](socket);function respondWithStatusCode(_0xffa6e5,_0x2c0e91){_0x2c0e91=_0x2c0e91||0xcc;return function(_0x11bd5f){if(_0x11bd5f){return _0xffa6e5[_0xcabd('0x1e')](_0x2c0e91);}return _0xffa6e5[_0xcabd('0x1f')](_0x2c0e91)[_0xcabd('0x20')]();};}function respondWithResult(_0x49ba8c,_0x5a7c2f){_0x5a7c2f=_0x5a7c2f||0xc8;return function(_0x199b57){if(_0x199b57){return _0x49ba8c[_0xcabd('0x1f')](_0x5a7c2f)[_0xcabd('0x21')](_0x199b57);}};}function respondWithFilteredResult(_0x2a62bd,_0x260719){return function(_0x1bdeac){if(_0x1bdeac){var _0x1b8d4e=typeof _0x260719['offset']===_0xcabd('0x22')&&typeof _0x260719[_0xcabd('0x23')]===_0xcabd('0x22');var _0x3b4668=_0x1bdeac[_0xcabd('0x24')];var _0x556576=_0x1b8d4e?0x0:_0x260719['offset'];var _0x3ec02c=_0x1b8d4e?_0x1bdeac[_0xcabd('0x24')]:_0x260719['offset']+_0x260719[_0xcabd('0x23')];var _0xaefd61;if(_0x3ec02c>=_0x3b4668){_0x3ec02c=_0x3b4668;_0xaefd61=0xc8;}else{_0xaefd61=0xce;}_0x2a62bd[_0xcabd('0x1f')](_0xaefd61);return _0x2a62bd[_0xcabd('0x25')](_0xcabd('0x26'),_0x556576+'-'+_0x3ec02c+'/'+_0x3b4668)[_0xcabd('0x21')](_0x1bdeac);}return null;};}function patchUpdates(_0x46612d){return function(_0xc39dbf){try{jsonpatch[_0xcabd('0x27')](_0xc39dbf,_0x46612d,!![]);}catch(_0x4ab95b){return BPromise[_0xcabd('0x28')](_0x4ab95b);}return _0xc39dbf[_0xcabd('0x29')]();};}function saveUpdates(_0x215369,_0x51ee02){return function(_0x916bee){if(_0x916bee){return _0x916bee[_0xcabd('0x2a')](_0x215369)['then'](function(_0x26f364){return _0x26f364;});}return null;};}function handleEntityNotFound(_0x5c2b82,_0x1e3570){return function(_0x97b5ef){if(!_0x97b5ef){_0x5c2b82[_0xcabd('0x1e')](0x194);}return _0x97b5ef;};}function handleError(_0x363c1e,_0x2d57d5){_0x2d57d5=_0x2d57d5||0x1f4;return function(_0x2e5260){logger[_0xcabd('0x2b')](_0x2e5260['stack']);if(_0x2e5260['name']){delete _0x2e5260[_0xcabd('0x2c')];}_0x363c1e[_0xcabd('0x1f')](_0x2d57d5)[_0xcabd('0x2d')](_0x2e5260);};}exports[_0xcabd('0x2e')]=function(_0x3612e4,_0x1b1c11){var _0x59115b={},_0x5d718b={},_0x1e1055={'count':0x0,'rows':[]};var _0x11aac1=_[_0xcabd('0x2f')](db[_0xcabd('0x30')][_0xcabd('0x31')],function(_0x235510){return{'name':_0x235510['fieldName'],'type':_0x235510[_0xcabd('0x32')][_0xcabd('0x33')]};});_0x5d718b[_0xcabd('0x34')]=_[_0xcabd('0x2f')](_0x11aac1,'name');_0x5d718b[_0xcabd('0x35')]=_[_0xcabd('0x36')](_0x3612e4['query']);_0x5d718b[_0xcabd('0x37')]=_[_0xcabd('0x38')](_0x5d718b['model'],_0x5d718b[_0xcabd('0x35')]);_0x59115b['attributes']=_['intersection'](_0x5d718b[_0xcabd('0x34')],qs[_0xcabd('0x39')](_0x3612e4[_0xcabd('0x35')][_0xcabd('0x39')]));_0x59115b[_0xcabd('0x3a')]=_0x59115b[_0xcabd('0x3a')]['length']?_0x59115b[_0xcabd('0x3a')]:_0x5d718b[_0xcabd('0x34')];if(!_0x3612e4[_0xcabd('0x35')]['hasOwnProperty'](_0xcabd('0x3b'))){_0x59115b[_0xcabd('0x23')]=qs[_0xcabd('0x23')](_0x3612e4[_0xcabd('0x35')][_0xcabd('0x23')]);_0x59115b[_0xcabd('0x3c')]=qs[_0xcabd('0x3c')](_0x3612e4[_0xcabd('0x35')][_0xcabd('0x3c')]);}_0x59115b[_0xcabd('0x3d')]=qs[_0xcabd('0x3e')](_0x3612e4['query'][_0xcabd('0x3e')]);_0x59115b[_0xcabd('0x3f')]=qs['filters'](_[_0xcabd('0x40')](_0x3612e4[_0xcabd('0x35')],_0x5d718b[_0xcabd('0x37')]),_0x11aac1);if(_0x3612e4['query'][_0xcabd('0x41')]){_0x59115b[_0xcabd('0x3f')]=_[_0xcabd('0x42')](_0x59115b[_0xcabd('0x3f')],{'$or':_['map'](_0x11aac1,function(_0x143a50){if(_0x143a50[_0xcabd('0x32')]!==_0xcabd('0x43')){var _0x419056={};_0x419056[_0x143a50[_0xcabd('0x2c')]]={'$like':'%'+_0x3612e4['query']['filter']+'%'};return _0x419056;}})});}_0x59115b=_[_0xcabd('0x42')]({},_0x59115b,_0x3612e4[_0xcabd('0x44')]);var _0x189889={'where':_0x59115b['where']};return db[_0xcabd('0x30')][_0xcabd('0x24')](_0x189889)[_0xcabd('0x45')](function(_0x1fda5b){_0x1e1055[_0xcabd('0x24')]=_0x1fda5b;if(_0x3612e4[_0xcabd('0x35')][_0xcabd('0x46')]){_0x59115b[_0xcabd('0x47')]=[{'all':!![]}];}return db[_0xcabd('0x30')]['findAll'](_0x59115b);})[_0xcabd('0x45')](function(_0x1363f4){_0x1e1055[_0xcabd('0x48')]=_0x1363f4;return _0x1e1055;})[_0xcabd('0x45')](respondWithFilteredResult(_0x1b1c11,_0x59115b))[_0xcabd('0x49')](handleError(_0x1b1c11,null));};exports['show']=function(_0xae808b,_0x27c9bf){var _0x4e8d1a={'raw':![],'where':{'id':_0xae808b['params']['id']}},_0x15d6b2={};_0x15d6b2['model']=_[_0xcabd('0x36')](db['Team'][_0xcabd('0x31')]);_0x15d6b2[_0xcabd('0x35')]=_[_0xcabd('0x36')](_0xae808b['query']);_0x15d6b2[_0xcabd('0x37')]=_[_0xcabd('0x38')](_0x15d6b2[_0xcabd('0x34')],_0x15d6b2[_0xcabd('0x35')]);_0x4e8d1a[_0xcabd('0x3a')]=_[_0xcabd('0x38')](_0x15d6b2['model'],qs[_0xcabd('0x39')](_0xae808b[_0xcabd('0x35')][_0xcabd('0x39')]));_0x4e8d1a['attributes']=_0x4e8d1a[_0xcabd('0x3a')]['length']?_0x4e8d1a[_0xcabd('0x3a')]:_0x15d6b2[_0xcabd('0x34')];if(_0xae808b['query']['includeAll']){_0x4e8d1a['include']=[{'all':!![]}];}_0x4e8d1a=_[_0xcabd('0x42')]({},_0x4e8d1a,_0xae808b['options']);return db[_0xcabd('0x30')][_0xcabd('0x4a')](_0x4e8d1a)['then'](handleEntityNotFound(_0x27c9bf,null))[_0xcabd('0x45')](respondWithResult(_0x27c9bf,null))[_0xcabd('0x49')](handleError(_0x27c9bf,null));};exports['create']=function(_0x2703de,_0x29d3d7){return db[_0xcabd('0x30')][_0xcabd('0x4b')](_0x2703de['body'],{})[_0xcabd('0x45')](function(_0x3168a7){var _0xcba451=_0x2703de[_0xcabd('0x4c')][_0xcabd('0x4d')]({'plain':!![]});if(!_0xcba451)throw new Error(_0xcabd('0x4e'));if(_0xcba451['role']===_0xcabd('0x4c')){var _0x4a1f00=_0x3168a7[_0xcabd('0x4d')]({'plain':!![]});var _0x159d01=_0xcabd('0x4f');return db['UserProfileSection'][_0xcabd('0x4a')]({'where':{'name':_0x159d01,'userProfileId':_0xcba451[_0xcabd('0x50')]},'raw':!![]})[_0xcabd('0x45')](function(_0x2afc57){if(_0x2afc57&&_0x2afc57['autoAssociation']===0x0){return db['UserProfileResource']['create']({'name':_0x4a1f00['name'],'resourceId':_0x4a1f00['id'],'type':_0x2afc57[_0xcabd('0x2c')],'sectionId':_0x2afc57['id']},{})[_0xcabd('0x45')](function(){return _0x3168a7;});}else{return _0x3168a7;}})['catch'](function(_0x382b80){logger[_0xcabd('0x2b')](_0xcabd('0x51'),_0x382b80);throw _0x382b80;});}return _0x3168a7;})[_0xcabd('0x45')](respondWithResult(_0x29d3d7,0xc9))[_0xcabd('0x49')](handleError(_0x29d3d7,null));};exports[_0xcabd('0x2a')]=function(_0x4dfa51,_0xd8914e){if(_0x4dfa51['body']['id']){delete _0x4dfa51[_0xcabd('0x52')]['id'];}return db['Team'][_0xcabd('0x4a')]({'where':{'id':_0x4dfa51['params']['id']}})[_0xcabd('0x45')](handleEntityNotFound(_0xd8914e,null))['then'](saveUpdates(_0x4dfa51[_0xcabd('0x52')],null))['then'](respondWithResult(_0xd8914e,null))[_0xcabd('0x49')](handleError(_0xd8914e,null));};exports[_0xcabd('0x53')]=function(_0x1fe90b,_0x4bf73c){var _0xae0a8c=_0x1fe90b[_0xcabd('0x54')]['id'];var _0x59ad86=[];return db[_0xcabd('0x55')][_0xcabd('0x56')](function(_0x18edce){var _0x111e2d=_0xcabd('0x57')+_0xae0a8c;return db[_0xcabd('0x55')]['query'](_0x111e2d,{'type':db[_0xcabd('0x58')][_0xcabd('0x59')][_0xcabd('0x5a')],'raw':!![],'transaction':_0x18edce})['then'](function(_0x22d1e2){_0x59ad86=_[_0xcabd('0x2f')](_0x22d1e2,function(_0x56ecec){return Number(_0x56ecec[_0xcabd('0x5b')]);});})['then'](function(){var _0xc93d21=_0xcabd('0x5c')+_0xae0a8c;return db['sequelize'][_0xcabd('0x35')](_0xc93d21,{'type':db[_0xcabd('0x58')][_0xcabd('0x59')][_0xcabd('0x5a')],'raw':!![],'transaction':_0x18edce});})[_0xcabd('0x45')](function(_0x1115f1){var _0x4cf26b=_[_0xcabd('0x2f')](_0x1115f1,function(_0x1bf797){return Number(_0x1bf797[_0xcabd('0x5d')]);});return db[_0xcabd('0x5e')][_0xcabd('0x53')]({'where':{'UserId':{'$in':_0x59ad86},'VoiceQueueId':{'$in':_0x4cf26b}},'transaction':_0x18edce});})[_0xcabd('0x45')](function(){var _0x219937='SELECT\x20MailQueueId\x20FROM\x20team_has_mail_queues\x20WHERE\x20TeamId\x20=\x20'+_0xae0a8c;return db[_0xcabd('0x55')][_0xcabd('0x35')](_0x219937,{'type':db['Sequelize'][_0xcabd('0x59')][_0xcabd('0x5a')],'raw':!![],'transaction':_0x18edce});})[_0xcabd('0x45')](function(_0x371abc){var _0x22b824=_[_0xcabd('0x2f')](_0x371abc,function(_0x45be52){return Number(_0x45be52[_0xcabd('0x5f')]);});return db[_0xcabd('0x60')][_0xcabd('0x53')]({'where':{'UserId':{'$in':_0x59ad86},'MailQueueId':{'$in':_0x22b824}},'transaction':_0x18edce});})[_0xcabd('0x45')](function(){var _0x3d2b9b='SELECT\x20SmsQueueId\x20FROM\x20team_has_sms_queues\x20WHERE\x20TeamId\x20=\x20'+_0xae0a8c;return db['sequelize'][_0xcabd('0x35')](_0x3d2b9b,{'type':db['Sequelize']['QueryTypes']['SELECT'],'raw':!![],'transaction':_0x18edce});})[_0xcabd('0x45')](function(_0x49e5b0){var _0x5f46ae=_[_0xcabd('0x2f')](_0x49e5b0,function(_0x2b51e0){return Number(_0x2b51e0['SmsQueueId']);});return db[_0xcabd('0x61')][_0xcabd('0x53')]({'where':{'UserId':{'$in':_0x59ad86},'SmsQueueId':{'$in':_0x5f46ae}},'transaction':_0x18edce});})['then'](function(){var _0x6e204f=_0xcabd('0x62')+_0xae0a8c;return db[_0xcabd('0x55')][_0xcabd('0x35')](_0x6e204f,{'type':db[_0xcabd('0x58')]['QueryTypes']['SELECT'],'raw':!![],'transaction':_0x18edce});})[_0xcabd('0x45')](function(_0x36fc61){var _0x25993d=_[_0xcabd('0x2f')](_0x36fc61,function(_0x38610e){return Number(_0x38610e[_0xcabd('0x63')]);});return db[_0xcabd('0x64')]['destroy']({'where':{'UserId':{'$in':_0x59ad86},'ChatQueueId':{'$in':_0x25993d}},'transaction':_0x18edce});})['then'](function(){var _0xbd8c34=_0xcabd('0x65')+_0xae0a8c;return db[_0xcabd('0x55')][_0xcabd('0x35')](_0xbd8c34,{'type':db[_0xcabd('0x58')][_0xcabd('0x59')][_0xcabd('0x5a')],'raw':!![],'transaction':_0x18edce});})[_0xcabd('0x45')](function(_0x1e9011){var _0x5efb4d=_[_0xcabd('0x2f')](_0x1e9011,function(_0x4788b3){return Number(_0x4788b3[_0xcabd('0x66')]);});return db['UserFaxQueue'][_0xcabd('0x53')]({'where':{'UserId':{'$in':_0x59ad86},'FaxQueueId':{'$in':_0x5efb4d}},'transaction':_0x18edce});})[_0xcabd('0x45')](function(){var _0x1ee5a1='SELECT\x20OpenchannelQueueId\x20FROM\x20team_has_openchannel_queues\x20WHERE\x20TeamId\x20=\x20'+_0xae0a8c;return db[_0xcabd('0x55')][_0xcabd('0x35')](_0x1ee5a1,{'type':db['Sequelize'][_0xcabd('0x59')][_0xcabd('0x5a')],'raw':!![],'transaction':_0x18edce});})[_0xcabd('0x45')](function(_0x4d680c){var _0x59fb5e=_[_0xcabd('0x2f')](_0x4d680c,function(_0x1aa5be){return Number(_0x1aa5be[_0xcabd('0x67')]);});return db[_0xcabd('0x68')][_0xcabd('0x53')]({'where':{'UserId':{'$in':_0x59ad86},'OpenchannelQueueId':{'$in':_0x59fb5e}},'transaction':_0x18edce});})[_0xcabd('0x45')](function(){var _0x2392db=_0xcabd('0x69')+_0xae0a8c;return db[_0xcabd('0x55')][_0xcabd('0x35')](_0x2392db,{'type':db[_0xcabd('0x58')][_0xcabd('0x59')][_0xcabd('0x5a')],'raw':!![],'transaction':_0x18edce});})[_0xcabd('0x45')](function(_0x494771){var _0x14486b=_['map'](_0x494771,function(_0x4110c3){return Number(_0x4110c3[_0xcabd('0x6a')]);});return db[_0xcabd('0x6b')][_0xcabd('0x53')]({'where':{'UserId':{'$in':_0x59ad86},'WhatsappQueueId':{'$in':_0x14486b}},'transaction':_0x18edce});})['then'](function(){return db[_0xcabd('0x6c')][_0xcabd('0x4a')]({'where':{'TeamId':_0xae0a8c}});})[_0xcabd('0x45')](function(_0xfc5ffd){if(_0xfc5ffd===null){return;}return db['UserVoicePrefix']['destroy']({'where':{'UserId':{'$in':_0x59ad86},'VoicePrefixId':_0xfc5ffd['VoicePrefixId']},'transaction':_0x18edce});})['then'](function(){return db[_0xcabd('0x30')][_0xcabd('0x53')]({'where':{'id':_0xae0a8c},'cascade':!![],'transaction':_0x18edce});})[_0xcabd('0x45')](function(_0x51445c){if(_0x51445c===0x0){_0x4bf73c[_0xcabd('0x1e')](0x194);}else{return db[_0xcabd('0x6d')][_0xcabd('0x53')]({'where':{'type':_0xcabd('0x4f'),'resourceId':_0xae0a8c},'cascade':!![],'transaction':_0x18edce})['then'](function(){_0x4bf73c[_0xcabd('0x1f')](0xcc)[_0xcabd('0x20')]();});}})[_0xcabd('0x49')](function(_0x3d89b6){_0x4bf73c[_0xcabd('0x1f')](0x1f4)[_0xcabd('0x2d')](_0x3d89b6);});});};exports[_0xcabd('0x6e')]=function(_0x550f8a,_0x24e936,_0x444429){return db['Team'][_0xcabd('0x6f')]({'where':{'id':_0x550f8a['params']['id']}})[_0xcabd('0x45')](handleEntityNotFound(_0x24e936,null))[_0xcabd('0x45')](function(_0x44483f){if(!_0x550f8a['query'][_0xcabd('0x70')]||!utils[_0xcabd('0x71')](_0x550f8a[_0xcabd('0x35')][_0xcabd('0x70')])){throw new db[(_0xcabd('0x58'))][(_0xcabd('0x72'))](_0xcabd('0x73'));}var _0x24ba33={};var _0x523744={};_0x523744[_0xcabd('0x34')]=_['keys'](db[_['capitalize'](_0x550f8a[_0xcabd('0x35')][_0xcabd('0x70')][_0xcabd('0x74')]())+_0xcabd('0x75')]['rawAttributes']);_0x523744[_0xcabd('0x35')]=_[_0xcabd('0x36')](_0x550f8a[_0xcabd('0x35')]);_0x523744[_0xcabd('0x37')]=_[_0xcabd('0x38')](_0x523744['model'],_0x523744[_0xcabd('0x35')]);_0x24ba33[_0xcabd('0x3a')]=_[_0xcabd('0x38')](_0x523744[_0xcabd('0x34')],qs[_0xcabd('0x39')](_0x550f8a[_0xcabd('0x35')][_0xcabd('0x39')]));_0x24ba33[_0xcabd('0x3a')]=_0x24ba33[_0xcabd('0x3a')]['length']?_0x24ba33[_0xcabd('0x3a')]:_0x523744[_0xcabd('0x34')];_0x24ba33['limit']=qs[_0xcabd('0x23')](_0x550f8a[_0xcabd('0x35')][_0xcabd('0x23')]);_0x24ba33[_0xcabd('0x3c')]=qs[_0xcabd('0x3c')](_0x550f8a['query'][_0xcabd('0x3c')]);_0x24ba33['order']=qs['sort'](_0x550f8a[_0xcabd('0x35')][_0xcabd('0x3e')]);_0x24ba33[_0xcabd('0x3f')]=qs[_0xcabd('0x37')](_['pick'](_0x550f8a[_0xcabd('0x35')],_0x523744[_0xcabd('0x37')]));_0x24ba33=_[_0xcabd('0x42')]({},_0x24ba33,_0x550f8a[_0xcabd('0x44')]);return _0x44483f[_0xcabd('0x4d')+_[_0xcabd('0x76')](_0x550f8a[_0xcabd('0x35')][_0xcabd('0x70')][_0xcabd('0x74')]())+_0xcabd('0x77')](_0x24ba33);})[_0xcabd('0x45')](respondWithResult(_0x24e936,null))[_0xcabd('0x49')](handleError(_0x24e936,null));};exports['addQueues']=function(_0x307cbb,_0x327cfe,_0x7b5206){return db[_0xcabd('0x30')][_0xcabd('0x6f')]({'where':{'id':_0x307cbb[_0xcabd('0x54')]['id']}})[_0xcabd('0x45')](function(_0x1a8ce8){if(_0x1a8ce8){if(!_0x307cbb['body']['channel']||!utils[_0xcabd('0x71')](_0x307cbb[_0xcabd('0x52')][_0xcabd('0x70')])){throw new db[(_0xcabd('0x58'))][(_0xcabd('0x72'))]('Unknown\x20channel');}return _0x1a8ce8[_0xcabd('0x78')+_[_0xcabd('0x76')](_0x307cbb[_0xcabd('0x52')][_0xcabd('0x70')][_0xcabd('0x74')]())+_0xcabd('0x77')](_0x307cbb[_0xcabd('0x52')][_0xcabd('0x79')]);}return null;})['then'](handleEntityNotFound(_0x327cfe,null))[_0xcabd('0x45')](respondWithStatusCode(_0x327cfe,null))[_0xcabd('0x49')](handleError(_0x327cfe,null));};exports[_0xcabd('0x7a')]=function(_0x3c8748,_0x220487,_0x583fcd){return db['Team']['findOne']({'where':{'id':_0x3c8748[_0xcabd('0x54')]['id']}})[_0xcabd('0x45')](function(_0x2efab7){if(_0x2efab7){if(!_0x3c8748[_0xcabd('0x35')][_0xcabd('0x70')]||!utils[_0xcabd('0x71')](_0x3c8748[_0xcabd('0x35')]['channel'])){throw new db[(_0xcabd('0x58'))][(_0xcabd('0x72'))](_0xcabd('0x73'));}return _0x2efab7[_0xcabd('0x7b')+_['capitalize'](_0x3c8748[_0xcabd('0x35')][_0xcabd('0x70')][_0xcabd('0x74')]())+_0xcabd('0x77')](_0x3c8748[_0xcabd('0x35')][_0xcabd('0x79')]);}return null;})[_0xcabd('0x45')](handleEntityNotFound(_0x220487,null))[_0xcabd('0x45')](respondWithStatusCode(_0x220487,null))['catch'](handleError(_0x220487,null));};exports[_0xcabd('0x7c')]=function(_0x393fa1,_0x5dd058){var _0x3f5ecc=_[_0xcabd('0x7d')](_0x393fa1[_0xcabd('0x52')][_0xcabd('0x79')])?_0x393fa1[_0xcabd('0x52')][_0xcabd('0x79')]:[_0x393fa1['body'][_0xcabd('0x79')]];var _0x20db66=_0x393fa1[_0xcabd('0x54')]['id'];return db['Team'][_0xcabd('0x4a')]({'where':{'id':_0x20db66}})['then'](handleEntityNotFound(_0x5dd058,null))[_0xcabd('0x45')](function(_0x4b2cad){if(_0x4b2cad){var _0x17f83b=['Voice','Chat',_0xcabd('0x7e'),_0xcabd('0x7f'),_0xcabd('0x80'),_0xcabd('0x81'),_0xcabd('0x82')];return db[_0xcabd('0x55')][_0xcabd('0x56')](function(_0xe37ce){var _0x3669f2=_[_0xcabd('0x2f')](_0x17f83b,function(_0x506b43){var _0x44c5a7={'attributes':['id',_0xcabd('0x2c')]};if(_0x506b43===_0xcabd('0x83')){_0x44c5a7['through']={'attributes':[_0xcabd('0x84')]};}return _0x4b2cad['get'+_0x506b43+'Queues'](_0x44c5a7)['then'](function(_0x557428){var _0x321374=_['map'](_0x557428,function(_0x4eea28){var _0x29aa32=_[_0xcabd('0x2f')](_0x3f5ecc,function(_0x45eca6){var _0x3b9efb={'where':{'UserId':_0x45eca6,[_0x506b43+_0xcabd('0x85')]:_0x4eea28['id']},'transaction':_0xe37ce};if(_0x506b43===_0xcabd('0x83')){_0x3b9efb[_0xcabd('0x1b')]={'penalty':_0x4eea28[_0xcabd('0x86')][_0xcabd('0x84')]};}return db[_0xcabd('0x87')+_0x506b43+'Queue'][_0xcabd('0x88')](_0x3b9efb)[_0xcabd('0x45')](function(){socket[_0xcabd('0x89')](_0xcabd('0x4c')+_0x506b43+_0xcabd('0x8a'),{'UserId':_0x45eca6,[_0x506b43+_0xcabd('0x85')]:_0x4eea28['id']});if(_0x506b43!=='Voice'){return;}return db[_0xcabd('0x87')][_0xcabd('0x8b')]({'where':{'id':_0x3f5ecc,'online':0x1},'attributes':['id',_0xcabd('0x2c'),_0xcabd('0x8c'),_0xcabd('0x8d'),'interface'],'raw':!![]})[_0xcabd('0x45')](function(_0x3101d2){var _0x342e8d=_['map'](_0x3101d2,function(_0x15575f){return db[_0xcabd('0x8e')]['upsert']({'membername':_0x15575f['name'],'UserId':_0x15575f['id'],'queue_name':_0x4eea28['name'],'VoiceQueueId':_0x4eea28['id'],'interface':_[_0xcabd('0x8f')](_0x15575f[_0xcabd('0x90')])?util[_0xcabd('0x91')](_0xcabd('0x92'),_0x15575f[_0xcabd('0x2c')]):_0x15575f['interface'],'paused':_0x15575f[_0xcabd('0x8d')]||![],'penalty':_0x4eea28[_0xcabd('0x86')][_0xcabd('0x84')]},{'transaction':_0xe37ce});});return Promise['all'](_0x342e8d);});});});return Promise['all'](_0x29aa32);});return Promise[_0xcabd('0x93')](_0x321374);})[_0xcabd('0x45')](function(){return db[_0xcabd('0x6c')][_0xcabd('0x6f')]({'where':{'teamId':_0x20db66}})['then'](function(_0x2d9325){if(_0x2d9325){var _0x277bd6=_[_0xcabd('0x2f')](_0x3f5ecc,function(_0x449a8a){db[_0xcabd('0x94')][_0xcabd('0x95')]({'UserId':_0x449a8a,'VoicePrefixId':_0x2d9325['VoicePrefixId']});});return Promise[_0xcabd('0x93')](_0x277bd6);}});});});return Promise[_0xcabd('0x93')](_0x3669f2)[_0xcabd('0x45')](function(){return _0x4b2cad['addAgents'](_0x3f5ecc,{'transaction':_0xe37ce})['spread'](function(_0x5ae848){return _0x5ae848;});});});}})[_0xcabd('0x45')](respondWithResult(_0x5dd058,null))[_0xcabd('0x49')](handleError(_0x5dd058,null));};exports[_0xcabd('0x96')]=function(_0x47e2b6,_0x5096f3){var _0x15036e=_[_0xcabd('0x7d')](_0x47e2b6[_0xcabd('0x35')][_0xcabd('0x79')])?_0x47e2b6[_0xcabd('0x35')][_0xcabd('0x79')]:[_0x47e2b6[_0xcabd('0x35')][_0xcabd('0x79')]];var _0x1e9e03=_0x47e2b6[_0xcabd('0x54')]['id'];return db[_0xcabd('0x30')][_0xcabd('0x4a')]({'where':{'id':_0x1e9e03}})[_0xcabd('0x45')](handleEntityNotFound(_0x5096f3,null))[_0xcabd('0x45')](function(_0x135b40){if(_0x135b40){var _0x4bd7e0=[_0xcabd('0x83'),'Chat',_0xcabd('0x7e'),_0xcabd('0x7f'),_0xcabd('0x80'),_0xcabd('0x81'),_0xcabd('0x82')];return db[_0xcabd('0x55')][_0xcabd('0x56')](function(_0x569096){var _0x50ded3=_[_0xcabd('0x2f')](_0x4bd7e0,function(_0x8f2ef0){var _0x3fd357={'attributes':['id','name']};return _0x135b40[_0xcabd('0x4d')+_0x8f2ef0+_0xcabd('0x77')](_0x3fd357)['then'](function(_0xfe7bd2){var _0x4cd2ef=_['map'](_0xfe7bd2,function(_0x58d121){return _0x58d121[_0xcabd('0x96')](_0x15036e,{'transaction':_0x569096})[_0xcabd('0x45')](function(){var _0x3b48fc=_[_0xcabd('0x2f')](_0x15036e,function(_0x492e71){socket['emit']('user'+_0x8f2ef0+_0xcabd('0x97'),{'UserId':Number(_0x492e71),[_0x8f2ef0+_0xcabd('0x85')]:_0x58d121['id']});if(_0x8f2ef0!=='Voice'){return;}return db[_0xcabd('0x8e')][_0xcabd('0x53')]({'where':{'VoiceQueueId':_0x58d121['id'],'UserId':_0x492e71},'transaction':_0x569096});});return Promise[_0xcabd('0x93')](_0x3b48fc);});});return Promise[_0xcabd('0x93')](_0x4cd2ef);});});return Promise[_0xcabd('0x93')](_0x50ded3)[_0xcabd('0x45')](function(){return _0x135b40[_0xcabd('0x96')](_0x15036e,{'transaction':_0x569096});})[_0xcabd('0x45')](function(){return db[_0xcabd('0x6c')]['findOne']({'where':{'teamId':_0x1e9e03}})[_0xcabd('0x45')](function(_0x1ae2dd){if(_0x1ae2dd){var _0x4d88e7=_['map'](_0x15036e,function(_0x4ffd99){db[_0xcabd('0x94')]['destroy']({'where':{'UserId':_0x4ffd99,'VoicePrefixId':_0x1ae2dd['VoicePrefixId']}});});return Promise['all'](_0x4d88e7);}});});});}})['then'](respondWithStatusCode(_0x5096f3,null))[_0xcabd('0x49')](handleError(_0x5096f3,null));};exports['getAgents']=function(_0x5b3622,_0x274e50,_0x51f2eb){var _0x52a14d={};var _0x5826df={};var _0x128cb4;var _0x325243;return db['Team'][_0xcabd('0x6f')]({'where':{'id':_0x5b3622[_0xcabd('0x54')]['id']}})[_0xcabd('0x45')](handleEntityNotFound(_0x274e50,null))[_0xcabd('0x45')](function(_0x3dfac1){if(_0x3dfac1){_0x128cb4=_0x3dfac1;_0x5826df[_0xcabd('0x34')]=_[_0xcabd('0x36')](db['User'][_0xcabd('0x31')]);_0x5826df[_0xcabd('0x35')]=_[_0xcabd('0x36')](_0x5b3622[_0xcabd('0x35')]);_0x5826df[_0xcabd('0x37')]=_[_0xcabd('0x38')](_0x5826df['model'],_0x5826df[_0xcabd('0x35')]);_0x52a14d[_0xcabd('0x3a')]=_[_0xcabd('0x38')](_0x5826df[_0xcabd('0x34')],qs['fields'](_0x5b3622[_0xcabd('0x35')][_0xcabd('0x39')]));_0x52a14d[_0xcabd('0x3a')]=_0x52a14d['attributes']['length']?_0x52a14d[_0xcabd('0x3a')]:_0x5826df[_0xcabd('0x34')];_0x52a14d[_0xcabd('0x3d')]=qs[_0xcabd('0x3e')](_0x5b3622[_0xcabd('0x35')][_0xcabd('0x3e')]);_0x52a14d[_0xcabd('0x3f')]=qs[_0xcabd('0x37')](_[_0xcabd('0x40')](_0x5b3622[_0xcabd('0x35')],_0x5826df[_0xcabd('0x37')]));if(_0x5b3622[_0xcabd('0x35')][_0xcabd('0x41')]){_0x52a14d[_0xcabd('0x3f')]=_[_0xcabd('0x42')](_0x52a14d[_0xcabd('0x3f')],{'$or':_[_0xcabd('0x2f')](_0x52a14d[_0xcabd('0x3a')],function(_0x53cf5b){var _0x509c02={};_0x509c02[_0x53cf5b]={'$like':'%'+_0x5b3622[_0xcabd('0x35')]['filter']+'%'};return _0x509c02;})});}_0x52a14d=_[_0xcabd('0x42')]({},_0x52a14d,_0x5b3622[_0xcabd('0x44')]);return _0x128cb4[_0xcabd('0x98')](_0x52a14d);}})['then'](function(_0x448627){if(_0x448627){_0x325243=_0x448627[_0xcabd('0x99')];if(!_0x5b3622['query'][_0xcabd('0x9a')](_0xcabd('0x3b'))){_0x52a14d[_0xcabd('0x23')]=qs[_0xcabd('0x23')](_0x5b3622[_0xcabd('0x35')][_0xcabd('0x23')]);_0x52a14d['offset']=qs['offset'](_0x5b3622[_0xcabd('0x35')][_0xcabd('0x3c')]);}return _0x128cb4[_0xcabd('0x98')](_0x52a14d);}})[_0xcabd('0x45')](function(_0x1710ad){if(_0x1710ad){return _0x1710ad?{'count':_0x325243,'rows':_0x1710ad}:null;}})[_0xcabd('0x45')](respondWithResult(_0x274e50,null))[_0xcabd('0x49')](handleError(_0x274e50,null));}; \ No newline at end of file diff --git a/server/api/team/team.events.js b/server/api/team/team.events.js index 39c92c7..fe57dea 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 _0xb3f9=['hasOwnProperty','hook','events','update','remove','emit'];(function(_0x5be795,_0x1cb1b8){var _0x4e8a3b=function(_0x5584ef){while(--_0x5584ef){_0x5be795['push'](_0x5be795['shift']());}};_0x4e8a3b(++_0x1cb1b8);}(_0xb3f9,0xc2));var _0x9b3f=function(_0xb04641,_0x2f7db7){_0xb04641=_0xb04641-0x0;var _0x4fa72b=_0xb3f9[_0xb04641];return _0x4fa72b;};'use strict';var EventEmitter=require(_0x9b3f('0x0'));var Team=require('../../mysqldb')['db']['Team'];var TeamEvents=new EventEmitter();TeamEvents['setMaxListeners'](0x0);var events={'afterCreate':'save','afterUpdate':_0x9b3f('0x1'),'afterDestroy':_0x9b3f('0x2')};function emitEvent(_0x1b99d7){return function(_0x50a997,_0xfc8b6d,_0x3f6e42){TeamEvents[_0x9b3f('0x3')](_0x1b99d7+':'+_0x50a997['id'],_0x50a997);TeamEvents[_0x9b3f('0x3')](_0x1b99d7,_0x50a997);_0x3f6e42(null);};}for(var e in events){if(events[_0x9b3f('0x4')](e)){var event=events[e];Team[_0x9b3f('0x5')](e,emitEvent(event));}}module['exports']=TeamEvents; \ No newline at end of file +var _0x341b=['emit','events','Team','update','remove'];(function(_0x21fc98,_0x482b1){var _0x5b9342=function(_0x590b61){while(--_0x590b61){_0x21fc98['push'](_0x21fc98['shift']());}};_0x5b9342(++_0x482b1);}(_0x341b,0xe7));var _0xb341=function(_0x1276ab,_0x34204a){_0x1276ab=_0x1276ab-0x0;var _0x5b7ba3=_0x341b[_0x1276ab];return _0x5b7ba3;};'use strict';var EventEmitter=require(_0xb341('0x0'));var Team=require('../../mysqldb')['db'][_0xb341('0x1')];var TeamEvents=new EventEmitter();TeamEvents['setMaxListeners'](0x0);var events={'afterCreate':'save','afterUpdate':_0xb341('0x2'),'afterDestroy':_0xb341('0x3')};function emitEvent(_0xd1c39e){return function(_0x3855f4,_0x39ceea,_0x22c9c3){TeamEvents[_0xb341('0x4')](_0xd1c39e+':'+_0x3855f4['id'],_0x3855f4);TeamEvents[_0xb341('0x4')](_0xd1c39e,_0x3855f4);_0x22c9c3(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];Team['hook'](e,emitEvent(event));}}module['exports']=TeamEvents; \ No newline at end of file diff --git a/server/api/team/team.model.js b/server/api/team/team.model.js index d145e00..fe27e52 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 _0x8920=['Voice','Whatsapp','resolve','all','./team.attributes','get','Queues','then','channel','catch','exports','define','Team','teams','Chat','Fax','Mail','Openchannel','Sms'];(function(_0x159c75,_0xc06a35){var _0x40bf2b=function(_0x17799c){while(--_0x17799c){_0x159c75['push'](_0x159c75['shift']());}};_0x40bf2b(++_0xc06a35);}(_0x8920,0x1df));var _0x0892=function(_0x19e35c,_0x29cd1e){_0x19e35c=_0x19e35c-0x0;var _0x3e1fe8=_0x8920[_0x19e35c];return _0x3e1fe8;};'use strict';var _=require('lodash');var attributes=require(_0x0892('0x0'));function getQueuesByChannel(_0x4e1013,_0x4d5c56){var _0x4d9fbd=_0x0892('0x1')+_0x4d5c56+_0x0892('0x2');return _0x4e1013[_0x4d9fbd]()[_0x0892('0x3')](function(_0x30707a){return _['map'](_0x30707a,function(_0x453978){_0x453978['setDataValue'](_0x0892('0x4'),_0x4d5c56);return _0x453978;});})[_0x0892('0x5')](function(_0x52931e){throw _0x52931e;});}module[_0x0892('0x6')]=function(_0x1eb168){return _0x1eb168[_0x0892('0x7')](_0x0892('0x8'),attributes,{'tableName':_0x0892('0x9'),'paranoid':![],'indexes':[],'timestamps':!![],'instanceMethods':{'getAssociatedQueues':function(){var _0x154551=this;var _0x1b5b1a=[_0x0892('0xa'),_0x0892('0xb'),_0x0892('0xc'),_0x0892('0xd'),_0x0892('0xe'),_0x0892('0xf'),_0x0892('0x10')];return Promise[_0x0892('0x11')]()[_0x0892('0x3')](function(){var _0x160a38=_['map'](_0x1b5b1a,function(_0x2b1f7a){return getQueuesByChannel(_0x154551,_0x2b1f7a);});return Promise[_0x0892('0x12')](_0x160a38);})[_0x0892('0x5')](function(_0x3c5131){throw _0x3c5131;});}}});}; \ No newline at end of file +var _0xfc01=['get','then','map','setDataValue','channel','exports','define','Team','Chat','Fax','Mail','Openchannel','Voice','all','lodash'];(function(_0x167cc1,_0x56ef5a){var _0x10bc4b=function(_0xd6a255){while(--_0xd6a255){_0x167cc1['push'](_0x167cc1['shift']());}};_0x10bc4b(++_0x56ef5a);}(_0xfc01,0x194));var _0x1fc0=function(_0x5561ad,_0x56fa3a){_0x5561ad=_0x5561ad-0x0;var _0x4a07eb=_0xfc01[_0x5561ad];return _0x4a07eb;};'use strict';var _=require(_0x1fc0('0x0'));var attributes=require('./team.attributes');function getQueuesByChannel(_0x56c296,_0x1662ef){var _0xac7883=_0x1fc0('0x1')+_0x1662ef+'Queues';return _0x56c296[_0xac7883]()[_0x1fc0('0x2')](function(_0x199769){return _[_0x1fc0('0x3')](_0x199769,function(_0x2a2e03){_0x2a2e03[_0x1fc0('0x4')](_0x1fc0('0x5'),_0x1662ef);return _0x2a2e03;});})['catch'](function(_0x46905a){throw _0x46905a;});}module[_0x1fc0('0x6')]=function(_0x40eb94){return _0x40eb94[_0x1fc0('0x7')](_0x1fc0('0x8'),attributes,{'tableName':'teams','paranoid':![],'indexes':[],'timestamps':!![],'instanceMethods':{'getAssociatedQueues':function(){var _0x173097=this;var _0x1bee4b=[_0x1fc0('0x9'),_0x1fc0('0xa'),_0x1fc0('0xb'),_0x1fc0('0xc'),'Sms',_0x1fc0('0xd'),'Whatsapp'];return Promise['resolve']()[_0x1fc0('0x2')](function(){var _0x4fcf5c=_[_0x1fc0('0x3')](_0x1bee4b,function(_0x44537d){return getQueuesByChannel(_0x173097,_0x44537d);});return Promise[_0x1fc0('0xe')](_0x4fcf5c);})['catch'](function(_0x5c9a20){throw _0x5c9a20;});}}});}; \ No newline at end of file diff --git a/server/api/team/team.rpc.js b/server/api/team/team.rpc.js index d05c9d4..7830c9c 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 _0x0144=['defaults','localhost','./team.socket','register','request','then','info','Team,\x20%s,\x20%s','request\x20sent','debug','Team,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','jayson/promise','client','http','redis'];(function(_0xa1e3e3,_0x29fe0e){var _0xc980e9=function(_0x1f5adc){while(--_0x1f5adc){_0xa1e3e3['push'](_0xa1e3e3['shift']());}};_0xc980e9(++_0x29fe0e);}(_0x0144,0x160));var _0x4014=function(_0x934425,_0x5af72f){_0x934425=_0x934425-0x0;var _0x31d596=_0x0144[_0x934425];return _0x31d596;};'use strict';var _=require(_0x4014('0x0'));var util=require('util');var moment=require(_0x4014('0x1'));var BPromise=require(_0x4014('0x2'));var rs=require(_0x4014('0x3'));var fs=require('fs');var Redis=require(_0x4014('0x4'));var db=require(_0x4014('0x5'))['db'];var utils=require(_0x4014('0x6'));var logger=require(_0x4014('0x7'))('rpc');var config=require('../../config/environment');var jayson=require(_0x4014('0x8'));var client=jayson[_0x4014('0x9')][_0x4014('0xa')]({'port':0x232a});config[_0x4014('0xb')]=_[_0x4014('0xc')](config[_0x4014('0xb')],{'host':_0x4014('0xd'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require(_0x4014('0xe'))[_0x4014('0xf')](socket);function respondWithRpcPromise(_0xf9d57b,_0x5e65ed,_0x404dad){return new BPromise(function(_0x30a938,_0xbf1bc1){return client[_0x4014('0x10')](_0xf9d57b,_0x404dad)[_0x4014('0x11')](function(_0x14ec8b){logger[_0x4014('0x12')](_0x4014('0x13'),_0x5e65ed,_0x4014('0x14'));logger[_0x4014('0x15')](_0x4014('0x16'),_0x5e65ed,_0x4014('0x14'),JSON[_0x4014('0x17')](_0x14ec8b));if(_0x14ec8b[_0x4014('0x18')]){if(_0x14ec8b[_0x4014('0x18')][_0x4014('0x19')]===0x1f4){logger[_0x4014('0x18')]('Team,\x20%s,\x20%s',_0x5e65ed,_0x14ec8b[_0x4014('0x18')]['message']);return _0xbf1bc1(_0x14ec8b[_0x4014('0x18')][_0x4014('0x1a')]);}logger[_0x4014('0x18')](_0x4014('0x13'),_0x5e65ed,_0x14ec8b[_0x4014('0x18')][_0x4014('0x1a')]);return _0x30a938(_0x14ec8b[_0x4014('0x18')]['message']);}else{logger['info']('Team,\x20%s,\x20%s',_0x5e65ed,_0x4014('0x14'));_0x30a938(_0x14ec8b['result'][_0x4014('0x1a')]);}})[_0x4014('0x1b')](function(_0x28e13d){logger['error'](_0x4014('0x13'),_0x5e65ed,_0x28e13d);_0xbf1bc1(_0x28e13d);});});} \ No newline at end of file +var _0x23f6=['result','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','redis','defaults','localhost','register','request','then','Team,\x20%s,\x20%s','request\x20sent','Team,\x20%s,\x20%s,\x20%s','error','code','message'];(function(_0xa148b7,_0x2f3eb2){var _0x51efd3=function(_0x34bcec){while(--_0x34bcec){_0xa148b7['push'](_0xa148b7['shift']());}};_0x51efd3(++_0x2f3eb2);}(_0x23f6,0xb0));var _0x623f=function(_0x46ddbd,_0x58d000){_0x46ddbd=_0x46ddbd-0x0;var _0x21e418=_0x23f6[_0x46ddbd];return _0x21e418;};'use strict';var _=require(_0x623f('0x0'));var util=require(_0x623f('0x1'));var moment=require(_0x623f('0x2'));var BPromise=require(_0x623f('0x3'));var rs=require(_0x623f('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x623f('0x5'))['db'];var utils=require(_0x623f('0x6'));var logger=require(_0x623f('0x7'))('rpc');var config=require(_0x623f('0x8'));var jayson=require(_0x623f('0x9'));var client=jayson[_0x623f('0xa')][_0x623f('0xb')]({'port':0x232a});config[_0x623f('0xc')]=_[_0x623f('0xd')](config[_0x623f('0xc')],{'host':_0x623f('0xe'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x623f('0xc')]));require('./team.socket')[_0x623f('0xf')](socket);function respondWithRpcPromise(_0x469918,_0x26994e,_0x4e0227){return new BPromise(function(_0xe62175,_0x58ad6e){return client[_0x623f('0x10')](_0x469918,_0x4e0227)[_0x623f('0x11')](function(_0x3eb2f2){logger['info'](_0x623f('0x12'),_0x26994e,_0x623f('0x13'));logger['debug'](_0x623f('0x14'),_0x26994e,_0x623f('0x13'),JSON['stringify'](_0x3eb2f2));if(_0x3eb2f2[_0x623f('0x15')]){if(_0x3eb2f2[_0x623f('0x15')][_0x623f('0x16')]===0x1f4){logger[_0x623f('0x15')]('Team,\x20%s,\x20%s',_0x26994e,_0x3eb2f2['error']['message']);return _0x58ad6e(_0x3eb2f2[_0x623f('0x15')]['message']);}logger[_0x623f('0x15')]('Team,\x20%s,\x20%s',_0x26994e,_0x3eb2f2[_0x623f('0x15')][_0x623f('0x17')]);return _0xe62175(_0x3eb2f2[_0x623f('0x15')]['message']);}else{logger['info'](_0x623f('0x12'),_0x26994e,'request\x20sent');_0xe62175(_0x3eb2f2[_0x623f('0x18')]['message']);}})['catch'](function(_0xa7783){logger['error'](_0x623f('0x12'),_0x26994e,_0xa7783);_0x58ad6e(_0xa7783);});});} \ No newline at end of file diff --git a/server/api/team/team.socket.js b/server/api/team/team.socket.js index 92e9893..88a1c71 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 _0xbdc4=['register','team:','save','remove','update','removeListener'];(function(_0x501510,_0x61caa9){var _0x1e6ee5=function(_0x32845b){while(--_0x32845b){_0x501510['push'](_0x501510['shift']());}};_0x1e6ee5(++_0x61caa9);}(_0xbdc4,0xaa));var _0x4bdc=function(_0x3511d3,_0x4107ae){_0x3511d3=_0x3511d3-0x0;var _0x5d6321=_0xbdc4[_0x3511d3];return _0x5d6321;};'use strict';var TeamEvents=require('./team.events');var events=[_0x4bdc('0x0'),_0x4bdc('0x1'),_0x4bdc('0x2')];function createListener(_0xe23acc,_0x5b57ce){return function(_0x54211d){_0x5b57ce['emit'](_0xe23acc,_0x54211d);};}function removeListener(_0x1bb827,_0x1108bb){return function(){TeamEvents[_0x4bdc('0x3')](_0x1bb827,_0x1108bb);};}exports[_0x4bdc('0x4')]=function(_0x117731){for(var _0x3a3322=0x0,_0x34bb89=events['length'];_0x3a3322<_0x34bb89;_0x3a3322++){var _0x202ca9=events[_0x3a3322];var _0x1a7829=createListener(_0x4bdc('0x5')+_0x202ca9,_0x117731);TeamEvents['on'](_0x202ca9,_0x1a7829);}}; \ No newline at end of file +var _0x35fc=['team:','./team.events','save','update','emit','removeListener','register'];(function(_0x38336f,_0x5510d7){var _0x7d2dca=function(_0x49f5ed){while(--_0x49f5ed){_0x38336f['push'](_0x38336f['shift']());}};_0x7d2dca(++_0x5510d7);}(_0x35fc,0x7f));var _0xc35f=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x35fc[_0x3dd15e];return _0x231fd0;};'use strict';var TeamEvents=require(_0xc35f('0x0'));var events=[_0xc35f('0x1'),'remove',_0xc35f('0x2')];function createListener(_0x2cf060,_0x457c10){return function(_0x20ef97){_0x457c10[_0xc35f('0x3')](_0x2cf060,_0x20ef97);};}function removeListener(_0x17879a,_0x3a3479){return function(){TeamEvents[_0xc35f('0x4')](_0x17879a,_0x3a3479);};}exports[_0xc35f('0x5')]=function(_0x1456a9){for(var _0x131e0d=0x0,_0x5764b6=events['length'];_0x131e0d<_0x5764b6;_0x131e0d++){var _0x17a26d=events[_0x131e0d];var _0xe2cee9=createListener(_0xc35f('0x6')+_0x17a26d,_0x1456a9);TeamEvents['on'](_0x17a26d,_0xe2cee9);}}; \ No newline at end of file diff --git a/server/api/teamVoicePrefix/teamVoicePrefix.attributes.js b/server/api/teamVoicePrefix/teamVoicePrefix.attributes.js index 4c8af69..5766abd 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 _0xcdce=['exports','INTEGER'];(function(_0x101e7b,_0x4ef05b){var _0x4995c0=function(_0x1a6488){while(--_0x1a6488){_0x101e7b['push'](_0x101e7b['shift']());}};_0x4995c0(++_0x4ef05b);}(_0xcdce,0x15a));var _0xecdc=function(_0xbf52d2,_0x2cd21){_0xbf52d2=_0xbf52d2-0x0;var _0x1261d4=_0xcdce[_0xbf52d2];return _0x1261d4;};'use strict';var Sequelize=require('sequelize');module[_0xecdc('0x0')]={'TeamId':{'type':Sequelize[_0xecdc('0x1')]},'VoicePrefixId':{'type':Sequelize[_0xecdc('0x1')]}}; \ No newline at end of file +var _0x6c50=['exports','INTEGER','sequelize'];(function(_0x20b8a7,_0x3ab435){var _0x113558=function(_0x417b4a){while(--_0x417b4a){_0x20b8a7['push'](_0x20b8a7['shift']());}};_0x113558(++_0x3ab435);}(_0x6c50,0xa4));var _0x06c5=function(_0x51c776,_0x3698b5){_0x51c776=_0x51c776-0x0;var _0x25627c=_0x6c50[_0x51c776];return _0x25627c;};'use strict';var Sequelize=require(_0x06c5('0x0'));module[_0x06c5('0x1')]={'TeamId':{'type':Sequelize[_0x06c5('0x2')]},'VoicePrefixId':{'type':Sequelize[_0x06c5('0x2')]}}; \ No newline at end of file diff --git a/server/api/teamVoicePrefix/teamVoicePrefix.model.js b/server/api/teamVoicePrefix/teamVoicePrefix.model.js index a270f8b..2931d85 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 _0x42f4=['request-promise','./teamVoicePrefix.attributes','exports','define','TeamVoicePrefix','team_has_voice_prefixes','lodash','../../config/logger','api','moment','bluebird'];(function(_0x29fe20,_0x5be65d){var _0x59c303=function(_0x2aa094){while(--_0x2aa094){_0x29fe20['push'](_0x29fe20['shift']());}};_0x59c303(++_0x5be65d);}(_0x42f4,0x19d));var _0x442f=function(_0x10d0f0,_0x1eba3d){_0x10d0f0=_0x10d0f0-0x0;var _0x93e308=_0x42f4[_0x10d0f0];return _0x93e308;};'use strict';var _=require(_0x442f('0x0'));var util=require('util');var logger=require(_0x442f('0x1'))(_0x442f('0x2'));var moment=require(_0x442f('0x3'));var BPromise=require(_0x442f('0x4'));var rp=require(_0x442f('0x5'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0x442f('0x6'));module[_0x442f('0x7')]=function(_0x545b7b,_0x3ed622){return _0x545b7b[_0x442f('0x8')](_0x442f('0x9'),attributes,{'tableName':_0x442f('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xd5a2=['moment','bluebird','path','rimraf','../../config/environment','./teamVoicePrefix.attributes','exports','define','TeamVoicePrefix','team_has_voice_prefixes','util','../../config/logger','api'];(function(_0x2fbf3d,_0x1b1b8a){var _0x18f0c1=function(_0x4aa677){while(--_0x4aa677){_0x2fbf3d['push'](_0x2fbf3d['shift']());}};_0x18f0c1(++_0x1b1b8a);}(_0xd5a2,0x1eb));var _0x2d5a=function(_0x4c4b28,_0x41512c){_0x4c4b28=_0x4c4b28-0x0;var _0x5a3ffb=_0xd5a2[_0x4c4b28];return _0x5a3ffb;};'use strict';var _=require('lodash');var util=require(_0x2d5a('0x0'));var logger=require(_0x2d5a('0x1'))(_0x2d5a('0x2'));var moment=require(_0x2d5a('0x3'));var BPromise=require(_0x2d5a('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x2d5a('0x5'));var rimraf=require(_0x2d5a('0x6'));var config=require(_0x2d5a('0x7'));var attributes=require(_0x2d5a('0x8'));module[_0x2d5a('0x9')]=function(_0x1187b5,_0x923c29){return _0x1187b5[_0x2d5a('0xa')](_0x2d5a('0xb'),attributes,{'tableName':_0x2d5a('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 8717b1b..8921ff0 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 _0x70e0=['../../components/auth/service','../../components/interaction/service','exports','multer','util','path','Router','fs-extra'];(function(_0x36cd5b,_0xe52957){var _0x448ef1=function(_0x26ad8c){while(--_0x26ad8c){_0x36cd5b['push'](_0x36cd5b['shift']());}};_0x448ef1(++_0xe52957);}(_0x70e0,0x17b));var _0x070e=function(_0x3d299a,_0x50fbf1){_0x3d299a=_0x3d299a-0x0;var _0x35b485=_0x70e0[_0x3d299a];return _0x35b485;};'use strict';var multer=require(_0x070e('0x0'));var util=require(_0x070e('0x1'));var path=require(_0x070e('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x070e('0x3')]();var fs_extra=require(_0x070e('0x4'));var auth=require(_0x070e('0x5'));var interaction=require(_0x070e('0x6'));var config=require('../../config/environment');module[_0x070e('0x7')]=router; \ No newline at end of file +var _0xd8b0=['Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','multer','util'];(function(_0x37c07d,_0xdbdb5f){var _0x10dadc=function(_0x2bafb7){while(--_0x2bafb7){_0x37c07d['push'](_0x37c07d['shift']());}};_0x10dadc(++_0xdbdb5f);}(_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/teamVoiceQueue/teamVoiceQueue.attributes.js b/server/api/teamVoiceQueue/teamVoiceQueue.attributes.js index cd44041..5e8b43c 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 _0x4556=['INTEGER','sequelize'];(function(_0x21b706,_0x1022f4){var _0x13b94a=function(_0x3116da){while(--_0x3116da){_0x21b706['push'](_0x21b706['shift']());}};_0x13b94a(++_0x1022f4);}(_0x4556,0x8f));var _0x6455=function(_0x52cfcb,_0x16b1f5){_0x52cfcb=_0x52cfcb-0x0;var _0x1aaecd=_0x4556[_0x52cfcb];return _0x1aaecd;};'use strict';var Sequelize=require(_0x6455('0x0'));module['exports']={'penalty':{'type':Sequelize[_0x6455('0x1')],'defaultValue':0x0}}; \ No newline at end of file +var _0x891b=['INTEGER'];(function(_0x2ec461,_0x5f588a){var _0x28603d=function(_0x21114b){while(--_0x21114b){_0x2ec461['push'](_0x2ec461['shift']());}};_0x28603d(++_0x5f588a);}(_0x891b,0xc5));var _0xb891=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0x891b[_0x14add3];return _0x4a174f;};'use strict';var Sequelize=require('sequelize');module['exports']={'penalty':{'type':Sequelize[_0xb891('0x0')],'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 03be8cb..d0ecb12 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 _0x2bbb=['team_has_voice_queues','util','../../config/logger','api','bluebird','request-promise','path','rimraf','../../config/environment','./teamVoiceQueue.attributes','TeamVoiceQueue'];(function(_0x3d343a,_0x443808){var _0x551f99=function(_0x2f8a18){while(--_0x2f8a18){_0x3d343a['push'](_0x3d343a['shift']());}};_0x551f99(++_0x443808);}(_0x2bbb,0x85));var _0xb2bb=function(_0x2aba69,_0x113724){_0x2aba69=_0x2aba69-0x0;var _0xd2c42b=_0x2bbb[_0x2aba69];return _0xd2c42b;};'use strict';var _=require('lodash');var util=require(_0xb2bb('0x0'));var logger=require(_0xb2bb('0x1'))(_0xb2bb('0x2'));var moment=require('moment');var BPromise=require(_0xb2bb('0x3'));var rp=require(_0xb2bb('0x4'));var fs=require('fs');var path=require(_0xb2bb('0x5'));var rimraf=require(_0xb2bb('0x6'));var config=require(_0xb2bb('0x7'));var attributes=require(_0xb2bb('0x8'));module['exports']=function(_0x3581e2,_0x5bee47){return _0x3581e2['define'](_0xb2bb('0x9'),attributes,{'tableName':_0xb2bb('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xc524=['bluebird','request-promise','path','rimraf','exports','define','../../config/logger','api','moment'];(function(_0x213ed5,_0x26712a){var _0x191514=function(_0x2d9305){while(--_0x2d9305){_0x213ed5['push'](_0x213ed5['shift']());}};_0x191514(++_0x26712a);}(_0xc524,0x1bf));var _0x4c52=function(_0x34d0d9,_0x5f5757){_0x34d0d9=_0x34d0d9-0x0;var _0x26bc3a=_0xc524[_0x34d0d9];return _0x26bc3a;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x4c52('0x0'))(_0x4c52('0x1'));var moment=require(_0x4c52('0x2'));var BPromise=require(_0x4c52('0x3'));var rp=require(_0x4c52('0x4'));var fs=require('fs');var path=require(_0x4c52('0x5'));var rimraf=require(_0x4c52('0x6'));var config=require('../../config/environment');var attributes=require('./teamVoiceQueue.attributes');module[_0x4c52('0x7')]=function(_0xdaf126,_0x72d0ec){return _0xdaf126[_0x4c52('0x8')]('TeamVoiceQueue',attributes,{'tableName':'team_has_voice_queues','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 ec6e5ba..27d47fa 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 _0x6505=['randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','then','info','TeamVoiceQueue,\x20%s,\x20%s','request\x20sent','debug','TeamVoiceQueue,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','lodash','util','moment','bluebird'];(function(_0x3be74f,_0x2a44ec){var _0xbf968c=function(_0x415a1c){while(--_0x415a1c){_0x3be74f['push'](_0x3be74f['shift']());}};_0xbf968c(++_0x2a44ec);}(_0x6505,0x8c));var _0x5650=function(_0x4e771e,_0x5e3b60){_0x4e771e=_0x4e771e-0x0;var _0x5e1fa4=_0x6505[_0x4e771e];return _0x5e1fa4;};'use strict';var _=require(_0x5650('0x0'));var util=require(_0x5650('0x1'));var moment=require(_0x5650('0x2'));var BPromise=require(_0x5650('0x3'));var rs=require(_0x5650('0x4'));var fs=require('fs');var Redis=require(_0x5650('0x5'));var db=require(_0x5650('0x6'))['db'];var utils=require(_0x5650('0x7'));var logger=require(_0x5650('0x8'))(_0x5650('0x9'));var config=require(_0x5650('0xa'));var jayson=require('jayson/promise');var client=jayson[_0x5650('0xb')][_0x5650('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x39fab5,_0x21a5b1,_0x224352){return new BPromise(function(_0x29fc80,_0x14a29b){return client['request'](_0x39fab5,_0x224352)[_0x5650('0xd')](function(_0x4cde26){logger[_0x5650('0xe')](_0x5650('0xf'),_0x21a5b1,_0x5650('0x10'));logger[_0x5650('0x11')](_0x5650('0x12'),_0x21a5b1,_0x5650('0x10'),JSON[_0x5650('0x13')](_0x4cde26));if(_0x4cde26[_0x5650('0x14')]){if(_0x4cde26[_0x5650('0x14')][_0x5650('0x15')]===0x1f4){logger[_0x5650('0x14')](_0x5650('0xf'),_0x21a5b1,_0x4cde26[_0x5650('0x14')][_0x5650('0x16')]);return _0x14a29b(_0x4cde26[_0x5650('0x14')][_0x5650('0x16')]);}logger[_0x5650('0x14')](_0x5650('0xf'),_0x21a5b1,_0x4cde26[_0x5650('0x14')][_0x5650('0x16')]);return _0x29fc80(_0x4cde26['error'][_0x5650('0x16')]);}else{logger[_0x5650('0xe')](_0x5650('0xf'),_0x21a5b1,_0x5650('0x10'));_0x29fc80(_0x4cde26[_0x5650('0x17')][_0x5650('0x16')]);}})['catch'](function(_0x3f0aa8){logger[_0x5650('0x14')](_0x5650('0xf'),_0x21a5b1,_0x3f0aa8);_0x14a29b(_0x3f0aa8);});});} \ No newline at end of file +var _0xdb1a=['error','code','message','util','moment','bluebird','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','TeamVoiceQueue,\x20%s,\x20%s','request\x20sent','debug','TeamVoiceQueue,\x20%s,\x20%s,\x20%s'];(function(_0xcb0d42,_0x4a4d39){var _0x476db1=function(_0x535f01){while(--_0x535f01){_0xcb0d42['push'](_0xcb0d42['shift']());}};_0x476db1(++_0x4a4d39);}(_0xdb1a,0x1bc));var _0xadb1=function(_0x439dc7,_0x3b7a43){_0x439dc7=_0x439dc7-0x0;var _0x39f7ef=_0xdb1a[_0x439dc7];return _0x39f7ef;};'use strict';var _=require('lodash');var util=require(_0xadb1('0x0'));var moment=require(_0xadb1('0x1'));var BPromise=require(_0xadb1('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xadb1('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0xadb1('0x4'));var logger=require(_0xadb1('0x5'))(_0xadb1('0x6'));var config=require(_0xadb1('0x7'));var jayson=require(_0xadb1('0x8'));var client=jayson[_0xadb1('0x9')][_0xadb1('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x359a08,_0x4f8172,_0x61f591){return new BPromise(function(_0x41b157,_0x5aa649){return client[_0xadb1('0xb')](_0x359a08,_0x61f591)[_0xadb1('0xc')](function(_0x30882e){logger[_0xadb1('0xd')](_0xadb1('0xe'),_0x4f8172,_0xadb1('0xf'));logger[_0xadb1('0x10')](_0xadb1('0x11'),_0x4f8172,_0xadb1('0xf'),JSON['stringify'](_0x30882e));if(_0x30882e[_0xadb1('0x12')]){if(_0x30882e[_0xadb1('0x12')][_0xadb1('0x13')]===0x1f4){logger['error'](_0xadb1('0xe'),_0x4f8172,_0x30882e[_0xadb1('0x12')][_0xadb1('0x14')]);return _0x5aa649(_0x30882e[_0xadb1('0x12')][_0xadb1('0x14')]);}logger['error'](_0xadb1('0xe'),_0x4f8172,_0x30882e[_0xadb1('0x12')][_0xadb1('0x14')]);return _0x41b157(_0x30882e[_0xadb1('0x12')]['message']);}else{logger[_0xadb1('0xd')](_0xadb1('0xe'),_0x4f8172,_0xadb1('0xf'));_0x41b157(_0x30882e['result'][_0xadb1('0x14')]);}})['catch'](function(_0x38905b){logger['error'](_0xadb1('0xe'),_0x4f8172,_0x38905b);_0x5aa649(_0x38905b);});});} \ No newline at end of file diff --git a/server/api/template/index.js b/server/api/template/index.js index 740cef7..1015f04 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 _0xbb61=['path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./template.controller','get','isAuthenticated','/:id','post','create','put','delete','destroy','multer'];(function(_0x468b87,_0x3ed8b8){var _0x40d206=function(_0x583d43){while(--_0x583d43){_0x468b87['push'](_0x468b87['shift']());}};_0x40d206(++_0x3ed8b8);}(_0xbb61,0x131));var _0x1bb6=function(_0x597484,_0x199340){_0x597484=_0x597484-0x0;var _0x218e64=_0xbb61[_0x597484];return _0x218e64;};'use strict';var multer=require(_0x1bb6('0x0'));var util=require('util');var path=require(_0x1bb6('0x1'));var timeout=require(_0x1bb6('0x2'));var express=require(_0x1bb6('0x3'));var router=express[_0x1bb6('0x4')]();var fs_extra=require(_0x1bb6('0x5'));var auth=require(_0x1bb6('0x6'));var interaction=require(_0x1bb6('0x7'));var config=require('../../config/environment');var controller=require(_0x1bb6('0x8'));router[_0x1bb6('0x9')]('/',auth[_0x1bb6('0xa')](),controller['index']);router[_0x1bb6('0x9')](_0x1bb6('0xb'),auth[_0x1bb6('0xa')](),controller['show']);router[_0x1bb6('0xc')]('/',auth[_0x1bb6('0xa')](),controller[_0x1bb6('0xd')]);router[_0x1bb6('0xe')](_0x1bb6('0xb'),auth[_0x1bb6('0xa')](),controller['update']);router[_0x1bb6('0xf')](_0x1bb6('0xb'),auth['isAuthenticated'](),controller[_0x1bb6('0x10')]);module['exports']=router; \ No newline at end of file +var _0xfcbb=['/:id','show','post','create','put','update','delete','destroy','exports','multer','util','path','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','isAuthenticated','index','get'];(function(_0x21ec61,_0x1fc6cf){var _0x1cfd68=function(_0x19eacc){while(--_0x19eacc){_0x21ec61['push'](_0x21ec61['shift']());}};_0x1cfd68(++_0x1fc6cf);}(_0xfcbb,0x10d));var _0xbfcb=function(_0x1d0d23,_0x34cf2a){_0x1d0d23=_0x1d0d23-0x0;var _0x5cb2e6=_0xfcbb[_0x1d0d23];return _0x5cb2e6;};'use strict';var multer=require(_0xbfcb('0x0'));var util=require(_0xbfcb('0x1'));var path=require(_0xbfcb('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0xbfcb('0x3')]();var fs_extra=require(_0xbfcb('0x4'));var auth=require(_0xbfcb('0x5'));var interaction=require(_0xbfcb('0x6'));var config=require(_0xbfcb('0x7'));var controller=require('./template.controller');router['get']('/',auth[_0xbfcb('0x8')](),controller[_0xbfcb('0x9')]);router[_0xbfcb('0xa')](_0xbfcb('0xb'),auth[_0xbfcb('0x8')](),controller[_0xbfcb('0xc')]);router[_0xbfcb('0xd')]('/',auth['isAuthenticated'](),controller[_0xbfcb('0xe')]);router[_0xbfcb('0xf')](_0xbfcb('0xb'),auth['isAuthenticated'](),controller[_0xbfcb('0x10')]);router[_0xbfcb('0x11')](_0xbfcb('0xb'),auth[_0xbfcb('0x8')](),controller[_0xbfcb('0x12')]);module[_0xbfcb('0x13')]=router; \ No newline at end of file diff --git a/server/api/template/template.attributes.js b/server/api/template/template.attributes.js index 9ca4bde..f33194e 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 _0x44c2=['STRING','TEXT','exports'];(function(_0x457f18,_0x5a8048){var _0x4df08f=function(_0x222a83){while(--_0x222a83){_0x457f18['push'](_0x457f18['shift']());}};_0x4df08f(++_0x5a8048);}(_0x44c2,0x1c7));var _0x244c=function(_0x351b46,_0x26b265){_0x351b46=_0x351b46-0x0;var _0x1515df=_0x44c2[_0x351b46];return _0x1515df;};'use strict';var Sequelize=require('sequelize');module[_0x244c('0x0')]={'name':{'type':Sequelize[_0x244c('0x1')]},'description':{'type':Sequelize[_0x244c('0x1')]},'html':{'type':Sequelize[_0x244c('0x2')]}}; \ No newline at end of file +var _0x103c=['sequelize','STRING','TEXT'];(function(_0x12f5f7,_0xa58b52){var _0x345c1b=function(_0x306035){while(--_0x306035){_0x12f5f7['push'](_0x12f5f7['shift']());}};_0x345c1b(++_0xa58b52);}(_0x103c,0x1bf));var _0xc103=function(_0x396693,_0xb9efe){_0x396693=_0x396693-0x0;var _0x39dc91=_0x103c[_0x396693];return _0x39dc91;};'use strict';var Sequelize=require(_0xc103('0x0'));module['exports']={'name':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0xc103('0x1')]},'html':{'type':Sequelize[_0xc103('0x2')]}}; \ No newline at end of file diff --git a/server/api/template/template.controller.js b/server/api/template/template.controller.js index f524643..8c8be94 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 _0x4262=['keys','query','filters','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','sort','where','pick','VIRTUAL','filter','options','includeAll','include','findAll','catch','show','merge','find','create','user','role','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','body','params','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','path','to-csv','ejs','fs-extra','squel','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','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','then','destroy','get','Templates','UserProfileResource','error','stack','send','index','map','Template','rawAttributes','fieldName','type','name'];(function(_0x556927,_0x34b53f){var _0x5f1235=function(_0x4f4e44){while(--_0x4f4e44){_0x556927['push'](_0x556927['shift']());}};_0x5f1235(++_0x34b53f);}(_0x4262,0x77));var _0x2426=function(_0xa464c9,_0x7c86d8){_0xa464c9=_0xa464c9-0x0;var _0x3d73c4=_0x4262[_0xa464c9];return _0x3d73c4;};'use strict';var emlformat=require(_0x2426('0x0'));var rimraf=require(_0x2426('0x1'));var zipdir=require(_0x2426('0x2'));var jsonpatch=require(_0x2426('0x3'));var rp=require(_0x2426('0x4'));var moment=require('moment');var BPromise=require(_0x2426('0x5'));var Mustache=require(_0x2426('0x6'));var util=require(_0x2426('0x7'));var path=require(_0x2426('0x8'));var sox=require('sox');var csv=require(_0x2426('0x9'));var ejs=require(_0x2426('0xa'));var fs=require('fs');var fs_extra=require(_0x2426('0xb'));var _=require('lodash');var squel=require(_0x2426('0xc'));var crypto=require(_0x2426('0xd'));var jsforce=require(_0x2426('0xe'));var deskjs=require('desk.js');var toCsv=require(_0x2426('0x9'));var querystring=require('querystring');var Papa=require(_0x2426('0xf'));var Redis=require(_0x2426('0x10'));var authService=require(_0x2426('0x11'));var qs=require(_0x2426('0x12'));var as=require(_0x2426('0x13'));var hardwareService=require(_0x2426('0x14'));var logger=require('../../config/logger')(_0x2426('0x15'));var utils=require(_0x2426('0x16'));var config=require(_0x2426('0x17'));var licenseUtil=require(_0x2426('0x18'));var db=require(_0x2426('0x19'))['db'];function respondWithStatusCode(_0x48f0f2,_0x407844){_0x407844=_0x407844||0xcc;return function(_0x141c2b){if(_0x141c2b){return _0x48f0f2[_0x2426('0x1a')](_0x407844);}return _0x48f0f2[_0x2426('0x1b')](_0x407844)[_0x2426('0x1c')]();};}function respondWithResult(_0x4b2d6d,_0x3345c0){_0x3345c0=_0x3345c0||0xc8;return function(_0x11ad10){if(_0x11ad10){return _0x4b2d6d[_0x2426('0x1b')](_0x3345c0)[_0x2426('0x1d')](_0x11ad10);}};}function respondWithFilteredResult(_0x229258,_0x129869){return function(_0x59ecff){if(_0x59ecff){var _0x3347f2=typeof _0x129869[_0x2426('0x1e')]===_0x2426('0x1f')&&typeof _0x129869[_0x2426('0x20')]==='undefined';var _0x4f83bc=_0x59ecff[_0x2426('0x21')];var _0x33719f=_0x3347f2?0x0:_0x129869[_0x2426('0x1e')];var _0x35fe73=_0x3347f2?_0x59ecff[_0x2426('0x21')]:_0x129869['offset']+_0x129869[_0x2426('0x20')];var _0x4c7be2;if(_0x35fe73>=_0x4f83bc){_0x35fe73=_0x4f83bc;_0x4c7be2=0xc8;}else{_0x4c7be2=0xce;}_0x229258[_0x2426('0x1b')](_0x4c7be2);return _0x229258[_0x2426('0x22')](_0x2426('0x23'),_0x33719f+'-'+_0x35fe73+'/'+_0x4f83bc)[_0x2426('0x1d')](_0x59ecff);}return null;};}function patchUpdates(_0x68b3ef){return function(_0x354919){try{jsonpatch[_0x2426('0x24')](_0x354919,_0x68b3ef,!![]);}catch(_0x1d84b8){return BPromise[_0x2426('0x25')](_0x1d84b8);}return _0x354919['save']();};}function saveUpdates(_0x1759a6,_0xe463d6){return function(_0xc9cab6){if(_0xc9cab6){return _0xc9cab6['update'](_0x1759a6)[_0x2426('0x26')](function(_0x49b36f){return _0x49b36f;});}return null;};}function removeEntity(_0x1e20f7,_0x55f930){return function(_0x510618){if(_0x510618){return _0x510618[_0x2426('0x27')]()[_0x2426('0x26')](function(){var _0x20cfc9=_0x510618[_0x2426('0x28')]({'plain':!![]});var _0x205778=_0x2426('0x29');return db[_0x2426('0x2a')][_0x2426('0x27')]({'where':{'type':_0x205778,'resourceId':_0x20cfc9['id']}})[_0x2426('0x26')](function(){return _0x510618;});})[_0x2426('0x26')](function(){_0x1e20f7['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x4271f6,_0xa891b4){return function(_0x44d902){if(!_0x44d902){_0x4271f6[_0x2426('0x1a')](0x194);}return _0x44d902;};}function handleError(_0x1dfeff,_0x305bdd){_0x305bdd=_0x305bdd||0x1f4;return function(_0xc9ac40){logger[_0x2426('0x2b')](_0xc9ac40[_0x2426('0x2c')]);if(_0xc9ac40['name']){delete _0xc9ac40['name'];}_0x1dfeff[_0x2426('0x1b')](_0x305bdd)[_0x2426('0x2d')](_0xc9ac40);};}exports[_0x2426('0x2e')]=function(_0x3043ac,_0x2c40fe){var _0x28e43b={},_0x3d2676={},_0x50843d={'count':0x0,'rows':[]};var _0x376f92=_[_0x2426('0x2f')](db[_0x2426('0x30')][_0x2426('0x31')],function(_0x45e314){return{'name':_0x45e314[_0x2426('0x32')],'type':_0x45e314[_0x2426('0x33')]['key']};});_0x3d2676['model']=_['map'](_0x376f92,_0x2426('0x34'));_0x3d2676['query']=_[_0x2426('0x35')](_0x3043ac[_0x2426('0x36')]);_0x3d2676[_0x2426('0x37')]=_[_0x2426('0x38')](_0x3d2676[_0x2426('0x39')],_0x3d2676[_0x2426('0x36')]);_0x28e43b[_0x2426('0x3a')]=_[_0x2426('0x38')](_0x3d2676[_0x2426('0x39')],qs['fields'](_0x3043ac[_0x2426('0x36')][_0x2426('0x3b')]));_0x28e43b['attributes']=_0x28e43b['attributes'][_0x2426('0x3c')]?_0x28e43b[_0x2426('0x3a')]:_0x3d2676['model'];if(!_0x3043ac[_0x2426('0x36')][_0x2426('0x3d')](_0x2426('0x3e'))){_0x28e43b['limit']=qs[_0x2426('0x20')](_0x3043ac[_0x2426('0x36')][_0x2426('0x20')]);_0x28e43b[_0x2426('0x1e')]=qs['offset'](_0x3043ac[_0x2426('0x36')][_0x2426('0x1e')]);}_0x28e43b['order']=qs[_0x2426('0x3f')](_0x3043ac['query'][_0x2426('0x3f')]);_0x28e43b[_0x2426('0x40')]=qs[_0x2426('0x37')](_[_0x2426('0x41')](_0x3043ac[_0x2426('0x36')],_0x3d2676[_0x2426('0x37')]),_0x376f92);if(_0x3043ac[_0x2426('0x36')]['filter']){_0x28e43b[_0x2426('0x40')]=_['merge'](_0x28e43b[_0x2426('0x40')],{'$or':_[_0x2426('0x2f')](_0x376f92,function(_0x40bc39){if(_0x40bc39[_0x2426('0x33')]!==_0x2426('0x42')){var _0x184353={};_0x184353[_0x40bc39[_0x2426('0x34')]]={'$like':'%'+_0x3043ac[_0x2426('0x36')][_0x2426('0x43')]+'%'};return _0x184353;}})});}_0x28e43b=_['merge']({},_0x28e43b,_0x3043ac[_0x2426('0x44')]);var _0x50fc49={'where':_0x28e43b['where']};return db[_0x2426('0x30')][_0x2426('0x21')](_0x50fc49)[_0x2426('0x26')](function(_0x330224){_0x50843d[_0x2426('0x21')]=_0x330224;if(_0x3043ac['query'][_0x2426('0x45')]){_0x28e43b[_0x2426('0x46')]=[{'all':!![]}];}return db['Template'][_0x2426('0x47')](_0x28e43b);})[_0x2426('0x26')](function(_0x25c60b){_0x50843d['rows']=_0x25c60b;return _0x50843d;})['then'](respondWithFilteredResult(_0x2c40fe,_0x28e43b))[_0x2426('0x48')](handleError(_0x2c40fe,null));};exports[_0x2426('0x49')]=function(_0x4b705c,_0x475e35){var _0x237cd4={'raw':!![],'where':{'id':_0x4b705c['params']['id']}},_0x55818={};_0x55818[_0x2426('0x39')]=_[_0x2426('0x35')](db[_0x2426('0x30')][_0x2426('0x31')]);_0x55818[_0x2426('0x36')]=_['keys'](_0x4b705c[_0x2426('0x36')]);_0x55818[_0x2426('0x37')]=_[_0x2426('0x38')](_0x55818[_0x2426('0x39')],_0x55818[_0x2426('0x36')]);_0x237cd4[_0x2426('0x3a')]=_['intersection'](_0x55818[_0x2426('0x39')],qs[_0x2426('0x3b')](_0x4b705c['query'][_0x2426('0x3b')]));_0x237cd4[_0x2426('0x3a')]=_0x237cd4[_0x2426('0x3a')][_0x2426('0x3c')]?_0x237cd4[_0x2426('0x3a')]:_0x55818[_0x2426('0x39')];if(_0x4b705c['query'][_0x2426('0x45')]){_0x237cd4[_0x2426('0x46')]=[{'all':!![]}];}_0x237cd4=_[_0x2426('0x4a')]({},_0x237cd4,_0x4b705c[_0x2426('0x44')]);return db[_0x2426('0x30')][_0x2426('0x4b')](_0x237cd4)[_0x2426('0x26')](handleEntityNotFound(_0x475e35,null))[_0x2426('0x26')](respondWithResult(_0x475e35,null))['catch'](handleError(_0x475e35,null));};exports[_0x2426('0x4c')]=function(_0x3f26f3,_0x4dabdb){return db[_0x2426('0x30')][_0x2426('0x4c')](_0x3f26f3['body'],{})[_0x2426('0x26')](function(_0x5e08a7){var _0x1bb122=_0x3f26f3[_0x2426('0x4d')]['get']({'plain':!![]});if(!_0x1bb122)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x1bb122[_0x2426('0x4e')]===_0x2426('0x4d')){var _0x147645=_0x5e08a7['get']({'plain':!![]});var _0x96485e=_0x2426('0x29');return db[_0x2426('0x4f')][_0x2426('0x4b')]({'where':{'name':_0x96485e,'userProfileId':_0x1bb122[_0x2426('0x50')]},'raw':!![]})['then'](function(_0x1cc447){if(_0x1cc447&&_0x1cc447[_0x2426('0x51')]===0x0){return db[_0x2426('0x2a')][_0x2426('0x4c')]({'name':_0x147645[_0x2426('0x34')],'resourceId':_0x147645['id'],'type':_0x1cc447[_0x2426('0x34')],'sectionId':_0x1cc447['id']},{})[_0x2426('0x26')](function(){return _0x5e08a7;});}else{return _0x5e08a7;}})[_0x2426('0x48')](function(_0x1112d1){logger[_0x2426('0x2b')](_0x2426('0x52'),_0x1112d1);throw _0x1112d1;});}return _0x5e08a7;})[_0x2426('0x26')](respondWithResult(_0x4dabdb,0xc9))[_0x2426('0x48')](handleError(_0x4dabdb,null));};exports[_0x2426('0x53')]=function(_0x146934,_0x2c056e){if(_0x146934['body']['id']){delete _0x146934[_0x2426('0x54')]['id'];}return db['Template'][_0x2426('0x4b')]({'where':{'id':_0x146934[_0x2426('0x55')]['id']}})[_0x2426('0x26')](handleEntityNotFound(_0x2c056e,null))['then'](saveUpdates(_0x146934[_0x2426('0x54')],null))[_0x2426('0x26')](respondWithResult(_0x2c056e,null))[_0x2426('0x48')](handleError(_0x2c056e,null));};exports[_0x2426('0x27')]=function(_0x121e83,_0xd4e013){return db['Template'][_0x2426('0x4b')]({'where':{'id':_0x121e83[_0x2426('0x55')]['id']}})[_0x2426('0x26')](handleEntityNotFound(_0xd4e013,null))['then'](removeEntity(_0xd4e013,null))[_0x2426('0x48')](handleError(_0xd4e013,null));}; \ No newline at end of file +var _0xc03e=['Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','eml-format','rimraf','zip-dir','fast-json-patch','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../mysqldb','sendStatus','end','status','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','destroy','then','get','Templates','UserProfileResource','error','stack','name','send','index','map','Template','rawAttributes','fieldName','key','model','query','keys','filters','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','where','VIRTUAL','filter','merge','options','includeAll','include','rows','show','params','length','find','catch','create','body','user'];(function(_0x42e1bd,_0x287a5f){var _0x3ed09b=function(_0xb26f0b){while(--_0xb26f0b){_0x42e1bd['push'](_0x42e1bd['shift']());}};_0x3ed09b(++_0x287a5f);}(_0xc03e,0x15d));var _0xec03=function(_0x1b9c2a,_0x50582e){_0x1b9c2a=_0x1b9c2a-0x0;var _0x21ab47=_0xc03e[_0x1b9c2a];return _0x21ab47;};'use strict';var emlformat=require(_0xec03('0x0'));var rimraf=require(_0xec03('0x1'));var zipdir=require(_0xec03('0x2'));var jsonpatch=require(_0xec03('0x3'));var rp=require('request-promise');var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0xec03('0x4'));var util=require(_0xec03('0x5'));var path=require(_0xec03('0x6'));var sox=require(_0xec03('0x7'));var csv=require(_0xec03('0x8'));var ejs=require(_0xec03('0x9'));var fs=require('fs');var fs_extra=require(_0xec03('0xa'));var _=require(_0xec03('0xb'));var squel=require(_0xec03('0xc'));var crypto=require(_0xec03('0xd'));var jsforce=require('jsforce');var deskjs=require(_0xec03('0xe'));var toCsv=require(_0xec03('0x8'));var querystring=require(_0xec03('0xf'));var Papa=require(_0xec03('0x10'));var Redis=require(_0xec03('0x11'));var authService=require('../../components/auth/service');var qs=require(_0xec03('0x12'));var as=require(_0xec03('0x13'));var hardwareService=require(_0xec03('0x14'));var logger=require(_0xec03('0x15'))(_0xec03('0x16'));var utils=require('../../config/utils');var config=require(_0xec03('0x17'));var licenseUtil=require('../../config/license/util');var db=require(_0xec03('0x18'))['db'];function respondWithStatusCode(_0x50df34,_0x31da53){_0x31da53=_0x31da53||0xcc;return function(_0x1e05b0){if(_0x1e05b0){return _0x50df34[_0xec03('0x19')](_0x31da53);}return _0x50df34['status'](_0x31da53)[_0xec03('0x1a')]();};}function respondWithResult(_0x381b15,_0x209a54){_0x209a54=_0x209a54||0xc8;return function(_0x47c2d6){if(_0x47c2d6){return _0x381b15[_0xec03('0x1b')](_0x209a54)[_0xec03('0x1c')](_0x47c2d6);}};}function respondWithFilteredResult(_0xf2a7df,_0x3c22ad){return function(_0xd209fa){if(_0xd209fa){var _0x422fdf=typeof _0x3c22ad[_0xec03('0x1d')]===_0xec03('0x1e')&&typeof _0x3c22ad[_0xec03('0x1f')]===_0xec03('0x1e');var _0x46895e=_0xd209fa[_0xec03('0x20')];var _0x305522=_0x422fdf?0x0:_0x3c22ad[_0xec03('0x1d')];var _0x31f865=_0x422fdf?_0xd209fa[_0xec03('0x20')]:_0x3c22ad[_0xec03('0x1d')]+_0x3c22ad[_0xec03('0x1f')];var _0x22b325;if(_0x31f865>=_0x46895e){_0x31f865=_0x46895e;_0x22b325=0xc8;}else{_0x22b325=0xce;}_0xf2a7df[_0xec03('0x1b')](_0x22b325);return _0xf2a7df[_0xec03('0x21')](_0xec03('0x22'),_0x305522+'-'+_0x31f865+'/'+_0x46895e)[_0xec03('0x1c')](_0xd209fa);}return null;};}function patchUpdates(_0x173bce){return function(_0x1424fe){try{jsonpatch[_0xec03('0x23')](_0x1424fe,_0x173bce,!![]);}catch(_0x30ef66){return BPromise[_0xec03('0x24')](_0x30ef66);}return _0x1424fe[_0xec03('0x25')]();};}function saveUpdates(_0x44daec,_0x449e6a){return function(_0x2c878e){if(_0x2c878e){return _0x2c878e[_0xec03('0x26')](_0x44daec)['then'](function(_0x3adac3){return _0x3adac3;});}return null;};}function removeEntity(_0x27d18d,_0x52987b){return function(_0x59f501){if(_0x59f501){return _0x59f501[_0xec03('0x27')]()[_0xec03('0x28')](function(){var _0xfdeb7b=_0x59f501[_0xec03('0x29')]({'plain':!![]});var _0x16ed64=_0xec03('0x2a');return db[_0xec03('0x2b')][_0xec03('0x27')]({'where':{'type':_0x16ed64,'resourceId':_0xfdeb7b['id']}})[_0xec03('0x28')](function(){return _0x59f501;});})[_0xec03('0x28')](function(){_0x27d18d[_0xec03('0x1b')](0xcc)[_0xec03('0x1a')]();});}};}function handleEntityNotFound(_0x630957,_0x372b5a){return function(_0x1f721d){if(!_0x1f721d){_0x630957[_0xec03('0x19')](0x194);}return _0x1f721d;};}function handleError(_0x52bf75,_0x950e14){_0x950e14=_0x950e14||0x1f4;return function(_0x2957c6){logger[_0xec03('0x2c')](_0x2957c6[_0xec03('0x2d')]);if(_0x2957c6[_0xec03('0x2e')]){delete _0x2957c6[_0xec03('0x2e')];}_0x52bf75[_0xec03('0x1b')](_0x950e14)[_0xec03('0x2f')](_0x2957c6);};}exports[_0xec03('0x30')]=function(_0x17edc4,_0x685301){var _0x47779e={},_0x407436={},_0x330454={'count':0x0,'rows':[]};var _0x5ad1f0=_[_0xec03('0x31')](db[_0xec03('0x32')][_0xec03('0x33')],function(_0x296906){return{'name':_0x296906[_0xec03('0x34')],'type':_0x296906['type'][_0xec03('0x35')]};});_0x407436[_0xec03('0x36')]=_[_0xec03('0x31')](_0x5ad1f0,'name');_0x407436[_0xec03('0x37')]=_[_0xec03('0x38')](_0x17edc4['query']);_0x407436[_0xec03('0x39')]=_[_0xec03('0x3a')](_0x407436[_0xec03('0x36')],_0x407436['query']);_0x47779e[_0xec03('0x3b')]=_[_0xec03('0x3a')](_0x407436[_0xec03('0x36')],qs['fields'](_0x17edc4[_0xec03('0x37')][_0xec03('0x3c')]));_0x47779e[_0xec03('0x3b')]=_0x47779e[_0xec03('0x3b')]['length']?_0x47779e[_0xec03('0x3b')]:_0x407436[_0xec03('0x36')];if(!_0x17edc4[_0xec03('0x37')][_0xec03('0x3d')](_0xec03('0x3e'))){_0x47779e['limit']=qs[_0xec03('0x1f')](_0x17edc4[_0xec03('0x37')][_0xec03('0x1f')]);_0x47779e[_0xec03('0x1d')]=qs[_0xec03('0x1d')](_0x17edc4['query']['offset']);}_0x47779e[_0xec03('0x3f')]=qs[_0xec03('0x40')](_0x17edc4['query']['sort']);_0x47779e[_0xec03('0x41')]=qs[_0xec03('0x39')](_['pick'](_0x17edc4[_0xec03('0x37')],_0x407436[_0xec03('0x39')]),_0x5ad1f0);if(_0x17edc4[_0xec03('0x37')]['filter']){_0x47779e['where']=_['merge'](_0x47779e['where'],{'$or':_[_0xec03('0x31')](_0x5ad1f0,function(_0x4f9f4f){if(_0x4f9f4f['type']!==_0xec03('0x42')){var _0x30bf41={};_0x30bf41[_0x4f9f4f[_0xec03('0x2e')]]={'$like':'%'+_0x17edc4[_0xec03('0x37')][_0xec03('0x43')]+'%'};return _0x30bf41;}})});}_0x47779e=_[_0xec03('0x44')]({},_0x47779e,_0x17edc4[_0xec03('0x45')]);var _0x44a1da={'where':_0x47779e[_0xec03('0x41')]};return db[_0xec03('0x32')][_0xec03('0x20')](_0x44a1da)[_0xec03('0x28')](function(_0x5602d2){_0x330454[_0xec03('0x20')]=_0x5602d2;if(_0x17edc4[_0xec03('0x37')][_0xec03('0x46')]){_0x47779e[_0xec03('0x47')]=[{'all':!![]}];}return db[_0xec03('0x32')]['findAll'](_0x47779e);})[_0xec03('0x28')](function(_0x3f567f){_0x330454[_0xec03('0x48')]=_0x3f567f;return _0x330454;})[_0xec03('0x28')](respondWithFilteredResult(_0x685301,_0x47779e))['catch'](handleError(_0x685301,null));};exports[_0xec03('0x49')]=function(_0x22e46c,_0x1f401e){var _0x371646={'raw':!![],'where':{'id':_0x22e46c[_0xec03('0x4a')]['id']}},_0x334be2={};_0x334be2[_0xec03('0x36')]=_[_0xec03('0x38')](db[_0xec03('0x32')][_0xec03('0x33')]);_0x334be2['query']=_[_0xec03('0x38')](_0x22e46c['query']);_0x334be2[_0xec03('0x39')]=_[_0xec03('0x3a')](_0x334be2[_0xec03('0x36')],_0x334be2[_0xec03('0x37')]);_0x371646[_0xec03('0x3b')]=_[_0xec03('0x3a')](_0x334be2['model'],qs[_0xec03('0x3c')](_0x22e46c[_0xec03('0x37')][_0xec03('0x3c')]));_0x371646[_0xec03('0x3b')]=_0x371646[_0xec03('0x3b')][_0xec03('0x4b')]?_0x371646[_0xec03('0x3b')]:_0x334be2['model'];if(_0x22e46c[_0xec03('0x37')][_0xec03('0x46')]){_0x371646[_0xec03('0x47')]=[{'all':!![]}];}_0x371646=_[_0xec03('0x44')]({},_0x371646,_0x22e46c['options']);return db[_0xec03('0x32')][_0xec03('0x4c')](_0x371646)[_0xec03('0x28')](handleEntityNotFound(_0x1f401e,null))[_0xec03('0x28')](respondWithResult(_0x1f401e,null))[_0xec03('0x4d')](handleError(_0x1f401e,null));};exports['create']=function(_0x58c8ab,_0x4f29a7){return db[_0xec03('0x32')][_0xec03('0x4e')](_0x58c8ab[_0xec03('0x4f')],{})[_0xec03('0x28')](function(_0x3693fa){var _0x91eb3a=_0x58c8ab[_0xec03('0x50')][_0xec03('0x29')]({'plain':!![]});if(!_0x91eb3a)throw new Error(_0xec03('0x51'));if(_0x91eb3a['role']===_0xec03('0x50')){var _0x3b44bf=_0x3693fa['get']({'plain':!![]});var _0x2b20cc=_0xec03('0x2a');return db[_0xec03('0x52')][_0xec03('0x4c')]({'where':{'name':_0x2b20cc,'userProfileId':_0x91eb3a[_0xec03('0x53')]},'raw':!![]})['then'](function(_0x3ef294){if(_0x3ef294&&_0x3ef294[_0xec03('0x54')]===0x0){return db[_0xec03('0x2b')][_0xec03('0x4e')]({'name':_0x3b44bf[_0xec03('0x2e')],'resourceId':_0x3b44bf['id'],'type':_0x3ef294['name'],'sectionId':_0x3ef294['id']},{})[_0xec03('0x28')](function(){return _0x3693fa;});}else{return _0x3693fa;}})[_0xec03('0x4d')](function(_0xee3217){logger[_0xec03('0x2c')](_0xec03('0x55'),_0xee3217);throw _0xee3217;});}return _0x3693fa;})['then'](respondWithResult(_0x4f29a7,0xc9))['catch'](handleError(_0x4f29a7,null));};exports[_0xec03('0x26')]=function(_0x46e9fa,_0x879179){if(_0x46e9fa['body']['id']){delete _0x46e9fa[_0xec03('0x4f')]['id'];}return db['Template']['find']({'where':{'id':_0x46e9fa[_0xec03('0x4a')]['id']}})['then'](handleEntityNotFound(_0x879179,null))[_0xec03('0x28')](saveUpdates(_0x46e9fa[_0xec03('0x4f')],null))[_0xec03('0x28')](respondWithResult(_0x879179,null))[_0xec03('0x4d')](handleError(_0x879179,null));};exports[_0xec03('0x27')]=function(_0x24d61b,_0x5b8634){return db[_0xec03('0x32')]['find']({'where':{'id':_0x24d61b['params']['id']}})[_0xec03('0x28')](handleEntityNotFound(_0x5b8634,null))[_0xec03('0x28')](removeEntity(_0x5b8634,null))[_0xec03('0x4d')](handleError(_0x5b8634,null));}; \ No newline at end of file diff --git a/server/api/template/template.model.js b/server/api/template/template.model.js index 532ec85..e91bddc 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 _0x5125=['path','rimraf','./template.attributes','exports','define','Template','lodash','api','bluebird','request-promise'];(function(_0x1e9e56,_0x34a74a){var _0x5d5e2e=function(_0x4bfcc2){while(--_0x4bfcc2){_0x1e9e56['push'](_0x1e9e56['shift']());}};_0x5d5e2e(++_0x34a74a);}(_0x5125,0x146));var _0x5512=function(_0x32270c,_0x4e4c59){_0x32270c=_0x32270c-0x0;var _0x4a0c24=_0x5125[_0x32270c];return _0x4a0c24;};'use strict';var _=require(_0x5512('0x0'));var util=require('util');var logger=require('../../config/logger')(_0x5512('0x1'));var moment=require('moment');var BPromise=require(_0x5512('0x2'));var rp=require(_0x5512('0x3'));var fs=require('fs');var path=require(_0x5512('0x4'));var rimraf=require(_0x5512('0x5'));var config=require('../../config/environment');var attributes=require(_0x5512('0x6'));module[_0x5512('0x7')]=function(_0x2b7816,_0x19b6ff){return _0x2b7816[_0x5512('0x8')](_0x5512('0x9'),attributes,{'tableName':'tools_templates','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x69eb=['exports','define','Template','lodash','util','../../config/logger','api','bluebird','path','../../config/environment','./template.attributes'];(function(_0x23d568,_0x39cfa6){var _0x39f2dc=function(_0x1c719){while(--_0x1c719){_0x23d568['push'](_0x23d568['shift']());}};_0x39f2dc(++_0x39cfa6);}(_0x69eb,0x18f));var _0xb69e=function(_0x30f71b,_0xaa0755){_0x30f71b=_0x30f71b-0x0;var _0x40671f=_0x69eb[_0x30f71b];return _0x40671f;};'use strict';var _=require(_0xb69e('0x0'));var util=require(_0xb69e('0x1'));var logger=require(_0xb69e('0x2'))(_0xb69e('0x3'));var moment=require('moment');var BPromise=require(_0xb69e('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xb69e('0x5'));var rimraf=require('rimraf');var config=require(_0xb69e('0x6'));var attributes=require(_0xb69e('0x7'));module[_0xb69e('0x8')]=function(_0x35b5c8,_0x561f0d){return _0x35b5c8[_0xb69e('0x9')](_0xb69e('0xa'),attributes,{'tableName':'tools_templates','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/template/template.rpc.js b/server/api/template/template.rpc.js index afe3699..5516c90 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 _0x7b9c=['message','info','catch','GetTemplate','findAll','options','raw','where','limit','include','map','model','attributes','lodash','util','bluebird','randomstring','ioredis','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','Template,\x20%s,\x20%s','debug','Template,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code'];(function(_0x2828c2,_0x19e864){var _0x2b8cb9=function(_0x5bd08a){while(--_0x5bd08a){_0x2828c2['push'](_0x2828c2['shift']());}};_0x2b8cb9(++_0x19e864);}(_0x7b9c,0x115));var _0xc7b9=function(_0x3b1bba,_0x220536){_0x3b1bba=_0x3b1bba-0x0;var _0x4ca374=_0x7b9c[_0x3b1bba];return _0x4ca374;};'use strict';var _=require(_0xc7b9('0x0'));var util=require(_0xc7b9('0x1'));var moment=require('moment');var BPromise=require(_0xc7b9('0x2'));var rs=require(_0xc7b9('0x3'));var fs=require('fs');var Redis=require(_0xc7b9('0x4'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0xc7b9('0x5'))(_0xc7b9('0x6'));var config=require(_0xc7b9('0x7'));var jayson=require(_0xc7b9('0x8'));var client=jayson[_0xc7b9('0x9')][_0xc7b9('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x4c3348,_0x386fec,_0x226278){return new BPromise(function(_0xf75d14,_0x4f5bfe){return client[_0xc7b9('0xb')](_0x4c3348,_0x226278)[_0xc7b9('0xc')](function(_0x2e2d9e){logger['info'](_0xc7b9('0xd'),_0x386fec,'request\x20sent');logger[_0xc7b9('0xe')](_0xc7b9('0xf'),_0x386fec,_0xc7b9('0x10'),JSON[_0xc7b9('0x11')](_0x2e2d9e));if(_0x2e2d9e[_0xc7b9('0x12')]){if(_0x2e2d9e[_0xc7b9('0x12')][_0xc7b9('0x13')]===0x1f4){logger[_0xc7b9('0x12')](_0xc7b9('0xd'),_0x386fec,_0x2e2d9e[_0xc7b9('0x12')][_0xc7b9('0x14')]);return _0x4f5bfe(_0x2e2d9e[_0xc7b9('0x12')]['message']);}logger[_0xc7b9('0x12')](_0xc7b9('0xd'),_0x386fec,_0x2e2d9e[_0xc7b9('0x12')][_0xc7b9('0x14')]);return _0xf75d14(_0x2e2d9e[_0xc7b9('0x12')][_0xc7b9('0x14')]);}else{logger[_0xc7b9('0x15')]('Template,\x20%s,\x20%s',_0x386fec,_0xc7b9('0x10'));_0xf75d14(_0x2e2d9e['result']['message']);}})[_0xc7b9('0x16')](function(_0x3cc9ba){logger[_0xc7b9('0x12')](_0xc7b9('0xd'),_0x386fec,_0x3cc9ba);_0x4f5bfe(_0x3cc9ba);});});}exports[_0xc7b9('0x17')]=function(_0x359a92){var _0x91a324=this;return new Promise(function(_0x4310b2,_0x463837){return db['Template'][_0xc7b9('0x18')]({'raw':_0x359a92[_0xc7b9('0x19')]?_0x359a92[_0xc7b9('0x19')][_0xc7b9('0x1a')]===undefined?!![]:![]:!![],'where':_0x359a92[_0xc7b9('0x19')]?_0x359a92[_0xc7b9('0x19')][_0xc7b9('0x1b')]||null:null,'attributes':_0x359a92[_0xc7b9('0x19')]?_0x359a92[_0xc7b9('0x19')]['attributes']||null:null,'limit':_0x359a92[_0xc7b9('0x19')]?_0x359a92[_0xc7b9('0x19')][_0xc7b9('0x1c')]||null:null,'include':_0x359a92['options']?_0x359a92[_0xc7b9('0x19')][_0xc7b9('0x1d')]?_['map'](_0x359a92[_0xc7b9('0x19')][_0xc7b9('0x1d')],function(_0x4cb23d){return{'model':db[_0x4cb23d['model']],'as':_0x4cb23d['as'],'attributes':_0x4cb23d['attributes'],'include':_0x4cb23d[_0xc7b9('0x1d')]?_[_0xc7b9('0x1e')](_0x4cb23d[_0xc7b9('0x1d')],function(_0x5a879a){return{'model':db[_0x5a879a[_0xc7b9('0x1f')]],'as':_0x5a879a['as'],'attributes':_0x5a879a[_0xc7b9('0x20')],'include':_0x5a879a['include']?_[_0xc7b9('0x1e')](_0x5a879a['include'],function(_0x163d20){return{'model':db[_0x163d20[_0xc7b9('0x1f')]],'as':_0x163d20['as'],'attributes':_0x163d20[_0xc7b9('0x20')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x5e66d5){logger[_0xc7b9('0x15')]('GetTemplate',_0x359a92);logger[_0xc7b9('0xe')](_0xc7b9('0x17'),_0x359a92,JSON[_0xc7b9('0x11')](_0x5e66d5));_0x4310b2(_0x5e66d5);})['catch'](function(_0x58b57f){logger['error'](_0xc7b9('0x17'),_0x58b57f['message'],_0x359a92);_0x463837(_0x91a324[_0xc7b9('0x12')](0x1f4,_0x58b57f['message']));});});}; \ No newline at end of file +var _0x5dd6=['Template,\x20%s,\x20%s,\x20%s','stringify','error','Template,\x20%s,\x20%s','message','catch','GetTemplate','Template','findAll','options','raw','where','attributes','limit','map','include','model','lodash','util','bluebird','randomstring','ioredis','../../config/utils','rpc','jayson/promise','client','http','request','then','info','request\x20sent'];(function(_0x25bea7,_0x49ab45){var _0x175952=function(_0x56a0b5){while(--_0x56a0b5){_0x25bea7['push'](_0x25bea7['shift']());}};_0x175952(++_0x49ab45);}(_0x5dd6,0x1a4));var _0x65dd=function(_0x33cece,_0x54b9da){_0x33cece=_0x33cece-0x0;var _0x1a2efd=_0x5dd6[_0x33cece];return _0x1a2efd;};'use strict';var _=require(_0x65dd('0x0'));var util=require(_0x65dd('0x1'));var moment=require('moment');var BPromise=require(_0x65dd('0x2'));var rs=require(_0x65dd('0x3'));var fs=require('fs');var Redis=require(_0x65dd('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x65dd('0x5'));var logger=require('../../config/logger')(_0x65dd('0x6'));var config=require('../../config/environment');var jayson=require(_0x65dd('0x7'));var client=jayson[_0x65dd('0x8')][_0x65dd('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x47b0d2,_0x41c4d3,_0x2c7121){return new BPromise(function(_0x5a5571,_0x35913a){return client[_0x65dd('0xa')](_0x47b0d2,_0x2c7121)[_0x65dd('0xb')](function(_0xa49baa){logger[_0x65dd('0xc')]('Template,\x20%s,\x20%s',_0x41c4d3,_0x65dd('0xd'));logger['debug'](_0x65dd('0xe'),_0x41c4d3,_0x65dd('0xd'),JSON[_0x65dd('0xf')](_0xa49baa));if(_0xa49baa['error']){if(_0xa49baa[_0x65dd('0x10')]['code']===0x1f4){logger[_0x65dd('0x10')](_0x65dd('0x11'),_0x41c4d3,_0xa49baa[_0x65dd('0x10')]['message']);return _0x35913a(_0xa49baa[_0x65dd('0x10')][_0x65dd('0x12')]);}logger[_0x65dd('0x10')](_0x65dd('0x11'),_0x41c4d3,_0xa49baa[_0x65dd('0x10')]['message']);return _0x5a5571(_0xa49baa[_0x65dd('0x10')]['message']);}else{logger[_0x65dd('0xc')](_0x65dd('0x11'),_0x41c4d3,_0x65dd('0xd'));_0x5a5571(_0xa49baa['result'][_0x65dd('0x12')]);}})[_0x65dd('0x13')](function(_0x2b0381){logger[_0x65dd('0x10')](_0x65dd('0x11'),_0x41c4d3,_0x2b0381);_0x35913a(_0x2b0381);});});}exports[_0x65dd('0x14')]=function(_0x5f0109){var _0x5f2475=this;return new Promise(function(_0x289890,_0x181aa8){return db[_0x65dd('0x15')][_0x65dd('0x16')]({'raw':_0x5f0109[_0x65dd('0x17')]?_0x5f0109['options'][_0x65dd('0x18')]===undefined?!![]:![]:!![],'where':_0x5f0109[_0x65dd('0x17')]?_0x5f0109[_0x65dd('0x17')][_0x65dd('0x19')]||null:null,'attributes':_0x5f0109[_0x65dd('0x17')]?_0x5f0109['options'][_0x65dd('0x1a')]||null:null,'limit':_0x5f0109[_0x65dd('0x17')]?_0x5f0109[_0x65dd('0x17')][_0x65dd('0x1b')]||null:null,'include':_0x5f0109[_0x65dd('0x17')]?_0x5f0109[_0x65dd('0x17')]['include']?_[_0x65dd('0x1c')](_0x5f0109[_0x65dd('0x17')][_0x65dd('0x1d')],function(_0x32095a){return{'model':db[_0x32095a[_0x65dd('0x1e')]],'as':_0x32095a['as'],'attributes':_0x32095a['attributes'],'include':_0x32095a[_0x65dd('0x1d')]?_['map'](_0x32095a[_0x65dd('0x1d')],function(_0x5dcf78){return{'model':db[_0x5dcf78['model']],'as':_0x5dcf78['as'],'attributes':_0x5dcf78[_0x65dd('0x1a')],'include':_0x5dcf78[_0x65dd('0x1d')]?_['map'](_0x5dcf78[_0x65dd('0x1d')],function(_0x209819){return{'model':db[_0x209819[_0x65dd('0x1e')]],'as':_0x209819['as'],'attributes':_0x209819[_0x65dd('0x1a')]};}):[]};}):[]};}):[]:[]})[_0x65dd('0xb')](function(_0x1f323f){logger[_0x65dd('0xc')]('GetTemplate',_0x5f0109);logger['debug'](_0x65dd('0x14'),_0x5f0109,JSON[_0x65dd('0xf')](_0x1f323f));_0x289890(_0x1f323f);})[_0x65dd('0x13')](function(_0x45c655){logger[_0x65dd('0x10')](_0x65dd('0x14'),_0x45c655[_0x65dd('0x12')],_0x5f0109);_0x181aa8(_0x5f2475[_0x65dd('0x10')](0x1f4,_0x45c655[_0x65dd('0x12')]));});});}; \ No newline at end of file diff --git a/server/api/trigger/index.js b/server/api/trigger/index.js index 8fb6ab6..a89b33b 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 _0x6a59=['update','exports','multer','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./trigger.controller','get','index','isAuthenticated','show','/:id/all_conditions','getAllConditions','/:id/any_conditions','getAnyConditions','/:id/actions','post','addAllCondition','addAnyCondition','addAction','put','/:id'];(function(_0x2420c8,_0x59cdcc){var _0x46e13d=function(_0x1117c3){while(--_0x1117c3){_0x2420c8['push'](_0x2420c8['shift']());}};_0x46e13d(++_0x59cdcc);}(_0x6a59,0x1d6));var _0x96a5=function(_0x209941,_0x5c9988){_0x209941=_0x209941-0x0;var _0x1e8729=_0x6a59[_0x209941];return _0x1e8729;};'use strict';var multer=require(_0x96a5('0x0'));var util=require('util');var path=require(_0x96a5('0x1'));var timeout=require(_0x96a5('0x2'));var express=require('express');var router=express[_0x96a5('0x3')]();var fs_extra=require(_0x96a5('0x4'));var auth=require(_0x96a5('0x5'));var interaction=require(_0x96a5('0x6'));var config=require(_0x96a5('0x7'));var controller=require(_0x96a5('0x8'));router[_0x96a5('0x9')]('/',auth['isAuthenticated'](),controller[_0x96a5('0xa')]);router[_0x96a5('0x9')]('/:id',auth[_0x96a5('0xb')](),controller[_0x96a5('0xc')]);router[_0x96a5('0x9')](_0x96a5('0xd'),auth[_0x96a5('0xb')](),controller[_0x96a5('0xe')]);router[_0x96a5('0x9')](_0x96a5('0xf'),auth[_0x96a5('0xb')](),controller[_0x96a5('0x10')]);router[_0x96a5('0x9')](_0x96a5('0x11'),auth[_0x96a5('0xb')](),controller['getActions']);router['post']('/',auth[_0x96a5('0xb')](),controller['create']);router[_0x96a5('0x12')](_0x96a5('0xd'),auth[_0x96a5('0xb')](),controller[_0x96a5('0x13')]);router['post']('/:id/any_conditions',auth[_0x96a5('0xb')](),controller[_0x96a5('0x14')]);router[_0x96a5('0x12')](_0x96a5('0x11'),auth[_0x96a5('0xb')](),controller[_0x96a5('0x15')]);router[_0x96a5('0x16')](_0x96a5('0x17'),auth['isAuthenticated'](),controller[_0x96a5('0x18')]);router['delete'](_0x96a5('0x17'),auth['isAuthenticated'](),controller['destroy']);module[_0x96a5('0x19')]=router; \ No newline at end of file +var _0x02c9=['put','update','delete','destroy','exports','multer','util','Router','fs-extra','../../components/interaction/service','./trigger.controller','get','isAuthenticated','index','/:id','show','/:id/all_conditions','getAnyConditions','/:id/actions','getActions','create','post','/:id/any_conditions','addAction'];(function(_0x287232,_0x2ad3dc){var _0x181ccc=function(_0x2c820b){while(--_0x2c820b){_0x287232['push'](_0x287232['shift']());}};_0x181ccc(++_0x2ad3dc);}(_0x02c9,0x125));var _0x902c=function(_0x56d743,_0xd3c44c){_0x56d743=_0x56d743-0x0;var _0xc7a5cb=_0x02c9[_0x56d743];return _0xc7a5cb;};'use strict';var multer=require(_0x902c('0x0'));var util=require(_0x902c('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require('express');var router=express[_0x902c('0x2')]();var fs_extra=require(_0x902c('0x3'));var auth=require('../../components/auth/service');var interaction=require(_0x902c('0x4'));var config=require('../../config/environment');var controller=require(_0x902c('0x5'));router[_0x902c('0x6')]('/',auth[_0x902c('0x7')](),controller[_0x902c('0x8')]);router[_0x902c('0x6')](_0x902c('0x9'),auth[_0x902c('0x7')](),controller[_0x902c('0xa')]);router[_0x902c('0x6')](_0x902c('0xb'),auth['isAuthenticated'](),controller['getAllConditions']);router['get']('/:id/any_conditions',auth[_0x902c('0x7')](),controller[_0x902c('0xc')]);router[_0x902c('0x6')](_0x902c('0xd'),auth[_0x902c('0x7')](),controller[_0x902c('0xe')]);router['post']('/',auth[_0x902c('0x7')](),controller[_0x902c('0xf')]);router[_0x902c('0x10')]('/:id/all_conditions',auth[_0x902c('0x7')](),controller['addAllCondition']);router['post'](_0x902c('0x11'),auth[_0x902c('0x7')](),controller['addAnyCondition']);router[_0x902c('0x10')](_0x902c('0xd'),auth[_0x902c('0x7')](),controller[_0x902c('0x12')]);router[_0x902c('0x13')](_0x902c('0x9'),auth[_0x902c('0x7')](),controller[_0x902c('0x14')]);router[_0x902c('0x15')]('/:id',auth[_0x902c('0x7')](),controller[_0x902c('0x16')]);module[_0x902c('0x17')]=router; \ No newline at end of file diff --git a/server/api/trigger/trigger.attributes.js b/server/api/trigger/trigger.attributes.js index fc3b38b..9821af9 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 _0x742e=['STRING'];(function(_0x1f1a97,_0xadfc15){var _0x29fc6a=function(_0x38c180){while(--_0x38c180){_0x1f1a97['push'](_0x1f1a97['shift']());}};_0x29fc6a(++_0xadfc15);}(_0x742e,0x101));var _0xe742=function(_0x11cb77,_0x12391c){_0x11cb77=_0x11cb77-0x0;var _0x2c3a18=_0x742e[_0x11cb77];return _0x2c3a18;};'use strict';var Sequelize=require('sequelize');module['exports']={'name':{'type':Sequelize['STRING']},'channel':{'type':Sequelize[_0xe742('0x0')]},'description':{'type':Sequelize[_0xe742('0x0')]},'status':{'type':Sequelize['BOOLEAN'],'defaultValue':![]}}; \ No newline at end of file +var _0x5eb6=['STRING','BOOLEAN','sequelize','exports'];(function(_0x1cfe2e,_0x1ebbcd){var _0x39233f=function(_0x48831a){while(--_0x48831a){_0x1cfe2e['push'](_0x1cfe2e['shift']());}};_0x39233f(++_0x1ebbcd);}(_0x5eb6,0x11e));var _0x65eb=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0x5eb6[_0x321bb2];return _0x9c12ed;};'use strict';var Sequelize=require(_0x65eb('0x0'));module[_0x65eb('0x1')]={'name':{'type':Sequelize['STRING']},'channel':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0x65eb('0x2')]},'status':{'type':Sequelize[_0x65eb('0x3')],'defaultValue':![]}}; \ No newline at end of file diff --git a/server/api/trigger/trigger.controller.js b/server/api/trigger/trigger.controller.js index bff05bf..8da4eaa 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 _0x2a7f=['sendStatus','status','end','json','undefined','limit','count','offset','set','Content-Range','apply','reject','save','then','get','Triggers','UserProfileResource','destroy','stack','name','send','index','map','Trigger','rawAttributes','fieldName','type','key','query','keys','filters','intersection','model','attributes','fields','nolimit','sort','where','pick','filter','merge','VIRTUAL','options','findAll','rows','catch','show','length','include','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','update','params','addAllCondition','TriggerAllId','Condition','addAnyCondition','getAllConditions','findOne','order','getAnyConditions','hasOwnProperty','addAction','TriggerId','Action','getActions','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','querystring','papaparse','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb'];(function(_0x5da899,_0x38345e){var _0x540da7=function(_0x3c0e42){while(--_0x3c0e42){_0x5da899['push'](_0x5da899['shift']());}};_0x540da7(++_0x38345e);}(_0x2a7f,0xb1));var _0xf2a7=function(_0x286b9e,_0x46a607){_0x286b9e=_0x286b9e-0x0;var _0x525987=_0x2a7f[_0x286b9e];return _0x525987;};'use strict';var emlformat=require(_0xf2a7('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xf2a7('0x1'));var jsonpatch=require(_0xf2a7('0x2'));var rp=require(_0xf2a7('0x3'));var moment=require(_0xf2a7('0x4'));var BPromise=require(_0xf2a7('0x5'));var Mustache=require(_0xf2a7('0x6'));var util=require(_0xf2a7('0x7'));var path=require('path');var sox=require(_0xf2a7('0x8'));var csv=require(_0xf2a7('0x9'));var ejs=require(_0xf2a7('0xa'));var fs=require('fs');var fs_extra=require(_0xf2a7('0xb'));var _=require(_0xf2a7('0xc'));var squel=require(_0xf2a7('0xd'));var crypto=require(_0xf2a7('0xe'));var jsforce=require(_0xf2a7('0xf'));var deskjs=require('desk.js');var toCsv=require(_0xf2a7('0x9'));var querystring=require(_0xf2a7('0x10'));var Papa=require(_0xf2a7('0x11'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0xf2a7('0x12'));var as=require(_0xf2a7('0x13'));var hardwareService=require(_0xf2a7('0x14'));var logger=require(_0xf2a7('0x15'))(_0xf2a7('0x16'));var utils=require(_0xf2a7('0x17'));var config=require(_0xf2a7('0x18'));var licenseUtil=require(_0xf2a7('0x19'));var db=require(_0xf2a7('0x1a'))['db'];function respondWithStatusCode(_0x594b9c,_0x54260b){_0x54260b=_0x54260b||0xcc;return function(_0x4c64d6){if(_0x4c64d6){return _0x594b9c[_0xf2a7('0x1b')](_0x54260b);}return _0x594b9c[_0xf2a7('0x1c')](_0x54260b)[_0xf2a7('0x1d')]();};}function respondWithResult(_0x76ac49,_0x6b695f){_0x6b695f=_0x6b695f||0xc8;return function(_0x2ea028){if(_0x2ea028){return _0x76ac49[_0xf2a7('0x1c')](_0x6b695f)[_0xf2a7('0x1e')](_0x2ea028);}};}function respondWithFilteredResult(_0x4cc797,_0x4b4f24){return function(_0x28b58c){if(_0x28b58c){var _0x19bbe9=typeof _0x4b4f24['offset']===_0xf2a7('0x1f')&&typeof _0x4b4f24[_0xf2a7('0x20')]==='undefined';var _0x1f69f6=_0x28b58c[_0xf2a7('0x21')];var _0x4aa8a6=_0x19bbe9?0x0:_0x4b4f24['offset'];var _0x1f23d5=_0x19bbe9?_0x28b58c['count']:_0x4b4f24[_0xf2a7('0x22')]+_0x4b4f24[_0xf2a7('0x20')];var _0xc1d1f;if(_0x1f23d5>=_0x1f69f6){_0x1f23d5=_0x1f69f6;_0xc1d1f=0xc8;}else{_0xc1d1f=0xce;}_0x4cc797[_0xf2a7('0x1c')](_0xc1d1f);return _0x4cc797[_0xf2a7('0x23')](_0xf2a7('0x24'),_0x4aa8a6+'-'+_0x1f23d5+'/'+_0x1f69f6)['json'](_0x28b58c);}return null;};}function patchUpdates(_0xacbbcd){return function(_0x5b3f3a){try{jsonpatch[_0xf2a7('0x25')](_0x5b3f3a,_0xacbbcd,!![]);}catch(_0x3c0980){return BPromise[_0xf2a7('0x26')](_0x3c0980);}return _0x5b3f3a[_0xf2a7('0x27')]();};}function saveUpdates(_0x597dc9,_0xfaf73a){return function(_0xd37cf2){if(_0xd37cf2){return _0xd37cf2['update'](_0x597dc9)[_0xf2a7('0x28')](function(_0x14bb3a){return _0x14bb3a;});}return null;};}function removeEntity(_0xe76839,_0x48aa45){return function(_0x4b4752){if(_0x4b4752){return _0x4b4752['destroy']()[_0xf2a7('0x28')](function(){var _0x3d4398=_0x4b4752[_0xf2a7('0x29')]({'plain':!![]});var _0x28c90c=_0xf2a7('0x2a');return db[_0xf2a7('0x2b')][_0xf2a7('0x2c')]({'where':{'type':_0x28c90c,'resourceId':_0x3d4398['id']}})[_0xf2a7('0x28')](function(){return _0x4b4752;});})[_0xf2a7('0x28')](function(){_0xe76839[_0xf2a7('0x1c')](0xcc)['end']();});}};}function handleEntityNotFound(_0x1cfe42,_0x3d4fca){return function(_0x202c17){if(!_0x202c17){_0x1cfe42[_0xf2a7('0x1b')](0x194);}return _0x202c17;};}function handleError(_0x10f9d3,_0x3ce617){_0x3ce617=_0x3ce617||0x1f4;return function(_0x18a448){logger['error'](_0x18a448[_0xf2a7('0x2d')]);if(_0x18a448[_0xf2a7('0x2e')]){delete _0x18a448[_0xf2a7('0x2e')];}_0x10f9d3[_0xf2a7('0x1c')](_0x3ce617)[_0xf2a7('0x2f')](_0x18a448);};}exports[_0xf2a7('0x30')]=function(_0xe3a7f2,_0x514963){var _0x541634={},_0x3d2837={},_0x1a0ba0={'count':0x0,'rows':[]};var _0x11d698=_[_0xf2a7('0x31')](db[_0xf2a7('0x32')][_0xf2a7('0x33')],function(_0x68202d){return{'name':_0x68202d[_0xf2a7('0x34')],'type':_0x68202d[_0xf2a7('0x35')][_0xf2a7('0x36')]};});_0x3d2837['model']=_[_0xf2a7('0x31')](_0x11d698,'name');_0x3d2837[_0xf2a7('0x37')]=_[_0xf2a7('0x38')](_0xe3a7f2[_0xf2a7('0x37')]);_0x3d2837[_0xf2a7('0x39')]=_[_0xf2a7('0x3a')](_0x3d2837[_0xf2a7('0x3b')],_0x3d2837[_0xf2a7('0x37')]);_0x541634[_0xf2a7('0x3c')]=_[_0xf2a7('0x3a')](_0x3d2837[_0xf2a7('0x3b')],qs[_0xf2a7('0x3d')](_0xe3a7f2['query']['fields']));_0x541634[_0xf2a7('0x3c')]=_0x541634[_0xf2a7('0x3c')]['length']?_0x541634[_0xf2a7('0x3c')]:_0x3d2837[_0xf2a7('0x3b')];if(!_0xe3a7f2[_0xf2a7('0x37')]['hasOwnProperty'](_0xf2a7('0x3e'))){_0x541634[_0xf2a7('0x20')]=qs[_0xf2a7('0x20')](_0xe3a7f2['query'][_0xf2a7('0x20')]);_0x541634['offset']=qs[_0xf2a7('0x22')](_0xe3a7f2[_0xf2a7('0x37')]['offset']);}_0x541634['order']=qs[_0xf2a7('0x3f')](_0xe3a7f2['query']['sort']);_0x541634[_0xf2a7('0x40')]=qs[_0xf2a7('0x39')](_[_0xf2a7('0x41')](_0xe3a7f2['query'],_0x3d2837[_0xf2a7('0x39')]),_0x11d698);if(_0xe3a7f2[_0xf2a7('0x37')][_0xf2a7('0x42')]){_0x541634['where']=_[_0xf2a7('0x43')](_0x541634[_0xf2a7('0x40')],{'$or':_[_0xf2a7('0x31')](_0x11d698,function(_0x1544aa){if(_0x1544aa[_0xf2a7('0x35')]!==_0xf2a7('0x44')){var _0x344f99={};_0x344f99[_0x1544aa[_0xf2a7('0x2e')]]={'$like':'%'+_0xe3a7f2[_0xf2a7('0x37')]['filter']+'%'};return _0x344f99;}})});}_0x541634=_['merge']({},_0x541634,_0xe3a7f2[_0xf2a7('0x45')]);var _0x56a151={'where':_0x541634['where']};return db[_0xf2a7('0x32')][_0xf2a7('0x21')](_0x56a151)[_0xf2a7('0x28')](function(_0x13a901){_0x1a0ba0['count']=_0x13a901;if(_0xe3a7f2[_0xf2a7('0x37')]['includeAll']){_0x541634['include']=[{'all':!![]}];}return db[_0xf2a7('0x32')][_0xf2a7('0x46')](_0x541634);})[_0xf2a7('0x28')](function(_0x52690b){_0x1a0ba0[_0xf2a7('0x47')]=_0x52690b;return _0x1a0ba0;})[_0xf2a7('0x28')](respondWithFilteredResult(_0x514963,_0x541634))[_0xf2a7('0x48')](handleError(_0x514963,null));};exports[_0xf2a7('0x49')]=function(_0x2ec62a,_0x3a508c){var _0x25e1ad={'raw':![],'where':{'id':_0x2ec62a['params']['id']}},_0x4c603a={};_0x4c603a[_0xf2a7('0x3b')]=_[_0xf2a7('0x38')](db['Trigger'][_0xf2a7('0x33')]);_0x4c603a['query']=_[_0xf2a7('0x38')](_0x2ec62a['query']);_0x4c603a['filters']=_[_0xf2a7('0x3a')](_0x4c603a[_0xf2a7('0x3b')],_0x4c603a[_0xf2a7('0x37')]);_0x25e1ad[_0xf2a7('0x3c')]=_[_0xf2a7('0x3a')](_0x4c603a[_0xf2a7('0x3b')],qs[_0xf2a7('0x3d')](_0x2ec62a[_0xf2a7('0x37')][_0xf2a7('0x3d')]));_0x25e1ad['attributes']=_0x25e1ad[_0xf2a7('0x3c')][_0xf2a7('0x4a')]?_0x25e1ad[_0xf2a7('0x3c')]:_0x4c603a['model'];if(_0x2ec62a[_0xf2a7('0x37')]['includeAll']){_0x25e1ad[_0xf2a7('0x4b')]=[{'all':!![]}];}_0x25e1ad=_[_0xf2a7('0x43')]({},_0x25e1ad,_0x2ec62a[_0xf2a7('0x45')]);return db[_0xf2a7('0x32')][_0xf2a7('0x4c')](_0x25e1ad)['then'](handleEntityNotFound(_0x3a508c,null))['then'](respondWithResult(_0x3a508c,null))[_0xf2a7('0x48')](handleError(_0x3a508c,null));};exports[_0xf2a7('0x4d')]=function(_0x1a66fd,_0x1c5cd2){return db[_0xf2a7('0x32')]['create'](_0x1a66fd[_0xf2a7('0x4e')],{})['then'](function(_0x2d8003){var _0x1377b3=_0x1a66fd[_0xf2a7('0x4f')][_0xf2a7('0x29')]({'plain':!![]});if(!_0x1377b3)throw new Error(_0xf2a7('0x50'));if(_0x1377b3[_0xf2a7('0x51')]==='user'){var _0x1d805a=_0x2d8003['get']({'plain':!![]});var _0x1ee16d='Triggers';return db[_0xf2a7('0x52')][_0xf2a7('0x4c')]({'where':{'name':_0x1ee16d,'userProfileId':_0x1377b3[_0xf2a7('0x53')]},'raw':!![]})[_0xf2a7('0x28')](function(_0xd23503){if(_0xd23503&&_0xd23503[_0xf2a7('0x54')]===0x0){return db['UserProfileResource'][_0xf2a7('0x4d')]({'name':_0x1d805a[_0xf2a7('0x2e')],'resourceId':_0x1d805a['id'],'type':_0xd23503[_0xf2a7('0x2e')],'sectionId':_0xd23503['id']},{})[_0xf2a7('0x28')](function(){return _0x2d8003;});}else{return _0x2d8003;}})[_0xf2a7('0x48')](function(_0x56f9e4){logger[_0xf2a7('0x55')](_0xf2a7('0x56'),_0x56f9e4);throw _0x56f9e4;});}return _0x2d8003;})[_0xf2a7('0x28')](respondWithResult(_0x1c5cd2,0xc9))['catch'](handleError(_0x1c5cd2,null));};exports[_0xf2a7('0x57')]=function(_0x1bb6a5,_0x33be69){if(_0x1bb6a5[_0xf2a7('0x4e')]['id']){delete _0x1bb6a5[_0xf2a7('0x4e')]['id'];}return db['Trigger'][_0xf2a7('0x4c')]({'where':{'id':_0x1bb6a5[_0xf2a7('0x58')]['id']}})[_0xf2a7('0x28')](handleEntityNotFound(_0x33be69,null))['then'](saveUpdates(_0x1bb6a5[_0xf2a7('0x4e')],null))['then'](respondWithResult(_0x33be69,null))[_0xf2a7('0x48')](handleError(_0x33be69,null));};exports[_0xf2a7('0x2c')]=function(_0x1b9757,_0xba4858){return db[_0xf2a7('0x32')][_0xf2a7('0x4c')]({'where':{'id':_0x1b9757[_0xf2a7('0x58')]['id']}})[_0xf2a7('0x28')](handleEntityNotFound(_0xba4858,null))[_0xf2a7('0x28')](removeEntity(_0xba4858,null))[_0xf2a7('0x48')](handleError(_0xba4858,null));};exports[_0xf2a7('0x59')]=function(_0x270a58,_0x23ba05,_0x55dd56){if(_0x270a58[_0xf2a7('0x4e')]['id']){delete _0x270a58['body']['id'];}return db[_0xf2a7('0x32')][_0xf2a7('0x4c')]({'where':{'id':_0x270a58[_0xf2a7('0x58')]['id']}})[_0xf2a7('0x28')](handleEntityNotFound(_0x23ba05,null))[_0xf2a7('0x28')](function(_0x33d1ca){if(_0x33d1ca){_0x270a58[_0xf2a7('0x4e')][_0xf2a7('0x5a')]=_0x33d1ca['id'];return db[_0xf2a7('0x5b')]['create'](_0x270a58[_0xf2a7('0x4e')]);}})[_0xf2a7('0x28')](respondWithResult(_0x23ba05,null))[_0xf2a7('0x48')](handleError(_0x23ba05,null));};exports[_0xf2a7('0x5c')]=function(_0x42324d,_0x11f6f1,_0x49d019){if(_0x42324d[_0xf2a7('0x4e')]['id']){delete _0x42324d['body']['id'];}return db[_0xf2a7('0x32')]['find']({'where':{'id':_0x42324d[_0xf2a7('0x58')]['id']}})[_0xf2a7('0x28')](handleEntityNotFound(_0x11f6f1,null))[_0xf2a7('0x28')](function(_0x4a432b){if(_0x4a432b){_0x42324d['body']['TriggerAnyId']=_0x4a432b['id'];return db[_0xf2a7('0x5b')][_0xf2a7('0x4d')](_0x42324d[_0xf2a7('0x4e')]);}})[_0xf2a7('0x28')](respondWithResult(_0x11f6f1,null))[_0xf2a7('0x48')](handleError(_0x11f6f1,null));};exports[_0xf2a7('0x5d')]=function(_0x17d622,_0x27ddaa,_0x314070){var _0xa8067d={};var _0x372053={};var _0x43b5f6;var _0x1428b0;return db['Trigger'][_0xf2a7('0x5e')]({'where':{'id':_0x17d622[_0xf2a7('0x58')]['id']}})[_0xf2a7('0x28')](handleEntityNotFound(_0x27ddaa,null))[_0xf2a7('0x28')](function(_0x58c20f){if(_0x58c20f){_0x43b5f6=_0x58c20f;_0x372053[_0xf2a7('0x3b')]=_[_0xf2a7('0x38')](db[_0xf2a7('0x5b')][_0xf2a7('0x33')]);_0x372053[_0xf2a7('0x37')]=_[_0xf2a7('0x38')](_0x17d622['query']);_0x372053['filters']=_['intersection'](_0x372053[_0xf2a7('0x3b')],_0x372053['query']);_0xa8067d[_0xf2a7('0x3c')]=_[_0xf2a7('0x3a')](_0x372053[_0xf2a7('0x3b')],qs[_0xf2a7('0x3d')](_0x17d622[_0xf2a7('0x37')][_0xf2a7('0x3d')]));_0xa8067d[_0xf2a7('0x3c')]=_0xa8067d[_0xf2a7('0x3c')][_0xf2a7('0x4a')]?_0xa8067d[_0xf2a7('0x3c')]:_0x372053[_0xf2a7('0x3b')];_0xa8067d[_0xf2a7('0x5f')]=qs[_0xf2a7('0x3f')](_0x17d622['query'][_0xf2a7('0x3f')]);_0xa8067d[_0xf2a7('0x40')]=qs[_0xf2a7('0x39')](_[_0xf2a7('0x41')](_0x17d622[_0xf2a7('0x37')],_0x372053['filters']));if(_0x17d622['query'][_0xf2a7('0x42')]){_0xa8067d[_0xf2a7('0x40')]=_[_0xf2a7('0x43')](_0xa8067d[_0xf2a7('0x40')],{'$or':_['map'](_0xa8067d[_0xf2a7('0x3c')],function(_0x137784){var _0x1af0d0={};_0x1af0d0[_0x137784]={'$like':'%'+_0x17d622[_0xf2a7('0x37')][_0xf2a7('0x42')]+'%'};return _0x1af0d0;})});}_0xa8067d=_[_0xf2a7('0x43')]({},_0xa8067d,_0x17d622[_0xf2a7('0x45')]);return _0x43b5f6[_0xf2a7('0x5d')](_0xa8067d);}})[_0xf2a7('0x28')](function(_0x2c3cbf){if(_0x2c3cbf){_0x1428b0=_0x2c3cbf[_0xf2a7('0x4a')];if(!_0x17d622['query']['hasOwnProperty'](_0xf2a7('0x3e'))){_0xa8067d[_0xf2a7('0x20')]=qs[_0xf2a7('0x20')](_0x17d622['query'][_0xf2a7('0x20')]);_0xa8067d[_0xf2a7('0x22')]=qs[_0xf2a7('0x22')](_0x17d622['query'][_0xf2a7('0x22')]);}return _0x43b5f6['getAllConditions'](_0xa8067d);}})[_0xf2a7('0x28')](function(_0x5211dd){if(_0x5211dd){return _0x5211dd?{'count':_0x1428b0,'rows':_0x5211dd}:null;}})[_0xf2a7('0x28')](respondWithResult(_0x27ddaa,null))['catch'](handleError(_0x27ddaa,null));};exports[_0xf2a7('0x60')]=function(_0x2e0885,_0xfc3f06,_0x4d4ca7){var _0x43e7e4={};var _0x3dbe05={};var _0x5435dd;var _0x40f36d;return db[_0xf2a7('0x32')][_0xf2a7('0x5e')]({'where':{'id':_0x2e0885[_0xf2a7('0x58')]['id']}})[_0xf2a7('0x28')](handleEntityNotFound(_0xfc3f06,null))[_0xf2a7('0x28')](function(_0xd59318){if(_0xd59318){_0x5435dd=_0xd59318;_0x3dbe05['model']=_[_0xf2a7('0x38')](db['Condition'][_0xf2a7('0x33')]);_0x3dbe05[_0xf2a7('0x37')]=_[_0xf2a7('0x38')](_0x2e0885[_0xf2a7('0x37')]);_0x3dbe05['filters']=_['intersection'](_0x3dbe05[_0xf2a7('0x3b')],_0x3dbe05[_0xf2a7('0x37')]);_0x43e7e4[_0xf2a7('0x3c')]=_[_0xf2a7('0x3a')](_0x3dbe05[_0xf2a7('0x3b')],qs[_0xf2a7('0x3d')](_0x2e0885[_0xf2a7('0x37')]['fields']));_0x43e7e4[_0xf2a7('0x3c')]=_0x43e7e4['attributes'][_0xf2a7('0x4a')]?_0x43e7e4[_0xf2a7('0x3c')]:_0x3dbe05['model'];_0x43e7e4['order']=qs[_0xf2a7('0x3f')](_0x2e0885['query'][_0xf2a7('0x3f')]);_0x43e7e4[_0xf2a7('0x40')]=qs[_0xf2a7('0x39')](_[_0xf2a7('0x41')](_0x2e0885[_0xf2a7('0x37')],_0x3dbe05['filters']));if(_0x2e0885[_0xf2a7('0x37')]['filter']){_0x43e7e4[_0xf2a7('0x40')]=_[_0xf2a7('0x43')](_0x43e7e4[_0xf2a7('0x40')],{'$or':_['map'](_0x43e7e4[_0xf2a7('0x3c')],function(_0x5581da){var _0x42183e={};_0x42183e[_0x5581da]={'$like':'%'+_0x2e0885['query']['filter']+'%'};return _0x42183e;})});}_0x43e7e4=_[_0xf2a7('0x43')]({},_0x43e7e4,_0x2e0885['options']);return _0x5435dd[_0xf2a7('0x60')](_0x43e7e4);}})[_0xf2a7('0x28')](function(_0x1d5a27){if(_0x1d5a27){_0x40f36d=_0x1d5a27[_0xf2a7('0x4a')];if(!_0x2e0885[_0xf2a7('0x37')][_0xf2a7('0x61')](_0xf2a7('0x3e'))){_0x43e7e4['limit']=qs['limit'](_0x2e0885[_0xf2a7('0x37')]['limit']);_0x43e7e4[_0xf2a7('0x22')]=qs[_0xf2a7('0x22')](_0x2e0885[_0xf2a7('0x37')][_0xf2a7('0x22')]);}return _0x5435dd[_0xf2a7('0x60')](_0x43e7e4);}})[_0xf2a7('0x28')](function(_0x197f40){if(_0x197f40){return _0x197f40?{'count':_0x40f36d,'rows':_0x197f40}:null;}})[_0xf2a7('0x28')](respondWithResult(_0xfc3f06,null))['catch'](handleError(_0xfc3f06,null));};exports[_0xf2a7('0x62')]=function(_0x469ae1,_0x294e6e,_0x2dc613){if(_0x469ae1[_0xf2a7('0x4e')]['id']){delete _0x469ae1[_0xf2a7('0x4e')]['id'];}return db[_0xf2a7('0x32')][_0xf2a7('0x4c')]({'where':{'id':_0x469ae1[_0xf2a7('0x58')]['id']}})[_0xf2a7('0x28')](handleEntityNotFound(_0x294e6e,null))[_0xf2a7('0x28')](function(_0x432e00){if(_0x432e00){_0x469ae1[_0xf2a7('0x4e')][_0xf2a7('0x63')]=_0x432e00['id'];return db[_0xf2a7('0x64')][_0xf2a7('0x4d')](_0x469ae1[_0xf2a7('0x4e')]);}})[_0xf2a7('0x28')](respondWithResult(_0x294e6e,null))[_0xf2a7('0x48')](handleError(_0x294e6e,null));};exports[_0xf2a7('0x65')]=function(_0x17007c,_0x483076,_0x3ce6a5){var _0x5ae05e={};var _0x277f1c={};var _0x38b2d0;var _0x1dd2b7;return db[_0xf2a7('0x32')][_0xf2a7('0x5e')]({'where':{'id':_0x17007c[_0xf2a7('0x58')]['id']}})[_0xf2a7('0x28')](handleEntityNotFound(_0x483076,null))[_0xf2a7('0x28')](function(_0x3761dc){if(_0x3761dc){_0x38b2d0=_0x3761dc;_0x277f1c['model']=_[_0xf2a7('0x38')](db[_0xf2a7('0x64')][_0xf2a7('0x33')]);_0x277f1c['query']=_['keys'](_0x17007c[_0xf2a7('0x37')]);_0x277f1c[_0xf2a7('0x39')]=_[_0xf2a7('0x3a')](_0x277f1c['model'],_0x277f1c['query']);_0x5ae05e[_0xf2a7('0x3c')]=_[_0xf2a7('0x3a')](_0x277f1c[_0xf2a7('0x3b')],qs[_0xf2a7('0x3d')](_0x17007c[_0xf2a7('0x37')]['fields']));_0x5ae05e[_0xf2a7('0x3c')]=_0x5ae05e['attributes']['length']?_0x5ae05e['attributes']:_0x277f1c[_0xf2a7('0x3b')];_0x5ae05e['order']=qs['sort'](_0x17007c[_0xf2a7('0x37')][_0xf2a7('0x3f')]);_0x5ae05e[_0xf2a7('0x40')]=qs['filters'](_[_0xf2a7('0x41')](_0x17007c[_0xf2a7('0x37')],_0x277f1c['filters']));if(_0x17007c[_0xf2a7('0x37')][_0xf2a7('0x42')]){_0x5ae05e[_0xf2a7('0x40')]=_[_0xf2a7('0x43')](_0x5ae05e[_0xf2a7('0x40')],{'$or':_['map'](_0x5ae05e[_0xf2a7('0x3c')],function(_0xaf0d06){var _0x1ce42a={};_0x1ce42a[_0xaf0d06]={'$like':'%'+_0x17007c['query']['filter']+'%'};return _0x1ce42a;})});}_0x5ae05e=_['merge']({},_0x5ae05e,_0x17007c[_0xf2a7('0x45')]);return _0x38b2d0[_0xf2a7('0x65')](_0x5ae05e);}})['then'](function(_0x3e140a){if(_0x3e140a){_0x1dd2b7=_0x3e140a[_0xf2a7('0x4a')];if(!_0x17007c['query']['hasOwnProperty'](_0xf2a7('0x3e'))){_0x5ae05e['limit']=qs['limit'](_0x17007c[_0xf2a7('0x37')]['limit']);_0x5ae05e[_0xf2a7('0x22')]=qs['offset'](_0x17007c[_0xf2a7('0x37')][_0xf2a7('0x22')]);}return _0x38b2d0['getActions'](_0x5ae05e);}})['then'](function(_0x44ce9b){if(_0x44ce9b){return _0x44ce9b?{'count':_0x1dd2b7,'rows':_0x44ce9b}:null;}})[_0xf2a7('0x28')](respondWithResult(_0x483076,null))[_0xf2a7('0x48')](handleError(_0x483076,null));}; \ No newline at end of file +var _0xca27=['json','reject','save','update','then','destroy','Triggers','sendStatus','error','stack','name','send','index','map','rawAttributes','fieldName','key','model','query','keys','intersection','attributes','fields','hasOwnProperty','order','sort','where','filters','pick','filter','merge','type','VIRTUAL','includeAll','include','Trigger','findAll','rows','catch','show','length','options','create','body','user','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','find','userProfileId','UserProfileResource','params','TriggerAllId','Condition','addAnyCondition','TriggerAnyId','getAllConditions','nolimit','getAnyConditions','findOne','addAction','TriggerId','Action','getActions','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','status','end','offset','undefined','limit','count'];(function(_0x2c91e9,_0x2fb965){var _0x13f0ff=function(_0xb39edf){while(--_0xb39edf){_0x2c91e9['push'](_0x2c91e9['shift']());}};_0x13f0ff(++_0x2fb965);}(_0xca27,0x1c8));var _0x7ca2=function(_0x51a3e0,_0x2b225c){_0x51a3e0=_0x51a3e0-0x0;var _0x2083a7=_0xca27[_0x51a3e0];return _0x2083a7;};'use strict';var emlformat=require(_0x7ca2('0x0'));var rimraf=require(_0x7ca2('0x1'));var zipdir=require(_0x7ca2('0x2'));var jsonpatch=require(_0x7ca2('0x3'));var rp=require(_0x7ca2('0x4'));var moment=require(_0x7ca2('0x5'));var BPromise=require(_0x7ca2('0x6'));var Mustache=require(_0x7ca2('0x7'));var util=require(_0x7ca2('0x8'));var path=require(_0x7ca2('0x9'));var sox=require(_0x7ca2('0xa'));var csv=require(_0x7ca2('0xb'));var ejs=require(_0x7ca2('0xc'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x7ca2('0xd'));var squel=require(_0x7ca2('0xe'));var crypto=require(_0x7ca2('0xf'));var jsforce=require(_0x7ca2('0x10'));var deskjs=require(_0x7ca2('0x11'));var toCsv=require(_0x7ca2('0xb'));var querystring=require(_0x7ca2('0x12'));var Papa=require(_0x7ca2('0x13'));var Redis=require(_0x7ca2('0x14'));var authService=require('../../components/auth/service');var qs=require(_0x7ca2('0x15'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x7ca2('0x16'));var logger=require(_0x7ca2('0x17'))(_0x7ca2('0x18'));var utils=require('../../config/utils');var config=require(_0x7ca2('0x19'));var licenseUtil=require(_0x7ca2('0x1a'));var db=require(_0x7ca2('0x1b'))['db'];function respondWithStatusCode(_0x21186a,_0x51b25e){_0x51b25e=_0x51b25e||0xcc;return function(_0x367ad8){if(_0x367ad8){return _0x21186a['sendStatus'](_0x51b25e);}return _0x21186a[_0x7ca2('0x1c')](_0x51b25e)[_0x7ca2('0x1d')]();};}function respondWithResult(_0x41362d,_0x40847d){_0x40847d=_0x40847d||0xc8;return function(_0x11851f){if(_0x11851f){return _0x41362d[_0x7ca2('0x1c')](_0x40847d)['json'](_0x11851f);}};}function respondWithFilteredResult(_0x4b3809,_0xec99fd){return function(_0x34a9ec){if(_0x34a9ec){var _0x31f26f=typeof _0xec99fd[_0x7ca2('0x1e')]===_0x7ca2('0x1f')&&typeof _0xec99fd[_0x7ca2('0x20')]==='undefined';var _0x24823d=_0x34a9ec[_0x7ca2('0x21')];var _0xefb326=_0x31f26f?0x0:_0xec99fd['offset'];var _0x4d2635=_0x31f26f?_0x34a9ec[_0x7ca2('0x21')]:_0xec99fd[_0x7ca2('0x1e')]+_0xec99fd[_0x7ca2('0x20')];var _0x3bb1e0;if(_0x4d2635>=_0x24823d){_0x4d2635=_0x24823d;_0x3bb1e0=0xc8;}else{_0x3bb1e0=0xce;}_0x4b3809[_0x7ca2('0x1c')](_0x3bb1e0);return _0x4b3809['set']('Content-Range',_0xefb326+'-'+_0x4d2635+'/'+_0x24823d)[_0x7ca2('0x22')](_0x34a9ec);}return null;};}function patchUpdates(_0x3a2891){return function(_0x4e3ba9){try{jsonpatch['apply'](_0x4e3ba9,_0x3a2891,!![]);}catch(_0x517110){return BPromise[_0x7ca2('0x23')](_0x517110);}return _0x4e3ba9[_0x7ca2('0x24')]();};}function saveUpdates(_0x4c6454,_0x183462){return function(_0x17c3d3){if(_0x17c3d3){return _0x17c3d3[_0x7ca2('0x25')](_0x4c6454)[_0x7ca2('0x26')](function(_0xd3ea3c){return _0xd3ea3c;});}return null;};}function removeEntity(_0x58250a,_0x2e97db){return function(_0x20deaf){if(_0x20deaf){return _0x20deaf[_0x7ca2('0x27')]()[_0x7ca2('0x26')](function(){var _0x52589e=_0x20deaf['get']({'plain':!![]});var _0x5ddf0b=_0x7ca2('0x28');return db['UserProfileResource']['destroy']({'where':{'type':_0x5ddf0b,'resourceId':_0x52589e['id']}})[_0x7ca2('0x26')](function(){return _0x20deaf;});})['then'](function(){_0x58250a[_0x7ca2('0x1c')](0xcc)[_0x7ca2('0x1d')]();});}};}function handleEntityNotFound(_0x579ba4,_0x1950c6){return function(_0x2c7d1b){if(!_0x2c7d1b){_0x579ba4[_0x7ca2('0x29')](0x194);}return _0x2c7d1b;};}function handleError(_0x27cd9d,_0x284b94){_0x284b94=_0x284b94||0x1f4;return function(_0x1e5065){logger[_0x7ca2('0x2a')](_0x1e5065[_0x7ca2('0x2b')]);if(_0x1e5065[_0x7ca2('0x2c')]){delete _0x1e5065[_0x7ca2('0x2c')];}_0x27cd9d[_0x7ca2('0x1c')](_0x284b94)[_0x7ca2('0x2d')](_0x1e5065);};}exports[_0x7ca2('0x2e')]=function(_0x143490,_0x1d2f2c){var _0x34c64c={},_0x65977e={},_0x1c32eb={'count':0x0,'rows':[]};var _0x5d7d55=_[_0x7ca2('0x2f')](db['Trigger'][_0x7ca2('0x30')],function(_0x51ff73){return{'name':_0x51ff73[_0x7ca2('0x31')],'type':_0x51ff73['type'][_0x7ca2('0x32')]};});_0x65977e[_0x7ca2('0x33')]=_[_0x7ca2('0x2f')](_0x5d7d55,_0x7ca2('0x2c'));_0x65977e[_0x7ca2('0x34')]=_[_0x7ca2('0x35')](_0x143490['query']);_0x65977e['filters']=_[_0x7ca2('0x36')](_0x65977e['model'],_0x65977e[_0x7ca2('0x34')]);_0x34c64c[_0x7ca2('0x37')]=_[_0x7ca2('0x36')](_0x65977e[_0x7ca2('0x33')],qs[_0x7ca2('0x38')](_0x143490[_0x7ca2('0x34')]['fields']));_0x34c64c[_0x7ca2('0x37')]=_0x34c64c[_0x7ca2('0x37')]['length']?_0x34c64c[_0x7ca2('0x37')]:_0x65977e[_0x7ca2('0x33')];if(!_0x143490[_0x7ca2('0x34')][_0x7ca2('0x39')]('nolimit')){_0x34c64c['limit']=qs[_0x7ca2('0x20')](_0x143490['query']['limit']);_0x34c64c[_0x7ca2('0x1e')]=qs[_0x7ca2('0x1e')](_0x143490[_0x7ca2('0x34')][_0x7ca2('0x1e')]);}_0x34c64c[_0x7ca2('0x3a')]=qs['sort'](_0x143490[_0x7ca2('0x34')][_0x7ca2('0x3b')]);_0x34c64c[_0x7ca2('0x3c')]=qs[_0x7ca2('0x3d')](_[_0x7ca2('0x3e')](_0x143490['query'],_0x65977e[_0x7ca2('0x3d')]),_0x5d7d55);if(_0x143490[_0x7ca2('0x34')][_0x7ca2('0x3f')]){_0x34c64c[_0x7ca2('0x3c')]=_[_0x7ca2('0x40')](_0x34c64c[_0x7ca2('0x3c')],{'$or':_[_0x7ca2('0x2f')](_0x5d7d55,function(_0x1fe32c){if(_0x1fe32c[_0x7ca2('0x41')]!==_0x7ca2('0x42')){var _0x5ac387={};_0x5ac387[_0x1fe32c['name']]={'$like':'%'+_0x143490['query'][_0x7ca2('0x3f')]+'%'};return _0x5ac387;}})});}_0x34c64c=_[_0x7ca2('0x40')]({},_0x34c64c,_0x143490['options']);var _0x1d1e27={'where':_0x34c64c[_0x7ca2('0x3c')]};return db['Trigger'][_0x7ca2('0x21')](_0x1d1e27)[_0x7ca2('0x26')](function(_0x3ac56c){_0x1c32eb[_0x7ca2('0x21')]=_0x3ac56c;if(_0x143490['query'][_0x7ca2('0x43')]){_0x34c64c[_0x7ca2('0x44')]=[{'all':!![]}];}return db[_0x7ca2('0x45')][_0x7ca2('0x46')](_0x34c64c);})[_0x7ca2('0x26')](function(_0x52a07d){_0x1c32eb[_0x7ca2('0x47')]=_0x52a07d;return _0x1c32eb;})['then'](respondWithFilteredResult(_0x1d2f2c,_0x34c64c))[_0x7ca2('0x48')](handleError(_0x1d2f2c,null));};exports[_0x7ca2('0x49')]=function(_0x38c77b,_0x48b7a5){var _0x2a6e8d={'raw':![],'where':{'id':_0x38c77b['params']['id']}},_0x1831a4={};_0x1831a4[_0x7ca2('0x33')]=_[_0x7ca2('0x35')](db['Trigger']['rawAttributes']);_0x1831a4[_0x7ca2('0x34')]=_[_0x7ca2('0x35')](_0x38c77b[_0x7ca2('0x34')]);_0x1831a4[_0x7ca2('0x3d')]=_[_0x7ca2('0x36')](_0x1831a4['model'],_0x1831a4[_0x7ca2('0x34')]);_0x2a6e8d[_0x7ca2('0x37')]=_[_0x7ca2('0x36')](_0x1831a4['model'],qs['fields'](_0x38c77b[_0x7ca2('0x34')]['fields']));_0x2a6e8d[_0x7ca2('0x37')]=_0x2a6e8d[_0x7ca2('0x37')][_0x7ca2('0x4a')]?_0x2a6e8d[_0x7ca2('0x37')]:_0x1831a4[_0x7ca2('0x33')];if(_0x38c77b[_0x7ca2('0x34')][_0x7ca2('0x43')]){_0x2a6e8d[_0x7ca2('0x44')]=[{'all':!![]}];}_0x2a6e8d=_[_0x7ca2('0x40')]({},_0x2a6e8d,_0x38c77b[_0x7ca2('0x4b')]);return db[_0x7ca2('0x45')]['find'](_0x2a6e8d)['then'](handleEntityNotFound(_0x48b7a5,null))[_0x7ca2('0x26')](respondWithResult(_0x48b7a5,null))[_0x7ca2('0x48')](handleError(_0x48b7a5,null));};exports[_0x7ca2('0x4c')]=function(_0x1450b6,_0xf6c391){return db['Trigger']['create'](_0x1450b6[_0x7ca2('0x4d')],{})[_0x7ca2('0x26')](function(_0x361fd3){var _0x238c1d=_0x1450b6[_0x7ca2('0x4e')][_0x7ca2('0x4f')]({'plain':!![]});if(!_0x238c1d)throw new Error(_0x7ca2('0x50'));if(_0x238c1d[_0x7ca2('0x51')]==='user'){var _0x5b7d45=_0x361fd3[_0x7ca2('0x4f')]({'plain':!![]});var _0x561960='Triggers';return db['UserProfileSection'][_0x7ca2('0x52')]({'where':{'name':_0x561960,'userProfileId':_0x238c1d[_0x7ca2('0x53')]},'raw':!![]})['then'](function(_0x2b9203){if(_0x2b9203&&_0x2b9203['autoAssociation']===0x0){return db[_0x7ca2('0x54')]['create']({'name':_0x5b7d45['name'],'resourceId':_0x5b7d45['id'],'type':_0x2b9203[_0x7ca2('0x2c')],'sectionId':_0x2b9203['id']},{})[_0x7ca2('0x26')](function(){return _0x361fd3;});}else{return _0x361fd3;}})[_0x7ca2('0x48')](function(_0x2f8b57){logger[_0x7ca2('0x2a')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x2f8b57);throw _0x2f8b57;});}return _0x361fd3;})[_0x7ca2('0x26')](respondWithResult(_0xf6c391,0xc9))['catch'](handleError(_0xf6c391,null));};exports[_0x7ca2('0x25')]=function(_0x2c12bd,_0x5312be){if(_0x2c12bd[_0x7ca2('0x4d')]['id']){delete _0x2c12bd['body']['id'];}return db['Trigger'][_0x7ca2('0x52')]({'where':{'id':_0x2c12bd[_0x7ca2('0x55')]['id']}})[_0x7ca2('0x26')](handleEntityNotFound(_0x5312be,null))[_0x7ca2('0x26')](saveUpdates(_0x2c12bd[_0x7ca2('0x4d')],null))[_0x7ca2('0x26')](respondWithResult(_0x5312be,null))[_0x7ca2('0x48')](handleError(_0x5312be,null));};exports[_0x7ca2('0x27')]=function(_0x17e1a1,_0x21d6de){return db[_0x7ca2('0x45')]['find']({'where':{'id':_0x17e1a1[_0x7ca2('0x55')]['id']}})[_0x7ca2('0x26')](handleEntityNotFound(_0x21d6de,null))[_0x7ca2('0x26')](removeEntity(_0x21d6de,null))[_0x7ca2('0x48')](handleError(_0x21d6de,null));};exports['addAllCondition']=function(_0x4c8985,_0x270de6,_0x5634a9){if(_0x4c8985[_0x7ca2('0x4d')]['id']){delete _0x4c8985[_0x7ca2('0x4d')]['id'];}return db[_0x7ca2('0x45')]['find']({'where':{'id':_0x4c8985[_0x7ca2('0x55')]['id']}})[_0x7ca2('0x26')](handleEntityNotFound(_0x270de6,null))[_0x7ca2('0x26')](function(_0x49077d){if(_0x49077d){_0x4c8985[_0x7ca2('0x4d')][_0x7ca2('0x56')]=_0x49077d['id'];return db[_0x7ca2('0x57')][_0x7ca2('0x4c')](_0x4c8985[_0x7ca2('0x4d')]);}})[_0x7ca2('0x26')](respondWithResult(_0x270de6,null))[_0x7ca2('0x48')](handleError(_0x270de6,null));};exports[_0x7ca2('0x58')]=function(_0x549cb1,_0x46e031,_0x267ab2){if(_0x549cb1[_0x7ca2('0x4d')]['id']){delete _0x549cb1[_0x7ca2('0x4d')]['id'];}return db[_0x7ca2('0x45')][_0x7ca2('0x52')]({'where':{'id':_0x549cb1[_0x7ca2('0x55')]['id']}})[_0x7ca2('0x26')](handleEntityNotFound(_0x46e031,null))['then'](function(_0x3b1f87){if(_0x3b1f87){_0x549cb1[_0x7ca2('0x4d')][_0x7ca2('0x59')]=_0x3b1f87['id'];return db[_0x7ca2('0x57')][_0x7ca2('0x4c')](_0x549cb1[_0x7ca2('0x4d')]);}})[_0x7ca2('0x26')](respondWithResult(_0x46e031,null))[_0x7ca2('0x48')](handleError(_0x46e031,null));};exports[_0x7ca2('0x5a')]=function(_0x6669e8,_0x253316,_0x317957){var _0x2ca48e={};var _0x18cf38={};var _0x1823ec;var _0x2cfc01;return db[_0x7ca2('0x45')]['findOne']({'where':{'id':_0x6669e8['params']['id']}})[_0x7ca2('0x26')](handleEntityNotFound(_0x253316,null))[_0x7ca2('0x26')](function(_0x1252b0){if(_0x1252b0){_0x1823ec=_0x1252b0;_0x18cf38[_0x7ca2('0x33')]=_[_0x7ca2('0x35')](db['Condition'][_0x7ca2('0x30')]);_0x18cf38[_0x7ca2('0x34')]=_['keys'](_0x6669e8[_0x7ca2('0x34')]);_0x18cf38[_0x7ca2('0x3d')]=_[_0x7ca2('0x36')](_0x18cf38['model'],_0x18cf38['query']);_0x2ca48e['attributes']=_[_0x7ca2('0x36')](_0x18cf38[_0x7ca2('0x33')],qs[_0x7ca2('0x38')](_0x6669e8[_0x7ca2('0x34')][_0x7ca2('0x38')]));_0x2ca48e[_0x7ca2('0x37')]=_0x2ca48e[_0x7ca2('0x37')][_0x7ca2('0x4a')]?_0x2ca48e[_0x7ca2('0x37')]:_0x18cf38[_0x7ca2('0x33')];_0x2ca48e['order']=qs[_0x7ca2('0x3b')](_0x6669e8['query'][_0x7ca2('0x3b')]);_0x2ca48e[_0x7ca2('0x3c')]=qs[_0x7ca2('0x3d')](_[_0x7ca2('0x3e')](_0x6669e8[_0x7ca2('0x34')],_0x18cf38[_0x7ca2('0x3d')]));if(_0x6669e8[_0x7ca2('0x34')][_0x7ca2('0x3f')]){_0x2ca48e[_0x7ca2('0x3c')]=_[_0x7ca2('0x40')](_0x2ca48e['where'],{'$or':_['map'](_0x2ca48e[_0x7ca2('0x37')],function(_0x22c0ca){var _0x3f360a={};_0x3f360a[_0x22c0ca]={'$like':'%'+_0x6669e8[_0x7ca2('0x34')]['filter']+'%'};return _0x3f360a;})});}_0x2ca48e=_['merge']({},_0x2ca48e,_0x6669e8[_0x7ca2('0x4b')]);return _0x1823ec[_0x7ca2('0x5a')](_0x2ca48e);}})[_0x7ca2('0x26')](function(_0x258c24){if(_0x258c24){_0x2cfc01=_0x258c24[_0x7ca2('0x4a')];if(!_0x6669e8[_0x7ca2('0x34')][_0x7ca2('0x39')](_0x7ca2('0x5b'))){_0x2ca48e[_0x7ca2('0x20')]=qs[_0x7ca2('0x20')](_0x6669e8['query'][_0x7ca2('0x20')]);_0x2ca48e['offset']=qs[_0x7ca2('0x1e')](_0x6669e8['query']['offset']);}return _0x1823ec['getAllConditions'](_0x2ca48e);}})[_0x7ca2('0x26')](function(_0x403b82){if(_0x403b82){return _0x403b82?{'count':_0x2cfc01,'rows':_0x403b82}:null;}})[_0x7ca2('0x26')](respondWithResult(_0x253316,null))[_0x7ca2('0x48')](handleError(_0x253316,null));};exports[_0x7ca2('0x5c')]=function(_0x733107,_0x176d49,_0x40c96d){var _0x12cac5={};var _0x4d72b5={};var _0x2e3614;var _0x1fc33a;return db[_0x7ca2('0x45')][_0x7ca2('0x5d')]({'where':{'id':_0x733107['params']['id']}})['then'](handleEntityNotFound(_0x176d49,null))[_0x7ca2('0x26')](function(_0xc72f52){if(_0xc72f52){_0x2e3614=_0xc72f52;_0x4d72b5[_0x7ca2('0x33')]=_[_0x7ca2('0x35')](db['Condition'][_0x7ca2('0x30')]);_0x4d72b5[_0x7ca2('0x34')]=_[_0x7ca2('0x35')](_0x733107[_0x7ca2('0x34')]);_0x4d72b5['filters']=_['intersection'](_0x4d72b5[_0x7ca2('0x33')],_0x4d72b5[_0x7ca2('0x34')]);_0x12cac5[_0x7ca2('0x37')]=_[_0x7ca2('0x36')](_0x4d72b5[_0x7ca2('0x33')],qs[_0x7ca2('0x38')](_0x733107[_0x7ca2('0x34')][_0x7ca2('0x38')]));_0x12cac5[_0x7ca2('0x37')]=_0x12cac5[_0x7ca2('0x37')]['length']?_0x12cac5[_0x7ca2('0x37')]:_0x4d72b5['model'];_0x12cac5['order']=qs[_0x7ca2('0x3b')](_0x733107[_0x7ca2('0x34')][_0x7ca2('0x3b')]);_0x12cac5[_0x7ca2('0x3c')]=qs[_0x7ca2('0x3d')](_['pick'](_0x733107['query'],_0x4d72b5[_0x7ca2('0x3d')]));if(_0x733107[_0x7ca2('0x34')][_0x7ca2('0x3f')]){_0x12cac5['where']=_[_0x7ca2('0x40')](_0x12cac5[_0x7ca2('0x3c')],{'$or':_[_0x7ca2('0x2f')](_0x12cac5[_0x7ca2('0x37')],function(_0x4d2076){var _0x193ebf={};_0x193ebf[_0x4d2076]={'$like':'%'+_0x733107[_0x7ca2('0x34')]['filter']+'%'};return _0x193ebf;})});}_0x12cac5=_[_0x7ca2('0x40')]({},_0x12cac5,_0x733107['options']);return _0x2e3614[_0x7ca2('0x5c')](_0x12cac5);}})[_0x7ca2('0x26')](function(_0x560788){if(_0x560788){_0x1fc33a=_0x560788[_0x7ca2('0x4a')];if(!_0x733107['query'][_0x7ca2('0x39')](_0x7ca2('0x5b'))){_0x12cac5[_0x7ca2('0x20')]=qs[_0x7ca2('0x20')](_0x733107[_0x7ca2('0x34')][_0x7ca2('0x20')]);_0x12cac5[_0x7ca2('0x1e')]=qs[_0x7ca2('0x1e')](_0x733107['query'][_0x7ca2('0x1e')]);}return _0x2e3614[_0x7ca2('0x5c')](_0x12cac5);}})[_0x7ca2('0x26')](function(_0x3985fe){if(_0x3985fe){return _0x3985fe?{'count':_0x1fc33a,'rows':_0x3985fe}:null;}})[_0x7ca2('0x26')](respondWithResult(_0x176d49,null))[_0x7ca2('0x48')](handleError(_0x176d49,null));};exports[_0x7ca2('0x5e')]=function(_0x5d4bc2,_0x3b1f2d,_0x171eea){if(_0x5d4bc2['body']['id']){delete _0x5d4bc2[_0x7ca2('0x4d')]['id'];}return db[_0x7ca2('0x45')][_0x7ca2('0x52')]({'where':{'id':_0x5d4bc2[_0x7ca2('0x55')]['id']}})[_0x7ca2('0x26')](handleEntityNotFound(_0x3b1f2d,null))[_0x7ca2('0x26')](function(_0x36674a){if(_0x36674a){_0x5d4bc2[_0x7ca2('0x4d')][_0x7ca2('0x5f')]=_0x36674a['id'];return db[_0x7ca2('0x60')]['create'](_0x5d4bc2[_0x7ca2('0x4d')]);}})['then'](respondWithResult(_0x3b1f2d,null))['catch'](handleError(_0x3b1f2d,null));};exports[_0x7ca2('0x61')]=function(_0x2a28f7,_0x59343a,_0x4bc1d7){var _0x27a856={};var _0xea13ee={};var _0x38fbe1;var _0x4e6424;return db[_0x7ca2('0x45')]['findOne']({'where':{'id':_0x2a28f7['params']['id']}})[_0x7ca2('0x26')](handleEntityNotFound(_0x59343a,null))[_0x7ca2('0x26')](function(_0x1ba951){if(_0x1ba951){_0x38fbe1=_0x1ba951;_0xea13ee['model']=_[_0x7ca2('0x35')](db[_0x7ca2('0x60')][_0x7ca2('0x30')]);_0xea13ee[_0x7ca2('0x34')]=_[_0x7ca2('0x35')](_0x2a28f7['query']);_0xea13ee[_0x7ca2('0x3d')]=_[_0x7ca2('0x36')](_0xea13ee[_0x7ca2('0x33')],_0xea13ee['query']);_0x27a856[_0x7ca2('0x37')]=_['intersection'](_0xea13ee[_0x7ca2('0x33')],qs['fields'](_0x2a28f7['query'][_0x7ca2('0x38')]));_0x27a856[_0x7ca2('0x37')]=_0x27a856['attributes'][_0x7ca2('0x4a')]?_0x27a856[_0x7ca2('0x37')]:_0xea13ee[_0x7ca2('0x33')];_0x27a856['order']=qs[_0x7ca2('0x3b')](_0x2a28f7[_0x7ca2('0x34')][_0x7ca2('0x3b')]);_0x27a856[_0x7ca2('0x3c')]=qs[_0x7ca2('0x3d')](_[_0x7ca2('0x3e')](_0x2a28f7[_0x7ca2('0x34')],_0xea13ee[_0x7ca2('0x3d')]));if(_0x2a28f7['query'][_0x7ca2('0x3f')]){_0x27a856['where']=_[_0x7ca2('0x40')](_0x27a856[_0x7ca2('0x3c')],{'$or':_[_0x7ca2('0x2f')](_0x27a856[_0x7ca2('0x37')],function(_0x228109){var _0x531004={};_0x531004[_0x228109]={'$like':'%'+_0x2a28f7[_0x7ca2('0x34')][_0x7ca2('0x3f')]+'%'};return _0x531004;})});}_0x27a856=_['merge']({},_0x27a856,_0x2a28f7[_0x7ca2('0x4b')]);return _0x38fbe1['getActions'](_0x27a856);}})[_0x7ca2('0x26')](function(_0xe99c67){if(_0xe99c67){_0x4e6424=_0xe99c67[_0x7ca2('0x4a')];if(!_0x2a28f7[_0x7ca2('0x34')]['hasOwnProperty'](_0x7ca2('0x5b'))){_0x27a856[_0x7ca2('0x20')]=qs[_0x7ca2('0x20')](_0x2a28f7[_0x7ca2('0x34')][_0x7ca2('0x20')]);_0x27a856[_0x7ca2('0x1e')]=qs['offset'](_0x2a28f7[_0x7ca2('0x34')][_0x7ca2('0x1e')]);}return _0x38fbe1[_0x7ca2('0x61')](_0x27a856);}})[_0x7ca2('0x26')](function(_0x18cf7e){if(_0x18cf7e){return _0x18cf7e?{'count':_0x4e6424,'rows':_0x18cf7e}:null;}})[_0x7ca2('0x26')](respondWithResult(_0x59343a,null))[_0x7ca2('0x48')](handleError(_0x59343a,null));}; \ No newline at end of file diff --git a/server/api/trigger/trigger.model.js b/server/api/trigger/trigger.model.js index 4e55c95..2a7d17c 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 _0x9aee=['path','rimraf','Trigger','lodash','util','../../config/logger','api','moment','bluebird','request-promise'];(function(_0x16ba14,_0x32cf07){var _0x23ef39=function(_0x160e0c){while(--_0x160e0c){_0x16ba14['push'](_0x16ba14['shift']());}};_0x23ef39(++_0x32cf07);}(_0x9aee,0x71));var _0xe9ae=function(_0x547a9b,_0x516541){_0x547a9b=_0x547a9b-0x0;var _0x323654=_0x9aee[_0x547a9b];return _0x323654;};'use strict';var _=require(_0xe9ae('0x0'));var util=require(_0xe9ae('0x1'));var logger=require(_0xe9ae('0x2'))(_0xe9ae('0x3'));var moment=require(_0xe9ae('0x4'));var BPromise=require(_0xe9ae('0x5'));var rp=require(_0xe9ae('0x6'));var fs=require('fs');var path=require(_0xe9ae('0x7'));var rimraf=require(_0xe9ae('0x8'));var config=require('../../config/environment');var attributes=require('./trigger.attributes');module['exports']=function(_0xf3aa52,_0x4e889d){return _0xf3aa52['define'](_0xe9ae('0x9'),attributes,{'tableName':'tools_triggers','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x6ae0=['Trigger','tools_triggers','lodash','util','../../config/logger','api','request-promise','rimraf','./trigger.attributes','exports'];(function(_0x36ba51,_0x290a27){var _0x4b1329=function(_0x32dea7){while(--_0x32dea7){_0x36ba51['push'](_0x36ba51['shift']());}};_0x4b1329(++_0x290a27);}(_0x6ae0,0x192));var _0x06ae=function(_0x5c6648,_0x26d538){_0x5c6648=_0x5c6648-0x0;var _0x2942ef=_0x6ae0[_0x5c6648];return _0x2942ef;};'use strict';var _=require(_0x06ae('0x0'));var util=require(_0x06ae('0x1'));var logger=require(_0x06ae('0x2'))(_0x06ae('0x3'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0x06ae('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0x06ae('0x5'));var config=require('../../config/environment');var attributes=require(_0x06ae('0x6'));module[_0x06ae('0x7')]=function(_0x517dea,_0x17b806){return _0x517dea['define'](_0x06ae('0x8'),attributes,{'tableName':_0x06ae('0x9'),'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 31b93d2..8aa7432 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 _0x5cb3=['options','raw','include','map','attributes','model','catch','ShowTrigger','find','where','util','moment','randomstring','ioredis','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','request\x20sent','debug','Trigger,\x20%s,\x20%s,\x20%s','stringify','error','code','Trigger,\x20%s,\x20%s','message','result','GetTrigger','Trigger'];(function(_0x4dc3db,_0x41fd64){var _0x1db0f9=function(_0x39ec3f){while(--_0x39ec3f){_0x4dc3db['push'](_0x4dc3db['shift']());}};_0x1db0f9(++_0x41fd64);}(_0x5cb3,0x112));var _0x35cb=function(_0x2ec00a,_0x23412a){_0x2ec00a=_0x2ec00a-0x0;var _0x27b616=_0x5cb3[_0x2ec00a];return _0x27b616;};'use strict';var _=require('lodash');var util=require(_0x35cb('0x0'));var moment=require(_0x35cb('0x1'));var BPromise=require('bluebird');var rs=require(_0x35cb('0x2'));var fs=require('fs');var Redis=require(_0x35cb('0x3'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0x35cb('0x4'))(_0x35cb('0x5'));var config=require(_0x35cb('0x6'));var jayson=require(_0x35cb('0x7'));var client=jayson[_0x35cb('0x8')][_0x35cb('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x2f0b19,_0x4baf7a,_0x2e5183){return new BPromise(function(_0x153d43,_0xc71605){return client[_0x35cb('0xa')](_0x2f0b19,_0x2e5183)[_0x35cb('0xb')](function(_0x1576d2){logger['info']('Trigger,\x20%s,\x20%s',_0x4baf7a,_0x35cb('0xc'));logger[_0x35cb('0xd')](_0x35cb('0xe'),_0x4baf7a,_0x35cb('0xc'),JSON[_0x35cb('0xf')](_0x1576d2));if(_0x1576d2['error']){if(_0x1576d2[_0x35cb('0x10')][_0x35cb('0x11')]===0x1f4){logger[_0x35cb('0x10')](_0x35cb('0x12'),_0x4baf7a,_0x1576d2['error']['message']);return _0xc71605(_0x1576d2[_0x35cb('0x10')][_0x35cb('0x13')]);}logger[_0x35cb('0x10')](_0x35cb('0x12'),_0x4baf7a,_0x1576d2[_0x35cb('0x10')][_0x35cb('0x13')]);return _0x153d43(_0x1576d2[_0x35cb('0x10')][_0x35cb('0x13')]);}else{logger['info']('Trigger,\x20%s,\x20%s',_0x4baf7a,'request\x20sent');_0x153d43(_0x1576d2[_0x35cb('0x14')]['message']);}})['catch'](function(_0x4661f7){logger[_0x35cb('0x10')](_0x35cb('0x12'),_0x4baf7a,_0x4661f7);_0xc71605(_0x4661f7);});});}exports[_0x35cb('0x15')]=function(_0x125b70){var _0x4b008c=this;return new Promise(function(_0x464f12,_0x5950e0){return db[_0x35cb('0x16')]['findAll']({'raw':_0x125b70['options']?_0x125b70[_0x35cb('0x17')][_0x35cb('0x18')]===undefined?!![]:![]:!![],'where':_0x125b70[_0x35cb('0x17')]?_0x125b70['options']['where']||null:null,'attributes':_0x125b70['options']?_0x125b70[_0x35cb('0x17')]['attributes']||null:null,'limit':_0x125b70['options']?_0x125b70[_0x35cb('0x17')]['limit']||null:null,'include':_0x125b70[_0x35cb('0x17')]?_0x125b70[_0x35cb('0x17')][_0x35cb('0x19')]?_[_0x35cb('0x1a')](_0x125b70[_0x35cb('0x17')][_0x35cb('0x19')],function(_0x2fd32b){return{'model':db[_0x2fd32b['model']],'as':_0x2fd32b['as'],'attributes':_0x2fd32b[_0x35cb('0x1b')],'include':_0x2fd32b['include']?_[_0x35cb('0x1a')](_0x2fd32b[_0x35cb('0x19')],function(_0x395a95){return{'model':db[_0x395a95[_0x35cb('0x1c')]],'as':_0x395a95['as'],'attributes':_0x395a95[_0x35cb('0x1b')],'include':_0x395a95['include']?_[_0x35cb('0x1a')](_0x395a95[_0x35cb('0x19')],function(_0xcd88ed){return{'model':db[_0xcd88ed[_0x35cb('0x1c')]],'as':_0xcd88ed['as'],'attributes':_0xcd88ed[_0x35cb('0x1b')]};}):[]};}):[]};}):[]:[]})[_0x35cb('0xb')](function(_0x2bb05b){logger['info'](_0x35cb('0x15'),_0x125b70);logger[_0x35cb('0xd')](_0x35cb('0x15'),_0x125b70,JSON['stringify'](_0x2bb05b));_0x464f12(_0x2bb05b);})[_0x35cb('0x1d')](function(_0x548a86){logger[_0x35cb('0x10')](_0x35cb('0x15'),_0x548a86[_0x35cb('0x13')],_0x125b70);_0x5950e0(_0x4b008c['error'](0x1f4,_0x548a86[_0x35cb('0x13')]));});});};exports[_0x35cb('0x1e')]=function(_0x65c611){var _0x212b33=this;return new Promise(function(_0x427e2f,_0x3a6dfa){return db[_0x35cb('0x16')][_0x35cb('0x1f')]({'raw':_0x65c611[_0x35cb('0x17')]?_0x65c611[_0x35cb('0x17')][_0x35cb('0x18')]===undefined?!![]:![]:!![],'where':_0x65c611[_0x35cb('0x17')]?_0x65c611[_0x35cb('0x17')][_0x35cb('0x20')]||null:null,'attributes':_0x65c611[_0x35cb('0x17')]?_0x65c611[_0x35cb('0x17')]['attributes']||null:null,'include':_0x65c611['options']?_0x65c611['options'][_0x35cb('0x19')]?_[_0x35cb('0x1a')](_0x65c611[_0x35cb('0x17')][_0x35cb('0x19')],function(_0x25b055){return{'model':db[_0x25b055[_0x35cb('0x1c')]],'as':_0x25b055['as'],'attributes':_0x25b055[_0x35cb('0x1b')],'include':_0x25b055[_0x35cb('0x19')]?_[_0x35cb('0x1a')](_0x25b055['include'],function(_0xf372fa){return{'model':db[_0xf372fa[_0x35cb('0x1c')]],'as':_0xf372fa['as'],'attributes':_0xf372fa[_0x35cb('0x1b')],'include':_0xf372fa[_0x35cb('0x19')]?_[_0x35cb('0x1a')](_0xf372fa[_0x35cb('0x19')],function(_0x4685de){return{'model':db[_0x4685de['model']],'as':_0x4685de['as'],'attributes':_0x4685de['attributes']};}):[]};}):[]};}):[]:[]})[_0x35cb('0xb')](function(_0x2d5ebd){logger['info'](_0x35cb('0x1e'),_0x65c611);logger[_0x35cb('0xd')](_0x35cb('0x1e'),_0x65c611,JSON['stringify'](_0x2d5ebd));_0x427e2f(_0x2d5ebd);})['catch'](function(_0x12042f){logger[_0x35cb('0x10')](_0x35cb('0x1e'),_0x12042f[_0x35cb('0x13')],_0x65c611);_0x3a6dfa(_0x212b33[_0x35cb('0x10')](0x1f4,_0x12042f[_0x35cb('0x13')]));});});}; \ No newline at end of file +var _0x5c56=['http','request','then','request\x20sent','error','code','Trigger,\x20%s,\x20%s','message','info','result','catch','GetTrigger','Trigger','findAll','options','raw','attributes','limit','include','model','map','debug','find','ShowTrigger','lodash','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client'];(function(_0x9590c9,_0x1167d0){var _0x4e3fb5=function(_0x3fbc5f){while(--_0x3fbc5f){_0x9590c9['push'](_0x9590c9['shift']());}};_0x4e3fb5(++_0x1167d0);}(_0x5c56,0xc7));var _0x65c5=function(_0x5605b6,_0x2f000d){_0x5605b6=_0x5605b6-0x0;var _0x18fa44=_0x5c56[_0x5605b6];return _0x18fa44;};'use strict';var _=require(_0x65c5('0x0'));var util=require('util');var moment=require(_0x65c5('0x1'));var BPromise=require(_0x65c5('0x2'));var rs=require(_0x65c5('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x65c5('0x4'))['db'];var utils=require(_0x65c5('0x5'));var logger=require(_0x65c5('0x6'))(_0x65c5('0x7'));var config=require(_0x65c5('0x8'));var jayson=require(_0x65c5('0x9'));var client=jayson[_0x65c5('0xa')][_0x65c5('0xb')]({'port':0x232a});function respondWithRpcPromise(_0xfd2828,_0x21e808,_0x5596fc){return new BPromise(function(_0x5f31a8,_0x234c03){return client[_0x65c5('0xc')](_0xfd2828,_0x5596fc)[_0x65c5('0xd')](function(_0x538a28){logger['info']('Trigger,\x20%s,\x20%s',_0x21e808,_0x65c5('0xe'));logger['debug']('Trigger,\x20%s,\x20%s,\x20%s',_0x21e808,_0x65c5('0xe'),JSON['stringify'](_0x538a28));if(_0x538a28[_0x65c5('0xf')]){if(_0x538a28[_0x65c5('0xf')][_0x65c5('0x10')]===0x1f4){logger['error'](_0x65c5('0x11'),_0x21e808,_0x538a28['error'][_0x65c5('0x12')]);return _0x234c03(_0x538a28[_0x65c5('0xf')][_0x65c5('0x12')]);}logger[_0x65c5('0xf')](_0x65c5('0x11'),_0x21e808,_0x538a28[_0x65c5('0xf')][_0x65c5('0x12')]);return _0x5f31a8(_0x538a28[_0x65c5('0xf')][_0x65c5('0x12')]);}else{logger[_0x65c5('0x13')](_0x65c5('0x11'),_0x21e808,_0x65c5('0xe'));_0x5f31a8(_0x538a28[_0x65c5('0x14')][_0x65c5('0x12')]);}})[_0x65c5('0x15')](function(_0x5d67ff){logger['error'](_0x65c5('0x11'),_0x21e808,_0x5d67ff);_0x234c03(_0x5d67ff);});});}exports[_0x65c5('0x16')]=function(_0x508716){var _0x4a6cc2=this;return new Promise(function(_0x35e01a,_0x112f06){return db[_0x65c5('0x17')][_0x65c5('0x18')]({'raw':_0x508716['options']?_0x508716[_0x65c5('0x19')][_0x65c5('0x1a')]===undefined?!![]:![]:!![],'where':_0x508716[_0x65c5('0x19')]?_0x508716[_0x65c5('0x19')]['where']||null:null,'attributes':_0x508716[_0x65c5('0x19')]?_0x508716[_0x65c5('0x19')][_0x65c5('0x1b')]||null:null,'limit':_0x508716['options']?_0x508716[_0x65c5('0x19')][_0x65c5('0x1c')]||null:null,'include':_0x508716[_0x65c5('0x19')]?_0x508716[_0x65c5('0x19')]['include']?_['map'](_0x508716[_0x65c5('0x19')][_0x65c5('0x1d')],function(_0x21bcc1){return{'model':db[_0x21bcc1[_0x65c5('0x1e')]],'as':_0x21bcc1['as'],'attributes':_0x21bcc1[_0x65c5('0x1b')],'include':_0x21bcc1[_0x65c5('0x1d')]?_[_0x65c5('0x1f')](_0x21bcc1[_0x65c5('0x1d')],function(_0x5f56f2){return{'model':db[_0x5f56f2[_0x65c5('0x1e')]],'as':_0x5f56f2['as'],'attributes':_0x5f56f2[_0x65c5('0x1b')],'include':_0x5f56f2['include']?_[_0x65c5('0x1f')](_0x5f56f2['include'],function(_0x1e7070){return{'model':db[_0x1e7070[_0x65c5('0x1e')]],'as':_0x1e7070['as'],'attributes':_0x1e7070[_0x65c5('0x1b')]};}):[]};}):[]};}):[]:[]})[_0x65c5('0xd')](function(_0x4cb32b){logger['info'](_0x65c5('0x16'),_0x508716);logger[_0x65c5('0x20')](_0x65c5('0x16'),_0x508716,JSON['stringify'](_0x4cb32b));_0x35e01a(_0x4cb32b);})[_0x65c5('0x15')](function(_0x3840d5){logger['error']('GetTrigger',_0x3840d5[_0x65c5('0x12')],_0x508716);_0x112f06(_0x4a6cc2[_0x65c5('0xf')](0x1f4,_0x3840d5['message']));});});};exports['ShowTrigger']=function(_0x43470d){var _0x764b11=this;return new Promise(function(_0xf4aacf,_0x3a556e){return db['Trigger'][_0x65c5('0x21')]({'raw':_0x43470d[_0x65c5('0x19')]?_0x43470d[_0x65c5('0x19')]['raw']===undefined?!![]:![]:!![],'where':_0x43470d[_0x65c5('0x19')]?_0x43470d[_0x65c5('0x19')]['where']||null:null,'attributes':_0x43470d[_0x65c5('0x19')]?_0x43470d[_0x65c5('0x19')]['attributes']||null:null,'include':_0x43470d[_0x65c5('0x19')]?_0x43470d[_0x65c5('0x19')][_0x65c5('0x1d')]?_[_0x65c5('0x1f')](_0x43470d[_0x65c5('0x19')][_0x65c5('0x1d')],function(_0x1957c7){return{'model':db[_0x1957c7[_0x65c5('0x1e')]],'as':_0x1957c7['as'],'attributes':_0x1957c7[_0x65c5('0x1b')],'include':_0x1957c7[_0x65c5('0x1d')]?_['map'](_0x1957c7[_0x65c5('0x1d')],function(_0x33759e){return{'model':db[_0x33759e[_0x65c5('0x1e')]],'as':_0x33759e['as'],'attributes':_0x33759e[_0x65c5('0x1b')],'include':_0x33759e['include']?_[_0x65c5('0x1f')](_0x33759e[_0x65c5('0x1d')],function(_0x40b164){return{'model':db[_0x40b164['model']],'as':_0x40b164['as'],'attributes':_0x40b164[_0x65c5('0x1b')]};}):[]};}):[]};}):[]:[]})[_0x65c5('0xd')](function(_0x4f4c33){logger[_0x65c5('0x13')]('ShowTrigger',_0x43470d);logger['debug'](_0x65c5('0x22'),_0x43470d,JSON['stringify'](_0x4f4c33));_0xf4aacf(_0x4f4c33);})[_0x65c5('0x15')](function(_0x5e2c4f){logger['error'](_0x65c5('0x22'),_0x5e2c4f[_0x65c5('0x12')],_0x43470d);_0x3a556e(_0x764b11[_0x65c5('0xf')](0x1f4,_0x5e2c4f[_0x65c5('0x12')]));});});}; \ No newline at end of file diff --git a/server/api/trunk/index.js b/server/api/trunk/index.js index 18c4302..a7320b9 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 _0xde6f=['Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','/:id','show','clone','post','create','put','update','delete','destroy','exports','multer','util','path','express'];(function(_0x2ecb67,_0x8ec62d){var _0x168079=function(_0x56c365){while(--_0x56c365){_0x2ecb67['push'](_0x2ecb67['shift']());}};_0x168079(++_0x8ec62d);}(_0xde6f,0x176));var _0xfde6=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0xde6f[_0x321bb2];return _0x9c12ed;};'use strict';var multer=require(_0xfde6('0x0'));var util=require(_0xfde6('0x1'));var path=require(_0xfde6('0x2'));var timeout=require('connect-timeout');var express=require(_0xfde6('0x3'));var router=express[_0xfde6('0x4')]();var fs_extra=require(_0xfde6('0x5'));var auth=require(_0xfde6('0x6'));var interaction=require(_0xfde6('0x7'));var config=require(_0xfde6('0x8'));var controller=require('./trunk.controller');router[_0xfde6('0x9')]('/',auth[_0xfde6('0xa')](),controller['index']);router[_0xfde6('0x9')](_0xfde6('0xb'),auth[_0xfde6('0xa')](),controller[_0xfde6('0xc')]);router['post']('/:id/clone',auth[_0xfde6('0xa')](),controller[_0xfde6('0xd')]);router[_0xfde6('0xe')]('/',auth['isAuthenticated'](),controller[_0xfde6('0xf')]);router[_0xfde6('0x10')](_0xfde6('0xb'),auth[_0xfde6('0xa')](),controller[_0xfde6('0x11')]);router[_0xfde6('0x12')](_0xfde6('0xb'),auth['isAuthenticated'](),controller[_0xfde6('0x13')]);module[_0xfde6('0x14')]=router; \ No newline at end of file +var _0xe570=['index','/:id','show','post','clone','create','update','delete','exports','multer','util','path','connect-timeout','express','fs-extra','../../components/auth/service','../../config/environment','./trunk.controller','get','isAuthenticated'];(function(_0x40c885,_0x39e72e){var _0x517061=function(_0xe952e9){while(--_0xe952e9){_0x40c885['push'](_0x40c885['shift']());}};_0x517061(++_0x39e72e);}(_0xe570,0x95));var _0x0e57=function(_0x31db73,_0x5ac462){_0x31db73=_0x31db73-0x0;var _0x30b2e8=_0xe570[_0x31db73];return _0x30b2e8;};'use strict';var multer=require(_0x0e57('0x0'));var util=require(_0x0e57('0x1'));var path=require(_0x0e57('0x2'));var timeout=require(_0x0e57('0x3'));var express=require(_0x0e57('0x4'));var router=express['Router']();var fs_extra=require(_0x0e57('0x5'));var auth=require(_0x0e57('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0x0e57('0x7'));var controller=require(_0x0e57('0x8'));router[_0x0e57('0x9')]('/',auth[_0x0e57('0xa')](),controller[_0x0e57('0xb')]);router['get'](_0x0e57('0xc'),auth['isAuthenticated'](),controller[_0x0e57('0xd')]);router[_0x0e57('0xe')]('/:id/clone',auth[_0x0e57('0xa')](),controller[_0x0e57('0xf')]);router[_0x0e57('0xe')]('/',auth[_0x0e57('0xa')](),controller[_0x0e57('0x10')]);router['put'](_0x0e57('0xc'),auth[_0x0e57('0xa')](),controller[_0x0e57('0x11')]);router[_0x0e57('0x12')](_0x0e57('0xc'),auth['isAuthenticated'](),controller['destroy']);module[_0x0e57('0x13')]=router; \ No newline at end of file diff --git a/server/api/trunk/trunk.attributes.js b/server/api/trunk/trunk.attributes.js index 705bf22..b26f360 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 _0xc8b3=['ALLOWED_FAILED_SCREEN','PROHIB_NOT_SCREENED','PROHIB_PASSED_SCREEN','PROHIB','udp','setDataValue','transport','join','getDataValue','String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22udp\x22,\x20\x22tcp\x22]','rfc2833','info','shortinfo','inband','yes','nonat','outgoing','nat','String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22force_rport\x22,\x20\x22comedia\x22]','all','ulaw;alaw;gsm','allow','split','String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22ulaw\x22,\x20\x22alaw\x22,\x20\x22alaw\x22]','port,invite','insecure','String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22port\x22,\x20\x22invite\x22]','\x22\x22\x20<>','always','accept','refuse','originate','INTEGER','uac','uas','pai','fingerprint','certificate','active','passive','dynamic','update','update,nonat','BOOLEAN','exports','STRING','name','friend','user','peer','from-voip-provider','ENUM','ALLOWED_NOT_SCREENED','ALLOWED_PASSED_SCREEN'];(function(_0x4c8fd1,_0x406a8a){var _0x3a09dd=function(_0x5549bc){while(--_0x5549bc){_0x4c8fd1['push'](_0x4c8fd1['shift']());}};_0x3a09dd(++_0x406a8a);}(_0xc8b3,0x1dc));var _0x3c8b=function(_0x56d970,_0x42c6e6){_0x56d970=_0x56d970-0x0;var _0x9180e6=_0xc8b3[_0x56d970];return _0x9180e6;};'use strict';var Sequelize=require('sequelize');module[_0x3c8b('0x0')]={'name':{'type':Sequelize[_0x3c8b('0x1')],'allowNull':![],'unique':_0x3c8b('0x2'),'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'type':{'type':Sequelize['ENUM'](_0x3c8b('0x3'),_0x3c8b('0x4'),_0x3c8b('0x5')),'allowNull':![],'defaultValue':_0x3c8b('0x3')},'context':{'type':Sequelize[_0x3c8b('0x1')],'allowNull':![],'defaultValue':_0x3c8b('0x6')},'callingpres':{'type':Sequelize[_0x3c8b('0x7')](_0x3c8b('0x8'),_0x3c8b('0x9'),_0x3c8b('0xa'),'ALLOWED',_0x3c8b('0xb'),_0x3c8b('0xc'),'PROHIB_FAILED_SCREEN',_0x3c8b('0xd'))},'deny':{'type':Sequelize[_0x3c8b('0x1')]},'permit':{'type':Sequelize['STRING']},'secret':{'type':Sequelize[_0x3c8b('0x1')]},'md5secret':{'type':Sequelize['STRING']},'remotesecret':{'type':Sequelize['STRING']},'transport':{'type':Sequelize[_0x3c8b('0x1')],'defaultValue':_0x3c8b('0xe'),'set':function(_0x11a807){this[_0x3c8b('0xf')](_0x3c8b('0x10'),_0x11a807?_0x11a807[_0x3c8b('0x11')](','):null);},'get':function(){return this[_0x3c8b('0x12')](_0x3c8b('0x10'))?this[_0x3c8b('0x12')](_0x3c8b('0x10'))['split'](','):null;},'comment':_0x3c8b('0x13')},'dtmfmode':{'type':Sequelize['ENUM'](_0x3c8b('0x14'),_0x3c8b('0x15'),_0x3c8b('0x16'),_0x3c8b('0x17'),'auto'),'defaultValue':'rfc2833'},'directmedia':{'type':Sequelize[_0x3c8b('0x7')](_0x3c8b('0x18'),'no',_0x3c8b('0x19'),'update',_0x3c8b('0x1a')),'defaultValue':'no'},'directrtpsetup':{'type':Sequelize[_0x3c8b('0x7')](_0x3c8b('0x18'),'no'),'defaultValue':'no'},'directmediapermit':{'type':Sequelize[_0x3c8b('0x1')]},'directmediadeny':{'type':Sequelize[_0x3c8b('0x1')]},'nat':{'type':Sequelize[_0x3c8b('0x1')],'defaultValue':'force_rport,comedia','set':function(_0xfc7ab2){this['setDataValue'](_0x3c8b('0x1b'),_0xfc7ab2?_0xfc7ab2[_0x3c8b('0x11')](','):null);},'get':function(){return this[_0x3c8b('0x12')](_0x3c8b('0x1b'))?this[_0x3c8b('0x12')](_0x3c8b('0x1b'))['split'](','):null;},'comment':_0x3c8b('0x1c')},'callgroup':{'type':Sequelize[_0x3c8b('0x1')]},'namedcallgroup':{'type':Sequelize[_0x3c8b('0x1')]},'pickupgroup':{'type':Sequelize[_0x3c8b('0x1')]},'namedpickupgroup':{'type':Sequelize[_0x3c8b('0x1')]},'language':{'type':Sequelize[_0x3c8b('0x1')],'defaultValue':'en'},'tonezone':{'type':Sequelize['STRING'],'allowNull':!![]},'disallow':{'type':Sequelize['STRING'],'defaultValue':_0x3c8b('0x1d')},'allow':{'type':Sequelize[_0x3c8b('0x1')],'allowNull':![],'defaultValue':_0x3c8b('0x1e'),'set':function(_0x5c960c){this['setDataValue']('allow',_0x5c960c?_0x5c960c['join'](';'):'ulaw;alaw;gsm');},'get':function(){return this['getDataValue'](_0x3c8b('0x1f'))?this[_0x3c8b('0x12')]('allow')[_0x3c8b('0x20')](';'):null;},'comment':_0x3c8b('0x21')},'autoframing':{'type':Sequelize[_0x3c8b('0x7')]('yes','no')},'insecure':{'type':Sequelize['STRING'],'defaultValue':_0x3c8b('0x22'),'set':function(_0x19e475){this[_0x3c8b('0xf')](_0x3c8b('0x23'),_0x19e475?_0x19e475[_0x3c8b('0x11')](','):null);},'get':function(){return this['getDataValue']('insecure')?this[_0x3c8b('0x12')](_0x3c8b('0x23'))[_0x3c8b('0x20')](','):null;},'comment':_0x3c8b('0x24')},'trustrpid':{'type':Sequelize['ENUM']('yes','no'),'defaultValue':'no'},'trust_id_outbound':{'type':Sequelize[_0x3c8b('0x7')](_0x3c8b('0x18'),'no'),'defaultValue':'no'},'progressinband':{'type':Sequelize[_0x3c8b('0x7')]('yes','no','never')},'promiscredir':{'type':Sequelize[_0x3c8b('0x7')]('yes','no')},'useclientcode':{'type':Sequelize['ENUM'](_0x3c8b('0x18'),'no')},'accountcode':{'type':Sequelize['INTEGER'](0xb)},'setvar':{'type':Sequelize[_0x3c8b('0x1')]},'callerid':{'type':Sequelize[_0x3c8b('0x1')],'defaultValue':_0x3c8b('0x25')},'amaflags':{'type':Sequelize[_0x3c8b('0x1')]},'callcounter':{'type':Sequelize['ENUM'](_0x3c8b('0x18'),'no'),'defaultValue':_0x3c8b('0x18')},'busylevel':{'type':Sequelize['INTEGER'](0xb)},'allowoverlap':{'type':Sequelize['ENUM'](_0x3c8b('0x18'),'no')},'allowsubscribe':{'type':Sequelize[_0x3c8b('0x7')](_0x3c8b('0x18'),'no')},'allowtransfer':{'type':Sequelize[_0x3c8b('0x7')](_0x3c8b('0x18'),'no')},'ignoresdpversion':{'type':Sequelize[_0x3c8b('0x7')](_0x3c8b('0x18'),'no')},'subscribecontext':{'type':Sequelize[_0x3c8b('0x1')]},'template':{'type':Sequelize[_0x3c8b('0x1')]},'videosupport':{'type':Sequelize[_0x3c8b('0x7')](_0x3c8b('0x18'),'no',_0x3c8b('0x26')),'defaultValue':'no'},'maxcallbitrate':{'type':Sequelize['INTEGER'](0xb)},'rfc2833compensate':{'type':Sequelize[_0x3c8b('0x7')](_0x3c8b('0x18'),'no')},'mailbox':{'type':Sequelize[_0x3c8b('0x1')]},'session_timers':{'type':Sequelize['ENUM'](_0x3c8b('0x27'),_0x3c8b('0x28'),_0x3c8b('0x29'))},'session_expires':{'type':Sequelize[_0x3c8b('0x2a')](0xb)},'session_minse':{'type':Sequelize[_0x3c8b('0x2a')](0xb)},'session_refresher':{'type':Sequelize[_0x3c8b('0x7')](_0x3c8b('0x2b'),_0x3c8b('0x2c')),'defaultValue':'uas'},'t38pt_usertpsource':{'type':Sequelize[_0x3c8b('0x1')]},'regexten':{'type':Sequelize[_0x3c8b('0x1')]},'fromdomain':{'type':Sequelize[_0x3c8b('0x1')]},'fromuser':{'type':Sequelize[_0x3c8b('0x1')]},'port':{'type':Sequelize[_0x3c8b('0x2a')](0x5)},'qualify':{'type':Sequelize['ENUM'](_0x3c8b('0x18'),'no'),'defaultValue':_0x3c8b('0x18')},'keepalive':{'type':Sequelize[_0x3c8b('0x2a')](0xb)},'defaultip':{'type':Sequelize['STRING']},'defaultuser':{'type':Sequelize[_0x3c8b('0x1')]},'rtptimeout':{'type':Sequelize[_0x3c8b('0x2a')](0xb)},'rtpholdtimeout':{'type':Sequelize[_0x3c8b('0x2a')](0xb)},'rtpkeepalive':{'type':Sequelize[_0x3c8b('0x2a')](0xb)},'sendrpid':{'type':Sequelize['ENUM'](_0x3c8b('0x18'),'no',_0x3c8b('0x2d')),'defaultValue':'no'},'outboundproxy':{'type':Sequelize['STRING']},'callbackextension':{'type':Sequelize['STRING']},'timert1':{'type':Sequelize['INTEGER'](0xb)},'timerb':{'type':Sequelize[_0x3c8b('0x2a')](0xb)},'qualifyfreq':{'type':Sequelize[_0x3c8b('0x2a')](0xb)},'contactpermit':{'type':Sequelize['STRING']},'contactdeny':{'type':Sequelize[_0x3c8b('0x1')]},'contactacl':{'type':Sequelize[_0x3c8b('0x1')]},'unsolicited_mailbox':{'type':Sequelize[_0x3c8b('0x1')]},'use_q850_reason':{'type':Sequelize[_0x3c8b('0x1')]},'maxforwards':{'type':Sequelize['INTEGER'](0xb)},'encryption':{'type':Sequelize['ENUM'](_0x3c8b('0x18'),'no'),'defaultValue':'no'},'avpf':{'type':Sequelize['ENUM'](_0x3c8b('0x18'),'no')},'force_avp':{'type':Sequelize['ENUM'](_0x3c8b('0x18'),'no')},'icesupport':{'type':Sequelize['ENUM'](_0x3c8b('0x18'),'no')},'dtlsenable':{'type':Sequelize[_0x3c8b('0x7')]('yes','no')},'dtlsverify':{'type':Sequelize[_0x3c8b('0x7')](_0x3c8b('0x18'),'no',_0x3c8b('0x2e'),_0x3c8b('0x2f'))},'dtlsrekey':{'type':Sequelize[_0x3c8b('0x2a')](0xb)},'dtlscertfile':{'type':Sequelize[_0x3c8b('0x1')]},'dtlsprivatekey':{'type':Sequelize['STRING']},'dtlscipher':{'type':Sequelize[_0x3c8b('0x1')]},'dtlscafile':{'type':Sequelize[_0x3c8b('0x1')]},'dtlscapath':{'type':Sequelize[_0x3c8b('0x1')]},'dtlssetup':{'type':Sequelize['ENUM'](_0x3c8b('0x30'),_0x3c8b('0x31'),'actpass'),'allowNull':!![]},'dtlsfingerprint':{'type':Sequelize[_0x3c8b('0x1')]},'usereqphone':{'type':Sequelize[_0x3c8b('0x7')](_0x3c8b('0x18'),'no'),'defaultValue':'no'},'recordonfeature':{'type':Sequelize['STRING']},'recordofffeature':{'type':Sequelize[_0x3c8b('0x1')]},'call_limit':{'type':Sequelize[_0x3c8b('0x2a')](0xb),'defaultValue':0x3e8},'registertrying':{'type':Sequelize[_0x3c8b('0x7')]('yes','no')},'subscribemwi':{'type':Sequelize[_0x3c8b('0x7')]('yes','no')},'vmexten':{'type':Sequelize['STRING']},'mohinterpret':{'type':Sequelize['STRING']},'mohsuggest':{'type':Sequelize[_0x3c8b('0x1')]},'parkinglot':{'type':Sequelize[_0x3c8b('0x1')]},'description':{'type':Sequelize[_0x3c8b('0x1')]},'host':{'type':Sequelize[_0x3c8b('0x1')],'defaultValue':_0x3c8b('0x32')},'canreinvite':{'type':Sequelize[_0x3c8b('0x7')](_0x3c8b('0x18'),'no',_0x3c8b('0x19'),_0x3c8b('0x33'),_0x3c8b('0x34')),'defaultValue':'no'},'registry':{'type':Sequelize[_0x3c8b('0x1')]},'otherFields':{'type':Sequelize[_0x3c8b('0x1')]},'active':{'type':Sequelize[_0x3c8b('0x35')],'allowNull':![],'defaultValue':!![]},'t38pt_udptl':{'type':Sequelize[_0x3c8b('0x1')],'defaultValue':'no'}}; \ No newline at end of file +var _0xac10=['sequelize','exports','STRING','ENUM','friend','user','ALLOWED_NOT_SCREENED','ALLOWED_PASSED_SCREEN','ALLOWED_FAILED_SCREEN','ALLOWED','PROHIB_NOT_SCREENED','PROHIB','udp','setDataValue','join','getDataValue','transport','String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22udp\x22,\x20\x22tcp\x22]','info','shortinfo','inband','auto','rfc2833','update','outgoing','yes','force_rport,comedia','nat','split','all','ulaw;alaw;gsm','allow','insecure','String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22port\x22,\x20\x22invite\x22]','always','refuse','originate','INTEGER','uac','uas','passive','actpass','dynamic','nonat','update,nonat','BOOLEAN'];(function(_0x2b21c8,_0x9acdf5){var _0xb72ef2=function(_0x4b61bb){while(--_0x4b61bb){_0x2b21c8['push'](_0x2b21c8['shift']());}};_0xb72ef2(++_0x9acdf5);}(_0xac10,0x8a));var _0x0ac1=function(_0x29cce4,_0x379f7c){_0x29cce4=_0x29cce4-0x0;var _0x1a6616=_0xac10[_0x29cce4];return _0x1a6616;};'use strict';var Sequelize=require(_0x0ac1('0x0'));module[_0x0ac1('0x1')]={'name':{'type':Sequelize[_0x0ac1('0x2')],'allowNull':![],'unique':'name','validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'type':{'type':Sequelize[_0x0ac1('0x3')](_0x0ac1('0x4'),_0x0ac1('0x5'),'peer'),'allowNull':![],'defaultValue':_0x0ac1('0x4')},'context':{'type':Sequelize[_0x0ac1('0x2')],'allowNull':![],'defaultValue':'from-voip-provider'},'callingpres':{'type':Sequelize['ENUM'](_0x0ac1('0x6'),_0x0ac1('0x7'),_0x0ac1('0x8'),_0x0ac1('0x9'),_0x0ac1('0xa'),'PROHIB_PASSED_SCREEN','PROHIB_FAILED_SCREEN',_0x0ac1('0xb'))},'deny':{'type':Sequelize['STRING']},'permit':{'type':Sequelize[_0x0ac1('0x2')]},'secret':{'type':Sequelize[_0x0ac1('0x2')]},'md5secret':{'type':Sequelize[_0x0ac1('0x2')]},'remotesecret':{'type':Sequelize[_0x0ac1('0x2')]},'transport':{'type':Sequelize[_0x0ac1('0x2')],'defaultValue':_0x0ac1('0xc'),'set':function(_0x5c56de){this[_0x0ac1('0xd')]('transport',_0x5c56de?_0x5c56de[_0x0ac1('0xe')](','):null);},'get':function(){return this[_0x0ac1('0xf')](_0x0ac1('0x10'))?this[_0x0ac1('0xf')](_0x0ac1('0x10'))['split'](','):null;},'comment':_0x0ac1('0x11')},'dtmfmode':{'type':Sequelize[_0x0ac1('0x3')]('rfc2833',_0x0ac1('0x12'),_0x0ac1('0x13'),_0x0ac1('0x14'),_0x0ac1('0x15')),'defaultValue':_0x0ac1('0x16')},'directmedia':{'type':Sequelize[_0x0ac1('0x3')]('yes','no','nonat',_0x0ac1('0x17'),_0x0ac1('0x18')),'defaultValue':'no'},'directrtpsetup':{'type':Sequelize[_0x0ac1('0x3')](_0x0ac1('0x19'),'no'),'defaultValue':'no'},'directmediapermit':{'type':Sequelize[_0x0ac1('0x2')]},'directmediadeny':{'type':Sequelize[_0x0ac1('0x2')]},'nat':{'type':Sequelize[_0x0ac1('0x2')],'defaultValue':_0x0ac1('0x1a'),'set':function(_0xbba9ed){this['setDataValue'](_0x0ac1('0x1b'),_0xbba9ed?_0xbba9ed[_0x0ac1('0xe')](','):null);},'get':function(){return this[_0x0ac1('0xf')](_0x0ac1('0x1b'))?this[_0x0ac1('0xf')](_0x0ac1('0x1b'))[_0x0ac1('0x1c')](','):null;},'comment':'String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22force_rport\x22,\x20\x22comedia\x22]'},'callgroup':{'type':Sequelize[_0x0ac1('0x2')]},'namedcallgroup':{'type':Sequelize[_0x0ac1('0x2')]},'pickupgroup':{'type':Sequelize[_0x0ac1('0x2')]},'namedpickupgroup':{'type':Sequelize['STRING']},'language':{'type':Sequelize[_0x0ac1('0x2')],'defaultValue':'en'},'tonezone':{'type':Sequelize[_0x0ac1('0x2')],'allowNull':!![]},'disallow':{'type':Sequelize['STRING'],'defaultValue':_0x0ac1('0x1d')},'allow':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':_0x0ac1('0x1e'),'set':function(_0x291c21){this['setDataValue'](_0x0ac1('0x1f'),_0x291c21?_0x291c21[_0x0ac1('0xe')](';'):_0x0ac1('0x1e'));},'get':function(){return this['getDataValue'](_0x0ac1('0x1f'))?this[_0x0ac1('0xf')](_0x0ac1('0x1f'))[_0x0ac1('0x1c')](';'):null;},'comment':'String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22ulaw\x22,\x20\x22alaw\x22,\x20\x22alaw\x22]'},'autoframing':{'type':Sequelize[_0x0ac1('0x3')](_0x0ac1('0x19'),'no')},'insecure':{'type':Sequelize['STRING'],'defaultValue':'port,invite','set':function(_0x2c5977){this['setDataValue'](_0x0ac1('0x20'),_0x2c5977?_0x2c5977[_0x0ac1('0xe')](','):null);},'get':function(){return this[_0x0ac1('0xf')](_0x0ac1('0x20'))?this[_0x0ac1('0xf')](_0x0ac1('0x20'))['split'](','):null;},'comment':_0x0ac1('0x21')},'trustrpid':{'type':Sequelize['ENUM'](_0x0ac1('0x19'),'no'),'defaultValue':'no'},'trust_id_outbound':{'type':Sequelize[_0x0ac1('0x3')](_0x0ac1('0x19'),'no'),'defaultValue':'no'},'progressinband':{'type':Sequelize[_0x0ac1('0x3')](_0x0ac1('0x19'),'no','never')},'promiscredir':{'type':Sequelize[_0x0ac1('0x3')](_0x0ac1('0x19'),'no')},'useclientcode':{'type':Sequelize[_0x0ac1('0x3')]('yes','no')},'accountcode':{'type':Sequelize['INTEGER'](0xb)},'setvar':{'type':Sequelize[_0x0ac1('0x2')]},'callerid':{'type':Sequelize[_0x0ac1('0x2')],'defaultValue':'\x22\x22\x20<>'},'amaflags':{'type':Sequelize[_0x0ac1('0x2')]},'callcounter':{'type':Sequelize['ENUM'](_0x0ac1('0x19'),'no'),'defaultValue':_0x0ac1('0x19')},'busylevel':{'type':Sequelize['INTEGER'](0xb)},'allowoverlap':{'type':Sequelize[_0x0ac1('0x3')](_0x0ac1('0x19'),'no')},'allowsubscribe':{'type':Sequelize['ENUM']('yes','no')},'allowtransfer':{'type':Sequelize['ENUM']('yes','no')},'ignoresdpversion':{'type':Sequelize[_0x0ac1('0x3')](_0x0ac1('0x19'),'no')},'subscribecontext':{'type':Sequelize[_0x0ac1('0x2')]},'template':{'type':Sequelize[_0x0ac1('0x2')]},'videosupport':{'type':Sequelize['ENUM'](_0x0ac1('0x19'),'no',_0x0ac1('0x22')),'defaultValue':'no'},'maxcallbitrate':{'type':Sequelize['INTEGER'](0xb)},'rfc2833compensate':{'type':Sequelize[_0x0ac1('0x3')](_0x0ac1('0x19'),'no')},'mailbox':{'type':Sequelize[_0x0ac1('0x2')]},'session_timers':{'type':Sequelize[_0x0ac1('0x3')]('accept',_0x0ac1('0x23'),_0x0ac1('0x24'))},'session_expires':{'type':Sequelize['INTEGER'](0xb)},'session_minse':{'type':Sequelize[_0x0ac1('0x25')](0xb)},'session_refresher':{'type':Sequelize[_0x0ac1('0x3')](_0x0ac1('0x26'),_0x0ac1('0x27')),'defaultValue':_0x0ac1('0x27')},'t38pt_usertpsource':{'type':Sequelize['STRING']},'regexten':{'type':Sequelize[_0x0ac1('0x2')]},'fromdomain':{'type':Sequelize['STRING']},'fromuser':{'type':Sequelize['STRING']},'port':{'type':Sequelize[_0x0ac1('0x25')](0x5)},'qualify':{'type':Sequelize[_0x0ac1('0x3')](_0x0ac1('0x19'),'no'),'defaultValue':_0x0ac1('0x19')},'keepalive':{'type':Sequelize[_0x0ac1('0x25')](0xb)},'defaultip':{'type':Sequelize[_0x0ac1('0x2')]},'defaultuser':{'type':Sequelize['STRING']},'rtptimeout':{'type':Sequelize[_0x0ac1('0x25')](0xb)},'rtpholdtimeout':{'type':Sequelize[_0x0ac1('0x25')](0xb)},'rtpkeepalive':{'type':Sequelize['INTEGER'](0xb)},'sendrpid':{'type':Sequelize[_0x0ac1('0x3')](_0x0ac1('0x19'),'no','pai'),'defaultValue':'no'},'outboundproxy':{'type':Sequelize[_0x0ac1('0x2')]},'callbackextension':{'type':Sequelize[_0x0ac1('0x2')]},'timert1':{'type':Sequelize[_0x0ac1('0x25')](0xb)},'timerb':{'type':Sequelize['INTEGER'](0xb)},'qualifyfreq':{'type':Sequelize[_0x0ac1('0x25')](0xb)},'contactpermit':{'type':Sequelize[_0x0ac1('0x2')]},'contactdeny':{'type':Sequelize[_0x0ac1('0x2')]},'contactacl':{'type':Sequelize[_0x0ac1('0x2')]},'unsolicited_mailbox':{'type':Sequelize[_0x0ac1('0x2')]},'use_q850_reason':{'type':Sequelize[_0x0ac1('0x2')]},'maxforwards':{'type':Sequelize['INTEGER'](0xb)},'encryption':{'type':Sequelize[_0x0ac1('0x3')](_0x0ac1('0x19'),'no'),'defaultValue':'no'},'avpf':{'type':Sequelize[_0x0ac1('0x3')](_0x0ac1('0x19'),'no')},'force_avp':{'type':Sequelize['ENUM'](_0x0ac1('0x19'),'no')},'icesupport':{'type':Sequelize[_0x0ac1('0x3')](_0x0ac1('0x19'),'no')},'dtlsenable':{'type':Sequelize[_0x0ac1('0x3')]('yes','no')},'dtlsverify':{'type':Sequelize['ENUM'](_0x0ac1('0x19'),'no','fingerprint','certificate')},'dtlsrekey':{'type':Sequelize['INTEGER'](0xb)},'dtlscertfile':{'type':Sequelize['STRING']},'dtlsprivatekey':{'type':Sequelize[_0x0ac1('0x2')]},'dtlscipher':{'type':Sequelize['STRING']},'dtlscafile':{'type':Sequelize[_0x0ac1('0x2')]},'dtlscapath':{'type':Sequelize[_0x0ac1('0x2')]},'dtlssetup':{'type':Sequelize[_0x0ac1('0x3')]('active',_0x0ac1('0x28'),_0x0ac1('0x29')),'allowNull':!![]},'dtlsfingerprint':{'type':Sequelize[_0x0ac1('0x2')]},'usereqphone':{'type':Sequelize['ENUM'](_0x0ac1('0x19'),'no'),'defaultValue':'no'},'recordonfeature':{'type':Sequelize[_0x0ac1('0x2')]},'recordofffeature':{'type':Sequelize[_0x0ac1('0x2')]},'call_limit':{'type':Sequelize[_0x0ac1('0x25')](0xb),'defaultValue':0x3e8},'registertrying':{'type':Sequelize[_0x0ac1('0x3')](_0x0ac1('0x19'),'no')},'subscribemwi':{'type':Sequelize['ENUM'](_0x0ac1('0x19'),'no')},'vmexten':{'type':Sequelize[_0x0ac1('0x2')]},'mohinterpret':{'type':Sequelize[_0x0ac1('0x2')]},'mohsuggest':{'type':Sequelize[_0x0ac1('0x2')]},'parkinglot':{'type':Sequelize[_0x0ac1('0x2')]},'description':{'type':Sequelize[_0x0ac1('0x2')]},'host':{'type':Sequelize[_0x0ac1('0x2')],'defaultValue':_0x0ac1('0x2a')},'canreinvite':{'type':Sequelize[_0x0ac1('0x3')]('yes','no',_0x0ac1('0x2b'),_0x0ac1('0x17'),_0x0ac1('0x2c')),'defaultValue':'no'},'registry':{'type':Sequelize['STRING']},'otherFields':{'type':Sequelize[_0x0ac1('0x2')]},'active':{'type':Sequelize[_0x0ac1('0x2d')],'allowNull':![],'defaultValue':!![]},'t38pt_udptl':{'type':Sequelize[_0x0ac1('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 019abaf..aea3e17 100644 --- a/server/api/trunk/trunk.controller.js +++ b/server/api/trunk/trunk.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x6aa7=['sort','where','filters','pick','filter','merge','VIRTUAL','options','include','findAll','rows','params','length','includeAll','clone','find','get','createdAt','body','omit','updatedAt','create','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','readFileSync','join','root','server/files/templates/trunk.ejs','render','/etc/asterisk/sip_xcally_trunks.conf','registry','/etc/asterisk/sip_xcally_registers.conf','Reload','chan_sip.so','autoAssociation','update','utf8','server/files/templates/registry.ejs','writeFileSync','eml-format','zip-dir','fast-json-patch','request-promise','moment','mustache','util','path','ejs','lodash','squel','crypto','desk.js','to-csv','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','jayson/promise','http','then','Trunk,\x20%s,\x20%s','debug','request\x20sent','stringify','error','code','message','result','catch','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','destroy','Trunks','UserProfileResource','stack','name','index','map','Trunk','rawAttributes','fieldName','type','model','query','keys','attributes','intersection','fields','order'];(function(_0x517d7a,_0xad7160){var _0x149269=function(_0x1d2a87){while(--_0x1d2a87){_0x517d7a['push'](_0x517d7a['shift']());}};_0x149269(++_0xad7160);}(_0x6aa7,0x178));var _0x76aa=function(_0x1ef8b7,_0x788452){_0x1ef8b7=_0x1ef8b7-0x0;var _0xde938=_0x6aa7[_0x1ef8b7];return _0xde938;};'use strict';var emlformat=require(_0x76aa('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x76aa('0x1'));var jsonpatch=require(_0x76aa('0x2'));var rp=require(_0x76aa('0x3'));var moment=require(_0x76aa('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x76aa('0x5'));var util=require(_0x76aa('0x6'));var path=require(_0x76aa('0x7'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0x76aa('0x8'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x76aa('0x9'));var squel=require(_0x76aa('0xa'));var crypto=require(_0x76aa('0xb'));var jsforce=require('jsforce');var deskjs=require(_0x76aa('0xc'));var toCsv=require(_0x76aa('0xd'));var querystring=require(_0x76aa('0xe'));var Papa=require('papaparse');var Redis=require(_0x76aa('0xf'));var authService=require(_0x76aa('0x10'));var qs=require(_0x76aa('0x11'));var as=require(_0x76aa('0x12'));var hardwareService=require(_0x76aa('0x13'));var logger=require(_0x76aa('0x14'))(_0x76aa('0x15'));var utils=require(_0x76aa('0x16'));var config=require(_0x76aa('0x17'));var licenseUtil=require(_0x76aa('0x18'));var db=require('../../mysqldb')['db'];var jayson=require(_0x76aa('0x19'));var client=jayson['client'][_0x76aa('0x1a')]({'port':0x232a});function respondWithRpcPromise(_0x12dde0,_0x3f8f6b,_0x8e44ed,_0x10432c){return new BPromise(function(_0x4e309f,_0x5f5b59){var _0x2b3b4f=_0x10432c||client;return _0x2b3b4f['request'](_0x12dde0,_0x8e44ed)[_0x76aa('0x1b')](function(_0x319bf1){logger['info'](_0x76aa('0x1c'),_0x3f8f6b,'request\x20sent');logger[_0x76aa('0x1d')]('Trunk,\x20%s,\x20%s,\x20%s',_0x3f8f6b,_0x76aa('0x1e'),JSON[_0x76aa('0x1f')](_0x319bf1));if(_0x319bf1[_0x76aa('0x20')]){if(_0x319bf1[_0x76aa('0x20')][_0x76aa('0x21')]===0x1f4){logger[_0x76aa('0x20')]('Trunk,\x20%s,\x20%s',_0x3f8f6b,_0x319bf1['error'][_0x76aa('0x22')]);return _0x5f5b59(_0x319bf1[_0x76aa('0x20')][_0x76aa('0x22')]);}logger[_0x76aa('0x20')](_0x76aa('0x1c'),_0x3f8f6b,_0x319bf1[_0x76aa('0x20')][_0x76aa('0x22')]);return _0x4e309f(_0x319bf1[_0x76aa('0x20')][_0x76aa('0x22')]);}else{logger['info'](_0x76aa('0x1c'),_0x3f8f6b,_0x76aa('0x1e'));_0x4e309f(_0x319bf1[_0x76aa('0x23')]['message']);}})[_0x76aa('0x24')](function(_0x189cb6){logger[_0x76aa('0x20')](_0x76aa('0x1c'),_0x3f8f6b,_0x189cb6);_0x5f5b59(_0x189cb6);});});}function respondWithStatusCode(_0x29c50c,_0xc1044c){_0xc1044c=_0xc1044c||0xcc;return function(_0x3cd039){if(_0x3cd039){return _0x29c50c[_0x76aa('0x25')](_0xc1044c);}return _0x29c50c[_0x76aa('0x26')](_0xc1044c)[_0x76aa('0x27')]();};}function respondWithResult(_0x37f1ab,_0x26b75e){_0x26b75e=_0x26b75e||0xc8;return function(_0x3599a9){if(_0x3599a9){return _0x37f1ab['status'](_0x26b75e)[_0x76aa('0x28')](_0x3599a9);}};}function respondWithFilteredResult(_0x1d6d15,_0x25c614){return function(_0x2e7ab4){if(_0x2e7ab4){var _0xa1e6=typeof _0x25c614[_0x76aa('0x29')]===_0x76aa('0x2a')&&typeof _0x25c614[_0x76aa('0x2b')]===_0x76aa('0x2a');var _0x1bdc3d=_0x2e7ab4['count'];var _0x3fcb7f=_0xa1e6?0x0:_0x25c614['offset'];var _0x994550=_0xa1e6?_0x2e7ab4[_0x76aa('0x2c')]:_0x25c614[_0x76aa('0x29')]+_0x25c614[_0x76aa('0x2b')];var _0x1eecd9;if(_0x994550>=_0x1bdc3d){_0x994550=_0x1bdc3d;_0x1eecd9=0xc8;}else{_0x1eecd9=0xce;}_0x1d6d15[_0x76aa('0x26')](_0x1eecd9);return _0x1d6d15[_0x76aa('0x2d')](_0x76aa('0x2e'),_0x3fcb7f+'-'+_0x994550+'/'+_0x1bdc3d)[_0x76aa('0x28')](_0x2e7ab4);}return null;};}function patchUpdates(_0x3ea05a){return function(_0x5edcd8){try{jsonpatch[_0x76aa('0x2f')](_0x5edcd8,_0x3ea05a,!![]);}catch(_0x5532c7){return BPromise[_0x76aa('0x30')](_0x5532c7);}return _0x5edcd8[_0x76aa('0x31')]();};}function saveUpdates(_0x458ac3,_0x38ecd1){return function(_0x35a705){if(_0x35a705){return _0x35a705['update'](_0x458ac3)[_0x76aa('0x1b')](function(_0x25a11f){return _0x25a11f;});}return null;};}function removeEntity(_0x5a0f72,_0x2ee338){return function(_0x58d860){if(_0x58d860){return _0x58d860[_0x76aa('0x32')]()['then'](function(){var _0x8479a3=_0x58d860['get']({'plain':!![]});var _0x58f135=_0x76aa('0x33');return db[_0x76aa('0x34')][_0x76aa('0x32')]({'where':{'type':_0x58f135,'resourceId':_0x8479a3['id']}})[_0x76aa('0x1b')](function(){return _0x58d860;});})['then'](function(){_0x5a0f72['status'](0xcc)[_0x76aa('0x27')]();});}};}function handleEntityNotFound(_0x1c7b6f,_0x58127c){return function(_0x23e2fd){if(!_0x23e2fd){_0x1c7b6f[_0x76aa('0x25')](0x194);}return _0x23e2fd;};}function handleError(_0x5b57d8,_0x9ce5f4){_0x9ce5f4=_0x9ce5f4||0x1f4;return function(_0x5c77f1){logger['error'](_0x5c77f1[_0x76aa('0x35')]);if(_0x5c77f1[_0x76aa('0x36')]){delete _0x5c77f1[_0x76aa('0x36')];}_0x5b57d8[_0x76aa('0x26')](_0x9ce5f4)['send'](_0x5c77f1);};}exports[_0x76aa('0x37')]=function(_0x1c22f7,_0x2eea79){var _0x4e131a={},_0x113770={},_0x1638db={'count':0x0,'rows':[]};var _0x2f7726=_[_0x76aa('0x38')](db[_0x76aa('0x39')][_0x76aa('0x3a')],function(_0x878903){return{'name':_0x878903[_0x76aa('0x3b')],'type':_0x878903[_0x76aa('0x3c')]['key']};});_0x113770[_0x76aa('0x3d')]=_[_0x76aa('0x38')](_0x2f7726,_0x76aa('0x36'));_0x113770[_0x76aa('0x3e')]=_[_0x76aa('0x3f')](_0x1c22f7[_0x76aa('0x3e')]);_0x113770['filters']=_['intersection'](_0x113770[_0x76aa('0x3d')],_0x113770[_0x76aa('0x3e')]);_0x4e131a[_0x76aa('0x40')]=_[_0x76aa('0x41')](_0x113770['model'],qs[_0x76aa('0x42')](_0x1c22f7[_0x76aa('0x3e')][_0x76aa('0x42')]));_0x4e131a[_0x76aa('0x40')]=_0x4e131a[_0x76aa('0x40')]['length']?_0x4e131a[_0x76aa('0x40')]:_0x113770['model'];if(!_0x1c22f7[_0x76aa('0x3e')]['hasOwnProperty']('nolimit')){_0x4e131a['limit']=qs[_0x76aa('0x2b')](_0x1c22f7['query']['limit']);_0x4e131a['offset']=qs[_0x76aa('0x29')](_0x1c22f7[_0x76aa('0x3e')][_0x76aa('0x29')]);}_0x4e131a[_0x76aa('0x43')]=qs[_0x76aa('0x44')](_0x1c22f7['query'][_0x76aa('0x44')]);_0x4e131a[_0x76aa('0x45')]=qs[_0x76aa('0x46')](_[_0x76aa('0x47')](_0x1c22f7[_0x76aa('0x3e')],_0x113770['filters']),_0x2f7726);if(_0x1c22f7[_0x76aa('0x3e')][_0x76aa('0x48')]){_0x4e131a['where']=_[_0x76aa('0x49')](_0x4e131a['where'],{'$or':_[_0x76aa('0x38')](_0x2f7726,function(_0x24ea05){if(_0x24ea05[_0x76aa('0x3c')]!==_0x76aa('0x4a')){var _0x2d0bc4={};_0x2d0bc4[_0x24ea05[_0x76aa('0x36')]]={'$like':'%'+_0x1c22f7[_0x76aa('0x3e')][_0x76aa('0x48')]+'%'};return _0x2d0bc4;}})});}_0x4e131a=_[_0x76aa('0x49')]({},_0x4e131a,_0x1c22f7[_0x76aa('0x4b')]);var _0x5e4967={'where':_0x4e131a[_0x76aa('0x45')]};return db['Trunk'][_0x76aa('0x2c')](_0x5e4967)[_0x76aa('0x1b')](function(_0x5e95f5){_0x1638db[_0x76aa('0x2c')]=_0x5e95f5;if(_0x1c22f7['query']['includeAll']){_0x4e131a[_0x76aa('0x4c')]=[{'all':!![]}];}return db['Trunk'][_0x76aa('0x4d')](_0x4e131a);})[_0x76aa('0x1b')](function(_0x4315b3){_0x1638db[_0x76aa('0x4e')]=_0x4315b3;return _0x1638db;})[_0x76aa('0x1b')](respondWithFilteredResult(_0x2eea79,_0x4e131a))[_0x76aa('0x24')](handleError(_0x2eea79,null));};exports['show']=function(_0x564546,_0x2fcf8f){var _0x1eafb2={'raw':![],'where':{'id':_0x564546[_0x76aa('0x4f')]['id']}},_0x1708d4={};_0x1708d4[_0x76aa('0x3d')]=_[_0x76aa('0x3f')](db['Trunk'][_0x76aa('0x3a')]);_0x1708d4[_0x76aa('0x3e')]=_[_0x76aa('0x3f')](_0x564546['query']);_0x1708d4[_0x76aa('0x46')]=_['intersection'](_0x1708d4[_0x76aa('0x3d')],_0x1708d4['query']);_0x1eafb2[_0x76aa('0x40')]=_[_0x76aa('0x41')](_0x1708d4[_0x76aa('0x3d')],qs[_0x76aa('0x42')](_0x564546[_0x76aa('0x3e')][_0x76aa('0x42')]));_0x1eafb2[_0x76aa('0x40')]=_0x1eafb2['attributes'][_0x76aa('0x50')]?_0x1eafb2['attributes']:_0x1708d4[_0x76aa('0x3d')];if(_0x564546[_0x76aa('0x3e')][_0x76aa('0x51')]){_0x1eafb2[_0x76aa('0x4c')]=[{'all':!![]}];}_0x1eafb2=_[_0x76aa('0x49')]({},_0x1eafb2,_0x564546[_0x76aa('0x4b')]);return db[_0x76aa('0x39')]['find'](_0x1eafb2)[_0x76aa('0x1b')](handleEntityNotFound(_0x2fcf8f,null))[_0x76aa('0x1b')](respondWithResult(_0x2fcf8f,null))[_0x76aa('0x24')](handleError(_0x2fcf8f,null));};exports[_0x76aa('0x52')]=function(_0x5c742c,_0xb9401b){var _0x163440={'where':{'id':_0x5c742c[_0x76aa('0x4f')]['id']}},_0x8dc601={};_0x8dc601[_0x76aa('0x3d')]=_[_0x76aa('0x3f')](db['Trunk'][_0x76aa('0x3a')]);_0x163440[_0x76aa('0x40')]=_[_0x76aa('0x41')](_0x8dc601[_0x76aa('0x3d')],qs[_0x76aa('0x42')](_0x5c742c[_0x76aa('0x3e')][_0x76aa('0x42')]));_0x163440['attributes']=_0x163440['attributes'][_0x76aa('0x50')]?_0x163440[_0x76aa('0x40')]:_0x8dc601['model'];if(_0x5c742c[_0x76aa('0x3e')][_0x76aa('0x51')]){_0x163440['include']=[{'all':!![]}];}_0x163440=_[_0x76aa('0x49')]({},_0x163440,_0x5c742c[_0x76aa('0x4b')]);return db[_0x76aa('0x39')][_0x76aa('0x53')](_0x163440)[_0x76aa('0x1b')](handleEntityNotFound(_0xb9401b,null))[_0x76aa('0x1b')](function(_0x3376ec){if(_0x3376ec){var _0x30573a=_0x3376ec[_0x76aa('0x54')]({'plain':!![]});_0x30573a=qs['omit'](_0x30573a,['id',_0x76aa('0x55'),'updatedAt']);_0x5c742c[_0x76aa('0x56')]=_[_0x76aa('0x57')](_0x5c742c[_0x76aa('0x56')],['id',_0x76aa('0x55'),_0x76aa('0x58')]);return db[_0x76aa('0x39')][_0x76aa('0x59')](_[_0x76aa('0x49')](_0x30573a,_0x5c742c[_0x76aa('0x56')]),{'include':_0x5c742c['query'][_0x76aa('0x51')]?[{'all':!![]}]:undefined})[_0x76aa('0x1b')](function(_0x5c542b){var _0xe5957d=_0x5c742c[_0x76aa('0x5a')][_0x76aa('0x54')]({'plain':!![]});if(!_0xe5957d)throw new Error(_0x76aa('0x5b'));if(_0xe5957d[_0x76aa('0x5c')]==='user'){var _0x364d05=_0x5c542b['get']({'plain':!![]});var _0x35bd2b=_0x76aa('0x33');return db[_0x76aa('0x5d')][_0x76aa('0x53')]({'where':{'name':_0x35bd2b,'userProfileId':_0xe5957d[_0x76aa('0x5e')]},'raw':!![]})[_0x76aa('0x1b')](function(_0x2bfb46){if(_0x2bfb46&&_0x2bfb46['autoAssociation']===0x0){return db[_0x76aa('0x34')][_0x76aa('0x59')]({'name':_0x364d05['name'],'resourceId':_0x364d05['id'],'type':_0x2bfb46['name'],'sectionId':_0x2bfb46['id']},{})[_0x76aa('0x1b')](function(){return _0x5c542b;});}else{return _0x5c542b;}})[_0x76aa('0x24')](function(_0x5295a7){logger[_0x76aa('0x20')](_0x76aa('0x5f'),_0x5295a7);throw _0x5295a7;});}return _0x5c542b;});}})[_0x76aa('0x1b')](respondWithResult(_0xb9401b,0xc9))['catch'](handleError(_0xb9401b,null));};exports[_0x76aa('0x59')]=function(_0x47f733,_0xf31e1f,_0x1178e5){var _0x2315cf;return db[_0x76aa('0x39')]['create'](_0x47f733['body'],{'raw':!![]})[_0x76aa('0x1b')](function(_0x4dfeb3){_0x2315cf=_0x4dfeb3;return db[_0x76aa('0x39')][_0x76aa('0x4d')]({'raw':!![]});})[_0x76aa('0x1b')](function(_0x43a2af){var _0x2dd320=fs[_0x76aa('0x60')](path[_0x76aa('0x61')](config[_0x76aa('0x62')],_0x76aa('0x63')),'utf8');var _0x7d02e7=fs[_0x76aa('0x60')](path[_0x76aa('0x61')](config[_0x76aa('0x62')],'server/files/templates/registry.ejs'),'utf8');var _0x557c11=ejs[_0x76aa('0x64')](_0x2dd320,{'trunks':_0x43a2af||[]});fs['writeFileSync'](_0x76aa('0x65'),_0x557c11);if(_0x2315cf[_0x76aa('0x66')]){var _0x38faff=ejs[_0x76aa('0x64')](_0x7d02e7,{'trunks':_0x43a2af||[]});fs['writeFileSync'](_0x76aa('0x67'),_0x38faff);}})['then'](function(){return respondWithRpcPromise(_0x76aa('0x68'),_0x76aa('0x59'),{'module':_0x76aa('0x69')});})[_0x76aa('0x1b')](function(){var _0x1037fb=_0x47f733['user'][_0x76aa('0x54')]({'plain':!![]});if(!_0x1037fb)throw new Error(_0x76aa('0x5b'));if(_0x1037fb[_0x76aa('0x5c')]===_0x76aa('0x5a')){var _0x32c1de=_0x2315cf[_0x76aa('0x54')]({'plain':!![]});return db[_0x76aa('0x5d')][_0x76aa('0x53')]({'where':{'name':'Trunks','userProfileId':_0x1037fb[_0x76aa('0x5e')]},'raw':!![]})[_0x76aa('0x1b')](function(_0x48136a){if(_0x48136a&&_0x48136a[_0x76aa('0x6a')]===0x0){return db[_0x76aa('0x34')][_0x76aa('0x59')]({'name':_0x32c1de[_0x76aa('0x36')],'resourceId':_0x32c1de['id'],'type':_0x48136a[_0x76aa('0x36')],'sectionId':_0x48136a['id']},{})[_0x76aa('0x1b')](function(){return _0x2315cf;});}else{return _0x2315cf;}})[_0x76aa('0x24')](function(_0x5dc923){logger[_0x76aa('0x20')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x5dc923);throw _0x5dc923;});}return _0x2315cf;})['then'](respondWithResult(_0xf31e1f,0xc9))[_0x76aa('0x24')](handleError(_0xf31e1f,null));};exports[_0x76aa('0x6b')]=function(_0x5d8947,_0x5d1de1,_0x36da4d){var _0x14b5a2;return db[_0x76aa('0x39')]['find']({'where':{'id':_0x5d8947['params']['id']}})[_0x76aa('0x1b')](handleEntityNotFound(_0x5d1de1,null))[_0x76aa('0x1b')](saveUpdates(_0x5d8947[_0x76aa('0x56')],null))['then'](function(_0xb70589){if(_0xb70589){_0x14b5a2=_0xb70589;return db['Trunk'][_0x76aa('0x4d')]({'raw':!![]});}})[_0x76aa('0x1b')](function(_0x383290){if(_0x383290){var _0x325ffa=fs[_0x76aa('0x60')](path['join'](config['root'],_0x76aa('0x63')),_0x76aa('0x6c'));var _0x19ebb7=fs['readFileSync'](path[_0x76aa('0x61')](config[_0x76aa('0x62')],_0x76aa('0x6d')),_0x76aa('0x6c'));var _0x303b78=ejs['render'](_0x325ffa,{'trunks':_0x383290||[]});fs[_0x76aa('0x6e')]('/etc/asterisk/sip_xcally_trunks.conf',_0x303b78);var _0x213f7f=ejs[_0x76aa('0x64')](_0x19ebb7,{'trunks':_0x383290||[]});fs[_0x76aa('0x6e')](_0x76aa('0x67'),_0x213f7f);return respondWithRpcPromise(_0x76aa('0x68'),_0x76aa('0x6b'),{'module':'chan_sip.so'});}return null;})['then'](function(_0x547411){if(_0x547411){return _0x14b5a2;}})['then'](respondWithResult(_0x5d1de1,null))['catch'](handleError(_0x5d1de1,null));};exports[_0x76aa('0x32')]=function(_0x22f44f,_0x52c5be,_0x5c2c91){var _0x4f01e9;return db[_0x76aa('0x39')][_0x76aa('0x53')]({'where':{'id':_0x22f44f[_0x76aa('0x4f')]['id']}})['then'](handleEntityNotFound(_0x52c5be,null))['then'](removeEntity(_0x52c5be,null))[_0x76aa('0x1b')](function(){return db[_0x76aa('0x39')][_0x76aa('0x4d')]({'raw':!![]});})[_0x76aa('0x1b')](function(_0x354c7b){var _0x55e526=fs['readFileSync'](path[_0x76aa('0x61')](config['root'],'server/files/templates/trunk.ejs'),'utf8');var _0x4673e6=fs[_0x76aa('0x60')](path['join'](config[_0x76aa('0x62')],_0x76aa('0x6d')),'utf8');var _0x22063f=ejs[_0x76aa('0x64')](_0x55e526,{'trunks':_0x354c7b});var _0x11d91f=ejs[_0x76aa('0x64')](_0x4673e6,{'trunks':_0x354c7b});fs[_0x76aa('0x6e')](_0x76aa('0x65'),_0x22063f);fs[_0x76aa('0x6e')](_0x76aa('0x67'),_0x11d91f);return respondWithRpcPromise(_0x76aa('0x68'),'destroy',{'module':_0x76aa('0x69')});})[_0x76aa('0x24')](handleError(_0x52c5be,null));}; \ No newline at end of file +var _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(_0x3a9eae,_0x1e859){var _0x3cbe46=function(_0x159ec6){while(--_0x159ec6){_0x3a9eae['push'](_0x3a9eae['shift']());}};_0x3cbe46(++_0x1e859);}(_0x98a8,0x12c));var _0x898a=function(_0x1d6245,_0x127d62){_0x1d6245=_0x1d6245-0x0;var _0x5d33b4=_0x98a8[_0x1d6245];return _0x5d33b4;};'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 4007482..bc7dbda 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 _0xdfbb=['request-promise','path','rimraf','../../config/environment','./trunk.attributes','exports','define','Trunk','tools_trunks','lodash','../../config/logger','api','moment','bluebird'];(function(_0x4a7f17,_0x4106a4){var _0x59e8d9=function(_0x4adfa1){while(--_0x4adfa1){_0x4a7f17['push'](_0x4a7f17['shift']());}};_0x59e8d9(++_0x4106a4);}(_0xdfbb,0xe9));var _0xbdfb=function(_0x4b2526,_0x28ae5b){_0x4b2526=_0x4b2526-0x0;var _0x9e2e7c=_0xdfbb[_0x4b2526];return _0x9e2e7c;};'use strict';var _=require(_0xbdfb('0x0'));var util=require('util');var logger=require(_0xbdfb('0x1'))(_0xbdfb('0x2'));var moment=require(_0xbdfb('0x3'));var BPromise=require(_0xbdfb('0x4'));var rp=require(_0xbdfb('0x5'));var fs=require('fs');var path=require(_0xbdfb('0x6'));var rimraf=require(_0xbdfb('0x7'));var config=require(_0xbdfb('0x8'));var attributes=require(_0xbdfb('0x9'));module[_0xbdfb('0xa')]=function(_0x4f0f00,_0x5b86fe){return _0x4f0f00[_0xbdfb('0xb')](_0xbdfb('0xc'),attributes,{'tableName':_0xbdfb('0xd'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xba43=['../../config/logger','moment','bluebird','request-promise','rimraf','../../config/environment','./trunk.attributes','exports','define','Trunk','tools_trunks','util'];(function(_0x5b25b6,_0x184cce){var _0x4e8b25=function(_0x4624cf){while(--_0x4624cf){_0x5b25b6['push'](_0x5b25b6['shift']());}};_0x4e8b25(++_0x184cce);}(_0xba43,0x12b));var _0x3ba4=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xba43[_0x3dd15e];return _0x231fd0;};'use strict';var _=require('lodash');var util=require(_0x3ba4('0x0'));var logger=require(_0x3ba4('0x1'))('api');var moment=require(_0x3ba4('0x2'));var BPromise=require(_0x3ba4('0x3'));var rp=require(_0x3ba4('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0x3ba4('0x5'));var config=require(_0x3ba4('0x6'));var attributes=require(_0x3ba4('0x7'));module[_0x3ba4('0x8')]=function(_0x22ebf0,_0x3efb7c){return _0x22ebf0[_0x3ba4('0x9')](_0x3ba4('0xa'),attributes,{'tableName':_0x3ba4('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 3ac54c4..cc3184f 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 _0x6da6=['limit','map','include','model','ShowTrunk','find','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','client','http','request','then','info','Trunk,\x20%s,\x20%s','request\x20sent','debug','Trunk,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','GetTrunk','Trunk','findAll','options','raw','where','attributes'];(function(_0x258b93,_0x188ccc){var _0x35484b=function(_0x2563ea){while(--_0x2563ea){_0x258b93['push'](_0x258b93['shift']());}};_0x35484b(++_0x188ccc);}(_0x6da6,0x9a));var _0x66da=function(_0x22850f,_0x4a0371){_0x22850f=_0x22850f-0x0;var _0x4f6117=_0x6da6[_0x22850f];return _0x4f6117;};'use strict';var _=require(_0x66da('0x0'));var util=require(_0x66da('0x1'));var moment=require(_0x66da('0x2'));var BPromise=require('bluebird');var rs=require(_0x66da('0x3'));var fs=require('fs');var Redis=require(_0x66da('0x4'));var db=require(_0x66da('0x5'))['db'];var utils=require(_0x66da('0x6'));var logger=require('../../config/logger')(_0x66da('0x7'));var config=require(_0x66da('0x8'));var jayson=require('jayson/promise');var client=jayson[_0x66da('0x9')][_0x66da('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x3892d4,_0x142650,_0x378aa4){return new BPromise(function(_0x55fc5f,_0x51e4cc){return client[_0x66da('0xb')](_0x3892d4,_0x378aa4)[_0x66da('0xc')](function(_0x48dc14){logger[_0x66da('0xd')](_0x66da('0xe'),_0x142650,_0x66da('0xf'));logger[_0x66da('0x10')](_0x66da('0x11'),_0x142650,_0x66da('0xf'),JSON[_0x66da('0x12')](_0x48dc14));if(_0x48dc14['error']){if(_0x48dc14[_0x66da('0x13')][_0x66da('0x14')]===0x1f4){logger[_0x66da('0x13')](_0x66da('0xe'),_0x142650,_0x48dc14['error'][_0x66da('0x15')]);return _0x51e4cc(_0x48dc14[_0x66da('0x13')]['message']);}logger[_0x66da('0x13')]('Trunk,\x20%s,\x20%s',_0x142650,_0x48dc14[_0x66da('0x13')][_0x66da('0x15')]);return _0x55fc5f(_0x48dc14[_0x66da('0x13')]['message']);}else{logger[_0x66da('0xd')]('Trunk,\x20%s,\x20%s',_0x142650,'request\x20sent');_0x55fc5f(_0x48dc14[_0x66da('0x16')][_0x66da('0x15')]);}})[_0x66da('0x17')](function(_0x3b3cb9){logger[_0x66da('0x13')](_0x66da('0xe'),_0x142650,_0x3b3cb9);_0x51e4cc(_0x3b3cb9);});});}exports[_0x66da('0x18')]=function(_0x1faeca){var _0x23a4bb=this;return new Promise(function(_0x521383,_0x267c93){return db[_0x66da('0x19')][_0x66da('0x1a')]({'raw':_0x1faeca['options']?_0x1faeca[_0x66da('0x1b')][_0x66da('0x1c')]===undefined?!![]:![]:!![],'where':_0x1faeca[_0x66da('0x1b')]?_0x1faeca[_0x66da('0x1b')][_0x66da('0x1d')]||null:null,'attributes':_0x1faeca['options']?_0x1faeca[_0x66da('0x1b')][_0x66da('0x1e')]||null:null,'limit':_0x1faeca[_0x66da('0x1b')]?_0x1faeca[_0x66da('0x1b')][_0x66da('0x1f')]||null:null,'include':_0x1faeca[_0x66da('0x1b')]?_0x1faeca['options']['include']?_[_0x66da('0x20')](_0x1faeca[_0x66da('0x1b')][_0x66da('0x21')],function(_0x40a380){return{'model':db[_0x40a380[_0x66da('0x22')]],'as':_0x40a380['as'],'attributes':_0x40a380[_0x66da('0x1e')],'include':_0x40a380[_0x66da('0x21')]?_[_0x66da('0x20')](_0x40a380['include'],function(_0x32f639){return{'model':db[_0x32f639[_0x66da('0x22')]],'as':_0x32f639['as'],'attributes':_0x32f639[_0x66da('0x1e')],'include':_0x32f639[_0x66da('0x21')]?_[_0x66da('0x20')](_0x32f639[_0x66da('0x21')],function(_0x310e98){return{'model':db[_0x310e98[_0x66da('0x22')]],'as':_0x310e98['as'],'attributes':_0x310e98[_0x66da('0x1e')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x493bc8){logger['info'](_0x66da('0x18'),_0x1faeca);logger[_0x66da('0x10')](_0x66da('0x18'),_0x1faeca,JSON['stringify'](_0x493bc8));_0x521383(_0x493bc8);})['catch'](function(_0x5ba9cf){logger['error']('GetTrunk',_0x5ba9cf[_0x66da('0x15')],_0x1faeca);_0x267c93(_0x23a4bb[_0x66da('0x13')](0x1f4,_0x5ba9cf[_0x66da('0x15')]));});});};exports[_0x66da('0x23')]=function(_0x2a3915){var _0x9bfc5b=this;return new Promise(function(_0x2179ab,_0x3a3976){return db[_0x66da('0x19')][_0x66da('0x24')]({'raw':_0x2a3915[_0x66da('0x1b')]?_0x2a3915['options'][_0x66da('0x1c')]===undefined?!![]:![]:!![],'where':_0x2a3915[_0x66da('0x1b')]?_0x2a3915[_0x66da('0x1b')][_0x66da('0x1d')]||null:null,'attributes':_0x2a3915['options']?_0x2a3915[_0x66da('0x1b')][_0x66da('0x1e')]||null:null,'include':_0x2a3915['options']?_0x2a3915[_0x66da('0x1b')][_0x66da('0x21')]?_[_0x66da('0x20')](_0x2a3915['options'][_0x66da('0x21')],function(_0x2585ab){return{'model':db[_0x2585ab['model']],'as':_0x2585ab['as'],'attributes':_0x2585ab['attributes'],'include':_0x2585ab[_0x66da('0x21')]?_[_0x66da('0x20')](_0x2585ab[_0x66da('0x21')],function(_0x1f19c7){return{'model':db[_0x1f19c7['model']],'as':_0x1f19c7['as'],'attributes':_0x1f19c7['attributes'],'include':_0x1f19c7[_0x66da('0x21')]?_[_0x66da('0x20')](_0x1f19c7[_0x66da('0x21')],function(_0x91d7b3){return{'model':db[_0x91d7b3[_0x66da('0x22')]],'as':_0x91d7b3['as'],'attributes':_0x91d7b3[_0x66da('0x1e')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x5d3f0d){logger['info'](_0x66da('0x23'),_0x2a3915);logger['debug'](_0x66da('0x23'),_0x2a3915,JSON['stringify'](_0x5d3f0d));_0x2179ab(_0x5d3f0d);})[_0x66da('0x17')](function(_0x42dae0){logger['error'](_0x66da('0x23'),_0x42dae0[_0x66da('0x15')],_0x2a3915);_0x3a3976(_0x9bfc5b[_0x66da('0x13')](0x1f4,_0x42dae0[_0x66da('0x15')]));});});}; \ No newline at end of file +var _0xf453=['ioredis','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','request','Trunk,\x20%s,\x20%s','request\x20sent','debug','error','code','message','info','result','Trunk','findAll','options','raw','where','limit','include','map','model','attributes','then','GetTrunk','stringify','ShowTrunk','lodash','util','randomstring'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0xf453,0x7d));var _0x3f45=function(_0x218c83,_0x5dcd1d){_0x218c83=_0x218c83-0x0;var _0x53e121=_0xf453[_0x218c83];return _0x53e121;};'use strict';var _=require(_0x3f45('0x0'));var util=require(_0x3f45('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0x3f45('0x2'));var fs=require('fs');var Redis=require(_0x3f45('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x3f45('0x4'));var logger=require(_0x3f45('0x5'))('rpc');var config=require(_0x3f45('0x6'));var jayson=require(_0x3f45('0x7'));var client=jayson[_0x3f45('0x8')]['http']({'port':0x232a});function respondWithRpcPromise(_0x379d5a,_0x15321a,_0x9818e5){return new BPromise(function(_0x56b094,_0x3dbe26){return client[_0x3f45('0x9')](_0x379d5a,_0x9818e5)['then'](function(_0x34b279){logger['info'](_0x3f45('0xa'),_0x15321a,_0x3f45('0xb'));logger[_0x3f45('0xc')]('Trunk,\x20%s,\x20%s,\x20%s',_0x15321a,_0x3f45('0xb'),JSON['stringify'](_0x34b279));if(_0x34b279[_0x3f45('0xd')]){if(_0x34b279['error'][_0x3f45('0xe')]===0x1f4){logger[_0x3f45('0xd')](_0x3f45('0xa'),_0x15321a,_0x34b279[_0x3f45('0xd')][_0x3f45('0xf')]);return _0x3dbe26(_0x34b279[_0x3f45('0xd')][_0x3f45('0xf')]);}logger['error'](_0x3f45('0xa'),_0x15321a,_0x34b279[_0x3f45('0xd')][_0x3f45('0xf')]);return _0x56b094(_0x34b279['error']['message']);}else{logger[_0x3f45('0x10')](_0x3f45('0xa'),_0x15321a,_0x3f45('0xb'));_0x56b094(_0x34b279[_0x3f45('0x11')][_0x3f45('0xf')]);}})['catch'](function(_0x5b2e68){logger[_0x3f45('0xd')](_0x3f45('0xa'),_0x15321a,_0x5b2e68);_0x3dbe26(_0x5b2e68);});});}exports['GetTrunk']=function(_0x34f1cd){var _0x3a5b09=this;return new Promise(function(_0x27d8e2,_0x2f9231){return db[_0x3f45('0x12')][_0x3f45('0x13')]({'raw':_0x34f1cd[_0x3f45('0x14')]?_0x34f1cd['options'][_0x3f45('0x15')]===undefined?!![]:![]:!![],'where':_0x34f1cd[_0x3f45('0x14')]?_0x34f1cd[_0x3f45('0x14')][_0x3f45('0x16')]||null:null,'attributes':_0x34f1cd[_0x3f45('0x14')]?_0x34f1cd['options']['attributes']||null:null,'limit':_0x34f1cd[_0x3f45('0x14')]?_0x34f1cd[_0x3f45('0x14')][_0x3f45('0x17')]||null:null,'include':_0x34f1cd[_0x3f45('0x14')]?_0x34f1cd['options'][_0x3f45('0x18')]?_[_0x3f45('0x19')](_0x34f1cd[_0x3f45('0x14')]['include'],function(_0x2a29a9){return{'model':db[_0x2a29a9[_0x3f45('0x1a')]],'as':_0x2a29a9['as'],'attributes':_0x2a29a9[_0x3f45('0x1b')],'include':_0x2a29a9[_0x3f45('0x18')]?_[_0x3f45('0x19')](_0x2a29a9[_0x3f45('0x18')],function(_0xeb6d06){return{'model':db[_0xeb6d06['model']],'as':_0xeb6d06['as'],'attributes':_0xeb6d06[_0x3f45('0x1b')],'include':_0xeb6d06[_0x3f45('0x18')]?_['map'](_0xeb6d06[_0x3f45('0x18')],function(_0xd7f5e1){return{'model':db[_0xd7f5e1['model']],'as':_0xd7f5e1['as'],'attributes':_0xd7f5e1[_0x3f45('0x1b')]};}):[]};}):[]};}):[]:[]})[_0x3f45('0x1c')](function(_0x407b05){logger[_0x3f45('0x10')](_0x3f45('0x1d'),_0x34f1cd);logger[_0x3f45('0xc')]('GetTrunk',_0x34f1cd,JSON[_0x3f45('0x1e')](_0x407b05));_0x27d8e2(_0x407b05);})['catch'](function(_0x179a1b){logger[_0x3f45('0xd')]('GetTrunk',_0x179a1b[_0x3f45('0xf')],_0x34f1cd);_0x2f9231(_0x3a5b09[_0x3f45('0xd')](0x1f4,_0x179a1b['message']));});});};exports['ShowTrunk']=function(_0x5e97c4){var _0x495d06=this;return new Promise(function(_0x4ef815,_0x3b4297){return db[_0x3f45('0x12')]['find']({'raw':_0x5e97c4[_0x3f45('0x14')]?_0x5e97c4[_0x3f45('0x14')][_0x3f45('0x15')]===undefined?!![]:![]:!![],'where':_0x5e97c4[_0x3f45('0x14')]?_0x5e97c4[_0x3f45('0x14')][_0x3f45('0x16')]||null:null,'attributes':_0x5e97c4['options']?_0x5e97c4['options'][_0x3f45('0x1b')]||null:null,'include':_0x5e97c4['options']?_0x5e97c4[_0x3f45('0x14')][_0x3f45('0x18')]?_[_0x3f45('0x19')](_0x5e97c4[_0x3f45('0x14')][_0x3f45('0x18')],function(_0x632642){return{'model':db[_0x632642[_0x3f45('0x1a')]],'as':_0x632642['as'],'attributes':_0x632642[_0x3f45('0x1b')],'include':_0x632642[_0x3f45('0x18')]?_[_0x3f45('0x19')](_0x632642[_0x3f45('0x18')],function(_0x39a031){return{'model':db[_0x39a031[_0x3f45('0x1a')]],'as':_0x39a031['as'],'attributes':_0x39a031[_0x3f45('0x1b')],'include':_0x39a031[_0x3f45('0x18')]?_[_0x3f45('0x19')](_0x39a031[_0x3f45('0x18')],function(_0x5425fe){return{'model':db[_0x5425fe[_0x3f45('0x1a')]],'as':_0x5425fe['as'],'attributes':_0x5425fe[_0x3f45('0x1b')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x416888){logger[_0x3f45('0x10')](_0x3f45('0x1f'),_0x5e97c4);logger[_0x3f45('0xc')]('ShowTrunk',_0x5e97c4,JSON[_0x3f45('0x1e')](_0x416888));_0x4ef815(_0x416888);})['catch'](function(_0x676b64){logger[_0x3f45('0xd')](_0x3f45('0x1f'),_0x676b64[_0x3f45('0xf')],_0x5e97c4);_0x3b4297(_0x495d06['error'](0x1f4,_0x676b64[_0x3f45('0xf')]));});});}; \ No newline at end of file diff --git a/server/api/user-setting/index.js b/server/api/user-setting/index.js index 3be1b89..befdde9 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 _0x81f2=['exports','Router','../../components/auth/service','./user-setting.controller','put','/:id','isAuthenticated','update'];(function(_0x1922e5,_0x32eac8){var _0x2e5c5c=function(_0xbc19cc){while(--_0xbc19cc){_0x1922e5['push'](_0x1922e5['shift']());}};_0x2e5c5c(++_0x32eac8);}(_0x81f2,0x1a9));var _0x281f=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x81f2[_0x3dd15e];return _0x231fd0;};'use strict';var express=require('express');var router=express[_0x281f('0x0')]();var auth=require(_0x281f('0x1'));var controller=require(_0x281f('0x2'));router[_0x281f('0x3')](_0x281f('0x4'),auth[_0x281f('0x5')](),controller[_0x281f('0x6')]);module[_0x281f('0x7')]=router; \ No newline at end of file +var _0x2b7b=['exports','Router','../../components/auth/service','./user-setting.controller'];(function(_0x466a17,_0x35b630){var _0x50538c=function(_0x4b0d71){while(--_0x4b0d71){_0x466a17['push'](_0x466a17['shift']());}};_0x50538c(++_0x35b630);}(_0x2b7b,0xe1));var _0xb2b7=function(_0x1d9aa0,_0x272488){_0x1d9aa0=_0x1d9aa0-0x0;var _0x226868=_0x2b7b[_0x1d9aa0];return _0x226868;};'use strict';var express=require('express');var router=express[_0xb2b7('0x0')]();var auth=require(_0xb2b7('0x1'));var controller=require(_0xb2b7('0x2'));router['put']('/:id',auth['isAuthenticated'](),controller['update']);module[_0xb2b7('0x3')]=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 a6371c1..9fe6d79 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 _0x3951=['error','warning','debug','exports','BOOLEAN','TEXT','DATE','UserId','sequelize'];(function(_0x4f52fa,_0x522609){var _0x24eb4a=function(_0x362bcf){while(--_0x362bcf){_0x4f52fa['push'](_0x4f52fa['shift']());}};_0x24eb4a(++_0x522609);}(_0x3951,0x1ca));var _0x1395=function(_0x336afa,_0x3ff400){_0x336afa=_0x336afa-0x0;var _0x4efbf5=_0x3951[_0x336afa];return _0x4efbf5;};'use strict';var Sequelize=require(_0x1395('0x0'));const CLIENT_SIDE_LOG_LEVELS=[_0x1395('0x1'),_0x1395('0x2'),'info',_0x1395('0x3')];module[_0x1395('0x4')]={'clientSideLoggingLevel':{'type':Sequelize['ENUM'](CLIENT_SIDE_LOG_LEVELS),'allowNull':![],'defaultValue':'error','validate':{'isIn':[CLIENT_SIDE_LOG_LEVELS]}},'clientSideLoggingEnabled':{'type':Sequelize[_0x1395('0x5')],'defaultValue':![]},'clientSideLoggingScopes':{'type':Sequelize[_0x1395('0x6')],'allowNull':!![]},'clientSideLoggingEnabledSince':{'type':Sequelize[_0x1395('0x7')],'allowNull':!![],'defaultValue':null},'UserId':{'type':Sequelize['INTEGER'],'unique':_0x1395('0x8')}}; \ No newline at end of file +var _0x8208=['sequelize','error','warning','debug','BOOLEAN','TEXT','DATE','INTEGER'];(function(_0x28d4fb,_0x21a70e){var _0x489581=function(_0x37ccb8){while(--_0x37ccb8){_0x28d4fb['push'](_0x28d4fb['shift']());}};_0x489581(++_0x21a70e);}(_0x8208,0xc0));var _0x8820=function(_0x36cf33,_0x32169f){_0x36cf33=_0x36cf33-0x0;var _0xf7f0c9=_0x8208[_0x36cf33];return _0xf7f0c9;};'use strict';var Sequelize=require(_0x8820('0x0'));const CLIENT_SIDE_LOG_LEVELS=[_0x8820('0x1'),_0x8820('0x2'),'info',_0x8820('0x3')];module['exports']={'clientSideLoggingLevel':{'type':Sequelize['ENUM'](CLIENT_SIDE_LOG_LEVELS),'allowNull':![],'defaultValue':_0x8820('0x1'),'validate':{'isIn':[CLIENT_SIDE_LOG_LEVELS]}},'clientSideLoggingEnabled':{'type':Sequelize[_0x8820('0x4')],'defaultValue':![]},'clientSideLoggingScopes':{'type':Sequelize[_0x8820('0x5')],'allowNull':!![]},'clientSideLoggingEnabledSince':{'type':Sequelize[_0x8820('0x6')],'allowNull':!![],'defaultValue':null},'UserId':{'type':Sequelize[_0x8820('0x7')],'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 17a34bb..7a14329 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 _0x225c=['status','json','then','sendStatus','error','name','update','Invalid\x20user\x20setting\x20id','UserSetting','find','lodash','ioredis','../../config/environment','socket.io-emitter','redis','./user-setting.socket','register','defaults'];(function(_0x134c2e,_0x3573c4){var _0x2825db=function(_0x2a574d){while(--_0x2a574d){_0x134c2e['push'](_0x134c2e['shift']());}};_0x2825db(++_0x3573c4);}(_0x225c,0x106));var _0xc225=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0x225c[_0x20a584];return _0x4b41a8;};'use strict';var _=require(_0xc225('0x0'));var Redis=require(_0xc225('0x1'));var logger=require('../../config/logger')('api');var config=require(_0xc225('0x2'));var db=require('../../mysqldb')['db'];var socket=require(_0xc225('0x3'))(new Redis(config[_0xc225('0x4')]));require(_0xc225('0x5'))[_0xc225('0x6')](socket);config[_0xc225('0x4')]=_[_0xc225('0x7')](config[_0xc225('0x4')],{'host':'localhost','port':0x18eb});function respondWithResult(_0x143eab,_0x249b43){_0x249b43=_0x249b43||0xc8;return function(_0x409c9f){if(_0x409c9f){return _0x143eab[_0xc225('0x8')](_0x249b43)[_0xc225('0x9')](_0x409c9f);}};}function saveUpdates(_0x4dc4ed){return function(_0x166add){if(_0x166add){return _0x166add['update'](_0x4dc4ed)[_0xc225('0xa')](function(_0x10f26b){return _0x10f26b;});}return null;};}function handleEntityNotFound(_0x238dbf){return function(_0x52727e){if(!_0x52727e){_0x238dbf[_0xc225('0xb')](0x194);}return _0x52727e;};}function handleError(_0x1f2f4f,_0x3ca94e){_0x3ca94e=_0x3ca94e||0x1f4;return function(_0x331018){logger[_0xc225('0xc')](_0x331018['stack']);if(_0x331018[_0xc225('0xd')]){delete _0x331018[_0xc225('0xd')];}_0x1f2f4f['status'](_0x3ca94e)['send'](_0x331018);};}exports[_0xc225('0xe')]=function(_0x3dc064,_0x2c53af){if(_0x3dc064['user']['role']!=='admin')throw new Error('Unauthorized');if(isNaN(Number(_0x3dc064['params']['id'])))throw new Error(_0xc225('0xf'));return db[_0xc225('0x10')][_0xc225('0x11')]({'where':{'id':_0x3dc064['params']['id']}})[_0xc225('0xa')](handleEntityNotFound(_0x2c53af,null))['then'](saveUpdates(_0x3dc064['body'],null))[_0xc225('0xa')](respondWithResult(_0x2c53af,null))['catch'](handleError(_0x2c53af,null));}; \ No newline at end of file +var _0x6364=['role','admin','Unauthorized','params','UserSetting','find','body','catch','../../config/logger','api','../../config/environment','../../mysqldb','socket.io-emitter','redis','./user-setting.socket','register','defaults','localhost','status','json','then','sendStatus','error','stack','name','send','update'];(function(_0x234ae1,_0x42bdd6){var _0x227ba0=function(_0x1f6531){while(--_0x1f6531){_0x234ae1['push'](_0x234ae1['shift']());}};_0x227ba0(++_0x42bdd6);}(_0x6364,0x8f));var _0x4636=function(_0x4204bb,_0xc130c3){_0x4204bb=_0x4204bb-0x0;var _0x46b908=_0x6364[_0x4204bb];return _0x46b908;};'use strict';var _=require('lodash');var Redis=require('ioredis');var logger=require(_0x4636('0x0'))(_0x4636('0x1'));var config=require(_0x4636('0x2'));var db=require(_0x4636('0x3'))['db'];var socket=require(_0x4636('0x4'))(new Redis(config[_0x4636('0x5')]));require(_0x4636('0x6'))[_0x4636('0x7')](socket);config['redis']=_[_0x4636('0x8')](config[_0x4636('0x5')],{'host':_0x4636('0x9'),'port':0x18eb});function respondWithResult(_0x185ea0,_0x17456d){_0x17456d=_0x17456d||0xc8;return function(_0x4e662e){if(_0x4e662e){return _0x185ea0[_0x4636('0xa')](_0x17456d)[_0x4636('0xb')](_0x4e662e);}};}function saveUpdates(_0x122d94){return function(_0x3e3f80){if(_0x3e3f80){return _0x3e3f80['update'](_0x122d94)[_0x4636('0xc')](function(_0x4747ac){return _0x4747ac;});}return null;};}function handleEntityNotFound(_0x31a3d2){return function(_0x348709){if(!_0x348709){_0x31a3d2[_0x4636('0xd')](0x194);}return _0x348709;};}function handleError(_0x48daa0,_0xcdf2bc){_0xcdf2bc=_0xcdf2bc||0x1f4;return function(_0x135761){logger[_0x4636('0xe')](_0x135761[_0x4636('0xf')]);if(_0x135761['name']){delete _0x135761[_0x4636('0x10')];}_0x48daa0[_0x4636('0xa')](_0xcdf2bc)[_0x4636('0x11')](_0x135761);};}exports[_0x4636('0x12')]=function(_0x16e836,_0x4e478d){if(_0x16e836['user'][_0x4636('0x13')]!==_0x4636('0x14'))throw new Error(_0x4636('0x15'));if(isNaN(Number(_0x16e836[_0x4636('0x16')]['id'])))throw new Error('Invalid\x20user\x20setting\x20id');return db[_0x4636('0x17')][_0x4636('0x18')]({'where':{'id':_0x16e836[_0x4636('0x16')]['id']}})[_0x4636('0xc')](handleEntityNotFound(_0x4e478d,null))[_0x4636('0xc')](saveUpdates(_0x16e836[_0x4636('0x19')],null))['then'](respondWithResult(_0x4e478d,null))[_0x4636('0x1a')](handleError(_0x4e478d,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 0680000..ec02d97 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 _0x1188=['events','../../mysqldb','UserSetting','setMaxListeners','remove','emit','hasOwnProperty','hook'];(function(_0xe6055a,_0x51b582){var _0x66d236=function(_0x376be2){while(--_0x376be2){_0xe6055a['push'](_0xe6055a['shift']());}};_0x66d236(++_0x51b582);}(_0x1188,0x198));var _0x8118=function(_0x107157,_0x5dd0fb){_0x107157=_0x107157-0x0;var _0x39c259=_0x1188[_0x107157];return _0x39c259;};'use strict';var EventEmitter=require(_0x8118('0x0'));var UserSetting=require(_0x8118('0x1'))['db'][_0x8118('0x2')];var UserSettingEvents=new EventEmitter();UserSettingEvents[_0x8118('0x3')](0x0);var events={'afterCreate':'save','afterUpdate':'update','afterDestroy':_0x8118('0x4')};function emitEvent(_0x5420da){return function(_0x52c588,_0x25f340,_0x29438c){UserSettingEvents[_0x8118('0x5')](_0x5420da+':'+_0x52c588['id'],_0x52c588);UserSettingEvents['emit'](_0x5420da,_0x52c588);_0x29438c(null);};}for(var e in events){if(events[_0x8118('0x6')](e)){var event=events[e];UserSetting[_0x8118('0x7')](e,emitEvent(event));}}module['exports']=UserSettingEvents; \ No newline at end of file +var _0xe38d=['../../mysqldb','UserSetting','setMaxListeners','update','remove','emit','hasOwnProperty','hook','exports','events'];(function(_0x20d54d,_0x1adc8e){var _0x516e8b=function(_0x2754e1){while(--_0x2754e1){_0x20d54d['push'](_0x20d54d['shift']());}};_0x516e8b(++_0x1adc8e);}(_0xe38d,0xd1));var _0xde38=function(_0x48e7cd,_0x29a41b){_0x48e7cd=_0x48e7cd-0x0;var _0x18464e=_0xe38d[_0x48e7cd];return _0x18464e;};'use strict';var EventEmitter=require(_0xde38('0x0'));var UserSetting=require(_0xde38('0x1'))['db'][_0xde38('0x2')];var UserSettingEvents=new EventEmitter();UserSettingEvents[_0xde38('0x3')](0x0);var events={'afterCreate':'save','afterUpdate':_0xde38('0x4'),'afterDestroy':_0xde38('0x5')};function emitEvent(_0x5e69af){return function(_0x5919fd,_0x3cdd34,_0x3c8b8e){UserSettingEvents['emit'](_0x5e69af+':'+_0x5919fd['id'],_0x5919fd);UserSettingEvents[_0xde38('0x6')](_0x5e69af,_0x5919fd);_0x3c8b8e(null);};}for(var e in events){if(events[_0xde38('0x7')](e)){var event=events[e];UserSetting[_0xde38('0x8')](e,emitEvent(event));}}module[_0xde38('0x9')]=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 138c9a1..1961ef6 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 _0xeea4=['clientSideLoggingEnabledSince','./user-setting.attributes','exports','define','UserSetting','user_settings','clientSideLoggingEnabled'];(function(_0x1c3b6c,_0x2407ac){var _0x5463e5=function(_0x125cc1){while(--_0x125cc1){_0x1c3b6c['push'](_0x1c3b6c['shift']());}};_0x5463e5(++_0x2407ac);}(_0xeea4,0x19e));var _0x4eea=function(_0x190707,_0x154836){_0x190707=_0x190707-0x0;var _0x28f1ab=_0xeea4[_0x190707];return _0x28f1ab;};'use strict';var attributes=require(_0x4eea('0x0'));module[_0x4eea('0x1')]=function(_0x36e0f6){return _0x36e0f6[_0x4eea('0x2')](_0x4eea('0x3'),attributes,{'tableName':_0x4eea('0x4'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x2a47d5){if(!_0x2a47d5[_0x4eea('0x5')])_0x2a47d5[_0x4eea('0x6')]=null;else if(_0x2a47d5['clientSideLoggingEnabledSince']===null)_0x2a47d5[_0x4eea('0x6')]=new Date();}}});}; \ No newline at end of file +var _0x9ffd=['clientSideLoggingEnabled','clientSideLoggingEnabledSince','./user-setting.attributes','exports','UserSetting','user_settings'];(function(_0x3b436b,_0x42fbbc){var _0x41b40b=function(_0x3e3f2b){while(--_0x3e3f2b){_0x3b436b['push'](_0x3b436b['shift']());}};_0x41b40b(++_0x42fbbc);}(_0x9ffd,0xaa));var _0xd9ff=function(_0x15c7b1,_0x5cdaad){_0x15c7b1=_0x15c7b1-0x0;var _0x4897c7=_0x9ffd[_0x15c7b1];return _0x4897c7;};'use strict';var attributes=require(_0xd9ff('0x0'));module[_0xd9ff('0x1')]=function(_0x47e5c0){return _0x47e5c0['define'](_0xd9ff('0x2'),attributes,{'tableName':_0xd9ff('0x3'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x26dc20){if(!_0x26dc20[_0xd9ff('0x4')])_0x26dc20['clientSideLoggingEnabledSince']=null;else if(_0x26dc20[_0xd9ff('0x5')]===null)_0x26dc20[_0xd9ff('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 35090b2..f7433df 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 _0x21f8=['update','emit','user-setting:update','user-setting:update:user-','UserId','register','length','user-setting:','save'];(function(_0x4b53d4,_0x4498af){var _0x14736e=function(_0x11a6ae){while(--_0x11a6ae){_0x4b53d4['push'](_0x4b53d4['shift']());}};_0x14736e(++_0x4498af);}(_0x21f8,0x170));var _0x821f=function(_0x5cbd7b,_0x207439){_0x5cbd7b=_0x5cbd7b-0x0;var _0x3fdfb8=_0x21f8[_0x5cbd7b];return _0x3fdfb8;};'use strict';var UserSettingEvents=require('./user-setting.events');var events=[_0x821f('0x0'),'remove',_0x821f('0x1')];function createListener(_0x45010c,_0xa7bc69){return function(_0x44a696){_0xa7bc69[_0x821f('0x2')](_0x45010c,_0x44a696);if(_0x45010c===_0x821f('0x3')){_0xa7bc69[_0x821f('0x2')](_0x821f('0x4')+_0x44a696[_0x821f('0x5')],_0x44a696);}};}exports[_0x821f('0x6')]=function(_0x43e032){for(var _0x4a9ad0=0x0,_0x8934f7=events[_0x821f('0x7')];_0x4a9ad0<_0x8934f7;_0x4a9ad0++){var _0x4ef9ce=events[_0x4a9ad0];var _0x4fedbc=createListener(_0x821f('0x8')+_0x4ef9ce,_0x43e032);UserSettingEvents['on'](_0x4ef9ce,_0x4fedbc);}}; \ No newline at end of file +var _0x78f2=['user-setting:','save','remove','update','emit','user-setting:update:user-','UserId','length'];(function(_0x122ef9,_0x451d2a){var _0x42fba0=function(_0x17c9d3){while(--_0x17c9d3){_0x122ef9['push'](_0x122ef9['shift']());}};_0x42fba0(++_0x451d2a);}(_0x78f2,0x1b9));var _0x278f=function(_0x26cb1b,_0x5be7e6){_0x26cb1b=_0x26cb1b-0x0;var _0x332bd1=_0x78f2[_0x26cb1b];return _0x332bd1;};'use strict';var UserSettingEvents=require('./user-setting.events');var events=[_0x278f('0x0'),_0x278f('0x1'),_0x278f('0x2')];function createListener(_0x52f762,_0x5f5548){return function(_0x5f310e){_0x5f5548[_0x278f('0x3')](_0x52f762,_0x5f310e);if(_0x52f762==='user-setting:update'){_0x5f5548[_0x278f('0x3')](_0x278f('0x4')+_0x5f310e[_0x278f('0x5')],_0x5f310e);}};}exports['register']=function(_0x184457){for(var _0x48a3f1=0x0,_0x2097ec=events[_0x278f('0x6')];_0x48a3f1<_0x2097ec;_0x48a3f1++){var _0x30edeb=events[_0x48a3f1];var _0x53cb8e=createListener(_0x278f('0x7')+_0x30edeb,_0x184457);UserSettingEvents['on'](_0x30edeb,_0x53cb8e);}}; \ No newline at end of file diff --git a/server/api/user/index.js b/server/api/user/index.js index dc8943a..b9cb7fc 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 _0x6dad=['exports','multer','express','Router','fs-extra','../../components/auth/service','../../config/environment','./user.controller','get','isAuthenticated','index','/describe','describe','/whoami','whoami','/presence','getPresence','/:id','show','getAvatar','/:id/open_tabs','getOpenTabs','/:id/contacts','/:id/queues','getQueues','/:id/queues_rt','getVoiceQueuesRt','getGroups','/:id/recordings','getRecordings','getScreenRecordings','getChatInteractions','/:id/openchannel/interactions','getOpenchannelInteractions','/:id/mail/interactions','getMailInteractions','/:id/sms/interactions','/:id/fax/interactions','getFaxInteractions','getWhatsappInteractions','getTeams','getLists','/:id/agents','getAgents','/:id/prefixes','getVoicePrefixes','/:id/fax_accounts','getFaxAccounts','/:id/mail_accounts','/:id/openchannel_accounts','/:id/sms_accounts','getSmsAccounts','getChatWebsites','/:id/whatsapp_accounts','getWhatsappAccounts','/:id/scheduled_calls','getScheduledCalls','/:id/api_key','getApiKey','addContacts','post','create','/create_many','bulkCreate','addQueues','diskStorage','join','root','server/files/images/','format','%s-%s','now','originalname','/:id/avatar','file','addAvatar','/:id/login','login','logout','/:id/pause','pause','/:id/unpause','unpause','addTeams','/:id/chat_interactions','addChatInteractions','addMailInteractions','/:id/fax_interactions','addFaxInteractions','/:id/sms_interactions','addSmsInteractions','addOpenchannelInteractions','/:id/whatsapp_interactions','addWhatsappInteractions','addMailAccounts','addChatWebsites','addWhatsappAccounts','createApiKey','put','update','/:id/password','/:id/teams','delete','destroy','removeChatInteractions','/:id/mail_interactions','removeMailInteractions','removeFaxInteractions','removeSmsInteractions','removeOpenchannelInteractions','removeWhatsappInteractions','removeMailAccounts','removeOpenchannelAccounts','removeSmsAccounts','/:id/chat_websites','removeChatWebsites','removeApiKey','/:id/messengerSoundNotification'];(function(_0x27472d,_0x146002){var _0x3eae9a=function(_0x28b212){while(--_0x28b212){_0x27472d['push'](_0x27472d['shift']());}};_0x3eae9a(++_0x146002);}(_0x6dad,0x77));var _0xd6da=function(_0x12d86d,_0x385097){_0x12d86d=_0x12d86d-0x0;var _0x3e3924=_0x6dad[_0x12d86d];return _0x3e3924;};'use strict';var multer=require(_0xd6da('0x0'));var util=require('util');var path=require('path');var timeout=require('connect-timeout');var express=require(_0xd6da('0x1'));var router=express[_0xd6da('0x2')]();var fs_extra=require(_0xd6da('0x3'));var auth=require(_0xd6da('0x4'));var interaction=require('../../components/interaction/service');var config=require(_0xd6da('0x5'));var controller=require(_0xd6da('0x6'));router[_0xd6da('0x7')]('/',auth[_0xd6da('0x8')](),controller[_0xd6da('0x9')]);router[_0xd6da('0x7')](_0xd6da('0xa'),auth[_0xd6da('0x8')](),controller[_0xd6da('0xb')]);router[_0xd6da('0x7')](_0xd6da('0xc'),auth[_0xd6da('0x8')](),controller[_0xd6da('0xd')]);router['get'](_0xd6da('0xe'),auth[_0xd6da('0x8')](),controller[_0xd6da('0xf')]);router[_0xd6da('0x7')](_0xd6da('0x10'),auth[_0xd6da('0x8')](),controller[_0xd6da('0x11')]);router[_0xd6da('0x7')]('/:id/avatar',controller[_0xd6da('0x12')]);router['get'](_0xd6da('0x13'),auth[_0xd6da('0x8')](),controller[_0xd6da('0x14')]);router[_0xd6da('0x7')](_0xd6da('0x15'),auth[_0xd6da('0x8')](),controller['getContacts']);router['get'](_0xd6da('0x16'),auth[_0xd6da('0x8')](),controller[_0xd6da('0x17')]);router[_0xd6da('0x7')](_0xd6da('0x18'),auth['isAuthenticated'](),controller[_0xd6da('0x19')]);router[_0xd6da('0x7')]('/:id/groups',auth[_0xd6da('0x8')](),controller[_0xd6da('0x1a')]);router[_0xd6da('0x7')](_0xd6da('0x1b'),auth[_0xd6da('0x8')](),controller[_0xd6da('0x1c')]);router[_0xd6da('0x7')]('/:id/screen_recordings',auth[_0xd6da('0x8')](),controller[_0xd6da('0x1d')]);router[_0xd6da('0x7')]('/:id/chat/interactions',auth[_0xd6da('0x8')](),controller[_0xd6da('0x1e')]);router[_0xd6da('0x7')](_0xd6da('0x1f'),auth['isAuthenticated'](),controller[_0xd6da('0x20')]);router[_0xd6da('0x7')](_0xd6da('0x21'),auth[_0xd6da('0x8')](),controller[_0xd6da('0x22')]);router[_0xd6da('0x7')](_0xd6da('0x23'),auth[_0xd6da('0x8')](),controller['getSmsInteractions']);router[_0xd6da('0x7')](_0xd6da('0x24'),auth[_0xd6da('0x8')](),controller[_0xd6da('0x25')]);router['get']('/:id/whatsapp/interactions',auth[_0xd6da('0x8')](),controller[_0xd6da('0x26')]);router[_0xd6da('0x7')]('/:id/teams',auth[_0xd6da('0x8')](),controller[_0xd6da('0x27')]);router[_0xd6da('0x7')]('/:id/lists',auth[_0xd6da('0x8')](),controller[_0xd6da('0x28')]);router['get'](_0xd6da('0x29'),auth[_0xd6da('0x8')](),controller[_0xd6da('0x2a')]);router[_0xd6da('0x7')](_0xd6da('0x2b'),auth[_0xd6da('0x8')](),controller[_0xd6da('0x2c')]);router[_0xd6da('0x7')](_0xd6da('0x2d'),auth[_0xd6da('0x8')](),controller[_0xd6da('0x2e')]);router['get'](_0xd6da('0x2f'),auth[_0xd6da('0x8')](),controller['getMailAccounts']);router['get'](_0xd6da('0x30'),auth[_0xd6da('0x8')](),controller['getOpenchannelAccounts']);router[_0xd6da('0x7')](_0xd6da('0x31'),auth[_0xd6da('0x8')](),controller[_0xd6da('0x32')]);router[_0xd6da('0x7')]('/:id/chat_websites',auth[_0xd6da('0x8')](),controller[_0xd6da('0x33')]);router[_0xd6da('0x7')](_0xd6da('0x34'),auth['isAuthenticated'](),controller[_0xd6da('0x35')]);router[_0xd6da('0x7')](_0xd6da('0x36'),auth[_0xd6da('0x8')](),controller[_0xd6da('0x37')]);router[_0xd6da('0x7')](_0xd6da('0x38'),auth['isAuthenticated'](),controller[_0xd6da('0x39')]);router['post'](_0xd6da('0x15'),auth[_0xd6da('0x8')](),controller[_0xd6da('0x3a')]);router[_0xd6da('0x3b')]('/',auth['isAuthenticated'](),controller[_0xd6da('0x3c')]);router[_0xd6da('0x3b')](_0xd6da('0x3d'),auth[_0xd6da('0x8')](),controller[_0xd6da('0x3e')]);router[_0xd6da('0x3b')](_0xd6da('0x16'),auth[_0xd6da('0x8')](),controller[_0xd6da('0x3f')]);var upload=multer({'storage':multer[_0xd6da('0x40')]({'destination':function(_0x23fdaa,_0x477dfd,_0x8b3d06){_0x8b3d06(null,path[_0xd6da('0x41')](config[_0xd6da('0x42')],_0xd6da('0x43')));},'filename':function(_0x2e26d4,_0x346c8f,_0x5e581d){_0x5e581d(null,util[_0xd6da('0x44')](_0xd6da('0x45'),Date[_0xd6da('0x46')](),_0x346c8f[_0xd6da('0x47')]));}})});router[_0xd6da('0x3b')](_0xd6da('0x48'),upload['single'](_0xd6da('0x49')),controller[_0xd6da('0x4a')]);router[_0xd6da('0x3b')](_0xd6da('0x4b'),auth['isAuthenticated'](),controller[_0xd6da('0x4c')]);router['post']('/:id/logout',auth['isAuthenticated'](),controller[_0xd6da('0x4d')]);router[_0xd6da('0x3b')](_0xd6da('0x4e'),auth[_0xd6da('0x8')](),controller[_0xd6da('0x4f')]);router[_0xd6da('0x3b')](_0xd6da('0x50'),auth[_0xd6da('0x8')](),controller[_0xd6da('0x51')]);router['post']('/:id/teams',auth[_0xd6da('0x8')](),controller[_0xd6da('0x52')]);router[_0xd6da('0x3b')](_0xd6da('0x53'),auth[_0xd6da('0x8')](),controller[_0xd6da('0x54')]);router[_0xd6da('0x3b')]('/:id/mail_interactions',auth[_0xd6da('0x8')](),controller[_0xd6da('0x55')]);router[_0xd6da('0x3b')](_0xd6da('0x56'),auth[_0xd6da('0x8')](),controller[_0xd6da('0x57')]);router[_0xd6da('0x3b')](_0xd6da('0x58'),auth[_0xd6da('0x8')](),controller[_0xd6da('0x59')]);router[_0xd6da('0x3b')]('/:id/openchannel_interactions',auth[_0xd6da('0x8')](),controller[_0xd6da('0x5a')]);router[_0xd6da('0x3b')](_0xd6da('0x5b'),auth[_0xd6da('0x8')](),controller[_0xd6da('0x5c')]);router[_0xd6da('0x3b')](_0xd6da('0x2d'),auth[_0xd6da('0x8')](),controller['addFaxAccounts']);router['post'](_0xd6da('0x2f'),auth[_0xd6da('0x8')](),controller[_0xd6da('0x5d')]);router['post'](_0xd6da('0x30'),auth['isAuthenticated'](),controller['addOpenchannelAccounts']);router[_0xd6da('0x3b')](_0xd6da('0x31'),auth[_0xd6da('0x8')](),controller['addSmsAccounts']);router[_0xd6da('0x3b')]('/:id/chat_websites',auth[_0xd6da('0x8')](),controller[_0xd6da('0x5e')]);router[_0xd6da('0x3b')](_0xd6da('0x34'),auth[_0xd6da('0x8')](),controller[_0xd6da('0x5f')]);router[_0xd6da('0x3b')](_0xd6da('0x38'),auth[_0xd6da('0x8')](),controller[_0xd6da('0x60')]);router[_0xd6da('0x61')](_0xd6da('0x10'),auth[_0xd6da('0x8')](),controller[_0xd6da('0x62')]);router[_0xd6da('0x61')](_0xd6da('0x63'),auth['isAuthenticated'](),controller['changePassword']);router['delete'](_0xd6da('0x16'),auth[_0xd6da('0x8')](),controller['removeQueues']);router['delete'](_0xd6da('0x64'),auth[_0xd6da('0x8')](),controller['removeTeams']);router[_0xd6da('0x65')](_0xd6da('0x10'),auth[_0xd6da('0x8')](),controller[_0xd6da('0x66')]);router[_0xd6da('0x65')](_0xd6da('0x53'),auth['isAuthenticated'](),controller[_0xd6da('0x67')]);router[_0xd6da('0x65')](_0xd6da('0x68'),auth[_0xd6da('0x8')](),controller[_0xd6da('0x69')]);router[_0xd6da('0x65')](_0xd6da('0x56'),auth[_0xd6da('0x8')](),controller[_0xd6da('0x6a')]);router['delete'](_0xd6da('0x58'),auth[_0xd6da('0x8')](),controller[_0xd6da('0x6b')]);router[_0xd6da('0x65')]('/:id/openchannel_interactions',auth[_0xd6da('0x8')](),controller[_0xd6da('0x6c')]);router[_0xd6da('0x65')](_0xd6da('0x5b'),auth[_0xd6da('0x8')](),controller[_0xd6da('0x6d')]);router[_0xd6da('0x65')](_0xd6da('0x2d'),auth[_0xd6da('0x8')](),controller['removeFaxAccounts']);router[_0xd6da('0x65')](_0xd6da('0x2f'),auth[_0xd6da('0x8')](),controller[_0xd6da('0x6e')]);router[_0xd6da('0x65')]('/:id/openchannel_accounts',auth[_0xd6da('0x8')](),controller[_0xd6da('0x6f')]);router[_0xd6da('0x65')](_0xd6da('0x31'),auth['isAuthenticated'](),controller[_0xd6da('0x70')]);router[_0xd6da('0x65')](_0xd6da('0x71'),auth[_0xd6da('0x8')](),controller[_0xd6da('0x72')]);router['delete'](_0xd6da('0x34'),auth['isAuthenticated'](),controller['removeWhatsappAccounts']);router[_0xd6da('0x65')](_0xd6da('0x38'),auth[_0xd6da('0x8')](),controller[_0xd6da('0x73')]);router[_0xd6da('0x3b')](_0xd6da('0x74'),auth[_0xd6da('0x8')](),controller['messengerSoundNotification']);module[_0xd6da('0x75')]=router; \ No newline at end of file +var _0xe510=['addSmsAccounts','addWhatsappAccounts','/:id/api_key','createApiKey','/:id','update','put','/:id/password','changePassword','delete','removeQueues','/:id/teams','removeTeams','destroy','/:id/chat_interactions','removeChatInteractions','/:id/mail_interactions','removeMailInteractions','removeFaxInteractions','removeWhatsappInteractions','removeFaxAccounts','removeMailAccounts','removeOpenchannelAccounts','removeSmsAccounts','removeChatWebsites','removeWhatsappAccounts','removeApiKey','/:id/messengerSoundNotification','messengerSoundNotification','exports','multer','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/describe','describe','/whoami','whoami','/presence','getPresence','show','/:id/avatar','getAvatar','/:id/open_tabs','getOpenTabs','/:id/contacts','getContacts','/:id/queues','getQueues','/:id/queues_rt','getVoiceQueuesRt','getGroups','/:id/screen_recordings','getScreenRecordings','getChatInteractions','/:id/openchannel/interactions','/:id/mail/interactions','/:id/sms/interactions','/:id/fax/interactions','getFaxInteractions','getWhatsappInteractions','getTeams','getLists','/:id/agents','/:id/prefixes','getVoicePrefixes','/:id/fax_accounts','/:id/mail_accounts','getMailAccounts','/:id/openchannel_accounts','getSmsAccounts','/:id/chat_websites','getChatWebsites','/:id/whatsapp_accounts','/:id/scheduled_calls','getApiKey','post','addContacts','create','/create_many','bulkCreate','diskStorage','join','root','server/files/images/','format','%s-%s','now','originalname','single','file','addAvatar','/:id/login','/:id/logout','logout','/:id/pause','pause','unpause','addTeams','addChatInteractions','addFaxInteractions','/:id/sms_interactions','addSmsInteractions','/:id/openchannel_interactions','addOpenchannelInteractions','/:id/whatsapp_interactions','addFaxAccounts','addMailAccounts','addOpenchannelAccounts','/:id/sms_accounts'];(function(_0x387a0d,_0x3653d8){var _0x5a1dfb=function(_0x127dda){while(--_0x127dda){_0x387a0d['push'](_0x387a0d['shift']());}};_0x5a1dfb(++_0x3653d8);}(_0xe510,0x10a));var _0x0e51=function(_0x29d94e,_0xf386d6){_0x29d94e=_0x29d94e-0x0;var _0x106237=_0xe510[_0x29d94e];return _0x106237;};'use strict';var multer=require(_0x0e51('0x0'));var util=require('util');var path=require(_0x0e51('0x1'));var timeout=require(_0x0e51('0x2'));var express=require(_0x0e51('0x3'));var router=express[_0x0e51('0x4')]();var fs_extra=require(_0x0e51('0x5'));var auth=require(_0x0e51('0x6'));var interaction=require(_0x0e51('0x7'));var config=require(_0x0e51('0x8'));var controller=require('./user.controller');router[_0x0e51('0x9')]('/',auth[_0x0e51('0xa')](),controller[_0x0e51('0xb')]);router['get'](_0x0e51('0xc'),auth[_0x0e51('0xa')](),controller[_0x0e51('0xd')]);router[_0x0e51('0x9')](_0x0e51('0xe'),auth['isAuthenticated'](),controller[_0x0e51('0xf')]);router[_0x0e51('0x9')](_0x0e51('0x10'),auth[_0x0e51('0xa')](),controller[_0x0e51('0x11')]);router[_0x0e51('0x9')]('/:id',auth[_0x0e51('0xa')](),controller[_0x0e51('0x12')]);router[_0x0e51('0x9')](_0x0e51('0x13'),controller[_0x0e51('0x14')]);router[_0x0e51('0x9')](_0x0e51('0x15'),auth['isAuthenticated'](),controller[_0x0e51('0x16')]);router[_0x0e51('0x9')](_0x0e51('0x17'),auth[_0x0e51('0xa')](),controller[_0x0e51('0x18')]);router[_0x0e51('0x9')](_0x0e51('0x19'),auth['isAuthenticated'](),controller[_0x0e51('0x1a')]);router[_0x0e51('0x9')](_0x0e51('0x1b'),auth[_0x0e51('0xa')](),controller[_0x0e51('0x1c')]);router[_0x0e51('0x9')]('/:id/groups',auth[_0x0e51('0xa')](),controller[_0x0e51('0x1d')]);router['get']('/:id/recordings',auth[_0x0e51('0xa')](),controller['getRecordings']);router[_0x0e51('0x9')](_0x0e51('0x1e'),auth[_0x0e51('0xa')](),controller[_0x0e51('0x1f')]);router[_0x0e51('0x9')]('/:id/chat/interactions',auth[_0x0e51('0xa')](),controller[_0x0e51('0x20')]);router[_0x0e51('0x9')](_0x0e51('0x21'),auth['isAuthenticated'](),controller['getOpenchannelInteractions']);router['get'](_0x0e51('0x22'),auth['isAuthenticated'](),controller['getMailInteractions']);router[_0x0e51('0x9')](_0x0e51('0x23'),auth[_0x0e51('0xa')](),controller['getSmsInteractions']);router[_0x0e51('0x9')](_0x0e51('0x24'),auth['isAuthenticated'](),controller[_0x0e51('0x25')]);router['get']('/:id/whatsapp/interactions',auth[_0x0e51('0xa')](),controller[_0x0e51('0x26')]);router['get']('/:id/teams',auth['isAuthenticated'](),controller[_0x0e51('0x27')]);router[_0x0e51('0x9')]('/:id/lists',auth[_0x0e51('0xa')](),controller[_0x0e51('0x28')]);router['get'](_0x0e51('0x29'),auth[_0x0e51('0xa')](),controller['getAgents']);router[_0x0e51('0x9')](_0x0e51('0x2a'),auth[_0x0e51('0xa')](),controller[_0x0e51('0x2b')]);router[_0x0e51('0x9')](_0x0e51('0x2c'),auth[_0x0e51('0xa')](),controller['getFaxAccounts']);router['get'](_0x0e51('0x2d'),auth[_0x0e51('0xa')](),controller[_0x0e51('0x2e')]);router[_0x0e51('0x9')](_0x0e51('0x2f'),auth[_0x0e51('0xa')](),controller['getOpenchannelAccounts']);router[_0x0e51('0x9')]('/:id/sms_accounts',auth['isAuthenticated'](),controller[_0x0e51('0x30')]);router['get'](_0x0e51('0x31'),auth['isAuthenticated'](),controller[_0x0e51('0x32')]);router['get'](_0x0e51('0x33'),auth[_0x0e51('0xa')](),controller['getWhatsappAccounts']);router[_0x0e51('0x9')](_0x0e51('0x34'),auth[_0x0e51('0xa')](),controller['getScheduledCalls']);router[_0x0e51('0x9')]('/:id/api_key',auth[_0x0e51('0xa')](),controller[_0x0e51('0x35')]);router[_0x0e51('0x36')](_0x0e51('0x17'),auth['isAuthenticated'](),controller[_0x0e51('0x37')]);router[_0x0e51('0x36')]('/',auth[_0x0e51('0xa')](),controller[_0x0e51('0x38')]);router[_0x0e51('0x36')](_0x0e51('0x39'),auth['isAuthenticated'](),controller[_0x0e51('0x3a')]);router[_0x0e51('0x36')](_0x0e51('0x19'),auth['isAuthenticated'](),controller['addQueues']);var upload=multer({'storage':multer[_0x0e51('0x3b')]({'destination':function(_0x2a4cec,_0x31eb64,_0x31c865){_0x31c865(null,path[_0x0e51('0x3c')](config[_0x0e51('0x3d')],_0x0e51('0x3e')));},'filename':function(_0x4c7ebd,_0x1d3a5d,_0x2bcfa5){_0x2bcfa5(null,util[_0x0e51('0x3f')](_0x0e51('0x40'),Date[_0x0e51('0x41')](),_0x1d3a5d[_0x0e51('0x42')]));}})});router[_0x0e51('0x36')]('/:id/avatar',upload[_0x0e51('0x43')](_0x0e51('0x44')),controller[_0x0e51('0x45')]);router[_0x0e51('0x36')](_0x0e51('0x46'),auth[_0x0e51('0xa')](),controller['login']);router[_0x0e51('0x36')](_0x0e51('0x47'),auth[_0x0e51('0xa')](),controller[_0x0e51('0x48')]);router['post'](_0x0e51('0x49'),auth[_0x0e51('0xa')](),controller[_0x0e51('0x4a')]);router[_0x0e51('0x36')]('/:id/unpause',auth[_0x0e51('0xa')](),controller[_0x0e51('0x4b')]);router[_0x0e51('0x36')]('/:id/teams',auth[_0x0e51('0xa')](),controller[_0x0e51('0x4c')]);router[_0x0e51('0x36')]('/:id/chat_interactions',auth[_0x0e51('0xa')](),controller[_0x0e51('0x4d')]);router['post']('/:id/mail_interactions',auth[_0x0e51('0xa')](),controller['addMailInteractions']);router['post']('/:id/fax_interactions',auth[_0x0e51('0xa')](),controller[_0x0e51('0x4e')]);router[_0x0e51('0x36')](_0x0e51('0x4f'),auth['isAuthenticated'](),controller[_0x0e51('0x50')]);router[_0x0e51('0x36')](_0x0e51('0x51'),auth['isAuthenticated'](),controller[_0x0e51('0x52')]);router[_0x0e51('0x36')](_0x0e51('0x53'),auth['isAuthenticated'](),controller['addWhatsappInteractions']);router[_0x0e51('0x36')](_0x0e51('0x2c'),auth[_0x0e51('0xa')](),controller[_0x0e51('0x54')]);router[_0x0e51('0x36')](_0x0e51('0x2d'),auth[_0x0e51('0xa')](),controller[_0x0e51('0x55')]);router['post'](_0x0e51('0x2f'),auth['isAuthenticated'](),controller[_0x0e51('0x56')]);router['post'](_0x0e51('0x57'),auth[_0x0e51('0xa')](),controller[_0x0e51('0x58')]);router[_0x0e51('0x36')](_0x0e51('0x31'),auth[_0x0e51('0xa')](),controller['addChatWebsites']);router[_0x0e51('0x36')](_0x0e51('0x33'),auth[_0x0e51('0xa')](),controller[_0x0e51('0x59')]);router['post'](_0x0e51('0x5a'),auth[_0x0e51('0xa')](),controller[_0x0e51('0x5b')]);router['put'](_0x0e51('0x5c'),auth[_0x0e51('0xa')](),controller[_0x0e51('0x5d')]);router[_0x0e51('0x5e')](_0x0e51('0x5f'),auth[_0x0e51('0xa')](),controller[_0x0e51('0x60')]);router[_0x0e51('0x61')]('/:id/queues',auth[_0x0e51('0xa')](),controller[_0x0e51('0x62')]);router[_0x0e51('0x61')](_0x0e51('0x63'),auth['isAuthenticated'](),controller[_0x0e51('0x64')]);router['delete'](_0x0e51('0x5c'),auth[_0x0e51('0xa')](),controller[_0x0e51('0x65')]);router[_0x0e51('0x61')](_0x0e51('0x66'),auth['isAuthenticated'](),controller[_0x0e51('0x67')]);router['delete'](_0x0e51('0x68'),auth[_0x0e51('0xa')](),controller[_0x0e51('0x69')]);router[_0x0e51('0x61')]('/:id/fax_interactions',auth['isAuthenticated'](),controller[_0x0e51('0x6a')]);router['delete'](_0x0e51('0x4f'),auth['isAuthenticated'](),controller['removeSmsInteractions']);router[_0x0e51('0x61')](_0x0e51('0x51'),auth[_0x0e51('0xa')](),controller['removeOpenchannelInteractions']);router['delete'](_0x0e51('0x53'),auth['isAuthenticated'](),controller[_0x0e51('0x6b')]);router[_0x0e51('0x61')]('/:id/fax_accounts',auth[_0x0e51('0xa')](),controller[_0x0e51('0x6c')]);router[_0x0e51('0x61')]('/:id/mail_accounts',auth[_0x0e51('0xa')](),controller[_0x0e51('0x6d')]);router[_0x0e51('0x61')](_0x0e51('0x2f'),auth[_0x0e51('0xa')](),controller[_0x0e51('0x6e')]);router[_0x0e51('0x61')]('/:id/sms_accounts',auth['isAuthenticated'](),controller[_0x0e51('0x6f')]);router['delete'](_0x0e51('0x31'),auth[_0x0e51('0xa')](),controller[_0x0e51('0x70')]);router[_0x0e51('0x61')](_0x0e51('0x33'),auth[_0x0e51('0xa')](),controller[_0x0e51('0x71')]);router[_0x0e51('0x61')](_0x0e51('0x5a'),auth[_0x0e51('0xa')](),controller[_0x0e51('0x72')]);router['post'](_0x0e51('0x73'),auth[_0x0e51('0xa')](),controller[_0x0e51('0x74')]);module[_0x0e51('0x75')]=router; \ No newline at end of file diff --git a/server/api/user/user.attributes.js b/server/api/user/user.attributes.js index 9ecad4d..68ee381 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 _0xce63=['UNSIGNED','sequelize','lodash','STRING','name','setDataValue','defaultuser','The\x20name\x20of\x20the\x20user','fullname','callerid','format','\x22%s\x22\x20<%s>','getDataValue','internal','email','toLowerCase','admin','user','agent','telephone','local','INTEGER','accountcode','DATE','BOOLEAN','DEFAULT\x20PAUSE','dynamic','friend','peer','from-sip','ENUM','ALLOWED_NOT_SCREENED','ALLOWED','PROHIB_PASSED_SCREEN','PROHIB_FAILED_SCREEN','PROHIB','udp','transport','join','info','inband','rfc2833','outgoing','force_rport,comedia','nat','split','String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22force_rport\x22,\x20\x22comedia\x22]','all','allow','ulaw;alaw;gsm','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]','yes','never','\x22\x22\x20<>','always','accept','refuse','uac','uas','active','passive','actpass','nonat','update','update,nonat','TEXT','isArray','wss','encryption','avpf','force_avp','icesupport','dtlssetup','dtlscertfile','dtlsprivatekey','dtlsenable','dtlsverify','/etc/pki/tls/certs/motion.crt','permissions','VIRTUAL','string','true','screenrecording','loginAttempts','blockedAt'];(function(_0x342baa,_0x4a110f){var _0x1208f3=function(_0x56a645){while(--_0x56a645){_0x342baa['push'](_0x342baa['shift']());}};_0x1208f3(++_0x4a110f);}(_0xce63,0xaf));var _0x3ce6=function(_0x2967c1,_0x202a72){_0x2967c1=_0x2967c1-0x0;var _0x103397=_0xce63[_0x2967c1];return _0x103397;};'use strict';var Sequelize=require(_0x3ce6('0x0'));var moment=require('moment');var util=require('util');var _=require(_0x3ce6('0x1'));module['exports']={'name':{'type':Sequelize[_0x3ce6('0x2')],'allowNull':![],'unique':_0x3ce6('0x3'),'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i},'set':function(_0x4f2059){this[_0x3ce6('0x4')](_0x3ce6('0x3'),_0x4f2059);this['setDataValue'](_0x3ce6('0x5'),_0x4f2059);},'comment':_0x3ce6('0x6')},'fullname':{'type':Sequelize[_0x3ce6('0x2')],'allowNull':![],'set':function(_0x3f57e7){this[_0x3ce6('0x4')](_0x3ce6('0x7'),_0x3f57e7);this[_0x3ce6('0x4')](_0x3ce6('0x8'),util[_0x3ce6('0x9')](_0x3ce6('0xa'),_0x3f57e7,this[_0x3ce6('0xb')](_0x3ce6('0xc'))));}},'alias':{'type':Sequelize['STRING']},'email':{'type':Sequelize[_0x3ce6('0x2')],'allowNull':![],'unique':'email','validate':{'isEmail':!![]},'set':function(_0x2e4b3a){if(_0x2e4b3a){this['setDataValue'](_0x3ce6('0xd'),_0x2e4b3a[_0x3ce6('0xe')]());}}},'role':{'type':Sequelize['ENUM'](_0x3ce6('0xf'),_0x3ce6('0x10'),_0x3ce6('0x11'),_0x3ce6('0x12')),'allowNull':![]},'password':{'type':Sequelize[_0x3ce6('0x2')],'allowNull':![],'validate':{'notEmpty':!![]}},'provider':{'type':Sequelize[_0x3ce6('0x2')],'defaultValue':_0x3ce6('0x13')},'internal':{'type':Sequelize[_0x3ce6('0x14')](0xb),'allowNull':![],'unique':_0x3ce6('0xc'),'set':function(_0x2650f7){this['setDataValue'](_0x3ce6('0xc'),_0x2650f7);this[_0x3ce6('0x4')](_0x3ce6('0x15'),_0x2650f7);this['setDataValue']('callerid',util[_0x3ce6('0x9')]('\x22%s\x22\x20<%s>',this[_0x3ce6('0xb')](_0x3ce6('0x7')),_0x2650f7));}},'salt':{'type':Sequelize[_0x3ce6('0x2')]},'phone':{'type':Sequelize[_0x3ce6('0x2')]},'mobile':{'type':Sequelize['STRING']},'address':{'type':Sequelize[_0x3ce6('0x2')]},'zipcode':{'type':Sequelize['STRING']},'userpic':{'type':Sequelize[_0x3ce6('0x2')]},'city':{'type':Sequelize[_0x3ce6('0x2')]},'country':{'type':Sequelize[_0x3ce6('0x2')]},'online':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'lastLoginAt':{'type':Sequelize[_0x3ce6('0x16')]},'voicePause':{'type':Sequelize[_0x3ce6('0x17')],'defaultValue':![]},'chatPause':{'type':Sequelize[_0x3ce6('0x17')],'defaultValue':![]},'mailPause':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'faxPause':{'type':Sequelize[_0x3ce6('0x17')],'defaultValue':![]},'smsPause':{'type':Sequelize[_0x3ce6('0x17')],'defaultValue':![]},'whatsappPause':{'type':Sequelize[_0x3ce6('0x17')],'defaultValue':![]},'openchannelPause':{'type':Sequelize[_0x3ce6('0x17')],'defaultValue':![]},'pauseType':{'type':Sequelize[_0x3ce6('0x2')],'defaultValue':_0x3ce6('0x18')},'lastPauseAt':{'type':Sequelize[_0x3ce6('0x16')]},'chatCapacity':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'mailCapacity':{'type':Sequelize[_0x3ce6('0x14')],'defaultValue':0x0},'faxCapacity':{'type':Sequelize[_0x3ce6('0x14')],'defaultValue':0x0},'smsCapacity':{'type':Sequelize[_0x3ce6('0x14')],'defaultValue':0x0},'whatsappCapacity':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'openchannelCapacity':{'type':Sequelize[_0x3ce6('0x14')],'defaultValue':0x0},'phoneBarAutoAnswer':{'type':Sequelize[_0x3ce6('0x17')],'defaultValue':![]},'phoneBarEnableSettings':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'phoneBarListenPort':{'type':Sequelize['INTEGER'](0x5),'defaultValue':0x1428},'phoneBarExpires':{'type':Sequelize['INTEGER'](0x5),'defaultValue':0x78},'phoneBarRemoteControl':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'phoneBarRemoteControlPort':{'type':Sequelize[_0x3ce6('0x14')],'defaultValue':0x26a0},'phoneBarEnableRecording':{'type':Sequelize[_0x3ce6('0x17')],'defaultValue':![]},'phoneBarRingInUse':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'chanspy':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'description':{'type':Sequelize[_0x3ce6('0x2')],'allowNull':!![]},'host':{'type':Sequelize[_0x3ce6('0x2')],'allowNull':!![],'defaultValue':_0x3ce6('0x19')},'ipaddr':{'type':Sequelize[_0x3ce6('0x2')],'allowNull':!![]},'port':{'type':Sequelize[_0x3ce6('0x14')](0x5),'allowNull':!![]},'regseconds':{'type':Sequelize[_0x3ce6('0x14')](0xb),'allowNull':!![]},'fullcontact':{'type':Sequelize[_0x3ce6('0x2')],'allowNull':!![]},'regserver':{'type':Sequelize['STRING'],'allowNull':!![]},'useragent':{'type':Sequelize[_0x3ce6('0x2')],'allowNull':!![]},'lastms':{'type':Sequelize[_0x3ce6('0x14')](0xb),'allowNull':!![]},'type':{'type':Sequelize['ENUM'](_0x3ce6('0x1a'),_0x3ce6('0x10'),_0x3ce6('0x1b')),'allowNull':!![],'defaultValue':'friend'},'context':{'type':Sequelize[_0x3ce6('0x2')],'allowNull':!![],'defaultValue':_0x3ce6('0x1c')},'callingpres':{'type':Sequelize[_0x3ce6('0x1d')](_0x3ce6('0x1e'),'ALLOWED_PASSED_SCREEN','ALLOWED_FAILED_SCREEN',_0x3ce6('0x1f'),'PROHIB_NOT_SCREENED',_0x3ce6('0x20'),_0x3ce6('0x21'),_0x3ce6('0x22')),'allowNull':!![]},'deny':{'type':Sequelize[_0x3ce6('0x2')],'allowNull':!![]},'permit':{'type':Sequelize[_0x3ce6('0x2')],'allowNull':!![]},'secret':{'type':Sequelize[_0x3ce6('0x2')],'allowNull':!![]},'md5secret':{'type':Sequelize['STRING'],'allowNull':!![]},'remotesecret':{'type':Sequelize['STRING'],'allowNull':!![]},'transport':{'type':Sequelize[_0x3ce6('0x2')],'allowNull':!![],'defaultValue':_0x3ce6('0x23'),'set':function(_0xc21e09){this[_0x3ce6('0x4')](_0x3ce6('0x24'),_0xc21e09?_0xc21e09[_0x3ce6('0x25')](','):null);},'get':function(){return this[_0x3ce6('0xb')](_0x3ce6('0x24'))?this['getDataValue'](_0x3ce6('0x24'))['split'](','):null;},'comment':'String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22udp\x22,\x20\x22tcp\x22]'},'dtmfmode':{'type':Sequelize[_0x3ce6('0x1d')]('rfc2833',_0x3ce6('0x26'),'shortinfo',_0x3ce6('0x27'),'auto'),'allowNull':!![],'defaultValue':_0x3ce6('0x28')},'directmedia':{'type':Sequelize[_0x3ce6('0x1d')]('yes','no','nonat','update',_0x3ce6('0x29')),'allowNull':!![],'defaultValue':'no'},'directrtpsetup':{'type':Sequelize[_0x3ce6('0x1d')]('yes','no'),'allowNull':!![],'defaultValue':'no'},'directmediapermit':{'type':Sequelize['STRING'],'allowNull':!![]},'directmediadeny':{'type':Sequelize[_0x3ce6('0x2')],'allowNull':!![]},'nat':{'type':Sequelize[_0x3ce6('0x2')],'allowNull':!![],'defaultValue':_0x3ce6('0x2a'),'set':function(_0x29aeb3){this[_0x3ce6('0x4')](_0x3ce6('0x2b'),_0x29aeb3?_0x29aeb3['join'](','):null);},'get':function(){return this[_0x3ce6('0xb')]('nat')?this[_0x3ce6('0xb')](_0x3ce6('0x2b'))[_0x3ce6('0x2c')](','):null;},'comment':_0x3ce6('0x2d')},'callgroup':{'type':Sequelize[_0x3ce6('0x2')]},'namedcallgroup':{'type':Sequelize[_0x3ce6('0x2')]},'pickupgroup':{'type':Sequelize[_0x3ce6('0x2')]},'namedpickupgroup':{'type':Sequelize[_0x3ce6('0x2')]},'language':{'type':Sequelize[_0x3ce6('0x2')],'defaultValue':'en'},'tonezone':{'type':Sequelize['STRING']},'disallow':{'type':Sequelize[_0x3ce6('0x2')],'allowNull':![],'defaultValue':_0x3ce6('0x2e')},'allow':{'type':Sequelize[_0x3ce6('0x2')],'allowNull':![],'defaultValue':'ulaw;alaw;gsm','set':function(_0x451d14){this[_0x3ce6('0x4')](_0x3ce6('0x2f'),_0x451d14?_0x451d14['join'](';'):_0x3ce6('0x30'));},'get':function(){return this['getDataValue']('allow')?this[_0x3ce6('0xb')](_0x3ce6('0x2f'))[_0x3ce6('0x2c')](';'):null;},'comment':_0x3ce6('0x31')},'autoframing':{'type':Sequelize[_0x3ce6('0x1d')]('yes','no'),'allowNull':!![]},'insecure':{'type':Sequelize[_0x3ce6('0x2')],'allowNull':!![],'set':function(_0x4f9b09){this[_0x3ce6('0x4')](_0x3ce6('0x32'),_0x4f9b09?_0x4f9b09[_0x3ce6('0x25')](','):null);},'get':function(){return this[_0x3ce6('0xb')](_0x3ce6('0x32'))?this[_0x3ce6('0xb')]('insecure')['split'](','):null;},'comment':_0x3ce6('0x33')},'trustrpid':{'type':Sequelize[_0x3ce6('0x1d')](_0x3ce6('0x34'),'no'),'allowNull':!![],'defaultValue':'no'},'trust_id_outbound':{'type':Sequelize['ENUM'](_0x3ce6('0x34'),'no'),'allowNull':!![],'defaultValue':'no'},'progressinband':{'type':Sequelize[_0x3ce6('0x1d')](_0x3ce6('0x34'),'no',_0x3ce6('0x35')),'allowNull':!![]},'promiscredir':{'type':Sequelize[_0x3ce6('0x1d')](_0x3ce6('0x34'),'no'),'allowNull':!![]},'useclientcode':{'type':Sequelize[_0x3ce6('0x1d')](_0x3ce6('0x34'),'no'),'allowNull':!![]},'accountcode':{'type':Sequelize[_0x3ce6('0x14')](0xb),'allowNull':!![]},'setvar':{'type':Sequelize[_0x3ce6('0x2')],'allowNull':!![]},'callerid':{'type':Sequelize[_0x3ce6('0x2')],'allowNull':!![],'defaultValue':_0x3ce6('0x36')},'amaflags':{'type':Sequelize[_0x3ce6('0x2')],'allowNull':!![]},'callcounter':{'type':Sequelize['ENUM'](_0x3ce6('0x34'),'no'),'allowNull':!![],'defaultValue':_0x3ce6('0x34')},'busylevel':{'type':Sequelize[_0x3ce6('0x14')](0xb),'allowNull':!![]},'allowoverlap':{'type':Sequelize[_0x3ce6('0x1d')]('yes','no'),'allowNull':!![]},'allowsubscribe':{'type':Sequelize[_0x3ce6('0x1d')](_0x3ce6('0x34'),'no'),'allowNull':!![]},'allowtransfer':{'type':Sequelize[_0x3ce6('0x1d')](_0x3ce6('0x34'),'no'),'allowNull':!![]},'ignoresdpversion':{'type':Sequelize[_0x3ce6('0x1d')]('yes','no'),'allowNull':!![]},'subscribecontext':{'type':Sequelize[_0x3ce6('0x2')],'allowNull':!![]},'template':{'type':Sequelize['STRING'],'allowNull':!![]},'videosupport':{'type':Sequelize[_0x3ce6('0x1d')](_0x3ce6('0x34'),'no',_0x3ce6('0x37')),'allowNull':!![],'defaultValue':'no'},'maxcallbitrate':{'type':Sequelize[_0x3ce6('0x14')](0xb),'allowNull':!![]},'rfc2833compensate':{'type':Sequelize[_0x3ce6('0x1d')]('yes','no'),'allowNull':!![]},'mailbox':{'type':Sequelize[_0x3ce6('0x2')],'allowNull':!![]},'session_timers':{'type':Sequelize['ENUM'](_0x3ce6('0x38'),_0x3ce6('0x39'),'originate'),'allowNull':!![]},'session_expires':{'type':Sequelize[_0x3ce6('0x14')](0xb),'allowNull':!![]},'session_minse':{'type':Sequelize[_0x3ce6('0x14')](0xb),'allowNull':!![]},'session_refresher':{'type':Sequelize[_0x3ce6('0x1d')](_0x3ce6('0x3a'),_0x3ce6('0x3b')),'allowNull':!![],'defaultValue':_0x3ce6('0x3b')},'t38pt_usertpsource':{'type':Sequelize[_0x3ce6('0x2')],'allowNull':!![]},'regexten':{'type':Sequelize[_0x3ce6('0x2')],'allowNull':!![]},'fromdomain':{'type':Sequelize[_0x3ce6('0x2')],'allowNull':!![]},'fromuser':{'type':Sequelize[_0x3ce6('0x2')],'allowNull':!![]},'qualify':{'type':Sequelize[_0x3ce6('0x1d')](_0x3ce6('0x34'),'no'),'allowNull':!![],'defaultValue':_0x3ce6('0x34')},'keepalive':{'type':Sequelize[_0x3ce6('0x14')](0xb),'allowNull':!![]},'defaultip':{'type':Sequelize['STRING'],'allowNull':!![]},'defaultuser':{'type':Sequelize['STRING'],'allowNull':!![]},'rtptimeout':{'type':Sequelize[_0x3ce6('0x14')](0xb),'allowNull':!![]},'rtpholdtimeout':{'type':Sequelize[_0x3ce6('0x14')](0xb),'allowNull':!![]},'rtpkeepalive':{'type':Sequelize['INTEGER'](0xb),'allowNull':!![]},'sendrpid':{'type':Sequelize[_0x3ce6('0x1d')]('yes','no'),'allowNull':!![],'defaultValue':'no'},'outboundproxy':{'type':Sequelize[_0x3ce6('0x2')],'allowNull':!![]},'callbackextension':{'type':Sequelize[_0x3ce6('0x2')],'allowNull':!![]},'timert1':{'type':Sequelize[_0x3ce6('0x14')](0xb),'allowNull':!![]},'timerb':{'type':Sequelize[_0x3ce6('0x14')](0xb),'allowNull':!![]},'qualifyfreq':{'type':Sequelize[_0x3ce6('0x14')](0xb),'allowNull':!![]},'contactpermit':{'type':Sequelize[_0x3ce6('0x2')],'allowNull':!![]},'contactdeny':{'type':Sequelize[_0x3ce6('0x2')],'allowNull':!![]},'contactacl':{'type':Sequelize[_0x3ce6('0x2')],'allowNull':!![]},'unsolicited_mailbox':{'type':Sequelize['STRING'],'allowNull':!![]},'use_q850_reason':{'type':Sequelize[_0x3ce6('0x2')],'allowNull':!![]},'maxforwards':{'type':Sequelize['INTEGER'](0xb),'allowNull':!![]},'encryption':{'type':Sequelize[_0x3ce6('0x1d')](_0x3ce6('0x34'),'no'),'allowNull':!![],'defaultValue':'no'},'avpf':{'type':Sequelize[_0x3ce6('0x1d')](_0x3ce6('0x34'),'no'),'allowNull':!![]},'force_avp':{'type':Sequelize[_0x3ce6('0x1d')]('yes','no'),'allowNull':!![]},'icesupport':{'type':Sequelize[_0x3ce6('0x1d')](_0x3ce6('0x34'),'no'),'allowNull':!![]},'dtlsenable':{'type':Sequelize['ENUM']('yes','no'),'allowNull':!![]},'dtlsverify':{'type':Sequelize[_0x3ce6('0x1d')](_0x3ce6('0x34'),'no','fingerprint','certificate'),'allowNull':!![]},'dtlsrekey':{'type':Sequelize[_0x3ce6('0x14')](0xb),'allowNull':!![]},'dtlscertfile':{'type':Sequelize[_0x3ce6('0x2')],'allowNull':!![]},'dtlsprivatekey':{'type':Sequelize[_0x3ce6('0x2')],'allowNull':!![]},'dtlscipher':{'type':Sequelize['STRING'],'allowNull':!![]},'dtlscafile':{'type':Sequelize[_0x3ce6('0x2')],'allowNull':!![]},'dtlscapath':{'type':Sequelize[_0x3ce6('0x2')],'allowNull':!![]},'dtlssetup':{'type':Sequelize[_0x3ce6('0x1d')](_0x3ce6('0x3c'),_0x3ce6('0x3d'),_0x3ce6('0x3e')),'allowNull':!![]},'dtlsfingerprint':{'type':Sequelize[_0x3ce6('0x2')],'allowNull':!![]},'usereqphone':{'type':Sequelize[_0x3ce6('0x1d')](_0x3ce6('0x34'),'no'),'allowNull':!![],'defaultValue':'no'},'recordonfeature':{'type':Sequelize[_0x3ce6('0x2')],'allowNull':!![]},'recordofffeature':{'type':Sequelize[_0x3ce6('0x2')],'allowNull':!![]},'call_limit':{'type':Sequelize[_0x3ce6('0x14')](0xb),'allowNull':!![],'defaultValue':0xa},'registertrying':{'type':Sequelize[_0x3ce6('0x1d')](_0x3ce6('0x34'),'no'),'allowNull':!![]},'subscribemwi':{'type':Sequelize[_0x3ce6('0x1d')]('yes','no'),'allowNull':!![]},'vmexten':{'type':Sequelize['STRING'],'allowNull':!![]},'mohinterpret':{'type':Sequelize[_0x3ce6('0x2')],'allowNull':!![]},'mohsuggest':{'type':Sequelize[_0x3ce6('0x2')],'allowNull':!![]},'parkinglot':{'type':Sequelize[_0x3ce6('0x2')],'allowNull':!![]},'canreinvite':{'type':Sequelize[_0x3ce6('0x1d')](_0x3ce6('0x34'),'no',_0x3ce6('0x3f'),_0x3ce6('0x40'),_0x3ce6('0x41')),'allowNull':!![],'defaultValue':'no'},'loginInPause':{'type':Sequelize[_0x3ce6('0x17')],'defaultValue':![]},'resetPasswordToken':{'type':Sequelize['STRING']},'resetPasswordExpires':{'type':Sequelize['DATE']},'passwordResetAt':{'type':Sequelize[_0x3ce6('0x16')],'defaultValue':null},'previousPasswords':{'type':Sequelize[_0x3ce6('0x42')]},'showWebBar':{'type':Sequelize[_0x3ce6('0x14')],'defaultValue':0x0,'set':function(_0x404649){this['setDataValue']('showWebBar',_0x404649);var _0x41a688=this['get']({'plain':!![]});switch(_0x404649){case 0x0:case 0x1:var _0x39c24c=_0x41a688[_0x3ce6('0x24')]?_[_0x3ce6('0x43')](_0x41a688[_0x3ce6('0x24')])?_0x41a688[_0x3ce6('0x24')][_0x3ce6('0x25')]():_0x41a688[_0x3ce6('0x24')]:_0x3ce6('0x23');if(_0x39c24c===_0x3ce6('0x44')){_0x39c24c=_0x3ce6('0x23');}this[_0x3ce6('0x4')](_0x3ce6('0x24'),_0x39c24c);this['setDataValue'](_0x3ce6('0x45'),'no');this[_0x3ce6('0x4')](_0x3ce6('0x46'),null);this['setDataValue'](_0x3ce6('0x47'),null);this[_0x3ce6('0x4')](_0x3ce6('0x48'),null);this[_0x3ce6('0x4')]('dtlsenable',null);this[_0x3ce6('0x4')]('dtlsverify',null);this[_0x3ce6('0x4')](_0x3ce6('0x49'),null);this[_0x3ce6('0x4')](_0x3ce6('0x4a'),null);this['setDataValue'](_0x3ce6('0x4b'),null);this[_0x3ce6('0x4')]('rtcp_mux','no');break;case 0x2:this[_0x3ce6('0x4')](_0x3ce6('0x24'),_0x3ce6('0x44'));this[_0x3ce6('0x4')]('encryption',_0x3ce6('0x34'));this[_0x3ce6('0x4')]('avpf',_0x3ce6('0x34'));this[_0x3ce6('0x4')](_0x3ce6('0x47'),_0x3ce6('0x34'));this[_0x3ce6('0x4')]('icesupport',_0x3ce6('0x34'));this[_0x3ce6('0x4')](_0x3ce6('0x4c'),_0x3ce6('0x34'));this[_0x3ce6('0x4')](_0x3ce6('0x4d'),'no');this[_0x3ce6('0x4')](_0x3ce6('0x49'),_0x3ce6('0x3e'));this[_0x3ce6('0x4')](_0x3ce6('0x4a'),_0x41a688[_0x3ce6('0x4a')]||_0x3ce6('0x4e'));this[_0x3ce6('0x4')](_0x3ce6('0x4b'),_0x41a688[_0x3ce6('0x4b')]||'/etc/pki/tls/private/motion.key');this[_0x3ce6('0x4')]('rtcp_mux',_0x3ce6('0x34'));break;default:}}},'permissions':{'type':Sequelize['TEXT'],'set':function(_0x37ebc6){this[_0x3ce6('0x4')](_0x3ce6('0x4f'),_0x37ebc6?_0x37ebc6[_0x3ce6('0x25')](','):[]);},'get':function(){return this[_0x3ce6('0xb')]('permissions')?_['map'](this[_0x3ce6('0xb')](_0x3ce6('0x4f'))['split'](','),function(_0x5db720){return parseInt(_0x5db720,0xa);}):[];}},'phoneBarUnconditionalNumber':{'type':Sequelize[_0x3ce6('0x2')]},'phoneBarNoReplyNumber':{'type':Sequelize['STRING']},'phoneBarBusyNumber':{'type':Sequelize[_0x3ce6('0x2')]},'phoneBarUnconditional':{'type':Sequelize[_0x3ce6('0x17')],'defaultValue':![]},'phoneBarNoReply':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'phoneBarBusy':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'phoneBarDnd':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'phoneBarUnansweredCallBadge':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'phoneBarEnableDtmfTone':{'type':Sequelize[_0x3ce6('0x17')],'defaultValue':![]},'phoneBarAutoAnswerDelay':{'type':Sequelize[_0x3ce6('0x14')],'defaultValue':0x0},'extensionMonitor':{'type':Sequelize[_0x3ce6('0x2')],'defaultValue':''},'crudPermissions':{'type':Sequelize[_0x3ce6('0x14')],'defaultValue':0x0},'rtcp_mux':{'type':Sequelize[_0x3ce6('0x1d')](_0x3ce6('0x34'),'no'),'defaultValue':'no'},'allowmessenger':{'type':Sequelize[_0x3ce6('0x17')],'defaultValue':!![]},'phoneBarOutboundProxy':{'type':Sequelize[_0x3ce6('0x2')]},'phoneBarEnableJaws':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'phoneBarEnableScreenRecordingByAgent':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'phoneBarEnableVideoRecording':{'type':Sequelize[_0x3ce6('0x50')],'get':function(){return this[_0x3ce6('0xb')]('phoneBarEnableScreenRecordingByAgent')?this[_0x3ce6('0xb')]('phoneBarEnableScreenRecordingByAgent'):![];}},'phoneBarEnableAutomaticScreenRecording':{'type':Sequelize[_0x3ce6('0x17')],'defaultValue':![]},'phoneBarPrefixRequired':{'type':Sequelize[_0x3ce6('0x17')],'defaultValue':![]},'hotdesk':{'type':Sequelize[_0x3ce6('0x17')],'defaultValue':![]},'interface':{'type':Sequelize[_0x3ce6('0x2')],'defaultValue':null},'privacyEnabled':{'type':Sequelize[_0x3ce6('0x17')],'defaultValue':![]},'apiKeyNonce':{'type':Sequelize[_0x3ce6('0x2')],'allowNull':!![]},'apiKeyIat':{'type':Sequelize['STRING'],'allowNull':!![]},'screenrecording':{'type':Sequelize['BOOLEAN'],'defaultValue':![],'set':function(_0x4751f1){if(typeof _0x4751f1===_0x3ce6('0x51')){var _0x930e54=_0x4751f1==='1'?!![]:_0x4751f1==='0'?![]:_0x4751f1===_0x3ce6('0x52')?!![]:_0x4751f1==='false'?![]:![];this['setDataValue'](_0x3ce6('0x53'),_0x930e54);}else{this[_0x3ce6('0x4')](_0x3ce6('0x53'),_0x4751f1);}}},'blocked':{'type':Sequelize[_0x3ce6('0x17')],'defaultValue':![],'set':function(_0x52e2bf){this[_0x3ce6('0x4')]('blocked',_0x52e2bf);if(_0x52e2bf===!![]){this[_0x3ce6('0x4')]('blockedAt',moment());this['setDataValue'](_0x3ce6('0x54'),0x0);}else{this[_0x3ce6('0x4')](_0x3ce6('0x55'),null);}}},'blockedAt':{'type':Sequelize[_0x3ce6('0x16')],'defaultValue':null},'loginAttempts':{'type':Sequelize[_0x3ce6('0x14')],'defaultValue':0x0},'disabled':{'type':Sequelize[_0x3ce6('0x17')],'defaultValue':![]},'settingsEnabled':{'type':Sequelize[_0x3ce6('0x17')],'defaultValue':!![]},'wssPort':{'type':Sequelize[_0x3ce6('0x14')](0x5)[_0x3ce6('0x56')],'defaultValue':0x1f99},'downloadAttachments':{'type':Sequelize[_0x3ce6('0x17')],'defaultValue':!![]},'downloadOmnichannelInteractions':{'type':Sequelize[_0x3ce6('0x17')],'defaultValue':!![]},'downloadVoiceRecordings':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'ignorePauseForPreviewCalls':{'type':Sequelize[_0x3ce6('0x17')],'defaultValue':![]},'selectRecallMeCampaign':{'type':Sequelize[_0x3ce6('0x17')],'defaultValue':![]},'adSsoEnabled':{'type':Sequelize[_0x3ce6('0x17')],'defaultValue':![]},'chatAutoanswer':{'type':Sequelize[_0x3ce6('0x17')],'defaultValue':![]},'chatAutoanswerDelay':{'type':Sequelize[_0x3ce6('0x14')],'defaultValue':0x0},'emailAutoanswer':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'emailAutoanswerDelay':{'type':Sequelize[_0x3ce6('0x14')],'defaultValue':0x0},'smsAutoanswer':{'type':Sequelize[_0x3ce6('0x17')],'defaultValue':![]},'smsAutoanswerDelay':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'openchannelAutoanswer':{'type':Sequelize[_0x3ce6('0x17')],'defaultValue':![]},'openchannelAutoanswerDelay':{'type':Sequelize[_0x3ce6('0x14')],'defaultValue':0x0},'faxAutoanswer':{'type':Sequelize[_0x3ce6('0x17')],'defaultValue':![]},'faxAutoanswerDelay':{'type':Sequelize[_0x3ce6('0x14')],'defaultValue':0x0},'whatsappAutoanswer':{'type':Sequelize[_0x3ce6('0x17')],'defaultValue':![]},'whatsappAutoanswerDelay':{'type':Sequelize[_0x3ce6('0x14')],'defaultValue':0x0},'messengerSoundNotification':{'type':Sequelize[_0x3ce6('0x17')],'defaultValue':![]}}; \ No newline at end of file +var _0xe2ba=['peer','from-sip','ALLOWED_PASSED_SCREEN','ALLOWED_FAILED_SCREEN','ALLOWED','PROHIB_PASSED_SCREEN','PROHIB','udp','transport','join','split','String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22udp\x22,\x20\x22tcp\x22]','rfc2833','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<>','always','accept','refuse','uac','uas','fingerprint','certificate','actpass','update,nonat','TEXT','showWebBar','get','encryption','dtlsenable','dtlsverify','dtlssetup','dtlsprivatekey','rtcp_mux','wss','icesupport','dtlscertfile','/etc/pki/tls/private/motion.key','permissions','map','VIRTUAL','phoneBarEnableScreenRecordingByAgent','string','true','screenrecording','blockedAt','loginAttempts','UNSIGNED','moment','util','lodash','STRING','name','setDataValue','defaultuser','The\x20name\x20of\x20the\x20user','fullname','callerid','format','getDataValue','internal','email','toLowerCase','ENUM','user','agent','telephone','local','INTEGER','accountcode','BOOLEAN','DATE','dynamic','friend'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xe2ba,0x96));var _0xae2b=function(_0x55e08b,_0x421620){_0x55e08b=_0x55e08b-0x0;var _0xd1a7ff=_0xe2ba[_0x55e08b];return _0xd1a7ff;};'use strict';var Sequelize=require('sequelize');var moment=require(_0xae2b('0x0'));var util=require(_0xae2b('0x1'));var _=require(_0xae2b('0x2'));module['exports']={'name':{'type':Sequelize[_0xae2b('0x3')],'allowNull':![],'unique':_0xae2b('0x4'),'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i},'set':function(_0x426108){this[_0xae2b('0x5')](_0xae2b('0x4'),_0x426108);this[_0xae2b('0x5')](_0xae2b('0x6'),_0x426108);},'comment':_0xae2b('0x7')},'fullname':{'type':Sequelize['STRING'],'allowNull':![],'set':function(_0x344c28){this[_0xae2b('0x5')](_0xae2b('0x8'),_0x344c28);this[_0xae2b('0x5')](_0xae2b('0x9'),util[_0xae2b('0xa')]('\x22%s\x22\x20<%s>',_0x344c28,this[_0xae2b('0xb')](_0xae2b('0xc'))));}},'alias':{'type':Sequelize[_0xae2b('0x3')]},'email':{'type':Sequelize['STRING'],'allowNull':![],'unique':_0xae2b('0xd'),'validate':{'isEmail':!![]},'set':function(_0x1c43ac){if(_0x1c43ac){this[_0xae2b('0x5')](_0xae2b('0xd'),_0x1c43ac[_0xae2b('0xe')]());}}},'role':{'type':Sequelize[_0xae2b('0xf')]('admin',_0xae2b('0x10'),_0xae2b('0x11'),_0xae2b('0x12')),'allowNull':![]},'password':{'type':Sequelize['STRING'],'allowNull':![],'validate':{'notEmpty':!![]}},'provider':{'type':Sequelize[_0xae2b('0x3')],'defaultValue':_0xae2b('0x13')},'internal':{'type':Sequelize[_0xae2b('0x14')](0xb),'allowNull':![],'unique':'internal','set':function(_0x5673d1){this['setDataValue'](_0xae2b('0xc'),_0x5673d1);this[_0xae2b('0x5')](_0xae2b('0x15'),_0x5673d1);this['setDataValue'](_0xae2b('0x9'),util[_0xae2b('0xa')]('\x22%s\x22\x20<%s>',this[_0xae2b('0xb')](_0xae2b('0x8')),_0x5673d1));}},'salt':{'type':Sequelize[_0xae2b('0x3')]},'phone':{'type':Sequelize[_0xae2b('0x3')]},'mobile':{'type':Sequelize[_0xae2b('0x3')]},'address':{'type':Sequelize[_0xae2b('0x3')]},'zipcode':{'type':Sequelize[_0xae2b('0x3')]},'userpic':{'type':Sequelize[_0xae2b('0x3')]},'city':{'type':Sequelize['STRING']},'country':{'type':Sequelize[_0xae2b('0x3')]},'online':{'type':Sequelize[_0xae2b('0x16')],'defaultValue':![]},'lastLoginAt':{'type':Sequelize[_0xae2b('0x17')]},'voicePause':{'type':Sequelize[_0xae2b('0x16')],'defaultValue':![]},'chatPause':{'type':Sequelize[_0xae2b('0x16')],'defaultValue':![]},'mailPause':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'faxPause':{'type':Sequelize[_0xae2b('0x16')],'defaultValue':![]},'smsPause':{'type':Sequelize[_0xae2b('0x16')],'defaultValue':![]},'whatsappPause':{'type':Sequelize[_0xae2b('0x16')],'defaultValue':![]},'openchannelPause':{'type':Sequelize[_0xae2b('0x16')],'defaultValue':![]},'pauseType':{'type':Sequelize[_0xae2b('0x3')],'defaultValue':'DEFAULT\x20PAUSE'},'lastPauseAt':{'type':Sequelize[_0xae2b('0x17')]},'chatCapacity':{'type':Sequelize[_0xae2b('0x14')],'defaultValue':0x0},'mailCapacity':{'type':Sequelize[_0xae2b('0x14')],'defaultValue':0x0},'faxCapacity':{'type':Sequelize[_0xae2b('0x14')],'defaultValue':0x0},'smsCapacity':{'type':Sequelize[_0xae2b('0x14')],'defaultValue':0x0},'whatsappCapacity':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'openchannelCapacity':{'type':Sequelize[_0xae2b('0x14')],'defaultValue':0x0},'phoneBarAutoAnswer':{'type':Sequelize[_0xae2b('0x16')],'defaultValue':![]},'phoneBarEnableSettings':{'type':Sequelize[_0xae2b('0x16')],'defaultValue':!![]},'phoneBarListenPort':{'type':Sequelize[_0xae2b('0x14')](0x5),'defaultValue':0x1428},'phoneBarExpires':{'type':Sequelize[_0xae2b('0x14')](0x5),'defaultValue':0x78},'phoneBarRemoteControl':{'type':Sequelize[_0xae2b('0x16')],'defaultValue':![]},'phoneBarRemoteControlPort':{'type':Sequelize['INTEGER'],'defaultValue':0x26a0},'phoneBarEnableRecording':{'type':Sequelize[_0xae2b('0x16')],'defaultValue':![]},'phoneBarRingInUse':{'type':Sequelize[_0xae2b('0x16')],'defaultValue':![]},'chanspy':{'type':Sequelize[_0xae2b('0x16')],'defaultValue':![]},'description':{'type':Sequelize[_0xae2b('0x3')],'allowNull':!![]},'host':{'type':Sequelize[_0xae2b('0x3')],'allowNull':!![],'defaultValue':_0xae2b('0x18')},'ipaddr':{'type':Sequelize['STRING'],'allowNull':!![]},'port':{'type':Sequelize[_0xae2b('0x14')](0x5),'allowNull':!![]},'regseconds':{'type':Sequelize[_0xae2b('0x14')](0xb),'allowNull':!![]},'fullcontact':{'type':Sequelize[_0xae2b('0x3')],'allowNull':!![]},'regserver':{'type':Sequelize[_0xae2b('0x3')],'allowNull':!![]},'useragent':{'type':Sequelize['STRING'],'allowNull':!![]},'lastms':{'type':Sequelize[_0xae2b('0x14')](0xb),'allowNull':!![]},'type':{'type':Sequelize[_0xae2b('0xf')](_0xae2b('0x19'),'user',_0xae2b('0x1a')),'allowNull':!![],'defaultValue':_0xae2b('0x19')},'context':{'type':Sequelize[_0xae2b('0x3')],'allowNull':!![],'defaultValue':_0xae2b('0x1b')},'callingpres':{'type':Sequelize['ENUM']('ALLOWED_NOT_SCREENED',_0xae2b('0x1c'),_0xae2b('0x1d'),_0xae2b('0x1e'),'PROHIB_NOT_SCREENED',_0xae2b('0x1f'),'PROHIB_FAILED_SCREEN',_0xae2b('0x20')),'allowNull':!![]},'deny':{'type':Sequelize['STRING'],'allowNull':!![]},'permit':{'type':Sequelize[_0xae2b('0x3')],'allowNull':!![]},'secret':{'type':Sequelize[_0xae2b('0x3')],'allowNull':!![]},'md5secret':{'type':Sequelize['STRING'],'allowNull':!![]},'remotesecret':{'type':Sequelize[_0xae2b('0x3')],'allowNull':!![]},'transport':{'type':Sequelize[_0xae2b('0x3')],'allowNull':!![],'defaultValue':_0xae2b('0x21'),'set':function(_0x2aca7d){this[_0xae2b('0x5')](_0xae2b('0x22'),_0x2aca7d?_0x2aca7d[_0xae2b('0x23')](','):null);},'get':function(){return this[_0xae2b('0xb')](_0xae2b('0x22'))?this['getDataValue']('transport')[_0xae2b('0x24')](','):null;},'comment':_0xae2b('0x25')},'dtmfmode':{'type':Sequelize['ENUM'](_0xae2b('0x26'),'info','shortinfo',_0xae2b('0x27'),_0xae2b('0x28')),'allowNull':!![],'defaultValue':'rfc2833'},'directmedia':{'type':Sequelize['ENUM'](_0xae2b('0x29'),'no',_0xae2b('0x2a'),_0xae2b('0x2b'),_0xae2b('0x2c')),'allowNull':!![],'defaultValue':'no'},'directrtpsetup':{'type':Sequelize[_0xae2b('0xf')](_0xae2b('0x29'),'no'),'allowNull':!![],'defaultValue':'no'},'directmediapermit':{'type':Sequelize[_0xae2b('0x3')],'allowNull':!![]},'directmediadeny':{'type':Sequelize['STRING'],'allowNull':!![]},'nat':{'type':Sequelize[_0xae2b('0x3')],'allowNull':!![],'defaultValue':_0xae2b('0x2d'),'set':function(_0x401112){this[_0xae2b('0x5')]('nat',_0x401112?_0x401112[_0xae2b('0x23')](','):null);},'get':function(){return this[_0xae2b('0xb')](_0xae2b('0x2e'))?this[_0xae2b('0xb')]('nat')[_0xae2b('0x24')](','):null;},'comment':_0xae2b('0x2f')},'callgroup':{'type':Sequelize['STRING']},'namedcallgroup':{'type':Sequelize['STRING']},'pickupgroup':{'type':Sequelize['STRING']},'namedpickupgroup':{'type':Sequelize[_0xae2b('0x3')]},'language':{'type':Sequelize[_0xae2b('0x3')],'defaultValue':'en'},'tonezone':{'type':Sequelize['STRING']},'disallow':{'type':Sequelize[_0xae2b('0x3')],'allowNull':![],'defaultValue':_0xae2b('0x30')},'allow':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':_0xae2b('0x31'),'set':function(_0x4a30fc){this['setDataValue'](_0xae2b('0x32'),_0x4a30fc?_0x4a30fc['join'](';'):'ulaw;alaw;gsm');},'get':function(){return this['getDataValue']('allow')?this[_0xae2b('0xb')](_0xae2b('0x32'))[_0xae2b('0x24')](';'):null;},'comment':_0xae2b('0x33')},'autoframing':{'type':Sequelize[_0xae2b('0xf')]('yes','no'),'allowNull':!![]},'insecure':{'type':Sequelize['STRING'],'allowNull':!![],'set':function(_0x294560){this['setDataValue'](_0xae2b('0x34'),_0x294560?_0x294560[_0xae2b('0x23')](','):null);},'get':function(){return this[_0xae2b('0xb')](_0xae2b('0x34'))?this[_0xae2b('0xb')](_0xae2b('0x34'))[_0xae2b('0x24')](','):null;},'comment':_0xae2b('0x35')},'trustrpid':{'type':Sequelize[_0xae2b('0xf')]('yes','no'),'allowNull':!![],'defaultValue':'no'},'trust_id_outbound':{'type':Sequelize['ENUM'](_0xae2b('0x29'),'no'),'allowNull':!![],'defaultValue':'no'},'progressinband':{'type':Sequelize[_0xae2b('0xf')](_0xae2b('0x29'),'no',_0xae2b('0x36')),'allowNull':!![]},'promiscredir':{'type':Sequelize[_0xae2b('0xf')](_0xae2b('0x29'),'no'),'allowNull':!![]},'useclientcode':{'type':Sequelize[_0xae2b('0xf')](_0xae2b('0x29'),'no'),'allowNull':!![]},'accountcode':{'type':Sequelize['INTEGER'](0xb),'allowNull':!![]},'setvar':{'type':Sequelize[_0xae2b('0x3')],'allowNull':!![]},'callerid':{'type':Sequelize[_0xae2b('0x3')],'allowNull':!![],'defaultValue':_0xae2b('0x37')},'amaflags':{'type':Sequelize['STRING'],'allowNull':!![]},'callcounter':{'type':Sequelize[_0xae2b('0xf')](_0xae2b('0x29'),'no'),'allowNull':!![],'defaultValue':_0xae2b('0x29')},'busylevel':{'type':Sequelize[_0xae2b('0x14')](0xb),'allowNull':!![]},'allowoverlap':{'type':Sequelize['ENUM'](_0xae2b('0x29'),'no'),'allowNull':!![]},'allowsubscribe':{'type':Sequelize[_0xae2b('0xf')](_0xae2b('0x29'),'no'),'allowNull':!![]},'allowtransfer':{'type':Sequelize[_0xae2b('0xf')]('yes','no'),'allowNull':!![]},'ignoresdpversion':{'type':Sequelize['ENUM'](_0xae2b('0x29'),'no'),'allowNull':!![]},'subscribecontext':{'type':Sequelize[_0xae2b('0x3')],'allowNull':!![]},'template':{'type':Sequelize[_0xae2b('0x3')],'allowNull':!![]},'videosupport':{'type':Sequelize['ENUM']('yes','no',_0xae2b('0x38')),'allowNull':!![],'defaultValue':'no'},'maxcallbitrate':{'type':Sequelize[_0xae2b('0x14')](0xb),'allowNull':!![]},'rfc2833compensate':{'type':Sequelize[_0xae2b('0xf')](_0xae2b('0x29'),'no'),'allowNull':!![]},'mailbox':{'type':Sequelize[_0xae2b('0x3')],'allowNull':!![]},'session_timers':{'type':Sequelize[_0xae2b('0xf')](_0xae2b('0x39'),_0xae2b('0x3a'),'originate'),'allowNull':!![]},'session_expires':{'type':Sequelize[_0xae2b('0x14')](0xb),'allowNull':!![]},'session_minse':{'type':Sequelize[_0xae2b('0x14')](0xb),'allowNull':!![]},'session_refresher':{'type':Sequelize['ENUM'](_0xae2b('0x3b'),_0xae2b('0x3c')),'allowNull':!![],'defaultValue':_0xae2b('0x3c')},'t38pt_usertpsource':{'type':Sequelize[_0xae2b('0x3')],'allowNull':!![]},'regexten':{'type':Sequelize['STRING'],'allowNull':!![]},'fromdomain':{'type':Sequelize['STRING'],'allowNull':!![]},'fromuser':{'type':Sequelize[_0xae2b('0x3')],'allowNull':!![]},'qualify':{'type':Sequelize['ENUM'](_0xae2b('0x29'),'no'),'allowNull':!![],'defaultValue':_0xae2b('0x29')},'keepalive':{'type':Sequelize[_0xae2b('0x14')](0xb),'allowNull':!![]},'defaultip':{'type':Sequelize[_0xae2b('0x3')],'allowNull':!![]},'defaultuser':{'type':Sequelize[_0xae2b('0x3')],'allowNull':!![]},'rtptimeout':{'type':Sequelize['INTEGER'](0xb),'allowNull':!![]},'rtpholdtimeout':{'type':Sequelize[_0xae2b('0x14')](0xb),'allowNull':!![]},'rtpkeepalive':{'type':Sequelize[_0xae2b('0x14')](0xb),'allowNull':!![]},'sendrpid':{'type':Sequelize[_0xae2b('0xf')]('yes','no'),'allowNull':!![],'defaultValue':'no'},'outboundproxy':{'type':Sequelize[_0xae2b('0x3')],'allowNull':!![]},'callbackextension':{'type':Sequelize[_0xae2b('0x3')],'allowNull':!![]},'timert1':{'type':Sequelize[_0xae2b('0x14')](0xb),'allowNull':!![]},'timerb':{'type':Sequelize[_0xae2b('0x14')](0xb),'allowNull':!![]},'qualifyfreq':{'type':Sequelize['INTEGER'](0xb),'allowNull':!![]},'contactpermit':{'type':Sequelize['STRING'],'allowNull':!![]},'contactdeny':{'type':Sequelize[_0xae2b('0x3')],'allowNull':!![]},'contactacl':{'type':Sequelize[_0xae2b('0x3')],'allowNull':!![]},'unsolicited_mailbox':{'type':Sequelize['STRING'],'allowNull':!![]},'use_q850_reason':{'type':Sequelize['STRING'],'allowNull':!![]},'maxforwards':{'type':Sequelize[_0xae2b('0x14')](0xb),'allowNull':!![]},'encryption':{'type':Sequelize[_0xae2b('0xf')](_0xae2b('0x29'),'no'),'allowNull':!![],'defaultValue':'no'},'avpf':{'type':Sequelize['ENUM'](_0xae2b('0x29'),'no'),'allowNull':!![]},'force_avp':{'type':Sequelize[_0xae2b('0xf')](_0xae2b('0x29'),'no'),'allowNull':!![]},'icesupport':{'type':Sequelize[_0xae2b('0xf')](_0xae2b('0x29'),'no'),'allowNull':!![]},'dtlsenable':{'type':Sequelize[_0xae2b('0xf')](_0xae2b('0x29'),'no'),'allowNull':!![]},'dtlsverify':{'type':Sequelize[_0xae2b('0xf')](_0xae2b('0x29'),'no',_0xae2b('0x3d'),_0xae2b('0x3e')),'allowNull':!![]},'dtlsrekey':{'type':Sequelize[_0xae2b('0x14')](0xb),'allowNull':!![]},'dtlscertfile':{'type':Sequelize[_0xae2b('0x3')],'allowNull':!![]},'dtlsprivatekey':{'type':Sequelize[_0xae2b('0x3')],'allowNull':!![]},'dtlscipher':{'type':Sequelize['STRING'],'allowNull':!![]},'dtlscafile':{'type':Sequelize[_0xae2b('0x3')],'allowNull':!![]},'dtlscapath':{'type':Sequelize[_0xae2b('0x3')],'allowNull':!![]},'dtlssetup':{'type':Sequelize['ENUM']('active','passive',_0xae2b('0x3f')),'allowNull':!![]},'dtlsfingerprint':{'type':Sequelize[_0xae2b('0x3')],'allowNull':!![]},'usereqphone':{'type':Sequelize['ENUM'](_0xae2b('0x29'),'no'),'allowNull':!![],'defaultValue':'no'},'recordonfeature':{'type':Sequelize[_0xae2b('0x3')],'allowNull':!![]},'recordofffeature':{'type':Sequelize[_0xae2b('0x3')],'allowNull':!![]},'call_limit':{'type':Sequelize['INTEGER'](0xb),'allowNull':!![],'defaultValue':0xa},'registertrying':{'type':Sequelize[_0xae2b('0xf')](_0xae2b('0x29'),'no'),'allowNull':!![]},'subscribemwi':{'type':Sequelize[_0xae2b('0xf')](_0xae2b('0x29'),'no'),'allowNull':!![]},'vmexten':{'type':Sequelize[_0xae2b('0x3')],'allowNull':!![]},'mohinterpret':{'type':Sequelize['STRING'],'allowNull':!![]},'mohsuggest':{'type':Sequelize[_0xae2b('0x3')],'allowNull':!![]},'parkinglot':{'type':Sequelize[_0xae2b('0x3')],'allowNull':!![]},'canreinvite':{'type':Sequelize[_0xae2b('0xf')](_0xae2b('0x29'),'no','nonat',_0xae2b('0x2b'),_0xae2b('0x40')),'allowNull':!![],'defaultValue':'no'},'loginInPause':{'type':Sequelize[_0xae2b('0x16')],'defaultValue':![]},'resetPasswordToken':{'type':Sequelize[_0xae2b('0x3')]},'resetPasswordExpires':{'type':Sequelize[_0xae2b('0x17')]},'passwordResetAt':{'type':Sequelize[_0xae2b('0x17')],'defaultValue':null},'previousPasswords':{'type':Sequelize[_0xae2b('0x41')]},'showWebBar':{'type':Sequelize['INTEGER'],'defaultValue':0x0,'set':function(_0x46e167){this[_0xae2b('0x5')](_0xae2b('0x42'),_0x46e167);var _0x214575=this[_0xae2b('0x43')]({'plain':!![]});switch(_0x46e167){case 0x0:case 0x1:var _0x1db2e0=_0x214575['transport']?_['isArray'](_0x214575[_0xae2b('0x22')])?_0x214575['transport']['join']():_0x214575[_0xae2b('0x22')]:_0xae2b('0x21');if(_0x1db2e0==='wss'){_0x1db2e0=_0xae2b('0x21');}this[_0xae2b('0x5')]('transport',_0x1db2e0);this['setDataValue'](_0xae2b('0x44'),'no');this['setDataValue']('avpf',null);this['setDataValue']('force_avp',null);this[_0xae2b('0x5')]('icesupport',null);this[_0xae2b('0x5')](_0xae2b('0x45'),null);this[_0xae2b('0x5')](_0xae2b('0x46'),null);this[_0xae2b('0x5')](_0xae2b('0x47'),null);this[_0xae2b('0x5')]('dtlscertfile',null);this[_0xae2b('0x5')](_0xae2b('0x48'),null);this['setDataValue'](_0xae2b('0x49'),'no');break;case 0x2:this['setDataValue'](_0xae2b('0x22'),_0xae2b('0x4a'));this['setDataValue'](_0xae2b('0x44'),_0xae2b('0x29'));this[_0xae2b('0x5')]('avpf',_0xae2b('0x29'));this[_0xae2b('0x5')]('force_avp',_0xae2b('0x29'));this[_0xae2b('0x5')](_0xae2b('0x4b'),_0xae2b('0x29'));this[_0xae2b('0x5')](_0xae2b('0x45'),_0xae2b('0x29'));this[_0xae2b('0x5')](_0xae2b('0x46'),'no');this[_0xae2b('0x5')](_0xae2b('0x47'),_0xae2b('0x3f'));this[_0xae2b('0x5')](_0xae2b('0x4c'),_0x214575['dtlscertfile']||'/etc/pki/tls/certs/motion.crt');this['setDataValue'](_0xae2b('0x48'),_0x214575[_0xae2b('0x48')]||_0xae2b('0x4d'));this[_0xae2b('0x5')](_0xae2b('0x49'),_0xae2b('0x29'));break;default:}}},'permissions':{'type':Sequelize[_0xae2b('0x41')],'set':function(_0x64500){this[_0xae2b('0x5')](_0xae2b('0x4e'),_0x64500?_0x64500['join'](','):[]);},'get':function(){return this[_0xae2b('0xb')](_0xae2b('0x4e'))?_[_0xae2b('0x4f')](this[_0xae2b('0xb')](_0xae2b('0x4e'))['split'](','),function(_0x3d9f0d){return parseInt(_0x3d9f0d,0xa);}):[];}},'phoneBarUnconditionalNumber':{'type':Sequelize[_0xae2b('0x3')]},'phoneBarNoReplyNumber':{'type':Sequelize[_0xae2b('0x3')]},'phoneBarBusyNumber':{'type':Sequelize[_0xae2b('0x3')]},'phoneBarUnconditional':{'type':Sequelize[_0xae2b('0x16')],'defaultValue':![]},'phoneBarNoReply':{'type':Sequelize[_0xae2b('0x16')],'defaultValue':![]},'phoneBarBusy':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'phoneBarDnd':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'phoneBarUnansweredCallBadge':{'type':Sequelize[_0xae2b('0x16')],'defaultValue':!![]},'phoneBarEnableDtmfTone':{'type':Sequelize[_0xae2b('0x16')],'defaultValue':![]},'phoneBarAutoAnswerDelay':{'type':Sequelize[_0xae2b('0x14')],'defaultValue':0x0},'extensionMonitor':{'type':Sequelize[_0xae2b('0x3')],'defaultValue':''},'crudPermissions':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'rtcp_mux':{'type':Sequelize[_0xae2b('0xf')](_0xae2b('0x29'),'no'),'defaultValue':'no'},'allowmessenger':{'type':Sequelize[_0xae2b('0x16')],'defaultValue':!![]},'phoneBarOutboundProxy':{'type':Sequelize[_0xae2b('0x3')]},'phoneBarEnableJaws':{'type':Sequelize[_0xae2b('0x16')],'defaultValue':![]},'phoneBarEnableScreenRecordingByAgent':{'type':Sequelize[_0xae2b('0x16')],'defaultValue':![]},'phoneBarEnableVideoRecording':{'type':Sequelize[_0xae2b('0x50')],'get':function(){return this[_0xae2b('0xb')](_0xae2b('0x51'))?this[_0xae2b('0xb')](_0xae2b('0x51')):![];}},'phoneBarEnableAutomaticScreenRecording':{'type':Sequelize[_0xae2b('0x16')],'defaultValue':![]},'phoneBarPrefixRequired':{'type':Sequelize[_0xae2b('0x16')],'defaultValue':![]},'hotdesk':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'interface':{'type':Sequelize['STRING'],'defaultValue':null},'privacyEnabled':{'type':Sequelize[_0xae2b('0x16')],'defaultValue':![]},'apiKeyNonce':{'type':Sequelize['STRING'],'allowNull':!![]},'apiKeyIat':{'type':Sequelize[_0xae2b('0x3')],'allowNull':!![]},'screenrecording':{'type':Sequelize[_0xae2b('0x16')],'defaultValue':![],'set':function(_0xfc8eab){if(typeof _0xfc8eab===_0xae2b('0x52')){var _0x2031fb=_0xfc8eab==='1'?!![]:_0xfc8eab==='0'?![]:_0xfc8eab===_0xae2b('0x53')?!![]:_0xfc8eab==='false'?![]:![];this[_0xae2b('0x5')](_0xae2b('0x54'),_0x2031fb);}else{this['setDataValue'](_0xae2b('0x54'),_0xfc8eab);}}},'blocked':{'type':Sequelize[_0xae2b('0x16')],'defaultValue':![],'set':function(_0x521bda){this['setDataValue']('blocked',_0x521bda);if(_0x521bda===!![]){this[_0xae2b('0x5')](_0xae2b('0x55'),moment());this[_0xae2b('0x5')](_0xae2b('0x56'),0x0);}else{this[_0xae2b('0x5')]('blockedAt',null);}}},'blockedAt':{'type':Sequelize[_0xae2b('0x17')],'defaultValue':null},'loginAttempts':{'type':Sequelize[_0xae2b('0x14')],'defaultValue':0x0},'disabled':{'type':Sequelize[_0xae2b('0x16')],'defaultValue':![]},'settingsEnabled':{'type':Sequelize[_0xae2b('0x16')],'defaultValue':!![]},'wssPort':{'type':Sequelize['INTEGER'](0x5)[_0xae2b('0x57')],'defaultValue':0x1f99},'downloadAttachments':{'type':Sequelize[_0xae2b('0x16')],'defaultValue':!![]},'downloadOmnichannelInteractions':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'downloadVoiceRecordings':{'type':Sequelize[_0xae2b('0x16')],'defaultValue':!![]},'ignorePauseForPreviewCalls':{'type':Sequelize[_0xae2b('0x16')],'defaultValue':![]},'selectRecallMeCampaign':{'type':Sequelize[_0xae2b('0x16')],'defaultValue':![]},'adSsoEnabled':{'type':Sequelize[_0xae2b('0x16')],'defaultValue':![]},'chatAutoanswer':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'chatAutoanswerDelay':{'type':Sequelize[_0xae2b('0x14')],'defaultValue':0x0},'emailAutoanswer':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'emailAutoanswerDelay':{'type':Sequelize[_0xae2b('0x14')],'defaultValue':0x0},'smsAutoanswer':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'smsAutoanswerDelay':{'type':Sequelize[_0xae2b('0x14')],'defaultValue':0x0},'openchannelAutoanswer':{'type':Sequelize[_0xae2b('0x16')],'defaultValue':![]},'openchannelAutoanswerDelay':{'type':Sequelize[_0xae2b('0x14')],'defaultValue':0x0},'faxAutoanswer':{'type':Sequelize[_0xae2b('0x16')],'defaultValue':![]},'faxAutoanswerDelay':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'whatsappAutoanswer':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'whatsappAutoanswerDelay':{'type':Sequelize[_0xae2b('0x14')],'defaultValue':0x0},'messengerSoundNotification':{'type':Sequelize[_0xae2b('0x16')],'defaultValue':![]}}; \ No newline at end of file diff --git a/server/api/user/user.controller.js b/server/api/user/user.controller.js index b0c29a6..c22f8be 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 _0x39fc=['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','removeOpenchannelInteractions','user_has_openchannel_interactions:remove','addWhatsappInteractions','user_has_whatsapp_interactions:save','removeWhatsappInteractions','getVoicePrefixes','VoicePrefix','getFaxAccounts','addFaxAccounts','removeFaxAccounts','getMailAccounts','MailAccount','addMailAccounts','removeMailAccounts','OpenchannelAccount','getOpenchannelAccounts','addOpenchannelAccounts','removeOpenchannelAccounts','getSmsAccounts','SmsAccount','addSmsAccounts','getChatWebsites','removeChatWebsites','getWhatsappAccounts','WhatsappAccount','addWhatsappAccounts','removeWhatsappAccounts','getScheduledCalls','CmHopper','$or','$gt','$gte','$lte','$ne','$not','$between','$notBetween','$in','$notIn','$like','$notLike','$notILike','$overlap','$contains','$contained','firstName','lastName','CmContact','Contact','dialActive','getApiKey','token','You\x20don\x27t\x20have\x20sufficient\x20privileges\x20to\x20access\x20this\x20resource.','createApiKey','generateApiKey','iat','removeApiKey','apiKeyNonce','apiKeyIat','API\x20key\x20not\x20available','whoami','getUserSetting','idle','unknown','inbound','toString','lower','col','asc','orderBy','getRealtimeAgents','offline','unavailable','voiceStatus','busy','slice','charAt','toUpperCase','select','field','ui.','InteractionId','ui.createdAt','user_has_','_interactions','ui.UserId\x20=\x20?','OpenTabs','messengerSoundNotification','moment','util','path','lodash','squel','ioredis','../../components/realtime/agents','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../errors/api','APINotFoundError','handleError','socket.io-emitter','redis','defaults','localhost','status','end','json','offset','limit','undefined','count','set','Content-Range','update','role','agent','userNotification:recalc:','get','admin','Users','user','Telephones','telephone','filter','ignore','map','value','includes','find','name','UserProfileResource','destroy','then','sendStatus','error','stack','send','User','rawAttributes','fieldName','type','key','password','salt','previousPasswords','resetPasswordToken','resetPasswordExpires','md5secret','index','getOptions','where','query','includeAll','include','userSetting','UserSetting','push','findAll','rows','openTabs','true','length','chat','dataValues','sms','openchannel','whatsapp','all','catch','show','merge','options','attributes','fax','mail','body','describe','addContacts','ids','Setting','findById','securePassword','validatePasswordPattern','internal','isNil','min_internal','sequelize','select\x20(select\x20IFNULL(max(internal)+1,1)\x20from\x20users\x20where\x20internal\x20<\x20md.internal)\x20as\x20\x27from\x27,\x20md.internal\x20-\x201\x20as\x20\x27to\x27\x20from\x20users\x20md\x20where\x20md.internal\x20!=\x201\x20and\x20not\x20exists\x20(select\x201\x20from\x20users\x20md2\x20where\x20md2.internal\x20=\x20md.internal\x20-\x201)','SELECT','from','mailbox','fullname','permissions','101','102','113','110','104','105','106','107','108','109','100','111','create','Unauthorized','Unauthorized.\x20You\x20must\x20be\x20an\x20administrator\x20in\x20order\x20to\x20create\x20an\x20user','checkUserLimits','settingsEnabled','userProfileId','Agents','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','VoiceMail','UserProfileSection','autoAssociation','compact','params','newPassword','Sequelize','ValidationError','authenticate','oldPassword','New\x20password\x20must\x20be\x20different\x20from\x20old\x20password','Invalid\x20body\x20format.\x20Use\x20newPassword','enforcePasswordHistory','passwordHistoryLimit','updatePasswordsHistory','addQueues','channel','loginInPause','voicePause','interface','isValidChannel','add','capitalize','toLowerCase','Queues','penalty','spread','emit','Queue:save','voice','VoiceQueue','online','format','UserVoiceQueueRt','upsert','Unknown\x20channel','remove','QueueId','Queue:remove','addAvatar','userpic','file','getAvatar','root','existsSync','join','server/files/images/','download','ChatOpenTabs','CHAT','FaxOpenTabs','FAX','createdAt','OPENCHANNEL','MAIL','SmsOpenTabs','SMS','WhatsappOpenTabs','WHATSAPP','concat','getContacts','findOne','User\x20with\x20id\x20%s\x20not\x20found','hasOwnProperty','CmList','List','Tag','Tags','color','tag','getQueues','model','Queue','keys','filters','intersection','fields','order','sort','pick','Unknown\x20role','nolimit','getVoiceQueuesRt','getGroups','ChatGroup','VoiceRecording','UserId','ScreenRecording','getChatInteractions','ChatInteraction','getOpenchannelInteractions','OpenchannelInteraction','getMailInteractions','MailInteraction','SmsInteraction','getSmsInteractions','getFaxInteractions','getWhatsappInteractions','login','phone','mobile','LOCAL/%s@from-sip/n','intrf','SIP/%s','user:%s','headers','x-forwarded-for','connection','remoteAddress','socket','User\x20not\x20found\x20or\x20not\x20allowed\x20to\x20perform\x20login\x20method','UserVoiceQueue.penalty','MemberReport','YYYY-MM-DD\x20HH:mm:ss','getChannels','LOGIN','device','PAUSE','LOGININPAUSE','logout','forEach','pause','DEFAULT\x20PAUSE','unpause','Channel\x20parameter\x20%s\x20is\x20invalid','mailPause','faxPause','openchannelPause','lastPauseAt','getTeams','addTeams','resolve','Body\x20parameter\x20\x27ids\x27\x20is\x20required','transaction','Team','addAgent','getDataValue','TeamVoicePrefix','UserVoicePrefix','VoicePrefixId','removeTeams','isArray','Query\x20parameter\x20\x27ids\x27\x20is\x20required','getAssociatedQueues','flattenDeep','removeAgent','Voice','getLists','getAgents','getVoiceQueues','You\x20can\x27t\x20delete\x20yourself','addChatInteractions','omit','user_has_chat_interactions:save','removeChatInteractions','user_has_chat_interactions:remove','addMailInteractions'];(function(_0xd0fa2b,_0x3ec5b3){var _0x5eb5af=function(_0x4ba8b1){while(--_0x4ba8b1){_0xd0fa2b['push'](_0xd0fa2b['shift']());}};_0x5eb5af(++_0x3ec5b3);}(_0x39fc,0x64));var _0xc39f=function(_0x3ee55a,_0x19aeea){_0x3ee55a=_0x3ee55a-0x0;var _0x581800=_0x39fc[_0x3ee55a];return _0x581800;};'use strict';var moment=require(_0xc39f('0x0'));var util=require(_0xc39f('0x1'));var path=require(_0xc39f('0x2'));var fs=require('fs');var _=require(_0xc39f('0x3'));var squel=require(_0xc39f('0x4'));var Redis=require(_0xc39f('0x5'));var authService=require('../../components/auth/service');var contacts=require('../../components/contacts');var qs=require('../../components/parsers/qs');var rta=require(_0xc39f('0x6'));var logger=require(_0xc39f('0x7'))('api');var utils=require(_0xc39f('0x8'));var config=require(_0xc39f('0x9'));var licenseUtil=require(_0xc39f('0xa'));var APIBadRequestError=require(_0xc39f('0xb'))['APIBadRequestError'];var APINotFoundError=require(_0xc39f('0xb'))[_0xc39f('0xc')];var APIHandleError=require(_0xc39f('0xb'))[_0xc39f('0xd')];var db=require('../../mysqldb')['db'];var socket=require(_0xc39f('0xe'))(new Redis(config[_0xc39f('0xf')]));require('./user.socket')['register'](socket);config[_0xc39f('0xf')]=_[_0xc39f('0x10')](config[_0xc39f('0xf')],{'host':_0xc39f('0x11'),'port':0x18eb});var values;function respondWithStatusCode(_0x55c500,_0x366e28){_0x366e28=_0x366e28||0xcc;return function(_0x18b9e4){if(_0x18b9e4){return _0x55c500['sendStatus'](_0x366e28);}return _0x55c500[_0xc39f('0x12')](_0x366e28)[_0xc39f('0x13')]();};}function respondWithResult(_0x4635d4,_0x1a0e97){_0x1a0e97=_0x1a0e97||0xc8;return function(_0x900cb6){if(_0x900cb6){return _0x4635d4[_0xc39f('0x12')](_0x1a0e97)[_0xc39f('0x14')](_0x900cb6);}};}function respondWithFilteredResult(_0x3548ed,_0xb5d900){return function(_0x19181b){if(_0x19181b){var _0x1f0c22=typeof _0xb5d900[_0xc39f('0x15')]==='undefined'&&typeof _0xb5d900[_0xc39f('0x16')]===_0xc39f('0x17');var _0x25c5e7=_0x19181b['count'];var _0xb1f994=_0x1f0c22?0x0:_0xb5d900[_0xc39f('0x15')];var _0x4ba7d3=_0x1f0c22?_0x19181b[_0xc39f('0x18')]:_0xb5d900[_0xc39f('0x15')]+_0xb5d900[_0xc39f('0x16')];var _0x5ba91a;if(_0x4ba7d3>=_0x25c5e7){_0x4ba7d3=_0x25c5e7;_0x5ba91a=0xc8;}else{_0x5ba91a=0xce;}_0x3548ed[_0xc39f('0x12')](_0x5ba91a);return _0x3548ed[_0xc39f('0x19')](_0xc39f('0x1a'),_0xb1f994+'-'+_0x4ba7d3+'/'+_0x25c5e7)['json'](_0x19181b);}return null;};}function saveUpdates(_0x353f12){return function(_0x1b644b){if(_0x1b644b){return _0x1b644b[_0xc39f('0x1b')](_0x353f12)['then'](function(_0x6f89b7){if(_0x6f89b7[_0xc39f('0x1c')]===_0xc39f('0x1d')){socket['emit'](_0xc39f('0x1e')+_0x6f89b7['id'],_0x6f89b7);}return _0x6f89b7;});}return null;};}function removeEntity(_0x2f8e09){return function(_0x163c1e){if(_0x163c1e){return _0x163c1e['destroy']()['then'](function(){var _0x4ef54c=_0x163c1e[_0xc39f('0x1f')]({'plain':!![]});if(_0x4ef54c[_0xc39f('0x1c')]===_0xc39f('0x20'))return;var _0x4b3162=[{'name':_0xc39f('0x21'),'value':_0xc39f('0x22'),'ignore':!![]},{'name':'Agents','value':_0xc39f('0x1d'),'ignore':![]},{'name':_0xc39f('0x23'),'value':_0xc39f('0x24'),'ignore':![]}];var _0x2cd243=_(_0x4b3162)[_0xc39f('0x25')](_0xc39f('0x26'))[_0xc39f('0x27')](_0xc39f('0x28'))[_0xc39f('0x28')]();if(_[_0xc39f('0x29')](_0x2cd243,_0x4ef54c['role'])){return;}var _0x9920d0=_[_0xc39f('0x2a')](_0x4b3162,[_0xc39f('0x28'),_0x4ef54c[_0xc39f('0x1c')]])[_0xc39f('0x2b')];return db[_0xc39f('0x2c')][_0xc39f('0x2d')]({'where':{'type':_0x9920d0,'resourceId':_0x4ef54c['id']}})[_0xc39f('0x2e')](function(){return _0x163c1e;});})[_0xc39f('0x2e')](function(){_0x2f8e09[_0xc39f('0x12')](0xcc)['end']();});}};}function handleEntityNotFound(_0x3ff502){return function(_0x25adef){if(!_0x25adef){_0x3ff502[_0xc39f('0x2f')](0x194);}return _0x25adef;};}function handleError(_0x3b827f,_0x3e5bdf){_0x3e5bdf=_0x3e5bdf||0x1f4;return function(_0x2628a7){logger[_0xc39f('0x30')](_0x2628a7[_0xc39f('0x31')]);if(_0x2628a7[_0xc39f('0x2b')]){delete _0x2628a7[_0xc39f('0x2b')];}_0x3b827f['status'](_0x3e5bdf)[_0xc39f('0x32')](_0x2628a7);};}function getUserAttributes(){return _(db[_0xc39f('0x33')][_0xc39f('0x34')])[_0xc39f('0x27')](function(_0x3f173a){return{'name':_0x3f173a[_0xc39f('0x35')],'type':_0x3f173a[_0xc39f('0x36')][_0xc39f('0x37')]};})[_0xc39f('0x25')](function(_0x4efcd8){return![_0xc39f('0x38'),_0xc39f('0x39'),_0xc39f('0x3a'),_0xc39f('0x3b'),_0xc39f('0x3c'),_0xc39f('0x3d')][_0xc39f('0x29')](_0x4efcd8['name']);})['value']();}exports[_0xc39f('0x3e')]=function(_0x1eeee5,_0x109520){var _0x24cdcd={},_0x3f1a54={'count':0x0,'rows':[]};var _0x4e172f=getUserAttributes();_0x24cdcd=qs[_0xc39f('0x3f')](_0x4e172f,_0x1eeee5);var _0x14a97e={'where':_0x24cdcd[_0xc39f('0x40')]};return db['User']['count'](_0x14a97e)['then'](function(_0x956e2c){_0x3f1a54[_0xc39f('0x18')]=_0x956e2c;if(_0x1eeee5[_0xc39f('0x41')][_0xc39f('0x42')]){_0x24cdcd[_0xc39f('0x43')]=[{'all':!![]}];}if(_0x1eeee5[_0xc39f('0x41')][_0xc39f('0x44')]==='true'){_0x24cdcd[_0xc39f('0x43')]=[{'model':db[_0xc39f('0x45')],'as':'userSetting'}];}if(!_[_0xc39f('0x29')](_0x24cdcd['attributes'],'id')){_0x24cdcd['attributes'][_0xc39f('0x46')]('id');}return db[_0xc39f('0x33')][_0xc39f('0x47')](_0x24cdcd);})[_0xc39f('0x2e')](function(_0x52b7f1){_0x3f1a54[_0xc39f('0x48')]=_0x52b7f1;if(_0x1eeee5[_0xc39f('0x41')][_0xc39f('0x49')]===_0xc39f('0x4a')){var _0x548d69=[];for(var _0x555008=0x0;_0x555008<_0x3f1a54[_0xc39f('0x48')][_0xc39f('0x4b')];_0x555008++){_0x548d69[_0xc39f('0x46')](get_open_tabs(_0xc39f('0x4c'),_0x3f1a54[_0xc39f('0x48')][_0x555008][_0xc39f('0x4d')]));_0x548d69[_0xc39f('0x46')](get_open_tabs(_0xc39f('0x4e'),_0x3f1a54[_0xc39f('0x48')][_0x555008][_0xc39f('0x4d')]));_0x548d69[_0xc39f('0x46')](get_open_tabs('fax',_0x3f1a54[_0xc39f('0x48')][_0x555008][_0xc39f('0x4d')]));_0x548d69['push'](get_open_tabs('mail',_0x3f1a54[_0xc39f('0x48')][_0x555008][_0xc39f('0x4d')]));_0x548d69[_0xc39f('0x46')](get_open_tabs(_0xc39f('0x4f'),_0x3f1a54[_0xc39f('0x48')][_0x555008]['dataValues']));_0x548d69['push'](get_open_tabs(_0xc39f('0x50'),_0x3f1a54[_0xc39f('0x48')][_0x555008]['dataValues']));}return Promise[_0xc39f('0x51')](_0x548d69)[_0xc39f('0x2e')](function(){return _0x3f1a54;});}else{return _0x3f1a54;}})[_0xc39f('0x2e')](respondWithFilteredResult(_0x109520,_0x24cdcd))[_0xc39f('0x52')](handleError(_0x109520,null));};exports[_0xc39f('0x53')]=function(_0x543af4,_0x5a3b46){var _0x3bfca0=getUserAttributes();_0x543af4[_0xc39f('0x41')]['id']=_0x543af4['params']['id'];var _0x1a0e92=qs[_0xc39f('0x3f')](_0x3bfca0,_0x543af4);if(_0x543af4[_0xc39f('0x41')][_0xc39f('0x42')]){_0x1a0e92[_0xc39f('0x43')]=[{'all':!![]}];}if(_0x543af4[_0xc39f('0x41')][_0xc39f('0x44')]==='true'){_0x1a0e92[_0xc39f('0x43')]=[{'model':db[_0xc39f('0x45')],'as':_0xc39f('0x44')}];}_0x1a0e92=_[_0xc39f('0x54')]({},_0x1a0e92,_0x543af4[_0xc39f('0x55')]);if(!_['includes'](_0x1a0e92[_0xc39f('0x56')],'id')){_0x1a0e92[_0xc39f('0x56')]['push']('id');}return db['User'][_0xc39f('0x2a')](_0x1a0e92)[_0xc39f('0x2e')](handleEntityNotFound(_0x5a3b46,null))[_0xc39f('0x2e')](function(_0x568b70){var _0x447ff8=[];values=_0x568b70;if(_0x543af4[_0xc39f('0x41')][_0xc39f('0x49')]===_0xc39f('0x4a')){_0x447ff8['push'](get_open_tabs(_0xc39f('0x4c'),_0x568b70['dataValues']));_0x447ff8[_0xc39f('0x46')](get_open_tabs('sms',_0x568b70['dataValues']));_0x447ff8[_0xc39f('0x46')](get_open_tabs('openchannel',_0x568b70[_0xc39f('0x4d')]));_0x447ff8['push'](get_open_tabs('whatsapp',_0x568b70['dataValues']));_0x447ff8['push'](get_open_tabs(_0xc39f('0x57'),_0x568b70[_0xc39f('0x4d')]));_0x447ff8[_0xc39f('0x46')](get_open_tabs(_0xc39f('0x58'),_0x568b70[_0xc39f('0x4d')]));return Promise['all'](_0x447ff8);}else{return values;}})['then'](function(){return values;})[_0xc39f('0x2e')](respondWithResult(_0x5a3b46,null))[_0xc39f('0x52')](handleError(_0x5a3b46,null));};exports['update']=function(_0x4758b1,_0x384226){if(_0x4758b1[_0xc39f('0x59')]['id']){delete _0x4758b1[_0xc39f('0x59')]['id'];}delete _0x4758b1['body'][_0xc39f('0x1c')];return db[_0xc39f('0x33')][_0xc39f('0x2a')]({'where':{'id':_0x4758b1['params']['id']}})['then'](handleEntityNotFound(_0x384226,null))[_0xc39f('0x2e')](saveUpdates(_0x4758b1['body'],null))[_0xc39f('0x2e')](respondWithResult(_0x384226,null))[_0xc39f('0x52')](handleError(_0x384226,null));};exports[_0xc39f('0x5a')]=function(_0x7f175f,_0x4042a0){return db[_0xc39f('0x33')][_0xc39f('0x5a')]()[_0xc39f('0x2e')](respondWithResult(_0x4042a0,null))[_0xc39f('0x52')](handleError(_0x4042a0,null));};exports[_0xc39f('0x5b')]=function(_0x3c5715,_0x35332c){return db[_0xc39f('0x33')]['find']({'where':{'id':_0x3c5715['params']['id']}})[_0xc39f('0x2e')](handleEntityNotFound(_0x35332c,null))[_0xc39f('0x2e')](function(_0x1aff94){if(_0x1aff94){return _0x1aff94[_0xc39f('0x5b')](_0x3c5715[_0xc39f('0x59')][_0xc39f('0x5c')],_['omit'](_0x3c5715[_0xc39f('0x59')],[_0xc39f('0x5c'),'id'])||{});}})[_0xc39f('0x2e')](respondWithResult(_0x35332c,null))[_0xc39f('0x52')](handleError(_0x35332c,null));};function validateUser(_0x38766c){return new Promise(function(_0x5384a0,_0x4d59a4){if(_0x38766c['internal'])return _0x5384a0(_0x38766c);return db[_0xc39f('0x5d')][_0xc39f('0x5e')](0x1)[_0xc39f('0x2e')](function(_0x1b7ae1){if(_0x1b7ae1[_0xc39f('0x5f')])authService[_0xc39f('0x60')](_0x38766c['password']);db['User']['max'](_0xc39f('0x61'))[_0xc39f('0x2e')](function(_0x23951e){if(_[_0xc39f('0x62')](_0x23951e)){_0x38766c[_0xc39f('0x61')]=_0x1b7ae1[_0xc39f('0x63')]||0x1;return;}if(_[_0xc39f('0x62')](_0x1b7ae1[_0xc39f('0x63')])||_0x1b7ae1[_0xc39f('0x63')]===_0x23951e){_0x38766c['internal']=_0x23951e+0x1;return;}if(_0x1b7ae1[_0xc39f('0x63')]>_0x23951e){_0x38766c['internal']=_0x1b7ae1[_0xc39f('0x63')];return;}return db[_0xc39f('0x64')][_0xc39f('0x41')](_0xc39f('0x65'),{'type':db[_0xc39f('0x64')]['QueryTypes'][_0xc39f('0x66')]})[_0xc39f('0x2e')](function(_0x562bc3){if(_0x562bc3&&_0x562bc3[_0xc39f('0x4b')]){for(var _0x3e6c42=0x0,_0x3e84cc=_0x562bc3[_0xc39f('0x4b')];_0x3e6c42<_0x3e84cc&&_[_0xc39f('0x62')](_0x38766c[_0xc39f('0x61')]);_0x3e6c42++){if(_0x1b7ae1[_0xc39f('0x63')]<=_0x562bc3[_0x3e6c42][_0xc39f('0x67')]){_0x38766c[_0xc39f('0x61')]=_0x562bc3[_0x3e6c42][_0xc39f('0x67')];}else if(_0x1b7ae1[_0xc39f('0x63')]>_0x562bc3[_0x3e6c42][_0xc39f('0x67')]&&_0x1b7ae1[_0xc39f('0x63')]<=_0x562bc3[_0x3e6c42]['to']){_0x38766c[_0xc39f('0x61')]=_0x1b7ae1[_0xc39f('0x63')];}}}if(_[_0xc39f('0x62')](_0x38766c[_0xc39f('0x61')])){_0x38766c[_0xc39f('0x61')]=_0x23951e+0x1;}return _0x5384a0(_0x38766c);});});})[_0xc39f('0x52')](function(_0x3c9f81){_0x4d59a4(_0x3c9f81);});});}function updateUser(_0x352463){return new Promise(function(_0x24f92e,_0x137701){try{if(_0x352463['voicemail']){_0x352463[_0xc39f('0x68')]=_0x352463[_0xc39f('0x61')];_0x352463['VoiceMail']={'mailbox':_0x352463['internal'],'password':_0x352463['password'],'fullname':_0x352463[_0xc39f('0x69')],'email':_0x352463['email']};}if(_0x352463['role']==='agent'){if(!_0x352463[_0xc39f('0x6a')])_0x352463['permissions']=[_0xc39f('0x6b'),_0xc39f('0x6c'),'103',_0xc39f('0x6d'),_0xc39f('0x6e'),_0xc39f('0x6f'),_0xc39f('0x70'),_0xc39f('0x71'),_0xc39f('0x72'),_0xc39f('0x73'),_0xc39f('0x74'),_0xc39f('0x75'),_0xc39f('0x76'),'114','115'];}_0x24f92e(_0x352463);}catch(_0x2e0110){_0x137701(_0x2e0110);}});}exports[_0xc39f('0x77')]=function(_0x316eb1,_0x4c6dd1){if(_0x316eb1[_0xc39f('0x22')]['role']===_0xc39f('0x1d'))throw new Error(_0xc39f('0x78'));if(_0x316eb1[_0xc39f('0x59')]['role']===_0xc39f('0x22')&&_0x316eb1['user'][_0xc39f('0x1c')]!==_0xc39f('0x20')){throw new Error(_0xc39f('0x79'));}if(_0x316eb1[_0xc39f('0x59')][_0xc39f('0x1c')]===_0xc39f('0x20')&&_0x316eb1[_0xc39f('0x22')][_0xc39f('0x1c')]!==_0xc39f('0x20')){throw new Error('Unauthorized.\x20You\x20must\x20be\x20an\x20administrator\x20in\x20order\x20to\x20create\x20another\x20administrator');}return licenseUtil[_0xc39f('0x7a')]([_0x316eb1['body']])['then'](function(){return validateUser(_0x316eb1[_0xc39f('0x59')]);})['then'](function(_0x25d397){return updateUser(_0x25d397)['then'](function(_0x49183b){if(_0x49183b[_0xc39f('0x1c')]==='admin'){_0x49183b[_0xc39f('0x7b')]=_0x316eb1[_0xc39f('0x22')]['settingsEnabled'];delete _0x49183b[_0xc39f('0x7c')];}return _0x49183b;});})['then'](function(_0x1278eb){return db[_0xc39f('0x33')]['create'](_0x1278eb,{'include':[{'model':db['VoiceMail'],'as':'VoiceMail'}]});})[_0xc39f('0x2e')](function(_0xe28b73){if(_0x316eb1[_0xc39f('0x59')][_0xc39f('0x1c')]==='user')return _0xe28b73;if(_0x316eb1[_0xc39f('0x22')][_0xc39f('0x1c')]!==_0xc39f('0x22'))return _0xe28b73;return db['UserProfileSection'][_0xc39f('0x2a')]({'where':{'name':_0xe28b73['role']===_0xc39f('0x1d')?_0xc39f('0x7d'):'Telephones','userProfileId':_0x316eb1[_0xc39f('0x22')][_0xc39f('0x7c')]},'raw':!![]})['then'](function(_0x5165a2){if(!_0x5165a2||_0x5165a2['autoAssociation']!=0x0)return _0xe28b73;return db[_0xc39f('0x2c')][_0xc39f('0x77')]({'name':_0xe28b73[_0xc39f('0x2b')],'resourceId':_0xe28b73['id'],'type':_0x5165a2[_0xc39f('0x2b')],'sectionId':_0x5165a2['id']},{})['then'](function(){return _0xe28b73;});})[_0xc39f('0x52')](function(_0x2f49d9){logger['error'](_0xc39f('0x7e'),_0x2f49d9);throw _0x2f49d9;});})[_0xc39f('0x2e')](respondWithResult(_0x4c6dd1,0xc9))['catch'](handleError(_0x4c6dd1,null));};exports[_0xc39f('0x7f')]=function(_0x41dd52,_0x1343cf){var _0x29cf94=_0x41dd52[_0xc39f('0x59')];var _0x239639=[];if(_0x41dd52['user'][_0xc39f('0x1c')]===_0xc39f('0x1d'))throw new Error('Unauthorized');if(_['some'](_0x29cf94,[_0xc39f('0x1c'),_0xc39f('0x22')])&&_0x41dd52[_0xc39f('0x22')]['role']!==_0xc39f('0x20')){throw new Error(_0xc39f('0x79'));}if(_[_0xc39f('0x80')](_0x29cf94,[_0xc39f('0x1c'),_0xc39f('0x20')])&&_0x41dd52['user'][_0xc39f('0x1c')]!=='admin'){throw new Error(_0xc39f('0x81'));}return licenseUtil[_0xc39f('0x7a')](_0x29cf94)[_0xc39f('0x2e')](function(){return validateUser(_0x29cf94[0x0]);})[_0xc39f('0x2e')](function(){for(var _0x111684=0x1;_0x111684<_0x29cf94[_0xc39f('0x4b')];_0x111684++){var _0x2b97a6=_0x29cf94[_0x111684-0x1][_0xc39f('0x61')];if(!_0x29cf94[_0x111684][_0xc39f('0x61')])_0x29cf94[_0x111684][_0xc39f('0x61')]=_0x2b97a6+0x1;_0x239639[_0xc39f('0x46')](validateUser(_0x29cf94[_0x111684]));}return Promise[_0xc39f('0x51')](_0x239639);})[_0xc39f('0x2e')](function(){_0x239639=[];for(var _0x3b14de=0x0;_0x3b14de<_0x29cf94[_0xc39f('0x4b')];_0x3b14de++){_0x239639[_0xc39f('0x46')](updateUser(_0x29cf94[_0x3b14de]));}return Promise[_0xc39f('0x51')](_0x239639);})[_0xc39f('0x2e')](function(){_0x239639=_0x29cf94['map'](function(_0x6afe2c){return db['User']['create'](_0x6afe2c,{'include':[{'model':db['VoiceMail'],'as':_0xc39f('0x82')}]})[_0xc39f('0x2e')](function(_0x4c7608){_0x6afe2c['id']=_0x4c7608['id'];return _0x6afe2c;});});return Promise[_0xc39f('0x51')](_0x239639);})[_0xc39f('0x2e')](function(_0x133e63){if(_0x41dd52['body']['role']===_0xc39f('0x22'))return _0x133e63;if(_0x41dd52[_0xc39f('0x22')][_0xc39f('0x1c')]!==_0xc39f('0x22'))return _0x133e63;var _0x3ea1b0=_[_0xc39f('0x80')](_0x133e63,function(_0x3fe807){return _0x3fe807[_0xc39f('0x1c')]===_0xc39f('0x1d')||_0x3fe807[_0xc39f('0x1c')]===_0xc39f('0x24');});if(!_0x3ea1b0)return _0x133e63;return db[_0xc39f('0x83')][_0xc39f('0x47')]({'where':{'name':{'$or':[_0xc39f('0x7d'),_0xc39f('0x23')]},'userProfileId':_0x41dd52[_0xc39f('0x22')][_0xc39f('0x7c')]},'raw':!![]})[_0xc39f('0x2e')](function(_0x3a8c82){if(_['isEmpty'](_0x3a8c82)||!_[_0xc39f('0x80')](_0x3a8c82,[_0xc39f('0x84'),0x0]))return _0x133e63;_0x239639=[];var _0x3b629c=_(_0x3a8c82)[_0xc39f('0x27')](function(_0x425d80){if(_0x425d80['autoAssociation']===0x1)return;return _0x425d80[_0xc39f('0x2b')]==='Agents'?_0xc39f('0x1d'):_0xc39f('0x24');})[_0xc39f('0x85')]()[_0xc39f('0x28')]();for(var _0xfdc34a=0x0;_0xfdc34a<_0x133e63['length'];_0xfdc34a++){if(!_[_0xc39f('0x29')](_0x3b629c,_0x133e63[_0xfdc34a][_0xc39f('0x1c')]))return;var _0x3fb005=_0x133e63[_0xfdc34a]['role']===_0xc39f('0x1d')?_0xc39f('0x7d'):_0xc39f('0x23');_0x239639[_0xc39f('0x46')](db[_0xc39f('0x2c')][_0xc39f('0x77')]({'name':_0x133e63[_0xfdc34a][_0xc39f('0x2b')],'resourceId':_0x133e63[_0xfdc34a]['id'],'type':_0x3fb005,'sectionId':_[_0xc39f('0x2a')](_0x3a8c82,[_0xc39f('0x2b'),_0x3fb005])['id']},{}));}return Promise[_0xc39f('0x51')](_0x239639);});})['then'](respondWithResult(_0x1343cf,0xc9))['catch'](handleError(_0x1343cf,null));};exports['changePassword']=function(_0x455d07,_0x3eb625){if(_0x455d07['body']['id']){delete _0x455d07[_0xc39f('0x59')]['id'];}return db[_0xc39f('0x33')]['find']({'where':{'id':_0x455d07[_0xc39f('0x86')]['id']}})[_0xc39f('0x2e')](function(_0x22cda4){if(!_0x22cda4)return null;if(_0x22cda4['id']===_0x455d07[_0xc39f('0x22')]['id']){if(!_0x455d07[_0xc39f('0x59')]['oldPassword']||!_0x455d07[_0xc39f('0x59')][_0xc39f('0x87')]){throw new db[(_0xc39f('0x88'))][(_0xc39f('0x89'))]('Invalid\x20body\x20format.\x20Use\x20oldPassword\x20and\x20newPassword');}if(!_0x22cda4[_0xc39f('0x8a')](_0x455d07[_0xc39f('0x59')][_0xc39f('0x8b')])){throw new db[(_0xc39f('0x88'))][(_0xc39f('0x89'))]('Wrong\x20credentials');}if(_0x455d07['body'][_0xc39f('0x8b')]===_0x455d07[_0xc39f('0x59')][_0xc39f('0x87')]){throw new db[(_0xc39f('0x88'))]['ValidationError'](_0xc39f('0x8c'));}}else if(_0x455d07['user'][_0xc39f('0x1c')]===_0xc39f('0x20')){if(!_0x455d07['body'][_0xc39f('0x87')]){throw new db[(_0xc39f('0x88'))][(_0xc39f('0x89'))]('Invalid\x20body\x20format.\x20Use\x20newPassword');}}else if(_0x455d07[_0xc39f('0x22')][_0xc39f('0x1c')]===_0xc39f('0x22')){if(!_0x455d07['body'][_0xc39f('0x87')]){throw new db[(_0xc39f('0x88'))][(_0xc39f('0x89'))](_0xc39f('0x8d'));}if(_0x22cda4[_0xc39f('0x1c')]!==_0xc39f('0x1d')){throw new db[(_0xc39f('0x88'))][(_0xc39f('0x89'))]('Unauthorized');}}else{throw new db[(_0xc39f('0x88'))][(_0xc39f('0x89'))](_0xc39f('0x78'));}return _0x22cda4;})['then'](handleEntityNotFound(_0x3eb625,null))[_0xc39f('0x2e')](function(_0x23e3f8){return db[_0xc39f('0x5d')]['findOne']({'attributes':['id',_0xc39f('0x5f'),'enforcePasswordHistory','passwordHistoryLimit']})[_0xc39f('0x2e')](function(_0x4d10a2){if(_0x4d10a2[_0xc39f('0x5f')])authService[_0xc39f('0x60')](_0x455d07[_0xc39f('0x59')][_0xc39f('0x87')]);if(!_0x4d10a2[_0xc39f('0x8e')]||!_0x23e3f8[_0xc39f('0x3a')])return _0x23e3f8;authService['validatePasswordHistory'](_0x455d07[_0xc39f('0x59')][_0xc39f('0x87')],_0x23e3f8[_0xc39f('0x3a')],_0x4d10a2[_0xc39f('0x8f')]);return _0x23e3f8;})[_0xc39f('0x2e')](saveUpdates({'password':_0x455d07['body'][_0xc39f('0x87')],'passwordResetAt':_0x455d07[_0xc39f('0x22')]['id']==_0x455d07[_0xc39f('0x86')]['id']?moment():null,'previousPasswords':authService[_0xc39f('0x90')](_0x455d07[_0xc39f('0x59')][_0xc39f('0x87')],_0x23e3f8[_0xc39f('0x3a')])},null));})[_0xc39f('0x2e')](respondWithResult(_0x3eb625,null))[_0xc39f('0x52')](handleError(_0x3eb625,null));};exports[_0xc39f('0x91')]=function(_0x338855,_0x28e8ef){var _0x40f520=_0x338855[_0xc39f('0x59')][_0xc39f('0x92')];return db[_0xc39f('0x33')][_0xc39f('0x2a')]({'where':{'id':_0x338855['params']['id']},'attributes':['id',_0xc39f('0x2b'),_0xc39f('0x1c'),'online',_0xc39f('0x93'),_0xc39f('0x94'),_0xc39f('0x95')]})['then'](handleEntityNotFound(_0x28e8ef,null))[_0xc39f('0x2e')](function(_0x370bca){if(_0x370bca){if(!utils[_0xc39f('0x96')](_0x40f520)){throw new db[(_0xc39f('0x88'))]['ValidationError']('Unknown\x20channel');}return _0x370bca[_0xc39f('0x97')+_[_0xc39f('0x98')](_0x40f520[_0xc39f('0x99')]())+_0xc39f('0x9a')](_0x338855[_0xc39f('0x59')]['ids'],{'penalty':_0x338855['body'][_0xc39f('0x9b')]||0x0})[_0xc39f('0x9c')](function(_0x3fc91b){for(var _0x443ddd=0x0;_0x443ddd<_0x338855['body'][_0xc39f('0x5c')][_0xc39f('0x4b')];_0x443ddd+=0x1){var _0x4505e7={'UserId':Number(_0x338855[_0xc39f('0x86')]['id'])};_0x4505e7[_[_0xc39f('0x98')](_0x40f520[_0xc39f('0x99')]())+'QueueId']=Number(_0x338855[_0xc39f('0x59')][_0xc39f('0x5c')][_0x443ddd]);socket[_0xc39f('0x9d')](_0xc39f('0x22')+_['capitalize'](_0x40f520[_0xc39f('0x99')]())+_0xc39f('0x9e'),_0x4505e7);}return _0x3fc91b;})[_0xc39f('0x2e')](function(){if(_0x40f520===_0xc39f('0x9f')){return db[_0xc39f('0xa0')][_0xc39f('0x47')]({'where':{'id':_0x338855[_0xc39f('0x59')]['ids']||[]},'raw':!![],'attributes':['id',_0xc39f('0x2b')]});}})[_0xc39f('0x2e')](function(_0x2451b9){var _0x2cd790=_0x370bca[_0xc39f('0x1f')]({'plain':!![]});var _0x2c8973=[];if(_0x40f520===_0xc39f('0x9f')&&_0x2cd790['role']===_0xc39f('0x1d')&&_0x2cd790[_0xc39f('0xa1')]){for(let _0x3560bc=0x0;_0x3560bc<_0x2451b9['length'];_0x3560bc+=0x1){_0x2c8973[_0xc39f('0x46')]({'membername':_0x2cd790[_0xc39f('0x2b')],'UserId':_0x2cd790['id'],'queue_name':_0x2451b9[_0x3560bc][_0xc39f('0x2b')],'VoiceQueueId':_0x2451b9[_0x3560bc]['id'],'interface':_[_0xc39f('0x62')](_0x2cd790[_0xc39f('0x95')])?util[_0xc39f('0xa2')]('SIP/%s',_0x2cd790[_0xc39f('0x2b')]):_0x2cd790[_0xc39f('0x95')],'paused':_0x2cd790['voicePause']||![],'penalty':_0x338855[_0xc39f('0x59')][_0xc39f('0x9b')]||0x0});}return Promise[_0xc39f('0x51')](_0x2c8973[_0xc39f('0x27')](function(_0x2563e5){return db[_0xc39f('0xa3')][_0xc39f('0xa4')](_0x2563e5);}));}return _0x370bca;});}})[_0xc39f('0x2e')](respondWithStatusCode(_0x28e8ef,null))['catch'](handleError(_0x28e8ef,null));};exports['removeQueues']=function(_0x301819,_0x54fefe){var _0x14d96d,_0x511e90;return db['User'][_0xc39f('0x2a')]({'where':{'id':_0x301819[_0xc39f('0x86')]['id']},'attributes':['id',_0xc39f('0x2b'),'role']})[_0xc39f('0x2e')](handleEntityNotFound(_0x54fefe,null))[_0xc39f('0x2e')](function(_0x1b4af7){if(_0x1b4af7){_0x14d96d=_0x1b4af7;if(!_0x301819[_0xc39f('0x41')]['channel']||!utils[_0xc39f('0x96')](_0x301819[_0xc39f('0x41')]['channel'])){throw new db[(_0xc39f('0x88'))][(_0xc39f('0x89'))](_0xc39f('0xa5'));}return _0x1b4af7[_0xc39f('0xa6')+_[_0xc39f('0x98')](_0x301819[_0xc39f('0x41')][_0xc39f('0x92')][_0xc39f('0x99')]())+'Queues'](_0x301819[_0xc39f('0x41')][_0xc39f('0x5c')]);}})[_0xc39f('0x2e')](function(_0x24466b){if(_['isArray'](_0x301819[_0xc39f('0x41')][_0xc39f('0x5c')])){for(var _0x52c95b=0x0;_0x52c95b<_0x301819[_0xc39f('0x41')][_0xc39f('0x5c')][_0xc39f('0x4b')];_0x52c95b+=0x1){_0x511e90={'UserId':Number(_0x301819[_0xc39f('0x86')]['id'])};_0x511e90[_[_0xc39f('0x98')](_0x301819[_0xc39f('0x41')]['channel']['toLowerCase']())+_0xc39f('0xa7')]=Number(_0x301819[_0xc39f('0x41')][_0xc39f('0x5c')][_0x52c95b]);socket[_0xc39f('0x9d')]('user'+_[_0xc39f('0x98')](_0x301819[_0xc39f('0x41')]['channel'][_0xc39f('0x99')]())+_0xc39f('0xa8'),_0x511e90);}}else{_0x511e90={'UserId':Number(_0x301819[_0xc39f('0x86')]['id'])};_0x511e90[_[_0xc39f('0x98')](_0x301819['query'][_0xc39f('0x92')][_0xc39f('0x99')]())+_0xc39f('0xa7')]=Number(_0x301819[_0xc39f('0x41')][_0xc39f('0x5c')]);socket['emit'](_0xc39f('0x22')+_['capitalize'](_0x301819[_0xc39f('0x41')][_0xc39f('0x92')]['toLowerCase']())+_0xc39f('0xa8'),_0x511e90);}return _0x24466b;})[_0xc39f('0x2e')](function(){if(_0x301819[_0xc39f('0x41')][_0xc39f('0x92')]==='voice'){return db[_0xc39f('0xa3')]['destroy']({'where':{'UserId':_0x301819[_0xc39f('0x86')]['id'],'VoiceQueueId':_0x301819['query'][_0xc39f('0x5c')]},'individualHooks':!![]})['then'](function(){return _0x14d96d;});}return _0x14d96d;})[_0xc39f('0x2e')](respondWithStatusCode(_0x54fefe,null))['catch'](handleError(_0x54fefe,null));};exports[_0xc39f('0xa9')]=function(_0x1cae27,_0x47ebe3){_0x1cae27[_0xc39f('0x59')][_0xc39f('0xaa')]=_0x1cae27[_0xc39f('0xab')]['filename'];return db[_0xc39f('0x33')][_0xc39f('0x2a')]({'where':{'id':_0x1cae27[_0xc39f('0x86')]['id']}})[_0xc39f('0x2e')](handleEntityNotFound(_0x47ebe3,null))[_0xc39f('0x2e')](saveUpdates(_0x1cae27['body'],null))[_0xc39f('0x2e')](respondWithResult(_0x47ebe3,null))['catch'](handleError(_0x47ebe3,null));};exports[_0xc39f('0xac')]=function(_0x10ec81,_0x556619){var _0x19cbab=path['join'](config[_0xc39f('0xad')],'server/files/images/logos/default_profile.png');return db[_0xc39f('0x33')][_0xc39f('0x2a')]({'where':{'id':_0x10ec81[_0xc39f('0x86')]['id']},'attributes':['id',_0xc39f('0xaa')],'raw':!![]})['then'](handleEntityNotFound(_0x556619,null))[_0xc39f('0x2e')](function(_0x47e8f2){if(_0x47e8f2){if(_[_0xc39f('0x62')](_0x47e8f2[_0xc39f('0xaa')])){return _0x556619['download'](_0x19cbab);}else{if(!fs[_0xc39f('0xae')](path[_0xc39f('0xaf')](config[_0xc39f('0xad')],_0xc39f('0xb0'),_0x47e8f2[_0xc39f('0xaa')]))){return _0x556619[_0xc39f('0xb1')](_0x19cbab);}return _0x556619['download'](path[_0xc39f('0xaf')](config[_0xc39f('0xad')],'server/files/images/',_0x47e8f2[_0xc39f('0xaa')]));}}})[_0xc39f('0x52')](handleError(_0x556619,null));};exports['getOpenTabs']=function(_0x50df53,_0x2c77a3){return db[_0xc39f('0x33')]['find']({'where':{'id':_0x50df53[_0xc39f('0x86')]['id']},'attributes':['id']})[_0xc39f('0x2e')](handleEntityNotFound(_0x2c77a3,null))[_0xc39f('0x2e')](function(_0x96fc7b){var _0x1c47fa=[];values=_0x96fc7b['dataValues'];_0x1c47fa[_0xc39f('0x46')](get_open_tabs('chat',_0x96fc7b[_0xc39f('0x4d')]));_0x1c47fa[_0xc39f('0x46')](get_open_tabs('sms',_0x96fc7b['dataValues']));_0x1c47fa[_0xc39f('0x46')](get_open_tabs(_0xc39f('0x4f'),_0x96fc7b[_0xc39f('0x4d')]));_0x1c47fa[_0xc39f('0x46')](get_open_tabs(_0xc39f('0x50'),_0x96fc7b[_0xc39f('0x4d')]));_0x1c47fa[_0xc39f('0x46')](get_open_tabs(_0xc39f('0x57'),_0x96fc7b['dataValues']));_0x1c47fa[_0xc39f('0x46')](get_open_tabs(_0xc39f('0x58'),_0x96fc7b[_0xc39f('0x4d')]));return Promise[_0xc39f('0x51')](_0x1c47fa);})[_0xc39f('0x2e')](function(_0x5b06d8){if(_0x5b06d8){var _0x397cd7=_[_0xc39f('0x27')](values[_0xc39f('0xb2')],function(_0x49104b){return{'channel':_0xc39f('0xb3'),'id':_0x49104b['id'],'createdAt':_0x49104b['createdAt']};});var _0x105d91=_['map'](values[_0xc39f('0xb4')],function(_0x3de5e5){return{'channel':_0xc39f('0xb5'),'id':_0x3de5e5['id'],'createdAt':_0x3de5e5[_0xc39f('0xb6')]};});var _0x1861e7=_[_0xc39f('0x27')](values['OpenchannelOpenTabs'],function(_0x2ca288){return{'channel':_0xc39f('0xb7'),'id':_0x2ca288['id'],'createdAt':_0x2ca288[_0xc39f('0xb6')]};});var _0x361d81=_[_0xc39f('0x27')](values['MailOpenTabs'],function(_0xd8f778){return{'channel':_0xc39f('0xb8'),'id':_0xd8f778['id'],'createdAt':_0xd8f778[_0xc39f('0xb6')]};});var _0x4a1bc2=_[_0xc39f('0x27')](values[_0xc39f('0xb9')],function(_0x257ae0){return{'channel':_0xc39f('0xba'),'id':_0x257ae0['id'],'createdAt':_0x257ae0[_0xc39f('0xb6')]};});var _0x28daac=_[_0xc39f('0x27')](values[_0xc39f('0xbb')],function(_0x2fea9e){return{'channel':_0xc39f('0xbc'),'id':_0x2fea9e['id'],'createdAt':_0x2fea9e[_0xc39f('0xb6')]};});var _0x4df3d4=_[_0xc39f('0xbd')](_0x397cd7,_0x105d91,_0x1861e7,_0x361d81,_0x4a1bc2,_0x28daac);var _0x436f05={'count':_0x4df3d4[_0xc39f('0x4b')],'rows':_0x4df3d4};return _0x436f05;}else return null;})[_0xc39f('0x2e')](respondWithResult(_0x2c77a3,null))[_0xc39f('0x52')](handleError(_0x2c77a3,null));};exports[_0xc39f('0xbe')]=function(_0x4aa846,_0x537075){var _0x3efe21={};return db[_0xc39f('0x33')][_0xc39f('0xbf')]({'where':{'id':_0x4aa846[_0xc39f('0x86')]['id']}})[_0xc39f('0x2e')](function(_0x3d84ae){if(!_0x3d84ae){throw new APINotFoundError(util[_0xc39f('0xa2')](_0xc39f('0xc0'),_0x4aa846[_0xc39f('0x86')]['id']));}return contacts['describe']();})[_0xc39f('0x2e')](function(_0x3f3dd5){_0x4aa846[_0xc39f('0x41')][_0xc39f('0x33')]=_0x4aa846[_0xc39f('0x86')]['id'];_0x3efe21=qs[_0xc39f('0x3f')](_0x3f3dd5,_0x4aa846);if(_0x4aa846[_0xc39f('0x41')][_0xc39f('0xc1')](_0xc39f('0x42'))){_0x3efe21['include']=[{'model':db[_0xc39f('0xc2')],'as':_0xc39f('0xc3'),'required':![]},{'model':db[_0xc39f('0xc4')],'as':_0xc39f('0xc5'),'attributes':['id',_0xc39f('0x2b'),_0xc39f('0xc6')],'where':_0x4aa846[_0xc39f('0x41')][_0xc39f('0xc7')]?{'id':_0x4aa846[_0xc39f('0x41')][_0xc39f('0xc7')]}:undefined,'required':_0x4aa846[_0xc39f('0x41')][_0xc39f('0xc7')]?!![]:![]}];}return contacts[_0xc39f('0x47')](_0x4aa846['query'],_0x4aa846['user'],_0x3efe21,_0x3f3dd5);})[_0xc39f('0x2e')](respondWithFilteredResult(_0x537075,_0x3efe21))['catch'](APIHandleError(_0x537075));};exports[_0xc39f('0xc8')]=function(_0x56debc,_0x5e3dc7){var _0x492eb7;var _0x293220={};var _0x4b7a90;return db[_0xc39f('0x33')][_0xc39f('0xbf')]({'where':{'id':_0x56debc[_0xc39f('0x86')]['id']},'attributes':['id',_0xc39f('0x2b'),'role']})[_0xc39f('0x2e')](handleEntityNotFound(_0x5e3dc7,null))[_0xc39f('0x2e')](function(_0x53df26){if(!utils['isValidChannel'](_0x56debc[_0xc39f('0x41')][_0xc39f('0x92')])){throw new db[(_0xc39f('0x88'))]['ValidationError'](_0xc39f('0xa5'));}_0x492eb7=_0x53df26;var _0x34e726={};_0x34e726[_0xc39f('0xc9')]=_['keys'](db[_[_0xc39f('0x98')](_0x56debc['query'][_0xc39f('0x92')])+_0xc39f('0xca')]['rawAttributes']);_0x34e726[_0xc39f('0x41')]=_[_0xc39f('0xcb')](_0x56debc['query']);_0x34e726[_0xc39f('0xcc')]=_[_0xc39f('0xcd')](_0x34e726['model'],_0x34e726[_0xc39f('0x41')]);_0x293220[_0xc39f('0x56')]=_[_0xc39f('0xcd')](_0x34e726[_0xc39f('0xc9')],qs[_0xc39f('0xce')](_0x56debc[_0xc39f('0x41')]['fields']));_0x293220[_0xc39f('0x56')]=_0x293220[_0xc39f('0x56')][_0xc39f('0x4b')]?_0x293220[_0xc39f('0x56')]:_0x34e726[_0xc39f('0xc9')];_0x293220[_0xc39f('0xcf')]=qs['sort'](_0x56debc[_0xc39f('0x41')][_0xc39f('0xd0')]);_0x293220[_0xc39f('0x40')]=qs[_0xc39f('0xcc')](_[_0xc39f('0xd1')](_0x56debc['query'],_0x34e726[_0xc39f('0xcc')]));if(_0x56debc[_0xc39f('0x41')][_0xc39f('0x25')]){_0x293220[_0xc39f('0x40')]=_[_0xc39f('0x54')](_0x293220[_0xc39f('0x40')],{'$or':_[_0xc39f('0x27')](_0x293220['attributes'],function(_0x445ec1){var _0x376655={};_0x376655[_0x445ec1]={'$like':'%'+_0x56debc[_0xc39f('0x41')]['filter']+'%'};return _0x376655;})});}_0x293220=_[_0xc39f('0x54')]({},_0x293220,_0x56debc[_0xc39f('0x55')]);switch(_0x492eb7['role']){case _0xc39f('0x20'):return db[_[_0xc39f('0x98')](_0x56debc[_0xc39f('0x41')][_0xc39f('0x92')])+_0xc39f('0xca')][_0xc39f('0x47')](_0x293220);case _0xc39f('0x22'):case'agent':return _0x492eb7['get'+_[_0xc39f('0x98')](_0x56debc[_0xc39f('0x41')]['channel'])+_0xc39f('0x9a')](_0x293220);default:throw new db[(_0xc39f('0x88'))]['ValidationError'](_0xc39f('0xd2'));}})['then'](function(_0x485b24){_0x4b7a90=_0x485b24['length'];if(!_0x56debc[_0xc39f('0x41')]['hasOwnProperty'](_0xc39f('0xd3'))){_0x293220[_0xc39f('0x16')]=qs['limit'](_0x56debc['query']['limit']);_0x293220[_0xc39f('0x15')]=qs[_0xc39f('0x15')](_0x56debc['query'][_0xc39f('0x15')]);}switch(_0x492eb7[_0xc39f('0x1c')]){case _0xc39f('0x20'):return db[_[_0xc39f('0x98')](_0x56debc[_0xc39f('0x41')][_0xc39f('0x92')])+_0xc39f('0xca')][_0xc39f('0x47')](_0x293220);case _0xc39f('0x22'):case _0xc39f('0x1d'):return _0x492eb7[_0xc39f('0x1f')+_['capitalize'](_0x56debc[_0xc39f('0x41')][_0xc39f('0x92')])+_0xc39f('0x9a')](_0x293220);}})[_0xc39f('0x2e')](function(_0x31d51f){return{'count':_0x4b7a90,'rows':_0x31d51f};})['then'](respondWithResult(_0x5e3dc7,null))['catch'](handleError(_0x5e3dc7,null));};exports[_0xc39f('0xd4')]=function(_0x2f5a41,_0x21a283){var _0x14d1b1={};var _0x3ea066={};var _0x1f8c57;var _0x1e09ef;return db[_0xc39f('0x33')]['findOne']({'where':{'id':_0x2f5a41[_0xc39f('0x86')]['id']}})['then'](handleEntityNotFound(_0x21a283,null))[_0xc39f('0x2e')](function(_0x5d57c9){if(_0x5d57c9){_0x1f8c57=_0x5d57c9;_0x3ea066[_0xc39f('0xc9')]=_[_0xc39f('0xcb')](db[_0xc39f('0xa3')]['rawAttributes']);_0x3ea066[_0xc39f('0x41')]=_[_0xc39f('0xcb')](_0x2f5a41[_0xc39f('0x41')]);_0x3ea066[_0xc39f('0xcc')]=_['intersection'](_0x3ea066['model'],_0x3ea066[_0xc39f('0x41')]);_0x14d1b1['attributes']=_[_0xc39f('0xcd')](_0x3ea066[_0xc39f('0xc9')],qs[_0xc39f('0xce')](_0x2f5a41['query'][_0xc39f('0xce')]));_0x14d1b1[_0xc39f('0x56')]=_0x14d1b1[_0xc39f('0x56')]['length']?_0x14d1b1['attributes']:_0x3ea066[_0xc39f('0xc9')];_0x14d1b1[_0xc39f('0xcf')]=qs[_0xc39f('0xd0')](_0x2f5a41[_0xc39f('0x41')][_0xc39f('0xd0')]);_0x14d1b1[_0xc39f('0x40')]=qs[_0xc39f('0xcc')](_[_0xc39f('0xd1')](_0x2f5a41[_0xc39f('0x41')],_0x3ea066[_0xc39f('0xcc')]));if(_0x2f5a41[_0xc39f('0x41')][_0xc39f('0x25')]){_0x14d1b1[_0xc39f('0x40')]=_['merge'](_0x14d1b1[_0xc39f('0x40')],{'$or':_[_0xc39f('0x27')](_0x14d1b1[_0xc39f('0x56')],function(_0x8025e8){var _0x32696e={};_0x32696e[_0x8025e8]={'$like':'%'+_0x2f5a41[_0xc39f('0x41')][_0xc39f('0x25')]+'%'};return _0x32696e;})});}_0x14d1b1=_['merge']({},_0x14d1b1,_0x2f5a41[_0xc39f('0x55')]);return _0x1f8c57['getVoiceQueuesRt'](_0x14d1b1);}})[_0xc39f('0x2e')](function(_0x471cad){if(_0x471cad){_0x1e09ef=_0x471cad[_0xc39f('0x4b')];if(!_0x2f5a41[_0xc39f('0x41')][_0xc39f('0xc1')](_0xc39f('0xd3'))){_0x14d1b1[_0xc39f('0x16')]=qs[_0xc39f('0x16')](_0x2f5a41[_0xc39f('0x41')][_0xc39f('0x16')]);_0x14d1b1[_0xc39f('0x15')]=qs[_0xc39f('0x15')](_0x2f5a41[_0xc39f('0x41')][_0xc39f('0x15')]);}return _0x1f8c57[_0xc39f('0xd4')](_0x14d1b1);}})['then'](function(_0x136af6){if(_0x136af6){return _0x136af6?{'count':_0x1e09ef,'rows':_0x136af6}:null;}})[_0xc39f('0x2e')](respondWithResult(_0x21a283,null))['catch'](handleError(_0x21a283,null));};exports[_0xc39f('0xd5')]=function(_0x46c56b,_0xab1fcd){var _0x561716={};var _0x3eb10b={};var _0x2dce24;var _0x5ada13;return db['User'][_0xc39f('0xbf')]({'where':{'id':_0x46c56b['params']['id']}})[_0xc39f('0x2e')](handleEntityNotFound(_0xab1fcd,null))['then'](function(_0x4eca06){if(_0x4eca06){_0x2dce24=_0x4eca06;_0x3eb10b['model']=_['keys'](db[_0xc39f('0xd6')]['rawAttributes']);_0x3eb10b[_0xc39f('0x41')]=_[_0xc39f('0xcb')](_0x46c56b[_0xc39f('0x41')]);_0x3eb10b[_0xc39f('0xcc')]=_['intersection'](_0x3eb10b[_0xc39f('0xc9')],_0x3eb10b['query']);_0x561716[_0xc39f('0x56')]=_[_0xc39f('0xcd')](_0x3eb10b[_0xc39f('0xc9')],qs['fields'](_0x46c56b[_0xc39f('0x41')][_0xc39f('0xce')]));_0x561716[_0xc39f('0x56')]=_0x561716[_0xc39f('0x56')]['length']?_0x561716['attributes']:_0x3eb10b[_0xc39f('0xc9')];_0x561716[_0xc39f('0xcf')]=qs[_0xc39f('0xd0')](_0x46c56b['query']['sort']);_0x561716[_0xc39f('0x40')]=qs['filters'](_[_0xc39f('0xd1')](_0x46c56b[_0xc39f('0x41')],_0x3eb10b[_0xc39f('0xcc')]));if(_0x46c56b[_0xc39f('0x41')][_0xc39f('0x25')]){_0x561716[_0xc39f('0x40')]=_[_0xc39f('0x54')](_0x561716[_0xc39f('0x40')],{'$or':_[_0xc39f('0x27')](_0x561716[_0xc39f('0x56')],function(_0x23e2d1){var _0x51b712={};_0x51b712[_0x23e2d1]={'$like':'%'+_0x46c56b[_0xc39f('0x41')][_0xc39f('0x25')]+'%'};return _0x51b712;})});}_0x561716=_[_0xc39f('0x54')]({},_0x561716,_0x46c56b[_0xc39f('0x55')]);return _0x2dce24['getGroups'](_0x561716);}})[_0xc39f('0x2e')](function(_0x31d38b){if(_0x31d38b){_0x5ada13=_0x31d38b[_0xc39f('0x4b')];if(!_0x46c56b['query'][_0xc39f('0xc1')](_0xc39f('0xd3'))){_0x561716[_0xc39f('0x16')]=qs['limit'](_0x46c56b[_0xc39f('0x41')][_0xc39f('0x16')]);_0x561716[_0xc39f('0x15')]=qs[_0xc39f('0x15')](_0x46c56b[_0xc39f('0x41')][_0xc39f('0x15')]);}return _0x2dce24['getGroups'](_0x561716);}})['then'](function(_0x34c1f8){if(_0x34c1f8){return _0x34c1f8?{'count':_0x5ada13,'rows':_0x34c1f8}:null;}})[_0xc39f('0x2e')](respondWithResult(_0xab1fcd,null))['catch'](handleError(_0xab1fcd,null));};exports['getRecordings']=function(_0x566677,_0x9016dc){var _0x294a0f={'raw':!![],'where':{}};var _0x11e045={};var _0x49709c={'count':0x0,'rows':[]};return db['User']['findOne']({'where':{'id':_0x566677[_0xc39f('0x86')]['id']}})['then'](handleEntityNotFound(_0x9016dc,null))['then'](function(_0x2b535c){if(_0x2b535c){_0x11e045['model']=_['keys'](db[_0xc39f('0xd7')]['rawAttributes']);_0x11e045[_0xc39f('0x41')]=_[_0xc39f('0xcb')](_0x566677['query']);_0x11e045[_0xc39f('0xcc')]=_[_0xc39f('0xcd')](_0x11e045[_0xc39f('0xc9')],_0x11e045['query']);_0x294a0f[_0xc39f('0x56')]=_[_0xc39f('0xcd')](_0x11e045[_0xc39f('0xc9')],qs[_0xc39f('0xce')](_0x566677[_0xc39f('0x41')][_0xc39f('0xce')]));_0x294a0f[_0xc39f('0x56')]=_0x294a0f[_0xc39f('0x56')][_0xc39f('0x4b')]?_0x294a0f[_0xc39f('0x56')]:_0x11e045[_0xc39f('0xc9')];if(!_0x566677[_0xc39f('0x41')][_0xc39f('0xc1')](_0xc39f('0xd3'))){_0x294a0f[_0xc39f('0x16')]=qs['limit'](_0x566677[_0xc39f('0x41')][_0xc39f('0x16')]);_0x294a0f[_0xc39f('0x15')]=qs[_0xc39f('0x15')](_0x566677[_0xc39f('0x41')][_0xc39f('0x15')]);}_0x294a0f[_0xc39f('0xcf')]=qs['sort'](_0x566677[_0xc39f('0x41')]['sort']);_0x294a0f[_0xc39f('0x40')]=qs['filters'](_[_0xc39f('0xd1')](_0x566677['query'],_0x11e045[_0xc39f('0xcc')]));_0x294a0f['where']['UserId']=_0x2b535c['id'];if(_0x566677[_0xc39f('0x41')][_0xc39f('0x25')]){_0x294a0f[_0xc39f('0x40')]=_['merge'](_0x294a0f[_0xc39f('0x40')],{'$or':_[_0xc39f('0x27')](_0x294a0f[_0xc39f('0x56')],function(_0x2bfc27){var _0x18b509={};_0x18b509[_0x2bfc27]={'$like':'%'+_0x566677['query'][_0xc39f('0x25')]+'%'};return _0x18b509;})});}_0x294a0f=_['merge']({},_0x294a0f,_0x566677[_0xc39f('0x55')]);return db[_0xc39f('0xd7')][_0xc39f('0x18')]({'where':_0x294a0f[_0xc39f('0x40')]})[_0xc39f('0x2e')](function(_0x55276e){_0x49709c[_0xc39f('0x18')]=_0x55276e;if(_0x566677[_0xc39f('0x41')][_0xc39f('0x42')]){_0x294a0f[_0xc39f('0x43')]=[{'all':!![]}];}return db[_0xc39f('0xd7')]['findAll'](_0x294a0f);})[_0xc39f('0x2e')](function(_0x221b16){_0x49709c[_0xc39f('0x48')]=_0x221b16;return _0x49709c;});}})['then'](respondWithFilteredResult(_0x9016dc,_0x294a0f))[_0xc39f('0x52')](handleError(_0x9016dc,null));};exports['getScreenRecordings']=function(_0x2814aa,_0x15689f){var _0x3fa5f7={'raw':!![],'where':{}};var _0xe0f3e0={};var _0xfcf0d6={'count':0x0,'rows':[]};return db[_0xc39f('0x33')][_0xc39f('0xbf')]({'where':{'id':_0x2814aa[_0xc39f('0x86')]['id']}})['then'](handleEntityNotFound(_0x15689f,null))['then'](function(_0x297781){if(_0x297781){_0xe0f3e0['model']=_[_0xc39f('0xcb')](db['ScreenRecording'][_0xc39f('0x34')]);_0xe0f3e0[_0xc39f('0x41')]=_[_0xc39f('0xcb')](_0x2814aa[_0xc39f('0x41')]);_0xe0f3e0[_0xc39f('0xcc')]=_[_0xc39f('0xcd')](_0xe0f3e0[_0xc39f('0xc9')],_0xe0f3e0[_0xc39f('0x41')]);_0x3fa5f7[_0xc39f('0x56')]=_[_0xc39f('0xcd')](_0xe0f3e0[_0xc39f('0xc9')],qs[_0xc39f('0xce')](_0x2814aa[_0xc39f('0x41')]['fields']));_0x3fa5f7[_0xc39f('0x56')]=_0x3fa5f7[_0xc39f('0x56')][_0xc39f('0x4b')]?_0x3fa5f7[_0xc39f('0x56')]:_0xe0f3e0['model'];if(!_0x2814aa[_0xc39f('0x41')]['hasOwnProperty'](_0xc39f('0xd3'))){_0x3fa5f7[_0xc39f('0x16')]=qs[_0xc39f('0x16')](_0x2814aa['query'][_0xc39f('0x16')]);_0x3fa5f7[_0xc39f('0x15')]=qs['offset'](_0x2814aa[_0xc39f('0x41')][_0xc39f('0x15')]);}_0x3fa5f7[_0xc39f('0xcf')]=qs[_0xc39f('0xd0')](_0x2814aa[_0xc39f('0x41')][_0xc39f('0xd0')]);_0x3fa5f7[_0xc39f('0x40')]=qs[_0xc39f('0xcc')](_['pick'](_0x2814aa[_0xc39f('0x41')],_0xe0f3e0[_0xc39f('0xcc')]));_0x3fa5f7[_0xc39f('0x40')][_0xc39f('0xd8')]=_0x297781['id'];if(_0x2814aa[_0xc39f('0x41')][_0xc39f('0x25')]){_0x3fa5f7['where']=_['merge'](_0x3fa5f7[_0xc39f('0x40')],{'$or':_[_0xc39f('0x27')](_0x3fa5f7[_0xc39f('0x56')],function(_0x571560){var _0x45efdd={};_0x45efdd[_0x571560]={'$like':'%'+_0x2814aa[_0xc39f('0x41')]['filter']+'%'};return _0x45efdd;})});}_0x3fa5f7=_[_0xc39f('0x54')]({},_0x3fa5f7,_0x2814aa['options']);return db[_0xc39f('0xd9')][_0xc39f('0x18')]({'where':_0x3fa5f7[_0xc39f('0x40')]})[_0xc39f('0x2e')](function(_0x555d64){_0xfcf0d6['count']=_0x555d64;if(_0x2814aa[_0xc39f('0x41')][_0xc39f('0x42')]){_0x3fa5f7['include']=[{'all':!![]}];}return db[_0xc39f('0xd9')][_0xc39f('0x47')](_0x3fa5f7);})[_0xc39f('0x2e')](function(_0x1ac735){_0xfcf0d6[_0xc39f('0x48')]=_0x1ac735;return _0xfcf0d6;});}})['then'](respondWithFilteredResult(_0x15689f,_0x3fa5f7))[_0xc39f('0x52')](handleError(_0x15689f,null));};exports[_0xc39f('0xda')]=function(_0x2735f7,_0x29f9fd){var _0x32f561={};var _0x236dc2={};var _0x43c4ef;var _0xb807af;return db[_0xc39f('0x33')]['findOne']({'where':{'id':_0x2735f7[_0xc39f('0x86')]['id']}})['then'](handleEntityNotFound(_0x29f9fd,null))[_0xc39f('0x2e')](function(_0x43f4b1){if(_0x43f4b1){_0x43c4ef=_0x43f4b1;_0x236dc2[_0xc39f('0xc9')]=_[_0xc39f('0xcb')](db[_0xc39f('0xdb')]['rawAttributes']);_0x236dc2[_0xc39f('0x41')]=_[_0xc39f('0xcb')](_0x2735f7[_0xc39f('0x41')]);_0x236dc2['filters']=_[_0xc39f('0xcd')](_0x236dc2['model'],_0x236dc2['query']);_0x32f561['attributes']=_[_0xc39f('0xcd')](_0x236dc2[_0xc39f('0xc9')],qs['fields'](_0x2735f7[_0xc39f('0x41')][_0xc39f('0xce')]));_0x32f561['attributes']=_0x32f561[_0xc39f('0x56')]['length']?_0x32f561['attributes']:_0x236dc2[_0xc39f('0xc9')];_0x32f561[_0xc39f('0xcf')]=qs[_0xc39f('0xd0')](_0x2735f7[_0xc39f('0x41')]['sort']);_0x32f561[_0xc39f('0x40')]=qs[_0xc39f('0xcc')](_[_0xc39f('0xd1')](_0x2735f7[_0xc39f('0x41')],_0x236dc2[_0xc39f('0xcc')]));if(_0x2735f7[_0xc39f('0x41')][_0xc39f('0x25')]){_0x32f561[_0xc39f('0x40')]=_['merge'](_0x32f561['where'],{'$or':_[_0xc39f('0x27')](_0x32f561['attributes'],function(_0x6812b5){var _0xcab72b={};_0xcab72b[_0x6812b5]={'$like':'%'+_0x2735f7[_0xc39f('0x41')]['filter']+'%'};return _0xcab72b;})});}_0x32f561=_['merge']({},_0x32f561,_0x2735f7['options']);return _0x43c4ef['getChatInteractions'](_0x32f561);}})['then'](function(_0x525075){if(_0x525075){_0xb807af=_0x525075[_0xc39f('0x4b')];if(!_0x2735f7[_0xc39f('0x41')][_0xc39f('0xc1')](_0xc39f('0xd3'))){_0x32f561[_0xc39f('0x16')]=qs['limit'](_0x2735f7['query'][_0xc39f('0x16')]);_0x32f561[_0xc39f('0x15')]=qs[_0xc39f('0x15')](_0x2735f7[_0xc39f('0x41')][_0xc39f('0x15')]);}return _0x43c4ef['getChatInteractions'](_0x32f561);}})[_0xc39f('0x2e')](function(_0x1efa6e){if(_0x1efa6e){return _0x1efa6e?{'count':_0xb807af,'rows':_0x1efa6e}:null;}})[_0xc39f('0x2e')](respondWithResult(_0x29f9fd,null))[_0xc39f('0x52')](handleError(_0x29f9fd,null));};exports[_0xc39f('0xdc')]=function(_0x2076d4,_0x30ca20){var _0x3caa6e={};var _0x6e3462={};var _0x4fd94b;var _0x298272;return db[_0xc39f('0x33')]['findOne']({'where':{'id':_0x2076d4[_0xc39f('0x86')]['id']}})[_0xc39f('0x2e')](handleEntityNotFound(_0x30ca20,null))[_0xc39f('0x2e')](function(_0x214732){if(_0x214732){_0x4fd94b=_0x214732;_0x6e3462[_0xc39f('0xc9')]=_[_0xc39f('0xcb')](db[_0xc39f('0xdd')][_0xc39f('0x34')]);_0x6e3462['query']=_['keys'](_0x2076d4[_0xc39f('0x41')]);_0x6e3462['filters']=_[_0xc39f('0xcd')](_0x6e3462[_0xc39f('0xc9')],_0x6e3462['query']);_0x3caa6e['attributes']=_[_0xc39f('0xcd')](_0x6e3462[_0xc39f('0xc9')],qs[_0xc39f('0xce')](_0x2076d4['query']['fields']));_0x3caa6e['attributes']=_0x3caa6e['attributes']['length']?_0x3caa6e[_0xc39f('0x56')]:_0x6e3462[_0xc39f('0xc9')];_0x3caa6e[_0xc39f('0xcf')]=qs['sort'](_0x2076d4[_0xc39f('0x41')][_0xc39f('0xd0')]);_0x3caa6e[_0xc39f('0x40')]=qs[_0xc39f('0xcc')](_[_0xc39f('0xd1')](_0x2076d4[_0xc39f('0x41')],_0x6e3462[_0xc39f('0xcc')]));if(_0x2076d4[_0xc39f('0x41')][_0xc39f('0x25')]){_0x3caa6e['where']=_[_0xc39f('0x54')](_0x3caa6e['where'],{'$or':_[_0xc39f('0x27')](_0x3caa6e[_0xc39f('0x56')],function(_0x8b7463){var _0x5dc675={};_0x5dc675[_0x8b7463]={'$like':'%'+_0x2076d4[_0xc39f('0x41')][_0xc39f('0x25')]+'%'};return _0x5dc675;})});}_0x3caa6e=_['merge']({},_0x3caa6e,_0x2076d4['options']);return _0x4fd94b[_0xc39f('0xdc')](_0x3caa6e);}})[_0xc39f('0x2e')](function(_0x4ad1d0){if(_0x4ad1d0){_0x298272=_0x4ad1d0[_0xc39f('0x4b')];if(!_0x2076d4['query']['hasOwnProperty'](_0xc39f('0xd3'))){_0x3caa6e[_0xc39f('0x16')]=qs['limit'](_0x2076d4['query'][_0xc39f('0x16')]);_0x3caa6e[_0xc39f('0x15')]=qs[_0xc39f('0x15')](_0x2076d4[_0xc39f('0x41')][_0xc39f('0x15')]);}return _0x4fd94b[_0xc39f('0xdc')](_0x3caa6e);}})[_0xc39f('0x2e')](function(_0x591d0a){if(_0x591d0a){return _0x591d0a?{'count':_0x298272,'rows':_0x591d0a}:null;}})['then'](respondWithResult(_0x30ca20,null))[_0xc39f('0x52')](handleError(_0x30ca20,null));};exports[_0xc39f('0xde')]=function(_0x4bc2f1,_0x216f8b){var _0x549262={'raw':!![],'where':{}};var _0x5a6f12={};var _0x1816cd={'count':0x0,'rows':[]};return db[_0xc39f('0x33')]['findOne']({'where':{'id':_0x4bc2f1[_0xc39f('0x86')]['id']}})[_0xc39f('0x2e')](handleEntityNotFound(_0x216f8b,null))[_0xc39f('0x2e')](function(_0x5e2df5){if(_0x5e2df5){_0x5a6f12[_0xc39f('0xc9')]=_[_0xc39f('0xcb')](db[_0xc39f('0xdf')][_0xc39f('0x34')]);_0x5a6f12[_0xc39f('0x41')]=_[_0xc39f('0xcb')](_0x4bc2f1['query']);_0x5a6f12[_0xc39f('0xcc')]=_[_0xc39f('0xcd')](_0x5a6f12[_0xc39f('0xc9')],_0x5a6f12[_0xc39f('0x41')]);_0x549262['attributes']=_['intersection'](_0x5a6f12[_0xc39f('0xc9')],qs[_0xc39f('0xce')](_0x4bc2f1[_0xc39f('0x41')][_0xc39f('0xce')]));_0x549262[_0xc39f('0x56')]=_0x549262[_0xc39f('0x56')][_0xc39f('0x4b')]?_0x549262[_0xc39f('0x56')]:_0x5a6f12[_0xc39f('0xc9')];if(!_0x4bc2f1[_0xc39f('0x41')][_0xc39f('0xc1')](_0xc39f('0xd3'))){_0x549262['limit']=qs[_0xc39f('0x16')](_0x4bc2f1[_0xc39f('0x41')][_0xc39f('0x16')]);_0x549262[_0xc39f('0x15')]=qs[_0xc39f('0x15')](_0x4bc2f1['query'][_0xc39f('0x15')]);}_0x549262[_0xc39f('0xcf')]=qs['sort'](_0x4bc2f1['query']['sort']);_0x549262[_0xc39f('0x40')]=qs[_0xc39f('0xcc')](_[_0xc39f('0xd1')](_0x4bc2f1[_0xc39f('0x41')],_0x5a6f12['filters']));_0x549262[_0xc39f('0x40')][_0xc39f('0xd8')]=_0x5e2df5['id'];if(_0x4bc2f1[_0xc39f('0x41')][_0xc39f('0x25')]){_0x549262[_0xc39f('0x40')]=_['merge'](_0x549262['where'],{'$or':_[_0xc39f('0x27')](_0x549262['attributes'],function(_0x3c874a){var _0x400471={};_0x400471[_0x3c874a]={'$like':'%'+_0x4bc2f1[_0xc39f('0x41')][_0xc39f('0x25')]+'%'};return _0x400471;})});}_0x549262=_['merge']({},_0x549262,_0x4bc2f1[_0xc39f('0x55')]);return db['MailInteraction']['count']({'where':_0x549262[_0xc39f('0x40')]})[_0xc39f('0x2e')](function(_0x22521e){_0x1816cd['count']=_0x22521e;if(_0x4bc2f1[_0xc39f('0x41')][_0xc39f('0x42')]){_0x549262[_0xc39f('0x43')]=[{'all':!![]}];}return db[_0xc39f('0xdf')][_0xc39f('0x47')](_0x549262);})[_0xc39f('0x2e')](function(_0x4feb35){_0x1816cd[_0xc39f('0x48')]=_0x4feb35;return _0x1816cd;});}})[_0xc39f('0x2e')](respondWithFilteredResult(_0x216f8b,_0x549262))[_0xc39f('0x52')](handleError(_0x216f8b,null));};exports['getSmsInteractions']=function(_0x54ca3c,_0x3c4697){var _0x1e3a1d={};var _0x3c4d9b={};var _0x3780f3;var _0xe5405f;return db[_0xc39f('0x33')]['findOne']({'where':{'id':_0x54ca3c[_0xc39f('0x86')]['id']}})[_0xc39f('0x2e')](handleEntityNotFound(_0x3c4697,null))[_0xc39f('0x2e')](function(_0x1b3bce){if(_0x1b3bce){_0x3780f3=_0x1b3bce;_0x3c4d9b[_0xc39f('0xc9')]=_[_0xc39f('0xcb')](db[_0xc39f('0xe0')][_0xc39f('0x34')]);_0x3c4d9b[_0xc39f('0x41')]=_[_0xc39f('0xcb')](_0x54ca3c['query']);_0x3c4d9b[_0xc39f('0xcc')]=_[_0xc39f('0xcd')](_0x3c4d9b[_0xc39f('0xc9')],_0x3c4d9b['query']);_0x1e3a1d[_0xc39f('0x56')]=_[_0xc39f('0xcd')](_0x3c4d9b[_0xc39f('0xc9')],qs['fields'](_0x54ca3c[_0xc39f('0x41')]['fields']));_0x1e3a1d[_0xc39f('0x56')]=_0x1e3a1d[_0xc39f('0x56')][_0xc39f('0x4b')]?_0x1e3a1d[_0xc39f('0x56')]:_0x3c4d9b['model'];_0x1e3a1d[_0xc39f('0xcf')]=qs['sort'](_0x54ca3c[_0xc39f('0x41')][_0xc39f('0xd0')]);_0x1e3a1d['where']=qs['filters'](_[_0xc39f('0xd1')](_0x54ca3c[_0xc39f('0x41')],_0x3c4d9b[_0xc39f('0xcc')]));if(_0x54ca3c['query'][_0xc39f('0x25')]){_0x1e3a1d['where']=_[_0xc39f('0x54')](_0x1e3a1d[_0xc39f('0x40')],{'$or':_[_0xc39f('0x27')](_0x1e3a1d[_0xc39f('0x56')],function(_0x5ce0de){var _0x299b69={};_0x299b69[_0x5ce0de]={'$like':'%'+_0x54ca3c[_0xc39f('0x41')]['filter']+'%'};return _0x299b69;})});}_0x1e3a1d=_['merge']({},_0x1e3a1d,_0x54ca3c[_0xc39f('0x55')]);return _0x3780f3[_0xc39f('0xe1')](_0x1e3a1d);}})[_0xc39f('0x2e')](function(_0x13c3a6){if(_0x13c3a6){_0xe5405f=_0x13c3a6[_0xc39f('0x4b')];if(!_0x54ca3c[_0xc39f('0x41')][_0xc39f('0xc1')]('nolimit')){_0x1e3a1d[_0xc39f('0x16')]=qs[_0xc39f('0x16')](_0x54ca3c[_0xc39f('0x41')][_0xc39f('0x16')]);_0x1e3a1d[_0xc39f('0x15')]=qs[_0xc39f('0x15')](_0x54ca3c[_0xc39f('0x41')][_0xc39f('0x15')]);}return _0x3780f3['getSmsInteractions'](_0x1e3a1d);}})[_0xc39f('0x2e')](function(_0x5ba1bb){if(_0x5ba1bb){return _0x5ba1bb?{'count':_0xe5405f,'rows':_0x5ba1bb}:null;}})['then'](respondWithResult(_0x3c4697,null))[_0xc39f('0x52')](handleError(_0x3c4697,null));};exports['getFaxInteractions']=function(_0x4104e6,_0xd671fe){var _0x5d0841={};var _0x582261={};var _0x3a3e3c;var _0xacd005;return db[_0xc39f('0x33')][_0xc39f('0xbf')]({'where':{'id':_0x4104e6[_0xc39f('0x86')]['id']}})[_0xc39f('0x2e')](handleEntityNotFound(_0xd671fe,null))[_0xc39f('0x2e')](function(_0x15491a){if(_0x15491a){_0x3a3e3c=_0x15491a;_0x582261['model']=_[_0xc39f('0xcb')](db['FaxInteraction'][_0xc39f('0x34')]);_0x582261[_0xc39f('0x41')]=_[_0xc39f('0xcb')](_0x4104e6[_0xc39f('0x41')]);_0x582261[_0xc39f('0xcc')]=_[_0xc39f('0xcd')](_0x582261[_0xc39f('0xc9')],_0x582261['query']);_0x5d0841[_0xc39f('0x56')]=_[_0xc39f('0xcd')](_0x582261[_0xc39f('0xc9')],qs[_0xc39f('0xce')](_0x4104e6[_0xc39f('0x41')][_0xc39f('0xce')]));_0x5d0841['attributes']=_0x5d0841[_0xc39f('0x56')][_0xc39f('0x4b')]?_0x5d0841['attributes']:_0x582261[_0xc39f('0xc9')];_0x5d0841[_0xc39f('0xcf')]=qs['sort'](_0x4104e6['query'][_0xc39f('0xd0')]);_0x5d0841[_0xc39f('0x40')]=qs['filters'](_['pick'](_0x4104e6[_0xc39f('0x41')],_0x582261[_0xc39f('0xcc')]));if(_0x4104e6[_0xc39f('0x41')]['filter']){_0x5d0841[_0xc39f('0x40')]=_[_0xc39f('0x54')](_0x5d0841['where'],{'$or':_[_0xc39f('0x27')](_0x5d0841[_0xc39f('0x56')],function(_0x4e91f6){var _0x1fa0ad={};_0x1fa0ad[_0x4e91f6]={'$like':'%'+_0x4104e6[_0xc39f('0x41')]['filter']+'%'};return _0x1fa0ad;})});}_0x5d0841=_[_0xc39f('0x54')]({},_0x5d0841,_0x4104e6[_0xc39f('0x55')]);return _0x3a3e3c[_0xc39f('0xe2')](_0x5d0841);}})[_0xc39f('0x2e')](function(_0x14cf8b){if(_0x14cf8b){_0xacd005=_0x14cf8b[_0xc39f('0x4b')];if(!_0x4104e6[_0xc39f('0x41')][_0xc39f('0xc1')](_0xc39f('0xd3'))){_0x5d0841['limit']=qs[_0xc39f('0x16')](_0x4104e6[_0xc39f('0x41')][_0xc39f('0x16')]);_0x5d0841['offset']=qs['offset'](_0x4104e6[_0xc39f('0x41')][_0xc39f('0x15')]);}return _0x3a3e3c[_0xc39f('0xe2')](_0x5d0841);}})[_0xc39f('0x2e')](function(_0x1e3cab){if(_0x1e3cab){return _0x1e3cab?{'count':_0xacd005,'rows':_0x1e3cab}:null;}})[_0xc39f('0x2e')](respondWithResult(_0xd671fe,null))[_0xc39f('0x52')](handleError(_0xd671fe,null));};exports[_0xc39f('0xe3')]=function(_0x40cc69,_0x3f5ed1){var _0x412fd3={};var _0x5aa809={};var _0x56e1f8;var _0xa25d12;return db[_0xc39f('0x33')][_0xc39f('0xbf')]({'where':{'id':_0x40cc69['params']['id']}})[_0xc39f('0x2e')](handleEntityNotFound(_0x3f5ed1,null))[_0xc39f('0x2e')](function(_0x1ab30c){if(_0x1ab30c){_0x56e1f8=_0x1ab30c;_0x5aa809[_0xc39f('0xc9')]=_[_0xc39f('0xcb')](db['WhatsappInteraction'][_0xc39f('0x34')]);_0x5aa809['query']=_[_0xc39f('0xcb')](_0x40cc69['query']);_0x5aa809[_0xc39f('0xcc')]=_[_0xc39f('0xcd')](_0x5aa809[_0xc39f('0xc9')],_0x5aa809[_0xc39f('0x41')]);_0x412fd3[_0xc39f('0x56')]=_[_0xc39f('0xcd')](_0x5aa809[_0xc39f('0xc9')],qs[_0xc39f('0xce')](_0x40cc69['query'][_0xc39f('0xce')]));_0x412fd3[_0xc39f('0x56')]=_0x412fd3[_0xc39f('0x56')]['length']?_0x412fd3[_0xc39f('0x56')]:_0x5aa809[_0xc39f('0xc9')];_0x412fd3[_0xc39f('0xcf')]=qs['sort'](_0x40cc69[_0xc39f('0x41')][_0xc39f('0xd0')]);_0x412fd3[_0xc39f('0x40')]=qs['filters'](_[_0xc39f('0xd1')](_0x40cc69[_0xc39f('0x41')],_0x5aa809['filters']));if(_0x40cc69['query'][_0xc39f('0x25')]){_0x412fd3[_0xc39f('0x40')]=_[_0xc39f('0x54')](_0x412fd3[_0xc39f('0x40')],{'$or':_['map'](_0x412fd3[_0xc39f('0x56')],function(_0xd8cdc6){var _0x38d1eb={};_0x38d1eb[_0xd8cdc6]={'$like':'%'+_0x40cc69['query']['filter']+'%'};return _0x38d1eb;})});}_0x412fd3=_[_0xc39f('0x54')]({},_0x412fd3,_0x40cc69[_0xc39f('0x55')]);return _0x56e1f8[_0xc39f('0xe3')](_0x412fd3);}})[_0xc39f('0x2e')](function(_0x11a4fb){if(_0x11a4fb){_0xa25d12=_0x11a4fb[_0xc39f('0x4b')];if(!_0x40cc69[_0xc39f('0x41')]['hasOwnProperty']('nolimit')){_0x412fd3[_0xc39f('0x16')]=qs['limit'](_0x40cc69[_0xc39f('0x41')][_0xc39f('0x16')]);_0x412fd3['offset']=qs[_0xc39f('0x15')](_0x40cc69['query'][_0xc39f('0x15')]);}return _0x56e1f8['getWhatsappInteractions'](_0x412fd3);}})[_0xc39f('0x2e')](function(_0x5f3512){if(_0x5f3512){return _0x5f3512?{'count':_0xa25d12,'rows':_0x5f3512}:null;}})[_0xc39f('0x2e')](respondWithResult(_0x3f5ed1,null))[_0xc39f('0x52')](handleError(_0x3f5ed1,null));};exports[_0xc39f('0xe4')]=function(_0x5b97e2,_0x4df78e,_0x215c49){var _0x28f2fc;var _0x2e719c;var _0x240c70;var _0x4ba813=!_[_0xc39f('0x62')](_0x5b97e2[_0xc39f('0x86')]['id'])?_0x5b97e2[_0xc39f('0x86')]['id']:!_[_0xc39f('0x62')](_0x5b97e2[_0xc39f('0x22')]['id'])?_0x5b97e2['user']['id']:null;return db[_0xc39f('0x33')][_0xc39f('0x2a')]({'where':{'id':_0x4ba813,'role':{'$or':[_0xc39f('0x20'),_0xc39f('0x22'),_0xc39f('0x1d')]}},'attributes':['id',_0xc39f('0x2b'),_0xc39f('0xe5'),_0xc39f('0xe6'),'role',_0xc39f('0x61'),_0xc39f('0x93')]})['then'](function(_0x12f518){if(_0x12f518){if(_0x12f518['role']===_0xc39f('0x1d')){_0x28f2fc=_0x12f518;if(_0x5b97e2[_0xc39f('0x59')][_0xc39f('0x95')]){_0x240c70=util[_0xc39f('0xa2')](_0xc39f('0xe7'),_0x28f2fc[_0x5b97e2['body'][_0xc39f('0x95')]]);}else if(_0x5b97e2['body'][_0xc39f('0xe8')]){_0x240c70=util['format']('SIP/%s',_0x5b97e2[_0xc39f('0x59')][_0xc39f('0xe8')]);}else{_0x240c70=util[_0xc39f('0xa2')](_0xc39f('0xe9'),_0x28f2fc[_0xc39f('0x2b')]);}socket['to'](util[_0xc39f('0xa2')](_0xc39f('0xea'),_0x28f2fc['name']))[_0xc39f('0x9d')]('user:forcelogout',{'user':{'id':_0x28f2fc['id'],'name':_0x28f2fc[_0xc39f('0x2b')]},'ip':_0x5b97e2[_0xc39f('0xeb')][_0xc39f('0xec')]||_0x5b97e2[_0xc39f('0xed')][_0xc39f('0xee')]||_0x5b97e2['socket'][_0xc39f('0xee')]||_0x5b97e2['connection'][_0xc39f('0xef')][_0xc39f('0xee')]});return db[_0xc39f('0xa3')][_0xc39f('0x2d')]({'where':{'membername':_0x28f2fc[_0xc39f('0x2b')]},'individualHooks':!![]});}}else{throw new db[(_0xc39f('0x88'))][(_0xc39f('0x89'))](_0xc39f('0xf0'));}})['then'](function(){if(_0x28f2fc){return _0x28f2fc['getVoiceQueues']({'raw':!![]});}})[_0xc39f('0x2e')](function(_0xdfd1f7){if(_0x28f2fc){if(_0xdfd1f7){_0x2e719c=_0xdfd1f7;if(_0x2e719c['length']){var _0x1c5565=_0x2e719c[_0xc39f('0x27')](function(_0x20d604){var _0x1716af={'membername':_0x28f2fc[_0xc39f('0x2b')],'UserId':_0x28f2fc['id'],'queue_name':_0x20d604[_0xc39f('0x2b')],'VoiceQueueId':_0x20d604['id'],'interface':_0x240c70,'paused':_0x28f2fc[_0xc39f('0x93')]||![],'penalty':_0x20d604[_0xc39f('0xf1')]||0x0};return db['UserVoiceQueueRt'][_0xc39f('0xa4')](_0x1716af);});return Promise['all'](_0x1c5565);}}}})[_0xc39f('0x2e')](function(){if(_0x28f2fc){return db[_0xc39f('0xf2')][_0xc39f('0x47')]({'where':{'membername':_0x28f2fc['name'],'exitAt':null}});}})[_0xc39f('0x2e')](function(_0x2ff439){if(_0x28f2fc){var _0x10971d=[];_0x2ff439['forEach'](function(_0x248060){_0x10971d[_0xc39f('0x46')](_0x248060[_0xc39f('0x1b')]({'exitAt':moment()[_0xc39f('0xa2')](_0xc39f('0xf3'))}));});return Promise['all'](_0x10971d);}})[_0xc39f('0x2e')](function(){if(_0x28f2fc){var _0x2c115d=[];var _0x3a94af=[];var _0x39e1be=utils[_0xc39f('0xf4')]();var _0x21e248={'membername':_0x28f2fc[_0xc39f('0x2b')],'interface':_0x240c70,'enterAt':moment()['format'](_0xc39f('0xf3')),'role':_0x28f2fc[_0xc39f('0x1c')],'internal':_0x28f2fc[_0xc39f('0x61')]};_0x39e1be['forEach'](function(_0x11ebe6){_0x2c115d[_0xc39f('0x46')](_[_0xc39f('0x54')]({'channel':_0x11ebe6,'type':_0xc39f('0xf5'),'data1':_0x5b97e2[_0xc39f('0x59')][_0xc39f('0xf6')],'data2':_0x240c70},_0x21e248));if(_0x28f2fc['loginInPause']){_0x3a94af['push'](_[_0xc39f('0x54')]({'channel':_0x11ebe6,'type':_0xc39f('0xf7'),'data1':_0xc39f('0xf8')},_0x21e248));}});return db['MemberReport'][_0xc39f('0x7f')](_0x2c115d[_0xc39f('0xbd')](_0x3a94af),{'individualHooks':!![]});}})['then'](function(){if(_0x28f2fc){return _0x28f2fc['update']({'online':!![],'lastLoginAt':moment()[_0xc39f('0xa2')](_0xc39f('0xf3')),'voicePause':_0x28f2fc['loginInPause']||![],'mailPause':_0x28f2fc['loginInPause']||![],'chatPause':_0x28f2fc[_0xc39f('0x93')]||![],'faxPause':_0x28f2fc[_0xc39f('0x93')]||![],'smsPause':_0x28f2fc[_0xc39f('0x93')]||![],'openchannelPause':_0x28f2fc[_0xc39f('0x93')]||![],'whatsappPause':_0x28f2fc['loginInPause']||![],'pauseType':_0x28f2fc[_0xc39f('0x93')]?_0xc39f('0xf8'):null,'interface':_0x240c70,'lastPauseAt':moment()[_0xc39f('0xa2')](_0xc39f('0xf3'))});}})[_0xc39f('0x2e')](function(_0x5cfd22){if(_0x5b97e2['isMiddleware']){return _0x215c49();}else{return Promise['resolve'](_0x5cfd22)[_0xc39f('0x2e')](respondWithResult(_0x4df78e,null));}})[_0xc39f('0x52')](handleError(_0x4df78e,null));};exports[_0xc39f('0xf9')]=function(_0x3e3426,_0x4290f2){var _0x35d081;return db['User'][_0xc39f('0x2a')]({'where':{'id':_0x3e3426[_0xc39f('0x86')]['id'],'role':_0xc39f('0x1d')},'attributes':['id',_0xc39f('0x2b'),_0xc39f('0x1c')]})[_0xc39f('0x2e')](handleEntityNotFound(_0x4290f2,null))[_0xc39f('0x2e')](function(_0xfa0b8c){if(_0xfa0b8c){_0x35d081=_0xfa0b8c;return db['UserVoiceQueueRt'][_0xc39f('0x2d')]({'where':{'membername':_0x35d081[_0xc39f('0x2b')]},'individualHooks':!![]});}})['then'](function(){return db[_0xc39f('0xf2')][_0xc39f('0x47')]({'where':{'membername':_0x35d081['name'],'exitAt':null}});})['then'](function(_0x13ede4){var _0x138fb2=[];_0x13ede4[_0xc39f('0xfa')](function(_0x23e97b){_0x138fb2[_0xc39f('0x46')](_0x23e97b[_0xc39f('0x1b')]({'exitAt':moment()[_0xc39f('0xa2')](_0xc39f('0xf3'))}));});return Promise[_0xc39f('0x51')](_0x138fb2);})[_0xc39f('0x2e')](function(){return _0x35d081[_0xc39f('0x1b')]({'online':![],'voicePause':![],'mailPause':![],'chatPause':![],'faxPause':![],'smsPause':![],'openchannelPause':![],'whatsappPause':![],'interface':null});})[_0xc39f('0x2e')](respondWithResult(_0x4290f2,null))['catch'](handleError(_0x4290f2,null));};exports[_0xc39f('0xfb')]=function(_0x485691,_0x465812){var _0x3ad5a9;return db['UserVoiceQueueRt'][_0xc39f('0x1b')]({'paused':0x1},{'where':{'UserId':_0x485691[_0xc39f('0x86')]['id']},'individualHooks':!![]})['then'](function(){return db[_0xc39f('0x33')][_0xc39f('0x2a')]({'where':{'id':_0x485691['params']['id'],'role':_0xc39f('0x1d')},'attributes':['id',_0xc39f('0x2b'),_0xc39f('0x1c'),_0xc39f('0x61'),_0xc39f('0x95'),'online']});})['then'](handleEntityNotFound(_0x465812,null))[_0xc39f('0x2e')](function(_0x16a32f){if(_0x16a32f){_0x3ad5a9=_0x16a32f;return db[_0xc39f('0xf2')][_0xc39f('0x47')]({'where':{'membername':_0x3ad5a9[_0xc39f('0x2b')],'type':_0xc39f('0xf7'),'exitAt':null}});}})[_0xc39f('0x2e')](function(_0x3dc999){if(_0x3dc999[_0xc39f('0x4b')]){var _0x11d4ec=moment()[_0xc39f('0xa2')](_0xc39f('0xf3'));for(var _0x4a5d5d=0x0,_0x1c6ded=_0x3dc999[_0xc39f('0x4b')];_0x4a5d5d<_0x1c6ded;_0x4a5d5d++){_0x3dc999[_0x4a5d5d]['updateAttributes']({'exitAt':_0x11d4ec});}}})['then'](function(){var _0x418ed0=[];var _0xeb8b66=utils[_0xc39f('0xf4')]();_0xeb8b66['forEach'](function(_0x52268b){_0x418ed0['push']({'channel':_0x52268b,'membername':_0x3ad5a9[_0xc39f('0x2b')],'interface':_[_0xc39f('0x62')](_0x3ad5a9[_0xc39f('0x95')])?util['format']('SIP/%s',_0x3ad5a9[_0xc39f('0x2b')]):_0x3ad5a9[_0xc39f('0x95')],'type':'PAUSE','enterAt':moment()[_0xc39f('0xa2')](_0xc39f('0xf3')),'data1':_0x485691[_0xc39f('0x59')][_0xc39f('0x36')]||_0xc39f('0xfc'),'role':_0x3ad5a9[_0xc39f('0x1c')],'internal':_0x3ad5a9[_0xc39f('0x61')]});});return db[_0xc39f('0xf2')]['bulkCreate'](_0x418ed0,{'individualHooks':!![]});})[_0xc39f('0x2e')](function(){return _0x3ad5a9[_0xc39f('0x1b')]({'voicePause':!![],'mailPause':!![],'chatPause':!![],'faxPause':!![],'smsPause':!![],'whatsappPause':!![],'openchannelPause':!![],'pauseType':_0x485691['body'][_0xc39f('0x36')]||_0xc39f('0xfc'),'lastPauseAt':moment()[_0xc39f('0xa2')](_0xc39f('0xf3'))});})[_0xc39f('0x2e')](respondWithResult(_0x465812,null))['catch'](handleError(_0x465812,null));};exports[_0xc39f('0xfd')]=function(_0x528dd7,_0x3dad9c){if(_0x528dd7[_0xc39f('0x59')][_0xc39f('0x92')]&&!utils[_0xc39f('0x96')](_0x528dd7['body'][_0xc39f('0x92')])){throw new APIBadRequestError(util[_0xc39f('0xa2')](_0xc39f('0xfe'),_0x528dd7[_0xc39f('0x59')][_0xc39f('0x92')]));}return db[_0xc39f('0x33')][_0xc39f('0x2a')]({'where':{'id':_0x528dd7[_0xc39f('0x86')]['id']},'attributes':['id',_0xc39f('0x2b'),_0xc39f('0x1c'),'internal','interface',_0xc39f('0xa1'),'voicePause',_0xc39f('0xff'),'chatPause',_0xc39f('0x100'),_0xc39f('0x101'),'smsPause','whatsappPause','pauseType',_0xc39f('0x102')]})[_0xc39f('0x2e')](function(_0x4b7c3b){if(!_0x4b7c3b){throw new APINotFoundError(util['format'](_0xc39f('0xc0'),_0x528dd7['params']['id']));}return _0x4b7c3b[_0xc39f('0xfd')](_0x528dd7[_0xc39f('0x59')]['channel']);})[_0xc39f('0x2e')](respondWithResult(_0x3dad9c,null))[_0xc39f('0x52')](APIHandleError(_0x3dad9c));};exports[_0xc39f('0x103')]=function(_0x5a7277,_0x14c4ea){var _0x3a12ce={};var _0x3ca3d8={};var _0x4d7531;var _0x168b7d;return db[_0xc39f('0x33')][_0xc39f('0xbf')]({'where':{'id':_0x5a7277[_0xc39f('0x86')]['id']}})[_0xc39f('0x2e')](handleEntityNotFound(_0x14c4ea,null))[_0xc39f('0x2e')](function(_0x506a3b){if(_0x506a3b){_0x4d7531=_0x506a3b;_0x3ca3d8['model']=_[_0xc39f('0xcb')](db['Team'][_0xc39f('0x34')]);_0x3ca3d8[_0xc39f('0x41')]=_[_0xc39f('0xcb')](_0x5a7277[_0xc39f('0x41')]);_0x3ca3d8[_0xc39f('0xcc')]=_[_0xc39f('0xcd')](_0x3ca3d8[_0xc39f('0xc9')],_0x3ca3d8[_0xc39f('0x41')]);_0x3a12ce[_0xc39f('0x56')]=_[_0xc39f('0xcd')](_0x3ca3d8['model'],qs[_0xc39f('0xce')](_0x5a7277['query']['fields']));_0x3a12ce[_0xc39f('0x56')]=_0x3a12ce['attributes']['length']?_0x3a12ce[_0xc39f('0x56')]:_0x3ca3d8[_0xc39f('0xc9')];_0x3a12ce[_0xc39f('0xcf')]=qs[_0xc39f('0xd0')](_0x5a7277[_0xc39f('0x41')][_0xc39f('0xd0')]);_0x3a12ce[_0xc39f('0x40')]=qs[_0xc39f('0xcc')](_[_0xc39f('0xd1')](_0x5a7277[_0xc39f('0x41')],_0x3ca3d8[_0xc39f('0xcc')]));if(_0x5a7277[_0xc39f('0x41')][_0xc39f('0x25')]){_0x3a12ce[_0xc39f('0x40')]=_[_0xc39f('0x54')](_0x3a12ce[_0xc39f('0x40')],{'$or':_[_0xc39f('0x27')](_0x3a12ce['attributes'],function(_0x426abf){var _0x48c342={};_0x48c342[_0x426abf]={'$like':'%'+_0x5a7277['query'][_0xc39f('0x25')]+'%'};return _0x48c342;})});}_0x3a12ce=_[_0xc39f('0x54')]({},_0x3a12ce,_0x5a7277[_0xc39f('0x55')]);return _0x4d7531['getTeams'](_0x3a12ce);}})['then'](function(_0x4866b2){if(_0x4866b2){_0x168b7d=_0x4866b2[_0xc39f('0x4b')];if(!_0x5a7277[_0xc39f('0x41')][_0xc39f('0xc1')](_0xc39f('0xd3'))){_0x3a12ce[_0xc39f('0x16')]=qs[_0xc39f('0x16')](_0x5a7277['query'][_0xc39f('0x16')]);_0x3a12ce[_0xc39f('0x15')]=qs[_0xc39f('0x15')](_0x5a7277[_0xc39f('0x41')]['offset']);}return _0x4d7531['getTeams'](_0x3a12ce);}})[_0xc39f('0x2e')](function(_0x118173){if(_0x118173){return _0x118173?{'count':_0x168b7d,'rows':_0x118173}:null;}})[_0xc39f('0x2e')](respondWithResult(_0x14c4ea,null))[_0xc39f('0x52')](handleError(_0x14c4ea,null));};exports[_0xc39f('0x104')]=function(_0x1c11e8,_0x3eb0e7){var _0x1f470=_0x1c11e8['params']['id'];var _0x1ebd67=_0x1c11e8[_0xc39f('0x59')]?_0x1c11e8[_0xc39f('0x59')]['ids']:null;var _0x4823b8=[];return Promise[_0xc39f('0x105')]()['then'](function(){if(!_0x1ebd67)throw new APIBadRequestError(_0xc39f('0x106'));})[_0xc39f('0x2e')](function(){return db[_0xc39f('0x33')]['findOne']({'where':{'id':_0x1f470}});})[_0xc39f('0x2e')](function(_0xd1ab7b){if(!_0xd1ab7b)throw new APINotFoundError(util[_0xc39f('0xa2')](_0xc39f('0xc0'),_0x1c11e8[_0xc39f('0x86')]['id']));return db[_0xc39f('0x64')][_0xc39f('0x107')](function(_0x4a30a0){return _0xd1ab7b[_0xc39f('0x104')](_0x1ebd67,{'transaction':_0x4a30a0})[_0xc39f('0x2e')](function(){return db[_0xc39f('0x108')][_0xc39f('0x47')]({'where':{'id':{'$in':_0x1ebd67}}});})[_0xc39f('0x2e')](function(_0x1e5e47){var _0x142bc9=_[_0xc39f('0x27')](_0x1e5e47,function(_0x23d3e9){return _0x23d3e9['getAssociatedQueues']();});return Promise[_0xc39f('0x51')](_0x142bc9);})[_0xc39f('0x2e')](function(_0x4677ce){_0x4823b8=_['flattenDeep'](_0x4677ce);var _0x24661f=_['map'](_0x4823b8,function(_0x4a6a94){return _0x4a6a94[_0xc39f('0x109')](_0xd1ab7b['id'],{'transaction':_0x4a30a0});});return Promise[_0xc39f('0x51')](_0x24661f);})[_0xc39f('0x2e')](function(){if(!_0xd1ab7b[_0xc39f('0xa1')])return;var _0x142783=_[_0xc39f('0x25')](_0x4823b8,function(_0x5e22e3){return _0x5e22e3[_0xc39f('0x10a')](_0xc39f('0x92'))==='Voice';});var _0x5bf6ef=_[_0xc39f('0x27')](_0x142783,function(_0x8add26){return db[_0xc39f('0xa3')][_0xc39f('0xa4')]({'membername':_0xd1ab7b['name'],'UserId':_0xd1ab7b['id'],'queue_name':_0x8add26[_0xc39f('0x2b')],'VoiceQueueId':_0x8add26['id'],'interface':_[_0xc39f('0x62')](_0xd1ab7b[_0xc39f('0x95')])?util[_0xc39f('0xa2')](_0xc39f('0xe9'),_0xd1ab7b[_0xc39f('0x2b')]):_0xd1ab7b[_0xc39f('0x95')],'paused':_0xd1ab7b[_0xc39f('0x94')]||![],'penalty':_0xd1ab7b['penalty']},{'transaction':_0x4a30a0});});return Promise[_0xc39f('0x51')](_0x5bf6ef);})[_0xc39f('0x2e')](function(){return db[_0xc39f('0x10b')]['findAll']({'where':{'teamId':{'$in':_0x1ebd67}}});})[_0xc39f('0x2e')](function(_0x12c8a6){var _0x599316=_[_0xc39f('0x27')](_0x12c8a6,function(_0x535a94){return db[_0xc39f('0x10c')][_0xc39f('0x77')]({'UserId':_0xd1ab7b['id'],'VoicePrefixId':_0x535a94[_0xc39f('0x10d')]},{'transaction':_0x4a30a0});});return Promise['all'](_0x599316);});});})[_0xc39f('0x2e')](function(){for(var _0x184f0e=0x0;_0x184f0e<_0x4823b8[_0xc39f('0x4b')];_0x184f0e++){var _0x48f355=_0x4823b8[_0x184f0e][_0xc39f('0x10a')](_0xc39f('0x92'));var _0x4da169=_0x48f355+_0xc39f('0xa7');socket[_0xc39f('0x9d')](_0xc39f('0x22')+_0x48f355+_0xc39f('0x9e'),{'UserId':_0x1f470,['queueField']:_0x4823b8[_0x184f0e]['id']});}})[_0xc39f('0x2e')](respondWithStatusCode(_0x3eb0e7,null))[_0xc39f('0x52')](APIHandleError(_0x3eb0e7));};exports[_0xc39f('0x10e')]=function(_0x1236e0,_0x391311){var _0x547a15=_0x1236e0[_0xc39f('0x86')]['id'];var _0x5232de=null;if(_0x1236e0['query']['ids']){_0x5232de=_[_0xc39f('0x10f')](_0x1236e0['query'][_0xc39f('0x5c')])?_0x1236e0['query']['ids']:[_0x1236e0[_0xc39f('0x41')][_0xc39f('0x5c')]];}var _0x2f61ea=[];return Promise[_0xc39f('0x105')]()['then'](function(){if(!_0x5232de)throw new APIBadRequestError(_0xc39f('0x110'));})[_0xc39f('0x2e')](function(){return db[_0xc39f('0x33')][_0xc39f('0xbf')]({'where':{'id':_0x547a15}});})[_0xc39f('0x2e')](function(_0x50d605){if(!_0x50d605)throw new APINotFoundError(util['format'](_0xc39f('0xc0'),_0x1236e0[_0xc39f('0x86')]['id']));return db['sequelize'][_0xc39f('0x107')](function(_0xbab507){return _0x50d605[_0xc39f('0x10e')](_0x5232de,{'transaction':_0xbab507})[_0xc39f('0x2e')](function(){return db[_0xc39f('0x108')][_0xc39f('0x47')]({'where':{'id':{'$in':_0x5232de}}});})[_0xc39f('0x2e')](function(_0x3f4655){var _0x2f846a=_['map'](_0x3f4655,function(_0x1e815f){return _0x1e815f[_0xc39f('0x111')]();});return Promise[_0xc39f('0x51')](_0x2f846a);})[_0xc39f('0x2e')](function(_0x47ff20){_0x2f61ea=_[_0xc39f('0x112')](_0x47ff20);var _0x43e0f0=_[_0xc39f('0x27')](_0x2f61ea,function(_0xcc69f3){return _0xcc69f3[_0xc39f('0x113')](_0x50d605['id'],{'transaction':_0xbab507});});return Promise[_0xc39f('0x51')](_0x43e0f0);})[_0xc39f('0x2e')](function(){if(!_0x50d605[_0xc39f('0xa1')])return;var _0xd103d8=_['filter'](_0x2f61ea,function(_0x52cddb){return _0x52cddb[_0xc39f('0x10a')](_0xc39f('0x92'))===_0xc39f('0x114');});var _0x266cd5=_['map'](_0xd103d8,function(_0xd9d96c){return db[_0xc39f('0xa3')][_0xc39f('0x2d')]({'where':{'VoiceQueueId':_0xd9d96c['id'],'UserId':_0x50d605['id']},'transaction':_0xbab507});});return Promise['all'](_0x266cd5);})[_0xc39f('0x2e')](function(){return db[_0xc39f('0x10b')][_0xc39f('0x47')]({'where':{'teamId':{'$in':_0x5232de}}});})['then'](function(_0x433b19){var _0x4f9822=_[_0xc39f('0x27')](_0x433b19,function(_0x418d0f){return db[_0xc39f('0x10c')][_0xc39f('0x2d')]({'where':{'UserId':_0x50d605['id'],'VoicePrefixId':_0x418d0f['VoicePrefixId']}},{'transaction':_0xbab507});});return Promise[_0xc39f('0x51')](_0x4f9822);});});})[_0xc39f('0x2e')](function(){for(var _0x27e9d1=0x0;_0x27e9d1<_0x2f61ea[_0xc39f('0x4b')];_0x27e9d1++){var _0x240ff7=_0x2f61ea[_0x27e9d1][_0xc39f('0x10a')](_0xc39f('0x92'));var _0xf4e34f=_0x240ff7+_0xc39f('0xa7');socket['emit'](_0xc39f('0x22')+_0x240ff7+_0xc39f('0xa8'),{'UserId':_0x547a15,['queueField']:_0x2f61ea[_0x27e9d1]['id']});}})[_0xc39f('0x2e')](respondWithStatusCode(_0x391311,null))['catch'](APIHandleError(_0x391311));};exports['getLists']=function(_0x4cdbce,_0x223d09){var _0x365a93={};var _0x1ef112={};var _0x505e74;var _0x52a7e5;return db[_0xc39f('0x33')][_0xc39f('0xbf')]({'where':{'id':_0x4cdbce['params']['id']}})[_0xc39f('0x2e')](handleEntityNotFound(_0x223d09,null))[_0xc39f('0x2e')](function(_0x276514){if(_0x276514){_0x505e74=_0x276514;_0x1ef112[_0xc39f('0xc9')]=_[_0xc39f('0xcb')](db[_0xc39f('0xc2')]['rawAttributes']);_0x1ef112[_0xc39f('0x41')]=_[_0xc39f('0xcb')](_0x4cdbce['query']);_0x1ef112[_0xc39f('0xcc')]=_[_0xc39f('0xcd')](_0x1ef112[_0xc39f('0xc9')],_0x1ef112[_0xc39f('0x41')]);_0x365a93[_0xc39f('0x56')]=_[_0xc39f('0xcd')](_0x1ef112[_0xc39f('0xc9')],qs[_0xc39f('0xce')](_0x4cdbce[_0xc39f('0x41')][_0xc39f('0xce')]));_0x365a93['attributes']=_0x365a93['attributes'][_0xc39f('0x4b')]?_0x365a93['attributes']:_0x1ef112[_0xc39f('0xc9')];_0x365a93[_0xc39f('0xcf')]=qs[_0xc39f('0xd0')](_0x4cdbce['query']['sort']);_0x365a93[_0xc39f('0x40')]=qs[_0xc39f('0xcc')](_[_0xc39f('0xd1')](_0x4cdbce[_0xc39f('0x41')],_0x1ef112['filters']));if(_0x4cdbce[_0xc39f('0x41')][_0xc39f('0x25')]){_0x365a93['where']=_['merge'](_0x365a93[_0xc39f('0x40')],{'$or':_['map'](_0x365a93[_0xc39f('0x56')],function(_0x373141){var _0x31df37={};_0x31df37[_0x373141]={'$like':'%'+_0x4cdbce[_0xc39f('0x41')][_0xc39f('0x25')]+'%'};return _0x31df37;})});}_0x365a93=_[_0xc39f('0x54')]({},_0x365a93,_0x4cdbce[_0xc39f('0x55')]);return _0x505e74['getLists'](_0x365a93);}})['then'](function(_0x23074b){if(_0x23074b){_0x52a7e5=_0x23074b[_0xc39f('0x4b')];if(!_0x4cdbce[_0xc39f('0x41')][_0xc39f('0xc1')]('nolimit')){_0x365a93['limit']=qs[_0xc39f('0x16')](_0x4cdbce[_0xc39f('0x41')]['limit']);_0x365a93['offset']=qs[_0xc39f('0x15')](_0x4cdbce[_0xc39f('0x41')][_0xc39f('0x15')]);}return _0x505e74[_0xc39f('0x115')](_0x365a93);}})[_0xc39f('0x2e')](function(_0x5787ac){if(_0x5787ac){return _0x5787ac?{'count':_0x52a7e5,'rows':_0x5787ac}:null;}})[_0xc39f('0x2e')](respondWithResult(_0x223d09,null))['catch'](handleError(_0x223d09,null));};exports[_0xc39f('0x116')]=function(_0x142ff1,_0x1ad2a2){var _0x9e41b0={};var _0x3123ab={};var _0x4de0c9;return db[_0xc39f('0x33')]['findOne']({'where':{'id':_0x142ff1['params']['id']}})['then'](handleEntityNotFound(_0x1ad2a2,null))[_0xc39f('0x2e')](function(_0x2346f2){if(_0x2346f2){_0x4de0c9=_0x2346f2;_0x3123ab[_0xc39f('0xc9')]=_[_0xc39f('0xcb')](db[_0xc39f('0x33')]['rawAttributes']);_0x3123ab[_0xc39f('0x41')]=_['keys'](_0x142ff1[_0xc39f('0x41')]);_0x3123ab['filters']=_[_0xc39f('0xcd')](_0x3123ab[_0xc39f('0xc9')],_0x3123ab[_0xc39f('0x41')]);_0x9e41b0[_0xc39f('0x56')]=_[_0xc39f('0xcd')](_0x3123ab[_0xc39f('0xc9')],qs[_0xc39f('0xce')](_0x142ff1[_0xc39f('0x41')]['fields']));_0x9e41b0[_0xc39f('0x56')]=_0x9e41b0[_0xc39f('0x56')][_0xc39f('0x4b')]?_0x9e41b0[_0xc39f('0x56')]:_0x3123ab[_0xc39f('0xc9')];_0x9e41b0['order']=qs['sort'](_0x142ff1[_0xc39f('0x41')]['sort']);_0x9e41b0[_0xc39f('0x40')]=qs[_0xc39f('0xcc')](_[_0xc39f('0xd1')](_0x142ff1[_0xc39f('0x41')],_0x3123ab[_0xc39f('0xcc')]));if(_0x142ff1[_0xc39f('0x41')][_0xc39f('0x25')]){_0x9e41b0[_0xc39f('0x40')]=_[_0xc39f('0x54')](_0x9e41b0[_0xc39f('0x40')],{'$or':_[_0xc39f('0x27')](_0x9e41b0[_0xc39f('0x56')],function(_0x4d017f){var _0x29a235={};_0x29a235[_0x4d017f]={'$like':'%'+_0x142ff1[_0xc39f('0x41')][_0xc39f('0x25')]+'%'};return _0x29a235;})});}_0x9e41b0['model']=db[_0xc39f('0x33')];_0x9e41b0['as']='Agents';_0x9e41b0=_['merge']({},_0x9e41b0,_0x142ff1['options']);return _0x4de0c9[_0xc39f('0x117')]({'include':[_0x9e41b0]});}})[_0xc39f('0x2e')](function(_0x501a34){if(_0x501a34){var _0x13a896={},_0x571002=[];for(var _0x1ca701=0x0;_0x1ca701<_0x501a34['length'];_0x1ca701+=0x1){for(var _0x5401b5=0x0,_0x45999d;_0x5401b5<_0x501a34[_0x1ca701]['Agents'][_0xc39f('0x4b')];_0x5401b5+=0x1){_0x45999d=_0x501a34[_0x1ca701][_0xc39f('0x7d')][_0x5401b5][_0xc39f('0x1f')]({'plain':!![]});_0x13a896[_0x45999d['id']]=_0x45999d;}}_0x13a896=_['values'](_0x13a896);for(var _0x15bb25=qs[_0xc39f('0x15')](_0x142ff1[_0xc39f('0x41')]['offset']);_0x15bb25<_0x13a896['length']&&_0x571002['length']=_0x17378b){_0x29e9b1=_0x17378b;_0x409401=0xc8;}else{_0x409401=0xce;}_0x3ba207[_0xc2ea('0x15')](_0x409401);return _0x3ba207[_0xc2ea('0x1c')](_0xc2ea('0x1d'),_0x38a825+'-'+_0x29e9b1+'/'+_0x17378b)['json'](_0x37b897);}return null;};}function saveUpdates(_0x37ed34){return function(_0xd44b17){if(_0xd44b17){return _0xd44b17[_0xc2ea('0x1e')](_0x37ed34)[_0xc2ea('0x1f')](function(_0x310838){if(_0x310838[_0xc2ea('0x20')]===_0xc2ea('0x21')){socket[_0xc2ea('0x22')](_0xc2ea('0x23')+_0x310838['id'],_0x310838);}return _0x310838;});}return null;};}function removeEntity(_0x2c9b5e){return function(_0x426815){if(_0x426815){return _0x426815[_0xc2ea('0x24')]()[_0xc2ea('0x1f')](function(){var _0x37aa1d=_0x426815[_0xc2ea('0x25')]({'plain':!![]});if(_0x37aa1d[_0xc2ea('0x20')]===_0xc2ea('0x26'))return;var _0xc2953c=[{'name':'Users','value':_0xc2ea('0x27'),'ignore':!![]},{'name':_0xc2ea('0x28'),'value':_0xc2ea('0x21'),'ignore':![]},{'name':_0xc2ea('0x29'),'value':_0xc2ea('0x2a'),'ignore':![]}];var _0x424c5b=_(_0xc2953c)['filter'](_0xc2ea('0x2b'))['map'](_0xc2ea('0x2c'))[_0xc2ea('0x2c')]();if(_[_0xc2ea('0x2d')](_0x424c5b,_0x37aa1d['role'])){return;}var _0x16b37e=_[_0xc2ea('0x2e')](_0xc2953c,[_0xc2ea('0x2c'),_0x37aa1d[_0xc2ea('0x20')]])[_0xc2ea('0x2f')];return db['UserProfileResource'][_0xc2ea('0x24')]({'where':{'type':_0x16b37e,'resourceId':_0x37aa1d['id']}})[_0xc2ea('0x1f')](function(){return _0x426815;});})['then'](function(){_0x2c9b5e[_0xc2ea('0x15')](0xcc)[_0xc2ea('0x16')]();});}};}function handleEntityNotFound(_0x4de59d){return function(_0x42dda2){if(!_0x42dda2){_0x4de59d['sendStatus'](0x194);}return _0x42dda2;};}function handleError(_0x3bde0f,_0x534dae){_0x534dae=_0x534dae||0x1f4;return function(_0x595810){logger[_0xc2ea('0x30')](_0x595810[_0xc2ea('0x31')]);if(_0x595810[_0xc2ea('0x2f')]){delete _0x595810['name'];}_0x3bde0f[_0xc2ea('0x15')](_0x534dae)['send'](_0x595810);};}function getUserAttributes(){return _(db[_0xc2ea('0x32')][_0xc2ea('0x33')])[_0xc2ea('0x34')](function(_0x55907f){return{'name':_0x55907f[_0xc2ea('0x35')],'type':_0x55907f[_0xc2ea('0x36')]['key']};})[_0xc2ea('0x37')](function(_0x77a52b){return![_0xc2ea('0x38'),_0xc2ea('0x39'),_0xc2ea('0x3a'),_0xc2ea('0x3b'),_0xc2ea('0x3c'),'md5secret']['includes'](_0x77a52b[_0xc2ea('0x2f')]);})[_0xc2ea('0x2c')]();}exports[_0xc2ea('0x3d')]=function(_0x336eab,_0x586dc1){var _0x17de20={},_0x6ac646={'count':0x0,'rows':[]};var _0x3fcfe4=getUserAttributes();_0x17de20=qs[_0xc2ea('0x3e')](_0x3fcfe4,_0x336eab);var _0x29be70={'where':_0x17de20[_0xc2ea('0x3f')]};return db[_0xc2ea('0x32')][_0xc2ea('0x19')](_0x29be70)[_0xc2ea('0x1f')](function(_0x5c99ba){_0x6ac646['count']=_0x5c99ba;if(_0x336eab[_0xc2ea('0x40')][_0xc2ea('0x41')]){_0x17de20[_0xc2ea('0x42')]=[{'all':!![]}];}if(_0x336eab[_0xc2ea('0x40')][_0xc2ea('0x43')]===_0xc2ea('0x44')){_0x17de20[_0xc2ea('0x42')]=[{'model':db['UserSetting'],'as':_0xc2ea('0x43')}];}if(!_['includes'](_0x17de20['attributes'],'id')){_0x17de20[_0xc2ea('0x45')]['push']('id');}return db[_0xc2ea('0x32')][_0xc2ea('0x46')](_0x17de20);})[_0xc2ea('0x1f')](function(_0x96afd4){_0x6ac646[_0xc2ea('0x47')]=_0x96afd4;if(_0x336eab['query']['openTabs']===_0xc2ea('0x44')){var _0xd388f9=[];for(var _0x1ddd0a=0x0;_0x1ddd0a<_0x6ac646[_0xc2ea('0x47')][_0xc2ea('0x48')];_0x1ddd0a++){_0xd388f9[_0xc2ea('0x49')](get_open_tabs(_0xc2ea('0x4a'),_0x6ac646['rows'][_0x1ddd0a][_0xc2ea('0x4b')]));_0xd388f9[_0xc2ea('0x49')](get_open_tabs(_0xc2ea('0x4c'),_0x6ac646['rows'][_0x1ddd0a]['dataValues']));_0xd388f9[_0xc2ea('0x49')](get_open_tabs(_0xc2ea('0x4d'),_0x6ac646[_0xc2ea('0x47')][_0x1ddd0a]['dataValues']));_0xd388f9[_0xc2ea('0x49')](get_open_tabs(_0xc2ea('0x4e'),_0x6ac646[_0xc2ea('0x47')][_0x1ddd0a][_0xc2ea('0x4b')]));_0xd388f9[_0xc2ea('0x49')](get_open_tabs(_0xc2ea('0x4f'),_0x6ac646['rows'][_0x1ddd0a][_0xc2ea('0x4b')]));_0xd388f9['push'](get_open_tabs(_0xc2ea('0x50'),_0x6ac646[_0xc2ea('0x47')][_0x1ddd0a][_0xc2ea('0x4b')]));}return Promise[_0xc2ea('0x51')](_0xd388f9)[_0xc2ea('0x1f')](function(){return _0x6ac646;});}else{return _0x6ac646;}})[_0xc2ea('0x1f')](respondWithFilteredResult(_0x586dc1,_0x17de20))[_0xc2ea('0x52')](handleError(_0x586dc1,null));};exports[_0xc2ea('0x53')]=function(_0x4b287f,_0x514c73){var _0x1d9174=getUserAttributes();_0x4b287f[_0xc2ea('0x40')]['id']=_0x4b287f['params']['id'];var _0x413715=qs[_0xc2ea('0x3e')](_0x1d9174,_0x4b287f);if(_0x4b287f[_0xc2ea('0x40')][_0xc2ea('0x41')]){_0x413715[_0xc2ea('0x42')]=[{'all':!![]}];}if(_0x4b287f[_0xc2ea('0x40')]['userSetting']===_0xc2ea('0x44')){_0x413715[_0xc2ea('0x42')]=[{'model':db['UserSetting'],'as':_0xc2ea('0x43')}];}_0x413715=_[_0xc2ea('0x54')]({},_0x413715,_0x4b287f[_0xc2ea('0x55')]);if(!_[_0xc2ea('0x2d')](_0x413715[_0xc2ea('0x45')],'id')){_0x413715['attributes'][_0xc2ea('0x49')]('id');}return db[_0xc2ea('0x32')][_0xc2ea('0x2e')](_0x413715)[_0xc2ea('0x1f')](handleEntityNotFound(_0x514c73,null))[_0xc2ea('0x1f')](function(_0x38bce){var _0x3e463c=[];values=_0x38bce;if(_0x4b287f[_0xc2ea('0x40')]['openTabs']==='true'){_0x3e463c[_0xc2ea('0x49')](get_open_tabs('chat',_0x38bce[_0xc2ea('0x4b')]));_0x3e463c[_0xc2ea('0x49')](get_open_tabs(_0xc2ea('0x4c'),_0x38bce[_0xc2ea('0x4b')]));_0x3e463c[_0xc2ea('0x49')](get_open_tabs(_0xc2ea('0x4f'),_0x38bce[_0xc2ea('0x4b')]));_0x3e463c['push'](get_open_tabs(_0xc2ea('0x50'),_0x38bce[_0xc2ea('0x4b')]));_0x3e463c[_0xc2ea('0x49')](get_open_tabs(_0xc2ea('0x4d'),_0x38bce['dataValues']));_0x3e463c['push'](get_open_tabs(_0xc2ea('0x4e'),_0x38bce[_0xc2ea('0x4b')]));return Promise[_0xc2ea('0x51')](_0x3e463c);}else{return values;}})['then'](function(){return values;})[_0xc2ea('0x1f')](respondWithResult(_0x514c73,null))[_0xc2ea('0x52')](handleError(_0x514c73,null));};exports[_0xc2ea('0x1e')]=function(_0x14ef40,_0x1508a6){if(_0x14ef40['body']['id']){delete _0x14ef40['body']['id'];}delete _0x14ef40['body'][_0xc2ea('0x20')];return db[_0xc2ea('0x32')][_0xc2ea('0x2e')]({'where':{'id':_0x14ef40[_0xc2ea('0x56')]['id']}})['then'](handleEntityNotFound(_0x1508a6,null))[_0xc2ea('0x1f')](saveUpdates(_0x14ef40['body'],null))[_0xc2ea('0x1f')](respondWithResult(_0x1508a6,null))[_0xc2ea('0x52')](handleError(_0x1508a6,null));};exports[_0xc2ea('0x57')]=function(_0x575a66,_0x1571eb){return db[_0xc2ea('0x32')][_0xc2ea('0x57')]()[_0xc2ea('0x1f')](respondWithResult(_0x1571eb,null))[_0xc2ea('0x52')](handleError(_0x1571eb,null));};exports[_0xc2ea('0x58')]=function(_0x3b9ac5,_0xf884a8){return db[_0xc2ea('0x32')][_0xc2ea('0x2e')]({'where':{'id':_0x3b9ac5[_0xc2ea('0x56')]['id']}})[_0xc2ea('0x1f')](handleEntityNotFound(_0xf884a8,null))[_0xc2ea('0x1f')](function(_0x33fc18){if(_0x33fc18){return _0x33fc18[_0xc2ea('0x58')](_0x3b9ac5[_0xc2ea('0x59')][_0xc2ea('0x5a')],_['omit'](_0x3b9ac5[_0xc2ea('0x59')],[_0xc2ea('0x5a'),'id'])||{});}})[_0xc2ea('0x1f')](respondWithResult(_0xf884a8,null))[_0xc2ea('0x52')](handleError(_0xf884a8,null));};function validateUser(_0xfcd60){return new Promise(function(_0x410a27,_0x1ab4cd){if(_0xfcd60['internal'])return _0x410a27(_0xfcd60);return db[_0xc2ea('0x5b')][_0xc2ea('0x5c')](0x1)[_0xc2ea('0x1f')](function(_0x2d1230){if(_0x2d1230['securePassword'])authService[_0xc2ea('0x5d')](_0xfcd60[_0xc2ea('0x38')]);db[_0xc2ea('0x32')]['max']('internal')[_0xc2ea('0x1f')](function(_0x555ee5){if(_['isNil'](_0x555ee5)){_0xfcd60[_0xc2ea('0x5e')]=_0x2d1230[_0xc2ea('0x5f')]||0x1;return;}if(_['isNil'](_0x2d1230[_0xc2ea('0x5f')])||_0x2d1230['min_internal']===_0x555ee5){_0xfcd60[_0xc2ea('0x5e')]=_0x555ee5+0x1;return;}if(_0x2d1230[_0xc2ea('0x5f')]>_0x555ee5){_0xfcd60[_0xc2ea('0x5e')]=_0x2d1230[_0xc2ea('0x5f')];return;}return db[_0xc2ea('0x60')][_0xc2ea('0x40')](_0xc2ea('0x61'),{'type':db[_0xc2ea('0x60')][_0xc2ea('0x62')][_0xc2ea('0x63')]})[_0xc2ea('0x1f')](function(_0x381705){if(_0x381705&&_0x381705['length']){for(var _0x12083b=0x0,_0x1c14d1=_0x381705[_0xc2ea('0x48')];_0x12083b<_0x1c14d1&&_[_0xc2ea('0x64')](_0xfcd60[_0xc2ea('0x5e')]);_0x12083b++){if(_0x2d1230['min_internal']<=_0x381705[_0x12083b]['from']){_0xfcd60[_0xc2ea('0x5e')]=_0x381705[_0x12083b][_0xc2ea('0x65')];}else if(_0x2d1230[_0xc2ea('0x5f')]>_0x381705[_0x12083b][_0xc2ea('0x65')]&&_0x2d1230[_0xc2ea('0x5f')]<=_0x381705[_0x12083b]['to']){_0xfcd60[_0xc2ea('0x5e')]=_0x2d1230[_0xc2ea('0x5f')];}}}if(_['isNil'](_0xfcd60[_0xc2ea('0x5e')])){_0xfcd60[_0xc2ea('0x5e')]=_0x555ee5+0x1;}return _0x410a27(_0xfcd60);});});})[_0xc2ea('0x52')](function(_0xbc8cca){_0x1ab4cd(_0xbc8cca);});});}function updateUser(_0x4aced9){return new Promise(function(_0x187b57,_0x5af3da){try{if(_0x4aced9[_0xc2ea('0x66')]){_0x4aced9[_0xc2ea('0x67')]=_0x4aced9[_0xc2ea('0x5e')];_0x4aced9[_0xc2ea('0x68')]={'mailbox':_0x4aced9[_0xc2ea('0x5e')],'password':_0x4aced9['password'],'fullname':_0x4aced9['fullname'],'email':_0x4aced9[_0xc2ea('0x69')]};}if(_0x4aced9[_0xc2ea('0x20')]===_0xc2ea('0x21')){if(!_0x4aced9[_0xc2ea('0x6a')])_0x4aced9[_0xc2ea('0x6a')]=['101',_0xc2ea('0x6b'),_0xc2ea('0x6c'),_0xc2ea('0x6d'),_0xc2ea('0x6e'),_0xc2ea('0x6f'),_0xc2ea('0x70'),_0xc2ea('0x71'),_0xc2ea('0x72'),_0xc2ea('0x73'),_0xc2ea('0x74'),'100',_0xc2ea('0x75'),_0xc2ea('0x76'),_0xc2ea('0x77')];}_0x187b57(_0x4aced9);}catch(_0x4615c7){_0x5af3da(_0x4615c7);}});}exports['create']=function(_0x52a933,_0x3a0c29){if(_0x52a933['user'][_0xc2ea('0x20')]===_0xc2ea('0x21'))throw new Error('Unauthorized');if(_0x52a933['body'][_0xc2ea('0x20')]===_0xc2ea('0x27')&&_0x52a933[_0xc2ea('0x27')]['role']!==_0xc2ea('0x26')){throw new Error(_0xc2ea('0x78'));}if(_0x52a933['body'][_0xc2ea('0x20')]==='admin'&&_0x52a933['user']['role']!=='admin'){throw new Error(_0xc2ea('0x79'));}return licenseUtil['checkUserLimits']([_0x52a933[_0xc2ea('0x59')]])['then'](function(){return validateUser(_0x52a933[_0xc2ea('0x59')]);})[_0xc2ea('0x1f')](function(_0x260a6f){return updateUser(_0x260a6f)['then'](function(_0x4f14ba){if(_0x4f14ba[_0xc2ea('0x20')]===_0xc2ea('0x26')){_0x4f14ba['settingsEnabled']=_0x52a933[_0xc2ea('0x27')][_0xc2ea('0x7a')];delete _0x4f14ba[_0xc2ea('0x7b')];}return _0x4f14ba;});})[_0xc2ea('0x1f')](function(_0x3cded1){return db[_0xc2ea('0x32')]['create'](_0x3cded1,{'include':[{'model':db[_0xc2ea('0x68')],'as':_0xc2ea('0x68')}]});})[_0xc2ea('0x1f')](function(_0x1d556f){if(_0x52a933[_0xc2ea('0x59')]['role']===_0xc2ea('0x27'))return _0x1d556f;if(_0x52a933['user'][_0xc2ea('0x20')]!==_0xc2ea('0x27'))return _0x1d556f;return db['UserProfileSection']['find']({'where':{'name':_0x1d556f[_0xc2ea('0x20')]===_0xc2ea('0x21')?_0xc2ea('0x28'):_0xc2ea('0x29'),'userProfileId':_0x52a933[_0xc2ea('0x27')]['userProfileId']},'raw':!![]})[_0xc2ea('0x1f')](function(_0x536746){if(!_0x536746||_0x536746[_0xc2ea('0x7c')]!=0x0)return _0x1d556f;return db[_0xc2ea('0x7d')][_0xc2ea('0x7e')]({'name':_0x1d556f['name'],'resourceId':_0x1d556f['id'],'type':_0x536746['name'],'sectionId':_0x536746['id']},{})['then'](function(){return _0x1d556f;});})[_0xc2ea('0x52')](function(_0x448d86){logger[_0xc2ea('0x30')](_0xc2ea('0x7f'),_0x448d86);throw _0x448d86;});})[_0xc2ea('0x1f')](respondWithResult(_0x3a0c29,0xc9))['catch'](handleError(_0x3a0c29,null));};exports[_0xc2ea('0x80')]=function(_0x19aa0d,_0x158f10){var _0x5419f5=_0x19aa0d[_0xc2ea('0x59')];var _0x18522d=[];if(_0x19aa0d[_0xc2ea('0x27')][_0xc2ea('0x20')]===_0xc2ea('0x21'))throw new Error(_0xc2ea('0x81'));if(_[_0xc2ea('0x82')](_0x5419f5,[_0xc2ea('0x20'),_0xc2ea('0x27')])&&_0x19aa0d[_0xc2ea('0x27')][_0xc2ea('0x20')]!==_0xc2ea('0x26')){throw new Error('Unauthorized.\x20You\x20must\x20be\x20an\x20administrator\x20in\x20order\x20to\x20create\x20an\x20user');}if(_[_0xc2ea('0x82')](_0x5419f5,[_0xc2ea('0x20'),_0xc2ea('0x26')])&&_0x19aa0d['user'][_0xc2ea('0x20')]!==_0xc2ea('0x26')){throw new Error(_0xc2ea('0x83'));}return licenseUtil[_0xc2ea('0x84')](_0x5419f5)[_0xc2ea('0x1f')](function(){return validateUser(_0x5419f5[0x0]);})[_0xc2ea('0x1f')](function(){for(var _0x1e007f=0x1;_0x1e007f<_0x5419f5['length'];_0x1e007f++){var _0x19641e=_0x5419f5[_0x1e007f-0x1][_0xc2ea('0x5e')];if(!_0x5419f5[_0x1e007f][_0xc2ea('0x5e')])_0x5419f5[_0x1e007f][_0xc2ea('0x5e')]=_0x19641e+0x1;_0x18522d[_0xc2ea('0x49')](validateUser(_0x5419f5[_0x1e007f]));}return Promise[_0xc2ea('0x51')](_0x18522d);})[_0xc2ea('0x1f')](function(){_0x18522d=[];for(var _0x37c608=0x0;_0x37c608<_0x5419f5[_0xc2ea('0x48')];_0x37c608++){_0x18522d[_0xc2ea('0x49')](updateUser(_0x5419f5[_0x37c608]));}return Promise['all'](_0x18522d);})[_0xc2ea('0x1f')](function(){_0x18522d=_0x5419f5[_0xc2ea('0x34')](function(_0x2a3c98){return db['User'][_0xc2ea('0x7e')](_0x2a3c98,{'include':[{'model':db[_0xc2ea('0x68')],'as':_0xc2ea('0x68')}]})[_0xc2ea('0x1f')](function(_0x14db45){_0x2a3c98['id']=_0x14db45['id'];return _0x2a3c98;});});return Promise[_0xc2ea('0x51')](_0x18522d);})[_0xc2ea('0x1f')](function(_0x37336f){if(_0x19aa0d[_0xc2ea('0x59')][_0xc2ea('0x20')]===_0xc2ea('0x27'))return _0x37336f;if(_0x19aa0d[_0xc2ea('0x27')]['role']!=='user')return _0x37336f;var _0x271b4f=_[_0xc2ea('0x82')](_0x37336f,function(_0x238384){return _0x238384[_0xc2ea('0x20')]===_0xc2ea('0x21')||_0x238384['role']===_0xc2ea('0x2a');});if(!_0x271b4f)return _0x37336f;return db[_0xc2ea('0x85')][_0xc2ea('0x46')]({'where':{'name':{'$or':[_0xc2ea('0x28'),_0xc2ea('0x29')]},'userProfileId':_0x19aa0d[_0xc2ea('0x27')][_0xc2ea('0x7b')]},'raw':!![]})['then'](function(_0x329734){if(_[_0xc2ea('0x86')](_0x329734)||!_['some'](_0x329734,[_0xc2ea('0x7c'),0x0]))return _0x37336f;_0x18522d=[];var _0x37bc27=_(_0x329734)['map'](function(_0x504496){if(_0x504496[_0xc2ea('0x7c')]===0x1)return;return _0x504496[_0xc2ea('0x2f')]===_0xc2ea('0x28')?'agent':_0xc2ea('0x2a');})['compact']()[_0xc2ea('0x2c')]();for(var _0x34201c=0x0;_0x34201c<_0x37336f[_0xc2ea('0x48')];_0x34201c++){if(!_[_0xc2ea('0x2d')](_0x37bc27,_0x37336f[_0x34201c][_0xc2ea('0x20')]))return;var _0x592d8d=_0x37336f[_0x34201c][_0xc2ea('0x20')]===_0xc2ea('0x21')?'Agents':_0xc2ea('0x29');_0x18522d[_0xc2ea('0x49')](db[_0xc2ea('0x7d')][_0xc2ea('0x7e')]({'name':_0x37336f[_0x34201c]['name'],'resourceId':_0x37336f[_0x34201c]['id'],'type':_0x592d8d,'sectionId':_['find'](_0x329734,[_0xc2ea('0x2f'),_0x592d8d])['id']},{}));}return Promise[_0xc2ea('0x51')](_0x18522d);});})['then'](respondWithResult(_0x158f10,0xc9))[_0xc2ea('0x52')](handleError(_0x158f10,null));};exports[_0xc2ea('0x87')]=function(_0x11e795,_0x57ff2e){if(_0x11e795[_0xc2ea('0x59')]['id']){delete _0x11e795[_0xc2ea('0x59')]['id'];}return db[_0xc2ea('0x32')][_0xc2ea('0x2e')]({'where':{'id':_0x11e795[_0xc2ea('0x56')]['id']}})[_0xc2ea('0x1f')](function(_0x3ed172){if(!_0x3ed172)return null;if(_0x3ed172['id']===_0x11e795[_0xc2ea('0x27')]['id']){if(!_0x11e795['body'][_0xc2ea('0x88')]||!_0x11e795['body'][_0xc2ea('0x89')]){throw new db[(_0xc2ea('0x8a'))][(_0xc2ea('0x8b'))](_0xc2ea('0x8c'));}if(!_0x3ed172[_0xc2ea('0x8d')](_0x11e795[_0xc2ea('0x59')][_0xc2ea('0x88')])){throw new db['Sequelize']['ValidationError'](_0xc2ea('0x8e'));}if(_0x11e795[_0xc2ea('0x59')][_0xc2ea('0x88')]===_0x11e795[_0xc2ea('0x59')]['newPassword']){throw new db[(_0xc2ea('0x8a'))][(_0xc2ea('0x8b'))](_0xc2ea('0x8f'));}}else if(_0x11e795[_0xc2ea('0x27')][_0xc2ea('0x20')]===_0xc2ea('0x26')){if(!_0x11e795[_0xc2ea('0x59')][_0xc2ea('0x89')]){throw new db[(_0xc2ea('0x8a'))][(_0xc2ea('0x8b'))](_0xc2ea('0x90'));}}else if(_0x11e795[_0xc2ea('0x27')][_0xc2ea('0x20')]===_0xc2ea('0x27')){if(!_0x11e795['body'][_0xc2ea('0x89')]){throw new db[(_0xc2ea('0x8a'))][(_0xc2ea('0x8b'))](_0xc2ea('0x90'));}if(_0x3ed172[_0xc2ea('0x20')]!==_0xc2ea('0x21')){throw new db[(_0xc2ea('0x8a'))][(_0xc2ea('0x8b'))](_0xc2ea('0x81'));}}else{throw new db['Sequelize']['ValidationError'](_0xc2ea('0x81'));}return _0x3ed172;})[_0xc2ea('0x1f')](handleEntityNotFound(_0x57ff2e,null))[_0xc2ea('0x1f')](function(_0x3ebb3b){return db['Setting']['findOne']({'attributes':['id',_0xc2ea('0x91'),_0xc2ea('0x92'),_0xc2ea('0x93')]})[_0xc2ea('0x1f')](function(_0x4ac691){if(_0x4ac691['securePassword'])authService[_0xc2ea('0x5d')](_0x11e795[_0xc2ea('0x59')][_0xc2ea('0x89')]);if(!_0x4ac691['enforcePasswordHistory']||!_0x3ebb3b[_0xc2ea('0x3a')])return _0x3ebb3b;authService['validatePasswordHistory'](_0x11e795[_0xc2ea('0x59')][_0xc2ea('0x89')],_0x3ebb3b[_0xc2ea('0x3a')],_0x4ac691[_0xc2ea('0x93')]);return _0x3ebb3b;})[_0xc2ea('0x1f')](saveUpdates({'password':_0x11e795[_0xc2ea('0x59')][_0xc2ea('0x89')],'passwordResetAt':_0x11e795['user']['id']==_0x11e795[_0xc2ea('0x56')]['id']?moment():null,'previousPasswords':authService[_0xc2ea('0x94')](_0x11e795[_0xc2ea('0x59')][_0xc2ea('0x89')],_0x3ebb3b[_0xc2ea('0x3a')])},null));})[_0xc2ea('0x1f')](respondWithResult(_0x57ff2e,null))[_0xc2ea('0x52')](handleError(_0x57ff2e,null));};exports[_0xc2ea('0x95')]=function(_0x1138d7,_0x4d9d4f){var _0x1c8315=_0x1138d7['body']['channel'];return db[_0xc2ea('0x32')][_0xc2ea('0x2e')]({'where':{'id':_0x1138d7[_0xc2ea('0x56')]['id']},'attributes':['id',_0xc2ea('0x2f'),'role',_0xc2ea('0x96'),_0xc2ea('0x97'),_0xc2ea('0x98'),_0xc2ea('0x99')]})[_0xc2ea('0x1f')](handleEntityNotFound(_0x4d9d4f,null))[_0xc2ea('0x1f')](function(_0x30774c){if(_0x30774c){if(!utils[_0xc2ea('0x9a')](_0x1c8315)){throw new db[(_0xc2ea('0x8a'))][(_0xc2ea('0x8b'))](_0xc2ea('0x9b'));}return _0x30774c[_0xc2ea('0x9c')+_[_0xc2ea('0x9d')](_0x1c8315[_0xc2ea('0x9e')]())+_0xc2ea('0x9f')](_0x1138d7['body'][_0xc2ea('0x5a')],{'penalty':_0x1138d7[_0xc2ea('0x59')]['penalty']||0x0})[_0xc2ea('0xa0')](function(_0x49dadb){for(var _0x436c38=0x0;_0x436c38<_0x1138d7[_0xc2ea('0x59')][_0xc2ea('0x5a')][_0xc2ea('0x48')];_0x436c38+=0x1){var _0xaabbb2={'UserId':Number(_0x1138d7['params']['id'])};_0xaabbb2[_[_0xc2ea('0x9d')](_0x1c8315['toLowerCase']())+_0xc2ea('0xa1')]=Number(_0x1138d7['body'][_0xc2ea('0x5a')][_0x436c38]);socket[_0xc2ea('0x22')](_0xc2ea('0x27')+_[_0xc2ea('0x9d')](_0x1c8315[_0xc2ea('0x9e')]())+_0xc2ea('0xa2'),_0xaabbb2);}return _0x49dadb;})[_0xc2ea('0x1f')](function(){if(_0x1c8315===_0xc2ea('0xa3')){return db['VoiceQueue'][_0xc2ea('0x46')]({'where':{'id':_0x1138d7[_0xc2ea('0x59')][_0xc2ea('0x5a')]||[]},'raw':!![],'attributes':['id',_0xc2ea('0x2f')]});}})[_0xc2ea('0x1f')](function(_0x270f02){var _0x29b0ff=_0x30774c['get']({'plain':!![]});var _0x42f0b5=[];if(_0x1c8315===_0xc2ea('0xa3')&&_0x29b0ff[_0xc2ea('0x20')]===_0xc2ea('0x21')&&_0x29b0ff[_0xc2ea('0x96')]){for(let _0x49547a=0x0;_0x49547a<_0x270f02[_0xc2ea('0x48')];_0x49547a+=0x1){_0x42f0b5[_0xc2ea('0x49')]({'membername':_0x29b0ff[_0xc2ea('0x2f')],'UserId':_0x29b0ff['id'],'queue_name':_0x270f02[_0x49547a][_0xc2ea('0x2f')],'VoiceQueueId':_0x270f02[_0x49547a]['id'],'interface':_['isNil'](_0x29b0ff[_0xc2ea('0x99')])?util['format'](_0xc2ea('0xa4'),_0x29b0ff[_0xc2ea('0x2f')]):_0x29b0ff[_0xc2ea('0x99')],'paused':_0x29b0ff[_0xc2ea('0x98')]||![],'penalty':_0x1138d7[_0xc2ea('0x59')][_0xc2ea('0xa5')]||0x0});}return Promise[_0xc2ea('0x51')](_0x42f0b5[_0xc2ea('0x34')](function(_0x246d06){return db[_0xc2ea('0xa6')][_0xc2ea('0xa7')](_0x246d06);}));}return _0x30774c;});}})[_0xc2ea('0x1f')](respondWithStatusCode(_0x4d9d4f,null))[_0xc2ea('0x52')](handleError(_0x4d9d4f,null));};exports[_0xc2ea('0xa8')]=function(_0x24f791,_0x59c22b){var _0x457982,_0x30dbba;return db[_0xc2ea('0x32')][_0xc2ea('0x2e')]({'where':{'id':_0x24f791[_0xc2ea('0x56')]['id']},'attributes':['id',_0xc2ea('0x2f'),_0xc2ea('0x20')]})['then'](handleEntityNotFound(_0x59c22b,null))[_0xc2ea('0x1f')](function(_0x2dda4a){if(_0x2dda4a){_0x457982=_0x2dda4a;if(!_0x24f791[_0xc2ea('0x40')][_0xc2ea('0xa9')]||!utils[_0xc2ea('0x9a')](_0x24f791['query'][_0xc2ea('0xa9')])){throw new db[(_0xc2ea('0x8a'))]['ValidationError'](_0xc2ea('0x9b'));}return _0x2dda4a[_0xc2ea('0xaa')+_[_0xc2ea('0x9d')](_0x24f791[_0xc2ea('0x40')][_0xc2ea('0xa9')][_0xc2ea('0x9e')]())+_0xc2ea('0x9f')](_0x24f791[_0xc2ea('0x40')][_0xc2ea('0x5a')]);}})[_0xc2ea('0x1f')](function(_0x326ede){if(_[_0xc2ea('0xab')](_0x24f791[_0xc2ea('0x40')][_0xc2ea('0x5a')])){for(var _0x2b7fee=0x0;_0x2b7fee<_0x24f791['query'][_0xc2ea('0x5a')]['length'];_0x2b7fee+=0x1){_0x30dbba={'UserId':Number(_0x24f791[_0xc2ea('0x56')]['id'])};_0x30dbba[_['capitalize'](_0x24f791[_0xc2ea('0x40')]['channel'][_0xc2ea('0x9e')]())+'QueueId']=Number(_0x24f791[_0xc2ea('0x40')][_0xc2ea('0x5a')][_0x2b7fee]);socket['emit'](_0xc2ea('0x27')+_[_0xc2ea('0x9d')](_0x24f791[_0xc2ea('0x40')][_0xc2ea('0xa9')]['toLowerCase']())+_0xc2ea('0xac'),_0x30dbba);}}else{_0x30dbba={'UserId':Number(_0x24f791[_0xc2ea('0x56')]['id'])};_0x30dbba[_['capitalize'](_0x24f791[_0xc2ea('0x40')][_0xc2ea('0xa9')]['toLowerCase']())+'QueueId']=Number(_0x24f791[_0xc2ea('0x40')][_0xc2ea('0x5a')]);socket[_0xc2ea('0x22')]('user'+_[_0xc2ea('0x9d')](_0x24f791['query']['channel'][_0xc2ea('0x9e')]())+_0xc2ea('0xac'),_0x30dbba);}return _0x326ede;})['then'](function(){if(_0x24f791[_0xc2ea('0x40')][_0xc2ea('0xa9')]===_0xc2ea('0xa3')){return db['UserVoiceQueueRt'][_0xc2ea('0x24')]({'where':{'UserId':_0x24f791[_0xc2ea('0x56')]['id'],'VoiceQueueId':_0x24f791[_0xc2ea('0x40')][_0xc2ea('0x5a')]},'individualHooks':!![]})[_0xc2ea('0x1f')](function(){return _0x457982;});}return _0x457982;})[_0xc2ea('0x1f')](respondWithStatusCode(_0x59c22b,null))[_0xc2ea('0x52')](handleError(_0x59c22b,null));};exports[_0xc2ea('0xad')]=function(_0x5714bd,_0x536180){_0x5714bd['body'][_0xc2ea('0xae')]=_0x5714bd[_0xc2ea('0xaf')][_0xc2ea('0xb0')];return db[_0xc2ea('0x32')][_0xc2ea('0x2e')]({'where':{'id':_0x5714bd['params']['id']}})[_0xc2ea('0x1f')](handleEntityNotFound(_0x536180,null))[_0xc2ea('0x1f')](saveUpdates(_0x5714bd[_0xc2ea('0x59')],null))[_0xc2ea('0x1f')](respondWithResult(_0x536180,null))[_0xc2ea('0x52')](handleError(_0x536180,null));};exports[_0xc2ea('0xb1')]=function(_0x13ff1a,_0x32a525){var _0x4fa723=path[_0xc2ea('0xb2')](config[_0xc2ea('0xb3')],_0xc2ea('0xb4'));return db[_0xc2ea('0x32')][_0xc2ea('0x2e')]({'where':{'id':_0x13ff1a[_0xc2ea('0x56')]['id']},'attributes':['id','userpic'],'raw':!![]})['then'](handleEntityNotFound(_0x32a525,null))[_0xc2ea('0x1f')](function(_0x4aee00){if(_0x4aee00){if(_[_0xc2ea('0x64')](_0x4aee00[_0xc2ea('0xae')])){return _0x32a525[_0xc2ea('0xb5')](_0x4fa723);}else{if(!fs[_0xc2ea('0xb6')](path[_0xc2ea('0xb2')](config[_0xc2ea('0xb3')],_0xc2ea('0xb7'),_0x4aee00[_0xc2ea('0xae')]))){return _0x32a525[_0xc2ea('0xb5')](_0x4fa723);}return _0x32a525[_0xc2ea('0xb5')](path[_0xc2ea('0xb2')](config[_0xc2ea('0xb3')],'server/files/images/',_0x4aee00[_0xc2ea('0xae')]));}}})[_0xc2ea('0x52')](handleError(_0x32a525,null));};exports[_0xc2ea('0xb8')]=function(_0x117684,_0x481952){return db[_0xc2ea('0x32')][_0xc2ea('0x2e')]({'where':{'id':_0x117684[_0xc2ea('0x56')]['id']},'attributes':['id']})[_0xc2ea('0x1f')](handleEntityNotFound(_0x481952,null))[_0xc2ea('0x1f')](function(_0x52db2c){var _0x326950=[];values=_0x52db2c['dataValues'];_0x326950[_0xc2ea('0x49')](get_open_tabs('chat',_0x52db2c[_0xc2ea('0x4b')]));_0x326950[_0xc2ea('0x49')](get_open_tabs(_0xc2ea('0x4c'),_0x52db2c['dataValues']));_0x326950[_0xc2ea('0x49')](get_open_tabs(_0xc2ea('0x4f'),_0x52db2c[_0xc2ea('0x4b')]));_0x326950[_0xc2ea('0x49')](get_open_tabs(_0xc2ea('0x50'),_0x52db2c['dataValues']));_0x326950[_0xc2ea('0x49')](get_open_tabs(_0xc2ea('0x4d'),_0x52db2c[_0xc2ea('0x4b')]));_0x326950['push'](get_open_tabs(_0xc2ea('0x4e'),_0x52db2c[_0xc2ea('0x4b')]));return Promise['all'](_0x326950);})[_0xc2ea('0x1f')](function(_0x161e3c){if(_0x161e3c){var _0x2abe32=_['map'](values[_0xc2ea('0xb9')],function(_0x42e8ae){return{'channel':_0xc2ea('0xba'),'id':_0x42e8ae['id'],'createdAt':_0x42e8ae[_0xc2ea('0xbb')]};});var _0x7bc6eb=_[_0xc2ea('0x34')](values[_0xc2ea('0xbc')],function(_0x1880d3){return{'channel':_0xc2ea('0xbd'),'id':_0x1880d3['id'],'createdAt':_0x1880d3[_0xc2ea('0xbb')]};});var _0x55140e=_[_0xc2ea('0x34')](values[_0xc2ea('0xbe')],function(_0x1d66de){return{'channel':'OPENCHANNEL','id':_0x1d66de['id'],'createdAt':_0x1d66de[_0xc2ea('0xbb')]};});var _0x470a95=_[_0xc2ea('0x34')](values['MailOpenTabs'],function(_0xf97620){return{'channel':_0xc2ea('0xbf'),'id':_0xf97620['id'],'createdAt':_0xf97620[_0xc2ea('0xbb')]};});var _0x2424b7=_['map'](values[_0xc2ea('0xc0')],function(_0x1abc7a){return{'channel':_0xc2ea('0xc1'),'id':_0x1abc7a['id'],'createdAt':_0x1abc7a['createdAt']};});var _0xacefc9=_[_0xc2ea('0x34')](values[_0xc2ea('0xc2')],function(_0x160dfa){return{'channel':_0xc2ea('0xc3'),'id':_0x160dfa['id'],'createdAt':_0x160dfa[_0xc2ea('0xbb')]};});var _0x39125e=_[_0xc2ea('0xc4')](_0x2abe32,_0x7bc6eb,_0x55140e,_0x470a95,_0x2424b7,_0xacefc9);var _0x17a2d7={'count':_0x39125e[_0xc2ea('0x48')],'rows':_0x39125e};return _0x17a2d7;}else return null;})['then'](respondWithResult(_0x481952,null))['catch'](handleError(_0x481952,null));};exports[_0xc2ea('0xc5')]=function(_0xfdfb20,_0x498253){var _0x3faa67={};return db[_0xc2ea('0x32')]['findOne']({'where':{'id':_0xfdfb20[_0xc2ea('0x56')]['id']}})[_0xc2ea('0x1f')](function(_0x1166df){if(!_0x1166df){throw new APINotFoundError(util[_0xc2ea('0xc6')]('User\x20with\x20id\x20%s\x20not\x20found',_0xfdfb20['params']['id']));}return contacts['describe']();})[_0xc2ea('0x1f')](function(_0x4b66de){_0xfdfb20['query']['User']=_0xfdfb20[_0xc2ea('0x56')]['id'];_0x3faa67=qs[_0xc2ea('0x3e')](_0x4b66de,_0xfdfb20);if(_0xfdfb20[_0xc2ea('0x40')][_0xc2ea('0xc7')]('includeAll')){_0x3faa67[_0xc2ea('0x42')]=[{'model':db['CmList'],'as':_0xc2ea('0xc8'),'required':![]},{'model':db[_0xc2ea('0xc9')],'as':_0xc2ea('0xca'),'attributes':['id',_0xc2ea('0x2f'),_0xc2ea('0xcb')],'where':_0xfdfb20[_0xc2ea('0x40')][_0xc2ea('0xcc')]?{'id':_0xfdfb20[_0xc2ea('0x40')][_0xc2ea('0xcc')]}:undefined,'required':_0xfdfb20[_0xc2ea('0x40')]['tag']?!![]:![]}];}return contacts[_0xc2ea('0x46')](_0xfdfb20[_0xc2ea('0x40')],_0xfdfb20[_0xc2ea('0x27')],_0x3faa67,_0x4b66de);})[_0xc2ea('0x1f')](respondWithFilteredResult(_0x498253,_0x3faa67))[_0xc2ea('0x52')](APIHandleError(_0x498253));};exports['getQueues']=function(_0x1f30e4,_0x153f59){var _0x1fc16f;var _0x7c048b={};var _0x2bbd55;return db[_0xc2ea('0x32')][_0xc2ea('0xcd')]({'where':{'id':_0x1f30e4[_0xc2ea('0x56')]['id']},'attributes':['id','name',_0xc2ea('0x20')]})[_0xc2ea('0x1f')](handleEntityNotFound(_0x153f59,null))[_0xc2ea('0x1f')](function(_0x41193a){if(!utils[_0xc2ea('0x9a')](_0x1f30e4[_0xc2ea('0x40')]['channel'])){throw new db[(_0xc2ea('0x8a'))][(_0xc2ea('0x8b'))](_0xc2ea('0x9b'));}_0x1fc16f=_0x41193a;var _0x31e93a={};_0x31e93a['model']=_[_0xc2ea('0xce')](db[_[_0xc2ea('0x9d')](_0x1f30e4[_0xc2ea('0x40')]['channel'])+_0xc2ea('0xcf')][_0xc2ea('0x33')]);_0x31e93a[_0xc2ea('0x40')]=_[_0xc2ea('0xce')](_0x1f30e4[_0xc2ea('0x40')]);_0x31e93a[_0xc2ea('0xd0')]=_['intersection'](_0x31e93a[_0xc2ea('0xd1')],_0x31e93a[_0xc2ea('0x40')]);_0x7c048b[_0xc2ea('0x45')]=_[_0xc2ea('0xd2')](_0x31e93a[_0xc2ea('0xd1')],qs[_0xc2ea('0xd3')](_0x1f30e4[_0xc2ea('0x40')]['fields']));_0x7c048b['attributes']=_0x7c048b['attributes'][_0xc2ea('0x48')]?_0x7c048b[_0xc2ea('0x45')]:_0x31e93a[_0xc2ea('0xd1')];_0x7c048b['order']=qs['sort'](_0x1f30e4['query'][_0xc2ea('0xd4')]);_0x7c048b[_0xc2ea('0x3f')]=qs[_0xc2ea('0xd0')](_['pick'](_0x1f30e4[_0xc2ea('0x40')],_0x31e93a[_0xc2ea('0xd0')]));if(_0x1f30e4['query']['filter']){_0x7c048b['where']=_['merge'](_0x7c048b[_0xc2ea('0x3f')],{'$or':_[_0xc2ea('0x34')](_0x7c048b[_0xc2ea('0x45')],function(_0x105ec4){var _0x59ec37={};_0x59ec37[_0x105ec4]={'$like':'%'+_0x1f30e4[_0xc2ea('0x40')][_0xc2ea('0x37')]+'%'};return _0x59ec37;})});}_0x7c048b=_[_0xc2ea('0x54')]({},_0x7c048b,_0x1f30e4[_0xc2ea('0x55')]);switch(_0x1fc16f[_0xc2ea('0x20')]){case'admin':return db[_[_0xc2ea('0x9d')](_0x1f30e4[_0xc2ea('0x40')]['channel'])+_0xc2ea('0xcf')][_0xc2ea('0x46')](_0x7c048b);case'user':case _0xc2ea('0x21'):return _0x1fc16f['get'+_[_0xc2ea('0x9d')](_0x1f30e4[_0xc2ea('0x40')][_0xc2ea('0xa9')])+_0xc2ea('0x9f')](_0x7c048b);default:throw new db['Sequelize'][(_0xc2ea('0x8b'))]('Unknown\x20role');}})[_0xc2ea('0x1f')](function(_0x5a6831){_0x2bbd55=_0x5a6831[_0xc2ea('0x48')];if(!_0x1f30e4[_0xc2ea('0x40')]['hasOwnProperty'](_0xc2ea('0xd5'))){_0x7c048b[_0xc2ea('0x1b')]=qs[_0xc2ea('0x1b')](_0x1f30e4[_0xc2ea('0x40')][_0xc2ea('0x1b')]);_0x7c048b[_0xc2ea('0x1a')]=qs[_0xc2ea('0x1a')](_0x1f30e4[_0xc2ea('0x40')]['offset']);}switch(_0x1fc16f['role']){case _0xc2ea('0x26'):return db[_['capitalize'](_0x1f30e4[_0xc2ea('0x40')][_0xc2ea('0xa9')])+_0xc2ea('0xcf')]['findAll'](_0x7c048b);case _0xc2ea('0x27'):case'agent':return _0x1fc16f[_0xc2ea('0x25')+_['capitalize'](_0x1f30e4[_0xc2ea('0x40')][_0xc2ea('0xa9')])+_0xc2ea('0x9f')](_0x7c048b);}})[_0xc2ea('0x1f')](function(_0x2ad71b){return{'count':_0x2bbd55,'rows':_0x2ad71b};})[_0xc2ea('0x1f')](respondWithResult(_0x153f59,null))[_0xc2ea('0x52')](handleError(_0x153f59,null));};exports[_0xc2ea('0xd6')]=function(_0x184f2e,_0x50e936){var _0x180432={};var _0x31b49b={};var _0x57c8ae;var _0x259dab;return db['User'][_0xc2ea('0xcd')]({'where':{'id':_0x184f2e[_0xc2ea('0x56')]['id']}})['then'](handleEntityNotFound(_0x50e936,null))['then'](function(_0x1b6c49){if(_0x1b6c49){_0x57c8ae=_0x1b6c49;_0x31b49b[_0xc2ea('0xd1')]=_[_0xc2ea('0xce')](db['UserVoiceQueueRt'][_0xc2ea('0x33')]);_0x31b49b[_0xc2ea('0x40')]=_[_0xc2ea('0xce')](_0x184f2e[_0xc2ea('0x40')]);_0x31b49b[_0xc2ea('0xd0')]=_[_0xc2ea('0xd2')](_0x31b49b[_0xc2ea('0xd1')],_0x31b49b['query']);_0x180432[_0xc2ea('0x45')]=_[_0xc2ea('0xd2')](_0x31b49b[_0xc2ea('0xd1')],qs['fields'](_0x184f2e[_0xc2ea('0x40')]['fields']));_0x180432[_0xc2ea('0x45')]=_0x180432[_0xc2ea('0x45')][_0xc2ea('0x48')]?_0x180432[_0xc2ea('0x45')]:_0x31b49b['model'];_0x180432[_0xc2ea('0xd7')]=qs[_0xc2ea('0xd4')](_0x184f2e[_0xc2ea('0x40')][_0xc2ea('0xd4')]);_0x180432['where']=qs[_0xc2ea('0xd0')](_[_0xc2ea('0xd8')](_0x184f2e['query'],_0x31b49b['filters']));if(_0x184f2e['query'][_0xc2ea('0x37')]){_0x180432[_0xc2ea('0x3f')]=_[_0xc2ea('0x54')](_0x180432[_0xc2ea('0x3f')],{'$or':_[_0xc2ea('0x34')](_0x180432['attributes'],function(_0x4a1225){var _0x522340={};_0x522340[_0x4a1225]={'$like':'%'+_0x184f2e[_0xc2ea('0x40')][_0xc2ea('0x37')]+'%'};return _0x522340;})});}_0x180432=_['merge']({},_0x180432,_0x184f2e[_0xc2ea('0x55')]);return _0x57c8ae[_0xc2ea('0xd6')](_0x180432);}})[_0xc2ea('0x1f')](function(_0x3c9231){if(_0x3c9231){_0x259dab=_0x3c9231['length'];if(!_0x184f2e[_0xc2ea('0x40')][_0xc2ea('0xc7')](_0xc2ea('0xd5'))){_0x180432[_0xc2ea('0x1b')]=qs[_0xc2ea('0x1b')](_0x184f2e[_0xc2ea('0x40')]['limit']);_0x180432[_0xc2ea('0x1a')]=qs[_0xc2ea('0x1a')](_0x184f2e[_0xc2ea('0x40')][_0xc2ea('0x1a')]);}return _0x57c8ae[_0xc2ea('0xd6')](_0x180432);}})['then'](function(_0x1973b2){if(_0x1973b2){return _0x1973b2?{'count':_0x259dab,'rows':_0x1973b2}:null;}})[_0xc2ea('0x1f')](respondWithResult(_0x50e936,null))['catch'](handleError(_0x50e936,null));};exports[_0xc2ea('0xd9')]=function(_0x3b7700,_0x3e4a90){var _0x3d47fb={};var _0x47d150={};var _0x307372;var _0xc3fa74;return db['User']['findOne']({'where':{'id':_0x3b7700[_0xc2ea('0x56')]['id']}})[_0xc2ea('0x1f')](handleEntityNotFound(_0x3e4a90,null))[_0xc2ea('0x1f')](function(_0x55fac7){if(_0x55fac7){_0x307372=_0x55fac7;_0x47d150[_0xc2ea('0xd1')]=_[_0xc2ea('0xce')](db[_0xc2ea('0xda')][_0xc2ea('0x33')]);_0x47d150['query']=_['keys'](_0x3b7700[_0xc2ea('0x40')]);_0x47d150[_0xc2ea('0xd0')]=_['intersection'](_0x47d150[_0xc2ea('0xd1')],_0x47d150[_0xc2ea('0x40')]);_0x3d47fb['attributes']=_[_0xc2ea('0xd2')](_0x47d150[_0xc2ea('0xd1')],qs[_0xc2ea('0xd3')](_0x3b7700['query'][_0xc2ea('0xd3')]));_0x3d47fb['attributes']=_0x3d47fb[_0xc2ea('0x45')]['length']?_0x3d47fb[_0xc2ea('0x45')]:_0x47d150[_0xc2ea('0xd1')];_0x3d47fb[_0xc2ea('0xd7')]=qs[_0xc2ea('0xd4')](_0x3b7700['query'][_0xc2ea('0xd4')]);_0x3d47fb[_0xc2ea('0x3f')]=qs[_0xc2ea('0xd0')](_[_0xc2ea('0xd8')](_0x3b7700[_0xc2ea('0x40')],_0x47d150['filters']));if(_0x3b7700[_0xc2ea('0x40')][_0xc2ea('0x37')]){_0x3d47fb[_0xc2ea('0x3f')]=_['merge'](_0x3d47fb['where'],{'$or':_[_0xc2ea('0x34')](_0x3d47fb[_0xc2ea('0x45')],function(_0x246f30){var _0x30df09={};_0x30df09[_0x246f30]={'$like':'%'+_0x3b7700[_0xc2ea('0x40')][_0xc2ea('0x37')]+'%'};return _0x30df09;})});}_0x3d47fb=_[_0xc2ea('0x54')]({},_0x3d47fb,_0x3b7700[_0xc2ea('0x55')]);return _0x307372[_0xc2ea('0xd9')](_0x3d47fb);}})[_0xc2ea('0x1f')](function(_0x2a8b64){if(_0x2a8b64){_0xc3fa74=_0x2a8b64[_0xc2ea('0x48')];if(!_0x3b7700[_0xc2ea('0x40')][_0xc2ea('0xc7')](_0xc2ea('0xd5'))){_0x3d47fb[_0xc2ea('0x1b')]=qs[_0xc2ea('0x1b')](_0x3b7700[_0xc2ea('0x40')][_0xc2ea('0x1b')]);_0x3d47fb[_0xc2ea('0x1a')]=qs[_0xc2ea('0x1a')](_0x3b7700['query'][_0xc2ea('0x1a')]);}return _0x307372[_0xc2ea('0xd9')](_0x3d47fb);}})[_0xc2ea('0x1f')](function(_0x5a16fe){if(_0x5a16fe){return _0x5a16fe?{'count':_0xc3fa74,'rows':_0x5a16fe}:null;}})['then'](respondWithResult(_0x3e4a90,null))[_0xc2ea('0x52')](handleError(_0x3e4a90,null));};exports[_0xc2ea('0xdb')]=function(_0x4515f1,_0xa4b2da){var _0x53bf20={'raw':!![],'where':{}};var _0x18fea0={};var _0x165738={'count':0x0,'rows':[]};return db[_0xc2ea('0x32')][_0xc2ea('0xcd')]({'where':{'id':_0x4515f1[_0xc2ea('0x56')]['id']}})[_0xc2ea('0x1f')](handleEntityNotFound(_0xa4b2da,null))[_0xc2ea('0x1f')](function(_0x3d6ef7){if(_0x3d6ef7){_0x18fea0[_0xc2ea('0xd1')]=_[_0xc2ea('0xce')](db[_0xc2ea('0xdc')]['rawAttributes']);_0x18fea0['query']=_['keys'](_0x4515f1[_0xc2ea('0x40')]);_0x18fea0[_0xc2ea('0xd0')]=_[_0xc2ea('0xd2')](_0x18fea0['model'],_0x18fea0[_0xc2ea('0x40')]);_0x53bf20[_0xc2ea('0x45')]=_[_0xc2ea('0xd2')](_0x18fea0['model'],qs[_0xc2ea('0xd3')](_0x4515f1['query']['fields']));_0x53bf20[_0xc2ea('0x45')]=_0x53bf20[_0xc2ea('0x45')][_0xc2ea('0x48')]?_0x53bf20[_0xc2ea('0x45')]:_0x18fea0[_0xc2ea('0xd1')];if(!_0x4515f1[_0xc2ea('0x40')][_0xc2ea('0xc7')]('nolimit')){_0x53bf20['limit']=qs[_0xc2ea('0x1b')](_0x4515f1[_0xc2ea('0x40')][_0xc2ea('0x1b')]);_0x53bf20['offset']=qs[_0xc2ea('0x1a')](_0x4515f1['query']['offset']);}_0x53bf20['order']=qs[_0xc2ea('0xd4')](_0x4515f1[_0xc2ea('0x40')][_0xc2ea('0xd4')]);_0x53bf20[_0xc2ea('0x3f')]=qs[_0xc2ea('0xd0')](_[_0xc2ea('0xd8')](_0x4515f1[_0xc2ea('0x40')],_0x18fea0[_0xc2ea('0xd0')]));_0x53bf20[_0xc2ea('0x3f')][_0xc2ea('0xdd')]=_0x3d6ef7['id'];if(_0x4515f1[_0xc2ea('0x40')][_0xc2ea('0x37')]){_0x53bf20['where']=_[_0xc2ea('0x54')](_0x53bf20['where'],{'$or':_[_0xc2ea('0x34')](_0x53bf20[_0xc2ea('0x45')],function(_0x2c3023){var _0xb9d932={};_0xb9d932[_0x2c3023]={'$like':'%'+_0x4515f1[_0xc2ea('0x40')][_0xc2ea('0x37')]+'%'};return _0xb9d932;})});}_0x53bf20=_[_0xc2ea('0x54')]({},_0x53bf20,_0x4515f1['options']);return db['VoiceRecording']['count']({'where':_0x53bf20[_0xc2ea('0x3f')]})[_0xc2ea('0x1f')](function(_0x22a808){_0x165738[_0xc2ea('0x19')]=_0x22a808;if(_0x4515f1[_0xc2ea('0x40')][_0xc2ea('0x41')]){_0x53bf20[_0xc2ea('0x42')]=[{'all':!![]}];}return db[_0xc2ea('0xdc')][_0xc2ea('0x46')](_0x53bf20);})['then'](function(_0x2c4a3c){_0x165738['rows']=_0x2c4a3c;return _0x165738;});}})[_0xc2ea('0x1f')](respondWithFilteredResult(_0xa4b2da,_0x53bf20))[_0xc2ea('0x52')](handleError(_0xa4b2da,null));};exports[_0xc2ea('0xde')]=function(_0x34bcea,_0x3a50af){var _0x183fbc={'raw':!![],'where':{}};var _0x2eea53={};var _0x3e4e74={'count':0x0,'rows':[]};return db['User'][_0xc2ea('0xcd')]({'where':{'id':_0x34bcea[_0xc2ea('0x56')]['id']}})[_0xc2ea('0x1f')](handleEntityNotFound(_0x3a50af,null))[_0xc2ea('0x1f')](function(_0x10cfb5){if(_0x10cfb5){_0x2eea53[_0xc2ea('0xd1')]=_[_0xc2ea('0xce')](db[_0xc2ea('0xdf')][_0xc2ea('0x33')]);_0x2eea53[_0xc2ea('0x40')]=_[_0xc2ea('0xce')](_0x34bcea[_0xc2ea('0x40')]);_0x2eea53[_0xc2ea('0xd0')]=_[_0xc2ea('0xd2')](_0x2eea53[_0xc2ea('0xd1')],_0x2eea53[_0xc2ea('0x40')]);_0x183fbc[_0xc2ea('0x45')]=_['intersection'](_0x2eea53[_0xc2ea('0xd1')],qs[_0xc2ea('0xd3')](_0x34bcea[_0xc2ea('0x40')][_0xc2ea('0xd3')]));_0x183fbc[_0xc2ea('0x45')]=_0x183fbc[_0xc2ea('0x45')][_0xc2ea('0x48')]?_0x183fbc['attributes']:_0x2eea53['model'];if(!_0x34bcea[_0xc2ea('0x40')][_0xc2ea('0xc7')](_0xc2ea('0xd5'))){_0x183fbc[_0xc2ea('0x1b')]=qs[_0xc2ea('0x1b')](_0x34bcea['query'][_0xc2ea('0x1b')]);_0x183fbc[_0xc2ea('0x1a')]=qs[_0xc2ea('0x1a')](_0x34bcea[_0xc2ea('0x40')][_0xc2ea('0x1a')]);}_0x183fbc['order']=qs[_0xc2ea('0xd4')](_0x34bcea[_0xc2ea('0x40')][_0xc2ea('0xd4')]);_0x183fbc['where']=qs[_0xc2ea('0xd0')](_['pick'](_0x34bcea['query'],_0x2eea53[_0xc2ea('0xd0')]));_0x183fbc['where']['UserId']=_0x10cfb5['id'];if(_0x34bcea['query'][_0xc2ea('0x37')]){_0x183fbc[_0xc2ea('0x3f')]=_[_0xc2ea('0x54')](_0x183fbc['where'],{'$or':_[_0xc2ea('0x34')](_0x183fbc['attributes'],function(_0x280a30){var _0x415911={};_0x415911[_0x280a30]={'$like':'%'+_0x34bcea[_0xc2ea('0x40')][_0xc2ea('0x37')]+'%'};return _0x415911;})});}_0x183fbc=_[_0xc2ea('0x54')]({},_0x183fbc,_0x34bcea[_0xc2ea('0x55')]);return db['ScreenRecording']['count']({'where':_0x183fbc[_0xc2ea('0x3f')]})[_0xc2ea('0x1f')](function(_0x59516c){_0x3e4e74[_0xc2ea('0x19')]=_0x59516c;if(_0x34bcea['query']['includeAll']){_0x183fbc[_0xc2ea('0x42')]=[{'all':!![]}];}return db[_0xc2ea('0xdf')][_0xc2ea('0x46')](_0x183fbc);})[_0xc2ea('0x1f')](function(_0x478d2b){_0x3e4e74[_0xc2ea('0x47')]=_0x478d2b;return _0x3e4e74;});}})['then'](respondWithFilteredResult(_0x3a50af,_0x183fbc))[_0xc2ea('0x52')](handleError(_0x3a50af,null));};exports[_0xc2ea('0xe0')]=function(_0x2e1368,_0x4fc6e8){var _0x52f2b7={};var _0x2b5f6d={};var _0x1146ca;var _0x3d2bc8;return db[_0xc2ea('0x32')][_0xc2ea('0xcd')]({'where':{'id':_0x2e1368['params']['id']}})[_0xc2ea('0x1f')](handleEntityNotFound(_0x4fc6e8,null))[_0xc2ea('0x1f')](function(_0x4f99a3){if(_0x4f99a3){_0x1146ca=_0x4f99a3;_0x2b5f6d['model']=_[_0xc2ea('0xce')](db[_0xc2ea('0xe1')][_0xc2ea('0x33')]);_0x2b5f6d[_0xc2ea('0x40')]=_['keys'](_0x2e1368[_0xc2ea('0x40')]);_0x2b5f6d['filters']=_[_0xc2ea('0xd2')](_0x2b5f6d[_0xc2ea('0xd1')],_0x2b5f6d[_0xc2ea('0x40')]);_0x52f2b7[_0xc2ea('0x45')]=_[_0xc2ea('0xd2')](_0x2b5f6d[_0xc2ea('0xd1')],qs[_0xc2ea('0xd3')](_0x2e1368['query'][_0xc2ea('0xd3')]));_0x52f2b7[_0xc2ea('0x45')]=_0x52f2b7[_0xc2ea('0x45')]['length']?_0x52f2b7[_0xc2ea('0x45')]:_0x2b5f6d[_0xc2ea('0xd1')];_0x52f2b7[_0xc2ea('0xd7')]=qs[_0xc2ea('0xd4')](_0x2e1368[_0xc2ea('0x40')][_0xc2ea('0xd4')]);_0x52f2b7[_0xc2ea('0x3f')]=qs[_0xc2ea('0xd0')](_[_0xc2ea('0xd8')](_0x2e1368[_0xc2ea('0x40')],_0x2b5f6d[_0xc2ea('0xd0')]));if(_0x2e1368[_0xc2ea('0x40')][_0xc2ea('0x37')]){_0x52f2b7[_0xc2ea('0x3f')]=_[_0xc2ea('0x54')](_0x52f2b7[_0xc2ea('0x3f')],{'$or':_[_0xc2ea('0x34')](_0x52f2b7[_0xc2ea('0x45')],function(_0x4c8f0f){var _0xd4642a={};_0xd4642a[_0x4c8f0f]={'$like':'%'+_0x2e1368['query']['filter']+'%'};return _0xd4642a;})});}_0x52f2b7=_[_0xc2ea('0x54')]({},_0x52f2b7,_0x2e1368[_0xc2ea('0x55')]);return _0x1146ca['getChatInteractions'](_0x52f2b7);}})[_0xc2ea('0x1f')](function(_0x3b3625){if(_0x3b3625){_0x3d2bc8=_0x3b3625[_0xc2ea('0x48')];if(!_0x2e1368[_0xc2ea('0x40')][_0xc2ea('0xc7')](_0xc2ea('0xd5'))){_0x52f2b7[_0xc2ea('0x1b')]=qs['limit'](_0x2e1368[_0xc2ea('0x40')]['limit']);_0x52f2b7[_0xc2ea('0x1a')]=qs['offset'](_0x2e1368[_0xc2ea('0x40')]['offset']);}return _0x1146ca[_0xc2ea('0xe0')](_0x52f2b7);}})[_0xc2ea('0x1f')](function(_0x56977d){if(_0x56977d){return _0x56977d?{'count':_0x3d2bc8,'rows':_0x56977d}:null;}})[_0xc2ea('0x1f')](respondWithResult(_0x4fc6e8,null))['catch'](handleError(_0x4fc6e8,null));};exports['getOpenchannelInteractions']=function(_0x42fc84,_0x21e714){var _0x4bac05={};var _0x322f6f={};var _0x3bb6d5;var _0x5de0ea;return db['User'][_0xc2ea('0xcd')]({'where':{'id':_0x42fc84[_0xc2ea('0x56')]['id']}})['then'](handleEntityNotFound(_0x21e714,null))[_0xc2ea('0x1f')](function(_0x1006fe){if(_0x1006fe){_0x3bb6d5=_0x1006fe;_0x322f6f['model']=_[_0xc2ea('0xce')](db[_0xc2ea('0xe2')]['rawAttributes']);_0x322f6f[_0xc2ea('0x40')]=_['keys'](_0x42fc84['query']);_0x322f6f['filters']=_['intersection'](_0x322f6f[_0xc2ea('0xd1')],_0x322f6f[_0xc2ea('0x40')]);_0x4bac05[_0xc2ea('0x45')]=_[_0xc2ea('0xd2')](_0x322f6f[_0xc2ea('0xd1')],qs[_0xc2ea('0xd3')](_0x42fc84[_0xc2ea('0x40')]['fields']));_0x4bac05[_0xc2ea('0x45')]=_0x4bac05[_0xc2ea('0x45')]['length']?_0x4bac05['attributes']:_0x322f6f[_0xc2ea('0xd1')];_0x4bac05[_0xc2ea('0xd7')]=qs[_0xc2ea('0xd4')](_0x42fc84[_0xc2ea('0x40')][_0xc2ea('0xd4')]);_0x4bac05[_0xc2ea('0x3f')]=qs['filters'](_[_0xc2ea('0xd8')](_0x42fc84['query'],_0x322f6f['filters']));if(_0x42fc84[_0xc2ea('0x40')][_0xc2ea('0x37')]){_0x4bac05[_0xc2ea('0x3f')]=_[_0xc2ea('0x54')](_0x4bac05[_0xc2ea('0x3f')],{'$or':_[_0xc2ea('0x34')](_0x4bac05[_0xc2ea('0x45')],function(_0x4f4823){var _0x312abd={};_0x312abd[_0x4f4823]={'$like':'%'+_0x42fc84['query'][_0xc2ea('0x37')]+'%'};return _0x312abd;})});}_0x4bac05=_['merge']({},_0x4bac05,_0x42fc84[_0xc2ea('0x55')]);return _0x3bb6d5['getOpenchannelInteractions'](_0x4bac05);}})[_0xc2ea('0x1f')](function(_0xb4da6a){if(_0xb4da6a){_0x5de0ea=_0xb4da6a[_0xc2ea('0x48')];if(!_0x42fc84[_0xc2ea('0x40')][_0xc2ea('0xc7')]('nolimit')){_0x4bac05[_0xc2ea('0x1b')]=qs['limit'](_0x42fc84['query'][_0xc2ea('0x1b')]);_0x4bac05['offset']=qs[_0xc2ea('0x1a')](_0x42fc84[_0xc2ea('0x40')][_0xc2ea('0x1a')]);}return _0x3bb6d5[_0xc2ea('0xe3')](_0x4bac05);}})[_0xc2ea('0x1f')](function(_0x268e7d){if(_0x268e7d){return _0x268e7d?{'count':_0x5de0ea,'rows':_0x268e7d}:null;}})[_0xc2ea('0x1f')](respondWithResult(_0x21e714,null))[_0xc2ea('0x52')](handleError(_0x21e714,null));};exports[_0xc2ea('0xe4')]=function(_0x1da246,_0x105e37){var _0x2e492b={'raw':!![],'where':{}};var _0x572bce={};var _0x48b6c1={'count':0x0,'rows':[]};return db[_0xc2ea('0x32')][_0xc2ea('0xcd')]({'where':{'id':_0x1da246['params']['id']}})[_0xc2ea('0x1f')](handleEntityNotFound(_0x105e37,null))[_0xc2ea('0x1f')](function(_0xd63227){if(_0xd63227){_0x572bce[_0xc2ea('0xd1')]=_[_0xc2ea('0xce')](db['MailInteraction']['rawAttributes']);_0x572bce[_0xc2ea('0x40')]=_['keys'](_0x1da246['query']);_0x572bce['filters']=_[_0xc2ea('0xd2')](_0x572bce[_0xc2ea('0xd1')],_0x572bce[_0xc2ea('0x40')]);_0x2e492b[_0xc2ea('0x45')]=_['intersection'](_0x572bce[_0xc2ea('0xd1')],qs[_0xc2ea('0xd3')](_0x1da246[_0xc2ea('0x40')][_0xc2ea('0xd3')]));_0x2e492b[_0xc2ea('0x45')]=_0x2e492b[_0xc2ea('0x45')][_0xc2ea('0x48')]?_0x2e492b['attributes']:_0x572bce[_0xc2ea('0xd1')];if(!_0x1da246[_0xc2ea('0x40')][_0xc2ea('0xc7')]('nolimit')){_0x2e492b[_0xc2ea('0x1b')]=qs[_0xc2ea('0x1b')](_0x1da246[_0xc2ea('0x40')]['limit']);_0x2e492b[_0xc2ea('0x1a')]=qs[_0xc2ea('0x1a')](_0x1da246['query'][_0xc2ea('0x1a')]);}_0x2e492b['order']=qs[_0xc2ea('0xd4')](_0x1da246[_0xc2ea('0x40')]['sort']);_0x2e492b[_0xc2ea('0x3f')]=qs[_0xc2ea('0xd0')](_[_0xc2ea('0xd8')](_0x1da246['query'],_0x572bce[_0xc2ea('0xd0')]));_0x2e492b[_0xc2ea('0x3f')][_0xc2ea('0xdd')]=_0xd63227['id'];if(_0x1da246[_0xc2ea('0x40')][_0xc2ea('0x37')]){_0x2e492b[_0xc2ea('0x3f')]=_[_0xc2ea('0x54')](_0x2e492b[_0xc2ea('0x3f')],{'$or':_[_0xc2ea('0x34')](_0x2e492b['attributes'],function(_0xb85744){var _0x48eed4={};_0x48eed4[_0xb85744]={'$like':'%'+_0x1da246[_0xc2ea('0x40')]['filter']+'%'};return _0x48eed4;})});}_0x2e492b=_[_0xc2ea('0x54')]({},_0x2e492b,_0x1da246['options']);return db[_0xc2ea('0xe5')][_0xc2ea('0x19')]({'where':_0x2e492b['where']})[_0xc2ea('0x1f')](function(_0x59f414){_0x48b6c1['count']=_0x59f414;if(_0x1da246[_0xc2ea('0x40')][_0xc2ea('0x41')]){_0x2e492b['include']=[{'all':!![]}];}return db[_0xc2ea('0xe5')][_0xc2ea('0x46')](_0x2e492b);})[_0xc2ea('0x1f')](function(_0x42523e){_0x48b6c1['rows']=_0x42523e;return _0x48b6c1;});}})[_0xc2ea('0x1f')](respondWithFilteredResult(_0x105e37,_0x2e492b))[_0xc2ea('0x52')](handleError(_0x105e37,null));};exports[_0xc2ea('0xe6')]=function(_0x2bde5b,_0xeb15a3){var _0x2c6654={};var _0x4c1785={};var _0x36112f;var _0x11458a;return db[_0xc2ea('0x32')][_0xc2ea('0xcd')]({'where':{'id':_0x2bde5b[_0xc2ea('0x56')]['id']}})[_0xc2ea('0x1f')](handleEntityNotFound(_0xeb15a3,null))[_0xc2ea('0x1f')](function(_0x8842fb){if(_0x8842fb){_0x36112f=_0x8842fb;_0x4c1785['model']=_[_0xc2ea('0xce')](db[_0xc2ea('0xe7')][_0xc2ea('0x33')]);_0x4c1785[_0xc2ea('0x40')]=_[_0xc2ea('0xce')](_0x2bde5b[_0xc2ea('0x40')]);_0x4c1785[_0xc2ea('0xd0')]=_[_0xc2ea('0xd2')](_0x4c1785[_0xc2ea('0xd1')],_0x4c1785[_0xc2ea('0x40')]);_0x2c6654[_0xc2ea('0x45')]=_['intersection'](_0x4c1785[_0xc2ea('0xd1')],qs[_0xc2ea('0xd3')](_0x2bde5b[_0xc2ea('0x40')][_0xc2ea('0xd3')]));_0x2c6654[_0xc2ea('0x45')]=_0x2c6654[_0xc2ea('0x45')][_0xc2ea('0x48')]?_0x2c6654[_0xc2ea('0x45')]:_0x4c1785['model'];_0x2c6654[_0xc2ea('0xd7')]=qs[_0xc2ea('0xd4')](_0x2bde5b[_0xc2ea('0x40')]['sort']);_0x2c6654[_0xc2ea('0x3f')]=qs[_0xc2ea('0xd0')](_[_0xc2ea('0xd8')](_0x2bde5b[_0xc2ea('0x40')],_0x4c1785[_0xc2ea('0xd0')]));if(_0x2bde5b[_0xc2ea('0x40')][_0xc2ea('0x37')]){_0x2c6654[_0xc2ea('0x3f')]=_[_0xc2ea('0x54')](_0x2c6654['where'],{'$or':_[_0xc2ea('0x34')](_0x2c6654[_0xc2ea('0x45')],function(_0x447694){var _0x7218d5={};_0x7218d5[_0x447694]={'$like':'%'+_0x2bde5b['query'][_0xc2ea('0x37')]+'%'};return _0x7218d5;})});}_0x2c6654=_[_0xc2ea('0x54')]({},_0x2c6654,_0x2bde5b['options']);return _0x36112f[_0xc2ea('0xe6')](_0x2c6654);}})[_0xc2ea('0x1f')](function(_0x544aa9){if(_0x544aa9){_0x11458a=_0x544aa9[_0xc2ea('0x48')];if(!_0x2bde5b[_0xc2ea('0x40')][_0xc2ea('0xc7')](_0xc2ea('0xd5'))){_0x2c6654['limit']=qs[_0xc2ea('0x1b')](_0x2bde5b[_0xc2ea('0x40')]['limit']);_0x2c6654[_0xc2ea('0x1a')]=qs[_0xc2ea('0x1a')](_0x2bde5b[_0xc2ea('0x40')][_0xc2ea('0x1a')]);}return _0x36112f[_0xc2ea('0xe6')](_0x2c6654);}})[_0xc2ea('0x1f')](function(_0x1dbbdd){if(_0x1dbbdd){return _0x1dbbdd?{'count':_0x11458a,'rows':_0x1dbbdd}:null;}})[_0xc2ea('0x1f')](respondWithResult(_0xeb15a3,null))[_0xc2ea('0x52')](handleError(_0xeb15a3,null));};exports[_0xc2ea('0xe8')]=function(_0xff6f80,_0x5ec2e5){var _0x431377={};var _0x3ba941={};var _0x461457;var _0x50c779;return db[_0xc2ea('0x32')]['findOne']({'where':{'id':_0xff6f80['params']['id']}})[_0xc2ea('0x1f')](handleEntityNotFound(_0x5ec2e5,null))['then'](function(_0x1b00f4){if(_0x1b00f4){_0x461457=_0x1b00f4;_0x3ba941[_0xc2ea('0xd1')]=_[_0xc2ea('0xce')](db[_0xc2ea('0xe9')][_0xc2ea('0x33')]);_0x3ba941[_0xc2ea('0x40')]=_[_0xc2ea('0xce')](_0xff6f80['query']);_0x3ba941[_0xc2ea('0xd0')]=_[_0xc2ea('0xd2')](_0x3ba941[_0xc2ea('0xd1')],_0x3ba941[_0xc2ea('0x40')]);_0x431377[_0xc2ea('0x45')]=_[_0xc2ea('0xd2')](_0x3ba941[_0xc2ea('0xd1')],qs['fields'](_0xff6f80[_0xc2ea('0x40')][_0xc2ea('0xd3')]));_0x431377[_0xc2ea('0x45')]=_0x431377[_0xc2ea('0x45')][_0xc2ea('0x48')]?_0x431377['attributes']:_0x3ba941[_0xc2ea('0xd1')];_0x431377[_0xc2ea('0xd7')]=qs[_0xc2ea('0xd4')](_0xff6f80[_0xc2ea('0x40')][_0xc2ea('0xd4')]);_0x431377[_0xc2ea('0x3f')]=qs['filters'](_[_0xc2ea('0xd8')](_0xff6f80[_0xc2ea('0x40')],_0x3ba941[_0xc2ea('0xd0')]));if(_0xff6f80[_0xc2ea('0x40')][_0xc2ea('0x37')]){_0x431377['where']=_[_0xc2ea('0x54')](_0x431377['where'],{'$or':_['map'](_0x431377[_0xc2ea('0x45')],function(_0x6af2d){var _0x3a1d9f={};_0x3a1d9f[_0x6af2d]={'$like':'%'+_0xff6f80[_0xc2ea('0x40')][_0xc2ea('0x37')]+'%'};return _0x3a1d9f;})});}_0x431377=_['merge']({},_0x431377,_0xff6f80[_0xc2ea('0x55')]);return _0x461457[_0xc2ea('0xe8')](_0x431377);}})[_0xc2ea('0x1f')](function(_0x263958){if(_0x263958){_0x50c779=_0x263958['length'];if(!_0xff6f80[_0xc2ea('0x40')][_0xc2ea('0xc7')](_0xc2ea('0xd5'))){_0x431377['limit']=qs[_0xc2ea('0x1b')](_0xff6f80[_0xc2ea('0x40')][_0xc2ea('0x1b')]);_0x431377[_0xc2ea('0x1a')]=qs[_0xc2ea('0x1a')](_0xff6f80[_0xc2ea('0x40')][_0xc2ea('0x1a')]);}return _0x461457[_0xc2ea('0xe8')](_0x431377);}})[_0xc2ea('0x1f')](function(_0x4924ac){if(_0x4924ac){return _0x4924ac?{'count':_0x50c779,'rows':_0x4924ac}:null;}})[_0xc2ea('0x1f')](respondWithResult(_0x5ec2e5,null))['catch'](handleError(_0x5ec2e5,null));};exports[_0xc2ea('0xea')]=function(_0x3024e0,_0xbfdd14){var _0x31ac12={};var _0x5689f3={};var _0x51e9f0;var _0x1298aa;return db[_0xc2ea('0x32')][_0xc2ea('0xcd')]({'where':{'id':_0x3024e0[_0xc2ea('0x56')]['id']}})['then'](handleEntityNotFound(_0xbfdd14,null))[_0xc2ea('0x1f')](function(_0xcc99e){if(_0xcc99e){_0x51e9f0=_0xcc99e;_0x5689f3[_0xc2ea('0xd1')]=_['keys'](db[_0xc2ea('0xeb')][_0xc2ea('0x33')]);_0x5689f3[_0xc2ea('0x40')]=_[_0xc2ea('0xce')](_0x3024e0[_0xc2ea('0x40')]);_0x5689f3[_0xc2ea('0xd0')]=_[_0xc2ea('0xd2')](_0x5689f3[_0xc2ea('0xd1')],_0x5689f3[_0xc2ea('0x40')]);_0x31ac12[_0xc2ea('0x45')]=_[_0xc2ea('0xd2')](_0x5689f3['model'],qs['fields'](_0x3024e0[_0xc2ea('0x40')][_0xc2ea('0xd3')]));_0x31ac12[_0xc2ea('0x45')]=_0x31ac12[_0xc2ea('0x45')][_0xc2ea('0x48')]?_0x31ac12['attributes']:_0x5689f3[_0xc2ea('0xd1')];_0x31ac12[_0xc2ea('0xd7')]=qs['sort'](_0x3024e0[_0xc2ea('0x40')][_0xc2ea('0xd4')]);_0x31ac12['where']=qs[_0xc2ea('0xd0')](_[_0xc2ea('0xd8')](_0x3024e0[_0xc2ea('0x40')],_0x5689f3[_0xc2ea('0xd0')]));if(_0x3024e0['query'][_0xc2ea('0x37')]){_0x31ac12[_0xc2ea('0x3f')]=_[_0xc2ea('0x54')](_0x31ac12[_0xc2ea('0x3f')],{'$or':_[_0xc2ea('0x34')](_0x31ac12[_0xc2ea('0x45')],function(_0x17ea07){var _0x30f4ca={};_0x30f4ca[_0x17ea07]={'$like':'%'+_0x3024e0['query'][_0xc2ea('0x37')]+'%'};return _0x30f4ca;})});}_0x31ac12=_[_0xc2ea('0x54')]({},_0x31ac12,_0x3024e0['options']);return _0x51e9f0[_0xc2ea('0xea')](_0x31ac12);}})[_0xc2ea('0x1f')](function(_0x717582){if(_0x717582){_0x1298aa=_0x717582[_0xc2ea('0x48')];if(!_0x3024e0[_0xc2ea('0x40')]['hasOwnProperty'](_0xc2ea('0xd5'))){_0x31ac12[_0xc2ea('0x1b')]=qs[_0xc2ea('0x1b')](_0x3024e0[_0xc2ea('0x40')]['limit']);_0x31ac12[_0xc2ea('0x1a')]=qs[_0xc2ea('0x1a')](_0x3024e0[_0xc2ea('0x40')][_0xc2ea('0x1a')]);}return _0x51e9f0[_0xc2ea('0xea')](_0x31ac12);}})[_0xc2ea('0x1f')](function(_0x16345f){if(_0x16345f){return _0x16345f?{'count':_0x1298aa,'rows':_0x16345f}:null;}})[_0xc2ea('0x1f')](respondWithResult(_0xbfdd14,null))[_0xc2ea('0x52')](handleError(_0xbfdd14,null));};exports[_0xc2ea('0xec')]=function(_0x236c83,_0x2a1f9f,_0x37f4d3){var _0x291d01;var _0x1b6cf3;var _0x542c80;var _0x536194=!_['isNil'](_0x236c83['params']['id'])?_0x236c83['params']['id']:!_[_0xc2ea('0x64')](_0x236c83[_0xc2ea('0x27')]['id'])?_0x236c83[_0xc2ea('0x27')]['id']:null;return db[_0xc2ea('0x32')][_0xc2ea('0x2e')]({'where':{'id':_0x536194,'role':{'$or':[_0xc2ea('0x26'),'user',_0xc2ea('0x21')]}},'attributes':['id',_0xc2ea('0x2f'),_0xc2ea('0xed'),_0xc2ea('0xee'),_0xc2ea('0x20'),_0xc2ea('0x5e'),_0xc2ea('0x97')]})['then'](function(_0x1ce404){if(_0x1ce404){if(_0x1ce404['role']===_0xc2ea('0x21')){_0x291d01=_0x1ce404;if(_0x236c83['body'][_0xc2ea('0x99')]){_0x542c80=util['format'](_0xc2ea('0xef'),_0x291d01[_0x236c83[_0xc2ea('0x59')][_0xc2ea('0x99')]]);}else if(_0x236c83[_0xc2ea('0x59')][_0xc2ea('0xf0')]){_0x542c80=util['format'](_0xc2ea('0xa4'),_0x236c83[_0xc2ea('0x59')][_0xc2ea('0xf0')]);}else{_0x542c80=util[_0xc2ea('0xc6')]('SIP/%s',_0x291d01[_0xc2ea('0x2f')]);}socket['to'](util[_0xc2ea('0xc6')](_0xc2ea('0xf1'),_0x291d01[_0xc2ea('0x2f')]))[_0xc2ea('0x22')](_0xc2ea('0xf2'),{'user':{'id':_0x291d01['id'],'name':_0x291d01[_0xc2ea('0x2f')]},'ip':_0x236c83[_0xc2ea('0xf3')][_0xc2ea('0xf4')]||_0x236c83['connection'][_0xc2ea('0xf5')]||_0x236c83[_0xc2ea('0xf6')][_0xc2ea('0xf5')]||_0x236c83[_0xc2ea('0xf7')][_0xc2ea('0xf6')][_0xc2ea('0xf5')]});return db[_0xc2ea('0xa6')][_0xc2ea('0x24')]({'where':{'membername':_0x291d01[_0xc2ea('0x2f')]},'individualHooks':!![]});}}else{throw new db[(_0xc2ea('0x8a'))]['ValidationError']('User\x20not\x20found\x20or\x20not\x20allowed\x20to\x20perform\x20login\x20method');}})['then'](function(){if(_0x291d01){return _0x291d01[_0xc2ea('0xf8')]({'raw':!![]});}})[_0xc2ea('0x1f')](function(_0x4ae174){if(_0x291d01){if(_0x4ae174){_0x1b6cf3=_0x4ae174;if(_0x1b6cf3[_0xc2ea('0x48')]){var _0x4a12bf=_0x1b6cf3['map'](function(_0x127c06){var _0x5559e2={'membername':_0x291d01[_0xc2ea('0x2f')],'UserId':_0x291d01['id'],'queue_name':_0x127c06[_0xc2ea('0x2f')],'VoiceQueueId':_0x127c06['id'],'interface':_0x542c80,'paused':_0x291d01['loginInPause']||![],'penalty':_0x127c06[_0xc2ea('0xf9')]||0x0};return db[_0xc2ea('0xa6')][_0xc2ea('0xa7')](_0x5559e2);});return Promise[_0xc2ea('0x51')](_0x4a12bf);}}}})[_0xc2ea('0x1f')](function(){if(_0x291d01){return db[_0xc2ea('0xfa')][_0xc2ea('0x46')]({'where':{'membername':_0x291d01[_0xc2ea('0x2f')],'exitAt':null}});}})['then'](function(_0x8e9d89){if(_0x291d01){var _0x75bf55=[];_0x8e9d89[_0xc2ea('0xfb')](function(_0x5e94de){_0x75bf55[_0xc2ea('0x49')](_0x5e94de[_0xc2ea('0x1e')]({'exitAt':moment()[_0xc2ea('0xc6')]('YYYY-MM-DD\x20HH:mm:ss')}));});return Promise[_0xc2ea('0x51')](_0x75bf55);}})[_0xc2ea('0x1f')](function(){if(_0x291d01){var _0x76077e=[];var _0x3c9336=[];var _0x2248ad=utils['getChannels']();var _0x52a132={'membername':_0x291d01[_0xc2ea('0x2f')],'interface':_0x542c80,'enterAt':moment()['format'](_0xc2ea('0xfc')),'role':_0x291d01['role'],'internal':_0x291d01[_0xc2ea('0x5e')]};_0x2248ad[_0xc2ea('0xfb')](function(_0x242957){_0x76077e[_0xc2ea('0x49')](_['merge']({'channel':_0x242957,'type':_0xc2ea('0xfd'),'data1':_0x236c83[_0xc2ea('0x59')][_0xc2ea('0xfe')],'data2':_0x542c80},_0x52a132));if(_0x291d01['loginInPause']){_0x3c9336[_0xc2ea('0x49')](_[_0xc2ea('0x54')]({'channel':_0x242957,'type':_0xc2ea('0xff'),'data1':_0xc2ea('0x100')},_0x52a132));}});return db[_0xc2ea('0xfa')][_0xc2ea('0x80')](_0x76077e[_0xc2ea('0xc4')](_0x3c9336),{'individualHooks':!![]});}})[_0xc2ea('0x1f')](function(){if(_0x291d01){return _0x291d01[_0xc2ea('0x1e')]({'online':!![],'lastLoginAt':moment()[_0xc2ea('0xc6')](_0xc2ea('0xfc')),'voicePause':_0x291d01[_0xc2ea('0x97')]||![],'mailPause':_0x291d01[_0xc2ea('0x97')]||![],'chatPause':_0x291d01[_0xc2ea('0x97')]||![],'faxPause':_0x291d01[_0xc2ea('0x97')]||![],'smsPause':_0x291d01[_0xc2ea('0x97')]||![],'openchannelPause':_0x291d01['loginInPause']||![],'whatsappPause':_0x291d01[_0xc2ea('0x97')]||![],'pauseType':_0x291d01[_0xc2ea('0x97')]?_0xc2ea('0x100'):null,'interface':_0x542c80,'lastPauseAt':moment()['format'](_0xc2ea('0xfc'))});}})['then'](function(_0x2f67b8){if(_0x236c83[_0xc2ea('0x101')]){return _0x37f4d3();}else{return Promise[_0xc2ea('0x102')](_0x2f67b8)[_0xc2ea('0x1f')](respondWithResult(_0x2a1f9f,null));}})[_0xc2ea('0x52')](handleError(_0x2a1f9f,null));};exports[_0xc2ea('0x103')]=function(_0x2ddbaf,_0x4f2c71){var _0x502b37;return db[_0xc2ea('0x32')][_0xc2ea('0x2e')]({'where':{'id':_0x2ddbaf[_0xc2ea('0x56')]['id'],'role':_0xc2ea('0x21')},'attributes':['id','name',_0xc2ea('0x20')]})[_0xc2ea('0x1f')](handleEntityNotFound(_0x4f2c71,null))['then'](function(_0x3d1586){if(_0x3d1586){_0x502b37=_0x3d1586;return db[_0xc2ea('0xa6')][_0xc2ea('0x24')]({'where':{'membername':_0x502b37[_0xc2ea('0x2f')]},'individualHooks':!![]});}})['then'](function(){return db['MemberReport']['findAll']({'where':{'membername':_0x502b37[_0xc2ea('0x2f')],'exitAt':null}});})[_0xc2ea('0x1f')](function(_0xe1fae4){var _0x30c270=[];_0xe1fae4['forEach'](function(_0xe3a279){_0x30c270['push'](_0xe3a279[_0xc2ea('0x1e')]({'exitAt':moment()[_0xc2ea('0xc6')]('YYYY-MM-DD\x20HH:mm:ss')}));});return Promise[_0xc2ea('0x51')](_0x30c270);})[_0xc2ea('0x1f')](function(){return _0x502b37['update']({'online':![],'voicePause':![],'mailPause':![],'chatPause':![],'faxPause':![],'smsPause':![],'openchannelPause':![],'whatsappPause':![],'interface':null});})[_0xc2ea('0x1f')](respondWithResult(_0x4f2c71,null))[_0xc2ea('0x52')](handleError(_0x4f2c71,null));};exports[_0xc2ea('0x104')]=function(_0x16c022,_0x54b367){var _0x4b6802;return db[_0xc2ea('0xa6')][_0xc2ea('0x1e')]({'paused':0x1},{'where':{'UserId':_0x16c022[_0xc2ea('0x56')]['id']},'individualHooks':!![]})[_0xc2ea('0x1f')](function(){return db[_0xc2ea('0x32')][_0xc2ea('0x2e')]({'where':{'id':_0x16c022[_0xc2ea('0x56')]['id'],'role':_0xc2ea('0x21')},'attributes':['id','name','role',_0xc2ea('0x5e'),_0xc2ea('0x99'),_0xc2ea('0x96')]});})[_0xc2ea('0x1f')](handleEntityNotFound(_0x54b367,null))[_0xc2ea('0x1f')](function(_0x287a21){if(_0x287a21){_0x4b6802=_0x287a21;return db[_0xc2ea('0xfa')][_0xc2ea('0x46')]({'where':{'membername':_0x4b6802[_0xc2ea('0x2f')],'type':_0xc2ea('0xff'),'exitAt':null}});}})[_0xc2ea('0x1f')](function(_0x131ef8){if(_0x131ef8[_0xc2ea('0x48')]){var _0xf36dc1=moment()[_0xc2ea('0xc6')](_0xc2ea('0xfc'));for(var _0x3b008b=0x0,_0x2a3a0b=_0x131ef8[_0xc2ea('0x48')];_0x3b008b<_0x2a3a0b;_0x3b008b++){_0x131ef8[_0x3b008b][_0xc2ea('0x105')]({'exitAt':_0xf36dc1});}}})['then'](function(){var _0x2b0130=[];var _0x15e394=utils[_0xc2ea('0x106')]();_0x15e394[_0xc2ea('0xfb')](function(_0x4afce9){_0x2b0130[_0xc2ea('0x49')]({'channel':_0x4afce9,'membername':_0x4b6802[_0xc2ea('0x2f')],'interface':_[_0xc2ea('0x64')](_0x4b6802['interface'])?util['format'](_0xc2ea('0xa4'),_0x4b6802[_0xc2ea('0x2f')]):_0x4b6802['interface'],'type':_0xc2ea('0xff'),'enterAt':moment()[_0xc2ea('0xc6')]('YYYY-MM-DD\x20HH:mm:ss'),'data1':_0x16c022['body']['type']||_0xc2ea('0x107'),'role':_0x4b6802[_0xc2ea('0x20')],'internal':_0x4b6802['internal']});});return db[_0xc2ea('0xfa')][_0xc2ea('0x80')](_0x2b0130,{'individualHooks':!![]});})['then'](function(){return _0x4b6802[_0xc2ea('0x1e')]({'voicePause':!![],'mailPause':!![],'chatPause':!![],'faxPause':!![],'smsPause':!![],'whatsappPause':!![],'openchannelPause':!![],'pauseType':_0x16c022['body'][_0xc2ea('0x36')]||_0xc2ea('0x107'),'lastPauseAt':moment()[_0xc2ea('0xc6')](_0xc2ea('0xfc'))});})[_0xc2ea('0x1f')](respondWithResult(_0x54b367,null))['catch'](handleError(_0x54b367,null));};exports[_0xc2ea('0x108')]=function(_0x2e110a,_0x42ca29){if(_0x2e110a[_0xc2ea('0x59')][_0xc2ea('0xa9')]&&!utils['isValidChannel'](_0x2e110a[_0xc2ea('0x59')]['channel'])){throw new APIBadRequestError(util['format']('Channel\x20parameter\x20%s\x20is\x20invalid',_0x2e110a[_0xc2ea('0x59')]['channel']));}return db[_0xc2ea('0x32')][_0xc2ea('0x2e')]({'where':{'id':_0x2e110a[_0xc2ea('0x56')]['id']},'attributes':['id',_0xc2ea('0x2f'),'role',_0xc2ea('0x5e'),'interface',_0xc2ea('0x96'),_0xc2ea('0x98'),_0xc2ea('0x109'),_0xc2ea('0x10a'),'faxPause',_0xc2ea('0x10b'),'smsPause',_0xc2ea('0x10c'),'pauseType',_0xc2ea('0x10d')]})[_0xc2ea('0x1f')](function(_0x3c1231){if(!_0x3c1231){throw new APINotFoundError(util[_0xc2ea('0xc6')](_0xc2ea('0x10e'),_0x2e110a['params']['id']));}return _0x3c1231[_0xc2ea('0x108')](_0x2e110a[_0xc2ea('0x59')][_0xc2ea('0xa9')]);})[_0xc2ea('0x1f')](respondWithResult(_0x42ca29,null))[_0xc2ea('0x52')](APIHandleError(_0x42ca29));};exports[_0xc2ea('0x10f')]=function(_0x254989,_0x3de2d3){var _0x3d8553={};var _0x2090a8={};var _0x249144;var _0x37121b;return db[_0xc2ea('0x32')]['findOne']({'where':{'id':_0x254989[_0xc2ea('0x56')]['id']}})[_0xc2ea('0x1f')](handleEntityNotFound(_0x3de2d3,null))[_0xc2ea('0x1f')](function(_0x4ce0db){if(_0x4ce0db){_0x249144=_0x4ce0db;_0x2090a8[_0xc2ea('0xd1')]=_[_0xc2ea('0xce')](db[_0xc2ea('0x110')][_0xc2ea('0x33')]);_0x2090a8[_0xc2ea('0x40')]=_[_0xc2ea('0xce')](_0x254989['query']);_0x2090a8[_0xc2ea('0xd0')]=_['intersection'](_0x2090a8['model'],_0x2090a8[_0xc2ea('0x40')]);_0x3d8553[_0xc2ea('0x45')]=_[_0xc2ea('0xd2')](_0x2090a8[_0xc2ea('0xd1')],qs[_0xc2ea('0xd3')](_0x254989[_0xc2ea('0x40')][_0xc2ea('0xd3')]));_0x3d8553[_0xc2ea('0x45')]=_0x3d8553[_0xc2ea('0x45')]['length']?_0x3d8553[_0xc2ea('0x45')]:_0x2090a8[_0xc2ea('0xd1')];_0x3d8553['order']=qs[_0xc2ea('0xd4')](_0x254989[_0xc2ea('0x40')]['sort']);_0x3d8553[_0xc2ea('0x3f')]=qs[_0xc2ea('0xd0')](_['pick'](_0x254989[_0xc2ea('0x40')],_0x2090a8[_0xc2ea('0xd0')]));if(_0x254989['query'][_0xc2ea('0x37')]){_0x3d8553['where']=_[_0xc2ea('0x54')](_0x3d8553[_0xc2ea('0x3f')],{'$or':_[_0xc2ea('0x34')](_0x3d8553['attributes'],function(_0x5adc46){var _0x46d5c1={};_0x46d5c1[_0x5adc46]={'$like':'%'+_0x254989['query']['filter']+'%'};return _0x46d5c1;})});}_0x3d8553=_[_0xc2ea('0x54')]({},_0x3d8553,_0x254989[_0xc2ea('0x55')]);return _0x249144['getTeams'](_0x3d8553);}})['then'](function(_0x30f652){if(_0x30f652){_0x37121b=_0x30f652[_0xc2ea('0x48')];if(!_0x254989[_0xc2ea('0x40')][_0xc2ea('0xc7')](_0xc2ea('0xd5'))){_0x3d8553[_0xc2ea('0x1b')]=qs[_0xc2ea('0x1b')](_0x254989[_0xc2ea('0x40')][_0xc2ea('0x1b')]);_0x3d8553['offset']=qs[_0xc2ea('0x1a')](_0x254989['query']['offset']);}return _0x249144[_0xc2ea('0x10f')](_0x3d8553);}})['then'](function(_0xe71213){if(_0xe71213){return _0xe71213?{'count':_0x37121b,'rows':_0xe71213}:null;}})[_0xc2ea('0x1f')](respondWithResult(_0x3de2d3,null))[_0xc2ea('0x52')](handleError(_0x3de2d3,null));};exports[_0xc2ea('0x111')]=function(_0x395e77,_0x4e222c){var _0x3e1353=_0x395e77['params']['id'];var _0x59d6a0=_0x395e77[_0xc2ea('0x59')]?_0x395e77[_0xc2ea('0x59')][_0xc2ea('0x5a')]:null;var _0x13d0ba=[];return Promise[_0xc2ea('0x102')]()['then'](function(){if(!_0x59d6a0)throw new APIBadRequestError(_0xc2ea('0x112'));})[_0xc2ea('0x1f')](function(){return db[_0xc2ea('0x32')][_0xc2ea('0xcd')]({'where':{'id':_0x3e1353}});})[_0xc2ea('0x1f')](function(_0x124793){if(!_0x124793)throw new APINotFoundError(util[_0xc2ea('0xc6')]('User\x20with\x20id\x20%s\x20not\x20found',_0x395e77['params']['id']));return db['sequelize']['transaction'](function(_0x5f3733){return _0x124793[_0xc2ea('0x111')](_0x59d6a0,{'transaction':_0x5f3733})[_0xc2ea('0x1f')](function(){return db[_0xc2ea('0x110')]['findAll']({'where':{'id':{'$in':_0x59d6a0}}});})[_0xc2ea('0x1f')](function(_0x14834a){var _0x192c22=_[_0xc2ea('0x34')](_0x14834a,function(_0x11df67){return _0x11df67[_0xc2ea('0x113')]();});return Promise['all'](_0x192c22);})[_0xc2ea('0x1f')](function(_0x4858c8){_0x13d0ba=_[_0xc2ea('0x114')](_0x4858c8);var _0x510198=_[_0xc2ea('0x34')](_0x13d0ba,function(_0x1d6cb4){return _0x1d6cb4['addAgent'](_0x124793['id'],{'transaction':_0x5f3733});});return Promise['all'](_0x510198);})[_0xc2ea('0x1f')](function(){if(!_0x124793['online'])return;var _0xd1ec88=_['filter'](_0x13d0ba,function(_0x63b5a9){return _0x63b5a9[_0xc2ea('0x115')](_0xc2ea('0xa9'))==='Voice';});var _0x5e06bb=_[_0xc2ea('0x34')](_0xd1ec88,function(_0x174264){return db['UserVoiceQueueRt']['upsert']({'membername':_0x124793[_0xc2ea('0x2f')],'UserId':_0x124793['id'],'queue_name':_0x174264[_0xc2ea('0x2f')],'VoiceQueueId':_0x174264['id'],'interface':_[_0xc2ea('0x64')](_0x124793[_0xc2ea('0x99')])?util['format'](_0xc2ea('0xa4'),_0x124793[_0xc2ea('0x2f')]):_0x124793[_0xc2ea('0x99')],'paused':_0x124793['voicePause']||![],'penalty':_0x124793[_0xc2ea('0xa5')]},{'transaction':_0x5f3733});});return Promise[_0xc2ea('0x51')](_0x5e06bb);})[_0xc2ea('0x1f')](function(){return db[_0xc2ea('0x116')][_0xc2ea('0x46')]({'where':{'teamId':{'$in':_0x59d6a0}}});})[_0xc2ea('0x1f')](function(_0x77904c){var _0x491162=_[_0xc2ea('0x34')](_0x77904c,function(_0x428a95){return db[_0xc2ea('0x117')]['create']({'UserId':_0x124793['id'],'VoicePrefixId':_0x428a95[_0xc2ea('0x118')]},{'transaction':_0x5f3733});});return Promise[_0xc2ea('0x51')](_0x491162);});});})[_0xc2ea('0x1f')](function(){for(var _0x37c34e=0x0;_0x37c34e<_0x13d0ba[_0xc2ea('0x48')];_0x37c34e++){var _0x433174=_0x13d0ba[_0x37c34e][_0xc2ea('0x115')](_0xc2ea('0xa9'));var _0x5691d4=_0x433174+_0xc2ea('0xa1');socket[_0xc2ea('0x22')]('user'+_0x433174+_0xc2ea('0xa2'),{'UserId':_0x3e1353,['queueField']:_0x13d0ba[_0x37c34e]['id']});}})[_0xc2ea('0x1f')](respondWithStatusCode(_0x4e222c,null))[_0xc2ea('0x52')](APIHandleError(_0x4e222c));};exports[_0xc2ea('0x119')]=function(_0x5b02f9,_0x339b71){var _0x381274=_0x5b02f9[_0xc2ea('0x56')]['id'];var _0x47a15d=null;if(_0x5b02f9[_0xc2ea('0x40')][_0xc2ea('0x5a')]){_0x47a15d=_['isArray'](_0x5b02f9[_0xc2ea('0x40')][_0xc2ea('0x5a')])?_0x5b02f9[_0xc2ea('0x40')][_0xc2ea('0x5a')]:[_0x5b02f9[_0xc2ea('0x40')]['ids']];}var _0x4c8a3f=[];return Promise[_0xc2ea('0x102')]()[_0xc2ea('0x1f')](function(){if(!_0x47a15d)throw new APIBadRequestError('Query\x20parameter\x20\x27ids\x27\x20is\x20required');})[_0xc2ea('0x1f')](function(){return db[_0xc2ea('0x32')][_0xc2ea('0xcd')]({'where':{'id':_0x381274}});})[_0xc2ea('0x1f')](function(_0x4b3d7e){if(!_0x4b3d7e)throw new APINotFoundError(util[_0xc2ea('0xc6')](_0xc2ea('0x10e'),_0x5b02f9[_0xc2ea('0x56')]['id']));return db['sequelize'][_0xc2ea('0x11a')](function(_0x52746e){return _0x4b3d7e[_0xc2ea('0x119')](_0x47a15d,{'transaction':_0x52746e})[_0xc2ea('0x1f')](function(){return db[_0xc2ea('0x110')][_0xc2ea('0x46')]({'where':{'id':{'$in':_0x47a15d}}});})[_0xc2ea('0x1f')](function(_0x2b2234){var _0x1d605b=_[_0xc2ea('0x34')](_0x2b2234,function(_0x171863){return _0x171863['getAssociatedQueues']();});return Promise[_0xc2ea('0x51')](_0x1d605b);})[_0xc2ea('0x1f')](function(_0x23b5cb){_0x4c8a3f=_[_0xc2ea('0x114')](_0x23b5cb);var _0xaf2e9e=_['map'](_0x4c8a3f,function(_0x24d55b){return _0x24d55b[_0xc2ea('0x11b')](_0x4b3d7e['id'],{'transaction':_0x52746e});});return Promise['all'](_0xaf2e9e);})[_0xc2ea('0x1f')](function(){if(!_0x4b3d7e[_0xc2ea('0x96')])return;var _0x2e8be5=_['filter'](_0x4c8a3f,function(_0x210e71){return _0x210e71[_0xc2ea('0x115')](_0xc2ea('0xa9'))==='Voice';});var _0x10df6c=_[_0xc2ea('0x34')](_0x2e8be5,function(_0x541f6e){return db['UserVoiceQueueRt'][_0xc2ea('0x24')]({'where':{'VoiceQueueId':_0x541f6e['id'],'UserId':_0x4b3d7e['id']},'transaction':_0x52746e});});return Promise['all'](_0x10df6c);})[_0xc2ea('0x1f')](function(){return db[_0xc2ea('0x116')][_0xc2ea('0x46')]({'where':{'teamId':{'$in':_0x47a15d}}});})[_0xc2ea('0x1f')](function(_0x4ec3f9){var _0x4415b3=_[_0xc2ea('0x34')](_0x4ec3f9,function(_0x365187){return db['UserVoicePrefix'][_0xc2ea('0x24')]({'where':{'UserId':_0x4b3d7e['id'],'VoicePrefixId':_0x365187[_0xc2ea('0x118')]}},{'transaction':_0x52746e});});return Promise[_0xc2ea('0x51')](_0x4415b3);});});})[_0xc2ea('0x1f')](function(){for(var _0x52563a=0x0;_0x52563a<_0x4c8a3f[_0xc2ea('0x48')];_0x52563a++){var _0x622117=_0x4c8a3f[_0x52563a][_0xc2ea('0x115')]('channel');var _0x4639e4=_0x622117+_0xc2ea('0xa1');socket[_0xc2ea('0x22')](_0xc2ea('0x27')+_0x622117+_0xc2ea('0xac'),{'UserId':_0x381274,['queueField']:_0x4c8a3f[_0x52563a]['id']});}})[_0xc2ea('0x1f')](respondWithStatusCode(_0x339b71,null))[_0xc2ea('0x52')](APIHandleError(_0x339b71));};exports[_0xc2ea('0x11c')]=function(_0x40c5e6,_0x57e22f){var _0x5d271b={};var _0x5cbf59={};var _0x270ece;var _0x196b2d;return db[_0xc2ea('0x32')][_0xc2ea('0xcd')]({'where':{'id':_0x40c5e6[_0xc2ea('0x56')]['id']}})['then'](handleEntityNotFound(_0x57e22f,null))[_0xc2ea('0x1f')](function(_0x598961){if(_0x598961){_0x270ece=_0x598961;_0x5cbf59[_0xc2ea('0xd1')]=_[_0xc2ea('0xce')](db[_0xc2ea('0x11d')][_0xc2ea('0x33')]);_0x5cbf59[_0xc2ea('0x40')]=_[_0xc2ea('0xce')](_0x40c5e6['query']);_0x5cbf59[_0xc2ea('0xd0')]=_[_0xc2ea('0xd2')](_0x5cbf59['model'],_0x5cbf59[_0xc2ea('0x40')]);_0x5d271b[_0xc2ea('0x45')]=_[_0xc2ea('0xd2')](_0x5cbf59[_0xc2ea('0xd1')],qs['fields'](_0x40c5e6[_0xc2ea('0x40')][_0xc2ea('0xd3')]));_0x5d271b[_0xc2ea('0x45')]=_0x5d271b[_0xc2ea('0x45')]['length']?_0x5d271b[_0xc2ea('0x45')]:_0x5cbf59[_0xc2ea('0xd1')];_0x5d271b[_0xc2ea('0xd7')]=qs[_0xc2ea('0xd4')](_0x40c5e6[_0xc2ea('0x40')]['sort']);_0x5d271b[_0xc2ea('0x3f')]=qs[_0xc2ea('0xd0')](_[_0xc2ea('0xd8')](_0x40c5e6[_0xc2ea('0x40')],_0x5cbf59[_0xc2ea('0xd0')]));if(_0x40c5e6[_0xc2ea('0x40')]['filter']){_0x5d271b[_0xc2ea('0x3f')]=_[_0xc2ea('0x54')](_0x5d271b[_0xc2ea('0x3f')],{'$or':_[_0xc2ea('0x34')](_0x5d271b[_0xc2ea('0x45')],function(_0x400e8e){var _0x2db913={};_0x2db913[_0x400e8e]={'$like':'%'+_0x40c5e6[_0xc2ea('0x40')][_0xc2ea('0x37')]+'%'};return _0x2db913;})});}_0x5d271b=_[_0xc2ea('0x54')]({},_0x5d271b,_0x40c5e6['options']);return _0x270ece[_0xc2ea('0x11c')](_0x5d271b);}})['then'](function(_0x32de2f){if(_0x32de2f){_0x196b2d=_0x32de2f[_0xc2ea('0x48')];if(!_0x40c5e6[_0xc2ea('0x40')][_0xc2ea('0xc7')]('nolimit')){_0x5d271b[_0xc2ea('0x1b')]=qs[_0xc2ea('0x1b')](_0x40c5e6[_0xc2ea('0x40')][_0xc2ea('0x1b')]);_0x5d271b[_0xc2ea('0x1a')]=qs[_0xc2ea('0x1a')](_0x40c5e6[_0xc2ea('0x40')][_0xc2ea('0x1a')]);}return _0x270ece[_0xc2ea('0x11c')](_0x5d271b);}})[_0xc2ea('0x1f')](function(_0xd7bd43){if(_0xd7bd43){return _0xd7bd43?{'count':_0x196b2d,'rows':_0xd7bd43}:null;}})['then'](respondWithResult(_0x57e22f,null))['catch'](handleError(_0x57e22f,null));};exports['getAgents']=function(_0x48c650,_0x548db0){var _0x409fe9={};var _0x79625f={};var _0x1a1740;return db[_0xc2ea('0x32')][_0xc2ea('0xcd')]({'where':{'id':_0x48c650['params']['id']}})['then'](handleEntityNotFound(_0x548db0,null))['then'](function(_0x52c88a){if(_0x52c88a){_0x1a1740=_0x52c88a;_0x79625f[_0xc2ea('0xd1')]=_[_0xc2ea('0xce')](db[_0xc2ea('0x32')][_0xc2ea('0x33')]);_0x79625f['query']=_['keys'](_0x48c650[_0xc2ea('0x40')]);_0x79625f['filters']=_['intersection'](_0x79625f['model'],_0x79625f[_0xc2ea('0x40')]);_0x409fe9[_0xc2ea('0x45')]=_[_0xc2ea('0xd2')](_0x79625f[_0xc2ea('0xd1')],qs[_0xc2ea('0xd3')](_0x48c650['query'][_0xc2ea('0xd3')]));_0x409fe9[_0xc2ea('0x45')]=_0x409fe9['attributes'][_0xc2ea('0x48')]?_0x409fe9['attributes']:_0x79625f['model'];_0x409fe9[_0xc2ea('0xd7')]=qs['sort'](_0x48c650[_0xc2ea('0x40')][_0xc2ea('0xd4')]);_0x409fe9[_0xc2ea('0x3f')]=qs[_0xc2ea('0xd0')](_[_0xc2ea('0xd8')](_0x48c650['query'],_0x79625f[_0xc2ea('0xd0')]));if(_0x48c650[_0xc2ea('0x40')][_0xc2ea('0x37')]){_0x409fe9[_0xc2ea('0x3f')]=_[_0xc2ea('0x54')](_0x409fe9[_0xc2ea('0x3f')],{'$or':_[_0xc2ea('0x34')](_0x409fe9[_0xc2ea('0x45')],function(_0x1db638){var _0x53e2f9={};_0x53e2f9[_0x1db638]={'$like':'%'+_0x48c650[_0xc2ea('0x40')][_0xc2ea('0x37')]+'%'};return _0x53e2f9;})});}_0x409fe9[_0xc2ea('0xd1')]=db[_0xc2ea('0x32')];_0x409fe9['as']=_0xc2ea('0x28');_0x409fe9=_[_0xc2ea('0x54')]({},_0x409fe9,_0x48c650['options']);return _0x1a1740['getVoiceQueues']({'include':[_0x409fe9]});}})[_0xc2ea('0x1f')](function(_0x42663d){if(_0x42663d){var _0x4f3590={},_0x5f1502=[];for(var _0x110601=0x0;_0x110601<_0x42663d[_0xc2ea('0x48')];_0x110601+=0x1){for(var _0x154e90=0x0,_0x329455;_0x154e90<_0x42663d[_0x110601][_0xc2ea('0x28')][_0xc2ea('0x48')];_0x154e90+=0x1){_0x329455=_0x42663d[_0x110601][_0xc2ea('0x28')][_0x154e90][_0xc2ea('0x25')]({'plain':!![]});_0x4f3590[_0x329455['id']]=_0x329455;}}_0x4f3590=_['values'](_0x4f3590);for(var _0x4b7d75=qs[_0xc2ea('0x1a')](_0x48c650['query']['offset']);_0x4b7d75<_0x4f3590['length']&&_0x5f1502[_0xc2ea('0x48')]=_0xff99de['agents']){throw new Error(_0x8376('0x4c'));}})[_0x8376('0x17')](function(){if(_0x3ca863){return db[_0x8376('0x24')]['destroy']({'where':{'membername':_0x3ca863['name']},'individualHooks':!![]});}})['then'](function(){if(_0x3ca863){return _0x3ca863[_0x8376('0x4d')]({'raw':!![]});}})[_0x8376('0x17')](function(_0x27d1d3){if(_0x3ca863){if(_0x27d1d3){var _0x374424=[];_0x199b4e=_0x27d1d3;if(_0x199b4e[_0x8376('0x27')]){for(var _0x370491=0x0;_0x370491<_0x199b4e['length'];_0x370491++){_0x374424[_0x8376('0x2b')](db[_0x8376('0x24')][_0x8376('0x4e')]({'membername':_0x3ca863['name'],'UserId':_0x3ca863['id'],'queue_name':_0x199b4e[_0x370491][_0x8376('0x1f')],'VoiceQueueId':_0x199b4e[_0x370491]['id'],'interface':_0x527e07,'paused':_0x3ca863[_0x8376('0x4f')]||![],'penalty':_0x199b4e[_0x370491][_0x8376('0x50')]||0x0}));}return BPromise[_0x8376('0x51')](_0x374424);}}}})['then'](function(){if(_0x3ca863){return db['MemberReport'][_0x8376('0xe')]({'where':{'membername':_0x3ca863[_0x8376('0x1f')],'exitAt':null}});}})[_0x8376('0x17')](function(_0x36e93){if(_0x3ca863){if(_0x36e93&&_0x36e93[_0x8376('0x27')]){var _0x5751a1=[];_0x36e93[_0x8376('0x43')](function(_0x44588d){_0x5751a1[_0x8376('0x2b')](_0x44588d['update']({'exitAt':moment()['format']('YYYY-MM-DD\x20HH:mm:ss')}));});return BPromise['all'](_0x5751a1);}}})[_0x8376('0x17')](function(){if(_0x3ca863){var _0xec6fd2=[];var _0x3dce71=[];var _0x64bd5d=utils['getChannels']();var _0x4483be={'membername':_0x3ca863[_0x8376('0x1f')],'interface':_0x527e07,'enterAt':moment()[_0x8376('0x28')](_0x8376('0x29')),'role':_0x3ca863[_0x8376('0x20')],'internal':_0x3ca863[_0x8376('0x21')]};_0x64bd5d[_0x8376('0x43')](function(_0x32a449){_0xec6fd2['push'](_['merge']({'channel':_0x32a449,'type':_0x8376('0x52'),'data1':_0x8376('0x53'),'data2':_0x527e07},_0x4483be));if(_0x3ca863[_0x8376('0x4f')]){_0x3dce71[_0x8376('0x2b')](_[_0x8376('0x54')]({'channel':_0x32a449,'type':_0x8376('0x26'),'data1':'LOGININPAUSE'},_0x4483be));}});return db['MemberReport'][_0x8376('0x30')](_0xec6fd2[_0x8376('0x55')](_0x3dce71),{'individualHooks':!![]});}})[_0x8376('0x17')](function(){if(_0x3ca863){return _0x3ca863[_0x8376('0x31')]({'online':!![],'lastLoginAt':moment()[_0x8376('0x28')](_0x8376('0x29')),'voicePause':_0x3ca863[_0x8376('0x4f')]||![],'mailPause':_0x3ca863[_0x8376('0x4f')]||![],'chatPause':_0x3ca863[_0x8376('0x4f')]||![],'faxPause':_0x3ca863['loginInPause']||![],'smsPause':_0x3ca863[_0x8376('0x4f')]||![],'openchannelPause':_0x3ca863[_0x8376('0x4f')]||![],'pauseType':_0x3ca863[_0x8376('0x4f')]?_0x8376('0x56'):null,'lastPauseAt':moment()['format'](_0x8376('0x29')),'interface':_0x527e07});}})[_0x8376('0x17')](function(_0x1bd6a){_0x4b51c9(_0x1bd6a);})[_0x8376('0x44')](function(_0x84639c){_0x449bc1(_0x41a8ea['error'](0x1f4,_0x84639c[_0x8376('0x1a')]));});});}; \ No newline at end of file +var _0x071b=['getLicense','agents','getVoiceQueues','upsert','UserVoiceQueue.penalty','all','merge','LOGIN','callysquare','LOGININPAUSE','concat','util','moment','bluebird','../../mysqldb','../../config/utils','rpc','redis','localhost','socket.io-emitter','./user.socket','register','GetUser','findAll','options','where','limit','include','model','attributes','map','then','debug','error','message','ShowUser','User','find','raw','info','catch','PauseUser','name','role','internal','User\x20with\x20id\x20%s\x20not\x20found','params','UserVoiceQueueRt','MemberReport','PAUSE','length','format','updateAttributes','getChannels','forEach','isNil','interface','YYYY-MM-DD\x20HH:mm:ss','body','type','DEFAULT\x20PAUSE','bulkCreate','UnpauseUser','resolve','channel','Channel\x20parameter\x20%s\x20is\x20invalid','findOne','mailPause','chatPause','faxPause','openchannelPause','smsPause','whatsappPause','unpause','system','LogoutUser','destroy','push','update','LoginUser','phone','loginInPause','SIP/%s','count','agent','../../config/license/util'];(function(_0x4de222,_0x22f7ee){var _0x27c851=function(_0x4775da){while(--_0x4775da){_0x4de222['push'](_0x4de222['shift']());}};_0x27c851(++_0x22f7ee);}(_0x071b,0x10d));var _0xb071=function(_0xcd4c43,_0x4869b9){_0xcd4c43=_0xcd4c43-0x0;var _0x36b300=_0x071b[_0xcd4c43];return _0x36b300;};'use strict';var _=require('lodash');var util=require(_0xb071('0x0'));var moment=require(_0xb071('0x1'));var BPromise=require(_0xb071('0x2'));var Redis=require('ioredis');var db=require(_0xb071('0x3'))['db'];var utils=require(_0xb071('0x4'));var logger=require('../../config/logger')(_0xb071('0x5'));var config=require('../../config/environment');config[_0xb071('0x6')]=_['defaults'](config[_0xb071('0x6')],{'host':_0xb071('0x7'),'port':0x18eb});var socket=require(_0xb071('0x8'))(new Redis(config[_0xb071('0x6')]));require(_0xb071('0x9'))[_0xb071('0xa')](socket);exports[_0xb071('0xb')]=function(_0x3a56f2){var _0x251d29=this;return new Promise(function(_0x1ffed3,_0x44e93a){return db['User'][_0xb071('0xc')]({'raw':_0x3a56f2[_0xb071('0xd')]?_0x3a56f2[_0xb071('0xd')]['raw']===undefined?!![]:![]:!![],'where':_0x3a56f2[_0xb071('0xd')]?_0x3a56f2[_0xb071('0xd')][_0xb071('0xe')]||null:null,'attributes':_0x3a56f2[_0xb071('0xd')]?_0x3a56f2['options']['attributes']||null:null,'limit':_0x3a56f2[_0xb071('0xd')]?_0x3a56f2[_0xb071('0xd')][_0xb071('0xf')]||null:null,'include':_0x3a56f2['options']?_0x3a56f2[_0xb071('0xd')][_0xb071('0x10')]?_['map'](_0x3a56f2[_0xb071('0xd')][_0xb071('0x10')],function(_0x2cbe9e){return{'model':db[_0x2cbe9e[_0xb071('0x11')]],'as':_0x2cbe9e['as'],'attributes':_0x2cbe9e[_0xb071('0x12')],'include':_0x2cbe9e[_0xb071('0x10')]?_[_0xb071('0x13')](_0x2cbe9e[_0xb071('0x10')],function(_0x496c37){return{'model':db[_0x496c37[_0xb071('0x11')]],'as':_0x496c37['as'],'attributes':_0x496c37[_0xb071('0x12')],'include':_0x496c37[_0xb071('0x10')]?_['map'](_0x496c37[_0xb071('0x10')],function(_0x3ba7ff){return{'model':db[_0x3ba7ff[_0xb071('0x11')]],'as':_0x3ba7ff['as'],'attributes':_0x3ba7ff[_0xb071('0x12')]};}):[]};}):[]};}):[]:[]})[_0xb071('0x14')](function(_0x40f1ed){logger['info'](_0xb071('0xb'),_0x3a56f2);logger[_0xb071('0x15')](_0xb071('0xb'),_0x3a56f2,JSON['stringify'](_0x40f1ed));_0x1ffed3(_0x40f1ed);})['catch'](function(_0x34c5d8){logger[_0xb071('0x16')](_0xb071('0xb'),_0x34c5d8[_0xb071('0x17')],_0x3a56f2);_0x44e93a(_0x251d29[_0xb071('0x16')](0x1f4,_0x34c5d8[_0xb071('0x17')]));});});};exports[_0xb071('0x18')]=function(_0x10c1a8){var _0x1bff3e=this;return new Promise(function(_0x1fc1e8,_0x35cd18){return db[_0xb071('0x19')][_0xb071('0x1a')]({'raw':_0x10c1a8[_0xb071('0xd')]?_0x10c1a8[_0xb071('0xd')][_0xb071('0x1b')]===undefined?!![]:![]:!![],'where':_0x10c1a8[_0xb071('0xd')]?_0x10c1a8[_0xb071('0xd')][_0xb071('0xe')]||null:null,'attributes':_0x10c1a8['options']?_0x10c1a8['options'][_0xb071('0x12')]||null:null,'include':_0x10c1a8['options']?_0x10c1a8[_0xb071('0xd')][_0xb071('0x10')]?_[_0xb071('0x13')](_0x10c1a8['options']['include'],function(_0x35c34f){return{'model':db[_0x35c34f['model']],'as':_0x35c34f['as'],'attributes':_0x35c34f[_0xb071('0x12')],'include':_0x35c34f[_0xb071('0x10')]?_[_0xb071('0x13')](_0x35c34f['include'],function(_0xc6eeec){return{'model':db[_0xc6eeec[_0xb071('0x11')]],'as':_0xc6eeec['as'],'attributes':_0xc6eeec[_0xb071('0x12')],'include':_0xc6eeec[_0xb071('0x10')]?_['map'](_0xc6eeec[_0xb071('0x10')],function(_0x59f841){return{'model':db[_0x59f841['model']],'as':_0x59f841['as'],'attributes':_0x59f841['attributes']};}):[]};}):[]};}):[]:[]})[_0xb071('0x14')](function(_0x123518){logger[_0xb071('0x1c')](_0xb071('0x18'),_0x10c1a8);logger[_0xb071('0x15')](_0xb071('0x18'),_0x10c1a8,JSON['stringify'](_0x123518));_0x1fc1e8(_0x123518);})[_0xb071('0x1d')](function(_0x5bc96e){logger[_0xb071('0x16')](_0xb071('0x18'),_0x5bc96e[_0xb071('0x17')],_0x10c1a8);_0x35cd18(_0x1bff3e[_0xb071('0x16')](0x1f4,_0x5bc96e[_0xb071('0x17')]));});});};exports[_0xb071('0x1e')]=function(_0x51f848){var _0x167a8d;return db['User']['find']({'where':_0x51f848[_0xb071('0xd')][_0xb071('0xe')]||{},'attributes':['id',_0xb071('0x1f'),_0xb071('0x20'),_0xb071('0x21'),'interface']})['then'](function(_0x5bc20e){if(!_0x5bc20e){throw new Error(util['format'](_0xb071('0x22'),_0x51f848[_0xb071('0x23')]['id']));}_0x167a8d=_0x5bc20e;return db[_0xb071('0x24')]['update']({'paused':0x1},{'where':{'UserId':_0x167a8d['id']},'individualHooks':!![]});})[_0xb071('0x14')](function(){return db[_0xb071('0x25')][_0xb071('0xc')]({'where':{'membername':_0x167a8d[_0xb071('0x1f')],'type':_0xb071('0x26'),'exitAt':null}});})[_0xb071('0x14')](function(_0x8399a0){if(_0x8399a0&&_0x8399a0[_0xb071('0x27')]){var _0x38c2ac=moment()[_0xb071('0x28')]('YYYY-MM-DD\x20HH:mm:ss');for(var _0x112803=0x0,_0x5c3e8f=_0x8399a0['length'];_0x112803<_0x5c3e8f;_0x112803++){_0x8399a0[_0x112803][_0xb071('0x29')]({'exitAt':_0x38c2ac});}}})[_0xb071('0x14')](function(){var _0x353df2=[];var _0x3332d1=utils[_0xb071('0x2a')]();_0x3332d1[_0xb071('0x2b')](function(_0x591d0b){_0x353df2['push']({'channel':_0x591d0b,'membername':_0x167a8d[_0xb071('0x1f')],'interface':_[_0xb071('0x2c')](_0x167a8d['interface'])?util[_0xb071('0x28')]('SIP/%s',_0x167a8d[_0xb071('0x1f')]):_0x167a8d[_0xb071('0x2d')],'type':_0xb071('0x26'),'enterAt':moment()['format'](_0xb071('0x2e')),'data1':_0x51f848[_0xb071('0x2f')][_0xb071('0x30')]||_0xb071('0x31'),'role':_0x167a8d['role'],'internal':_0x167a8d[_0xb071('0x21')],'uniqueid':_0x51f848[_0xb071('0x2f')]['uniqueid']||null});});return db[_0xb071('0x25')][_0xb071('0x32')](_0x353df2,{'individualHooks':!![]});})['then'](function(){return _0x167a8d['update']({'voicePause':!![],'mailPause':!![],'chatPause':!![],'faxPause':!![],'smsPause':!![],'openchannelPause':!![],'whatsappPause':!![],'pauseType':_0x51f848[_0xb071('0x2f')][_0xb071('0x30')]||_0xb071('0x31'),'lastPauseAt':moment()[_0xb071('0x28')](_0xb071('0x2e'))});})[_0xb071('0x1d')](function(_0x52f7eb){throw _0x52f7eb;});};exports[_0xb071('0x33')]=function(_0x4525b6){return Promise[_0xb071('0x34')]()['then'](function(){if(_0x4525b6['body']['channel']&&!utils['isValidChannel'](_0x4525b6[_0xb071('0x2f')][_0xb071('0x35')])){throw new Error(util[_0xb071('0x28')](_0xb071('0x36'),_0x4525b6[_0xb071('0x2f')]['channel']));}return db[_0xb071('0x19')][_0xb071('0x37')]({'where':_0x4525b6[_0xb071('0xd')][_0xb071('0xe')]||{},'attributes':['id',_0xb071('0x1f'),_0xb071('0x20'),_0xb071('0x21'),_0xb071('0x2d'),'online','voicePause',_0xb071('0x38'),_0xb071('0x39'),_0xb071('0x3a'),_0xb071('0x3b'),_0xb071('0x3c'),_0xb071('0x3d'),'pauseType','lastPauseAt']});})[_0xb071('0x14')](function(_0x30a256){if(!_0x30a256){throw new Error(util['format'](_0xb071('0x22'),_0x4525b6[_0xb071('0x23')]['id']));}return _0x30a256[_0xb071('0x3e')](_0x4525b6[_0xb071('0x2f')][_0xb071('0x35')],_0xb071('0x3f'));})['catch'](function(_0x5aed3c){throw _0x5aed3c;});};exports[_0xb071('0x40')]=function(_0x5b988c){var _0x269ba8=this;return new Promise(function(_0x120add,_0x257ba0){var _0x5e1c58;return db['User'][_0xb071('0x37')]({'where':_0x5b988c[_0xb071('0xd')]['where']||{},'attributes':['id','name']})[_0xb071('0x14')](function(_0x1b5f9a){if(_0x1b5f9a){_0x5e1c58=_0x1b5f9a;return db[_0xb071('0x24')][_0xb071('0x41')]({'where':{'membername':_0x5e1c58[_0xb071('0x1f')]},'individualHooks':!![]});}})[_0xb071('0x14')](function(){if(_0x5e1c58){return db[_0xb071('0x25')][_0xb071('0xc')]({'where':{'membername':_0x5e1c58['name'],'exitAt':null}});}})[_0xb071('0x14')](function(_0x4832f2){if(_0x5e1c58){if(_0x4832f2&&_0x4832f2['length']){var _0x39483c=[];_0x4832f2[_0xb071('0x2b')](function(_0x55d587){_0x39483c[_0xb071('0x42')](_0x55d587[_0xb071('0x43')]({'exitAt':moment()[_0xb071('0x28')]('YYYY-MM-DD\x20HH:mm:ss')}));});return BPromise['all'](_0x39483c);}}})[_0xb071('0x14')](function(){if(_0x5e1c58){return _0x5e1c58['update']({'online':![],'voicePause':![],'mailPause':![],'chatPause':![],'faxPause':![],'smsPause':![],'openchannelPause':![]});}})[_0xb071('0x14')](function(_0x3c7652){_0x120add(_0x3c7652);})['catch'](function(_0x43db6d){_0x257ba0(_0x269ba8[_0xb071('0x16')](0x1f4,_0x43db6d[_0xb071('0x17')]));});});};exports[_0xb071('0x44')]=function(_0x1065ea){var _0x3f604e=this;return new Promise(function(_0x30cddf,_0x2b1b5f){var _0x3244a2;var _0xf372d9;var _0x5c6f66;var _0x10e6b3;return db['User'][_0xb071('0x37')]({'where':_0x1065ea[_0xb071('0xd')][_0xb071('0xe')]||{},'attributes':['id',_0xb071('0x1f'),_0xb071('0x20'),'mobile',_0xb071('0x45'),'internal',_0xb071('0x46'),_0xb071('0x2d')]})[_0xb071('0x14')](function(_0xc3e11d){if(_0xc3e11d){_0x3244a2=_0xc3e11d;_0x10e6b3=_0x1065ea[_0xb071('0x2f')][_0xb071('0x2d')]?_0x1065ea['body'][_0xb071('0x2d')]:util[_0xb071('0x28')](_0xb071('0x47'),_0x3244a2[_0xb071('0x1f')]);return db['User'][_0xb071('0x48')]({'where':{'role':_0xb071('0x49'),'online':!![],'id':{'$ne':_0x3244a2['id']}}});}})[_0xb071('0x14')](function(_0x304be5){if(_0x304be5){_0x5c6f66=_0x304be5;return require(_0xb071('0x4a'))[_0xb071('0x4b')]();}})['then'](function(_0x4e7e79){if(_0x4e7e79&&_0x4e7e79['agents']&&_0x5c6f66>=_0x4e7e79[_0xb071('0x4c')]){throw new Error('Maximum\x20login\x20has\x20been\x20reached');}})[_0xb071('0x14')](function(){if(_0x3244a2){return db[_0xb071('0x24')][_0xb071('0x41')]({'where':{'membername':_0x3244a2['name']},'individualHooks':!![]});}})[_0xb071('0x14')](function(){if(_0x3244a2){return _0x3244a2[_0xb071('0x4d')]({'raw':!![]});}})[_0xb071('0x14')](function(_0x1ee505){if(_0x3244a2){if(_0x1ee505){var _0x2adaab=[];_0xf372d9=_0x1ee505;if(_0xf372d9[_0xb071('0x27')]){for(var _0x1382da=0x0;_0x1382da<_0xf372d9['length'];_0x1382da++){_0x2adaab[_0xb071('0x42')](db['UserVoiceQueueRt'][_0xb071('0x4e')]({'membername':_0x3244a2['name'],'UserId':_0x3244a2['id'],'queue_name':_0xf372d9[_0x1382da][_0xb071('0x1f')],'VoiceQueueId':_0xf372d9[_0x1382da]['id'],'interface':_0x10e6b3,'paused':_0x3244a2[_0xb071('0x46')]||![],'penalty':_0xf372d9[_0x1382da][_0xb071('0x4f')]||0x0}));}return BPromise[_0xb071('0x50')](_0x2adaab);}}}})[_0xb071('0x14')](function(){if(_0x3244a2){return db[_0xb071('0x25')]['findAll']({'where':{'membername':_0x3244a2[_0xb071('0x1f')],'exitAt':null}});}})[_0xb071('0x14')](function(_0x1b6621){if(_0x3244a2){if(_0x1b6621&&_0x1b6621[_0xb071('0x27')]){var _0x69fc86=[];_0x1b6621[_0xb071('0x2b')](function(_0x5232ce){_0x69fc86[_0xb071('0x42')](_0x5232ce['update']({'exitAt':moment()['format'](_0xb071('0x2e'))}));});return BPromise['all'](_0x69fc86);}}})['then'](function(){if(_0x3244a2){var _0x517fa3=[];var _0x305cf1=[];var _0x29a0f2=utils[_0xb071('0x2a')]();var _0x367faa={'membername':_0x3244a2[_0xb071('0x1f')],'interface':_0x10e6b3,'enterAt':moment()[_0xb071('0x28')](_0xb071('0x2e')),'role':_0x3244a2['role'],'internal':_0x3244a2['internal']};_0x29a0f2['forEach'](function(_0x20fb8){_0x517fa3[_0xb071('0x42')](_[_0xb071('0x51')]({'channel':_0x20fb8,'type':_0xb071('0x52'),'data1':_0xb071('0x53'),'data2':_0x10e6b3},_0x367faa));if(_0x3244a2[_0xb071('0x46')]){_0x305cf1['push'](_[_0xb071('0x51')]({'channel':_0x20fb8,'type':'PAUSE','data1':_0xb071('0x54')},_0x367faa));}});return db[_0xb071('0x25')][_0xb071('0x32')](_0x517fa3[_0xb071('0x55')](_0x305cf1),{'individualHooks':!![]});}})[_0xb071('0x14')](function(){if(_0x3244a2){return _0x3244a2[_0xb071('0x43')]({'online':!![],'lastLoginAt':moment()[_0xb071('0x28')]('YYYY-MM-DD\x20HH:mm:ss'),'voicePause':_0x3244a2['loginInPause']||![],'mailPause':_0x3244a2[_0xb071('0x46')]||![],'chatPause':_0x3244a2[_0xb071('0x46')]||![],'faxPause':_0x3244a2[_0xb071('0x46')]||![],'smsPause':_0x3244a2[_0xb071('0x46')]||![],'openchannelPause':_0x3244a2[_0xb071('0x46')]||![],'pauseType':_0x3244a2['loginInPause']?'LOGININPAUSE':null,'lastPauseAt':moment()[_0xb071('0x28')]('YYYY-MM-DD\x20HH:mm:ss'),'interface':_0x10e6b3});}})[_0xb071('0x14')](function(_0xcaaca4){_0x30cddf(_0xcaaca4);})[_0xb071('0x1d')](function(_0x4ed7bd){_0x2b1b5f(_0x3f604e[_0xb071('0x16')](0x1f4,_0x4ed7bd[_0xb071('0x17')]));});});}; \ No newline at end of file diff --git a/server/api/user/user.socket.js b/server/api/user/user.socket.js index 6da70be..b4a5d4a 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 _0xbd58=['length','user:','remove','update','emit','removeListener','register'];(function(_0x1aac46,_0x5e2881){var _0x2f7f7d=function(_0x18f4d4){while(--_0x18f4d4){_0x1aac46['push'](_0x1aac46['shift']());}};_0x2f7f7d(++_0x5e2881);}(_0xbd58,0x1e5));var _0x8bd5=function(_0x59e4e3,_0x430f6c){_0x59e4e3=_0x59e4e3-0x0;var _0x54be45=_0xbd58[_0x59e4e3];return _0x54be45;};'use strict';var UserEvents=require('./user.events');var events=['save',_0x8bd5('0x0'),_0x8bd5('0x1')];function createListener(_0x2bca35,_0x1b7c0b){return function(_0x28b857){_0x1b7c0b[_0x8bd5('0x2')](_0x2bca35,_0x28b857);};}function removeListener(_0x51fa99,_0x136bc7){return function(){UserEvents[_0x8bd5('0x3')](_0x51fa99,_0x136bc7);};}exports[_0x8bd5('0x4')]=function(_0x356253){for(var _0x56aecb=0x0,_0x20e76c=events[_0x8bd5('0x5')];_0x56aecb<_0x20e76c;_0x56aecb++){var _0x458ce9=events[_0x56aecb];var _0x51af9f=createListener(_0x8bd5('0x6')+_0x458ce9,_0x356253);UserEvents['on'](_0x458ce9,_0x51af9f);}}; \ No newline at end of file +var _0xb931=['save','emit','register','length'];(function(_0x4108e9,_0x58da63){var _0x369cc4=function(_0x527bfd){while(--_0x527bfd){_0x4108e9['push'](_0x4108e9['shift']());}};_0x369cc4(++_0x58da63);}(_0xb931,0xa0));var _0x1b93=function(_0x579dfd,_0x49ec2d){_0x579dfd=_0x579dfd-0x0;var _0x3231dc=_0xb931[_0x579dfd];return _0x3231dc;};'use strict';var UserEvents=require('./user.events');var events=[_0x1b93('0x0'),'remove','update'];function createListener(_0x3bf416,_0x207f81){return function(_0x42ff06){_0x207f81[_0x1b93('0x1')](_0x3bf416,_0x42ff06);};}function removeListener(_0x310a85,_0x2c2be9){return function(){UserEvents['removeListener'](_0x310a85,_0x2c2be9);};}exports[_0x1b93('0x2')]=function(_0x40c857){for(var _0x1a3c42=0x0,_0x3d61bc=events[_0x1b93('0x3')];_0x1a3c42<_0x3d61bc;_0x1a3c42++){var _0x39aa9a=events[_0x1a3c42];var _0x5ba4ac=createListener('user:'+_0x39aa9a,_0x40c857);UserEvents['on'](_0x39aa9a,_0x5ba4ac);}}; \ No newline at end of file diff --git a/server/api/userChatQueue/index.js b/server/api/userChatQueue/index.js index d47ccde..9be6188 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 _0xcb91=['express','Router','../../components/auth/service','../../components/interaction/service','exports','path','connect-timeout'];(function(_0xa6b0b8,_0xcbbdeb){var _0x14cea8=function(_0x5937c1){while(--_0x5937c1){_0xa6b0b8['push'](_0xa6b0b8['shift']());}};_0x14cea8(++_0xcbbdeb);}(_0xcb91,0x1a9));var _0x1cb9=function(_0x5d6c3e,_0x409a3e){_0x5d6c3e=_0x5d6c3e-0x0;var _0x44ecb7=_0xcb91[_0x5d6c3e];return _0x44ecb7;};'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 _0xa9e0=['../../components/interaction/service','../../config/environment','exports','multer','util','path','Router','../../components/auth/service'];(function(_0x3f6614,_0xefe981){var _0x7dc330=function(_0xe205d4){while(--_0xe205d4){_0x3f6614['push'](_0x3f6614['shift']());}};_0x7dc330(++_0xefe981);}(_0xa9e0,0x123));var _0x0a9e=function(_0x92c450,_0x41f1e3){_0x92c450=_0x92c450-0x0;var _0x2a9599=_0xa9e0[_0x92c450];return _0x2a9599;};'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 709125b..8614fb0 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 _0x1b6d=['INTEGER','exports'];(function(_0x3ab51d,_0x2fa01d){var _0x29a04e=function(_0x7807b0){while(--_0x7807b0){_0x3ab51d['push'](_0x3ab51d['shift']());}};_0x29a04e(++_0x2fa01d);}(_0x1b6d,0xe7));var _0xd1b6=function(_0x178e48,_0x3c9509){_0x178e48=_0x178e48-0x0;var _0x440d7e=_0x1b6d[_0x178e48];return _0x440d7e;};'use strict';var Sequelize=require('sequelize');module[_0xd1b6('0x0')]={'penalty':{'type':Sequelize[_0xd1b6('0x1')],'defaultValue':0x0}}; \ No newline at end of file +var _0xe64e=['sequelize','exports','INTEGER'];(function(_0x1d9382,_0x2d17b5){var _0x34ebe0=function(_0x397428){while(--_0x397428){_0x1d9382['push'](_0x1d9382['shift']());}};_0x34ebe0(++_0x2d17b5);}(_0xe64e,0xe4));var _0xee64=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0xe64e[_0x20a584];return _0x4b41a8;};'use strict';var Sequelize=require(_0xee64('0x0'));module[_0xee64('0x1')]={'penalty':{'type':Sequelize[_0xee64('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 d90af37..f83cbc0 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 _0x6513=['util','../../config/logger','moment','request-promise','path','rimraf','../../config/environment','./userChatQueue.attributes','exports'];(function(_0xe2cbb8,_0x158436){var _0x3cce4d=function(_0x5a7e3d){while(--_0x5a7e3d){_0xe2cbb8['push'](_0xe2cbb8['shift']());}};_0x3cce4d(++_0x158436);}(_0x6513,0xf3));var _0x3651=function(_0x5de532,_0x2941c4){_0x5de532=_0x5de532-0x0;var _0x4e9192=_0x6513[_0x5de532];return _0x4e9192;};'use strict';var _=require('lodash');var util=require(_0x3651('0x0'));var logger=require(_0x3651('0x1'))('api');var moment=require(_0x3651('0x2'));var BPromise=require('bluebird');var rp=require(_0x3651('0x3'));var fs=require('fs');var path=require(_0x3651('0x4'));var rimraf=require(_0x3651('0x5'));var config=require(_0x3651('0x6'));var attributes=require(_0x3651('0x7'));module[_0x3651('0x8')]=function(_0x426d41,_0x1335a1){return _0x426d41['define']('UserChatQueue',attributes,{'tableName':'user_has_chat_queues','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xe07e=['path','rimraf','../../config/environment','./userChatQueue.attributes','exports','define','UserChatQueue','user_has_chat_queues','util','../../config/logger','api','moment','bluebird'];(function(_0x4355be,_0x23a3c2){var _0x3d3534=function(_0x1a7205){while(--_0x1a7205){_0x4355be['push'](_0x4355be['shift']());}};_0x3d3534(++_0x23a3c2);}(_0xe07e,0xff));var _0xee07=function(_0x43b08,_0x15f967){_0x43b08=_0x43b08-0x0;var _0x5e05f4=_0xe07e[_0x43b08];return _0x5e05f4;};'use strict';var _=require('lodash');var util=require(_0xee07('0x0'));var logger=require(_0xee07('0x1'))(_0xee07('0x2'));var moment=require(_0xee07('0x3'));var BPromise=require(_0xee07('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xee07('0x5'));var rimraf=require(_0xee07('0x6'));var config=require(_0xee07('0x7'));var attributes=require(_0xee07('0x8'));module[_0xee07('0x9')]=function(_0x48d3b4,_0x1c8473){return _0x48d3b4[_0xee07('0xa')](_0xee07('0xb'),attributes,{'tableName':_0xee07('0xc'),'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 3eb0f16..b19366a 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 _0x9b95=['debug','UserChatQueue,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','request','then','info','UserChatQueue,\x20%s,\x20%s'];(function(_0x469a98,_0x1405fa){var _0x5b638c=function(_0x71f7c5){while(--_0x71f7c5){_0x469a98['push'](_0x469a98['shift']());}};_0x5b638c(++_0x1405fa);}(_0x9b95,0x9f));var _0x59b9=function(_0x42cae2,_0x284ef8){_0x42cae2=_0x42cae2-0x0;var _0x5f256f=_0x9b95[_0x42cae2];return _0x5f256f;};'use strict';var _=require(_0x59b9('0x0'));var util=require(_0x59b9('0x1'));var moment=require(_0x59b9('0x2'));var BPromise=require(_0x59b9('0x3'));var rs=require(_0x59b9('0x4'));var fs=require('fs');var Redis=require(_0x59b9('0x5'));var db=require(_0x59b9('0x6'))['db'];var utils=require(_0x59b9('0x7'));var logger=require(_0x59b9('0x8'))(_0x59b9('0x9'));var config=require(_0x59b9('0xa'));var jayson=require(_0x59b9('0xb'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x1a83a6,_0x4c2138,_0x4484f4){return new BPromise(function(_0xff52c0,_0xa2f595){return client[_0x59b9('0xc')](_0x1a83a6,_0x4484f4)[_0x59b9('0xd')](function(_0x4fcf8a){logger[_0x59b9('0xe')](_0x59b9('0xf'),_0x4c2138,'request\x20sent');logger[_0x59b9('0x10')](_0x59b9('0x11'),_0x4c2138,_0x59b9('0x12'),JSON[_0x59b9('0x13')](_0x4fcf8a));if(_0x4fcf8a[_0x59b9('0x14')]){if(_0x4fcf8a[_0x59b9('0x14')][_0x59b9('0x15')]===0x1f4){logger[_0x59b9('0x14')]('UserChatQueue,\x20%s,\x20%s',_0x4c2138,_0x4fcf8a[_0x59b9('0x14')]['message']);return _0xa2f595(_0x4fcf8a[_0x59b9('0x14')][_0x59b9('0x16')]);}logger['error'](_0x59b9('0xf'),_0x4c2138,_0x4fcf8a[_0x59b9('0x14')][_0x59b9('0x16')]);return _0xff52c0(_0x4fcf8a[_0x59b9('0x14')]['message']);}else{logger[_0x59b9('0xe')](_0x59b9('0xf'),_0x4c2138,'request\x20sent');_0xff52c0(_0x4fcf8a[_0x59b9('0x17')][_0x59b9('0x16')]);}})[_0x59b9('0x18')](function(_0x59146e){logger['error'](_0x59b9('0xf'),_0x4c2138,_0x59146e);_0xa2f595(_0x59146e);});});} \ No newline at end of file +var _0x79bc=['then','info','UserChatQueue,\x20%s,\x20%s','debug','UserChatQueue,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','lodash','util','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client'];(function(_0x2635e6,_0x3b2aec){var _0x71b2e5=function(_0x59e941){while(--_0x59e941){_0x2635e6['push'](_0x2635e6['shift']());}};_0x71b2e5(++_0x3b2aec);}(_0x79bc,0x17c));var _0xc79b=function(_0x40a045,_0x516f0e){_0x40a045=_0x40a045-0x0;var _0x1a687c=_0x79bc[_0x40a045];return _0x1a687c;};'use strict';var _=require(_0xc79b('0x0'));var util=require(_0xc79b('0x1'));var moment=require('moment');var BPromise=require(_0xc79b('0x2'));var rs=require(_0xc79b('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xc79b('0x4'))['db'];var utils=require(_0xc79b('0x5'));var logger=require(_0xc79b('0x6'))(_0xc79b('0x7'));var config=require(_0xc79b('0x8'));var jayson=require(_0xc79b('0x9'));var client=jayson[_0xc79b('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x2f9d38,_0x43a2a5,_0x2a4eb8){return new BPromise(function(_0x27cada,_0x1a954f){return client['request'](_0x2f9d38,_0x2a4eb8)[_0xc79b('0xb')](function(_0x115c11){logger[_0xc79b('0xc')](_0xc79b('0xd'),_0x43a2a5,'request\x20sent');logger[_0xc79b('0xe')](_0xc79b('0xf'),_0x43a2a5,_0xc79b('0x10'),JSON[_0xc79b('0x11')](_0x115c11));if(_0x115c11[_0xc79b('0x12')]){if(_0x115c11[_0xc79b('0x12')][_0xc79b('0x13')]===0x1f4){logger['error'](_0xc79b('0xd'),_0x43a2a5,_0x115c11[_0xc79b('0x12')]['message']);return _0x1a954f(_0x115c11[_0xc79b('0x12')][_0xc79b('0x14')]);}logger[_0xc79b('0x12')]('UserChatQueue,\x20%s,\x20%s',_0x43a2a5,_0x115c11['error']['message']);return _0x27cada(_0x115c11[_0xc79b('0x12')]['message']);}else{logger['info']('UserChatQueue,\x20%s,\x20%s',_0x43a2a5,_0xc79b('0x10'));_0x27cada(_0x115c11[_0xc79b('0x15')][_0xc79b('0x14')]);}})[_0xc79b('0x16')](function(_0x5e354d){logger[_0xc79b('0x12')]('UserChatQueue,\x20%s,\x20%s',_0x43a2a5,_0x5e354d);_0x1a954f(_0x5e354d);});});} \ No newline at end of file diff --git a/server/api/userFaxQueue/index.js b/server/api/userFaxQueue/index.js index 304cf50..b824b99 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 _0x0713=['../../config/environment','exports','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service'];(function(_0x17ea13,_0x1b7955){var _0x911701=function(_0x1ebed6){while(--_0x1ebed6){_0x17ea13['push'](_0x17ea13['shift']());}};_0x911701(++_0x1b7955);}(_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 _0xe706=['../../components/interaction/service','../../config/environment','exports','multer','util','path','express','Router','fs-extra','../../components/auth/service'];(function(_0x4bf959,_0x29b1d7){var _0x2b96b4=function(_0x133c2b){while(--_0x133c2b){_0x4bf959['push'](_0x4bf959['shift']());}};_0x2b96b4(++_0x29b1d7);}(_0xe706,0xa3));var _0x6e70=function(_0x2ad632,_0x134994){_0x2ad632=_0x2ad632-0x0;var _0x418653=_0xe706[_0x2ad632];return _0x418653;};'use strict';var multer=require(_0x6e70('0x0'));var util=require(_0x6e70('0x1'));var path=require(_0x6e70('0x2'));var timeout=require('connect-timeout');var express=require(_0x6e70('0x3'));var router=express[_0x6e70('0x4')]();var fs_extra=require(_0x6e70('0x5'));var auth=require(_0x6e70('0x6'));var interaction=require(_0x6e70('0x7'));var config=require(_0x6e70('0x8'));module[_0x6e70('0x9')]=router; \ No newline at end of file diff --git a/server/api/userFaxQueue/userFaxQueue.attributes.js b/server/api/userFaxQueue/userFaxQueue.attributes.js index f51ec25..9a5c34b 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 _0xe741=['sequelize','INTEGER','STRING'];(function(_0x366647,_0xd7065c){var _0x54aed1=function(_0x1c0d52){while(--_0x1c0d52){_0x366647['push'](_0x366647['shift']());}};_0x54aed1(++_0xd7065c);}(_0xe741,0x1bf));var _0x1e74=function(_0x4d613c,_0x55f220){_0x4d613c=_0x4d613c-0x0;var _0x301fe3=_0xe741[_0x4d613c];return _0x301fe3;};'use strict';var Sequelize=require(_0x1e74('0x0'));module['exports']={'penalty':{'type':Sequelize[_0x1e74('0x1')],'defaultValue':0x0},'assigned':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'queue':{'type':Sequelize[_0x1e74('0x2')]}}; \ No newline at end of file +var _0xcba4=['STRING','sequelize','exports','INTEGER'];(function(_0x7e8c83,_0x42e370){var _0x2f9fb2=function(_0x4652e6){while(--_0x4652e6){_0x7e8c83['push'](_0x7e8c83['shift']());}};_0x2f9fb2(++_0x42e370);}(_0xcba4,0x161));var _0x4cba=function(_0x1b38a5,_0x1fb566){_0x1b38a5=_0x1b38a5-0x0;var _0x2ec46f=_0xcba4[_0x1b38a5];return _0x2ec46f;};'use strict';var Sequelize=require(_0x4cba('0x0'));module[_0x4cba('0x1')]={'penalty':{'type':Sequelize[_0x4cba('0x2')],'defaultValue':0x0},'assigned':{'type':Sequelize[_0x4cba('0x2')],'defaultValue':0x0},'queue':{'type':Sequelize[_0x4cba('0x3')]}}; \ No newline at end of file diff --git a/server/api/userFaxQueue/userFaxQueue.model.js b/server/api/userFaxQueue/userFaxQueue.model.js index aca7fd2..e9074d2 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 _0x1bcc=['../../config/environment','./userFaxQueue.attributes','exports','define','UserFaxQueue','user_has_fax_queues','lodash','util','../../config/logger','api','moment','request-promise','path','rimraf'];(function(_0x50f5ef,_0x10677c){var _0x48f2a2=function(_0x803ec5){while(--_0x803ec5){_0x50f5ef['push'](_0x50f5ef['shift']());}};_0x48f2a2(++_0x10677c);}(_0x1bcc,0xa0));var _0xc1bc=function(_0x6978c0,_0x1f6765){_0x6978c0=_0x6978c0-0x0;var _0x361377=_0x1bcc[_0x6978c0];return _0x361377;};'use strict';var _=require(_0xc1bc('0x0'));var util=require(_0xc1bc('0x1'));var logger=require(_0xc1bc('0x2'))(_0xc1bc('0x3'));var moment=require(_0xc1bc('0x4'));var BPromise=require('bluebird');var rp=require(_0xc1bc('0x5'));var fs=require('fs');var path=require(_0xc1bc('0x6'));var rimraf=require(_0xc1bc('0x7'));var config=require(_0xc1bc('0x8'));var attributes=require(_0xc1bc('0x9'));module[_0xc1bc('0xa')]=function(_0x5ebdf3,_0x53f9ec){return _0x5ebdf3[_0xc1bc('0xb')](_0xc1bc('0xc'),attributes,{'tableName':_0xc1bc('0xd'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xe59c=['user_has_fax_queues','lodash','util','../../config/logger','api','request-promise','path','rimraf','../../config/environment','define'];(function(_0x666a55,_0x19c02a){var _0x13a42a=function(_0x21ad10){while(--_0x21ad10){_0x666a55['push'](_0x666a55['shift']());}};_0x13a42a(++_0x19c02a);}(_0xe59c,0x79));var _0xce59=function(_0x1d6b89,_0x2ae71f){_0x1d6b89=_0x1d6b89-0x0;var _0x5d14ea=_0xe59c[_0x1d6b89];return _0x5d14ea;};'use strict';var _=require(_0xce59('0x0'));var util=require(_0xce59('0x1'));var logger=require(_0xce59('0x2'))(_0xce59('0x3'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0xce59('0x4'));var fs=require('fs');var path=require(_0xce59('0x5'));var rimraf=require(_0xce59('0x6'));var config=require(_0xce59('0x7'));var attributes=require('./userFaxQueue.attributes');module['exports']=function(_0x4d5e8b,_0x609d53){return _0x4d5e8b[_0xce59('0x8')]('UserFaxQueue',attributes,{'tableName':_0xce59('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/userFaxQueue/userFaxQueue.rpc.js b/server/api/userFaxQueue/userFaxQueue.rpc.js index 518290c..bafdfef 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 _0xdf0d=['code','message','result','catch','lodash','util','moment','randomstring','ioredis','../../mysqldb','rpc','jayson/promise','http','request','then','info','UserFaxQueue,\x20%s,\x20%s','request\x20sent','debug','UserFaxQueue,\x20%s,\x20%s,\x20%s','error'];(function(_0x30e469,_0x5de53c){var _0xf75061=function(_0x16a336){while(--_0x16a336){_0x30e469['push'](_0x30e469['shift']());}};_0xf75061(++_0x5de53c);}(_0xdf0d,0xeb));var _0xddf0=function(_0x3bfee5,_0x2b9999){_0x3bfee5=_0x3bfee5-0x0;var _0x174789=_0xdf0d[_0x3bfee5];return _0x174789;};'use strict';var _=require(_0xddf0('0x0'));var util=require(_0xddf0('0x1'));var moment=require(_0xddf0('0x2'));var BPromise=require('bluebird');var rs=require(_0xddf0('0x3'));var fs=require('fs');var Redis=require(_0xddf0('0x4'));var db=require(_0xddf0('0x5'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0xddf0('0x6'));var config=require('../../config/environment');var jayson=require(_0xddf0('0x7'));var client=jayson['client'][_0xddf0('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x2b3d07,_0x33ca9d,_0x5c84e8){return new BPromise(function(_0x109636,_0x1faad1){return client[_0xddf0('0x9')](_0x2b3d07,_0x5c84e8)[_0xddf0('0xa')](function(_0x3c08f0){logger[_0xddf0('0xb')](_0xddf0('0xc'),_0x33ca9d,_0xddf0('0xd'));logger[_0xddf0('0xe')](_0xddf0('0xf'),_0x33ca9d,_0xddf0('0xd'),JSON['stringify'](_0x3c08f0));if(_0x3c08f0[_0xddf0('0x10')]){if(_0x3c08f0[_0xddf0('0x10')][_0xddf0('0x11')]===0x1f4){logger[_0xddf0('0x10')](_0xddf0('0xc'),_0x33ca9d,_0x3c08f0[_0xddf0('0x10')]['message']);return _0x1faad1(_0x3c08f0[_0xddf0('0x10')][_0xddf0('0x12')]);}logger['error']('UserFaxQueue,\x20%s,\x20%s',_0x33ca9d,_0x3c08f0[_0xddf0('0x10')][_0xddf0('0x12')]);return _0x109636(_0x3c08f0[_0xddf0('0x10')][_0xddf0('0x12')]);}else{logger[_0xddf0('0xb')]('UserFaxQueue,\x20%s,\x20%s',_0x33ca9d,_0xddf0('0xd'));_0x109636(_0x3c08f0[_0xddf0('0x13')][_0xddf0('0x12')]);}})[_0xddf0('0x14')](function(_0x2e3d76){logger[_0xddf0('0x10')](_0xddf0('0xc'),_0x33ca9d,_0x2e3d76);_0x1faad1(_0x2e3d76);});});} \ No newline at end of file +var _0xc90b=['error','code','UserFaxQueue,\x20%s,\x20%s','message','info','result','lodash','util','moment','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','then','debug','UserFaxQueue,\x20%s,\x20%s,\x20%s','request\x20sent'];(function(_0x21b037,_0x1f310a){var _0x20556c=function(_0x1855a9){while(--_0x1855a9){_0x21b037['push'](_0x21b037['shift']());}};_0x20556c(++_0x1f310a);}(_0xc90b,0x15a));var _0xbc90=function(_0x275ee1,_0x439f58){_0x275ee1=_0x275ee1-0x0;var _0x52f9fc=_0xc90b[_0x275ee1];return _0x52f9fc;};'use strict';var _=require(_0xbc90('0x0'));var util=require(_0xbc90('0x1'));var moment=require(_0xbc90('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xbc90('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0xbc90('0x4'));var logger=require(_0xbc90('0x5'))(_0xbc90('0x6'));var config=require(_0xbc90('0x7'));var jayson=require('jayson/promise');var client=jayson[_0xbc90('0x8')][_0xbc90('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x620e6c,_0x386777,_0x429baa){return new BPromise(function(_0x340349,_0x2e3c8c){return client['request'](_0x620e6c,_0x429baa)[_0xbc90('0xa')](function(_0x57fc97){logger['info']('UserFaxQueue,\x20%s,\x20%s',_0x386777,'request\x20sent');logger[_0xbc90('0xb')](_0xbc90('0xc'),_0x386777,_0xbc90('0xd'),JSON['stringify'](_0x57fc97));if(_0x57fc97[_0xbc90('0xe')]){if(_0x57fc97[_0xbc90('0xe')][_0xbc90('0xf')]===0x1f4){logger[_0xbc90('0xe')](_0xbc90('0x10'),_0x386777,_0x57fc97[_0xbc90('0xe')]['message']);return _0x2e3c8c(_0x57fc97[_0xbc90('0xe')][_0xbc90('0x11')]);}logger[_0xbc90('0xe')](_0xbc90('0x10'),_0x386777,_0x57fc97[_0xbc90('0xe')][_0xbc90('0x11')]);return _0x340349(_0x57fc97[_0xbc90('0xe')][_0xbc90('0x11')]);}else{logger[_0xbc90('0x12')](_0xbc90('0x10'),_0x386777,_0xbc90('0xd'));_0x340349(_0x57fc97[_0xbc90('0x13')][_0xbc90('0x11')]);}})['catch'](function(_0x4b54e0){logger[_0xbc90('0xe')](_0xbc90('0x10'),_0x386777,_0x4b54e0);_0x2e3c8c(_0x4b54e0);});});} \ No newline at end of file diff --git a/server/api/userMailQueue/index.js b/server/api/userMailQueue/index.js index 04535bd..75758f8 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 _0xedd9=['util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','exports'];(function(_0x1205dd,_0x11605e){var _0x439f72=function(_0x459b90){while(--_0x459b90){_0x1205dd['push'](_0x1205dd['shift']());}};_0x439f72(++_0x11605e);}(_0xedd9,0xfc));var _0x9edd=function(_0x42e1cd,_0x5ea3c7){_0x42e1cd=_0x42e1cd-0x0;var _0x4d69ad=_0xedd9[_0x42e1cd];return _0x4d69ad;};'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 _0x0713=['../../config/environment','exports','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service'];(function(_0x2e7d9f,_0x452ae0){var _0x2743db=function(_0x314391){while(--_0x314391){_0x2e7d9f['push'](_0x2e7d9f['shift']());}};_0x2743db(++_0x452ae0);}(_0x0713,0x1ba));var _0x3071=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x0713[_0x3dd15e];return _0x231fd0;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x3071('0x0'));var timeout=require(_0x3071('0x1'));var express=require(_0x3071('0x2'));var router=express[_0x3071('0x3')]();var fs_extra=require(_0x3071('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0x3071('0x5'));var config=require(_0x3071('0x6'));module[_0x3071('0x7')]=router; \ No newline at end of file diff --git a/server/api/userMailQueue/userMailQueue.attributes.js b/server/api/userMailQueue/userMailQueue.attributes.js index d088b81..b8a1e0c 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 _0x6a5c=['exports'];(function(_0x1cb8aa,_0x2a08c3){var _0x220179=function(_0x32977c){while(--_0x32977c){_0x1cb8aa['push'](_0x1cb8aa['shift']());}};_0x220179(++_0x2a08c3);}(_0x6a5c,0x9d));var _0xc6a5=function(_0x272734,_0x5e33e4){_0x272734=_0x272734-0x0;var _0x1f7aa0=_0x6a5c[_0x272734];return _0x1f7aa0;};'use strict';var Sequelize=require('sequelize');module[_0xc6a5('0x0')]={'penalty':{'type':Sequelize['INTEGER'],'defaultValue':0x0}}; \ No newline at end of file +var _0x8e4c=['INTEGER','exports'];(function(_0x54efd7,_0xbc55d7){var _0x182ef6=function(_0x57e052){while(--_0x57e052){_0x54efd7['push'](_0x54efd7['shift']());}};_0x182ef6(++_0xbc55d7);}(_0x8e4c,0x69));var _0xc8e4=function(_0x4f6f84,_0x31e197){_0x4f6f84=_0x4f6f84-0x0;var _0x20d989=_0x8e4c[_0x4f6f84];return _0x20d989;};'use strict';var Sequelize=require('sequelize');module[_0xc8e4('0x0')]={'penalty':{'type':Sequelize[_0xc8e4('0x1')],'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 7d2479e..5376684 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 _0xa45c=['rimraf','./userMailQueue.attributes','exports','define','UserMailQueue','user_has_mail_queues','lodash','util','../../config/logger','api','moment','bluebird','path'];(function(_0x49f2d4,_0x4554db){var _0x174021=function(_0x5edd9f){while(--_0x5edd9f){_0x49f2d4['push'](_0x49f2d4['shift']());}};_0x174021(++_0x4554db);}(_0xa45c,0xaf));var _0xca45=function(_0x40944a,_0x99ad6d){_0x40944a=_0x40944a-0x0;var _0x36062c=_0xa45c[_0x40944a];return _0x36062c;};'use strict';var _=require(_0xca45('0x0'));var util=require(_0xca45('0x1'));var logger=require(_0xca45('0x2'))(_0xca45('0x3'));var moment=require(_0xca45('0x4'));var BPromise=require(_0xca45('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xca45('0x6'));var rimraf=require(_0xca45('0x7'));var config=require('../../config/environment');var attributes=require(_0xca45('0x8'));module[_0xca45('0x9')]=function(_0x287b9e,_0x5973fa){return _0x287b9e[_0xca45('0xa')](_0xca45('0xb'),attributes,{'tableName':_0xca45('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x320a=['../../config/environment','exports','define','UserMailQueue','lodash','util','../../config/logger','moment','bluebird','request-promise','rimraf'];(function(_0x3e3c07,_0x3ff5ca){var _0x501dc7=function(_0x556d39){while(--_0x556d39){_0x3e3c07['push'](_0x3e3c07['shift']());}};_0x501dc7(++_0x3ff5ca);}(_0x320a,0x72));var _0xa320=function(_0x449c0f,_0x4562a6){_0x449c0f=_0x449c0f-0x0;var _0x3b285e=_0x320a[_0x449c0f];return _0x3b285e;};'use strict';var _=require(_0xa320('0x0'));var util=require(_0xa320('0x1'));var logger=require(_0xa320('0x2'))('api');var moment=require(_0xa320('0x3'));var BPromise=require(_0xa320('0x4'));var rp=require(_0xa320('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0xa320('0x6'));var config=require(_0xa320('0x7'));var attributes=require('./userMailQueue.attributes');module[_0xa320('0x8')]=function(_0x546004,_0x52ebdf){return _0x546004[_0xa320('0x9')](_0xa320('0xa'),attributes,{'tableName':'user_has_mail_queues','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 275482e..01c02c8 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 _0x34e8=['lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','then','info','UserMailQueue,\x20%s,\x20%s','request\x20sent','debug','UserMailQueue,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch'];(function(_0x2aeb52,_0x3d2398){var _0x2d0e98=function(_0xd566a0){while(--_0xd566a0){_0x2aeb52['push'](_0x2aeb52['shift']());}};_0x2d0e98(++_0x3d2398);}(_0x34e8,0x12c));var _0x834e=function(_0x30cd9a,_0x3e8379){_0x30cd9a=_0x30cd9a-0x0;var _0x1c68c5=_0x34e8[_0x30cd9a];return _0x1c68c5;};'use strict';var _=require(_0x834e('0x0'));var util=require(_0x834e('0x1'));var moment=require(_0x834e('0x2'));var BPromise=require(_0x834e('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x834e('0x4'));var db=require(_0x834e('0x5'))['db'];var utils=require(_0x834e('0x6'));var logger=require(_0x834e('0x7'))(_0x834e('0x8'));var config=require(_0x834e('0x9'));var jayson=require(_0x834e('0xa'));var client=jayson['client'][_0x834e('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x52056d,_0x3e16d2,_0x3cc2e3){return new BPromise(function(_0x3a3ef6,_0x2e69e2){return client[_0x834e('0xc')](_0x52056d,_0x3cc2e3)[_0x834e('0xd')](function(_0x363786){logger[_0x834e('0xe')](_0x834e('0xf'),_0x3e16d2,_0x834e('0x10'));logger[_0x834e('0x11')](_0x834e('0x12'),_0x3e16d2,_0x834e('0x10'),JSON[_0x834e('0x13')](_0x363786));if(_0x363786[_0x834e('0x14')]){if(_0x363786[_0x834e('0x14')][_0x834e('0x15')]===0x1f4){logger['error'](_0x834e('0xf'),_0x3e16d2,_0x363786[_0x834e('0x14')]['message']);return _0x2e69e2(_0x363786[_0x834e('0x14')][_0x834e('0x16')]);}logger[_0x834e('0x14')](_0x834e('0xf'),_0x3e16d2,_0x363786['error'][_0x834e('0x16')]);return _0x3a3ef6(_0x363786[_0x834e('0x14')]['message']);}else{logger[_0x834e('0xe')]('UserMailQueue,\x20%s,\x20%s',_0x3e16d2,_0x834e('0x10'));_0x3a3ef6(_0x363786[_0x834e('0x17')]['message']);}})[_0x834e('0x18')](function(_0x22106e){logger[_0x834e('0x14')]('UserMailQueue,\x20%s,\x20%s',_0x3e16d2,_0x22106e);_0x2e69e2(_0x22106e);});});} \ No newline at end of file +var _0x9957=['message','result','catch','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','then','info','UserMailQueue,\x20%s,\x20%s','request\x20sent','debug','UserMailQueue,\x20%s,\x20%s,\x20%s','stringify','error','code'];(function(_0x264a0f,_0x5c273e){var _0x3cf070=function(_0x17acaf){while(--_0x17acaf){_0x264a0f['push'](_0x264a0f['shift']());}};_0x3cf070(++_0x5c273e);}(_0x9957,0x93));var _0x7995=function(_0x5ddb1c,_0x5ea4df){_0x5ddb1c=_0x5ddb1c-0x0;var _0x354adc=_0x9957[_0x5ddb1c];return _0x354adc;};'use strict';var _=require(_0x7995('0x0'));var util=require(_0x7995('0x1'));var 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']('UserMailQueue,\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/userNotification/index.js b/server/api/userNotification/index.js index c3e64e3..726ad6a 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 _0xb575=['sendUserNotification','exports','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./userNotification.controller','post','isAuthenticated'];(function(_0x127277,_0x4cacaf){var _0x23c8ee=function(_0x942e67){while(--_0x942e67){_0x127277['push'](_0x127277['shift']());}};_0x23c8ee(++_0x4cacaf);}(_0xb575,0x9c));var _0x5b57=function(_0x451eaa,_0x27948f){_0x451eaa=_0x451eaa-0x0;var _0x25fdd7=_0xb575[_0x451eaa];return _0x25fdd7;};'use strict';var multer=require('multer');var util=require(_0x5b57('0x0'));var path=require(_0x5b57('0x1'));var timeout=require(_0x5b57('0x2'));var express=require(_0x5b57('0x3'));var router=express[_0x5b57('0x4')]();var fs_extra=require(_0x5b57('0x5'));var auth=require(_0x5b57('0x6'));var interaction=require(_0x5b57('0x7'));var config=require(_0x5b57('0x8'));var controller=require(_0x5b57('0x9'));router[_0x5b57('0xa')]('/',auth[_0x5b57('0xb')](),controller[_0x5b57('0xc')]);module[_0x5b57('0xd')]=router; \ No newline at end of file +var _0x2d18=['Router','fs-extra','../../components/interaction/service','../../config/environment','./userNotification.controller','post','isAuthenticated','sendUserNotification','exports','util','path','connect-timeout'];(function(_0x166d93,_0x301f09){var _0xba708=function(_0x349bf7){while(--_0x349bf7){_0x166d93['push'](_0x166d93['shift']());}};_0xba708(++_0x301f09);}(_0x2d18,0xe1));var _0x82d1=function(_0x1a9fa9,_0x228f31){_0x1a9fa9=_0x1a9fa9-0x0;var _0x26795b=_0x2d18[_0x1a9fa9];return _0x26795b;};'use strict';var multer=require('multer');var util=require(_0x82d1('0x0'));var path=require(_0x82d1('0x1'));var timeout=require(_0x82d1('0x2'));var express=require('express');var router=express[_0x82d1('0x3')]();var fs_extra=require(_0x82d1('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0x82d1('0x5'));var config=require(_0x82d1('0x6'));var controller=require(_0x82d1('0x7'));router[_0x82d1('0x8')]('/',auth[_0x82d1('0x9')](),controller[_0x82d1('0xa')]);module[_0x82d1('0xb')]=router; \ No newline at end of file diff --git a/server/api/userNotification/userNotification.attributes.js b/server/api/userNotification/userNotification.attributes.js index 3cca64b..a076118 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 _0x7b55=['sequelize','exports','STRING','TEXT','BOOLEAN'];(function(_0x501510,_0x61caa9){var _0x1e6ee5=function(_0x32845b){while(--_0x32845b){_0x501510['push'](_0x501510['shift']());}};_0x1e6ee5(++_0x61caa9);}(_0x7b55,0x131));var _0x57b5=function(_0x5db96e,_0x1d15dd){_0x5db96e=_0x5db96e-0x0;var _0x1f7fd7=_0x7b55[_0x5db96e];return _0x1f7fd7;};'use strict';var Sequelize=require(_0x57b5('0x0'));module[_0x57b5('0x1')]={'body':{'type':Sequelize['TEXT']},'senderName':{'type':Sequelize[_0x57b5('0x2')]},'recipientsId':{'type':Sequelize[_0x57b5('0x3')]},'recipientsDescription':{'type':Sequelize[_0x57b5('0x2')]},'beep':{'type':Sequelize[_0x57b5('0x4')]}}; \ No newline at end of file +var _0x6564=['TEXT','STRING','BOOLEAN','sequelize','exports'];(function(_0x57b54c,_0x54ce0d){var _0x59cc19=function(_0xa33bc6){while(--_0xa33bc6){_0x57b54c['push'](_0x57b54c['shift']());}};_0x59cc19(++_0x54ce0d);}(_0x6564,0x102));var _0x4656=function(_0x237d3c,_0x3c5723){_0x237d3c=_0x237d3c-0x0;var _0x4e94c8=_0x6564[_0x237d3c];return _0x4e94c8;};'use strict';var Sequelize=require(_0x4656('0x0'));module[_0x4656('0x1')]={'body':{'type':Sequelize['TEXT']},'senderName':{'type':Sequelize['STRING']},'recipientsId':{'type':Sequelize[_0x4656('0x2')]},'recipientsDescription':{'type':Sequelize[_0x4656('0x3')]},'beep':{'type':Sequelize[_0x4656('0x4')]}}; \ No newline at end of file diff --git a/server/api/userNotification/userNotification.controller.js b/server/api/userNotification/userNotification.controller.js index ffcef7e..662c663 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 _0x4a2a=['offset','undefined','count','limit','set','Content-Range','apply','update','destroy','then','end','sendStatus','error','stack','name','hasOwnProperty','text','body','TemplateId','ValidationError','Must\x20specify\x20at\x20least\x20one\x20argument\x20for\x20\x27text\x27\x20or\x20\x27TemplateId\x27','view','Sequelize','Missing\x20\x27view\x27\x20parameter','recipients','Missing\x20\x27recipients\x27\x20parameter','parse','faxqueue','mailqueue','openchannelqueue','smsqueue','voicequeue','whatsappqueue','user','includes','model','toLowerCase','Invalid\x20model\x20in\x20\x27recipients\x27\x20object','senderName','recipientsDescription','isEmpty','beep','SenderId','recipientsId','sortBy','join','sequelize','UserNotification','create','forEach','recipient','emit','userNotification:send','catch','Template','Invalid\x20\x27TemplateId\x27\x20parameter','render','html','startCase','union','ids','replace','queue','push','all','flatten','findOne','getAgents','map','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','util','path','sox','to-csv','ejs','lodash','squel','crypto','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','localhost','./userNotification.socket','register','status','json'];(function(_0x4f01a9,_0x4a0d3a){var _0x5f5ade=function(_0xbd7ca6){while(--_0xbd7ca6){_0x4f01a9['push'](_0x4f01a9['shift']());}};_0x5f5ade(++_0x4a0d3a);}(_0x4a2a,0x1dd));var _0xa4a2=function(_0x3cb8c9,_0x40cbd6){_0x3cb8c9=_0x3cb8c9-0x0;var _0x50d5af=_0x4a2a[_0x3cb8c9];return _0x50d5af;};'use strict';var emlformat=require(_0xa4a2('0x0'));var rimraf=require(_0xa4a2('0x1'));var zipdir=require(_0xa4a2('0x2'));var jsonpatch=require(_0xa4a2('0x3'));var rp=require(_0xa4a2('0x4'));var moment=require(_0xa4a2('0x5'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0xa4a2('0x6'));var path=require(_0xa4a2('0x7'));var sox=require(_0xa4a2('0x8'));var csv=require(_0xa4a2('0x9'));var ejs=require(_0xa4a2('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xa4a2('0xb'));var squel=require(_0xa4a2('0xc'));var crypto=require(_0xa4a2('0xd'));var jsforce=require('jsforce');var deskjs=require(_0xa4a2('0xe'));var toCsv=require(_0xa4a2('0x9'));var querystring=require('querystring');var Papa=require(_0xa4a2('0xf'));var Redis=require(_0xa4a2('0x10'));var authService=require(_0xa4a2('0x11'));var qs=require(_0xa4a2('0x12'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xa4a2('0x13'));var logger=require(_0xa4a2('0x14'))(_0xa4a2('0x15'));var utils=require(_0xa4a2('0x16'));var config=require(_0xa4a2('0x17'));var licenseUtil=require(_0xa4a2('0x18'));var db=require(_0xa4a2('0x19'))['db'];config[_0xa4a2('0x1a')]=_[_0xa4a2('0x1b')](config[_0xa4a2('0x1a')],{'host':_0xa4a2('0x1c'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xa4a2('0x1a')]));require(_0xa4a2('0x1d'))[_0xa4a2('0x1e')](socket);function respondWithStatusCode(_0x33fe8d,_0x46bb67){_0x46bb67=_0x46bb67||0xcc;return function(_0x111566){if(_0x111566){return _0x33fe8d['sendStatus'](_0x46bb67);}return _0x33fe8d['status'](_0x46bb67)['end']();};}function respondWithResult(_0x2f899b,_0x70ea5d){_0x70ea5d=_0x70ea5d||0xc8;return function(_0x359bf3){if(_0x359bf3){return _0x2f899b[_0xa4a2('0x1f')](_0x70ea5d)[_0xa4a2('0x20')](_0x359bf3);}};}function respondWithFilteredResult(_0x49af02,_0x36754b){return function(_0x2aa8a9){if(_0x2aa8a9){var _0x4be9f8=typeof _0x36754b[_0xa4a2('0x21')]==='undefined'&&typeof _0x36754b['limit']===_0xa4a2('0x22');var _0x92f166=_0x2aa8a9[_0xa4a2('0x23')];var _0xa4cee5=_0x4be9f8?0x0:_0x36754b['offset'];var _0x4a5405=_0x4be9f8?_0x2aa8a9[_0xa4a2('0x23')]:_0x36754b[_0xa4a2('0x21')]+_0x36754b[_0xa4a2('0x24')];var _0x577369;if(_0x4a5405>=_0x92f166){_0x4a5405=_0x92f166;_0x577369=0xc8;}else{_0x577369=0xce;}_0x49af02[_0xa4a2('0x1f')](_0x577369);return _0x49af02[_0xa4a2('0x25')](_0xa4a2('0x26'),_0xa4cee5+'-'+_0x4a5405+'/'+_0x92f166)[_0xa4a2('0x20')](_0x2aa8a9);}return null;};}function patchUpdates(_0x19f75d){return function(_0x2ab0cd){try{jsonpatch[_0xa4a2('0x27')](_0x2ab0cd,_0x19f75d,!![]);}catch(_0x339811){return BPromise['reject'](_0x339811);}return _0x2ab0cd['save']();};}function saveUpdates(_0x4ae8db,_0x10175c){return function(_0x3ad342){if(_0x3ad342){return _0x3ad342[_0xa4a2('0x28')](_0x4ae8db)['then'](function(_0x10cafd){return _0x10cafd;});}return null;};}function removeEntity(_0x415a44,_0x1de675){return function(_0x3fb0fe){if(_0x3fb0fe){return _0x3fb0fe[_0xa4a2('0x29')]()[_0xa4a2('0x2a')](function(){_0x415a44[_0xa4a2('0x1f')](0xcc)[_0xa4a2('0x2b')]();});}};}function handleEntityNotFound(_0x28410a,_0xe092d2){return function(_0x214c5f){if(!_0x214c5f){_0x28410a[_0xa4a2('0x2c')](0x194);}return _0x214c5f;};}function handleError(_0x1fec6a,_0x5145c4){_0x5145c4=_0x5145c4||0x1f4;return function(_0xf59ea6){logger[_0xa4a2('0x2d')](_0xf59ea6[_0xa4a2('0x2e')]);if(_0xf59ea6[_0xa4a2('0x2f')]){delete _0xf59ea6[_0xa4a2('0x2f')];}_0x1fec6a['status'](_0x5145c4)['send'](_0xf59ea6);};}exports['sendUserNotification']=function(_0x209bc2,_0xe56fcc,_0x5d3c95){if(!_0x209bc2['body'][_0xa4a2('0x30')](_0xa4a2('0x31'))&&!_0x209bc2[_0xa4a2('0x32')][_0xa4a2('0x30')](_0xa4a2('0x33'))){throw new db['Sequelize'][(_0xa4a2('0x34'))](_0xa4a2('0x35'));}else{if(_0x209bc2[_0xa4a2('0x32')][_0xa4a2('0x30')]('TemplateId')&&!_0x209bc2[_0xa4a2('0x32')][_0xa4a2('0x30')](_0xa4a2('0x36'))){throw new db[(_0xa4a2('0x37'))][(_0xa4a2('0x34'))](_0xa4a2('0x38'));}if(!_0x209bc2[_0xa4a2('0x32')][_0xa4a2('0x30')](_0xa4a2('0x39'))){throw new db[(_0xa4a2('0x37'))]['ValidationError'](_0xa4a2('0x3a'));}else{try{var _0x29314a=JSON[_0xa4a2('0x3b')](_0x209bc2[_0xa4a2('0x32')]['recipients']);}catch(_0x408e49){logger[_0xa4a2('0x2d')](_0x408e49);throw new db['Sequelize'][(_0xa4a2('0x34'))]('Invalid\x20\x27recipients\x27\x20object');}var _0x371117=['chatqueue',_0xa4a2('0x3c'),_0xa4a2('0x3d'),_0xa4a2('0x3e'),_0xa4a2('0x3f'),_0xa4a2('0x40'),_0xa4a2('0x41'),'team',_0xa4a2('0x42')];if(_['some'](_0x29314a,function(_0x125d4b){return!_[_0xa4a2('0x43')](_0x371117,_0x125d4b[_0xa4a2('0x44')][_0xa4a2('0x45')]());})){throw new db[(_0xa4a2('0x37'))][(_0xa4a2('0x34'))](_0xa4a2('0x46'));}}}var _0x3ba8c3={};_0x3ba8c3[_0xa4a2('0x47')]=_0x209bc2[_0xa4a2('0x32')]['hasOwnProperty'](_0xa4a2('0x47'))?_0x209bc2[_0xa4a2('0x32')][_0xa4a2('0x47')]:_0x209bc2['user']['fullname'];_0x3ba8c3[_0xa4a2('0x48')]=_[_0xa4a2('0x49')](_0x209bc2[_0xa4a2('0x32')]['recipientsDescription'])?null:_0x209bc2[_0xa4a2('0x32')]['recipientsDescription'];_0x3ba8c3['beep']=_0x209bc2[_0xa4a2('0x32')][_0xa4a2('0x4a')]||![];_0x3ba8c3[_0xa4a2('0x4b')]=_0x209bc2[_0xa4a2('0x42')]['id'];return getContent(_0x209bc2[_0xa4a2('0x32')])[_0xa4a2('0x2a')](function(_0x17289f){_0x3ba8c3[_0xa4a2('0x32')]=_0x17289f;return getRecipients(_0x29314a);})['then'](function(_0x448f07){_0x3ba8c3[_0xa4a2('0x4c')]=_[_0xa4a2('0x4d')](_0x448f07)[_0xa4a2('0x4e')](',');return db[_0xa4a2('0x4f')]['transaction'](function(_0x269be7){return db[_0xa4a2('0x50')][_0xa4a2('0x51')](_0x3ba8c3,{'raw':!![],'transaction':_0x269be7})[_0xa4a2('0x2a')](function(_0x1e1151){var _0xd751f3={'sender':_0x3ba8c3['senderName'],'description':_0x3ba8c3[_0xa4a2('0x48')],'content':_0x3ba8c3[_0xa4a2('0x32')],'beep':_0x3ba8c3['beep']};_0x448f07[_0xa4a2('0x52')](function(_0xdba475){_0xd751f3[_0xa4a2('0x53')]=_0xdba475;socket[_0xa4a2('0x54')](_0xa4a2('0x55'),_0xd751f3);});return _0x1e1151;});});})[_0xa4a2('0x2a')](respondWithResult(_0xe56fcc,0xc9))[_0xa4a2('0x56')](handleError(_0xe56fcc,null));};function getContent(_0x2207bb){return new BPromise(function(_0x5da162,_0x23ad58){if(_0x2207bb[_0xa4a2('0x31')]){_0x5da162(_0x2207bb[_0xa4a2('0x31')]);return;}return db[_0xa4a2('0x57')]['findOne']({'attributes':['html'],'where':{'id':_0x2207bb[_0xa4a2('0x33')]},'raw':!![]})[_0xa4a2('0x2a')](function(_0x43e9e4){if(!_0x43e9e4)throw new db[(_0xa4a2('0x37'))][(_0xa4a2('0x34'))](_0xa4a2('0x58'));var _0x48c695=Mustache[_0xa4a2('0x59')](_0x43e9e4[_0xa4a2('0x5a')],_0x2207bb[_0xa4a2('0x36')]);_0x5da162(_0x48c695);})[_0xa4a2('0x56')](function(_0x569f52){_0x23ad58(_0x569f52);});});}function getRecipients(_0x4c3051){return new BPromise(function(_0x4bd711,_0xe60f56){var _0xef8fe2=[];var _0x549870=[];_0x4c3051['forEach'](function(_0x23d86f){var _0x3c3ae2=_[_0xa4a2('0x5b')](_0x23d86f[_0xa4a2('0x44')]['toLowerCase']());if(_0x3c3ae2==='User'){_0xef8fe2=_[_0xa4a2('0x5c')](_0xef8fe2,_0x23d86f[_0xa4a2('0x5d')]);}else{if(_[_0xa4a2('0x43')](_0x3c3ae2,'queue'))_0x3c3ae2=_0x3c3ae2[_0xa4a2('0x5e')](_0xa4a2('0x5f'),'Queue');_0x23d86f['ids'][_0xa4a2('0x52')](function(_0x5e0f1f){_0x549870[_0xa4a2('0x60')](getAgents(_0x3c3ae2,_0x5e0f1f));});}});return BPromise[_0xa4a2('0x61')](_0x549870)['then'](function(_0x58f20d){_0xef8fe2=_['union'](_0xef8fe2,_[_0xa4a2('0x62')](_0x58f20d));_0x4bd711(_0xef8fe2);})[_0xa4a2('0x56')](function(_0x1cc629){_0xe60f56(_0x1cc629);});});}function getAgents(_0x507518,_0x24c116){return new BPromise(function(_0x5acb2d,_0x9cd625){return db[_0x507518][_0xa4a2('0x63')]({'where':{'id':_0x24c116}})[_0xa4a2('0x2a')](function(_0x2cc16e){return _0x2cc16e[_0xa4a2('0x64')]({'attributes':['id'],'raw':!![]})[_0xa4a2('0x2a')](function(_0x4b3a0f){var _0x530a80=_[_0xa4a2('0x65')](_0x4b3a0f,'id');_0x5acb2d(_0x530a80);});})[_0xa4a2('0x56')](function(_0xac3bbb){_0x9cd625(_0xac3bbb);});});} \ No newline at end of file +var _0x0939=['jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','defaults','redis','localhost','socket.io-emitter','./userNotification.socket','sendStatus','status','end','json','offset','limit','undefined','count','apply','reject','save','update','destroy','then','error','stack','name','sendUserNotification','hasOwnProperty','text','TemplateId','Sequelize','body','ValidationError','Missing\x20\x27view\x27\x20parameter','recipients','Missing\x20\x27recipients\x27\x20parameter','parse','chatqueue','faxqueue','openchannelqueue','smsqueue','voicequeue','whatsappqueue','team','user','some','model','toLowerCase','Invalid\x20model\x20in\x20\x27recipients\x27\x20object','senderName','fullname','isEmpty','recipientsDescription','beep','SenderId','recipientsId','sortBy','join','sequelize','UserNotification','create','forEach','recipient','userNotification:send','Template','html','Invalid\x20\x27TemplateId\x27\x20parameter','render','view','catch','startCase','User','union','ids','queue','replace','Queue','push','all','findOne','getAgents','map','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','util','path','sox','to-csv','ejs','lodash','squel','crypto'];(function(_0x1946d6,_0x499e9c){var _0x455973=function(_0x27b19f){while(--_0x27b19f){_0x1946d6['push'](_0x1946d6['shift']());}};_0x455973(++_0x499e9c);}(_0x0939,0x129));var _0x9093=function(_0x628dc4,_0x531388){_0x628dc4=_0x628dc4-0x0;var _0x3dad16=_0x0939[_0x628dc4];return _0x3dad16;};'use strict';var emlformat=require(_0x9093('0x0'));var rimraf=require(_0x9093('0x1'));var zipdir=require(_0x9093('0x2'));var jsonpatch=require(_0x9093('0x3'));var rp=require(_0x9093('0x4'));var moment=require(_0x9093('0x5'));var BPromise=require('bluebird');var Mustache=require(_0x9093('0x6'));var util=require(_0x9093('0x7'));var path=require(_0x9093('0x8'));var sox=require(_0x9093('0x9'));var csv=require(_0x9093('0xa'));var ejs=require(_0x9093('0xb'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x9093('0xc'));var squel=require(_0x9093('0xd'));var crypto=require(_0x9093('0xe'));var jsforce=require(_0x9093('0xf'));var deskjs=require(_0x9093('0x10'));var toCsv=require(_0x9093('0xa'));var querystring=require(_0x9093('0x11'));var Papa=require('papaparse');var Redis=require(_0x9093('0x12'));var authService=require(_0x9093('0x13'));var qs=require('../../components/parsers/qs');var as=require(_0x9093('0x14'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x9093('0x15'))(_0x9093('0x16'));var utils=require(_0x9093('0x17'));var config=require('../../config/environment');var licenseUtil=require(_0x9093('0x18'));var db=require(_0x9093('0x19'))['db'];config['redis']=_[_0x9093('0x1a')](config[_0x9093('0x1b')],{'host':_0x9093('0x1c'),'port':0x18eb});var socket=require(_0x9093('0x1d'))(new Redis(config[_0x9093('0x1b')]));require(_0x9093('0x1e'))['register'](socket);function respondWithStatusCode(_0x35a193,_0x12cb02){_0x12cb02=_0x12cb02||0xcc;return function(_0x4926ec){if(_0x4926ec){return _0x35a193[_0x9093('0x1f')](_0x12cb02);}return _0x35a193[_0x9093('0x20')](_0x12cb02)[_0x9093('0x21')]();};}function respondWithResult(_0x567eda,_0x53a58e){_0x53a58e=_0x53a58e||0xc8;return function(_0x575c75){if(_0x575c75){return _0x567eda[_0x9093('0x20')](_0x53a58e)[_0x9093('0x22')](_0x575c75);}};}function respondWithFilteredResult(_0x5d00cb,_0x4c91d3){return function(_0x46bf1f){if(_0x46bf1f){var _0x32fbf9=typeof _0x4c91d3[_0x9093('0x23')]==='undefined'&&typeof _0x4c91d3[_0x9093('0x24')]===_0x9093('0x25');var _0x19902e=_0x46bf1f[_0x9093('0x26')];var _0x49cb73=_0x32fbf9?0x0:_0x4c91d3[_0x9093('0x23')];var _0xcfce3=_0x32fbf9?_0x46bf1f['count']:_0x4c91d3[_0x9093('0x23')]+_0x4c91d3[_0x9093('0x24')];var _0x165a5b;if(_0xcfce3>=_0x19902e){_0xcfce3=_0x19902e;_0x165a5b=0xc8;}else{_0x165a5b=0xce;}_0x5d00cb[_0x9093('0x20')](_0x165a5b);return _0x5d00cb['set']('Content-Range',_0x49cb73+'-'+_0xcfce3+'/'+_0x19902e)[_0x9093('0x22')](_0x46bf1f);}return null;};}function patchUpdates(_0x711f0){return function(_0x201f8b){try{jsonpatch[_0x9093('0x27')](_0x201f8b,_0x711f0,!![]);}catch(_0x57c7f9){return BPromise[_0x9093('0x28')](_0x57c7f9);}return _0x201f8b[_0x9093('0x29')]();};}function saveUpdates(_0x12e6b1,_0x4277e9){return function(_0x27a468){if(_0x27a468){return _0x27a468[_0x9093('0x2a')](_0x12e6b1)['then'](function(_0x2b436c){return _0x2b436c;});}return null;};}function removeEntity(_0x1c9c93,_0x5ba6b4){return function(_0x5c699c){if(_0x5c699c){return _0x5c699c[_0x9093('0x2b')]()[_0x9093('0x2c')](function(){_0x1c9c93[_0x9093('0x20')](0xcc)[_0x9093('0x21')]();});}};}function handleEntityNotFound(_0xb8e427,_0x5a8bfc){return function(_0x5044ab){if(!_0x5044ab){_0xb8e427[_0x9093('0x1f')](0x194);}return _0x5044ab;};}function handleError(_0x51d766,_0x4634ed){_0x4634ed=_0x4634ed||0x1f4;return function(_0x21621c){logger[_0x9093('0x2d')](_0x21621c[_0x9093('0x2e')]);if(_0x21621c['name']){delete _0x21621c[_0x9093('0x2f')];}_0x51d766['status'](_0x4634ed)['send'](_0x21621c);};}exports[_0x9093('0x30')]=function(_0x168b94,_0x6462de,_0xc38419){if(!_0x168b94['body'][_0x9093('0x31')](_0x9093('0x32'))&&!_0x168b94['body'][_0x9093('0x31')](_0x9093('0x33'))){throw new db[(_0x9093('0x34'))]['ValidationError']('Must\x20specify\x20at\x20least\x20one\x20argument\x20for\x20\x27text\x27\x20or\x20\x27TemplateId\x27');}else{if(_0x168b94[_0x9093('0x35')]['hasOwnProperty']('TemplateId')&&!_0x168b94['body'][_0x9093('0x31')]('view')){throw new db[(_0x9093('0x34'))][(_0x9093('0x36'))](_0x9093('0x37'));}if(!_0x168b94[_0x9093('0x35')][_0x9093('0x31')](_0x9093('0x38'))){throw new db[(_0x9093('0x34'))][(_0x9093('0x36'))](_0x9093('0x39'));}else{try{var _0x5c386c=JSON[_0x9093('0x3a')](_0x168b94[_0x9093('0x35')][_0x9093('0x38')]);}catch(_0x46a899){logger[_0x9093('0x2d')](_0x46a899);throw new db[(_0x9093('0x34'))][(_0x9093('0x36'))]('Invalid\x20\x27recipients\x27\x20object');}var _0x4cbb17=[_0x9093('0x3b'),_0x9093('0x3c'),'mailqueue',_0x9093('0x3d'),_0x9093('0x3e'),_0x9093('0x3f'),_0x9093('0x40'),_0x9093('0x41'),_0x9093('0x42')];if(_[_0x9093('0x43')](_0x5c386c,function(_0x203041){return!_['includes'](_0x4cbb17,_0x203041[_0x9093('0x44')][_0x9093('0x45')]());})){throw new db[(_0x9093('0x34'))]['ValidationError'](_0x9093('0x46'));}}}var _0x2d2865={};_0x2d2865[_0x9093('0x47')]=_0x168b94[_0x9093('0x35')][_0x9093('0x31')](_0x9093('0x47'))?_0x168b94[_0x9093('0x35')][_0x9093('0x47')]:_0x168b94[_0x9093('0x42')][_0x9093('0x48')];_0x2d2865['recipientsDescription']=_[_0x9093('0x49')](_0x168b94[_0x9093('0x35')][_0x9093('0x4a')])?null:_0x168b94[_0x9093('0x35')][_0x9093('0x4a')];_0x2d2865[_0x9093('0x4b')]=_0x168b94['body']['beep']||![];_0x2d2865[_0x9093('0x4c')]=_0x168b94[_0x9093('0x42')]['id'];return getContent(_0x168b94[_0x9093('0x35')])[_0x9093('0x2c')](function(_0x10c032){_0x2d2865[_0x9093('0x35')]=_0x10c032;return getRecipients(_0x5c386c);})['then'](function(_0x49f88a){_0x2d2865[_0x9093('0x4d')]=_[_0x9093('0x4e')](_0x49f88a)[_0x9093('0x4f')](',');return db[_0x9093('0x50')]['transaction'](function(_0x57a88e){return db[_0x9093('0x51')][_0x9093('0x52')](_0x2d2865,{'raw':!![],'transaction':_0x57a88e})[_0x9093('0x2c')](function(_0x3856ee){var _0x964490={'sender':_0x2d2865[_0x9093('0x47')],'description':_0x2d2865[_0x9093('0x4a')],'content':_0x2d2865[_0x9093('0x35')],'beep':_0x2d2865[_0x9093('0x4b')]};_0x49f88a[_0x9093('0x53')](function(_0x3f1a1b){_0x964490[_0x9093('0x54')]=_0x3f1a1b;socket['emit'](_0x9093('0x55'),_0x964490);});return _0x3856ee;});});})['then'](respondWithResult(_0x6462de,0xc9))['catch'](handleError(_0x6462de,null));};function getContent(_0x628e03){return new BPromise(function(_0x42dc52,_0x38ac2a){if(_0x628e03[_0x9093('0x32')]){_0x42dc52(_0x628e03[_0x9093('0x32')]);return;}return db[_0x9093('0x56')]['findOne']({'attributes':[_0x9093('0x57')],'where':{'id':_0x628e03[_0x9093('0x33')]},'raw':!![]})[_0x9093('0x2c')](function(_0x3886cb){if(!_0x3886cb)throw new db[(_0x9093('0x34'))]['ValidationError'](_0x9093('0x58'));var _0x10c91b=Mustache[_0x9093('0x59')](_0x3886cb[_0x9093('0x57')],_0x628e03[_0x9093('0x5a')]);_0x42dc52(_0x10c91b);})[_0x9093('0x5b')](function(_0x4e65c2){_0x38ac2a(_0x4e65c2);});});}function getRecipients(_0x560a70){return new BPromise(function(_0xf2ea30,_0x1dd370){var _0x1a3686=[];var _0xb7f843=[];_0x560a70[_0x9093('0x53')](function(_0x9fdddd){var _0x4dc723=_[_0x9093('0x5c')](_0x9fdddd[_0x9093('0x44')][_0x9093('0x45')]());if(_0x4dc723===_0x9093('0x5d')){_0x1a3686=_[_0x9093('0x5e')](_0x1a3686,_0x9fdddd[_0x9093('0x5f')]);}else{if(_['includes'](_0x4dc723,_0x9093('0x60')))_0x4dc723=_0x4dc723[_0x9093('0x61')](_0x9093('0x60'),_0x9093('0x62'));_0x9fdddd[_0x9093('0x5f')][_0x9093('0x53')](function(_0x27086a){_0xb7f843[_0x9093('0x63')](getAgents(_0x4dc723,_0x27086a));});}});return BPromise[_0x9093('0x64')](_0xb7f843)['then'](function(_0x42bcdc){_0x1a3686=_['union'](_0x1a3686,_['flatten'](_0x42bcdc));_0xf2ea30(_0x1a3686);})[_0x9093('0x5b')](function(_0x486625){_0x1dd370(_0x486625);});});}function getAgents(_0x4ca16f,_0x3905b0){return new BPromise(function(_0x5caf21,_0x53650e){return db[_0x4ca16f][_0x9093('0x65')]({'where':{'id':_0x3905b0}})[_0x9093('0x2c')](function(_0x2b1481){return _0x2b1481[_0x9093('0x66')]({'attributes':['id'],'raw':!![]})['then'](function(_0x138cc8){var _0x58d719=_[_0x9093('0x67')](_0x138cc8,'id');_0x5caf21(_0x58d719);});})[_0x9093('0x5b')](function(_0x5a58f3){_0x53650e(_0x5a58f3);});});} \ No newline at end of file diff --git a/server/api/userNotification/userNotification.events.js b/server/api/userNotification/userNotification.events.js index 598860c..d5a5a0d 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 _0xeeab=['events','../../mysqldb','UserNotification','save','update','remove','emit','hasOwnProperty','hook','exports'];(function(_0x379b05,_0x1321f6){var _0x12c2ba=function(_0x4c67af){while(--_0x4c67af){_0x379b05['push'](_0x379b05['shift']());}};_0x12c2ba(++_0x1321f6);}(_0xeeab,0xd2));var _0xbeea=function(_0x55d1b6,_0x36c3a3){_0x55d1b6=_0x55d1b6-0x0;var _0x2db938=_0xeeab[_0x55d1b6];return _0x2db938;};'use strict';var EventEmitter=require(_0xbeea('0x0'));var UserNotification=require(_0xbeea('0x1'))['db'][_0xbeea('0x2')];var UserNotificationEvents=new EventEmitter();UserNotificationEvents['setMaxListeners'](0x0);var events={'afterCreate':_0xbeea('0x3'),'afterUpdate':_0xbeea('0x4'),'afterDestroy':_0xbeea('0x5')};function emitEvent(_0x217894){return function(_0x379d35,_0x23d1b8,_0x22d952){UserNotificationEvents[_0xbeea('0x6')](_0x217894+':'+_0x379d35['id'],_0x379d35);UserNotificationEvents[_0xbeea('0x6')](_0x217894,_0x379d35);_0x22d952(null);};}for(var e in events){if(events[_0xbeea('0x7')](e)){var event=events[e];UserNotification[_0xbeea('0x8')](e,emitEvent(event));}}module[_0xbeea('0x9')]=UserNotificationEvents; \ No newline at end of file +var _0x4e7b=['events','../../mysqldb','UserNotification','update','remove','emit','hook'];(function(_0x454bd3,_0x3e4d94){var _0x4eb066=function(_0x4478fa){while(--_0x4478fa){_0x454bd3['push'](_0x454bd3['shift']());}};_0x4eb066(++_0x3e4d94);}(_0x4e7b,0x77));var _0xb4e7=function(_0x184ca1,_0x5b7766){_0x184ca1=_0x184ca1-0x0;var _0x5daf50=_0x4e7b[_0x184ca1];return _0x5daf50;};'use strict';var EventEmitter=require(_0xb4e7('0x0'));var UserNotification=require(_0xb4e7('0x1'))['db'][_0xb4e7('0x2')];var UserNotificationEvents=new EventEmitter();UserNotificationEvents['setMaxListeners'](0x0);var events={'afterCreate':'save','afterUpdate':_0xb4e7('0x3'),'afterDestroy':_0xb4e7('0x4')};function emitEvent(_0x4e069d){return function(_0x421574,_0x19a10e,_0x114ece){UserNotificationEvents[_0xb4e7('0x5')](_0x4e069d+':'+_0x421574['id'],_0x421574);UserNotificationEvents[_0xb4e7('0x5')](_0x4e069d,_0x421574);_0x114ece(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];UserNotification[_0xb4e7('0x6')](e,emitEvent(event));}}module['exports']=UserNotificationEvents; \ No newline at end of file diff --git a/server/api/userNotification/userNotification.model.js b/server/api/userNotification/userNotification.model.js index fa97b2d..15d7376 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 _0xe20c=['../../config/logger','moment','bluebird','rimraf','define','UserNotification','userNotifications','utf8mb4','utf8mb4_unicode_ci','lodash'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0xe20c,0x9f));var _0xce20=function(_0x9a6ad7,_0x348beb){_0x9a6ad7=_0x9a6ad7-0x0;var _0x292b85=_0xe20c[_0x9a6ad7];return _0x292b85;};'use strict';var _=require(_0xce20('0x0'));var util=require('util');var logger=require(_0xce20('0x1'))('api');var moment=require(_0xce20('0x2'));var BPromise=require(_0xce20('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0xce20('0x4'));var config=require('../../config/environment');var attributes=require('./userNotification.attributes');module['exports']=function(_0x1f828a,_0x5a901c){return _0x1f828a[_0xce20('0x5')](_0xce20('0x6'),attributes,{'tableName':_0xce20('0x7'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0xce20('0x8'),'collate':_0xce20('0x9')});}; \ No newline at end of file +var _0xd67c=['../../config/environment','./userNotification.attributes','exports','UserNotification','userNotifications','utf8mb4','utf8mb4_unicode_ci','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf'];(function(_0x1867e3,_0x589b2d){var _0x4b22aa=function(_0x36a685){while(--_0x36a685){_0x1867e3['push'](_0x1867e3['shift']());}};_0x4b22aa(++_0x589b2d);}(_0xd67c,0x177));var _0xcd67=function(_0x2e2910,_0x3b06e0){_0x2e2910=_0x2e2910-0x0;var _0x22e05c=_0xd67c[_0x2e2910];return _0x22e05c;};'use strict';var _=require(_0xcd67('0x0'));var util=require(_0xcd67('0x1'));var logger=require(_0xcd67('0x2'))(_0xcd67('0x3'));var moment=require(_0xcd67('0x4'));var BPromise=require(_0xcd67('0x5'));var rp=require(_0xcd67('0x6'));var fs=require('fs');var path=require(_0xcd67('0x7'));var rimraf=require(_0xcd67('0x8'));var config=require(_0xcd67('0x9'));var attributes=require(_0xcd67('0xa'));module[_0xcd67('0xb')]=function(_0xa5634,_0x2cbceb){return _0xa5634['define'](_0xcd67('0xc'),attributes,{'tableName':_0xcd67('0xd'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0xcd67('0xe'),'collate':_0xcd67('0xf')});}; \ No newline at end of file diff --git a/server/api/userNotification/userNotification.rpc.js b/server/api/userNotification/userNotification.rpc.js index 215ea73..ac5f716 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 _0xf0dd=['catch','lodash','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','redis','defaults','localhost','./userNotification.socket','register','then','UserNotification,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message'];(function(_0x4e43e6,_0x3c8d39){var _0x56bb49=function(_0x5c83fe){while(--_0x5c83fe){_0x4e43e6['push'](_0x4e43e6['shift']());}};_0x56bb49(++_0x3c8d39);}(_0xf0dd,0x191));var _0xdf0d=function(_0x36549f,_0x5c74f9){_0x36549f=_0x36549f-0x0;var _0x174066=_0xf0dd[_0x36549f];return _0x174066;};'use strict';var _=require(_0xdf0d('0x0'));var util=require('util');var moment=require(_0xdf0d('0x1'));var BPromise=require(_0xdf0d('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xdf0d('0x3'));var db=require(_0xdf0d('0x4'))['db'];var utils=require(_0xdf0d('0x5'));var logger=require(_0xdf0d('0x6'))(_0xdf0d('0x7'));var config=require(_0xdf0d('0x8'));var jayson=require(_0xdf0d('0x9'));var client=jayson[_0xdf0d('0xa')]['http']({'port':0x232a});config[_0xdf0d('0xb')]=_[_0xdf0d('0xc')](config['redis'],{'host':_0xdf0d('0xd'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require(_0xdf0d('0xe'))[_0xdf0d('0xf')](socket);function respondWithRpcPromise(_0x322ea7,_0x293f18,_0x3c4633){return new BPromise(function(_0x180bbe,_0x88812e){return client['request'](_0x322ea7,_0x3c4633)[_0xdf0d('0x10')](function(_0x494e60){logger['info'](_0xdf0d('0x11'),_0x293f18,_0xdf0d('0x12'));logger[_0xdf0d('0x13')]('UserNotification,\x20%s,\x20%s,\x20%s',_0x293f18,_0xdf0d('0x12'),JSON[_0xdf0d('0x14')](_0x494e60));if(_0x494e60[_0xdf0d('0x15')]){if(_0x494e60[_0xdf0d('0x15')][_0xdf0d('0x16')]===0x1f4){logger[_0xdf0d('0x15')]('UserNotification,\x20%s,\x20%s',_0x293f18,_0x494e60[_0xdf0d('0x15')][_0xdf0d('0x17')]);return _0x88812e(_0x494e60[_0xdf0d('0x15')][_0xdf0d('0x17')]);}logger[_0xdf0d('0x15')](_0xdf0d('0x11'),_0x293f18,_0x494e60['error']['message']);return _0x180bbe(_0x494e60[_0xdf0d('0x15')]['message']);}else{logger['info'](_0xdf0d('0x11'),_0x293f18,_0xdf0d('0x12'));_0x180bbe(_0x494e60['result'][_0xdf0d('0x17')]);}})[_0xdf0d('0x18')](function(_0x3d3080){logger[_0xdf0d('0x15')](_0xdf0d('0x11'),_0x293f18,_0x3d3080);_0x88812e(_0x3d3080);});});} \ No newline at end of file +var _0x8fe4=['util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','redis','defaults','localhost','socket.io-emitter','./userNotification.socket','register','request','info','UserNotification,\x20%s,\x20%s','request\x20sent','UserNotification,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','lodash'];(function(_0x30033a,_0x5ce4a6){var _0x5e3518=function(_0x11494a){while(--_0x11494a){_0x30033a['push'](_0x30033a['shift']());}};_0x5e3518(++_0x5ce4a6);}(_0x8fe4,0x1ec));var _0x48fe=function(_0x31c00e,_0x11b10b){_0x31c00e=_0x31c00e-0x0;var _0x5941e7=_0x8fe4[_0x31c00e];return _0x5941e7;};'use strict';var _=require(_0x48fe('0x0'));var util=require(_0x48fe('0x1'));var moment=require(_0x48fe('0x2'));var BPromise=require(_0x48fe('0x3'));var rs=require(_0x48fe('0x4'));var fs=require('fs');var Redis=require(_0x48fe('0x5'));var db=require(_0x48fe('0x6'))['db'];var utils=require('../../config/utils');var logger=require(_0x48fe('0x7'))(_0x48fe('0x8'));var config=require(_0x48fe('0x9'));var jayson=require(_0x48fe('0xa'));var client=jayson[_0x48fe('0xb')]['http']({'port':0x232a});config[_0x48fe('0xc')]=_[_0x48fe('0xd')](config[_0x48fe('0xc')],{'host':_0x48fe('0xe'),'port':0x18eb});var socket=require(_0x48fe('0xf'))(new Redis(config[_0x48fe('0xc')]));require(_0x48fe('0x10'))[_0x48fe('0x11')](socket);function respondWithRpcPromise(_0x35a619,_0x2868fa,_0x389307){return new BPromise(function(_0x22f97c,_0x299bb7){return client[_0x48fe('0x12')](_0x35a619,_0x389307)['then'](function(_0xee80c3){logger[_0x48fe('0x13')](_0x48fe('0x14'),_0x2868fa,_0x48fe('0x15'));logger['debug'](_0x48fe('0x16'),_0x2868fa,_0x48fe('0x15'),JSON[_0x48fe('0x17')](_0xee80c3));if(_0xee80c3['error']){if(_0xee80c3[_0x48fe('0x18')][_0x48fe('0x19')]===0x1f4){logger[_0x48fe('0x18')](_0x48fe('0x14'),_0x2868fa,_0xee80c3[_0x48fe('0x18')]['message']);return _0x299bb7(_0xee80c3['error'][_0x48fe('0x1a')]);}logger[_0x48fe('0x18')](_0x48fe('0x14'),_0x2868fa,_0xee80c3[_0x48fe('0x18')][_0x48fe('0x1a')]);return _0x22f97c(_0xee80c3[_0x48fe('0x18')]['message']);}else{logger[_0x48fe('0x13')](_0x48fe('0x14'),_0x2868fa,_0x48fe('0x15'));_0x22f97c(_0xee80c3[_0x48fe('0x1b')]['message']);}})[_0x48fe('0x1c')](function(_0x25ec2){logger[_0x48fe('0x18')](_0x48fe('0x14'),_0x2868fa,_0x25ec2);_0x299bb7(_0x25ec2);});});} \ No newline at end of file diff --git a/server/api/userNotification/userNotification.socket.js b/server/api/userNotification/userNotification.socket.js index 58fcac1..c5068ca 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 _0xcf98=['save','emit','register','length','userNotification:','./userNotification.events'];(function(_0x480e5b,_0xe19028){var _0x30e10d=function(_0x2015e9){while(--_0x2015e9){_0x480e5b['push'](_0x480e5b['shift']());}};_0x30e10d(++_0xe19028);}(_0xcf98,0xa1));var _0x8cf9=function(_0x5934c5,_0xee08dd){_0x5934c5=_0x5934c5-0x0;var _0x272822=_0xcf98[_0x5934c5];return _0x272822;};'use strict';var UserNotificationEvents=require(_0x8cf9('0x0'));var events=[_0x8cf9('0x1'),'remove','update'];function createListener(_0x5c3d83,_0x121412){return function(_0x4e97c7){_0x121412[_0x8cf9('0x2')](_0x5c3d83,_0x4e97c7);};}function removeListener(_0x5aedc6,_0x424327){return function(){UserNotificationEvents['removeListener'](_0x5aedc6,_0x424327);};}exports[_0x8cf9('0x3')]=function(_0x1ce1a2){for(var _0x42e80f=0x0,_0x25bd5f=events[_0x8cf9('0x4')];_0x42e80f<_0x25bd5f;_0x42e80f++){var _0x509674=events[_0x42e80f];var _0x3736da=createListener(_0x8cf9('0x5')+_0x509674,_0x1ce1a2);UserNotificationEvents['on'](_0x509674,_0x3736da);}}; \ No newline at end of file +var _0xe8a3=['register','length','userNotification:','remove','emit'];(function(_0x8d492f,_0x23e4fe){var _0x14554c=function(_0x323669){while(--_0x323669){_0x8d492f['push'](_0x8d492f['shift']());}};_0x14554c(++_0x23e4fe);}(_0xe8a3,0x19d));var _0x3e8a=function(_0x35b7ba,_0x155c7f){_0x35b7ba=_0x35b7ba-0x0;var _0x25ea5e=_0xe8a3[_0x35b7ba];return _0x25ea5e;};'use strict';var UserNotificationEvents=require('./userNotification.events');var events=['save',_0x3e8a('0x0'),'update'];function createListener(_0x636fbc,_0x1e057f){return function(_0x348242){_0x1e057f[_0x3e8a('0x1')](_0x636fbc,_0x348242);};}function removeListener(_0xbeff3d,_0x397b05){return function(){UserNotificationEvents['removeListener'](_0xbeff3d,_0x397b05);};}exports[_0x3e8a('0x2')]=function(_0x1e74da){for(var _0x4bfea2=0x0,_0x358606=events[_0x3e8a('0x3')];_0x4bfea2<_0x358606;_0x4bfea2++){var _0xb28783=events[_0x4bfea2];var _0x5d7c1d=createListener(_0x3e8a('0x4')+_0xb28783,_0x1e74da);UserNotificationEvents['on'](_0xb28783,_0x5d7c1d);}}; \ No newline at end of file diff --git a/server/api/userOpenchannelQueue/index.js b/server/api/userOpenchannelQueue/index.js index ca11bb9..4861466 100644 --- a/server/api/userOpenchannelQueue/index.js +++ b/server/api/userOpenchannelQueue/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xa9e0=['../../components/interaction/service','../../config/environment','exports','multer','util','path','Router','../../components/auth/service'];(function(_0x3639ee,_0x4b29b6){var _0x307852=function(_0x44394b){while(--_0x44394b){_0x3639ee['push'](_0x3639ee['shift']());}};_0x307852(++_0x4b29b6);}(_0xa9e0,0x123));var _0x0a9e=function(_0x1c546c,_0x5c57cb){_0x1c546c=_0x1c546c-0x0;var _0x2cc384=_0xa9e0[_0x1c546c];return _0x2cc384;};'use strict';var multer=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var path=require(_0x0a9e('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x0a9e('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x0a9e('0x4'));var interaction=require(_0x0a9e('0x5'));var config=require(_0x0a9e('0x6'));module[_0x0a9e('0x7')]=router; \ No newline at end of file +var _0x70e0=['../../components/auth/service','../../components/interaction/service','exports','multer','util','path','Router','fs-extra'];(function(_0x192a0d,_0x22ac51){var _0x43565a=function(_0x13d29a){while(--_0x13d29a){_0x192a0d['push'](_0x192a0d['shift']());}};_0x43565a(++_0x22ac51);}(_0x70e0,0x17b));var _0x070e=function(_0x51005f,_0x479570){_0x51005f=_0x51005f-0x0;var _0x2d448c=_0x70e0[_0x51005f];return _0x2d448c;};'use strict';var multer=require(_0x070e('0x0'));var util=require(_0x070e('0x1'));var path=require(_0x070e('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x070e('0x3')]();var fs_extra=require(_0x070e('0x4'));var auth=require(_0x070e('0x5'));var interaction=require(_0x070e('0x6'));var config=require('../../config/environment');module[_0x070e('0x7')]=router; \ No newline at end of file diff --git a/server/api/userOpenchannelQueue/userOpenchannelQueue.attributes.js b/server/api/userOpenchannelQueue/userOpenchannelQueue.attributes.js index 4ed497f..b2ebd74 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 _0xec13=['exports','INTEGER','sequelize'];(function(_0xb176d8,_0x17c90e){var _0x3a2490=function(_0x24092c){while(--_0x24092c){_0xb176d8['push'](_0xb176d8['shift']());}};_0x3a2490(++_0x17c90e);}(_0xec13,0x8f));var _0x3ec1=function(_0x618414,_0x1a7a60){_0x618414=_0x618414-0x0;var _0x21c19a=_0xec13[_0x618414];return _0x21c19a;};'use strict';var Sequelize=require(_0x3ec1('0x0'));module[_0x3ec1('0x1')]={'penalty':{'type':Sequelize[_0x3ec1('0x2')],'defaultValue':0x0}}; \ No newline at end of file +var _0x0e58=['exports','INTEGER'];(function(_0x13ce0c,_0x3f2a0d){var _0x4388fb=function(_0x27db4b){while(--_0x27db4b){_0x13ce0c['push'](_0x13ce0c['shift']());}};_0x4388fb(++_0x3f2a0d);}(_0x0e58,0x18e));var _0x80e5=function(_0x51f5c8,_0x2aa90d){_0x51f5c8=_0x51f5c8-0x0;var _0x30789e=_0x0e58[_0x51f5c8];return _0x30789e;};'use strict';var Sequelize=require('sequelize');module[_0x80e5('0x0')]={'penalty':{'type':Sequelize[_0x80e5('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 51ab9b9..e9d996b 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 _0x7866=['UserOpenchannelQueue','user_has_openchannel_queues','lodash','util','../../config/logger','api','bluebird','request-promise','path','rimraf','./userOpenchannelQueue.attributes','define'];(function(_0x91d019,_0x5223c4){var _0x19de1f=function(_0x3e1311){while(--_0x3e1311){_0x91d019['push'](_0x91d019['shift']());}};_0x19de1f(++_0x5223c4);}(_0x7866,0xce));var _0x6786=function(_0x178e48,_0x3c9509){_0x178e48=_0x178e48-0x0;var _0x440d7e=_0x7866[_0x178e48];return _0x440d7e;};'use strict';var _=require(_0x6786('0x0'));var util=require(_0x6786('0x1'));var logger=require(_0x6786('0x2'))(_0x6786('0x3'));var moment=require('moment');var BPromise=require(_0x6786('0x4'));var rp=require(_0x6786('0x5'));var fs=require('fs');var path=require(_0x6786('0x6'));var rimraf=require(_0x6786('0x7'));var config=require('../../config/environment');var attributes=require(_0x6786('0x8'));module['exports']=function(_0x4ab14c,_0x1488af){return _0x4ab14c[_0x6786('0x9')](_0x6786('0xa'),attributes,{'tableName':_0x6786('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xaf3b=['rimraf','../../config/environment','./userOpenchannelQueue.attributes','lodash','../../config/logger','api','moment','bluebird','request-promise','path'];(function(_0x4fbaf9,_0x3b8190){var _0x1d89a0=function(_0x3b650b){while(--_0x3b650b){_0x4fbaf9['push'](_0x4fbaf9['shift']());}};_0x1d89a0(++_0x3b8190);}(_0xaf3b,0xe9));var _0xbaf3=function(_0x3b6af5,_0x2ffc72){_0x3b6af5=_0x3b6af5-0x0;var _0x46bef6=_0xaf3b[_0x3b6af5];return _0x46bef6;};'use strict';var _=require(_0xbaf3('0x0'));var util=require('util');var logger=require(_0xbaf3('0x1'))(_0xbaf3('0x2'));var moment=require(_0xbaf3('0x3'));var BPromise=require(_0xbaf3('0x4'));var rp=require(_0xbaf3('0x5'));var fs=require('fs');var path=require(_0xbaf3('0x6'));var rimraf=require(_0xbaf3('0x7'));var config=require(_0xbaf3('0x8'));var attributes=require(_0xbaf3('0x9'));module['exports']=function(_0x3125f4,_0x3d44aa){return _0x3125f4['define']('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 567d11b..b713523 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 _0xcb11=['jayson/promise','client','then','info','UserOpenchannelQueue,\x20%s,\x20%s','debug','request\x20sent','error','code','message','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/environment'];(function(_0x2c47e7,_0x2f5fa){var _0x22e591=function(_0x253d5b){while(--_0x253d5b){_0x2c47e7['push'](_0x2c47e7['shift']());}};_0x22e591(++_0x2f5fa);}(_0xcb11,0x161));var _0x1cb1=function(_0x18ecae,_0x2bf366){_0x18ecae=_0x18ecae-0x0;var _0x2fe95b=_0xcb11[_0x18ecae];return _0x2fe95b;};'use strict';var _=require(_0x1cb1('0x0'));var util=require(_0x1cb1('0x1'));var moment=require(_0x1cb1('0x2'));var BPromise=require(_0x1cb1('0x3'));var rs=require(_0x1cb1('0x4'));var fs=require('fs');var Redis=require(_0x1cb1('0x5'));var db=require(_0x1cb1('0x6'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')('rpc');var config=require(_0x1cb1('0x7'));var jayson=require(_0x1cb1('0x8'));var client=jayson[_0x1cb1('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x10d386,_0x46f0d5,_0xf2f79b){return new BPromise(function(_0x49abe0,_0x42b7a5){return client['request'](_0x10d386,_0xf2f79b)[_0x1cb1('0xa')](function(_0x54a86f){logger[_0x1cb1('0xb')](_0x1cb1('0xc'),_0x46f0d5,'request\x20sent');logger[_0x1cb1('0xd')]('UserOpenchannelQueue,\x20%s,\x20%s,\x20%s',_0x46f0d5,_0x1cb1('0xe'),JSON['stringify'](_0x54a86f));if(_0x54a86f[_0x1cb1('0xf')]){if(_0x54a86f[_0x1cb1('0xf')][_0x1cb1('0x10')]===0x1f4){logger[_0x1cb1('0xf')](_0x1cb1('0xc'),_0x46f0d5,_0x54a86f['error'][_0x1cb1('0x11')]);return _0x42b7a5(_0x54a86f['error'][_0x1cb1('0x11')]);}logger['error'](_0x1cb1('0xc'),_0x46f0d5,_0x54a86f[_0x1cb1('0xf')][_0x1cb1('0x11')]);return _0x49abe0(_0x54a86f[_0x1cb1('0xf')][_0x1cb1('0x11')]);}else{logger[_0x1cb1('0xb')]('UserOpenchannelQueue,\x20%s,\x20%s',_0x46f0d5,_0x1cb1('0xe'));_0x49abe0(_0x54a86f['result']['message']);}})[_0x1cb1('0x12')](function(_0x1cef0b){logger[_0x1cb1('0xf')]('UserOpenchannelQueue,\x20%s,\x20%s',_0x46f0d5,_0x1cef0b);_0x42b7a5(_0x1cef0b);});});} \ No newline at end of file +var _0x4188=['../../config/logger','rpc','../../config/environment','jayson/promise','http','request','info','UserOpenchannelQueue,\x20%s,\x20%s','request\x20sent','UserOpenchannelQueue,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils'];(function(_0x2ec461,_0x5f588a){var _0x28603d=function(_0x21114b){while(--_0x21114b){_0x2ec461['push'](_0x2ec461['shift']());}};_0x28603d(++_0x5f588a);}(_0x4188,0x101));var _0x8418=function(_0x4fdae8,_0x4b1703){_0x4fdae8=_0x4fdae8-0x0;var _0x11d5cb=_0x4188[_0x4fdae8];return _0x11d5cb;};'use strict';var _=require(_0x8418('0x0'));var util=require('util');var moment=require(_0x8418('0x1'));var BPromise=require(_0x8418('0x2'));var rs=require(_0x8418('0x3'));var fs=require('fs');var Redis=require(_0x8418('0x4'));var db=require(_0x8418('0x5'))['db'];var utils=require(_0x8418('0x6'));var logger=require(_0x8418('0x7'))(_0x8418('0x8'));var config=require(_0x8418('0x9'));var jayson=require(_0x8418('0xa'));var client=jayson['client'][_0x8418('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x2d6338,_0x19e862,_0x47dd3b){return new BPromise(function(_0x1ccc14,_0x4b35f0){return client[_0x8418('0xc')](_0x2d6338,_0x47dd3b)['then'](function(_0x44cd21){logger[_0x8418('0xd')](_0x8418('0xe'),_0x19e862,_0x8418('0xf'));logger['debug'](_0x8418('0x10'),_0x19e862,_0x8418('0xf'),JSON[_0x8418('0x11')](_0x44cd21));if(_0x44cd21[_0x8418('0x12')]){if(_0x44cd21['error']['code']===0x1f4){logger[_0x8418('0x12')]('UserOpenchannelQueue,\x20%s,\x20%s',_0x19e862,_0x44cd21[_0x8418('0x12')][_0x8418('0x13')]);return _0x4b35f0(_0x44cd21['error'][_0x8418('0x13')]);}logger['error']('UserOpenchannelQueue,\x20%s,\x20%s',_0x19e862,_0x44cd21[_0x8418('0x12')][_0x8418('0x13')]);return _0x1ccc14(_0x44cd21['error']['message']);}else{logger[_0x8418('0xd')]('UserOpenchannelQueue,\x20%s,\x20%s',_0x19e862,_0x8418('0xf'));_0x1ccc14(_0x44cd21[_0x8418('0x14')]['message']);}})[_0x8418('0x15')](function(_0x374e45){logger[_0x8418('0x12')]('UserOpenchannelQueue,\x20%s,\x20%s',_0x19e862,_0x374e45);_0x4b35f0(_0x374e45);});});} \ No newline at end of file diff --git a/server/api/userProfile/index.js b/server/api/userProfile/index.js index 0bcf320..6b8722c 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 _0x2e5d=['destroy','delete','removeSections','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service','../../config/environment','./userProfile.controller','get','index','isAuthenticated','describe','/:id','show','getSections','/:id/resources','getResources','post','create','/:id/sections','addSections','addResources','put','update'];(function(_0x46698a,_0x8de1e4){var _0x356db0=function(_0x19e83c){while(--_0x19e83c){_0x46698a['push'](_0x46698a['shift']());}};_0x356db0(++_0x8de1e4);}(_0x2e5d,0xb8));var _0xd2e5=function(_0x2feb53,_0x264ef7){_0x2feb53=_0x2feb53-0x0;var _0x5700ee=_0x2e5d[_0x2feb53];return _0x5700ee;};'use strict';var multer=require(_0xd2e5('0x0'));var util=require(_0xd2e5('0x1'));var path=require(_0xd2e5('0x2'));var timeout=require(_0xd2e5('0x3'));var express=require(_0xd2e5('0x4'));var router=express[_0xd2e5('0x5')]();var fs_extra=require(_0xd2e5('0x6'));var auth=require('../../components/auth/service');var interaction=require(_0xd2e5('0x7'));var config=require(_0xd2e5('0x8'));var controller=require(_0xd2e5('0x9'));router[_0xd2e5('0xa')]('/',auth['isAuthenticated'](),controller[_0xd2e5('0xb')]);router[_0xd2e5('0xa')]('/describe',auth[_0xd2e5('0xc')](),controller[_0xd2e5('0xd')]);router[_0xd2e5('0xa')](_0xd2e5('0xe'),auth[_0xd2e5('0xc')](),controller[_0xd2e5('0xf')]);router[_0xd2e5('0xa')]('/:id/sections',auth['isAuthenticated'](),controller[_0xd2e5('0x10')]);router['get'](_0xd2e5('0x11'),auth[_0xd2e5('0xc')](),controller[_0xd2e5('0x12')]);router[_0xd2e5('0x13')]('/',auth[_0xd2e5('0xc')](),controller[_0xd2e5('0x14')]);router[_0xd2e5('0x13')]('/:id/clone',auth[_0xd2e5('0xc')](),controller['clone']);router[_0xd2e5('0x13')](_0xd2e5('0x15'),auth[_0xd2e5('0xc')](),controller[_0xd2e5('0x16')]);router[_0xd2e5('0x13')](_0xd2e5('0x11'),auth[_0xd2e5('0xc')](),controller[_0xd2e5('0x17')]);router[_0xd2e5('0x18')](_0xd2e5('0xe'),auth[_0xd2e5('0xc')](),controller[_0xd2e5('0x19')]);router['delete'](_0xd2e5('0xe'),auth[_0xd2e5('0xc')](),controller[_0xd2e5('0x1a')]);router[_0xd2e5('0x1b')](_0xd2e5('0x15'),auth[_0xd2e5('0xc')](),controller[_0xd2e5('0x1c')]);router['delete']('/:id/resources',auth['isAuthenticated'](),controller['removeResources']);module[_0xd2e5('0x1d')]=router; \ No newline at end of file +var _0x4c07=['index','describe','/:id','show','/:id/sections','getSections','/:id/resources','getResources','post','create','addSections','put','update','delete','destroy','removeSections','exports','multer','path','connect-timeout','express','fs-extra','../../components/interaction/service','../../config/environment','./userProfile.controller','get','isAuthenticated'];(function(_0x1c077a,_0x3edfd7){var _0x3aa0df=function(_0x1c835c){while(--_0x1c835c){_0x1c077a['push'](_0x1c077a['shift']());}};_0x3aa0df(++_0x3edfd7);}(_0x4c07,0x170));var _0x74c0=function(_0x1559a5,_0x41924e){_0x1559a5=_0x1559a5-0x0;var _0x17a783=_0x4c07[_0x1559a5];return _0x17a783;};'use strict';var multer=require(_0x74c0('0x0'));var util=require('util');var path=require(_0x74c0('0x1'));var timeout=require(_0x74c0('0x2'));var express=require(_0x74c0('0x3'));var router=express['Router']();var fs_extra=require(_0x74c0('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0x74c0('0x5'));var config=require(_0x74c0('0x6'));var controller=require(_0x74c0('0x7'));router[_0x74c0('0x8')]('/',auth[_0x74c0('0x9')](),controller[_0x74c0('0xa')]);router[_0x74c0('0x8')]('/describe',auth[_0x74c0('0x9')](),controller[_0x74c0('0xb')]);router[_0x74c0('0x8')](_0x74c0('0xc'),auth[_0x74c0('0x9')](),controller[_0x74c0('0xd')]);router['get'](_0x74c0('0xe'),auth[_0x74c0('0x9')](),controller[_0x74c0('0xf')]);router[_0x74c0('0x8')](_0x74c0('0x10'),auth['isAuthenticated'](),controller[_0x74c0('0x11')]);router[_0x74c0('0x12')]('/',auth['isAuthenticated'](),controller[_0x74c0('0x13')]);router[_0x74c0('0x12')]('/:id/clone',auth[_0x74c0('0x9')](),controller['clone']);router[_0x74c0('0x12')](_0x74c0('0xe'),auth['isAuthenticated'](),controller[_0x74c0('0x14')]);router[_0x74c0('0x12')]('/:id/resources',auth[_0x74c0('0x9')](),controller['addResources']);router[_0x74c0('0x15')](_0x74c0('0xc'),auth['isAuthenticated'](),controller[_0x74c0('0x16')]);router[_0x74c0('0x17')](_0x74c0('0xc'),auth[_0x74c0('0x9')](),controller[_0x74c0('0x18')]);router[_0x74c0('0x17')](_0x74c0('0xe'),auth[_0x74c0('0x9')](),controller[_0x74c0('0x19')]);router[_0x74c0('0x17')](_0x74c0('0x10'),auth[_0x74c0('0x9')](),controller['removeResources']);module[_0x74c0('0x1a')]=router; \ No newline at end of file diff --git a/server/api/userProfile/userProfile.attributes.js b/server/api/userProfile/userProfile.attributes.js index 906337e..50df299 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 _0x0652=['crudPermissions','BOOLEAN','sequelize','exports','STRING','name','setDataValue','getDataValue'];(function(_0x6e7f17,_0x185a7d){var _0x36ba9a=function(_0x2f8535){while(--_0x2f8535){_0x6e7f17['push'](_0x6e7f17['shift']());}};_0x36ba9a(++_0x185a7d);}(_0x0652,0x192));var _0x2065=function(_0x520dd3,_0x18e30a){_0x520dd3=_0x520dd3-0x0;var _0x4efad1=_0x0652[_0x520dd3];return _0x4efad1;};'use strict';var Sequelize=require(_0x2065('0x0'));module[_0x2065('0x1')]={'name':{'type':Sequelize[_0x2065('0x2')],'allowNull':![],'unique':_0x2065('0x3')},'crudPermissions':{'type':Sequelize[_0x2065('0x2')],'set':function(_0x5a7d04){this[_0x2065('0x4')]('crudPermissions',_0x5a7d04?_0x5a7d04['join'](''):[]);},'get':function(){return this[_0x2065('0x5')](_0x2065('0x6'))?this[_0x2065('0x5')](_0x2065('0x6'))['split'](''):[];},'allowNull':![],'defaultValue':'r'},'description':{'type':Sequelize[_0x2065('0x2')],'allowNull':!![]},'privacyEnabled':{'type':Sequelize[_0x2065('0x7')],'defaultValue':![]},'downloadAttachments':{'type':Sequelize[_0x2065('0x7')],'defaultValue':!![]},'downloadCallySquareRecordings':{'type':Sequelize[_0x2065('0x7')],'defaultValue':!![]},'downloadContactManagerLists':{'type':Sequelize[_0x2065('0x7')],'defaultValue':!![]},'downloadJscriptySessions':{'type':Sequelize[_0x2065('0x7')],'defaultValue':!![]},'downloadOmnichannelInteractions':{'type':Sequelize[_0x2065('0x7')],'defaultValue':!![]},'downloadScreenRecordings':{'type':Sequelize[_0x2065('0x7')],'defaultValue':!![]},'downloadVoiceRecordings':{'type':Sequelize[_0x2065('0x7')],'defaultValue':!![]}}; \ No newline at end of file +var _0x45e0=['exports','STRING','name','setDataValue','crudPermissions','join','getDataValue','BOOLEAN'];(function(_0x53d9a7,_0x44c4a3){var _0x1c8958=function(_0x597d99){while(--_0x597d99){_0x53d9a7['push'](_0x53d9a7['shift']());}};_0x1c8958(++_0x44c4a3);}(_0x45e0,0x120));var _0x045e=function(_0x42b2fe,_0x22e453){_0x42b2fe=_0x42b2fe-0x0;var _0x669686=_0x45e0[_0x42b2fe];return _0x669686;};'use strict';var Sequelize=require('sequelize');module[_0x045e('0x0')]={'name':{'type':Sequelize[_0x045e('0x1')],'allowNull':![],'unique':_0x045e('0x2')},'crudPermissions':{'type':Sequelize[_0x045e('0x1')],'set':function(_0x4e04a9){this[_0x045e('0x3')](_0x045e('0x4'),_0x4e04a9?_0x4e04a9[_0x045e('0x5')](''):[]);},'get':function(){return this[_0x045e('0x6')]('crudPermissions')?this[_0x045e('0x6')](_0x045e('0x4'))['split'](''):[];},'allowNull':![],'defaultValue':'r'},'description':{'type':Sequelize[_0x045e('0x1')],'allowNull':!![]},'privacyEnabled':{'type':Sequelize[_0x045e('0x7')],'defaultValue':![]},'downloadAttachments':{'type':Sequelize[_0x045e('0x7')],'defaultValue':!![]},'downloadCallySquareRecordings':{'type':Sequelize[_0x045e('0x7')],'defaultValue':!![]},'downloadContactManagerLists':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'downloadJscriptySessions':{'type':Sequelize[_0x045e('0x7')],'defaultValue':!![]},'downloadOmnichannelInteractions':{'type':Sequelize[_0x045e('0x7')],'defaultValue':!![]},'downloadScreenRecordings':{'type':Sequelize[_0x045e('0x7')],'defaultValue':!![]},'downloadVoiceRecordings':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]}}; \ No newline at end of file diff --git a/server/api/userProfile/userProfile.controller.js b/server/api/userProfile/userProfile.controller.js index c3237b6..7d429a2 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 _0x345e=['filter','where','VIRTUAL','options','count','includeAll','include','findAll','rows','catch','show','params','rawAttributes','find','create','body','clone','fields','get','omit','createdAt','updatedAt','sequelize','merge','autoAssociation','sectionId','userProfileId','Resources','UserProfileResource','destroy','describe','addSections','UserProfileSection','push','removeSections','getSections','enabled','includes','isEmpty','subsections','concat','forEach','resourceId','Plugin','transaction','bulkCreate','removeResources','ids','section','nolimit','getResources','eml-format','rimraf','request-promise','moment','mustache','util','path','sox','to-csv','lodash','squel','jsforce','desk.js','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','localhost','socket.io-emitter','./userProfile.socket','sendStatus','status','end','json','undefined','limit','offset','Content-Range','apply','reject','update','then','error','stack','name','send','index','map','UserProfile','type','key','model','query','keys','filters','intersection','attributes','length','sort','pick'];(function(_0x35da80,_0x1673f3){var _0x28732d=function(_0x28c1ff){while(--_0x28c1ff){_0x35da80['push'](_0x35da80['shift']());}};_0x28732d(++_0x1673f3);}(_0x345e,0x10d));var _0xe345=function(_0x5ad4cf,_0x212ffb){_0x5ad4cf=_0x5ad4cf-0x0;var _0x530aba=_0x345e[_0x5ad4cf];return _0x530aba;};'use strict';var emlformat=require(_0xe345('0x0'));var rimraf=require(_0xe345('0x1'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0xe345('0x2'));var moment=require(_0xe345('0x3'));var BPromise=require('bluebird');var Mustache=require(_0xe345('0x4'));var util=require(_0xe345('0x5'));var path=require(_0xe345('0x6'));var sox=require(_0xe345('0x7'));var csv=require(_0xe345('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xe345('0x9'));var squel=require(_0xe345('0xa'));var crypto=require('crypto');var jsforce=require(_0xe345('0xb'));var deskjs=require(_0xe345('0xc'));var toCsv=require(_0xe345('0x8'));var querystring=require('querystring');var Papa=require(_0xe345('0xd'));var Redis=require(_0xe345('0xe'));var authService=require('../../components/auth/service');var qs=require(_0xe345('0xf'));var as=require(_0xe345('0x10'));var hardwareService=require(_0xe345('0x11'));var logger=require(_0xe345('0x12'))(_0xe345('0x13'));var utils=require(_0xe345('0x14'));var config=require(_0xe345('0x15'));var licenseUtil=require(_0xe345('0x16'));var db=require(_0xe345('0x17'))['db'];config[_0xe345('0x18')]=_['defaults'](config[_0xe345('0x18')],{'host':_0xe345('0x19'),'port':0x18eb});var socket=require(_0xe345('0x1a'))(new Redis(config[_0xe345('0x18')]));require(_0xe345('0x1b'))['register'](socket);function respondWithStatusCode(_0xec970b,_0x2939a2){_0x2939a2=_0x2939a2||0xcc;return function(_0x178931){if(_0x178931){return _0xec970b[_0xe345('0x1c')](_0x2939a2);}return _0xec970b[_0xe345('0x1d')](_0x2939a2)[_0xe345('0x1e')]();};}function respondWithResult(_0x505035,_0x3253c6){_0x3253c6=_0x3253c6||0xc8;return function(_0xf78c9b){if(_0xf78c9b){return _0x505035[_0xe345('0x1d')](_0x3253c6)[_0xe345('0x1f')](_0xf78c9b);}};}function respondWithFilteredResult(_0x523bb1,_0xabd19d){return function(_0x26c134){if(_0x26c134){var _0x3316f2=typeof _0xabd19d['offset']===_0xe345('0x20')&&typeof _0xabd19d[_0xe345('0x21')]==='undefined';var _0x42c4a1=_0x26c134['count'];var _0x3b5e42=_0x3316f2?0x0:_0xabd19d[_0xe345('0x22')];var _0x267b01=_0x3316f2?_0x26c134['count']:_0xabd19d['offset']+_0xabd19d[_0xe345('0x21')];var _0x9e2920;if(_0x267b01>=_0x42c4a1){_0x267b01=_0x42c4a1;_0x9e2920=0xc8;}else{_0x9e2920=0xce;}_0x523bb1[_0xe345('0x1d')](_0x9e2920);return _0x523bb1['set'](_0xe345('0x23'),_0x3b5e42+'-'+_0x267b01+'/'+_0x42c4a1)['json'](_0x26c134);}return null;};}function patchUpdates(_0x4004a6){return function(_0x16668f){try{jsonpatch[_0xe345('0x24')](_0x16668f,_0x4004a6,!![]);}catch(_0x3de52f){return BPromise[_0xe345('0x25')](_0x3de52f);}return _0x16668f['save']();};}function saveUpdates(_0x384978,_0x53ece1){return function(_0x47b47f){if(_0x47b47f){return _0x47b47f[_0xe345('0x26')](_0x384978)[_0xe345('0x27')](function(_0xcfbae8){return _0xcfbae8;});}return null;};}function removeEntity(_0x36871e,_0x33a8dc){return function(_0x4c4c58){if(_0x4c4c58){return _0x4c4c58['destroy']()[_0xe345('0x27')](function(){_0x36871e[_0xe345('0x1d')](0xcc)[_0xe345('0x1e')]();});}};}function handleEntityNotFound(_0x13d334,_0x4c41a6){return function(_0x17a58c){if(!_0x17a58c){_0x13d334['sendStatus'](0x194);}return _0x17a58c;};}function handleError(_0x3eeef2,_0x4c4a87){_0x4c4a87=_0x4c4a87||0x1f4;return function(_0x3ae991){logger[_0xe345('0x28')](_0x3ae991[_0xe345('0x29')]);if(_0x3ae991[_0xe345('0x2a')]){delete _0x3ae991[_0xe345('0x2a')];}_0x3eeef2[_0xe345('0x1d')](_0x4c4a87)[_0xe345('0x2b')](_0x3ae991);};}exports[_0xe345('0x2c')]=function(_0x48f47,_0x2033ee){var _0x21a1b7={},_0x35dea6={},_0x3b0c9f={'count':0x0,'rows':[]};var _0x161bea=_[_0xe345('0x2d')](db[_0xe345('0x2e')]['rawAttributes'],function(_0x245f5b){return{'name':_0x245f5b['fieldName'],'type':_0x245f5b[_0xe345('0x2f')][_0xe345('0x30')]};});_0x35dea6[_0xe345('0x31')]=_[_0xe345('0x2d')](_0x161bea,_0xe345('0x2a'));_0x35dea6[_0xe345('0x32')]=_[_0xe345('0x33')](_0x48f47[_0xe345('0x32')]);_0x35dea6[_0xe345('0x34')]=_[_0xe345('0x35')](_0x35dea6[_0xe345('0x31')],_0x35dea6[_0xe345('0x32')]);_0x21a1b7[_0xe345('0x36')]=_[_0xe345('0x35')](_0x35dea6[_0xe345('0x31')],qs['fields'](_0x48f47[_0xe345('0x32')]['fields']));_0x21a1b7['attributes']=_0x21a1b7[_0xe345('0x36')][_0xe345('0x37')]?_0x21a1b7[_0xe345('0x36')]:_0x35dea6['model'];if(!_0x48f47['query']['hasOwnProperty']('nolimit')){_0x21a1b7[_0xe345('0x21')]=qs['limit'](_0x48f47[_0xe345('0x32')]['limit']);_0x21a1b7[_0xe345('0x22')]=qs[_0xe345('0x22')](_0x48f47['query'][_0xe345('0x22')]);}_0x21a1b7['order']=qs[_0xe345('0x38')](_0x48f47[_0xe345('0x32')][_0xe345('0x38')]);_0x21a1b7['where']=qs[_0xe345('0x34')](_[_0xe345('0x39')](_0x48f47[_0xe345('0x32')],_0x35dea6[_0xe345('0x34')]),_0x161bea);if(_0x48f47[_0xe345('0x32')][_0xe345('0x3a')]){_0x21a1b7['where']=_['merge'](_0x21a1b7[_0xe345('0x3b')],{'$or':_['map'](_0x161bea,function(_0x16e6e9){if(_0x16e6e9[_0xe345('0x2f')]!==_0xe345('0x3c')){var _0x3af7a1={};_0x3af7a1[_0x16e6e9[_0xe345('0x2a')]]={'$like':'%'+_0x48f47[_0xe345('0x32')][_0xe345('0x3a')]+'%'};return _0x3af7a1;}})});}_0x21a1b7=_['merge']({},_0x21a1b7,_0x48f47[_0xe345('0x3d')]);var _0x15d092={'where':_0x21a1b7[_0xe345('0x3b')]};return db['UserProfile'][_0xe345('0x3e')](_0x15d092)[_0xe345('0x27')](function(_0x23f3ae){_0x3b0c9f[_0xe345('0x3e')]=_0x23f3ae;if(_0x48f47[_0xe345('0x32')][_0xe345('0x3f')]){_0x21a1b7[_0xe345('0x40')]=[{'all':!![]}];}return db['UserProfile'][_0xe345('0x41')](_0x21a1b7);})[_0xe345('0x27')](function(_0x5cbc02){_0x3b0c9f[_0xe345('0x42')]=_0x5cbc02;return _0x3b0c9f;})[_0xe345('0x27')](respondWithFilteredResult(_0x2033ee,_0x21a1b7))[_0xe345('0x43')](handleError(_0x2033ee,null));};exports[_0xe345('0x44')]=function(_0x514890,_0x415979){var _0x3e1eb0={'raw':![],'where':{'id':_0x514890[_0xe345('0x45')]['id']}},_0x229d34={};_0x229d34[_0xe345('0x31')]=_[_0xe345('0x33')](db['UserProfile'][_0xe345('0x46')]);_0x229d34['query']=_[_0xe345('0x33')](_0x514890[_0xe345('0x32')]);_0x229d34[_0xe345('0x34')]=_[_0xe345('0x35')](_0x229d34[_0xe345('0x31')],_0x229d34[_0xe345('0x32')]);_0x3e1eb0[_0xe345('0x36')]=_[_0xe345('0x35')](_0x229d34[_0xe345('0x31')],qs['fields'](_0x514890[_0xe345('0x32')]['fields']));_0x3e1eb0[_0xe345('0x36')]=_0x3e1eb0['attributes'][_0xe345('0x37')]?_0x3e1eb0['attributes']:_0x229d34[_0xe345('0x31')];if(_0x514890[_0xe345('0x32')][_0xe345('0x3f')]){_0x3e1eb0[_0xe345('0x40')]=[{'all':!![]}];}_0x3e1eb0=_['merge']({},_0x3e1eb0,_0x514890[_0xe345('0x3d')]);return db[_0xe345('0x2e')][_0xe345('0x47')](_0x3e1eb0)['then'](handleEntityNotFound(_0x415979,null))[_0xe345('0x27')](respondWithResult(_0x415979,null))[_0xe345('0x43')](handleError(_0x415979,null));};exports['create']=function(_0x24b915,_0x5be853){return db[_0xe345('0x2e')][_0xe345('0x48')](_0x24b915[_0xe345('0x49')],{})[_0xe345('0x27')](respondWithResult(_0x5be853,0xc9))[_0xe345('0x43')](handleError(_0x5be853,null));};exports[_0xe345('0x4a')]=function(_0x2c6e97,_0x1f07ab){var _0x43e388={'where':{'id':_0x2c6e97['params']['id']}},_0x136d86={};_0x136d86['model']=_[_0xe345('0x33')](db['UserProfile']['rawAttributes']);_0x43e388[_0xe345('0x36')]=_[_0xe345('0x35')](_0x136d86[_0xe345('0x31')],qs[_0xe345('0x4b')](_0x2c6e97[_0xe345('0x32')][_0xe345('0x4b')]));_0x43e388[_0xe345('0x36')]=_0x43e388['attributes'][_0xe345('0x37')]?_0x43e388[_0xe345('0x36')]:_0x136d86[_0xe345('0x31')];if(_0x2c6e97[_0xe345('0x32')][_0xe345('0x3f')]){_0x43e388[_0xe345('0x40')]=[{'all':!![]}];}_0x43e388=_['merge']({},_0x43e388,_0x2c6e97[_0xe345('0x3d')]);return db['UserProfile'][_0xe345('0x47')](_0x43e388)[_0xe345('0x27')](handleEntityNotFound(_0x1f07ab,null))[_0xe345('0x27')](function(_0x2ffdc3){if(_0x2ffdc3){var _0x5073de=_0x2ffdc3[_0xe345('0x4c')]({'plain':!![]});_0x5073de=qs[_0xe345('0x4d')](_0x5073de,['id',_0xe345('0x4e'),_0xe345('0x4f'),'crudPermissions']);_0x2c6e97['body']=_[_0xe345('0x4d')](_0x2c6e97[_0xe345('0x49')],['id',_0xe345('0x4e'),_0xe345('0x4f')]);return db[_0xe345('0x50')]['transaction'](function(_0x534cef){return db[_0xe345('0x2e')][_0xe345('0x48')](_[_0xe345('0x51')](_0x5073de,_0x2c6e97[_0xe345('0x49')]),{'include':_0x2c6e97[_0xe345('0x32')][_0xe345('0x3f')]?[{'all':!![]}]:undefined,'transaction':_0x534cef})['then'](function(_0x274550){var _0x16da89=_0x274550[_0xe345('0x4c')]({'plain':!![]});return db['UserProfileSection'][_0xe345('0x41')]({'where':{'userProfileId':_0x2c6e97['params']['id']},'raw':!![]})[_0xe345('0x27')](function(_0x2ff10e){if(_0x2ff10e){return BPromise['each'](_0x2ff10e,function(_0x174812){return new BPromise(function(_0x180d03,_0x5a9ca1){if(_0x174812[_0xe345('0x52')]===null||_0x174812['autoAssociation']===0x1)_0x180d03(null);return db['UserProfileResource']['findAll']({'where':{'sectionId':_0x174812['id']},'raw':!![]})[_0xe345('0x27')](function(_0x2e69a8){var _0x154788=_[_0xe345('0x2d')](_0x2e69a8,function(_0x5d3fcc){return qs[_0xe345('0x4d')](_0x5d3fcc,['id','createdAt',_0xe345('0x4f'),_0xe345('0x53')]);});_0x180d03(_0x154788);})[_0xe345('0x43')](function(_0x264392){_0x5a9ca1(_0x264392);});})[_0xe345('0x27')](function(_0x3df29f){var _0x17f484=qs['omit'](_0x174812,['id',_0xe345('0x4e'),_0xe345('0x4f')]);_0x17f484[_0xe345('0x54')]=_0x16da89['id'];if(_0x3df29f)_0x17f484[_0xe345('0x55')]=_0x3df29f;return _0x17f484;})[_0xe345('0x27')](function(_0x143107){return db['UserProfileSection'][_0xe345('0x48')](_0x143107,{'include':[{'model':db[_0xe345('0x56')],'as':_0xe345('0x55')}],'raw':!![],'transaction':_0x534cef});});})[_0xe345('0x27')](function(){return _0x16da89;});}});});});}})[_0xe345('0x27')](respondWithResult(_0x1f07ab,0xc9))['catch'](handleError(_0x1f07ab,null));};exports[_0xe345('0x26')]=function(_0x1f3116,_0x46983f){if(_0x1f3116['body']['id']){delete _0x1f3116['body']['id'];}return db[_0xe345('0x2e')][_0xe345('0x47')]({'where':{'id':_0x1f3116[_0xe345('0x45')]['id']}})[_0xe345('0x27')](handleEntityNotFound(_0x46983f,null))['then'](saveUpdates(_0x1f3116[_0xe345('0x49')],null))['then'](respondWithResult(_0x46983f,null))[_0xe345('0x43')](handleError(_0x46983f,null));};exports[_0xe345('0x57')]=function(_0x35a313,_0x3475ad){return db[_0xe345('0x2e')][_0xe345('0x47')]({'where':{'id':_0x35a313[_0xe345('0x45')]['id']}})['then'](handleEntityNotFound(_0x3475ad,null))[_0xe345('0x27')](removeEntity(_0x3475ad,null))[_0xe345('0x43')](handleError(_0x3475ad,null));};exports['describe']=function(_0x21d6ee,_0x2af631){return db[_0xe345('0x2e')][_0xe345('0x58')]()[_0xe345('0x27')](respondWithResult(_0x2af631,null))[_0xe345('0x43')](handleError(_0x2af631,null));};exports[_0xe345('0x59')]=function(_0x4e644e,_0x37b85d){var _0x1a5cb5=_0x4e644e[_0xe345('0x49')];return db[_0xe345('0x2e')][_0xe345('0x47')]({'where':{'id':_0x4e644e[_0xe345('0x45')]['id']}})['then'](handleEntityNotFound(_0x37b85d,null))[_0xe345('0x27')](function(_0x2a94d9){if(_0x2a94d9){return db[_0xe345('0x50')]['transaction'](function(_0x35f7bc){return db[_0xe345('0x5a')][_0xe345('0x57')]({'where':{'userProfileId':_0x4e644e[_0xe345('0x45')]['id'],'sectionId':_[_0xe345('0x2d')](_0x1a5cb5,function(_0x40aa89){return _0x40aa89[_0xe345('0x53')];})},'transaction':_0x35f7bc})[_0xe345('0x27')](function(){var _0x4abf5a=_[_0xe345('0x2d')](_0x1a5cb5,function(_0x45bda9){_0x45bda9[_0xe345('0x54')]=_0x4e644e[_0xe345('0x45')]['id'];return _0x45bda9;});var _0x32a328=[];return BPromise['each'](_0x4abf5a,function(_0x272bab){return db[_0xe345('0x5a')][_0xe345('0x48')](_0x272bab,{'include':[{'model':db[_0xe345('0x56')],'as':_0xe345('0x55')}],'raw':!![],'transaction':_0x35f7bc})[_0xe345('0x27')](function(_0x1a486d){_0x32a328[_0xe345('0x5b')](_0x1a486d[_0xe345('0x4c')]({'plain':!![]}));});})[_0xe345('0x27')](function(){return _0x32a328;});});});}})['then'](function(_0x14dc29){return _0x14dc29;})['then'](respondWithResult(_0x37b85d,null))[_0xe345('0x43')](handleError(_0x37b85d,null));};exports[_0xe345('0x5c')]=function(_0x3ed664,_0x2c7e6c){var _0x56fb64;return db[_0xe345('0x2e')][_0xe345('0x47')]({'where':{'id':_0x3ed664[_0xe345('0x45')]['id']},'attributes':['id',_0xe345('0x2a')]})[_0xe345('0x27')](handleEntityNotFound(_0x2c7e6c,null))[_0xe345('0x27')](function(_0x4a031c){if(_0x4a031c){_0x56fb64=_0x4a031c;return db[_0xe345('0x5a')][_0xe345('0x57')]({'where':{'userProfileId':_0x3ed664[_0xe345('0x45')]['id'],'sectionId':_0x3ed664[_0xe345('0x32')]['ids']}});}})['then'](function(){return _0x56fb64;})[_0xe345('0x27')](respondWithStatusCode(_0x2c7e6c,null))[_0xe345('0x43')](handleError(_0x2c7e6c,null));};exports[_0xe345('0x5d')]=function(_0x582ebf,_0x2eb29a){var _0x475627=[];var _0x5639d7=[];return db[_0xe345('0x5a')][_0xe345('0x41')]({'where':{'userProfileId':_0x582ebf[_0xe345('0x45')]['id']},'raw':!![]})[_0xe345('0x27')](function(_0x52491a){_0x475627=_['filter'](_0x52491a,function(_0xadc62b){return _0xadc62b[_0xe345('0x5e')]===0x1||_[_0xe345('0x5f')]([0x3eb,0x709],_0xadc62b['sectionId']);});if(!_[_0xe345('0x60')](_0x475627)){return _['map'](_0x475627,function(_0x1fe2b6){return _0x1fe2b6['sectionId'];});}else{return;}})['then'](function(_0x129e6a){if(_0x129e6a)_0x5639d7=_0x129e6a;if(_[_0xe345('0x5f')](_0x5639d7,0x64)){var _0xff2d32=_['find'](_0x475627,{'sectionId':0x64});return hasDefaultDashboard(_0xff2d32)[_0xe345('0x27')](function(_0x28520a){return _['map'](_0x475627,function(_0x1ab410){if(_0x1ab410[_0xe345('0x53')]===0x64){_0x1ab410[_0xe345('0x61')]=_0x28520a;}return _0x1ab410;});});}else{return;}})[_0xe345('0x27')](function(_0x4d0f98){if(_0x4d0f98)_0x475627=_0x4d0f98;if(_[_0xe345('0x5f')](_0x5639d7,0x3eb)){var _0x1a37db=_[_0xe345('0x47')](_0x475627,{'sectionId':0x3eb});return getCustomDashboards(_0x1a37db)[_0xe345('0x27')](function(_0x1d8969){return _['map'](_0x475627,function(_0xba2a10){if(_0x1a37db[_0xe345('0x5e')]){if(_0xba2a10[_0xe345('0x53')]===0x3eb){_0xba2a10[_0xe345('0x61')]=_0x1d8969;}}else{if(_0xba2a10['sectionId']===0x64){if(!_0xba2a10['subsections']){_0xba2a10[_0xe345('0x61')]=[];}_0xba2a10[_0xe345('0x61')]=_0xba2a10[_0xe345('0x61')][_0xe345('0x62')](_0x1d8969);}}return _0xba2a10;});});}else{return;}})[_0xe345('0x27')](function(_0x364804){if(_0x364804)_0x475627=_0x364804;if(_['includes'](_0x5639d7,0x709)){var _0x1f5401=_[_0xe345('0x47')](_0x475627,{'sectionId':0x709});return getPlugins(_0x1f5401)['then'](function(_0x45f171){if(_0x1f5401[_0xe345('0x5e')]){return _[_0xe345('0x2d')](_0x475627,function(_0xc6d623){if(_0xc6d623[_0xe345('0x53')]===0x709){_0xc6d623[_0xe345('0x61')]=_0x45f171;}return _0xc6d623;});}else{var _0x51a14f={'sectionId':0x76c,'enabled':0x1,'subsections':_0x45f171};var _0x123204=_[_0xe345('0x2d')](_0x475627);_0x123204[_0xe345('0x5b')](_0x51a14f);return _0x123204;}});}else{return;}})[_0xe345('0x27')](function(_0x129f03){if(_0x129f03)_0x475627=_0x129f03;return _[_0xe345('0x3a')](_0x475627,[_0xe345('0x5e'),0x1]);})['then'](respondWithResult(_0x2eb29a,null))[_0xe345('0x43')](handleError(_0x2eb29a,null));};function hasDefaultDashboard(_0x2e8815){var _0x5c1587=[0x65];return new BPromise(function(_0xb15e38,_0x288696){try{if(_0x2e8815[_0xe345('0x52')]){_0xb15e38(_0x5c1587);}else{return db[_0xe345('0x56')]['findOne']({'where':{'sectionId':_0x2e8815['id']},'raw':!![]})['then'](function(_0x86765){_0x86765?_0xb15e38(_0x5c1587):_0xb15e38();});}}catch(_0x5e3c95){_0x288696(_0x5e3c95);}});}function getCustomDashboards(_0x4c2882){var _0x216eae=[];return new BPromise(function(_0x37ba62,_0x3a65b6){try{if(_0x4c2882[_0xe345('0x52')]){return db['Dashboard']['findAll']({'raw':!![]})[_0xe345('0x27')](function(_0x3b5b9a){_0x3b5b9a[_0xe345('0x63')](function(_0x3139fc){_0x216eae[_0xe345('0x5b')](_0x3139fc['id']+0x1869f);});_0x37ba62(_0x216eae);});}else{return db[_0xe345('0x56')][_0xe345('0x41')]({'where':{'sectionId':_0x4c2882['id']},'raw':!![]})[_0xe345('0x27')](function(_0x1e983a){_0x1e983a[_0xe345('0x63')](function(_0xb3f4d){_0x216eae[_0xe345('0x5b')](_0xb3f4d[_0xe345('0x64')]+0x1869f);});_0x37ba62(_0x216eae);});}}catch(_0x414955){_0x3a65b6(_0x414955);}});}function getPlugins(_0x1ec47f){var _0x300d2a=[];return new BPromise(function(_0x2bd0b3,_0x2145fe){try{if(_0x1ec47f['autoAssociation']){return db[_0xe345('0x65')][_0xe345('0x41')]({'raw':!![]})['then'](function(_0x2fcfa6){_0x2fcfa6[_0xe345('0x63')](function(_0x2ebe56){_0x300d2a[_0xe345('0x5b')](_0x2ebe56['id']+0x15b38);});_0x2bd0b3(_0x300d2a);});}else{return db[_0xe345('0x56')]['findAll']({'where':{'sectionId':_0x1ec47f['id']},'raw':!![]})[_0xe345('0x27')](function(_0x533cb2){_0x533cb2[_0xe345('0x63')](function(_0x3a341f){_0x300d2a[_0xe345('0x5b')](_0x3a341f['resourceId']+0x15b38);});_0x2bd0b3(_0x300d2a);});}}catch(_0x4ad431){_0x2145fe(_0x4ad431);}});}exports['addResources']=function(_0x128114,_0x403713){return db[_0xe345('0x2e')][_0xe345('0x47')]({'where':{'id':_0x128114[_0xe345('0x45')]['id']}})[_0xe345('0x27')](handleEntityNotFound(_0x403713,null))[_0xe345('0x27')](function(_0x438182){if(_0x438182){return db[_0xe345('0x50')][_0xe345('0x66')](function(_0x20eae6){return db['UserProfileSection']['findAll']({'where':{'userProfileId':_0x128114[_0xe345('0x45')]['id']},'attributes':['id'],'raw':!![]})[_0xe345('0x27')](function(_0x2c2a77){if(_0x2c2a77){return db['UserProfileSection'][_0xe345('0x57')]({'where':{'userProfileId':_0x128114[_0xe345('0x45')]['id'],'id':_[_0xe345('0x2d')](_0x2c2a77,function(_0x521b50){return _0x521b50['id'];})},'transaction':_0x20eae6});}})[_0xe345('0x27')](function(_0x50f7a7){var _0x941b8=_['map'](_0x128114[_0xe345('0x49')],function(_0x32f24c){_0x32f24c[_0xe345('0x54')]=_0x128114[_0xe345('0x45')]['id'];return _0x32f24c;});return db[_0xe345('0x5a')][_0xe345('0x67')](_0x941b8,{'raw':!![],'transaction':_0x20eae6});})['then'](function(_0x55d866){var _0x1cbcd6=_['filter'](_['map'](_0x55d866,function(_0x29e80e){return _0x29e80e['get']({'plain':!![]});}),{'includeAll':![]});if(_0x1cbcd6){return db['UserProfileSection'][_0xe345('0x41')]({'where':{'userProfileId':_0x128114[_0xe345('0x45')]['id'],'sectionId':_['map'](_0x1cbcd6,function(_0xbe10ed){return _0xbe10ed['sectionId'];})},'attributes':['id',_0xe345('0x53')],'raw':!![]})[_0xe345('0x27')](function(_0x725efa){var _0x5298cd=_[_0xe345('0x2d')](_0x128114['body'],function(_0x1d8821){_0x1d8821[_0xe345('0x54')]=_0x128114[_0xe345('0x45')]['id'];return _0x1d8821;});return db[_0xe345('0x56')][_0xe345('0x67')](_0x5298cd,{'raw':!![],'transaction':_0x20eae6});});}})[_0xe345('0x43')](handleError(_0x403713,null));});}})['then'](function(_0x582461){var _0x36edf6=_['map'](_0x582461,function(_0x2e1f32){return _0x2e1f32[_0xe345('0x4c')]({'plain':!![]});});})[_0xe345('0x27')](respondWithResult(_0x403713,null))[_0xe345('0x43')](handleError(_0x403713,null));};exports[_0xe345('0x68')]=function(_0x2dc8de,_0x29c0de,_0x4e0339){return db[_0xe345('0x2e')][_0xe345('0x47')]({'where':{'id':_0x2dc8de['params']['id']}})[_0xe345('0x27')](handleEntityNotFound(_0x29c0de,null))[_0xe345('0x27')](function(_0x34ab91){if(_0x34ab91){return _0x34ab91[_0xe345('0x68')](_0x2dc8de[_0xe345('0x32')][_0xe345('0x69')]);}})['then'](respondWithStatusCode(_0x29c0de,null))[_0xe345('0x43')](handleError(_0x29c0de,null));};exports['getResources']=function(_0x7f653f,_0x496e78){var _0x5851a8={};if(!_0x7f653f[_0xe345('0x32')][_0xe345('0x6a')])throw new Error('Missing\x20section\x20parameter');if(!_0x7f653f[_0xe345('0x32')]['hasOwnProperty'](_0xe345('0x6b'))){_0x5851a8['limit']=qs[_0xe345('0x21')](_0x7f653f[_0xe345('0x32')]['limit']);_0x5851a8[_0xe345('0x22')]=qs[_0xe345('0x22')](_0x7f653f[_0xe345('0x32')][_0xe345('0x22')]);}return db['UserProfile']['find']({'where':{'id':_0x7f653f['params']['id']}})[_0xe345('0x27')](function(_0x41d6b5){if(!_0x41d6b5)throw new Error('No\x20User\x20Profile\x20found\x20for\x20id\x20'+_0x7f653f[_0xe345('0x45')]['id']);return db[_0xe345('0x2e')][_0xe345('0x6c')](_0x7f653f);})['then'](respondWithFilteredResult(_0x496e78,_0x5851a8))[_0xe345('0x43')](handleError(_0x496e78,null));}; \ No newline at end of file +var _0xc3db=['updatedAt','crudPermissions','UserProfileSection','autoAssociation','UserProfileResource','sectionId','userProfileId','Resources','describe','addSections','sequelize','transaction','push','removeSections','ids','getSections','enabled','subsections','includes','concat','findOne','Dashboard','forEach','resourceId','Plugin','addResources','bulkCreate','removeResources','getResources','Missing\x20section\x20parameter','No\x20User\x20Profile\x20found\x20for\x20id\x20','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','util','sox','to-csv','fs-extra','lodash','squel','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../mysqldb','defaults','redis','localhost','socket.io-emitter','./userProfile.socket','status','json','offset','undefined','limit','count','set','Content-Range','apply','save','update','then','destroy','error','stack','name','send','index','map','UserProfile','model','keys','filters','query','attributes','intersection','fields','length','hasOwnProperty','nolimit','order','sort','where','filter','type','VIRTUAL','merge','includeAll','include','findAll','rows','catch','show','params','find','create','body','rawAttributes','get','omit','createdAt'];(function(_0x32f386,_0x5b887f){var _0x3f18d2=function(_0x189492){while(--_0x189492){_0x32f386['push'](_0x32f386['shift']());}};_0x3f18d2(++_0x5b887f);}(_0xc3db,0xfd));var _0xbc3d=function(_0x111e94,_0x31c837){_0x111e94=_0x111e94-0x0;var _0x3de107=_0xc3db[_0x111e94];return _0x3de107;};'use strict';var emlformat=require(_0xbc3d('0x0'));var rimraf=require(_0xbc3d('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xbc3d('0x2'));var rp=require(_0xbc3d('0x3'));var moment=require(_0xbc3d('0x4'));var BPromise=require(_0xbc3d('0x5'));var Mustache=require(_0xbc3d('0x6'));var util=require(_0xbc3d('0x7'));var path=require('path');var sox=require(_0xbc3d('0x8'));var csv=require(_0xbc3d('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xbc3d('0xa'));var _=require(_0xbc3d('0xb'));var squel=require(_0xbc3d('0xc'));var crypto=require('crypto');var jsforce=require(_0xbc3d('0xd'));var deskjs=require(_0xbc3d('0xe'));var toCsv=require(_0xbc3d('0x9'));var querystring=require(_0xbc3d('0xf'));var Papa=require('papaparse');var Redis=require(_0xbc3d('0x10'));var authService=require(_0xbc3d('0x11'));var qs=require('../../components/parsers/qs');var as=require(_0xbc3d('0x12'));var hardwareService=require(_0xbc3d('0x13'));var logger=require('../../config/logger')(_0xbc3d('0x14'));var utils=require(_0xbc3d('0x15'));var config=require(_0xbc3d('0x16'));var licenseUtil=require('../../config/license/util');var db=require(_0xbc3d('0x17'))['db'];config['redis']=_[_0xbc3d('0x18')](config[_0xbc3d('0x19')],{'host':_0xbc3d('0x1a'),'port':0x18eb});var socket=require(_0xbc3d('0x1b'))(new Redis(config['redis']));require(_0xbc3d('0x1c'))['register'](socket);function respondWithStatusCode(_0x229230,_0x422df3){_0x422df3=_0x422df3||0xcc;return function(_0x160483){if(_0x160483){return _0x229230['sendStatus'](_0x422df3);}return _0x229230[_0xbc3d('0x1d')](_0x422df3)['end']();};}function respondWithResult(_0x5e5eed,_0x1e709f){_0x1e709f=_0x1e709f||0xc8;return function(_0x26fd4d){if(_0x26fd4d){return _0x5e5eed['status'](_0x1e709f)[_0xbc3d('0x1e')](_0x26fd4d);}};}function respondWithFilteredResult(_0x426b1e,_0x411352){return function(_0x5cdc6b){if(_0x5cdc6b){var _0x194664=typeof _0x411352[_0xbc3d('0x1f')]===_0xbc3d('0x20')&&typeof _0x411352[_0xbc3d('0x21')]===_0xbc3d('0x20');var _0x3fbbf3=_0x5cdc6b['count'];var _0x59bc85=_0x194664?0x0:_0x411352['offset'];var _0x1c1f02=_0x194664?_0x5cdc6b[_0xbc3d('0x22')]:_0x411352[_0xbc3d('0x1f')]+_0x411352['limit'];var _0x1953ca;if(_0x1c1f02>=_0x3fbbf3){_0x1c1f02=_0x3fbbf3;_0x1953ca=0xc8;}else{_0x1953ca=0xce;}_0x426b1e[_0xbc3d('0x1d')](_0x1953ca);return _0x426b1e[_0xbc3d('0x23')](_0xbc3d('0x24'),_0x59bc85+'-'+_0x1c1f02+'/'+_0x3fbbf3)[_0xbc3d('0x1e')](_0x5cdc6b);}return null;};}function patchUpdates(_0x3ca6a5){return function(_0x46a2ba){try{jsonpatch[_0xbc3d('0x25')](_0x46a2ba,_0x3ca6a5,!![]);}catch(_0x4a8dcc){return BPromise['reject'](_0x4a8dcc);}return _0x46a2ba[_0xbc3d('0x26')]();};}function saveUpdates(_0x16893f,_0x152728){return function(_0x147fe6){if(_0x147fe6){return _0x147fe6[_0xbc3d('0x27')](_0x16893f)[_0xbc3d('0x28')](function(_0x32691b){return _0x32691b;});}return null;};}function removeEntity(_0x595fc7,_0x46926e){return function(_0x54e6ee){if(_0x54e6ee){return _0x54e6ee[_0xbc3d('0x29')]()[_0xbc3d('0x28')](function(){_0x595fc7[_0xbc3d('0x1d')](0xcc)['end']();});}};}function handleEntityNotFound(_0x4e26a0,_0x2ece95){return function(_0x283687){if(!_0x283687){_0x4e26a0['sendStatus'](0x194);}return _0x283687;};}function handleError(_0x111e2f,_0x565a3b){_0x565a3b=_0x565a3b||0x1f4;return function(_0x1c6681){logger[_0xbc3d('0x2a')](_0x1c6681[_0xbc3d('0x2b')]);if(_0x1c6681[_0xbc3d('0x2c')]){delete _0x1c6681[_0xbc3d('0x2c')];}_0x111e2f[_0xbc3d('0x1d')](_0x565a3b)[_0xbc3d('0x2d')](_0x1c6681);};}exports[_0xbc3d('0x2e')]=function(_0x149da6,_0xa36dc7){var _0x359ce0={},_0x2b0ab0={},_0x487983={'count':0x0,'rows':[]};var _0x566456=_[_0xbc3d('0x2f')](db[_0xbc3d('0x30')]['rawAttributes'],function(_0xb0bc8a){return{'name':_0xb0bc8a['fieldName'],'type':_0xb0bc8a['type']['key']};});_0x2b0ab0[_0xbc3d('0x31')]=_[_0xbc3d('0x2f')](_0x566456,'name');_0x2b0ab0['query']=_[_0xbc3d('0x32')](_0x149da6['query']);_0x2b0ab0[_0xbc3d('0x33')]=_['intersection'](_0x2b0ab0['model'],_0x2b0ab0[_0xbc3d('0x34')]);_0x359ce0[_0xbc3d('0x35')]=_[_0xbc3d('0x36')](_0x2b0ab0['model'],qs[_0xbc3d('0x37')](_0x149da6['query']['fields']));_0x359ce0['attributes']=_0x359ce0[_0xbc3d('0x35')][_0xbc3d('0x38')]?_0x359ce0[_0xbc3d('0x35')]:_0x2b0ab0['model'];if(!_0x149da6[_0xbc3d('0x34')][_0xbc3d('0x39')](_0xbc3d('0x3a'))){_0x359ce0[_0xbc3d('0x21')]=qs[_0xbc3d('0x21')](_0x149da6[_0xbc3d('0x34')][_0xbc3d('0x21')]);_0x359ce0[_0xbc3d('0x1f')]=qs[_0xbc3d('0x1f')](_0x149da6[_0xbc3d('0x34')][_0xbc3d('0x1f')]);}_0x359ce0[_0xbc3d('0x3b')]=qs[_0xbc3d('0x3c')](_0x149da6['query']['sort']);_0x359ce0[_0xbc3d('0x3d')]=qs[_0xbc3d('0x33')](_['pick'](_0x149da6[_0xbc3d('0x34')],_0x2b0ab0[_0xbc3d('0x33')]),_0x566456);if(_0x149da6['query'][_0xbc3d('0x3e')]){_0x359ce0[_0xbc3d('0x3d')]=_['merge'](_0x359ce0[_0xbc3d('0x3d')],{'$or':_[_0xbc3d('0x2f')](_0x566456,function(_0xf347cd){if(_0xf347cd[_0xbc3d('0x3f')]!==_0xbc3d('0x40')){var _0x12d683={};_0x12d683[_0xf347cd['name']]={'$like':'%'+_0x149da6[_0xbc3d('0x34')][_0xbc3d('0x3e')]+'%'};return _0x12d683;}})});}_0x359ce0=_[_0xbc3d('0x41')]({},_0x359ce0,_0x149da6['options']);var _0xe35ae8={'where':_0x359ce0[_0xbc3d('0x3d')]};return db[_0xbc3d('0x30')][_0xbc3d('0x22')](_0xe35ae8)[_0xbc3d('0x28')](function(_0x1da184){_0x487983[_0xbc3d('0x22')]=_0x1da184;if(_0x149da6[_0xbc3d('0x34')][_0xbc3d('0x42')]){_0x359ce0[_0xbc3d('0x43')]=[{'all':!![]}];}return db[_0xbc3d('0x30')][_0xbc3d('0x44')](_0x359ce0);})[_0xbc3d('0x28')](function(_0x42b5b9){_0x487983[_0xbc3d('0x45')]=_0x42b5b9;return _0x487983;})[_0xbc3d('0x28')](respondWithFilteredResult(_0xa36dc7,_0x359ce0))[_0xbc3d('0x46')](handleError(_0xa36dc7,null));};exports[_0xbc3d('0x47')]=function(_0x1c71da,_0x21941e){var _0x298e6b={'raw':![],'where':{'id':_0x1c71da[_0xbc3d('0x48')]['id']}},_0x8a7bed={};_0x8a7bed[_0xbc3d('0x31')]=_['keys'](db[_0xbc3d('0x30')]['rawAttributes']);_0x8a7bed['query']=_[_0xbc3d('0x32')](_0x1c71da['query']);_0x8a7bed[_0xbc3d('0x33')]=_[_0xbc3d('0x36')](_0x8a7bed[_0xbc3d('0x31')],_0x8a7bed['query']);_0x298e6b[_0xbc3d('0x35')]=_['intersection'](_0x8a7bed[_0xbc3d('0x31')],qs[_0xbc3d('0x37')](_0x1c71da[_0xbc3d('0x34')][_0xbc3d('0x37')]));_0x298e6b['attributes']=_0x298e6b[_0xbc3d('0x35')]['length']?_0x298e6b[_0xbc3d('0x35')]:_0x8a7bed[_0xbc3d('0x31')];if(_0x1c71da[_0xbc3d('0x34')][_0xbc3d('0x42')]){_0x298e6b[_0xbc3d('0x43')]=[{'all':!![]}];}_0x298e6b=_[_0xbc3d('0x41')]({},_0x298e6b,_0x1c71da['options']);return db['UserProfile'][_0xbc3d('0x49')](_0x298e6b)[_0xbc3d('0x28')](handleEntityNotFound(_0x21941e,null))[_0xbc3d('0x28')](respondWithResult(_0x21941e,null))[_0xbc3d('0x46')](handleError(_0x21941e,null));};exports['create']=function(_0x59fd92,_0x15c2dd){return db[_0xbc3d('0x30')][_0xbc3d('0x4a')](_0x59fd92[_0xbc3d('0x4b')],{})[_0xbc3d('0x28')](respondWithResult(_0x15c2dd,0xc9))['catch'](handleError(_0x15c2dd,null));};exports['clone']=function(_0x58bd13,_0xecf312){var _0x43c14d={'where':{'id':_0x58bd13['params']['id']}},_0x31b2c9={};_0x31b2c9[_0xbc3d('0x31')]=_['keys'](db[_0xbc3d('0x30')][_0xbc3d('0x4c')]);_0x43c14d[_0xbc3d('0x35')]=_[_0xbc3d('0x36')](_0x31b2c9[_0xbc3d('0x31')],qs['fields'](_0x58bd13[_0xbc3d('0x34')][_0xbc3d('0x37')]));_0x43c14d[_0xbc3d('0x35')]=_0x43c14d[_0xbc3d('0x35')]['length']?_0x43c14d[_0xbc3d('0x35')]:_0x31b2c9[_0xbc3d('0x31')];if(_0x58bd13['query'][_0xbc3d('0x42')]){_0x43c14d[_0xbc3d('0x43')]=[{'all':!![]}];}_0x43c14d=_[_0xbc3d('0x41')]({},_0x43c14d,_0x58bd13['options']);return db['UserProfile'][_0xbc3d('0x49')](_0x43c14d)[_0xbc3d('0x28')](handleEntityNotFound(_0xecf312,null))[_0xbc3d('0x28')](function(_0x55f3e6){if(_0x55f3e6){var _0xeb7459=_0x55f3e6[_0xbc3d('0x4d')]({'plain':!![]});_0xeb7459=qs[_0xbc3d('0x4e')](_0xeb7459,['id',_0xbc3d('0x4f'),_0xbc3d('0x50'),_0xbc3d('0x51')]);_0x58bd13[_0xbc3d('0x4b')]=_[_0xbc3d('0x4e')](_0x58bd13['body'],['id',_0xbc3d('0x4f'),_0xbc3d('0x50')]);return db['sequelize']['transaction'](function(_0x1a1163){return db[_0xbc3d('0x30')]['create'](_[_0xbc3d('0x41')](_0xeb7459,_0x58bd13['body']),{'include':_0x58bd13[_0xbc3d('0x34')][_0xbc3d('0x42')]?[{'all':!![]}]:undefined,'transaction':_0x1a1163})[_0xbc3d('0x28')](function(_0x2b6b85){var _0x2742f0=_0x2b6b85['get']({'plain':!![]});return db[_0xbc3d('0x52')][_0xbc3d('0x44')]({'where':{'userProfileId':_0x58bd13['params']['id']},'raw':!![]})[_0xbc3d('0x28')](function(_0x891a58){if(_0x891a58){return BPromise['each'](_0x891a58,function(_0x9b4aca){return new BPromise(function(_0x1690c5,_0x4d8a6e){if(_0x9b4aca['autoAssociation']===null||_0x9b4aca[_0xbc3d('0x53')]===0x1)_0x1690c5(null);return db[_0xbc3d('0x54')][_0xbc3d('0x44')]({'where':{'sectionId':_0x9b4aca['id']},'raw':!![]})[_0xbc3d('0x28')](function(_0x446ccf){var _0x54d1f8=_['map'](_0x446ccf,function(_0x11d6c6){return qs[_0xbc3d('0x4e')](_0x11d6c6,['id',_0xbc3d('0x4f'),_0xbc3d('0x50'),_0xbc3d('0x55')]);});_0x1690c5(_0x54d1f8);})[_0xbc3d('0x46')](function(_0x3d28ec){_0x4d8a6e(_0x3d28ec);});})['then'](function(_0x4f507e){var _0xdde055=qs[_0xbc3d('0x4e')](_0x9b4aca,['id',_0xbc3d('0x4f'),'updatedAt']);_0xdde055[_0xbc3d('0x56')]=_0x2742f0['id'];if(_0x4f507e)_0xdde055[_0xbc3d('0x57')]=_0x4f507e;return _0xdde055;})[_0xbc3d('0x28')](function(_0x50ea2f){return db[_0xbc3d('0x52')][_0xbc3d('0x4a')](_0x50ea2f,{'include':[{'model':db[_0xbc3d('0x54')],'as':_0xbc3d('0x57')}],'raw':!![],'transaction':_0x1a1163});});})[_0xbc3d('0x28')](function(){return _0x2742f0;});}});});});}})[_0xbc3d('0x28')](respondWithResult(_0xecf312,0xc9))[_0xbc3d('0x46')](handleError(_0xecf312,null));};exports[_0xbc3d('0x27')]=function(_0x44b8ed,_0x33381a){if(_0x44b8ed[_0xbc3d('0x4b')]['id']){delete _0x44b8ed[_0xbc3d('0x4b')]['id'];}return db['UserProfile'][_0xbc3d('0x49')]({'where':{'id':_0x44b8ed[_0xbc3d('0x48')]['id']}})[_0xbc3d('0x28')](handleEntityNotFound(_0x33381a,null))['then'](saveUpdates(_0x44b8ed[_0xbc3d('0x4b')],null))['then'](respondWithResult(_0x33381a,null))[_0xbc3d('0x46')](handleError(_0x33381a,null));};exports['destroy']=function(_0x446bb6,_0x399847){return db[_0xbc3d('0x30')]['find']({'where':{'id':_0x446bb6[_0xbc3d('0x48')]['id']}})[_0xbc3d('0x28')](handleEntityNotFound(_0x399847,null))['then'](removeEntity(_0x399847,null))[_0xbc3d('0x46')](handleError(_0x399847,null));};exports[_0xbc3d('0x58')]=function(_0x2d4de7,_0xcf902){return db['UserProfile']['describe']()['then'](respondWithResult(_0xcf902,null))[_0xbc3d('0x46')](handleError(_0xcf902,null));};exports[_0xbc3d('0x59')]=function(_0x463210,_0x5224c4){var _0x843f6a=_0x463210[_0xbc3d('0x4b')];return db[_0xbc3d('0x30')][_0xbc3d('0x49')]({'where':{'id':_0x463210['params']['id']}})[_0xbc3d('0x28')](handleEntityNotFound(_0x5224c4,null))[_0xbc3d('0x28')](function(_0xca6d91){if(_0xca6d91){return db[_0xbc3d('0x5a')][_0xbc3d('0x5b')](function(_0x3223af){return db[_0xbc3d('0x52')][_0xbc3d('0x29')]({'where':{'userProfileId':_0x463210[_0xbc3d('0x48')]['id'],'sectionId':_['map'](_0x843f6a,function(_0x4e9336){return _0x4e9336[_0xbc3d('0x55')];})},'transaction':_0x3223af})['then'](function(){var _0x3d5aab=_[_0xbc3d('0x2f')](_0x843f6a,function(_0x4e60fe){_0x4e60fe[_0xbc3d('0x56')]=_0x463210[_0xbc3d('0x48')]['id'];return _0x4e60fe;});var _0x317a00=[];return BPromise['each'](_0x3d5aab,function(_0xd90403){return db['UserProfileSection'][_0xbc3d('0x4a')](_0xd90403,{'include':[{'model':db['UserProfileResource'],'as':_0xbc3d('0x57')}],'raw':!![],'transaction':_0x3223af})['then'](function(_0xaa267){_0x317a00[_0xbc3d('0x5c')](_0xaa267[_0xbc3d('0x4d')]({'plain':!![]}));});})[_0xbc3d('0x28')](function(){return _0x317a00;});});});}})['then'](function(_0x4ed61c){return _0x4ed61c;})[_0xbc3d('0x28')](respondWithResult(_0x5224c4,null))[_0xbc3d('0x46')](handleError(_0x5224c4,null));};exports[_0xbc3d('0x5d')]=function(_0x8db00c,_0x3a343b){var _0x2b5ffc;return db[_0xbc3d('0x30')]['find']({'where':{'id':_0x8db00c[_0xbc3d('0x48')]['id']},'attributes':['id',_0xbc3d('0x2c')]})['then'](handleEntityNotFound(_0x3a343b,null))[_0xbc3d('0x28')](function(_0x44e99b){if(_0x44e99b){_0x2b5ffc=_0x44e99b;return db['UserProfileSection'][_0xbc3d('0x29')]({'where':{'userProfileId':_0x8db00c['params']['id'],'sectionId':_0x8db00c['query'][_0xbc3d('0x5e')]}});}})['then'](function(){return _0x2b5ffc;})[_0xbc3d('0x28')](respondWithStatusCode(_0x3a343b,null))[_0xbc3d('0x46')](handleError(_0x3a343b,null));};exports[_0xbc3d('0x5f')]=function(_0x3eed56,_0x3b13a1){var _0x505d20=[];var _0xd1e69=[];return db['UserProfileSection'][_0xbc3d('0x44')]({'where':{'userProfileId':_0x3eed56[_0xbc3d('0x48')]['id']},'raw':!![]})['then'](function(_0x2c9d7e){_0x505d20=_[_0xbc3d('0x3e')](_0x2c9d7e,function(_0x5f1f8d){return _0x5f1f8d[_0xbc3d('0x60')]===0x1||_['includes']([0x3eb,0x709],_0x5f1f8d[_0xbc3d('0x55')]);});if(!_['isEmpty'](_0x505d20)){return _[_0xbc3d('0x2f')](_0x505d20,function(_0x33f034){return _0x33f034[_0xbc3d('0x55')];});}else{return;}})['then'](function(_0x106fb2){if(_0x106fb2)_0xd1e69=_0x106fb2;if(_['includes'](_0xd1e69,0x64)){var _0x56fb28=_[_0xbc3d('0x49')](_0x505d20,{'sectionId':0x64});return hasDefaultDashboard(_0x56fb28)[_0xbc3d('0x28')](function(_0x213104){return _[_0xbc3d('0x2f')](_0x505d20,function(_0x47d052){if(_0x47d052[_0xbc3d('0x55')]===0x64){_0x47d052[_0xbc3d('0x61')]=_0x213104;}return _0x47d052;});});}else{return;}})['then'](function(_0x34f971){if(_0x34f971)_0x505d20=_0x34f971;if(_[_0xbc3d('0x62')](_0xd1e69,0x3eb)){var _0x4e829a=_[_0xbc3d('0x49')](_0x505d20,{'sectionId':0x3eb});return getCustomDashboards(_0x4e829a)[_0xbc3d('0x28')](function(_0x492156){return _['map'](_0x505d20,function(_0xf18112){if(_0x4e829a[_0xbc3d('0x60')]){if(_0xf18112['sectionId']===0x3eb){_0xf18112['subsections']=_0x492156;}}else{if(_0xf18112[_0xbc3d('0x55')]===0x64){if(!_0xf18112[_0xbc3d('0x61')]){_0xf18112[_0xbc3d('0x61')]=[];}_0xf18112[_0xbc3d('0x61')]=_0xf18112[_0xbc3d('0x61')][_0xbc3d('0x63')](_0x492156);}}return _0xf18112;});});}else{return;}})['then'](function(_0x427dbd){if(_0x427dbd)_0x505d20=_0x427dbd;if(_['includes'](_0xd1e69,0x709)){var _0x249596=_[_0xbc3d('0x49')](_0x505d20,{'sectionId':0x709});return getPlugins(_0x249596)[_0xbc3d('0x28')](function(_0x598882){if(_0x249596[_0xbc3d('0x60')]){return _[_0xbc3d('0x2f')](_0x505d20,function(_0x1f1332){if(_0x1f1332['sectionId']===0x709){_0x1f1332[_0xbc3d('0x61')]=_0x598882;}return _0x1f1332;});}else{var _0x24a0ae={'sectionId':0x76c,'enabled':0x1,'subsections':_0x598882};var _0x58157a=_[_0xbc3d('0x2f')](_0x505d20);_0x58157a[_0xbc3d('0x5c')](_0x24a0ae);return _0x58157a;}});}else{return;}})[_0xbc3d('0x28')](function(_0x300b52){if(_0x300b52)_0x505d20=_0x300b52;return _[_0xbc3d('0x3e')](_0x505d20,['enabled',0x1]);})[_0xbc3d('0x28')](respondWithResult(_0x3b13a1,null))['catch'](handleError(_0x3b13a1,null));};function hasDefaultDashboard(_0x8b7c3d){var _0x14922a=[0x65];return new BPromise(function(_0x235a91,_0x2c96ee){try{if(_0x8b7c3d[_0xbc3d('0x53')]){_0x235a91(_0x14922a);}else{return db[_0xbc3d('0x54')][_0xbc3d('0x64')]({'where':{'sectionId':_0x8b7c3d['id']},'raw':!![]})['then'](function(_0x14188f){_0x14188f?_0x235a91(_0x14922a):_0x235a91();});}}catch(_0x44316a){_0x2c96ee(_0x44316a);}});}function getCustomDashboards(_0xcdc714){var _0x52ece9=[];return new BPromise(function(_0x4d48df,_0x5b3768){try{if(_0xcdc714[_0xbc3d('0x53')]){return db[_0xbc3d('0x65')][_0xbc3d('0x44')]({'raw':!![]})['then'](function(_0x3dbfb9){_0x3dbfb9[_0xbc3d('0x66')](function(_0x2cdf79){_0x52ece9[_0xbc3d('0x5c')](_0x2cdf79['id']+0x1869f);});_0x4d48df(_0x52ece9);});}else{return db[_0xbc3d('0x54')]['findAll']({'where':{'sectionId':_0xcdc714['id']},'raw':!![]})[_0xbc3d('0x28')](function(_0x14e099){_0x14e099[_0xbc3d('0x66')](function(_0x4d6533){_0x52ece9[_0xbc3d('0x5c')](_0x4d6533[_0xbc3d('0x67')]+0x1869f);});_0x4d48df(_0x52ece9);});}}catch(_0x13845a){_0x5b3768(_0x13845a);}});}function getPlugins(_0x53add6){var _0x112aa7=[];return new BPromise(function(_0x52215e,_0x4397d6){try{if(_0x53add6['autoAssociation']){return db[_0xbc3d('0x68')][_0xbc3d('0x44')]({'raw':!![]})[_0xbc3d('0x28')](function(_0x26b9d9){_0x26b9d9[_0xbc3d('0x66')](function(_0x380751){_0x112aa7[_0xbc3d('0x5c')](_0x380751['id']+0x15b38);});_0x52215e(_0x112aa7);});}else{return db['UserProfileResource'][_0xbc3d('0x44')]({'where':{'sectionId':_0x53add6['id']},'raw':!![]})['then'](function(_0x536120){_0x536120[_0xbc3d('0x66')](function(_0x16908e){_0x112aa7[_0xbc3d('0x5c')](_0x16908e[_0xbc3d('0x67')]+0x15b38);});_0x52215e(_0x112aa7);});}}catch(_0x350268){_0x4397d6(_0x350268);}});}exports[_0xbc3d('0x69')]=function(_0x1c62d3,_0x271a64){return db['UserProfile'][_0xbc3d('0x49')]({'where':{'id':_0x1c62d3['params']['id']}})[_0xbc3d('0x28')](handleEntityNotFound(_0x271a64,null))[_0xbc3d('0x28')](function(_0x4ba960){if(_0x4ba960){return db[_0xbc3d('0x5a')][_0xbc3d('0x5b')](function(_0x24675d){return db[_0xbc3d('0x52')][_0xbc3d('0x44')]({'where':{'userProfileId':_0x1c62d3[_0xbc3d('0x48')]['id']},'attributes':['id'],'raw':!![]})[_0xbc3d('0x28')](function(_0x3d63f0){if(_0x3d63f0){return db[_0xbc3d('0x52')]['destroy']({'where':{'userProfileId':_0x1c62d3[_0xbc3d('0x48')]['id'],'id':_[_0xbc3d('0x2f')](_0x3d63f0,function(_0x52dfdd){return _0x52dfdd['id'];})},'transaction':_0x24675d});}})['then'](function(_0x52cf68){var _0x1d8db5=_[_0xbc3d('0x2f')](_0x1c62d3[_0xbc3d('0x4b')],function(_0x196354){_0x196354[_0xbc3d('0x56')]=_0x1c62d3[_0xbc3d('0x48')]['id'];return _0x196354;});return db['UserProfileSection'][_0xbc3d('0x6a')](_0x1d8db5,{'raw':!![],'transaction':_0x24675d});})[_0xbc3d('0x28')](function(_0x4af748){var _0x415ce1=_[_0xbc3d('0x3e')](_[_0xbc3d('0x2f')](_0x4af748,function(_0x3a9cb2){return _0x3a9cb2['get']({'plain':!![]});}),{'includeAll':![]});if(_0x415ce1){return db[_0xbc3d('0x52')][_0xbc3d('0x44')]({'where':{'userProfileId':_0x1c62d3[_0xbc3d('0x48')]['id'],'sectionId':_[_0xbc3d('0x2f')](_0x415ce1,function(_0x513d15){return _0x513d15[_0xbc3d('0x55')];})},'attributes':['id',_0xbc3d('0x55')],'raw':!![]})[_0xbc3d('0x28')](function(_0x20c2b1){var _0x4903c6=_['map'](_0x1c62d3[_0xbc3d('0x4b')],function(_0x1f89a8){_0x1f89a8['userProfileId']=_0x1c62d3['params']['id'];return _0x1f89a8;});return db[_0xbc3d('0x54')][_0xbc3d('0x6a')](_0x4903c6,{'raw':!![],'transaction':_0x24675d});});}})[_0xbc3d('0x46')](handleError(_0x271a64,null));});}})[_0xbc3d('0x28')](function(_0x2a8d12){var _0x50dc02=_[_0xbc3d('0x2f')](_0x2a8d12,function(_0x2fe6fd){return _0x2fe6fd[_0xbc3d('0x4d')]({'plain':!![]});});})[_0xbc3d('0x28')](respondWithResult(_0x271a64,null))[_0xbc3d('0x46')](handleError(_0x271a64,null));};exports[_0xbc3d('0x6b')]=function(_0x494500,_0x8721fa,_0xcc4c55){return db[_0xbc3d('0x30')][_0xbc3d('0x49')]({'where':{'id':_0x494500[_0xbc3d('0x48')]['id']}})[_0xbc3d('0x28')](handleEntityNotFound(_0x8721fa,null))['then'](function(_0x191780){if(_0x191780){return _0x191780['removeResources'](_0x494500['query'][_0xbc3d('0x5e')]);}})[_0xbc3d('0x28')](respondWithStatusCode(_0x8721fa,null))['catch'](handleError(_0x8721fa,null));};exports[_0xbc3d('0x6c')]=function(_0x3731c5,_0x5abf38){var _0x4b1784={};if(!_0x3731c5['query']['section'])throw new Error(_0xbc3d('0x6d'));if(!_0x3731c5[_0xbc3d('0x34')][_0xbc3d('0x39')](_0xbc3d('0x3a'))){_0x4b1784[_0xbc3d('0x21')]=qs['limit'](_0x3731c5['query']['limit']);_0x4b1784['offset']=qs[_0xbc3d('0x1f')](_0x3731c5['query'][_0xbc3d('0x1f')]);}return db[_0xbc3d('0x30')]['find']({'where':{'id':_0x3731c5[_0xbc3d('0x48')]['id']}})[_0xbc3d('0x28')](function(_0x3ebd2b){if(!_0x3ebd2b)throw new Error(_0xbc3d('0x6e')+_0x3731c5[_0xbc3d('0x48')]['id']);return db[_0xbc3d('0x30')][_0xbc3d('0x6c')](_0x3731c5);})['then'](respondWithFilteredResult(_0x5abf38,_0x4b1784))[_0xbc3d('0x46')](handleError(_0x5abf38,null));}; \ No newline at end of file diff --git a/server/api/userProfile/userProfile.events.js b/server/api/userProfile/userProfile.events.js index cbaf0a3..f555948 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 _0xc0d7=['save','update','remove','emit','hasOwnProperty','hook','exports','setMaxListeners'];(function(_0x101db3,_0x39260a){var _0x2d0cf6=function(_0x4370ea){while(--_0x4370ea){_0x101db3['push'](_0x101db3['shift']());}};_0x2d0cf6(++_0x39260a);}(_0xc0d7,0x7f));var _0x7c0d=function(_0x4de233,_0x48584d){_0x4de233=_0x4de233-0x0;var _0x637a5e=_0xc0d7[_0x4de233];return _0x637a5e;};'use strict';var EventEmitter=require('events');var UserProfile=require('../../mysqldb')['db']['UserProfile'];var UserProfileEvents=new EventEmitter();UserProfileEvents[_0x7c0d('0x0')](0x0);var events={'afterCreate':_0x7c0d('0x1'),'afterUpdate':_0x7c0d('0x2'),'afterDestroy':_0x7c0d('0x3')};function emitEvent(_0x2c03ef){return function(_0x2e1cc8,_0xfbd3c8,_0x276b49){UserProfileEvents[_0x7c0d('0x4')](_0x2c03ef+':'+_0x2e1cc8['id'],_0x2e1cc8);UserProfileEvents['emit'](_0x2c03ef,_0x2e1cc8);_0x276b49(null);};}for(var e in events){if(events[_0x7c0d('0x5')](e)){var event=events[e];UserProfile[_0x7c0d('0x6')](e,emitEvent(event));}}module[_0x7c0d('0x7')]=UserProfileEvents; \ No newline at end of file +var _0x8cda=['remove','emit','hasOwnProperty','hook','exports','../../mysqldb','UserProfile','setMaxListeners','save','update'];(function(_0x195201,_0x5ec43b){var _0x471c9c=function(_0x53527f){while(--_0x53527f){_0x195201['push'](_0x195201['shift']());}};_0x471c9c(++_0x5ec43b);}(_0x8cda,0x1db));var _0xa8cd=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0x8cda[_0x14add3];return _0x4a174f;};'use strict';var EventEmitter=require('events');var UserProfile=require(_0xa8cd('0x0'))['db'][_0xa8cd('0x1')];var UserProfileEvents=new EventEmitter();UserProfileEvents[_0xa8cd('0x2')](0x0);var events={'afterCreate':_0xa8cd('0x3'),'afterUpdate':_0xa8cd('0x4'),'afterDestroy':_0xa8cd('0x5')};function emitEvent(_0x52a4ca){return function(_0x4116cf,_0x402139,_0x318ac3){UserProfileEvents['emit'](_0x52a4ca+':'+_0x4116cf['id'],_0x4116cf);UserProfileEvents[_0xa8cd('0x6')](_0x52a4ca,_0x4116cf);_0x318ac3(null);};}for(var e in events){if(events[_0xa8cd('0x7')](e)){var event=events[e];UserProfile[_0xa8cd('0x8')](e,emitEvent(event));}}module[_0xa8cd('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 782102c..329e015 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 _0xbb41=['SugarcrmAccount','deskaccounts','DeskAccount','zohoaccounts','ZohoAccount','vtigeraccounts','cannedanswers','dispositions','customdashboards','Dashboard','intervals','Interval','pauses','Schedule','sounds','Tag','templates','Trigger','variables','Variable','plugins','Plugin','extractedreports','AnalyticExtractedReport','Reports','metrics','charAt','toUpperCase','slice','QueryTypes','SELECT','select','ui.','InteractionId','ui.createdAt','from','user_has_','_interactions','where','sequelize','query','toString','define','user_profiles','../../components/parsers/qs','Invalid\x20section\x20\x27','isEmpty','length','push','find','params','all','ignore','union','model','rawAttributes','keys','filters','intersection','attributes','fields','hasOwnProperty','limit','offset','order','sort','pick','key','VIRTUAL','foreignKey','forEach','merge','options','autoAssociation','include','DefaultReports','reportId','count','ids','customSorting','extraQueryConditions','includeAll','CmContact','color','tag','rows','true','chat','dataValues','sms','mail','whatsapp','lodash','./userProfile.attributes','exports','models','filter','field','value','findAll','then','associatedResources','map','catch','name','resolve','resourceId','type','toLowerCase','childModel','SquareProject','odbc','SquareOdbc','squarerecordings','SquareRecording','parentSections','SquareProjects','projectName','projects','JscriptyProject','contacts','ListId','CmList','CmCompany','globalcustomfields','CmCustomField','chatqueues','ChatQueue','chatwebsites','FaxQueue','faxaccounts','FaxAccount','inboundroutes','outboundroutes','VoiceExtension','contexts','VoiceContext','VoiceMail','voicerecordings','VoiceRecording','Agents','User','agent','Telephones','membername','role','telephone','VoiceQueues','queue','VoiceQueue','QueueCampaigns','outbound','chanspies','VoiceChanSpy','voiceprefixes','mailqueues','MailQueue','mailaccounts','MailAccount','mailsubstatuses','MailSubstatus','openchannelqueues','OpenchannelQueue','openchannelaccounts','SmsQueue','smsaccounts','whatsappaccounts','teams','Team','voicequeues','users','agents','telephones','Users','user','zendeskaccounts','ZendeskAccount','salesforceaccounts','SalesforceAccount','freshdeskaccounts','FreshdeskAccount'];(function(_0x266cd6,_0x43c08e){var _0x3a8953=function(_0x23db2d){while(--_0x23db2d){_0x266cd6['push'](_0x266cd6['shift']());}};_0x3a8953(++_0x43c08e);}(_0xbb41,0x1c6));var _0x1bb4=function(_0x380a5a,_0x50f2e5){_0x380a5a=_0x380a5a-0x0;var _0xd47ac1=_0xbb41[_0x380a5a];return _0xd47ac1;};'use strict';var _=require(_0x1bb4('0x0'));var attributes=require(_0x1bb4('0x1'));var squel=require('squel');module[_0x1bb4('0x2')]=function(_0x52f141){var _0x3cdc4d=_0x52f141[_0x1bb4('0x3')];function _0x8e61a7(_0x47447f,_0x5df4eb){return new Promise(function(_0x129c75,_0xf0ae6){if(!_0x5df4eb)return _0x129c75(null);var _0x407468=_0x5df4eb[_0x1bb4('0x4')]?{[_0x5df4eb[_0x1bb4('0x4')][_0x1bb4('0x5')]]:_0x5df4eb['filter'][_0x1bb4('0x6')]}:undefined;return _0x3cdc4d[_0x47447f][_0x1bb4('0x7')]({'where':_0x407468,'raw':!![]})[_0x1bb4('0x8')](function(_0xb2ec2e){_0x5df4eb[_0x1bb4('0x9')]=_[_0x1bb4('0xa')](_0xb2ec2e,'id');_0x129c75(_0x5df4eb);})[_0x1bb4('0xb')](function(_0x4c731c){_0xf0ae6(_0x4c731c);});});}function _0x522512(_0x3b372d,_0x547621){return new Promise(function(_0x361629,_0x125c3c){var _0x32dee1=_0x3b372d[_0x1bb4('0x4')]?{[_0x3b372d['filter'][_0x1bb4('0x5')]]:_0x3b372d['filter'][_0x1bb4('0x6')]}:undefined;return _0x3cdc4d[_0x3b372d['model']][_0x1bb4('0x7')]({'where':_0x32dee1,'raw':!![]})['then'](function(_0x16cdad){_0x547621['associatedResources']=_[_0x1bb4('0xa')](_0x16cdad,function(_0x48677a){return _0x48677a[_0x1bb4('0xc')];});_0x361629(_0x547621);})[_0x1bb4('0xb')](function(_0x5037f8){_0x125c3c(_0x5037f8);});});}function _0x2d1bc1(_0x4f5d50,_0x161215,_0x3b7b6e){if(!_0x161215)return Promise[_0x1bb4('0xd')](null);return new Promise(function(_0x35f9e7,_0x4d7eb5){return _0x3cdc4d['UserProfileResource'][_0x1bb4('0x7')]({'where':{'sectionId':_0x161215['id']},'raw':!![]})[_0x1bb4('0x8')](function(_0x1b9599){if(_0x4f5d50['field']&&_0x4f5d50[_0x1bb4('0x5')]!=='id'){_0x161215[_0x1bb4('0x9')]=_[_0x1bb4('0xa')](_0x1b9599,function(_0x4ff4c3){return _0x4ff4c3[_0x4f5d50['field']];});}else{if(_0x3b7b6e==='AnalyticExtractedReport'){_0x161215['associatedResources']=_[_0x1bb4('0xa')](_0x1b9599,function(_0xf98da7){return{'id':_0xf98da7[_0x1bb4('0xe')],'type':_0xf98da7[_0x1bb4('0xf')]};});}else{_0x161215[_0x1bb4('0x9')]=_[_0x1bb4('0xa')](_0x1b9599,function(_0x19858b){return _0x19858b['resourceId'];});}}_0x35f9e7(_0x161215);})[_0x1bb4('0xb')](function(_0x4c743c){_0x4d7eb5(_0x4c743c);});});}function _0x24fd81(_0x5b44cf,_0x456bb9){var _0x464783={'parentSections':[]};switch(_0x5b44cf[_0x1bb4('0x10')]()){case'squareprojects':_0x464783[_0x1bb4('0x11')]=_0x1bb4('0x12');break;case _0x1bb4('0x13'):_0x464783[_0x1bb4('0x11')]=_0x1bb4('0x14');break;case _0x1bb4('0x15'):_0x464783[_0x1bb4('0x11')]=_0x1bb4('0x16');_0x464783[_0x1bb4('0x17')]=[{'name':_0x1bb4('0x18'),'field':_0x1bb4('0xc'),'foreignKey':_0x1bb4('0x19')}];break;case _0x1bb4('0x1a'):_0x464783['childModel']=_0x1bb4('0x1b');break;case _0x1bb4('0x1c'):_0x464783['childModel']='CmContact';_0x464783[_0x1bb4('0x17')]=[{'name':'Lists','field':'id','foreignKey':_0x1bb4('0x1d')}];break;case'lists':_0x464783['childModel']=_0x1bb4('0x1e');break;case'companies':_0x464783['childModel']=_0x1bb4('0x1f');break;case _0x1bb4('0x20'):_0x464783[_0x1bb4('0x11')]=_0x1bb4('0x21');break;case _0x1bb4('0x22'):_0x464783[_0x1bb4('0x11')]=_0x1bb4('0x23');break;case _0x1bb4('0x24'):_0x464783[_0x1bb4('0x11')]='ChatWebsite';break;case'faxqueues':_0x464783[_0x1bb4('0x11')]=_0x1bb4('0x25');break;case _0x1bb4('0x26'):_0x464783[_0x1bb4('0x11')]=_0x1bb4('0x27');break;case _0x1bb4('0x28'):case'internalroutes':case _0x1bb4('0x29'):_0x464783['childModel']=_0x1bb4('0x2a');break;case _0x1bb4('0x2b'):_0x464783[_0x1bb4('0x11')]=_0x1bb4('0x2c');break;case'voicemails':_0x464783[_0x1bb4('0x11')]=_0x1bb4('0x2d');break;case _0x1bb4('0x2e'):_0x464783['childModel']=_0x1bb4('0x2f');_0x464783[_0x1bb4('0x17')]=[{'name':_0x1bb4('0x30'),'field':_0x1bb4('0xc'),'foreignKey':'membername','model':_0x1bb4('0x31'),'filter':{'field':'role','value':[_0x1bb4('0x32')]}},{'name':_0x1bb4('0x33'),'field':_0x1bb4('0xc'),'foreignKey':_0x1bb4('0x34'),'model':'User','filter':{'field':_0x1bb4('0x35'),'value':[_0x1bb4('0x36')]}},{'name':_0x1bb4('0x37'),'field':_0x1bb4('0xc'),'foreignKey':_0x1bb4('0x38'),'model':_0x1bb4('0x39'),'filter':{'field':_0x1bb4('0xf'),'value':['inbound']}},{'name':_0x1bb4('0x3a'),'field':_0x1bb4('0xc'),'foreignKey':_0x1bb4('0x38'),'model':_0x1bb4('0x39'),'filter':{'field':'type','value':[_0x1bb4('0x3b')]}}];break;case'musiconholds':_0x464783[_0x1bb4('0x11')]='VoiceMusicOnHold';break;case _0x1bb4('0x3c'):_0x464783[_0x1bb4('0x11')]=_0x1bb4('0x3d');break;case _0x1bb4('0x3e'):_0x464783[_0x1bb4('0x11')]='VoicePrefix';break;case'ivrcampaigns':_0x464783[_0x1bb4('0x11')]='Campaign';break;case _0x1bb4('0x3f'):_0x464783['childModel']=_0x1bb4('0x40');break;case _0x1bb4('0x41'):_0x464783[_0x1bb4('0x11')]=_0x1bb4('0x42');break;case _0x1bb4('0x43'):_0x464783['childModel']=_0x1bb4('0x44');break;case _0x1bb4('0x45'):_0x464783[_0x1bb4('0x11')]=_0x1bb4('0x46');break;case _0x1bb4('0x47'):_0x464783[_0x1bb4('0x11')]='OpenchannelAccount';break;case'smsqueues':_0x464783[_0x1bb4('0x11')]=_0x1bb4('0x48');break;case _0x1bb4('0x49'):_0x464783[_0x1bb4('0x11')]='SmsAccount';break;case'whatsappqueues':_0x464783[_0x1bb4('0x11')]='WhatsappQueue';break;case _0x1bb4('0x4a'):_0x464783[_0x1bb4('0x11')]='WhatsappAccount';break;case _0x1bb4('0x4b'):_0x464783[_0x1bb4('0x11')]=_0x1bb4('0x4c');break;case _0x1bb4('0x4d'):case'queuecampaigns':_0x464783[_0x1bb4('0x11')]=_0x1bb4('0x39');if(_0x456bb9){_0x464783[_0x1bb4('0x17')]=[{'name':_0x1bb4('0x37')},{'name':_0x1bb4('0x3a')}];}break;case _0x1bb4('0x4e'):case _0x1bb4('0x4f'):case _0x1bb4('0x50'):_0x464783[_0x1bb4('0x11')]=_0x1bb4('0x31');if(_0x456bb9){_0x464783[_0x1bb4('0x17')]=[{'name':_0x1bb4('0x51'),'filter':{'field':_0x1bb4('0x35'),'value':['admin',_0x1bb4('0x52')]},'ignore':!![]},{'name':_0x1bb4('0x30')},{'name':_0x1bb4('0x33')}];}break;case _0x1bb4('0x53'):_0x464783[_0x1bb4('0x11')]=_0x1bb4('0x54');break;case _0x1bb4('0x55'):_0x464783[_0x1bb4('0x11')]=_0x1bb4('0x56');break;case _0x1bb4('0x57'):_0x464783[_0x1bb4('0x11')]=_0x1bb4('0x58');break;case'sugarcrmaccounts':_0x464783[_0x1bb4('0x11')]=_0x1bb4('0x59');break;case _0x1bb4('0x5a'):_0x464783[_0x1bb4('0x11')]=_0x1bb4('0x5b');break;case _0x1bb4('0x5c'):_0x464783['childModel']=_0x1bb4('0x5d');break;case _0x1bb4('0x5e'):_0x464783['childModel']=_0x1bb4('0x31');break;case _0x1bb4('0x5f'):_0x464783['childModel']='CannedAnswer';break;case _0x1bb4('0x60'):_0x464783[_0x1bb4('0x11')]='Disposition';break;case _0x1bb4('0x61'):_0x464783[_0x1bb4('0x11')]=_0x1bb4('0x62');break;case _0x1bb4('0x63'):_0x464783[_0x1bb4('0x11')]=_0x1bb4('0x64');break;case _0x1bb4('0x65'):_0x464783[_0x1bb4('0x11')]='Pause';break;case'scheduler':_0x464783[_0x1bb4('0x11')]=_0x1bb4('0x66');break;case _0x1bb4('0x67'):_0x464783[_0x1bb4('0x11')]='Sound';break;case'tags':_0x464783[_0x1bb4('0x11')]=_0x1bb4('0x68');break;case _0x1bb4('0x69'):_0x464783['childModel']='Template';break;case'triggers':_0x464783[_0x1bb4('0x11')]=_0x1bb4('0x6a');break;case'trunks':_0x464783[_0x1bb4('0x11')]='Trunk';break;case _0x1bb4('0x6b'):_0x464783[_0x1bb4('0x11')]=_0x1bb4('0x6c');break;case _0x1bb4('0x6d'):_0x464783[_0x1bb4('0x11')]=_0x1bb4('0x6e');break;case _0x1bb4('0x6f'):_0x464783[_0x1bb4('0x11')]=_0x1bb4('0x70');_0x464783[_0x1bb4('0x17')]=[{'name':_0x1bb4('0x71'),'field':'id','foreignKey':'reportId'}];break;case _0x1bb4('0x72'):_0x464783[_0x1bb4('0x11')]='AnalyticMetric';break;}return _0x464783;}function _0x9c9ed9(_0x4bd7b4,_0x167776){var _0x5ea2ba=_0x4bd7b4[_0x1bb4('0x73')](0x0)[_0x1bb4('0x74')]()+_0x4bd7b4[_0x1bb4('0x75')](0x1);var _0x4dc932={'type':_0x3cdc4d['Sequelize'][_0x1bb4('0x76')][_0x1bb4('0x77')],'raw':!![]};return new Promise(function(_0x15c226,_0x2fad53){var _0x598fbd=squel[_0x1bb4('0x78')]()[_0x1bb4('0x5')](_0x1bb4('0x79')+_0x5ea2ba+_0x1bb4('0x7a'),'id')[_0x1bb4('0x5')](_0x1bb4('0x7b'))[_0x1bb4('0x7c')](_0x1bb4('0x7d')+_0x4bd7b4+_0x1bb4('0x7e'),'ui')[_0x1bb4('0x7f')]('ui.UserId\x20=\x20?',_0x167776['id']);return _0x3cdc4d[_0x1bb4('0x80')][_0x1bb4('0x81')](_0x598fbd[_0x1bb4('0x82')](),_0x4dc932)['then'](function(_0x4a8dfb){_0x167776[_0x5ea2ba+'OpenTabs']=_0x4a8dfb;_0x15c226(_0x4a8dfb);})[_0x1bb4('0xb')](function(_0x45cd7a){_0x2fad53(_0x45cd7a);});});}return _0x52f141[_0x1bb4('0x83')]('UserProfile',attributes,{'tableName':_0x1bb4('0x84'),'paranoid':![],'indexes':[],'timestamps':!![],'classMethods':{'getResources':function(_0x2227d9){var _0x4a42ad=require(_0x1bb4('0x85'));var _0x5345ac={'raw':_0x2227d9[_0x1bb4('0x81')]['raw'],'where':{}};var _0x141e6e={};var _0x266311={'count':0x0,'rows':[]};var _0x2203de=_0x2227d9['query']['section'];var _0x4887a9=_0x2227d9[_0x1bb4('0x81')]['mergeResources']||![];var _0x18a06b=_0x24fd81(_0x2203de,_0x4887a9);if(!_0x18a06b[_0x1bb4('0x11')])throw new Error(_0x1bb4('0x86')+_0x2203de+'\x27');var _0x452323=[{'name':_0x2203de}];if(!_[_0x1bb4('0x87')](_0x18a06b['parentSections']))_0x452323=_0x18a06b[_0x1bb4('0x17')];var _0x436c9c=[];for(var _0x38f059=0x0;_0x38f059<_0x452323[_0x1bb4('0x88')];_0x38f059++){_0x436c9c[_0x1bb4('0x89')](_0x3cdc4d['UserProfileSection'][_0x1bb4('0x8a')]({'where':{'userProfileId':_0x2227d9[_0x1bb4('0x8b')]['id'],'name':_0x452323[_0x38f059][_0x1bb4('0xc')]},'raw':!![]}));}return Promise[_0x1bb4('0x8c')](_0x436c9c)[_0x1bb4('0x8')](function(_0x2495ff){var _0x50f699=_[_0x1bb4('0x4')](_0x2495ff,function(_0x17a394){return _0x17a394?_0x17a394:undefined;});var _0x2bfa09=_[_0x1bb4('0x4')](_0x452323,[_0x1bb4('0x8d'),!![]]);var _0x4d3db1=_[_0x1bb4('0x87')](_0x50f699)&&_[_0x1bb4('0x87')](_0x2bfa09)?null:_[_0x1bb4('0x8e')](_0x2bfa09,_0x50f699);if(!_0x4d3db1)return null;var _0x340aa3=[];for(var _0x14cf12=0x0;_0x14cf12<_0x4d3db1[_0x1bb4('0x88')];_0x14cf12++){var _0x12ac81=_[_0x1bb4('0x8a')](_0x452323,function(_0x5bb680){return _0x4d3db1[_0x14cf12]?_0x5bb680[_0x1bb4('0xc')]===_0x4d3db1[_0x14cf12][_0x1bb4('0xc')]:null;});if(_0x12ac81){if(_0x4d3db1[_0x14cf12]['ignore']){_0x340aa3[_0x1bb4('0x89')](_0x8e61a7(_0x18a06b[_0x1bb4('0x11')],_0x4d3db1[_0x14cf12]));}else{if(!_0x4d3db1[_0x14cf12]['autoAssociation']){_0x340aa3[_0x1bb4('0x89')](_0x2d1bc1(_0x12ac81,_0x4d3db1[_0x14cf12],_0x18a06b[_0x1bb4('0x11')]));}else{if(_0x12ac81[_0x1bb4('0x8f')]){_0x340aa3[_0x1bb4('0x89')](_0x522512(_0x12ac81,_0x4d3db1[_0x14cf12]));}}}}}return Promise['all'](_0x340aa3);})[_0x1bb4('0x8')](function(_0x15e887){var _0xf8462b=_0x15e887;var _0x2f721b=null;if(_0xf8462b){_0x2f721b=_0xf8462b[_0x1bb4('0x88')]===0x1?_0xf8462b[0x0]:null;}if(!_0x2f721b&&!_0xf8462b)return _0x266311;var _0x44dd6e=_0x3cdc4d[_0x18a06b[_0x1bb4('0x11')]][_0x1bb4('0x90')];_0x141e6e['model']=_[_0x1bb4('0x91')](_0x44dd6e);_0x141e6e['query']=_['keys'](_0x2227d9[_0x1bb4('0x81')]);_0x141e6e[_0x1bb4('0x92')]=_[_0x1bb4('0x93')](_0x141e6e[_0x1bb4('0x8f')],_0x141e6e['query']);_0x5345ac[_0x1bb4('0x94')]=_[_0x1bb4('0x93')](_0x141e6e['model'],_0x4a42ad[_0x1bb4('0x95')](_0x2227d9['query']['fields']));_0x5345ac['attributes']=_0x5345ac['attributes']['length']?_0x5345ac[_0x1bb4('0x94')]:_0x141e6e[_0x1bb4('0x8f')];if(!_0x2227d9[_0x1bb4('0x81')][_0x1bb4('0x96')]('nolimit')){_0x5345ac[_0x1bb4('0x97')]=_0x4a42ad[_0x1bb4('0x97')](_0x2227d9[_0x1bb4('0x81')]['limit']);_0x5345ac[_0x1bb4('0x98')]=_0x4a42ad[_0x1bb4('0x98')](_0x2227d9[_0x1bb4('0x81')]['offset']);}_0x5345ac[_0x1bb4('0x99')]=_0x4a42ad[_0x1bb4('0x9a')](_0x2227d9[_0x1bb4('0x81')]['sort']);_0x5345ac[_0x1bb4('0x7f')]=_0x4a42ad[_0x1bb4('0x92')](_[_0x1bb4('0x9b')](_0x2227d9[_0x1bb4('0x81')],_0x141e6e[_0x1bb4('0x92')]));if(_0x2227d9[_0x1bb4('0x81')][_0x1bb4('0x4')]){_0x5345ac[_0x1bb4('0x7f')]=_['merge'](_0x5345ac[_0x1bb4('0x7f')],{'$or':_[_0x1bb4('0xa')](_0x44dd6e,function(_0x28ca13){if(_0x28ca13[_0x1bb4('0xf')][_0x1bb4('0x9c')]!==_0x1bb4('0x9d')){var _0x508a97={};_0x508a97[_0x28ca13[_0x1bb4('0x5')]]={'$like':'%'+_0x2227d9[_0x1bb4('0x81')][_0x1bb4('0x4')]+'%'};return _0x508a97;}})});}var _0x15e624=[];var _0x252feb=null;var _0x2c805d={};if(_0x2f721b){_0x252feb=_['find'](_0x452323,['name',_0x2f721b[_0x1bb4('0xc')]]);if(_0x252feb['field']){_0x2c805d={};if(_0x18a06b[_0x1bb4('0x11')]===_0x1bb4('0x70')){_0x2c805d[_0x252feb['foreignKey']]=_['map'](_0x2f721b[_0x1bb4('0x9')],'id');}else{_0x2c805d[_0x252feb[_0x1bb4('0x9e')]]=_0x2f721b['associatedResources'];}_0x15e624[_0x1bb4('0x89')](_0x2c805d);}else{_0x5345ac[_0x1bb4('0x7f')]['id']=_0x2f721b[_0x1bb4('0x9')];}}else{for(var _0x287918=0x0;_0x287918<_0xf8462b['length'];_0x287918++){_0x252feb=_[_0x1bb4('0x8a')](_0x452323,['name',_0xf8462b[_0x287918][_0x1bb4('0xc')]]);if(_0x252feb[_0x1bb4('0x5')]){_0x2c805d={};_0x2c805d[_0x252feb[_0x1bb4('0x9e')]]=_0xf8462b[_0x287918][_0x1bb4('0x9')];_0x15e624[_0x1bb4('0x89')](_0x2c805d);}else{if(!_0x5345ac['where']['id'])_0x5345ac[_0x1bb4('0x7f')]['id']=[];_0xf8462b[_0x287918][_0x1bb4('0x9')][_0x1bb4('0x9f')](function(_0x4756c8){_0x5345ac[_0x1bb4('0x7f')]['id']['push'](_0x4756c8);});}}}if(!_[_0x1bb4('0x87')](_0x15e624)){_0x5345ac[_0x1bb4('0x7f')]=_['merge'](_0x5345ac['where'],{'$and':{'$or':_0x15e624}});}_0x5345ac=_[_0x1bb4('0xa0')]({},_0x5345ac,_0x2227d9[_0x1bb4('0xa1')]);if(_0x2f721b&&!_0x2f721b[_0x1bb4('0xa2')]&&_0x18a06b[_0x1bb4('0x11')]===_0x1bb4('0x70')){if(_0x2227d9['query']['includeAll']){_0x5345ac[_0x1bb4('0xa3')]=[{'all':!![]}];}return _0x3cdc4d[_0x18a06b['childModel']]['findAll'](_0x5345ac)[_0x1bb4('0x8')](function(_0x19d4a5){var _0x827f5b=[];_0x19d4a5[_0x1bb4('0x9f')](function(_0x590405){var _0x395e33;switch(_0x590405['reportType']){case'default':_0x395e33=_[_0x1bb4('0x8a')](_0x2f721b[_0x1bb4('0x9')],function(_0x42cdee){return _0x42cdee['id']===_0x590405['reportId']&&_0x42cdee['type']===_0x1bb4('0xa4');});break;case'custom':_0x395e33=_[_0x1bb4('0x8a')](_0x2f721b['associatedResources'],function(_0x4490b3){return _0x4490b3['id']===_0x590405[_0x1bb4('0xa5')]&&_0x4490b3[_0x1bb4('0xf')]==='CustomReports';});break;}if(_0x395e33)_0x827f5b[_0x1bb4('0x89')](_0x590405);});_0x266311[_0x1bb4('0xa6')]=_0x827f5b[_0x1bb4('0x88')];_0x266311['rows']=_0x827f5b;return _0x266311;});}else{if(!_[_0x1bb4('0x87')](_0x2227d9[_0x1bb4('0x81')]['ids'])){_0x5345ac['where']['id']=_0x5345ac[_0x1bb4('0x7f')]['id']?_[_0x1bb4('0x93')](_0x5345ac[_0x1bb4('0x7f')]['id'],_0x2227d9[_0x1bb4('0x81')][_0x1bb4('0xa7')]):_0x2227d9[_0x1bb4('0x81')][_0x1bb4('0xa7')];if(_0x2227d9[_0x1bb4('0x81')]['customSorting']){_0x5345ac['order']=_0x2227d9['query'][_0x1bb4('0xa8')];}}if(_0x2227d9[_0x1bb4('0x81')][_0x1bb4('0xa9')]){_0x5345ac[_0x1bb4('0x7f')]=_['merge'](_0x5345ac[_0x1bb4('0x7f')],{'$and':_0x2227d9[_0x1bb4('0x81')][_0x1bb4('0xa9')]});}return _0x3cdc4d[_0x18a06b[_0x1bb4('0x11')]][_0x1bb4('0xa6')]({'where':_0x5345ac[_0x1bb4('0x7f')]})['then'](function(_0x53762d){_0x266311[_0x1bb4('0xa6')]=_0x53762d;if(_0x2227d9[_0x1bb4('0x81')][_0x1bb4('0xaa')]){if(_0x18a06b['childModel']===_0x1bb4('0xab')){_0x5345ac['include']=[{'model':_0x3cdc4d[_0x1bb4('0x68')],'as':'Tags','attributes':['id','name',_0x1bb4('0xac')],'required':_0x2227d9['query'][_0x1bb4('0xad')]?!![]:![]},{'model':_0x3cdc4d[_0x1bb4('0x68')],'as':'ThroughTags','attributes':['id',_0x1bb4('0xc'),_0x1bb4('0xac')],'through':_0x2227d9[_0x1bb4('0x81')][_0x1bb4('0xad')]?{'attributes':[],'where':{'TagId':_0x2227d9[_0x1bb4('0x81')][_0x1bb4('0xad')]||undefined}}:{},'required':_0x2227d9['query'][_0x1bb4('0xad')]?!![]:![]}];}else{_0x5345ac['include']=[{'all':!![]}];}}return _0x3cdc4d[_0x18a06b[_0x1bb4('0x11')]][_0x1bb4('0x7')](_0x5345ac);})[_0x1bb4('0x8')](function(_0x18b113){_0x266311[_0x1bb4('0xae')]=_0x18b113;if(_0x2203de==='Agents'&&_0x2227d9['query']['openTabs']===_0x1bb4('0xaf')){var _0x9fc774=[];for(var _0x1d325b=0x0;_0x1d325b<_0x266311[_0x1bb4('0xae')][_0x1bb4('0x88')];_0x1d325b++){_0x9fc774[_0x1bb4('0x89')](_0x9c9ed9(_0x1bb4('0xb0'),_0x266311[_0x1bb4('0xae')][_0x1d325b][_0x1bb4('0xb1')]));_0x9fc774[_0x1bb4('0x89')](_0x9c9ed9(_0x1bb4('0xb2'),_0x266311['rows'][_0x1d325b][_0x1bb4('0xb1')]));_0x9fc774['push'](_0x9c9ed9('fax',_0x266311[_0x1bb4('0xae')][_0x1d325b]['dataValues']));_0x9fc774[_0x1bb4('0x89')](_0x9c9ed9(_0x1bb4('0xb3'),_0x266311[_0x1bb4('0xae')][_0x1d325b][_0x1bb4('0xb1')]));_0x9fc774[_0x1bb4('0x89')](_0x9c9ed9('openchannel',_0x266311[_0x1bb4('0xae')][_0x1d325b]['dataValues']));_0x9fc774[_0x1bb4('0x89')](_0x9c9ed9(_0x1bb4('0xb4'),_0x266311[_0x1bb4('0xae')][_0x1d325b][_0x1bb4('0xb1')]));}return Promise[_0x1bb4('0x8c')](_0x9fc774)[_0x1bb4('0x8')](function(){return _0x266311;});}return _0x266311;});}});}}});}; \ No newline at end of file +var _0xe92a=['ZohoAccount','cannedanswers','CannedAnswer','dispositions','Disposition','Dashboard','Interval','pauses','Pause','scheduler','Sound','Tag','templates','Template','triggers','Trigger','trunks','Trunk','variables','plugins','AnalyticExtractedReport','Reports','reportId','metrics','AnalyticMetric','charAt','slice','Sequelize','SELECT','select','ui.','ui.createdAt','from','user_has_','_interactions','where','sequelize','query','toString','define','UserProfile','user_profiles','../../components/parsers/qs','raw','section','Invalid\x20section\x20\x27','isEmpty','length','push','find','params','all','ignore','union','autoAssociation','keys','filters','attributes','intersection','fields','hasOwnProperty','nolimit','limit','offset','sort','pick','merge','key','foreignKey','forEach','includeAll','include','default','DefaultReports','custom','CustomReports','count','rows','ids','customSorting','order','extraQueryConditions','color','ThroughTags','tag','findAll','openTabs','chat','sms','fax','mail','openchannel','dataValues','lodash','./userProfile.attributes','squel','exports','models','filter','field','value','associatedResources','map','catch','model','name','resolve','then','type','resourceId','childModel','SquareProject','odbc','SquareRecording','parentSections','SquareProjects','projects','JscriptyProject','CmContact','Lists','ListId','lists','companies','CmCompany','globalcustomfields','CmCustomField','chatqueues','ChatQueue','ChatWebsite','FaxQueue','faxaccounts','FaxAccount','inboundroutes','internalroutes','VoiceExtension','contexts','VoiceContext','voicemails','VoiceRecording','Agents','membername','User','role','agent','telephone','VoiceQueues','VoiceQueue','queue','musiconholds','VoiceMusicOnHold','chanspies','VoiceChanSpy','VoicePrefix','ivrcampaigns','mailqueues','mailaccounts','mailsubstatuses','MailSubstatus','openchannelqueues','OpenchannelQueue','openchannelaccounts','OpenchannelAccount','smsqueues','smsaccounts','SmsAccount','whatsappqueues','WhatsappQueue','whatsappaccounts','teams','voicequeues','queuecampaigns','QueueCampaigns','users','agents','telephones','Users','admin','user','Telephones','salesforceaccounts','SalesforceAccount','freshdeskaccounts','FreshdeskAccount','SugarcrmAccount','deskaccounts','DeskAccount','zohoaccounts'];(function(_0x814989,_0x4205d3){var _0x226b56=function(_0x317030){while(--_0x317030){_0x814989['push'](_0x814989['shift']());}};_0x226b56(++_0x4205d3);}(_0xe92a,0x118));var _0xae92=function(_0x260dc1,_0x58bc1f){_0x260dc1=_0x260dc1-0x0;var _0x433b34=_0xe92a[_0x260dc1];return _0x433b34;};'use strict';var _=require(_0xae92('0x0'));var attributes=require(_0xae92('0x1'));var squel=require(_0xae92('0x2'));module[_0xae92('0x3')]=function(_0x3eeea9){var _0x46bf9d=_0x3eeea9[_0xae92('0x4')];function _0x17495f(_0x5ecc53,_0x24d404){return new Promise(function(_0x3ed16a,_0x255dc8){if(!_0x24d404)return _0x3ed16a(null);var _0x1fcfce=_0x24d404[_0xae92('0x5')]?{[_0x24d404[_0xae92('0x5')][_0xae92('0x6')]]:_0x24d404[_0xae92('0x5')][_0xae92('0x7')]}:undefined;return _0x46bf9d[_0x5ecc53]['findAll']({'where':_0x1fcfce,'raw':!![]})['then'](function(_0x3fbe5e){_0x24d404[_0xae92('0x8')]=_[_0xae92('0x9')](_0x3fbe5e,'id');_0x3ed16a(_0x24d404);})[_0xae92('0xa')](function(_0x4d88d8){_0x255dc8(_0x4d88d8);});});}function _0x2276e0(_0x20a161,_0x39cbc3){return new Promise(function(_0x4bc222,_0x2ff631){var _0x340eca=_0x20a161[_0xae92('0x5')]?{[_0x20a161[_0xae92('0x5')][_0xae92('0x6')]]:_0x20a161[_0xae92('0x5')][_0xae92('0x7')]}:undefined;return _0x46bf9d[_0x20a161[_0xae92('0xb')]]['findAll']({'where':_0x340eca,'raw':!![]})['then'](function(_0x16aba2){_0x39cbc3[_0xae92('0x8')]=_[_0xae92('0x9')](_0x16aba2,function(_0x2042be){return _0x2042be[_0xae92('0xc')];});_0x4bc222(_0x39cbc3);})[_0xae92('0xa')](function(_0x1d7968){_0x2ff631(_0x1d7968);});});}function _0x1c2986(_0xe4d90d,_0x4299dc,_0x5b2aa7){if(!_0x4299dc)return Promise[_0xae92('0xd')](null);return new Promise(function(_0x300629,_0x429eb8){return _0x46bf9d['UserProfileResource']['findAll']({'where':{'sectionId':_0x4299dc['id']},'raw':!![]})[_0xae92('0xe')](function(_0x28ae7b){if(_0xe4d90d[_0xae92('0x6')]&&_0xe4d90d[_0xae92('0x6')]!=='id'){_0x4299dc[_0xae92('0x8')]=_['map'](_0x28ae7b,function(_0x22ae9c){return _0x22ae9c[_0xe4d90d['field']];});}else{if(_0x5b2aa7==='AnalyticExtractedReport'){_0x4299dc[_0xae92('0x8')]=_[_0xae92('0x9')](_0x28ae7b,function(_0x39b713){return{'id':_0x39b713['resourceId'],'type':_0x39b713[_0xae92('0xf')]};});}else{_0x4299dc[_0xae92('0x8')]=_[_0xae92('0x9')](_0x28ae7b,function(_0x52b64f){return _0x52b64f[_0xae92('0x10')];});}}_0x300629(_0x4299dc);})[_0xae92('0xa')](function(_0x1cee64){_0x429eb8(_0x1cee64);});});}function _0x16074b(_0x512b4a,_0x43326b){var _0x54444d={'parentSections':[]};switch(_0x512b4a['toLowerCase']()){case'squareprojects':_0x54444d[_0xae92('0x11')]=_0xae92('0x12');break;case _0xae92('0x13'):_0x54444d['childModel']='SquareOdbc';break;case'squarerecordings':_0x54444d[_0xae92('0x11')]=_0xae92('0x14');_0x54444d[_0xae92('0x15')]=[{'name':_0xae92('0x16'),'field':_0xae92('0xc'),'foreignKey':'projectName'}];break;case _0xae92('0x17'):_0x54444d[_0xae92('0x11')]=_0xae92('0x18');break;case'contacts':_0x54444d[_0xae92('0x11')]=_0xae92('0x19');_0x54444d[_0xae92('0x15')]=[{'name':_0xae92('0x1a'),'field':'id','foreignKey':_0xae92('0x1b')}];break;case _0xae92('0x1c'):_0x54444d[_0xae92('0x11')]='CmList';break;case _0xae92('0x1d'):_0x54444d['childModel']=_0xae92('0x1e');break;case _0xae92('0x1f'):_0x54444d[_0xae92('0x11')]=_0xae92('0x20');break;case _0xae92('0x21'):_0x54444d[_0xae92('0x11')]=_0xae92('0x22');break;case'chatwebsites':_0x54444d[_0xae92('0x11')]=_0xae92('0x23');break;case'faxqueues':_0x54444d[_0xae92('0x11')]=_0xae92('0x24');break;case _0xae92('0x25'):_0x54444d['childModel']=_0xae92('0x26');break;case _0xae92('0x27'):case _0xae92('0x28'):case'outboundroutes':_0x54444d[_0xae92('0x11')]=_0xae92('0x29');break;case _0xae92('0x2a'):_0x54444d[_0xae92('0x11')]=_0xae92('0x2b');break;case _0xae92('0x2c'):_0x54444d[_0xae92('0x11')]='VoiceMail';break;case'voicerecordings':_0x54444d['childModel']=_0xae92('0x2d');_0x54444d['parentSections']=[{'name':_0xae92('0x2e'),'field':_0xae92('0xc'),'foreignKey':_0xae92('0x2f'),'model':_0xae92('0x30'),'filter':{'field':_0xae92('0x31'),'value':[_0xae92('0x32')]}},{'name':'Telephones','field':_0xae92('0xc'),'foreignKey':_0xae92('0x2f'),'model':_0xae92('0x30'),'filter':{'field':_0xae92('0x31'),'value':[_0xae92('0x33')]}},{'name':_0xae92('0x34'),'field':_0xae92('0xc'),'foreignKey':'queue','model':_0xae92('0x35'),'filter':{'field':'type','value':['inbound']}},{'name':'QueueCampaigns','field':_0xae92('0xc'),'foreignKey':_0xae92('0x36'),'model':_0xae92('0x35'),'filter':{'field':_0xae92('0xf'),'value':['outbound']}}];break;case _0xae92('0x37'):_0x54444d[_0xae92('0x11')]=_0xae92('0x38');break;case _0xae92('0x39'):_0x54444d[_0xae92('0x11')]=_0xae92('0x3a');break;case'voiceprefixes':_0x54444d[_0xae92('0x11')]=_0xae92('0x3b');break;case _0xae92('0x3c'):_0x54444d[_0xae92('0x11')]='Campaign';break;case _0xae92('0x3d'):_0x54444d[_0xae92('0x11')]='MailQueue';break;case _0xae92('0x3e'):_0x54444d[_0xae92('0x11')]='MailAccount';break;case _0xae92('0x3f'):_0x54444d[_0xae92('0x11')]=_0xae92('0x40');break;case _0xae92('0x41'):_0x54444d[_0xae92('0x11')]=_0xae92('0x42');break;case _0xae92('0x43'):_0x54444d['childModel']=_0xae92('0x44');break;case _0xae92('0x45'):_0x54444d[_0xae92('0x11')]='SmsQueue';break;case _0xae92('0x46'):_0x54444d[_0xae92('0x11')]=_0xae92('0x47');break;case _0xae92('0x48'):_0x54444d[_0xae92('0x11')]=_0xae92('0x49');break;case _0xae92('0x4a'):_0x54444d['childModel']='WhatsappAccount';break;case _0xae92('0x4b'):_0x54444d[_0xae92('0x11')]='Team';break;case _0xae92('0x4c'):case _0xae92('0x4d'):_0x54444d[_0xae92('0x11')]='VoiceQueue';if(_0x43326b){_0x54444d['parentSections']=[{'name':'VoiceQueues'},{'name':_0xae92('0x4e')}];}break;case _0xae92('0x4f'):case _0xae92('0x50'):case _0xae92('0x51'):_0x54444d[_0xae92('0x11')]=_0xae92('0x30');if(_0x43326b){_0x54444d[_0xae92('0x15')]=[{'name':_0xae92('0x52'),'filter':{'field':'role','value':[_0xae92('0x53'),_0xae92('0x54')]},'ignore':!![]},{'name':_0xae92('0x2e')},{'name':_0xae92('0x55')}];}break;case'zendeskaccounts':_0x54444d[_0xae92('0x11')]='ZendeskAccount';break;case _0xae92('0x56'):_0x54444d[_0xae92('0x11')]=_0xae92('0x57');break;case _0xae92('0x58'):_0x54444d['childModel']=_0xae92('0x59');break;case'sugarcrmaccounts':_0x54444d[_0xae92('0x11')]=_0xae92('0x5a');break;case _0xae92('0x5b'):_0x54444d[_0xae92('0x11')]=_0xae92('0x5c');break;case _0xae92('0x5d'):_0x54444d[_0xae92('0x11')]=_0xae92('0x5e');break;case'vtigeraccounts':_0x54444d[_0xae92('0x11')]='User';break;case _0xae92('0x5f'):_0x54444d['childModel']=_0xae92('0x60');break;case _0xae92('0x61'):_0x54444d[_0xae92('0x11')]=_0xae92('0x62');break;case'customdashboards':_0x54444d[_0xae92('0x11')]=_0xae92('0x63');break;case'intervals':_0x54444d[_0xae92('0x11')]=_0xae92('0x64');break;case _0xae92('0x65'):_0x54444d[_0xae92('0x11')]=_0xae92('0x66');break;case _0xae92('0x67'):_0x54444d[_0xae92('0x11')]='Schedule';break;case'sounds':_0x54444d[_0xae92('0x11')]=_0xae92('0x68');break;case'tags':_0x54444d['childModel']=_0xae92('0x69');break;case _0xae92('0x6a'):_0x54444d[_0xae92('0x11')]=_0xae92('0x6b');break;case _0xae92('0x6c'):_0x54444d[_0xae92('0x11')]=_0xae92('0x6d');break;case _0xae92('0x6e'):_0x54444d[_0xae92('0x11')]=_0xae92('0x6f');break;case _0xae92('0x70'):_0x54444d[_0xae92('0x11')]='Variable';break;case _0xae92('0x71'):_0x54444d['childModel']='Plugin';break;case'extractedreports':_0x54444d[_0xae92('0x11')]=_0xae92('0x72');_0x54444d[_0xae92('0x15')]=[{'name':_0xae92('0x73'),'field':'id','foreignKey':_0xae92('0x74')}];break;case _0xae92('0x75'):_0x54444d[_0xae92('0x11')]=_0xae92('0x76');break;}return _0x54444d;}function _0x383237(_0x22cb3b,_0x2144cf){var _0x48d634=_0x22cb3b[_0xae92('0x77')](0x0)['toUpperCase']()+_0x22cb3b[_0xae92('0x78')](0x1);var _0x291336={'type':_0x46bf9d[_0xae92('0x79')]['QueryTypes'][_0xae92('0x7a')],'raw':!![]};return new Promise(function(_0x6f694e,_0x2e249c){var _0xd03a77=squel[_0xae92('0x7b')]()[_0xae92('0x6')](_0xae92('0x7c')+_0x48d634+'InteractionId','id')[_0xae92('0x6')](_0xae92('0x7d'))[_0xae92('0x7e')](_0xae92('0x7f')+_0x22cb3b+_0xae92('0x80'),'ui')[_0xae92('0x81')]('ui.UserId\x20=\x20?',_0x2144cf['id']);return _0x46bf9d[_0xae92('0x82')][_0xae92('0x83')](_0xd03a77[_0xae92('0x84')](),_0x291336)[_0xae92('0xe')](function(_0x4d8201){_0x2144cf[_0x48d634+'OpenTabs']=_0x4d8201;_0x6f694e(_0x4d8201);})[_0xae92('0xa')](function(_0x43870f){_0x2e249c(_0x43870f);});});}return _0x3eeea9[_0xae92('0x85')](_0xae92('0x86'),attributes,{'tableName':_0xae92('0x87'),'paranoid':![],'indexes':[],'timestamps':!![],'classMethods':{'getResources':function(_0x518a03){var _0xc7fb9a=require(_0xae92('0x88'));var _0x26dcb4={'raw':_0x518a03[_0xae92('0x83')][_0xae92('0x89')],'where':{}};var _0x5e08ef={};var _0x5a2547={'count':0x0,'rows':[]};var _0x155084=_0x518a03[_0xae92('0x83')][_0xae92('0x8a')];var _0x2ffa20=_0x518a03[_0xae92('0x83')]['mergeResources']||![];var _0x405d06=_0x16074b(_0x155084,_0x2ffa20);if(!_0x405d06[_0xae92('0x11')])throw new Error(_0xae92('0x8b')+_0x155084+'\x27');var _0x10b149=[{'name':_0x155084}];if(!_[_0xae92('0x8c')](_0x405d06[_0xae92('0x15')]))_0x10b149=_0x405d06[_0xae92('0x15')];var _0x33e5dd=[];for(var _0x279fe7=0x0;_0x279fe7<_0x10b149[_0xae92('0x8d')];_0x279fe7++){_0x33e5dd[_0xae92('0x8e')](_0x46bf9d['UserProfileSection'][_0xae92('0x8f')]({'where':{'userProfileId':_0x518a03[_0xae92('0x90')]['id'],'name':_0x10b149[_0x279fe7][_0xae92('0xc')]},'raw':!![]}));}return Promise[_0xae92('0x91')](_0x33e5dd)[_0xae92('0xe')](function(_0x21d7e1){var _0x2ec7d3=_[_0xae92('0x5')](_0x21d7e1,function(_0x45e440){return _0x45e440?_0x45e440:undefined;});var _0x5e8f6c=_['filter'](_0x10b149,[_0xae92('0x92'),!![]]);var _0x22ff0f=_[_0xae92('0x8c')](_0x2ec7d3)&&_[_0xae92('0x8c')](_0x5e8f6c)?null:_[_0xae92('0x93')](_0x5e8f6c,_0x2ec7d3);if(!_0x22ff0f)return null;var _0x1c5f46=[];for(var _0x4100e8=0x0;_0x4100e8<_0x22ff0f['length'];_0x4100e8++){var _0x3e7c03=_[_0xae92('0x8f')](_0x10b149,function(_0x369ac6){return _0x22ff0f[_0x4100e8]?_0x369ac6['name']===_0x22ff0f[_0x4100e8][_0xae92('0xc')]:null;});if(_0x3e7c03){if(_0x22ff0f[_0x4100e8][_0xae92('0x92')]){_0x1c5f46[_0xae92('0x8e')](_0x17495f(_0x405d06[_0xae92('0x11')],_0x22ff0f[_0x4100e8]));}else{if(!_0x22ff0f[_0x4100e8][_0xae92('0x94')]){_0x1c5f46[_0xae92('0x8e')](_0x1c2986(_0x3e7c03,_0x22ff0f[_0x4100e8],_0x405d06[_0xae92('0x11')]));}else{if(_0x3e7c03[_0xae92('0xb')]){_0x1c5f46[_0xae92('0x8e')](_0x2276e0(_0x3e7c03,_0x22ff0f[_0x4100e8]));}}}}}return Promise[_0xae92('0x91')](_0x1c5f46);})['then'](function(_0x45bfef){var _0x2f1035=_0x45bfef;var _0x3dc38e=null;if(_0x2f1035){_0x3dc38e=_0x2f1035[_0xae92('0x8d')]===0x1?_0x2f1035[0x0]:null;}if(!_0x3dc38e&&!_0x2f1035)return _0x5a2547;var _0x599334=_0x46bf9d[_0x405d06[_0xae92('0x11')]]['rawAttributes'];_0x5e08ef[_0xae92('0xb')]=_[_0xae92('0x95')](_0x599334);_0x5e08ef[_0xae92('0x83')]=_[_0xae92('0x95')](_0x518a03[_0xae92('0x83')]);_0x5e08ef[_0xae92('0x96')]=_['intersection'](_0x5e08ef['model'],_0x5e08ef['query']);_0x26dcb4[_0xae92('0x97')]=_[_0xae92('0x98')](_0x5e08ef[_0xae92('0xb')],_0xc7fb9a[_0xae92('0x99')](_0x518a03[_0xae92('0x83')][_0xae92('0x99')]));_0x26dcb4[_0xae92('0x97')]=_0x26dcb4[_0xae92('0x97')][_0xae92('0x8d')]?_0x26dcb4[_0xae92('0x97')]:_0x5e08ef['model'];if(!_0x518a03[_0xae92('0x83')][_0xae92('0x9a')](_0xae92('0x9b'))){_0x26dcb4[_0xae92('0x9c')]=_0xc7fb9a[_0xae92('0x9c')](_0x518a03[_0xae92('0x83')]['limit']);_0x26dcb4[_0xae92('0x9d')]=_0xc7fb9a['offset'](_0x518a03[_0xae92('0x83')][_0xae92('0x9d')]);}_0x26dcb4['order']=_0xc7fb9a[_0xae92('0x9e')](_0x518a03[_0xae92('0x83')][_0xae92('0x9e')]);_0x26dcb4[_0xae92('0x81')]=_0xc7fb9a[_0xae92('0x96')](_[_0xae92('0x9f')](_0x518a03[_0xae92('0x83')],_0x5e08ef[_0xae92('0x96')]));if(_0x518a03['query']['filter']){_0x26dcb4[_0xae92('0x81')]=_[_0xae92('0xa0')](_0x26dcb4[_0xae92('0x81')],{'$or':_[_0xae92('0x9')](_0x599334,function(_0x12e340){if(_0x12e340[_0xae92('0xf')][_0xae92('0xa1')]!=='VIRTUAL'){var _0x4950a5={};_0x4950a5[_0x12e340[_0xae92('0x6')]]={'$like':'%'+_0x518a03[_0xae92('0x83')][_0xae92('0x5')]+'%'};return _0x4950a5;}})});}var _0x423333=[];var _0x37db9f=null;var _0x236fa6={};if(_0x3dc38e){_0x37db9f=_['find'](_0x10b149,[_0xae92('0xc'),_0x3dc38e[_0xae92('0xc')]]);if(_0x37db9f['field']){_0x236fa6={};if(_0x405d06[_0xae92('0x11')]===_0xae92('0x72')){_0x236fa6[_0x37db9f[_0xae92('0xa2')]]=_[_0xae92('0x9')](_0x3dc38e[_0xae92('0x8')],'id');}else{_0x236fa6[_0x37db9f[_0xae92('0xa2')]]=_0x3dc38e[_0xae92('0x8')];}_0x423333['push'](_0x236fa6);}else{_0x26dcb4[_0xae92('0x81')]['id']=_0x3dc38e['associatedResources'];}}else{for(var _0x28c3ac=0x0;_0x28c3ac<_0x2f1035['length'];_0x28c3ac++){_0x37db9f=_[_0xae92('0x8f')](_0x10b149,[_0xae92('0xc'),_0x2f1035[_0x28c3ac][_0xae92('0xc')]]);if(_0x37db9f[_0xae92('0x6')]){_0x236fa6={};_0x236fa6[_0x37db9f['foreignKey']]=_0x2f1035[_0x28c3ac][_0xae92('0x8')];_0x423333[_0xae92('0x8e')](_0x236fa6);}else{if(!_0x26dcb4[_0xae92('0x81')]['id'])_0x26dcb4['where']['id']=[];_0x2f1035[_0x28c3ac][_0xae92('0x8')][_0xae92('0xa3')](function(_0x184dc8){_0x26dcb4['where']['id'][_0xae92('0x8e')](_0x184dc8);});}}}if(!_[_0xae92('0x8c')](_0x423333)){_0x26dcb4[_0xae92('0x81')]=_[_0xae92('0xa0')](_0x26dcb4[_0xae92('0x81')],{'$and':{'$or':_0x423333}});}_0x26dcb4=_[_0xae92('0xa0')]({},_0x26dcb4,_0x518a03['options']);if(_0x3dc38e&&!_0x3dc38e[_0xae92('0x94')]&&_0x405d06[_0xae92('0x11')]===_0xae92('0x72')){if(_0x518a03[_0xae92('0x83')][_0xae92('0xa4')]){_0x26dcb4[_0xae92('0xa5')]=[{'all':!![]}];}return _0x46bf9d[_0x405d06[_0xae92('0x11')]]['findAll'](_0x26dcb4)[_0xae92('0xe')](function(_0x47bbad){var _0x432893=[];_0x47bbad[_0xae92('0xa3')](function(_0x43b48d){var _0x5b3c08;switch(_0x43b48d['reportType']){case _0xae92('0xa6'):_0x5b3c08=_[_0xae92('0x8f')](_0x3dc38e[_0xae92('0x8')],function(_0x4f5b6a){return _0x4f5b6a['id']===_0x43b48d['reportId']&&_0x4f5b6a[_0xae92('0xf')]===_0xae92('0xa7');});break;case _0xae92('0xa8'):_0x5b3c08=_[_0xae92('0x8f')](_0x3dc38e[_0xae92('0x8')],function(_0x3eab84){return _0x3eab84['id']===_0x43b48d['reportId']&&_0x3eab84[_0xae92('0xf')]===_0xae92('0xa9');});break;}if(_0x5b3c08)_0x432893[_0xae92('0x8e')](_0x43b48d);});_0x5a2547[_0xae92('0xaa')]=_0x432893[_0xae92('0x8d')];_0x5a2547[_0xae92('0xab')]=_0x432893;return _0x5a2547;});}else{if(!_[_0xae92('0x8c')](_0x518a03[_0xae92('0x83')]['ids'])){_0x26dcb4['where']['id']=_0x26dcb4[_0xae92('0x81')]['id']?_[_0xae92('0x98')](_0x26dcb4['where']['id'],_0x518a03[_0xae92('0x83')][_0xae92('0xac')]):_0x518a03['query'][_0xae92('0xac')];if(_0x518a03[_0xae92('0x83')][_0xae92('0xad')]){_0x26dcb4[_0xae92('0xae')]=_0x518a03[_0xae92('0x83')][_0xae92('0xad')];}}if(_0x518a03[_0xae92('0x83')][_0xae92('0xaf')]){_0x26dcb4[_0xae92('0x81')]=_[_0xae92('0xa0')](_0x26dcb4[_0xae92('0x81')],{'$and':_0x518a03[_0xae92('0x83')][_0xae92('0xaf')]});}return _0x46bf9d[_0x405d06['childModel']][_0xae92('0xaa')]({'where':_0x26dcb4[_0xae92('0x81')]})[_0xae92('0xe')](function(_0x4945ce){_0x5a2547[_0xae92('0xaa')]=_0x4945ce;if(_0x518a03[_0xae92('0x83')][_0xae92('0xa4')]){if(_0x405d06[_0xae92('0x11')]===_0xae92('0x19')){_0x26dcb4[_0xae92('0xa5')]=[{'model':_0x46bf9d[_0xae92('0x69')],'as':'Tags','attributes':['id',_0xae92('0xc'),_0xae92('0xb0')],'required':_0x518a03['query']['tag']?!![]:![]},{'model':_0x46bf9d[_0xae92('0x69')],'as':_0xae92('0xb1'),'attributes':['id',_0xae92('0xc'),_0xae92('0xb0')],'through':_0x518a03[_0xae92('0x83')]['tag']?{'attributes':[],'where':{'TagId':_0x518a03[_0xae92('0x83')][_0xae92('0xb2')]||undefined}}:{},'required':_0x518a03[_0xae92('0x83')][_0xae92('0xb2')]?!![]:![]}];}else{_0x26dcb4['include']=[{'all':!![]}];}}return _0x46bf9d[_0x405d06[_0xae92('0x11')]][_0xae92('0xb3')](_0x26dcb4);})['then'](function(_0x33aed4){_0x5a2547[_0xae92('0xab')]=_0x33aed4;if(_0x155084===_0xae92('0x2e')&&_0x518a03[_0xae92('0x83')][_0xae92('0xb4')]==='true'){var _0x174e0b=[];for(var _0x4b80c4=0x0;_0x4b80c4<_0x5a2547[_0xae92('0xab')][_0xae92('0x8d')];_0x4b80c4++){_0x174e0b[_0xae92('0x8e')](_0x383237(_0xae92('0xb5'),_0x5a2547[_0xae92('0xab')][_0x4b80c4]['dataValues']));_0x174e0b[_0xae92('0x8e')](_0x383237(_0xae92('0xb6'),_0x5a2547[_0xae92('0xab')][_0x4b80c4]['dataValues']));_0x174e0b['push'](_0x383237(_0xae92('0xb7'),_0x5a2547[_0xae92('0xab')][_0x4b80c4]['dataValues']));_0x174e0b['push'](_0x383237(_0xae92('0xb8'),_0x5a2547[_0xae92('0xab')][_0x4b80c4]['dataValues']));_0x174e0b[_0xae92('0x8e')](_0x383237(_0xae92('0xb9'),_0x5a2547[_0xae92('0xab')][_0x4b80c4][_0xae92('0xba')]));_0x174e0b[_0xae92('0x8e')](_0x383237('whatsapp',_0x5a2547['rows'][_0x4b80c4][_0xae92('0xba')]));}return Promise[_0xae92('0x91')](_0x174e0b)[_0xae92('0xe')](function(){return _0x5a2547;});}return _0x5a2547;});}});}}});}; \ No newline at end of file diff --git a/server/api/userProfile/userProfile.rpc.js b/server/api/userProfile/userProfile.rpc.js index a431550..52115cd 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 _0xff01=['catch','lodash','util','bluebird','ioredis','../../mysqldb','../../config/utils','rpc','jayson/promise','http','redis','localhost','./userProfile.socket','register','request','then','info','UserProfile,\x20%s,\x20%s','request\x20sent','debug','UserProfile,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result'];(function(_0x5db0db,_0x1c585a){var _0x3fbd1a=function(_0x590e6a){while(--_0x590e6a){_0x5db0db['push'](_0x5db0db['shift']());}};_0x3fbd1a(++_0x1c585a);}(_0xff01,0xb7));var _0x1ff0=function(_0x32b78d,_0x32595c){_0x32b78d=_0x32b78d-0x0;var _0x34ee90=_0xff01[_0x32b78d];return _0x34ee90;};'use strict';var _=require(_0x1ff0('0x0'));var util=require(_0x1ff0('0x1'));var moment=require('moment');var BPromise=require(_0x1ff0('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x1ff0('0x3'));var db=require(_0x1ff0('0x4'))['db'];var utils=require(_0x1ff0('0x5'));var logger=require('../../config/logger')(_0x1ff0('0x6'));var config=require('../../config/environment');var jayson=require(_0x1ff0('0x7'));var client=jayson['client'][_0x1ff0('0x8')]({'port':0x232a});config['redis']=_['defaults'](config[_0x1ff0('0x9')],{'host':_0x1ff0('0xa'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x1ff0('0x9')]));require(_0x1ff0('0xb'))[_0x1ff0('0xc')](socket);function respondWithRpcPromise(_0x200b69,_0xa163fc,_0x52a6ff){return new BPromise(function(_0xcf03ac,_0x5d46af){return client[_0x1ff0('0xd')](_0x200b69,_0x52a6ff)[_0x1ff0('0xe')](function(_0xb498fb){logger[_0x1ff0('0xf')](_0x1ff0('0x10'),_0xa163fc,_0x1ff0('0x11'));logger[_0x1ff0('0x12')](_0x1ff0('0x13'),_0xa163fc,_0x1ff0('0x11'),JSON[_0x1ff0('0x14')](_0xb498fb));if(_0xb498fb['error']){if(_0xb498fb[_0x1ff0('0x15')][_0x1ff0('0x16')]===0x1f4){logger[_0x1ff0('0x15')](_0x1ff0('0x10'),_0xa163fc,_0xb498fb['error'][_0x1ff0('0x17')]);return _0x5d46af(_0xb498fb[_0x1ff0('0x15')]['message']);}logger[_0x1ff0('0x15')](_0x1ff0('0x10'),_0xa163fc,_0xb498fb[_0x1ff0('0x15')]['message']);return _0xcf03ac(_0xb498fb['error'][_0x1ff0('0x17')]);}else{logger[_0x1ff0('0xf')]('UserProfile,\x20%s,\x20%s',_0xa163fc,_0x1ff0('0x11'));_0xcf03ac(_0xb498fb[_0x1ff0('0x18')][_0x1ff0('0x17')]);}})[_0x1ff0('0x19')](function(_0x580215){logger['error']('UserProfile,\x20%s,\x20%s',_0xa163fc,_0x580215);_0x5d46af(_0x580215);});});} \ No newline at end of file +var _0x8710=['stringify','error','message','catch','lodash','util','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','../../config/environment','client','http','redis','defaults','localhost','./userProfile.socket','register','request','then','UserProfile,\x20%s,\x20%s','request\x20sent','debug','UserProfile,\x20%s,\x20%s,\x20%s'];(function(_0x36e39a,_0x1fd6c0){var _0x4a0db1=function(_0x1aefa0){while(--_0x1aefa0){_0x36e39a['push'](_0x36e39a['shift']());}};_0x4a0db1(++_0x1fd6c0);}(_0x8710,0x68));var _0x0871=function(_0x1e2113,_0x597af8){_0x1e2113=_0x1e2113-0x0;var _0x266390=_0x8710[_0x1e2113];return _0x266390;};'use strict';var _=require(_0x0871('0x0'));var util=require(_0x0871('0x1'));var moment=require('moment');var BPromise=require(_0x0871('0x2'));var rs=require(_0x0871('0x3'));var fs=require('fs');var Redis=require(_0x0871('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x0871('0x5'));var logger=require(_0x0871('0x6'))('rpc');var config=require(_0x0871('0x7'));var jayson=require('jayson/promise');var client=jayson[_0x0871('0x8')][_0x0871('0x9')]({'port':0x232a});config[_0x0871('0xa')]=_[_0x0871('0xb')](config[_0x0871('0xa')],{'host':_0x0871('0xc'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x0871('0xa')]));require(_0x0871('0xd'))[_0x0871('0xe')](socket);function respondWithRpcPromise(_0x21b5ba,_0xd80c43,_0x4df538){return new BPromise(function(_0x8488f2,_0x34d018){return client[_0x0871('0xf')](_0x21b5ba,_0x4df538)[_0x0871('0x10')](function(_0x401936){logger['info'](_0x0871('0x11'),_0xd80c43,_0x0871('0x12'));logger[_0x0871('0x13')](_0x0871('0x14'),_0xd80c43,_0x0871('0x12'),JSON[_0x0871('0x15')](_0x401936));if(_0x401936[_0x0871('0x16')]){if(_0x401936[_0x0871('0x16')]['code']===0x1f4){logger['error'](_0x0871('0x11'),_0xd80c43,_0x401936[_0x0871('0x16')][_0x0871('0x17')]);return _0x34d018(_0x401936[_0x0871('0x16')][_0x0871('0x17')]);}logger[_0x0871('0x16')](_0x0871('0x11'),_0xd80c43,_0x401936[_0x0871('0x16')][_0x0871('0x17')]);return _0x8488f2(_0x401936['error'][_0x0871('0x17')]);}else{logger['info'](_0x0871('0x11'),_0xd80c43,_0x0871('0x12'));_0x8488f2(_0x401936['result'][_0x0871('0x17')]);}})[_0x0871('0x18')](function(_0x10ad02){logger[_0x0871('0x16')]('UserProfile,\x20%s,\x20%s',_0xd80c43,_0x10ad02);_0x34d018(_0x10ad02);});});} \ No newline at end of file diff --git a/server/api/userProfile/userProfile.socket.js b/server/api/userProfile/userProfile.socket.js index e2c902a..7546c2b 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 _0x7fa9=['removeListener','register','userProfile:','./userProfile.events','save','remove','update','emit'];(function(_0x478edd,_0x5d8cf8){var _0x479429=function(_0x595eb9){while(--_0x595eb9){_0x478edd['push'](_0x478edd['shift']());}};_0x479429(++_0x5d8cf8);}(_0x7fa9,0x103));var _0x97fa=function(_0x1a79bb,_0x27d95d){_0x1a79bb=_0x1a79bb-0x0;var _0x3058de=_0x7fa9[_0x1a79bb];return _0x3058de;};'use strict';var UserProfileEvents=require(_0x97fa('0x0'));var events=[_0x97fa('0x1'),_0x97fa('0x2'),_0x97fa('0x3')];function createListener(_0x3959d9,_0x42490c){return function(_0x37b359){_0x42490c[_0x97fa('0x4')](_0x3959d9,_0x37b359);};}function removeListener(_0x4183f2,_0x33f570){return function(){UserProfileEvents[_0x97fa('0x5')](_0x4183f2,_0x33f570);};}exports[_0x97fa('0x6')]=function(_0x20a28e){for(var _0x213f8d=0x0,_0x223756=events['length'];_0x213f8d<_0x223756;_0x213f8d++){var _0x2634ef=events[_0x213f8d];var _0x965486=createListener(_0x97fa('0x7')+_0x2634ef,_0x20a28e);UserProfileEvents['on'](_0x2634ef,_0x965486);}}; \ No newline at end of file +var _0xa995=['register','length','userProfile:','./userProfile.events','save','remove','emit','removeListener'];(function(_0x4129df,_0x480144){var _0x34cede=function(_0x3ee829){while(--_0x3ee829){_0x4129df['push'](_0x4129df['shift']());}};_0x34cede(++_0x480144);}(_0xa995,0x1b3));var _0x5a99=function(_0x3a1260,_0x3411ce){_0x3a1260=_0x3a1260-0x0;var _0x3bcc16=_0xa995[_0x3a1260];return _0x3bcc16;};'use strict';var UserProfileEvents=require(_0x5a99('0x0'));var events=[_0x5a99('0x1'),_0x5a99('0x2'),'update'];function createListener(_0x49222f,_0x40e6e8){return function(_0x27a781){_0x40e6e8[_0x5a99('0x3')](_0x49222f,_0x27a781);};}function removeListener(_0x20f08f,_0x771b82){return function(){UserProfileEvents[_0x5a99('0x4')](_0x20f08f,_0x771b82);};}exports[_0x5a99('0x5')]=function(_0x411287){for(var _0x391edc=0x0,_0x1e7ef4=events[_0x5a99('0x6')];_0x391edc<_0x1e7ef4;_0x391edc++){var _0x837433=events[_0x391edc];var _0x1c49f8=createListener(_0x5a99('0x7')+_0x837433,_0x411287);UserProfileEvents['on'](_0x837433,_0x1c49f8);}}; \ No newline at end of file diff --git a/server/api/userProfileResource/index.js b/server/api/userProfileResource/index.js index 0f68067..b983363 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 _0xdf15=['/describe','/:id','show','post','create','put','update','delete','exports','multer','util','path','connect-timeout','Router','../../components/interaction/service','./userProfileResource.controller','get','isAuthenticated','index'];(function(_0x44c935,_0x3653f0){var _0x465bee=function(_0x211d20){while(--_0x211d20){_0x44c935['push'](_0x44c935['shift']());}};_0x465bee(++_0x3653f0);}(_0xdf15,0x185));var _0x5df1=function(_0x2a3311,_0x272275){_0x2a3311=_0x2a3311-0x0;var _0x1143a=_0xdf15[_0x2a3311];return _0x1143a;};'use strict';var multer=require(_0x5df1('0x0'));var util=require(_0x5df1('0x1'));var path=require(_0x5df1('0x2'));var timeout=require(_0x5df1('0x3'));var express=require('express');var router=express[_0x5df1('0x4')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0x5df1('0x5'));var config=require('../../config/environment');var controller=require(_0x5df1('0x6'));router[_0x5df1('0x7')]('/',auth[_0x5df1('0x8')](),controller[_0x5df1('0x9')]);router[_0x5df1('0x7')](_0x5df1('0xa'),auth[_0x5df1('0x8')](),controller['describe']);router[_0x5df1('0x7')](_0x5df1('0xb'),auth['isAuthenticated'](),controller[_0x5df1('0xc')]);router[_0x5df1('0xd')]('/',auth[_0x5df1('0x8')](),controller[_0x5df1('0xe')]);router[_0x5df1('0xf')]('/:id',auth[_0x5df1('0x8')](),controller[_0x5df1('0x10')]);router[_0x5df1('0x11')](_0x5df1('0xb'),auth[_0x5df1('0x8')](),controller['destroy']);module[_0x5df1('0x12')]=router; \ No newline at end of file +var _0xdd20=['show','post','create','put','update','destroy','exports','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./userProfileResource.controller','get','isAuthenticated','index','/describe','describe','/:id'];(function(_0x1e5cc3,_0x238a87){var _0x15c596=function(_0x27bb04){while(--_0x27bb04){_0x1e5cc3['push'](_0x1e5cc3['shift']());}};_0x15c596(++_0x238a87);}(_0xdd20,0x1a5));var _0x0dd2=function(_0x35edea,_0x2d17f2){_0x35edea=_0x35edea-0x0;var _0x388fd5=_0xdd20[_0x35edea];return _0x388fd5;};'use strict';var multer=require('multer');var util=require(_0x0dd2('0x0'));var path=require(_0x0dd2('0x1'));var timeout=require(_0x0dd2('0x2'));var express=require(_0x0dd2('0x3'));var router=express[_0x0dd2('0x4')]();var fs_extra=require(_0x0dd2('0x5'));var auth=require(_0x0dd2('0x6'));var interaction=require(_0x0dd2('0x7'));var config=require(_0x0dd2('0x8'));var controller=require(_0x0dd2('0x9'));router[_0x0dd2('0xa')]('/',auth[_0x0dd2('0xb')](),controller[_0x0dd2('0xc')]);router[_0x0dd2('0xa')](_0x0dd2('0xd'),auth[_0x0dd2('0xb')](),controller[_0x0dd2('0xe')]);router[_0x0dd2('0xa')](_0x0dd2('0xf'),auth[_0x0dd2('0xb')](),controller[_0x0dd2('0x10')]);router[_0x0dd2('0x11')]('/',auth[_0x0dd2('0xb')](),controller[_0x0dd2('0x12')]);router[_0x0dd2('0x13')](_0x0dd2('0xf'),auth[_0x0dd2('0xb')](),controller[_0x0dd2('0x14')]);router['delete'](_0x0dd2('0xf'),auth['isAuthenticated'](),controller[_0x0dd2('0x15')]);module[_0x0dd2('0x16')]=router; \ No newline at end of file diff --git a/server/api/userProfileResource/userProfileResource.attributes.js b/server/api/userProfileResource/userProfileResource.attributes.js index c4d996a..96b37da 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 _0xb4a3=['exports','STRING'];(function(_0x5cf31d,_0x159233){var _0x3a157a=function(_0x5cd18f){while(--_0x5cd18f){_0x5cf31d['push'](_0x5cf31d['shift']());}};_0x3a157a(++_0x159233);}(_0xb4a3,0x168));var _0x3b4a=function(_0x2f1762,_0xab43df){_0x2f1762=_0x2f1762-0x0;var _0x8ab21=_0xb4a3[_0x2f1762];return _0x8ab21;};'use strict';var Sequelize=require('sequelize');module[_0x3b4a('0x0')]={'name':{'type':Sequelize[_0x3b4a('0x1')],'allowNull':![]},'resourceId':{'type':Sequelize['INTEGER'],'allowNull':![]},'type':{'type':Sequelize[_0x3b4a('0x1')],'allowNull':![]}}; \ No newline at end of file +var _0xf88a=['STRING','sequelize'];(function(_0x3bf83f,_0x181cac){var _0x22c4a9=function(_0xb3ff0d){while(--_0xb3ff0d){_0x3bf83f['push'](_0x3bf83f['shift']());}};_0x22c4a9(++_0x181cac);}(_0xf88a,0x111));var _0xaf88=function(_0x2083c4,_0x379560){_0x2083c4=_0x2083c4-0x0;var _0x49c74d=_0xf88a[_0x2083c4];return _0x49c74d;};'use strict';var Sequelize=require(_0xaf88('0x0'));module['exports']={'name':{'type':Sequelize[_0xaf88('0x1')],'allowNull':![]},'resourceId':{'type':Sequelize['INTEGER'],'allowNull':![]},'type':{'type':Sequelize[_0xaf88('0x1')],'allowNull':![]}}; \ No newline at end of file diff --git a/server/api/userProfileResource/userProfileResource.controller.js b/server/api/userProfileResource/userProfileResource.controller.js index 75e5408..f910be5 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 _0x9f0e=['../../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','UserProfileResource','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','describe','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','mustache','util','path','sox','to-csv','lodash','squel','crypto','desk.js','querystring','papaparse','ioredis','../../components/auth/service'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x9f0e,0x116));var _0xe9f0=function(_0x51a001,_0x3669b9){_0x51a001=_0x51a001-0x0;var _0x31b1f3=_0x9f0e[_0x51a001];return _0x31b1f3;};'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['UserProfileResource'][_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['UserProfileResource'][_0xe9f0('0x45')](_0x314f0e)['then'](handleEntityNotFound(_0x52613a,null))[_0xe9f0('0x24')](respondWithResult(_0x52613a,null))['catch'](handleError(_0x52613a,null));};exports[_0xe9f0('0x46')]=function(_0x2023b4,_0x422324){return db['UserProfileResource'][_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));};exports[_0xe9f0('0x49')]=function(_0x5163ea,_0x2bf65c){return db[_0xe9f0('0x2c')][_0xe9f0('0x49')]()[_0xe9f0('0x24')](respondWithResult(_0x2bf65c,null))['catch'](handleError(_0x2bf65c,null));}; \ No newline at end of file +var _0x01d9=['rawAttributes','fieldName','type','key','model','query','keys','intersection','fields','attributes','length','nolimit','order','sort','where','filters','pick','filter','merge','VIRTUAL','options','include','catch','show','params','includeAll','find','create','body','describe','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','path','sox','to-csv','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','set','apply','save','update','then','destroy','error','name','send','index','map','UserProfileResource'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0x01d9,0x6c));var _0x901d=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0x01d9[_0x321bb2];return _0x9c12ed;};'use strict';var emlformat=require(_0x901d('0x0'));var rimraf=require(_0x901d('0x1'));var zipdir=require(_0x901d('0x2'));var jsonpatch=require(_0x901d('0x3'));var rp=require('request-promise');var moment=require(_0x901d('0x4'));var BPromise=require(_0x901d('0x5'));var Mustache=require(_0x901d('0x6'));var util=require(_0x901d('0x7'));var path=require(_0x901d('0x8'));var sox=require(_0x901d('0x9'));var csv=require(_0x901d('0xa'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x901d('0xb'));var _=require(_0x901d('0xc'));var squel=require(_0x901d('0xd'));var crypto=require(_0x901d('0xe'));var jsforce=require(_0x901d('0xf'));var deskjs=require(_0x901d('0x10'));var toCsv=require(_0x901d('0xa'));var querystring=require(_0x901d('0x11'));var Papa=require(_0x901d('0x12'));var Redis=require(_0x901d('0x13'));var authService=require(_0x901d('0x14'));var qs=require(_0x901d('0x15'));var as=require(_0x901d('0x16'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x901d('0x17'))('api');var utils=require(_0x901d('0x18'));var config=require(_0x901d('0x19'));var licenseUtil=require(_0x901d('0x1a'));var db=require(_0x901d('0x1b'))['db'];function respondWithStatusCode(_0x15ebaf,_0x5d2345){_0x5d2345=_0x5d2345||0xcc;return function(_0x1d8117){if(_0x1d8117){return _0x15ebaf[_0x901d('0x1c')](_0x5d2345);}return _0x15ebaf[_0x901d('0x1d')](_0x5d2345)[_0x901d('0x1e')]();};}function respondWithResult(_0xb8869a,_0x14d99b){_0x14d99b=_0x14d99b||0xc8;return function(_0x530a2b){if(_0x530a2b){return _0xb8869a[_0x901d('0x1d')](_0x14d99b)[_0x901d('0x1f')](_0x530a2b);}};}function respondWithFilteredResult(_0x11b0cc,_0x17d451){return function(_0x1aba97){if(_0x1aba97){var _0x7dd5f4=typeof _0x17d451[_0x901d('0x20')]===_0x901d('0x21')&&typeof _0x17d451[_0x901d('0x22')]===_0x901d('0x21');var _0x28caae=_0x1aba97[_0x901d('0x23')];var _0x285353=_0x7dd5f4?0x0:_0x17d451[_0x901d('0x20')];var _0x38f42b=_0x7dd5f4?_0x1aba97[_0x901d('0x23')]:_0x17d451[_0x901d('0x20')]+_0x17d451[_0x901d('0x22')];var _0x57d518;if(_0x38f42b>=_0x28caae){_0x38f42b=_0x28caae;_0x57d518=0xc8;}else{_0x57d518=0xce;}_0x11b0cc[_0x901d('0x1d')](_0x57d518);return _0x11b0cc[_0x901d('0x24')]('Content-Range',_0x285353+'-'+_0x38f42b+'/'+_0x28caae)['json'](_0x1aba97);}return null;};}function patchUpdates(_0x496a06){return function(_0x53f8ae){try{jsonpatch[_0x901d('0x25')](_0x53f8ae,_0x496a06,!![]);}catch(_0x44ea6f){return BPromise['reject'](_0x44ea6f);}return _0x53f8ae[_0x901d('0x26')]();};}function saveUpdates(_0x3ea3f6,_0x488e24){return function(_0x20778b){if(_0x20778b){return _0x20778b[_0x901d('0x27')](_0x3ea3f6)[_0x901d('0x28')](function(_0x3f80b9){return _0x3f80b9;});}return null;};}function removeEntity(_0x1e7d36,_0x1818d3){return function(_0x46e5c6){if(_0x46e5c6){return _0x46e5c6[_0x901d('0x29')]()['then'](function(){_0x1e7d36[_0x901d('0x1d')](0xcc)[_0x901d('0x1e')]();});}};}function handleEntityNotFound(_0xbc89a5,_0x1f0ee5){return function(_0x557809){if(!_0x557809){_0xbc89a5[_0x901d('0x1c')](0x194);}return _0x557809;};}function handleError(_0x23fd43,_0x27f4ca){_0x27f4ca=_0x27f4ca||0x1f4;return function(_0x3cbe43){logger[_0x901d('0x2a')](_0x3cbe43['stack']);if(_0x3cbe43[_0x901d('0x2b')]){delete _0x3cbe43[_0x901d('0x2b')];}_0x23fd43[_0x901d('0x1d')](_0x27f4ca)[_0x901d('0x2c')](_0x3cbe43);};}exports[_0x901d('0x2d')]=function(_0x3de9b9,_0x48e86e){var _0xae6dfe={},_0x533038={},_0x128830={'count':0x0,'rows':[]};var _0x389fd9=_[_0x901d('0x2e')](db[_0x901d('0x2f')][_0x901d('0x30')],function(_0x20df02){return{'name':_0x20df02[_0x901d('0x31')],'type':_0x20df02[_0x901d('0x32')][_0x901d('0x33')]};});_0x533038[_0x901d('0x34')]=_[_0x901d('0x2e')](_0x389fd9,_0x901d('0x2b'));_0x533038[_0x901d('0x35')]=_[_0x901d('0x36')](_0x3de9b9[_0x901d('0x35')]);_0x533038['filters']=_[_0x901d('0x37')](_0x533038[_0x901d('0x34')],_0x533038[_0x901d('0x35')]);_0xae6dfe['attributes']=_[_0x901d('0x37')](_0x533038[_0x901d('0x34')],qs[_0x901d('0x38')](_0x3de9b9[_0x901d('0x35')][_0x901d('0x38')]));_0xae6dfe[_0x901d('0x39')]=_0xae6dfe[_0x901d('0x39')][_0x901d('0x3a')]?_0xae6dfe[_0x901d('0x39')]:_0x533038[_0x901d('0x34')];if(!_0x3de9b9['query']['hasOwnProperty'](_0x901d('0x3b'))){_0xae6dfe['limit']=qs[_0x901d('0x22')](_0x3de9b9[_0x901d('0x35')]['limit']);_0xae6dfe[_0x901d('0x20')]=qs[_0x901d('0x20')](_0x3de9b9[_0x901d('0x35')]['offset']);}_0xae6dfe[_0x901d('0x3c')]=qs[_0x901d('0x3d')](_0x3de9b9[_0x901d('0x35')][_0x901d('0x3d')]);_0xae6dfe[_0x901d('0x3e')]=qs[_0x901d('0x3f')](_[_0x901d('0x40')](_0x3de9b9[_0x901d('0x35')],_0x533038[_0x901d('0x3f')]),_0x389fd9);if(_0x3de9b9[_0x901d('0x35')][_0x901d('0x41')]){_0xae6dfe[_0x901d('0x3e')]=_[_0x901d('0x42')](_0xae6dfe[_0x901d('0x3e')],{'$or':_[_0x901d('0x2e')](_0x389fd9,function(_0x1644d8){if(_0x1644d8['type']!==_0x901d('0x43')){var _0x423cab={};_0x423cab[_0x1644d8['name']]={'$like':'%'+_0x3de9b9['query'][_0x901d('0x41')]+'%'};return _0x423cab;}})});}_0xae6dfe=_['merge']({},_0xae6dfe,_0x3de9b9[_0x901d('0x44')]);var _0x3d0556={'where':_0xae6dfe[_0x901d('0x3e')]};return db[_0x901d('0x2f')][_0x901d('0x23')](_0x3d0556)[_0x901d('0x28')](function(_0x5df4cb){_0x128830['count']=_0x5df4cb;if(_0x3de9b9['query']['includeAll']){_0xae6dfe[_0x901d('0x45')]=[{'all':!![]}];}return db[_0x901d('0x2f')]['findAll'](_0xae6dfe);})[_0x901d('0x28')](function(_0x22fc44){_0x128830['rows']=_0x22fc44;return _0x128830;})[_0x901d('0x28')](respondWithFilteredResult(_0x48e86e,_0xae6dfe))[_0x901d('0x46')](handleError(_0x48e86e,null));};exports[_0x901d('0x47')]=function(_0x2c1895,_0x53663d){var _0x5aeb41={'raw':![],'where':{'id':_0x2c1895[_0x901d('0x48')]['id']}},_0xa9c008={};_0xa9c008[_0x901d('0x34')]=_[_0x901d('0x36')](db[_0x901d('0x2f')][_0x901d('0x30')]);_0xa9c008[_0x901d('0x35')]=_[_0x901d('0x36')](_0x2c1895[_0x901d('0x35')]);_0xa9c008[_0x901d('0x3f')]=_[_0x901d('0x37')](_0xa9c008['model'],_0xa9c008[_0x901d('0x35')]);_0x5aeb41['attributes']=_[_0x901d('0x37')](_0xa9c008['model'],qs[_0x901d('0x38')](_0x2c1895['query'][_0x901d('0x38')]));_0x5aeb41[_0x901d('0x39')]=_0x5aeb41[_0x901d('0x39')][_0x901d('0x3a')]?_0x5aeb41[_0x901d('0x39')]:_0xa9c008[_0x901d('0x34')];if(_0x2c1895[_0x901d('0x35')][_0x901d('0x49')]){_0x5aeb41[_0x901d('0x45')]=[{'all':!![]}];}_0x5aeb41=_[_0x901d('0x42')]({},_0x5aeb41,_0x2c1895[_0x901d('0x44')]);return db['UserProfileResource'][_0x901d('0x4a')](_0x5aeb41)[_0x901d('0x28')](handleEntityNotFound(_0x53663d,null))[_0x901d('0x28')](respondWithResult(_0x53663d,null))[_0x901d('0x46')](handleError(_0x53663d,null));};exports[_0x901d('0x4b')]=function(_0x24b6fa,_0x27459b){return db[_0x901d('0x2f')][_0x901d('0x4b')](_0x24b6fa[_0x901d('0x4c')],{})[_0x901d('0x28')](respondWithResult(_0x27459b,0xc9))[_0x901d('0x46')](handleError(_0x27459b,null));};exports[_0x901d('0x27')]=function(_0x23f2a9,_0x4888e8){if(_0x23f2a9['body']['id']){delete _0x23f2a9[_0x901d('0x4c')]['id'];}return db[_0x901d('0x2f')][_0x901d('0x4a')]({'where':{'id':_0x23f2a9[_0x901d('0x48')]['id']}})[_0x901d('0x28')](handleEntityNotFound(_0x4888e8,null))['then'](saveUpdates(_0x23f2a9['body'],null))[_0x901d('0x28')](respondWithResult(_0x4888e8,null))[_0x901d('0x46')](handleError(_0x4888e8,null));};exports['destroy']=function(_0x23673d,_0x165207){return db['UserProfileResource'][_0x901d('0x4a')]({'where':{'id':_0x23673d['params']['id']}})[_0x901d('0x28')](handleEntityNotFound(_0x165207,null))[_0x901d('0x28')](removeEntity(_0x165207,null))[_0x901d('0x46')](handleError(_0x165207,null));};exports[_0x901d('0x4d')]=function(_0x52aa2d,_0x3a3ea6){return db[_0x901d('0x2f')][_0x901d('0x4d')]()[_0x901d('0x28')](respondWithResult(_0x3a3ea6,null))[_0x901d('0x46')](handleError(_0x3a3ea6,null));}; \ No newline at end of file diff --git a/server/api/userProfileResource/userProfileResource.model.js b/server/api/userProfileResource/userProfileResource.model.js index 9a7d3f6..dd2e564 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 _0x82c2=['path','rimraf','../../config/environment','./userProfileResource.attributes','exports','define','UserProfileResource','user_profile_has_resources','resourceId','lodash','util','../../config/logger','api','moment','bluebird','request-promise'];(function(_0x4b2b2b,_0xce00a8){var _0x23067d=function(_0x3d92ae){while(--_0x3d92ae){_0x4b2b2b['push'](_0x4b2b2b['shift']());}};_0x23067d(++_0xce00a8);}(_0x82c2,0x1c9));var _0x282c=function(_0x2f52d1,_0x36e3b1){_0x2f52d1=_0x2f52d1-0x0;var _0x3f9871=_0x82c2[_0x2f52d1];return _0x3f9871;};'use strict';var _=require(_0x282c('0x0'));var util=require(_0x282c('0x1'));var logger=require(_0x282c('0x2'))(_0x282c('0x3'));var moment=require(_0x282c('0x4'));var BPromise=require(_0x282c('0x5'));var rp=require(_0x282c('0x6'));var fs=require('fs');var path=require(_0x282c('0x7'));var rimraf=require(_0x282c('0x8'));var config=require(_0x282c('0x9'));var attributes=require(_0x282c('0xa'));module[_0x282c('0xb')]=function(_0x536fa4,_0x26c115){return _0x536fa4[_0x282c('0xc')](_0x282c('0xd'),attributes,{'tableName':_0x282c('0xe'),'paranoid':![],'indexes':[{'name':'compositeIndex','fields':[_0x282c('0xf'),'sectionId']}],'timestamps':!![]});}; \ No newline at end of file +var _0xafbe=['./userProfileResource.attributes','exports','define','user_profile_has_resources','compositeIndex','resourceId','sectionId','lodash','util','../../config/logger','api','moment','rimraf','../../config/environment'];(function(_0x308a7f,_0x764ce6){var _0x749fca=function(_0x372004){while(--_0x372004){_0x308a7f['push'](_0x308a7f['shift']());}};_0x749fca(++_0x764ce6);}(_0xafbe,0x69));var _0xeafb=function(_0x3d1244,_0x156028){_0x3d1244=_0x3d1244-0x0;var _0x5d6372=_0xafbe[_0x3d1244];return _0x5d6372;};'use strict';var _=require(_0xeafb('0x0'));var util=require(_0xeafb('0x1'));var logger=require(_0xeafb('0x2'))(_0xeafb('0x3'));var moment=require(_0xeafb('0x4'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0xeafb('0x5'));var config=require(_0xeafb('0x6'));var attributes=require(_0xeafb('0x7'));module[_0xeafb('0x8')]=function(_0x3bd85f,_0xfd1526){return _0x3bd85f[_0xeafb('0x9')]('UserProfileResource',attributes,{'tableName':_0xeafb('0xa'),'paranoid':![],'indexes':[{'name':_0xeafb('0xb'),'fields':[_0xeafb('0xc'),_0xeafb('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 559b6fc..f9c3e45 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 _0x9873=['../../config/logger','rpc','jayson/promise','client','http','request','then','info','UserProfileResource,\x20%s,\x20%s','request\x20sent','debug','UserProfileResource,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils'];(function(_0x53ff36,_0x5066f2){var _0x4a0e2b=function(_0x204527){while(--_0x204527){_0x53ff36['push'](_0x53ff36['shift']());}};_0x4a0e2b(++_0x5066f2);}(_0x9873,0x119));var _0x3987=function(_0x5e1ab5,_0x2fcd4a){_0x5e1ab5=_0x5e1ab5-0x0;var _0xb9cc2f=_0x9873[_0x5e1ab5];return _0xb9cc2f;};'use strict';var _=require(_0x3987('0x0'));var util=require('util');var moment=require(_0x3987('0x1'));var BPromise=require(_0x3987('0x2'));var rs=require(_0x3987('0x3'));var fs=require('fs');var Redis=require(_0x3987('0x4'));var db=require(_0x3987('0x5'))['db'];var utils=require(_0x3987('0x6'));var logger=require(_0x3987('0x7'))(_0x3987('0x8'));var config=require('../../config/environment');var jayson=require(_0x3987('0x9'));var client=jayson[_0x3987('0xa')][_0x3987('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x110354,_0x4dbea6,_0x414433){return new BPromise(function(_0x335e58,_0x36625d){return client[_0x3987('0xc')](_0x110354,_0x414433)[_0x3987('0xd')](function(_0x453a18){logger[_0x3987('0xe')](_0x3987('0xf'),_0x4dbea6,_0x3987('0x10'));logger[_0x3987('0x11')](_0x3987('0x12'),_0x4dbea6,'request\x20sent',JSON[_0x3987('0x13')](_0x453a18));if(_0x453a18[_0x3987('0x14')]){if(_0x453a18[_0x3987('0x14')][_0x3987('0x15')]===0x1f4){logger['error'](_0x3987('0xf'),_0x4dbea6,_0x453a18[_0x3987('0x14')][_0x3987('0x16')]);return _0x36625d(_0x453a18[_0x3987('0x14')][_0x3987('0x16')]);}logger[_0x3987('0x14')](_0x3987('0xf'),_0x4dbea6,_0x453a18['error']['message']);return _0x335e58(_0x453a18['error'][_0x3987('0x16')]);}else{logger[_0x3987('0xe')](_0x3987('0xf'),_0x4dbea6,'request\x20sent');_0x335e58(_0x453a18['result'][_0x3987('0x16')]);}})[_0x3987('0x17')](function(_0x30d67c){logger[_0x3987('0x14')](_0x3987('0xf'),_0x4dbea6,_0x30d67c);_0x36625d(_0x30d67c);});});} \ No newline at end of file +var _0x7054=['bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','http','then','UserProfileResource,\x20%s,\x20%s','debug','request\x20sent','error','code','message','util'];(function(_0x459663,_0x11129d){var _0xa7a8cb=function(_0x16e8b6){while(--_0x16e8b6){_0x459663['push'](_0x459663['shift']());}};_0xa7a8cb(++_0x11129d);}(_0x7054,0x164));var _0x4705=function(_0x27a7d3,_0x24ca5b){_0x27a7d3=_0x27a7d3-0x0;var _0x107ab8=_0x7054[_0x27a7d3];return _0x107ab8;};'use strict';var _=require('lodash');var util=require(_0x4705('0x0'));var moment=require('moment');var BPromise=require(_0x4705('0x1'));var rs=require(_0x4705('0x2'));var fs=require('fs');var Redis=require(_0x4705('0x3'));var db=require(_0x4705('0x4'))['db'];var utils=require(_0x4705('0x5'));var logger=require('../../config/logger')(_0x4705('0x6'));var config=require(_0x4705('0x7'));var jayson=require(_0x4705('0x8'));var client=jayson['client'][_0x4705('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x177a5a,_0x4c8171,_0x3762bc){return new BPromise(function(_0x452c22,_0x4ca271){return client['request'](_0x177a5a,_0x3762bc)[_0x4705('0xa')](function(_0x2d27bd){logger['info'](_0x4705('0xb'),_0x4c8171,'request\x20sent');logger[_0x4705('0xc')]('UserProfileResource,\x20%s,\x20%s,\x20%s',_0x4c8171,_0x4705('0xd'),JSON['stringify'](_0x2d27bd));if(_0x2d27bd[_0x4705('0xe')]){if(_0x2d27bd[_0x4705('0xe')][_0x4705('0xf')]===0x1f4){logger[_0x4705('0xe')]('UserProfileResource,\x20%s,\x20%s',_0x4c8171,_0x2d27bd['error'][_0x4705('0x10')]);return _0x4ca271(_0x2d27bd[_0x4705('0xe')][_0x4705('0x10')]);}logger[_0x4705('0xe')](_0x4705('0xb'),_0x4c8171,_0x2d27bd[_0x4705('0xe')][_0x4705('0x10')]);return _0x452c22(_0x2d27bd[_0x4705('0xe')][_0x4705('0x10')]);}else{logger['info'](_0x4705('0xb'),_0x4c8171,_0x4705('0xd'));_0x452c22(_0x2d27bd['result'][_0x4705('0x10')]);}})['catch'](function(_0x4f1e15){logger[_0x4705('0xe')](_0x4705('0xb'),_0x4c8171,_0x4f1e15);_0x4ca271(_0x4f1e15);});});} \ No newline at end of file diff --git a/server/api/userProfileSection/index.js b/server/api/userProfileSection/index.js index 610ab8a..8964764 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 _0x908a=['path','connect-timeout','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/describe','show','put','/:id','update','destroy','exports','multer','util'];(function(_0x85a944,_0xbf35e8){var _0x441ec7=function(_0x3d0ec0){while(--_0x3d0ec0){_0x85a944['push'](_0x85a944['shift']());}};_0x441ec7(++_0xbf35e8);}(_0x908a,0x142));var _0xa908=function(_0x13784b,_0x2e0911){_0x13784b=_0x13784b-0x0;var _0x1aa6fe=_0x908a[_0x13784b];return _0x1aa6fe;};'use strict';var multer=require(_0xa908('0x0'));var util=require(_0xa908('0x1'));var path=require(_0xa908('0x2'));var timeout=require(_0xa908('0x3'));var express=require('express');var router=express[_0xa908('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0xa908('0x5'));var interaction=require(_0xa908('0x6'));var config=require(_0xa908('0x7'));var controller=require('./userProfileSection.controller');router[_0xa908('0x8')]('/',auth[_0xa908('0x9')](),controller[_0xa908('0xa')]);router['get'](_0xa908('0xb'),auth[_0xa908('0x9')](),controller['describe']);router[_0xa908('0x8')]('/:id',auth[_0xa908('0x9')](),controller[_0xa908('0xc')]);router['post']('/',auth[_0xa908('0x9')](),controller['create']);router[_0xa908('0xd')](_0xa908('0xe'),auth[_0xa908('0x9')](),controller[_0xa908('0xf')]);router['delete'](_0xa908('0xe'),auth[_0xa908('0x9')](),controller[_0xa908('0x10')]);module[_0xa908('0x11')]=router; \ No newline at end of file +var _0x023c=['fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./userProfileSection.controller','isAuthenticated','index','get','/describe','describe','/:id','show','post','create','put','delete','destroy','exports','multer','util','path','connect-timeout','express','Router'];(function(_0x255227,_0x2063b0){var _0x43a3e4=function(_0x2352ec){while(--_0x2352ec){_0x255227['push'](_0x255227['shift']());}};_0x43a3e4(++_0x2063b0);}(_0x023c,0xd2));var _0xc023=function(_0x388eb3,_0x2540ce){_0x388eb3=_0x388eb3-0x0;var _0xc454da=_0x023c[_0x388eb3];return _0xc454da;};'use strict';var multer=require(_0xc023('0x0'));var util=require(_0xc023('0x1'));var path=require(_0xc023('0x2'));var timeout=require(_0xc023('0x3'));var express=require(_0xc023('0x4'));var router=express[_0xc023('0x5')]();var fs_extra=require(_0xc023('0x6'));var auth=require(_0xc023('0x7'));var interaction=require(_0xc023('0x8'));var config=require(_0xc023('0x9'));var controller=require(_0xc023('0xa'));router['get']('/',auth[_0xc023('0xb')](),controller[_0xc023('0xc')]);router[_0xc023('0xd')](_0xc023('0xe'),auth[_0xc023('0xb')](),controller[_0xc023('0xf')]);router[_0xc023('0xd')](_0xc023('0x10'),auth['isAuthenticated'](),controller[_0xc023('0x11')]);router[_0xc023('0x12')]('/',auth['isAuthenticated'](),controller[_0xc023('0x13')]);router[_0xc023('0x14')]('/:id',auth[_0xc023('0xb')](),controller['update']);router[_0xc023('0x15')]('/:id',auth[_0xc023('0xb')](),controller[_0xc023('0x16')]);module[_0xc023('0x17')]=router; \ No newline at end of file diff --git a/server/api/userProfileSection/userProfileSection.attributes.js b/server/api/userProfileSection/userProfileSection.attributes.js index 408f4f4..222855b 100644 --- a/server/api/userProfileSection/userProfileSection.attributes.js +++ b/server/api/userProfileSection/userProfileSection.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xbaf0=['split','exports','STRING','INTEGER','BOOLEAN','setDataValue','crudPermissions','join','getDataValue'];(function(_0x3250f3,_0x1cd63e){var _0x2c5c69=function(_0x440092){while(--_0x440092){_0x3250f3['push'](_0x3250f3['shift']());}};_0x2c5c69(++_0x1cd63e);}(_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':![]},'category':{'type':Sequelize[_0x0baf('0x1')],'allowNull':![]},'sectionId':{'type':Sequelize[_0x0baf('0x2')],'allowNull':![]},'enabled':{'type':Sequelize[_0x0baf('0x3')],'defaultValue':null},'autoAssociation':{'type':Sequelize[_0x0baf('0x3')],'defaultValue':null},'crudPermissions':{'type':Sequelize['STRING'],'set':function(_0x232cc7){this[_0x0baf('0x4')](_0x0baf('0x5'),_0x232cc7?_0x232cc7[_0x0baf('0x6')](''):[]);},'get':function(){return this[_0x0baf('0x7')](_0x0baf('0x5'))?this[_0x0baf('0x7')](_0x0baf('0x5'))[_0x0baf('0x8')](''):[];}}}; \ No newline at end of file +var _0xb58b=['exports','STRING','BOOLEAN','crudPermissions','join','getDataValue','split'];(function(_0x11155f,_0x57b687){var _0xd07e48=function(_0x592615){while(--_0x592615){_0x11155f['push'](_0x11155f['shift']());}};_0xd07e48(++_0x57b687);}(_0xb58b,0x1f1));var _0xbb58=function(_0x1602fa,_0xb0c0b3){_0x1602fa=_0x1602fa-0x0;var _0x5c0330=_0xb58b[_0x1602fa];return _0x5c0330;};'use strict';var Sequelize=require('sequelize');module[_0xbb58('0x0')]={'name':{'type':Sequelize[_0xbb58('0x1')],'allowNull':![]},'category':{'type':Sequelize[_0xbb58('0x1')],'allowNull':![]},'sectionId':{'type':Sequelize['INTEGER'],'allowNull':![]},'enabled':{'type':Sequelize[_0xbb58('0x2')],'defaultValue':null},'autoAssociation':{'type':Sequelize[_0xbb58('0x2')],'defaultValue':null},'crudPermissions':{'type':Sequelize['STRING'],'set':function(_0x226363){this['setDataValue'](_0xbb58('0x3'),_0x226363?_0x226363[_0xbb58('0x4')](''):[]);},'get':function(){return this[_0xbb58('0x5')]('crudPermissions')?this[_0xbb58('0x5')](_0xbb58('0x3'))[_0xbb58('0x6')](''):[];}}}; \ No newline at end of file diff --git a/server/api/userProfileSection/userProfileSection.controller.js b/server/api/userProfileSection/userProfileSection.controller.js index 0c353b7..7f12ce6 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 _0xd8c8=['where','merge','VIRTUAL','options','includeAll','include','show','params','intersection','create','body','catch','find','eml-format','rimraf','zip-dir','request-promise','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','jsforce','desk.js','querystring','papaparse','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','sendStatus','status','json','offset','undefined','limit','count','set','apply','reject','save','update','destroy','then','end','error','stack','name','send','index','UserProfileSection','rawAttributes','type','key','model','query','keys','fields','attributes','length','nolimit','order','sort','filters','pick','filter'];(function(_0x3e5086,_0x48f4a2){var _0xfeb102=function(_0x5a945f){while(--_0x5a945f){_0x3e5086['push'](_0x3e5086['shift']());}};_0xfeb102(++_0x48f4a2);}(_0xd8c8,0x175));var _0x8d8c=function(_0x314029,_0x134824){_0x314029=_0x314029-0x0;var _0x11a61d=_0xd8c8[_0x314029];return _0x11a61d;};'use strict';var emlformat=require(_0x8d8c('0x0'));var rimraf=require(_0x8d8c('0x1'));var zipdir=require(_0x8d8c('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x8d8c('0x3'));var moment=require('moment');var BPromise=require(_0x8d8c('0x4'));var Mustache=require(_0x8d8c('0x5'));var util=require(_0x8d8c('0x6'));var path=require(_0x8d8c('0x7'));var sox=require(_0x8d8c('0x8'));var csv=require(_0x8d8c('0x9'));var ejs=require(_0x8d8c('0xa'));var fs=require('fs');var fs_extra=require(_0x8d8c('0xb'));var _=require(_0x8d8c('0xc'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0x8d8c('0xd'));var deskjs=require(_0x8d8c('0xe'));var toCsv=require(_0x8d8c('0x9'));var querystring=require(_0x8d8c('0xf'));var Papa=require(_0x8d8c('0x10'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0x8d8c('0x11'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x8d8c('0x12'));var logger=require(_0x8d8c('0x13'))(_0x8d8c('0x14'));var utils=require(_0x8d8c('0x15'));var config=require('../../config/environment');var licenseUtil=require(_0x8d8c('0x16'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x2e651e,_0x1d54c0){_0x1d54c0=_0x1d54c0||0xcc;return function(_0x235f92){if(_0x235f92){return _0x2e651e[_0x8d8c('0x17')](_0x1d54c0);}return _0x2e651e[_0x8d8c('0x18')](_0x1d54c0)['end']();};}function respondWithResult(_0x38edf3,_0x23fc44){_0x23fc44=_0x23fc44||0xc8;return function(_0x5318f6){if(_0x5318f6){return _0x38edf3[_0x8d8c('0x18')](_0x23fc44)[_0x8d8c('0x19')](_0x5318f6);}};}function respondWithFilteredResult(_0x21d982,_0xad5826){return function(_0x59164f){if(_0x59164f){var _0x2685d2=typeof _0xad5826[_0x8d8c('0x1a')]===_0x8d8c('0x1b')&&typeof _0xad5826[_0x8d8c('0x1c')]===_0x8d8c('0x1b');var _0xcfb0ff=_0x59164f[_0x8d8c('0x1d')];var _0x2be063=_0x2685d2?0x0:_0xad5826[_0x8d8c('0x1a')];var _0x439373=_0x2685d2?_0x59164f[_0x8d8c('0x1d')]:_0xad5826['offset']+_0xad5826['limit'];var _0x5f3ebf;if(_0x439373>=_0xcfb0ff){_0x439373=_0xcfb0ff;_0x5f3ebf=0xc8;}else{_0x5f3ebf=0xce;}_0x21d982[_0x8d8c('0x18')](_0x5f3ebf);return _0x21d982[_0x8d8c('0x1e')]('Content-Range',_0x2be063+'-'+_0x439373+'/'+_0xcfb0ff)[_0x8d8c('0x19')](_0x59164f);}return null;};}function patchUpdates(_0x59b6f3){return function(_0x3c8637){try{jsonpatch[_0x8d8c('0x1f')](_0x3c8637,_0x59b6f3,!![]);}catch(_0x262367){return BPromise[_0x8d8c('0x20')](_0x262367);}return _0x3c8637[_0x8d8c('0x21')]();};}function saveUpdates(_0x31dd36,_0x5c56a9){return function(_0x392529){if(_0x392529){return _0x392529[_0x8d8c('0x22')](_0x31dd36)['then'](function(_0x454c4d){return _0x454c4d;});}return null;};}function removeEntity(_0x370d2a,_0x52f05c){return function(_0x4b8b76){if(_0x4b8b76){return _0x4b8b76[_0x8d8c('0x23')]()[_0x8d8c('0x24')](function(){_0x370d2a[_0x8d8c('0x18')](0xcc)[_0x8d8c('0x25')]();});}};}function handleEntityNotFound(_0x188441,_0x20b486){return function(_0x24e15b){if(!_0x24e15b){_0x188441[_0x8d8c('0x17')](0x194);}return _0x24e15b;};}function handleError(_0x1d66db,_0x488dd7){_0x488dd7=_0x488dd7||0x1f4;return function(_0x28d286){logger[_0x8d8c('0x26')](_0x28d286[_0x8d8c('0x27')]);if(_0x28d286[_0x8d8c('0x28')]){delete _0x28d286[_0x8d8c('0x28')];}_0x1d66db[_0x8d8c('0x18')](_0x488dd7)[_0x8d8c('0x29')](_0x28d286);};}exports[_0x8d8c('0x2a')]=function(_0x36b217,_0x565f93){var _0x5a3b76={},_0x277907={},_0x5ed635={'count':0x0,'rows':[]};var _0x14255e=_['map'](db[_0x8d8c('0x2b')][_0x8d8c('0x2c')],function(_0x37f043){return{'name':_0x37f043['fieldName'],'type':_0x37f043[_0x8d8c('0x2d')][_0x8d8c('0x2e')]};});_0x277907[_0x8d8c('0x2f')]=_['map'](_0x14255e,_0x8d8c('0x28'));_0x277907[_0x8d8c('0x30')]=_[_0x8d8c('0x31')](_0x36b217['query']);_0x277907['filters']=_['intersection'](_0x277907[_0x8d8c('0x2f')],_0x277907[_0x8d8c('0x30')]);_0x5a3b76['attributes']=_['intersection'](_0x277907[_0x8d8c('0x2f')],qs[_0x8d8c('0x32')](_0x36b217[_0x8d8c('0x30')]['fields']));_0x5a3b76[_0x8d8c('0x33')]=_0x5a3b76[_0x8d8c('0x33')][_0x8d8c('0x34')]?_0x5a3b76[_0x8d8c('0x33')]:_0x277907[_0x8d8c('0x2f')];if(!_0x36b217[_0x8d8c('0x30')]['hasOwnProperty'](_0x8d8c('0x35'))){_0x5a3b76[_0x8d8c('0x1c')]=qs[_0x8d8c('0x1c')](_0x36b217[_0x8d8c('0x30')][_0x8d8c('0x1c')]);_0x5a3b76[_0x8d8c('0x1a')]=qs[_0x8d8c('0x1a')](_0x36b217[_0x8d8c('0x30')][_0x8d8c('0x1a')]);}_0x5a3b76[_0x8d8c('0x36')]=qs[_0x8d8c('0x37')](_0x36b217['query'][_0x8d8c('0x37')]);_0x5a3b76['where']=qs[_0x8d8c('0x38')](_[_0x8d8c('0x39')](_0x36b217[_0x8d8c('0x30')],_0x277907['filters']),_0x14255e);if(_0x36b217[_0x8d8c('0x30')][_0x8d8c('0x3a')]){_0x5a3b76[_0x8d8c('0x3b')]=_[_0x8d8c('0x3c')](_0x5a3b76[_0x8d8c('0x3b')],{'$or':_['map'](_0x14255e,function(_0x5166ad){if(_0x5166ad[_0x8d8c('0x2d')]!==_0x8d8c('0x3d')){var _0x170113={};_0x170113[_0x5166ad[_0x8d8c('0x28')]]={'$like':'%'+_0x36b217[_0x8d8c('0x30')]['filter']+'%'};return _0x170113;}})});}_0x5a3b76=_[_0x8d8c('0x3c')]({},_0x5a3b76,_0x36b217[_0x8d8c('0x3e')]);var _0x2c35e9={'where':_0x5a3b76[_0x8d8c('0x3b')]};return db['UserProfileSection']['count'](_0x2c35e9)[_0x8d8c('0x24')](function(_0x12134a){_0x5ed635[_0x8d8c('0x1d')]=_0x12134a;if(_0x36b217[_0x8d8c('0x30')][_0x8d8c('0x3f')]){_0x5a3b76[_0x8d8c('0x40')]=[{'all':!![]}];}return db[_0x8d8c('0x2b')]['findAll'](_0x5a3b76);})[_0x8d8c('0x24')](function(_0x5b7354){_0x5ed635['rows']=_0x5b7354;return _0x5ed635;})['then'](respondWithFilteredResult(_0x565f93,_0x5a3b76))['catch'](handleError(_0x565f93,null));};exports[_0x8d8c('0x41')]=function(_0x261e2f,_0x534772){var _0x2410a7={'raw':![],'where':{'id':_0x261e2f[_0x8d8c('0x42')]['id']}},_0x2976ad={};_0x2976ad[_0x8d8c('0x2f')]=_[_0x8d8c('0x31')](db['UserProfileSection']['rawAttributes']);_0x2976ad[_0x8d8c('0x30')]=_[_0x8d8c('0x31')](_0x261e2f[_0x8d8c('0x30')]);_0x2976ad[_0x8d8c('0x38')]=_[_0x8d8c('0x43')](_0x2976ad[_0x8d8c('0x2f')],_0x2976ad[_0x8d8c('0x30')]);_0x2410a7['attributes']=_[_0x8d8c('0x43')](_0x2976ad[_0x8d8c('0x2f')],qs['fields'](_0x261e2f['query'][_0x8d8c('0x32')]));_0x2410a7[_0x8d8c('0x33')]=_0x2410a7[_0x8d8c('0x33')][_0x8d8c('0x34')]?_0x2410a7['attributes']:_0x2976ad[_0x8d8c('0x2f')];if(_0x261e2f['query']['includeAll']){_0x2410a7[_0x8d8c('0x40')]=[{'all':!![]}];}_0x2410a7=_['merge']({},_0x2410a7,_0x261e2f[_0x8d8c('0x3e')]);return db[_0x8d8c('0x2b')]['find'](_0x2410a7)['then'](handleEntityNotFound(_0x534772,null))[_0x8d8c('0x24')](respondWithResult(_0x534772,null))['catch'](handleError(_0x534772,null));};exports[_0x8d8c('0x44')]=function(_0x44b63c,_0x49d7ac){return db[_0x8d8c('0x2b')][_0x8d8c('0x44')](_0x44b63c[_0x8d8c('0x45')],{})[_0x8d8c('0x24')](respondWithResult(_0x49d7ac,0xc9))[_0x8d8c('0x46')](handleError(_0x49d7ac,null));};exports[_0x8d8c('0x22')]=function(_0x37183d,_0x5a7436){if(_0x37183d['body']['id']){delete _0x37183d[_0x8d8c('0x45')]['id'];}return db[_0x8d8c('0x2b')]['find']({'where':{'id':_0x37183d[_0x8d8c('0x42')]['id']}})['then'](handleEntityNotFound(_0x5a7436,null))[_0x8d8c('0x24')](saveUpdates(_0x37183d[_0x8d8c('0x45')],null))[_0x8d8c('0x24')](respondWithResult(_0x5a7436,null))[_0x8d8c('0x46')](handleError(_0x5a7436,null));};exports[_0x8d8c('0x23')]=function(_0x3e03b8,_0x2ca96e){return db[_0x8d8c('0x2b')][_0x8d8c('0x47')]({'where':{'id':_0x3e03b8[_0x8d8c('0x42')]['id']}})[_0x8d8c('0x24')](handleEntityNotFound(_0x2ca96e,null))[_0x8d8c('0x24')](removeEntity(_0x2ca96e,null))[_0x8d8c('0x46')](handleError(_0x2ca96e,null));};exports['describe']=function(_0xdd05b4,_0x5e34cf){return db['UserProfileSection']['describe']()[_0x8d8c('0x24')](respondWithResult(_0x5e34cf,null))['catch'](handleError(_0x5e34cf,null));}; \ No newline at end of file +var _0xa336=['include','findAll','rows','catch','show','rawAttributes','options','find','create','body','update','params','describe','eml-format','rimraf','request-promise','moment','bluebird','mustache','util','path','to-csv','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','then','destroy','stack','name','send','index','map','UserProfileSection','fieldName','key','model','query','keys','filters','intersection','fields','attributes','length','hasOwnProperty','order','sort','pick','merge','where','VIRTUAL','filter','includeAll'];(function(_0xc3248d,_0x40996c){var _0x18e9f4=function(_0x86a96f){while(--_0x86a96f){_0xc3248d['push'](_0xc3248d['shift']());}};_0x18e9f4(++_0x40996c);}(_0xa336,0xab));var _0x6a33=function(_0x525509,_0x3af854){_0x525509=_0x525509-0x0;var _0x492648=_0xa336[_0x525509];return _0x492648;};'use strict';var emlformat=require(_0x6a33('0x0'));var rimraf=require(_0x6a33('0x1'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x6a33('0x2'));var moment=require(_0x6a33('0x3'));var BPromise=require(_0x6a33('0x4'));var Mustache=require(_0x6a33('0x5'));var util=require(_0x6a33('0x6'));var path=require(_0x6a33('0x7'));var sox=require('sox');var csv=require(_0x6a33('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x6a33('0x9'));var _=require(_0x6a33('0xa'));var squel=require(_0x6a33('0xb'));var crypto=require(_0x6a33('0xc'));var jsforce=require(_0x6a33('0xd'));var deskjs=require(_0x6a33('0xe'));var toCsv=require(_0x6a33('0x8'));var querystring=require(_0x6a33('0xf'));var Papa=require(_0x6a33('0x10'));var Redis=require(_0x6a33('0x11'));var authService=require(_0x6a33('0x12'));var qs=require(_0x6a33('0x13'));var as=require(_0x6a33('0x14'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x6a33('0x15'))(_0x6a33('0x16'));var utils=require('../../config/utils');var config=require(_0x6a33('0x17'));var licenseUtil=require(_0x6a33('0x18'));var db=require(_0x6a33('0x19'))['db'];function respondWithStatusCode(_0x551d0e,_0xcbbb){_0xcbbb=_0xcbbb||0xcc;return function(_0x2a9bc7){if(_0x2a9bc7){return _0x551d0e[_0x6a33('0x1a')](_0xcbbb);}return _0x551d0e[_0x6a33('0x1b')](_0xcbbb)[_0x6a33('0x1c')]();};}function respondWithResult(_0x52ef3,_0x491b7e){_0x491b7e=_0x491b7e||0xc8;return function(_0x417d08){if(_0x417d08){return _0x52ef3['status'](_0x491b7e)[_0x6a33('0x1d')](_0x417d08);}};}function respondWithFilteredResult(_0x2ca347,_0x33fced){return function(_0x2fdfc1){if(_0x2fdfc1){var _0x4f4d47=typeof _0x33fced[_0x6a33('0x1e')]===_0x6a33('0x1f')&&typeof _0x33fced[_0x6a33('0x20')]==='undefined';var _0x4f3d47=_0x2fdfc1[_0x6a33('0x21')];var _0x3255a9=_0x4f4d47?0x0:_0x33fced[_0x6a33('0x1e')];var _0x1fac4c=_0x4f4d47?_0x2fdfc1[_0x6a33('0x21')]:_0x33fced[_0x6a33('0x1e')]+_0x33fced[_0x6a33('0x20')];var _0x455848;if(_0x1fac4c>=_0x4f3d47){_0x1fac4c=_0x4f3d47;_0x455848=0xc8;}else{_0x455848=0xce;}_0x2ca347[_0x6a33('0x1b')](_0x455848);return _0x2ca347[_0x6a33('0x22')](_0x6a33('0x23'),_0x3255a9+'-'+_0x1fac4c+'/'+_0x4f3d47)[_0x6a33('0x1d')](_0x2fdfc1);}return null;};}function patchUpdates(_0x1fcb9a){return function(_0x574067){try{jsonpatch[_0x6a33('0x24')](_0x574067,_0x1fcb9a,!![]);}catch(_0xaed945){return BPromise[_0x6a33('0x25')](_0xaed945);}return _0x574067[_0x6a33('0x26')]();};}function saveUpdates(_0x2708bc,_0x2ab048){return function(_0x414925){if(_0x414925){return _0x414925['update'](_0x2708bc)[_0x6a33('0x27')](function(_0x55c3ff){return _0x55c3ff;});}return null;};}function removeEntity(_0x45c226,_0x284846){return function(_0x44d200){if(_0x44d200){return _0x44d200[_0x6a33('0x28')]()[_0x6a33('0x27')](function(){_0x45c226[_0x6a33('0x1b')](0xcc)[_0x6a33('0x1c')]();});}};}function handleEntityNotFound(_0x33a67a,_0x5db389){return function(_0x1aac39){if(!_0x1aac39){_0x33a67a[_0x6a33('0x1a')](0x194);}return _0x1aac39;};}function handleError(_0x5cf75f,_0x10c0cf){_0x10c0cf=_0x10c0cf||0x1f4;return function(_0x47c7ea){logger['error'](_0x47c7ea[_0x6a33('0x29')]);if(_0x47c7ea[_0x6a33('0x2a')]){delete _0x47c7ea['name'];}_0x5cf75f[_0x6a33('0x1b')](_0x10c0cf)[_0x6a33('0x2b')](_0x47c7ea);};}exports[_0x6a33('0x2c')]=function(_0x5b590a,_0x42fb69){var _0x25855c={},_0x285314={},_0x12cc7c={'count':0x0,'rows':[]};var _0x55e437=_[_0x6a33('0x2d')](db[_0x6a33('0x2e')]['rawAttributes'],function(_0xfa02b8){return{'name':_0xfa02b8[_0x6a33('0x2f')],'type':_0xfa02b8['type'][_0x6a33('0x30')]};});_0x285314[_0x6a33('0x31')]=_[_0x6a33('0x2d')](_0x55e437,_0x6a33('0x2a'));_0x285314[_0x6a33('0x32')]=_[_0x6a33('0x33')](_0x5b590a['query']);_0x285314[_0x6a33('0x34')]=_[_0x6a33('0x35')](_0x285314['model'],_0x285314[_0x6a33('0x32')]);_0x25855c['attributes']=_['intersection'](_0x285314['model'],qs['fields'](_0x5b590a[_0x6a33('0x32')][_0x6a33('0x36')]));_0x25855c[_0x6a33('0x37')]=_0x25855c[_0x6a33('0x37')][_0x6a33('0x38')]?_0x25855c[_0x6a33('0x37')]:_0x285314[_0x6a33('0x31')];if(!_0x5b590a[_0x6a33('0x32')][_0x6a33('0x39')]('nolimit')){_0x25855c[_0x6a33('0x20')]=qs[_0x6a33('0x20')](_0x5b590a[_0x6a33('0x32')]['limit']);_0x25855c[_0x6a33('0x1e')]=qs[_0x6a33('0x1e')](_0x5b590a[_0x6a33('0x32')][_0x6a33('0x1e')]);}_0x25855c[_0x6a33('0x3a')]=qs[_0x6a33('0x3b')](_0x5b590a[_0x6a33('0x32')][_0x6a33('0x3b')]);_0x25855c['where']=qs[_0x6a33('0x34')](_[_0x6a33('0x3c')](_0x5b590a[_0x6a33('0x32')],_0x285314[_0x6a33('0x34')]),_0x55e437);if(_0x5b590a[_0x6a33('0x32')]['filter']){_0x25855c['where']=_[_0x6a33('0x3d')](_0x25855c[_0x6a33('0x3e')],{'$or':_[_0x6a33('0x2d')](_0x55e437,function(_0x5a9dfd){if(_0x5a9dfd['type']!==_0x6a33('0x3f')){var _0x1689ae={};_0x1689ae[_0x5a9dfd[_0x6a33('0x2a')]]={'$like':'%'+_0x5b590a[_0x6a33('0x32')][_0x6a33('0x40')]+'%'};return _0x1689ae;}})});}_0x25855c=_[_0x6a33('0x3d')]({},_0x25855c,_0x5b590a['options']);var _0x977607={'where':_0x25855c['where']};return db[_0x6a33('0x2e')][_0x6a33('0x21')](_0x977607)['then'](function(_0x922499){_0x12cc7c['count']=_0x922499;if(_0x5b590a[_0x6a33('0x32')][_0x6a33('0x41')]){_0x25855c[_0x6a33('0x42')]=[{'all':!![]}];}return db[_0x6a33('0x2e')][_0x6a33('0x43')](_0x25855c);})['then'](function(_0x3c2145){_0x12cc7c[_0x6a33('0x44')]=_0x3c2145;return _0x12cc7c;})[_0x6a33('0x27')](respondWithFilteredResult(_0x42fb69,_0x25855c))[_0x6a33('0x45')](handleError(_0x42fb69,null));};exports[_0x6a33('0x46')]=function(_0x466862,_0x16e530){var _0x44f267={'raw':![],'where':{'id':_0x466862['params']['id']}},_0xec6fd3={};_0xec6fd3['model']=_[_0x6a33('0x33')](db[_0x6a33('0x2e')][_0x6a33('0x47')]);_0xec6fd3[_0x6a33('0x32')]=_[_0x6a33('0x33')](_0x466862[_0x6a33('0x32')]);_0xec6fd3[_0x6a33('0x34')]=_[_0x6a33('0x35')](_0xec6fd3[_0x6a33('0x31')],_0xec6fd3[_0x6a33('0x32')]);_0x44f267['attributes']=_[_0x6a33('0x35')](_0xec6fd3[_0x6a33('0x31')],qs[_0x6a33('0x36')](_0x466862[_0x6a33('0x32')][_0x6a33('0x36')]));_0x44f267['attributes']=_0x44f267[_0x6a33('0x37')][_0x6a33('0x38')]?_0x44f267[_0x6a33('0x37')]:_0xec6fd3[_0x6a33('0x31')];if(_0x466862[_0x6a33('0x32')][_0x6a33('0x41')]){_0x44f267[_0x6a33('0x42')]=[{'all':!![]}];}_0x44f267=_[_0x6a33('0x3d')]({},_0x44f267,_0x466862[_0x6a33('0x48')]);return db[_0x6a33('0x2e')][_0x6a33('0x49')](_0x44f267)['then'](handleEntityNotFound(_0x16e530,null))['then'](respondWithResult(_0x16e530,null))[_0x6a33('0x45')](handleError(_0x16e530,null));};exports[_0x6a33('0x4a')]=function(_0x5e4c64,_0x321106){return db[_0x6a33('0x2e')][_0x6a33('0x4a')](_0x5e4c64[_0x6a33('0x4b')],{})[_0x6a33('0x27')](respondWithResult(_0x321106,0xc9))['catch'](handleError(_0x321106,null));};exports[_0x6a33('0x4c')]=function(_0xc1c28,_0x15f901){if(_0xc1c28[_0x6a33('0x4b')]['id']){delete _0xc1c28[_0x6a33('0x4b')]['id'];}return db[_0x6a33('0x2e')]['find']({'where':{'id':_0xc1c28[_0x6a33('0x4d')]['id']}})[_0x6a33('0x27')](handleEntityNotFound(_0x15f901,null))[_0x6a33('0x27')](saveUpdates(_0xc1c28[_0x6a33('0x4b')],null))[_0x6a33('0x27')](respondWithResult(_0x15f901,null))[_0x6a33('0x45')](handleError(_0x15f901,null));};exports[_0x6a33('0x28')]=function(_0x325e2a,_0x15a221){return db['UserProfileSection']['find']({'where':{'id':_0x325e2a[_0x6a33('0x4d')]['id']}})['then'](handleEntityNotFound(_0x15a221,null))[_0x6a33('0x27')](removeEntity(_0x15a221,null))[_0x6a33('0x45')](handleError(_0x15a221,null));};exports[_0x6a33('0x4e')]=function(_0x32adf0,_0xb02d40){return db[_0x6a33('0x2e')]['describe']()[_0x6a33('0x27')](respondWithResult(_0xb02d40,null))[_0x6a33('0x45')](handleError(_0xb02d40,null));}; \ No newline at end of file diff --git a/server/api/userProfileSection/userProfileSection.model.js b/server/api/userProfileSection/userProfileSection.model.js index 00b9906..6f70ee6 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 _0xc7b4=['util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','exports','user_profile_has_sections','compositeIndex','userProfileId','lodash'];(function(_0xd7fe21,_0x578f2c){var _0x2eed96=function(_0x5e5908){while(--_0x5e5908){_0xd7fe21['push'](_0xd7fe21['shift']());}};_0x2eed96(++_0x578f2c);}(_0xc7b4,0x9b));var _0x4c7b=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xc7b4[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0x4c7b('0x0'));var util=require(_0x4c7b('0x1'));var logger=require(_0x4c7b('0x2'))(_0x4c7b('0x3'));var moment=require(_0x4c7b('0x4'));var BPromise=require(_0x4c7b('0x5'));var rp=require(_0x4c7b('0x6'));var fs=require('fs');var path=require(_0x4c7b('0x7'));var rimraf=require(_0x4c7b('0x8'));var config=require('../../config/environment');var attributes=require('./userProfileSection.attributes');module[_0x4c7b('0x9')]=function(_0x8ebf5e,_0x185a15){return _0x8ebf5e['define']('UserProfileSection',attributes,{'tableName':_0x4c7b('0xa'),'paranoid':![],'indexes':[{'name':_0x4c7b('0xb'),'fields':['sectionId',_0x4c7b('0xc')]}],'timestamps':!![]});}; \ No newline at end of file +var _0x8ff9=['./userProfileSection.attributes','define','UserProfileSection','user_profile_has_sections','compositeIndex','userProfileId','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment'];(function(_0xeef13e,_0x4e48e0){var _0x1ca7dd=function(_0x5d6fd9){while(--_0x5d6fd9){_0xeef13e['push'](_0xeef13e['shift']());}};_0x1ca7dd(++_0x4e48e0);}(_0x8ff9,0x1a6));var _0x98ff=function(_0x43cee9,_0x4d0bd0){_0x43cee9=_0x43cee9-0x0;var _0x1d758c=_0x8ff9[_0x43cee9];return _0x1d758c;};'use strict';var _=require(_0x98ff('0x0'));var util=require(_0x98ff('0x1'));var logger=require(_0x98ff('0x2'))(_0x98ff('0x3'));var moment=require(_0x98ff('0x4'));var BPromise=require(_0x98ff('0x5'));var rp=require(_0x98ff('0x6'));var fs=require('fs');var path=require(_0x98ff('0x7'));var rimraf=require(_0x98ff('0x8'));var config=require(_0x98ff('0x9'));var attributes=require(_0x98ff('0xa'));module['exports']=function(_0x3c07f5,_0xcdd5f){return _0x3c07f5[_0x98ff('0xb')](_0x98ff('0xc'),attributes,{'tableName':_0x98ff('0xd'),'paranoid':![],'indexes':[{'name':_0x98ff('0xe'),'fields':['sectionId',_0x98ff('0xf')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/userProfileSection/userProfileSection.rpc.js b/server/api/userProfileSection/userProfileSection.rpc.js index 9029cfd..a4effec 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 _0x3178=['../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','debug','UserProfileSection,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','UserProfileSection,\x20%s,\x20%s','message','lodash','util','bluebird','randomstring','ioredis'];(function(_0x22eb96,_0x3c2d8d){var _0x5e1adf=function(_0x22e392){while(--_0x22e392){_0x22eb96['push'](_0x22eb96['shift']());}};_0x5e1adf(++_0x3c2d8d);}(_0x3178,0x7f));var _0x8317=function(_0x26d6eb,_0x3fc8b2){_0x26d6eb=_0x26d6eb-0x0;var _0x5dcbc4=_0x3178[_0x26d6eb];return _0x5dcbc4;};'use strict';var _=require(_0x8317('0x0'));var util=require(_0x8317('0x1'));var moment=require('moment');var BPromise=require(_0x8317('0x2'));var rs=require(_0x8317('0x3'));var fs=require('fs');var Redis=require(_0x8317('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x8317('0x5'));var logger=require(_0x8317('0x6'))(_0x8317('0x7'));var config=require(_0x8317('0x8'));var jayson=require(_0x8317('0x9'));var client=jayson[_0x8317('0xa')][_0x8317('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x29976b,_0x49c705,_0x83d6d3){return new BPromise(function(_0x3cff10,_0xf37701){return client[_0x8317('0xc')](_0x29976b,_0x83d6d3)[_0x8317('0xd')](function(_0x3c7eb7){logger[_0x8317('0xe')]('UserProfileSection,\x20%s,\x20%s',_0x49c705,'request\x20sent');logger[_0x8317('0xf')](_0x8317('0x10'),_0x49c705,_0x8317('0x11'),JSON[_0x8317('0x12')](_0x3c7eb7));if(_0x3c7eb7[_0x8317('0x13')]){if(_0x3c7eb7[_0x8317('0x13')]['code']===0x1f4){logger['error'](_0x8317('0x14'),_0x49c705,_0x3c7eb7[_0x8317('0x13')][_0x8317('0x15')]);return _0xf37701(_0x3c7eb7[_0x8317('0x13')][_0x8317('0x15')]);}logger[_0x8317('0x13')]('UserProfileSection,\x20%s,\x20%s',_0x49c705,_0x3c7eb7['error'][_0x8317('0x15')]);return _0x3cff10(_0x3c7eb7[_0x8317('0x13')][_0x8317('0x15')]);}else{logger[_0x8317('0xe')](_0x8317('0x14'),_0x49c705,_0x8317('0x11'));_0x3cff10(_0x3c7eb7['result'][_0x8317('0x15')]);}})['catch'](function(_0x2db59f){logger['error'](_0x8317('0x14'),_0x49c705,_0x2db59f);_0xf37701(_0x2db59f);});});} \ No newline at end of file +var _0x734a=['bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/environment','client','request','UserProfileSection,\x20%s,\x20%s','debug','stringify','error','code','message','info','request\x20sent','result','lodash','moment'];(function(_0x120da6,_0x15f450){var _0x3d6c07=function(_0x5acddd){while(--_0x5acddd){_0x120da6['push'](_0x120da6['shift']());}};_0x3d6c07(++_0x15f450);}(_0x734a,0x83));var _0xa734=function(_0x2a9bb2,_0xccdbcb){_0x2a9bb2=_0x2a9bb2-0x0;var _0x58c695=_0x734a[_0x2a9bb2];return _0x58c695;};'use strict';var _=require(_0xa734('0x0'));var util=require('util');var moment=require(_0xa734('0x1'));var BPromise=require(_0xa734('0x2'));var rs=require(_0xa734('0x3'));var fs=require('fs');var Redis=require(_0xa734('0x4'));var db=require(_0xa734('0x5'))['db'];var utils=require(_0xa734('0x6'));var logger=require('../../config/logger')('rpc');var config=require(_0xa734('0x7'));var jayson=require('jayson/promise');var client=jayson[_0xa734('0x8')]['http']({'port':0x232a});function respondWithRpcPromise(_0x338a48,_0x21dfa1,_0x51c886){return new BPromise(function(_0x25337a,_0x7270db){return client[_0xa734('0x9')](_0x338a48,_0x51c886)['then'](function(_0x15c82b){logger['info'](_0xa734('0xa'),_0x21dfa1,'request\x20sent');logger[_0xa734('0xb')]('UserProfileSection,\x20%s,\x20%s,\x20%s',_0x21dfa1,'request\x20sent',JSON[_0xa734('0xc')](_0x15c82b));if(_0x15c82b['error']){if(_0x15c82b[_0xa734('0xd')][_0xa734('0xe')]===0x1f4){logger[_0xa734('0xd')](_0xa734('0xa'),_0x21dfa1,_0x15c82b[_0xa734('0xd')][_0xa734('0xf')]);return _0x7270db(_0x15c82b[_0xa734('0xd')][_0xa734('0xf')]);}logger[_0xa734('0xd')](_0xa734('0xa'),_0x21dfa1,_0x15c82b[_0xa734('0xd')]['message']);return _0x25337a(_0x15c82b[_0xa734('0xd')][_0xa734('0xf')]);}else{logger[_0xa734('0x10')](_0xa734('0xa'),_0x21dfa1,_0xa734('0x11'));_0x25337a(_0x15c82b[_0xa734('0x12')][_0xa734('0xf')]);}})['catch'](function(_0x1b6f64){logger[_0xa734('0xd')](_0xa734('0xa'),_0x21dfa1,_0x1b6f64);_0x7270db(_0x1b6f64);});});} \ No newline at end of file diff --git a/server/api/userSmsQueue/index.js b/server/api/userSmsQueue/index.js index abacef6..34654af 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 _0x0713=['../../config/environment','exports','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service'];(function(_0x560d9e,_0x5017ea){var _0xe362ab=function(_0x4a5474){while(--_0x4a5474){_0x560d9e['push'](_0x560d9e['shift']());}};_0xe362ab(++_0x5017ea);}(_0x0713,0x1ba));var _0x3071=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x0713[_0x3dd15e];return _0x231fd0;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x3071('0x0'));var timeout=require(_0x3071('0x1'));var express=require(_0x3071('0x2'));var router=express[_0x3071('0x3')]();var fs_extra=require(_0x3071('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0x3071('0x5'));var config=require(_0x3071('0x6'));module[_0x3071('0x7')]=router; \ No newline at end of file +var _0xd8b0=['Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','multer','util'];(function(_0x17824a,_0x21994f){var _0x2618aa=function(_0x132e99){while(--_0x132e99){_0x17824a['push'](_0x17824a['shift']());}};_0x2618aa(++_0x21994f);}(_0xd8b0,0xad));var _0x0d8b=function(_0x122ef9,_0x451d2a){_0x122ef9=_0x122ef9-0x0;var _0x42fba0=_0xd8b0[_0x122ef9];return _0x42fba0;};'use strict';var multer=require(_0x0d8b('0x0'));var util=require(_0x0d8b('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require('express');var router=express[_0x0d8b('0x2')]();var fs_extra=require(_0x0d8b('0x3'));var auth=require(_0x0d8b('0x4'));var interaction=require(_0x0d8b('0x5'));var config=require(_0x0d8b('0x6'));module['exports']=router; \ No newline at end of file diff --git a/server/api/userSmsQueue/userSmsQueue.attributes.js b/server/api/userSmsQueue/userSmsQueue.attributes.js index 60fa42c..c7830e2 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 _0xe168=['INTEGER','exports'];(function(_0x347dec,_0x1d41a7){var _0x87cb4=function(_0x2214b7){while(--_0x2214b7){_0x347dec['push'](_0x347dec['shift']());}};_0x87cb4(++_0x1d41a7);}(_0xe168,0x79));var _0x8e16=function(_0x1c2f4a,_0x29deb0){_0x1c2f4a=_0x1c2f4a-0x0;var _0x1079eb=_0xe168[_0x1c2f4a];return _0x1079eb;};'use strict';var Sequelize=require('sequelize');module[_0x8e16('0x0')]={'penalty':{'type':Sequelize[_0x8e16('0x1')],'defaultValue':0x0}}; \ No newline at end of file +var _0xda1a=['INTEGER','sequelize'];(function(_0x3724e2,_0x41d318){var _0x5c5ab2=function(_0x4c57ae){while(--_0x4c57ae){_0x3724e2['push'](_0x3724e2['shift']());}};_0x5c5ab2(++_0x41d318);}(_0xda1a,0xff));var _0xada1=function(_0x1d2987,_0x533726){_0x1d2987=_0x1d2987-0x0;var _0x488c9b=_0xda1a[_0x1d2987];return _0x488c9b;};'use strict';var Sequelize=require(_0xada1('0x0'));module['exports']={'penalty':{'type':Sequelize[_0xada1('0x1')],'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 21b4789..7320e9d 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 _0x5f6f=['lodash','util','../../config/logger','api','moment','request-promise','path','rimraf','./userSmsQueue.attributes','exports','user_has_sms_queues'];(function(_0x2c9fe0,_0x1e2901){var _0xbcfe33=function(_0x3b9f5b){while(--_0x3b9f5b){_0x2c9fe0['push'](_0x2c9fe0['shift']());}};_0xbcfe33(++_0x1e2901);}(_0x5f6f,0x1ef));var _0xf5f6=function(_0xbaf497,_0x1b5105){_0xbaf497=_0xbaf497-0x0;var _0x34fd88=_0x5f6f[_0xbaf497];return _0x34fd88;};'use strict';var _=require(_0xf5f6('0x0'));var util=require(_0xf5f6('0x1'));var logger=require(_0xf5f6('0x2'))(_0xf5f6('0x3'));var moment=require(_0xf5f6('0x4'));var BPromise=require('bluebird');var rp=require(_0xf5f6('0x5'));var fs=require('fs');var path=require(_0xf5f6('0x6'));var rimraf=require(_0xf5f6('0x7'));var config=require('../../config/environment');var attributes=require(_0xf5f6('0x8'));module[_0xf5f6('0x9')]=function(_0x390b1a,_0xfda1c7){return _0x390b1a['define']('UserSmsQueue',attributes,{'tableName':_0xf5f6('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x1751=['../../config/environment','./userSmsQueue.attributes','exports','define','UserSmsQueue','user_has_sms_queues','lodash','util','../../config/logger','api','bluebird','request-promise','path','rimraf'];(function(_0x3508f1,_0xc0f42f){var _0x36da32=function(_0x15b9ca){while(--_0x15b9ca){_0x3508f1['push'](_0x3508f1['shift']());}};_0x36da32(++_0xc0f42f);}(_0x1751,0x76));var _0x1175=function(_0x2ab71b,_0x1c4d57){_0x2ab71b=_0x2ab71b-0x0;var _0x37fe6c=_0x1751[_0x2ab71b];return _0x37fe6c;};'use strict';var _=require(_0x1175('0x0'));var util=require(_0x1175('0x1'));var logger=require(_0x1175('0x2'))(_0x1175('0x3'));var moment=require('moment');var BPromise=require(_0x1175('0x4'));var rp=require(_0x1175('0x5'));var fs=require('fs');var path=require(_0x1175('0x6'));var rimraf=require(_0x1175('0x7'));var config=require(_0x1175('0x8'));var attributes=require(_0x1175('0x9'));module[_0x1175('0xa')]=function(_0x171756,_0x3f99ca){return _0x171756[_0x1175('0xb')](_0x1175('0xc'),attributes,{'tableName':_0x1175('0xd'),'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 5c718ac..afd894b 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 _0x9e79=['rpc','../../config/environment','client','http','request','info','UserSmsQueue,\x20%s,\x20%s','UserSmsQueue,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','message','catch','lodash','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger'];(function(_0x478219,_0x28aa3d){var _0x4ff324=function(_0x226fb8){while(--_0x226fb8){_0x478219['push'](_0x478219['shift']());}};_0x4ff324(++_0x28aa3d);}(_0x9e79,0x111));var _0x99e7=function(_0x3ec668,_0x1029a9){_0x3ec668=_0x3ec668-0x0;var _0x454edd=_0x9e79[_0x3ec668];return _0x454edd;};'use strict';var _=require(_0x99e7('0x0'));var util=require('util');var moment=require(_0x99e7('0x1'));var BPromise=require('bluebird');var rs=require(_0x99e7('0x2'));var fs=require('fs');var Redis=require(_0x99e7('0x3'));var db=require(_0x99e7('0x4'))['db'];var utils=require(_0x99e7('0x5'));var logger=require(_0x99e7('0x6'))(_0x99e7('0x7'));var config=require(_0x99e7('0x8'));var jayson=require('jayson/promise');var client=jayson[_0x99e7('0x9')][_0x99e7('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x13a478,_0x299139,_0x4d3720){return new BPromise(function(_0x1e4939,_0x51b20b){return client[_0x99e7('0xb')](_0x13a478,_0x4d3720)['then'](function(_0x261f51){logger[_0x99e7('0xc')](_0x99e7('0xd'),_0x299139,'request\x20sent');logger['debug'](_0x99e7('0xe'),_0x299139,_0x99e7('0xf'),JSON[_0x99e7('0x10')](_0x261f51));if(_0x261f51[_0x99e7('0x11')]){if(_0x261f51[_0x99e7('0x11')]['code']===0x1f4){logger[_0x99e7('0x11')](_0x99e7('0xd'),_0x299139,_0x261f51[_0x99e7('0x11')][_0x99e7('0x12')]);return _0x51b20b(_0x261f51[_0x99e7('0x11')]['message']);}logger[_0x99e7('0x11')](_0x99e7('0xd'),_0x299139,_0x261f51[_0x99e7('0x11')][_0x99e7('0x12')]);return _0x1e4939(_0x261f51[_0x99e7('0x11')][_0x99e7('0x12')]);}else{logger[_0x99e7('0xc')](_0x99e7('0xd'),_0x299139,_0x99e7('0xf'));_0x1e4939(_0x261f51['result']['message']);}})[_0x99e7('0x13')](function(_0x3688cd){logger['error'](_0x99e7('0xd'),_0x299139,_0x3688cd);_0x51b20b(_0x3688cd);});});} \ No newline at end of file +var _0xffd8=['UserSmsQueue,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result','catch','lodash','util','moment','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','UserSmsQueue,\x20%s,\x20%s','request\x20sent','debug'];(function(_0x1410dd,_0x35813c){var _0x56aac2=function(_0x1e8a6f){while(--_0x1e8a6f){_0x1410dd['push'](_0x1410dd['shift']());}};_0x56aac2(++_0x35813c);}(_0xffd8,0x12e));var _0x8ffd=function(_0x14a52c,_0x34b93c){_0x14a52c=_0x14a52c-0x0;var _0x8533a1=_0xffd8[_0x14a52c];return _0x8533a1;};'use strict';var _=require(_0x8ffd('0x0'));var util=require(_0x8ffd('0x1'));var moment=require(_0x8ffd('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x8ffd('0x3'));var db=require(_0x8ffd('0x4'))['db'];var utils=require(_0x8ffd('0x5'));var logger=require(_0x8ffd('0x6'))('rpc');var config=require(_0x8ffd('0x7'));var jayson=require(_0x8ffd('0x8'));var client=jayson[_0x8ffd('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x363bc7,_0x258815,_0x171a52){return new BPromise(function(_0x38bd92,_0x16748e){return client['request'](_0x363bc7,_0x171a52)['then'](function(_0x7a9a8e){logger['info'](_0x8ffd('0xa'),_0x258815,_0x8ffd('0xb'));logger[_0x8ffd('0xc')](_0x8ffd('0xd'),_0x258815,'request\x20sent',JSON[_0x8ffd('0xe')](_0x7a9a8e));if(_0x7a9a8e['error']){if(_0x7a9a8e[_0x8ffd('0xf')][_0x8ffd('0x10')]===0x1f4){logger['error'](_0x8ffd('0xa'),_0x258815,_0x7a9a8e[_0x8ffd('0xf')][_0x8ffd('0x11')]);return _0x16748e(_0x7a9a8e[_0x8ffd('0xf')][_0x8ffd('0x11')]);}logger[_0x8ffd('0xf')](_0x8ffd('0xa'),_0x258815,_0x7a9a8e[_0x8ffd('0xf')][_0x8ffd('0x11')]);return _0x38bd92(_0x7a9a8e[_0x8ffd('0xf')][_0x8ffd('0x11')]);}else{logger[_0x8ffd('0x12')]('UserSmsQueue,\x20%s,\x20%s',_0x258815,'request\x20sent');_0x38bd92(_0x7a9a8e[_0x8ffd('0x13')][_0x8ffd('0x11')]);}})[_0x8ffd('0x14')](function(_0x5b2baa){logger[_0x8ffd('0xf')](_0x8ffd('0xa'),_0x258815,_0x5b2baa);_0x16748e(_0x5b2baa);});});} \ No newline at end of file diff --git a/server/api/userVoicePrefix/userVoicePrefix.attributes.js b/server/api/userVoicePrefix/userVoicePrefix.attributes.js index 09d3004..d997395 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 _0xd4c9=['INTEGER','exports'];(function(_0x4bcbe7,_0x278680){var _0x2513ba=function(_0x5e0486){while(--_0x5e0486){_0x4bcbe7['push'](_0x4bcbe7['shift']());}};_0x2513ba(++_0x278680);}(_0xd4c9,0x1c3));var _0x9d4c=function(_0x24fa1a,_0x16d9c2){_0x24fa1a=_0x24fa1a-0x0;var _0xc5621f=_0xd4c9[_0x24fa1a];return _0xc5621f;};'use strict';var Sequelize=require('sequelize');module[_0x9d4c('0x0')]={'UserId':{'type':Sequelize[_0x9d4c('0x1')]},'VoicePrefixId':{'type':Sequelize[_0x9d4c('0x1')]}}; \ No newline at end of file +var _0x95e1=['sequelize'];(function(_0x200be6,_0x47707b){var _0x2d6e41=function(_0x37048c){while(--_0x37048c){_0x200be6['push'](_0x200be6['shift']());}};_0x2d6e41(++_0x47707b);}(_0x95e1,0x171));var _0x195e=function(_0x15bc81,_0x4d4f77){_0x15bc81=_0x15bc81-0x0;var _0x59440e=_0x95e1[_0x15bc81];return _0x59440e;};'use strict';var Sequelize=require(_0x195e('0x0'));module['exports']={'UserId':{'type':Sequelize['INTEGER']},'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 6cc407c..37a56a6 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(_0x47349f,_0xb292e9){var _0x527c39=function(_0x1f6ac5){while(--_0x1f6ac5){_0x47349f['push'](_0x47349f['shift']());}};_0x527c39(++_0xb292e9);}(_0xa9e0,0x123));var _0x0a9e=function(_0x411add,_0x1aed38){_0x411add=_0x411add-0x0;var _0x238242=_0xa9e0[_0x411add];return _0x238242;};'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(_0x147136,_0xdd0d43){var _0x196f24=function(_0x51e019){while(--_0x51e019){_0x147136['push'](_0x147136['shift']());}};_0x196f24(++_0xdd0d43);}(_0xa9e0,0x123));var _0x0a9e=function(_0x34bc30,_0x177cb0){_0x34bc30=_0x34bc30-0x0;var _0x5706de=_0xa9e0[_0x34bc30];return _0x5706de;};'use strict';var _=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var 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 579d210..d5d87cc 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 _0x9c44=['express','Router','fs-extra','../../components/auth/service','exports','path','connect-timeout'];(function(_0x2351c4,_0x1dca54){var _0x1dd3f8=function(_0x4c3fa2){while(--_0x4c3fa2){_0x2351c4['push'](_0x2351c4['shift']());}};_0x1dd3f8(++_0x1dca54);}(_0x9c44,0x178));var _0x49c4=function(_0x5f1391,_0x19c132){_0x5f1391=_0x5f1391-0x0;var _0x50ebe3=_0x9c44[_0x5f1391];return _0x50ebe3;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x49c4('0x0'));var timeout=require(_0x49c4('0x1'));var express=require(_0x49c4('0x2'));var router=express[_0x49c4('0x3')]();var fs_extra=require(_0x49c4('0x4'));var auth=require(_0x49c4('0x5'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');module[_0x49c4('0x6')]=router; \ No newline at end of file +var _0xcb91=['express','Router','../../components/auth/service','../../components/interaction/service','exports','path','connect-timeout'];(function(_0x2fb649,_0x34b459){var _0x2d6de2=function(_0x453da9){while(--_0x453da9){_0x2fb649['push'](_0x2fb649['shift']());}};_0x2d6de2(++_0x34b459);}(_0xcb91,0x1a9));var _0x1cb9=function(_0x50f0a9,_0x2b0c57){_0x50f0a9=_0x50f0a9-0x0;var _0x5a33d9=_0xcb91[_0x50f0a9];return _0x5a33d9;};'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/userVoiceQueue/userVoiceQueue.attributes.js b/server/api/userVoiceQueue/userVoiceQueue.attributes.js index 86eb866..09d8531 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 _0x64f0=['sequelize'];(function(_0x25c55a,_0x19f5f2){var _0x4f24b4=function(_0x48930c){while(--_0x48930c){_0x25c55a['push'](_0x25c55a['shift']());}};_0x4f24b4(++_0x19f5f2);}(_0x64f0,0x1a0));var _0x064f=function(_0x1e03a6,_0xf0349){_0x1e03a6=_0x1e03a6-0x0;var _0x295b64=_0x64f0[_0x1e03a6];return _0x295b64;};'use strict';var Sequelize=require(_0x064f('0x0'));module['exports']={'penalty':{'type':Sequelize['INTEGER'],'defaultValue':0x0}}; \ No newline at end of file +var _0x021d=['sequelize'];(function(_0x43c8b8,_0x5e8934){var _0x413be3=function(_0x23969c){while(--_0x23969c){_0x43c8b8['push'](_0x43c8b8['shift']());}};_0x413be3(++_0x5e8934);}(_0x021d,0xa4));var _0xd021=function(_0xfd0ece,_0x4e1c00){_0xfd0ece=_0xfd0ece-0x0;var _0x37545b=_0x021d[_0xfd0ece];return _0x37545b;};'use strict';var Sequelize=require(_0xd021('0x0'));module['exports']={'penalty':{'type':Sequelize['INTEGER'],'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 b373364..2ed06bd 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 _0x029a=['user_has_voice_queues','util','../../config/logger','path','../../config/environment','./userVoiceQueue.attributes','UserVoiceQueue'];(function(_0x1035c1,_0x2d8583){var _0x308d67=function(_0x58ddb6){while(--_0x58ddb6){_0x1035c1['push'](_0x1035c1['shift']());}};_0x308d67(++_0x2d8583);}(_0x029a,0xcc));var _0xa029=function(_0x3d9337,_0x263244){_0x3d9337=_0x3d9337-0x0;var _0x55693a=_0x029a[_0x3d9337];return _0x55693a;};'use strict';var _=require('lodash');var util=require(_0xa029('0x0'));var logger=require(_0xa029('0x1'))('api');var moment=require('moment');var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0xa029('0x2'));var rimraf=require('rimraf');var config=require(_0xa029('0x3'));var attributes=require(_0xa029('0x4'));module['exports']=function(_0x4008f3,_0x1a7fee){return _0x4008f3['define'](_0xa029('0x5'),attributes,{'tableName':_0xa029('0x6'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x7f09=['rimraf','../../config/environment','./userVoiceQueue.attributes','exports','UserVoiceQueue','user_has_voice_queues','lodash','util','../../config/logger','api','path'];(function(_0x4ef1a9,_0x59a5fa){var _0x23f201=function(_0x229355){while(--_0x229355){_0x4ef1a9['push'](_0x4ef1a9['shift']());}};_0x23f201(++_0x59a5fa);}(_0x7f09,0x69));var _0x97f0=function(_0xf664c1,_0x313ed2){_0xf664c1=_0xf664c1-0x0;var _0x15acad=_0x7f09[_0xf664c1];return _0x15acad;};'use strict';var _=require(_0x97f0('0x0'));var util=require(_0x97f0('0x1'));var logger=require(_0x97f0('0x2'))(_0x97f0('0x3'));var moment=require('moment');var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0x97f0('0x4'));var rimraf=require(_0x97f0('0x5'));var config=require(_0x97f0('0x6'));var attributes=require(_0x97f0('0x7'));module[_0x97f0('0x8')]=function(_0x26e2a3,_0x3f2151){return _0x26e2a3['define'](_0x97f0('0x9'),attributes,{'tableName':_0x97f0('0xa'),'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 fec7156..a30eafa 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 _0x9eae=['then','info','UserVoiceQueue,\x20%s,\x20%s','request\x20sent','debug','error','message','result','catch','lodash','util','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','request'];(function(_0x35624f,_0x456079){var _0x345514=function(_0x121aca){while(--_0x121aca){_0x35624f['push'](_0x35624f['shift']());}};_0x345514(++_0x456079);}(_0x9eae,0x1be));var _0xe9ea=function(_0x57b54c,_0x54ce0d){_0x57b54c=_0x57b54c-0x0;var _0x59cc19=_0x9eae[_0x57b54c];return _0x59cc19;};'use strict';var _=require(_0xe9ea('0x0'));var util=require(_0xe9ea('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0xe9ea('0x2'));var fs=require('fs');var Redis=require(_0xe9ea('0x3'));var db=require(_0xe9ea('0x4'))['db'];var utils=require(_0xe9ea('0x5'));var logger=require('../../config/logger')(_0xe9ea('0x6'));var config=require(_0xe9ea('0x7'));var jayson=require(_0xe9ea('0x8'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x3676f0,_0x46d508,_0x4476c8){return new BPromise(function(_0x3b2a7e,_0x5cffb3){return client[_0xe9ea('0x9')](_0x3676f0,_0x4476c8)[_0xe9ea('0xa')](function(_0x585da6){logger[_0xe9ea('0xb')](_0xe9ea('0xc'),_0x46d508,_0xe9ea('0xd'));logger[_0xe9ea('0xe')]('UserVoiceQueue,\x20%s,\x20%s,\x20%s',_0x46d508,_0xe9ea('0xd'),JSON['stringify'](_0x585da6));if(_0x585da6[_0xe9ea('0xf')]){if(_0x585da6[_0xe9ea('0xf')]['code']===0x1f4){logger[_0xe9ea('0xf')](_0xe9ea('0xc'),_0x46d508,_0x585da6[_0xe9ea('0xf')][_0xe9ea('0x10')]);return _0x5cffb3(_0x585da6[_0xe9ea('0xf')][_0xe9ea('0x10')]);}logger['error'](_0xe9ea('0xc'),_0x46d508,_0x585da6['error'][_0xe9ea('0x10')]);return _0x3b2a7e(_0x585da6['error']['message']);}else{logger[_0xe9ea('0xb')](_0xe9ea('0xc'),_0x46d508,_0xe9ea('0xd'));_0x3b2a7e(_0x585da6[_0xe9ea('0x11')][_0xe9ea('0x10')]);}})[_0xe9ea('0x12')](function(_0x1ed7a6){logger[_0xe9ea('0xf')](_0xe9ea('0xc'),_0x46d508,_0x1ed7a6);_0x5cffb3(_0x1ed7a6);});});} \ No newline at end of file +var _0xfcbd=['rpc','../../config/environment','client','request','then','info','UserVoiceQueue,\x20%s,\x20%s','request\x20sent','debug','UserVoiceQueue,\x20%s,\x20%s,\x20%s','error','code','message','result','lodash','util','moment','randomstring','ioredis','../../config/utils','../../config/logger'];(function(_0x24f31b,_0x44b8f3){var _0x488401=function(_0x204caf){while(--_0x204caf){_0x24f31b['push'](_0x24f31b['shift']());}};_0x488401(++_0x44b8f3);}(_0xfcbd,0x149));var _0xdfcb=function(_0x13d1e1,_0x3fc41c){_0x13d1e1=_0x13d1e1-0x0;var _0x475ad7=_0xfcbd[_0x13d1e1];return _0x475ad7;};'use strict';var _=require(_0xdfcb('0x0'));var util=require(_0xdfcb('0x1'));var moment=require(_0xdfcb('0x2'));var BPromise=require('bluebird');var rs=require(_0xdfcb('0x3'));var fs=require('fs');var Redis=require(_0xdfcb('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0xdfcb('0x5'));var logger=require(_0xdfcb('0x6'))(_0xdfcb('0x7'));var config=require(_0xdfcb('0x8'));var jayson=require('jayson/promise');var client=jayson[_0xdfcb('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x2544c5,_0x180994,_0x29a670){return new BPromise(function(_0x194588,_0x307e09){return client[_0xdfcb('0xa')](_0x2544c5,_0x29a670)[_0xdfcb('0xb')](function(_0x42704d){logger[_0xdfcb('0xc')](_0xdfcb('0xd'),_0x180994,_0xdfcb('0xe'));logger[_0xdfcb('0xf')](_0xdfcb('0x10'),_0x180994,_0xdfcb('0xe'),JSON['stringify'](_0x42704d));if(_0x42704d[_0xdfcb('0x11')]){if(_0x42704d[_0xdfcb('0x11')][_0xdfcb('0x12')]===0x1f4){logger[_0xdfcb('0x11')](_0xdfcb('0xd'),_0x180994,_0x42704d['error'][_0xdfcb('0x13')]);return _0x307e09(_0x42704d[_0xdfcb('0x11')]['message']);}logger[_0xdfcb('0x11')](_0xdfcb('0xd'),_0x180994,_0x42704d[_0xdfcb('0x11')][_0xdfcb('0x13')]);return _0x194588(_0x42704d['error'][_0xdfcb('0x13')]);}else{logger[_0xdfcb('0xc')](_0xdfcb('0xd'),_0x180994,_0xdfcb('0xe'));_0x194588(_0x42704d[_0xdfcb('0x14')][_0xdfcb('0x13')]);}})['catch'](function(_0x4e0bfc){logger[_0xdfcb('0x11')](_0xdfcb('0xd'),_0x180994,_0x4e0bfc);_0x307e09(_0x4e0bfc);});});} \ No newline at end of file diff --git a/server/api/userVoiceQueueRt/index.js b/server/api/userVoiceQueueRt/index.js index a63128c..97d09ef 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 _0xe706=['../../components/interaction/service','../../config/environment','exports','multer','util','path','express','Router','fs-extra','../../components/auth/service'];(function(_0x3f237f,_0x1bb937){var _0x498986=function(_0x4a22c4){while(--_0x4a22c4){_0x3f237f['push'](_0x3f237f['shift']());}};_0x498986(++_0x1bb937);}(_0xe706,0xa3));var _0x6e70=function(_0x4b26b5,_0x4f71fd){_0x4b26b5=_0x4b26b5-0x0;var _0x4dec71=_0xe706[_0x4b26b5];return _0x4dec71;};'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 _0xd8b0=['Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','multer','util'];(function(_0x4aa662,_0x1cc90c){var _0x336478=function(_0x18b6ef){while(--_0x18b6ef){_0x4aa662['push'](_0x4aa662['shift']());}};_0x336478(++_0x1cc90c);}(_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/userVoiceQueueRt/userVoiceQueueRt.attributes.js b/server/api/userVoiceQueueRt/userVoiceQueueRt.attributes.js index 1ca98c7..0bbd57c 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 _0x97db=['Required\x20by\x20Asterisk','STRING','exports','INTEGER'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x97db,0x8e));var _0xb97d=function(_0x5f0138,_0x1c0f5c){_0x5f0138=_0x5f0138-0x0;var _0x269b85=_0x97db[_0x5f0138];return _0x269b85;};'use strict';var Sequelize=require('sequelize');module[_0xb97d('0x0')]={'uniqueid':{'type':Sequelize[_0xb97d('0x1')],'primaryKey':!![],'autoIncrement':!![],'comment':_0xb97d('0x2')},'membername':{'type':Sequelize[_0xb97d('0x3')],'allowNull':![],'comment':_0xb97d('0x2')},'UserId':{'type':Sequelize['INTEGER'],'allowNull':![]},'queue_name':{'type':Sequelize['STRING'],'allowNull':![],'unique':'queue_interface','comment':_0xb97d('0x2')},'VoiceQueueId':{'type':Sequelize[_0xb97d('0x1')],'allowNull':![]},'interface':{'type':Sequelize[_0xb97d('0x3')],'allowNull':![],'unique':'queue_interface','comment':'Required\x20by\x20Asterisk'},'penalty':{'type':Sequelize[_0xb97d('0x1')](0xb),'defaultValue':0x0,'comment':_0xb97d('0x2')},'paused':{'type':Sequelize[_0xb97d('0x1')](0xb),'defaultValue':0x0,'comment':'Required\x20by\x20Asterisk'}}; \ No newline at end of file +var _0xbeba=['Required\x20by\x20Asterisk','STRING','INTEGER','queue_interface','sequelize','exports'];(function(_0x532a6d,_0x59d3fb){var _0x4faf26=function(_0x5efdb6){while(--_0x5efdb6){_0x532a6d['push'](_0x532a6d['shift']());}};_0x4faf26(++_0x59d3fb);}(_0xbeba,0x64));var _0xabeb=function(_0x2f4673,_0x5452df){_0x2f4673=_0x2f4673-0x0;var _0x24e3a3=_0xbeba[_0x2f4673];return _0x24e3a3;};'use strict';var Sequelize=require(_0xabeb('0x0'));module[_0xabeb('0x1')]={'uniqueid':{'type':Sequelize['INTEGER'],'primaryKey':!![],'autoIncrement':!![],'comment':_0xabeb('0x2')},'membername':{'type':Sequelize[_0xabeb('0x3')],'allowNull':![],'comment':_0xabeb('0x2')},'UserId':{'type':Sequelize[_0xabeb('0x4')],'allowNull':![]},'queue_name':{'type':Sequelize[_0xabeb('0x3')],'allowNull':![],'unique':'queue_interface','comment':_0xabeb('0x2')},'VoiceQueueId':{'type':Sequelize[_0xabeb('0x4')],'allowNull':![]},'interface':{'type':Sequelize[_0xabeb('0x3')],'allowNull':![],'unique':_0xabeb('0x5'),'comment':_0xabeb('0x2')},'penalty':{'type':Sequelize[_0xabeb('0x4')](0xb),'defaultValue':0x0,'comment':_0xabeb('0x2')},'paused':{'type':Sequelize[_0xabeb('0x4')](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 e4e243f..06e1b16 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 _0x16ad=['update','remove','hasOwnProperty','hook','exports','events','../../mysqldb','setMaxListeners','save'];(function(_0xf3c8a4,_0x2bd868){var _0x4f5a9f=function(_0x6f031a){while(--_0x6f031a){_0xf3c8a4['push'](_0xf3c8a4['shift']());}};_0x4f5a9f(++_0x2bd868);}(_0x16ad,0xb0));var _0xd16a=function(_0x5f4192,_0x4ed539){_0x5f4192=_0x5f4192-0x0;var _0x21ee5c=_0x16ad[_0x5f4192];return _0x21ee5c;};'use strict';var EventEmitter=require(_0xd16a('0x0'));var UserVoiceQueueRt=require(_0xd16a('0x1'))['db']['UserVoiceQueueRt'];var UserVoiceQueueRtEvents=new EventEmitter();UserVoiceQueueRtEvents[_0xd16a('0x2')](0x0);var events={'afterCreate':_0xd16a('0x3'),'afterUpdate':_0xd16a('0x4'),'afterDestroy':_0xd16a('0x5')};function emitEvent(_0x3f28d6){return function(_0x24cc39,_0x909eb7,_0x429f97){UserVoiceQueueRtEvents['emit'](_0x3f28d6+':'+_0x24cc39['id'],_0x24cc39);UserVoiceQueueRtEvents['emit'](_0x3f28d6,_0x24cc39);_0x429f97(null);};}for(var e in events){if(events[_0xd16a('0x6')](e)){var event=events[e];UserVoiceQueueRt[_0xd16a('0x7')](e,emitEvent(event));}}module[_0xd16a('0x8')]=UserVoiceQueueRtEvents; \ No newline at end of file +var _0x7769=['exports','events','../../mysqldb','UserVoiceQueueRt','setMaxListeners','update','remove','emit','hasOwnProperty'];(function(_0x2487aa,_0x5c2df3){var _0x3cc7ec=function(_0x3a0cd8){while(--_0x3a0cd8){_0x2487aa['push'](_0x2487aa['shift']());}};_0x3cc7ec(++_0x5c2df3);}(_0x7769,0xbe));var _0x9776=function(_0x15cce9,_0x12bc38){_0x15cce9=_0x15cce9-0x0;var _0x49e335=_0x7769[_0x15cce9];return _0x49e335;};'use strict';var EventEmitter=require(_0x9776('0x0'));var UserVoiceQueueRt=require(_0x9776('0x1'))['db'][_0x9776('0x2')];var UserVoiceQueueRtEvents=new EventEmitter();UserVoiceQueueRtEvents[_0x9776('0x3')](0x0);var events={'afterCreate':'save','afterUpdate':_0x9776('0x4'),'afterDestroy':_0x9776('0x5')};function emitEvent(_0x45360f){return function(_0x1687f8,_0x5a3d46,_0x4325c2){UserVoiceQueueRtEvents[_0x9776('0x6')](_0x45360f+':'+_0x1687f8['id'],_0x1687f8);UserVoiceQueueRtEvents['emit'](_0x45360f,_0x1687f8);_0x4325c2(null);};}for(var e in events){if(events[_0x9776('0x7')](e)){var event=events[e];UserVoiceQueueRt['hook'](e,emitEvent(event));}}module[_0x9776('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 3e492bc..6f232b1 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 _0x8dbb=['../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','define','UserVoiceQueueRt','user_has_voice_queues_rt','lodash','util'];(function(_0x22e7d9,_0x88f058){var _0x5396c2=function(_0xcd0fd3){while(--_0xcd0fd3){_0x22e7d9['push'](_0x22e7d9['shift']());}};_0x5396c2(++_0x88f058);}(_0x8dbb,0x1ec));var _0xb8db=function(_0x415b5d,_0x52a76d){_0x415b5d=_0x415b5d-0x0;var _0x3c0911=_0x8dbb[_0x415b5d];return _0x3c0911;};'use strict';var _=require(_0xb8db('0x0'));var util=require(_0xb8db('0x1'));var logger=require(_0xb8db('0x2'))(_0xb8db('0x3'));var moment=require(_0xb8db('0x4'));var BPromise=require(_0xb8db('0x5'));var rp=require(_0xb8db('0x6'));var fs=require('fs');var path=require(_0xb8db('0x7'));var rimraf=require(_0xb8db('0x8'));var config=require(_0xb8db('0x9'));var attributes=require('./userVoiceQueueRt.attributes');module['exports']=function(_0x57b16a,_0x285e53){return _0x57b16a[_0xb8db('0xa')](_0xb8db('0xb'),attributes,{'tableName':_0xb8db('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x8007=['path','rimraf','../../config/environment','./userVoiceQueueRt.attributes','exports','define','user_has_voice_queues_rt','lodash','../../config/logger','api','bluebird'];(function(_0x18d8f1,_0x572109){var _0x2ee51c=function(_0x11d716){while(--_0x11d716){_0x18d8f1['push'](_0x18d8f1['shift']());}};_0x2ee51c(++_0x572109);}(_0x8007,0x17d));var _0x7800=function(_0x27f955,_0x3ca12e){_0x27f955=_0x27f955-0x0;var _0x18d4c1=_0x8007[_0x27f955];return _0x18d4c1;};'use strict';var _=require(_0x7800('0x0'));var util=require('util');var logger=require(_0x7800('0x1'))(_0x7800('0x2'));var moment=require('moment');var BPromise=require(_0x7800('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x7800('0x4'));var rimraf=require(_0x7800('0x5'));var config=require(_0x7800('0x6'));var attributes=require(_0x7800('0x7'));module[_0x7800('0x8')]=function(_0x28b5ac,_0xc9c236){return _0x28b5ac[_0x7800('0x9')]('UserVoiceQueueRt',attributes,{'tableName':_0x7800('0xa'),'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 fe01e5d..5b46173 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 _0x5f66=['../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis','defaults','localhost','./userVoiceQueueRt.socket','register','request','then','info','debug','UserVoiceQueueRt,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','UserVoiceQueueRt,\x20%s,\x20%s','message','result','GetVoiceQueueRtPauses','UserVoiceQueueRt','findAll','options','where','sequelize','COUNT','literal','`paused`\x20=\x201,\x201,\x20null','outboundQueuePauses','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils'];(function(_0x211d16,_0x281bda){var _0x4f27d4=function(_0x374388){while(--_0x374388){_0x211d16['push'](_0x211d16['shift']());}};_0x4f27d4(++_0x281bda);}(_0x5f66,0xca));var _0x65f6=function(_0x3ab9ee,_0x4a74b8){_0x3ab9ee=_0x3ab9ee-0x0;var _0x82ee88=_0x5f66[_0x3ab9ee];return _0x82ee88;};'use strict';var _=require(_0x65f6('0x0'));var util=require(_0x65f6('0x1'));var moment=require(_0x65f6('0x2'));var BPromise=require(_0x65f6('0x3'));var rs=require(_0x65f6('0x4'));var fs=require('fs');var Redis=require(_0x65f6('0x5'));var db=require(_0x65f6('0x6'))['db'];var utils=require(_0x65f6('0x7'));var logger=require(_0x65f6('0x8'))(_0x65f6('0x9'));var config=require(_0x65f6('0xa'));var jayson=require(_0x65f6('0xb'));var client=jayson[_0x65f6('0xc')][_0x65f6('0xd')]({'port':0x232a});config[_0x65f6('0xe')]=_[_0x65f6('0xf')](config[_0x65f6('0xe')],{'host':_0x65f6('0x10'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x65f6('0xe')]));require(_0x65f6('0x11'))[_0x65f6('0x12')](socket);function respondWithRpcPromise(_0x3e0994,_0x2972cc,_0x5626fb){return new BPromise(function(_0x12be31,_0x1cbc01){return client[_0x65f6('0x13')](_0x3e0994,_0x5626fb)[_0x65f6('0x14')](function(_0x5835b5){logger[_0x65f6('0x15')]('UserVoiceQueueRt,\x20%s,\x20%s',_0x2972cc,'request\x20sent');logger[_0x65f6('0x16')](_0x65f6('0x17'),_0x2972cc,_0x65f6('0x18'),JSON[_0x65f6('0x19')](_0x5835b5));if(_0x5835b5['error']){if(_0x5835b5[_0x65f6('0x1a')][_0x65f6('0x1b')]===0x1f4){logger[_0x65f6('0x1a')](_0x65f6('0x1c'),_0x2972cc,_0x5835b5['error'][_0x65f6('0x1d')]);return _0x1cbc01(_0x5835b5['error'][_0x65f6('0x1d')]);}logger[_0x65f6('0x1a')](_0x65f6('0x1c'),_0x2972cc,_0x5835b5[_0x65f6('0x1a')][_0x65f6('0x1d')]);return _0x12be31(_0x5835b5[_0x65f6('0x1a')][_0x65f6('0x1d')]);}else{logger[_0x65f6('0x15')](_0x65f6('0x1c'),_0x2972cc,_0x65f6('0x18'));_0x12be31(_0x5835b5[_0x65f6('0x1e')]['message']);}})['catch'](function(_0x34fd04){logger[_0x65f6('0x1a')]('UserVoiceQueueRt,\x20%s,\x20%s',_0x2972cc,_0x34fd04);_0x1cbc01(_0x34fd04);});});}exports[_0x65f6('0x1f')]=function(_0x17c8ec){var _0x3d37ad=this;return new Promise(function(_0xcf8744,_0x452967){return db[_0x65f6('0x20')][_0x65f6('0x21')]({'raw':_0x17c8ec[_0x65f6('0x22')]?_0x17c8ec[_0x65f6('0x22')]['raw']===undefined?!![]:![]:!![],'where':_0x17c8ec[_0x65f6('0x22')]?_0x17c8ec['options'][_0x65f6('0x23')]||null:null,'attributes':[[db[_0x65f6('0x24')]['fn'](_0x65f6('0x25'),db[_0x65f6('0x24')]['fn']('IF',db[_0x65f6('0x24')][_0x65f6('0x26')](_0x65f6('0x27')))),_0x65f6('0x28')]]})[_0x65f6('0x14')](function(_0x4922e1){logger['info'](_0x65f6('0x1f'),_0x17c8ec);logger['debug'](_0x65f6('0x1f'),_0x17c8ec,JSON[_0x65f6('0x19')](_0x4922e1));_0xcf8744(_0x4922e1);})[_0x65f6('0x29')](function(_0x2ac500){logger[_0x65f6('0x1a')](_0x65f6('0x1f'),_0x2ac500['message'],_0x17c8ec);_0x452967(_0x3d37ad[_0x65f6('0x1a')](0x1f4,_0x2ac500[_0x65f6('0x1d')]));});});}; \ No newline at end of file +var _0x2b90=['./userVoiceQueueRt.socket','register','then','info','UserVoiceQueueRt,\x20%s,\x20%s,\x20%s','error','message','UserVoiceQueueRt,\x20%s,\x20%s','request\x20sent','result','catch','GetVoiceQueueRtPauses','UserVoiceQueueRt','findAll','options','raw','sequelize','COUNT','literal','`paused`\x20=\x201,\x201,\x20null','stringify','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','redis','defaults','localhost','socket.io-emitter'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0x2b90,0x118));var _0x02b9=function(_0x47e7cb,_0x4c1b8d){_0x47e7cb=_0x47e7cb-0x0;var _0x2a8874=_0x2b90[_0x47e7cb];return _0x2a8874;};'use strict';var _=require(_0x02b9('0x0'));var util=require(_0x02b9('0x1'));var moment=require('moment');var BPromise=require(_0x02b9('0x2'));var rs=require(_0x02b9('0x3'));var fs=require('fs');var Redis=require(_0x02b9('0x4'));var db=require(_0x02b9('0x5'))['db'];var utils=require(_0x02b9('0x6'));var logger=require(_0x02b9('0x7'))(_0x02b9('0x8'));var config=require(_0x02b9('0x9'));var jayson=require('jayson/promise');var client=jayson[_0x02b9('0xa')][_0x02b9('0xb')]({'port':0x232a});config[_0x02b9('0xc')]=_[_0x02b9('0xd')](config[_0x02b9('0xc')],{'host':_0x02b9('0xe'),'port':0x18eb});var socket=require(_0x02b9('0xf'))(new Redis(config['redis']));require(_0x02b9('0x10'))[_0x02b9('0x11')](socket);function respondWithRpcPromise(_0x527ef2,_0x326760,_0x483815){return new BPromise(function(_0xe1ba1d,_0x4050e5){return client['request'](_0x527ef2,_0x483815)[_0x02b9('0x12')](function(_0x9d9dd3){logger[_0x02b9('0x13')]('UserVoiceQueueRt,\x20%s,\x20%s',_0x326760,'request\x20sent');logger['debug'](_0x02b9('0x14'),_0x326760,'request\x20sent',JSON['stringify'](_0x9d9dd3));if(_0x9d9dd3[_0x02b9('0x15')]){if(_0x9d9dd3[_0x02b9('0x15')]['code']===0x1f4){logger[_0x02b9('0x15')]('UserVoiceQueueRt,\x20%s,\x20%s',_0x326760,_0x9d9dd3[_0x02b9('0x15')]['message']);return _0x4050e5(_0x9d9dd3[_0x02b9('0x15')][_0x02b9('0x16')]);}logger[_0x02b9('0x15')](_0x02b9('0x17'),_0x326760,_0x9d9dd3[_0x02b9('0x15')][_0x02b9('0x16')]);return _0xe1ba1d(_0x9d9dd3[_0x02b9('0x15')][_0x02b9('0x16')]);}else{logger[_0x02b9('0x13')](_0x02b9('0x17'),_0x326760,_0x02b9('0x18'));_0xe1ba1d(_0x9d9dd3[_0x02b9('0x19')][_0x02b9('0x16')]);}})[_0x02b9('0x1a')](function(_0x148fbc){logger[_0x02b9('0x15')](_0x02b9('0x17'),_0x326760,_0x148fbc);_0x4050e5(_0x148fbc);});});}exports[_0x02b9('0x1b')]=function(_0x497467){var _0x16c085=this;return new Promise(function(_0x1681e2,_0x2de324){return db[_0x02b9('0x1c')][_0x02b9('0x1d')]({'raw':_0x497467['options']?_0x497467[_0x02b9('0x1e')][_0x02b9('0x1f')]===undefined?!![]:![]:!![],'where':_0x497467[_0x02b9('0x1e')]?_0x497467[_0x02b9('0x1e')]['where']||null:null,'attributes':[[db[_0x02b9('0x20')]['fn'](_0x02b9('0x21'),db[_0x02b9('0x20')]['fn']('IF',db['sequelize'][_0x02b9('0x22')](_0x02b9('0x23')))),'outboundQueuePauses']]})[_0x02b9('0x12')](function(_0x155489){logger[_0x02b9('0x13')](_0x02b9('0x1b'),_0x497467);logger['debug']('GetVoiceQueueRtPauses',_0x497467,JSON[_0x02b9('0x24')](_0x155489));_0x1681e2(_0x155489);})[_0x02b9('0x1a')](function(_0x582790){logger[_0x02b9('0x15')]('GetVoiceQueueRtPauses',_0x582790[_0x02b9('0x16')],_0x497467);_0x2de324(_0x16c085[_0x02b9('0x15')](0x1f4,_0x582790[_0x02b9('0x16')]));});});}; \ No newline at end of file diff --git a/server/api/userVoiceQueueRt/userVoiceQueueRt.socket.js b/server/api/userVoiceQueueRt/userVoiceQueueRt.socket.js index 6f69ee0..d701209 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 _0x07e8=['length','./userVoiceQueueRt.events','save','remove','removeListener','register'];(function(_0x56442c,_0x46f7cd){var _0x5ed5dc=function(_0x4fbfc4){while(--_0x4fbfc4){_0x56442c['push'](_0x56442c['shift']());}};_0x5ed5dc(++_0x46f7cd);}(_0x07e8,0x10f));var _0x807e=function(_0x1248db,_0x1d9f24){_0x1248db=_0x1248db-0x0;var _0x48e8=_0x07e8[_0x1248db];return _0x48e8;};'use strict';var UserVoiceQueueRtEvents=require(_0x807e('0x0'));var events=[_0x807e('0x1'),_0x807e('0x2'),'update'];function createListener(_0xaeb273,_0x51e0a1){return function(_0x100014){_0x51e0a1['emit'](_0xaeb273,_0x100014);};}function removeListener(_0x47d154,_0x2c423b){return function(){UserVoiceQueueRtEvents[_0x807e('0x3')](_0x47d154,_0x2c423b);};}exports[_0x807e('0x4')]=function(_0x59981c){for(var _0x5a768b=0x0,_0xa12efd=events[_0x807e('0x5')];_0x5a768b<_0xa12efd;_0x5a768b++){var _0x178efb=events[_0x5a768b];var _0x1845b3=createListener('userVoiceQueueRt:'+_0x178efb,_0x59981c);UserVoiceQueueRtEvents['on'](_0x178efb,_0x1845b3);}}; \ No newline at end of file +var _0xc01b=['update','removeListener','register','length','userVoiceQueueRt:','./userVoiceQueueRt.events','save','remove'];(function(_0x1facfa,_0x1acf7d){var _0x9ec701=function(_0x115e37){while(--_0x115e37){_0x1facfa['push'](_0x1facfa['shift']());}};_0x9ec701(++_0x1acf7d);}(_0xc01b,0x65));var _0xbc01=function(_0x3ccdf9,_0x158e36){_0x3ccdf9=_0x3ccdf9-0x0;var _0x3209c1=_0xc01b[_0x3ccdf9];return _0x3209c1;};'use strict';var UserVoiceQueueRtEvents=require(_0xbc01('0x0'));var events=[_0xbc01('0x1'),_0xbc01('0x2'),_0xbc01('0x3')];function createListener(_0x5f1964,_0x2be502){return function(_0x39bff3){_0x2be502['emit'](_0x5f1964,_0x39bff3);};}function removeListener(_0x538b32,_0x52b070){return function(){UserVoiceQueueRtEvents[_0xbc01('0x4')](_0x538b32,_0x52b070);};}exports[_0xbc01('0x5')]=function(_0x53b2e6){for(var _0x525a49=0x0,_0x27f7b7=events[_0xbc01('0x6')];_0x525a49<_0x27f7b7;_0x525a49++){var _0x1244dc=events[_0x525a49];var _0xdedc4e=createListener(_0xbc01('0x7')+_0x1244dc,_0x53b2e6);UserVoiceQueueRtEvents['on'](_0x1244dc,_0xdedc4e);}}; \ No newline at end of file diff --git a/server/api/userWhatsappQueue/index.js b/server/api/userWhatsappQueue/index.js index 12b8cf5..62b52d9 100644 --- a/server/api/userWhatsappQueue/index.js +++ b/server/api/userWhatsappQueue/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xcb91=['express','Router','../../components/auth/service','../../components/interaction/service','exports','path','connect-timeout'];(function(_0xa03cfa,_0x50f59c){var _0x550e0f=function(_0x56866d){while(--_0x56866d){_0xa03cfa['push'](_0xa03cfa['shift']());}};_0x550e0f(++_0x50f59c);}(_0xcb91,0x1a9));var _0x1cb9=function(_0xd4636c,_0x34dbf6){_0xd4636c=_0xd4636c-0x0;var _0x5ee17d=_0xcb91[_0xd4636c];return _0x5ee17d;};'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 _0xedd9=['util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','exports'];(function(_0x59f598,_0x370757){var _0x439c77=function(_0x36ac8f){while(--_0x36ac8f){_0x59f598['push'](_0x59f598['shift']());}};_0x439c77(++_0x370757);}(_0xedd9,0xfc));var _0x9edd=function(_0x4c9a89,_0x2b1896){_0x4c9a89=_0x4c9a89-0x0;var _0x76e0f4=_0xedd9[_0x4c9a89];return _0x76e0f4;};'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/userWhatsappQueue/userWhatsappQueue.attributes.js b/server/api/userWhatsappQueue/userWhatsappQueue.attributes.js index 6736bd9..cebcf48 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 _0xa477=['sequelize','exports','INTEGER'];(function(_0xf1de4a,_0x52f431){var _0x2e2c37=function(_0x146699){while(--_0x146699){_0xf1de4a['push'](_0xf1de4a['shift']());}};_0x2e2c37(++_0x52f431);}(_0xa477,0x9c));var _0x7a47=function(_0x2b4411,_0x2625ed){_0x2b4411=_0x2b4411-0x0;var _0x8e41ef=_0xa477[_0x2b4411];return _0x8e41ef;};'use strict';var Sequelize=require(_0x7a47('0x0'));module[_0x7a47('0x1')]={'penalty':{'type':Sequelize[_0x7a47('0x2')],'defaultValue':0x0}}; \ No newline at end of file +var _0x3ed8=['sequelize','exports','INTEGER'];(function(_0x562666,_0x4bc3d8){var _0x25de4e=function(_0x3e6abb){while(--_0x3e6abb){_0x562666['push'](_0x562666['shift']());}};_0x25de4e(++_0x4bc3d8);}(_0x3ed8,0x17d));var _0x83ed=function(_0x3b5ad9,_0x223867){_0x3b5ad9=_0x3b5ad9-0x0;var _0x611ae9=_0x3ed8[_0x3b5ad9];return _0x611ae9;};'use strict';var Sequelize=require(_0x83ed('0x0'));module[_0x83ed('0x1')]={'penalty':{'type':Sequelize[_0x83ed('0x2')],'defaultValue':0x0}}; \ No newline at end of file diff --git a/server/api/userWhatsappQueue/userWhatsappQueue.model.js b/server/api/userWhatsappQueue/userWhatsappQueue.model.js index 7bcbe43..57f395a 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 _0xba71=['../../config/logger','api','moment','../../config/environment','exports','define','user_has_whatsapp_queues','lodash'];(function(_0x50c492,_0x5c1e67){var _0x3505a8=function(_0x2f7937){while(--_0x2f7937){_0x50c492['push'](_0x50c492['shift']());}};_0x3505a8(++_0x5c1e67);}(_0xba71,0x1ef));var _0x1ba7=function(_0x1dfdd5,_0x2f1efe){_0x1dfdd5=_0x1dfdd5-0x0;var _0x2d106a=_0xba71[_0x1dfdd5];return _0x2d106a;};'use strict';var _=require(_0x1ba7('0x0'));var util=require('util');var logger=require(_0x1ba7('0x1'))(_0x1ba7('0x2'));var moment=require(_0x1ba7('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(_0x1ba7('0x4'));var attributes=require('./userWhatsappQueue.attributes');module[_0x1ba7('0x5')]=function(_0x5669fb,_0x185350){return _0x5669fb[_0x1ba7('0x6')]('UserWhatsappQueue',attributes,{'tableName':_0x1ba7('0x7'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x0b4a=['path','rimraf','./userWhatsappQueue.attributes','exports','define','UserWhatsappQueue','user_has_whatsapp_queues','lodash','util','../../config/logger','moment','bluebird'];(function(_0x102ff9,_0x907658){var _0x24fa97=function(_0x3622ff){while(--_0x3622ff){_0x102ff9['push'](_0x102ff9['shift']());}};_0x24fa97(++_0x907658);}(_0x0b4a,0xdf));var _0xa0b4=function(_0x4059c6,_0x476bb6){_0x4059c6=_0x4059c6-0x0;var _0x342017=_0x0b4a[_0x4059c6];return _0x342017;};'use strict';var _=require(_0xa0b4('0x0'));var util=require(_0xa0b4('0x1'));var logger=require(_0xa0b4('0x2'))('api');var moment=require(_0xa0b4('0x3'));var BPromise=require(_0xa0b4('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xa0b4('0x5'));var rimraf=require(_0xa0b4('0x6'));var config=require('../../config/environment');var attributes=require(_0xa0b4('0x7'));module[_0xa0b4('0x8')]=function(_0x45adb2,_0x345871){return _0x45adb2[_0xa0b4('0x9')](_0xa0b4('0xa'),attributes,{'tableName':_0xa0b4('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/userWhatsappQueue/userWhatsappQueue.rpc.js b/server/api/userWhatsappQueue/userWhatsappQueue.rpc.js index 248ba90..a69fe6a 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 _0xd044=['then','info','UserWhatsappQueue,\x20%s,\x20%s','request\x20sent','debug','UserWhatsappQueue,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','lodash','util','moment','bluebird','randomstring','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','request'];(function(_0x1073ad,_0x44bf0b){var _0x528474=function(_0x3450f7){while(--_0x3450f7){_0x1073ad['push'](_0x1073ad['shift']());}};_0x528474(++_0x44bf0b);}(_0xd044,0x14d));var _0x4d04=function(_0x4f716e,_0x45191f){_0x4f716e=_0x4f716e-0x0;var _0x486be9=_0xd044[_0x4f716e];return _0x486be9;};'use strict';var _=require(_0x4d04('0x0'));var util=require(_0x4d04('0x1'));var moment=require(_0x4d04('0x2'));var BPromise=require(_0x4d04('0x3'));var rs=require(_0x4d04('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0x4d04('0x5'));var logger=require('../../config/logger')(_0x4d04('0x6'));var config=require(_0x4d04('0x7'));var jayson=require(_0x4d04('0x8'));var client=jayson[_0x4d04('0x9')][_0x4d04('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x484117,_0x288349,_0x5e5c79){return new BPromise(function(_0x3e9ecd,_0x2ead2e){return client[_0x4d04('0xb')](_0x484117,_0x5e5c79)[_0x4d04('0xc')](function(_0x77c726){logger[_0x4d04('0xd')](_0x4d04('0xe'),_0x288349,_0x4d04('0xf'));logger[_0x4d04('0x10')](_0x4d04('0x11'),_0x288349,_0x4d04('0xf'),JSON[_0x4d04('0x12')](_0x77c726));if(_0x77c726['error']){if(_0x77c726[_0x4d04('0x13')][_0x4d04('0x14')]===0x1f4){logger[_0x4d04('0x13')](_0x4d04('0xe'),_0x288349,_0x77c726[_0x4d04('0x13')][_0x4d04('0x15')]);return _0x2ead2e(_0x77c726['error'][_0x4d04('0x15')]);}logger[_0x4d04('0x13')](_0x4d04('0xe'),_0x288349,_0x77c726['error'][_0x4d04('0x15')]);return _0x3e9ecd(_0x77c726[_0x4d04('0x13')]['message']);}else{logger['info']('UserWhatsappQueue,\x20%s,\x20%s',_0x288349,_0x4d04('0xf'));_0x3e9ecd(_0x77c726[_0x4d04('0x16')][_0x4d04('0x15')]);}})['catch'](function(_0x55f5e0){logger[_0x4d04('0x13')]('UserWhatsappQueue,\x20%s,\x20%s',_0x288349,_0x55f5e0);_0x2ead2e(_0x55f5e0);});});} \ No newline at end of file +var _0x908b=['error','code','message','result','catch','lodash','moment','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','then','UserWhatsappQueue,\x20%s,\x20%s','request\x20sent','debug','stringify'];(function(_0xeb3a05,_0x186f93){var _0x5512c5=function(_0x22159f){while(--_0x22159f){_0xeb3a05['push'](_0xeb3a05['shift']());}};_0x5512c5(++_0x186f93);}(_0x908b,0x145));var _0xb908=function(_0xf60d19,_0x3cde50){_0xf60d19=_0xf60d19-0x0;var _0x294081=_0x908b[_0xf60d19];return _0x294081;};'use strict';var _=require(_0xb908('0x0'));var util=require('util');var moment=require(_0xb908('0x1'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xb908('0x2'));var db=require(_0xb908('0x3'))['db'];var utils=require(_0xb908('0x4'));var logger=require(_0xb908('0x5'))('rpc');var config=require(_0xb908('0x6'));var jayson=require(_0xb908('0x7'));var client=jayson[_0xb908('0x8')][_0xb908('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x5370d1,_0x50b0f6,_0x2c8eac){return new BPromise(function(_0x37fc7a,_0x66d62b){return client['request'](_0x5370d1,_0x2c8eac)[_0xb908('0xa')](function(_0x3e5001){logger['info'](_0xb908('0xb'),_0x50b0f6,_0xb908('0xc'));logger[_0xb908('0xd')]('UserWhatsappQueue,\x20%s,\x20%s,\x20%s',_0x50b0f6,'request\x20sent',JSON[_0xb908('0xe')](_0x3e5001));if(_0x3e5001[_0xb908('0xf')]){if(_0x3e5001[_0xb908('0xf')][_0xb908('0x10')]===0x1f4){logger['error']('UserWhatsappQueue,\x20%s,\x20%s',_0x50b0f6,_0x3e5001[_0xb908('0xf')][_0xb908('0x11')]);return _0x66d62b(_0x3e5001['error'][_0xb908('0x11')]);}logger[_0xb908('0xf')](_0xb908('0xb'),_0x50b0f6,_0x3e5001[_0xb908('0xf')][_0xb908('0x11')]);return _0x37fc7a(_0x3e5001[_0xb908('0xf')][_0xb908('0x11')]);}else{logger['info'](_0xb908('0xb'),_0x50b0f6,_0xb908('0xc'));_0x37fc7a(_0x3e5001[_0xb908('0x12')][_0xb908('0x11')]);}})[_0xb908('0x13')](function(_0x518eeb){logger['error'](_0xb908('0xb'),_0x50b0f6,_0x518eeb);_0x66d62b(_0x518eeb);});});} \ No newline at end of file diff --git a/server/api/variable/index.js b/server/api/variable/index.js index d5932ab..9c19bd3 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 _0xf50b=['destroy','exports','multer','util','connect-timeout','express','Router','fs-extra','../../components/interaction/service','./variable.controller','get','isAuthenticated','index','/:id','post','create','update','delete'];(function(_0x29a37d,_0x1efdce){var _0x11fc58=function(_0x373719){while(--_0x373719){_0x29a37d['push'](_0x29a37d['shift']());}};_0x11fc58(++_0x1efdce);}(_0xf50b,0xc8));var _0xbf50=function(_0x16ef29,_0x2eee79){_0x16ef29=_0x16ef29-0x0;var _0x35fc8f=_0xf50b[_0x16ef29];return _0x35fc8f;};'use strict';var multer=require(_0xbf50('0x0'));var util=require(_0xbf50('0x1'));var path=require('path');var timeout=require(_0xbf50('0x2'));var express=require(_0xbf50('0x3'));var router=express[_0xbf50('0x4')]();var fs_extra=require(_0xbf50('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0xbf50('0x6'));var config=require('../../config/environment');var controller=require(_0xbf50('0x7'));router[_0xbf50('0x8')]('/',auth[_0xbf50('0x9')](),controller[_0xbf50('0xa')]);router[_0xbf50('0x8')](_0xbf50('0xb'),auth[_0xbf50('0x9')](),controller['show']);router[_0xbf50('0xc')]('/',auth[_0xbf50('0x9')](),controller[_0xbf50('0xd')]);router['put']('/:id',auth[_0xbf50('0x9')](),controller[_0xbf50('0xe')]);router[_0xbf50('0xf')]('/:id',auth[_0xbf50('0x9')](),controller[_0xbf50('0x10')]);module[_0xbf50('0x11')]=router; \ No newline at end of file +var _0x4fdb=['fs-extra','../../components/auth/service','../../components/interaction/service','./variable.controller','isAuthenticated','/:id','show','create','put','update','delete','destroy','multer','util','path','connect-timeout','express','Router'];(function(_0x16b667,_0xadec02){var _0x58620e=function(_0x5db60b){while(--_0x5db60b){_0x16b667['push'](_0x16b667['shift']());}};_0x58620e(++_0xadec02);}(_0x4fdb,0x9c));var _0xb4fd=function(_0x5dd02a,_0xc0648c){_0x5dd02a=_0x5dd02a-0x0;var _0x2b3ac6=_0x4fdb[_0x5dd02a];return _0x2b3ac6;};'use strict';var multer=require(_0xb4fd('0x0'));var util=require(_0xb4fd('0x1'));var path=require(_0xb4fd('0x2'));var timeout=require(_0xb4fd('0x3'));var express=require(_0xb4fd('0x4'));var router=express[_0xb4fd('0x5')]();var fs_extra=require(_0xb4fd('0x6'));var auth=require(_0xb4fd('0x7'));var interaction=require(_0xb4fd('0x8'));var config=require('../../config/environment');var controller=require(_0xb4fd('0x9'));router['get']('/',auth[_0xb4fd('0xa')](),controller['index']);router['get'](_0xb4fd('0xb'),auth[_0xb4fd('0xa')](),controller[_0xb4fd('0xc')]);router['post']('/',auth['isAuthenticated'](),controller[_0xb4fd('0xd')]);router[_0xb4fd('0xe')](_0xb4fd('0xb'),auth['isAuthenticated'](),controller[_0xb4fd('0xf')]);router[_0xb4fd('0x10')](_0xb4fd('0xb'),auth[_0xb4fd('0xa')](),controller[_0xb4fd('0x11')]);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 50e4ecf..92fd08d 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 _0x79e3=['exports','name','sequelize'];(function(_0x57b54c,_0x54ce0d){var _0x59cc19=function(_0xa33bc6){while(--_0xa33bc6){_0x57b54c['push'](_0x57b54c['shift']());}};_0x59cc19(++_0x54ce0d);}(_0x79e3,0x77));var _0x379e=function(_0x2a006e,_0x15bd8a){_0x2a006e=_0x2a006e-0x0;var _0x4c781e=_0x79e3[_0x2a006e];return _0x4c781e;};'use strict';var Sequelize=require(_0x379e('0x0'));module[_0x379e('0x1')]={'name':{'type':Sequelize['STRING'],'unique':_0x379e('0x2'),'allowNull':![],'validate':{'notEmpty':!![]}},'description':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0xef2d=['name','sequelize','exports','STRING'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xef2d,0x16d));var _0xdef2=function(_0x4939ce,_0x755776){_0x4939ce=_0x4939ce-0x0;var _0x3ea485=_0xef2d[_0x4939ce];return _0x3ea485;};'use strict';var Sequelize=require(_0xdef2('0x0'));module[_0xdef2('0x1')]={'name':{'type':Sequelize[_0xdef2('0x2')],'unique':_0xdef2('0x3'),'allowNull':![],'validate':{'notEmpty':!![]}},'description':{'type':Sequelize[_0xdef2('0x2')]}}; \ No newline at end of file diff --git a/server/api/variable/variable.controller.js b/server/api/variable/variable.controller.js index 404d3f9..c9dcd8a 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 _0xd056=['moment','bluebird','mustache','path','sox','to-csv','fs-extra','squel','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','undefined','limit','count','offset','set','Content-Range','apply','reject','update','destroy','then','get','Variables','UserProfileResource','stack','name','map','Variable','rawAttributes','key','model','query','keys','filters','fields','attributes','length','hasOwnProperty','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','include','findAll','rows','params','intersection','catch','create','UserProfileSection','find','userProfileId','autoAssociation','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','eml-format','rimraf','fast-json-patch','request-promise'];(function(_0x292423,_0x1759b7){var _0x2801cb=function(_0x23c821){while(--_0x23c821){_0x292423['push'](_0x292423['shift']());}};_0x2801cb(++_0x1759b7);}(_0xd056,0x1d6));var _0x6d05=function(_0x1ba9c1,_0x22bc64){_0x1ba9c1=_0x1ba9c1-0x0;var _0x31c63b=_0xd056[_0x1ba9c1];return _0x31c63b;};'use strict';var emlformat=require(_0x6d05('0x0'));var rimraf=require(_0x6d05('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x6d05('0x2'));var rp=require(_0x6d05('0x3'));var moment=require(_0x6d05('0x4'));var BPromise=require(_0x6d05('0x5'));var Mustache=require(_0x6d05('0x6'));var util=require('util');var path=require(_0x6d05('0x7'));var sox=require(_0x6d05('0x8'));var csv=require(_0x6d05('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x6d05('0xa'));var _=require('lodash');var squel=require(_0x6d05('0xb'));var crypto=require('crypto');var jsforce=require(_0x6d05('0xc'));var deskjs=require(_0x6d05('0xd'));var toCsv=require(_0x6d05('0x9'));var querystring=require(_0x6d05('0xe'));var Papa=require(_0x6d05('0xf'));var Redis=require(_0x6d05('0x10'));var authService=require(_0x6d05('0x11'));var qs=require('../../components/parsers/qs');var as=require(_0x6d05('0x12'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x6d05('0x13'))(_0x6d05('0x14'));var utils=require(_0x6d05('0x15'));var config=require(_0x6d05('0x16'));var licenseUtil=require(_0x6d05('0x17'));var db=require(_0x6d05('0x18'))['db'];function respondWithStatusCode(_0x3a8a18,_0x1c9757){_0x1c9757=_0x1c9757||0xcc;return function(_0x25efba){if(_0x25efba){return _0x3a8a18[_0x6d05('0x19')](_0x1c9757);}return _0x3a8a18[_0x6d05('0x1a')](_0x1c9757)[_0x6d05('0x1b')]();};}function respondWithResult(_0x3658fa,_0x59ca08){_0x59ca08=_0x59ca08||0xc8;return function(_0x24aa8e){if(_0x24aa8e){return _0x3658fa[_0x6d05('0x1a')](_0x59ca08)[_0x6d05('0x1c')](_0x24aa8e);}};}function respondWithFilteredResult(_0x147dd8,_0x418e34){return function(_0x35c985){if(_0x35c985){var _0xdd930a=typeof _0x418e34['offset']===_0x6d05('0x1d')&&typeof _0x418e34[_0x6d05('0x1e')]===_0x6d05('0x1d');var _0x3e7bf=_0x35c985[_0x6d05('0x1f')];var _0x31af39=_0xdd930a?0x0:_0x418e34[_0x6d05('0x20')];var _0x1f7472=_0xdd930a?_0x35c985[_0x6d05('0x1f')]:_0x418e34[_0x6d05('0x20')]+_0x418e34[_0x6d05('0x1e')];var _0x43bb43;if(_0x1f7472>=_0x3e7bf){_0x1f7472=_0x3e7bf;_0x43bb43=0xc8;}else{_0x43bb43=0xce;}_0x147dd8[_0x6d05('0x1a')](_0x43bb43);return _0x147dd8[_0x6d05('0x21')](_0x6d05('0x22'),_0x31af39+'-'+_0x1f7472+'/'+_0x3e7bf)[_0x6d05('0x1c')](_0x35c985);}return null;};}function patchUpdates(_0x1ac400){return function(_0x4f3650){try{jsonpatch[_0x6d05('0x23')](_0x4f3650,_0x1ac400,!![]);}catch(_0x43d8f0){return BPromise[_0x6d05('0x24')](_0x43d8f0);}return _0x4f3650['save']();};}function saveUpdates(_0x1790c8,_0x4c59b6){return function(_0x1fdd59){if(_0x1fdd59){return _0x1fdd59[_0x6d05('0x25')](_0x1790c8)['then'](function(_0x1f4f76){return _0x1f4f76;});}return null;};}function removeEntity(_0x51928e,_0x440bb6){return function(_0x56f690){if(_0x56f690){return _0x56f690[_0x6d05('0x26')]()[_0x6d05('0x27')](function(){var _0x18ecd2=_0x56f690[_0x6d05('0x28')]({'plain':!![]});var _0x4087cb=_0x6d05('0x29');return db[_0x6d05('0x2a')]['destroy']({'where':{'type':_0x4087cb,'resourceId':_0x18ecd2['id']}})[_0x6d05('0x27')](function(){return _0x56f690;});})[_0x6d05('0x27')](function(){_0x51928e[_0x6d05('0x1a')](0xcc)[_0x6d05('0x1b')]();});}};}function handleEntityNotFound(_0x4defb6,_0x4d3285){return function(_0x1a64c0){if(!_0x1a64c0){_0x4defb6[_0x6d05('0x19')](0x194);}return _0x1a64c0;};}function handleError(_0x4e4c1e,_0x406676){_0x406676=_0x406676||0x1f4;return function(_0x44f907){logger['error'](_0x44f907[_0x6d05('0x2b')]);if(_0x44f907[_0x6d05('0x2c')]){delete _0x44f907['name'];}_0x4e4c1e['status'](_0x406676)['send'](_0x44f907);};}exports['index']=function(_0x343f83,_0x217231){var _0x2653b9={},_0x22d913={},_0x6a55f={'count':0x0,'rows':[]};var _0x15e684=_[_0x6d05('0x2d')](db[_0x6d05('0x2e')][_0x6d05('0x2f')],function(_0x34c8bc){return{'name':_0x34c8bc['fieldName'],'type':_0x34c8bc['type'][_0x6d05('0x30')]};});_0x22d913[_0x6d05('0x31')]=_[_0x6d05('0x2d')](_0x15e684,_0x6d05('0x2c'));_0x22d913[_0x6d05('0x32')]=_[_0x6d05('0x33')](_0x343f83['query']);_0x22d913[_0x6d05('0x34')]=_['intersection'](_0x22d913['model'],_0x22d913[_0x6d05('0x32')]);_0x2653b9['attributes']=_['intersection'](_0x22d913[_0x6d05('0x31')],qs[_0x6d05('0x35')](_0x343f83[_0x6d05('0x32')][_0x6d05('0x35')]));_0x2653b9[_0x6d05('0x36')]=_0x2653b9[_0x6d05('0x36')][_0x6d05('0x37')]?_0x2653b9['attributes']:_0x22d913['model'];if(!_0x343f83[_0x6d05('0x32')][_0x6d05('0x38')]('nolimit')){_0x2653b9[_0x6d05('0x1e')]=qs[_0x6d05('0x1e')](_0x343f83[_0x6d05('0x32')][_0x6d05('0x1e')]);_0x2653b9[_0x6d05('0x20')]=qs[_0x6d05('0x20')](_0x343f83[_0x6d05('0x32')][_0x6d05('0x20')]);}_0x2653b9['order']=qs[_0x6d05('0x39')](_0x343f83['query'][_0x6d05('0x39')]);_0x2653b9[_0x6d05('0x3a')]=qs['filters'](_[_0x6d05('0x3b')](_0x343f83[_0x6d05('0x32')],_0x22d913[_0x6d05('0x34')]),_0x15e684);if(_0x343f83[_0x6d05('0x32')][_0x6d05('0x3c')]){_0x2653b9[_0x6d05('0x3a')]=_[_0x6d05('0x3d')](_0x2653b9['where'],{'$or':_[_0x6d05('0x2d')](_0x15e684,function(_0x2dc800){if(_0x2dc800['type']!==_0x6d05('0x3e')){var _0x274d4a={};_0x274d4a[_0x2dc800[_0x6d05('0x2c')]]={'$like':'%'+_0x343f83[_0x6d05('0x32')][_0x6d05('0x3c')]+'%'};return _0x274d4a;}})});}_0x2653b9=_[_0x6d05('0x3d')]({},_0x2653b9,_0x343f83[_0x6d05('0x3f')]);var _0x538321={'where':_0x2653b9[_0x6d05('0x3a')]};return db[_0x6d05('0x2e')]['count'](_0x538321)[_0x6d05('0x27')](function(_0x58154f){_0x6a55f[_0x6d05('0x1f')]=_0x58154f;if(_0x343f83[_0x6d05('0x32')][_0x6d05('0x40')]){_0x2653b9[_0x6d05('0x41')]=[{'all':!![]}];}return db[_0x6d05('0x2e')][_0x6d05('0x42')](_0x2653b9);})[_0x6d05('0x27')](function(_0x43e26e){_0x6a55f[_0x6d05('0x43')]=_0x43e26e;return _0x6a55f;})[_0x6d05('0x27')](respondWithFilteredResult(_0x217231,_0x2653b9))['catch'](handleError(_0x217231,null));};exports['show']=function(_0x5b239f,_0x4bdfc7){var _0x197bc4={'raw':!![],'where':{'id':_0x5b239f[_0x6d05('0x44')]['id']}},_0xeca7bc={};_0xeca7bc[_0x6d05('0x31')]=_[_0x6d05('0x33')](db['Variable']['rawAttributes']);_0xeca7bc[_0x6d05('0x32')]=_[_0x6d05('0x33')](_0x5b239f[_0x6d05('0x32')]);_0xeca7bc[_0x6d05('0x34')]=_[_0x6d05('0x45')](_0xeca7bc[_0x6d05('0x31')],_0xeca7bc[_0x6d05('0x32')]);_0x197bc4[_0x6d05('0x36')]=_['intersection'](_0xeca7bc['model'],qs['fields'](_0x5b239f[_0x6d05('0x32')][_0x6d05('0x35')]));_0x197bc4[_0x6d05('0x36')]=_0x197bc4[_0x6d05('0x36')][_0x6d05('0x37')]?_0x197bc4[_0x6d05('0x36')]:_0xeca7bc[_0x6d05('0x31')];if(_0x5b239f[_0x6d05('0x32')][_0x6d05('0x40')]){_0x197bc4['include']=[{'all':!![]}];}_0x197bc4=_[_0x6d05('0x3d')]({},_0x197bc4,_0x5b239f['options']);return db[_0x6d05('0x2e')]['find'](_0x197bc4)['then'](handleEntityNotFound(_0x4bdfc7,null))[_0x6d05('0x27')](respondWithResult(_0x4bdfc7,null))[_0x6d05('0x46')](handleError(_0x4bdfc7,null));};exports[_0x6d05('0x47')]=function(_0x1662bb,_0x49a01d){return db[_0x6d05('0x2e')][_0x6d05('0x47')](_0x1662bb['body'],{})[_0x6d05('0x27')](function(_0x943c86){var _0x2a4ab5=_0x1662bb['user'][_0x6d05('0x28')]({'plain':!![]});if(!_0x2a4ab5)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x2a4ab5['role']==='user'){var _0x1acc33=_0x943c86[_0x6d05('0x28')]({'plain':!![]});var _0x390312=_0x6d05('0x29');return db[_0x6d05('0x48')][_0x6d05('0x49')]({'where':{'name':_0x390312,'userProfileId':_0x2a4ab5[_0x6d05('0x4a')]},'raw':!![]})[_0x6d05('0x27')](function(_0x4a709){if(_0x4a709&&_0x4a709[_0x6d05('0x4b')]===0x0){return db[_0x6d05('0x2a')][_0x6d05('0x47')]({'name':_0x1acc33['name'],'resourceId':_0x1acc33['id'],'type':_0x4a709[_0x6d05('0x2c')],'sectionId':_0x4a709['id']},{})[_0x6d05('0x27')](function(){return _0x943c86;});}else{return _0x943c86;}})['catch'](function(_0x469fbc){logger[_0x6d05('0x4c')](_0x6d05('0x4d'),_0x469fbc);throw _0x469fbc;});}return _0x943c86;})[_0x6d05('0x27')](respondWithResult(_0x49a01d,0xc9))[_0x6d05('0x46')](handleError(_0x49a01d,null));};exports[_0x6d05('0x25')]=function(_0x459f9c,_0x4f147d){if(_0x459f9c[_0x6d05('0x4e')]['id']){delete _0x459f9c[_0x6d05('0x4e')]['id'];}return db[_0x6d05('0x2e')][_0x6d05('0x49')]({'where':{'id':_0x459f9c['params']['id']}})[_0x6d05('0x27')](handleEntityNotFound(_0x4f147d,null))[_0x6d05('0x27')](saveUpdates(_0x459f9c[_0x6d05('0x4e')],null))[_0x6d05('0x27')](respondWithResult(_0x4f147d,null))[_0x6d05('0x46')](handleError(_0x4f147d,null));};exports[_0x6d05('0x26')]=function(_0x69cdc,_0x172ac6){return db['Variable'][_0x6d05('0x49')]({'where':{'id':_0x69cdc[_0x6d05('0x44')]['id']}})['then'](handleEntityNotFound(_0x172ac6,null))[_0x6d05('0x27')](removeEntity(_0x172ac6,null))[_0x6d05('0x46')](handleError(_0x172ac6,null));}; \ No newline at end of file +var _0x9eea=['keys','filters','attributes','intersection','fields','length','model','nolimit','order','sort','pick','filter','where','merge','Variable','includeAll','findAll','rows','catch','params','options','find','create','body','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','user','UserProfileSection','autoAssociation','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','path','sox','ejs','fs-extra','lodash','desk.js','to-csv','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','destroy','then','Variables','UserProfileResource','error','stack','name','index','map','rawAttributes','type','key','query'];(function(_0x3848b4,_0x4a887f){var _0x35ea12=function(_0x52088d){while(--_0x52088d){_0x3848b4['push'](_0x3848b4['shift']());}};_0x35ea12(++_0x4a887f);}(_0x9eea,0x70));var _0xa9ee=function(_0x5aaa70,_0x23c9d6){_0x5aaa70=_0x5aaa70-0x0;var _0x49312d=_0x9eea[_0x5aaa70];return _0x49312d;};'use strict';var emlformat=require(_0xa9ee('0x0'));var rimraf=require(_0xa9ee('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xa9ee('0x2'));var rp=require(_0xa9ee('0x3'));var moment=require(_0xa9ee('0x4'));var BPromise=require(_0xa9ee('0x5'));var Mustache=require(_0xa9ee('0x6'));var util=require('util');var path=require(_0xa9ee('0x7'));var sox=require(_0xa9ee('0x8'));var csv=require('to-csv');var ejs=require(_0xa9ee('0x9'));var fs=require('fs');var fs_extra=require(_0xa9ee('0xa'));var _=require(_0xa9ee('0xb'));var squel=require('squel');var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0xa9ee('0xc'));var toCsv=require(_0xa9ee('0xd'));var querystring=require(_0xa9ee('0xe'));var Papa=require(_0xa9ee('0xf'));var Redis=require(_0xa9ee('0x10'));var authService=require('../../components/auth/service');var qs=require(_0xa9ee('0x11'));var as=require(_0xa9ee('0x12'));var hardwareService=require(_0xa9ee('0x13'));var logger=require(_0xa9ee('0x14'))(_0xa9ee('0x15'));var utils=require('../../config/utils');var config=require(_0xa9ee('0x16'));var licenseUtil=require(_0xa9ee('0x17'));var db=require(_0xa9ee('0x18'))['db'];function respondWithStatusCode(_0x550671,_0x1e091b){_0x1e091b=_0x1e091b||0xcc;return function(_0x59b905){if(_0x59b905){return _0x550671[_0xa9ee('0x19')](_0x1e091b);}return _0x550671[_0xa9ee('0x1a')](_0x1e091b)[_0xa9ee('0x1b')]();};}function respondWithResult(_0x313159,_0x4c128c){_0x4c128c=_0x4c128c||0xc8;return function(_0x45aa33){if(_0x45aa33){return _0x313159['status'](_0x4c128c)[_0xa9ee('0x1c')](_0x45aa33);}};}function respondWithFilteredResult(_0x3af8f1,_0x25b9bf){return function(_0x36c765){if(_0x36c765){var _0x1dc93e=typeof _0x25b9bf[_0xa9ee('0x1d')]===_0xa9ee('0x1e')&&typeof _0x25b9bf[_0xa9ee('0x1f')]===_0xa9ee('0x1e');var _0x5afb1b=_0x36c765['count'];var _0x4fc8db=_0x1dc93e?0x0:_0x25b9bf[_0xa9ee('0x1d')];var _0x5181b7=_0x1dc93e?_0x36c765[_0xa9ee('0x20')]:_0x25b9bf[_0xa9ee('0x1d')]+_0x25b9bf[_0xa9ee('0x1f')];var _0x24dbf8;if(_0x5181b7>=_0x5afb1b){_0x5181b7=_0x5afb1b;_0x24dbf8=0xc8;}else{_0x24dbf8=0xce;}_0x3af8f1[_0xa9ee('0x1a')](_0x24dbf8);return _0x3af8f1[_0xa9ee('0x21')](_0xa9ee('0x22'),_0x4fc8db+'-'+_0x5181b7+'/'+_0x5afb1b)['json'](_0x36c765);}return null;};}function patchUpdates(_0x1a2737){return function(_0x3ebeda){try{jsonpatch[_0xa9ee('0x23')](_0x3ebeda,_0x1a2737,!![]);}catch(_0x2f6986){return BPromise[_0xa9ee('0x24')](_0x2f6986);}return _0x3ebeda[_0xa9ee('0x25')]();};}function saveUpdates(_0x2596b1,_0x231936){return function(_0x59c1aa){if(_0x59c1aa){return _0x59c1aa[_0xa9ee('0x26')](_0x2596b1)['then'](function(_0x6eee2c){return _0x6eee2c;});}return null;};}function removeEntity(_0x550832,_0x3e90de){return function(_0x824959){if(_0x824959){return _0x824959[_0xa9ee('0x27')]()[_0xa9ee('0x28')](function(){var _0x5755a7=_0x824959['get']({'plain':!![]});var _0x4a3eae=_0xa9ee('0x29');return db[_0xa9ee('0x2a')][_0xa9ee('0x27')]({'where':{'type':_0x4a3eae,'resourceId':_0x5755a7['id']}})[_0xa9ee('0x28')](function(){return _0x824959;});})[_0xa9ee('0x28')](function(){_0x550832[_0xa9ee('0x1a')](0xcc)[_0xa9ee('0x1b')]();});}};}function handleEntityNotFound(_0x3bd191,_0x5215b1){return function(_0xf24079){if(!_0xf24079){_0x3bd191[_0xa9ee('0x19')](0x194);}return _0xf24079;};}function handleError(_0x214db1,_0x3d1620){_0x3d1620=_0x3d1620||0x1f4;return function(_0x182cd3){logger[_0xa9ee('0x2b')](_0x182cd3[_0xa9ee('0x2c')]);if(_0x182cd3[_0xa9ee('0x2d')]){delete _0x182cd3['name'];}_0x214db1['status'](_0x3d1620)['send'](_0x182cd3);};}exports[_0xa9ee('0x2e')]=function(_0x1ee4da,_0x22e38f){var _0x54b6e2={},_0x83577f={},_0x3616df={'count':0x0,'rows':[]};var _0x32361a=_[_0xa9ee('0x2f')](db['Variable'][_0xa9ee('0x30')],function(_0x59789c){return{'name':_0x59789c['fieldName'],'type':_0x59789c[_0xa9ee('0x31')][_0xa9ee('0x32')]};});_0x83577f['model']=_['map'](_0x32361a,_0xa9ee('0x2d'));_0x83577f[_0xa9ee('0x33')]=_[_0xa9ee('0x34')](_0x1ee4da[_0xa9ee('0x33')]);_0x83577f[_0xa9ee('0x35')]=_['intersection'](_0x83577f['model'],_0x83577f['query']);_0x54b6e2[_0xa9ee('0x36')]=_[_0xa9ee('0x37')](_0x83577f['model'],qs['fields'](_0x1ee4da[_0xa9ee('0x33')][_0xa9ee('0x38')]));_0x54b6e2[_0xa9ee('0x36')]=_0x54b6e2['attributes'][_0xa9ee('0x39')]?_0x54b6e2[_0xa9ee('0x36')]:_0x83577f[_0xa9ee('0x3a')];if(!_0x1ee4da['query']['hasOwnProperty'](_0xa9ee('0x3b'))){_0x54b6e2[_0xa9ee('0x1f')]=qs[_0xa9ee('0x1f')](_0x1ee4da['query'][_0xa9ee('0x1f')]);_0x54b6e2[_0xa9ee('0x1d')]=qs[_0xa9ee('0x1d')](_0x1ee4da[_0xa9ee('0x33')][_0xa9ee('0x1d')]);}_0x54b6e2[_0xa9ee('0x3c')]=qs[_0xa9ee('0x3d')](_0x1ee4da[_0xa9ee('0x33')][_0xa9ee('0x3d')]);_0x54b6e2['where']=qs[_0xa9ee('0x35')](_[_0xa9ee('0x3e')](_0x1ee4da[_0xa9ee('0x33')],_0x83577f['filters']),_0x32361a);if(_0x1ee4da[_0xa9ee('0x33')][_0xa9ee('0x3f')]){_0x54b6e2[_0xa9ee('0x40')]=_[_0xa9ee('0x41')](_0x54b6e2[_0xa9ee('0x40')],{'$or':_[_0xa9ee('0x2f')](_0x32361a,function(_0x6af0ba){if(_0x6af0ba[_0xa9ee('0x31')]!=='VIRTUAL'){var _0x17e21d={};_0x17e21d[_0x6af0ba[_0xa9ee('0x2d')]]={'$like':'%'+_0x1ee4da[_0xa9ee('0x33')][_0xa9ee('0x3f')]+'%'};return _0x17e21d;}})});}_0x54b6e2=_[_0xa9ee('0x41')]({},_0x54b6e2,_0x1ee4da['options']);var _0x5ca710={'where':_0x54b6e2['where']};return db[_0xa9ee('0x42')][_0xa9ee('0x20')](_0x5ca710)['then'](function(_0x3d1b62){_0x3616df[_0xa9ee('0x20')]=_0x3d1b62;if(_0x1ee4da['query'][_0xa9ee('0x43')]){_0x54b6e2['include']=[{'all':!![]}];}return db[_0xa9ee('0x42')][_0xa9ee('0x44')](_0x54b6e2);})[_0xa9ee('0x28')](function(_0x45f05e){_0x3616df[_0xa9ee('0x45')]=_0x45f05e;return _0x3616df;})['then'](respondWithFilteredResult(_0x22e38f,_0x54b6e2))[_0xa9ee('0x46')](handleError(_0x22e38f,null));};exports['show']=function(_0x36b76b,_0x3268f2){var _0x266efa={'raw':!![],'where':{'id':_0x36b76b[_0xa9ee('0x47')]['id']}},_0x49c286={};_0x49c286[_0xa9ee('0x3a')]=_[_0xa9ee('0x34')](db[_0xa9ee('0x42')][_0xa9ee('0x30')]);_0x49c286[_0xa9ee('0x33')]=_[_0xa9ee('0x34')](_0x36b76b[_0xa9ee('0x33')]);_0x49c286['filters']=_[_0xa9ee('0x37')](_0x49c286[_0xa9ee('0x3a')],_0x49c286['query']);_0x266efa[_0xa9ee('0x36')]=_[_0xa9ee('0x37')](_0x49c286['model'],qs[_0xa9ee('0x38')](_0x36b76b[_0xa9ee('0x33')][_0xa9ee('0x38')]));_0x266efa['attributes']=_0x266efa[_0xa9ee('0x36')]['length']?_0x266efa[_0xa9ee('0x36')]:_0x49c286[_0xa9ee('0x3a')];if(_0x36b76b[_0xa9ee('0x33')][_0xa9ee('0x43')]){_0x266efa['include']=[{'all':!![]}];}_0x266efa=_['merge']({},_0x266efa,_0x36b76b[_0xa9ee('0x48')]);return db['Variable'][_0xa9ee('0x49')](_0x266efa)[_0xa9ee('0x28')](handleEntityNotFound(_0x3268f2,null))[_0xa9ee('0x28')](respondWithResult(_0x3268f2,null))[_0xa9ee('0x46')](handleError(_0x3268f2,null));};exports['create']=function(_0x10cd5e,_0x56b43e){return db['Variable'][_0xa9ee('0x4a')](_0x10cd5e[_0xa9ee('0x4b')],{})[_0xa9ee('0x28')](function(_0x10e301){var _0x14e1d1=_0x10cd5e['user'][_0xa9ee('0x4c')]({'plain':!![]});if(!_0x14e1d1)throw new Error(_0xa9ee('0x4d'));if(_0x14e1d1[_0xa9ee('0x4e')]===_0xa9ee('0x4f')){var _0x31e626=_0x10e301['get']({'plain':!![]});var _0x599705='Variables';return db[_0xa9ee('0x50')][_0xa9ee('0x49')]({'where':{'name':_0x599705,'userProfileId':_0x14e1d1['userProfileId']},'raw':!![]})[_0xa9ee('0x28')](function(_0x5502b8){if(_0x5502b8&&_0x5502b8[_0xa9ee('0x51')]===0x0){return db[_0xa9ee('0x2a')]['create']({'name':_0x31e626[_0xa9ee('0x2d')],'resourceId':_0x31e626['id'],'type':_0x5502b8[_0xa9ee('0x2d')],'sectionId':_0x5502b8['id']},{})[_0xa9ee('0x28')](function(){return _0x10e301;});}else{return _0x10e301;}})[_0xa9ee('0x46')](function(_0x12abde){logger[_0xa9ee('0x2b')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x12abde);throw _0x12abde;});}return _0x10e301;})[_0xa9ee('0x28')](respondWithResult(_0x56b43e,0xc9))[_0xa9ee('0x46')](handleError(_0x56b43e,null));};exports[_0xa9ee('0x26')]=function(_0x2a957e,_0x54a414){if(_0x2a957e['body']['id']){delete _0x2a957e['body']['id'];}return db[_0xa9ee('0x42')]['find']({'where':{'id':_0x2a957e[_0xa9ee('0x47')]['id']}})['then'](handleEntityNotFound(_0x54a414,null))[_0xa9ee('0x28')](saveUpdates(_0x2a957e[_0xa9ee('0x4b')],null))[_0xa9ee('0x28')](respondWithResult(_0x54a414,null))[_0xa9ee('0x46')](handleError(_0x54a414,null));};exports[_0xa9ee('0x27')]=function(_0x76ac70,_0x4f7993){return db[_0xa9ee('0x42')][_0xa9ee('0x49')]({'where':{'id':_0x76ac70['params']['id']}})[_0xa9ee('0x28')](handleEntityNotFound(_0x4f7993,null))[_0xa9ee('0x28')](removeEntity(_0x4f7993,null))[_0xa9ee('0x46')](handleError(_0x4f7993,null));}; \ No newline at end of file diff --git a/server/api/variable/variable.model.js b/server/api/variable/variable.model.js index 3dffb47..d4adacf 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 _0x4268=['Variable','tools_variables','lodash','util','../../config/logger','api','bluebird','request-promise','../../config/environment','./variable.attributes','exports','define'];(function(_0x3b380d,_0x4bf247){var _0x54502b=function(_0x35d207){while(--_0x35d207){_0x3b380d['push'](_0x3b380d['shift']());}};_0x54502b(++_0x4bf247);}(_0x4268,0x15e));var _0x8426=function(_0x5043bd,_0x557d42){_0x5043bd=_0x5043bd-0x0;var _0x304c04=_0x4268[_0x5043bd];return _0x304c04;};'use strict';var _=require(_0x8426('0x0'));var util=require(_0x8426('0x1'));var logger=require(_0x8426('0x2'))(_0x8426('0x3'));var moment=require('moment');var BPromise=require(_0x8426('0x4'));var rp=require(_0x8426('0x5'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0x8426('0x6'));var attributes=require(_0x8426('0x7'));module[_0x8426('0x8')]=function(_0x130007,_0x14233b){return _0x130007[_0x8426('0x9')](_0x8426('0xa'),attributes,{'tableName':_0x8426('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x56df=['util','api','bluebird','request-promise','path','rimraf','../../config/environment','./variable.attributes','exports','define','Variable','tools_variables','lodash'];(function(_0x14ba97,_0x9de8f0){var _0x21d14d=function(_0x420946){while(--_0x420946){_0x14ba97['push'](_0x14ba97['shift']());}};_0x21d14d(++_0x9de8f0);}(_0x56df,0x19f));var _0xf56d=function(_0x39049b,_0x1e8502){_0x39049b=_0x39049b-0x0;var _0x187e69=_0x56df[_0x39049b];return _0x187e69;};'use strict';var _=require(_0xf56d('0x0'));var util=require(_0xf56d('0x1'));var logger=require('../../config/logger')(_0xf56d('0x2'));var moment=require('moment');var BPromise=require(_0xf56d('0x3'));var rp=require(_0xf56d('0x4'));var fs=require('fs');var path=require(_0xf56d('0x5'));var rimraf=require(_0xf56d('0x6'));var config=require(_0xf56d('0x7'));var attributes=require(_0xf56d('0x8'));module[_0xf56d('0x9')]=function(_0x100753,_0x3d7b88){return _0x100753[_0xf56d('0xa')](_0xf56d('0xb'),attributes,{'tableName':_0xf56d('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 90e34dd..41300f5 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 _0x326f=['bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','info','Variable,\x20%s,\x20%s','request\x20sent','debug','error','code','message','result','catch','ShowVariable','Variable','raw','options','include','model','attributes','map','then','stringify','lodash'];(function(_0xbca1b1,_0x33f0ce){var _0x4e1686=function(_0x58a80c){while(--_0x58a80c){_0xbca1b1['push'](_0xbca1b1['shift']());}};_0x4e1686(++_0x33f0ce);}(_0x326f,0xd1));var _0xf326=function(_0x44d39e,_0x5c6390){_0x44d39e=_0x44d39e-0x0;var _0x1a483e=_0x326f[_0x44d39e];return _0x1a483e;};'use strict';var _=require(_0xf326('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0xf326('0x1'));var rs=require(_0xf326('0x2'));var fs=require('fs');var Redis=require(_0xf326('0x3'));var db=require(_0xf326('0x4'))['db'];var utils=require(_0xf326('0x5'));var logger=require(_0xf326('0x6'))(_0xf326('0x7'));var config=require(_0xf326('0x8'));var jayson=require(_0xf326('0x9'));var client=jayson[_0xf326('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x3c254d,_0x3851eb,_0x165f95){return new BPromise(function(_0x1e7b8a,_0x515bfa){return client['request'](_0x3c254d,_0x165f95)['then'](function(_0x3bacf2){logger[_0xf326('0xb')](_0xf326('0xc'),_0x3851eb,_0xf326('0xd'));logger[_0xf326('0xe')]('Variable,\x20%s,\x20%s,\x20%s',_0x3851eb,_0xf326('0xd'),JSON['stringify'](_0x3bacf2));if(_0x3bacf2[_0xf326('0xf')]){if(_0x3bacf2['error'][_0xf326('0x10')]===0x1f4){logger['error'](_0xf326('0xc'),_0x3851eb,_0x3bacf2[_0xf326('0xf')]['message']);return _0x515bfa(_0x3bacf2[_0xf326('0xf')][_0xf326('0x11')]);}logger[_0xf326('0xf')](_0xf326('0xc'),_0x3851eb,_0x3bacf2['error'][_0xf326('0x11')]);return _0x1e7b8a(_0x3bacf2['error']['message']);}else{logger[_0xf326('0xb')](_0xf326('0xc'),_0x3851eb,_0xf326('0xd'));_0x1e7b8a(_0x3bacf2[_0xf326('0x12')][_0xf326('0x11')]);}})[_0xf326('0x13')](function(_0x34128e){logger[_0xf326('0xf')]('Variable,\x20%s,\x20%s',_0x3851eb,_0x34128e);_0x515bfa(_0x34128e);});});}exports[_0xf326('0x14')]=function(_0x453100){var _0x18bee3=this;return new Promise(function(_0x31ffb9,_0xcef2b5){return db[_0xf326('0x15')]['find']({'raw':_0x453100['options']?_0x453100['options'][_0xf326('0x16')]===undefined?!![]:![]:!![],'where':_0x453100[_0xf326('0x17')]?_0x453100['options']['where']||null:null,'attributes':_0x453100[_0xf326('0x17')]?_0x453100['options']['attributes']||null:null,'include':_0x453100[_0xf326('0x17')]?_0x453100[_0xf326('0x17')]['include']?_['map'](_0x453100[_0xf326('0x17')][_0xf326('0x18')],function(_0x5f21a2){return{'model':db[_0x5f21a2[_0xf326('0x19')]],'as':_0x5f21a2['as'],'attributes':_0x5f21a2[_0xf326('0x1a')],'include':_0x5f21a2[_0xf326('0x18')]?_[_0xf326('0x1b')](_0x5f21a2[_0xf326('0x18')],function(_0x2049ec){return{'model':db[_0x2049ec['model']],'as':_0x2049ec['as'],'attributes':_0x2049ec['attributes'],'include':_0x2049ec['include']?_[_0xf326('0x1b')](_0x2049ec[_0xf326('0x18')],function(_0x2cd45a){return{'model':db[_0x2cd45a[_0xf326('0x19')]],'as':_0x2cd45a['as'],'attributes':_0x2cd45a[_0xf326('0x1a')]};}):[]};}):[]};}):[]:[]})[_0xf326('0x1c')](function(_0x5217d4){logger[_0xf326('0xb')](_0xf326('0x14'),_0x453100);logger[_0xf326('0xe')]('ShowVariable',_0x453100,JSON[_0xf326('0x1d')](_0x5217d4));_0x31ffb9(_0x5217d4);})['catch'](function(_0x4a9abf){logger[_0xf326('0xf')](_0xf326('0x14'),_0x4a9abf[_0xf326('0x11')],_0x453100);_0xcef2b5(_0x18bee3['error'](0x1f4,_0x4a9abf[_0xf326('0x11')]));});});}; \ 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(_0x1cfa0d,_0x4391f2){var _0xe33279=function(_0x3ce7c1){while(--_0x3ce7c1){_0x1cfa0d['push'](_0x1cfa0d['shift']());}};_0xe33279(++_0x4391f2);}(_0xa41a,0x6b));var _0xaa41=function(_0x488289,_0x4fceb3){_0x488289=_0x488289-0x0;var _0x509803=_0xa41a[_0x488289];return _0x509803;};'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 04e2cb1..761961a 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 _0xe5a2=['isAuthenticated','canUpdate','/reset','reset','/pull','/restart','restart','migrations','express','Router','../../components/auth/service','./version.controller','get','/fetch'];(function(_0x1eb21d,_0x33a68b){var _0x43a875=function(_0x2ba9bd){while(--_0x2ba9bd){_0x1eb21d['push'](_0x1eb21d['shift']());}};_0x43a875(++_0x33a68b);}(_0xe5a2,0x166));var _0x2e5a=function(_0x33c8cd,_0xee1e23){_0x33c8cd=_0x33c8cd-0x0;var _0x4c28fb=_0xe5a2[_0x33c8cd];return _0x4c28fb;};'use strict';var express=require(_0x2e5a('0x0'));var router=express[_0x2e5a('0x1')]();var auth=require(_0x2e5a('0x2'));var controller=require(_0x2e5a('0x3'));router['get']('/',controller['index']);router[_0x2e5a('0x4')](_0x2e5a('0x5'),auth[_0x2e5a('0x6')](),auth[_0x2e5a('0x7')](),controller['fetch']);router[_0x2e5a('0x4')](_0x2e5a('0x8'),auth[_0x2e5a('0x6')](),auth[_0x2e5a('0x7')](),controller[_0x2e5a('0x9')]);router[_0x2e5a('0x4')](_0x2e5a('0xa'),auth['isAuthenticated'](),auth[_0x2e5a('0x7')](),controller['pull']);router['get'](_0x2e5a('0xb'),auth[_0x2e5a('0x6')](),controller[_0x2e5a('0xc')]);router['get']('/migrations',controller[_0x2e5a('0xd')]);module['exports']=router; \ No newline at end of file +var _0xe4d9=['isAuthenticated','canUpdate','fetch','/reset','reset','/pull','pull','/restart','restart','/migrations','exports','express','Router','../../components/auth/service','./version.controller','get','index','/fetch'];(function(_0x31c79e,_0x147bb8){var _0x2cb956=function(_0x1acb56){while(--_0x1acb56){_0x31c79e['push'](_0x31c79e['shift']());}};_0x2cb956(++_0x147bb8);}(_0xe4d9,0x119));var _0x9e4d=function(_0x4bb560,_0x1c49a8){_0x4bb560=_0x4bb560-0x0;var _0x71157a=_0xe4d9[_0x4bb560];return _0x71157a;};'use strict';var express=require(_0x9e4d('0x0'));var router=express[_0x9e4d('0x1')]();var auth=require(_0x9e4d('0x2'));var controller=require(_0x9e4d('0x3'));router[_0x9e4d('0x4')]('/',controller[_0x9e4d('0x5')]);router['get'](_0x9e4d('0x6'),auth[_0x9e4d('0x7')](),auth[_0x9e4d('0x8')](),controller[_0x9e4d('0x9')]);router[_0x9e4d('0x4')](_0x9e4d('0xa'),auth[_0x9e4d('0x7')](),auth[_0x9e4d('0x8')](),controller[_0x9e4d('0xb')]);router[_0x9e4d('0x4')](_0x9e4d('0xc'),auth[_0x9e4d('0x7')](),auth[_0x9e4d('0x8')](),controller[_0x9e4d('0xd')]);router[_0x9e4d('0x4')](_0x9e4d('0xe'),auth[_0x9e4d('0x7')](),controller[_0x9e4d('0xf')]);router[_0x9e4d('0x4')](_0x9e4d('0x10'),controller['migrations']);module[_0x9e4d('0x11')]=router; \ No newline at end of file diff --git a/server/api/version/version.controller.js b/server/api/version/version.controller.js index 476b91f..fb5b7e3 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 _0x3952=['replace','.js','sort','sequelize','Migration','getQueryInterface','constructor','Migration\x20tried\x20to\x20use\x20old\x20style\x20\x22done\x22\x20callback.\x20Please\x20upgrade\x20to\x20\x22umzug\x22\x20and\x20return\x20a\x20promise\x20instead.','join','root','map','Database\x20migrated\x20successfully\x20from\x20version\x20','last','UniqueConstraintError','Database\x20already\x20up-to-date','path','lodash','version','exec','../../config/pm2','../../config/logger','exports','query','latest','fetch','tags','status','json','origin','master','error','git\x20fetch','git\x20fetch\x20origin\x20master','reset','--hard','FETCH_HEAD','info','git\x20reset\x20--hard\x20FETCH_HEAD','git\x20reset\x20--hard','pull','npm\x20install\x20--production','restart','motion2','then','catch','migrations','readdirSync','server','length'];(function(_0x6131cd,_0x4c26a1){var _0x47e916=function(_0x1f2bce){while(--_0x1f2bce){_0x6131cd['push'](_0x6131cd['shift']());}};_0x47e916(++_0x4c26a1);}(_0x3952,0xd3));var _0x2395=function(_0x1bc013,_0x7771c6){_0x1bc013=_0x1bc013-0x0;var _0x55df36=_0x3952[_0x1bc013];return _0x55df36;};'use strict';var Umzug=require('umzug');var path=require(_0x2395('0x0'));var fs=require('fs');var _=require(_0x2395('0x1'));var pkginfo=require('pkginfo')(module,_0x2395('0x2'));var compareVersions=require('compare-versions');var exec=require('child_process')[_0x2395('0x3')];var db=require('../../mysqldb')['db'];var config=require('../../config/environment');var pm2=require(_0x2395('0x4'));var logger=require(_0x2395('0x5'))('update');var git=require('simple-git')(config['root']);exports['index']=function(_0x3dbd04,_0x111b4d){var _0x380871={'current':module[_0x2395('0x6')][_0x2395('0x2')],'phonebar':0x2};if(_0x3dbd04[_0x2395('0x7')]&&_0x3dbd04[_0x2395('0x7')][_0x2395('0x8')]){return git[_0x2395('0x9')]()[_0x2395('0xa')](function(_0x42198f,_0x507463){_0x380871['latest']=(_0x42198f?module[_0x2395('0x6')][_0x2395('0x2')]:_0x507463[_0x2395('0x8')])||'2.0.0';return _0x111b4d[_0x2395('0xb')](0xc8)[_0x2395('0xc')](_0x380871);});}else{return _0x111b4d[_0x2395('0xb')](0xc8)[_0x2395('0xc')](_0x380871);}};exports['fetch']=function(_0x49b044,_0x277869){return git[_0x2395('0x9')]([_0x2395('0xd'),_0x2395('0xe')],function(_0x51218f){if(_0x51218f){logger[_0x2395('0xf')](_0x51218f);return _0x277869[_0x2395('0xb')](0x1f4)[_0x2395('0xc')](_0x51218f);}logger['info'](_0x2395('0x10'));return _0x277869[_0x2395('0xb')](0xc8)[_0x2395('0xc')]({'output':_0x2395('0x11')});});};exports[_0x2395('0x12')]=function(_0x487a98,_0x462b6f){return git[_0x2395('0x12')]([_0x2395('0x13'),_0x2395('0x14')],function(_0x5b756d){if(_0x5b756d){logger['error'](_0x5b756d);return _0x462b6f[_0x2395('0xb')](0x1f4)[_0x2395('0xc')](_0x5b756d);}logger[_0x2395('0x15')](_0x2395('0x16'));return _0x462b6f[_0x2395('0xb')](0xc8)[_0x2395('0xc')]({'output':_0x2395('0x17')});});};exports[_0x2395('0x18')]=function(_0x41d509,_0x36ba34){exec(_0x2395('0x19'),function(_0x18090f,_0x3ddae9,_0x1672e7){logger['info'](_0x3ddae9);logger[_0x2395('0x15')](_0x1672e7);if(_0x18090f){logger[_0x2395('0xf')](_0x18090f);return _0x36ba34['status'](0x1f4)[_0x2395('0xc')](_0x18090f);}return _0x36ba34[_0x2395('0xb')](0xc8)[_0x2395('0xc')]({'output':_0x3ddae9});});};exports[_0x2395('0x1a')]=function(_0x3d4b4b,_0x11cff8){return pm2['restart'](_0x2395('0x1b'))[_0x2395('0x1c')](function(_0x22f51c){logger['info']('pm2\x20restart\x20motion\x20%s',_0x22f51c);return _0x11cff8[_0x2395('0xb')](0xc8)[_0x2395('0xc')]({'output':'Your\x20system\x20has\x20been\x20restart\x20successfully'});})[_0x2395('0x1d')](function(_0x44679e){logger[_0x2395('0xf')](_0x44679e);return _0x11cff8['status'](0x1f4)[_0x2395('0xc')](_0x44679e);});};exports[_0x2395('0x1e')]=function(_0x5c19d9,_0x524a3f){var _0x60beb3=fs[_0x2395('0x1f')](path['join'](config['root'],_0x2395('0x20'),_0x2395('0x1e')));var _0x54fdec=[];for(var _0x132e3a=0x0;_0x132e3a<_0x60beb3[_0x2395('0x21')];_0x132e3a++){var _0x3f547c=_0x60beb3[_0x132e3a][_0x2395('0x22')](_0x2395('0x23'),'');if(compareVersions(module['exports']['version'],_0x3f547c)===-0x1){_0x54fdec['push'](_0x3f547c);}}if(_0x54fdec['length']){var _0x311089=_0x54fdec[_0x2395('0x24')](compareVersions);var _0x110860=new Umzug({'storage':_0x2395('0x25'),'storageOptions':{'model':db[_0x2395('0x26')],'modelName':_0x2395('0x26'),'columnName':'version'},'migrations':{'params':[db[_0x2395('0x25')][_0x2395('0x27')](),db['sequelize'][_0x2395('0x28')],function(){throw new Error(_0x2395('0x29'));}],'path':path[_0x2395('0x2a')](config[_0x2395('0x2b')],_0x2395('0x20'),'migrations'),'pattern':/\.js$/}});_0x110860['up']({'migrations':_[_0x2395('0x2c')](_0x311089,function(_0x2d282a){return _0x2d282a+_0x2395('0x23');})})[_0x2395('0x1c')](function(){return _0x524a3f[_0x2395('0xb')](0xc8)['json']({'output':_0x2395('0x2d')+module[_0x2395('0x6')][_0x2395('0x2')]+'\x20to\x20'+_[_0x2395('0x2e')](_0x311089),'migrations':_[_0x2395('0x2a')](_0x311089)});})[_0x2395('0x1d')](function(_0x4997c5){if(_0x4997c5 instanceof db[_0x2395('0x25')][_0x2395('0x2f')]){return _0x524a3f[_0x2395('0xb')](0xc8)['json']({'output':_0x2395('0x30')});}else{return _0x524a3f['status'](0x1f4)[_0x2395('0xc')](_0x4997c5);}});}else{return _0x524a3f[_0x2395('0xb')](0xc8)[_0x2395('0xc')]({'output':_0x2395('0x30')});}}; \ No newline at end of file +var _0x3b88=['exports','query','latest','tags','2.0.0','status','json','fetch','origin','master','error','info','git\x20fetch\x20origin\x20master','reset','FETCH_HEAD','git\x20reset\x20--hard\x20FETCH_HEAD','git\x20reset\x20--hard','npm\x20install\x20--production','restart','motion2','then','pm2\x20restart\x20motion\x20%s','migrations','readdirSync','join','root','replace','.js','length','sort','sequelize','Migration','getQueryInterface','Migration\x20tried\x20to\x20use\x20old\x20style\x20\x22done\x22\x20callback.\x20Please\x20upgrade\x20to\x20\x22umzug\x22\x20and\x20return\x20a\x20promise\x20instead.','map','Database\x20migrated\x20successfully\x20from\x20version\x20','\x20to\x20','last','catch','Database\x20already\x20up-to-date','path','lodash','pkginfo','version','child_process','exec','../../mysqldb','../../config/pm2','../../config/logger','update','simple-git','index'];(function(_0x543242,_0xeac9fd){var _0x4c99b6=function(_0x47d087){while(--_0x47d087){_0x543242['push'](_0x543242['shift']());}};_0x4c99b6(++_0xeac9fd);}(_0x3b88,0xc4));var _0x83b8=function(_0x5d45c2,_0x4fae95){_0x5d45c2=_0x5d45c2-0x0;var _0x35c5c4=_0x3b88[_0x5d45c2];return _0x35c5c4;};'use strict';var Umzug=require('umzug');var path=require(_0x83b8('0x0'));var fs=require('fs');var _=require(_0x83b8('0x1'));var pkginfo=require(_0x83b8('0x2'))(module,_0x83b8('0x3'));var compareVersions=require('compare-versions');var exec=require(_0x83b8('0x4'))[_0x83b8('0x5')];var db=require(_0x83b8('0x6'))['db'];var config=require('../../config/environment');var pm2=require(_0x83b8('0x7'));var logger=require(_0x83b8('0x8'))(_0x83b8('0x9'));var git=require(_0x83b8('0xa'))(config['root']);exports[_0x83b8('0xb')]=function(_0x496320,_0x348890){var _0xdd5e60={'current':module[_0x83b8('0xc')][_0x83b8('0x3')],'phonebar':0x2};if(_0x496320[_0x83b8('0xd')]&&_0x496320['query'][_0x83b8('0xe')]){return git['fetch']()[_0x83b8('0xf')](function(_0x11f7c8,_0x19c21c){_0xdd5e60[_0x83b8('0xe')]=(_0x11f7c8?module[_0x83b8('0xc')]['version']:_0x19c21c[_0x83b8('0xe')])||_0x83b8('0x10');return _0x348890[_0x83b8('0x11')](0xc8)[_0x83b8('0x12')](_0xdd5e60);});}else{return _0x348890['status'](0xc8)[_0x83b8('0x12')](_0xdd5e60);}};exports[_0x83b8('0x13')]=function(_0x16e5bf,_0x2aaff4){return git[_0x83b8('0x13')]([_0x83b8('0x14'),_0x83b8('0x15')],function(_0x383429){if(_0x383429){logger[_0x83b8('0x16')](_0x383429);return _0x2aaff4[_0x83b8('0x11')](0x1f4)[_0x83b8('0x12')](_0x383429);}logger[_0x83b8('0x17')]('git\x20fetch');return _0x2aaff4[_0x83b8('0x11')](0xc8)[_0x83b8('0x12')]({'output':_0x83b8('0x18')});});};exports[_0x83b8('0x19')]=function(_0x47bf0e,_0x58c156){return git['reset'](['--hard',_0x83b8('0x1a')],function(_0x47088d){if(_0x47088d){logger['error'](_0x47088d);return _0x58c156[_0x83b8('0x11')](0x1f4)['json'](_0x47088d);}logger['info'](_0x83b8('0x1b'));return _0x58c156['status'](0xc8)['json']({'output':_0x83b8('0x1c')});});};exports['pull']=function(_0x8c4256,_0x44abd5){exec(_0x83b8('0x1d'),function(_0x372831,_0x2aeb76,_0x83960a){logger[_0x83b8('0x17')](_0x2aeb76);logger[_0x83b8('0x17')](_0x83960a);if(_0x372831){logger[_0x83b8('0x16')](_0x372831);return _0x44abd5[_0x83b8('0x11')](0x1f4)[_0x83b8('0x12')](_0x372831);}return _0x44abd5[_0x83b8('0x11')](0xc8)[_0x83b8('0x12')]({'output':_0x2aeb76});});};exports['restart']=function(_0x14c1a0,_0x2b5647){return pm2[_0x83b8('0x1e')](_0x83b8('0x1f'))[_0x83b8('0x20')](function(_0x544d7e){logger[_0x83b8('0x17')](_0x83b8('0x21'),_0x544d7e);return _0x2b5647[_0x83b8('0x11')](0xc8)[_0x83b8('0x12')]({'output':'Your\x20system\x20has\x20been\x20restart\x20successfully'});})['catch'](function(_0x4e112e){logger['error'](_0x4e112e);return _0x2b5647[_0x83b8('0x11')](0x1f4)[_0x83b8('0x12')](_0x4e112e);});};exports[_0x83b8('0x22')]=function(_0x50a1cb,_0x357069){var _0xc2be48=fs[_0x83b8('0x23')](path[_0x83b8('0x24')](config[_0x83b8('0x25')],'server','migrations'));var _0x1bc946=[];for(var _0x4cb92a=0x0;_0x4cb92a<_0xc2be48['length'];_0x4cb92a++){var _0x43c2df=_0xc2be48[_0x4cb92a][_0x83b8('0x26')](_0x83b8('0x27'),'');if(compareVersions(module[_0x83b8('0xc')][_0x83b8('0x3')],_0x43c2df)===-0x1){_0x1bc946['push'](_0x43c2df);}}if(_0x1bc946[_0x83b8('0x28')]){var _0x156703=_0x1bc946[_0x83b8('0x29')](compareVersions);var _0x1c9d36=new Umzug({'storage':_0x83b8('0x2a'),'storageOptions':{'model':db[_0x83b8('0x2b')],'modelName':_0x83b8('0x2b'),'columnName':'version'},'migrations':{'params':[db['sequelize'][_0x83b8('0x2c')](),db[_0x83b8('0x2a')]['constructor'],function(){throw new Error(_0x83b8('0x2d'));}],'path':path['join'](config[_0x83b8('0x25')],'server',_0x83b8('0x22')),'pattern':/\.js$/}});_0x1c9d36['up']({'migrations':_[_0x83b8('0x2e')](_0x156703,function(_0x529be9){return _0x529be9+'.js';})})[_0x83b8('0x20')](function(){return _0x357069[_0x83b8('0x11')](0xc8)['json']({'output':_0x83b8('0x2f')+module[_0x83b8('0xc')]['version']+_0x83b8('0x30')+_[_0x83b8('0x31')](_0x156703),'migrations':_[_0x83b8('0x24')](_0x156703)});})[_0x83b8('0x32')](function(_0x1e6658){if(_0x1e6658 instanceof db[_0x83b8('0x2a')]['UniqueConstraintError']){return _0x357069['status'](0xc8)[_0x83b8('0x12')]({'output':_0x83b8('0x33')});}else{return _0x357069[_0x83b8('0x11')](0x1f4)[_0x83b8('0x12')](_0x1e6658);}});}else{return _0x357069['status'](0xc8)[_0x83b8('0x12')]({'output':'Database\x20already\x20up-to-date'});}}; \ No newline at end of file diff --git a/server/api/voiceAgentReport/index.js b/server/api/voiceAgentReport/index.js index 59c420c..5533288 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 _0xf321=['./voiceAgentReport.controller','isAuthenticated','get','/describe','/:id','post','create','put','update','delete','destroy','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment'];(function(_0x22634f,_0x47120f){var _0x27a216=function(_0x22ffff){while(--_0x22ffff){_0x22634f['push'](_0x22634f['shift']());}};_0x27a216(++_0x47120f);}(_0xf321,0x10f));var _0x1f32=function(_0x48a48e,_0x5d96bd){_0x48a48e=_0x48a48e-0x0;var _0xe70df3=_0xf321[_0x48a48e];return _0xe70df3;};'use strict';var multer=require('multer');var util=require(_0x1f32('0x0'));var path=require(_0x1f32('0x1'));var timeout=require(_0x1f32('0x2'));var express=require(_0x1f32('0x3'));var router=express[_0x1f32('0x4')]();var fs_extra=require(_0x1f32('0x5'));var auth=require(_0x1f32('0x6'));var interaction=require(_0x1f32('0x7'));var config=require(_0x1f32('0x8'));var controller=require(_0x1f32('0x9'));router['get']('/',auth[_0x1f32('0xa')](),controller['index']);router[_0x1f32('0xb')](_0x1f32('0xc'),auth[_0x1f32('0xa')](),controller['describe']);router['get'](_0x1f32('0xd'),auth[_0x1f32('0xa')](),controller['show']);router[_0x1f32('0xe')]('/',auth[_0x1f32('0xa')](),controller[_0x1f32('0xf')]);router[_0x1f32('0x10')](_0x1f32('0xd'),auth[_0x1f32('0xa')](),controller[_0x1f32('0x11')]);router[_0x1f32('0x12')](_0x1f32('0xd'),auth[_0x1f32('0xa')](),controller[_0x1f32('0x13')]);module['exports']=router; \ No newline at end of file +var _0xef34=['./voiceAgentReport.controller','get','isAuthenticated','/describe','show','post','create','put','/:id','delete','destroy','exports','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service','../../config/environment'];(function(_0x51e38c,_0x3b8494){var _0x4b2087=function(_0x2682ef){while(--_0x2682ef){_0x51e38c['push'](_0x51e38c['shift']());}};_0x4b2087(++_0x3b8494);}(_0xef34,0xdd));var _0x4ef3=function(_0x2ab3ab,_0x4e7b2c){_0x2ab3ab=_0x2ab3ab-0x0;var _0x139a7f=_0xef34[_0x2ab3ab];return _0x139a7f;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x4ef3('0x0'));var timeout=require(_0x4ef3('0x1'));var express=require(_0x4ef3('0x2'));var router=express[_0x4ef3('0x3')]();var fs_extra=require(_0x4ef3('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0x4ef3('0x5'));var config=require(_0x4ef3('0x6'));var controller=require(_0x4ef3('0x7'));router[_0x4ef3('0x8')]('/',auth[_0x4ef3('0x9')](),controller['index']);router[_0x4ef3('0x8')](_0x4ef3('0xa'),auth['isAuthenticated'](),controller['describe']);router[_0x4ef3('0x8')]('/:id',auth[_0x4ef3('0x9')](),controller[_0x4ef3('0xb')]);router[_0x4ef3('0xc')]('/',auth[_0x4ef3('0x9')](),controller[_0x4ef3('0xd')]);router[_0x4ef3('0xe')](_0x4ef3('0xf'),auth[_0x4ef3('0x9')](),controller['update']);router[_0x4ef3('0x10')]('/:id',auth['isAuthenticated'](),controller[_0x4ef3('0x11')]);module[_0x4ef3('0x12')]=router; \ No newline at end of file diff --git a/server/api/voiceAgentReport/voiceAgentReport.attributes.js b/server/api/voiceAgentReport/voiceAgentReport.attributes.js index 584d7d5..81f3636 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 _0x1a37=['STRING','DATE','INTEGER','BOOLEAN','FORWARD,\x20BLIND,\x20ATTENDED','sequelize','exports'];(function(_0x510d50,_0x284a40){var _0x5eead6=function(_0x589bbe){while(--_0x589bbe){_0x510d50['push'](_0x510d50['shift']());}};_0x5eead6(++_0x284a40);}(_0x1a37,0xb4));var _0x71a3=function(_0xd09668,_0x1435b2){_0xd09668=_0xd09668-0x0;var _0x68726=_0x1a37[_0xd09668];return _0x68726;};'use strict';var Sequelize=require(_0x71a3('0x0'));module[_0x71a3('0x1')]={'type':{'type':Sequelize[_0x71a3('0x2')]},'uniqueid':{'type':Sequelize[_0x71a3('0x2')]},'calleridnum':{'type':Sequelize[_0x71a3('0x2')]},'calleridname':{'type':Sequelize[_0x71a3('0x2')]},'queue':{'type':Sequelize[_0x71a3('0x2')]},'interface':{'type':Sequelize[_0x71a3('0x2')]},'membername':{'type':Sequelize[_0x71a3('0x2')]},'agentcalledAt':{'type':Sequelize[_0x71a3('0x3')]},'agentconnectAt':{'type':Sequelize['DATE']},'agentcompleteAt':{'type':Sequelize[_0x71a3('0x3')]},'agentringnoanswerAt':{'type':Sequelize['DATE']},'agentdumpAt':{'type':Sequelize[_0x71a3('0x3')]},'holdtime':{'type':Sequelize[_0x71a3('0x4')]},'agentcomplete':{'type':Sequelize[_0x71a3('0x5')],'defaultValue':![]},'agentringnoanswer':{'type':Sequelize[_0x71a3('0x5')],'defaultValue':![]},'agentdump':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'talktime':{'type':Sequelize['INTEGER']},'agentacw':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'acwtime':{'type':Sequelize['INTEGER']},'reason':{'type':Sequelize[_0x71a3('0x2')]},'lastevent':{'type':Sequelize[_0x71a3('0x2')]},'channel':{'type':Sequelize[_0x71a3('0x2')]},'channelstate':{'type':Sequelize[_0x71a3('0x4')]},'channelstatedesc':{'type':Sequelize[_0x71a3('0x2')]},'connectedlinenum':{'type':Sequelize[_0x71a3('0x2')]},'connectedlinename':{'type':Sequelize[_0x71a3('0x2')]},'language':{'type':Sequelize[_0x71a3('0x2')]},'accountcode':{'type':Sequelize['STRING']},'context':{'type':Sequelize['STRING']},'exten':{'type':Sequelize['STRING']},'priority':{'type':Sequelize[_0x71a3('0x2')]},'destchannel':{'type':Sequelize[_0x71a3('0x2')]},'destchannelstate':{'type':Sequelize[_0x71a3('0x4')]},'destchannelstatedesc':{'type':Sequelize[_0x71a3('0x2')]},'destcalleridnum':{'type':Sequelize[_0x71a3('0x2')]},'destcalleridname':{'type':Sequelize[_0x71a3('0x2')]},'destconnectedlinenum':{'type':Sequelize[_0x71a3('0x2')]},'destconnectedlinename':{'type':Sequelize[_0x71a3('0x2')]},'destlanguage':{'type':Sequelize[_0x71a3('0x2')]},'destaccountcode':{'type':Sequelize[_0x71a3('0x2')]},'destcontext':{'type':Sequelize[_0x71a3('0x2')]},'destexten':{'type':Sequelize['STRING']},'destpriority':{'type':Sequelize[_0x71a3('0x2')]},'destuniqueid':{'type':Sequelize[_0x71a3('0x2')]},'answeredelsewheredestinationuniqueid':{'type':Sequelize['STRING']},'answeredelsewheremembername':{'type':Sequelize['STRING']},'transfer':{'type':Sequelize[_0x71a3('0x5')],'defaultValue':![]},'transfertype':{'type':Sequelize[_0x71a3('0x2')],'comment':_0x71a3('0x6')},'transferexten':{'type':Sequelize[_0x71a3('0x2')]},'transferuniqueid':{'type':Sequelize[_0x71a3('0x2')]},'agententerreason':{'type':Sequelize[_0x71a3('0x4')],'defaultValue':0x0}}; \ No newline at end of file +var _0x2d0b=['exports','STRING','DATE','INTEGER','BOOLEAN','FORWARD,\x20BLIND,\x20ATTENDED'];(function(_0x15e688,_0x4fd347){var _0x213e36=function(_0x1a12c8){while(--_0x1a12c8){_0x15e688['push'](_0x15e688['shift']());}};_0x213e36(++_0x4fd347);}(_0x2d0b,0x102));var _0xb2d0=function(_0x4f14b6,_0x4d96ce){_0x4f14b6=_0x4f14b6-0x0;var _0x259e6a=_0x2d0b[_0x4f14b6];return _0x259e6a;};'use strict';var Sequelize=require('sequelize');module[_0xb2d0('0x0')]={'type':{'type':Sequelize[_0xb2d0('0x1')]},'uniqueid':{'type':Sequelize[_0xb2d0('0x1')]},'calleridnum':{'type':Sequelize['STRING']},'calleridname':{'type':Sequelize[_0xb2d0('0x1')]},'queue':{'type':Sequelize[_0xb2d0('0x1')]},'interface':{'type':Sequelize[_0xb2d0('0x1')]},'membername':{'type':Sequelize[_0xb2d0('0x1')]},'agentcalledAt':{'type':Sequelize['DATE']},'agentconnectAt':{'type':Sequelize[_0xb2d0('0x2')]},'agentcompleteAt':{'type':Sequelize['DATE']},'agentringnoanswerAt':{'type':Sequelize[_0xb2d0('0x2')]},'agentdumpAt':{'type':Sequelize[_0xb2d0('0x2')]},'holdtime':{'type':Sequelize[_0xb2d0('0x3')]},'agentcomplete':{'type':Sequelize[_0xb2d0('0x4')],'defaultValue':![]},'agentringnoanswer':{'type':Sequelize[_0xb2d0('0x4')],'defaultValue':![]},'agentdump':{'type':Sequelize[_0xb2d0('0x4')],'defaultValue':![]},'talktime':{'type':Sequelize[_0xb2d0('0x3')]},'agentacw':{'type':Sequelize[_0xb2d0('0x4')],'defaultValue':![]},'acwtime':{'type':Sequelize[_0xb2d0('0x3')]},'reason':{'type':Sequelize[_0xb2d0('0x1')]},'lastevent':{'type':Sequelize[_0xb2d0('0x1')]},'channel':{'type':Sequelize['STRING']},'channelstate':{'type':Sequelize['INTEGER']},'channelstatedesc':{'type':Sequelize['STRING']},'connectedlinenum':{'type':Sequelize[_0xb2d0('0x1')]},'connectedlinename':{'type':Sequelize['STRING']},'language':{'type':Sequelize['STRING']},'accountcode':{'type':Sequelize['STRING']},'context':{'type':Sequelize[_0xb2d0('0x1')]},'exten':{'type':Sequelize[_0xb2d0('0x1')]},'priority':{'type':Sequelize[_0xb2d0('0x1')]},'destchannel':{'type':Sequelize['STRING']},'destchannelstate':{'type':Sequelize[_0xb2d0('0x3')]},'destchannelstatedesc':{'type':Sequelize['STRING']},'destcalleridnum':{'type':Sequelize[_0xb2d0('0x1')]},'destcalleridname':{'type':Sequelize[_0xb2d0('0x1')]},'destconnectedlinenum':{'type':Sequelize[_0xb2d0('0x1')]},'destconnectedlinename':{'type':Sequelize[_0xb2d0('0x1')]},'destlanguage':{'type':Sequelize[_0xb2d0('0x1')]},'destaccountcode':{'type':Sequelize[_0xb2d0('0x1')]},'destcontext':{'type':Sequelize[_0xb2d0('0x1')]},'destexten':{'type':Sequelize[_0xb2d0('0x1')]},'destpriority':{'type':Sequelize[_0xb2d0('0x1')]},'destuniqueid':{'type':Sequelize[_0xb2d0('0x1')]},'answeredelsewheredestinationuniqueid':{'type':Sequelize[_0xb2d0('0x1')]},'answeredelsewheremembername':{'type':Sequelize[_0xb2d0('0x1')]},'transfer':{'type':Sequelize[_0xb2d0('0x4')],'defaultValue':![]},'transfertype':{'type':Sequelize[_0xb2d0('0x1')],'comment':_0xb2d0('0x5')},'transferexten':{'type':Sequelize['STRING']},'transferuniqueid':{'type':Sequelize[_0xb2d0('0x1')]},'agententerreason':{'type':Sequelize['INTEGER'],'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 5300eaf..6aa406c 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(_0x12f688,_0x585c25){var _0x59c3de=function(_0x4ac301){while(--_0x4ac301){_0x12f688['push'](_0x12f688['shift']());}};_0x59c3de(++_0x585c25);}(_0xa9e0,0x123));var _0x0a9e=function(_0x1b828b,_0x344400){_0x1b828b=_0x1b828b-0x0;var _0x98da1a=_0xa9e0[_0x1b828b];return _0x98da1a;};'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(_0x2e4e19,_0x493b50){var _0x9ba20b=function(_0x2f6456){while(--_0x2f6456){_0x2e4e19['push'](_0x2e4e19['shift']());}};_0x9ba20b(++_0x493b50);}(_0xa9e0,0x123));var _0x0a9e=function(_0x2763f2,_0x416af8){_0x2763f2=_0x2763f2-0x0;var _0x3ef471=_0xa9e0[_0x2763f2];return _0x3ef471;};'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 f3527f0..b8cb0fd 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 _0x6bff=['bluebird','request-promise','path','rimraf','./voiceAgentReport.attributes','exports','define','VoiceAgentReport','report_agent','uniqueid','lodash','util','api'];(function(_0x1113d9,_0x52cd99){var _0x4a5aa2=function(_0x1f0b6e){while(--_0x1f0b6e){_0x1113d9['push'](_0x1113d9['shift']());}};_0x4a5aa2(++_0x52cd99);}(_0x6bff,0xa6));var _0xf6bf=function(_0x218fd8,_0x593900){_0x218fd8=_0x218fd8-0x0;var _0xb1fb78=_0x6bff[_0x218fd8];return _0xb1fb78;};'use strict';var _=require(_0xf6bf('0x0'));var util=require(_0xf6bf('0x1'));var logger=require('../../config/logger')(_0xf6bf('0x2'));var moment=require('moment');var BPromise=require(_0xf6bf('0x3'));var rp=require(_0xf6bf('0x4'));var fs=require('fs');var path=require(_0xf6bf('0x5'));var rimraf=require(_0xf6bf('0x6'));var config=require('../../config/environment');var attributes=require(_0xf6bf('0x7'));module[_0xf6bf('0x8')]=function(_0x27cdda,_0x239d17){return _0x27cdda[_0xf6bf('0x9')](_0xf6bf('0xa'),attributes,{'tableName':_0xf6bf('0xb'),'paranoid':![],'indexes':[{'fields':[_0xf6bf('0xc'),'destuniqueid']}],'timestamps':!![]});}; \ No newline at end of file +var _0x98a8=['../../config/environment','./voiceAgentReport.attributes','exports','define','report_agent','destuniqueid','lodash','util','../../config/logger','api','moment','bluebird','request-promise','rimraf'];(function(_0x11c115,_0x43ea93){var _0x41e4f8=function(_0x24ac81){while(--_0x24ac81){_0x11c115['push'](_0x11c115['shift']());}};_0x41e4f8(++_0x43ea93);}(_0x98a8,0x12c));var _0x898a=function(_0x49b434,_0x35e42a){_0x49b434=_0x49b434-0x0;var _0x5ec113=_0x98a8[_0x49b434];return _0x5ec113;};'use strict';var _=require(_0x898a('0x0'));var util=require(_0x898a('0x1'));var logger=require(_0x898a('0x2'))(_0x898a('0x3'));var moment=require(_0x898a('0x4'));var BPromise=require(_0x898a('0x5'));var rp=require(_0x898a('0x6'));var fs=require('fs');var path=require('path');var rimraf=require(_0x898a('0x7'));var config=require(_0x898a('0x8'));var attributes=require(_0x898a('0x9'));module[_0x898a('0xa')]=function(_0x3e7ddd,_0x5d7e59){return _0x3e7ddd[_0x898a('0xb')]('VoiceAgentReport',attributes,{'tableName':_0x898a('0xc'),'paranoid':![],'indexes':[{'fields':['uniqueid',_0x898a('0xd')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/voiceAgentReport/voiceAgentReport.rpc.js b/server/api/voiceAgentReport/voiceAgentReport.rpc.js index 070ec8a..808519e 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 _0x1fcf=['attributes','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','request','then','info','VoiceAgentReport,\x20%s,\x20%s','debug','VoiceAgentReport,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','message','result','catch','VoiceAgentReport','create','body','options','CreateVoiceAgentReport','UpdateVoiceAgentReport','update','raw','where'];(function(_0x47bd60,_0x385f18){var _0x379085=function(_0x1ae943){while(--_0x1ae943){_0x47bd60['push'](_0x47bd60['shift']());}};_0x379085(++_0x385f18);}(_0x1fcf,0x111));var _0xf1fc=function(_0x22cc16,_0x1f4fa2){_0x22cc16=_0x22cc16-0x0;var _0x399b70=_0x1fcf[_0x22cc16];return _0x399b70;};'use strict';var _=require(_0xf1fc('0x0'));var util=require(_0xf1fc('0x1'));var moment=require(_0xf1fc('0x2'));var BPromise=require(_0xf1fc('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xf1fc('0x4'));var db=require(_0xf1fc('0x5'))['db'];var utils=require(_0xf1fc('0x6'));var logger=require(_0xf1fc('0x7'))(_0xf1fc('0x8'));var config=require(_0xf1fc('0x9'));var jayson=require('jayson/promise');var client=jayson[_0xf1fc('0xa')][_0xf1fc('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x7fb3e3,_0x3ac2f9,_0x4dad3a){return new BPromise(function(_0x24b28e,_0x351fcd){return client[_0xf1fc('0xc')](_0x7fb3e3,_0x4dad3a)[_0xf1fc('0xd')](function(_0x4fdd48){logger[_0xf1fc('0xe')](_0xf1fc('0xf'),_0x3ac2f9,'request\x20sent');logger[_0xf1fc('0x10')](_0xf1fc('0x11'),_0x3ac2f9,_0xf1fc('0x12'),JSON[_0xf1fc('0x13')](_0x4fdd48));if(_0x4fdd48[_0xf1fc('0x14')]){if(_0x4fdd48[_0xf1fc('0x14')]['code']===0x1f4){logger['error'](_0xf1fc('0xf'),_0x3ac2f9,_0x4fdd48['error'][_0xf1fc('0x15')]);return _0x351fcd(_0x4fdd48[_0xf1fc('0x14')]['message']);}logger[_0xf1fc('0x14')](_0xf1fc('0xf'),_0x3ac2f9,_0x4fdd48[_0xf1fc('0x14')][_0xf1fc('0x15')]);return _0x24b28e(_0x4fdd48[_0xf1fc('0x14')][_0xf1fc('0x15')]);}else{logger[_0xf1fc('0xe')](_0xf1fc('0xf'),_0x3ac2f9,'request\x20sent');_0x24b28e(_0x4fdd48[_0xf1fc('0x16')][_0xf1fc('0x15')]);}})[_0xf1fc('0x17')](function(_0x1c3f3f){logger[_0xf1fc('0x14')](_0xf1fc('0xf'),_0x3ac2f9,_0x1c3f3f);_0x351fcd(_0x1c3f3f);});});}exports['CreateVoiceAgentReport']=function(_0x310376){var _0x466f86=this;return new Promise(function(_0x5cfc17,_0x9e5c09){return db[_0xf1fc('0x18')][_0xf1fc('0x19')](_0x310376[_0xf1fc('0x1a')],{'raw':_0x310376[_0xf1fc('0x1b')]?_0x310376['options']['raw']===undefined?!![]:![]:!![]})[_0xf1fc('0xd')](function(_0x3df8a7){logger[_0xf1fc('0xe')]('CreateVoiceAgentReport',_0x310376);logger[_0xf1fc('0x10')](_0xf1fc('0x1c'),_0x310376,JSON[_0xf1fc('0x13')](_0x3df8a7));_0x5cfc17(_0x3df8a7);})[_0xf1fc('0x17')](function(_0x28d2ce){logger[_0xf1fc('0x14')](_0xf1fc('0x1c'),_0x28d2ce[_0xf1fc('0x15')],_0x310376);_0x9e5c09(_0x466f86['error'](0x1f4,_0x28d2ce['message']));});});};exports[_0xf1fc('0x1d')]=function(_0x96b75c){var _0x59f505=this;return new Promise(function(_0x16f252,_0x55d48a){return db[_0xf1fc('0x18')][_0xf1fc('0x1e')](_0x96b75c['body'],{'raw':_0x96b75c[_0xf1fc('0x1b')]?_0x96b75c[_0xf1fc('0x1b')][_0xf1fc('0x1f')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x96b75c['options']?_0x96b75c[_0xf1fc('0x1b')][_0xf1fc('0x20')]||null:null,'attributes':_0x96b75c[_0xf1fc('0x1b')]?_0x96b75c[_0xf1fc('0x1b')][_0xf1fc('0x21')]||null:null,'limit':_0x96b75c[_0xf1fc('0x1b')]?_0x96b75c[_0xf1fc('0x1b')]['limit']||null:null})[_0xf1fc('0xd')](function(_0x3a3416){logger[_0xf1fc('0xe')](_0xf1fc('0x1d'),_0x96b75c);logger[_0xf1fc('0x10')](_0xf1fc('0x1d'),_0x96b75c,JSON[_0xf1fc('0x13')](_0x3a3416));_0x16f252(_0x3a3416);})[_0xf1fc('0x17')](function(_0x52f4ea){logger[_0xf1fc('0x14')](_0xf1fc('0x1d'),_0x52f4ea['message'],_0x96b75c);_0x55d48a(_0x59f505['error'](0x1f4,_0x52f4ea[_0xf1fc('0x15')]));});});}; \ No newline at end of file +var _0xfd18=['lodash','util','moment','bluebird','randomstring','ioredis','rpc','../../config/environment','jayson/promise','client','http','info','VoiceAgentReport,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','VoiceAgentReport,\x20%s,\x20%s','message','result','CreateVoiceAgentReport','create','raw','then','catch','UpdateVoiceAgentReport','VoiceAgentReport','update','body','options','attributes','limit','debug'];(function(_0x31c2fe,_0x37b843){var _0x17565e=function(_0xb272e2){while(--_0xb272e2){_0x31c2fe['push'](_0x31c2fe['shift']());}};_0x17565e(++_0x37b843);}(_0xfd18,0x16b));var _0x8fd1=function(_0x27c201,_0xd947bf){_0x27c201=_0x27c201-0x0;var _0x3cabde=_0xfd18[_0x27c201];return _0x3cabde;};'use strict';var _=require(_0x8fd1('0x0'));var util=require(_0x8fd1('0x1'));var moment=require(_0x8fd1('0x2'));var BPromise=require(_0x8fd1('0x3'));var rs=require(_0x8fd1('0x4'));var fs=require('fs');var Redis=require(_0x8fd1('0x5'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0x8fd1('0x6'));var config=require(_0x8fd1('0x7'));var jayson=require(_0x8fd1('0x8'));var client=jayson[_0x8fd1('0x9')][_0x8fd1('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x50e0af,_0x47ee75,_0x24c4d5){return new BPromise(function(_0x27e60c,_0x4cf586){return client['request'](_0x50e0af,_0x24c4d5)['then'](function(_0x4e5c65){logger[_0x8fd1('0xb')]('VoiceAgentReport,\x20%s,\x20%s',_0x47ee75,'request\x20sent');logger['debug'](_0x8fd1('0xc'),_0x47ee75,_0x8fd1('0xd'),JSON[_0x8fd1('0xe')](_0x4e5c65));if(_0x4e5c65[_0x8fd1('0xf')]){if(_0x4e5c65[_0x8fd1('0xf')][_0x8fd1('0x10')]===0x1f4){logger[_0x8fd1('0xf')](_0x8fd1('0x11'),_0x47ee75,_0x4e5c65[_0x8fd1('0xf')]['message']);return _0x4cf586(_0x4e5c65[_0x8fd1('0xf')][_0x8fd1('0x12')]);}logger[_0x8fd1('0xf')](_0x8fd1('0x11'),_0x47ee75,_0x4e5c65[_0x8fd1('0xf')]['message']);return _0x27e60c(_0x4e5c65[_0x8fd1('0xf')]['message']);}else{logger['info'](_0x8fd1('0x11'),_0x47ee75,_0x8fd1('0xd'));_0x27e60c(_0x4e5c65[_0x8fd1('0x13')][_0x8fd1('0x12')]);}})['catch'](function(_0x30e0bc){logger[_0x8fd1('0xf')](_0x8fd1('0x11'),_0x47ee75,_0x30e0bc);_0x4cf586(_0x30e0bc);});});}exports[_0x8fd1('0x14')]=function(_0x573a29){var _0x5ad4f3=this;return new Promise(function(_0x684b66,_0x1ff58c){return db['VoiceAgentReport'][_0x8fd1('0x15')](_0x573a29['body'],{'raw':_0x573a29['options']?_0x573a29['options'][_0x8fd1('0x16')]===undefined?!![]:![]:!![]})[_0x8fd1('0x17')](function(_0x1155a3){logger[_0x8fd1('0xb')](_0x8fd1('0x14'),_0x573a29);logger['debug'](_0x8fd1('0x14'),_0x573a29,JSON[_0x8fd1('0xe')](_0x1155a3));_0x684b66(_0x1155a3);})[_0x8fd1('0x18')](function(_0x4ac506){logger['error'](_0x8fd1('0x14'),_0x4ac506[_0x8fd1('0x12')],_0x573a29);_0x1ff58c(_0x5ad4f3[_0x8fd1('0xf')](0x1f4,_0x4ac506[_0x8fd1('0x12')]));});});};exports[_0x8fd1('0x19')]=function(_0x36a827){var _0xc0607=this;return new Promise(function(_0x49d254,_0x10eebb){return db[_0x8fd1('0x1a')][_0x8fd1('0x1b')](_0x36a827[_0x8fd1('0x1c')],{'raw':_0x36a827[_0x8fd1('0x1d')]?_0x36a827[_0x8fd1('0x1d')][_0x8fd1('0x16')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x36a827['options']?_0x36a827[_0x8fd1('0x1d')]['where']||null:null,'attributes':_0x36a827['options']?_0x36a827['options'][_0x8fd1('0x1e')]||null:null,'limit':_0x36a827[_0x8fd1('0x1d')]?_0x36a827['options'][_0x8fd1('0x1f')]||null:null})[_0x8fd1('0x17')](function(_0x344350){logger[_0x8fd1('0xb')](_0x8fd1('0x19'),_0x36a827);logger[_0x8fd1('0x20')]('UpdateVoiceAgentReport',_0x36a827,JSON[_0x8fd1('0xe')](_0x344350));_0x49d254(_0x344350);})[_0x8fd1('0x18')](function(_0x2ff047){logger[_0x8fd1('0xf')]('UpdateVoiceAgentReport',_0x2ff047[_0x8fd1('0x12')],_0x36a827);_0x10eebb(_0xc0607[_0x8fd1('0xf')](0x1f4,_0x2ff047['message']));});});}; \ No newline at end of file diff --git a/server/api/voiceCallReport/index.js b/server/api/voiceCallReport/index.js index 846f965..5d6785b 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 _0x6c7b=['./voiceCallReport.controller','get','isAuthenticated','index','describe','/:id','show','post','update','delete','destroy','multer','express','fs-extra','../../components/auth/service','../../components/interaction/service'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x6c7b,0x10b));var _0xb6c7=function(_0x2aff11,_0x4a1023){_0x2aff11=_0x2aff11-0x0;var _0x1c6bd1=_0x6c7b[_0x2aff11];return _0x1c6bd1;};'use strict';var multer=require(_0xb6c7('0x0'));var util=require('util');var path=require('path');var timeout=require('connect-timeout');var express=require(_0xb6c7('0x1'));var router=express['Router']();var fs_extra=require(_0xb6c7('0x2'));var auth=require(_0xb6c7('0x3'));var interaction=require(_0xb6c7('0x4'));var config=require('../../config/environment');var controller=require(_0xb6c7('0x5'));router[_0xb6c7('0x6')]('/',auth[_0xb6c7('0x7')](),controller[_0xb6c7('0x8')]);router[_0xb6c7('0x6')]('/describe',auth[_0xb6c7('0x7')](),controller[_0xb6c7('0x9')]);router[_0xb6c7('0x6')](_0xb6c7('0xa'),auth[_0xb6c7('0x7')](),controller[_0xb6c7('0xb')]);router[_0xb6c7('0xc')]('/',auth[_0xb6c7('0x7')](),controller['create']);router['put'](_0xb6c7('0xa'),auth[_0xb6c7('0x7')](),controller[_0xb6c7('0xd')]);router[_0xb6c7('0xe')](_0xb6c7('0xa'),auth[_0xb6c7('0x7')](),controller[_0xb6c7('0xf')]);module['exports']=router; \ No newline at end of file +var _0xac31=['update','delete','destroy','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service','../../config/environment','isAuthenticated','index','get','/describe','show','post','create','put','/:id'];(function(_0x156a58,_0x837b28){var _0x1bc56e=function(_0x5f3bcf){while(--_0x5f3bcf){_0x156a58['push'](_0x156a58['shift']());}};_0x1bc56e(++_0x837b28);}(_0xac31,0xca));var _0x1ac3=function(_0x440b3e,_0x36304f){_0x440b3e=_0x440b3e-0x0;var _0x464e11=_0xac31[_0x440b3e];return _0x464e11;};'use strict';var multer=require(_0x1ac3('0x0'));var util=require(_0x1ac3('0x1'));var path=require(_0x1ac3('0x2'));var timeout=require(_0x1ac3('0x3'));var express=require(_0x1ac3('0x4'));var router=express[_0x1ac3('0x5')]();var fs_extra=require(_0x1ac3('0x6'));var auth=require('../../components/auth/service');var interaction=require(_0x1ac3('0x7'));var config=require(_0x1ac3('0x8'));var controller=require('./voiceCallReport.controller');router['get']('/',auth[_0x1ac3('0x9')](),controller[_0x1ac3('0xa')]);router[_0x1ac3('0xb')](_0x1ac3('0xc'),auth[_0x1ac3('0x9')](),controller['describe']);router[_0x1ac3('0xb')]('/:id',auth[_0x1ac3('0x9')](),controller[_0x1ac3('0xd')]);router[_0x1ac3('0xe')]('/',auth['isAuthenticated'](),controller[_0x1ac3('0xf')]);router[_0x1ac3('0x10')](_0x1ac3('0x11'),auth[_0x1ac3('0x9')](),controller[_0x1ac3('0x12')]);router[_0x1ac3('0x13')]('/:id',auth[_0x1ac3('0x9')](),controller[_0x1ac3('0x14')]);module[_0x1ac3('0x15')]=router; \ No newline at end of file diff --git a/server/api/voiceCallReport/voiceCallReport.attributes.js b/server/api/voiceCallReport/voiceCallReport.attributes.js index e86be08..adb1994 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 _0x793b=['TEXT','DATE','INTEGER','sequelize','exports','STRING','ENUM','inbound','outbound','inbound-fax'];(function(_0x5eb22e,_0x27cbac){var _0x27fed5=function(_0x565467){while(--_0x565467){_0x5eb22e['push'](_0x5eb22e['shift']());}};_0x27fed5(++_0x27cbac);}(_0x793b,0x189));var _0xb793=function(_0x6cbaea,_0x1bbbce){_0x6cbaea=_0x6cbaea-0x0;var _0x39efbf=_0x793b[_0x6cbaea];return _0x39efbf;};'use strict';var Sequelize=require(_0xb793('0x0'));module[_0xb793('0x1')]={'uniqueid':{'type':Sequelize[_0xb793('0x2')]},'type':{'type':Sequelize[_0xb793('0x3')](_0xb793('0x4'),'internal',_0xb793('0x5'),_0xb793('0x6'),'outbound-fax','dialer')},'tag':{'type':Sequelize[_0xb793('0x2')]},'accountcode':{'type':Sequelize[_0xb793('0x2')]},'source':{'type':Sequelize[_0xb793('0x2')]},'destination':{'type':Sequelize[_0xb793('0x2')]},'destinationcontext':{'type':Sequelize[_0xb793('0x2')]},'callerid':{'type':Sequelize[_0xb793('0x2')]},'channel':{'type':Sequelize[_0xb793('0x2')]},'destinationchannel':{'type':Sequelize[_0xb793('0x2')]},'lastapplication':{'type':Sequelize[_0xb793('0x2')]},'lastdata':{'type':Sequelize[_0xb793('0x7')]},'starttime':{'type':Sequelize[_0xb793('0x8')]},'systemanswertime':{'type':Sequelize[_0xb793('0x8')]},'answertime':{'type':Sequelize[_0xb793('0x8')]},'endtime':{'type':Sequelize[_0xb793('0x8')]},'duration':{'type':Sequelize['INTEGER']},'billableseconds':{'type':Sequelize[_0xb793('0x9')]},'mohtime':{'type':Sequelize[_0xb793('0x9')],'defaultValue':0x0},'disposition':{'type':Sequelize['STRING']},'amaflags':{'type':Sequelize['STRING']},'userfield':{'type':Sequelize[_0xb793('0x2')]},'userDisposition':{'type':Sequelize[_0xb793('0x2')]},'userSecondDisposition':{'type':Sequelize['STRING']},'userThirdDisposition':{'type':Sequelize[_0xb793('0x2')]},'note':{'type':Sequelize[_0xb793('0x2')]},'prefix':{'type':Sequelize['STRING']},'routeid':{'type':Sequelize[_0xb793('0x9')]},'sipcallid':{'type':Sequelize[_0xb793('0x2')]}}; \ No newline at end of file +var _0x0c19=['outbound-fax','dialer','TEXT','DATE','INTEGER','sequelize','exports','STRING','ENUM','inbound','internal','inbound-fax'];(function(_0x26c807,_0x5af1cb){var _0x347679=function(_0x1a49dd){while(--_0x1a49dd){_0x26c807['push'](_0x26c807['shift']());}};_0x347679(++_0x5af1cb);}(_0x0c19,0xf5));var _0x90c1=function(_0xec5ac7,_0x2ecd7b){_0xec5ac7=_0xec5ac7-0x0;var _0x4a7bdf=_0x0c19[_0xec5ac7];return _0x4a7bdf;};'use strict';var Sequelize=require(_0x90c1('0x0'));module[_0x90c1('0x1')]={'uniqueid':{'type':Sequelize[_0x90c1('0x2')]},'type':{'type':Sequelize[_0x90c1('0x3')](_0x90c1('0x4'),_0x90c1('0x5'),'outbound',_0x90c1('0x6'),_0x90c1('0x7'),_0x90c1('0x8'))},'tag':{'type':Sequelize['STRING']},'accountcode':{'type':Sequelize[_0x90c1('0x2')]},'source':{'type':Sequelize[_0x90c1('0x2')]},'destination':{'type':Sequelize['STRING']},'destinationcontext':{'type':Sequelize[_0x90c1('0x2')]},'callerid':{'type':Sequelize[_0x90c1('0x2')]},'channel':{'type':Sequelize[_0x90c1('0x2')]},'destinationchannel':{'type':Sequelize[_0x90c1('0x2')]},'lastapplication':{'type':Sequelize[_0x90c1('0x2')]},'lastdata':{'type':Sequelize[_0x90c1('0x9')]},'starttime':{'type':Sequelize[_0x90c1('0xa')]},'systemanswertime':{'type':Sequelize['DATE']},'answertime':{'type':Sequelize[_0x90c1('0xa')]},'endtime':{'type':Sequelize[_0x90c1('0xa')]},'duration':{'type':Sequelize['INTEGER']},'billableseconds':{'type':Sequelize[_0x90c1('0xb')]},'mohtime':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'disposition':{'type':Sequelize['STRING']},'amaflags':{'type':Sequelize[_0x90c1('0x2')]},'userfield':{'type':Sequelize['STRING']},'userDisposition':{'type':Sequelize[_0x90c1('0x2')]},'userSecondDisposition':{'type':Sequelize[_0x90c1('0x2')]},'userThirdDisposition':{'type':Sequelize[_0x90c1('0x2')]},'note':{'type':Sequelize[_0x90c1('0x2')]},'prefix':{'type':Sequelize['STRING']},'routeid':{'type':Sequelize['INTEGER']},'sipcallid':{'type':Sequelize[_0x90c1('0x2')]}}; \ No newline at end of file diff --git a/server/api/voiceCallReport/voiceCallReport.controller.js b/server/api/voiceCallReport/voiceCallReport.controller.js index 106bf6e..5a54a1a 100644 --- a/server/api/voiceCallReport/voiceCallReport.controller.js +++ b/server/api/voiceCallReport/voiceCallReport.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x2032=['../../config/logger','../../config/utils','../../config/license/util','../../mysqldb','end','status','json','offset','undefined','limit','count','set','Content-Range','apply','save','then','destroy','sendStatus','error','stack','name','send','index','map','VoiceCallReport','fieldName','type','key','query','model','attributes','intersection','fields','length','hasOwnProperty','nolimit','sort','pick','filters','filter','merge','where','options','alias','User','rows','catch','show','params','keys','rawAttributes','includeAll','include','create','body','find','describe','uniqueid','user','rimraf','zip-dir','fast-json-patch','moment','bluebird','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x2032,0xd9));var _0x2203=function(_0x33fca0,_0x188563){_0x33fca0=_0x33fca0-0x0;var _0x3a380c=_0x2032[_0x33fca0];return _0x3a380c;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x2203('0x0'));var zipdir=require(_0x2203('0x1'));var jsonpatch=require(_0x2203('0x2'));var rp=require('request-promise');var moment=require(_0x2203('0x3'));var BPromise=require(_0x2203('0x4'));var Mustache=require('mustache');var util=require(_0x2203('0x5'));var path=require(_0x2203('0x6'));var sox=require(_0x2203('0x7'));var csv=require(_0x2203('0x8'));var ejs=require(_0x2203('0x9'));var fs=require('fs');var fs_extra=require(_0x2203('0xa'));var _=require(_0x2203('0xb'));var squel=require(_0x2203('0xc'));var crypto=require(_0x2203('0xd'));var jsforce=require(_0x2203('0xe'));var deskjs=require(_0x2203('0xf'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x2203('0x10'));var Redis=require('ioredis');var authService=require(_0x2203('0x11'));var qs=require(_0x2203('0x12'));var as=require(_0x2203('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x2203('0x14'))('api');var utils=require(_0x2203('0x15'));var config=require('../../config/environment');var licenseUtil=require(_0x2203('0x16'));var db=require(_0x2203('0x17'))['db'];function respondWithStatusCode(_0x4b9376,_0x583bc7){_0x583bc7=_0x583bc7||0xcc;return function(_0x585c76){if(_0x585c76){return _0x4b9376['sendStatus'](_0x583bc7);}return _0x4b9376['status'](_0x583bc7)[_0x2203('0x18')]();};}function respondWithResult(_0x538b30,_0x592e47){_0x592e47=_0x592e47||0xc8;return function(_0x21a3af){if(_0x21a3af){return _0x538b30[_0x2203('0x19')](_0x592e47)[_0x2203('0x1a')](_0x21a3af);}};}function respondWithFilteredResult(_0x41af85,_0x226209){return function(_0x3fe0a8){if(_0x3fe0a8){var _0x2c36e6=typeof _0x226209[_0x2203('0x1b')]===_0x2203('0x1c')&&typeof _0x226209[_0x2203('0x1d')]==='undefined';var _0x280eda=_0x3fe0a8[_0x2203('0x1e')];var _0x4893ff=_0x2c36e6?0x0:_0x226209[_0x2203('0x1b')];var _0x8906e1=_0x2c36e6?_0x3fe0a8['count']:_0x226209[_0x2203('0x1b')]+_0x226209['limit'];var _0x2904ba;if(_0x8906e1>=_0x280eda){_0x8906e1=_0x280eda;_0x2904ba=0xc8;}else{_0x2904ba=0xce;}_0x41af85[_0x2203('0x19')](_0x2904ba);return _0x41af85[_0x2203('0x1f')](_0x2203('0x20'),_0x4893ff+'-'+_0x8906e1+'/'+_0x280eda)[_0x2203('0x1a')](_0x3fe0a8);}return null;};}function patchUpdates(_0x449039){return function(_0x538c23){try{jsonpatch[_0x2203('0x21')](_0x538c23,_0x449039,!![]);}catch(_0x50822b){return BPromise['reject'](_0x50822b);}return _0x538c23[_0x2203('0x22')]();};}function saveUpdates(_0x496d82,_0x3b8ef9){return function(_0x5bfe61){if(_0x5bfe61){return _0x5bfe61['update'](_0x496d82)[_0x2203('0x23')](function(_0x5e29cd){return _0x5e29cd;});}return null;};}function removeEntity(_0x5c8da9,_0x226374){return function(_0x2718f5){if(_0x2718f5){return _0x2718f5[_0x2203('0x24')]()[_0x2203('0x23')](function(){_0x5c8da9[_0x2203('0x19')](0xcc)[_0x2203('0x18')]();});}};}function handleEntityNotFound(_0x49c12,_0x250349){return function(_0x576378){if(!_0x576378){_0x49c12[_0x2203('0x25')](0x194);}return _0x576378;};}function handleError(_0x36b958,_0x39a11a){_0x39a11a=_0x39a11a||0x1f4;return function(_0x5f11bf){logger[_0x2203('0x26')](_0x5f11bf[_0x2203('0x27')]);if(_0x5f11bf['name']){delete _0x5f11bf[_0x2203('0x28')];}_0x36b958[_0x2203('0x19')](_0x39a11a)[_0x2203('0x29')](_0x5f11bf);};}exports[_0x2203('0x2a')]=function(_0x28ae02,_0x1df508){var _0x9c53f={},_0x5a95c1={},_0x34b8ba={'count':0x0,'rows':[]};var _0x616ed8=_[_0x2203('0x2b')](db[_0x2203('0x2c')]['rawAttributes'],function(_0x3a8e23){return{'name':_0x3a8e23[_0x2203('0x2d')],'type':_0x3a8e23[_0x2203('0x2e')][_0x2203('0x2f')]};});_0x5a95c1['model']=_[_0x2203('0x2b')](_0x616ed8,_0x2203('0x28'));_0x5a95c1['query']=_['keys'](_0x28ae02[_0x2203('0x30')]);_0x5a95c1['filters']=_['intersection'](_0x5a95c1[_0x2203('0x31')],_0x5a95c1[_0x2203('0x30')]);_0x9c53f[_0x2203('0x32')]=_[_0x2203('0x33')](_0x5a95c1[_0x2203('0x31')],qs['fields'](_0x28ae02[_0x2203('0x30')][_0x2203('0x34')]));_0x9c53f['attributes']=_0x9c53f[_0x2203('0x32')][_0x2203('0x35')]?_0x9c53f[_0x2203('0x32')]:_0x5a95c1[_0x2203('0x31')];if(!_0x28ae02[_0x2203('0x30')][_0x2203('0x36')](_0x2203('0x37'))){_0x9c53f[_0x2203('0x1d')]=qs[_0x2203('0x1d')](_0x28ae02['query'][_0x2203('0x1d')]);_0x9c53f[_0x2203('0x1b')]=qs['offset'](_0x28ae02['query'][_0x2203('0x1b')]);}_0x9c53f['order']=qs[_0x2203('0x38')](_0x28ae02[_0x2203('0x30')][_0x2203('0x38')]);_0x9c53f['where']=qs['filters'](_[_0x2203('0x39')](_0x28ae02['query'],_0x5a95c1[_0x2203('0x3a')]),_0x616ed8);if(_0x28ae02['query'][_0x2203('0x3b')]){_0x9c53f['where']=_[_0x2203('0x3c')](_0x9c53f[_0x2203('0x3d')],{'$or':_[_0x2203('0x2b')](_0x616ed8,function(_0x40a793){if(_0x40a793[_0x2203('0x2e')]!=='VIRTUAL'){var _0x5f1561={};_0x5f1561[_0x40a793['name']]={'$like':'%'+_0x28ae02[_0x2203('0x30')][_0x2203('0x3b')]+'%'};return _0x5f1561;}})});}_0x9c53f=_[_0x2203('0x3c')]({},_0x9c53f,_0x28ae02[_0x2203('0x3e')]);var _0x3283fb={'where':_0x9c53f[_0x2203('0x3d')]};return db[_0x2203('0x2c')]['count'](_0x3283fb)[_0x2203('0x23')](function(_0x1b12c3){_0x34b8ba[_0x2203('0x1e')]=_0x1b12c3;if(_0x28ae02[_0x2203('0x30')]['includeAll']){_0x9c53f['include']=[{'attributes':['id',_0x2203('0x28'),'fullname',_0x2203('0x3f')],'model':db[_0x2203('0x40')],'as':_0x2203('0x40')}];}return db['VoiceCallReport']['findAll'](_0x9c53f);})[_0x2203('0x23')](function(_0x3739f6){_0x34b8ba[_0x2203('0x41')]=_0x3739f6;return _0x34b8ba;})[_0x2203('0x23')](respondWithFilteredResult(_0x1df508,_0x9c53f))[_0x2203('0x42')](handleError(_0x1df508,null));};exports[_0x2203('0x43')]=function(_0x5cd573,_0x15d3b6){var _0x165a3f={'raw':!![],'where':{'id':_0x5cd573[_0x2203('0x44')]['id']}},_0x3a866c={};_0x3a866c[_0x2203('0x31')]=_[_0x2203('0x45')](db[_0x2203('0x2c')][_0x2203('0x46')]);_0x3a866c[_0x2203('0x30')]=_[_0x2203('0x45')](_0x5cd573['query']);_0x3a866c[_0x2203('0x3a')]=_[_0x2203('0x33')](_0x3a866c[_0x2203('0x31')],_0x3a866c[_0x2203('0x30')]);_0x165a3f['attributes']=_['intersection'](_0x3a866c[_0x2203('0x31')],qs['fields'](_0x5cd573[_0x2203('0x30')][_0x2203('0x34')]));_0x165a3f[_0x2203('0x32')]=_0x165a3f[_0x2203('0x32')]['length']?_0x165a3f[_0x2203('0x32')]:_0x3a866c[_0x2203('0x31')];if(_0x5cd573['query'][_0x2203('0x47')]){_0x165a3f[_0x2203('0x48')]=[{'all':!![]}];}_0x165a3f=_[_0x2203('0x3c')]({},_0x165a3f,_0x5cd573[_0x2203('0x3e')]);return db['VoiceCallReport']['find'](_0x165a3f)[_0x2203('0x23')](handleEntityNotFound(_0x15d3b6,null))['then'](respondWithResult(_0x15d3b6,null))['catch'](handleError(_0x15d3b6,null));};exports[_0x2203('0x49')]=function(_0x33b7b5,_0x1a2665){return db['VoiceCallReport']['create'](_0x33b7b5[_0x2203('0x4a')],{})[_0x2203('0x23')](respondWithResult(_0x1a2665,0xc9))[_0x2203('0x42')](handleError(_0x1a2665,null));};exports[_0x2203('0x24')]=function(_0x225b0e,_0x21fd78){return db['VoiceCallReport'][_0x2203('0x4b')]({'where':{'id':_0x225b0e['params']['id']}})[_0x2203('0x23')](handleEntityNotFound(_0x21fd78,null))[_0x2203('0x23')](removeEntity(_0x21fd78,null))[_0x2203('0x42')](handleError(_0x21fd78,null));};exports[_0x2203('0x4c')]=function(_0x58b9bb,_0x506795){return db[_0x2203('0x2c')][_0x2203('0x4c')]()[_0x2203('0x23')](respondWithResult(_0x506795,null))[_0x2203('0x42')](handleError(_0x506795,null));};exports['update']=function(_0x4de47a,_0x49999a){if(_0x4de47a[_0x2203('0x4a')][_0x2203('0x4d')]){delete _0x4de47a['body'][_0x2203('0x4d')];}return db[_0x2203('0x2c')]['find']({'where':{'uniqueid':_0x4de47a[_0x2203('0x44')]['id'],'UserId':{'$or':[null,_0x4de47a[_0x2203('0x4e')]['id']]}}})[_0x2203('0x23')](handleEntityNotFound(_0x49999a,null))[_0x2203('0x23')](saveUpdates(_0x4de47a['body'],null))[_0x2203('0x23')](respondWithResult(_0x49999a,null))['catch'](handleError(_0x49999a,null));}; \ No newline at end of file +var _0xdb28=['options','includeAll','fullname','User','findAll','rows','catch','show','params','rawAttributes','intersection','include','find','create','destroy','describe','body','uniqueid','user','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','path','to-csv','ejs','squel','crypto','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','status','end','json','offset','undefined','count','limit','set','apply','save','update','then','sendStatus','error','stack','name','send','index','VoiceCallReport','fieldName','type','key','map','query','keys','model','fields','attributes','length','nolimit','order','sort','filters','filter','where','VIRTUAL','merge'];(function(_0x564dd9,_0x26407d){var _0x55f337=function(_0x3249ca){while(--_0x3249ca){_0x564dd9['push'](_0x564dd9['shift']());}};_0x55f337(++_0x26407d);}(_0xdb28,0x106));var _0x8db2=function(_0x102054,_0x400a91){_0x102054=_0x102054-0x0;var _0xa29dd6=_0xdb28[_0x102054];return _0xa29dd6;};'use strict';var emlformat=require(_0x8db2('0x0'));var rimraf=require(_0x8db2('0x1'));var zipdir=require(_0x8db2('0x2'));var jsonpatch=require(_0x8db2('0x3'));var rp=require('request-promise');var moment=require(_0x8db2('0x4'));var BPromise=require(_0x8db2('0x5'));var Mustache=require(_0x8db2('0x6'));var util=require(_0x8db2('0x7'));var path=require(_0x8db2('0x8'));var sox=require('sox');var csv=require(_0x8db2('0x9'));var ejs=require(_0x8db2('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0x8db2('0xb'));var crypto=require(_0x8db2('0xc'));var jsforce=require(_0x8db2('0xd'));var deskjs=require(_0x8db2('0xe'));var toCsv=require(_0x8db2('0x9'));var querystring=require(_0x8db2('0xf'));var Papa=require(_0x8db2('0x10'));var Redis=require('ioredis');var authService=require(_0x8db2('0x11'));var qs=require(_0x8db2('0x12'));var as=require(_0x8db2('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x8db2('0x14'))(_0x8db2('0x15'));var utils=require('../../config/utils');var config=require(_0x8db2('0x16'));var licenseUtil=require(_0x8db2('0x17'));var db=require(_0x8db2('0x18'))['db'];function respondWithStatusCode(_0x204f49,_0x37d017){_0x37d017=_0x37d017||0xcc;return function(_0x559fb1){if(_0x559fb1){return _0x204f49['sendStatus'](_0x37d017);}return _0x204f49[_0x8db2('0x19')](_0x37d017)[_0x8db2('0x1a')]();};}function respondWithResult(_0x350d61,_0x1d6a15){_0x1d6a15=_0x1d6a15||0xc8;return function(_0x227355){if(_0x227355){return _0x350d61[_0x8db2('0x19')](_0x1d6a15)[_0x8db2('0x1b')](_0x227355);}};}function respondWithFilteredResult(_0x3c96a7,_0x131252){return function(_0x16c8c2){if(_0x16c8c2){var _0x5489a9=typeof _0x131252[_0x8db2('0x1c')]===_0x8db2('0x1d')&&typeof _0x131252['limit']===_0x8db2('0x1d');var _0x44957d=_0x16c8c2[_0x8db2('0x1e')];var _0x3fddc2=_0x5489a9?0x0:_0x131252[_0x8db2('0x1c')];var _0x46ce14=_0x5489a9?_0x16c8c2['count']:_0x131252['offset']+_0x131252[_0x8db2('0x1f')];var _0x104e33;if(_0x46ce14>=_0x44957d){_0x46ce14=_0x44957d;_0x104e33=0xc8;}else{_0x104e33=0xce;}_0x3c96a7[_0x8db2('0x19')](_0x104e33);return _0x3c96a7[_0x8db2('0x20')]('Content-Range',_0x3fddc2+'-'+_0x46ce14+'/'+_0x44957d)[_0x8db2('0x1b')](_0x16c8c2);}return null;};}function patchUpdates(_0x36a9ff){return function(_0x260940){try{jsonpatch[_0x8db2('0x21')](_0x260940,_0x36a9ff,!![]);}catch(_0x3dbe8e){return BPromise['reject'](_0x3dbe8e);}return _0x260940[_0x8db2('0x22')]();};}function saveUpdates(_0x3e30e6,_0x18f69c){return function(_0x125be2){if(_0x125be2){return _0x125be2[_0x8db2('0x23')](_0x3e30e6)[_0x8db2('0x24')](function(_0x796ec1){return _0x796ec1;});}return null;};}function removeEntity(_0x5c6614,_0x256202){return function(_0x4f6516){if(_0x4f6516){return _0x4f6516['destroy']()['then'](function(){_0x5c6614['status'](0xcc)[_0x8db2('0x1a')]();});}};}function handleEntityNotFound(_0x29b5cd,_0x3be281){return function(_0x2baed0){if(!_0x2baed0){_0x29b5cd[_0x8db2('0x25')](0x194);}return _0x2baed0;};}function handleError(_0x8d4f54,_0x58cd9d){_0x58cd9d=_0x58cd9d||0x1f4;return function(_0x3544ba){logger[_0x8db2('0x26')](_0x3544ba[_0x8db2('0x27')]);if(_0x3544ba[_0x8db2('0x28')]){delete _0x3544ba['name'];}_0x8d4f54[_0x8db2('0x19')](_0x58cd9d)[_0x8db2('0x29')](_0x3544ba);};}exports[_0x8db2('0x2a')]=function(_0x1687ed,_0xbe5ece){var _0x21bae5={},_0xa54ea3={},_0x3124d5={'count':0x0,'rows':[]};var _0xbc5366=_['map'](db[_0x8db2('0x2b')]['rawAttributes'],function(_0x59cb77){return{'name':_0x59cb77[_0x8db2('0x2c')],'type':_0x59cb77[_0x8db2('0x2d')][_0x8db2('0x2e')]};});_0xa54ea3['model']=_[_0x8db2('0x2f')](_0xbc5366,'name');_0xa54ea3[_0x8db2('0x30')]=_[_0x8db2('0x31')](_0x1687ed[_0x8db2('0x30')]);_0xa54ea3['filters']=_['intersection'](_0xa54ea3[_0x8db2('0x32')],_0xa54ea3[_0x8db2('0x30')]);_0x21bae5['attributes']=_['intersection'](_0xa54ea3[_0x8db2('0x32')],qs[_0x8db2('0x33')](_0x1687ed[_0x8db2('0x30')][_0x8db2('0x33')]));_0x21bae5[_0x8db2('0x34')]=_0x21bae5[_0x8db2('0x34')][_0x8db2('0x35')]?_0x21bae5[_0x8db2('0x34')]:_0xa54ea3[_0x8db2('0x32')];if(!_0x1687ed[_0x8db2('0x30')]['hasOwnProperty'](_0x8db2('0x36'))){_0x21bae5[_0x8db2('0x1f')]=qs['limit'](_0x1687ed[_0x8db2('0x30')][_0x8db2('0x1f')]);_0x21bae5['offset']=qs['offset'](_0x1687ed[_0x8db2('0x30')]['offset']);}_0x21bae5[_0x8db2('0x37')]=qs[_0x8db2('0x38')](_0x1687ed[_0x8db2('0x30')][_0x8db2('0x38')]);_0x21bae5['where']=qs[_0x8db2('0x39')](_['pick'](_0x1687ed[_0x8db2('0x30')],_0xa54ea3[_0x8db2('0x39')]),_0xbc5366);if(_0x1687ed[_0x8db2('0x30')][_0x8db2('0x3a')]){_0x21bae5['where']=_['merge'](_0x21bae5[_0x8db2('0x3b')],{'$or':_[_0x8db2('0x2f')](_0xbc5366,function(_0x5dc2b4){if(_0x5dc2b4[_0x8db2('0x2d')]!==_0x8db2('0x3c')){var _0x656dd2={};_0x656dd2[_0x5dc2b4['name']]={'$like':'%'+_0x1687ed[_0x8db2('0x30')][_0x8db2('0x3a')]+'%'};return _0x656dd2;}})});}_0x21bae5=_[_0x8db2('0x3d')]({},_0x21bae5,_0x1687ed[_0x8db2('0x3e')]);var _0x2e6f0c={'where':_0x21bae5[_0x8db2('0x3b')]};return db[_0x8db2('0x2b')][_0x8db2('0x1e')](_0x2e6f0c)[_0x8db2('0x24')](function(_0x63c561){_0x3124d5[_0x8db2('0x1e')]=_0x63c561;if(_0x1687ed[_0x8db2('0x30')][_0x8db2('0x3f')]){_0x21bae5['include']=[{'attributes':['id',_0x8db2('0x28'),_0x8db2('0x40'),'alias'],'model':db['User'],'as':_0x8db2('0x41')}];}return db['VoiceCallReport'][_0x8db2('0x42')](_0x21bae5);})[_0x8db2('0x24')](function(_0x313130){_0x3124d5[_0x8db2('0x43')]=_0x313130;return _0x3124d5;})[_0x8db2('0x24')](respondWithFilteredResult(_0xbe5ece,_0x21bae5))[_0x8db2('0x44')](handleError(_0xbe5ece,null));};exports[_0x8db2('0x45')]=function(_0x5c97ef,_0x2f86b1){var _0x3d44de={'raw':!![],'where':{'id':_0x5c97ef[_0x8db2('0x46')]['id']}},_0x40c69e={};_0x40c69e['model']=_[_0x8db2('0x31')](db[_0x8db2('0x2b')][_0x8db2('0x47')]);_0x40c69e[_0x8db2('0x30')]=_['keys'](_0x5c97ef[_0x8db2('0x30')]);_0x40c69e['filters']=_[_0x8db2('0x48')](_0x40c69e[_0x8db2('0x32')],_0x40c69e[_0x8db2('0x30')]);_0x3d44de['attributes']=_['intersection'](_0x40c69e[_0x8db2('0x32')],qs['fields'](_0x5c97ef[_0x8db2('0x30')][_0x8db2('0x33')]));_0x3d44de[_0x8db2('0x34')]=_0x3d44de[_0x8db2('0x34')][_0x8db2('0x35')]?_0x3d44de[_0x8db2('0x34')]:_0x40c69e[_0x8db2('0x32')];if(_0x5c97ef[_0x8db2('0x30')][_0x8db2('0x3f')]){_0x3d44de[_0x8db2('0x49')]=[{'all':!![]}];}_0x3d44de=_[_0x8db2('0x3d')]({},_0x3d44de,_0x5c97ef[_0x8db2('0x3e')]);return db['VoiceCallReport'][_0x8db2('0x4a')](_0x3d44de)[_0x8db2('0x24')](handleEntityNotFound(_0x2f86b1,null))[_0x8db2('0x24')](respondWithResult(_0x2f86b1,null))[_0x8db2('0x44')](handleError(_0x2f86b1,null));};exports['create']=function(_0x4ffd9d,_0x11c224){return db[_0x8db2('0x2b')][_0x8db2('0x4b')](_0x4ffd9d['body'],{})['then'](respondWithResult(_0x11c224,0xc9))['catch'](handleError(_0x11c224,null));};exports[_0x8db2('0x4c')]=function(_0x368c37,_0x55c7dd){return db[_0x8db2('0x2b')][_0x8db2('0x4a')]({'where':{'id':_0x368c37[_0x8db2('0x46')]['id']}})[_0x8db2('0x24')](handleEntityNotFound(_0x55c7dd,null))['then'](removeEntity(_0x55c7dd,null))['catch'](handleError(_0x55c7dd,null));};exports[_0x8db2('0x4d')]=function(_0x18c6ef,_0x2908e4){return db[_0x8db2('0x2b')][_0x8db2('0x4d')]()[_0x8db2('0x24')](respondWithResult(_0x2908e4,null))[_0x8db2('0x44')](handleError(_0x2908e4,null));};exports[_0x8db2('0x23')]=function(_0x4187d6,_0x426ae0){if(_0x4187d6[_0x8db2('0x4e')][_0x8db2('0x4f')]){delete _0x4187d6[_0x8db2('0x4e')][_0x8db2('0x4f')];}return db[_0x8db2('0x2b')]['find']({'where':{'uniqueid':_0x4187d6[_0x8db2('0x46')]['id'],'UserId':{'$or':[null,_0x4187d6[_0x8db2('0x50')]['id']]}}})['then'](handleEntityNotFound(_0x426ae0,null))[_0x8db2('0x24')](saveUpdates(_0x4187d6[_0x8db2('0x4e')],null))[_0x8db2('0x24')](respondWithResult(_0x426ae0,null))['catch'](handleError(_0x426ae0,null));}; \ No newline at end of file diff --git a/server/api/voiceCallReport/voiceCallReport.model.js b/server/api/voiceCallReport/voiceCallReport.model.js index 3fb7ed1..d72906a 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 _0x0141=['report_call','uniqueid','util','../../config/logger','bluebird','path','rimraf','exports','define'];(function(_0x292152,_0x1b5117){var _0x466335=function(_0x1c4cf9){while(--_0x1c4cf9){_0x292152['push'](_0x292152['shift']());}};_0x466335(++_0x1b5117);}(_0x0141,0x107));var _0x1014=function(_0x4d5994,_0x54e5e6){_0x4d5994=_0x4d5994-0x0;var _0x54df0a=_0x0141[_0x4d5994];return _0x54df0a;};'use strict';var _=require('lodash');var util=require(_0x1014('0x0'));var logger=require(_0x1014('0x1'))('api');var moment=require('moment');var BPromise=require(_0x1014('0x2'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x1014('0x3'));var rimraf=require(_0x1014('0x4'));var config=require('../../config/environment');var attributes=require('./voiceCallReport.attributes');module[_0x1014('0x5')]=function(_0x1afa28,_0x52a5d0){return _0x1afa28[_0x1014('0x6')]('VoiceCallReport',attributes,{'tableName':_0x1014('0x7'),'paranoid':![],'indexes':[{'fields':[_0x1014('0x8')]}],'timestamps':!![]});}; \ No newline at end of file +var _0xb9f0=['rimraf','../../config/environment','./voiceCallReport.attributes','exports','define','VoiceCallReport','uniqueid','lodash','util','api','moment','path'];(function(_0x5309b2,_0x466bdd){var _0x43d4f5=function(_0xf1976a){while(--_0xf1976a){_0x5309b2['push'](_0x5309b2['shift']());}};_0x43d4f5(++_0x466bdd);}(_0xb9f0,0x13f));var _0x0b9f=function(_0x34e33d,_0x4a63df){_0x34e33d=_0x34e33d-0x0;var _0x3db00b=_0xb9f0[_0x34e33d];return _0x3db00b;};'use strict';var _=require(_0x0b9f('0x0'));var util=require(_0x0b9f('0x1'));var logger=require('../../config/logger')(_0x0b9f('0x2'));var moment=require(_0x0b9f('0x3'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0x0b9f('0x4'));var rimraf=require(_0x0b9f('0x5'));var config=require(_0x0b9f('0x6'));var attributes=require(_0x0b9f('0x7'));module[_0x0b9f('0x8')]=function(_0x2f3cf1,_0x434c6d){return _0x2f3cf1[_0x0b9f('0x9')](_0x0b9f('0xa'),attributes,{'tableName':'report_call','paranoid':![],'indexes':[{'fields':[_0x0b9f('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 59594a7..9451474 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 _0x0a9f=['catch','GetVoiceCallReport','options','raw','where','attributes','limit','include','map','model','CreateVoiceCallReport','create','UpdateVoiceCallReport','VoiceCallReport','update','body','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','client','request','then','info','VoiceCallReport,\x20%s,\x20%s','debug','VoiceCallReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','request\x20sent','result'];(function(_0x53ea96,_0x169917){var _0x3ffb86=function(_0x28c349){while(--_0x28c349){_0x53ea96['push'](_0x53ea96['shift']());}};_0x3ffb86(++_0x169917);}(_0x0a9f,0x1bd));var _0xf0a9=function(_0x13e11a,_0xe0fc7){_0x13e11a=_0x13e11a-0x0;var _0xd7f115=_0x0a9f[_0x13e11a];return _0xd7f115;};'use strict';var _=require(_0xf0a9('0x0'));var util=require(_0xf0a9('0x1'));var moment=require(_0xf0a9('0x2'));var BPromise=require(_0xf0a9('0x3'));var rs=require(_0xf0a9('0x4'));var fs=require('fs');var Redis=require(_0xf0a9('0x5'));var db=require(_0xf0a9('0x6'))['db'];var utils=require(_0xf0a9('0x7'));var logger=require('../../config/logger')(_0xf0a9('0x8'));var config=require(_0xf0a9('0x9'));var jayson=require('jayson/promise');var client=jayson[_0xf0a9('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x559ec1,_0x17ef2d,_0x5c3cff){return new BPromise(function(_0x52338f,_0x384f24){return client[_0xf0a9('0xb')](_0x559ec1,_0x5c3cff)[_0xf0a9('0xc')](function(_0x5c5dbd){logger[_0xf0a9('0xd')](_0xf0a9('0xe'),_0x17ef2d,'request\x20sent');logger[_0xf0a9('0xf')](_0xf0a9('0x10'),_0x17ef2d,'request\x20sent',JSON[_0xf0a9('0x11')](_0x5c5dbd));if(_0x5c5dbd[_0xf0a9('0x12')]){if(_0x5c5dbd[_0xf0a9('0x12')][_0xf0a9('0x13')]===0x1f4){logger[_0xf0a9('0x12')](_0xf0a9('0xe'),_0x17ef2d,_0x5c5dbd[_0xf0a9('0x12')][_0xf0a9('0x14')]);return _0x384f24(_0x5c5dbd[_0xf0a9('0x12')][_0xf0a9('0x14')]);}logger[_0xf0a9('0x12')](_0xf0a9('0xe'),_0x17ef2d,_0x5c5dbd[_0xf0a9('0x12')]['message']);return _0x52338f(_0x5c5dbd[_0xf0a9('0x12')]['message']);}else{logger[_0xf0a9('0xd')](_0xf0a9('0xe'),_0x17ef2d,_0xf0a9('0x15'));_0x52338f(_0x5c5dbd[_0xf0a9('0x16')][_0xf0a9('0x14')]);}})[_0xf0a9('0x17')](function(_0x30dc1b){logger['error'](_0xf0a9('0xe'),_0x17ef2d,_0x30dc1b);_0x384f24(_0x30dc1b);});});}exports[_0xf0a9('0x18')]=function(_0x36fabd){var _0x1cb3d6=this;return new Promise(function(_0xe5274d,_0x5de5bd){return db['VoiceCallReport']['findAll']({'raw':_0x36fabd[_0xf0a9('0x19')]?_0x36fabd['options'][_0xf0a9('0x1a')]===undefined?!![]:![]:!![],'where':_0x36fabd[_0xf0a9('0x19')]?_0x36fabd['options'][_0xf0a9('0x1b')]||null:null,'attributes':_0x36fabd[_0xf0a9('0x19')]?_0x36fabd[_0xf0a9('0x19')][_0xf0a9('0x1c')]||null:null,'limit':_0x36fabd[_0xf0a9('0x19')]?_0x36fabd[_0xf0a9('0x19')][_0xf0a9('0x1d')]||null:null,'include':_0x36fabd[_0xf0a9('0x19')]?_0x36fabd[_0xf0a9('0x19')][_0xf0a9('0x1e')]?_[_0xf0a9('0x1f')](_0x36fabd[_0xf0a9('0x19')]['include'],function(_0x444536){return{'model':db[_0x444536[_0xf0a9('0x20')]],'as':_0x444536['as'],'attributes':_0x444536['attributes'],'include':_0x444536[_0xf0a9('0x1e')]?_[_0xf0a9('0x1f')](_0x444536[_0xf0a9('0x1e')],function(_0x40d69e){return{'model':db[_0x40d69e['model']],'as':_0x40d69e['as'],'attributes':_0x40d69e[_0xf0a9('0x1c')],'include':_0x40d69e['include']?_['map'](_0x40d69e['include'],function(_0x17ead5){return{'model':db[_0x17ead5[_0xf0a9('0x20')]],'as':_0x17ead5['as'],'attributes':_0x17ead5['attributes']};}):[]};}):[]};}):[]:[]})['then'](function(_0xb54b83){logger[_0xf0a9('0xd')](_0xf0a9('0x18'),_0x36fabd);logger[_0xf0a9('0xf')](_0xf0a9('0x18'),_0x36fabd,JSON[_0xf0a9('0x11')](_0xb54b83));_0xe5274d(_0xb54b83);})[_0xf0a9('0x17')](function(_0x92badf){logger[_0xf0a9('0x12')](_0xf0a9('0x18'),_0x92badf['message'],_0x36fabd);_0x5de5bd(_0x1cb3d6[_0xf0a9('0x12')](0x1f4,_0x92badf['message']));});});};exports[_0xf0a9('0x21')]=function(_0x2d3bd6){var _0x14ab4d=this;return new Promise(function(_0x58dfe9,_0x110a33){return db['VoiceCallReport'][_0xf0a9('0x22')](_0x2d3bd6['body'],{'raw':_0x2d3bd6[_0xf0a9('0x19')]?_0x2d3bd6[_0xf0a9('0x19')]['raw']===undefined?!![]:![]:!![]})['then'](function(_0x175076){logger[_0xf0a9('0xd')]('CreateVoiceCallReport',_0x2d3bd6);logger[_0xf0a9('0xf')]('CreateVoiceCallReport',_0x2d3bd6,JSON['stringify'](_0x175076));_0x58dfe9(_0x175076);})[_0xf0a9('0x17')](function(_0x2d80ed){logger[_0xf0a9('0x12')](_0xf0a9('0x21'),_0x2d80ed[_0xf0a9('0x14')],_0x2d3bd6);_0x110a33(_0x14ab4d[_0xf0a9('0x12')](0x1f4,_0x2d80ed['message']));});});};exports[_0xf0a9('0x23')]=function(_0x5718b5){var _0x4e181c=this;return new Promise(function(_0x573845,_0x161573){return db[_0xf0a9('0x24')][_0xf0a9('0x25')](_0x5718b5[_0xf0a9('0x26')],{'raw':_0x5718b5[_0xf0a9('0x19')]?_0x5718b5[_0xf0a9('0x19')]['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x5718b5[_0xf0a9('0x19')]?_0x5718b5[_0xf0a9('0x19')][_0xf0a9('0x1b')]||null:null,'attributes':_0x5718b5[_0xf0a9('0x19')]?_0x5718b5[_0xf0a9('0x19')][_0xf0a9('0x1c')]||null:null,'limit':_0x5718b5[_0xf0a9('0x19')]?_0x5718b5[_0xf0a9('0x19')][_0xf0a9('0x1d')]||null:null})[_0xf0a9('0xc')](function(_0x1f2eee){logger[_0xf0a9('0xd')]('UpdateVoiceCallReport',_0x5718b5);logger['debug'](_0xf0a9('0x23'),_0x5718b5,JSON['stringify'](_0x1f2eee));_0x573845(_0x1f2eee);})['catch'](function(_0x8b814d){logger[_0xf0a9('0x12')](_0xf0a9('0x23'),_0x8b814d[_0xf0a9('0x14')],_0x5718b5);_0x161573(_0x4e181c[_0xf0a9('0x12')](0x1f4,_0x8b814d[_0xf0a9('0x14')]));});});}; \ No newline at end of file +var _0x0484=['code','VoiceCallReport,\x20%s,\x20%s','message','result','catch','GetVoiceCallReport','VoiceCallReport','findAll','options','raw','attributes','include','model','map','CreateVoiceCallReport','create','body','then','UpdateVoiceCallReport','update','where','limit','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/environment','jayson/promise','http','request','info','request\x20sent','debug','VoiceCallReport,\x20%s,\x20%s,\x20%s','stringify','error'];(function(_0xf05259,_0x492225){var _0x2b27df=function(_0x22c206){while(--_0x22c206){_0xf05259['push'](_0xf05259['shift']());}};_0x2b27df(++_0x492225);}(_0x0484,0x19c));var _0x4048=function(_0x4ea824,_0xaeabe0){_0x4ea824=_0x4ea824-0x0;var _0x32dbd0=_0x0484[_0x4ea824];return _0x32dbd0;};'use strict';var _=require(_0x4048('0x0'));var util=require(_0x4048('0x1'));var moment=require(_0x4048('0x2'));var BPromise=require(_0x4048('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x4048('0x4'));var db=require(_0x4048('0x5'))['db'];var utils=require(_0x4048('0x6'));var logger=require('../../config/logger')('rpc');var config=require(_0x4048('0x7'));var jayson=require(_0x4048('0x8'));var client=jayson['client'][_0x4048('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x542c4d,_0x583307,_0x949bf8){return new BPromise(function(_0x5ec9d9,_0x126d3b){return client[_0x4048('0xa')](_0x542c4d,_0x949bf8)['then'](function(_0x472127){logger[_0x4048('0xb')]('VoiceCallReport,\x20%s,\x20%s',_0x583307,_0x4048('0xc'));logger[_0x4048('0xd')](_0x4048('0xe'),_0x583307,_0x4048('0xc'),JSON[_0x4048('0xf')](_0x472127));if(_0x472127[_0x4048('0x10')]){if(_0x472127[_0x4048('0x10')][_0x4048('0x11')]===0x1f4){logger['error'](_0x4048('0x12'),_0x583307,_0x472127[_0x4048('0x10')][_0x4048('0x13')]);return _0x126d3b(_0x472127[_0x4048('0x10')][_0x4048('0x13')]);}logger[_0x4048('0x10')](_0x4048('0x12'),_0x583307,_0x472127[_0x4048('0x10')]['message']);return _0x5ec9d9(_0x472127['error'][_0x4048('0x13')]);}else{logger[_0x4048('0xb')]('VoiceCallReport,\x20%s,\x20%s',_0x583307,_0x4048('0xc'));_0x5ec9d9(_0x472127[_0x4048('0x14')][_0x4048('0x13')]);}})[_0x4048('0x15')](function(_0x548222){logger[_0x4048('0x10')]('VoiceCallReport,\x20%s,\x20%s',_0x583307,_0x548222);_0x126d3b(_0x548222);});});}exports[_0x4048('0x16')]=function(_0x534791){var _0x123378=this;return new Promise(function(_0x28b645,_0x50932a){return db[_0x4048('0x17')][_0x4048('0x18')]({'raw':_0x534791[_0x4048('0x19')]?_0x534791[_0x4048('0x19')][_0x4048('0x1a')]===undefined?!![]:![]:!![],'where':_0x534791[_0x4048('0x19')]?_0x534791['options']['where']||null:null,'attributes':_0x534791[_0x4048('0x19')]?_0x534791[_0x4048('0x19')][_0x4048('0x1b')]||null:null,'limit':_0x534791['options']?_0x534791[_0x4048('0x19')]['limit']||null:null,'include':_0x534791[_0x4048('0x19')]?_0x534791[_0x4048('0x19')][_0x4048('0x1c')]?_['map'](_0x534791[_0x4048('0x19')][_0x4048('0x1c')],function(_0x438d26){return{'model':db[_0x438d26[_0x4048('0x1d')]],'as':_0x438d26['as'],'attributes':_0x438d26[_0x4048('0x1b')],'include':_0x438d26[_0x4048('0x1c')]?_[_0x4048('0x1e')](_0x438d26[_0x4048('0x1c')],function(_0x28496a){return{'model':db[_0x28496a[_0x4048('0x1d')]],'as':_0x28496a['as'],'attributes':_0x28496a[_0x4048('0x1b')],'include':_0x28496a[_0x4048('0x1c')]?_[_0x4048('0x1e')](_0x28496a[_0x4048('0x1c')],function(_0x39cd7a){return{'model':db[_0x39cd7a['model']],'as':_0x39cd7a['as'],'attributes':_0x39cd7a['attributes']};}):[]};}):[]};}):[]:[]})['then'](function(_0x4865db){logger['info'](_0x4048('0x16'),_0x534791);logger[_0x4048('0xd')](_0x4048('0x16'),_0x534791,JSON[_0x4048('0xf')](_0x4865db));_0x28b645(_0x4865db);})[_0x4048('0x15')](function(_0x9c2a86){logger[_0x4048('0x10')]('GetVoiceCallReport',_0x9c2a86[_0x4048('0x13')],_0x534791);_0x50932a(_0x123378[_0x4048('0x10')](0x1f4,_0x9c2a86[_0x4048('0x13')]));});});};exports[_0x4048('0x1f')]=function(_0x10e876){var _0x26aed9=this;return new Promise(function(_0x360d58,_0x4ca7e0){return db[_0x4048('0x17')][_0x4048('0x20')](_0x10e876[_0x4048('0x21')],{'raw':_0x10e876[_0x4048('0x19')]?_0x10e876[_0x4048('0x19')][_0x4048('0x1a')]===undefined?!![]:![]:!![]})[_0x4048('0x22')](function(_0x579a5a){logger[_0x4048('0xb')](_0x4048('0x1f'),_0x10e876);logger[_0x4048('0xd')](_0x4048('0x1f'),_0x10e876,JSON[_0x4048('0xf')](_0x579a5a));_0x360d58(_0x579a5a);})[_0x4048('0x15')](function(_0x11d383){logger[_0x4048('0x10')]('CreateVoiceCallReport',_0x11d383[_0x4048('0x13')],_0x10e876);_0x4ca7e0(_0x26aed9[_0x4048('0x10')](0x1f4,_0x11d383[_0x4048('0x13')]));});});};exports[_0x4048('0x23')]=function(_0x56de7c){var _0x1e1d1b=this;return new Promise(function(_0x25235c,_0x113758){return db['VoiceCallReport'][_0x4048('0x24')](_0x56de7c[_0x4048('0x21')],{'raw':_0x56de7c[_0x4048('0x19')]?_0x56de7c[_0x4048('0x19')][_0x4048('0x1a')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x56de7c[_0x4048('0x19')]?_0x56de7c[_0x4048('0x19')][_0x4048('0x25')]||null:null,'attributes':_0x56de7c[_0x4048('0x19')]?_0x56de7c['options']['attributes']||null:null,'limit':_0x56de7c[_0x4048('0x19')]?_0x56de7c['options'][_0x4048('0x26')]||null:null})[_0x4048('0x22')](function(_0x11a8c8){logger[_0x4048('0xb')](_0x4048('0x23'),_0x56de7c);logger[_0x4048('0xd')](_0x4048('0x23'),_0x56de7c,JSON[_0x4048('0xf')](_0x11a8c8));_0x25235c(_0x11a8c8);})[_0x4048('0x15')](function(_0x184603){logger[_0x4048('0x10')]('UpdateVoiceCallReport',_0x184603['message'],_0x56de7c);_0x113758(_0x1e1d1b[_0x4048('0x10')](0x1f4,_0x184603[_0x4048('0x13')]));});});}; \ No newline at end of file diff --git a/server/api/voiceChanSpy/index.js b/server/api/voiceChanSpy/index.js index 8ba0977..1e8bbfb 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 _0x7499=['get','isAuthenticated','index','/:id','show','post','create','put','update','delete','destroy','multer','util','path','connect-timeout','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./voiceChanSpy.controller'];(function(_0x1e1f7b,_0x45246c){var _0x17b712=function(_0x166c48){while(--_0x166c48){_0x1e1f7b['push'](_0x1e1f7b['shift']());}};_0x17b712(++_0x45246c);}(_0x7499,0x1eb));var _0x9749=function(_0x13ac10,_0x46e79e){_0x13ac10=_0x13ac10-0x0;var _0x28eda2=_0x7499[_0x13ac10];return _0x28eda2;};'use strict';var multer=require(_0x9749('0x0'));var util=require(_0x9749('0x1'));var path=require(_0x9749('0x2'));var timeout=require(_0x9749('0x3'));var express=require('express');var router=express[_0x9749('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0x9749('0x5'));var interaction=require(_0x9749('0x6'));var config=require(_0x9749('0x7'));var controller=require(_0x9749('0x8'));router[_0x9749('0x9')]('/',auth[_0x9749('0xa')](),controller[_0x9749('0xb')]);router[_0x9749('0x9')](_0x9749('0xc'),auth[_0x9749('0xa')](),controller[_0x9749('0xd')]);router[_0x9749('0xe')]('/',auth['isAuthenticated'](),controller[_0x9749('0xf')]);router[_0x9749('0x10')]('/:id',auth[_0x9749('0xa')](),controller[_0x9749('0x11')]);router[_0x9749('0x12')](_0x9749('0xc'),auth[_0x9749('0xa')](),controller[_0x9749('0x13')]);module['exports']=router; \ No newline at end of file +var _0xe454=['delete','destroy','exports','util','path','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','isAuthenticated','index','get','/:id','show','post','create','put','update'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0xe454,0x193));var _0x4e45=function(_0x25e289,_0xab0bf8){_0x25e289=_0x25e289-0x0;var _0x207ea1=_0xe454[_0x25e289];return _0x207ea1;};'use strict';var multer=require('multer');var util=require(_0x4e45('0x0'));var path=require(_0x4e45('0x1'));var timeout=require('connect-timeout');var express=require(_0x4e45('0x2'));var router=express[_0x4e45('0x3')]();var fs_extra=require(_0x4e45('0x4'));var auth=require(_0x4e45('0x5'));var interaction=require(_0x4e45('0x6'));var config=require(_0x4e45('0x7'));var controller=require('./voiceChanSpy.controller');router['get']('/',auth[_0x4e45('0x8')](),controller[_0x4e45('0x9')]);router[_0x4e45('0xa')](_0x4e45('0xb'),auth['isAuthenticated'](),controller[_0x4e45('0xc')]);router[_0x4e45('0xd')]('/',auth['isAuthenticated'](),controller[_0x4e45('0xe')]);router[_0x4e45('0xf')](_0x4e45('0xb'),auth['isAuthenticated'](),controller[_0x4e45('0x10')]);router[_0x4e45('0x11')](_0x4e45('0xb'),auth[_0x4e45('0x8')](),controller[_0x4e45('0x12')]);module[_0x4e45('0x13')]=router; \ No newline at end of file diff --git a/server/api/voiceChanSpy/voiceChanSpy.attributes.js b/server/api/voiceChanSpy/voiceChanSpy.attributes.js index a7ee636..3c833bc 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 _0x5bde=['name','setDataValue','options','join','getDataValue','split','BOOLEAN','sequelize','exports','STRING'];(function(_0x237d67,_0x4ff2db){var _0x292dfb=function(_0x565a7d){while(--_0x565a7d){_0x237d67['push'](_0x237d67['shift']());}};_0x292dfb(++_0x4ff2db);}(_0x5bde,0x1e7));var _0xe5bd=function(_0x5483d6,_0x1dd0ee){_0x5483d6=_0x5483d6-0x0;var _0x57f41a=_0x5bde[_0x5483d6];return _0x57f41a;};'use strict';var Sequelize=require(_0xe5bd('0x0'));module[_0xe5bd('0x1')]={'name':{'type':Sequelize[_0xe5bd('0x2')]},'prefix':{'type':Sequelize[_0xe5bd('0x2')],'unique':_0xe5bd('0x3'),'allowNull':![]},'options':{'type':Sequelize[_0xe5bd('0x2')],'set':function(_0x49593c){this[_0xe5bd('0x4')](_0xe5bd('0x5'),_0x49593c?_0x49593c[_0xe5bd('0x6')](''):[]);},'get':function(){return this[_0xe5bd('0x7')](_0xe5bd('0x5'))?this[_0xe5bd('0x7')](_0xe5bd('0x5'))[_0xe5bd('0x8')](''):[];}},'auth':{'type':Sequelize[_0xe5bd('0x9')],'defaultValue':![]},'password':{'type':Sequelize[_0xe5bd('0x2')]},'record':{'type':Sequelize[_0xe5bd('0x9')],'defaultValue':![]},'recordingFormat':{'type':Sequelize[_0xe5bd('0x2')]},'description':{'type':Sequelize[_0xe5bd('0x2')]}}; \ No newline at end of file +var _0xdbe3=['options','join','getDataValue','BOOLEAN','sequelize','exports','STRING','name'];(function(_0x361bb4,_0x411189){var _0x3e88c3=function(_0x263662){while(--_0x263662){_0x361bb4['push'](_0x361bb4['shift']());}};_0x3e88c3(++_0x411189);}(_0xdbe3,0xe4));var _0x3dbe=function(_0x372898,_0x3783a3){_0x372898=_0x372898-0x0;var _0x3d38e7=_0xdbe3[_0x372898];return _0x3d38e7;};'use strict';var Sequelize=require(_0x3dbe('0x0'));module[_0x3dbe('0x1')]={'name':{'type':Sequelize['STRING']},'prefix':{'type':Sequelize[_0x3dbe('0x2')],'unique':_0x3dbe('0x3'),'allowNull':![]},'options':{'type':Sequelize['STRING'],'set':function(_0x4cb9a4){this['setDataValue'](_0x3dbe('0x4'),_0x4cb9a4?_0x4cb9a4[_0x3dbe('0x5')](''):[]);},'get':function(){return this[_0x3dbe('0x6')](_0x3dbe('0x4'))?this[_0x3dbe('0x6')]('options')['split'](''):[];}},'auth':{'type':Sequelize[_0x3dbe('0x7')],'defaultValue':![]},'password':{'type':Sequelize[_0x3dbe('0x2')]},'record':{'type':Sequelize[_0x3dbe('0x7')],'defaultValue':![]},'recordingFormat':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0x3dbe('0x2')]}}; \ No newline at end of file diff --git a/server/api/voiceChanSpy/voiceChanSpy.controller.js b/server/api/voiceChanSpy/voiceChanSpy.controller.js index f6e259b..615f418 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 _0x89f7=['findAll','catch','include','options','find','create','body','user','role','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','params','eml-format','rimraf','zip-dir','request-promise','bluebird','util','path','sox','to-csv','fs-extra','lodash','squel','crypto','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/environment','../../config/license/util','../../mysqldb','status','end','offset','undefined','limit','count','set','Content-Range','json','apply','reject','save','then','get','ChanSpies','UserProfileResource','destroy','sendStatus','error','name','send','index','VoiceChanSpy','rawAttributes','fieldName','type','key','model','keys','filters','intersection','query','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','map','VIRTUAL','merge','includeAll'];(function(_0x493b70,_0x168e73){var _0x4c2355=function(_0x1e0247){while(--_0x1e0247){_0x493b70['push'](_0x493b70['shift']());}};_0x4c2355(++_0x168e73);}(_0x89f7,0x105));var _0x789f=function(_0x11adbd,_0x5055f5){_0x11adbd=_0x11adbd-0x0;var _0x270029=_0x89f7[_0x11adbd];return _0x270029;};'use strict';var emlformat=require(_0x789f('0x0'));var rimraf=require(_0x789f('0x1'));var zipdir=require(_0x789f('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x789f('0x3'));var moment=require('moment');var BPromise=require(_0x789f('0x4'));var Mustache=require('mustache');var util=require(_0x789f('0x5'));var path=require(_0x789f('0x6'));var sox=require(_0x789f('0x7'));var csv=require(_0x789f('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x789f('0x9'));var _=require(_0x789f('0xa'));var squel=require(_0x789f('0xb'));var crypto=require(_0x789f('0xc'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0x789f('0x8'));var querystring=require(_0x789f('0xd'));var Papa=require(_0x789f('0xe'));var Redis=require('ioredis');var authService=require(_0x789f('0xf'));var qs=require(_0x789f('0x10'));var as=require(_0x789f('0x11'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')('api');var utils=require('../../config/utils');var config=require(_0x789f('0x12'));var licenseUtil=require(_0x789f('0x13'));var db=require(_0x789f('0x14'))['db'];function respondWithStatusCode(_0x137c31,_0x8819db){_0x8819db=_0x8819db||0xcc;return function(_0x3c9259){if(_0x3c9259){return _0x137c31['sendStatus'](_0x8819db);}return _0x137c31[_0x789f('0x15')](_0x8819db)[_0x789f('0x16')]();};}function respondWithResult(_0x103241,_0xe767ad){_0xe767ad=_0xe767ad||0xc8;return function(_0x4c16cb){if(_0x4c16cb){return _0x103241[_0x789f('0x15')](_0xe767ad)['json'](_0x4c16cb);}};}function respondWithFilteredResult(_0x7fd299,_0x511ca4){return function(_0x51207b){if(_0x51207b){var _0x264258=typeof _0x511ca4[_0x789f('0x17')]===_0x789f('0x18')&&typeof _0x511ca4[_0x789f('0x19')]===_0x789f('0x18');var _0x44058c=_0x51207b[_0x789f('0x1a')];var _0x509853=_0x264258?0x0:_0x511ca4[_0x789f('0x17')];var _0x678cfb=_0x264258?_0x51207b[_0x789f('0x1a')]:_0x511ca4[_0x789f('0x17')]+_0x511ca4[_0x789f('0x19')];var _0xe4bb84;if(_0x678cfb>=_0x44058c){_0x678cfb=_0x44058c;_0xe4bb84=0xc8;}else{_0xe4bb84=0xce;}_0x7fd299['status'](_0xe4bb84);return _0x7fd299[_0x789f('0x1b')](_0x789f('0x1c'),_0x509853+'-'+_0x678cfb+'/'+_0x44058c)[_0x789f('0x1d')](_0x51207b);}return null;};}function patchUpdates(_0x5f2999){return function(_0x2b2ab0){try{jsonpatch[_0x789f('0x1e')](_0x2b2ab0,_0x5f2999,!![]);}catch(_0x415c71){return BPromise[_0x789f('0x1f')](_0x415c71);}return _0x2b2ab0[_0x789f('0x20')]();};}function saveUpdates(_0x590d01,_0x2611d8){return function(_0x162855){if(_0x162855){return _0x162855['update'](_0x590d01)[_0x789f('0x21')](function(_0xf9781f){return _0xf9781f;});}return null;};}function removeEntity(_0x1a67f0,_0x8e445f){return function(_0x52e3c4){if(_0x52e3c4){return _0x52e3c4['destroy']()['then'](function(){var _0x15122a=_0x52e3c4[_0x789f('0x22')]({'plain':!![]});var _0x4c14bd=_0x789f('0x23');return db[_0x789f('0x24')][_0x789f('0x25')]({'where':{'type':_0x4c14bd,'resourceId':_0x15122a['id']}})['then'](function(){return _0x52e3c4;});})[_0x789f('0x21')](function(){_0x1a67f0[_0x789f('0x15')](0xcc)[_0x789f('0x16')]();});}};}function handleEntityNotFound(_0x4344ea,_0x558598){return function(_0x1550b){if(!_0x1550b){_0x4344ea[_0x789f('0x26')](0x194);}return _0x1550b;};}function handleError(_0x23037c,_0xa655be){_0xa655be=_0xa655be||0x1f4;return function(_0xd5a07){logger[_0x789f('0x27')](_0xd5a07['stack']);if(_0xd5a07[_0x789f('0x28')]){delete _0xd5a07[_0x789f('0x28')];}_0x23037c[_0x789f('0x15')](_0xa655be)[_0x789f('0x29')](_0xd5a07);};}exports[_0x789f('0x2a')]=function(_0x28c365,_0x4ff7d0){var _0x55d202={},_0x1e1421={},_0x47da54={'count':0x0,'rows':[]};var _0x34e5b7=_['map'](db[_0x789f('0x2b')][_0x789f('0x2c')],function(_0x2b626f){return{'name':_0x2b626f[_0x789f('0x2d')],'type':_0x2b626f[_0x789f('0x2e')][_0x789f('0x2f')]};});_0x1e1421[_0x789f('0x30')]=_['map'](_0x34e5b7,_0x789f('0x28'));_0x1e1421['query']=_[_0x789f('0x31')](_0x28c365['query']);_0x1e1421[_0x789f('0x32')]=_[_0x789f('0x33')](_0x1e1421[_0x789f('0x30')],_0x1e1421[_0x789f('0x34')]);_0x55d202[_0x789f('0x35')]=_[_0x789f('0x33')](_0x1e1421[_0x789f('0x30')],qs['fields'](_0x28c365[_0x789f('0x34')][_0x789f('0x36')]));_0x55d202[_0x789f('0x35')]=_0x55d202[_0x789f('0x35')][_0x789f('0x37')]?_0x55d202[_0x789f('0x35')]:_0x1e1421['model'];if(!_0x28c365['query'][_0x789f('0x38')](_0x789f('0x39'))){_0x55d202['limit']=qs[_0x789f('0x19')](_0x28c365[_0x789f('0x34')]['limit']);_0x55d202[_0x789f('0x17')]=qs[_0x789f('0x17')](_0x28c365[_0x789f('0x34')]['offset']);}_0x55d202[_0x789f('0x3a')]=qs[_0x789f('0x3b')](_0x28c365[_0x789f('0x34')]['sort']);_0x55d202[_0x789f('0x3c')]=qs['filters'](_[_0x789f('0x3d')](_0x28c365['query'],_0x1e1421[_0x789f('0x32')]),_0x34e5b7);if(_0x28c365[_0x789f('0x34')][_0x789f('0x3e')]){_0x55d202[_0x789f('0x3c')]=_['merge'](_0x55d202['where'],{'$or':_[_0x789f('0x3f')](_0x34e5b7,function(_0x418547){if(_0x418547[_0x789f('0x2e')]!==_0x789f('0x40')){var _0x13710e={};_0x13710e[_0x418547[_0x789f('0x28')]]={'$like':'%'+_0x28c365[_0x789f('0x34')][_0x789f('0x3e')]+'%'};return _0x13710e;}})});}_0x55d202=_[_0x789f('0x41')]({},_0x55d202,_0x28c365['options']);var _0xf8d12f={'where':_0x55d202[_0x789f('0x3c')]};return db['VoiceChanSpy'][_0x789f('0x1a')](_0xf8d12f)[_0x789f('0x21')](function(_0x31eecf){_0x47da54['count']=_0x31eecf;if(_0x28c365[_0x789f('0x34')][_0x789f('0x42')]){_0x55d202['include']=[{'all':!![]}];}return db[_0x789f('0x2b')][_0x789f('0x43')](_0x55d202);})[_0x789f('0x21')](function(_0x2c43ee){_0x47da54['rows']=_0x2c43ee;return _0x47da54;})['then'](respondWithFilteredResult(_0x4ff7d0,_0x55d202))[_0x789f('0x44')](handleError(_0x4ff7d0,null));};exports['show']=function(_0x25aa8d,_0x4e25f7){var _0x31b7bc={'raw':![],'where':{'id':_0x25aa8d['params']['id']}},_0xf491f4={};_0xf491f4['model']=_[_0x789f('0x31')](db['VoiceChanSpy']['rawAttributes']);_0xf491f4[_0x789f('0x34')]=_[_0x789f('0x31')](_0x25aa8d['query']);_0xf491f4['filters']=_['intersection'](_0xf491f4[_0x789f('0x30')],_0xf491f4['query']);_0x31b7bc['attributes']=_[_0x789f('0x33')](_0xf491f4[_0x789f('0x30')],qs[_0x789f('0x36')](_0x25aa8d[_0x789f('0x34')][_0x789f('0x36')]));_0x31b7bc[_0x789f('0x35')]=_0x31b7bc[_0x789f('0x35')][_0x789f('0x37')]?_0x31b7bc[_0x789f('0x35')]:_0xf491f4['model'];if(_0x25aa8d[_0x789f('0x34')][_0x789f('0x42')]){_0x31b7bc[_0x789f('0x45')]=[{'all':!![]}];}_0x31b7bc=_['merge']({},_0x31b7bc,_0x25aa8d[_0x789f('0x46')]);return db[_0x789f('0x2b')][_0x789f('0x47')](_0x31b7bc)[_0x789f('0x21')](handleEntityNotFound(_0x4e25f7,null))['then'](respondWithResult(_0x4e25f7,null))[_0x789f('0x44')](handleError(_0x4e25f7,null));};exports[_0x789f('0x48')]=function(_0x596c82,_0x218c5d){return db[_0x789f('0x2b')][_0x789f('0x48')](_0x596c82[_0x789f('0x49')],{})[_0x789f('0x21')](function(_0x55e340){var _0x3e1cb6=_0x596c82[_0x789f('0x4a')]['get']({'plain':!![]});if(!_0x3e1cb6)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x3e1cb6[_0x789f('0x4b')]==='user'){var _0xfdba86=_0x55e340[_0x789f('0x22')]({'plain':!![]});var _0x1cdb86=_0x789f('0x23');return db[_0x789f('0x4c')][_0x789f('0x47')]({'where':{'name':_0x1cdb86,'userProfileId':_0x3e1cb6[_0x789f('0x4d')]},'raw':!![]})[_0x789f('0x21')](function(_0xa30f7){if(_0xa30f7&&_0xa30f7[_0x789f('0x4e')]===0x0){return db['UserProfileResource']['create']({'name':_0xfdba86[_0x789f('0x28')],'resourceId':_0xfdba86['id'],'type':_0xa30f7[_0x789f('0x28')],'sectionId':_0xa30f7['id']},{})[_0x789f('0x21')](function(){return _0x55e340;});}else{return _0x55e340;}})[_0x789f('0x44')](function(_0x4d5700){logger[_0x789f('0x27')](_0x789f('0x4f'),_0x4d5700);throw _0x4d5700;});}return _0x55e340;})['then'](respondWithResult(_0x218c5d,0xc9))['catch'](handleError(_0x218c5d,null));};exports[_0x789f('0x50')]=function(_0x98ee83,_0x1418ef){if(_0x98ee83[_0x789f('0x49')]['id']){delete _0x98ee83[_0x789f('0x49')]['id'];}return db[_0x789f('0x2b')]['find']({'where':{'id':_0x98ee83['params']['id']}})[_0x789f('0x21')](handleEntityNotFound(_0x1418ef,null))[_0x789f('0x21')](saveUpdates(_0x98ee83[_0x789f('0x49')],null))[_0x789f('0x21')](respondWithResult(_0x1418ef,null))['catch'](handleError(_0x1418ef,null));};exports['destroy']=function(_0x347347,_0xc8f58){return db[_0x789f('0x2b')][_0x789f('0x47')]({'where':{'id':_0x347347[_0x789f('0x51')]['id']}})['then'](handleEntityNotFound(_0xc8f58,null))[_0x789f('0x21')](removeEntity(_0xc8f58,null))[_0x789f('0x44')](handleError(_0xc8f58,null));}; \ No newline at end of file +var _0x524a=['rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','sox','to-csv','ejs','lodash','crypto','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/utils','../../config/environment','../../config/license/util','sendStatus','end','json','offset','undefined','count','status','set','Content-Range','apply','reject','save','update','then','ChanSpies','UserProfileResource','destroy','stack','name','index','map','VoiceChanSpy','fieldName','model','query','filters','attributes','intersection','fields','length','limit','order','sort','where','filter','type','VIRTUAL','merge','options','includeAll','include','findAll','rows','show','keys','rawAttributes','find','catch','create','body','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','user','UserProfileSection','userProfileId','autoAssociation','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','params','eml-format'];(function(_0x31506e,_0x1412b2){var _0x316c44=function(_0x1853b){while(--_0x1853b){_0x31506e['push'](_0x31506e['shift']());}};_0x316c44(++_0x1412b2);}(_0x524a,0xf5));var _0xa524=function(_0x4286ed,_0x7964a2){_0x4286ed=_0x4286ed-0x0;var _0x2e017f=_0x524a[_0x4286ed];return _0x2e017f;};'use strict';var emlformat=require(_0xa524('0x0'));var rimraf=require(_0xa524('0x1'));var zipdir=require(_0xa524('0x2'));var jsonpatch=require(_0xa524('0x3'));var rp=require('request-promise');var moment=require(_0xa524('0x4'));var BPromise=require(_0xa524('0x5'));var Mustache=require(_0xa524('0x6'));var util=require('util');var path=require('path');var sox=require(_0xa524('0x7'));var csv=require(_0xa524('0x8'));var ejs=require(_0xa524('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xa524('0xa'));var squel=require('squel');var crypto=require(_0xa524('0xb'));var jsforce=require(_0xa524('0xc'));var deskjs=require('desk.js');var toCsv=require(_0xa524('0x8'));var querystring=require(_0xa524('0xd'));var Papa=require(_0xa524('0xe'));var Redis=require(_0xa524('0xf'));var authService=require(_0xa524('0x10'));var qs=require('../../components/parsers/qs');var as=require(_0xa524('0x11'));var hardwareService=require(_0xa524('0x12'));var logger=require('../../config/logger')('api');var utils=require(_0xa524('0x13'));var config=require(_0xa524('0x14'));var licenseUtil=require(_0xa524('0x15'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x55117f,_0x14a0d6){_0x14a0d6=_0x14a0d6||0xcc;return function(_0x4aa46d){if(_0x4aa46d){return _0x55117f[_0xa524('0x16')](_0x14a0d6);}return _0x55117f['status'](_0x14a0d6)[_0xa524('0x17')]();};}function respondWithResult(_0x5c7e6a,_0x75bfe8){_0x75bfe8=_0x75bfe8||0xc8;return function(_0x281137){if(_0x281137){return _0x5c7e6a['status'](_0x75bfe8)[_0xa524('0x18')](_0x281137);}};}function respondWithFilteredResult(_0x15b14c,_0xe85361){return function(_0x1de01e){if(_0x1de01e){var _0x45347f=typeof _0xe85361[_0xa524('0x19')]===_0xa524('0x1a')&&typeof _0xe85361['limit']===_0xa524('0x1a');var _0x3d8494=_0x1de01e[_0xa524('0x1b')];var _0x3d6a0d=_0x45347f?0x0:_0xe85361[_0xa524('0x19')];var _0x805b93=_0x45347f?_0x1de01e[_0xa524('0x1b')]:_0xe85361[_0xa524('0x19')]+_0xe85361['limit'];var _0x304dea;if(_0x805b93>=_0x3d8494){_0x805b93=_0x3d8494;_0x304dea=0xc8;}else{_0x304dea=0xce;}_0x15b14c[_0xa524('0x1c')](_0x304dea);return _0x15b14c[_0xa524('0x1d')](_0xa524('0x1e'),_0x3d6a0d+'-'+_0x805b93+'/'+_0x3d8494)['json'](_0x1de01e);}return null;};}function patchUpdates(_0x5510fa){return function(_0x40f4bd){try{jsonpatch[_0xa524('0x1f')](_0x40f4bd,_0x5510fa,!![]);}catch(_0x21e114){return BPromise[_0xa524('0x20')](_0x21e114);}return _0x40f4bd[_0xa524('0x21')]();};}function saveUpdates(_0x3866e2,_0x4abffe){return function(_0x262eac){if(_0x262eac){return _0x262eac[_0xa524('0x22')](_0x3866e2)[_0xa524('0x23')](function(_0x40fb4b){return _0x40fb4b;});}return null;};}function removeEntity(_0x226784,_0x45cdcc){return function(_0x26e931){if(_0x26e931){return _0x26e931['destroy']()[_0xa524('0x23')](function(){var _0x221bf=_0x26e931['get']({'plain':!![]});var _0x47efb3=_0xa524('0x24');return db[_0xa524('0x25')][_0xa524('0x26')]({'where':{'type':_0x47efb3,'resourceId':_0x221bf['id']}})[_0xa524('0x23')](function(){return _0x26e931;});})[_0xa524('0x23')](function(){_0x226784['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x1aeabc,_0x869b22){return function(_0x1582fa){if(!_0x1582fa){_0x1aeabc[_0xa524('0x16')](0x194);}return _0x1582fa;};}function handleError(_0x505c42,_0x1c84c6){_0x1c84c6=_0x1c84c6||0x1f4;return function(_0x32ba03){logger['error'](_0x32ba03[_0xa524('0x27')]);if(_0x32ba03[_0xa524('0x28')]){delete _0x32ba03['name'];}_0x505c42[_0xa524('0x1c')](_0x1c84c6)['send'](_0x32ba03);};}exports[_0xa524('0x29')]=function(_0x38e051,_0x45b846){var _0x238133={},_0x136e83={},_0x1c706b={'count':0x0,'rows':[]};var _0x4f6133=_[_0xa524('0x2a')](db[_0xa524('0x2b')]['rawAttributes'],function(_0x535e41){return{'name':_0x535e41[_0xa524('0x2c')],'type':_0x535e41['type']['key']};});_0x136e83[_0xa524('0x2d')]=_[_0xa524('0x2a')](_0x4f6133,_0xa524('0x28'));_0x136e83[_0xa524('0x2e')]=_['keys'](_0x38e051['query']);_0x136e83[_0xa524('0x2f')]=_['intersection'](_0x136e83['model'],_0x136e83[_0xa524('0x2e')]);_0x238133[_0xa524('0x30')]=_[_0xa524('0x31')](_0x136e83[_0xa524('0x2d')],qs[_0xa524('0x32')](_0x38e051[_0xa524('0x2e')][_0xa524('0x32')]));_0x238133[_0xa524('0x30')]=_0x238133[_0xa524('0x30')][_0xa524('0x33')]?_0x238133[_0xa524('0x30')]:_0x136e83[_0xa524('0x2d')];if(!_0x38e051['query']['hasOwnProperty']('nolimit')){_0x238133[_0xa524('0x34')]=qs[_0xa524('0x34')](_0x38e051['query'][_0xa524('0x34')]);_0x238133['offset']=qs[_0xa524('0x19')](_0x38e051[_0xa524('0x2e')]['offset']);}_0x238133[_0xa524('0x35')]=qs[_0xa524('0x36')](_0x38e051[_0xa524('0x2e')]['sort']);_0x238133[_0xa524('0x37')]=qs[_0xa524('0x2f')](_['pick'](_0x38e051[_0xa524('0x2e')],_0x136e83[_0xa524('0x2f')]),_0x4f6133);if(_0x38e051['query'][_0xa524('0x38')]){_0x238133[_0xa524('0x37')]=_['merge'](_0x238133[_0xa524('0x37')],{'$or':_[_0xa524('0x2a')](_0x4f6133,function(_0x186395){if(_0x186395[_0xa524('0x39')]!==_0xa524('0x3a')){var _0x38f87a={};_0x38f87a[_0x186395[_0xa524('0x28')]]={'$like':'%'+_0x38e051[_0xa524('0x2e')][_0xa524('0x38')]+'%'};return _0x38f87a;}})});}_0x238133=_[_0xa524('0x3b')]({},_0x238133,_0x38e051[_0xa524('0x3c')]);var _0x51cd09={'where':_0x238133[_0xa524('0x37')]};return db['VoiceChanSpy'][_0xa524('0x1b')](_0x51cd09)[_0xa524('0x23')](function(_0x35d92d){_0x1c706b[_0xa524('0x1b')]=_0x35d92d;if(_0x38e051[_0xa524('0x2e')][_0xa524('0x3d')]){_0x238133[_0xa524('0x3e')]=[{'all':!![]}];}return db[_0xa524('0x2b')][_0xa524('0x3f')](_0x238133);})[_0xa524('0x23')](function(_0x4a87d4){_0x1c706b[_0xa524('0x40')]=_0x4a87d4;return _0x1c706b;})[_0xa524('0x23')](respondWithFilteredResult(_0x45b846,_0x238133))['catch'](handleError(_0x45b846,null));};exports[_0xa524('0x41')]=function(_0x3f5564,_0x4885a4){var _0x492851={'raw':![],'where':{'id':_0x3f5564['params']['id']}},_0x4dff4b={};_0x4dff4b['model']=_[_0xa524('0x42')](db[_0xa524('0x2b')][_0xa524('0x43')]);_0x4dff4b[_0xa524('0x2e')]=_['keys'](_0x3f5564[_0xa524('0x2e')]);_0x4dff4b[_0xa524('0x2f')]=_[_0xa524('0x31')](_0x4dff4b[_0xa524('0x2d')],_0x4dff4b['query']);_0x492851[_0xa524('0x30')]=_[_0xa524('0x31')](_0x4dff4b[_0xa524('0x2d')],qs[_0xa524('0x32')](_0x3f5564[_0xa524('0x2e')]['fields']));_0x492851[_0xa524('0x30')]=_0x492851[_0xa524('0x30')][_0xa524('0x33')]?_0x492851[_0xa524('0x30')]:_0x4dff4b[_0xa524('0x2d')];if(_0x3f5564[_0xa524('0x2e')][_0xa524('0x3d')]){_0x492851[_0xa524('0x3e')]=[{'all':!![]}];}_0x492851=_[_0xa524('0x3b')]({},_0x492851,_0x3f5564['options']);return db['VoiceChanSpy'][_0xa524('0x44')](_0x492851)[_0xa524('0x23')](handleEntityNotFound(_0x4885a4,null))[_0xa524('0x23')](respondWithResult(_0x4885a4,null))[_0xa524('0x45')](handleError(_0x4885a4,null));};exports[_0xa524('0x46')]=function(_0xddc80,_0x56e570){return db[_0xa524('0x2b')][_0xa524('0x46')](_0xddc80[_0xa524('0x47')],{})[_0xa524('0x23')](function(_0x24c7ef){var _0x451bbe=_0xddc80['user'][_0xa524('0x48')]({'plain':!![]});if(!_0x451bbe)throw new Error(_0xa524('0x49'));if(_0x451bbe[_0xa524('0x4a')]===_0xa524('0x4b')){var _0x25ffbd=_0x24c7ef[_0xa524('0x48')]({'plain':!![]});var _0xef18b7=_0xa524('0x24');return db[_0xa524('0x4c')][_0xa524('0x44')]({'where':{'name':_0xef18b7,'userProfileId':_0x451bbe[_0xa524('0x4d')]},'raw':!![]})[_0xa524('0x23')](function(_0x3a374f){if(_0x3a374f&&_0x3a374f[_0xa524('0x4e')]===0x0){return db[_0xa524('0x25')]['create']({'name':_0x25ffbd[_0xa524('0x28')],'resourceId':_0x25ffbd['id'],'type':_0x3a374f[_0xa524('0x28')],'sectionId':_0x3a374f['id']},{})['then'](function(){return _0x24c7ef;});}else{return _0x24c7ef;}})['catch'](function(_0x32844c){logger[_0xa524('0x4f')](_0xa524('0x50'),_0x32844c);throw _0x32844c;});}return _0x24c7ef;})[_0xa524('0x23')](respondWithResult(_0x56e570,0xc9))[_0xa524('0x45')](handleError(_0x56e570,null));};exports[_0xa524('0x22')]=function(_0x121fc5,_0x4e3709){if(_0x121fc5[_0xa524('0x47')]['id']){delete _0x121fc5[_0xa524('0x47')]['id'];}return db[_0xa524('0x2b')][_0xa524('0x44')]({'where':{'id':_0x121fc5[_0xa524('0x51')]['id']}})['then'](handleEntityNotFound(_0x4e3709,null))[_0xa524('0x23')](saveUpdates(_0x121fc5['body'],null))[_0xa524('0x23')](respondWithResult(_0x4e3709,null))[_0xa524('0x45')](handleError(_0x4e3709,null));};exports[_0xa524('0x26')]=function(_0x3f5694,_0x161393){return db[_0xa524('0x2b')][_0xa524('0x44')]({'where':{'id':_0x3f5694['params']['id']}})['then'](handleEntityNotFound(_0x161393,null))[_0xa524('0x23')](removeEntity(_0x161393,null))[_0xa524('0x45')](handleError(_0x161393,null));}; \ No newline at end of file diff --git a/server/api/voiceChanSpy/voiceChanSpy.model.js b/server/api/voiceChanSpy/voiceChanSpy.model.js index 8abf8fd..250328a 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 _0x2fe2=['exports','models','define','VoiceChanSpy','voice_chanspy','VoiceExtension','bulkCreate','destroy','util','from-sip','format','%s%s','system','merge','Set','CDR(type)=%s','chanspy','record','push','MixMonitor','${UNIQUEID}.%s,a','recordingFormat','auth','password','ChanSpy','SIP/%s,%s','name','options','join','StopMixMonitor','length','internal','concat','findAll','then','catch'];(function(_0x1265ed,_0x4b85e8){var _0x5ac459=function(_0xf0c114){while(--_0xf0c114){_0x1265ed['push'](_0x1265ed['shift']());}};_0x5ac459(++_0x4b85e8);}(_0x2fe2,0x1b8));var _0x22fe=function(_0x52ecb3,_0xfbd8d5){_0x52ecb3=_0x52ecb3-0x0;var _0x8043bf=_0x2fe2[_0x52ecb3];return _0x8043bf;};'use strict';var _=require('lodash');var util=require(_0x22fe('0x0'));var BPromise=require('bluebird');var attributes=require('./voiceChanSpy.attributes');var getUserApplications=function(_0x595e55,_0xd0ffdd,_0x336a0d){var _0x1c8b92=0x1;var _0x362ca2=[];var _0x1840ad={'context':_0xd0ffdd['context']||_0x22fe('0x1'),'exten':util[_0x22fe('0x2')](_0x22fe('0x3'),_0x595e55['prefix'],_0x336a0d),'type':_0x22fe('0x4'),'isApp':![],'ChanSpyId':_0x595e55['id'],'UserId':_0xd0ffdd['id']};_0x362ca2['push'](_[_0x22fe('0x5')]({'app':_0x22fe('0x6'),'appdata':util[_0x22fe('0x2')](_0x22fe('0x7'),_0x22fe('0x8')),'priority':_0x1c8b92++},_0x1840ad));if(_0x595e55[_0x22fe('0x9')]){_0x362ca2[_0x22fe('0xa')](_[_0x22fe('0x5')]({'app':_0x22fe('0xb'),'appdata':util['format'](_0x22fe('0xc'),_0x595e55[_0x22fe('0xd')]),'priority':_0x1c8b92++},_0x1840ad));}if(_0x595e55[_0x22fe('0xe')]){_0x362ca2[_0x22fe('0xa')](_['merge']({'app':'Authenticate','appdata':_0x595e55[_0x22fe('0xf')],'priority':_0x1c8b92++},_0x1840ad));}_0x362ca2[_0x22fe('0xa')](_['merge']({'app':_0x22fe('0x10'),'appdata':util[_0x22fe('0x2')](_0x22fe('0x11'),_0xd0ffdd[_0x22fe('0x12')],_0x595e55[_0x22fe('0x13')]?_0x595e55[_0x22fe('0x13')][_0x22fe('0x14')](''):''),'priority':_0x1c8b92++},_0x1840ad));if(_0x595e55[_0x22fe('0x9')]){_0x362ca2[_0x22fe('0xa')](_[_0x22fe('0x5')]({'app':_0x22fe('0x15'),'priority':_0x1c8b92++},_0x1840ad));}return _0x362ca2;};var getChanSpyApplications=function(_0x3bdb38,_0x2361ca){var _0x506822=[];for(var _0x2f4376=0x0,_0xea8fb8=0x1;_0x2f4376<_0x2361ca[_0x22fe('0x16')];_0x2f4376++,_0xea8fb8=0x1){_0x506822=_0x506822['concat'](getUserApplications(_0x3bdb38,_0x2361ca[_0x2f4376],_0x2361ca[_0x2f4376]['internal']));if(_0x2361ca[_0x2f4376][_0x22fe('0x17')]!=_0x2361ca[_0x2f4376][_0x22fe('0x12')]){_0x506822=_0x506822[_0x22fe('0x18')](getUserApplications(_0x3bdb38,_0x2361ca[_0x2f4376],_0x2361ca[_0x2f4376][_0x22fe('0x12')]));}}return _0x506822;};var getChanSpyPromise=function(_0x39b2aa,_0x1bf78c){return new BPromise(function(_0x2af156,_0x496949){return _0x39b2aa['User'][_0x22fe('0x19')]({'attributes':['id',_0x22fe('0x12'),_0x22fe('0x17')],'where':{'role':'agent','chanspy':!![]},'raw':!![]})[_0x22fe('0x1a')](function(_0x54526d){if(_0x54526d){return _0x2af156(getChanSpyApplications(_0x1bf78c,_0x54526d));}return _0x2af156([]);})[_0x22fe('0x1b')](function(_0x7c92b9){_0x496949(_0x7c92b9);});});};module[_0x22fe('0x1c')]=function(_0x42421b,_0xd8e97f){var _0x387cb3=_0x42421b[_0x22fe('0x1d')];return _0x42421b[_0x22fe('0x1e')](_0x22fe('0x1f'),attributes,{'tableName':_0x22fe('0x20'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'afterCreate':function(_0x3fee0c,_0x1be0a7,_0x570766){return getChanSpyPromise(_0x387cb3,_0x3fee0c)[_0x22fe('0x1a')](function(_0x5c7140){if(_0x5c7140&&_0x5c7140['length']){return _0x387cb3[_0x22fe('0x21')][_0x22fe('0x22')](_0x5c7140);}})[_0x22fe('0x1a')](function(){_0x570766();})[_0x22fe('0x1b')](function(_0x13455d){_0x570766(_0x13455d);});},'afterUpdate':function(_0x278c3e,_0x211323,_0x1f2c2a){return _0x387cb3[_0x22fe('0x21')][_0x22fe('0x23')]({'where':{'ChanSpyId':_0x278c3e['id']}})[_0x22fe('0x1a')](function(){return getChanSpyPromise(_0x387cb3,_0x278c3e);})[_0x22fe('0x1a')](function(_0x5b54b3){if(_0x5b54b3&&_0x5b54b3[_0x22fe('0x16')]){return _0x387cb3[_0x22fe('0x21')][_0x22fe('0x22')](_0x5b54b3);}})[_0x22fe('0x1a')](function(){_0x1f2c2a();})[_0x22fe('0x1b')](function(_0x2093ea){_0x1f2c2a(_0x2093ea);});},'afterDestroy':function(_0x79cbae,_0x1f8adc,_0x15f9d8){return _0x387cb3['VoiceExtension'][_0x22fe('0x23')]({'where':{'ChanSpyId':_0x79cbae['id']}})[_0x22fe('0x1a')](function(){_0x15f9d8();})[_0x22fe('0x1b')](function(_0x3726f2){_0x15f9d8(_0x3726f2);});}}});}; \ No newline at end of file +var _0xde75=['ChanSpy','SIP/%s,%s','name','join','StopMixMonitor','length','concat','User','findAll','internal','catch','models','define','voice_chanspy','then','VoiceExtension','bulkCreate','destroy','util','bluebird','./voiceChanSpy.attributes','format','%s%s','prefix','system','push','merge','Set','CDR(type)=%s','record','MixMonitor','${UNIQUEID}.%s,a','password'];(function(_0xcef371,_0xad25a7){var _0x1661cd=function(_0x4e97a7){while(--_0x4e97a7){_0xcef371['push'](_0xcef371['shift']());}};_0x1661cd(++_0xad25a7);}(_0xde75,0x19e));var _0x5de7=function(_0x1ef3be,_0x2618b5){_0x1ef3be=_0x1ef3be-0x0;var _0x1b096c=_0xde75[_0x1ef3be];return _0x1b096c;};'use strict';var _=require('lodash');var util=require(_0x5de7('0x0'));var BPromise=require(_0x5de7('0x1'));var attributes=require(_0x5de7('0x2'));var getUserApplications=function(_0x21f2f5,_0x26d65d,_0x3a12ca){var _0x4e2a6a=0x1;var _0x35d182=[];var _0x47c555={'context':_0x26d65d['context']||'from-sip','exten':util[_0x5de7('0x3')](_0x5de7('0x4'),_0x21f2f5[_0x5de7('0x5')],_0x3a12ca),'type':_0x5de7('0x6'),'isApp':![],'ChanSpyId':_0x21f2f5['id'],'UserId':_0x26d65d['id']};_0x35d182[_0x5de7('0x7')](_[_0x5de7('0x8')]({'app':_0x5de7('0x9'),'appdata':util[_0x5de7('0x3')](_0x5de7('0xa'),'chanspy'),'priority':_0x4e2a6a++},_0x47c555));if(_0x21f2f5[_0x5de7('0xb')]){_0x35d182['push'](_[_0x5de7('0x8')]({'app':_0x5de7('0xc'),'appdata':util[_0x5de7('0x3')](_0x5de7('0xd'),_0x21f2f5['recordingFormat']),'priority':_0x4e2a6a++},_0x47c555));}if(_0x21f2f5['auth']){_0x35d182[_0x5de7('0x7')](_['merge']({'app':'Authenticate','appdata':_0x21f2f5[_0x5de7('0xe')],'priority':_0x4e2a6a++},_0x47c555));}_0x35d182[_0x5de7('0x7')](_[_0x5de7('0x8')]({'app':_0x5de7('0xf'),'appdata':util[_0x5de7('0x3')](_0x5de7('0x10'),_0x26d65d[_0x5de7('0x11')],_0x21f2f5['options']?_0x21f2f5['options'][_0x5de7('0x12')](''):''),'priority':_0x4e2a6a++},_0x47c555));if(_0x21f2f5[_0x5de7('0xb')]){_0x35d182[_0x5de7('0x7')](_[_0x5de7('0x8')]({'app':_0x5de7('0x13'),'priority':_0x4e2a6a++},_0x47c555));}return _0x35d182;};var getChanSpyApplications=function(_0x556301,_0x4195c5){var _0x525ef0=[];for(var _0x20443e=0x0,_0x99aa43=0x1;_0x20443e<_0x4195c5[_0x5de7('0x14')];_0x20443e++,_0x99aa43=0x1){_0x525ef0=_0x525ef0[_0x5de7('0x15')](getUserApplications(_0x556301,_0x4195c5[_0x20443e],_0x4195c5[_0x20443e]['internal']));if(_0x4195c5[_0x20443e]['internal']!=_0x4195c5[_0x20443e][_0x5de7('0x11')]){_0x525ef0=_0x525ef0[_0x5de7('0x15')](getUserApplications(_0x556301,_0x4195c5[_0x20443e],_0x4195c5[_0x20443e][_0x5de7('0x11')]));}}return _0x525ef0;};var getChanSpyPromise=function(_0x408098,_0x1390ef){return new BPromise(function(_0x1008d2,_0x4a46b3){return _0x408098[_0x5de7('0x16')][_0x5de7('0x17')]({'attributes':['id',_0x5de7('0x11'),_0x5de7('0x18')],'where':{'role':'agent','chanspy':!![]},'raw':!![]})['then'](function(_0x1fcba2){if(_0x1fcba2){return _0x1008d2(getChanSpyApplications(_0x1390ef,_0x1fcba2));}return _0x1008d2([]);})[_0x5de7('0x19')](function(_0x3fdd31){_0x4a46b3(_0x3fdd31);});});};module['exports']=function(_0x16ae3c,_0x214cdc){var _0x9cb657=_0x16ae3c[_0x5de7('0x1a')];return _0x16ae3c[_0x5de7('0x1b')]('VoiceChanSpy',attributes,{'tableName':_0x5de7('0x1c'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'afterCreate':function(_0x4d0ef4,_0x2862c9,_0x506b72){return getChanSpyPromise(_0x9cb657,_0x4d0ef4)[_0x5de7('0x1d')](function(_0x325834){if(_0x325834&&_0x325834[_0x5de7('0x14')]){return _0x9cb657[_0x5de7('0x1e')][_0x5de7('0x1f')](_0x325834);}})[_0x5de7('0x1d')](function(){_0x506b72();})[_0x5de7('0x19')](function(_0x34a09e){_0x506b72(_0x34a09e);});},'afterUpdate':function(_0x110ec4,_0x559f24,_0x5656ce){return _0x9cb657[_0x5de7('0x1e')][_0x5de7('0x20')]({'where':{'ChanSpyId':_0x110ec4['id']}})[_0x5de7('0x1d')](function(){return getChanSpyPromise(_0x9cb657,_0x110ec4);})[_0x5de7('0x1d')](function(_0x4b8270){if(_0x4b8270&&_0x4b8270[_0x5de7('0x14')]){return _0x9cb657['VoiceExtension']['bulkCreate'](_0x4b8270);}})[_0x5de7('0x1d')](function(){_0x5656ce();})[_0x5de7('0x19')](function(_0x1947b3){_0x5656ce(_0x1947b3);});},'afterDestroy':function(_0x1df29e,_0x10d210,_0x12b4ef){return _0x9cb657[_0x5de7('0x1e')][_0x5de7('0x20')]({'where':{'ChanSpyId':_0x1df29e['id']}})[_0x5de7('0x1d')](function(){_0x12b4ef();})[_0x5de7('0x19')](function(_0x3f9ac5){_0x12b4ef(_0x3f9ac5);});}}});}; \ No newline at end of file diff --git a/server/api/voiceChanSpy/voiceChanSpy.rpc.js b/server/api/voiceChanSpy/voiceChanSpy.rpc.js index fb397ba..68242bd 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 _0x6e6c=['randomstring','../../config/utils','rpc','jayson/promise','client','then','info','VoiceChanSpy,\x20%s,\x20%s','request\x20sent','debug','VoiceChanSpy,\x20%s,\x20%s,\x20%s','stringify','error','message','catch','lodash','util','bluebird'];(function(_0x4de1c3,_0xbe77b9){var _0x26acfe=function(_0x2c9df4){while(--_0x2c9df4){_0x4de1c3['push'](_0x4de1c3['shift']());}};_0x26acfe(++_0xbe77b9);}(_0x6e6c,0xc3));var _0xc6e6=function(_0x19e35c,_0x29cd1e){_0x19e35c=_0x19e35c-0x0;var _0x3e1fe8=_0x6e6c[_0x19e35c];return _0x3e1fe8;};'use strict';var _=require(_0xc6e6('0x0'));var util=require(_0xc6e6('0x1'));var moment=require('moment');var BPromise=require(_0xc6e6('0x2'));var rs=require(_0xc6e6('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0xc6e6('0x4'));var logger=require('../../config/logger')(_0xc6e6('0x5'));var config=require('../../config/environment');var jayson=require(_0xc6e6('0x6'));var client=jayson[_0xc6e6('0x7')]['http']({'port':0x232a});function respondWithRpcPromise(_0x301f55,_0x30a10b,_0x4da7bd){return new BPromise(function(_0x324706,_0x15d268){return client['request'](_0x301f55,_0x4da7bd)[_0xc6e6('0x8')](function(_0x481799){logger[_0xc6e6('0x9')](_0xc6e6('0xa'),_0x30a10b,_0xc6e6('0xb'));logger[_0xc6e6('0xc')](_0xc6e6('0xd'),_0x30a10b,_0xc6e6('0xb'),JSON[_0xc6e6('0xe')](_0x481799));if(_0x481799[_0xc6e6('0xf')]){if(_0x481799[_0xc6e6('0xf')]['code']===0x1f4){logger[_0xc6e6('0xf')]('VoiceChanSpy,\x20%s,\x20%s',_0x30a10b,_0x481799[_0xc6e6('0xf')][_0xc6e6('0x10')]);return _0x15d268(_0x481799[_0xc6e6('0xf')][_0xc6e6('0x10')]);}logger['error'](_0xc6e6('0xa'),_0x30a10b,_0x481799[_0xc6e6('0xf')][_0xc6e6('0x10')]);return _0x324706(_0x481799[_0xc6e6('0xf')][_0xc6e6('0x10')]);}else{logger['info'](_0xc6e6('0xa'),_0x30a10b,_0xc6e6('0xb'));_0x324706(_0x481799['result'][_0xc6e6('0x10')]);}})[_0xc6e6('0x11')](function(_0xedf127){logger['error']('VoiceChanSpy,\x20%s,\x20%s',_0x30a10b,_0xedf127);_0x15d268(_0xedf127);});});} \ 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(_0x48744b,_0x25223f){var _0x50920f=function(_0x56e8f8){while(--_0x56e8f8){_0x48744b['push'](_0x48744b['shift']());}};_0x50920f(++_0x25223f);}(_0x2f3a,0xfb));var _0xa2f3=function(_0x340ee2,_0x35a040){_0x340ee2=_0x340ee2-0x0;var _0x477639=_0x2f3a[_0x340ee2];return _0x477639;};'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 016f3cf..e14847c 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 _0x5fad=['./voiceContext.controller','get','isAuthenticated','show','post','create','put','update','destroy','exports','multer','util','connect-timeout','Router','fs-extra','../../components/interaction/service','../../config/environment'];(function(_0x57acd0,_0x35704a){var _0x4ae3ba=function(_0x410ba9){while(--_0x410ba9){_0x57acd0['push'](_0x57acd0['shift']());}};_0x4ae3ba(++_0x35704a);}(_0x5fad,0x11a));var _0xd5fa=function(_0x4a6c4d,_0x455768){_0x4a6c4d=_0x4a6c4d-0x0;var _0x31800b=_0x5fad[_0x4a6c4d];return _0x31800b;};'use strict';var multer=require(_0xd5fa('0x0'));var util=require(_0xd5fa('0x1'));var path=require('path');var timeout=require(_0xd5fa('0x2'));var express=require('express');var router=express[_0xd5fa('0x3')]();var fs_extra=require(_0xd5fa('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0xd5fa('0x5'));var config=require(_0xd5fa('0x6'));var controller=require(_0xd5fa('0x7'));router[_0xd5fa('0x8')]('/',auth[_0xd5fa('0x9')](),controller['index']);router[_0xd5fa('0x8')]('/:id',auth[_0xd5fa('0x9')](),controller[_0xd5fa('0xa')]);router[_0xd5fa('0xb')]('/',auth[_0xd5fa('0x9')](),controller[_0xd5fa('0xc')]);router[_0xd5fa('0xd')]('/:id',auth[_0xd5fa('0x9')](),controller[_0xd5fa('0xe')]);router['delete']('/:id',auth[_0xd5fa('0x9')](),controller[_0xd5fa('0xf')]);module[_0xd5fa('0x10')]=router; \ No newline at end of file +var _0x3d2a=['get','index','/:id','isAuthenticated','show','post','destroy','exports','util','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./voiceContext.controller'];(function(_0x180f84,_0xcfbf26){var _0x38c465=function(_0x4e6490){while(--_0x4e6490){_0x180f84['push'](_0x180f84['shift']());}};_0x38c465(++_0xcfbf26);}(_0x3d2a,0xa8));var _0xa3d2=function(_0x100dcb,_0x2cfcdf){_0x100dcb=_0x100dcb-0x0;var _0x690bf=_0x3d2a[_0x100dcb];return _0x690bf;};'use strict';var multer=require('multer');var util=require(_0xa3d2('0x0'));var path=require('path');var timeout=require(_0xa3d2('0x1'));var express=require(_0xa3d2('0x2'));var router=express[_0xa3d2('0x3')]();var fs_extra=require(_0xa3d2('0x4'));var auth=require(_0xa3d2('0x5'));var interaction=require(_0xa3d2('0x6'));var config=require('../../config/environment');var controller=require(_0xa3d2('0x7'));router[_0xa3d2('0x8')]('/',auth['isAuthenticated'](),controller[_0xa3d2('0x9')]);router[_0xa3d2('0x8')](_0xa3d2('0xa'),auth[_0xa3d2('0xb')](),controller[_0xa3d2('0xc')]);router[_0xa3d2('0xd')]('/',auth[_0xa3d2('0xb')](),controller['create']);router['put'](_0xa3d2('0xa'),auth[_0xa3d2('0xb')](),controller['update']);router['delete'](_0xa3d2('0xa'),auth[_0xa3d2('0xb')](),controller[_0xa3d2('0xe')]);module[_0xa3d2('0xf')]=router; \ No newline at end of file diff --git a/server/api/voiceContext/voiceContext.attributes.js b/server/api/voiceContext/voiceContext.attributes.js index a487407..e6f02fa 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 _0x8a5c=['STRING','name','BOOLEAN','sequelize'];(function(_0x295fe2,_0x5c92c0){var _0x40426b=function(_0x1d165f){while(--_0x1d165f){_0x295fe2['push'](_0x295fe2['shift']());}};_0x40426b(++_0x5c92c0);}(_0x8a5c,0x15f));var _0xc8a5=function(_0x5a2cb2,_0x79a980){_0x5a2cb2=_0x5a2cb2-0x0;var _0x1f6b0c=_0x8a5c[_0x5a2cb2];return _0x1f6b0c;};'use strict';var Sequelize=require(_0xc8a5('0x0'));module['exports']={'name':{'type':Sequelize[_0xc8a5('0x1')],'unique':_0xc8a5('0x2')},'description':{'type':Sequelize[_0xc8a5('0x1')],'allowNull':!![]},'defaultEntry':{'type':Sequelize[_0xc8a5('0x3')],'defaultValue':0x0}}; \ No newline at end of file +var _0xb763=['name','BOOLEAN','sequelize','STRING'];(function(_0x423bc7,_0x36c0c2){var _0x3b00e7=function(_0x549791){while(--_0x549791){_0x423bc7['push'](_0x423bc7['shift']());}};_0x3b00e7(++_0x36c0c2);}(_0xb763,0x16a));var _0x3b76=function(_0x2a0283,_0xf60fff){_0x2a0283=_0x2a0283-0x0;var _0x6ee7d4=_0xb763[_0x2a0283];return _0x6ee7d4;};'use strict';var Sequelize=require(_0x3b76('0x0'));module['exports']={'name':{'type':Sequelize[_0x3b76('0x1')],'unique':_0x3b76('0x2')},'description':{'type':Sequelize[_0x3b76('0x1')],'allowNull':!![]},'defaultEntry':{'type':Sequelize[_0x3b76('0x3')],'defaultValue':0x0}}; \ No newline at end of file diff --git a/server/api/voiceContext/voiceContext.controller.js b/server/api/voiceContext/voiceContext.controller.js index c0e85b0..e590423 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 _0x1eb9=['apply','reject','update','destroy','get','Contexts','stack','name','send','index','VoiceContext','rawAttributes','fieldName','type','key','map','query','keys','filters','intersection','attributes','model','fields','length','hasOwnProperty','nolimit','limit','order','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','include','findAll','rows','show','params','find','create','body','readFileSync','join','root','utf8','render','writeFileSync','Reload','chan_sip.so','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','autoAssociation','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','/etc/asterisk/extensions_xcally_contexts.conf','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','ioredis','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','jayson/promise','http','then','request\x20sent','VoiceContext,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','VoiceContext,\x20%s,\x20%s','result','catch','sendStatus','status','end','json','undefined','offset','count'];(function(_0x57d2af,_0x124741){var _0x444a9c=function(_0x39154c){while(--_0x39154c){_0x57d2af['push'](_0x57d2af['shift']());}};_0x444a9c(++_0x124741);}(_0x1eb9,0x1dd));var _0x91eb=function(_0x36ea6b,_0x3b6a9e){_0x36ea6b=_0x36ea6b-0x0;var _0x25c6d2=_0x1eb9[_0x36ea6b];return _0x25c6d2;};'use strict';var emlformat=require(_0x91eb('0x0'));var rimraf=require(_0x91eb('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x91eb('0x2'));var rp=require(_0x91eb('0x3'));var moment=require(_0x91eb('0x4'));var BPromise=require(_0x91eb('0x5'));var Mustache=require(_0x91eb('0x6'));var util=require('util');var path=require('path');var sox=require('sox');var csv=require(_0x91eb('0x7'));var ejs=require(_0x91eb('0x8'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x91eb('0x9'));var squel=require(_0x91eb('0xa'));var crypto=require(_0x91eb('0xb'));var jsforce=require(_0x91eb('0xc'));var deskjs=require(_0x91eb('0xd'));var toCsv=require(_0x91eb('0x7'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x91eb('0xe'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0x91eb('0xf'));var hardwareService=require(_0x91eb('0x10'));var logger=require(_0x91eb('0x11'))(_0x91eb('0x12'));var utils=require(_0x91eb('0x13'));var config=require(_0x91eb('0x14'));var licenseUtil=require(_0x91eb('0x15'));var db=require(_0x91eb('0x16'))['db'];var jayson=require(_0x91eb('0x17'));var client=jayson['client'][_0x91eb('0x18')]({'port':0x232a});function respondWithRpcPromise(_0x5149b5,_0x451f16,_0x173670,_0x2d8474){return new BPromise(function(_0x2c0c69,_0x5994b1){var _0x321516=_0x2d8474||client;return _0x321516['request'](_0x5149b5,_0x173670)[_0x91eb('0x19')](function(_0xd3c1a1){logger['info']('VoiceContext,\x20%s,\x20%s',_0x451f16,_0x91eb('0x1a'));logger['debug'](_0x91eb('0x1b'),_0x451f16,'request\x20sent',JSON[_0x91eb('0x1c')](_0xd3c1a1));if(_0xd3c1a1[_0x91eb('0x1d')]){if(_0xd3c1a1[_0x91eb('0x1d')][_0x91eb('0x1e')]===0x1f4){logger[_0x91eb('0x1d')]('VoiceContext,\x20%s,\x20%s',_0x451f16,_0xd3c1a1[_0x91eb('0x1d')]['message']);return _0x5994b1(_0xd3c1a1[_0x91eb('0x1d')][_0x91eb('0x1f')]);}logger[_0x91eb('0x1d')]('VoiceContext,\x20%s,\x20%s',_0x451f16,_0xd3c1a1[_0x91eb('0x1d')][_0x91eb('0x1f')]);return _0x2c0c69(_0xd3c1a1[_0x91eb('0x1d')]['message']);}else{logger[_0x91eb('0x20')](_0x91eb('0x21'),_0x451f16,_0x91eb('0x1a'));_0x2c0c69(_0xd3c1a1[_0x91eb('0x22')][_0x91eb('0x1f')]);}})[_0x91eb('0x23')](function(_0x18e80a){logger['error'](_0x91eb('0x21'),_0x451f16,_0x18e80a);_0x5994b1(_0x18e80a);});});}function respondWithStatusCode(_0x5ba712,_0x2e0d7b){_0x2e0d7b=_0x2e0d7b||0xcc;return function(_0x1a1945){if(_0x1a1945){return _0x5ba712[_0x91eb('0x24')](_0x2e0d7b);}return _0x5ba712[_0x91eb('0x25')](_0x2e0d7b)[_0x91eb('0x26')]();};}function respondWithResult(_0x204567,_0x21f5b7){_0x21f5b7=_0x21f5b7||0xc8;return function(_0x49d1f0){if(_0x49d1f0){return _0x204567[_0x91eb('0x25')](_0x21f5b7)[_0x91eb('0x27')](_0x49d1f0);}};}function respondWithFilteredResult(_0x3059d4,_0x1fddc3){return function(_0x24f49e){if(_0x24f49e){var _0x1ddef4=typeof _0x1fddc3['offset']===_0x91eb('0x28')&&typeof _0x1fddc3['limit']===_0x91eb('0x28');var _0x48af5f=_0x24f49e['count'];var _0x5261c8=_0x1ddef4?0x0:_0x1fddc3[_0x91eb('0x29')];var _0x3e231d=_0x1ddef4?_0x24f49e[_0x91eb('0x2a')]:_0x1fddc3[_0x91eb('0x29')]+_0x1fddc3['limit'];var _0x35b80c;if(_0x3e231d>=_0x48af5f){_0x3e231d=_0x48af5f;_0x35b80c=0xc8;}else{_0x35b80c=0xce;}_0x3059d4[_0x91eb('0x25')](_0x35b80c);return _0x3059d4['set']('Content-Range',_0x5261c8+'-'+_0x3e231d+'/'+_0x48af5f)[_0x91eb('0x27')](_0x24f49e);}return null;};}function patchUpdates(_0x2f06a6){return function(_0xf4fb90){try{jsonpatch[_0x91eb('0x2b')](_0xf4fb90,_0x2f06a6,!![]);}catch(_0xc62a91){return BPromise[_0x91eb('0x2c')](_0xc62a91);}return _0xf4fb90['save']();};}function saveUpdates(_0xa56662,_0x14e563){return function(_0x25beec){if(_0x25beec){return _0x25beec[_0x91eb('0x2d')](_0xa56662)['then'](function(_0x538c18){return _0x538c18;});}return null;};}function removeEntity(_0x1de4c8,_0x3a1409){return function(_0x20a5e8){if(_0x20a5e8){return _0x20a5e8[_0x91eb('0x2e')]()[_0x91eb('0x19')](function(){var _0x11b7b2=_0x20a5e8[_0x91eb('0x2f')]({'plain':!![]});var _0x19f9e0=_0x91eb('0x30');return db['UserProfileResource'][_0x91eb('0x2e')]({'where':{'type':_0x19f9e0,'resourceId':_0x11b7b2['id']}})['then'](function(){return _0x20a5e8;});})[_0x91eb('0x19')](function(){_0x1de4c8[_0x91eb('0x25')](0xcc)['end']();});}};}function handleEntityNotFound(_0x307484,_0x21c01e){return function(_0x42f5c8){if(!_0x42f5c8){_0x307484[_0x91eb('0x24')](0x194);}return _0x42f5c8;};}function handleError(_0x332f72,_0x4a987b){_0x4a987b=_0x4a987b||0x1f4;return function(_0xa7eb5f){logger[_0x91eb('0x1d')](_0xa7eb5f[_0x91eb('0x31')]);if(_0xa7eb5f['name']){delete _0xa7eb5f[_0x91eb('0x32')];}_0x332f72[_0x91eb('0x25')](_0x4a987b)[_0x91eb('0x33')](_0xa7eb5f);};}exports[_0x91eb('0x34')]=function(_0x4b3499,_0x3634bc){var _0x3f5fc4={},_0x44c24b={},_0x686071={'count':0x0,'rows':[]};var _0x2ff9f6=_['map'](db[_0x91eb('0x35')][_0x91eb('0x36')],function(_0x5c47c8){return{'name':_0x5c47c8[_0x91eb('0x37')],'type':_0x5c47c8[_0x91eb('0x38')][_0x91eb('0x39')]};});_0x44c24b['model']=_[_0x91eb('0x3a')](_0x2ff9f6,_0x91eb('0x32'));_0x44c24b[_0x91eb('0x3b')]=_[_0x91eb('0x3c')](_0x4b3499['query']);_0x44c24b[_0x91eb('0x3d')]=_[_0x91eb('0x3e')](_0x44c24b['model'],_0x44c24b[_0x91eb('0x3b')]);_0x3f5fc4[_0x91eb('0x3f')]=_[_0x91eb('0x3e')](_0x44c24b[_0x91eb('0x40')],qs[_0x91eb('0x41')](_0x4b3499['query'][_0x91eb('0x41')]));_0x3f5fc4[_0x91eb('0x3f')]=_0x3f5fc4[_0x91eb('0x3f')][_0x91eb('0x42')]?_0x3f5fc4[_0x91eb('0x3f')]:_0x44c24b[_0x91eb('0x40')];if(!_0x4b3499[_0x91eb('0x3b')][_0x91eb('0x43')](_0x91eb('0x44'))){_0x3f5fc4[_0x91eb('0x45')]=qs[_0x91eb('0x45')](_0x4b3499['query'][_0x91eb('0x45')]);_0x3f5fc4['offset']=qs[_0x91eb('0x29')](_0x4b3499[_0x91eb('0x3b')]['offset']);}_0x3f5fc4[_0x91eb('0x46')]=qs[_0x91eb('0x47')](_0x4b3499[_0x91eb('0x3b')]['sort']);_0x3f5fc4[_0x91eb('0x48')]=qs[_0x91eb('0x3d')](_[_0x91eb('0x49')](_0x4b3499['query'],_0x44c24b[_0x91eb('0x3d')]),_0x2ff9f6);if(_0x4b3499[_0x91eb('0x3b')][_0x91eb('0x4a')]){_0x3f5fc4['where']=_[_0x91eb('0x4b')](_0x3f5fc4[_0x91eb('0x48')],{'$or':_[_0x91eb('0x3a')](_0x2ff9f6,function(_0x1c2ae1){if(_0x1c2ae1[_0x91eb('0x38')]!==_0x91eb('0x4c')){var _0x57eab8={};_0x57eab8[_0x1c2ae1[_0x91eb('0x32')]]={'$like':'%'+_0x4b3499['query']['filter']+'%'};return _0x57eab8;}})});}_0x3f5fc4=_[_0x91eb('0x4b')]({},_0x3f5fc4,_0x4b3499[_0x91eb('0x4d')]);var _0x1566b2={'where':_0x3f5fc4[_0x91eb('0x48')]};return db['VoiceContext'][_0x91eb('0x2a')](_0x1566b2)[_0x91eb('0x19')](function(_0x536394){_0x686071['count']=_0x536394;if(_0x4b3499[_0x91eb('0x3b')][_0x91eb('0x4e')]){_0x3f5fc4[_0x91eb('0x4f')]=[{'all':!![]}];}return db[_0x91eb('0x35')][_0x91eb('0x50')](_0x3f5fc4);})[_0x91eb('0x19')](function(_0x159cbc){_0x686071[_0x91eb('0x51')]=_0x159cbc;return _0x686071;})[_0x91eb('0x19')](respondWithFilteredResult(_0x3634bc,_0x3f5fc4))['catch'](handleError(_0x3634bc,null));};exports[_0x91eb('0x52')]=function(_0x20c405,_0x3bf9f6){var _0x392a90={'raw':![],'where':{'id':_0x20c405[_0x91eb('0x53')]['id']}},_0x577176={};_0x577176[_0x91eb('0x40')]=_[_0x91eb('0x3c')](db[_0x91eb('0x35')][_0x91eb('0x36')]);_0x577176[_0x91eb('0x3b')]=_['keys'](_0x20c405[_0x91eb('0x3b')]);_0x577176['filters']=_['intersection'](_0x577176['model'],_0x577176[_0x91eb('0x3b')]);_0x392a90[_0x91eb('0x3f')]=_[_0x91eb('0x3e')](_0x577176[_0x91eb('0x40')],qs[_0x91eb('0x41')](_0x20c405[_0x91eb('0x3b')][_0x91eb('0x41')]));_0x392a90[_0x91eb('0x3f')]=_0x392a90[_0x91eb('0x3f')]['length']?_0x392a90['attributes']:_0x577176['model'];if(_0x20c405['query'][_0x91eb('0x4e')]){_0x392a90[_0x91eb('0x4f')]=[{'all':!![]}];}_0x392a90=_['merge']({},_0x392a90,_0x20c405[_0x91eb('0x4d')]);return db['VoiceContext'][_0x91eb('0x54')](_0x392a90)['then'](handleEntityNotFound(_0x3bf9f6,null))[_0x91eb('0x19')](respondWithResult(_0x3bf9f6,null))[_0x91eb('0x23')](handleError(_0x3bf9f6,null));};exports[_0x91eb('0x55')]=function(_0x34da38,_0x446317,_0x2735a3){var _0x34b606;return db[_0x91eb('0x35')][_0x91eb('0x55')](_0x34da38[_0x91eb('0x56')],{'raw':!![]})['then'](function(_0x2ae528){_0x34b606=_0x2ae528;return db[_0x91eb('0x35')][_0x91eb('0x50')]({'raw':!![]});})[_0x91eb('0x19')](function(_0x1b22ae){var _0x3e540d=fs[_0x91eb('0x57')](path[_0x91eb('0x58')](config[_0x91eb('0x59')],'server/files/templates/context.ejs'),_0x91eb('0x5a'));var _0x45279f=ejs[_0x91eb('0x5b')](_0x3e540d,{'contexts':_0x1b22ae||[]});fs[_0x91eb('0x5c')]('/etc/asterisk/extensions_xcally_contexts.conf',_0x45279f);})[_0x91eb('0x19')](function(){return respondWithRpcPromise(_0x91eb('0x5d'),_0x91eb('0x55'),{'module':_0x91eb('0x5e')});})[_0x91eb('0x19')](function(){var _0x41388f=_0x34da38[_0x91eb('0x5f')][_0x91eb('0x2f')]({'plain':!![]});if(!_0x41388f)throw new Error(_0x91eb('0x60'));if(_0x41388f[_0x91eb('0x61')]===_0x91eb('0x5f')){var _0x15a480=_0x34b606['get']({'plain':!![]});return db[_0x91eb('0x62')][_0x91eb('0x54')]({'where':{'name':_0x91eb('0x30'),'userProfileId':_0x41388f[_0x91eb('0x63')]},'raw':!![]})[_0x91eb('0x19')](function(_0x5875c2){if(_0x5875c2&&_0x5875c2[_0x91eb('0x64')]===0x0){return db[_0x91eb('0x65')][_0x91eb('0x55')]({'name':_0x15a480['name'],'resourceId':_0x15a480['id'],'type':_0x5875c2['name'],'sectionId':_0x5875c2['id']},{})['then'](function(){return _0x34b606;});}else{return _0x34b606;}})['catch'](function(_0x315c9d){logger[_0x91eb('0x1d')](_0x91eb('0x66'),_0x315c9d);throw _0x315c9d;});}return _0x34b606;})[_0x91eb('0x19')](respondWithResult(_0x446317,0xc9))['catch'](handleError(_0x446317,null));};exports[_0x91eb('0x2d')]=function(_0x1f7d5c,_0x1191e7,_0x19e030){var _0x113dca;return db[_0x91eb('0x35')][_0x91eb('0x54')]({'where':{'id':_0x1f7d5c[_0x91eb('0x53')]['id']}})[_0x91eb('0x19')](handleEntityNotFound(_0x1191e7,null))[_0x91eb('0x19')](saveUpdates(_0x1f7d5c[_0x91eb('0x56')],null))[_0x91eb('0x19')](function(_0x3be0f5){if(_0x3be0f5){_0x113dca=_0x3be0f5;return db[_0x91eb('0x35')][_0x91eb('0x50')]({'raw':!![]});}})[_0x91eb('0x19')](function(_0x8268d1){var _0x4c02a3=fs[_0x91eb('0x57')](path[_0x91eb('0x58')](config['root'],'server/files/templates/context.ejs'),_0x91eb('0x5a'));var _0x50e167=ejs['render'](_0x4c02a3,{'contexts':_0x8268d1||[]});fs[_0x91eb('0x5c')](_0x91eb('0x67'),_0x50e167);})[_0x91eb('0x19')](function(){return respondWithRpcPromise(_0x91eb('0x5d'),_0x91eb('0x2d'),{'module':'chan_sip.so'});})[_0x91eb('0x19')](function(){return _0x113dca;})[_0x91eb('0x19')](respondWithResult(_0x1191e7,null))[_0x91eb('0x23')](handleError(_0x1191e7,null));};exports[_0x91eb('0x2e')]=function(_0x1f7fdd,_0x13e203,_0xc1a78f){var _0x4f96c0;return db['VoiceContext']['find']({'where':{'id':_0x1f7fdd[_0x91eb('0x53')]['id']}})['then'](handleEntityNotFound(_0x13e203,null))[_0x91eb('0x19')](removeEntity(_0x13e203,null))[_0x91eb('0x19')](function(){return db[_0x91eb('0x35')][_0x91eb('0x50')]({'raw':!![]});})[_0x91eb('0x19')](function(_0x343919){var _0x1cfe69=fs['readFileSync'](path[_0x91eb('0x58')](config[_0x91eb('0x59')],'server/files/templates/context.ejs'),'utf8');var _0x467652=ejs['render'](_0x1cfe69,{'contexts':_0x343919});fs[_0x91eb('0x5c')]('/etc/asterisk/extensions_xcally_contexts.conf',_0x467652);return respondWithRpcPromise(_0x91eb('0x5d'),_0x91eb('0x2e'),{'module':'chan_sip.so'});})[_0x91eb('0x23')](handleError(_0x13e203,null));}; \ No newline at end of file +var _0xcae2=['request-promise','moment','bluebird','mustache','path','ejs','fs-extra','lodash','crypto','desk.js','to-csv','querystring','papaparse','ioredis','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','jayson/promise','request','then','info','VoiceContext,\x20%s,\x20%s','request\x20sent','debug','error','code','message','result','catch','sendStatus','end','status','json','offset','limit','undefined','count','set','Content-Range','save','destroy','get','Contexts','UserProfileResource','stack','index','map','VoiceContext','fieldName','type','key','name','query','keys','filters','attributes','model','fields','length','hasOwnProperty','nolimit','sort','where','pick','filter','VIRTUAL','options','includeAll','include','findAll','rows','params','rawAttributes','intersection','find','create','readFileSync','join','root','server/files/templates/context.ejs','utf8','writeFileSync','chan_sip.so','user','UserProfileSection','userProfileId','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','/etc/asterisk/extensions_xcally_contexts.conf','Reload','update','render','eml-format','rimraf'];(function(_0x5037ab,_0x43209e){var _0x512adb=function(_0x261783){while(--_0x261783){_0x5037ab['push'](_0x5037ab['shift']());}};_0x512adb(++_0x43209e);}(_0xcae2,0x124));var _0x2cae=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0xcae2[_0x321bb2];return _0x9c12ed;};'use strict';var emlformat=require(_0x2cae('0x0'));var rimraf=require(_0x2cae('0x1'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x2cae('0x2'));var moment=require(_0x2cae('0x3'));var BPromise=require(_0x2cae('0x4'));var Mustache=require(_0x2cae('0x5'));var util=require('util');var path=require(_0x2cae('0x6'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0x2cae('0x7'));var fs=require('fs');var fs_extra=require(_0x2cae('0x8'));var _=require(_0x2cae('0x9'));var squel=require('squel');var crypto=require(_0x2cae('0xa'));var jsforce=require('jsforce');var deskjs=require(_0x2cae('0xb'));var toCsv=require(_0x2cae('0xc'));var querystring=require(_0x2cae('0xd'));var Papa=require(_0x2cae('0xe'));var Redis=require(_0x2cae('0xf'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0x2cae('0x10'));var hardwareService=require(_0x2cae('0x11'));var logger=require('../../config/logger')(_0x2cae('0x12'));var utils=require(_0x2cae('0x13'));var config=require(_0x2cae('0x14'));var licenseUtil=require(_0x2cae('0x15'));var db=require(_0x2cae('0x16'))['db'];var jayson=require(_0x2cae('0x17'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x1a5a33,_0x1f94ce,_0x244345,_0x230507){return new BPromise(function(_0x287fde,_0x36d747){var _0x45f3c3=_0x230507||client;return _0x45f3c3[_0x2cae('0x18')](_0x1a5a33,_0x244345)[_0x2cae('0x19')](function(_0x337c24){logger[_0x2cae('0x1a')](_0x2cae('0x1b'),_0x1f94ce,_0x2cae('0x1c'));logger[_0x2cae('0x1d')]('VoiceContext,\x20%s,\x20%s,\x20%s',_0x1f94ce,_0x2cae('0x1c'),JSON['stringify'](_0x337c24));if(_0x337c24['error']){if(_0x337c24[_0x2cae('0x1e')][_0x2cae('0x1f')]===0x1f4){logger[_0x2cae('0x1e')](_0x2cae('0x1b'),_0x1f94ce,_0x337c24[_0x2cae('0x1e')][_0x2cae('0x20')]);return _0x36d747(_0x337c24[_0x2cae('0x1e')]['message']);}logger[_0x2cae('0x1e')](_0x2cae('0x1b'),_0x1f94ce,_0x337c24[_0x2cae('0x1e')]['message']);return _0x287fde(_0x337c24[_0x2cae('0x1e')]['message']);}else{logger[_0x2cae('0x1a')](_0x2cae('0x1b'),_0x1f94ce,_0x2cae('0x1c'));_0x287fde(_0x337c24[_0x2cae('0x21')][_0x2cae('0x20')]);}})[_0x2cae('0x22')](function(_0x35cf77){logger[_0x2cae('0x1e')]('VoiceContext,\x20%s,\x20%s',_0x1f94ce,_0x35cf77);_0x36d747(_0x35cf77);});});}function respondWithStatusCode(_0x580c07,_0x4c0cbe){_0x4c0cbe=_0x4c0cbe||0xcc;return function(_0x3220de){if(_0x3220de){return _0x580c07[_0x2cae('0x23')](_0x4c0cbe);}return _0x580c07['status'](_0x4c0cbe)[_0x2cae('0x24')]();};}function respondWithResult(_0x78efe7,_0x2ce088){_0x2ce088=_0x2ce088||0xc8;return function(_0xfc3a5e){if(_0xfc3a5e){return _0x78efe7[_0x2cae('0x25')](_0x2ce088)[_0x2cae('0x26')](_0xfc3a5e);}};}function respondWithFilteredResult(_0x1cc157,_0x49d6bb){return function(_0x2f488a){if(_0x2f488a){var _0x57232a=typeof _0x49d6bb[_0x2cae('0x27')]==='undefined'&&typeof _0x49d6bb[_0x2cae('0x28')]===_0x2cae('0x29');var _0x1e8f04=_0x2f488a[_0x2cae('0x2a')];var _0x4e1bf0=_0x57232a?0x0:_0x49d6bb[_0x2cae('0x27')];var _0x2075ca=_0x57232a?_0x2f488a[_0x2cae('0x2a')]:_0x49d6bb[_0x2cae('0x27')]+_0x49d6bb[_0x2cae('0x28')];var _0x450340;if(_0x2075ca>=_0x1e8f04){_0x2075ca=_0x1e8f04;_0x450340=0xc8;}else{_0x450340=0xce;}_0x1cc157[_0x2cae('0x25')](_0x450340);return _0x1cc157[_0x2cae('0x2b')](_0x2cae('0x2c'),_0x4e1bf0+'-'+_0x2075ca+'/'+_0x1e8f04)[_0x2cae('0x26')](_0x2f488a);}return null;};}function patchUpdates(_0x598e34){return function(_0x3de36b){try{jsonpatch['apply'](_0x3de36b,_0x598e34,!![]);}catch(_0x309a83){return BPromise['reject'](_0x309a83);}return _0x3de36b[_0x2cae('0x2d')]();};}function saveUpdates(_0x98ba25,_0x161a6d){return function(_0x197971){if(_0x197971){return _0x197971['update'](_0x98ba25)[_0x2cae('0x19')](function(_0x958b52){return _0x958b52;});}return null;};}function removeEntity(_0x2d513c,_0x201434){return function(_0x277fd7){if(_0x277fd7){return _0x277fd7[_0x2cae('0x2e')]()[_0x2cae('0x19')](function(){var _0x1fbe6b=_0x277fd7[_0x2cae('0x2f')]({'plain':!![]});var _0xbdd457=_0x2cae('0x30');return db[_0x2cae('0x31')][_0x2cae('0x2e')]({'where':{'type':_0xbdd457,'resourceId':_0x1fbe6b['id']}})['then'](function(){return _0x277fd7;});})[_0x2cae('0x19')](function(){_0x2d513c[_0x2cae('0x25')](0xcc)[_0x2cae('0x24')]();});}};}function handleEntityNotFound(_0x2760eb,_0x14862b){return function(_0x5d3408){if(!_0x5d3408){_0x2760eb[_0x2cae('0x23')](0x194);}return _0x5d3408;};}function handleError(_0x213e71,_0x54775b){_0x54775b=_0x54775b||0x1f4;return function(_0x47021a){logger[_0x2cae('0x1e')](_0x47021a[_0x2cae('0x32')]);if(_0x47021a['name']){delete _0x47021a['name'];}_0x213e71[_0x2cae('0x25')](_0x54775b)['send'](_0x47021a);};}exports[_0x2cae('0x33')]=function(_0x41807b,_0xa2a474){var _0x588d17={},_0x4822b2={},_0x34f3a6={'count':0x0,'rows':[]};var _0x2295e9=_[_0x2cae('0x34')](db[_0x2cae('0x35')]['rawAttributes'],function(_0x15e379){return{'name':_0x15e379[_0x2cae('0x36')],'type':_0x15e379[_0x2cae('0x37')][_0x2cae('0x38')]};});_0x4822b2['model']=_[_0x2cae('0x34')](_0x2295e9,_0x2cae('0x39'));_0x4822b2[_0x2cae('0x3a')]=_[_0x2cae('0x3b')](_0x41807b[_0x2cae('0x3a')]);_0x4822b2[_0x2cae('0x3c')]=_['intersection'](_0x4822b2['model'],_0x4822b2[_0x2cae('0x3a')]);_0x588d17[_0x2cae('0x3d')]=_['intersection'](_0x4822b2[_0x2cae('0x3e')],qs['fields'](_0x41807b[_0x2cae('0x3a')][_0x2cae('0x3f')]));_0x588d17[_0x2cae('0x3d')]=_0x588d17['attributes'][_0x2cae('0x40')]?_0x588d17[_0x2cae('0x3d')]:_0x4822b2[_0x2cae('0x3e')];if(!_0x41807b['query'][_0x2cae('0x41')](_0x2cae('0x42'))){_0x588d17[_0x2cae('0x28')]=qs['limit'](_0x41807b[_0x2cae('0x3a')][_0x2cae('0x28')]);_0x588d17[_0x2cae('0x27')]=qs[_0x2cae('0x27')](_0x41807b[_0x2cae('0x3a')][_0x2cae('0x27')]);}_0x588d17['order']=qs[_0x2cae('0x43')](_0x41807b[_0x2cae('0x3a')][_0x2cae('0x43')]);_0x588d17[_0x2cae('0x44')]=qs[_0x2cae('0x3c')](_[_0x2cae('0x45')](_0x41807b[_0x2cae('0x3a')],_0x4822b2['filters']),_0x2295e9);if(_0x41807b[_0x2cae('0x3a')][_0x2cae('0x46')]){_0x588d17['where']=_['merge'](_0x588d17[_0x2cae('0x44')],{'$or':_[_0x2cae('0x34')](_0x2295e9,function(_0x4d2644){if(_0x4d2644['type']!==_0x2cae('0x47')){var _0x19256d={};_0x19256d[_0x4d2644[_0x2cae('0x39')]]={'$like':'%'+_0x41807b[_0x2cae('0x3a')][_0x2cae('0x46')]+'%'};return _0x19256d;}})});}_0x588d17=_['merge']({},_0x588d17,_0x41807b[_0x2cae('0x48')]);var _0x474fc2={'where':_0x588d17[_0x2cae('0x44')]};return db['VoiceContext'][_0x2cae('0x2a')](_0x474fc2)[_0x2cae('0x19')](function(_0x1d92e0){_0x34f3a6[_0x2cae('0x2a')]=_0x1d92e0;if(_0x41807b['query'][_0x2cae('0x49')]){_0x588d17[_0x2cae('0x4a')]=[{'all':!![]}];}return db[_0x2cae('0x35')][_0x2cae('0x4b')](_0x588d17);})[_0x2cae('0x19')](function(_0x1158ed){_0x34f3a6[_0x2cae('0x4c')]=_0x1158ed;return _0x34f3a6;})[_0x2cae('0x19')](respondWithFilteredResult(_0xa2a474,_0x588d17))[_0x2cae('0x22')](handleError(_0xa2a474,null));};exports['show']=function(_0x14fe07,_0x45ea87){var _0x1589ab={'raw':![],'where':{'id':_0x14fe07[_0x2cae('0x4d')]['id']}},_0x15284b={};_0x15284b[_0x2cae('0x3e')]=_['keys'](db['VoiceContext'][_0x2cae('0x4e')]);_0x15284b[_0x2cae('0x3a')]=_[_0x2cae('0x3b')](_0x14fe07[_0x2cae('0x3a')]);_0x15284b[_0x2cae('0x3c')]=_[_0x2cae('0x4f')](_0x15284b[_0x2cae('0x3e')],_0x15284b[_0x2cae('0x3a')]);_0x1589ab[_0x2cae('0x3d')]=_[_0x2cae('0x4f')](_0x15284b[_0x2cae('0x3e')],qs[_0x2cae('0x3f')](_0x14fe07[_0x2cae('0x3a')][_0x2cae('0x3f')]));_0x1589ab['attributes']=_0x1589ab[_0x2cae('0x3d')]['length']?_0x1589ab[_0x2cae('0x3d')]:_0x15284b[_0x2cae('0x3e')];if(_0x14fe07[_0x2cae('0x3a')][_0x2cae('0x49')]){_0x1589ab[_0x2cae('0x4a')]=[{'all':!![]}];}_0x1589ab=_['merge']({},_0x1589ab,_0x14fe07['options']);return db[_0x2cae('0x35')][_0x2cae('0x50')](_0x1589ab)[_0x2cae('0x19')](handleEntityNotFound(_0x45ea87,null))[_0x2cae('0x19')](respondWithResult(_0x45ea87,null))[_0x2cae('0x22')](handleError(_0x45ea87,null));};exports[_0x2cae('0x51')]=function(_0x3b6361,_0x4b9184,_0x46b327){var _0x4120a6;return db[_0x2cae('0x35')][_0x2cae('0x51')](_0x3b6361['body'],{'raw':!![]})['then'](function(_0x900e69){_0x4120a6=_0x900e69;return db[_0x2cae('0x35')][_0x2cae('0x4b')]({'raw':!![]});})[_0x2cae('0x19')](function(_0x271f21){var _0x2b0d01=fs[_0x2cae('0x52')](path[_0x2cae('0x53')](config[_0x2cae('0x54')],_0x2cae('0x55')),_0x2cae('0x56'));var _0x24c841=ejs['render'](_0x2b0d01,{'contexts':_0x271f21||[]});fs[_0x2cae('0x57')]('/etc/asterisk/extensions_xcally_contexts.conf',_0x24c841);})[_0x2cae('0x19')](function(){return respondWithRpcPromise('Reload','create',{'module':_0x2cae('0x58')});})['then'](function(){var _0x1751e4=_0x3b6361[_0x2cae('0x59')]['get']({'plain':!![]});if(!_0x1751e4)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x1751e4['role']==='user'){var _0x3c2e44=_0x4120a6[_0x2cae('0x2f')]({'plain':!![]});return db[_0x2cae('0x5a')][_0x2cae('0x50')]({'where':{'name':'Contexts','userProfileId':_0x1751e4[_0x2cae('0x5b')]},'raw':!![]})['then'](function(_0x120ec5){if(_0x120ec5&&_0x120ec5['autoAssociation']===0x0){return db[_0x2cae('0x31')]['create']({'name':_0x3c2e44[_0x2cae('0x39')],'resourceId':_0x3c2e44['id'],'type':_0x120ec5[_0x2cae('0x39')],'sectionId':_0x120ec5['id']},{})[_0x2cae('0x19')](function(){return _0x4120a6;});}else{return _0x4120a6;}})[_0x2cae('0x22')](function(_0x4f1596){logger['error'](_0x2cae('0x5c'),_0x4f1596);throw _0x4f1596;});}return _0x4120a6;})[_0x2cae('0x19')](respondWithResult(_0x4b9184,0xc9))[_0x2cae('0x22')](handleError(_0x4b9184,null));};exports['update']=function(_0x171018,_0x2d658b,_0x284913){var _0x42a2ba;return db[_0x2cae('0x35')][_0x2cae('0x50')]({'where':{'id':_0x171018[_0x2cae('0x4d')]['id']}})[_0x2cae('0x19')](handleEntityNotFound(_0x2d658b,null))[_0x2cae('0x19')](saveUpdates(_0x171018[_0x2cae('0x5d')],null))[_0x2cae('0x19')](function(_0x103208){if(_0x103208){_0x42a2ba=_0x103208;return db[_0x2cae('0x35')][_0x2cae('0x4b')]({'raw':!![]});}})[_0x2cae('0x19')](function(_0x423336){var _0x1fe2f1=fs['readFileSync'](path['join'](config['root'],_0x2cae('0x55')),_0x2cae('0x56'));var _0x249053=ejs['render'](_0x1fe2f1,{'contexts':_0x423336||[]});fs[_0x2cae('0x57')](_0x2cae('0x5e'),_0x249053);})[_0x2cae('0x19')](function(){return respondWithRpcPromise(_0x2cae('0x5f'),_0x2cae('0x60'),{'module':_0x2cae('0x58')});})[_0x2cae('0x19')](function(){return _0x42a2ba;})[_0x2cae('0x19')](respondWithResult(_0x2d658b,null))[_0x2cae('0x22')](handleError(_0x2d658b,null));};exports['destroy']=function(_0x109212,_0x5c0e13,_0x3a5d84){var _0x5489ab;return db[_0x2cae('0x35')][_0x2cae('0x50')]({'where':{'id':_0x109212[_0x2cae('0x4d')]['id']}})[_0x2cae('0x19')](handleEntityNotFound(_0x5c0e13,null))[_0x2cae('0x19')](removeEntity(_0x5c0e13,null))['then'](function(){return db[_0x2cae('0x35')]['findAll']({'raw':!![]});})[_0x2cae('0x19')](function(_0x1db3b8){var _0x2255be=fs['readFileSync'](path['join'](config['root'],_0x2cae('0x55')),_0x2cae('0x56'));var _0x14b19d=ejs[_0x2cae('0x61')](_0x2255be,{'contexts':_0x1db3b8});fs[_0x2cae('0x57')]('/etc/asterisk/extensions_xcally_contexts.conf',_0x14b19d);return respondWithRpcPromise(_0x2cae('0x5f'),_0x2cae('0x2e'),{'module':_0x2cae('0x58')});})['catch'](handleError(_0x5c0e13,null));}; \ No newline at end of file diff --git a/server/api/voiceContext/voiceContext.model.js b/server/api/voiceContext/voiceContext.model.js index 68adbaf..085edec 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 _0xc3b7=['rimraf','../../config/environment','define','VoiceContext','util','../../config/logger','api','moment','bluebird','request-promise','path'];(function(_0x20d333,_0x5a5b00){var _0x4b80f7=function(_0x24cedd){while(--_0x24cedd){_0x20d333['push'](_0x20d333['shift']());}};_0x4b80f7(++_0x5a5b00);}(_0xc3b7,0xb4));var _0x7c3b=function(_0x311c5b,_0x4a2b50){_0x311c5b=_0x311c5b-0x0;var _0x44f0f5=_0xc3b7[_0x311c5b];return _0x44f0f5;};'use strict';var _=require('lodash');var util=require(_0x7c3b('0x0'));var logger=require(_0x7c3b('0x1'))(_0x7c3b('0x2'));var moment=require(_0x7c3b('0x3'));var BPromise=require(_0x7c3b('0x4'));var rp=require(_0x7c3b('0x5'));var fs=require('fs');var path=require(_0x7c3b('0x6'));var rimraf=require(_0x7c3b('0x7'));var config=require(_0x7c3b('0x8'));var attributes=require('./voiceContext.attributes');module['exports']=function(_0x20fa26,_0x40ef6a){return _0x20fa26[_0x7c3b('0x9')](_0x7c3b('0xa'),attributes,{'tableName':'voice_contexts','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x7cc5=['define','VoiceContext','voice_contexts','lodash','util','../../config/logger','api','bluebird','request-promise','rimraf','../../config/environment','./voiceContext.attributes','exports'];(function(_0x1f6e71,_0x19360b){var _0x2271aa=function(_0x2f0431){while(--_0x2f0431){_0x1f6e71['push'](_0x1f6e71['shift']());}};_0x2271aa(++_0x19360b);}(_0x7cc5,0xc6));var _0x57cc=function(_0x1b0a89,_0x5f4f8f){_0x1b0a89=_0x1b0a89-0x0;var _0x3800f0=_0x7cc5[_0x1b0a89];return _0x3800f0;};'use strict';var _=require(_0x57cc('0x0'));var util=require(_0x57cc('0x1'));var logger=require(_0x57cc('0x2'))(_0x57cc('0x3'));var moment=require('moment');var BPromise=require(_0x57cc('0x4'));var rp=require(_0x57cc('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x57cc('0x6'));var config=require(_0x57cc('0x7'));var attributes=require(_0x57cc('0x8'));module[_0x57cc('0x9')]=function(_0x56dd3c,_0x4fd9b1){return _0x56dd3c[_0x57cc('0xa')](_0x57cc('0xb'),attributes,{'tableName':_0x57cc('0xc'),'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 723bfca..98e43a2 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 _0xfbb2=['jayson/promise','http','request','then','VoiceContext,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','VoiceContext,\x20%s,\x20%s','message','info','result','catch','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment'];(function(_0x757d8e,_0x3d3e28){var _0x78a473=function(_0x3ad510){while(--_0x3ad510){_0x757d8e['push'](_0x757d8e['shift']());}};_0x78a473(++_0x3d3e28);}(_0xfbb2,0xae));var _0x2fbb=function(_0x560b56,_0x2004b9){_0x560b56=_0x560b56-0x0;var _0x173c4e=_0xfbb2[_0x560b56];return _0x173c4e;};'use strict';var _=require(_0x2fbb('0x0'));var util=require(_0x2fbb('0x1'));var moment=require(_0x2fbb('0x2'));var BPromise=require(_0x2fbb('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x2fbb('0x4'));var db=require(_0x2fbb('0x5'))['db'];var utils=require(_0x2fbb('0x6'));var logger=require(_0x2fbb('0x7'))(_0x2fbb('0x8'));var config=require(_0x2fbb('0x9'));var jayson=require(_0x2fbb('0xa'));var client=jayson['client'][_0x2fbb('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x170c70,_0x27a40d,_0x5db376){return new BPromise(function(_0x4220be,_0x2b8842){return client[_0x2fbb('0xc')](_0x170c70,_0x5db376)[_0x2fbb('0xd')](function(_0x2e4a06){logger['info']('VoiceContext,\x20%s,\x20%s',_0x27a40d,'request\x20sent');logger['debug'](_0x2fbb('0xe'),_0x27a40d,_0x2fbb('0xf'),JSON[_0x2fbb('0x10')](_0x2e4a06));if(_0x2e4a06['error']){if(_0x2e4a06[_0x2fbb('0x11')]['code']===0x1f4){logger[_0x2fbb('0x11')](_0x2fbb('0x12'),_0x27a40d,_0x2e4a06[_0x2fbb('0x11')][_0x2fbb('0x13')]);return _0x2b8842(_0x2e4a06[_0x2fbb('0x11')]['message']);}logger[_0x2fbb('0x11')](_0x2fbb('0x12'),_0x27a40d,_0x2e4a06['error'][_0x2fbb('0x13')]);return _0x4220be(_0x2e4a06['error'][_0x2fbb('0x13')]);}else{logger[_0x2fbb('0x14')](_0x2fbb('0x12'),_0x27a40d,'request\x20sent');_0x4220be(_0x2e4a06[_0x2fbb('0x15')][_0x2fbb('0x13')]);}})[_0x2fbb('0x16')](function(_0x3ea671){logger[_0x2fbb('0x11')](_0x2fbb('0x12'),_0x27a40d,_0x3ea671);_0x2b8842(_0x3ea671);});});} \ No newline at end of file +var _0x160b=['code','message','info','result','catch','lodash','util','moment','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','VoiceContext,\x20%s,\x20%s','request\x20sent','debug','VoiceContext,\x20%s,\x20%s,\x20%s','stringify','error'];(function(_0x4c2c23,_0x3d8d28){var _0x5c992e=function(_0x5cfed7){while(--_0x5cfed7){_0x4c2c23['push'](_0x4c2c23['shift']());}};_0x5c992e(++_0x3d8d28);}(_0x160b,0xff));var _0xb160=function(_0x40faed,_0x219591){_0x40faed=_0x40faed-0x0;var _0x4a45ff=_0x160b[_0x40faed];return _0x4a45ff;};'use strict';var _=require(_0xb160('0x0'));var util=require(_0xb160('0x1'));var moment=require(_0xb160('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xb160('0x3'));var db=require(_0xb160('0x4'))['db'];var utils=require(_0xb160('0x5'));var logger=require(_0xb160('0x6'))(_0xb160('0x7'));var config=require(_0xb160('0x8'));var jayson=require(_0xb160('0x9'));var client=jayson[_0xb160('0xa')][_0xb160('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x17d37e,_0x291913,_0x4aa32a){return new BPromise(function(_0x121151,_0x13e33b){return client[_0xb160('0xc')](_0x17d37e,_0x4aa32a)[_0xb160('0xd')](function(_0x2e79c3){logger['info'](_0xb160('0xe'),_0x291913,_0xb160('0xf'));logger[_0xb160('0x10')](_0xb160('0x11'),_0x291913,_0xb160('0xf'),JSON[_0xb160('0x12')](_0x2e79c3));if(_0x2e79c3[_0xb160('0x13')]){if(_0x2e79c3[_0xb160('0x13')][_0xb160('0x14')]===0x1f4){logger[_0xb160('0x13')](_0xb160('0xe'),_0x291913,_0x2e79c3['error']['message']);return _0x13e33b(_0x2e79c3[_0xb160('0x13')][_0xb160('0x15')]);}logger[_0xb160('0x13')](_0xb160('0xe'),_0x291913,_0x2e79c3[_0xb160('0x13')][_0xb160('0x15')]);return _0x121151(_0x2e79c3[_0xb160('0x13')][_0xb160('0x15')]);}else{logger[_0xb160('0x16')](_0xb160('0xe'),_0x291913,_0xb160('0xf'));_0x121151(_0x2e79c3[_0xb160('0x17')][_0xb160('0x15')]);}})[_0xb160('0x18')](function(_0x451690){logger[_0xb160('0x13')](_0xb160('0xe'),_0x291913,_0x451690);_0x13e33b(_0x451690);});});} \ No newline at end of file diff --git a/server/api/voiceDialReport/index.js b/server/api/voiceDialReport/index.js index 6c77386..707e787 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 _0xd450=['../../config/environment','get','isAuthenticated','index','/describe','describe','/:id','show','post','put','update','delete','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xd450,0x157));var _0x0d45=function(_0x1af067,_0x518a65){_0x1af067=_0x1af067-0x0;var _0x5379a2=_0xd450[_0x1af067];return _0x5379a2;};'use strict';var multer=require(_0x0d45('0x0'));var util=require(_0x0d45('0x1'));var path=require(_0x0d45('0x2'));var timeout=require(_0x0d45('0x3'));var express=require(_0x0d45('0x4'));var router=express[_0x0d45('0x5')]();var fs_extra=require(_0x0d45('0x6'));var auth=require(_0x0d45('0x7'));var interaction=require(_0x0d45('0x8'));var config=require(_0x0d45('0x9'));var controller=require('./voiceDialReport.controller');router[_0x0d45('0xa')]('/',auth[_0x0d45('0xb')](),controller[_0x0d45('0xc')]);router[_0x0d45('0xa')](_0x0d45('0xd'),auth['isAuthenticated'](),controller[_0x0d45('0xe')]);router['get'](_0x0d45('0xf'),auth[_0x0d45('0xb')](),controller[_0x0d45('0x10')]);router[_0x0d45('0x11')]('/',auth[_0x0d45('0xb')](),controller['create']);router[_0x0d45('0x12')]('/:id',auth['isAuthenticated'](),controller[_0x0d45('0x13')]);router[_0x0d45('0x14')](_0x0d45('0xf'),auth[_0x0d45('0xb')](),controller['destroy']);module[_0x0d45('0x15')]=router; \ No newline at end of file +var _0xfaca=['/describe','/:id','show','create','update','delete','multer','util','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','isAuthenticated','index','get'];(function(_0x4d7a61,_0x3fb6e6){var _0x186f73=function(_0x4eeeeb){while(--_0x4eeeeb){_0x4d7a61['push'](_0x4d7a61['shift']());}};_0x186f73(++_0x3fb6e6);}(_0xfaca,0x114));var _0xafac=function(_0x4ed5d7,_0x1a61a8){_0x4ed5d7=_0x4ed5d7-0x0;var _0x9a927c=_0xfaca[_0x4ed5d7];return _0x9a927c;};'use strict';var multer=require(_0xafac('0x0'));var util=require(_0xafac('0x1'));var path=require('path');var timeout=require(_0xafac('0x2'));var express=require(_0xafac('0x3'));var router=express[_0xafac('0x4')]();var fs_extra=require(_0xafac('0x5'));var auth=require(_0xafac('0x6'));var interaction=require(_0xafac('0x7'));var config=require(_0xafac('0x8'));var controller=require('./voiceDialReport.controller');router['get']('/',auth[_0xafac('0x9')](),controller[_0xafac('0xa')]);router[_0xafac('0xb')](_0xafac('0xc'),auth[_0xafac('0x9')](),controller['describe']);router[_0xafac('0xb')](_0xafac('0xd'),auth[_0xafac('0x9')](),controller[_0xafac('0xe')]);router['post']('/',auth[_0xafac('0x9')](),controller[_0xafac('0xf')]);router['put']('/:id',auth[_0xafac('0x9')](),controller[_0xafac('0x10')]);router[_0xafac('0x11')](_0xafac('0xd'),auth[_0xafac('0x9')](),controller['destroy']);module['exports']=router; \ No newline at end of file diff --git a/server/api/voiceDialReport/voiceDialReport.attributes.js b/server/api/voiceDialReport/voiceDialReport.attributes.js index 14788a8..a0539ef 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 _0x6f0d=['STRING','INTEGER','DATE','called,connect,complete','exports'];(function(_0x309566,_0x5718f3){var _0x4ad5a8=function(_0x28b074){while(--_0x28b074){_0x309566['push'](_0x309566['shift']());}};_0x4ad5a8(++_0x5718f3);}(_0x6f0d,0x16c));var _0xd6f0=function(_0x2f89c0,_0x5965af){_0x2f89c0=_0x2f89c0-0x0;var _0x4c5cd6=_0x6f0d[_0x2f89c0];return _0x4c5cd6;};'use strict';var Sequelize=require('sequelize');module[_0xd6f0('0x0')]={'privilege':{'type':Sequelize[_0xd6f0('0x1')]},'channel':{'type':Sequelize[_0xd6f0('0x1')]},'channelstate':{'type':Sequelize[_0xd6f0('0x2')]},'channelstatedesc':{'type':Sequelize['STRING']},'calleridnum':{'type':Sequelize[_0xd6f0('0x1')]},'calleridname':{'type':Sequelize[_0xd6f0('0x1')]},'connectedlinenum':{'type':Sequelize[_0xd6f0('0x1')]},'connectedlinename':{'type':Sequelize[_0xd6f0('0x1')]},'language':{'type':Sequelize[_0xd6f0('0x1')]},'accountcode':{'type':Sequelize['STRING']},'context':{'type':Sequelize[_0xd6f0('0x1')]},'exten':{'type':Sequelize['STRING']},'priority':{'type':Sequelize[_0xd6f0('0x2')]},'uniqueid':{'type':Sequelize[_0xd6f0('0x1')]},'linkedid':{'type':Sequelize[_0xd6f0('0x1')]},'destchannel':{'type':Sequelize[_0xd6f0('0x1')]},'destchannelstate':{'type':Sequelize['INTEGER']},'destchannelstatedesc':{'type':Sequelize['STRING']},'destcalleridnum':{'type':Sequelize[_0xd6f0('0x1')]},'destcalleridname':{'type':Sequelize[_0xd6f0('0x1')]},'destconnectedlinenum':{'type':Sequelize[_0xd6f0('0x1')]},'destconnectedlinename':{'type':Sequelize[_0xd6f0('0x1')]},'destlanguage':{'type':Sequelize[_0xd6f0('0x1')]},'destaccountcode':{'type':Sequelize['STRING']},'destcontext':{'type':Sequelize[_0xd6f0('0x1')]},'destexten':{'type':Sequelize[_0xd6f0('0x1')]},'destpriority':{'type':Sequelize[_0xd6f0('0x2')]},'destuniqueid':{'type':Sequelize[_0xd6f0('0x1')]},'destlinkedid':{'type':Sequelize['STRING']},'dialstring':{'type':Sequelize[_0xd6f0('0x1')]},'dialstatus':{'type':Sequelize[_0xd6f0('0x1')]},'starttime':{'type':Sequelize[_0xd6f0('0x3')]},'answertime':{'type':Sequelize[_0xd6f0('0x3')]},'endtime':{'type':Sequelize[_0xd6f0('0x3')]},'lastevent':{'type':Sequelize[_0xd6f0('0x1')],'comment':_0xd6f0('0x4')},'routeId':{'type':Sequelize[_0xd6f0('0x2')]},'duration':{'type':Sequelize[_0xd6f0('0x2')]},'holdtime':{'type':Sequelize['INTEGER']},'billableseconds':{'type':Sequelize[_0xd6f0('0x2')]}}; \ No newline at end of file +var _0xf3cd=['exports','STRING','INTEGER','DATE','sequelize'];(function(_0x408b9b,_0x743ee1){var _0x4011d2=function(_0xcee8ed){while(--_0xcee8ed){_0x408b9b['push'](_0x408b9b['shift']());}};_0x4011d2(++_0x743ee1);}(_0xf3cd,0xfe));var _0xdf3c=function(_0x531e48,_0x4bb96b){_0x531e48=_0x531e48-0x0;var _0x202971=_0xf3cd[_0x531e48];return _0x202971;};'use strict';var Sequelize=require(_0xdf3c('0x0'));module[_0xdf3c('0x1')]={'privilege':{'type':Sequelize[_0xdf3c('0x2')]},'channel':{'type':Sequelize[_0xdf3c('0x2')]},'channelstate':{'type':Sequelize[_0xdf3c('0x3')]},'channelstatedesc':{'type':Sequelize[_0xdf3c('0x2')]},'calleridnum':{'type':Sequelize['STRING']},'calleridname':{'type':Sequelize[_0xdf3c('0x2')]},'connectedlinenum':{'type':Sequelize[_0xdf3c('0x2')]},'connectedlinename':{'type':Sequelize[_0xdf3c('0x2')]},'language':{'type':Sequelize['STRING']},'accountcode':{'type':Sequelize[_0xdf3c('0x2')]},'context':{'type':Sequelize[_0xdf3c('0x2')]},'exten':{'type':Sequelize[_0xdf3c('0x2')]},'priority':{'type':Sequelize[_0xdf3c('0x3')]},'uniqueid':{'type':Sequelize[_0xdf3c('0x2')]},'linkedid':{'type':Sequelize[_0xdf3c('0x2')]},'destchannel':{'type':Sequelize['STRING']},'destchannelstate':{'type':Sequelize[_0xdf3c('0x3')]},'destchannelstatedesc':{'type':Sequelize['STRING']},'destcalleridnum':{'type':Sequelize['STRING']},'destcalleridname':{'type':Sequelize[_0xdf3c('0x2')]},'destconnectedlinenum':{'type':Sequelize[_0xdf3c('0x2')]},'destconnectedlinename':{'type':Sequelize['STRING']},'destlanguage':{'type':Sequelize[_0xdf3c('0x2')]},'destaccountcode':{'type':Sequelize[_0xdf3c('0x2')]},'destcontext':{'type':Sequelize[_0xdf3c('0x2')]},'destexten':{'type':Sequelize[_0xdf3c('0x2')]},'destpriority':{'type':Sequelize[_0xdf3c('0x3')]},'destuniqueid':{'type':Sequelize[_0xdf3c('0x2')]},'destlinkedid':{'type':Sequelize[_0xdf3c('0x2')]},'dialstring':{'type':Sequelize[_0xdf3c('0x2')]},'dialstatus':{'type':Sequelize['STRING']},'starttime':{'type':Sequelize[_0xdf3c('0x4')]},'answertime':{'type':Sequelize[_0xdf3c('0x4')]},'endtime':{'type':Sequelize[_0xdf3c('0x4')]},'lastevent':{'type':Sequelize[_0xdf3c('0x2')],'comment':'called,connect,complete'},'routeId':{'type':Sequelize[_0xdf3c('0x3')]},'duration':{'type':Sequelize[_0xdf3c('0x3')]},'holdtime':{'type':Sequelize[_0xdf3c('0x3')]},'billableseconds':{'type':Sequelize['INTEGER']}}; \ No newline at end of file diff --git a/server/api/voiceDialReport/voiceDialReport.controller.js b/server/api/voiceDialReport/voiceDialReport.controller.js index 294dcc7..6bff25c 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 _0x582c=['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','offset','count','set','Content-Range','reject','save','destroy','error','stack','name','index','map','VoiceDialReport','fieldName','type','filters','intersection','model','query','attributes','fields','limit','order','sort','where','pick','filter','merge','VIRTUAL','options','then','includeAll','include','rows','catch','show','params','rawAttributes','length','find','create','update','body','describe','eml-format','rimraf','zip-dir','fast-json-patch','moment','path','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','papaparse'];(function(_0x349a6a,_0x291b2a){var _0x3f6577=function(_0x384071){while(--_0x384071){_0x349a6a['push'](_0x349a6a['shift']());}};_0x3f6577(++_0x291b2a);}(_0x582c,0xcf));var _0xc582=function(_0x27a3cb,_0x4af597){_0x27a3cb=_0x27a3cb-0x0;var _0x54ff38=_0x582c[_0x27a3cb];return _0x54ff38;};'use strict';var emlformat=require(_0xc582('0x0'));var rimraf=require(_0xc582('0x1'));var zipdir=require(_0xc582('0x2'));var jsonpatch=require(_0xc582('0x3'));var rp=require('request-promise');var moment=require(_0xc582('0x4'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require('util');var path=require(_0xc582('0x5'));var sox=require('sox');var csv=require(_0xc582('0x6'));var ejs=require(_0xc582('0x7'));var fs=require('fs');var fs_extra=require(_0xc582('0x8'));var _=require(_0xc582('0x9'));var squel=require(_0xc582('0xa'));var crypto=require(_0xc582('0xb'));var jsforce=require(_0xc582('0xc'));var deskjs=require(_0xc582('0xd'));var toCsv=require(_0xc582('0x6'));var querystring=require('querystring');var Papa=require(_0xc582('0xe'));var Redis=require(_0xc582('0xf'));var authService=require(_0xc582('0x10'));var qs=require(_0xc582('0x11'));var as=require(_0xc582('0x12'));var hardwareService=require(_0xc582('0x13'));var logger=require(_0xc582('0x14'))(_0xc582('0x15'));var utils=require(_0xc582('0x16'));var config=require(_0xc582('0x17'));var licenseUtil=require(_0xc582('0x18'));var db=require(_0xc582('0x19'))['db'];function respondWithStatusCode(_0x3f1370,_0x5ca978){_0x5ca978=_0x5ca978||0xcc;return function(_0x539b0f){if(_0x539b0f){return _0x3f1370[_0xc582('0x1a')](_0x5ca978);}return _0x3f1370[_0xc582('0x1b')](_0x5ca978)['end']();};}function respondWithResult(_0x1cb9e2,_0x443c16){_0x443c16=_0x443c16||0xc8;return function(_0x1a5c81){if(_0x1a5c81){return _0x1cb9e2[_0xc582('0x1b')](_0x443c16)[_0xc582('0x1c')](_0x1a5c81);}};}function respondWithFilteredResult(_0x4039ab,_0x41478d){return function(_0x3cbda8){if(_0x3cbda8){var _0x1a7f9c=typeof _0x41478d['offset']==='undefined'&&typeof _0x41478d['limit']===_0xc582('0x1d');var _0x240b52=_0x3cbda8['count'];var _0x3ed801=_0x1a7f9c?0x0:_0x41478d[_0xc582('0x1e')];var _0x5f09f8=_0x1a7f9c?_0x3cbda8[_0xc582('0x1f')]:_0x41478d[_0xc582('0x1e')]+_0x41478d['limit'];var _0x2234ce;if(_0x5f09f8>=_0x240b52){_0x5f09f8=_0x240b52;_0x2234ce=0xc8;}else{_0x2234ce=0xce;}_0x4039ab[_0xc582('0x1b')](_0x2234ce);return _0x4039ab[_0xc582('0x20')](_0xc582('0x21'),_0x3ed801+'-'+_0x5f09f8+'/'+_0x240b52)[_0xc582('0x1c')](_0x3cbda8);}return null;};}function patchUpdates(_0xe75c69){return function(_0x22cea3){try{jsonpatch['apply'](_0x22cea3,_0xe75c69,!![]);}catch(_0x4f6bf2){return BPromise[_0xc582('0x22')](_0x4f6bf2);}return _0x22cea3[_0xc582('0x23')]();};}function saveUpdates(_0x1ef72d,_0x33b759){return function(_0x51cd0e){if(_0x51cd0e){return _0x51cd0e['update'](_0x1ef72d)['then'](function(_0x4b50f7){return _0x4b50f7;});}return null;};}function removeEntity(_0xf20a85,_0x4d4358){return function(_0x34fbc0){if(_0x34fbc0){return _0x34fbc0[_0xc582('0x24')]()['then'](function(){_0xf20a85[_0xc582('0x1b')](0xcc)['end']();});}};}function handleEntityNotFound(_0x3a2826,_0x817c84){return function(_0x27b6b7){if(!_0x27b6b7){_0x3a2826[_0xc582('0x1a')](0x194);}return _0x27b6b7;};}function handleError(_0x4f0687,_0x13ab6e){_0x13ab6e=_0x13ab6e||0x1f4;return function(_0x3ef6e3){logger[_0xc582('0x25')](_0x3ef6e3[_0xc582('0x26')]);if(_0x3ef6e3[_0xc582('0x27')]){delete _0x3ef6e3[_0xc582('0x27')];}_0x4f0687[_0xc582('0x1b')](_0x13ab6e)['send'](_0x3ef6e3);};}exports[_0xc582('0x28')]=function(_0xeb6101,_0x2695dc){var _0x2aeea0={},_0x45a7bc={},_0x22fc85={'count':0x0,'rows':[]};var _0x395c64=_[_0xc582('0x29')](db[_0xc582('0x2a')]['rawAttributes'],function(_0x3a2a39){return{'name':_0x3a2a39[_0xc582('0x2b')],'type':_0x3a2a39[_0xc582('0x2c')]['key']};});_0x45a7bc['model']=_['map'](_0x395c64,_0xc582('0x27'));_0x45a7bc['query']=_['keys'](_0xeb6101['query']);_0x45a7bc[_0xc582('0x2d')]=_[_0xc582('0x2e')](_0x45a7bc[_0xc582('0x2f')],_0x45a7bc[_0xc582('0x30')]);_0x2aeea0[_0xc582('0x31')]=_['intersection'](_0x45a7bc[_0xc582('0x2f')],qs[_0xc582('0x32')](_0xeb6101[_0xc582('0x30')][_0xc582('0x32')]));_0x2aeea0[_0xc582('0x31')]=_0x2aeea0[_0xc582('0x31')]['length']?_0x2aeea0[_0xc582('0x31')]:_0x45a7bc['model'];if(!_0xeb6101['query']['hasOwnProperty']('nolimit')){_0x2aeea0[_0xc582('0x33')]=qs[_0xc582('0x33')](_0xeb6101[_0xc582('0x30')][_0xc582('0x33')]);_0x2aeea0[_0xc582('0x1e')]=qs['offset'](_0xeb6101['query']['offset']);}_0x2aeea0[_0xc582('0x34')]=qs['sort'](_0xeb6101['query'][_0xc582('0x35')]);_0x2aeea0[_0xc582('0x36')]=qs[_0xc582('0x2d')](_[_0xc582('0x37')](_0xeb6101[_0xc582('0x30')],_0x45a7bc[_0xc582('0x2d')]),_0x395c64);if(_0xeb6101[_0xc582('0x30')][_0xc582('0x38')]){_0x2aeea0[_0xc582('0x36')]=_[_0xc582('0x39')](_0x2aeea0[_0xc582('0x36')],{'$or':_[_0xc582('0x29')](_0x395c64,function(_0x480bd9){if(_0x480bd9[_0xc582('0x2c')]!==_0xc582('0x3a')){var _0x37b91f={};_0x37b91f[_0x480bd9[_0xc582('0x27')]]={'$like':'%'+_0xeb6101[_0xc582('0x30')]['filter']+'%'};return _0x37b91f;}})});}_0x2aeea0=_['merge']({},_0x2aeea0,_0xeb6101[_0xc582('0x3b')]);var _0x47c09f={'where':_0x2aeea0[_0xc582('0x36')]};return db[_0xc582('0x2a')][_0xc582('0x1f')](_0x47c09f)[_0xc582('0x3c')](function(_0x236918){_0x22fc85[_0xc582('0x1f')]=_0x236918;if(_0xeb6101[_0xc582('0x30')][_0xc582('0x3d')]){_0x2aeea0[_0xc582('0x3e')]=[{'all':!![]}];}return db[_0xc582('0x2a')]['findAll'](_0x2aeea0);})[_0xc582('0x3c')](function(_0x186a8f){_0x22fc85[_0xc582('0x3f')]=_0x186a8f;return _0x22fc85;})['then'](respondWithFilteredResult(_0x2695dc,_0x2aeea0))[_0xc582('0x40')](handleError(_0x2695dc,null));};exports[_0xc582('0x41')]=function(_0x40f5b8,_0x189be2){var _0x26710e={'raw':!![],'where':{'id':_0x40f5b8[_0xc582('0x42')]['id']}},_0x5b524b={};_0x5b524b[_0xc582('0x2f')]=_['keys'](db[_0xc582('0x2a')][_0xc582('0x43')]);_0x5b524b['query']=_['keys'](_0x40f5b8[_0xc582('0x30')]);_0x5b524b[_0xc582('0x2d')]=_[_0xc582('0x2e')](_0x5b524b[_0xc582('0x2f')],_0x5b524b[_0xc582('0x30')]);_0x26710e['attributes']=_[_0xc582('0x2e')](_0x5b524b['model'],qs['fields'](_0x40f5b8[_0xc582('0x30')][_0xc582('0x32')]));_0x26710e[_0xc582('0x31')]=_0x26710e[_0xc582('0x31')][_0xc582('0x44')]?_0x26710e[_0xc582('0x31')]:_0x5b524b['model'];if(_0x40f5b8[_0xc582('0x30')]['includeAll']){_0x26710e[_0xc582('0x3e')]=[{'all':!![]}];}_0x26710e=_[_0xc582('0x39')]({},_0x26710e,_0x40f5b8[_0xc582('0x3b')]);return db[_0xc582('0x2a')][_0xc582('0x45')](_0x26710e)[_0xc582('0x3c')](handleEntityNotFound(_0x189be2,null))[_0xc582('0x3c')](respondWithResult(_0x189be2,null))[_0xc582('0x40')](handleError(_0x189be2,null));};exports[_0xc582('0x46')]=function(_0x2b7631,_0xa1ee14){return db[_0xc582('0x2a')][_0xc582('0x46')](_0x2b7631['body'],{})[_0xc582('0x3c')](respondWithResult(_0xa1ee14,0xc9))['catch'](handleError(_0xa1ee14,null));};exports[_0xc582('0x47')]=function(_0x308b6b,_0x506298){if(_0x308b6b['body']['id']){delete _0x308b6b[_0xc582('0x48')]['id'];}return db[_0xc582('0x2a')][_0xc582('0x45')]({'where':{'id':_0x308b6b[_0xc582('0x42')]['id']}})[_0xc582('0x3c')](handleEntityNotFound(_0x506298,null))[_0xc582('0x3c')](saveUpdates(_0x308b6b[_0xc582('0x48')],null))[_0xc582('0x3c')](respondWithResult(_0x506298,null))[_0xc582('0x40')](handleError(_0x506298,null));};exports[_0xc582('0x24')]=function(_0x588243,_0x3302bd){return db[_0xc582('0x2a')]['find']({'where':{'id':_0x588243[_0xc582('0x42')]['id']}})[_0xc582('0x3c')](handleEntityNotFound(_0x3302bd,null))[_0xc582('0x3c')](removeEntity(_0x3302bd,null))[_0xc582('0x40')](handleError(_0x3302bd,null));};exports['describe']=function(_0x54051d,_0x7f094c){return db[_0xc582('0x2a')][_0xc582('0x49')]()[_0xc582('0x3c')](respondWithResult(_0x7f094c,null))[_0xc582('0x40')](handleError(_0x7f094c,null));}; \ No newline at end of file +var _0x71ae=['stack','name','send','index','map','VoiceDialReport','fieldName','key','model','keys','query','intersection','attributes','fields','length','hasOwnProperty','sort','where','filters','pick','filter','type','VIRTUAL','options','includeAll','include','rows','catch','show','params','rawAttributes','merge','find','create','body','describe','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../mysqldb','sendStatus','end','json','offset','limit','undefined','count','status','set','Content-Range','save','update','then','destroy','error'];(function(_0x4ad39a,_0x26766b){var _0x270ec2=function(_0xfa0e11){while(--_0xfa0e11){_0x4ad39a['push'](_0x4ad39a['shift']());}};_0x270ec2(++_0x26766b);}(_0x71ae,0xbc));var _0xe71a=function(_0x2eb5bc,_0x4634c6){_0x2eb5bc=_0x2eb5bc-0x0;var _0x51c7b1=_0x71ae[_0x2eb5bc];return _0x51c7b1;};'use strict';var emlformat=require(_0xe71a('0x0'));var rimraf=require(_0xe71a('0x1'));var zipdir=require(_0xe71a('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0xe71a('0x3'));var moment=require(_0xe71a('0x4'));var BPromise=require(_0xe71a('0x5'));var Mustache=require(_0xe71a('0x6'));var util=require(_0xe71a('0x7'));var path=require(_0xe71a('0x8'));var sox=require(_0xe71a('0x9'));var csv=require(_0xe71a('0xa'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xe71a('0xb'));var _=require(_0xe71a('0xc'));var squel=require(_0xe71a('0xd'));var crypto=require(_0xe71a('0xe'));var jsforce=require(_0xe71a('0xf'));var deskjs=require(_0xe71a('0x10'));var toCsv=require(_0xe71a('0xa'));var querystring=require(_0xe71a('0x11'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0xe71a('0x12'));var as=require(_0xe71a('0x13'));var hardwareService=require(_0xe71a('0x14'));var logger=require(_0xe71a('0x15'))(_0xe71a('0x16'));var utils=require(_0xe71a('0x17'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0xe71a('0x18'))['db'];function respondWithStatusCode(_0x2a7d59,_0x43e220){_0x43e220=_0x43e220||0xcc;return function(_0x440fae){if(_0x440fae){return _0x2a7d59[_0xe71a('0x19')](_0x43e220);}return _0x2a7d59['status'](_0x43e220)[_0xe71a('0x1a')]();};}function respondWithResult(_0x3dd40b,_0x36f306){_0x36f306=_0x36f306||0xc8;return function(_0x14f87e){if(_0x14f87e){return _0x3dd40b['status'](_0x36f306)[_0xe71a('0x1b')](_0x14f87e);}};}function respondWithFilteredResult(_0x187601,_0x38f742){return function(_0x37d780){if(_0x37d780){var _0x350abe=typeof _0x38f742[_0xe71a('0x1c')]==='undefined'&&typeof _0x38f742[_0xe71a('0x1d')]===_0xe71a('0x1e');var _0x18af8e=_0x37d780[_0xe71a('0x1f')];var _0x33360a=_0x350abe?0x0:_0x38f742[_0xe71a('0x1c')];var _0x14948e=_0x350abe?_0x37d780[_0xe71a('0x1f')]:_0x38f742[_0xe71a('0x1c')]+_0x38f742['limit'];var _0x2fdf8c;if(_0x14948e>=_0x18af8e){_0x14948e=_0x18af8e;_0x2fdf8c=0xc8;}else{_0x2fdf8c=0xce;}_0x187601[_0xe71a('0x20')](_0x2fdf8c);return _0x187601[_0xe71a('0x21')](_0xe71a('0x22'),_0x33360a+'-'+_0x14948e+'/'+_0x18af8e)['json'](_0x37d780);}return null;};}function patchUpdates(_0x10e5ca){return function(_0x222d67){try{jsonpatch['apply'](_0x222d67,_0x10e5ca,!![]);}catch(_0x4c4506){return BPromise['reject'](_0x4c4506);}return _0x222d67[_0xe71a('0x23')]();};}function saveUpdates(_0x2d3446,_0x2814b3){return function(_0x47cab4){if(_0x47cab4){return _0x47cab4[_0xe71a('0x24')](_0x2d3446)[_0xe71a('0x25')](function(_0x115ce0){return _0x115ce0;});}return null;};}function removeEntity(_0x14d81d,_0x2d15d1){return function(_0xe28f3e){if(_0xe28f3e){return _0xe28f3e[_0xe71a('0x26')]()['then'](function(){_0x14d81d['status'](0xcc)[_0xe71a('0x1a')]();});}};}function handleEntityNotFound(_0x23418f,_0xc9d252){return function(_0x177421){if(!_0x177421){_0x23418f[_0xe71a('0x19')](0x194);}return _0x177421;};}function handleError(_0x43c482,_0x5e8a28){_0x5e8a28=_0x5e8a28||0x1f4;return function(_0x1a7985){logger[_0xe71a('0x27')](_0x1a7985[_0xe71a('0x28')]);if(_0x1a7985[_0xe71a('0x29')]){delete _0x1a7985[_0xe71a('0x29')];}_0x43c482[_0xe71a('0x20')](_0x5e8a28)[_0xe71a('0x2a')](_0x1a7985);};}exports[_0xe71a('0x2b')]=function(_0x228def,_0x6659d3){var _0x21f85e={},_0x207adf={},_0x2b8fca={'count':0x0,'rows':[]};var _0x40a487=_[_0xe71a('0x2c')](db[_0xe71a('0x2d')]['rawAttributes'],function(_0xa2c377){return{'name':_0xa2c377[_0xe71a('0x2e')],'type':_0xa2c377['type'][_0xe71a('0x2f')]};});_0x207adf[_0xe71a('0x30')]=_[_0xe71a('0x2c')](_0x40a487,'name');_0x207adf['query']=_[_0xe71a('0x31')](_0x228def[_0xe71a('0x32')]);_0x207adf['filters']=_[_0xe71a('0x33')](_0x207adf[_0xe71a('0x30')],_0x207adf[_0xe71a('0x32')]);_0x21f85e[_0xe71a('0x34')]=_['intersection'](_0x207adf[_0xe71a('0x30')],qs[_0xe71a('0x35')](_0x228def[_0xe71a('0x32')][_0xe71a('0x35')]));_0x21f85e[_0xe71a('0x34')]=_0x21f85e['attributes'][_0xe71a('0x36')]?_0x21f85e[_0xe71a('0x34')]:_0x207adf['model'];if(!_0x228def[_0xe71a('0x32')][_0xe71a('0x37')]('nolimit')){_0x21f85e[_0xe71a('0x1d')]=qs['limit'](_0x228def[_0xe71a('0x32')][_0xe71a('0x1d')]);_0x21f85e[_0xe71a('0x1c')]=qs['offset'](_0x228def['query'][_0xe71a('0x1c')]);}_0x21f85e['order']=qs[_0xe71a('0x38')](_0x228def[_0xe71a('0x32')][_0xe71a('0x38')]);_0x21f85e[_0xe71a('0x39')]=qs[_0xe71a('0x3a')](_[_0xe71a('0x3b')](_0x228def[_0xe71a('0x32')],_0x207adf[_0xe71a('0x3a')]),_0x40a487);if(_0x228def[_0xe71a('0x32')][_0xe71a('0x3c')]){_0x21f85e[_0xe71a('0x39')]=_['merge'](_0x21f85e[_0xe71a('0x39')],{'$or':_[_0xe71a('0x2c')](_0x40a487,function(_0x133afe){if(_0x133afe[_0xe71a('0x3d')]!==_0xe71a('0x3e')){var _0x399275={};_0x399275[_0x133afe[_0xe71a('0x29')]]={'$like':'%'+_0x228def[_0xe71a('0x32')]['filter']+'%'};return _0x399275;}})});}_0x21f85e=_['merge']({},_0x21f85e,_0x228def[_0xe71a('0x3f')]);var _0x3f2834={'where':_0x21f85e['where']};return db['VoiceDialReport'][_0xe71a('0x1f')](_0x3f2834)[_0xe71a('0x25')](function(_0x480d02){_0x2b8fca[_0xe71a('0x1f')]=_0x480d02;if(_0x228def['query'][_0xe71a('0x40')]){_0x21f85e[_0xe71a('0x41')]=[{'all':!![]}];}return db[_0xe71a('0x2d')]['findAll'](_0x21f85e);})[_0xe71a('0x25')](function(_0x32b6a0){_0x2b8fca[_0xe71a('0x42')]=_0x32b6a0;return _0x2b8fca;})[_0xe71a('0x25')](respondWithFilteredResult(_0x6659d3,_0x21f85e))[_0xe71a('0x43')](handleError(_0x6659d3,null));};exports[_0xe71a('0x44')]=function(_0x5d304d,_0x31154e){var _0x542cf9={'raw':!![],'where':{'id':_0x5d304d[_0xe71a('0x45')]['id']}},_0x1e9f9f={};_0x1e9f9f[_0xe71a('0x30')]=_[_0xe71a('0x31')](db['VoiceDialReport'][_0xe71a('0x46')]);_0x1e9f9f['query']=_[_0xe71a('0x31')](_0x5d304d[_0xe71a('0x32')]);_0x1e9f9f[_0xe71a('0x3a')]=_[_0xe71a('0x33')](_0x1e9f9f['model'],_0x1e9f9f['query']);_0x542cf9['attributes']=_[_0xe71a('0x33')](_0x1e9f9f[_0xe71a('0x30')],qs['fields'](_0x5d304d[_0xe71a('0x32')][_0xe71a('0x35')]));_0x542cf9[_0xe71a('0x34')]=_0x542cf9[_0xe71a('0x34')][_0xe71a('0x36')]?_0x542cf9[_0xe71a('0x34')]:_0x1e9f9f[_0xe71a('0x30')];if(_0x5d304d[_0xe71a('0x32')][_0xe71a('0x40')]){_0x542cf9[_0xe71a('0x41')]=[{'all':!![]}];}_0x542cf9=_[_0xe71a('0x47')]({},_0x542cf9,_0x5d304d[_0xe71a('0x3f')]);return db[_0xe71a('0x2d')][_0xe71a('0x48')](_0x542cf9)['then'](handleEntityNotFound(_0x31154e,null))[_0xe71a('0x25')](respondWithResult(_0x31154e,null))[_0xe71a('0x43')](handleError(_0x31154e,null));};exports['create']=function(_0x434720,_0x5d59bf){return db[_0xe71a('0x2d')][_0xe71a('0x49')](_0x434720['body'],{})[_0xe71a('0x25')](respondWithResult(_0x5d59bf,0xc9))[_0xe71a('0x43')](handleError(_0x5d59bf,null));};exports[_0xe71a('0x24')]=function(_0x53c1d8,_0x42dc49){if(_0x53c1d8[_0xe71a('0x4a')]['id']){delete _0x53c1d8[_0xe71a('0x4a')]['id'];}return db[_0xe71a('0x2d')][_0xe71a('0x48')]({'where':{'id':_0x53c1d8['params']['id']}})[_0xe71a('0x25')](handleEntityNotFound(_0x42dc49,null))[_0xe71a('0x25')](saveUpdates(_0x53c1d8[_0xe71a('0x4a')],null))[_0xe71a('0x25')](respondWithResult(_0x42dc49,null))[_0xe71a('0x43')](handleError(_0x42dc49,null));};exports['destroy']=function(_0xcaa5d8,_0x2eac93){return db[_0xe71a('0x2d')][_0xe71a('0x48')]({'where':{'id':_0xcaa5d8[_0xe71a('0x45')]['id']}})[_0xe71a('0x25')](handleEntityNotFound(_0x2eac93,null))[_0xe71a('0x25')](removeEntity(_0x2eac93,null))[_0xe71a('0x43')](handleError(_0x2eac93,null));};exports[_0xe71a('0x4b')]=function(_0x37baef,_0x52aa29){return db[_0xe71a('0x2d')]['describe']()[_0xe71a('0x25')](respondWithResult(_0x52aa29,null))[_0xe71a('0x43')](handleError(_0x52aa29,null));}; \ No newline at end of file diff --git a/server/api/voiceDialReport/voiceDialReport.model.js b/server/api/voiceDialReport/voiceDialReport.model.js index 9fbd7f8..e985f0f 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 _0x4703=['api','moment','bluebird','rimraf','../../config/environment','./voiceDialReport.attributes','exports','define','VoiceDialReport','report_dial','lodash','util','../../config/logger'];(function(_0x2d2b18,_0x2bf8b0){var _0x5c71eb=function(_0x9a3a2b){while(--_0x9a3a2b){_0x2d2b18['push'](_0x2d2b18['shift']());}};_0x5c71eb(++_0x2bf8b0);}(_0x4703,0xda));var _0x3470=function(_0x207267,_0x50618f){_0x207267=_0x207267-0x0;var _0x4c7d02=_0x4703[_0x207267];return _0x4c7d02;};'use strict';var _=require(_0x3470('0x0'));var util=require(_0x3470('0x1'));var logger=require(_0x3470('0x2'))(_0x3470('0x3'));var moment=require(_0x3470('0x4'));var BPromise=require(_0x3470('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0x3470('0x6'));var config=require(_0x3470('0x7'));var attributes=require(_0x3470('0x8'));module[_0x3470('0x9')]=function(_0x184fac,_0x55a269){return _0x184fac[_0x3470('0xa')](_0x3470('0xb'),attributes,{'tableName':_0x3470('0xc'),'paranoid':![],'indexes':[{'fields':['uniqueid']}],'timestamps':!![]});}; \ No newline at end of file +var _0x0275=['util','../../config/logger','moment','bluebird','request-promise','path','rimraf','../../config/environment','./voiceDialReport.attributes','exports','VoiceDialReport','uniqueid'];(function(_0x502ca3,_0x36be36){var _0x27f42c=function(_0x1e3045){while(--_0x1e3045){_0x502ca3['push'](_0x502ca3['shift']());}};_0x27f42c(++_0x36be36);}(_0x0275,0xc0));var _0x5027=function(_0x1d9ccc,_0x65116c){_0x1d9ccc=_0x1d9ccc-0x0;var _0x2cb721=_0x0275[_0x1d9ccc];return _0x2cb721;};'use strict';var _=require('lodash');var util=require(_0x5027('0x0'));var logger=require(_0x5027('0x1'))('api');var moment=require(_0x5027('0x2'));var BPromise=require(_0x5027('0x3'));var rp=require(_0x5027('0x4'));var fs=require('fs');var path=require(_0x5027('0x5'));var rimraf=require(_0x5027('0x6'));var config=require(_0x5027('0x7'));var attributes=require(_0x5027('0x8'));module[_0x5027('0x9')]=function(_0x375c16,_0x3a8b12){return _0x375c16['define'](_0x5027('0xa'),attributes,{'tableName':'report_dial','paranoid':![],'indexes':[{'fields':[_0x5027('0xb')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/voiceDialReport/voiceDialReport.rpc.js b/server/api/voiceDialReport/voiceDialReport.rpc.js index 6dd94e0..59ff17a 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 _0x53a2=['lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','then','info','VoiceDialReport,\x20%s,\x20%s','request\x20sent','VoiceDialReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','CreateVoiceDialReport','VoiceDialReport','create','body','options','debug','catch','UpdateVoiceDialReport','raw','where','limit'];(function(_0x31aa84,_0x3bcc8b){var _0x2d9e3e=function(_0x4783da){while(--_0x4783da){_0x31aa84['push'](_0x31aa84['shift']());}};_0x2d9e3e(++_0x3bcc8b);}(_0x53a2,0x176));var _0x253a=function(_0x33032e,_0x31411a){_0x33032e=_0x33032e-0x0;var _0x13316b=_0x53a2[_0x33032e];return _0x13316b;};'use strict';var _=require(_0x253a('0x0'));var util=require(_0x253a('0x1'));var moment=require('moment');var BPromise=require(_0x253a('0x2'));var rs=require(_0x253a('0x3'));var fs=require('fs');var Redis=require(_0x253a('0x4'));var db=require(_0x253a('0x5'))['db'];var utils=require(_0x253a('0x6'));var logger=require(_0x253a('0x7'))(_0x253a('0x8'));var config=require(_0x253a('0x9'));var jayson=require(_0x253a('0xa'));var client=jayson['client'][_0x253a('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x532d1d,_0x52c1aa,_0x570bd0){return new BPromise(function(_0x6e0333,_0x54855d){return client[_0x253a('0xc')](_0x532d1d,_0x570bd0)[_0x253a('0xd')](function(_0xb4a04d){logger[_0x253a('0xe')](_0x253a('0xf'),_0x52c1aa,_0x253a('0x10'));logger['debug'](_0x253a('0x11'),_0x52c1aa,_0x253a('0x10'),JSON[_0x253a('0x12')](_0xb4a04d));if(_0xb4a04d[_0x253a('0x13')]){if(_0xb4a04d[_0x253a('0x13')][_0x253a('0x14')]===0x1f4){logger[_0x253a('0x13')](_0x253a('0xf'),_0x52c1aa,_0xb4a04d[_0x253a('0x13')][_0x253a('0x15')]);return _0x54855d(_0xb4a04d[_0x253a('0x13')][_0x253a('0x15')]);}logger[_0x253a('0x13')](_0x253a('0xf'),_0x52c1aa,_0xb4a04d['error'][_0x253a('0x15')]);return _0x6e0333(_0xb4a04d[_0x253a('0x13')][_0x253a('0x15')]);}else{logger[_0x253a('0xe')]('VoiceDialReport,\x20%s,\x20%s',_0x52c1aa,_0x253a('0x10'));_0x6e0333(_0xb4a04d[_0x253a('0x16')][_0x253a('0x15')]);}})['catch'](function(_0x668783){logger[_0x253a('0x13')](_0x253a('0xf'),_0x52c1aa,_0x668783);_0x54855d(_0x668783);});});}exports[_0x253a('0x17')]=function(_0x5aa533){var _0x3bf511=this;return new Promise(function(_0x27f812,_0x501a2e){return db[_0x253a('0x18')][_0x253a('0x19')](_0x5aa533[_0x253a('0x1a')],{'raw':_0x5aa533['options']?_0x5aa533[_0x253a('0x1b')]['raw']===undefined?!![]:![]:!![]})[_0x253a('0xd')](function(_0x30426){logger[_0x253a('0xe')](_0x253a('0x17'),_0x5aa533);logger[_0x253a('0x1c')](_0x253a('0x17'),_0x5aa533,JSON['stringify'](_0x30426));_0x27f812(_0x30426);})[_0x253a('0x1d')](function(_0x5d01b1){logger[_0x253a('0x13')]('CreateVoiceDialReport',_0x5d01b1[_0x253a('0x15')],_0x5aa533);_0x501a2e(_0x3bf511[_0x253a('0x13')](0x1f4,_0x5d01b1[_0x253a('0x15')]));});});};exports[_0x253a('0x1e')]=function(_0x278c8a){var _0x5c5b01=this;return new Promise(function(_0x36111d,_0x2ed8a2){return db[_0x253a('0x18')]['update'](_0x278c8a[_0x253a('0x1a')],{'raw':_0x278c8a[_0x253a('0x1b')]?_0x278c8a[_0x253a('0x1b')][_0x253a('0x1f')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x278c8a[_0x253a('0x1b')]?_0x278c8a[_0x253a('0x1b')][_0x253a('0x20')]||null:null,'attributes':_0x278c8a['options']?_0x278c8a[_0x253a('0x1b')]['attributes']||null:null,'limit':_0x278c8a[_0x253a('0x1b')]?_0x278c8a['options'][_0x253a('0x21')]||null:null})[_0x253a('0xd')](function(_0x1dbf95){logger[_0x253a('0xe')](_0x253a('0x1e'),_0x278c8a);logger['debug'](_0x253a('0x1e'),_0x278c8a,JSON[_0x253a('0x12')](_0x1dbf95));_0x36111d(_0x1dbf95);})['catch'](function(_0x1565bd){logger[_0x253a('0x13')]('UpdateVoiceDialReport',_0x1565bd[_0x253a('0x15')],_0x278c8a);_0x2ed8a2(_0x5c5b01[_0x253a('0x13')](0x1f4,_0x1565bd[_0x253a('0x15')]));});});}; \ No newline at end of file +var _0x2b85=['bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','client','http','request','then','info','VoiceDialReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','VoiceDialReport,\x20%s,\x20%s','request\x20sent','result','catch','CreateVoiceDialReport','VoiceDialReport','create','body','options','debug','UpdateVoiceDialReport','update','raw','limit','lodash','util','moment'];(function(_0x7729b1,_0x468322){var _0x349504=function(_0x401cee){while(--_0x401cee){_0x7729b1['push'](_0x7729b1['shift']());}};_0x349504(++_0x468322);}(_0x2b85,0xa2));var _0x52b8=function(_0x2fab48,_0x4fa860){_0x2fab48=_0x2fab48-0x0;var _0xb441c7=_0x2b85[_0x2fab48];return _0xb441c7;};'use strict';var _=require(_0x52b8('0x0'));var util=require(_0x52b8('0x1'));var moment=require(_0x52b8('0x2'));var BPromise=require(_0x52b8('0x3'));var rs=require(_0x52b8('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x52b8('0x5'))['db'];var utils=require(_0x52b8('0x6'));var logger=require(_0x52b8('0x7'))(_0x52b8('0x8'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x52b8('0x9')][_0x52b8('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x271ada,_0x14c117,_0x43821e){return new BPromise(function(_0x5087b3,_0x8f966){return client[_0x52b8('0xb')](_0x271ada,_0x43821e)[_0x52b8('0xc')](function(_0x569c4f){logger[_0x52b8('0xd')]('VoiceDialReport,\x20%s,\x20%s',_0x14c117,'request\x20sent');logger['debug'](_0x52b8('0xe'),_0x14c117,'request\x20sent',JSON[_0x52b8('0xf')](_0x569c4f));if(_0x569c4f[_0x52b8('0x10')]){if(_0x569c4f[_0x52b8('0x10')][_0x52b8('0x11')]===0x1f4){logger['error']('VoiceDialReport,\x20%s,\x20%s',_0x14c117,_0x569c4f['error'][_0x52b8('0x12')]);return _0x8f966(_0x569c4f[_0x52b8('0x10')][_0x52b8('0x12')]);}logger[_0x52b8('0x10')](_0x52b8('0x13'),_0x14c117,_0x569c4f[_0x52b8('0x10')][_0x52b8('0x12')]);return _0x5087b3(_0x569c4f[_0x52b8('0x10')][_0x52b8('0x12')]);}else{logger['info'](_0x52b8('0x13'),_0x14c117,_0x52b8('0x14'));_0x5087b3(_0x569c4f[_0x52b8('0x15')]['message']);}})[_0x52b8('0x16')](function(_0x66a52f){logger[_0x52b8('0x10')](_0x52b8('0x13'),_0x14c117,_0x66a52f);_0x8f966(_0x66a52f);});});}exports[_0x52b8('0x17')]=function(_0x190f55){var _0x349def=this;return new Promise(function(_0x44fd07,_0x4a65c8){return db[_0x52b8('0x18')][_0x52b8('0x19')](_0x190f55[_0x52b8('0x1a')],{'raw':_0x190f55[_0x52b8('0x1b')]?_0x190f55[_0x52b8('0x1b')]['raw']===undefined?!![]:![]:!![]})['then'](function(_0x450cd9){logger[_0x52b8('0xd')](_0x52b8('0x17'),_0x190f55);logger[_0x52b8('0x1c')](_0x52b8('0x17'),_0x190f55,JSON[_0x52b8('0xf')](_0x450cd9));_0x44fd07(_0x450cd9);})[_0x52b8('0x16')](function(_0x56076d){logger[_0x52b8('0x10')]('CreateVoiceDialReport',_0x56076d['message'],_0x190f55);_0x4a65c8(_0x349def[_0x52b8('0x10')](0x1f4,_0x56076d['message']));});});};exports[_0x52b8('0x1d')]=function(_0x4923cb){var _0x44b552=this;return new Promise(function(_0x5abbe9,_0x30b37e){return db[_0x52b8('0x18')][_0x52b8('0x1e')](_0x4923cb[_0x52b8('0x1a')],{'raw':_0x4923cb['options']?_0x4923cb[_0x52b8('0x1b')][_0x52b8('0x1f')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x4923cb['options']?_0x4923cb['options']['where']||null:null,'attributes':_0x4923cb['options']?_0x4923cb[_0x52b8('0x1b')]['attributes']||null:null,'limit':_0x4923cb[_0x52b8('0x1b')]?_0x4923cb[_0x52b8('0x1b')][_0x52b8('0x20')]||null:null})[_0x52b8('0xc')](function(_0x26e8a7){logger[_0x52b8('0xd')](_0x52b8('0x1d'),_0x4923cb);logger[_0x52b8('0x1c')](_0x52b8('0x1d'),_0x4923cb,JSON[_0x52b8('0xf')](_0x26e8a7));_0x5abbe9(_0x26e8a7);})['catch'](function(_0x456794){logger[_0x52b8('0x10')](_0x52b8('0x1d'),_0x456794['message'],_0x4923cb);_0x30b37e(_0x44b552[_0x52b8('0x10')](0x1f4,_0x456794[_0x52b8('0x12')]));});});}; \ No newline at end of file diff --git a/server/api/voiceExtension/index.js b/server/api/voiceExtension/index.js index 2df7abc..a1123b0 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 _0xba67=['../../components/interaction/service','./voiceExtension.controller','get','isAuthenticated','index','/:id','show','post','create','/:id/applications','addApplications','put','delete','destroy','util','path','express','fs-extra','../../components/auth/service'];(function(_0x334704,_0x56cafb){var _0x18257c=function(_0x19490e){while(--_0x19490e){_0x334704['push'](_0x334704['shift']());}};_0x18257c(++_0x56cafb);}(_0xba67,0x13e));var _0x7ba6=function(_0x236dcd,_0x40799f){_0x236dcd=_0x236dcd-0x0;var _0x14646b=_0xba67[_0x236dcd];return _0x14646b;};'use strict';var multer=require('multer');var util=require(_0x7ba6('0x0'));var path=require(_0x7ba6('0x1'));var timeout=require('connect-timeout');var express=require(_0x7ba6('0x2'));var router=express['Router']();var fs_extra=require(_0x7ba6('0x3'));var auth=require(_0x7ba6('0x4'));var interaction=require(_0x7ba6('0x5'));var config=require('../../config/environment');var controller=require(_0x7ba6('0x6'));router[_0x7ba6('0x7')]('/',auth[_0x7ba6('0x8')](),controller[_0x7ba6('0x9')]);router[_0x7ba6('0x7')](_0x7ba6('0xa'),auth[_0x7ba6('0x8')](),controller[_0x7ba6('0xb')]);router[_0x7ba6('0xc')]('/',auth[_0x7ba6('0x8')](),controller[_0x7ba6('0xd')]);router[_0x7ba6('0xc')](_0x7ba6('0xe'),auth[_0x7ba6('0x8')](),controller[_0x7ba6('0xf')]);router[_0x7ba6('0x10')](_0x7ba6('0xa'),auth[_0x7ba6('0x8')](),controller['update']);router[_0x7ba6('0x11')]('/:id',auth[_0x7ba6('0x8')](),controller[_0x7ba6('0x12')]);module['exports']=router; \ No newline at end of file +var _0xd18a=['/:id','show','post','/:id/applications','addApplications','put','delete','destroy','exports','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./voiceExtension.controller','get','isAuthenticated'];(function(_0x3a9b59,_0x58ba6f){var _0x48994e=function(_0x144522){while(--_0x144522){_0x3a9b59['push'](_0x3a9b59['shift']());}};_0x48994e(++_0x58ba6f);}(_0xd18a,0x149));var _0xad18=function(_0x160c3d,_0x5568ab){_0x160c3d=_0x160c3d-0x0;var _0x1242ee=_0xd18a[_0x160c3d];return _0x1242ee;};'use strict';var multer=require('multer');var util=require(_0xad18('0x0'));var path=require(_0xad18('0x1'));var timeout=require(_0xad18('0x2'));var express=require(_0xad18('0x3'));var router=express[_0xad18('0x4')]();var fs_extra=require(_0xad18('0x5'));var auth=require(_0xad18('0x6'));var interaction=require(_0xad18('0x7'));var config=require('../../config/environment');var controller=require(_0xad18('0x8'));router[_0xad18('0x9')]('/',auth[_0xad18('0xa')](),controller['index']);router[_0xad18('0x9')](_0xad18('0xb'),auth['isAuthenticated'](),controller[_0xad18('0xc')]);router[_0xad18('0xd')]('/',auth[_0xad18('0xa')](),controller['create']);router['post'](_0xad18('0xe'),auth['isAuthenticated'](),controller[_0xad18('0xf')]);router[_0xad18('0x10')](_0xad18('0xb'),auth[_0xad18('0xa')](),controller['update']);router[_0xad18('0x11')](_0xad18('0xb'),auth[_0xad18('0xa')](),controller[_0xad18('0x12')]);module[_0xad18('0x13')]=router; \ No newline at end of file diff --git a/server/api/voiceExtension/voiceExtension.attributes.js b/server/api/voiceExtension/voiceExtension.attributes.js index c266f05..c59661e 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 _0xb203=['sequelize','exports','compositeIndex','STRING','NoOp','ENUM','inbound','outbound','internal','inbound-fax','outbound-fax','system','any','*,*,*,*','INTEGER','BOOLEAN','wav','getDataValue'];(function(_0x54bdd1,_0x565d88){var _0x495f90=function(_0x86b09e){while(--_0x86b09e){_0x54bdd1['push'](_0x54bdd1['shift']());}};_0x495f90(++_0x565d88);}(_0xb203,0x1b0));var _0x3b20=function(_0x3e5086,_0x48f4a2){_0x3e5086=_0x3e5086-0x0;var _0xfeb102=_0xb203[_0x3e5086];return _0xfeb102;};'use strict';var Sequelize=require(_0x3b20('0x0'));module[_0x3b20('0x1')]={'context':{'type':Sequelize['STRING'],'allowNull':![],'unique':_0x3b20('0x2'),'validate':{'notEmpty':!![],'is':/[A-Za-z0-9._\+*!\-\[\]]+$/i}},'exten':{'type':Sequelize[_0x3b20('0x3')],'allowNull':![],'unique':_0x3b20('0x2')},'priority':{'type':Sequelize[_0x3b20('0x3')],'allowNull':![],'defaultValue':'1','unique':_0x3b20('0x2')},'tag':{'type':Sequelize[_0x3b20('0x3')],'allowNull':![],'defaultValue':'--'},'app':{'type':Sequelize[_0x3b20('0x3')],'allowNull':![],'defaultValue':_0x3b20('0x4')},'appdata':{'type':Sequelize[_0x3b20('0x3')](0x1000),'allowNull':!![],'defaultValue':''},'type':{'type':Sequelize[_0x3b20('0x5')](_0x3b20('0x6'),_0x3b20('0x7'),_0x3b20('0x8'),_0x3b20('0x9'),_0x3b20('0xa'),_0x3b20('0xb'),_0x3b20('0xc')),'allowNull':![]},'description':{'type':Sequelize[_0x3b20('0x3')]},'interval':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':_0x3b20('0xd')},'IntervalId':{'type':Sequelize[_0x3b20('0xe')]},'isApp':{'type':Sequelize[_0x3b20('0xf')],'allowNull':![],'defaultValue':![]},'appType':{'type':Sequelize['STRING'],'defaultValue':null},'callerID':{'type':Sequelize[_0x3b20('0x3')],'allowNull':!![]},'record':{'type':Sequelize[_0x3b20('0xf')],'defaultValue':![]},'cutdigits':{'type':Sequelize['INTEGER']},'recordingFormat':{'type':Sequelize[_0x3b20('0x3')],'defaultValue':_0x3b20('0x10')},'answer':{'type':Sequelize[_0x3b20('0xf')],'defaultValue':!![]},'name':{'type':Sequelize['VIRTUAL'],'get':function(_0x38ca50){return this[_0x3b20('0x11')]('exten');}},'alias':{'type':Sequelize[_0x3b20('0x3')],'allowNull':!![]}}; \ No newline at end of file +var _0x0ad1=['inbound-fax','outbound-fax','system','INTEGER','BOOLEAN','wav','VIRTUAL','getDataValue','exten','sequelize','exports','STRING','compositeIndex','NoOp','inbound','outbound','internal'];(function(_0x423097,_0x8a09f4){var _0x3a73f1=function(_0x9314f0){while(--_0x9314f0){_0x423097['push'](_0x423097['shift']());}};_0x3a73f1(++_0x8a09f4);}(_0x0ad1,0x15d));var _0x10ad=function(_0x181cac,_0x4f8ee1){_0x181cac=_0x181cac-0x0;var _0x199d5d=_0x0ad1[_0x181cac];return _0x199d5d;};'use strict';var Sequelize=require(_0x10ad('0x0'));module[_0x10ad('0x1')]={'context':{'type':Sequelize[_0x10ad('0x2')],'allowNull':![],'unique':_0x10ad('0x3'),'validate':{'notEmpty':!![],'is':/[A-Za-z0-9._\+*!\-\[\]]+$/i}},'exten':{'type':Sequelize[_0x10ad('0x2')],'allowNull':![],'unique':_0x10ad('0x3')},'priority':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':'1','unique':'compositeIndex'},'tag':{'type':Sequelize[_0x10ad('0x2')],'allowNull':![],'defaultValue':'--'},'app':{'type':Sequelize[_0x10ad('0x2')],'allowNull':![],'defaultValue':_0x10ad('0x4')},'appdata':{'type':Sequelize[_0x10ad('0x2')](0x1000),'allowNull':!![],'defaultValue':''},'type':{'type':Sequelize['ENUM'](_0x10ad('0x5'),_0x10ad('0x6'),_0x10ad('0x7'),_0x10ad('0x8'),_0x10ad('0x9'),_0x10ad('0xa'),'any'),'allowNull':![]},'description':{'type':Sequelize[_0x10ad('0x2')]},'interval':{'type':Sequelize[_0x10ad('0x2')],'allowNull':![],'defaultValue':'*,*,*,*'},'IntervalId':{'type':Sequelize[_0x10ad('0xb')]},'isApp':{'type':Sequelize['BOOLEAN'],'allowNull':![],'defaultValue':![]},'appType':{'type':Sequelize['STRING'],'defaultValue':null},'callerID':{'type':Sequelize[_0x10ad('0x2')],'allowNull':!![]},'record':{'type':Sequelize[_0x10ad('0xc')],'defaultValue':![]},'cutdigits':{'type':Sequelize['INTEGER']},'recordingFormat':{'type':Sequelize[_0x10ad('0x2')],'defaultValue':_0x10ad('0xd')},'answer':{'type':Sequelize[_0x10ad('0xc')],'defaultValue':!![]},'name':{'type':Sequelize[_0x10ad('0xe')],'get':function(_0x1abfb6){return this[_0x10ad('0xf')](_0x10ad('0x10'));}},'alias':{'type':Sequelize['STRING'],'allowNull':!![]}}; \ No newline at end of file diff --git a/server/api/voiceExtension/voiceExtension.controller.js b/server/api/voiceExtension/voiceExtension.controller.js index 18084c4..f1dd786 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 _0x0ca5=['../../config/environment','../../mysqldb','redis','localhost','./voiceExtension.socket','register','sendStatus','status','end','offset','undefined','limit','count','set','json','destroy','then','InboundRoutes','OutboundRoutes','InternalRoutes','ignore','map','value','type','find','name','UserProfileResource','error','index','VoiceExtension','rawAttributes','fieldName','model','query','keys','filters','intersection','attributes','fields','length','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','findAll','rows','catch','include','outbound','startsWith','exten','body','concat','create','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','get','inbound','internal','UserProfileSection','userProfileId','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','params','context','description','cutdigits','alias','sequelize','transaction','Transaction','ISOLATION_LEVELS','READ_COMMITTED','findOne','VoiceExtensionId','createRouting','bulkCreate','findAndCountAll','stack','finally','send','lodash','ioredis','../../components/parsers/qs','../../config/logger','api'];(function(_0x1c8620,_0x5d6555){var _0x55ce0c=function(_0x38afec){while(--_0x38afec){_0x1c8620['push'](_0x1c8620['shift']());}};_0x55ce0c(++_0x5d6555);}(_0x0ca5,0x10f));var _0x50ca=function(_0x36f92c,_0x78d7b1){_0x36f92c=_0x36f92c-0x0;var _0x5c0abc=_0x0ca5[_0x36f92c];return _0x5c0abc;};'use strict';var _=require(_0x50ca('0x0'));var Redis=require(_0x50ca('0x1'));var qs=require(_0x50ca('0x2'));var logger=require(_0x50ca('0x3'))(_0x50ca('0x4'));var config=require(_0x50ca('0x5'));var db=require(_0x50ca('0x6'))['db'];config[_0x50ca('0x7')]=_['defaults'](config[_0x50ca('0x7')],{'host':_0x50ca('0x8'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x50ca('0x7')]));require(_0x50ca('0x9'))[_0x50ca('0xa')](socket);function respondWithStatusCode(_0x1efe55,_0x534f15){_0x534f15=_0x534f15||0xcc;return function(_0x48ec01){if(_0x48ec01){return _0x1efe55[_0x50ca('0xb')](_0x534f15);}return _0x1efe55[_0x50ca('0xc')](_0x534f15)[_0x50ca('0xd')]();};}function respondWithResult(_0x3d2edf,_0xecdfd7){_0xecdfd7=_0xecdfd7||0xc8;return function(_0x58bfce){if(_0x58bfce){return _0x3d2edf[_0x50ca('0xc')](_0xecdfd7)['json'](_0x58bfce);}};}function respondWithFilteredResult(_0x18eac8,_0x1242fe){return function(_0x3cc7f5){if(_0x3cc7f5){var _0x1b7ce5=typeof _0x1242fe[_0x50ca('0xe')]===_0x50ca('0xf')&&typeof _0x1242fe[_0x50ca('0x10')]===_0x50ca('0xf');var _0x235c1e=_0x3cc7f5[_0x50ca('0x11')];var _0x437ec6=_0x1b7ce5?0x0:_0x1242fe[_0x50ca('0xe')];var _0xd5d5c7=_0x1b7ce5?_0x3cc7f5['count']:_0x1242fe[_0x50ca('0xe')]+_0x1242fe[_0x50ca('0x10')];var _0x3c2a97;if(_0xd5d5c7>=_0x235c1e){_0xd5d5c7=_0x235c1e;_0x3c2a97=0xc8;}else{_0x3c2a97=0xce;}_0x18eac8[_0x50ca('0xc')](_0x3c2a97);return _0x18eac8[_0x50ca('0x12')]('Content-Range',_0x437ec6+'-'+_0xd5d5c7+'/'+_0x235c1e)[_0x50ca('0x13')](_0x3cc7f5);}return null;};}function removeEntity(_0x17a4da){return function(_0x5d24b9){if(_0x5d24b9){return _0x5d24b9[_0x50ca('0x14')]()[_0x50ca('0x15')](function(){var _0x53f69e=_0x5d24b9['get']({'plain':!![]});var _0x12d6ad=[{'name':_0x50ca('0x16'),'value':'inbound','ignore':![]},{'name':_0x50ca('0x17'),'value':'outbound','ignore':![]},{'name':_0x50ca('0x18'),'value':'internal','ignore':![]}];var _0x2662f9=_(_0x12d6ad)['filter'](_0x50ca('0x19'))[_0x50ca('0x1a')](_0x50ca('0x1b'))['value']();if(_['includes'](_0x2662f9,_0x53f69e[_0x50ca('0x1c')])){return;}var _0x2de4bd=_[_0x50ca('0x1d')](_0x12d6ad,['value',_0x53f69e[_0x50ca('0x1c')]])[_0x50ca('0x1e')];return db[_0x50ca('0x1f')][_0x50ca('0x14')]({'where':{'type':_0x2de4bd,'resourceId':_0x53f69e['id']}})['then'](function(){return _0x5d24b9;});})[_0x50ca('0x15')](function(){_0x17a4da[_0x50ca('0xc')](0xcc)[_0x50ca('0xd')]();});}};}function handleEntityNotFound(_0x4f42c5){return function(_0x162df3){if(!_0x162df3){_0x4f42c5[_0x50ca('0xb')](0x194);}return _0x162df3;};}function handleError(_0x2f30b4,_0x59b127){_0x59b127=_0x59b127||0x1f4;return function(_0x5030a2){logger[_0x50ca('0x20')](_0x5030a2['stack']);if(_0x5030a2[_0x50ca('0x1e')]){delete _0x5030a2[_0x50ca('0x1e')];}_0x2f30b4[_0x50ca('0xc')](_0x59b127)['send'](_0x5030a2);};}exports[_0x50ca('0x21')]=function(_0x434ea3,_0x14070f){var _0x269897={},_0x55a42e={},_0xe4e853={'count':0x0,'rows':[]};var _0x48b131=_[_0x50ca('0x1a')](db[_0x50ca('0x22')][_0x50ca('0x23')],function(_0x12e02b){return{'name':_0x12e02b[_0x50ca('0x24')],'type':_0x12e02b[_0x50ca('0x1c')]['key']};});_0x55a42e[_0x50ca('0x25')]=_[_0x50ca('0x1a')](_0x48b131,_0x50ca('0x1e'));_0x55a42e[_0x50ca('0x26')]=_[_0x50ca('0x27')](_0x434ea3['query']);_0x55a42e[_0x50ca('0x28')]=_[_0x50ca('0x29')](_0x55a42e[_0x50ca('0x25')],_0x55a42e['query']);_0x269897[_0x50ca('0x2a')]=_[_0x50ca('0x29')](_0x55a42e['model'],qs[_0x50ca('0x2b')](_0x434ea3[_0x50ca('0x26')][_0x50ca('0x2b')]));_0x269897[_0x50ca('0x2a')]=_0x269897[_0x50ca('0x2a')][_0x50ca('0x2c')]?_0x269897[_0x50ca('0x2a')]:_0x55a42e[_0x50ca('0x25')];if(!_0x434ea3[_0x50ca('0x26')]['hasOwnProperty'](_0x50ca('0x2d'))){_0x269897[_0x50ca('0x10')]=qs[_0x50ca('0x10')](_0x434ea3[_0x50ca('0x26')][_0x50ca('0x10')]);_0x269897[_0x50ca('0xe')]=qs[_0x50ca('0xe')](_0x434ea3['query'][_0x50ca('0xe')]);}_0x269897[_0x50ca('0x2e')]=qs[_0x50ca('0x2f')](_0x434ea3['query'][_0x50ca('0x2f')]);_0x269897[_0x50ca('0x30')]=qs[_0x50ca('0x28')](_[_0x50ca('0x31')](_0x434ea3[_0x50ca('0x26')],_0x55a42e['filters']),_0x48b131);if(_0x434ea3[_0x50ca('0x26')][_0x50ca('0x32')]){_0x269897[_0x50ca('0x30')]=_[_0x50ca('0x33')](_0x269897[_0x50ca('0x30')],{'$or':_['map'](_0x48b131,function(_0x53dc8e){if(_0x53dc8e[_0x50ca('0x1c')]!==_0x50ca('0x34')){var _0x45ab96={};_0x45ab96[_0x53dc8e[_0x50ca('0x1e')]]={'$like':'%'+_0x434ea3['query'][_0x50ca('0x32')]+'%'};return _0x45ab96;}})});}_0x269897=_['merge']({},_0x269897,_0x434ea3[_0x50ca('0x35')]);var _0x9a0d35={'where':_0x269897[_0x50ca('0x30')]};return db[_0x50ca('0x22')][_0x50ca('0x11')](_0x9a0d35)[_0x50ca('0x15')](function(_0x55b15f){_0xe4e853[_0x50ca('0x11')]=_0x55b15f;if(_0x434ea3[_0x50ca('0x26')][_0x50ca('0x36')]){_0x269897['include']=[{'all':!![]}];}return db[_0x50ca('0x22')][_0x50ca('0x37')](_0x269897);})[_0x50ca('0x15')](function(_0x198ecd){_0xe4e853[_0x50ca('0x38')]=_0x198ecd;return _0xe4e853;})[_0x50ca('0x15')](respondWithFilteredResult(_0x14070f,_0x269897))[_0x50ca('0x39')](handleError(_0x14070f,null));};exports['show']=function(_0x89a7e1,_0x2c3d81){var _0x360151={'raw':![],'where':{'id':_0x89a7e1['params']['id']}},_0x39a710={};_0x39a710[_0x50ca('0x25')]=_['keys'](db['VoiceExtension']['rawAttributes']);_0x39a710[_0x50ca('0x26')]=_[_0x50ca('0x27')](_0x89a7e1[_0x50ca('0x26')]);_0x39a710['filters']=_[_0x50ca('0x29')](_0x39a710[_0x50ca('0x25')],_0x39a710['query']);_0x360151[_0x50ca('0x2a')]=_['intersection'](_0x39a710[_0x50ca('0x25')],qs[_0x50ca('0x2b')](_0x89a7e1[_0x50ca('0x26')][_0x50ca('0x2b')]));_0x360151[_0x50ca('0x2a')]=_0x360151[_0x50ca('0x2a')][_0x50ca('0x2c')]?_0x360151['attributes']:_0x39a710['model'];if(_0x89a7e1[_0x50ca('0x26')][_0x50ca('0x36')]){_0x360151[_0x50ca('0x3a')]=[{'all':!![]}];}_0x360151=_['merge']({},_0x360151,_0x89a7e1[_0x50ca('0x35')]);return db[_0x50ca('0x22')][_0x50ca('0x1d')](_0x360151)[_0x50ca('0x15')](handleEntityNotFound(_0x2c3d81,null))['then'](respondWithResult(_0x2c3d81,null))[_0x50ca('0x39')](handleError(_0x2c3d81,null));};exports[_0x50ca('0x14')]=function(_0x333170,_0x34cdc1){return db['VoiceExtension']['find']({'where':{'id':_0x333170['params']['id']}})['then'](handleEntityNotFound(_0x34cdc1,null))[_0x50ca('0x15')](removeEntity(_0x34cdc1,null))[_0x50ca('0x39')](handleError(_0x34cdc1,null));};exports['create']=function(_0x3879c1,_0x57767c){if(_0x3879c1['body'][_0x50ca('0x1c')]===_0x50ca('0x3b')&&!_[_0x50ca('0x3c')](_0x3879c1['body'][_0x50ca('0x3d')],'_')){_0x3879c1[_0x50ca('0x3e')][_0x50ca('0x3d')]='_'[_0x50ca('0x3f')](_0x3879c1['body'][_0x50ca('0x3d')]);}return db[_0x50ca('0x22')][_0x50ca('0x40')](_0x3879c1[_0x50ca('0x3e')],{'raw':![]})[_0x50ca('0x15')](function(_0x12b0ac){var _0x4a6f31=_0x3879c1[_0x50ca('0x41')]['get']({'plain':!![]});if(!_0x4a6f31)throw new Error(_0x50ca('0x42'));if(_0x4a6f31[_0x50ca('0x43')]==='user'){var _0x2ee4ed=_0x12b0ac[_0x50ca('0x44')]({'plain':!![]});var _0x5e3f9c=[{'name':_0x50ca('0x16'),'value':_0x50ca('0x45')},{'name':_0x50ca('0x17'),'value':_0x50ca('0x3b')},{'name':'InternalRoutes','value':_0x50ca('0x46')}];var _0x312449=_[_0x50ca('0x1d')](_0x5e3f9c,['value',_0x2ee4ed[_0x50ca('0x1c')]])['name'];return db[_0x50ca('0x47')]['find']({'where':{'name':_0x312449,'userProfileId':_0x4a6f31[_0x50ca('0x48')]},'raw':!![]})[_0x50ca('0x15')](function(_0x4a4433){if(_0x4a4433&&_0x4a4433['autoAssociation']===0x0){return db[_0x50ca('0x1f')]['create']({'name':_0x2ee4ed[_0x50ca('0x1e')],'resourceId':_0x2ee4ed['id'],'type':_0x4a4433[_0x50ca('0x1e')],'sectionId':_0x4a4433['id']},{})['then'](function(){return _0x12b0ac;});}else{return _0x12b0ac;}})['catch'](function(_0x5925c8){logger[_0x50ca('0x20')](_0x50ca('0x49'),_0x5925c8);throw _0x5925c8;});}return _0x12b0ac;})[_0x50ca('0x15')](respondWithResult(_0x57767c,0xc9))['catch'](handleError(_0x57767c,null));};exports['update']=function(_0x48f1a2,_0x3e1ff7){if(_0x48f1a2[_0x50ca('0x3e')]['id']){delete _0x48f1a2['body']['id'];}return db[_0x50ca('0x22')][_0x50ca('0x1d')]({'where':{'id':_0x48f1a2[_0x50ca('0x4a')]['id']}})[_0x50ca('0x15')](handleEntityNotFound(_0x3e1ff7,null))[_0x50ca('0x15')](function(_0xdb3047){if(_0xdb3047){return db[_0x50ca('0x22')]['update'](_['pick'](_0x48f1a2[_0x50ca('0x3e')],[_0x50ca('0x3d'),_0x50ca('0x4b'),_0x50ca('0x4c'),'recordingFormat',_0x50ca('0x4d'),'mandatoryDisposition',_0x50ca('0x4e')]),{'where':{'context':_0xdb3047[_0x50ca('0x4b')],'exten':_0xdb3047['exten']},'individualHooks':!![]})[_0x50ca('0x15')](function(_0x4a26f0){return _0x4a26f0;});}return null;})[_0x50ca('0x15')](respondWithStatusCode(_0x3e1ff7,null))['catch'](handleError(_0x3e1ff7,null));};exports['addApplications']=function(_0xa46028,_0x1cebef){var _0x4ed94b=_0xa46028[_0x50ca('0x4a')]['id'];var _0x5284dd=_0xa46028[_0x50ca('0x3e')];var _0x135906=0xc8;var _0x297cc7=null;return db[_0x50ca('0x4f')][_0x50ca('0x50')]({'isolationLevel':db[_0x50ca('0x4f')][_0x50ca('0x51')][_0x50ca('0x52')][_0x50ca('0x53')]},function(_0x16b497){return db[_0x50ca('0x22')][_0x50ca('0x54')]({'where':{'id':_0x4ed94b},'transaction':_0x16b497})[_0x50ca('0x15')](function(_0x3c5269){if(_0x3c5269){return db['VoiceExtension']['destroy']({'where':{'VoiceExtensionId':_0x4ed94b},'transaction':_0x16b497})[_0x50ca('0x15')](function(){var _0x24f27e=_[_0x50ca('0x1a')](_0x5284dd,function(_0x24d445){_0x24d445[_0x50ca('0x55')]=_0x4ed94b;_0x24d445['isApp']=!![];return _0x24d445;});return _0x3c5269[_0x50ca('0x56')](_0x24f27e);})[_0x50ca('0x15')](function(_0x54ecf2){return db[_0x50ca('0x22')][_0x50ca('0x57')](_0x54ecf2,{'transaction':_0x16b497});});}else{_0x135906=0x194;_0x297cc7=[];}});})[_0x50ca('0x15')](function(){if(_0x135906!==0x194){return db[_0x50ca('0x22')][_0x50ca('0x58')]({'where':{'isApp':!![],'VoiceExtensionId':_0x4ed94b},'order':'cast(priority\x20as\x20unsigned)'})[_0x50ca('0x15')](function(_0x3cc41d){_0x297cc7=_0x3cc41d;});}})['catch'](function(_0x6716c2){_0x135906=0x1f4;logger['error'](_0x6716c2[_0x50ca('0x59')]);if(_0x6716c2['name']){delete _0x6716c2['name'];}_0x297cc7=_0x6716c2;})[_0x50ca('0x5a')](function(){if(_0x297cc7===null){_0x1cebef[_0x50ca('0xb')](_0x135906);}else{if(_0x135906===0x1f4){_0x1cebef[_0x50ca('0xc')](_0x135906)[_0x50ca('0x5b')](_0x297cc7);}else{_0x1cebef[_0x50ca('0xc')](_0x135906)[_0x50ca('0x13')](_0x297cc7);}}});}; \ No newline at end of file +var _0x432f=['socket.io-emitter','./voiceExtension.socket','sendStatus','status','end','json','offset','undefined','count','limit','set','Content-Range','destroy','then','get','InboundRoutes','inbound','OutboundRoutes','outbound','InternalRoutes','internal','ignore','value','find','type','name','stack','index','VoiceExtension','rawAttributes','fieldName','key','model','map','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','merge','VIRTUAL','filter','options','rows','catch','show','includeAll','params','body','exten','concat','create','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','autoAssociation','UserProfileResource','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','context','description','recordingFormat','cutdigits','mandatoryDisposition','alias','addApplications','sequelize','transaction','ISOLATION_LEVELS','READ_COMMITTED','findOne','createRouting','bulkCreate','findAndCountAll','cast(priority\x20as\x20unsigned)','send','lodash','../../components/parsers/qs','../../config/logger','../../mysqldb','defaults','redis','localhost'];(function(_0x5eef05,_0x1be989){var _0x56d4b8=function(_0x57993d){while(--_0x57993d){_0x5eef05['push'](_0x5eef05['shift']());}};_0x56d4b8(++_0x1be989);}(_0x432f,0xaf));var _0xf432=function(_0x279d37,_0x14de3f){_0x279d37=_0x279d37-0x0;var _0x530173=_0x432f[_0x279d37];return _0x530173;};'use strict';var _=require(_0xf432('0x0'));var Redis=require('ioredis');var qs=require(_0xf432('0x1'));var logger=require(_0xf432('0x2'))('api');var config=require('../../config/environment');var db=require(_0xf432('0x3'))['db'];config['redis']=_[_0xf432('0x4')](config[_0xf432('0x5')],{'host':_0xf432('0x6'),'port':0x18eb});var socket=require(_0xf432('0x7'))(new Redis(config[_0xf432('0x5')]));require(_0xf432('0x8'))['register'](socket);function respondWithStatusCode(_0x2cb9c3,_0x51afff){_0x51afff=_0x51afff||0xcc;return function(_0x4a5199){if(_0x4a5199){return _0x2cb9c3[_0xf432('0x9')](_0x51afff);}return _0x2cb9c3[_0xf432('0xa')](_0x51afff)[_0xf432('0xb')]();};}function respondWithResult(_0x16a0b6,_0x36bb00){_0x36bb00=_0x36bb00||0xc8;return function(_0x375571){if(_0x375571){return _0x16a0b6[_0xf432('0xa')](_0x36bb00)[_0xf432('0xc')](_0x375571);}};}function respondWithFilteredResult(_0x376446,_0x8122ed){return function(_0x13a77a){if(_0x13a77a){var _0x575f54=typeof _0x8122ed[_0xf432('0xd')]==='undefined'&&typeof _0x8122ed['limit']===_0xf432('0xe');var _0x4db4f7=_0x13a77a[_0xf432('0xf')];var _0xaa124c=_0x575f54?0x0:_0x8122ed[_0xf432('0xd')];var _0x33d8be=_0x575f54?_0x13a77a[_0xf432('0xf')]:_0x8122ed[_0xf432('0xd')]+_0x8122ed[_0xf432('0x10')];var _0x3a22b7;if(_0x33d8be>=_0x4db4f7){_0x33d8be=_0x4db4f7;_0x3a22b7=0xc8;}else{_0x3a22b7=0xce;}_0x376446[_0xf432('0xa')](_0x3a22b7);return _0x376446[_0xf432('0x11')](_0xf432('0x12'),_0xaa124c+'-'+_0x33d8be+'/'+_0x4db4f7)['json'](_0x13a77a);}return null;};}function removeEntity(_0x3bd97e){return function(_0x3b613e){if(_0x3b613e){return _0x3b613e[_0xf432('0x13')]()[_0xf432('0x14')](function(){var _0x194628=_0x3b613e[_0xf432('0x15')]({'plain':!![]});var _0x2144b0=[{'name':_0xf432('0x16'),'value':_0xf432('0x17'),'ignore':![]},{'name':_0xf432('0x18'),'value':_0xf432('0x19'),'ignore':![]},{'name':_0xf432('0x1a'),'value':_0xf432('0x1b'),'ignore':![]}];var _0x2436fd=_(_0x2144b0)['filter'](_0xf432('0x1c'))['map'](_0xf432('0x1d'))['value']();if(_['includes'](_0x2436fd,_0x194628['type'])){return;}var _0x279e0e=_[_0xf432('0x1e')](_0x2144b0,['value',_0x194628[_0xf432('0x1f')]])[_0xf432('0x20')];return db['UserProfileResource']['destroy']({'where':{'type':_0x279e0e,'resourceId':_0x194628['id']}})[_0xf432('0x14')](function(){return _0x3b613e;});})[_0xf432('0x14')](function(){_0x3bd97e[_0xf432('0xa')](0xcc)[_0xf432('0xb')]();});}};}function handleEntityNotFound(_0xb93b5d){return function(_0x23e9b0){if(!_0x23e9b0){_0xb93b5d[_0xf432('0x9')](0x194);}return _0x23e9b0;};}function handleError(_0x3e5dbd,_0x40465c){_0x40465c=_0x40465c||0x1f4;return function(_0x26fa79){logger['error'](_0x26fa79[_0xf432('0x21')]);if(_0x26fa79[_0xf432('0x20')]){delete _0x26fa79[_0xf432('0x20')];}_0x3e5dbd[_0xf432('0xa')](_0x40465c)['send'](_0x26fa79);};}exports[_0xf432('0x22')]=function(_0x1661ba,_0x2babdd){var _0x1075d6={},_0x4468a9={},_0x6f57be={'count':0x0,'rows':[]};var _0x242fb1=_['map'](db[_0xf432('0x23')][_0xf432('0x24')],function(_0x4c8188){return{'name':_0x4c8188[_0xf432('0x25')],'type':_0x4c8188['type'][_0xf432('0x26')]};});_0x4468a9[_0xf432('0x27')]=_[_0xf432('0x28')](_0x242fb1,_0xf432('0x20'));_0x4468a9[_0xf432('0x29')]=_[_0xf432('0x2a')](_0x1661ba[_0xf432('0x29')]);_0x4468a9[_0xf432('0x2b')]=_[_0xf432('0x2c')](_0x4468a9[_0xf432('0x27')],_0x4468a9[_0xf432('0x29')]);_0x1075d6[_0xf432('0x2d')]=_['intersection'](_0x4468a9[_0xf432('0x27')],qs[_0xf432('0x2e')](_0x1661ba[_0xf432('0x29')][_0xf432('0x2e')]));_0x1075d6[_0xf432('0x2d')]=_0x1075d6['attributes'][_0xf432('0x2f')]?_0x1075d6[_0xf432('0x2d')]:_0x4468a9[_0xf432('0x27')];if(!_0x1661ba[_0xf432('0x29')][_0xf432('0x30')](_0xf432('0x31'))){_0x1075d6[_0xf432('0x10')]=qs[_0xf432('0x10')](_0x1661ba['query'][_0xf432('0x10')]);_0x1075d6[_0xf432('0xd')]=qs[_0xf432('0xd')](_0x1661ba['query']['offset']);}_0x1075d6[_0xf432('0x32')]=qs[_0xf432('0x33')](_0x1661ba['query']['sort']);_0x1075d6[_0xf432('0x34')]=qs['filters'](_[_0xf432('0x35')](_0x1661ba['query'],_0x4468a9[_0xf432('0x2b')]),_0x242fb1);if(_0x1661ba['query']['filter']){_0x1075d6[_0xf432('0x34')]=_[_0xf432('0x36')](_0x1075d6[_0xf432('0x34')],{'$or':_[_0xf432('0x28')](_0x242fb1,function(_0x1b06fc){if(_0x1b06fc[_0xf432('0x1f')]!==_0xf432('0x37')){var _0x35f576={};_0x35f576[_0x1b06fc['name']]={'$like':'%'+_0x1661ba['query'][_0xf432('0x38')]+'%'};return _0x35f576;}})});}_0x1075d6=_[_0xf432('0x36')]({},_0x1075d6,_0x1661ba[_0xf432('0x39')]);var _0x536546={'where':_0x1075d6['where']};return db[_0xf432('0x23')][_0xf432('0xf')](_0x536546)[_0xf432('0x14')](function(_0x5ddc7d){_0x6f57be['count']=_0x5ddc7d;if(_0x1661ba['query']['includeAll']){_0x1075d6['include']=[{'all':!![]}];}return db[_0xf432('0x23')]['findAll'](_0x1075d6);})[_0xf432('0x14')](function(_0x7d861f){_0x6f57be[_0xf432('0x3a')]=_0x7d861f;return _0x6f57be;})[_0xf432('0x14')](respondWithFilteredResult(_0x2babdd,_0x1075d6))[_0xf432('0x3b')](handleError(_0x2babdd,null));};exports[_0xf432('0x3c')]=function(_0x172a47,_0x4cf2da){var _0x31c751={'raw':![],'where':{'id':_0x172a47['params']['id']}},_0x3d52e4={};_0x3d52e4[_0xf432('0x27')]=_[_0xf432('0x2a')](db[_0xf432('0x23')][_0xf432('0x24')]);_0x3d52e4[_0xf432('0x29')]=_[_0xf432('0x2a')](_0x172a47[_0xf432('0x29')]);_0x3d52e4[_0xf432('0x2b')]=_['intersection'](_0x3d52e4[_0xf432('0x27')],_0x3d52e4[_0xf432('0x29')]);_0x31c751[_0xf432('0x2d')]=_[_0xf432('0x2c')](_0x3d52e4[_0xf432('0x27')],qs[_0xf432('0x2e')](_0x172a47[_0xf432('0x29')][_0xf432('0x2e')]));_0x31c751[_0xf432('0x2d')]=_0x31c751['attributes']['length']?_0x31c751[_0xf432('0x2d')]:_0x3d52e4[_0xf432('0x27')];if(_0x172a47[_0xf432('0x29')][_0xf432('0x3d')]){_0x31c751['include']=[{'all':!![]}];}_0x31c751=_[_0xf432('0x36')]({},_0x31c751,_0x172a47[_0xf432('0x39')]);return db[_0xf432('0x23')][_0xf432('0x1e')](_0x31c751)['then'](handleEntityNotFound(_0x4cf2da,null))['then'](respondWithResult(_0x4cf2da,null))[_0xf432('0x3b')](handleError(_0x4cf2da,null));};exports[_0xf432('0x13')]=function(_0x5b4cce,_0xe40f55){return db[_0xf432('0x23')][_0xf432('0x1e')]({'where':{'id':_0x5b4cce[_0xf432('0x3e')]['id']}})[_0xf432('0x14')](handleEntityNotFound(_0xe40f55,null))[_0xf432('0x14')](removeEntity(_0xe40f55,null))[_0xf432('0x3b')](handleError(_0xe40f55,null));};exports['create']=function(_0x153874,_0x3aadc6){if(_0x153874[_0xf432('0x3f')]['type']===_0xf432('0x19')&&!_['startsWith'](_0x153874[_0xf432('0x3f')][_0xf432('0x40')],'_')){_0x153874[_0xf432('0x3f')][_0xf432('0x40')]='_'[_0xf432('0x41')](_0x153874[_0xf432('0x3f')][_0xf432('0x40')]);}return db[_0xf432('0x23')][_0xf432('0x42')](_0x153874[_0xf432('0x3f')],{'raw':![]})[_0xf432('0x14')](function(_0x4b9fcd){var _0x2a4ba8=_0x153874[_0xf432('0x43')][_0xf432('0x15')]({'plain':!![]});if(!_0x2a4ba8)throw new Error(_0xf432('0x44'));if(_0x2a4ba8['role']===_0xf432('0x43')){var _0x3b33f4=_0x4b9fcd['get']({'plain':!![]});var _0x3094f9=[{'name':_0xf432('0x16'),'value':'inbound'},{'name':_0xf432('0x18'),'value':_0xf432('0x19')},{'name':_0xf432('0x1a'),'value':'internal'}];var _0x210d93=_[_0xf432('0x1e')](_0x3094f9,[_0xf432('0x1d'),_0x3b33f4['type']])[_0xf432('0x20')];return db['UserProfileSection']['find']({'where':{'name':_0x210d93,'userProfileId':_0x2a4ba8['userProfileId']},'raw':!![]})[_0xf432('0x14')](function(_0x1810a2){if(_0x1810a2&&_0x1810a2[_0xf432('0x45')]===0x0){return db[_0xf432('0x46')][_0xf432('0x42')]({'name':_0x3b33f4[_0xf432('0x20')],'resourceId':_0x3b33f4['id'],'type':_0x1810a2[_0xf432('0x20')],'sectionId':_0x1810a2['id']},{})[_0xf432('0x14')](function(){return _0x4b9fcd;});}else{return _0x4b9fcd;}})[_0xf432('0x3b')](function(_0x1d5dc5){logger[_0xf432('0x47')](_0xf432('0x48'),_0x1d5dc5);throw _0x1d5dc5;});}return _0x4b9fcd;})[_0xf432('0x14')](respondWithResult(_0x3aadc6,0xc9))[_0xf432('0x3b')](handleError(_0x3aadc6,null));};exports[_0xf432('0x49')]=function(_0x45f76f,_0x5cb8e8){if(_0x45f76f[_0xf432('0x3f')]['id']){delete _0x45f76f[_0xf432('0x3f')]['id'];}return db[_0xf432('0x23')][_0xf432('0x1e')]({'where':{'id':_0x45f76f[_0xf432('0x3e')]['id']}})['then'](handleEntityNotFound(_0x5cb8e8,null))[_0xf432('0x14')](function(_0x29b637){if(_0x29b637){return db[_0xf432('0x23')][_0xf432('0x49')](_[_0xf432('0x35')](_0x45f76f['body'],[_0xf432('0x40'),_0xf432('0x4a'),_0xf432('0x4b'),_0xf432('0x4c'),_0xf432('0x4d'),_0xf432('0x4e'),_0xf432('0x4f')]),{'where':{'context':_0x29b637[_0xf432('0x4a')],'exten':_0x29b637['exten']},'individualHooks':!![]})[_0xf432('0x14')](function(_0x189b10){return _0x189b10;});}return null;})[_0xf432('0x14')](respondWithStatusCode(_0x5cb8e8,null))['catch'](handleError(_0x5cb8e8,null));};exports[_0xf432('0x50')]=function(_0x1cdfff,_0x5c54f9){var _0x3b1561=_0x1cdfff['params']['id'];var _0x517569=_0x1cdfff[_0xf432('0x3f')];var _0x46aa5d=0xc8;var _0x3b59b0=null;return db[_0xf432('0x51')][_0xf432('0x52')]({'isolationLevel':db[_0xf432('0x51')]['Transaction'][_0xf432('0x53')][_0xf432('0x54')]},function(_0x165d1c){return db['VoiceExtension'][_0xf432('0x55')]({'where':{'id':_0x3b1561},'transaction':_0x165d1c})['then'](function(_0x26feec){if(_0x26feec){return db[_0xf432('0x23')][_0xf432('0x13')]({'where':{'VoiceExtensionId':_0x3b1561},'transaction':_0x165d1c})[_0xf432('0x14')](function(){var _0x3bd7bd=_['map'](_0x517569,function(_0x5541da){_0x5541da['VoiceExtensionId']=_0x3b1561;_0x5541da['isApp']=!![];return _0x5541da;});return _0x26feec[_0xf432('0x56')](_0x3bd7bd);})[_0xf432('0x14')](function(_0x89db39){return db[_0xf432('0x23')][_0xf432('0x57')](_0x89db39,{'transaction':_0x165d1c});});}else{_0x46aa5d=0x194;_0x3b59b0=[];}});})[_0xf432('0x14')](function(){if(_0x46aa5d!==0x194){return db['VoiceExtension'][_0xf432('0x58')]({'where':{'isApp':!![],'VoiceExtensionId':_0x3b1561},'order':_0xf432('0x59')})['then'](function(_0x5aa5ba){_0x3b59b0=_0x5aa5ba;});}})[_0xf432('0x3b')](function(_0x184c1a){_0x46aa5d=0x1f4;logger[_0xf432('0x47')](_0x184c1a['stack']);if(_0x184c1a[_0xf432('0x20')]){delete _0x184c1a[_0xf432('0x20')];}_0x3b59b0=_0x184c1a;})['finally'](function(){if(_0x3b59b0===null){_0x5c54f9[_0xf432('0x9')](_0x46aa5d);}else{if(_0x46aa5d===0x1f4){_0x5c54f9[_0xf432('0xa')](_0x46aa5d)[_0xf432('0x5a')](_0x3b59b0);}else{_0x5c54f9[_0xf432('0xa')](_0x46aa5d)[_0xf432('0xc')](_0x3b59b0);}}});}; \ No newline at end of file diff --git a/server/api/voiceExtension/voiceExtension.events.js b/server/api/voiceExtension/voiceExtension.events.js index 7b63192..336d144 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 _0x96ae=['exports','events','../../mysqldb','VoiceExtension','setMaxListeners','save','update','remove','emit','hasOwnProperty','hook'];(function(_0x599f41,_0x4db732){var _0x2e4d58=function(_0x14c882){while(--_0x14c882){_0x599f41['push'](_0x599f41['shift']());}};_0x2e4d58(++_0x4db732);}(_0x96ae,0x1cf));var _0xe96a=function(_0x306626,_0x425e93){_0x306626=_0x306626-0x0;var _0x466728=_0x96ae[_0x306626];return _0x466728;};'use strict';var EventEmitter=require(_0xe96a('0x0'));var VoiceExtension=require(_0xe96a('0x1'))['db'][_0xe96a('0x2')];var VoiceExtensionEvents=new EventEmitter();VoiceExtensionEvents[_0xe96a('0x3')](0x0);var events={'afterCreate':_0xe96a('0x4'),'afterUpdate':_0xe96a('0x5'),'afterDestroy':_0xe96a('0x6')};function emitEvent(_0xeea681){return function(_0x141bde,_0x197173,_0x4a1ae9){VoiceExtensionEvents[_0xe96a('0x7')](_0xeea681+':'+_0x141bde['id'],_0x141bde);VoiceExtensionEvents[_0xe96a('0x7')](_0xeea681,_0x141bde);_0x4a1ae9(null);};}for(var e in events){if(events[_0xe96a('0x8')](e)){var event=events[e];VoiceExtension[_0xe96a('0x9')](e,emitEvent(event));}}module[_0xe96a('0xa')]=VoiceExtensionEvents; \ No newline at end of file +var _0x6d02=['hook','exports','events','../../mysqldb','VoiceExtension','setMaxListeners','update','remove','emit','hasOwnProperty'];(function(_0x2e1e61,_0x101335){var _0x544c98=function(_0x266d1e){while(--_0x266d1e){_0x2e1e61['push'](_0x2e1e61['shift']());}};_0x544c98(++_0x101335);}(_0x6d02,0x174));var _0x26d0=function(_0x2dafbe,_0x5d04de){_0x2dafbe=_0x2dafbe-0x0;var _0x58a45a=_0x6d02[_0x2dafbe];return _0x58a45a;};'use strict';var EventEmitter=require(_0x26d0('0x0'));var VoiceExtension=require(_0x26d0('0x1'))['db'][_0x26d0('0x2')];var VoiceExtensionEvents=new EventEmitter();VoiceExtensionEvents[_0x26d0('0x3')](0x0);var events={'afterCreate':'save','afterUpdate':_0x26d0('0x4'),'afterDestroy':_0x26d0('0x5')};function emitEvent(_0x1f4495){return function(_0x4fa825,_0x54e0ce,_0xbca429){VoiceExtensionEvents[_0x26d0('0x6')](_0x1f4495+':'+_0x4fa825['id'],_0x4fa825);VoiceExtensionEvents[_0x26d0('0x6')](_0x1f4495,_0x4fa825);_0xbca429(null);};}for(var e in events){if(events[_0x26d0('0x7')](e)){var event=events[e];VoiceExtension[_0x26d0('0x8')](e,emitEvent(event));}}module[_0x26d0('0x9')]=VoiceExtensionEvents; \ No newline at end of file diff --git a/server/api/voiceExtension/voiceExtension.model.js b/server/api/voiceExtension/voiceExtension.model.js index 834cc91..c7aa7ad 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 _0x08b8=['type','CDR(type)=','exten','NoOp','alias','No\x20alias\x20set','inbound','push','Set','context','XCALLY-MOTION-ANSWER=0','MONITOR_OPTIONS=ab','outbound','CDR(type)=outbound','CDR(routeAlias)=','CDR(destination)=','cutdigits','${EXTEN:','${EXTEN}','$[${LEN(${CDR(prefix)})}\x20>\x200]?Goto(','):Goto(','XCALLY-MOTION-PROGRESS=0','outboundrouteid=','hasOwnProperty','recordingFormat','none','_XCALLY_MIXMONITOR_UNIQUEID=${UNIQUEID}','_XCALLY_MIXMONITOR_FORMAT=','timeout','url','split','length','name','phone','prefix','SIP','join','options','param','indexOf','U(xcally-mixmonitor-context)','replace','Interval','findAll','IntervalId','then','interval','*,*,*,*','intervals','map','filter','toLowerCase','tag','CDR(tag)=','ExecIf','$[${LEN(${PREFIX-CALLERIDALL})}\x20>\x200]?Set(CALLERID(all)=${PREFIX-CALLERIDALL}):','callerID','Set(CALLERID(all)=','NoOp(No\x20number\x20available)','answer','queue','app','appType','custom','XCALLY-MOTION-ANSWER=1','XCALLY-MOTION-PROGRESS=1','GotoIfTime',',${EXTEN},','agi','XMCS-UNIQUEID=${CHANNEL(LINKEDID)}','priority','last','concat','catch','define','VoiceExtension','voice_extensions','get','lodash','./voiceExtension.attributes','models'];(function(_0x4a710c,_0x1dd160){var _0x31c65d=function(_0x51869d){while(--_0x51869d){_0x4a710c['push'](_0x4a710c['shift']());}};_0x31c65d(++_0x1dd160);}(_0x08b8,0xf0));var _0x808b=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0x08b8[_0x321bb2];return _0x9c12ed;};'use strict';var _=require(_0x808b('0x0'));var attributes=require(_0x808b('0x1'));module['exports']=function(_0x13676f){var _0x32c07c=_0x13676f[_0x808b('0x2')];function _0x37d729(_0x2443fb){var _0x967ada=0x2;var _0x3b5024=[{'type':_0x2443fb[_0x808b('0x3')],'app':'Set','appdata':_0x808b('0x4')+_0x2443fb['type'],'context':_0x2443fb['context'],'exten':_0x2443fb[_0x808b('0x5')],'priority':_0x967ada++,'VoiceExtensionId':_0x2443fb['id']},{'type':_0x2443fb['type'],'app':_0x2443fb['alias']?'Set':_0x808b('0x6'),'appdata':_0x2443fb[_0x808b('0x7')]?'CDR(routeAlias)='+_0x2443fb['alias']:_0x808b('0x8'),'context':_0x2443fb['context'],'exten':_0x2443fb[_0x808b('0x5')],'priority':_0x967ada++,'VoiceExtensionId':_0x2443fb['id']}];if(_0x2443fb[_0x808b('0x3')]===_0x808b('0x9')){_0x3b5024[_0x808b('0xa')]({'type':'inbound','app':_0x808b('0xb'),'appdata':'CDR(routeid)='+_0x2443fb['id'],'context':_0x2443fb[_0x808b('0xc')],'exten':_0x2443fb['exten'],'priority':_0x967ada++,'VoiceExtensionId':_0x2443fb['id']});}_0x3b5024[_0x808b('0xa')]({'type':_0x2443fb[_0x808b('0x3')],'app':_0x808b('0xb'),'appdata':_0x808b('0xd'),'context':_0x2443fb[_0x808b('0xc')],'exten':_0x2443fb['exten'],'priority':_0x967ada++,'VoiceExtensionId':_0x2443fb['id']},{'type':_0x2443fb[_0x808b('0x3')],'app':_0x808b('0xb'),'appdata':'XCALLY-MOTION-PROGRESS=0','context':_0x2443fb[_0x808b('0xc')],'exten':_0x2443fb[_0x808b('0x5')],'priority':_0x967ada++,'VoiceExtensionId':_0x2443fb['id']},{'type':_0x2443fb[_0x808b('0x3')],'app':'Set','appdata':_0x808b('0xe'),'context':_0x2443fb['context'],'exten':_0x2443fb[_0x808b('0x5')],'priority':_0x967ada++,'VoiceExtensionId':_0x2443fb['id']});return _0x3b5024;}function _0x723da(_0x465386){var _0x202505=0x2;var _0x3a30af=[{'type':_0x808b('0xf'),'app':_0x808b('0xb'),'appdata':_0x808b('0x10'),'context':_0x465386[_0x808b('0xc')],'exten':_0x465386[_0x808b('0x5')],'priority':_0x202505++,'VoiceExtensionId':_0x465386['id']},{'type':_0x808b('0xf'),'app':_0x465386[_0x808b('0x7')]?_0x808b('0xb'):_0x808b('0x6'),'appdata':_0x465386['alias']?_0x808b('0x11')+_0x465386[_0x808b('0x7')]:'No\x20alias\x20set','context':_0x465386[_0x808b('0xc')],'exten':_0x465386[_0x808b('0x5')],'priority':_0x202505++,'VoiceExtensionId':_0x465386['id']},{'type':_0x808b('0xf'),'app':_0x808b('0xb'),'appdata':_0x808b('0x12')+(_0x465386[_0x808b('0x13')]?_0x808b('0x14')+_0x465386[_0x808b('0x13')]+'}':_0x808b('0x15')),'context':_0x465386[_0x808b('0xc')],'exten':_0x465386['exten'],'priority':_0x202505++,'VoiceExtensionId':_0x465386['id']},{'type':_0x808b('0xf'),'app':_0x808b('0xb'),'appdata':'CDR(routeid)='+_0x465386['id'],'context':_0x465386[_0x808b('0xc')],'exten':_0x465386[_0x808b('0x5')],'priority':_0x202505++,'VoiceExtensionId':_0x465386['id']},{'type':_0x808b('0xf'),'app':'ExecIf','appdata':_0x808b('0x16')+(_0x202505+0x2)+_0x808b('0x17')+(_0x202505+0x1)+')','context':_0x465386[_0x808b('0xc')],'exten':_0x465386[_0x808b('0x5')],'priority':_0x202505++,'VoiceExtensionId':_0x465386['id']},{'type':_0x808b('0xf'),'app':'Set','appdata':_0x465386[_0x808b('0x13')]?'CDR(prefix)=${EXTEN:0:'+_0x465386[_0x808b('0x13')]+'}':'CDR(prefix)=noprefix','context':_0x465386[_0x808b('0xc')],'exten':_0x465386[_0x808b('0x5')],'priority':_0x202505++,'VoiceExtensionId':_0x465386['id']},{'type':_0x808b('0xf'),'app':_0x808b('0xb'),'appdata':_0x808b('0xd'),'context':_0x465386[_0x808b('0xc')],'exten':_0x465386[_0x808b('0x5')],'priority':_0x202505++,'VoiceExtensionId':_0x465386['id']},{'type':_0x808b('0xf'),'app':_0x808b('0xb'),'appdata':_0x808b('0x18'),'context':_0x465386['context'],'exten':_0x465386['exten'],'priority':_0x202505++,'VoiceExtensionId':_0x465386['id']},{'type':'outbound','app':_0x808b('0xb'),'appdata':_0x808b('0xe'),'context':_0x465386['context'],'exten':_0x465386[_0x808b('0x5')],'priority':_0x202505++,'VoiceExtensionId':_0x465386['id']},{'type':_0x808b('0xf'),'app':_0x808b('0xb'),'appdata':_0x808b('0x19')+_0x465386['id'],'context':_0x465386[_0x808b('0xc')],'exten':_0x465386[_0x808b('0x5')],'priority':_0x202505++,'VoiceExtensionId':_0x465386['id']}];if(_0x465386[_0x808b('0x1a')](_0x808b('0x1b'))&&_0x465386['recordingFormat']!==_0x808b('0x1c')){_0x3a30af[_0x808b('0xa')]({'type':'outbound','app':_0x808b('0xb'),'appdata':_0x808b('0x1d'),'context':_0x465386['context'],'exten':_0x465386['exten'],'priority':_0x202505++,'VoiceExtensionId':_0x465386['id']},{'type':_0x808b('0xf'),'app':_0x808b('0xb'),'appdata':_0x808b('0x1e')+_0x465386[_0x808b('0x1b')]||'wav','context':_0x465386[_0x808b('0xc')],'exten':_0x465386['exten'],'priority':_0x202505++,'VoiceExtensionId':_0x465386['id']});}return _0x3a30af;}function _0x588f13(_0x28622e,_0x5bd917){var _0x3055cc=[{'name':'trunk','param':0x0},{'name':_0x808b('0x1f'),'param':0x1},{'name':'options','param':0x2},{'name':_0x808b('0x20'),'param':0x3}];var _0x12f549={};var _0x4e8f37=_0x5bd917[_0x808b('0x21')](',');var _0xe00f9b=[];for(var _0x48570d=0x0;_0x48570d<_0x3055cc[_0x808b('0x22')];_0x48570d++){switch(_0x3055cc[_0x48570d][_0x808b('0x23')]){case'trunk':_0x12f549['trunk']=_0x4e8f37[_0x3055cc[_0x48570d]['param']][_0x808b('0x21')]('/')[0x1];_0x12f549[_0x808b('0x24')]=_0x4e8f37[_0x3055cc[_0x48570d]['param']][_0x808b('0x21')]('/')[0x2];_0x12f549[_0x808b('0x25')]=_0x12f549[_0x808b('0x24')]?_0x12f549[_0x808b('0x24')][_0x808b('0x21')]('$')[0x0]:undefined;_0x12f549[_0x808b('0x24')]=_0x28622e[_0x808b('0x13')]?(_0x12f549['prefix']||'')+'${EXTEN:'+_0x28622e[_0x808b('0x13')]+'}':(_0x12f549[_0x808b('0x25')]||'')+'${EXTEN}';_0xe00f9b[_0x3055cc[_0x48570d]['param']]=[_0x808b('0x26'),_0x12f549['trunk'],_0x12f549['phone']][_0x808b('0x27')]('/');break;case _0x808b('0x28'):_0x12f549['options']=_0x4e8f37[_0x3055cc[_0x48570d][_0x808b('0x29')]];if(_0x28622e[_0x808b('0x1b')]!==_0x808b('0x1c')){if(_0x12f549[_0x808b('0x28')][_0x808b('0x2a')]('U(xcally-mixmonitor-context)')<0x0){_0x12f549[_0x808b('0x28')]+=_0x808b('0x2b');}}else{_0x12f549[_0x808b('0x28')]=_0x12f549[_0x808b('0x28')][_0x808b('0x2c')](_0x808b('0x2b'),'');}_0xe00f9b[_0x3055cc[_0x48570d][_0x808b('0x29')]]=_0x12f549[_0x808b('0x28')];break;default:_0xe00f9b[_0x3055cc[_0x48570d][_0x808b('0x29')]]=_0x4e8f37[_0x3055cc[_0x48570d][_0x808b('0x29')]];}}return _0xe00f9b[_0x808b('0x27')](',');}function _0x1ee3fd(_0x19cce0,_0x11f490,_0x398701){return new Promise(function(_0x50f31e,_0x211e4f){var _0x434c2=[];if(_['isEmpty'](_0x11f490))return _0x50f31e(_0x434c2);_0x32c07c[_0x808b('0x2d')][_0x808b('0x2e')]({'attributes':['id','interval',_0x808b('0x2f')],'raw':!![]})[_0x808b('0x30')](function(_0x13c870){for(var _0x4e3580=0x0,_0x137236=0x0;_0x4e3580<_0x11f490[_0x808b('0x22')];_0x4e3580++,_0x137236=0x0){var _0x32df31=_0x11f490[_0x4e3580];var _0x34d3d9=[];var _0x25f556=[];delete _0x32df31['id'];if(_0x32df31[_0x808b('0x31')]!==_0x808b('0x32')){_0x32df31[_0x808b('0x33')]=[_0x32df31[_0x808b('0x31')]];}else{_0x32df31[_0x808b('0x33')]=_0x32df31['IntervalId']?_[_0x808b('0x34')](_[_0x808b('0x35')](_0x13c870,{'IntervalId':_0x32df31[_0x808b('0x2f')]}),_0x808b('0x31')):[];}_0x32df31[_0x808b('0xc')]=_0x19cce0['context'];_0x32df31[_0x808b('0x5')]=_0x19cce0['exten'];if(_0x32df31[_0x808b('0x3')])_0x32df31[_0x808b('0x3')]=_0x32df31[_0x808b('0x3')][_0x808b('0x36')]();if(_0x19cce0['type']===_0x808b('0xf')){if(_0x32df31[_0x808b('0x1a')]('tag')&&_0x32df31[_0x808b('0x37')]&&_0x32df31[_0x808b('0x37')]!=='--'){_0x34d3d9[_0x808b('0xa')]({'type':_0x32df31[_0x808b('0x3')]['toLowerCase'](),'app':'Set','appdata':_0x808b('0x38')+_0x32df31[_0x808b('0x37')],'context':_0x19cce0[_0x808b('0xc')],'exten':_0x19cce0[_0x808b('0x5')],'priority':_0x32df31[_0x808b('0x33')][_0x808b('0x22')]+_0x398701+_0x137236++,'VoiceExtensionId':_0x19cce0['id']});}_0x34d3d9['push']({'type':_0x32df31[_0x808b('0x3')][_0x808b('0x36')](),'app':_0x808b('0x39'),'appdata':_0x808b('0x3a')+(_0x32df31[_0x808b('0x3b')]?_0x808b('0x3c')+_0x32df31['callerID']+')':_0x808b('0x3d')),'context':_0x19cce0[_0x808b('0xc')],'exten':_0x19cce0[_0x808b('0x5')],'priority':_0x32df31[_0x808b('0x33')][_0x808b('0x22')]+_0x398701+_0x137236++,'VoiceExtensionId':_0x19cce0['id']});}else{if(_0x32df31[_0x808b('0x1a')](_0x808b('0x3e'))){if([_0x808b('0x3f'),'playback']['includes'](_0x32df31[_0x808b('0x40')][_0x808b('0x36')]())&&_0x32df31[_0x808b('0x41')]!==_0x808b('0x42')){if(_0x32df31['answer']){_0x34d3d9['push']({'type':_0x32df31[_0x808b('0x3')][_0x808b('0x36')](),'app':_0x808b('0x39'),'appdata':'$[${XCALLY-MOTION-ANSWER}=0]?Answer','context':_0x19cce0[_0x808b('0xc')],'exten':_0x19cce0[_0x808b('0x5')],'priority':_0x32df31[_0x808b('0x33')][_0x808b('0x22')]+_0x398701+_0x137236++,'VoiceExtensionId':_0x19cce0['id']});_0x34d3d9[_0x808b('0xa')]({'type':_0x32df31[_0x808b('0x3')][_0x808b('0x36')](),'app':'Set','appdata':_0x808b('0x43'),'context':_0x19cce0[_0x808b('0xc')],'exten':_0x19cce0['exten'],'priority':_0x32df31[_0x808b('0x33')][_0x808b('0x22')]+_0x398701+_0x137236++,'VoiceExtensionId':_0x19cce0['id']});}else{_0x34d3d9['push']({'type':_0x32df31[_0x808b('0x3')][_0x808b('0x36')](),'app':'ExecIf','appdata':'$[${XCALLY-MOTION-PROGRESS}=0]?Progress','context':_0x19cce0['context'],'exten':_0x19cce0[_0x808b('0x5')],'priority':_0x32df31[_0x808b('0x33')][_0x808b('0x22')]+_0x398701+_0x137236++,'VoiceExtensionId':_0x19cce0['id']});_0x34d3d9[_0x808b('0xa')]({'type':_0x32df31['type'][_0x808b('0x36')](),'app':_0x808b('0xb'),'appdata':_0x808b('0x44'),'context':_0x19cce0[_0x808b('0xc')],'exten':_0x19cce0[_0x808b('0x5')],'priority':_0x32df31[_0x808b('0x33')]['length']+_0x398701+_0x137236++,'VoiceExtensionId':_0x19cce0['id']});}}}}for(var _0x5c00dd=0x0;_0x5c00dd<_0x32df31[_0x808b('0x33')]['length'];_0x5c00dd++){var _0x10480b=_0x398701+_0x32df31[_0x808b('0x33')][_0x808b('0x22')];var _0x33c6dc=_0x5c00dd===_0x32df31[_0x808b('0x33')][_0x808b('0x22')]-0x1?_0x398701+_0x34d3d9[_0x808b('0x22')]+_0x25f556[_0x808b('0x22')]+0x2:_0x398701+_0x5c00dd+0x1;_0x34d3d9['splice'](_0x5c00dd,0x0,{'type':_0x19cce0[_0x808b('0x3')],'app':_0x808b('0x45'),'appdata':_0x32df31[_0x808b('0x33')][_0x5c00dd]+'?'+_0x19cce0[_0x808b('0xc')]+_0x808b('0x46')+_0x10480b+':'+_0x19cce0['context']+_0x808b('0x46')+_0x33c6dc,'exten':_0x19cce0['exten'],'context':_0x19cce0['context'],'priority':_0x398701+_0x5c00dd,'VoiceExtensionId':_0x19cce0['id']});}if(_0x32df31[_0x808b('0x41')]==='outboundDial'){_0x32df31['appdata']=_0x588f13(_0x19cce0,_0x32df31['appdata']);}if(_0x32df31[_0x808b('0x41')]===_0x808b('0x47')){_0x34d3d9['push']({'type':_0x32df31['type']['toLowerCase'](),'app':_0x808b('0xb'),'appdata':_0x808b('0x48'),'context':_0x19cce0[_0x808b('0xc')],'exten':_0x19cce0['exten'],'priority':_0x32df31[_0x808b('0x33')][_0x808b('0x22')]+_0x398701+_0x137236++,'VoiceExtensionId':_0x19cce0['id']});}_0x32df31[_0x808b('0x49')]=_0x34d3d9[_0x808b('0x22')]?_[_0x808b('0x4a')](_0x34d3d9)[_0x808b('0x49')]+0x1:_0x398701;_0x434c2=_[_0x808b('0x4b')](_0x434c2,_0x34d3d9,[_0x32df31],_0x25f556);_0x398701=_[_0x808b('0x4a')](_0x434c2)[_0x808b('0x49')]+0x1;}return _0x50f31e(_0x434c2);})[_0x808b('0x4c')](function(_0x355f74){_0x211e4f(_0x355f74);});});}return _0x13676f[_0x808b('0x4d')](_0x808b('0x4e'),attributes,{'tableName':_0x808b('0x4f'),'paranoid':![],'indexes':[],'timestamps':!![],'instanceMethods':{'createRouting':function(_0x1b103d){var _0x556762=this[_0x808b('0x50')]({'plain':!![]});var _0x27ea03=_0x556762[_0x808b('0x3')]===_0x808b('0xf')?_0x723da(_0x556762):_0x37d729(_0x556762);return _0x1ee3fd(_0x556762,_0x1b103d,_[_0x808b('0x4a')](_0x27ea03)[_0x808b('0x49')]+0x1)[_0x808b('0x30')](function(_0x2897e2){var _0x378a3d=_[_0x808b('0x4b')](_0x27ea03,_0x2897e2);_0x378a3d[_0x808b('0xa')]({'type':_0x556762[_0x808b('0x3')],'app':'Hangup','exten':_0x556762[_0x808b('0x5')],'context':_0x556762['context'],'priority':_['last'](_0x378a3d)[_0x808b('0x49')]+0x1,'VoiceExtensionId':_0x556762['id']});return _0x378a3d;});}}});}; \ No newline at end of file +var _0x75f3=['filter','toLowerCase','tag','$[${LEN(${PREFIX-CALLERIDALL})}\x20>\x200]?Set(CALLERID(all)=${PREFIX-CALLERIDALL}):','callerID','Set(CALLERID(all)=','NoOp(No\x20number\x20available)','answer','queue','playback','appType','$[${XCALLY-MOTION-ANSWER}=0]?Answer','XCALLY-MOTION-ANSWER=1','$[${XCALLY-MOTION-PROGRESS}=0]?Progress','XCALLY-MOTION-PROGRESS=1','splice','GotoIfTime',',${EXTEN},','outboundDial','appdata','XMCS-UNIQUEID=${CHANNEL(LINKEDID)}','priority','last','catch','define','VoiceExtension','get','concat','Hangup','./voiceExtension.attributes','exports','type','Set','CDR(type)=','context','alias','CDR(routeAlias)=','No\x20alias\x20set','inbound','push','exten','XCALLY-MOTION-ANSWER=0','XCALLY-MOTION-PROGRESS=0','outbound','NoOp','CDR(destination)=','cutdigits','${EXTEN:','${EXTEN}','ExecIf','$[${LEN(${CDR(prefix)})}\x20>\x200]?Goto(','):Goto(','CDR(prefix)=${EXTEN:0:','CDR(prefix)=noprefix','MONITOR_OPTIONS=ab','outboundrouteid=','hasOwnProperty','recordingFormat','_XCALLY_MIXMONITOR_UNIQUEID=${UNIQUEID}','_XCALLY_MIXMONITOR_FORMAT=','wav','trunk','timeout','options','url','length','name','split','phone','param','prefix','SIP','join','indexOf','U(xcally-mixmonitor-context)','isEmpty','Interval','findAll','IntervalId','then','interval','*,*,*,*','intervals','map'];(function(_0x1928c9,_0x13a6d1){var _0x51b5fb=function(_0x24cf70){while(--_0x24cf70){_0x1928c9['push'](_0x1928c9['shift']());}};_0x51b5fb(++_0x13a6d1);}(_0x75f3,0xc5));var _0x375f=function(_0x28a31a,_0xc47e23){_0x28a31a=_0x28a31a-0x0;var _0x58ca5b=_0x75f3[_0x28a31a];return _0x58ca5b;};'use strict';var _=require('lodash');var attributes=require(_0x375f('0x0'));module[_0x375f('0x1')]=function(_0x545fd1){var _0x8c610e=_0x545fd1['models'];function _0xf56ecf(_0x5cb809){var _0x2fffb9=0x2;var _0x29c04e=[{'type':_0x5cb809[_0x375f('0x2')],'app':_0x375f('0x3'),'appdata':_0x375f('0x4')+_0x5cb809['type'],'context':_0x5cb809[_0x375f('0x5')],'exten':_0x5cb809['exten'],'priority':_0x2fffb9++,'VoiceExtensionId':_0x5cb809['id']},{'type':_0x5cb809[_0x375f('0x2')],'app':_0x5cb809[_0x375f('0x6')]?_0x375f('0x3'):'NoOp','appdata':_0x5cb809[_0x375f('0x6')]?_0x375f('0x7')+_0x5cb809[_0x375f('0x6')]:_0x375f('0x8'),'context':_0x5cb809[_0x375f('0x5')],'exten':_0x5cb809['exten'],'priority':_0x2fffb9++,'VoiceExtensionId':_0x5cb809['id']}];if(_0x5cb809[_0x375f('0x2')]===_0x375f('0x9')){_0x29c04e[_0x375f('0xa')]({'type':_0x375f('0x9'),'app':_0x375f('0x3'),'appdata':'CDR(routeid)='+_0x5cb809['id'],'context':_0x5cb809['context'],'exten':_0x5cb809[_0x375f('0xb')],'priority':_0x2fffb9++,'VoiceExtensionId':_0x5cb809['id']});}_0x29c04e[_0x375f('0xa')]({'type':_0x5cb809[_0x375f('0x2')],'app':'Set','appdata':_0x375f('0xc'),'context':_0x5cb809[_0x375f('0x5')],'exten':_0x5cb809[_0x375f('0xb')],'priority':_0x2fffb9++,'VoiceExtensionId':_0x5cb809['id']},{'type':_0x5cb809['type'],'app':_0x375f('0x3'),'appdata':_0x375f('0xd'),'context':_0x5cb809[_0x375f('0x5')],'exten':_0x5cb809[_0x375f('0xb')],'priority':_0x2fffb9++,'VoiceExtensionId':_0x5cb809['id']},{'type':_0x5cb809['type'],'app':_0x375f('0x3'),'appdata':'MONITOR_OPTIONS=ab','context':_0x5cb809[_0x375f('0x5')],'exten':_0x5cb809[_0x375f('0xb')],'priority':_0x2fffb9++,'VoiceExtensionId':_0x5cb809['id']});return _0x29c04e;}function _0x19ac41(_0x4692ca){var _0x169cbe=0x2;var _0x285d19=[{'type':_0x375f('0xe'),'app':_0x375f('0x3'),'appdata':'CDR(type)=outbound','context':_0x4692ca[_0x375f('0x5')],'exten':_0x4692ca[_0x375f('0xb')],'priority':_0x169cbe++,'VoiceExtensionId':_0x4692ca['id']},{'type':_0x375f('0xe'),'app':_0x4692ca[_0x375f('0x6')]?'Set':_0x375f('0xf'),'appdata':_0x4692ca['alias']?'CDR(routeAlias)='+_0x4692ca['alias']:_0x375f('0x8'),'context':_0x4692ca[_0x375f('0x5')],'exten':_0x4692ca['exten'],'priority':_0x169cbe++,'VoiceExtensionId':_0x4692ca['id']},{'type':_0x375f('0xe'),'app':'Set','appdata':_0x375f('0x10')+(_0x4692ca[_0x375f('0x11')]?_0x375f('0x12')+_0x4692ca[_0x375f('0x11')]+'}':_0x375f('0x13')),'context':_0x4692ca[_0x375f('0x5')],'exten':_0x4692ca[_0x375f('0xb')],'priority':_0x169cbe++,'VoiceExtensionId':_0x4692ca['id']},{'type':'outbound','app':_0x375f('0x3'),'appdata':'CDR(routeid)='+_0x4692ca['id'],'context':_0x4692ca['context'],'exten':_0x4692ca[_0x375f('0xb')],'priority':_0x169cbe++,'VoiceExtensionId':_0x4692ca['id']},{'type':'outbound','app':_0x375f('0x14'),'appdata':_0x375f('0x15')+(_0x169cbe+0x2)+_0x375f('0x16')+(_0x169cbe+0x1)+')','context':_0x4692ca['context'],'exten':_0x4692ca[_0x375f('0xb')],'priority':_0x169cbe++,'VoiceExtensionId':_0x4692ca['id']},{'type':_0x375f('0xe'),'app':_0x375f('0x3'),'appdata':_0x4692ca[_0x375f('0x11')]?_0x375f('0x17')+_0x4692ca[_0x375f('0x11')]+'}':_0x375f('0x18'),'context':_0x4692ca[_0x375f('0x5')],'exten':_0x4692ca[_0x375f('0xb')],'priority':_0x169cbe++,'VoiceExtensionId':_0x4692ca['id']},{'type':_0x375f('0xe'),'app':_0x375f('0x3'),'appdata':'XCALLY-MOTION-ANSWER=0','context':_0x4692ca[_0x375f('0x5')],'exten':_0x4692ca[_0x375f('0xb')],'priority':_0x169cbe++,'VoiceExtensionId':_0x4692ca['id']},{'type':_0x375f('0xe'),'app':_0x375f('0x3'),'appdata':'XCALLY-MOTION-PROGRESS=0','context':_0x4692ca['context'],'exten':_0x4692ca[_0x375f('0xb')],'priority':_0x169cbe++,'VoiceExtensionId':_0x4692ca['id']},{'type':_0x375f('0xe'),'app':_0x375f('0x3'),'appdata':_0x375f('0x19'),'context':_0x4692ca[_0x375f('0x5')],'exten':_0x4692ca[_0x375f('0xb')],'priority':_0x169cbe++,'VoiceExtensionId':_0x4692ca['id']},{'type':'outbound','app':_0x375f('0x3'),'appdata':_0x375f('0x1a')+_0x4692ca['id'],'context':_0x4692ca[_0x375f('0x5')],'exten':_0x4692ca['exten'],'priority':_0x169cbe++,'VoiceExtensionId':_0x4692ca['id']}];if(_0x4692ca[_0x375f('0x1b')](_0x375f('0x1c'))&&_0x4692ca[_0x375f('0x1c')]!=='none'){_0x285d19['push']({'type':_0x375f('0xe'),'app':_0x375f('0x3'),'appdata':_0x375f('0x1d'),'context':_0x4692ca[_0x375f('0x5')],'exten':_0x4692ca['exten'],'priority':_0x169cbe++,'VoiceExtensionId':_0x4692ca['id']},{'type':_0x375f('0xe'),'app':_0x375f('0x3'),'appdata':_0x375f('0x1e')+_0x4692ca['recordingFormat']||_0x375f('0x1f'),'context':_0x4692ca[_0x375f('0x5')],'exten':_0x4692ca[_0x375f('0xb')],'priority':_0x169cbe++,'VoiceExtensionId':_0x4692ca['id']});}return _0x285d19;}function _0x30ad1a(_0x32a20d,_0x527a99){var _0x4ce360=[{'name':_0x375f('0x20'),'param':0x0},{'name':_0x375f('0x21'),'param':0x1},{'name':_0x375f('0x22'),'param':0x2},{'name':_0x375f('0x23'),'param':0x3}];var _0x918d13={};var _0x2286b7=_0x527a99['split'](',');var _0x29ff10=[];for(var _0x15d8f4=0x0;_0x15d8f4<_0x4ce360[_0x375f('0x24')];_0x15d8f4++){switch(_0x4ce360[_0x15d8f4][_0x375f('0x25')]){case _0x375f('0x20'):_0x918d13['trunk']=_0x2286b7[_0x4ce360[_0x15d8f4]['param']][_0x375f('0x26')]('/')[0x1];_0x918d13[_0x375f('0x27')]=_0x2286b7[_0x4ce360[_0x15d8f4][_0x375f('0x28')]][_0x375f('0x26')]('/')[0x2];_0x918d13['prefix']=_0x918d13[_0x375f('0x27')]?_0x918d13[_0x375f('0x27')][_0x375f('0x26')]('$')[0x0]:undefined;_0x918d13[_0x375f('0x27')]=_0x32a20d[_0x375f('0x11')]?(_0x918d13[_0x375f('0x29')]||'')+_0x375f('0x12')+_0x32a20d[_0x375f('0x11')]+'}':(_0x918d13[_0x375f('0x29')]||'')+_0x375f('0x13');_0x29ff10[_0x4ce360[_0x15d8f4][_0x375f('0x28')]]=[_0x375f('0x2a'),_0x918d13[_0x375f('0x20')],_0x918d13[_0x375f('0x27')]][_0x375f('0x2b')]('/');break;case'options':_0x918d13[_0x375f('0x22')]=_0x2286b7[_0x4ce360[_0x15d8f4]['param']];if(_0x32a20d[_0x375f('0x1c')]!=='none'){if(_0x918d13[_0x375f('0x22')][_0x375f('0x2c')]('U(xcally-mixmonitor-context)')<0x0){_0x918d13['options']+=_0x375f('0x2d');}}else{_0x918d13[_0x375f('0x22')]=_0x918d13[_0x375f('0x22')]['replace'](_0x375f('0x2d'),'');}_0x29ff10[_0x4ce360[_0x15d8f4]['param']]=_0x918d13[_0x375f('0x22')];break;default:_0x29ff10[_0x4ce360[_0x15d8f4][_0x375f('0x28')]]=_0x2286b7[_0x4ce360[_0x15d8f4][_0x375f('0x28')]];}}return _0x29ff10[_0x375f('0x2b')](',');}function _0x48f716(_0x1551f8,_0xc8d928,_0x419161){return new Promise(function(_0x308531,_0x3593a2){var _0x193c93=[];if(_[_0x375f('0x2e')](_0xc8d928))return _0x308531(_0x193c93);_0x8c610e[_0x375f('0x2f')][_0x375f('0x30')]({'attributes':['id','interval',_0x375f('0x31')],'raw':!![]})[_0x375f('0x32')](function(_0x455b26){for(var _0x294217=0x0,_0x44d6c8=0x0;_0x294217<_0xc8d928[_0x375f('0x24')];_0x294217++,_0x44d6c8=0x0){var _0x10c0b3=_0xc8d928[_0x294217];var _0x2b0a29=[];var _0x3d902e=[];delete _0x10c0b3['id'];if(_0x10c0b3[_0x375f('0x33')]!==_0x375f('0x34')){_0x10c0b3['intervals']=[_0x10c0b3['interval']];}else{_0x10c0b3[_0x375f('0x35')]=_0x10c0b3[_0x375f('0x31')]?_[_0x375f('0x36')](_[_0x375f('0x37')](_0x455b26,{'IntervalId':_0x10c0b3[_0x375f('0x31')]}),'interval'):[];}_0x10c0b3[_0x375f('0x5')]=_0x1551f8[_0x375f('0x5')];_0x10c0b3['exten']=_0x1551f8['exten'];if(_0x10c0b3['type'])_0x10c0b3[_0x375f('0x2')]=_0x10c0b3['type'][_0x375f('0x38')]();if(_0x1551f8[_0x375f('0x2')]===_0x375f('0xe')){if(_0x10c0b3[_0x375f('0x1b')](_0x375f('0x39'))&&_0x10c0b3[_0x375f('0x39')]&&_0x10c0b3[_0x375f('0x39')]!=='--'){_0x2b0a29[_0x375f('0xa')]({'type':_0x10c0b3[_0x375f('0x2')][_0x375f('0x38')](),'app':_0x375f('0x3'),'appdata':'CDR(tag)='+_0x10c0b3[_0x375f('0x39')],'context':_0x1551f8[_0x375f('0x5')],'exten':_0x1551f8['exten'],'priority':_0x10c0b3[_0x375f('0x35')][_0x375f('0x24')]+_0x419161+_0x44d6c8++,'VoiceExtensionId':_0x1551f8['id']});}_0x2b0a29['push']({'type':_0x10c0b3[_0x375f('0x2')][_0x375f('0x38')](),'app':_0x375f('0x14'),'appdata':_0x375f('0x3a')+(_0x10c0b3[_0x375f('0x3b')]?_0x375f('0x3c')+_0x10c0b3[_0x375f('0x3b')]+')':_0x375f('0x3d')),'context':_0x1551f8['context'],'exten':_0x1551f8[_0x375f('0xb')],'priority':_0x10c0b3[_0x375f('0x35')]['length']+_0x419161+_0x44d6c8++,'VoiceExtensionId':_0x1551f8['id']});}else{if(_0x10c0b3['hasOwnProperty'](_0x375f('0x3e'))){if([_0x375f('0x3f'),_0x375f('0x40')]['includes'](_0x10c0b3['app']['toLowerCase']())&&_0x10c0b3[_0x375f('0x41')]!=='custom'){if(_0x10c0b3[_0x375f('0x3e')]){_0x2b0a29['push']({'type':_0x10c0b3[_0x375f('0x2')][_0x375f('0x38')](),'app':_0x375f('0x14'),'appdata':_0x375f('0x42'),'context':_0x1551f8[_0x375f('0x5')],'exten':_0x1551f8[_0x375f('0xb')],'priority':_0x10c0b3[_0x375f('0x35')][_0x375f('0x24')]+_0x419161+_0x44d6c8++,'VoiceExtensionId':_0x1551f8['id']});_0x2b0a29[_0x375f('0xa')]({'type':_0x10c0b3[_0x375f('0x2')][_0x375f('0x38')](),'app':'Set','appdata':_0x375f('0x43'),'context':_0x1551f8[_0x375f('0x5')],'exten':_0x1551f8['exten'],'priority':_0x10c0b3[_0x375f('0x35')]['length']+_0x419161+_0x44d6c8++,'VoiceExtensionId':_0x1551f8['id']});}else{_0x2b0a29['push']({'type':_0x10c0b3['type']['toLowerCase'](),'app':_0x375f('0x14'),'appdata':_0x375f('0x44'),'context':_0x1551f8[_0x375f('0x5')],'exten':_0x1551f8[_0x375f('0xb')],'priority':_0x10c0b3['intervals'][_0x375f('0x24')]+_0x419161+_0x44d6c8++,'VoiceExtensionId':_0x1551f8['id']});_0x2b0a29[_0x375f('0xa')]({'type':_0x10c0b3[_0x375f('0x2')]['toLowerCase'](),'app':'Set','appdata':_0x375f('0x45'),'context':_0x1551f8[_0x375f('0x5')],'exten':_0x1551f8['exten'],'priority':_0x10c0b3['intervals'][_0x375f('0x24')]+_0x419161+_0x44d6c8++,'VoiceExtensionId':_0x1551f8['id']});}}}}for(var _0xeef057=0x0;_0xeef057<_0x10c0b3['intervals'][_0x375f('0x24')];_0xeef057++){var _0x54bd21=_0x419161+_0x10c0b3[_0x375f('0x35')]['length'];var _0x4d159b=_0xeef057===_0x10c0b3[_0x375f('0x35')][_0x375f('0x24')]-0x1?_0x419161+_0x2b0a29[_0x375f('0x24')]+_0x3d902e[_0x375f('0x24')]+0x2:_0x419161+_0xeef057+0x1;_0x2b0a29[_0x375f('0x46')](_0xeef057,0x0,{'type':_0x1551f8[_0x375f('0x2')],'app':_0x375f('0x47'),'appdata':_0x10c0b3[_0x375f('0x35')][_0xeef057]+'?'+_0x1551f8[_0x375f('0x5')]+',${EXTEN},'+_0x54bd21+':'+_0x1551f8[_0x375f('0x5')]+_0x375f('0x48')+_0x4d159b,'exten':_0x1551f8[_0x375f('0xb')],'context':_0x1551f8['context'],'priority':_0x419161+_0xeef057,'VoiceExtensionId':_0x1551f8['id']});}if(_0x10c0b3[_0x375f('0x41')]===_0x375f('0x49')){_0x10c0b3[_0x375f('0x4a')]=_0x30ad1a(_0x1551f8,_0x10c0b3[_0x375f('0x4a')]);}if(_0x10c0b3[_0x375f('0x41')]==='agi'){_0x2b0a29['push']({'type':_0x10c0b3[_0x375f('0x2')]['toLowerCase'](),'app':_0x375f('0x3'),'appdata':_0x375f('0x4b'),'context':_0x1551f8['context'],'exten':_0x1551f8[_0x375f('0xb')],'priority':_0x10c0b3[_0x375f('0x35')][_0x375f('0x24')]+_0x419161+_0x44d6c8++,'VoiceExtensionId':_0x1551f8['id']});}_0x10c0b3[_0x375f('0x4c')]=_0x2b0a29[_0x375f('0x24')]?_[_0x375f('0x4d')](_0x2b0a29)[_0x375f('0x4c')]+0x1:_0x419161;_0x193c93=_['concat'](_0x193c93,_0x2b0a29,[_0x10c0b3],_0x3d902e);_0x419161=_[_0x375f('0x4d')](_0x193c93)['priority']+0x1;}return _0x308531(_0x193c93);})[_0x375f('0x4e')](function(_0x246248){_0x3593a2(_0x246248);});});}return _0x545fd1[_0x375f('0x4f')](_0x375f('0x50'),attributes,{'tableName':'voice_extensions','paranoid':![],'indexes':[],'timestamps':!![],'instanceMethods':{'createRouting':function(_0x414a9b){var _0x436453=this[_0x375f('0x51')]({'plain':!![]});var _0x3d1731=_0x436453[_0x375f('0x2')]==='outbound'?_0x19ac41(_0x436453):_0xf56ecf(_0x436453);return _0x48f716(_0x436453,_0x414a9b,_[_0x375f('0x4d')](_0x3d1731)[_0x375f('0x4c')]+0x1)[_0x375f('0x32')](function(_0x7f99a4){var _0xb5449d=_[_0x375f('0x52')](_0x3d1731,_0x7f99a4);_0xb5449d['push']({'type':_0x436453[_0x375f('0x2')],'app':_0x375f('0x53'),'exten':_0x436453[_0x375f('0xb')],'context':_0x436453[_0x375f('0x5')],'priority':_[_0x375f('0x4d')](_0xb5449d)[_0x375f('0x4c')]+0x1,'VoiceExtensionId':_0x436453['id']});return _0xb5449d;});}}});}; \ No newline at end of file diff --git a/server/api/voiceExtension/voiceExtension.rpc.js b/server/api/voiceExtension/voiceExtension.rpc.js index cf6ad2e..d3de66c 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 _0x814b=['include','map','model','attributes','then','info','GetVoiceExtension','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','redis','defaults','localhost','socket.io-emitter','./voiceExtension.socket','register','request','VoiceExtension,\x20%s,\x20%s','request\x20sent','debug','VoiceExtension,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','findAll','options','raw','where','limit'];(function(_0x2f32fd,_0x51c18c){var _0x16826c=function(_0x5a75b1){while(--_0x5a75b1){_0x2f32fd['push'](_0x2f32fd['shift']());}};_0x16826c(++_0x51c18c);}(_0x814b,0x1a2));var _0xb814=function(_0x54381d,_0x247b2c){_0x54381d=_0x54381d-0x0;var _0x5308a7=_0x814b[_0x54381d];return _0x5308a7;};'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});config[_0xb814('0xc')]=_[_0xb814('0xd')](config['redis'],{'host':_0xb814('0xe'),'port':0x18eb});var socket=require(_0xb814('0xf'))(new Redis(config[_0xb814('0xc')]));require(_0xb814('0x10'))[_0xb814('0x11')](socket);function respondWithRpcPromise(_0x21d4a5,_0x1086f8,_0x19aad8){return new BPromise(function(_0x207dbc,_0x3450f2){return client[_0xb814('0x12')](_0x21d4a5,_0x19aad8)['then'](function(_0x43dfe6){logger['info'](_0xb814('0x13'),_0x1086f8,_0xb814('0x14'));logger[_0xb814('0x15')](_0xb814('0x16'),_0x1086f8,_0xb814('0x14'),JSON[_0xb814('0x17')](_0x43dfe6));if(_0x43dfe6[_0xb814('0x18')]){if(_0x43dfe6[_0xb814('0x18')][_0xb814('0x19')]===0x1f4){logger[_0xb814('0x18')](_0xb814('0x13'),_0x1086f8,_0x43dfe6[_0xb814('0x18')][_0xb814('0x1a')]);return _0x3450f2(_0x43dfe6[_0xb814('0x18')][_0xb814('0x1a')]);}logger[_0xb814('0x18')](_0xb814('0x13'),_0x1086f8,_0x43dfe6[_0xb814('0x18')][_0xb814('0x1a')]);return _0x207dbc(_0x43dfe6[_0xb814('0x18')][_0xb814('0x1a')]);}else{logger['info'](_0xb814('0x13'),_0x1086f8,'request\x20sent');_0x207dbc(_0x43dfe6[_0xb814('0x1b')][_0xb814('0x1a')]);}})['catch'](function(_0x4b55a7){logger['error'](_0xb814('0x13'),_0x1086f8,_0x4b55a7);_0x3450f2(_0x4b55a7);});});}exports['GetVoiceExtension']=function(_0x57c128){var _0xb684ea=this;return new Promise(function(_0x24211d,_0x25b6b6){return db['VoiceExtension'][_0xb814('0x1c')]({'raw':_0x57c128['options']?_0x57c128[_0xb814('0x1d')][_0xb814('0x1e')]===undefined?!![]:![]:!![],'where':_0x57c128[_0xb814('0x1d')]?_0x57c128[_0xb814('0x1d')][_0xb814('0x1f')]||null:null,'attributes':_0x57c128[_0xb814('0x1d')]?_0x57c128[_0xb814('0x1d')]['attributes']||null:null,'limit':_0x57c128[_0xb814('0x1d')]?_0x57c128['options'][_0xb814('0x20')]||null:null,'include':_0x57c128[_0xb814('0x1d')]?_0x57c128[_0xb814('0x1d')][_0xb814('0x21')]?_[_0xb814('0x22')](_0x57c128[_0xb814('0x1d')][_0xb814('0x21')],function(_0x5755ea){return{'model':db[_0x5755ea[_0xb814('0x23')]],'as':_0x5755ea['as'],'attributes':_0x5755ea[_0xb814('0x24')],'include':_0x5755ea[_0xb814('0x21')]?_[_0xb814('0x22')](_0x5755ea[_0xb814('0x21')],function(_0x1d5965){return{'model':db[_0x1d5965[_0xb814('0x23')]],'as':_0x1d5965['as'],'attributes':_0x1d5965[_0xb814('0x24')],'include':_0x1d5965['include']?_[_0xb814('0x22')](_0x1d5965[_0xb814('0x21')],function(_0x52ed64){return{'model':db[_0x52ed64[_0xb814('0x23')]],'as':_0x52ed64['as'],'attributes':_0x52ed64[_0xb814('0x24')]};}):[]};}):[]};}):[]:[]})[_0xb814('0x25')](function(_0x499f22){logger[_0xb814('0x26')](_0xb814('0x27'),_0x57c128);logger['debug'](_0xb814('0x27'),_0x57c128,JSON['stringify'](_0x499f22));_0x24211d(_0x499f22);})[_0xb814('0x28')](function(_0x5f3e9b){logger['error'](_0xb814('0x27'),_0x5f3e9b['message'],_0x57c128);_0x25b6b6(_0xb684ea[_0xb814('0x18')](0x1f4,_0x5f3e9b[_0xb814('0x1a')]));});});}; \ No newline at end of file +var _0x292c=['../../config/logger','jayson/promise','client','http','redis','defaults','localhost','socket.io-emitter','./voiceExtension.socket','then','info','VoiceExtension,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','catch','GetVoiceExtension','VoiceExtension','findAll','options','raw','where','attributes','limit','map','model','include','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb'];(function(_0x65c50e,_0x1aa926){var _0x4573e7=function(_0x5bc049){while(--_0x5bc049){_0x65c50e['push'](_0x65c50e['shift']());}};_0x4573e7(++_0x1aa926);}(_0x292c,0x66));var _0xc292=function(_0x5c6994,_0x19ad9a){_0x5c6994=_0x5c6994-0x0;var _0x1d5c84=_0x292c[_0x5c6994];return _0x1d5c84;};'use strict';var _=require(_0xc292('0x0'));var util=require('util');var moment=require(_0xc292('0x1'));var BPromise=require(_0xc292('0x2'));var rs=require(_0xc292('0x3'));var fs=require('fs');var Redis=require(_0xc292('0x4'));var db=require(_0xc292('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0xc292('0x6'))('rpc');var config=require('../../config/environment');var jayson=require(_0xc292('0x7'));var client=jayson[_0xc292('0x8')][_0xc292('0x9')]({'port':0x232a});config[_0xc292('0xa')]=_[_0xc292('0xb')](config[_0xc292('0xa')],{'host':_0xc292('0xc'),'port':0x18eb});var socket=require(_0xc292('0xd'))(new Redis(config[_0xc292('0xa')]));require(_0xc292('0xe'))['register'](socket);function respondWithRpcPromise(_0x1be13f,_0x659c9a,_0x45fe79){return new BPromise(function(_0x25d1f0,_0x556537){return client['request'](_0x1be13f,_0x45fe79)[_0xc292('0xf')](function(_0x215ae7){logger[_0xc292('0x10')](_0xc292('0x11'),_0x659c9a,_0xc292('0x12'));logger[_0xc292('0x13')]('VoiceExtension,\x20%s,\x20%s,\x20%s',_0x659c9a,_0xc292('0x12'),JSON[_0xc292('0x14')](_0x215ae7));if(_0x215ae7[_0xc292('0x15')]){if(_0x215ae7[_0xc292('0x15')][_0xc292('0x16')]===0x1f4){logger['error']('VoiceExtension,\x20%s,\x20%s',_0x659c9a,_0x215ae7[_0xc292('0x15')][_0xc292('0x17')]);return _0x556537(_0x215ae7['error'][_0xc292('0x17')]);}logger['error']('VoiceExtension,\x20%s,\x20%s',_0x659c9a,_0x215ae7[_0xc292('0x15')]['message']);return _0x25d1f0(_0x215ae7[_0xc292('0x15')][_0xc292('0x17')]);}else{logger[_0xc292('0x10')]('VoiceExtension,\x20%s,\x20%s',_0x659c9a,_0xc292('0x12'));_0x25d1f0(_0x215ae7['result']['message']);}})[_0xc292('0x18')](function(_0x502f23){logger['error'](_0xc292('0x11'),_0x659c9a,_0x502f23);_0x556537(_0x502f23);});});}exports[_0xc292('0x19')]=function(_0x314f3b){var _0x5a9873=this;return new Promise(function(_0x4b7c83,_0x29b51a){return db[_0xc292('0x1a')][_0xc292('0x1b')]({'raw':_0x314f3b[_0xc292('0x1c')]?_0x314f3b[_0xc292('0x1c')][_0xc292('0x1d')]===undefined?!![]:![]:!![],'where':_0x314f3b[_0xc292('0x1c')]?_0x314f3b[_0xc292('0x1c')][_0xc292('0x1e')]||null:null,'attributes':_0x314f3b['options']?_0x314f3b['options'][_0xc292('0x1f')]||null:null,'limit':_0x314f3b[_0xc292('0x1c')]?_0x314f3b['options'][_0xc292('0x20')]||null:null,'include':_0x314f3b[_0xc292('0x1c')]?_0x314f3b[_0xc292('0x1c')]['include']?_[_0xc292('0x21')](_0x314f3b[_0xc292('0x1c')]['include'],function(_0x4eb30e){return{'model':db[_0x4eb30e[_0xc292('0x22')]],'as':_0x4eb30e['as'],'attributes':_0x4eb30e[_0xc292('0x1f')],'include':_0x4eb30e['include']?_['map'](_0x4eb30e['include'],function(_0x3933c6){return{'model':db[_0x3933c6[_0xc292('0x22')]],'as':_0x3933c6['as'],'attributes':_0x3933c6['attributes'],'include':_0x3933c6[_0xc292('0x23')]?_['map'](_0x3933c6[_0xc292('0x23')],function(_0x20452e){return{'model':db[_0x20452e['model']],'as':_0x20452e['as'],'attributes':_0x20452e['attributes']};}):[]};}):[]};}):[]:[]})[_0xc292('0xf')](function(_0x100cf2){logger['info']('GetVoiceExtension',_0x314f3b);logger[_0xc292('0x13')]('GetVoiceExtension',_0x314f3b,JSON[_0xc292('0x14')](_0x100cf2));_0x4b7c83(_0x100cf2);})[_0xc292('0x18')](function(_0x2f7735){logger['error'](_0xc292('0x19'),_0x2f7735[_0xc292('0x17')],_0x314f3b);_0x29b51a(_0x5a9873[_0xc292('0x15')](0x1f4,_0x2f7735[_0xc292('0x17')]));});});}; \ No newline at end of file diff --git a/server/api/voiceExtension/voiceExtension.socket.js b/server/api/voiceExtension/voiceExtension.socket.js index f453166..113c703 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 _0x1261=['save','remove','update','emit','removeListener','voiceExtension:'];(function(_0x4125e8,_0x2ab373){var _0x53cb6d=function(_0x6aee8a){while(--_0x6aee8a){_0x4125e8['push'](_0x4125e8['shift']());}};_0x53cb6d(++_0x2ab373);}(_0x1261,0x144));var _0x1126=function(_0x14e001,_0x569bf){_0x14e001=_0x14e001-0x0;var _0x2c09da=_0x1261[_0x14e001];return _0x2c09da;};'use strict';var VoiceExtensionEvents=require('./voiceExtension.events');var events=[_0x1126('0x0'),_0x1126('0x1'),_0x1126('0x2')];function createListener(_0x331a2c,_0x39b786){return function(_0x350f3a){_0x39b786[_0x1126('0x3')](_0x331a2c,_0x350f3a);};}function removeListener(_0x4245ca,_0x21a480){return function(){VoiceExtensionEvents[_0x1126('0x4')](_0x4245ca,_0x21a480);};}exports['register']=function(_0x5c68c8){for(var _0x40ba58=0x0,_0x907180=events['length'];_0x40ba58<_0x907180;_0x40ba58++){var _0x17e5f0=events[_0x40ba58];var _0x28772d=createListener(_0x1126('0x5')+_0x17e5f0,_0x5c68c8);VoiceExtensionEvents['on'](_0x17e5f0,_0x28772d);}}; \ No newline at end of file +var _0x5fc3=['./voiceExtension.events','save','update','emit','removeListener','register','voiceExtension:'];(function(_0x328875,_0x12b0f9){var _0x41fb3f=function(_0x1506b3){while(--_0x1506b3){_0x328875['push'](_0x328875['shift']());}};_0x41fb3f(++_0x12b0f9);}(_0x5fc3,0xa8));var _0x35fc=function(_0x1ae4a9,_0x4c0ed9){_0x1ae4a9=_0x1ae4a9-0x0;var _0x54d0b0=_0x5fc3[_0x1ae4a9];return _0x54d0b0;};'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 diff --git a/server/api/voiceMail/index.js b/server/api/voiceMail/index.js index c3f5449..35b2070 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 _0x5496=['fs-extra','../../components/interaction/service','../../config/environment','./voiceMail.controller','index','get','isAuthenticated','show','getMessages','post','create','put','update','delete','/:id','destroy','multer','util','path','connect-timeout','express'];(function(_0xba7bca,_0x477e46){var _0x2bf83d=function(_0x3b4f73){while(--_0x3b4f73){_0xba7bca['push'](_0xba7bca['shift']());}};_0x2bf83d(++_0x477e46);}(_0x5496,0x175));var _0x6549=function(_0x174067,_0x166f3e){_0x174067=_0x174067-0x0;var _0x48feb0=_0x5496[_0x174067];return _0x48feb0;};'use strict';var multer=require(_0x6549('0x0'));var util=require(_0x6549('0x1'));var path=require(_0x6549('0x2'));var timeout=require(_0x6549('0x3'));var express=require(_0x6549('0x4'));var router=express['Router']();var fs_extra=require(_0x6549('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0x6549('0x6'));var config=require(_0x6549('0x7'));var controller=require(_0x6549('0x8'));router['get']('/',auth['isAuthenticated'](),controller[_0x6549('0x9')]);router[_0x6549('0xa')]('/:id',auth[_0x6549('0xb')](),controller[_0x6549('0xc')]);router[_0x6549('0xa')]('/:id/messages',auth[_0x6549('0xb')](),controller[_0x6549('0xd')]);router[_0x6549('0xe')]('/',auth[_0x6549('0xb')](),controller[_0x6549('0xf')]);router[_0x6549('0x10')]('/:id',auth['isAuthenticated'](),controller[_0x6549('0x11')]);router[_0x6549('0x12')](_0x6549('0x13'),auth[_0x6549('0xb')](),controller[_0x6549('0x14')]);module['exports']=router; \ No newline at end of file +var _0x9fd4=['post','create','put','/:id','update','destroy','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','get','isAuthenticated','index','show','/:id/messages'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0x9fd4,0x16c));var _0x49fd=function(_0x37fcda,_0x2f5aa1){_0x37fcda=_0x37fcda-0x0;var _0xf5ed91=_0x9fd4[_0x37fcda];return _0xf5ed91;};'use strict';var multer=require(_0x49fd('0x0'));var util=require(_0x49fd('0x1'));var path=require(_0x49fd('0x2'));var timeout=require(_0x49fd('0x3'));var express=require(_0x49fd('0x4'));var router=express[_0x49fd('0x5')]();var fs_extra=require(_0x49fd('0x6'));var auth=require(_0x49fd('0x7'));var interaction=require(_0x49fd('0x8'));var config=require('../../config/environment');var controller=require('./voiceMail.controller');router[_0x49fd('0x9')]('/',auth[_0x49fd('0xa')](),controller[_0x49fd('0xb')]);router[_0x49fd('0x9')]('/:id',auth[_0x49fd('0xa')](),controller[_0x49fd('0xc')]);router[_0x49fd('0x9')](_0x49fd('0xd'),auth[_0x49fd('0xa')](),controller['getMessages']);router[_0x49fd('0xe')]('/',auth[_0x49fd('0xa')](),controller[_0x49fd('0xf')]);router[_0x49fd('0x10')](_0x49fd('0x11'),auth[_0x49fd('0xa')](),controller[_0x49fd('0x12')]);router['delete'](_0x49fd('0x11'),auth[_0x49fd('0xa')](),controller[_0x49fd('0x13')]);module[_0x49fd('0x14')]=router; \ No newline at end of file diff --git a/server/api/voiceMail/voiceMail.attributes.js b/server/api/voiceMail/voiceMail.attributes.js index 62163bd..5e69380 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 _0x7087=['from-voicemail','contest_mailbox','string','trim','central','ENUM','yes','TINYINT(4)','VIRTUAL','fullname','\x20-\x20','getDataValue','mailbox','sequelize','STRING'];(function(_0x352a3e,_0x13108c){var _0x51ef3f=function(_0xe7287b){while(--_0xe7287b){_0x352a3e['push'](_0x352a3e['shift']());}};_0x51ef3f(++_0x13108c);}(_0x7087,0x1c0));var _0x7708=function(_0x1ff7d0,_0xaa0357){_0x1ff7d0=_0x1ff7d0-0x0;var _0x321557=_0x7087[_0x1ff7d0];return _0x321557;};'use strict';var Sequelize=require(_0x7708('0x0'));module['exports']={'customer_id':{'type':Sequelize[_0x7708('0x1')]},'context':{'type':Sequelize[_0x7708('0x1')],'defaultValue':_0x7708('0x2'),'unique':_0x7708('0x3')},'mailbox':{'type':Sequelize[_0x7708('0x1')],'defaultValue':'','allowNull':![],'unique':_0x7708('0x3')},'password':{'type':Sequelize[_0x7708('0x1')]},'fullname':{'type':Sequelize['STRING']},'email':{'type':Sequelize[_0x7708('0x1')],'validate':{'isEmail':!![]},'set':function(_0x5c8624){this['setDataValue']('email',typeof _0x5c8624===_0x7708('0x4')&&_0x5c8624[_0x7708('0x5')]()?_0x5c8624['trim']():null);}},'pager':{'type':Sequelize[_0x7708('0x1')]},'tz':{'type':Sequelize[_0x7708('0x1')],'defaultValue':_0x7708('0x6')},'attach':{'type':Sequelize[_0x7708('0x7')](_0x7708('0x8'),'no'),'defaultValue':_0x7708('0x8'),'allowNull':![]},'saycid':{'type':Sequelize[_0x7708('0x7')](_0x7708('0x8'),'no'),'defaultValue':_0x7708('0x8'),'allowNull':![]},'dialout':{'type':Sequelize[_0x7708('0x1')]},'callback':{'type':Sequelize[_0x7708('0x1')]},'review':{'type':Sequelize[_0x7708('0x7')]('yes','no'),'defaultValue':'no','allowNull':![]},'operator':{'type':Sequelize[_0x7708('0x7')]('yes','no'),'defaultValue':'no','allowNull':![]},'envelope':{'type':Sequelize[_0x7708('0x7')](_0x7708('0x8'),'no'),'defaultValue':'no','allowNull':![]},'sayduration':{'type':Sequelize[_0x7708('0x7')](_0x7708('0x8'),'no'),'defaultValue':'no','allowNull':![]},'saydurationm':{'type':_0x7708('0x9'),'defaultValue':0x1,'allowNull':![]},'sendvoicemail':{'type':Sequelize['ENUM'](_0x7708('0x8'),'no'),'defaultValue':'no','allowNull':![]},'delete':{'type':Sequelize[_0x7708('0x7')](_0x7708('0x8'),'no'),'defaultValue':'no','allowNull':![]},'nextaftercmd':{'type':Sequelize[_0x7708('0x7')]('yes','no'),'defaultValue':'yes','allowNull':![]},'forcename':{'type':Sequelize[_0x7708('0x7')]('yes','no'),'defaultValue':'no','allowNull':![]},'forcegreetings':{'type':Sequelize[_0x7708('0x7')](_0x7708('0x8'),'no'),'defaultValue':'no','allowNull':![]},'hidefromdir':{'type':Sequelize[_0x7708('0x7')](_0x7708('0x8'),'no'),'defaultValue':_0x7708('0x8'),'allowNull':![]},'stamp':{'type':'TIMESTAMP'},'emailsubject':{'type':Sequelize[_0x7708('0x1')]},'emailbody':{'type':Sequelize[_0x7708('0x1')]},'maxsecs':{'type':Sequelize['INTEGER'](0xff),'defaultValue':0xb4,'allowNull':![]},'maxmsg':{'type':Sequelize['INTEGER'](0xff),'defaultValue':0x64,'allowNull':![]},'name':{'type':Sequelize[_0x7708('0xa')],'get':function(){return this['getDataValue'](_0x7708('0xb'))+_0x7708('0xc')+this[_0x7708('0xd')](_0x7708('0xe'));}}}; \ No newline at end of file +var _0x0819=['getDataValue','fullname','\x20-\x20','mailbox','exports','STRING','contest_mailbox','setDataValue','email','string','trim','central','ENUM','yes','TINYINT(4)','TIMESTAMP','INTEGER','VIRTUAL'];(function(_0x263204,_0x19286b){var _0xed3987=function(_0x282bf1){while(--_0x282bf1){_0x263204['push'](_0x263204['shift']());}};_0xed3987(++_0x19286b);}(_0x0819,0x1b4));var _0x9081=function(_0x51ea9f,_0xf5cb39){_0x51ea9f=_0x51ea9f-0x0;var _0x9fe61c=_0x0819[_0x51ea9f];return _0x9fe61c;};'use strict';var Sequelize=require('sequelize');module[_0x9081('0x0')]={'customer_id':{'type':Sequelize[_0x9081('0x1')]},'context':{'type':Sequelize['STRING'],'defaultValue':'from-voicemail','unique':_0x9081('0x2')},'mailbox':{'type':Sequelize['STRING'],'defaultValue':'','allowNull':![],'unique':_0x9081('0x2')},'password':{'type':Sequelize['STRING']},'fullname':{'type':Sequelize[_0x9081('0x1')]},'email':{'type':Sequelize[_0x9081('0x1')],'validate':{'isEmail':!![]},'set':function(_0x5cb34b){this[_0x9081('0x3')](_0x9081('0x4'),typeof _0x5cb34b===_0x9081('0x5')&&_0x5cb34b[_0x9081('0x6')]()?_0x5cb34b[_0x9081('0x6')]():null);}},'pager':{'type':Sequelize[_0x9081('0x1')]},'tz':{'type':Sequelize[_0x9081('0x1')],'defaultValue':_0x9081('0x7')},'attach':{'type':Sequelize[_0x9081('0x8')](_0x9081('0x9'),'no'),'defaultValue':_0x9081('0x9'),'allowNull':![]},'saycid':{'type':Sequelize[_0x9081('0x8')](_0x9081('0x9'),'no'),'defaultValue':_0x9081('0x9'),'allowNull':![]},'dialout':{'type':Sequelize[_0x9081('0x1')]},'callback':{'type':Sequelize[_0x9081('0x1')]},'review':{'type':Sequelize[_0x9081('0x8')](_0x9081('0x9'),'no'),'defaultValue':'no','allowNull':![]},'operator':{'type':Sequelize['ENUM'](_0x9081('0x9'),'no'),'defaultValue':'no','allowNull':![]},'envelope':{'type':Sequelize[_0x9081('0x8')](_0x9081('0x9'),'no'),'defaultValue':'no','allowNull':![]},'sayduration':{'type':Sequelize['ENUM']('yes','no'),'defaultValue':'no','allowNull':![]},'saydurationm':{'type':_0x9081('0xa'),'defaultValue':0x1,'allowNull':![]},'sendvoicemail':{'type':Sequelize['ENUM'](_0x9081('0x9'),'no'),'defaultValue':'no','allowNull':![]},'delete':{'type':Sequelize[_0x9081('0x8')](_0x9081('0x9'),'no'),'defaultValue':'no','allowNull':![]},'nextaftercmd':{'type':Sequelize[_0x9081('0x8')](_0x9081('0x9'),'no'),'defaultValue':_0x9081('0x9'),'allowNull':![]},'forcename':{'type':Sequelize[_0x9081('0x8')]('yes','no'),'defaultValue':'no','allowNull':![]},'forcegreetings':{'type':Sequelize['ENUM'](_0x9081('0x9'),'no'),'defaultValue':'no','allowNull':![]},'hidefromdir':{'type':Sequelize[_0x9081('0x8')](_0x9081('0x9'),'no'),'defaultValue':'yes','allowNull':![]},'stamp':{'type':_0x9081('0xb')},'emailsubject':{'type':Sequelize[_0x9081('0x1')]},'emailbody':{'type':Sequelize[_0x9081('0x1')]},'maxsecs':{'type':Sequelize[_0x9081('0xc')](0xff),'defaultValue':0xb4,'allowNull':![]},'maxmsg':{'type':Sequelize[_0x9081('0xc')](0xff),'defaultValue':0x64,'allowNull':![]},'name':{'type':Sequelize[_0x9081('0xd')],'get':function(){return this[_0x9081('0xe')](_0x9081('0xf'))+_0x9081('0x10')+this[_0x9081('0xe')](_0x9081('0x11'));}}}; \ No newline at end of file diff --git a/server/api/voiceMail/voiceMail.controller.js b/server/api/voiceMail/voiceMail.controller.js index 3693eed..f197e28 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 _0x087b=['catch','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','body','params','destroy','getMessages','findOne','hasOwnProperty','order','mailbox','VoiceMailMessage','eml-format','rimraf','request-promise','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','json','offset','limit','undefined','count','set','apply','reject','save','then','error','stack','name','send','index','VoiceMail','rawAttributes','fieldName','type','key','model','map','query','keys','filters','intersection','attributes','fields','length','nolimit','sort','pick','where','merge','options','includeAll','include','findAll','show','find','create','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','autoAssociation','UserProfileResource'];(function(_0x5311a1,_0x304912){var _0x2acb9f=function(_0x4803e7){while(--_0x4803e7){_0x5311a1['push'](_0x5311a1['shift']());}};_0x2acb9f(++_0x304912);}(_0x087b,0x11a));var _0xb087=function(_0x7e2eb0,_0x17cd58){_0x7e2eb0=_0x7e2eb0-0x0;var _0xd92de4=_0x087b[_0x7e2eb0];return _0xd92de4;};'use strict';var emlformat=require(_0xb087('0x0'));var rimraf=require(_0xb087('0x1'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0xb087('0x2'));var moment=require('moment');var BPromise=require(_0xb087('0x3'));var Mustache=require(_0xb087('0x4'));var util=require(_0xb087('0x5'));var path=require(_0xb087('0x6'));var sox=require(_0xb087('0x7'));var csv=require(_0xb087('0x8'));var ejs=require(_0xb087('0x9'));var fs=require('fs');var fs_extra=require(_0xb087('0xa'));var _=require(_0xb087('0xb'));var squel=require(_0xb087('0xc'));var crypto=require(_0xb087('0xd'));var jsforce=require(_0xb087('0xe'));var deskjs=require(_0xb087('0xf'));var toCsv=require(_0xb087('0x8'));var querystring=require(_0xb087('0x10'));var Papa=require(_0xb087('0x11'));var Redis=require(_0xb087('0x12'));var authService=require('../../components/auth/service');var qs=require(_0xb087('0x13'));var as=require(_0xb087('0x14'));var hardwareService=require(_0xb087('0x15'));var logger=require(_0xb087('0x16'))(_0xb087('0x17'));var utils=require(_0xb087('0x18'));var config=require(_0xb087('0x19'));var licenseUtil=require('../../config/license/util');var db=require(_0xb087('0x1a'))['db'];function respondWithStatusCode(_0x31f977,_0x323656){_0x323656=_0x323656||0xcc;return function(_0x51ceaa){if(_0x51ceaa){return _0x31f977[_0xb087('0x1b')](_0x323656);}return _0x31f977[_0xb087('0x1c')](_0x323656)[_0xb087('0x1d')]();};}function respondWithResult(_0x46410b,_0x11784c){_0x11784c=_0x11784c||0xc8;return function(_0x12d0db){if(_0x12d0db){return _0x46410b[_0xb087('0x1c')](_0x11784c)[_0xb087('0x1e')](_0x12d0db);}};}function respondWithFilteredResult(_0x24e1a3,_0x16d0b7){return function(_0x5193a4){if(_0x5193a4){var _0x43e576=typeof _0x16d0b7[_0xb087('0x1f')]==='undefined'&&typeof _0x16d0b7[_0xb087('0x20')]===_0xb087('0x21');var _0x2e9e74=_0x5193a4['count'];var _0x330005=_0x43e576?0x0:_0x16d0b7[_0xb087('0x1f')];var _0x17200d=_0x43e576?_0x5193a4[_0xb087('0x22')]:_0x16d0b7['offset']+_0x16d0b7[_0xb087('0x20')];var _0x28428e;if(_0x17200d>=_0x2e9e74){_0x17200d=_0x2e9e74;_0x28428e=0xc8;}else{_0x28428e=0xce;}_0x24e1a3[_0xb087('0x1c')](_0x28428e);return _0x24e1a3[_0xb087('0x23')]('Content-Range',_0x330005+'-'+_0x17200d+'/'+_0x2e9e74)['json'](_0x5193a4);}return null;};}function patchUpdates(_0x5ea3dc){return function(_0x49450a){try{jsonpatch[_0xb087('0x24')](_0x49450a,_0x5ea3dc,!![]);}catch(_0x17be8e){return BPromise[_0xb087('0x25')](_0x17be8e);}return _0x49450a[_0xb087('0x26')]();};}function saveUpdates(_0x1fb765,_0x258b4c){return function(_0x31ae01){if(_0x31ae01){return _0x31ae01['update'](_0x1fb765)[_0xb087('0x27')](function(_0x466397){return _0x466397;});}return null;};}function removeEntity(_0x1de654,_0x1cfb3e){return function(_0x3ad74e){if(_0x3ad74e){return _0x3ad74e['destroy']()[_0xb087('0x27')](function(){var _0xdd4216=_0x3ad74e['get']({'plain':!![]});var _0x5a2dc6='Voicemails';return db['UserProfileResource']['destroy']({'where':{'type':_0x5a2dc6,'resourceId':_0xdd4216['id']}})[_0xb087('0x27')](function(){return _0x3ad74e;});})[_0xb087('0x27')](function(){_0x1de654[_0xb087('0x1c')](0xcc)[_0xb087('0x1d')]();});}};}function handleEntityNotFound(_0xd9ec66,_0xb72173){return function(_0xf3f41f){if(!_0xf3f41f){_0xd9ec66[_0xb087('0x1b')](0x194);}return _0xf3f41f;};}function handleError(_0x6cfb22,_0x1551c3){_0x1551c3=_0x1551c3||0x1f4;return function(_0x18058c){logger[_0xb087('0x28')](_0x18058c[_0xb087('0x29')]);if(_0x18058c[_0xb087('0x2a')]){delete _0x18058c['name'];}_0x6cfb22[_0xb087('0x1c')](_0x1551c3)[_0xb087('0x2b')](_0x18058c);};}exports[_0xb087('0x2c')]=function(_0x15c9ac,_0x22d441){var _0xa6d90c={},_0x2e1c57={},_0x13fb2f={'count':0x0,'rows':[]};var _0x53a535=_['map'](db[_0xb087('0x2d')][_0xb087('0x2e')],function(_0x4cb5a8){return{'name':_0x4cb5a8[_0xb087('0x2f')],'type':_0x4cb5a8[_0xb087('0x30')][_0xb087('0x31')]};});_0x2e1c57[_0xb087('0x32')]=_[_0xb087('0x33')](_0x53a535,_0xb087('0x2a'));_0x2e1c57[_0xb087('0x34')]=_[_0xb087('0x35')](_0x15c9ac[_0xb087('0x34')]);_0x2e1c57[_0xb087('0x36')]=_[_0xb087('0x37')](_0x2e1c57[_0xb087('0x32')],_0x2e1c57['query']);_0xa6d90c[_0xb087('0x38')]=_['intersection'](_0x2e1c57[_0xb087('0x32')],qs[_0xb087('0x39')](_0x15c9ac[_0xb087('0x34')][_0xb087('0x39')]));_0xa6d90c[_0xb087('0x38')]=_0xa6d90c[_0xb087('0x38')][_0xb087('0x3a')]?_0xa6d90c[_0xb087('0x38')]:_0x2e1c57[_0xb087('0x32')];if(!_0x15c9ac['query']['hasOwnProperty'](_0xb087('0x3b'))){_0xa6d90c[_0xb087('0x20')]=qs[_0xb087('0x20')](_0x15c9ac[_0xb087('0x34')][_0xb087('0x20')]);_0xa6d90c['offset']=qs[_0xb087('0x1f')](_0x15c9ac[_0xb087('0x34')]['offset']);}_0xa6d90c['order']=qs[_0xb087('0x3c')](_0x15c9ac[_0xb087('0x34')][_0xb087('0x3c')]);_0xa6d90c['where']=qs[_0xb087('0x36')](_[_0xb087('0x3d')](_0x15c9ac[_0xb087('0x34')],_0x2e1c57[_0xb087('0x36')]),_0x53a535);if(_0x15c9ac[_0xb087('0x34')]['filter']){_0xa6d90c[_0xb087('0x3e')]=_['merge'](_0xa6d90c[_0xb087('0x3e')],{'$or':_['map'](_0x53a535,function(_0x52a98f){if(_0x52a98f[_0xb087('0x30')]!=='VIRTUAL'){var _0xed47c4={};_0xed47c4[_0x52a98f['name']]={'$like':'%'+_0x15c9ac[_0xb087('0x34')]['filter']+'%'};return _0xed47c4;}})});}_0xa6d90c=_[_0xb087('0x3f')]({},_0xa6d90c,_0x15c9ac[_0xb087('0x40')]);var _0x364b1d={'where':_0xa6d90c[_0xb087('0x3e')]};return db[_0xb087('0x2d')][_0xb087('0x22')](_0x364b1d)[_0xb087('0x27')](function(_0x5e7690){_0x13fb2f[_0xb087('0x22')]=_0x5e7690;if(_0x15c9ac['query'][_0xb087('0x41')]){_0xa6d90c[_0xb087('0x42')]=[{'all':!![]}];}return db['VoiceMail'][_0xb087('0x43')](_0xa6d90c);})[_0xb087('0x27')](function(_0x7650c5){_0x13fb2f['rows']=_0x7650c5;return _0x13fb2f;})[_0xb087('0x27')](respondWithFilteredResult(_0x22d441,_0xa6d90c))['catch'](handleError(_0x22d441,null));};exports[_0xb087('0x44')]=function(_0x32b9d3,_0x5e7f45){var _0x38cb9d={'raw':!![],'where':{'id':_0x32b9d3['params']['id']}},_0x302ce7={};_0x302ce7[_0xb087('0x32')]=_[_0xb087('0x35')](db['VoiceMail'][_0xb087('0x2e')]);_0x302ce7[_0xb087('0x34')]=_[_0xb087('0x35')](_0x32b9d3[_0xb087('0x34')]);_0x302ce7['filters']=_['intersection'](_0x302ce7[_0xb087('0x32')],_0x302ce7[_0xb087('0x34')]);_0x38cb9d[_0xb087('0x38')]=_[_0xb087('0x37')](_0x302ce7[_0xb087('0x32')],qs[_0xb087('0x39')](_0x32b9d3['query']['fields']));_0x38cb9d[_0xb087('0x38')]=_0x38cb9d['attributes'][_0xb087('0x3a')]?_0x38cb9d[_0xb087('0x38')]:_0x302ce7[_0xb087('0x32')];if(_0x32b9d3[_0xb087('0x34')]['includeAll']){_0x38cb9d[_0xb087('0x42')]=[{'all':!![]}];}_0x38cb9d=_['merge']({},_0x38cb9d,_0x32b9d3[_0xb087('0x40')]);return db[_0xb087('0x2d')][_0xb087('0x45')](_0x38cb9d)[_0xb087('0x27')](handleEntityNotFound(_0x5e7f45,null))[_0xb087('0x27')](respondWithResult(_0x5e7f45,null))['catch'](handleError(_0x5e7f45,null));};exports[_0xb087('0x46')]=function(_0xb15e28,_0x588d96){return db['VoiceMail'][_0xb087('0x46')](_0xb15e28['body'],{})['then'](function(_0x1c9f8f){var _0x341665=_0xb15e28['user'][_0xb087('0x47')]({'plain':!![]});if(!_0x341665)throw new Error(_0xb087('0x48'));if(_0x341665[_0xb087('0x49')]==='user'){var _0x5ba160=_0x1c9f8f[_0xb087('0x47')]({'plain':!![]});var _0x54862a='Voicemails';return db[_0xb087('0x4a')][_0xb087('0x45')]({'where':{'name':_0x54862a,'userProfileId':_0x341665[_0xb087('0x4b')]},'raw':!![]})[_0xb087('0x27')](function(_0x2bf92f){if(_0x2bf92f&&_0x2bf92f[_0xb087('0x4c')]===0x0){return db[_0xb087('0x4d')][_0xb087('0x46')]({'name':_0x5ba160[_0xb087('0x2a')],'resourceId':_0x5ba160['id'],'type':_0x2bf92f[_0xb087('0x2a')],'sectionId':_0x2bf92f['id']},{})[_0xb087('0x27')](function(){return _0x1c9f8f;});}else{return _0x1c9f8f;}})[_0xb087('0x4e')](function(_0x55e653){logger[_0xb087('0x28')](_0xb087('0x4f'),_0x55e653);throw _0x55e653;});}return _0x1c9f8f;})['then'](respondWithResult(_0x588d96,0xc9))[_0xb087('0x4e')](handleError(_0x588d96,null));};exports[_0xb087('0x50')]=function(_0x343830,_0x1c91e8){if(_0x343830[_0xb087('0x51')]['id']){delete _0x343830[_0xb087('0x51')]['id'];}return db[_0xb087('0x2d')][_0xb087('0x45')]({'where':{'id':_0x343830[_0xb087('0x52')]['id']}})[_0xb087('0x27')](handleEntityNotFound(_0x1c91e8,null))[_0xb087('0x27')](saveUpdates(_0x343830['body'],null))[_0xb087('0x27')](respondWithResult(_0x1c91e8,null))['catch'](handleError(_0x1c91e8,null));};exports[_0xb087('0x53')]=function(_0x575cc4,_0xf0b592){return db[_0xb087('0x2d')][_0xb087('0x45')]({'where':{'id':_0x575cc4[_0xb087('0x52')]['id']}})[_0xb087('0x27')](handleEntityNotFound(_0xf0b592,null))[_0xb087('0x27')](removeEntity(_0xf0b592,null))[_0xb087('0x4e')](handleError(_0xf0b592,null));};exports[_0xb087('0x54')]=function(_0x3f3091,_0x323e0a,_0x300e9b){return db[_0xb087('0x2d')][_0xb087('0x55')]({'where':{'id':_0x3f3091[_0xb087('0x52')]['id']}})[_0xb087('0x27')](handleEntityNotFound(_0x323e0a,null))[_0xb087('0x27')](function(_0x217f26){var _0x3185c4;var _0x40ff74={},_0xe3cb2={};_0xe3cb2[_0xb087('0x32')]=_[_0xb087('0x35')](db['VoiceMailMessage'][_0xb087('0x2e')]);_0xe3cb2[_0xb087('0x34')]=_[_0xb087('0x35')](_0x3f3091['query']);_0xe3cb2[_0xb087('0x36')]=_[_0xb087('0x37')](_0xe3cb2['model'],_0xe3cb2[_0xb087('0x34')]);_0x40ff74[_0xb087('0x38')]=_[_0xb087('0x37')](_0xe3cb2['model'],qs[_0xb087('0x39')](_0x3f3091[_0xb087('0x34')][_0xb087('0x39')]));_0x40ff74[_0xb087('0x38')]=_0x40ff74[_0xb087('0x38')][_0xb087('0x3a')]?_0x40ff74[_0xb087('0x38')]:_0xe3cb2[_0xb087('0x32')];if(!_0x3f3091['query'][_0xb087('0x56')](_0xb087('0x3b'))){_0x40ff74[_0xb087('0x20')]=qs['limit'](_0x3f3091[_0xb087('0x34')]['limit']);_0x40ff74['offset']=qs[_0xb087('0x1f')](_0x3f3091[_0xb087('0x34')]['offset']);}_0x40ff74[_0xb087('0x57')]=qs['sort'](_0x3f3091[_0xb087('0x34')][_0xb087('0x3c')]);_0x40ff74['where']=qs['filters'](_[_0xb087('0x3d')](_0x3f3091['query'],_0xe3cb2['filters']));if(_0x3f3091[_0xb087('0x34')]['filter']){_0x40ff74[_0xb087('0x3e')]=_['merge'](_0x40ff74[_0xb087('0x3e')],{'$or':_[_0xb087('0x33')](_0x40ff74[_0xb087('0x38')],function(_0x2a6b2e){var _0x4e1683={};_0x4e1683[_0x2a6b2e]={'$like':'%'+_0x3f3091[_0xb087('0x34')]['filter']+'%'};return _0x4e1683;})});}_0x40ff74[_0xb087('0x3e')]=_['merge'](_0x40ff74[_0xb087('0x3e')],{'mailboxuser':_0x217f26[_0xb087('0x58')]});_0x40ff74=_[_0xb087('0x3f')]({},_0x40ff74,_0x3f3091['options']);return db[_0xb087('0x59')]['findAndCountAll'](_0x40ff74)[_0xb087('0x27')](respondWithFilteredResult(_0x323e0a,_0x40ff74));})[_0xb087('0x4e')](handleError(_0x323e0a,null));}; \ No newline at end of file +var _0xd87e=['autoAssociation','create','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','params','getMessages','findOne','VoiceMailMessage','hasOwnProperty','sort','mailbox','findAndCountAll','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','undefined','limit','count','set','Content-Range','save','then','destroy','get','Voicemails','UserProfileResource','error','name','map','VoiceMail','rawAttributes','fieldName','type','key','keys','filters','intersection','model','query','attributes','fields','length','nolimit','order','where','pick','filter','merge','VIRTUAL','options','includeAll','include','findAll','rows','find','catch','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileSection','userProfileId'];(function(_0x4432c4,_0x3c5a9f){var _0x112cef=function(_0x27efe2){while(--_0x27efe2){_0x4432c4['push'](_0x4432c4['shift']());}};_0x112cef(++_0x3c5a9f);}(_0xd87e,0x1bf));var _0xed87=function(_0x53eba7,_0x38744c){_0x53eba7=_0x53eba7-0x0;var _0x32491b=_0xd87e[_0x53eba7];return _0x32491b;};'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'];function respondWithStatusCode(_0x5e912e,_0x4ffc2d){_0x4ffc2d=_0x4ffc2d||0xcc;return function(_0x466f35){if(_0x466f35){return _0x5e912e[_0xed87('0x18')](_0x4ffc2d);}return _0x5e912e[_0xed87('0x19')](_0x4ffc2d)[_0xed87('0x1a')]();};}function respondWithResult(_0x16bfd6,_0x3865c5){_0x3865c5=_0x3865c5||0xc8;return function(_0x52dfe8){if(_0x52dfe8){return _0x16bfd6[_0xed87('0x19')](_0x3865c5)[_0xed87('0x1b')](_0x52dfe8);}};}function respondWithFilteredResult(_0x1722a6,_0x1e9a3d){return function(_0x2f2fd3){if(_0x2f2fd3){var _0xd34e0e=typeof _0x1e9a3d[_0xed87('0x1c')]===_0xed87('0x1d')&&typeof _0x1e9a3d[_0xed87('0x1e')]==='undefined';var _0x3db5ea=_0x2f2fd3[_0xed87('0x1f')];var _0x2c386a=_0xd34e0e?0x0:_0x1e9a3d[_0xed87('0x1c')];var _0x5f4076=_0xd34e0e?_0x2f2fd3[_0xed87('0x1f')]:_0x1e9a3d[_0xed87('0x1c')]+_0x1e9a3d[_0xed87('0x1e')];var _0x3f9e08;if(_0x5f4076>=_0x3db5ea){_0x5f4076=_0x3db5ea;_0x3f9e08=0xc8;}else{_0x3f9e08=0xce;}_0x1722a6[_0xed87('0x19')](_0x3f9e08);return _0x1722a6[_0xed87('0x20')](_0xed87('0x21'),_0x2c386a+'-'+_0x5f4076+'/'+_0x3db5ea)[_0xed87('0x1b')](_0x2f2fd3);}return null;};}function patchUpdates(_0x3b7981){return function(_0x52e81c){try{jsonpatch['apply'](_0x52e81c,_0x3b7981,!![]);}catch(_0x5db546){return BPromise['reject'](_0x5db546);}return _0x52e81c[_0xed87('0x22')]();};}function saveUpdates(_0x5d3ec8,_0x4191a7){return function(_0x2b0b98){if(_0x2b0b98){return _0x2b0b98['update'](_0x5d3ec8)[_0xed87('0x23')](function(_0x505733){return _0x505733;});}return null;};}function removeEntity(_0x3d1641,_0x24962e){return function(_0x27799a){if(_0x27799a){return _0x27799a[_0xed87('0x24')]()[_0xed87('0x23')](function(){var _0x5d15b3=_0x27799a[_0xed87('0x25')]({'plain':!![]});var _0x3c22b7=_0xed87('0x26');return db[_0xed87('0x27')][_0xed87('0x24')]({'where':{'type':_0x3c22b7,'resourceId':_0x5d15b3['id']}})[_0xed87('0x23')](function(){return _0x27799a;});})[_0xed87('0x23')](function(){_0x3d1641[_0xed87('0x19')](0xcc)[_0xed87('0x1a')]();});}};}function handleEntityNotFound(_0x38f5c,_0x469181){return function(_0x341a35){if(!_0x341a35){_0x38f5c[_0xed87('0x18')](0x194);}return _0x341a35;};}function handleError(_0x2b86e2,_0x4dfaf2){_0x4dfaf2=_0x4dfaf2||0x1f4;return function(_0xb32b1c){logger[_0xed87('0x28')](_0xb32b1c['stack']);if(_0xb32b1c[_0xed87('0x29')]){delete _0xb32b1c[_0xed87('0x29')];}_0x2b86e2[_0xed87('0x19')](_0x4dfaf2)['send'](_0xb32b1c);};}exports['index']=function(_0xd0efba,_0x428b75){var _0x21ab8a={},_0x549a19={},_0x37d45a={'count':0x0,'rows':[]};var _0x3b87e3=_[_0xed87('0x2a')](db[_0xed87('0x2b')][_0xed87('0x2c')],function(_0x46b9f9){return{'name':_0x46b9f9[_0xed87('0x2d')],'type':_0x46b9f9[_0xed87('0x2e')][_0xed87('0x2f')]};});_0x549a19['model']=_[_0xed87('0x2a')](_0x3b87e3,_0xed87('0x29'));_0x549a19['query']=_[_0xed87('0x30')](_0xd0efba['query']);_0x549a19[_0xed87('0x31')]=_[_0xed87('0x32')](_0x549a19[_0xed87('0x33')],_0x549a19[_0xed87('0x34')]);_0x21ab8a[_0xed87('0x35')]=_[_0xed87('0x32')](_0x549a19[_0xed87('0x33')],qs[_0xed87('0x36')](_0xd0efba[_0xed87('0x34')][_0xed87('0x36')]));_0x21ab8a[_0xed87('0x35')]=_0x21ab8a['attributes'][_0xed87('0x37')]?_0x21ab8a[_0xed87('0x35')]:_0x549a19['model'];if(!_0xd0efba[_0xed87('0x34')]['hasOwnProperty'](_0xed87('0x38'))){_0x21ab8a[_0xed87('0x1e')]=qs['limit'](_0xd0efba[_0xed87('0x34')][_0xed87('0x1e')]);_0x21ab8a[_0xed87('0x1c')]=qs[_0xed87('0x1c')](_0xd0efba[_0xed87('0x34')]['offset']);}_0x21ab8a[_0xed87('0x39')]=qs['sort'](_0xd0efba[_0xed87('0x34')]['sort']);_0x21ab8a[_0xed87('0x3a')]=qs[_0xed87('0x31')](_[_0xed87('0x3b')](_0xd0efba[_0xed87('0x34')],_0x549a19[_0xed87('0x31')]),_0x3b87e3);if(_0xd0efba[_0xed87('0x34')][_0xed87('0x3c')]){_0x21ab8a[_0xed87('0x3a')]=_[_0xed87('0x3d')](_0x21ab8a['where'],{'$or':_['map'](_0x3b87e3,function(_0xa6714a){if(_0xa6714a[_0xed87('0x2e')]!==_0xed87('0x3e')){var _0x325112={};_0x325112[_0xa6714a[_0xed87('0x29')]]={'$like':'%'+_0xd0efba[_0xed87('0x34')]['filter']+'%'};return _0x325112;}})});}_0x21ab8a=_[_0xed87('0x3d')]({},_0x21ab8a,_0xd0efba[_0xed87('0x3f')]);var _0x1c49b0={'where':_0x21ab8a['where']};return db[_0xed87('0x2b')][_0xed87('0x1f')](_0x1c49b0)[_0xed87('0x23')](function(_0x1b0092){_0x37d45a[_0xed87('0x1f')]=_0x1b0092;if(_0xd0efba[_0xed87('0x34')][_0xed87('0x40')]){_0x21ab8a[_0xed87('0x41')]=[{'all':!![]}];}return db[_0xed87('0x2b')][_0xed87('0x42')](_0x21ab8a);})['then'](function(_0x7e6cbb){_0x37d45a[_0xed87('0x43')]=_0x7e6cbb;return _0x37d45a;})[_0xed87('0x23')](respondWithFilteredResult(_0x428b75,_0x21ab8a))['catch'](handleError(_0x428b75,null));};exports['show']=function(_0xa31eec,_0x7aa7fa){var _0x40cd98={'raw':!![],'where':{'id':_0xa31eec['params']['id']}},_0x41a658={};_0x41a658[_0xed87('0x33')]=_[_0xed87('0x30')](db['VoiceMail'][_0xed87('0x2c')]);_0x41a658[_0xed87('0x34')]=_[_0xed87('0x30')](_0xa31eec[_0xed87('0x34')]);_0x41a658[_0xed87('0x31')]=_[_0xed87('0x32')](_0x41a658[_0xed87('0x33')],_0x41a658[_0xed87('0x34')]);_0x40cd98[_0xed87('0x35')]=_[_0xed87('0x32')](_0x41a658[_0xed87('0x33')],qs['fields'](_0xa31eec[_0xed87('0x34')][_0xed87('0x36')]));_0x40cd98[_0xed87('0x35')]=_0x40cd98[_0xed87('0x35')][_0xed87('0x37')]?_0x40cd98[_0xed87('0x35')]:_0x41a658[_0xed87('0x33')];if(_0xa31eec[_0xed87('0x34')][_0xed87('0x40')]){_0x40cd98[_0xed87('0x41')]=[{'all':!![]}];}_0x40cd98=_[_0xed87('0x3d')]({},_0x40cd98,_0xa31eec[_0xed87('0x3f')]);return db[_0xed87('0x2b')][_0xed87('0x44')](_0x40cd98)[_0xed87('0x23')](handleEntityNotFound(_0x7aa7fa,null))[_0xed87('0x23')](respondWithResult(_0x7aa7fa,null))[_0xed87('0x45')](handleError(_0x7aa7fa,null));};exports['create']=function(_0x2c7bef,_0x1a68a7){return db[_0xed87('0x2b')]['create'](_0x2c7bef[_0xed87('0x46')],{})[_0xed87('0x23')](function(_0x54bc95){var _0x33e736=_0x2c7bef[_0xed87('0x47')][_0xed87('0x25')]({'plain':!![]});if(!_0x33e736)throw new Error(_0xed87('0x48'));if(_0x33e736['role']===_0xed87('0x47')){var _0x436e15=_0x54bc95[_0xed87('0x25')]({'plain':!![]});var _0x272a07=_0xed87('0x26');return db[_0xed87('0x49')][_0xed87('0x44')]({'where':{'name':_0x272a07,'userProfileId':_0x33e736[_0xed87('0x4a')]},'raw':!![]})[_0xed87('0x23')](function(_0x251d4e){if(_0x251d4e&&_0x251d4e[_0xed87('0x4b')]===0x0){return db[_0xed87('0x27')][_0xed87('0x4c')]({'name':_0x436e15['name'],'resourceId':_0x436e15['id'],'type':_0x251d4e[_0xed87('0x29')],'sectionId':_0x251d4e['id']},{})['then'](function(){return _0x54bc95;});}else{return _0x54bc95;}})[_0xed87('0x45')](function(_0x329973){logger[_0xed87('0x28')](_0xed87('0x4d'),_0x329973);throw _0x329973;});}return _0x54bc95;})[_0xed87('0x23')](respondWithResult(_0x1a68a7,0xc9))[_0xed87('0x45')](handleError(_0x1a68a7,null));};exports[_0xed87('0x4e')]=function(_0xccdbb6,_0x3b413d){if(_0xccdbb6[_0xed87('0x46')]['id']){delete _0xccdbb6['body']['id'];}return db[_0xed87('0x2b')][_0xed87('0x44')]({'where':{'id':_0xccdbb6[_0xed87('0x4f')]['id']}})[_0xed87('0x23')](handleEntityNotFound(_0x3b413d,null))[_0xed87('0x23')](saveUpdates(_0xccdbb6[_0xed87('0x46')],null))[_0xed87('0x23')](respondWithResult(_0x3b413d,null))[_0xed87('0x45')](handleError(_0x3b413d,null));};exports[_0xed87('0x24')]=function(_0x367ff4,_0x32db1f){return db['VoiceMail']['find']({'where':{'id':_0x367ff4[_0xed87('0x4f')]['id']}})[_0xed87('0x23')](handleEntityNotFound(_0x32db1f,null))[_0xed87('0x23')](removeEntity(_0x32db1f,null))[_0xed87('0x45')](handleError(_0x32db1f,null));};exports[_0xed87('0x50')]=function(_0x4dd840,_0x7e6738,_0x1ddd72){return db[_0xed87('0x2b')][_0xed87('0x51')]({'where':{'id':_0x4dd840[_0xed87('0x4f')]['id']}})[_0xed87('0x23')](handleEntityNotFound(_0x7e6738,null))[_0xed87('0x23')](function(_0x1391a2){var _0x2ffffa;var _0xf4ec55={},_0x3feebb={};_0x3feebb[_0xed87('0x33')]=_[_0xed87('0x30')](db[_0xed87('0x52')]['rawAttributes']);_0x3feebb[_0xed87('0x34')]=_[_0xed87('0x30')](_0x4dd840[_0xed87('0x34')]);_0x3feebb[_0xed87('0x31')]=_[_0xed87('0x32')](_0x3feebb[_0xed87('0x33')],_0x3feebb[_0xed87('0x34')]);_0xf4ec55[_0xed87('0x35')]=_['intersection'](_0x3feebb[_0xed87('0x33')],qs[_0xed87('0x36')](_0x4dd840[_0xed87('0x34')][_0xed87('0x36')]));_0xf4ec55[_0xed87('0x35')]=_0xf4ec55[_0xed87('0x35')]['length']?_0xf4ec55['attributes']:_0x3feebb[_0xed87('0x33')];if(!_0x4dd840[_0xed87('0x34')][_0xed87('0x53')](_0xed87('0x38'))){_0xf4ec55[_0xed87('0x1e')]=qs[_0xed87('0x1e')](_0x4dd840[_0xed87('0x34')][_0xed87('0x1e')]);_0xf4ec55['offset']=qs[_0xed87('0x1c')](_0x4dd840['query'][_0xed87('0x1c')]);}_0xf4ec55[_0xed87('0x39')]=qs['sort'](_0x4dd840[_0xed87('0x34')][_0xed87('0x54')]);_0xf4ec55['where']=qs[_0xed87('0x31')](_[_0xed87('0x3b')](_0x4dd840[_0xed87('0x34')],_0x3feebb[_0xed87('0x31')]));if(_0x4dd840[_0xed87('0x34')]['filter']){_0xf4ec55[_0xed87('0x3a')]=_[_0xed87('0x3d')](_0xf4ec55[_0xed87('0x3a')],{'$or':_[_0xed87('0x2a')](_0xf4ec55['attributes'],function(_0x58279a){var _0x3a6ab6={};_0x3a6ab6[_0x58279a]={'$like':'%'+_0x4dd840[_0xed87('0x34')]['filter']+'%'};return _0x3a6ab6;})});}_0xf4ec55[_0xed87('0x3a')]=_[_0xed87('0x3d')](_0xf4ec55[_0xed87('0x3a')],{'mailboxuser':_0x1391a2[_0xed87('0x55')]});_0xf4ec55=_[_0xed87('0x3d')]({},_0xf4ec55,_0x4dd840[_0xed87('0x3f')]);return db[_0xed87('0x52')][_0xed87('0x56')](_0xf4ec55)[_0xed87('0x23')](respondWithFilteredResult(_0x7e6738,_0xf4ec55));})[_0xed87('0x45')](handleError(_0x7e6738,null));}; \ No newline at end of file diff --git a/server/api/voiceMail/voiceMail.model.js b/server/api/voiceMail/voiceMail.model.js index 638b4fd..2310f93 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 _0xb614=['context','../../config/logger','api','moment','path','rimraf','../../config/environment','./voiceMail.attributes','exports','VoiceMail','voice_voicemail','mailbox_context','mailbox'];(function(_0x1dcc28,_0x26d40f){var _0x1ffb2d=function(_0x59e9e0){while(--_0x59e9e0){_0x1dcc28['push'](_0x1dcc28['shift']());}};_0x1ffb2d(++_0x26d40f);}(_0xb614,0x1e2));var _0x4b61=function(_0x48074b,_0x17a04b){_0x48074b=_0x48074b-0x0;var _0x3db86c=_0xb614[_0x48074b];return _0x3db86c;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x4b61('0x0'))(_0x4b61('0x1'));var moment=require(_0x4b61('0x2'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0x4b61('0x3'));var rimraf=require(_0x4b61('0x4'));var config=require(_0x4b61('0x5'));var attributes=require(_0x4b61('0x6'));module[_0x4b61('0x7')]=function(_0x4d5fd8,_0x341a98){return _0x4d5fd8['define'](_0x4b61('0x8'),attributes,{'tableName':_0x4b61('0x9'),'paranoid':![],'indexes':[{'name':_0x4b61('0xa'),'fields':[_0x4b61('0xb'),_0x4b61('0xc')]}],'timestamps':!![]});}; \ No newline at end of file +var _0x76ac=['exports','define','VoiceMail','voice_voicemail','mailbox','context','lodash','util','api','bluebird','request-promise','rimraf','../../config/environment','./voiceMail.attributes'];(function(_0x25576f,_0x590a13){var _0x515db1=function(_0x78b267){while(--_0x78b267){_0x25576f['push'](_0x25576f['shift']());}};_0x515db1(++_0x590a13);}(_0x76ac,0x156));var _0xc76a=function(_0x495bef,_0xd3cb76){_0x495bef=_0x495bef-0x0;var _0x5bd380=_0x76ac[_0x495bef];return _0x5bd380;};'use strict';var _=require(_0xc76a('0x0'));var util=require(_0xc76a('0x1'));var logger=require('../../config/logger')(_0xc76a('0x2'));var moment=require('moment');var BPromise=require(_0xc76a('0x3'));var rp=require(_0xc76a('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0xc76a('0x5'));var config=require(_0xc76a('0x6'));var attributes=require(_0xc76a('0x7'));module[_0xc76a('0x8')]=function(_0x135473,_0x149990){return _0x135473[_0xc76a('0x9')](_0xc76a('0xa'),attributes,{'tableName':_0xc76a('0xb'),'paranoid':![],'indexes':[{'name':'mailbox_context','fields':[_0xc76a('0xc'),_0xc76a('0xd')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/voiceMail/voiceMail.rpc.js b/server/api/voiceMail/voiceMail.rpc.js index 35e9441..38f0a0b 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 _0x6241=['bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','VoiceMail,\x20%s,\x20%s','VoiceMail,\x20%s,\x20%s,\x20%s','request\x20sent','error','code','message','catch','util','moment'];(function(_0x1b2b74,_0xa38666){var _0x1e5fac=function(_0x2c16b2){while(--_0x2c16b2){_0x1b2b74['push'](_0x1b2b74['shift']());}};_0x1e5fac(++_0xa38666);}(_0x6241,0xcd));var _0x1624=function(_0x32f7d7,_0x54231b){_0x32f7d7=_0x32f7d7-0x0;var _0x133d09=_0x6241[_0x32f7d7];return _0x133d09;};'use strict';var _=require('lodash');var util=require(_0x1624('0x0'));var moment=require(_0x1624('0x1'));var BPromise=require(_0x1624('0x2'));var rs=require(_0x1624('0x3'));var fs=require('fs');var Redis=require(_0x1624('0x4'));var db=require(_0x1624('0x5'))['db'];var utils=require(_0x1624('0x6'));var logger=require(_0x1624('0x7'))(_0x1624('0x8'));var config=require(_0x1624('0x9'));var jayson=require(_0x1624('0xa'));var client=jayson[_0x1624('0xb')][_0x1624('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x3bceef,_0x116ed6,_0x5c7394){return new BPromise(function(_0x1ec586,_0x1c54ec){return client[_0x1624('0xd')](_0x3bceef,_0x5c7394)[_0x1624('0xe')](function(_0x1c64bd){logger[_0x1624('0xf')](_0x1624('0x10'),_0x116ed6,'request\x20sent');logger['debug'](_0x1624('0x11'),_0x116ed6,_0x1624('0x12'),JSON['stringify'](_0x1c64bd));if(_0x1c64bd[_0x1624('0x13')]){if(_0x1c64bd[_0x1624('0x13')][_0x1624('0x14')]===0x1f4){logger[_0x1624('0x13')](_0x1624('0x10'),_0x116ed6,_0x1c64bd[_0x1624('0x13')][_0x1624('0x15')]);return _0x1c54ec(_0x1c64bd[_0x1624('0x13')][_0x1624('0x15')]);}logger[_0x1624('0x13')](_0x1624('0x10'),_0x116ed6,_0x1c64bd[_0x1624('0x13')][_0x1624('0x15')]);return _0x1ec586(_0x1c64bd[_0x1624('0x13')]['message']);}else{logger[_0x1624('0xf')](_0x1624('0x10'),_0x116ed6,'request\x20sent');_0x1ec586(_0x1c64bd['result']['message']);}})[_0x1624('0x16')](function(_0x390b8e){logger['error'](_0x1624('0x10'),_0x116ed6,_0x390b8e);_0x1c54ec(_0x390b8e);});});} \ No newline at end of file +var _0x493b=['../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','request','then','info','VoiceMail,\x20%s,\x20%s','request\x20sent','debug','VoiceMail,\x20%s,\x20%s,\x20%s','stringify','error','code','message','util','moment','bluebird','randomstring','ioredis'];(function(_0xd758b6,_0x225982){var _0x1dd8f3=function(_0x5b2999){while(--_0x5b2999){_0xd758b6['push'](_0xd758b6['shift']());}};_0x1dd8f3(++_0x225982);}(_0x493b,0x69));var _0xb493=function(_0x37b321,_0x4ca385){_0x37b321=_0x37b321-0x0;var _0x3a64ba=_0x493b[_0x37b321];return _0x3a64ba;};'use strict';var _=require('lodash');var util=require(_0xb493('0x0'));var moment=require(_0xb493('0x1'));var BPromise=require(_0xb493('0x2'));var rs=require(_0xb493('0x3'));var fs=require('fs');var Redis=require(_0xb493('0x4'));var db=require(_0xb493('0x5'))['db'];var utils=require(_0xb493('0x6'));var logger=require(_0xb493('0x7'))(_0xb493('0x8'));var config=require(_0xb493('0x9'));var jayson=require('jayson/promise');var client=jayson[_0xb493('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x3effef,_0x4319b4,_0xc727e){return new BPromise(function(_0x4ddb50,_0x31368f){return client[_0xb493('0xb')](_0x3effef,_0xc727e)[_0xb493('0xc')](function(_0x53306a){logger[_0xb493('0xd')](_0xb493('0xe'),_0x4319b4,_0xb493('0xf'));logger[_0xb493('0x10')](_0xb493('0x11'),_0x4319b4,_0xb493('0xf'),JSON[_0xb493('0x12')](_0x53306a));if(_0x53306a[_0xb493('0x13')]){if(_0x53306a[_0xb493('0x13')][_0xb493('0x14')]===0x1f4){logger[_0xb493('0x13')]('VoiceMail,\x20%s,\x20%s',_0x4319b4,_0x53306a[_0xb493('0x13')][_0xb493('0x15')]);return _0x31368f(_0x53306a['error'][_0xb493('0x15')]);}logger['error'](_0xb493('0xe'),_0x4319b4,_0x53306a['error'][_0xb493('0x15')]);return _0x4ddb50(_0x53306a[_0xb493('0x13')][_0xb493('0x15')]);}else{logger[_0xb493('0xd')](_0xb493('0xe'),_0x4319b4,_0xb493('0xf'));_0x4ddb50(_0x53306a['result'][_0xb493('0x15')]);}})['catch'](function(_0x4ea49e){logger[_0xb493('0x13')](_0xb493('0xe'),_0x4319b4,_0x4ea49e);_0x31368f(_0x4ea49e);});});} \ No newline at end of file diff --git a/server/api/voiceMailMessage/index.js b/server/api/voiceMailMessage/index.js index 8e13ae5..7bfb7ad 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 _0xb31c=['Router','fs-extra','../../components/auth/service','../../config/environment','./voiceMailMessage.controller','get','isAuthenticated','/:id','show','/:id/download','download','post','create','put','delete','destroy','multer','path','connect-timeout','express'];(function(_0x59145a,_0x1f60f1){var _0xf04d7=function(_0x247581){while(--_0x247581){_0x59145a['push'](_0x59145a['shift']());}};_0xf04d7(++_0x1f60f1);}(_0xb31c,0x1b4));var _0xcb31=function(_0x313324,_0x362720){_0x313324=_0x313324-0x0;var _0x4c9dec=_0xb31c[_0x313324];return _0x4c9dec;};'use strict';var multer=require(_0xcb31('0x0'));var util=require('util');var path=require(_0xcb31('0x1'));var timeout=require(_0xcb31('0x2'));var express=require(_0xcb31('0x3'));var router=express[_0xcb31('0x4')]();var fs_extra=require(_0xcb31('0x5'));var auth=require(_0xcb31('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0xcb31('0x7'));var controller=require(_0xcb31('0x8'));router[_0xcb31('0x9')]('/',auth[_0xcb31('0xa')](),controller['index']);router['get'](_0xcb31('0xb'),auth['isAuthenticated'](),controller[_0xcb31('0xc')]);router[_0xcb31('0x9')](_0xcb31('0xd'),auth[_0xcb31('0xa')](),controller[_0xcb31('0xe')]);router[_0xcb31('0xf')]('/',auth[_0xcb31('0xa')](),controller[_0xcb31('0x10')]);router[_0xcb31('0x11')]('/:id',auth[_0xcb31('0xa')](),controller['update']);router[_0xcb31('0x12')](_0xcb31('0xb'),auth[_0xcb31('0xa')](),controller[_0xcb31('0x13')]);module['exports']=router; \ No newline at end of file +var _0xe93c=['express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./voiceMailMessage.controller','get','isAuthenticated','/:id','show','/:id/download','download','create','update','delete','destroy','exports','util','connect-timeout'];(function(_0x2fd358,_0x28e77a){var _0x530601=function(_0xb7f86){while(--_0xb7f86){_0x2fd358['push'](_0x2fd358['shift']());}};_0x530601(++_0x28e77a);}(_0xe93c,0x13e));var _0xce93=function(_0xbecf94,_0x50bef0){_0xbecf94=_0xbecf94-0x0;var _0x388191=_0xe93c[_0xbecf94];return _0x388191;};'use strict';var multer=require('multer');var util=require(_0xce93('0x0'));var path=require('path');var timeout=require(_0xce93('0x1'));var express=require(_0xce93('0x2'));var router=express[_0xce93('0x3')]();var fs_extra=require(_0xce93('0x4'));var auth=require(_0xce93('0x5'));var interaction=require(_0xce93('0x6'));var config=require(_0xce93('0x7'));var controller=require(_0xce93('0x8'));router[_0xce93('0x9')]('/',auth[_0xce93('0xa')](),controller['index']);router[_0xce93('0x9')](_0xce93('0xb'),auth[_0xce93('0xa')](),controller[_0xce93('0xc')]);router[_0xce93('0x9')](_0xce93('0xd'),auth[_0xce93('0xa')](),controller[_0xce93('0xe')]);router['post']('/',auth[_0xce93('0xa')](),controller[_0xce93('0xf')]);router['put'](_0xce93('0xb'),auth[_0xce93('0xa')](),controller[_0xce93('0x10')]);router[_0xce93('0x11')]('/:id',auth[_0xce93('0xa')](),controller[_0xce93('0x12')]);module[_0xce93('0x13')]=router; \ No newline at end of file diff --git a/server/api/voiceMailMessage/voiceMailMessage.attributes.js b/server/api/voiceMailMessage/voiceMailMessage.attributes.js index 13469d8..cbfa81c 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 _0x4384=['CURRENT_TIMESTAMP\x20ON\x20UPDATE\x20CURRENT_TIMESTAMP','sequelize','getDataValue','INTEGER','STRING','long','TIMESTAMP','literal'];(function(_0x4e9628,_0x250573){var _0x27bc8c=function(_0xb3b7ae){while(--_0xb3b7ae){_0x4e9628['push'](_0x4e9628['shift']());}};_0x27bc8c(++_0x250573);}(_0x4384,0x89));var _0x4438=function(_0x24f22d,_0x5a261a){_0x24f22d=_0x24f22d-0x0;var _0x441263=_0x4384[_0x24f22d];return _0x441263;};'use strict';var Sequelize=require(_0x4438('0x0'));module['exports']={'name':{'type':Sequelize['VIRTUAL'],'get':function(_0x181cbb){return this[_0x4438('0x1')]('id');}},'msgnum':{'type':Sequelize[_0x4438('0x2')](0xb),'defaultValue':0x0,'allowNull':![]},'dir':{'type':Sequelize[_0x4438('0x3')],'defaultValue':''},'context':{'type':Sequelize[_0x4438('0x3')],'defaultValue':''},'macrocontext':{'type':Sequelize[_0x4438('0x3')],'defaultValue':''},'callerid':{'type':Sequelize[_0x4438('0x3')],'defaultValue':''},'origtime':{'type':Sequelize['STRING'],'defaultValue':''},'duration':{'type':Sequelize[_0x4438('0x3')],'defaultValue':''},'mailboxuser':{'type':Sequelize[_0x4438('0x3')],'defaultValue':''},'mailboxcontext':{'type':Sequelize['STRING'],'defaultValue':''},'recording':{'type':Sequelize['BLOB'](_0x4438('0x4')),'defaultValue':null},'flag':{'type':Sequelize[_0x4438('0x3')],'defaultValue':''},'msg_id':{'type':Sequelize[_0x4438('0x3')],'defaultValue':''},'stamp':{'type':_0x4438('0x5'),'defaultValue':Sequelize[_0x4438('0x6')](_0x4438('0x7'))}}; \ No newline at end of file +var _0x61c1=['CURRENT_TIMESTAMP\x20ON\x20UPDATE\x20CURRENT_TIMESTAMP','sequelize','exports','VIRTUAL','getDataValue','INTEGER','STRING','TIMESTAMP','literal'];(function(_0x2c9618,_0x43183f){var _0x12613b=function(_0x213cc4){while(--_0x213cc4){_0x2c9618['push'](_0x2c9618['shift']());}};_0x12613b(++_0x43183f);}(_0x61c1,0x7f));var _0x161c=function(_0x30aa36,_0x353ed5){_0x30aa36=_0x30aa36-0x0;var _0x533690=_0x61c1[_0x30aa36];return _0x533690;};'use strict';var Sequelize=require(_0x161c('0x0'));module[_0x161c('0x1')]={'name':{'type':Sequelize[_0x161c('0x2')],'get':function(_0x570ede){return this[_0x161c('0x3')]('id');}},'msgnum':{'type':Sequelize[_0x161c('0x4')](0xb),'defaultValue':0x0,'allowNull':![]},'dir':{'type':Sequelize[_0x161c('0x5')],'defaultValue':''},'context':{'type':Sequelize[_0x161c('0x5')],'defaultValue':''},'macrocontext':{'type':Sequelize['STRING'],'defaultValue':''},'callerid':{'type':Sequelize[_0x161c('0x5')],'defaultValue':''},'origtime':{'type':Sequelize[_0x161c('0x5')],'defaultValue':''},'duration':{'type':Sequelize[_0x161c('0x5')],'defaultValue':''},'mailboxuser':{'type':Sequelize['STRING'],'defaultValue':''},'mailboxcontext':{'type':Sequelize[_0x161c('0x5')],'defaultValue':''},'recording':{'type':Sequelize['BLOB']('long'),'defaultValue':null},'flag':{'type':Sequelize[_0x161c('0x5')],'defaultValue':''},'msg_id':{'type':Sequelize['STRING'],'defaultValue':''},'stamp':{'type':_0x161c('0x6'),'defaultValue':Sequelize[_0x161c('0x7')](_0x161c('0x8'))}}; \ No newline at end of file diff --git a/server/api/voiceMailMessage/voiceMailMessage.controller.js b/server/api/voiceMailMessage/voiceMailMessage.controller.js index 5cabca8..1aa85ed 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 _0xa0f8=['rows','catch','show','create','update','body','find','params','destroy','download','msg_id','recording','ValidationError','VoiceMailMessage\x20not\x20found','audio/wav','attachment','Content-Disposition','.wav\x22','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','path','fs-extra','lodash','squel','jsforce','to-csv','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','end','json','offset','undefined','limit','count','status','set','Content-Range','reject','save','then','sendStatus','error','name','send','index','map','VoiceMailMessage','rawAttributes','key','model','differenceBy','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','order','sort','pick','filter','where','type','merge','options','includeAll','include','findAll'];(function(_0x2d76ac,_0x5b30c0){var _0x330806=function(_0x1d481c){while(--_0x1d481c){_0x2d76ac['push'](_0x2d76ac['shift']());}};_0x330806(++_0x5b30c0);}(_0xa0f8,0x166));var _0x8a0f=function(_0x487f15,_0x1cf5fb){_0x487f15=_0x487f15-0x0;var _0x32c8a1=_0xa0f8[_0x487f15];return _0x32c8a1;};'use strict';var emlformat=require(_0x8a0f('0x0'));var rimraf=require(_0x8a0f('0x1'));var zipdir=require(_0x8a0f('0x2'));var jsonpatch=require(_0x8a0f('0x3'));var rp=require(_0x8a0f('0x4'));var moment=require(_0x8a0f('0x5'));var BPromise=require(_0x8a0f('0x6'));var Mustache=require('mustache');var util=require('util');var path=require(_0x8a0f('0x7'));var sox=require('sox');var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x8a0f('0x8'));var _=require(_0x8a0f('0x9'));var squel=require(_0x8a0f('0xa'));var crypto=require('crypto');var jsforce=require(_0x8a0f('0xb'));var deskjs=require('desk.js');var toCsv=require(_0x8a0f('0xc'));var querystring=require(_0x8a0f('0xd'));var Papa=require(_0x8a0f('0xe'));var Redis=require('ioredis');var authService=require(_0x8a0f('0xf'));var qs=require(_0x8a0f('0x10'));var as=require(_0x8a0f('0x11'));var hardwareService=require(_0x8a0f('0x12'));var logger=require(_0x8a0f('0x13'))(_0x8a0f('0x14'));var utils=require(_0x8a0f('0x15'));var config=require(_0x8a0f('0x16'));var licenseUtil=require(_0x8a0f('0x17'));var db=require(_0x8a0f('0x18'))['db'];function respondWithStatusCode(_0x275375,_0x3b1302){_0x3b1302=_0x3b1302||0xcc;return function(_0x54f273){if(_0x54f273){return _0x275375['sendStatus'](_0x3b1302);}return _0x275375['status'](_0x3b1302)[_0x8a0f('0x19')]();};}function respondWithResult(_0x1b61ed,_0x11dba4){_0x11dba4=_0x11dba4||0xc8;return function(_0x4f15b5){if(_0x4f15b5){return _0x1b61ed['status'](_0x11dba4)[_0x8a0f('0x1a')](_0x4f15b5);}};}function respondWithFilteredResult(_0x592e9a,_0x22289a){return function(_0xf2a888){if(_0xf2a888){var _0x3ed19c=typeof _0x22289a[_0x8a0f('0x1b')]===_0x8a0f('0x1c')&&typeof _0x22289a[_0x8a0f('0x1d')]===_0x8a0f('0x1c');var _0x301f91=_0xf2a888[_0x8a0f('0x1e')];var _0x159330=_0x3ed19c?0x0:_0x22289a['offset'];var _0x2bd424=_0x3ed19c?_0xf2a888['count']:_0x22289a[_0x8a0f('0x1b')]+_0x22289a['limit'];var _0xc09c3b;if(_0x2bd424>=_0x301f91){_0x2bd424=_0x301f91;_0xc09c3b=0xc8;}else{_0xc09c3b=0xce;}_0x592e9a[_0x8a0f('0x1f')](_0xc09c3b);return _0x592e9a[_0x8a0f('0x20')](_0x8a0f('0x21'),_0x159330+'-'+_0x2bd424+'/'+_0x301f91)[_0x8a0f('0x1a')](_0xf2a888);}return null;};}function patchUpdates(_0x2fa36d){return function(_0x501892){try{jsonpatch['apply'](_0x501892,_0x2fa36d,!![]);}catch(_0x28ae20){return BPromise[_0x8a0f('0x22')](_0x28ae20);}return _0x501892[_0x8a0f('0x23')]();};}function saveUpdates(_0x4c8da3,_0x51e8d1){return function(_0x3d5c32){if(_0x3d5c32){return _0x3d5c32['update'](_0x4c8da3)[_0x8a0f('0x24')](function(_0x9e85f2){return _0x9e85f2;});}return null;};}function removeEntity(_0x1d2b88,_0x22234c){return function(_0x2ae6fb){if(_0x2ae6fb){return _0x2ae6fb['destroy']()[_0x8a0f('0x24')](function(){_0x1d2b88[_0x8a0f('0x1f')](0xcc)[_0x8a0f('0x19')]();});}};}function handleEntityNotFound(_0x582b11,_0x4490e7){return function(_0x7c2028){if(!_0x7c2028){_0x582b11[_0x8a0f('0x25')](0x194);}return _0x7c2028;};}function handleError(_0xb2cf17,_0x34e734){_0x34e734=_0x34e734||0x1f4;return function(_0x474157){logger[_0x8a0f('0x26')](_0x474157['stack']);if(_0x474157['name']){delete _0x474157[_0x8a0f('0x27')];}_0xb2cf17[_0x8a0f('0x1f')](_0x34e734)[_0x8a0f('0x28')](_0x474157);};}exports[_0x8a0f('0x29')]=function(_0x5d9186,_0x1ebb2d){var _0x52192c={},_0x512ae3={},_0x1cc95c={'count':0x0,'rows':[]};var _0x2fc202=_[_0x8a0f('0x2a')](db[_0x8a0f('0x2b')][_0x8a0f('0x2c')],function(_0x4022ee){return{'name':_0x4022ee['fieldName'],'type':_0x4022ee['type'][_0x8a0f('0x2d')]};});_0x512ae3[_0x8a0f('0x2e')]=_[_0x8a0f('0x2f')](_[_0x8a0f('0x2a')](_0x2fc202,_0x8a0f('0x27')),['name']);_0x512ae3[_0x8a0f('0x30')]=_[_0x8a0f('0x31')](_0x5d9186[_0x8a0f('0x30')]);_0x512ae3[_0x8a0f('0x32')]=_[_0x8a0f('0x33')](_0x512ae3['model'],_0x512ae3[_0x8a0f('0x30')]);_0x52192c[_0x8a0f('0x34')]=_[_0x8a0f('0x33')](_0x512ae3[_0x8a0f('0x2e')],qs['fields'](_0x5d9186[_0x8a0f('0x30')][_0x8a0f('0x35')]));_0x52192c[_0x8a0f('0x34')]=_0x52192c[_0x8a0f('0x34')][_0x8a0f('0x36')]?_0x52192c[_0x8a0f('0x34')]:_0x512ae3[_0x8a0f('0x2e')];if(!_0x5d9186[_0x8a0f('0x30')][_0x8a0f('0x37')]('nolimit')){_0x52192c['limit']=qs['limit'](_0x5d9186[_0x8a0f('0x30')][_0x8a0f('0x1d')]);_0x52192c['offset']=qs[_0x8a0f('0x1b')](_0x5d9186['query']['offset']);}_0x52192c[_0x8a0f('0x38')]=qs[_0x8a0f('0x39')](_0x5d9186[_0x8a0f('0x30')][_0x8a0f('0x39')]);_0x52192c['where']=qs[_0x8a0f('0x32')](_[_0x8a0f('0x3a')](_0x5d9186[_0x8a0f('0x30')],_0x512ae3[_0x8a0f('0x32')]),_0x2fc202);if(_0x5d9186[_0x8a0f('0x30')][_0x8a0f('0x3b')]){_0x52192c['where']=_['merge'](_0x52192c[_0x8a0f('0x3c')],{'$or':_['map'](_0x2fc202,function(_0x292bad){if(_0x292bad[_0x8a0f('0x3d')]!=='VIRTUAL'){var _0x56b7e4={};_0x56b7e4[_0x292bad[_0x8a0f('0x27')]]={'$like':'%'+_0x5d9186[_0x8a0f('0x30')][_0x8a0f('0x3b')]+'%'};return _0x56b7e4;}})});}_0x52192c=_[_0x8a0f('0x3e')]({},_0x52192c,_0x5d9186[_0x8a0f('0x3f')]);var _0x3955f5={'where':_0x52192c[_0x8a0f('0x3c')]};return db[_0x8a0f('0x2b')][_0x8a0f('0x1e')](_0x3955f5)[_0x8a0f('0x24')](function(_0x266784){_0x1cc95c[_0x8a0f('0x1e')]=_0x266784;if(_0x5d9186[_0x8a0f('0x30')][_0x8a0f('0x40')]){_0x52192c[_0x8a0f('0x41')]=[{'all':!![]}];}return db['VoiceMailMessage'][_0x8a0f('0x42')](_0x52192c);})[_0x8a0f('0x24')](function(_0x46f5f9){_0x1cc95c[_0x8a0f('0x43')]=_0x46f5f9;return _0x1cc95c;})[_0x8a0f('0x24')](respondWithFilteredResult(_0x1ebb2d,_0x52192c))[_0x8a0f('0x44')](handleError(_0x1ebb2d,null));};exports[_0x8a0f('0x45')]=function(_0x1800a0,_0x41a863){var _0xff19e7={'raw':!![],'where':{'id':_0x1800a0['params']['id']}},_0x53f59d={};_0x53f59d[_0x8a0f('0x2e')]=_['keys'](db['VoiceMailMessage'][_0x8a0f('0x2c')]);_0x53f59d[_0x8a0f('0x30')]=_[_0x8a0f('0x31')](_0x1800a0[_0x8a0f('0x30')]);_0x53f59d['filters']=_[_0x8a0f('0x33')](_0x53f59d[_0x8a0f('0x2e')],_0x53f59d['query']);_0xff19e7['attributes']=_[_0x8a0f('0x33')](_0x53f59d[_0x8a0f('0x2e')],qs[_0x8a0f('0x35')](_0x1800a0[_0x8a0f('0x30')][_0x8a0f('0x35')]));_0xff19e7[_0x8a0f('0x34')]=_0xff19e7['attributes'][_0x8a0f('0x36')]?_0xff19e7['attributes']:_0x53f59d[_0x8a0f('0x2e')];if(_0x1800a0['query']['includeAll']){_0xff19e7[_0x8a0f('0x41')]=[{'all':!![]}];}_0xff19e7=_['merge']({},_0xff19e7,_0x1800a0['options']);return db[_0x8a0f('0x2b')]['find'](_0xff19e7)[_0x8a0f('0x24')](handleEntityNotFound(_0x41a863,null))['then'](respondWithResult(_0x41a863,null))[_0x8a0f('0x44')](handleError(_0x41a863,null));};exports[_0x8a0f('0x46')]=function(_0x1e41cf,_0x298ca4){return db[_0x8a0f('0x2b')]['create'](_0x1e41cf['body'],{})[_0x8a0f('0x24')](respondWithResult(_0x298ca4,0xc9))[_0x8a0f('0x44')](handleError(_0x298ca4,null));};exports[_0x8a0f('0x47')]=function(_0x5ccbe7,_0x260397){if(_0x5ccbe7['body']['id']){delete _0x5ccbe7[_0x8a0f('0x48')]['id'];}return db[_0x8a0f('0x2b')][_0x8a0f('0x49')]({'where':{'id':_0x5ccbe7[_0x8a0f('0x4a')]['id']}})['then'](handleEntityNotFound(_0x260397,null))[_0x8a0f('0x24')](saveUpdates(_0x5ccbe7[_0x8a0f('0x48')],null))[_0x8a0f('0x24')](respondWithResult(_0x260397,null))['catch'](handleError(_0x260397,null));};exports[_0x8a0f('0x4b')]=function(_0x45a725,_0x96fb73){return db[_0x8a0f('0x2b')]['find']({'where':{'id':_0x45a725[_0x8a0f('0x4a')]['id']}})['then'](handleEntityNotFound(_0x96fb73,null))[_0x8a0f('0x24')](removeEntity(_0x96fb73,null))[_0x8a0f('0x44')](handleError(_0x96fb73,null));};exports[_0x8a0f('0x4c')]=function(_0x23d42a,_0xb799c0,_0x28c3fe){return db[_0x8a0f('0x2b')][_0x8a0f('0x49')]({'where':{'id':_0x23d42a[_0x8a0f('0x4a')]['id']},'attributes':['id','recording',_0x8a0f('0x4d')]})[_0x8a0f('0x24')](handleEntityNotFound(_0xb799c0,null))[_0x8a0f('0x24')](function(_0x418f4c){if(_0x418f4c){if(!_0x418f4c[_0x8a0f('0x4e')]){throw new db['Sequelize'][(_0x8a0f('0x4f'))](_0x8a0f('0x50'));}var _0x4c56ff={'Content-Type':_0x8a0f('0x51'),'Content-Disposition':_0x8a0f('0x52')};if(_0x418f4c['msg_id']){_0x4c56ff[_0x8a0f('0x53')]='attachment;\x20filename=\x22'+_0x418f4c['msg_id']+_0x8a0f('0x54');}_0xb799c0['set'](_0x4c56ff);return _0xb799c0[_0x8a0f('0x28')](new Buffer(_0x418f4c['recording']));}})[_0x8a0f('0x44')](handleError(_0xb799c0,null));}; \ No newline at end of file +var _0xa820=['keys','filters','intersection','attributes','fields','hasOwnProperty','order','sort','pick','filter','merge','where','options','include','findAll','rows','catch','show','params','length','create','body','find','download','recording','msg_id','VoiceMailMessage\x20not\x20found','attachment','Content-Disposition','attachment;\x20filename=\x22','.wav\x22','zip-dir','request-promise','bluebird','mustache','util','path','sox','to-csv','fs-extra','lodash','squel','jsforce','desk.js','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','undefined','limit','count','set','Content-Range','apply','reject','then','destroy','stack','name','send','map','VoiceMailMessage','fieldName','type','key','model','differenceBy','query'];(function(_0x20d713,_0x955578){var _0xc4f054=function(_0x93dec6){while(--_0x93dec6){_0x20d713['push'](_0x20d713['shift']());}};_0xc4f054(++_0x955578);}(_0xa820,0xbb));var _0x0a82=function(_0x369151,_0x179f72){_0x369151=_0x369151-0x0;var _0x4292d5=_0xa820[_0x369151];return _0x4292d5;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0x0a82('0x0'));var jsonpatch=require('fast-json-patch');var rp=require(_0x0a82('0x1'));var moment=require('moment');var BPromise=require(_0x0a82('0x2'));var Mustache=require(_0x0a82('0x3'));var util=require(_0x0a82('0x4'));var path=require(_0x0a82('0x5'));var sox=require(_0x0a82('0x6'));var csv=require(_0x0a82('0x7'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x0a82('0x8'));var _=require(_0x0a82('0x9'));var squel=require(_0x0a82('0xa'));var crypto=require('crypto');var jsforce=require(_0x0a82('0xb'));var deskjs=require(_0x0a82('0xc'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x0a82('0xd'));var authService=require(_0x0a82('0xe'));var qs=require(_0x0a82('0xf'));var as=require(_0x0a82('0x10'));var hardwareService=require(_0x0a82('0x11'));var logger=require('../../config/logger')(_0x0a82('0x12'));var utils=require(_0x0a82('0x13'));var config=require('../../config/environment');var licenseUtil=require(_0x0a82('0x14'));var db=require(_0x0a82('0x15'))['db'];function respondWithStatusCode(_0x5287b5,_0x20ca4f){_0x20ca4f=_0x20ca4f||0xcc;return function(_0x14d895){if(_0x14d895){return _0x5287b5[_0x0a82('0x16')](_0x20ca4f);}return _0x5287b5[_0x0a82('0x17')](_0x20ca4f)[_0x0a82('0x18')]();};}function respondWithResult(_0x3fb5c1,_0x4f2ccd){_0x4f2ccd=_0x4f2ccd||0xc8;return function(_0xbfdfcd){if(_0xbfdfcd){return _0x3fb5c1['status'](_0x4f2ccd)[_0x0a82('0x19')](_0xbfdfcd);}};}function respondWithFilteredResult(_0x2b1c4d,_0x1eb3ef){return function(_0x64f8e){if(_0x64f8e){var _0x171105=typeof _0x1eb3ef[_0x0a82('0x1a')]===_0x0a82('0x1b')&&typeof _0x1eb3ef[_0x0a82('0x1c')]==='undefined';var _0x4d5ee5=_0x64f8e['count'];var _0x3d64d3=_0x171105?0x0:_0x1eb3ef[_0x0a82('0x1a')];var _0x32e898=_0x171105?_0x64f8e[_0x0a82('0x1d')]:_0x1eb3ef[_0x0a82('0x1a')]+_0x1eb3ef[_0x0a82('0x1c')];var _0x49f6db;if(_0x32e898>=_0x4d5ee5){_0x32e898=_0x4d5ee5;_0x49f6db=0xc8;}else{_0x49f6db=0xce;}_0x2b1c4d[_0x0a82('0x17')](_0x49f6db);return _0x2b1c4d[_0x0a82('0x1e')](_0x0a82('0x1f'),_0x3d64d3+'-'+_0x32e898+'/'+_0x4d5ee5)[_0x0a82('0x19')](_0x64f8e);}return null;};}function patchUpdates(_0x2f6d03){return function(_0x5b09c8){try{jsonpatch[_0x0a82('0x20')](_0x5b09c8,_0x2f6d03,!![]);}catch(_0x4be487){return BPromise[_0x0a82('0x21')](_0x4be487);}return _0x5b09c8['save']();};}function saveUpdates(_0x3be157,_0x25e384){return function(_0x483876){if(_0x483876){return _0x483876['update'](_0x3be157)[_0x0a82('0x22')](function(_0x553325){return _0x553325;});}return null;};}function removeEntity(_0x1106da,_0x3ad273){return function(_0xc493e4){if(_0xc493e4){return _0xc493e4[_0x0a82('0x23')]()['then'](function(){_0x1106da['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x47a803,_0x585575){return function(_0x42d102){if(!_0x42d102){_0x47a803['sendStatus'](0x194);}return _0x42d102;};}function handleError(_0x112137,_0xbb46fd){_0xbb46fd=_0xbb46fd||0x1f4;return function(_0x19179a){logger['error'](_0x19179a[_0x0a82('0x24')]);if(_0x19179a[_0x0a82('0x25')]){delete _0x19179a[_0x0a82('0x25')];}_0x112137[_0x0a82('0x17')](_0xbb46fd)[_0x0a82('0x26')](_0x19179a);};}exports['index']=function(_0x165c68,_0x3aa3c5){var _0x55a35f={},_0x32f0d9={},_0x3a55aa={'count':0x0,'rows':[]};var _0x5df8d8=_[_0x0a82('0x27')](db[_0x0a82('0x28')]['rawAttributes'],function(_0xe6252d){return{'name':_0xe6252d[_0x0a82('0x29')],'type':_0xe6252d[_0x0a82('0x2a')][_0x0a82('0x2b')]};});_0x32f0d9[_0x0a82('0x2c')]=_[_0x0a82('0x2d')](_[_0x0a82('0x27')](_0x5df8d8,_0x0a82('0x25')),[_0x0a82('0x25')]);_0x32f0d9[_0x0a82('0x2e')]=_[_0x0a82('0x2f')](_0x165c68['query']);_0x32f0d9[_0x0a82('0x30')]=_[_0x0a82('0x31')](_0x32f0d9['model'],_0x32f0d9['query']);_0x55a35f[_0x0a82('0x32')]=_[_0x0a82('0x31')](_0x32f0d9[_0x0a82('0x2c')],qs[_0x0a82('0x33')](_0x165c68[_0x0a82('0x2e')][_0x0a82('0x33')]));_0x55a35f[_0x0a82('0x32')]=_0x55a35f[_0x0a82('0x32')]['length']?_0x55a35f[_0x0a82('0x32')]:_0x32f0d9[_0x0a82('0x2c')];if(!_0x165c68[_0x0a82('0x2e')][_0x0a82('0x34')]('nolimit')){_0x55a35f[_0x0a82('0x1c')]=qs[_0x0a82('0x1c')](_0x165c68[_0x0a82('0x2e')][_0x0a82('0x1c')]);_0x55a35f[_0x0a82('0x1a')]=qs[_0x0a82('0x1a')](_0x165c68[_0x0a82('0x2e')][_0x0a82('0x1a')]);}_0x55a35f[_0x0a82('0x35')]=qs[_0x0a82('0x36')](_0x165c68[_0x0a82('0x2e')][_0x0a82('0x36')]);_0x55a35f['where']=qs[_0x0a82('0x30')](_[_0x0a82('0x37')](_0x165c68[_0x0a82('0x2e')],_0x32f0d9[_0x0a82('0x30')]),_0x5df8d8);if(_0x165c68[_0x0a82('0x2e')][_0x0a82('0x38')]){_0x55a35f['where']=_[_0x0a82('0x39')](_0x55a35f[_0x0a82('0x3a')],{'$or':_[_0x0a82('0x27')](_0x5df8d8,function(_0x5d007b){if(_0x5d007b[_0x0a82('0x2a')]!=='VIRTUAL'){var _0x3fc169={};_0x3fc169[_0x5d007b[_0x0a82('0x25')]]={'$like':'%'+_0x165c68[_0x0a82('0x2e')][_0x0a82('0x38')]+'%'};return _0x3fc169;}})});}_0x55a35f=_[_0x0a82('0x39')]({},_0x55a35f,_0x165c68[_0x0a82('0x3b')]);var _0x4c9bc4={'where':_0x55a35f[_0x0a82('0x3a')]};return db[_0x0a82('0x28')][_0x0a82('0x1d')](_0x4c9bc4)[_0x0a82('0x22')](function(_0x3d6282){_0x3a55aa[_0x0a82('0x1d')]=_0x3d6282;if(_0x165c68[_0x0a82('0x2e')]['includeAll']){_0x55a35f[_0x0a82('0x3c')]=[{'all':!![]}];}return db[_0x0a82('0x28')][_0x0a82('0x3d')](_0x55a35f);})[_0x0a82('0x22')](function(_0x43f5bb){_0x3a55aa[_0x0a82('0x3e')]=_0x43f5bb;return _0x3a55aa;})[_0x0a82('0x22')](respondWithFilteredResult(_0x3aa3c5,_0x55a35f))[_0x0a82('0x3f')](handleError(_0x3aa3c5,null));};exports[_0x0a82('0x40')]=function(_0x5486ef,_0x4ebcdc){var _0x493661={'raw':!![],'where':{'id':_0x5486ef[_0x0a82('0x41')]['id']}},_0x3f1e27={};_0x3f1e27['model']=_[_0x0a82('0x2f')](db[_0x0a82('0x28')]['rawAttributes']);_0x3f1e27[_0x0a82('0x2e')]=_[_0x0a82('0x2f')](_0x5486ef[_0x0a82('0x2e')]);_0x3f1e27['filters']=_[_0x0a82('0x31')](_0x3f1e27[_0x0a82('0x2c')],_0x3f1e27['query']);_0x493661[_0x0a82('0x32')]=_['intersection'](_0x3f1e27[_0x0a82('0x2c')],qs['fields'](_0x5486ef[_0x0a82('0x2e')][_0x0a82('0x33')]));_0x493661['attributes']=_0x493661[_0x0a82('0x32')][_0x0a82('0x42')]?_0x493661[_0x0a82('0x32')]:_0x3f1e27[_0x0a82('0x2c')];if(_0x5486ef[_0x0a82('0x2e')]['includeAll']){_0x493661['include']=[{'all':!![]}];}_0x493661=_['merge']({},_0x493661,_0x5486ef[_0x0a82('0x3b')]);return db[_0x0a82('0x28')]['find'](_0x493661)[_0x0a82('0x22')](handleEntityNotFound(_0x4ebcdc,null))[_0x0a82('0x22')](respondWithResult(_0x4ebcdc,null))['catch'](handleError(_0x4ebcdc,null));};exports[_0x0a82('0x43')]=function(_0x36cbde,_0xf4a72f){return db[_0x0a82('0x28')][_0x0a82('0x43')](_0x36cbde[_0x0a82('0x44')],{})[_0x0a82('0x22')](respondWithResult(_0xf4a72f,0xc9))[_0x0a82('0x3f')](handleError(_0xf4a72f,null));};exports['update']=function(_0x4bb9b6,_0x1986f9){if(_0x4bb9b6[_0x0a82('0x44')]['id']){delete _0x4bb9b6['body']['id'];}return db[_0x0a82('0x28')][_0x0a82('0x45')]({'where':{'id':_0x4bb9b6[_0x0a82('0x41')]['id']}})[_0x0a82('0x22')](handleEntityNotFound(_0x1986f9,null))[_0x0a82('0x22')](saveUpdates(_0x4bb9b6[_0x0a82('0x44')],null))[_0x0a82('0x22')](respondWithResult(_0x1986f9,null))[_0x0a82('0x3f')](handleError(_0x1986f9,null));};exports[_0x0a82('0x23')]=function(_0x4f9a0f,_0x153d1b){return db['VoiceMailMessage']['find']({'where':{'id':_0x4f9a0f['params']['id']}})[_0x0a82('0x22')](handleEntityNotFound(_0x153d1b,null))[_0x0a82('0x22')](removeEntity(_0x153d1b,null))[_0x0a82('0x3f')](handleError(_0x153d1b,null));};exports[_0x0a82('0x46')]=function(_0x265542,_0x4178e0,_0x181c1a){return db[_0x0a82('0x28')]['find']({'where':{'id':_0x265542[_0x0a82('0x41')]['id']},'attributes':['id',_0x0a82('0x47'),_0x0a82('0x48')]})[_0x0a82('0x22')](handleEntityNotFound(_0x4178e0,null))['then'](function(_0x4974b4){if(_0x4974b4){if(!_0x4974b4[_0x0a82('0x47')]){throw new db['Sequelize']['ValidationError'](_0x0a82('0x49'));}var _0x3b2937={'Content-Type':'audio/wav','Content-Disposition':_0x0a82('0x4a')};if(_0x4974b4[_0x0a82('0x48')]){_0x3b2937[_0x0a82('0x4b')]=_0x0a82('0x4c')+_0x4974b4[_0x0a82('0x48')]+_0x0a82('0x4d');}_0x4178e0[_0x0a82('0x1e')](_0x3b2937);return _0x4178e0[_0x0a82('0x26')](new Buffer(_0x4974b4[_0x0a82('0x47')]));}})[_0x0a82('0x3f')](handleError(_0x4178e0,null));}; \ No newline at end of file diff --git a/server/api/voiceMailMessage/voiceMailMessage.model.js b/server/api/voiceMailMessage/voiceMailMessage.model.js index ad1c8aa..22fd895 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 _0x973d=['../../config/logger','bluebird','request-promise','path','rimraf','../../config/environment','./voiceMailMessage.attributes','exports','define','VoiceMailMessage','voice_voicemail_messages','dir','lodash','util'];(function(_0x4149ae,_0x11fab6){var _0x2cd18a=function(_0x4f2e1a){while(--_0x4f2e1a){_0x4149ae['push'](_0x4149ae['shift']());}};_0x2cd18a(++_0x11fab6);}(_0x973d,0x1b0));var _0xd973=function(_0x175a8c,_0x2d9212){_0x175a8c=_0x175a8c-0x0;var _0x37b0b0=_0x973d[_0x175a8c];return _0x37b0b0;};'use strict';var _=require(_0xd973('0x0'));var util=require(_0xd973('0x1'));var logger=require(_0xd973('0x2'))('api');var moment=require('moment');var BPromise=require(_0xd973('0x3'));var rp=require(_0xd973('0x4'));var fs=require('fs');var path=require(_0xd973('0x5'));var rimraf=require(_0xd973('0x6'));var config=require(_0xd973('0x7'));var attributes=require(_0xd973('0x8'));module[_0xd973('0x9')]=function(_0x584d12,_0xba13cd){return _0x584d12[_0xd973('0xa')](_0xd973('0xb'),attributes,{'tableName':_0xd973('0xc'),'paranoid':![],'indexes':[{'name':_0xd973('0xd'),'fields':[_0xd973('0xd')]}],'timestamps':![]});}; \ No newline at end of file +var _0x6ac4=['dir','lodash','util','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./voiceMailMessage.attributes','exports','define','VoiceMailMessage','voice_voicemail_messages'];(function(_0x56d0b2,_0x2f7c9e){var _0x37e421=function(_0x23b3a9){while(--_0x23b3a9){_0x56d0b2['push'](_0x56d0b2['shift']());}};_0x37e421(++_0x2f7c9e);}(_0x6ac4,0xf1));var _0x46ac=function(_0x5e3178,_0x3492da){_0x5e3178=_0x5e3178-0x0;var _0x905dcf=_0x6ac4[_0x5e3178];return _0x905dcf;};'use strict';var _=require(_0x46ac('0x0'));var util=require(_0x46ac('0x1'));var logger=require('../../config/logger')(_0x46ac('0x2'));var moment=require(_0x46ac('0x3'));var BPromise=require(_0x46ac('0x4'));var rp=require(_0x46ac('0x5'));var fs=require('fs');var path=require(_0x46ac('0x6'));var rimraf=require(_0x46ac('0x7'));var config=require(_0x46ac('0x8'));var attributes=require(_0x46ac('0x9'));module[_0x46ac('0xa')]=function(_0x3a46d8,_0x16ba23){return _0x3a46d8[_0x46ac('0xb')](_0x46ac('0xc'),attributes,{'tableName':_0x46ac('0xd'),'paranoid':![],'indexes':[{'name':_0x46ac('0xe'),'fields':[_0x46ac('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 f49f1d0..f15405e 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 _0x7568=['request','then','VoiceMailMessage,\x20%s,\x20%s','request\x20sent','stringify','error','message','result','catch','lodash','util','bluebird','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','http'];(function(_0x2f32c4,_0x531dc6){var _0x3f3018=function(_0x406998){while(--_0x406998){_0x2f32c4['push'](_0x2f32c4['shift']());}};_0x3f3018(++_0x531dc6);}(_0x7568,0x185));var _0x8756=function(_0x616290,_0x280b7f){_0x616290=_0x616290-0x0;var _0x453879=_0x7568[_0x616290];return _0x453879;};'use strict';var _=require(_0x8756('0x0'));var util=require(_0x8756('0x1'));var moment=require('moment');var BPromise=require(_0x8756('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x8756('0x3'))['db'];var utils=require(_0x8756('0x4'));var logger=require(_0x8756('0x5'))(_0x8756('0x6'));var config=require(_0x8756('0x7'));var jayson=require('jayson/promise');var client=jayson[_0x8756('0x8')][_0x8756('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x3e4fbd,_0x28f782,_0x490da7){return new BPromise(function(_0x58d8b0,_0x1d2cb8){return client[_0x8756('0xa')](_0x3e4fbd,_0x490da7)[_0x8756('0xb')](function(_0x2f4f08){logger['info'](_0x8756('0xc'),_0x28f782,_0x8756('0xd'));logger['debug']('VoiceMailMessage,\x20%s,\x20%s,\x20%s',_0x28f782,_0x8756('0xd'),JSON[_0x8756('0xe')](_0x2f4f08));if(_0x2f4f08[_0x8756('0xf')]){if(_0x2f4f08[_0x8756('0xf')]['code']===0x1f4){logger[_0x8756('0xf')]('VoiceMailMessage,\x20%s,\x20%s',_0x28f782,_0x2f4f08[_0x8756('0xf')][_0x8756('0x10')]);return _0x1d2cb8(_0x2f4f08[_0x8756('0xf')]['message']);}logger[_0x8756('0xf')](_0x8756('0xc'),_0x28f782,_0x2f4f08[_0x8756('0xf')][_0x8756('0x10')]);return _0x58d8b0(_0x2f4f08['error']['message']);}else{logger['info'](_0x8756('0xc'),_0x28f782,_0x8756('0xd'));_0x58d8b0(_0x2f4f08[_0x8756('0x11')][_0x8756('0x10')]);}})[_0x8756('0x12')](function(_0x5eb6a2){logger['error']('VoiceMailMessage,\x20%s,\x20%s',_0x28f782,_0x5eb6a2);_0x1d2cb8(_0x5eb6a2);});});} \ No newline at end of file +var _0xe816=['stringify','error','message','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','client','http','request','then','info','VoiceMailMessage,\x20%s,\x20%s','request\x20sent','debug','VoiceMailMessage,\x20%s,\x20%s,\x20%s'];(function(_0x5bb187,_0x482026){var _0x1a44c9=function(_0x247688){while(--_0x247688){_0x5bb187['push'](_0x5bb187['shift']());}};_0x1a44c9(++_0x482026);}(_0xe816,0xe7));var _0x6e81=function(_0x54d2af,_0x1385b3){_0x54d2af=_0x54d2af-0x0;var _0x5dfee6=_0xe816[_0x54d2af];return _0x5dfee6;};'use strict';var _=require(_0x6e81('0x0'));var util=require(_0x6e81('0x1'));var moment=require(_0x6e81('0x2'));var BPromise=require(_0x6e81('0x3'));var rs=require(_0x6e81('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x6e81('0x5'))['db'];var utils=require(_0x6e81('0x6'));var logger=require('../../config/logger')('rpc');var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x6e81('0x7')][_0x6e81('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x81b7e9,_0x5b2dc9,_0x5a4c22){return new BPromise(function(_0x5e16f7,_0x29b128){return client[_0x6e81('0x9')](_0x81b7e9,_0x5a4c22)[_0x6e81('0xa')](function(_0x85a36a){logger[_0x6e81('0xb')](_0x6e81('0xc'),_0x5b2dc9,_0x6e81('0xd'));logger[_0x6e81('0xe')](_0x6e81('0xf'),_0x5b2dc9,'request\x20sent',JSON[_0x6e81('0x10')](_0x85a36a));if(_0x85a36a[_0x6e81('0x11')]){if(_0x85a36a['error']['code']===0x1f4){logger['error']('VoiceMailMessage,\x20%s,\x20%s',_0x5b2dc9,_0x85a36a[_0x6e81('0x11')]['message']);return _0x29b128(_0x85a36a[_0x6e81('0x11')][_0x6e81('0x12')]);}logger['error'](_0x6e81('0xc'),_0x5b2dc9,_0x85a36a[_0x6e81('0x11')][_0x6e81('0x12')]);return _0x5e16f7(_0x85a36a[_0x6e81('0x11')][_0x6e81('0x12')]);}else{logger[_0x6e81('0xb')]('VoiceMailMessage,\x20%s,\x20%s',_0x5b2dc9,_0x6e81('0xd'));_0x5e16f7(_0x85a36a['result'][_0x6e81('0x12')]);}})['catch'](function(_0x463c10){logger[_0x6e81('0x11')](_0x6e81('0xc'),_0x5b2dc9,_0x463c10);_0x29b128(_0x463c10);});});} \ No newline at end of file diff --git a/server/api/voiceMusicOnHold/index.js b/server/api/voiceMusicOnHold/index.js index a7e664f..6962ff9 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 _0xb52c=['isAuthenticated','index','get','/:id','show','getSounds','post','create','/:id/sounds','addSound','put','update','delete','removeSound','exports','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service'];(function(_0x49afb8,_0x48be44){var _0x7a587c=function(_0x24ca0a){while(--_0x24ca0a){_0x49afb8['push'](_0x49afb8['shift']());}};_0x7a587c(++_0x48be44);}(_0xb52c,0x1f3));var _0xcb52=function(_0x37edd5,_0x5b3a32){_0x37edd5=_0x37edd5-0x0;var _0x46a30e=_0xb52c[_0x37edd5];return _0x46a30e;};'use strict';var multer=require('multer');var util=require(_0xcb52('0x0'));var path=require(_0xcb52('0x1'));var timeout=require(_0xcb52('0x2'));var express=require(_0xcb52('0x3'));var router=express[_0xcb52('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0xcb52('0x5'));var interaction=require(_0xcb52('0x6'));var config=require('../../config/environment');var controller=require('./voiceMusicOnHold.controller');router['get']('/',auth[_0xcb52('0x7')](),controller[_0xcb52('0x8')]);router[_0xcb52('0x9')](_0xcb52('0xa'),auth[_0xcb52('0x7')](),controller[_0xcb52('0xb')]);router[_0xcb52('0x9')]('/:id/sounds',auth[_0xcb52('0x7')](),controller[_0xcb52('0xc')]);router[_0xcb52('0xd')]('/',auth['isAuthenticated'](),controller[_0xcb52('0xe')]);router[_0xcb52('0xd')](_0xcb52('0xf'),auth['isAuthenticated'](),controller[_0xcb52('0x10')]);router[_0xcb52('0x11')](_0xcb52('0xa'),auth[_0xcb52('0x7')](),controller[_0xcb52('0x12')]);router[_0xcb52('0x13')]('/:id',auth[_0xcb52('0x7')](),controller['destroy']);router[_0xcb52('0x13')]('/:id/sounds/:id2',auth[_0xcb52('0x7')](),controller[_0xcb52('0x14')]);module[_0xcb52('0x15')]=router; \ No newline at end of file +var _0xfad4=['/:id','isAuthenticated','/:id/sounds','getSounds','post','create','addSound','put','delete','destroy','/:id/sounds/:id2','removeSound','exports','util','path','express','Router','fs-extra','../../components/auth/service','../../config/environment','get'];(function(_0x32f589,_0x48afeb){var _0x577b5d=function(_0x22049c){while(--_0x22049c){_0x32f589['push'](_0x32f589['shift']());}};_0x577b5d(++_0x48afeb);}(_0xfad4,0x172));var _0x4fad=function(_0x5b366e,_0x54990a){_0x5b366e=_0x5b366e-0x0;var _0x6cd6a3=_0xfad4[_0x5b366e];return _0x6cd6a3;};'use strict';var multer=require('multer');var util=require(_0x4fad('0x0'));var path=require(_0x4fad('0x1'));var timeout=require('connect-timeout');var express=require(_0x4fad('0x2'));var router=express[_0x4fad('0x3')]();var fs_extra=require(_0x4fad('0x4'));var auth=require(_0x4fad('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0x4fad('0x6'));var controller=require('./voiceMusicOnHold.controller');router[_0x4fad('0x7')]('/',auth['isAuthenticated'](),controller['index']);router[_0x4fad('0x7')](_0x4fad('0x8'),auth[_0x4fad('0x9')](),controller['show']);router[_0x4fad('0x7')](_0x4fad('0xa'),auth[_0x4fad('0x9')](),controller[_0x4fad('0xb')]);router[_0x4fad('0xc')]('/',auth['isAuthenticated'](),controller[_0x4fad('0xd')]);router[_0x4fad('0xc')](_0x4fad('0xa'),auth[_0x4fad('0x9')](),controller[_0x4fad('0xe')]);router[_0x4fad('0xf')](_0x4fad('0x8'),auth[_0x4fad('0x9')](),controller['update']);router[_0x4fad('0x10')](_0x4fad('0x8'),auth[_0x4fad('0x9')](),controller[_0x4fad('0x11')]);router[_0x4fad('0x10')](_0x4fad('0x12'),auth['isAuthenticated'](),controller[_0x4fad('0x13')]);module[_0x4fad('0x14')]=router; \ No newline at end of file diff --git a/server/api/voiceMusicOnHold/voiceMusicOnHold.attributes.js b/server/api/voiceMusicOnHold/voiceMusicOnHold.attributes.js index 401625c..1cc0c3b 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 _0x8a66=['exports','name','ENUM','files','mp3nb','quietmp3nb','quietmp3','mp3','STRING','sequelize'];(function(_0x2fa04a,_0x324bb9){var _0x145d62=function(_0xc58bb0){while(--_0xc58bb0){_0x2fa04a['push'](_0x2fa04a['shift']());}};_0x145d62(++_0x324bb9);}(_0x8a66,0x1cb));var _0x68a6=function(_0x7ea1fb,_0x2f0b74){_0x7ea1fb=_0x7ea1fb-0x0;var _0x478241=_0x8a66[_0x7ea1fb];return _0x478241;};'use strict';var Sequelize=require(_0x68a6('0x0'));module[_0x68a6('0x1')]={'name':{'type':Sequelize['STRING'],'allowNull':![],'unique':_0x68a6('0x2')},'mode':{'type':Sequelize[_0x68a6('0x3')]('custom',_0x68a6('0x4'),_0x68a6('0x5'),_0x68a6('0x6'),_0x68a6('0x7'),_0x68a6('0x8')),'allowNull':!![],'defaultValue':_0x68a6('0x4')},'directory':{'type':Sequelize['STRING'],'allowNull':!![]},'application':{'type':Sequelize[_0x68a6('0x9')],'allowNull':!![]},'digit':{'type':Sequelize[_0x68a6('0x9')],'allowNull':!![]},'sort':{'type':Sequelize[_0x68a6('0x9')],'allowNull':!![],'defaultValue':'alpha'},'format':{'type':Sequelize[_0x68a6('0x9')],'allowNull':!![]},'stamp':{'type':'TIMESTAMP'},'defaultEntry':{'type':Sequelize['BOOLEAN'],'defaultValue':0x0}}; \ No newline at end of file +var _0x8c8c=['mp3nb','quietmp3','mp3','files','STRING','TIMESTAMP','BOOLEAN','sequelize','exports','name','ENUM','custom'];(function(_0x5d2803,_0xf375bd){var _0xdcad2c=function(_0x3c3a98){while(--_0x3c3a98){_0x5d2803['push'](_0x5d2803['shift']());}};_0xdcad2c(++_0xf375bd);}(_0x8c8c,0x133));var _0xc8c8=function(_0x3947c9,_0x4d6c97){_0x3947c9=_0x3947c9-0x0;var _0x2e7871=_0x8c8c[_0x3947c9];return _0x2e7871;};'use strict';var Sequelize=require(_0xc8c8('0x0'));module[_0xc8c8('0x1')]={'name':{'type':Sequelize['STRING'],'allowNull':![],'unique':_0xc8c8('0x2')},'mode':{'type':Sequelize[_0xc8c8('0x3')](_0xc8c8('0x4'),'files',_0xc8c8('0x5'),'quietmp3nb',_0xc8c8('0x6'),_0xc8c8('0x7')),'allowNull':!![],'defaultValue':_0xc8c8('0x8')},'directory':{'type':Sequelize['STRING'],'allowNull':!![]},'application':{'type':Sequelize[_0xc8c8('0x9')],'allowNull':!![]},'digit':{'type':Sequelize[_0xc8c8('0x9')],'allowNull':!![]},'sort':{'type':Sequelize[_0xc8c8('0x9')],'allowNull':!![],'defaultValue':'alpha'},'format':{'type':Sequelize[_0xc8c8('0x9')],'allowNull':!![]},'stamp':{'type':_0xc8c8('0xa')},'defaultEntry':{'type':Sequelize[_0xc8c8('0xb')],'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 81a883c..414415b 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 _0x531d=['length','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','count','includeAll','findAll','rows','catch','params','include','options','body','find','sequelize','transaction','mode','files','create','mkdirSync','directory','0777','get','user','UserProfileSection','MusicOnHolds','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','readdirSync','forEach','unlinkSync','join','rmdirSync','message','addSound','Sound','converted_format','createdAt','root','server/files/sounds/converted','format','%s.%s','basename','save_name','extname','server/files/moh','Sequelize','ValidationError','removeSound','findOne','id2','getSounds','hasOwnProperty','rimraf','zip-dir','bluebird','path','lodash','squel','crypto','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../config/license/hardware','api','../../config/environment','../../config/license/util','../../mysqldb','status','end','json','offset','undefined','limit','set','Content-Range','apply','reject','save','update','destroy','then','UserProfileResource','sendStatus','error','name','send','index','map','VoiceMusicOnHold','rawAttributes','fieldName','type','model','query','keys','filters','intersection','attributes','fields'];(function(_0x4111f8,_0x2c6325){var _0x4ac8d8=function(_0x8898bf){while(--_0x8898bf){_0x4111f8['push'](_0x4111f8['shift']());}};_0x4ac8d8(++_0x2c6325);}(_0x531d,0x10d));var _0xd531=function(_0x32a20b,_0x226241){_0x32a20b=_0x32a20b-0x0;var _0x25ae51=_0x531d[_0x32a20b];return _0x25ae51;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xd531('0x0'));var zipdir=require(_0xd531('0x1'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0xd531('0x2'));var Mustache=require('mustache');var util=require('util');var path=require(_0xd531('0x3'));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(_0xd531('0x4'));var squel=require(_0xd531('0x5'));var crypto=require(_0xd531('0x6'));var jsforce=require('jsforce');var deskjs=require(_0xd531('0x7'));var toCsv=require('to-csv');var querystring=require(_0xd531('0x8'));var Papa=require(_0xd531('0x9'));var Redis=require(_0xd531('0xa'));var authService=require('../../components/auth/service');var qs=require(_0xd531('0xb'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xd531('0xc'));var logger=require('../../config/logger')(_0xd531('0xd'));var utils=require('../../config/utils');var config=require(_0xd531('0xe'));var licenseUtil=require(_0xd531('0xf'));var db=require(_0xd531('0x10'))['db'];function respondWithStatusCode(_0x4d2920,_0x459a3c){_0x459a3c=_0x459a3c||0xcc;return function(_0x3edc86){if(_0x3edc86){return _0x4d2920['sendStatus'](_0x459a3c);}return _0x4d2920[_0xd531('0x11')](_0x459a3c)[_0xd531('0x12')]();};}function respondWithResult(_0xb86ba4,_0x1fbdfa){_0x1fbdfa=_0x1fbdfa||0xc8;return function(_0x139008){if(_0x139008){return _0xb86ba4[_0xd531('0x11')](_0x1fbdfa)[_0xd531('0x13')](_0x139008);}};}function respondWithFilteredResult(_0x1e33c0,_0x56cfa9){return function(_0x2b4009){if(_0x2b4009){var _0x43d5f8=typeof _0x56cfa9[_0xd531('0x14')]===_0xd531('0x15')&&typeof _0x56cfa9[_0xd531('0x16')]===_0xd531('0x15');var _0x3a85a5=_0x2b4009['count'];var _0x3dec12=_0x43d5f8?0x0:_0x56cfa9[_0xd531('0x14')];var _0x33caaa=_0x43d5f8?_0x2b4009['count']:_0x56cfa9[_0xd531('0x14')]+_0x56cfa9[_0xd531('0x16')];var _0x41aa8d;if(_0x33caaa>=_0x3a85a5){_0x33caaa=_0x3a85a5;_0x41aa8d=0xc8;}else{_0x41aa8d=0xce;}_0x1e33c0[_0xd531('0x11')](_0x41aa8d);return _0x1e33c0[_0xd531('0x17')](_0xd531('0x18'),_0x3dec12+'-'+_0x33caaa+'/'+_0x3a85a5)['json'](_0x2b4009);}return null;};}function patchUpdates(_0x34823d){return function(_0x2ea501){try{jsonpatch[_0xd531('0x19')](_0x2ea501,_0x34823d,!![]);}catch(_0x2f4d70){return BPromise[_0xd531('0x1a')](_0x2f4d70);}return _0x2ea501[_0xd531('0x1b')]();};}function saveUpdates(_0x1bf850,_0x484b13){return function(_0xa78104){if(_0xa78104){return _0xa78104[_0xd531('0x1c')](_0x1bf850)['then'](function(_0x472d59){return _0x472d59;});}return null;};}function removeEntity(_0x3f4736,_0x389c05){return function(_0xd54765){if(_0xd54765){return _0xd54765[_0xd531('0x1d')]()[_0xd531('0x1e')](function(){var _0x15b1d5=_0xd54765['get']({'plain':!![]});var _0x2a9f9a='MusicOnHolds';return db[_0xd531('0x1f')][_0xd531('0x1d')]({'where':{'type':_0x2a9f9a,'resourceId':_0x15b1d5['id']}})[_0xd531('0x1e')](function(){return _0xd54765;});})[_0xd531('0x1e')](function(){_0x3f4736['status'](0xcc)[_0xd531('0x12')]();});}};}function handleEntityNotFound(_0x400fc7,_0x5e1251){return function(_0x2b9e3c){if(!_0x2b9e3c){_0x400fc7[_0xd531('0x20')](0x194);}return _0x2b9e3c;};}function handleError(_0x129a19,_0x18e468){_0x18e468=_0x18e468||0x1f4;return function(_0x5740a8){logger[_0xd531('0x21')](_0x5740a8['stack']);if(_0x5740a8[_0xd531('0x22')]){delete _0x5740a8[_0xd531('0x22')];}_0x129a19[_0xd531('0x11')](_0x18e468)[_0xd531('0x23')](_0x5740a8);};}exports[_0xd531('0x24')]=function(_0x23d1ef,_0x5a21c0){var _0x5cf391={},_0x39da16={},_0xf14caa={'count':0x0,'rows':[]};var _0xe349a4=_[_0xd531('0x25')](db[_0xd531('0x26')][_0xd531('0x27')],function(_0xbe310){return{'name':_0xbe310[_0xd531('0x28')],'type':_0xbe310[_0xd531('0x29')]['key']};});_0x39da16[_0xd531('0x2a')]=_['map'](_0xe349a4,'name');_0x39da16[_0xd531('0x2b')]=_[_0xd531('0x2c')](_0x23d1ef[_0xd531('0x2b')]);_0x39da16[_0xd531('0x2d')]=_[_0xd531('0x2e')](_0x39da16[_0xd531('0x2a')],_0x39da16[_0xd531('0x2b')]);_0x5cf391[_0xd531('0x2f')]=_[_0xd531('0x2e')](_0x39da16[_0xd531('0x2a')],qs[_0xd531('0x30')](_0x23d1ef[_0xd531('0x2b')]['fields']));_0x5cf391[_0xd531('0x2f')]=_0x5cf391[_0xd531('0x2f')][_0xd531('0x31')]?_0x5cf391[_0xd531('0x2f')]:_0x39da16[_0xd531('0x2a')];if(!_0x23d1ef[_0xd531('0x2b')]['hasOwnProperty'](_0xd531('0x32'))){_0x5cf391['limit']=qs[_0xd531('0x16')](_0x23d1ef['query'][_0xd531('0x16')]);_0x5cf391[_0xd531('0x14')]=qs['offset'](_0x23d1ef[_0xd531('0x2b')]['offset']);}_0x5cf391[_0xd531('0x33')]=qs[_0xd531('0x34')](_0x23d1ef['query'][_0xd531('0x34')]);delete _0x23d1ef['query'][_0xd531('0x34')];_0x5cf391[_0xd531('0x35')]=qs[_0xd531('0x2d')](_[_0xd531('0x36')](_0x23d1ef[_0xd531('0x2b')],_0x39da16[_0xd531('0x2d')]),_0xe349a4);if(_0x23d1ef[_0xd531('0x2b')][_0xd531('0x37')]){_0x5cf391['where']=_[_0xd531('0x38')](_0x5cf391['where'],{'$or':_[_0xd531('0x25')](_0xe349a4,function(_0x112e96){if(_0x112e96[_0xd531('0x29')]!==_0xd531('0x39')){var _0x2d007d={};_0x2d007d[_0x112e96['name']]={'$like':'%'+_0x23d1ef[_0xd531('0x2b')]['filter']+'%'};return _0x2d007d;}})});}_0x5cf391=_[_0xd531('0x38')]({},_0x5cf391,_0x23d1ef['options']);var _0x550398={'where':_0x5cf391[_0xd531('0x35')]};return db[_0xd531('0x26')][_0xd531('0x3a')](_0x550398)[_0xd531('0x1e')](function(_0x4fd9c1){_0xf14caa[_0xd531('0x3a')]=_0x4fd9c1;if(_0x23d1ef['query'][_0xd531('0x3b')]){_0x5cf391['include']=[{'all':!![]}];}return db['VoiceMusicOnHold'][_0xd531('0x3c')](_0x5cf391);})[_0xd531('0x1e')](function(_0x2edab4){_0xf14caa[_0xd531('0x3d')]=_0x2edab4;return _0xf14caa;})['then'](respondWithFilteredResult(_0x5a21c0,_0x5cf391))[_0xd531('0x3e')](handleError(_0x5a21c0,null));};exports['show']=function(_0x4bdd7d,_0x1cae04){var _0x4b37ef={'raw':![],'where':{'id':_0x4bdd7d[_0xd531('0x3f')]['id']}},_0x151c53={};_0x151c53[_0xd531('0x2a')]=_[_0xd531('0x2c')](db[_0xd531('0x26')][_0xd531('0x27')]);_0x151c53[_0xd531('0x2b')]=_[_0xd531('0x2c')](_0x4bdd7d[_0xd531('0x2b')]);_0x151c53[_0xd531('0x2d')]=_['intersection'](_0x151c53['model'],_0x151c53[_0xd531('0x2b')]);_0x4b37ef[_0xd531('0x2f')]=_[_0xd531('0x2e')](_0x151c53['model'],qs[_0xd531('0x30')](_0x4bdd7d[_0xd531('0x2b')][_0xd531('0x30')]));_0x4b37ef[_0xd531('0x2f')]=_0x4b37ef['attributes'][_0xd531('0x31')]?_0x4b37ef[_0xd531('0x2f')]:_0x151c53[_0xd531('0x2a')];if(_0x4bdd7d['query'][_0xd531('0x3b')]){_0x4b37ef[_0xd531('0x40')]=[{'all':!![]}];}_0x4b37ef=_['merge']({},_0x4b37ef,_0x4bdd7d[_0xd531('0x41')]);return db['VoiceMusicOnHold']['find'](_0x4b37ef)[_0xd531('0x1e')](handleEntityNotFound(_0x1cae04,null))[_0xd531('0x1e')](respondWithResult(_0x1cae04,null))['catch'](handleError(_0x1cae04,null));};exports[_0xd531('0x1c')]=function(_0x30fe5d,_0x3fd223){if(_0x30fe5d[_0xd531('0x42')]['id']){delete _0x30fe5d[_0xd531('0x42')]['id'];}return db['VoiceMusicOnHold'][_0xd531('0x43')]({'where':{'id':_0x30fe5d[_0xd531('0x3f')]['id']}})[_0xd531('0x1e')](handleEntityNotFound(_0x3fd223,null))[_0xd531('0x1e')](saveUpdates(_0x30fe5d['body'],null))[_0xd531('0x1e')](respondWithResult(_0x3fd223,null))['catch'](handleError(_0x3fd223,null));};exports['create']=function(_0x23ebde,_0x24c988,_0x3f0b76){return db[_0xd531('0x44')][_0xd531('0x45')](function(_0x372e15){if(_0x23ebde['body'][_0xd531('0x46')]===_0xd531('0x47')){_0x23ebde[_0xd531('0x42')]['directory']=path['join'](config['root'],'server/files/moh',_0x23ebde[_0xd531('0x42')]['name']);}return db[_0xd531('0x26')][_0xd531('0x48')](_0x23ebde[_0xd531('0x42')],{'transaction':_0x372e15})[_0xd531('0x1e')](function(_0x41aeee){if(_0x23ebde[_0xd531('0x42')]['mode']==='files'){fs[_0xd531('0x49')](_0x41aeee[_0xd531('0x4a')],parseInt(_0xd531('0x4b'),0x8));}var _0x518628=_0x23ebde['user'][_0xd531('0x4c')]({'plain':!![]});if(!_0x518628)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x518628['role']===_0xd531('0x4d')){var _0x349b30=_0x41aeee[_0xd531('0x4c')]({'plain':!![]});return db[_0xd531('0x4e')][_0xd531('0x43')]({'where':{'name':_0xd531('0x4f'),'userProfileId':_0x518628['userProfileId']},'raw':!![]})[_0xd531('0x1e')](function(_0x640e3f){if(_0x640e3f&&_0x640e3f['autoAssociation']===0x0){return db[_0xd531('0x1f')]['create']({'name':_0x349b30['name'],'resourceId':_0x349b30['id'],'type':_0x640e3f['name'],'sectionId':_0x640e3f['id']},{})['then'](function(){return _0x41aeee;});}else{return _0x41aeee;}})[_0xd531('0x3e')](function(_0x1d48ab){logger['error'](_0xd531('0x50'),_0x1d48ab);});}return _0x41aeee;});})[_0xd531('0x1e')](respondWithResult(_0x24c988,0xc9))[_0xd531('0x3e')](handleError(_0x24c988,null));};exports[_0xd531('0x1d')]=function(_0x535225,_0x242dc0,_0x4d601a){var _0x154fa3;return db['VoiceMusicOnHold'][_0xd531('0x43')]({'where':{'id':_0x535225[_0xd531('0x3f')]['id']}})[_0xd531('0x1e')](function(_0x384bab){if(_0x384bab){return db[_0xd531('0x44')][_0xd531('0x45')](function(_0x21812f){return _0x384bab[_0xd531('0x1d')]({'transaction':_0x21812f,'raw':!![]})[_0xd531('0x1e')](function(_0x50fd3c){if(_0x50fd3c['directory']){fs[_0xd531('0x51')](_0x50fd3c[_0xd531('0x4a')])[_0xd531('0x52')](function(_0x42b974){fs[_0xd531('0x53')](path[_0xd531('0x54')](_0x50fd3c[_0xd531('0x4a')],_0x42b974));});fs[_0xd531('0x55')](_0x50fd3c['directory']);}return _0x50fd3c;});})[_0xd531('0x3e')](function(_0x1b73e6){throw new db['Sequelize']['ValidationError'](_0x1b73e6[_0xd531('0x56')]);});}})['then'](handleEntityNotFound(_0x242dc0,null))[_0xd531('0x1e')](removeEntity(_0x242dc0,null))[_0xd531('0x3e')](handleError(_0x242dc0,null));};exports[_0xd531('0x57')]=function(_0x4303d5,_0x4c57c7,_0x3a884a){return db['sequelize']['transaction'](function(_0x3d4121){var _0x4f8653;return db[_0xd531('0x26')][_0xd531('0x43')]({'where':{'id':_0x4303d5[_0xd531('0x3f')]['id']}})[_0xd531('0x1e')](function(_0x492d56){if(_0x492d56){_0x4f8653=_0x492d56;return _0x492d56[_0xd531('0x57')](_0x4303d5[_0xd531('0x42')]['id'],{'transaction':_0x3d4121});}})[_0xd531('0x1e')](function(_0x35dee5){if(_0x35dee5){return db[_0xd531('0x58')]['findOne']({'where':{'id':_0x4303d5[_0xd531('0x42')]['id']},'attributes':['id',_0xd531('0x22'),'save_name',_0xd531('0x59'),_0xd531('0x5a')],'raw':!![]});}})[_0xd531('0x1e')](function(_0x291dd9){if(_0x291dd9){var _0x4bdee9=path[_0xd531('0x54')](config[_0xd531('0x5b')],_0xd531('0x5c'),util[_0xd531('0x5d')](_0xd531('0x5e'),path[_0xd531('0x5f')](_0x291dd9[_0xd531('0x60')],path[_0xd531('0x61')](_0x291dd9[_0xd531('0x60')])),_0x291dd9[_0xd531('0x59')]));var _0x5f028d=path['join'](config[_0xd531('0x5b')],_0xd531('0x62'),_0x4f8653[_0xd531('0x22')],util['format'](_0xd531('0x5e'),_0x291dd9[_0xd531('0x22')],_0x291dd9[_0xd531('0x59')]));fs['symlinkSync'](_0x4bdee9,_0x5f028d);return _0x291dd9;}})[_0xd531('0x3e')](function(_0x197386){throw new db[(_0xd531('0x63'))][(_0xd531('0x64'))](_0x197386[_0xd531('0x56')]);});})['then'](handleEntityNotFound(_0x4c57c7,null))[_0xd531('0x1e')](respondWithResult(_0x4c57c7,0xc9))[_0xd531('0x3e')](handleError(_0x4c57c7,null));};exports[_0xd531('0x65')]=function(_0x242b6a,_0x5bd43b,_0x3cdc65){return db['sequelize']['transaction'](function(_0x33aa11){var _0x44c937;return db['VoiceMusicOnHold'][_0xd531('0x66')]({'where':{'id':_0x242b6a[_0xd531('0x3f')]['id']}})[_0xd531('0x1e')](handleEntityNotFound(_0x5bd43b,null))[_0xd531('0x1e')](function(_0xce6fbb){if(_0xce6fbb){_0x44c937=_0xce6fbb;return _0xce6fbb[_0xd531('0x65')](_0x242b6a[_0xd531('0x3f')]['id2']);}})[_0xd531('0x1e')](function(_0xd7df5d){if(_0xd7df5d){return db[_0xd531('0x58')][_0xd531('0x66')]({'where':{'id':_0x242b6a[_0xd531('0x3f')][_0xd531('0x67')]},'attributes':['id',_0xd531('0x22'),_0xd531('0x60'),_0xd531('0x59'),_0xd531('0x5a')],'raw':!![]});}})[_0xd531('0x1e')](function(_0x21a636){if(_0x21a636){fs[_0xd531('0x53')](path[_0xd531('0x54')](_0x44c937['directory'],util['format']('%s.%s',_0x21a636[_0xd531('0x22')],_0x21a636[_0xd531('0x59')])));return _0x21a636;}})['catch'](function(_0x502878){throw new db['Sequelize'][(_0xd531('0x64'))](_0x502878[_0xd531('0x56')]);});})[_0xd531('0x1e')](handleEntityNotFound(_0x5bd43b,null))[_0xd531('0x1e')](respondWithStatusCode(_0x5bd43b,0xcc))['catch'](handleError(_0x5bd43b,null));};exports[_0xd531('0x68')]=function(_0x4dabbc,_0xc918c,_0x47f38e){var _0x5aaf2d={};var _0x477333={};var _0xb93588;var _0x3c1720;return db['VoiceMusicOnHold'][_0xd531('0x66')]({'where':{'id':_0x4dabbc[_0xd531('0x3f')]['id']}})[_0xd531('0x1e')](handleEntityNotFound(_0xc918c,null))[_0xd531('0x1e')](function(_0x1a42ed){if(_0x1a42ed){_0xb93588=_0x1a42ed;_0x477333['model']=_['keys'](db[_0xd531('0x58')][_0xd531('0x27')]);_0x477333[_0xd531('0x2b')]=_[_0xd531('0x2c')](_0x4dabbc[_0xd531('0x2b')]);_0x477333[_0xd531('0x2d')]=_[_0xd531('0x2e')](_0x477333[_0xd531('0x2a')],_0x477333[_0xd531('0x2b')]);_0x5aaf2d[_0xd531('0x2f')]=_['intersection'](_0x477333[_0xd531('0x2a')],qs['fields'](_0x4dabbc[_0xd531('0x2b')][_0xd531('0x30')]));_0x5aaf2d['attributes']=_0x5aaf2d[_0xd531('0x2f')][_0xd531('0x31')]?_0x5aaf2d[_0xd531('0x2f')]:_0x477333[_0xd531('0x2a')];_0x5aaf2d[_0xd531('0x33')]=qs['sort'](_0x4dabbc[_0xd531('0x2b')]['sort']);_0x5aaf2d['where']=qs[_0xd531('0x2d')](_[_0xd531('0x36')](_0x4dabbc[_0xd531('0x2b')],_0x477333[_0xd531('0x2d')]));if(_0x4dabbc['query']['filter']){_0x5aaf2d[_0xd531('0x35')]=_['merge'](_0x5aaf2d[_0xd531('0x35')],{'$or':_[_0xd531('0x25')](_0x5aaf2d['attributes'],function(_0x5c37ab){var _0x13a653={};_0x13a653[_0x5c37ab]={'$like':'%'+_0x4dabbc['query'][_0xd531('0x37')]+'%'};return _0x13a653;})});}_0x5aaf2d=_[_0xd531('0x38')]({},_0x5aaf2d,_0x4dabbc['options']);return _0xb93588[_0xd531('0x68')](_0x5aaf2d);}})[_0xd531('0x1e')](function(_0x25c496){if(_0x25c496){_0x3c1720=_0x25c496[_0xd531('0x31')];if(!_0x4dabbc[_0xd531('0x2b')][_0xd531('0x69')]('nolimit')){_0x5aaf2d[_0xd531('0x16')]=qs[_0xd531('0x16')](_0x4dabbc[_0xd531('0x2b')][_0xd531('0x16')]);_0x5aaf2d[_0xd531('0x14')]=qs[_0xd531('0x14')](_0x4dabbc[_0xd531('0x2b')][_0xd531('0x14')]);}return _0xb93588[_0xd531('0x68')](_0x5aaf2d);}})[_0xd531('0x1e')](function(_0x33b3e9){if(_0x33b3e9){return _0x33b3e9?{'count':_0x3c1720,'rows':_0x33b3e9}:null;}})['then'](respondWithResult(_0xc918c,null))[_0xd531('0x3e')](handleError(_0xc918c,null));}; \ No newline at end of file +var _0x8b23=['mkdirSync','directory','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','user','userProfileId','autoAssociation','create','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','readdirSync','forEach','rmdirSync','Sequelize','ValidationError','message','addSound','Sound','findOne','save_name','converted_format','createdAt','server/files/sounds/converted','basename','root','server/files/moh','format','%s.%s','symlinkSync','removeSound','id2','unlinkSync','getSounds','pick','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','path','sox','to-csv','ejs','fs-extra','lodash','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','sendStatus','status','end','json','offset','undefined','limit','count','Content-Range','apply','save','update','destroy','then','get','MusicOnHolds','UserProfileResource','stack','name','send','VoiceMusicOnHold','rawAttributes','fieldName','type','key','model','map','query','keys','filters','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','where','filter','merge','options','includeAll','include','findAll','rows','catch','length','find','body','params','sequelize','transaction','files','join','mode'];(function(_0x255f67,_0x3b2d58){var _0x1431d1=function(_0x435758){while(--_0x435758){_0x255f67['push'](_0x255f67['shift']());}};_0x1431d1(++_0x3b2d58);}(_0x8b23,0x1ed));var _0x38b2=function(_0x42bdad,_0x12836c){_0x42bdad=_0x42bdad-0x0;var _0x122626=_0x8b23[_0x42bdad];return _0x122626;};'use strict';var emlformat=require(_0x38b2('0x0'));var rimraf=require(_0x38b2('0x1'));var zipdir=require(_0x38b2('0x2'));var jsonpatch=require(_0x38b2('0x3'));var rp=require(_0x38b2('0x4'));var moment=require(_0x38b2('0x5'));var BPromise=require(_0x38b2('0x6'));var Mustache=require(_0x38b2('0x7'));var util=require('util');var path=require(_0x38b2('0x8'));var sox=require(_0x38b2('0x9'));var csv=require(_0x38b2('0xa'));var ejs=require(_0x38b2('0xb'));var fs=require('fs');var fs_extra=require(_0x38b2('0xc'));var _=require(_0x38b2('0xd'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0x38b2('0xe'));var deskjs=require(_0x38b2('0xf'));var toCsv=require(_0x38b2('0xa'));var querystring=require(_0x38b2('0x10'));var Papa=require(_0x38b2('0x11'));var Redis=require(_0x38b2('0x12'));var authService=require(_0x38b2('0x13'));var qs=require(_0x38b2('0x14'));var as=require(_0x38b2('0x15'));var hardwareService=require(_0x38b2('0x16'));var logger=require(_0x38b2('0x17'))('api');var utils=require(_0x38b2('0x18'));var config=require(_0x38b2('0x19'));var licenseUtil=require(_0x38b2('0x1a'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x456118,_0x4c252e){_0x4c252e=_0x4c252e||0xcc;return function(_0x3c5043){if(_0x3c5043){return _0x456118[_0x38b2('0x1b')](_0x4c252e);}return _0x456118[_0x38b2('0x1c')](_0x4c252e)[_0x38b2('0x1d')]();};}function respondWithResult(_0x5f551e,_0x4ccad9){_0x4ccad9=_0x4ccad9||0xc8;return function(_0xf85f9c){if(_0xf85f9c){return _0x5f551e['status'](_0x4ccad9)[_0x38b2('0x1e')](_0xf85f9c);}};}function respondWithFilteredResult(_0x19e7b4,_0x5bad1e){return function(_0x25f1f2){if(_0x25f1f2){var _0x5716d4=typeof _0x5bad1e[_0x38b2('0x1f')]===_0x38b2('0x20')&&typeof _0x5bad1e[_0x38b2('0x21')]==='undefined';var _0x336eb0=_0x25f1f2[_0x38b2('0x22')];var _0x3e9fdf=_0x5716d4?0x0:_0x5bad1e[_0x38b2('0x1f')];var _0x566780=_0x5716d4?_0x25f1f2[_0x38b2('0x22')]:_0x5bad1e[_0x38b2('0x1f')]+_0x5bad1e['limit'];var _0x3845e0;if(_0x566780>=_0x336eb0){_0x566780=_0x336eb0;_0x3845e0=0xc8;}else{_0x3845e0=0xce;}_0x19e7b4[_0x38b2('0x1c')](_0x3845e0);return _0x19e7b4['set'](_0x38b2('0x23'),_0x3e9fdf+'-'+_0x566780+'/'+_0x336eb0)['json'](_0x25f1f2);}return null;};}function patchUpdates(_0x5745cd){return function(_0x59708f){try{jsonpatch[_0x38b2('0x24')](_0x59708f,_0x5745cd,!![]);}catch(_0x3e0f38){return BPromise['reject'](_0x3e0f38);}return _0x59708f[_0x38b2('0x25')]();};}function saveUpdates(_0x9765ec,_0x4ca5a9){return function(_0x466b3b){if(_0x466b3b){return _0x466b3b[_0x38b2('0x26')](_0x9765ec)['then'](function(_0x393578){return _0x393578;});}return null;};}function removeEntity(_0x52b79e,_0x33215a){return function(_0x45475b){if(_0x45475b){return _0x45475b[_0x38b2('0x27')]()[_0x38b2('0x28')](function(){var _0xe2fecd=_0x45475b[_0x38b2('0x29')]({'plain':!![]});var _0x3477b2=_0x38b2('0x2a');return db[_0x38b2('0x2b')]['destroy']({'where':{'type':_0x3477b2,'resourceId':_0xe2fecd['id']}})[_0x38b2('0x28')](function(){return _0x45475b;});})[_0x38b2('0x28')](function(){_0x52b79e[_0x38b2('0x1c')](0xcc)[_0x38b2('0x1d')]();});}};}function handleEntityNotFound(_0x4b79d5,_0x41ba14){return function(_0x51bd10){if(!_0x51bd10){_0x4b79d5[_0x38b2('0x1b')](0x194);}return _0x51bd10;};}function handleError(_0x5b926f,_0x5e282a){_0x5e282a=_0x5e282a||0x1f4;return function(_0x4bd051){logger['error'](_0x4bd051[_0x38b2('0x2c')]);if(_0x4bd051['name']){delete _0x4bd051[_0x38b2('0x2d')];}_0x5b926f['status'](_0x5e282a)[_0x38b2('0x2e')](_0x4bd051);};}exports['index']=function(_0x4072fd,_0xebf13e){var _0x159eaa={},_0x520522={},_0x142225={'count':0x0,'rows':[]};var _0x6f9f6d=_['map'](db[_0x38b2('0x2f')][_0x38b2('0x30')],function(_0x7243ce){return{'name':_0x7243ce[_0x38b2('0x31')],'type':_0x7243ce[_0x38b2('0x32')][_0x38b2('0x33')]};});_0x520522[_0x38b2('0x34')]=_[_0x38b2('0x35')](_0x6f9f6d,_0x38b2('0x2d'));_0x520522[_0x38b2('0x36')]=_[_0x38b2('0x37')](_0x4072fd[_0x38b2('0x36')]);_0x520522[_0x38b2('0x38')]=_[_0x38b2('0x39')](_0x520522[_0x38b2('0x34')],_0x520522[_0x38b2('0x36')]);_0x159eaa[_0x38b2('0x3a')]=_[_0x38b2('0x39')](_0x520522[_0x38b2('0x34')],qs[_0x38b2('0x3b')](_0x4072fd[_0x38b2('0x36')]['fields']));_0x159eaa[_0x38b2('0x3a')]=_0x159eaa['attributes']['length']?_0x159eaa[_0x38b2('0x3a')]:_0x520522[_0x38b2('0x34')];if(!_0x4072fd[_0x38b2('0x36')][_0x38b2('0x3c')](_0x38b2('0x3d'))){_0x159eaa[_0x38b2('0x21')]=qs[_0x38b2('0x21')](_0x4072fd[_0x38b2('0x36')]['limit']);_0x159eaa[_0x38b2('0x1f')]=qs[_0x38b2('0x1f')](_0x4072fd[_0x38b2('0x36')][_0x38b2('0x1f')]);}_0x159eaa[_0x38b2('0x3e')]=qs[_0x38b2('0x3f')](_0x4072fd['query'][_0x38b2('0x3f')]);delete _0x4072fd[_0x38b2('0x36')][_0x38b2('0x3f')];_0x159eaa[_0x38b2('0x40')]=qs[_0x38b2('0x38')](_['pick'](_0x4072fd[_0x38b2('0x36')],_0x520522[_0x38b2('0x38')]),_0x6f9f6d);if(_0x4072fd[_0x38b2('0x36')]['filter']){_0x159eaa[_0x38b2('0x40')]=_['merge'](_0x159eaa[_0x38b2('0x40')],{'$or':_[_0x38b2('0x35')](_0x6f9f6d,function(_0x162ea7){if(_0x162ea7[_0x38b2('0x32')]!=='VIRTUAL'){var _0x19306f={};_0x19306f[_0x162ea7[_0x38b2('0x2d')]]={'$like':'%'+_0x4072fd[_0x38b2('0x36')][_0x38b2('0x41')]+'%'};return _0x19306f;}})});}_0x159eaa=_[_0x38b2('0x42')]({},_0x159eaa,_0x4072fd[_0x38b2('0x43')]);var _0x1d22dc={'where':_0x159eaa[_0x38b2('0x40')]};return db['VoiceMusicOnHold'][_0x38b2('0x22')](_0x1d22dc)[_0x38b2('0x28')](function(_0xbd162f){_0x142225['count']=_0xbd162f;if(_0x4072fd[_0x38b2('0x36')][_0x38b2('0x44')]){_0x159eaa[_0x38b2('0x45')]=[{'all':!![]}];}return db[_0x38b2('0x2f')][_0x38b2('0x46')](_0x159eaa);})['then'](function(_0x17e888){_0x142225[_0x38b2('0x47')]=_0x17e888;return _0x142225;})[_0x38b2('0x28')](respondWithFilteredResult(_0xebf13e,_0x159eaa))[_0x38b2('0x48')](handleError(_0xebf13e,null));};exports['show']=function(_0x37b8e6,_0xcc763c){var _0x5c3f23={'raw':![],'where':{'id':_0x37b8e6['params']['id']}},_0x520488={};_0x520488[_0x38b2('0x34')]=_['keys'](db['VoiceMusicOnHold']['rawAttributes']);_0x520488['query']=_[_0x38b2('0x37')](_0x37b8e6[_0x38b2('0x36')]);_0x520488[_0x38b2('0x38')]=_[_0x38b2('0x39')](_0x520488[_0x38b2('0x34')],_0x520488['query']);_0x5c3f23[_0x38b2('0x3a')]=_['intersection'](_0x520488[_0x38b2('0x34')],qs[_0x38b2('0x3b')](_0x37b8e6[_0x38b2('0x36')][_0x38b2('0x3b')]));_0x5c3f23[_0x38b2('0x3a')]=_0x5c3f23['attributes'][_0x38b2('0x49')]?_0x5c3f23[_0x38b2('0x3a')]:_0x520488[_0x38b2('0x34')];if(_0x37b8e6[_0x38b2('0x36')][_0x38b2('0x44')]){_0x5c3f23['include']=[{'all':!![]}];}_0x5c3f23=_['merge']({},_0x5c3f23,_0x37b8e6[_0x38b2('0x43')]);return db['VoiceMusicOnHold'][_0x38b2('0x4a')](_0x5c3f23)[_0x38b2('0x28')](handleEntityNotFound(_0xcc763c,null))[_0x38b2('0x28')](respondWithResult(_0xcc763c,null))[_0x38b2('0x48')](handleError(_0xcc763c,null));};exports[_0x38b2('0x26')]=function(_0x2807b5,_0x517780){if(_0x2807b5['body']['id']){delete _0x2807b5[_0x38b2('0x4b')]['id'];}return db[_0x38b2('0x2f')][_0x38b2('0x4a')]({'where':{'id':_0x2807b5[_0x38b2('0x4c')]['id']}})[_0x38b2('0x28')](handleEntityNotFound(_0x517780,null))[_0x38b2('0x28')](saveUpdates(_0x2807b5[_0x38b2('0x4b')],null))[_0x38b2('0x28')](respondWithResult(_0x517780,null))['catch'](handleError(_0x517780,null));};exports['create']=function(_0x46e97c,_0x891fdd,_0x4d7204){return db[_0x38b2('0x4d')][_0x38b2('0x4e')](function(_0x48f7c3){if(_0x46e97c['body']['mode']===_0x38b2('0x4f')){_0x46e97c['body']['directory']=path[_0x38b2('0x50')](config['root'],'server/files/moh',_0x46e97c['body']['name']);}return db[_0x38b2('0x2f')]['create'](_0x46e97c[_0x38b2('0x4b')],{'transaction':_0x48f7c3})[_0x38b2('0x28')](function(_0x56434f){if(_0x46e97c['body'][_0x38b2('0x51')]===_0x38b2('0x4f')){fs[_0x38b2('0x52')](_0x56434f[_0x38b2('0x53')],parseInt('0777',0x8));}var _0x2d95f6=_0x46e97c['user'][_0x38b2('0x29')]({'plain':!![]});if(!_0x2d95f6)throw new Error(_0x38b2('0x54'));if(_0x2d95f6[_0x38b2('0x55')]===_0x38b2('0x56')){var _0x26f117=_0x56434f[_0x38b2('0x29')]({'plain':!![]});return db['UserProfileSection']['find']({'where':{'name':_0x38b2('0x2a'),'userProfileId':_0x2d95f6[_0x38b2('0x57')]},'raw':!![]})[_0x38b2('0x28')](function(_0x84bec5){if(_0x84bec5&&_0x84bec5[_0x38b2('0x58')]===0x0){return db[_0x38b2('0x2b')][_0x38b2('0x59')]({'name':_0x26f117[_0x38b2('0x2d')],'resourceId':_0x26f117['id'],'type':_0x84bec5[_0x38b2('0x2d')],'sectionId':_0x84bec5['id']},{})[_0x38b2('0x28')](function(){return _0x56434f;});}else{return _0x56434f;}})[_0x38b2('0x48')](function(_0x314d5b){logger['error'](_0x38b2('0x5a'),_0x314d5b);});}return _0x56434f;});})[_0x38b2('0x28')](respondWithResult(_0x891fdd,0xc9))[_0x38b2('0x48')](handleError(_0x891fdd,null));};exports[_0x38b2('0x27')]=function(_0x5f4489,_0x93bb6b,_0x4f9122){var _0x12b561;return db[_0x38b2('0x2f')][_0x38b2('0x4a')]({'where':{'id':_0x5f4489['params']['id']}})[_0x38b2('0x28')](function(_0x2b5be9){if(_0x2b5be9){return db[_0x38b2('0x4d')][_0x38b2('0x4e')](function(_0xe00ef5){return _0x2b5be9[_0x38b2('0x27')]({'transaction':_0xe00ef5,'raw':!![]})[_0x38b2('0x28')](function(_0x5ce07d){if(_0x5ce07d['directory']){fs[_0x38b2('0x5b')](_0x5ce07d[_0x38b2('0x53')])[_0x38b2('0x5c')](function(_0x59e4aa){fs['unlinkSync'](path['join'](_0x5ce07d[_0x38b2('0x53')],_0x59e4aa));});fs[_0x38b2('0x5d')](_0x5ce07d[_0x38b2('0x53')]);}return _0x5ce07d;});})[_0x38b2('0x48')](function(_0x5ba95d){throw new db[(_0x38b2('0x5e'))][(_0x38b2('0x5f'))](_0x5ba95d[_0x38b2('0x60')]);});}})[_0x38b2('0x28')](handleEntityNotFound(_0x93bb6b,null))['then'](removeEntity(_0x93bb6b,null))['catch'](handleError(_0x93bb6b,null));};exports[_0x38b2('0x61')]=function(_0x34985f,_0x2635af,_0x34b2f0){return db[_0x38b2('0x4d')]['transaction'](function(_0x3f1de0){var _0x206657;return db[_0x38b2('0x2f')]['find']({'where':{'id':_0x34985f[_0x38b2('0x4c')]['id']}})[_0x38b2('0x28')](function(_0xf52824){if(_0xf52824){_0x206657=_0xf52824;return _0xf52824[_0x38b2('0x61')](_0x34985f[_0x38b2('0x4b')]['id'],{'transaction':_0x3f1de0});}})['then'](function(_0x2d0a6f){if(_0x2d0a6f){return db[_0x38b2('0x62')][_0x38b2('0x63')]({'where':{'id':_0x34985f[_0x38b2('0x4b')]['id']},'attributes':['id',_0x38b2('0x2d'),_0x38b2('0x64'),_0x38b2('0x65'),_0x38b2('0x66')],'raw':!![]});}})[_0x38b2('0x28')](function(_0x2a3d9f){if(_0x2a3d9f){var _0x6047a5=path[_0x38b2('0x50')](config['root'],_0x38b2('0x67'),util['format']('%s.%s',path[_0x38b2('0x68')](_0x2a3d9f[_0x38b2('0x64')],path['extname'](_0x2a3d9f['save_name'])),_0x2a3d9f[_0x38b2('0x65')]));var _0x44038c=path['join'](config[_0x38b2('0x69')],_0x38b2('0x6a'),_0x206657[_0x38b2('0x2d')],util[_0x38b2('0x6b')](_0x38b2('0x6c'),_0x2a3d9f['name'],_0x2a3d9f['converted_format']));fs[_0x38b2('0x6d')](_0x6047a5,_0x44038c);return _0x2a3d9f;}})[_0x38b2('0x48')](function(_0x54fe97){throw new db['Sequelize']['ValidationError'](_0x54fe97['message']);});})['then'](handleEntityNotFound(_0x2635af,null))[_0x38b2('0x28')](respondWithResult(_0x2635af,0xc9))[_0x38b2('0x48')](handleError(_0x2635af,null));};exports[_0x38b2('0x6e')]=function(_0x440799,_0x3978ea,_0x405a56){return db[_0x38b2('0x4d')][_0x38b2('0x4e')](function(_0x203c4b){var _0x5af6de;return db[_0x38b2('0x2f')][_0x38b2('0x63')]({'where':{'id':_0x440799[_0x38b2('0x4c')]['id']}})[_0x38b2('0x28')](handleEntityNotFound(_0x3978ea,null))[_0x38b2('0x28')](function(_0x5f20de){if(_0x5f20de){_0x5af6de=_0x5f20de;return _0x5f20de[_0x38b2('0x6e')](_0x440799[_0x38b2('0x4c')][_0x38b2('0x6f')]);}})[_0x38b2('0x28')](function(_0x22a1b2){if(_0x22a1b2){return db[_0x38b2('0x62')]['findOne']({'where':{'id':_0x440799[_0x38b2('0x4c')][_0x38b2('0x6f')]},'attributes':['id',_0x38b2('0x2d'),_0x38b2('0x64'),'converted_format',_0x38b2('0x66')],'raw':!![]});}})['then'](function(_0x2d5f94){if(_0x2d5f94){fs[_0x38b2('0x70')](path[_0x38b2('0x50')](_0x5af6de[_0x38b2('0x53')],util[_0x38b2('0x6b')](_0x38b2('0x6c'),_0x2d5f94[_0x38b2('0x2d')],_0x2d5f94[_0x38b2('0x65')])));return _0x2d5f94;}})[_0x38b2('0x48')](function(_0x55008c){throw new db[(_0x38b2('0x5e'))]['ValidationError'](_0x55008c['message']);});})[_0x38b2('0x28')](handleEntityNotFound(_0x3978ea,null))[_0x38b2('0x28')](respondWithStatusCode(_0x3978ea,0xcc))[_0x38b2('0x48')](handleError(_0x3978ea,null));};exports[_0x38b2('0x71')]=function(_0x337716,_0x3eef3f,_0x477bb1){var _0x375364={};var _0x45be8d={};var _0x7a6407;var _0x30a873;return db[_0x38b2('0x2f')]['findOne']({'where':{'id':_0x337716[_0x38b2('0x4c')]['id']}})[_0x38b2('0x28')](handleEntityNotFound(_0x3eef3f,null))[_0x38b2('0x28')](function(_0x4673c2){if(_0x4673c2){_0x7a6407=_0x4673c2;_0x45be8d['model']=_[_0x38b2('0x37')](db[_0x38b2('0x62')][_0x38b2('0x30')]);_0x45be8d[_0x38b2('0x36')]=_[_0x38b2('0x37')](_0x337716[_0x38b2('0x36')]);_0x45be8d[_0x38b2('0x38')]=_[_0x38b2('0x39')](_0x45be8d[_0x38b2('0x34')],_0x45be8d['query']);_0x375364['attributes']=_[_0x38b2('0x39')](_0x45be8d[_0x38b2('0x34')],qs[_0x38b2('0x3b')](_0x337716['query'][_0x38b2('0x3b')]));_0x375364[_0x38b2('0x3a')]=_0x375364[_0x38b2('0x3a')]['length']?_0x375364[_0x38b2('0x3a')]:_0x45be8d[_0x38b2('0x34')];_0x375364[_0x38b2('0x3e')]=qs[_0x38b2('0x3f')](_0x337716['query']['sort']);_0x375364[_0x38b2('0x40')]=qs['filters'](_[_0x38b2('0x72')](_0x337716['query'],_0x45be8d[_0x38b2('0x38')]));if(_0x337716[_0x38b2('0x36')][_0x38b2('0x41')]){_0x375364[_0x38b2('0x40')]=_[_0x38b2('0x42')](_0x375364[_0x38b2('0x40')],{'$or':_[_0x38b2('0x35')](_0x375364[_0x38b2('0x3a')],function(_0x2b2c27){var _0x26bead={};_0x26bead[_0x2b2c27]={'$like':'%'+_0x337716[_0x38b2('0x36')][_0x38b2('0x41')]+'%'};return _0x26bead;})});}_0x375364=_[_0x38b2('0x42')]({},_0x375364,_0x337716['options']);return _0x7a6407[_0x38b2('0x71')](_0x375364);}})['then'](function(_0xb8024a){if(_0xb8024a){_0x30a873=_0xb8024a[_0x38b2('0x49')];if(!_0x337716[_0x38b2('0x36')]['hasOwnProperty']('nolimit')){_0x375364[_0x38b2('0x21')]=qs[_0x38b2('0x21')](_0x337716[_0x38b2('0x36')][_0x38b2('0x21')]);_0x375364['offset']=qs['offset'](_0x337716[_0x38b2('0x36')][_0x38b2('0x1f')]);}return _0x7a6407[_0x38b2('0x71')](_0x375364);}})['then'](function(_0x23827a){if(_0x23827a){return _0x23827a?{'count':_0x30a873,'rows':_0x23827a}:null;}})[_0x38b2('0x28')](respondWithResult(_0x3eef3f,null))[_0x38b2('0x48')](handleError(_0x3eef3f,null));}; \ No newline at end of file diff --git a/server/api/voiceMusicOnHold/voiceMusicOnHold.model.js b/server/api/voiceMusicOnHold/voiceMusicOnHold.model.js index df57895..419a758 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 _0xf636=['exports','VoiceMusicOnHold','voice_musiconhold','util','../../config/logger','api','moment','request-promise','path','rimraf','../../config/environment','./voiceMusicOnHold.attributes'];(function(_0x38ea83,_0x1b1fe6){var _0x90a5e=function(_0x3655f8){while(--_0x3655f8){_0x38ea83['push'](_0x38ea83['shift']());}};_0x90a5e(++_0x1b1fe6);}(_0xf636,0x7b));var _0x6f63=function(_0xb590d2,_0x2eeba9){_0xb590d2=_0xb590d2-0x0;var _0x3696dd=_0xf636[_0xb590d2];return _0x3696dd;};'use strict';var _=require('lodash');var util=require(_0x6f63('0x0'));var logger=require(_0x6f63('0x1'))(_0x6f63('0x2'));var moment=require(_0x6f63('0x3'));var BPromise=require('bluebird');var rp=require(_0x6f63('0x4'));var fs=require('fs');var path=require(_0x6f63('0x5'));var rimraf=require(_0x6f63('0x6'));var config=require(_0x6f63('0x7'));var attributes=require(_0x6f63('0x8'));module[_0x6f63('0x9')]=function(_0x9d0810,_0x41e1ac){return _0x9d0810['define'](_0x6f63('0xa'),attributes,{'tableName':_0x6f63('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x4d2f=['../../config/environment','./voiceMusicOnHold.attributes','exports','define','VoiceMusicOnHold','lodash','api','moment','bluebird','rimraf'];(function(_0x363ef8,_0x4ecb1a){var _0x148822=function(_0x232634){while(--_0x232634){_0x363ef8['push'](_0x363ef8['shift']());}};_0x148822(++_0x4ecb1a);}(_0x4d2f,0xd7));var _0xf4d2=function(_0x397e5f,_0x454c8f){_0x397e5f=_0x397e5f-0x0;var _0x5302b8=_0x4d2f[_0x397e5f];return _0x5302b8;};'use strict';var _=require(_0xf4d2('0x0'));var util=require('util');var logger=require('../../config/logger')(_0xf4d2('0x1'));var moment=require(_0xf4d2('0x2'));var BPromise=require(_0xf4d2('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0xf4d2('0x4'));var config=require(_0xf4d2('0x5'));var attributes=require(_0xf4d2('0x6'));module[_0xf4d2('0x7')]=function(_0x353175,_0x326674){return _0x353175[_0xf4d2('0x8')](_0xf4d2('0x9'),attributes,{'tableName':'voice_musiconhold','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/voiceMusicOnHold/voiceMusicOnHold.rpc.js b/server/api/voiceMusicOnHold/voiceMusicOnHold.rpc.js index d411110..194414b 100644 --- a/server/api/voiceMusicOnHold/voiceMusicOnHold.rpc.js +++ b/server/api/voiceMusicOnHold/voiceMusicOnHold.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xcb91=['stringify','error','code','message','catch','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','../../config/environment','jayson/promise','http','request','info','VoiceMusicOnHold,\x20%s,\x20%s','request\x20sent','debug','VoiceMusicOnHold,\x20%s,\x20%s,\x20%s'];(function(_0x533406,_0x11ea96){var _0x579c8b=function(_0x30d128){while(--_0x30d128){_0x533406['push'](_0x533406['shift']());}};_0x579c8b(++_0x11ea96);}(_0xcb91,0x1a9));var _0x1cb9=function(_0xfedc72,_0x292f02){_0xfedc72=_0xfedc72-0x0;var _0x2c7c78=_0xcb91[_0xfedc72];return _0x2c7c78;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x1cb9('0x0'));var BPromise=require(_0x1cb9('0x1'));var rs=require(_0x1cb9('0x2'));var fs=require('fs');var Redis=require(_0x1cb9('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x1cb9('0x4'));var logger=require(_0x1cb9('0x5'))('rpc');var config=require(_0x1cb9('0x6'));var jayson=require(_0x1cb9('0x7'));var client=jayson['client'][_0x1cb9('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x3f7deb,_0x4ffe20,_0x38737d){return new BPromise(function(_0x12567c,_0x59d1be){return client[_0x1cb9('0x9')](_0x3f7deb,_0x38737d)['then'](function(_0x567139){logger[_0x1cb9('0xa')](_0x1cb9('0xb'),_0x4ffe20,_0x1cb9('0xc'));logger[_0x1cb9('0xd')](_0x1cb9('0xe'),_0x4ffe20,'request\x20sent',JSON[_0x1cb9('0xf')](_0x567139));if(_0x567139[_0x1cb9('0x10')]){if(_0x567139[_0x1cb9('0x10')][_0x1cb9('0x11')]===0x1f4){logger[_0x1cb9('0x10')]('VoiceMusicOnHold,\x20%s,\x20%s',_0x4ffe20,_0x567139['error']['message']);return _0x59d1be(_0x567139[_0x1cb9('0x10')][_0x1cb9('0x12')]);}logger[_0x1cb9('0x10')](_0x1cb9('0xb'),_0x4ffe20,_0x567139['error'][_0x1cb9('0x12')]);return _0x12567c(_0x567139[_0x1cb9('0x10')][_0x1cb9('0x12')]);}else{logger[_0x1cb9('0xa')](_0x1cb9('0xb'),_0x4ffe20,'request\x20sent');_0x12567c(_0x567139['result'][_0x1cb9('0x12')]);}})[_0x1cb9('0x13')](function(_0x3904b7){logger[_0x1cb9('0x10')](_0x1cb9('0xb'),_0x4ffe20,_0x3904b7);_0x59d1be(_0x3904b7);});});} \ No newline at end of file +var _0xcb91=['stringify','error','code','message','catch','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','../../config/environment','jayson/promise','http','request','info','VoiceMusicOnHold,\x20%s,\x20%s','request\x20sent','debug','VoiceMusicOnHold,\x20%s,\x20%s,\x20%s'];(function(_0x1dc02d,_0x1bbd1b){var _0x4e7e1d=function(_0x11254c){while(--_0x11254c){_0x1dc02d['push'](_0x1dc02d['shift']());}};_0x4e7e1d(++_0x1bbd1b);}(_0xcb91,0x1a9));var _0x1cb9=function(_0x207811,_0x3420a6){_0x207811=_0x207811-0x0;var _0x170d56=_0xcb91[_0x207811];return _0x170d56;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x1cb9('0x0'));var BPromise=require(_0x1cb9('0x1'));var rs=require(_0x1cb9('0x2'));var fs=require('fs');var Redis=require(_0x1cb9('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x1cb9('0x4'));var logger=require(_0x1cb9('0x5'))('rpc');var config=require(_0x1cb9('0x6'));var jayson=require(_0x1cb9('0x7'));var client=jayson['client'][_0x1cb9('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x3f7deb,_0x4ffe20,_0x38737d){return new BPromise(function(_0x12567c,_0x59d1be){return client[_0x1cb9('0x9')](_0x3f7deb,_0x38737d)['then'](function(_0x567139){logger[_0x1cb9('0xa')](_0x1cb9('0xb'),_0x4ffe20,_0x1cb9('0xc'));logger[_0x1cb9('0xd')](_0x1cb9('0xe'),_0x4ffe20,'request\x20sent',JSON[_0x1cb9('0xf')](_0x567139));if(_0x567139[_0x1cb9('0x10')]){if(_0x567139[_0x1cb9('0x10')][_0x1cb9('0x11')]===0x1f4){logger[_0x1cb9('0x10')]('VoiceMusicOnHold,\x20%s,\x20%s',_0x4ffe20,_0x567139['error']['message']);return _0x59d1be(_0x567139[_0x1cb9('0x10')][_0x1cb9('0x12')]);}logger[_0x1cb9('0x10')](_0x1cb9('0xb'),_0x4ffe20,_0x567139['error'][_0x1cb9('0x12')]);return _0x12567c(_0x567139[_0x1cb9('0x10')][_0x1cb9('0x12')]);}else{logger[_0x1cb9('0xa')](_0x1cb9('0xb'),_0x4ffe20,'request\x20sent');_0x12567c(_0x567139['result'][_0x1cb9('0x12')]);}})[_0x1cb9('0x13')](function(_0x3904b7){logger[_0x1cb9('0x10')](_0x1cb9('0xb'),_0x4ffe20,_0x3904b7);_0x59d1be(_0x3904b7);});});} \ No newline at end of file diff --git a/server/api/voicePrefix/index.js b/server/api/voicePrefix/index.js index f0072b7..978dbd0 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 _0x70a1=['/describe','/:id','/:id/users','getAgents','/:id/teams','getTeams','post','create','addTeams','put','update','delete','destroy','removeAgents','removeTeams','multer','util','path','fs-extra','../../components/auth/service','../../components/interaction/service','./voicePrefix.controller','get','isAuthenticated','index'];(function(_0x4d4ef8,_0x4c9d05){var _0x1137a3=function(_0x18ffaa){while(--_0x18ffaa){_0x4d4ef8['push'](_0x4d4ef8['shift']());}};_0x1137a3(++_0x4c9d05);}(_0x70a1,0x154));var _0x170a=function(_0x243217,_0x522951){_0x243217=_0x243217-0x0;var _0x478029=_0x70a1[_0x243217];return _0x478029;};'use strict';var multer=require(_0x170a('0x0'));var util=require(_0x170a('0x1'));var path=require(_0x170a('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express['Router']();var fs_extra=require(_0x170a('0x3'));var auth=require(_0x170a('0x4'));var interaction=require(_0x170a('0x5'));var config=require('../../config/environment');var controller=require(_0x170a('0x6'));router[_0x170a('0x7')]('/',auth[_0x170a('0x8')](),controller[_0x170a('0x9')]);router[_0x170a('0x7')](_0x170a('0xa'),auth['isAuthenticated'](),controller['describe']);router[_0x170a('0x7')](_0x170a('0xb'),auth[_0x170a('0x8')](),controller['show']);router['get'](_0x170a('0xc'),auth[_0x170a('0x8')](),controller[_0x170a('0xd')]);router[_0x170a('0x7')](_0x170a('0xe'),auth['isAuthenticated'](),controller[_0x170a('0xf')]);router[_0x170a('0x10')]('/',auth[_0x170a('0x8')](),controller[_0x170a('0x11')]);router[_0x170a('0x10')](_0x170a('0xc'),auth[_0x170a('0x8')](),controller['addAgents']);router[_0x170a('0x10')](_0x170a('0xe'),auth[_0x170a('0x8')](),controller[_0x170a('0x12')]);router[_0x170a('0x13')]('/:id',auth[_0x170a('0x8')](),controller[_0x170a('0x14')]);router[_0x170a('0x15')](_0x170a('0xb'),auth[_0x170a('0x8')](),controller[_0x170a('0x16')]);router[_0x170a('0x15')](_0x170a('0xc'),auth['isAuthenticated'](),controller[_0x170a('0x17')]);router[_0x170a('0x15')](_0x170a('0xe'),auth[_0x170a('0x8')](),controller[_0x170a('0x18')]);module['exports']=router; \ No newline at end of file +var _0x061c=['delete','destroy','/:id/users','removeAgents','removeTeams','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./voicePrefix.controller','isAuthenticated','index','get','/describe','describe','/:id','getAgents','/:id/teams','getTeams','post','create','addAgents','addTeams','put','update'];(function(_0x2da7b8,_0xf42496){var _0x4676c5=function(_0x434f65){while(--_0x434f65){_0x2da7b8['push'](_0x2da7b8['shift']());}};_0x4676c5(++_0xf42496);}(_0x061c,0xc0));var _0xc061=function(_0x303ba2,_0x45297e){_0x303ba2=_0x303ba2-0x0;var _0x56ffe1=_0x061c[_0x303ba2];return _0x56ffe1;};'use strict';var multer=require(_0xc061('0x0'));var util=require(_0xc061('0x1'));var path=require(_0xc061('0x2'));var timeout=require(_0xc061('0x3'));var express=require(_0xc061('0x4'));var router=express[_0xc061('0x5')]();var fs_extra=require(_0xc061('0x6'));var auth=require(_0xc061('0x7'));var interaction=require(_0xc061('0x8'));var config=require('../../config/environment');var controller=require(_0xc061('0x9'));router['get']('/',auth[_0xc061('0xa')](),controller[_0xc061('0xb')]);router[_0xc061('0xc')](_0xc061('0xd'),auth[_0xc061('0xa')](),controller[_0xc061('0xe')]);router[_0xc061('0xc')](_0xc061('0xf'),auth[_0xc061('0xa')](),controller['show']);router['get']('/:id/users',auth[_0xc061('0xa')](),controller[_0xc061('0x10')]);router[_0xc061('0xc')](_0xc061('0x11'),auth['isAuthenticated'](),controller[_0xc061('0x12')]);router[_0xc061('0x13')]('/',auth[_0xc061('0xa')](),controller[_0xc061('0x14')]);router['post']('/:id/users',auth[_0xc061('0xa')](),controller[_0xc061('0x15')]);router[_0xc061('0x13')](_0xc061('0x11'),auth[_0xc061('0xa')](),controller[_0xc061('0x16')]);router[_0xc061('0x17')](_0xc061('0xf'),auth[_0xc061('0xa')](),controller[_0xc061('0x18')]);router[_0xc061('0x19')](_0xc061('0xf'),auth[_0xc061('0xa')](),controller[_0xc061('0x1a')]);router['delete'](_0xc061('0x1b'),auth[_0xc061('0xa')](),controller[_0xc061('0x1c')]);router[_0xc061('0x19')](_0xc061('0x11'),auth[_0xc061('0xa')](),controller[_0xc061('0x1d')]);module[_0xc061('0x1e')]=router; \ No newline at end of file diff --git a/server/api/voicePrefix/voicePrefix.attributes.js b/server/api/voicePrefix/voicePrefix.attributes.js index 02404f8..5336a04 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 _0x3aad=['sequelize','exports','STRING','name','system-','getDataValue','INTEGER'];(function(_0x840aba,_0x32b722){var _0x128321=function(_0x1dac9a){while(--_0x1dac9a){_0x840aba['push'](_0x840aba['shift']());}};_0x128321(++_0x32b722);}(_0x3aad,0x1a4));var _0xd3aa=function(_0x3186f5,_0xd6b4dd){_0x3186f5=_0x3186f5-0x0;var _0x11f488=_0x3aad[_0x3186f5];return _0x11f488;};'use strict';var Sequelize=require(_0xd3aa('0x0'));module[_0xd3aa('0x1')]={'name':{'type':Sequelize[_0xd3aa('0x2')],'allowNull':![],'unique':_0xd3aa('0x3')},'prefix':{'type':Sequelize['VIRTUAL'],'get':function(_0x61ec44){return _0xd3aa('0x4')+this[_0xd3aa('0x5')](_0xd3aa('0x3'))+'-';}},'description':{'type':Sequelize['STRING']},'callerIdAll':{'type':Sequelize[_0xd3aa('0x2')]},'VoiceExtensionId':{'type':Sequelize[_0xd3aa('0x6')]}}; \ No newline at end of file +var _0x2a09=['exports','STRING','name','VIRTUAL','system-','getDataValue','sequelize'];(function(_0x233e93,_0x451d61){var _0x114a7e=function(_0x13a057){while(--_0x13a057){_0x233e93['push'](_0x233e93['shift']());}};_0x114a7e(++_0x451d61);}(_0x2a09,0x164));var _0x92a0=function(_0x75c8cf,_0x2d896c){_0x75c8cf=_0x75c8cf-0x0;var _0x4589e1=_0x2a09[_0x75c8cf];return _0x4589e1;};'use strict';var Sequelize=require(_0x92a0('0x0'));module[_0x92a0('0x1')]={'name':{'type':Sequelize[_0x92a0('0x2')],'allowNull':![],'unique':_0x92a0('0x3')},'prefix':{'type':Sequelize[_0x92a0('0x4')],'get':function(_0x2a019b){return _0x92a0('0x5')+this[_0x92a0('0x6')](_0x92a0('0x3'))+'-';}},'description':{'type':Sequelize[_0x92a0('0x2')]},'callerIdAll':{'type':Sequelize[_0x92a0('0x2')]},'VoiceExtensionId':{'type':Sequelize['INTEGER']}}; \ No newline at end of file diff --git a/server/api/voicePrefix/voicePrefix.controller.js b/server/api/voicePrefix/voicePrefix.controller.js index 2f7d526..9247e48 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 _0xf7b4=['filter','nolimit','User','Agents','online','voicePause','flatMap','each','TeamVoicePrefix','upsert','UserVoicePrefix','findOrCreate','forEach','removeTeams','select','from','join','user_has_teams','ut.TeamId\x20=\x20tq.TeamId','VoicePrefixId\x20=\x20?','clone','ut.UserId\x20=\x20?','toString','QueryTypes','SELECT','every','TeamId','includes','union','value','eml-format','fast-json-patch','request-promise','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','redis','defaults','localhost','./voicePrefix.socket','register','sendStatus','status','end','json','undefined','limit','count','offset','set','Content-Range','apply','save','then','destroy','VoicePrefixes','UserProfileResource','name','send','index','map','VoicePrefix','rawAttributes','fieldName','type','key','model','query','keys','intersection','attributes','fields','length','hasOwnProperty','order','sort','where','pick','merge','includeAll','include','findAll','rows','catch','show','params','options','find','describe','sequelize','transaction','create','body','get','VoiceExtension','VoiceExtensionId','role','user','userProfileId','autoAssociation','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','app','system','description','Voice\x20Prefix\x20Extension','priority','appdata','prefix','NoOp','Voice\x20Prefix','VoicePrefixId','bulkCreate','callerIdAll','push','PREFIX-CALLERIDALL=','No\x20callerid\x20available','goto','context','charAt','update','system-','findById','addAgents','ids','omit','spread','emit','userVoicePrefix:save','removeAgents','isArray','userVoicePrefix:remove','getAgents','findOne','filters','getTeams','Team'];(function(_0x673722,_0x275d7e){var _0x21249c=function(_0x25b4e7){while(--_0x25b4e7){_0x673722['push'](_0x673722['shift']());}};_0x21249c(++_0x275d7e);}(_0xf7b4,0x152));var _0x4f7b=function(_0x2215c8,_0x32ea49){_0x2215c8=_0x2215c8-0x0;var _0x2d8d10=_0xf7b4[_0x2215c8];return _0x2d8d10;};'use strict';var emlformat=require(_0x4f7b('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0x4f7b('0x1'));var rp=require(_0x4f7b('0x2'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0x4f7b('0x3'));var util=require(_0x4f7b('0x4'));var path=require(_0x4f7b('0x5'));var sox=require(_0x4f7b('0x6'));var csv=require(_0x4f7b('0x7'));var ejs=require(_0x4f7b('0x8'));var fs=require('fs');var fs_extra=require(_0x4f7b('0x9'));var _=require(_0x4f7b('0xa'));var squel=require(_0x4f7b('0xb'));var crypto=require(_0x4f7b('0xc'));var jsforce=require(_0x4f7b('0xd'));var deskjs=require(_0x4f7b('0xe'));var toCsv=require(_0x4f7b('0x7'));var querystring=require('querystring');var Papa=require(_0x4f7b('0xf'));var Redis=require(_0x4f7b('0x10'));var authService=require('../../components/auth/service');var qs=require(_0x4f7b('0x11'));var as=require(_0x4f7b('0x12'));var hardwareService=require(_0x4f7b('0x13'));var logger=require(_0x4f7b('0x14'))(_0x4f7b('0x15'));var utils=require('../../config/utils');var config=require(_0x4f7b('0x16'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];config[_0x4f7b('0x17')]=_[_0x4f7b('0x18')](config[_0x4f7b('0x17')],{'host':_0x4f7b('0x19'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x4f7b('0x17')]));require(_0x4f7b('0x1a'))[_0x4f7b('0x1b')](socket);function respondWithStatusCode(_0x43a51a,_0x339486){_0x339486=_0x339486||0xcc;return function(_0x330de9){if(_0x330de9){return _0x43a51a[_0x4f7b('0x1c')](_0x339486);}return _0x43a51a[_0x4f7b('0x1d')](_0x339486)[_0x4f7b('0x1e')]();};}function respondWithResult(_0x29fdd5,_0x1a28b8){_0x1a28b8=_0x1a28b8||0xc8;return function(_0x1e7afc){if(_0x1e7afc){return _0x29fdd5['status'](_0x1a28b8)[_0x4f7b('0x1f')](_0x1e7afc);}};}function respondWithFilteredResult(_0x496322,_0x5b5ee3){return function(_0x24e5cf){if(_0x24e5cf){var _0x3813da=typeof _0x5b5ee3['offset']===_0x4f7b('0x20')&&typeof _0x5b5ee3[_0x4f7b('0x21')]===_0x4f7b('0x20');var _0xf2311f=_0x24e5cf['count'];var _0x1daa79=_0x3813da?0x0:_0x5b5ee3['offset'];var _0x41cf36=_0x3813da?_0x24e5cf[_0x4f7b('0x22')]:_0x5b5ee3[_0x4f7b('0x23')]+_0x5b5ee3[_0x4f7b('0x21')];var _0x27127b;if(_0x41cf36>=_0xf2311f){_0x41cf36=_0xf2311f;_0x27127b=0xc8;}else{_0x27127b=0xce;}_0x496322[_0x4f7b('0x1d')](_0x27127b);return _0x496322[_0x4f7b('0x24')](_0x4f7b('0x25'),_0x1daa79+'-'+_0x41cf36+'/'+_0xf2311f)[_0x4f7b('0x1f')](_0x24e5cf);}return null;};}function patchUpdates(_0x5508bd){return function(_0x410176){try{jsonpatch[_0x4f7b('0x26')](_0x410176,_0x5508bd,!![]);}catch(_0x2c9ea6){return BPromise['reject'](_0x2c9ea6);}return _0x410176[_0x4f7b('0x27')]();};}function saveUpdates(_0x4610a4,_0x5d22f4){return function(_0x15dbec){if(_0x15dbec){return _0x15dbec['update'](_0x4610a4)[_0x4f7b('0x28')](function(_0x2429be){return _0x2429be;});}return null;};}function removeEntity(_0x23c820,_0x278c41){return function(_0x17aa9d){if(_0x17aa9d){return _0x17aa9d[_0x4f7b('0x29')]()[_0x4f7b('0x28')](function(){var _0x3ad769=_0x17aa9d['get']({'plain':!![]});var _0x6c9626=_0x4f7b('0x2a');return db[_0x4f7b('0x2b')]['destroy']({'where':{'type':_0x6c9626,'resourceId':_0x3ad769['id']}})[_0x4f7b('0x28')](function(){return _0x17aa9d;});})[_0x4f7b('0x28')](function(){_0x23c820[_0x4f7b('0x1d')](0xcc)[_0x4f7b('0x1e')]();});}};}function handleEntityNotFound(_0x1ccce0,_0x4ebffa){return function(_0xac1f93){if(!_0xac1f93){_0x1ccce0[_0x4f7b('0x1c')](0x194);}return _0xac1f93;};}function handleError(_0x9a675c,_0x59d3ad){_0x59d3ad=_0x59d3ad||0x1f4;return function(_0x7de561){logger['error'](_0x7de561['stack']);if(_0x7de561[_0x4f7b('0x2c')]){delete _0x7de561['name'];}_0x9a675c[_0x4f7b('0x1d')](_0x59d3ad)[_0x4f7b('0x2d')](_0x7de561);};}exports[_0x4f7b('0x2e')]=function(_0x1cf980,_0x105ffb){var _0x4e5862={},_0x13a113={},_0x179372={'count':0x0,'rows':[]};var _0xba46b8=_[_0x4f7b('0x2f')](db[_0x4f7b('0x30')][_0x4f7b('0x31')],function(_0x3e7fb4){return{'name':_0x3e7fb4[_0x4f7b('0x32')],'type':_0x3e7fb4[_0x4f7b('0x33')][_0x4f7b('0x34')]};});_0x13a113[_0x4f7b('0x35')]=_[_0x4f7b('0x2f')](_0xba46b8,_0x4f7b('0x2c'));_0x13a113[_0x4f7b('0x36')]=_[_0x4f7b('0x37')](_0x1cf980[_0x4f7b('0x36')]);_0x13a113['filters']=_[_0x4f7b('0x38')](_0x13a113['model'],_0x13a113[_0x4f7b('0x36')]);_0x4e5862[_0x4f7b('0x39')]=_['intersection'](_0x13a113[_0x4f7b('0x35')],qs[_0x4f7b('0x3a')](_0x1cf980[_0x4f7b('0x36')]['fields']));_0x4e5862[_0x4f7b('0x39')]=_0x4e5862[_0x4f7b('0x39')][_0x4f7b('0x3b')]?_0x4e5862[_0x4f7b('0x39')]:_0x13a113[_0x4f7b('0x35')];if(!_0x1cf980[_0x4f7b('0x36')][_0x4f7b('0x3c')]('nolimit')){_0x4e5862[_0x4f7b('0x21')]=qs['limit'](_0x1cf980[_0x4f7b('0x36')][_0x4f7b('0x21')]);_0x4e5862[_0x4f7b('0x23')]=qs['offset'](_0x1cf980[_0x4f7b('0x36')]['offset']);}_0x4e5862[_0x4f7b('0x3d')]=qs[_0x4f7b('0x3e')](_0x1cf980['query']['sort']);_0x4e5862[_0x4f7b('0x3f')]=qs['filters'](_[_0x4f7b('0x40')](_0x1cf980[_0x4f7b('0x36')],_0x13a113['filters']),_0xba46b8);if(_0x1cf980[_0x4f7b('0x36')]['filter']){_0x4e5862['where']=_['merge'](_0x4e5862[_0x4f7b('0x3f')],{'$or':_[_0x4f7b('0x2f')](_0xba46b8,function(_0xa5532b){if(_0xa5532b[_0x4f7b('0x33')]!=='VIRTUAL'){var _0x3da93f={};_0x3da93f[_0xa5532b['name']]={'$like':'%'+_0x1cf980[_0x4f7b('0x36')]['filter']+'%'};return _0x3da93f;}})});}_0x4e5862=_[_0x4f7b('0x41')]({},_0x4e5862,_0x1cf980['options']);var _0x2c2b10={'where':_0x4e5862[_0x4f7b('0x3f')]};return db[_0x4f7b('0x30')][_0x4f7b('0x22')](_0x2c2b10)[_0x4f7b('0x28')](function(_0x325cd6){_0x179372[_0x4f7b('0x22')]=_0x325cd6;if(_0x1cf980[_0x4f7b('0x36')][_0x4f7b('0x42')]){_0x4e5862[_0x4f7b('0x43')]=[{'all':!![]}];}return db[_0x4f7b('0x30')][_0x4f7b('0x44')](_0x4e5862);})[_0x4f7b('0x28')](function(_0x508eaa){_0x179372[_0x4f7b('0x45')]=_0x508eaa;return _0x179372;})[_0x4f7b('0x28')](respondWithFilteredResult(_0x105ffb,_0x4e5862))[_0x4f7b('0x46')](handleError(_0x105ffb,null));};exports[_0x4f7b('0x47')]=function(_0x5cfca1,_0x581356){var _0x10d0ac={'raw':![],'where':{'id':_0x5cfca1[_0x4f7b('0x48')]['id']}},_0x1d1e10={};_0x1d1e10[_0x4f7b('0x35')]=_['keys'](db['VoicePrefix'][_0x4f7b('0x31')]);_0x1d1e10[_0x4f7b('0x36')]=_[_0x4f7b('0x37')](_0x5cfca1[_0x4f7b('0x36')]);_0x1d1e10['filters']=_['intersection'](_0x1d1e10[_0x4f7b('0x35')],_0x1d1e10[_0x4f7b('0x36')]);_0x10d0ac[_0x4f7b('0x39')]=_[_0x4f7b('0x38')](_0x1d1e10[_0x4f7b('0x35')],qs['fields'](_0x5cfca1[_0x4f7b('0x36')][_0x4f7b('0x3a')]));_0x10d0ac[_0x4f7b('0x39')]=_0x10d0ac['attributes'][_0x4f7b('0x3b')]?_0x10d0ac[_0x4f7b('0x39')]:_0x1d1e10[_0x4f7b('0x35')];if(_0x5cfca1[_0x4f7b('0x36')][_0x4f7b('0x42')]){_0x10d0ac[_0x4f7b('0x43')]=[{'all':!![]}];}_0x10d0ac=_[_0x4f7b('0x41')]({},_0x10d0ac,_0x5cfca1[_0x4f7b('0x49')]);return db[_0x4f7b('0x30')][_0x4f7b('0x4a')](_0x10d0ac)['then'](handleEntityNotFound(_0x581356,null))[_0x4f7b('0x28')](respondWithResult(_0x581356,null))[_0x4f7b('0x46')](handleError(_0x581356,null));};exports[_0x4f7b('0x29')]=function(_0x5003f1,_0x16eaef){return db[_0x4f7b('0x30')][_0x4f7b('0x4a')]({'where':{'id':_0x5003f1[_0x4f7b('0x48')]['id']}})[_0x4f7b('0x28')](handleEntityNotFound(_0x16eaef,null))[_0x4f7b('0x28')](removeEntity(_0x16eaef,null))[_0x4f7b('0x46')](handleError(_0x16eaef,null));};exports[_0x4f7b('0x4b')]=function(_0x776ce7,_0x23d5f3){return db['VoicePrefix'][_0x4f7b('0x4b')]()[_0x4f7b('0x28')](respondWithResult(_0x23d5f3,null))[_0x4f7b('0x46')](handleError(_0x23d5f3,null));};exports['create']=function(_0x2c9cee,_0x40c183){var _0xeeb227;return db[_0x4f7b('0x4c')][_0x4f7b('0x4d')](function(_0x819fb3){return db['VoicePrefix'][_0x4f7b('0x4e')](_0x2c9cee[_0x4f7b('0x4f')],{'transaction':_0x819fb3})[_0x4f7b('0x28')](function(_0x4c9496){_0xeeb227=_0x4c9496[_0x4f7b('0x50')]({'plain':!![]});return db[_0x4f7b('0x51')][_0x4f7b('0x4a')]({'where':{'id':_0xeeb227[_0x4f7b('0x52')]},'raw':!![]})[_0x4f7b('0x28')](function(_0x6e448f){return createVoicePrefixExtensions(_0xeeb227,_0x6e448f,_0x819fb3);});});})['then'](function(){var _0x13bb98=_0x2c9cee['user']['get']({'plain':!![]});if(!_0x13bb98)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x13bb98[_0x4f7b('0x53')]===_0x4f7b('0x54')){var _0x27b2e1=_0xeeb227;return db['UserProfileSection']['find']({'where':{'name':_0x4f7b('0x2a'),'userProfileId':_0x13bb98[_0x4f7b('0x55')]},'raw':!![]})['then'](function(_0xf957ca){if(_0xf957ca&&_0xf957ca[_0x4f7b('0x56')]===0x0){return db[_0x4f7b('0x2b')][_0x4f7b('0x4e')]({'name':_0x27b2e1['name'],'resourceId':_0x27b2e1['id'],'type':_0xf957ca[_0x4f7b('0x2c')],'sectionId':_0xf957ca['id']},{})[_0x4f7b('0x28')](function(){return _0xeeb227;});}else{return _0xeeb227;}})[_0x4f7b('0x46')](function(_0x42b378){logger[_0x4f7b('0x57')](_0x4f7b('0x58'),_0x42b378);throw _0x42b378;});}return _0xeeb227;})[_0x4f7b('0x28')](respondWithResult(_0x40c183,null))['catch'](handleError(_0x40c183,null));};function Extension(_0x529821,_0x507199,_0x133074,_0x5530cb){this['context']='from-sip';this['exten']=_0x529821;this[_0x4f7b('0x59')]=_0x133074;this[_0x4f7b('0x33')]=_0x4f7b('0x5a');this[_0x4f7b('0x5b')]=_0x4f7b('0x5c');this[_0x4f7b('0x5d')]=_0x507199;this[_0x4f7b('0x5e')]=_0x5530cb;}function createVoicePrefixExtensions(_0x80efcb,_0x1d500c,_0x2a80fe){return new BPromise(function(_0x31bed4,_0x12456e){var _0x1ba432=new Extension(formatPrefixName(_0x80efcb[_0x4f7b('0x5f')]),0x1,_0x4f7b('0x60'),_0x4f7b('0x61'));_0x1ba432[_0x4f7b('0x62')]=_0x80efcb['id'];return db[_0x4f7b('0x51')]['create'](_0x1ba432,{'transaction':_0x2a80fe})[_0x4f7b('0x28')](function(_0x46d15c){var _0x3c5b28=_0x46d15c[_0x4f7b('0x50')]({'plain':!![]});var _0x321f36=_['map'](addVoicePrefixExtensions(_0x80efcb,_0x1d500c),function(_0x4b9f3a){_0x4b9f3a[_0x4f7b('0x52')]=_0x3c5b28['id'];_0x4b9f3a['VoicePrefixId']=_0x80efcb['id'];return _0x4b9f3a;});return db[_0x4f7b('0x51')][_0x4f7b('0x63')](_0x321f36,{'transaction':_0x2a80fe})[_0x4f7b('0x28')](function(_0x7509ab){if(!_0x7509ab){return _0x12456e('Extensions\x20creation\x20failed');}else{return _0x31bed4(_0x7509ab);}})[_0x4f7b('0x46')](function(_0x35b569){return _0x12456e(_0x35b569);});});;});};function addVoicePrefixExtensions(_0x5a6db0,_0x58baa5){var _0x4b2089=[];var _0x5b16cb=formatPrefixName(_0x5a6db0[_0x4f7b('0x5f')]);_0x4b2089['push'](new Extension(_0x5b16cb,0x2,'Set','CDR(prefix)='+_0x5a6db0[_0x4f7b('0x2c')]));if(_0x5a6db0[_0x4f7b('0x64')]){_0x4b2089[_0x4f7b('0x65')](new Extension(_0x5b16cb,0x3,'Set',_0x4f7b('0x66')+_0x5a6db0[_0x4f7b('0x64')]));}else{_0x4b2089['push'](new Extension(_0x5b16cb,0x3,'NoOp',_0x4f7b('0x67')));}_0x4b2089[_0x4f7b('0x65')](new Extension(_0x5b16cb,0x4,_0x4f7b('0x68'),_0x58baa5[_0x4f7b('0x69')]+','+'${EXTEN:'+(0x8+_0x5a6db0[_0x4f7b('0x2c')][_0x4f7b('0x3b')])+'}'+','+0x1));return _0x4b2089;}function formatPrefixName(_0xc6b94e){var _0x2cb5f1='_';for(var _0x2ac8db=0x0;_0x2ac8db<_0xc6b94e[_0x4f7b('0x3b')];_0x2ac8db++){if(_0xc6b94e['charAt'](_0x2ac8db)=='-'){_0x2cb5f1+=_0xc6b94e[_0x4f7b('0x6a')](_0x2ac8db);}else{_0x2cb5f1+='['+_0xc6b94e[_0x4f7b('0x6a')](_0x2ac8db)+']';}}_0x2cb5f1+='.';return _0x2cb5f1;}exports[_0x4f7b('0x6b')]=function(_0x220f21,_0x1ca442,_0x509763){var _0x579363=_0x220f21['body'];_0x579363[_0x4f7b('0x5f')]=_0x4f7b('0x6c')+_0x579363[_0x4f7b('0x2c')]+'-';return db[_0x4f7b('0x4c')][_0x4f7b('0x4d')](function(_0x53034b){return db[_0x4f7b('0x30')][_0x4f7b('0x6b')](_0x579363,{'where':{'id':_0x579363['id']},'transaction':_0x53034b})[_0x4f7b('0x28')](function(){return db[_0x4f7b('0x51')][_0x4f7b('0x29')]({'where':{'VoicePrefixId':_0x579363['id']},'transaction':_0x53034b})[_0x4f7b('0x28')](function(){return db[_0x4f7b('0x51')][_0x4f7b('0x4a')]({'where':{'id':_0x579363[_0x4f7b('0x52')]},'raw':!![]})[_0x4f7b('0x28')](function(_0x36b46d){return createVoicePrefixExtensions(_0x579363,_0x36b46d,_0x53034b);});});});})[_0x4f7b('0x28')](function(){return db[_0x4f7b('0x30')][_0x4f7b('0x6d')](_0x579363['id']);})[_0x4f7b('0x28')](respondWithResult(_0x1ca442,null))[_0x4f7b('0x46')](handleError(_0x1ca442,null));};exports[_0x4f7b('0x6e')]=function(_0xf0691e,_0x531da6,_0x5bce88){return db[_0x4f7b('0x30')][_0x4f7b('0x4a')]({'where':{'id':_0xf0691e[_0x4f7b('0x48')]['id']}})[_0x4f7b('0x28')](handleEntityNotFound(_0x531da6,null))['then'](function(_0x1102fe){if(_0x1102fe){return _0x1102fe[_0x4f7b('0x6e')](_0xf0691e[_0x4f7b('0x4f')][_0x4f7b('0x6f')],_[_0x4f7b('0x70')](_0xf0691e[_0x4f7b('0x4f')],[_0x4f7b('0x6f'),'id'])||{})[_0x4f7b('0x71')](function(_0x3ddd33){for(var _0x13f190=0x0;_0x13f190<_0xf0691e[_0x4f7b('0x4f')][_0x4f7b('0x6f')][_0x4f7b('0x3b')];_0x13f190+=0x1){socket[_0x4f7b('0x72')](_0x4f7b('0x73'),{'UserId':Number(_0xf0691e['body'][_0x4f7b('0x6f')][_0x13f190]),'VoicePrefixId':Number(_0xf0691e[_0x4f7b('0x48')]['id'])});}return _0x3ddd33;});}})['then'](respondWithResult(_0x531da6,null))['catch'](handleError(_0x531da6,null));};exports[_0x4f7b('0x74')]=function(_0x4beb8e,_0x3d25a6,_0x12125d){return db[_0x4f7b('0x30')][_0x4f7b('0x4a')]({'where':{'id':_0x4beb8e[_0x4f7b('0x48')]['id']}})['then'](handleEntityNotFound(_0x3d25a6,null))['then'](function(_0x42bd6b){if(_0x42bd6b){return _0x42bd6b[_0x4f7b('0x74')](_0x4beb8e[_0x4f7b('0x36')][_0x4f7b('0x6f')])['then'](function(){if(_[_0x4f7b('0x75')](_0x4beb8e[_0x4f7b('0x36')]['ids'])){for(var _0x6aef20=0x0;_0x6aef20<_0x4beb8e[_0x4f7b('0x36')]['ids']['length'];_0x6aef20+=0x1){socket[_0x4f7b('0x72')]('userVoicePrefix:remove',{'UserId':Number(_0x4beb8e['query']['ids'][_0x6aef20]),'VoicePrefixId':Number(_0x4beb8e[_0x4f7b('0x48')]['id'])});}}else{socket['emit'](_0x4f7b('0x76'),{'UserId':Number(_0x4beb8e[_0x4f7b('0x36')][_0x4f7b('0x6f')]),'VoicePrefixId':Number(_0x4beb8e[_0x4f7b('0x48')]['id'])});}});}})[_0x4f7b('0x28')](respondWithStatusCode(_0x3d25a6,null))[_0x4f7b('0x46')](handleError(_0x3d25a6,null));};exports[_0x4f7b('0x77')]=function(_0x1f6650,_0x39799b,_0x4da13f){var _0x476637={};var _0x35c3cb={};var _0x37d151;var _0x40120d;return db[_0x4f7b('0x30')][_0x4f7b('0x78')]({'where':{'id':_0x1f6650[_0x4f7b('0x48')]['id']}})[_0x4f7b('0x28')](handleEntityNotFound(_0x39799b,null))['then'](function(_0x24289e){if(_0x24289e){_0x37d151=_0x24289e;_0x35c3cb[_0x4f7b('0x35')]=_[_0x4f7b('0x37')](db['User'][_0x4f7b('0x31')]);_0x35c3cb['query']=_[_0x4f7b('0x37')](_0x1f6650[_0x4f7b('0x36')]);_0x35c3cb['filters']=_['intersection'](_0x35c3cb[_0x4f7b('0x35')],_0x35c3cb['query']);_0x476637[_0x4f7b('0x39')]=_['intersection'](_0x35c3cb[_0x4f7b('0x35')],qs[_0x4f7b('0x3a')](_0x1f6650[_0x4f7b('0x36')]['fields']));_0x476637[_0x4f7b('0x39')]=_0x476637['attributes'][_0x4f7b('0x3b')]?_0x476637[_0x4f7b('0x39')]:_0x35c3cb[_0x4f7b('0x35')];_0x476637[_0x4f7b('0x3d')]=qs[_0x4f7b('0x3e')](_0x1f6650[_0x4f7b('0x36')][_0x4f7b('0x3e')]);_0x476637['where']=qs[_0x4f7b('0x79')](_['pick'](_0x1f6650['query'],_0x35c3cb['filters']));if(_0x1f6650[_0x4f7b('0x36')]['filter']){_0x476637[_0x4f7b('0x3f')]=_[_0x4f7b('0x41')](_0x476637[_0x4f7b('0x3f')],{'$or':_[_0x4f7b('0x2f')](_0x476637[_0x4f7b('0x39')],function(_0x3f5f81){var _0x30a003={};_0x30a003[_0x3f5f81]={'$like':'%'+_0x1f6650[_0x4f7b('0x36')]['filter']+'%'};return _0x30a003;})});}_0x476637=_['merge']({},_0x476637,_0x1f6650['options']);return _0x37d151['getAgents'](_0x476637);}})[_0x4f7b('0x28')](function(_0x34bca4){if(_0x34bca4){_0x40120d=_0x34bca4[_0x4f7b('0x3b')];if(!_0x1f6650['query'][_0x4f7b('0x3c')]('nolimit')){_0x476637[_0x4f7b('0x21')]=qs[_0x4f7b('0x21')](_0x1f6650['query'][_0x4f7b('0x21')]);_0x476637[_0x4f7b('0x23')]=qs[_0x4f7b('0x23')](_0x1f6650['query'][_0x4f7b('0x23')]);}return _0x37d151[_0x4f7b('0x77')](_0x476637);}})[_0x4f7b('0x28')](function(_0x3927b5){if(_0x3927b5){return _0x3927b5?{'count':_0x40120d,'rows':_0x3927b5}:null;}})[_0x4f7b('0x28')](respondWithResult(_0x39799b,null))[_0x4f7b('0x46')](handleError(_0x39799b,null));};exports[_0x4f7b('0x7a')]=function(_0x1a91ce,_0xd249a,_0x4f2c6e){var _0x147e14={};var _0x55922a={};var _0x5afd27;var _0x471caa;return db[_0x4f7b('0x30')]['findOne']({'where':{'id':_0x1a91ce['params']['id']}})[_0x4f7b('0x28')](handleEntityNotFound(_0xd249a,null))['then'](function(_0x13c2e4){if(_0x13c2e4){_0x5afd27=_0x13c2e4;_0x55922a[_0x4f7b('0x35')]=_[_0x4f7b('0x37')](db[_0x4f7b('0x7b')][_0x4f7b('0x31')]);_0x55922a[_0x4f7b('0x36')]=_[_0x4f7b('0x37')](_0x1a91ce[_0x4f7b('0x36')]);_0x55922a['filters']=_[_0x4f7b('0x38')](_0x55922a[_0x4f7b('0x35')],_0x55922a[_0x4f7b('0x36')]);_0x147e14[_0x4f7b('0x39')]=_[_0x4f7b('0x38')](_0x55922a[_0x4f7b('0x35')],qs[_0x4f7b('0x3a')](_0x1a91ce['query'][_0x4f7b('0x3a')]));_0x147e14[_0x4f7b('0x39')]=_0x147e14[_0x4f7b('0x39')][_0x4f7b('0x3b')]?_0x147e14[_0x4f7b('0x39')]:_0x55922a[_0x4f7b('0x35')];_0x147e14[_0x4f7b('0x3d')]=qs[_0x4f7b('0x3e')](_0x1a91ce[_0x4f7b('0x36')]['sort']);_0x147e14['where']=qs['filters'](_['pick'](_0x1a91ce[_0x4f7b('0x36')],_0x55922a[_0x4f7b('0x79')]));if(_0x1a91ce[_0x4f7b('0x36')][_0x4f7b('0x7c')]){_0x147e14[_0x4f7b('0x3f')]=_[_0x4f7b('0x41')](_0x147e14[_0x4f7b('0x3f')],{'$or':_['map'](_0x147e14[_0x4f7b('0x39')],function(_0x265a8f){var _0x39ec96={};_0x39ec96[_0x265a8f]={'$like':'%'+_0x1a91ce[_0x4f7b('0x36')]['filter']+'%'};return _0x39ec96;})});}_0x147e14=_[_0x4f7b('0x41')]({},_0x147e14,_0x1a91ce[_0x4f7b('0x49')]);return _0x5afd27[_0x4f7b('0x7a')](_0x147e14);}})['then'](function(_0x3f844f){if(_0x3f844f){_0x471caa=_0x3f844f[_0x4f7b('0x3b')];if(!_0x1a91ce[_0x4f7b('0x36')][_0x4f7b('0x3c')](_0x4f7b('0x7d'))){_0x147e14[_0x4f7b('0x21')]=qs[_0x4f7b('0x21')](_0x1a91ce[_0x4f7b('0x36')][_0x4f7b('0x21')]);_0x147e14[_0x4f7b('0x23')]=qs[_0x4f7b('0x23')](_0x1a91ce[_0x4f7b('0x36')]['offset']);}return _0x5afd27['getTeams'](_0x147e14);}})[_0x4f7b('0x28')](function(_0x4cd4d6){if(_0x4cd4d6){return _0x4cd4d6?{'count':_0x471caa,'rows':_0x4cd4d6}:null;}})[_0x4f7b('0x28')](respondWithResult(_0xd249a,null))[_0x4f7b('0x46')](handleError(_0xd249a,null));};exports['addTeams']=function(_0x411a94,_0x1e934e,_0x5ec78b){var _0x4e07ce=_0x411a94['body'][_0x4f7b('0x6f')];var _0x5a8bda;return db['Team'][_0x4f7b('0x44')]({'where':{'id':_0x4e07ce},'attributes':['id'],'include':[{'model':db[_0x4f7b('0x7e')],'as':_0x4f7b('0x7f'),'attributes':['id',_0x4f7b('0x2c'),_0x4f7b('0x80'),_0x4f7b('0x81'),'interface'],'raw':!![]}]})[_0x4f7b('0x28')](function(_0x1ebf36){if(_0x1ebf36){_0x5a8bda=_0x1ebf36;var _0x4daeb1=_[_0x4f7b('0x82')](_0x1ebf36,function(_0x5556b4){var _0x4d5eb3=_0x5556b4['get']({'plain':!![]});return _0x4d5eb3[_0x4f7b('0x7f')];});return db[_0x4f7b('0x30')][_0x4f7b('0x4a')]({'where':{'id':_0x411a94[_0x4f7b('0x48')]['id']}})['then'](function(_0x3e0d84){return db['sequelize']['transaction'](function(_0x5c2027){return _0x3e0d84['addTeams'](_0x4e07ce,{'transaction':_0x5c2027})[_0x4f7b('0x28')](function(){return BPromise[_0x4f7b('0x83')](_0x5a8bda,function(_0xb3a12b){return db[_0x4f7b('0x84')][_0x4f7b('0x85')]({'TeamId':_0xb3a12b['id'],'VoicePrefixId':_0x411a94['params']['id']},{'transaction':_0x5c2027});});})[_0x4f7b('0x28')](function(){return BPromise[_0x4f7b('0x83')](_0x4daeb1,function(_0x20daa0){return db[_0x4f7b('0x86')][_0x4f7b('0x87')]({'where':{'UserId':_0x20daa0['id'],'VoicePrefixId':_0x411a94[_0x4f7b('0x48')]['id']},'transaction':_0x5c2027});});})['then'](function(){_0x4daeb1[_0x4f7b('0x88')](function(_0x5f4ea9){socket[_0x4f7b('0x72')](_0x4f7b('0x73'),{'UserId':_0x5f4ea9['id'],'VoicePrefixId':_0x3e0d84['id']});});});});});}})[_0x4f7b('0x28')](respondWithStatusCode(_0x1e934e,null))[_0x4f7b('0x46')](handleError(_0x1e934e,null));};exports[_0x4f7b('0x89')]=function(_0x3aaa25,_0x344257,_0x36209e){return db[_0x4f7b('0x7b')][_0x4f7b('0x44')]({'where':{'id':_0x3aaa25[_0x4f7b('0x36')][_0x4f7b('0x6f')]},'attributes':['id'],'include':[{'model':db['User'],'as':'Agents','attributes':['id'],'raw':!![]}]})[_0x4f7b('0x28')](handleEntityNotFound(_0x344257,null))[_0x4f7b('0x28')](function(_0x136804){var _0x13d7cd=_[_0x4f7b('0x2f')](_0x136804,'id');var _0x1cf812=[];var _0x3434a1=[];var _0x3acd39=squel[_0x4f7b('0x8a')]();_0x3acd39['field']('tq.TeamId')[_0x4f7b('0x8b')]('team_has_voice_prefixes','tq')[_0x4f7b('0x8c')](_0x4f7b('0x8d'),'ut',_0x4f7b('0x8e'))[_0x4f7b('0x3f')](_0x4f7b('0x8f'),_0x3aaa25['params']['id']);for(var _0x324ee3=0x0;_0x324ee3<_0x136804[_0x4f7b('0x3b')];_0x324ee3+=0x1){let _0x14c427=_0x136804[_0x324ee3];for(var _0x5dd4cd=0x0;_0x5dd4cd<_0x14c427[_0x4f7b('0x7f')][_0x4f7b('0x3b')];_0x5dd4cd+=0x1){let _0x43276a=_0x14c427[_0x4f7b('0x7f')][_0x5dd4cd];var _0x58cf43=_0x3acd39[_0x4f7b('0x90')]();_0x58cf43['where'](_0x4f7b('0x91'),_0x43276a['id']);_0x3434a1[_0x4f7b('0x65')](db[_0x4f7b('0x4c')][_0x4f7b('0x36')](_0x58cf43[_0x4f7b('0x92')](),{'type':db[_0x4f7b('0x4c')][_0x4f7b('0x93')][_0x4f7b('0x94')]})[_0x4f7b('0x28')](function(_0xe6b4de){if(_0xe6b4de[_0x4f7b('0x3b')]===0x1){return _0x43276a['id'];}else{var _0x4088d7=_[_0x4f7b('0x95')](_[_0x4f7b('0x2f')](_0xe6b4de,_0x4f7b('0x96')),function(_0x8fa122){return _[_0x4f7b('0x97')](_0x13d7cd,_0x8fa122);});if(_0x4088d7){return _0x43276a['id'];}}}));}}return BPromise['all'](_0x3434a1)['then'](function(_0x50a1e5){_0x1cf812=_(_0x1cf812)[_0x4f7b('0x98')](_0x50a1e5)['compact']()[_0x4f7b('0x99')]();return db['VoicePrefix'][_0x4f7b('0x4a')]({'where':{'id':_0x3aaa25[_0x4f7b('0x48')]['id']}})[_0x4f7b('0x28')](function(_0x196911){return db['sequelize']['transaction'](function(_0x228e98){return _0x196911[_0x4f7b('0x89')](_0x3aaa25['query']['ids'],{'transaction':_0x228e98})[_0x4f7b('0x28')](function(){if(!_['isEmpty'](_0x1cf812)){return _0x196911[_0x4f7b('0x74')](_0x1cf812,{'transaction':_0x228e98});}})['then'](function(){_0x1cf812[_0x4f7b('0x88')](function(_0x3dd10a){socket[_0x4f7b('0x72')](_0x4f7b('0x76'),{'UserId':_0x3dd10a,'VoicePrefixId':_0x196911['id']});});});});});});})[_0x4f7b('0x28')](respondWithStatusCode(_0x344257,null))[_0x4f7b('0x46')](handleError(_0x344257,null));}; \ No newline at end of file +var _0xb44a=['../../components/auth/service','../../components/parsers/advancedSearch','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','localhost','register','sendStatus','status','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','then','get','VoicePrefixes','destroy','end','error','name','index','map','VoicePrefix','rawAttributes','fieldName','type','key','query','filters','intersection','model','attributes','fields','length','hasOwnProperty','order','sort','where','filter','merge','options','includeAll','include','findAll','rows','catch','show','params','keys','find','describe','create','sequelize','transaction','body','VoiceExtension','VoiceExtensionId','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','autoAssociation','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','exten','app','system','description','priority','appdata','NoOp','Voice\x20Prefix','VoicePrefixId','bulkCreate','Extensions\x20creation\x20failed','push','Set','callerIdAll','PREFIX-CALLERIDALL=','No\x20callerid\x20available','goto','context','${EXTEN:','charAt','prefix','findById','addAgents','ids','omit','emit','userVoicePrefix:save','removeAgents','isArray','userVoicePrefix:remove','findOne','User','pick','getAgents','getTeams','nolimit','addTeams','Team','Agents','online','voicePause','interface','flatMap','each','TeamVoicePrefix','upsert','UserVoicePrefix','findOrCreate','forEach','select','field','tq.TeamId','from','team_has_voice_prefixes','ut.TeamId\x20=\x20tq.TeamId','clone','ut.UserId\x20=\x20?','toString','SELECT','every','includes','all','union','removeTeams','isEmpty','zip-dir','request-promise','mustache','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse'];(function(_0x3f4cd0,_0x303070){var _0x3f9f01=function(_0x6ced93){while(--_0x6ced93){_0x3f4cd0['push'](_0x3f4cd0['shift']());}};_0x3f9f01(++_0x303070);}(_0xb44a,0x1c2));var _0xab44=function(_0x33975c,_0x50d085){_0x33975c=_0x33975c-0x0;var _0x1c15ab=_0xb44a[_0x33975c];return _0x1c15ab;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0xab44('0x0'));var jsonpatch=require('fast-json-patch');var rp=require(_0xab44('0x1'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0xab44('0x2'));var util=require('util');var path=require(_0xab44('0x3'));var sox=require(_0xab44('0x4'));var csv=require(_0xab44('0x5'));var ejs=require(_0xab44('0x6'));var fs=require('fs');var fs_extra=require(_0xab44('0x7'));var _=require(_0xab44('0x8'));var squel=require(_0xab44('0x9'));var crypto=require(_0xab44('0xa'));var jsforce=require(_0xab44('0xb'));var deskjs=require(_0xab44('0xc'));var toCsv=require(_0xab44('0x5'));var querystring=require(_0xab44('0xd'));var Papa=require(_0xab44('0xe'));var Redis=require('ioredis');var authService=require(_0xab44('0xf'));var qs=require('../../components/parsers/qs');var as=require(_0xab44('0x10'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0xab44('0x11'));var utils=require(_0xab44('0x12'));var config=require(_0xab44('0x13'));var licenseUtil=require(_0xab44('0x14'));var db=require(_0xab44('0x15'))['db'];config[_0xab44('0x16')]=_['defaults'](config['redis'],{'host':_0xab44('0x17'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xab44('0x16')]));require('./voicePrefix.socket')[_0xab44('0x18')](socket);function respondWithStatusCode(_0x15b98a,_0x344e6b){_0x344e6b=_0x344e6b||0xcc;return function(_0x384f02){if(_0x384f02){return _0x15b98a[_0xab44('0x19')](_0x344e6b);}return _0x15b98a[_0xab44('0x1a')](_0x344e6b)['end']();};}function respondWithResult(_0x51251b,_0x44c85e){_0x44c85e=_0x44c85e||0xc8;return function(_0x272a5b){if(_0x272a5b){return _0x51251b[_0xab44('0x1a')](_0x44c85e)[_0xab44('0x1b')](_0x272a5b);}};}function respondWithFilteredResult(_0xffdfbc,_0x5fd6a1){return function(_0x354b09){if(_0x354b09){var _0x44fa43=typeof _0x5fd6a1[_0xab44('0x1c')]===_0xab44('0x1d')&&typeof _0x5fd6a1[_0xab44('0x1e')]==='undefined';var _0xb779bb=_0x354b09[_0xab44('0x1f')];var _0x101a1b=_0x44fa43?0x0:_0x5fd6a1[_0xab44('0x1c')];var _0x29bb73=_0x44fa43?_0x354b09['count']:_0x5fd6a1[_0xab44('0x1c')]+_0x5fd6a1['limit'];var _0x1f7311;if(_0x29bb73>=_0xb779bb){_0x29bb73=_0xb779bb;_0x1f7311=0xc8;}else{_0x1f7311=0xce;}_0xffdfbc[_0xab44('0x1a')](_0x1f7311);return _0xffdfbc[_0xab44('0x20')](_0xab44('0x21'),_0x101a1b+'-'+_0x29bb73+'/'+_0xb779bb)['json'](_0x354b09);}return null;};}function patchUpdates(_0x3a2b1d){return function(_0x26fc03){try{jsonpatch[_0xab44('0x22')](_0x26fc03,_0x3a2b1d,!![]);}catch(_0x3b17d5){return BPromise[_0xab44('0x23')](_0x3b17d5);}return _0x26fc03[_0xab44('0x24')]();};}function saveUpdates(_0x43f1c6,_0x554955){return function(_0x595761){if(_0x595761){return _0x595761[_0xab44('0x25')](_0x43f1c6)['then'](function(_0x2439f3){return _0x2439f3;});}return null;};}function removeEntity(_0x5a7269,_0x2a1bbc){return function(_0x5ac42f){if(_0x5ac42f){return _0x5ac42f['destroy']()[_0xab44('0x26')](function(){var _0x25287b=_0x5ac42f[_0xab44('0x27')]({'plain':!![]});var _0x4620ed=_0xab44('0x28');return db['UserProfileResource'][_0xab44('0x29')]({'where':{'type':_0x4620ed,'resourceId':_0x25287b['id']}})[_0xab44('0x26')](function(){return _0x5ac42f;});})['then'](function(){_0x5a7269[_0xab44('0x1a')](0xcc)[_0xab44('0x2a')]();});}};}function handleEntityNotFound(_0x21131e,_0x1cd486){return function(_0x4550c8){if(!_0x4550c8){_0x21131e[_0xab44('0x19')](0x194);}return _0x4550c8;};}function handleError(_0x59f844,_0x22f28e){_0x22f28e=_0x22f28e||0x1f4;return function(_0x43a42d){logger[_0xab44('0x2b')](_0x43a42d['stack']);if(_0x43a42d['name']){delete _0x43a42d[_0xab44('0x2c')];}_0x59f844['status'](_0x22f28e)['send'](_0x43a42d);};}exports[_0xab44('0x2d')]=function(_0x2f8a1d,_0x160177){var _0x1e9715={},_0x1192a8={},_0x475f09={'count':0x0,'rows':[]};var _0x17e4ea=_[_0xab44('0x2e')](db[_0xab44('0x2f')][_0xab44('0x30')],function(_0x43aa7f){return{'name':_0x43aa7f[_0xab44('0x31')],'type':_0x43aa7f[_0xab44('0x32')][_0xab44('0x33')]};});_0x1192a8['model']=_['map'](_0x17e4ea,_0xab44('0x2c'));_0x1192a8[_0xab44('0x34')]=_['keys'](_0x2f8a1d[_0xab44('0x34')]);_0x1192a8[_0xab44('0x35')]=_[_0xab44('0x36')](_0x1192a8[_0xab44('0x37')],_0x1192a8[_0xab44('0x34')]);_0x1e9715[_0xab44('0x38')]=_[_0xab44('0x36')](_0x1192a8[_0xab44('0x37')],qs[_0xab44('0x39')](_0x2f8a1d[_0xab44('0x34')][_0xab44('0x39')]));_0x1e9715[_0xab44('0x38')]=_0x1e9715[_0xab44('0x38')][_0xab44('0x3a')]?_0x1e9715[_0xab44('0x38')]:_0x1192a8[_0xab44('0x37')];if(!_0x2f8a1d[_0xab44('0x34')][_0xab44('0x3b')]('nolimit')){_0x1e9715[_0xab44('0x1e')]=qs[_0xab44('0x1e')](_0x2f8a1d[_0xab44('0x34')][_0xab44('0x1e')]);_0x1e9715['offset']=qs[_0xab44('0x1c')](_0x2f8a1d[_0xab44('0x34')][_0xab44('0x1c')]);}_0x1e9715[_0xab44('0x3c')]=qs[_0xab44('0x3d')](_0x2f8a1d['query'][_0xab44('0x3d')]);_0x1e9715[_0xab44('0x3e')]=qs[_0xab44('0x35')](_['pick'](_0x2f8a1d[_0xab44('0x34')],_0x1192a8[_0xab44('0x35')]),_0x17e4ea);if(_0x2f8a1d[_0xab44('0x34')][_0xab44('0x3f')]){_0x1e9715[_0xab44('0x3e')]=_['merge'](_0x1e9715[_0xab44('0x3e')],{'$or':_['map'](_0x17e4ea,function(_0x8b55da){if(_0x8b55da['type']!=='VIRTUAL'){var _0x5aa438={};_0x5aa438[_0x8b55da['name']]={'$like':'%'+_0x2f8a1d['query'][_0xab44('0x3f')]+'%'};return _0x5aa438;}})});}_0x1e9715=_[_0xab44('0x40')]({},_0x1e9715,_0x2f8a1d[_0xab44('0x41')]);var _0x1aec00={'where':_0x1e9715[_0xab44('0x3e')]};return db[_0xab44('0x2f')][_0xab44('0x1f')](_0x1aec00)[_0xab44('0x26')](function(_0x4429e6){_0x475f09[_0xab44('0x1f')]=_0x4429e6;if(_0x2f8a1d['query'][_0xab44('0x42')]){_0x1e9715[_0xab44('0x43')]=[{'all':!![]}];}return db[_0xab44('0x2f')][_0xab44('0x44')](_0x1e9715);})['then'](function(_0x3e9a79){_0x475f09[_0xab44('0x45')]=_0x3e9a79;return _0x475f09;})[_0xab44('0x26')](respondWithFilteredResult(_0x160177,_0x1e9715))[_0xab44('0x46')](handleError(_0x160177,null));};exports[_0xab44('0x47')]=function(_0x436cd8,_0x4d4421){var _0x5bb256={'raw':![],'where':{'id':_0x436cd8[_0xab44('0x48')]['id']}},_0x2dd6f8={};_0x2dd6f8[_0xab44('0x37')]=_[_0xab44('0x49')](db[_0xab44('0x2f')]['rawAttributes']);_0x2dd6f8[_0xab44('0x34')]=_[_0xab44('0x49')](_0x436cd8[_0xab44('0x34')]);_0x2dd6f8[_0xab44('0x35')]=_['intersection'](_0x2dd6f8[_0xab44('0x37')],_0x2dd6f8[_0xab44('0x34')]);_0x5bb256[_0xab44('0x38')]=_['intersection'](_0x2dd6f8[_0xab44('0x37')],qs[_0xab44('0x39')](_0x436cd8[_0xab44('0x34')][_0xab44('0x39')]));_0x5bb256['attributes']=_0x5bb256[_0xab44('0x38')]['length']?_0x5bb256[_0xab44('0x38')]:_0x2dd6f8[_0xab44('0x37')];if(_0x436cd8[_0xab44('0x34')][_0xab44('0x42')]){_0x5bb256['include']=[{'all':!![]}];}_0x5bb256=_[_0xab44('0x40')]({},_0x5bb256,_0x436cd8['options']);return db[_0xab44('0x2f')][_0xab44('0x4a')](_0x5bb256)[_0xab44('0x26')](handleEntityNotFound(_0x4d4421,null))[_0xab44('0x26')](respondWithResult(_0x4d4421,null))[_0xab44('0x46')](handleError(_0x4d4421,null));};exports['destroy']=function(_0x4736fd,_0x53ef06){return db[_0xab44('0x2f')][_0xab44('0x4a')]({'where':{'id':_0x4736fd[_0xab44('0x48')]['id']}})['then'](handleEntityNotFound(_0x53ef06,null))[_0xab44('0x26')](removeEntity(_0x53ef06,null))[_0xab44('0x46')](handleError(_0x53ef06,null));};exports[_0xab44('0x4b')]=function(_0x160232,_0x41f946){return db['VoicePrefix']['describe']()[_0xab44('0x26')](respondWithResult(_0x41f946,null))[_0xab44('0x46')](handleError(_0x41f946,null));};exports[_0xab44('0x4c')]=function(_0x51ee03,_0x11bcd9){var _0x1bf44b;return db[_0xab44('0x4d')][_0xab44('0x4e')](function(_0x4eb2eb){return db['VoicePrefix'][_0xab44('0x4c')](_0x51ee03[_0xab44('0x4f')],{'transaction':_0x4eb2eb})[_0xab44('0x26')](function(_0x1e5731){_0x1bf44b=_0x1e5731[_0xab44('0x27')]({'plain':!![]});return db[_0xab44('0x50')][_0xab44('0x4a')]({'where':{'id':_0x1bf44b[_0xab44('0x51')]},'raw':!![]})['then'](function(_0x496e6d){return createVoicePrefixExtensions(_0x1bf44b,_0x496e6d,_0x4eb2eb);});});})[_0xab44('0x26')](function(){var _0x39bc1b=_0x51ee03[_0xab44('0x52')][_0xab44('0x27')]({'plain':!![]});if(!_0x39bc1b)throw new Error(_0xab44('0x53'));if(_0x39bc1b[_0xab44('0x54')]===_0xab44('0x52')){var _0x411bac=_0x1bf44b;return db[_0xab44('0x55')]['find']({'where':{'name':_0xab44('0x28'),'userProfileId':_0x39bc1b[_0xab44('0x56')]},'raw':!![]})[_0xab44('0x26')](function(_0xf8edd8){if(_0xf8edd8&&_0xf8edd8[_0xab44('0x57')]===0x0){return db[_0xab44('0x58')][_0xab44('0x4c')]({'name':_0x411bac[_0xab44('0x2c')],'resourceId':_0x411bac['id'],'type':_0xf8edd8['name'],'sectionId':_0xf8edd8['id']},{})['then'](function(){return _0x1bf44b;});}else{return _0x1bf44b;}})[_0xab44('0x46')](function(_0x35b4bc){logger[_0xab44('0x2b')](_0xab44('0x59'),_0x35b4bc);throw _0x35b4bc;});}return _0x1bf44b;})[_0xab44('0x26')](respondWithResult(_0x11bcd9,null))[_0xab44('0x46')](handleError(_0x11bcd9,null));};function Extension(_0x29fdb2,_0x41c4aa,_0x5b238d,_0x4d6a68){this['context']='from-sip';this[_0xab44('0x5a')]=_0x29fdb2;this[_0xab44('0x5b')]=_0x5b238d;this[_0xab44('0x32')]=_0xab44('0x5c');this[_0xab44('0x5d')]='Voice\x20Prefix\x20Extension';this[_0xab44('0x5e')]=_0x41c4aa;this[_0xab44('0x5f')]=_0x4d6a68;}function createVoicePrefixExtensions(_0x1e32d9,_0x32f92e,_0x1ef3af){return new BPromise(function(_0x255ec7,_0x205168){var _0x3a982b=new Extension(formatPrefixName(_0x1e32d9['prefix']),0x1,_0xab44('0x60'),_0xab44('0x61'));_0x3a982b[_0xab44('0x62')]=_0x1e32d9['id'];return db[_0xab44('0x50')]['create'](_0x3a982b,{'transaction':_0x1ef3af})[_0xab44('0x26')](function(_0x56401c){var _0x47ecdc=_0x56401c[_0xab44('0x27')]({'plain':!![]});var _0x5718fc=_['map'](addVoicePrefixExtensions(_0x1e32d9,_0x32f92e),function(_0x1daf6c){_0x1daf6c[_0xab44('0x51')]=_0x47ecdc['id'];_0x1daf6c[_0xab44('0x62')]=_0x1e32d9['id'];return _0x1daf6c;});return db[_0xab44('0x50')][_0xab44('0x63')](_0x5718fc,{'transaction':_0x1ef3af})['then'](function(_0x242795){if(!_0x242795){return _0x205168(_0xab44('0x64'));}else{return _0x255ec7(_0x242795);}})[_0xab44('0x46')](function(_0x3ad244){return _0x205168(_0x3ad244);});});;});};function addVoicePrefixExtensions(_0x45a9b4,_0x81b522){var _0x50558d=[];var _0x5ecf43=formatPrefixName(_0x45a9b4['prefix']);_0x50558d[_0xab44('0x65')](new Extension(_0x5ecf43,0x2,_0xab44('0x66'),'CDR(prefix)='+_0x45a9b4[_0xab44('0x2c')]));if(_0x45a9b4[_0xab44('0x67')]){_0x50558d[_0xab44('0x65')](new Extension(_0x5ecf43,0x3,_0xab44('0x66'),_0xab44('0x68')+_0x45a9b4[_0xab44('0x67')]));}else{_0x50558d[_0xab44('0x65')](new Extension(_0x5ecf43,0x3,_0xab44('0x60'),_0xab44('0x69')));}_0x50558d[_0xab44('0x65')](new Extension(_0x5ecf43,0x4,_0xab44('0x6a'),_0x81b522[_0xab44('0x6b')]+','+_0xab44('0x6c')+(0x8+_0x45a9b4[_0xab44('0x2c')][_0xab44('0x3a')])+'}'+','+0x1));return _0x50558d;}function formatPrefixName(_0x3f0eb0){var _0x445555='_';for(var _0x3c0668=0x0;_0x3c0668<_0x3f0eb0[_0xab44('0x3a')];_0x3c0668++){if(_0x3f0eb0[_0xab44('0x6d')](_0x3c0668)=='-'){_0x445555+=_0x3f0eb0[_0xab44('0x6d')](_0x3c0668);}else{_0x445555+='['+_0x3f0eb0[_0xab44('0x6d')](_0x3c0668)+']';}}_0x445555+='.';return _0x445555;}exports[_0xab44('0x25')]=function(_0x24055f,_0x315b00,_0x15dd86){var _0xd8a908=_0x24055f['body'];_0xd8a908[_0xab44('0x6e')]='system-'+_0xd8a908[_0xab44('0x2c')]+'-';return db[_0xab44('0x4d')][_0xab44('0x4e')](function(_0x169139){return db[_0xab44('0x2f')][_0xab44('0x25')](_0xd8a908,{'where':{'id':_0xd8a908['id']},'transaction':_0x169139})[_0xab44('0x26')](function(){return db[_0xab44('0x50')][_0xab44('0x29')]({'where':{'VoicePrefixId':_0xd8a908['id']},'transaction':_0x169139})[_0xab44('0x26')](function(){return db[_0xab44('0x50')]['find']({'where':{'id':_0xd8a908[_0xab44('0x51')]},'raw':!![]})[_0xab44('0x26')](function(_0x4e8352){return createVoicePrefixExtensions(_0xd8a908,_0x4e8352,_0x169139);});});});})[_0xab44('0x26')](function(){return db['VoicePrefix'][_0xab44('0x6f')](_0xd8a908['id']);})[_0xab44('0x26')](respondWithResult(_0x315b00,null))[_0xab44('0x46')](handleError(_0x315b00,null));};exports[_0xab44('0x70')]=function(_0x2f523f,_0x9115d9,_0x114499){return db['VoicePrefix'][_0xab44('0x4a')]({'where':{'id':_0x2f523f['params']['id']}})[_0xab44('0x26')](handleEntityNotFound(_0x9115d9,null))['then'](function(_0x1078ff){if(_0x1078ff){return _0x1078ff[_0xab44('0x70')](_0x2f523f[_0xab44('0x4f')][_0xab44('0x71')],_[_0xab44('0x72')](_0x2f523f[_0xab44('0x4f')],[_0xab44('0x71'),'id'])||{})['spread'](function(_0x5ab4b5){for(var _0x4baedb=0x0;_0x4baedb<_0x2f523f[_0xab44('0x4f')]['ids'][_0xab44('0x3a')];_0x4baedb+=0x1){socket[_0xab44('0x73')](_0xab44('0x74'),{'UserId':Number(_0x2f523f[_0xab44('0x4f')][_0xab44('0x71')][_0x4baedb]),'VoicePrefixId':Number(_0x2f523f['params']['id'])});}return _0x5ab4b5;});}})[_0xab44('0x26')](respondWithResult(_0x9115d9,null))[_0xab44('0x46')](handleError(_0x9115d9,null));};exports[_0xab44('0x75')]=function(_0x5387d5,_0xa7bbeb,_0x4ac1a2){return db[_0xab44('0x2f')][_0xab44('0x4a')]({'where':{'id':_0x5387d5[_0xab44('0x48')]['id']}})[_0xab44('0x26')](handleEntityNotFound(_0xa7bbeb,null))[_0xab44('0x26')](function(_0x690755){if(_0x690755){return _0x690755[_0xab44('0x75')](_0x5387d5[_0xab44('0x34')][_0xab44('0x71')])[_0xab44('0x26')](function(){if(_[_0xab44('0x76')](_0x5387d5[_0xab44('0x34')][_0xab44('0x71')])){for(var _0x491112=0x0;_0x491112<_0x5387d5['query'][_0xab44('0x71')][_0xab44('0x3a')];_0x491112+=0x1){socket['emit'](_0xab44('0x77'),{'UserId':Number(_0x5387d5[_0xab44('0x34')][_0xab44('0x71')][_0x491112]),'VoicePrefixId':Number(_0x5387d5[_0xab44('0x48')]['id'])});}}else{socket[_0xab44('0x73')]('userVoicePrefix:remove',{'UserId':Number(_0x5387d5[_0xab44('0x34')][_0xab44('0x71')]),'VoicePrefixId':Number(_0x5387d5['params']['id'])});}});}})['then'](respondWithStatusCode(_0xa7bbeb,null))['catch'](handleError(_0xa7bbeb,null));};exports['getAgents']=function(_0x3846d7,_0x13b63b,_0x630390){var _0x345c5e={};var _0x43c787={};var _0x4338dd;var _0x4fc173;return db[_0xab44('0x2f')][_0xab44('0x78')]({'where':{'id':_0x3846d7['params']['id']}})['then'](handleEntityNotFound(_0x13b63b,null))[_0xab44('0x26')](function(_0x1814ea){if(_0x1814ea){_0x4338dd=_0x1814ea;_0x43c787['model']=_[_0xab44('0x49')](db[_0xab44('0x79')][_0xab44('0x30')]);_0x43c787['query']=_[_0xab44('0x49')](_0x3846d7[_0xab44('0x34')]);_0x43c787[_0xab44('0x35')]=_[_0xab44('0x36')](_0x43c787[_0xab44('0x37')],_0x43c787[_0xab44('0x34')]);_0x345c5e[_0xab44('0x38')]=_['intersection'](_0x43c787['model'],qs[_0xab44('0x39')](_0x3846d7[_0xab44('0x34')][_0xab44('0x39')]));_0x345c5e[_0xab44('0x38')]=_0x345c5e[_0xab44('0x38')]['length']?_0x345c5e[_0xab44('0x38')]:_0x43c787[_0xab44('0x37')];_0x345c5e['order']=qs['sort'](_0x3846d7[_0xab44('0x34')][_0xab44('0x3d')]);_0x345c5e[_0xab44('0x3e')]=qs[_0xab44('0x35')](_[_0xab44('0x7a')](_0x3846d7['query'],_0x43c787[_0xab44('0x35')]));if(_0x3846d7[_0xab44('0x34')][_0xab44('0x3f')]){_0x345c5e[_0xab44('0x3e')]=_[_0xab44('0x40')](_0x345c5e['where'],{'$or':_[_0xab44('0x2e')](_0x345c5e[_0xab44('0x38')],function(_0x493533){var _0x3bee2e={};_0x3bee2e[_0x493533]={'$like':'%'+_0x3846d7[_0xab44('0x34')][_0xab44('0x3f')]+'%'};return _0x3bee2e;})});}_0x345c5e=_['merge']({},_0x345c5e,_0x3846d7[_0xab44('0x41')]);return _0x4338dd[_0xab44('0x7b')](_0x345c5e);}})[_0xab44('0x26')](function(_0x685026){if(_0x685026){_0x4fc173=_0x685026[_0xab44('0x3a')];if(!_0x3846d7[_0xab44('0x34')][_0xab44('0x3b')]('nolimit')){_0x345c5e[_0xab44('0x1e')]=qs[_0xab44('0x1e')](_0x3846d7['query'][_0xab44('0x1e')]);_0x345c5e[_0xab44('0x1c')]=qs[_0xab44('0x1c')](_0x3846d7[_0xab44('0x34')][_0xab44('0x1c')]);}return _0x4338dd[_0xab44('0x7b')](_0x345c5e);}})[_0xab44('0x26')](function(_0x40ee04){if(_0x40ee04){return _0x40ee04?{'count':_0x4fc173,'rows':_0x40ee04}:null;}})[_0xab44('0x26')](respondWithResult(_0x13b63b,null))[_0xab44('0x46')](handleError(_0x13b63b,null));};exports[_0xab44('0x7c')]=function(_0x1c96ef,_0xa5033e,_0x5e8820){var _0x41b30b={};var _0x5e93de={};var _0x476957;var _0x594482;return db[_0xab44('0x2f')][_0xab44('0x78')]({'where':{'id':_0x1c96ef[_0xab44('0x48')]['id']}})[_0xab44('0x26')](handleEntityNotFound(_0xa5033e,null))[_0xab44('0x26')](function(_0x1a25cd){if(_0x1a25cd){_0x476957=_0x1a25cd;_0x5e93de[_0xab44('0x37')]=_[_0xab44('0x49')](db['Team']['rawAttributes']);_0x5e93de['query']=_['keys'](_0x1c96ef[_0xab44('0x34')]);_0x5e93de[_0xab44('0x35')]=_[_0xab44('0x36')](_0x5e93de['model'],_0x5e93de['query']);_0x41b30b['attributes']=_['intersection'](_0x5e93de[_0xab44('0x37')],qs[_0xab44('0x39')](_0x1c96ef[_0xab44('0x34')][_0xab44('0x39')]));_0x41b30b['attributes']=_0x41b30b[_0xab44('0x38')][_0xab44('0x3a')]?_0x41b30b[_0xab44('0x38')]:_0x5e93de['model'];_0x41b30b[_0xab44('0x3c')]=qs[_0xab44('0x3d')](_0x1c96ef[_0xab44('0x34')][_0xab44('0x3d')]);_0x41b30b[_0xab44('0x3e')]=qs[_0xab44('0x35')](_['pick'](_0x1c96ef[_0xab44('0x34')],_0x5e93de[_0xab44('0x35')]));if(_0x1c96ef[_0xab44('0x34')]['filter']){_0x41b30b[_0xab44('0x3e')]=_['merge'](_0x41b30b[_0xab44('0x3e')],{'$or':_[_0xab44('0x2e')](_0x41b30b[_0xab44('0x38')],function(_0x1798c7){var _0x5e44d0={};_0x5e44d0[_0x1798c7]={'$like':'%'+_0x1c96ef[_0xab44('0x34')]['filter']+'%'};return _0x5e44d0;})});}_0x41b30b=_[_0xab44('0x40')]({},_0x41b30b,_0x1c96ef[_0xab44('0x41')]);return _0x476957[_0xab44('0x7c')](_0x41b30b);}})[_0xab44('0x26')](function(_0x41a7bc){if(_0x41a7bc){_0x594482=_0x41a7bc[_0xab44('0x3a')];if(!_0x1c96ef[_0xab44('0x34')][_0xab44('0x3b')](_0xab44('0x7d'))){_0x41b30b[_0xab44('0x1e')]=qs[_0xab44('0x1e')](_0x1c96ef['query'][_0xab44('0x1e')]);_0x41b30b[_0xab44('0x1c')]=qs[_0xab44('0x1c')](_0x1c96ef['query'][_0xab44('0x1c')]);}return _0x476957[_0xab44('0x7c')](_0x41b30b);}})[_0xab44('0x26')](function(_0x4c8a45){if(_0x4c8a45){return _0x4c8a45?{'count':_0x594482,'rows':_0x4c8a45}:null;}})[_0xab44('0x26')](respondWithResult(_0xa5033e,null))[_0xab44('0x46')](handleError(_0xa5033e,null));};exports[_0xab44('0x7e')]=function(_0x5d0a30,_0x545819,_0x2b71dc){var _0x3d56cb=_0x5d0a30['body']['ids'];var _0x1033a;return db[_0xab44('0x7f')][_0xab44('0x44')]({'where':{'id':_0x3d56cb},'attributes':['id'],'include':[{'model':db[_0xab44('0x79')],'as':_0xab44('0x80'),'attributes':['id','name',_0xab44('0x81'),_0xab44('0x82'),_0xab44('0x83')],'raw':!![]}]})[_0xab44('0x26')](function(_0x4bdb57){if(_0x4bdb57){_0x1033a=_0x4bdb57;var _0x101332=_[_0xab44('0x84')](_0x4bdb57,function(_0x5802ff){var _0x286dbf=_0x5802ff[_0xab44('0x27')]({'plain':!![]});return _0x286dbf[_0xab44('0x80')];});return db[_0xab44('0x2f')][_0xab44('0x4a')]({'where':{'id':_0x5d0a30['params']['id']}})[_0xab44('0x26')](function(_0x37bfc1){return db[_0xab44('0x4d')][_0xab44('0x4e')](function(_0x2271d4){return _0x37bfc1['addTeams'](_0x3d56cb,{'transaction':_0x2271d4})[_0xab44('0x26')](function(){return BPromise[_0xab44('0x85')](_0x1033a,function(_0x2f00b7){return db[_0xab44('0x86')][_0xab44('0x87')]({'TeamId':_0x2f00b7['id'],'VoicePrefixId':_0x5d0a30['params']['id']},{'transaction':_0x2271d4});});})[_0xab44('0x26')](function(){return BPromise['each'](_0x101332,function(_0x1aa45c){return db[_0xab44('0x88')][_0xab44('0x89')]({'where':{'UserId':_0x1aa45c['id'],'VoicePrefixId':_0x5d0a30['params']['id']},'transaction':_0x2271d4});});})['then'](function(){_0x101332[_0xab44('0x8a')](function(_0x114e4e){socket['emit'](_0xab44('0x74'),{'UserId':_0x114e4e['id'],'VoicePrefixId':_0x37bfc1['id']});});});});});}})[_0xab44('0x26')](respondWithStatusCode(_0x545819,null))[_0xab44('0x46')](handleError(_0x545819,null));};exports['removeTeams']=function(_0x528b00,_0xa0e3ff,_0x460778){return db[_0xab44('0x7f')][_0xab44('0x44')]({'where':{'id':_0x528b00['query']['ids']},'attributes':['id'],'include':[{'model':db[_0xab44('0x79')],'as':_0xab44('0x80'),'attributes':['id'],'raw':!![]}]})[_0xab44('0x26')](handleEntityNotFound(_0xa0e3ff,null))[_0xab44('0x26')](function(_0x4c299f){var _0x4e7857=_[_0xab44('0x2e')](_0x4c299f,'id');var _0x322cff=[];var _0x1525ad=[];var _0xe27f2c=squel[_0xab44('0x8b')]();_0xe27f2c[_0xab44('0x8c')](_0xab44('0x8d'))[_0xab44('0x8e')](_0xab44('0x8f'),'tq')['join']('user_has_teams','ut',_0xab44('0x90'))[_0xab44('0x3e')]('VoicePrefixId\x20=\x20?',_0x528b00[_0xab44('0x48')]['id']);for(var _0x544b82=0x0;_0x544b82<_0x4c299f[_0xab44('0x3a')];_0x544b82+=0x1){let _0x495ef4=_0x4c299f[_0x544b82];for(var _0x471790=0x0;_0x471790<_0x495ef4[_0xab44('0x80')][_0xab44('0x3a')];_0x471790+=0x1){let _0x5c77ed=_0x495ef4['Agents'][_0x471790];var _0x21fbb5=_0xe27f2c[_0xab44('0x91')]();_0x21fbb5['where'](_0xab44('0x92'),_0x5c77ed['id']);_0x1525ad['push'](db[_0xab44('0x4d')][_0xab44('0x34')](_0x21fbb5[_0xab44('0x93')](),{'type':db[_0xab44('0x4d')]['QueryTypes'][_0xab44('0x94')]})[_0xab44('0x26')](function(_0x48b47c){if(_0x48b47c[_0xab44('0x3a')]===0x1){return _0x5c77ed['id'];}else{var _0x4696f3=_[_0xab44('0x95')](_[_0xab44('0x2e')](_0x48b47c,'TeamId'),function(_0x3bbb88){return _[_0xab44('0x96')](_0x4e7857,_0x3bbb88);});if(_0x4696f3){return _0x5c77ed['id'];}}}));}}return BPromise[_0xab44('0x97')](_0x1525ad)['then'](function(_0x415556){_0x322cff=_(_0x322cff)[_0xab44('0x98')](_0x415556)['compact']()['value']();return db['VoicePrefix'][_0xab44('0x4a')]({'where':{'id':_0x528b00[_0xab44('0x48')]['id']}})[_0xab44('0x26')](function(_0x54a64f){return db['sequelize'][_0xab44('0x4e')](function(_0x1988bc){return _0x54a64f[_0xab44('0x99')](_0x528b00[_0xab44('0x34')][_0xab44('0x71')],{'transaction':_0x1988bc})[_0xab44('0x26')](function(){if(!_[_0xab44('0x9a')](_0x322cff)){return _0x54a64f[_0xab44('0x75')](_0x322cff,{'transaction':_0x1988bc});}})['then'](function(){_0x322cff['forEach'](function(_0xb093c4){socket[_0xab44('0x73')](_0xab44('0x77'),{'UserId':_0xb093c4,'VoicePrefixId':_0x54a64f['id']});});});});});});})['then'](respondWithStatusCode(_0xa0e3ff,null))[_0xab44('0x46')](handleError(_0xa0e3ff,null));}; \ No newline at end of file diff --git a/server/api/voicePrefix/voicePrefix.events.js b/server/api/voicePrefix/voicePrefix.events.js index 7cdb6f2..102c706 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 _0x945c=['remove','exports','events','../../mysqldb','setMaxListeners','update'];(function(_0x19950b,_0x53d0d7){var _0x3c6b41=function(_0x3924ad){while(--_0x3924ad){_0x19950b['push'](_0x19950b['shift']());}};_0x3c6b41(++_0x53d0d7);}(_0x945c,0x1a0));var _0xc945=function(_0x4952e1,_0x488c90){_0x4952e1=_0x4952e1-0x0;var _0x3d2a3f=_0x945c[_0x4952e1];return _0x3d2a3f;};'use strict';var EventEmitter=require(_0xc945('0x0'));var VoicePrefix=require(_0xc945('0x1'))['db']['VoicePrefix'];var VoicePrefixEvents=new EventEmitter();VoicePrefixEvents[_0xc945('0x2')](0x0);var events={'afterCreate':'save','afterUpdate':_0xc945('0x3'),'afterDestroy':_0xc945('0x4')};function emitEvent(_0x50350e){return function(_0x1958ba,_0x128d50,_0x11c6f2){VoicePrefixEvents['emit'](_0x50350e+':'+_0x1958ba['id'],_0x1958ba);VoicePrefixEvents['emit'](_0x50350e,_0x1958ba);_0x11c6f2(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];VoicePrefix['hook'](e,emitEvent(event));}}module[_0xc945('0x5')]=VoicePrefixEvents; \ No newline at end of file +var _0x7812=['emit','hook','exports','events','VoicePrefix','setMaxListeners','save','update','remove'];(function(_0x2641f9,_0x26715f){var _0x585741=function(_0x2d1462){while(--_0x2d1462){_0x2641f9['push'](_0x2641f9['shift']());}};_0x585741(++_0x26715f);}(_0x7812,0xae));var _0x2781=function(_0x3d1aa8,_0x2e15c0){_0x3d1aa8=_0x3d1aa8-0x0;var _0x5a21e1=_0x7812[_0x3d1aa8];return _0x5a21e1;};'use strict';var EventEmitter=require(_0x2781('0x0'));var VoicePrefix=require('../../mysqldb')['db'][_0x2781('0x1')];var VoicePrefixEvents=new EventEmitter();VoicePrefixEvents[_0x2781('0x2')](0x0);var events={'afterCreate':_0x2781('0x3'),'afterUpdate':_0x2781('0x4'),'afterDestroy':_0x2781('0x5')};function emitEvent(_0x3172bc){return function(_0x398743,_0x1f3bf2,_0x23fe69){VoicePrefixEvents[_0x2781('0x6')](_0x3172bc+':'+_0x398743['id'],_0x398743);VoicePrefixEvents[_0x2781('0x6')](_0x3172bc,_0x398743);_0x23fe69(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];VoicePrefix[_0x2781('0x7')](e,emitEvent(event));}}module[_0x2781('0x8')]=VoicePrefixEvents; \ No newline at end of file diff --git a/server/api/voicePrefix/voicePrefix.model.js b/server/api/voicePrefix/voicePrefix.model.js index e3e0230..84ee33b 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 _0x26ba=['bluebird','path','../../config/environment','./voicePrefix.attributes','define','VoicePrefix','voice_prefixes','lodash','util','../../config/logger','api','moment'];(function(_0x241de3,_0x433612){var _0x179db1=function(_0x323cd6){while(--_0x323cd6){_0x241de3['push'](_0x241de3['shift']());}};_0x179db1(++_0x433612);}(_0x26ba,0x193));var _0xa26b=function(_0x3217d3,_0xf66fcf){_0x3217d3=_0x3217d3-0x0;var _0x260f43=_0x26ba[_0x3217d3];return _0x260f43;};'use strict';var _=require(_0xa26b('0x0'));var util=require(_0xa26b('0x1'));var logger=require(_0xa26b('0x2'))(_0xa26b('0x3'));var moment=require(_0xa26b('0x4'));var BPromise=require(_0xa26b('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xa26b('0x6'));var rimraf=require('rimraf');var config=require(_0xa26b('0x7'));var attributes=require(_0xa26b('0x8'));module['exports']=function(_0x80370e,_0x5958b9){return _0x80370e[_0xa26b('0x9')](_0xa26b('0xa'),attributes,{'tableName':_0xa26b('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x006d=['lodash','util','api','moment','bluebird','rimraf','../../config/environment','./voicePrefix.attributes','exports','define','VoicePrefix'];(function(_0x3635ce,_0x33a6f9){var _0x97ecd0=function(_0x123d98){while(--_0x123d98){_0x3635ce['push'](_0x3635ce['shift']());}};_0x97ecd0(++_0x33a6f9);}(_0x006d,0x11e));var _0xd006=function(_0x5b19b8,_0x3953b0){_0x5b19b8=_0x5b19b8-0x0;var _0x2c1e03=_0x006d[_0x5b19b8];return _0x2c1e03;};'use strict';var _=require(_0xd006('0x0'));var util=require(_0xd006('0x1'));var logger=require('../../config/logger')(_0xd006('0x2'));var moment=require(_0xd006('0x3'));var BPromise=require(_0xd006('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0xd006('0x5'));var config=require(_0xd006('0x6'));var attributes=require(_0xd006('0x7'));module[_0xd006('0x8')]=function(_0x22aad4,_0x17ced0){return _0x22aad4[_0xd006('0x9')](_0xd006('0xa'),attributes,{'tableName':'voice_prefixes','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/voicePrefix/voicePrefix.rpc.js b/server/api/voicePrefix/voicePrefix.rpc.js index a176383..8425488 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 _0xe928=['defaults','socket.io-emitter','./voicePrefix.socket','register','request','then','VoicePrefix,\x20%s,\x20%s','request\x20sent','debug','VoicePrefix,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result','catch','lodash','util','moment','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','http','redis'];(function(_0x2d3ab3,_0x47d90b){var _0x321f9e=function(_0x50a53d){while(--_0x50a53d){_0x2d3ab3['push'](_0x2d3ab3['shift']());}};_0x321f9e(++_0x47d90b);}(_0xe928,0x145));var _0x8e92=function(_0x9875f2,_0x5df566){_0x9875f2=_0x9875f2-0x0;var _0x57c331=_0xe928[_0x9875f2];return _0x57c331;};'use strict';var _=require(_0x8e92('0x0'));var util=require(_0x8e92('0x1'));var moment=require(_0x8e92('0x2'));var BPromise=require('bluebird');var rs=require(_0x8e92('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x8e92('0x4'))['db'];var utils=require(_0x8e92('0x5'));var logger=require(_0x8e92('0x6'))(_0x8e92('0x7'));var config=require('../../config/environment');var jayson=require(_0x8e92('0x8'));var client=jayson['client'][_0x8e92('0x9')]({'port':0x232a});config[_0x8e92('0xa')]=_[_0x8e92('0xb')](config[_0x8e92('0xa')],{'host':'localhost','port':0x18eb});var socket=require(_0x8e92('0xc'))(new Redis(config['redis']));require(_0x8e92('0xd'))[_0x8e92('0xe')](socket);function respondWithRpcPromise(_0x720643,_0x3124d8,_0x45c1a4){return new BPromise(function(_0x79e446,_0x5d396b){return client[_0x8e92('0xf')](_0x720643,_0x45c1a4)[_0x8e92('0x10')](function(_0x2ad0d9){logger['info'](_0x8e92('0x11'),_0x3124d8,_0x8e92('0x12'));logger[_0x8e92('0x13')](_0x8e92('0x14'),_0x3124d8,_0x8e92('0x12'),JSON[_0x8e92('0x15')](_0x2ad0d9));if(_0x2ad0d9[_0x8e92('0x16')]){if(_0x2ad0d9['error'][_0x8e92('0x17')]===0x1f4){logger['error'](_0x8e92('0x11'),_0x3124d8,_0x2ad0d9[_0x8e92('0x16')]['message']);return _0x5d396b(_0x2ad0d9[_0x8e92('0x16')]['message']);}logger[_0x8e92('0x16')](_0x8e92('0x11'),_0x3124d8,_0x2ad0d9[_0x8e92('0x16')][_0x8e92('0x18')]);return _0x79e446(_0x2ad0d9[_0x8e92('0x16')][_0x8e92('0x18')]);}else{logger[_0x8e92('0x19')](_0x8e92('0x11'),_0x3124d8,'request\x20sent');_0x79e446(_0x2ad0d9[_0x8e92('0x1a')][_0x8e92('0x18')]);}})[_0x8e92('0x1b')](function(_0x1d476a){logger[_0x8e92('0x16')]('VoicePrefix,\x20%s,\x20%s',_0x3124d8,_0x1d476a);_0x5d396b(_0x1d476a);});});} \ No newline at end of file +var _0x2faf=['result','catch','lodash','util','moment','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','defaults','redis','localhost','socket.io-emitter','./voicePrefix.socket','request','then','info','VoicePrefix,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message'];(function(_0x1edf32,_0x1246c7){var _0x291779=function(_0x1fc985){while(--_0x1fc985){_0x1edf32['push'](_0x1edf32['shift']());}};_0x291779(++_0x1246c7);}(_0x2faf,0xb0));var _0xf2fa=function(_0x122ef9,_0x451d2a){_0x122ef9=_0x122ef9-0x0;var _0x42fba0=_0x2faf[_0x122ef9];return _0x42fba0;};'use strict';var _=require(_0xf2fa('0x0'));var util=require(_0xf2fa('0x1'));var moment=require(_0xf2fa('0x2'));var BPromise=require('bluebird');var rs=require(_0xf2fa('0x3'));var fs=require('fs');var Redis=require(_0xf2fa('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0xf2fa('0x5'));var logger=require(_0xf2fa('0x6'))(_0xf2fa('0x7'));var config=require(_0xf2fa('0x8'));var jayson=require(_0xf2fa('0x9'));var client=jayson[_0xf2fa('0xa')][_0xf2fa('0xb')]({'port':0x232a});config['redis']=_[_0xf2fa('0xc')](config[_0xf2fa('0xd')],{'host':_0xf2fa('0xe'),'port':0x18eb});var socket=require(_0xf2fa('0xf'))(new Redis(config['redis']));require(_0xf2fa('0x10'))['register'](socket);function respondWithRpcPromise(_0x310ccd,_0x481c20,_0x36bd8d){return new BPromise(function(_0x44f3e2,_0x4640a6){return client[_0xf2fa('0x11')](_0x310ccd,_0x36bd8d)[_0xf2fa('0x12')](function(_0x2c1386){logger[_0xf2fa('0x13')](_0xf2fa('0x14'),_0x481c20,_0xf2fa('0x15'));logger[_0xf2fa('0x16')]('VoicePrefix,\x20%s,\x20%s,\x20%s',_0x481c20,_0xf2fa('0x15'),JSON[_0xf2fa('0x17')](_0x2c1386));if(_0x2c1386[_0xf2fa('0x18')]){if(_0x2c1386[_0xf2fa('0x18')][_0xf2fa('0x19')]===0x1f4){logger[_0xf2fa('0x18')](_0xf2fa('0x14'),_0x481c20,_0x2c1386[_0xf2fa('0x18')]['message']);return _0x4640a6(_0x2c1386[_0xf2fa('0x18')]['message']);}logger[_0xf2fa('0x18')](_0xf2fa('0x14'),_0x481c20,_0x2c1386['error']['message']);return _0x44f3e2(_0x2c1386[_0xf2fa('0x18')][_0xf2fa('0x1a')]);}else{logger[_0xf2fa('0x13')](_0xf2fa('0x14'),_0x481c20,_0xf2fa('0x15'));_0x44f3e2(_0x2c1386[_0xf2fa('0x1b')]['message']);}})[_0xf2fa('0x1c')](function(_0x4f5baa){logger[_0xf2fa('0x18')]('VoicePrefix,\x20%s,\x20%s',_0x481c20,_0x4f5baa);_0x4640a6(_0x4f5baa);});});} \ No newline at end of file diff --git a/server/api/voicePrefix/voicePrefix.socket.js b/server/api/voicePrefix/voicePrefix.socket.js index 1c64d95..573b3d2 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 _0x1cf3=['emit','removeListener','register','length','voicePrefix:','./voicePrefix.events','save','remove','update'];(function(_0x2eb94b,_0xf3debe){var _0xb65a1c=function(_0x17f88f){while(--_0x17f88f){_0x2eb94b['push'](_0x2eb94b['shift']());}};_0xb65a1c(++_0xf3debe);}(_0x1cf3,0x1be));var _0x31cf=function(_0x2867ca,_0x344aec){_0x2867ca=_0x2867ca-0x0;var _0x4e6e3e=_0x1cf3[_0x2867ca];return _0x4e6e3e;};'use strict';var VoicePrefixEvents=require(_0x31cf('0x0'));var events=[_0x31cf('0x1'),_0x31cf('0x2'),_0x31cf('0x3')];function createListener(_0x54dff7,_0x20aa57){return function(_0x5a2ae7){_0x20aa57[_0x31cf('0x4')](_0x54dff7,_0x5a2ae7);};}function removeListener(_0x442009,_0x44d64d){return function(){VoicePrefixEvents[_0x31cf('0x5')](_0x442009,_0x44d64d);};}exports[_0x31cf('0x6')]=function(_0x44dd04){for(var _0x2b7cd4=0x0,_0x1830b4=events[_0x31cf('0x7')];_0x2b7cd4<_0x1830b4;_0x2b7cd4++){var _0x6be80=events[_0x2b7cd4];var _0x3f7b2e=createListener(_0x31cf('0x8')+_0x6be80,_0x44dd04);VoicePrefixEvents['on'](_0x6be80,_0x3f7b2e);}}; \ No newline at end of file +var _0xe0b2=['update','emit','removeListener','register','voicePrefix:','save','remove'];(function(_0x26b5ab,_0x13f2b0){var _0x76781f=function(_0x2e2979){while(--_0x2e2979){_0x26b5ab['push'](_0x26b5ab['shift']());}};_0x76781f(++_0x13f2b0);}(_0xe0b2,0xec));var _0x2e0b=function(_0x142d16,_0x16d946){_0x142d16=_0x142d16-0x0;var _0x2ed6f0=_0xe0b2[_0x142d16];return _0x2ed6f0;};'use strict';var VoicePrefixEvents=require('./voicePrefix.events');var events=[_0x2e0b('0x0'),_0x2e0b('0x1'),_0x2e0b('0x2')];function createListener(_0x1480b,_0x406b1c){return function(_0x187b65){_0x406b1c[_0x2e0b('0x3')](_0x1480b,_0x187b65);};}function removeListener(_0x56b694,_0x44e35e){return function(){VoicePrefixEvents[_0x2e0b('0x4')](_0x56b694,_0x44e35e);};}exports[_0x2e0b('0x5')]=function(_0x2a3a82){for(var _0x1b8455=0x0,_0x264319=events['length'];_0x1b8455<_0x264319;_0x1b8455++){var _0x2e1e40=events[_0x1b8455];var _0x504ea6=createListener(_0x2e0b('0x6')+_0x2e1e40,_0x2a3a82);VoicePrefixEvents['on'](_0x2e1e40,_0x504ea6);}}; \ No newline at end of file diff --git a/server/api/voiceQueue/index.js b/server/api/voiceQueue/index.js index f70d94c..be400f6 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(_0x297fd3,_0x115406){var _0x2af381=function(_0x1dd31b){while(--_0x1dd31b){_0x297fd3['push'](_0x297fd3['shift']());}};_0x2af381(++_0x115406);}(_0xb10b,0x12a));var _0xbb10=function(_0x4c5e8b,_0x11b9fa){_0x4c5e8b=_0x4c5e8b-0x0;var _0x3ca42e=_0xb10b[_0x4c5e8b];return _0x3ca42e;};'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(_0x11650b,_0x3bace5){var _0x489b22=function(_0x9c7140){while(--_0x9c7140){_0x11650b['push'](_0x11650b['shift']());}};_0x489b22(++_0x3bace5);}(_0xa9e0,0x123));var _0x0a9e=function(_0x387777,_0x356171){_0x387777=_0x387777-0x0;var _0x3f84c0=_0xa9e0[_0x387777];return _0x3f84c0;};'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 d7e64b2..fe34817 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 _0x8fe4=['booked','roundrobin','includes','INTEGER','yes','all','TEXT','periodic_announce','split','join','joinempty','leavewhenempty','BOOLEAN','acw','wrapuptime','Active/Disactive\x20Campaign','power','progressive','Dial\x20Method.','UNSIGNED','Max\x209999\x20channels,\x200\x20means\x20unlimited.','Max\x209999\x20member\x20in\x20queue(min:1,\x20max:9999),\x200\x20means\x20unlimited.','FLOAT','Power\x20Level:\x20Calls\x20for\x20agents\x20(min:1,\x20max:10).','agentBusyFactor','dropRate','Only\x20for\x20predictive\x20method.','Predictive\x20Optimization\x20Percentage\x20(min:\x201,\x20max:\x2095)','Interval\x20Predictive\x20Minutes\x20(min:5\x20max:30)','Originate\x20Timeout\x20Seconds\x20(min:1,\x20max:999)','tTxX','Queue\x20Timeout\x20Seconds\x20(min:1,\x20max:999)','AGI\x20queue\x20option\x20(use:\x20agi://127.0.0.1/square,)','#Congestion\x20Retry\x20(min:1,\x20max:999)','Congestion\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Busy\x20Retry\x20(min:1,\x20max:999)','#Global\x20Max\x20Retry\x20(min:1,\x20max:999)','onlyIfOpen','always','Active/Disactive\x20AMD','#AMD\x20Initial\x20Silence','#AMD\x20Greeting','#AMD\x20After\x20Greeting\x20Silence','#AMD\x20Total\x20Analysis\x20Time','#AMD\x20Min\x20Word\x20Length','#AMD\x20Maximum\x20Number\x20Of\x20Words','#AMD\x20Silence\x20Threshold\x20(min:0,\x20max:32767)','#AMD\x20Maximum\x20Word\x20Length','#RecallMe\x20Timeout\x20(min:1)','Active/Disactive\x20Recall\x20In\x20Queue','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)','Abandoned\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','Machine\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#AgentReject\x20Retry\x20(min:1,\x20max:999)','AgentReject\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','mandatoryDispositionPauseId','mandatoryDisposition','sequelize','exports','STRING','name','ENUM','outbound','ringall','leastrecent','fewestcalls','rrmemory','linear','wrandom','rrordered','setDataValue','strategy','getDataValue','dialMethod','preview'];(function(_0x107490,_0x63027e){var _0x3f197e=function(_0x480b53){while(--_0x480b53){_0x107490['push'](_0x107490['shift']());}};_0x3f197e(++_0x63027e);}(_0x8fe4,0xe1));var _0x48fe=function(_0x2cd090,_0x19980c){_0x2cd090=_0x2cd090-0x0;var _0x54f066=_0x8fe4[_0x2cd090];return _0x54f066;};'use strict';var Sequelize=require(_0x48fe('0x0'));module[_0x48fe('0x1')]={'name':{'type':Sequelize[_0x48fe('0x2')],'allowNull':![],'unique':_0x48fe('0x3'),'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'type':{'type':Sequelize[_0x48fe('0x4')]('inbound',_0x48fe('0x5')),'allowNull':![],'defaultValue':'inbound'},'musiconhold':{'type':Sequelize[_0x48fe('0x2')],'defaultValue':'default'},'announce':{'type':Sequelize[_0x48fe('0x2')],'defaultValue':''},'strategy':{'type':Sequelize[_0x48fe('0x4')]('rr',_0x48fe('0x6'),_0x48fe('0x7'),_0x48fe('0x8'),'random',_0x48fe('0x9'),_0x48fe('0xa'),_0x48fe('0xb'),_0x48fe('0xc')),'allowNull':![],'defaultValue':_0x48fe('0x6'),'set':function(_0x2a4402){this[_0x48fe('0xd')](_0x48fe('0xe'),_0x2a4402?_0x2a4402:_0x48fe('0x9'));},'get':function(){var _0x5b5d2d=this[_0x48fe('0xf')]('type');var _0x583dce=this[_0x48fe('0xf')](_0x48fe('0x10'));var _0x1fb90e=this[_0x48fe('0xf')]('strategy');if(_0x5b5d2d===_0x48fe('0x5')){if(_0x583dce===_0x48fe('0x11')){return null;}if(_0x583dce===_0x48fe('0x12')&&![_0x48fe('0x9'),_0x48fe('0x13')][_0x48fe('0x14')](_0x1fb90e)){this['setDataValue'](_0x48fe('0xe'),_0x48fe('0x9'));}}return _0x1fb90e;}},'servicelevel':{'type':Sequelize[_0x48fe('0x15')](0xb),'defaultValue':0x0},'context':{'type':Sequelize['STRING'],'defaultValue':null},'penaltymemberslimit':{'type':Sequelize['INTEGER'](0xb)},'timeout':{'type':Sequelize[_0x48fe('0x15')](0xb),'defaultValue':0xf},'retry':{'type':Sequelize[_0x48fe('0x15')](0xb),'defaultValue':0x2},'timeoutpriority':{'type':Sequelize['STRING']},'weight':{'type':Sequelize[_0x48fe('0x15')](0xb),'allowNull':!![],'defaultValue':0x0},'wrapuptime':{'type':Sequelize[_0x48fe('0x15')](0xb),'defaultValue':0x0},'autofill':{'type':Sequelize[_0x48fe('0x4')](_0x48fe('0x16'),'no'),'defaultValue':_0x48fe('0x16')},'autopause':{'type':Sequelize[_0x48fe('0x4')](_0x48fe('0x16'),'no',_0x48fe('0x17')),'defaultValue':'no'},'autopausedelay':{'type':Sequelize['INTEGER'](0xb)},'autopausebusy':{'type':Sequelize[_0x48fe('0x4')](_0x48fe('0x16'),'no'),'defaultValue':'no'},'autopauseunavail':{'type':Sequelize[_0x48fe('0x4')](_0x48fe('0x16'),'no'),'defaultValue':'no'},'maxlen':{'type':Sequelize[_0x48fe('0x15')](0xb),'defaultValue':0x0},'setinterfacevar':{'type':Sequelize[_0x48fe('0x4')]('yes','no'),'defaultValue':'no'},'setqueueentryvar':{'type':Sequelize[_0x48fe('0x4')](_0x48fe('0x16'),'no'),'defautValue':'no'},'setqueuevar':{'type':Sequelize[_0x48fe('0x4')](_0x48fe('0x16'),'no'),'defaultValue':'no'},'eventmemberstatus':{'type':Sequelize[_0x48fe('0x4')](_0x48fe('0x16'),'no'),'defaultValue':'no'},'membermacro':{'type':Sequelize['STRING'],'allowNull':!![]},'membergosub':{'type':Sequelize['STRING'],'allowNull':!![]},'announce_frequency':{'type':Sequelize[_0x48fe('0x15')](0xb),'defaultValue':0x0},'min_announce_frequency':{'type':Sequelize[_0x48fe('0x15')](0xb),'defaultValue':0x0},'periodic_announce_frequency':{'type':Sequelize[_0x48fe('0x15')](0xb),'defaultValue':0x0},'random_periodic_announce':{'type':Sequelize[_0x48fe('0x4')]('yes','no'),'defaultValue':'no'},'relative_periodic_announce':{'type':Sequelize[_0x48fe('0x4')]('yes','no'),'defaultValue':_0x48fe('0x16')},'announce_holdtime':{'type':Sequelize[_0x48fe('0x4')](_0x48fe('0x16'),'no','once'),'defaultValue':'no'},'announce_position':{'type':Sequelize[_0x48fe('0x2')],'defaultValue':'no'},'announce_to_first_user':{'type':Sequelize[_0x48fe('0x4')](_0x48fe('0x16'),'no')},'announce_position_limit':{'type':Sequelize[_0x48fe('0x15')](0xb)},'announce_round_seconds':{'type':Sequelize['ENUM']('0','5','10','15','20','30'),'defaultValue':'0'},'monitor_format':{'type':Sequelize['STRING'],'defaultValue':''},'monitor_type':{'type':Sequelize['STRING']},'queue_youarenext':{'type':Sequelize['STRING'],'defaultValue':null},'queue_thereare':{'type':Sequelize[_0x48fe('0x2')],'defaultValue':null},'queue_callswaiting':{'type':Sequelize[_0x48fe('0x2')],'defaultValue':null},'queue_holdtime':{'type':Sequelize[_0x48fe('0x2')],'defaultValue':null},'queue_minute':{'type':Sequelize[_0x48fe('0x2')],'allowNull':!![],'defaultValue':null},'queue_minutes':{'type':Sequelize[_0x48fe('0x2')],'defaultValue':null},'queue_seconds':{'type':Sequelize[_0x48fe('0x2')],'defaultValue':null},'queue_thankyou':{'type':Sequelize[_0x48fe('0x2')],'defaultValue':null},'queue_reporthold':{'type':Sequelize['STRING']},'queue_quantity1':{'type':Sequelize[_0x48fe('0x2')]},'queue_quantity2':{'type':Sequelize['STRING']},'queue_periodic_announce':{'type':Sequelize[_0x48fe('0x2')]},'queue_less_than':{'type':Sequelize['STRING']},'periodic_announce':{'type':Sequelize[_0x48fe('0x18')],'set':function(_0x28d178){this[_0x48fe('0xd')](_0x48fe('0x19'),_0x28d178?_0x28d178['join'](','):[]);},'get':function(){return this[_0x48fe('0xf')](_0x48fe('0x19'))?this[_0x48fe('0xf')](_0x48fe('0x19'))[_0x48fe('0x1a')](','):[];}},'joinempty':{'type':Sequelize['STRING'],'defaultValue':'yes','set':function(_0x7ec781){this[_0x48fe('0xd')]('joinempty',_0x7ec781?_0x7ec781[_0x48fe('0x1b')](','):undefined);},'get':function(){return this[_0x48fe('0xf')](_0x48fe('0x1c'))?this['getDataValue'](_0x48fe('0x1c'))['split'](','):undefined;}},'leavewhenempty':{'type':Sequelize[_0x48fe('0x2')],'defaultValue':'no','set':function(_0x42b994){this[_0x48fe('0xd')]('leavewhenempty',_0x42b994?_0x42b994['join'](','):undefined);},'get':function(){return this[_0x48fe('0xf')](_0x48fe('0x1d'))?this['getDataValue'](_0x48fe('0x1d'))[_0x48fe('0x1a')](','):undefined;}},'reportholdtime':{'type':Sequelize['ENUM'](_0x48fe('0x16'),'no'),'defaultValue':'no'},'ringinuse':{'type':Sequelize[_0x48fe('0x4')](_0x48fe('0x16'),'no'),'defaultValue':'no'},'memberdelay':{'type':Sequelize[_0x48fe('0x15')](0xb),'defaultValue':0x0},'timeoutrestart':{'type':Sequelize['ENUM']('yes','no'),'defaultValue':'no'},'defaultrule':{'type':Sequelize[_0x48fe('0x2')]},'description':{'type':Sequelize[_0x48fe('0x2')]},'acw':{'type':Sequelize[_0x48fe('0x1e')],'defaultValue':0x0,'set':function(_0xc0d90e){this[_0x48fe('0xd')](_0x48fe('0x1f'),_0xc0d90e);if(_0xc0d90e){if(this[_0x48fe('0xf')]('wrapuptime')<0x2){this[_0x48fe('0xd')](_0x48fe('0x20'),0x2);}}}},'acwTimeout':{'type':Sequelize['INTEGER'](0xb),'defaultValue':0xa},'dialActive':{'type':Sequelize[_0x48fe('0x1e')],'defaultValue':0x0,'comment':_0x48fe('0x21')},'dialMethod':{'type':Sequelize[_0x48fe('0x4')](_0x48fe('0x11'),'progressive',_0x48fe('0x22'),'predictive','booked'),'defaultValue':_0x48fe('0x23'),'comment':_0x48fe('0x24')},'dialLimitChannel':{'type':Sequelize[_0x48fe('0x15')](0x4)[_0x48fe('0x25')],'defaultValue':0x0,'validate':{'min':0x0,'max':0x270f},'comment':_0x48fe('0x26')},'dialLimitQueue':{'type':Sequelize[_0x48fe('0x15')](0x4)[_0x48fe('0x25')],'defaultValue':0x0,'validate':{'min':0x0,'max':0x270f},'comment':_0x48fe('0x27')},'dialPowerLevel':{'type':Sequelize[_0x48fe('0x28')](0x2)['UNSIGNED'],'defaultValue':0x1,'validate':{'min':0x1,'max':0xa},'comment':_0x48fe('0x29')},'dialPredictiveOptimization':{'type':Sequelize[_0x48fe('0x4')](_0x48fe('0x2a'),_0x48fe('0x2b')),'defaultValue':_0x48fe('0x2b'),'comment':_0x48fe('0x2c')},'dialPredictiveOptimizationPercentage':{'type':Sequelize[_0x48fe('0x28')](0x2)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x1,'max':0x5f},'comment':_0x48fe('0x2d')},'dialPredictiveInterval':{'type':Sequelize[_0x48fe('0x15')](0x3)[_0x48fe('0x25')],'defaultValue':0xa,'validate':{'min':0x5,'max':0x1e},'comment':_0x48fe('0x2e')},'dialOriginateCallerIdName':{'type':Sequelize[_0x48fe('0x2')]},'dialOriginateCallerIdNumber':{'type':Sequelize[_0x48fe('0x2')]},'dialOriginateTimeout':{'type':Sequelize[_0x48fe('0x15')](0x3)['UNSIGNED'],'defaultValue':0x1e,'validate':{'min':0x1,'max':0x3e7},'comment':_0x48fe('0x2f')},'dialQueueOptions':{'type':Sequelize[_0x48fe('0x2')],'defaultValue':_0x48fe('0x30'),'comment':'https://wiki.asterisk.org/wiki/display/AST/Asterisk+13+Application_Queue'},'dialQueueTimeout':{'type':Sequelize[_0x48fe('0x15')](0x3)[_0x48fe('0x25')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x48fe('0x31')},'dialQueueProject':{'type':Sequelize['STRING'],'comment':_0x48fe('0x32')},'dialCongestionMaxRetry':{'type':Sequelize[_0x48fe('0x15')](0x3)[_0x48fe('0x25')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x48fe('0x33')},'dialCongestionRetryFrequency':{'type':Sequelize[_0x48fe('0x15')](0x5)[_0x48fe('0x25')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x48fe('0x34')},'dialBusyMaxRetry':{'type':Sequelize[_0x48fe('0x15')](0x3)[_0x48fe('0x25')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x48fe('0x35')},'dialBusyRetryFrequency':{'type':Sequelize[_0x48fe('0x15')](0x5)[_0x48fe('0x25')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':'Busy\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'},'dialNoAnswerMaxRetry':{'type':Sequelize[_0x48fe('0x15')](0x3)[_0x48fe('0x25')],'defaultValue':0x3,'comment':'#NoAnswer\x20Retry\x20(min:1,\x20max:999)'},'dialNoAnswerRetryFrequency':{'type':Sequelize[_0x48fe('0x15')](0x5)[_0x48fe('0x25')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':'NoAnswer\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'},'dialGlobalMaxRetry':{'type':Sequelize[_0x48fe('0x15')](0x3)['UNSIGNED'],'validate':{'min':0x1,'max':0x3e7},'defaultValue':0x4,'comment':_0x48fe('0x36')},'dialTimezone':{'type':Sequelize[_0x48fe('0x2')],'defaultValue':null},'dialGlobalInterval':{'type':Sequelize['STRING'],'defaultValue':'07:00-22:00,*,*,*'},'dialPrefix':{'type':Sequelize[_0x48fe('0x2')],'defaultValue':null},'dialCheckDuplicateType':{'type':Sequelize[_0x48fe('0x4')]('always','never',_0x48fe('0x37')),'defaultValue':_0x48fe('0x38')},'dialAMDActive':{'type':Sequelize[_0x48fe('0x1e')],'defaultValue':0x0,'comment':_0x48fe('0x39')},'dialAMDInitialSilence':{'type':Sequelize['INTEGER'](0x9)['UNSIGNED'],'defaultValue':0x9c4,'validate':{'min':0x0},'comment':_0x48fe('0x3a')},'dialAMDGreeting':{'type':Sequelize[_0x48fe('0x15')](0x9)[_0x48fe('0x25')],'defaultValue':0x5dc,'validate':{'min':0x0},'comment':_0x48fe('0x3b')},'dialAMDAfterGreetingSilence':{'type':Sequelize[_0x48fe('0x15')](0x9)['UNSIGNED'],'defaultValue':0x320,'validate':{'min':0x0},'comment':_0x48fe('0x3c')},'dialAMDTotalAnalysisTime':{'type':Sequelize[_0x48fe('0x15')](0x9)[_0x48fe('0x25')],'defaultValue':0x1388,'validate':{'min':0x0},'comment':_0x48fe('0x3d')},'dialAMDMinWordLength':{'type':Sequelize[_0x48fe('0x15')](0x9)[_0x48fe('0x25')],'defaultValue':0x64,'validate':{'min':0x0},'comment':_0x48fe('0x3e')},'dialAMDBetweenWordsSilence':{'type':Sequelize[_0x48fe('0x15')](0x9)[_0x48fe('0x25')],'defaultValue':0x32,'validate':{'min':0x0},'comment':'#AMD\x20Between\x20Words\x20Silence'},'dialAMDMaximumNumberOfWords':{'type':Sequelize[_0x48fe('0x15')](0x9)[_0x48fe('0x25')],'defaultValue':0x3,'validate':{'min':0x0},'comment':_0x48fe('0x3f')},'dialAMDSilenceThreshold':{'type':Sequelize[_0x48fe('0x15')](0x5)[_0x48fe('0x25')],'validate':{'min':0x0,'max':0x7fff},'defaultValue':0x100,'comment':_0x48fe('0x40')},'dialAMDMaximumWordLength':{'type':Sequelize[_0x48fe('0x15')](0x9)[_0x48fe('0x25')],'defaultValue':0x1388,'validate':{'min':0x0},'comment':_0x48fe('0x41')},'dialRecallMeTimeout':{'type':Sequelize[_0x48fe('0x15')](0x5)[_0x48fe('0x25')],'validate':{'min':0x1},'defaultValue':0x1e,'comment':_0x48fe('0x42')},'dialRecallInQueue':{'type':Sequelize['BOOLEAN'],'defaultValue':0x0,'comment':_0x48fe('0x43')},'dialOrderByScheduledAt':{'type':Sequelize[_0x48fe('0x4')]('DESC','ASC'),'defaultValue':'DESC'},'dialQueueProject2':{'type':Sequelize['STRING'],'comment':_0x48fe('0x32')},'dialAgiAfterHangupClient':{'type':Sequelize[_0x48fe('0x1e')],'defaultValue':![]},'dialAgiAfterHangupAgent':{'type':Sequelize[_0x48fe('0x1e')],'defaultValue':![]},'dialRandomLastDigitCallerIdNumber':{'type':Sequelize[_0x48fe('0x15')](0x3)[_0x48fe('0x25')],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':_0x48fe('0x44')},'dialCutDigit':{'type':Sequelize[_0x48fe('0x15')](0x3)[_0x48fe('0x25')],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':_0x48fe('0x45')},'dialNoSuchNumberMaxRetry':{'type':Sequelize['INTEGER'](0x3)[_0x48fe('0x25')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x48fe('0x46')},'dialNoSuchNumberRetryFrequency':{'type':Sequelize[_0x48fe('0x15')](0x5)[_0x48fe('0x25')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x48fe('0x47')},'dialDropMaxRetry':{'type':Sequelize[_0x48fe('0x15')](0x3)[_0x48fe('0x25')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x48fe('0x48')},'dialDropRetryFrequency':{'type':Sequelize[_0x48fe('0x15')](0x5)[_0x48fe('0x25')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x48fe('0x49')},'dialAbandonedMaxRetry':{'type':Sequelize[_0x48fe('0x15')](0x3)[_0x48fe('0x25')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':'#Abandoned\x20Retry\x20(min:1,\x20max:999)'},'dialAbandonedRetryFrequency':{'type':Sequelize[_0x48fe('0x15')](0x5)[_0x48fe('0x25')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x48fe('0x4a')},'dialMachineMaxRetry':{'type':Sequelize[_0x48fe('0x15')](0x3)[_0x48fe('0x25')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':'#Machine\x20Retry\x20(min:1,\x20max:999)'},'dialMachineRetryFrequency':{'type':Sequelize[_0x48fe('0x15')](0x5)[_0x48fe('0x25')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x48fe('0x4b')},'dialAgentRejectMaxRetry':{'type':Sequelize[_0x48fe('0x15')](0x3)[_0x48fe('0x25')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x48fe('0x4c')},'dialAgentRejectRetryFrequency':{'type':Sequelize[_0x48fe('0x15')](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x48fe('0x4d')},'mandatoryDispositionPauseId':{'type':Sequelize['INTEGER'],'allowNull':!![],'comment':'Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled'},'mandatoryDisposition':{'type':Sequelize[_0x48fe('0x1e')],'defaultValue':![],'comment':_0x48fe('0x4e'),'set':function(_0x19de0d){if(!_0x19de0d)this[_0x48fe('0xd')](_0x48fe('0x4f'),null);this['setDataValue'](_0x48fe('0x50'),_0x19de0d);}},'dialPredictiveIntervalMaxThreshold':{'type':Sequelize[_0x48fe('0x15')](0x3)[_0x48fe('0x25')],'defaultValue':0x14,'validate':{'min':0x1,'max':0x64}},'dialPredictiveIntervalMinThreshold':{'type':Sequelize[_0x48fe('0x15')](0x3)['UNSIGNED'],'defaultValue':0xa,'validate':{'min':0x1,'max':0x64}},'dialPreviewAutoRecallMe':{'type':Sequelize[_0x48fe('0x1e')],'defaultValue':!![]},'callAdditionalPhoneAfterMin':{'type':Sequelize[_0x48fe('0x15')](0x3)[_0x48fe('0x25')],'defaultValue':0x4},'dialPreviewRecallmeReminder':{'type':Sequelize['BOOLEAN'],'defaultValue':![]}}; \ No newline at end of file +var _0x95b3=['random','rrmemory','linear','wrandom','strategy','getDataValue','type','dialMethod','preview','booked','roundrobin','setDataValue','INTEGER','yes','all','TEXT','periodic_announce','joinempty','join','leavewhenempty','split','BOOLEAN','wrapuptime','Active/Disactive\x20Campaign','progressive','power','predictive','Dial\x20Method.','Max\x209999\x20channels,\x200\x20means\x20unlimited.','FLOAT','UNSIGNED','Power\x20Level:\x20Calls\x20for\x20agents\x20(min:1,\x20max:10).','dropRate','Only\x20for\x20predictive\x20method.','Predictive\x20Optimization\x20Percentage\x20(min:\x201,\x20max:\x2095)','Interval\x20Predictive\x20Minutes\x20(min:5\x20max:30)','Originate\x20Timeout\x20Seconds\x20(min:1,\x20max:999)','https://wiki.asterisk.org/wiki/display/AST/Asterisk+13+Application_Queue','Queue\x20Timeout\x20Seconds\x20(min:1,\x20max:999)','AGI\x20queue\x20option\x20(use:\x20agi://127.0.0.1/square,)','#Congestion\x20Retry\x20(min:1,\x20max:999)','Congestion\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Busy\x20Retry\x20(min:1,\x20max:999)','Busy\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#NoAnswer\x20Retry\x20(min:1,\x20max:999)','NoAnswer\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','07:00-22:00,*,*,*','always','never','onlyIfOpen','Active/Disactive\x20AMD','#AMD\x20Initial\x20Silence','#AMD\x20Greeting','#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)','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)','Abandoned\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Machine\x20Retry\x20(min:1,\x20max:999)','Machine\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#AgentReject\x20Retry\x20(min:1,\x20max:999)','AgentReject\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled','Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','mandatoryDispositionPauseId','mandatoryDisposition','sequelize','exports','STRING','name','ENUM','inbound','outbound','default','ringall','leastrecent'];(function(_0x35c0f9,_0x435ef0){var _0x24ac27=function(_0x221b2a){while(--_0x221b2a){_0x35c0f9['push'](_0x35c0f9['shift']());}};_0x24ac27(++_0x435ef0);}(_0x95b3,0xa0));var _0x395b=function(_0x557173,_0x1b1229){_0x557173=_0x557173-0x0;var _0x4de626=_0x95b3[_0x557173];return _0x4de626;};'use strict';var Sequelize=require(_0x395b('0x0'));module[_0x395b('0x1')]={'name':{'type':Sequelize[_0x395b('0x2')],'allowNull':![],'unique':_0x395b('0x3'),'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'type':{'type':Sequelize[_0x395b('0x4')](_0x395b('0x5'),_0x395b('0x6')),'allowNull':![],'defaultValue':_0x395b('0x5')},'musiconhold':{'type':Sequelize[_0x395b('0x2')],'defaultValue':_0x395b('0x7')},'announce':{'type':Sequelize[_0x395b('0x2')],'defaultValue':''},'strategy':{'type':Sequelize[_0x395b('0x4')]('rr',_0x395b('0x8'),_0x395b('0x9'),'fewestcalls',_0x395b('0xa'),_0x395b('0xb'),_0x395b('0xc'),_0x395b('0xd'),'rrordered'),'allowNull':![],'defaultValue':'ringall','set':function(_0x34bbd0){this['setDataValue'](_0x395b('0xe'),_0x34bbd0?_0x34bbd0:'rrmemory');},'get':function(){var _0x5e8fd3=this[_0x395b('0xf')](_0x395b('0x10'));var _0xcf1b70=this['getDataValue'](_0x395b('0x11'));var _0x2d8a07=this[_0x395b('0xf')](_0x395b('0xe'));if(_0x5e8fd3===_0x395b('0x6')){if(_0xcf1b70===_0x395b('0x12')){return null;}if(_0xcf1b70===_0x395b('0x13')&&![_0x395b('0xb'),_0x395b('0x14')]['includes'](_0x2d8a07)){this[_0x395b('0x15')](_0x395b('0xe'),_0x395b('0xb'));}}return _0x2d8a07;}},'servicelevel':{'type':Sequelize[_0x395b('0x16')](0xb),'defaultValue':0x0},'context':{'type':Sequelize[_0x395b('0x2')],'defaultValue':null},'penaltymemberslimit':{'type':Sequelize[_0x395b('0x16')](0xb)},'timeout':{'type':Sequelize['INTEGER'](0xb),'defaultValue':0xf},'retry':{'type':Sequelize[_0x395b('0x16')](0xb),'defaultValue':0x2},'timeoutpriority':{'type':Sequelize[_0x395b('0x2')]},'weight':{'type':Sequelize[_0x395b('0x16')](0xb),'allowNull':!![],'defaultValue':0x0},'wrapuptime':{'type':Sequelize[_0x395b('0x16')](0xb),'defaultValue':0x0},'autofill':{'type':Sequelize[_0x395b('0x4')](_0x395b('0x17'),'no'),'defaultValue':'yes'},'autopause':{'type':Sequelize[_0x395b('0x4')](_0x395b('0x17'),'no',_0x395b('0x18')),'defaultValue':'no'},'autopausedelay':{'type':Sequelize[_0x395b('0x16')](0xb)},'autopausebusy':{'type':Sequelize[_0x395b('0x4')](_0x395b('0x17'),'no'),'defaultValue':'no'},'autopauseunavail':{'type':Sequelize['ENUM'](_0x395b('0x17'),'no'),'defaultValue':'no'},'maxlen':{'type':Sequelize[_0x395b('0x16')](0xb),'defaultValue':0x0},'setinterfacevar':{'type':Sequelize['ENUM'](_0x395b('0x17'),'no'),'defaultValue':'no'},'setqueueentryvar':{'type':Sequelize[_0x395b('0x4')]('yes','no'),'defautValue':'no'},'setqueuevar':{'type':Sequelize[_0x395b('0x4')]('yes','no'),'defaultValue':'no'},'eventmemberstatus':{'type':Sequelize[_0x395b('0x4')](_0x395b('0x17'),'no'),'defaultValue':'no'},'membermacro':{'type':Sequelize[_0x395b('0x2')],'allowNull':!![]},'membergosub':{'type':Sequelize[_0x395b('0x2')],'allowNull':!![]},'announce_frequency':{'type':Sequelize[_0x395b('0x16')](0xb),'defaultValue':0x0},'min_announce_frequency':{'type':Sequelize['INTEGER'](0xb),'defaultValue':0x0},'periodic_announce_frequency':{'type':Sequelize[_0x395b('0x16')](0xb),'defaultValue':0x0},'random_periodic_announce':{'type':Sequelize[_0x395b('0x4')]('yes','no'),'defaultValue':'no'},'relative_periodic_announce':{'type':Sequelize[_0x395b('0x4')]('yes','no'),'defaultValue':_0x395b('0x17')},'announce_holdtime':{'type':Sequelize[_0x395b('0x4')](_0x395b('0x17'),'no','once'),'defaultValue':'no'},'announce_position':{'type':Sequelize[_0x395b('0x2')],'defaultValue':'no'},'announce_to_first_user':{'type':Sequelize['ENUM'](_0x395b('0x17'),'no')},'announce_position_limit':{'type':Sequelize['INTEGER'](0xb)},'announce_round_seconds':{'type':Sequelize[_0x395b('0x4')]('0','5','10','15','20','30'),'defaultValue':'0'},'monitor_format':{'type':Sequelize[_0x395b('0x2')],'defaultValue':''},'monitor_type':{'type':Sequelize[_0x395b('0x2')]},'queue_youarenext':{'type':Sequelize[_0x395b('0x2')],'defaultValue':null},'queue_thereare':{'type':Sequelize[_0x395b('0x2')],'defaultValue':null},'queue_callswaiting':{'type':Sequelize[_0x395b('0x2')],'defaultValue':null},'queue_holdtime':{'type':Sequelize[_0x395b('0x2')],'defaultValue':null},'queue_minute':{'type':Sequelize[_0x395b('0x2')],'allowNull':!![],'defaultValue':null},'queue_minutes':{'type':Sequelize[_0x395b('0x2')],'defaultValue':null},'queue_seconds':{'type':Sequelize[_0x395b('0x2')],'defaultValue':null},'queue_thankyou':{'type':Sequelize[_0x395b('0x2')],'defaultValue':null},'queue_reporthold':{'type':Sequelize[_0x395b('0x2')]},'queue_quantity1':{'type':Sequelize['STRING']},'queue_quantity2':{'type':Sequelize[_0x395b('0x2')]},'queue_periodic_announce':{'type':Sequelize[_0x395b('0x2')]},'queue_less_than':{'type':Sequelize[_0x395b('0x2')]},'periodic_announce':{'type':Sequelize[_0x395b('0x19')],'set':function(_0x31f51b){this[_0x395b('0x15')]('periodic_announce',_0x31f51b?_0x31f51b['join'](','):[]);},'get':function(){return this[_0x395b('0xf')](_0x395b('0x1a'))?this[_0x395b('0xf')](_0x395b('0x1a'))['split'](','):[];}},'joinempty':{'type':Sequelize[_0x395b('0x2')],'defaultValue':_0x395b('0x17'),'set':function(_0x1ecd5c){this['setDataValue'](_0x395b('0x1b'),_0x1ecd5c?_0x1ecd5c[_0x395b('0x1c')](','):undefined);},'get':function(){return this['getDataValue'](_0x395b('0x1b'))?this[_0x395b('0xf')](_0x395b('0x1b'))['split'](','):undefined;}},'leavewhenempty':{'type':Sequelize[_0x395b('0x2')],'defaultValue':'no','set':function(_0x25e4e6){this[_0x395b('0x15')](_0x395b('0x1d'),_0x25e4e6?_0x25e4e6['join'](','):undefined);},'get':function(){return this['getDataValue'](_0x395b('0x1d'))?this[_0x395b('0xf')](_0x395b('0x1d'))[_0x395b('0x1e')](','):undefined;}},'reportholdtime':{'type':Sequelize[_0x395b('0x4')]('yes','no'),'defaultValue':'no'},'ringinuse':{'type':Sequelize[_0x395b('0x4')](_0x395b('0x17'),'no'),'defaultValue':'no'},'memberdelay':{'type':Sequelize[_0x395b('0x16')](0xb),'defaultValue':0x0},'timeoutrestart':{'type':Sequelize[_0x395b('0x4')](_0x395b('0x17'),'no'),'defaultValue':'no'},'defaultrule':{'type':Sequelize[_0x395b('0x2')]},'description':{'type':Sequelize[_0x395b('0x2')]},'acw':{'type':Sequelize[_0x395b('0x1f')],'defaultValue':0x0,'set':function(_0x3dc111){this[_0x395b('0x15')]('acw',_0x3dc111);if(_0x3dc111){if(this[_0x395b('0xf')](_0x395b('0x20'))<0x2){this[_0x395b('0x15')](_0x395b('0x20'),0x2);}}}},'acwTimeout':{'type':Sequelize[_0x395b('0x16')](0xb),'defaultValue':0xa},'dialActive':{'type':Sequelize[_0x395b('0x1f')],'defaultValue':0x0,'comment':_0x395b('0x21')},'dialMethod':{'type':Sequelize[_0x395b('0x4')](_0x395b('0x12'),_0x395b('0x22'),_0x395b('0x23'),_0x395b('0x24'),_0x395b('0x13')),'defaultValue':_0x395b('0x22'),'comment':_0x395b('0x25')},'dialLimitChannel':{'type':Sequelize['INTEGER'](0x4)['UNSIGNED'],'defaultValue':0x0,'validate':{'min':0x0,'max':0x270f},'comment':_0x395b('0x26')},'dialLimitQueue':{'type':Sequelize['INTEGER'](0x4)['UNSIGNED'],'defaultValue':0x0,'validate':{'min':0x0,'max':0x270f},'comment':'Max\x209999\x20member\x20in\x20queue(min:1,\x20max:9999),\x200\x20means\x20unlimited.'},'dialPowerLevel':{'type':Sequelize[_0x395b('0x27')](0x2)[_0x395b('0x28')],'defaultValue':0x1,'validate':{'min':0x1,'max':0xa},'comment':_0x395b('0x29')},'dialPredictiveOptimization':{'type':Sequelize[_0x395b('0x4')]('agentBusyFactor',_0x395b('0x2a')),'defaultValue':_0x395b('0x2a'),'comment':_0x395b('0x2b')},'dialPredictiveOptimizationPercentage':{'type':Sequelize[_0x395b('0x27')](0x2)[_0x395b('0x28')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x5f},'comment':_0x395b('0x2c')},'dialPredictiveInterval':{'type':Sequelize['INTEGER'](0x3)['UNSIGNED'],'defaultValue':0xa,'validate':{'min':0x5,'max':0x1e},'comment':_0x395b('0x2d')},'dialOriginateCallerIdName':{'type':Sequelize[_0x395b('0x2')]},'dialOriginateCallerIdNumber':{'type':Sequelize[_0x395b('0x2')]},'dialOriginateTimeout':{'type':Sequelize[_0x395b('0x16')](0x3)[_0x395b('0x28')],'defaultValue':0x1e,'validate':{'min':0x1,'max':0x3e7},'comment':_0x395b('0x2e')},'dialQueueOptions':{'type':Sequelize[_0x395b('0x2')],'defaultValue':'tTxX','comment':_0x395b('0x2f')},'dialQueueTimeout':{'type':Sequelize['INTEGER'](0x3)[_0x395b('0x28')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x395b('0x30')},'dialQueueProject':{'type':Sequelize[_0x395b('0x2')],'comment':_0x395b('0x31')},'dialCongestionMaxRetry':{'type':Sequelize[_0x395b('0x16')](0x3)[_0x395b('0x28')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x395b('0x32')},'dialCongestionRetryFrequency':{'type':Sequelize['INTEGER'](0x5)[_0x395b('0x28')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x395b('0x33')},'dialBusyMaxRetry':{'type':Sequelize[_0x395b('0x16')](0x3)[_0x395b('0x28')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x395b('0x34')},'dialBusyRetryFrequency':{'type':Sequelize[_0x395b('0x16')](0x5)[_0x395b('0x28')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x395b('0x35')},'dialNoAnswerMaxRetry':{'type':Sequelize[_0x395b('0x16')](0x3)['UNSIGNED'],'defaultValue':0x3,'comment':_0x395b('0x36')},'dialNoAnswerRetryFrequency':{'type':Sequelize[_0x395b('0x16')](0x5)[_0x395b('0x28')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x395b('0x37')},'dialGlobalMaxRetry':{'type':Sequelize['INTEGER'](0x3)[_0x395b('0x28')],'validate':{'min':0x1,'max':0x3e7},'defaultValue':0x4,'comment':'#Global\x20Max\x20Retry\x20(min:1,\x20max:999)'},'dialTimezone':{'type':Sequelize[_0x395b('0x2')],'defaultValue':null},'dialGlobalInterval':{'type':Sequelize[_0x395b('0x2')],'defaultValue':_0x395b('0x38')},'dialPrefix':{'type':Sequelize[_0x395b('0x2')],'defaultValue':null},'dialCheckDuplicateType':{'type':Sequelize[_0x395b('0x4')](_0x395b('0x39'),_0x395b('0x3a'),_0x395b('0x3b')),'defaultValue':_0x395b('0x39')},'dialAMDActive':{'type':Sequelize[_0x395b('0x1f')],'defaultValue':0x0,'comment':_0x395b('0x3c')},'dialAMDInitialSilence':{'type':Sequelize[_0x395b('0x16')](0x9)['UNSIGNED'],'defaultValue':0x9c4,'validate':{'min':0x0},'comment':_0x395b('0x3d')},'dialAMDGreeting':{'type':Sequelize[_0x395b('0x16')](0x9)[_0x395b('0x28')],'defaultValue':0x5dc,'validate':{'min':0x0},'comment':_0x395b('0x3e')},'dialAMDAfterGreetingSilence':{'type':Sequelize[_0x395b('0x16')](0x9)['UNSIGNED'],'defaultValue':0x320,'validate':{'min':0x0},'comment':'#AMD\x20After\x20Greeting\x20Silence'},'dialAMDTotalAnalysisTime':{'type':Sequelize['INTEGER'](0x9)[_0x395b('0x28')],'defaultValue':0x1388,'validate':{'min':0x0},'comment':'#AMD\x20Total\x20Analysis\x20Time'},'dialAMDMinWordLength':{'type':Sequelize[_0x395b('0x16')](0x9)['UNSIGNED'],'defaultValue':0x64,'validate':{'min':0x0},'comment':_0x395b('0x3f')},'dialAMDBetweenWordsSilence':{'type':Sequelize[_0x395b('0x16')](0x9)['UNSIGNED'],'defaultValue':0x32,'validate':{'min':0x0},'comment':_0x395b('0x40')},'dialAMDMaximumNumberOfWords':{'type':Sequelize[_0x395b('0x16')](0x9)[_0x395b('0x28')],'defaultValue':0x3,'validate':{'min':0x0},'comment':'#AMD\x20Maximum\x20Number\x20Of\x20Words'},'dialAMDSilenceThreshold':{'type':Sequelize['INTEGER'](0x5)['UNSIGNED'],'validate':{'min':0x0,'max':0x7fff},'defaultValue':0x100,'comment':_0x395b('0x41')},'dialAMDMaximumWordLength':{'type':Sequelize[_0x395b('0x16')](0x9)[_0x395b('0x28')],'defaultValue':0x1388,'validate':{'min':0x0},'comment':_0x395b('0x42')},'dialRecallMeTimeout':{'type':Sequelize[_0x395b('0x16')](0x5)['UNSIGNED'],'validate':{'min':0x1},'defaultValue':0x1e,'comment':_0x395b('0x43')},'dialRecallInQueue':{'type':Sequelize[_0x395b('0x1f')],'defaultValue':0x0,'comment':'Active/Disactive\x20Recall\x20In\x20Queue'},'dialOrderByScheduledAt':{'type':Sequelize[_0x395b('0x4')](_0x395b('0x44'),_0x395b('0x45')),'defaultValue':'DESC'},'dialQueueProject2':{'type':Sequelize[_0x395b('0x2')],'comment':_0x395b('0x31')},'dialAgiAfterHangupClient':{'type':Sequelize[_0x395b('0x1f')],'defaultValue':![]},'dialAgiAfterHangupAgent':{'type':Sequelize[_0x395b('0x1f')],'defaultValue':![]},'dialRandomLastDigitCallerIdNumber':{'type':Sequelize[_0x395b('0x16')](0x3)[_0x395b('0x28')],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':_0x395b('0x46')},'dialCutDigit':{'type':Sequelize[_0x395b('0x16')](0x3)['UNSIGNED'],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':_0x395b('0x47')},'dialNoSuchNumberMaxRetry':{'type':Sequelize[_0x395b('0x16')](0x3)[_0x395b('0x28')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x395b('0x48')},'dialNoSuchNumberRetryFrequency':{'type':Sequelize['INTEGER'](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x395b('0x49')},'dialDropMaxRetry':{'type':Sequelize['INTEGER'](0x3)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x395b('0x4a')},'dialDropRetryFrequency':{'type':Sequelize[_0x395b('0x16')](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x395b('0x4b')},'dialAbandonedMaxRetry':{'type':Sequelize['INTEGER'](0x3)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':'#Abandoned\x20Retry\x20(min:1,\x20max:999)'},'dialAbandonedRetryFrequency':{'type':Sequelize[_0x395b('0x16')](0x5)[_0x395b('0x28')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x395b('0x4c')},'dialMachineMaxRetry':{'type':Sequelize['INTEGER'](0x3)[_0x395b('0x28')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x395b('0x4d')},'dialMachineRetryFrequency':{'type':Sequelize[_0x395b('0x16')](0x5)[_0x395b('0x28')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x395b('0x4e')},'dialAgentRejectMaxRetry':{'type':Sequelize[_0x395b('0x16')](0x3)[_0x395b('0x28')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x395b('0x4f')},'dialAgentRejectRetryFrequency':{'type':Sequelize[_0x395b('0x16')](0x5)[_0x395b('0x28')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x395b('0x50')},'mandatoryDispositionPauseId':{'type':Sequelize['INTEGER'],'allowNull':!![],'comment':_0x395b('0x51')},'mandatoryDisposition':{'type':Sequelize[_0x395b('0x1f')],'defaultValue':![],'comment':_0x395b('0x52'),'set':function(_0x2bfe9c){if(!_0x2bfe9c)this[_0x395b('0x15')](_0x395b('0x53'),null);this[_0x395b('0x15')](_0x395b('0x54'),_0x2bfe9c);}},'dialPredictiveIntervalMaxThreshold':{'type':Sequelize['INTEGER'](0x3)[_0x395b('0x28')],'defaultValue':0x14,'validate':{'min':0x1,'max':0x64}},'dialPredictiveIntervalMinThreshold':{'type':Sequelize[_0x395b('0x16')](0x3)[_0x395b('0x28')],'defaultValue':0xa,'validate':{'min':0x1,'max':0x64}},'dialPreviewAutoRecallMe':{'type':Sequelize[_0x395b('0x1f')],'defaultValue':!![]},'callAdditionalPhoneAfterMin':{'type':Sequelize[_0x395b('0x16')](0x3)['UNSIGNED'],'defaultValue':0x4},'dialPreviewRecallmeReminder':{'type':Sequelize[_0x395b('0x1f')],'defaultValue':![]}}; \ No newline at end of file diff --git a/server/api/voiceQueue/voiceQueue.controller.js b/server/api/voiceQueue/voiceQueue.controller.js index 6a18484..31bdab1 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 _0x6aa7=['ListId\x20=\x20?','CmListId','phone\x20IS\x20NOT\x20NULL','deletedAt\x20IS\x20NULL','cm_hopper_additional_phones','CmHopperId','OrderBy','ci.item','ci.OrderBy+1','cm_contact_has_items','h.ContactId=ci.CmContactId','h.scheduledat=?','ci.ItemClass=?','PHONE','getBlackLists','CmList','addBlackLists','cm_hopper_black','NOW()','removeBlackLists','moment','util','lodash','squel','ioredis','../../config/logger','api','../../config/environment','defaults','localhost','socket.io-emitter','redis','register','sendStatus','status','end','json','undefined','limit','count','offset','Content-Range','update','then','get','VoiceQueues','inbound','QueueCampaigns','outbound','ignore','map','value','includes','type','find','name','UserProfileResource','destroy','error','stack','index','VoiceQueue','rawAttributes','fieldName','getOptions','where','include','rows','show','model','keys','query','attributes','intersection','fields','length','includeAll','merge','options','catch','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','clone','params','omit','updatedAt','createdAt','getHoppers','findOne','filters','nolimit','order','sort','pick','VoiceQueueId','filter','CmHopper','findAll','getHopperHistories','CmHopperHistory','CmHopperFinal','hasOwnProperty','CmHopperBlack','getTeams','Team','addTeams','teams','User','online','voicePause','interface','flatMap','forEach','penalty','Agents','sequelize','transaction','each','TeamVoiceQueue','upsert','findOrCreate','UserVoiceQueueRt','isNil','format','SIP/%s','emit','userVoiceQueue:save','removeTeams','ids','field','tq.TeamId','from','team_has_voice_queues','join','user_has_teams','VoiceQueueId\x20=\x20?','ut.UserId\x20=\x20?','push','SELECT','every','TeamId','compact','isEmpty','removeAgents','addAgents','spread','all','isArray','userVoiceQueue:remove','getAgents','getMembers','getLists','addLists','YYYY-MM-DD\x20HH:mm:ss','dialCheckDuplicateType','insert','into','cm_hopper','fromQuery','phone','scheduledAt','ContactId','ListId','toString','cm_contacts','COALESCE(calleridnum,\x27\x27)','cm_hopper_final','phone\x20NOT\x20IN\x20(?)','COALESCE(phone,\x27\x27)','onlyIfOpen','select'];(function(_0x5c351c,_0x2046d8){var _0x26f3b3=function(_0x47ac18){while(--_0x47ac18){_0x5c351c['push'](_0x5c351c['shift']());}};_0x26f3b3(++_0x2046d8);}(_0x6aa7,0x178));var _0x76aa=function(_0x24381e,_0x19d08c){_0x24381e=_0x24381e-0x0;var _0x1f2ba1=_0x6aa7[_0x24381e];return _0x1f2ba1;};'use strict';var moment=require(_0x76aa('0x0'));var BPromise=require('bluebird');var util=require(_0x76aa('0x1'));var _=require(_0x76aa('0x2'));var squel=require(_0x76aa('0x3'));var Redis=require(_0x76aa('0x4'));var qs=require('../../components/parsers/qs');var logger=require(_0x76aa('0x5'))(_0x76aa('0x6'));var config=require(_0x76aa('0x7'));var db=require('../../mysqldb')['db'];config['redis']=_[_0x76aa('0x8')](config['redis'],{'host':_0x76aa('0x9'),'port':0x18eb});var socket=require(_0x76aa('0xa'))(new Redis(config[_0x76aa('0xb')]));require('./voiceQueue.socket')[_0x76aa('0xc')](socket);function respondWithStatusCode(_0x266bd5,_0x3a3f36){_0x3a3f36=_0x3a3f36||0xcc;return function(_0x557d69){if(_0x557d69){return _0x266bd5[_0x76aa('0xd')](_0x3a3f36);}return _0x266bd5[_0x76aa('0xe')](_0x3a3f36)[_0x76aa('0xf')]();};}function respondWithResult(_0x16cb50,_0x37f1ab){_0x37f1ab=_0x37f1ab||0xc8;return function(_0x128435){if(_0x128435){return _0x16cb50[_0x76aa('0xe')](_0x37f1ab)[_0x76aa('0x10')](_0x128435);}};}function respondWithFilteredResult(_0xd6327,_0x17a417){return function(_0x5e5f47){if(_0x5e5f47){var _0x112c39=typeof _0x17a417['offset']===_0x76aa('0x11')&&typeof _0x17a417[_0x76aa('0x12')]===_0x76aa('0x11');var _0x8e44ed=_0x5e5f47[_0x76aa('0x13')];var _0x4e309f=_0x112c39?0x0:_0x17a417['offset'];var _0x2b3b4f=_0x112c39?_0x5e5f47['count']:_0x17a417[_0x76aa('0x14')]+_0x17a417[_0x76aa('0x12')];var _0x5cf594;if(_0x2b3b4f>=_0x8e44ed){_0x2b3b4f=_0x8e44ed;_0x5cf594=0xc8;}else{_0x5cf594=0xce;}_0xd6327[_0x76aa('0xe')](_0x5cf594);return _0xd6327['set'](_0x76aa('0x15'),_0x4e309f+'-'+_0x2b3b4f+'/'+_0x8e44ed)['json'](_0x5e5f47);}return null;};}function saveUpdates(_0x1515e9){return function(_0x413cf6){if(_0x413cf6){return _0x413cf6[_0x76aa('0x16')](_0x1515e9)[_0x76aa('0x17')](function(_0xa1bc7){return _0xa1bc7;});}return null;};}function removeEntity(_0x3ead3f){return function(_0x496902){if(_0x496902){return _0x496902['destroy']()[_0x76aa('0x17')](function(){var _0x454dd3=_0x496902[_0x76aa('0x18')]({'plain':!![]});var _0x15b931=[{'name':_0x76aa('0x19'),'value':_0x76aa('0x1a'),'ignore':![]},{'name':_0x76aa('0x1b'),'value':_0x76aa('0x1c'),'ignore':![]}];var _0x385157=_(_0x15b931)['filter'](_0x76aa('0x1d'))[_0x76aa('0x1e')](_0x76aa('0x1f'))['value']();if(_[_0x76aa('0x20')](_0x385157,_0x454dd3[_0x76aa('0x21')])){return;}var _0x31252f=_[_0x76aa('0x22')](_0x15b931,[_0x76aa('0x1f'),_0x454dd3[_0x76aa('0x21')]])[_0x76aa('0x23')];return db[_0x76aa('0x24')][_0x76aa('0x25')]({'where':{'type':_0x31252f,'resourceId':_0x454dd3['id']}})[_0x76aa('0x17')](function(){return _0x496902;});})[_0x76aa('0x17')](function(){_0x3ead3f[_0x76aa('0xe')](0xcc)[_0x76aa('0xf')]();});}};}function handleEntityNotFound(_0x4ef9b0){return function(_0xb5e8a9){if(!_0xb5e8a9){_0x4ef9b0[_0x76aa('0xd')](0x194);}return _0xb5e8a9;};}function handleError(_0x25c614,_0x2e7ab4){_0x2e7ab4=_0x2e7ab4||0x1f4;return function(_0xa1e6){logger[_0x76aa('0x26')](_0xa1e6[_0x76aa('0x27')]);if(_0xa1e6[_0x76aa('0x23')]){delete _0xa1e6[_0x76aa('0x23')];}_0x25c614[_0x76aa('0xe')](_0x2e7ab4)['send'](_0xa1e6);};}exports[_0x76aa('0x28')]=function(_0x5a8030,_0x994550){var _0x365ff8={};var _0x2dec94={'count':0x0,'rows':[]};var _0x1e90b9=_[_0x76aa('0x1e')](db[_0x76aa('0x29')][_0x76aa('0x2a')],function(_0x3827ec){return{'name':_0x3827ec[_0x76aa('0x2b')],'type':_0x3827ec[_0x76aa('0x21')]['key']};});_0x365ff8=qs[_0x76aa('0x2c')](_0x1e90b9,_0x5a8030);var _0x5532c7={'where':_0x365ff8[_0x76aa('0x2d')]};return db[_0x76aa('0x29')][_0x76aa('0x13')](_0x5532c7)[_0x76aa('0x17')](function(_0x35a705){_0x2dec94['count']=_0x35a705;_0x365ff8[_0x76aa('0x2e')]=qs[_0x76aa('0x2e')](_0x5a8030['query']);return db[_0x76aa('0x29')]['findAll'](_0x365ff8);})[_0x76aa('0x17')](function(_0x4c90b6){_0x2dec94[_0x76aa('0x2f')]=_0x4c90b6;return _0x2dec94;})['then'](respondWithFilteredResult(_0x994550,_0x365ff8))['catch'](handleError(_0x994550,null));};exports[_0x76aa('0x30')]=function(_0x282c56,_0x198fcb){var _0x37dfab={'raw':![],'where':{'id':_0x282c56['params']['id']}},_0x595a0f={};_0x595a0f[_0x76aa('0x31')]=_[_0x76aa('0x32')](db[_0x76aa('0x29')][_0x76aa('0x2a')]);_0x595a0f[_0x76aa('0x33')]=_['keys'](_0x282c56[_0x76aa('0x33')]);_0x595a0f['filters']=_['intersection'](_0x595a0f[_0x76aa('0x31')],_0x595a0f[_0x76aa('0x33')]);_0x37dfab[_0x76aa('0x34')]=_[_0x76aa('0x35')](_0x595a0f['model'],qs[_0x76aa('0x36')](_0x282c56[_0x76aa('0x33')][_0x76aa('0x36')]));_0x37dfab['attributes']=_0x37dfab[_0x76aa('0x34')][_0x76aa('0x37')]?_0x37dfab[_0x76aa('0x34')]:_0x595a0f[_0x76aa('0x31')];if(_0x282c56[_0x76aa('0x33')][_0x76aa('0x38')]){_0x37dfab[_0x76aa('0x2e')]=[{'all':!![]}];}_0x37dfab=_[_0x76aa('0x39')]({},_0x37dfab,_0x282c56[_0x76aa('0x3a')]);return db['VoiceQueue'][_0x76aa('0x22')](_0x37dfab)[_0x76aa('0x17')](handleEntityNotFound(_0x198fcb,null))[_0x76aa('0x17')](respondWithResult(_0x198fcb,null))[_0x76aa('0x3b')](handleError(_0x198fcb,null));};exports[_0x76aa('0x3c')]=function(_0x2957aa,_0x572fdb){return db['VoiceQueue'][_0x76aa('0x3c')](_0x2957aa[_0x76aa('0x3d')],{})[_0x76aa('0x17')](function(_0x365612){var _0x50599f=_0x2957aa[_0x76aa('0x3e')][_0x76aa('0x18')]({'plain':!![]});if(!_0x50599f)throw new Error(_0x76aa('0x3f'));if(_0x50599f[_0x76aa('0x40')]===_0x76aa('0x3e')){var _0x4aa2f3=_0x365612[_0x76aa('0x18')]({'plain':!![]});var _0x556f59=[{'name':_0x76aa('0x19'),'value':'inbound'},{'name':'QueueCampaigns','value':'outbound'}];var _0x144f0a=_['find'](_0x556f59,['value',_0x4aa2f3['type']])[_0x76aa('0x23')];return db[_0x76aa('0x41')][_0x76aa('0x22')]({'where':{'name':_0x144f0a,'userProfileId':_0x50599f[_0x76aa('0x42')]},'raw':!![]})[_0x76aa('0x17')](function(_0x47b0c8){if(_0x47b0c8&&_0x47b0c8[_0x76aa('0x43')]===0x0){return db[_0x76aa('0x24')][_0x76aa('0x3c')]({'name':_0x4aa2f3[_0x76aa('0x23')],'resourceId':_0x4aa2f3['id'],'type':_0x47b0c8[_0x76aa('0x23')],'sectionId':_0x47b0c8['id']},{})['then'](function(){return _0x365612;});}else{return _0x365612;}})[_0x76aa('0x3b')](function(_0x1c62a9){logger['error'](_0x76aa('0x44'),_0x1c62a9);throw _0x1c62a9;});}return _0x365612;})['then'](respondWithResult(_0x572fdb,0xc9))[_0x76aa('0x3b')](handleError(_0x572fdb,null));};exports[_0x76aa('0x45')]=function(_0x31930b,_0x18fd3e){var _0x2d0bc4={'where':{'id':_0x31930b[_0x76aa('0x46')]['id']}},_0x3e0315={};_0x3e0315[_0x76aa('0x31')]=_[_0x76aa('0x32')](db[_0x76aa('0x29')]['rawAttributes']);_0x2d0bc4[_0x76aa('0x34')]=_['intersection'](_0x3e0315[_0x76aa('0x31')],qs[_0x76aa('0x36')](_0x31930b[_0x76aa('0x33')][_0x76aa('0x36')]));_0x2d0bc4['attributes']=_0x2d0bc4['attributes'][_0x76aa('0x37')]?_0x2d0bc4['attributes']:_0x3e0315[_0x76aa('0x31')];if(_0x31930b[_0x76aa('0x33')][_0x76aa('0x38')]){_0x2d0bc4[_0x76aa('0x2e')]=[{'all':!![]}];}_0x2d0bc4=_[_0x76aa('0x39')]({},_0x2d0bc4,_0x31930b[_0x76aa('0x3a')]);return db['VoiceQueue']['find'](_0x2d0bc4)[_0x76aa('0x17')](handleEntityNotFound(_0x18fd3e,null))[_0x76aa('0x17')](function(_0x1708d4){if(_0x1708d4){var _0x40e8ff=_0x1708d4[_0x76aa('0x18')]({'plain':!![]});_0x40e8ff=qs[_0x76aa('0x47')](_0x40e8ff,['id','createdAt',_0x76aa('0x48')]);_0x31930b[_0x76aa('0x3d')]=_[_0x76aa('0x47')](_0x31930b['body'],['id',_0x76aa('0x49'),'updatedAt']);return db[_0x76aa('0x29')]['create'](_[_0x76aa('0x39')](_0x40e8ff,_0x31930b[_0x76aa('0x3d')]),{'include':_0x31930b[_0x76aa('0x33')][_0x76aa('0x38')]?[{'all':!![]}]:undefined})[_0x76aa('0x17')](function(_0x316de3){var _0x953726=_0x31930b['user'][_0x76aa('0x18')]({'plain':!![]});if(!_0x953726)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x953726[_0x76aa('0x40')]===_0x76aa('0x3e')){var _0x288151=_0x316de3[_0x76aa('0x18')]({'plain':!![]});var _0x3fa7ec=[{'name':_0x76aa('0x19'),'value':_0x76aa('0x1a')},{'name':'QueueCampaigns','value':_0x76aa('0x1c')}];var _0x281f73=_[_0x76aa('0x22')](_0x3fa7ec,[_0x76aa('0x1f'),_0x288151['type']])[_0x76aa('0x23')];return db[_0x76aa('0x41')][_0x76aa('0x22')]({'where':{'name':_0x281f73,'userProfileId':_0x953726[_0x76aa('0x42')]},'raw':!![]})[_0x76aa('0x17')](function(_0xf7732){if(_0xf7732&&_0xf7732['autoAssociation']===0x0){return db[_0x76aa('0x24')][_0x76aa('0x3c')]({'name':_0x288151[_0x76aa('0x23')],'resourceId':_0x288151['id'],'type':_0xf7732[_0x76aa('0x23')],'sectionId':_0xf7732['id']},{})[_0x76aa('0x17')](function(){return _0x316de3;});}else{return _0x316de3;}})[_0x76aa('0x3b')](function(_0x37babe){logger['error']('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x37babe);throw _0x37babe;});}return _0x316de3;});}})[_0x76aa('0x17')](respondWithResult(_0x18fd3e,0xc9))[_0x76aa('0x3b')](handleError(_0x18fd3e,null));};exports['update']=function(_0x3d7802,_0x1e6f3c){if(_0x3d7802['body']['id']){delete _0x3d7802[_0x76aa('0x3d')]['id'];}return db[_0x76aa('0x29')][_0x76aa('0x22')]({'where':{'id':_0x3d7802[_0x76aa('0x46')]['id']}})[_0x76aa('0x17')](handleEntityNotFound(_0x1e6f3c,null))[_0x76aa('0x17')](saveUpdates(_0x3d7802[_0x76aa('0x3d')],null))[_0x76aa('0x17')](respondWithResult(_0x1e6f3c,null))[_0x76aa('0x3b')](handleError(_0x1e6f3c,null));};exports['destroy']=function(_0xd337f0,_0x49156c){return db[_0x76aa('0x29')][_0x76aa('0x22')]({'where':{'id':_0xd337f0[_0x76aa('0x46')]['id']}})[_0x76aa('0x17')](handleEntityNotFound(_0x49156c,null))[_0x76aa('0x17')](removeEntity(_0x49156c,null))[_0x76aa('0x3b')](handleError(_0x49156c,null));};exports[_0x76aa('0x4a')]=function(_0x431d1c,_0x2f1263){var _0x5eceba={'raw':![],'where':{}};var _0x267fcf={};var _0x3d4025={'count':0x0,'rows':[]};return db[_0x76aa('0x29')][_0x76aa('0x4b')]({'where':{'id':_0x431d1c[_0x76aa('0x46')]['id']}})[_0x76aa('0x17')](handleEntityNotFound(_0x2f1263,null))[_0x76aa('0x17')](function(_0x157540){if(_0x157540){_0x267fcf['model']=_[_0x76aa('0x32')](db['CmHopper'][_0x76aa('0x2a')]);_0x267fcf[_0x76aa('0x33')]=_[_0x76aa('0x32')](_0x431d1c[_0x76aa('0x33')]);_0x267fcf[_0x76aa('0x4c')]=_[_0x76aa('0x35')](_0x267fcf[_0x76aa('0x31')],_0x267fcf['query']);_0x5eceba[_0x76aa('0x34')]=_[_0x76aa('0x35')](_0x267fcf['model'],qs['fields'](_0x431d1c[_0x76aa('0x33')][_0x76aa('0x36')]));_0x5eceba['attributes']=_0x5eceba[_0x76aa('0x34')][_0x76aa('0x37')]?_0x5eceba[_0x76aa('0x34')]:_0x267fcf['model'];if(!_0x431d1c[_0x76aa('0x33')]['hasOwnProperty'](_0x76aa('0x4d'))){_0x5eceba[_0x76aa('0x12')]=qs[_0x76aa('0x12')](_0x431d1c[_0x76aa('0x33')]['limit']);_0x5eceba['offset']=qs[_0x76aa('0x14')](_0x431d1c['query'][_0x76aa('0x14')]);}_0x5eceba[_0x76aa('0x4e')]=qs[_0x76aa('0x4f')](_0x431d1c[_0x76aa('0x33')][_0x76aa('0x4f')]);_0x5eceba[_0x76aa('0x2d')]=qs[_0x76aa('0x4c')](_[_0x76aa('0x50')](_0x431d1c[_0x76aa('0x33')],_0x267fcf['filters']));_0x5eceba[_0x76aa('0x2d')][_0x76aa('0x51')]=_0x157540['id'];if(_0x431d1c[_0x76aa('0x33')][_0x76aa('0x52')]){_0x5eceba['where']=_['merge'](_0x5eceba['where'],{'$or':_[_0x76aa('0x1e')](_0x5eceba['attributes'],function(_0xb61e5){var _0x256195={};_0x256195[_0xb61e5]={'$like':'%'+_0x431d1c[_0x76aa('0x33')][_0x76aa('0x52')]+'%'};return _0x256195;})});}_0x5eceba=_['merge']({},_0x5eceba,_0x431d1c[_0x76aa('0x3a')]);return db['CmHopper'][_0x76aa('0x13')]({'where':_0x5eceba[_0x76aa('0x2d')]})[_0x76aa('0x17')](function(_0x11d602){_0x3d4025[_0x76aa('0x13')]=_0x11d602;if(_0x431d1c['query'][_0x76aa('0x38')]){_0x5eceba[_0x76aa('0x2e')]=[{'all':!![]}];}return db[_0x76aa('0x53')][_0x76aa('0x54')](_0x5eceba);})[_0x76aa('0x17')](function(_0x22432d){_0x3d4025[_0x76aa('0x2f')]=_0x22432d;return _0x3d4025;});}})[_0x76aa('0x17')](respondWithFilteredResult(_0x2f1263,_0x5eceba))['catch'](handleError(_0x2f1263,null));};exports[_0x76aa('0x55')]=function(_0x381f44,_0x48136a){var _0x3c1b98={'raw':!![],'where':{}};var _0x215463={};var _0x325487={'count':0x0,'rows':[]};return db[_0x76aa('0x29')][_0x76aa('0x4b')]({'where':{'id':_0x381f44[_0x76aa('0x46')]['id']}})[_0x76aa('0x17')](handleEntityNotFound(_0x48136a,null))['then'](function(_0xdb821b){if(_0xdb821b){_0x215463['model']=_['keys'](db[_0x76aa('0x56')][_0x76aa('0x2a')]);_0x215463['query']=_['keys'](_0x381f44[_0x76aa('0x33')]);_0x215463[_0x76aa('0x4c')]=_[_0x76aa('0x35')](_0x215463['model'],_0x215463['query']);_0x3c1b98[_0x76aa('0x34')]=_[_0x76aa('0x35')](_0x215463[_0x76aa('0x31')],qs['fields'](_0x381f44[_0x76aa('0x33')]['fields']));_0x3c1b98[_0x76aa('0x34')]=_0x3c1b98[_0x76aa('0x34')][_0x76aa('0x37')]?_0x3c1b98[_0x76aa('0x34')]:_0x215463[_0x76aa('0x31')];if(!_0x381f44['query']['hasOwnProperty'](_0x76aa('0x4d'))){_0x3c1b98[_0x76aa('0x12')]=qs[_0x76aa('0x12')](_0x381f44['query'][_0x76aa('0x12')]);_0x3c1b98[_0x76aa('0x14')]=qs[_0x76aa('0x14')](_0x381f44[_0x76aa('0x33')][_0x76aa('0x14')]);}_0x3c1b98['order']=qs[_0x76aa('0x4f')](_0x381f44['query'][_0x76aa('0x4f')]);_0x3c1b98[_0x76aa('0x2d')]=qs[_0x76aa('0x4c')](_[_0x76aa('0x50')](_0x381f44[_0x76aa('0x33')],_0x215463[_0x76aa('0x4c')]));_0x3c1b98['where']['VoiceQueueId']=_0xdb821b['id'];if(_0x381f44['query']['filter']){_0x3c1b98['where']=_[_0x76aa('0x39')](_0x3c1b98[_0x76aa('0x2d')],{'$or':_['map'](_0x3c1b98['attributes'],function(_0x4f01e9){var _0x3a6326={};_0x3a6326[_0x4f01e9]={'$like':'%'+_0x381f44[_0x76aa('0x33')][_0x76aa('0x52')]+'%'};return _0x3a6326;})});}_0x3c1b98=_['merge']({},_0x3c1b98,_0x381f44['options']);return db[_0x76aa('0x56')][_0x76aa('0x13')]({'where':_0x3c1b98[_0x76aa('0x2d')]})[_0x76aa('0x17')](function(_0x354c7b){_0x325487['count']=_0x354c7b;if(_0x381f44['query'][_0x76aa('0x38')]){_0x3c1b98['include']=[{'all':!![]}];}return db['CmHopperHistory']['findAll'](_0x3c1b98);})[_0x76aa('0x17')](function(_0xbb1ccd){_0x325487['rows']=_0xbb1ccd;return _0x325487;});}})[_0x76aa('0x17')](respondWithFilteredResult(_0x48136a,_0x3c1b98))[_0x76aa('0x3b')](handleError(_0x48136a,null));};exports['getHopperFinals']=function(_0x22063f,_0x24331a){var _0x11d91f={'raw':!![],'where':{}};var _0x258e5a={};var _0x1fa86b={'count':0x0,'rows':[]};return db[_0x76aa('0x29')][_0x76aa('0x4b')]({'where':{'id':_0x22063f[_0x76aa('0x46')]['id']}})[_0x76aa('0x17')](handleEntityNotFound(_0x24331a,null))['then'](function(_0x84bc91){if(_0x84bc91){_0x258e5a[_0x76aa('0x31')]=_['keys'](db[_0x76aa('0x57')][_0x76aa('0x2a')]);_0x258e5a[_0x76aa('0x33')]=_['keys'](_0x22063f[_0x76aa('0x33')]);_0x258e5a[_0x76aa('0x4c')]=_['intersection'](_0x258e5a[_0x76aa('0x31')],_0x258e5a[_0x76aa('0x33')]);_0x11d91f[_0x76aa('0x34')]=_['intersection'](_0x258e5a[_0x76aa('0x31')],qs[_0x76aa('0x36')](_0x22063f['query']['fields']));_0x11d91f['attributes']=_0x11d91f[_0x76aa('0x34')][_0x76aa('0x37')]?_0x11d91f[_0x76aa('0x34')]:_0x258e5a[_0x76aa('0x31')];if(!_0x22063f['query']['hasOwnProperty']('nolimit')){_0x11d91f[_0x76aa('0x12')]=qs['limit'](_0x22063f[_0x76aa('0x33')][_0x76aa('0x12')]);_0x11d91f['offset']=qs[_0x76aa('0x14')](_0x22063f[_0x76aa('0x33')]['offset']);}_0x11d91f[_0x76aa('0x4e')]=qs[_0x76aa('0x4f')](_0x22063f[_0x76aa('0x33')][_0x76aa('0x4f')]);_0x11d91f[_0x76aa('0x2d')]=qs[_0x76aa('0x4c')](_['pick'](_0x22063f[_0x76aa('0x33')],_0x258e5a['filters']));_0x11d91f['where']['VoiceQueueId']=_0x84bc91['id'];if(_0x22063f['query']['filter']){_0x11d91f[_0x76aa('0x2d')]=_[_0x76aa('0x39')](_0x11d91f[_0x76aa('0x2d')],{'$or':_[_0x76aa('0x1e')](_0x11d91f['attributes'],function(_0x447103){var _0x2192ed={};_0x2192ed[_0x447103]={'$like':'%'+_0x22063f[_0x76aa('0x33')][_0x76aa('0x52')]+'%'};return _0x2192ed;})});}_0x11d91f=_[_0x76aa('0x39')]({},_0x11d91f,_0x22063f['options']);return db[_0x76aa('0x57')][_0x76aa('0x13')]({'where':_0x11d91f[_0x76aa('0x2d')]})[_0x76aa('0x17')](function(_0x13be70){_0x1fa86b[_0x76aa('0x13')]=_0x13be70;if(_0x22063f[_0x76aa('0x33')]['includeAll']){_0x11d91f[_0x76aa('0x2e')]=[{'all':!![]}];}return db[_0x76aa('0x57')]['findAll'](_0x11d91f);})['then'](function(_0x216e87){_0x1fa86b[_0x76aa('0x2f')]=_0x216e87;return _0x1fa86b;});}})['then'](respondWithFilteredResult(_0x24331a,_0x11d91f))[_0x76aa('0x3b')](handleError(_0x24331a,null));};exports['getHopperBlacks']=function(_0x28ec11,_0x5cc005){var _0x28b439={'raw':!![],'where':{}};var _0x583924={};var _0x45227e={'count':0x0,'rows':[]};return db[_0x76aa('0x29')][_0x76aa('0x4b')]({'where':{'id':_0x28ec11['params']['id']}})[_0x76aa('0x17')](handleEntityNotFound(_0x5cc005,null))['then'](function(_0x1af32e){if(_0x1af32e){_0x583924[_0x76aa('0x31')]=_['keys'](db['CmHopperBlack'][_0x76aa('0x2a')]);_0x583924[_0x76aa('0x33')]=_[_0x76aa('0x32')](_0x28ec11[_0x76aa('0x33')]);_0x583924['filters']=_['intersection'](_0x583924[_0x76aa('0x31')],_0x583924['query']);_0x28b439[_0x76aa('0x34')]=_['intersection'](_0x583924[_0x76aa('0x31')],qs[_0x76aa('0x36')](_0x28ec11['query'][_0x76aa('0x36')]));_0x28b439['attributes']=_0x28b439['attributes'][_0x76aa('0x37')]?_0x28b439[_0x76aa('0x34')]:_0x583924['model'];if(!_0x28ec11[_0x76aa('0x33')][_0x76aa('0x58')](_0x76aa('0x4d'))){_0x28b439['limit']=qs[_0x76aa('0x12')](_0x28ec11[_0x76aa('0x33')][_0x76aa('0x12')]);_0x28b439[_0x76aa('0x14')]=qs[_0x76aa('0x14')](_0x28ec11[_0x76aa('0x33')][_0x76aa('0x14')]);}_0x28b439[_0x76aa('0x4e')]=qs[_0x76aa('0x4f')](_0x28ec11[_0x76aa('0x33')][_0x76aa('0x4f')]);_0x28b439[_0x76aa('0x2d')]=qs['filters'](_[_0x76aa('0x50')](_0x28ec11[_0x76aa('0x33')],_0x583924['filters']));_0x28b439[_0x76aa('0x2d')][_0x76aa('0x51')]=_0x1af32e['id'];if(_0x28ec11['query']['filter']){_0x28b439[_0x76aa('0x2d')]=_[_0x76aa('0x39')](_0x28b439['where'],{'$or':_[_0x76aa('0x1e')](_0x28b439[_0x76aa('0x34')],function(_0x24af48){var _0x5010c8={};_0x5010c8[_0x24af48]={'$like':'%'+_0x28ec11[_0x76aa('0x33')][_0x76aa('0x52')]+'%'};return _0x5010c8;})});}_0x28b439=_['merge']({},_0x28b439,_0x28ec11[_0x76aa('0x3a')]);return db[_0x76aa('0x59')][_0x76aa('0x13')]({'where':_0x28b439[_0x76aa('0x2d')]})[_0x76aa('0x17')](function(_0x42543c){_0x45227e['count']=_0x42543c;if(_0x28ec11[_0x76aa('0x33')]['includeAll']){_0x28b439[_0x76aa('0x2e')]=[{'all':!![]}];}return db[_0x76aa('0x59')][_0x76aa('0x54')](_0x28b439);})['then'](function(_0x4c5f54){_0x45227e[_0x76aa('0x2f')]=_0x4c5f54;return _0x45227e;});}})[_0x76aa('0x17')](respondWithFilteredResult(_0x5cc005,_0x28b439))[_0x76aa('0x3b')](handleError(_0x5cc005,null));};exports[_0x76aa('0x5a')]=function(_0x1a81fd,_0x1eb8f2){var _0x4f7dd4={};var _0x5a4c03={};var _0x2565a2;var _0x109bd3;return db[_0x76aa('0x29')][_0x76aa('0x4b')]({'where':{'id':_0x1a81fd['params']['id']}})[_0x76aa('0x17')](handleEntityNotFound(_0x1eb8f2,null))['then'](function(_0x54d530){if(_0x54d530){_0x2565a2=_0x54d530;_0x5a4c03[_0x76aa('0x31')]=_[_0x76aa('0x32')](db[_0x76aa('0x5b')]['rawAttributes']);_0x5a4c03[_0x76aa('0x33')]=_[_0x76aa('0x32')](_0x1a81fd[_0x76aa('0x33')]);_0x5a4c03[_0x76aa('0x4c')]=_[_0x76aa('0x35')](_0x5a4c03[_0x76aa('0x31')],_0x5a4c03[_0x76aa('0x33')]);_0x4f7dd4['attributes']=_[_0x76aa('0x35')](_0x5a4c03[_0x76aa('0x31')],qs[_0x76aa('0x36')](_0x1a81fd[_0x76aa('0x33')][_0x76aa('0x36')]));_0x4f7dd4[_0x76aa('0x34')]=_0x4f7dd4['attributes'][_0x76aa('0x37')]?_0x4f7dd4[_0x76aa('0x34')]:_0x5a4c03[_0x76aa('0x31')];_0x4f7dd4[_0x76aa('0x4e')]=qs['sort'](_0x1a81fd[_0x76aa('0x33')][_0x76aa('0x4f')]);_0x4f7dd4[_0x76aa('0x2d')]=qs[_0x76aa('0x4c')](_[_0x76aa('0x50')](_0x1a81fd['query'],_0x5a4c03[_0x76aa('0x4c')]));if(_0x1a81fd[_0x76aa('0x33')]['filter']){_0x4f7dd4['where']=_[_0x76aa('0x39')](_0x4f7dd4[_0x76aa('0x2d')],{'$or':_[_0x76aa('0x1e')](_0x4f7dd4[_0x76aa('0x34')],function(_0x46f098){var _0x293221={};_0x293221[_0x46f098]={'$like':'%'+_0x1a81fd['query'][_0x76aa('0x52')]+'%'};return _0x293221;})});}_0x4f7dd4=_[_0x76aa('0x39')]({},_0x4f7dd4,_0x1a81fd[_0x76aa('0x3a')]);return _0x2565a2[_0x76aa('0x5a')](_0x4f7dd4);}})[_0x76aa('0x17')](function(_0x2e7bb7){if(_0x2e7bb7){_0x109bd3=_0x2e7bb7['length'];if(!_0x1a81fd[_0x76aa('0x33')][_0x76aa('0x58')](_0x76aa('0x4d'))){_0x4f7dd4[_0x76aa('0x12')]=qs[_0x76aa('0x12')](_0x1a81fd[_0x76aa('0x33')]['limit']);_0x4f7dd4[_0x76aa('0x14')]=qs['offset'](_0x1a81fd[_0x76aa('0x33')]['offset']);}return _0x2565a2[_0x76aa('0x5a')](_0x4f7dd4);}})[_0x76aa('0x17')](function(_0x56d6af){if(_0x56d6af){return _0x56d6af?{'count':_0x109bd3,'rows':_0x56d6af}:null;}})[_0x76aa('0x17')](respondWithResult(_0x1eb8f2,null))[_0x76aa('0x3b')](handleError(_0x1eb8f2,null));};exports[_0x76aa('0x5c')]=function(_0x57636c,_0x3ae5e8){var _0x46c818=_0x57636c['body'][_0x76aa('0x5d')];var _0xfe926d=_[_0x76aa('0x1e')](_0x46c818,'id');return db[_0x76aa('0x5b')][_0x76aa('0x54')]({'where':{'id':_0xfe926d},'attributes':['id'],'include':[{'model':db[_0x76aa('0x5e')],'as':'Agents','attributes':['id',_0x76aa('0x23'),_0x76aa('0x5f'),_0x76aa('0x60'),_0x76aa('0x61')],'raw':!![]}]})[_0x76aa('0x17')](function(_0x28e1a4){if(_0x28e1a4){var _0x8bb516=_[_0x76aa('0x62')](_0x28e1a4,function(_0xf9f670){var _0x1359f9=_0xf9f670[_0x76aa('0x18')]({'plain':!![]});_0x1359f9['Agents'][_0x76aa('0x63')](function(_0x58cd0c){_0x58cd0c[_0x76aa('0x64')]=_[_0x76aa('0x22')](_0x46c818,{'id':_0x1359f9['id']})[_0x76aa('0x64')];});return _0x1359f9[_0x76aa('0x65')];});return db[_0x76aa('0x29')][_0x76aa('0x22')]({'where':{'id':_0x57636c['params']['id']}})[_0x76aa('0x17')](function(_0x53090c){return db[_0x76aa('0x66')][_0x76aa('0x67')](function(_0x2045a2){return _0x53090c['addTeams'](_0xfe926d,{'transaction':_0x2045a2})[_0x76aa('0x17')](function(){return BPromise[_0x76aa('0x68')](_0x46c818,function(_0x228968){return db[_0x76aa('0x69')][_0x76aa('0x6a')]({'TeamId':_0x228968['id'],'VoiceQueueId':_0x57636c['params']['id'],'penalty':_0x228968[_0x76aa('0x64')]},{'transaction':_0x2045a2});});})['then'](function(){return BPromise[_0x76aa('0x68')](_0x8bb516,function(_0x1bc764){return db['UserVoiceQueue'][_0x76aa('0x6b')]({'where':{'UserId':_0x1bc764['id'],'VoiceQueueId':_0x57636c[_0x76aa('0x46')]['id']},'defaults':{'penalty':_0x1bc764[_0x76aa('0x64')]},'transaction':_0x2045a2});});})[_0x76aa('0x17')](function(){return BPromise[_0x76aa('0x68')](_[_0x76aa('0x52')](_0x8bb516,{'online':!![]}),function(_0x245af7){return db[_0x76aa('0x6c')]['upsert']({'membername':_0x245af7[_0x76aa('0x23')],'UserId':_0x245af7['id'],'queue_name':_0x53090c[_0x76aa('0x23')],'VoiceQueueId':_0x53090c['id'],'interface':_[_0x76aa('0x6d')](_0x245af7[_0x76aa('0x61')])?util[_0x76aa('0x6e')](_0x76aa('0x6f'),_0x245af7[_0x76aa('0x23')]):_0x245af7[_0x76aa('0x61')],'paused':_0x245af7['voicePause']||![],'penalty':_0x245af7[_0x76aa('0x64')]},{'transaction':_0x2045a2});});})[_0x76aa('0x17')](function(){_0x8bb516[_0x76aa('0x63')](function(_0x54e450){socket[_0x76aa('0x70')](_0x76aa('0x71'),{'UserId':_0x54e450['id'],'VoiceQueueId':_0x53090c['id']});});});});});}})[_0x76aa('0x17')](respondWithStatusCode(_0x3ae5e8,null))[_0x76aa('0x3b')](handleError(_0x3ae5e8,null));};exports[_0x76aa('0x72')]=function(_0x5db8d8,_0x21fd43){return db['Team'][_0x76aa('0x54')]({'where':{'id':_0x5db8d8[_0x76aa('0x33')][_0x76aa('0x73')]},'attributes':['id'],'include':[{'model':db[_0x76aa('0x5e')],'as':_0x76aa('0x65'),'attributes':['id'],'raw':!![]}]})['then'](handleEntityNotFound(_0x21fd43,null))[_0x76aa('0x17')](function(_0x4920fa){var _0x577463=_[_0x76aa('0x1e')](_0x4920fa,'id');var _0x20ba92=[];var _0x533080=[];var _0x3cd088=squel['select']();_0x3cd088[_0x76aa('0x74')](_0x76aa('0x75'))[_0x76aa('0x76')](_0x76aa('0x77'),'tq')[_0x76aa('0x78')](_0x76aa('0x79'),'ut','ut.TeamId\x20=\x20tq.TeamId')[_0x76aa('0x2d')](_0x76aa('0x7a'),_0x5db8d8[_0x76aa('0x46')]['id']);for(var _0x3ebe91=0x0;_0x3ebe91<_0x4920fa[_0x76aa('0x37')];_0x3ebe91+=0x1){let _0x14318c=_0x4920fa[_0x3ebe91];for(var _0xbfa5f8=0x0;_0xbfa5f8<_0x14318c[_0x76aa('0x65')][_0x76aa('0x37')];_0xbfa5f8+=0x1){let _0x46772f=_0x14318c[_0x76aa('0x65')][_0xbfa5f8];var _0x40df44=_0x3cd088[_0x76aa('0x45')]();_0x40df44[_0x76aa('0x2d')](_0x76aa('0x7b'),_0x46772f['id']);_0x533080[_0x76aa('0x7c')](db[_0x76aa('0x66')][_0x76aa('0x33')](_0x40df44['toString'](),{'type':db[_0x76aa('0x66')]['QueryTypes'][_0x76aa('0x7d')]})[_0x76aa('0x17')](function(_0x4a093b){if(_0x4a093b[_0x76aa('0x37')]===0x1){return _0x46772f['id'];}else{var _0x5305f1=_[_0x76aa('0x7e')](_[_0x76aa('0x1e')](_0x4a093b,_0x76aa('0x7f')),function(_0x5ceae2){return _[_0x76aa('0x20')](_0x577463,_0x5ceae2);});if(_0x5305f1){return _0x46772f['id'];}}}));}}return BPromise['all'](_0x533080)['then'](function(_0x3c9841){_0x20ba92=_(_0x20ba92)['union'](_0x3c9841)[_0x76aa('0x80')]()['value']();return db['VoiceQueue'][_0x76aa('0x22')]({'where':{'id':_0x5db8d8[_0x76aa('0x46')]['id']}})[_0x76aa('0x17')](function(_0x3f4ded){return db[_0x76aa('0x66')][_0x76aa('0x67')](function(_0x434634){return _0x3f4ded[_0x76aa('0x72')](_0x5db8d8[_0x76aa('0x33')][_0x76aa('0x73')],{'transaction':_0x434634})[_0x76aa('0x17')](function(){if(!_[_0x76aa('0x81')](_0x20ba92)){return _0x3f4ded[_0x76aa('0x82')](_0x20ba92,{'transaction':_0x434634})[_0x76aa('0x17')](function(){return db['UserVoiceQueueRt'][_0x76aa('0x25')]({'where':{'VoiceQueueId':_0x5db8d8[_0x76aa('0x46')]['id'],'UserId':_0x20ba92},'transaction':_0x434634});});}})[_0x76aa('0x17')](function(){_0x20ba92[_0x76aa('0x63')](function(_0x540bf3){socket[_0x76aa('0x70')]('userVoiceQueue:remove',{'UserId':_0x540bf3,'VoiceQueueId':_0x3f4ded['id']});});});});});});})[_0x76aa('0x17')](respondWithStatusCode(_0x21fd43,null))['catch'](handleError(_0x21fd43,null));};exports[_0x76aa('0x83')]=function(_0x5427f0,_0x3e9153){var _0x490090,_0x31b7a8;return db['VoiceQueue'][_0x76aa('0x22')]({'where':{'id':_0x5427f0[_0x76aa('0x46')]['id']}})['then'](handleEntityNotFound(_0x3e9153,null))[_0x76aa('0x17')](function(_0x51feca){if(_0x51feca){_0x31b7a8=_0x51feca;return _0x51feca[_0x76aa('0x83')](_0x5427f0['body'][_0x76aa('0x73')],_['omit'](_0x5427f0['body'],[_0x76aa('0x73'),'id'])||{})[_0x76aa('0x84')](function(_0x38b6aa){for(var _0x395501=0x0;_0x395501<_0x5427f0[_0x76aa('0x3d')][_0x76aa('0x73')][_0x76aa('0x37')];_0x395501+=0x1){socket[_0x76aa('0x70')](_0x76aa('0x71'),{'UserId':Number(_0x5427f0[_0x76aa('0x3d')]['ids'][_0x395501]),'VoiceQueueId':Number(_0x5427f0[_0x76aa('0x46')]['id'])});}return _0x38b6aa;});}})[_0x76aa('0x17')](function(_0x3d969f){_0x490090=_0x3d969f||[];if(_0x31b7a8){return db[_0x76aa('0x5e')][_0x76aa('0x54')]({'where':{'id':_0x5427f0[_0x76aa('0x3d')][_0x76aa('0x73')]},'attributes':['id',_0x76aa('0x23'),_0x76aa('0x5f'),_0x76aa('0x60'),_0x76aa('0x61')],'raw':!![]});}})[_0x76aa('0x17')](function(_0x3274a9){if(!_[_0x76aa('0x81')](_0x3274a9)){var _0x5c0268=[];for(var _0x5c5a6f=0x0;_0x5c5a6f<_0x3274a9[_0x76aa('0x37')];_0x5c5a6f++){if(_0x3274a9[_0x5c5a6f][_0x76aa('0x5f')]){_0x5c0268[_0x76aa('0x7c')](db['UserVoiceQueueRt']['upsert']({'membername':_0x3274a9[_0x5c5a6f][_0x76aa('0x23')],'UserId':_0x3274a9[_0x5c5a6f]['id'],'queue_name':_0x31b7a8[_0x76aa('0x23')],'VoiceQueueId':_0x31b7a8['id'],'interface':_[_0x76aa('0x6d')](_0x3274a9[_0x5c5a6f]['interface'])?util[_0x76aa('0x6e')](_0x76aa('0x6f'),_0x3274a9[_0x5c5a6f]['name']):_0x3274a9[_0x5c5a6f]['interface'],'paused':_0x3274a9[_0x5c5a6f]['voicePause']||![],'penalty':_0x5427f0[_0x76aa('0x3d')][_0x76aa('0x64')]||0x0}));}}return BPromise[_0x76aa('0x85')](_0x5c0268);}})['then'](function(){return _0x490090;})[_0x76aa('0x17')](respondWithResult(_0x3e9153,null))[_0x76aa('0x3b')](handleError(_0x3e9153,null));};exports['removeAgents']=function(_0x5433dc,_0x328d1a){return db[_0x76aa('0x29')][_0x76aa('0x22')]({'where':{'id':_0x5433dc['params']['id']}})[_0x76aa('0x17')](handleEntityNotFound(_0x328d1a,null))[_0x76aa('0x17')](function(_0x546770){if(_0x546770){return _0x546770[_0x76aa('0x82')](_0x5433dc[_0x76aa('0x33')]['ids'])[_0x76aa('0x17')](function(){if(_[_0x76aa('0x86')](_0x5433dc['query'][_0x76aa('0x73')])){for(var _0x4df504=0x0;_0x4df504<_0x5433dc['query'][_0x76aa('0x73')][_0x76aa('0x37')];_0x4df504+=0x1){socket[_0x76aa('0x70')](_0x76aa('0x87'),{'UserId':Number(_0x5433dc[_0x76aa('0x33')][_0x76aa('0x73')][_0x4df504]),'VoiceQueueId':Number(_0x5433dc[_0x76aa('0x46')]['id'])});}}else{socket[_0x76aa('0x70')](_0x76aa('0x87'),{'UserId':Number(_0x5433dc[_0x76aa('0x33')]['ids']),'VoiceQueueId':Number(_0x5433dc['params']['id'])});}});}})[_0x76aa('0x17')](function(_0x2726da){return db[_0x76aa('0x6c')][_0x76aa('0x25')]({'where':{'VoiceQueueId':_0x5433dc[_0x76aa('0x46')]['id'],'UserId':_0x5433dc[_0x76aa('0x33')]['ids']}})[_0x76aa('0x17')](function(){return _0x2726da;});})[_0x76aa('0x17')](respondWithStatusCode(_0x328d1a,null))[_0x76aa('0x3b')](handleError(_0x328d1a,null));};exports[_0x76aa('0x88')]=function(_0x38694d,_0xf0b932){var _0x1c8cf5={};var _0x5a8d0f={};var _0x5f513d;var _0x54e70c;return db[_0x76aa('0x29')][_0x76aa('0x4b')]({'where':{'id':_0x38694d[_0x76aa('0x46')]['id']}})[_0x76aa('0x17')](handleEntityNotFound(_0xf0b932,null))[_0x76aa('0x17')](function(_0x4afe13){if(_0x4afe13){_0x5f513d=_0x4afe13;_0x5a8d0f['model']=_[_0x76aa('0x32')](db[_0x76aa('0x5e')][_0x76aa('0x2a')]);_0x5a8d0f[_0x76aa('0x33')]=_[_0x76aa('0x32')](_0x38694d['query']);_0x5a8d0f[_0x76aa('0x4c')]=_['intersection'](_0x5a8d0f[_0x76aa('0x31')],_0x5a8d0f['query']);_0x1c8cf5['attributes']=_[_0x76aa('0x35')](_0x5a8d0f['model'],qs[_0x76aa('0x36')](_0x38694d[_0x76aa('0x33')][_0x76aa('0x36')]));_0x1c8cf5[_0x76aa('0x34')]=_0x1c8cf5[_0x76aa('0x34')][_0x76aa('0x37')]?_0x1c8cf5[_0x76aa('0x34')]:_0x5a8d0f[_0x76aa('0x31')];_0x1c8cf5['order']=qs[_0x76aa('0x4f')](_0x38694d[_0x76aa('0x33')][_0x76aa('0x4f')]);_0x1c8cf5[_0x76aa('0x2d')]=qs[_0x76aa('0x4c')](_['pick'](_0x38694d[_0x76aa('0x33')],_0x5a8d0f['filters']));if(_0x38694d[_0x76aa('0x33')]['filter']){_0x1c8cf5[_0x76aa('0x2d')]=_['merge'](_0x1c8cf5[_0x76aa('0x2d')],{'$or':_['map'](_0x1c8cf5[_0x76aa('0x34')],function(_0x8b2ee1){var _0x279be2={};_0x279be2[_0x8b2ee1]={'$like':'%'+_0x38694d['query']['filter']+'%'};return _0x279be2;})});}_0x1c8cf5=_[_0x76aa('0x39')]({},_0x1c8cf5,_0x38694d['options']);return _0x5f513d[_0x76aa('0x88')](_0x1c8cf5);}})[_0x76aa('0x17')](function(_0x1b99d8){if(_0x1b99d8){_0x54e70c=_0x1b99d8['length'];if(!_0x38694d['query']['hasOwnProperty']('nolimit')){_0x1c8cf5[_0x76aa('0x12')]=qs[_0x76aa('0x12')](_0x38694d[_0x76aa('0x33')][_0x76aa('0x12')]);_0x1c8cf5[_0x76aa('0x14')]=qs[_0x76aa('0x14')](_0x38694d[_0x76aa('0x33')][_0x76aa('0x14')]);}return _0x5f513d[_0x76aa('0x88')](_0x1c8cf5);}})[_0x76aa('0x17')](function(_0x2484fd){if(_0x2484fd){return _0x2484fd?{'count':_0x54e70c,'rows':_0x2484fd}:null;}})[_0x76aa('0x17')](respondWithResult(_0xf0b932,null))[_0x76aa('0x3b')](handleError(_0xf0b932,null));};exports['getMembers']=function(_0x2b12e9,_0x4e697b){var _0x1e902d={};var _0x3a7658={};var _0x1b1f85;var _0x3fb275;return db[_0x76aa('0x29')][_0x76aa('0x4b')]({'where':{'id':_0x2b12e9[_0x76aa('0x46')]['id']}})[_0x76aa('0x17')](handleEntityNotFound(_0x4e697b,null))[_0x76aa('0x17')](function(_0x1bdc5c){if(_0x1bdc5c){_0x1b1f85=_0x1bdc5c;_0x3a7658[_0x76aa('0x31')]=_['keys'](db['UserVoiceQueueRt'][_0x76aa('0x2a')]);_0x3a7658[_0x76aa('0x33')]=_['keys'](_0x2b12e9[_0x76aa('0x33')]);_0x3a7658[_0x76aa('0x4c')]=_[_0x76aa('0x35')](_0x3a7658[_0x76aa('0x31')],_0x3a7658[_0x76aa('0x33')]);_0x1e902d[_0x76aa('0x34')]=_[_0x76aa('0x35')](_0x3a7658['model'],qs[_0x76aa('0x36')](_0x2b12e9[_0x76aa('0x33')]['fields']));_0x1e902d['attributes']=_0x1e902d[_0x76aa('0x34')][_0x76aa('0x37')]?_0x1e902d[_0x76aa('0x34')]:_0x3a7658[_0x76aa('0x31')];_0x1e902d[_0x76aa('0x4e')]=qs[_0x76aa('0x4f')](_0x2b12e9[_0x76aa('0x33')][_0x76aa('0x4f')]);_0x1e902d[_0x76aa('0x2d')]=qs[_0x76aa('0x4c')](_[_0x76aa('0x50')](_0x2b12e9[_0x76aa('0x33')],_0x3a7658[_0x76aa('0x4c')]));if(_0x2b12e9['query']['filter']){_0x1e902d[_0x76aa('0x2d')]=_[_0x76aa('0x39')](_0x1e902d[_0x76aa('0x2d')],{'$or':_[_0x76aa('0x1e')](_0x1e902d['attributes'],function(_0x5f3819){var _0x2a8410={};_0x2a8410[_0x5f3819]={'$like':'%'+_0x2b12e9[_0x76aa('0x33')][_0x76aa('0x52')]+'%'};return _0x2a8410;})});}_0x1e902d=_['merge']({},_0x1e902d,_0x2b12e9['options']);return _0x1b1f85['getMembers'](_0x1e902d);}})[_0x76aa('0x17')](function(_0x4df872){if(_0x4df872){_0x3fb275=_0x4df872[_0x76aa('0x37')];if(!_0x2b12e9[_0x76aa('0x33')][_0x76aa('0x58')](_0x76aa('0x4d'))){_0x1e902d[_0x76aa('0x12')]=qs[_0x76aa('0x12')](_0x2b12e9[_0x76aa('0x33')][_0x76aa('0x12')]);_0x1e902d[_0x76aa('0x14')]=qs[_0x76aa('0x14')](_0x2b12e9[_0x76aa('0x33')][_0x76aa('0x14')]);}return _0x1b1f85[_0x76aa('0x89')](_0x1e902d);}})[_0x76aa('0x17')](function(_0x3b1f33){return _0x3b1f33?{'count':_0x3fb275,'rows':_0x3b1f33}:null;})[_0x76aa('0x17')](respondWithResult(_0x4e697b,null))['catch'](handleError(_0x4e697b,null));};exports[_0x76aa('0x8a')]=function(_0x5e8cec,_0x1a37e9){var _0x58932f={};var _0x17bd1a={};var _0x5d7a2b;var _0x363c45;return db['VoiceQueue']['findOne']({'where':{'id':_0x5e8cec[_0x76aa('0x46')]['id']}})[_0x76aa('0x17')](handleEntityNotFound(_0x1a37e9,null))[_0x76aa('0x17')](function(_0x44668d){if(_0x44668d){_0x5d7a2b=_0x44668d;_0x17bd1a[_0x76aa('0x31')]=_[_0x76aa('0x32')](db['CmList'][_0x76aa('0x2a')]);_0x17bd1a[_0x76aa('0x33')]=_[_0x76aa('0x32')](_0x5e8cec[_0x76aa('0x33')]);_0x17bd1a['filters']=_[_0x76aa('0x35')](_0x17bd1a[_0x76aa('0x31')],_0x17bd1a[_0x76aa('0x33')]);_0x58932f[_0x76aa('0x34')]=_[_0x76aa('0x35')](_0x17bd1a[_0x76aa('0x31')],qs[_0x76aa('0x36')](_0x5e8cec[_0x76aa('0x33')][_0x76aa('0x36')]));_0x58932f[_0x76aa('0x34')]=_0x58932f[_0x76aa('0x34')][_0x76aa('0x37')]?_0x58932f['attributes']:_0x17bd1a['model'];_0x58932f[_0x76aa('0x4e')]=qs[_0x76aa('0x4f')](_0x5e8cec[_0x76aa('0x33')][_0x76aa('0x4f')]);_0x58932f[_0x76aa('0x2d')]=qs[_0x76aa('0x4c')](_[_0x76aa('0x50')](_0x5e8cec[_0x76aa('0x33')],_0x17bd1a[_0x76aa('0x4c')]));if(_0x5e8cec[_0x76aa('0x33')][_0x76aa('0x52')]){_0x58932f['where']=_[_0x76aa('0x39')](_0x58932f['where'],{'$or':_[_0x76aa('0x1e')](_0x58932f[_0x76aa('0x34')],function(_0x278bac){var _0x14256c={};_0x14256c[_0x278bac]={'$like':'%'+_0x5e8cec[_0x76aa('0x33')]['filter']+'%'};return _0x14256c;})});}_0x58932f=_['merge']({},_0x58932f,_0x5e8cec[_0x76aa('0x3a')]);return _0x5d7a2b['getLists'](_0x58932f);}})[_0x76aa('0x17')](function(_0xb760ca){if(_0xb760ca){_0x363c45=_0xb760ca[_0x76aa('0x37')];if(!_0x5e8cec[_0x76aa('0x33')][_0x76aa('0x58')]('nolimit')){_0x58932f['limit']=qs[_0x76aa('0x12')](_0x5e8cec[_0x76aa('0x33')][_0x76aa('0x12')]);_0x58932f[_0x76aa('0x14')]=qs[_0x76aa('0x14')](_0x5e8cec[_0x76aa('0x33')][_0x76aa('0x14')]);}return _0x5d7a2b[_0x76aa('0x8a')](_0x58932f);}})[_0x76aa('0x17')](function(_0x33644d){if(_0x33644d){return _0x33644d?{'count':_0x363c45,'rows':_0x33644d}:null;}})['then'](respondWithResult(_0x1a37e9,null))[_0x76aa('0x3b')](handleError(_0x1a37e9,null));};exports[_0x76aa('0x8b')]=function(_0x4830ea,_0x20638f){var _0x2b2f27=moment()[_0x76aa('0x6e')](_0x76aa('0x8c'));var _0x1a5297,_0x487c28;return db[_0x76aa('0x29')]['find']({'where':{'id':_0x4830ea[_0x76aa('0x46')]['id']}})[_0x76aa('0x17')](handleEntityNotFound(_0x20638f,null))[_0x76aa('0x17')](function(_0x2f2a27){if(_0x2f2a27){_0x487c28=_0x2f2a27;return _0x2f2a27['addLists'](_0x4830ea[_0x76aa('0x3d')][_0x76aa('0x73')],_[_0x76aa('0x47')](_0x4830ea[_0x76aa('0x3d')],[_0x76aa('0x73'),'id'])||{});}return null;})[_0x76aa('0x84')](function(_0xca12fa){var _0xb0a4e1;_0x1a5297=_0xca12fa||[];var _0x1f7f1d=[];if(_0xca12fa){for(var _0x413528=0x0;_0x413528<_0xca12fa[_0x76aa('0x37')];_0x413528+=0x1){var _0x39de41=_0xca12fa[_0x413528][_0x76aa('0x18')]({'plain':!![]});_0x487c28[_0x76aa('0x8d')]=_0x4830ea['body']['dialCheckDuplicateType']?_0x4830ea[_0x76aa('0x3d')][_0x76aa('0x8d')]:_0x487c28['dialCheckDuplicateType'];switch(_0x487c28[_0x76aa('0x8d')]){case'always':_0xb0a4e1=squel[_0x76aa('0x8e')]()[_0x76aa('0x8f')](_0x76aa('0x90'))[_0x76aa('0x91')]([_0x76aa('0x92'),_0x76aa('0x93'),_0x76aa('0x94'),_0x76aa('0x95'),'VoiceQueueId',_0x76aa('0x49'),_0x76aa('0x48')],squel['select']()['field'](_0x76aa('0x92'),_0x76aa('0x92'))[_0x76aa('0x74')]('\x27'+_0x2b2f27+'\x27',_0x76aa('0x93'))[_0x76aa('0x74')]('id','ContactId')[_0x76aa('0x74')](_0x39de41['CmListId'][_0x76aa('0x96')](),_0x76aa('0x95'))[_0x76aa('0x74')](_0x4830ea[_0x76aa('0x46')]['id'][_0x76aa('0x96')](),_0x76aa('0x51'))[_0x76aa('0x74')]('\x27'+_0x2b2f27+'\x27',_0x76aa('0x49'))[_0x76aa('0x74')]('\x27'+_0x2b2f27+'\x27',_0x76aa('0x48'))[_0x76aa('0x76')](_0x76aa('0x97'))[_0x76aa('0x2d')]('deletedAt\x20IS\x20NULL')[_0x76aa('0x2d')]('ListId\x20=\x20?',_0x39de41['CmListId']['toString']())[_0x76aa('0x2d')]('phone\x20IS\x20NOT\x20NULL')['where']('phone\x20NOT\x20IN\x20(?)',squel['select']()[_0x76aa('0x74')](_0x76aa('0x98'))['from'](_0x76aa('0x99'))[_0x76aa('0x2d')](_0x76aa('0x7a'),_0x4830ea['params']['id']['toString']()))['where'](_0x76aa('0x9a'),squel['select']()[_0x76aa('0x74')](_0x76aa('0x9b'))['from'](_0x76aa('0x90'))[_0x76aa('0x2d')]('VoiceQueueId\x20=\x20?',_0x4830ea[_0x76aa('0x46')]['id'][_0x76aa('0x96')]())))[_0x76aa('0x96')]();break;case _0x76aa('0x9c'):_0xb0a4e1=squel[_0x76aa('0x8e')]()[_0x76aa('0x8f')](_0x76aa('0x90'))[_0x76aa('0x91')](['phone',_0x76aa('0x93'),_0x76aa('0x94'),_0x76aa('0x95'),_0x76aa('0x51'),_0x76aa('0x49'),_0x76aa('0x48')],squel[_0x76aa('0x9d')]()[_0x76aa('0x74')](_0x76aa('0x92'),_0x76aa('0x92'))['field']('\x27'+_0x2b2f27+'\x27',_0x76aa('0x93'))[_0x76aa('0x74')]('id',_0x76aa('0x94'))['field'](_0x39de41['CmListId']['toString'](),_0x76aa('0x95'))[_0x76aa('0x74')](_0x4830ea['params']['id'][_0x76aa('0x96')](),'VoiceQueueId')['field']('\x27'+_0x2b2f27+'\x27',_0x76aa('0x49'))[_0x76aa('0x74')]('\x27'+_0x2b2f27+'\x27','updatedAt')[_0x76aa('0x76')](_0x76aa('0x97'))[_0x76aa('0x2d')]('deletedAt\x20IS\x20NULL')[_0x76aa('0x2d')](_0x76aa('0x9e'),_0x39de41[_0x76aa('0x9f')][_0x76aa('0x96')]())[_0x76aa('0x2d')](_0x76aa('0xa0'))[_0x76aa('0x2d')](_0x76aa('0x9a'),squel[_0x76aa('0x9d')]()[_0x76aa('0x74')](_0x76aa('0x9b'))['from'](_0x76aa('0x90'))[_0x76aa('0x2d')](_0x76aa('0x7a'),_0x4830ea['params']['id']['toString']())))[_0x76aa('0x96')]();break;default:_0xb0a4e1=squel[_0x76aa('0x8e')]()[_0x76aa('0x8f')]('cm_hopper')[_0x76aa('0x91')]([_0x76aa('0x92'),_0x76aa('0x93'),_0x76aa('0x94'),_0x76aa('0x95'),_0x76aa('0x51'),_0x76aa('0x49'),_0x76aa('0x48')],squel[_0x76aa('0x9d')]()[_0x76aa('0x74')](_0x76aa('0x92'),_0x76aa('0x92'))[_0x76aa('0x74')]('\x27'+_0x2b2f27+'\x27',_0x76aa('0x93'))['field']('id',_0x76aa('0x94'))['field'](_0x39de41[_0x76aa('0x9f')]['toString'](),_0x76aa('0x95'))[_0x76aa('0x74')](_0x4830ea[_0x76aa('0x46')]['id']['toString'](),_0x76aa('0x51'))[_0x76aa('0x74')]('\x27'+_0x2b2f27+'\x27',_0x76aa('0x49'))[_0x76aa('0x74')]('\x27'+_0x2b2f27+'\x27',_0x76aa('0x48'))[_0x76aa('0x76')]('cm_contacts')['where'](_0x76aa('0xa1'))[_0x76aa('0x2d')](_0x76aa('0x9e'),_0x39de41['CmListId']['toString']())[_0x76aa('0x2d')](_0x76aa('0xa0')))[_0x76aa('0x96')]();}_0x1f7f1d['push'](db['sequelize'][_0x76aa('0x33')](_0xb0a4e1));}return BPromise[_0x76aa('0x85')](_0x1f7f1d);}})[_0x76aa('0x17')](function(){var _0xbb19e4=[];var _0x226b44=squel[_0x76aa('0x8e')]()[_0x76aa('0x8f')](_0x76aa('0xa2'))['fromQuery']([_0x76aa('0xa3'),_0x76aa('0x92'),_0x76aa('0xa4'),'createdAt',_0x76aa('0x48')],squel[_0x76aa('0x9d')]()[_0x76aa('0x74')]('h.id')['field'](_0x76aa('0xa5'))['field'](_0x76aa('0xa6'))[_0x76aa('0x74')]('\x27'+_0x2b2f27+'\x27',_0x76aa('0x49'))[_0x76aa('0x74')]('\x27'+_0x2b2f27+'\x27','updatedAt')['from'](_0x76aa('0xa7'),'ci')[_0x76aa('0x78')](_0x76aa('0x90'),'h',_0x76aa('0xa8'))[_0x76aa('0x2d')](_0x76aa('0xa9'),_0x2b2f27)['where'](_0x76aa('0xaa'),_0x76aa('0xab')))[_0x76aa('0x96')]();_0xbb19e4['push'](db[_0x76aa('0x66')][_0x76aa('0x33')](_0x226b44));return BPromise[_0x76aa('0x85')](_0xbb19e4);})['then'](function(){return _0x1a5297;})[_0x76aa('0x17')](respondWithResult(_0x20638f,null))['catch'](handleError(_0x20638f,null));};exports['removeLists']=function(_0xef9ea7,_0x45f21f){return db[_0x76aa('0x29')]['find']({'where':{'id':_0xef9ea7[_0x76aa('0x46')]['id']}})['then'](handleEntityNotFound(_0x45f21f,null))[_0x76aa('0x17')](function(_0x113e70){if(_0x113e70){return _0x113e70['removeLists'](_0xef9ea7[_0x76aa('0x33')]['ids']);}})['then'](function(_0x583d68){if(_0x583d68){return db[_0x76aa('0x53')]['destroy']({'where':{'ListId':_0xef9ea7[_0x76aa('0x33')]['ids'],'VoiceQueueId':_0xef9ea7['params']['id']}})[_0x76aa('0x17')](function(){return _0x583d68;});}})['then'](respondWithStatusCode(_0x45f21f,null))['catch'](handleError(_0x45f21f,null));};exports[_0x76aa('0xac')]=function(_0x3b7370,_0x1c3431){var _0x865a1b={};var _0x132d60={};var _0x1a3074;var _0x3184a2;return db['VoiceQueue']['findOne']({'where':{'id':_0x3b7370[_0x76aa('0x46')]['id']}})[_0x76aa('0x17')](handleEntityNotFound(_0x1c3431,null))[_0x76aa('0x17')](function(_0x274356){if(_0x274356){_0x1a3074=_0x274356;_0x132d60[_0x76aa('0x31')]=_[_0x76aa('0x32')](db[_0x76aa('0xad')][_0x76aa('0x2a')]);_0x132d60[_0x76aa('0x33')]=_['keys'](_0x3b7370['query']);_0x132d60[_0x76aa('0x4c')]=_[_0x76aa('0x35')](_0x132d60[_0x76aa('0x31')],_0x132d60[_0x76aa('0x33')]);_0x865a1b['attributes']=_['intersection'](_0x132d60[_0x76aa('0x31')],qs['fields'](_0x3b7370[_0x76aa('0x33')][_0x76aa('0x36')]));_0x865a1b['attributes']=_0x865a1b[_0x76aa('0x34')][_0x76aa('0x37')]?_0x865a1b[_0x76aa('0x34')]:_0x132d60[_0x76aa('0x31')];_0x865a1b[_0x76aa('0x4e')]=qs['sort'](_0x3b7370[_0x76aa('0x33')][_0x76aa('0x4f')]);_0x865a1b['where']=qs['filters'](_[_0x76aa('0x50')](_0x3b7370[_0x76aa('0x33')],_0x132d60[_0x76aa('0x4c')]));if(_0x3b7370[_0x76aa('0x33')][_0x76aa('0x52')]){_0x865a1b[_0x76aa('0x2d')]=_[_0x76aa('0x39')](_0x865a1b[_0x76aa('0x2d')],{'$or':_[_0x76aa('0x1e')](_0x865a1b[_0x76aa('0x34')],function(_0xbb0ea3){var _0x4978dd={};_0x4978dd[_0xbb0ea3]={'$like':'%'+_0x3b7370[_0x76aa('0x33')][_0x76aa('0x52')]+'%'};return _0x4978dd;})});}_0x865a1b=_[_0x76aa('0x39')]({},_0x865a1b,_0x3b7370[_0x76aa('0x3a')]);return _0x1a3074['getBlackLists'](_0x865a1b);}})['then'](function(_0x4ee1d3){if(_0x4ee1d3){_0x3184a2=_0x4ee1d3['length'];if(!_0x3b7370[_0x76aa('0x33')][_0x76aa('0x58')](_0x76aa('0x4d'))){_0x865a1b[_0x76aa('0x12')]=qs[_0x76aa('0x12')](_0x3b7370[_0x76aa('0x33')][_0x76aa('0x12')]);_0x865a1b['offset']=qs['offset'](_0x3b7370[_0x76aa('0x33')]['offset']);}return _0x1a3074[_0x76aa('0xac')](_0x865a1b);}})[_0x76aa('0x17')](function(_0x3bc149){if(_0x3bc149){return _0x3bc149?{'count':_0x3184a2,'rows':_0x3bc149}:null;}})['then'](respondWithResult(_0x1c3431,null))[_0x76aa('0x3b')](handleError(_0x1c3431,null));};exports[_0x76aa('0xae')]=function(_0x29e112,_0x3fd683){var _0x5c2c4d;return db[_0x76aa('0x29')][_0x76aa('0x22')]({'where':{'id':_0x29e112[_0x76aa('0x46')]['id']}})['then'](handleEntityNotFound(_0x3fd683,null))[_0x76aa('0x17')](function(_0xcb041d){if(_0xcb041d){return _0xcb041d[_0x76aa('0xae')](_0x29e112[_0x76aa('0x3d')][_0x76aa('0x73')],_[_0x76aa('0x47')](_0x29e112[_0x76aa('0x3d')],['ids','id'])||{});}return null;})['spread'](function(_0x72b9a){var _0x29db0f;_0x5c2c4d=_0x72b9a||[];var _0x28a212=[];if(_0x72b9a){for(var _0x242cd6=0x0;_0x242cd6<_0x72b9a[_0x76aa('0x37')];_0x242cd6+=0x1){var _0xeb428a=_0x72b9a[_0x242cd6][_0x76aa('0x18')]({'plain':!![]});_0x29db0f=squel[_0x76aa('0x8e')]()[_0x76aa('0x8f')](_0x76aa('0xaf'))[_0x76aa('0x91')]([_0x76aa('0x92'),_0x76aa('0x94'),_0x76aa('0x95'),_0x76aa('0x51'),_0x76aa('0x49'),_0x76aa('0x48')],squel[_0x76aa('0x9d')]()[_0x76aa('0x74')](_0x76aa('0x92'),_0x76aa('0x92'))[_0x76aa('0x74')]('id',_0x76aa('0x94'))[_0x76aa('0x74')](_0xeb428a[_0x76aa('0x9f')][_0x76aa('0x96')](),_0x76aa('0x95'))[_0x76aa('0x74')](_0x29e112['params']['id'][_0x76aa('0x96')](),_0x76aa('0x51'))[_0x76aa('0x74')](_0x76aa('0xb0'),'createdAt')[_0x76aa('0x74')](_0x76aa('0xb0'),_0x76aa('0x48'))['from'](_0x76aa('0x97'))[_0x76aa('0x2d')]('deletedAt\x20IS\x20NULL')[_0x76aa('0x2d')]('ListId\x20=\x20?',_0xeb428a[_0x76aa('0x9f')][_0x76aa('0x96')]())[_0x76aa('0x2d')](_0x76aa('0xa0')))['toString']();_0x28a212[_0x76aa('0x7c')](db['sequelize'][_0x76aa('0x33')](_0x29db0f));}return BPromise['all'](_0x28a212);}})[_0x76aa('0x17')](function(){return _0x5c2c4d;})['then'](respondWithResult(_0x3fd683,null))[_0x76aa('0x3b')](handleError(_0x3fd683,null));};exports[_0x76aa('0xb1')]=function(_0x140ee1,_0x3d9e9e){return db[_0x76aa('0x29')][_0x76aa('0x22')]({'where':{'id':_0x140ee1['params']['id']}})[_0x76aa('0x17')](handleEntityNotFound(_0x3d9e9e,null))[_0x76aa('0x17')](function(_0x139e67){if(_0x139e67){return _0x139e67[_0x76aa('0xb1')](_0x140ee1['query'][_0x76aa('0x73')]);}})[_0x76aa('0x17')](function(_0x506cad){if(_0x506cad){return db['CmHopperBlack'][_0x76aa('0x25')]({'where':{'ListId':_0x140ee1[_0x76aa('0x33')][_0x76aa('0x73')],'VoiceQueueId':_0x140ee1[_0x76aa('0x46')]['id']}})['then'](function(){return _0x506cad;});}})['then'](respondWithStatusCode(_0x3d9e9e,null))[_0x76aa('0x3b')](handleError(_0x3d9e9e,null));}; \ No newline at end of file +var _0x4b84=['type','find','UserProfileResource','stack','name','send','index','rawAttributes','fieldName','key','getOptions','where','VoiceQueue','include','findAll','rows','catch','show','params','model','keys','query','filters','intersection','attributes','fields','length','includeAll','merge','options','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','autoAssociation','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','clone','omit','createdAt','updatedAt','userProfileId','findOne','hasOwnProperty','nolimit','order','sort','VoiceQueueId','CmHopper','getHopperHistories','pick','CmHopperHistory','CmHopperFinal','CmHopperBlack','getTeams','Team','addTeams','User','Agents','voicePause','interface','forEach','penalty','transaction','TeamVoiceQueue','each','UserVoiceQueue','UserVoiceQueueRt','upsert','format','SIP/%s','emit','ids','field','from','user_has_teams','ut.TeamId\x20=\x20tq.TeamId','VoiceQueueId\x20=\x20?','ut.UserId\x20=\x20?','push','toString','sequelize','SELECT','TeamId','all','removeTeams','isEmpty','removeAgents','addAgents','spread','userVoiceQueue:save','online','isNil','isArray','userVoiceQueue:remove','getAgents','getMembers','getLists','CmList','addLists','dialCheckDuplicateType','fromQuery','phone','scheduledAt','ContactId','ListId','select','cm_contacts','deletedAt\x20IS\x20NULL','ListId\x20=\x20?','CmListId','phone\x20IS\x20NOT\x20NULL','phone\x20NOT\x20IN\x20(?)','COALESCE(calleridnum,\x27\x27)','cm_hopper_final','COALESCE(phone,\x27\x27)','cm_hopper','onlyIfOpen','insert','into','CmHopperId','OrderBy','h.id','ci.item','ci.OrderBy+1','cm_contact_has_items','h.scheduledat=?','ci.ItemClass=?','removeLists','getBlackLists','NOW()','removeBlackLists','moment','bluebird','squel','../../config/logger','api','../../config/environment','redis','socket.io-emitter','./voiceQueue.socket','sendStatus','end','status','json','undefined','count','offset','limit','update','destroy','then','get','VoiceQueues','inbound','QueueCampaigns','outbound','filter','ignore','map','value'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x4b84,0x1cc));var _0x44b8=function(_0x2c0dc0,_0x19900d){_0x2c0dc0=_0x2c0dc0-0x0;var _0x4c0990=_0x4b84[_0x2c0dc0];return _0x4c0990;};'use strict';var moment=require(_0x44b8('0x0'));var BPromise=require(_0x44b8('0x1'));var util=require('util');var _=require('lodash');var squel=require(_0x44b8('0x2'));var Redis=require('ioredis');var qs=require('../../components/parsers/qs');var logger=require(_0x44b8('0x3'))(_0x44b8('0x4'));var config=require(_0x44b8('0x5'));var db=require('../../mysqldb')['db'];config['redis']=_['defaults'](config[_0x44b8('0x6')],{'host':'localhost','port':0x18eb});var socket=require(_0x44b8('0x7'))(new Redis(config['redis']));require(_0x44b8('0x8'))['register'](socket);function respondWithStatusCode(_0x5034b6,_0x41d515){_0x41d515=_0x41d515||0xcc;return function(_0x42319d){if(_0x42319d){return _0x5034b6[_0x44b8('0x9')](_0x41d515);}return _0x5034b6['status'](_0x41d515)[_0x44b8('0xa')]();};}function respondWithResult(_0x2cc74b,_0x4315f6){_0x4315f6=_0x4315f6||0xc8;return function(_0x9b6048){if(_0x9b6048){return _0x2cc74b[_0x44b8('0xb')](_0x4315f6)[_0x44b8('0xc')](_0x9b6048);}};}function respondWithFilteredResult(_0xe9a025,_0x4ae8a1){return function(_0x147529){if(_0x147529){var _0x4301a6=typeof _0x4ae8a1['offset']===_0x44b8('0xd')&&typeof _0x4ae8a1['limit']===_0x44b8('0xd');var _0x18d642=_0x147529['count'];var _0x63e8f6=_0x4301a6?0x0:_0x4ae8a1['offset'];var _0x54fa95=_0x4301a6?_0x147529[_0x44b8('0xe')]:_0x4ae8a1[_0x44b8('0xf')]+_0x4ae8a1[_0x44b8('0x10')];var _0x41ab46;if(_0x54fa95>=_0x18d642){_0x54fa95=_0x18d642;_0x41ab46=0xc8;}else{_0x41ab46=0xce;}_0xe9a025['status'](_0x41ab46);return _0xe9a025['set']('Content-Range',_0x63e8f6+'-'+_0x54fa95+'/'+_0x18d642)[_0x44b8('0xc')](_0x147529);}return null;};}function saveUpdates(_0x5b7803){return function(_0x28ef36){if(_0x28ef36){return _0x28ef36[_0x44b8('0x11')](_0x5b7803)['then'](function(_0x36743e){return _0x36743e;});}return null;};}function removeEntity(_0xe3de8f){return function(_0x5103f5){if(_0x5103f5){return _0x5103f5[_0x44b8('0x12')]()[_0x44b8('0x13')](function(){var _0x4b600f=_0x5103f5[_0x44b8('0x14')]({'plain':!![]});var _0x8b4301=[{'name':_0x44b8('0x15'),'value':_0x44b8('0x16'),'ignore':![]},{'name':_0x44b8('0x17'),'value':_0x44b8('0x18'),'ignore':![]}];var _0x452f2f=_(_0x8b4301)[_0x44b8('0x19')](_0x44b8('0x1a'))[_0x44b8('0x1b')](_0x44b8('0x1c'))[_0x44b8('0x1c')]();if(_['includes'](_0x452f2f,_0x4b600f[_0x44b8('0x1d')])){return;}var _0x3a8aa4=_[_0x44b8('0x1e')](_0x8b4301,[_0x44b8('0x1c'),_0x4b600f[_0x44b8('0x1d')]])['name'];return db[_0x44b8('0x1f')]['destroy']({'where':{'type':_0x3a8aa4,'resourceId':_0x4b600f['id']}})[_0x44b8('0x13')](function(){return _0x5103f5;});})[_0x44b8('0x13')](function(){_0xe3de8f[_0x44b8('0xb')](0xcc)[_0x44b8('0xa')]();});}};}function handleEntityNotFound(_0x230a3d){return function(_0x59acbc){if(!_0x59acbc){_0x230a3d[_0x44b8('0x9')](0x194);}return _0x59acbc;};}function handleError(_0x502acf,_0x41d673){_0x41d673=_0x41d673||0x1f4;return function(_0x350482){logger['error'](_0x350482[_0x44b8('0x20')]);if(_0x350482[_0x44b8('0x21')]){delete _0x350482[_0x44b8('0x21')];}_0x502acf['status'](_0x41d673)[_0x44b8('0x22')](_0x350482);};}exports[_0x44b8('0x23')]=function(_0x53d9c7,_0x2e0174){var _0x4a182d={};var _0xfb0028={'count':0x0,'rows':[]};var _0x5a544c=_['map'](db['VoiceQueue'][_0x44b8('0x24')],function(_0x29b18d){return{'name':_0x29b18d[_0x44b8('0x25')],'type':_0x29b18d[_0x44b8('0x1d')][_0x44b8('0x26')]};});_0x4a182d=qs[_0x44b8('0x27')](_0x5a544c,_0x53d9c7);var _0x2cf205={'where':_0x4a182d[_0x44b8('0x28')]};return db[_0x44b8('0x29')][_0x44b8('0xe')](_0x2cf205)[_0x44b8('0x13')](function(_0x417d81){_0xfb0028[_0x44b8('0xe')]=_0x417d81;_0x4a182d['include']=qs[_0x44b8('0x2a')](_0x53d9c7['query']);return db[_0x44b8('0x29')][_0x44b8('0x2b')](_0x4a182d);})[_0x44b8('0x13')](function(_0xb64609){_0xfb0028[_0x44b8('0x2c')]=_0xb64609;return _0xfb0028;})['then'](respondWithFilteredResult(_0x2e0174,_0x4a182d))[_0x44b8('0x2d')](handleError(_0x2e0174,null));};exports[_0x44b8('0x2e')]=function(_0x26265f,_0x339f0f){var _0x46b008={'raw':![],'where':{'id':_0x26265f[_0x44b8('0x2f')]['id']}},_0x5f541d={};_0x5f541d[_0x44b8('0x30')]=_[_0x44b8('0x31')](db[_0x44b8('0x29')][_0x44b8('0x24')]);_0x5f541d[_0x44b8('0x32')]=_[_0x44b8('0x31')](_0x26265f[_0x44b8('0x32')]);_0x5f541d[_0x44b8('0x33')]=_[_0x44b8('0x34')](_0x5f541d[_0x44b8('0x30')],_0x5f541d[_0x44b8('0x32')]);_0x46b008[_0x44b8('0x35')]=_[_0x44b8('0x34')](_0x5f541d[_0x44b8('0x30')],qs[_0x44b8('0x36')](_0x26265f[_0x44b8('0x32')][_0x44b8('0x36')]));_0x46b008[_0x44b8('0x35')]=_0x46b008[_0x44b8('0x35')][_0x44b8('0x37')]?_0x46b008[_0x44b8('0x35')]:_0x5f541d['model'];if(_0x26265f[_0x44b8('0x32')][_0x44b8('0x38')]){_0x46b008['include']=[{'all':!![]}];}_0x46b008=_[_0x44b8('0x39')]({},_0x46b008,_0x26265f[_0x44b8('0x3a')]);return db[_0x44b8('0x29')][_0x44b8('0x1e')](_0x46b008)['then'](handleEntityNotFound(_0x339f0f,null))[_0x44b8('0x13')](respondWithResult(_0x339f0f,null))[_0x44b8('0x2d')](handleError(_0x339f0f,null));};exports[_0x44b8('0x3b')]=function(_0x1ee3cc,_0x9cb2a){return db[_0x44b8('0x29')][_0x44b8('0x3b')](_0x1ee3cc[_0x44b8('0x3c')],{})[_0x44b8('0x13')](function(_0x3d1be1){var _0x1c9983=_0x1ee3cc[_0x44b8('0x3d')][_0x44b8('0x14')]({'plain':!![]});if(!_0x1c9983)throw new Error(_0x44b8('0x3e'));if(_0x1c9983[_0x44b8('0x3f')]===_0x44b8('0x3d')){var _0x57d8c4=_0x3d1be1[_0x44b8('0x14')]({'plain':!![]});var _0x43e43a=[{'name':_0x44b8('0x15'),'value':'inbound'},{'name':_0x44b8('0x17'),'value':_0x44b8('0x18')}];var _0x229cc9=_['find'](_0x43e43a,[_0x44b8('0x1c'),_0x57d8c4[_0x44b8('0x1d')]])[_0x44b8('0x21')];return db[_0x44b8('0x40')][_0x44b8('0x1e')]({'where':{'name':_0x229cc9,'userProfileId':_0x1c9983['userProfileId']},'raw':!![]})['then'](function(_0x215f7b){if(_0x215f7b&&_0x215f7b[_0x44b8('0x41')]===0x0){return db[_0x44b8('0x1f')][_0x44b8('0x3b')]({'name':_0x57d8c4[_0x44b8('0x21')],'resourceId':_0x57d8c4['id'],'type':_0x215f7b[_0x44b8('0x21')],'sectionId':_0x215f7b['id']},{})[_0x44b8('0x13')](function(){return _0x3d1be1;});}else{return _0x3d1be1;}})[_0x44b8('0x2d')](function(_0x455fd6){logger[_0x44b8('0x42')](_0x44b8('0x43'),_0x455fd6);throw _0x455fd6;});}return _0x3d1be1;})[_0x44b8('0x13')](respondWithResult(_0x9cb2a,0xc9))[_0x44b8('0x2d')](handleError(_0x9cb2a,null));};exports[_0x44b8('0x44')]=function(_0x149731,_0x60eeb2){var _0xce06dc={'where':{'id':_0x149731[_0x44b8('0x2f')]['id']}},_0x3b3d5d={};_0x3b3d5d['model']=_['keys'](db[_0x44b8('0x29')][_0x44b8('0x24')]);_0xce06dc[_0x44b8('0x35')]=_[_0x44b8('0x34')](_0x3b3d5d[_0x44b8('0x30')],qs[_0x44b8('0x36')](_0x149731[_0x44b8('0x32')]['fields']));_0xce06dc[_0x44b8('0x35')]=_0xce06dc['attributes'][_0x44b8('0x37')]?_0xce06dc[_0x44b8('0x35')]:_0x3b3d5d[_0x44b8('0x30')];if(_0x149731[_0x44b8('0x32')][_0x44b8('0x38')]){_0xce06dc[_0x44b8('0x2a')]=[{'all':!![]}];}_0xce06dc=_['merge']({},_0xce06dc,_0x149731[_0x44b8('0x3a')]);return db[_0x44b8('0x29')][_0x44b8('0x1e')](_0xce06dc)[_0x44b8('0x13')](handleEntityNotFound(_0x60eeb2,null))['then'](function(_0x4e4ed1){if(_0x4e4ed1){var _0x2f549d=_0x4e4ed1[_0x44b8('0x14')]({'plain':!![]});_0x2f549d=qs[_0x44b8('0x45')](_0x2f549d,['id',_0x44b8('0x46'),_0x44b8('0x47')]);_0x149731['body']=_[_0x44b8('0x45')](_0x149731[_0x44b8('0x3c')],['id',_0x44b8('0x46'),_0x44b8('0x47')]);return db[_0x44b8('0x29')]['create'](_['merge'](_0x2f549d,_0x149731[_0x44b8('0x3c')]),{'include':_0x149731['query'][_0x44b8('0x38')]?[{'all':!![]}]:undefined})['then'](function(_0x40164d){var _0x434d6a=_0x149731[_0x44b8('0x3d')][_0x44b8('0x14')]({'plain':!![]});if(!_0x434d6a)throw new Error(_0x44b8('0x3e'));if(_0x434d6a[_0x44b8('0x3f')]===_0x44b8('0x3d')){var _0x533967=_0x40164d[_0x44b8('0x14')]({'plain':!![]});var _0x37b2c2=[{'name':_0x44b8('0x15'),'value':'inbound'},{'name':_0x44b8('0x17'),'value':_0x44b8('0x18')}];var _0x45f9a0=_[_0x44b8('0x1e')](_0x37b2c2,['value',_0x533967[_0x44b8('0x1d')]])[_0x44b8('0x21')];return db['UserProfileSection'][_0x44b8('0x1e')]({'where':{'name':_0x45f9a0,'userProfileId':_0x434d6a[_0x44b8('0x48')]},'raw':!![]})[_0x44b8('0x13')](function(_0x3df6aa){if(_0x3df6aa&&_0x3df6aa[_0x44b8('0x41')]===0x0){return db['UserProfileResource']['create']({'name':_0x533967[_0x44b8('0x21')],'resourceId':_0x533967['id'],'type':_0x3df6aa[_0x44b8('0x21')],'sectionId':_0x3df6aa['id']},{})[_0x44b8('0x13')](function(){return _0x40164d;});}else{return _0x40164d;}})[_0x44b8('0x2d')](function(_0x765e45){logger[_0x44b8('0x42')](_0x44b8('0x43'),_0x765e45);throw _0x765e45;});}return _0x40164d;});}})[_0x44b8('0x13')](respondWithResult(_0x60eeb2,0xc9))[_0x44b8('0x2d')](handleError(_0x60eeb2,null));};exports[_0x44b8('0x11')]=function(_0x16c628,_0x3f7576){if(_0x16c628['body']['id']){delete _0x16c628[_0x44b8('0x3c')]['id'];}return db[_0x44b8('0x29')][_0x44b8('0x1e')]({'where':{'id':_0x16c628[_0x44b8('0x2f')]['id']}})[_0x44b8('0x13')](handleEntityNotFound(_0x3f7576,null))[_0x44b8('0x13')](saveUpdates(_0x16c628[_0x44b8('0x3c')],null))[_0x44b8('0x13')](respondWithResult(_0x3f7576,null))[_0x44b8('0x2d')](handleError(_0x3f7576,null));};exports[_0x44b8('0x12')]=function(_0x2ecff9,_0x15bcba){return db[_0x44b8('0x29')][_0x44b8('0x1e')]({'where':{'id':_0x2ecff9[_0x44b8('0x2f')]['id']}})[_0x44b8('0x13')](handleEntityNotFound(_0x15bcba,null))[_0x44b8('0x13')](removeEntity(_0x15bcba,null))[_0x44b8('0x2d')](handleError(_0x15bcba,null));};exports['getHoppers']=function(_0x1ec516,_0x3aac51){var _0x10e519={'raw':![],'where':{}};var _0x2b37e={};var _0x51f763={'count':0x0,'rows':[]};return db[_0x44b8('0x29')][_0x44b8('0x49')]({'where':{'id':_0x1ec516['params']['id']}})[_0x44b8('0x13')](handleEntityNotFound(_0x3aac51,null))[_0x44b8('0x13')](function(_0x5df821){if(_0x5df821){_0x2b37e[_0x44b8('0x30')]=_[_0x44b8('0x31')](db['CmHopper'][_0x44b8('0x24')]);_0x2b37e[_0x44b8('0x32')]=_[_0x44b8('0x31')](_0x1ec516['query']);_0x2b37e[_0x44b8('0x33')]=_['intersection'](_0x2b37e[_0x44b8('0x30')],_0x2b37e['query']);_0x10e519[_0x44b8('0x35')]=_[_0x44b8('0x34')](_0x2b37e[_0x44b8('0x30')],qs[_0x44b8('0x36')](_0x1ec516[_0x44b8('0x32')][_0x44b8('0x36')]));_0x10e519['attributes']=_0x10e519[_0x44b8('0x35')]['length']?_0x10e519[_0x44b8('0x35')]:_0x2b37e[_0x44b8('0x30')];if(!_0x1ec516['query'][_0x44b8('0x4a')](_0x44b8('0x4b'))){_0x10e519[_0x44b8('0x10')]=qs[_0x44b8('0x10')](_0x1ec516[_0x44b8('0x32')][_0x44b8('0x10')]);_0x10e519[_0x44b8('0xf')]=qs[_0x44b8('0xf')](_0x1ec516[_0x44b8('0x32')][_0x44b8('0xf')]);}_0x10e519[_0x44b8('0x4c')]=qs[_0x44b8('0x4d')](_0x1ec516['query'][_0x44b8('0x4d')]);_0x10e519[_0x44b8('0x28')]=qs[_0x44b8('0x33')](_['pick'](_0x1ec516[_0x44b8('0x32')],_0x2b37e[_0x44b8('0x33')]));_0x10e519['where'][_0x44b8('0x4e')]=_0x5df821['id'];if(_0x1ec516[_0x44b8('0x32')][_0x44b8('0x19')]){_0x10e519[_0x44b8('0x28')]=_[_0x44b8('0x39')](_0x10e519['where'],{'$or':_[_0x44b8('0x1b')](_0x10e519[_0x44b8('0x35')],function(_0x279753){var _0x270224={};_0x270224[_0x279753]={'$like':'%'+_0x1ec516[_0x44b8('0x32')][_0x44b8('0x19')]+'%'};return _0x270224;})});}_0x10e519=_[_0x44b8('0x39')]({},_0x10e519,_0x1ec516[_0x44b8('0x3a')]);return db['CmHopper'][_0x44b8('0xe')]({'where':_0x10e519[_0x44b8('0x28')]})[_0x44b8('0x13')](function(_0x3ce76e){_0x51f763['count']=_0x3ce76e;if(_0x1ec516['query']['includeAll']){_0x10e519[_0x44b8('0x2a')]=[{'all':!![]}];}return db[_0x44b8('0x4f')][_0x44b8('0x2b')](_0x10e519);})[_0x44b8('0x13')](function(_0x32e630){_0x51f763['rows']=_0x32e630;return _0x51f763;});}})[_0x44b8('0x13')](respondWithFilteredResult(_0x3aac51,_0x10e519))['catch'](handleError(_0x3aac51,null));};exports[_0x44b8('0x50')]=function(_0x155bcf,_0xea2c3e){var _0x5da034={'raw':!![],'where':{}};var _0x4cac12={};var _0xb4c6dc={'count':0x0,'rows':[]};return db[_0x44b8('0x29')][_0x44b8('0x49')]({'where':{'id':_0x155bcf['params']['id']}})[_0x44b8('0x13')](handleEntityNotFound(_0xea2c3e,null))[_0x44b8('0x13')](function(_0x1258c2){if(_0x1258c2){_0x4cac12[_0x44b8('0x30')]=_[_0x44b8('0x31')](db['CmHopperHistory'][_0x44b8('0x24')]);_0x4cac12[_0x44b8('0x32')]=_[_0x44b8('0x31')](_0x155bcf[_0x44b8('0x32')]);_0x4cac12[_0x44b8('0x33')]=_['intersection'](_0x4cac12[_0x44b8('0x30')],_0x4cac12[_0x44b8('0x32')]);_0x5da034[_0x44b8('0x35')]=_[_0x44b8('0x34')](_0x4cac12[_0x44b8('0x30')],qs[_0x44b8('0x36')](_0x155bcf[_0x44b8('0x32')]['fields']));_0x5da034[_0x44b8('0x35')]=_0x5da034[_0x44b8('0x35')]['length']?_0x5da034[_0x44b8('0x35')]:_0x4cac12[_0x44b8('0x30')];if(!_0x155bcf['query'][_0x44b8('0x4a')]('nolimit')){_0x5da034['limit']=qs[_0x44b8('0x10')](_0x155bcf[_0x44b8('0x32')][_0x44b8('0x10')]);_0x5da034['offset']=qs['offset'](_0x155bcf['query'][_0x44b8('0xf')]);}_0x5da034[_0x44b8('0x4c')]=qs[_0x44b8('0x4d')](_0x155bcf[_0x44b8('0x32')][_0x44b8('0x4d')]);_0x5da034[_0x44b8('0x28')]=qs[_0x44b8('0x33')](_[_0x44b8('0x51')](_0x155bcf['query'],_0x4cac12[_0x44b8('0x33')]));_0x5da034['where']['VoiceQueueId']=_0x1258c2['id'];if(_0x155bcf['query'][_0x44b8('0x19')]){_0x5da034['where']=_[_0x44b8('0x39')](_0x5da034[_0x44b8('0x28')],{'$or':_[_0x44b8('0x1b')](_0x5da034[_0x44b8('0x35')],function(_0x3a9780){var _0x245ba3={};_0x245ba3[_0x3a9780]={'$like':'%'+_0x155bcf[_0x44b8('0x32')][_0x44b8('0x19')]+'%'};return _0x245ba3;})});}_0x5da034=_['merge']({},_0x5da034,_0x155bcf[_0x44b8('0x3a')]);return db[_0x44b8('0x52')][_0x44b8('0xe')]({'where':_0x5da034[_0x44b8('0x28')]})[_0x44b8('0x13')](function(_0xee44b3){_0xb4c6dc[_0x44b8('0xe')]=_0xee44b3;if(_0x155bcf[_0x44b8('0x32')][_0x44b8('0x38')]){_0x5da034['include']=[{'all':!![]}];}return db['CmHopperHistory'][_0x44b8('0x2b')](_0x5da034);})['then'](function(_0x531d65){_0xb4c6dc[_0x44b8('0x2c')]=_0x531d65;return _0xb4c6dc;});}})[_0x44b8('0x13')](respondWithFilteredResult(_0xea2c3e,_0x5da034))['catch'](handleError(_0xea2c3e,null));};exports['getHopperFinals']=function(_0x4b22e7,_0x2e0289){var _0x4860af={'raw':!![],'where':{}};var _0x353ff1={};var _0x2812da={'count':0x0,'rows':[]};return db[_0x44b8('0x29')][_0x44b8('0x49')]({'where':{'id':_0x4b22e7[_0x44b8('0x2f')]['id']}})[_0x44b8('0x13')](handleEntityNotFound(_0x2e0289,null))[_0x44b8('0x13')](function(_0x3a7229){if(_0x3a7229){_0x353ff1[_0x44b8('0x30')]=_[_0x44b8('0x31')](db[_0x44b8('0x53')][_0x44b8('0x24')]);_0x353ff1[_0x44b8('0x32')]=_[_0x44b8('0x31')](_0x4b22e7['query']);_0x353ff1[_0x44b8('0x33')]=_[_0x44b8('0x34')](_0x353ff1[_0x44b8('0x30')],_0x353ff1[_0x44b8('0x32')]);_0x4860af[_0x44b8('0x35')]=_[_0x44b8('0x34')](_0x353ff1[_0x44b8('0x30')],qs[_0x44b8('0x36')](_0x4b22e7[_0x44b8('0x32')][_0x44b8('0x36')]));_0x4860af[_0x44b8('0x35')]=_0x4860af[_0x44b8('0x35')][_0x44b8('0x37')]?_0x4860af['attributes']:_0x353ff1[_0x44b8('0x30')];if(!_0x4b22e7[_0x44b8('0x32')][_0x44b8('0x4a')]('nolimit')){_0x4860af['limit']=qs[_0x44b8('0x10')](_0x4b22e7[_0x44b8('0x32')][_0x44b8('0x10')]);_0x4860af['offset']=qs[_0x44b8('0xf')](_0x4b22e7[_0x44b8('0x32')][_0x44b8('0xf')]);}_0x4860af[_0x44b8('0x4c')]=qs[_0x44b8('0x4d')](_0x4b22e7[_0x44b8('0x32')][_0x44b8('0x4d')]);_0x4860af[_0x44b8('0x28')]=qs['filters'](_[_0x44b8('0x51')](_0x4b22e7[_0x44b8('0x32')],_0x353ff1[_0x44b8('0x33')]));_0x4860af[_0x44b8('0x28')][_0x44b8('0x4e')]=_0x3a7229['id'];if(_0x4b22e7[_0x44b8('0x32')][_0x44b8('0x19')]){_0x4860af['where']=_['merge'](_0x4860af['where'],{'$or':_[_0x44b8('0x1b')](_0x4860af[_0x44b8('0x35')],function(_0x2d74ee){var _0x312f4c={};_0x312f4c[_0x2d74ee]={'$like':'%'+_0x4b22e7[_0x44b8('0x32')][_0x44b8('0x19')]+'%'};return _0x312f4c;})});}_0x4860af=_[_0x44b8('0x39')]({},_0x4860af,_0x4b22e7[_0x44b8('0x3a')]);return db[_0x44b8('0x53')]['count']({'where':_0x4860af[_0x44b8('0x28')]})[_0x44b8('0x13')](function(_0x4b8036){_0x2812da['count']=_0x4b8036;if(_0x4b22e7[_0x44b8('0x32')]['includeAll']){_0x4860af[_0x44b8('0x2a')]=[{'all':!![]}];}return db[_0x44b8('0x53')][_0x44b8('0x2b')](_0x4860af);})['then'](function(_0x3f4a2a){_0x2812da[_0x44b8('0x2c')]=_0x3f4a2a;return _0x2812da;});}})[_0x44b8('0x13')](respondWithFilteredResult(_0x2e0289,_0x4860af))[_0x44b8('0x2d')](handleError(_0x2e0289,null));};exports['getHopperBlacks']=function(_0x216030,_0x584ae3){var _0x38c0c5={'raw':!![],'where':{}};var _0x2f2923={};var _0x2d9d62={'count':0x0,'rows':[]};return db[_0x44b8('0x29')][_0x44b8('0x49')]({'where':{'id':_0x216030[_0x44b8('0x2f')]['id']}})[_0x44b8('0x13')](handleEntityNotFound(_0x584ae3,null))['then'](function(_0x4d3b82){if(_0x4d3b82){_0x2f2923['model']=_[_0x44b8('0x31')](db[_0x44b8('0x54')][_0x44b8('0x24')]);_0x2f2923[_0x44b8('0x32')]=_[_0x44b8('0x31')](_0x216030[_0x44b8('0x32')]);_0x2f2923[_0x44b8('0x33')]=_[_0x44b8('0x34')](_0x2f2923[_0x44b8('0x30')],_0x2f2923[_0x44b8('0x32')]);_0x38c0c5[_0x44b8('0x35')]=_[_0x44b8('0x34')](_0x2f2923[_0x44b8('0x30')],qs[_0x44b8('0x36')](_0x216030[_0x44b8('0x32')][_0x44b8('0x36')]));_0x38c0c5[_0x44b8('0x35')]=_0x38c0c5[_0x44b8('0x35')]['length']?_0x38c0c5[_0x44b8('0x35')]:_0x2f2923['model'];if(!_0x216030[_0x44b8('0x32')]['hasOwnProperty']('nolimit')){_0x38c0c5[_0x44b8('0x10')]=qs['limit'](_0x216030['query']['limit']);_0x38c0c5['offset']=qs['offset'](_0x216030[_0x44b8('0x32')][_0x44b8('0xf')]);}_0x38c0c5[_0x44b8('0x4c')]=qs[_0x44b8('0x4d')](_0x216030['query'][_0x44b8('0x4d')]);_0x38c0c5[_0x44b8('0x28')]=qs['filters'](_['pick'](_0x216030[_0x44b8('0x32')],_0x2f2923[_0x44b8('0x33')]));_0x38c0c5[_0x44b8('0x28')]['VoiceQueueId']=_0x4d3b82['id'];if(_0x216030[_0x44b8('0x32')][_0x44b8('0x19')]){_0x38c0c5[_0x44b8('0x28')]=_[_0x44b8('0x39')](_0x38c0c5[_0x44b8('0x28')],{'$or':_[_0x44b8('0x1b')](_0x38c0c5[_0x44b8('0x35')],function(_0x16344b){var _0x21057f={};_0x21057f[_0x16344b]={'$like':'%'+_0x216030['query'][_0x44b8('0x19')]+'%'};return _0x21057f;})});}_0x38c0c5=_[_0x44b8('0x39')]({},_0x38c0c5,_0x216030['options']);return db[_0x44b8('0x54')][_0x44b8('0xe')]({'where':_0x38c0c5[_0x44b8('0x28')]})['then'](function(_0x3a09e4){_0x2d9d62['count']=_0x3a09e4;if(_0x216030[_0x44b8('0x32')][_0x44b8('0x38')]){_0x38c0c5['include']=[{'all':!![]}];}return db[_0x44b8('0x54')][_0x44b8('0x2b')](_0x38c0c5);})[_0x44b8('0x13')](function(_0x37871e){_0x2d9d62['rows']=_0x37871e;return _0x2d9d62;});}})[_0x44b8('0x13')](respondWithFilteredResult(_0x584ae3,_0x38c0c5))[_0x44b8('0x2d')](handleError(_0x584ae3,null));};exports[_0x44b8('0x55')]=function(_0x35d46c,_0x2d4a8a){var _0x1d666e={};var _0x10a66a={};var _0x1e608f;var _0x470f90;return db['VoiceQueue']['findOne']({'where':{'id':_0x35d46c[_0x44b8('0x2f')]['id']}})[_0x44b8('0x13')](handleEntityNotFound(_0x2d4a8a,null))[_0x44b8('0x13')](function(_0x3539f9){if(_0x3539f9){_0x1e608f=_0x3539f9;_0x10a66a[_0x44b8('0x30')]=_['keys'](db[_0x44b8('0x56')]['rawAttributes']);_0x10a66a[_0x44b8('0x32')]=_['keys'](_0x35d46c[_0x44b8('0x32')]);_0x10a66a[_0x44b8('0x33')]=_[_0x44b8('0x34')](_0x10a66a[_0x44b8('0x30')],_0x10a66a[_0x44b8('0x32')]);_0x1d666e[_0x44b8('0x35')]=_[_0x44b8('0x34')](_0x10a66a[_0x44b8('0x30')],qs[_0x44b8('0x36')](_0x35d46c['query'][_0x44b8('0x36')]));_0x1d666e[_0x44b8('0x35')]=_0x1d666e[_0x44b8('0x35')][_0x44b8('0x37')]?_0x1d666e['attributes']:_0x10a66a['model'];_0x1d666e['order']=qs[_0x44b8('0x4d')](_0x35d46c['query']['sort']);_0x1d666e[_0x44b8('0x28')]=qs[_0x44b8('0x33')](_[_0x44b8('0x51')](_0x35d46c[_0x44b8('0x32')],_0x10a66a[_0x44b8('0x33')]));if(_0x35d46c[_0x44b8('0x32')][_0x44b8('0x19')]){_0x1d666e[_0x44b8('0x28')]=_['merge'](_0x1d666e[_0x44b8('0x28')],{'$or':_[_0x44b8('0x1b')](_0x1d666e[_0x44b8('0x35')],function(_0x2594bf){var _0x5f0c0c={};_0x5f0c0c[_0x2594bf]={'$like':'%'+_0x35d46c[_0x44b8('0x32')][_0x44b8('0x19')]+'%'};return _0x5f0c0c;})});}_0x1d666e=_[_0x44b8('0x39')]({},_0x1d666e,_0x35d46c['options']);return _0x1e608f['getTeams'](_0x1d666e);}})[_0x44b8('0x13')](function(_0xae9b10){if(_0xae9b10){_0x470f90=_0xae9b10[_0x44b8('0x37')];if(!_0x35d46c[_0x44b8('0x32')][_0x44b8('0x4a')]('nolimit')){_0x1d666e[_0x44b8('0x10')]=qs[_0x44b8('0x10')](_0x35d46c['query'][_0x44b8('0x10')]);_0x1d666e[_0x44b8('0xf')]=qs[_0x44b8('0xf')](_0x35d46c[_0x44b8('0x32')]['offset']);}return _0x1e608f[_0x44b8('0x55')](_0x1d666e);}})['then'](function(_0x4464d3){if(_0x4464d3){return _0x4464d3?{'count':_0x470f90,'rows':_0x4464d3}:null;}})[_0x44b8('0x13')](respondWithResult(_0x2d4a8a,null))[_0x44b8('0x2d')](handleError(_0x2d4a8a,null));};exports[_0x44b8('0x57')]=function(_0x45ff62,_0x343c5c){var _0x3cb290=_0x45ff62[_0x44b8('0x3c')]['teams'];var _0x2d27bf=_[_0x44b8('0x1b')](_0x3cb290,'id');return db[_0x44b8('0x56')][_0x44b8('0x2b')]({'where':{'id':_0x2d27bf},'attributes':['id'],'include':[{'model':db[_0x44b8('0x58')],'as':_0x44b8('0x59'),'attributes':['id','name','online',_0x44b8('0x5a'),_0x44b8('0x5b')],'raw':!![]}]})['then'](function(_0x41f732){if(_0x41f732){var _0x16074e=_['flatMap'](_0x41f732,function(_0x1ec23e){var _0x3208b4=_0x1ec23e[_0x44b8('0x14')]({'plain':!![]});_0x3208b4[_0x44b8('0x59')][_0x44b8('0x5c')](function(_0x43f416){_0x43f416[_0x44b8('0x5d')]=_[_0x44b8('0x1e')](_0x3cb290,{'id':_0x3208b4['id']})[_0x44b8('0x5d')];});return _0x3208b4[_0x44b8('0x59')];});return db[_0x44b8('0x29')][_0x44b8('0x1e')]({'where':{'id':_0x45ff62[_0x44b8('0x2f')]['id']}})[_0x44b8('0x13')](function(_0x15365d){return db['sequelize'][_0x44b8('0x5e')](function(_0x3d92a9){return _0x15365d[_0x44b8('0x57')](_0x2d27bf,{'transaction':_0x3d92a9})[_0x44b8('0x13')](function(){return BPromise['each'](_0x3cb290,function(_0x611876){return db[_0x44b8('0x5f')]['upsert']({'TeamId':_0x611876['id'],'VoiceQueueId':_0x45ff62[_0x44b8('0x2f')]['id'],'penalty':_0x611876['penalty']},{'transaction':_0x3d92a9});});})[_0x44b8('0x13')](function(){return BPromise[_0x44b8('0x60')](_0x16074e,function(_0x5a508f){return db[_0x44b8('0x61')]['findOrCreate']({'where':{'UserId':_0x5a508f['id'],'VoiceQueueId':_0x45ff62['params']['id']},'defaults':{'penalty':_0x5a508f[_0x44b8('0x5d')]},'transaction':_0x3d92a9});});})[_0x44b8('0x13')](function(){return BPromise['each'](_['filter'](_0x16074e,{'online':!![]}),function(_0x52af57){return db[_0x44b8('0x62')][_0x44b8('0x63')]({'membername':_0x52af57[_0x44b8('0x21')],'UserId':_0x52af57['id'],'queue_name':_0x15365d['name'],'VoiceQueueId':_0x15365d['id'],'interface':_['isNil'](_0x52af57[_0x44b8('0x5b')])?util[_0x44b8('0x64')](_0x44b8('0x65'),_0x52af57[_0x44b8('0x21')]):_0x52af57[_0x44b8('0x5b')],'paused':_0x52af57[_0x44b8('0x5a')]||![],'penalty':_0x52af57[_0x44b8('0x5d')]},{'transaction':_0x3d92a9});});})[_0x44b8('0x13')](function(){_0x16074e[_0x44b8('0x5c')](function(_0x4ed62f){socket[_0x44b8('0x66')]('userVoiceQueue:save',{'UserId':_0x4ed62f['id'],'VoiceQueueId':_0x15365d['id']});});});});});}})[_0x44b8('0x13')](respondWithStatusCode(_0x343c5c,null))['catch'](handleError(_0x343c5c,null));};exports['removeTeams']=function(_0x1fb070,_0x224071){return db[_0x44b8('0x56')][_0x44b8('0x2b')]({'where':{'id':_0x1fb070[_0x44b8('0x32')][_0x44b8('0x67')]},'attributes':['id'],'include':[{'model':db[_0x44b8('0x58')],'as':_0x44b8('0x59'),'attributes':['id'],'raw':!![]}]})[_0x44b8('0x13')](handleEntityNotFound(_0x224071,null))['then'](function(_0x1eb0a8){var _0x1e3b5f=_[_0x44b8('0x1b')](_0x1eb0a8,'id');var _0x536d1d=[];var _0x5bc747=[];var _0x3e44ea=squel['select']();_0x3e44ea[_0x44b8('0x68')]('tq.TeamId')[_0x44b8('0x69')]('team_has_voice_queues','tq')['join'](_0x44b8('0x6a'),'ut',_0x44b8('0x6b'))['where'](_0x44b8('0x6c'),_0x1fb070[_0x44b8('0x2f')]['id']);for(var _0x276dfc=0x0;_0x276dfc<_0x1eb0a8[_0x44b8('0x37')];_0x276dfc+=0x1){let _0x291617=_0x1eb0a8[_0x276dfc];for(var _0x57b73f=0x0;_0x57b73f<_0x291617[_0x44b8('0x59')]['length'];_0x57b73f+=0x1){let _0x595af5=_0x291617['Agents'][_0x57b73f];var _0x3015f9=_0x3e44ea[_0x44b8('0x44')]();_0x3015f9['where'](_0x44b8('0x6d'),_0x595af5['id']);_0x5bc747[_0x44b8('0x6e')](db['sequelize']['query'](_0x3015f9[_0x44b8('0x6f')](),{'type':db[_0x44b8('0x70')]['QueryTypes'][_0x44b8('0x71')]})[_0x44b8('0x13')](function(_0x5e2d3b){if(_0x5e2d3b[_0x44b8('0x37')]===0x1){return _0x595af5['id'];}else{var _0x97f4=_['every'](_[_0x44b8('0x1b')](_0x5e2d3b,_0x44b8('0x72')),function(_0xdb42f2){return _['includes'](_0x1e3b5f,_0xdb42f2);});if(_0x97f4){return _0x595af5['id'];}}}));}}return BPromise[_0x44b8('0x73')](_0x5bc747)['then'](function(_0x2ea49d){_0x536d1d=_(_0x536d1d)['union'](_0x2ea49d)['compact']()[_0x44b8('0x1c')]();return db[_0x44b8('0x29')][_0x44b8('0x1e')]({'where':{'id':_0x1fb070[_0x44b8('0x2f')]['id']}})[_0x44b8('0x13')](function(_0x1db2cf){return db[_0x44b8('0x70')][_0x44b8('0x5e')](function(_0x1b7826){return _0x1db2cf[_0x44b8('0x74')](_0x1fb070[_0x44b8('0x32')]['ids'],{'transaction':_0x1b7826})[_0x44b8('0x13')](function(){if(!_[_0x44b8('0x75')](_0x536d1d)){return _0x1db2cf[_0x44b8('0x76')](_0x536d1d,{'transaction':_0x1b7826})[_0x44b8('0x13')](function(){return db[_0x44b8('0x62')][_0x44b8('0x12')]({'where':{'VoiceQueueId':_0x1fb070[_0x44b8('0x2f')]['id'],'UserId':_0x536d1d},'transaction':_0x1b7826});});}})[_0x44b8('0x13')](function(){_0x536d1d['forEach'](function(_0x4234bc){socket[_0x44b8('0x66')]('userVoiceQueue:remove',{'UserId':_0x4234bc,'VoiceQueueId':_0x1db2cf['id']});});});});});});})[_0x44b8('0x13')](respondWithStatusCode(_0x224071,null))[_0x44b8('0x2d')](handleError(_0x224071,null));};exports[_0x44b8('0x77')]=function(_0x5596c0,_0x4b2b8f){var _0x18cd30,_0x133da8;return db['VoiceQueue']['find']({'where':{'id':_0x5596c0[_0x44b8('0x2f')]['id']}})[_0x44b8('0x13')](handleEntityNotFound(_0x4b2b8f,null))[_0x44b8('0x13')](function(_0x2bccf9){if(_0x2bccf9){_0x133da8=_0x2bccf9;return _0x2bccf9[_0x44b8('0x77')](_0x5596c0['body'][_0x44b8('0x67')],_['omit'](_0x5596c0[_0x44b8('0x3c')],[_0x44b8('0x67'),'id'])||{})[_0x44b8('0x78')](function(_0x156a60){for(var _0x3cbec9=0x0;_0x3cbec9<_0x5596c0[_0x44b8('0x3c')]['ids'][_0x44b8('0x37')];_0x3cbec9+=0x1){socket['emit'](_0x44b8('0x79'),{'UserId':Number(_0x5596c0[_0x44b8('0x3c')]['ids'][_0x3cbec9]),'VoiceQueueId':Number(_0x5596c0[_0x44b8('0x2f')]['id'])});}return _0x156a60;});}})['then'](function(_0x42b0c9){_0x18cd30=_0x42b0c9||[];if(_0x133da8){return db[_0x44b8('0x58')][_0x44b8('0x2b')]({'where':{'id':_0x5596c0['body'][_0x44b8('0x67')]},'attributes':['id',_0x44b8('0x21'),'online',_0x44b8('0x5a'),'interface'],'raw':!![]});}})['then'](function(_0x4220b5){if(!_['isEmpty'](_0x4220b5)){var _0x336436=[];for(var _0x51add5=0x0;_0x51add5<_0x4220b5[_0x44b8('0x37')];_0x51add5++){if(_0x4220b5[_0x51add5][_0x44b8('0x7a')]){_0x336436['push'](db[_0x44b8('0x62')][_0x44b8('0x63')]({'membername':_0x4220b5[_0x51add5]['name'],'UserId':_0x4220b5[_0x51add5]['id'],'queue_name':_0x133da8['name'],'VoiceQueueId':_0x133da8['id'],'interface':_[_0x44b8('0x7b')](_0x4220b5[_0x51add5][_0x44b8('0x5b')])?util[_0x44b8('0x64')](_0x44b8('0x65'),_0x4220b5[_0x51add5]['name']):_0x4220b5[_0x51add5][_0x44b8('0x5b')],'paused':_0x4220b5[_0x51add5][_0x44b8('0x5a')]||![],'penalty':_0x5596c0[_0x44b8('0x3c')][_0x44b8('0x5d')]||0x0}));}}return BPromise['all'](_0x336436);}})['then'](function(){return _0x18cd30;})[_0x44b8('0x13')](respondWithResult(_0x4b2b8f,null))[_0x44b8('0x2d')](handleError(_0x4b2b8f,null));};exports[_0x44b8('0x76')]=function(_0x4cf4a0,_0x1443bd){return db[_0x44b8('0x29')]['find']({'where':{'id':_0x4cf4a0[_0x44b8('0x2f')]['id']}})[_0x44b8('0x13')](handleEntityNotFound(_0x1443bd,null))[_0x44b8('0x13')](function(_0x2cb698){if(_0x2cb698){return _0x2cb698[_0x44b8('0x76')](_0x4cf4a0[_0x44b8('0x32')]['ids'])['then'](function(){if(_[_0x44b8('0x7c')](_0x4cf4a0['query'][_0x44b8('0x67')])){for(var _0x4dc333=0x0;_0x4dc333<_0x4cf4a0[_0x44b8('0x32')][_0x44b8('0x67')][_0x44b8('0x37')];_0x4dc333+=0x1){socket[_0x44b8('0x66')](_0x44b8('0x7d'),{'UserId':Number(_0x4cf4a0[_0x44b8('0x32')][_0x44b8('0x67')][_0x4dc333]),'VoiceQueueId':Number(_0x4cf4a0[_0x44b8('0x2f')]['id'])});}}else{socket[_0x44b8('0x66')](_0x44b8('0x7d'),{'UserId':Number(_0x4cf4a0[_0x44b8('0x32')][_0x44b8('0x67')]),'VoiceQueueId':Number(_0x4cf4a0[_0x44b8('0x2f')]['id'])});}});}})[_0x44b8('0x13')](function(_0x4026d7){return db[_0x44b8('0x62')]['destroy']({'where':{'VoiceQueueId':_0x4cf4a0[_0x44b8('0x2f')]['id'],'UserId':_0x4cf4a0['query'][_0x44b8('0x67')]}})[_0x44b8('0x13')](function(){return _0x4026d7;});})[_0x44b8('0x13')](respondWithStatusCode(_0x1443bd,null))[_0x44b8('0x2d')](handleError(_0x1443bd,null));};exports[_0x44b8('0x7e')]=function(_0x22e5ae,_0x2f3340){var _0x4d98de={};var _0x597139={};var _0x2fffd5;var _0x3c90c2;return db[_0x44b8('0x29')][_0x44b8('0x49')]({'where':{'id':_0x22e5ae[_0x44b8('0x2f')]['id']}})['then'](handleEntityNotFound(_0x2f3340,null))[_0x44b8('0x13')](function(_0x208c53){if(_0x208c53){_0x2fffd5=_0x208c53;_0x597139[_0x44b8('0x30')]=_[_0x44b8('0x31')](db[_0x44b8('0x58')][_0x44b8('0x24')]);_0x597139['query']=_[_0x44b8('0x31')](_0x22e5ae[_0x44b8('0x32')]);_0x597139[_0x44b8('0x33')]=_[_0x44b8('0x34')](_0x597139[_0x44b8('0x30')],_0x597139['query']);_0x4d98de['attributes']=_[_0x44b8('0x34')](_0x597139[_0x44b8('0x30')],qs['fields'](_0x22e5ae['query'][_0x44b8('0x36')]));_0x4d98de['attributes']=_0x4d98de[_0x44b8('0x35')][_0x44b8('0x37')]?_0x4d98de[_0x44b8('0x35')]:_0x597139[_0x44b8('0x30')];_0x4d98de[_0x44b8('0x4c')]=qs[_0x44b8('0x4d')](_0x22e5ae[_0x44b8('0x32')][_0x44b8('0x4d')]);_0x4d98de['where']=qs[_0x44b8('0x33')](_[_0x44b8('0x51')](_0x22e5ae[_0x44b8('0x32')],_0x597139['filters']));if(_0x22e5ae[_0x44b8('0x32')][_0x44b8('0x19')]){_0x4d98de['where']=_['merge'](_0x4d98de['where'],{'$or':_['map'](_0x4d98de[_0x44b8('0x35')],function(_0x5e423c){var _0x48065d={};_0x48065d[_0x5e423c]={'$like':'%'+_0x22e5ae[_0x44b8('0x32')][_0x44b8('0x19')]+'%'};return _0x48065d;})});}_0x4d98de=_[_0x44b8('0x39')]({},_0x4d98de,_0x22e5ae['options']);return _0x2fffd5[_0x44b8('0x7e')](_0x4d98de);}})['then'](function(_0x230407){if(_0x230407){_0x3c90c2=_0x230407[_0x44b8('0x37')];if(!_0x22e5ae[_0x44b8('0x32')][_0x44b8('0x4a')]('nolimit')){_0x4d98de[_0x44b8('0x10')]=qs[_0x44b8('0x10')](_0x22e5ae[_0x44b8('0x32')][_0x44b8('0x10')]);_0x4d98de['offset']=qs['offset'](_0x22e5ae[_0x44b8('0x32')][_0x44b8('0xf')]);}return _0x2fffd5['getAgents'](_0x4d98de);}})[_0x44b8('0x13')](function(_0x188744){if(_0x188744){return _0x188744?{'count':_0x3c90c2,'rows':_0x188744}:null;}})[_0x44b8('0x13')](respondWithResult(_0x2f3340,null))[_0x44b8('0x2d')](handleError(_0x2f3340,null));};exports[_0x44b8('0x7f')]=function(_0x2da727,_0x319520){var _0x2f7550={};var _0x57d24f={};var _0x223e54;var _0x3e5fa8;return db[_0x44b8('0x29')]['findOne']({'where':{'id':_0x2da727[_0x44b8('0x2f')]['id']}})['then'](handleEntityNotFound(_0x319520,null))[_0x44b8('0x13')](function(_0x5370a5){if(_0x5370a5){_0x223e54=_0x5370a5;_0x57d24f[_0x44b8('0x30')]=_[_0x44b8('0x31')](db[_0x44b8('0x62')][_0x44b8('0x24')]);_0x57d24f[_0x44b8('0x32')]=_[_0x44b8('0x31')](_0x2da727[_0x44b8('0x32')]);_0x57d24f[_0x44b8('0x33')]=_[_0x44b8('0x34')](_0x57d24f[_0x44b8('0x30')],_0x57d24f[_0x44b8('0x32')]);_0x2f7550[_0x44b8('0x35')]=_['intersection'](_0x57d24f[_0x44b8('0x30')],qs['fields'](_0x2da727[_0x44b8('0x32')]['fields']));_0x2f7550[_0x44b8('0x35')]=_0x2f7550[_0x44b8('0x35')][_0x44b8('0x37')]?_0x2f7550[_0x44b8('0x35')]:_0x57d24f[_0x44b8('0x30')];_0x2f7550[_0x44b8('0x4c')]=qs[_0x44b8('0x4d')](_0x2da727['query'][_0x44b8('0x4d')]);_0x2f7550[_0x44b8('0x28')]=qs[_0x44b8('0x33')](_[_0x44b8('0x51')](_0x2da727[_0x44b8('0x32')],_0x57d24f[_0x44b8('0x33')]));if(_0x2da727[_0x44b8('0x32')][_0x44b8('0x19')]){_0x2f7550[_0x44b8('0x28')]=_[_0x44b8('0x39')](_0x2f7550[_0x44b8('0x28')],{'$or':_[_0x44b8('0x1b')](_0x2f7550[_0x44b8('0x35')],function(_0x4281a6){var _0x4bb399={};_0x4bb399[_0x4281a6]={'$like':'%'+_0x2da727[_0x44b8('0x32')][_0x44b8('0x19')]+'%'};return _0x4bb399;})});}_0x2f7550=_['merge']({},_0x2f7550,_0x2da727[_0x44b8('0x3a')]);return _0x223e54[_0x44b8('0x7f')](_0x2f7550);}})[_0x44b8('0x13')](function(_0x1f389e){if(_0x1f389e){_0x3e5fa8=_0x1f389e[_0x44b8('0x37')];if(!_0x2da727['query'][_0x44b8('0x4a')](_0x44b8('0x4b'))){_0x2f7550[_0x44b8('0x10')]=qs[_0x44b8('0x10')](_0x2da727['query'][_0x44b8('0x10')]);_0x2f7550[_0x44b8('0xf')]=qs['offset'](_0x2da727['query']['offset']);}return _0x223e54['getMembers'](_0x2f7550);}})[_0x44b8('0x13')](function(_0x5824a8){return _0x5824a8?{'count':_0x3e5fa8,'rows':_0x5824a8}:null;})['then'](respondWithResult(_0x319520,null))[_0x44b8('0x2d')](handleError(_0x319520,null));};exports[_0x44b8('0x80')]=function(_0x87a38,_0x54adf9){var _0x44dc3d={};var _0x32dafb={};var _0x3c8e0c;var _0x21ea61;return db['VoiceQueue'][_0x44b8('0x49')]({'where':{'id':_0x87a38['params']['id']}})[_0x44b8('0x13')](handleEntityNotFound(_0x54adf9,null))[_0x44b8('0x13')](function(_0x56cfa5){if(_0x56cfa5){_0x3c8e0c=_0x56cfa5;_0x32dafb[_0x44b8('0x30')]=_[_0x44b8('0x31')](db[_0x44b8('0x81')][_0x44b8('0x24')]);_0x32dafb[_0x44b8('0x32')]=_['keys'](_0x87a38['query']);_0x32dafb[_0x44b8('0x33')]=_[_0x44b8('0x34')](_0x32dafb[_0x44b8('0x30')],_0x32dafb[_0x44b8('0x32')]);_0x44dc3d[_0x44b8('0x35')]=_[_0x44b8('0x34')](_0x32dafb[_0x44b8('0x30')],qs[_0x44b8('0x36')](_0x87a38[_0x44b8('0x32')][_0x44b8('0x36')]));_0x44dc3d[_0x44b8('0x35')]=_0x44dc3d[_0x44b8('0x35')]['length']?_0x44dc3d['attributes']:_0x32dafb[_0x44b8('0x30')];_0x44dc3d['order']=qs[_0x44b8('0x4d')](_0x87a38[_0x44b8('0x32')][_0x44b8('0x4d')]);_0x44dc3d['where']=qs[_0x44b8('0x33')](_[_0x44b8('0x51')](_0x87a38[_0x44b8('0x32')],_0x32dafb[_0x44b8('0x33')]));if(_0x87a38[_0x44b8('0x32')][_0x44b8('0x19')]){_0x44dc3d['where']=_[_0x44b8('0x39')](_0x44dc3d[_0x44b8('0x28')],{'$or':_['map'](_0x44dc3d[_0x44b8('0x35')],function(_0x1ffa05){var _0x22edd7={};_0x22edd7[_0x1ffa05]={'$like':'%'+_0x87a38[_0x44b8('0x32')][_0x44b8('0x19')]+'%'};return _0x22edd7;})});}_0x44dc3d=_['merge']({},_0x44dc3d,_0x87a38[_0x44b8('0x3a')]);return _0x3c8e0c[_0x44b8('0x80')](_0x44dc3d);}})[_0x44b8('0x13')](function(_0x2fca1a){if(_0x2fca1a){_0x21ea61=_0x2fca1a[_0x44b8('0x37')];if(!_0x87a38[_0x44b8('0x32')][_0x44b8('0x4a')](_0x44b8('0x4b'))){_0x44dc3d[_0x44b8('0x10')]=qs[_0x44b8('0x10')](_0x87a38['query'][_0x44b8('0x10')]);_0x44dc3d[_0x44b8('0xf')]=qs[_0x44b8('0xf')](_0x87a38['query']['offset']);}return _0x3c8e0c[_0x44b8('0x80')](_0x44dc3d);}})['then'](function(_0x9458fb){if(_0x9458fb){return _0x9458fb?{'count':_0x21ea61,'rows':_0x9458fb}:null;}})[_0x44b8('0x13')](respondWithResult(_0x54adf9,null))[_0x44b8('0x2d')](handleError(_0x54adf9,null));};exports[_0x44b8('0x82')]=function(_0x2eb6ce,_0x105ca0){var _0x25f364=moment()['format']('YYYY-MM-DD\x20HH:mm:ss');var _0x77c009,_0x161362;return db[_0x44b8('0x29')][_0x44b8('0x1e')]({'where':{'id':_0x2eb6ce[_0x44b8('0x2f')]['id']}})[_0x44b8('0x13')](handleEntityNotFound(_0x105ca0,null))['then'](function(_0x4d88a6){if(_0x4d88a6){_0x161362=_0x4d88a6;return _0x4d88a6[_0x44b8('0x82')](_0x2eb6ce[_0x44b8('0x3c')][_0x44b8('0x67')],_[_0x44b8('0x45')](_0x2eb6ce[_0x44b8('0x3c')],[_0x44b8('0x67'),'id'])||{});}return null;})[_0x44b8('0x78')](function(_0x4b49df){var _0xbf96c1;_0x77c009=_0x4b49df||[];var _0x1f6244=[];if(_0x4b49df){for(var _0x96a3cd=0x0;_0x96a3cd<_0x4b49df['length'];_0x96a3cd+=0x1){var _0x16721d=_0x4b49df[_0x96a3cd][_0x44b8('0x14')]({'plain':!![]});_0x161362[_0x44b8('0x83')]=_0x2eb6ce[_0x44b8('0x3c')]['dialCheckDuplicateType']?_0x2eb6ce[_0x44b8('0x3c')][_0x44b8('0x83')]:_0x161362[_0x44b8('0x83')];switch(_0x161362['dialCheckDuplicateType']){case'always':_0xbf96c1=squel['insert']()['into']('cm_hopper')[_0x44b8('0x84')]([_0x44b8('0x85'),_0x44b8('0x86'),_0x44b8('0x87'),_0x44b8('0x88'),_0x44b8('0x4e'),_0x44b8('0x46'),_0x44b8('0x47')],squel[_0x44b8('0x89')]()[_0x44b8('0x68')](_0x44b8('0x85'),'phone')[_0x44b8('0x68')]('\x27'+_0x25f364+'\x27',_0x44b8('0x86'))[_0x44b8('0x68')]('id',_0x44b8('0x87'))[_0x44b8('0x68')](_0x16721d['CmListId'][_0x44b8('0x6f')](),'ListId')[_0x44b8('0x68')](_0x2eb6ce[_0x44b8('0x2f')]['id'][_0x44b8('0x6f')](),'VoiceQueueId')[_0x44b8('0x68')]('\x27'+_0x25f364+'\x27',_0x44b8('0x46'))['field']('\x27'+_0x25f364+'\x27',_0x44b8('0x47'))[_0x44b8('0x69')](_0x44b8('0x8a'))['where'](_0x44b8('0x8b'))['where'](_0x44b8('0x8c'),_0x16721d[_0x44b8('0x8d')][_0x44b8('0x6f')]())['where'](_0x44b8('0x8e'))['where'](_0x44b8('0x8f'),squel[_0x44b8('0x89')]()[_0x44b8('0x68')](_0x44b8('0x90'))[_0x44b8('0x69')](_0x44b8('0x91'))['where'](_0x44b8('0x6c'),_0x2eb6ce[_0x44b8('0x2f')]['id'][_0x44b8('0x6f')]()))[_0x44b8('0x28')]('phone\x20NOT\x20IN\x20(?)',squel[_0x44b8('0x89')]()[_0x44b8('0x68')](_0x44b8('0x92'))[_0x44b8('0x69')](_0x44b8('0x93'))[_0x44b8('0x28')](_0x44b8('0x6c'),_0x2eb6ce[_0x44b8('0x2f')]['id'][_0x44b8('0x6f')]())))[_0x44b8('0x6f')]();break;case _0x44b8('0x94'):_0xbf96c1=squel[_0x44b8('0x95')]()['into'](_0x44b8('0x93'))[_0x44b8('0x84')]([_0x44b8('0x85'),_0x44b8('0x86'),'ContactId',_0x44b8('0x88'),'VoiceQueueId',_0x44b8('0x46'),_0x44b8('0x47')],squel[_0x44b8('0x89')]()['field'](_0x44b8('0x85'),_0x44b8('0x85'))[_0x44b8('0x68')]('\x27'+_0x25f364+'\x27',_0x44b8('0x86'))[_0x44b8('0x68')]('id','ContactId')[_0x44b8('0x68')](_0x16721d[_0x44b8('0x8d')][_0x44b8('0x6f')](),_0x44b8('0x88'))[_0x44b8('0x68')](_0x2eb6ce['params']['id'][_0x44b8('0x6f')](),_0x44b8('0x4e'))[_0x44b8('0x68')]('\x27'+_0x25f364+'\x27',_0x44b8('0x46'))[_0x44b8('0x68')]('\x27'+_0x25f364+'\x27',_0x44b8('0x47'))[_0x44b8('0x69')]('cm_contacts')['where']('deletedAt\x20IS\x20NULL')[_0x44b8('0x28')](_0x44b8('0x8c'),_0x16721d[_0x44b8('0x8d')]['toString']())['where'](_0x44b8('0x8e'))[_0x44b8('0x28')](_0x44b8('0x8f'),squel[_0x44b8('0x89')]()[_0x44b8('0x68')]('COALESCE(phone,\x27\x27)')['from']('cm_hopper')['where'](_0x44b8('0x6c'),_0x2eb6ce[_0x44b8('0x2f')]['id'][_0x44b8('0x6f')]())))[_0x44b8('0x6f')]();break;default:_0xbf96c1=squel[_0x44b8('0x95')]()[_0x44b8('0x96')]('cm_hopper')[_0x44b8('0x84')](['phone',_0x44b8('0x86'),_0x44b8('0x87'),_0x44b8('0x88'),'VoiceQueueId','createdAt',_0x44b8('0x47')],squel[_0x44b8('0x89')]()['field']('phone',_0x44b8('0x85'))[_0x44b8('0x68')]('\x27'+_0x25f364+'\x27',_0x44b8('0x86'))[_0x44b8('0x68')]('id',_0x44b8('0x87'))['field'](_0x16721d[_0x44b8('0x8d')][_0x44b8('0x6f')](),_0x44b8('0x88'))[_0x44b8('0x68')](_0x2eb6ce[_0x44b8('0x2f')]['id'][_0x44b8('0x6f')](),_0x44b8('0x4e'))['field']('\x27'+_0x25f364+'\x27',_0x44b8('0x46'))[_0x44b8('0x68')]('\x27'+_0x25f364+'\x27',_0x44b8('0x47'))[_0x44b8('0x69')](_0x44b8('0x8a'))[_0x44b8('0x28')]('deletedAt\x20IS\x20NULL')[_0x44b8('0x28')](_0x44b8('0x8c'),_0x16721d[_0x44b8('0x8d')][_0x44b8('0x6f')]())['where'](_0x44b8('0x8e')))[_0x44b8('0x6f')]();}_0x1f6244[_0x44b8('0x6e')](db[_0x44b8('0x70')]['query'](_0xbf96c1));}return BPromise['all'](_0x1f6244);}})[_0x44b8('0x13')](function(){var _0x2ad4ab=[];var _0x196b4b=squel[_0x44b8('0x95')]()[_0x44b8('0x96')]('cm_hopper_additional_phones')[_0x44b8('0x84')]([_0x44b8('0x97'),_0x44b8('0x85'),_0x44b8('0x98'),_0x44b8('0x46'),_0x44b8('0x47')],squel['select']()[_0x44b8('0x68')](_0x44b8('0x99'))[_0x44b8('0x68')](_0x44b8('0x9a'))[_0x44b8('0x68')](_0x44b8('0x9b'))[_0x44b8('0x68')]('\x27'+_0x25f364+'\x27','createdAt')[_0x44b8('0x68')]('\x27'+_0x25f364+'\x27',_0x44b8('0x47'))[_0x44b8('0x69')](_0x44b8('0x9c'),'ci')['join'](_0x44b8('0x93'),'h','h.ContactId=ci.CmContactId')[_0x44b8('0x28')](_0x44b8('0x9d'),_0x25f364)[_0x44b8('0x28')](_0x44b8('0x9e'),'PHONE'))[_0x44b8('0x6f')]();_0x2ad4ab[_0x44b8('0x6e')](db[_0x44b8('0x70')]['query'](_0x196b4b));return BPromise[_0x44b8('0x73')](_0x2ad4ab);})[_0x44b8('0x13')](function(){return _0x77c009;})[_0x44b8('0x13')](respondWithResult(_0x105ca0,null))[_0x44b8('0x2d')](handleError(_0x105ca0,null));};exports[_0x44b8('0x9f')]=function(_0x257702,_0x17560c){return db[_0x44b8('0x29')][_0x44b8('0x1e')]({'where':{'id':_0x257702[_0x44b8('0x2f')]['id']}})['then'](handleEntityNotFound(_0x17560c,null))[_0x44b8('0x13')](function(_0x4d11d5){if(_0x4d11d5){return _0x4d11d5[_0x44b8('0x9f')](_0x257702[_0x44b8('0x32')][_0x44b8('0x67')]);}})[_0x44b8('0x13')](function(_0xafca17){if(_0xafca17){return db['CmHopper']['destroy']({'where':{'ListId':_0x257702['query'][_0x44b8('0x67')],'VoiceQueueId':_0x257702[_0x44b8('0x2f')]['id']}})[_0x44b8('0x13')](function(){return _0xafca17;});}})[_0x44b8('0x13')](respondWithStatusCode(_0x17560c,null))[_0x44b8('0x2d')](handleError(_0x17560c,null));};exports[_0x44b8('0xa0')]=function(_0x513302,_0xfdb408){var _0x119dda={};var _0x5834fe={};var _0xe5cc1e;var _0x4c55e6;return db[_0x44b8('0x29')][_0x44b8('0x49')]({'where':{'id':_0x513302['params']['id']}})[_0x44b8('0x13')](handleEntityNotFound(_0xfdb408,null))[_0x44b8('0x13')](function(_0x537eab){if(_0x537eab){_0xe5cc1e=_0x537eab;_0x5834fe[_0x44b8('0x30')]=_[_0x44b8('0x31')](db[_0x44b8('0x81')][_0x44b8('0x24')]);_0x5834fe['query']=_[_0x44b8('0x31')](_0x513302[_0x44b8('0x32')]);_0x5834fe[_0x44b8('0x33')]=_[_0x44b8('0x34')](_0x5834fe[_0x44b8('0x30')],_0x5834fe[_0x44b8('0x32')]);_0x119dda[_0x44b8('0x35')]=_['intersection'](_0x5834fe[_0x44b8('0x30')],qs[_0x44b8('0x36')](_0x513302[_0x44b8('0x32')]['fields']));_0x119dda[_0x44b8('0x35')]=_0x119dda[_0x44b8('0x35')]['length']?_0x119dda[_0x44b8('0x35')]:_0x5834fe[_0x44b8('0x30')];_0x119dda[_0x44b8('0x4c')]=qs[_0x44b8('0x4d')](_0x513302['query'][_0x44b8('0x4d')]);_0x119dda[_0x44b8('0x28')]=qs[_0x44b8('0x33')](_[_0x44b8('0x51')](_0x513302[_0x44b8('0x32')],_0x5834fe['filters']));if(_0x513302[_0x44b8('0x32')][_0x44b8('0x19')]){_0x119dda['where']=_[_0x44b8('0x39')](_0x119dda[_0x44b8('0x28')],{'$or':_[_0x44b8('0x1b')](_0x119dda[_0x44b8('0x35')],function(_0x4e9376){var _0x25f31c={};_0x25f31c[_0x4e9376]={'$like':'%'+_0x513302[_0x44b8('0x32')][_0x44b8('0x19')]+'%'};return _0x25f31c;})});}_0x119dda=_[_0x44b8('0x39')]({},_0x119dda,_0x513302[_0x44b8('0x3a')]);return _0xe5cc1e[_0x44b8('0xa0')](_0x119dda);}})[_0x44b8('0x13')](function(_0x57e3c9){if(_0x57e3c9){_0x4c55e6=_0x57e3c9[_0x44b8('0x37')];if(!_0x513302[_0x44b8('0x32')][_0x44b8('0x4a')](_0x44b8('0x4b'))){_0x119dda['limit']=qs[_0x44b8('0x10')](_0x513302[_0x44b8('0x32')][_0x44b8('0x10')]);_0x119dda['offset']=qs['offset'](_0x513302[_0x44b8('0x32')][_0x44b8('0xf')]);}return _0xe5cc1e[_0x44b8('0xa0')](_0x119dda);}})[_0x44b8('0x13')](function(_0x4a5916){if(_0x4a5916){return _0x4a5916?{'count':_0x4c55e6,'rows':_0x4a5916}:null;}})[_0x44b8('0x13')](respondWithResult(_0xfdb408,null))[_0x44b8('0x2d')](handleError(_0xfdb408,null));};exports['addBlackLists']=function(_0xd19a35,_0x2439f2){var _0x22a624;return db['VoiceQueue'][_0x44b8('0x1e')]({'where':{'id':_0xd19a35[_0x44b8('0x2f')]['id']}})[_0x44b8('0x13')](handleEntityNotFound(_0x2439f2,null))[_0x44b8('0x13')](function(_0x14c021){if(_0x14c021){return _0x14c021['addBlackLists'](_0xd19a35[_0x44b8('0x3c')][_0x44b8('0x67')],_['omit'](_0xd19a35[_0x44b8('0x3c')],[_0x44b8('0x67'),'id'])||{});}return null;})[_0x44b8('0x78')](function(_0x3b9cd2){var _0xb6cadf;_0x22a624=_0x3b9cd2||[];var _0x2024eb=[];if(_0x3b9cd2){for(var _0x29af58=0x0;_0x29af58<_0x3b9cd2[_0x44b8('0x37')];_0x29af58+=0x1){var _0x3870a9=_0x3b9cd2[_0x29af58]['get']({'plain':!![]});_0xb6cadf=squel['insert']()['into']('cm_hopper_black')[_0x44b8('0x84')]([_0x44b8('0x85'),'ContactId',_0x44b8('0x88'),_0x44b8('0x4e'),_0x44b8('0x46'),_0x44b8('0x47')],squel[_0x44b8('0x89')]()[_0x44b8('0x68')]('phone',_0x44b8('0x85'))['field']('id','ContactId')[_0x44b8('0x68')](_0x3870a9[_0x44b8('0x8d')][_0x44b8('0x6f')](),_0x44b8('0x88'))[_0x44b8('0x68')](_0xd19a35['params']['id'][_0x44b8('0x6f')](),_0x44b8('0x4e'))[_0x44b8('0x68')](_0x44b8('0xa1'),_0x44b8('0x46'))[_0x44b8('0x68')](_0x44b8('0xa1'),'updatedAt')[_0x44b8('0x69')](_0x44b8('0x8a'))[_0x44b8('0x28')]('deletedAt\x20IS\x20NULL')[_0x44b8('0x28')](_0x44b8('0x8c'),_0x3870a9[_0x44b8('0x8d')][_0x44b8('0x6f')]())[_0x44b8('0x28')](_0x44b8('0x8e')))[_0x44b8('0x6f')]();_0x2024eb[_0x44b8('0x6e')](db['sequelize'][_0x44b8('0x32')](_0xb6cadf));}return BPromise[_0x44b8('0x73')](_0x2024eb);}})[_0x44b8('0x13')](function(){return _0x22a624;})[_0x44b8('0x13')](respondWithResult(_0x2439f2,null))[_0x44b8('0x2d')](handleError(_0x2439f2,null));};exports[_0x44b8('0xa2')]=function(_0x4ec799,_0x3fa943){return db[_0x44b8('0x29')]['find']({'where':{'id':_0x4ec799[_0x44b8('0x2f')]['id']}})[_0x44b8('0x13')](handleEntityNotFound(_0x3fa943,null))[_0x44b8('0x13')](function(_0x3b1643){if(_0x3b1643){return _0x3b1643['removeBlackLists'](_0x4ec799[_0x44b8('0x32')]['ids']);}})['then'](function(_0x9a5734){if(_0x9a5734){return db[_0x44b8('0x54')][_0x44b8('0x12')]({'where':{'ListId':_0x4ec799[_0x44b8('0x32')][_0x44b8('0x67')],'VoiceQueueId':_0x4ec799['params']['id']}})['then'](function(){return _0x9a5734;});}})['then'](respondWithStatusCode(_0x3fa943,null))[_0x44b8('0x2d')](handleError(_0x3fa943,null));}; \ No newline at end of file diff --git a/server/api/voiceQueue/voiceQueue.events.js b/server/api/voiceQueue/voiceQueue.events.js index 5556d93..01ec70e 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 _0xf71b=['emit','hasOwnProperty','hook','exports','events','setMaxListeners','save','update','remove'];(function(_0x48bfb5,_0xa4ad5a){var _0x400a2c=function(_0x4f9cd3){while(--_0x4f9cd3){_0x48bfb5['push'](_0x48bfb5['shift']());}};_0x400a2c(++_0xa4ad5a);}(_0xf71b,0xe5));var _0xbf71=function(_0x1b896f,_0x12dbd4){_0x1b896f=_0x1b896f-0x0;var _0x4aa895=_0xf71b[_0x1b896f];return _0x4aa895;};'use strict';var EventEmitter=require(_0xbf71('0x0'));var VoiceQueue=require('../../mysqldb')['db']['VoiceQueue'];var VoiceQueueEvents=new EventEmitter();VoiceQueueEvents[_0xbf71('0x1')](0x0);var events={'afterCreate':_0xbf71('0x2'),'afterUpdate':_0xbf71('0x3'),'afterDestroy':_0xbf71('0x4')};function emitEvent(_0x53e7fc){return function(_0x4386c0,_0x3a6807,_0x12ce4f){VoiceQueueEvents[_0xbf71('0x5')](_0x53e7fc+':'+_0x4386c0['id'],_0x4386c0);VoiceQueueEvents[_0xbf71('0x5')](_0x53e7fc,_0x4386c0);_0x12ce4f(null);};}for(var e in events){if(events[_0xbf71('0x6')](e)){var event=events[e];VoiceQueue[_0xbf71('0x7')](e,emitEvent(event));}}module[_0xbf71('0x8')]=VoiceQueueEvents; \ No newline at end of file +var _0xe683=['events','VoiceQueue','update','emit','hook'];(function(_0x16771d,_0x224c60){var _0x386f11=function(_0x3d7a87){while(--_0x3d7a87){_0x16771d['push'](_0x16771d['shift']());}};_0x386f11(++_0x224c60);}(_0xe683,0xc8));var _0x3e68=function(_0x5a6e94,_0x2a2df7){_0x5a6e94=_0x5a6e94-0x0;var _0x294afa=_0xe683[_0x5a6e94];return _0x294afa;};'use strict';var EventEmitter=require(_0x3e68('0x0'));var VoiceQueue=require('../../mysqldb')['db'][_0x3e68('0x1')];var VoiceQueueEvents=new EventEmitter();VoiceQueueEvents['setMaxListeners'](0x0);var events={'afterCreate':'save','afterUpdate':_0x3e68('0x2'),'afterDestroy':'remove'};function emitEvent(_0x19e648){return function(_0x601687,_0x2d8f05,_0x1871e4){VoiceQueueEvents[_0x3e68('0x3')](_0x19e648+':'+_0x601687['id'],_0x601687);VoiceQueueEvents[_0x3e68('0x3')](_0x19e648,_0x601687);_0x1871e4(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];VoiceQueue[_0x3e68('0x4')](e,emitEvent(event));}}module['exports']=VoiceQueueEvents; \ No newline at end of file diff --git a/server/api/voiceQueue/voiceQueue.model.js b/server/api/voiceQueue/voiceQueue.model.js index 919299a..7803d71 100644 --- a/server/api/voiceQueue/voiceQueue.model.js +++ b/server/api/voiceQueue/voiceQueue.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x34e8=['voice_queues','lodash','util','../../config/logger','api','bluebird','request-promise','path','rimraf','../../config/environment','./voiceQueue.attributes','exports','VoiceQueue'];(function(_0xa4ca7f,_0x22921a){var _0x46bb5a=function(_0x4dbee3){while(--_0x4dbee3){_0xa4ca7f['push'](_0xa4ca7f['shift']());}};_0x46bb5a(++_0x22921a);}(_0x34e8,0x12c));var _0x834e=function(_0x3dffd6,_0x1f5b5c){_0x3dffd6=_0x3dffd6-0x0;var _0x32f395=_0x34e8[_0x3dffd6];return _0x32f395;};'use strict';var _=require(_0x834e('0x0'));var util=require(_0x834e('0x1'));var logger=require(_0x834e('0x2'))(_0x834e('0x3'));var moment=require('moment');var BPromise=require(_0x834e('0x4'));var rp=require(_0x834e('0x5'));var fs=require('fs');var path=require(_0x834e('0x6'));var rimraf=require(_0x834e('0x7'));var config=require(_0x834e('0x8'));var attributes=require(_0x834e('0x9'));module[_0x834e('0xa')]=function(_0x4a2018,_0x858aa1){return _0x4a2018['define'](_0x834e('0xb'),attributes,{'tableName':_0x834e('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x34e8=['voice_queues','lodash','util','../../config/logger','api','bluebird','request-promise','path','rimraf','../../config/environment','./voiceQueue.attributes','exports','VoiceQueue'];(function(_0x34ff3b,_0x2b9c2a){var _0xf1dd77=function(_0x551ab7){while(--_0x551ab7){_0x34ff3b['push'](_0x34ff3b['shift']());}};_0xf1dd77(++_0x2b9c2a);}(_0x34e8,0x12c));var _0x834e=function(_0x393d0a,_0x2c00d0){_0x393d0a=_0x393d0a-0x0;var _0xd6017d=_0x34e8[_0x393d0a];return _0xd6017d;};'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 62b59e1..4a8e984 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 _0xdc78=['request','then','info','VoiceQueue,\x20%s,\x20%s','request\x20sent','VoiceQueue,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','VoiceQueue','findAll','options','raw','where','attributes','limit','include','map','model','GetVoiceQueue','debug','ShowVoiceQueue','catch','lodash','util','moment','randomstring','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','redis','defaults','localhost','./voiceQueue.socket','register'];(function(_0x31752d,_0x2efff8){var _0x29da67=function(_0x296d74){while(--_0x296d74){_0x31752d['push'](_0x31752d['shift']());}};_0x29da67(++_0x2efff8);}(_0xdc78,0x10f));var _0x8dc7=function(_0x434ddc,_0x1f9e59){_0x434ddc=_0x434ddc-0x0;var _0x283bf5=_0xdc78[_0x434ddc];return _0x283bf5;};'use strict';var _=require(_0x8dc7('0x0'));var util=require(_0x8dc7('0x1'));var moment=require(_0x8dc7('0x2'));var BPromise=require('bluebird');var rs=require(_0x8dc7('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x8dc7('0x4'))['db'];var utils=require(_0x8dc7('0x5'));var logger=require(_0x8dc7('0x6'))('rpc');var config=require(_0x8dc7('0x7'));var jayson=require(_0x8dc7('0x8'));var client=jayson[_0x8dc7('0x9')][_0x8dc7('0xa')]({'port':0x232a});config[_0x8dc7('0xb')]=_[_0x8dc7('0xc')](config[_0x8dc7('0xb')],{'host':_0x8dc7('0xd'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x8dc7('0xb')]));require(_0x8dc7('0xe'))[_0x8dc7('0xf')](socket);function respondWithRpcPromise(_0x4fb2bb,_0x4d1c33,_0x5246e0){return new BPromise(function(_0x5499f5,_0x12c61a){return client[_0x8dc7('0x10')](_0x4fb2bb,_0x5246e0)[_0x8dc7('0x11')](function(_0x129a2d){logger[_0x8dc7('0x12')](_0x8dc7('0x13'),_0x4d1c33,_0x8dc7('0x14'));logger['debug'](_0x8dc7('0x15'),_0x4d1c33,_0x8dc7('0x14'),JSON[_0x8dc7('0x16')](_0x129a2d));if(_0x129a2d[_0x8dc7('0x17')]){if(_0x129a2d[_0x8dc7('0x17')][_0x8dc7('0x18')]===0x1f4){logger[_0x8dc7('0x17')](_0x8dc7('0x13'),_0x4d1c33,_0x129a2d[_0x8dc7('0x17')]['message']);return _0x12c61a(_0x129a2d[_0x8dc7('0x17')][_0x8dc7('0x19')]);}logger[_0x8dc7('0x17')](_0x8dc7('0x13'),_0x4d1c33,_0x129a2d['error'][_0x8dc7('0x19')]);return _0x5499f5(_0x129a2d[_0x8dc7('0x17')][_0x8dc7('0x19')]);}else{logger['info']('VoiceQueue,\x20%s,\x20%s',_0x4d1c33,_0x8dc7('0x14'));_0x5499f5(_0x129a2d[_0x8dc7('0x1a')]['message']);}})['catch'](function(_0x1060d0){logger['error']('VoiceQueue,\x20%s,\x20%s',_0x4d1c33,_0x1060d0);_0x12c61a(_0x1060d0);});});}exports['GetVoiceQueue']=function(_0x6999a7){var _0x15e884=this;return new Promise(function(_0x289eeb,_0x57acfe){return db[_0x8dc7('0x1b')][_0x8dc7('0x1c')]({'raw':_0x6999a7[_0x8dc7('0x1d')]?_0x6999a7['options'][_0x8dc7('0x1e')]===undefined?!![]:![]:!![],'where':_0x6999a7[_0x8dc7('0x1d')]?_0x6999a7[_0x8dc7('0x1d')][_0x8dc7('0x1f')]||null:null,'attributes':_0x6999a7[_0x8dc7('0x1d')]?_0x6999a7[_0x8dc7('0x1d')][_0x8dc7('0x20')]||null:null,'limit':_0x6999a7[_0x8dc7('0x1d')]?_0x6999a7['options'][_0x8dc7('0x21')]||null:null,'include':_0x6999a7['options']?_0x6999a7[_0x8dc7('0x1d')][_0x8dc7('0x22')]?_[_0x8dc7('0x23')](_0x6999a7[_0x8dc7('0x1d')][_0x8dc7('0x22')],function(_0x4d2243){return{'model':db[_0x4d2243['model']],'as':_0x4d2243['as'],'attributes':_0x4d2243[_0x8dc7('0x20')],'include':_0x4d2243[_0x8dc7('0x22')]?_[_0x8dc7('0x23')](_0x4d2243[_0x8dc7('0x22')],function(_0x30f45b){return{'model':db[_0x30f45b[_0x8dc7('0x24')]],'as':_0x30f45b['as'],'attributes':_0x30f45b[_0x8dc7('0x20')],'include':_0x30f45b[_0x8dc7('0x22')]?_['map'](_0x30f45b[_0x8dc7('0x22')],function(_0x3dd502){return{'model':db[_0x3dd502['model']],'as':_0x3dd502['as'],'attributes':_0x3dd502[_0x8dc7('0x20')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x3af29d){logger[_0x8dc7('0x12')](_0x8dc7('0x25'),_0x6999a7);logger[_0x8dc7('0x26')]('GetVoiceQueue',_0x6999a7,JSON[_0x8dc7('0x16')](_0x3af29d));_0x289eeb(_0x3af29d);})['catch'](function(_0x3b97bf){logger[_0x8dc7('0x17')]('GetVoiceQueue',_0x3b97bf[_0x8dc7('0x19')],_0x6999a7);_0x57acfe(_0x15e884[_0x8dc7('0x17')](0x1f4,_0x3b97bf['message']));});});};exports[_0x8dc7('0x27')]=function(_0x3413fb){var _0x500c9d=this;return new Promise(function(_0x3380fa,_0x4eb856){return db[_0x8dc7('0x1b')]['find']({'raw':_0x3413fb[_0x8dc7('0x1d')]?_0x3413fb['options'][_0x8dc7('0x1e')]===undefined?!![]:![]:!![],'where':_0x3413fb[_0x8dc7('0x1d')]?_0x3413fb['options']['where']||null:null,'attributes':_0x3413fb['options']?_0x3413fb[_0x8dc7('0x1d')][_0x8dc7('0x20')]||null:null,'include':_0x3413fb[_0x8dc7('0x1d')]?_0x3413fb['options'][_0x8dc7('0x22')]?_[_0x8dc7('0x23')](_0x3413fb[_0x8dc7('0x1d')][_0x8dc7('0x22')],function(_0x1e036a){return{'model':db[_0x1e036a['model']],'as':_0x1e036a['as'],'attributes':_0x1e036a[_0x8dc7('0x20')],'include':_0x1e036a[_0x8dc7('0x22')]?_[_0x8dc7('0x23')](_0x1e036a['include'],function(_0x427b48){return{'model':db[_0x427b48['model']],'as':_0x427b48['as'],'attributes':_0x427b48['attributes'],'include':_0x427b48[_0x8dc7('0x22')]?_[_0x8dc7('0x23')](_0x427b48[_0x8dc7('0x22')],function(_0x277802){return{'model':db[_0x277802['model']],'as':_0x277802['as'],'attributes':_0x277802[_0x8dc7('0x20')]};}):[]};}):[]};}):[]:[]})[_0x8dc7('0x11')](function(_0x5650d2){logger[_0x8dc7('0x12')]('ShowVoiceQueue',_0x3413fb);logger[_0x8dc7('0x26')](_0x8dc7('0x27'),_0x3413fb,JSON['stringify'](_0x5650d2));_0x3380fa(_0x5650d2);})[_0x8dc7('0x28')](function(_0x5d7b18){logger[_0x8dc7('0x17')](_0x8dc7('0x27'),_0x5d7b18['message'],_0x3413fb);_0x4eb856(_0x500c9d[_0x8dc7('0x17')](0x1f4,_0x5d7b18[_0x8dc7('0x19')]));});});}; \ No newline at end of file +var _0x7136=['debug','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/environment','http','redis','defaults','localhost','socket.io-emitter','register','request','VoiceQueue,\x20%s,\x20%s','request\x20sent','VoiceQueue,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result','VoiceQueue','findAll','options','raw','where','limit','include','map','model','attributes','then','GetVoiceQueue','catch','ShowVoiceQueue','find'];(function(_0x32d457,_0x1a39c9){var _0x338386=function(_0x199d7a){while(--_0x199d7a){_0x32d457['push'](_0x32d457['shift']());}};_0x338386(++_0x1a39c9);}(_0x7136,0x1d5));var _0x6713=function(_0x4161ac,_0xbc442d){_0x4161ac=_0x4161ac-0x0;var _0x5024fe=_0x7136[_0x4161ac];return _0x5024fe;};'use strict';var _=require(_0x6713('0x0'));var util=require(_0x6713('0x1'));var moment=require(_0x6713('0x2'));var BPromise=require(_0x6713('0x3'));var rs=require(_0x6713('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x6713('0x5'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')('rpc');var config=require(_0x6713('0x6'));var jayson=require('jayson/promise');var client=jayson['client'][_0x6713('0x7')]({'port':0x232a});config[_0x6713('0x8')]=_[_0x6713('0x9')](config[_0x6713('0x8')],{'host':_0x6713('0xa'),'port':0x18eb});var socket=require(_0x6713('0xb'))(new Redis(config['redis']));require('./voiceQueue.socket')[_0x6713('0xc')](socket);function respondWithRpcPromise(_0x1613f1,_0x5e4aec,_0x49a9b1){return new BPromise(function(_0x3e7c75,_0x570350){return client[_0x6713('0xd')](_0x1613f1,_0x49a9b1)['then'](function(_0x5f1142){logger['info'](_0x6713('0xe'),_0x5e4aec,_0x6713('0xf'));logger['debug'](_0x6713('0x10'),_0x5e4aec,_0x6713('0xf'),JSON[_0x6713('0x11')](_0x5f1142));if(_0x5f1142['error']){if(_0x5f1142[_0x6713('0x12')][_0x6713('0x13')]===0x1f4){logger[_0x6713('0x12')](_0x6713('0xe'),_0x5e4aec,_0x5f1142['error'][_0x6713('0x14')]);return _0x570350(_0x5f1142[_0x6713('0x12')][_0x6713('0x14')]);}logger[_0x6713('0x12')](_0x6713('0xe'),_0x5e4aec,_0x5f1142[_0x6713('0x12')][_0x6713('0x14')]);return _0x3e7c75(_0x5f1142[_0x6713('0x12')]['message']);}else{logger[_0x6713('0x15')](_0x6713('0xe'),_0x5e4aec,_0x6713('0xf'));_0x3e7c75(_0x5f1142[_0x6713('0x16')][_0x6713('0x14')]);}})['catch'](function(_0x9cb0c3){logger[_0x6713('0x12')](_0x6713('0xe'),_0x5e4aec,_0x9cb0c3);_0x570350(_0x9cb0c3);});});}exports['GetVoiceQueue']=function(_0x3d87f0){var _0x1ded9b=this;return new Promise(function(_0x311ca7,_0x5cf270){return db[_0x6713('0x17')][_0x6713('0x18')]({'raw':_0x3d87f0[_0x6713('0x19')]?_0x3d87f0['options'][_0x6713('0x1a')]===undefined?!![]:![]:!![],'where':_0x3d87f0[_0x6713('0x19')]?_0x3d87f0['options'][_0x6713('0x1b')]||null:null,'attributes':_0x3d87f0[_0x6713('0x19')]?_0x3d87f0[_0x6713('0x19')]['attributes']||null:null,'limit':_0x3d87f0[_0x6713('0x19')]?_0x3d87f0[_0x6713('0x19')][_0x6713('0x1c')]||null:null,'include':_0x3d87f0[_0x6713('0x19')]?_0x3d87f0[_0x6713('0x19')][_0x6713('0x1d')]?_[_0x6713('0x1e')](_0x3d87f0[_0x6713('0x19')][_0x6713('0x1d')],function(_0x368cda){return{'model':db[_0x368cda[_0x6713('0x1f')]],'as':_0x368cda['as'],'attributes':_0x368cda[_0x6713('0x20')],'include':_0x368cda['include']?_['map'](_0x368cda[_0x6713('0x1d')],function(_0x19886c){return{'model':db[_0x19886c[_0x6713('0x1f')]],'as':_0x19886c['as'],'attributes':_0x19886c['attributes'],'include':_0x19886c[_0x6713('0x1d')]?_[_0x6713('0x1e')](_0x19886c['include'],function(_0x4b4e7c){return{'model':db[_0x4b4e7c[_0x6713('0x1f')]],'as':_0x4b4e7c['as'],'attributes':_0x4b4e7c['attributes']};}):[]};}):[]};}):[]:[]})[_0x6713('0x21')](function(_0x436b82){logger[_0x6713('0x15')]('GetVoiceQueue',_0x3d87f0);logger['debug'](_0x6713('0x22'),_0x3d87f0,JSON['stringify'](_0x436b82));_0x311ca7(_0x436b82);})[_0x6713('0x23')](function(_0x119d31){logger[_0x6713('0x12')](_0x6713('0x22'),_0x119d31[_0x6713('0x14')],_0x3d87f0);_0x5cf270(_0x1ded9b[_0x6713('0x12')](0x1f4,_0x119d31[_0x6713('0x14')]));});});};exports[_0x6713('0x24')]=function(_0x45a2a2){var _0x313460=this;return new Promise(function(_0x2b45ea,_0x1e2f26){return db['VoiceQueue'][_0x6713('0x25')]({'raw':_0x45a2a2['options']?_0x45a2a2[_0x6713('0x19')][_0x6713('0x1a')]===undefined?!![]:![]:!![],'where':_0x45a2a2[_0x6713('0x19')]?_0x45a2a2[_0x6713('0x19')][_0x6713('0x1b')]||null:null,'attributes':_0x45a2a2[_0x6713('0x19')]?_0x45a2a2[_0x6713('0x19')][_0x6713('0x20')]||null:null,'include':_0x45a2a2[_0x6713('0x19')]?_0x45a2a2[_0x6713('0x19')][_0x6713('0x1d')]?_['map'](_0x45a2a2[_0x6713('0x19')][_0x6713('0x1d')],function(_0x4d9903){return{'model':db[_0x4d9903['model']],'as':_0x4d9903['as'],'attributes':_0x4d9903[_0x6713('0x20')],'include':_0x4d9903[_0x6713('0x1d')]?_[_0x6713('0x1e')](_0x4d9903[_0x6713('0x1d')],function(_0x451860){return{'model':db[_0x451860[_0x6713('0x1f')]],'as':_0x451860['as'],'attributes':_0x451860[_0x6713('0x20')],'include':_0x451860[_0x6713('0x1d')]?_['map'](_0x451860['include'],function(_0x172d63){return{'model':db[_0x172d63[_0x6713('0x1f')]],'as':_0x172d63['as'],'attributes':_0x172d63[_0x6713('0x20')]};}):[]};}):[]};}):[]:[]})[_0x6713('0x21')](function(_0x58ae4d){logger[_0x6713('0x15')](_0x6713('0x24'),_0x45a2a2);logger[_0x6713('0x26')](_0x6713('0x24'),_0x45a2a2,JSON[_0x6713('0x11')](_0x58ae4d));_0x2b45ea(_0x58ae4d);})[_0x6713('0x23')](function(_0x4e7086){logger[_0x6713('0x12')]('ShowVoiceQueue',_0x4e7086[_0x6713('0x14')],_0x45a2a2);_0x1e2f26(_0x313460[_0x6713('0x12')](0x1f4,_0x4e7086[_0x6713('0x14')]));});});}; \ No newline at end of file diff --git a/server/api/voiceQueue/voiceQueue.socket.js b/server/api/voiceQueue/voiceQueue.socket.js index d1f107a..632107a 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 _0x2bb6=['update','removeListener','voiceQueue:','./voiceQueue.events','save','remove'];(function(_0x326b26,_0x3d372b){var _0x185153=function(_0x102fa4){while(--_0x102fa4){_0x326b26['push'](_0x326b26['shift']());}};_0x185153(++_0x3d372b);}(_0x2bb6,0x6f));var _0x62bb=function(_0x488616,_0x516a25){_0x488616=_0x488616-0x0;var _0x217fb3=_0x2bb6[_0x488616];return _0x217fb3;};'use strict';var VoiceQueueEvents=require(_0x62bb('0x0'));var events=[_0x62bb('0x1'),_0x62bb('0x2'),_0x62bb('0x3')];function createListener(_0x1d31b1,_0xac8711){return function(_0x3ee177){_0xac8711['emit'](_0x1d31b1,_0x3ee177);};}function removeListener(_0x2b8b85,_0x2b4818){return function(){VoiceQueueEvents[_0x62bb('0x4')](_0x2b8b85,_0x2b4818);};}exports['register']=function(_0x1730f4){for(var _0x3b656b=0x0,_0x9d42dc=events['length'];_0x3b656b<_0x9d42dc;_0x3b656b++){var _0x378241=events[_0x3b656b];var _0x352783=createListener(_0x62bb('0x5')+_0x378241,_0x1730f4);VoiceQueueEvents['on'](_0x378241,_0x352783);}}; \ No newline at end of file +var _0x9605=['voiceQueue:','./voiceQueue.events','save','emit','removeListener','register','length'];(function(_0x54a14f,_0x59c124){var _0x47d334=function(_0xfe197f){while(--_0xfe197f){_0x54a14f['push'](_0x54a14f['shift']());}};_0x47d334(++_0x59c124);}(_0x9605,0x17b));var _0x5960=function(_0x16a866,_0x4739cc){_0x16a866=_0x16a866-0x0;var _0xc512cc=_0x9605[_0x16a866];return _0xc512cc;};'use strict';var VoiceQueueEvents=require(_0x5960('0x0'));var events=[_0x5960('0x1'),'remove','update'];function createListener(_0x25e6a7,_0x2836fb){return function(_0x5575a4){_0x2836fb[_0x5960('0x2')](_0x25e6a7,_0x5575a4);};}function removeListener(_0x170658,_0x4bf077){return function(){VoiceQueueEvents[_0x5960('0x3')](_0x170658,_0x4bf077);};}exports[_0x5960('0x4')]=function(_0x379a4f){for(var _0x102077=0x0,_0x457f2e=events[_0x5960('0x5')];_0x102077<_0x457f2e;_0x102077++){var _0x1209e4=events[_0x102077];var _0x30df61=createListener(_0x5960('0x6')+_0x1209e4,_0x379a4f);VoiceQueueEvents['on'](_0x1209e4,_0x30df61);}}; \ No newline at end of file diff --git a/server/api/voiceQueueReport/index.js b/server/api/voiceQueueReport/index.js index 22c3742..64c4d41 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 _0x8da1=['put','/:id','update','delete','destroy','exports','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./voiceQueueReport.controller','isAuthenticated','index','get','/describe','/index','getVoiceQueuesReport','create'];(function(_0x4954d4,_0x88836f){var _0x5d282d=function(_0x406e19){while(--_0x406e19){_0x4954d4['push'](_0x4954d4['shift']());}};_0x5d282d(++_0x88836f);}(_0x8da1,0xf8));var _0x18da=function(_0x24507a,_0x58e59b){_0x24507a=_0x24507a-0x0;var _0x20ed6a=_0x8da1[_0x24507a];return _0x20ed6a;};'use strict';var multer=require('multer');var util=require(_0x18da('0x0'));var path=require(_0x18da('0x1'));var timeout=require(_0x18da('0x2'));var express=require(_0x18da('0x3'));var router=express[_0x18da('0x4')]();var fs_extra=require(_0x18da('0x5'));var auth=require(_0x18da('0x6'));var interaction=require(_0x18da('0x7'));var config=require('../../config/environment');var controller=require(_0x18da('0x8'));router['get']('/',auth[_0x18da('0x9')](),controller[_0x18da('0xa')]);router[_0x18da('0xb')](_0x18da('0xc'),auth['isAuthenticated'](),controller['describe']);router[_0x18da('0xb')](_0x18da('0xd'),auth[_0x18da('0x9')](),controller[_0x18da('0xe')]);router['get']('/:id',auth[_0x18da('0x9')](),controller['show']);router['post']('/',auth[_0x18da('0x9')](),controller[_0x18da('0xf')]);router[_0x18da('0x10')](_0x18da('0x11'),auth[_0x18da('0x9')](),controller[_0x18da('0x12')]);router[_0x18da('0x13')](_0x18da('0x11'),auth[_0x18da('0x9')](),controller[_0x18da('0x14')]);module[_0x18da('0x15')]=router; \ No newline at end of file +var _0xbfcd=['get','isAuthenticated','/describe','/index','getVoiceQueuesReport','show','post','put','/:id','update','delete','destroy','exports','multer','util','path','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment'];(function(_0x1649af,_0x9522f8){var _0x28359a=function(_0x255fd8){while(--_0x255fd8){_0x1649af['push'](_0x1649af['shift']());}};_0x28359a(++_0x9522f8);}(_0xbfcd,0x199));var _0xdbfc=function(_0x14900a,_0x21472){_0x14900a=_0x14900a-0x0;var _0x1d916e=_0xbfcd[_0x14900a];return _0x1d916e;};'use strict';var multer=require(_0xdbfc('0x0'));var util=require(_0xdbfc('0x1'));var path=require(_0xdbfc('0x2'));var timeout=require('connect-timeout');var express=require(_0xdbfc('0x3'));var router=express[_0xdbfc('0x4')]();var fs_extra=require(_0xdbfc('0x5'));var auth=require(_0xdbfc('0x6'));var interaction=require(_0xdbfc('0x7'));var config=require(_0xdbfc('0x8'));var controller=require('./voiceQueueReport.controller');router[_0xdbfc('0x9')]('/',auth[_0xdbfc('0xa')](),controller['index']);router['get'](_0xdbfc('0xb'),auth[_0xdbfc('0xa')](),controller['describe']);router['get'](_0xdbfc('0xc'),auth['isAuthenticated'](),controller[_0xdbfc('0xd')]);router[_0xdbfc('0x9')]('/:id',auth[_0xdbfc('0xa')](),controller[_0xdbfc('0xe')]);router[_0xdbfc('0xf')]('/',auth[_0xdbfc('0xa')](),controller['create']);router[_0xdbfc('0x10')](_0xdbfc('0x11'),auth['isAuthenticated'](),controller[_0xdbfc('0x12')]);router[_0xdbfc('0x13')](_0xdbfc('0x11'),auth['isAuthenticated'](),controller[_0xdbfc('0x14')]);module[_0xdbfc('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 38c918a..6125800 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 _0x17cf=['format','YYYY-MM-DD\x20HH:mm:ss','diff','seconds','setDataValue','INTEGER','BOOLEAN','COMPLETEDBYCALLER,\x20COMPLETEDBYAGENT,\x20FORWARDTRANFER,\x20BLINDTRANSFER,\x20ATTENDEDTRANSFER,\x20EXITWITHKEY,\x20TIMEOUT','FORWARD,\x20BLIND,\x20ATTENDED','sequelize','exports','STRING','DATE'];(function(_0x4f310b,_0x2eb1b5){var _0x404f33=function(_0x24781f){while(--_0x24781f){_0x4f310b['push'](_0x4f310b['shift']());}};_0x404f33(++_0x2eb1b5);}(_0x17cf,0x1c3));var _0xf17c=function(_0x4565bf,_0x5ad9d6){_0x4565bf=_0x4565bf-0x0;var _0x5610ba=_0x17cf[_0x4565bf];return _0x5610ba;};'use strict';var Sequelize=require(_0xf17c('0x0'));var moment=require('moment');module[_0xf17c('0x1')]={'type':{'type':Sequelize[_0xf17c('0x2')]},'uniqueid':{'type':Sequelize['STRING']},'calleridnum':{'type':Sequelize[_0xf17c('0x2')]},'calleridname':{'type':Sequelize[_0xf17c('0x2')]},'queue':{'type':Sequelize[_0xf17c('0x2')]},'queuecallerjoinAt':{'type':Sequelize[_0xf17c('0x3')]},'queuecallerleaveAt':{'type':Sequelize[_0xf17c('0x3')],'set':function(_0x111224){var _0x3d1a7d=moment(_0x111224);var _0x48a12d=moment(this['getDataValue']('queuecallerjoinAt'))[_0xf17c('0x4')](_0xf17c('0x5'));var _0x2c6fcc=_0x3d1a7d[_0xf17c('0x6')](_0x48a12d,_0xf17c('0x7'));this['setDataValue']('queuecallerleaveAt',_0x111224);this[_0xf17c('0x8')]('holdtime',_0x2c6fcc||null);}},'position':{'type':Sequelize['INTEGER']},'count':{'type':Sequelize[_0xf17c('0x9')]},'queuecallerabandon':{'type':Sequelize[_0xf17c('0xa')],'defaultValue':![]},'queuecallerabandonAt':{'type':Sequelize[_0xf17c('0x3')]},'queuecallercomplete':{'type':Sequelize[_0xf17c('0xa')],'defaultValue':![]},'queuecallercompleteAt':{'type':Sequelize[_0xf17c('0x3')]},'queuecallerexit':{'type':Sequelize[_0xf17c('0xa')],'defaultValue':![]},'queuecallerexitAt':{'type':Sequelize[_0xf17c('0x3')]},'queuecallerexitreason':{'type':Sequelize[_0xf17c('0x2')],'comment':_0xf17c('0xb')},'originalposition':{'type':Sequelize[_0xf17c('0x9')]},'channel':{'type':Sequelize[_0xf17c('0x2')]},'connectedlinenum':{'type':Sequelize['STRING']},'connectedlinename':{'type':Sequelize[_0xf17c('0x2')]},'accountcode':{'type':Sequelize[_0xf17c('0x2')]},'context':{'type':Sequelize['STRING']},'exten':{'type':Sequelize['STRING']},'priority':{'type':Sequelize['STRING']},'holdtime':{'type':Sequelize['INTEGER']},'mohtime':{'type':Sequelize[_0xf17c('0x9')],'defaultValue':0x0},'assigned':{'type':Sequelize[_0xf17c('0xa')],'defaultValue':![]},'lastAssignedTo':{'type':Sequelize[_0xf17c('0x2')]},'transfer':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'transfertype':{'type':Sequelize[_0xf17c('0x2')],'comment':_0xf17c('0xc')},'transferexten':{'type':Sequelize['STRING']},'transferuniqueid':{'type':Sequelize[_0xf17c('0x2')]},'disposition':{'type':Sequelize[_0xf17c('0x2')]},'secondDisposition':{'type':Sequelize['STRING']},'thirdDisposition':{'type':Sequelize[_0xf17c('0x2')]},'queuecallerenterreason':{'type':Sequelize[_0xf17c('0x9')],'defaultValue':0x0},'note':{'type':Sequelize[_0xf17c('0x2')]}}; \ No newline at end of file +var _0x0498=['setDataValue','holdtime','INTEGER','BOOLEAN','COMPLETEDBYCALLER,\x20COMPLETEDBYAGENT,\x20FORWARDTRANFER,\x20BLINDTRANSFER,\x20ATTENDEDTRANSFER,\x20EXITWITHKEY,\x20TIMEOUT','FORWARD,\x20BLIND,\x20ATTENDED','sequelize','moment','exports','STRING','DATE','getDataValue','queuecallerjoinAt','format','diff','seconds'];(function(_0x397188,_0x14fe36){var _0x291613=function(_0x316031){while(--_0x316031){_0x397188['push'](_0x397188['shift']());}};_0x291613(++_0x14fe36);}(_0x0498,0xc6));var _0x8049=function(_0x4c12ec,_0x2e9103){_0x4c12ec=_0x4c12ec-0x0;var _0x3ae42c=_0x0498[_0x4c12ec];return _0x3ae42c;};'use strict';var Sequelize=require(_0x8049('0x0'));var moment=require(_0x8049('0x1'));module[_0x8049('0x2')]={'type':{'type':Sequelize[_0x8049('0x3')]},'uniqueid':{'type':Sequelize[_0x8049('0x3')]},'calleridnum':{'type':Sequelize[_0x8049('0x3')]},'calleridname':{'type':Sequelize[_0x8049('0x3')]},'queue':{'type':Sequelize[_0x8049('0x3')]},'queuecallerjoinAt':{'type':Sequelize[_0x8049('0x4')]},'queuecallerleaveAt':{'type':Sequelize[_0x8049('0x4')],'set':function(_0x54495d){var _0x24ef48=moment(_0x54495d);var _0x25ccb1=moment(this[_0x8049('0x5')](_0x8049('0x6')))[_0x8049('0x7')]('YYYY-MM-DD\x20HH:mm:ss');var _0x24c616=_0x24ef48[_0x8049('0x8')](_0x25ccb1,_0x8049('0x9'));this[_0x8049('0xa')]('queuecallerleaveAt',_0x54495d);this['setDataValue'](_0x8049('0xb'),_0x24c616||null);}},'position':{'type':Sequelize['INTEGER']},'count':{'type':Sequelize[_0x8049('0xc')]},'queuecallerabandon':{'type':Sequelize[_0x8049('0xd')],'defaultValue':![]},'queuecallerabandonAt':{'type':Sequelize[_0x8049('0x4')]},'queuecallercomplete':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'queuecallercompleteAt':{'type':Sequelize['DATE']},'queuecallerexit':{'type':Sequelize[_0x8049('0xd')],'defaultValue':![]},'queuecallerexitAt':{'type':Sequelize[_0x8049('0x4')]},'queuecallerexitreason':{'type':Sequelize[_0x8049('0x3')],'comment':_0x8049('0xe')},'originalposition':{'type':Sequelize[_0x8049('0xc')]},'channel':{'type':Sequelize[_0x8049('0x3')]},'connectedlinenum':{'type':Sequelize[_0x8049('0x3')]},'connectedlinename':{'type':Sequelize[_0x8049('0x3')]},'accountcode':{'type':Sequelize['STRING']},'context':{'type':Sequelize[_0x8049('0x3')]},'exten':{'type':Sequelize[_0x8049('0x3')]},'priority':{'type':Sequelize['STRING']},'holdtime':{'type':Sequelize['INTEGER']},'mohtime':{'type':Sequelize[_0x8049('0xc')],'defaultValue':0x0},'assigned':{'type':Sequelize[_0x8049('0xd')],'defaultValue':![]},'lastAssignedTo':{'type':Sequelize[_0x8049('0x3')]},'transfer':{'type':Sequelize[_0x8049('0xd')],'defaultValue':![]},'transfertype':{'type':Sequelize['STRING'],'comment':_0x8049('0xf')},'transferexten':{'type':Sequelize[_0x8049('0x3')]},'transferuniqueid':{'type':Sequelize[_0x8049('0x3')]},'disposition':{'type':Sequelize[_0x8049('0x3')]},'secondDisposition':{'type':Sequelize[_0x8049('0x3')]},'thirdDisposition':{'type':Sequelize[_0x8049('0x3')]},'queuecallerenterreason':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'note':{'type':Sequelize[_0x8049('0x3')]}}; \ No newline at end of file diff --git a/server/api/voiceQueueReport/voiceQueueReport.controller.js b/server/api/voiceQueueReport/voiceQueueReport.controller.js index 5c50566..fd9f331 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 _0xece1=['desk.js','querystring','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','localhost','./voiceQueueReport.socket','sendStatus','json','offset','undefined','limit','count','status','set','Content-Range','apply','reject','update','then','destroy','end','error','stack','name','send','index','map','rawAttributes','fieldName','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','type','options','VoiceQueueReport','includeAll','include','findAll','rows','show','params','find','catch','create','body','describe','getVoiceQueuesReport','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto'];(function(_0x1c86af,_0x40f50d){var _0xbdd025=function(_0xd168a4){while(--_0xd168a4){_0x1c86af['push'](_0x1c86af['shift']());}};_0xbdd025(++_0x40f50d);}(_0xece1,0x1ed));var _0x1ece=function(_0x497d6d,_0xff7558){_0x497d6d=_0x497d6d-0x0;var _0x4a1d9a=_0xece1[_0x497d6d];return _0x4a1d9a;};'use strict';var emlformat=require(_0x1ece('0x0'));var rimraf=require(_0x1ece('0x1'));var zipdir=require(_0x1ece('0x2'));var jsonpatch=require(_0x1ece('0x3'));var rp=require(_0x1ece('0x4'));var moment=require(_0x1ece('0x5'));var BPromise=require(_0x1ece('0x6'));var Mustache=require(_0x1ece('0x7'));var util=require(_0x1ece('0x8'));var path=require(_0x1ece('0x9'));var sox=require(_0x1ece('0xa'));var csv=require(_0x1ece('0xb'));var ejs=require(_0x1ece('0xc'));var fs=require('fs');var fs_extra=require(_0x1ece('0xd'));var _=require(_0x1ece('0xe'));var squel=require(_0x1ece('0xf'));var crypto=require(_0x1ece('0x10'));var jsforce=require('jsforce');var deskjs=require(_0x1ece('0x11'));var toCsv=require(_0x1ece('0xb'));var querystring=require(_0x1ece('0x12'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0x1ece('0x13'));var as=require(_0x1ece('0x14'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x1ece('0x15'))(_0x1ece('0x16'));var utils=require(_0x1ece('0x17'));var config=require(_0x1ece('0x18'));var licenseUtil=require(_0x1ece('0x19'));var db=require(_0x1ece('0x1a'))['db'];config[_0x1ece('0x1b')]=_[_0x1ece('0x1c')](config['redis'],{'host':_0x1ece('0x1d'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require(_0x1ece('0x1e'))['register'](socket);function respondWithStatusCode(_0x27d363,_0x1d180f){_0x1d180f=_0x1d180f||0xcc;return function(_0x387e45){if(_0x387e45){return _0x27d363[_0x1ece('0x1f')](_0x1d180f);}return _0x27d363['status'](_0x1d180f)['end']();};}function respondWithResult(_0x312d65,_0x264603){_0x264603=_0x264603||0xc8;return function(_0x42a853){if(_0x42a853){return _0x312d65['status'](_0x264603)[_0x1ece('0x20')](_0x42a853);}};}function respondWithFilteredResult(_0x5342ce,_0x837e72){return function(_0x27da97){if(_0x27da97){var _0x394774=typeof _0x837e72[_0x1ece('0x21')]===_0x1ece('0x22')&&typeof _0x837e72[_0x1ece('0x23')]===_0x1ece('0x22');var _0xe6569c=_0x27da97[_0x1ece('0x24')];var _0x3ab43d=_0x394774?0x0:_0x837e72['offset'];var _0x36d9fe=_0x394774?_0x27da97[_0x1ece('0x24')]:_0x837e72[_0x1ece('0x21')]+_0x837e72[_0x1ece('0x23')];var _0x5da54c;if(_0x36d9fe>=_0xe6569c){_0x36d9fe=_0xe6569c;_0x5da54c=0xc8;}else{_0x5da54c=0xce;}_0x5342ce[_0x1ece('0x25')](_0x5da54c);return _0x5342ce[_0x1ece('0x26')](_0x1ece('0x27'),_0x3ab43d+'-'+_0x36d9fe+'/'+_0xe6569c)[_0x1ece('0x20')](_0x27da97);}return null;};}function patchUpdates(_0x4ffd10){return function(_0x28f244){try{jsonpatch[_0x1ece('0x28')](_0x28f244,_0x4ffd10,!![]);}catch(_0x4ae181){return BPromise[_0x1ece('0x29')](_0x4ae181);}return _0x28f244['save']();};}function saveUpdates(_0x1788b6,_0x24381c){return function(_0x26810e){if(_0x26810e){return _0x26810e[_0x1ece('0x2a')](_0x1788b6)[_0x1ece('0x2b')](function(_0x3a9824){return _0x3a9824;});}return null;};}function removeEntity(_0x46a34f,_0x3471d8){return function(_0x1eab76){if(_0x1eab76){return _0x1eab76[_0x1ece('0x2c')]()[_0x1ece('0x2b')](function(){_0x46a34f[_0x1ece('0x25')](0xcc)[_0x1ece('0x2d')]();});}};}function handleEntityNotFound(_0x32c4f6,_0x1f4e09){return function(_0x5ab952){if(!_0x5ab952){_0x32c4f6[_0x1ece('0x1f')](0x194);}return _0x5ab952;};}function handleError(_0x4767e6,_0x73a30a){_0x73a30a=_0x73a30a||0x1f4;return function(_0x25b1bc){logger[_0x1ece('0x2e')](_0x25b1bc[_0x1ece('0x2f')]);if(_0x25b1bc[_0x1ece('0x30')]){delete _0x25b1bc['name'];}_0x4767e6['status'](_0x73a30a)[_0x1ece('0x31')](_0x25b1bc);};}exports[_0x1ece('0x32')]=function(_0x55988d,_0x4ed723){var _0x31e99b={},_0x26634c={},_0x44b1b3={'count':0x0,'rows':[]};var _0x6c7a09=_[_0x1ece('0x33')](db['VoiceQueueReport'][_0x1ece('0x34')],function(_0xdd702d){return{'name':_0xdd702d[_0x1ece('0x35')],'type':_0xdd702d['type']['key']};});_0x26634c[_0x1ece('0x36')]=_[_0x1ece('0x33')](_0x6c7a09,_0x1ece('0x30'));_0x26634c[_0x1ece('0x37')]=_[_0x1ece('0x38')](_0x55988d[_0x1ece('0x37')]);_0x26634c[_0x1ece('0x39')]=_[_0x1ece('0x3a')](_0x26634c['model'],_0x26634c['query']);_0x31e99b[_0x1ece('0x3b')]=_[_0x1ece('0x3a')](_0x26634c['model'],qs['fields'](_0x55988d[_0x1ece('0x37')][_0x1ece('0x3c')]));_0x31e99b['attributes']=_0x31e99b['attributes'][_0x1ece('0x3d')]?_0x31e99b[_0x1ece('0x3b')]:_0x26634c[_0x1ece('0x36')];if(!_0x55988d[_0x1ece('0x37')][_0x1ece('0x3e')](_0x1ece('0x3f'))){_0x31e99b[_0x1ece('0x23')]=qs[_0x1ece('0x23')](_0x55988d[_0x1ece('0x37')]['limit']);_0x31e99b['offset']=qs[_0x1ece('0x21')](_0x55988d[_0x1ece('0x37')][_0x1ece('0x21')]);}_0x31e99b[_0x1ece('0x40')]=qs[_0x1ece('0x41')](_0x55988d[_0x1ece('0x37')][_0x1ece('0x41')]);_0x31e99b[_0x1ece('0x42')]=qs['filters'](_[_0x1ece('0x43')](_0x55988d[_0x1ece('0x37')],_0x26634c['filters']),_0x6c7a09);if(_0x55988d[_0x1ece('0x37')][_0x1ece('0x44')]){_0x31e99b['where']=_[_0x1ece('0x45')](_0x31e99b[_0x1ece('0x42')],{'$or':_['map'](_0x6c7a09,function(_0x1a2e85){if(_0x1a2e85[_0x1ece('0x46')]!=='VIRTUAL'){var _0x1aebfb={};_0x1aebfb[_0x1a2e85[_0x1ece('0x30')]]={'$like':'%'+_0x55988d[_0x1ece('0x37')][_0x1ece('0x44')]+'%'};return _0x1aebfb;}})});}_0x31e99b=_[_0x1ece('0x45')]({},_0x31e99b,_0x55988d[_0x1ece('0x47')]);var _0x141301={'where':_0x31e99b['where']};return db[_0x1ece('0x48')][_0x1ece('0x24')](_0x141301)[_0x1ece('0x2b')](function(_0x4bd2c1){_0x44b1b3[_0x1ece('0x24')]=_0x4bd2c1;if(_0x55988d[_0x1ece('0x37')][_0x1ece('0x49')]){_0x31e99b[_0x1ece('0x4a')]=[{'all':!![]}];}return db['VoiceQueueReport'][_0x1ece('0x4b')](_0x31e99b);})['then'](function(_0x54413a){_0x44b1b3[_0x1ece('0x4c')]=_0x54413a;return _0x44b1b3;})[_0x1ece('0x2b')](respondWithFilteredResult(_0x4ed723,_0x31e99b))['catch'](handleError(_0x4ed723,null));};exports[_0x1ece('0x4d')]=function(_0x134473,_0x4b19ad){var _0x116912={'raw':![],'where':{'id':_0x134473[_0x1ece('0x4e')]['id']}},_0x57f107={};_0x57f107[_0x1ece('0x36')]=_['keys'](db['VoiceQueueReport'][_0x1ece('0x34')]);_0x57f107[_0x1ece('0x37')]=_[_0x1ece('0x38')](_0x134473['query']);_0x57f107['filters']=_[_0x1ece('0x3a')](_0x57f107[_0x1ece('0x36')],_0x57f107[_0x1ece('0x37')]);_0x116912[_0x1ece('0x3b')]=_[_0x1ece('0x3a')](_0x57f107[_0x1ece('0x36')],qs[_0x1ece('0x3c')](_0x134473[_0x1ece('0x37')][_0x1ece('0x3c')]));_0x116912[_0x1ece('0x3b')]=_0x116912[_0x1ece('0x3b')][_0x1ece('0x3d')]?_0x116912['attributes']:_0x57f107['model'];if(_0x134473[_0x1ece('0x37')][_0x1ece('0x49')]){_0x116912[_0x1ece('0x4a')]=[{'all':!![]}];}_0x116912=_['merge']({},_0x116912,_0x134473['options']);return db[_0x1ece('0x48')][_0x1ece('0x4f')](_0x116912)[_0x1ece('0x2b')](handleEntityNotFound(_0x4b19ad,null))['then'](respondWithResult(_0x4b19ad,null))[_0x1ece('0x50')](handleError(_0x4b19ad,null));};exports['create']=function(_0x24f01c,_0x1ec49){return db[_0x1ece('0x48')][_0x1ece('0x51')](_0x24f01c[_0x1ece('0x52')],{})[_0x1ece('0x2b')](respondWithResult(_0x1ec49,0xc9))[_0x1ece('0x50')](handleError(_0x1ec49,null));};exports['update']=function(_0x1b2737,_0x1374ea){if(_0x1b2737['body']['id']){delete _0x1b2737[_0x1ece('0x52')]['id'];}return db[_0x1ece('0x48')]['find']({'where':{'id':_0x1b2737['params']['id']}})[_0x1ece('0x2b')](handleEntityNotFound(_0x1374ea,null))[_0x1ece('0x2b')](saveUpdates(_0x1b2737['body'],null))[_0x1ece('0x2b')](respondWithResult(_0x1374ea,null))[_0x1ece('0x50')](handleError(_0x1374ea,null));};exports[_0x1ece('0x2c')]=function(_0x5f1fbb,_0x2d487e){return db[_0x1ece('0x48')][_0x1ece('0x4f')]({'where':{'id':_0x5f1fbb['params']['id']}})[_0x1ece('0x2b')](handleEntityNotFound(_0x2d487e,null))[_0x1ece('0x2b')](removeEntity(_0x2d487e,null))['catch'](handleError(_0x2d487e,null));};exports[_0x1ece('0x53')]=function(_0x5a0245,_0x5c87b4){return db['VoiceQueueReport']['describe']()['then'](respondWithResult(_0x5c87b4,null))[_0x1ece('0x50')](handleError(_0x5c87b4,null));};exports[_0x1ece('0x54')]=function(_0x265c2e,_0x25b3b9){var _0x1aed47={},_0x5e4672={},_0x2f5655={'count':0x0,'rows':[]};_0x5e4672[_0x1ece('0x36')]=_[_0x1ece('0x38')](db[_0x1ece('0x48')][_0x1ece('0x34')]);_0x5e4672[_0x1ece('0x37')]=_['keys'](_0x265c2e[_0x1ece('0x37')]);_0x5e4672['filters']=_[_0x1ece('0x3a')](_0x5e4672[_0x1ece('0x36')],_0x5e4672[_0x1ece('0x37')]);_0x1aed47[_0x1ece('0x3b')]=_[_0x1ece('0x3a')](_0x5e4672['model'],qs[_0x1ece('0x3c')](_0x265c2e[_0x1ece('0x37')][_0x1ece('0x3c')]));_0x1aed47[_0x1ece('0x3b')]=_0x1aed47[_0x1ece('0x3b')][_0x1ece('0x3d')]?_0x1aed47[_0x1ece('0x3b')]:_0x5e4672[_0x1ece('0x36')];if(!_0x265c2e['query']['hasOwnProperty'](_0x1ece('0x3f'))){_0x1aed47[_0x1ece('0x23')]=qs[_0x1ece('0x23')](_0x265c2e[_0x1ece('0x37')][_0x1ece('0x23')]);_0x1aed47[_0x1ece('0x21')]=qs[_0x1ece('0x21')](_0x265c2e[_0x1ece('0x37')][_0x1ece('0x21')]);}_0x1aed47[_0x1ece('0x40')]=qs[_0x1ece('0x41')](_0x265c2e[_0x1ece('0x37')][_0x1ece('0x41')]);_0x1aed47[_0x1ece('0x42')]=qs[_0x1ece('0x39')](_['pick'](_0x265c2e[_0x1ece('0x37')],_0x5e4672[_0x1ece('0x39')]));if(_0x265c2e['query']['filter']){_0x1aed47['where']=_[_0x1ece('0x45')](_0x1aed47[_0x1ece('0x42')],{'$or':_[_0x1ece('0x33')](_0x1aed47[_0x1ece('0x3b')],function(_0xd80f4a){var _0x15a3a8={};_0x15a3a8[_0xd80f4a]={'$like':'%'+_0x265c2e[_0x1ece('0x37')][_0x1ece('0x44')]+'%'};return _0x15a3a8;})});}_0x1aed47=_['merge']({},_0x1aed47,_0x265c2e[_0x1ece('0x47')]);var _0x38a4a2={'where':_0x1aed47['where']};return db[_0x1ece('0x48')][_0x1ece('0x24')](_0x38a4a2)[_0x1ece('0x2b')](function(_0x4fe660){_0x2f5655[_0x1ece('0x24')]=_0x4fe660;if(_0x265c2e[_0x1ece('0x37')][_0x1ece('0x49')]){_0x1aed47['include']=[{'all':!![]}];}return db[_0x1ece('0x48')][_0x1ece('0x4b')](_0x1aed47);})[_0x1ece('0x2b')](function(_0x44cb04){_0x2f5655['rows']=_0x44cb04;return _0x2f5655;})[_0x1ece('0x2b')](respondWithFilteredResult(_0x25b3b9,_0x1aed47,_0x1ece('0x54')))[_0x1ece('0x50')](handleError(_0x25b3b9,null,_0x1ece('0x54')));}; \ No newline at end of file +var _0x8d00=['options','includeAll','include','findAll','rows','catch','show','params','find','create','body','describe','getVoiceQueuesReport','nolimit','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/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../mysqldb','redis','defaults','localhost','register','sendStatus','end','status','json','offset','undefined','limit','count','set','Content-Range','apply','save','update','then','destroy','error','stack','name','send','map','VoiceQueueReport','rawAttributes','fieldName','type','key','model','query','keys','attributes','intersection','fields','length','hasOwnProperty','order','sort','filters','pick','filter','where','merge','VIRTUAL'];(function(_0x4ec9e3,_0x15fbf4){var _0x2883ce=function(_0x3e9998){while(--_0x3e9998){_0x4ec9e3['push'](_0x4ec9e3['shift']());}};_0x2883ce(++_0x15fbf4);}(_0x8d00,0x1cb));var _0x08d0=function(_0x50d728,_0x4f3bec){_0x50d728=_0x50d728-0x0;var _0x191dc4=_0x8d00[_0x50d728];return _0x191dc4;};'use strict';var emlformat=require(_0x08d0('0x0'));var rimraf=require(_0x08d0('0x1'));var zipdir=require(_0x08d0('0x2'));var jsonpatch=require(_0x08d0('0x3'));var rp=require(_0x08d0('0x4'));var moment=require(_0x08d0('0x5'));var BPromise=require(_0x08d0('0x6'));var Mustache=require(_0x08d0('0x7'));var util=require(_0x08d0('0x8'));var path=require(_0x08d0('0x9'));var sox=require(_0x08d0('0xa'));var csv=require(_0x08d0('0xb'));var ejs=require(_0x08d0('0xc'));var fs=require('fs');var fs_extra=require(_0x08d0('0xd'));var _=require(_0x08d0('0xe'));var squel=require(_0x08d0('0xf'));var crypto=require(_0x08d0('0x10'));var jsforce=require(_0x08d0('0x11'));var deskjs=require(_0x08d0('0x12'));var toCsv=require(_0x08d0('0xb'));var querystring=require(_0x08d0('0x13'));var Papa=require(_0x08d0('0x14'));var Redis=require(_0x08d0('0x15'));var authService=require(_0x08d0('0x16'));var qs=require(_0x08d0('0x17'));var as=require(_0x08d0('0x18'));var hardwareService=require(_0x08d0('0x19'));var logger=require(_0x08d0('0x1a'))(_0x08d0('0x1b'));var utils=require('../../config/utils');var config=require(_0x08d0('0x1c'));var licenseUtil=require('../../config/license/util');var db=require(_0x08d0('0x1d'))['db'];config[_0x08d0('0x1e')]=_[_0x08d0('0x1f')](config[_0x08d0('0x1e')],{'host':_0x08d0('0x20'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x08d0('0x1e')]));require('./voiceQueueReport.socket')[_0x08d0('0x21')](socket);function respondWithStatusCode(_0x339441,_0x369e4b){_0x369e4b=_0x369e4b||0xcc;return function(_0x287917){if(_0x287917){return _0x339441[_0x08d0('0x22')](_0x369e4b);}return _0x339441['status'](_0x369e4b)[_0x08d0('0x23')]();};}function respondWithResult(_0x33dfb1,_0x55fe0c){_0x55fe0c=_0x55fe0c||0xc8;return function(_0x3269fa){if(_0x3269fa){return _0x33dfb1[_0x08d0('0x24')](_0x55fe0c)[_0x08d0('0x25')](_0x3269fa);}};}function respondWithFilteredResult(_0x5cd46a,_0x34f37b){return function(_0x50df97){if(_0x50df97){var _0x171f2a=typeof _0x34f37b[_0x08d0('0x26')]===_0x08d0('0x27')&&typeof _0x34f37b[_0x08d0('0x28')]===_0x08d0('0x27');var _0x57d712=_0x50df97['count'];var _0x4d4c58=_0x171f2a?0x0:_0x34f37b['offset'];var _0x44be1c=_0x171f2a?_0x50df97[_0x08d0('0x29')]:_0x34f37b[_0x08d0('0x26')]+_0x34f37b[_0x08d0('0x28')];var _0x3afbc9;if(_0x44be1c>=_0x57d712){_0x44be1c=_0x57d712;_0x3afbc9=0xc8;}else{_0x3afbc9=0xce;}_0x5cd46a[_0x08d0('0x24')](_0x3afbc9);return _0x5cd46a[_0x08d0('0x2a')](_0x08d0('0x2b'),_0x4d4c58+'-'+_0x44be1c+'/'+_0x57d712)[_0x08d0('0x25')](_0x50df97);}return null;};}function patchUpdates(_0x5a1e98){return function(_0x48c87e){try{jsonpatch[_0x08d0('0x2c')](_0x48c87e,_0x5a1e98,!![]);}catch(_0x7afbba){return BPromise['reject'](_0x7afbba);}return _0x48c87e[_0x08d0('0x2d')]();};}function saveUpdates(_0x4294c5,_0x23dfce){return function(_0x36323e){if(_0x36323e){return _0x36323e[_0x08d0('0x2e')](_0x4294c5)[_0x08d0('0x2f')](function(_0x5a0e4a){return _0x5a0e4a;});}return null;};}function removeEntity(_0x3795b2,_0xaa0fd4){return function(_0x350753){if(_0x350753){return _0x350753[_0x08d0('0x30')]()['then'](function(){_0x3795b2[_0x08d0('0x24')](0xcc)['end']();});}};}function handleEntityNotFound(_0x5c9c38,_0x2000ae){return function(_0x1842ec){if(!_0x1842ec){_0x5c9c38[_0x08d0('0x22')](0x194);}return _0x1842ec;};}function handleError(_0x378367,_0x1a6664){_0x1a6664=_0x1a6664||0x1f4;return function(_0x1db66c){logger[_0x08d0('0x31')](_0x1db66c[_0x08d0('0x32')]);if(_0x1db66c[_0x08d0('0x33')]){delete _0x1db66c[_0x08d0('0x33')];}_0x378367[_0x08d0('0x24')](_0x1a6664)[_0x08d0('0x34')](_0x1db66c);};}exports['index']=function(_0x5e49e7,_0x16aa1f){var _0xb7c7ed={},_0x2cf332={},_0x4d6b8a={'count':0x0,'rows':[]};var _0xb4fb25=_[_0x08d0('0x35')](db[_0x08d0('0x36')][_0x08d0('0x37')],function(_0x412209){return{'name':_0x412209[_0x08d0('0x38')],'type':_0x412209[_0x08d0('0x39')][_0x08d0('0x3a')]};});_0x2cf332[_0x08d0('0x3b')]=_[_0x08d0('0x35')](_0xb4fb25,'name');_0x2cf332[_0x08d0('0x3c')]=_[_0x08d0('0x3d')](_0x5e49e7[_0x08d0('0x3c')]);_0x2cf332['filters']=_['intersection'](_0x2cf332[_0x08d0('0x3b')],_0x2cf332[_0x08d0('0x3c')]);_0xb7c7ed[_0x08d0('0x3e')]=_[_0x08d0('0x3f')](_0x2cf332[_0x08d0('0x3b')],qs[_0x08d0('0x40')](_0x5e49e7[_0x08d0('0x3c')][_0x08d0('0x40')]));_0xb7c7ed[_0x08d0('0x3e')]=_0xb7c7ed[_0x08d0('0x3e')][_0x08d0('0x41')]?_0xb7c7ed[_0x08d0('0x3e')]:_0x2cf332[_0x08d0('0x3b')];if(!_0x5e49e7['query'][_0x08d0('0x42')]('nolimit')){_0xb7c7ed[_0x08d0('0x28')]=qs[_0x08d0('0x28')](_0x5e49e7[_0x08d0('0x3c')][_0x08d0('0x28')]);_0xb7c7ed[_0x08d0('0x26')]=qs[_0x08d0('0x26')](_0x5e49e7[_0x08d0('0x3c')][_0x08d0('0x26')]);}_0xb7c7ed[_0x08d0('0x43')]=qs[_0x08d0('0x44')](_0x5e49e7[_0x08d0('0x3c')][_0x08d0('0x44')]);_0xb7c7ed['where']=qs[_0x08d0('0x45')](_[_0x08d0('0x46')](_0x5e49e7['query'],_0x2cf332[_0x08d0('0x45')]),_0xb4fb25);if(_0x5e49e7[_0x08d0('0x3c')][_0x08d0('0x47')]){_0xb7c7ed[_0x08d0('0x48')]=_[_0x08d0('0x49')](_0xb7c7ed[_0x08d0('0x48')],{'$or':_[_0x08d0('0x35')](_0xb4fb25,function(_0x4765e2){if(_0x4765e2['type']!==_0x08d0('0x4a')){var _0x35a263={};_0x35a263[_0x4765e2[_0x08d0('0x33')]]={'$like':'%'+_0x5e49e7[_0x08d0('0x3c')][_0x08d0('0x47')]+'%'};return _0x35a263;}})});}_0xb7c7ed=_[_0x08d0('0x49')]({},_0xb7c7ed,_0x5e49e7[_0x08d0('0x4b')]);var _0x371058={'where':_0xb7c7ed[_0x08d0('0x48')]};return db[_0x08d0('0x36')][_0x08d0('0x29')](_0x371058)['then'](function(_0x35ff04){_0x4d6b8a[_0x08d0('0x29')]=_0x35ff04;if(_0x5e49e7[_0x08d0('0x3c')][_0x08d0('0x4c')]){_0xb7c7ed[_0x08d0('0x4d')]=[{'all':!![]}];}return db[_0x08d0('0x36')][_0x08d0('0x4e')](_0xb7c7ed);})[_0x08d0('0x2f')](function(_0x10e104){_0x4d6b8a[_0x08d0('0x4f')]=_0x10e104;return _0x4d6b8a;})[_0x08d0('0x2f')](respondWithFilteredResult(_0x16aa1f,_0xb7c7ed))[_0x08d0('0x50')](handleError(_0x16aa1f,null));};exports[_0x08d0('0x51')]=function(_0xa5170,_0x4b89eb){var _0x3384cf={'raw':![],'where':{'id':_0xa5170[_0x08d0('0x52')]['id']}},_0x2eccc1={};_0x2eccc1['model']=_[_0x08d0('0x3d')](db[_0x08d0('0x36')][_0x08d0('0x37')]);_0x2eccc1[_0x08d0('0x3c')]=_['keys'](_0xa5170['query']);_0x2eccc1[_0x08d0('0x45')]=_[_0x08d0('0x3f')](_0x2eccc1['model'],_0x2eccc1[_0x08d0('0x3c')]);_0x3384cf[_0x08d0('0x3e')]=_[_0x08d0('0x3f')](_0x2eccc1[_0x08d0('0x3b')],qs[_0x08d0('0x40')](_0xa5170['query'][_0x08d0('0x40')]));_0x3384cf['attributes']=_0x3384cf[_0x08d0('0x3e')][_0x08d0('0x41')]?_0x3384cf[_0x08d0('0x3e')]:_0x2eccc1['model'];if(_0xa5170[_0x08d0('0x3c')][_0x08d0('0x4c')]){_0x3384cf[_0x08d0('0x4d')]=[{'all':!![]}];}_0x3384cf=_[_0x08d0('0x49')]({},_0x3384cf,_0xa5170['options']);return db[_0x08d0('0x36')][_0x08d0('0x53')](_0x3384cf)[_0x08d0('0x2f')](handleEntityNotFound(_0x4b89eb,null))[_0x08d0('0x2f')](respondWithResult(_0x4b89eb,null))[_0x08d0('0x50')](handleError(_0x4b89eb,null));};exports[_0x08d0('0x54')]=function(_0x48df07,_0x5d7e58){return db[_0x08d0('0x36')][_0x08d0('0x54')](_0x48df07[_0x08d0('0x55')],{})[_0x08d0('0x2f')](respondWithResult(_0x5d7e58,0xc9))['catch'](handleError(_0x5d7e58,null));};exports['update']=function(_0x31796c,_0x43e16b){if(_0x31796c['body']['id']){delete _0x31796c['body']['id'];}return db['VoiceQueueReport']['find']({'where':{'id':_0x31796c['params']['id']}})[_0x08d0('0x2f')](handleEntityNotFound(_0x43e16b,null))['then'](saveUpdates(_0x31796c[_0x08d0('0x55')],null))[_0x08d0('0x2f')](respondWithResult(_0x43e16b,null))[_0x08d0('0x50')](handleError(_0x43e16b,null));};exports[_0x08d0('0x30')]=function(_0x828e66,_0x26383b){return db[_0x08d0('0x36')][_0x08d0('0x53')]({'where':{'id':_0x828e66[_0x08d0('0x52')]['id']}})['then'](handleEntityNotFound(_0x26383b,null))[_0x08d0('0x2f')](removeEntity(_0x26383b,null))['catch'](handleError(_0x26383b,null));};exports[_0x08d0('0x56')]=function(_0x5c67af,_0x46fc59){return db['VoiceQueueReport'][_0x08d0('0x56')]()[_0x08d0('0x2f')](respondWithResult(_0x46fc59,null))[_0x08d0('0x50')](handleError(_0x46fc59,null));};exports[_0x08d0('0x57')]=function(_0x3099f3,_0x396e22){var _0x234892={},_0x2eca6d={},_0x4f03bf={'count':0x0,'rows':[]};_0x2eca6d[_0x08d0('0x3b')]=_[_0x08d0('0x3d')](db['VoiceQueueReport'][_0x08d0('0x37')]);_0x2eca6d['query']=_[_0x08d0('0x3d')](_0x3099f3[_0x08d0('0x3c')]);_0x2eca6d[_0x08d0('0x45')]=_[_0x08d0('0x3f')](_0x2eca6d[_0x08d0('0x3b')],_0x2eca6d['query']);_0x234892[_0x08d0('0x3e')]=_[_0x08d0('0x3f')](_0x2eca6d[_0x08d0('0x3b')],qs[_0x08d0('0x40')](_0x3099f3[_0x08d0('0x3c')][_0x08d0('0x40')]));_0x234892['attributes']=_0x234892[_0x08d0('0x3e')][_0x08d0('0x41')]?_0x234892[_0x08d0('0x3e')]:_0x2eca6d[_0x08d0('0x3b')];if(!_0x3099f3[_0x08d0('0x3c')][_0x08d0('0x42')](_0x08d0('0x58'))){_0x234892[_0x08d0('0x28')]=qs[_0x08d0('0x28')](_0x3099f3[_0x08d0('0x3c')][_0x08d0('0x28')]);_0x234892[_0x08d0('0x26')]=qs[_0x08d0('0x26')](_0x3099f3['query']['offset']);}_0x234892[_0x08d0('0x43')]=qs[_0x08d0('0x44')](_0x3099f3['query'][_0x08d0('0x44')]);_0x234892[_0x08d0('0x48')]=qs[_0x08d0('0x45')](_[_0x08d0('0x46')](_0x3099f3[_0x08d0('0x3c')],_0x2eca6d[_0x08d0('0x45')]));if(_0x3099f3[_0x08d0('0x3c')][_0x08d0('0x47')]){_0x234892['where']=_['merge'](_0x234892[_0x08d0('0x48')],{'$or':_['map'](_0x234892[_0x08d0('0x3e')],function(_0x50d012){var _0x39d69a={};_0x39d69a[_0x50d012]={'$like':'%'+_0x3099f3[_0x08d0('0x3c')]['filter']+'%'};return _0x39d69a;})});}_0x234892=_[_0x08d0('0x49')]({},_0x234892,_0x3099f3['options']);var _0x346dad={'where':_0x234892[_0x08d0('0x48')]};return db[_0x08d0('0x36')]['count'](_0x346dad)[_0x08d0('0x2f')](function(_0x17c5c9){_0x4f03bf['count']=_0x17c5c9;if(_0x3099f3[_0x08d0('0x3c')]['includeAll']){_0x234892['include']=[{'all':!![]}];}return db[_0x08d0('0x36')][_0x08d0('0x4e')](_0x234892);})[_0x08d0('0x2f')](function(_0x4bc193){_0x4f03bf[_0x08d0('0x4f')]=_0x4bc193;return _0x4f03bf;})[_0x08d0('0x2f')](respondWithFilteredResult(_0x396e22,_0x234892,_0x08d0('0x57')))[_0x08d0('0x50')](handleError(_0x396e22,null,_0x08d0('0x57')));}; \ No newline at end of file diff --git a/server/api/voiceQueueReport/voiceQueueReport.events.js b/server/api/voiceQueueReport/voiceQueueReport.events.js index a2b1f33..ac9e66e 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 _0xa75b=['hasOwnProperty','hook','exports','events','../../mysqldb','VoiceQueueReport','setMaxListeners','save','update','remove','emit'];(function(_0x365c0a,_0x26dcb7){var _0x19e3e7=function(_0xe2a28a){while(--_0xe2a28a){_0x365c0a['push'](_0x365c0a['shift']());}};_0x19e3e7(++_0x26dcb7);}(_0xa75b,0x100));var _0xba75=function(_0x1141c0,_0x141b75){_0x1141c0=_0x1141c0-0x0;var _0x333b96=_0xa75b[_0x1141c0];return _0x333b96;};'use strict';var EventEmitter=require(_0xba75('0x0'));var VoiceQueueReport=require(_0xba75('0x1'))['db'][_0xba75('0x2')];var VoiceQueueReportEvents=new EventEmitter();VoiceQueueReportEvents[_0xba75('0x3')](0x0);var events={'afterCreate':_0xba75('0x4'),'afterUpdate':_0xba75('0x5'),'afterDestroy':_0xba75('0x6')};function emitEvent(_0x275286){return function(_0xcc73be,_0x522714,_0xa1c738){VoiceQueueReportEvents['emit'](_0x275286+':'+_0xcc73be['id'],_0xcc73be);VoiceQueueReportEvents[_0xba75('0x7')](_0x275286,_0xcc73be);_0xa1c738(null);};}for(var e in events){if(events[_0xba75('0x8')](e)){var event=events[e];VoiceQueueReport[_0xba75('0x9')](e,emitEvent(event));}}module[_0xba75('0xa')]=VoiceQueueReportEvents; \ No newline at end of file +var _0x3949=['hook','exports','events','VoiceQueueReport','save','emit','hasOwnProperty'];(function(_0x474603,_0x41cf41){var _0x7815ee=function(_0x46c2b2){while(--_0x46c2b2){_0x474603['push'](_0x474603['shift']());}};_0x7815ee(++_0x41cf41);}(_0x3949,0x113));var _0x9394=function(_0x501c32,_0x2f24c9){_0x501c32=_0x501c32-0x0;var _0x9bd372=_0x3949[_0x501c32];return _0x9bd372;};'use strict';var EventEmitter=require(_0x9394('0x0'));var VoiceQueueReport=require('../../mysqldb')['db'][_0x9394('0x1')];var VoiceQueueReportEvents=new EventEmitter();VoiceQueueReportEvents['setMaxListeners'](0x0);var events={'afterCreate':_0x9394('0x2'),'afterUpdate':'update','afterDestroy':'remove'};function emitEvent(_0x25f854){return function(_0x36a545,_0x57a0f0,_0x39c634){VoiceQueueReportEvents['emit'](_0x25f854+':'+_0x36a545['id'],_0x36a545);VoiceQueueReportEvents[_0x9394('0x3')](_0x25f854,_0x36a545);_0x39c634(null);};}for(var e in events){if(events[_0x9394('0x4')](e)){var event=events[e];VoiceQueueReport[_0x9394('0x5')](e,emitEvent(event));}}module[_0x9394('0x6')]=VoiceQueueReportEvents; \ No newline at end of file diff --git a/server/api/voiceQueueReport/voiceQueueReport.model.js b/server/api/voiceQueueReport/voiceQueueReport.model.js index 2a286d5..85e374d 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 _0x3b15=['define','VoiceQueueReport','report_queue','uniqueid','calleridnum','lodash','util','api','moment','bluebird','request-promise','path','../../config/environment','./voiceQueueReport.attributes'];(function(_0x42cae2,_0x284ef8){var _0x5f256f=function(_0x41abc8){while(--_0x41abc8){_0x42cae2['push'](_0x42cae2['shift']());}};_0x5f256f(++_0x284ef8);}(_0x3b15,0x1e1));var _0x53b1=function(_0x339129,_0x86dcc6){_0x339129=_0x339129-0x0;var _0x1570df=_0x3b15[_0x339129];return _0x1570df;};'use strict';var _=require(_0x53b1('0x0'));var util=require(_0x53b1('0x1'));var logger=require('../../config/logger')(_0x53b1('0x2'));var moment=require(_0x53b1('0x3'));var BPromise=require(_0x53b1('0x4'));var rp=require(_0x53b1('0x5'));var fs=require('fs');var path=require(_0x53b1('0x6'));var rimraf=require('rimraf');var config=require(_0x53b1('0x7'));var attributes=require(_0x53b1('0x8'));module['exports']=function(_0x14a34c,_0x3302a4){return _0x14a34c[_0x53b1('0x9')](_0x53b1('0xa'),attributes,{'tableName':_0x53b1('0xb'),'paranoid':![],'indexes':[{'fields':[_0x53b1('0xc')]},{'fields':[_0x53b1('0xd')]}],'timestamps':!![]});}; \ No newline at end of file +var _0x228c=['./voiceQueueReport.attributes','exports','define','VoiceQueueReport','report_queue','uniqueid','calleridnum','util','../../config/logger','moment','bluebird','request-promise','rimraf','../../config/environment'];(function(_0x255d5b,_0x4f6f35){var _0x3e141a=function(_0x249ee2){while(--_0x249ee2){_0x255d5b['push'](_0x255d5b['shift']());}};_0x3e141a(++_0x4f6f35);}(_0x228c,0x157));var _0xc228=function(_0x19bd6c,_0xebbbf1){_0x19bd6c=_0x19bd6c-0x0;var _0x179091=_0x228c[_0x19bd6c];return _0x179091;};'use strict';var _=require('lodash');var util=require(_0xc228('0x0'));var logger=require(_0xc228('0x1'))('api');var moment=require(_0xc228('0x2'));var BPromise=require(_0xc228('0x3'));var rp=require(_0xc228('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0xc228('0x5'));var config=require(_0xc228('0x6'));var attributes=require(_0xc228('0x7'));module[_0xc228('0x8')]=function(_0x191dcd,_0x23455f){return _0x191dcd[_0xc228('0x9')](_0xc228('0xa'),attributes,{'tableName':_0xc228('0xb'),'paranoid':![],'indexes':[{'fields':[_0xc228('0xc')]},{'fields':[_0xc228('0xd')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/voiceQueueReport/voiceQueueReport.rpc.js b/server/api/voiceQueueReport/voiceQueueReport.rpc.js index 87f5f5d..d2b1413 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 _0x5c5b=['defaults','localhost','socket.io-emitter','./voiceQueueReport.socket','register','request','then','info','VoiceQueueReport,\x20%s,\x20%s','request\x20sent','VoiceQueueReport,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','GetVoiceQueueReport','VoiceQueueReport','findAll','options','raw','where','map','include','model','attributes','debug','stringify','CreateVoiceQueueReport','create','UpdateVoiceQueueReport','body','limit','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis'];(function(_0x18f88c,_0x2fed0f){var _0x576492=function(_0x557349){while(--_0x557349){_0x18f88c['push'](_0x18f88c['shift']());}};_0x576492(++_0x2fed0f);}(_0x5c5b,0xdd));var _0xb5c5=function(_0x416cdc,_0x213b87){_0x416cdc=_0x416cdc-0x0;var _0x1931ce=_0x5c5b[_0x416cdc];return _0x1931ce;};'use strict';var _=require(_0xb5c5('0x0'));var util=require(_0xb5c5('0x1'));var moment=require(_0xb5c5('0x2'));var BPromise=require(_0xb5c5('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xb5c5('0x4'));var db=require(_0xb5c5('0x5'))['db'];var utils=require(_0xb5c5('0x6'));var logger=require(_0xb5c5('0x7'))(_0xb5c5('0x8'));var config=require(_0xb5c5('0x9'));var jayson=require(_0xb5c5('0xa'));var client=jayson[_0xb5c5('0xb')][_0xb5c5('0xc')]({'port':0x232a});config[_0xb5c5('0xd')]=_[_0xb5c5('0xe')](config['redis'],{'host':_0xb5c5('0xf'),'port':0x18eb});var socket=require(_0xb5c5('0x10'))(new Redis(config[_0xb5c5('0xd')]));require(_0xb5c5('0x11'))[_0xb5c5('0x12')](socket);function respondWithRpcPromise(_0x529de1,_0x3482ce,_0x2d2e64){return new BPromise(function(_0x40c3f5,_0x364db9){return client[_0xb5c5('0x13')](_0x529de1,_0x2d2e64)[_0xb5c5('0x14')](function(_0x282af2){logger[_0xb5c5('0x15')](_0xb5c5('0x16'),_0x3482ce,_0xb5c5('0x17'));logger['debug'](_0xb5c5('0x18'),_0x3482ce,_0xb5c5('0x17'),JSON['stringify'](_0x282af2));if(_0x282af2[_0xb5c5('0x19')]){if(_0x282af2[_0xb5c5('0x19')][_0xb5c5('0x1a')]===0x1f4){logger[_0xb5c5('0x19')]('VoiceQueueReport,\x20%s,\x20%s',_0x3482ce,_0x282af2[_0xb5c5('0x19')][_0xb5c5('0x1b')]);return _0x364db9(_0x282af2[_0xb5c5('0x19')][_0xb5c5('0x1b')]);}logger['error'](_0xb5c5('0x16'),_0x3482ce,_0x282af2['error'][_0xb5c5('0x1b')]);return _0x40c3f5(_0x282af2[_0xb5c5('0x19')][_0xb5c5('0x1b')]);}else{logger[_0xb5c5('0x15')]('VoiceQueueReport,\x20%s,\x20%s',_0x3482ce,_0xb5c5('0x17'));_0x40c3f5(_0x282af2[_0xb5c5('0x1c')][_0xb5c5('0x1b')]);}})[_0xb5c5('0x1d')](function(_0x17bc48){logger[_0xb5c5('0x19')](_0xb5c5('0x16'),_0x3482ce,_0x17bc48);_0x364db9(_0x17bc48);});});}exports[_0xb5c5('0x1e')]=function(_0x46d3f8){var _0x15d8de=this;return new Promise(function(_0x215f92,_0x232d73){return db[_0xb5c5('0x1f')][_0xb5c5('0x20')]({'raw':_0x46d3f8[_0xb5c5('0x21')]?_0x46d3f8[_0xb5c5('0x21')][_0xb5c5('0x22')]===undefined?!![]:![]:!![],'where':_0x46d3f8[_0xb5c5('0x21')]?_0x46d3f8[_0xb5c5('0x21')][_0xb5c5('0x23')]||null:null,'attributes':_0x46d3f8[_0xb5c5('0x21')]?_0x46d3f8[_0xb5c5('0x21')]['attributes']||null:null,'limit':_0x46d3f8[_0xb5c5('0x21')]?_0x46d3f8['options']['limit']||null:null,'include':_0x46d3f8[_0xb5c5('0x21')]?_0x46d3f8[_0xb5c5('0x21')]['include']?_[_0xb5c5('0x24')](_0x46d3f8[_0xb5c5('0x21')][_0xb5c5('0x25')],function(_0x278460){return{'model':db[_0x278460['model']],'as':_0x278460['as'],'attributes':_0x278460['attributes'],'include':_0x278460[_0xb5c5('0x25')]?_[_0xb5c5('0x24')](_0x278460[_0xb5c5('0x25')],function(_0x50126){return{'model':db[_0x50126[_0xb5c5('0x26')]],'as':_0x50126['as'],'attributes':_0x50126[_0xb5c5('0x27')],'include':_0x50126[_0xb5c5('0x25')]?_[_0xb5c5('0x24')](_0x50126[_0xb5c5('0x25')],function(_0x4f0a59){return{'model':db[_0x4f0a59[_0xb5c5('0x26')]],'as':_0x4f0a59['as'],'attributes':_0x4f0a59[_0xb5c5('0x27')]};}):[]};}):[]};}):[]:[]})[_0xb5c5('0x14')](function(_0xfb2b14){logger[_0xb5c5('0x15')]('GetVoiceQueueReport',_0x46d3f8);logger[_0xb5c5('0x28')](_0xb5c5('0x1e'),_0x46d3f8,JSON[_0xb5c5('0x29')](_0xfb2b14));_0x215f92(_0xfb2b14);})[_0xb5c5('0x1d')](function(_0x5c32e0){logger[_0xb5c5('0x19')](_0xb5c5('0x1e'),_0x5c32e0[_0xb5c5('0x1b')],_0x46d3f8);_0x232d73(_0x15d8de[_0xb5c5('0x19')](0x1f4,_0x5c32e0[_0xb5c5('0x1b')]));});});};exports[_0xb5c5('0x2a')]=function(_0x1519f0){var _0x42671b=this;return new Promise(function(_0x451565,_0x5c3eab){return db[_0xb5c5('0x1f')][_0xb5c5('0x2b')](_0x1519f0['body'],{'raw':_0x1519f0['options']?_0x1519f0[_0xb5c5('0x21')]['raw']===undefined?!![]:![]:!![]})[_0xb5c5('0x14')](function(_0x51d263){logger[_0xb5c5('0x15')](_0xb5c5('0x2a'),_0x1519f0);logger[_0xb5c5('0x28')](_0xb5c5('0x2a'),_0x1519f0,JSON[_0xb5c5('0x29')](_0x51d263));_0x451565(_0x51d263);})[_0xb5c5('0x1d')](function(_0x18f2c9){logger[_0xb5c5('0x19')](_0xb5c5('0x2a'),_0x18f2c9[_0xb5c5('0x1b')],_0x1519f0);_0x5c3eab(_0x42671b[_0xb5c5('0x19')](0x1f4,_0x18f2c9[_0xb5c5('0x1b')]));});});};exports[_0xb5c5('0x2c')]=function(_0x6a71c0){var _0x319de9=this;return new Promise(function(_0x123f1f,_0x114be1){return db[_0xb5c5('0x1f')]['update'](_0x6a71c0[_0xb5c5('0x2d')],{'raw':_0x6a71c0['options']?_0x6a71c0[_0xb5c5('0x21')][_0xb5c5('0x22')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x6a71c0[_0xb5c5('0x21')]?_0x6a71c0['options']['where']||null:null,'attributes':_0x6a71c0[_0xb5c5('0x21')]?_0x6a71c0['options'][_0xb5c5('0x27')]||null:null,'limit':_0x6a71c0[_0xb5c5('0x21')]?_0x6a71c0[_0xb5c5('0x21')][_0xb5c5('0x2e')]||null:null})[_0xb5c5('0x14')](function(_0x273cff){logger['info'](_0xb5c5('0x2c'),_0x6a71c0);logger[_0xb5c5('0x28')](_0xb5c5('0x2c'),_0x6a71c0,JSON[_0xb5c5('0x29')](_0x273cff));_0x123f1f(_0x273cff);})[_0xb5c5('0x1d')](function(_0xee30fa){logger[_0xb5c5('0x19')](_0xb5c5('0x2c'),_0xee30fa['message'],_0x6a71c0);_0x114be1(_0x319de9[_0xb5c5('0x19')](0x1f4,_0xee30fa['message']));});});}; \ No newline at end of file +var _0x6fde=['VoiceQueueReport,\x20%s,\x20%s','request\x20sent','debug','VoiceQueueReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','GetVoiceQueueReport','options','raw','where','attributes','limit','include','map','model','catch','CreateVoiceQueueReport','create','body','update','UpdateVoiceQueueReport','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','redis','defaults','localhost','./voiceQueueReport.socket','request','then','info'];(function(_0x57c539,_0x30ea36){var _0xeac23d=function(_0x54c199){while(--_0x54c199){_0x57c539['push'](_0x57c539['shift']());}};_0xeac23d(++_0x30ea36);}(_0x6fde,0x170));var _0xe6fd=function(_0x5c2230,_0x309572){_0x5c2230=_0x5c2230-0x0;var _0x47f24b=_0x6fde[_0x5c2230];return _0x47f24b;};'use strict';var _=require(_0xe6fd('0x0'));var util=require(_0xe6fd('0x1'));var moment=require(_0xe6fd('0x2'));var BPromise=require('bluebird');var rs=require(_0xe6fd('0x3'));var fs=require('fs');var Redis=require(_0xe6fd('0x4'));var db=require(_0xe6fd('0x5'))['db'];var utils=require(_0xe6fd('0x6'));var logger=require(_0xe6fd('0x7'))(_0xe6fd('0x8'));var config=require(_0xe6fd('0x9'));var jayson=require('jayson/promise');var client=jayson[_0xe6fd('0xa')][_0xe6fd('0xb')]({'port':0x232a});config[_0xe6fd('0xc')]=_[_0xe6fd('0xd')](config[_0xe6fd('0xc')],{'host':_0xe6fd('0xe'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xe6fd('0xc')]));require(_0xe6fd('0xf'))['register'](socket);function respondWithRpcPromise(_0x5cbfd0,_0x1e1f6a,_0x5d9662){return new BPromise(function(_0x1a39dc,_0x1ff298){return client[_0xe6fd('0x10')](_0x5cbfd0,_0x5d9662)[_0xe6fd('0x11')](function(_0x121750){logger[_0xe6fd('0x12')](_0xe6fd('0x13'),_0x1e1f6a,_0xe6fd('0x14'));logger[_0xe6fd('0x15')](_0xe6fd('0x16'),_0x1e1f6a,_0xe6fd('0x14'),JSON[_0xe6fd('0x17')](_0x121750));if(_0x121750[_0xe6fd('0x18')]){if(_0x121750[_0xe6fd('0x18')][_0xe6fd('0x19')]===0x1f4){logger[_0xe6fd('0x18')]('VoiceQueueReport,\x20%s,\x20%s',_0x1e1f6a,_0x121750[_0xe6fd('0x18')][_0xe6fd('0x1a')]);return _0x1ff298(_0x121750['error'][_0xe6fd('0x1a')]);}logger[_0xe6fd('0x18')](_0xe6fd('0x13'),_0x1e1f6a,_0x121750[_0xe6fd('0x18')][_0xe6fd('0x1a')]);return _0x1a39dc(_0x121750['error'][_0xe6fd('0x1a')]);}else{logger[_0xe6fd('0x12')]('VoiceQueueReport,\x20%s,\x20%s',_0x1e1f6a,'request\x20sent');_0x1a39dc(_0x121750[_0xe6fd('0x1b')][_0xe6fd('0x1a')]);}})['catch'](function(_0x48647d){logger[_0xe6fd('0x18')](_0xe6fd('0x13'),_0x1e1f6a,_0x48647d);_0x1ff298(_0x48647d);});});}exports[_0xe6fd('0x1c')]=function(_0x10181a){var _0x59f974=this;return new Promise(function(_0x17f1fd,_0x25309d){return db['VoiceQueueReport']['findAll']({'raw':_0x10181a['options']?_0x10181a[_0xe6fd('0x1d')][_0xe6fd('0x1e')]===undefined?!![]:![]:!![],'where':_0x10181a['options']?_0x10181a[_0xe6fd('0x1d')][_0xe6fd('0x1f')]||null:null,'attributes':_0x10181a['options']?_0x10181a['options'][_0xe6fd('0x20')]||null:null,'limit':_0x10181a[_0xe6fd('0x1d')]?_0x10181a[_0xe6fd('0x1d')][_0xe6fd('0x21')]||null:null,'include':_0x10181a['options']?_0x10181a[_0xe6fd('0x1d')][_0xe6fd('0x22')]?_[_0xe6fd('0x23')](_0x10181a[_0xe6fd('0x1d')][_0xe6fd('0x22')],function(_0x510ac1){return{'model':db[_0x510ac1['model']],'as':_0x510ac1['as'],'attributes':_0x510ac1[_0xe6fd('0x20')],'include':_0x510ac1[_0xe6fd('0x22')]?_[_0xe6fd('0x23')](_0x510ac1[_0xe6fd('0x22')],function(_0x20a509){return{'model':db[_0x20a509[_0xe6fd('0x24')]],'as':_0x20a509['as'],'attributes':_0x20a509[_0xe6fd('0x20')],'include':_0x20a509[_0xe6fd('0x22')]?_['map'](_0x20a509['include'],function(_0x2d1d91){return{'model':db[_0x2d1d91['model']],'as':_0x2d1d91['as'],'attributes':_0x2d1d91['attributes']};}):[]};}):[]};}):[]:[]})[_0xe6fd('0x11')](function(_0x3bf2f5){logger[_0xe6fd('0x12')](_0xe6fd('0x1c'),_0x10181a);logger[_0xe6fd('0x15')](_0xe6fd('0x1c'),_0x10181a,JSON[_0xe6fd('0x17')](_0x3bf2f5));_0x17f1fd(_0x3bf2f5);})[_0xe6fd('0x25')](function(_0x7f8377){logger[_0xe6fd('0x18')]('GetVoiceQueueReport',_0x7f8377[_0xe6fd('0x1a')],_0x10181a);_0x25309d(_0x59f974[_0xe6fd('0x18')](0x1f4,_0x7f8377[_0xe6fd('0x1a')]));});});};exports[_0xe6fd('0x26')]=function(_0x1730e7){var _0x3acfa8=this;return new Promise(function(_0x2d2937,_0x557a12){return db['VoiceQueueReport'][_0xe6fd('0x27')](_0x1730e7[_0xe6fd('0x28')],{'raw':_0x1730e7[_0xe6fd('0x1d')]?_0x1730e7[_0xe6fd('0x1d')][_0xe6fd('0x1e')]===undefined?!![]:![]:!![]})['then'](function(_0x3dbeda){logger['info'](_0xe6fd('0x26'),_0x1730e7);logger['debug']('CreateVoiceQueueReport',_0x1730e7,JSON[_0xe6fd('0x17')](_0x3dbeda));_0x2d2937(_0x3dbeda);})[_0xe6fd('0x25')](function(_0x26a534){logger[_0xe6fd('0x18')](_0xe6fd('0x26'),_0x26a534[_0xe6fd('0x1a')],_0x1730e7);_0x557a12(_0x3acfa8[_0xe6fd('0x18')](0x1f4,_0x26a534[_0xe6fd('0x1a')]));});});};exports['UpdateVoiceQueueReport']=function(_0x13f184){var _0x193532=this;return new Promise(function(_0xc6e13f,_0x5610e8){return db['VoiceQueueReport'][_0xe6fd('0x29')](_0x13f184['body'],{'raw':_0x13f184[_0xe6fd('0x1d')]?_0x13f184[_0xe6fd('0x1d')][_0xe6fd('0x1e')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x13f184[_0xe6fd('0x1d')]?_0x13f184[_0xe6fd('0x1d')]['where']||null:null,'attributes':_0x13f184[_0xe6fd('0x1d')]?_0x13f184[_0xe6fd('0x1d')][_0xe6fd('0x20')]||null:null,'limit':_0x13f184[_0xe6fd('0x1d')]?_0x13f184['options'][_0xe6fd('0x21')]||null:null})[_0xe6fd('0x11')](function(_0x1752f6){logger['info'](_0xe6fd('0x2a'),_0x13f184);logger[_0xe6fd('0x15')]('UpdateVoiceQueueReport',_0x13f184,JSON[_0xe6fd('0x17')](_0x1752f6));_0xc6e13f(_0x1752f6);})['catch'](function(_0x3e5ab4){logger[_0xe6fd('0x18')](_0xe6fd('0x2a'),_0x3e5ab4[_0xe6fd('0x1a')],_0x13f184);_0x5610e8(_0x193532[_0xe6fd('0x18')](0x1f4,_0x3e5ab4['message']));});});}; \ No newline at end of file diff --git a/server/api/voiceQueueReport/voiceQueueReport.socket.js b/server/api/voiceQueueReport/voiceQueueReport.socket.js index 1a5ab9b..db5f377 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 _0x121d=['register','length','./voiceQueueReport.events','save','remove','update','emit','removeListener'];(function(_0x1e5ab2,_0x508296){var _0x564ee8=function(_0x43fc3a){while(--_0x43fc3a){_0x1e5ab2['push'](_0x1e5ab2['shift']());}};_0x564ee8(++_0x508296);}(_0x121d,0xea));var _0xd121=function(_0x586b2b,_0xa097d6){_0x586b2b=_0x586b2b-0x0;var _0x5471e1=_0x121d[_0x586b2b];return _0x5471e1;};'use strict';var VoiceQueueReportEvents=require(_0xd121('0x0'));var events=[_0xd121('0x1'),_0xd121('0x2'),_0xd121('0x3')];function createListener(_0x16ed51,_0x40e506){return function(_0x233726){_0x40e506[_0xd121('0x4')](_0x16ed51,_0x233726);};}function removeListener(_0x20a687,_0x349fc5){return function(){VoiceQueueReportEvents[_0xd121('0x5')](_0x20a687,_0x349fc5);};}exports[_0xd121('0x6')]=function(_0x2b2f41){for(var _0x31c727=0x0,_0x540cf2=events[_0xd121('0x7')];_0x31c727<_0x540cf2;_0x31c727++){var _0x5b67f7=events[_0x31c727];var _0x1da01c=createListener('voiceQueueReport:'+_0x5b67f7,_0x2b2f41);VoiceQueueReportEvents['on'](_0x5b67f7,_0x1da01c);}}; \ No newline at end of file +var _0x95d9=['remove','update','emit','removeListener','register','length','voiceQueueReport:','./voiceQueueReport.events','save'];(function(_0x200db5,_0x26ee0e){var _0xf65f2e=function(_0x2f19e6){while(--_0x2f19e6){_0x200db5['push'](_0x200db5['shift']());}};_0xf65f2e(++_0x26ee0e);}(_0x95d9,0x97));var _0x995d=function(_0x19e35c,_0x29cd1e){_0x19e35c=_0x19e35c-0x0;var _0x3e1fe8=_0x95d9[_0x19e35c];return _0x3e1fe8;};'use strict';var VoiceQueueReportEvents=require(_0x995d('0x0'));var events=[_0x995d('0x1'),_0x995d('0x2'),_0x995d('0x3')];function createListener(_0x568331,_0x3d6fa5){return function(_0x3b9a11){_0x3d6fa5[_0x995d('0x4')](_0x568331,_0x3b9a11);};}function removeListener(_0x5b44d3,_0x225c17){return function(){VoiceQueueReportEvents[_0x995d('0x5')](_0x5b44d3,_0x225c17);};}exports[_0x995d('0x6')]=function(_0x226250){for(var _0xe6d244=0x0,_0x4a4d21=events[_0x995d('0x7')];_0xe6d244<_0x4a4d21;_0xe6d244++){var _0x464e22=events[_0xe6d244];var _0x351a63=createListener(_0x995d('0x8')+_0x464e22,_0x226250);VoiceQueueReportEvents['on'](_0x464e22,_0x351a63);}}; \ No newline at end of file diff --git a/server/api/voiceQueuesLog/index.js b/server/api/voiceQueuesLog/index.js index c58f2aa..d06d35f 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 _0x2cb4=['fs-extra','../../components/interaction/service','../../config/environment','./voiceQueuesLog.controller','get','isAuthenticated','/:id','show','create','put','update','delete','multer','util','path','connect-timeout','express','Router'];(function(_0x3511d3,_0x4107ae){var _0x5d6321=function(_0x1a23da){while(--_0x1a23da){_0x3511d3['push'](_0x3511d3['shift']());}};_0x5d6321(++_0x4107ae);}(_0x2cb4,0x13e));var _0x42cb=function(_0x21f9c2,_0x2b3d2a){_0x21f9c2=_0x21f9c2-0x0;var _0x3da17f=_0x2cb4[_0x21f9c2];return _0x3da17f;};'use strict';var multer=require(_0x42cb('0x0'));var util=require(_0x42cb('0x1'));var path=require(_0x42cb('0x2'));var timeout=require(_0x42cb('0x3'));var express=require(_0x42cb('0x4'));var router=express[_0x42cb('0x5')]();var fs_extra=require(_0x42cb('0x6'));var auth=require('../../components/auth/service');var interaction=require(_0x42cb('0x7'));var config=require(_0x42cb('0x8'));var controller=require(_0x42cb('0x9'));router[_0x42cb('0xa')]('/',auth[_0x42cb('0xb')](),controller['index']);router[_0x42cb('0xa')](_0x42cb('0xc'),auth[_0x42cb('0xb')](),controller[_0x42cb('0xd')]);router['post']('/',auth[_0x42cb('0xb')](),controller[_0x42cb('0xe')]);router[_0x42cb('0xf')](_0x42cb('0xc'),auth[_0x42cb('0xb')](),controller[_0x42cb('0x10')]);router[_0x42cb('0x11')](_0x42cb('0xc'),auth[_0x42cb('0xb')](),controller['destroy']);module['exports']=router; \ No newline at end of file +var _0x3f4b=['util','path','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/:id','create','put','update','delete','destroy','exports','multer'];(function(_0xbd85,_0x359a86){var _0xf127=function(_0x4674db){while(--_0x4674db){_0xbd85['push'](_0xbd85['shift']());}};_0xf127(++_0x359a86);}(_0x3f4b,0x11f));var _0xb3f4=function(_0x36e318,_0x13cd16){_0x36e318=_0x36e318-0x0;var _0x472a59=_0x3f4b[_0x36e318];return _0x472a59;};'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['Router']();var fs_extra=require(_0xb3f4('0x4'));var auth=require(_0xb3f4('0x5'));var interaction=require(_0xb3f4('0x6'));var config=require(_0xb3f4('0x7'));var controller=require('./voiceQueuesLog.controller');router[_0xb3f4('0x8')]('/',auth[_0xb3f4('0x9')](),controller[_0xb3f4('0xa')]);router[_0xb3f4('0x8')](_0xb3f4('0xb'),auth['isAuthenticated'](),controller['show']);router['post']('/',auth['isAuthenticated'](),controller[_0xb3f4('0xc')]);router[_0xb3f4('0xd')]('/:id',auth[_0xb3f4('0x9')](),controller[_0xb3f4('0xe')]);router[_0xb3f4('0xf')]('/:id',auth[_0xb3f4('0x9')](),controller[_0xb3f4('0x10')]);module[_0xb3f4('0x11')]=router; \ No newline at end of file diff --git a/server/api/voiceQueuesLog/voiceQueuesLog.attributes.js b/server/api/voiceQueuesLog/voiceQueuesLog.attributes.js index bdb02f4..4abfc9c 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 _0x7c61=['sequelize','moment','STRING','literal','CURRENT_TIMESTAMP\x20ON\x20UPDATE\x20CURRENT_TIMESTAMP'];(function(_0x514b70,_0x33749e){var _0x50d83d=function(_0x4aa9ca){while(--_0x4aa9ca){_0x514b70['push'](_0x514b70['shift']());}};_0x50d83d(++_0x33749e);}(_0x7c61,0x10e));var _0x17c6=function(_0xc461d8,_0x37a5de){_0xc461d8=_0xc461d8-0x0;var _0xb1dd0d=_0x7c61[_0xc461d8];return _0xb1dd0d;};'use strict';var Sequelize=require(_0x17c6('0x0'));var moment=require(_0x17c6('0x1'));module['exports']={'time':{'type':Sequelize[_0x17c6('0x2')]},'callid':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':''},'queuename':{'type':Sequelize[_0x17c6('0x2')],'allowNull':![],'defaultValue':''},'agent':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':''},'event':{'type':Sequelize[_0x17c6('0x2')],'allowNull':![],'defaultValue':''},'data':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':''},'data1':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':''},'data2':{'type':Sequelize[_0x17c6('0x2')],'allowNull':![],'defaultValue':''},'data3':{'type':Sequelize[_0x17c6('0x2')],'allowNull':![],'defaultValue':''},'data4':{'type':Sequelize[_0x17c6('0x2')],'allowNull':![],'defaultValue':''},'data5':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':''},'dtm':{'type':Sequelize['DATE'],'allowNull':![],'defaultValue':Sequelize[_0x17c6('0x3')](_0x17c6('0x4'))}}; \ No newline at end of file +var _0x01b3=['DATE','literal','CURRENT_TIMESTAMP\x20ON\x20UPDATE\x20CURRENT_TIMESTAMP','moment','exports','STRING'];(function(_0x32e758,_0x13c271){var _0x349316=function(_0x27a9da){while(--_0x27a9da){_0x32e758['push'](_0x32e758['shift']());}};_0x349316(++_0x13c271);}(_0x01b3,0x1ef));var _0x301b=function(_0x5c48b8,_0x12b980){_0x5c48b8=_0x5c48b8-0x0;var _0x666d01=_0x01b3[_0x5c48b8];return _0x666d01;};'use strict';var Sequelize=require('sequelize');var moment=require(_0x301b('0x0'));module[_0x301b('0x1')]={'time':{'type':Sequelize[_0x301b('0x2')]},'callid':{'type':Sequelize[_0x301b('0x2')],'allowNull':![],'defaultValue':''},'queuename':{'type':Sequelize[_0x301b('0x2')],'allowNull':![],'defaultValue':''},'agent':{'type':Sequelize[_0x301b('0x2')],'allowNull':![],'defaultValue':''},'event':{'type':Sequelize[_0x301b('0x2')],'allowNull':![],'defaultValue':''},'data':{'type':Sequelize[_0x301b('0x2')],'allowNull':![],'defaultValue':''},'data1':{'type':Sequelize[_0x301b('0x2')],'allowNull':![],'defaultValue':''},'data2':{'type':Sequelize[_0x301b('0x2')],'allowNull':![],'defaultValue':''},'data3':{'type':Sequelize[_0x301b('0x2')],'allowNull':![],'defaultValue':''},'data4':{'type':Sequelize[_0x301b('0x2')],'allowNull':![],'defaultValue':''},'data5':{'type':Sequelize[_0x301b('0x2')],'allowNull':![],'defaultValue':''},'dtm':{'type':Sequelize[_0x301b('0x3')],'allowNull':![],'defaultValue':Sequelize[_0x301b('0x4')](_0x301b('0x5'))}}; \ No newline at end of file diff --git a/server/api/voiceQueuesLog/voiceQueuesLog.controller.js b/server/api/voiceQueuesLog/voiceQueuesLog.controller.js index 1f453e8..c4db68c 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 _0xcc3f=['sendStatus','end','json','offset','undefined','count','limit','set','Content-Range','save','update','destroy','status','error','name','index','map','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','order','sort','where','pick','filter','merge','VIRTUAL','options','VoiceQueuesLog','then','includeAll','findAll','rows','catch','show','params','include','create','body','find','eml-format','rimraf','zip-dir','request-promise','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment'];(function(_0x1d94d1,_0x347bb8){var _0x23c397=function(_0x489441){while(--_0x489441){_0x1d94d1['push'](_0x1d94d1['shift']());}};_0x23c397(++_0x347bb8);}(_0xcc3f,0x15a));var _0xfcc3=function(_0x450296,_0x29fca9){_0x450296=_0x450296-0x0;var _0x1340e9=_0xcc3f[_0x450296];return _0x1340e9;};'use strict';var emlformat=require(_0xfcc3('0x0'));var rimraf=require(_0xfcc3('0x1'));var zipdir=require(_0xfcc3('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0xfcc3('0x3'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0xfcc3('0x4'));var util=require(_0xfcc3('0x5'));var path=require(_0xfcc3('0x6'));var sox=require(_0xfcc3('0x7'));var csv=require(_0xfcc3('0x8'));var ejs=require(_0xfcc3('0x9'));var fs=require('fs');var fs_extra=require(_0xfcc3('0xa'));var _=require(_0xfcc3('0xb'));var squel=require(_0xfcc3('0xc'));var crypto=require(_0xfcc3('0xd'));var jsforce=require('jsforce');var deskjs=require(_0xfcc3('0xe'));var toCsv=require('to-csv');var querystring=require(_0xfcc3('0xf'));var Papa=require('papaparse');var Redis=require(_0xfcc3('0x10'));var authService=require(_0xfcc3('0x11'));var qs=require('../../components/parsers/qs');var as=require(_0xfcc3('0x12'));var hardwareService=require(_0xfcc3('0x13'));var logger=require(_0xfcc3('0x14'))(_0xfcc3('0x15'));var utils=require(_0xfcc3('0x16'));var config=require(_0xfcc3('0x17'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x19d5dc,_0x536de4){_0x536de4=_0x536de4||0xcc;return function(_0x42d176){if(_0x42d176){return _0x19d5dc[_0xfcc3('0x18')](_0x536de4);}return _0x19d5dc['status'](_0x536de4)[_0xfcc3('0x19')]();};}function respondWithResult(_0x3821b1,_0x372293){_0x372293=_0x372293||0xc8;return function(_0x4da62e){if(_0x4da62e){return _0x3821b1['status'](_0x372293)[_0xfcc3('0x1a')](_0x4da62e);}};}function respondWithFilteredResult(_0x2b14d0,_0x2b3ee4){return function(_0x2e2d79){if(_0x2e2d79){var _0x3c6931=typeof _0x2b3ee4[_0xfcc3('0x1b')]===_0xfcc3('0x1c')&&typeof _0x2b3ee4['limit']===_0xfcc3('0x1c');var _0x455e2e=_0x2e2d79[_0xfcc3('0x1d')];var _0xb01124=_0x3c6931?0x0:_0x2b3ee4['offset'];var _0x1792df=_0x3c6931?_0x2e2d79[_0xfcc3('0x1d')]:_0x2b3ee4['offset']+_0x2b3ee4[_0xfcc3('0x1e')];var _0x503ecf;if(_0x1792df>=_0x455e2e){_0x1792df=_0x455e2e;_0x503ecf=0xc8;}else{_0x503ecf=0xce;}_0x2b14d0['status'](_0x503ecf);return _0x2b14d0[_0xfcc3('0x1f')](_0xfcc3('0x20'),_0xb01124+'-'+_0x1792df+'/'+_0x455e2e)['json'](_0x2e2d79);}return null;};}function patchUpdates(_0x176fc9){return function(_0x3e2479){try{jsonpatch['apply'](_0x3e2479,_0x176fc9,!![]);}catch(_0x55f885){return BPromise['reject'](_0x55f885);}return _0x3e2479[_0xfcc3('0x21')]();};}function saveUpdates(_0x18b99e,_0x23c8b3){return function(_0x4f87bc){if(_0x4f87bc){return _0x4f87bc[_0xfcc3('0x22')](_0x18b99e)['then'](function(_0x1bcf4e){return _0x1bcf4e;});}return null;};}function removeEntity(_0x2d52fc,_0x348393){return function(_0x572602){if(_0x572602){return _0x572602[_0xfcc3('0x23')]()['then'](function(){_0x2d52fc[_0xfcc3('0x24')](0xcc)[_0xfcc3('0x19')]();});}};}function handleEntityNotFound(_0x1a3097,_0x4fc0bb){return function(_0x1f7281){if(!_0x1f7281){_0x1a3097[_0xfcc3('0x18')](0x194);}return _0x1f7281;};}function handleError(_0x115473,_0x16169e){_0x16169e=_0x16169e||0x1f4;return function(_0x224325){logger[_0xfcc3('0x25')](_0x224325['stack']);if(_0x224325[_0xfcc3('0x26')]){delete _0x224325[_0xfcc3('0x26')];}_0x115473['status'](_0x16169e)['send'](_0x224325);};}exports[_0xfcc3('0x27')]=function(_0x119f8e,_0x3fee16){var _0x104c1d={},_0xd6289b={},_0x3d58b7={'count':0x0,'rows':[]};var _0x4858d3=_[_0xfcc3('0x28')](db['VoiceQueuesLog'][_0xfcc3('0x29')],function(_0xc90d5f){return{'name':_0xc90d5f[_0xfcc3('0x2a')],'type':_0xc90d5f[_0xfcc3('0x2b')][_0xfcc3('0x2c')]};});_0xd6289b[_0xfcc3('0x2d')]=_[_0xfcc3('0x28')](_0x4858d3,_0xfcc3('0x26'));_0xd6289b[_0xfcc3('0x2e')]=_[_0xfcc3('0x2f')](_0x119f8e['query']);_0xd6289b[_0xfcc3('0x30')]=_[_0xfcc3('0x31')](_0xd6289b[_0xfcc3('0x2d')],_0xd6289b[_0xfcc3('0x2e')]);_0x104c1d[_0xfcc3('0x32')]=_['intersection'](_0xd6289b['model'],qs['fields'](_0x119f8e['query'][_0xfcc3('0x33')]));_0x104c1d[_0xfcc3('0x32')]=_0x104c1d['attributes'][_0xfcc3('0x34')]?_0x104c1d[_0xfcc3('0x32')]:_0xd6289b[_0xfcc3('0x2d')];if(!_0x119f8e[_0xfcc3('0x2e')][_0xfcc3('0x35')]('nolimit')){_0x104c1d['limit']=qs[_0xfcc3('0x1e')](_0x119f8e[_0xfcc3('0x2e')][_0xfcc3('0x1e')]);_0x104c1d[_0xfcc3('0x1b')]=qs[_0xfcc3('0x1b')](_0x119f8e[_0xfcc3('0x2e')][_0xfcc3('0x1b')]);}_0x104c1d[_0xfcc3('0x36')]=qs['sort'](_0x119f8e[_0xfcc3('0x2e')][_0xfcc3('0x37')]);_0x104c1d[_0xfcc3('0x38')]=qs['filters'](_[_0xfcc3('0x39')](_0x119f8e[_0xfcc3('0x2e')],_0xd6289b['filters']),_0x4858d3);if(_0x119f8e[_0xfcc3('0x2e')][_0xfcc3('0x3a')]){_0x104c1d[_0xfcc3('0x38')]=_[_0xfcc3('0x3b')](_0x104c1d[_0xfcc3('0x38')],{'$or':_[_0xfcc3('0x28')](_0x4858d3,function(_0x25a68c){if(_0x25a68c[_0xfcc3('0x2b')]!==_0xfcc3('0x3c')){var _0x22ba71={};_0x22ba71[_0x25a68c[_0xfcc3('0x26')]]={'$like':'%'+_0x119f8e[_0xfcc3('0x2e')][_0xfcc3('0x3a')]+'%'};return _0x22ba71;}})});}_0x104c1d=_[_0xfcc3('0x3b')]({},_0x104c1d,_0x119f8e[_0xfcc3('0x3d')]);var _0x5ee364={'where':_0x104c1d[_0xfcc3('0x38')]};return db[_0xfcc3('0x3e')][_0xfcc3('0x1d')](_0x5ee364)[_0xfcc3('0x3f')](function(_0x5a889f){_0x3d58b7[_0xfcc3('0x1d')]=_0x5a889f;if(_0x119f8e[_0xfcc3('0x2e')][_0xfcc3('0x40')]){_0x104c1d['include']=[{'all':!![]}];}return db[_0xfcc3('0x3e')][_0xfcc3('0x41')](_0x104c1d);})['then'](function(_0x5f196f){_0x3d58b7[_0xfcc3('0x42')]=_0x5f196f;return _0x3d58b7;})[_0xfcc3('0x3f')](respondWithFilteredResult(_0x3fee16,_0x104c1d))[_0xfcc3('0x43')](handleError(_0x3fee16,null));};exports[_0xfcc3('0x44')]=function(_0x20242a,_0x460149){var _0x4f9cd1={'raw':!![],'where':{'id':_0x20242a[_0xfcc3('0x45')]['id']}},_0x416b2d={};_0x416b2d[_0xfcc3('0x2d')]=_[_0xfcc3('0x2f')](db[_0xfcc3('0x3e')]['rawAttributes']);_0x416b2d[_0xfcc3('0x2e')]=_['keys'](_0x20242a[_0xfcc3('0x2e')]);_0x416b2d['filters']=_[_0xfcc3('0x31')](_0x416b2d['model'],_0x416b2d[_0xfcc3('0x2e')]);_0x4f9cd1[_0xfcc3('0x32')]=_[_0xfcc3('0x31')](_0x416b2d[_0xfcc3('0x2d')],qs['fields'](_0x20242a[_0xfcc3('0x2e')][_0xfcc3('0x33')]));_0x4f9cd1['attributes']=_0x4f9cd1[_0xfcc3('0x32')]['length']?_0x4f9cd1['attributes']:_0x416b2d['model'];if(_0x20242a[_0xfcc3('0x2e')][_0xfcc3('0x40')]){_0x4f9cd1[_0xfcc3('0x46')]=[{'all':!![]}];}_0x4f9cd1=_['merge']({},_0x4f9cd1,_0x20242a[_0xfcc3('0x3d')]);return db['VoiceQueuesLog']['find'](_0x4f9cd1)[_0xfcc3('0x3f')](handleEntityNotFound(_0x460149,null))[_0xfcc3('0x3f')](respondWithResult(_0x460149,null))['catch'](handleError(_0x460149,null));};exports[_0xfcc3('0x47')]=function(_0x688426,_0x465917){return db[_0xfcc3('0x3e')][_0xfcc3('0x47')](_0x688426[_0xfcc3('0x48')],{})[_0xfcc3('0x3f')](respondWithResult(_0x465917,0xc9))[_0xfcc3('0x43')](handleError(_0x465917,null));};exports[_0xfcc3('0x22')]=function(_0x52df99,_0x304ec3){if(_0x52df99['body']['id']){delete _0x52df99[_0xfcc3('0x48')]['id'];}return db[_0xfcc3('0x3e')][_0xfcc3('0x49')]({'where':{'id':_0x52df99[_0xfcc3('0x45')]['id']}})['then'](handleEntityNotFound(_0x304ec3,null))[_0xfcc3('0x3f')](saveUpdates(_0x52df99[_0xfcc3('0x48')],null))[_0xfcc3('0x3f')](respondWithResult(_0x304ec3,null))[_0xfcc3('0x43')](handleError(_0x304ec3,null));};exports[_0xfcc3('0x23')]=function(_0x5dc025,_0x21e678){return db[_0xfcc3('0x3e')][_0xfcc3('0x49')]({'where':{'id':_0x5dc025[_0xfcc3('0x45')]['id']}})[_0xfcc3('0x3f')](handleEntityNotFound(_0x21e678,null))[_0xfcc3('0x3f')](removeEntity(_0x21e678,null))[_0xfcc3('0x43')](handleError(_0x21e678,null));}; \ No newline at end of file +var _0x0086=['../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','status','end','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','then','destroy','sendStatus','error','name','index','map','VoiceQueuesLog','rawAttributes','fieldName','type','key','query','intersection','model','attributes','length','hasOwnProperty','nolimit','order','sort','where','pick','filters','filter','merge','VIRTUAL','options','includeAll','include','findAll','catch','show','params','keys','fields','create','body','find','eml-format','zip-dir','fast-json-patch','moment','bluebird','mustache','util','path','sox','to-csv','fs-extra','lodash','squel','desk.js','papaparse','ioredis','../../components/auth/service'];(function(_0x5f37bf,_0x306d14){var _0x34f057=function(_0x5ab230){while(--_0x5ab230){_0x5f37bf['push'](_0x5f37bf['shift']());}};_0x34f057(++_0x306d14);}(_0x0086,0x16b));var _0x6008=function(_0x5d1af1,_0x50b9d7){_0x5d1af1=_0x5d1af1-0x0;var _0x167f79=_0x0086[_0x5d1af1];return _0x167f79;};'use strict';var emlformat=require(_0x6008('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x6008('0x1'));var jsonpatch=require(_0x6008('0x2'));var rp=require('request-promise');var moment=require(_0x6008('0x3'));var BPromise=require(_0x6008('0x4'));var Mustache=require(_0x6008('0x5'));var util=require(_0x6008('0x6'));var path=require(_0x6008('0x7'));var sox=require(_0x6008('0x8'));var csv=require(_0x6008('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x6008('0xa'));var _=require(_0x6008('0xb'));var squel=require(_0x6008('0xc'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x6008('0xd'));var toCsv=require(_0x6008('0x9'));var querystring=require('querystring');var Papa=require(_0x6008('0xe'));var Redis=require(_0x6008('0xf'));var authService=require(_0x6008('0x10'));var qs=require(_0x6008('0x11'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x6008('0x12'));var logger=require(_0x6008('0x13'))(_0x6008('0x14'));var utils=require(_0x6008('0x15'));var config=require(_0x6008('0x16'));var licenseUtil=require(_0x6008('0x17'));var db=require(_0x6008('0x18'))['db'];function respondWithStatusCode(_0x336e76,_0x32904d){_0x32904d=_0x32904d||0xcc;return function(_0x2a6f57){if(_0x2a6f57){return _0x336e76['sendStatus'](_0x32904d);}return _0x336e76[_0x6008('0x19')](_0x32904d)[_0x6008('0x1a')]();};}function respondWithResult(_0x1d8be7,_0x2b9d1a){_0x2b9d1a=_0x2b9d1a||0xc8;return function(_0x3adca1){if(_0x3adca1){return _0x1d8be7[_0x6008('0x19')](_0x2b9d1a)['json'](_0x3adca1);}};}function respondWithFilteredResult(_0x5e39cf,_0x36f910){return function(_0x2e7ade){if(_0x2e7ade){var _0x2b63be=typeof _0x36f910[_0x6008('0x1b')]===_0x6008('0x1c')&&typeof _0x36f910[_0x6008('0x1d')]===_0x6008('0x1c');var _0x3261fc=_0x2e7ade[_0x6008('0x1e')];var _0x50109a=_0x2b63be?0x0:_0x36f910['offset'];var _0x506e97=_0x2b63be?_0x2e7ade[_0x6008('0x1e')]:_0x36f910['offset']+_0x36f910['limit'];var _0x18982b;if(_0x506e97>=_0x3261fc){_0x506e97=_0x3261fc;_0x18982b=0xc8;}else{_0x18982b=0xce;}_0x5e39cf['status'](_0x18982b);return _0x5e39cf[_0x6008('0x1f')](_0x6008('0x20'),_0x50109a+'-'+_0x506e97+'/'+_0x3261fc)['json'](_0x2e7ade);}return null;};}function patchUpdates(_0x1b3814){return function(_0x4c12e1){try{jsonpatch[_0x6008('0x21')](_0x4c12e1,_0x1b3814,!![]);}catch(_0x5587d2){return BPromise[_0x6008('0x22')](_0x5587d2);}return _0x4c12e1[_0x6008('0x23')]();};}function saveUpdates(_0x552e2d,_0x3e5965){return function(_0x52018d){if(_0x52018d){return _0x52018d[_0x6008('0x24')](_0x552e2d)[_0x6008('0x25')](function(_0xf698fa){return _0xf698fa;});}return null;};}function removeEntity(_0x5ccb92,_0x272f57){return function(_0x4631be){if(_0x4631be){return _0x4631be[_0x6008('0x26')]()['then'](function(){_0x5ccb92['status'](0xcc)[_0x6008('0x1a')]();});}};}function handleEntityNotFound(_0x1159bb,_0x1d1773){return function(_0x1e9950){if(!_0x1e9950){_0x1159bb[_0x6008('0x27')](0x194);}return _0x1e9950;};}function handleError(_0x2071c7,_0x1f1e04){_0x1f1e04=_0x1f1e04||0x1f4;return function(_0x5ce307){logger[_0x6008('0x28')](_0x5ce307['stack']);if(_0x5ce307[_0x6008('0x29')]){delete _0x5ce307[_0x6008('0x29')];}_0x2071c7[_0x6008('0x19')](_0x1f1e04)['send'](_0x5ce307);};}exports[_0x6008('0x2a')]=function(_0x56266e,_0x1b14aa){var _0x1858a2={},_0xa01b4a={},_0x323c2b={'count':0x0,'rows':[]};var _0x11ce70=_[_0x6008('0x2b')](db[_0x6008('0x2c')][_0x6008('0x2d')],function(_0x5a6ba4){return{'name':_0x5a6ba4[_0x6008('0x2e')],'type':_0x5a6ba4[_0x6008('0x2f')][_0x6008('0x30')]};});_0xa01b4a['model']=_[_0x6008('0x2b')](_0x11ce70,_0x6008('0x29'));_0xa01b4a[_0x6008('0x31')]=_['keys'](_0x56266e[_0x6008('0x31')]);_0xa01b4a['filters']=_[_0x6008('0x32')](_0xa01b4a[_0x6008('0x33')],_0xa01b4a[_0x6008('0x31')]);_0x1858a2[_0x6008('0x34')]=_[_0x6008('0x32')](_0xa01b4a[_0x6008('0x33')],qs['fields'](_0x56266e[_0x6008('0x31')]['fields']));_0x1858a2[_0x6008('0x34')]=_0x1858a2[_0x6008('0x34')][_0x6008('0x35')]?_0x1858a2[_0x6008('0x34')]:_0xa01b4a[_0x6008('0x33')];if(!_0x56266e[_0x6008('0x31')][_0x6008('0x36')](_0x6008('0x37'))){_0x1858a2['limit']=qs[_0x6008('0x1d')](_0x56266e[_0x6008('0x31')]['limit']);_0x1858a2[_0x6008('0x1b')]=qs[_0x6008('0x1b')](_0x56266e['query']['offset']);}_0x1858a2[_0x6008('0x38')]=qs[_0x6008('0x39')](_0x56266e[_0x6008('0x31')][_0x6008('0x39')]);_0x1858a2[_0x6008('0x3a')]=qs['filters'](_[_0x6008('0x3b')](_0x56266e[_0x6008('0x31')],_0xa01b4a[_0x6008('0x3c')]),_0x11ce70);if(_0x56266e[_0x6008('0x31')][_0x6008('0x3d')]){_0x1858a2[_0x6008('0x3a')]=_[_0x6008('0x3e')](_0x1858a2[_0x6008('0x3a')],{'$or':_[_0x6008('0x2b')](_0x11ce70,function(_0x3b6a0d){if(_0x3b6a0d[_0x6008('0x2f')]!==_0x6008('0x3f')){var _0x2d47dd={};_0x2d47dd[_0x3b6a0d[_0x6008('0x29')]]={'$like':'%'+_0x56266e[_0x6008('0x31')][_0x6008('0x3d')]+'%'};return _0x2d47dd;}})});}_0x1858a2=_[_0x6008('0x3e')]({},_0x1858a2,_0x56266e[_0x6008('0x40')]);var _0x1a5dff={'where':_0x1858a2['where']};return db[_0x6008('0x2c')][_0x6008('0x1e')](_0x1a5dff)[_0x6008('0x25')](function(_0x24f557){_0x323c2b[_0x6008('0x1e')]=_0x24f557;if(_0x56266e['query'][_0x6008('0x41')]){_0x1858a2[_0x6008('0x42')]=[{'all':!![]}];}return db[_0x6008('0x2c')][_0x6008('0x43')](_0x1858a2);})[_0x6008('0x25')](function(_0x29dd14){_0x323c2b['rows']=_0x29dd14;return _0x323c2b;})[_0x6008('0x25')](respondWithFilteredResult(_0x1b14aa,_0x1858a2))[_0x6008('0x44')](handleError(_0x1b14aa,null));};exports[_0x6008('0x45')]=function(_0x196da0,_0x4c31a5){var _0x10fae9={'raw':!![],'where':{'id':_0x196da0[_0x6008('0x46')]['id']}},_0x2c59a4={};_0x2c59a4[_0x6008('0x33')]=_[_0x6008('0x47')](db[_0x6008('0x2c')]['rawAttributes']);_0x2c59a4['query']=_[_0x6008('0x47')](_0x196da0[_0x6008('0x31')]);_0x2c59a4[_0x6008('0x3c')]=_[_0x6008('0x32')](_0x2c59a4[_0x6008('0x33')],_0x2c59a4['query']);_0x10fae9[_0x6008('0x34')]=_[_0x6008('0x32')](_0x2c59a4['model'],qs[_0x6008('0x48')](_0x196da0[_0x6008('0x31')][_0x6008('0x48')]));_0x10fae9[_0x6008('0x34')]=_0x10fae9['attributes'][_0x6008('0x35')]?_0x10fae9[_0x6008('0x34')]:_0x2c59a4[_0x6008('0x33')];if(_0x196da0[_0x6008('0x31')][_0x6008('0x41')]){_0x10fae9[_0x6008('0x42')]=[{'all':!![]}];}_0x10fae9=_[_0x6008('0x3e')]({},_0x10fae9,_0x196da0[_0x6008('0x40')]);return db[_0x6008('0x2c')]['find'](_0x10fae9)[_0x6008('0x25')](handleEntityNotFound(_0x4c31a5,null))[_0x6008('0x25')](respondWithResult(_0x4c31a5,null))[_0x6008('0x44')](handleError(_0x4c31a5,null));};exports[_0x6008('0x49')]=function(_0x48d74d,_0x3fddf0){return db[_0x6008('0x2c')][_0x6008('0x49')](_0x48d74d[_0x6008('0x4a')],{})[_0x6008('0x25')](respondWithResult(_0x3fddf0,0xc9))[_0x6008('0x44')](handleError(_0x3fddf0,null));};exports[_0x6008('0x24')]=function(_0x250b5c,_0x12bbd3){if(_0x250b5c[_0x6008('0x4a')]['id']){delete _0x250b5c[_0x6008('0x4a')]['id'];}return db[_0x6008('0x2c')][_0x6008('0x4b')]({'where':{'id':_0x250b5c[_0x6008('0x46')]['id']}})[_0x6008('0x25')](handleEntityNotFound(_0x12bbd3,null))[_0x6008('0x25')](saveUpdates(_0x250b5c[_0x6008('0x4a')],null))['then'](respondWithResult(_0x12bbd3,null))[_0x6008('0x44')](handleError(_0x12bbd3,null));};exports[_0x6008('0x26')]=function(_0x15afc6,_0x305c8d){return db[_0x6008('0x2c')]['find']({'where':{'id':_0x15afc6[_0x6008('0x46')]['id']}})[_0x6008('0x25')](handleEntityNotFound(_0x305c8d,null))[_0x6008('0x25')](removeEntity(_0x305c8d,null))[_0x6008('0x44')](handleError(_0x305c8d,null));}; \ No newline at end of file diff --git a/server/api/voiceQueuesLog/voiceQueuesLog.model.js b/server/api/voiceQueuesLog/voiceQueuesLog.model.js index c78ab30..6fb5d19 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 _0x0e11=['../../config/logger','api','moment','request-promise','../../config/environment','./voiceQueuesLog.attributes','exports','VoiceQueuesLog','voice_queues_log','event_dtm','event','dtm','lodash','util'];(function(_0x2e80f2,_0x4a8364){var _0x12ef3c=function(_0x21088d){while(--_0x21088d){_0x2e80f2['push'](_0x2e80f2['shift']());}};_0x12ef3c(++_0x4a8364);}(_0x0e11,0x16a));var _0x10e1=function(_0x1ba59d,_0x22ab1f){_0x1ba59d=_0x1ba59d-0x0;var _0x38c360=_0x0e11[_0x1ba59d];return _0x38c360;};'use strict';var _=require(_0x10e1('0x0'));var util=require(_0x10e1('0x1'));var logger=require(_0x10e1('0x2'))(_0x10e1('0x3'));var moment=require(_0x10e1('0x4'));var BPromise=require('bluebird');var rp=require(_0x10e1('0x5'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0x10e1('0x6'));var attributes=require(_0x10e1('0x7'));module[_0x10e1('0x8')]=function(_0x1deff0,_0x38e95e){return _0x1deff0['define'](_0x10e1('0x9'),attributes,{'tableName':_0x10e1('0xa'),'paranoid':![],'indexes':[{'name':_0x10e1('0xb'),'fields':[_0x10e1('0xc'),_0x10e1('0xd')]}],'timestamps':![]});}; \ No newline at end of file +var _0xa450=['dtm','lodash','util','../../config/logger','api','request-promise','path','../../config/environment','./voiceQueuesLog.attributes','define','voice_queues_log','event_dtm','event'];(function(_0x3e6469,_0x503c0d){var _0x5b6fa3=function(_0xd6375b){while(--_0xd6375b){_0x3e6469['push'](_0x3e6469['shift']());}};_0x5b6fa3(++_0x503c0d);}(_0xa450,0x16d));var _0x0a45=function(_0xb0b268,_0x3ec937){_0xb0b268=_0xb0b268-0x0;var _0x50b8b5=_0xa450[_0xb0b268];return _0x50b8b5;};'use strict';var _=require(_0x0a45('0x0'));var util=require(_0x0a45('0x1'));var logger=require(_0x0a45('0x2'))(_0x0a45('0x3'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0x0a45('0x4'));var fs=require('fs');var path=require(_0x0a45('0x5'));var rimraf=require('rimraf');var config=require(_0x0a45('0x6'));var attributes=require(_0x0a45('0x7'));module['exports']=function(_0x3d855c,_0x1213db){return _0x3d855c[_0x0a45('0x8')]('VoiceQueuesLog',attributes,{'tableName':_0x0a45('0x9'),'paranoid':![],'indexes':[{'name':_0x0a45('0xa'),'fields':[_0x0a45('0xb'),_0x0a45('0xc')]}],'timestamps':![]});}; \ No newline at end of file diff --git a/server/api/voiceQueuesLog/voiceQueuesLog.rpc.js b/server/api/voiceQueuesLog/voiceQueuesLog.rpc.js index 26fb11a..cc5aa0f 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 _0x7382=['../../mysqldb','../../config/logger','rpc','jayson/promise','client','http','request','then','info','VoiceQueuesLog,\x20%s,\x20%s','request\x20sent','debug','VoiceQueuesLog,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','util','randomstring'];(function(_0x1b025e,_0x1ea348){var _0xa31d2=function(_0x3461e3){while(--_0x3461e3){_0x1b025e['push'](_0x1b025e['shift']());}};_0xa31d2(++_0x1ea348);}(_0x7382,0x1f2));var _0x2738=function(_0x2b8a35,_0x1d9de5){_0x2b8a35=_0x2b8a35-0x0;var _0x494366=_0x7382[_0x2b8a35];return _0x494366;};'use strict';var _=require('lodash');var util=require(_0x2738('0x0'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0x2738('0x1'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x2738('0x2'))['db'];var utils=require('../../config/utils');var logger=require(_0x2738('0x3'))(_0x2738('0x4'));var config=require('../../config/environment');var jayson=require(_0x2738('0x5'));var client=jayson[_0x2738('0x6')][_0x2738('0x7')]({'port':0x232a});function respondWithRpcPromise(_0x1437b0,_0x4f0d91,_0x99e22e){return new BPromise(function(_0x20a64f,_0x351335){return client[_0x2738('0x8')](_0x1437b0,_0x99e22e)[_0x2738('0x9')](function(_0x4d8c36){logger[_0x2738('0xa')](_0x2738('0xb'),_0x4f0d91,_0x2738('0xc'));logger[_0x2738('0xd')](_0x2738('0xe'),_0x4f0d91,'request\x20sent',JSON['stringify'](_0x4d8c36));if(_0x4d8c36['error']){if(_0x4d8c36[_0x2738('0xf')][_0x2738('0x10')]===0x1f4){logger[_0x2738('0xf')](_0x2738('0xb'),_0x4f0d91,_0x4d8c36[_0x2738('0xf')][_0x2738('0x11')]);return _0x351335(_0x4d8c36[_0x2738('0xf')][_0x2738('0x11')]);}logger[_0x2738('0xf')](_0x2738('0xb'),_0x4f0d91,_0x4d8c36[_0x2738('0xf')][_0x2738('0x11')]);return _0x20a64f(_0x4d8c36['error'][_0x2738('0x11')]);}else{logger[_0x2738('0xa')]('VoiceQueuesLog,\x20%s,\x20%s',_0x4f0d91,'request\x20sent');_0x20a64f(_0x4d8c36[_0x2738('0x12')][_0x2738('0x11')]);}})[_0x2738('0x13')](function(_0x588a68){logger[_0x2738('0xf')](_0x2738('0xb'),_0x4f0d91,_0x588a68);_0x351335(_0x588a68);});});} \ No newline at end of file +var _0x0f1a=['bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','../../config/environment','jayson/promise','http','request','then','info','VoiceQueuesLog,\x20%s,\x20%s','request\x20sent','debug','VoiceQueuesLog,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','lodash'];(function(_0x409fb8,_0x5ab3d3){var _0x278270=function(_0x58849c){while(--_0x58849c){_0x409fb8['push'](_0x409fb8['shift']());}};_0x278270(++_0x5ab3d3);}(_0x0f1a,0x1cd));var _0xa0f1=function(_0x190d2c,_0x159734){_0x190d2c=_0x190d2c-0x0;var _0x83d998=_0x0f1a[_0x190d2c];return _0x83d998;};'use strict';var _=require(_0xa0f1('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0xa0f1('0x1'));var rs=require(_0xa0f1('0x2'));var fs=require('fs');var Redis=require(_0xa0f1('0x3'));var db=require(_0xa0f1('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0xa0f1('0x5'))('rpc');var config=require(_0xa0f1('0x6'));var jayson=require(_0xa0f1('0x7'));var client=jayson['client'][_0xa0f1('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x690eff,_0x4e67e2,_0x3f0855){return new BPromise(function(_0x58149e,_0x5dd6c3){return client[_0xa0f1('0x9')](_0x690eff,_0x3f0855)[_0xa0f1('0xa')](function(_0x369bb8){logger[_0xa0f1('0xb')](_0xa0f1('0xc'),_0x4e67e2,_0xa0f1('0xd'));logger[_0xa0f1('0xe')](_0xa0f1('0xf'),_0x4e67e2,'request\x20sent',JSON[_0xa0f1('0x10')](_0x369bb8));if(_0x369bb8['error']){if(_0x369bb8[_0xa0f1('0x11')][_0xa0f1('0x12')]===0x1f4){logger[_0xa0f1('0x11')](_0xa0f1('0xc'),_0x4e67e2,_0x369bb8[_0xa0f1('0x11')]['message']);return _0x5dd6c3(_0x369bb8[_0xa0f1('0x11')][_0xa0f1('0x13')]);}logger[_0xa0f1('0x11')](_0xa0f1('0xc'),_0x4e67e2,_0x369bb8[_0xa0f1('0x11')][_0xa0f1('0x13')]);return _0x58149e(_0x369bb8[_0xa0f1('0x11')][_0xa0f1('0x13')]);}else{logger[_0xa0f1('0xb')]('VoiceQueuesLog,\x20%s,\x20%s',_0x4e67e2,_0xa0f1('0xd'));_0x58149e(_0x369bb8[_0xa0f1('0x14')][_0xa0f1('0x13')]);}})[_0xa0f1('0x15')](function(_0x15da8f){logger[_0xa0f1('0x11')](_0xa0f1('0xc'),_0x4e67e2,_0x15da8f);_0x5dd6c3(_0x15da8f);});});} \ No newline at end of file diff --git a/server/api/voiceRecording/index.js b/server/api/voiceRecording/index.js index 5960bf2..c1b365e 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 _0x1139=['/:id/downloads','/:id/transcribe','create','runTranscribe','put','update','delete','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./voiceRecording.controller','get','index','/describe','isAuthenticated','describe','/:id','show','/:id/download','download'];(function(_0x19950b,_0x53d0d7){var _0x3c6b41=function(_0x3924ad){while(--_0x3924ad){_0x19950b['push'](_0x19950b['shift']());}};_0x3c6b41(++_0x53d0d7);}(_0x1139,0x1ac));var _0x9113=function(_0x46698a,_0x8de1e4){_0x46698a=_0x46698a-0x0;var _0x356db0=_0x1139[_0x46698a];return _0x356db0;};'use strict';var multer=require(_0x9113('0x0'));var util=require(_0x9113('0x1'));var path=require(_0x9113('0x2'));var timeout=require(_0x9113('0x3'));var express=require(_0x9113('0x4'));var router=express[_0x9113('0x5')]();var fs_extra=require(_0x9113('0x6'));var auth=require(_0x9113('0x7'));var interaction=require(_0x9113('0x8'));var config=require(_0x9113('0x9'));var controller=require(_0x9113('0xa'));router[_0x9113('0xb')]('/',auth['isAuthenticated'](),controller[_0x9113('0xc')]);router['get'](_0x9113('0xd'),auth[_0x9113('0xe')](),controller[_0x9113('0xf')]);router[_0x9113('0xb')](_0x9113('0x10'),auth['isAuthenticated'](),controller[_0x9113('0x11')]);router[_0x9113('0xb')](_0x9113('0x12'),auth[_0x9113('0xe')](),controller[_0x9113('0x13')]);router[_0x9113('0xb')](_0x9113('0x14'),controller['downloads']);router['get'](_0x9113('0x15'),auth['isAuthenticated'](),controller['downloadTranscribe']);router['post']('/',auth['isAuthenticated'](),controller[_0x9113('0x16')]);router['post']('/:id/transcribe',auth[_0x9113('0xe')](),controller[_0x9113('0x17')]);router[_0x9113('0x18')]('/:id',auth['isAuthenticated'](),controller[_0x9113('0x19')]);router[_0x9113('0x1a')](_0x9113('0x10'),auth['isAuthenticated'](),controller['destroy']);module[_0x9113('0x1b')]=router; \ No newline at end of file +var _0xcfbc=['util','path','connect-timeout','express','fs-extra','../../components/auth/service','../../config/environment','get','isAuthenticated','index','/describe','describe','/:id/download','/:id/downloads','downloads','/:id/transcribe','downloadTranscribe','post','create','put','/:id','update','delete','exports'];(function(_0x5dbe8c,_0x4068a0){var _0x5ec79b=function(_0x1af497){while(--_0x1af497){_0x5dbe8c['push'](_0x5dbe8c['shift']());}};_0x5ec79b(++_0x4068a0);}(_0xcfbc,0x120));var _0xccfb=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0xcfbc[_0x321bb2];return _0x9c12ed;};'use strict';var multer=require('multer');var util=require(_0xccfb('0x0'));var path=require(_0xccfb('0x1'));var timeout=require(_0xccfb('0x2'));var express=require(_0xccfb('0x3'));var router=express['Router']();var fs_extra=require(_0xccfb('0x4'));var auth=require(_0xccfb('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0xccfb('0x6'));var controller=require('./voiceRecording.controller');router[_0xccfb('0x7')]('/',auth[_0xccfb('0x8')](),controller[_0xccfb('0x9')]);router[_0xccfb('0x7')](_0xccfb('0xa'),auth[_0xccfb('0x8')](),controller[_0xccfb('0xb')]);router[_0xccfb('0x7')]('/:id',auth[_0xccfb('0x8')](),controller['show']);router[_0xccfb('0x7')](_0xccfb('0xc'),auth[_0xccfb('0x8')](),controller['download']);router[_0xccfb('0x7')](_0xccfb('0xd'),controller[_0xccfb('0xe')]);router[_0xccfb('0x7')](_0xccfb('0xf'),auth[_0xccfb('0x8')](),controller[_0xccfb('0x10')]);router[_0xccfb('0x11')]('/',auth[_0xccfb('0x8')](),controller[_0xccfb('0x12')]);router[_0xccfb('0x11')](_0xccfb('0xf'),auth[_0xccfb('0x8')](),controller['runTranscribe']);router[_0xccfb('0x13')](_0xccfb('0x14'),auth['isAuthenticated'](),controller[_0xccfb('0x15')]);router[_0xccfb('0x16')](_0xccfb('0x14'),auth[_0xccfb('0x8')](),controller['destroy']);module[_0xccfb('0x17')]=router; \ No newline at end of file diff --git a/server/api/voiceRecording/voiceRecording.attributes.js b/server/api/voiceRecording/voiceRecording.attributes.js index 133fd66..e9e81ec 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(_0x122096,_0x60c295){var _0x3d1966=function(_0x3d569e){while(--_0x3d569e){_0x122096['push'](_0x122096['shift']());}};_0x3d1966(++_0x60c295);}(_0xa9e0,0x123));var _0x0a9e=function(_0x2160a9,_0x3cbd9e){_0x2160a9=_0x2160a9-0x0;var _0xa88cf7=_0xa9e0[_0x2160a9];return _0xa88cf7;};'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(_0x47aa64,_0xfb8a07){var _0x549c7a=function(_0x266165){while(--_0x266165){_0x47aa64['push'](_0x47aa64['shift']());}};_0x549c7a(++_0xfb8a07);}(_0xa9e0,0x123));var _0x0a9e=function(_0x4cf98e,_0xba4b79){_0x4cf98e=_0x4cf98e-0x0;var _0x1623ac=_0xa9e0[_0x4cf98e];return _0x1623ac;};'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 b4431ad..6c6fc04 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 _0x74fe=['Location','bucket','Bucket','location','[RUNTRANSCRIPT][%d]\x20Sending\x20transcribe\x20request','[RUNTRANSCRIPT][%d]\x20Transcription\x20job\x20%s\x20created','TranscriptionJob','transcribeStatus','runTranscribe','findOne','decryptFile','Voice\x20Recording\x20not\x20found','Setting','transcribe','transcribeAccountId','transcribeRegion','language','runSentiment','sentiment','CloudProvider','Cloud\x20Provider\x20not\x20available','data2','Buckets','Name','[RUNTRANSCRIPT][%d]\x20Bucket\x20%s\x20not\x20available','data1','NEW','[RUNTRANSCRIPT][%d]\x20Transcript\x20action\x20already\x20requested','updateAttributes','downloadTranscribe','fileText','/server/files/transcribes/transcribe_','.txt','Transcript\x20not\x20available','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','sox','ejs','lodash','squel','crypto','jsforce','desk.js','to-csv','querystring','uuid/v4','../../components/auth/service','../../components/parsers/advancedSearch','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','destroy','then','end','error','name','VoiceRecording','fieldName','type','key','model','differenceBy','map','format','keys','query','intersection','fields','attributes','length','hasOwnProperty','sort','where','filters','pick','filter','merge','VIRTUAL','includeAll','include','findAll','show','params','rawAttributes','find','catch','create','body','describe','uniqueid','value','%s.cypher','existsSync','secrets','Sequelize','filename','download','extname','unlink','message','VoiceRecording\x20not\x20found','send','downloads','../../components/encryptor','sequelize','MD5','col','push','$and','recording','ValidationError','isNil','info','cancellazione\x20fisica\x20documento\x20%s','File:\x20\x22','unlinkSync','listBuckets','createBucket','upload','TranscribeService','startTranscriptionJob','[RUNTRANSCRIPT][%d]\x20Starting\x20voice\x20recording\x20upload\x20in\x20bucket\x20%s','basename','[RUNTRANSCRIPT][%d]\x20Voice\x20recording\x20uploaded\x20in\x20bucket\x20%s\x20(%s)'];(function(_0x110b00,_0x2a0358){var _0x29b6d0=function(_0x3d2e18){while(--_0x3d2e18){_0x110b00['push'](_0x110b00['shift']());}};_0x29b6d0(++_0x2a0358);}(_0x74fe,0xb3));var _0xe74f=function(_0xcf925d,_0x500d26){_0xcf925d=_0xcf925d-0x0;var _0x2ba6d0=_0x74fe[_0xcf925d];return _0x2ba6d0;};'use strict';var emlformat=require(_0xe74f('0x0'));var rimraf=require(_0xe74f('0x1'));var zipdir=require(_0xe74f('0x2'));var jsonpatch=require(_0xe74f('0x3'));var rp=require(_0xe74f('0x4'));var moment=require('moment');var BPromise=require(_0xe74f('0x5'));var Mustache=require(_0xe74f('0x6'));var util=require(_0xe74f('0x7'));var path=require('path');var sox=require(_0xe74f('0x8'));var csv=require('to-csv');var ejs=require(_0xe74f('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xe74f('0xa'));var squel=require(_0xe74f('0xb'));var crypto=require(_0xe74f('0xc'));var jsforce=require(_0xe74f('0xd'));var deskjs=require(_0xe74f('0xe'));var toCsv=require(_0xe74f('0xf'));var querystring=require(_0xe74f('0x10'));var Papa=require('papaparse');var AWS=require('aws-sdk');var uuidv4=require(_0xe74f('0x11'));var Redis=require('ioredis');var authService=require(_0xe74f('0x12'));var qs=require('../../components/parsers/qs');var as=require(_0xe74f('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0xe74f('0x14'));var utils=require(_0xe74f('0x15'));var config=require(_0xe74f('0x16'));var licenseUtil=require(_0xe74f('0x17'));var db=require(_0xe74f('0x18'))['db'];function respondWithStatusCode(_0x1f6794,_0xd95515){_0xd95515=_0xd95515||0xcc;return function(_0x1a9ac2){if(_0x1a9ac2){return _0x1f6794[_0xe74f('0x19')](_0xd95515);}return _0x1f6794[_0xe74f('0x1a')](_0xd95515)['end']();};}function respondWithResult(_0x52d8b6,_0x2e9db3){_0x2e9db3=_0x2e9db3||0xc8;return function(_0x4bcaaf){if(_0x4bcaaf){return _0x52d8b6['status'](_0x2e9db3)[_0xe74f('0x1b')](_0x4bcaaf);}};}function respondWithFilteredResult(_0x11efbd,_0x38b0f2){return function(_0x1bfcc0){if(_0x1bfcc0){var _0x53bec2=typeof _0x38b0f2[_0xe74f('0x1c')]===_0xe74f('0x1d')&&typeof _0x38b0f2[_0xe74f('0x1e')]===_0xe74f('0x1d');var _0x1218fa=_0x1bfcc0['count'];var _0x123d7e=_0x53bec2?0x0:_0x38b0f2['offset'];var _0x13914a=_0x53bec2?_0x1bfcc0[_0xe74f('0x1f')]:_0x38b0f2['offset']+_0x38b0f2['limit'];var _0x454eba;if(_0x13914a>=_0x1218fa){_0x13914a=_0x1218fa;_0x454eba=0xc8;}else{_0x454eba=0xce;}_0x11efbd[_0xe74f('0x1a')](_0x454eba);return _0x11efbd[_0xe74f('0x20')](_0xe74f('0x21'),_0x123d7e+'-'+_0x13914a+'/'+_0x1218fa)[_0xe74f('0x1b')](_0x1bfcc0);}return null;};}function patchUpdates(_0x3ab766){return function(_0x317b71){try{jsonpatch[_0xe74f('0x22')](_0x317b71,_0x3ab766,!![]);}catch(_0x4cc998){return BPromise[_0xe74f('0x23')](_0x4cc998);}return _0x317b71[_0xe74f('0x24')]();};}function saveUpdates(_0x4a2582,_0x1468bd){return function(_0x54b788){if(_0x54b788){return _0x54b788[_0xe74f('0x25')](_0x4a2582)['then'](function(_0x393a95){return _0x393a95;});}return null;};}function removeEntity(_0x3ece66,_0x1c93b9){return function(_0x13a63f){if(_0x13a63f){return _0x13a63f[_0xe74f('0x26')]()[_0xe74f('0x27')](function(){_0x3ece66[_0xe74f('0x1a')](0xcc)[_0xe74f('0x28')]();});}};}function handleEntityNotFound(_0x9d5966,_0x5f37ac){return function(_0x1a1db4){if(!_0x1a1db4){_0x9d5966[_0xe74f('0x19')](0x194);}return _0x1a1db4;};}function handleError(_0x37cfd5,_0x331681){_0x331681=_0x331681||0x1f4;return function(_0x1e15a0){logger[_0xe74f('0x29')](_0x1e15a0['stack']);if(_0x1e15a0[_0xe74f('0x2a')]){delete _0x1e15a0[_0xe74f('0x2a')];}_0x37cfd5[_0xe74f('0x1a')](_0x331681)['send'](_0x1e15a0);};}exports['index']=function(_0x5260b0,_0x2ef81e){var _0x56fb71={},_0x334ee6={},_0x29223b={'count':0x0,'rows':[]};var _0x284421=_['map'](db[_0xe74f('0x2b')]['rawAttributes'],function(_0x36b4bf){return{'name':_0x36b4bf[_0xe74f('0x2c')],'type':_0x36b4bf[_0xe74f('0x2d')][_0xe74f('0x2e')]};});_0x334ee6[_0xe74f('0x2f')]=_[_0xe74f('0x30')](_[_0xe74f('0x31')](_0x284421,_0xe74f('0x2a')),[_0xe74f('0x32')]);_0x334ee6['query']=_[_0xe74f('0x33')](_0x5260b0[_0xe74f('0x34')]);_0x334ee6['filters']=_['intersection'](_0x334ee6[_0xe74f('0x2f')],_0x334ee6[_0xe74f('0x34')]);_0x56fb71['attributes']=_[_0xe74f('0x35')](_0x334ee6['model'],qs[_0xe74f('0x36')](_0x5260b0[_0xe74f('0x34')][_0xe74f('0x36')]));_0x56fb71[_0xe74f('0x37')]=_0x56fb71[_0xe74f('0x37')][_0xe74f('0x38')]?_0x56fb71[_0xe74f('0x37')]:_0x334ee6[_0xe74f('0x2f')];if(!_0x5260b0[_0xe74f('0x34')][_0xe74f('0x39')]('nolimit')){_0x56fb71[_0xe74f('0x1e')]=qs[_0xe74f('0x1e')](_0x5260b0[_0xe74f('0x34')][_0xe74f('0x1e')]);_0x56fb71[_0xe74f('0x1c')]=qs['offset'](_0x5260b0[_0xe74f('0x34')]['offset']);}_0x56fb71['order']=qs[_0xe74f('0x3a')](_0x5260b0[_0xe74f('0x34')]['sort']);_0x56fb71[_0xe74f('0x3b')]=qs[_0xe74f('0x3c')](_[_0xe74f('0x3d')](_0x5260b0['query'],_0x334ee6[_0xe74f('0x3c')]),_0x284421);if(_0x5260b0[_0xe74f('0x34')][_0xe74f('0x3e')]){_0x56fb71[_0xe74f('0x3b')]=_[_0xe74f('0x3f')](_0x56fb71[_0xe74f('0x3b')],{'$or':_[_0xe74f('0x31')](_0x284421,function(_0x1ac674){if(_0x1ac674['type']!==_0xe74f('0x40')){var _0x4d0426={};_0x4d0426[_0x1ac674[_0xe74f('0x2a')]]={'$like':'%'+_0x5260b0[_0xe74f('0x34')][_0xe74f('0x3e')]+'%'};return _0x4d0426;}})});}_0x56fb71=_[_0xe74f('0x3f')]({},_0x56fb71,_0x5260b0['options']);var _0x3dc959={'where':_0x56fb71[_0xe74f('0x3b')]};return db[_0xe74f('0x2b')][_0xe74f('0x1f')](_0x3dc959)[_0xe74f('0x27')](function(_0x49d2db){_0x29223b[_0xe74f('0x1f')]=_0x49d2db;if(_0x5260b0[_0xe74f('0x34')][_0xe74f('0x41')]){_0x56fb71[_0xe74f('0x42')]=[{'all':!![]}];}return db[_0xe74f('0x2b')][_0xe74f('0x43')](_0x56fb71);})[_0xe74f('0x27')](function(_0xac55ea){_0x29223b['rows']=_0xac55ea;return _0x29223b;})[_0xe74f('0x27')](respondWithFilteredResult(_0x2ef81e,_0x56fb71))['catch'](handleError(_0x2ef81e,null));};exports[_0xe74f('0x44')]=function(_0x30f212,_0x53ec85){var _0x1d86c7={'raw':![],'where':{'id':_0x30f212[_0xe74f('0x45')]['id']}},_0x290911={};_0x290911[_0xe74f('0x2f')]=_[_0xe74f('0x33')](db[_0xe74f('0x2b')][_0xe74f('0x46')]);_0x290911[_0xe74f('0x34')]=_[_0xe74f('0x33')](_0x30f212[_0xe74f('0x34')]);_0x290911['filters']=_[_0xe74f('0x35')](_0x290911[_0xe74f('0x2f')],_0x290911[_0xe74f('0x34')]);_0x1d86c7['attributes']=_[_0xe74f('0x35')](_0x290911[_0xe74f('0x2f')],qs[_0xe74f('0x36')](_0x30f212[_0xe74f('0x34')][_0xe74f('0x36')]));_0x1d86c7[_0xe74f('0x37')]=_0x1d86c7[_0xe74f('0x37')][_0xe74f('0x38')]?_0x1d86c7[_0xe74f('0x37')]:_0x290911[_0xe74f('0x2f')];if(_0x30f212[_0xe74f('0x34')][_0xe74f('0x41')]){_0x1d86c7[_0xe74f('0x42')]=[{'all':!![]}];}_0x1d86c7=_[_0xe74f('0x3f')]({},_0x1d86c7,_0x30f212['options']);return db['VoiceRecording'][_0xe74f('0x47')](_0x1d86c7)[_0xe74f('0x27')](handleEntityNotFound(_0x53ec85,null))[_0xe74f('0x27')](respondWithResult(_0x53ec85,null))[_0xe74f('0x48')](handleError(_0x53ec85,null));};exports[_0xe74f('0x49')]=function(_0x505897,_0x38cc33){return db[_0xe74f('0x2b')][_0xe74f('0x49')](_0x505897[_0xe74f('0x4a')],{})[_0xe74f('0x27')](respondWithResult(_0x38cc33,0xc9))[_0xe74f('0x48')](handleError(_0x38cc33,null));};exports['update']=function(_0x129a03,_0x37a011){if(_0x129a03['body']['id']){delete _0x129a03[_0xe74f('0x4a')]['id'];}return db[_0xe74f('0x2b')]['find']({'where':{'id':_0x129a03[_0xe74f('0x45')]['id']}})[_0xe74f('0x27')](handleEntityNotFound(_0x37a011,null))[_0xe74f('0x27')](saveUpdates(_0x129a03[_0xe74f('0x4a')],null))[_0xe74f('0x27')](respondWithResult(_0x37a011,null))[_0xe74f('0x48')](handleError(_0x37a011,null));};exports['describe']=function(_0x495b23,_0x230286){return db[_0xe74f('0x2b')][_0xe74f('0x4b')]()['then'](respondWithResult(_0x230286,null))[_0xe74f('0x48')](handleError(_0x230286,null));};exports['download']=function(_0x23af8a,_0x37b3c9,_0x15664c){var _0x49e34a=require('../../components/encryptor');var _0x40e9b5=![];var _0xe95dca={};if(_0x23af8a[_0xe74f('0x34')][_0xe74f('0x2d')]&&_0x23af8a[_0xe74f('0x34')]['type']===_0xe74f('0x4c')){_0xe95dca[_0xe74f('0x4c')]=_0x23af8a[_0xe74f('0x45')]['id'];}else{_0xe95dca['id']=_0x23af8a['params']['id'];}return db[_0xe74f('0x2b')]['find']({'where':_0xe95dca,'attributes':['id',_0xe74f('0x4d')],'raw':!![]})['then'](handleEntityNotFound(_0x37b3c9,null))[_0xe74f('0x27')](function(_0x528524){if(_0x528524){var _0x401e02=_0x528524[_0xe74f('0x4d')];var _0x407c87=util[_0xe74f('0x32')](_0xe74f('0x4e'),_0x401e02);if(fs[_0xe74f('0x4f')](_0x407c87)){_0x40e9b5=!![];return _0x49e34a['decryptFile'](_0x407c87,_0x401e02,config[_0xe74f('0x50')]['recording'])[_0xe74f('0x27')](function(){return _0x528524;});}return _0x528524;}})[_0xe74f('0x27')](function(_0x2cc2e2){if(_0x2cc2e2){var _0xdb3eff=_0x2cc2e2['value'];if(!fs[_0xe74f('0x4f')](_0xdb3eff)){throw new db[(_0xe74f('0x51'))]['ValidationError']('VoiceRecording\x20not\x20found');}if(_0x2cc2e2[_0xe74f('0x52')]){return _0x37b3c9[_0xe74f('0x53')](_0xdb3eff,_0x2cc2e2[_0xe74f('0x52')]+path[_0xe74f('0x54')](_0xdb3eff),function(){if(_0x40e9b5){fs['unlink'](_0xdb3eff);}});}else{return _0x37b3c9['download'](_0xdb3eff,function(_0x1c0d5e){if(_0x40e9b5){fs[_0xe74f('0x55')](_0xdb3eff);}});}}})[_0xe74f('0x48')](function(_0x4e58e5){if(_0x4e58e5[_0xe74f('0x56')]===_0xe74f('0x57')){_0x37b3c9[_0xe74f('0x1a')](0x194)[_0xe74f('0x58')]('Not\x20found');}else{return handleError(_0x37b3c9,null);}});};exports[_0xe74f('0x59')]=function(_0x47898e,_0xac9276,_0x49fed4){var _0x280302=require(_0xe74f('0x5a'));var _0x47d75c=![];var _0x24a59e={'$and':[db[_0xe74f('0x5b')]['where'](db[_0xe74f('0x5b')]['fn'](_0xe74f('0x5c'),db['sequelize'][_0xe74f('0x5d')]('uniqueid')),_0x47898e[_0xe74f('0x34')]['token'])]};if(_0x47898e[_0xe74f('0x34')]['type']&&_0x47898e['query'][_0xe74f('0x2d')]===_0xe74f('0x4c')){_0x24a59e['$and'][_0xe74f('0x5e')]({'uniqueid':_0x47898e[_0xe74f('0x45')]['id']});}else{_0x24a59e[_0xe74f('0x5f')]['push']({'id':_0x47898e['params']['id']});}return db[_0xe74f('0x2b')][_0xe74f('0x47')]({'where':_0x24a59e,'attributes':['id',_0xe74f('0x4d')],'raw':!![]})[_0xe74f('0x27')](handleEntityNotFound(_0xac9276,null))[_0xe74f('0x27')](function(_0x4236bf){if(_0x4236bf){var _0x30642f=util['format'](_0xe74f('0x4e'),_0x4236bf[_0xe74f('0x4d')]);if(fs['existsSync'](_0x30642f)){_0x47d75c=!![];return _0x280302['decryptFile'](_0x30642f,_0x4236bf['value'],config[_0xe74f('0x50')][_0xe74f('0x60')])[_0xe74f('0x27')](function(){return _0x4236bf;});}return _0x4236bf;}})['then'](function(_0x29ea76){if(_0x29ea76){if(!fs[_0xe74f('0x4f')](_0x29ea76[_0xe74f('0x4d')])){throw new db[(_0xe74f('0x51'))][(_0xe74f('0x61'))]('VoiceRecording\x20not\x20found');}if(_0x29ea76[_0xe74f('0x52')]){return _0xac9276[_0xe74f('0x53')](_0x29ea76[_0xe74f('0x4d')],_0x29ea76[_0xe74f('0x52')]+path[_0xe74f('0x54')](_0x29ea76[_0xe74f('0x4d')]),function(){if(_0x47d75c){fs[_0xe74f('0x55')](_0x29ea76[_0xe74f('0x4d')]);}});}else{return _0xac9276[_0xe74f('0x53')](_0x29ea76[_0xe74f('0x4d')],function(_0x18f453){if(_0x47d75c){fs[_0xe74f('0x55')](_0x29ea76['value']);}});}}})[_0xe74f('0x48')](handleError(_0xac9276,null));};exports['destroy']=function(_0x5d5e35,_0x4a3296){return db[_0xe74f('0x2b')][_0xe74f('0x47')]({'where':{'id':_0x5d5e35[_0xe74f('0x45')]['id']}})[_0xe74f('0x27')](function(_0x1ba760){if(_[_0xe74f('0x62')](_0x1ba760)){throw new ReferenceError('Entity\x20not\x20found');}return _0x1ba760;})[_0xe74f('0x27')](function(_0x1f1eeb){var _0x4fb43f=_0x1f1eeb[_0xe74f('0x4d')];logger[_0xe74f('0x63')](_0xe74f('0x64'),_0x4fb43f);if(!_[_0xe74f('0x62')](_0x1f1eeb['value'])&&fs[_0xe74f('0x4f')](_0x4fb43f)){logger[_0xe74f('0x63')](_0xe74f('0x65')+_0x4fb43f+'\x22\x20trovato\x20eseguo\x20la\x20cancellazione');fs[_0xe74f('0x66')](_0x4fb43f);}_0x4fb43f=_0x4fb43f+'.cypher';if(!_[_0xe74f('0x62')](_0x1f1eeb[_0xe74f('0x4d')])&&fs['existsSync'](_0x4fb43f)){logger[_0xe74f('0x63')](_0xe74f('0x65')+_0x4fb43f+'\x22\x20trovato\x20eseguo\x20la\x20cancellazione');fs[_0xe74f('0x66')](_0x4fb43f);}return _0x1f1eeb;})['then'](function(_0x4335c2){if(!_0x4335c2)throw new InternalError();return _0x4335c2[_0xe74f('0x26')]();})[_0xe74f('0x27')](function(){_0x4a3296[_0xe74f('0x1a')](0xcc)['end']();})[_0xe74f('0x48')](handleError(_0x4a3296,null));};function getBucketslist(_0x18a4f0,_0x30b8e6,_0x562e57){return new Promise(function(_0x103b3f,_0x27d756){var _0x21ed21=new AWS['S3']({'accessKeyId':_0x30b8e6,'secretAccessKey':_0x18a4f0,'region':_0x562e57});_0x21ed21[_0xe74f('0x67')]({},function(_0x946961,_0x5c1397){if(_0x946961){return _0x27d756(_0x946961);}else{return _0x103b3f(_0x5c1397);}});});}function createBucket(_0x16c072,_0x2da392,_0x26fc14,_0x10a26a){return new Promise(function(_0x1211a2,_0x4cc718){var _0x4210a1=new AWS['S3']({'accessKeyId':_0x2da392,'secretAccessKey':_0x16c072,'region':_0x26fc14});_0x4210a1[_0xe74f('0x68')]({'Bucket':_0x10a26a},function(_0x2acbe3,_0xc10b6b){if(_0x2acbe3){return _0x4cc718(_0x2acbe3);}else{return _0x1211a2(_0xc10b6b);}});});}function uploadFile(_0x54d022,_0x1a51b3,_0x26dbf7,_0x34e922,_0x4e135d,_0x599e9a){return new Promise(function(_0x1fc082,_0xbba492){var _0x32a4a1=new AWS['S3']({'accessKeyId':_0x1a51b3,'secretAccessKey':_0x54d022,'region':_0x26dbf7});_0x32a4a1[_0xe74f('0x69')]({'Bucket':_0x34e922,'Key':_0x4e135d,'Body':_0x599e9a},function(_0x5df4a6,_0x452f78){if(_0x5df4a6){return _0xbba492(_0x5df4a6);}else{return _0x1fc082(_0x452f78);}});});}function startTranscribe(_0x522fde,_0x3b8589,_0x3d0487,_0x368d3e,_0x442556,_0x52ba40){return new Promise(function(_0x5aa29e,_0x49e44d){var _0x311015=new AWS[(_0xe74f('0x6a'))]({'accessKeyId':_0x3b8589,'secretAccessKey':_0x522fde,'region':_0x3d0487});_0x311015[_0xe74f('0x6b')]({'TranscriptionJobName':_0x368d3e,'LanguageCode':_0x442556,'Media':{'MediaFileUri':_0x52ba40}},function(_0x269397,_0x595ec5){if(_0x269397){return _0x49e44d(_0x269397);}else{return _0x5aa29e(_0x595ec5);}});});}function transcribe(_0xd53254,_0x46302b,_0x5e2c54,_0x36b28b,_0x1b0601,_0x24310e,_0x1508a7){return new Promise(function(_0x160564,_0x211093){var _0x81e45c={};logger[_0xe74f('0x63')](util[_0xe74f('0x32')](_0xe74f('0x6c'),_0xd53254,_0x1b0601));return uploadFile(_0x46302b,_0x5e2c54,_0x36b28b,_0x1b0601,path[_0xe74f('0x6d')](_0x24310e),fs['readFileSync'](_0x24310e))['then'](function(_0x48142d){logger['info'](util['format'](_0xe74f('0x6e'),_0xd53254,_0x1b0601,_0x48142d[_0xe74f('0x6f')]));_0x81e45c[_0xe74f('0x70')]=_0x48142d[_0xe74f('0x71')];_0x81e45c[_0xe74f('0x72')]=_0x48142d[_0xe74f('0x6f')];logger[_0xe74f('0x63')](util['format'](_0xe74f('0x73'),_0xd53254));return startTranscribe(_0x46302b,_0x5e2c54,_0x36b28b,uuidv4(),_0x1508a7,_0x48142d['Location']);})[_0xe74f('0x27')](function(_0x3d51df){logger['info'](util['format'](_0xe74f('0x74'),_0xd53254,_0x3d51df[_0xe74f('0x75')]['TranscriptionJobName']));_0x81e45c['transcribeName']=_0x3d51df[_0xe74f('0x75')]['TranscriptionJobName'];_0x81e45c[_0xe74f('0x76')]=_0x3d51df['TranscriptionJob']['TranscriptionJobStatus'];return _0x160564(_0x81e45c);})['catch'](function(_0x33d0b0){return _0x211093(_0x33d0b0);});});}exports[_0xe74f('0x77')]=function(_0x12e392,_0x150d1d,_0x119d3c){var _0x56c37a;var _0x20a19d;var _0x34cce4;var _0xe3d800=require('../../components/encryptor');return db[_0xe74f('0x2b')][_0xe74f('0x78')]({'where':{'id':_0x12e392['params']['id']}})[_0xe74f('0x27')](function(_0x36a7f6){if(_0x36a7f6){var _0x100e63=util[_0xe74f('0x32')](_0xe74f('0x4e'),_0x36a7f6['value']);if(fs[_0xe74f('0x4f')](_0x100e63)){cypher=!![];return _0xe3d800[_0xe74f('0x79')](_0x100e63,_0x36a7f6[_0xe74f('0x4d')],config[_0xe74f('0x50')][_0xe74f('0x60')])[_0xe74f('0x27')](function(){return _0x36a7f6;});}return _0x36a7f6;}})[_0xe74f('0x27')](function(_0x1bfe84){if(!_0x1bfe84){throw new db[(_0xe74f('0x51'))][(_0xe74f('0x61'))](_0xe74f('0x7a'));}_0x20a19d=_0x1bfe84;return db[_0xe74f('0x7b')][_0xe74f('0x78')]({'where':{'id':0x1}});})['then'](handleEntityNotFound(_0x150d1d,null))[_0xe74f('0x27')](function(_0x14aaf2){if(_0x14aaf2){_0x56c37a=_0x14aaf2;if(!_0x56c37a[_0xe74f('0x7c')]||!_0x56c37a[_0xe74f('0x7d')]||!_0x56c37a[_0xe74f('0x7e')]||!_0x56c37a[_0xe74f('0x7f')]||!_0x56c37a[_0xe74f('0x70')]){throw new db[(_0xe74f('0x51'))]['ValidationError']('Transcribe\x20not\x20configured');}if(_0x12e392[_0xe74f('0x4a')][_0xe74f('0x80')]&&(!_0x56c37a[_0xe74f('0x81')]||!_0x56c37a['sentimentAccountId']||!_0x56c37a['sentimentRegion']||!_0x56c37a[_0xe74f('0x7f')]||!_0x56c37a[_0xe74f('0x70')])){throw new db[(_0xe74f('0x51'))][(_0xe74f('0x61'))]('Sentiment\x20Analysis\x20not\x20configured');}return db[_0xe74f('0x82')]['findOne']({'where':{'id':_0x56c37a[_0xe74f('0x7d')]}});}})['then'](function(_0x138d9d){if(!_0x138d9d){throw new db['Sequelize'][(_0xe74f('0x61'))](_0xe74f('0x83'));}if(!_0x138d9d['data1']||!_0x138d9d[_0xe74f('0x84')]){throw new db[(_0xe74f('0x51'))][(_0xe74f('0x61'))]('Cloud\x20Provider\x20not\x20configured');}_0x34cce4=_0x138d9d;return getBucketslist(_0x34cce4['data1'],_0x34cce4[_0xe74f('0x84')],_0x56c37a[_0xe74f('0x7e')]);})[_0xe74f('0x27')](function(_0x187621){if(_0x187621&&_0x187621[_0xe74f('0x85')]){var _0x24def3=_[_0xe74f('0x47')](_0x187621[_0xe74f('0x85')],function(_0x200e8b){return _0x200e8b[_0xe74f('0x86')]===_0x56c37a[_0xe74f('0x70')];});if(!_0x24def3){logger[_0xe74f('0x63')](util[_0xe74f('0x32')](_0xe74f('0x87'),_0x12e392['params']['id'],_0x56c37a['bucket']));return createBucket(_0x34cce4[_0xe74f('0x88')],_0x34cce4[_0xe74f('0x84')],_0x56c37a[_0xe74f('0x7e')],_0x56c37a['bucket']);}logger['info'](util[_0xe74f('0x32')]('[RUNTRANSCRIPT][%d]\x20Bucket\x20%s\x20available',_0x12e392['params']['id'],_0x56c37a[_0xe74f('0x70')]));return;}})[_0xe74f('0x27')](function(_0xd151d9){if(_0x20a19d[_0xe74f('0x76')]===_0xe74f('0x89')){return transcribe(_0x12e392[_0xe74f('0x45')]['id'],_0x34cce4[_0xe74f('0x88')],_0x34cce4['data2'],_0x56c37a['transcribeRegion'],_0x56c37a[_0xe74f('0x70')],_0x20a19d[_0xe74f('0x4d')],_0x56c37a[_0xe74f('0x7f')]);}else{logger[_0xe74f('0x63')](util['format'](_0xe74f('0x8a'),_0x12e392[_0xe74f('0x45')]['id']));return{'transcribeStatus':'IN_PROGRESS'};}})[_0xe74f('0x27')](function(_0x38aff5){if(_0x38aff5){_0x38aff5['tempSentiment']=_0x12e392[_0xe74f('0x4a')][_0xe74f('0x80')];return _0x20a19d[_0xe74f('0x8b')](_0x38aff5);}})[_0xe74f('0x27')](respondWithResult(_0x150d1d,null))[_0xe74f('0x48')](handleError(_0x150d1d,null));};function writeFile(_0x5bf331,_0x545ba6){return new Promise(function(_0xdb42c2,_0x4a7a99){fs['writeFile'](_0x545ba6,_0x5bf331,function(_0x107efc,_0xf3101f){if(_0x107efc){return _0x4a7a99(_0x107efc);}else{return _0xdb42c2(_0xf3101f);}});});}exports[_0xe74f('0x8c')]=function(_0x279bf4,_0x573f14,_0x3dab62){return db['VoiceRecording'][_0xe74f('0x78')]({'where':{'id':_0x279bf4['params']['id']}})[_0xe74f('0x27')](handleEntityNotFound(_0x573f14))['then'](function(_0x4badab){if(_0x4badab&&_0x4badab[_0xe74f('0x8d')]){var _0x592bea=_0x4badab['fileText'];var _0x2e0e31=config['root']+_0xe74f('0x8e')+_0x4badab['id']+_0xe74f('0x8f');if(fs[_0xe74f('0x4f')](_0x2e0e31)){return _0x2e0e31;}return writeFile(_0x592bea,_0x2e0e31)[_0xe74f('0x27')](function(){return _0x2e0e31;});}else{throw new db[(_0xe74f('0x51'))][(_0xe74f('0x61'))](_0xe74f('0x90'));}})[_0xe74f('0x27')](function(_0x70d550){return _0x573f14[_0xe74f('0x53')](_0x70d550);})[_0xe74f('0x48')](handleError(_0x573f14));}; \ No newline at end of file +var _0xb541=['../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','end','status','offset','undefined','limit','set','Content-Range','json','apply','reject','save','update','destroy','error','stack','name','index','rawAttributes','fieldName','type','key','model','differenceBy','map','query','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','filter','where','merge','options','VoiceRecording','includeAll','include','findAll','then','rows','catch','show','params','keys','find','create','body','describe','download','../../components/encryptor','uniqueid','value','format','%s.cypher','existsSync','decryptFile','recording','Sequelize','ValidationError','VoiceRecording\x20not\x20found','filename','unlink','message','send','Not\x20found','downloads','sequelize','MD5','col','token','$and','isNil','Entity\x20not\x20found','info','File:\x20\x22','\x22\x20trovato\x20eseguo\x20la\x20cancellazione','.cypher','unlinkSync','createBucket','TranscribeService','startTranscriptionJob','[RUNTRANSCRIPT][%d]\x20Starting\x20voice\x20recording\x20upload\x20in\x20bucket\x20%s','readFileSync','[RUNTRANSCRIPT][%d]\x20Voice\x20recording\x20uploaded\x20in\x20bucket\x20%s\x20(%s)','Location','bucket','Bucket','[RUNTRANSCRIPT][%d]\x20Sending\x20transcribe\x20request','[RUNTRANSCRIPT][%d]\x20Transcription\x20job\x20%s\x20created','TranscriptionJobName','TranscriptionJob','transcribeStatus','TranscriptionJobStatus','runTranscribe','secrets','findOne','transcribe','transcribeAccountId','transcribeRegion','language','Transcribe\x20not\x20configured','runSentiment','sentimentAccountId','Sentiment\x20Analysis\x20not\x20configured','Cloud\x20Provider\x20not\x20available','Cloud\x20Provider\x20not\x20configured','data1','data2','Buckets','Name','[RUNTRANSCRIPT][%d]\x20Bucket\x20%s\x20not\x20available','[RUNTRANSCRIPT][%d]\x20Bucket\x20%s\x20available','[RUNTRANSCRIPT][%d]\x20Transcript\x20action\x20already\x20requested','updateAttributes','writeFile','fileText','root','/server/files/transcribes/transcribe_','Transcript\x20not\x20available','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','path','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','aws-sdk','../../components/auth/service'];(function(_0x1909c7,_0x1f55b6){var _0x409d37=function(_0xa95394){while(--_0xa95394){_0x1909c7['push'](_0x1909c7['shift']());}};_0x409d37(++_0x1f55b6);}(_0xb541,0x1b5));var _0x1b54=function(_0x17fa13,_0x591497){_0x17fa13=_0x17fa13-0x0;var _0x249803=_0xb541[_0x17fa13];return _0x249803;};'use strict';var emlformat=require(_0x1b54('0x0'));var rimraf=require(_0x1b54('0x1'));var zipdir=require(_0x1b54('0x2'));var jsonpatch=require(_0x1b54('0x3'));var rp=require(_0x1b54('0x4'));var moment=require(_0x1b54('0x5'));var BPromise=require(_0x1b54('0x6'));var Mustache=require('mustache');var util=require('util');var path=require(_0x1b54('0x7'));var sox=require('sox');var csv=require(_0x1b54('0x8'));var ejs=require(_0x1b54('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x1b54('0xa'));var squel=require(_0x1b54('0xb'));var crypto=require(_0x1b54('0xc'));var jsforce=require(_0x1b54('0xd'));var deskjs=require(_0x1b54('0xe'));var toCsv=require('to-csv');var querystring=require(_0x1b54('0xf'));var Papa=require(_0x1b54('0x10'));var AWS=require(_0x1b54('0x11'));var uuidv4=require('uuid/v4');var Redis=require('ioredis');var authService=require(_0x1b54('0x12'));var qs=require(_0x1b54('0x13'));var as=require(_0x1b54('0x14'));var hardwareService=require(_0x1b54('0x15'));var logger=require(_0x1b54('0x16'))(_0x1b54('0x17'));var utils=require(_0x1b54('0x18'));var config=require(_0x1b54('0x19'));var licenseUtil=require(_0x1b54('0x1a'));var db=require(_0x1b54('0x1b'))['db'];function respondWithStatusCode(_0x43f904,_0x721937){_0x721937=_0x721937||0xcc;return function(_0x22c76b){if(_0x22c76b){return _0x43f904[_0x1b54('0x1c')](_0x721937);}return _0x43f904['status'](_0x721937)[_0x1b54('0x1d')]();};}function respondWithResult(_0x417f63,_0x1b8dc8){_0x1b8dc8=_0x1b8dc8||0xc8;return function(_0x42ca6c){if(_0x42ca6c){return _0x417f63[_0x1b54('0x1e')](_0x1b8dc8)['json'](_0x42ca6c);}};}function respondWithFilteredResult(_0x3e3bcc,_0xd37251){return function(_0x4d4c69){if(_0x4d4c69){var _0x5d9eea=typeof _0xd37251[_0x1b54('0x1f')]===_0x1b54('0x20')&&typeof _0xd37251[_0x1b54('0x21')]===_0x1b54('0x20');var _0x53b562=_0x4d4c69['count'];var _0x5b1473=_0x5d9eea?0x0:_0xd37251[_0x1b54('0x1f')];var _0x15857d=_0x5d9eea?_0x4d4c69['count']:_0xd37251['offset']+_0xd37251[_0x1b54('0x21')];var _0x7336d5;if(_0x15857d>=_0x53b562){_0x15857d=_0x53b562;_0x7336d5=0xc8;}else{_0x7336d5=0xce;}_0x3e3bcc[_0x1b54('0x1e')](_0x7336d5);return _0x3e3bcc[_0x1b54('0x22')](_0x1b54('0x23'),_0x5b1473+'-'+_0x15857d+'/'+_0x53b562)[_0x1b54('0x24')](_0x4d4c69);}return null;};}function patchUpdates(_0x285e07){return function(_0x1c0081){try{jsonpatch[_0x1b54('0x25')](_0x1c0081,_0x285e07,!![]);}catch(_0x328690){return BPromise[_0x1b54('0x26')](_0x328690);}return _0x1c0081[_0x1b54('0x27')]();};}function saveUpdates(_0x39a8a9,_0x2f4db2){return function(_0x579558){if(_0x579558){return _0x579558[_0x1b54('0x28')](_0x39a8a9)['then'](function(_0xeef120){return _0xeef120;});}return null;};}function removeEntity(_0x286c7e,_0x4a3eb1){return function(_0x4b5123){if(_0x4b5123){return _0x4b5123[_0x1b54('0x29')]()['then'](function(){_0x286c7e['status'](0xcc)[_0x1b54('0x1d')]();});}};}function handleEntityNotFound(_0x225d59,_0x2a4c40){return function(_0x3ae907){if(!_0x3ae907){_0x225d59[_0x1b54('0x1c')](0x194);}return _0x3ae907;};}function handleError(_0x3ba785,_0x8132a3){_0x8132a3=_0x8132a3||0x1f4;return function(_0x5bb935){logger[_0x1b54('0x2a')](_0x5bb935[_0x1b54('0x2b')]);if(_0x5bb935[_0x1b54('0x2c')]){delete _0x5bb935['name'];}_0x3ba785[_0x1b54('0x1e')](_0x8132a3)['send'](_0x5bb935);};}exports[_0x1b54('0x2d')]=function(_0x285937,_0x2acb14){var _0x4aac75={},_0x38784c={},_0x513039={'count':0x0,'rows':[]};var _0x32d0be=_['map'](db['VoiceRecording'][_0x1b54('0x2e')],function(_0x33c699){return{'name':_0x33c699[_0x1b54('0x2f')],'type':_0x33c699[_0x1b54('0x30')][_0x1b54('0x31')]};});_0x38784c[_0x1b54('0x32')]=_[_0x1b54('0x33')](_[_0x1b54('0x34')](_0x32d0be,_0x1b54('0x2c')),['format']);_0x38784c['query']=_['keys'](_0x285937[_0x1b54('0x35')]);_0x38784c[_0x1b54('0x36')]=_['intersection'](_0x38784c[_0x1b54('0x32')],_0x38784c[_0x1b54('0x35')]);_0x4aac75['attributes']=_[_0x1b54('0x37')](_0x38784c['model'],qs[_0x1b54('0x38')](_0x285937[_0x1b54('0x35')][_0x1b54('0x38')]));_0x4aac75[_0x1b54('0x39')]=_0x4aac75['attributes'][_0x1b54('0x3a')]?_0x4aac75[_0x1b54('0x39')]:_0x38784c[_0x1b54('0x32')];if(!_0x285937[_0x1b54('0x35')][_0x1b54('0x3b')](_0x1b54('0x3c'))){_0x4aac75[_0x1b54('0x21')]=qs[_0x1b54('0x21')](_0x285937[_0x1b54('0x35')]['limit']);_0x4aac75[_0x1b54('0x1f')]=qs['offset'](_0x285937[_0x1b54('0x35')]['offset']);}_0x4aac75[_0x1b54('0x3d')]=qs[_0x1b54('0x3e')](_0x285937[_0x1b54('0x35')][_0x1b54('0x3e')]);_0x4aac75['where']=qs[_0x1b54('0x36')](_['pick'](_0x285937['query'],_0x38784c[_0x1b54('0x36')]),_0x32d0be);if(_0x285937['query'][_0x1b54('0x3f')]){_0x4aac75[_0x1b54('0x40')]=_['merge'](_0x4aac75[_0x1b54('0x40')],{'$or':_['map'](_0x32d0be,function(_0x4c9980){if(_0x4c9980['type']!=='VIRTUAL'){var _0x5b87a4={};_0x5b87a4[_0x4c9980[_0x1b54('0x2c')]]={'$like':'%'+_0x285937[_0x1b54('0x35')][_0x1b54('0x3f')]+'%'};return _0x5b87a4;}})});}_0x4aac75=_[_0x1b54('0x41')]({},_0x4aac75,_0x285937[_0x1b54('0x42')]);var _0x4abba0={'where':_0x4aac75[_0x1b54('0x40')]};return db[_0x1b54('0x43')]['count'](_0x4abba0)['then'](function(_0x3604d3){_0x513039['count']=_0x3604d3;if(_0x285937['query'][_0x1b54('0x44')]){_0x4aac75[_0x1b54('0x45')]=[{'all':!![]}];}return db[_0x1b54('0x43')][_0x1b54('0x46')](_0x4aac75);})[_0x1b54('0x47')](function(_0x3b6560){_0x513039[_0x1b54('0x48')]=_0x3b6560;return _0x513039;})[_0x1b54('0x47')](respondWithFilteredResult(_0x2acb14,_0x4aac75))[_0x1b54('0x49')](handleError(_0x2acb14,null));};exports[_0x1b54('0x4a')]=function(_0x269219,_0x5aaa6d){var _0x4782ad={'raw':![],'where':{'id':_0x269219[_0x1b54('0x4b')]['id']}},_0x22f765={};_0x22f765[_0x1b54('0x32')]=_[_0x1b54('0x4c')](db[_0x1b54('0x43')]['rawAttributes']);_0x22f765[_0x1b54('0x35')]=_[_0x1b54('0x4c')](_0x269219[_0x1b54('0x35')]);_0x22f765[_0x1b54('0x36')]=_[_0x1b54('0x37')](_0x22f765[_0x1b54('0x32')],_0x22f765[_0x1b54('0x35')]);_0x4782ad[_0x1b54('0x39')]=_[_0x1b54('0x37')](_0x22f765[_0x1b54('0x32')],qs['fields'](_0x269219[_0x1b54('0x35')][_0x1b54('0x38')]));_0x4782ad[_0x1b54('0x39')]=_0x4782ad[_0x1b54('0x39')][_0x1b54('0x3a')]?_0x4782ad[_0x1b54('0x39')]:_0x22f765[_0x1b54('0x32')];if(_0x269219[_0x1b54('0x35')][_0x1b54('0x44')]){_0x4782ad['include']=[{'all':!![]}];}_0x4782ad=_[_0x1b54('0x41')]({},_0x4782ad,_0x269219[_0x1b54('0x42')]);return db[_0x1b54('0x43')][_0x1b54('0x4d')](_0x4782ad)[_0x1b54('0x47')](handleEntityNotFound(_0x5aaa6d,null))['then'](respondWithResult(_0x5aaa6d,null))[_0x1b54('0x49')](handleError(_0x5aaa6d,null));};exports[_0x1b54('0x4e')]=function(_0x148e4d,_0x5a580c){return db['VoiceRecording'][_0x1b54('0x4e')](_0x148e4d['body'],{})[_0x1b54('0x47')](respondWithResult(_0x5a580c,0xc9))[_0x1b54('0x49')](handleError(_0x5a580c,null));};exports[_0x1b54('0x28')]=function(_0x31bdca,_0x399a80){if(_0x31bdca['body']['id']){delete _0x31bdca[_0x1b54('0x4f')]['id'];}return db['VoiceRecording'][_0x1b54('0x4d')]({'where':{'id':_0x31bdca[_0x1b54('0x4b')]['id']}})[_0x1b54('0x47')](handleEntityNotFound(_0x399a80,null))[_0x1b54('0x47')](saveUpdates(_0x31bdca[_0x1b54('0x4f')],null))[_0x1b54('0x47')](respondWithResult(_0x399a80,null))[_0x1b54('0x49')](handleError(_0x399a80,null));};exports['describe']=function(_0x4f9454,_0x232b9b){return db[_0x1b54('0x43')][_0x1b54('0x50')]()[_0x1b54('0x47')](respondWithResult(_0x232b9b,null))[_0x1b54('0x49')](handleError(_0x232b9b,null));};exports[_0x1b54('0x51')]=function(_0x214c07,_0x4e423c,_0x158966){var _0x492112=require(_0x1b54('0x52'));var _0xaad392=![];var _0x1eeed4={};if(_0x214c07[_0x1b54('0x35')][_0x1b54('0x30')]&&_0x214c07['query']['type']===_0x1b54('0x53')){_0x1eeed4[_0x1b54('0x53')]=_0x214c07[_0x1b54('0x4b')]['id'];}else{_0x1eeed4['id']=_0x214c07[_0x1b54('0x4b')]['id'];}return db[_0x1b54('0x43')][_0x1b54('0x4d')]({'where':_0x1eeed4,'attributes':['id',_0x1b54('0x54')],'raw':!![]})['then'](handleEntityNotFound(_0x4e423c,null))['then'](function(_0x255340){if(_0x255340){var _0x477e9a=_0x255340[_0x1b54('0x54')];var _0x325758=util[_0x1b54('0x55')](_0x1b54('0x56'),_0x477e9a);if(fs[_0x1b54('0x57')](_0x325758)){_0xaad392=!![];return _0x492112[_0x1b54('0x58')](_0x325758,_0x477e9a,config['secrets'][_0x1b54('0x59')])[_0x1b54('0x47')](function(){return _0x255340;});}return _0x255340;}})[_0x1b54('0x47')](function(_0x4ed428){if(_0x4ed428){var _0x2faafa=_0x4ed428[_0x1b54('0x54')];if(!fs[_0x1b54('0x57')](_0x2faafa)){throw new db[(_0x1b54('0x5a'))][(_0x1b54('0x5b'))](_0x1b54('0x5c'));}if(_0x4ed428[_0x1b54('0x5d')]){return _0x4e423c[_0x1b54('0x51')](_0x2faafa,_0x4ed428[_0x1b54('0x5d')]+path['extname'](_0x2faafa),function(){if(_0xaad392){fs[_0x1b54('0x5e')](_0x2faafa);}});}else{return _0x4e423c[_0x1b54('0x51')](_0x2faafa,function(_0x51366b){if(_0xaad392){fs[_0x1b54('0x5e')](_0x2faafa);}});}}})['catch'](function(_0x5a38d0){if(_0x5a38d0[_0x1b54('0x5f')]===_0x1b54('0x5c')){_0x4e423c[_0x1b54('0x1e')](0x194)[_0x1b54('0x60')](_0x1b54('0x61'));}else{return handleError(_0x4e423c,null);}});};exports[_0x1b54('0x62')]=function(_0x27652e,_0x3f660c,_0x2538c8){var _0x2fb078=require(_0x1b54('0x52'));var _0x480bfc=![];var _0x414efe={'$and':[db[_0x1b54('0x63')]['where'](db['sequelize']['fn'](_0x1b54('0x64'),db['sequelize'][_0x1b54('0x65')](_0x1b54('0x53'))),_0x27652e[_0x1b54('0x35')][_0x1b54('0x66')])]};if(_0x27652e[_0x1b54('0x35')][_0x1b54('0x30')]&&_0x27652e[_0x1b54('0x35')][_0x1b54('0x30')]===_0x1b54('0x53')){_0x414efe[_0x1b54('0x67')]['push']({'uniqueid':_0x27652e[_0x1b54('0x4b')]['id']});}else{_0x414efe['$and']['push']({'id':_0x27652e['params']['id']});}return db['VoiceRecording'][_0x1b54('0x4d')]({'where':_0x414efe,'attributes':['id',_0x1b54('0x54')],'raw':!![]})['then'](handleEntityNotFound(_0x3f660c,null))[_0x1b54('0x47')](function(_0x3e9188){if(_0x3e9188){var _0x2eec86=util[_0x1b54('0x55')](_0x1b54('0x56'),_0x3e9188[_0x1b54('0x54')]);if(fs[_0x1b54('0x57')](_0x2eec86)){_0x480bfc=!![];return _0x2fb078[_0x1b54('0x58')](_0x2eec86,_0x3e9188[_0x1b54('0x54')],config['secrets']['recording'])[_0x1b54('0x47')](function(){return _0x3e9188;});}return _0x3e9188;}})['then'](function(_0x4355ab){if(_0x4355ab){if(!fs['existsSync'](_0x4355ab[_0x1b54('0x54')])){throw new db[(_0x1b54('0x5a'))][(_0x1b54('0x5b'))]('VoiceRecording\x20not\x20found');}if(_0x4355ab['filename']){return _0x3f660c[_0x1b54('0x51')](_0x4355ab[_0x1b54('0x54')],_0x4355ab[_0x1b54('0x5d')]+path['extname'](_0x4355ab[_0x1b54('0x54')]),function(){if(_0x480bfc){fs[_0x1b54('0x5e')](_0x4355ab[_0x1b54('0x54')]);}});}else{return _0x3f660c['download'](_0x4355ab[_0x1b54('0x54')],function(_0x33b4fd){if(_0x480bfc){fs[_0x1b54('0x5e')](_0x4355ab['value']);}});}}})[_0x1b54('0x49')](handleError(_0x3f660c,null));};exports[_0x1b54('0x29')]=function(_0xe6b8fe,_0x3943ed){return db['VoiceRecording']['find']({'where':{'id':_0xe6b8fe[_0x1b54('0x4b')]['id']}})[_0x1b54('0x47')](function(_0x53ff48){if(_[_0x1b54('0x68')](_0x53ff48)){throw new ReferenceError(_0x1b54('0x69'));}return _0x53ff48;})[_0x1b54('0x47')](function(_0x405733){var _0x414136=_0x405733[_0x1b54('0x54')];logger[_0x1b54('0x6a')]('cancellazione\x20fisica\x20documento\x20%s',_0x414136);if(!_[_0x1b54('0x68')](_0x405733['value'])&&fs['existsSync'](_0x414136)){logger['info'](_0x1b54('0x6b')+_0x414136+_0x1b54('0x6c'));fs['unlinkSync'](_0x414136);}_0x414136=_0x414136+_0x1b54('0x6d');if(!_[_0x1b54('0x68')](_0x405733[_0x1b54('0x54')])&&fs[_0x1b54('0x57')](_0x414136)){logger[_0x1b54('0x6a')](_0x1b54('0x6b')+_0x414136+_0x1b54('0x6c'));fs[_0x1b54('0x6e')](_0x414136);}return _0x405733;})[_0x1b54('0x47')](function(_0x483753){if(!_0x483753)throw new InternalError();return _0x483753[_0x1b54('0x29')]();})[_0x1b54('0x47')](function(){_0x3943ed['status'](0xcc)[_0x1b54('0x1d')]();})[_0x1b54('0x49')](handleError(_0x3943ed,null));};function getBucketslist(_0x584acc,_0x15fb93,_0x149755){return new Promise(function(_0x1885d2,_0x5f4bed){var _0x5436ed=new AWS['S3']({'accessKeyId':_0x15fb93,'secretAccessKey':_0x584acc,'region':_0x149755});_0x5436ed['listBuckets']({},function(_0x588922,_0x88601f){if(_0x588922){return _0x5f4bed(_0x588922);}else{return _0x1885d2(_0x88601f);}});});}function createBucket(_0x93fded,_0x39823a,_0x5780b2,_0x2667d1){return new Promise(function(_0x394497,_0x4acfe7){var _0xdbd563=new AWS['S3']({'accessKeyId':_0x39823a,'secretAccessKey':_0x93fded,'region':_0x5780b2});_0xdbd563[_0x1b54('0x6f')]({'Bucket':_0x2667d1},function(_0x13d223,_0x17b4a2){if(_0x13d223){return _0x4acfe7(_0x13d223);}else{return _0x394497(_0x17b4a2);}});});}function uploadFile(_0x260add,_0x45d17f,_0x6baf3,_0x4aa558,_0x4e069d,_0x58010c){return new Promise(function(_0x377734,_0x59a5de){var _0x1692ed=new AWS['S3']({'accessKeyId':_0x45d17f,'secretAccessKey':_0x260add,'region':_0x6baf3});_0x1692ed['upload']({'Bucket':_0x4aa558,'Key':_0x4e069d,'Body':_0x58010c},function(_0x20d450,_0x5427d3){if(_0x20d450){return _0x59a5de(_0x20d450);}else{return _0x377734(_0x5427d3);}});});}function startTranscribe(_0x1db9f0,_0x3e612c,_0x26c9da,_0x36dc19,_0x1bb3f3,_0x5dfd1f){return new Promise(function(_0x313675,_0x515a6b){var _0x497f64=new AWS[(_0x1b54('0x70'))]({'accessKeyId':_0x3e612c,'secretAccessKey':_0x1db9f0,'region':_0x26c9da});_0x497f64[_0x1b54('0x71')]({'TranscriptionJobName':_0x36dc19,'LanguageCode':_0x1bb3f3,'Media':{'MediaFileUri':_0x5dfd1f}},function(_0x59ec56,_0x4f4303){if(_0x59ec56){return _0x515a6b(_0x59ec56);}else{return _0x313675(_0x4f4303);}});});}function transcribe(_0x48196c,_0x18c350,_0x3ee701,_0x3326ed,_0x3348c9,_0x2d8a96,_0x33e2f4){return new Promise(function(_0x29dc10,_0x16ea2c){var _0x1626ed={};logger[_0x1b54('0x6a')](util[_0x1b54('0x55')](_0x1b54('0x72'),_0x48196c,_0x3348c9));return uploadFile(_0x18c350,_0x3ee701,_0x3326ed,_0x3348c9,path['basename'](_0x2d8a96),fs[_0x1b54('0x73')](_0x2d8a96))[_0x1b54('0x47')](function(_0x36f670){logger[_0x1b54('0x6a')](util[_0x1b54('0x55')](_0x1b54('0x74'),_0x48196c,_0x3348c9,_0x36f670[_0x1b54('0x75')]));_0x1626ed[_0x1b54('0x76')]=_0x36f670[_0x1b54('0x77')];_0x1626ed['location']=_0x36f670[_0x1b54('0x75')];logger[_0x1b54('0x6a')](util[_0x1b54('0x55')](_0x1b54('0x78'),_0x48196c));return startTranscribe(_0x18c350,_0x3ee701,_0x3326ed,uuidv4(),_0x33e2f4,_0x36f670[_0x1b54('0x75')]);})[_0x1b54('0x47')](function(_0x214b2a){logger[_0x1b54('0x6a')](util[_0x1b54('0x55')](_0x1b54('0x79'),_0x48196c,_0x214b2a['TranscriptionJob'][_0x1b54('0x7a')]));_0x1626ed['transcribeName']=_0x214b2a[_0x1b54('0x7b')][_0x1b54('0x7a')];_0x1626ed[_0x1b54('0x7c')]=_0x214b2a[_0x1b54('0x7b')][_0x1b54('0x7d')];return _0x29dc10(_0x1626ed);})['catch'](function(_0x2c61be){return _0x16ea2c(_0x2c61be);});});}exports[_0x1b54('0x7e')]=function(_0x130f51,_0x33c4a7,_0x1eab8d){var _0x95a666;var _0x7b3f9c;var _0x459fcd;var _0x5c32e2=require(_0x1b54('0x52'));return db['VoiceRecording']['findOne']({'where':{'id':_0x130f51[_0x1b54('0x4b')]['id']}})['then'](function(_0xb25690){if(_0xb25690){var _0x1ed367=util[_0x1b54('0x55')]('%s.cypher',_0xb25690['value']);if(fs[_0x1b54('0x57')](_0x1ed367)){cypher=!![];return _0x5c32e2['decryptFile'](_0x1ed367,_0xb25690[_0x1b54('0x54')],config[_0x1b54('0x7f')][_0x1b54('0x59')])[_0x1b54('0x47')](function(){return _0xb25690;});}return _0xb25690;}})[_0x1b54('0x47')](function(_0x4f2e8c){if(!_0x4f2e8c){throw new db[(_0x1b54('0x5a'))]['ValidationError']('Voice\x20Recording\x20not\x20found');}_0x7b3f9c=_0x4f2e8c;return db['Setting'][_0x1b54('0x80')]({'where':{'id':0x1}});})[_0x1b54('0x47')](handleEntityNotFound(_0x33c4a7,null))[_0x1b54('0x47')](function(_0x44e8da){if(_0x44e8da){_0x95a666=_0x44e8da;if(!_0x95a666[_0x1b54('0x81')]||!_0x95a666[_0x1b54('0x82')]||!_0x95a666[_0x1b54('0x83')]||!_0x95a666[_0x1b54('0x84')]||!_0x95a666[_0x1b54('0x76')]){throw new db[(_0x1b54('0x5a'))]['ValidationError'](_0x1b54('0x85'));}if(_0x130f51[_0x1b54('0x4f')][_0x1b54('0x86')]&&(!_0x95a666['sentiment']||!_0x95a666[_0x1b54('0x87')]||!_0x95a666['sentimentRegion']||!_0x95a666[_0x1b54('0x84')]||!_0x95a666[_0x1b54('0x76')])){throw new db[(_0x1b54('0x5a'))][(_0x1b54('0x5b'))](_0x1b54('0x88'));}return db['CloudProvider'][_0x1b54('0x80')]({'where':{'id':_0x95a666[_0x1b54('0x82')]}});}})[_0x1b54('0x47')](function(_0x895b44){if(!_0x895b44){throw new db[(_0x1b54('0x5a'))][(_0x1b54('0x5b'))](_0x1b54('0x89'));}if(!_0x895b44['data1']||!_0x895b44['data2']){throw new db[(_0x1b54('0x5a'))][(_0x1b54('0x5b'))](_0x1b54('0x8a'));}_0x459fcd=_0x895b44;return getBucketslist(_0x459fcd[_0x1b54('0x8b')],_0x459fcd[_0x1b54('0x8c')],_0x95a666[_0x1b54('0x83')]);})[_0x1b54('0x47')](function(_0x2e1e27){if(_0x2e1e27&&_0x2e1e27[_0x1b54('0x8d')]){var _0x46a5c5=_[_0x1b54('0x4d')](_0x2e1e27[_0x1b54('0x8d')],function(_0x35adb5){return _0x35adb5[_0x1b54('0x8e')]===_0x95a666[_0x1b54('0x76')];});if(!_0x46a5c5){logger['info'](util[_0x1b54('0x55')](_0x1b54('0x8f'),_0x130f51[_0x1b54('0x4b')]['id'],_0x95a666[_0x1b54('0x76')]));return createBucket(_0x459fcd['data1'],_0x459fcd[_0x1b54('0x8c')],_0x95a666[_0x1b54('0x83')],_0x95a666[_0x1b54('0x76')]);}logger[_0x1b54('0x6a')](util[_0x1b54('0x55')](_0x1b54('0x90'),_0x130f51[_0x1b54('0x4b')]['id'],_0x95a666[_0x1b54('0x76')]));return;}})[_0x1b54('0x47')](function(_0x16f5f5){if(_0x7b3f9c[_0x1b54('0x7c')]==='NEW'){return transcribe(_0x130f51[_0x1b54('0x4b')]['id'],_0x459fcd[_0x1b54('0x8b')],_0x459fcd[_0x1b54('0x8c')],_0x95a666['transcribeRegion'],_0x95a666['bucket'],_0x7b3f9c[_0x1b54('0x54')],_0x95a666['language']);}else{logger[_0x1b54('0x6a')](util[_0x1b54('0x55')](_0x1b54('0x91'),_0x130f51['params']['id']));return{'transcribeStatus':'IN_PROGRESS'};}})['then'](function(_0x17e499){if(_0x17e499){_0x17e499['tempSentiment']=_0x130f51[_0x1b54('0x4f')][_0x1b54('0x86')];return _0x7b3f9c[_0x1b54('0x92')](_0x17e499);}})['then'](respondWithResult(_0x33c4a7,null))[_0x1b54('0x49')](handleError(_0x33c4a7,null));};function writeFile(_0x4e89dd,_0x201ba7){return new Promise(function(_0x58c392,_0x4ffc71){fs[_0x1b54('0x93')](_0x201ba7,_0x4e89dd,function(_0x5218c6,_0x2e3679){if(_0x5218c6){return _0x4ffc71(_0x5218c6);}else{return _0x58c392(_0x2e3679);}});});}exports['downloadTranscribe']=function(_0x52ed24,_0x20925e,_0x2360b5){return db[_0x1b54('0x43')][_0x1b54('0x80')]({'where':{'id':_0x52ed24[_0x1b54('0x4b')]['id']}})[_0x1b54('0x47')](handleEntityNotFound(_0x20925e))[_0x1b54('0x47')](function(_0x5de9ce){if(_0x5de9ce&&_0x5de9ce[_0x1b54('0x94')]){var _0xc19b88=_0x5de9ce['fileText'];var _0x534ed1=config[_0x1b54('0x95')]+_0x1b54('0x96')+_0x5de9ce['id']+'.txt';if(fs['existsSync'](_0x534ed1)){return _0x534ed1;}return writeFile(_0xc19b88,_0x534ed1)[_0x1b54('0x47')](function(){return _0x534ed1;});}else{throw new db[(_0x1b54('0x5a'))]['ValidationError'](_0x1b54('0x97'));}})[_0x1b54('0x47')](function(_0x1211c6){return _0x20925e[_0x1b54('0x51')](_0x1211c6);})[_0x1b54('0x49')](handleError(_0x20925e));}; \ No newline at end of file diff --git a/server/api/voiceRecording/voiceRecording.model.js b/server/api/voiceRecording/voiceRecording.model.js index 6c9aa22..4cc92c7 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 _0x9e9b=['voice_recordings','uniqueid','transcribeStatus','./voiceRecording.attributes','define','VoiceRecording'];(function(_0x3128f7,_0x5ec08a){var _0x5ce976=function(_0x463e28){while(--_0x463e28){_0x3128f7['push'](_0x3128f7['shift']());}};_0x5ce976(++_0x5ec08a);}(_0x9e9b,0x1a7));var _0xb9e9=function(_0xa4928c,_0x16b89c){_0xa4928c=_0xa4928c-0x0;var _0x27cc29=_0x9e9b[_0xa4928c];return _0x27cc29;};'use strict';var attributes=require(_0xb9e9('0x0'));module['exports']=function(_0x5af29a,_0x39a0db){return _0x5af29a[_0xb9e9('0x1')](_0xb9e9('0x2'),attributes,{'tableName':_0xb9e9('0x3'),'paranoid':![],'indexes':[{'name':'uniqueid','fields':[_0xb9e9('0x4')]},{'name':_0xb9e9('0x5'),'fields':['transcribeStatus']}],'timestamps':!![]});}; \ No newline at end of file +var _0xf185=['uniqueid','transcribeStatus','./voiceRecording.attributes','define','VoiceRecording','voice_recordings'];(function(_0x501510,_0x61caa9){var _0x1e6ee5=function(_0x32845b){while(--_0x32845b){_0x501510['push'](_0x501510['shift']());}};_0x1e6ee5(++_0x61caa9);}(_0xf185,0x1be));var _0x5f18=function(_0x2917f0,_0x1cd7fb){_0x2917f0=_0x2917f0-0x0;var _0x41602e=_0xf185[_0x2917f0];return _0x41602e;};'use strict';var attributes=require(_0x5f18('0x0'));module['exports']=function(_0x504298,_0x34335b){return _0x504298[_0x5f18('0x1')](_0x5f18('0x2'),attributes,{'tableName':_0x5f18('0x3'),'paranoid':![],'indexes':[{'name':_0x5f18('0x4'),'fields':['uniqueid']},{'name':_0x5f18('0x5'),'fields':[_0x5f18('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 8a42ad7..9051511 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 _0x8f4c=['../../components/encryptor','Setting','findOne','callRecordingEncryption','existsSync','value','encryptFile','secrets','recording','unlink','CreateVoiceRecording\x20file\x20encrypted','lodash','util','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','jayson/promise','request','then','VoiceRecording,\x20%s,\x20%s','request\x20sent','debug','VoiceRecording,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result','catch','UpdateVoiceRecording','VoiceRecording','update','body','options','raw','where','attributes','limit','CreateVoiceRecording'];(function(_0x51f812,_0x36212c){var _0x1ad290=function(_0x1f03b7){while(--_0x1f03b7){_0x51f812['push'](_0x51f812['shift']());}};_0x1ad290(++_0x36212c);}(_0x8f4c,0x113));var _0xc8f4=function(_0x3b0d12,_0x581b78){_0x3b0d12=_0x3b0d12-0x0;var _0x44eb08=_0x8f4c[_0x3b0d12];return _0x44eb08;};'use strict';var _=require(_0xc8f4('0x0'));var util=require(_0xc8f4('0x1'));var moment=require(_0xc8f4('0x2'));var BPromise=require(_0xc8f4('0x3'));var rs=require(_0xc8f4('0x4'));var fs=require('fs');var Redis=require(_0xc8f4('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0xc8f4('0x6'));var logger=require(_0xc8f4('0x7'))(_0xc8f4('0x8'));var config=require('../../config/environment');var jayson=require(_0xc8f4('0x9'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x520063,_0x373506,_0x48c39d){return new BPromise(function(_0x3ea9a2,_0x3a9ab1){return client[_0xc8f4('0xa')](_0x520063,_0x48c39d)[_0xc8f4('0xb')](function(_0x34f05f){logger['info'](_0xc8f4('0xc'),_0x373506,_0xc8f4('0xd'));logger[_0xc8f4('0xe')](_0xc8f4('0xf'),_0x373506,'request\x20sent',JSON[_0xc8f4('0x10')](_0x34f05f));if(_0x34f05f['error']){if(_0x34f05f[_0xc8f4('0x11')][_0xc8f4('0x12')]===0x1f4){logger[_0xc8f4('0x11')](_0xc8f4('0xc'),_0x373506,_0x34f05f[_0xc8f4('0x11')]['message']);return _0x3a9ab1(_0x34f05f[_0xc8f4('0x11')][_0xc8f4('0x13')]);}logger[_0xc8f4('0x11')](_0xc8f4('0xc'),_0x373506,_0x34f05f[_0xc8f4('0x11')][_0xc8f4('0x13')]);return _0x3ea9a2(_0x34f05f['error'][_0xc8f4('0x13')]);}else{logger[_0xc8f4('0x14')](_0xc8f4('0xc'),_0x373506,_0xc8f4('0xd'));_0x3ea9a2(_0x34f05f[_0xc8f4('0x15')]['message']);}})[_0xc8f4('0x16')](function(_0x4d2b77){logger['error'](_0xc8f4('0xc'),_0x373506,_0x4d2b77);_0x3a9ab1(_0x4d2b77);});});}exports[_0xc8f4('0x17')]=function(_0x108076){var _0x7bb973=this;return new Promise(function(_0x4763c1,_0x374761){return db[_0xc8f4('0x18')][_0xc8f4('0x19')](_0x108076[_0xc8f4('0x1a')],{'raw':_0x108076[_0xc8f4('0x1b')]?_0x108076[_0xc8f4('0x1b')][_0xc8f4('0x1c')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x108076[_0xc8f4('0x1b')]?_0x108076['options'][_0xc8f4('0x1d')]||null:null,'attributes':_0x108076[_0xc8f4('0x1b')]?_0x108076[_0xc8f4('0x1b')][_0xc8f4('0x1e')]||null:null,'limit':_0x108076[_0xc8f4('0x1b')]?_0x108076[_0xc8f4('0x1b')][_0xc8f4('0x1f')]||null:null})[_0xc8f4('0xb')](function(_0x5e62aa){logger[_0xc8f4('0x14')](_0xc8f4('0x17'),_0x108076);logger[_0xc8f4('0xe')](_0xc8f4('0x17'),_0x108076,JSON['stringify'](_0x5e62aa));_0x4763c1(_0x5e62aa);})[_0xc8f4('0x16')](function(_0x4a44e0){logger[_0xc8f4('0x11')]('UpdateVoiceRecording',_0x4a44e0[_0xc8f4('0x13')],_0x108076);_0x374761(_0x7bb973[_0xc8f4('0x11')](0x1f4,_0x4a44e0['message']));});});};exports[_0xc8f4('0x20')]=function(_0x21062f){var _0x11f766=this;return new Promise(function(_0x2fa052,_0x4ce586){var _0x3db490=require(_0xc8f4('0x21'));var _0x5db666;return db[_0xc8f4('0x22')][_0xc8f4('0x23')]({'attributes':['id',_0xc8f4('0x24')],'where':{'id':0x1},'raw':!![]})[_0xc8f4('0xb')](function(_0x24bef0){_0x5db666=_0x24bef0;return db[_0xc8f4('0x18')]['create'](_0x21062f[_0xc8f4('0x1a')]);})[_0xc8f4('0xb')](function(_0x1ea3d9){if(_0x5db666['callRecordingEncryption']&&fs[_0xc8f4('0x25')](_0x1ea3d9[_0xc8f4('0x26')])){var _0x5ab6cb=util['format']('%s.cypher',_0x1ea3d9[_0xc8f4('0x26')]);return _0x3db490[_0xc8f4('0x27')](_0x1ea3d9[_0xc8f4('0x26')],_0x5ab6cb,config[_0xc8f4('0x28')][_0xc8f4('0x29')])[_0xc8f4('0xb')](function(){fs[_0xc8f4('0x2a')](_0x1ea3d9[_0xc8f4('0x26')]);logger['info'](_0xc8f4('0x2b'));return _0x1ea3d9;});}return _0x1ea3d9;})[_0xc8f4('0xb')](function(_0x3910f3){logger['info'](_0xc8f4('0x20'),_0x21062f);logger[_0xc8f4('0xe')]('CreateVoiceRecording',_0x21062f,JSON[_0xc8f4('0x10')](_0x3910f3));_0x2fa052(_0x3910f3);})[_0xc8f4('0x16')](function(_0x36f24f){logger['error'](_0xc8f4('0x20'),_0x36f24f[_0xc8f4('0x13')],_0x21062f);_0x4ce586(_0x11f766[_0xc8f4('0x11')](0x1f4,_0x36f24f['message']));});});}; \ No newline at end of file +var _0x8e3f=['where','attributes','limit','stringify','CreateVoiceRecording','../../components/encryptor','Setting','findOne','callRecordingEncryption','create','existsSync','value','format','%s.cypher','encryptFile','recording','CreateVoiceRecording\x20file\x20encrypted','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','jayson/promise','client','http','request','then','info','VoiceRecording,\x20%s,\x20%s','request\x20sent','debug','VoiceRecording,\x20%s,\x20%s,\x20%s','error','code','message','catch','UpdateVoiceRecording','VoiceRecording','body','options','raw'];(function(_0x4d7241,_0x32aa1f){var _0x59d9e2=function(_0x30e273){while(--_0x30e273){_0x4d7241['push'](_0x4d7241['shift']());}};_0x59d9e2(++_0x32aa1f);}(_0x8e3f,0xc1));var _0xf8e3=function(_0x4565bf,_0x5ad9d6){_0x4565bf=_0x4565bf-0x0;var _0x5610ba=_0x8e3f[_0x4565bf];return _0x5610ba;};'use strict';var _=require(_0xf8e3('0x0'));var util=require(_0xf8e3('0x1'));var moment=require(_0xf8e3('0x2'));var BPromise=require('bluebird');var rs=require(_0xf8e3('0x3'));var fs=require('fs');var Redis=require(_0xf8e3('0x4'));var db=require(_0xf8e3('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0xf8e3('0x6'))(_0xf8e3('0x7'));var config=require('../../config/environment');var jayson=require(_0xf8e3('0x8'));var client=jayson[_0xf8e3('0x9')][_0xf8e3('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x1ee9f3,_0x4e9e57,_0x4504dd){return new BPromise(function(_0x2e39b7,_0x17f56c){return client[_0xf8e3('0xb')](_0x1ee9f3,_0x4504dd)[_0xf8e3('0xc')](function(_0x4055e2){logger[_0xf8e3('0xd')](_0xf8e3('0xe'),_0x4e9e57,_0xf8e3('0xf'));logger[_0xf8e3('0x10')](_0xf8e3('0x11'),_0x4e9e57,_0xf8e3('0xf'),JSON['stringify'](_0x4055e2));if(_0x4055e2[_0xf8e3('0x12')]){if(_0x4055e2[_0xf8e3('0x12')][_0xf8e3('0x13')]===0x1f4){logger['error'](_0xf8e3('0xe'),_0x4e9e57,_0x4055e2[_0xf8e3('0x12')][_0xf8e3('0x14')]);return _0x17f56c(_0x4055e2[_0xf8e3('0x12')]['message']);}logger[_0xf8e3('0x12')](_0xf8e3('0xe'),_0x4e9e57,_0x4055e2[_0xf8e3('0x12')]['message']);return _0x2e39b7(_0x4055e2[_0xf8e3('0x12')]['message']);}else{logger[_0xf8e3('0xd')](_0xf8e3('0xe'),_0x4e9e57,_0xf8e3('0xf'));_0x2e39b7(_0x4055e2['result']['message']);}})[_0xf8e3('0x15')](function(_0x385dde){logger[_0xf8e3('0x12')](_0xf8e3('0xe'),_0x4e9e57,_0x385dde);_0x17f56c(_0x385dde);});});}exports[_0xf8e3('0x16')]=function(_0x11d4cc){var _0x7a81c3=this;return new Promise(function(_0x2e27e3,_0x1337ae){return db[_0xf8e3('0x17')]['update'](_0x11d4cc[_0xf8e3('0x18')],{'raw':_0x11d4cc[_0xf8e3('0x19')]?_0x11d4cc[_0xf8e3('0x19')][_0xf8e3('0x1a')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x11d4cc[_0xf8e3('0x19')]?_0x11d4cc[_0xf8e3('0x19')][_0xf8e3('0x1b')]||null:null,'attributes':_0x11d4cc[_0xf8e3('0x19')]?_0x11d4cc['options'][_0xf8e3('0x1c')]||null:null,'limit':_0x11d4cc[_0xf8e3('0x19')]?_0x11d4cc[_0xf8e3('0x19')][_0xf8e3('0x1d')]||null:null})['then'](function(_0x39df34){logger['info'](_0xf8e3('0x16'),_0x11d4cc);logger[_0xf8e3('0x10')](_0xf8e3('0x16'),_0x11d4cc,JSON[_0xf8e3('0x1e')](_0x39df34));_0x2e27e3(_0x39df34);})[_0xf8e3('0x15')](function(_0x3ac384){logger['error'](_0xf8e3('0x16'),_0x3ac384[_0xf8e3('0x14')],_0x11d4cc);_0x1337ae(_0x7a81c3[_0xf8e3('0x12')](0x1f4,_0x3ac384[_0xf8e3('0x14')]));});});};exports[_0xf8e3('0x1f')]=function(_0x3b41a1){var _0x2963ed=this;return new Promise(function(_0x157a2d,_0x56fa8e){var _0x356e0a=require(_0xf8e3('0x20'));var _0x12ebd2;return db[_0xf8e3('0x21')][_0xf8e3('0x22')]({'attributes':['id',_0xf8e3('0x23')],'where':{'id':0x1},'raw':!![]})[_0xf8e3('0xc')](function(_0xfaf15d){_0x12ebd2=_0xfaf15d;return db['VoiceRecording'][_0xf8e3('0x24')](_0x3b41a1[_0xf8e3('0x18')]);})[_0xf8e3('0xc')](function(_0x28b2f2){if(_0x12ebd2['callRecordingEncryption']&&fs[_0xf8e3('0x25')](_0x28b2f2[_0xf8e3('0x26')])){var _0x40f64d=util[_0xf8e3('0x27')](_0xf8e3('0x28'),_0x28b2f2[_0xf8e3('0x26')]);return _0x356e0a[_0xf8e3('0x29')](_0x28b2f2[_0xf8e3('0x26')],_0x40f64d,config['secrets'][_0xf8e3('0x2a')])[_0xf8e3('0xc')](function(){fs['unlink'](_0x28b2f2['value']);logger['info'](_0xf8e3('0x2b'));return _0x28b2f2;});}return _0x28b2f2;})['then'](function(_0x2559ea){logger[_0xf8e3('0xd')](_0xf8e3('0x1f'),_0x3b41a1);logger[_0xf8e3('0x10')]('CreateVoiceRecording',_0x3b41a1,JSON['stringify'](_0x2559ea));_0x157a2d(_0x2559ea);})[_0xf8e3('0x15')](function(_0x2f87d8){logger[_0xf8e3('0x12')](_0xf8e3('0x1f'),_0x2f87d8[_0xf8e3('0x14')],_0x3b41a1);_0x56fa8e(_0x2963ed[_0xf8e3('0x12')](0x1f4,_0x2f87d8['message']));});});}; \ No newline at end of file diff --git a/server/api/voiceTransferReport/index.js b/server/api/voiceTransferReport/index.js index 9eb664a..b9dbb7c 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 _0x7352=['/describe','describe','get','show','post','create','put','/:id','update','exports','util','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./voiceTransferReport.controller','isAuthenticated','index'];(function(_0x2e24d0,_0x34db1d){var _0x5aec4a=function(_0x1dbf44){while(--_0x1dbf44){_0x2e24d0['push'](_0x2e24d0['shift']());}};_0x5aec4a(++_0x34db1d);}(_0x7352,0xbe));var _0x2735=function(_0x5a4744,_0x2310bd){_0x5a4744=_0x5a4744-0x0;var _0x41f496=_0x7352[_0x5a4744];return _0x41f496;};'use strict';var multer=require('multer');var util=require(_0x2735('0x0'));var path=require('path');var timeout=require(_0x2735('0x1'));var express=require(_0x2735('0x2'));var router=express[_0x2735('0x3')]();var fs_extra=require(_0x2735('0x4'));var auth=require(_0x2735('0x5'));var interaction=require(_0x2735('0x6'));var config=require('../../config/environment');var controller=require(_0x2735('0x7'));router['get']('/',auth[_0x2735('0x8')](),controller[_0x2735('0x9')]);router['get'](_0x2735('0xa'),auth[_0x2735('0x8')](),controller[_0x2735('0xb')]);router[_0x2735('0xc')]('/:id',auth[_0x2735('0x8')](),controller[_0x2735('0xd')]);router[_0x2735('0xe')]('/',auth[_0x2735('0x8')](),controller[_0x2735('0xf')]);router[_0x2735('0x10')](_0x2735('0x11'),auth['isAuthenticated'](),controller[_0x2735('0x12')]);router['delete'](_0x2735('0x11'),auth[_0x2735('0x8')](),controller['destroy']);module[_0x2735('0x13')]=router; \ No newline at end of file +var _0xcaef=['post','create','put','update','delete','destroy','exports','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./voiceTransferReport.controller','get','isAuthenticated','index','/describe','describe','/:id','show'];(function(_0x4a6d9f,_0x4d79cc){var _0x2676b2=function(_0x15a1da){while(--_0x15a1da){_0x4a6d9f['push'](_0x4a6d9f['shift']());}};_0x2676b2(++_0x4d79cc);}(_0xcaef,0x8b));var _0xfcae=function(_0x1a9204,_0x1c9e00){_0x1a9204=_0x1a9204-0x0;var _0x17ca68=_0xcaef[_0x1a9204];return _0x17ca68;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0xfcae('0x0'));var timeout=require(_0xfcae('0x1'));var express=require(_0xfcae('0x2'));var router=express[_0xfcae('0x3')]();var fs_extra=require(_0xfcae('0x4'));var auth=require(_0xfcae('0x5'));var interaction=require(_0xfcae('0x6'));var config=require('../../config/environment');var controller=require(_0xfcae('0x7'));router[_0xfcae('0x8')]('/',auth[_0xfcae('0x9')](),controller[_0xfcae('0xa')]);router[_0xfcae('0x8')](_0xfcae('0xb'),auth[_0xfcae('0x9')](),controller[_0xfcae('0xc')]);router['get'](_0xfcae('0xd'),auth[_0xfcae('0x9')](),controller[_0xfcae('0xe')]);router[_0xfcae('0xf')]('/',auth[_0xfcae('0x9')](),controller[_0xfcae('0x10')]);router[_0xfcae('0x11')](_0xfcae('0xd'),auth[_0xfcae('0x9')](),controller[_0xfcae('0x12')]);router[_0xfcae('0x13')]('/:id',auth[_0xfcae('0x9')](),controller[_0xfcae('0x14')]);module[_0xfcae('0x15')]=router; \ No newline at end of file diff --git a/server/api/voiceTransferReport/voiceTransferReport.attributes.js b/server/api/voiceTransferReport/voiceTransferReport.attributes.js index 56d09ad..1977e06 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 _0xbcda=['ENUM','blind','STRING','sequelize','moment','exports'];(function(_0x46dec4,_0x1fd050){var _0x319ab7=function(_0x1864f0){while(--_0x1864f0){_0x46dec4['push'](_0x46dec4['shift']());}};_0x319ab7(++_0x1fd050);}(_0xbcda,0xe1));var _0xabcd=function(_0x55f8b4,_0x43f30d){_0x55f8b4=_0x55f8b4-0x0;var _0x2475f9=_0xbcda[_0x55f8b4];return _0x2475f9;};'use strict';var Sequelize=require(_0xabcd('0x0'));var moment=require(_0xabcd('0x1'));module[_0xabcd('0x2')]={'type':{'type':Sequelize[_0xabcd('0x3')](_0xabcd('0x4'),'attended')},'result':{'type':Sequelize[_0xabcd('0x5')]},'transfererchannel':{'type':Sequelize['STRING']},'transferercalleridnum':{'type':Sequelize['STRING']},'transferercalleridname':{'type':Sequelize['STRING']},'transfererconnectedlinenum':{'type':Sequelize['STRING']},'transfererconnectedlinename':{'type':Sequelize[_0xabcd('0x5')]},'transfereraccountcode':{'type':Sequelize[_0xabcd('0x5')]},'transferercontext':{'type':Sequelize[_0xabcd('0x5')]},'transfererexten':{'type':Sequelize[_0xabcd('0x5')]},'transfererlinkedid':{'type':Sequelize['STRING']},'transfereechannel':{'type':Sequelize[_0xabcd('0x5')]},'transfereecalleridnum':{'type':Sequelize[_0xabcd('0x5')]},'transfereecalleridname':{'type':Sequelize[_0xabcd('0x5')]},'transfereeconnectedlinenum':{'type':Sequelize['STRING']},'transfereeconnectedlinename':{'type':Sequelize['STRING']},'transfereeaccountcode':{'type':Sequelize[_0xabcd('0x5')]},'transfereecontext':{'type':Sequelize['STRING']},'transfereeexten':{'type':Sequelize[_0xabcd('0x5')]},'transfereelinkedid':{'type':Sequelize[_0xabcd('0x5')]},'isexternal':{'type':Sequelize[_0xabcd('0x3')]('Yes','No')},'context':{'type':Sequelize[_0xabcd('0x5')]},'extension':{'type':Sequelize[_0xabcd('0x5')]}}; \ No newline at end of file +var _0x1e6a=['Yes','sequelize','moment','exports','STRING','ENUM'];(function(_0x4ca333,_0x1218a3){var _0x13b2e1=function(_0x1eaf45){while(--_0x1eaf45){_0x4ca333['push'](_0x4ca333['shift']());}};_0x13b2e1(++_0x1218a3);}(_0x1e6a,0x163));var _0xa1e6=function(_0x2fb2f7,_0x2e06b3){_0x2fb2f7=_0x2fb2f7-0x0;var _0x3f08a2=_0x1e6a[_0x2fb2f7];return _0x3f08a2;};'use strict';var Sequelize=require(_0xa1e6('0x0'));var moment=require(_0xa1e6('0x1'));module[_0xa1e6('0x2')]={'type':{'type':Sequelize['ENUM']('blind','attended')},'result':{'type':Sequelize[_0xa1e6('0x3')]},'transfererchannel':{'type':Sequelize[_0xa1e6('0x3')]},'transferercalleridnum':{'type':Sequelize[_0xa1e6('0x3')]},'transferercalleridname':{'type':Sequelize[_0xa1e6('0x3')]},'transfererconnectedlinenum':{'type':Sequelize[_0xa1e6('0x3')]},'transfererconnectedlinename':{'type':Sequelize[_0xa1e6('0x3')]},'transfereraccountcode':{'type':Sequelize[_0xa1e6('0x3')]},'transferercontext':{'type':Sequelize[_0xa1e6('0x3')]},'transfererexten':{'type':Sequelize['STRING']},'transfererlinkedid':{'type':Sequelize[_0xa1e6('0x3')]},'transfereechannel':{'type':Sequelize[_0xa1e6('0x3')]},'transfereecalleridnum':{'type':Sequelize['STRING']},'transfereecalleridname':{'type':Sequelize['STRING']},'transfereeconnectedlinenum':{'type':Sequelize[_0xa1e6('0x3')]},'transfereeconnectedlinename':{'type':Sequelize[_0xa1e6('0x3')]},'transfereeaccountcode':{'type':Sequelize[_0xa1e6('0x3')]},'transfereecontext':{'type':Sequelize['STRING']},'transfereeexten':{'type':Sequelize[_0xa1e6('0x3')]},'transfereelinkedid':{'type':Sequelize[_0xa1e6('0x3')]},'isexternal':{'type':Sequelize[_0xa1e6('0x4')](_0xa1e6('0x5'),'No')},'context':{'type':Sequelize[_0xa1e6('0x3')]},'extension':{'type':Sequelize['STRING']}}; \ No newline at end of file diff --git a/server/api/voiceTransferReport/voiceTransferReport.controller.js b/server/api/voiceTransferReport/voiceTransferReport.controller.js index 0905cff..2888549 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 _0x58a8=['attributes','fields','length','nolimit','order','sort','where','filters','filter','merge','includeAll','include','findAll','rows','catch','params','options','find','create','body','describe','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','util','path','sox','to-csv','ejs','fs-extra','crypto','querystring','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../mysqldb','end','status','offset','undefined','count','limit','set','Content-Range','json','apply','reject','save','update','destroy','then','sendStatus','error','name','send','index','map','VoiceTransferReport','fieldName','type','key','model','query','keys','intersection'];(function(_0x16667a,_0x40fe6e){var _0x535ddb=function(_0x56aa68){while(--_0x56aa68){_0x16667a['push'](_0x16667a['shift']());}};_0x535ddb(++_0x40fe6e);}(_0x58a8,0xa7));var _0x858a=function(_0x3076f9,_0x379308){_0x3076f9=_0x3076f9-0x0;var _0x552d12=_0x58a8[_0x3076f9];return _0x552d12;};'use strict';var emlformat=require(_0x858a('0x0'));var rimraf=require(_0x858a('0x1'));var zipdir=require(_0x858a('0x2'));var jsonpatch=require(_0x858a('0x3'));var rp=require(_0x858a('0x4'));var moment=require(_0x858a('0x5'));var BPromise=require('bluebird');var Mustache=require(_0x858a('0x6'));var util=require(_0x858a('0x7'));var path=require(_0x858a('0x8'));var sox=require(_0x858a('0x9'));var csv=require(_0x858a('0xa'));var ejs=require(_0x858a('0xb'));var fs=require('fs');var fs_extra=require(_0x858a('0xc'));var _=require('lodash');var squel=require('squel');var crypto=require(_0x858a('0xd'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0x858a('0xa'));var querystring=require(_0x858a('0xe'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0x858a('0xf'));var qs=require(_0x858a('0x10'));var as=require(_0x858a('0x11'));var hardwareService=require(_0x858a('0x12'));var logger=require(_0x858a('0x13'))(_0x858a('0x14'));var utils=require('../../config/utils');var config=require(_0x858a('0x15'));var licenseUtil=require('../../config/license/util');var db=require(_0x858a('0x16'))['db'];function respondWithStatusCode(_0x3f90fc,_0x140a70){_0x140a70=_0x140a70||0xcc;return function(_0x33a473){if(_0x33a473){return _0x3f90fc['sendStatus'](_0x140a70);}return _0x3f90fc['status'](_0x140a70)[_0x858a('0x17')]();};}function respondWithResult(_0x218db6,_0x3a0f84){_0x3a0f84=_0x3a0f84||0xc8;return function(_0x34a23e){if(_0x34a23e){return _0x218db6[_0x858a('0x18')](_0x3a0f84)['json'](_0x34a23e);}};}function respondWithFilteredResult(_0x3bdf48,_0x1c674a){return function(_0x2aba6e){if(_0x2aba6e){var _0x2c036e=typeof _0x1c674a[_0x858a('0x19')]===_0x858a('0x1a')&&typeof _0x1c674a['limit']===_0x858a('0x1a');var _0x5f1713=_0x2aba6e[_0x858a('0x1b')];var _0x25c48f=_0x2c036e?0x0:_0x1c674a[_0x858a('0x19')];var _0x26a9dc=_0x2c036e?_0x2aba6e[_0x858a('0x1b')]:_0x1c674a[_0x858a('0x19')]+_0x1c674a[_0x858a('0x1c')];var _0x3bdf9b;if(_0x26a9dc>=_0x5f1713){_0x26a9dc=_0x5f1713;_0x3bdf9b=0xc8;}else{_0x3bdf9b=0xce;}_0x3bdf48['status'](_0x3bdf9b);return _0x3bdf48[_0x858a('0x1d')](_0x858a('0x1e'),_0x25c48f+'-'+_0x26a9dc+'/'+_0x5f1713)[_0x858a('0x1f')](_0x2aba6e);}return null;};}function patchUpdates(_0x452391){return function(_0x265f29){try{jsonpatch[_0x858a('0x20')](_0x265f29,_0x452391,!![]);}catch(_0x40afc0){return BPromise[_0x858a('0x21')](_0x40afc0);}return _0x265f29[_0x858a('0x22')]();};}function saveUpdates(_0x366b16,_0x190b99){return function(_0x424751){if(_0x424751){return _0x424751[_0x858a('0x23')](_0x366b16)['then'](function(_0x4d1a98){return _0x4d1a98;});}return null;};}function removeEntity(_0x5bdbd5,_0x24f96c){return function(_0x317163){if(_0x317163){return _0x317163[_0x858a('0x24')]()[_0x858a('0x25')](function(){_0x5bdbd5['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x40f80a,_0x3b7272){return function(_0x131e95){if(!_0x131e95){_0x40f80a[_0x858a('0x26')](0x194);}return _0x131e95;};}function handleError(_0x18222a,_0x53b245){_0x53b245=_0x53b245||0x1f4;return function(_0x199807){logger[_0x858a('0x27')](_0x199807['stack']);if(_0x199807[_0x858a('0x28')]){delete _0x199807['name'];}_0x18222a[_0x858a('0x18')](_0x53b245)[_0x858a('0x29')](_0x199807);};}exports[_0x858a('0x2a')]=function(_0x211072,_0x17184a){var _0x297591={},_0x14fed5={},_0x103ad4={'count':0x0,'rows':[]};var _0x5605c5=_[_0x858a('0x2b')](db[_0x858a('0x2c')]['rawAttributes'],function(_0x41f564){return{'name':_0x41f564[_0x858a('0x2d')],'type':_0x41f564[_0x858a('0x2e')][_0x858a('0x2f')]};});_0x14fed5[_0x858a('0x30')]=_[_0x858a('0x2b')](_0x5605c5,_0x858a('0x28'));_0x14fed5[_0x858a('0x31')]=_[_0x858a('0x32')](_0x211072[_0x858a('0x31')]);_0x14fed5['filters']=_[_0x858a('0x33')](_0x14fed5['model'],_0x14fed5[_0x858a('0x31')]);_0x297591[_0x858a('0x34')]=_[_0x858a('0x33')](_0x14fed5['model'],qs[_0x858a('0x35')](_0x211072[_0x858a('0x31')][_0x858a('0x35')]));_0x297591['attributes']=_0x297591['attributes'][_0x858a('0x36')]?_0x297591[_0x858a('0x34')]:_0x14fed5[_0x858a('0x30')];if(!_0x211072['query']['hasOwnProperty'](_0x858a('0x37'))){_0x297591[_0x858a('0x1c')]=qs['limit'](_0x211072[_0x858a('0x31')][_0x858a('0x1c')]);_0x297591[_0x858a('0x19')]=qs[_0x858a('0x19')](_0x211072['query']['offset']);}_0x297591[_0x858a('0x38')]=qs[_0x858a('0x39')](_0x211072[_0x858a('0x31')]['sort']);_0x297591[_0x858a('0x3a')]=qs[_0x858a('0x3b')](_['pick'](_0x211072[_0x858a('0x31')],_0x14fed5[_0x858a('0x3b')]),_0x5605c5);if(_0x211072[_0x858a('0x31')][_0x858a('0x3c')]){_0x297591[_0x858a('0x3a')]=_['merge'](_0x297591[_0x858a('0x3a')],{'$or':_[_0x858a('0x2b')](_0x5605c5,function(_0x1c8e48){if(_0x1c8e48[_0x858a('0x2e')]!=='VIRTUAL'){var _0x2b359e={};_0x2b359e[_0x1c8e48[_0x858a('0x28')]]={'$like':'%'+_0x211072['query'][_0x858a('0x3c')]+'%'};return _0x2b359e;}})});}_0x297591=_[_0x858a('0x3d')]({},_0x297591,_0x211072['options']);var _0x9d7f31={'where':_0x297591[_0x858a('0x3a')]};return db['VoiceTransferReport'][_0x858a('0x1b')](_0x9d7f31)[_0x858a('0x25')](function(_0x487d9b){_0x103ad4[_0x858a('0x1b')]=_0x487d9b;if(_0x211072['query'][_0x858a('0x3e')]){_0x297591[_0x858a('0x3f')]=[{'all':!![]}];}return db[_0x858a('0x2c')][_0x858a('0x40')](_0x297591);})[_0x858a('0x25')](function(_0x4e5b06){_0x103ad4[_0x858a('0x41')]=_0x4e5b06;return _0x103ad4;})[_0x858a('0x25')](respondWithFilteredResult(_0x17184a,_0x297591))[_0x858a('0x42')](handleError(_0x17184a,null));};exports['show']=function(_0x19f7fc,_0x59d6f6){var _0x29d5cc={'raw':!![],'where':{'id':_0x19f7fc[_0x858a('0x43')]['id']}},_0x20b126={};_0x20b126[_0x858a('0x30')]=_[_0x858a('0x32')](db[_0x858a('0x2c')]['rawAttributes']);_0x20b126[_0x858a('0x31')]=_[_0x858a('0x32')](_0x19f7fc['query']);_0x20b126['filters']=_[_0x858a('0x33')](_0x20b126[_0x858a('0x30')],_0x20b126[_0x858a('0x31')]);_0x29d5cc[_0x858a('0x34')]=_[_0x858a('0x33')](_0x20b126[_0x858a('0x30')],qs[_0x858a('0x35')](_0x19f7fc[_0x858a('0x31')][_0x858a('0x35')]));_0x29d5cc[_0x858a('0x34')]=_0x29d5cc[_0x858a('0x34')][_0x858a('0x36')]?_0x29d5cc[_0x858a('0x34')]:_0x20b126[_0x858a('0x30')];if(_0x19f7fc['query']['includeAll']){_0x29d5cc[_0x858a('0x3f')]=[{'all':!![]}];}_0x29d5cc=_[_0x858a('0x3d')]({},_0x29d5cc,_0x19f7fc[_0x858a('0x44')]);return db['VoiceTransferReport'][_0x858a('0x45')](_0x29d5cc)[_0x858a('0x25')](handleEntityNotFound(_0x59d6f6,null))['then'](respondWithResult(_0x59d6f6,null))[_0x858a('0x42')](handleError(_0x59d6f6,null));};exports[_0x858a('0x46')]=function(_0xee88f0,_0x101021){return db[_0x858a('0x2c')][_0x858a('0x46')](_0xee88f0['body'],{})[_0x858a('0x25')](respondWithResult(_0x101021,0xc9))[_0x858a('0x42')](handleError(_0x101021,null));};exports['update']=function(_0x38e35c,_0x2d3fc9){if(_0x38e35c[_0x858a('0x47')]['id']){delete _0x38e35c['body']['id'];}return db[_0x858a('0x2c')]['find']({'where':{'id':_0x38e35c[_0x858a('0x43')]['id']}})['then'](handleEntityNotFound(_0x2d3fc9,null))[_0x858a('0x25')](saveUpdates(_0x38e35c['body'],null))[_0x858a('0x25')](respondWithResult(_0x2d3fc9,null))[_0x858a('0x42')](handleError(_0x2d3fc9,null));};exports[_0x858a('0x24')]=function(_0xa5a2c4,_0x3f0992){return db[_0x858a('0x2c')][_0x858a('0x45')]({'where':{'id':_0xa5a2c4[_0x858a('0x43')]['id']}})[_0x858a('0x25')](handleEntityNotFound(_0x3f0992,null))['then'](removeEntity(_0x3f0992,null))[_0x858a('0x42')](handleError(_0x3f0992,null));};exports[_0x858a('0x48')]=function(_0x291763,_0x535d6b){return db[_0x858a('0x2c')][_0x858a('0x48')]()[_0x858a('0x25')](respondWithResult(_0x535d6b,null))[_0x858a('0x42')](handleError(_0x535d6b,null));}; \ No newline at end of file +var _0x9e77=['set','Content-Range','apply','reject','save','then','destroy','error','stack','name','send','map','VoiceTransferReport','rawAttributes','fieldName','model','query','keys','filters','intersection','fields','attributes','hasOwnProperty','nolimit','order','sort','where','filter','merge','VIRTUAL','options','count','includeAll','include','findAll','rows','catch','params','length','find','create','update','body','describe','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','squel','crypto','jsforce','desk.js','querystring','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit'];(function(_0x4e30d7,_0x2d967b){var _0x53d50a=function(_0x3fa975){while(--_0x3fa975){_0x4e30d7['push'](_0x4e30d7['shift']());}};_0x53d50a(++_0x2d967b);}(_0x9e77,0x1ad));var _0x79e7=function(_0x6bf524,_0x3080d2){_0x6bf524=_0x6bf524-0x0;var _0x259f34=_0x9e77[_0x6bf524];return _0x259f34;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x79e7('0x0'));var zipdir=require(_0x79e7('0x1'));var jsonpatch=require(_0x79e7('0x2'));var rp=require(_0x79e7('0x3'));var moment=require(_0x79e7('0x4'));var BPromise=require(_0x79e7('0x5'));var Mustache=require(_0x79e7('0x6'));var util=require(_0x79e7('0x7'));var path=require(_0x79e7('0x8'));var sox=require(_0x79e7('0x9'));var csv=require(_0x79e7('0xa'));var ejs=require(_0x79e7('0xb'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0x79e7('0xc'));var crypto=require(_0x79e7('0xd'));var jsforce=require(_0x79e7('0xe'));var deskjs=require(_0x79e7('0xf'));var toCsv=require('to-csv');var querystring=require(_0x79e7('0x10'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0x79e7('0x11'));var qs=require('../../components/parsers/qs');var as=require(_0x79e7('0x12'));var hardwareService=require(_0x79e7('0x13'));var logger=require(_0x79e7('0x14'))(_0x79e7('0x15'));var utils=require(_0x79e7('0x16'));var config=require(_0x79e7('0x17'));var licenseUtil=require(_0x79e7('0x18'));var db=require(_0x79e7('0x19'))['db'];function respondWithStatusCode(_0x10acb5,_0xd06557){_0xd06557=_0xd06557||0xcc;return function(_0x3ecfc5){if(_0x3ecfc5){return _0x10acb5[_0x79e7('0x1a')](_0xd06557);}return _0x10acb5[_0x79e7('0x1b')](_0xd06557)[_0x79e7('0x1c')]();};}function respondWithResult(_0x3fde7a,_0x5e738e){_0x5e738e=_0x5e738e||0xc8;return function(_0x292ce6){if(_0x292ce6){return _0x3fde7a[_0x79e7('0x1b')](_0x5e738e)[_0x79e7('0x1d')](_0x292ce6);}};}function respondWithFilteredResult(_0x5eb582,_0xe73d9a){return function(_0xacbffd){if(_0xacbffd){var _0x36a575=typeof _0xe73d9a[_0x79e7('0x1e')]===_0x79e7('0x1f')&&typeof _0xe73d9a[_0x79e7('0x20')]==='undefined';var _0x2dfcbd=_0xacbffd['count'];var _0x41fa24=_0x36a575?0x0:_0xe73d9a[_0x79e7('0x1e')];var _0x236001=_0x36a575?_0xacbffd['count']:_0xe73d9a[_0x79e7('0x1e')]+_0xe73d9a['limit'];var _0x58e9a1;if(_0x236001>=_0x2dfcbd){_0x236001=_0x2dfcbd;_0x58e9a1=0xc8;}else{_0x58e9a1=0xce;}_0x5eb582[_0x79e7('0x1b')](_0x58e9a1);return _0x5eb582[_0x79e7('0x21')](_0x79e7('0x22'),_0x41fa24+'-'+_0x236001+'/'+_0x2dfcbd)[_0x79e7('0x1d')](_0xacbffd);}return null;};}function patchUpdates(_0x2a3f0b){return function(_0x3c1072){try{jsonpatch[_0x79e7('0x23')](_0x3c1072,_0x2a3f0b,!![]);}catch(_0x5da6bf){return BPromise[_0x79e7('0x24')](_0x5da6bf);}return _0x3c1072[_0x79e7('0x25')]();};}function saveUpdates(_0x1f7063,_0x27acc4){return function(_0x11518c){if(_0x11518c){return _0x11518c['update'](_0x1f7063)[_0x79e7('0x26')](function(_0x4f7c1b){return _0x4f7c1b;});}return null;};}function removeEntity(_0x433ea4,_0x4de940){return function(_0x20e54e){if(_0x20e54e){return _0x20e54e[_0x79e7('0x27')]()['then'](function(){_0x433ea4[_0x79e7('0x1b')](0xcc)[_0x79e7('0x1c')]();});}};}function handleEntityNotFound(_0xbda89e,_0x4033ab){return function(_0x1db7af){if(!_0x1db7af){_0xbda89e['sendStatus'](0x194);}return _0x1db7af;};}function handleError(_0x2e53c2,_0x1ed949){_0x1ed949=_0x1ed949||0x1f4;return function(_0x3acf82){logger[_0x79e7('0x28')](_0x3acf82[_0x79e7('0x29')]);if(_0x3acf82[_0x79e7('0x2a')]){delete _0x3acf82[_0x79e7('0x2a')];}_0x2e53c2[_0x79e7('0x1b')](_0x1ed949)[_0x79e7('0x2b')](_0x3acf82);};}exports['index']=function(_0x30b0df,_0x592d0e){var _0x556355={},_0x2a096a={},_0x3de30d={'count':0x0,'rows':[]};var _0x126958=_[_0x79e7('0x2c')](db[_0x79e7('0x2d')][_0x79e7('0x2e')],function(_0x206637){return{'name':_0x206637[_0x79e7('0x2f')],'type':_0x206637['type']['key']};});_0x2a096a[_0x79e7('0x30')]=_[_0x79e7('0x2c')](_0x126958,_0x79e7('0x2a'));_0x2a096a[_0x79e7('0x31')]=_[_0x79e7('0x32')](_0x30b0df[_0x79e7('0x31')]);_0x2a096a[_0x79e7('0x33')]=_['intersection'](_0x2a096a[_0x79e7('0x30')],_0x2a096a[_0x79e7('0x31')]);_0x556355['attributes']=_[_0x79e7('0x34')](_0x2a096a[_0x79e7('0x30')],qs['fields'](_0x30b0df['query'][_0x79e7('0x35')]));_0x556355[_0x79e7('0x36')]=_0x556355['attributes']['length']?_0x556355[_0x79e7('0x36')]:_0x2a096a[_0x79e7('0x30')];if(!_0x30b0df[_0x79e7('0x31')][_0x79e7('0x37')](_0x79e7('0x38'))){_0x556355[_0x79e7('0x20')]=qs[_0x79e7('0x20')](_0x30b0df[_0x79e7('0x31')][_0x79e7('0x20')]);_0x556355['offset']=qs['offset'](_0x30b0df['query'][_0x79e7('0x1e')]);}_0x556355[_0x79e7('0x39')]=qs[_0x79e7('0x3a')](_0x30b0df[_0x79e7('0x31')][_0x79e7('0x3a')]);_0x556355[_0x79e7('0x3b')]=qs[_0x79e7('0x33')](_['pick'](_0x30b0df[_0x79e7('0x31')],_0x2a096a['filters']),_0x126958);if(_0x30b0df[_0x79e7('0x31')][_0x79e7('0x3c')]){_0x556355[_0x79e7('0x3b')]=_[_0x79e7('0x3d')](_0x556355[_0x79e7('0x3b')],{'$or':_[_0x79e7('0x2c')](_0x126958,function(_0x13ddc6){if(_0x13ddc6['type']!==_0x79e7('0x3e')){var _0x5c2160={};_0x5c2160[_0x13ddc6['name']]={'$like':'%'+_0x30b0df[_0x79e7('0x31')][_0x79e7('0x3c')]+'%'};return _0x5c2160;}})});}_0x556355=_[_0x79e7('0x3d')]({},_0x556355,_0x30b0df[_0x79e7('0x3f')]);var _0x16280c={'where':_0x556355[_0x79e7('0x3b')]};return db[_0x79e7('0x2d')][_0x79e7('0x40')](_0x16280c)[_0x79e7('0x26')](function(_0x3bf756){_0x3de30d[_0x79e7('0x40')]=_0x3bf756;if(_0x30b0df[_0x79e7('0x31')][_0x79e7('0x41')]){_0x556355[_0x79e7('0x42')]=[{'all':!![]}];}return db[_0x79e7('0x2d')][_0x79e7('0x43')](_0x556355);})[_0x79e7('0x26')](function(_0x53afc3){_0x3de30d[_0x79e7('0x44')]=_0x53afc3;return _0x3de30d;})[_0x79e7('0x26')](respondWithFilteredResult(_0x592d0e,_0x556355))[_0x79e7('0x45')](handleError(_0x592d0e,null));};exports['show']=function(_0x46fd6b,_0x542151){var _0x1d7d53={'raw':!![],'where':{'id':_0x46fd6b[_0x79e7('0x46')]['id']}},_0x5dda6b={};_0x5dda6b[_0x79e7('0x30')]=_['keys'](db['VoiceTransferReport'][_0x79e7('0x2e')]);_0x5dda6b[_0x79e7('0x31')]=_[_0x79e7('0x32')](_0x46fd6b['query']);_0x5dda6b[_0x79e7('0x33')]=_[_0x79e7('0x34')](_0x5dda6b[_0x79e7('0x30')],_0x5dda6b[_0x79e7('0x31')]);_0x1d7d53[_0x79e7('0x36')]=_['intersection'](_0x5dda6b[_0x79e7('0x30')],qs[_0x79e7('0x35')](_0x46fd6b[_0x79e7('0x31')][_0x79e7('0x35')]));_0x1d7d53['attributes']=_0x1d7d53[_0x79e7('0x36')][_0x79e7('0x47')]?_0x1d7d53[_0x79e7('0x36')]:_0x5dda6b['model'];if(_0x46fd6b['query']['includeAll']){_0x1d7d53[_0x79e7('0x42')]=[{'all':!![]}];}_0x1d7d53=_[_0x79e7('0x3d')]({},_0x1d7d53,_0x46fd6b['options']);return db[_0x79e7('0x2d')][_0x79e7('0x48')](_0x1d7d53)[_0x79e7('0x26')](handleEntityNotFound(_0x542151,null))['then'](respondWithResult(_0x542151,null))[_0x79e7('0x45')](handleError(_0x542151,null));};exports[_0x79e7('0x49')]=function(_0x231e6f,_0x546235){return db[_0x79e7('0x2d')]['create'](_0x231e6f['body'],{})['then'](respondWithResult(_0x546235,0xc9))[_0x79e7('0x45')](handleError(_0x546235,null));};exports[_0x79e7('0x4a')]=function(_0x33978f,_0x1677c6){if(_0x33978f[_0x79e7('0x4b')]['id']){delete _0x33978f[_0x79e7('0x4b')]['id'];}return db['VoiceTransferReport'][_0x79e7('0x48')]({'where':{'id':_0x33978f[_0x79e7('0x46')]['id']}})[_0x79e7('0x26')](handleEntityNotFound(_0x1677c6,null))[_0x79e7('0x26')](saveUpdates(_0x33978f[_0x79e7('0x4b')],null))['then'](respondWithResult(_0x1677c6,null))[_0x79e7('0x45')](handleError(_0x1677c6,null));};exports[_0x79e7('0x27')]=function(_0x41fb81,_0x289571){return db[_0x79e7('0x2d')][_0x79e7('0x48')]({'where':{'id':_0x41fb81['params']['id']}})['then'](handleEntityNotFound(_0x289571,null))[_0x79e7('0x26')](removeEntity(_0x289571,null))[_0x79e7('0x45')](handleError(_0x289571,null));};exports[_0x79e7('0x4c')]=function(_0x3b10f5,_0x55e0b8){return db[_0x79e7('0x2d')][_0x79e7('0x4c')]()[_0x79e7('0x26')](respondWithResult(_0x55e0b8,null))[_0x79e7('0x45')](handleError(_0x55e0b8,null));}; \ No newline at end of file diff --git a/server/api/voiceTransferReport/voiceTransferReport.model.js b/server/api/voiceTransferReport/voiceTransferReport.model.js index d8d1747..5c9737a 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 _0x76be=['VoiceTransferReport','report_call_transfer','lodash','../../config/logger','api','bluebird','request-promise','path','rimraf','../../config/environment','./voiceTransferReport.attributes','exports','define'];(function(_0x4257a5,_0x168b5a){var _0x668494=function(_0x4f986a){while(--_0x4f986a){_0x4257a5['push'](_0x4257a5['shift']());}};_0x668494(++_0x168b5a);}(_0x76be,0x154));var _0xe76b=function(_0x981602,_0x261528){_0x981602=_0x981602-0x0;var _0x116340=_0x76be[_0x981602];return _0x116340;};'use strict';var _=require(_0xe76b('0x0'));var util=require('util');var logger=require(_0xe76b('0x1'))(_0xe76b('0x2'));var moment=require('moment');var BPromise=require(_0xe76b('0x3'));var rp=require(_0xe76b('0x4'));var fs=require('fs');var path=require(_0xe76b('0x5'));var rimraf=require(_0xe76b('0x6'));var config=require(_0xe76b('0x7'));var attributes=require(_0xe76b('0x8'));module[_0xe76b('0x9')]=function(_0x27d2e5,_0x39b2a3){return _0x27d2e5[_0xe76b('0xa')](_0xe76b('0xb'),attributes,{'tableName':_0xe76b('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xb1fa=['moment','bluebird','request-promise','path','rimraf','../../config/environment','./voiceTransferReport.attributes','exports','VoiceTransferReport','report_call_transfer','lodash','../../config/logger','api'];(function(_0x336eaa,_0x1398af){var _0x8b3fe9=function(_0x429d9d){while(--_0x429d9d){_0x336eaa['push'](_0x336eaa['shift']());}};_0x8b3fe9(++_0x1398af);}(_0xb1fa,0xe7));var _0xab1f=function(_0x593c42,_0x3b4923){_0x593c42=_0x593c42-0x0;var _0xdfb3ca=_0xb1fa[_0x593c42];return _0xdfb3ca;};'use strict';var _=require(_0xab1f('0x0'));var util=require('util');var logger=require(_0xab1f('0x1'))(_0xab1f('0x2'));var moment=require(_0xab1f('0x3'));var BPromise=require(_0xab1f('0x4'));var rp=require(_0xab1f('0x5'));var fs=require('fs');var path=require(_0xab1f('0x6'));var rimraf=require(_0xab1f('0x7'));var config=require(_0xab1f('0x8'));var attributes=require(_0xab1f('0x9'));module[_0xab1f('0xa')]=function(_0x1020c5,_0x33f9d0){return _0x1020c5['define'](_0xab1f('0xb'),attributes,{'tableName':_0xab1f('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/voiceTransferReport/voiceTransferReport.rpc.js b/server/api/voiceTransferReport/voiceTransferReport.rpc.js index dd14a52..82c78c4 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 _0x0c84=['ioredis','../../config/utils','rpc','../../config/environment','jayson/promise','http','request','info','VoiceTransferReport,\x20%s,\x20%s','request\x20sent','VoiceTransferReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','CreateVoiceTransferReport','VoiceTransferReport','create','body','options','raw','then','util','moment','bluebird'];(function(_0x28e30a,_0x514484){var _0x1aa1f3=function(_0x4c6a59){while(--_0x4c6a59){_0x28e30a['push'](_0x28e30a['shift']());}};_0x1aa1f3(++_0x514484);}(_0x0c84,0x1c8));var _0x40c8=function(_0x2c91e9,_0x2fb965){_0x2c91e9=_0x2c91e9-0x0;var _0x13f0ff=_0x0c84[_0x2c91e9];return _0x13f0ff;};'use strict';var _=require('lodash');var util=require(_0x40c8('0x0'));var moment=require(_0x40c8('0x1'));var BPromise=require(_0x40c8('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x40c8('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x40c8('0x4'));var logger=require('../../config/logger')(_0x40c8('0x5'));var config=require(_0x40c8('0x6'));var jayson=require(_0x40c8('0x7'));var client=jayson['client'][_0x40c8('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x4e0bf6,_0xb55dc9,_0x418292){return new BPromise(function(_0x13957a,_0x402591){return client[_0x40c8('0x9')](_0x4e0bf6,_0x418292)['then'](function(_0x495394){logger[_0x40c8('0xa')](_0x40c8('0xb'),_0xb55dc9,_0x40c8('0xc'));logger['debug'](_0x40c8('0xd'),_0xb55dc9,_0x40c8('0xc'),JSON[_0x40c8('0xe')](_0x495394));if(_0x495394[_0x40c8('0xf')]){if(_0x495394[_0x40c8('0xf')][_0x40c8('0x10')]===0x1f4){logger['error'](_0x40c8('0xb'),_0xb55dc9,_0x495394[_0x40c8('0xf')][_0x40c8('0x11')]);return _0x402591(_0x495394[_0x40c8('0xf')][_0x40c8('0x11')]);}logger[_0x40c8('0xf')]('VoiceTransferReport,\x20%s,\x20%s',_0xb55dc9,_0x495394[_0x40c8('0xf')][_0x40c8('0x11')]);return _0x13957a(_0x495394[_0x40c8('0xf')][_0x40c8('0x11')]);}else{logger[_0x40c8('0xa')](_0x40c8('0xb'),_0xb55dc9,_0x40c8('0xc'));_0x13957a(_0x495394[_0x40c8('0x12')][_0x40c8('0x11')]);}})[_0x40c8('0x13')](function(_0x2051a7){logger[_0x40c8('0xf')](_0x40c8('0xb'),_0xb55dc9,_0x2051a7);_0x402591(_0x2051a7);});});}exports[_0x40c8('0x14')]=function(_0x1ae56e){var _0x4092dd=this;return new Promise(function(_0x411534,_0x18c381){return db[_0x40c8('0x15')][_0x40c8('0x16')](_0x1ae56e[_0x40c8('0x17')],{'raw':_0x1ae56e[_0x40c8('0x18')]?_0x1ae56e[_0x40c8('0x18')][_0x40c8('0x19')]===undefined?!![]:![]:!![]})[_0x40c8('0x1a')](function(_0x7631ef){logger['info']('CreateVoiceTransferReport',_0x1ae56e);logger['debug']('CreateVoiceTransferReport',_0x1ae56e,JSON[_0x40c8('0xe')](_0x7631ef));_0x411534(_0x7631ef);})[_0x40c8('0x13')](function(_0x24bf8c){logger['error'](_0x40c8('0x14'),_0x24bf8c[_0x40c8('0x11')],_0x1ae56e);_0x18c381(_0x4092dd[_0x40c8('0xf')](0x1f4,_0x24bf8c[_0x40c8('0x11')]));});});}; \ No newline at end of file +var _0xdd00=['code','VoiceTransferReport,\x20%s,\x20%s','message','info','result','CreateVoiceTransferReport','VoiceTransferReport','options','raw','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','then','request\x20sent','debug','VoiceTransferReport,\x20%s,\x20%s,\x20%s','stringify','error'];(function(_0x166742,_0x55520c){var _0xb7814a=function(_0x18feaf){while(--_0x18feaf){_0x166742['push'](_0x166742['shift']());}};_0xb7814a(++_0x55520c);}(_0xdd00,0xdc));var _0x0dd0=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xdd00[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0x0dd0('0x0'));var util=require(_0x0dd0('0x1'));var moment=require(_0x0dd0('0x2'));var BPromise=require(_0x0dd0('0x3'));var rs=require(_0x0dd0('0x4'));var fs=require('fs');var Redis=require(_0x0dd0('0x5'));var db=require(_0x0dd0('0x6'))['db'];var utils=require(_0x0dd0('0x7'));var logger=require(_0x0dd0('0x8'))(_0x0dd0('0x9'));var config=require(_0x0dd0('0xa'));var jayson=require(_0x0dd0('0xb'));var client=jayson[_0x0dd0('0xc')][_0x0dd0('0xd')]({'port':0x232a});function respondWithRpcPromise(_0x74071c,_0x1e9ffc,_0x3021bf){return new BPromise(function(_0xdc0d8a,_0x4cd876){return client['request'](_0x74071c,_0x3021bf)[_0x0dd0('0xe')](function(_0x3325d8){logger['info']('VoiceTransferReport,\x20%s,\x20%s',_0x1e9ffc,_0x0dd0('0xf'));logger[_0x0dd0('0x10')](_0x0dd0('0x11'),_0x1e9ffc,_0x0dd0('0xf'),JSON[_0x0dd0('0x12')](_0x3325d8));if(_0x3325d8[_0x0dd0('0x13')]){if(_0x3325d8[_0x0dd0('0x13')][_0x0dd0('0x14')]===0x1f4){logger[_0x0dd0('0x13')](_0x0dd0('0x15'),_0x1e9ffc,_0x3325d8['error'][_0x0dd0('0x16')]);return _0x4cd876(_0x3325d8[_0x0dd0('0x13')][_0x0dd0('0x16')]);}logger[_0x0dd0('0x13')](_0x0dd0('0x15'),_0x1e9ffc,_0x3325d8[_0x0dd0('0x13')][_0x0dd0('0x16')]);return _0xdc0d8a(_0x3325d8[_0x0dd0('0x13')]['message']);}else{logger[_0x0dd0('0x17')](_0x0dd0('0x15'),_0x1e9ffc,_0x0dd0('0xf'));_0xdc0d8a(_0x3325d8[_0x0dd0('0x18')][_0x0dd0('0x16')]);}})['catch'](function(_0x2ac91d){logger[_0x0dd0('0x13')]('VoiceTransferReport,\x20%s,\x20%s',_0x1e9ffc,_0x2ac91d);_0x4cd876(_0x2ac91d);});});}exports[_0x0dd0('0x19')]=function(_0x34b002){var _0xb064d1=this;return new Promise(function(_0x561550,_0x142871){return db[_0x0dd0('0x1a')]['create'](_0x34b002['body'],{'raw':_0x34b002[_0x0dd0('0x1b')]?_0x34b002['options'][_0x0dd0('0x1c')]===undefined?!![]:![]:!![]})['then'](function(_0x1b16d1){logger[_0x0dd0('0x17')](_0x0dd0('0x19'),_0x34b002);logger[_0x0dd0('0x10')](_0x0dd0('0x19'),_0x34b002,JSON[_0x0dd0('0x12')](_0x1b16d1));_0x561550(_0x1b16d1);})[_0x0dd0('0x1d')](function(_0x46b37e){logger['error'](_0x0dd0('0x19'),_0x46b37e[_0x0dd0('0x16')],_0x34b002);_0x142871(_0xb064d1['error'](0x1f4,_0x46b37e[_0x0dd0('0x16')]));});});}; \ No newline at end of file diff --git a/server/api/webbar/index.js b/server/api/webbar/index.js index 961ccbf..9ef20ac 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 _0xdace=['unhold','calls','/transfer','transfer','exports','express','../../components/auth/service','./webbar.controller','post','isAuthenticated','isWebrtcLicence','originate','hangup','/answer','/hold','/unhold'];(function(_0x46c91d,_0x1c57a5){var _0x8d029e=function(_0xfa581f){while(--_0xfa581f){_0x46c91d['push'](_0x46c91d['shift']());}};_0x8d029e(++_0x1c57a5);}(_0xdace,0xc5));var _0xedac=function(_0x487b0c,_0x14ff74){_0x487b0c=_0x487b0c-0x0;var _0x1adbdc=_0xdace[_0x487b0c];return _0x1adbdc;};'use strict';var express=require(_0xedac('0x0'));var router=express['Router']();var auth=require(_0xedac('0x1'));var controller=require(_0xedac('0x2'));router[_0xedac('0x3')]('/originate',auth[_0xedac('0x4')](),auth[_0xedac('0x5')](),controller[_0xedac('0x6')]);router[_0xedac('0x3')]('/hangup',auth[_0xedac('0x4')](),auth[_0xedac('0x5')](),controller[_0xedac('0x7')]);router['post'](_0xedac('0x8'),auth[_0xedac('0x4')](),auth[_0xedac('0x5')](),controller['answer']);router[_0xedac('0x3')](_0xedac('0x9'),auth[_0xedac('0x4')](),auth['isWebrtcLicence'](),controller['hold']);router[_0xedac('0x3')](_0xedac('0xa'),auth['isAuthenticated'](),auth['isWebrtcLicence'](),controller[_0xedac('0xb')]);router[_0xedac('0x3')]('/calls',auth[_0xedac('0x4')](),auth['isWebrtcLicence'](),controller[_0xedac('0xc')]);router[_0xedac('0x3')](_0xedac('0xd'),auth[_0xedac('0x4')](),auth[_0xedac('0x5')](),controller[_0xedac('0xe')]);module[_0xedac('0xf')]=router; \ No newline at end of file +var _0x9bde=['Router','./webbar.controller','/originate','isAuthenticated','isWebrtcLicence','originate','post','/hangup','hangup','/answer','answer','/hold','/unhold','/calls','transfer'];(function(_0x41a457,_0x4a8e30){var _0x84b15f=function(_0x11868b){while(--_0x11868b){_0x41a457['push'](_0x41a457['shift']());}};_0x84b15f(++_0x4a8e30);}(_0x9bde,0xe1));var _0xe9bd=function(_0x4e07df,_0x1bbbd3){_0x4e07df=_0x4e07df-0x0;var _0x1df412=_0x9bde[_0x4e07df];return _0x1df412;};'use strict';var express=require('express');var router=express[_0xe9bd('0x0')]();var auth=require('../../components/auth/service');var controller=require(_0xe9bd('0x1'));router['post'](_0xe9bd('0x2'),auth[_0xe9bd('0x3')](),auth[_0xe9bd('0x4')](),controller[_0xe9bd('0x5')]);router[_0xe9bd('0x6')](_0xe9bd('0x7'),auth[_0xe9bd('0x3')](),auth['isWebrtcLicence'](),controller[_0xe9bd('0x8')]);router[_0xe9bd('0x6')](_0xe9bd('0x9'),auth[_0xe9bd('0x3')](),auth[_0xe9bd('0x4')](),controller[_0xe9bd('0xa')]);router[_0xe9bd('0x6')](_0xe9bd('0xb'),auth[_0xe9bd('0x3')](),auth[_0xe9bd('0x4')](),controller['hold']);router['post'](_0xe9bd('0xc'),auth[_0xe9bd('0x3')](),auth[_0xe9bd('0x4')](),controller['unhold']);router[_0xe9bd('0x6')](_0xe9bd('0xd'),auth[_0xe9bd('0x3')](),auth[_0xe9bd('0x4')](),controller['calls']);router[_0xe9bd('0x6')]('/transfer',auth[_0xe9bd('0x3')](),auth[_0xe9bd('0x4')](),controller[_0xe9bd('0xe')]);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 26fca53..467a8b6 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 _0xf290=['lodash','../../config/environment','bluebird','jayson/promise','client','http','../../config/logger','ioredis','defaults','redis','localhost','socket.io-emitter','validate','number','userId\x20is\x20required','string','callNumber\x20is\x20required','sessionId\x20is\x20required','transferNumber\x20is\x20required','info','stringify','log','name','status','send','then','error','code','message','result','catch','User','VoiceChannels','all','rows','sessionId','length','sessionId\x20','\x20not\x20found!','body','json','userId','callerId','callbackUrl','entityFound:','user:%s','webbar:originate','originate\x20executed!','hangup','hangup\x20fired:','format','hangup\x20executed!','answer\x20fired:','webbar:answer','answer\x20executed!','hold','hold\x20fired:','webbar:hold','hold\x20executed!','unhold','unhold\x20fired:','unhold\x20executed!','calls','calls\x20fired:','filter','conference','conference\x20fired:','webbar:conference','conference\x20executed!','transfer','transfer\x20fired:','transferNumber','webbar:transfer','transfer\x20executed!'];(function(_0x2bf76a,_0xb01832){var _0x1ec759=function(_0x660558){while(--_0x660558){_0x2bf76a['push'](_0x2bf76a['shift']());}};_0x1ec759(++_0xb01832);}(_0xf290,0xde));var _0x0f29=function(_0x113e32,_0x5339f0){_0x113e32=_0x113e32-0x0;var _0x4ff939=_0xf290[_0x113e32];return _0x4ff939;};'use strict';var path=require('path');var fs=require('fs');var _=require(_0x0f29('0x0'));var db=require('../../mysqldb')['db'];var config=require(_0x0f29('0x1'));var util=require('util');var BPromise=require(_0x0f29('0x2'));var jayson=require(_0x0f29('0x3'));var amiClient=jayson[_0x0f29('0x4')][_0x0f29('0x5')]({'port':0x232a});var logger=require(_0x0f29('0x6'))('webbarapi');var Redis=require(_0x0f29('0x7'));config['redis']=_[_0x0f29('0x8')](config[_0x0f29('0x9')],{'host':_0x0f29('0xa'),'port':0x18eb});var io=require(_0x0f29('0xb'))(new Redis(config[_0x0f29('0x9')]));var Schema=require(_0x0f29('0xc'));var originateValidation=new Schema({'userId':{'type':_0x0f29('0xd'),'required':[!![],_0x0f29('0xe')]},'callNumber':{'type':_0x0f29('0xf'),'required':[!![],_0x0f29('0x10')]},'callerId':{'type':_0x0f29('0xf')},'callbackUrl':{'type':_0x0f29('0xf')}});var hangupValidation=new Schema({'userId':{'type':_0x0f29('0xd'),'required':[!![],_0x0f29('0xe')]},'sessionId':{'type':_0x0f29('0xf'),'required':![]}});var answerValidation=new Schema({'userId':{'type':'number','required':[!![],_0x0f29('0xe')]},'sessionId':{'type':'string','required':![]}});var transferValidation=new Schema({'userId':{'type':_0x0f29('0xd'),'required':[!![],_0x0f29('0xe')]},'sessionId':{'type':_0x0f29('0xf'),'required':[!![],_0x0f29('0x11')]},'transferNumber':{'type':_0x0f29('0xf'),'required':[!![],_0x0f29('0x12')]}});var holdValidation=new Schema({'userId':{'type':'number','required':[!![],_0x0f29('0xe')]},'sessionId':{'type':_0x0f29('0xf'),'required':![]}});var unholdValidation=new Schema({'userId':{'type':_0x0f29('0xd'),'required':[!![],_0x0f29('0xe')]},'sessionId':{'type':_0x0f29('0xf'),'required':![]}});var callsValidation=new Schema({'userId':{'type':_0x0f29('0xd'),'required':[!![],_0x0f29('0xe')]}});var conferenceValidation=new Schema({'userId':{'type':_0x0f29('0xd'),'required':[!![],'userId\x20is\x20required']}});function emit(_0x4ac37d,_0x2be27f,_0x3151a5){logger[_0x0f29('0x13')](_0x4ac37d,_0x2be27f,JSON[_0x0f29('0x14')](_0x3151a5));io['to'](_0x4ac37d)['emit'](_0x2be27f,_0x3151a5);}function handleError(_0x122bfa){return function(_0x5d72a5){console[_0x0f29('0x15')]('handleError:',_0x5d72a5,_0x5d72a5 instanceof RangeError);logger['error'](_0x5d72a5['stack']);if(_0x5d72a5 instanceof RangeError){if(_0x5d72a5[_0x0f29('0x16')]){delete _0x5d72a5[_0x0f29('0x16')];}_0x122bfa[_0x0f29('0x17')](0x194)[_0x0f29('0x18')](_0x5d72a5);}else{if(_0x5d72a5[_0x0f29('0x16')]){delete _0x5d72a5[_0x0f29('0x16')];}_0x122bfa[_0x0f29('0x17')](0x1f4)['send'](_0x5d72a5);}};}function checkError(){return function(_0x49d954){if(!_0x49d954){throw new RangeError('NotFound');}return _0x49d954;};}function respondWithRpcPromise(_0x5ab592,_0x55d92e){return new BPromise(function(_0x5d94b9,_0x38a1ce){var _0x4a9dd8=amiClient;return _0x4a9dd8['request'](_0x5ab592,_0x55d92e)[_0x0f29('0x19')](function(_0x1840e0){if(_0x1840e0[_0x0f29('0x1a')]){if(_0x1840e0[_0x0f29('0x1a')][_0x0f29('0x1b')]===0x1f4){return _0x38a1ce(_0x1840e0['error'][_0x0f29('0x1c')]);}return _0x5d94b9(_0x1840e0['error'][_0x0f29('0x1c')]);}else{_0x5d94b9(_0x1840e0[_0x0f29('0x1d')]);}})[_0x0f29('0x1e')](function(_0x28cfaa){_0x38a1ce(_0x28cfaa);});});}function getAgent(_0x57667b){return db[_0x0f29('0x1f')]['findOne']({'where':{'id':_0x57667b,'role':'agent'}})[_0x0f29('0x19')](checkError());}function getAgentCheckSession(_0x5c0202,_0x5bfcac){return new BPromise(function(_0x57dcc7,_0x4dd0b0){var _0x3c6ce9=respondWithRpcPromise(_0x0f29('0x20'));var _0x4cc5a0=getAgent(_0x5c0202);Promise[_0x0f29('0x21')]([_0x3c6ce9,_0x4cc5a0])[_0x0f29('0x19')](function(_0x274c9d){var _0x51e7dc=_0x274c9d[0x0];var _0x56e729=_0x274c9d[0x1];var _0x37ebcc=_['filter'](_0x51e7dc[_0x0f29('0x22')],function(_0x561c31){return _0x561c31['UserId']==_0x56e729['id']&&_0x561c31[_0x0f29('0x23')]==_0x5bfcac;});if(_0x37ebcc[_0x0f29('0x24')]==0x1){_0x57dcc7(_0x56e729);}else{_0x4dd0b0(new RangeError(_0x0f29('0x25')+_0x5bfcac+_0x0f29('0x26')));}});});}exports['originate']=function(_0x52a501,_0x3bb3c8){logger['info']('originate\x20fired:',_0x52a501[_0x0f29('0x27')]);var _0x5baebb=originateValidation[_0x0f29('0xc')](_0x52a501['body']);if(_0x5baebb['length']>0x0){return _0x3bb3c8[_0x0f29('0x17')](0x190)[_0x0f29('0x28')](_0x5baebb);}var _0x3ea452=_0x52a501[_0x0f29('0x27')][_0x0f29('0x29')];var _0x4d0504=_0x52a501[_0x0f29('0x27')]['callNumber'];var _0x2cc510=_0x52a501[_0x0f29('0x27')][_0x0f29('0x2a')];var _0x1320a3=_0x52a501['body'][_0x0f29('0x2b')];return getAgent(_0x3ea452)[_0x0f29('0x19')](function(_0x5be4fa){logger[_0x0f29('0x13')](_0x0f29('0x2c'),_0x5be4fa['name']);emit(util['format'](_0x0f29('0x2d'),_0x5be4fa[_0x0f29('0x16')]),_0x0f29('0x2e'),{'callNumber':_0x4d0504,'callerId':_0x2cc510,'callbackUrl':_0x1320a3});return _0x3bb3c8[_0x0f29('0x17')](0xc8)[_0x0f29('0x28')]({'error':![],'message':_0x0f29('0x2f')});})['catch'](handleError(_0x3bb3c8));};exports[_0x0f29('0x30')]=function(_0x5a538e,_0x331dc7){logger['info'](_0x0f29('0x31'),_0x5a538e[_0x0f29('0x27')]);var _0x6d4c82=hangupValidation['validate'](_0x5a538e['body']);if(_0x6d4c82[_0x0f29('0x24')]>0x0){return _0x331dc7['status'](0x190)[_0x0f29('0x28')](_0x6d4c82);}var _0x3f49f8=_0x5a538e[_0x0f29('0x27')][_0x0f29('0x29')];var _0x9ae45d=_0x5a538e['body'][_0x0f29('0x23')];return getAgent(_0x3f49f8)[_0x0f29('0x19')](function(_0x42872b){logger[_0x0f29('0x13')](_0x0f29('0x2c'),_0x42872b[_0x0f29('0x16')]);emit(util[_0x0f29('0x32')](_0x0f29('0x2d'),_0x42872b[_0x0f29('0x16')]),'webbar:hangup',{'sessionId':_0x9ae45d});return _0x331dc7[_0x0f29('0x17')](0xc8)[_0x0f29('0x28')]({'error':![],'message':_0x0f29('0x33')});})[_0x0f29('0x1e')](handleError(_0x331dc7));};exports['answer']=function(_0x10e800,_0xfc9257){logger[_0x0f29('0x13')](_0x0f29('0x34'),_0x10e800[_0x0f29('0x27')]);var _0x56062d=answerValidation[_0x0f29('0xc')](_0x10e800[_0x0f29('0x27')]);if(_0x56062d[_0x0f29('0x24')]>0x0){return _0xfc9257['status'](0x190)[_0x0f29('0x28')](_0x56062d);}var _0x284279=_0x10e800[_0x0f29('0x27')][_0x0f29('0x29')];var _0x35f753=_0x10e800[_0x0f29('0x27')][_0x0f29('0x23')];return getAgent(_0x284279)[_0x0f29('0x19')](function(_0x4b6b6a){logger['info']('entityFound:',_0x4b6b6a[_0x0f29('0x16')]);emit(util[_0x0f29('0x32')](_0x0f29('0x2d'),_0x4b6b6a[_0x0f29('0x16')]),_0x0f29('0x35'),{'sessionId':_0x35f753});return _0xfc9257[_0x0f29('0x17')](0xc8)['json']({'error':![],'message':_0x0f29('0x36')});})['catch'](handleError(_0xfc9257));};exports[_0x0f29('0x37')]=function(_0x57242c,_0x284036){logger[_0x0f29('0x13')](_0x0f29('0x38'),_0x57242c[_0x0f29('0x27')]);var _0x301fc8=holdValidation['validate'](_0x57242c[_0x0f29('0x27')]);if(_0x301fc8[_0x0f29('0x24')]>0x0){return _0x284036[_0x0f29('0x17')](0x190)['json'](_0x301fc8);}var _0x14b747=_0x57242c['body']['userId'];var _0x21c0a4=_0x57242c[_0x0f29('0x27')][_0x0f29('0x23')];return getAgent(_0x14b747)[_0x0f29('0x19')](function(_0x20aa53){logger[_0x0f29('0x13')]('entityFound:',_0x20aa53[_0x0f29('0x16')]);emit(util[_0x0f29('0x32')](_0x0f29('0x2d'),_0x20aa53[_0x0f29('0x16')]),_0x0f29('0x39'),{'sessionId':_0x21c0a4});return _0x284036[_0x0f29('0x17')](0xc8)[_0x0f29('0x28')]({'error':![],'message':_0x0f29('0x3a')});})[_0x0f29('0x1e')](handleError(_0x284036));};exports[_0x0f29('0x3b')]=function(_0x5cd4a9,_0x5e4479){logger[_0x0f29('0x13')](_0x0f29('0x3c'),_0x5cd4a9[_0x0f29('0x27')]);var _0x178f21=unholdValidation['validate'](_0x5cd4a9[_0x0f29('0x27')]);if(_0x178f21[_0x0f29('0x24')]>0x0){return _0x5e4479[_0x0f29('0x17')](0x190)[_0x0f29('0x28')](_0x178f21);}var _0xbf8f22=_0x5cd4a9[_0x0f29('0x27')][_0x0f29('0x29')];var _0x59aeb9=_0x5cd4a9[_0x0f29('0x27')][_0x0f29('0x23')];return getAgent(_0xbf8f22)[_0x0f29('0x19')](function(_0x2c6a95){logger[_0x0f29('0x13')](_0x0f29('0x2c'),_0x2c6a95['name']);emit(util[_0x0f29('0x32')](_0x0f29('0x2d'),_0x2c6a95[_0x0f29('0x16')]),'webbar:unhold',{'sessionId':_0x59aeb9});return _0x5e4479[_0x0f29('0x17')](0xc8)['json']({'error':![],'message':_0x0f29('0x3d')});})['catch'](handleError(_0x5e4479));};exports[_0x0f29('0x3e')]=function(_0x3fcda8,_0x4a490a){logger[_0x0f29('0x13')](_0x0f29('0x3f'),_0x4a490a[_0x0f29('0x27')]);var _0x4a2c08=callsValidation[_0x0f29('0xc')](_0x3fcda8['body']);if(_0x4a2c08[_0x0f29('0x24')]>0x0){return _0x4a490a[_0x0f29('0x17')](0x190)['json'](_0x4a2c08);}var _0x1c46a6=_0x3fcda8[_0x0f29('0x27')]['userId'];var _0xbe013b=respondWithRpcPromise('VoiceChannels');var _0x1baaf8=getAgent(_0x1c46a6);return Promise['all']([_0xbe013b,_0x1baaf8])[_0x0f29('0x19')](function(_0x302d05){var _0x36a7df=_0x302d05[0x0];var _0x4ba5c3=_0x302d05[0x1];var _0x36e714=_[_0x0f29('0x40')](_0x36a7df[_0x0f29('0x22')],function(_0x46c22c){return _0x46c22c['UserId']==_0x4ba5c3['id'];});return _0x4a490a[_0x0f29('0x17')](0xc8)['json']({'count':_0x36e714[_0x0f29('0x24')],'rows':_0x36e714});})['catch'](handleError(_0x4a490a));};exports[_0x0f29('0x41')]=function(_0x3eafc8,_0x306b24){logger[_0x0f29('0x13')](_0x0f29('0x42'),_0x3eafc8[_0x0f29('0x27')]);var _0x272a9e=conferenceValidation['validate'](_0x3eafc8[_0x0f29('0x27')]);if(_0x272a9e['length']>0x0){return _0x306b24[_0x0f29('0x17')](0x190)[_0x0f29('0x28')](_0x272a9e);}var _0x357437=_0x3eafc8['body'][_0x0f29('0x29')];return getAgent(_0x357437)[_0x0f29('0x19')](function(_0x115dbe){logger[_0x0f29('0x13')](_0x0f29('0x2c'),_0x115dbe['name']);emit(util['format'](_0x0f29('0x2d'),_0x115dbe[_0x0f29('0x16')]),_0x0f29('0x43'));return _0x306b24['status'](0xc8)['json']({'error':![],'message':_0x0f29('0x44')});})[_0x0f29('0x1e')](handleError(_0x306b24));};exports[_0x0f29('0x45')]=function(_0x4a7e9f,_0x520e92){logger['info'](_0x0f29('0x46'),_0x4a7e9f[_0x0f29('0x27')]);var _0x49a7b3=transferValidation[_0x0f29('0xc')](_0x4a7e9f[_0x0f29('0x27')]);if(_0x49a7b3['length']>0x0){return _0x520e92[_0x0f29('0x17')](0x190)['json'](_0x49a7b3);}var _0x41f20a=_0x4a7e9f[_0x0f29('0x27')]['userId'];var _0x2e423a=_0x4a7e9f[_0x0f29('0x27')][_0x0f29('0x23')];var _0x2d5ce4=_0x4a7e9f[_0x0f29('0x27')][_0x0f29('0x47')];return getAgent(_0x41f20a)['then'](function(_0x2babb0){logger[_0x0f29('0x13')](_0x0f29('0x2c'),_0x2babb0['name']);emit(util[_0x0f29('0x32')](_0x0f29('0x2d'),_0x2babb0['name']),_0x0f29('0x48'),{'sessionId':_0x2e423a,'transferNumber':_0x2d5ce4});return _0x520e92['status'](0xc8)[_0x0f29('0x28')]({'error':![],'message':_0x0f29('0x49')});})[_0x0f29('0x1e')](handleError(_0x520e92));}; \ No newline at end of file +var _0x66fa=['userId','callNumber','callerId','callbackUrl','format','user:%s','webbar:originate','json','originate\x20executed!','hangup','hangup\x20fired:','sessionId','entityFound:','webbar:hangup','hangup\x20executed!','answer','answer\x20fired:','webbar:answer','answer\x20executed!','hold','hold\x20fired:','webbar:hold','hold\x20executed!','unhold\x20fired:','webbar:unhold','unhold\x20executed!','calls','VoiceChannels','filter','conference\x20fired:','webbar:conference','transfer','transfer\x20fired:','transferNumber','webbar:transfer','transfer\x20executed!','path','lodash','../../mysqldb','bluebird','jayson/promise','client','http','../../config/logger','webbarapi','ioredis','redis','defaults','localhost','number','userId\x20is\x20required','callNumber\x20is\x20required','string','sessionId\x20is\x20required','transferNumber\x20is\x20required','info','stringify','emit','log','handleError:','error','stack','name','status','send','request','then','code','message','result','catch','findOne','all','rows','UserId','length','\x20not\x20found!','originate','originate\x20fired:','validate','body'];(function(_0x3ef546,_0x3a4425){var _0x435bd9=function(_0x4107f1){while(--_0x4107f1){_0x3ef546['push'](_0x3ef546['shift']());}};_0x435bd9(++_0x3a4425);}(_0x66fa,0x168));var _0xa66f=function(_0x3dcff5,_0x48e4e4){_0x3dcff5=_0x3dcff5-0x0;var _0x2cf002=_0x66fa[_0x3dcff5];return _0x2cf002;};'use strict';var path=require(_0xa66f('0x0'));var fs=require('fs');var _=require(_0xa66f('0x1'));var db=require(_0xa66f('0x2'))['db'];var config=require('../../config/environment');var util=require('util');var BPromise=require(_0xa66f('0x3'));var jayson=require(_0xa66f('0x4'));var amiClient=jayson[_0xa66f('0x5')][_0xa66f('0x6')]({'port':0x232a});var logger=require(_0xa66f('0x7'))(_0xa66f('0x8'));var Redis=require(_0xa66f('0x9'));config[_0xa66f('0xa')]=_[_0xa66f('0xb')](config[_0xa66f('0xa')],{'host':_0xa66f('0xc'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0xa66f('0xa')]));var Schema=require('validate');var originateValidation=new Schema({'userId':{'type':_0xa66f('0xd'),'required':[!![],_0xa66f('0xe')]},'callNumber':{'type':'string','required':[!![],_0xa66f('0xf')]},'callerId':{'type':_0xa66f('0x10')},'callbackUrl':{'type':_0xa66f('0x10')}});var hangupValidation=new Schema({'userId':{'type':_0xa66f('0xd'),'required':[!![],_0xa66f('0xe')]},'sessionId':{'type':_0xa66f('0x10'),'required':![]}});var answerValidation=new Schema({'userId':{'type':'number','required':[!![],'userId\x20is\x20required']},'sessionId':{'type':_0xa66f('0x10'),'required':![]}});var transferValidation=new Schema({'userId':{'type':'number','required':[!![],_0xa66f('0xe')]},'sessionId':{'type':_0xa66f('0x10'),'required':[!![],_0xa66f('0x11')]},'transferNumber':{'type':'string','required':[!![],_0xa66f('0x12')]}});var holdValidation=new Schema({'userId':{'type':_0xa66f('0xd'),'required':[!![],'userId\x20is\x20required']},'sessionId':{'type':_0xa66f('0x10'),'required':![]}});var unholdValidation=new Schema({'userId':{'type':_0xa66f('0xd'),'required':[!![],_0xa66f('0xe')]},'sessionId':{'type':_0xa66f('0x10'),'required':![]}});var callsValidation=new Schema({'userId':{'type':'number','required':[!![],_0xa66f('0xe')]}});var conferenceValidation=new Schema({'userId':{'type':_0xa66f('0xd'),'required':[!![],'userId\x20is\x20required']}});function emit(_0x2d9ec7,_0x33270b,_0xc68431){logger[_0xa66f('0x13')](_0x2d9ec7,_0x33270b,JSON[_0xa66f('0x14')](_0xc68431));io['to'](_0x2d9ec7)[_0xa66f('0x15')](_0x33270b,_0xc68431);}function handleError(_0x58f239){return function(_0x4d5e31){console[_0xa66f('0x16')](_0xa66f('0x17'),_0x4d5e31,_0x4d5e31 instanceof RangeError);logger[_0xa66f('0x18')](_0x4d5e31[_0xa66f('0x19')]);if(_0x4d5e31 instanceof RangeError){if(_0x4d5e31['name']){delete _0x4d5e31[_0xa66f('0x1a')];}_0x58f239[_0xa66f('0x1b')](0x194)['send'](_0x4d5e31);}else{if(_0x4d5e31[_0xa66f('0x1a')]){delete _0x4d5e31['name'];}_0x58f239[_0xa66f('0x1b')](0x1f4)[_0xa66f('0x1c')](_0x4d5e31);}};}function checkError(){return function(_0x4a92dd){if(!_0x4a92dd){throw new RangeError('NotFound');}return _0x4a92dd;};}function respondWithRpcPromise(_0xc87a54,_0x5e6856){return new BPromise(function(_0x5b2cf0,_0x59f7aa){var _0x535359=amiClient;return _0x535359[_0xa66f('0x1d')](_0xc87a54,_0x5e6856)[_0xa66f('0x1e')](function(_0x1aeaf2){if(_0x1aeaf2['error']){if(_0x1aeaf2[_0xa66f('0x18')][_0xa66f('0x1f')]===0x1f4){return _0x59f7aa(_0x1aeaf2['error'][_0xa66f('0x20')]);}return _0x5b2cf0(_0x1aeaf2[_0xa66f('0x18')][_0xa66f('0x20')]);}else{_0x5b2cf0(_0x1aeaf2[_0xa66f('0x21')]);}})[_0xa66f('0x22')](function(_0x13aec8){_0x59f7aa(_0x13aec8);});});}function getAgent(_0x56b603){return db['User'][_0xa66f('0x23')]({'where':{'id':_0x56b603,'role':'agent'}})[_0xa66f('0x1e')](checkError());}function getAgentCheckSession(_0x278531,_0x2cf4c9){return new BPromise(function(_0x49e1b3,_0x161f53){var _0x4ca0a4=respondWithRpcPromise('VoiceChannels');var _0x4c7b82=getAgent(_0x278531);Promise[_0xa66f('0x24')]([_0x4ca0a4,_0x4c7b82])['then'](function(_0xd9f17e){var _0x7d07a4=_0xd9f17e[0x0];var _0x386c4d=_0xd9f17e[0x1];var _0x5f253f=_['filter'](_0x7d07a4[_0xa66f('0x25')],function(_0x416c25){return _0x416c25[_0xa66f('0x26')]==_0x386c4d['id']&&_0x416c25['sessionId']==_0x2cf4c9;});if(_0x5f253f[_0xa66f('0x27')]==0x1){_0x49e1b3(_0x386c4d);}else{_0x161f53(new RangeError('sessionId\x20'+_0x2cf4c9+_0xa66f('0x28')));}});});}exports[_0xa66f('0x29')]=function(_0x342dde,_0x36525b){logger[_0xa66f('0x13')](_0xa66f('0x2a'),_0x342dde['body']);var _0x3e5b98=originateValidation[_0xa66f('0x2b')](_0x342dde['body']);if(_0x3e5b98[_0xa66f('0x27')]>0x0){return _0x36525b[_0xa66f('0x1b')](0x190)['json'](_0x3e5b98);}var _0x49e47c=_0x342dde[_0xa66f('0x2c')][_0xa66f('0x2d')];var _0x42aa69=_0x342dde[_0xa66f('0x2c')][_0xa66f('0x2e')];var _0x422624=_0x342dde['body'][_0xa66f('0x2f')];var _0x16b375=_0x342dde[_0xa66f('0x2c')][_0xa66f('0x30')];return getAgent(_0x49e47c)['then'](function(_0x4d76bd){logger[_0xa66f('0x13')]('entityFound:',_0x4d76bd[_0xa66f('0x1a')]);emit(util[_0xa66f('0x31')](_0xa66f('0x32'),_0x4d76bd[_0xa66f('0x1a')]),_0xa66f('0x33'),{'callNumber':_0x42aa69,'callerId':_0x422624,'callbackUrl':_0x16b375});return _0x36525b[_0xa66f('0x1b')](0xc8)[_0xa66f('0x34')]({'error':![],'message':_0xa66f('0x35')});})[_0xa66f('0x22')](handleError(_0x36525b));};exports[_0xa66f('0x36')]=function(_0xdc06ac,_0x1c355f){logger['info'](_0xa66f('0x37'),_0xdc06ac[_0xa66f('0x2c')]);var _0x4d3e55=hangupValidation[_0xa66f('0x2b')](_0xdc06ac['body']);if(_0x4d3e55[_0xa66f('0x27')]>0x0){return _0x1c355f[_0xa66f('0x1b')](0x190)[_0xa66f('0x34')](_0x4d3e55);}var _0x2c185b=_0xdc06ac['body'][_0xa66f('0x2d')];var _0x17ad3b=_0xdc06ac[_0xa66f('0x2c')][_0xa66f('0x38')];return getAgent(_0x2c185b)['then'](function(_0x111e80){logger['info'](_0xa66f('0x39'),_0x111e80[_0xa66f('0x1a')]);emit(util[_0xa66f('0x31')](_0xa66f('0x32'),_0x111e80['name']),_0xa66f('0x3a'),{'sessionId':_0x17ad3b});return _0x1c355f['status'](0xc8)[_0xa66f('0x34')]({'error':![],'message':_0xa66f('0x3b')});})[_0xa66f('0x22')](handleError(_0x1c355f));};exports[_0xa66f('0x3c')]=function(_0x331ad8,_0x34b5eb){logger[_0xa66f('0x13')](_0xa66f('0x3d'),_0x331ad8[_0xa66f('0x2c')]);var _0x3ed4a0=answerValidation[_0xa66f('0x2b')](_0x331ad8[_0xa66f('0x2c')]);if(_0x3ed4a0[_0xa66f('0x27')]>0x0){return _0x34b5eb[_0xa66f('0x1b')](0x190)[_0xa66f('0x34')](_0x3ed4a0);}var _0x4f43e1=_0x331ad8[_0xa66f('0x2c')][_0xa66f('0x2d')];var _0x70f6da=_0x331ad8['body'][_0xa66f('0x38')];return getAgent(_0x4f43e1)['then'](function(_0x188f54){logger[_0xa66f('0x13')](_0xa66f('0x39'),_0x188f54['name']);emit(util['format'](_0xa66f('0x32'),_0x188f54[_0xa66f('0x1a')]),_0xa66f('0x3e'),{'sessionId':_0x70f6da});return _0x34b5eb[_0xa66f('0x1b')](0xc8)[_0xa66f('0x34')]({'error':![],'message':_0xa66f('0x3f')});})['catch'](handleError(_0x34b5eb));};exports[_0xa66f('0x40')]=function(_0x3bfe9d,_0x4d8008){logger['info'](_0xa66f('0x41'),_0x3bfe9d[_0xa66f('0x2c')]);var _0x31d7c0=holdValidation[_0xa66f('0x2b')](_0x3bfe9d[_0xa66f('0x2c')]);if(_0x31d7c0['length']>0x0){return _0x4d8008[_0xa66f('0x1b')](0x190)[_0xa66f('0x34')](_0x31d7c0);}var _0x3aa272=_0x3bfe9d[_0xa66f('0x2c')][_0xa66f('0x2d')];var _0x50564b=_0x3bfe9d[_0xa66f('0x2c')][_0xa66f('0x38')];return getAgent(_0x3aa272)[_0xa66f('0x1e')](function(_0x2dc004){logger[_0xa66f('0x13')]('entityFound:',_0x2dc004['name']);emit(util[_0xa66f('0x31')](_0xa66f('0x32'),_0x2dc004[_0xa66f('0x1a')]),_0xa66f('0x42'),{'sessionId':_0x50564b});return _0x4d8008[_0xa66f('0x1b')](0xc8)[_0xa66f('0x34')]({'error':![],'message':_0xa66f('0x43')});})[_0xa66f('0x22')](handleError(_0x4d8008));};exports['unhold']=function(_0x396f4c,_0x313075){logger[_0xa66f('0x13')](_0xa66f('0x44'),_0x396f4c[_0xa66f('0x2c')]);var _0x55e402=unholdValidation[_0xa66f('0x2b')](_0x396f4c[_0xa66f('0x2c')]);if(_0x55e402[_0xa66f('0x27')]>0x0){return _0x313075['status'](0x190)['json'](_0x55e402);}var _0x19018f=_0x396f4c[_0xa66f('0x2c')][_0xa66f('0x2d')];var _0x43efba=_0x396f4c[_0xa66f('0x2c')]['sessionId'];return getAgent(_0x19018f)[_0xa66f('0x1e')](function(_0x5852c5){logger[_0xa66f('0x13')](_0xa66f('0x39'),_0x5852c5[_0xa66f('0x1a')]);emit(util['format'](_0xa66f('0x32'),_0x5852c5['name']),_0xa66f('0x45'),{'sessionId':_0x43efba});return _0x313075[_0xa66f('0x1b')](0xc8)[_0xa66f('0x34')]({'error':![],'message':_0xa66f('0x46')});})[_0xa66f('0x22')](handleError(_0x313075));};exports[_0xa66f('0x47')]=function(_0x1f61bd,_0x5f3bb7){logger['info']('calls\x20fired:',_0x5f3bb7[_0xa66f('0x2c')]);var _0x334eca=callsValidation[_0xa66f('0x2b')](_0x1f61bd[_0xa66f('0x2c')]);if(_0x334eca[_0xa66f('0x27')]>0x0){return _0x5f3bb7[_0xa66f('0x1b')](0x190)[_0xa66f('0x34')](_0x334eca);}var _0x49e3e7=_0x1f61bd[_0xa66f('0x2c')]['userId'];var _0x34130a=respondWithRpcPromise(_0xa66f('0x48'));var _0x4dadc9=getAgent(_0x49e3e7);return Promise[_0xa66f('0x24')]([_0x34130a,_0x4dadc9])[_0xa66f('0x1e')](function(_0x3d04aa){var _0x585bca=_0x3d04aa[0x0];var _0x4dbefc=_0x3d04aa[0x1];var _0x5ac6fc=_[_0xa66f('0x49')](_0x585bca['rows'],function(_0x3cf529){return _0x3cf529['UserId']==_0x4dbefc['id'];});return _0x5f3bb7[_0xa66f('0x1b')](0xc8)[_0xa66f('0x34')]({'count':_0x5ac6fc['length'],'rows':_0x5ac6fc});})['catch'](handleError(_0x5f3bb7));};exports['conference']=function(_0x28e782,_0x10b99d){logger[_0xa66f('0x13')](_0xa66f('0x4a'),_0x28e782[_0xa66f('0x2c')]);var _0x4b8359=conferenceValidation[_0xa66f('0x2b')](_0x28e782[_0xa66f('0x2c')]);if(_0x4b8359['length']>0x0){return _0x10b99d['status'](0x190)[_0xa66f('0x34')](_0x4b8359);}var _0xb90573=_0x28e782[_0xa66f('0x2c')][_0xa66f('0x2d')];return getAgent(_0xb90573)[_0xa66f('0x1e')](function(_0x73f124){logger[_0xa66f('0x13')](_0xa66f('0x39'),_0x73f124[_0xa66f('0x1a')]);emit(util[_0xa66f('0x31')](_0xa66f('0x32'),_0x73f124[_0xa66f('0x1a')]),_0xa66f('0x4b'));return _0x10b99d['status'](0xc8)[_0xa66f('0x34')]({'error':![],'message':'conference\x20executed!'});})[_0xa66f('0x22')](handleError(_0x10b99d));};exports[_0xa66f('0x4c')]=function(_0x3b6ba9,_0xc8f303){logger[_0xa66f('0x13')](_0xa66f('0x4d'),_0x3b6ba9[_0xa66f('0x2c')]);var _0x1372ab=transferValidation[_0xa66f('0x2b')](_0x3b6ba9[_0xa66f('0x2c')]);if(_0x1372ab[_0xa66f('0x27')]>0x0){return _0xc8f303[_0xa66f('0x1b')](0x190)[_0xa66f('0x34')](_0x1372ab);}var _0x1d97bf=_0x3b6ba9['body'][_0xa66f('0x2d')];var _0xca003d=_0x3b6ba9[_0xa66f('0x2c')][_0xa66f('0x38')];var _0x5e5d1c=_0x3b6ba9[_0xa66f('0x2c')][_0xa66f('0x4e')];return getAgent(_0x1d97bf)['then'](function(_0x53d290){logger[_0xa66f('0x13')](_0xa66f('0x39'),_0x53d290[_0xa66f('0x1a')]);emit(util[_0xa66f('0x31')]('user:%s',_0x53d290[_0xa66f('0x1a')]),_0xa66f('0x4f'),{'sessionId':_0xca003d,'transferNumber':_0x5e5d1c});return _0xc8f303[_0xa66f('0x1b')](0xc8)[_0xa66f('0x34')]({'error':![],'message':_0xa66f('0x50')});})[_0xa66f('0x22')](handleError(_0xc8f303));}; \ No newline at end of file diff --git a/server/api/whatsappAccount/index.js b/server/api/whatsappAccount/index.js index fdec0fd..8761263 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 _0xf036=['getApplications','post','create','addDisposition','addAnswer','addAgents','addApplications','/:id/notify','notify','/:id/send','send','put','update','delete','destroy','removeDispositions','removeAnswers','removeAgents','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../config/environment','./whatsappAccount.controller','get','index','/describe','isAuthenticated','describe','/:id','/:id/dispositions','/:id/canned_answers','/:id/users','/:id/applications'];(function(_0x24259d,_0x64a194){var _0x5a701=function(_0x204516){while(--_0x204516){_0x24259d['push'](_0x24259d['shift']());}};_0x5a701(++_0x64a194);}(_0xf036,0x1c0));var _0x6f03=function(_0x41dd18,_0x2d8885){_0x41dd18=_0x41dd18-0x0;var _0x5a2d2f=_0xf036[_0x41dd18];return _0x5a2d2f;};'use strict';var multer=require(_0x6f03('0x0'));var util=require(_0x6f03('0x1'));var path=require(_0x6f03('0x2'));var timeout=require(_0x6f03('0x3'));var express=require(_0x6f03('0x4'));var router=express[_0x6f03('0x5')]();var fs_extra=require(_0x6f03('0x6'));var auth=require(_0x6f03('0x7'));var interaction=require('../../components/interaction/service');var config=require(_0x6f03('0x8'));var controller=require(_0x6f03('0x9'));router[_0x6f03('0xa')]('/',auth['isAuthenticated'](),controller[_0x6f03('0xb')]);router[_0x6f03('0xa')](_0x6f03('0xc'),auth[_0x6f03('0xd')](),controller[_0x6f03('0xe')]);router['get'](_0x6f03('0xf'),auth['isAuthenticated'](),controller['show']);router[_0x6f03('0xa')](_0x6f03('0x10'),auth[_0x6f03('0xd')](),controller['getDispositions']);router['get'](_0x6f03('0x11'),auth[_0x6f03('0xd')](),controller['getAnswers']);router[_0x6f03('0xa')](_0x6f03('0x12'),auth[_0x6f03('0xd')](),controller['getAgents']);router[_0x6f03('0xa')](_0x6f03('0x13'),auth[_0x6f03('0xd')](),controller[_0x6f03('0x14')]);router[_0x6f03('0x15')]('/',auth[_0x6f03('0xd')](),controller[_0x6f03('0x16')]);router[_0x6f03('0x15')](_0x6f03('0x10'),auth['isAuthenticated'](),controller[_0x6f03('0x17')]);router[_0x6f03('0x15')](_0x6f03('0x11'),auth[_0x6f03('0xd')](),controller[_0x6f03('0x18')]);router['post'](_0x6f03('0x12'),auth[_0x6f03('0xd')](),controller[_0x6f03('0x19')]);router['post'](_0x6f03('0x13'),auth[_0x6f03('0xd')](),controller[_0x6f03('0x1a')]);router[_0x6f03('0x15')](_0x6f03('0x1b'),controller[_0x6f03('0x1c')]);router[_0x6f03('0x15')](_0x6f03('0x1d'),auth[_0x6f03('0xd')](),controller[_0x6f03('0x1e')]);router[_0x6f03('0x1f')]('/:id',auth[_0x6f03('0xd')](),controller[_0x6f03('0x20')]);router[_0x6f03('0x21')](_0x6f03('0xf'),auth[_0x6f03('0xd')](),controller[_0x6f03('0x22')]);router['delete'](_0x6f03('0x10'),auth[_0x6f03('0xd')](),controller[_0x6f03('0x23')]);router[_0x6f03('0x21')](_0x6f03('0x11'),auth['isAuthenticated'](),controller[_0x6f03('0x24')]);router['delete'](_0x6f03('0x12'),auth[_0x6f03('0xd')](),controller[_0x6f03('0x25')]);module[_0x6f03('0x26')]=router; \ No newline at end of file +var _0x0870=['/:id','show','/:id/dispositions','getDispositions','/:id/canned_answers','getAnswers','/:id/users','getAgents','/:id/applications','getApplications','post','create','addDisposition','addAnswer','addAgents','addApplications','/:id/notify','notify','/:id/send','put','update','destroy','delete','removeAnswers','removeAgents','exports','multer','util','path','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./whatsappAccount.controller','get','isAuthenticated','index'];(function(_0x5ce15c,_0x19c917){var _0x36e4f5=function(_0x50fa90){while(--_0x50fa90){_0x5ce15c['push'](_0x5ce15c['shift']());}};_0x36e4f5(++_0x19c917);}(_0x0870,0xb2));var _0x0087=function(_0x5c4436,_0x5a1f3c){_0x5c4436=_0x5c4436-0x0;var _0x5f4f1=_0x0870[_0x5c4436];return _0x5f4f1;};'use strict';var multer=require(_0x0087('0x0'));var util=require(_0x0087('0x1'));var path=require(_0x0087('0x2'));var timeout=require('connect-timeout');var express=require(_0x0087('0x3'));var router=express[_0x0087('0x4')]();var fs_extra=require(_0x0087('0x5'));var auth=require(_0x0087('0x6'));var interaction=require(_0x0087('0x7'));var config=require('../../config/environment');var controller=require(_0x0087('0x8'));router[_0x0087('0x9')]('/',auth[_0x0087('0xa')](),controller[_0x0087('0xb')]);router['get']('/describe',auth[_0x0087('0xa')](),controller['describe']);router[_0x0087('0x9')](_0x0087('0xc'),auth[_0x0087('0xa')](),controller[_0x0087('0xd')]);router['get'](_0x0087('0xe'),auth[_0x0087('0xa')](),controller[_0x0087('0xf')]);router[_0x0087('0x9')](_0x0087('0x10'),auth[_0x0087('0xa')](),controller[_0x0087('0x11')]);router[_0x0087('0x9')](_0x0087('0x12'),auth[_0x0087('0xa')](),controller[_0x0087('0x13')]);router[_0x0087('0x9')](_0x0087('0x14'),auth[_0x0087('0xa')](),controller[_0x0087('0x15')]);router[_0x0087('0x16')]('/',auth[_0x0087('0xa')](),controller[_0x0087('0x17')]);router[_0x0087('0x16')](_0x0087('0xe'),auth[_0x0087('0xa')](),controller[_0x0087('0x18')]);router[_0x0087('0x16')](_0x0087('0x10'),auth[_0x0087('0xa')](),controller[_0x0087('0x19')]);router[_0x0087('0x16')]('/:id/users',auth['isAuthenticated'](),controller[_0x0087('0x1a')]);router[_0x0087('0x16')]('/:id/applications',auth[_0x0087('0xa')](),controller[_0x0087('0x1b')]);router['post'](_0x0087('0x1c'),controller[_0x0087('0x1d')]);router[_0x0087('0x16')](_0x0087('0x1e'),auth[_0x0087('0xa')](),controller['send']);router[_0x0087('0x1f')](_0x0087('0xc'),auth[_0x0087('0xa')](),controller[_0x0087('0x20')]);router['delete'](_0x0087('0xc'),auth[_0x0087('0xa')](),controller[_0x0087('0x21')]);router['delete'](_0x0087('0xe'),auth['isAuthenticated'](),controller['removeDispositions']);router[_0x0087('0x22')](_0x0087('0x10'),auth[_0x0087('0xa')](),controller[_0x0087('0x23')]);router[_0x0087('0x22')](_0x0087('0x12'),auth[_0x0087('0xa')](),controller[_0x0087('0x24')]);module[_0x0087('0x25')]=router; \ No newline at end of file diff --git a/server/api/whatsappAccount/whatsappAccount.attributes.js b/server/api/whatsappAccount/whatsappAccount.attributes.js index f637a1c..7ffb5c9 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 _0xcedc=['name','STRING','generate','ENUM','twilio','sinch','TEXT','Account:\x20{{account.name}}
{{#queue}}Queue:\x20{{queue.name}}
{{/queue}}From\x20:\x20{{from}}','BOOLEAN','INTEGER','Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','setDataValue','mandatoryDispositionPauseId','sequelize','randomstring','exports'];(function(_0x52b23b,_0x378054){var _0x1c2126=function(_0xf21258){while(--_0xf21258){_0x52b23b['push'](_0x52b23b['shift']());}};_0x1c2126(++_0x378054);}(_0xcedc,0x8d));var _0xcced=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0xcedc[_0x14add3];return _0x4a174f;};'use strict';var Sequelize=require(_0xcced('0x0'));var rs=require(_0xcced('0x1'));module[_0xcced('0x2')]={'name':{'type':Sequelize['STRING'],'unique':_0xcced('0x3'),'allowNull':![]},'key':{'type':Sequelize[_0xcced('0x4')],'allowNull':![]},'remote':{'type':Sequelize['STRING'],'allowNull':![]},'token':{'type':Sequelize['STRING'],'defaultValue':function(){return rs[_0xcced('0x5')]();}},'phone':{'type':Sequelize[_0xcced('0x4')]},'type':{'type':Sequelize[_0xcced('0x6')](_0xcced('0x7'),_0xcced('0x8'))},'accountSid':{'type':Sequelize[_0xcced('0x4')]},'baseUrl':{'type':Sequelize[_0xcced('0x4')]},'authToken':{'type':Sequelize[_0xcced('0x4')]},'notificationTemplate':{'type':Sequelize[_0xcced('0x9')],'defaultValue':function(){return _0xcced('0xa');}},'notificationSound':{'type':Sequelize[_0xcced('0xb')],'defaultValue':![]},'notificationShake':{'type':Sequelize[_0xcced('0xb')],'defaultValue':![]},'waitForTheAssignedAgent':{'type':Sequelize[_0xcced('0xc')],'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[_0xcced('0xc')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize[_0xcced('0xb')],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize[_0xcced('0xc')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'mandatoryDispositionPauseId':{'type':Sequelize['INTEGER'],'comment':'Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled'},'mandatoryDisposition':{'type':Sequelize['BOOLEAN'],'defaultValue':![],'comment':_0xcced('0xd'),'set':function(_0x46bfd0){if(!_0x46bfd0){this[_0xcced('0xe')](_0xcced('0xf'),null);}this[_0xcced('0xe')]('mandatoryDisposition',_0x46bfd0);}},'description':{'type':Sequelize[_0xcced('0x4')]}}; \ No newline at end of file +var _0x3828=['name','generate','ENUM','twilio','sinch','TEXT','Account:\x20{{account.name}}
{{#queue}}Queue:\x20{{queue.name}}
{{/queue}}From\x20:\x20{{from}}','BOOLEAN','INTEGER','Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','setDataValue','mandatoryDisposition','randomstring','exports','STRING'];(function(_0x7b173,_0x539d7f){var _0x1c598c=function(_0xe1e1e0){while(--_0xe1e1e0){_0x7b173['push'](_0x7b173['shift']());}};_0x1c598c(++_0x539d7f);}(_0x3828,0x138));var _0x8382=function(_0x565c49,_0x54acd0){_0x565c49=_0x565c49-0x0;var _0x20ca34=_0x3828[_0x565c49];return _0x20ca34;};'use strict';var Sequelize=require('sequelize');var rs=require(_0x8382('0x0'));module[_0x8382('0x1')]={'name':{'type':Sequelize[_0x8382('0x2')],'unique':_0x8382('0x3'),'allowNull':![]},'key':{'type':Sequelize[_0x8382('0x2')],'allowNull':![]},'remote':{'type':Sequelize['STRING'],'allowNull':![]},'token':{'type':Sequelize[_0x8382('0x2')],'defaultValue':function(){return rs[_0x8382('0x4')]();}},'phone':{'type':Sequelize[_0x8382('0x2')]},'type':{'type':Sequelize[_0x8382('0x5')](_0x8382('0x6'),_0x8382('0x7'))},'accountSid':{'type':Sequelize[_0x8382('0x2')]},'baseUrl':{'type':Sequelize[_0x8382('0x2')]},'authToken':{'type':Sequelize[_0x8382('0x2')]},'notificationTemplate':{'type':Sequelize[_0x8382('0x8')],'defaultValue':function(){return _0x8382('0x9');}},'notificationSound':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'notificationShake':{'type':Sequelize[_0x8382('0xa')],'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['BOOLEAN'],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize[_0x8382('0xa')],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'mandatoryDispositionPauseId':{'type':Sequelize[_0x8382('0xb')],'comment':'Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled'},'mandatoryDisposition':{'type':Sequelize[_0x8382('0xa')],'defaultValue':![],'comment':_0x8382('0xc'),'set':function(_0x5c2b2c){if(!_0x5c2b2c){this['setDataValue']('mandatoryDispositionPauseId',null);}this[_0x8382('0xd')](_0x8382('0xe'),_0x5c2b2c);}},'description':{'type':Sequelize[_0x8382('0x2')]}}; \ No newline at end of file diff --git a/server/api/whatsappAccount/whatsappAccount.controller.js b/server/api/whatsappAccount/whatsappAccount.controller.js index ebc5372..0eb508c 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 _0x5610=['CmContact','ValidationError','no\x20available\x20attributes','difference','createdAt','updatedAt','CompanyId','ListId','from','replace','whatsapp:','messageId','MessageSid','message_id','isNil','Sequelize','from\x20is\x20mandatory','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','Contacts','DESC','list','contact','WhatsappInteraction','spread','interaction','created','autoclose','applications','close','*,*,*,*','ContactId','UserId','unshift','waitForTheAssignedAgent','queueId','WhatsappQueue','queue','Start','startRouting','receiveMessage','entity\x20found','WhatsappAccount,\x20%s,\x20%s,\x20%s,\x20%s','twilio','Content-Type','\x0a','to\x20is\x20mandatory','CmList','List','Messages','WhatsappMessage','dataValues','push','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','mustache','util','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/environment','redis','defaults','localhost','./whatsappAccount.socket','register','jayson/promise','http','then','info','WhatsappAccount,\x20%s,\x20%s','request\x20sent','debug','WhatsappAccount,\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','get','WhatsappAccounts','stack','name','index','mandatoryDispositionPause','map','WhatsappAccount','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','fields','attributes','length','nolimit','order','sort','where','filter','merge','options','includeAll','findAll','rows','show','params','Pause','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','find','userProfileId','autoAssociation','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','destroy','describe','addDisposition','Disposition','getDispositions','findOne','include','removeDispositions','ids','addAnswer','WhatsappAccountId','getAnswers','CannedAnswer','hasOwnProperty','pick','removeAnswers','addAgents','omit','emit','userWhatsappAccount:save','removeAgents','userWhatsappAccount:remove','getAgents','User','sequelize','transaction','Transaction','ISOLATION_LEVELS','READ_COMMITTED','WhatsappApplication','bulkCreate','findAndCountAll','priority','finally','send','getApplications','notify','whatsapp','Applications','account','sinch','statuses','state','read','timestamp','asc'];(function(_0x2f9f2b,_0x2de7ed){var _0x497d69=function(_0x1d2960){while(--_0x1d2960){_0x2f9f2b['push'](_0x2f9f2b['shift']());}};_0x497d69(++_0x2de7ed);}(_0x5610,0x100));var _0x0561=function(_0x3d006e,_0x5e7af2){_0x3d006e=_0x3d006e-0x0;var _0x19b490=_0x5610[_0x3d006e];return _0x19b490;};'use strict';var emlformat=require(_0x0561('0x0'));var rimraf=require(_0x0561('0x1'));var zipdir=require(_0x0561('0x2'));var jsonpatch=require(_0x0561('0x3'));var rp=require(_0x0561('0x4'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0x0561('0x5'));var util=require(_0x0561('0x6'));var path=require('path');var sox=require('sox');var csv=require(_0x0561('0x7'));var ejs=require(_0x0561('0x8'));var fs=require('fs');var fs_extra=require(_0x0561('0x9'));var _=require(_0x0561('0xa'));var squel=require(_0x0561('0xb'));var crypto=require(_0x0561('0xc'));var jsforce=require(_0x0561('0xd'));var deskjs=require(_0x0561('0xe'));var toCsv=require(_0x0561('0x7'));var querystring=require(_0x0561('0xf'));var Papa=require(_0x0561('0x10'));var Redis=require('ioredis');var authService=require(_0x0561('0x11'));var qs=require(_0x0561('0x12'));var as=require(_0x0561('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x0561('0x14'))(_0x0561('0x15'));var utils=require('../../config/utils');var config=require(_0x0561('0x16'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];config[_0x0561('0x17')]=_[_0x0561('0x18')](config[_0x0561('0x17')],{'host':_0x0561('0x19'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x0561('0x17')]));require(_0x0561('0x1a'))[_0x0561('0x1b')](socket);var jayson=require(_0x0561('0x1c'));var client=jayson['client'][_0x0561('0x1d')]({'port':0x232c});function respondWithRpcPromise(_0x5188b2,_0x38a5ba,_0xdb29b1,_0x198bbe){return new BPromise(function(_0x4c2dd4,_0x3fdc54){var _0x22ba73=_0x198bbe||client;return _0x22ba73['request'](_0x5188b2,_0xdb29b1)[_0x0561('0x1e')](function(_0x5386db){logger[_0x0561('0x1f')](_0x0561('0x20'),_0x38a5ba,_0x0561('0x21'));logger[_0x0561('0x22')](_0x0561('0x23'),_0x38a5ba,'request\x20sent',JSON[_0x0561('0x24')](_0x5386db));if(_0x5386db[_0x0561('0x25')]){if(_0x5386db['error'][_0x0561('0x26')]===0x1f4){logger[_0x0561('0x25')](_0x0561('0x20'),_0x38a5ba,_0x5386db[_0x0561('0x25')][_0x0561('0x27')]);return _0x3fdc54(_0x5386db[_0x0561('0x25')][_0x0561('0x27')]);}logger['error'](_0x0561('0x20'),_0x38a5ba,_0x5386db[_0x0561('0x25')][_0x0561('0x27')]);return _0x4c2dd4(_0x5386db[_0x0561('0x25')][_0x0561('0x27')]);}else{logger['info'](_0x0561('0x20'),_0x38a5ba,_0x0561('0x21'));_0x4c2dd4(_0x5386db['result'][_0x0561('0x27')]);}})[_0x0561('0x28')](function(_0x543a1a){logger[_0x0561('0x25')](_0x0561('0x20'),_0x38a5ba,_0x543a1a);_0x3fdc54(_0x543a1a);});});}function respondWithStatusCode(_0xe05b8c,_0x4657bc){_0x4657bc=_0x4657bc||0xcc;return function(_0x584315){if(_0x584315){return _0xe05b8c[_0x0561('0x29')](_0x4657bc);}return _0xe05b8c[_0x0561('0x2a')](_0x4657bc)[_0x0561('0x2b')]();};}function respondWithResult(_0x2c35d3,_0x3ccd61){_0x3ccd61=_0x3ccd61||0xc8;return function(_0x303d3b){if(_0x303d3b){return _0x2c35d3[_0x0561('0x2a')](_0x3ccd61)[_0x0561('0x2c')](_0x303d3b);}};}function respondWithFilteredResult(_0x426e8d,_0x41525b){return function(_0xea6cc3){if(_0xea6cc3){var _0x4cd50c=typeof _0x41525b[_0x0561('0x2d')]===_0x0561('0x2e')&&typeof _0x41525b[_0x0561('0x2f')]==='undefined';var _0x506f29=_0xea6cc3[_0x0561('0x30')];var _0xfd59bf=_0x4cd50c?0x0:_0x41525b[_0x0561('0x2d')];var _0x2aff78=_0x4cd50c?_0xea6cc3[_0x0561('0x30')]:_0x41525b[_0x0561('0x2d')]+_0x41525b[_0x0561('0x2f')];var _0x52b74a;if(_0x2aff78>=_0x506f29){_0x2aff78=_0x506f29;_0x52b74a=0xc8;}else{_0x52b74a=0xce;}_0x426e8d[_0x0561('0x2a')](_0x52b74a);return _0x426e8d[_0x0561('0x31')](_0x0561('0x32'),_0xfd59bf+'-'+_0x2aff78+'/'+_0x506f29)['json'](_0xea6cc3);}return null;};}function patchUpdates(_0x2d5145){return function(_0x174812){try{jsonpatch[_0x0561('0x33')](_0x174812,_0x2d5145,!![]);}catch(_0x507e64){return BPromise[_0x0561('0x34')](_0x507e64);}return _0x174812[_0x0561('0x35')]();};}function saveUpdates(_0x46ec38,_0x28ec35){return function(_0xf3ca9c){if(_0xf3ca9c){return _0xf3ca9c['update'](_0x46ec38)[_0x0561('0x1e')](function(_0x2c388e){return _0x2c388e;});}return null;};}function removeEntity(_0x29a221,_0x162236){return function(_0x102188){if(_0x102188){return _0x102188['destroy']()[_0x0561('0x1e')](function(){var _0x574c08=_0x102188[_0x0561('0x36')]({'plain':!![]});var _0x37808c=_0x0561('0x37');return db['UserProfileResource']['destroy']({'where':{'type':_0x37808c,'resourceId':_0x574c08['id']}})['then'](function(){return _0x102188;});})[_0x0561('0x1e')](function(){_0x29a221[_0x0561('0x2a')](0xcc)[_0x0561('0x2b')]();});}};}function handleEntityNotFound(_0x1bd194,_0x536769){return function(_0x5dde38){if(!_0x5dde38){_0x1bd194[_0x0561('0x29')](0x194);}return _0x5dde38;};}function handleError(_0x216ea4,_0x9e1708){_0x9e1708=_0x9e1708||0x1f4;return function(_0x5c07b9){logger[_0x0561('0x25')](_0x5c07b9[_0x0561('0x38')]);if(_0x5c07b9[_0x0561('0x39')]){delete _0x5c07b9[_0x0561('0x39')];}_0x216ea4['status'](_0x9e1708)['send'](_0x5c07b9);};}exports[_0x0561('0x3a')]=function(_0x57444e,_0x238024){var _0x24ff8e={'include':[{'model':db['Pause'],'as':_0x0561('0x3b')}]},_0x469768={},_0x492597={'count':0x0,'rows':[]};var _0x467ef8=_[_0x0561('0x3c')](db[_0x0561('0x3d')][_0x0561('0x3e')],function(_0x92ca59){return{'name':_0x92ca59[_0x0561('0x3f')],'type':_0x92ca59[_0x0561('0x40')][_0x0561('0x41')]};});_0x469768[_0x0561('0x42')]=_[_0x0561('0x3c')](_0x467ef8,_0x0561('0x39'));_0x469768[_0x0561('0x43')]=_[_0x0561('0x44')](_0x57444e[_0x0561('0x43')]);_0x469768[_0x0561('0x45')]=_[_0x0561('0x46')](_0x469768[_0x0561('0x42')],_0x469768[_0x0561('0x43')]);_0x24ff8e['attributes']=_[_0x0561('0x46')](_0x469768['model'],qs[_0x0561('0x47')](_0x57444e[_0x0561('0x43')][_0x0561('0x47')]));_0x24ff8e[_0x0561('0x48')]=_0x24ff8e[_0x0561('0x48')][_0x0561('0x49')]?_0x24ff8e[_0x0561('0x48')]:_0x469768[_0x0561('0x42')];if(!_0x57444e[_0x0561('0x43')]['hasOwnProperty'](_0x0561('0x4a'))){_0x24ff8e['limit']=qs['limit'](_0x57444e[_0x0561('0x43')][_0x0561('0x2f')]);_0x24ff8e['offset']=qs[_0x0561('0x2d')](_0x57444e[_0x0561('0x43')][_0x0561('0x2d')]);}_0x24ff8e[_0x0561('0x4b')]=qs[_0x0561('0x4c')](_0x57444e['query'][_0x0561('0x4c')]);_0x24ff8e[_0x0561('0x4d')]=qs['filters'](_['pick'](_0x57444e[_0x0561('0x43')],_0x469768[_0x0561('0x45')]),_0x467ef8);if(_0x57444e[_0x0561('0x43')][_0x0561('0x4e')]){_0x24ff8e[_0x0561('0x4d')]=_[_0x0561('0x4f')](_0x24ff8e[_0x0561('0x4d')],{'$or':_[_0x0561('0x3c')](_0x467ef8,function(_0x3cd840){if(_0x3cd840[_0x0561('0x40')]!=='VIRTUAL'){var _0x3fd190={};_0x3fd190[_0x3cd840[_0x0561('0x39')]]={'$like':'%'+_0x57444e[_0x0561('0x43')][_0x0561('0x4e')]+'%'};return _0x3fd190;}})});}_0x24ff8e=_[_0x0561('0x4f')]({},_0x24ff8e,_0x57444e[_0x0561('0x50')]);var _0x20568a={'where':_0x24ff8e[_0x0561('0x4d')]};return db[_0x0561('0x3d')][_0x0561('0x30')](_0x20568a)[_0x0561('0x1e')](function(_0x1313bd){_0x492597[_0x0561('0x30')]=_0x1313bd;if(_0x57444e[_0x0561('0x43')][_0x0561('0x51')]){_0x24ff8e['include']=[{'all':!![]}];}return db[_0x0561('0x3d')][_0x0561('0x52')](_0x24ff8e);})['then'](function(_0x52745c){_0x492597[_0x0561('0x53')]=_0x52745c;return _0x492597;})['then'](respondWithFilteredResult(_0x238024,_0x24ff8e))[_0x0561('0x28')](handleError(_0x238024,null));};exports[_0x0561('0x54')]=function(_0x18c85b,_0x3d5b37){var _0xe09f24={'raw':![],'where':{'id':_0x18c85b[_0x0561('0x55')]['id']},'include':[{'model':db[_0x0561('0x56')],'as':_0x0561('0x3b')}]},_0x4f149d={};_0x4f149d[_0x0561('0x42')]=_[_0x0561('0x44')](db[_0x0561('0x3d')][_0x0561('0x3e')]);_0x4f149d['query']=_['keys'](_0x18c85b['query']);_0x4f149d[_0x0561('0x45')]=_[_0x0561('0x46')](_0x4f149d[_0x0561('0x42')],_0x4f149d[_0x0561('0x43')]);_0xe09f24[_0x0561('0x48')]=_[_0x0561('0x46')](_0x4f149d[_0x0561('0x42')],qs[_0x0561('0x47')](_0x18c85b[_0x0561('0x43')][_0x0561('0x47')]));_0xe09f24[_0x0561('0x48')]=_0xe09f24['attributes'][_0x0561('0x49')]?_0xe09f24[_0x0561('0x48')]:_0x4f149d['model'];if(_0x18c85b[_0x0561('0x43')][_0x0561('0x51')]){_0xe09f24['include']=[{'all':!![]}];}_0xe09f24=_[_0x0561('0x4f')]({},_0xe09f24,_0x18c85b['options']);return db[_0x0561('0x3d')]['find'](_0xe09f24)[_0x0561('0x1e')](handleEntityNotFound(_0x3d5b37,null))[_0x0561('0x1e')](respondWithResult(_0x3d5b37,null))[_0x0561('0x28')](handleError(_0x3d5b37,null));};exports[_0x0561('0x57')]=function(_0x261711,_0x1d35c0){return db[_0x0561('0x3d')][_0x0561('0x57')](_0x261711[_0x0561('0x58')],{})[_0x0561('0x1e')](function(_0x358502){var _0x22ddc6=_0x261711[_0x0561('0x59')][_0x0561('0x36')]({'plain':!![]});if(!_0x22ddc6)throw new Error(_0x0561('0x5a'));if(_0x22ddc6[_0x0561('0x5b')]===_0x0561('0x59')){var _0xe159fb=_0x358502[_0x0561('0x36')]({'plain':!![]});var _0x245732=_0x0561('0x37');return db['UserProfileSection'][_0x0561('0x5c')]({'where':{'name':_0x245732,'userProfileId':_0x22ddc6[_0x0561('0x5d')]},'raw':!![]})[_0x0561('0x1e')](function(_0x2e7387){if(_0x2e7387&&_0x2e7387[_0x0561('0x5e')]===0x0){return db[_0x0561('0x5f')][_0x0561('0x57')]({'name':_0xe159fb[_0x0561('0x39')],'resourceId':_0xe159fb['id'],'type':_0x2e7387[_0x0561('0x39')],'sectionId':_0x2e7387['id']},{})[_0x0561('0x1e')](function(){return _0x358502;});}else{return _0x358502;}})[_0x0561('0x28')](function(_0x48cd03){logger[_0x0561('0x25')](_0x0561('0x60'),_0x48cd03);throw _0x48cd03;});}return _0x358502;})[_0x0561('0x1e')](respondWithResult(_0x1d35c0,0xc9))[_0x0561('0x28')](handleError(_0x1d35c0,null));};exports[_0x0561('0x61')]=function(_0x3ada87,_0x1d29c5){if(_0x3ada87[_0x0561('0x58')]['id']){delete _0x3ada87[_0x0561('0x58')]['id'];}return db[_0x0561('0x3d')][_0x0561('0x5c')]({'where':{'id':_0x3ada87[_0x0561('0x55')]['id']},'include':[{'model':db[_0x0561('0x56')],'as':'mandatoryDispositionPause'}]})[_0x0561('0x1e')](handleEntityNotFound(_0x1d29c5,null))[_0x0561('0x1e')](saveUpdates(_0x3ada87['body'],null))[_0x0561('0x1e')](respondWithResult(_0x1d29c5,null))['catch'](handleError(_0x1d29c5,null));};exports[_0x0561('0x62')]=function(_0x49e36f,_0x4ca6bc){return db[_0x0561('0x3d')][_0x0561('0x5c')]({'where':{'id':_0x49e36f[_0x0561('0x55')]['id']}})[_0x0561('0x1e')](handleEntityNotFound(_0x4ca6bc,null))[_0x0561('0x1e')](removeEntity(_0x4ca6bc,null))['catch'](handleError(_0x4ca6bc,null));};exports[_0x0561('0x63')]=function(_0x157f03,_0x43195d){return db[_0x0561('0x3d')][_0x0561('0x63')]()[_0x0561('0x1e')](respondWithResult(_0x43195d,null))[_0x0561('0x28')](handleError(_0x43195d,null));};exports[_0x0561('0x64')]=function(_0x20c610,_0x554d27,_0x1c3456){if(_0x20c610[_0x0561('0x58')]['id']){delete _0x20c610[_0x0561('0x58')]['id'];}return db[_0x0561('0x3d')][_0x0561('0x5c')]({'where':{'id':_0x20c610[_0x0561('0x55')]['id']}})[_0x0561('0x1e')](handleEntityNotFound(_0x554d27,null))[_0x0561('0x1e')](function(_0xa5fb44){if(_0xa5fb44){_0x20c610[_0x0561('0x58')]['WhatsappAccountId']=_0xa5fb44['id'];return db[_0x0561('0x65')]['create'](_0x20c610[_0x0561('0x58')]);}})[_0x0561('0x1e')](respondWithResult(_0x554d27,null))[_0x0561('0x28')](handleError(_0x554d27,null));};exports[_0x0561('0x66')]=function(_0x288086,_0x5ae938,_0x4b4d3c){var _0x589434={'raw':![],'where':{}};var _0x2e90e8={};var _0x1108dd={'count':0x0,'rows':[]};return db['WhatsappAccount'][_0x0561('0x67')]({'where':{'id':_0x288086[_0x0561('0x55')]['id']}})[_0x0561('0x1e')](handleEntityNotFound(_0x5ae938,null))[_0x0561('0x1e')](function(_0x4b838b){if(_0x4b838b){_0x2e90e8[_0x0561('0x42')]=_[_0x0561('0x44')](db[_0x0561('0x65')][_0x0561('0x3e')]);_0x2e90e8[_0x0561('0x43')]=_[_0x0561('0x44')](_0x288086[_0x0561('0x43')]);_0x2e90e8[_0x0561('0x45')]=_['intersection'](_0x2e90e8['model'],_0x2e90e8[_0x0561('0x43')]);_0x589434['attributes']=_[_0x0561('0x46')](_0x2e90e8[_0x0561('0x42')],qs[_0x0561('0x47')](_0x288086[_0x0561('0x43')][_0x0561('0x47')]));_0x589434[_0x0561('0x48')]=_0x589434[_0x0561('0x48')]['length']?_0x589434[_0x0561('0x48')]:_0x2e90e8[_0x0561('0x42')];if(!_0x288086[_0x0561('0x43')]['hasOwnProperty'](_0x0561('0x4a'))){_0x589434[_0x0561('0x2f')]=qs[_0x0561('0x2f')](_0x288086['query'][_0x0561('0x2f')]);_0x589434[_0x0561('0x2d')]=qs['offset'](_0x288086[_0x0561('0x43')][_0x0561('0x2d')]);}_0x589434[_0x0561('0x4b')]=qs[_0x0561('0x4c')](_0x288086[_0x0561('0x43')][_0x0561('0x4c')]);_0x589434[_0x0561('0x4d')]=qs[_0x0561('0x45')](_['pick'](_0x288086[_0x0561('0x43')],_0x2e90e8[_0x0561('0x45')]));_0x589434['where']['WhatsappAccountId']=_0x4b838b['id'];if(_0x288086[_0x0561('0x43')][_0x0561('0x4e')]){_0x589434[_0x0561('0x4d')]=_[_0x0561('0x4f')](_0x589434[_0x0561('0x4d')],{'$or':_['map'](_0x589434['attributes'],function(_0x32fb8d){var _0x20d91={};_0x20d91[_0x32fb8d]={'$like':'%'+_0x288086[_0x0561('0x43')][_0x0561('0x4e')]+'%'};return _0x20d91;})});}_0x589434=_[_0x0561('0x4f')]({},_0x589434,_0x288086['options']);return db[_0x0561('0x65')][_0x0561('0x30')]({'where':_0x589434['where']})[_0x0561('0x1e')](function(_0x533809){_0x1108dd[_0x0561('0x30')]=_0x533809;if(_0x288086[_0x0561('0x43')][_0x0561('0x51')]){_0x589434[_0x0561('0x68')]=[{'all':!![]}];}return db[_0x0561('0x65')][_0x0561('0x52')](_0x589434);})['then'](function(_0x56d3c5){_0x1108dd[_0x0561('0x53')]=_0x56d3c5;return _0x1108dd;});}})[_0x0561('0x1e')](respondWithFilteredResult(_0x5ae938,_0x589434))['catch'](handleError(_0x5ae938,null));};exports[_0x0561('0x69')]=function(_0x47920e,_0x2590da,_0xbbd357){return db['WhatsappAccount'][_0x0561('0x5c')]({'where':{'id':_0x47920e[_0x0561('0x55')]['id']}})[_0x0561('0x1e')](handleEntityNotFound(_0x2590da,null))['then'](function(_0x32a7f6){if(_0x32a7f6){return _0x32a7f6[_0x0561('0x69')](_0x47920e[_0x0561('0x43')][_0x0561('0x6a')]);}})[_0x0561('0x1e')](respondWithStatusCode(_0x2590da,null))[_0x0561('0x28')](handleError(_0x2590da,null));};exports[_0x0561('0x6b')]=function(_0x515bb3,_0x50883a,_0x27203e){if(_0x515bb3[_0x0561('0x58')]['id']){delete _0x515bb3[_0x0561('0x58')]['id'];}return db[_0x0561('0x3d')]['find']({'where':{'id':_0x515bb3['params']['id']}})[_0x0561('0x1e')](handleEntityNotFound(_0x50883a,null))[_0x0561('0x1e')](function(_0xb88875){if(_0xb88875){_0x515bb3['body'][_0x0561('0x6c')]=_0xb88875['id'];return db['CannedAnswer'][_0x0561('0x57')](_0x515bb3[_0x0561('0x58')]);}})[_0x0561('0x1e')](respondWithResult(_0x50883a,null))[_0x0561('0x28')](handleError(_0x50883a,null));};exports[_0x0561('0x6d')]=function(_0x5f5761,_0x193af2,_0x567c24){var _0x51bcc8={'raw':![],'where':{}};var _0x3ecf51={};var _0x22d18e={'count':0x0,'rows':[]};return db[_0x0561('0x3d')][_0x0561('0x67')]({'where':{'id':_0x5f5761['params']['id']}})[_0x0561('0x1e')](handleEntityNotFound(_0x193af2,null))[_0x0561('0x1e')](function(_0x3c4367){if(_0x3c4367){_0x3ecf51[_0x0561('0x42')]=_[_0x0561('0x44')](db[_0x0561('0x6e')]['rawAttributes']);_0x3ecf51[_0x0561('0x43')]=_[_0x0561('0x44')](_0x5f5761[_0x0561('0x43')]);_0x3ecf51[_0x0561('0x45')]=_[_0x0561('0x46')](_0x3ecf51[_0x0561('0x42')],_0x3ecf51['query']);_0x51bcc8[_0x0561('0x48')]=_['intersection'](_0x3ecf51[_0x0561('0x42')],qs[_0x0561('0x47')](_0x5f5761[_0x0561('0x43')][_0x0561('0x47')]));_0x51bcc8['attributes']=_0x51bcc8[_0x0561('0x48')][_0x0561('0x49')]?_0x51bcc8[_0x0561('0x48')]:_0x3ecf51[_0x0561('0x42')];if(!_0x5f5761[_0x0561('0x43')][_0x0561('0x6f')](_0x0561('0x4a'))){_0x51bcc8['limit']=qs[_0x0561('0x2f')](_0x5f5761[_0x0561('0x43')][_0x0561('0x2f')]);_0x51bcc8[_0x0561('0x2d')]=qs[_0x0561('0x2d')](_0x5f5761['query'][_0x0561('0x2d')]);}_0x51bcc8[_0x0561('0x4b')]=qs[_0x0561('0x4c')](_0x5f5761['query'][_0x0561('0x4c')]);_0x51bcc8[_0x0561('0x4d')]=qs[_0x0561('0x45')](_[_0x0561('0x70')](_0x5f5761[_0x0561('0x43')],_0x3ecf51[_0x0561('0x45')]));_0x51bcc8['where']['WhatsappAccountId']=_0x3c4367['id'];if(_0x5f5761[_0x0561('0x43')][_0x0561('0x4e')]){_0x51bcc8[_0x0561('0x4d')]=_[_0x0561('0x4f')](_0x51bcc8[_0x0561('0x4d')],{'$or':_[_0x0561('0x3c')](_0x51bcc8['attributes'],function(_0x51fb3d){var _0xe22801={};_0xe22801[_0x51fb3d]={'$like':'%'+_0x5f5761[_0x0561('0x43')][_0x0561('0x4e')]+'%'};return _0xe22801;})});}_0x51bcc8=_['merge']({},_0x51bcc8,_0x5f5761[_0x0561('0x50')]);return db[_0x0561('0x6e')][_0x0561('0x30')]({'where':_0x51bcc8[_0x0561('0x4d')]})[_0x0561('0x1e')](function(_0xb3339d){_0x22d18e['count']=_0xb3339d;if(_0x5f5761['query']['includeAll']){_0x51bcc8['include']=[{'all':!![]}];}return db['CannedAnswer'][_0x0561('0x52')](_0x51bcc8);})['then'](function(_0x2302e2){_0x22d18e[_0x0561('0x53')]=_0x2302e2;return _0x22d18e;});}})[_0x0561('0x1e')](respondWithFilteredResult(_0x193af2,_0x51bcc8))[_0x0561('0x28')](handleError(_0x193af2,null));};exports['removeAnswers']=function(_0x5cca26,_0x314119,_0x1a313c){return db['WhatsappAccount'][_0x0561('0x5c')]({'where':{'id':_0x5cca26[_0x0561('0x55')]['id']}})[_0x0561('0x1e')](handleEntityNotFound(_0x314119,null))[_0x0561('0x1e')](function(_0x2377d3){if(_0x2377d3){return _0x2377d3[_0x0561('0x71')](_0x5cca26[_0x0561('0x43')][_0x0561('0x6a')]);}})[_0x0561('0x1e')](respondWithStatusCode(_0x314119,null))['catch'](handleError(_0x314119,null));};exports[_0x0561('0x72')]=function(_0x27ad99,_0x446d85,_0x3b9a9f){return db['WhatsappAccount'][_0x0561('0x5c')]({'where':{'id':_0x27ad99[_0x0561('0x55')]['id']}})['then'](handleEntityNotFound(_0x446d85,null))[_0x0561('0x1e')](function(_0x21bdc9){if(_0x21bdc9){return _0x21bdc9['addAgents'](_0x27ad99[_0x0561('0x58')][_0x0561('0x6a')],_[_0x0561('0x73')](_0x27ad99[_0x0561('0x58')],['ids','id'])||{})['spread'](function(_0x1a3254){for(var _0x2658bd=0x0;_0x2658bd<_0x27ad99[_0x0561('0x58')][_0x0561('0x6a')][_0x0561('0x49')];_0x2658bd+=0x1){socket[_0x0561('0x74')](_0x0561('0x75'),{'UserId':Number(_0x27ad99[_0x0561('0x58')][_0x0561('0x6a')][_0x2658bd]),'WhatsappAccountId':Number(_0x27ad99['params']['id'])});}return _0x1a3254;});}})[_0x0561('0x1e')](respondWithResult(_0x446d85,null))[_0x0561('0x28')](handleError(_0x446d85,null));};exports[_0x0561('0x76')]=function(_0x569693,_0x2c23f5,_0x12230c){return db[_0x0561('0x3d')][_0x0561('0x5c')]({'where':{'id':_0x569693['params']['id']}})[_0x0561('0x1e')](handleEntityNotFound(_0x2c23f5,null))[_0x0561('0x1e')](function(_0x289313){if(_0x289313){return _0x289313[_0x0561('0x76')](_0x569693[_0x0561('0x43')][_0x0561('0x6a')])['then'](function(){if(_['isArray'](_0x569693[_0x0561('0x43')][_0x0561('0x6a')])){for(var _0x9c4248=0x0;_0x9c4248<_0x569693[_0x0561('0x43')][_0x0561('0x6a')][_0x0561('0x49')];_0x9c4248+=0x1){socket[_0x0561('0x74')](_0x0561('0x77'),{'UserId':Number(_0x569693['query'][_0x0561('0x6a')][_0x9c4248]),'WhatsappAccountId':Number(_0x569693['params']['id'])});}}else{socket[_0x0561('0x74')]('userWhatsappAccount:remove',{'UserId':Number(_0x569693[_0x0561('0x43')][_0x0561('0x6a')]),'WhatsappAccountId':Number(_0x569693[_0x0561('0x55')]['id'])});}});}})[_0x0561('0x1e')](respondWithStatusCode(_0x2c23f5,null))['catch'](handleError(_0x2c23f5,null));};exports[_0x0561('0x78')]=function(_0x33d516,_0x3be7c0,_0x1fdd4a){var _0x43823b={};var _0x5029ce={};var _0xa95bf7;var _0x1715e6;return db['WhatsappAccount']['findOne']({'where':{'id':_0x33d516['params']['id']}})[_0x0561('0x1e')](handleEntityNotFound(_0x3be7c0,null))[_0x0561('0x1e')](function(_0x2eb106){if(_0x2eb106){_0xa95bf7=_0x2eb106;_0x5029ce['model']=_[_0x0561('0x44')](db[_0x0561('0x79')]['rawAttributes']);_0x5029ce[_0x0561('0x43')]=_[_0x0561('0x44')](_0x33d516[_0x0561('0x43')]);_0x5029ce['filters']=_[_0x0561('0x46')](_0x5029ce['model'],_0x5029ce[_0x0561('0x43')]);_0x43823b[_0x0561('0x48')]=_[_0x0561('0x46')](_0x5029ce[_0x0561('0x42')],qs[_0x0561('0x47')](_0x33d516[_0x0561('0x43')][_0x0561('0x47')]));_0x43823b[_0x0561('0x48')]=_0x43823b[_0x0561('0x48')]['length']?_0x43823b['attributes']:_0x5029ce[_0x0561('0x42')];_0x43823b['order']=qs[_0x0561('0x4c')](_0x33d516[_0x0561('0x43')]['sort']);_0x43823b['where']=qs[_0x0561('0x45')](_[_0x0561('0x70')](_0x33d516[_0x0561('0x43')],_0x5029ce[_0x0561('0x45')]));if(_0x33d516[_0x0561('0x43')][_0x0561('0x4e')]){_0x43823b[_0x0561('0x4d')]=_[_0x0561('0x4f')](_0x43823b[_0x0561('0x4d')],{'$or':_['map'](_0x43823b[_0x0561('0x48')],function(_0x213e50){var _0x2f5a1b={};_0x2f5a1b[_0x213e50]={'$like':'%'+_0x33d516[_0x0561('0x43')][_0x0561('0x4e')]+'%'};return _0x2f5a1b;})});}_0x43823b=_[_0x0561('0x4f')]({},_0x43823b,_0x33d516['options']);return _0xa95bf7[_0x0561('0x78')](_0x43823b);}})[_0x0561('0x1e')](function(_0x42fe93){if(_0x42fe93){_0x1715e6=_0x42fe93['length'];if(!_0x33d516[_0x0561('0x43')][_0x0561('0x6f')](_0x0561('0x4a'))){_0x43823b[_0x0561('0x2f')]=qs[_0x0561('0x2f')](_0x33d516[_0x0561('0x43')]['limit']);_0x43823b[_0x0561('0x2d')]=qs[_0x0561('0x2d')](_0x33d516[_0x0561('0x43')][_0x0561('0x2d')]);}return _0xa95bf7[_0x0561('0x78')](_0x43823b);}})[_0x0561('0x1e')](function(_0x43556a){if(_0x43556a){return _0x43556a?{'count':_0x1715e6,'rows':_0x43556a}:null;}})[_0x0561('0x1e')](respondWithResult(_0x3be7c0,null))[_0x0561('0x28')](handleError(_0x3be7c0,null));};exports['addApplications']=function(_0x288c5b,_0x4b8c36){var _0x3898a9=_0x288c5b[_0x0561('0x55')]['id'];var _0x10bf60=_0x288c5b['body'];var _0x3f40cc=0xc8;var _0x4411e6=null;return db[_0x0561('0x7a')][_0x0561('0x7b')]({'isolationLevel':db[_0x0561('0x7a')][_0x0561('0x7c')][_0x0561('0x7d')][_0x0561('0x7e')]},function(_0x3e1a8d){return db[_0x0561('0x3d')]['findOne']({'where':{'id':_0x3898a9},'transaction':_0x3e1a8d})[_0x0561('0x1e')](function(_0x5a2411){if(_0x5a2411){return db[_0x0561('0x7f')][_0x0561('0x62')]({'where':{'WhatsappAccountId':_0x3898a9},'transaction':_0x3e1a8d})[_0x0561('0x1e')](function(){var _0x1734eb=_[_0x0561('0x3c')](_0x10bf60,function(_0x2a8f38){_0x2a8f38[_0x0561('0x6c')]=_0x3898a9;return _0x2a8f38;});return db[_0x0561('0x7f')][_0x0561('0x80')](_0x1734eb,{'transaction':_0x3e1a8d});});}else{_0x3f40cc=0x194;_0x4411e6=[];}});})[_0x0561('0x1e')](function(){if(_0x3f40cc!==0x194){return db[_0x0561('0x7f')][_0x0561('0x81')]({'where':{'WhatsappAccountId':_0x3898a9},'order':_0x0561('0x82')})[_0x0561('0x1e')](function(_0x45e143){_0x4411e6=_0x45e143;});}})[_0x0561('0x28')](function(_0x34261e){_0x3f40cc=0x1f4;logger[_0x0561('0x25')](_0x34261e[_0x0561('0x38')]);if(_0x34261e['name']){delete _0x34261e['name'];}_0x4411e6=_0x34261e;})[_0x0561('0x83')](function(){if(_0x4411e6===null){_0x4b8c36['sendStatus'](_0x3f40cc);}else{if(_0x3f40cc===0x1f4){_0x4b8c36['status'](_0x3f40cc)[_0x0561('0x84')](_0x4411e6);}else{_0x4b8c36[_0x0561('0x2a')](_0x3f40cc)[_0x0561('0x2c')](_0x4411e6);}}});};exports['getApplications']=function(_0x832ab1,_0x38b106,_0x55b6c4){var _0x412cac={};var _0x124536={};var _0x1fa55b;var _0x1bd9cc;return db[_0x0561('0x3d')][_0x0561('0x67')]({'where':{'id':_0x832ab1[_0x0561('0x55')]['id']}})[_0x0561('0x1e')](handleEntityNotFound(_0x38b106,null))['then'](function(_0x4d49ed){if(_0x4d49ed){_0x1fa55b=_0x4d49ed;_0x124536['model']=_[_0x0561('0x44')](db[_0x0561('0x7f')][_0x0561('0x3e')]);_0x124536['query']=_[_0x0561('0x44')](_0x832ab1['query']);_0x124536[_0x0561('0x45')]=_[_0x0561('0x46')](_0x124536['model'],_0x124536[_0x0561('0x43')]);_0x412cac['attributes']=_[_0x0561('0x46')](_0x124536[_0x0561('0x42')],qs[_0x0561('0x47')](_0x832ab1[_0x0561('0x43')][_0x0561('0x47')]));_0x412cac[_0x0561('0x48')]=_0x412cac[_0x0561('0x48')][_0x0561('0x49')]?_0x412cac[_0x0561('0x48')]:_0x124536['model'];_0x412cac[_0x0561('0x4b')]=qs['sort'](_0x832ab1[_0x0561('0x43')][_0x0561('0x4c')]);_0x412cac[_0x0561('0x4d')]=qs[_0x0561('0x45')](_[_0x0561('0x70')](_0x832ab1['query'],_0x124536[_0x0561('0x45')]));if(_0x832ab1[_0x0561('0x43')]['filter']){_0x412cac[_0x0561('0x4d')]=_[_0x0561('0x4f')](_0x412cac[_0x0561('0x4d')],{'$or':_[_0x0561('0x3c')](_0x412cac[_0x0561('0x48')],function(_0x55a806){var _0x43a12a={};_0x43a12a[_0x55a806]={'$like':'%'+_0x832ab1[_0x0561('0x43')][_0x0561('0x4e')]+'%'};return _0x43a12a;})});}_0x412cac=_[_0x0561('0x4f')]({},_0x412cac,_0x832ab1[_0x0561('0x50')]);return _0x1fa55b[_0x0561('0x85')](_0x412cac);}})[_0x0561('0x1e')](function(_0x36d9e8){if(_0x36d9e8){_0x1bd9cc=_0x36d9e8[_0x0561('0x49')];if(!_0x832ab1['query'][_0x0561('0x6f')](_0x0561('0x4a'))){_0x412cac['limit']=qs[_0x0561('0x2f')](_0x832ab1[_0x0561('0x43')][_0x0561('0x2f')]);_0x412cac['offset']=qs[_0x0561('0x2d')](_0x832ab1['query'][_0x0561('0x2d')]);}return _0x1fa55b[_0x0561('0x85')](_0x412cac);}})['then'](function(_0x5b4371){if(_0x5b4371){return _0x5b4371?{'count':_0x1bd9cc,'rows':_0x5b4371}:null;}})[_0x0561('0x1e')](respondWithResult(_0x38b106,null))[_0x0561('0x28')](handleError(_0x38b106,null));};exports[_0x0561('0x86')]=function(_0x2f5a2c,_0x3e5e62,_0x4f33b8){var _0x5799d3={'channel':_0x0561('0x87')};var _0x28f039=[];var _0x355336=[];var _0x21d89a={};return db[_0x0561('0x3d')][_0x0561('0x5c')]({'where':{'id':_0x2f5a2c[_0x0561('0x55')]['id']},'include':[{'model':db['WhatsappApplication'],'as':_0x0561('0x88')}]})['then'](handleEntityNotFound(_0x3e5e62,null))[_0x0561('0x1e')](function(_0x3e6d94){_0x5799d3['account']=_0x3e6d94;if(_0x5799d3['account']&&_0x5799d3[_0x0561('0x89')]['type']===_0x0561('0x8a')&&_0x2f5a2c[_0x0561('0x58')]['statuses']){if(_0x2f5a2c['body']['statuses'][_0x0561('0x49')]===0x0)return;if(_0x2f5a2c[_0x0561('0x58')][_0x0561('0x8b')][0x0][_0x0561('0x8c')]!==_0x0561('0x8d'))return;return db['WhatsappMessage'][_0x0561('0x61')]({'read':!![],'readAt':_0x2f5a2c[_0x0561('0x58')]['statuses'][0x0][_0x0561('0x8e')]},{'where':{'messageId':_0x2f5a2c[_0x0561('0x58')][_0x0561('0x8b')][0x0]['message_id']},'individualHooks':!![]})[_0x0561('0x1e')](function(_0x4aab0b){return _0x3e5e62[_0x0561('0x2a')](0xc8)[_0x0561('0x2c')](_0x4aab0b);});}_0x5799d3['applications']=_['orderBy'](_0x3e6d94[_0x0561('0x88')],['priority'],[_0x0561('0x8f')]);if(_0x5799d3['account'][_0x0561('0x88')]){delete _0x5799d3[_0x0561('0x89')][_0x0561('0x88')];}return db[_0x0561('0x90')][_0x0561('0x63')]()[_0x0561('0x1e')](function(_0x4056b2){if(!_0x4056b2){throw new db['Sequelize'][(_0x0561('0x91'))](_0x0561('0x92'));}_0x28f039=_[_0x0561('0x93')](_['keys'](_0x4056b2),[_0x0561('0x94'),_0x0561('0x95')]);_0x355336=_[_0x0561('0x93')](_['keys'](_0x4056b2),[_0x0561('0x94'),_0x0561('0x95'),_0x0561('0x96'),_0x0561('0x97')]);_0x5799d3['body']={'mapKey':'mobile'};if(_0x5799d3[_0x0561('0x89')]&&_0x5799d3[_0x0561('0x89')][_0x0561('0x40')]==='twilio'){_0x5799d3[_0x0561('0x58')][_0x0561('0x98')]=_0x2f5a2c[_0x0561('0x58')]['From'][_0x0561('0x99')](_0x0561('0x9a'),'');_0x5799d3[_0x0561('0x58')]['body']=_0x2f5a2c[_0x0561('0x58')]['Body'];_0x5799d3[_0x0561('0x58')][_0x0561('0x9b')]=_0x2f5a2c[_0x0561('0x58')][_0x0561('0x9c')];}if(_0x5799d3['account']&&_0x5799d3['account'][_0x0561('0x40')]===_0x0561('0x8a')){_0x5799d3['body'][_0x0561('0x98')]=_0x2f5a2c[_0x0561('0x58')]['notifications'][0x0][_0x0561('0x98')];_0x5799d3['body'][_0x0561('0x58')]=_0x2f5a2c['body']['notifications'][0x0][_0x0561('0x27')][_0x0561('0x58')];_0x5799d3[_0x0561('0x58')][_0x0561('0x9b')]=_0x2f5a2c[_0x0561('0x58')]['notifications'][0x0][_0x0561('0x9d')];}if(_0x5799d3[_0x0561('0x58')]['id']){delete _0x5799d3['body']['id'];}if(_[_0x0561('0x9e')](_0x5799d3[_0x0561('0x58')][_0x0561('0x98')])){throw new db[(_0x0561('0x9f'))][(_0x0561('0x91'))](_0x0561('0xa0'));}if(_['isNil'](_0x5799d3['body'][_0x0561('0x58')])||_0x5799d3[_0x0561('0x58')][_0x0561('0x58')]===''){throw new db[(_0x0561('0x9f'))]['ValidationError'](_0x0561('0xa1'));}if(_[_0x0561('0x9e')](_0x5799d3[_0x0561('0x58')]['mapKey'])){throw new db['Sequelize'][(_0x0561('0x91'))](_0x0561('0xa2')+_0x355336);}if(!_[_0x0561('0xa3')](_0x355336,_0x5799d3[_0x0561('0x58')][_0x0561('0xa4')])){throw new db[(_0x0561('0x9f'))][(_0x0561('0x91'))](_0x0561('0xa5')+_0x355336);}_0x21d89a[_0x5799d3[_0x0561('0x58')]['mapKey']]=_0x5799d3[_0x0561('0x58')][_0x0561('0x98')];return db['CmList'][_0x0561('0x5c')]({'where':{'id':_0x5799d3[_0x0561('0x89')][_0x0561('0x97')]},'include':[{'model':db['CmContact'],'as':_0x0561('0xa6'),'where':_0x21d89a,'limit':0x1,'order':[['updatedAt',_0x0561('0xa7')]]}]});})['then'](handleEntityNotFound(_0x3e5e62,null))['then'](function(_0x1856cc){if(_0x1856cc){_0x5799d3[_0x0561('0xa8')]=_[_0x0561('0x73')](_0x1856cc,[_0x0561('0xa6')]);if(_0x1856cc[_0x0561('0xa6')][_0x0561('0x49')]){return _0x1856cc[_0x0561('0xa6')][0x0];}var _0x592dc8=_[_0x0561('0x18')](_0x5799d3[_0x0561('0x58')],{'firstName':_0x5799d3['body'][_0x0561('0x98')],'ListId':_0x1856cc['id']});_0x592dc8[_0x5799d3[_0x0561('0x58')][_0x0561('0xa4')]]=_0x5799d3[_0x0561('0x58')][_0x0561('0x98')];return db[_0x0561('0x90')][_0x0561('0x57')](_0x592dc8,{'fields':_0x28f039,'raw':!![]});}})['then'](handleEntityNotFound(_0x3e5e62,null))['then'](function(_0x4a53da){if(_0x4a53da){_0x5799d3[_0x0561('0xa9')]=_0x4a53da;var _0x2f09e7={'ContactId':_0x4a53da['id'],'phone':_0x5799d3['body'][_0x0561('0x98')],'WhatsappAccountId':_0x2f5a2c[_0x0561('0x55')]['id']};var _0x2f60a8={'ContactId':_0x4a53da['id'],'WhatsappAccountId':_0x2f5a2c[_0x0561('0x55')]['id'],'closed':![]};return db[_0x0561('0xaa')][_0x0561('0x5c')]({'where':_0x2f60a8})[_0x0561('0x1e')](function(_0x431cd9){if(_0x431cd9){return[_0x431cd9,![]];}return db[_0x0561('0xaa')][_0x0561('0x57')](_0x2f09e7)['then'](function(_0x1751d8){return[_0x1751d8,!![]];});});}})[_0x0561('0xab')](function(_0x2cf51d,_0x18ff77){_0x5799d3[_0x0561('0xac')]=_0x2cf51d[_0x0561('0x36')]({'plain':!![]});_0x5799d3[_0x0561('0xac')][_0x0561('0xad')]=![];if(_0x18ff77){if(_0x5799d3[_0x0561('0x89')][_0x0561('0xae')]){_0x5799d3[_0x0561('0xaf')]['push']({'id':0x0,'priority':_0x5799d3['applications']['length']+0x1,'app':_0x0561('0xb0'),'appdata':'unmanaged','interval':_0x0561('0xb1')});}_0x5799d3[_0x0561('0xac')][_0x0561('0xad')]=!![];}return db['WhatsappMessage'][_0x0561('0x57')]({'phone':_0x5799d3['body'][_0x0561('0x98')],'messageId':_0x5799d3[_0x0561('0x58')][_0x0561('0x9b')],'body':_0x5799d3['body'][_0x0561('0x58')],'WhatsappAccountId':_0x2f5a2c['params']['id'],'WhatsappInteractionId':_0x2cf51d['id'],'direction':'in','ContactId':_0x2cf51d[_0x0561('0xb2')],'AttachmentId':_0x5799d3[_0x0561('0x58')]['AttachmentId']});})['then'](function(_0x8cf64e){_0x5799d3[_0x0561('0x27')]=_0x8cf64e;if(!_0x5799d3[_0x0561('0xac')]['UserId'])return;return db[_0x0561('0x79')]['find']({'attributes':['id','name'],'where':{'id':_0x5799d3[_0x0561('0xac')][_0x0561('0xb3')]}});})[_0x0561('0x1e')](function(_0x3a1cb9){if(_0x3a1cb9){_0x5799d3[_0x0561('0xaf')][_0x0561('0xb4')]({'id':0x0,'priority':0x0,'app':'agent','appdata':_0x3a1cb9[_0x0561('0x39')]+','+(_0x5799d3['account'][_0x0561('0xb5')]||0xa),'interval':_0x0561('0xb1')});}if(!_0x5799d3[_0x0561('0xac')][_0x0561('0xb6')])return;return db[_0x0561('0xb7')]['find']({'attributes':['id','name'],'where':{'id':_0x5799d3[_0x0561('0xac')][_0x0561('0xb6')]}});})[_0x0561('0x1e')](function(_0x379fc6){if(_0x379fc6){_0x5799d3[_0x0561('0xaf')][_0x0561('0xb4')]({'id':0x0,'priority':0x1,'app':_0x0561('0xb8'),'appdata':_0x379fc6[_0x0561('0x39')]+','+(_0x5799d3[_0x0561('0x89')]['waitForTheAssignedQueue']||0x12c),'interval':_0x0561('0xb1')});}return respondWithRpcPromise(_0x0561('0xb9'),_0x0561('0xba'),_0x5799d3);})[_0x0561('0x1e')](function(_0x709df8){if(_0x709df8){var _0x2c665a=0xc8;var _0x3d073c=_0x0561('0xbb');logger[_0x0561('0x1f')](_0x0561('0x23'),_0x3d073c,_0x2c665a,_0x0561('0xbc'));logger['debug'](_0x0561('0xbd'),_0x3d073c,_0x2c665a,_0x0561('0xbc'),JSON[_0x0561('0x24')](_0x709df8));if(_0x5799d3[_0x0561('0x89')][_0x0561('0x40')]===_0x0561('0xbe')){return _0x3e5e62[_0x0561('0x2a')](_0x2c665a)[_0x0561('0x31')](_0x0561('0xbf'),'text/xml')[_0x0561('0x84')](_0x0561('0xc0'));}else{return _0x3e5e62[_0x0561('0x2a')](_0x2c665a)[_0x0561('0x2c')](_0x709df8);}}});})[_0x0561('0x28')](handleError(_0x3e5e62,null));};exports[_0x0561('0x84')]=function(_0x4bcf5b,_0x51a21a,_0x517697){var _0x41e6ee,_0x560938,_0x2b70b4;if(_[_0x0561('0x9e')](_0x4bcf5b[_0x0561('0x58')][_0x0561('0x58')])||_0x4bcf5b[_0x0561('0x58')]['body']===''){throw new db[(_0x0561('0x9f'))][(_0x0561('0x91'))](_0x0561('0xa1'));}if(_[_0x0561('0x9e')](_0x4bcf5b['body']['to'])){throw new db[(_0x0561('0x9f'))][(_0x0561('0x91'))](_0x0561('0xc1'));}_0x41e6ee=_0x4bcf5b['body']['to'];return db['WhatsappAccount'][_0x0561('0x5c')]({'where':{'id':_0x4bcf5b['params']['id']},'include':[{'model':db[_0x0561('0xc2')],'as':_0x0561('0xc3'),'include':[{'model':db['CmContact'],'as':_0x0561('0xa6'),'where':{'mobile':_0x41e6ee},'limit':0x1,'order':[[_0x0561('0x95'),_0x0561('0xa7')]]}]}]})[_0x0561('0x1e')](handleEntityNotFound(_0x51a21a,null))[_0x0561('0x1e')](function(_0x9ae503){if(_0x9ae503&&_0x9ae503[_0x0561('0xc3')]){_0x560938=_0x9ae503[_0x0561('0x36')]({'plain':!![]});if(_0x560938[_0x0561('0xc3')]&&_0x560938[_0x0561('0xc3')][_0x0561('0xa6')]['length']){return _0x560938['List'][_0x0561('0xa6')][0x0];}return db[_0x0561('0x90')][_0x0561('0x57')](_['defaults'](_0x4bcf5b[_0x0561('0x58')],{'firstName':_0x41e6ee,'mobile':_0x41e6ee,'phone':_0x41e6ee,'ListId':_0x560938['ListId']}));}})[_0x0561('0x1e')](handleEntityNotFound(_0x51a21a,null))['then'](function(_0x3c14fb){if(_0x3c14fb){_0x2b70b4=_0x3c14fb;return db[_0x0561('0xaa')][_0x0561('0x5c')]({'where':{'ContactId':_0x2b70b4['id'],'closed':![],'WhatsappAccountId':_0x560938['id']}})[_0x0561('0x1e')](function(_0x56156f){if(_0x56156f){return[_0x56156f,![]];}return db[_0x0561('0xaa')]['create']({'UserId':_0x4bcf5b[_0x0561('0x59')]['id'],'ContactId':_0x2b70b4['id'],'WhatsappAccountId':_0x560938['id'],'phone':_0x41e6ee,'firstMsgDirection':'out','Messages':[_[_0x0561('0x4f')](_0x4bcf5b[_0x0561('0x58')],{'read':![],'body':_0x4bcf5b[_0x0561('0x58')]['body'],'phone':_0x41e6ee,'WhatsappAccountId':_0x560938['id'],'UserId':_0x4bcf5b[_0x0561('0x59')]['id'],'ContactId':_0x2b70b4['id']})]},{'include':[{'model':db['WhatsappMessage'],'as':_0x0561('0xc4')}]})[_0x0561('0x1e')](function(_0x2ddd6d){return[_0x2ddd6d,!![]];});});}})[_0x0561('0xab')](function(_0x48ebdf,_0x5f0e42){if(_0x5f0e42){return _0x48ebdf;}return db[_0x0561('0xc5')]['create'](_[_0x0561('0x4f')](_0x4bcf5b[_0x0561('0x58')],{'read':![],'body':_0x4bcf5b[_0x0561('0x58')][_0x0561('0x58')],'phone':_0x41e6ee,'WhatsappAccountId':_0x560938['id'],'WhatsappInteractionId':_0x48ebdf['id'],'UserId':_0x4bcf5b[_0x0561('0x59')]['id'],'ContactId':_0x2b70b4['id']}))['then'](function(_0x34a94c){_0x48ebdf[_0x0561('0xc6')][_0x0561('0xc4')]=[];_0x48ebdf[_0x0561('0xc6')]['Messages'][_0x0561('0xc7')](_0x34a94c[_0x0561('0xc6')]);return _0x48ebdf;});})[_0x0561('0x1e')](respondWithResult(_0x51a21a,null))[_0x0561('0x28')](handleError(_0x51a21a,null));}; \ No newline at end of file +var _0x65fe=['desk.js','querystring','papaparse','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/license/util','../../mysqldb','redis','defaults','./whatsappAccount.socket','register','jayson/promise','client','http','then','info','request\x20sent','debug','error','code','WhatsappAccount,\x20%s,\x20%s','message','result','catch','json','offset','limit','undefined','count','set','Content-Range','apply','reject','save','destroy','get','status','end','stack','name','index','Pause','mandatoryDispositionPause','map','WhatsappAccount','rawAttributes','fieldName','type','model','query','intersection','attributes','fields','length','nolimit','sort','where','filters','filter','merge','VIRTUAL','options','includeAll','include','findAll','rows','show','params','keys','find','create','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','WhatsappAccounts','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','describe','Disposition','getDispositions','hasOwnProperty','order','pick','WhatsappAccountId','removeDispositions','ids','addAnswer','CannedAnswer','removeAnswers','addAgents','omit','emit','userWhatsappAccount:save','removeAgents','isArray','userWhatsappAccount:remove','getAgents','findOne','User','transaction','sequelize','Transaction','ISOLATION_LEVELS','READ_COMMITTED','WhatsappApplication','bulkCreate','findAndCountAll','finally','send','getApplications','notify','whatsapp','Applications','account','sinch','statuses','state','read','WhatsappMessage','update','message_id','applications','orderBy','CmContact','Sequelize','ValidationError','no\x20available\x20attributes','updatedAt','CompanyId','ListId','twilio','From','replace','messageId','MessageSid','from','notifications','isNil','from\x20is\x20mandatory','body\x20is\x20mandatory\x20and\x20not\x20empty','mapKey','mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','includes','mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','CmList','DESC','Contacts','WhatsappInteraction','spread','interaction','autoclose','push','unmanaged','*,*,*,*','created','ContactId','AttachmentId','UserId','unshift','waitForTheAssignedAgent','WhatsappQueue','queue','waitForTheAssignedQueue','Start','WhatsappAccount,\x20%s,\x20%s,\x20%s','entity\x20found','stringify','Content-Type','to\x20is\x20mandatory','List','out','Messages','dataValues','rimraf','fast-json-patch','request-promise','moment','mustache','path','sox','to-csv','fs-extra','squel','crypto','jsforce'];(function(_0x5f1391,_0x19c132){var _0x50ebe3=function(_0x3d00a3){while(--_0x3d00a3){_0x5f1391['push'](_0x5f1391['shift']());}};_0x50ebe3(++_0x19c132);}(_0x65fe,0x16c));var _0xe65f=function(_0x21a2c0,_0x1a7e6d){_0x21a2c0=_0x21a2c0-0x0;var _0x10fb48=_0x65fe[_0x21a2c0];return _0x10fb48;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xe65f('0x0'));var zipdir=require('zip-dir');var jsonpatch=require(_0xe65f('0x1'));var rp=require(_0xe65f('0x2'));var moment=require(_0xe65f('0x3'));var BPromise=require('bluebird');var Mustache=require(_0xe65f('0x4'));var util=require('util');var path=require(_0xe65f('0x5'));var sox=require(_0xe65f('0x6'));var csv=require(_0xe65f('0x7'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xe65f('0x8'));var _=require('lodash');var squel=require(_0xe65f('0x9'));var crypto=require(_0xe65f('0xa'));var jsforce=require(_0xe65f('0xb'));var deskjs=require(_0xe65f('0xc'));var toCsv=require(_0xe65f('0x7'));var querystring=require(_0xe65f('0xd'));var Papa=require(_0xe65f('0xe'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0xe65f('0xf'));var as=require(_0xe65f('0x10'));var hardwareService=require(_0xe65f('0x11'));var logger=require('../../config/logger')(_0xe65f('0x12'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0xe65f('0x13'));var db=require(_0xe65f('0x14'))['db'];config[_0xe65f('0x15')]=_[_0xe65f('0x16')](config['redis'],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xe65f('0x15')]));require(_0xe65f('0x17'))[_0xe65f('0x18')](socket);var jayson=require(_0xe65f('0x19'));var client=jayson[_0xe65f('0x1a')][_0xe65f('0x1b')]({'port':0x232c});function respondWithRpcPromise(_0x2cad72,_0x520489,_0x3b976b,_0x3f2a12){return new BPromise(function(_0x45de1f,_0x5931d9){var _0x5d0567=_0x3f2a12||client;return _0x5d0567['request'](_0x2cad72,_0x3b976b)[_0xe65f('0x1c')](function(_0x28d1e2){logger[_0xe65f('0x1d')]('WhatsappAccount,\x20%s,\x20%s',_0x520489,_0xe65f('0x1e'));logger[_0xe65f('0x1f')]('WhatsappAccount,\x20%s,\x20%s,\x20%s',_0x520489,_0xe65f('0x1e'),JSON['stringify'](_0x28d1e2));if(_0x28d1e2[_0xe65f('0x20')]){if(_0x28d1e2['error'][_0xe65f('0x21')]===0x1f4){logger[_0xe65f('0x20')](_0xe65f('0x22'),_0x520489,_0x28d1e2[_0xe65f('0x20')][_0xe65f('0x23')]);return _0x5931d9(_0x28d1e2[_0xe65f('0x20')]['message']);}logger[_0xe65f('0x20')]('WhatsappAccount,\x20%s,\x20%s',_0x520489,_0x28d1e2[_0xe65f('0x20')]['message']);return _0x45de1f(_0x28d1e2[_0xe65f('0x20')][_0xe65f('0x23')]);}else{logger[_0xe65f('0x1d')](_0xe65f('0x22'),_0x520489,_0xe65f('0x1e'));_0x45de1f(_0x28d1e2[_0xe65f('0x24')][_0xe65f('0x23')]);}})[_0xe65f('0x25')](function(_0xc0c4d3){logger[_0xe65f('0x20')](_0xe65f('0x22'),_0x520489,_0xc0c4d3);_0x5931d9(_0xc0c4d3);});});}function respondWithStatusCode(_0x51188c,_0x5c1115){_0x5c1115=_0x5c1115||0xcc;return function(_0x2e52bf){if(_0x2e52bf){return _0x51188c['sendStatus'](_0x5c1115);}return _0x51188c['status'](_0x5c1115)['end']();};}function respondWithResult(_0x37c49b,_0x273410){_0x273410=_0x273410||0xc8;return function(_0x30c44c){if(_0x30c44c){return _0x37c49b['status'](_0x273410)[_0xe65f('0x26')](_0x30c44c);}};}function respondWithFilteredResult(_0x547203,_0x2715e2){return function(_0x3674e7){if(_0x3674e7){var _0xbef71=typeof _0x2715e2[_0xe65f('0x27')]==='undefined'&&typeof _0x2715e2[_0xe65f('0x28')]===_0xe65f('0x29');var _0xd3096d=_0x3674e7[_0xe65f('0x2a')];var _0x351af6=_0xbef71?0x0:_0x2715e2[_0xe65f('0x27')];var _0x334fde=_0xbef71?_0x3674e7['count']:_0x2715e2['offset']+_0x2715e2[_0xe65f('0x28')];var _0x2cfd3e;if(_0x334fde>=_0xd3096d){_0x334fde=_0xd3096d;_0x2cfd3e=0xc8;}else{_0x2cfd3e=0xce;}_0x547203['status'](_0x2cfd3e);return _0x547203[_0xe65f('0x2b')](_0xe65f('0x2c'),_0x351af6+'-'+_0x334fde+'/'+_0xd3096d)[_0xe65f('0x26')](_0x3674e7);}return null;};}function patchUpdates(_0x33d2cd){return function(_0x2f7d7a){try{jsonpatch[_0xe65f('0x2d')](_0x2f7d7a,_0x33d2cd,!![]);}catch(_0x1be6b9){return BPromise[_0xe65f('0x2e')](_0x1be6b9);}return _0x2f7d7a[_0xe65f('0x2f')]();};}function saveUpdates(_0x59755b,_0x373eef){return function(_0x497859){if(_0x497859){return _0x497859['update'](_0x59755b)[_0xe65f('0x1c')](function(_0x105250){return _0x105250;});}return null;};}function removeEntity(_0x57c83d,_0x787e28){return function(_0xa2ddee){if(_0xa2ddee){return _0xa2ddee[_0xe65f('0x30')]()[_0xe65f('0x1c')](function(){var _0x2781cb=_0xa2ddee[_0xe65f('0x31')]({'plain':!![]});var _0x251f2e='WhatsappAccounts';return db['UserProfileResource'][_0xe65f('0x30')]({'where':{'type':_0x251f2e,'resourceId':_0x2781cb['id']}})[_0xe65f('0x1c')](function(){return _0xa2ddee;});})[_0xe65f('0x1c')](function(){_0x57c83d[_0xe65f('0x32')](0xcc)[_0xe65f('0x33')]();});}};}function handleEntityNotFound(_0x648884,_0x2c9476){return function(_0x43ba10){if(!_0x43ba10){_0x648884['sendStatus'](0x194);}return _0x43ba10;};}function handleError(_0xb113e,_0x121974){_0x121974=_0x121974||0x1f4;return function(_0x16bd81){logger[_0xe65f('0x20')](_0x16bd81[_0xe65f('0x34')]);if(_0x16bd81[_0xe65f('0x35')]){delete _0x16bd81[_0xe65f('0x35')];}_0xb113e[_0xe65f('0x32')](_0x121974)['send'](_0x16bd81);};}exports[_0xe65f('0x36')]=function(_0x19e9b5,_0x4edaa8){var _0x4813ec={'include':[{'model':db[_0xe65f('0x37')],'as':_0xe65f('0x38')}]},_0xecc0b7={},_0x5ef62f={'count':0x0,'rows':[]};var _0xbfd23f=_[_0xe65f('0x39')](db[_0xe65f('0x3a')][_0xe65f('0x3b')],function(_0x37578e){return{'name':_0x37578e[_0xe65f('0x3c')],'type':_0x37578e[_0xe65f('0x3d')]['key']};});_0xecc0b7[_0xe65f('0x3e')]=_['map'](_0xbfd23f,'name');_0xecc0b7[_0xe65f('0x3f')]=_['keys'](_0x19e9b5['query']);_0xecc0b7['filters']=_[_0xe65f('0x40')](_0xecc0b7['model'],_0xecc0b7['query']);_0x4813ec[_0xe65f('0x41')]=_[_0xe65f('0x40')](_0xecc0b7[_0xe65f('0x3e')],qs[_0xe65f('0x42')](_0x19e9b5[_0xe65f('0x3f')][_0xe65f('0x42')]));_0x4813ec['attributes']=_0x4813ec[_0xe65f('0x41')][_0xe65f('0x43')]?_0x4813ec['attributes']:_0xecc0b7[_0xe65f('0x3e')];if(!_0x19e9b5[_0xe65f('0x3f')]['hasOwnProperty'](_0xe65f('0x44'))){_0x4813ec['limit']=qs[_0xe65f('0x28')](_0x19e9b5[_0xe65f('0x3f')][_0xe65f('0x28')]);_0x4813ec[_0xe65f('0x27')]=qs[_0xe65f('0x27')](_0x19e9b5['query'][_0xe65f('0x27')]);}_0x4813ec['order']=qs[_0xe65f('0x45')](_0x19e9b5[_0xe65f('0x3f')][_0xe65f('0x45')]);_0x4813ec[_0xe65f('0x46')]=qs['filters'](_['pick'](_0x19e9b5[_0xe65f('0x3f')],_0xecc0b7[_0xe65f('0x47')]),_0xbfd23f);if(_0x19e9b5[_0xe65f('0x3f')][_0xe65f('0x48')]){_0x4813ec['where']=_[_0xe65f('0x49')](_0x4813ec[_0xe65f('0x46')],{'$or':_[_0xe65f('0x39')](_0xbfd23f,function(_0x10a885){if(_0x10a885['type']!==_0xe65f('0x4a')){var _0x315a26={};_0x315a26[_0x10a885[_0xe65f('0x35')]]={'$like':'%'+_0x19e9b5[_0xe65f('0x3f')][_0xe65f('0x48')]+'%'};return _0x315a26;}})});}_0x4813ec=_[_0xe65f('0x49')]({},_0x4813ec,_0x19e9b5[_0xe65f('0x4b')]);var _0x47fa5b={'where':_0x4813ec[_0xe65f('0x46')]};return db[_0xe65f('0x3a')][_0xe65f('0x2a')](_0x47fa5b)['then'](function(_0x84233e){_0x5ef62f[_0xe65f('0x2a')]=_0x84233e;if(_0x19e9b5['query'][_0xe65f('0x4c')]){_0x4813ec[_0xe65f('0x4d')]=[{'all':!![]}];}return db[_0xe65f('0x3a')][_0xe65f('0x4e')](_0x4813ec);})[_0xe65f('0x1c')](function(_0x1dd63a){_0x5ef62f[_0xe65f('0x4f')]=_0x1dd63a;return _0x5ef62f;})['then'](respondWithFilteredResult(_0x4edaa8,_0x4813ec))[_0xe65f('0x25')](handleError(_0x4edaa8,null));};exports[_0xe65f('0x50')]=function(_0xd2fb2d,_0x566491){var _0x3e6e79={'raw':![],'where':{'id':_0xd2fb2d[_0xe65f('0x51')]['id']},'include':[{'model':db[_0xe65f('0x37')],'as':_0xe65f('0x38')}]},_0x5dfebb={};_0x5dfebb[_0xe65f('0x3e')]=_[_0xe65f('0x52')](db[_0xe65f('0x3a')]['rawAttributes']);_0x5dfebb[_0xe65f('0x3f')]=_[_0xe65f('0x52')](_0xd2fb2d[_0xe65f('0x3f')]);_0x5dfebb[_0xe65f('0x47')]=_[_0xe65f('0x40')](_0x5dfebb[_0xe65f('0x3e')],_0x5dfebb[_0xe65f('0x3f')]);_0x3e6e79[_0xe65f('0x41')]=_[_0xe65f('0x40')](_0x5dfebb[_0xe65f('0x3e')],qs[_0xe65f('0x42')](_0xd2fb2d['query'][_0xe65f('0x42')]));_0x3e6e79[_0xe65f('0x41')]=_0x3e6e79['attributes'][_0xe65f('0x43')]?_0x3e6e79[_0xe65f('0x41')]:_0x5dfebb['model'];if(_0xd2fb2d[_0xe65f('0x3f')]['includeAll']){_0x3e6e79[_0xe65f('0x4d')]=[{'all':!![]}];}_0x3e6e79=_[_0xe65f('0x49')]({},_0x3e6e79,_0xd2fb2d[_0xe65f('0x4b')]);return db['WhatsappAccount'][_0xe65f('0x53')](_0x3e6e79)[_0xe65f('0x1c')](handleEntityNotFound(_0x566491,null))[_0xe65f('0x1c')](respondWithResult(_0x566491,null))['catch'](handleError(_0x566491,null));};exports[_0xe65f('0x54')]=function(_0xd7fbb3,_0x2ec1d9){return db[_0xe65f('0x3a')][_0xe65f('0x54')](_0xd7fbb3['body'],{})['then'](function(_0x8107f5){var _0x4bf1c3=_0xd7fbb3[_0xe65f('0x55')]['get']({'plain':!![]});if(!_0x4bf1c3)throw new Error(_0xe65f('0x56'));if(_0x4bf1c3['role']===_0xe65f('0x55')){var _0x1e6541=_0x8107f5[_0xe65f('0x31')]({'plain':!![]});var _0x430691=_0xe65f('0x57');return db['UserProfileSection'][_0xe65f('0x53')]({'where':{'name':_0x430691,'userProfileId':_0x4bf1c3[_0xe65f('0x58')]},'raw':!![]})[_0xe65f('0x1c')](function(_0x27ac14){if(_0x27ac14&&_0x27ac14[_0xe65f('0x59')]===0x0){return db['UserProfileResource'][_0xe65f('0x54')]({'name':_0x1e6541[_0xe65f('0x35')],'resourceId':_0x1e6541['id'],'type':_0x27ac14[_0xe65f('0x35')],'sectionId':_0x27ac14['id']},{})['then'](function(){return _0x8107f5;});}else{return _0x8107f5;}})['catch'](function(_0x56a924){logger[_0xe65f('0x20')](_0xe65f('0x5a'),_0x56a924);throw _0x56a924;});}return _0x8107f5;})[_0xe65f('0x1c')](respondWithResult(_0x2ec1d9,0xc9))[_0xe65f('0x25')](handleError(_0x2ec1d9,null));};exports['update']=function(_0x52d563,_0x49de91){if(_0x52d563[_0xe65f('0x5b')]['id']){delete _0x52d563[_0xe65f('0x5b')]['id'];}return db[_0xe65f('0x3a')]['find']({'where':{'id':_0x52d563[_0xe65f('0x51')]['id']},'include':[{'model':db[_0xe65f('0x37')],'as':'mandatoryDispositionPause'}]})[_0xe65f('0x1c')](handleEntityNotFound(_0x49de91,null))[_0xe65f('0x1c')](saveUpdates(_0x52d563[_0xe65f('0x5b')],null))['then'](respondWithResult(_0x49de91,null))['catch'](handleError(_0x49de91,null));};exports[_0xe65f('0x30')]=function(_0x4bd049,_0x208ff5){return db[_0xe65f('0x3a')]['find']({'where':{'id':_0x4bd049['params']['id']}})[_0xe65f('0x1c')](handleEntityNotFound(_0x208ff5,null))[_0xe65f('0x1c')](removeEntity(_0x208ff5,null))[_0xe65f('0x25')](handleError(_0x208ff5,null));};exports[_0xe65f('0x5c')]=function(_0x21087e,_0x360ebc){return db[_0xe65f('0x3a')][_0xe65f('0x5c')]()[_0xe65f('0x1c')](respondWithResult(_0x360ebc,null))[_0xe65f('0x25')](handleError(_0x360ebc,null));};exports['addDisposition']=function(_0x59bb58,_0x269c98,_0x3ed36e){if(_0x59bb58[_0xe65f('0x5b')]['id']){delete _0x59bb58[_0xe65f('0x5b')]['id'];}return db[_0xe65f('0x3a')]['find']({'where':{'id':_0x59bb58['params']['id']}})[_0xe65f('0x1c')](handleEntityNotFound(_0x269c98,null))['then'](function(_0x3a5479){if(_0x3a5479){_0x59bb58[_0xe65f('0x5b')]['WhatsappAccountId']=_0x3a5479['id'];return db[_0xe65f('0x5d')][_0xe65f('0x54')](_0x59bb58['body']);}})[_0xe65f('0x1c')](respondWithResult(_0x269c98,null))['catch'](handleError(_0x269c98,null));};exports[_0xe65f('0x5e')]=function(_0x472ca7,_0x429ea6,_0x8e4701){var _0x1170e2={'raw':![],'where':{}};var _0x4faf70={};var _0x2cd6e2={'count':0x0,'rows':[]};return db[_0xe65f('0x3a')]['findOne']({'where':{'id':_0x472ca7[_0xe65f('0x51')]['id']}})[_0xe65f('0x1c')](handleEntityNotFound(_0x429ea6,null))[_0xe65f('0x1c')](function(_0x39d6b2){if(_0x39d6b2){_0x4faf70[_0xe65f('0x3e')]=_[_0xe65f('0x52')](db[_0xe65f('0x5d')][_0xe65f('0x3b')]);_0x4faf70[_0xe65f('0x3f')]=_['keys'](_0x472ca7['query']);_0x4faf70[_0xe65f('0x47')]=_['intersection'](_0x4faf70[_0xe65f('0x3e')],_0x4faf70['query']);_0x1170e2[_0xe65f('0x41')]=_[_0xe65f('0x40')](_0x4faf70['model'],qs[_0xe65f('0x42')](_0x472ca7[_0xe65f('0x3f')][_0xe65f('0x42')]));_0x1170e2[_0xe65f('0x41')]=_0x1170e2[_0xe65f('0x41')][_0xe65f('0x43')]?_0x1170e2[_0xe65f('0x41')]:_0x4faf70[_0xe65f('0x3e')];if(!_0x472ca7[_0xe65f('0x3f')][_0xe65f('0x5f')]('nolimit')){_0x1170e2[_0xe65f('0x28')]=qs['limit'](_0x472ca7[_0xe65f('0x3f')][_0xe65f('0x28')]);_0x1170e2['offset']=qs[_0xe65f('0x27')](_0x472ca7[_0xe65f('0x3f')][_0xe65f('0x27')]);}_0x1170e2[_0xe65f('0x60')]=qs[_0xe65f('0x45')](_0x472ca7['query']['sort']);_0x1170e2['where']=qs[_0xe65f('0x47')](_[_0xe65f('0x61')](_0x472ca7[_0xe65f('0x3f')],_0x4faf70['filters']));_0x1170e2['where'][_0xe65f('0x62')]=_0x39d6b2['id'];if(_0x472ca7[_0xe65f('0x3f')][_0xe65f('0x48')]){_0x1170e2[_0xe65f('0x46')]=_[_0xe65f('0x49')](_0x1170e2[_0xe65f('0x46')],{'$or':_[_0xe65f('0x39')](_0x1170e2[_0xe65f('0x41')],function(_0x1f588e){var _0x5221a8={};_0x5221a8[_0x1f588e]={'$like':'%'+_0x472ca7[_0xe65f('0x3f')]['filter']+'%'};return _0x5221a8;})});}_0x1170e2=_[_0xe65f('0x49')]({},_0x1170e2,_0x472ca7[_0xe65f('0x4b')]);return db['Disposition'][_0xe65f('0x2a')]({'where':_0x1170e2[_0xe65f('0x46')]})[_0xe65f('0x1c')](function(_0x5337d7){_0x2cd6e2['count']=_0x5337d7;if(_0x472ca7[_0xe65f('0x3f')][_0xe65f('0x4c')]){_0x1170e2['include']=[{'all':!![]}];}return db[_0xe65f('0x5d')][_0xe65f('0x4e')](_0x1170e2);})[_0xe65f('0x1c')](function(_0x1363be){_0x2cd6e2['rows']=_0x1363be;return _0x2cd6e2;});}})[_0xe65f('0x1c')](respondWithFilteredResult(_0x429ea6,_0x1170e2))['catch'](handleError(_0x429ea6,null));};exports['removeDispositions']=function(_0x380dc6,_0x349cd7,_0x206ec1){return db[_0xe65f('0x3a')][_0xe65f('0x53')]({'where':{'id':_0x380dc6[_0xe65f('0x51')]['id']}})['then'](handleEntityNotFound(_0x349cd7,null))[_0xe65f('0x1c')](function(_0x2ecdaa){if(_0x2ecdaa){return _0x2ecdaa[_0xe65f('0x63')](_0x380dc6[_0xe65f('0x3f')][_0xe65f('0x64')]);}})[_0xe65f('0x1c')](respondWithStatusCode(_0x349cd7,null))[_0xe65f('0x25')](handleError(_0x349cd7,null));};exports[_0xe65f('0x65')]=function(_0x2c162e,_0xc1a9b7,_0x241dea){if(_0x2c162e['body']['id']){delete _0x2c162e['body']['id'];}return db[_0xe65f('0x3a')][_0xe65f('0x53')]({'where':{'id':_0x2c162e[_0xe65f('0x51')]['id']}})[_0xe65f('0x1c')](handleEntityNotFound(_0xc1a9b7,null))['then'](function(_0x179e0a){if(_0x179e0a){_0x2c162e[_0xe65f('0x5b')][_0xe65f('0x62')]=_0x179e0a['id'];return db[_0xe65f('0x66')][_0xe65f('0x54')](_0x2c162e[_0xe65f('0x5b')]);}})[_0xe65f('0x1c')](respondWithResult(_0xc1a9b7,null))[_0xe65f('0x25')](handleError(_0xc1a9b7,null));};exports['getAnswers']=function(_0x3102be,_0x568252,_0x133a3f){var _0x2bc75f={'raw':![],'where':{}};var _0x14d114={};var _0x58a0cb={'count':0x0,'rows':[]};return db['WhatsappAccount']['findOne']({'where':{'id':_0x3102be[_0xe65f('0x51')]['id']}})[_0xe65f('0x1c')](handleEntityNotFound(_0x568252,null))[_0xe65f('0x1c')](function(_0x4e0d25){if(_0x4e0d25){_0x14d114[_0xe65f('0x3e')]=_[_0xe65f('0x52')](db[_0xe65f('0x66')][_0xe65f('0x3b')]);_0x14d114[_0xe65f('0x3f')]=_[_0xe65f('0x52')](_0x3102be[_0xe65f('0x3f')]);_0x14d114['filters']=_['intersection'](_0x14d114[_0xe65f('0x3e')],_0x14d114[_0xe65f('0x3f')]);_0x2bc75f[_0xe65f('0x41')]=_[_0xe65f('0x40')](_0x14d114[_0xe65f('0x3e')],qs[_0xe65f('0x42')](_0x3102be[_0xe65f('0x3f')][_0xe65f('0x42')]));_0x2bc75f[_0xe65f('0x41')]=_0x2bc75f[_0xe65f('0x41')][_0xe65f('0x43')]?_0x2bc75f[_0xe65f('0x41')]:_0x14d114[_0xe65f('0x3e')];if(!_0x3102be['query'][_0xe65f('0x5f')]('nolimit')){_0x2bc75f[_0xe65f('0x28')]=qs[_0xe65f('0x28')](_0x3102be[_0xe65f('0x3f')][_0xe65f('0x28')]);_0x2bc75f[_0xe65f('0x27')]=qs['offset'](_0x3102be[_0xe65f('0x3f')][_0xe65f('0x27')]);}_0x2bc75f[_0xe65f('0x60')]=qs[_0xe65f('0x45')](_0x3102be['query'][_0xe65f('0x45')]);_0x2bc75f[_0xe65f('0x46')]=qs['filters'](_['pick'](_0x3102be['query'],_0x14d114[_0xe65f('0x47')]));_0x2bc75f['where']['WhatsappAccountId']=_0x4e0d25['id'];if(_0x3102be[_0xe65f('0x3f')][_0xe65f('0x48')]){_0x2bc75f[_0xe65f('0x46')]=_[_0xe65f('0x49')](_0x2bc75f['where'],{'$or':_[_0xe65f('0x39')](_0x2bc75f['attributes'],function(_0x3dd185){var _0x23f438={};_0x23f438[_0x3dd185]={'$like':'%'+_0x3102be[_0xe65f('0x3f')]['filter']+'%'};return _0x23f438;})});}_0x2bc75f=_[_0xe65f('0x49')]({},_0x2bc75f,_0x3102be[_0xe65f('0x4b')]);return db[_0xe65f('0x66')][_0xe65f('0x2a')]({'where':_0x2bc75f[_0xe65f('0x46')]})['then'](function(_0x36a4e5){_0x58a0cb[_0xe65f('0x2a')]=_0x36a4e5;if(_0x3102be[_0xe65f('0x3f')][_0xe65f('0x4c')]){_0x2bc75f[_0xe65f('0x4d')]=[{'all':!![]}];}return db['CannedAnswer'][_0xe65f('0x4e')](_0x2bc75f);})[_0xe65f('0x1c')](function(_0x2beaa8){_0x58a0cb['rows']=_0x2beaa8;return _0x58a0cb;});}})[_0xe65f('0x1c')](respondWithFilteredResult(_0x568252,_0x2bc75f))[_0xe65f('0x25')](handleError(_0x568252,null));};exports['removeAnswers']=function(_0x466bb8,_0x29c219,_0x5f2fb7){return db['WhatsappAccount'][_0xe65f('0x53')]({'where':{'id':_0x466bb8[_0xe65f('0x51')]['id']}})['then'](handleEntityNotFound(_0x29c219,null))[_0xe65f('0x1c')](function(_0x3d8321){if(_0x3d8321){return _0x3d8321[_0xe65f('0x67')](_0x466bb8[_0xe65f('0x3f')][_0xe65f('0x64')]);}})[_0xe65f('0x1c')](respondWithStatusCode(_0x29c219,null))[_0xe65f('0x25')](handleError(_0x29c219,null));};exports[_0xe65f('0x68')]=function(_0x9f6541,_0x423738,_0x13685c){return db[_0xe65f('0x3a')]['find']({'where':{'id':_0x9f6541[_0xe65f('0x51')]['id']}})[_0xe65f('0x1c')](handleEntityNotFound(_0x423738,null))['then'](function(_0x21ce7e){if(_0x21ce7e){return _0x21ce7e[_0xe65f('0x68')](_0x9f6541[_0xe65f('0x5b')][_0xe65f('0x64')],_[_0xe65f('0x69')](_0x9f6541[_0xe65f('0x5b')],[_0xe65f('0x64'),'id'])||{})['spread'](function(_0x30c722){for(var _0x3dcb58=0x0;_0x3dcb58<_0x9f6541[_0xe65f('0x5b')][_0xe65f('0x64')][_0xe65f('0x43')];_0x3dcb58+=0x1){socket[_0xe65f('0x6a')](_0xe65f('0x6b'),{'UserId':Number(_0x9f6541[_0xe65f('0x5b')]['ids'][_0x3dcb58]),'WhatsappAccountId':Number(_0x9f6541['params']['id'])});}return _0x30c722;});}})[_0xe65f('0x1c')](respondWithResult(_0x423738,null))[_0xe65f('0x25')](handleError(_0x423738,null));};exports[_0xe65f('0x6c')]=function(_0x1dbf0f,_0x23fadb,_0xe68f52){return db[_0xe65f('0x3a')][_0xe65f('0x53')]({'where':{'id':_0x1dbf0f[_0xe65f('0x51')]['id']}})['then'](handleEntityNotFound(_0x23fadb,null))['then'](function(_0x4a6ab9){if(_0x4a6ab9){return _0x4a6ab9['removeAgents'](_0x1dbf0f['query'][_0xe65f('0x64')])[_0xe65f('0x1c')](function(){if(_[_0xe65f('0x6d')](_0x1dbf0f[_0xe65f('0x3f')][_0xe65f('0x64')])){for(var _0x571e3b=0x0;_0x571e3b<_0x1dbf0f['query'][_0xe65f('0x64')][_0xe65f('0x43')];_0x571e3b+=0x1){socket[_0xe65f('0x6a')](_0xe65f('0x6e'),{'UserId':Number(_0x1dbf0f[_0xe65f('0x3f')][_0xe65f('0x64')][_0x571e3b]),'WhatsappAccountId':Number(_0x1dbf0f[_0xe65f('0x51')]['id'])});}}else{socket[_0xe65f('0x6a')](_0xe65f('0x6e'),{'UserId':Number(_0x1dbf0f[_0xe65f('0x3f')][_0xe65f('0x64')]),'WhatsappAccountId':Number(_0x1dbf0f[_0xe65f('0x51')]['id'])});}});}})[_0xe65f('0x1c')](respondWithStatusCode(_0x23fadb,null))['catch'](handleError(_0x23fadb,null));};exports[_0xe65f('0x6f')]=function(_0x4ab2c6,_0x138ce9,_0x1148ea){var _0x382256={};var _0x14b939={};var _0x288583;var _0x282542;return db['WhatsappAccount'][_0xe65f('0x70')]({'where':{'id':_0x4ab2c6[_0xe65f('0x51')]['id']}})[_0xe65f('0x1c')](handleEntityNotFound(_0x138ce9,null))[_0xe65f('0x1c')](function(_0x11047d){if(_0x11047d){_0x288583=_0x11047d;_0x14b939[_0xe65f('0x3e')]=_[_0xe65f('0x52')](db[_0xe65f('0x71')][_0xe65f('0x3b')]);_0x14b939[_0xe65f('0x3f')]=_[_0xe65f('0x52')](_0x4ab2c6[_0xe65f('0x3f')]);_0x14b939[_0xe65f('0x47')]=_[_0xe65f('0x40')](_0x14b939['model'],_0x14b939[_0xe65f('0x3f')]);_0x382256[_0xe65f('0x41')]=_[_0xe65f('0x40')](_0x14b939[_0xe65f('0x3e')],qs[_0xe65f('0x42')](_0x4ab2c6['query'][_0xe65f('0x42')]));_0x382256[_0xe65f('0x41')]=_0x382256[_0xe65f('0x41')][_0xe65f('0x43')]?_0x382256[_0xe65f('0x41')]:_0x14b939[_0xe65f('0x3e')];_0x382256['order']=qs[_0xe65f('0x45')](_0x4ab2c6[_0xe65f('0x3f')]['sort']);_0x382256[_0xe65f('0x46')]=qs['filters'](_[_0xe65f('0x61')](_0x4ab2c6['query'],_0x14b939[_0xe65f('0x47')]));if(_0x4ab2c6[_0xe65f('0x3f')][_0xe65f('0x48')]){_0x382256[_0xe65f('0x46')]=_[_0xe65f('0x49')](_0x382256[_0xe65f('0x46')],{'$or':_[_0xe65f('0x39')](_0x382256[_0xe65f('0x41')],function(_0x19e60b){var _0x16be94={};_0x16be94[_0x19e60b]={'$like':'%'+_0x4ab2c6[_0xe65f('0x3f')][_0xe65f('0x48')]+'%'};return _0x16be94;})});}_0x382256=_[_0xe65f('0x49')]({},_0x382256,_0x4ab2c6['options']);return _0x288583[_0xe65f('0x6f')](_0x382256);}})[_0xe65f('0x1c')](function(_0x629180){if(_0x629180){_0x282542=_0x629180['length'];if(!_0x4ab2c6[_0xe65f('0x3f')][_0xe65f('0x5f')](_0xe65f('0x44'))){_0x382256[_0xe65f('0x28')]=qs[_0xe65f('0x28')](_0x4ab2c6[_0xe65f('0x3f')]['limit']);_0x382256['offset']=qs[_0xe65f('0x27')](_0x4ab2c6[_0xe65f('0x3f')][_0xe65f('0x27')]);}return _0x288583[_0xe65f('0x6f')](_0x382256);}})['then'](function(_0x3e0f30){if(_0x3e0f30){return _0x3e0f30?{'count':_0x282542,'rows':_0x3e0f30}:null;}})['then'](respondWithResult(_0x138ce9,null))['catch'](handleError(_0x138ce9,null));};exports['addApplications']=function(_0x264e6d,_0x400b6b){var _0x1b51ed=_0x264e6d[_0xe65f('0x51')]['id'];var _0x176ee6=_0x264e6d['body'];var _0x28329d=0xc8;var _0x63f8db=null;return db['sequelize'][_0xe65f('0x72')]({'isolationLevel':db[_0xe65f('0x73')][_0xe65f('0x74')][_0xe65f('0x75')][_0xe65f('0x76')]},function(_0x19bf48){return db[_0xe65f('0x3a')]['findOne']({'where':{'id':_0x1b51ed},'transaction':_0x19bf48})[_0xe65f('0x1c')](function(_0x4a8ed5){if(_0x4a8ed5){return db['WhatsappApplication'][_0xe65f('0x30')]({'where':{'WhatsappAccountId':_0x1b51ed},'transaction':_0x19bf48})[_0xe65f('0x1c')](function(){var _0x32a9eb=_[_0xe65f('0x39')](_0x176ee6,function(_0x4394ff){_0x4394ff[_0xe65f('0x62')]=_0x1b51ed;return _0x4394ff;});return db[_0xe65f('0x77')][_0xe65f('0x78')](_0x32a9eb,{'transaction':_0x19bf48});});}else{_0x28329d=0x194;_0x63f8db=[];}});})[_0xe65f('0x1c')](function(){if(_0x28329d!==0x194){return db['WhatsappApplication'][_0xe65f('0x79')]({'where':{'WhatsappAccountId':_0x1b51ed},'order':'priority'})[_0xe65f('0x1c')](function(_0x391e8d){_0x63f8db=_0x391e8d;});}})[_0xe65f('0x25')](function(_0x18211b){_0x28329d=0x1f4;logger[_0xe65f('0x20')](_0x18211b[_0xe65f('0x34')]);if(_0x18211b[_0xe65f('0x35')]){delete _0x18211b[_0xe65f('0x35')];}_0x63f8db=_0x18211b;})[_0xe65f('0x7a')](function(){if(_0x63f8db===null){_0x400b6b['sendStatus'](_0x28329d);}else{if(_0x28329d===0x1f4){_0x400b6b[_0xe65f('0x32')](_0x28329d)[_0xe65f('0x7b')](_0x63f8db);}else{_0x400b6b['status'](_0x28329d)[_0xe65f('0x26')](_0x63f8db);}}});};exports['getApplications']=function(_0x33b1d4,_0x553abd,_0x10a8d5){var _0x20b8ac={};var _0x1cd2e7={};var _0x44b8e2;var _0x18f42d;return db[_0xe65f('0x3a')][_0xe65f('0x70')]({'where':{'id':_0x33b1d4[_0xe65f('0x51')]['id']}})[_0xe65f('0x1c')](handleEntityNotFound(_0x553abd,null))[_0xe65f('0x1c')](function(_0x5b7676){if(_0x5b7676){_0x44b8e2=_0x5b7676;_0x1cd2e7[_0xe65f('0x3e')]=_['keys'](db['WhatsappApplication'][_0xe65f('0x3b')]);_0x1cd2e7[_0xe65f('0x3f')]=_['keys'](_0x33b1d4[_0xe65f('0x3f')]);_0x1cd2e7[_0xe65f('0x47')]=_[_0xe65f('0x40')](_0x1cd2e7[_0xe65f('0x3e')],_0x1cd2e7[_0xe65f('0x3f')]);_0x20b8ac['attributes']=_[_0xe65f('0x40')](_0x1cd2e7['model'],qs['fields'](_0x33b1d4[_0xe65f('0x3f')][_0xe65f('0x42')]));_0x20b8ac[_0xe65f('0x41')]=_0x20b8ac[_0xe65f('0x41')]['length']?_0x20b8ac[_0xe65f('0x41')]:_0x1cd2e7[_0xe65f('0x3e')];_0x20b8ac[_0xe65f('0x60')]=qs[_0xe65f('0x45')](_0x33b1d4[_0xe65f('0x3f')][_0xe65f('0x45')]);_0x20b8ac[_0xe65f('0x46')]=qs[_0xe65f('0x47')](_[_0xe65f('0x61')](_0x33b1d4[_0xe65f('0x3f')],_0x1cd2e7['filters']));if(_0x33b1d4[_0xe65f('0x3f')][_0xe65f('0x48')]){_0x20b8ac[_0xe65f('0x46')]=_[_0xe65f('0x49')](_0x20b8ac[_0xe65f('0x46')],{'$or':_[_0xe65f('0x39')](_0x20b8ac[_0xe65f('0x41')],function(_0x445702){var _0x4249f0={};_0x4249f0[_0x445702]={'$like':'%'+_0x33b1d4['query'][_0xe65f('0x48')]+'%'};return _0x4249f0;})});}_0x20b8ac=_[_0xe65f('0x49')]({},_0x20b8ac,_0x33b1d4[_0xe65f('0x4b')]);return _0x44b8e2[_0xe65f('0x7c')](_0x20b8ac);}})[_0xe65f('0x1c')](function(_0x1a792a){if(_0x1a792a){_0x18f42d=_0x1a792a['length'];if(!_0x33b1d4['query'][_0xe65f('0x5f')](_0xe65f('0x44'))){_0x20b8ac[_0xe65f('0x28')]=qs[_0xe65f('0x28')](_0x33b1d4['query'][_0xe65f('0x28')]);_0x20b8ac['offset']=qs[_0xe65f('0x27')](_0x33b1d4['query'][_0xe65f('0x27')]);}return _0x44b8e2['getApplications'](_0x20b8ac);}})[_0xe65f('0x1c')](function(_0x439072){if(_0x439072){return _0x439072?{'count':_0x18f42d,'rows':_0x439072}:null;}})[_0xe65f('0x1c')](respondWithResult(_0x553abd,null))['catch'](handleError(_0x553abd,null));};exports[_0xe65f('0x7d')]=function(_0x409ec6,_0x1e7848,_0x51bdb0){var _0x16878f={'channel':_0xe65f('0x7e')};var _0x47018f=[];var _0xab2714=[];var _0x6f01ae={};return db[_0xe65f('0x3a')][_0xe65f('0x53')]({'where':{'id':_0x409ec6[_0xe65f('0x51')]['id']},'include':[{'model':db[_0xe65f('0x77')],'as':_0xe65f('0x7f')}]})[_0xe65f('0x1c')](handleEntityNotFound(_0x1e7848,null))['then'](function(_0x547377){_0x16878f[_0xe65f('0x80')]=_0x547377;if(_0x16878f['account']&&_0x16878f['account'][_0xe65f('0x3d')]===_0xe65f('0x81')&&_0x409ec6[_0xe65f('0x5b')][_0xe65f('0x82')]){if(_0x409ec6['body'][_0xe65f('0x82')][_0xe65f('0x43')]===0x0)return;if(_0x409ec6[_0xe65f('0x5b')][_0xe65f('0x82')][0x0][_0xe65f('0x83')]!==_0xe65f('0x84'))return;return db[_0xe65f('0x85')][_0xe65f('0x86')]({'read':!![],'readAt':_0x409ec6[_0xe65f('0x5b')][_0xe65f('0x82')][0x0]['timestamp']},{'where':{'messageId':_0x409ec6[_0xe65f('0x5b')][_0xe65f('0x82')][0x0][_0xe65f('0x87')]},'individualHooks':!![]})['then'](function(_0x40429d){return _0x1e7848[_0xe65f('0x32')](0xc8)[_0xe65f('0x26')](_0x40429d);});}_0x16878f[_0xe65f('0x88')]=_[_0xe65f('0x89')](_0x547377[_0xe65f('0x7f')],['priority'],['asc']);if(_0x16878f['account'][_0xe65f('0x7f')]){delete _0x16878f[_0xe65f('0x80')][_0xe65f('0x7f')];}return db[_0xe65f('0x8a')]['describe']()[_0xe65f('0x1c')](function(_0x41297e){if(!_0x41297e){throw new db[(_0xe65f('0x8b'))][(_0xe65f('0x8c'))](_0xe65f('0x8d'));}_0x47018f=_['difference'](_['keys'](_0x41297e),['createdAt',_0xe65f('0x8e')]);_0xab2714=_['difference'](_[_0xe65f('0x52')](_0x41297e),['createdAt','updatedAt',_0xe65f('0x8f'),_0xe65f('0x90')]);_0x16878f[_0xe65f('0x5b')]={'mapKey':'mobile'};if(_0x16878f[_0xe65f('0x80')]&&_0x16878f['account']['type']===_0xe65f('0x91')){_0x16878f[_0xe65f('0x5b')]['from']=_0x409ec6['body'][_0xe65f('0x92')][_0xe65f('0x93')]('whatsapp:','');_0x16878f[_0xe65f('0x5b')][_0xe65f('0x5b')]=_0x409ec6[_0xe65f('0x5b')]['Body'];_0x16878f[_0xe65f('0x5b')][_0xe65f('0x94')]=_0x409ec6[_0xe65f('0x5b')][_0xe65f('0x95')];}if(_0x16878f[_0xe65f('0x80')]&&_0x16878f[_0xe65f('0x80')][_0xe65f('0x3d')]==='sinch'){_0x16878f['body'][_0xe65f('0x96')]=_0x409ec6[_0xe65f('0x5b')]['notifications'][0x0][_0xe65f('0x96')];_0x16878f[_0xe65f('0x5b')][_0xe65f('0x5b')]=_0x409ec6[_0xe65f('0x5b')][_0xe65f('0x97')][0x0][_0xe65f('0x23')]['body'];_0x16878f[_0xe65f('0x5b')]['messageId']=_0x409ec6[_0xe65f('0x5b')]['notifications'][0x0]['message_id'];}if(_0x16878f[_0xe65f('0x5b')]['id']){delete _0x16878f['body']['id'];}if(_[_0xe65f('0x98')](_0x16878f[_0xe65f('0x5b')][_0xe65f('0x96')])){throw new db[(_0xe65f('0x8b'))]['ValidationError'](_0xe65f('0x99'));}if(_[_0xe65f('0x98')](_0x16878f[_0xe65f('0x5b')][_0xe65f('0x5b')])||_0x16878f[_0xe65f('0x5b')][_0xe65f('0x5b')]===''){throw new db[(_0xe65f('0x8b'))][(_0xe65f('0x8c'))](_0xe65f('0x9a'));}if(_[_0xe65f('0x98')](_0x16878f[_0xe65f('0x5b')][_0xe65f('0x9b')])){throw new db[(_0xe65f('0x8b'))][(_0xe65f('0x8c'))](_0xe65f('0x9c')+_0xab2714);}if(!_[_0xe65f('0x9d')](_0xab2714,_0x16878f['body'][_0xe65f('0x9b')])){throw new db[(_0xe65f('0x8b'))]['ValidationError'](_0xe65f('0x9e')+_0xab2714);}_0x6f01ae[_0x16878f['body'][_0xe65f('0x9b')]]=_0x16878f[_0xe65f('0x5b')][_0xe65f('0x96')];return db[_0xe65f('0x9f')][_0xe65f('0x53')]({'where':{'id':_0x16878f['account'][_0xe65f('0x90')]},'include':[{'model':db[_0xe65f('0x8a')],'as':'Contacts','where':_0x6f01ae,'limit':0x1,'order':[['updatedAt',_0xe65f('0xa0')]]}]});})['then'](handleEntityNotFound(_0x1e7848,null))[_0xe65f('0x1c')](function(_0x4ed417){if(_0x4ed417){_0x16878f['list']=_['omit'](_0x4ed417,[_0xe65f('0xa1')]);if(_0x4ed417[_0xe65f('0xa1')]['length']){return _0x4ed417['Contacts'][0x0];}var _0x25d3e6=_[_0xe65f('0x16')](_0x16878f[_0xe65f('0x5b')],{'firstName':_0x16878f['body'][_0xe65f('0x96')],'ListId':_0x4ed417['id']});_0x25d3e6[_0x16878f[_0xe65f('0x5b')][_0xe65f('0x9b')]]=_0x16878f[_0xe65f('0x5b')][_0xe65f('0x96')];return db['CmContact'][_0xe65f('0x54')](_0x25d3e6,{'fields':_0x47018f,'raw':!![]});}})[_0xe65f('0x1c')](handleEntityNotFound(_0x1e7848,null))['then'](function(_0x186732){if(_0x186732){_0x16878f['contact']=_0x186732;var _0x3dfa0a={'ContactId':_0x186732['id'],'phone':_0x16878f[_0xe65f('0x5b')][_0xe65f('0x96')],'WhatsappAccountId':_0x409ec6[_0xe65f('0x51')]['id']};var _0x7a5b56={'ContactId':_0x186732['id'],'WhatsappAccountId':_0x409ec6['params']['id'],'closed':![]};return db[_0xe65f('0xa2')][_0xe65f('0x53')]({'where':_0x7a5b56})[_0xe65f('0x1c')](function(_0x39fe2f){if(_0x39fe2f){return[_0x39fe2f,![]];}return db['WhatsappInteraction']['create'](_0x3dfa0a)[_0xe65f('0x1c')](function(_0x1b2ea2){return[_0x1b2ea2,!![]];});});}})[_0xe65f('0xa3')](function(_0x184811,_0x6dacd0){_0x16878f[_0xe65f('0xa4')]=_0x184811[_0xe65f('0x31')]({'plain':!![]});_0x16878f[_0xe65f('0xa4')]['created']=![];if(_0x6dacd0){if(_0x16878f['account'][_0xe65f('0xa5')]){_0x16878f['applications'][_0xe65f('0xa6')]({'id':0x0,'priority':_0x16878f[_0xe65f('0x88')][_0xe65f('0x43')]+0x1,'app':'close','appdata':_0xe65f('0xa7'),'interval':_0xe65f('0xa8')});}_0x16878f[_0xe65f('0xa4')][_0xe65f('0xa9')]=!![];}return db[_0xe65f('0x85')][_0xe65f('0x54')]({'phone':_0x16878f['body'][_0xe65f('0x96')],'messageId':_0x16878f[_0xe65f('0x5b')][_0xe65f('0x94')],'body':_0x16878f['body'][_0xe65f('0x5b')],'WhatsappAccountId':_0x409ec6[_0xe65f('0x51')]['id'],'WhatsappInteractionId':_0x184811['id'],'direction':'in','ContactId':_0x184811[_0xe65f('0xaa')],'AttachmentId':_0x16878f[_0xe65f('0x5b')][_0xe65f('0xab')]});})['then'](function(_0x1ff4d3){_0x16878f['message']=_0x1ff4d3;if(!_0x16878f[_0xe65f('0xa4')][_0xe65f('0xac')])return;return db[_0xe65f('0x71')][_0xe65f('0x53')]({'attributes':['id','name'],'where':{'id':_0x16878f['interaction']['UserId']}});})[_0xe65f('0x1c')](function(_0x59c563){if(_0x59c563){_0x16878f[_0xe65f('0x88')][_0xe65f('0xad')]({'id':0x0,'priority':0x0,'app':'agent','appdata':_0x59c563[_0xe65f('0x35')]+','+(_0x16878f[_0xe65f('0x80')][_0xe65f('0xae')]||0xa),'interval':'*,*,*,*'});}if(!_0x16878f[_0xe65f('0xa4')]['queueId'])return;return db[_0xe65f('0xaf')]['find']({'attributes':['id',_0xe65f('0x35')],'where':{'id':_0x16878f['interaction']['queueId']}});})['then'](function(_0x4578a9){if(_0x4578a9){_0x16878f[_0xe65f('0x88')][_0xe65f('0xad')]({'id':0x0,'priority':0x1,'app':_0xe65f('0xb0'),'appdata':_0x4578a9[_0xe65f('0x35')]+','+(_0x16878f[_0xe65f('0x80')][_0xe65f('0xb1')]||0x12c),'interval':_0xe65f('0xa8')});}return respondWithRpcPromise(_0xe65f('0xb2'),'startRouting',_0x16878f);})['then'](function(_0xa730c){if(_0xa730c){var _0x52afed=0xc8;var _0x2da0fb='receiveMessage';logger['info'](_0xe65f('0xb3'),_0x2da0fb,_0x52afed,'entity\x20found');logger[_0xe65f('0x1f')]('WhatsappAccount,\x20%s,\x20%s,\x20%s,\x20%s',_0x2da0fb,_0x52afed,_0xe65f('0xb4'),JSON[_0xe65f('0xb5')](_0xa730c));if(_0x16878f[_0xe65f('0x80')]['type']===_0xe65f('0x91')){return _0x1e7848[_0xe65f('0x32')](_0x52afed)[_0xe65f('0x2b')](_0xe65f('0xb6'),'text/xml')[_0xe65f('0x7b')]('\x0a');}else{return _0x1e7848['status'](_0x52afed)[_0xe65f('0x26')](_0xa730c);}}});})[_0xe65f('0x25')](handleError(_0x1e7848,null));};exports[_0xe65f('0x7b')]=function(_0x1510a4,_0x456831,_0x38a678){var _0x4b4f1f,_0x35aaee,_0x4df4bd;if(_[_0xe65f('0x98')](_0x1510a4[_0xe65f('0x5b')][_0xe65f('0x5b')])||_0x1510a4['body'][_0xe65f('0x5b')]===''){throw new db['Sequelize']['ValidationError'](_0xe65f('0x9a'));}if(_[_0xe65f('0x98')](_0x1510a4[_0xe65f('0x5b')]['to'])){throw new db[(_0xe65f('0x8b'))][(_0xe65f('0x8c'))](_0xe65f('0xb7'));}_0x4b4f1f=_0x1510a4[_0xe65f('0x5b')]['to'];return db[_0xe65f('0x3a')]['find']({'where':{'id':_0x1510a4[_0xe65f('0x51')]['id']},'include':[{'model':db[_0xe65f('0x9f')],'as':_0xe65f('0xb8'),'include':[{'model':db[_0xe65f('0x8a')],'as':_0xe65f('0xa1'),'where':{'mobile':_0x4b4f1f},'limit':0x1,'order':[['updatedAt',_0xe65f('0xa0')]]}]}]})[_0xe65f('0x1c')](handleEntityNotFound(_0x456831,null))[_0xe65f('0x1c')](function(_0x128102){if(_0x128102&&_0x128102[_0xe65f('0xb8')]){_0x35aaee=_0x128102[_0xe65f('0x31')]({'plain':!![]});if(_0x35aaee['List']&&_0x35aaee[_0xe65f('0xb8')][_0xe65f('0xa1')][_0xe65f('0x43')]){return _0x35aaee[_0xe65f('0xb8')][_0xe65f('0xa1')][0x0];}return db[_0xe65f('0x8a')][_0xe65f('0x54')](_[_0xe65f('0x16')](_0x1510a4[_0xe65f('0x5b')],{'firstName':_0x4b4f1f,'mobile':_0x4b4f1f,'phone':_0x4b4f1f,'ListId':_0x35aaee[_0xe65f('0x90')]}));}})[_0xe65f('0x1c')](handleEntityNotFound(_0x456831,null))[_0xe65f('0x1c')](function(_0x25ee1d){if(_0x25ee1d){_0x4df4bd=_0x25ee1d;return db[_0xe65f('0xa2')][_0xe65f('0x53')]({'where':{'ContactId':_0x4df4bd['id'],'closed':![],'WhatsappAccountId':_0x35aaee['id']}})['then'](function(_0x5c3ef0){if(_0x5c3ef0){return[_0x5c3ef0,![]];}return db['WhatsappInteraction'][_0xe65f('0x54')]({'UserId':_0x1510a4['user']['id'],'ContactId':_0x4df4bd['id'],'WhatsappAccountId':_0x35aaee['id'],'phone':_0x4b4f1f,'firstMsgDirection':_0xe65f('0xb9'),'Messages':[_['merge'](_0x1510a4[_0xe65f('0x5b')],{'read':![],'body':_0x1510a4[_0xe65f('0x5b')][_0xe65f('0x5b')],'phone':_0x4b4f1f,'WhatsappAccountId':_0x35aaee['id'],'UserId':_0x1510a4[_0xe65f('0x55')]['id'],'ContactId':_0x4df4bd['id']})]},{'include':[{'model':db[_0xe65f('0x85')],'as':_0xe65f('0xba')}]})[_0xe65f('0x1c')](function(_0xf44924){return[_0xf44924,!![]];});});}})[_0xe65f('0xa3')](function(_0x2d3ad8,_0x30f93f){if(_0x30f93f){return _0x2d3ad8;}return db[_0xe65f('0x85')][_0xe65f('0x54')](_[_0xe65f('0x49')](_0x1510a4['body'],{'read':![],'body':_0x1510a4[_0xe65f('0x5b')][_0xe65f('0x5b')],'phone':_0x4b4f1f,'WhatsappAccountId':_0x35aaee['id'],'WhatsappInteractionId':_0x2d3ad8['id'],'UserId':_0x1510a4[_0xe65f('0x55')]['id'],'ContactId':_0x4df4bd['id']}))['then'](function(_0x5c3e33){_0x2d3ad8[_0xe65f('0xbb')][_0xe65f('0xba')]=[];_0x2d3ad8[_0xe65f('0xbb')][_0xe65f('0xba')][_0xe65f('0xa6')](_0x5c3e33[_0xe65f('0xbb')]);return _0x2d3ad8;});})[_0xe65f('0x1c')](respondWithResult(_0x456831,null))[_0xe65f('0x25')](handleError(_0x456831,null));}; \ No newline at end of file diff --git a/server/api/whatsappAccount/whatsappAccount.events.js b/server/api/whatsappAccount/whatsappAccount.events.js index 1099f48..f39f9cb 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 _0xd1f4=['../../mysqldb','WhatsappAccount','setMaxListeners','save','update','remove','emit','hasOwnProperty','events'];(function(_0x248874,_0x26f631){var _0x2eb2ed=function(_0x467ff5){while(--_0x467ff5){_0x248874['push'](_0x248874['shift']());}};_0x2eb2ed(++_0x26f631);}(_0xd1f4,0x18b));var _0x4d1f=function(_0x2435fe,_0x5edfaa){_0x2435fe=_0x2435fe-0x0;var _0xef61e2=_0xd1f4[_0x2435fe];return _0xef61e2;};'use strict';var EventEmitter=require(_0x4d1f('0x0'));var WhatsappAccount=require(_0x4d1f('0x1'))['db'][_0x4d1f('0x2')];var WhatsappAccountEvents=new EventEmitter();WhatsappAccountEvents[_0x4d1f('0x3')](0x0);var events={'afterCreate':_0x4d1f('0x4'),'afterUpdate':_0x4d1f('0x5'),'afterDestroy':_0x4d1f('0x6')};function emitEvent(_0x3d5f94){return function(_0x388cb2,_0x56c961,_0x5692b0){WhatsappAccountEvents[_0x4d1f('0x7')](_0x3d5f94+':'+_0x388cb2['id'],_0x388cb2);WhatsappAccountEvents[_0x4d1f('0x7')](_0x3d5f94,_0x388cb2);_0x5692b0(null);};}for(var e in events){if(events[_0x4d1f('0x8')](e)){var event=events[e];WhatsappAccount['hook'](e,emitEvent(event));}}module['exports']=WhatsappAccountEvents; \ No newline at end of file +var _0xa02d=['exports','events','../../mysqldb','WhatsappAccount','setMaxListeners','emit','hasOwnProperty','hook'];(function(_0x378fcb,_0x32e78c){var _0x5dfe9b=function(_0x14cf62){while(--_0x14cf62){_0x378fcb['push'](_0x378fcb['shift']());}};_0x5dfe9b(++_0x32e78c);}(_0xa02d,0x89));var _0xda02=function(_0x595013,_0x65a215){_0x595013=_0x595013-0x0;var _0x2a29e3=_0xa02d[_0x595013];return _0x2a29e3;};'use strict';var EventEmitter=require(_0xda02('0x0'));var WhatsappAccount=require(_0xda02('0x1'))['db'][_0xda02('0x2')];var WhatsappAccountEvents=new EventEmitter();WhatsappAccountEvents[_0xda02('0x3')](0x0);var events={'afterCreate':'save','afterUpdate':'update','afterDestroy':'remove'};function emitEvent(_0x185228){return function(_0x50c927,_0xdb8747,_0x16d547){WhatsappAccountEvents[_0xda02('0x4')](_0x185228+':'+_0x50c927['id'],_0x50c927);WhatsappAccountEvents[_0xda02('0x4')](_0x185228,_0x50c927);_0x16d547(null);};}for(var e in events){if(events[_0xda02('0x5')](e)){var event=events[e];WhatsappAccount[_0xda02('0x6')](e,emitEvent(event));}}module[_0xda02('0x7')]=WhatsappAccountEvents; \ No newline at end of file diff --git a/server/api/whatsappAccount/whatsappAccount.model.js b/server/api/whatsappAccount/whatsappAccount.model.js index 0be96e1..76c343d 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 _0x4618=['WhatsappAccount','whatsapp_accounts','moment','bluebird','request-promise','path','rimraf','./whatsappAccount.attributes','define'];(function(_0x15bc81,_0x4d4f77){var _0x59440e=function(_0x1b60f2){while(--_0x1b60f2){_0x15bc81['push'](_0x15bc81['shift']());}};_0x59440e(++_0x4d4f77);}(_0x4618,0xda));var _0x8461=function(_0x5f09c5,_0x2bfca0){_0x5f09c5=_0x5f09c5-0x0;var _0x426ad9=_0x4618[_0x5f09c5];return _0x426ad9;};'use strict';var _=require('lodash');var util=require('util');var logger=require('../../config/logger')('api');var moment=require(_0x8461('0x0'));var BPromise=require(_0x8461('0x1'));var rp=require(_0x8461('0x2'));var fs=require('fs');var path=require(_0x8461('0x3'));var rimraf=require(_0x8461('0x4'));var config=require('../../config/environment');var attributes=require(_0x8461('0x5'));module['exports']=function(_0x3150c5,_0x21d769){return _0x3150c5[_0x8461('0x6')](_0x8461('0x7'),attributes,{'tableName':_0x8461('0x8'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xc74e=['util','../../config/logger','api','moment','bluebird','rimraf','../../config/environment','./whatsappAccount.attributes','exports','define','whatsapp_accounts','lodash'];(function(_0x109105,_0x5e9edf){var _0x4f9a6c=function(_0x323e59){while(--_0x323e59){_0x109105['push'](_0x109105['shift']());}};_0x4f9a6c(++_0x5e9edf);}(_0xc74e,0x77));var _0xec74=function(_0x3947c9,_0x4d6c97){_0x3947c9=_0x3947c9-0x0;var _0x2e7871=_0xc74e[_0x3947c9];return _0x2e7871;};'use strict';var _=require(_0xec74('0x0'));var util=require(_0xec74('0x1'));var logger=require(_0xec74('0x2'))(_0xec74('0x3'));var moment=require(_0xec74('0x4'));var BPromise=require(_0xec74('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0xec74('0x6'));var config=require(_0xec74('0x7'));var attributes=require(_0xec74('0x8'));module[_0xec74('0x9')]=function(_0x3197f8,_0x3e0e0a){return _0x3197f8[_0xec74('0xa')]('WhatsappAccount',attributes,{'tableName':_0xec74('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 9b2cef7..19584e2 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 _0x3166=['message','info','catch','ShowWhatsappAccount','WhatsappAccount','options','raw','where','include','map','model','attributes','util','moment','bluebird','ioredis','../../mysqldb','../../config/logger','rpc','jayson/promise','client','http','redis','localhost','./whatsappAccount.socket','register','request','then','WhatsappAccount,\x20%s,\x20%s','request\x20sent','debug','WhatsappAccount,\x20%s,\x20%s,\x20%s','stringify','error','code'];(function(_0x5b5641,_0x439102){var _0xb51db1=function(_0x964c58){while(--_0x964c58){_0x5b5641['push'](_0x5b5641['shift']());}};_0xb51db1(++_0x439102);}(_0x3166,0xbb));var _0x6316=function(_0x28a2aa,_0x373c9a){_0x28a2aa=_0x28a2aa-0x0;var _0x125975=_0x3166[_0x28a2aa];return _0x125975;};'use strict';var _=require('lodash');var util=require(_0x6316('0x0'));var moment=require(_0x6316('0x1'));var BPromise=require(_0x6316('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x6316('0x3'));var db=require(_0x6316('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0x6316('0x5'))(_0x6316('0x6'));var config=require('../../config/environment');var jayson=require(_0x6316('0x7'));var client=jayson[_0x6316('0x8')][_0x6316('0x9')]({'port':0x232a});config[_0x6316('0xa')]=_['defaults'](config[_0x6316('0xa')],{'host':_0x6316('0xb'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x6316('0xa')]));require(_0x6316('0xc'))[_0x6316('0xd')](socket);function respondWithRpcPromise(_0x39b005,_0x39570a,_0xa599d5){return new BPromise(function(_0x2930d7,_0x26d437){return client[_0x6316('0xe')](_0x39b005,_0xa599d5)[_0x6316('0xf')](function(_0xeb4358){logger['info'](_0x6316('0x10'),_0x39570a,_0x6316('0x11'));logger[_0x6316('0x12')](_0x6316('0x13'),_0x39570a,_0x6316('0x11'),JSON[_0x6316('0x14')](_0xeb4358));if(_0xeb4358['error']){if(_0xeb4358[_0x6316('0x15')][_0x6316('0x16')]===0x1f4){logger[_0x6316('0x15')](_0x6316('0x10'),_0x39570a,_0xeb4358['error'][_0x6316('0x17')]);return _0x26d437(_0xeb4358[_0x6316('0x15')][_0x6316('0x17')]);}logger['error'](_0x6316('0x10'),_0x39570a,_0xeb4358[_0x6316('0x15')]['message']);return _0x2930d7(_0xeb4358[_0x6316('0x15')][_0x6316('0x17')]);}else{logger[_0x6316('0x18')](_0x6316('0x10'),_0x39570a,'request\x20sent');_0x2930d7(_0xeb4358['result'][_0x6316('0x17')]);}})[_0x6316('0x19')](function(_0xf70772){logger[_0x6316('0x15')](_0x6316('0x10'),_0x39570a,_0xf70772);_0x26d437(_0xf70772);});});}exports[_0x6316('0x1a')]=function(_0x17ca5b){var _0x3ca71f=this;return new Promise(function(_0x111a38,_0x3e4543){return db[_0x6316('0x1b')]['find']({'raw':_0x17ca5b[_0x6316('0x1c')]?_0x17ca5b[_0x6316('0x1c')][_0x6316('0x1d')]===undefined?!![]:![]:!![],'where':_0x17ca5b[_0x6316('0x1c')]?_0x17ca5b[_0x6316('0x1c')][_0x6316('0x1e')]||null:null,'attributes':_0x17ca5b[_0x6316('0x1c')]?_0x17ca5b[_0x6316('0x1c')]['attributes']||null:null,'include':_0x17ca5b[_0x6316('0x1c')]?_0x17ca5b[_0x6316('0x1c')][_0x6316('0x1f')]?_[_0x6316('0x20')](_0x17ca5b['options'][_0x6316('0x1f')],function(_0x378cdf){return{'model':db[_0x378cdf[_0x6316('0x21')]],'as':_0x378cdf['as'],'attributes':_0x378cdf['attributes'],'include':_0x378cdf[_0x6316('0x1f')]?_[_0x6316('0x20')](_0x378cdf[_0x6316('0x1f')],function(_0x16a64b){return{'model':db[_0x16a64b[_0x6316('0x21')]],'as':_0x16a64b['as'],'attributes':_0x16a64b[_0x6316('0x22')],'include':_0x16a64b[_0x6316('0x1f')]?_[_0x6316('0x20')](_0x16a64b[_0x6316('0x1f')],function(_0x575e0e){return{'model':db[_0x575e0e[_0x6316('0x21')]],'as':_0x575e0e['as'],'attributes':_0x575e0e[_0x6316('0x22')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x30b984){logger['info'](_0x6316('0x1a'),_0x17ca5b);logger[_0x6316('0x12')]('ShowWhatsappAccount',_0x17ca5b,JSON['stringify'](_0x30b984));_0x111a38(_0x30b984);})[_0x6316('0x19')](function(_0x4f97fc){logger['error']('ShowWhatsappAccount',_0x4f97fc['message'],_0x17ca5b);_0x3e4543(_0x3ca71f[_0x6316('0x15')](0x1f4,_0x4f97fc[_0x6316('0x17')]));});});}; \ No newline at end of file +var _0x092f=['info','WhatsappAccount,\x20%s,\x20%s','request\x20sent','WhatsappAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','ShowWhatsappAccount','WhatsappAccount','find','options','raw','where','attributes','map','include','model','debug','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','client','http','defaults','localhost','socket.io-emitter','./whatsappAccount.socket','register','request','then'];(function(_0x38a469,_0x6f7bed){var _0x3529da=function(_0x4242f6){while(--_0x4242f6){_0x38a469['push'](_0x38a469['shift']());}};_0x3529da(++_0x6f7bed);}(_0x092f,0x1dc));var _0xf092=function(_0x3a4f18,_0x1af741){_0x3a4f18=_0x3a4f18-0x0;var _0x4c20fc=_0x092f[_0x3a4f18];return _0x4c20fc;};'use strict';var _=require(_0xf092('0x0'));var util=require(_0xf092('0x1'));var moment=require(_0xf092('0x2'));var BPromise=require(_0xf092('0x3'));var rs=require(_0xf092('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xf092('0x5'))['db'];var utils=require(_0xf092('0x6'));var logger=require(_0xf092('0x7'))('rpc');var config=require(_0xf092('0x8'));var jayson=require('jayson/promise');var client=jayson[_0xf092('0x9')][_0xf092('0xa')]({'port':0x232a});config['redis']=_[_0xf092('0xb')](config['redis'],{'host':_0xf092('0xc'),'port':0x18eb});var socket=require(_0xf092('0xd'))(new Redis(config['redis']));require(_0xf092('0xe'))[_0xf092('0xf')](socket);function respondWithRpcPromise(_0x47b8fe,_0x417dd9,_0x8452d3){return new BPromise(function(_0x4d38cb,_0x33cb99){return client[_0xf092('0x10')](_0x47b8fe,_0x8452d3)[_0xf092('0x11')](function(_0x16814b){logger[_0xf092('0x12')](_0xf092('0x13'),_0x417dd9,_0xf092('0x14'));logger['debug'](_0xf092('0x15'),_0x417dd9,_0xf092('0x14'),JSON[_0xf092('0x16')](_0x16814b));if(_0x16814b[_0xf092('0x17')]){if(_0x16814b['error'][_0xf092('0x18')]===0x1f4){logger[_0xf092('0x17')](_0xf092('0x13'),_0x417dd9,_0x16814b[_0xf092('0x17')]['message']);return _0x33cb99(_0x16814b['error'][_0xf092('0x19')]);}logger[_0xf092('0x17')](_0xf092('0x13'),_0x417dd9,_0x16814b[_0xf092('0x17')][_0xf092('0x19')]);return _0x4d38cb(_0x16814b['error']['message']);}else{logger['info'](_0xf092('0x13'),_0x417dd9,_0xf092('0x14'));_0x4d38cb(_0x16814b['result'][_0xf092('0x19')]);}})[_0xf092('0x1a')](function(_0x1a65ab){logger[_0xf092('0x17')](_0xf092('0x13'),_0x417dd9,_0x1a65ab);_0x33cb99(_0x1a65ab);});});}exports[_0xf092('0x1b')]=function(_0x171d4c){var _0x826df1=this;return new Promise(function(_0x1a14b0,_0x203ca6){return db[_0xf092('0x1c')][_0xf092('0x1d')]({'raw':_0x171d4c[_0xf092('0x1e')]?_0x171d4c[_0xf092('0x1e')][_0xf092('0x1f')]===undefined?!![]:![]:!![],'where':_0x171d4c[_0xf092('0x1e')]?_0x171d4c[_0xf092('0x1e')][_0xf092('0x20')]||null:null,'attributes':_0x171d4c['options']?_0x171d4c[_0xf092('0x1e')][_0xf092('0x21')]||null:null,'include':_0x171d4c['options']?_0x171d4c['options']['include']?_[_0xf092('0x22')](_0x171d4c[_0xf092('0x1e')][_0xf092('0x23')],function(_0x4619b7){return{'model':db[_0x4619b7['model']],'as':_0x4619b7['as'],'attributes':_0x4619b7[_0xf092('0x21')],'include':_0x4619b7[_0xf092('0x23')]?_['map'](_0x4619b7[_0xf092('0x23')],function(_0x5a0cdb){return{'model':db[_0x5a0cdb[_0xf092('0x24')]],'as':_0x5a0cdb['as'],'attributes':_0x5a0cdb[_0xf092('0x21')],'include':_0x5a0cdb[_0xf092('0x23')]?_[_0xf092('0x22')](_0x5a0cdb[_0xf092('0x23')],function(_0x31f020){return{'model':db[_0x31f020[_0xf092('0x24')]],'as':_0x31f020['as'],'attributes':_0x31f020[_0xf092('0x21')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x5c9477){logger[_0xf092('0x12')](_0xf092('0x1b'),_0x171d4c);logger[_0xf092('0x25')](_0xf092('0x1b'),_0x171d4c,JSON['stringify'](_0x5c9477));_0x1a14b0(_0x5c9477);})[_0xf092('0x1a')](function(_0x2b89b7){logger[_0xf092('0x17')](_0xf092('0x1b'),_0x2b89b7[_0xf092('0x19')],_0x171d4c);_0x203ca6(_0x826df1[_0xf092('0x17')](0x1f4,_0x2b89b7[_0xf092('0x19')]));});});}; \ No newline at end of file diff --git a/server/api/whatsappAccount/whatsappAccount.socket.js b/server/api/whatsappAccount/whatsappAccount.socket.js index b69ecd4..ca8b29a 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 _0xbaa8=['length','whatsappAccount:','./whatsappAccount.events','save','remove','update'];(function(_0x1d64fe,_0x21e967){var _0x27bd64=function(_0x259101){while(--_0x259101){_0x1d64fe['push'](_0x1d64fe['shift']());}};_0x27bd64(++_0x21e967);}(_0xbaa8,0x110));var _0x8baa=function(_0x32f3e3,_0x21da17){_0x32f3e3=_0x32f3e3-0x0;var _0xe0295a=_0xbaa8[_0x32f3e3];return _0xe0295a;};'use strict';var WhatsappAccountEvents=require(_0x8baa('0x0'));var events=[_0x8baa('0x1'),_0x8baa('0x2'),_0x8baa('0x3')];function createListener(_0x5f4bb4,_0xbcc43e){return function(_0x57f4c2){_0xbcc43e['emit'](_0x5f4bb4,_0x57f4c2);};}function removeListener(_0x31fe1c,_0x32b7fb){return function(){WhatsappAccountEvents['removeListener'](_0x31fe1c,_0x32b7fb);};}exports['register']=function(_0x2a084f){for(var _0xf041af=0x0,_0x7684fc=events[_0x8baa('0x4')];_0xf041af<_0x7684fc;_0xf041af++){var _0x33bf70=events[_0xf041af];var _0x5f2db4=createListener(_0x8baa('0x5')+_0x33bf70,_0x2a084f);WhatsappAccountEvents['on'](_0x33bf70,_0x5f2db4);}}; \ No newline at end of file +var _0x2ca2=['update','removeListener','register','length','whatsappAccount:','./whatsappAccount.events','save'];(function(_0x59fffa,_0x5a61db){var _0x281d4e=function(_0x5327ca){while(--_0x5327ca){_0x59fffa['push'](_0x59fffa['shift']());}};_0x281d4e(++_0x5a61db);}(_0x2ca2,0x1da));var _0x22ca=function(_0x411867,_0x5db935){_0x411867=_0x411867-0x0;var _0x3f1fc4=_0x2ca2[_0x411867];return _0x3f1fc4;};'use strict';var WhatsappAccountEvents=require(_0x22ca('0x0'));var events=[_0x22ca('0x1'),'remove',_0x22ca('0x2')];function createListener(_0x27c7af,_0x106bb9){return function(_0x3046d9){_0x106bb9['emit'](_0x27c7af,_0x3046d9);};}function removeListener(_0x476abe,_0x1a00ee){return function(){WhatsappAccountEvents[_0x22ca('0x3')](_0x476abe,_0x1a00ee);};}exports[_0x22ca('0x4')]=function(_0x965a5c){for(var _0x568d17=0x0,_0xde7528=events[_0x22ca('0x5')];_0x568d17<_0xde7528;_0x568d17++){var _0x1b94ca=events[_0x568d17];var _0x146542=createListener(_0x22ca('0x6')+_0x1b94ca,_0x965a5c);WhatsappAccountEvents['on'](_0x1b94ca,_0x146542);}}; \ No newline at end of file diff --git a/server/api/whatsappApplication/index.js b/server/api/whatsappApplication/index.js index ed618a8..8c34a73 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 _0x5202=['util','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','index','/:id','isAuthenticated','post','create','update','multer'];(function(_0x1d24eb,_0x12295b){var _0x1dc576=function(_0x4d5770){while(--_0x4d5770){_0x1d24eb['push'](_0x1d24eb['shift']());}};_0x1dc576(++_0x12295b);}(_0x5202,0x74));var _0x2520=function(_0x554e2c,_0x311468){_0x554e2c=_0x554e2c-0x0;var _0x28b199=_0x5202[_0x554e2c];return _0x28b199;};'use strict';var multer=require(_0x2520('0x0'));var util=require(_0x2520('0x1'));var path=require('path');var timeout=require(_0x2520('0x2'));var express=require('express');var router=express[_0x2520('0x3')]();var fs_extra=require(_0x2520('0x4'));var auth=require(_0x2520('0x5'));var interaction=require(_0x2520('0x6'));var config=require('../../config/environment');var controller=require('./whatsappApplication.controller');router['get']('/',auth['isAuthenticated'](),controller[_0x2520('0x7')]);router['get'](_0x2520('0x8'),auth[_0x2520('0x9')](),controller['show']);router[_0x2520('0xa')]('/',auth[_0x2520('0x9')](),controller[_0x2520('0xb')]);router['put'](_0x2520('0x8'),auth[_0x2520('0x9')](),controller[_0x2520('0xc')]);router['delete'](_0x2520('0x8'),auth[_0x2520('0x9')](),controller['destroy']);module['exports']=router; \ No newline at end of file +var _0x631a=['fs-extra','../../components/auth/service','../../config/environment','./whatsappApplication.controller','isAuthenticated','index','get','/:id','show','create','put','update','delete','destroy','exports','multer','path','express','Router'];(function(_0x796734,_0x23296f){var _0x3378ee=function(_0x5a626f){while(--_0x5a626f){_0x796734['push'](_0x796734['shift']());}};_0x3378ee(++_0x23296f);}(_0x631a,0x1c4));var _0xa631=function(_0x3e3219,_0x24f4dc){_0x3e3219=_0x3e3219-0x0;var _0x4c826a=_0x631a[_0x3e3219];return _0x4c826a;};'use strict';var multer=require(_0xa631('0x0'));var util=require('util');var path=require(_0xa631('0x1'));var timeout=require('connect-timeout');var express=require(_0xa631('0x2'));var router=express[_0xa631('0x3')]();var fs_extra=require(_0xa631('0x4'));var auth=require(_0xa631('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0xa631('0x6'));var controller=require(_0xa631('0x7'));router['get']('/',auth[_0xa631('0x8')](),controller[_0xa631('0x9')]);router[_0xa631('0xa')](_0xa631('0xb'),auth[_0xa631('0x8')](),controller[_0xa631('0xc')]);router['post']('/',auth[_0xa631('0x8')](),controller[_0xa631('0xd')]);router[_0xa631('0xe')](_0xa631('0xb'),auth[_0xa631('0x8')](),controller[_0xa631('0xf')]);router[_0xa631('0x10')](_0xa631('0xb'),auth[_0xa631('0x8')](),controller[_0xa631('0x11')]);module[_0xa631('0x12')]=router; \ No newline at end of file diff --git a/server/api/whatsappApplication/whatsappApplication.attributes.js b/server/api/whatsappApplication/whatsappApplication.attributes.js index 04882d0..bbe89fe 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 _0x0b66=['STRING','noop','TEXT','*,*,*,*','exports','INTEGER'];(function(_0x32776a,_0x592b3b){var _0x4e4c3f=function(_0x328a00){while(--_0x328a00){_0x32776a['push'](_0x32776a['shift']());}};_0x4e4c3f(++_0x592b3b);}(_0x0b66,0x1de));var _0x60b6=function(_0x5aee50,_0x52cd3d){_0x5aee50=_0x5aee50-0x0;var _0x32c480=_0x0b66[_0x5aee50];return _0x32c480;};'use strict';var Sequelize=require('sequelize');module[_0x60b6('0x0')]={'priority':{'type':Sequelize[_0x60b6('0x1')],'allowNull':![]},'app':{'type':Sequelize[_0x60b6('0x2')],'allowNull':![],'defaultValue':_0x60b6('0x3')},'appdata':{'type':Sequelize[_0x60b6('0x4')]()},'description':{'type':Sequelize[_0x60b6('0x2')]},'interval':{'type':Sequelize[_0x60b6('0x2')],'defaultValue':_0x60b6('0x5')}}; \ No newline at end of file +var _0x0570=['STRING','sequelize','exports','INTEGER','noop','TEXT'];(function(_0x1b5aea,_0x3f04b7){var _0x15cfc6=function(_0x204e92){while(--_0x204e92){_0x1b5aea['push'](_0x1b5aea['shift']());}};_0x15cfc6(++_0x3f04b7);}(_0x0570,0x115));var _0x0057=function(_0x4b1d3f,_0x4e3b19){_0x4b1d3f=_0x4b1d3f-0x0;var _0x24f22d=_0x0570[_0x4b1d3f];return _0x24f22d;};'use strict';var Sequelize=require(_0x0057('0x0'));module[_0x0057('0x1')]={'priority':{'type':Sequelize[_0x0057('0x2')],'allowNull':![]},'app':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':_0x0057('0x3')},'appdata':{'type':Sequelize[_0x0057('0x4')]()},'description':{'type':Sequelize[_0x0057('0x5')]},'interval':{'type':Sequelize[_0x0057('0x5')],'defaultValue':'*,*,*,*'}}; \ No newline at end of file diff --git a/server/api/whatsappApplication/whatsappApplication.controller.js b/server/api/whatsappApplication/whatsappApplication.controller.js index 5eb1d22..fb405d6 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 _0xa064=['model','map','query','keys','filters','attributes','intersection','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','include','rows','catch','show','params','fields','length','find','body','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','mustache','path','sox','ejs','fs-extra','squel','crypto','to-csv','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','end','status','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','then','destroy','error','stack','name','send','index','WhatsappApplication','rawAttributes','key'];(function(_0xbd08b4,_0x4790ed){var _0x314f1e=function(_0x161589){while(--_0x161589){_0xbd08b4['push'](_0xbd08b4['shift']());}};_0x314f1e(++_0x4790ed);}(_0xa064,0x192));var _0x4a06=function(_0x997ede,_0x5a0814){_0x997ede=_0x997ede-0x0;var _0x1f3288=_0xa064[_0x997ede];return _0x1f3288;};'use strict';var emlformat=require(_0x4a06('0x0'));var rimraf=require(_0x4a06('0x1'));var zipdir=require(_0x4a06('0x2'));var jsonpatch=require(_0x4a06('0x3'));var rp=require(_0x4a06('0x4'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0x4a06('0x5'));var util=require('util');var path=require(_0x4a06('0x6'));var sox=require(_0x4a06('0x7'));var csv=require('to-csv');var ejs=require(_0x4a06('0x8'));var fs=require('fs');var fs_extra=require(_0x4a06('0x9'));var _=require('lodash');var squel=require(_0x4a06('0xa'));var crypto=require(_0x4a06('0xb'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0x4a06('0xc'));var querystring=require(_0x4a06('0xd'));var Papa=require(_0x4a06('0xe'));var Redis=require(_0x4a06('0xf'));var authService=require('../../components/auth/service');var qs=require(_0x4a06('0x10'));var as=require(_0x4a06('0x11'));var hardwareService=require(_0x4a06('0x12'));var logger=require(_0x4a06('0x13'))(_0x4a06('0x14'));var utils=require(_0x4a06('0x15'));var config=require(_0x4a06('0x16'));var licenseUtil=require('../../config/license/util');var db=require(_0x4a06('0x17'))['db'];function respondWithStatusCode(_0x52818e,_0x16d686){_0x16d686=_0x16d686||0xcc;return function(_0x3ac986){if(_0x3ac986){return _0x52818e[_0x4a06('0x18')](_0x16d686);}return _0x52818e['status'](_0x16d686)[_0x4a06('0x19')]();};}function respondWithResult(_0xdbc234,_0xf9b166){_0xf9b166=_0xf9b166||0xc8;return function(_0x569aed){if(_0x569aed){return _0xdbc234[_0x4a06('0x1a')](_0xf9b166)[_0x4a06('0x1b')](_0x569aed);}};}function respondWithFilteredResult(_0x292770,_0x51643c){return function(_0x221a80){if(_0x221a80){var _0x29e99b=typeof _0x51643c[_0x4a06('0x1c')]===_0x4a06('0x1d')&&typeof _0x51643c[_0x4a06('0x1e')]==='undefined';var _0x19c96d=_0x221a80['count'];var _0x4fd47f=_0x29e99b?0x0:_0x51643c[_0x4a06('0x1c')];var _0x463aca=_0x29e99b?_0x221a80[_0x4a06('0x1f')]:_0x51643c[_0x4a06('0x1c')]+_0x51643c[_0x4a06('0x1e')];var _0x226538;if(_0x463aca>=_0x19c96d){_0x463aca=_0x19c96d;_0x226538=0xc8;}else{_0x226538=0xce;}_0x292770[_0x4a06('0x1a')](_0x226538);return _0x292770[_0x4a06('0x20')](_0x4a06('0x21'),_0x4fd47f+'-'+_0x463aca+'/'+_0x19c96d)['json'](_0x221a80);}return null;};}function patchUpdates(_0x98df26){return function(_0x3933e6){try{jsonpatch[_0x4a06('0x22')](_0x3933e6,_0x98df26,!![]);}catch(_0x357f82){return BPromise[_0x4a06('0x23')](_0x357f82);}return _0x3933e6[_0x4a06('0x24')]();};}function saveUpdates(_0x20f9f4,_0x156af7){return function(_0xae7471){if(_0xae7471){return _0xae7471[_0x4a06('0x25')](_0x20f9f4)[_0x4a06('0x26')](function(_0x44eb74){return _0x44eb74;});}return null;};}function removeEntity(_0x38c823,_0x5ebd7c){return function(_0x501ee9){if(_0x501ee9){return _0x501ee9[_0x4a06('0x27')]()[_0x4a06('0x26')](function(){_0x38c823[_0x4a06('0x1a')](0xcc)[_0x4a06('0x19')]();});}};}function handleEntityNotFound(_0x5b5a43,_0x5e8af0){return function(_0xf7e565){if(!_0xf7e565){_0x5b5a43[_0x4a06('0x18')](0x194);}return _0xf7e565;};}function handleError(_0x55861c,_0xdf5163){_0xdf5163=_0xdf5163||0x1f4;return function(_0x54613e){logger[_0x4a06('0x28')](_0x54613e[_0x4a06('0x29')]);if(_0x54613e['name']){delete _0x54613e[_0x4a06('0x2a')];}_0x55861c[_0x4a06('0x1a')](_0xdf5163)[_0x4a06('0x2b')](_0x54613e);};}exports[_0x4a06('0x2c')]=function(_0x1c14d3,_0x37cb33){var _0x5ee187={},_0x255924={},_0x452188={'count':0x0,'rows':[]};var _0x1ab220=_['map'](db[_0x4a06('0x2d')][_0x4a06('0x2e')],function(_0x20cf23){return{'name':_0x20cf23['fieldName'],'type':_0x20cf23['type'][_0x4a06('0x2f')]};});_0x255924[_0x4a06('0x30')]=_[_0x4a06('0x31')](_0x1ab220,_0x4a06('0x2a'));_0x255924[_0x4a06('0x32')]=_[_0x4a06('0x33')](_0x1c14d3[_0x4a06('0x32')]);_0x255924[_0x4a06('0x34')]=_['intersection'](_0x255924[_0x4a06('0x30')],_0x255924[_0x4a06('0x32')]);_0x5ee187[_0x4a06('0x35')]=_[_0x4a06('0x36')](_0x255924[_0x4a06('0x30')],qs['fields'](_0x1c14d3[_0x4a06('0x32')]['fields']));_0x5ee187[_0x4a06('0x35')]=_0x5ee187[_0x4a06('0x35')]['length']?_0x5ee187[_0x4a06('0x35')]:_0x255924[_0x4a06('0x30')];if(!_0x1c14d3[_0x4a06('0x32')][_0x4a06('0x37')](_0x4a06('0x38'))){_0x5ee187['limit']=qs[_0x4a06('0x1e')](_0x1c14d3['query'][_0x4a06('0x1e')]);_0x5ee187[_0x4a06('0x1c')]=qs[_0x4a06('0x1c')](_0x1c14d3['query'][_0x4a06('0x1c')]);}_0x5ee187[_0x4a06('0x39')]=qs[_0x4a06('0x3a')](_0x1c14d3[_0x4a06('0x32')][_0x4a06('0x3a')]);_0x5ee187[_0x4a06('0x3b')]=qs['filters'](_[_0x4a06('0x3c')](_0x1c14d3['query'],_0x255924[_0x4a06('0x34')]),_0x1ab220);if(_0x1c14d3[_0x4a06('0x32')][_0x4a06('0x3d')]){_0x5ee187['where']=_[_0x4a06('0x3e')](_0x5ee187['where'],{'$or':_[_0x4a06('0x31')](_0x1ab220,function(_0x59517c){if(_0x59517c['type']!==_0x4a06('0x3f')){var _0x84b40e={};_0x84b40e[_0x59517c[_0x4a06('0x2a')]]={'$like':'%'+_0x1c14d3[_0x4a06('0x32')][_0x4a06('0x3d')]+'%'};return _0x84b40e;}})});}_0x5ee187=_[_0x4a06('0x3e')]({},_0x5ee187,_0x1c14d3[_0x4a06('0x40')]);var _0x1084b8={'where':_0x5ee187[_0x4a06('0x3b')]};return db['WhatsappApplication']['count'](_0x1084b8)[_0x4a06('0x26')](function(_0x284a2b){_0x452188[_0x4a06('0x1f')]=_0x284a2b;if(_0x1c14d3[_0x4a06('0x32')][_0x4a06('0x41')]){_0x5ee187[_0x4a06('0x42')]=[{'all':!![]}];}return db[_0x4a06('0x2d')]['findAll'](_0x5ee187);})['then'](function(_0x465938){_0x452188[_0x4a06('0x43')]=_0x465938;return _0x452188;})[_0x4a06('0x26')](respondWithFilteredResult(_0x37cb33,_0x5ee187))[_0x4a06('0x44')](handleError(_0x37cb33,null));};exports[_0x4a06('0x45')]=function(_0x534227,_0x18dbe9){var _0x538c73={'raw':!![],'where':{'id':_0x534227[_0x4a06('0x46')]['id']}},_0x35fb1b={};_0x35fb1b[_0x4a06('0x30')]=_[_0x4a06('0x33')](db['WhatsappApplication'][_0x4a06('0x2e')]);_0x35fb1b[_0x4a06('0x32')]=_[_0x4a06('0x33')](_0x534227['query']);_0x35fb1b[_0x4a06('0x34')]=_[_0x4a06('0x36')](_0x35fb1b[_0x4a06('0x30')],_0x35fb1b['query']);_0x538c73[_0x4a06('0x35')]=_[_0x4a06('0x36')](_0x35fb1b[_0x4a06('0x30')],qs[_0x4a06('0x47')](_0x534227[_0x4a06('0x32')][_0x4a06('0x47')]));_0x538c73[_0x4a06('0x35')]=_0x538c73[_0x4a06('0x35')][_0x4a06('0x48')]?_0x538c73[_0x4a06('0x35')]:_0x35fb1b[_0x4a06('0x30')];if(_0x534227[_0x4a06('0x32')][_0x4a06('0x41')]){_0x538c73['include']=[{'all':!![]}];}_0x538c73=_[_0x4a06('0x3e')]({},_0x538c73,_0x534227['options']);return db[_0x4a06('0x2d')][_0x4a06('0x49')](_0x538c73)[_0x4a06('0x26')](handleEntityNotFound(_0x18dbe9,null))[_0x4a06('0x26')](respondWithResult(_0x18dbe9,null))[_0x4a06('0x44')](handleError(_0x18dbe9,null));};exports['create']=function(_0x1fb2fe,_0x1f4fad){return db[_0x4a06('0x2d')]['create'](_0x1fb2fe[_0x4a06('0x4a')],{})[_0x4a06('0x26')](respondWithResult(_0x1f4fad,0xc9))[_0x4a06('0x44')](handleError(_0x1f4fad,null));};exports['update']=function(_0x25ba9c,_0x2824ed){if(_0x25ba9c[_0x4a06('0x4a')]['id']){delete _0x25ba9c[_0x4a06('0x4a')]['id'];}return db[_0x4a06('0x2d')][_0x4a06('0x49')]({'where':{'id':_0x25ba9c['params']['id']}})[_0x4a06('0x26')](handleEntityNotFound(_0x2824ed,null))[_0x4a06('0x26')](saveUpdates(_0x25ba9c[_0x4a06('0x4a')],null))[_0x4a06('0x26')](respondWithResult(_0x2824ed,null))[_0x4a06('0x44')](handleError(_0x2824ed,null));};exports[_0x4a06('0x27')]=function(_0x524ebd,_0xcfa915){return db['WhatsappApplication']['find']({'where':{'id':_0x524ebd[_0x4a06('0x46')]['id']}})[_0x4a06('0x26')](handleEntityNotFound(_0xcfa915,null))[_0x4a06('0x26')](removeEntity(_0xcfa915,null))[_0x4a06('0x44')](handleError(_0xcfa915,null));}; \ No newline at end of file +var _0x97b2=['params','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','util','sox','to-csv','squel','crypto','desk.js','papaparse','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','offset','undefined','count','limit','set','json','apply','reject','save','then','destroy','error','stack','send','map','rawAttributes','fieldName','type','key','model','name','query','keys','filters','intersection','fields','attributes','hasOwnProperty','sort','filter','where','merge','VIRTUAL','options','WhatsappApplication','includeAll','include','findAll','rows','catch','show','length','find','create','body','update'];(function(_0x6f798f,_0x229d35){var _0x43b803=function(_0x937380){while(--_0x937380){_0x6f798f['push'](_0x6f798f['shift']());}};_0x43b803(++_0x229d35);}(_0x97b2,0x1b7));var _0x297b=function(_0x5b561d,_0x422b7c){_0x5b561d=_0x5b561d-0x0;var _0x431060=_0x97b2[_0x5b561d];return _0x431060;};'use strict';var emlformat=require(_0x297b('0x0'));var rimraf=require(_0x297b('0x1'));var zipdir=require(_0x297b('0x2'));var jsonpatch=require(_0x297b('0x3'));var rp=require(_0x297b('0x4'));var moment=require(_0x297b('0x5'));var BPromise=require('bluebird');var Mustache=require(_0x297b('0x6'));var util=require(_0x297b('0x7'));var path=require('path');var sox=require(_0x297b('0x8'));var csv=require(_0x297b('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0x297b('0xa'));var crypto=require(_0x297b('0xb'));var jsforce=require('jsforce');var deskjs=require(_0x297b('0xc'));var toCsv=require(_0x297b('0x9'));var querystring=require('querystring');var Papa=require(_0x297b('0xd'));var Redis=require('ioredis');var authService=require(_0x297b('0xe'));var qs=require('../../components/parsers/qs');var as=require(_0x297b('0xf'));var hardwareService=require(_0x297b('0x10'));var logger=require(_0x297b('0x11'))(_0x297b('0x12'));var utils=require(_0x297b('0x13'));var config=require(_0x297b('0x14'));var licenseUtil=require(_0x297b('0x15'));var db=require(_0x297b('0x16'))['db'];function respondWithStatusCode(_0x17c231,_0xd833be){_0xd833be=_0xd833be||0xcc;return function(_0xf8a700){if(_0xf8a700){return _0x17c231[_0x297b('0x17')](_0xd833be);}return _0x17c231[_0x297b('0x18')](_0xd833be)[_0x297b('0x19')]();};}function respondWithResult(_0x27f44b,_0x56c7ed){_0x56c7ed=_0x56c7ed||0xc8;return function(_0x3446e6){if(_0x3446e6){return _0x27f44b[_0x297b('0x18')](_0x56c7ed)['json'](_0x3446e6);}};}function respondWithFilteredResult(_0x376287,_0x1a1434){return function(_0x4455f3){if(_0x4455f3){var _0x241ff6=typeof _0x1a1434[_0x297b('0x1a')]===_0x297b('0x1b')&&typeof _0x1a1434['limit']===_0x297b('0x1b');var _0x34854d=_0x4455f3[_0x297b('0x1c')];var _0x5618eb=_0x241ff6?0x0:_0x1a1434['offset'];var _0x161a40=_0x241ff6?_0x4455f3['count']:_0x1a1434[_0x297b('0x1a')]+_0x1a1434[_0x297b('0x1d')];var _0x2379dd;if(_0x161a40>=_0x34854d){_0x161a40=_0x34854d;_0x2379dd=0xc8;}else{_0x2379dd=0xce;}_0x376287[_0x297b('0x18')](_0x2379dd);return _0x376287[_0x297b('0x1e')]('Content-Range',_0x5618eb+'-'+_0x161a40+'/'+_0x34854d)[_0x297b('0x1f')](_0x4455f3);}return null;};}function patchUpdates(_0x250b19){return function(_0x5d2fa5){try{jsonpatch[_0x297b('0x20')](_0x5d2fa5,_0x250b19,!![]);}catch(_0x367c09){return BPromise[_0x297b('0x21')](_0x367c09);}return _0x5d2fa5[_0x297b('0x22')]();};}function saveUpdates(_0x4776e1,_0xa5bf63){return function(_0x402c1d){if(_0x402c1d){return _0x402c1d['update'](_0x4776e1)[_0x297b('0x23')](function(_0x19d8f3){return _0x19d8f3;});}return null;};}function removeEntity(_0x3df595,_0x56ed4b){return function(_0x279451){if(_0x279451){return _0x279451[_0x297b('0x24')]()[_0x297b('0x23')](function(){_0x3df595[_0x297b('0x18')](0xcc)[_0x297b('0x19')]();});}};}function handleEntityNotFound(_0x4e995f,_0x578d13){return function(_0x27ab73){if(!_0x27ab73){_0x4e995f[_0x297b('0x17')](0x194);}return _0x27ab73;};}function handleError(_0x46c23d,_0x2894b0){_0x2894b0=_0x2894b0||0x1f4;return function(_0x3f63dc){logger[_0x297b('0x25')](_0x3f63dc[_0x297b('0x26')]);if(_0x3f63dc['name']){delete _0x3f63dc['name'];}_0x46c23d['status'](_0x2894b0)[_0x297b('0x27')](_0x3f63dc);};}exports['index']=function(_0x5c2c26,_0x861618){var _0x323c47={},_0x2d64a={},_0xe51de={'count':0x0,'rows':[]};var _0x1caa2b=_[_0x297b('0x28')](db['WhatsappApplication'][_0x297b('0x29')],function(_0x50d2d0){return{'name':_0x50d2d0[_0x297b('0x2a')],'type':_0x50d2d0[_0x297b('0x2b')][_0x297b('0x2c')]};});_0x2d64a[_0x297b('0x2d')]=_[_0x297b('0x28')](_0x1caa2b,_0x297b('0x2e'));_0x2d64a[_0x297b('0x2f')]=_[_0x297b('0x30')](_0x5c2c26[_0x297b('0x2f')]);_0x2d64a[_0x297b('0x31')]=_[_0x297b('0x32')](_0x2d64a[_0x297b('0x2d')],_0x2d64a['query']);_0x323c47['attributes']=_[_0x297b('0x32')](_0x2d64a[_0x297b('0x2d')],qs[_0x297b('0x33')](_0x5c2c26[_0x297b('0x2f')]['fields']));_0x323c47[_0x297b('0x34')]=_0x323c47['attributes']['length']?_0x323c47[_0x297b('0x34')]:_0x2d64a[_0x297b('0x2d')];if(!_0x5c2c26[_0x297b('0x2f')][_0x297b('0x35')]('nolimit')){_0x323c47[_0x297b('0x1d')]=qs['limit'](_0x5c2c26[_0x297b('0x2f')][_0x297b('0x1d')]);_0x323c47['offset']=qs[_0x297b('0x1a')](_0x5c2c26[_0x297b('0x2f')]['offset']);}_0x323c47['order']=qs[_0x297b('0x36')](_0x5c2c26[_0x297b('0x2f')][_0x297b('0x36')]);_0x323c47['where']=qs[_0x297b('0x31')](_['pick'](_0x5c2c26[_0x297b('0x2f')],_0x2d64a['filters']),_0x1caa2b);if(_0x5c2c26[_0x297b('0x2f')][_0x297b('0x37')]){_0x323c47[_0x297b('0x38')]=_[_0x297b('0x39')](_0x323c47[_0x297b('0x38')],{'$or':_['map'](_0x1caa2b,function(_0x3895af){if(_0x3895af[_0x297b('0x2b')]!==_0x297b('0x3a')){var _0x581897={};_0x581897[_0x3895af[_0x297b('0x2e')]]={'$like':'%'+_0x5c2c26[_0x297b('0x2f')][_0x297b('0x37')]+'%'};return _0x581897;}})});}_0x323c47=_[_0x297b('0x39')]({},_0x323c47,_0x5c2c26[_0x297b('0x3b')]);var _0x32ce4c={'where':_0x323c47[_0x297b('0x38')]};return db[_0x297b('0x3c')][_0x297b('0x1c')](_0x32ce4c)[_0x297b('0x23')](function(_0x54ea17){_0xe51de['count']=_0x54ea17;if(_0x5c2c26[_0x297b('0x2f')][_0x297b('0x3d')]){_0x323c47[_0x297b('0x3e')]=[{'all':!![]}];}return db[_0x297b('0x3c')][_0x297b('0x3f')](_0x323c47);})[_0x297b('0x23')](function(_0x4a3e31){_0xe51de[_0x297b('0x40')]=_0x4a3e31;return _0xe51de;})[_0x297b('0x23')](respondWithFilteredResult(_0x861618,_0x323c47))[_0x297b('0x41')](handleError(_0x861618,null));};exports[_0x297b('0x42')]=function(_0x45a868,_0x1168ea){var _0x31780c={'raw':!![],'where':{'id':_0x45a868['params']['id']}},_0x3b89e3={};_0x3b89e3[_0x297b('0x2d')]=_['keys'](db[_0x297b('0x3c')][_0x297b('0x29')]);_0x3b89e3[_0x297b('0x2f')]=_[_0x297b('0x30')](_0x45a868[_0x297b('0x2f')]);_0x3b89e3[_0x297b('0x31')]=_[_0x297b('0x32')](_0x3b89e3['model'],_0x3b89e3[_0x297b('0x2f')]);_0x31780c[_0x297b('0x34')]=_['intersection'](_0x3b89e3[_0x297b('0x2d')],qs[_0x297b('0x33')](_0x45a868[_0x297b('0x2f')]['fields']));_0x31780c[_0x297b('0x34')]=_0x31780c[_0x297b('0x34')][_0x297b('0x43')]?_0x31780c['attributes']:_0x3b89e3[_0x297b('0x2d')];if(_0x45a868[_0x297b('0x2f')][_0x297b('0x3d')]){_0x31780c['include']=[{'all':!![]}];}_0x31780c=_[_0x297b('0x39')]({},_0x31780c,_0x45a868[_0x297b('0x3b')]);return db[_0x297b('0x3c')][_0x297b('0x44')](_0x31780c)[_0x297b('0x23')](handleEntityNotFound(_0x1168ea,null))['then'](respondWithResult(_0x1168ea,null))[_0x297b('0x41')](handleError(_0x1168ea,null));};exports[_0x297b('0x45')]=function(_0x5895b4,_0x3469f1){return db[_0x297b('0x3c')][_0x297b('0x45')](_0x5895b4[_0x297b('0x46')],{})[_0x297b('0x23')](respondWithResult(_0x3469f1,0xc9))[_0x297b('0x41')](handleError(_0x3469f1,null));};exports[_0x297b('0x47')]=function(_0x4e7e7e,_0x17d098){if(_0x4e7e7e[_0x297b('0x46')]['id']){delete _0x4e7e7e[_0x297b('0x46')]['id'];}return db[_0x297b('0x3c')]['find']({'where':{'id':_0x4e7e7e[_0x297b('0x48')]['id']}})[_0x297b('0x23')](handleEntityNotFound(_0x17d098,null))[_0x297b('0x23')](saveUpdates(_0x4e7e7e['body'],null))[_0x297b('0x23')](respondWithResult(_0x17d098,null))[_0x297b('0x41')](handleError(_0x17d098,null));};exports[_0x297b('0x24')]=function(_0xc11452,_0x5411e6){return db['WhatsappApplication'][_0x297b('0x44')]({'where':{'id':_0xc11452[_0x297b('0x48')]['id']}})[_0x297b('0x23')](handleEntityNotFound(_0x5411e6,null))['then'](removeEntity(_0x5411e6,null))[_0x297b('0x41')](handleError(_0x5411e6,null));}; \ No newline at end of file diff --git a/server/api/whatsappApplication/whatsappApplication.model.js b/server/api/whatsappApplication/whatsappApplication.model.js index baf49ec..455de1e 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 _0x6dac=['rimraf','../../config/environment','./whatsappApplication.attributes','exports','define','WhatsappApplication','whatsapp_applications','utf8mb4','utf8mb4_unicode_ci','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path'];(function(_0x25d45e,_0x26f1d6){var _0x209ce4=function(_0x25e3f4){while(--_0x25e3f4){_0x25d45e['push'](_0x25d45e['shift']());}};_0x209ce4(++_0x26f1d6);}(_0x6dac,0x16e));var _0xc6da=function(_0x11cf57,_0x218174){_0x11cf57=_0x11cf57-0x0;var _0x2c92f5=_0x6dac[_0x11cf57];return _0x2c92f5;};'use strict';var _=require(_0xc6da('0x0'));var util=require(_0xc6da('0x1'));var logger=require(_0xc6da('0x2'))(_0xc6da('0x3'));var moment=require(_0xc6da('0x4'));var BPromise=require(_0xc6da('0x5'));var rp=require(_0xc6da('0x6'));var fs=require('fs');var path=require(_0xc6da('0x7'));var rimraf=require(_0xc6da('0x8'));var config=require(_0xc6da('0x9'));var attributes=require(_0xc6da('0xa'));module[_0xc6da('0xb')]=function(_0x325f49,_0x5caf49){return _0x325f49[_0xc6da('0xc')](_0xc6da('0xd'),attributes,{'tableName':_0xc6da('0xe'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0xc6da('0xf'),'collate':_0xc6da('0x10')});}; \ No newline at end of file +var _0xd58c=['lodash','util','../../config/logger','moment','request-promise','rimraf','../../config/environment','./whatsappApplication.attributes','exports','WhatsappApplication','whatsapp_applications','utf8mb4','utf8mb4_unicode_ci'];(function(_0x406442,_0x4809b6){var _0x3a3e92=function(_0x31436e){while(--_0x31436e){_0x406442['push'](_0x406442['shift']());}};_0x3a3e92(++_0x4809b6);}(_0xd58c,0xb6));var _0xcd58=function(_0x52b15f,_0x57dd58){_0x52b15f=_0x52b15f-0x0;var _0x5792a8=_0xd58c[_0x52b15f];return _0x5792a8;};'use strict';var _=require(_0xcd58('0x0'));var util=require(_0xcd58('0x1'));var logger=require(_0xcd58('0x2'))('api');var moment=require(_0xcd58('0x3'));var BPromise=require('bluebird');var rp=require(_0xcd58('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0xcd58('0x5'));var config=require(_0xcd58('0x6'));var attributes=require(_0xcd58('0x7'));module[_0xcd58('0x8')]=function(_0x45bc6f,_0x599c02){return _0x45bc6f['define'](_0xcd58('0x9'),attributes,{'tableName':_0xcd58('0xa'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0xcd58('0xb'),'collate':_0xcd58('0xc')});}; \ No newline at end of file diff --git a/server/api/whatsappApplication/whatsappApplication.rpc.js b/server/api/whatsappApplication/whatsappApplication.rpc.js index 5df82fc..f2eb2f6 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 _0x98a8=['request','then','info','WhatsappApplication,\x20%s,\x20%s','request\x20sent','debug','WhatsappApplication,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client'];(function(_0x52c17b,_0x3f8750){var _0x50cde3=function(_0x4f50f6){while(--_0x4f50f6){_0x52c17b['push'](_0x52c17b['shift']());}};_0x50cde3(++_0x3f8750);}(_0x98a8,0x12c));var _0x898a=function(_0x59e8e2,_0x2eb5ba){_0x59e8e2=_0x59e8e2-0x0;var _0x2a1693=_0x98a8[_0x59e8e2];return _0x2a1693;};'use strict';var _=require(_0x898a('0x0'));var util=require(_0x898a('0x1'));var moment=require(_0x898a('0x2'));var BPromise=require(_0x898a('0x3'));var rs=require(_0x898a('0x4'));var fs=require('fs');var Redis=require(_0x898a('0x5'));var db=require(_0x898a('0x6'))['db'];var utils=require('../../config/utils');var logger=require(_0x898a('0x7'))(_0x898a('0x8'));var config=require(_0x898a('0x9'));var jayson=require(_0x898a('0xa'));var client=jayson[_0x898a('0xb')]['http']({'port':0x232a});function respondWithRpcPromise(_0x3aadc2,_0x564583,_0xfa8c50){return new BPromise(function(_0x4fbce5,_0x42021d){return client[_0x898a('0xc')](_0x3aadc2,_0xfa8c50)[_0x898a('0xd')](function(_0x96b636){logger[_0x898a('0xe')](_0x898a('0xf'),_0x564583,_0x898a('0x10'));logger[_0x898a('0x11')](_0x898a('0x12'),_0x564583,'request\x20sent',JSON[_0x898a('0x13')](_0x96b636));if(_0x96b636['error']){if(_0x96b636[_0x898a('0x14')]['code']===0x1f4){logger[_0x898a('0x14')](_0x898a('0xf'),_0x564583,_0x96b636[_0x898a('0x14')]['message']);return _0x42021d(_0x96b636['error']['message']);}logger[_0x898a('0x14')](_0x898a('0xf'),_0x564583,_0x96b636[_0x898a('0x14')][_0x898a('0x15')]);return _0x4fbce5(_0x96b636[_0x898a('0x14')][_0x898a('0x15')]);}else{logger['info'](_0x898a('0xf'),_0x564583,'request\x20sent');_0x4fbce5(_0x96b636[_0x898a('0x16')]['message']);}})[_0x898a('0x17')](function(_0x4fb05b){logger[_0x898a('0x14')]('WhatsappApplication,\x20%s,\x20%s',_0x564583,_0x4fb05b);_0x42021d(_0x4fb05b);});});} \ No newline at end of file +var _0xe14d=['../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','WhatsappApplication,\x20%s,\x20%s','debug','WhatsappApplication,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','lodash','util','moment','bluebird','ioredis','../../mysqldb'];(function(_0x4e71b9,_0x5e799d){var _0x3201a1=function(_0x5d6fd7){while(--_0x5d6fd7){_0x4e71b9['push'](_0x4e71b9['shift']());}};_0x3201a1(++_0x5e799d);}(_0xe14d,0x1ee));var _0xde14=function(_0xbe200f,_0x4b50eb){_0xbe200f=_0xbe200f-0x0;var _0x192597=_0xe14d[_0xbe200f];return _0x192597;};'use strict';var _=require(_0xde14('0x0'));var util=require(_0xde14('0x1'));var moment=require(_0xde14('0x2'));var BPromise=require(_0xde14('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xde14('0x4'));var db=require(_0xde14('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0xde14('0x6'))(_0xde14('0x7'));var config=require(_0xde14('0x8'));var jayson=require(_0xde14('0x9'));var client=jayson[_0xde14('0xa')][_0xde14('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x4b1f6b,_0x5a1344,_0x1bd49d){return new BPromise(function(_0x115b7d,_0x2b0e7c){return client[_0xde14('0xc')](_0x4b1f6b,_0x1bd49d)[_0xde14('0xd')](function(_0x176909){logger[_0xde14('0xe')](_0xde14('0xf'),_0x5a1344,'request\x20sent');logger[_0xde14('0x10')](_0xde14('0x11'),_0x5a1344,_0xde14('0x12'),JSON[_0xde14('0x13')](_0x176909));if(_0x176909[_0xde14('0x14')]){if(_0x176909[_0xde14('0x14')][_0xde14('0x15')]===0x1f4){logger[_0xde14('0x14')](_0xde14('0xf'),_0x5a1344,_0x176909[_0xde14('0x14')][_0xde14('0x16')]);return _0x2b0e7c(_0x176909[_0xde14('0x14')][_0xde14('0x16')]);}logger[_0xde14('0x14')](_0xde14('0xf'),_0x5a1344,_0x176909['error']['message']);return _0x115b7d(_0x176909[_0xde14('0x14')][_0xde14('0x16')]);}else{logger[_0xde14('0xe')]('WhatsappApplication,\x20%s,\x20%s',_0x5a1344,_0xde14('0x12'));_0x115b7d(_0x176909[_0xde14('0x17')][_0xde14('0x16')]);}})[_0xde14('0x18')](function(_0x3de959){logger[_0xde14('0x14')](_0xde14('0xf'),_0x5a1344,_0x3de959);_0x2b0e7c(_0x3de959);});});} \ No newline at end of file diff --git a/server/api/whatsappInteraction/index.js b/server/api/whatsappInteraction/index.js index 050f409..08e4705 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 _0xba34=['removeTags','exports','multer','util','path','connect-timeout','express','../../components/interaction/service','../../config/environment','./whatsappInteraction.controller','get','isAuthenticated','index','describe','/:id','show','/:id/messages','getMessages','download','post','addMessage','/:id/tags','tracked','whatsapp','whatsappinteraction:addtags','addTags','put','whatsappinteraction:update','update','destroy','delete'];(function(_0x40c6b4,_0x4b803b){var _0x2b54e7=function(_0x4b3db9){while(--_0x4b3db9){_0x40c6b4['push'](_0x40c6b4['shift']());}};_0x2b54e7(++_0x4b803b);}(_0xba34,0x119));var _0x4ba3=function(_0x143b84,_0xc0aabf){_0x143b84=_0x143b84-0x0;var _0x17937e=_0xba34[_0x143b84];return _0x17937e;};'use strict';var multer=require(_0x4ba3('0x0'));var util=require(_0x4ba3('0x1'));var path=require(_0x4ba3('0x2'));var timeout=require(_0x4ba3('0x3'));var express=require(_0x4ba3('0x4'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0x4ba3('0x5'));var config=require(_0x4ba3('0x6'));var controller=require(_0x4ba3('0x7'));router[_0x4ba3('0x8')]('/',auth[_0x4ba3('0x9')](),controller[_0x4ba3('0xa')]);router[_0x4ba3('0x8')]('/describe',auth[_0x4ba3('0x9')](),controller[_0x4ba3('0xb')]);router[_0x4ba3('0x8')](_0x4ba3('0xc'),auth[_0x4ba3('0x9')](),controller[_0x4ba3('0xd')]);router[_0x4ba3('0x8')](_0x4ba3('0xe'),auth[_0x4ba3('0x9')](),controller[_0x4ba3('0xf')]);router[_0x4ba3('0x8')]('/:id/download',auth[_0x4ba3('0x9')](),controller[_0x4ba3('0x10')]);router['post']('/',auth[_0x4ba3('0x9')](),controller['create']);router[_0x4ba3('0x11')]('/:id/messages',auth[_0x4ba3('0x9')](),controller[_0x4ba3('0x12')]);router[_0x4ba3('0x11')](_0x4ba3('0x13'),auth[_0x4ba3('0x9')](),interaction[_0x4ba3('0x14')](_0x4ba3('0x15'),_0x4ba3('0x16')),controller[_0x4ba3('0x17')]);router[_0x4ba3('0x18')](_0x4ba3('0xc'),auth[_0x4ba3('0x9')](),interaction[_0x4ba3('0x14')](_0x4ba3('0x15'),_0x4ba3('0x19')),controller[_0x4ba3('0x1a')]);router['delete'](_0x4ba3('0xc'),auth[_0x4ba3('0x9')](),interaction[_0x4ba3('0x14')](_0x4ba3('0x15'),'whatsappinteraction:destroy'),controller[_0x4ba3('0x1b')]);router[_0x4ba3('0x1c')](_0x4ba3('0x13'),auth[_0x4ba3('0x9')](),controller[_0x4ba3('0x1d')]);module[_0x4ba3('0x1e')]=router; \ No newline at end of file +var _0xe714=['post','/:id/tags','whatsapp','/:id','whatsappinteraction:update','update','delete','tracked','whatsappinteraction:destroy','destroy','multer','path','connect-timeout','express','Router','../../components/auth/service','../../config/environment','./whatsappInteraction.controller','get','isAuthenticated','index','describe','/:id/messages','getMessages','/:id/download','download','create'];(function(_0x378efd,_0xf3811a){var _0x597eeb=function(_0x235f02){while(--_0x235f02){_0x378efd['push'](_0x378efd['shift']());}};_0x597eeb(++_0xf3811a);}(_0xe714,0xe2));var _0x4e71=function(_0x300d05,_0x578c86){_0x300d05=_0x300d05-0x0;var _0x2d3d8e=_0xe714[_0x300d05];return _0x2d3d8e;};'use strict';var multer=require(_0x4e71('0x0'));var util=require('util');var path=require(_0x4e71('0x1'));var timeout=require(_0x4e71('0x2'));var express=require(_0x4e71('0x3'));var router=express[_0x4e71('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0x4e71('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0x4e71('0x6'));var controller=require(_0x4e71('0x7'));router[_0x4e71('0x8')]('/',auth[_0x4e71('0x9')](),controller[_0x4e71('0xa')]);router[_0x4e71('0x8')]('/describe',auth[_0x4e71('0x9')](),controller[_0x4e71('0xb')]);router[_0x4e71('0x8')]('/:id',auth[_0x4e71('0x9')](),controller['show']);router[_0x4e71('0x8')](_0x4e71('0xc'),auth[_0x4e71('0x9')](),controller[_0x4e71('0xd')]);router[_0x4e71('0x8')](_0x4e71('0xe'),auth[_0x4e71('0x9')](),controller[_0x4e71('0xf')]);router['post']('/',auth[_0x4e71('0x9')](),controller[_0x4e71('0x10')]);router['post'](_0x4e71('0xc'),auth[_0x4e71('0x9')](),controller['addMessage']);router[_0x4e71('0x11')](_0x4e71('0x12'),auth['isAuthenticated'](),interaction['tracked'](_0x4e71('0x13'),'whatsappinteraction:addtags'),controller['addTags']);router['put'](_0x4e71('0x14'),auth[_0x4e71('0x9')](),interaction['tracked']('whatsapp',_0x4e71('0x15')),controller[_0x4e71('0x16')]);router[_0x4e71('0x17')](_0x4e71('0x14'),auth[_0x4e71('0x9')](),interaction[_0x4e71('0x18')]('whatsapp',_0x4e71('0x19')),controller[_0x4e71('0x1a')]);router['delete'](_0x4e71('0x12'),auth[_0x4e71('0x9')](),controller['removeTags']);module['exports']=router; \ No newline at end of file diff --git a/server/api/whatsappInteraction/whatsappInteraction.attributes.js b/server/api/whatsappInteraction/whatsappInteraction.attributes.js index 2fc3f13..9ccb3ec 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 _0x3c66=['DATE','STRING','ENUM','out','BOOLEAN'];(function(_0x257a8b,_0x214d25){var _0x36e8b1=function(_0x58fa7a){while(--_0x58fa7a){_0x257a8b['push'](_0x257a8b['shift']());}};_0x36e8b1(++_0x214d25);}(_0x3c66,0x8b));var _0x63c6=function(_0x2b5ecb,_0x49f11b){_0x2b5ecb=_0x2b5ecb-0x0;var _0x156305=_0x3c66[_0x2b5ecb];return _0x156305;};'use strict';var Sequelize=require('sequelize');var moment=require('moment');module['exports']={'closed':{'type':Sequelize[_0x63c6('0x0')],'defaultValue':![]},'closedAt':{'type':Sequelize[_0x63c6('0x1')]},'disposition':{'type':Sequelize[_0x63c6('0x2')]},'secondDisposition':{'type':Sequelize[_0x63c6('0x2')]},'thirdDisposition':{'type':Sequelize[_0x63c6('0x2')]},'note':{'type':Sequelize[_0x63c6('0x2')]},'phone':{'type':Sequelize[_0x63c6('0x2')]},'read1stAt':{'type':Sequelize[_0x63c6('0x1')]},'firstMsgDirection':{'type':Sequelize[_0x63c6('0x3')]('in',_0x63c6('0x4')),'defaultValue':'in','allowNull':![]},'lastMsgAt':{'type':Sequelize[_0x63c6('0x1')]},'lastMsgDirection':{'type':Sequelize[_0x63c6('0x3')]('in','out'),'defaultValue':'in','allowNull':![]},'autoreplyExecuted':{'type':Sequelize[_0x63c6('0x0')],'defaultValue':![]},'queueId':{'type':Sequelize['INTEGER']}}; \ No newline at end of file +var _0xbd9f=['ENUM','out','BOOLEAN','STRING','DATE'];(function(_0x158f68,_0x33fd3a){var _0x581e9f=function(_0xdd23bf){while(--_0xdd23bf){_0x158f68['push'](_0x158f68['shift']());}};_0x581e9f(++_0x33fd3a);}(_0xbd9f,0x98));var _0xfbd9=function(_0x304aca,_0x4f8e0b){_0x304aca=_0x304aca-0x0;var _0x3b811c=_0xbd9f[_0x304aca];return _0x3b811c;};'use strict';var Sequelize=require('sequelize');var moment=require('moment');module['exports']={'closed':{'type':Sequelize[_0xfbd9('0x0')],'defaultValue':![]},'closedAt':{'type':Sequelize['DATE']},'disposition':{'type':Sequelize[_0xfbd9('0x1')]},'secondDisposition':{'type':Sequelize['STRING']},'thirdDisposition':{'type':Sequelize[_0xfbd9('0x1')]},'note':{'type':Sequelize['STRING']},'phone':{'type':Sequelize[_0xfbd9('0x1')]},'read1stAt':{'type':Sequelize[_0xfbd9('0x2')]},'firstMsgDirection':{'type':Sequelize[_0xfbd9('0x3')]('in','out'),'defaultValue':'in','allowNull':![]},'lastMsgAt':{'type':Sequelize[_0xfbd9('0x2')]},'lastMsgDirection':{'type':Sequelize['ENUM']('in',_0xfbd9('0x4')),'defaultValue':'in','allowNull':![]},'autoreplyExecuted':{'type':Sequelize[_0xfbd9('0x0')],'defaultValue':![]},'queueId':{'type':Sequelize['INTEGER']}}; \ No newline at end of file diff --git a/server/api/whatsappInteraction/whatsappInteraction.controller.js b/server/api/whatsappInteraction/whatsappInteraction.controller.js index 20412c4..57cd4df 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 _0x7df7=['merge','find','create','body','destroy','describe','addMessage','WhatsappMessage','ids','omit','getMessages','findOne','hasOwnProperty','nolimit','limit','order','sort','where','pick','$gte','split','format','YYYY-MM-DD\x20HH:mm:ss','options','rows','addTags','setTags','spread','Tag','color','removeTags','download','toString','join','root','server','files','tmp','attachments','transcript-%d-%s.zip','push','User','fullname','CmContact','Contact','firstName','Attachment','Messages','createdAt','direction','secret','read','WhatsappAccount','Account','Owner','get','Whatsapp','N.A.','disposition','basename','existsSync','createReadStream','createWriteStream','System','lastName','out','renderFile','views','.pdf','log','err','unlinkSync','rimraf','zip-dir','util','lodash','../../components/interaction/service','../../components/parsers/qs','../../components/export/pdf','../../config/logger','api','../../config/environment','../../mysqldb','redis','defaults','socket.io-emitter','./whatsappInteraction.socket','register','sendStatus','status','end','json','offset','undefined','count','set','Content-Range','update','then','name','send','index','map','WhatsappInteraction','rawAttributes','fieldName','type','getOptions','findAll','whatsapp','query','catch','show','params','model','keys','filters','intersection','attributes','fields','length','includeAll','include'];(function(_0x413feb,_0x10477f){var _0x40ee88=function(_0x32a3f6){while(--_0x32a3f6){_0x413feb['push'](_0x413feb['shift']());}};_0x40ee88(++_0x10477f);}(_0x7df7,0x1b9));var _0x77df=function(_0x26e2b6,_0xed0ac2){_0x26e2b6=_0x26e2b6-0x0;var _0x199157=_0x7df7[_0x26e2b6];return _0x199157;};'use strict';var rimraf=require(_0x77df('0x0'));var zipdir=require(_0x77df('0x1'));var moment=require('moment');var BPromise=require('bluebird');var util=require(_0x77df('0x2'));var path=require('path');var ejs=require('ejs');var fs=require('fs');var _=require(_0x77df('0x3'));var Redis=require('ioredis');var interaction=require(_0x77df('0x4'));var qs=require(_0x77df('0x5'));var pdf=require(_0x77df('0x6'));var logger=require(_0x77df('0x7'))(_0x77df('0x8'));var config=require(_0x77df('0x9'));var db=require(_0x77df('0xa'))['db'];config[_0x77df('0xb')]=_[_0x77df('0xc')](config['redis'],{'host':'localhost','port':0x18eb});var socket=require(_0x77df('0xd'))(new Redis(config[_0x77df('0xb')]));require(_0x77df('0xe'))[_0x77df('0xf')](socket);function respondWithStatusCode(_0x3b3790,_0x375b88){_0x375b88=_0x375b88||0xcc;return function(_0x5f0f3c){if(_0x5f0f3c){return _0x3b3790[_0x77df('0x10')](_0x375b88);}return _0x3b3790[_0x77df('0x11')](_0x375b88)[_0x77df('0x12')]();};}function respondWithResult(_0x5cb829,_0x46603d){_0x46603d=_0x46603d||0xc8;return function(_0x3215ec){if(_0x3215ec){return _0x5cb829[_0x77df('0x11')](_0x46603d)[_0x77df('0x13')](_0x3215ec);}};}function respondWithFilteredResult(_0x2ffa28,_0x23b1f8){return function(_0x411d1f){if(_0x411d1f){var _0x528754=typeof _0x23b1f8[_0x77df('0x14')]===_0x77df('0x15')&&typeof _0x23b1f8['limit']===_0x77df('0x15');var _0x42b7d1=_0x411d1f['count'];var _0x54b359=_0x528754?0x0:_0x23b1f8['offset'];var _0x5c500c=_0x528754?_0x411d1f[_0x77df('0x16')]:_0x23b1f8[_0x77df('0x14')]+_0x23b1f8['limit'];var _0x574706;if(_0x5c500c>=_0x42b7d1){_0x5c500c=_0x42b7d1;_0x574706=0xc8;}else{_0x574706=0xce;}_0x2ffa28['status'](_0x574706);return _0x2ffa28[_0x77df('0x17')](_0x77df('0x18'),_0x54b359+'-'+_0x5c500c+'/'+_0x42b7d1)[_0x77df('0x13')](_0x411d1f);}return null;};}function saveUpdates(_0x3da640){return function(_0x5b6019){if(_0x5b6019){return _0x5b6019[_0x77df('0x19')](_0x3da640)[_0x77df('0x1a')](function(_0xf61f5e){return _0xf61f5e;});}return null;};}function removeEntity(_0x30a274){return function(_0x227d93){if(_0x227d93){return _0x227d93['destroy']()[_0x77df('0x1a')](function(){_0x30a274['status'](0xcc)[_0x77df('0x12')]();});}};}function handleEntityNotFound(_0x1b8d97){return function(_0xd0e5aa){if(!_0xd0e5aa){_0x1b8d97['sendStatus'](0x194);}return _0xd0e5aa;};}function handleError(_0x36459f,_0x517825){_0x517825=_0x517825||0x1f4;return function(_0x3178c8){logger['error'](_0x3178c8['stack']);if(_0x3178c8[_0x77df('0x1b')]){delete _0x3178c8[_0x77df('0x1b')];}_0x36459f['status'](_0x517825)[_0x77df('0x1c')](_0x3178c8);};}exports[_0x77df('0x1d')]=function(_0x21987c,_0x1dc1cf){var _0x1a0649={};var _0x685ce1=_[_0x77df('0x1e')](db[_0x77df('0x1f')][_0x77df('0x20')],function(_0x5aa2b1){return{'name':_0x5aa2b1[_0x77df('0x21')],'type':_0x5aa2b1[_0x77df('0x22')]['key']};});_0x1a0649=qs[_0x77df('0x23')](_0x685ce1,_0x21987c);return interaction[_0x77df('0x24')](_0x77df('0x25'),_0x21987c[_0x77df('0x26')],_0x21987c['user'],_0x1a0649,_0x685ce1)[_0x77df('0x1a')](respondWithFilteredResult(_0x1dc1cf,_0x1a0649))[_0x77df('0x27')](handleError(_0x1dc1cf,null));};exports[_0x77df('0x28')]=function(_0x5c7622,_0x36a889){var _0x2bb591={'raw':![],'where':{'id':_0x5c7622[_0x77df('0x29')]['id']}},_0x33edda={};_0x33edda[_0x77df('0x2a')]=_[_0x77df('0x2b')](db[_0x77df('0x1f')][_0x77df('0x20')]);_0x33edda[_0x77df('0x26')]=_[_0x77df('0x2b')](_0x5c7622[_0x77df('0x26')]);_0x33edda[_0x77df('0x2c')]=_[_0x77df('0x2d')](_0x33edda[_0x77df('0x2a')],_0x33edda[_0x77df('0x26')]);_0x2bb591[_0x77df('0x2e')]=_[_0x77df('0x2d')](_0x33edda[_0x77df('0x2a')],qs['fields'](_0x5c7622[_0x77df('0x26')][_0x77df('0x2f')]));_0x2bb591[_0x77df('0x2e')]=_0x2bb591[_0x77df('0x2e')][_0x77df('0x30')]?_0x2bb591['attributes']:_0x33edda['model'];if(_0x5c7622[_0x77df('0x26')][_0x77df('0x31')]){_0x2bb591[_0x77df('0x32')]=[{'all':!![]}];}_0x2bb591=_[_0x77df('0x33')]({},_0x2bb591,_0x5c7622['options']);return db[_0x77df('0x1f')][_0x77df('0x34')](_0x2bb591)[_0x77df('0x1a')](handleEntityNotFound(_0x36a889,null))[_0x77df('0x1a')](respondWithResult(_0x36a889,null))[_0x77df('0x27')](handleError(_0x36a889,null));};exports[_0x77df('0x35')]=function(_0x134a69,_0x3afd25){return db[_0x77df('0x1f')][_0x77df('0x35')](_0x134a69[_0x77df('0x36')],{})['then'](respondWithResult(_0x3afd25,0xc9))[_0x77df('0x27')](handleError(_0x3afd25,null));};exports[_0x77df('0x19')]=function(_0xbce8c2,_0x2a3298){if(_0xbce8c2['body']['id']){delete _0xbce8c2[_0x77df('0x36')]['id'];}return db[_0x77df('0x1f')][_0x77df('0x34')]({'where':{'id':_0xbce8c2[_0x77df('0x29')]['id']}})[_0x77df('0x1a')](handleEntityNotFound(_0x2a3298,null))[_0x77df('0x1a')](saveUpdates(_0xbce8c2[_0x77df('0x36')],null))[_0x77df('0x1a')](respondWithResult(_0x2a3298,null))[_0x77df('0x27')](handleError(_0x2a3298,null));};exports[_0x77df('0x37')]=function(_0x3c0417,_0x2778f8){return db[_0x77df('0x1f')][_0x77df('0x34')]({'where':{'id':_0x3c0417[_0x77df('0x29')]['id']}})[_0x77df('0x1a')](handleEntityNotFound(_0x2778f8,null))[_0x77df('0x1a')](removeEntity(_0x2778f8,null))[_0x77df('0x27')](handleError(_0x2778f8,null));};exports[_0x77df('0x38')]=function(_0x396524,_0x32afdc){return db[_0x77df('0x1f')]['describe']()['then'](respondWithResult(_0x32afdc,null))[_0x77df('0x27')](handleError(_0x32afdc,null));};exports[_0x77df('0x39')]=function(_0x14f5ef,_0x55e7fc){return db[_0x77df('0x3a')][_0x77df('0x34')]({'where':{'id':_0x14f5ef[_0x77df('0x29')]['id']}})[_0x77df('0x1a')](handleEntityNotFound(_0x55e7fc,null))[_0x77df('0x1a')](function(_0x331786){if(_0x331786){return _0x331786[_0x77df('0x39')](_0x14f5ef[_0x77df('0x36')][_0x77df('0x3b')],_[_0x77df('0x3c')](_0x14f5ef[_0x77df('0x36')],['ids','id'])||{});}})[_0x77df('0x1a')](respondWithResult(_0x55e7fc,null))['catch'](handleError(_0x55e7fc,null));};exports[_0x77df('0x3d')]=function(_0x4e8f1c,_0x4b3956){var _0x3b2daa={'raw':![],'where':{}};var _0x20d057={};var _0x59f85e={'count':0x0,'rows':[]};return db['WhatsappInteraction'][_0x77df('0x3e')]({'where':{'id':_0x4e8f1c[_0x77df('0x29')]['id']}})[_0x77df('0x1a')](handleEntityNotFound(_0x4b3956,null))[_0x77df('0x1a')](function(_0x4fca0e){if(_0x4fca0e){_0x20d057[_0x77df('0x2a')]=_[_0x77df('0x2b')](db[_0x77df('0x3a')][_0x77df('0x20')]);_0x20d057[_0x77df('0x26')]=_['keys'](_0x4e8f1c[_0x77df('0x26')]);_0x20d057[_0x77df('0x2c')]=_[_0x77df('0x2d')](_0x20d057[_0x77df('0x2a')],_0x20d057[_0x77df('0x26')]);_0x3b2daa[_0x77df('0x2e')]=_[_0x77df('0x2d')](_0x20d057[_0x77df('0x2a')],qs[_0x77df('0x2f')](_0x4e8f1c['query'][_0x77df('0x2f')]));_0x3b2daa[_0x77df('0x2e')]=_0x3b2daa['attributes']['length']?_0x3b2daa[_0x77df('0x2e')]:_0x20d057[_0x77df('0x2a')];if(!_0x4e8f1c[_0x77df('0x26')][_0x77df('0x3f')](_0x77df('0x40'))){_0x3b2daa['limit']=qs[_0x77df('0x41')](_0x4e8f1c[_0x77df('0x26')][_0x77df('0x41')]);_0x3b2daa['offset']=qs[_0x77df('0x14')](_0x4e8f1c['query']['offset']);}_0x3b2daa[_0x77df('0x42')]=qs[_0x77df('0x43')](_0x4e8f1c[_0x77df('0x26')][_0x77df('0x43')]);_0x3b2daa[_0x77df('0x44')]=qs[_0x77df('0x2c')](_[_0x77df('0x45')](_0x4e8f1c[_0x77df('0x26')],_0x20d057['filters']));_0x3b2daa[_0x77df('0x44')]['WhatsappInteractionId']=_0x4fca0e['id'];if(_0x4e8f1c['query']['filter']){_0x3b2daa['where']=_['merge'](_0x3b2daa['where'],{'$or':_[_0x77df('0x1e')](_0x3b2daa[_0x77df('0x2e')],function(_0x5295b0){var _0x1938e7={};_0x1938e7[_0x5295b0]={'$like':'%'+_0x4e8f1c[_0x77df('0x26')]['filter']+'%'};return _0x1938e7;})});}if(_0x4e8f1c[_0x77df('0x26')][_0x77df('0x46')]){var _0x57c2c6=_0x4e8f1c[_0x77df('0x26')][_0x77df('0x46')][_0x77df('0x47')](',');var _0x47644f={};_0x47644f[_0x57c2c6[0x0]]={'$gte':moment(_0x57c2c6[0x1])[_0x77df('0x48')](_0x77df('0x49'))};_0x3b2daa['where']=_[_0x77df('0x33')](_0x3b2daa[_0x77df('0x44')],_0x47644f);}_0x3b2daa=_['merge']({},_0x3b2daa,_0x4e8f1c[_0x77df('0x4a')]);return db[_0x77df('0x3a')][_0x77df('0x16')]({'where':_0x3b2daa['where']})[_0x77df('0x1a')](function(_0x30e7b6){_0x59f85e[_0x77df('0x16')]=_0x30e7b6;if(_0x4e8f1c['query'][_0x77df('0x31')]){_0x3b2daa['include']=[{'all':!![]}];}return db['WhatsappMessage'][_0x77df('0x24')](_0x3b2daa);})['then'](function(_0x198ff0){_0x59f85e[_0x77df('0x4b')]=_0x198ff0;return _0x59f85e;});}})[_0x77df('0x1a')](respondWithFilteredResult(_0x4b3956,_0x3b2daa))[_0x77df('0x27')](handleError(_0x4b3956,null));};exports[_0x77df('0x4c')]=function(_0x56387a,_0x560496){return db[_0x77df('0x1f')][_0x77df('0x34')]({'where':{'id':_0x56387a[_0x77df('0x29')]['id']}})[_0x77df('0x1a')](handleEntityNotFound(_0x560496,null))['then'](function(_0x287fa9){if(_0x287fa9){return _0x287fa9[_0x77df('0x4d')](_0x56387a[_0x77df('0x36')][_0x77df('0x3b')],_[_0x77df('0x3c')](_0x56387a[_0x77df('0x36')],[_0x77df('0x3b'),'id'])||{})[_0x77df('0x4e')](function(){return db[_0x77df('0x4f')][_0x77df('0x24')]({'attributes':['id',_0x77df('0x1b'),_0x77df('0x50')],'where':{'id':_0x56387a[_0x77df('0x36')][_0x77df('0x3b')]}});})['then'](function(_0xf88add){socket['emit']('whatsappInteractionTags:save',{'id':Number(_0x56387a[_0x77df('0x29')]['id']),'tags':_0xf88add||[]});return{'id':Number(_0x56387a[_0x77df('0x29')]['id']),'tags':_0xf88add||[]};});}})[_0x77df('0x1a')](respondWithResult(_0x560496,null))[_0x77df('0x27')](handleError(_0x560496,null));};exports[_0x77df('0x51')]=function(_0x1e0540,_0x2cdabb){return db[_0x77df('0x1f')]['find']({'where':{'id':_0x1e0540[_0x77df('0x29')]['id']}})['then'](handleEntityNotFound(_0x2cdabb,null))[_0x77df('0x1a')](function(_0xd1a46d){if(_0xd1a46d){return _0xd1a46d[_0x77df('0x51')](_0x1e0540[_0x77df('0x26')]['ids']);}})[_0x77df('0x1a')](respondWithStatusCode(_0x2cdabb,null))[_0x77df('0x27')](handleError(_0x2cdabb,null));};exports[_0x77df('0x52')]=function(_0x1e3812,_0x5313bf){var _0x3bc61a=moment()['unix']()[_0x77df('0x53')]();var _0x23648c=path[_0x77df('0x54')](config[_0x77df('0x55')],_0x77df('0x56'),_0x77df('0x57'),_0x77df('0x58'));var _0x324e26=path[_0x77df('0x54')](config[_0x77df('0x55')],'server',_0x77df('0x57'),_0x77df('0x59'));var _0x51f689=path[_0x77df('0x54')](_0x23648c,_0x3bc61a);var _0x466aaa=util[_0x77df('0x48')](_0x77df('0x5a'),_0x1e3812[_0x77df('0x29')]['id'],_0x3bc61a);var _0x5700e4=path[_0x77df('0x54')](_0x23648c,_0x466aaa);var _0x5f3278=[];_0x5f3278[_0x77df('0x5b')]({'model':db[_0x77df('0x5c')],'as':_0x77df('0x5c'),'attributes':['id',_0x77df('0x5d')],'raw':!![]});_0x5f3278[_0x77df('0x5b')]({'model':db[_0x77df('0x5e')],'as':_0x77df('0x5f'),'attributes':['id',_0x77df('0x60'),'lastName'],'raw':!![]});if(_0x1e3812[_0x77df('0x26')][_0x77df('0x59')]){_0x5f3278[_0x77df('0x5b')]({'model':db[_0x77df('0x61')],'as':_0x77df('0x61'),'raw':!![]});}var _0x476d99=[{'model':db['WhatsappMessage'],'as':_0x77df('0x62'),'attributes':['id',_0x77df('0x36'),_0x77df('0x63'),_0x77df('0x64'),_0x77df('0x65'),_0x77df('0x66')],'include':_0x5f3278}];_0x476d99[_0x77df('0x5b')]({'model':db[_0x77df('0x67')],'as':_0x77df('0x68'),'attributes':['id',_0x77df('0x1b')]});_0x476d99[_0x77df('0x5b')]({'model':db[_0x77df('0x5c')],'as':_0x77df('0x69'),'attributes':['id',_0x77df('0x5d')]});return db['WhatsappInteraction'][_0x77df('0x34')]({'where':{'id':_0x1e3812[_0x77df('0x29')]['id']},'include':_0x476d99})[_0x77df('0x1a')](handleEntityNotFound(_0x5313bf,null))[_0x77df('0x1a')](function(_0x24b49a){if(_0x24b49a){var _0x284f65=_0x24b49a[_0x77df('0x6a')]({'plain':!![]});fs['mkdirSync'](_0x51f689);var _0xb01d20={'channel':_0x77df('0x6b'),'account':_0x284f65[_0x77df('0x68')][_0x77df('0x1b')],'agent':_0x284f65[_0x77df('0x69')]?_0x284f65[_0x77df('0x69')][_0x77df('0x5d')]:_0x77df('0x6c'),'createdAt':moment(_0x284f65['createdAt'])[_0x77df('0x48')](_0x77df('0x49'))[_0x77df('0x53')](),'closedAt':_0x284f65['closed']?moment(_0x284f65['closedAt'])[_0x77df('0x48')]('YYYY-MM-DD\x20HH:mm:ss')[_0x77df('0x53')]():'','disposition':_0x284f65[_0x77df('0x6d')],'messages':_(_0x284f65[_0x77df('0x62')])['filter']({'secret':![]})['map'](function(_0x226e3a){if(_0x226e3a['Attachment']){var _0x2d7fdd=path['join'](_0x324e26,_0x226e3a[_0x77df('0x61')][_0x77df('0x6e')]);if(fs[_0x77df('0x6f')](_0x2d7fdd)){fs[_0x77df('0x70')](_0x2d7fdd)['pipe'](fs[_0x77df('0x71')](path[_0x77df('0x54')](_0x51f689,_0x226e3a['Attachment'][_0x77df('0x6e')])));}}return{'date':moment(_0x226e3a['createdAt'])[_0x77df('0x48')]('YYYY-MM-DD\x20HH:mm:ss')[_0x77df('0x53')](),'sender':_0x226e3a[_0x77df('0x64')]==='out'?_0x226e3a[_0x77df('0x5c')]?_0x226e3a['User'][_0x77df('0x5d')]:_0x77df('0x72'):_0x226e3a[_0x77df('0x5f')][_0x77df('0x60')]+(_0x226e3a[_0x77df('0x5f')][_0x77df('0x73')]?'\x20'+_0x226e3a[_0x77df('0x5f')][_0x77df('0x73')]:''),'body':_0x226e3a[_0x77df('0x61')]?_0x226e3a['Attachment']['basename']:_0x226e3a[_0x77df('0x36')],'direction':_0x226e3a[_0x77df('0x64')]===_0x77df('0x74')?'A':'C','secret':_0x226e3a[_0x77df('0x65')],'read':_0x226e3a['read'],'attachment':_0x226e3a[_0x77df('0x61')]};})['value']()};return ejs[_0x77df('0x75')](path[_0x77df('0x54')](config['root'],_0x77df('0x56'),_0x77df('0x76'),'downloadInteraction.ejs'),{'interaction':_0xb01d20})['then'](function(_0x20c365){var _0x1900ea=path[_0x77df('0x54')](_0x51f689,'transcript-'+_0x284f65['id']+'-'+_0x3bc61a+_0x77df('0x77'));var _0x27e4f9={'path':_0x1900ea,'channel':'Whatsapp','interactionId':_0x284f65['id']};return pdf['createPdfFromHTML'](_0x20c365,_0x27e4f9);})[_0x77df('0x1a')](function(){return new BPromise(function(_0x5e2d34,_0x57b071){zipdir(_0x51f689,{'saveTo':_0x5700e4},function(_0x20409a,_0xba2548){if(_0x20409a)return _0x57b071(_0x20409a);return _0x5e2d34(_0xba2548);});})[_0x77df('0x1a')](function(){return new BPromise(function(_0x3e0801,_0x399062){rimraf(_0x51f689,function(_0x4fc637){if(_0x4fc637)_0x399062(_0x4fc637);return _0x3e0801();});});})[_0x77df('0x1a')](function(){return _0x5313bf[_0x77df('0x52')](_0x5700e4,_0x466aaa,function(_0x304d06){if(_0x304d06){console[_0x77df('0x78')](_0x77df('0x79'),_0x304d06);}else{fs[_0x77df('0x7a')](_0x5700e4);}});});});}else{return _0x5313bf[_0x77df('0x10')](0xc8);}})['catch'](handleError(_0x5313bf,null));}; \ No newline at end of file +var _0xf7f6=['hasOwnProperty','nolimit','order','sort','where','pick','merge','filter','$gte','split','options','include','rows','addTags','setTags','Tag','name','whatsappInteractionTags:save','removeTags','unix','toString','join','root','server','files','tmp','attachments','format','transcript-%d-%s.zip','User','fullname','push','CmContact','Contact','firstName','Attachment','Messages','createdAt','direction','WhatsappAccount','Owner','get','Whatsapp','N.A.','YYYY-MM-DD\x20HH:mm:ss','closed','closedAt','disposition','basename','existsSync','createReadStream','pipe','createWriteStream','out','System','secret','read','value','renderFile','views','downloadInteraction.ejs','transcript-','createPdfFromHTML','download','log','err','unlinkSync','moment','util','path','ioredis','../../components/interaction/service','../../components/parsers/qs','../../components/export/pdf','../../config/logger','api','../../config/environment','redis','localhost','socket.io-emitter','./whatsappInteraction.socket','register','sendStatus','status','undefined','limit','offset','count','set','Content-Range','destroy','error','index','map','fieldName','type','key','getOptions','findAll','whatsapp','query','catch','show','params','model','keys','rawAttributes','filters','intersection','attributes','fields','length','includeAll','WhatsappInteraction','find','then','create','body','update','describe','WhatsappMessage','addMessage','ids','omit'];(function(_0x46e7de,_0x1bf915){var _0x956360=function(_0x2f2965){while(--_0x2f2965){_0x46e7de['push'](_0x46e7de['shift']());}};_0x956360(++_0x1bf915);}(_0xf7f6,0x1b7));var _0x6f7f=function(_0x2b2d9c,_0x1e6185){_0x2b2d9c=_0x2b2d9c-0x0;var _0x1e59e7=_0xf7f6[_0x2b2d9c];return _0x1e59e7;};'use strict';var rimraf=require('rimraf');var zipdir=require('zip-dir');var moment=require(_0x6f7f('0x0'));var BPromise=require('bluebird');var util=require(_0x6f7f('0x1'));var path=require(_0x6f7f('0x2'));var ejs=require('ejs');var fs=require('fs');var _=require('lodash');var Redis=require(_0x6f7f('0x3'));var interaction=require(_0x6f7f('0x4'));var qs=require(_0x6f7f('0x5'));var pdf=require(_0x6f7f('0x6'));var logger=require(_0x6f7f('0x7'))(_0x6f7f('0x8'));var config=require(_0x6f7f('0x9'));var db=require('../../mysqldb')['db'];config['redis']=_['defaults'](config[_0x6f7f('0xa')],{'host':_0x6f7f('0xb'),'port':0x18eb});var socket=require(_0x6f7f('0xc'))(new Redis(config[_0x6f7f('0xa')]));require(_0x6f7f('0xd'))[_0x6f7f('0xe')](socket);function respondWithStatusCode(_0xab7584,_0x38a9a2){_0x38a9a2=_0x38a9a2||0xcc;return function(_0x1fbd90){if(_0x1fbd90){return _0xab7584[_0x6f7f('0xf')](_0x38a9a2);}return _0xab7584['status'](_0x38a9a2)['end']();};}function respondWithResult(_0x248062,_0x58b070){_0x58b070=_0x58b070||0xc8;return function(_0x503e43){if(_0x503e43){return _0x248062[_0x6f7f('0x10')](_0x58b070)['json'](_0x503e43);}};}function respondWithFilteredResult(_0x2bff41,_0x699e4f){return function(_0x3a0ec6){if(_0x3a0ec6){var _0x4b8765=typeof _0x699e4f['offset']===_0x6f7f('0x11')&&typeof _0x699e4f[_0x6f7f('0x12')]===_0x6f7f('0x11');var _0x49a085=_0x3a0ec6['count'];var _0x223986=_0x4b8765?0x0:_0x699e4f[_0x6f7f('0x13')];var _0x1b8d01=_0x4b8765?_0x3a0ec6[_0x6f7f('0x14')]:_0x699e4f[_0x6f7f('0x13')]+_0x699e4f[_0x6f7f('0x12')];var _0x8ea414;if(_0x1b8d01>=_0x49a085){_0x1b8d01=_0x49a085;_0x8ea414=0xc8;}else{_0x8ea414=0xce;}_0x2bff41[_0x6f7f('0x10')](_0x8ea414);return _0x2bff41[_0x6f7f('0x15')](_0x6f7f('0x16'),_0x223986+'-'+_0x1b8d01+'/'+_0x49a085)['json'](_0x3a0ec6);}return null;};}function saveUpdates(_0x31c533){return function(_0x3af673){if(_0x3af673){return _0x3af673['update'](_0x31c533)['then'](function(_0x1341d3){return _0x1341d3;});}return null;};}function removeEntity(_0x159fb9){return function(_0x2c957a){if(_0x2c957a){return _0x2c957a[_0x6f7f('0x17')]()['then'](function(){_0x159fb9[_0x6f7f('0x10')](0xcc)['end']();});}};}function handleEntityNotFound(_0x52474f){return function(_0x18be46){if(!_0x18be46){_0x52474f['sendStatus'](0x194);}return _0x18be46;};}function handleError(_0xa68139,_0x4b5d1c){_0x4b5d1c=_0x4b5d1c||0x1f4;return function(_0x52d8ab){logger[_0x6f7f('0x18')](_0x52d8ab['stack']);if(_0x52d8ab['name']){delete _0x52d8ab['name'];}_0xa68139[_0x6f7f('0x10')](_0x4b5d1c)['send'](_0x52d8ab);};}exports[_0x6f7f('0x19')]=function(_0x11787f,_0x5b5e56){var _0x3b8d9f={};var _0x4b059c=_[_0x6f7f('0x1a')](db['WhatsappInteraction']['rawAttributes'],function(_0xddb9b0){return{'name':_0xddb9b0[_0x6f7f('0x1b')],'type':_0xddb9b0[_0x6f7f('0x1c')][_0x6f7f('0x1d')]};});_0x3b8d9f=qs[_0x6f7f('0x1e')](_0x4b059c,_0x11787f);return interaction[_0x6f7f('0x1f')](_0x6f7f('0x20'),_0x11787f[_0x6f7f('0x21')],_0x11787f['user'],_0x3b8d9f,_0x4b059c)['then'](respondWithFilteredResult(_0x5b5e56,_0x3b8d9f))[_0x6f7f('0x22')](handleError(_0x5b5e56,null));};exports[_0x6f7f('0x23')]=function(_0x159a35,_0x348a99){var _0x557752={'raw':![],'where':{'id':_0x159a35[_0x6f7f('0x24')]['id']}},_0x52facb={};_0x52facb[_0x6f7f('0x25')]=_[_0x6f7f('0x26')](db['WhatsappInteraction'][_0x6f7f('0x27')]);_0x52facb[_0x6f7f('0x21')]=_[_0x6f7f('0x26')](_0x159a35[_0x6f7f('0x21')]);_0x52facb[_0x6f7f('0x28')]=_[_0x6f7f('0x29')](_0x52facb[_0x6f7f('0x25')],_0x52facb[_0x6f7f('0x21')]);_0x557752[_0x6f7f('0x2a')]=_[_0x6f7f('0x29')](_0x52facb[_0x6f7f('0x25')],qs[_0x6f7f('0x2b')](_0x159a35['query'][_0x6f7f('0x2b')]));_0x557752[_0x6f7f('0x2a')]=_0x557752[_0x6f7f('0x2a')][_0x6f7f('0x2c')]?_0x557752[_0x6f7f('0x2a')]:_0x52facb[_0x6f7f('0x25')];if(_0x159a35[_0x6f7f('0x21')][_0x6f7f('0x2d')]){_0x557752['include']=[{'all':!![]}];}_0x557752=_['merge']({},_0x557752,_0x159a35['options']);return db[_0x6f7f('0x2e')][_0x6f7f('0x2f')](_0x557752)['then'](handleEntityNotFound(_0x348a99,null))[_0x6f7f('0x30')](respondWithResult(_0x348a99,null))[_0x6f7f('0x22')](handleError(_0x348a99,null));};exports['create']=function(_0x4b5994,_0x332cb5){return db[_0x6f7f('0x2e')][_0x6f7f('0x31')](_0x4b5994[_0x6f7f('0x32')],{})[_0x6f7f('0x30')](respondWithResult(_0x332cb5,0xc9))['catch'](handleError(_0x332cb5,null));};exports[_0x6f7f('0x33')]=function(_0x5b6825,_0x50ab14){if(_0x5b6825['body']['id']){delete _0x5b6825[_0x6f7f('0x32')]['id'];}return db['WhatsappInteraction'][_0x6f7f('0x2f')]({'where':{'id':_0x5b6825[_0x6f7f('0x24')]['id']}})[_0x6f7f('0x30')](handleEntityNotFound(_0x50ab14,null))[_0x6f7f('0x30')](saveUpdates(_0x5b6825[_0x6f7f('0x32')],null))[_0x6f7f('0x30')](respondWithResult(_0x50ab14,null))['catch'](handleError(_0x50ab14,null));};exports[_0x6f7f('0x17')]=function(_0x359b2f,_0x5e9fc2){return db['WhatsappInteraction'][_0x6f7f('0x2f')]({'where':{'id':_0x359b2f['params']['id']}})['then'](handleEntityNotFound(_0x5e9fc2,null))[_0x6f7f('0x30')](removeEntity(_0x5e9fc2,null))['catch'](handleError(_0x5e9fc2,null));};exports[_0x6f7f('0x34')]=function(_0x554f3a,_0x38a1d0){return db['WhatsappInteraction'][_0x6f7f('0x34')]()[_0x6f7f('0x30')](respondWithResult(_0x38a1d0,null))['catch'](handleError(_0x38a1d0,null));};exports['addMessage']=function(_0x47370e,_0x174c22){return db[_0x6f7f('0x35')][_0x6f7f('0x2f')]({'where':{'id':_0x47370e[_0x6f7f('0x24')]['id']}})[_0x6f7f('0x30')](handleEntityNotFound(_0x174c22,null))['then'](function(_0x5e85cc){if(_0x5e85cc){return _0x5e85cc[_0x6f7f('0x36')](_0x47370e['body'][_0x6f7f('0x37')],_[_0x6f7f('0x38')](_0x47370e['body'],[_0x6f7f('0x37'),'id'])||{});}})[_0x6f7f('0x30')](respondWithResult(_0x174c22,null))[_0x6f7f('0x22')](handleError(_0x174c22,null));};exports['getMessages']=function(_0x499963,_0x1ed33a){var _0x3d3a48={'raw':![],'where':{}};var _0x29c795={};var _0x4cbeff={'count':0x0,'rows':[]};return db[_0x6f7f('0x2e')]['findOne']({'where':{'id':_0x499963[_0x6f7f('0x24')]['id']}})[_0x6f7f('0x30')](handleEntityNotFound(_0x1ed33a,null))[_0x6f7f('0x30')](function(_0x530157){if(_0x530157){_0x29c795[_0x6f7f('0x25')]=_['keys'](db['WhatsappMessage'][_0x6f7f('0x27')]);_0x29c795['query']=_[_0x6f7f('0x26')](_0x499963[_0x6f7f('0x21')]);_0x29c795[_0x6f7f('0x28')]=_['intersection'](_0x29c795['model'],_0x29c795[_0x6f7f('0x21')]);_0x3d3a48[_0x6f7f('0x2a')]=_[_0x6f7f('0x29')](_0x29c795['model'],qs[_0x6f7f('0x2b')](_0x499963[_0x6f7f('0x21')][_0x6f7f('0x2b')]));_0x3d3a48[_0x6f7f('0x2a')]=_0x3d3a48['attributes']['length']?_0x3d3a48[_0x6f7f('0x2a')]:_0x29c795[_0x6f7f('0x25')];if(!_0x499963['query'][_0x6f7f('0x39')](_0x6f7f('0x3a'))){_0x3d3a48[_0x6f7f('0x12')]=qs[_0x6f7f('0x12')](_0x499963[_0x6f7f('0x21')][_0x6f7f('0x12')]);_0x3d3a48[_0x6f7f('0x13')]=qs[_0x6f7f('0x13')](_0x499963[_0x6f7f('0x21')][_0x6f7f('0x13')]);}_0x3d3a48[_0x6f7f('0x3b')]=qs['sort'](_0x499963[_0x6f7f('0x21')][_0x6f7f('0x3c')]);_0x3d3a48[_0x6f7f('0x3d')]=qs[_0x6f7f('0x28')](_[_0x6f7f('0x3e')](_0x499963[_0x6f7f('0x21')],_0x29c795['filters']));_0x3d3a48['where']['WhatsappInteractionId']=_0x530157['id'];if(_0x499963[_0x6f7f('0x21')]['filter']){_0x3d3a48['where']=_[_0x6f7f('0x3f')](_0x3d3a48[_0x6f7f('0x3d')],{'$or':_[_0x6f7f('0x1a')](_0x3d3a48['attributes'],function(_0x3812a1){var _0x50b31d={};_0x50b31d[_0x3812a1]={'$like':'%'+_0x499963[_0x6f7f('0x21')][_0x6f7f('0x40')]+'%'};return _0x50b31d;})});}if(_0x499963['query']['$gte']){var _0x388525=_0x499963[_0x6f7f('0x21')][_0x6f7f('0x41')][_0x6f7f('0x42')](',');var _0x36e7c5={};_0x36e7c5[_0x388525[0x0]]={'$gte':moment(_0x388525[0x1])['format']('YYYY-MM-DD\x20HH:mm:ss')};_0x3d3a48[_0x6f7f('0x3d')]=_[_0x6f7f('0x3f')](_0x3d3a48['where'],_0x36e7c5);}_0x3d3a48=_[_0x6f7f('0x3f')]({},_0x3d3a48,_0x499963[_0x6f7f('0x43')]);return db[_0x6f7f('0x35')]['count']({'where':_0x3d3a48[_0x6f7f('0x3d')]})[_0x6f7f('0x30')](function(_0xdf15c4){_0x4cbeff[_0x6f7f('0x14')]=_0xdf15c4;if(_0x499963['query'][_0x6f7f('0x2d')]){_0x3d3a48[_0x6f7f('0x44')]=[{'all':!![]}];}return db[_0x6f7f('0x35')][_0x6f7f('0x1f')](_0x3d3a48);})[_0x6f7f('0x30')](function(_0x3123b9){_0x4cbeff[_0x6f7f('0x45')]=_0x3123b9;return _0x4cbeff;});}})[_0x6f7f('0x30')](respondWithFilteredResult(_0x1ed33a,_0x3d3a48))[_0x6f7f('0x22')](handleError(_0x1ed33a,null));};exports[_0x6f7f('0x46')]=function(_0x3c53b9,_0x9b7995){return db['WhatsappInteraction'][_0x6f7f('0x2f')]({'where':{'id':_0x3c53b9[_0x6f7f('0x24')]['id']}})[_0x6f7f('0x30')](handleEntityNotFound(_0x9b7995,null))[_0x6f7f('0x30')](function(_0x26ac34){if(_0x26ac34){return _0x26ac34[_0x6f7f('0x47')](_0x3c53b9[_0x6f7f('0x32')]['ids'],_[_0x6f7f('0x38')](_0x3c53b9[_0x6f7f('0x32')],[_0x6f7f('0x37'),'id'])||{})['spread'](function(){return db[_0x6f7f('0x48')][_0x6f7f('0x1f')]({'attributes':['id',_0x6f7f('0x49'),'color'],'where':{'id':_0x3c53b9[_0x6f7f('0x32')][_0x6f7f('0x37')]}});})['then'](function(_0x491080){socket['emit'](_0x6f7f('0x4a'),{'id':Number(_0x3c53b9[_0x6f7f('0x24')]['id']),'tags':_0x491080||[]});return{'id':Number(_0x3c53b9[_0x6f7f('0x24')]['id']),'tags':_0x491080||[]};});}})['then'](respondWithResult(_0x9b7995,null))[_0x6f7f('0x22')](handleError(_0x9b7995,null));};exports[_0x6f7f('0x4b')]=function(_0x3054f6,_0x2c2c17){return db[_0x6f7f('0x2e')]['find']({'where':{'id':_0x3054f6[_0x6f7f('0x24')]['id']}})['then'](handleEntityNotFound(_0x2c2c17,null))[_0x6f7f('0x30')](function(_0x47e45c){if(_0x47e45c){return _0x47e45c[_0x6f7f('0x4b')](_0x3054f6[_0x6f7f('0x21')][_0x6f7f('0x37')]);}})[_0x6f7f('0x30')](respondWithStatusCode(_0x2c2c17,null))[_0x6f7f('0x22')](handleError(_0x2c2c17,null));};exports['download']=function(_0x4dc6c2,_0x28a280){var _0x3f5d97=moment()[_0x6f7f('0x4c')]()[_0x6f7f('0x4d')]();var _0x329238=path[_0x6f7f('0x4e')](config[_0x6f7f('0x4f')],_0x6f7f('0x50'),_0x6f7f('0x51'),_0x6f7f('0x52'));var _0x1c7ffe=path['join'](config['root'],'server','files',_0x6f7f('0x53'));var _0xccba81=path[_0x6f7f('0x4e')](_0x329238,_0x3f5d97);var _0x1c5991=util[_0x6f7f('0x54')](_0x6f7f('0x55'),_0x4dc6c2[_0x6f7f('0x24')]['id'],_0x3f5d97);var _0x5dcf0f=path[_0x6f7f('0x4e')](_0x329238,_0x1c5991);var _0x300767=[];_0x300767['push']({'model':db[_0x6f7f('0x56')],'as':'User','attributes':['id',_0x6f7f('0x57')],'raw':!![]});_0x300767[_0x6f7f('0x58')]({'model':db[_0x6f7f('0x59')],'as':_0x6f7f('0x5a'),'attributes':['id',_0x6f7f('0x5b'),'lastName'],'raw':!![]});if(_0x4dc6c2['query'][_0x6f7f('0x53')]){_0x300767[_0x6f7f('0x58')]({'model':db[_0x6f7f('0x5c')],'as':_0x6f7f('0x5c'),'raw':!![]});}var _0x2bd1f3=[{'model':db[_0x6f7f('0x35')],'as':_0x6f7f('0x5d'),'attributes':['id',_0x6f7f('0x32'),_0x6f7f('0x5e'),_0x6f7f('0x5f'),'secret','read'],'include':_0x300767}];_0x2bd1f3['push']({'model':db[_0x6f7f('0x60')],'as':'Account','attributes':['id','name']});_0x2bd1f3[_0x6f7f('0x58')]({'model':db['User'],'as':_0x6f7f('0x61'),'attributes':['id',_0x6f7f('0x57')]});return db[_0x6f7f('0x2e')][_0x6f7f('0x2f')]({'where':{'id':_0x4dc6c2[_0x6f7f('0x24')]['id']},'include':_0x2bd1f3})[_0x6f7f('0x30')](handleEntityNotFound(_0x28a280,null))[_0x6f7f('0x30')](function(_0x1e0460){if(_0x1e0460){var _0xcb149=_0x1e0460[_0x6f7f('0x62')]({'plain':!![]});fs['mkdirSync'](_0xccba81);var _0x545853={'channel':_0x6f7f('0x63'),'account':_0xcb149['Account']['name'],'agent':_0xcb149[_0x6f7f('0x61')]?_0xcb149[_0x6f7f('0x61')]['fullname']:_0x6f7f('0x64'),'createdAt':moment(_0xcb149[_0x6f7f('0x5e')])[_0x6f7f('0x54')](_0x6f7f('0x65'))[_0x6f7f('0x4d')](),'closedAt':_0xcb149[_0x6f7f('0x66')]?moment(_0xcb149[_0x6f7f('0x67')])[_0x6f7f('0x54')](_0x6f7f('0x65'))[_0x6f7f('0x4d')]():'','disposition':_0xcb149[_0x6f7f('0x68')],'messages':_(_0xcb149['Messages'])[_0x6f7f('0x40')]({'secret':![]})['map'](function(_0x49a37a){if(_0x49a37a['Attachment']){var _0xbf63d4=path[_0x6f7f('0x4e')](_0x1c7ffe,_0x49a37a['Attachment'][_0x6f7f('0x69')]);if(fs[_0x6f7f('0x6a')](_0xbf63d4)){fs[_0x6f7f('0x6b')](_0xbf63d4)[_0x6f7f('0x6c')](fs[_0x6f7f('0x6d')](path[_0x6f7f('0x4e')](_0xccba81,_0x49a37a[_0x6f7f('0x5c')][_0x6f7f('0x69')])));}}return{'date':moment(_0x49a37a[_0x6f7f('0x5e')])['format'](_0x6f7f('0x65'))[_0x6f7f('0x4d')](),'sender':_0x49a37a['direction']===_0x6f7f('0x6e')?_0x49a37a[_0x6f7f('0x56')]?_0x49a37a[_0x6f7f('0x56')][_0x6f7f('0x57')]:_0x6f7f('0x6f'):_0x49a37a['Contact']['firstName']+(_0x49a37a[_0x6f7f('0x5a')]['lastName']?'\x20'+_0x49a37a[_0x6f7f('0x5a')]['lastName']:''),'body':_0x49a37a[_0x6f7f('0x5c')]?_0x49a37a[_0x6f7f('0x5c')][_0x6f7f('0x69')]:_0x49a37a['body'],'direction':_0x49a37a[_0x6f7f('0x5f')]===_0x6f7f('0x6e')?'A':'C','secret':_0x49a37a[_0x6f7f('0x70')],'read':_0x49a37a[_0x6f7f('0x71')],'attachment':_0x49a37a[_0x6f7f('0x5c')]};})[_0x6f7f('0x72')]()};return ejs[_0x6f7f('0x73')](path['join'](config[_0x6f7f('0x4f')],_0x6f7f('0x50'),_0x6f7f('0x74'),_0x6f7f('0x75')),{'interaction':_0x545853})['then'](function(_0xdbbc27){var _0x47d621=path[_0x6f7f('0x4e')](_0xccba81,_0x6f7f('0x76')+_0xcb149['id']+'-'+_0x3f5d97+'.pdf');var _0x329a84={'path':_0x47d621,'channel':_0x6f7f('0x63'),'interactionId':_0xcb149['id']};return pdf[_0x6f7f('0x77')](_0xdbbc27,_0x329a84);})[_0x6f7f('0x30')](function(){return new BPromise(function(_0x5d9a12,_0x31e798){zipdir(_0xccba81,{'saveTo':_0x5dcf0f},function(_0x15532e,_0x1f0c83){if(_0x15532e)return _0x31e798(_0x15532e);return _0x5d9a12(_0x1f0c83);});})['then'](function(){return new BPromise(function(_0x4d8110,_0x3917a7){rimraf(_0xccba81,function(_0x5191b0){if(_0x5191b0)_0x3917a7(_0x5191b0);return _0x4d8110();});});})['then'](function(){return _0x28a280[_0x6f7f('0x78')](_0x5dcf0f,_0x1c5991,function(_0x336522){if(_0x336522){console[_0x6f7f('0x79')](_0x6f7f('0x7a'),_0x336522);}else{fs[_0x6f7f('0x7b')](_0x5dcf0f);}});});});}else{return _0x28a280[_0x6f7f('0xf')](0xc8);}})[_0x6f7f('0x22')](handleError(_0x28a280,null));}; \ No newline at end of file diff --git a/server/api/whatsappInteraction/whatsappInteraction.events.js b/server/api/whatsappInteraction/whatsappInteraction.events.js index ca3bc83..d40f103 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 _0x87ae=['findAll','setDataValue','unreadMessages','length','emit','catch','exports','WhatsappInteraction','setMaxListeners','save','update','then','Users','map'];(function(_0x20c9b2,_0x55d7b1){var _0x2c6030=function(_0x10845f){while(--_0x10845f){_0x20c9b2['push'](_0x20c9b2['shift']());}};_0x2c6030(++_0x55d7b1);}(_0x87ae,0xf5));var _0xe87a=function(_0x456fb1,_0x859a1d){_0x456fb1=_0x456fb1-0x0;var _0x4083d6=_0x87ae[_0x456fb1];return _0x4083d6;};'use strict';var EventEmitter=require('events');var WhatsappInteraction=require('../../mysqldb')['db'][_0xe87a('0x0')];var WhatsappMessage=require('../../mysqldb')['db']['WhatsappMessage'];var WhatsappInteractionEvents=new EventEmitter();WhatsappInteractionEvents[_0xe87a('0x1')](0x0);var events={'afterCreate':_0xe87a('0x2'),'afterUpdate':_0xe87a('0x3'),'afterDestroy':'remove'};function emitEvent(_0x28899c){return function(_0x1fa362,_0x1820dc,_0x5ef978){_0x1fa362['getUsers']({'attributes':['id'],'raw':!![]})[_0xe87a('0x4')](function(_0x2fbd6b){_0x1fa362['setDataValue'](_0xe87a('0x5'),_0x2fbd6b[_0xe87a('0x6')](function(_0x48873f){return{'id':_0x48873f['id']};}));return WhatsappMessage[_0xe87a('0x7')]({'where':{'WhatsappInteractionId':_0x1fa362['id'],'direction':'in','read':![]},'raw':!![]});})[_0xe87a('0x4')](function(_0x499cb8){_0x1fa362[_0xe87a('0x8')](_0xe87a('0x9'),_0x499cb8[_0xe87a('0xa')]);WhatsappInteractionEvents[_0xe87a('0xb')](_0x28899c+':'+_0x1fa362['id'],_0x1fa362);WhatsappInteractionEvents[_0xe87a('0xb')](_0x28899c,_0x1fa362);_0x5ef978(null);})[_0xe87a('0xc')](_0x5ef978(null));};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];WhatsappInteraction['hook'](e,emitEvent(event));}}module[_0xe87a('0xd')]=WhatsappInteractionEvents; \ No newline at end of file +var _0x6324=['WhatsappInteraction','setMaxListeners','update','getUsers','then','setDataValue','Users','map','findAll','unreadMessages','length','emit','catch','hasOwnProperty','hook','exports','events','../../mysqldb'];(function(_0x1e3c02,_0x5c07a2){var _0x4d26d7=function(_0x367ed9){while(--_0x367ed9){_0x1e3c02['push'](_0x1e3c02['shift']());}};_0x4d26d7(++_0x5c07a2);}(_0x6324,0x142));var _0x4632=function(_0x469add,_0x50ef21){_0x469add=_0x469add-0x0;var _0x2e8a26=_0x6324[_0x469add];return _0x2e8a26;};'use strict';var EventEmitter=require(_0x4632('0x0'));var WhatsappInteraction=require(_0x4632('0x1'))['db'][_0x4632('0x2')];var WhatsappMessage=require(_0x4632('0x1'))['db']['WhatsappMessage'];var WhatsappInteractionEvents=new EventEmitter();WhatsappInteractionEvents[_0x4632('0x3')](0x0);var events={'afterCreate':'save','afterUpdate':_0x4632('0x4'),'afterDestroy':'remove'};function emitEvent(_0x13b218){return function(_0x592e39,_0x140bc7,_0x24aba6){_0x592e39[_0x4632('0x5')]({'attributes':['id'],'raw':!![]})[_0x4632('0x6')](function(_0x4a15b2){_0x592e39[_0x4632('0x7')](_0x4632('0x8'),_0x4a15b2[_0x4632('0x9')](function(_0x5a523b){return{'id':_0x5a523b['id']};}));return WhatsappMessage[_0x4632('0xa')]({'where':{'WhatsappInteractionId':_0x592e39['id'],'direction':'in','read':![]},'raw':!![]});})[_0x4632('0x6')](function(_0x47a518){_0x592e39['setDataValue'](_0x4632('0xb'),_0x47a518[_0x4632('0xc')]);WhatsappInteractionEvents[_0x4632('0xd')](_0x13b218+':'+_0x592e39['id'],_0x592e39);WhatsappInteractionEvents[_0x4632('0xd')](_0x13b218,_0x592e39);_0x24aba6(null);})[_0x4632('0xe')](_0x24aba6(null));};}for(var e in events){if(events[_0x4632('0xf')](e)){var event=events[e];WhatsappInteraction[_0x4632('0x10')](e,emitEvent(event));}}module[_0x4632('0x11')]=WhatsappInteractionEvents; \ No newline at end of file diff --git a/server/api/whatsappInteraction/whatsappInteraction.model.js b/server/api/whatsappInteraction/whatsappInteraction.model.js index d2fa679..30747c7 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 _0x0f97=['../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./whatsappInteraction.attributes','define','WhatsappInteraction','whatsapp_interactions','changed','closed','closedAt','lodash','util'];(function(_0x57b54c,_0x54ce0d){var _0x59cc19=function(_0xa33bc6){while(--_0xa33bc6){_0x57b54c['push'](_0x57b54c['shift']());}};_0x59cc19(++_0x54ce0d);}(_0x0f97,0x196));var _0x70f9=function(_0x2181fc,_0x7283aa){_0x2181fc=_0x2181fc-0x0;var _0x315da1=_0x0f97[_0x2181fc];return _0x315da1;};'use strict';var _=require(_0x70f9('0x0'));var util=require(_0x70f9('0x1'));var logger=require(_0x70f9('0x2'))(_0x70f9('0x3'));var moment=require(_0x70f9('0x4'));var BPromise=require(_0x70f9('0x5'));var rp=require(_0x70f9('0x6'));var fs=require('fs');var path=require(_0x70f9('0x7'));var rimraf=require(_0x70f9('0x8'));var config=require(_0x70f9('0x9'));var attributes=require(_0x70f9('0xa'));module['exports']=function(_0x4dafa5,_0x37d6a7){return _0x4dafa5[_0x70f9('0xb')](_0x70f9('0xc'),attributes,{'tableName':_0x70f9('0xd'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x59933c,_0x523d32,_0x140eec){if(_0x59933c[_0x70f9('0xe')](_0x70f9('0xf'))){_0x59933c[_0x70f9('0x10')]=moment()['format']('YYYY-MM-DD\x20HH:mm:ss');}_0x140eec(null,_0x59933c);}}});}; \ No newline at end of file +var _0x7f0a=['closedAt','YYYY-MM-DD\x20HH:mm:ss','lodash','../../config/logger','api','moment','request-promise','path','rimraf','../../config/environment','./whatsappInteraction.attributes','define','WhatsappInteraction','whatsapp_interactions','changed','closed'];(function(_0x57b8a8,_0x2a296e){var _0x140714=function(_0x54f658){while(--_0x54f658){_0x57b8a8['push'](_0x57b8a8['shift']());}};_0x140714(++_0x2a296e);}(_0x7f0a,0x82));var _0xa7f0=function(_0xae7c2f,_0xf31e04){_0xae7c2f=_0xae7c2f-0x0;var _0x5d7001=_0x7f0a[_0xae7c2f];return _0x5d7001;};'use strict';var _=require(_0xa7f0('0x0'));var util=require('util');var logger=require(_0xa7f0('0x1'))(_0xa7f0('0x2'));var moment=require(_0xa7f0('0x3'));var BPromise=require('bluebird');var rp=require(_0xa7f0('0x4'));var fs=require('fs');var path=require(_0xa7f0('0x5'));var rimraf=require(_0xa7f0('0x6'));var config=require(_0xa7f0('0x7'));var attributes=require(_0xa7f0('0x8'));module['exports']=function(_0x596aaa,_0x10a3a8){return _0x596aaa[_0xa7f0('0x9')](_0xa7f0('0xa'),attributes,{'tableName':_0xa7f0('0xb'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x299e9e,_0x307e19,_0x12cc49){if(_0x299e9e[_0xa7f0('0xc')](_0xa7f0('0xd'))){_0x299e9e[_0xa7f0('0xe')]=moment()['format'](_0xa7f0('0xf'));}_0x12cc49(null,_0x299e9e);}}});}; \ No newline at end of file diff --git a/server/api/whatsappInteraction/whatsappInteraction.rpc.js b/server/api/whatsappInteraction/whatsappInteraction.rpc.js index 49544d8..0152509 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 _0xbd81=['limit','AddTagsToWhatsappInteraction','find','where','body','ids','AddTags','util','moment','bluebird','randomstring','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','defaults','redis','localhost','socket.io-emitter','./whatsappInteraction.socket','register','request','then','info','WhatsappInteraction,\x20%s,\x20%s','request\x20sent','debug','WhatsappInteraction,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','UpdateWhatsappInteraction','WhatsappInteraction','update','options','raw','attributes'];(function(_0x13a102,_0x7f6c67){var _0x3a37d2=function(_0x418744){while(--_0x418744){_0x13a102['push'](_0x13a102['shift']());}};_0x3a37d2(++_0x7f6c67);}(_0xbd81,0x126));var _0x1bd8=function(_0x55e08b,_0x421620){_0x55e08b=_0x55e08b-0x0;var _0xd1a7ff=_0xbd81[_0x55e08b];return _0xd1a7ff;};'use strict';var _=require('lodash');var util=require(_0x1bd8('0x0'));var moment=require(_0x1bd8('0x1'));var BPromise=require(_0x1bd8('0x2'));var rs=require(_0x1bd8('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0x1bd8('0x4'));var logger=require(_0x1bd8('0x5'))('rpc');var config=require(_0x1bd8('0x6'));var jayson=require(_0x1bd8('0x7'));var client=jayson[_0x1bd8('0x8')][_0x1bd8('0x9')]({'port':0x232a});config['redis']=_[_0x1bd8('0xa')](config[_0x1bd8('0xb')],{'host':_0x1bd8('0xc'),'port':0x18eb});var socket=require(_0x1bd8('0xd'))(new Redis(config[_0x1bd8('0xb')]));require(_0x1bd8('0xe'))[_0x1bd8('0xf')](socket);function respondWithRpcPromise(_0x422a09,_0x29f5ea,_0x27ab1e){return new BPromise(function(_0x121468,_0x372a36){return client[_0x1bd8('0x10')](_0x422a09,_0x27ab1e)[_0x1bd8('0x11')](function(_0x3a468f){logger[_0x1bd8('0x12')](_0x1bd8('0x13'),_0x29f5ea,_0x1bd8('0x14'));logger[_0x1bd8('0x15')](_0x1bd8('0x16'),_0x29f5ea,_0x1bd8('0x14'),JSON['stringify'](_0x3a468f));if(_0x3a468f['error']){if(_0x3a468f[_0x1bd8('0x17')][_0x1bd8('0x18')]===0x1f4){logger[_0x1bd8('0x17')](_0x1bd8('0x13'),_0x29f5ea,_0x3a468f[_0x1bd8('0x17')][_0x1bd8('0x19')]);return _0x372a36(_0x3a468f[_0x1bd8('0x17')][_0x1bd8('0x19')]);}logger['error'](_0x1bd8('0x13'),_0x29f5ea,_0x3a468f['error'][_0x1bd8('0x19')]);return _0x121468(_0x3a468f[_0x1bd8('0x17')][_0x1bd8('0x19')]);}else{logger[_0x1bd8('0x12')](_0x1bd8('0x13'),_0x29f5ea,_0x1bd8('0x14'));_0x121468(_0x3a468f[_0x1bd8('0x1a')]['message']);}})[_0x1bd8('0x1b')](function(_0x66954){logger[_0x1bd8('0x17')](_0x1bd8('0x13'),_0x29f5ea,_0x66954);_0x372a36(_0x66954);});});}exports[_0x1bd8('0x1c')]=function(_0x4721e7){var _0xd3d852=this;return new Promise(function(_0x20ff0b,_0x11f098){return db[_0x1bd8('0x1d')][_0x1bd8('0x1e')](_0x4721e7['body'],{'raw':_0x4721e7[_0x1bd8('0x1f')]?_0x4721e7[_0x1bd8('0x1f')][_0x1bd8('0x20')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x4721e7[_0x1bd8('0x1f')]?_0x4721e7[_0x1bd8('0x1f')]['where']||null:null,'attributes':_0x4721e7[_0x1bd8('0x1f')]?_0x4721e7[_0x1bd8('0x1f')][_0x1bd8('0x21')]||null:null,'limit':_0x4721e7[_0x1bd8('0x1f')]?_0x4721e7[_0x1bd8('0x1f')][_0x1bd8('0x22')]||null:null})[_0x1bd8('0x11')](function(_0x19bf9d){logger['info'](_0x1bd8('0x1c'),_0x4721e7);logger[_0x1bd8('0x15')](_0x1bd8('0x1c'),_0x4721e7,JSON['stringify'](_0x19bf9d));_0x20ff0b(_0x19bf9d);})[_0x1bd8('0x1b')](function(_0x2c6f04){logger[_0x1bd8('0x17')](_0x1bd8('0x1c'),_0x2c6f04[_0x1bd8('0x19')],_0x4721e7);_0x11f098(_0xd3d852['error'](0x1f4,_0x2c6f04[_0x1bd8('0x19')]));});});};exports[_0x1bd8('0x23')]=function(_0x3f8b49){return new Promise(function(_0x10ecef,_0x90e70){return db[_0x1bd8('0x1d')][_0x1bd8('0x24')]({'where':_0x3f8b49[_0x1bd8('0x1f')]?_0x3f8b49[_0x1bd8('0x1f')][_0x1bd8('0x25')]||null:null})[_0x1bd8('0x11')](function(_0x532552){if(_0x532552){return _0x532552['addTags'](_0x3f8b49[_0x1bd8('0x26')][_0x1bd8('0x27')],_['omit'](_0x3f8b49[_0x1bd8('0x26')],[_0x1bd8('0x27'),'id'])||{});}})['spread'](function(_0x23f3f6){logger[_0x1bd8('0x12')]('AddTags',_0x3f8b49);logger['debug']('AddTags',_0x3f8b49,JSON['stringify'](_0x23f3f6));_0x10ecef(_0x23f3f6);})[_0x1bd8('0x1b')](function(_0x51cb2e){logger[_0x1bd8('0x17')](_0x1bd8('0x28'),_0x51cb2e[_0x1bd8('0x19')],_0x3f8b49);_0x90e70(_this[_0x1bd8('0x17')](0x1f4,_0x51cb2e['message']));});});}; \ No newline at end of file +var _0x8f73=['register','request','then','info','WhatsappInteraction,\x20%s,\x20%s','request\x20sent','debug','WhatsappInteraction,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','UpdateWhatsappInteraction','WhatsappInteraction','update','body','options','attributes','limit','AddTagsToWhatsappInteraction','find','where','addTags','ids','omit','AddTags','lodash','util','moment','bluebird','randomstring','../../config/logger','rpc','../../config/environment','client','http','redis','defaults','localhost','socket.io-emitter'];(function(_0x4ae625,_0xf396d0){var _0x31accf=function(_0x3ded6b){while(--_0x3ded6b){_0x4ae625['push'](_0x4ae625['shift']());}};_0x31accf(++_0xf396d0);}(_0x8f73,0xc4));var _0x38f7=function(_0x565c49,_0x54acd0){_0x565c49=_0x565c49-0x0;var _0x20ca34=_0x8f73[_0x565c49];return _0x20ca34;};'use strict';var _=require(_0x38f7('0x0'));var util=require(_0x38f7('0x1'));var moment=require(_0x38f7('0x2'));var BPromise=require(_0x38f7('0x3'));var rs=require(_0x38f7('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0x38f7('0x5'))(_0x38f7('0x6'));var config=require(_0x38f7('0x7'));var jayson=require('jayson/promise');var client=jayson[_0x38f7('0x8')][_0x38f7('0x9')]({'port':0x232a});config[_0x38f7('0xa')]=_[_0x38f7('0xb')](config[_0x38f7('0xa')],{'host':_0x38f7('0xc'),'port':0x18eb});var socket=require(_0x38f7('0xd'))(new Redis(config[_0x38f7('0xa')]));require('./whatsappInteraction.socket')[_0x38f7('0xe')](socket);function respondWithRpcPromise(_0x185c81,_0x48bc08,_0x463cf9){return new BPromise(function(_0x94920a,_0xe85346){return client[_0x38f7('0xf')](_0x185c81,_0x463cf9)[_0x38f7('0x10')](function(_0x1c5cd8){logger[_0x38f7('0x11')](_0x38f7('0x12'),_0x48bc08,_0x38f7('0x13'));logger[_0x38f7('0x14')](_0x38f7('0x15'),_0x48bc08,_0x38f7('0x13'),JSON[_0x38f7('0x16')](_0x1c5cd8));if(_0x1c5cd8['error']){if(_0x1c5cd8[_0x38f7('0x17')][_0x38f7('0x18')]===0x1f4){logger[_0x38f7('0x17')](_0x38f7('0x12'),_0x48bc08,_0x1c5cd8[_0x38f7('0x17')][_0x38f7('0x19')]);return _0xe85346(_0x1c5cd8['error'][_0x38f7('0x19')]);}logger[_0x38f7('0x17')](_0x38f7('0x12'),_0x48bc08,_0x1c5cd8['error'][_0x38f7('0x19')]);return _0x94920a(_0x1c5cd8[_0x38f7('0x17')][_0x38f7('0x19')]);}else{logger[_0x38f7('0x11')](_0x38f7('0x12'),_0x48bc08,_0x38f7('0x13'));_0x94920a(_0x1c5cd8[_0x38f7('0x1a')][_0x38f7('0x19')]);}})[_0x38f7('0x1b')](function(_0x2dac40){logger[_0x38f7('0x17')](_0x38f7('0x12'),_0x48bc08,_0x2dac40);_0xe85346(_0x2dac40);});});}exports[_0x38f7('0x1c')]=function(_0x31b0e5){var _0x53de88=this;return new Promise(function(_0x5a730b,_0x410bd3){return db[_0x38f7('0x1d')][_0x38f7('0x1e')](_0x31b0e5[_0x38f7('0x1f')],{'raw':_0x31b0e5[_0x38f7('0x20')]?_0x31b0e5[_0x38f7('0x20')]['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x31b0e5[_0x38f7('0x20')]?_0x31b0e5[_0x38f7('0x20')]['where']||null:null,'attributes':_0x31b0e5[_0x38f7('0x20')]?_0x31b0e5['options'][_0x38f7('0x21')]||null:null,'limit':_0x31b0e5['options']?_0x31b0e5[_0x38f7('0x20')][_0x38f7('0x22')]||null:null})[_0x38f7('0x10')](function(_0x46f5c8){logger[_0x38f7('0x11')]('UpdateWhatsappInteraction',_0x31b0e5);logger[_0x38f7('0x14')]('UpdateWhatsappInteraction',_0x31b0e5,JSON[_0x38f7('0x16')](_0x46f5c8));_0x5a730b(_0x46f5c8);})[_0x38f7('0x1b')](function(_0x200863){logger['error'](_0x38f7('0x1c'),_0x200863[_0x38f7('0x19')],_0x31b0e5);_0x410bd3(_0x53de88[_0x38f7('0x17')](0x1f4,_0x200863[_0x38f7('0x19')]));});});};exports[_0x38f7('0x23')]=function(_0x4da23b){return new Promise(function(_0xbe9c3,_0x42e0a5){return db[_0x38f7('0x1d')][_0x38f7('0x24')]({'where':_0x4da23b[_0x38f7('0x20')]?_0x4da23b['options'][_0x38f7('0x25')]||null:null})[_0x38f7('0x10')](function(_0x24b57d){if(_0x24b57d){return _0x24b57d[_0x38f7('0x26')](_0x4da23b[_0x38f7('0x1f')][_0x38f7('0x27')],_[_0x38f7('0x28')](_0x4da23b[_0x38f7('0x1f')],[_0x38f7('0x27'),'id'])||{});}})['spread'](function(_0x18d08e){logger['info'](_0x38f7('0x29'),_0x4da23b);logger[_0x38f7('0x14')]('AddTags',_0x4da23b,JSON[_0x38f7('0x16')](_0x18d08e));_0xbe9c3(_0x18d08e);})['catch'](function(_0x4d515f){logger[_0x38f7('0x17')](_0x38f7('0x29'),_0x4d515f[_0x38f7('0x19')],_0x4da23b);_0x42e0a5(_this['error'](0x1f4,_0x4d515f[_0x38f7('0x19')]));});});}; \ No newline at end of file diff --git a/server/api/whatsappInteraction/whatsappInteraction.socket.js b/server/api/whatsappInteraction/whatsappInteraction.socket.js index ae5c9ef..e845f60 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 _0xa004=['emit','removeListener','register','length','whatsappInteraction:','./whatsappInteraction.events','save','update'];(function(_0x29a289,_0x95a026){var _0x47e6af=function(_0x34e18a){while(--_0x34e18a){_0x29a289['push'](_0x29a289['shift']());}};_0x47e6af(++_0x95a026);}(_0xa004,0x7d));var _0x4a00=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xa004[_0x3dd15e];return _0x231fd0;};'use strict';var WhatsappInteractionEvents=require(_0x4a00('0x0'));var events=[_0x4a00('0x1'),'remove',_0x4a00('0x2')];function createListener(_0x171613,_0x3dc877){return function(_0x5905c7){_0x3dc877[_0x4a00('0x3')](_0x171613,_0x5905c7);};}function removeListener(_0x54099c,_0x1e9fbb){return function(){WhatsappInteractionEvents[_0x4a00('0x4')](_0x54099c,_0x1e9fbb);};}exports[_0x4a00('0x5')]=function(_0x2c422a){for(var _0x5f82c3=0x0,_0x40efbd=events[_0x4a00('0x6')];_0x5f82c3<_0x40efbd;_0x5f82c3++){var _0x1ac233=events[_0x5f82c3];var _0x48ffa4=createListener(_0x4a00('0x7')+_0x1ac233,_0x2c422a);WhatsappInteractionEvents['on'](_0x1ac233,_0x48ffa4);}}; \ No newline at end of file +var _0xaf57=['save','update','./whatsappInteraction.events'];(function(_0x4b73a2,_0x40b5fe){var _0x383c66=function(_0x3917ae){while(--_0x3917ae){_0x4b73a2['push'](_0x4b73a2['shift']());}};_0x383c66(++_0x40b5fe);}(_0xaf57,0x14c));var _0x7af5=function(_0x5f309e,_0x66e31){_0x5f309e=_0x5f309e-0x0;var _0x487b5e=_0xaf57[_0x5f309e];return _0x487b5e;};'use strict';var WhatsappInteractionEvents=require(_0x7af5('0x0'));var events=[_0x7af5('0x1'),'remove',_0x7af5('0x2')];function createListener(_0x5a93ed,_0x3d25fd){return function(_0x48d1e3){_0x3d25fd['emit'](_0x5a93ed,_0x48d1e3);};}function removeListener(_0x3696d2,_0x383772){return function(){WhatsappInteractionEvents['removeListener'](_0x3696d2,_0x383772);};}exports['register']=function(_0x5d5e03){for(var _0x4fc87d=0x0,_0x1a2073=events['length'];_0x4fc87d<_0x1a2073;_0x4fc87d++){var _0x3edad4=events[_0x4fc87d];var _0x59403a=createListener('whatsappInteraction:'+_0x3edad4,_0x5d5e03);WhatsappInteractionEvents['on'](_0x3edad4,_0x59403a);}}; \ No newline at end of file diff --git a/server/api/whatsappMessage/index.js b/server/api/whatsappMessage/index.js index d25e817..da5341d 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 _0x4d5c=['whatsapp','whatsappmessage:create','create','/:id/status','status','put','update','/:id/accept','accept','/:id/reject','reject','delete','destroy','multer','util','path','connect-timeout','express','fs-extra','../../components/interaction/service','../../config/environment','./whatsappMessage.controller','get','isAuthenticated','index','describe','/:id','show','post','tracked'];(function(_0xd76d8b,_0x12f713){var _0xf75e5e=function(_0x5c253f){while(--_0x5c253f){_0xd76d8b['push'](_0xd76d8b['shift']());}};_0xf75e5e(++_0x12f713);}(_0x4d5c,0xfd));var _0xc4d5=function(_0x3a6efd,_0x2a5102){_0x3a6efd=_0x3a6efd-0x0;var _0x487b9a=_0x4d5c[_0x3a6efd];return _0x487b9a;};'use strict';var multer=require(_0xc4d5('0x0'));var util=require(_0xc4d5('0x1'));var path=require(_0xc4d5('0x2'));var timeout=require(_0xc4d5('0x3'));var express=require(_0xc4d5('0x4'));var router=express['Router']();var fs_extra=require(_0xc4d5('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0xc4d5('0x6'));var config=require(_0xc4d5('0x7'));var controller=require(_0xc4d5('0x8'));router[_0xc4d5('0x9')]('/',auth[_0xc4d5('0xa')](),controller[_0xc4d5('0xb')]);router[_0xc4d5('0x9')]('/describe',auth[_0xc4d5('0xa')](),controller[_0xc4d5('0xc')]);router[_0xc4d5('0x9')](_0xc4d5('0xd'),auth[_0xc4d5('0xa')](),controller[_0xc4d5('0xe')]);router[_0xc4d5('0xf')]('/',auth['isAuthenticated'](),interaction[_0xc4d5('0x10')](_0xc4d5('0x11'),_0xc4d5('0x12')),controller[_0xc4d5('0x13')]);router['post'](_0xc4d5('0x14'),controller[_0xc4d5('0x15')]);router[_0xc4d5('0x16')](_0xc4d5('0xd'),auth['isAuthenticated'](),controller[_0xc4d5('0x17')]);router[_0xc4d5('0x16')](_0xc4d5('0x18'),auth[_0xc4d5('0xa')](),controller[_0xc4d5('0x19')]);router[_0xc4d5('0x16')](_0xc4d5('0x1a'),auth[_0xc4d5('0xa')](),controller[_0xc4d5('0x1b')]);router[_0xc4d5('0x1c')](_0xc4d5('0xd'),auth[_0xc4d5('0xa')](),controller[_0xc4d5('0x1d')]);module['exports']=router; \ No newline at end of file +var _0x5eb6=['get','isAuthenticated','index','/describe','describe','show','post','tracked','create','/:id/status','status','put','/:id/accept','/:id/reject','delete','destroy','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../config/environment','./whatsappMessage.controller'];(function(_0x2da5df,_0x4697c9){var _0x4be7c2=function(_0x394445){while(--_0x394445){_0x2da5df['push'](_0x2da5df['shift']());}};_0x4be7c2(++_0x4697c9);}(_0x5eb6,0x1c1));var _0x65eb=function(_0x46e363,_0x45d7e2){_0x46e363=_0x46e363-0x0;var _0x3fb059=_0x5eb6[_0x46e363];return _0x3fb059;};'use strict';var multer=require(_0x65eb('0x0'));var util=require(_0x65eb('0x1'));var path=require(_0x65eb('0x2'));var timeout=require(_0x65eb('0x3'));var express=require(_0x65eb('0x4'));var router=express[_0x65eb('0x5')]();var fs_extra=require(_0x65eb('0x6'));var auth=require(_0x65eb('0x7'));var interaction=require('../../components/interaction/service');var config=require(_0x65eb('0x8'));var controller=require(_0x65eb('0x9'));router[_0x65eb('0xa')]('/',auth[_0x65eb('0xb')](),controller[_0x65eb('0xc')]);router[_0x65eb('0xa')](_0x65eb('0xd'),auth[_0x65eb('0xb')](),controller[_0x65eb('0xe')]);router[_0x65eb('0xa')]('/:id',auth[_0x65eb('0xb')](),controller[_0x65eb('0xf')]);router[_0x65eb('0x10')]('/',auth[_0x65eb('0xb')](),interaction[_0x65eb('0x11')]('whatsapp','whatsappmessage:create'),controller[_0x65eb('0x12')]);router['post'](_0x65eb('0x13'),controller[_0x65eb('0x14')]);router[_0x65eb('0x15')]('/:id',auth[_0x65eb('0xb')](),controller['update']);router[_0x65eb('0x15')](_0x65eb('0x16'),auth[_0x65eb('0xb')](),controller['accept']);router[_0x65eb('0x15')](_0x65eb('0x17'),auth['isAuthenticated'](),controller['reject']);router[_0x65eb('0x18')]('/:id',auth[_0x65eb('0xb')](),controller[_0x65eb('0x19')]);module[_0x65eb('0x1a')]=router; \ No newline at end of file diff --git a/server/api/whatsappMessage/whatsappMessage.attributes.js b/server/api/whatsappMessage/whatsappMessage.attributes.js index de5c8d8..8690e48 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 _0x37c7=['TEXT','sequelize','exports','BOOLEAN','out','STRING','DATE'];(function(_0x53f86f,_0xf17560){var _0xa58ab1=function(_0x20e6b4){while(--_0x20e6b4){_0x53f86f['push'](_0x53f86f['shift']());}};_0xa58ab1(++_0xf17560);}(_0x37c7,0x1cf));var _0x737c=function(_0x2212d1,_0x483fc8){_0x2212d1=_0x2212d1-0x0;var _0x15eec5=_0x37c7[_0x2212d1];return _0x15eec5;};'use strict';var Sequelize=require(_0x737c('0x0'));module[_0x737c('0x1')]={'body':{'type':Sequelize['TEXT']('medium'),'allowNull':![]},'read':{'type':Sequelize[_0x737c('0x2')],'defaultValue':![]},'direction':{'type':Sequelize['ENUM']('in',_0x737c('0x3')),'defaultValue':'out','allowNull':![]},'messageId':{'type':Sequelize['STRING'](0xbe)},'phone':{'type':Sequelize[_0x737c('0x4')]},'readAt':{'type':Sequelize[_0x737c('0x5')]},'secret':{'type':Sequelize[_0x737c('0x2')],'defaultValue':![]},'providerName':{'type':Sequelize[_0x737c('0x4')]},'providerResponse':{'type':Sequelize[_0x737c('0x6')]}}; \ No newline at end of file +var _0xa210=['sequelize','medium','BOOLEAN','ENUM','out','STRING','DATE','TEXT'];(function(_0x19e35c,_0x29cd1e){var _0x3e1fe8=function(_0x17258b){while(--_0x17258b){_0x19e35c['push'](_0x19e35c['shift']());}};_0x3e1fe8(++_0x29cd1e);}(_0xa210,0x1d8));var _0x0a21=function(_0x4d4f90,_0x4f761f){_0x4d4f90=_0x4d4f90-0x0;var _0x5507e8=_0xa210[_0x4d4f90];return _0x5507e8;};'use strict';var Sequelize=require(_0x0a21('0x0'));module['exports']={'body':{'type':Sequelize['TEXT'](_0x0a21('0x1')),'allowNull':![]},'read':{'type':Sequelize[_0x0a21('0x2')],'defaultValue':![]},'direction':{'type':Sequelize[_0x0a21('0x3')]('in','out'),'defaultValue':_0x0a21('0x4'),'allowNull':![]},'messageId':{'type':Sequelize[_0x0a21('0x5')](0xbe)},'phone':{'type':Sequelize[_0x0a21('0x5')]},'readAt':{'type':Sequelize[_0x0a21('0x6')]},'secret':{'type':Sequelize[_0x0a21('0x2')],'defaultValue':![]},'providerName':{'type':Sequelize[_0x0a21('0x5')]},'providerResponse':{'type':Sequelize[_0x0a21('0x7')]}}; \ No newline at end of file diff --git a/server/api/whatsappMessage/whatsappMessage.controller.js b/server/api/whatsappMessage/whatsappMessage.controller.js index 56c5ed7..fb3ac4a 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 _0x5e90=['accept','whatsapp','read','readAt','YYYY-MM-DD\x20HH:mm:ss','UserId','user','agent','WhatsappInteractionId','isNil','read1stAt','format','get','[WHATSAPPMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','role','interaction','null','acceptMessage','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','ContactId','sequelize','QueryTypes','SELECT','contact','fullname','internal','manual','SIP/%s','channel','motionChannel','event','EventManager','acceptmessage','WhatsappInteraction','[WHATSAPPMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','rejectMessage','User','email','reject','rejectmessage','WhatsappAccount','WhatsappAccountId','WhatsppMessage,\x20%s,\x20%s,\x20%s','received\x20delivery\x20report\x20from','twilio','MessageSid','messageId','MessageStatus','WhatsappAccount,\x20%s,\x20%s,\x20%s','inspect','eml-format','rimraf','fast-json-patch','request-promise','mustache','util','path','sox','squel','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','redis','./whatsappMessage.socket','register','jayson/promise','client','http','then','info','WhatsappMessage,\x20%s,\x20%s','debug','WhatsappMessage,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','sendStatus','end','status','json','offset','undefined','count','limit','set','Content-Range','apply','update','destroy','stack','name','send','index','map','WhatsappMessage','rawAttributes','fieldName','type','key','query','keys','filters','intersection','model','attributes','fields','hasOwnProperty','order','sort','pick','filter','where','merge','VIRTUAL','include','findAll','rows','catch','show','length','options','find','create','body','params','describe','whatsapp-interactions'];(function(_0x3ef27d,_0x382a13){var _0x5e40df=function(_0x4a31b0){while(--_0x4a31b0){_0x3ef27d['push'](_0x3ef27d['shift']());}};_0x5e40df(++_0x382a13);}(_0x5e90,0x1dc));var _0x05e9=function(_0x3064f4,_0x5aa5e2){_0x3064f4=_0x3064f4-0x0;var _0x5649a3=_0x5e90[_0x3064f4];return _0x5649a3;};'use strict';var emlformat=require(_0x05e9('0x0'));var rimraf=require(_0x05e9('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x05e9('0x2'));var rp=require(_0x05e9('0x3'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0x05e9('0x4'));var util=require(_0x05e9('0x5'));var path=require(_0x05e9('0x6'));var sox=require(_0x05e9('0x7'));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(_0x05e9('0x8'));var crypto=require('crypto');var jsforce=require(_0x05e9('0x9'));var deskjs=require(_0x05e9('0xa'));var toCsv=require(_0x05e9('0xb'));var querystring=require(_0x05e9('0xc'));var Papa=require(_0x05e9('0xd'));var Redis=require(_0x05e9('0xe'));var authService=require(_0x05e9('0xf'));var qs=require('../../components/parsers/qs');var as=require(_0x05e9('0x10'));var hardwareService=require(_0x05e9('0x11'));var logger=require(_0x05e9('0x12'))(_0x05e9('0x13'));var utils=require(_0x05e9('0x14'));var config=require(_0x05e9('0x15'));var licenseUtil=require(_0x05e9('0x16'));var db=require(_0x05e9('0x17'))['db'];config['redis']=_['defaults'](config[_0x05e9('0x18')],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x05e9('0x18')]));require(_0x05e9('0x19'))[_0x05e9('0x1a')](socket);var jayson=require(_0x05e9('0x1b'));var client=jayson[_0x05e9('0x1c')]['http']({'port':0x232c});var client9002=jayson[_0x05e9('0x1c')][_0x05e9('0x1d')]({'port':0x232a});function respondWithRpcPromise(_0x304520,_0x2edd35,_0x436213,_0x2f3575){return new BPromise(function(_0xd74ed3,_0x3a1621){var _0x11c49d=_0x2f3575||client;return _0x11c49d['request'](_0x304520,_0x436213)[_0x05e9('0x1e')](function(_0x136338){logger[_0x05e9('0x1f')](_0x05e9('0x20'),_0x2edd35,'request\x20sent');logger[_0x05e9('0x21')](_0x05e9('0x22'),_0x2edd35,_0x05e9('0x23'),JSON[_0x05e9('0x24')](_0x136338));if(_0x136338[_0x05e9('0x25')]){if(_0x136338[_0x05e9('0x25')][_0x05e9('0x26')]===0x1f4){logger[_0x05e9('0x25')](_0x05e9('0x20'),_0x2edd35,_0x136338[_0x05e9('0x25')]['message']);return _0x3a1621(_0x136338[_0x05e9('0x25')]['message']);}logger[_0x05e9('0x25')](_0x05e9('0x20'),_0x2edd35,_0x136338['error'][_0x05e9('0x27')]);return _0xd74ed3(_0x136338['error']['message']);}else{logger[_0x05e9('0x1f')](_0x05e9('0x20'),_0x2edd35,'request\x20sent');_0xd74ed3(_0x136338[_0x05e9('0x28')][_0x05e9('0x27')]);}})['catch'](function(_0x1794df){logger['error'](_0x05e9('0x20'),_0x2edd35,_0x1794df);_0x3a1621(_0x1794df);});});}function respondWithStatusCode(_0x80af9d,_0x345d4a){_0x345d4a=_0x345d4a||0xcc;return function(_0x17deb1){if(_0x17deb1){return _0x80af9d[_0x05e9('0x29')](_0x345d4a);}return _0x80af9d['status'](_0x345d4a)[_0x05e9('0x2a')]();};}function respondWithResult(_0x30cac6,_0x589729){_0x589729=_0x589729||0xc8;return function(_0x122d4f){if(_0x122d4f){return _0x30cac6[_0x05e9('0x2b')](_0x589729)[_0x05e9('0x2c')](_0x122d4f);}};}function respondWithFilteredResult(_0x348a3f,_0x4453db){return function(_0x255260){if(_0x255260){var _0x568038=typeof _0x4453db[_0x05e9('0x2d')]===_0x05e9('0x2e')&&typeof _0x4453db['limit']===_0x05e9('0x2e');var _0x2a4daf=_0x255260[_0x05e9('0x2f')];var _0x25b558=_0x568038?0x0:_0x4453db['offset'];var _0x21b5f1=_0x568038?_0x255260[_0x05e9('0x2f')]:_0x4453db['offset']+_0x4453db[_0x05e9('0x30')];var _0x59536d;if(_0x21b5f1>=_0x2a4daf){_0x21b5f1=_0x2a4daf;_0x59536d=0xc8;}else{_0x59536d=0xce;}_0x348a3f[_0x05e9('0x2b')](_0x59536d);return _0x348a3f[_0x05e9('0x31')](_0x05e9('0x32'),_0x25b558+'-'+_0x21b5f1+'/'+_0x2a4daf)[_0x05e9('0x2c')](_0x255260);}return null;};}function patchUpdates(_0x2daf2a){return function(_0x3032eb){try{jsonpatch[_0x05e9('0x33')](_0x3032eb,_0x2daf2a,!![]);}catch(_0x177638){return BPromise['reject'](_0x177638);}return _0x3032eb['save']();};}function saveUpdates(_0x8dfeb5,_0x50a017){return function(_0x1f834e){if(_0x1f834e){return _0x1f834e[_0x05e9('0x34')](_0x8dfeb5)[_0x05e9('0x1e')](function(_0x58d8b8){return _0x58d8b8;});}return null;};}function removeEntity(_0x1eb798,_0x3a8c21){return function(_0xd70780){if(_0xd70780){return _0xd70780[_0x05e9('0x35')]()[_0x05e9('0x1e')](function(){_0x1eb798['status'](0xcc)[_0x05e9('0x2a')]();});}};}function handleEntityNotFound(_0x413c16,_0x5d3ce6){return function(_0x36909b){if(!_0x36909b){_0x413c16[_0x05e9('0x29')](0x194);}return _0x36909b;};}function handleError(_0x391b81,_0x44c99f){_0x44c99f=_0x44c99f||0x1f4;return function(_0x38e96c){logger[_0x05e9('0x25')](_0x38e96c[_0x05e9('0x36')]);if(_0x38e96c[_0x05e9('0x37')]){delete _0x38e96c['name'];}_0x391b81['status'](_0x44c99f)[_0x05e9('0x38')](_0x38e96c);};}exports[_0x05e9('0x39')]=function(_0x440954,_0x3cff9b){var _0x32751e={},_0x167b64={},_0x58348b={'count':0x0,'rows':[]};var _0x579292=_[_0x05e9('0x3a')](db[_0x05e9('0x3b')][_0x05e9('0x3c')],function(_0xd6c60a){return{'name':_0xd6c60a[_0x05e9('0x3d')],'type':_0xd6c60a[_0x05e9('0x3e')][_0x05e9('0x3f')]};});_0x167b64['model']=_[_0x05e9('0x3a')](_0x579292,_0x05e9('0x37'));_0x167b64[_0x05e9('0x40')]=_[_0x05e9('0x41')](_0x440954[_0x05e9('0x40')]);_0x167b64[_0x05e9('0x42')]=_[_0x05e9('0x43')](_0x167b64[_0x05e9('0x44')],_0x167b64[_0x05e9('0x40')]);_0x32751e[_0x05e9('0x45')]=_[_0x05e9('0x43')](_0x167b64['model'],qs['fields'](_0x440954[_0x05e9('0x40')][_0x05e9('0x46')]));_0x32751e[_0x05e9('0x45')]=_0x32751e[_0x05e9('0x45')]['length']?_0x32751e['attributes']:_0x167b64[_0x05e9('0x44')];if(!_0x440954[_0x05e9('0x40')][_0x05e9('0x47')]('nolimit')){_0x32751e[_0x05e9('0x30')]=qs[_0x05e9('0x30')](_0x440954[_0x05e9('0x40')][_0x05e9('0x30')]);_0x32751e[_0x05e9('0x2d')]=qs[_0x05e9('0x2d')](_0x440954[_0x05e9('0x40')][_0x05e9('0x2d')]);}_0x32751e[_0x05e9('0x48')]=qs[_0x05e9('0x49')](_0x440954[_0x05e9('0x40')]['sort']);_0x32751e['where']=qs[_0x05e9('0x42')](_[_0x05e9('0x4a')](_0x440954['query'],_0x167b64[_0x05e9('0x42')]),_0x579292);if(_0x440954[_0x05e9('0x40')][_0x05e9('0x4b')]){_0x32751e[_0x05e9('0x4c')]=_[_0x05e9('0x4d')](_0x32751e['where'],{'$or':_['map'](_0x579292,function(_0x6e667d){if(_0x6e667d[_0x05e9('0x3e')]!==_0x05e9('0x4e')){var _0x3f051d={};_0x3f051d[_0x6e667d[_0x05e9('0x37')]]={'$like':'%'+_0x440954[_0x05e9('0x40')][_0x05e9('0x4b')]+'%'};return _0x3f051d;}})});}_0x32751e=_[_0x05e9('0x4d')]({},_0x32751e,_0x440954['options']);var _0xe2a121={'where':_0x32751e[_0x05e9('0x4c')]};return db[_0x05e9('0x3b')][_0x05e9('0x2f')](_0xe2a121)[_0x05e9('0x1e')](function(_0x5a6ec3){_0x58348b[_0x05e9('0x2f')]=_0x5a6ec3;if(_0x440954['query']['includeAll']){_0x32751e[_0x05e9('0x4f')]=[{'all':!![]}];}return db[_0x05e9('0x3b')][_0x05e9('0x50')](_0x32751e);})[_0x05e9('0x1e')](function(_0x39c7a5){_0x58348b[_0x05e9('0x51')]=_0x39c7a5;return _0x58348b;})['then'](respondWithFilteredResult(_0x3cff9b,_0x32751e))[_0x05e9('0x52')](handleError(_0x3cff9b,null));};exports[_0x05e9('0x53')]=function(_0x55eab3,_0x124604){var _0x506e64={'raw':!![],'where':{'id':_0x55eab3['params']['id']}},_0x12f8b={};_0x12f8b[_0x05e9('0x44')]=_[_0x05e9('0x41')](db[_0x05e9('0x3b')][_0x05e9('0x3c')]);_0x12f8b['query']=_[_0x05e9('0x41')](_0x55eab3[_0x05e9('0x40')]);_0x12f8b[_0x05e9('0x42')]=_['intersection'](_0x12f8b['model'],_0x12f8b['query']);_0x506e64['attributes']=_[_0x05e9('0x43')](_0x12f8b[_0x05e9('0x44')],qs[_0x05e9('0x46')](_0x55eab3[_0x05e9('0x40')][_0x05e9('0x46')]));_0x506e64['attributes']=_0x506e64[_0x05e9('0x45')][_0x05e9('0x54')]?_0x506e64[_0x05e9('0x45')]:_0x12f8b[_0x05e9('0x44')];if(_0x55eab3[_0x05e9('0x40')]['includeAll']){_0x506e64['include']=[{'all':!![]}];}_0x506e64=_[_0x05e9('0x4d')]({},_0x506e64,_0x55eab3[_0x05e9('0x55')]);return db[_0x05e9('0x3b')][_0x05e9('0x56')](_0x506e64)[_0x05e9('0x1e')](handleEntityNotFound(_0x124604,null))[_0x05e9('0x1e')](respondWithResult(_0x124604,null))[_0x05e9('0x52')](handleError(_0x124604,null));};exports[_0x05e9('0x57')]=function(_0x4040f7,_0xf99977){return db[_0x05e9('0x3b')][_0x05e9('0x57')](_0x4040f7[_0x05e9('0x58')],{})[_0x05e9('0x1e')](respondWithResult(_0xf99977,0xc9))[_0x05e9('0x52')](handleError(_0xf99977,null));};exports[_0x05e9('0x34')]=function(_0x4e9cb1,_0x247736){if(_0x4e9cb1[_0x05e9('0x58')]['id']){delete _0x4e9cb1[_0x05e9('0x58')]['id'];}return db[_0x05e9('0x3b')][_0x05e9('0x56')]({'where':{'id':_0x4e9cb1['params']['id']}})[_0x05e9('0x1e')](handleEntityNotFound(_0x247736,null))[_0x05e9('0x1e')](saveUpdates(_0x4e9cb1['body'],null))[_0x05e9('0x1e')](respondWithResult(_0x247736,null))[_0x05e9('0x52')](handleError(_0x247736,null));};exports[_0x05e9('0x35')]=function(_0x1a4622,_0x5140b3){return db['WhatsappMessage']['find']({'where':{'id':_0x1a4622[_0x05e9('0x59')]['id']}})[_0x05e9('0x1e')](handleEntityNotFound(_0x5140b3,null))['then'](removeEntity(_0x5140b3,null))[_0x05e9('0x52')](handleError(_0x5140b3,null));};exports[_0x05e9('0x5a')]=function(_0x1571a8,_0x100d5a){return db[_0x05e9('0x3b')][_0x05e9('0x5a')]()[_0x05e9('0x1e')](respondWithResult(_0x100d5a,null))[_0x05e9('0x52')](handleError(_0x100d5a,null));};var interaction_log=require(_0x05e9('0x12'))(_0x05e9('0x5b'));exports[_0x05e9('0x5c')]=function(_0x1c806a,_0x173fc0,_0x5b430e){var _0x34d9c9={'agent':{},'channel':_0x05e9('0x5d')};if(_0x1c806a['body']['id']){delete _0x1c806a[_0x05e9('0x58')]['id'];}_0x1c806a[_0x05e9('0x58')][_0x05e9('0x5e')]=!![];_0x1c806a[_0x05e9('0x58')][_0x05e9('0x5f')]=moment()['format'](_0x05e9('0x60'));_0x1c806a['body'][_0x05e9('0x61')]=_0x1c806a['body']['UserId']||_0x1c806a[_0x05e9('0x62')]['id'];_0x34d9c9[_0x05e9('0x63')]['id']=_0x1c806a[_0x05e9('0x58')]['UserId'];return db[_0x05e9('0x3b')][_0x05e9('0x56')]({'where':{'id':_0x1c806a[_0x05e9('0x59')]['id'],'UserId':null}})[_0x05e9('0x1e')](handleEntityNotFound(_0x173fc0,null))[_0x05e9('0x1e')](saveUpdates(_0x1c806a[_0x05e9('0x58')],null))[_0x05e9('0x1e')](function(_0x5494e5){if(_0x5494e5){_0x34d9c9['message']=_0x5494e5['get']({'plain':!![]});return db['WhatsappInteraction'][_0x05e9('0x56')]({'where':{'id':_0x5494e5[_0x05e9('0x64')]}});}return null;})[_0x05e9('0x1e')](handleEntityNotFound(_0x173fc0,null))['then'](function(_0x29ef80){if(_0x29ef80){return _0x29ef80[_0x05e9('0x34')]({'UserId':_0x1c806a['body'][_0x05e9('0x61')],'read1stAt':_[_0x05e9('0x65')](_0x29ef80[_0x05e9('0x66')])?moment()[_0x05e9('0x67')](_0x05e9('0x60')):undefined});}return null;})[_0x05e9('0x1e')](function(_0x50f8f8){if(_0x50f8f8){_0x34d9c9['interaction']=_0x50f8f8[_0x05e9('0x68')]({'plain':!![]});interaction_log[_0x05e9('0x1f')](_0x05e9('0x69'),_0x1c806a[_0x05e9('0x62')]['id'],_0x1c806a[_0x05e9('0x62')][_0x05e9('0x37')],_0x1c806a[_0x05e9('0x62')][_0x05e9('0x6a')],_0x34d9c9[_0x05e9('0x6b')]['id'],_0x1c806a['body']?JSON[_0x05e9('0x24')](_0x1c806a['body']):_0x05e9('0x6c'));return respondWithRpcPromise('AcceptMessage',_0x05e9('0x6d'),_0x34d9c9);}return null;})[_0x05e9('0x1e')](function(_0x1bfa5d){var _0x1805aa=_0x05e9('0x6e')+_0x1bfa5d['message'][_0x05e9('0x6f')];return db[_0x05e9('0x70')][_0x05e9('0x40')](_0x1805aa,{'type':db['Sequelize'][_0x05e9('0x71')][_0x05e9('0x72')],'raw':!![]})[_0x05e9('0x1e')](function(_0xf5b479){return _0xf5b479;});})[_0x05e9('0x1e')](function(_0x241725){if(_0x241725){_0x34d9c9[_0x05e9('0x27')][_0x05e9('0x73')]=_0x241725[0x0];if(!_0x1c806a[_0x05e9('0x58')][_0x05e9('0x61')])return;return db['User'][_0x05e9('0x56')]({'where':{'id':_0x1c806a[_0x05e9('0x58')][_0x05e9('0x61')],'role':_0x05e9('0x63')},'attributes':['id',_0x05e9('0x37'),_0x05e9('0x74'),'email',_0x05e9('0x75')],'raw':!![]});}return null;})[_0x05e9('0x1e')](function(_0xea0dd0){if(!_0xea0dd0)return null;_0x34d9c9[_0x05e9('0x27')][_0x05e9('0x63')]=_0xea0dd0;return _0x34d9c9;})[_0x05e9('0x1e')](function(_0x1d1632){if(_0x1d1632){if(_0x1c806a[_0x05e9('0x58')][_0x05e9('0x76')]){_0x34d9c9[_0x05e9('0x27')]['interface']=util['format'](_0x05e9('0x77'),_0x1c806a['user'][_0x05e9('0x37')]);_0x34d9c9['message'][_0x05e9('0x78')]=_0x34d9c9['channel'];_0x34d9c9[_0x05e9('0x27')][_0x05e9('0x79')]=_0x34d9c9[_0x05e9('0x78')];_0x34d9c9[_0x05e9('0x27')][_0x05e9('0x7a')]=_0x05e9('0x5c');return respondWithRpcPromise(_0x05e9('0x7b'),_0x05e9('0x7b'),{'event':_0x05e9('0x7c'),'message':_0x34d9c9[_0x05e9('0x27')]},client9002)['then'](function(){return _0x34d9c9;});}return _0x34d9c9;}return null;})['then'](respondWithResult(_0x173fc0,null))[_0x05e9('0x52')](handleError(_0x173fc0,null));};var interaction_log=require('../../config/logger')(_0x05e9('0x5b'));exports['reject']=function(_0x3a8ee7,_0x58bb43,_0x4b94e3){var _0x4d4263={'agent':{},'channel':'whatsapp'};if(_0x3a8ee7['body']['id']){delete _0x3a8ee7['body']['id'];}_0x3a8ee7[_0x05e9('0x58')][_0x05e9('0x61')]=_0x3a8ee7[_0x05e9('0x58')][_0x05e9('0x61')]||_0x3a8ee7[_0x05e9('0x62')]['id'];_0x4d4263[_0x05e9('0x63')]['id']=_0x3a8ee7[_0x05e9('0x58')]['UserId'];return db[_0x05e9('0x3b')][_0x05e9('0x56')]({'where':{'id':_0x3a8ee7['params']['id'],'UserId':null}})[_0x05e9('0x1e')](handleEntityNotFound(_0x58bb43,null))['then'](function(_0x2167f2){if(_0x2167f2){_0x4d4263[_0x05e9('0x27')]=_0x2167f2[_0x05e9('0x68')]({'plain':!![]});return db[_0x05e9('0x7d')][_0x05e9('0x56')]({'where':{'id':_0x2167f2[_0x05e9('0x64')]}});}return null;})[_0x05e9('0x1e')](handleEntityNotFound(_0x58bb43,null))[_0x05e9('0x1e')](function(_0x14e982){if(_0x14e982){_0x4d4263['interaction']=_0x14e982[_0x05e9('0x68')]({'plain':!![]});interaction_log[_0x05e9('0x1f')](_0x05e9('0x7e'),_0x3a8ee7[_0x05e9('0x62')]['id'],_0x3a8ee7[_0x05e9('0x62')][_0x05e9('0x37')],_0x3a8ee7['user'][_0x05e9('0x6a')],_0x4d4263[_0x05e9('0x6b')]['id'],_0x3a8ee7[_0x05e9('0x58')]?JSON[_0x05e9('0x24')](_0x3a8ee7[_0x05e9('0x58')]):_0x05e9('0x6c'));return respondWithRpcPromise('RejectMessage',_0x05e9('0x7f'),_0x4d4263);}return null;})[_0x05e9('0x1e')](function(_0x10f013){var _0xb0030d=_0x05e9('0x6e')+_0x10f013[_0x05e9('0x27')][_0x05e9('0x6f')];return db[_0x05e9('0x70')]['query'](_0xb0030d,{'type':db['Sequelize'][_0x05e9('0x71')][_0x05e9('0x72')],'raw':!![]})[_0x05e9('0x1e')](function(_0x54353f){return _0x54353f;});})[_0x05e9('0x1e')](function(_0x290ccf){if(_0x290ccf){_0x4d4263['message']['contact']=_0x290ccf[0x0];if(!_0x3a8ee7[_0x05e9('0x58')][_0x05e9('0x61')])return;return db[_0x05e9('0x80')]['find']({'where':{'id':_0x3a8ee7[_0x05e9('0x58')][_0x05e9('0x61')],'role':_0x05e9('0x63')},'attributes':['id',_0x05e9('0x37'),_0x05e9('0x74'),_0x05e9('0x81'),_0x05e9('0x75')],'raw':!![]});}return null;})[_0x05e9('0x1e')](function(_0x2983ca){if(!_0x2983ca)return null;_0x4d4263[_0x05e9('0x27')][_0x05e9('0x63')]=_0x2983ca;return _0x4d4263;})[_0x05e9('0x1e')](function(_0x5d8051){if(_0x5d8051){_0x5d8051[_0x05e9('0x27')]['interface']=util[_0x05e9('0x67')](_0x05e9('0x77'),_0x3a8ee7[_0x05e9('0x62')][_0x05e9('0x37')]);_0x5d8051['message'][_0x05e9('0x78')]=_0x4d4263[_0x05e9('0x78')];_0x5d8051[_0x05e9('0x27')][_0x05e9('0x79')]=_0x4d4263['channel'];_0x5d8051[_0x05e9('0x27')][_0x05e9('0x7a')]=_0x05e9('0x82');respondWithRpcPromise('EventManager',_0x05e9('0x7b'),{'event':_0x05e9('0x83'),'message':_0x5d8051[_0x05e9('0x27')]},client9002);return _0x4d4263;}return null;})[_0x05e9('0x1e')](respondWithResult(_0x58bb43,null))['catch'](handleError(_0x58bb43,null));};exports[_0x05e9('0x2b')]=function(_0x28cd0a,_0x2d67b3,_0x31b74a){if(_0x28cd0a['body']['id']){delete _0x28cd0a['body']['id'];}var _0x558fd7;return db[_0x05e9('0x3b')][_0x05e9('0x56')]({'where':{'id':_0x28cd0a[_0x05e9('0x59')]['id']}})[_0x05e9('0x1e')](handleEntityNotFound(_0x2d67b3,null))[_0x05e9('0x1e')](function(_0x75c2e){if(_0x75c2e){_0x558fd7=_0x75c2e;return db[_0x05e9('0x84')]['find']({'where':{'id':_0x75c2e[_0x05e9('0x85')]}});}})['then'](handleEntityNotFound(_0x2d67b3,null))[_0x05e9('0x1e')](function(_0xbab310){if(_0xbab310){logger[_0x05e9('0x21')](_0x05e9('0x86'),_0x05e9('0x2b'),_0x05e9('0x87'),_0xbab310['type'],util['inspect'](_0x28cd0a[_0x05e9('0x58')],{'showHidden':![],'depth':null}));switch(_0xbab310[_0x05e9('0x3e')]){case _0x05e9('0x88'):if(_0x28cd0a[_0x05e9('0x58')]['MessageSid']&&_0x28cd0a[_0x05e9('0x58')][_0x05e9('0x89')]===_0x558fd7[_0x05e9('0x8a')]&&_0x28cd0a[_0x05e9('0x58')]['MessageStatus']&&_0x28cd0a[_0x05e9('0x58')][_0x05e9('0x8b')]===_0x05e9('0x5e')){return _0x558fd7[_0x05e9('0x34')]({'read':!![]});}else{logger[_0x05e9('0x25')](_0x05e9('0x8c'),_0x05e9('0x2b'),'twilio',util[_0x05e9('0x8d')](_0x28cd0a[_0x05e9('0x58')],{'showHidden':![],'depth':null}));}break;}return _0x558fd7;}})[_0x05e9('0x1e')](respondWithResult(_0x2d67b3,null))[_0x05e9('0x52')](handleError(_0x2d67b3,null));}; \ No newline at end of file +var _0x2c25=['show','params','keys','find','body','destroy','describe','../../config/logger','whatsapp-interactions','accept','whatsapp','read','readAt','format','YYYY-MM-DD\x20HH:mm:ss','UserId','user','agent','get','WhatsappInteraction','WhatsappInteractionId','isNil','[WHATSAPPMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','role','interaction','AcceptMessage','acceptMessage','ContactId','sequelize','Sequelize','QueryTypes','fullname','email','internal','manual','interface','SIP/%s','channel','motionChannel','EventManager','acceptmessage','[WHATSAPPMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','RejectMessage','rejectMessage','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','SELECT','contact','event','rejectmessage','WhatsappAccount','WhatsappAccountId','received\x20delivery\x20report\x20from','inspect','twilio','MessageSid','messageId','MessageStatus','WhatsappAccount,\x20%s,\x20%s,\x20%s','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','fs-extra','squel','crypto','jsforce','to-csv','querystring','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','api','../../config/environment','../../config/license/util','../../mysqldb','defaults','redis','localhost','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','stringify','error','message','result','catch','status','json','offset','limit','set','apply','reject','save','update','then','end','sendStatus','name','send','index','map','WhatsappMessage','rawAttributes','fieldName','type','key','filters','intersection','model','query','attributes','fields','length','order','sort','where','pick','filter','VIRTUAL','merge','options','count','include','findAll'];(function(_0x2e52a0,_0x2bd8f0){var _0x1ffb62=function(_0x19cdb1){while(--_0x19cdb1){_0x2e52a0['push'](_0x2e52a0['shift']());}};_0x1ffb62(++_0x2bd8f0);}(_0x2c25,0xc3));var _0x52c2=function(_0x34342a,_0x3e16f5){_0x34342a=_0x34342a-0x0;var _0x427cdf=_0x2c25[_0x34342a];return _0x427cdf;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0x52c2('0x0'));var jsonpatch=require(_0x52c2('0x1'));var rp=require(_0x52c2('0x2'));var moment=require(_0x52c2('0x3'));var BPromise=require(_0x52c2('0x4'));var Mustache=require(_0x52c2('0x5'));var util=require(_0x52c2('0x6'));var path=require(_0x52c2('0x7'));var sox=require('sox');var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x52c2('0x8'));var _=require('lodash');var squel=require(_0x52c2('0x9'));var crypto=require(_0x52c2('0xa'));var jsforce=require(_0x52c2('0xb'));var deskjs=require('desk.js');var toCsv=require(_0x52c2('0xc'));var querystring=require(_0x52c2('0xd'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0x52c2('0xe'));var qs=require(_0x52c2('0xf'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x52c2('0x10'));var logger=require('../../config/logger')(_0x52c2('0x11'));var utils=require('../../config/utils');var config=require(_0x52c2('0x12'));var licenseUtil=require(_0x52c2('0x13'));var db=require(_0x52c2('0x14'))['db'];config['redis']=_[_0x52c2('0x15')](config[_0x52c2('0x16')],{'host':_0x52c2('0x17'),'port':0x18eb});var socket=require(_0x52c2('0x18'))(new Redis(config['redis']));require('./whatsappMessage.socket')[_0x52c2('0x19')](socket);var jayson=require(_0x52c2('0x1a'));var client=jayson[_0x52c2('0x1b')][_0x52c2('0x1c')]({'port':0x232c});var client9002=jayson[_0x52c2('0x1b')][_0x52c2('0x1c')]({'port':0x232a});function respondWithRpcPromise(_0x1fb4f1,_0x2c6da3,_0x5d258b,_0x308323){return new BPromise(function(_0x4c04d5,_0x17454a){var _0x32fc18=_0x308323||client;return _0x32fc18[_0x52c2('0x1d')](_0x1fb4f1,_0x5d258b)['then'](function(_0x2bf98c){logger[_0x52c2('0x1e')](_0x52c2('0x1f'),_0x2c6da3,_0x52c2('0x20'));logger[_0x52c2('0x21')](_0x52c2('0x22'),_0x2c6da3,_0x52c2('0x20'),JSON[_0x52c2('0x23')](_0x2bf98c));if(_0x2bf98c[_0x52c2('0x24')]){if(_0x2bf98c[_0x52c2('0x24')]['code']===0x1f4){logger[_0x52c2('0x24')](_0x52c2('0x1f'),_0x2c6da3,_0x2bf98c[_0x52c2('0x24')][_0x52c2('0x25')]);return _0x17454a(_0x2bf98c['error'][_0x52c2('0x25')]);}logger[_0x52c2('0x24')]('WhatsappMessage,\x20%s,\x20%s',_0x2c6da3,_0x2bf98c[_0x52c2('0x24')][_0x52c2('0x25')]);return _0x4c04d5(_0x2bf98c[_0x52c2('0x24')]['message']);}else{logger[_0x52c2('0x1e')](_0x52c2('0x1f'),_0x2c6da3,_0x52c2('0x20'));_0x4c04d5(_0x2bf98c[_0x52c2('0x26')][_0x52c2('0x25')]);}})[_0x52c2('0x27')](function(_0x554c6f){logger[_0x52c2('0x24')]('WhatsappMessage,\x20%s,\x20%s',_0x2c6da3,_0x554c6f);_0x17454a(_0x554c6f);});});}function respondWithStatusCode(_0x2a5cdc,_0x103e71){_0x103e71=_0x103e71||0xcc;return function(_0x141f89){if(_0x141f89){return _0x2a5cdc['sendStatus'](_0x103e71);}return _0x2a5cdc[_0x52c2('0x28')](_0x103e71)['end']();};}function respondWithResult(_0x4b97ad,_0x555a53){_0x555a53=_0x555a53||0xc8;return function(_0x917d41){if(_0x917d41){return _0x4b97ad[_0x52c2('0x28')](_0x555a53)[_0x52c2('0x29')](_0x917d41);}};}function respondWithFilteredResult(_0x2502e7,_0x3f6955){return function(_0x1075c0){if(_0x1075c0){var _0x17f1b0=typeof _0x3f6955[_0x52c2('0x2a')]==='undefined'&&typeof _0x3f6955[_0x52c2('0x2b')]==='undefined';var _0x3d3071=_0x1075c0['count'];var _0x476542=_0x17f1b0?0x0:_0x3f6955[_0x52c2('0x2a')];var _0x434959=_0x17f1b0?_0x1075c0['count']:_0x3f6955[_0x52c2('0x2a')]+_0x3f6955['limit'];var _0x34e8a4;if(_0x434959>=_0x3d3071){_0x434959=_0x3d3071;_0x34e8a4=0xc8;}else{_0x34e8a4=0xce;}_0x2502e7['status'](_0x34e8a4);return _0x2502e7[_0x52c2('0x2c')]('Content-Range',_0x476542+'-'+_0x434959+'/'+_0x3d3071)[_0x52c2('0x29')](_0x1075c0);}return null;};}function patchUpdates(_0x411e5e){return function(_0x1f5a09){try{jsonpatch[_0x52c2('0x2d')](_0x1f5a09,_0x411e5e,!![]);}catch(_0x10d7c1){return BPromise[_0x52c2('0x2e')](_0x10d7c1);}return _0x1f5a09[_0x52c2('0x2f')]();};}function saveUpdates(_0x146857,_0x1a3a76){return function(_0x474648){if(_0x474648){return _0x474648[_0x52c2('0x30')](_0x146857)['then'](function(_0x186b4e){return _0x186b4e;});}return null;};}function removeEntity(_0xd16423,_0x491a55){return function(_0x569ac9){if(_0x569ac9){return _0x569ac9['destroy']()[_0x52c2('0x31')](function(){_0xd16423[_0x52c2('0x28')](0xcc)[_0x52c2('0x32')]();});}};}function handleEntityNotFound(_0x10bd40,_0x2fc861){return function(_0x37fc18){if(!_0x37fc18){_0x10bd40[_0x52c2('0x33')](0x194);}return _0x37fc18;};}function handleError(_0x2a268b,_0x452b1f){_0x452b1f=_0x452b1f||0x1f4;return function(_0x56e50a){logger[_0x52c2('0x24')](_0x56e50a['stack']);if(_0x56e50a[_0x52c2('0x34')]){delete _0x56e50a[_0x52c2('0x34')];}_0x2a268b[_0x52c2('0x28')](_0x452b1f)[_0x52c2('0x35')](_0x56e50a);};}exports[_0x52c2('0x36')]=function(_0x4c759f,_0x42b472){var _0x4eddac={},_0x3ea1ce={},_0x58a45c={'count':0x0,'rows':[]};var _0x4fb6ed=_[_0x52c2('0x37')](db[_0x52c2('0x38')][_0x52c2('0x39')],function(_0x26256c){return{'name':_0x26256c[_0x52c2('0x3a')],'type':_0x26256c[_0x52c2('0x3b')][_0x52c2('0x3c')]};});_0x3ea1ce['model']=_[_0x52c2('0x37')](_0x4fb6ed,_0x52c2('0x34'));_0x3ea1ce['query']=_['keys'](_0x4c759f['query']);_0x3ea1ce[_0x52c2('0x3d')]=_[_0x52c2('0x3e')](_0x3ea1ce[_0x52c2('0x3f')],_0x3ea1ce[_0x52c2('0x40')]);_0x4eddac[_0x52c2('0x41')]=_[_0x52c2('0x3e')](_0x3ea1ce[_0x52c2('0x3f')],qs[_0x52c2('0x42')](_0x4c759f[_0x52c2('0x40')][_0x52c2('0x42')]));_0x4eddac[_0x52c2('0x41')]=_0x4eddac[_0x52c2('0x41')][_0x52c2('0x43')]?_0x4eddac[_0x52c2('0x41')]:_0x3ea1ce[_0x52c2('0x3f')];if(!_0x4c759f[_0x52c2('0x40')]['hasOwnProperty']('nolimit')){_0x4eddac[_0x52c2('0x2b')]=qs[_0x52c2('0x2b')](_0x4c759f[_0x52c2('0x40')][_0x52c2('0x2b')]);_0x4eddac['offset']=qs[_0x52c2('0x2a')](_0x4c759f['query'][_0x52c2('0x2a')]);}_0x4eddac[_0x52c2('0x44')]=qs[_0x52c2('0x45')](_0x4c759f['query'][_0x52c2('0x45')]);_0x4eddac[_0x52c2('0x46')]=qs[_0x52c2('0x3d')](_[_0x52c2('0x47')](_0x4c759f[_0x52c2('0x40')],_0x3ea1ce[_0x52c2('0x3d')]),_0x4fb6ed);if(_0x4c759f[_0x52c2('0x40')][_0x52c2('0x48')]){_0x4eddac[_0x52c2('0x46')]=_['merge'](_0x4eddac['where'],{'$or':_['map'](_0x4fb6ed,function(_0x640976){if(_0x640976[_0x52c2('0x3b')]!==_0x52c2('0x49')){var _0x50f993={};_0x50f993[_0x640976['name']]={'$like':'%'+_0x4c759f[_0x52c2('0x40')]['filter']+'%'};return _0x50f993;}})});}_0x4eddac=_[_0x52c2('0x4a')]({},_0x4eddac,_0x4c759f[_0x52c2('0x4b')]);var _0xa25e6c={'where':_0x4eddac[_0x52c2('0x46')]};return db[_0x52c2('0x38')][_0x52c2('0x4c')](_0xa25e6c)[_0x52c2('0x31')](function(_0x1a160c){_0x58a45c[_0x52c2('0x4c')]=_0x1a160c;if(_0x4c759f['query']['includeAll']){_0x4eddac[_0x52c2('0x4d')]=[{'all':!![]}];}return db[_0x52c2('0x38')][_0x52c2('0x4e')](_0x4eddac);})[_0x52c2('0x31')](function(_0x307922){_0x58a45c['rows']=_0x307922;return _0x58a45c;})['then'](respondWithFilteredResult(_0x42b472,_0x4eddac))[_0x52c2('0x27')](handleError(_0x42b472,null));};exports[_0x52c2('0x4f')]=function(_0x33dbea,_0x2f7a7e){var _0x2bc4ca={'raw':!![],'where':{'id':_0x33dbea[_0x52c2('0x50')]['id']}},_0x3e5bb3={};_0x3e5bb3[_0x52c2('0x3f')]=_[_0x52c2('0x51')](db[_0x52c2('0x38')][_0x52c2('0x39')]);_0x3e5bb3['query']=_['keys'](_0x33dbea[_0x52c2('0x40')]);_0x3e5bb3[_0x52c2('0x3d')]=_[_0x52c2('0x3e')](_0x3e5bb3[_0x52c2('0x3f')],_0x3e5bb3[_0x52c2('0x40')]);_0x2bc4ca[_0x52c2('0x41')]=_[_0x52c2('0x3e')](_0x3e5bb3[_0x52c2('0x3f')],qs[_0x52c2('0x42')](_0x33dbea[_0x52c2('0x40')][_0x52c2('0x42')]));_0x2bc4ca[_0x52c2('0x41')]=_0x2bc4ca[_0x52c2('0x41')]['length']?_0x2bc4ca[_0x52c2('0x41')]:_0x3e5bb3[_0x52c2('0x3f')];if(_0x33dbea[_0x52c2('0x40')]['includeAll']){_0x2bc4ca[_0x52c2('0x4d')]=[{'all':!![]}];}_0x2bc4ca=_[_0x52c2('0x4a')]({},_0x2bc4ca,_0x33dbea['options']);return db['WhatsappMessage'][_0x52c2('0x52')](_0x2bc4ca)[_0x52c2('0x31')](handleEntityNotFound(_0x2f7a7e,null))['then'](respondWithResult(_0x2f7a7e,null))['catch'](handleError(_0x2f7a7e,null));};exports['create']=function(_0x4b4073,_0x1bd60e){return db[_0x52c2('0x38')]['create'](_0x4b4073[_0x52c2('0x53')],{})['then'](respondWithResult(_0x1bd60e,0xc9))['catch'](handleError(_0x1bd60e,null));};exports[_0x52c2('0x30')]=function(_0x191e15,_0x259228){if(_0x191e15[_0x52c2('0x53')]['id']){delete _0x191e15[_0x52c2('0x53')]['id'];}return db[_0x52c2('0x38')][_0x52c2('0x52')]({'where':{'id':_0x191e15[_0x52c2('0x50')]['id']}})['then'](handleEntityNotFound(_0x259228,null))[_0x52c2('0x31')](saveUpdates(_0x191e15[_0x52c2('0x53')],null))['then'](respondWithResult(_0x259228,null))[_0x52c2('0x27')](handleError(_0x259228,null));};exports[_0x52c2('0x54')]=function(_0x140917,_0x273c42){return db[_0x52c2('0x38')][_0x52c2('0x52')]({'where':{'id':_0x140917[_0x52c2('0x50')]['id']}})['then'](handleEntityNotFound(_0x273c42,null))['then'](removeEntity(_0x273c42,null))[_0x52c2('0x27')](handleError(_0x273c42,null));};exports[_0x52c2('0x55')]=function(_0x37484a,_0x99b536){return db[_0x52c2('0x38')][_0x52c2('0x55')]()[_0x52c2('0x31')](respondWithResult(_0x99b536,null))['catch'](handleError(_0x99b536,null));};var interaction_log=require(_0x52c2('0x56'))(_0x52c2('0x57'));exports[_0x52c2('0x58')]=function(_0x1de507,_0x27f249,_0xd91be){var _0x13ade1={'agent':{},'channel':_0x52c2('0x59')};if(_0x1de507[_0x52c2('0x53')]['id']){delete _0x1de507[_0x52c2('0x53')]['id'];}_0x1de507['body'][_0x52c2('0x5a')]=!![];_0x1de507[_0x52c2('0x53')][_0x52c2('0x5b')]=moment()[_0x52c2('0x5c')](_0x52c2('0x5d'));_0x1de507[_0x52c2('0x53')][_0x52c2('0x5e')]=_0x1de507[_0x52c2('0x53')][_0x52c2('0x5e')]||_0x1de507[_0x52c2('0x5f')]['id'];_0x13ade1[_0x52c2('0x60')]['id']=_0x1de507[_0x52c2('0x53')][_0x52c2('0x5e')];return db[_0x52c2('0x38')][_0x52c2('0x52')]({'where':{'id':_0x1de507[_0x52c2('0x50')]['id'],'UserId':null}})[_0x52c2('0x31')](handleEntityNotFound(_0x27f249,null))[_0x52c2('0x31')](saveUpdates(_0x1de507[_0x52c2('0x53')],null))['then'](function(_0x39c61d){if(_0x39c61d){_0x13ade1[_0x52c2('0x25')]=_0x39c61d[_0x52c2('0x61')]({'plain':!![]});return db[_0x52c2('0x62')][_0x52c2('0x52')]({'where':{'id':_0x39c61d[_0x52c2('0x63')]}});}return null;})[_0x52c2('0x31')](handleEntityNotFound(_0x27f249,null))['then'](function(_0x52ce01){if(_0x52ce01){return _0x52ce01[_0x52c2('0x30')]({'UserId':_0x1de507['body'][_0x52c2('0x5e')],'read1stAt':_[_0x52c2('0x64')](_0x52ce01['read1stAt'])?moment()[_0x52c2('0x5c')]('YYYY-MM-DD\x20HH:mm:ss'):undefined});}return null;})['then'](function(_0x421ac5){if(_0x421ac5){_0x13ade1['interaction']=_0x421ac5[_0x52c2('0x61')]({'plain':!![]});interaction_log[_0x52c2('0x1e')](_0x52c2('0x65'),_0x1de507[_0x52c2('0x5f')]['id'],_0x1de507[_0x52c2('0x5f')][_0x52c2('0x34')],_0x1de507[_0x52c2('0x5f')][_0x52c2('0x66')],_0x13ade1[_0x52c2('0x67')]['id'],_0x1de507[_0x52c2('0x53')]?JSON[_0x52c2('0x23')](_0x1de507[_0x52c2('0x53')]):'null');return respondWithRpcPromise(_0x52c2('0x68'),_0x52c2('0x69'),_0x13ade1);}return null;})[_0x52c2('0x31')](function(_0x17549e){var _0x5139ab='SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20'+_0x17549e['message'][_0x52c2('0x6a')];return db[_0x52c2('0x6b')][_0x52c2('0x40')](_0x5139ab,{'type':db[_0x52c2('0x6c')][_0x52c2('0x6d')]['SELECT'],'raw':!![]})[_0x52c2('0x31')](function(_0x543b5c){return _0x543b5c;});})[_0x52c2('0x31')](function(_0x5aae2b){if(_0x5aae2b){_0x13ade1[_0x52c2('0x25')]['contact']=_0x5aae2b[0x0];if(!_0x1de507['body'][_0x52c2('0x5e')])return;return db['User'][_0x52c2('0x52')]({'where':{'id':_0x1de507[_0x52c2('0x53')][_0x52c2('0x5e')],'role':_0x52c2('0x60')},'attributes':['id','name',_0x52c2('0x6e'),_0x52c2('0x6f'),_0x52c2('0x70')],'raw':!![]});}return null;})[_0x52c2('0x31')](function(_0x598226){if(!_0x598226)return null;_0x13ade1[_0x52c2('0x25')]['agent']=_0x598226;return _0x13ade1;})[_0x52c2('0x31')](function(_0x15d496){if(_0x15d496){if(_0x1de507[_0x52c2('0x53')][_0x52c2('0x71')]){_0x13ade1[_0x52c2('0x25')][_0x52c2('0x72')]=util[_0x52c2('0x5c')](_0x52c2('0x73'),_0x1de507[_0x52c2('0x5f')]['name']);_0x13ade1[_0x52c2('0x25')][_0x52c2('0x74')]=_0x13ade1[_0x52c2('0x74')];_0x13ade1[_0x52c2('0x25')][_0x52c2('0x75')]=_0x13ade1[_0x52c2('0x74')];_0x13ade1[_0x52c2('0x25')]['event']='accept';return respondWithRpcPromise('EventManager',_0x52c2('0x76'),{'event':_0x52c2('0x77'),'message':_0x13ade1['message']},client9002)[_0x52c2('0x31')](function(){return _0x13ade1;});}return _0x13ade1;}return null;})['then'](respondWithResult(_0x27f249,null))[_0x52c2('0x27')](handleError(_0x27f249,null));};var interaction_log=require(_0x52c2('0x56'))(_0x52c2('0x57'));exports[_0x52c2('0x2e')]=function(_0x44baa2,_0x2e20f8,_0x3b9ff5){var _0x262c7a={'agent':{},'channel':_0x52c2('0x59')};if(_0x44baa2[_0x52c2('0x53')]['id']){delete _0x44baa2[_0x52c2('0x53')]['id'];}_0x44baa2[_0x52c2('0x53')]['UserId']=_0x44baa2[_0x52c2('0x53')][_0x52c2('0x5e')]||_0x44baa2[_0x52c2('0x5f')]['id'];_0x262c7a[_0x52c2('0x60')]['id']=_0x44baa2[_0x52c2('0x53')][_0x52c2('0x5e')];return db['WhatsappMessage']['find']({'where':{'id':_0x44baa2[_0x52c2('0x50')]['id'],'UserId':null}})[_0x52c2('0x31')](handleEntityNotFound(_0x2e20f8,null))[_0x52c2('0x31')](function(_0x19f71a){if(_0x19f71a){_0x262c7a[_0x52c2('0x25')]=_0x19f71a[_0x52c2('0x61')]({'plain':!![]});return db[_0x52c2('0x62')][_0x52c2('0x52')]({'where':{'id':_0x19f71a[_0x52c2('0x63')]}});}return null;})[_0x52c2('0x31')](handleEntityNotFound(_0x2e20f8,null))[_0x52c2('0x31')](function(_0x4af3ab){if(_0x4af3ab){_0x262c7a[_0x52c2('0x67')]=_0x4af3ab[_0x52c2('0x61')]({'plain':!![]});interaction_log[_0x52c2('0x1e')](_0x52c2('0x78'),_0x44baa2[_0x52c2('0x5f')]['id'],_0x44baa2['user'][_0x52c2('0x34')],_0x44baa2['user'][_0x52c2('0x66')],_0x262c7a[_0x52c2('0x67')]['id'],_0x44baa2[_0x52c2('0x53')]?JSON[_0x52c2('0x23')](_0x44baa2[_0x52c2('0x53')]):'null');return respondWithRpcPromise(_0x52c2('0x79'),_0x52c2('0x7a'),_0x262c7a);}return null;})['then'](function(_0x3139ab){var _0x34dfec=_0x52c2('0x7b')+_0x3139ab['message'][_0x52c2('0x6a')];return db[_0x52c2('0x6b')]['query'](_0x34dfec,{'type':db[_0x52c2('0x6c')][_0x52c2('0x6d')][_0x52c2('0x7c')],'raw':!![]})[_0x52c2('0x31')](function(_0x452eec){return _0x452eec;});})[_0x52c2('0x31')](function(_0x5e2f1b){if(_0x5e2f1b){_0x262c7a[_0x52c2('0x25')][_0x52c2('0x7d')]=_0x5e2f1b[0x0];if(!_0x44baa2[_0x52c2('0x53')][_0x52c2('0x5e')])return;return db['User'][_0x52c2('0x52')]({'where':{'id':_0x44baa2[_0x52c2('0x53')]['UserId'],'role':_0x52c2('0x60')},'attributes':['id',_0x52c2('0x34'),_0x52c2('0x6e'),'email','internal'],'raw':!![]});}return null;})[_0x52c2('0x31')](function(_0x3231bd){if(!_0x3231bd)return null;_0x262c7a[_0x52c2('0x25')][_0x52c2('0x60')]=_0x3231bd;return _0x262c7a;})['then'](function(_0x3731fc){if(_0x3731fc){_0x3731fc[_0x52c2('0x25')][_0x52c2('0x72')]=util[_0x52c2('0x5c')](_0x52c2('0x73'),_0x44baa2[_0x52c2('0x5f')]['name']);_0x3731fc[_0x52c2('0x25')][_0x52c2('0x74')]=_0x262c7a[_0x52c2('0x74')];_0x3731fc[_0x52c2('0x25')][_0x52c2('0x75')]=_0x262c7a[_0x52c2('0x74')];_0x3731fc[_0x52c2('0x25')][_0x52c2('0x7e')]=_0x52c2('0x2e');respondWithRpcPromise(_0x52c2('0x76'),'EventManager',{'event':_0x52c2('0x7f'),'message':_0x3731fc[_0x52c2('0x25')]},client9002);return _0x262c7a;}return null;})[_0x52c2('0x31')](respondWithResult(_0x2e20f8,null))[_0x52c2('0x27')](handleError(_0x2e20f8,null));};exports[_0x52c2('0x28')]=function(_0x3a7dd0,_0x2aa0f4,_0x3dcc3c){if(_0x3a7dd0[_0x52c2('0x53')]['id']){delete _0x3a7dd0[_0x52c2('0x53')]['id'];}var _0x10f7cf;return db[_0x52c2('0x38')][_0x52c2('0x52')]({'where':{'id':_0x3a7dd0[_0x52c2('0x50')]['id']}})[_0x52c2('0x31')](handleEntityNotFound(_0x2aa0f4,null))[_0x52c2('0x31')](function(_0x4c9828){if(_0x4c9828){_0x10f7cf=_0x4c9828;return db[_0x52c2('0x80')][_0x52c2('0x52')]({'where':{'id':_0x4c9828[_0x52c2('0x81')]}});}})[_0x52c2('0x31')](handleEntityNotFound(_0x2aa0f4,null))['then'](function(_0x453714){if(_0x453714){logger['debug']('WhatsppMessage,\x20%s,\x20%s,\x20%s','status',_0x52c2('0x82'),_0x453714[_0x52c2('0x3b')],util[_0x52c2('0x83')](_0x3a7dd0[_0x52c2('0x53')],{'showHidden':![],'depth':null}));switch(_0x453714[_0x52c2('0x3b')]){case _0x52c2('0x84'):if(_0x3a7dd0[_0x52c2('0x53')][_0x52c2('0x85')]&&_0x3a7dd0[_0x52c2('0x53')]['MessageSid']===_0x10f7cf[_0x52c2('0x86')]&&_0x3a7dd0['body'][_0x52c2('0x87')]&&_0x3a7dd0[_0x52c2('0x53')][_0x52c2('0x87')]===_0x52c2('0x5a')){return _0x10f7cf[_0x52c2('0x30')]({'read':!![]});}else{logger['error'](_0x52c2('0x88'),_0x52c2('0x28'),_0x52c2('0x84'),util[_0x52c2('0x83')](_0x3a7dd0[_0x52c2('0x53')],{'showHidden':![],'depth':null}));}break;}return _0x10f7cf;}})[_0x52c2('0x31')](respondWithResult(_0x2aa0f4,null))['catch'](handleError(_0x2aa0f4,null));}; \ No newline at end of file diff --git a/server/api/whatsappMessage/whatsappMessage.events.js b/server/api/whatsappMessage/whatsappMessage.events.js index afe5a08..2b4d6a7 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 _0x3264=['exports','../../mysqldb','WhatsappMessage','setMaxListeners','save','emit','hasOwnProperty'];(function(_0x18bee3,_0x534c71){var _0x331e74=function(_0x346f7b){while(--_0x346f7b){_0x18bee3['push'](_0x18bee3['shift']());}};_0x331e74(++_0x534c71);}(_0x3264,0x7f));var _0x4326=function(_0x5608a3,_0x5b33c5){_0x5608a3=_0x5608a3-0x0;var _0x1ed50a=_0x3264[_0x5608a3];return _0x1ed50a;};'use strict';var EventEmitter=require('events');var WhatsappMessage=require(_0x4326('0x0'))['db'][_0x4326('0x1')];var WhatsappMessageEvents=new EventEmitter();WhatsappMessageEvents[_0x4326('0x2')](0x0);var events={'afterCreate':_0x4326('0x3'),'afterUpdate':'update','afterDestroy':'remove'};function emitEvent(_0xdd223f){return function(_0x510181,_0x5555ac,_0x27ff99){WhatsappMessageEvents[_0x4326('0x4')](_0xdd223f+':'+_0x510181['id'],_0x510181);WhatsappMessageEvents[_0x4326('0x4')](_0xdd223f,_0x510181);_0x27ff99(null);};}for(var e in events){if(events[_0x4326('0x5')](e)){var event=events[e];WhatsappMessage['hook'](e,emitEvent(event));}}module[_0x4326('0x6')]=WhatsappMessageEvents; \ No newline at end of file +var _0x0427=['setMaxListeners','update','remove','emit','hasOwnProperty','hook','exports','WhatsappMessage'];(function(_0x29052a,_0x1dcb73){var _0x31228c=function(_0x53073c){while(--_0x53073c){_0x29052a['push'](_0x29052a['shift']());}};_0x31228c(++_0x1dcb73);}(_0x0427,0x137));var _0x7042=function(_0x55adec,_0x27468c){_0x55adec=_0x55adec-0x0;var _0x2e379b=_0x0427[_0x55adec];return _0x2e379b;};'use strict';var EventEmitter=require('events');var WhatsappMessage=require('../../mysqldb')['db'][_0x7042('0x0')];var WhatsappMessageEvents=new EventEmitter();WhatsappMessageEvents[_0x7042('0x1')](0x0);var events={'afterCreate':'save','afterUpdate':_0x7042('0x2'),'afterDestroy':_0x7042('0x3')};function emitEvent(_0xae8bc2){return function(_0x1db1f3,_0xa72963,_0x343a69){WhatsappMessageEvents[_0x7042('0x4')](_0xae8bc2+':'+_0x1db1f3['id'],_0x1db1f3);WhatsappMessageEvents['emit'](_0xae8bc2,_0x1db1f3);_0x343a69(null);};}for(var e in events){if(events[_0x7042('0x5')](e)){var event=events[e];WhatsappMessage[_0x7042('0x6')](e,emitEvent(event));}}module[_0x7042('0x7')]=WhatsappMessageEvents; \ No newline at end of file diff --git a/server/api/whatsappMessage/whatsappMessage.model.js b/server/api/whatsappMessage/whatsappMessage.model.js index ec3e8f8..4869a3c 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 _0xef3a=['body','models','get','direction','toLowerCase','secret','isNil','UserId','WhatsappInteraction','WhatsappInteractionId','then','createdAt','catch','error','out','WhatsappAccount','find','WhatsappAccountId','twilio','accountSid','authToken','phone','messages','create','whatsapp:','remote','/api/whatsapp/messages/','/status?token=','token','sid','update','WhatsappMessage,\x20%s,\x20%s,\x20%s','afterCreate','Missing\x20parameters:\x20phone,\x20accountSid\x20or\x20authToken','sinch','/whatsapp/v1/','/messages/','text','Bearer\x20','application/json','message_id','statuses','err','WhatsappMessage,\x20%s','finally','utf8mb4','lodash','../../config/logger','moment','request-promise','node-fetch','path','rimraf','../../config/environment','./whatsappMessage.attributes','exports','define','WhatsappMessage','whatsapp_messages','messageId'];(function(_0x52874e,_0x2196de){var _0x274a88=function(_0x206b1f){while(--_0x206b1f){_0x52874e['push'](_0x52874e['shift']());}};_0x274a88(++_0x2196de);}(_0xef3a,0xa6));var _0xaef3=function(_0x1cb0b4,_0x1fd48d){_0x1cb0b4=_0x1cb0b4-0x0;var _0x525b60=_0xef3a[_0x1cb0b4];return _0x525b60;};'use strict';var _=require(_0xaef3('0x0'));var util=require('util');var logger=require(_0xaef3('0x1'))('api');var moment=require(_0xaef3('0x2'));var BPromise=require('bluebird');var rp=require(_0xaef3('0x3'));var fetch=require(_0xaef3('0x4'));var fs=require('fs');var path=require(_0xaef3('0x5'));var rimraf=require(_0xaef3('0x6'));var config=require(_0xaef3('0x7'));var attributes=require(_0xaef3('0x8'));module[_0xaef3('0x9')]=function(_0x29f36b,_0x1fef7c){return _0x29f36b[_0xaef3('0xa')](_0xaef3('0xb'),attributes,{'tableName':_0xaef3('0xc'),'paranoid':![],'indexes':[{'name':_0xaef3('0xd'),'fields':[_0xaef3('0xd')]},{'name':'fti_whatsapp_messages','fields':[_0xaef3('0xe')],'type':'FULLTEXT'}],'timestamps':!![],'hooks':{'afterCreate':function(_0x4d4764,_0x4aa193,_0x12ca45){var _0x30b6dd=_0x29f36b[_0xaef3('0xf')];var _0x3e782e=_0x4d4764[_0xaef3('0x10')]({'plain':!![]});if(_0x3e782e[_0xaef3('0x11')][_0xaef3('0x12')]()==='in'||_0x3e782e[_0xaef3('0x11')]['toLowerCase']()==='out'&&!_0x3e782e[_0xaef3('0x13')]&&!_[_0xaef3('0x14')](_0x3e782e[_0xaef3('0x15')])){_0x30b6dd[_0xaef3('0x16')]['findOne']({'where':{'id':_0x3e782e[_0xaef3('0x17')]}})[_0xaef3('0x18')](function(_0x2e32ad){if(_0x2e32ad){_0x2e32ad['update']({'lastMsgAt':_0x3e782e[_0xaef3('0x19')],'lastMsgDirection':_0x3e782e['direction'][_0xaef3('0x12')]()});}})[_0xaef3('0x1a')](function(_0x371fc7){console[_0xaef3('0x1b')](_0x371fc7);});}if(_0x3e782e[_0xaef3('0x11')]===_0xaef3('0x1c')&&!_0x3e782e[_0xaef3('0x13')]){var _0x2d59aa;_0x30b6dd[_0xaef3('0x1d')][_0xaef3('0x1e')]({'where':{'id':_0x3e782e[_0xaef3('0x1f')]},'raw':!![]})[_0xaef3('0x18')](function(_0x2bfa12){_0x2d59aa=_0x2bfa12;if(_0x2d59aa&&_0x2d59aa['type']){switch(_0x2d59aa['type']){case _0xaef3('0x20'):var _0x2eae00=require(_0xaef3('0x20'));if(_0x2d59aa[_0xaef3('0x21')]&&_0x2d59aa[_0xaef3('0x22')]&&_0x2d59aa[_0xaef3('0x23')]){var _0x193e9d=new _0x2eae00(_0x2d59aa[_0xaef3('0x21')],_0x2d59aa[_0xaef3('0x22')]);_0x193e9d[_0xaef3('0x24')][_0xaef3('0x25')]({'body':_0x3e782e[_0xaef3('0xe')],'to':_0xaef3('0x26')+_0x3e782e[_0xaef3('0x23')],'from':_0xaef3('0x26')+_0x2d59aa['phone'],'statusCallback':_0x2d59aa[_0xaef3('0x27')]+_0xaef3('0x28')+_0x3e782e['id']+_0xaef3('0x29')+_0x2d59aa[_0xaef3('0x2a')]})['then'](function(_0xec001c){if(_0xec001c[_0xaef3('0x2b')]){return _0x4d4764[_0xaef3('0x2c')]({'messageId':_0xec001c[_0xaef3('0x2b')]});}})['catch'](function(_0x39c84a){logger[_0xaef3('0x1b')]('WhatsappMessage,\x20%s,\x20%s,\x20%s','afterCreate',_0xaef3('0x20'),util['inspect'](_0x39c84a,{'showHidden':![],'depth':null}));});}else{logger['error'](_0xaef3('0x2d'),_0xaef3('0x2e'),'twilio',_0xaef3('0x2f'));}break;case _0xaef3('0x30'):var _0x529041=_0x2d59aa[_0xaef3('0x21')];var _0x165e0c=_0x2d59aa[_0xaef3('0x22')];var _0x16dcf5=_0x2d59aa['baseUrl']+_0xaef3('0x31')+_0x529041+_0xaef3('0x32');var _0x490c93={'to':[_0x3e782e[_0xaef3('0x23')]],'message':{'type':_0xaef3('0x33'),'text':_0x3e782e[_0xaef3('0xe')]}};var _0x29ef06={'method':'POST','uri':_0x16dcf5,'headers':{'Authorization':_0xaef3('0x34')+_0x165e0c,'Content-Type':_0xaef3('0x35')},'body':_0x490c93,'json':!![]};rp(_0x29ef06)[_0xaef3('0x18')](function(_0x308eae){if(_0x308eae['statuses'][0x0][_0xaef3('0x36')]){return _0x4d4764['update']({'messageId':_0x308eae[_0xaef3('0x37')][0x0]['message_id']});}})['catch'](function(_0xa538bc){logger[_0xaef3('0x38')](_0xaef3('0x39'),_0xa538bc);});break;}}})[_0xaef3('0x3a')](function(){_0x12ca45();});}else{_0x12ca45();}}},'charset':_0xaef3('0x3b'),'collate':'utf8mb4_unicode_ci'});}; \ No newline at end of file +var _0x69e8=['WhatsappInteraction','findOne','WhatsappInteractionId','then','update','createdAt','catch','error','WhatsappAccount','find','type','accountSid','authToken','phone','create','whatsapp:','remote','/status?token=','token','sid','WhatsappMessage,\x20%s,\x20%s,\x20%s','afterCreate','twilio','Missing\x20parameters:\x20phone,\x20accountSid\x20or\x20authToken','sinch','baseUrl','/whatsapp/v1/','/messages/','POST','Bearer\x20','application/json','statuses','message_id','err','finally','utf8mb4_unicode_ci','lodash','../../config/logger','api','bluebird','path','rimraf','exports','whatsapp_messages','messageId','fti_whatsapp_messages','body','FULLTEXT','models','get','direction','toLowerCase','out','secret','UserId'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0x69e8,0x137));var _0x869e=function(_0x2cd118,_0x4b4587){_0x2cd118=_0x2cd118-0x0;var _0x13ad75=_0x69e8[_0x2cd118];return _0x13ad75;};'use strict';var _=require(_0x869e('0x0'));var util=require('util');var logger=require(_0x869e('0x1'))(_0x869e('0x2'));var moment=require('moment');var BPromise=require(_0x869e('0x3'));var rp=require('request-promise');var fetch=require('node-fetch');var fs=require('fs');var path=require(_0x869e('0x4'));var rimraf=require(_0x869e('0x5'));var config=require('../../config/environment');var attributes=require('./whatsappMessage.attributes');module[_0x869e('0x6')]=function(_0x83ac68,_0x276678){return _0x83ac68['define']('WhatsappMessage',attributes,{'tableName':_0x869e('0x7'),'paranoid':![],'indexes':[{'name':'messageId','fields':[_0x869e('0x8')]},{'name':_0x869e('0x9'),'fields':[_0x869e('0xa')],'type':_0x869e('0xb')}],'timestamps':!![],'hooks':{'afterCreate':function(_0x1e86ae,_0x404415,_0x20868f){var _0x105d81=_0x83ac68[_0x869e('0xc')];var _0x25394e=_0x1e86ae[_0x869e('0xd')]({'plain':!![]});if(_0x25394e[_0x869e('0xe')]['toLowerCase']()==='in'||_0x25394e[_0x869e('0xe')][_0x869e('0xf')]()===_0x869e('0x10')&&!_0x25394e[_0x869e('0x11')]&&!_['isNil'](_0x25394e[_0x869e('0x12')])){_0x105d81[_0x869e('0x13')][_0x869e('0x14')]({'where':{'id':_0x25394e[_0x869e('0x15')]}})[_0x869e('0x16')](function(_0x3efca0){if(_0x3efca0){_0x3efca0[_0x869e('0x17')]({'lastMsgAt':_0x25394e[_0x869e('0x18')],'lastMsgDirection':_0x25394e[_0x869e('0xe')][_0x869e('0xf')]()});}})[_0x869e('0x19')](function(_0x659225){console[_0x869e('0x1a')](_0x659225);});}if(_0x25394e[_0x869e('0xe')]===_0x869e('0x10')&&!_0x25394e[_0x869e('0x11')]){var _0x2ffb76;_0x105d81[_0x869e('0x1b')][_0x869e('0x1c')]({'where':{'id':_0x25394e['WhatsappAccountId']},'raw':!![]})[_0x869e('0x16')](function(_0x2c4802){_0x2ffb76=_0x2c4802;if(_0x2ffb76&&_0x2ffb76[_0x869e('0x1d')]){switch(_0x2ffb76[_0x869e('0x1d')]){case'twilio':var _0x5e2a25=require('twilio');if(_0x2ffb76[_0x869e('0x1e')]&&_0x2ffb76[_0x869e('0x1f')]&&_0x2ffb76[_0x869e('0x20')]){var _0x1bde48=new _0x5e2a25(_0x2ffb76[_0x869e('0x1e')],_0x2ffb76[_0x869e('0x1f')]);_0x1bde48['messages'][_0x869e('0x21')]({'body':_0x25394e[_0x869e('0xa')],'to':'whatsapp:'+_0x25394e[_0x869e('0x20')],'from':_0x869e('0x22')+_0x2ffb76[_0x869e('0x20')],'statusCallback':_0x2ffb76[_0x869e('0x23')]+'/api/whatsapp/messages/'+_0x25394e['id']+_0x869e('0x24')+_0x2ffb76[_0x869e('0x25')]})[_0x869e('0x16')](function(_0x432b74){if(_0x432b74[_0x869e('0x26')]){return _0x1e86ae[_0x869e('0x17')]({'messageId':_0x432b74[_0x869e('0x26')]});}})[_0x869e('0x19')](function(_0x176a90){logger[_0x869e('0x1a')](_0x869e('0x27'),_0x869e('0x28'),_0x869e('0x29'),util['inspect'](_0x176a90,{'showHidden':![],'depth':null}));});}else{logger['error'](_0x869e('0x27'),_0x869e('0x28'),_0x869e('0x29'),_0x869e('0x2a'));}break;case _0x869e('0x2b'):var _0x520917=_0x2ffb76[_0x869e('0x1e')];var _0x5a09f0=_0x2ffb76[_0x869e('0x1f')];var _0x3dd0ce=_0x2ffb76[_0x869e('0x2c')]+_0x869e('0x2d')+_0x520917+_0x869e('0x2e');var _0x261959={'to':[_0x25394e[_0x869e('0x20')]],'message':{'type':'text','text':_0x25394e['body']}};var _0x5382ca={'method':_0x869e('0x2f'),'uri':_0x3dd0ce,'headers':{'Authorization':_0x869e('0x30')+_0x5a09f0,'Content-Type':_0x869e('0x31')},'body':_0x261959,'json':!![]};rp(_0x5382ca)[_0x869e('0x16')](function(_0x2767fa){if(_0x2767fa[_0x869e('0x32')][0x0][_0x869e('0x33')]){return _0x1e86ae[_0x869e('0x17')]({'messageId':_0x2767fa[_0x869e('0x32')][0x0]['message_id']});}})[_0x869e('0x19')](function(_0x492114){logger[_0x869e('0x34')]('WhatsappMessage,\x20%s',_0x492114);});break;}}})[_0x869e('0x35')](function(){_0x20868f();});}else{_0x20868f();}}},'charset':'utf8mb4','collate':_0x869e('0x36')});}; \ No newline at end of file diff --git a/server/api/whatsappMessage/whatsappMessage.rpc.js b/server/api/whatsappMessage/whatsappMessage.rpc.js index 09a9a77..3f90cc9 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 _0xd113=['request','then','WhatsappMessage,\x20%s,\x20%s','request\x20sent','WhatsappMessage,\x20%s,\x20%s,\x20%s','stringify','code','error','message','info','catch','WhatsappMessage','create','body','options','raw','CreateWhatsappMessage','debug','lodash','util','moment','randomstring','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis','defaults','localhost','socket.io-emitter','./whatsappMessage.socket','register'];(function(_0xad68ca,_0x45baf8){var _0x34e77d=function(_0x2e01a2){while(--_0x2e01a2){_0xad68ca['push'](_0xad68ca['shift']());}};_0x34e77d(++_0x45baf8);}(_0xd113,0x9e));var _0x3d11=function(_0x3f8208,_0x6d3077){_0x3f8208=_0x3f8208-0x0;var _0x12abc5=_0xd113[_0x3f8208];return _0x12abc5;};'use strict';var _=require(_0x3d11('0x0'));var util=require(_0x3d11('0x1'));var moment=require(_0x3d11('0x2'));var BPromise=require('bluebird');var rs=require(_0x3d11('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0x3d11('0x4'));var logger=require(_0x3d11('0x5'))(_0x3d11('0x6'));var config=require(_0x3d11('0x7'));var jayson=require(_0x3d11('0x8'));var client=jayson[_0x3d11('0x9')][_0x3d11('0xa')]({'port':0x232a});config[_0x3d11('0xb')]=_[_0x3d11('0xc')](config[_0x3d11('0xb')],{'host':_0x3d11('0xd'),'port':0x18eb});var socket=require(_0x3d11('0xe'))(new Redis(config[_0x3d11('0xb')]));require(_0x3d11('0xf'))[_0x3d11('0x10')](socket);function respondWithRpcPromise(_0x5bdeab,_0x305b63,_0x4cdfd6){return new BPromise(function(_0x1ac0c4,_0x47bcd3){return client[_0x3d11('0x11')](_0x5bdeab,_0x4cdfd6)[_0x3d11('0x12')](function(_0x2e8c51){logger['info'](_0x3d11('0x13'),_0x305b63,_0x3d11('0x14'));logger['debug'](_0x3d11('0x15'),_0x305b63,_0x3d11('0x14'),JSON[_0x3d11('0x16')](_0x2e8c51));if(_0x2e8c51['error']){if(_0x2e8c51['error'][_0x3d11('0x17')]===0x1f4){logger[_0x3d11('0x18')](_0x3d11('0x13'),_0x305b63,_0x2e8c51[_0x3d11('0x18')][_0x3d11('0x19')]);return _0x47bcd3(_0x2e8c51['error']['message']);}logger[_0x3d11('0x18')](_0x3d11('0x13'),_0x305b63,_0x2e8c51[_0x3d11('0x18')][_0x3d11('0x19')]);return _0x1ac0c4(_0x2e8c51[_0x3d11('0x18')][_0x3d11('0x19')]);}else{logger[_0x3d11('0x1a')](_0x3d11('0x13'),_0x305b63,_0x3d11('0x14'));_0x1ac0c4(_0x2e8c51['result'][_0x3d11('0x19')]);}})[_0x3d11('0x1b')](function(_0x4d28f1){logger[_0x3d11('0x18')](_0x3d11('0x13'),_0x305b63,_0x4d28f1);_0x47bcd3(_0x4d28f1);});});}exports['CreateWhatsappMessage']=function(_0x3548c1){var _0x482a06=this;return new Promise(function(_0x2c64b8,_0x33e5f3){return db[_0x3d11('0x1c')][_0x3d11('0x1d')](_0x3548c1[_0x3d11('0x1e')],{'raw':_0x3548c1[_0x3d11('0x1f')]?_0x3548c1[_0x3d11('0x1f')][_0x3d11('0x20')]===undefined?!![]:![]:!![]})[_0x3d11('0x12')](function(_0x52a584){logger[_0x3d11('0x1a')](_0x3d11('0x21'),_0x3548c1);logger[_0x3d11('0x22')](_0x3d11('0x21'),_0x3548c1,JSON['stringify'](_0x52a584));_0x2c64b8(_0x52a584);})[_0x3d11('0x1b')](function(_0x3e2adc){logger['error']('CreateWhatsappMessage',_0x3e2adc[_0x3d11('0x19')],_0x3548c1);_0x33e5f3(_0x482a06[_0x3d11('0x18')](0x1f4,_0x3e2adc['message']));});});}; \ No newline at end of file +var _0xdcb8=['register','then','info','WhatsappMessage,\x20%s,\x20%s','debug','WhatsappMessage,\x20%s,\x20%s,\x20%s','request\x20sent','error','code','message','result','catch','CreateWhatsappMessage','WhatsappMessage','options','raw','lodash','util','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis','defaults','localhost','./whatsappMessage.socket'];(function(_0x260e29,_0x1d8d60){var _0x263384=function(_0x4b34ca){while(--_0x4b34ca){_0x260e29['push'](_0x260e29['shift']());}};_0x263384(++_0x1d8d60);}(_0xdcb8,0x130));var _0x8dcb=function(_0x3bf83f,_0x181cac){_0x3bf83f=_0x3bf83f-0x0;var _0x22c4a9=_0xdcb8[_0x3bf83f];return _0x22c4a9;};'use strict';var _=require(_0x8dcb('0x0'));var util=require(_0x8dcb('0x1'));var moment=require('moment');var BPromise=require(_0x8dcb('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x8dcb('0x3'));var db=require(_0x8dcb('0x4'))['db'];var utils=require(_0x8dcb('0x5'));var logger=require(_0x8dcb('0x6'))(_0x8dcb('0x7'));var config=require(_0x8dcb('0x8'));var jayson=require(_0x8dcb('0x9'));var client=jayson[_0x8dcb('0xa')][_0x8dcb('0xb')]({'port':0x232a});config[_0x8dcb('0xc')]=_[_0x8dcb('0xd')](config[_0x8dcb('0xc')],{'host':_0x8dcb('0xe'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x8dcb('0xc')]));require(_0x8dcb('0xf'))[_0x8dcb('0x10')](socket);function respondWithRpcPromise(_0x3c7878,_0x40fe6b,_0xf76794){return new BPromise(function(_0x4a4c8f,_0x3fa539){return client['request'](_0x3c7878,_0xf76794)[_0x8dcb('0x11')](function(_0x4e739d){logger[_0x8dcb('0x12')](_0x8dcb('0x13'),_0x40fe6b,'request\x20sent');logger[_0x8dcb('0x14')](_0x8dcb('0x15'),_0x40fe6b,_0x8dcb('0x16'),JSON['stringify'](_0x4e739d));if(_0x4e739d[_0x8dcb('0x17')]){if(_0x4e739d['error'][_0x8dcb('0x18')]===0x1f4){logger['error'](_0x8dcb('0x13'),_0x40fe6b,_0x4e739d[_0x8dcb('0x17')][_0x8dcb('0x19')]);return _0x3fa539(_0x4e739d['error'][_0x8dcb('0x19')]);}logger[_0x8dcb('0x17')]('WhatsappMessage,\x20%s,\x20%s',_0x40fe6b,_0x4e739d['error'][_0x8dcb('0x19')]);return _0x4a4c8f(_0x4e739d[_0x8dcb('0x17')][_0x8dcb('0x19')]);}else{logger['info']('WhatsappMessage,\x20%s,\x20%s',_0x40fe6b,'request\x20sent');_0x4a4c8f(_0x4e739d[_0x8dcb('0x1a')][_0x8dcb('0x19')]);}})[_0x8dcb('0x1b')](function(_0x28d03d){logger[_0x8dcb('0x17')](_0x8dcb('0x13'),_0x40fe6b,_0x28d03d);_0x3fa539(_0x28d03d);});});}exports[_0x8dcb('0x1c')]=function(_0x55e060){var _0x4412cf=this;return new Promise(function(_0x337478,_0x3ca292){return db[_0x8dcb('0x1d')]['create'](_0x55e060['body'],{'raw':_0x55e060[_0x8dcb('0x1e')]?_0x55e060[_0x8dcb('0x1e')][_0x8dcb('0x1f')]===undefined?!![]:![]:!![]})['then'](function(_0x2be655){logger[_0x8dcb('0x12')](_0x8dcb('0x1c'),_0x55e060);logger[_0x8dcb('0x14')]('CreateWhatsappMessage',_0x55e060,JSON['stringify'](_0x2be655));_0x337478(_0x2be655);})[_0x8dcb('0x1b')](function(_0x2cf5f5){logger[_0x8dcb('0x17')](_0x8dcb('0x1c'),_0x2cf5f5['message'],_0x55e060);_0x3ca292(_0x4412cf[_0x8dcb('0x17')](0x1f4,_0x2cf5f5[_0x8dcb('0x19')]));});});}; \ No newline at end of file diff --git a/server/api/whatsappMessage/whatsappMessage.socket.js b/server/api/whatsappMessage/whatsappMessage.socket.js index 262e5a9..2ff6398 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 _0x3c4a=['save','remove','update','emit','removeListener','register','length','whatsappMessage:','./whatsappMessage.events'];(function(_0x4c9380,_0x2fefc0){var _0x49a523=function(_0x165e85){while(--_0x165e85){_0x4c9380['push'](_0x4c9380['shift']());}};_0x49a523(++_0x2fefc0);}(_0x3c4a,0xb3));var _0xa3c4=function(_0x18860c,_0x4af1bb){_0x18860c=_0x18860c-0x0;var _0x51f126=_0x3c4a[_0x18860c];return _0x51f126;};'use strict';var WhatsappMessageEvents=require(_0xa3c4('0x0'));var events=[_0xa3c4('0x1'),_0xa3c4('0x2'),_0xa3c4('0x3')];function createListener(_0x448a77,_0x5b2b0a){return function(_0x458d3b){_0x5b2b0a[_0xa3c4('0x4')](_0x448a77,_0x458d3b);};}function removeListener(_0x325a53,_0x33706f){return function(){WhatsappMessageEvents[_0xa3c4('0x5')](_0x325a53,_0x33706f);};}exports[_0xa3c4('0x6')]=function(_0x37077a){for(var _0x2c4739=0x0,_0x2b5654=events[_0xa3c4('0x7')];_0x2c4739<_0x2b5654;_0x2c4739++){var _0x3f03ef=events[_0x2c4739];var _0x204a29=createListener(_0xa3c4('0x8')+_0x3f03ef,_0x37077a);WhatsappMessageEvents['on'](_0x3f03ef,_0x204a29);}}; \ No newline at end of file +var _0x075d=['register','length','whatsappMessage:','./whatsappMessage.events','remove','update','emit','removeListener'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x075d,0x1db));var _0xd075=function(_0x69c038,_0x3bf449){_0x69c038=_0x69c038-0x0;var _0x1fded5=_0x075d[_0x69c038];return _0x1fded5;};'use strict';var WhatsappMessageEvents=require(_0xd075('0x0'));var events=['save',_0xd075('0x1'),_0xd075('0x2')];function createListener(_0x74072f,_0x16e0c6){return function(_0x2a80ce){_0x16e0c6[_0xd075('0x3')](_0x74072f,_0x2a80ce);};}function removeListener(_0x3cc907,_0x46dbee){return function(){WhatsappMessageEvents[_0xd075('0x4')](_0x3cc907,_0x46dbee);};}exports[_0xd075('0x5')]=function(_0x263395){for(var _0x1bb541=0x0,_0x3790b7=events[_0xd075('0x6')];_0x1bb541<_0x3790b7;_0x1bb541++){var _0xa7d774=events[_0x1bb541];var _0xc5a3f4=createListener(_0xd075('0x7')+_0xa7d774,_0x263395);WhatsappMessageEvents['on'](_0xa7d774,_0xc5a3f4);}}; \ No newline at end of file diff --git a/server/api/whatsappQueue/index.js b/server/api/whatsappQueue/index.js index aab165b..31bb16a 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 _0x4341=['removeAgents','multer','util','path','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./whatsappQueue.controller','get','isAuthenticated','/describe','/:id/members','/:id/teams','getTeams','/:id/users','post','addTeams','put','/:id','update','destroy','delete','removeTeams'];(function(_0x19950b,_0x53d0d7){var _0x3c6b41=function(_0x3924ad){while(--_0x3924ad){_0x19950b['push'](_0x19950b['shift']());}};_0x3c6b41(++_0x53d0d7);}(_0x4341,0x1dc));var _0x1434=function(_0x1e1b5a,_0x13b534){_0x1e1b5a=_0x1e1b5a-0x0;var _0x3206db=_0x4341[_0x1e1b5a];return _0x3206db;};'use strict';var multer=require(_0x1434('0x0'));var util=require(_0x1434('0x1'));var path=require(_0x1434('0x2'));var timeout=require('connect-timeout');var express=require(_0x1434('0x3'));var router=express['Router']();var fs_extra=require(_0x1434('0x4'));var auth=require(_0x1434('0x5'));var interaction=require(_0x1434('0x6'));var config=require(_0x1434('0x7'));var controller=require(_0x1434('0x8'));router[_0x1434('0x9')]('/',auth[_0x1434('0xa')](),controller['index']);router[_0x1434('0x9')](_0x1434('0xb'),auth[_0x1434('0xa')](),controller['describe']);router[_0x1434('0x9')]('/:id',auth[_0x1434('0xa')](),controller['show']);router[_0x1434('0x9')](_0x1434('0xc'),auth['isAuthenticated'](),controller['getMembers']);router[_0x1434('0x9')](_0x1434('0xd'),auth[_0x1434('0xa')](),controller[_0x1434('0xe')]);router[_0x1434('0x9')](_0x1434('0xf'),auth['isAuthenticated'](),controller['getAgents']);router[_0x1434('0x10')]('/',auth[_0x1434('0xa')](),controller['create']);router[_0x1434('0x10')](_0x1434('0xd'),auth['isAuthenticated'](),controller[_0x1434('0x11')]);router[_0x1434('0x10')](_0x1434('0xf'),auth[_0x1434('0xa')](),controller['addAgents']);router[_0x1434('0x12')](_0x1434('0x13'),auth[_0x1434('0xa')](),controller[_0x1434('0x14')]);router['delete']('/:id',auth[_0x1434('0xa')](),controller[_0x1434('0x15')]);router[_0x1434('0x16')](_0x1434('0xd'),auth[_0x1434('0xa')](),controller[_0x1434('0x17')]);router[_0x1434('0x16')]('/:id/users',auth[_0x1434('0xa')](),controller[_0x1434('0x18')]);module['exports']=router; \ No newline at end of file +var _0xf677=['index','/describe','describe','/:id','show','/:id/members','getMembers','/:id/teams','getTeams','/:id/users','getAgents','post','addTeams','addAgents','update','delete','destroy','removeTeams','removeAgents','util','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./whatsappQueue.controller','get','isAuthenticated'];(function(_0x414ffa,_0x1ea7a5){var _0x55a8fb=function(_0x5a310e){while(--_0x5a310e){_0x414ffa['push'](_0x414ffa['shift']());}};_0x55a8fb(++_0x1ea7a5);}(_0xf677,0xfb));var _0x7f67=function(_0x4081e9,_0x157feb){_0x4081e9=_0x4081e9-0x0;var _0x35cf25=_0xf677[_0x4081e9];return _0x35cf25;};'use strict';var multer=require('multer');var util=require(_0x7f67('0x0'));var path=require('path');var timeout=require(_0x7f67('0x1'));var express=require('express');var router=express[_0x7f67('0x2')]();var fs_extra=require(_0x7f67('0x3'));var auth=require(_0x7f67('0x4'));var interaction=require(_0x7f67('0x5'));var config=require(_0x7f67('0x6'));var controller=require(_0x7f67('0x7'));router[_0x7f67('0x8')]('/',auth[_0x7f67('0x9')](),controller[_0x7f67('0xa')]);router[_0x7f67('0x8')](_0x7f67('0xb'),auth[_0x7f67('0x9')](),controller[_0x7f67('0xc')]);router[_0x7f67('0x8')](_0x7f67('0xd'),auth[_0x7f67('0x9')](),controller[_0x7f67('0xe')]);router[_0x7f67('0x8')](_0x7f67('0xf'),auth[_0x7f67('0x9')](),controller[_0x7f67('0x10')]);router['get'](_0x7f67('0x11'),auth['isAuthenticated'](),controller[_0x7f67('0x12')]);router[_0x7f67('0x8')](_0x7f67('0x13'),auth['isAuthenticated'](),controller[_0x7f67('0x14')]);router[_0x7f67('0x15')]('/',auth[_0x7f67('0x9')](),controller['create']);router[_0x7f67('0x15')](_0x7f67('0x11'),auth['isAuthenticated'](),controller[_0x7f67('0x16')]);router[_0x7f67('0x15')](_0x7f67('0x13'),auth[_0x7f67('0x9')](),controller[_0x7f67('0x17')]);router['put']('/:id',auth[_0x7f67('0x9')](),controller[_0x7f67('0x18')]);router[_0x7f67('0x19')](_0x7f67('0xd'),auth['isAuthenticated'](),controller[_0x7f67('0x1a')]);router['delete']('/:id/teams',auth[_0x7f67('0x9')](),controller[_0x7f67('0x1b')]);router['delete'](_0x7f67('0x13'),auth[_0x7f67('0x9')](),controller[_0x7f67('0x1c')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/whatsappQueue/whatsappQueue.attributes.js b/server/api/whatsappQueue/whatsappQueue.attributes.js index 27646a9..57c3d07 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 _0x0269=['rrmemory','beepall','roundrobin','sequelize','STRING','INTEGER'];(function(_0x17d9e3,_0x1f969c){var _0x14192d=function(_0x159745){while(--_0x159745){_0x17d9e3['push'](_0x17d9e3['shift']());}};_0x14192d(++_0x1f969c);}(_0x0269,0x135));var _0x9026=function(_0x3cb1a8,_0x26b758){_0x3cb1a8=_0x3cb1a8-0x0;var _0x1826cf=_0x0269[_0x3cb1a8];return _0x1826cf;};'use strict';var Sequelize=require(_0x9026('0x0'));module['exports']={'name':{'type':Sequelize[_0x9026('0x1')],'unique':'name','validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'timeout':{'type':Sequelize[_0x9026('0x2')],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize['ENUM'](_0x9026('0x3'),_0x9026('0x4'),_0x9026('0x5'))},'description':{'type':Sequelize[_0x9026('0x1')]}}; \ No newline at end of file +var _0x49ac=['sequelize','exports','STRING','name','INTEGER','ENUM','rrmemory','beepall','roundrobin'];(function(_0x419bb9,_0x247ffa){var _0x594006=function(_0x795a74){while(--_0x795a74){_0x419bb9['push'](_0x419bb9['shift']());}};_0x594006(++_0x247ffa);}(_0x49ac,0x19e));var _0xc49a=function(_0x585ee5,_0x1c9dba){_0x585ee5=_0x585ee5-0x0;var _0x470808=_0x49ac[_0x585ee5];return _0x470808;};'use strict';var Sequelize=require(_0xc49a('0x0'));module[_0xc49a('0x1')]={'name':{'type':Sequelize[_0xc49a('0x2')],'unique':_0xc49a('0x3'),'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'timeout':{'type':Sequelize[_0xc49a('0x4')],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize[_0xc49a('0x5')](_0xc49a('0x6'),_0xc49a('0x7'),_0xc49a('0x8'))},'description':{'type':Sequelize[_0xc49a('0x2')]}}; \ No newline at end of file diff --git a/server/api/whatsappQueue/whatsappQueue.controller.js b/server/api/whatsappQueue/whatsappQueue.controller.js index 8d9352e..c4e7ad6 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 _0x345d=['params','keys','filters','attributes','intersection','fields','length','model','includeAll','options','find','create','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','describe','getMembers','findOne','order','sort','pick','WhatsappQueueId','filter','merge','UserWhatsappQueue','User','findAndCountAll','UserId','agent','whatsappPause','updatedAt','createdAt','format','%s/%s','getTeams','Team','hasOwnProperty','addTeams','ids','Agents','voicePause','interface','flatMap','sequelize','transaction','each','findOrCreate','forEach','userWhatsappQueue:save','removeTeams','select','field','tq.TeamId','from','team_has_whatsapp_queues','user_has_teams','clone','ut.UserId\x20=\x20?','push','QueryTypes','SELECT','every','TeamId','includes','union','compact','value','isEmpty','emit','userWhatsappQueue:remove','addAgents','omit','spread','removeAgents','isArray','getAgents','nolimit','bluebird','squel','ioredis','../../components/parsers/qs','../../config/logger','api','../../config/environment','../../mysqldb','redis','localhost','socket.io-emitter','register','sendStatus','status','json','offset','undefined','count','limit','set','Content-Range','update','then','destroy','get','WhatsappQueues','UserProfileResource','end','error','stack','name','send','index','map','WhatsappQueue','rawAttributes','fieldName','key','getOptions','where','include','query','findAll','rows','catch'];(function(_0xee741b,_0x10cf16){var _0x9ce0a2=function(_0x196418){while(--_0x196418){_0xee741b['push'](_0xee741b['shift']());}};_0x9ce0a2(++_0x10cf16);}(_0x345d,0x150));var _0xd345=function(_0x5ee673,_0x4ee30e){_0x5ee673=_0x5ee673-0x0;var _0x3cb63f=_0x345d[_0x5ee673];return _0x3cb63f;};'use strict';var BPromise=require(_0xd345('0x0'));var util=require('util');var _=require('lodash');var squel=require(_0xd345('0x1'));var Redis=require(_0xd345('0x2'));var qs=require(_0xd345('0x3'));var logger=require(_0xd345('0x4'))(_0xd345('0x5'));var config=require(_0xd345('0x6'));var db=require(_0xd345('0x7'))['db'];config['redis']=_['defaults'](config[_0xd345('0x8')],{'host':_0xd345('0x9'),'port':0x18eb});var socket=require(_0xd345('0xa'))(new Redis(config[_0xd345('0x8')]));require('./whatsappQueue.socket')[_0xd345('0xb')](socket);function respondWithStatusCode(_0x59af35,_0x48e879){_0x48e879=_0x48e879||0xcc;return function(_0x39dbeb){if(_0x39dbeb){return _0x59af35[_0xd345('0xc')](_0x48e879);}return _0x59af35[_0xd345('0xd')](_0x48e879)['end']();};}function respondWithResult(_0xa9b006,_0x36f2a1){_0x36f2a1=_0x36f2a1||0xc8;return function(_0xd6083e){if(_0xd6083e){return _0xa9b006[_0xd345('0xd')](_0x36f2a1)[_0xd345('0xe')](_0xd6083e);}};}function respondWithFilteredResult(_0x43914b,_0x336a79){return function(_0x1839a1){if(_0x1839a1){var _0x3d8121=typeof _0x336a79[_0xd345('0xf')]===_0xd345('0x10')&&typeof _0x336a79['limit']===_0xd345('0x10');var _0x47f4e8=_0x1839a1[_0xd345('0x11')];var _0x19fd95=_0x3d8121?0x0:_0x336a79[_0xd345('0xf')];var _0x20d055=_0x3d8121?_0x1839a1[_0xd345('0x11')]:_0x336a79[_0xd345('0xf')]+_0x336a79[_0xd345('0x12')];var _0x5890de;if(_0x20d055>=_0x47f4e8){_0x20d055=_0x47f4e8;_0x5890de=0xc8;}else{_0x5890de=0xce;}_0x43914b[_0xd345('0xd')](_0x5890de);return _0x43914b[_0xd345('0x13')](_0xd345('0x14'),_0x19fd95+'-'+_0x20d055+'/'+_0x47f4e8)[_0xd345('0xe')](_0x1839a1);}return null;};}function saveUpdates(_0x57126e){return function(_0x152940){if(_0x152940){return _0x152940[_0xd345('0x15')](_0x57126e)[_0xd345('0x16')](function(_0xef2731){return _0xef2731;});}return null;};}function removeEntity(_0x40d075){return function(_0x4d7c17){if(_0x4d7c17){return _0x4d7c17[_0xd345('0x17')]()[_0xd345('0x16')](function(){var _0x3064d2=_0x4d7c17[_0xd345('0x18')]({'plain':!![]});var _0x5f5c00=_0xd345('0x19');return db[_0xd345('0x1a')][_0xd345('0x17')]({'where':{'type':_0x5f5c00,'resourceId':_0x3064d2['id']}})['then'](function(){return _0x4d7c17;});})[_0xd345('0x16')](function(){_0x40d075['status'](0xcc)[_0xd345('0x1b')]();});}};}function handleEntityNotFound(_0x11f3bd){return function(_0x38c290){if(!_0x38c290){_0x11f3bd[_0xd345('0xc')](0x194);}return _0x38c290;};}function handleError(_0x5c1757,_0x4db933){_0x4db933=_0x4db933||0x1f4;return function(_0x54813c){logger[_0xd345('0x1c')](_0x54813c[_0xd345('0x1d')]);if(_0x54813c[_0xd345('0x1e')]){delete _0x54813c[_0xd345('0x1e')];}_0x5c1757[_0xd345('0xd')](_0x4db933)[_0xd345('0x1f')](_0x54813c);};}exports[_0xd345('0x20')]=function(_0x4e266c,_0x2b725d){var _0x3788b7={};var _0x27c396={'count':0x0,'rows':[]};var _0x44a9e9=_[_0xd345('0x21')](db[_0xd345('0x22')][_0xd345('0x23')],function(_0x28050a){return{'name':_0x28050a[_0xd345('0x24')],'type':_0x28050a['type'][_0xd345('0x25')]};});_0x3788b7=qs[_0xd345('0x26')](_0x44a9e9,_0x4e266c);var _0x4fda15={'where':_0x3788b7[_0xd345('0x27')]};return db[_0xd345('0x22')][_0xd345('0x11')](_0x4fda15)['then'](function(_0x15de9d){_0x27c396['count']=_0x15de9d;_0x3788b7[_0xd345('0x28')]=qs[_0xd345('0x28')](_0x4e266c[_0xd345('0x29')]);return db[_0xd345('0x22')][_0xd345('0x2a')](_0x3788b7);})[_0xd345('0x16')](function(_0x312f19){_0x27c396[_0xd345('0x2b')]=_0x312f19;return _0x27c396;})[_0xd345('0x16')](respondWithFilteredResult(_0x2b725d,_0x3788b7))[_0xd345('0x2c')](handleError(_0x2b725d,null));};exports['show']=function(_0x39a203,_0x1e01d1){var _0x4de3ac={'raw':!![],'where':{'id':_0x39a203[_0xd345('0x2d')]['id']}},_0x354f4a={};_0x354f4a['model']=_[_0xd345('0x2e')](db['WhatsappQueue'][_0xd345('0x23')]);_0x354f4a[_0xd345('0x29')]=_[_0xd345('0x2e')](_0x39a203[_0xd345('0x29')]);_0x354f4a[_0xd345('0x2f')]=_['intersection'](_0x354f4a['model'],_0x354f4a[_0xd345('0x29')]);_0x4de3ac[_0xd345('0x30')]=_[_0xd345('0x31')](_0x354f4a['model'],qs[_0xd345('0x32')](_0x39a203[_0xd345('0x29')][_0xd345('0x32')]));_0x4de3ac[_0xd345('0x30')]=_0x4de3ac['attributes'][_0xd345('0x33')]?_0x4de3ac[_0xd345('0x30')]:_0x354f4a[_0xd345('0x34')];if(_0x39a203[_0xd345('0x29')][_0xd345('0x35')]){_0x4de3ac[_0xd345('0x28')]=[{'all':!![]}];}_0x4de3ac=_['merge']({},_0x4de3ac,_0x39a203[_0xd345('0x36')]);return db[_0xd345('0x22')][_0xd345('0x37')](_0x4de3ac)[_0xd345('0x16')](handleEntityNotFound(_0x1e01d1,null))[_0xd345('0x16')](respondWithResult(_0x1e01d1,null))['catch'](handleError(_0x1e01d1,null));};exports[_0xd345('0x38')]=function(_0x42b6a7,_0xf0086f){return db[_0xd345('0x22')][_0xd345('0x38')](_0x42b6a7['body'],{})[_0xd345('0x16')](function(_0x2f016f){var _0x25e3dd=_0x42b6a7[_0xd345('0x39')][_0xd345('0x18')]({'plain':!![]});if(!_0x25e3dd)throw new Error(_0xd345('0x3a'));if(_0x25e3dd[_0xd345('0x3b')]===_0xd345('0x39')){var _0x36d093=_0x2f016f['get']({'plain':!![]});var _0x5285c2=_0xd345('0x19');return db[_0xd345('0x3c')][_0xd345('0x37')]({'where':{'name':_0x5285c2,'userProfileId':_0x25e3dd[_0xd345('0x3d')]},'raw':!![]})[_0xd345('0x16')](function(_0x1cae13){if(_0x1cae13&&_0x1cae13[_0xd345('0x3e')]===0x0){return db[_0xd345('0x1a')][_0xd345('0x38')]({'name':_0x36d093['name'],'resourceId':_0x36d093['id'],'type':_0x1cae13['name'],'sectionId':_0x1cae13['id']},{})[_0xd345('0x16')](function(){return _0x2f016f;});}else{return _0x2f016f;}})['catch'](function(_0x5a161c){logger[_0xd345('0x1c')](_0xd345('0x3f'),_0x5a161c);throw _0x5a161c;});}return _0x2f016f;})[_0xd345('0x16')](respondWithResult(_0xf0086f,0xc9))['catch'](handleError(_0xf0086f,null));};exports[_0xd345('0x15')]=function(_0x1754a4,_0x3cd09c){if(_0x1754a4[_0xd345('0x40')]['id']){delete _0x1754a4[_0xd345('0x40')]['id'];}return db['WhatsappQueue'][_0xd345('0x37')]({'where':{'id':_0x1754a4[_0xd345('0x2d')]['id']}})['then'](handleEntityNotFound(_0x3cd09c,null))[_0xd345('0x16')](saveUpdates(_0x1754a4[_0xd345('0x40')],null))[_0xd345('0x16')](respondWithResult(_0x3cd09c,null))['catch'](handleError(_0x3cd09c,null));};exports[_0xd345('0x17')]=function(_0x17e7bd,_0x360f58){return db[_0xd345('0x22')][_0xd345('0x37')]({'where':{'id':_0x17e7bd[_0xd345('0x2d')]['id']}})[_0xd345('0x16')](handleEntityNotFound(_0x360f58,null))[_0xd345('0x16')](removeEntity(_0x360f58,null))[_0xd345('0x2c')](handleError(_0x360f58,null));};exports[_0xd345('0x41')]=function(_0x20faa2,_0x15dc07){return db['WhatsappQueue'][_0xd345('0x41')]()[_0xd345('0x16')](respondWithResult(_0x15dc07,null))[_0xd345('0x2c')](handleError(_0x15dc07,null));};exports[_0xd345('0x42')]=function(_0x3d386c,_0x56dc9d){var _0x3e4b35={'raw':!![],'where':{}},_0x476601={},_0x33d579;return db[_0xd345('0x22')][_0xd345('0x43')]({'where':{'id':_0x3d386c[_0xd345('0x2d')]['id']}})[_0xd345('0x16')](handleEntityNotFound(_0x56dc9d,null))[_0xd345('0x16')](function(_0x306b5d){if(_0x306b5d){_0x33d579=_0x306b5d[_0xd345('0x18')]({'plain':!![]});_0x476601['model']=_[_0xd345('0x2e')](db['UserWhatsappQueue'][_0xd345('0x23')]);_0x476601[_0xd345('0x29')]=_[_0xd345('0x2e')](_0x3d386c['query']);_0x476601[_0xd345('0x2f')]=_[_0xd345('0x31')](_0x476601['model'],_0x476601[_0xd345('0x29')]);_0x3e4b35[_0xd345('0x30')]=_[_0xd345('0x31')](_0x476601['model'],qs[_0xd345('0x32')](_0x3d386c[_0xd345('0x29')][_0xd345('0x32')]));_0x3e4b35[_0xd345('0x30')]=_0x3e4b35['attributes'][_0xd345('0x33')]?_0x3e4b35[_0xd345('0x30')]:_0x476601[_0xd345('0x34')];if(!_0x3d386c[_0xd345('0x29')]['hasOwnProperty']('nolimit')){_0x3e4b35['limit']=qs[_0xd345('0x12')](_0x3d386c['query'][_0xd345('0x12')]);_0x3e4b35[_0xd345('0xf')]=qs[_0xd345('0xf')](_0x3d386c[_0xd345('0x29')][_0xd345('0xf')]);}_0x3e4b35[_0xd345('0x44')]=qs[_0xd345('0x45')](_0x3d386c[_0xd345('0x29')][_0xd345('0x45')]);_0x3e4b35[_0xd345('0x27')]=qs[_0xd345('0x2f')](_[_0xd345('0x46')](_0x3d386c[_0xd345('0x29')],_0x476601[_0xd345('0x2f')]));_0x3e4b35[_0xd345('0x27')][_0xd345('0x47')]=_0x306b5d['id'];if(_0x3d386c[_0xd345('0x29')][_0xd345('0x48')]){_0x3e4b35[_0xd345('0x27')]=_[_0xd345('0x49')](_0x3e4b35['where'],{'$or':_['map'](_0x3e4b35[_0xd345('0x30')],function(_0x10043c){var _0x46607b={};_0x46607b[_0x10043c]={'$like':'%'+_0x3d386c[_0xd345('0x29')][_0xd345('0x48')]+'%'};return _0x46607b;})});}_0x3e4b35=_[_0xd345('0x49')]({},_0x3e4b35,_0x3d386c[_0xd345('0x36')]);return db[_0xd345('0x4a')]['findAll'](_0x3e4b35);}})[_0xd345('0x16')](function(_0x14e122){if(_0x14e122){return db[_0xd345('0x4b')][_0xd345('0x4c')]({'where':{'id':_['map'](_0x14e122,_0xd345('0x4d')),'role':_0xd345('0x4e')},'attributes':['id',_0xd345('0x1e'),_0xd345('0x4f'),_0xd345('0x50'),_0xd345('0x51')]});}})['then'](function(_0x1ad560){if(_0x1ad560){return{'count':_0x1ad560[_0xd345('0x11')],'rows':_['map'](_0x1ad560[_0xd345('0x2b')],function(_0xf77aef){return{'membername':_0xf77aef[_0xd345('0x1e')],'UserId':_0xf77aef['id'],'queue_name':_0x33d579[_0xd345('0x1e')],'WhatsappQueueId':_0x33d579['id'],'interface':util[_0xd345('0x52')](_0xd345('0x53'),'SIP',_0xf77aef[_0xd345('0x1e')]),'penalty':0x0,'paused':_0xf77aef[_0xd345('0x4f')],'createdAt':_0xf77aef['createdAt'],'updatedAt':_0xf77aef[_0xd345('0x50')]};})};}else{return{'count':0x0,'rows':[]};}})['then'](respondWithFilteredResult(_0x56dc9d,_0x3e4b35))[_0xd345('0x2c')](handleError(_0x56dc9d,null));};exports[_0xd345('0x54')]=function(_0x5c458b,_0x318802){var _0x41689e={};var _0x4c700d={};var _0x14cd44;var _0x231ba7;return db['WhatsappQueue'][_0xd345('0x43')]({'where':{'id':_0x5c458b[_0xd345('0x2d')]['id']}})[_0xd345('0x16')](handleEntityNotFound(_0x318802,null))[_0xd345('0x16')](function(_0x531d7b){if(_0x531d7b){_0x14cd44=_0x531d7b;_0x4c700d[_0xd345('0x34')]=_[_0xd345('0x2e')](db[_0xd345('0x55')][_0xd345('0x23')]);_0x4c700d[_0xd345('0x29')]=_['keys'](_0x5c458b[_0xd345('0x29')]);_0x4c700d[_0xd345('0x2f')]=_[_0xd345('0x31')](_0x4c700d['model'],_0x4c700d[_0xd345('0x29')]);_0x41689e[_0xd345('0x30')]=_[_0xd345('0x31')](_0x4c700d[_0xd345('0x34')],qs['fields'](_0x5c458b[_0xd345('0x29')][_0xd345('0x32')]));_0x41689e[_0xd345('0x30')]=_0x41689e[_0xd345('0x30')][_0xd345('0x33')]?_0x41689e[_0xd345('0x30')]:_0x4c700d[_0xd345('0x34')];_0x41689e[_0xd345('0x44')]=qs[_0xd345('0x45')](_0x5c458b['query'][_0xd345('0x45')]);_0x41689e[_0xd345('0x27')]=qs[_0xd345('0x2f')](_[_0xd345('0x46')](_0x5c458b[_0xd345('0x29')],_0x4c700d[_0xd345('0x2f')]));if(_0x5c458b[_0xd345('0x29')]['filter']){_0x41689e[_0xd345('0x27')]=_[_0xd345('0x49')](_0x41689e[_0xd345('0x27')],{'$or':_[_0xd345('0x21')](_0x41689e['attributes'],function(_0x2181c2){var _0x5be700={};_0x5be700[_0x2181c2]={'$like':'%'+_0x5c458b[_0xd345('0x29')][_0xd345('0x48')]+'%'};return _0x5be700;})});}_0x41689e=_['merge']({},_0x41689e,_0x5c458b[_0xd345('0x36')]);return _0x14cd44[_0xd345('0x54')](_0x41689e);}})[_0xd345('0x16')](function(_0x4dba03){if(_0x4dba03){_0x231ba7=_0x4dba03[_0xd345('0x33')];if(!_0x5c458b['query'][_0xd345('0x56')]('nolimit')){_0x41689e[_0xd345('0x12')]=qs['limit'](_0x5c458b[_0xd345('0x29')][_0xd345('0x12')]);_0x41689e[_0xd345('0xf')]=qs[_0xd345('0xf')](_0x5c458b['query'][_0xd345('0xf')]);}return _0x14cd44[_0xd345('0x54')](_0x41689e);}})['then'](function(_0x4da6db){if(_0x4da6db){return _0x4da6db?{'count':_0x231ba7,'rows':_0x4da6db}:null;}})['then'](respondWithResult(_0x318802,null))['catch'](handleError(_0x318802,null));};exports[_0xd345('0x57')]=function(_0xb7324c,_0x35c498){var _0x1e6fcf=_0xb7324c['body'][_0xd345('0x58')];return db[_0xd345('0x55')]['findAll']({'where':{'id':_0x1e6fcf},'attributes':['id'],'include':[{'model':db[_0xd345('0x4b')],'as':_0xd345('0x59'),'attributes':['id',_0xd345('0x1e'),'online',_0xd345('0x5a'),_0xd345('0x5b')],'raw':!![]}]})[_0xd345('0x16')](function(_0x199deb){if(_0x199deb){var _0x1894e6=_[_0xd345('0x5c')](_0x199deb,function(_0x931c52){var _0x2d6591=_0x931c52[_0xd345('0x18')]({'plain':!![]});return _0x2d6591[_0xd345('0x59')];});return db[_0xd345('0x22')][_0xd345('0x37')]({'where':{'id':_0xb7324c['params']['id']}})[_0xd345('0x16')](function(_0x5bcfc8){return db[_0xd345('0x5d')][_0xd345('0x5e')](function(_0x46af07){return _0x5bcfc8[_0xd345('0x57')](_0x1e6fcf,{'transaction':_0x46af07})[_0xd345('0x16')](function(){return BPromise[_0xd345('0x5f')](_0x1894e6,function(_0x4a4f19){return db['UserWhatsappQueue'][_0xd345('0x60')]({'where':{'UserId':_0x4a4f19['id'],'WhatsappQueueId':_0xb7324c['params']['id']},'transaction':_0x46af07});});})[_0xd345('0x16')](function(){_0x1894e6[_0xd345('0x61')](function(_0x59cf6a){socket['emit'](_0xd345('0x62'),{'UserId':_0x59cf6a['id'],'WhatsappQueueId':_0x5bcfc8['id']});});});});});}})['then'](respondWithStatusCode(_0x35c498,null))[_0xd345('0x2c')](handleError(_0x35c498,null));};exports[_0xd345('0x63')]=function(_0x48448c,_0x26b523){return db[_0xd345('0x55')][_0xd345('0x2a')]({'where':{'id':_0x48448c[_0xd345('0x29')][_0xd345('0x58')]},'attributes':['id'],'include':[{'model':db['User'],'as':_0xd345('0x59'),'attributes':['id'],'raw':!![]}]})[_0xd345('0x16')](handleEntityNotFound(_0x26b523,null))['then'](function(_0xb3c3d3){var _0x2f2549=_[_0xd345('0x21')](_0xb3c3d3,'id');var _0x18c0b0=[];var _0x25d170=[];var _0x599fcd=squel[_0xd345('0x64')]();_0x599fcd[_0xd345('0x65')](_0xd345('0x66'))[_0xd345('0x67')](_0xd345('0x68'),'tq')['join'](_0xd345('0x69'),'ut','ut.TeamId\x20=\x20tq.TeamId')[_0xd345('0x27')]('WhatsappQueueId\x20=\x20?',_0x48448c[_0xd345('0x2d')]['id']);for(var _0x25c5cc=0x0;_0x25c5cc<_0xb3c3d3[_0xd345('0x33')];_0x25c5cc+=0x1){let _0x394824=_0xb3c3d3[_0x25c5cc];for(var _0x543644=0x0;_0x543644<_0x394824['Agents'][_0xd345('0x33')];_0x543644+=0x1){let _0x48705a=_0x394824[_0xd345('0x59')][_0x543644];var _0x66321f=_0x599fcd[_0xd345('0x6a')]();_0x66321f[_0xd345('0x27')](_0xd345('0x6b'),_0x48705a['id']);_0x25d170[_0xd345('0x6c')](db[_0xd345('0x5d')][_0xd345('0x29')](_0x66321f['toString'](),{'type':db[_0xd345('0x5d')][_0xd345('0x6d')][_0xd345('0x6e')]})[_0xd345('0x16')](function(_0x3a4e53){if(_0x3a4e53['length']===0x1){return _0x48705a['id'];}else{var _0x599cd7=_[_0xd345('0x6f')](_[_0xd345('0x21')](_0x3a4e53,_0xd345('0x70')),function(_0x15a616){return _[_0xd345('0x71')](_0x2f2549,_0x15a616);});if(_0x599cd7){return _0x48705a['id'];}}}));}}return BPromise['all'](_0x25d170)['then'](function(_0x3920f7){_0x18c0b0=_(_0x18c0b0)[_0xd345('0x72')](_0x3920f7)[_0xd345('0x73')]()[_0xd345('0x74')]();return db['WhatsappQueue'][_0xd345('0x37')]({'where':{'id':_0x48448c[_0xd345('0x2d')]['id']}})[_0xd345('0x16')](function(_0x148b50){return db['sequelize'][_0xd345('0x5e')](function(_0x5b54bc){return _0x148b50['removeTeams'](_0x48448c[_0xd345('0x29')][_0xd345('0x58')],{'transaction':_0x5b54bc})[_0xd345('0x16')](function(){if(!_[_0xd345('0x75')](_0x18c0b0)){return _0x148b50['removeAgents'](_0x18c0b0,{'transaction':_0x5b54bc});}})[_0xd345('0x16')](function(){_0x18c0b0[_0xd345('0x61')](function(_0x3b84a4){socket[_0xd345('0x76')](_0xd345('0x77'),{'UserId':_0x3b84a4,'WhatsappQueueId':_0x148b50['id']});});});});});});})[_0xd345('0x16')](respondWithStatusCode(_0x26b523,null))[_0xd345('0x2c')](handleError(_0x26b523,null));};exports[_0xd345('0x78')]=function(_0x3145e2,_0x2790c3){return db[_0xd345('0x22')][_0xd345('0x37')]({'where':{'id':_0x3145e2['params']['id']}})['then'](handleEntityNotFound(_0x2790c3,null))[_0xd345('0x16')](function(_0x8eabcc){if(_0x8eabcc){return _0x8eabcc[_0xd345('0x78')](_0x3145e2[_0xd345('0x40')]['ids'],_[_0xd345('0x79')](_0x3145e2[_0xd345('0x40')],[_0xd345('0x58'),'id'])||{})[_0xd345('0x7a')](function(_0x4baea0){for(var _0x18fa3d=0x0;_0x18fa3d<_0x3145e2[_0xd345('0x40')]['ids']['length'];_0x18fa3d+=0x1){socket[_0xd345('0x76')](_0xd345('0x62'),{'UserId':Number(_0x3145e2[_0xd345('0x40')][_0xd345('0x58')][_0x18fa3d]),'WhatsappQueueId':Number(_0x3145e2[_0xd345('0x2d')]['id'])});}return _0x4baea0;});}})[_0xd345('0x16')](respondWithResult(_0x2790c3,null))[_0xd345('0x2c')](handleError(_0x2790c3,null));};exports[_0xd345('0x7b')]=function(_0x2a7b5e,_0x3cc7ab){return db[_0xd345('0x22')]['find']({'where':{'id':_0x2a7b5e[_0xd345('0x2d')]['id']}})[_0xd345('0x16')](handleEntityNotFound(_0x3cc7ab,null))['then'](function(_0xe35bdc){if(_0xe35bdc){return _0xe35bdc['removeAgents'](_0x2a7b5e[_0xd345('0x29')]['ids'])[_0xd345('0x16')](function(){if(_[_0xd345('0x7c')](_0x2a7b5e['query']['ids'])){for(var _0x2ee972=0x0;_0x2ee972<_0x2a7b5e['query'][_0xd345('0x58')][_0xd345('0x33')];_0x2ee972+=0x1){socket[_0xd345('0x76')](_0xd345('0x77'),{'UserId':Number(_0x2a7b5e[_0xd345('0x29')][_0xd345('0x58')][_0x2ee972]),'WhatsappQueueId':Number(_0x2a7b5e[_0xd345('0x2d')]['id'])});}}else{socket[_0xd345('0x76')]('userWhatsappQueue:remove',{'UserId':Number(_0x2a7b5e['query'][_0xd345('0x58')]),'WhatsappQueueId':Number(_0x2a7b5e['params']['id'])});}});}})['then'](respondWithStatusCode(_0x3cc7ab,null))[_0xd345('0x2c')](handleError(_0x3cc7ab,null));};exports[_0xd345('0x7d')]=function(_0x18cba2,_0x27ee95){var _0x11bca0={};var _0x38a85b={};var _0xc32711;var _0x3a52fc;return db['WhatsappQueue']['findOne']({'where':{'id':_0x18cba2[_0xd345('0x2d')]['id']}})['then'](handleEntityNotFound(_0x27ee95,null))['then'](function(_0x29f79c){if(_0x29f79c){_0xc32711=_0x29f79c;_0x38a85b[_0xd345('0x34')]=_[_0xd345('0x2e')](db[_0xd345('0x4b')][_0xd345('0x23')]);_0x38a85b[_0xd345('0x29')]=_[_0xd345('0x2e')](_0x18cba2[_0xd345('0x29')]);_0x38a85b[_0xd345('0x2f')]=_['intersection'](_0x38a85b['model'],_0x38a85b[_0xd345('0x29')]);_0x11bca0['attributes']=_[_0xd345('0x31')](_0x38a85b[_0xd345('0x34')],qs[_0xd345('0x32')](_0x18cba2[_0xd345('0x29')][_0xd345('0x32')]));_0x11bca0['attributes']=_0x11bca0[_0xd345('0x30')]['length']?_0x11bca0[_0xd345('0x30')]:_0x38a85b['model'];_0x11bca0[_0xd345('0x44')]=qs[_0xd345('0x45')](_0x18cba2[_0xd345('0x29')][_0xd345('0x45')]);_0x11bca0[_0xd345('0x27')]=qs[_0xd345('0x2f')](_[_0xd345('0x46')](_0x18cba2['query'],_0x38a85b['filters']));if(_0x18cba2[_0xd345('0x29')][_0xd345('0x48')]){_0x11bca0[_0xd345('0x27')]=_[_0xd345('0x49')](_0x11bca0[_0xd345('0x27')],{'$or':_[_0xd345('0x21')](_0x11bca0[_0xd345('0x30')],function(_0x560b15){var _0x6d1520={};_0x6d1520[_0x560b15]={'$like':'%'+_0x18cba2[_0xd345('0x29')]['filter']+'%'};return _0x6d1520;})});}_0x11bca0=_['merge']({},_0x11bca0,_0x18cba2['options']);return _0xc32711[_0xd345('0x7d')](_0x11bca0);}})['then'](function(_0x2d9f09){if(_0x2d9f09){_0x3a52fc=_0x2d9f09['length'];if(!_0x18cba2[_0xd345('0x29')]['hasOwnProperty'](_0xd345('0x7e'))){_0x11bca0[_0xd345('0x12')]=qs['limit'](_0x18cba2['query']['limit']);_0x11bca0[_0xd345('0xf')]=qs['offset'](_0x18cba2[_0xd345('0x29')][_0xd345('0xf')]);}return _0xc32711['getAgents'](_0x11bca0);}})['then'](function(_0x19d3a4){if(_0x19d3a4){return _0x19d3a4?{'count':_0x3a52fc,'rows':_0x19d3a4}:null;}})[_0xd345('0x16')](respondWithResult(_0x27ee95,null))[_0xd345('0x2c')](handleError(_0x27ee95,null));}; \ No newline at end of file +var _0xffd7=['getMembers','findOne','UserWhatsappQueue','rawAttributes','hasOwnProperty','nolimit','order','sort','pick','filter','merge','User','findAndCountAll','UserId','agent','whatsappPause','updatedAt','createdAt','format','SIP','getTeams','addTeams','ids','Team','Agents','online','voicePause','flatMap','sequelize','transaction','each','findOrCreate','forEach','emit','userWhatsappQueue:save','removeTeams','select','field','tq.TeamId','from','team_has_whatsapp_queues','join','user_has_teams','ut.TeamId\x20=\x20tq.TeamId','WhatsappQueueId\x20=\x20?','clone','ut.UserId\x20=\x20?','toString','every','TeamId','all','union','compact','value','isEmpty','removeAgents','omit','spread','getAgents','bluebird','util','lodash','squel','../../components/parsers/qs','../../config/logger','api','../../config/environment','redis','defaults','socket.io-emitter','register','status','end','json','offset','undefined','count','limit','set','Content-Range','update','then','destroy','get','WhatsappQueues','UserProfileResource','sendStatus','stack','name','map','WhatsappQueue','fieldName','key','getOptions','where','include','query','findAll','rows','catch','params','model','keys','filters','intersection','attributes','fields','length','includeAll','options','create','body','Unable\x20to\x20retrieve\x20the\x20current\x20user','user','find','userProfileId','autoAssociation','error','describe'];(function(_0x42160d,_0x2a8b51){var _0x4d4bc5=function(_0x1c31b4){while(--_0x1c31b4){_0x42160d['push'](_0x42160d['shift']());}};_0x4d4bc5(++_0x2a8b51);}(_0xffd7,0x129));var _0x7ffd=function(_0x31a866,_0x1b5556){_0x31a866=_0x31a866-0x0;var _0x59bc23=_0xffd7[_0x31a866];return _0x59bc23;};'use strict';var BPromise=require(_0x7ffd('0x0'));var util=require(_0x7ffd('0x1'));var _=require(_0x7ffd('0x2'));var squel=require(_0x7ffd('0x3'));var Redis=require('ioredis');var qs=require(_0x7ffd('0x4'));var logger=require(_0x7ffd('0x5'))(_0x7ffd('0x6'));var config=require(_0x7ffd('0x7'));var db=require('../../mysqldb')['db'];config[_0x7ffd('0x8')]=_[_0x7ffd('0x9')](config[_0x7ffd('0x8')],{'host':'localhost','port':0x18eb});var socket=require(_0x7ffd('0xa'))(new Redis(config['redis']));require('./whatsappQueue.socket')[_0x7ffd('0xb')](socket);function respondWithStatusCode(_0x557f45,_0x57b95c){_0x57b95c=_0x57b95c||0xcc;return function(_0x55acf8){if(_0x55acf8){return _0x557f45['sendStatus'](_0x57b95c);}return _0x557f45[_0x7ffd('0xc')](_0x57b95c)[_0x7ffd('0xd')]();};}function respondWithResult(_0xf5fa46,_0x1fcceb){_0x1fcceb=_0x1fcceb||0xc8;return function(_0x1cdbec){if(_0x1cdbec){return _0xf5fa46[_0x7ffd('0xc')](_0x1fcceb)[_0x7ffd('0xe')](_0x1cdbec);}};}function respondWithFilteredResult(_0x1a54af,_0x397d9d){return function(_0x96f01e){if(_0x96f01e){var _0xe6a627=typeof _0x397d9d[_0x7ffd('0xf')]===_0x7ffd('0x10')&&typeof _0x397d9d['limit']===_0x7ffd('0x10');var _0x19bb82=_0x96f01e[_0x7ffd('0x11')];var _0x42613c=_0xe6a627?0x0:_0x397d9d[_0x7ffd('0xf')];var _0x51b950=_0xe6a627?_0x96f01e[_0x7ffd('0x11')]:_0x397d9d[_0x7ffd('0xf')]+_0x397d9d[_0x7ffd('0x12')];var _0x4739ca;if(_0x51b950>=_0x19bb82){_0x51b950=_0x19bb82;_0x4739ca=0xc8;}else{_0x4739ca=0xce;}_0x1a54af[_0x7ffd('0xc')](_0x4739ca);return _0x1a54af[_0x7ffd('0x13')](_0x7ffd('0x14'),_0x42613c+'-'+_0x51b950+'/'+_0x19bb82)['json'](_0x96f01e);}return null;};}function saveUpdates(_0x56f2b2){return function(_0x483e2d){if(_0x483e2d){return _0x483e2d[_0x7ffd('0x15')](_0x56f2b2)[_0x7ffd('0x16')](function(_0x1cf1a8){return _0x1cf1a8;});}return null;};}function removeEntity(_0x4b069c){return function(_0x3d429b){if(_0x3d429b){return _0x3d429b[_0x7ffd('0x17')]()[_0x7ffd('0x16')](function(){var _0x5a7948=_0x3d429b[_0x7ffd('0x18')]({'plain':!![]});var _0x1bac91=_0x7ffd('0x19');return db[_0x7ffd('0x1a')][_0x7ffd('0x17')]({'where':{'type':_0x1bac91,'resourceId':_0x5a7948['id']}})[_0x7ffd('0x16')](function(){return _0x3d429b;});})['then'](function(){_0x4b069c[_0x7ffd('0xc')](0xcc)[_0x7ffd('0xd')]();});}};}function handleEntityNotFound(_0x597f42){return function(_0x147365){if(!_0x147365){_0x597f42[_0x7ffd('0x1b')](0x194);}return _0x147365;};}function handleError(_0x26a0e9,_0x2e79e3){_0x2e79e3=_0x2e79e3||0x1f4;return function(_0x36f606){logger['error'](_0x36f606[_0x7ffd('0x1c')]);if(_0x36f606[_0x7ffd('0x1d')]){delete _0x36f606[_0x7ffd('0x1d')];}_0x26a0e9[_0x7ffd('0xc')](_0x2e79e3)['send'](_0x36f606);};}exports['index']=function(_0x159ad5,_0x56910b){var _0x2d92a6={};var _0x52f849={'count':0x0,'rows':[]};var _0x9afa0=_[_0x7ffd('0x1e')](db[_0x7ffd('0x1f')]['rawAttributes'],function(_0xcf70){return{'name':_0xcf70[_0x7ffd('0x20')],'type':_0xcf70['type'][_0x7ffd('0x21')]};});_0x2d92a6=qs[_0x7ffd('0x22')](_0x9afa0,_0x159ad5);var _0x40b00b={'where':_0x2d92a6[_0x7ffd('0x23')]};return db['WhatsappQueue'][_0x7ffd('0x11')](_0x40b00b)['then'](function(_0x2ba21c){_0x52f849[_0x7ffd('0x11')]=_0x2ba21c;_0x2d92a6[_0x7ffd('0x24')]=qs[_0x7ffd('0x24')](_0x159ad5[_0x7ffd('0x25')]);return db[_0x7ffd('0x1f')][_0x7ffd('0x26')](_0x2d92a6);})[_0x7ffd('0x16')](function(_0xb4f093){_0x52f849[_0x7ffd('0x27')]=_0xb4f093;return _0x52f849;})['then'](respondWithFilteredResult(_0x56910b,_0x2d92a6))[_0x7ffd('0x28')](handleError(_0x56910b,null));};exports['show']=function(_0x39395c,_0x486d84){var _0x1457ec={'raw':!![],'where':{'id':_0x39395c[_0x7ffd('0x29')]['id']}},_0xcbc3c9={};_0xcbc3c9[_0x7ffd('0x2a')]=_['keys'](db['WhatsappQueue']['rawAttributes']);_0xcbc3c9[_0x7ffd('0x25')]=_[_0x7ffd('0x2b')](_0x39395c['query']);_0xcbc3c9[_0x7ffd('0x2c')]=_[_0x7ffd('0x2d')](_0xcbc3c9['model'],_0xcbc3c9[_0x7ffd('0x25')]);_0x1457ec[_0x7ffd('0x2e')]=_[_0x7ffd('0x2d')](_0xcbc3c9[_0x7ffd('0x2a')],qs[_0x7ffd('0x2f')](_0x39395c[_0x7ffd('0x25')][_0x7ffd('0x2f')]));_0x1457ec['attributes']=_0x1457ec[_0x7ffd('0x2e')][_0x7ffd('0x30')]?_0x1457ec[_0x7ffd('0x2e')]:_0xcbc3c9['model'];if(_0x39395c[_0x7ffd('0x25')][_0x7ffd('0x31')]){_0x1457ec[_0x7ffd('0x24')]=[{'all':!![]}];}_0x1457ec=_['merge']({},_0x1457ec,_0x39395c[_0x7ffd('0x32')]);return db[_0x7ffd('0x1f')]['find'](_0x1457ec)[_0x7ffd('0x16')](handleEntityNotFound(_0x486d84,null))[_0x7ffd('0x16')](respondWithResult(_0x486d84,null))[_0x7ffd('0x28')](handleError(_0x486d84,null));};exports[_0x7ffd('0x33')]=function(_0x2e09b5,_0x315771){return db[_0x7ffd('0x1f')][_0x7ffd('0x33')](_0x2e09b5[_0x7ffd('0x34')],{})[_0x7ffd('0x16')](function(_0x487165){var _0x35bf70=_0x2e09b5['user'][_0x7ffd('0x18')]({'plain':!![]});if(!_0x35bf70)throw new Error(_0x7ffd('0x35'));if(_0x35bf70['role']===_0x7ffd('0x36')){var _0x39d5c9=_0x487165[_0x7ffd('0x18')]({'plain':!![]});var _0x4fccad='WhatsappQueues';return db['UserProfileSection'][_0x7ffd('0x37')]({'where':{'name':_0x4fccad,'userProfileId':_0x35bf70[_0x7ffd('0x38')]},'raw':!![]})[_0x7ffd('0x16')](function(_0x5aa140){if(_0x5aa140&&_0x5aa140[_0x7ffd('0x39')]===0x0){return db[_0x7ffd('0x1a')][_0x7ffd('0x33')]({'name':_0x39d5c9[_0x7ffd('0x1d')],'resourceId':_0x39d5c9['id'],'type':_0x5aa140[_0x7ffd('0x1d')],'sectionId':_0x5aa140['id']},{})[_0x7ffd('0x16')](function(){return _0x487165;});}else{return _0x487165;}})[_0x7ffd('0x28')](function(_0x2e6b1b){logger[_0x7ffd('0x3a')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x2e6b1b);throw _0x2e6b1b;});}return _0x487165;})[_0x7ffd('0x16')](respondWithResult(_0x315771,0xc9))[_0x7ffd('0x28')](handleError(_0x315771,null));};exports[_0x7ffd('0x15')]=function(_0x561231,_0x24c288){if(_0x561231[_0x7ffd('0x34')]['id']){delete _0x561231[_0x7ffd('0x34')]['id'];}return db['WhatsappQueue'][_0x7ffd('0x37')]({'where':{'id':_0x561231['params']['id']}})['then'](handleEntityNotFound(_0x24c288,null))[_0x7ffd('0x16')](saveUpdates(_0x561231[_0x7ffd('0x34')],null))[_0x7ffd('0x16')](respondWithResult(_0x24c288,null))['catch'](handleError(_0x24c288,null));};exports[_0x7ffd('0x17')]=function(_0x521087,_0x562e39){return db[_0x7ffd('0x1f')][_0x7ffd('0x37')]({'where':{'id':_0x521087[_0x7ffd('0x29')]['id']}})[_0x7ffd('0x16')](handleEntityNotFound(_0x562e39,null))[_0x7ffd('0x16')](removeEntity(_0x562e39,null))[_0x7ffd('0x28')](handleError(_0x562e39,null));};exports[_0x7ffd('0x3b')]=function(_0x5249db,_0x39963a){return db[_0x7ffd('0x1f')][_0x7ffd('0x3b')]()[_0x7ffd('0x16')](respondWithResult(_0x39963a,null))[_0x7ffd('0x28')](handleError(_0x39963a,null));};exports[_0x7ffd('0x3c')]=function(_0x16a8a9,_0x14eb2d){var _0x16aa89={'raw':!![],'where':{}},_0x332900={},_0x2ab065;return db[_0x7ffd('0x1f')][_0x7ffd('0x3d')]({'where':{'id':_0x16a8a9[_0x7ffd('0x29')]['id']}})[_0x7ffd('0x16')](handleEntityNotFound(_0x14eb2d,null))[_0x7ffd('0x16')](function(_0x472913){if(_0x472913){_0x2ab065=_0x472913[_0x7ffd('0x18')]({'plain':!![]});_0x332900['model']=_['keys'](db[_0x7ffd('0x3e')][_0x7ffd('0x3f')]);_0x332900[_0x7ffd('0x25')]=_[_0x7ffd('0x2b')](_0x16a8a9[_0x7ffd('0x25')]);_0x332900['filters']=_['intersection'](_0x332900[_0x7ffd('0x2a')],_0x332900['query']);_0x16aa89[_0x7ffd('0x2e')]=_[_0x7ffd('0x2d')](_0x332900[_0x7ffd('0x2a')],qs[_0x7ffd('0x2f')](_0x16a8a9[_0x7ffd('0x25')][_0x7ffd('0x2f')]));_0x16aa89[_0x7ffd('0x2e')]=_0x16aa89[_0x7ffd('0x2e')][_0x7ffd('0x30')]?_0x16aa89[_0x7ffd('0x2e')]:_0x332900[_0x7ffd('0x2a')];if(!_0x16a8a9[_0x7ffd('0x25')][_0x7ffd('0x40')](_0x7ffd('0x41'))){_0x16aa89[_0x7ffd('0x12')]=qs[_0x7ffd('0x12')](_0x16a8a9[_0x7ffd('0x25')][_0x7ffd('0x12')]);_0x16aa89[_0x7ffd('0xf')]=qs['offset'](_0x16a8a9[_0x7ffd('0x25')][_0x7ffd('0xf')]);}_0x16aa89[_0x7ffd('0x42')]=qs[_0x7ffd('0x43')](_0x16a8a9[_0x7ffd('0x25')][_0x7ffd('0x43')]);_0x16aa89[_0x7ffd('0x23')]=qs[_0x7ffd('0x2c')](_[_0x7ffd('0x44')](_0x16a8a9[_0x7ffd('0x25')],_0x332900[_0x7ffd('0x2c')]));_0x16aa89[_0x7ffd('0x23')]['WhatsappQueueId']=_0x472913['id'];if(_0x16a8a9['query'][_0x7ffd('0x45')]){_0x16aa89['where']=_['merge'](_0x16aa89['where'],{'$or':_[_0x7ffd('0x1e')](_0x16aa89[_0x7ffd('0x2e')],function(_0x1b4001){var _0x3687bc={};_0x3687bc[_0x1b4001]={'$like':'%'+_0x16a8a9[_0x7ffd('0x25')][_0x7ffd('0x45')]+'%'};return _0x3687bc;})});}_0x16aa89=_[_0x7ffd('0x46')]({},_0x16aa89,_0x16a8a9[_0x7ffd('0x32')]);return db['UserWhatsappQueue'][_0x7ffd('0x26')](_0x16aa89);}})['then'](function(_0x5e5cf1){if(_0x5e5cf1){return db[_0x7ffd('0x47')][_0x7ffd('0x48')]({'where':{'id':_[_0x7ffd('0x1e')](_0x5e5cf1,_0x7ffd('0x49')),'role':_0x7ffd('0x4a')},'attributes':['id',_0x7ffd('0x1d'),_0x7ffd('0x4b'),_0x7ffd('0x4c'),_0x7ffd('0x4d')]});}})[_0x7ffd('0x16')](function(_0x445ace){if(_0x445ace){return{'count':_0x445ace[_0x7ffd('0x11')],'rows':_['map'](_0x445ace[_0x7ffd('0x27')],function(_0xfaecfc){return{'membername':_0xfaecfc[_0x7ffd('0x1d')],'UserId':_0xfaecfc['id'],'queue_name':_0x2ab065[_0x7ffd('0x1d')],'WhatsappQueueId':_0x2ab065['id'],'interface':util[_0x7ffd('0x4e')]('%s/%s',_0x7ffd('0x4f'),_0xfaecfc[_0x7ffd('0x1d')]),'penalty':0x0,'paused':_0xfaecfc[_0x7ffd('0x4b')],'createdAt':_0xfaecfc[_0x7ffd('0x4d')],'updatedAt':_0xfaecfc[_0x7ffd('0x4c')]};})};}else{return{'count':0x0,'rows':[]};}})[_0x7ffd('0x16')](respondWithFilteredResult(_0x14eb2d,_0x16aa89))[_0x7ffd('0x28')](handleError(_0x14eb2d,null));};exports[_0x7ffd('0x50')]=function(_0x16a12a,_0x1b274b){var _0x43c489={};var _0x59ec48={};var _0x1fcd77;var _0x11539b;return db[_0x7ffd('0x1f')][_0x7ffd('0x3d')]({'where':{'id':_0x16a12a[_0x7ffd('0x29')]['id']}})[_0x7ffd('0x16')](handleEntityNotFound(_0x1b274b,null))[_0x7ffd('0x16')](function(_0x4472bb){if(_0x4472bb){_0x1fcd77=_0x4472bb;_0x59ec48[_0x7ffd('0x2a')]=_[_0x7ffd('0x2b')](db['Team'][_0x7ffd('0x3f')]);_0x59ec48[_0x7ffd('0x25')]=_[_0x7ffd('0x2b')](_0x16a12a[_0x7ffd('0x25')]);_0x59ec48[_0x7ffd('0x2c')]=_[_0x7ffd('0x2d')](_0x59ec48[_0x7ffd('0x2a')],_0x59ec48[_0x7ffd('0x25')]);_0x43c489['attributes']=_['intersection'](_0x59ec48['model'],qs[_0x7ffd('0x2f')](_0x16a12a['query'][_0x7ffd('0x2f')]));_0x43c489[_0x7ffd('0x2e')]=_0x43c489[_0x7ffd('0x2e')]['length']?_0x43c489[_0x7ffd('0x2e')]:_0x59ec48[_0x7ffd('0x2a')];_0x43c489[_0x7ffd('0x42')]=qs[_0x7ffd('0x43')](_0x16a12a[_0x7ffd('0x25')]['sort']);_0x43c489['where']=qs[_0x7ffd('0x2c')](_[_0x7ffd('0x44')](_0x16a12a[_0x7ffd('0x25')],_0x59ec48[_0x7ffd('0x2c')]));if(_0x16a12a[_0x7ffd('0x25')][_0x7ffd('0x45')]){_0x43c489['where']=_[_0x7ffd('0x46')](_0x43c489[_0x7ffd('0x23')],{'$or':_['map'](_0x43c489[_0x7ffd('0x2e')],function(_0x248816){var _0xfe4131={};_0xfe4131[_0x248816]={'$like':'%'+_0x16a12a[_0x7ffd('0x25')]['filter']+'%'};return _0xfe4131;})});}_0x43c489=_[_0x7ffd('0x46')]({},_0x43c489,_0x16a12a[_0x7ffd('0x32')]);return _0x1fcd77['getTeams'](_0x43c489);}})[_0x7ffd('0x16')](function(_0x379283){if(_0x379283){_0x11539b=_0x379283[_0x7ffd('0x30')];if(!_0x16a12a[_0x7ffd('0x25')][_0x7ffd('0x40')](_0x7ffd('0x41'))){_0x43c489[_0x7ffd('0x12')]=qs['limit'](_0x16a12a[_0x7ffd('0x25')]['limit']);_0x43c489['offset']=qs[_0x7ffd('0xf')](_0x16a12a[_0x7ffd('0x25')][_0x7ffd('0xf')]);}return _0x1fcd77[_0x7ffd('0x50')](_0x43c489);}})['then'](function(_0x3df203){if(_0x3df203){return _0x3df203?{'count':_0x11539b,'rows':_0x3df203}:null;}})[_0x7ffd('0x16')](respondWithResult(_0x1b274b,null))['catch'](handleError(_0x1b274b,null));};exports[_0x7ffd('0x51')]=function(_0x14835b,_0x2ca846){var _0x212ee6=_0x14835b[_0x7ffd('0x34')][_0x7ffd('0x52')];return db[_0x7ffd('0x53')][_0x7ffd('0x26')]({'where':{'id':_0x212ee6},'attributes':['id'],'include':[{'model':db['User'],'as':_0x7ffd('0x54'),'attributes':['id',_0x7ffd('0x1d'),_0x7ffd('0x55'),_0x7ffd('0x56'),'interface'],'raw':!![]}]})[_0x7ffd('0x16')](function(_0x288b30){if(_0x288b30){var _0x16fb7f=_[_0x7ffd('0x57')](_0x288b30,function(_0xdf9496){var _0x4f96ff=_0xdf9496[_0x7ffd('0x18')]({'plain':!![]});return _0x4f96ff[_0x7ffd('0x54')];});return db[_0x7ffd('0x1f')][_0x7ffd('0x37')]({'where':{'id':_0x14835b[_0x7ffd('0x29')]['id']}})[_0x7ffd('0x16')](function(_0x520099){return db[_0x7ffd('0x58')][_0x7ffd('0x59')](function(_0x4ecd87){return _0x520099['addTeams'](_0x212ee6,{'transaction':_0x4ecd87})['then'](function(){return BPromise[_0x7ffd('0x5a')](_0x16fb7f,function(_0x598b50){return db[_0x7ffd('0x3e')][_0x7ffd('0x5b')]({'where':{'UserId':_0x598b50['id'],'WhatsappQueueId':_0x14835b[_0x7ffd('0x29')]['id']},'transaction':_0x4ecd87});});})['then'](function(){_0x16fb7f[_0x7ffd('0x5c')](function(_0x47eef3){socket[_0x7ffd('0x5d')](_0x7ffd('0x5e'),{'UserId':_0x47eef3['id'],'WhatsappQueueId':_0x520099['id']});});});});});}})[_0x7ffd('0x16')](respondWithStatusCode(_0x2ca846,null))['catch'](handleError(_0x2ca846,null));};exports[_0x7ffd('0x5f')]=function(_0x184af5,_0x1eff9b){return db[_0x7ffd('0x53')][_0x7ffd('0x26')]({'where':{'id':_0x184af5[_0x7ffd('0x25')][_0x7ffd('0x52')]},'attributes':['id'],'include':[{'model':db[_0x7ffd('0x47')],'as':_0x7ffd('0x54'),'attributes':['id'],'raw':!![]}]})[_0x7ffd('0x16')](handleEntityNotFound(_0x1eff9b,null))['then'](function(_0x133a07){var _0x3f57eb=_[_0x7ffd('0x1e')](_0x133a07,'id');var _0xb1f786=[];var _0x515643=[];var _0x17d1b9=squel[_0x7ffd('0x60')]();_0x17d1b9[_0x7ffd('0x61')](_0x7ffd('0x62'))[_0x7ffd('0x63')](_0x7ffd('0x64'),'tq')[_0x7ffd('0x65')](_0x7ffd('0x66'),'ut',_0x7ffd('0x67'))[_0x7ffd('0x23')](_0x7ffd('0x68'),_0x184af5[_0x7ffd('0x29')]['id']);for(var _0x54d11c=0x0;_0x54d11c<_0x133a07['length'];_0x54d11c+=0x1){let _0x2c9178=_0x133a07[_0x54d11c];for(var _0xdbe379=0x0;_0xdbe379<_0x2c9178['Agents'][_0x7ffd('0x30')];_0xdbe379+=0x1){let _0x356881=_0x2c9178[_0x7ffd('0x54')][_0xdbe379];var _0xa88688=_0x17d1b9[_0x7ffd('0x69')]();_0xa88688[_0x7ffd('0x23')](_0x7ffd('0x6a'),_0x356881['id']);_0x515643['push'](db[_0x7ffd('0x58')][_0x7ffd('0x25')](_0xa88688[_0x7ffd('0x6b')](),{'type':db[_0x7ffd('0x58')]['QueryTypes']['SELECT']})[_0x7ffd('0x16')](function(_0x247f1d){if(_0x247f1d[_0x7ffd('0x30')]===0x1){return _0x356881['id'];}else{var _0xbc7319=_[_0x7ffd('0x6c')](_['map'](_0x247f1d,_0x7ffd('0x6d')),function(_0x925791){return _['includes'](_0x3f57eb,_0x925791);});if(_0xbc7319){return _0x356881['id'];}}}));}}return BPromise[_0x7ffd('0x6e')](_0x515643)[_0x7ffd('0x16')](function(_0x33e60f){_0xb1f786=_(_0xb1f786)[_0x7ffd('0x6f')](_0x33e60f)[_0x7ffd('0x70')]()[_0x7ffd('0x71')]();return db['WhatsappQueue'][_0x7ffd('0x37')]({'where':{'id':_0x184af5[_0x7ffd('0x29')]['id']}})[_0x7ffd('0x16')](function(_0x535ab7){return db[_0x7ffd('0x58')][_0x7ffd('0x59')](function(_0x52907b){return _0x535ab7[_0x7ffd('0x5f')](_0x184af5[_0x7ffd('0x25')][_0x7ffd('0x52')],{'transaction':_0x52907b})[_0x7ffd('0x16')](function(){if(!_[_0x7ffd('0x72')](_0xb1f786)){return _0x535ab7[_0x7ffd('0x73')](_0xb1f786,{'transaction':_0x52907b});}})[_0x7ffd('0x16')](function(){_0xb1f786[_0x7ffd('0x5c')](function(_0xd329e8){socket[_0x7ffd('0x5d')]('userWhatsappQueue:remove',{'UserId':_0xd329e8,'WhatsappQueueId':_0x535ab7['id']});});});});});});})[_0x7ffd('0x16')](respondWithStatusCode(_0x1eff9b,null))[_0x7ffd('0x28')](handleError(_0x1eff9b,null));};exports['addAgents']=function(_0x54cff1,_0x25b72e){return db[_0x7ffd('0x1f')][_0x7ffd('0x37')]({'where':{'id':_0x54cff1[_0x7ffd('0x29')]['id']}})[_0x7ffd('0x16')](handleEntityNotFound(_0x25b72e,null))[_0x7ffd('0x16')](function(_0x364c2c){if(_0x364c2c){return _0x364c2c['addAgents'](_0x54cff1[_0x7ffd('0x34')][_0x7ffd('0x52')],_[_0x7ffd('0x74')](_0x54cff1['body'],[_0x7ffd('0x52'),'id'])||{})[_0x7ffd('0x75')](function(_0x5509ac){for(var _0x318368=0x0;_0x318368<_0x54cff1[_0x7ffd('0x34')][_0x7ffd('0x52')][_0x7ffd('0x30')];_0x318368+=0x1){socket['emit'](_0x7ffd('0x5e'),{'UserId':Number(_0x54cff1['body'][_0x7ffd('0x52')][_0x318368]),'WhatsappQueueId':Number(_0x54cff1[_0x7ffd('0x29')]['id'])});}return _0x5509ac;});}})['then'](respondWithResult(_0x25b72e,null))[_0x7ffd('0x28')](handleError(_0x25b72e,null));};exports[_0x7ffd('0x73')]=function(_0x2c9ffb,_0x3b314a){return db['WhatsappQueue']['find']({'where':{'id':_0x2c9ffb[_0x7ffd('0x29')]['id']}})['then'](handleEntityNotFound(_0x3b314a,null))[_0x7ffd('0x16')](function(_0x1349a7){if(_0x1349a7){return _0x1349a7[_0x7ffd('0x73')](_0x2c9ffb[_0x7ffd('0x25')][_0x7ffd('0x52')])[_0x7ffd('0x16')](function(){if(_['isArray'](_0x2c9ffb[_0x7ffd('0x25')]['ids'])){for(var _0x196022=0x0;_0x196022<_0x2c9ffb[_0x7ffd('0x25')][_0x7ffd('0x52')][_0x7ffd('0x30')];_0x196022+=0x1){socket[_0x7ffd('0x5d')]('userWhatsappQueue:remove',{'UserId':Number(_0x2c9ffb[_0x7ffd('0x25')][_0x7ffd('0x52')][_0x196022]),'WhatsappQueueId':Number(_0x2c9ffb[_0x7ffd('0x29')]['id'])});}}else{socket['emit']('userWhatsappQueue:remove',{'UserId':Number(_0x2c9ffb[_0x7ffd('0x25')][_0x7ffd('0x52')]),'WhatsappQueueId':Number(_0x2c9ffb['params']['id'])});}});}})[_0x7ffd('0x16')](respondWithStatusCode(_0x3b314a,null))[_0x7ffd('0x28')](handleError(_0x3b314a,null));};exports['getAgents']=function(_0x393d8f,_0x3de6a0){var _0x3b9a2d={};var _0x64a887={};var _0x3639ee;var _0x2cb61a;return db[_0x7ffd('0x1f')][_0x7ffd('0x3d')]({'where':{'id':_0x393d8f[_0x7ffd('0x29')]['id']}})[_0x7ffd('0x16')](handleEntityNotFound(_0x3de6a0,null))[_0x7ffd('0x16')](function(_0x573122){if(_0x573122){_0x3639ee=_0x573122;_0x64a887[_0x7ffd('0x2a')]=_[_0x7ffd('0x2b')](db[_0x7ffd('0x47')][_0x7ffd('0x3f')]);_0x64a887[_0x7ffd('0x25')]=_[_0x7ffd('0x2b')](_0x393d8f[_0x7ffd('0x25')]);_0x64a887[_0x7ffd('0x2c')]=_['intersection'](_0x64a887[_0x7ffd('0x2a')],_0x64a887['query']);_0x3b9a2d[_0x7ffd('0x2e')]=_[_0x7ffd('0x2d')](_0x64a887['model'],qs[_0x7ffd('0x2f')](_0x393d8f[_0x7ffd('0x25')][_0x7ffd('0x2f')]));_0x3b9a2d[_0x7ffd('0x2e')]=_0x3b9a2d[_0x7ffd('0x2e')][_0x7ffd('0x30')]?_0x3b9a2d['attributes']:_0x64a887[_0x7ffd('0x2a')];_0x3b9a2d[_0x7ffd('0x42')]=qs[_0x7ffd('0x43')](_0x393d8f[_0x7ffd('0x25')]['sort']);_0x3b9a2d[_0x7ffd('0x23')]=qs['filters'](_[_0x7ffd('0x44')](_0x393d8f[_0x7ffd('0x25')],_0x64a887[_0x7ffd('0x2c')]));if(_0x393d8f[_0x7ffd('0x25')][_0x7ffd('0x45')]){_0x3b9a2d[_0x7ffd('0x23')]=_[_0x7ffd('0x46')](_0x3b9a2d[_0x7ffd('0x23')],{'$or':_[_0x7ffd('0x1e')](_0x3b9a2d[_0x7ffd('0x2e')],function(_0xd5e426){var _0xf02971={};_0xf02971[_0xd5e426]={'$like':'%'+_0x393d8f[_0x7ffd('0x25')][_0x7ffd('0x45')]+'%'};return _0xf02971;})});}_0x3b9a2d=_['merge']({},_0x3b9a2d,_0x393d8f[_0x7ffd('0x32')]);return _0x3639ee[_0x7ffd('0x76')](_0x3b9a2d);}})[_0x7ffd('0x16')](function(_0x3216d7){if(_0x3216d7){_0x2cb61a=_0x3216d7[_0x7ffd('0x30')];if(!_0x393d8f['query'][_0x7ffd('0x40')]('nolimit')){_0x3b9a2d['limit']=qs[_0x7ffd('0x12')](_0x393d8f[_0x7ffd('0x25')][_0x7ffd('0x12')]);_0x3b9a2d[_0x7ffd('0xf')]=qs[_0x7ffd('0xf')](_0x393d8f[_0x7ffd('0x25')]['offset']);}return _0x3639ee[_0x7ffd('0x76')](_0x3b9a2d);}})[_0x7ffd('0x16')](function(_0x534450){if(_0x534450){return _0x534450?{'count':_0x2cb61a,'rows':_0x534450}:null;}})[_0x7ffd('0x16')](respondWithResult(_0x3de6a0,null))[_0x7ffd('0x28')](handleError(_0x3de6a0,null));}; \ No newline at end of file diff --git a/server/api/whatsappQueue/whatsappQueue.events.js b/server/api/whatsappQueue/whatsappQueue.events.js index 53b0131..75162b7 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 _0x7255=['hasOwnProperty','exports','events','setMaxListeners','save','remove','emit'];(function(_0x2e791b,_0x216426){var _0x391b9f=function(_0x3a2e96){while(--_0x3a2e96){_0x2e791b['push'](_0x2e791b['shift']());}};_0x391b9f(++_0x216426);}(_0x7255,0x1b4));var _0x5725=function(_0x489a4f,_0xaa4d77){_0x489a4f=_0x489a4f-0x0;var _0x462e1b=_0x7255[_0x489a4f];return _0x462e1b;};'use strict';var EventEmitter=require(_0x5725('0x0'));var WhatsappQueue=require('../../mysqldb')['db']['WhatsappQueue'];var WhatsappQueueEvents=new EventEmitter();WhatsappQueueEvents[_0x5725('0x1')](0x0);var events={'afterCreate':_0x5725('0x2'),'afterUpdate':'update','afterDestroy':_0x5725('0x3')};function emitEvent(_0x2f00c4){return function(_0x1fe5a8,_0x1cb0f2,_0x2150c7){WhatsappQueueEvents[_0x5725('0x4')](_0x2f00c4+':'+_0x1fe5a8['id'],_0x1fe5a8);WhatsappQueueEvents['emit'](_0x2f00c4,_0x1fe5a8);_0x2150c7(null);};}for(var e in events){if(events[_0x5725('0x5')](e)){var event=events[e];WhatsappQueue['hook'](e,emitEvent(event));}}module[_0x5725('0x6')]=WhatsappQueueEvents; \ No newline at end of file +var _0x0af9=['update','remove','emit','hasOwnProperty','exports','events','../../mysqldb','WhatsappQueue','setMaxListeners'];(function(_0x31e29a,_0x349c9b){var _0x32d892=function(_0x41cc86){while(--_0x41cc86){_0x31e29a['push'](_0x31e29a['shift']());}};_0x32d892(++_0x349c9b);}(_0x0af9,0x17f));var _0x90af=function(_0x35d879,_0x517820){_0x35d879=_0x35d879-0x0;var _0x32530f=_0x0af9[_0x35d879];return _0x32530f;};'use strict';var EventEmitter=require(_0x90af('0x0'));var WhatsappQueue=require(_0x90af('0x1'))['db'][_0x90af('0x2')];var WhatsappQueueEvents=new EventEmitter();WhatsappQueueEvents[_0x90af('0x3')](0x0);var events={'afterCreate':'save','afterUpdate':_0x90af('0x4'),'afterDestroy':_0x90af('0x5')};function emitEvent(_0x5e32a4){return function(_0x315530,_0xdff5ff,_0x48e667){WhatsappQueueEvents[_0x90af('0x6')](_0x5e32a4+':'+_0x315530['id'],_0x315530);WhatsappQueueEvents['emit'](_0x5e32a4,_0x315530);_0x48e667(null);};}for(var e in events){if(events[_0x90af('0x7')](e)){var event=events[e];WhatsappQueue['hook'](e,emitEvent(event));}}module[_0x90af('0x8')]=WhatsappQueueEvents; \ No newline at end of file diff --git a/server/api/whatsappQueue/whatsappQueue.model.js b/server/api/whatsappQueue/whatsappQueue.model.js index e723811..e29fcae 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 _0xe723=['rimraf','../../config/environment','./whatsappQueue.attributes','exports','define','util','api','moment','bluebird','request-promise','path'];(function(_0x3ea913,_0x255df2){var _0x2b4f28=function(_0x48bb25){while(--_0x48bb25){_0x3ea913['push'](_0x3ea913['shift']());}};_0x2b4f28(++_0x255df2);}(_0xe723,0x144));var _0x3e72=function(_0xb7e04c,_0x5c0d2e){_0xb7e04c=_0xb7e04c-0x0;var _0x51d4c5=_0xe723[_0xb7e04c];return _0x51d4c5;};'use strict';var _=require('lodash');var util=require(_0x3e72('0x0'));var logger=require('../../config/logger')(_0x3e72('0x1'));var moment=require(_0x3e72('0x2'));var BPromise=require(_0x3e72('0x3'));var rp=require(_0x3e72('0x4'));var fs=require('fs');var path=require(_0x3e72('0x5'));var rimraf=require(_0x3e72('0x6'));var config=require(_0x3e72('0x7'));var attributes=require(_0x3e72('0x8'));module[_0x3e72('0x9')]=function(_0x1a7604,_0x3b0622){return _0x1a7604[_0x3e72('0xa')]('WhatsappQueue',attributes,{'tableName':'whatsapp_queues','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x43d8=['api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./whatsappQueue.attributes','exports','WhatsappQueue','lodash','util','../../config/logger'];(function(_0x28adaa,_0x4dcc47){var _0x2e633a=function(_0x27a017){while(--_0x27a017){_0x28adaa['push'](_0x28adaa['shift']());}};_0x2e633a(++_0x4dcc47);}(_0x43d8,0xcd));var _0x843d=function(_0x52d5df,_0x3a6baa){_0x52d5df=_0x52d5df-0x0;var _0x374a89=_0x43d8[_0x52d5df];return _0x374a89;};'use strict';var _=require(_0x843d('0x0'));var util=require(_0x843d('0x1'));var logger=require(_0x843d('0x2'))(_0x843d('0x3'));var moment=require(_0x843d('0x4'));var BPromise=require(_0x843d('0x5'));var rp=require(_0x843d('0x6'));var fs=require('fs');var path=require(_0x843d('0x7'));var rimraf=require(_0x843d('0x8'));var config=require(_0x843d('0x9'));var attributes=require(_0x843d('0xa'));module[_0x843d('0xb')]=function(_0x24371d,_0x5216d5){return _0x24371d['define'](_0x843d('0xc'),attributes,{'tableName':'whatsapp_queues','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/whatsappQueue/whatsappQueue.rpc.js b/server/api/whatsappQueue/whatsappQueue.rpc.js index 607f240..db030fc 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 _0x6b37=['limit','include','model','map','stringify','catch','ShowWhatsappQueue','find','raw','then','lodash','util','moment','bluebird','randomstring','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','redis','defaults','localhost','socket.io-emitter','register','request\x20sent','debug','WhatsappQueue,\x20%s,\x20%s,\x20%s','error','WhatsappQueue,\x20%s,\x20%s','message','info','result','GetWhatsappQueue','WhatsappQueue','options','where','attributes'];(function(_0x465a0c,_0x19d4d5){var _0x1e202e=function(_0x27bd8a){while(--_0x27bd8a){_0x465a0c['push'](_0x465a0c['shift']());}};_0x1e202e(++_0x19d4d5);}(_0x6b37,0x142));var _0x76b3=function(_0x5ee4fb,_0xafe0dd){_0x5ee4fb=_0x5ee4fb-0x0;var _0x541423=_0x6b37[_0x5ee4fb];return _0x541423;};'use strict';var _=require(_0x76b3('0x0'));var util=require(_0x76b3('0x1'));var moment=require(_0x76b3('0x2'));var BPromise=require(_0x76b3('0x3'));var rs=require(_0x76b3('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0x76b3('0x5'));var logger=require(_0x76b3('0x6'))('rpc');var config=require(_0x76b3('0x7'));var jayson=require(_0x76b3('0x8'));var client=jayson[_0x76b3('0x9')][_0x76b3('0xa')]({'port':0x232a});config[_0x76b3('0xb')]=_[_0x76b3('0xc')](config[_0x76b3('0xb')],{'host':_0x76b3('0xd'),'port':0x18eb});var socket=require(_0x76b3('0xe'))(new Redis(config[_0x76b3('0xb')]));require('./whatsappQueue.socket')[_0x76b3('0xf')](socket);function respondWithRpcPromise(_0x20142d,_0x2c8e42,_0x4c5d86){return new BPromise(function(_0x35e6ae,_0x584a6a){return client['request'](_0x20142d,_0x4c5d86)['then'](function(_0x22a9e3){logger['info']('WhatsappQueue,\x20%s,\x20%s',_0x2c8e42,_0x76b3('0x10'));logger[_0x76b3('0x11')](_0x76b3('0x12'),_0x2c8e42,_0x76b3('0x10'),JSON['stringify'](_0x22a9e3));if(_0x22a9e3[_0x76b3('0x13')]){if(_0x22a9e3[_0x76b3('0x13')]['code']===0x1f4){logger['error'](_0x76b3('0x14'),_0x2c8e42,_0x22a9e3['error'][_0x76b3('0x15')]);return _0x584a6a(_0x22a9e3['error']['message']);}logger[_0x76b3('0x13')](_0x76b3('0x14'),_0x2c8e42,_0x22a9e3[_0x76b3('0x13')][_0x76b3('0x15')]);return _0x35e6ae(_0x22a9e3[_0x76b3('0x13')]['message']);}else{logger[_0x76b3('0x16')]('WhatsappQueue,\x20%s,\x20%s',_0x2c8e42,'request\x20sent');_0x35e6ae(_0x22a9e3[_0x76b3('0x17')][_0x76b3('0x15')]);}})['catch'](function(_0x5ab6fd){logger['error']('WhatsappQueue,\x20%s,\x20%s',_0x2c8e42,_0x5ab6fd);_0x584a6a(_0x5ab6fd);});});}exports[_0x76b3('0x18')]=function(_0x2c7fcf){var _0x3e2781=this;return new Promise(function(_0x1a473c,_0x2396bd){return db[_0x76b3('0x19')]['findAll']({'raw':_0x2c7fcf[_0x76b3('0x1a')]?_0x2c7fcf[_0x76b3('0x1a')]['raw']===undefined?!![]:![]:!![],'where':_0x2c7fcf[_0x76b3('0x1a')]?_0x2c7fcf[_0x76b3('0x1a')][_0x76b3('0x1b')]||null:null,'attributes':_0x2c7fcf[_0x76b3('0x1a')]?_0x2c7fcf[_0x76b3('0x1a')][_0x76b3('0x1c')]||null:null,'limit':_0x2c7fcf[_0x76b3('0x1a')]?_0x2c7fcf[_0x76b3('0x1a')][_0x76b3('0x1d')]||null:null,'include':_0x2c7fcf[_0x76b3('0x1a')]?_0x2c7fcf[_0x76b3('0x1a')][_0x76b3('0x1e')]?_['map'](_0x2c7fcf[_0x76b3('0x1a')][_0x76b3('0x1e')],function(_0x4efd9e){return{'model':db[_0x4efd9e['model']],'as':_0x4efd9e['as'],'attributes':_0x4efd9e[_0x76b3('0x1c')],'include':_0x4efd9e[_0x76b3('0x1e')]?_['map'](_0x4efd9e[_0x76b3('0x1e')],function(_0x2cdc0f){return{'model':db[_0x2cdc0f[_0x76b3('0x1f')]],'as':_0x2cdc0f['as'],'attributes':_0x2cdc0f[_0x76b3('0x1c')],'include':_0x2cdc0f[_0x76b3('0x1e')]?_[_0x76b3('0x20')](_0x2cdc0f[_0x76b3('0x1e')],function(_0x18a9c8){return{'model':db[_0x18a9c8[_0x76b3('0x1f')]],'as':_0x18a9c8['as'],'attributes':_0x18a9c8[_0x76b3('0x1c')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x14b6d4){logger[_0x76b3('0x16')]('GetWhatsappQueue',_0x2c7fcf);logger[_0x76b3('0x11')](_0x76b3('0x18'),_0x2c7fcf,JSON[_0x76b3('0x21')](_0x14b6d4));_0x1a473c(_0x14b6d4);})[_0x76b3('0x22')](function(_0x2703fe){logger[_0x76b3('0x13')](_0x76b3('0x18'),_0x2703fe[_0x76b3('0x15')],_0x2c7fcf);_0x2396bd(_0x3e2781[_0x76b3('0x13')](0x1f4,_0x2703fe[_0x76b3('0x15')]));});});};exports[_0x76b3('0x23')]=function(_0x5250b4){var _0xa354dd=this;return new Promise(function(_0x30fdbb,_0x55776c){return db[_0x76b3('0x19')][_0x76b3('0x24')]({'raw':_0x5250b4[_0x76b3('0x1a')]?_0x5250b4[_0x76b3('0x1a')][_0x76b3('0x25')]===undefined?!![]:![]:!![],'where':_0x5250b4[_0x76b3('0x1a')]?_0x5250b4['options'][_0x76b3('0x1b')]||null:null,'attributes':_0x5250b4[_0x76b3('0x1a')]?_0x5250b4[_0x76b3('0x1a')]['attributes']||null:null,'include':_0x5250b4[_0x76b3('0x1a')]?_0x5250b4[_0x76b3('0x1a')][_0x76b3('0x1e')]?_['map'](_0x5250b4['options'][_0x76b3('0x1e')],function(_0x4c001e){return{'model':db[_0x4c001e[_0x76b3('0x1f')]],'as':_0x4c001e['as'],'attributes':_0x4c001e['attributes'],'include':_0x4c001e[_0x76b3('0x1e')]?_[_0x76b3('0x20')](_0x4c001e[_0x76b3('0x1e')],function(_0x57b79f){return{'model':db[_0x57b79f[_0x76b3('0x1f')]],'as':_0x57b79f['as'],'attributes':_0x57b79f[_0x76b3('0x1c')],'include':_0x57b79f[_0x76b3('0x1e')]?_[_0x76b3('0x20')](_0x57b79f[_0x76b3('0x1e')],function(_0xd9d782){return{'model':db[_0xd9d782[_0x76b3('0x1f')]],'as':_0xd9d782['as'],'attributes':_0xd9d782[_0x76b3('0x1c')]};}):[]};}):[]};}):[]:[]})[_0x76b3('0x26')](function(_0x1b56f2){logger[_0x76b3('0x16')](_0x76b3('0x23'),_0x5250b4);logger[_0x76b3('0x11')](_0x76b3('0x23'),_0x5250b4,JSON[_0x76b3('0x21')](_0x1b56f2));_0x30fdbb(_0x1b56f2);})[_0x76b3('0x22')](function(_0x1157e1){logger[_0x76b3('0x13')](_0x76b3('0x23'),_0x1157e1[_0x76b3('0x15')],_0x5250b4);_0x55776c(_0xa354dd['error'](0x1f4,_0x1157e1['message']));});});}; \ No newline at end of file +var _0x7a9a=['util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/environment','jayson/promise','client','http','defaults','localhost','socket.io-emitter','redis','then','info','WhatsappQueue,\x20%s,\x20%s','debug','request\x20sent','stringify','error','code','message','catch','WhatsappQueue','findAll','options','raw','where','attributes','limit','include','map','model','GetWhatsappQueue','ShowWhatsappQueue','find','lodash'];(function(_0x243b2f,_0x30aa15){var _0xcb3c2d=function(_0x213bb2){while(--_0x213bb2){_0x243b2f['push'](_0x243b2f['shift']());}};_0xcb3c2d(++_0x30aa15);}(_0x7a9a,0x1a1));var _0xa7a9=function(_0x49152c,_0x395455){_0x49152c=_0x49152c-0x0;var _0x4e3893=_0x7a9a[_0x49152c];return _0x4e3893;};'use strict';var _=require(_0xa7a9('0x0'));var util=require(_0xa7a9('0x1'));var moment=require(_0xa7a9('0x2'));var BPromise=require(_0xa7a9('0x3'));var rs=require(_0xa7a9('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xa7a9('0x5'))['db'];var utils=require(_0xa7a9('0x6'));var logger=require('../../config/logger')('rpc');var config=require(_0xa7a9('0x7'));var jayson=require(_0xa7a9('0x8'));var client=jayson[_0xa7a9('0x9')][_0xa7a9('0xa')]({'port':0x232a});config['redis']=_[_0xa7a9('0xb')](config['redis'],{'host':_0xa7a9('0xc'),'port':0x18eb});var socket=require(_0xa7a9('0xd'))(new Redis(config[_0xa7a9('0xe')]));require('./whatsappQueue.socket')['register'](socket);function respondWithRpcPromise(_0x4de156,_0x505212,_0x465de2){return new BPromise(function(_0x182b4a,_0x18d96f){return client['request'](_0x4de156,_0x465de2)[_0xa7a9('0xf')](function(_0x5ecae3){logger[_0xa7a9('0x10')](_0xa7a9('0x11'),_0x505212,'request\x20sent');logger[_0xa7a9('0x12')]('WhatsappQueue,\x20%s,\x20%s,\x20%s',_0x505212,_0xa7a9('0x13'),JSON[_0xa7a9('0x14')](_0x5ecae3));if(_0x5ecae3[_0xa7a9('0x15')]){if(_0x5ecae3['error'][_0xa7a9('0x16')]===0x1f4){logger['error'](_0xa7a9('0x11'),_0x505212,_0x5ecae3[_0xa7a9('0x15')][_0xa7a9('0x17')]);return _0x18d96f(_0x5ecae3[_0xa7a9('0x15')][_0xa7a9('0x17')]);}logger['error']('WhatsappQueue,\x20%s,\x20%s',_0x505212,_0x5ecae3[_0xa7a9('0x15')][_0xa7a9('0x17')]);return _0x182b4a(_0x5ecae3[_0xa7a9('0x15')]['message']);}else{logger['info'](_0xa7a9('0x11'),_0x505212,_0xa7a9('0x13'));_0x182b4a(_0x5ecae3['result'][_0xa7a9('0x17')]);}})[_0xa7a9('0x18')](function(_0x570a6a){logger[_0xa7a9('0x15')](_0xa7a9('0x11'),_0x505212,_0x570a6a);_0x18d96f(_0x570a6a);});});}exports['GetWhatsappQueue']=function(_0x282213){var _0x196ad3=this;return new Promise(function(_0x58b0a1,_0x47152b){return db[_0xa7a9('0x19')][_0xa7a9('0x1a')]({'raw':_0x282213['options']?_0x282213[_0xa7a9('0x1b')][_0xa7a9('0x1c')]===undefined?!![]:![]:!![],'where':_0x282213[_0xa7a9('0x1b')]?_0x282213[_0xa7a9('0x1b')][_0xa7a9('0x1d')]||null:null,'attributes':_0x282213[_0xa7a9('0x1b')]?_0x282213[_0xa7a9('0x1b')][_0xa7a9('0x1e')]||null:null,'limit':_0x282213[_0xa7a9('0x1b')]?_0x282213['options'][_0xa7a9('0x1f')]||null:null,'include':_0x282213[_0xa7a9('0x1b')]?_0x282213['options'][_0xa7a9('0x20')]?_[_0xa7a9('0x21')](_0x282213[_0xa7a9('0x1b')][_0xa7a9('0x20')],function(_0x1a4aa2){return{'model':db[_0x1a4aa2['model']],'as':_0x1a4aa2['as'],'attributes':_0x1a4aa2[_0xa7a9('0x1e')],'include':_0x1a4aa2['include']?_[_0xa7a9('0x21')](_0x1a4aa2[_0xa7a9('0x20')],function(_0x34acde){return{'model':db[_0x34acde[_0xa7a9('0x22')]],'as':_0x34acde['as'],'attributes':_0x34acde[_0xa7a9('0x1e')],'include':_0x34acde[_0xa7a9('0x20')]?_[_0xa7a9('0x21')](_0x34acde[_0xa7a9('0x20')],function(_0x1a3f92){return{'model':db[_0x1a3f92['model']],'as':_0x1a3f92['as'],'attributes':_0x1a3f92[_0xa7a9('0x1e')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x6e58e9){logger[_0xa7a9('0x10')](_0xa7a9('0x23'),_0x282213);logger[_0xa7a9('0x12')](_0xa7a9('0x23'),_0x282213,JSON['stringify'](_0x6e58e9));_0x58b0a1(_0x6e58e9);})[_0xa7a9('0x18')](function(_0x56d870){logger['error'](_0xa7a9('0x23'),_0x56d870[_0xa7a9('0x17')],_0x282213);_0x47152b(_0x196ad3['error'](0x1f4,_0x56d870[_0xa7a9('0x17')]));});});};exports[_0xa7a9('0x24')]=function(_0x25159a){var _0x1bb25d=this;return new Promise(function(_0x45d2e5,_0x169116){return db[_0xa7a9('0x19')][_0xa7a9('0x25')]({'raw':_0x25159a['options']?_0x25159a[_0xa7a9('0x1b')][_0xa7a9('0x1c')]===undefined?!![]:![]:!![],'where':_0x25159a[_0xa7a9('0x1b')]?_0x25159a['options'][_0xa7a9('0x1d')]||null:null,'attributes':_0x25159a[_0xa7a9('0x1b')]?_0x25159a[_0xa7a9('0x1b')]['attributes']||null:null,'include':_0x25159a['options']?_0x25159a[_0xa7a9('0x1b')][_0xa7a9('0x20')]?_[_0xa7a9('0x21')](_0x25159a[_0xa7a9('0x1b')][_0xa7a9('0x20')],function(_0x3ea6c6){return{'model':db[_0x3ea6c6[_0xa7a9('0x22')]],'as':_0x3ea6c6['as'],'attributes':_0x3ea6c6['attributes'],'include':_0x3ea6c6[_0xa7a9('0x20')]?_[_0xa7a9('0x21')](_0x3ea6c6[_0xa7a9('0x20')],function(_0x5af5d6){return{'model':db[_0x5af5d6['model']],'as':_0x5af5d6['as'],'attributes':_0x5af5d6[_0xa7a9('0x1e')],'include':_0x5af5d6[_0xa7a9('0x20')]?_['map'](_0x5af5d6[_0xa7a9('0x20')],function(_0x23fea8){return{'model':db[_0x23fea8[_0xa7a9('0x22')]],'as':_0x23fea8['as'],'attributes':_0x23fea8['attributes']};}):[]};}):[]};}):[]:[]})['then'](function(_0x2faf93){logger[_0xa7a9('0x10')](_0xa7a9('0x24'),_0x25159a);logger[_0xa7a9('0x12')](_0xa7a9('0x24'),_0x25159a,JSON[_0xa7a9('0x14')](_0x2faf93));_0x45d2e5(_0x2faf93);})[_0xa7a9('0x18')](function(_0x29c61e){logger['error'](_0xa7a9('0x24'),_0x29c61e[_0xa7a9('0x17')],_0x25159a);_0x169116(_0x1bb25d['error'](0x1f4,_0x29c61e[_0xa7a9('0x17')]));});});}; \ No newline at end of file diff --git a/server/api/whatsappQueue/whatsappQueue.socket.js b/server/api/whatsappQueue/whatsappQueue.socket.js index a06e9db..72c7931 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 _0x7e59=['removeListener','register','length','whatsappQueue:','./whatsappQueue.events','save','remove','emit'];(function(_0x19e8ec,_0x12e4e2){var _0x5bdfa2=function(_0x2fc2f0){while(--_0x2fc2f0){_0x19e8ec['push'](_0x19e8ec['shift']());}};_0x5bdfa2(++_0x12e4e2);}(_0x7e59,0x9c));var _0x97e5=function(_0xc61c38,_0x648013){_0xc61c38=_0xc61c38-0x0;var _0x117e5b=_0x7e59[_0xc61c38];return _0x117e5b;};'use strict';var WhatsappQueueEvents=require(_0x97e5('0x0'));var events=[_0x97e5('0x1'),_0x97e5('0x2'),'update'];function createListener(_0x894a33,_0x58bb3d){return function(_0x3e4c98){_0x58bb3d[_0x97e5('0x3')](_0x894a33,_0x3e4c98);};}function removeListener(_0x5d8826,_0x50ed3b){return function(){WhatsappQueueEvents[_0x97e5('0x4')](_0x5d8826,_0x50ed3b);};}exports[_0x97e5('0x5')]=function(_0x4cc528){for(var _0x588703=0x0,_0x57c08a=events[_0x97e5('0x6')];_0x588703<_0x57c08a;_0x588703++){var _0x46c042=events[_0x588703];var _0x12e78e=createListener(_0x97e5('0x7')+_0x46c042,_0x4cc528);WhatsappQueueEvents['on'](_0x46c042,_0x12e78e);}}; \ No newline at end of file +var _0xcc5b=['remove','update','emit','length','whatsappQueue:','save'];(function(_0x525efd,_0x3a9326){var _0x48b00b=function(_0x19ea05){while(--_0x19ea05){_0x525efd['push'](_0x525efd['shift']());}};_0x48b00b(++_0x3a9326);}(_0xcc5b,0x1d9));var _0xbcc5=function(_0x35936d,_0x507700){_0x35936d=_0x35936d-0x0;var _0xc6dc80=_0xcc5b[_0x35936d];return _0xc6dc80;};'use strict';var WhatsappQueueEvents=require('./whatsappQueue.events');var events=[_0xbcc5('0x0'),_0xbcc5('0x1'),_0xbcc5('0x2')];function createListener(_0x2615f3,_0x476df6){return function(_0x27e5da){_0x476df6[_0xbcc5('0x3')](_0x2615f3,_0x27e5da);};}function removeListener(_0x17bf0a,_0xd5389a){return function(){WhatsappQueueEvents['removeListener'](_0x17bf0a,_0xd5389a);};}exports['register']=function(_0x1ececd){for(var _0x44c4ef=0x0,_0x25fdfd=events[_0xbcc5('0x4')];_0x44c4ef<_0x25fdfd;_0x44c4ef++){var _0x293ce3=events[_0x44c4ef];var _0xff2eb3=createListener(_0xbcc5('0x5')+_0x293ce3,_0x1ececd);WhatsappQueueEvents['on'](_0x293ce3,_0xff2eb3);}}; \ No newline at end of file diff --git a/server/api/whatsappQueueReport/index.js b/server/api/whatsappQueueReport/index.js index 264b6d0..4e099db 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 _0xf531=['update','delete','/:id','destroy','multer','util','path','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./whatsappQueueReport.controller','get','isAuthenticated','describe','post','create','put'];(function(_0x421284,_0x5590ee){var _0x19488e=function(_0x55258c){while(--_0x55258c){_0x421284['push'](_0x421284['shift']());}};_0x19488e(++_0x5590ee);}(_0xf531,0x1df));var _0x1f53=function(_0x45eacc,_0x3727a4){_0x45eacc=_0x45eacc-0x0;var _0x3f1252=_0xf531[_0x45eacc];return _0x3f1252;};'use strict';var multer=require(_0x1f53('0x0'));var util=require(_0x1f53('0x1'));var path=require(_0x1f53('0x2'));var timeout=require('connect-timeout');var express=require(_0x1f53('0x3'));var router=express['Router']();var fs_extra=require(_0x1f53('0x4'));var auth=require(_0x1f53('0x5'));var interaction=require(_0x1f53('0x6'));var config=require(_0x1f53('0x7'));var controller=require(_0x1f53('0x8'));router[_0x1f53('0x9')]('/',auth[_0x1f53('0xa')](),controller['index']);router[_0x1f53('0x9')]('/describe',auth[_0x1f53('0xa')](),controller[_0x1f53('0xb')]);router[_0x1f53('0x9')]('/:id',auth[_0x1f53('0xa')](),controller['show']);router[_0x1f53('0xc')]('/',auth[_0x1f53('0xa')](),controller[_0x1f53('0xd')]);router[_0x1f53('0xe')]('/:id',auth['isAuthenticated'](),controller[_0x1f53('0xf')]);router[_0x1f53('0x10')](_0x1f53('0x11'),auth[_0x1f53('0xa')](),controller[_0x1f53('0x12')]);module['exports']=router; \ No newline at end of file +var _0xe36f=['util','connect-timeout','express','Router','fs-extra','../../components/interaction/service','../../config/environment','get','index','describe','/:id','isAuthenticated','post','put','update','delete','destroy','exports'];(function(_0x99ff94,_0x47a1b1){var _0x1b5bc0=function(_0x25821f){while(--_0x25821f){_0x99ff94['push'](_0x99ff94['shift']());}};_0x1b5bc0(++_0x47a1b1);}(_0xe36f,0x18c));var _0xfe36=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xe36f[_0x3dd15e];return _0x231fd0;};'use strict';var multer=require('multer');var util=require(_0xfe36('0x0'));var path=require('path');var timeout=require(_0xfe36('0x1'));var express=require(_0xfe36('0x2'));var router=express[_0xfe36('0x3')]();var fs_extra=require(_0xfe36('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0xfe36('0x5'));var config=require(_0xfe36('0x6'));var controller=require('./whatsappQueueReport.controller');router[_0xfe36('0x7')]('/',auth['isAuthenticated'](),controller[_0xfe36('0x8')]);router[_0xfe36('0x7')]('/describe',auth['isAuthenticated'](),controller[_0xfe36('0x9')]);router['get'](_0xfe36('0xa'),auth[_0xfe36('0xb')](),controller['show']);router[_0xfe36('0xc')]('/',auth[_0xfe36('0xb')](),controller['create']);router[_0xfe36('0xd')](_0xfe36('0xa'),auth[_0xfe36('0xb')](),controller[_0xfe36('0xe')]);router[_0xfe36('0xf')]('/:id',auth['isAuthenticated'](),controller[_0xfe36('0x10')]);module[_0xfe36('0x11')]=router; \ No newline at end of file diff --git a/server/api/whatsappQueueReport/whatsappQueueReport.attributes.js b/server/api/whatsappQueueReport/whatsappQueueReport.attributes.js index a18d518..9ec3942 100644 --- a/server/api/whatsappQueueReport/whatsappQueueReport.attributes.js +++ b/server/api/whatsappQueueReport/whatsappQueueReport.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x9957=['exports','STRING','DATE','sequelize'];(function(_0x3eddc1,_0x143c45){var _0xce9cd1=function(_0x1583c8){while(--_0x1583c8){_0x3eddc1['push'](_0x3eddc1['shift']());}};_0xce9cd1(++_0x143c45);}(_0x9957,0x93));var _0x7995=function(_0x2dafbe,_0x5d04de){_0x2dafbe=_0x2dafbe-0x0;var _0x58a45a=_0x9957[_0x2dafbe];return _0x58a45a;};'use strict';var Sequelize=require(_0x7995('0x0'));module[_0x7995('0x1')]={'uniqueid':{'type':Sequelize[_0x7995('0x2')],'allowNull':![]},'from':{'type':Sequelize[_0x7995('0x2')]},'joinAt':{'type':Sequelize['DATE']},'leaveAt':{'type':Sequelize[_0x7995('0x3')]},'acceptAt':{'type':Sequelize[_0x7995('0x3')]},'exitAt':{'type':Sequelize[_0x7995('0x3')]},'reason':{'type':Sequelize[_0x7995('0x2')]}}; \ No newline at end of file +var _0x9957=['exports','STRING','DATE','sequelize'];(function(_0x24cd21,_0x3a5022){var _0x2126c4=function(_0x5693ad){while(--_0x5693ad){_0x24cd21['push'](_0x24cd21['shift']());}};_0x2126c4(++_0x3a5022);}(_0x9957,0x93));var _0x7995=function(_0xbca1b1,_0x33f0ce){_0xbca1b1=_0xbca1b1-0x0;var _0x4e1686=_0x9957[_0xbca1b1];return _0x4e1686;};'use strict';var Sequelize=require(_0x7995('0x0'));module[_0x7995('0x1')]={'uniqueid':{'type':Sequelize[_0x7995('0x2')],'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 30a6a50..2287663 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 _0x3266=['query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','limit','order','where','pick','merge','VIRTUAL','filter','includeAll','include','findAll','rows','show','params','keys','options','find','create','body','catch','describe','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','sox','ejs','fs-extra','lodash','crypto','desk.js','to-csv','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','json','offset','count','set','Content-Range','save','update','then','destroy','end','stack','name','send','index','map','WhatsappQueueReport','rawAttributes','type','key','model'];(function(_0xf3c25,_0x3d763b){var _0x83f347=function(_0x57890e){while(--_0x57890e){_0xf3c25['push'](_0xf3c25['shift']());}};_0x83f347(++_0x3d763b);}(_0x3266,0x6a));var _0x6326=function(_0xe45118,_0x5dffbc){_0xe45118=_0xe45118-0x0;var _0x15e15d=_0x3266[_0xe45118];return _0x15e15d;};'use strict';var emlformat=require(_0x6326('0x0'));var rimraf=require(_0x6326('0x1'));var zipdir=require(_0x6326('0x2'));var jsonpatch=require(_0x6326('0x3'));var rp=require(_0x6326('0x4'));var moment=require(_0x6326('0x5'));var BPromise=require(_0x6326('0x6'));var Mustache=require(_0x6326('0x7'));var util=require(_0x6326('0x8'));var path=require('path');var sox=require(_0x6326('0x9'));var csv=require('to-csv');var ejs=require(_0x6326('0xa'));var fs=require('fs');var fs_extra=require(_0x6326('0xb'));var _=require(_0x6326('0xc'));var squel=require('squel');var crypto=require(_0x6326('0xd'));var jsforce=require('jsforce');var deskjs=require(_0x6326('0xe'));var toCsv=require(_0x6326('0xf'));var querystring=require(_0x6326('0x10'));var Papa=require(_0x6326('0x11'));var Redis=require(_0x6326('0x12'));var authService=require('../../components/auth/service');var qs=require(_0x6326('0x13'));var as=require(_0x6326('0x14'));var hardwareService=require(_0x6326('0x15'));var logger=require(_0x6326('0x16'))(_0x6326('0x17'));var utils=require(_0x6326('0x18'));var config=require(_0x6326('0x19'));var licenseUtil=require(_0x6326('0x1a'));var db=require(_0x6326('0x1b'))['db'];function respondWithStatusCode(_0x379358,_0x5c07e1){_0x5c07e1=_0x5c07e1||0xcc;return function(_0x5381d0){if(_0x5381d0){return _0x379358[_0x6326('0x1c')](_0x5c07e1);}return _0x379358[_0x6326('0x1d')](_0x5c07e1)['end']();};}function respondWithResult(_0x425878,_0x4caef3){_0x4caef3=_0x4caef3||0xc8;return function(_0x2d2d9b){if(_0x2d2d9b){return _0x425878[_0x6326('0x1d')](_0x4caef3)[_0x6326('0x1e')](_0x2d2d9b);}};}function respondWithFilteredResult(_0x41c352,_0x1ed3a3){return function(_0x2c1879){if(_0x2c1879){var _0x55923a=typeof _0x1ed3a3[_0x6326('0x1f')]==='undefined'&&typeof _0x1ed3a3['limit']==='undefined';var _0x51e7b9=_0x2c1879['count'];var _0x58e960=_0x55923a?0x0:_0x1ed3a3[_0x6326('0x1f')];var _0x1f4c11=_0x55923a?_0x2c1879[_0x6326('0x20')]:_0x1ed3a3['offset']+_0x1ed3a3['limit'];var _0x954ed5;if(_0x1f4c11>=_0x51e7b9){_0x1f4c11=_0x51e7b9;_0x954ed5=0xc8;}else{_0x954ed5=0xce;}_0x41c352[_0x6326('0x1d')](_0x954ed5);return _0x41c352[_0x6326('0x21')](_0x6326('0x22'),_0x58e960+'-'+_0x1f4c11+'/'+_0x51e7b9)[_0x6326('0x1e')](_0x2c1879);}return null;};}function patchUpdates(_0x25957a){return function(_0x21ee7d){try{jsonpatch['apply'](_0x21ee7d,_0x25957a,!![]);}catch(_0x22307f){return BPromise['reject'](_0x22307f);}return _0x21ee7d[_0x6326('0x23')]();};}function saveUpdates(_0x3c6cfa,_0x2482ef){return function(_0x24fb78){if(_0x24fb78){return _0x24fb78[_0x6326('0x24')](_0x3c6cfa)[_0x6326('0x25')](function(_0x225555){return _0x225555;});}return null;};}function removeEntity(_0x429bb0,_0x4781cc){return function(_0x2d0d00){if(_0x2d0d00){return _0x2d0d00[_0x6326('0x26')]()['then'](function(){_0x429bb0[_0x6326('0x1d')](0xcc)[_0x6326('0x27')]();});}};}function handleEntityNotFound(_0x575701,_0x4e272b){return function(_0x4d28fd){if(!_0x4d28fd){_0x575701[_0x6326('0x1c')](0x194);}return _0x4d28fd;};}function handleError(_0x4dae28,_0x33c466){_0x33c466=_0x33c466||0x1f4;return function(_0x1a48da){logger['error'](_0x1a48da[_0x6326('0x28')]);if(_0x1a48da[_0x6326('0x29')]){delete _0x1a48da[_0x6326('0x29')];}_0x4dae28[_0x6326('0x1d')](_0x33c466)[_0x6326('0x2a')](_0x1a48da);};}exports[_0x6326('0x2b')]=function(_0x40e036,_0x27802c){var _0x461e0f={},_0x127744={},_0x4980f6={'count':0x0,'rows':[]};var _0x2a8873=_[_0x6326('0x2c')](db[_0x6326('0x2d')][_0x6326('0x2e')],function(_0x20c5ab){return{'name':_0x20c5ab['fieldName'],'type':_0x20c5ab[_0x6326('0x2f')][_0x6326('0x30')]};});_0x127744[_0x6326('0x31')]=_['map'](_0x2a8873,_0x6326('0x29'));_0x127744['query']=_['keys'](_0x40e036[_0x6326('0x32')]);_0x127744[_0x6326('0x33')]=_[_0x6326('0x34')](_0x127744[_0x6326('0x31')],_0x127744[_0x6326('0x32')]);_0x461e0f[_0x6326('0x35')]=_[_0x6326('0x34')](_0x127744[_0x6326('0x31')],qs[_0x6326('0x36')](_0x40e036[_0x6326('0x32')][_0x6326('0x36')]));_0x461e0f[_0x6326('0x35')]=_0x461e0f['attributes'][_0x6326('0x37')]?_0x461e0f[_0x6326('0x35')]:_0x127744['model'];if(!_0x40e036[_0x6326('0x32')][_0x6326('0x38')](_0x6326('0x39'))){_0x461e0f['limit']=qs[_0x6326('0x3a')](_0x40e036['query']['limit']);_0x461e0f[_0x6326('0x1f')]=qs[_0x6326('0x1f')](_0x40e036[_0x6326('0x32')]['offset']);}_0x461e0f[_0x6326('0x3b')]=qs['sort'](_0x40e036[_0x6326('0x32')]['sort']);_0x461e0f[_0x6326('0x3c')]=qs[_0x6326('0x33')](_[_0x6326('0x3d')](_0x40e036[_0x6326('0x32')],_0x127744[_0x6326('0x33')]),_0x2a8873);if(_0x40e036[_0x6326('0x32')]['filter']){_0x461e0f[_0x6326('0x3c')]=_[_0x6326('0x3e')](_0x461e0f['where'],{'$or':_[_0x6326('0x2c')](_0x2a8873,function(_0x5ae140){if(_0x5ae140['type']!==_0x6326('0x3f')){var _0x1f8dcf={};_0x1f8dcf[_0x5ae140[_0x6326('0x29')]]={'$like':'%'+_0x40e036[_0x6326('0x32')][_0x6326('0x40')]+'%'};return _0x1f8dcf;}})});}_0x461e0f=_[_0x6326('0x3e')]({},_0x461e0f,_0x40e036['options']);var _0x485bed={'where':_0x461e0f[_0x6326('0x3c')]};return db['WhatsappQueueReport'][_0x6326('0x20')](_0x485bed)['then'](function(_0x282f33){_0x4980f6[_0x6326('0x20')]=_0x282f33;if(_0x40e036[_0x6326('0x32')][_0x6326('0x41')]){_0x461e0f[_0x6326('0x42')]=[{'all':!![]}];}return db[_0x6326('0x2d')][_0x6326('0x43')](_0x461e0f);})[_0x6326('0x25')](function(_0x3b089b){_0x4980f6[_0x6326('0x44')]=_0x3b089b;return _0x4980f6;})[_0x6326('0x25')](respondWithFilteredResult(_0x27802c,_0x461e0f))['catch'](handleError(_0x27802c,null));};exports[_0x6326('0x45')]=function(_0x5ce03a,_0x29f2fd){var _0x1d9d4c={'raw':!![],'where':{'id':_0x5ce03a[_0x6326('0x46')]['id']}},_0x16fc33={};_0x16fc33['model']=_[_0x6326('0x47')](db[_0x6326('0x2d')]['rawAttributes']);_0x16fc33[_0x6326('0x32')]=_[_0x6326('0x47')](_0x5ce03a[_0x6326('0x32')]);_0x16fc33[_0x6326('0x33')]=_['intersection'](_0x16fc33[_0x6326('0x31')],_0x16fc33[_0x6326('0x32')]);_0x1d9d4c[_0x6326('0x35')]=_[_0x6326('0x34')](_0x16fc33[_0x6326('0x31')],qs[_0x6326('0x36')](_0x5ce03a[_0x6326('0x32')]['fields']));_0x1d9d4c[_0x6326('0x35')]=_0x1d9d4c[_0x6326('0x35')][_0x6326('0x37')]?_0x1d9d4c[_0x6326('0x35')]:_0x16fc33['model'];if(_0x5ce03a[_0x6326('0x32')]['includeAll']){_0x1d9d4c[_0x6326('0x42')]=[{'all':!![]}];}_0x1d9d4c=_[_0x6326('0x3e')]({},_0x1d9d4c,_0x5ce03a[_0x6326('0x48')]);return db[_0x6326('0x2d')][_0x6326('0x49')](_0x1d9d4c)['then'](handleEntityNotFound(_0x29f2fd,null))[_0x6326('0x25')](respondWithResult(_0x29f2fd,null))['catch'](handleError(_0x29f2fd,null));};exports['create']=function(_0x2bca12,_0x44cf9d){return db['WhatsappQueueReport'][_0x6326('0x4a')](_0x2bca12[_0x6326('0x4b')],{})[_0x6326('0x25')](respondWithResult(_0x44cf9d,0xc9))[_0x6326('0x4c')](handleError(_0x44cf9d,null));};exports[_0x6326('0x24')]=function(_0x4f8dc0,_0x4af0ee){if(_0x4f8dc0[_0x6326('0x4b')]['id']){delete _0x4f8dc0[_0x6326('0x4b')]['id'];}return db[_0x6326('0x2d')][_0x6326('0x49')]({'where':{'id':_0x4f8dc0[_0x6326('0x46')]['id']}})[_0x6326('0x25')](handleEntityNotFound(_0x4af0ee,null))[_0x6326('0x25')](saveUpdates(_0x4f8dc0['body'],null))[_0x6326('0x25')](respondWithResult(_0x4af0ee,null))[_0x6326('0x4c')](handleError(_0x4af0ee,null));};exports[_0x6326('0x26')]=function(_0x3e7674,_0x1b5e9a){return db['WhatsappQueueReport'][_0x6326('0x49')]({'where':{'id':_0x3e7674['params']['id']}})[_0x6326('0x25')](handleEntityNotFound(_0x1b5e9a,null))[_0x6326('0x25')](removeEntity(_0x1b5e9a,null))['catch'](handleError(_0x1b5e9a,null));};exports[_0x6326('0x4d')]=function(_0x5040b1,_0xaa4c9d){return db[_0x6326('0x2d')][_0x6326('0x4d')]()[_0x6326('0x25')](respondWithResult(_0xaa4c9d,null))['catch'](handleError(_0xaa4c9d,null));}; \ No newline at end of file +var _0x1775=['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','sendStatus','status','end','json','offset','undefined','count','set','Content-Range','apply','reject','save','then','destroy','error','name','send','index','map','WhatsappQueueReport','rawAttributes','fieldName','key','model','keys','query','filters','attributes','intersection','fields','length','hasOwnProperty','nolimit','limit','order','sort','where','filter','merge','type','VIRTUAL','options','includeAll','include','findAll','rows','show','find','catch','create','update','params','describe','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv'];(function(_0x17a11f,_0x40bf5b){var _0xe29634=function(_0xac41ed){while(--_0xac41ed){_0x17a11f['push'](_0x17a11f['shift']());}};_0xe29634(++_0x40bf5b);}(_0x1775,0x1db));var _0x5177=function(_0x502c7d,_0x2f1285){_0x502c7d=_0x502c7d-0x0;var _0x30b7ed=_0x1775[_0x502c7d];return _0x30b7ed;};'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'];function respondWithStatusCode(_0xc613b9,_0x3c4ced){_0x3c4ced=_0x3c4ced||0xcc;return function(_0x111e99){if(_0x111e99){return _0xc613b9[_0x5177('0x1c')](_0x3c4ced);}return _0xc613b9[_0x5177('0x1d')](_0x3c4ced)[_0x5177('0x1e')]();};}function respondWithResult(_0x3e6224,_0x1eb9dd){_0x1eb9dd=_0x1eb9dd||0xc8;return function(_0x41bef4){if(_0x41bef4){return _0x3e6224[_0x5177('0x1d')](_0x1eb9dd)[_0x5177('0x1f')](_0x41bef4);}};}function respondWithFilteredResult(_0x31aff8,_0x1b32e6){return function(_0x175ca6){if(_0x175ca6){var _0x2ab5e5=typeof _0x1b32e6[_0x5177('0x20')]===_0x5177('0x21')&&typeof _0x1b32e6['limit']===_0x5177('0x21');var _0x41e687=_0x175ca6[_0x5177('0x22')];var _0x1b4102=_0x2ab5e5?0x0:_0x1b32e6['offset'];var _0x3e6944=_0x2ab5e5?_0x175ca6[_0x5177('0x22')]:_0x1b32e6[_0x5177('0x20')]+_0x1b32e6['limit'];var _0x86f5f8;if(_0x3e6944>=_0x41e687){_0x3e6944=_0x41e687;_0x86f5f8=0xc8;}else{_0x86f5f8=0xce;}_0x31aff8['status'](_0x86f5f8);return _0x31aff8[_0x5177('0x23')](_0x5177('0x24'),_0x1b4102+'-'+_0x3e6944+'/'+_0x41e687)[_0x5177('0x1f')](_0x175ca6);}return null;};}function patchUpdates(_0x27b732){return function(_0x451e5c){try{jsonpatch[_0x5177('0x25')](_0x451e5c,_0x27b732,!![]);}catch(_0x174c4f){return BPromise[_0x5177('0x26')](_0x174c4f);}return _0x451e5c[_0x5177('0x27')]();};}function saveUpdates(_0x2a95cc,_0x23dad2){return function(_0x3b0c37){if(_0x3b0c37){return _0x3b0c37['update'](_0x2a95cc)[_0x5177('0x28')](function(_0x556f96){return _0x556f96;});}return null;};}function removeEntity(_0x30b60f,_0x2c68d8){return function(_0x3b39b5){if(_0x3b39b5){return _0x3b39b5[_0x5177('0x29')]()['then'](function(){_0x30b60f[_0x5177('0x1d')](0xcc)['end']();});}};}function handleEntityNotFound(_0x564139,_0x19a0c2){return function(_0x15cb93){if(!_0x15cb93){_0x564139['sendStatus'](0x194);}return _0x15cb93;};}function handleError(_0x3285b3,_0x4eba3a){_0x4eba3a=_0x4eba3a||0x1f4;return function(_0x231d35){logger[_0x5177('0x2a')](_0x231d35['stack']);if(_0x231d35[_0x5177('0x2b')]){delete _0x231d35[_0x5177('0x2b')];}_0x3285b3[_0x5177('0x1d')](_0x4eba3a)[_0x5177('0x2c')](_0x231d35);};}exports[_0x5177('0x2d')]=function(_0x1cef5d,_0x5577bb){var _0x498fcd={},_0x45cf20={},_0x1c660e={'count':0x0,'rows':[]};var _0x7dae59=_[_0x5177('0x2e')](db[_0x5177('0x2f')][_0x5177('0x30')],function(_0x31eb9f){return{'name':_0x31eb9f[_0x5177('0x31')],'type':_0x31eb9f['type'][_0x5177('0x32')]};});_0x45cf20[_0x5177('0x33')]=_['map'](_0x7dae59,_0x5177('0x2b'));_0x45cf20['query']=_[_0x5177('0x34')](_0x1cef5d[_0x5177('0x35')]);_0x45cf20[_0x5177('0x36')]=_['intersection'](_0x45cf20['model'],_0x45cf20[_0x5177('0x35')]);_0x498fcd[_0x5177('0x37')]=_[_0x5177('0x38')](_0x45cf20[_0x5177('0x33')],qs[_0x5177('0x39')](_0x1cef5d[_0x5177('0x35')][_0x5177('0x39')]));_0x498fcd[_0x5177('0x37')]=_0x498fcd['attributes'][_0x5177('0x3a')]?_0x498fcd[_0x5177('0x37')]:_0x45cf20['model'];if(!_0x1cef5d[_0x5177('0x35')][_0x5177('0x3b')](_0x5177('0x3c'))){_0x498fcd[_0x5177('0x3d')]=qs[_0x5177('0x3d')](_0x1cef5d[_0x5177('0x35')]['limit']);_0x498fcd[_0x5177('0x20')]=qs[_0x5177('0x20')](_0x1cef5d[_0x5177('0x35')][_0x5177('0x20')]);}_0x498fcd[_0x5177('0x3e')]=qs[_0x5177('0x3f')](_0x1cef5d[_0x5177('0x35')]['sort']);_0x498fcd[_0x5177('0x40')]=qs[_0x5177('0x36')](_['pick'](_0x1cef5d['query'],_0x45cf20[_0x5177('0x36')]),_0x7dae59);if(_0x1cef5d[_0x5177('0x35')][_0x5177('0x41')]){_0x498fcd[_0x5177('0x40')]=_[_0x5177('0x42')](_0x498fcd[_0x5177('0x40')],{'$or':_[_0x5177('0x2e')](_0x7dae59,function(_0x24fd92){if(_0x24fd92[_0x5177('0x43')]!==_0x5177('0x44')){var _0x16fabc={};_0x16fabc[_0x24fd92[_0x5177('0x2b')]]={'$like':'%'+_0x1cef5d[_0x5177('0x35')]['filter']+'%'};return _0x16fabc;}})});}_0x498fcd=_[_0x5177('0x42')]({},_0x498fcd,_0x1cef5d[_0x5177('0x45')]);var _0x4e3677={'where':_0x498fcd[_0x5177('0x40')]};return db['WhatsappQueueReport'][_0x5177('0x22')](_0x4e3677)[_0x5177('0x28')](function(_0x3f02f1){_0x1c660e['count']=_0x3f02f1;if(_0x1cef5d['query'][_0x5177('0x46')]){_0x498fcd[_0x5177('0x47')]=[{'all':!![]}];}return db[_0x5177('0x2f')][_0x5177('0x48')](_0x498fcd);})[_0x5177('0x28')](function(_0x3e710d){_0x1c660e[_0x5177('0x49')]=_0x3e710d;return _0x1c660e;})[_0x5177('0x28')](respondWithFilteredResult(_0x5577bb,_0x498fcd))['catch'](handleError(_0x5577bb,null));};exports[_0x5177('0x4a')]=function(_0x51ecc0,_0x5e3d30){var _0x30e4f3={'raw':!![],'where':{'id':_0x51ecc0['params']['id']}},_0x17dc98={};_0x17dc98[_0x5177('0x33')]=_['keys'](db['WhatsappQueueReport'][_0x5177('0x30')]);_0x17dc98[_0x5177('0x35')]=_[_0x5177('0x34')](_0x51ecc0[_0x5177('0x35')]);_0x17dc98[_0x5177('0x36')]=_[_0x5177('0x38')](_0x17dc98[_0x5177('0x33')],_0x17dc98['query']);_0x30e4f3['attributes']=_[_0x5177('0x38')](_0x17dc98['model'],qs[_0x5177('0x39')](_0x51ecc0[_0x5177('0x35')][_0x5177('0x39')]));_0x30e4f3[_0x5177('0x37')]=_0x30e4f3['attributes'][_0x5177('0x3a')]?_0x30e4f3[_0x5177('0x37')]:_0x17dc98[_0x5177('0x33')];if(_0x51ecc0[_0x5177('0x35')][_0x5177('0x46')]){_0x30e4f3[_0x5177('0x47')]=[{'all':!![]}];}_0x30e4f3=_[_0x5177('0x42')]({},_0x30e4f3,_0x51ecc0[_0x5177('0x45')]);return db[_0x5177('0x2f')][_0x5177('0x4b')](_0x30e4f3)[_0x5177('0x28')](handleEntityNotFound(_0x5e3d30,null))['then'](respondWithResult(_0x5e3d30,null))[_0x5177('0x4c')](handleError(_0x5e3d30,null));};exports['create']=function(_0x58a4e6,_0x5bda8a){return db[_0x5177('0x2f')][_0x5177('0x4d')](_0x58a4e6['body'],{})[_0x5177('0x28')](respondWithResult(_0x5bda8a,0xc9))[_0x5177('0x4c')](handleError(_0x5bda8a,null));};exports[_0x5177('0x4e')]=function(_0x4891fe,_0x1d4ae4){if(_0x4891fe['body']['id']){delete _0x4891fe['body']['id'];}return db['WhatsappQueueReport'][_0x5177('0x4b')]({'where':{'id':_0x4891fe[_0x5177('0x4f')]['id']}})[_0x5177('0x28')](handleEntityNotFound(_0x1d4ae4,null))['then'](saveUpdates(_0x4891fe['body'],null))[_0x5177('0x28')](respondWithResult(_0x1d4ae4,null))['catch'](handleError(_0x1d4ae4,null));};exports[_0x5177('0x29')]=function(_0x9dd7a2,_0x430e8e){return db[_0x5177('0x2f')][_0x5177('0x4b')]({'where':{'id':_0x9dd7a2[_0x5177('0x4f')]['id']}})[_0x5177('0x28')](handleEntityNotFound(_0x430e8e,null))[_0x5177('0x28')](removeEntity(_0x430e8e,null))[_0x5177('0x4c')](handleError(_0x430e8e,null));};exports[_0x5177('0x50')]=function(_0x89fe3a,_0xb08267){return db[_0x5177('0x2f')]['describe']()['then'](respondWithResult(_0xb08267,null))[_0x5177('0x4c')](handleError(_0xb08267,null));}; \ No newline at end of file diff --git a/server/api/whatsappQueueReport/whatsappQueueReport.model.js b/server/api/whatsappQueueReport/whatsappQueueReport.model.js index ab54eab..bddb7e7 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 _0xe682=['uniqueid','lodash','../../config/logger','api','bluebird','request-promise','path','../../config/environment','exports','define','report_whatsapp_queue'];(function(_0x1cd47d,_0x55bc75){var _0x29d52f=function(_0x37737a){while(--_0x37737a){_0x1cd47d['push'](_0x1cd47d['shift']());}};_0x29d52f(++_0x55bc75);}(_0xe682,0x7a));var _0x2e68=function(_0x3626ce,_0x33effa){_0x3626ce=_0x3626ce-0x0;var _0x455327=_0xe682[_0x3626ce];return _0x455327;};'use strict';var _=require(_0x2e68('0x0'));var util=require('util');var logger=require(_0x2e68('0x1'))(_0x2e68('0x2'));var moment=require('moment');var BPromise=require(_0x2e68('0x3'));var rp=require(_0x2e68('0x4'));var fs=require('fs');var path=require(_0x2e68('0x5'));var rimraf=require('rimraf');var config=require(_0x2e68('0x6'));var attributes=require('./whatsappQueueReport.attributes');module[_0x2e68('0x7')]=function(_0xecd394,_0x3d1b99){return _0xecd394[_0x2e68('0x8')]('WhatsappQueueReport',attributes,{'tableName':_0x2e68('0x9'),'paranoid':![],'indexes':[{'name':_0x2e68('0xa'),'fields':[_0x2e68('0xa')]}],'timestamps':!![]});}; \ No newline at end of file +var _0x2fc5=['util','../../config/logger','api','moment','request-promise','path','../../config/environment','./whatsappQueueReport.attributes','exports','define','uniqueid','lodash'];(function(_0x38af48,_0x400460){var _0x445384=function(_0x464435){while(--_0x464435){_0x38af48['push'](_0x38af48['shift']());}};_0x445384(++_0x400460);}(_0x2fc5,0x1bb));var _0x52fc=function(_0x47a5bd,_0x508329){_0x47a5bd=_0x47a5bd-0x0;var _0x5c2184=_0x2fc5[_0x47a5bd];return _0x5c2184;};'use strict';var _=require(_0x52fc('0x0'));var util=require(_0x52fc('0x1'));var logger=require(_0x52fc('0x2'))(_0x52fc('0x3'));var moment=require(_0x52fc('0x4'));var BPromise=require('bluebird');var rp=require(_0x52fc('0x5'));var fs=require('fs');var path=require(_0x52fc('0x6'));var rimraf=require('rimraf');var config=require(_0x52fc('0x7'));var attributes=require(_0x52fc('0x8'));module[_0x52fc('0x9')]=function(_0x386854,_0x3fea9c){return _0x386854[_0x52fc('0xa')]('WhatsappQueueReport',attributes,{'tableName':'report_whatsapp_queue','paranoid':![],'indexes':[{'name':_0x52fc('0xb'),'fields':['uniqueid']}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/whatsappQueueReport/whatsappQueueReport.rpc.js b/server/api/whatsappQueueReport/whatsappQueueReport.rpc.js index 517d51a..e9f9307 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 _0xa5cd=['limit','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','then','info','request\x20sent','debug','stringify','error','WhatsappQueueReport,\x20%s,\x20%s','message','CreateWhatsappQueueReport','WhatsappQueueReport','create','body','options','raw','catch','UpdateWhatsappQueueReport','update','where','attributes'];(function(_0x3ceb54,_0x5bddfd){var _0x26d8a6=function(_0x32e484){while(--_0x32e484){_0x3ceb54['push'](_0x3ceb54['shift']());}};_0x26d8a6(++_0x5bddfd);}(_0xa5cd,0xd3));var _0xda5c=function(_0x45d3f0,_0x4be53f){_0x45d3f0=_0x45d3f0-0x0;var _0x314b79=_0xa5cd[_0x45d3f0];return _0x314b79;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0xda5c('0x0'));var BPromise=require(_0xda5c('0x1'));var rs=require(_0xda5c('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xda5c('0x3'))['db'];var utils=require(_0xda5c('0x4'));var logger=require(_0xda5c('0x5'))(_0xda5c('0x6'));var config=require(_0xda5c('0x7'));var jayson=require(_0xda5c('0x8'));var client=jayson[_0xda5c('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x7006b3,_0x3c2094,_0x2df01d){return new BPromise(function(_0xa18ef3,_0x4ee173){return client['request'](_0x7006b3,_0x2df01d)[_0xda5c('0xa')](function(_0x35dbb7){logger[_0xda5c('0xb')]('WhatsappQueueReport,\x20%s,\x20%s',_0x3c2094,_0xda5c('0xc'));logger[_0xda5c('0xd')]('WhatsappQueueReport,\x20%s,\x20%s,\x20%s',_0x3c2094,'request\x20sent',JSON[_0xda5c('0xe')](_0x35dbb7));if(_0x35dbb7[_0xda5c('0xf')]){if(_0x35dbb7[_0xda5c('0xf')]['code']===0x1f4){logger[_0xda5c('0xf')](_0xda5c('0x10'),_0x3c2094,_0x35dbb7['error'][_0xda5c('0x11')]);return _0x4ee173(_0x35dbb7[_0xda5c('0xf')][_0xda5c('0x11')]);}logger['error'](_0xda5c('0x10'),_0x3c2094,_0x35dbb7[_0xda5c('0xf')][_0xda5c('0x11')]);return _0xa18ef3(_0x35dbb7[_0xda5c('0xf')]['message']);}else{logger[_0xda5c('0xb')]('WhatsappQueueReport,\x20%s,\x20%s',_0x3c2094,_0xda5c('0xc'));_0xa18ef3(_0x35dbb7['result'][_0xda5c('0x11')]);}})['catch'](function(_0x277d61){logger['error'](_0xda5c('0x10'),_0x3c2094,_0x277d61);_0x4ee173(_0x277d61);});});}exports[_0xda5c('0x12')]=function(_0x504391){var _0x2dbdd7=this;return new Promise(function(_0x771326,_0x51a6a2){return db[_0xda5c('0x13')][_0xda5c('0x14')](_0x504391[_0xda5c('0x15')],{'raw':_0x504391[_0xda5c('0x16')]?_0x504391[_0xda5c('0x16')][_0xda5c('0x17')]===undefined?!![]:![]:!![]})[_0xda5c('0xa')](function(_0x44fe7f){logger[_0xda5c('0xb')](_0xda5c('0x12'),_0x504391);logger[_0xda5c('0xd')](_0xda5c('0x12'),_0x504391,JSON['stringify'](_0x44fe7f));_0x771326(_0x44fe7f);})[_0xda5c('0x18')](function(_0x547b51){logger['error']('CreateWhatsappQueueReport',_0x547b51[_0xda5c('0x11')],_0x504391);_0x51a6a2(_0x2dbdd7[_0xda5c('0xf')](0x1f4,_0x547b51[_0xda5c('0x11')]));});});};exports[_0xda5c('0x19')]=function(_0x48aee6){var _0x172350=this;return new Promise(function(_0x9e32b3,_0x530aeb){return db['WhatsappQueueReport'][_0xda5c('0x1a')](_0x48aee6[_0xda5c('0x15')],{'raw':_0x48aee6[_0xda5c('0x16')]?_0x48aee6['options']['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x48aee6['options']?_0x48aee6[_0xda5c('0x16')][_0xda5c('0x1b')]||null:null,'attributes':_0x48aee6[_0xda5c('0x16')]?_0x48aee6['options'][_0xda5c('0x1c')]||null:null,'limit':_0x48aee6[_0xda5c('0x16')]?_0x48aee6['options'][_0xda5c('0x1d')]||null:null})[_0xda5c('0xa')](function(_0x147af7){logger['info'](_0xda5c('0x19'),_0x48aee6);logger['debug'](_0xda5c('0x19'),_0x48aee6,JSON[_0xda5c('0xe')](_0x147af7));_0x9e32b3(_0x147af7);})[_0xda5c('0x18')](function(_0x1394b6){logger[_0xda5c('0xf')](_0xda5c('0x19'),_0x1394b6[_0xda5c('0x11')],_0x48aee6);_0x530aeb(_0x172350['error'](0x1f4,_0x1394b6[_0xda5c('0x11')]));});});}; \ No newline at end of file +var _0x4628=['code','WhatsappQueueReport,\x20%s,\x20%s','message','info','result','catch','CreateWhatsappQueueReport','WhatsappQueueReport','create','body','options','raw','debug','stringify','update','where','attributes','limit','UpdateWhatsappQueueReport','util','randomstring','../../mysqldb','../../config/logger','rpc','client','http','request','then','request\x20sent','WhatsappQueueReport,\x20%s,\x20%s,\x20%s','error'];(function(_0x122a77,_0x39e40d){var _0x41b2ee=function(_0x3be13f){while(--_0x3be13f){_0x122a77['push'](_0x122a77['shift']());}};_0x41b2ee(++_0x39e40d);}(_0x4628,0x70));var _0x8462=function(_0x8ba19a,_0x1d2b2b){_0x8ba19a=_0x8ba19a-0x0;var _0x2bd8b4=_0x4628[_0x8ba19a];return _0x2bd8b4;};'use strict';var _=require('lodash');var util=require(_0x8462('0x0'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0x8462('0x1'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x8462('0x2'))['db'];var utils=require('../../config/utils');var logger=require(_0x8462('0x3'))(_0x8462('0x4'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x8462('0x5')][_0x8462('0x6')]({'port':0x232a});function respondWithRpcPromise(_0xc4c73a,_0x36a09d,_0x470457){return new BPromise(function(_0x578718,_0x1d4de9){return client[_0x8462('0x7')](_0xc4c73a,_0x470457)[_0x8462('0x8')](function(_0x4bc1b0){logger['info']('WhatsappQueueReport,\x20%s,\x20%s',_0x36a09d,_0x8462('0x9'));logger['debug'](_0x8462('0xa'),_0x36a09d,'request\x20sent',JSON['stringify'](_0x4bc1b0));if(_0x4bc1b0[_0x8462('0xb')]){if(_0x4bc1b0['error'][_0x8462('0xc')]===0x1f4){logger[_0x8462('0xb')](_0x8462('0xd'),_0x36a09d,_0x4bc1b0[_0x8462('0xb')][_0x8462('0xe')]);return _0x1d4de9(_0x4bc1b0[_0x8462('0xb')][_0x8462('0xe')]);}logger[_0x8462('0xb')](_0x8462('0xd'),_0x36a09d,_0x4bc1b0[_0x8462('0xb')]['message']);return _0x578718(_0x4bc1b0[_0x8462('0xb')][_0x8462('0xe')]);}else{logger[_0x8462('0xf')](_0x8462('0xd'),_0x36a09d,_0x8462('0x9'));_0x578718(_0x4bc1b0[_0x8462('0x10')]['message']);}})[_0x8462('0x11')](function(_0x6e2118){logger['error'](_0x8462('0xd'),_0x36a09d,_0x6e2118);_0x1d4de9(_0x6e2118);});});}exports[_0x8462('0x12')]=function(_0x2ec4d3){var _0x121c50=this;return new Promise(function(_0x179261,_0x8f8e7e){return db[_0x8462('0x13')][_0x8462('0x14')](_0x2ec4d3[_0x8462('0x15')],{'raw':_0x2ec4d3['options']?_0x2ec4d3[_0x8462('0x16')][_0x8462('0x17')]===undefined?!![]:![]:!![]})[_0x8462('0x8')](function(_0x33281c){logger[_0x8462('0xf')](_0x8462('0x12'),_0x2ec4d3);logger[_0x8462('0x18')](_0x8462('0x12'),_0x2ec4d3,JSON[_0x8462('0x19')](_0x33281c));_0x179261(_0x33281c);})[_0x8462('0x11')](function(_0x2b469b){logger[_0x8462('0xb')](_0x8462('0x12'),_0x2b469b[_0x8462('0xe')],_0x2ec4d3);_0x8f8e7e(_0x121c50[_0x8462('0xb')](0x1f4,_0x2b469b[_0x8462('0xe')]));});});};exports['UpdateWhatsappQueueReport']=function(_0x11ca10){var _0x14a5cb=this;return new Promise(function(_0x39c0bc,_0x5ad9b4){return db['WhatsappQueueReport'][_0x8462('0x1a')](_0x11ca10[_0x8462('0x15')],{'raw':_0x11ca10[_0x8462('0x16')]?_0x11ca10[_0x8462('0x16')][_0x8462('0x17')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x11ca10['options']?_0x11ca10[_0x8462('0x16')][_0x8462('0x1b')]||null:null,'attributes':_0x11ca10[_0x8462('0x16')]?_0x11ca10[_0x8462('0x16')][_0x8462('0x1c')]||null:null,'limit':_0x11ca10[_0x8462('0x16')]?_0x11ca10['options'][_0x8462('0x1d')]||null:null})[_0x8462('0x8')](function(_0x1d7f99){logger[_0x8462('0xf')](_0x8462('0x1e'),_0x11ca10);logger[_0x8462('0x18')]('UpdateWhatsappQueueReport',_0x11ca10,JSON[_0x8462('0x19')](_0x1d7f99));_0x39c0bc(_0x1d7f99);})[_0x8462('0x11')](function(_0x36aed6){logger[_0x8462('0xb')](_0x8462('0x1e'),_0x36aed6['message'],_0x11ca10);_0x5ad9b4(_0x14a5cb[_0x8462('0xb')](0x1f4,_0x36aed6[_0x8462('0xe')]));});});}; \ No newline at end of file diff --git a/server/api/whatsappTransferReport/index.js b/server/api/whatsappTransferReport/index.js index f90795b..bb1a1cf 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 _0x0248=['isAuthenticated','index','get','/describe','/:id','post','create','put','update','delete','destroy','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service'];(function(_0x2318d3,_0x29a3b0){var _0x4bfd76=function(_0x36f9f2){while(--_0x36f9f2){_0x2318d3['push'](_0x2318d3['shift']());}};_0x4bfd76(++_0x29a3b0);}(_0x0248,0xd4));var _0x8024=function(_0x4e352c,_0x1730dd){_0x4e352c=_0x4e352c-0x0;var _0x40b221=_0x0248[_0x4e352c];return _0x40b221;};'use strict';var multer=require(_0x8024('0x0'));var util=require(_0x8024('0x1'));var path=require(_0x8024('0x2'));var timeout=require(_0x8024('0x3'));var express=require(_0x8024('0x4'));var router=express[_0x8024('0x5')]();var fs_extra=require(_0x8024('0x6'));var auth=require('../../components/auth/service');var interaction=require(_0x8024('0x7'));var config=require('../../config/environment');var controller=require('./whatsappTransferReport.controller');router['get']('/',auth[_0x8024('0x8')](),controller[_0x8024('0x9')]);router[_0x8024('0xa')](_0x8024('0xb'),auth['isAuthenticated'](),controller['describe']);router['get'](_0x8024('0xc'),auth[_0x8024('0x8')](),controller['show']);router[_0x8024('0xd')]('/',auth['isAuthenticated'](),controller[_0x8024('0xe')]);router[_0x8024('0xf')](_0x8024('0xc'),auth[_0x8024('0x8')](),controller[_0x8024('0x10')]);router[_0x8024('0x11')]('/:id',auth[_0x8024('0x8')](),controller[_0x8024('0x12')]);module[_0x8024('0x13')]=router; \ No newline at end of file +var _0x6f24=['./whatsappTransferReport.controller','get','isAuthenticated','index','describe','/:id','post','put','update','delete','destroy','exports','multer','util','path','connect-timeout','../../components/interaction/service','../../config/environment'];(function(_0xa6cc5c,_0x239c99){var _0x44803d=function(_0x515b6e){while(--_0x515b6e){_0xa6cc5c['push'](_0xa6cc5c['shift']());}};_0x44803d(++_0x239c99);}(_0x6f24,0x150));var _0x46f2=function(_0xb1cf84,_0x813740){_0xb1cf84=_0xb1cf84-0x0;var _0x4bad2e=_0x6f24[_0xb1cf84];return _0x4bad2e;};'use strict';var multer=require(_0x46f2('0x0'));var util=require(_0x46f2('0x1'));var path=require(_0x46f2('0x2'));var timeout=require(_0x46f2('0x3'));var express=require('express');var router=express['Router']();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0x46f2('0x4'));var config=require(_0x46f2('0x5'));var controller=require(_0x46f2('0x6'));router[_0x46f2('0x7')]('/',auth[_0x46f2('0x8')](),controller[_0x46f2('0x9')]);router[_0x46f2('0x7')]('/describe',auth[_0x46f2('0x8')](),controller[_0x46f2('0xa')]);router[_0x46f2('0x7')](_0x46f2('0xb'),auth[_0x46f2('0x8')](),controller['show']);router[_0x46f2('0xc')]('/',auth[_0x46f2('0x8')](),controller['create']);router[_0x46f2('0xd')]('/:id',auth[_0x46f2('0x8')](),controller[_0x46f2('0xe')]);router[_0x46f2('0xf')](_0x46f2('0xb'),auth[_0x46f2('0x8')](),controller[_0x46f2('0x10')]);module[_0x46f2('0x11')]=router; \ No newline at end of file diff --git a/server/api/whatsappTransferReport/whatsappTransferReport.attributes.js b/server/api/whatsappTransferReport/whatsappTransferReport.attributes.js index 48fd765..d8f9368 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 _0xdcdb=['account','agent','queue','DATE','sequelize','exports','STRING','ENUM'];(function(_0x1780f8,_0x11ba93){var _0x33a410=function(_0x2a015f){while(--_0x2a015f){_0x1780f8['push'](_0x1780f8['shift']());}};_0x33a410(++_0x11ba93);}(_0xdcdb,0x64));var _0xbdcd=function(_0x3505df,_0x129aea){_0x3505df=_0x3505df-0x0;var _0x3cf71e=_0xdcdb[_0x3505df];return _0x3cf71e;};'use strict';var Sequelize=require(_0xbdcd('0x0'));module[_0xbdcd('0x1')]={'uniqueid':{'type':Sequelize[_0xbdcd('0x2')],'allowNull':![]},'type':{'type':Sequelize[_0xbdcd('0x3')](_0xbdcd('0x4'),_0xbdcd('0x5'),_0xbdcd('0x6')),'allowNull':![]},'transferredAt':{'type':Sequelize[_0xbdcd('0x7')]}}; \ No newline at end of file +var _0xe890=['queue','DATE','STRING','ENUM','account','agent'];(function(_0x54e6f5,_0x4f4e99){var _0x5e8794=function(_0x27512b){while(--_0x27512b){_0x54e6f5['push'](_0x54e6f5['shift']());}};_0x5e8794(++_0x4f4e99);}(_0xe890,0x1a6));var _0x0e89=function(_0x120165,_0x1b93cd){_0x120165=_0x120165-0x0;var _0x493e46=_0xe890[_0x120165];return _0x493e46;};'use strict';var Sequelize=require('sequelize');module['exports']={'uniqueid':{'type':Sequelize[_0x0e89('0x0')],'allowNull':![]},'type':{'type':Sequelize[_0x0e89('0x1')](_0x0e89('0x2'),_0x0e89('0x3'),_0x0e89('0x4')),'allowNull':![]},'transferredAt':{'type':Sequelize[_0x0e89('0x5')]}}; \ No newline at end of file diff --git a/server/api/whatsappTransferReport/whatsappTransferReport.controller.js b/server/api/whatsappTransferReport/whatsappTransferReport.controller.js index ef28530..47d74d8 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 _0xb7ea=['apply','save','update','then','destroy','stack','name','send','index','rawAttributes','key','model','query','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','type','options','WhatsappTransferReport','includeAll','findAll','catch','keys','body','params','find','describe','rimraf','zip-dir','bluebird','util','path','sox','to-csv','ejs','fs-extra','lodash','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','json','offset','undefined','limit','count','set','Content-Range'];(function(_0x3947c9,_0x4d6c97){var _0x2e7871=function(_0x1236cc){while(--_0x1236cc){_0x3947c9['push'](_0x3947c9['shift']());}};_0x2e7871(++_0x4d6c97);}(_0xb7ea,0x6a));var _0xab7e=function(_0x3640e2,_0x562103){_0x3640e2=_0x3640e2-0x0;var _0x277415=_0xb7ea[_0x3640e2];return _0x277415;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xab7e('0x0'));var zipdir=require(_0xab7e('0x1'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0xab7e('0x2'));var Mustache=require('mustache');var util=require(_0xab7e('0x3'));var path=require(_0xab7e('0x4'));var sox=require(_0xab7e('0x5'));var csv=require(_0xab7e('0x6'));var ejs=require(_0xab7e('0x7'));var fs=require('fs');var fs_extra=require(_0xab7e('0x8'));var _=require(_0xab7e('0x9'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0xab7e('0xa'));var deskjs=require('desk.js');var toCsv=require(_0xab7e('0x6'));var querystring=require(_0xab7e('0xb'));var Papa=require(_0xab7e('0xc'));var Redis=require(_0xab7e('0xd'));var authService=require(_0xab7e('0xe'));var qs=require(_0xab7e('0xf'));var as=require(_0xab7e('0x10'));var hardwareService=require(_0xab7e('0x11'));var logger=require(_0xab7e('0x12'))('api');var utils=require(_0xab7e('0x13'));var config=require('../../config/environment');var licenseUtil=require(_0xab7e('0x14'));var db=require(_0xab7e('0x15'))['db'];function respondWithStatusCode(_0x4d8803,_0x3bf166){_0x3bf166=_0x3bf166||0xcc;return function(_0xafd35d){if(_0xafd35d){return _0x4d8803[_0xab7e('0x16')](_0x3bf166);}return _0x4d8803[_0xab7e('0x17')](_0x3bf166)[_0xab7e('0x18')]();};}function respondWithResult(_0x1bcd83,_0x4b462b){_0x4b462b=_0x4b462b||0xc8;return function(_0xfc2553){if(_0xfc2553){return _0x1bcd83[_0xab7e('0x17')](_0x4b462b)[_0xab7e('0x19')](_0xfc2553);}};}function respondWithFilteredResult(_0x19dc4e,_0x45352b){return function(_0x193cf3){if(_0x193cf3){var _0xf812c4=typeof _0x45352b[_0xab7e('0x1a')]===_0xab7e('0x1b')&&typeof _0x45352b[_0xab7e('0x1c')]===_0xab7e('0x1b');var _0x5dbde3=_0x193cf3[_0xab7e('0x1d')];var _0x5ce265=_0xf812c4?0x0:_0x45352b[_0xab7e('0x1a')];var _0x585e76=_0xf812c4?_0x193cf3[_0xab7e('0x1d')]:_0x45352b['offset']+_0x45352b['limit'];var _0x2f39ea;if(_0x585e76>=_0x5dbde3){_0x585e76=_0x5dbde3;_0x2f39ea=0xc8;}else{_0x2f39ea=0xce;}_0x19dc4e[_0xab7e('0x17')](_0x2f39ea);return _0x19dc4e[_0xab7e('0x1e')](_0xab7e('0x1f'),_0x5ce265+'-'+_0x585e76+'/'+_0x5dbde3)[_0xab7e('0x19')](_0x193cf3);}return null;};}function patchUpdates(_0x52d25f){return function(_0x1fb180){try{jsonpatch[_0xab7e('0x20')](_0x1fb180,_0x52d25f,!![]);}catch(_0x825e1a){return BPromise['reject'](_0x825e1a);}return _0x1fb180[_0xab7e('0x21')]();};}function saveUpdates(_0x4d8d3a,_0x47ff7a){return function(_0x7616be){if(_0x7616be){return _0x7616be[_0xab7e('0x22')](_0x4d8d3a)[_0xab7e('0x23')](function(_0x3e312d){return _0x3e312d;});}return null;};}function removeEntity(_0x46b69c,_0xb196ca){return function(_0x1d4b38){if(_0x1d4b38){return _0x1d4b38[_0xab7e('0x24')]()['then'](function(){_0x46b69c['status'](0xcc)[_0xab7e('0x18')]();});}};}function handleEntityNotFound(_0x2e7995,_0x379ae0){return function(_0x257fc4){if(!_0x257fc4){_0x2e7995[_0xab7e('0x16')](0x194);}return _0x257fc4;};}function handleError(_0x52ee29,_0x582286){_0x582286=_0x582286||0x1f4;return function(_0x3475fd){logger['error'](_0x3475fd[_0xab7e('0x25')]);if(_0x3475fd[_0xab7e('0x26')]){delete _0x3475fd[_0xab7e('0x26')];}_0x52ee29['status'](_0x582286)[_0xab7e('0x27')](_0x3475fd);};}exports[_0xab7e('0x28')]=function(_0x2d5bd8,_0x52c0b3){var _0x21470e={},_0x52fc3d={},_0x3d8d94={'count':0x0,'rows':[]};var _0x42dd1a=_['map'](db['WhatsappTransferReport'][_0xab7e('0x29')],function(_0x296e4b){return{'name':_0x296e4b['fieldName'],'type':_0x296e4b['type'][_0xab7e('0x2a')]};});_0x52fc3d[_0xab7e('0x2b')]=_['map'](_0x42dd1a,_0xab7e('0x26'));_0x52fc3d[_0xab7e('0x2c')]=_['keys'](_0x2d5bd8[_0xab7e('0x2c')]);_0x52fc3d[_0xab7e('0x2d')]=_[_0xab7e('0x2e')](_0x52fc3d[_0xab7e('0x2b')],_0x52fc3d[_0xab7e('0x2c')]);_0x21470e['attributes']=_['intersection'](_0x52fc3d[_0xab7e('0x2b')],qs[_0xab7e('0x2f')](_0x2d5bd8[_0xab7e('0x2c')][_0xab7e('0x2f')]));_0x21470e[_0xab7e('0x30')]=_0x21470e['attributes'][_0xab7e('0x31')]?_0x21470e[_0xab7e('0x30')]:_0x52fc3d[_0xab7e('0x2b')];if(!_0x2d5bd8[_0xab7e('0x2c')][_0xab7e('0x32')](_0xab7e('0x33'))){_0x21470e[_0xab7e('0x1c')]=qs[_0xab7e('0x1c')](_0x2d5bd8[_0xab7e('0x2c')][_0xab7e('0x1c')]);_0x21470e[_0xab7e('0x1a')]=qs[_0xab7e('0x1a')](_0x2d5bd8[_0xab7e('0x2c')][_0xab7e('0x1a')]);}_0x21470e[_0xab7e('0x34')]=qs[_0xab7e('0x35')](_0x2d5bd8[_0xab7e('0x2c')][_0xab7e('0x35')]);_0x21470e[_0xab7e('0x36')]=qs['filters'](_[_0xab7e('0x37')](_0x2d5bd8[_0xab7e('0x2c')],_0x52fc3d[_0xab7e('0x2d')]),_0x42dd1a);if(_0x2d5bd8['query'][_0xab7e('0x38')]){_0x21470e['where']=_[_0xab7e('0x39')](_0x21470e['where'],{'$or':_['map'](_0x42dd1a,function(_0x304913){if(_0x304913[_0xab7e('0x3a')]!=='VIRTUAL'){var _0x3039e1={};_0x3039e1[_0x304913[_0xab7e('0x26')]]={'$like':'%'+_0x2d5bd8[_0xab7e('0x2c')][_0xab7e('0x38')]+'%'};return _0x3039e1;}})});}_0x21470e=_['merge']({},_0x21470e,_0x2d5bd8[_0xab7e('0x3b')]);var _0x3d0071={'where':_0x21470e[_0xab7e('0x36')]};return db[_0xab7e('0x3c')]['count'](_0x3d0071)[_0xab7e('0x23')](function(_0x19cfe5){_0x3d8d94[_0xab7e('0x1d')]=_0x19cfe5;if(_0x2d5bd8[_0xab7e('0x2c')][_0xab7e('0x3d')]){_0x21470e['include']=[{'all':!![]}];}return db[_0xab7e('0x3c')][_0xab7e('0x3e')](_0x21470e);})[_0xab7e('0x23')](function(_0x17d51d){_0x3d8d94['rows']=_0x17d51d;return _0x3d8d94;})[_0xab7e('0x23')](respondWithFilteredResult(_0x52c0b3,_0x21470e))[_0xab7e('0x3f')](handleError(_0x52c0b3,null));};exports['show']=function(_0x4b7816,_0x4ef3a2){var _0x286b3c={'raw':!![],'where':{'id':_0x4b7816['params']['id']}},_0x5c3f04={};_0x5c3f04[_0xab7e('0x2b')]=_[_0xab7e('0x40')](db['WhatsappTransferReport'][_0xab7e('0x29')]);_0x5c3f04[_0xab7e('0x2c')]=_['keys'](_0x4b7816[_0xab7e('0x2c')]);_0x5c3f04[_0xab7e('0x2d')]=_[_0xab7e('0x2e')](_0x5c3f04[_0xab7e('0x2b')],_0x5c3f04[_0xab7e('0x2c')]);_0x286b3c[_0xab7e('0x30')]=_[_0xab7e('0x2e')](_0x5c3f04['model'],qs['fields'](_0x4b7816[_0xab7e('0x2c')][_0xab7e('0x2f')]));_0x286b3c[_0xab7e('0x30')]=_0x286b3c[_0xab7e('0x30')][_0xab7e('0x31')]?_0x286b3c['attributes']:_0x5c3f04[_0xab7e('0x2b')];if(_0x4b7816[_0xab7e('0x2c')]['includeAll']){_0x286b3c['include']=[{'all':!![]}];}_0x286b3c=_[_0xab7e('0x39')]({},_0x286b3c,_0x4b7816[_0xab7e('0x3b')]);return db[_0xab7e('0x3c')]['find'](_0x286b3c)['then'](handleEntityNotFound(_0x4ef3a2,null))[_0xab7e('0x23')](respondWithResult(_0x4ef3a2,null))[_0xab7e('0x3f')](handleError(_0x4ef3a2,null));};exports['create']=function(_0x459d56,_0x3b1205){return db[_0xab7e('0x3c')]['create'](_0x459d56[_0xab7e('0x41')],{})[_0xab7e('0x23')](respondWithResult(_0x3b1205,0xc9))['catch'](handleError(_0x3b1205,null));};exports[_0xab7e('0x22')]=function(_0x8307ae,_0x361db0){if(_0x8307ae[_0xab7e('0x41')]['id']){delete _0x8307ae[_0xab7e('0x41')]['id'];}return db[_0xab7e('0x3c')]['find']({'where':{'id':_0x8307ae[_0xab7e('0x42')]['id']}})[_0xab7e('0x23')](handleEntityNotFound(_0x361db0,null))['then'](saveUpdates(_0x8307ae[_0xab7e('0x41')],null))[_0xab7e('0x23')](respondWithResult(_0x361db0,null))[_0xab7e('0x3f')](handleError(_0x361db0,null));};exports[_0xab7e('0x24')]=function(_0xc27fc7,_0x36c2b3){return db['WhatsappTransferReport'][_0xab7e('0x43')]({'where':{'id':_0xc27fc7['params']['id']}})['then'](handleEntityNotFound(_0x36c2b3,null))[_0xab7e('0x23')](removeEntity(_0x36c2b3,null))[_0xab7e('0x3f')](handleError(_0x36c2b3,null));};exports[_0xab7e('0x44')]=function(_0x49f0bf,_0x3173f1){return db[_0xab7e('0x3c')]['describe']()['then'](respondWithResult(_0x3173f1,null))[_0xab7e('0x3f')](handleError(_0x3173f1,null));}; \ No newline at end of file +var _0x6db4=['fieldName','type','key','model','map','query','keys','filters','intersection','fields','attributes','length','hasOwnProperty','limit','order','sort','where','pick','merge','VIRTUAL','filter','includeAll','include','findAll','rows','catch','show','params','options','find','create','body','describe','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','path','sox','to-csv','ejs','fs-extra','lodash','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','offset','undefined','count','set','apply','reject','update','then','destroy','end','error','stack','name','send','index','WhatsappTransferReport','rawAttributes'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0x6db4,0x111));var _0x46db=function(_0x41a546,_0x3506ff){_0x41a546=_0x41a546-0x0;var _0x1ab7a=_0x6db4[_0x41a546];return _0x1ab7a;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x46db('0x0'));var zipdir=require(_0x46db('0x1'));var jsonpatch=require(_0x46db('0x2'));var rp=require(_0x46db('0x3'));var moment=require(_0x46db('0x4'));var BPromise=require(_0x46db('0x5'));var Mustache=require('mustache');var util=require(_0x46db('0x6'));var path=require(_0x46db('0x7'));var sox=require(_0x46db('0x8'));var csv=require(_0x46db('0x9'));var ejs=require(_0x46db('0xa'));var fs=require('fs');var fs_extra=require(_0x46db('0xb'));var _=require(_0x46db('0xc'));var squel=require('squel');var crypto=require(_0x46db('0xd'));var jsforce=require(_0x46db('0xe'));var deskjs=require(_0x46db('0xf'));var toCsv=require(_0x46db('0x9'));var querystring=require(_0x46db('0x10'));var Papa=require(_0x46db('0x11'));var Redis=require(_0x46db('0x12'));var authService=require(_0x46db('0x13'));var qs=require(_0x46db('0x14'));var as=require(_0x46db('0x15'));var hardwareService=require(_0x46db('0x16'));var logger=require(_0x46db('0x17'))('api');var utils=require(_0x46db('0x18'));var config=require(_0x46db('0x19'));var licenseUtil=require(_0x46db('0x1a'));var db=require(_0x46db('0x1b'))['db'];function respondWithStatusCode(_0xfd2064,_0xc6d202){_0xc6d202=_0xc6d202||0xcc;return function(_0x44bd9a){if(_0x44bd9a){return _0xfd2064[_0x46db('0x1c')](_0xc6d202);}return _0xfd2064[_0x46db('0x1d')](_0xc6d202)['end']();};}function respondWithResult(_0x54b34d,_0x5f3f69){_0x5f3f69=_0x5f3f69||0xc8;return function(_0x417caf){if(_0x417caf){return _0x54b34d[_0x46db('0x1d')](_0x5f3f69)['json'](_0x417caf);}};}function respondWithFilteredResult(_0x1a79a6,_0x479544){return function(_0x30e5a9){if(_0x30e5a9){var _0x5dccf9=typeof _0x479544[_0x46db('0x1e')]===_0x46db('0x1f')&&typeof _0x479544['limit']===_0x46db('0x1f');var _0x1e6b13=_0x30e5a9[_0x46db('0x20')];var _0x32c5ef=_0x5dccf9?0x0:_0x479544[_0x46db('0x1e')];var _0x34101d=_0x5dccf9?_0x30e5a9[_0x46db('0x20')]:_0x479544[_0x46db('0x1e')]+_0x479544['limit'];var _0x27cfcf;if(_0x34101d>=_0x1e6b13){_0x34101d=_0x1e6b13;_0x27cfcf=0xc8;}else{_0x27cfcf=0xce;}_0x1a79a6[_0x46db('0x1d')](_0x27cfcf);return _0x1a79a6[_0x46db('0x21')]('Content-Range',_0x32c5ef+'-'+_0x34101d+'/'+_0x1e6b13)['json'](_0x30e5a9);}return null;};}function patchUpdates(_0x4fb609){return function(_0x597a95){try{jsonpatch[_0x46db('0x22')](_0x597a95,_0x4fb609,!![]);}catch(_0x270f8d){return BPromise[_0x46db('0x23')](_0x270f8d);}return _0x597a95['save']();};}function saveUpdates(_0x50090f,_0x27aab2){return function(_0x3601e4){if(_0x3601e4){return _0x3601e4[_0x46db('0x24')](_0x50090f)[_0x46db('0x25')](function(_0x443651){return _0x443651;});}return null;};}function removeEntity(_0x2d3688,_0x2bf7b4){return function(_0x3a50dd){if(_0x3a50dd){return _0x3a50dd[_0x46db('0x26')]()[_0x46db('0x25')](function(){_0x2d3688['status'](0xcc)[_0x46db('0x27')]();});}};}function handleEntityNotFound(_0x149e66,_0x1e7acc){return function(_0x408b9f){if(!_0x408b9f){_0x149e66[_0x46db('0x1c')](0x194);}return _0x408b9f;};}function handleError(_0x3134dd,_0x52de86){_0x52de86=_0x52de86||0x1f4;return function(_0x2b6dfe){logger[_0x46db('0x28')](_0x2b6dfe[_0x46db('0x29')]);if(_0x2b6dfe['name']){delete _0x2b6dfe[_0x46db('0x2a')];}_0x3134dd[_0x46db('0x1d')](_0x52de86)[_0x46db('0x2b')](_0x2b6dfe);};}exports[_0x46db('0x2c')]=function(_0x367195,_0x81dc80){var _0x2c66e5={},_0x2f6088={},_0x3c9a4f={'count':0x0,'rows':[]};var _0x3b1d84=_['map'](db[_0x46db('0x2d')][_0x46db('0x2e')],function(_0x531ef2){return{'name':_0x531ef2[_0x46db('0x2f')],'type':_0x531ef2[_0x46db('0x30')][_0x46db('0x31')]};});_0x2f6088[_0x46db('0x32')]=_[_0x46db('0x33')](_0x3b1d84,_0x46db('0x2a'));_0x2f6088[_0x46db('0x34')]=_[_0x46db('0x35')](_0x367195[_0x46db('0x34')]);_0x2f6088[_0x46db('0x36')]=_[_0x46db('0x37')](_0x2f6088[_0x46db('0x32')],_0x2f6088['query']);_0x2c66e5['attributes']=_[_0x46db('0x37')](_0x2f6088[_0x46db('0x32')],qs[_0x46db('0x38')](_0x367195['query'][_0x46db('0x38')]));_0x2c66e5[_0x46db('0x39')]=_0x2c66e5['attributes'][_0x46db('0x3a')]?_0x2c66e5[_0x46db('0x39')]:_0x2f6088[_0x46db('0x32')];if(!_0x367195[_0x46db('0x34')][_0x46db('0x3b')]('nolimit')){_0x2c66e5['limit']=qs[_0x46db('0x3c')](_0x367195[_0x46db('0x34')][_0x46db('0x3c')]);_0x2c66e5[_0x46db('0x1e')]=qs[_0x46db('0x1e')](_0x367195['query'][_0x46db('0x1e')]);}_0x2c66e5[_0x46db('0x3d')]=qs[_0x46db('0x3e')](_0x367195['query']['sort']);_0x2c66e5[_0x46db('0x3f')]=qs[_0x46db('0x36')](_[_0x46db('0x40')](_0x367195[_0x46db('0x34')],_0x2f6088[_0x46db('0x36')]),_0x3b1d84);if(_0x367195[_0x46db('0x34')]['filter']){_0x2c66e5['where']=_[_0x46db('0x41')](_0x2c66e5[_0x46db('0x3f')],{'$or':_['map'](_0x3b1d84,function(_0xb8d443){if(_0xb8d443['type']!==_0x46db('0x42')){var _0x5954fa={};_0x5954fa[_0xb8d443[_0x46db('0x2a')]]={'$like':'%'+_0x367195[_0x46db('0x34')][_0x46db('0x43')]+'%'};return _0x5954fa;}})});}_0x2c66e5=_[_0x46db('0x41')]({},_0x2c66e5,_0x367195['options']);var _0x4a5e3d={'where':_0x2c66e5['where']};return db[_0x46db('0x2d')][_0x46db('0x20')](_0x4a5e3d)[_0x46db('0x25')](function(_0x4755c0){_0x3c9a4f['count']=_0x4755c0;if(_0x367195[_0x46db('0x34')][_0x46db('0x44')]){_0x2c66e5[_0x46db('0x45')]=[{'all':!![]}];}return db[_0x46db('0x2d')][_0x46db('0x46')](_0x2c66e5);})[_0x46db('0x25')](function(_0x3f31e1){_0x3c9a4f[_0x46db('0x47')]=_0x3f31e1;return _0x3c9a4f;})[_0x46db('0x25')](respondWithFilteredResult(_0x81dc80,_0x2c66e5))[_0x46db('0x48')](handleError(_0x81dc80,null));};exports[_0x46db('0x49')]=function(_0xb94272,_0x376285){var _0x41fb0a={'raw':!![],'where':{'id':_0xb94272[_0x46db('0x4a')]['id']}},_0x1e9cde={};_0x1e9cde['model']=_[_0x46db('0x35')](db[_0x46db('0x2d')][_0x46db('0x2e')]);_0x1e9cde[_0x46db('0x34')]=_[_0x46db('0x35')](_0xb94272['query']);_0x1e9cde[_0x46db('0x36')]=_[_0x46db('0x37')](_0x1e9cde[_0x46db('0x32')],_0x1e9cde[_0x46db('0x34')]);_0x41fb0a[_0x46db('0x39')]=_[_0x46db('0x37')](_0x1e9cde[_0x46db('0x32')],qs[_0x46db('0x38')](_0xb94272['query']['fields']));_0x41fb0a[_0x46db('0x39')]=_0x41fb0a[_0x46db('0x39')][_0x46db('0x3a')]?_0x41fb0a[_0x46db('0x39')]:_0x1e9cde['model'];if(_0xb94272[_0x46db('0x34')][_0x46db('0x44')]){_0x41fb0a[_0x46db('0x45')]=[{'all':!![]}];}_0x41fb0a=_[_0x46db('0x41')]({},_0x41fb0a,_0xb94272[_0x46db('0x4b')]);return db[_0x46db('0x2d')][_0x46db('0x4c')](_0x41fb0a)[_0x46db('0x25')](handleEntityNotFound(_0x376285,null))[_0x46db('0x25')](respondWithResult(_0x376285,null))[_0x46db('0x48')](handleError(_0x376285,null));};exports['create']=function(_0x20ec6d,_0x49acb1){return db[_0x46db('0x2d')][_0x46db('0x4d')](_0x20ec6d[_0x46db('0x4e')],{})[_0x46db('0x25')](respondWithResult(_0x49acb1,0xc9))[_0x46db('0x48')](handleError(_0x49acb1,null));};exports['update']=function(_0xa4dd63,_0xd469f){if(_0xa4dd63['body']['id']){delete _0xa4dd63[_0x46db('0x4e')]['id'];}return db[_0x46db('0x2d')]['find']({'where':{'id':_0xa4dd63[_0x46db('0x4a')]['id']}})[_0x46db('0x25')](handleEntityNotFound(_0xd469f,null))['then'](saveUpdates(_0xa4dd63['body'],null))['then'](respondWithResult(_0xd469f,null))['catch'](handleError(_0xd469f,null));};exports[_0x46db('0x26')]=function(_0x4c0238,_0x17a702){return db[_0x46db('0x2d')][_0x46db('0x4c')]({'where':{'id':_0x4c0238['params']['id']}})[_0x46db('0x25')](handleEntityNotFound(_0x17a702,null))[_0x46db('0x25')](removeEntity(_0x17a702,null))[_0x46db('0x48')](handleError(_0x17a702,null));};exports[_0x46db('0x4f')]=function(_0x4b4ee3,_0x399422){return db[_0x46db('0x2d')]['describe']()['then'](respondWithResult(_0x399422,null))['catch'](handleError(_0x399422,null));}; \ No newline at end of file diff --git a/server/api/whatsappTransferReport/whatsappTransferReport.model.js b/server/api/whatsappTransferReport/whatsappTransferReport.model.js index 593cfe8..7ad615a 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 _0x9761=['bluebird','request-promise','rimraf','./whatsappTransferReport.attributes','exports','define','WhatsappTransferReport','report_whatsapp_transfer','uniqueid','lodash','util','../../config/logger','moment'];(function(_0x52121d,_0x1d1704){var _0x448627=function(_0x495bf0){while(--_0x495bf0){_0x52121d['push'](_0x52121d['shift']());}};_0x448627(++_0x1d1704);}(_0x9761,0xf3));var _0x1976=function(_0x11b259,_0x322aa3){_0x11b259=_0x11b259-0x0;var _0x57dba4=_0x9761[_0x11b259];return _0x57dba4;};'use strict';var _=require(_0x1976('0x0'));var util=require(_0x1976('0x1'));var logger=require(_0x1976('0x2'))('api');var moment=require(_0x1976('0x3'));var BPromise=require(_0x1976('0x4'));var rp=require(_0x1976('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x1976('0x6'));var config=require('../../config/environment');var attributes=require(_0x1976('0x7'));module[_0x1976('0x8')]=function(_0x1b8195,_0x30e161){return _0x1b8195[_0x1976('0x9')](_0x1976('0xa'),attributes,{'tableName':_0x1976('0xb'),'paranoid':![],'indexes':[{'name':'uniqueid','fields':[_0x1976('0xc')]}],'timestamps':!![]});}; \ No newline at end of file +var _0xdf53=['bluebird','request-promise','path','../../config/environment','exports','report_whatsapp_transfer','uniqueid','lodash','util','api','moment'];(function(_0x2b70df,_0x224881){var _0x44b705=function(_0x4d79f0){while(--_0x4d79f0){_0x2b70df['push'](_0x2b70df['shift']());}};_0x44b705(++_0x224881);}(_0xdf53,0x151));var _0x3df5=function(_0x5b644e,_0x2e5e07){_0x5b644e=_0x5b644e-0x0;var _0x49c6bf=_0xdf53[_0x5b644e];return _0x49c6bf;};'use strict';var _=require(_0x3df5('0x0'));var util=require(_0x3df5('0x1'));var logger=require('../../config/logger')(_0x3df5('0x2'));var moment=require(_0x3df5('0x3'));var BPromise=require(_0x3df5('0x4'));var rp=require(_0x3df5('0x5'));var fs=require('fs');var path=require(_0x3df5('0x6'));var rimraf=require('rimraf');var config=require(_0x3df5('0x7'));var attributes=require('./whatsappTransferReport.attributes');module[_0x3df5('0x8')]=function(_0x1b738f,_0x464d7d){return _0x1b738f['define']('WhatsappTransferReport',attributes,{'tableName':_0x3df5('0x9'),'paranoid':![],'indexes':[{'name':_0x3df5('0xa'),'fields':[_0x3df5('0xa')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/whatsappTransferReport/whatsappTransferReport.rpc.js b/server/api/whatsappTransferReport/whatsappTransferReport.rpc.js index 2fbafd3..0fef8ee 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 _0x8445=['message','WhatsappTransferReport,\x20%s,\x20%s','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','request','then','info','request\x20sent','debug','WhatsappTransferReport,\x20%s,\x20%s,\x20%s','stringify','error','code'];(function(_0x59ee6f,_0x450239){var _0x4c0979=function(_0x565e92){while(--_0x565e92){_0x59ee6f['push'](_0x59ee6f['shift']());}};_0x4c0979(++_0x450239);}(_0x8445,0x77));var _0x5844=function(_0x38690b,_0x158905){_0x38690b=_0x38690b-0x0;var _0x1478e7=_0x8445[_0x38690b];return _0x1478e7;};'use strict';var _=require(_0x5844('0x0'));var util=require(_0x5844('0x1'));var moment=require(_0x5844('0x2'));var BPromise=require(_0x5844('0x3'));var rs=require(_0x5844('0x4'));var fs=require('fs');var Redis=require(_0x5844('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0x5844('0x6'));var logger=require(_0x5844('0x7'))(_0x5844('0x8'));var config=require(_0x5844('0x9'));var jayson=require('jayson/promise');var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x195d35,_0x322863,_0x448480){return new BPromise(function(_0x490e4c,_0x2f8ec6){return client[_0x5844('0xa')](_0x195d35,_0x448480)[_0x5844('0xb')](function(_0xd467ff){logger[_0x5844('0xc')]('WhatsappTransferReport,\x20%s,\x20%s',_0x322863,_0x5844('0xd'));logger[_0x5844('0xe')](_0x5844('0xf'),_0x322863,_0x5844('0xd'),JSON[_0x5844('0x10')](_0xd467ff));if(_0xd467ff['error']){if(_0xd467ff[_0x5844('0x11')][_0x5844('0x12')]===0x1f4){logger[_0x5844('0x11')]('WhatsappTransferReport,\x20%s,\x20%s',_0x322863,_0xd467ff['error'][_0x5844('0x13')]);return _0x2f8ec6(_0xd467ff[_0x5844('0x11')][_0x5844('0x13')]);}logger[_0x5844('0x11')](_0x5844('0x14'),_0x322863,_0xd467ff[_0x5844('0x11')]['message']);return _0x490e4c(_0xd467ff['error'][_0x5844('0x13')]);}else{logger[_0x5844('0xc')]('WhatsappTransferReport,\x20%s,\x20%s',_0x322863,_0x5844('0xd'));_0x490e4c(_0xd467ff[_0x5844('0x15')][_0x5844('0x13')]);}})[_0x5844('0x16')](function(_0x34bbbf){logger[_0x5844('0x11')](_0x5844('0x14'),_0x322863,_0x34bbbf);_0x2f8ec6(_0x34bbbf);});});} \ No newline at end of file +var _0xc8f0=['result','catch','util','moment','bluebird','ioredis','../../config/utils','../../config/logger','jayson/promise','client','request','then','info','WhatsappTransferReport,\x20%s,\x20%s','request\x20sent','debug','WhatsappTransferReport,\x20%s,\x20%s,\x20%s','stringify','error','message'];(function(_0x2d95a1,_0x280e71){var _0x243853=function(_0x2b3a1e){while(--_0x2b3a1e){_0x2d95a1['push'](_0x2d95a1['shift']());}};_0x243853(++_0x280e71);}(_0xc8f0,0x16a));var _0x0c8f=function(_0x419937,_0x200d3a){_0x419937=_0x419937-0x0;var _0x2d2587=_0xc8f0[_0x419937];return _0x2d2587;};'use strict';var _=require('lodash');var util=require(_0x0c8f('0x0'));var moment=require(_0x0c8f('0x1'));var BPromise=require(_0x0c8f('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x0c8f('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x0c8f('0x4'));var logger=require(_0x0c8f('0x5'))('rpc');var config=require('../../config/environment');var jayson=require(_0x0c8f('0x6'));var client=jayson[_0x0c8f('0x7')]['http']({'port':0x232a});function respondWithRpcPromise(_0x1a8e65,_0x526921,_0x417d99){return new BPromise(function(_0x344617,_0x26292b){return client[_0x0c8f('0x8')](_0x1a8e65,_0x417d99)[_0x0c8f('0x9')](function(_0x5e70d4){logger[_0x0c8f('0xa')](_0x0c8f('0xb'),_0x526921,_0x0c8f('0xc'));logger[_0x0c8f('0xd')](_0x0c8f('0xe'),_0x526921,_0x0c8f('0xc'),JSON[_0x0c8f('0xf')](_0x5e70d4));if(_0x5e70d4[_0x0c8f('0x10')]){if(_0x5e70d4[_0x0c8f('0x10')]['code']===0x1f4){logger[_0x0c8f('0x10')]('WhatsappTransferReport,\x20%s,\x20%s',_0x526921,_0x5e70d4[_0x0c8f('0x10')][_0x0c8f('0x11')]);return _0x26292b(_0x5e70d4['error'][_0x0c8f('0x11')]);}logger[_0x0c8f('0x10')](_0x0c8f('0xb'),_0x526921,_0x5e70d4[_0x0c8f('0x10')][_0x0c8f('0x11')]);return _0x344617(_0x5e70d4['error'][_0x0c8f('0x11')]);}else{logger[_0x0c8f('0xa')](_0x0c8f('0xb'),_0x526921,_0x0c8f('0xc'));_0x344617(_0x5e70d4[_0x0c8f('0x12')][_0x0c8f('0x11')]);}})[_0x0c8f('0x13')](function(_0x37605b){logger[_0x0c8f('0x10')](_0x0c8f('0xb'),_0x526921,_0x37605b);_0x26292b(_0x37605b);});});} \ No newline at end of file diff --git a/server/app.js b/server/app.js index f90bdd0..a4af678 100644 --- a/server/app.js +++ b/server/app.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x102b=['\x20processes\x20failed\x20at\x20startup:\x20','map','Online\x20apps:','join','Offline\x20apps:','status','online','name','log','App\x20Ready!','Server\x20failed\x20to\x20start\x20due\x20to\x20error!','error','Server\x20failed\x20to\x20start\x20due\x20to\x20error:\x20%s','exit','./mysqldb','./config/license','./rpc','./config/environment','./config/logger','app','./config/pm2','./config/pm2/config','./config/schedule','./config/schedule/whatsapp','./config/schedule/transcribe','./config/schedule/cloud-provider','sequelize','sync','seedDB','default','then','start','info','filter','exitCode','length'];(function(_0x42cae2,_0x284ef8){var _0x5f256f=function(_0x41abc8){while(--_0x41abc8){_0x42cae2['push'](_0x42cae2['shift']());}};_0x5f256f(++_0x284ef8);}(_0x102b,0x1be));var _0xb102=function(_0x23ca48,_0x52df82){_0x23ca48=_0x23ca48-0x0;var _0x88ed76=_0x102b[_0x23ca48];return _0x88ed76;};'use strict';var _=require('lodash');var db=require(_0xb102('0x0'))['db'];var seedDb=require('./config/seedDB');var checkLicense=require(_0xb102('0x1'));var rpc=require(_0xb102('0x2'));var config=require(_0xb102('0x3'));var logger=require(_0xb102('0x4'))(_0xb102('0x5'));var pm2=require(_0xb102('0x6'));var pm2Config=require(_0xb102('0x7'));var schedule=require(_0xb102('0x8'));var chat=require('./config/schedule/chat');var whatsapp=require(_0xb102('0x9'));var transcribe=require(_0xb102('0xa'));var provider=require(_0xb102('0xb'));function main(){return db[_0xb102('0xc')][_0xb102('0xd')]()['then'](function(){if(config[_0xb102('0xe')]){return seedDb['default']();}})['then'](function(){return checkLicense[_0xb102('0xf')]();})['then'](function(){return rpc['listen']();})[_0xb102('0x10')](function(_0x19f257){logger['info'](_0x19f257);return chat[_0xb102('0x11')]();})[_0xb102('0x10')](function(){return whatsapp[_0xb102('0x11')]();})[_0xb102('0x10')](function(){return schedule[_0xb102('0x11')]();})[_0xb102('0x10')](function(){return transcribe[_0xb102('0x11')]();})['then'](function(){return provider[_0xb102('0x11')]();})['then'](function(_0x2327ee){logger[_0xb102('0x12')](_0x2327ee);return pm2['start'](pm2Config);})[_0xb102('0x10')](function(_0x38db8c){var _0x5ab722=_0x38db8c[_0xb102('0x13')](function(_0x2925fb){return typeof _0x2925fb[_0xb102('0x14')]==='number'&&_0x2925fb['exitCode']>=0x0;});if(_0x5ab722['length']>0x0){throw new Error(_0x5ab722[_0xb102('0x15')]+_0xb102('0x16')+_[_0xb102('0x17')](_0x5ab722,function(_0xc80615){return'\x22'+_0xc80615['pm2_env']['name']+'\x22';}));}logger[_0xb102('0x12')](_0xb102('0x18'),_[_0xb102('0x17')](_[_0xb102('0x13')](_0x38db8c,{'status':'online'}),'name')[_0xb102('0x19')]());logger[_0xb102('0x12')](_0xb102('0x1a'),_[_0xb102('0x17')](_['filter'](_0x38db8c,function(_0xd2206b){return _0xd2206b[_0xb102('0x1b')]!==_0xb102('0x1c');}),_0xb102('0x1d'))['join']()||'None');console[_0xb102('0x1e')](_0xb102('0x1f'));})['catch'](function(_0x1752f1){console['log'](_0xb102('0x20'),_0x1752f1);logger[_0xb102('0x21')](_0xb102('0x22'),_0x1752f1);process[_0xb102('0x23')](0x1);});}main(); \ No newline at end of file +var _0x24ce=['seedDB','default','listen','info','start','filter','number','exitCode','length','\x20processes\x20failed\x20at\x20startup:\x20','map','pm2_env','name','Online\x20apps:','join','status','online','App\x20Ready!','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','app','./config/schedule','./config/schedule/chat','./config/schedule/whatsapp','./config/schedule/transcribe','./config/schedule/cloud-provider','sync','then'];(function(_0x4c8d0f,_0x10d958){var _0x20ea2e=function(_0x45c067){while(--_0x45c067){_0x4c8d0f['push'](_0x4c8d0f['shift']());}};_0x20ea2e(++_0x10d958);}(_0x24ce,0x1de));var _0xe24c=function(_0x4fdff1,_0x3c03ce){_0x4fdff1=_0x4fdff1-0x0;var _0x4302b9=_0x24ce[_0x4fdff1];return _0x4302b9;};'use strict';var _=require('lodash');var db=require(_0xe24c('0x0'))['db'];var seedDb=require(_0xe24c('0x1'));var checkLicense=require(_0xe24c('0x2'));var rpc=require(_0xe24c('0x3'));var config=require('./config/environment');var logger=require('./config/logger')(_0xe24c('0x4'));var pm2=require('./config/pm2');var pm2Config=require('./config/pm2/config');var schedule=require(_0xe24c('0x5'));var chat=require(_0xe24c('0x6'));var whatsapp=require(_0xe24c('0x7'));var transcribe=require(_0xe24c('0x8'));var provider=require(_0xe24c('0x9'));function main(){return db['sequelize'][_0xe24c('0xa')]()[_0xe24c('0xb')](function(){if(config[_0xe24c('0xc')]){return seedDb[_0xe24c('0xd')]();}})[_0xe24c('0xb')](function(){return checkLicense[_0xe24c('0xd')]();})[_0xe24c('0xb')](function(){return rpc[_0xe24c('0xe')]();})[_0xe24c('0xb')](function(_0x7b13c){logger[_0xe24c('0xf')](_0x7b13c);return chat[_0xe24c('0x10')]();})[_0xe24c('0xb')](function(){return whatsapp['start']();})[_0xe24c('0xb')](function(){return schedule['start']();})[_0xe24c('0xb')](function(){return transcribe['start']();})[_0xe24c('0xb')](function(){return provider[_0xe24c('0x10')]();})['then'](function(_0x572824){logger['info'](_0x572824);return pm2[_0xe24c('0x10')](pm2Config);})['then'](function(_0x1cb6c0){var _0x3446cf=_0x1cb6c0[_0xe24c('0x11')](function(_0x33979b){return typeof _0x33979b['exitCode']===_0xe24c('0x12')&&_0x33979b[_0xe24c('0x13')]>=0x0;});if(_0x3446cf[_0xe24c('0x14')]>0x0){throw new Error(_0x3446cf[_0xe24c('0x14')]+_0xe24c('0x15')+_[_0xe24c('0x16')](_0x3446cf,function(_0xbd9e1d){return'\x22'+_0xbd9e1d[_0xe24c('0x17')][_0xe24c('0x18')]+'\x22';}));}logger[_0xe24c('0xf')](_0xe24c('0x19'),_[_0xe24c('0x16')](_[_0xe24c('0x11')](_0x1cb6c0,{'status':'online'}),_0xe24c('0x18'))[_0xe24c('0x1a')]());logger[_0xe24c('0xf')]('Offline\x20apps:',_[_0xe24c('0x16')](_[_0xe24c('0x11')](_0x1cb6c0,function(_0x2462f2){return _0x2462f2[_0xe24c('0x1b')]!==_0xe24c('0x1c');}),_0xe24c('0x18'))['join']()||'None');console['log'](_0xe24c('0x1d'));})['catch'](function(_0x5d307c){console[_0xe24c('0x1e')](_0xe24c('0x1f'),_0x5d307c);logger[_0xe24c('0x20')](_0xe24c('0x21'),_0x5d307c);process[_0xe24c('0x22')](0x1);});}main(); \ No newline at end of file diff --git a/server/components/auth/service.js b/server/components/auth/service.js index 3e48e52..1247049 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 _0x4cf8=['Setting','allowedLoginAttempts','blockDuration','isEqual','apiKeyNonce','API\x20access\x20key\x20is\x20not\x20valid\x20anymore','disabled','Invalid\x20API\x20access\x20key','blocked','blockedAt','add','minutes','catch','User\x20object\x20not\x20found.','update','isWebrtcLicence','getLicense','webrtc','Forbidden','isMiddleware','signToken','setTokenCookie','cookie','motion.token','redirect','/dashboards/general','retrieveApiKey','isNil','apiKeyIat','regenerateApiKey','Please\x20use\x20the\x20previous\x20API\x20access\x20key\x20to\x20generate\x20a\x20new\x20one','validatePasswordPattern','test','ValidationError','validatePasswordHistory','decryptString','split','toLowerCase','The\x20password\x20must\x20be\x20different\x20from\x20the\x20last\x20one.\x20Please\x20choose\x20another\x20one.','Sequelize','updatePasswordsHistory','length','splice','unshift','encryptString','join','sign','secret','session','options','promisify','verify','randomBytes','toString','HS512','../../mysqldb','../../config/environment','../../config/license/hardware','../../config/license/util','../encryptor','lodash','jsonwebtoken','express-jwt','composable-middleware','basic-auth','crypto','bluebird','secrets','role','fullname','internal','email','permissions','md5secret','voicePause','chatPause','faxPause','smsPause','showWebBar','lastLoginAt','lastPauseAt','crudPermissions','allowmessenger','passwordResetAt','alias','phoneBarAutoAnswer','phoneBarAutoAnswerDelay','phoneBarDnd','phoneBarEnableRecording','phoneBarEnableDtmfTone','phoneBarEnableSettings','phoneBarExpires','phoneBarPrefixRequired','phoneBarRemoteControl','phoneBarRemoteControlPort','hotdesk','interface','privacyEnabled','settingsEnabled','wssPort','downloadVoiceRecordings','downloadOmnichannelInteractions','downloadAttachments','ignorePauseForPreviewCalls','chatAutoanswerDelay','emailAutoanswer','emailAutoanswerDelay','smsAutoanswer','smsAutoanswerDelay','openchannelAutoanswerDelay','faxAutoanswer','faxAutoanswerDelay','whatsappAutoanswer','whatsappAutoanswerDelay','isChatInteractionAuthorized','isAuthenticated','use','user','findOne','params','closed','disposition','then','status','unmanaged','Unmanaged.','Forbidden.','headers','authorization','startsWith','Basic','User','authenticate','pass','json','Wrong\x20credentials.','Unknown\x20authorization\x20format','query','apikey','getUuid','find','sub'];(function(_0x46f3f8,_0x12c74b){var _0xbc57cd=function(_0x34df37){while(--_0x34df37){_0x46f3f8['push'](_0x46f3f8['shift']());}};_0xbc57cd(++_0x12c74b);}(_0x4cf8,0x1e1));var _0x84cf=function(_0x5d31f3,_0x4239b0){_0x5d31f3=_0x5d31f3-0x0;var _0x1cc88c=_0x4cf8[_0x5d31f3];return _0x1cc88c;};'use strict';var db=require(_0x84cf('0x0'))['db'];var config=require(_0x84cf('0x1'));var hardwareConf=require(_0x84cf('0x2'));var licenseUtil=require(_0x84cf('0x3'));var encryptor=require(_0x84cf('0x4'));var _=require(_0x84cf('0x5'));var jwt=require(_0x84cf('0x6'));var expressJwt=require(_0x84cf('0x7'));var compose=require(_0x84cf('0x8'));var basicAuth=require(_0x84cf('0x9'));var crypto=require(_0x84cf('0xa'));var BPromise=require(_0x84cf('0xb'));var util=require('util');var moment=require('moment');var validateJwt=expressJwt({'secret':config[_0x84cf('0xc')]['session']});var userAttributes=['id',_0x84cf('0xd'),_0x84cf('0xe'),'name',_0x84cf('0xf'),_0x84cf('0x10'),'userpic',_0x84cf('0x11'),_0x84cf('0x12'),_0x84cf('0x13'),_0x84cf('0x14'),'mailPause',_0x84cf('0x15'),_0x84cf('0x16'),'openchannelPause','pauseType',_0x84cf('0x17'),_0x84cf('0x18'),_0x84cf('0x19'),_0x84cf('0x1a'),_0x84cf('0x1b'),_0x84cf('0x1c'),_0x84cf('0x1d'),_0x84cf('0x1e'),_0x84cf('0x1f'),_0x84cf('0x20'),_0x84cf('0x21'),_0x84cf('0x22'),_0x84cf('0x23'),_0x84cf('0x24'),_0x84cf('0x25'),_0x84cf('0x26'),_0x84cf('0x27'),_0x84cf('0x28'),_0x84cf('0x29'),'userProfileId',_0x84cf('0x2a'),_0x84cf('0x2b'),_0x84cf('0x2c'),_0x84cf('0x2d'),_0x84cf('0x2e'),_0x84cf('0x2f'),_0x84cf('0x30'),'selectRecallMeCampaign','chatAutoanswer',_0x84cf('0x31'),_0x84cf('0x32'),_0x84cf('0x33'),_0x84cf('0x34'),_0x84cf('0x35'),'openchannelAutoanswer',_0x84cf('0x36'),_0x84cf('0x37'),_0x84cf('0x38'),_0x84cf('0x39'),_0x84cf('0x3a'),'messengerSoundNotification'];exports[_0x84cf('0x3b')]=function(){return this[_0x84cf('0x3c')](!![])[_0x84cf('0x3d')](function(_0x23e1e7,_0x3e5e94,_0x29e9e1){if(_0x23e1e7[_0x84cf('0x3e')]){_0x29e9e1();}else{return db['ChatInteraction'][_0x84cf('0x3f')]({'where':{'id':_0x23e1e7[_0x84cf('0x40')]['id']},'attributes':['id',_0x84cf('0x41'),_0x84cf('0x42')],'raw':!![]})[_0x84cf('0x43')](function(_0x44d4bf){if(_0x44d4bf&&_0x44d4bf[_0x84cf('0x41')]){return _0x3e5e94[_0x84cf('0x44')](_0x44d4bf[_0x84cf('0x42')]===_0x84cf('0x45')?0x195:0x193)['json']({'message':_0x44d4bf[_0x84cf('0x42')]===_0x84cf('0x45')?_0x84cf('0x46'):_0x84cf('0x47')});}else{_0x29e9e1();}})['catch'](function(_0x1595dd){_0x29e9e1(_0x1595dd);});}});};exports['isAuthenticated']=function isAuthenticated(_0x29455e){return compose()[_0x84cf('0x3d')](function(_0x43b41b,_0xc15298,_0x51adcf){var _0x20de4b;if(_0x43b41b[_0x84cf('0x48')][_0x84cf('0x49')]){if(_[_0x84cf('0x4a')](_0x43b41b[_0x84cf('0x48')][_0x84cf('0x49')],_0x84cf('0x4b'))){var _0x18243d=basicAuth(_0x43b41b);db[_0x84cf('0x4c')]['find']({'where':{'name':_0x18243d['name']}})[_0x84cf('0x43')](function(_0x25de3a){if(!_0x25de3a||!_0x25de3a[_0x84cf('0x4d')](_0x18243d[_0x84cf('0x4e')])){return _0xc15298[_0x84cf('0x44')](0x191)[_0x84cf('0x4f')]({'message':_0x84cf('0x50')});}_0x43b41b[_0x84cf('0x3e')]={'id':_0x25de3a['id']};_0x51adcf();})['catch'](function(_0x113b3e){_0x51adcf(_0x113b3e);});}else if(_[_0x84cf('0x4a')](_0x43b41b['headers'][_0x84cf('0x49')],'Bearer')){validateJwt(_0x43b41b,_0xc15298,_0x51adcf);}else{if(_0x29455e){_0x51adcf();}else{return _0xc15298[_0x84cf('0x44')](0x193)[_0x84cf('0x4f')]({'message':_0x84cf('0x51')});}}}else if(_0x43b41b[_0x84cf('0x52')][_0x84cf('0x53')]){try{var _0x49d415={'audience':hardwareConf[_0x84cf('0x54')](),'issuer':hardwareConf['getUuid']()};verifyJwt(_0x43b41b['query'][_0x84cf('0x53')],_0x49d415)[_0x84cf('0x43')](function(_0x4c4676){return db[_0x84cf('0x4c')][_0x84cf('0x55')]({'where':{'id':_0x4c4676[_0x84cf('0x56')]}})[_0x84cf('0x43')](function(_0xd13908){_0x20de4b=_0xd13908;return db[_0x84cf('0x57')]['findOne']({'where':{'id':0x1},'attributes':[_0x84cf('0x58'),_0x84cf('0x59')],'raw':!![]});})[_0x84cf('0x43')](function(_0x32cff6){if(!_0x20de4b||!_[_0x84cf('0x5a')](_0x20de4b[_0x84cf('0x5b')],_0x4c4676['nonce'])){return _0xc15298[_0x84cf('0x44')](0x191)['json']({'message':_0x84cf('0x5c')});}if(_0x20de4b[_0x84cf('0x5d')]){return _0xc15298[_0x84cf('0x44')](0x191)[_0x84cf('0x4f')]({'message':_0x84cf('0x5e')});}if(_0x20de4b[_0x84cf('0x5f')]){if(_0x32cff6[_0x84cf('0x59')]>0x0){if(moment(_0x20de4b[_0x84cf('0x60')])[_0x84cf('0x61')](_0x32cff6['blockDuration'],_0x84cf('0x62'))>moment()){return _0xc15298['status'](0x191)[_0x84cf('0x4f')]({'message':_0x84cf('0x5e')});}}else{return _0xc15298['status'](0x191)[_0x84cf('0x4f')]({'message':'Invalid\x20API\x20access\x20key'});}}_0x43b41b[_0x84cf('0x3e')]={'id':_0x20de4b['id']};_0x51adcf();});})['catch'](function(){return _0xc15298[_0x84cf('0x44')](0x191)['json']({'message':_0x84cf('0x5e')});});}catch(_0x40ae50){_0x51adcf(_0x40ae50);}}else if(_0x29455e){_0x51adcf();}else{return _0xc15298['status'](0x193)[_0x84cf('0x4f')]({'message':_0x84cf('0x51')});}})[_0x84cf('0x3d')](function(_0x5ef5fb,_0x3c1314,_0x5f1b8e){if(_0x5ef5fb[_0x84cf('0x3e')]){db['User']['find']({'where':{'id':_0x5ef5fb['user']['id']},'attributes':userAttributes})[_0x84cf('0x43')](function(_0xcf14ba){if(!_0xcf14ba){return _0x3c1314['status'](0x194)[_0x84cf('0x4f')]({'message':'User\x20not\x20found.'});}_0x5ef5fb[_0x84cf('0x3e')]=_0xcf14ba;_0x5f1b8e();})[_0x84cf('0x63')](function(_0x5ce309){_0x5f1b8e(_0x5ce309);});}else if(_0x29455e){_0x5f1b8e();}else{return _0x3c1314[_0x84cf('0x44')](0x194)['json']({'message':_0x84cf('0x64')});}});};exports['canUpdate']=function canUpdate(){return compose()['use'](function(_0x5d8b69,_0x5498ec,_0x585644){return licenseUtil['getLicense']()['then'](function(_0x210d9b){if(_0x210d9b[_0x84cf('0x65')]){_0x585644();}else{return _0x5498ec[_0x84cf('0x44')](0x193)[_0x84cf('0x4f')]({'message':'Forbidden'});}})[_0x84cf('0x63')](function(_0x4af229){_0x585644(_0x4af229);});});};exports[_0x84cf('0x66')]=function isWebrtcLicence(){return compose()[_0x84cf('0x3d')](function(_0x1533a7,_0x253464,_0x121bb9){return licenseUtil[_0x84cf('0x67')]()['then'](function(_0x2f7da6){if(_0x2f7da6[_0x84cf('0x68')]){_0x121bb9();}else{return _0x253464['status'](0x193)[_0x84cf('0x4f')]({'message':_0x84cf('0x69')});}})[_0x84cf('0x63')](function(_0x5212ec){_0x121bb9(_0x5212ec);});});};exports['isMiddleware']=function(_0x5499f9,_0x1cf3f6,_0x104421){_0x5499f9[_0x84cf('0x6a')]=!![];return _0x104421();};exports[_0x84cf('0x6b')]=function signToken(_0x271cc3){return signJwt(_0x271cc3);};exports[_0x84cf('0x6c')]=function(_0x51d725,_0x350985){if(!_0x51d725['user']){return _0x350985[_0x84cf('0x44')](0x194)['json']({'message':'It\x20looks\x20like\x20you\x20aren\x27t\x20logged\x20in,\x20please\x20try\x20again.'});}var _0x46c595={'payload':{'id':_0x51d725[_0x84cf('0x3e')]['id'],'role':_0x51d725[_0x84cf('0x3e')]['role']},'options':{'expiresIn':0x15180}};return signJwt(_0x46c595)['then'](function(_0x290a4d){_0x350985[_0x84cf('0x6d')](_0x84cf('0x6e'),_0x290a4d);_0x350985[_0x84cf('0x6f')](_0x84cf('0x70'));})['catch'](function(_0xcfe28f){return _0x350985[_0x84cf('0x44')](0x1f4)['send'](_0xcfe28f);});};exports[_0x84cf('0x71')]=function(_0x5baea8){if(_['isNil'](_0x5baea8[_0x84cf('0x5b')])||_[_0x84cf('0x72')](_0x5baea8['apiKeyIat'])){return null;}else{return createJwt(_0x5baea8);}};exports['generateApiKey']=function(_0x31176c){_0x31176c[_0x84cf('0x5b')]=generateNonce();_0x31176c[_0x84cf('0x73')]=generateIssuedAt();return createJwt(_0x31176c);};exports[_0x84cf('0x74')]=function(_0x406c33,_0x3edaec){var _0x3a0eb4=_0x406c33[_0x84cf('0x52')]['apikey'];if(_0x3a0eb4){var _0x1bc15c={'nonce':_0x3edaec[_0x84cf('0x5b')],'iat':_0x3edaec['apiKeyIat'],'audience':hardwareConf['getUuid'](),'issuer':hardwareConf[_0x84cf('0x54')]()};return verifyJwt(_0x3a0eb4,_0x1bc15c)[_0x84cf('0x43')](function(){return generateApiKey(_0x3edaec);});}else{throw{'message':_0x84cf('0x75')};}};exports[_0x84cf('0x76')]=function(_0x340915){var _0xfec87d=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(!_0xfec87d[_0x84cf('0x77')](_0x340915))throw new db['Sequelize'][(_0x84cf('0x78'))]('The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.');return;};exports[_0x84cf('0x79')]=function(_0x5c0122,_0x2a60bc,_0x1c2f1b){var _0x55d8c4=encryptor[_0x84cf('0x7a')](_0x2a60bc)[_0x84cf('0x7b')](',');for(var _0x52a3f1=0x0;_0x52a3f1<_0x1c2f1b;_0x52a3f1++){if(!_0x55d8c4[_0x52a3f1])break;if(_0x5c0122[_0x84cf('0x7c')]()===_0x55d8c4[_0x52a3f1]['toLowerCase']()){var _0x577d55=util['format']('The\x20password\x20must\x20be\x20different\x20from\x20the\x20previous\x20%d\x20passwords.\x20Please\x20choose\x20another\x20one.',_0x1c2f1b);if(_0x1c2f1b===0x1){_0x577d55=_0x84cf('0x7d');}throw new db[(_0x84cf('0x7e'))][(_0x84cf('0x78'))](_0x577d55);}}return;};exports[_0x84cf('0x7f')]=function(_0x480c3e,_0x32aa8b){var _0x3c1c55=_0x32aa8b?encryptor['decryptString'](_0x32aa8b)[_0x84cf('0x7b')](','):[];if(_0x3c1c55[_0x84cf('0x80')]===0x5){_0x3c1c55[_0x84cf('0x81')](-0x1,0x1);}_0x3c1c55[_0x84cf('0x82')](_0x480c3e);return encryptor[_0x84cf('0x83')](_0x3c1c55[_0x84cf('0x84')](','));};function signJwt(_0x1f1f76){var _0x39a336=BPromise['promisify'](jwt[_0x84cf('0x85')],{'context':jwt});var _0x58a96a=_0x1f1f76[_0x84cf('0x86')]||config[_0x84cf('0xc')][_0x84cf('0x87')];return new BPromise(function(_0x276ab1,_0x2602b7){_0x39a336(_0x1f1f76['payload'],_0x58a96a,_0x1f1f76[_0x84cf('0x88')])[_0x84cf('0x43')](function(_0xe1a1d9){_0x276ab1(_0xe1a1d9);})['catch'](function(_0xdb9b0c){_0x2602b7(_0xdb9b0c);});});}function verifyJwt(_0x240cca,_0x4e6077,_0x84d9cb){var _0x482958=BPromise[_0x84cf('0x89')](jwt[_0x84cf('0x8a')],{'context':jwt});var _0x57f1f2=_0x84d9cb||config[_0x84cf('0xc')][_0x84cf('0x87')];return new BPromise(function(_0x4a7905,_0x40b33e){_0x482958(_0x240cca,_0x57f1f2,_0x4e6077)[_0x84cf('0x43')](function(_0x262ae1){_0x4a7905(_0x262ae1);})[_0x84cf('0x63')](function(_0x577ade){_0x40b33e(_0x577ade);});});}function generateNonce(){return crypto[_0x84cf('0x8b')](0x10)[_0x84cf('0x8c')]('hex');}function generateIssuedAt(){return Math['floor'](Date['now']()/0x3e8)[_0x84cf('0x8c')]();}function createJwt(_0x8399f4){var _0xfcd0d={'payload':{'iat':_0x8399f4['apiKeyIat'],'nonce':_0x8399f4['apiKeyNonce']},'options':{'algorithm':_0x84cf('0x8d'),'subject':_0x8399f4['id'][_0x84cf('0x8c')](),'issuer':hardwareConf[_0x84cf('0x54')](),'audience':hardwareConf[_0x84cf('0x54')]()}};return signJwt(_0xfcd0d)[_0x84cf('0x43')](function(_0x39bd44){return{'iat':_0x8399f4[_0x84cf('0x73')],'nonce':_0x8399f4[_0x84cf('0x5b')],'token':_0x39bd44};});} \ No newline at end of file +var _0xa571=['verify','randomBytes','toString','hex','floor','../../mysqldb','../../config/environment','../../config/license/hardware','../../config/license/util','lodash','jsonwebtoken','basic-auth','bluebird','util','moment','secrets','session','role','name','internal','email','permissions','md5secret','voicePause','chatPause','mailPause','faxPause','smsPause','openchannelPause','lastLoginAt','lastPauseAt','crudPermissions','passwordResetAt','alias','phoneBarAutoAnswerDelay','phoneBarEnableRecording','phoneBarEnableDtmfTone','phoneBarEnableSettings','phoneBarExpires','phoneBarRemoteControl','interface','userProfileId','privacyEnabled','wssPort','downloadVoiceRecordings','downloadOmnichannelInteractions','ignorePauseForPreviewCalls','selectRecallMeCampaign','chatAutoanswer','chatAutoanswerDelay','emailAutoanswer','smsAutoanswerDelay','openchannelAutoanswer','openchannelAutoanswerDelay','whatsappAutoanswerDelay','messengerSoundNotification','isChatInteractionAuthorized','isAuthenticated','use','user','ChatInteraction','findOne','params','closed','disposition','then','status','unmanaged','json','Forbidden.','catch','headers','authorization','Basic','find','authenticate','pass','Wrong\x20credentials.','Bearer','Unknown\x20authorization\x20format','query','apikey','getUuid','User','sub','Setting','allowedLoginAttempts','blockDuration','isEqual','apiKeyNonce','nonce','Invalid\x20API\x20access\x20key','blockedAt','add','User\x20not\x20found.','User\x20object\x20not\x20found.','canUpdate','getLicense','Forbidden','isWebrtcLicence','webrtc','isMiddleware','signToken','setTokenCookie','cookie','motion.token','retrieveApiKey','apiKeyIat','generateApiKey','regenerateApiKey','Please\x20use\x20the\x20previous\x20API\x20access\x20key\x20to\x20generate\x20a\x20new\x20one','validatePasswordPattern','The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.','decryptString','split','format','The\x20password\x20must\x20be\x20different\x20from\x20the\x20previous\x20%d\x20passwords.\x20Please\x20choose\x20another\x20one.','The\x20password\x20must\x20be\x20different\x20from\x20the\x20last\x20one.\x20Please\x20choose\x20another\x20one.','Sequelize','ValidationError','updatePasswordsHistory','length','splice','unshift','encryptString','promisify','secret','payload','options'];(function(_0x6057c7,_0x5ea90a){var _0x113c8b=function(_0x4816bb){while(--_0x4816bb){_0x6057c7['push'](_0x6057c7['shift']());}};_0x113c8b(++_0x5ea90a);}(_0xa571,0x107));var _0x1a57=function(_0x2bb13f,_0x407ab8){_0x2bb13f=_0x2bb13f-0x0;var _0x21e336=_0xa571[_0x2bb13f];return _0x21e336;};'use strict';var db=require(_0x1a57('0x0'))['db'];var config=require(_0x1a57('0x1'));var hardwareConf=require(_0x1a57('0x2'));var licenseUtil=require(_0x1a57('0x3'));var encryptor=require('../encryptor');var _=require(_0x1a57('0x4'));var jwt=require(_0x1a57('0x5'));var expressJwt=require('express-jwt');var compose=require('composable-middleware');var basicAuth=require(_0x1a57('0x6'));var crypto=require('crypto');var BPromise=require(_0x1a57('0x7'));var util=require(_0x1a57('0x8'));var moment=require(_0x1a57('0x9'));var validateJwt=expressJwt({'secret':config[_0x1a57('0xa')][_0x1a57('0xb')]});var userAttributes=['id',_0x1a57('0xc'),'fullname',_0x1a57('0xd'),_0x1a57('0xe'),_0x1a57('0xf'),'userpic',_0x1a57('0x10'),_0x1a57('0x11'),_0x1a57('0x12'),_0x1a57('0x13'),_0x1a57('0x14'),_0x1a57('0x15'),_0x1a57('0x16'),_0x1a57('0x17'),'pauseType','showWebBar',_0x1a57('0x18'),_0x1a57('0x19'),_0x1a57('0x1a'),'allowmessenger',_0x1a57('0x1b'),_0x1a57('0x1c'),'phoneBarAutoAnswer',_0x1a57('0x1d'),'phoneBarDnd',_0x1a57('0x1e'),_0x1a57('0x1f'),_0x1a57('0x20'),_0x1a57('0x21'),'phoneBarPrefixRequired',_0x1a57('0x22'),'phoneBarRemoteControlPort','hotdesk',_0x1a57('0x23'),_0x1a57('0x24'),_0x1a57('0x25'),'settingsEnabled',_0x1a57('0x26'),_0x1a57('0x27'),_0x1a57('0x28'),'downloadAttachments',_0x1a57('0x29'),_0x1a57('0x2a'),_0x1a57('0x2b'),_0x1a57('0x2c'),_0x1a57('0x2d'),'emailAutoanswerDelay','smsAutoanswer',_0x1a57('0x2e'),_0x1a57('0x2f'),_0x1a57('0x30'),'faxAutoanswer','faxAutoanswerDelay','whatsappAutoanswer',_0x1a57('0x31'),_0x1a57('0x32')];exports[_0x1a57('0x33')]=function(){return this[_0x1a57('0x34')](!![])[_0x1a57('0x35')](function(_0x39d3ce,_0x2efa49,_0x2f8b00){if(_0x39d3ce[_0x1a57('0x36')]){_0x2f8b00();}else{return db[_0x1a57('0x37')][_0x1a57('0x38')]({'where':{'id':_0x39d3ce[_0x1a57('0x39')]['id']},'attributes':['id',_0x1a57('0x3a'),_0x1a57('0x3b')],'raw':!![]})[_0x1a57('0x3c')](function(_0x182649){if(_0x182649&&_0x182649[_0x1a57('0x3a')]){return _0x2efa49[_0x1a57('0x3d')](_0x182649[_0x1a57('0x3b')]===_0x1a57('0x3e')?0x195:0x193)[_0x1a57('0x3f')]({'message':_0x182649[_0x1a57('0x3b')]==='unmanaged'?'Unmanaged.':_0x1a57('0x40')});}else{_0x2f8b00();}})[_0x1a57('0x41')](function(_0x545041){_0x2f8b00(_0x545041);});}});};exports[_0x1a57('0x34')]=function isAuthenticated(_0x54f6a5){return compose()[_0x1a57('0x35')](function(_0x4a2901,_0x53bf6e,_0x8179a4){var _0x274fe6;if(_0x4a2901[_0x1a57('0x42')][_0x1a57('0x43')]){if(_['startsWith'](_0x4a2901[_0x1a57('0x42')][_0x1a57('0x43')],_0x1a57('0x44'))){var _0x160536=basicAuth(_0x4a2901);db['User'][_0x1a57('0x45')]({'where':{'name':_0x160536[_0x1a57('0xd')]}})[_0x1a57('0x3c')](function(_0x32f79f){if(!_0x32f79f||!_0x32f79f[_0x1a57('0x46')](_0x160536[_0x1a57('0x47')])){return _0x53bf6e[_0x1a57('0x3d')](0x191)[_0x1a57('0x3f')]({'message':_0x1a57('0x48')});}_0x4a2901['user']={'id':_0x32f79f['id']};_0x8179a4();})[_0x1a57('0x41')](function(_0x1e27b4){_0x8179a4(_0x1e27b4);});}else if(_['startsWith'](_0x4a2901['headers'][_0x1a57('0x43')],_0x1a57('0x49'))){validateJwt(_0x4a2901,_0x53bf6e,_0x8179a4);}else{if(_0x54f6a5){_0x8179a4();}else{return _0x53bf6e[_0x1a57('0x3d')](0x193)[_0x1a57('0x3f')]({'message':_0x1a57('0x4a')});}}}else if(_0x4a2901[_0x1a57('0x4b')][_0x1a57('0x4c')]){try{var _0x41e466={'audience':hardwareConf[_0x1a57('0x4d')](),'issuer':hardwareConf[_0x1a57('0x4d')]()};verifyJwt(_0x4a2901[_0x1a57('0x4b')][_0x1a57('0x4c')],_0x41e466)[_0x1a57('0x3c')](function(_0x1a6231){return db[_0x1a57('0x4e')][_0x1a57('0x45')]({'where':{'id':_0x1a6231[_0x1a57('0x4f')]}})[_0x1a57('0x3c')](function(_0x53432f){_0x274fe6=_0x53432f;return db[_0x1a57('0x50')][_0x1a57('0x38')]({'where':{'id':0x1},'attributes':[_0x1a57('0x51'),_0x1a57('0x52')],'raw':!![]});})[_0x1a57('0x3c')](function(_0xf64cb5){if(!_0x274fe6||!_[_0x1a57('0x53')](_0x274fe6[_0x1a57('0x54')],_0x1a6231[_0x1a57('0x55')])){return _0x53bf6e['status'](0x191)['json']({'message':'API\x20access\x20key\x20is\x20not\x20valid\x20anymore'});}if(_0x274fe6['disabled']){return _0x53bf6e[_0x1a57('0x3d')](0x191)[_0x1a57('0x3f')]({'message':_0x1a57('0x56')});}if(_0x274fe6['blocked']){if(_0xf64cb5[_0x1a57('0x52')]>0x0){if(moment(_0x274fe6[_0x1a57('0x57')])[_0x1a57('0x58')](_0xf64cb5[_0x1a57('0x52')],'minutes')>moment()){return _0x53bf6e[_0x1a57('0x3d')](0x191)['json']({'message':_0x1a57('0x56')});}}else{return _0x53bf6e[_0x1a57('0x3d')](0x191)[_0x1a57('0x3f')]({'message':'Invalid\x20API\x20access\x20key'});}}_0x4a2901[_0x1a57('0x36')]={'id':_0x274fe6['id']};_0x8179a4();});})[_0x1a57('0x41')](function(){return _0x53bf6e[_0x1a57('0x3d')](0x191)[_0x1a57('0x3f')]({'message':_0x1a57('0x56')});});}catch(_0x528ed3){_0x8179a4(_0x528ed3);}}else if(_0x54f6a5){_0x8179a4();}else{return _0x53bf6e[_0x1a57('0x3d')](0x193)['json']({'message':'Unknown\x20authorization\x20format'});}})[_0x1a57('0x35')](function(_0x5b42bd,_0x433878,_0x398c59){if(_0x5b42bd[_0x1a57('0x36')]){db['User'][_0x1a57('0x45')]({'where':{'id':_0x5b42bd[_0x1a57('0x36')]['id']},'attributes':userAttributes})[_0x1a57('0x3c')](function(_0x392217){if(!_0x392217){return _0x433878['status'](0x194)[_0x1a57('0x3f')]({'message':_0x1a57('0x59')});}_0x5b42bd['user']=_0x392217;_0x398c59();})[_0x1a57('0x41')](function(_0x4c0759){_0x398c59(_0x4c0759);});}else if(_0x54f6a5){_0x398c59();}else{return _0x433878['status'](0x194)[_0x1a57('0x3f')]({'message':_0x1a57('0x5a')});}});};exports[_0x1a57('0x5b')]=function canUpdate(){return compose()[_0x1a57('0x35')](function(_0x5c0f5d,_0x44167e,_0xec234d){return licenseUtil[_0x1a57('0x5c')]()[_0x1a57('0x3c')](function(_0x473524){if(_0x473524['update']){_0xec234d();}else{return _0x44167e[_0x1a57('0x3d')](0x193)[_0x1a57('0x3f')]({'message':_0x1a57('0x5d')});}})[_0x1a57('0x41')](function(_0x4e540d){_0xec234d(_0x4e540d);});});};exports[_0x1a57('0x5e')]=function isWebrtcLicence(){return compose()['use'](function(_0x4bbfc3,_0x36f8dc,_0x167b40){return licenseUtil[_0x1a57('0x5c')]()[_0x1a57('0x3c')](function(_0x445df1){if(_0x445df1[_0x1a57('0x5f')]){_0x167b40();}else{return _0x36f8dc[_0x1a57('0x3d')](0x193)[_0x1a57('0x3f')]({'message':_0x1a57('0x5d')});}})[_0x1a57('0x41')](function(_0x136335){_0x167b40(_0x136335);});});};exports[_0x1a57('0x60')]=function(_0x47f9da,_0xf4d056,_0x480aff){_0x47f9da[_0x1a57('0x60')]=!![];return _0x480aff();};exports[_0x1a57('0x61')]=function signToken(_0x38b334){return signJwt(_0x38b334);};exports[_0x1a57('0x62')]=function(_0x323af1,_0x3cbb9e){if(!_0x323af1[_0x1a57('0x36')]){return _0x3cbb9e[_0x1a57('0x3d')](0x194)[_0x1a57('0x3f')]({'message':'It\x20looks\x20like\x20you\x20aren\x27t\x20logged\x20in,\x20please\x20try\x20again.'});}var _0x193b77={'payload':{'id':_0x323af1[_0x1a57('0x36')]['id'],'role':_0x323af1['user'][_0x1a57('0xc')]},'options':{'expiresIn':0x15180}};return signJwt(_0x193b77)[_0x1a57('0x3c')](function(_0x594f94){_0x3cbb9e[_0x1a57('0x63')](_0x1a57('0x64'),_0x594f94);_0x3cbb9e['redirect']('/dashboards/general');})['catch'](function(_0x2c1bac){return _0x3cbb9e[_0x1a57('0x3d')](0x1f4)['send'](_0x2c1bac);});};exports[_0x1a57('0x65')]=function(_0x18267c){if(_['isNil'](_0x18267c['apiKeyNonce'])||_['isNil'](_0x18267c[_0x1a57('0x66')])){return null;}else{return createJwt(_0x18267c);}};exports[_0x1a57('0x67')]=function(_0x431cf5){_0x431cf5[_0x1a57('0x54')]=generateNonce();_0x431cf5[_0x1a57('0x66')]=generateIssuedAt();return createJwt(_0x431cf5);};exports[_0x1a57('0x68')]=function(_0xd64b3a,_0x1f705b){var _0x516aff=_0xd64b3a['query']['apikey'];if(_0x516aff){var _0x5ef58d={'nonce':_0x1f705b['apiKeyNonce'],'iat':_0x1f705b[_0x1a57('0x66')],'audience':hardwareConf[_0x1a57('0x4d')](),'issuer':hardwareConf[_0x1a57('0x4d')]()};return verifyJwt(_0x516aff,_0x5ef58d)[_0x1a57('0x3c')](function(){return generateApiKey(_0x1f705b);});}else{throw{'message':_0x1a57('0x69')};}};exports[_0x1a57('0x6a')]=function(_0xe710e){var _0x3bf7f0=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(!_0x3bf7f0['test'](_0xe710e))throw new db['Sequelize']['ValidationError'](_0x1a57('0x6b'));return;};exports['validatePasswordHistory']=function(_0x301db9,_0x10c058,_0x408e67){var _0x352aca=encryptor[_0x1a57('0x6c')](_0x10c058)[_0x1a57('0x6d')](',');for(var _0x5a80be=0x0;_0x5a80be<_0x408e67;_0x5a80be++){if(!_0x352aca[_0x5a80be])break;if(_0x301db9['toLowerCase']()===_0x352aca[_0x5a80be]['toLowerCase']()){var _0x4d5b1d=util[_0x1a57('0x6e')](_0x1a57('0x6f'),_0x408e67);if(_0x408e67===0x1){_0x4d5b1d=_0x1a57('0x70');}throw new db[(_0x1a57('0x71'))][(_0x1a57('0x72'))](_0x4d5b1d);}}return;};exports[_0x1a57('0x73')]=function(_0x2ca029,_0x4ab246){var _0x5b691c=_0x4ab246?encryptor[_0x1a57('0x6c')](_0x4ab246)[_0x1a57('0x6d')](','):[];if(_0x5b691c[_0x1a57('0x74')]===0x5){_0x5b691c[_0x1a57('0x75')](-0x1,0x1);}_0x5b691c[_0x1a57('0x76')](_0x2ca029);return encryptor[_0x1a57('0x77')](_0x5b691c['join'](','));};function signJwt(_0x47db75){var _0x3bf6dd=BPromise[_0x1a57('0x78')](jwt['sign'],{'context':jwt});var _0x55c89e=_0x47db75[_0x1a57('0x79')]||config[_0x1a57('0xa')][_0x1a57('0xb')];return new BPromise(function(_0x10ceb8,_0x3ddc7e){_0x3bf6dd(_0x47db75[_0x1a57('0x7a')],_0x55c89e,_0x47db75[_0x1a57('0x7b')])['then'](function(_0x5913cf){_0x10ceb8(_0x5913cf);})[_0x1a57('0x41')](function(_0x69da3c){_0x3ddc7e(_0x69da3c);});});}function verifyJwt(_0x299fb7,_0x2e0ba6,_0x5d92dc){var _0x33092d=BPromise[_0x1a57('0x78')](jwt[_0x1a57('0x7c')],{'context':jwt});var _0x33c8d4=_0x5d92dc||config[_0x1a57('0xa')]['session'];return new BPromise(function(_0x4aa36d,_0x59d0b0){_0x33092d(_0x299fb7,_0x33c8d4,_0x2e0ba6)[_0x1a57('0x3c')](function(_0x223ba5){_0x4aa36d(_0x223ba5);})[_0x1a57('0x41')](function(_0x33ffe5){_0x59d0b0(_0x33ffe5);});});}function generateNonce(){return crypto[_0x1a57('0x7d')](0x10)[_0x1a57('0x7e')](_0x1a57('0x7f'));}function generateIssuedAt(){return Math[_0x1a57('0x80')](Date['now']()/0x3e8)[_0x1a57('0x7e')]();}function createJwt(_0x39399b){var _0x50ff89={'payload':{'iat':_0x39399b['apiKeyIat'],'nonce':_0x39399b[_0x1a57('0x54')]},'options':{'algorithm':'HS512','subject':_0x39399b['id'][_0x1a57('0x7e')](),'issuer':hardwareConf[_0x1a57('0x4d')](),'audience':hardwareConf[_0x1a57('0x4d')]()}};return signJwt(_0x50ff89)[_0x1a57('0x3c')](function(_0x3e7603){return{'iat':_0x39399b[_0x1a57('0x66')],'nonce':_0x39399b[_0x1a57('0x54')],'token':_0x3e7603};});} \ No newline at end of file diff --git a/server/components/contacts/index.js b/server/components/contacts/index.js index b85f63e..2740bc5 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 _0x5179=['keys','cf_','map','findOne','all','length','type','catch','./sql-utils','findAll','skipContactsQuery','getContactsSubquery','resolve','search','parseAdvancedSearchFilter','parseQueryParameters','then','where','default','filter','user','clause','skip','checkListsRestrictions','tag','countFilteredContacts','count','buildContactsQuery','fields','getFilteredContacts','rows','describe'];(function(_0x27b994,_0x309afe){var _0x364a12=function(_0x475ad3){while(--_0x475ad3){_0x27b994['push'](_0x27b994['shift']());}};_0x364a12(++_0x309afe);}(_0x5179,0x108));var _0x9517=function(_0x1b7368,_0x3286ed){_0x1b7368=_0x1b7368-0x0;var _0x25d54c=_0x5179[_0x1b7368];return _0x25d54c;};'use strict';var _=require('lodash');var sqlUtils=require(_0x9517('0x0'));var db=require('../../mysqldb')['db'];exports[_0x9517('0x1')]=function(_0x507e9d,_0x36b70b,_0xf03dbf,_0x391a74){var _0x49c55b={'count':0x0,'rows':[]};var _0x54063d=sqlUtils[_0x9517('0x2')](_0x36b70b,_0x507e9d);if(_0x54063d){return Promise['resolve'](_0x49c55b);}var _0x2a2328=sqlUtils[_0x9517('0x3')]();var _0x49b3dd={};var _0x55ac76=![];var _0x32a174=![];return Promise[_0x9517('0x4')]()['then'](function(){if(_0x507e9d[_0x9517('0x5')]){return sqlUtils[_0x9517('0x6')](_0x507e9d[_0x9517('0x5')],_0x391a74);}else{return sqlUtils[_0x9517('0x7')](_0x507e9d,_0x391a74);}})[_0x9517('0x8')](function(_0x532422){_0x2a2328[_0x9517('0x9')](_0x532422[_0x9517('0xa')]);_0x2a2328[_0x9517('0x9')](_0x532422['fields']);_0x2a2328['where'](_0x532422[_0x9517('0xb')]);_0x2a2328[_0x9517('0x9')](_0x532422[_0x9517('0xc')][_0x9517('0xd')]);_0x49b3dd=_0x532422['tags'];_0x32a174=_0x532422[_0x9517('0xc')][_0x9517('0xe')];return sqlUtils[_0x9517('0xf')](_0x36b70b,_0x507e9d,_0x32a174);})['then'](function(_0x481c37){_0x2a2328['where'](_0x481c37);var _0x1a556f=_0x507e9d[_0x9517('0x5')]?_0x49b3dd['ids']:_0x507e9d[_0x9517('0x10')];_0x55ac76=_0x1a556f?!![]:![];return sqlUtils[_0x9517('0x11')](_0x2a2328,_0x1a556f);})[_0x9517('0x8')](function(_0x2e3679){_0x49c55b[_0x9517('0x12')]=_0x2e3679;if(_0x49c55b[_0x9517('0x12')]===0x0){return;}if(_0x507e9d['User']){_0x32a174=!![];}return sqlUtils[_0x9517('0x13')](_0x2a2328,_0x507e9d[_0x9517('0x14')],_0xf03dbf,_0x55ac76,_0x49b3dd[_0x9517('0xd')],_0x32a174);})[_0x9517('0x8')](function(_0x68a06f){if(!_0x68a06f){return[];}return sqlUtils[_0x9517('0x15')](_0x68a06f,_0x507e9d,_0xf03dbf);})['then'](function(_0x1d3c59){_0x49c55b[_0x9517('0x16')]=_0x1d3c59;return _0x49c55b;})['catch'](function(_0x351e7e){throw _0x351e7e;});};exports[_0x9517('0x17')]=function(){var _0x106b16={};var _0x3eb780=[];return db['CmContact'][_0x9517('0x17')]()[_0x9517('0x8')](function(_0x50caf4){_0x106b16=_0x50caf4;var _0x58d05f=Object[_0x9517('0x18')](_0x106b16)['filter'](function(_0x493e73){return _['startsWith'](_0x493e73,_0x9517('0x19'))?_0x493e73:undefined;});var _0x294a6c=_0x58d05f[_0x9517('0x1a')](function(_0x104b14){return db['CmCustomField'][_0x9517('0x1b')]({'where':{'id':_0x104b14['slice'](0x3)},'raw':!![]});});return Promise[_0x9517('0x1c')](_0x294a6c);})[_0x9517('0x8')](function(_0x3e9d90){for(var _0x345d1f=0x0;_0x345d1f<_0x3e9d90[_0x9517('0x1d')];_0x345d1f++){if(_0x3e9d90[_0x345d1f]){var _0x466c2b=_0x9517('0x19')+_0x3e9d90[_0x345d1f]['id'];_0x106b16[_0x466c2b]['fieldType']=_0x3e9d90[_0x345d1f][_0x9517('0x1e')];}}_0x3eb780=_[_0x9517('0x1a')](Object[_0x9517('0x18')](_0x106b16),function(_0xf85033){return{'name':_0xf85033,'type':_0x106b16[_0xf85033][_0x9517('0x1e')]};});return _0x3eb780;})[_0x9517('0x1f')](function(_0x40a302){throw _0x40a302;});}; \ No newline at end of file +var _0x83dc=['describe','CmContact','filter','startsWith','cf_','map','CmCustomField','findOne','slice','all','length','fieldType','type','keys','catch','lodash','./sql-utils','../../mysqldb','findAll','resolve','getContactsSubquery','then','search','parseAdvancedSearchFilter','parseQueryParameters','where','default','fields','user','clause','tags','checkListsRestrictions','tag','countFilteredContacts','count','User'];(function(_0xf233bf,_0x29d15b){var _0x177338=function(_0x13ad8e){while(--_0x13ad8e){_0xf233bf['push'](_0xf233bf['shift']());}};_0x177338(++_0x29d15b);}(_0x83dc,0xe7));var _0xc83d=function(_0x262e6c,_0x440b4c){_0x262e6c=_0x262e6c-0x0;var _0x270090=_0x83dc[_0x262e6c];return _0x270090;};'use strict';var _=require(_0xc83d('0x0'));var sqlUtils=require(_0xc83d('0x1'));var db=require(_0xc83d('0x2'))['db'];exports[_0xc83d('0x3')]=function(_0x5c77a2,_0x1ee550,_0x107ac5,_0x260c77){var _0x31ff54={'count':0x0,'rows':[]};var _0x4374df=sqlUtils['skipContactsQuery'](_0x1ee550,_0x5c77a2);if(_0x4374df){return Promise[_0xc83d('0x4')](_0x31ff54);}var _0x31f4e2=sqlUtils[_0xc83d('0x5')]();var _0x5507dd={};var _0x306a22=![];var _0x1b0d71=![];return Promise['resolve']()[_0xc83d('0x6')](function(){if(_0x5c77a2[_0xc83d('0x7')]){return sqlUtils[_0xc83d('0x8')](_0x5c77a2[_0xc83d('0x7')],_0x260c77);}else{return sqlUtils[_0xc83d('0x9')](_0x5c77a2,_0x260c77);}})[_0xc83d('0x6')](function(_0x58c069){_0x31f4e2[_0xc83d('0xa')](_0x58c069[_0xc83d('0xb')]);_0x31f4e2[_0xc83d('0xa')](_0x58c069[_0xc83d('0xc')]);_0x31f4e2[_0xc83d('0xa')](_0x58c069['filter']);_0x31f4e2[_0xc83d('0xa')](_0x58c069[_0xc83d('0xd')][_0xc83d('0xe')]);_0x5507dd=_0x58c069[_0xc83d('0xf')];_0x1b0d71=_0x58c069[_0xc83d('0xd')]['skip'];return sqlUtils[_0xc83d('0x10')](_0x1ee550,_0x5c77a2,_0x1b0d71);})['then'](function(_0x387bfb){_0x31f4e2[_0xc83d('0xa')](_0x387bfb);var _0xc2def=_0x5c77a2[_0xc83d('0x7')]?_0x5507dd['ids']:_0x5c77a2[_0xc83d('0x11')];_0x306a22=_0xc2def?!![]:![];return sqlUtils[_0xc83d('0x12')](_0x31f4e2,_0xc2def);})[_0xc83d('0x6')](function(_0x5daccc){_0x31ff54[_0xc83d('0x13')]=_0x5daccc;if(_0x31ff54[_0xc83d('0x13')]===0x0){return;}if(_0x5c77a2[_0xc83d('0x14')]){_0x1b0d71=!![];}return sqlUtils['buildContactsQuery'](_0x31f4e2,_0x5c77a2[_0xc83d('0xc')],_0x107ac5,_0x306a22,_0x5507dd[_0xc83d('0xe')],_0x1b0d71);})[_0xc83d('0x6')](function(_0x160377){if(!_0x160377){return[];}return sqlUtils['getFilteredContacts'](_0x160377,_0x5c77a2,_0x107ac5);})['then'](function(_0x15d5ab){_0x31ff54['rows']=_0x15d5ab;return _0x31ff54;})['catch'](function(_0x389c86){throw _0x389c86;});};exports[_0xc83d('0x15')]=function(){var _0x20c386={};var _0x25c879=[];return db[_0xc83d('0x16')][_0xc83d('0x15')]()[_0xc83d('0x6')](function(_0x2a95bc){_0x20c386=_0x2a95bc;var _0x2262ef=Object['keys'](_0x20c386)[_0xc83d('0x17')](function(_0x50a880){return _[_0xc83d('0x18')](_0x50a880,_0xc83d('0x19'))?_0x50a880:undefined;});var _0x435284=_0x2262ef[_0xc83d('0x1a')](function(_0x437116){return db[_0xc83d('0x1b')][_0xc83d('0x1c')]({'where':{'id':_0x437116[_0xc83d('0x1d')](0x3)},'raw':!![]});});return Promise[_0xc83d('0x1e')](_0x435284);})[_0xc83d('0x6')](function(_0x5b6cdf){for(var _0x4df4c9=0x0;_0x4df4c9<_0x5b6cdf[_0xc83d('0x1f')];_0x4df4c9++){if(_0x5b6cdf[_0x4df4c9]){var _0x2add46=_0xc83d('0x19')+_0x5b6cdf[_0x4df4c9]['id'];_0x20c386[_0x2add46][_0xc83d('0x20')]=_0x5b6cdf[_0x4df4c9][_0xc83d('0x21')];}}_0x25c879=_['map'](Object[_0xc83d('0x22')](_0x20c386),function(_0x3eedfa){return{'name':_0x3eedfa,'type':_0x20c386[_0x3eedfa]['type']};});return _0x25c879;})[_0xc83d('0x23')](function(_0x2acdf3){throw _0x2acdf3;});}; \ No newline at end of file diff --git a/server/components/contacts/sql-utils.js b/server/components/contacts/sql-utils.js index e769802..6905a49 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 _0x885b=['where','c.deletedAt\x20IS\x20NULL','subqry','left_join','cm_user_has_contacts','.id','cm_contact_has_tags','ct.CmContactId\x20=\x20','tools_tags','t.id\x20=\x20ct.TagId','firstName','phone','mobile','fax','ListId','CompanyId','createdAt','deletedAt','TagIds','includes','push','forEach','field','expr','getSelectedTags','CONCAT(\x27,\x27,\x20subqry.TagIds,\x20\x27,\x27)\x20LIKE\x20?','replace','split','length','MATCH\x20(c.firstName,\x20c.lastName,\x20c.phone,\x20c.mobile,\x20c.fax,\x20c.email)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','getFullTextValue','c.id\x20LIKE\x20?','c.phone\x20LIKE\x20?','c.mobile\x20LIKE\x20?','c.fax\x20LIKE\x20?','isEmail','c.email\x20LIKE\x20?','c.lastName\x20LIKE\x20?','parseSearch','conditions','find','fieldType','datetime','castTo','DATE','buildExpression','type','default','text','value','start','end','Tag','map','tags','clause','ids','User','user','uc.UserId\x20=\x20?','skip','keys','some','name','compact','Contact','and','c.ListId\x20IN\x20?','concat','\x20=\x20?','then','fields','tag','filter','getLists','attributes','group','c.id','limit','offset','subqry.id','order','subqry.','DESC','color','keyBy','Sequelize','QueryTypes','SELECT','CmContact','sequelize','query','toString','Tags','clone','isEmpty','t.id\x20IN\x20?','exports','squel','../parsers/advancedSearch','../../mysqldb','role','agent','search','autocomplete','select','from','cm_contacts'];(function(_0x5a67c0,_0x337713){var _0xbe503=function(_0xd84145){while(--_0xd84145){_0x5a67c0['push'](_0x5a67c0['shift']());}};_0xbe503(++_0x337713);}(_0x885b,0x13a));var _0xb885=function(_0x947d64,_0x226378){_0x947d64=_0x947d64-0x0;var _0x1ab4ae=_0x885b[_0x947d64];return _0x1ab4ae;};'use strict';var _=require('lodash');var squel=require(_0xb885('0x0'));var as=require(_0xb885('0x1'));var qs=require('../parsers/qs');var utils=require('../interaction/utils');var db=require(_0xb885('0x2'))['db'];function skipContactsQuery(_0x36e03b,_0x2e6558){var _0x3861c5=![];if(_0x36e03b[_0xb885('0x3')]===_0xb885('0x4')&&!_0x2e6558[_0xb885('0x5')]&&!_0x2e6558['ListId']&&_0x2e6558[_0xb885('0x6')]!=='true'){_0x3861c5=!![];}return _0x3861c5;}function getContactsSubquery(){return squel[_0xb885('0x7')]()[_0xb885('0x8')](_0xb885('0x9'),'c')[_0xb885('0xa')](_0xb885('0xb'));}function applyJoinClauses(_0x5cda5e,_0x352994){var _0x221aed=_0x352994?'c':_0xb885('0xc');_0x5cda5e[_0xb885('0xd')](_0xb885('0xe'),'uc','uc.CmContactId\x20=\x20'+_0x221aed+_0xb885('0xf'))[_0xb885('0xd')](_0xb885('0x10'),'ct',_0xb885('0x11')+_0x221aed+_0xb885('0xf'))[_0xb885('0xd')](_0xb885('0x12'),'t',_0xb885('0x13'));return _0x5cda5e;}function addFieldsToQuery(_0x2bd301,_0x3e9e1e,_0x46e570,_0xe31c37,_0x1ea7de){var _0x2dba29=_0x1ea7de?'c':_0xb885('0xc');if(!_0x3e9e1e){_0x3e9e1e=['id',_0xb885('0x14'),'lastName',_0xb885('0x15'),_0xb885('0x16'),_0xb885('0x17'),'email',_0xb885('0x18'),_0xb885('0x19'),_0xb885('0x1a'),'updatedAt',_0xb885('0x1b'),_0xb885('0x1c')];}else if(!_0x3e9e1e[_0xb885('0x1d')]('id')){_0x3e9e1e[_0xb885('0x1e')]('id');}var _0x42c58d=_0x46e570&&_0x1ea7de||!_0x46e570&&!_0x1ea7de;if(_0xe31c37){_0x42c58d=_0xe31c37&&_0x1ea7de||!_0xe31c37&&!_0x1ea7de;}_0x3e9e1e[_0xb885('0x1f')](function(_0x342b5e){if(_0x342b5e===_0xb885('0x1c')){if(_0x42c58d){_0x2bd301[_0xb885('0x20')]('GROUP_CONCAT(DISTINCT\x20t.id)',_0x342b5e);}else if(_0x46e570||_0xe31c37){_0x2bd301[_0xb885('0x20')](_0x2dba29+'.'+_0x342b5e);}}else{_0x2bd301[_0xb885('0x20')](_0x2dba29+'.'+_0x342b5e);}});return _0x2bd301;}function getSqlClauses(){var _0x3dbb5d={'default':squel[_0xb885('0x21')](),'fields':squel[_0xb885('0x21')](),'filter':squel[_0xb885('0x21')](),'tags':{'clause':squel[_0xb885('0x21')](),'ids':null},'user':{'clause':squel[_0xb885('0x21')](),'skip':![]}};return _0x3dbb5d;}function parseTagParameter(_0x5ed730){var _0x122cbc=squel[_0xb885('0x21')]();if(_0x5ed730){var _0x2a0ee4=utils[_0xb885('0x22')](_0x5ed730);_0x2a0ee4['forEach'](function(_0x1257f1){_0x122cbc['or'](_0xb885('0x23'),'%,'+_0x1257f1+',%');});}return _0x122cbc;}function parseSearchFilter(_0x3352f4){var _0x39283f=squel[_0xb885('0x21')]();if(_0x3352f4){var _0x451ece=_0x3352f4[_0xb885('0x24')]('\x5c','\x5c\x5c')['replace'](/'/g,'\x27\x27');if(_0x451ece[_0xb885('0x25')]('\x20')[_0xb885('0x26')]>0x1){_0x39283f['or'](_0xb885('0x27'),qs[_0xb885('0x28')](_0x451ece,!![]),null);}else{if(qs['isNumeric'](_0x451ece)){_0x39283f['or'](_0xb885('0x29'),_0x451ece+'%');_0x39283f['or'](_0xb885('0x2a'),_0x451ece+'%');_0x39283f['or'](_0xb885('0x2b'),_0x451ece+'%');_0x39283f['or'](_0xb885('0x2c'),_0x451ece+'%');}else if(qs[_0xb885('0x2d')](_0x451ece)){_0x39283f['or'](_0xb885('0x2e'),_0x451ece+'%');}else{_0x39283f['or']('c.firstName\x20LIKE\x20?','%'+_0x451ece+'%');_0x39283f['or'](_0xb885('0x2f'),'%'+_0x451ece+'%');_0x39283f['or']('c.email\x20LIKE\x20?','%'+_0x451ece+'%');}}}return _0x39283f;}function parseAdvancedSearchFilter(_0x1354de,_0x2515a9){var _0x3123bc=getSqlClauses();var _0x1bdb3a=as[_0xb885('0x30')](_0x1354de);var _0x582772=_0x1bdb3a['sqlOperator'];for(var _0x44bc75=0x0;_0x44bc75<_0x1bdb3a[_0xb885('0x31')][_0xb885('0x26')];_0x44bc75++){var _0x53fd22=_0x1bdb3a[_0xb885('0x31')][_0x44bc75];var _0x450db4='c';var _0x2d5134=_[_0xb885('0x32')](_0x2515a9,['name',_0x53fd22['field']]);if(_0x2d5134){if(_0x53fd22['field']==='dateOfBirth'||_0x2d5134[_0xb885('0x33')]===_0xb885('0x34')){_0x53fd22[_0xb885('0x35')]=_0xb885('0x36');}var _0x2ffa8c=as[_0xb885('0x37')](_0x450db4,_0x2d5134[_0xb885('0x38')],_0x53fd22);_0x3123bc[_0xb885('0x39')][_0x582772](_0x2ffa8c[_0xb885('0x3a')],_0x2ffa8c[_0xb885('0x3b')][_0xb885('0x3c')],_0x2ffa8c['value'][_0xb885('0x3d')]);}else{if(_0x53fd22[_0xb885('0x20')]===_0xb885('0x3e')){var _0x327eb2=_0x53fd22[_0xb885('0x3b')]['split'](',')[_0xb885('0x3f')](function(_0x16363d){return Number(_0x16363d);});var _0x35f12f=parseTagParameter(_0x327eb2);_0x3123bc[_0xb885('0x40')][_0xb885('0x41')]['and'](_0x35f12f);_0x3123bc[_0xb885('0x40')][_0xb885('0x42')]=_0x327eb2;}else if(_0x53fd22[_0xb885('0x20')]===_0xb885('0x43')){_0x3123bc[_0xb885('0x44')][_0xb885('0x41')]['and'](_0xb885('0x45'),_0x53fd22[_0xb885('0x3b')]);_0x3123bc[_0xb885('0x44')][_0xb885('0x46')]=!![];}}}return _0x3123bc;}function parseModelFields(_0x192068,_0x4a4ab9){var _0x33dfe9=squel[_0xb885('0x21')]();var _0x5c5836=_(_0x192068)[_0xb885('0x47')]()[_0xb885('0x3f')](function(_0x4e40b4){return _[_0xb885('0x48')](_0x4a4ab9,[_0xb885('0x49'),_0x4e40b4])?_0x4e40b4:undefined;})[_0xb885('0x4a')]()['value']();if(_0x192068[_0xb885('0x4b')]){_0x5c5836[_0xb885('0x1e')](_0xb885('0x4b'));}if(_0x192068['User']){_0x5c5836[_0xb885('0x1e')](_0xb885('0x43'));}if(_0x5c5836[_0xb885('0x26')]>0x0){_0x5c5836[_0xb885('0x1f')](function(_0x17a45e){if(_0x17a45e==='ListId'){_0x33dfe9[_0xb885('0x4c')](_0xb885('0x4d'),[][_0xb885('0x4e')](_0x192068[_0x17a45e]));}else if(_0x17a45e===_0xb885('0x4b')){var _0x4c814d='%'+_0x192068[_0x17a45e]+'%';_0x33dfe9[_0xb885('0x4c')]('CONCAT_WS(\x27\x20\x27,\x20c.firstName,\x20c.lastName,\x20c.email)\x20LIKE\x20?',_0x4c814d);}else if(_0x17a45e===_0xb885('0x43')){_0x33dfe9[_0xb885('0x4c')]('uc.UserId\x20=\x20?',_0x192068[_0x17a45e]);}else{_0x33dfe9['and']('c.'+_0x17a45e+_0xb885('0x4f'),_0x192068[_0x17a45e]);}});}return _0x33dfe9;}function parseQueryParameters(_0xf3f715,_0x16d440){var _0x375405=getSqlClauses();return Promise['resolve']()['then'](function(){return parseModelFields(_0xf3f715,_0x16d440);})[_0xb885('0x50')](function(_0x26f1fc){_0x375405[_0xb885('0x51')]['and'](_0x26f1fc);return parseTagParameter(_0xf3f715[_0xb885('0x52')]);})[_0xb885('0x50')](function(_0x38d8a3){_0x375405['tags'][_0xb885('0x41')][_0xb885('0x4c')](_0x38d8a3);return parseSearchFilter(_0xf3f715[_0xb885('0x53')]);})[_0xb885('0x50')](function(_0x46211a){_0x375405[_0xb885('0x53')]=_0x46211a;return _0x375405;});}function checkListsRestrictions(_0x347808,_0x21cb0a,_0x50dc1){var _0x4d0b02=squel[_0xb885('0x21')]();return Promise['resolve']()[_0xb885('0x50')](function(){if(_0x21cb0a[_0xb885('0x5')]&&_0x347808['role']===_0xb885('0x4')&&!_0x50dc1){return _0x347808[_0xb885('0x54')]({'attributes':['id'],'raw':!![]});}})[_0xb885('0x50')](function(_0x59705e){if(_0x59705e){if(_0x59705e[_0xb885('0x26')]===0x0){_0x4d0b02[_0xb885('0x4c')]('c.ListId\x20IS\x20NULL');}else{_0x4d0b02[_0xb885('0x4c')]('c.ListId\x20IN\x20?',_[_0xb885('0x3f')](_0x59705e,'id'));}}})[_0xb885('0x50')](function(){return _0x4d0b02;});}function buildContactsQuery(_0x2e77db,_0xa28dc3,_0x45d190,_0x13e12b,_0x1ee01d,_0x500cae){if(_0xa28dc3){_0xa28dc3=_0x45d190[_0xb885('0x55')];}_0x2e77db=addFieldsToQuery(_0x2e77db,_0xa28dc3,_0x13e12b,_0x500cae,!![]);var _0x2c2984=squel[_0xb885('0x7')]();_0x2c2984=addFieldsToQuery(_0x2c2984,_0xa28dc3,_0x13e12b,_0x500cae,![]);if(_0x13e12b||_0x500cae){_0x2e77db=applyJoinClauses(_0x2e77db,!![]);_0x2e77db[_0xb885('0x56')](_0xb885('0x57'));if(_0x45d190[_0xb885('0x58')]){_0x2c2984[_0xb885('0x58')](_0x45d190[_0xb885('0x58')]);}if(_0x45d190[_0xb885('0x59')]){_0x2c2984[_0xb885('0x59')](_0x45d190[_0xb885('0x59')]);}}else{_0x2c2984=applyJoinClauses(_0x2c2984,![]);_0x2c2984['group'](_0xb885('0x5a'));if(_0x45d190[_0xb885('0x58')]){_0x2e77db[_0xb885('0x58')](_0x45d190['limit']);}if(_0x45d190[_0xb885('0x59')]){_0x2e77db['offset'](_0x45d190[_0xb885('0x59')]);}}_0x2c2984['having'](_0x1ee01d);if(_0x45d190['order']){_0x45d190[_0xb885('0x5b')][_0xb885('0x1f')](function(_0x43dc2a){_0x2e77db[_0xb885('0x5b')]('c.'+_0x43dc2a[0x0],_0x43dc2a[0x1]==='DESC'?![]:!![]);_0x2c2984[_0xb885('0x5b')](_0xb885('0x5c')+_0x43dc2a[0x0],_0x43dc2a[0x1]===_0xb885('0x5d')?![]:!![]);});}_0x2c2984[_0xb885('0x8')](_0x2e77db,'subqry');return _0x2c2984;}function getFilteredContacts(_0x457d9){var _0x16aa87=[];return db[_0xb885('0x3e')]['findAll']({'attributes':['id',_0xb885('0x49'),_0xb885('0x5e')],'raw':!![]})[_0xb885('0x50')](function(_0x3fe696){_0x16aa87=_[_0xb885('0x5f')](_0x3fe696,'id');var _0x113c32={'type':db[_0xb885('0x60')][_0xb885('0x61')][_0xb885('0x62')],'model':db[_0xb885('0x63')],'mapToModel':!![],'nest':!![],'raw':!![]};return db[_0xb885('0x64')][_0xb885('0x65')](_0x457d9[_0xb885('0x66')](),_0x113c32);})[_0xb885('0x50')](function(_0x4d2595){_0x4d2595[_0xb885('0x1f')](function(_0x92a5c5){if(_0x92a5c5[_0xb885('0x1c')]){_0x92a5c5[_0xb885('0x67')]=[];_0x92a5c5['TagIds'][_0xb885('0x25')](',')['forEach'](function(_0x307004){_0x92a5c5[_0xb885('0x67')]['push'](_0x16aa87[_0x307004]);});}delete _0x92a5c5[_0xb885('0x1c')];});return _0x4d2595;});}function countFilteredContacts(_0x87433f,_0x139487){var _0x489e76=_0x87433f[_0xb885('0x68')]();_0x489e76['field']('COUNT(*)');_0x489e76=applyJoinClauses(_0x489e76,!![]);_0x87433f[_0xb885('0x56')](_0xb885('0x57'));var _0x27638e=utils[_0xb885('0x22')](_0x139487);if(!_[_0xb885('0x69')](_0x27638e)){_0x489e76[_0xb885('0xa')](_0xb885('0x6a'),_0x27638e);}var _0xce5ff6={'type':db[_0xb885('0x60')][_0xb885('0x61')][_0xb885('0x62')],'raw':!![]};return db[_0xb885('0x64')][_0xb885('0x65')](_0x489e76['toString'](),_0xce5ff6)[_0xb885('0x50')](function(_0x3146ad){return _0x3146ad[0x0]['COUNT(*)'];});}module[_0xb885('0x6b')]={'buildContactsQuery':buildContactsQuery,'checkListsRestrictions':checkListsRestrictions,'countFilteredContacts':countFilteredContacts,'getContactsSubquery':getContactsSubquery,'getFilteredContacts':getFilteredContacts,'parseAdvancedSearchFilter':parseAdvancedSearchFilter,'parseQueryParameters':parseQueryParameters,'skipContactsQuery':skipContactsQuery}; \ No newline at end of file +var _0x188f=['cm_user_has_contacts','uc.CmContactId\x20=\x20','.id','left_join','cm_contact_has_tags','ct.CmContactId\x20=\x20','tools_tags','t.id\x20=\x20ct.TagId','subqry','lastName','phone','mobile','fax','updatedAt','includes','push','forEach','TagIds','field','GROUP_CONCAT(DISTINCT\x20t.id)','expr','getSelectedTags','replace','split','length','MATCH\x20(c.firstName,\x20c.lastName,\x20c.phone,\x20c.mobile,\x20c.fax,\x20c.email)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','getFullTextValue','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','sqlOperator','conditions','find','name','fieldType','datetime','castTo','type','default','text','value','start','end','map','tags','clause','ids','User','user','uc.UserId\x20=\x20?','keys','some','compact','Contact','and','concat','CONCAT_WS(\x27\x20\x27,\x20c.firstName,\x20c.lastName,\x20c.email)\x20LIKE\x20?','\x20=\x20?','resolve','fields','then','filter','getLists','c.ListId\x20IS\x20NULL','c.ListId\x20IN\x20?','attributes','group','c.id','limit','offset','subqry.id','having','order','DESC','subqry.','Tag','findAll','color','Sequelize','SELECT','CmContact','sequelize','query','toString','Tags','clone','COUNT(*)','isEmpty','QueryTypes','exports','lodash','squel','../parsers/advancedSearch','../parsers/qs','../../mysqldb','role','agent','search','ListId','autocomplete','true','from','where','c.deletedAt\x20IS\x20NULL'];(function(_0x2e9163,_0x459ade){var _0x4eb93e=function(_0x1a9916){while(--_0x1a9916){_0x2e9163['push'](_0x2e9163['shift']());}};_0x4eb93e(++_0x459ade);}(_0x188f,0x1a6));var _0xf188=function(_0x4ffa7f,_0xf0b43e){_0x4ffa7f=_0x4ffa7f-0x0;var _0x4c3607=_0x188f[_0x4ffa7f];return _0x4c3607;};'use strict';var _=require(_0xf188('0x0'));var squel=require(_0xf188('0x1'));var as=require(_0xf188('0x2'));var qs=require(_0xf188('0x3'));var utils=require('../interaction/utils');var db=require(_0xf188('0x4'))['db'];function skipContactsQuery(_0x4d4cd2,_0x31eeaf){var _0x2e7fb5=![];if(_0x4d4cd2[_0xf188('0x5')]===_0xf188('0x6')&&!_0x31eeaf[_0xf188('0x7')]&&!_0x31eeaf[_0xf188('0x8')]&&_0x31eeaf[_0xf188('0x9')]!==_0xf188('0xa')){_0x2e7fb5=!![];}return _0x2e7fb5;}function getContactsSubquery(){return squel['select']()[_0xf188('0xb')]('cm_contacts','c')[_0xf188('0xc')](_0xf188('0xd'));}function applyJoinClauses(_0x17ca6c,_0xaa8e19){var _0xdca23a=_0xaa8e19?'c':'subqry';_0x17ca6c['left_join'](_0xf188('0xe'),'uc',_0xf188('0xf')+_0xdca23a+_0xf188('0x10'))[_0xf188('0x11')](_0xf188('0x12'),'ct',_0xf188('0x13')+_0xdca23a+_0xf188('0x10'))['left_join'](_0xf188('0x14'),'t',_0xf188('0x15'));return _0x17ca6c;}function addFieldsToQuery(_0x39847b,_0x349b41,_0x389558,_0x224dbe,_0x461bc1){var _0x5739ff=_0x461bc1?'c':_0xf188('0x16');if(!_0x349b41){_0x349b41=['id','firstName',_0xf188('0x17'),_0xf188('0x18'),_0xf188('0x19'),_0xf188('0x1a'),'email',_0xf188('0x8'),'CompanyId','createdAt',_0xf188('0x1b'),'deletedAt','TagIds'];}else if(!_0x349b41[_0xf188('0x1c')]('id')){_0x349b41[_0xf188('0x1d')]('id');}var _0x155a47=_0x389558&&_0x461bc1||!_0x389558&&!_0x461bc1;if(_0x224dbe){_0x155a47=_0x224dbe&&_0x461bc1||!_0x224dbe&&!_0x461bc1;}_0x349b41[_0xf188('0x1e')](function(_0x40988b){if(_0x40988b===_0xf188('0x1f')){if(_0x155a47){_0x39847b[_0xf188('0x20')](_0xf188('0x21'),_0x40988b);}else if(_0x389558||_0x224dbe){_0x39847b[_0xf188('0x20')](_0x5739ff+'.'+_0x40988b);}}else{_0x39847b[_0xf188('0x20')](_0x5739ff+'.'+_0x40988b);}});return _0x39847b;}function getSqlClauses(){var _0xde7b7d={'default':squel[_0xf188('0x22')](),'fields':squel['expr'](),'filter':squel[_0xf188('0x22')](),'tags':{'clause':squel[_0xf188('0x22')](),'ids':null},'user':{'clause':squel[_0xf188('0x22')](),'skip':![]}};return _0xde7b7d;}function parseTagParameter(_0x4f1328){var _0x10a539=squel['expr']();if(_0x4f1328){var _0x53e0ca=utils[_0xf188('0x23')](_0x4f1328);_0x53e0ca[_0xf188('0x1e')](function(_0x5c2bab){_0x10a539['or']('CONCAT(\x27,\x27,\x20subqry.TagIds,\x20\x27,\x27)\x20LIKE\x20?','%,'+_0x5c2bab+',%');});}return _0x10a539;}function parseSearchFilter(_0x1029f3){var _0x389318=squel['expr']();if(_0x1029f3){var _0x5e96d1=_0x1029f3[_0xf188('0x24')]('\x5c','\x5c\x5c')['replace'](/'/g,'\x27\x27');if(_0x5e96d1[_0xf188('0x25')]('\x20')[_0xf188('0x26')]>0x1){_0x389318['or'](_0xf188('0x27'),qs[_0xf188('0x28')](_0x5e96d1,!![]),null);}else{if(qs[_0xf188('0x29')](_0x5e96d1)){_0x389318['or'](_0xf188('0x2a'),_0x5e96d1+'%');_0x389318['or'](_0xf188('0x2b'),_0x5e96d1+'%');_0x389318['or']('c.mobile\x20LIKE\x20?',_0x5e96d1+'%');_0x389318['or'](_0xf188('0x2c'),_0x5e96d1+'%');}else if(qs['isEmail'](_0x5e96d1)){_0x389318['or'](_0xf188('0x2d'),_0x5e96d1+'%');}else{_0x389318['or'](_0xf188('0x2e'),'%'+_0x5e96d1+'%');_0x389318['or'](_0xf188('0x2f'),'%'+_0x5e96d1+'%');_0x389318['or']('c.email\x20LIKE\x20?','%'+_0x5e96d1+'%');}}}return _0x389318;}function parseAdvancedSearchFilter(_0x11216a,_0x3995dd){var _0x3dc806=getSqlClauses();var _0xcae16e=as[_0xf188('0x30')](_0x11216a);var _0x263187=_0xcae16e[_0xf188('0x31')];for(var _0x53132a=0x0;_0x53132a<_0xcae16e[_0xf188('0x32')]['length'];_0x53132a++){var _0x1b4084=_0xcae16e['conditions'][_0x53132a];var _0x47b872='c';var _0x4e510d=_[_0xf188('0x33')](_0x3995dd,[_0xf188('0x34'),_0x1b4084[_0xf188('0x20')]]);if(_0x4e510d){if(_0x1b4084[_0xf188('0x20')]==='dateOfBirth'||_0x4e510d[_0xf188('0x35')]===_0xf188('0x36')){_0x1b4084[_0xf188('0x37')]='DATE';}var _0xf9141=as['buildExpression'](_0x47b872,_0x4e510d[_0xf188('0x38')],_0x1b4084);_0x3dc806[_0xf188('0x39')][_0x263187](_0xf9141[_0xf188('0x3a')],_0xf9141[_0xf188('0x3b')][_0xf188('0x3c')],_0xf9141['value'][_0xf188('0x3d')]);}else{if(_0x1b4084[_0xf188('0x20')]==='Tag'){var _0x38b36a=_0x1b4084[_0xf188('0x3b')]['split'](',')[_0xf188('0x3e')](function(_0x570d67){return Number(_0x570d67);});var _0x3ef0f5=parseTagParameter(_0x38b36a);_0x3dc806[_0xf188('0x3f')][_0xf188('0x40')]['and'](_0x3ef0f5);_0x3dc806[_0xf188('0x3f')][_0xf188('0x41')]=_0x38b36a;}else if(_0x1b4084[_0xf188('0x20')]===_0xf188('0x42')){_0x3dc806[_0xf188('0x43')][_0xf188('0x40')]['and'](_0xf188('0x44'),_0x1b4084[_0xf188('0x3b')]);_0x3dc806[_0xf188('0x43')]['skip']=!![];}}}return _0x3dc806;}function parseModelFields(_0x164231,_0x52fcf9){var _0xa22448=squel[_0xf188('0x22')]();var _0x4db271=_(_0x164231)[_0xf188('0x45')]()[_0xf188('0x3e')](function(_0x45618a){return _[_0xf188('0x46')](_0x52fcf9,[_0xf188('0x34'),_0x45618a])?_0x45618a:undefined;})[_0xf188('0x47')]()[_0xf188('0x3b')]();if(_0x164231[_0xf188('0x48')]){_0x4db271['push'](_0xf188('0x48'));}if(_0x164231[_0xf188('0x42')]){_0x4db271[_0xf188('0x1d')](_0xf188('0x42'));}if(_0x4db271['length']>0x0){_0x4db271[_0xf188('0x1e')](function(_0x2ed99d){if(_0x2ed99d===_0xf188('0x8')){_0xa22448[_0xf188('0x49')]('c.ListId\x20IN\x20?',[][_0xf188('0x4a')](_0x164231[_0x2ed99d]));}else if(_0x2ed99d===_0xf188('0x48')){var _0x3bd074='%'+_0x164231[_0x2ed99d]+'%';_0xa22448[_0xf188('0x49')](_0xf188('0x4b'),_0x3bd074);}else if(_0x2ed99d===_0xf188('0x42')){_0xa22448[_0xf188('0x49')]('uc.UserId\x20=\x20?',_0x164231[_0x2ed99d]);}else{_0xa22448[_0xf188('0x49')]('c.'+_0x2ed99d+_0xf188('0x4c'),_0x164231[_0x2ed99d]);}});}return _0xa22448;}function parseQueryParameters(_0x1b97ea,_0x8aded7){var _0x7531a9=getSqlClauses();return Promise[_0xf188('0x4d')]()['then'](function(){return parseModelFields(_0x1b97ea,_0x8aded7);})['then'](function(_0x575947){_0x7531a9[_0xf188('0x4e')]['and'](_0x575947);return parseTagParameter(_0x1b97ea['tag']);})[_0xf188('0x4f')](function(_0x1ba690){_0x7531a9['tags'][_0xf188('0x40')][_0xf188('0x49')](_0x1ba690);return parseSearchFilter(_0x1b97ea['filter']);})[_0xf188('0x4f')](function(_0x14750d){_0x7531a9[_0xf188('0x50')]=_0x14750d;return _0x7531a9;});}function checkListsRestrictions(_0x44cef0,_0x814700,_0x53a023){var _0x233668=squel['expr']();return Promise[_0xf188('0x4d')]()[_0xf188('0x4f')](function(){if(_0x814700[_0xf188('0x7')]&&_0x44cef0['role']===_0xf188('0x6')&&!_0x53a023){return _0x44cef0[_0xf188('0x51')]({'attributes':['id'],'raw':!![]});}})[_0xf188('0x4f')](function(_0x476b1f){if(_0x476b1f){if(_0x476b1f['length']===0x0){_0x233668[_0xf188('0x49')](_0xf188('0x52'));}else{_0x233668[_0xf188('0x49')](_0xf188('0x53'),_[_0xf188('0x3e')](_0x476b1f,'id'));}}})['then'](function(){return _0x233668;});}function buildContactsQuery(_0x393592,_0x37a0c9,_0x434043,_0x292ffd,_0x429b93,_0xfe0b4b){if(_0x37a0c9){_0x37a0c9=_0x434043[_0xf188('0x54')];}_0x393592=addFieldsToQuery(_0x393592,_0x37a0c9,_0x292ffd,_0xfe0b4b,!![]);var _0xd0fd90=squel['select']();_0xd0fd90=addFieldsToQuery(_0xd0fd90,_0x37a0c9,_0x292ffd,_0xfe0b4b,![]);if(_0x292ffd||_0xfe0b4b){_0x393592=applyJoinClauses(_0x393592,!![]);_0x393592[_0xf188('0x55')](_0xf188('0x56'));if(_0x434043['limit']){_0xd0fd90['limit'](_0x434043[_0xf188('0x57')]);}if(_0x434043[_0xf188('0x58')]){_0xd0fd90['offset'](_0x434043[_0xf188('0x58')]);}}else{_0xd0fd90=applyJoinClauses(_0xd0fd90,![]);_0xd0fd90[_0xf188('0x55')](_0xf188('0x59'));if(_0x434043[_0xf188('0x57')]){_0x393592[_0xf188('0x57')](_0x434043[_0xf188('0x57')]);}if(_0x434043['offset']){_0x393592['offset'](_0x434043[_0xf188('0x58')]);}}_0xd0fd90[_0xf188('0x5a')](_0x429b93);if(_0x434043[_0xf188('0x5b')]){_0x434043[_0xf188('0x5b')][_0xf188('0x1e')](function(_0x35d946){_0x393592[_0xf188('0x5b')]('c.'+_0x35d946[0x0],_0x35d946[0x1]===_0xf188('0x5c')?![]:!![]);_0xd0fd90[_0xf188('0x5b')](_0xf188('0x5d')+_0x35d946[0x0],_0x35d946[0x1]===_0xf188('0x5c')?![]:!![]);});}_0xd0fd90[_0xf188('0xb')](_0x393592,_0xf188('0x16'));return _0xd0fd90;}function getFilteredContacts(_0x580de4){var _0x5c2e91=[];return db[_0xf188('0x5e')][_0xf188('0x5f')]({'attributes':['id','name',_0xf188('0x60')],'raw':!![]})[_0xf188('0x4f')](function(_0x39ea22){_0x5c2e91=_['keyBy'](_0x39ea22,'id');var _0x36a789={'type':db[_0xf188('0x61')]['QueryTypes'][_0xf188('0x62')],'model':db[_0xf188('0x63')],'mapToModel':!![],'nest':!![],'raw':!![]};return db[_0xf188('0x64')][_0xf188('0x65')](_0x580de4[_0xf188('0x66')](),_0x36a789);})[_0xf188('0x4f')](function(_0x49a0bd){_0x49a0bd['forEach'](function(_0x1282d8){if(_0x1282d8['TagIds']){_0x1282d8[_0xf188('0x67')]=[];_0x1282d8['TagIds']['split'](',')[_0xf188('0x1e')](function(_0x45a1b9){_0x1282d8['Tags']['push'](_0x5c2e91[_0x45a1b9]);});}delete _0x1282d8['TagIds'];});return _0x49a0bd;});}function countFilteredContacts(_0x3d03de,_0x33ea1b){var _0x17f083=_0x3d03de[_0xf188('0x68')]();_0x17f083[_0xf188('0x20')](_0xf188('0x69'));_0x17f083=applyJoinClauses(_0x17f083,!![]);_0x3d03de[_0xf188('0x55')](_0xf188('0x56'));var _0x27cf16=utils[_0xf188('0x23')](_0x33ea1b);if(!_[_0xf188('0x6a')](_0x27cf16)){_0x17f083[_0xf188('0xc')]('t.id\x20IN\x20?',_0x27cf16);}var _0x491e1d={'type':db[_0xf188('0x61')][_0xf188('0x6b')][_0xf188('0x62')],'raw':!![]};return db['sequelize'][_0xf188('0x65')](_0x17f083[_0xf188('0x66')](),_0x491e1d)[_0xf188('0x4f')](function(_0x310fc3){return _0x310fc3[0x0][_0xf188('0x69')];});}module[_0xf188('0x6c')]={'buildContactsQuery':buildContactsQuery,'checkListsRestrictions':checkListsRestrictions,'countFilteredContacts':countFilteredContacts,'getContactsSubquery':getContactsSubquery,'getFilteredContacts':getFilteredContacts,'parseAdvancedSearchFilter':parseAdvancedSearchFilter,'parseQueryParameters':parseQueryParameters,'skipContactsQuery':skipContactsQuery}; \ No newline at end of file diff --git a/server/components/encryptor/index.js b/server/components/encryptor/index.js index 5758398..d7f71e2 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 _0x4528=['createWriteStream','createCipher','data','update','binary','end','close','unlink','decryptFile','write','encryptString','secret','utf8','final','decryptString','createDecipher','crypto','bluebird','lodash','secrets','aes-256-ctr','aes192','encrypt','algorithm','join','is\x20not\x20a\x20supported\x20algorithm.\x20Your\x20system\x20supports\x20the\x20following\x20algorithms:','test','getCiphers','indexOf','hasOwnProperty','encryptFile'];(function(_0x1a1586,_0x2ddd60){var _0x59eca0=function(_0x22c619){while(--_0x22c619){_0x1a1586['push'](_0x1a1586['shift']());}};_0x59eca0(++_0x2ddd60);}(_0x4528,0x108));var _0x8452=function(_0x4f39a8,_0x1a4fdf){_0x4f39a8=_0x4f39a8-0x0;var _0xc40765=_0x4528[_0x4f39a8];return _0xc40765;};'use strict';var crypto=require(_0x8452('0x0'));var fs=require('fs');var BPromise=require(_0x8452('0x1'));var _=require(_0x8452('0x2'));var config=require('../../config/environment');var logger=require('../../config/logger')('app');const AES_SUPPORTED_RX=/^aes(-)?\d{3}(-(cbc|cfb|ctr)(1|8)?){0,1}$/;const stringOptions={'secret':config[_0x8452('0x3')]['session'],'algorithm':_0x8452('0x4')};const fileOptions={'algorithm':_0x8452('0x5')};if(config[_0x8452('0x6')]&&config[_0x8452('0x6')]['algorithm']){var isSupported=isAlgorithmSupported(config[_0x8452('0x6')]['algorithm']);if(isSupported){fileOptions[_0x8452('0x7')]=config[_0x8452('0x6')][_0x8452('0x7')];}else{var supportedAlgorithms=getSupportedCiphers()[_0x8452('0x8')](',\x20');logger['error'](config[_0x8452('0x6')][_0x8452('0x7')],_0x8452('0x9'),supportedAlgorithms);}}function isASupportedCipher(_0x468153){return AES_SUPPORTED_RX[_0x8452('0xa')](_0x468153);}function getSupportedCiphers(){return crypto[_0x8452('0xb')]()['filter'](isASupportedCipher);}function isAlgorithmSupported(_0x2a0012){return getSupportedCiphers()[_0x8452('0xc')](_0x2a0012)>-0x1;}function combineOptions(_0x15364e){var _0x2f8d2c={};for(var _0x20ff05 in fileOptions){if(fileOptions[_0x8452('0xd')](_0x20ff05)){_0x2f8d2c[_0x20ff05]=fileOptions[_0x20ff05];}}if(_0x15364e){for(var _0x56cea5 in _0x15364e){if(_0x15364e[_0x8452('0xd')](_0x56cea5)){_0x2f8d2c[_0x56cea5]=_0x15364e[_0x56cea5];}}}return _0x2f8d2c;}exports[_0x8452('0xe')]=function(_0x5c41de,_0x484ba6,_0x1381cc,_0x315ee5){return new BPromise(function(_0x26b4eb,_0x3c5570){_0x315ee5=combineOptions(_0x315ee5);var _0x36a7e0=new Buffer(_0x1381cc);var _0x58e457=fs['createReadStream'](_0x5c41de);var _0x577d70=fs[_0x8452('0xf')](_0x484ba6);var _0x3f5c82=crypto[_0x8452('0x10')](_0x315ee5[_0x8452('0x7')],_0x36a7e0);_0x58e457['on'](_0x8452('0x11'),function(_0x582700){var _0x3c21ae=new Buffer(_0x3f5c82[_0x8452('0x12')](_0x582700),_0x8452('0x13'));_0x577d70['write'](_0x3c21ae);});_0x58e457['on'](_0x8452('0x14'),function(){try{var _0x19e82c=new Buffer(_0x3f5c82['final'](_0x8452('0x13')),_0x8452('0x13'));_0x577d70['write'](_0x19e82c);_0x577d70[_0x8452('0x14')]();_0x577d70['on'](_0x8452('0x15'),function(){return _0x26b4eb(_0x484ba6);});}catch(_0xefa13c){fs[_0x8452('0x16')](_0x484ba6);return _0x3c5570(_0xefa13c);}});});};exports[_0x8452('0x17')]=function(_0x1f6d33,_0x31a786,_0x957b56,_0x4dfb60){return new BPromise(function(_0x5ca9ed,_0x57c89b){_0x4dfb60=combineOptions(_0x4dfb60);var _0x56de47=new Buffer(_0x957b56);var _0x23bc9a=fs['createReadStream'](_0x1f6d33);var _0x1b872e=fs[_0x8452('0xf')](_0x31a786);var _0x1116b8=crypto['createDecipher'](_0x4dfb60[_0x8452('0x7')],_0x56de47);_0x23bc9a['on'](_0x8452('0x11'),function(_0x5bc9e8){var _0x1e5912=new Buffer(_0x1116b8[_0x8452('0x12')](_0x5bc9e8),'binary');_0x1b872e['write'](_0x1e5912);});_0x23bc9a['on'](_0x8452('0x14'),function(){try{var _0x18fa5d=new Buffer(_0x1116b8['final'](_0x8452('0x13')),_0x8452('0x13'));_0x1b872e[_0x8452('0x18')](_0x18fa5d);_0x1b872e[_0x8452('0x14')]();_0x1b872e['on']('close',function(){return _0x5ca9ed(_0x31a786);});}catch(_0x55a831){fs[_0x8452('0x16')](_0x31a786);return _0x57c89b(_0x55a831);}});});};exports[_0x8452('0x19')]=function(_0x2c3611,_0x5b418f,_0xe1d5f2){var _0x589f2d=_0xe1d5f2||stringOptions['algorithm'];var _0x4e02b5=_0x5b418f||stringOptions[_0x8452('0x1a')];var _0x131f50=crypto[_0x8452('0x10')](_0x589f2d,_0x4e02b5);var _0x4b0969=_0x131f50[_0x8452('0x12')](_0x2c3611,_0x8452('0x1b'),'base64');_0x4b0969+=_0x131f50[_0x8452('0x1c')]('base64');return _0x4b0969;};exports[_0x8452('0x1d')]=function(_0x1804ad,_0x34939e,_0x536760){var _0x4dc3dd=_0x536760||stringOptions[_0x8452('0x7')];var _0x1e963c=_0x34939e||stringOptions[_0x8452('0x1a')];var _0x1f2e1c=crypto[_0x8452('0x1e')](_0x4dc3dd,_0x1e963c);var _0xbb5c1b=_0x1f2e1c[_0x8452('0x12')](_0x1804ad,'base64',_0x8452('0x1b'));_0xbb5c1b+=_0x1f2e1c[_0x8452('0x1c')](_0x8452('0x1b'));return _0xbb5c1b;}; \ No newline at end of file +var _0x9004=['encrypt','algorithm','join','error','is\x20not\x20a\x20supported\x20algorithm.\x20Your\x20system\x20supports\x20the\x20following\x20algorithms:','getCiphers','indexOf','hasOwnProperty','encryptFile','createReadStream','binary','end','final','write','close','unlink','createWriteStream','createDecipher','data','encryptString','secret','createCipher','update','utf8','base64','decryptString','crypto','lodash','../../config/environment','../../config/logger','secrets','session','aes192'];(function(_0x91cf87,_0x41ca45){var _0x2ee79b=function(_0x2a829c){while(--_0x2a829c){_0x91cf87['push'](_0x91cf87['shift']());}};_0x2ee79b(++_0x41ca45);}(_0x9004,0x143));var _0x4900=function(_0x4c3116,_0x1bc867){_0x4c3116=_0x4c3116-0x0;var _0x46b36c=_0x9004[_0x4c3116];return _0x46b36c;};'use strict';var crypto=require(_0x4900('0x0'));var fs=require('fs');var BPromise=require('bluebird');var _=require(_0x4900('0x1'));var config=require(_0x4900('0x2'));var logger=require(_0x4900('0x3'))('app');const AES_SUPPORTED_RX=/^aes(-)?\d{3}(-(cbc|cfb|ctr)(1|8)?){0,1}$/;const stringOptions={'secret':config[_0x4900('0x4')][_0x4900('0x5')],'algorithm':'aes-256-ctr'};const fileOptions={'algorithm':_0x4900('0x6')};if(config[_0x4900('0x7')]&&config['encrypt'][_0x4900('0x8')]){var isSupported=isAlgorithmSupported(config[_0x4900('0x7')]['algorithm']);if(isSupported){fileOptions['algorithm']=config[_0x4900('0x7')][_0x4900('0x8')];}else{var supportedAlgorithms=getSupportedCiphers()[_0x4900('0x9')](',\x20');logger[_0x4900('0xa')](config[_0x4900('0x7')][_0x4900('0x8')],_0x4900('0xb'),supportedAlgorithms);}}function isASupportedCipher(_0x305acd){return AES_SUPPORTED_RX['test'](_0x305acd);}function getSupportedCiphers(){return crypto[_0x4900('0xc')]()['filter'](isASupportedCipher);}function isAlgorithmSupported(_0x311f6d){return getSupportedCiphers()[_0x4900('0xd')](_0x311f6d)>-0x1;}function combineOptions(_0x325a06){var _0x35a73a={};for(var _0xabe47a in fileOptions){if(fileOptions[_0x4900('0xe')](_0xabe47a)){_0x35a73a[_0xabe47a]=fileOptions[_0xabe47a];}}if(_0x325a06){for(var _0x16ca51 in _0x325a06){if(_0x325a06[_0x4900('0xe')](_0x16ca51)){_0x35a73a[_0x16ca51]=_0x325a06[_0x16ca51];}}}return _0x35a73a;}exports[_0x4900('0xf')]=function(_0x31ea91,_0x3fc3e7,_0x4a6b50,_0x34d889){return new BPromise(function(_0x2bd82e,_0x788bdf){_0x34d889=combineOptions(_0x34d889);var _0x45754b=new Buffer(_0x4a6b50);var _0x321c26=fs[_0x4900('0x10')](_0x31ea91);var _0x4b3f65=fs['createWriteStream'](_0x3fc3e7);var _0x5712d4=crypto['createCipher'](_0x34d889[_0x4900('0x8')],_0x45754b);_0x321c26['on']('data',function(_0x5522d4){var _0x3f3fff=new Buffer(_0x5712d4['update'](_0x5522d4),_0x4900('0x11'));_0x4b3f65['write'](_0x3f3fff);});_0x321c26['on'](_0x4900('0x12'),function(){try{var _0x5c8024=new Buffer(_0x5712d4[_0x4900('0x13')]('binary'),_0x4900('0x11'));_0x4b3f65[_0x4900('0x14')](_0x5c8024);_0x4b3f65[_0x4900('0x12')]();_0x4b3f65['on'](_0x4900('0x15'),function(){return _0x2bd82e(_0x3fc3e7);});}catch(_0x4ed53e){fs[_0x4900('0x16')](_0x3fc3e7);return _0x788bdf(_0x4ed53e);}});});};exports['decryptFile']=function(_0xdf591c,_0x9d79a1,_0x36d3e2,_0x220690){return new BPromise(function(_0x4b9dab,_0xe3ac7a){_0x220690=combineOptions(_0x220690);var _0x177c4f=new Buffer(_0x36d3e2);var _0x560fd6=fs[_0x4900('0x10')](_0xdf591c);var _0x5dd252=fs[_0x4900('0x17')](_0x9d79a1);var _0x5d3f2c=crypto[_0x4900('0x18')](_0x220690[_0x4900('0x8')],_0x177c4f);_0x560fd6['on'](_0x4900('0x19'),function(_0x2ce60a){var _0x30efb7=new Buffer(_0x5d3f2c['update'](_0x2ce60a),_0x4900('0x11'));_0x5dd252[_0x4900('0x14')](_0x30efb7);});_0x560fd6['on'](_0x4900('0x12'),function(){try{var _0x40a7bd=new Buffer(_0x5d3f2c[_0x4900('0x13')](_0x4900('0x11')),_0x4900('0x11'));_0x5dd252[_0x4900('0x14')](_0x40a7bd);_0x5dd252[_0x4900('0x12')]();_0x5dd252['on'](_0x4900('0x15'),function(){return _0x4b9dab(_0x9d79a1);});}catch(_0x400702){fs[_0x4900('0x16')](_0x9d79a1);return _0xe3ac7a(_0x400702);}});});};exports[_0x4900('0x1a')]=function(_0x4d6ca0,_0x40a376,_0x15329c){var _0x2e6fe7=_0x15329c||stringOptions[_0x4900('0x8')];var _0x2eadac=_0x40a376||stringOptions[_0x4900('0x1b')];var _0x36cfcd=crypto[_0x4900('0x1c')](_0x2e6fe7,_0x2eadac);var _0x1fab14=_0x36cfcd[_0x4900('0x1d')](_0x4d6ca0,_0x4900('0x1e'),_0x4900('0x1f'));_0x1fab14+=_0x36cfcd[_0x4900('0x13')](_0x4900('0x1f'));return _0x1fab14;};exports[_0x4900('0x20')]=function(_0x5ae959,_0xb77ae6,_0x3be94d){var _0x3d34a8=_0x3be94d||stringOptions[_0x4900('0x8')];var _0x1d1620=_0xb77ae6||stringOptions[_0x4900('0x1b')];var _0x12e2fb=crypto[_0x4900('0x18')](_0x3d34a8,_0x1d1620);var _0x468b87=_0x12e2fb[_0x4900('0x1d')](_0x5ae959,_0x4900('0x1f'),_0x4900('0x1e'));_0x468b87+=_0x12e2fb[_0x4900('0x13')](_0x4900('0x1e'));return _0x468b87;}; \ No newline at end of file diff --git a/server/components/export/csv.js b/server/components/export/csv.js index 9a4a1f7..1d59696 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 _0x2fbe=['lodash','to-csv','bluebird','zip-dir','rimraf','../../mysqldb','dbH','../../config/logger','analytics','argv','savename','update','info','format','CSV','Setting','find','split','then','splitSizeCsv','sequelize','SELECT','num','length','query','QueryTypes','push','%s\x20limit\x20%d\x20OFFSET\x20%d','dirname','.csv','existsSync','mkdirSync','join','%s%d.%s','csv','%s.%s','writeFileSync','zip','zip\x20finished','Extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format\x20completed','Completed','catch','Failed','exit'];(function(_0x131acf,_0x4b4597){var _0x40d32e=function(_0x804943){while(--_0x804943){_0x131acf['push'](_0x131acf['shift']());}};_0x40d32e(++_0x4b4597);}(_0x2fbe,0x134));var _0xe2fb=function(_0x1b3b8d,_0x1487b6){_0x1b3b8d=_0x1b3b8d-0x0;var _0x1ab26d=_0x2fbe[_0x1b3b8d];return _0x1ab26d;};'use strict';var util=require('util');var path=require('path');var _=require(_0xe2fb('0x0'));var csv=require(_0xe2fb('0x1'));var fs=require('fs');var BPromise=require(_0xe2fb('0x2'));var zipdir=require(_0xe2fb('0x3'));var rimraf=require(_0xe2fb('0x4'));var db=require(_0xe2fb('0x5'))['db'];var dbH=require('../../mysqldb')[_0xe2fb('0x6')];var logger=require(_0xe2fb('0x7'))(_0xe2fb('0x8'));var EXTRACTED_REPORT_ID=Number(process[_0xe2fb('0x9')][0x2]);var QUERY=process[_0xe2fb('0x9')][0x3];var PATH=process[_0xe2fb('0x9')][0x4];var EXIT_CODE=0x0;function analyticExtractedReport(_0x18e9c8,_0x5f168e){var _0x231f57={'status':_0x18e9c8};var _0x10113c={'where':{'id':EXTRACTED_REPORT_ID}};if(_0x5f168e){_0x231f57[_0xe2fb('0xa')]=_0x5f168e;}return db['AnalyticExtractedReport'][_0xe2fb('0xb')](_0x231f57,_0x10113c);}function main(){var _0x3bf1c5=0x1388;var _0x254e31;logger[_0xe2fb('0xc')](util[_0xe2fb('0xd')]('Start\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format',EXTRACTED_REPORT_ID,_0xe2fb('0xe')));return db[_0xe2fb('0xf')][_0xe2fb('0x10')]({'where':{'id':0x1},'raw':!![],'attributes':['id',_0xe2fb('0x11'),'splitSizeCsv']})[_0xe2fb('0x12')](function(_0x5c57b0){if(_0x5c57b0){_0x254e31=_0x5c57b0;_0x3bf1c5=_0x254e31[_0xe2fb('0x13')]||0x1388;}})[_0xe2fb('0x12')](function(){return dbH['sequelize']['query'](util['format']('SELECT\x20count(*)\x20as\x20num\x20FROM\x20(%s)\x20t',QUERY),{'type':dbH[_0xe2fb('0x14')]['QueryTypes'][_0xe2fb('0x15')]});})['then'](function(_0x4477a8){if(!_0x4477a8[0x0][_0xe2fb('0x16')]){return analyticExtractedReport('Empty');}var _0x26e020=[];var _0x371b84=0x0;if(_0x254e31[_0xe2fb('0x11')]){if(_0x4477a8&&_0x4477a8[_0xe2fb('0x17')]){var _0x3fdb6d=_['range'](_0x4477a8[0x0][_0xe2fb('0x16')]/_0x3bf1c5);var _0x1063a5=Number['isInteger'](_0x4477a8[0x0][_0xe2fb('0x16')]/_0x3bf1c5)?_0x4477a8[0x0]['num']%_0x3bf1c5:0x0;_0x3fdb6d['forEach'](function(_0x1702f4){if(_0x1702f4>0x0){_0x371b84+=_0x3bf1c5;}_0x26e020['push'](dbH[_0xe2fb('0x14')][_0xe2fb('0x18')](util[_0xe2fb('0xd')]('%s\x20limit\x20%d\x20OFFSET\x20%d',QUERY,_0x3bf1c5,_0x371b84),{'type':dbH[_0xe2fb('0x14')][_0xe2fb('0x19')][_0xe2fb('0x15')]}));});if(_0x1063a5>0x0){_0x371b84+=_0x3bf1c5;_0x26e020[_0xe2fb('0x1a')](dbH[_0xe2fb('0x14')][_0xe2fb('0x18')](util[_0xe2fb('0xd')](_0xe2fb('0x1b'),QUERY,_0x1063a5,_0x371b84),{'type':dbH[_0xe2fb('0x14')][_0xe2fb('0x19')][_0xe2fb('0x15')]}));}}}else{_0x26e020[_0xe2fb('0x1a')](dbH[_0xe2fb('0x14')][_0xe2fb('0x18')](QUERY,{'type':dbH['sequelize']['QueryTypes'][_0xe2fb('0x15')]}));}var _0x43baf8=path[_0xe2fb('0x1c')](PATH);var _0x20021=path['basename'](PATH,_0xe2fb('0x1d'));var _0x3f692b=_0x254e31[_0xe2fb('0x11')]&&_0x26e020['length']>0x1;var _0x48cc85=[];if(!fs[_0xe2fb('0x1e')](path['join'](_0x43baf8,_0x20021))&&_0x3f692b){fs[_0xe2fb('0x1f')](path['join'](_0x43baf8,_0x20021));}return BPromise['each'](_0x26e020,function(_0xb59a1c){_0x48cc85['push'](_0xb59a1c);})['then'](function(){for(var _0x2fe82e=0x0;_0x2fe82e<_0x48cc85['length'];_0x2fe82e+=0x1){var _0x437944;var _0xea6d5e=_0x48cc85[_0x2fe82e];if(_0x3f692b){_0x437944=path[_0xe2fb('0x20')](_0x43baf8,_0x20021,util[_0xe2fb('0xd')](_0xe2fb('0x21'),_0x20021,_0x2fe82e,_0xe2fb('0x22')));}else{_0x437944=path['join'](_0x43baf8,util['format'](_0xe2fb('0x23'),_0x20021,'csv'));}fs[_0xe2fb('0x24')](_0x437944,csv(_0xea6d5e));}})['then'](function(){if(_0x3f692b){return new Promise(function(_0x3190e8){zipdir(path[_0xe2fb('0x20')](_0x43baf8,_0x20021),{'saveTo':path[_0xe2fb('0x20')](_0x43baf8,util['format']('%s.%s',_0x20021,_0xe2fb('0x25')))},function(_0x2adaf0,_0x3fa08e){rimraf(path[_0xe2fb('0x20')](_0x43baf8,_0x20021),function(){});_0x3190e8(_0xe2fb('0x26'));});});}})['then'](function(){logger[_0xe2fb('0xc')](util[_0xe2fb('0xd')](_0xe2fb('0x27'),EXTRACTED_REPORT_ID,_0xe2fb('0xe')));return analyticExtractedReport(_0xe2fb('0x28'),_0x3f692b?util[_0xe2fb('0xd')](_0xe2fb('0x23'),_0x20021,_0x3f692b?_0xe2fb('0x25'):_0xe2fb('0x22')):null);});})[_0xe2fb('0x29')](function(_0x225a05){logger[_0xe2fb('0xc')](util[_0xe2fb('0xd')]('Error\x20during\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format',EXTRACTED_REPORT_ID,_0xe2fb('0xe')),util['inspect'](_0x225a05,{'showHidden':![],'depth':null}));EXIT_CODE=0x1;return analyticExtractedReport(_0xe2fb('0x2a'));})['finally'](function(){process[_0xe2fb('0x2b')](EXIT_CODE);});}main(); \ No newline at end of file +var _0xb7a8=['Failed','exit','util','path','lodash','to-csv','zip-dir','rimraf','../../mysqldb','dbH','analytics','argv','savename','AnalyticExtractedReport','update','info','format','Start\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format','CSV','find','split','splitSizeCsv','then','sequelize','query','SELECT\x20count(*)\x20as\x20num\x20FROM\x20(%s)\x20t','QueryTypes','SELECT','num','Empty','length','range','forEach','push','%s\x20limit\x20%d\x20OFFSET\x20%d','dirname','basename','.csv','existsSync','join','mkdirSync','each','%s%d.%s','csv','%s.%s','writeFileSync','zip','Completed','catch','inspect'];(function(_0x19e35c,_0x29cd1e){var _0x3e1fe8=function(_0x17258b){while(--_0x17258b){_0x19e35c['push'](_0x19e35c['shift']());}};_0x3e1fe8(++_0x29cd1e);}(_0xb7a8,0x160));var _0x8b7a=function(_0x42161d,_0xd933){_0x42161d=_0x42161d-0x0;var _0x5889c2=_0xb7a8[_0x42161d];return _0x5889c2;};'use strict';var util=require(_0x8b7a('0x0'));var path=require(_0x8b7a('0x1'));var _=require(_0x8b7a('0x2'));var csv=require(_0x8b7a('0x3'));var fs=require('fs');var BPromise=require('bluebird');var zipdir=require(_0x8b7a('0x4'));var rimraf=require(_0x8b7a('0x5'));var db=require(_0x8b7a('0x6'))['db'];var dbH=require('../../mysqldb')[_0x8b7a('0x7')];var logger=require('../../config/logger')(_0x8b7a('0x8'));var EXTRACTED_REPORT_ID=Number(process[_0x8b7a('0x9')][0x2]);var QUERY=process['argv'][0x3];var PATH=process[_0x8b7a('0x9')][0x4];var EXIT_CODE=0x0;function analyticExtractedReport(_0x51eb8d,_0x373f78){var _0x36fad4={'status':_0x51eb8d};var _0xf87ad5={'where':{'id':EXTRACTED_REPORT_ID}};if(_0x373f78){_0x36fad4[_0x8b7a('0xa')]=_0x373f78;}return db[_0x8b7a('0xb')][_0x8b7a('0xc')](_0x36fad4,_0xf87ad5);}function main(){var _0x2e34c5=0x1388;var _0x37fb98;logger[_0x8b7a('0xd')](util[_0x8b7a('0xe')](_0x8b7a('0xf'),EXTRACTED_REPORT_ID,_0x8b7a('0x10')));return db['Setting'][_0x8b7a('0x11')]({'where':{'id':0x1},'raw':!![],'attributes':['id',_0x8b7a('0x12'),_0x8b7a('0x13')]})[_0x8b7a('0x14')](function(_0x8ce608){if(_0x8ce608){_0x37fb98=_0x8ce608;_0x2e34c5=_0x37fb98[_0x8b7a('0x13')]||0x1388;}})[_0x8b7a('0x14')](function(){return dbH[_0x8b7a('0x15')][_0x8b7a('0x16')](util[_0x8b7a('0xe')](_0x8b7a('0x17'),QUERY),{'type':dbH['sequelize'][_0x8b7a('0x18')][_0x8b7a('0x19')]});})[_0x8b7a('0x14')](function(_0x2f8f86){if(!_0x2f8f86[0x0][_0x8b7a('0x1a')]){return analyticExtractedReport(_0x8b7a('0x1b'));}var _0x146746=[];var _0x694fac=0x0;if(_0x37fb98[_0x8b7a('0x12')]){if(_0x2f8f86&&_0x2f8f86[_0x8b7a('0x1c')]){var _0x4d1515=_[_0x8b7a('0x1d')](_0x2f8f86[0x0][_0x8b7a('0x1a')]/_0x2e34c5);var _0x2ea989=Number['isInteger'](_0x2f8f86[0x0]['num']/_0x2e34c5)?_0x2f8f86[0x0][_0x8b7a('0x1a')]%_0x2e34c5:0x0;_0x4d1515[_0x8b7a('0x1e')](function(_0x4a3378){if(_0x4a3378>0x0){_0x694fac+=_0x2e34c5;}_0x146746[_0x8b7a('0x1f')](dbH[_0x8b7a('0x15')][_0x8b7a('0x16')](util['format']('%s\x20limit\x20%d\x20OFFSET\x20%d',QUERY,_0x2e34c5,_0x694fac),{'type':dbH[_0x8b7a('0x15')][_0x8b7a('0x18')][_0x8b7a('0x19')]}));});if(_0x2ea989>0x0){_0x694fac+=_0x2e34c5;_0x146746[_0x8b7a('0x1f')](dbH['sequelize']['query'](util['format'](_0x8b7a('0x20'),QUERY,_0x2ea989,_0x694fac),{'type':dbH[_0x8b7a('0x15')][_0x8b7a('0x18')][_0x8b7a('0x19')]}));}}}else{_0x146746[_0x8b7a('0x1f')](dbH['sequelize']['query'](QUERY,{'type':dbH['sequelize'][_0x8b7a('0x18')][_0x8b7a('0x19')]}));}var _0x4db1b6=path[_0x8b7a('0x21')](PATH);var _0x5e8df4=path[_0x8b7a('0x22')](PATH,_0x8b7a('0x23'));var _0x1674d2=_0x37fb98[_0x8b7a('0x12')]&&_0x146746['length']>0x1;var _0x2861e8=[];if(!fs[_0x8b7a('0x24')](path[_0x8b7a('0x25')](_0x4db1b6,_0x5e8df4))&&_0x1674d2){fs[_0x8b7a('0x26')](path[_0x8b7a('0x25')](_0x4db1b6,_0x5e8df4));}return BPromise[_0x8b7a('0x27')](_0x146746,function(_0x290dae){_0x2861e8[_0x8b7a('0x1f')](_0x290dae);})[_0x8b7a('0x14')](function(){for(var _0x289e21=0x0;_0x289e21<_0x2861e8[_0x8b7a('0x1c')];_0x289e21+=0x1){var _0x4ecb97;var _0x1fe868=_0x2861e8[_0x289e21];if(_0x1674d2){_0x4ecb97=path[_0x8b7a('0x25')](_0x4db1b6,_0x5e8df4,util[_0x8b7a('0xe')](_0x8b7a('0x28'),_0x5e8df4,_0x289e21,_0x8b7a('0x29')));}else{_0x4ecb97=path[_0x8b7a('0x25')](_0x4db1b6,util['format'](_0x8b7a('0x2a'),_0x5e8df4,_0x8b7a('0x29')));}fs[_0x8b7a('0x2b')](_0x4ecb97,csv(_0x1fe868));}})['then'](function(){if(_0x1674d2){return new Promise(function(_0x15b6b7){zipdir(path[_0x8b7a('0x25')](_0x4db1b6,_0x5e8df4),{'saveTo':path['join'](_0x4db1b6,util[_0x8b7a('0xe')](_0x8b7a('0x2a'),_0x5e8df4,_0x8b7a('0x2c')))},function(_0x5f4d56,_0x16b511){rimraf(path[_0x8b7a('0x25')](_0x4db1b6,_0x5e8df4),function(){});_0x15b6b7('zip\x20finished');});});}})[_0x8b7a('0x14')](function(){logger[_0x8b7a('0xd')](util['format']('Extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format\x20completed',EXTRACTED_REPORT_ID,_0x8b7a('0x10')));return analyticExtractedReport(_0x8b7a('0x2d'),_0x1674d2?util[_0x8b7a('0xe')](_0x8b7a('0x2a'),_0x5e8df4,_0x1674d2?_0x8b7a('0x2c'):'csv'):null);});})[_0x8b7a('0x2e')](function(_0xa003a3){logger[_0x8b7a('0xd')](util[_0x8b7a('0xe')]('Error\x20during\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format',EXTRACTED_REPORT_ID,_0x8b7a('0x10')),util[_0x8b7a('0x2f')](_0xa003a3,{'showHidden':![],'depth':null}));EXIT_CODE=0x1;return analyticExtractedReport(_0x8b7a('0x30'));})['finally'](function(){process[_0x8b7a('0x31')](EXIT_CODE);});}main(); \ No newline at end of file diff --git a/server/components/export/pdf.js b/server/components/export/pdf.js index b3a945d..f89f48e 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 _0x92ce=['Setting','find','split','splitSizePdf','then','isInteger','query','%s\x20limit\x20%d\x20OFFSET\x20%d','sequelize','QueryTypes','SELECT','dirname','basename','.pdf','existsSync','join','each','flatten','createPdfKitDocument','%s%d.%s','pdf','all','%s.%s','zip','zip\x20finished','Extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format\x20completed','Completed','Start\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format','SELECT\x20count(*)\x20as\x20num\x20FROM\x20(%s)\x20t','info','Error\x20during\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format','PDF','inspect','finally','exit','/fonts/arial-regular.ttf','/fonts/arial-bold.ttf','/fonts/arial-italic.ttf','/fonts/arial-bold-italic.ttf','channel','center','Interaction\x20Transcript','\x09\x09XCALLY\x20Motion\x20-\x20%s\x09\x09\x09\x09%d/%d\x09\x09\x09\x09%s','createWriteStream','finish','error','createPdfFromHTML','catch','path','moment','html-to-pdfmake','pdfmake/src/printer','zip-dir','rimraf','jsdom','JSDOM','window','../../mysqldb','dbH','../../config/logger','argv','MMMM\x20Do\x20YYYY,\x20h:mm:ss\x20a','savename','AnalyticExtractedReport','update','map','toString','value','fill','length','auto','body','chunk','keys','push','format','startDate','header','pageBreak','before','margin','\x20/\x20','footer','Arial','black','right','num','Empty'];(function(_0x2fc284,_0x5d271c){var _0x221234=function(_0x39fb00){while(--_0x39fb00){_0x2fc284['push'](_0x2fc284['shift']());}};_0x221234(++_0x5d271c);}(_0x92ce,0xe0));var _0xe92c=function(_0x6a7986,_0x30debf){_0x6a7986=_0x6a7986-0x0;var _0x381864=_0x92ce[_0x6a7986];return _0x381864;};'use strict';var _=require('lodash');var fs=require('fs');var util=require('util');var path=require(_0xe92c('0x0'));var moment=require(_0xe92c('0x1'));var htmlToPdfmake=require(_0xe92c('0x2'));var PdfPrinter=require(_0xe92c('0x3'));var zipdir=require(_0xe92c('0x4'));var rimraf=require(_0xe92c('0x5'));var JSDOM=require(_0xe92c('0x6'))[_0xe92c('0x7')];var window=new JSDOM('')[_0xe92c('0x8')];var BPromise=require('bluebird');var db=require('../../mysqldb')['db'];var dbH=require(_0xe92c('0x9'))[_0xe92c('0xa')];var logger=require(_0xe92c('0xb'))('analytics');var EXTRACTED_REPORT_ID=Number(process[_0xe92c('0xc')][0x2]);var QUERY=process[_0xe92c('0xc')][0x3];var PATH=process[_0xe92c('0xc')][0x4];var NAME=process[_0xe92c('0xc')][0x5];var FORMAT=_0xe92c('0xd');var EXTRACTED_REPORT;var EXIT_CODE=0x0;function analyticExtractedReport(_0x1ed033,_0x12624c){var _0x142930={'status':_0x1ed033};var _0x5b4f72={'where':{'id':EXTRACTED_REPORT_ID}};if(_0x12624c){_0x142930[_0xe92c('0xe')]=_0x12624c;}return db[_0xe92c('0xf')][_0xe92c('0x10')](_0x142930,_0x5b4f72);}function getHeaders(_0x2220a8){return _[_0xe92c('0x11')](_0x2220a8,function(_0x30543b){return{'text':_0x30543b,'style':'tableHeader'};});}function getRows(_0x1edb9b,_0x1c1129){return _[_0xe92c('0x11')](_0x1c1129,function(_0x4f48ce){return _(_0x4f48ce)['pick'](_0x1edb9b)['map'](function(_0x54f651){return _0x54f651?_[_0xe92c('0x12')](_0x54f651):'';})[_0xe92c('0x13')]();});}function createTable(_0x13a90e,_0x83aac4){var _0x2b6ada={'widths':_[_0xe92c('0x14')](Array(_0x13a90e[_0xe92c('0x15')]),0x91),'heights':function(_0x237f02){return _0x237f02===0x0?_0xe92c('0x16'):0x32;},'dontBreakRows':!![],'headerRows':0x1,'body':[]};var _0xc32f91=getHeaders(_0x13a90e);_0x2b6ada[_0xe92c('0x17')]['push'](_0xc32f91);var _0x458954=getRows(_0x13a90e,_0x83aac4);_0x2b6ada['body']=_0x2b6ada['body']['concat'](_0x458954);return _0x2b6ada;}function createTables(_0x2414ce){var _0x36505e=[];var _0x30e697=_[_0xe92c('0x18')](Object[_0xe92c('0x19')](_0x2414ce[0x0]),0x5);_0x30e697['forEach'](function(_0x9def1e){_0x36505e[_0xe92c('0x1a')](createTable(_0x9def1e,_0x2414ce));});return _0x36505e;}function getPDFDocDefinition(_0x29af7b){var _0x36a9da=util[_0xe92c('0x1b')]('Name:\x20%s\x0aReport:\x20%s\x0aFrom:\x20%s\x20To:\x20%s',NAME,EXTRACTED_REPORT['name'],moment(EXTRACTED_REPORT[_0xe92c('0x1c')])[_0xe92c('0x1b')](FORMAT),moment(EXTRACTED_REPORT['endDate'])['format'](FORMAT));var _0x3fbb98=[];for(var _0x5edf5e=0x0;_0x5edf5e<_0x29af7b['length'];_0x5edf5e++){var _0x4fac6b=[];if(_0x5edf5e===0x0){_0x4fac6b[_0xe92c('0x1a')]({'text':_0x36a9da,'style':_0xe92c('0x1d')});}var _0x4ff12f={'table':_0x29af7b[_0x5edf5e]};if(_0x5edf5e>0x0){_0x4ff12f[_0xe92c('0x1e')]=_0xe92c('0x1f');_0x4ff12f[_0xe92c('0x20')]=[0x0,0x46,0x0,0x0];}_0x4fac6b['push'](_0x4ff12f);_0x3fbb98[_0xe92c('0x1a')](_0x4fac6b);}return{'pageSize':'A4','pageOrientation':'landscape','content':_0x3fbb98,'footer':function(_0x380b8d,_0x164c2c){return{'text':_0x380b8d[_0xe92c('0x12')]()+_0xe92c('0x21')+_0x164c2c,'style':_0xe92c('0x22')};},'defaultStyle':{'font':_0xe92c('0x23')},'styles':{'header':{'fontSize':0x12,'bold':!![],'margin':[0x0,0x0,0x0,0xa]},'tableHeader':{'bold':!![],'fontSize':0xd,'color':_0xe92c('0x24')},'footer':{'alignment':_0xe92c('0x25'),'margin':[0x0,0x0,0x28,0x0]}}};}function extractReport(_0x8e84b3){var _0x3d7ca6=0x1388;var _0x3a484a;if(!_0x8e84b3[0x0][_0xe92c('0x26')]){return analyticExtractedReport(_0xe92c('0x27'));}return db[_0xe92c('0x28')][_0xe92c('0x29')]({'where':{'id':0x1},'raw':!![],'attributes':['id',_0xe92c('0x2a'),_0xe92c('0x2b')]})[_0xe92c('0x2c')](function(_0x4059bd){if(_0x4059bd){_0x3a484a=_0x4059bd;_0x3d7ca6=_0x3a484a['splitSizePdf']||0x3e8;}})[_0xe92c('0x2c')](function(){var _0x886f2d=[];var _0x443a32=0x0;if(_0x3a484a[_0xe92c('0x2a')]){if(_0x8e84b3&&_0x8e84b3[_0xe92c('0x15')]){var _0xaa6353=_['range'](_0x8e84b3[0x0][_0xe92c('0x26')]/_0x3d7ca6);var _0xfa885=Number[_0xe92c('0x2d')](_0x8e84b3[0x0]['num']/_0x3d7ca6)?_0x8e84b3[0x0][_0xe92c('0x26')]%_0x3d7ca6:0x0;_0xaa6353['forEach'](function(_0x425052){if(_0x425052>0x0){_0x443a32+=_0x3d7ca6;}_0x886f2d['push'](dbH['sequelize'][_0xe92c('0x2e')](util[_0xe92c('0x1b')](_0xe92c('0x2f'),QUERY,_0x3d7ca6,_0x443a32),{'type':dbH[_0xe92c('0x30')][_0xe92c('0x31')][_0xe92c('0x32')]}));});if(_0xfa885>0x0){_0x443a32+=_0x3d7ca6;_0x886f2d[_0xe92c('0x1a')](dbH[_0xe92c('0x30')][_0xe92c('0x2e')](util['format'](_0xe92c('0x2f'),QUERY,_0xfa885,_0x443a32),{'type':dbH[_0xe92c('0x30')]['QueryTypes'][_0xe92c('0x32')]}));}}}else{_0x886f2d[_0xe92c('0x1a')](dbH[_0xe92c('0x30')][_0xe92c('0x2e')](QUERY,{'type':dbH[_0xe92c('0x30')][_0xe92c('0x31')][_0xe92c('0x32')]}));}var _0x16f382=path[_0xe92c('0x33')](PATH);var _0x3b75b5=path[_0xe92c('0x34')](PATH,_0xe92c('0x35'));var _0x2578b5=_0x3a484a[_0xe92c('0x2a')]&&_0x886f2d['length']>0x1;var _0x58323a=[];if(!fs[_0xe92c('0x36')](path[_0xe92c('0x37')](_0x16f382,_0x3b75b5))&&_0x2578b5){fs['mkdirSync'](path[_0xe92c('0x37')](_0x16f382,_0x3b75b5));}return BPromise[_0xe92c('0x38')](_0x886f2d,function(_0x46ca59){_0x58323a[_0xe92c('0x1a')](_0x46ca59);})[_0xe92c('0x2c')](function(){var _0x11ca34=[];for(var _0x17738a=0x0;_0x17738a<_0x58323a[_0xe92c('0x15')];_0x17738a+=0x1){var _0x32d91a=_0x58323a[_0x17738a];var _0x587375=createTables(_[_0xe92c('0x39')](_0x32d91a));var _0xda2177;var _0x174b46=getPDFDocDefinition(_0x587375);var _0x23e387=getPDFPrinter();var _0x3a13be=_0x23e387[_0xe92c('0x3a')](_0x174b46);if(_0x2578b5){_0xda2177=path[_0xe92c('0x37')](_0x16f382,_0x3b75b5,util[_0xe92c('0x1b')](_0xe92c('0x3b'),_0x3b75b5,_0x17738a,'pdf'));}else{_0xda2177=path[_0xe92c('0x37')](_0x16f382,util[_0xe92c('0x1b')]('%s.%s',_0x3b75b5,_0xe92c('0x3c')));}_0x11ca34[_0xe92c('0x1a')](writePDFDocument(_0x3a13be,_0xda2177));}return Promise[_0xe92c('0x3d')](_0x11ca34);})['then'](function(){if(_0x2578b5){return new Promise(function(_0xd1ac5){zipdir(path['join'](_0x16f382,_0x3b75b5),{'saveTo':path[_0xe92c('0x37')](_0x16f382,util[_0xe92c('0x1b')](_0xe92c('0x3e'),_0x3b75b5,_0xe92c('0x3f')))},function(){rimraf(path[_0xe92c('0x37')](_0x16f382,_0x3b75b5),function(){});_0xd1ac5(_0xe92c('0x40'));});});}})[_0xe92c('0x2c')](function(){if(!_0x2578b5)return;rimraf(path[_0xe92c('0x37')](_0x16f382,_0x3b75b5),function(){});})[_0xe92c('0x2c')](function(){logger['info'](util[_0xe92c('0x1b')](_0xe92c('0x41'),EXTRACTED_REPORT_ID,'PDF'));return analyticExtractedReport(_0xe92c('0x42'),_0x2578b5?util[_0xe92c('0x1b')]('%s.%s',_0x3b75b5,_0x2578b5?_0xe92c('0x3f'):'pdf'):null);});});}function main(){if(!EXTRACTED_REPORT_ID)return;logger['info'](util[_0xe92c('0x1b')](_0xe92c('0x43'),EXTRACTED_REPORT_ID,'PDF'));return db['AnalyticExtractedReport']['findOne']({'where':{'id':EXTRACTED_REPORT_ID}})['then'](function(_0x4cb0b7){EXTRACTED_REPORT=_0x4cb0b7;return dbH[_0xe92c('0x30')][_0xe92c('0x2e')](util[_0xe92c('0x1b')](_0xe92c('0x44'),QUERY),{'type':dbH[_0xe92c('0x30')][_0xe92c('0x31')][_0xe92c('0x32')]});})[_0xe92c('0x2c')](extractReport)['catch'](function(_0x4607c9){logger[_0xe92c('0x45')](util[_0xe92c('0x1b')](_0xe92c('0x46'),EXTRACTED_REPORT_ID,_0xe92c('0x47')),util[_0xe92c('0x48')](_0x4607c9,{'showHidden':![],'depth':null}));EXIT_CODE=0x1;return analyticExtractedReport('Failed');})[_0xe92c('0x49')](function(){process[_0xe92c('0x4a')](EXIT_CODE);});}main();function getPDFPrinter(){var _0x1e8b98=new PdfPrinter({'Arial':{'normal':__dirname+_0xe92c('0x4b'),'bold':__dirname+_0xe92c('0x4c'),'italics':__dirname+_0xe92c('0x4d'),'bolditalics':__dirname+_0xe92c('0x4e')}});return _0x1e8b98;}function getPDFDocDefinitionFromHTML(_0x1fbda0,_0x219651){var _0x4c7f22=util['format']('%s\x20#%d',_0x219651[_0xe92c('0x4f')],_0x219651['interactionId']);var _0x4501a5=moment()[_0xe92c('0x1b')]('YYYY-MM-DD')[_0xe92c('0x12')]();var _0x37297f=htmlToPdfmake(_0x1fbda0,{'window':window,'tableAutoSize':!![]});return{'content':[_0x37297f],'defaultStyle':{'font':_0xe92c('0x23')},'styles':{'header':{'fontSize':0x12,'bold':!![],'alignment':_0xe92c('0x50'),'margin':[0xa,0xa,0xa,0xa]},'footer':{'fontSize':0x9,'alignment':_0xe92c('0x50'),'margin':[0xa,0x14,0xa,0xa]},'textblock':{'fontSize':0xb},'textfield':{'bold':!![]},'messageContainer':{'fontSize':0xa},'messageInfo':{'bold':!![]},'interactionData':{'alignment':_0xe92c('0x50')}},'header':function(){return[{'text':_0xe92c('0x51'),'style':_0xe92c('0x1d')}];},'footer':function(_0x2c1b24,_0x5b93b9){return[{'text':util[_0xe92c('0x1b')](_0xe92c('0x52'),_0x4c7f22,_0x2c1b24,_0x5b93b9,_0x4501a5),'style':_0xe92c('0x22')}];}};}function writePDFDocument(_0x2f13e7,_0x2e5c82){return new Promise(function(_0x13e4ee,_0x3ea1a6){var _0x4a56d4=_0x2f13e7['pipe'](fs[_0xe92c('0x53')](_0x2e5c82));_0x4a56d4['on'](_0xe92c('0x54'),function(){_0x13e4ee('finish');});_0x4a56d4['on'](_0xe92c('0x55'),function(_0x19ac37){_0x3ea1a6(_0x19ac37);});_0x2f13e7['end']();});}exports[_0xe92c('0x56')]=function(_0x37a684,_0x4a6ed3){var _0x6d2018=getPDFPrinter();var _0x35f17a=getPDFDocDefinitionFromHTML(_0x37a684,_0x4a6ed3);var _0x47e2f9=_0x6d2018[_0xe92c('0x3a')](_0x35f17a);return writePDFDocument(_0x47e2f9,_0x4a6ed3[_0xe92c('0x0')])[_0xe92c('0x57')](function(_0x48ffd5){throw _0x48ffd5;});}; \ No newline at end of file +var _0xd8db=['exit','/fonts/arial-regular.ttf','/fonts/arial-bold.ttf','/fonts/arial-italic.ttf','/fonts/arial-bold-italic.ttf','%s\x20#%d','channel','toString','center','\x09\x09XCALLY\x20Motion\x20-\x20%s\x09\x09\x09\x09%d/%d\x09\x09\x09\x09%s','finish','end','createPdfFromHTML','createPdfKitDocument','lodash','util','path','moment','html-to-pdfmake','pdfmake/src/printer','zip-dir','rimraf','jsdom','JSDOM','bluebird','../../mysqldb','dbH','../../config/logger','analytics','argv','MMMM\x20Do\x20YYYY,\x20h:mm:ss\x20a','AnalyticExtractedReport','update','map','tableHeader','value','fill','body','push','concat','chunk','keys','format','Name:\x20%s\x0aReport:\x20%s\x0aFrom:\x20%s\x20To:\x20%s','name','startDate','endDate','length','header','before','landscape','\x20/\x20','footer','Arial','black','right','num','Empty','Setting','find','split','splitSizePdf','then','isInteger','sequelize','query','QueryTypes','%s\x20limit\x20%d\x20OFFSET\x20%d','SELECT','basename','.pdf','existsSync','mkdirSync','join','each','%s%d.%s','pdf','%s.%s','zip','zip\x20finished','info','Extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format\x20completed','PDF','Start\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format','SELECT\x20count(*)\x20as\x20num\x20FROM\x20(%s)\x20t','catch','inspect','Failed','finally'];(function(_0x3afaf4,_0xb3ecd4){var _0x1dfa16=function(_0x354034){while(--_0x354034){_0x3afaf4['push'](_0x3afaf4['shift']());}};_0x1dfa16(++_0xb3ecd4);}(_0xd8db,0x67));var _0xbd8d=function(_0x52a9fa,_0x13f364){_0x52a9fa=_0x52a9fa-0x0;var _0x13280b=_0xd8db[_0x52a9fa];return _0x13280b;};'use strict';var _=require(_0xbd8d('0x0'));var fs=require('fs');var util=require(_0xbd8d('0x1'));var path=require(_0xbd8d('0x2'));var moment=require(_0xbd8d('0x3'));var htmlToPdfmake=require(_0xbd8d('0x4'));var PdfPrinter=require(_0xbd8d('0x5'));var zipdir=require(_0xbd8d('0x6'));var rimraf=require(_0xbd8d('0x7'));var JSDOM=require(_0xbd8d('0x8'))[_0xbd8d('0x9')];var window=new JSDOM('')['window'];var BPromise=require(_0xbd8d('0xa'));var db=require('../../mysqldb')['db'];var dbH=require(_0xbd8d('0xb'))[_0xbd8d('0xc')];var logger=require(_0xbd8d('0xd'))(_0xbd8d('0xe'));var EXTRACTED_REPORT_ID=Number(process['argv'][0x2]);var QUERY=process[_0xbd8d('0xf')][0x3];var PATH=process['argv'][0x4];var NAME=process[_0xbd8d('0xf')][0x5];var FORMAT=_0xbd8d('0x10');var EXTRACTED_REPORT;var EXIT_CODE=0x0;function analyticExtractedReport(_0x1188da,_0x4b957d){var _0x5c8c81={'status':_0x1188da};var _0x3813d8={'where':{'id':EXTRACTED_REPORT_ID}};if(_0x4b957d){_0x5c8c81['savename']=_0x4b957d;}return db[_0xbd8d('0x11')][_0xbd8d('0x12')](_0x5c8c81,_0x3813d8);}function getHeaders(_0x3be153){return _[_0xbd8d('0x13')](_0x3be153,function(_0x377811){return{'text':_0x377811,'style':_0xbd8d('0x14')};});}function getRows(_0x2ee2fa,_0x2284d8){return _['map'](_0x2284d8,function(_0x27292b){return _(_0x27292b)['pick'](_0x2ee2fa)[_0xbd8d('0x13')](function(_0x520bd1){return _0x520bd1?_['toString'](_0x520bd1):'';})[_0xbd8d('0x15')]();});}function createTable(_0x4a9a30,_0x3eb608){var _0x4cab91={'widths':_[_0xbd8d('0x16')](Array(_0x4a9a30['length']),0x91),'heights':function(_0x232d22){return _0x232d22===0x0?'auto':0x32;},'dontBreakRows':!![],'headerRows':0x1,'body':[]};var _0xb8e78d=getHeaders(_0x4a9a30);_0x4cab91[_0xbd8d('0x17')][_0xbd8d('0x18')](_0xb8e78d);var _0x5c243a=getRows(_0x4a9a30,_0x3eb608);_0x4cab91[_0xbd8d('0x17')]=_0x4cab91[_0xbd8d('0x17')][_0xbd8d('0x19')](_0x5c243a);return _0x4cab91;}function createTables(_0x37cae2){var _0x56906e=[];var _0x1a9427=_[_0xbd8d('0x1a')](Object[_0xbd8d('0x1b')](_0x37cae2[0x0]),0x5);_0x1a9427['forEach'](function(_0x41da1a){_0x56906e[_0xbd8d('0x18')](createTable(_0x41da1a,_0x37cae2));});return _0x56906e;}function getPDFDocDefinition(_0x28b72e){var _0x1d3943=util[_0xbd8d('0x1c')](_0xbd8d('0x1d'),NAME,EXTRACTED_REPORT[_0xbd8d('0x1e')],moment(EXTRACTED_REPORT[_0xbd8d('0x1f')])[_0xbd8d('0x1c')](FORMAT),moment(EXTRACTED_REPORT[_0xbd8d('0x20')])[_0xbd8d('0x1c')](FORMAT));var _0x2d1e89=[];for(var _0x37b33b=0x0;_0x37b33b<_0x28b72e[_0xbd8d('0x21')];_0x37b33b++){var _0x125434=[];if(_0x37b33b===0x0){_0x125434[_0xbd8d('0x18')]({'text':_0x1d3943,'style':_0xbd8d('0x22')});}var _0xd6bf23={'table':_0x28b72e[_0x37b33b]};if(_0x37b33b>0x0){_0xd6bf23['pageBreak']=_0xbd8d('0x23');_0xd6bf23['margin']=[0x0,0x46,0x0,0x0];}_0x125434['push'](_0xd6bf23);_0x2d1e89[_0xbd8d('0x18')](_0x125434);}return{'pageSize':'A4','pageOrientation':_0xbd8d('0x24'),'content':_0x2d1e89,'footer':function(_0x1b4091,_0x438c01){return{'text':_0x1b4091['toString']()+_0xbd8d('0x25')+_0x438c01,'style':_0xbd8d('0x26')};},'defaultStyle':{'font':_0xbd8d('0x27')},'styles':{'header':{'fontSize':0x12,'bold':!![],'margin':[0x0,0x0,0x0,0xa]},'tableHeader':{'bold':!![],'fontSize':0xd,'color':_0xbd8d('0x28')},'footer':{'alignment':_0xbd8d('0x29'),'margin':[0x0,0x0,0x28,0x0]}}};}function extractReport(_0xb216ae){var _0x5cfd42=0x1388;var _0x1e57f7;if(!_0xb216ae[0x0][_0xbd8d('0x2a')]){return analyticExtractedReport(_0xbd8d('0x2b'));}return db[_0xbd8d('0x2c')][_0xbd8d('0x2d')]({'where':{'id':0x1},'raw':!![],'attributes':['id',_0xbd8d('0x2e'),_0xbd8d('0x2f')]})[_0xbd8d('0x30')](function(_0x53e3fe){if(_0x53e3fe){_0x1e57f7=_0x53e3fe;_0x5cfd42=_0x1e57f7[_0xbd8d('0x2f')]||0x3e8;}})['then'](function(){var _0xaec34a=[];var _0x53e26f=0x0;if(_0x1e57f7[_0xbd8d('0x2e')]){if(_0xb216ae&&_0xb216ae[_0xbd8d('0x21')]){var _0x4b42b8=_['range'](_0xb216ae[0x0][_0xbd8d('0x2a')]/_0x5cfd42);var _0x22a732=Number[_0xbd8d('0x31')](_0xb216ae[0x0][_0xbd8d('0x2a')]/_0x5cfd42)?_0xb216ae[0x0][_0xbd8d('0x2a')]%_0x5cfd42:0x0;_0x4b42b8['forEach'](function(_0x547509){if(_0x547509>0x0){_0x53e26f+=_0x5cfd42;}_0xaec34a[_0xbd8d('0x18')](dbH[_0xbd8d('0x32')][_0xbd8d('0x33')](util[_0xbd8d('0x1c')]('%s\x20limit\x20%d\x20OFFSET\x20%d',QUERY,_0x5cfd42,_0x53e26f),{'type':dbH[_0xbd8d('0x32')][_0xbd8d('0x34')]['SELECT']}));});if(_0x22a732>0x0){_0x53e26f+=_0x5cfd42;_0xaec34a[_0xbd8d('0x18')](dbH[_0xbd8d('0x32')][_0xbd8d('0x33')](util[_0xbd8d('0x1c')](_0xbd8d('0x35'),QUERY,_0x22a732,_0x53e26f),{'type':dbH[_0xbd8d('0x32')][_0xbd8d('0x34')][_0xbd8d('0x36')]}));}}}else{_0xaec34a[_0xbd8d('0x18')](dbH[_0xbd8d('0x32')][_0xbd8d('0x33')](QUERY,{'type':dbH[_0xbd8d('0x32')][_0xbd8d('0x34')]['SELECT']}));}var _0x2296b1=path['dirname'](PATH);var _0x295e76=path[_0xbd8d('0x37')](PATH,_0xbd8d('0x38'));var _0x3b12e5=_0x1e57f7[_0xbd8d('0x2e')]&&_0xaec34a[_0xbd8d('0x21')]>0x1;var _0x4c7753=[];if(!fs[_0xbd8d('0x39')](path['join'](_0x2296b1,_0x295e76))&&_0x3b12e5){fs[_0xbd8d('0x3a')](path[_0xbd8d('0x3b')](_0x2296b1,_0x295e76));}return BPromise[_0xbd8d('0x3c')](_0xaec34a,function(_0x125920){_0x4c7753['push'](_0x125920);})[_0xbd8d('0x30')](function(){var _0x1a1e39=[];for(var _0x2d91a0=0x0;_0x2d91a0<_0x4c7753['length'];_0x2d91a0+=0x1){var _0x3d9dc1=_0x4c7753[_0x2d91a0];var _0x51c586=createTables(_['flatten'](_0x3d9dc1));var _0x51e5fb;var _0x5e73a9=getPDFDocDefinition(_0x51c586);var _0x5a7fe3=getPDFPrinter();var _0x1fd47c=_0x5a7fe3['createPdfKitDocument'](_0x5e73a9);if(_0x3b12e5){_0x51e5fb=path[_0xbd8d('0x3b')](_0x2296b1,_0x295e76,util[_0xbd8d('0x1c')](_0xbd8d('0x3d'),_0x295e76,_0x2d91a0,_0xbd8d('0x3e')));}else{_0x51e5fb=path['join'](_0x2296b1,util['format'](_0xbd8d('0x3f'),_0x295e76,'pdf'));}_0x1a1e39[_0xbd8d('0x18')](writePDFDocument(_0x1fd47c,_0x51e5fb));}return Promise['all'](_0x1a1e39);})[_0xbd8d('0x30')](function(){if(_0x3b12e5){return new Promise(function(_0x2b4034){zipdir(path[_0xbd8d('0x3b')](_0x2296b1,_0x295e76),{'saveTo':path['join'](_0x2296b1,util[_0xbd8d('0x1c')](_0xbd8d('0x3f'),_0x295e76,_0xbd8d('0x40')))},function(){rimraf(path['join'](_0x2296b1,_0x295e76),function(){});_0x2b4034(_0xbd8d('0x41'));});});}})[_0xbd8d('0x30')](function(){if(!_0x3b12e5)return;rimraf(path[_0xbd8d('0x3b')](_0x2296b1,_0x295e76),function(){});})['then'](function(){logger[_0xbd8d('0x42')](util[_0xbd8d('0x1c')](_0xbd8d('0x43'),EXTRACTED_REPORT_ID,_0xbd8d('0x44')));return analyticExtractedReport('Completed',_0x3b12e5?util['format']('%s.%s',_0x295e76,_0x3b12e5?'zip':_0xbd8d('0x3e')):null);});});}function main(){if(!EXTRACTED_REPORT_ID)return;logger[_0xbd8d('0x42')](util[_0xbd8d('0x1c')](_0xbd8d('0x45'),EXTRACTED_REPORT_ID,'PDF'));return db[_0xbd8d('0x11')]['findOne']({'where':{'id':EXTRACTED_REPORT_ID}})[_0xbd8d('0x30')](function(_0x1cbc12){EXTRACTED_REPORT=_0x1cbc12;return dbH[_0xbd8d('0x32')]['query'](util['format'](_0xbd8d('0x46'),QUERY),{'type':dbH[_0xbd8d('0x32')]['QueryTypes'][_0xbd8d('0x36')]});})[_0xbd8d('0x30')](extractReport)[_0xbd8d('0x47')](function(_0xafc65){logger[_0xbd8d('0x42')](util[_0xbd8d('0x1c')]('Error\x20during\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format',EXTRACTED_REPORT_ID,'PDF'),util[_0xbd8d('0x48')](_0xafc65,{'showHidden':![],'depth':null}));EXIT_CODE=0x1;return analyticExtractedReport(_0xbd8d('0x49'));})[_0xbd8d('0x4a')](function(){process[_0xbd8d('0x4b')](EXIT_CODE);});}main();function getPDFPrinter(){var _0x2091ce=new PdfPrinter({'Arial':{'normal':__dirname+_0xbd8d('0x4c'),'bold':__dirname+_0xbd8d('0x4d'),'italics':__dirname+_0xbd8d('0x4e'),'bolditalics':__dirname+_0xbd8d('0x4f')}});return _0x2091ce;}function getPDFDocDefinitionFromHTML(_0x158536,_0xcefe8c){var _0x2b4e5b=util[_0xbd8d('0x1c')](_0xbd8d('0x50'),_0xcefe8c[_0xbd8d('0x51')],_0xcefe8c['interactionId']);var _0x15e08a=moment()['format']('YYYY-MM-DD')[_0xbd8d('0x52')]();var _0xbec2e8=htmlToPdfmake(_0x158536,{'window':window,'tableAutoSize':!![]});return{'content':[_0xbec2e8],'defaultStyle':{'font':'Arial'},'styles':{'header':{'fontSize':0x12,'bold':!![],'alignment':_0xbd8d('0x53'),'margin':[0xa,0xa,0xa,0xa]},'footer':{'fontSize':0x9,'alignment':_0xbd8d('0x53'),'margin':[0xa,0x14,0xa,0xa]},'textblock':{'fontSize':0xb},'textfield':{'bold':!![]},'messageContainer':{'fontSize':0xa},'messageInfo':{'bold':!![]},'interactionData':{'alignment':_0xbd8d('0x53')}},'header':function(){return[{'text':'Interaction\x20Transcript','style':_0xbd8d('0x22')}];},'footer':function(_0xf31e41,_0x41f9f2){return[{'text':util['format'](_0xbd8d('0x54'),_0x2b4e5b,_0xf31e41,_0x41f9f2,_0x15e08a),'style':_0xbd8d('0x26')}];}};}function writePDFDocument(_0x10f646,_0x356e0f){return new Promise(function(_0x3a8c06,_0x181fc1){var _0x3a0d1c=_0x10f646['pipe'](fs['createWriteStream'](_0x356e0f));_0x3a0d1c['on'](_0xbd8d('0x55'),function(){_0x3a8c06(_0xbd8d('0x55'));});_0x3a0d1c['on']('error',function(_0x1057d7){_0x181fc1(_0x1057d7);});_0x10f646[_0xbd8d('0x56')]();});}exports[_0xbd8d('0x57')]=function(_0x5bbc77,_0x2c2544){var _0x57fe79=getPDFPrinter();var _0x49460a=getPDFDocDefinitionFromHTML(_0x5bbc77,_0x2c2544);var _0x1011ac=_0x57fe79[_0xbd8d('0x58')](_0x49460a);return writePDFDocument(_0x1011ac,_0x2c2544[_0xbd8d('0x2')])[_0xbd8d('0x47')](function(_0xa7ae28){throw _0xa7ae28;});}; \ No newline at end of file diff --git a/server/components/export/xlsx.js b/server/components/export/xlsx.js index 1cc8fb2..1fb0af7 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 _0x8960=['length','isInteger','num','forEach','sequelize','query','SELECT','push','QueryTypes','dirname','basename','.xlsx','existsSync','mkdirSync','each','join','%s%d.%s','xlsx','writeFileSync','binary','%s.%s','Extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format\x20completed','XLSX','Completed','zip','Error\x20during\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format','Failed','finally','exit','path','lodash','json2xls','bluebird','zip-dir','rimraf','../../mysqldb','dbH','../../config/logger','argv','savename','AnalyticExtractedReport','update','info','format','Setting','find','splitSizeXlsx','then','SELECT\x20count(*)\x20as\x20num\x20FROM\x20(%s)\x20t','Empty'];(function(_0x1488fe,_0x1a2440){var _0x142f88=function(_0x4b98a7){while(--_0x4b98a7){_0x1488fe['push'](_0x1488fe['shift']());}};_0x142f88(++_0x1a2440);}(_0x8960,0x17b));var _0x0896=function(_0x206bd7,_0x4426a8){_0x206bd7=_0x206bd7-0x0;var _0x1eec47=_0x8960[_0x206bd7];return _0x1eec47;};'use strict';var util=require('util');var path=require(_0x0896('0x0'));var _=require(_0x0896('0x1'));var fs=require('fs');var json2xls=require(_0x0896('0x2'));var BPromise=require(_0x0896('0x3'));var zipdir=require(_0x0896('0x4'));var rimraf=require(_0x0896('0x5'));var db=require('../../mysqldb')['db'];var dbH=require(_0x0896('0x6'))[_0x0896('0x7')];var logger=require(_0x0896('0x8'))('analytics');var EXTRACTED_REPORT_ID=Number(process[_0x0896('0x9')][0x2]);var QUERY=process[_0x0896('0x9')][0x3];var PATH=process['argv'][0x4];var EXIT_CODE=0x0;function analyticExtractedReport(_0x197968,_0x4958f1){var _0x56d3e1={'status':_0x197968};var _0x1dd5e9={'where':{'id':EXTRACTED_REPORT_ID}};if(_0x4958f1){_0x56d3e1[_0x0896('0xa')]=_0x4958f1;}return db[_0x0896('0xb')][_0x0896('0xc')](_0x56d3e1,_0x1dd5e9);}function main(){var _0x1dfd7e=0x1388;var _0x1612c7;logger[_0x0896('0xd')](util[_0x0896('0xe')]('Start\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format',EXTRACTED_REPORT_ID,'XLSX'));return db[_0x0896('0xf')][_0x0896('0x10')]({'where':{'id':0x1},'raw':!![],'attributes':['id','split',_0x0896('0x11')]})[_0x0896('0x12')](function(_0x5388c8){if(_0x5388c8){_0x1612c7=_0x5388c8;_0x1dfd7e=_0x1612c7[_0x0896('0x11')]||0x1388;}})[_0x0896('0x12')](function(){return dbH['sequelize']['query'](util['format'](_0x0896('0x13'),QUERY),{'type':dbH['sequelize']['QueryTypes']['SELECT']});})[_0x0896('0x12')](function(_0x5629a1){if(!_0x5629a1[0x0]['num']){return analyticExtractedReport(_0x0896('0x14'));}var _0x5dd072=[];var _0x1806d6=0x0;if(_0x1612c7['split']){if(_0x5629a1&&_0x5629a1[_0x0896('0x15')]){var _0x5d3f45=_['range'](_0x5629a1[0x0]['num']/_0x1dfd7e);var _0x321850=Number[_0x0896('0x16')](_0x5629a1[0x0]['num']/_0x1dfd7e)?_0x5629a1[0x0][_0x0896('0x17')]%_0x1dfd7e:0x0;_0x5d3f45[_0x0896('0x18')](function(_0x77b14){if(_0x77b14>0x0){_0x1806d6+=_0x1dfd7e;}_0x5dd072['push'](dbH[_0x0896('0x19')][_0x0896('0x1a')](util[_0x0896('0xe')]('%s\x20limit\x20%d\x20OFFSET\x20%d',QUERY,_0x1dfd7e,_0x1806d6),{'type':dbH[_0x0896('0x19')]['QueryTypes']['SELECT']}));});if(_0x321850>0x0){_0x1806d6+=_0x1dfd7e;_0x5dd072['push'](dbH['sequelize'][_0x0896('0x1a')](util['format']('%s\x20limit\x20%d\x20OFFSET\x20%d',QUERY,_0x321850,_0x1806d6),{'type':dbH[_0x0896('0x19')]['QueryTypes'][_0x0896('0x1b')]}));}}}else{_0x5dd072[_0x0896('0x1c')](dbH[_0x0896('0x19')]['query'](QUERY,{'type':dbH[_0x0896('0x19')][_0x0896('0x1d')]['SELECT']}));}var _0x35348a=path[_0x0896('0x1e')](PATH);var _0x22447b=path[_0x0896('0x1f')](PATH,_0x0896('0x20'));var _0xdfaa74=_0x1612c7['split']&&_0x5dd072[_0x0896('0x15')]>0x1;var _0x2353b0=[];if(!fs[_0x0896('0x21')](path['join'](_0x35348a,_0x22447b))&&_0xdfaa74){fs[_0x0896('0x22')](path['join'](_0x35348a,_0x22447b));}return BPromise[_0x0896('0x23')](_0x5dd072,function(_0x4135f3){_0x2353b0[_0x0896('0x1c')](_0x4135f3);})[_0x0896('0x12')](function(){for(var _0x54b3ca=0x0;_0x54b3ca<_0x2353b0[_0x0896('0x15')];_0x54b3ca+=0x1){var _0x427cad;var _0x4bfd39=_0x2353b0[_0x54b3ca];if(_0xdfaa74){_0x427cad=path[_0x0896('0x24')](_0x35348a,_0x22447b,util[_0x0896('0xe')](_0x0896('0x25'),_0x22447b,_0x54b3ca,_0x0896('0x26')));}else{_0x427cad=path[_0x0896('0x24')](_0x35348a,util[_0x0896('0xe')]('%s.%s',_0x22447b,'xlsx'));}fs[_0x0896('0x27')](_0x427cad,json2xls(_0x4bfd39),_0x0896('0x28'));}})[_0x0896('0x12')](function(){if(_0xdfaa74){return new Promise(function(_0x465c4d){zipdir(path['join'](_0x35348a,_0x22447b),{'saveTo':path[_0x0896('0x24')](_0x35348a,util[_0x0896('0xe')](_0x0896('0x29'),_0x22447b,'zip'))},function(_0x5bcb40,_0x7356d1){rimraf(path[_0x0896('0x24')](_0x35348a,_0x22447b),function(){});_0x465c4d('zip\x20finished');});});}})[_0x0896('0x12')](function(){logger[_0x0896('0xd')](util[_0x0896('0xe')](_0x0896('0x2a'),EXTRACTED_REPORT_ID,_0x0896('0x2b')));return analyticExtractedReport(_0x0896('0x2c'),_0xdfaa74?util[_0x0896('0xe')](_0x0896('0x29'),_0x22447b,_0xdfaa74?_0x0896('0x2d'):'xlsx'):null);});})['catch'](function(_0x4bc599){logger[_0x0896('0xd')](util['format'](_0x0896('0x2e'),EXTRACTED_REPORT_ID,'XLSX'),util['inspect'](_0x4bc599,{'showHidden':![],'depth':null}));EXIT_CODE=0x1;return analyticExtractedReport(_0x0896('0x2f'));})[_0x0896('0x30')](function(){process[_0x0896('0x31')](EXIT_CODE);});}main(); \ No newline at end of file +var _0xcc65=['isInteger','forEach','push','%s\x20limit\x20%d\x20OFFSET\x20%d','dirname','basename','.xlsx','join','mkdirSync','each','%s%d.%s','xlsx','%s.%s','writeFileSync','binary','zip','Extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format\x20completed','catch','Error\x20during\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format','XLSX','inspect','Failed','finally','exit','path','lodash','json2xls','bluebird','zip-dir','rimraf','../../mysqldb','dbH','../../config/logger','analytics','argv','AnalyticExtractedReport','update','info','format','Start\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format','find','split','splitSizeXlsx','then','sequelize','query','SELECT\x20count(*)\x20as\x20num\x20FROM\x20(%s)\x20t','QueryTypes','SELECT','length','num'];(function(_0x127dd5,_0x5c2d19){var _0xca248=function(_0x1362a3){while(--_0x1362a3){_0x127dd5['push'](_0x127dd5['shift']());}};_0xca248(++_0x5c2d19);}(_0xcc65,0x1e3));var _0x5cc6=function(_0x4d0810,_0x13e15f){_0x4d0810=_0x4d0810-0x0;var _0x3e47e0=_0xcc65[_0x4d0810];return _0x3e47e0;};'use strict';var util=require('util');var path=require(_0x5cc6('0x0'));var _=require(_0x5cc6('0x1'));var fs=require('fs');var json2xls=require(_0x5cc6('0x2'));var BPromise=require(_0x5cc6('0x3'));var zipdir=require(_0x5cc6('0x4'));var rimraf=require(_0x5cc6('0x5'));var db=require(_0x5cc6('0x6'))['db'];var dbH=require(_0x5cc6('0x6'))[_0x5cc6('0x7')];var logger=require(_0x5cc6('0x8'))(_0x5cc6('0x9'));var EXTRACTED_REPORT_ID=Number(process[_0x5cc6('0xa')][0x2]);var QUERY=process[_0x5cc6('0xa')][0x3];var PATH=process['argv'][0x4];var EXIT_CODE=0x0;function analyticExtractedReport(_0xbd83cc,_0x4b7c8e){var _0xbefa92={'status':_0xbd83cc};var _0x4d9ba8={'where':{'id':EXTRACTED_REPORT_ID}};if(_0x4b7c8e){_0xbefa92['savename']=_0x4b7c8e;}return db[_0x5cc6('0xb')][_0x5cc6('0xc')](_0xbefa92,_0x4d9ba8);}function main(){var _0x5c49bf=0x1388;var _0x3946a4;logger[_0x5cc6('0xd')](util[_0x5cc6('0xe')](_0x5cc6('0xf'),EXTRACTED_REPORT_ID,'XLSX'));return db['Setting'][_0x5cc6('0x10')]({'where':{'id':0x1},'raw':!![],'attributes':['id',_0x5cc6('0x11'),_0x5cc6('0x12')]})[_0x5cc6('0x13')](function(_0x6cebf8){if(_0x6cebf8){_0x3946a4=_0x6cebf8;_0x5c49bf=_0x3946a4[_0x5cc6('0x12')]||0x1388;}})[_0x5cc6('0x13')](function(){return dbH[_0x5cc6('0x14')][_0x5cc6('0x15')](util[_0x5cc6('0xe')](_0x5cc6('0x16'),QUERY),{'type':dbH[_0x5cc6('0x14')][_0x5cc6('0x17')][_0x5cc6('0x18')]});})[_0x5cc6('0x13')](function(_0x4a43f3){if(!_0x4a43f3[0x0]['num']){return analyticExtractedReport('Empty');}var _0x16ca41=[];var _0x10e3ff=0x0;if(_0x3946a4['split']){if(_0x4a43f3&&_0x4a43f3[_0x5cc6('0x19')]){var _0x1aee0c=_['range'](_0x4a43f3[0x0][_0x5cc6('0x1a')]/_0x5c49bf);var _0x3ae317=Number[_0x5cc6('0x1b')](_0x4a43f3[0x0][_0x5cc6('0x1a')]/_0x5c49bf)?_0x4a43f3[0x0][_0x5cc6('0x1a')]%_0x5c49bf:0x0;_0x1aee0c[_0x5cc6('0x1c')](function(_0xc7fe86){if(_0xc7fe86>0x0){_0x10e3ff+=_0x5c49bf;}_0x16ca41[_0x5cc6('0x1d')](dbH['sequelize'][_0x5cc6('0x15')](util[_0x5cc6('0xe')](_0x5cc6('0x1e'),QUERY,_0x5c49bf,_0x10e3ff),{'type':dbH['sequelize']['QueryTypes'][_0x5cc6('0x18')]}));});if(_0x3ae317>0x0){_0x10e3ff+=_0x5c49bf;_0x16ca41['push'](dbH[_0x5cc6('0x14')][_0x5cc6('0x15')](util['format']('%s\x20limit\x20%d\x20OFFSET\x20%d',QUERY,_0x3ae317,_0x10e3ff),{'type':dbH['sequelize'][_0x5cc6('0x17')][_0x5cc6('0x18')]}));}}}else{_0x16ca41[_0x5cc6('0x1d')](dbH[_0x5cc6('0x14')][_0x5cc6('0x15')](QUERY,{'type':dbH[_0x5cc6('0x14')][_0x5cc6('0x17')][_0x5cc6('0x18')]}));}var _0x3cdc30=path[_0x5cc6('0x1f')](PATH);var _0x525b55=path[_0x5cc6('0x20')](PATH,_0x5cc6('0x21'));var _0x585849=_0x3946a4[_0x5cc6('0x11')]&&_0x16ca41[_0x5cc6('0x19')]>0x1;var _0x45dd0b=[];if(!fs['existsSync'](path[_0x5cc6('0x22')](_0x3cdc30,_0x525b55))&&_0x585849){fs[_0x5cc6('0x23')](path[_0x5cc6('0x22')](_0x3cdc30,_0x525b55));}return BPromise[_0x5cc6('0x24')](_0x16ca41,function(_0x262a13){_0x45dd0b['push'](_0x262a13);})[_0x5cc6('0x13')](function(){for(var _0x2772ca=0x0;_0x2772ca<_0x45dd0b['length'];_0x2772ca+=0x1){var _0x2f760a;var _0x17e3d2=_0x45dd0b[_0x2772ca];if(_0x585849){_0x2f760a=path[_0x5cc6('0x22')](_0x3cdc30,_0x525b55,util[_0x5cc6('0xe')](_0x5cc6('0x25'),_0x525b55,_0x2772ca,_0x5cc6('0x26')));}else{_0x2f760a=path[_0x5cc6('0x22')](_0x3cdc30,util['format'](_0x5cc6('0x27'),_0x525b55,'xlsx'));}fs[_0x5cc6('0x28')](_0x2f760a,json2xls(_0x17e3d2),_0x5cc6('0x29'));}})[_0x5cc6('0x13')](function(){if(_0x585849){return new Promise(function(_0x585e35){zipdir(path['join'](_0x3cdc30,_0x525b55),{'saveTo':path[_0x5cc6('0x22')](_0x3cdc30,util[_0x5cc6('0xe')](_0x5cc6('0x27'),_0x525b55,_0x5cc6('0x2a')))},function(_0x290b21,_0x163db4){rimraf(path['join'](_0x3cdc30,_0x525b55),function(){});_0x585e35('zip\x20finished');});});}})[_0x5cc6('0x13')](function(){logger[_0x5cc6('0xd')](util[_0x5cc6('0xe')](_0x5cc6('0x2b'),EXTRACTED_REPORT_ID,'XLSX'));return analyticExtractedReport('Completed',_0x585849?util[_0x5cc6('0xe')]('%s.%s',_0x525b55,_0x585849?_0x5cc6('0x2a'):_0x5cc6('0x26')):null);});})[_0x5cc6('0x2c')](function(_0x5dc035){logger['info'](util[_0x5cc6('0xe')](_0x5cc6('0x2d'),EXTRACTED_REPORT_ID,_0x5cc6('0x2e')),util[_0x5cc6('0x2f')](_0x5dc035,{'showHidden':![],'depth':null}));EXIT_CODE=0x1;return analyticExtractedReport(_0x5cc6('0x30'));})[_0x5cc6('0x31')](function(){process[_0x5cc6('0x32')](EXIT_CODE);});}main(); \ No newline at end of file diff --git a/server/components/extensions/rewrite.js b/server/components/extensions/rewrite.js index 81db00c..93bee2d 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 _0xb833=['util','Interval','then','intervals','findAll','models','VoiceExtension','map','exten','CAST(priority\x20AS\x20UNSIGNED)','filter','groupBy','playback','priority','extensions','extension','push','type','Set','format','CDR(type)=%s','context','VoiceExtensionId','outbound','CDR(destination)=','cutdigits','${EXTEN}','CDR(routeid)=','ExecIf','$[${LEN(${CDR(prefix)})}\x20>\x200]?Goto(','CDR(prefix)=noprefix','outboundrouteid=','recordingFormat','_XCALLY_MIXMONITOR_UNIQUEID=${UNIQUEID}','wav','MONITOR_OPTIONS=ab','updatedAt','interval','*,*,*,*','IntervalId','hasOwnProperty','tag','CDR(tag)=','length','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)','answer','appType','custom','$[${XCALLY-MOTION-PROGRESS}=0]?Progress','XCALLY-MOTION-PROGRESS=1','splice','GotoIfTime',',${EXTEN},','concat','transaction','destroy','bulkCreate','sortBy','catch','error','rewrite'];(function(_0x59ae41,_0x22a50c){var _0x3a46f6=function(_0x47fb9e){while(--_0x47fb9e){_0x59ae41['push'](_0x59ae41['shift']());}};_0x3a46f6(++_0x22a50c);}(_0xb833,0x1b9));var _0x3b83=function(_0x5134ae,_0x12e32d){_0x5134ae=_0x5134ae-0x0;var _0x281380=_0xb833[_0x5134ae];return _0x281380;};'use strict';var _=require('lodash');var util=require(_0x3b83('0x0'));function rewrite(_0x23ed52,_0x1d7c37){var _0x3efe7d=this;return _0x23ed52['models'][_0x3b83('0x1')]['findAll']({'raw':!![]})[_0x3b83('0x2')](function(_0x36057c){_0x3efe7d[_0x3b83('0x3')]=_0x36057c;return _0x23ed52['models']['VoiceExtension'][_0x3b83('0x4')]({'where':{'IntervalId':_0x1d7c37['IntervalId']},'raw':!![]});})['then'](function(_0x558889){return _0x23ed52[_0x3b83('0x5')][_0x3b83('0x6')][_0x3b83('0x4')]({'where':{'exten':{'$in':_['uniq'](_[_0x3b83('0x7')](_0x558889,_0x3b83('0x8')))}},'order':[{'raw':_0x3b83('0x9')}],'raw':!![]});})[_0x3b83('0x2')](function(_0x271b37){var _0x2b2f56=_[_0x3b83('0xa')](_0x271b37,{'priority':'1'});var _0x2022ff=_[_0x3b83('0xa')](_0x271b37,{'isApp':0x1});var _0xf5f3ad=_[_0x3b83('0xb')](_0x2022ff,_0x3b83('0x8'));var _0x44a93b=['queue',_0x3b83('0xc')];var _0x419161=[];var _0x28c71f=[];for(var _0x1ef54f in _0xf5f3ad){if(_0xf5f3ad['hasOwnProperty'](_0x1ef54f)){_0x3efe7d[_0x3b83('0xd')]=0x2;_0x3efe7d[_0x3b83('0xe')]=[];_0x3efe7d[_0x3b83('0xf')]=_['find'](_0x2b2f56,{'exten':_0xf5f3ad[_0x1ef54f][0x0]['exten']});_0x3efe7d[_0x3b83('0xe')][_0x3b83('0x10')]({'type':_0xf5f3ad[_0x1ef54f][0x0][_0x3b83('0x11')],'app':_0x3b83('0x12'),'appdata':util[_0x3b83('0x13')](_0x3b83('0x14'),_0xf5f3ad[_0x1ef54f][0x0][_0x3b83('0x11')]),'context':_0xf5f3ad[_0x1ef54f][0x0][_0x3b83('0x15')],'exten':_0xf5f3ad[_0x1ef54f][0x0][_0x3b83('0x8')],'priority':_0x3efe7d[_0x3b83('0xd')]++,'VoiceExtensionId':_0xf5f3ad[_0x1ef54f][0x0][_0x3b83('0x16')]});if(_0xf5f3ad[_0x1ef54f][0x0][_0x3b83('0x11')]==='inbound'){_0x3efe7d['extensions'][_0x3b83('0x10')]({'type':_0xf5f3ad[_0x1ef54f][0x0][_0x3b83('0x11')],'app':'Set','appdata':'CDR(routeid)='+_0xf5f3ad[_0x1ef54f][0x0]['VoiceExtensionId'],'context':_0xf5f3ad[_0x1ef54f][0x0][_0x3b83('0x15')],'exten':_0xf5f3ad[_0x1ef54f][0x0][_0x3b83('0x8')],'priority':_0x3efe7d[_0x3b83('0xd')]++,'VoiceExtensionId':_0xf5f3ad[_0x1ef54f][0x0][_0x3b83('0x16')]});}else if(_0xf5f3ad[_0x1ef54f][0x0][_0x3b83('0x11')]===_0x3b83('0x17')){if(_0x3efe7d['extension']){_0x3efe7d[_0x3b83('0xe')][_0x3b83('0x10')]({'type':_0xf5f3ad[_0x1ef54f][0x0][_0x3b83('0x11')],'app':_0x3b83('0x12'),'appdata':_0x3b83('0x18')+(_0x3efe7d[_0x3b83('0xf')][_0x3b83('0x19')]?'${EXTEN:'+_0x3efe7d[_0x3b83('0xf')][_0x3b83('0x19')]+'}':_0x3b83('0x1a')),'context':_0xf5f3ad[_0x1ef54f][0x0][_0x3b83('0x15')],'exten':_0xf5f3ad[_0x1ef54f][0x0][_0x3b83('0x8')],'priority':_0x3efe7d[_0x3b83('0xd')]++,'VoiceExtensionId':_0xf5f3ad[_0x1ef54f][0x0][_0x3b83('0x16')]});}_0x3efe7d[_0x3b83('0xe')][_0x3b83('0x10')]({'type':_0xf5f3ad[_0x1ef54f][0x0]['type'],'app':'Set','appdata':_0x3b83('0x1b')+_0xf5f3ad[_0x1ef54f][0x0][_0x3b83('0x16')],'context':_0xf5f3ad[_0x1ef54f][0x0][_0x3b83('0x15')],'exten':_0xf5f3ad[_0x1ef54f][0x0][_0x3b83('0x8')],'priority':_0x3efe7d[_0x3b83('0xd')]++,'VoiceExtensionId':_0xf5f3ad[_0x1ef54f][0x0][_0x3b83('0x16')]});var _0x3bffb3=_0x3efe7d[_0x3b83('0xd')]++;_0x3efe7d[_0x3b83('0xe')][_0x3b83('0x10')]({'type':_0xf5f3ad[_0x1ef54f][0x0][_0x3b83('0x11')],'app':_0x3b83('0x1c'),'appdata':_0x3b83('0x1d')+(_0x3bffb3+0x2)+'):Goto('+(_0x3bffb3+0x1)+')','context':_0xf5f3ad[_0x1ef54f][0x0][_0x3b83('0x15')],'exten':_0xf5f3ad[_0x1ef54f][0x0][_0x3b83('0x8')],'priority':_0x3bffb3,'VoiceExtensionId':_0xf5f3ad[_0x1ef54f][0x0][_0x3b83('0x16')]});if(_0x3efe7d[_0x3b83('0xf')]){_0x3efe7d[_0x3b83('0xe')][_0x3b83('0x10')]({'type':_0xf5f3ad[_0x1ef54f][0x0][_0x3b83('0x11')],'app':_0x3b83('0x12'),'appdata':_0x3efe7d[_0x3b83('0xf')]['cutdigits']?'CDR(prefix)=${EXTEN:0:'+_0x3efe7d[_0x3b83('0xf')][_0x3b83('0x19')]+'}':_0x3b83('0x1e'),'context':_0xf5f3ad[_0x1ef54f][0x0][_0x3b83('0x15')],'exten':_0xf5f3ad[_0x1ef54f][0x0]['exten'],'priority':_0x3efe7d[_0x3b83('0xd')]++,'VoiceExtensionId':_0xf5f3ad[_0x1ef54f][0x0][_0x3b83('0x16')]});}_0x3efe7d[_0x3b83('0xe')][_0x3b83('0x10')]({'type':_0xf5f3ad[_0x1ef54f][0x0][_0x3b83('0x11')],'app':_0x3b83('0x12'),'appdata':_0x3b83('0x1f')+_0xf5f3ad[_0x1ef54f][0x0][_0x3b83('0x16')],'context':_0xf5f3ad[_0x1ef54f][0x0][_0x3b83('0x15')],'exten':_0xf5f3ad[_0x1ef54f][0x0]['exten'],'priority':_0x3efe7d[_0x3b83('0xd')]++,'VoiceExtensionId':_0xf5f3ad[_0x1ef54f][0x0][_0x3b83('0x16')]});if(_0x3efe7d[_0x3b83('0xf')]&&_0x3efe7d[_0x3b83('0xf')]['hasOwnProperty'](_0x3b83('0x20'))&&_0x3efe7d[_0x3b83('0xf')][_0x3b83('0x20')]!=='none'){_0x3efe7d['extensions'][_0x3b83('0x10')]({'type':_0xf5f3ad[_0x1ef54f][0x0][_0x3b83('0x11')],'app':_0x3b83('0x12'),'appdata':_0x3b83('0x21'),'context':_0xf5f3ad[_0x1ef54f][0x0][_0x3b83('0x15')],'exten':_0xf5f3ad[_0x1ef54f][0x0][_0x3b83('0x8')],'priority':_0x3efe7d[_0x3b83('0xd')]++,'VoiceExtensionId':_0xf5f3ad[_0x1ef54f][0x0][_0x3b83('0x16')]});_0x3efe7d[_0x3b83('0xe')][_0x3b83('0x10')]({'type':_0xf5f3ad[_0x1ef54f][0x0][_0x3b83('0x11')],'app':_0x3b83('0x12'),'appdata':'_XCALLY_MIXMONITOR_FORMAT='+_0x3efe7d[_0x3b83('0xf')][_0x3b83('0x20')]||_0x3b83('0x22'),'context':_0xf5f3ad[_0x1ef54f][0x0][_0x3b83('0x15')],'exten':_0xf5f3ad[_0x1ef54f][0x0][_0x3b83('0x8')],'priority':_0x3efe7d['priority']++,'VoiceExtensionId':_0xf5f3ad[_0x1ef54f][0x0][_0x3b83('0x16')]});}}_0x3efe7d[_0x3b83('0xe')][_0x3b83('0x10')]({'type':_0xf5f3ad[_0x1ef54f][0x0][_0x3b83('0x11')],'app':'Set','appdata':'XCALLY-MOTION-ANSWER=0','context':_0xf5f3ad[_0x1ef54f][0x0][_0x3b83('0x15')],'exten':_0xf5f3ad[_0x1ef54f][0x0][_0x3b83('0x8')],'priority':_0x3efe7d[_0x3b83('0xd')]++,'VoiceExtensionId':_0xf5f3ad[_0x1ef54f][0x0]['VoiceExtensionId']});_0x3efe7d[_0x3b83('0xe')][_0x3b83('0x10')]({'type':_0xf5f3ad[_0x1ef54f][0x0][_0x3b83('0x11')],'app':_0x3b83('0x12'),'appdata':'XCALLY-MOTION-PROGRESS=0','context':_0xf5f3ad[_0x1ef54f][0x0]['context'],'exten':_0xf5f3ad[_0x1ef54f][0x0][_0x3b83('0x8')],'priority':_0x3efe7d[_0x3b83('0xd')]++,'VoiceExtensionId':_0xf5f3ad[_0x1ef54f][0x0][_0x3b83('0x16')]});_0x3efe7d['extensions'][_0x3b83('0x10')]({'type':_0xf5f3ad[_0x1ef54f][0x0][_0x3b83('0x11')],'app':_0x3b83('0x12'),'appdata':_0x3b83('0x23'),'context':_0xf5f3ad[_0x1ef54f][0x0][_0x3b83('0x15')],'exten':_0xf5f3ad[_0x1ef54f][0x0][_0x3b83('0x8')],'priority':_0x3efe7d[_0x3b83('0xd')]++,'VoiceExtensionId':_0xf5f3ad[_0x1ef54f][0x0]['VoiceExtensionId']});for(var _0xd45fd0=0x0,_0x26822b=0x0;_0xd45fd0<_0xf5f3ad[_0x1ef54f]['length'];_0xd45fd0+=0x1,_0x26822b=0x0){var _0x58f450=_0xf5f3ad[_0x1ef54f][_0xd45fd0];if(_0x58f450[_0x3b83('0x11')]){_0x58f450[_0x3b83('0x11')]=_0x58f450[_0x3b83('0x11')]['toLowerCase']();}var _0x2e92f8=[];var _0x2c8a0c=[];delete _0x58f450['id'];delete _0x58f450['createdAt'];delete _0x58f450[_0x3b83('0x24')];var _0x5761a3=_0x58f450[_0x3b83('0x25')]!==_0x3b83('0x26')?[_0x58f450[_0x3b83('0x25')]]:_0x58f450[_0x3b83('0x27')]?_[_0x3b83('0x7')](_['filter'](_0x3efe7d[_0x3b83('0x3')],{'IntervalId':_0x58f450['IntervalId']}),_0x3b83('0x25')):[];if(_0x58f450[_0x3b83('0x28')](_0x3b83('0x29'))){if(_0x58f450[_0x3b83('0x29')]&&_0x58f450['tag']!=='--'){_0x2e92f8['push']({'type':_0x58f450[_0x3b83('0x11')],'app':_0x3b83('0x12'),'appdata':_0x3b83('0x2a')+_0x58f450[_0x3b83('0x29')],'context':_0x58f450[_0x3b83('0x15')],'exten':_0x58f450[_0x3b83('0x8')],'priority':_0x5761a3[_0x3b83('0x2b')]+_0x3efe7d[_0x3b83('0xd')]+_0x26822b++,'VoiceExtensionId':_0x58f450[_0x3b83('0x16')]});}}if(_0x58f450[_0x3b83('0x11')]===_0x3b83('0x17')&&_0x58f450[_0x3b83('0x28')](_0x3b83('0x2c'))){if(_0x58f450[_0x3b83('0x2c')]){_0x2e92f8[_0x3b83('0x10')]({'type':_0x58f450[_0x3b83('0x11')],'app':_0x3b83('0x1c'),'appdata':_0x3b83('0x2d')+_0x58f450['callerID']+')','context':_0x58f450['context'],'exten':_0x58f450[_0x3b83('0x8')],'priority':_0x5761a3['length']+_0x3efe7d['priority']+_0x26822b++,'VoiceExtensionId':_0x58f450[_0x3b83('0x16')]});}else{_0x2e92f8[_0x3b83('0x10')]({'type':_0x58f450[_0x3b83('0x11')],'app':_0x3b83('0x1c'),'appdata':_0x3b83('0x2e'),'context':_0x58f450[_0x3b83('0x15')],'exten':_0x58f450['exten'],'priority':_0x5761a3[_0x3b83('0x2b')]+_0x3efe7d['priority']+_0x26822b++,'VoiceExtensionId':_0x58f450[_0x3b83('0x16')]});}}if(_0x58f450[_0x3b83('0x28')](_0x3b83('0x2f'))){if(_0x44a93b['indexOf'](_0x58f450['app']['toLowerCase']())>=0x0&&_0x58f450[_0x3b83('0x30')]!==_0x3b83('0x31')){if(_0x58f450[_0x3b83('0x2f')]){_0x2e92f8['push']({'type':_0x58f450[_0x3b83('0x11')],'app':_0x3b83('0x1c'),'appdata':'$[${XCALLY-MOTION-ANSWER}=0]?Answer','context':_0x58f450[_0x3b83('0x15')],'exten':_0x58f450[_0x3b83('0x8')],'priority':_0x5761a3[_0x3b83('0x2b')]+_0x3efe7d[_0x3b83('0xd')]+_0x26822b++,'VoiceExtensionId':_0x58f450['VoiceExtensionId']});_0x2e92f8[_0x3b83('0x10')]({'type':_0x58f450[_0x3b83('0x11')],'app':_0x3b83('0x12'),'appdata':'XCALLY-MOTION-ANSWER=1','context':_0x58f450[_0x3b83('0x15')],'exten':_0x58f450[_0x3b83('0x8')],'priority':_0x5761a3[_0x3b83('0x2b')]+_0x3efe7d['priority']+_0x26822b++,'VoiceExtensionId':_0x58f450['VoiceExtensionId']});}else{_0x2e92f8[_0x3b83('0x10')]({'type':_0x58f450['type'],'app':'ExecIf','appdata':_0x3b83('0x32'),'context':_0x58f450['context'],'exten':_0x58f450['exten'],'priority':_0x5761a3[_0x3b83('0x2b')]+_0x3efe7d[_0x3b83('0xd')]+_0x26822b++,'VoiceExtensionId':_0x58f450['VoiceExtensionId']});_0x2e92f8[_0x3b83('0x10')]({'type':_0x58f450[_0x3b83('0x11')],'app':_0x3b83('0x12'),'appdata':_0x3b83('0x33'),'context':_0x58f450[_0x3b83('0x15')],'exten':_0x58f450[_0x3b83('0x8')],'priority':_0x5761a3[_0x3b83('0x2b')]+_0x3efe7d[_0x3b83('0xd')]+_0x26822b++,'VoiceExtensionId':_0x58f450[_0x3b83('0x16')]});}}}for(var _0x21b117=0x0;_0x21b117<_0x5761a3[_0x3b83('0x2b')];_0x21b117+=0x1){var _0x6689ac=_0x3efe7d[_0x3b83('0xd')]+_0x5761a3[_0x3b83('0x2b')];var _0x5270f7=_0x21b117===_0x5761a3[_0x3b83('0x2b')]-0x1?_0x3efe7d[_0x3b83('0xd')]+_0x2e92f8[_0x3b83('0x2b')]+_0x2c8a0c[_0x3b83('0x2b')]+0x2:_0x3efe7d[_0x3b83('0xd')]+_0x21b117+0x1;_0x2e92f8[_0x3b83('0x34')](_0x21b117,0x0,{'type':_0x58f450['type'],'app':_0x3b83('0x35'),'appdata':_0x5761a3[_0x21b117]+'?'+_0x58f450['context']+_0x3b83('0x36')+_0x6689ac+':'+_0x58f450[_0x3b83('0x15')]+_0x3b83('0x36')+_0x5270f7,'exten':_0x58f450[_0x3b83('0x8')],'context':_0x58f450[_0x3b83('0x15')],'priority':_0x3efe7d[_0x3b83('0xd')]+_0x21b117,'VoiceExtensionId':_0xf5f3ad[_0x1ef54f][0x0][_0x3b83('0x16')]});}_0x58f450[_0x3b83('0xd')]=_0x2e92f8[_0x3b83('0x2b')]?_['last'](_0x2e92f8)['priority']+0x1:_0x3efe7d['priority'];_0x3efe7d[_0x3b83('0xd')]=(_0x2c8a0c[_0x3b83('0x2b')]?_['last'](_0x2c8a0c)[_0x3b83('0xd')]:_0x58f450[_0x3b83('0xd')])+0x1;_0x3efe7d[_0x3b83('0xe')]=_[_0x3b83('0x37')](_0x3efe7d[_0x3b83('0xe')],_0x2e92f8,[_0x58f450],_0x2c8a0c);}_0x3efe7d[_0x3b83('0xe')]['push']({'type':_0xf5f3ad[_0x1ef54f][0x0][_0x3b83('0x11')],'app':'Hangup','exten':_0xf5f3ad[_0x1ef54f][0x0][_0x3b83('0x8')],'context':_0xf5f3ad[_0x1ef54f][0x0][_0x3b83('0x15')],'priority':_0x3efe7d[_0x3b83('0xd')],'VoiceExtensionId':_0xf5f3ad[_0x1ef54f][0x0]['VoiceExtensionId']});_0x419161[_0x3b83('0x10')](_0xf5f3ad[_0x1ef54f][0x0]['VoiceExtensionId']);_0x28c71f=_[_0x3b83('0x37')](_0x28c71f,_0x3efe7d[_0x3b83('0xe')]);}}return _0x23ed52[_0x3b83('0x38')](function(_0x571dc8){return _0x23ed52['models'][_0x3b83('0x6')][_0x3b83('0x39')]({'where':{'VoiceExtensionId':{'$in':_0x419161}},'transaction':_0x571dc8})['then'](function(_0x2fb5ed){return _0x23ed52['models']['VoiceExtension'][_0x3b83('0x3a')](_[_0x3b83('0x3b')](_0x28c71f,_0x3b83('0xd')),{'transaction':_0x571dc8});});});})[_0x3b83('0x3c')](function(_0x236e61){console[_0x3b83('0x3d')](_0x236e61);});}exports[_0x3b83('0x3e')]=rewrite; \ No newline at end of file +var _0x18cf=['outbound','CDR(destination)=','${EXTEN:','cutdigits','${EXTEN}','ExecIf','$[${LEN(${CDR(prefix)})}\x20>\x200]?Goto(','CDR(prefix)=${EXTEN:0:','CDR(prefix)=noprefix','outboundrouteid=','hasOwnProperty','recordingFormat','_XCALLY_MIXMONITOR_UNIQUEID=${UNIQUEID}','wav','XCALLY-MOTION-ANSWER=0','XCALLY-MOTION-PROGRESS=0','MONITOR_OPTIONS=ab','length','toLowerCase','createdAt','updatedAt','*,*,*,*','interval','map','tag','CDR(tag)=','callerID','$[${LEN(${PREFIX-CALLERIDALL})}\x20>\x200]?Set(CALLERID(all)=${PREFIX-CALLERIDALL}):NoOp(No\x20number\x20available)','app','appType','$[${XCALLY-MOTION-ANSWER}=0]?Answer','XCALLY-MOTION-ANSWER=1','splice','GotoIfTime',',${EXTEN},','last','concat','Hangup','transaction','destroy','sortBy','error','rewrite','lodash','models','Interval','findAll','then','intervals','VoiceExtension','IntervalId','uniq','exten','CAST(priority\x20AS\x20UNSIGNED)','filter','groupBy','queue','playback','priority','extensions','extension','find','push','type','Set','format','CDR(type)=%s','context','VoiceExtensionId','CDR(routeid)='];(function(_0x5a034a,_0x5b1a9d){var _0x3caf8d=function(_0x56b01d){while(--_0x56b01d){_0x5a034a['push'](_0x5a034a['shift']());}};_0x3caf8d(++_0x5b1a9d);}(_0x18cf,0x1cf));var _0xf18c=function(_0x25ea66,_0x570d58){_0x25ea66=_0x25ea66-0x0;var _0x4483ce=_0x18cf[_0x25ea66];return _0x4483ce;};'use strict';var _=require(_0xf18c('0x0'));var util=require('util');function rewrite(_0x560291,_0x5ac98f){var _0x2a588a=this;return _0x560291[_0xf18c('0x1')][_0xf18c('0x2')][_0xf18c('0x3')]({'raw':!![]})[_0xf18c('0x4')](function(_0xea3122){_0x2a588a[_0xf18c('0x5')]=_0xea3122;return _0x560291[_0xf18c('0x1')][_0xf18c('0x6')][_0xf18c('0x3')]({'where':{'IntervalId':_0x5ac98f[_0xf18c('0x7')]},'raw':!![]});})[_0xf18c('0x4')](function(_0x4a548f){return _0x560291[_0xf18c('0x1')][_0xf18c('0x6')][_0xf18c('0x3')]({'where':{'exten':{'$in':_[_0xf18c('0x8')](_['map'](_0x4a548f,_0xf18c('0x9')))}},'order':[{'raw':_0xf18c('0xa')}],'raw':!![]});})[_0xf18c('0x4')](function(_0xd76ec7){var _0x46701b=_[_0xf18c('0xb')](_0xd76ec7,{'priority':'1'});var _0x5c814b=_[_0xf18c('0xb')](_0xd76ec7,{'isApp':0x1});var _0x5dedd3=_[_0xf18c('0xc')](_0x5c814b,_0xf18c('0x9'));var _0x2d0b7d=[_0xf18c('0xd'),_0xf18c('0xe')];var _0x9ef75=[];var _0x5eeb05=[];for(var _0x26f680 in _0x5dedd3){if(_0x5dedd3['hasOwnProperty'](_0x26f680)){_0x2a588a[_0xf18c('0xf')]=0x2;_0x2a588a[_0xf18c('0x10')]=[];_0x2a588a[_0xf18c('0x11')]=_[_0xf18c('0x12')](_0x46701b,{'exten':_0x5dedd3[_0x26f680][0x0]['exten']});_0x2a588a[_0xf18c('0x10')][_0xf18c('0x13')]({'type':_0x5dedd3[_0x26f680][0x0][_0xf18c('0x14')],'app':_0xf18c('0x15'),'appdata':util[_0xf18c('0x16')](_0xf18c('0x17'),_0x5dedd3[_0x26f680][0x0]['type']),'context':_0x5dedd3[_0x26f680][0x0][_0xf18c('0x18')],'exten':_0x5dedd3[_0x26f680][0x0][_0xf18c('0x9')],'priority':_0x2a588a[_0xf18c('0xf')]++,'VoiceExtensionId':_0x5dedd3[_0x26f680][0x0][_0xf18c('0x19')]});if(_0x5dedd3[_0x26f680][0x0][_0xf18c('0x14')]==='inbound'){_0x2a588a[_0xf18c('0x10')][_0xf18c('0x13')]({'type':_0x5dedd3[_0x26f680][0x0][_0xf18c('0x14')],'app':_0xf18c('0x15'),'appdata':_0xf18c('0x1a')+_0x5dedd3[_0x26f680][0x0][_0xf18c('0x19')],'context':_0x5dedd3[_0x26f680][0x0][_0xf18c('0x18')],'exten':_0x5dedd3[_0x26f680][0x0][_0xf18c('0x9')],'priority':_0x2a588a[_0xf18c('0xf')]++,'VoiceExtensionId':_0x5dedd3[_0x26f680][0x0][_0xf18c('0x19')]});}else if(_0x5dedd3[_0x26f680][0x0][_0xf18c('0x14')]===_0xf18c('0x1b')){if(_0x2a588a['extension']){_0x2a588a['extensions'][_0xf18c('0x13')]({'type':_0x5dedd3[_0x26f680][0x0]['type'],'app':_0xf18c('0x15'),'appdata':_0xf18c('0x1c')+(_0x2a588a[_0xf18c('0x11')]['cutdigits']?_0xf18c('0x1d')+_0x2a588a[_0xf18c('0x11')][_0xf18c('0x1e')]+'}':_0xf18c('0x1f')),'context':_0x5dedd3[_0x26f680][0x0]['context'],'exten':_0x5dedd3[_0x26f680][0x0]['exten'],'priority':_0x2a588a['priority']++,'VoiceExtensionId':_0x5dedd3[_0x26f680][0x0]['VoiceExtensionId']});}_0x2a588a[_0xf18c('0x10')][_0xf18c('0x13')]({'type':_0x5dedd3[_0x26f680][0x0][_0xf18c('0x14')],'app':_0xf18c('0x15'),'appdata':_0xf18c('0x1a')+_0x5dedd3[_0x26f680][0x0][_0xf18c('0x19')],'context':_0x5dedd3[_0x26f680][0x0]['context'],'exten':_0x5dedd3[_0x26f680][0x0][_0xf18c('0x9')],'priority':_0x2a588a[_0xf18c('0xf')]++,'VoiceExtensionId':_0x5dedd3[_0x26f680][0x0]['VoiceExtensionId']});var _0x14ace8=_0x2a588a[_0xf18c('0xf')]++;_0x2a588a[_0xf18c('0x10')][_0xf18c('0x13')]({'type':_0x5dedd3[_0x26f680][0x0][_0xf18c('0x14')],'app':_0xf18c('0x20'),'appdata':_0xf18c('0x21')+(_0x14ace8+0x2)+'):Goto('+(_0x14ace8+0x1)+')','context':_0x5dedd3[_0x26f680][0x0][_0xf18c('0x18')],'exten':_0x5dedd3[_0x26f680][0x0][_0xf18c('0x9')],'priority':_0x14ace8,'VoiceExtensionId':_0x5dedd3[_0x26f680][0x0]['VoiceExtensionId']});if(_0x2a588a[_0xf18c('0x11')]){_0x2a588a['extensions'][_0xf18c('0x13')]({'type':_0x5dedd3[_0x26f680][0x0][_0xf18c('0x14')],'app':_0xf18c('0x15'),'appdata':_0x2a588a[_0xf18c('0x11')][_0xf18c('0x1e')]?_0xf18c('0x22')+_0x2a588a['extension'][_0xf18c('0x1e')]+'}':_0xf18c('0x23'),'context':_0x5dedd3[_0x26f680][0x0][_0xf18c('0x18')],'exten':_0x5dedd3[_0x26f680][0x0][_0xf18c('0x9')],'priority':_0x2a588a[_0xf18c('0xf')]++,'VoiceExtensionId':_0x5dedd3[_0x26f680][0x0]['VoiceExtensionId']});}_0x2a588a[_0xf18c('0x10')][_0xf18c('0x13')]({'type':_0x5dedd3[_0x26f680][0x0]['type'],'app':'Set','appdata':_0xf18c('0x24')+_0x5dedd3[_0x26f680][0x0][_0xf18c('0x19')],'context':_0x5dedd3[_0x26f680][0x0][_0xf18c('0x18')],'exten':_0x5dedd3[_0x26f680][0x0]['exten'],'priority':_0x2a588a[_0xf18c('0xf')]++,'VoiceExtensionId':_0x5dedd3[_0x26f680][0x0][_0xf18c('0x19')]});if(_0x2a588a[_0xf18c('0x11')]&&_0x2a588a['extension'][_0xf18c('0x25')]('recordingFormat')&&_0x2a588a[_0xf18c('0x11')][_0xf18c('0x26')]!=='none'){_0x2a588a[_0xf18c('0x10')][_0xf18c('0x13')]({'type':_0x5dedd3[_0x26f680][0x0][_0xf18c('0x14')],'app':_0xf18c('0x15'),'appdata':_0xf18c('0x27'),'context':_0x5dedd3[_0x26f680][0x0][_0xf18c('0x18')],'exten':_0x5dedd3[_0x26f680][0x0]['exten'],'priority':_0x2a588a[_0xf18c('0xf')]++,'VoiceExtensionId':_0x5dedd3[_0x26f680][0x0][_0xf18c('0x19')]});_0x2a588a[_0xf18c('0x10')]['push']({'type':_0x5dedd3[_0x26f680][0x0][_0xf18c('0x14')],'app':_0xf18c('0x15'),'appdata':'_XCALLY_MIXMONITOR_FORMAT='+_0x2a588a[_0xf18c('0x11')]['recordingFormat']||_0xf18c('0x28'),'context':_0x5dedd3[_0x26f680][0x0][_0xf18c('0x18')],'exten':_0x5dedd3[_0x26f680][0x0][_0xf18c('0x9')],'priority':_0x2a588a[_0xf18c('0xf')]++,'VoiceExtensionId':_0x5dedd3[_0x26f680][0x0][_0xf18c('0x19')]});}}_0x2a588a['extensions'][_0xf18c('0x13')]({'type':_0x5dedd3[_0x26f680][0x0]['type'],'app':_0xf18c('0x15'),'appdata':_0xf18c('0x29'),'context':_0x5dedd3[_0x26f680][0x0][_0xf18c('0x18')],'exten':_0x5dedd3[_0x26f680][0x0][_0xf18c('0x9')],'priority':_0x2a588a[_0xf18c('0xf')]++,'VoiceExtensionId':_0x5dedd3[_0x26f680][0x0][_0xf18c('0x19')]});_0x2a588a[_0xf18c('0x10')]['push']({'type':_0x5dedd3[_0x26f680][0x0]['type'],'app':_0xf18c('0x15'),'appdata':_0xf18c('0x2a'),'context':_0x5dedd3[_0x26f680][0x0]['context'],'exten':_0x5dedd3[_0x26f680][0x0][_0xf18c('0x9')],'priority':_0x2a588a['priority']++,'VoiceExtensionId':_0x5dedd3[_0x26f680][0x0][_0xf18c('0x19')]});_0x2a588a[_0xf18c('0x10')][_0xf18c('0x13')]({'type':_0x5dedd3[_0x26f680][0x0][_0xf18c('0x14')],'app':_0xf18c('0x15'),'appdata':_0xf18c('0x2b'),'context':_0x5dedd3[_0x26f680][0x0]['context'],'exten':_0x5dedd3[_0x26f680][0x0][_0xf18c('0x9')],'priority':_0x2a588a[_0xf18c('0xf')]++,'VoiceExtensionId':_0x5dedd3[_0x26f680][0x0][_0xf18c('0x19')]});for(var _0x506322=0x0,_0x13ea70=0x0;_0x506322<_0x5dedd3[_0x26f680][_0xf18c('0x2c')];_0x506322+=0x1,_0x13ea70=0x0){var _0x1c6001=_0x5dedd3[_0x26f680][_0x506322];if(_0x1c6001[_0xf18c('0x14')]){_0x1c6001[_0xf18c('0x14')]=_0x1c6001[_0xf18c('0x14')][_0xf18c('0x2d')]();}var _0x507e3d=[];var _0x1903b3=[];delete _0x1c6001['id'];delete _0x1c6001[_0xf18c('0x2e')];delete _0x1c6001[_0xf18c('0x2f')];var _0xb72a68=_0x1c6001['interval']!==_0xf18c('0x30')?[_0x1c6001[_0xf18c('0x31')]]:_0x1c6001['IntervalId']?_[_0xf18c('0x32')](_['filter'](_0x2a588a['intervals'],{'IntervalId':_0x1c6001[_0xf18c('0x7')]}),_0xf18c('0x31')):[];if(_0x1c6001[_0xf18c('0x25')](_0xf18c('0x33'))){if(_0x1c6001[_0xf18c('0x33')]&&_0x1c6001[_0xf18c('0x33')]!=='--'){_0x507e3d[_0xf18c('0x13')]({'type':_0x1c6001[_0xf18c('0x14')],'app':'Set','appdata':_0xf18c('0x34')+_0x1c6001[_0xf18c('0x33')],'context':_0x1c6001[_0xf18c('0x18')],'exten':_0x1c6001[_0xf18c('0x9')],'priority':_0xb72a68[_0xf18c('0x2c')]+_0x2a588a[_0xf18c('0xf')]+_0x13ea70++,'VoiceExtensionId':_0x1c6001[_0xf18c('0x19')]});}}if(_0x1c6001[_0xf18c('0x14')]==='outbound'&&_0x1c6001[_0xf18c('0x25')]('callerID')){if(_0x1c6001[_0xf18c('0x35')]){_0x507e3d[_0xf18c('0x13')]({'type':_0x1c6001[_0xf18c('0x14')],'app':_0xf18c('0x20'),'appdata':'$[${LEN(${PREFIX-CALLERIDALL})}\x20>\x200]?Set(CALLERID(all)=${PREFIX-CALLERIDALL}):Set(CALLERID(all)='+_0x1c6001['callerID']+')','context':_0x1c6001[_0xf18c('0x18')],'exten':_0x1c6001[_0xf18c('0x9')],'priority':_0xb72a68['length']+_0x2a588a[_0xf18c('0xf')]+_0x13ea70++,'VoiceExtensionId':_0x1c6001[_0xf18c('0x19')]});}else{_0x507e3d[_0xf18c('0x13')]({'type':_0x1c6001[_0xf18c('0x14')],'app':_0xf18c('0x20'),'appdata':_0xf18c('0x36'),'context':_0x1c6001[_0xf18c('0x18')],'exten':_0x1c6001[_0xf18c('0x9')],'priority':_0xb72a68[_0xf18c('0x2c')]+_0x2a588a[_0xf18c('0xf')]+_0x13ea70++,'VoiceExtensionId':_0x1c6001[_0xf18c('0x19')]});}}if(_0x1c6001[_0xf18c('0x25')]('answer')){if(_0x2d0b7d['indexOf'](_0x1c6001[_0xf18c('0x37')][_0xf18c('0x2d')]())>=0x0&&_0x1c6001[_0xf18c('0x38')]!=='custom'){if(_0x1c6001['answer']){_0x507e3d['push']({'type':_0x1c6001[_0xf18c('0x14')],'app':'ExecIf','appdata':_0xf18c('0x39'),'context':_0x1c6001[_0xf18c('0x18')],'exten':_0x1c6001[_0xf18c('0x9')],'priority':_0xb72a68[_0xf18c('0x2c')]+_0x2a588a[_0xf18c('0xf')]+_0x13ea70++,'VoiceExtensionId':_0x1c6001[_0xf18c('0x19')]});_0x507e3d[_0xf18c('0x13')]({'type':_0x1c6001['type'],'app':_0xf18c('0x15'),'appdata':_0xf18c('0x3a'),'context':_0x1c6001[_0xf18c('0x18')],'exten':_0x1c6001[_0xf18c('0x9')],'priority':_0xb72a68[_0xf18c('0x2c')]+_0x2a588a[_0xf18c('0xf')]+_0x13ea70++,'VoiceExtensionId':_0x1c6001[_0xf18c('0x19')]});}else{_0x507e3d['push']({'type':_0x1c6001[_0xf18c('0x14')],'app':_0xf18c('0x20'),'appdata':'$[${XCALLY-MOTION-PROGRESS}=0]?Progress','context':_0x1c6001['context'],'exten':_0x1c6001[_0xf18c('0x9')],'priority':_0xb72a68['length']+_0x2a588a[_0xf18c('0xf')]+_0x13ea70++,'VoiceExtensionId':_0x1c6001['VoiceExtensionId']});_0x507e3d[_0xf18c('0x13')]({'type':_0x1c6001[_0xf18c('0x14')],'app':_0xf18c('0x15'),'appdata':'XCALLY-MOTION-PROGRESS=1','context':_0x1c6001[_0xf18c('0x18')],'exten':_0x1c6001['exten'],'priority':_0xb72a68[_0xf18c('0x2c')]+_0x2a588a[_0xf18c('0xf')]+_0x13ea70++,'VoiceExtensionId':_0x1c6001[_0xf18c('0x19')]});}}}for(var _0x3384cb=0x0;_0x3384cb<_0xb72a68[_0xf18c('0x2c')];_0x3384cb+=0x1){var _0x1b6ffb=_0x2a588a[_0xf18c('0xf')]+_0xb72a68[_0xf18c('0x2c')];var _0x23efe6=_0x3384cb===_0xb72a68[_0xf18c('0x2c')]-0x1?_0x2a588a[_0xf18c('0xf')]+_0x507e3d[_0xf18c('0x2c')]+_0x1903b3[_0xf18c('0x2c')]+0x2:_0x2a588a['priority']+_0x3384cb+0x1;_0x507e3d[_0xf18c('0x3b')](_0x3384cb,0x0,{'type':_0x1c6001[_0xf18c('0x14')],'app':_0xf18c('0x3c'),'appdata':_0xb72a68[_0x3384cb]+'?'+_0x1c6001[_0xf18c('0x18')]+_0xf18c('0x3d')+_0x1b6ffb+':'+_0x1c6001[_0xf18c('0x18')]+_0xf18c('0x3d')+_0x23efe6,'exten':_0x1c6001[_0xf18c('0x9')],'context':_0x1c6001[_0xf18c('0x18')],'priority':_0x2a588a[_0xf18c('0xf')]+_0x3384cb,'VoiceExtensionId':_0x5dedd3[_0x26f680][0x0]['VoiceExtensionId']});}_0x1c6001[_0xf18c('0xf')]=_0x507e3d['length']?_[_0xf18c('0x3e')](_0x507e3d)[_0xf18c('0xf')]+0x1:_0x2a588a['priority'];_0x2a588a[_0xf18c('0xf')]=(_0x1903b3[_0xf18c('0x2c')]?_['last'](_0x1903b3)[_0xf18c('0xf')]:_0x1c6001[_0xf18c('0xf')])+0x1;_0x2a588a[_0xf18c('0x10')]=_[_0xf18c('0x3f')](_0x2a588a[_0xf18c('0x10')],_0x507e3d,[_0x1c6001],_0x1903b3);}_0x2a588a[_0xf18c('0x10')][_0xf18c('0x13')]({'type':_0x5dedd3[_0x26f680][0x0][_0xf18c('0x14')],'app':_0xf18c('0x40'),'exten':_0x5dedd3[_0x26f680][0x0][_0xf18c('0x9')],'context':_0x5dedd3[_0x26f680][0x0][_0xf18c('0x18')],'priority':_0x2a588a[_0xf18c('0xf')],'VoiceExtensionId':_0x5dedd3[_0x26f680][0x0][_0xf18c('0x19')]});_0x9ef75[_0xf18c('0x13')](_0x5dedd3[_0x26f680][0x0][_0xf18c('0x19')]);_0x5eeb05=_[_0xf18c('0x3f')](_0x5eeb05,_0x2a588a[_0xf18c('0x10')]);}}return _0x560291[_0xf18c('0x41')](function(_0x3ccb3b){return _0x560291['models'][_0xf18c('0x6')][_0xf18c('0x42')]({'where':{'VoiceExtensionId':{'$in':_0x9ef75}},'transaction':_0x3ccb3b})[_0xf18c('0x4')](function(_0x3783c3){return _0x560291[_0xf18c('0x1')][_0xf18c('0x6')]['bulkCreate'](_[_0xf18c('0x43')](_0x5eeb05,_0xf18c('0xf')),{'transaction':_0x3ccb3b});});});})['catch'](function(_0x484148){console[_0xf18c('0x44')](_0x484148);});}exports[_0xf18c('0x45')]=rewrite; \ No newline at end of file diff --git a/server/components/import/cm/csv.js b/server/components/import/cm/csv.js index 99fbfc4..f6f3018 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 _0x842a=['BlackLists','get','query','Campaign','CampaignId','emit','contact:csv_','resume','resolve','exit','SIGINT','info','parse','duplicate','pause','CSV\x20parsed\x20correctly!','CSV\x20parse\x20error','bluebird','util','lodash','squel','../../../mysqldb','api','redis','localhost','../../../api/cmContact/cmContact.socket','register','argv','undefined','null','Missing\x20binding\x20parameters!','zipObject','split','Missing\x20ListId\x20parameter!','error','contact','index','test','The\x20row\x20is\x20empty\x20or\x20the\x20number\x20of\x20parameters\x20does\x20not\x20match\x20the\x20columns!','map','errors','join','hasOwnProperty','firstName\x20not\x20specified!','phone\x20not\x20specified!','birthDate','YYYY-MM-DD','isValid','birthDate\x20format\x20is\x20invalid,\x20YYYY-MM-DD\x20format\x20is\x20supported!','email','ListId','length','Duplicate\x20Contact','create','keys','push','pick','catch','Error\x20while\x20creating\x20contact:\x20','message','stringify','cmContact','checkHopper','insert','into','cm_hopper','phone','scheduledAt','ContactId','createdAt','updatedAt','select','field','toString','NOW()','from','cm_contacts','where','deletedAt\x20IS\x20NULL','phone\x20IS\x20NOT\x20NULL','phone\x20NOT\x20IN\x20(?)','\x20=\x20?','ListId\x20=\x20?','id\x20IN\x20?','str','calleridnum','cm_hopper_final','fromQuery','cm_hopper_black','VoiceQueue','findAll','dialCheckDuplicateType','Lists','always','sequelize','VoiceQueueId','then','onlyIfOpen','all','outbound','CmList'];(function(_0x4e9d3c,_0x1f4b98){var _0x2d0825=function(_0x384676){while(--_0x384676){_0x4e9d3c['push'](_0x4e9d3c['shift']());}};_0x2d0825(++_0x1f4b98);}(_0x842a,0xdb));var _0xa842=function(_0x2ff739,_0x1c8e0f){_0x2ff739=_0x2ff739-0x0;var _0x12dc13=_0x842a[_0x2ff739];return _0x12dc13;};'use strict';var BPromise=require(_0xa842('0x0'));var util=require(_0xa842('0x1'));var _=require(_0xa842('0x2'));var fs=require('fs');var squel=require(_0xa842('0x3'));var Papa=require('papaparse');var Redis=require('ioredis');var db=require(_0xa842('0x4'))['db'];var config=require('../../../config/environment');var logger=require('../../../config/logger')(_0xa842('0x5'));config[_0xa842('0x6')]=_['defaults'](config[_0xa842('0x6')],{'host':_0xa842('0x7'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xa842('0x6')]));require(_0xa842('0x8'))[_0xa842('0x9')](socket);try{if(!process['argv'][0x2]||process[_0xa842('0xa')][0x2]===_0xa842('0xb')||process[_0xa842('0xa')][0x2]===_0xa842('0xc')){throw new Error('Missing\x20filepath\x20parameter!');}var FILEPATH=process['argv'][0x2];if(!process[_0xa842('0xa')][0x3]||process['argv'][0x3]==='undefined'||process[_0xa842('0xa')][0x3]===_0xa842('0xc')||!process[_0xa842('0xa')][0x4]||process['argv'][0x4]===_0xa842('0xb')||process[_0xa842('0xa')][0x4]===_0xa842('0xc')){throw new Error(_0xa842('0xd'));}var FIELDS=_[_0xa842('0xe')](process['argv'][0x3][_0xa842('0xf')](','),process[_0xa842('0xa')][0x4][_0xa842('0xf')](','));if(!process[_0xa842('0xa')][0x5]||process[_0xa842('0xa')][0x5]===_0xa842('0xb')||process[_0xa842('0xa')][0x5]==='null'){throw new Error(_0xa842('0x10'));}var LISTID=process[_0xa842('0xa')][0x5];var COMPANYID=process[_0xa842('0xa')][0x6]&&process[_0xa842('0xa')][0x6]!=='undefined'&&process[_0xa842('0xa')][0x6]!==_0xa842('0xc')?process[_0xa842('0xa')][0x6]:null;var DUPLICATES=process[_0xa842('0xa')][0x7]&&process['argv'][0x7]!=='undefined'&&process[_0xa842('0xa')][0x7]!=='null'?process['argv'][0x7]:null;if(!process[_0xa842('0xa')][0x8]||process[_0xa842('0xa')][0x8]===_0xa842('0xb')||process[_0xa842('0xa')][0x8]==='null'){throw new Error('Missing\x20socket_timestamp\x20parameter!');}var SOCKET_TIMESTAMP=process[_0xa842('0xa')][0x8];}catch(_0x18625c){logger[_0xa842('0x11')](_0x18625c);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(_0x1c35d7,_0x500c1c,_0x2eb460,_0x155dd4){var _0x4268ea={'message':_0x500c1c};_0x4268ea[_0x1c35d7]=!![];if(_0x2eb460){_0x4268ea[_0xa842('0x12')]=_0x2eb460;}if(_0x155dd4){_0x4268ea[_0xa842('0x13')]=_0x155dd4;}return _0x4268ea;}function isEmail(_0x596bf4){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))*$/[_0xa842('0x14')](_0x596bf4);}function checkRow(_0x176dd3,_0x22af01,_0xafc0b8){return new BPromise(function(_0x5a72fe,_0x1cb8d1){if(_['isNil'](_0x176dd3)){return _0x1cb8d1(handleCheckRowError(_0xa842('0x11'),_0xa842('0x15'),null,_0xafc0b8));}if(_0x176dd3['errors']&&_0x176dd3['errors']['length']){var _0x4c29ca=_[_0xa842('0x16')](_0x176dd3[_0xa842('0x17')],'message')[_0xa842('0x18')](';');return _0x1cb8d1(handleCheckRowError(_0xa842('0x11'),_0x4c29ca,null,_0xafc0b8));}var _0x39c864={};for(var _0x4b7caf in FIELDS){if(FIELDS[_0xa842('0x19')](_0x4b7caf)&&FIELDS[_0x4b7caf]){_0x39c864[_0x4b7caf]=_0x176dd3['data'][0x0][FIELDS[_0x4b7caf]]||_0x176dd3['data'][0x0]['\ufeff'+FIELDS[_0x4b7caf]];}}if(!_0x39c864['firstName']){return _0x1cb8d1(handleCheckRowError('error',_0xa842('0x1a'),null,_0xafc0b8));}if(!_0x39c864['phone']){return _0x1cb8d1(handleCheckRowError(_0xa842('0x11'),_0xa842('0x1b'),null,_0xafc0b8));}if(_0x39c864['birthDate']){var _0x5b90d9=moment(_0x39c864[_0xa842('0x1c')],_0xa842('0x1d'));if(!_0x5b90d9[_0xa842('0x1e')]()){return _0x1cb8d1(handleCheckRowError(_0xa842('0x11'),_0xa842('0x1f'),null,_0xafc0b8));}}if(_0x39c864[_0xa842('0x20')]){if(!isEmail(_0x39c864[_0xa842('0x20')])){return _0x1cb8d1(handleCheckRowError(_0xa842('0x11'),'email\x20format\x20is\x20not\x20valid!',null,_0xafc0b8));}}_0x39c864[_0xa842('0x21')]=LISTID;_0x39c864['CompanyId']=COMPANYID||undefined;if(DUPLICATES&&DUPLICATES['length']&&_0x22af01){var _0x38a573={};for(var _0x1981d6=0x0,_0x3cb978=DUPLICATES[_0xa842('0x22')];_0x1981d6<_0x3cb978;_0x1981d6+=0x1){_0x38a573[DUPLICATES[_0x1981d6]]=_0x39c864[DUPLICATES[_0x1981d6]];}var _0xa51da4=_['find'](_0x22af01,_0x38a573);if(_0xa51da4){return _0x1cb8d1(handleCheckRowError('duplicate',_0xa842('0x23'),_0xa51da4,_0xafc0b8));}}return db['CmContact'][_0xa842('0x24')](_0x39c864,{'raw':!![],'hooks':![],'fields':_[_0xa842('0x25')](_0x39c864)})['then'](function(_0x565de1){if(DUPLICATES&&DUPLICATES[_0xa842('0x22')]&&_0x22af01){_0x22af01[_0xa842('0x26')](_[_0xa842('0x27')](_0x39c864,DUPLICATES));}hopperContacts+=(hopperContacts?',':'')+_0x565de1['id'];return _0x5a72fe();})[_0xa842('0x28')](function(_0x3e8aa8){return _0x1cb8d1(handleCheckRowError(_0xa842('0x11'),_0xa842('0x29')+(_0x3e8aa8[_0xa842('0x2a')]||JSON[_0xa842('0x2b')](_0x3e8aa8)),null,_0xafc0b8));});});}function checkHopper(){function _0x47ca2b(){return function(_0xf3a69d){logger[_0xa842('0x11')](_0xa842('0x2c'),_0xa842('0x2d'),util['inspect'](_0xf3a69d,{'showHidden':![],'depth':null}));};}var _0x221e29=function(_0x3c9e3f,_0x4191a2){var _0x32e5ea=squel[_0xa842('0x2e')]()[_0xa842('0x2f')](_0xa842('0x30'))['fromQuery']([_0xa842('0x31'),_0xa842('0x32'),_0xa842('0x33'),_0xa842('0x21'),_0x4191a2,_0xa842('0x34'),_0xa842('0x35')],squel[_0xa842('0x36')]()[_0xa842('0x37')](_0xa842('0x31'),_0xa842('0x31'))[_0xa842('0x37')]('NOW()',_0xa842('0x32'))[_0xa842('0x37')]('id',_0xa842('0x33'))[_0xa842('0x37')](LISTID['toString'](),'ListId')[_0xa842('0x37')](_0x3c9e3f['id'][_0xa842('0x38')](),_0x4191a2)[_0xa842('0x37')](_0xa842('0x39'),'createdAt')[_0xa842('0x37')]('NOW()',_0xa842('0x35'))[_0xa842('0x3a')](_0xa842('0x3b'))[_0xa842('0x3c')](_0xa842('0x3d'))['where']('ListId\x20=\x20?',LISTID['toString']())[_0xa842('0x3c')](_0xa842('0x3e'))[_0xa842('0x3c')](_0xa842('0x3f'),squel[_0xa842('0x36')]()[_0xa842('0x37')](_0xa842('0x31'))[_0xa842('0x3a')](_0xa842('0x30'))[_0xa842('0x3c')](_0x4191a2+_0xa842('0x40'),_0x3c9e3f['id'][_0xa842('0x38')]())))['toString']();return _0x32e5ea;};var _0x390190=function(_0x168408,_0x2257be){var _0x22c8ea=squel['insert']()[_0xa842('0x2f')]('cm_hopper')['fromQuery']([_0xa842('0x31'),_0xa842('0x32'),_0xa842('0x33'),_0xa842('0x21'),_0x2257be,_0xa842('0x34'),'updatedAt'],squel[_0xa842('0x36')]()[_0xa842('0x37')](_0xa842('0x31'),_0xa842('0x31'))[_0xa842('0x37')](_0xa842('0x39'),_0xa842('0x32'))[_0xa842('0x37')]('id',_0xa842('0x33'))[_0xa842('0x37')](LISTID[_0xa842('0x38')](),'ListId')[_0xa842('0x37')](_0x168408['id'][_0xa842('0x38')](),_0x2257be)[_0xa842('0x37')](_0xa842('0x39'),'createdAt')[_0xa842('0x37')](_0xa842('0x39'),'updatedAt')[_0xa842('0x3a')](_0xa842('0x3b'))[_0xa842('0x3c')]('deletedAt\x20IS\x20NULL')[_0xa842('0x3c')](_0xa842('0x41'),LISTID[_0xa842('0x38')]())[_0xa842('0x3c')](_0xa842('0x42'),squel[_0xa842('0x43')](hopperContacts))[_0xa842('0x3c')]('phone\x20IS\x20NOT\x20NULL')['where']('phone\x20NOT\x20IN\x20(?)',squel[_0xa842('0x36')]()[_0xa842('0x37')](_0xa842('0x44'))[_0xa842('0x3a')](_0xa842('0x45'))[_0xa842('0x3c')](_0x2257be+_0xa842('0x40'),_0x168408['id']['toString']()))[_0xa842('0x3c')](_0xa842('0x3f'),squel[_0xa842('0x36')]()[_0xa842('0x37')](_0xa842('0x31'))[_0xa842('0x3a')](_0xa842('0x30'))['where'](_0x2257be+_0xa842('0x40'),_0x168408['id'][_0xa842('0x38')]())))['toString']();return _0x22c8ea;};function _0x515dd4(_0x9e8d8d,_0x1c3915){var _0x3ae4c1=squel[_0xa842('0x2e')]()['into'](_0xa842('0x30'))[_0xa842('0x46')]([_0xa842('0x31'),_0xa842('0x32'),_0xa842('0x33'),_0xa842('0x21'),_0x1c3915,'createdAt',_0xa842('0x35')],squel[_0xa842('0x36')]()[_0xa842('0x37')](_0xa842('0x31'),_0xa842('0x31'))['field']('NOW()',_0xa842('0x32'))[_0xa842('0x37')]('id',_0xa842('0x33'))[_0xa842('0x37')](LISTID[_0xa842('0x38')](),_0xa842('0x21'))[_0xa842('0x37')](_0x9e8d8d['id'][_0xa842('0x38')](),_0x1c3915)[_0xa842('0x37')](_0xa842('0x39'),_0xa842('0x34'))[_0xa842('0x37')](_0xa842('0x39'),_0xa842('0x35'))[_0xa842('0x3a')]('cm_contacts')[_0xa842('0x3c')]('deletedAt\x20IS\x20NULL')['where'](_0xa842('0x41'),LISTID[_0xa842('0x38')]())['where']('id\x20IN\x20?',squel['str'](hopperContacts))[_0xa842('0x3c')](_0xa842('0x3e')))['toString']();return _0x3ae4c1;}function _0x7f2ea9(_0xac7ec8,_0x2e7615){var _0x20b916=squel[_0xa842('0x2e')]()[_0xa842('0x2f')](_0xa842('0x47'))[_0xa842('0x46')]([_0xa842('0x31'),_0xa842('0x33'),_0xa842('0x21'),_0x2e7615,_0xa842('0x34'),'updatedAt'],squel['select']()[_0xa842('0x37')]('phone',_0xa842('0x31'))[_0xa842('0x37')]('id',_0xa842('0x33'))[_0xa842('0x37')](LISTID[_0xa842('0x38')](),_0xa842('0x21'))[_0xa842('0x37')](_0xac7ec8['id'][_0xa842('0x38')](),_0x2e7615)[_0xa842('0x37')](_0xa842('0x39'),_0xa842('0x34'))[_0xa842('0x37')]('NOW()',_0xa842('0x35'))[_0xa842('0x3a')](_0xa842('0x3b'))[_0xa842('0x3c')](_0xa842('0x3d'))[_0xa842('0x3c')](_0xa842('0x41'),LISTID['toString']())[_0xa842('0x3c')](_0xa842('0x42'),squel['str'](hopperContacts))[_0xa842('0x3c')](_0xa842('0x3e')))['toString']();return _0x20b916;}return db[_0xa842('0x48')][_0xa842('0x49')]({'where':{'type':'outbound'},'attributes':['id',_0xa842('0x4a')],'include':[{'model':db['CmList'],'as':_0xa842('0x4b'),'where':{'id':LISTID}}]})['then'](function(_0x2fb47e){var _0x1a71d4=[];if(_0x2fb47e){var _0x4e44b2;for(var _0x1fa4fd=0x0,_0x2fa75b;_0x1fa4fd<_0x2fb47e[_0xa842('0x22')];_0x1fa4fd+=0x1){_0x2fa75b=_0x2fb47e[_0x1fa4fd]['get']({'plain':!![]});switch(_0x2fa75b[_0xa842('0x4a')]){case _0xa842('0x4c'):_0x1a71d4['push'](db[_0xa842('0x4d')]['query'](_0x390190(_0x2fa75b,_0xa842('0x4e')))[_0xa842('0x4f')](function(){})[_0xa842('0x28')](_0x47ca2b()));break;case _0xa842('0x50'):_0x1a71d4['push'](db[_0xa842('0x4d')]['query'](_0x221e29(_0x2fa75b,_0xa842('0x4e')))[_0xa842('0x4f')](function(){})['catch'](_0x47ca2b()));break;default:_0x1a71d4[_0xa842('0x26')](db['sequelize']['query'](_0x515dd4(_0x2fa75b,_0xa842('0x4e')))[_0xa842('0x4f')](function(){})[_0xa842('0x28')](_0x47ca2b()));}}}return _0x1a71d4;})[_0xa842('0x51')]()[_0xa842('0x4f')](function(){return db[_0xa842('0x48')]['findAll']({'where':{'type':_0xa842('0x52')},'attributes':['id'],'include':[{'model':db[_0xa842('0x53')],'as':_0xa842('0x54'),'where':{'id':LISTID}}]})['then'](function(_0x879bee){var _0x49f52d=[];if(_0x879bee){var _0x270ad5;for(var _0x17a0c3=0x0,_0x43e5e2;_0x17a0c3<_0x879bee['length'];_0x17a0c3+=0x1){_0x43e5e2=_0x879bee[_0x17a0c3][_0xa842('0x55')]({'plain':!![]});_0x49f52d[_0xa842('0x26')](db[_0xa842('0x4d')][_0xa842('0x56')](_0x7f2ea9(_0x43e5e2,_0xa842('0x4e')))[_0xa842('0x4f')](function(){})[_0xa842('0x28')](_0x47ca2b()));}}return _0x49f52d;})[_0xa842('0x51')]();})[_0xa842('0x4f')](function(){return db[_0xa842('0x57')][_0xa842('0x49')]({'attributes':['id',_0xa842('0x4a')],'include':[{'model':db[_0xa842('0x53')],'as':_0xa842('0x4b'),'where':{'id':LISTID}}]})[_0xa842('0x4f')](function(_0x5fa3b3){var _0x2fdf93=[];if(_0x5fa3b3){for(var _0xb4bde8=0x0,_0x573eec;_0xb4bde8<_0x5fa3b3[_0xa842('0x22')];_0xb4bde8+=0x1){_0x573eec=_0x5fa3b3[_0xb4bde8][_0xa842('0x55')]({'plain':!![]});switch(_0x573eec['dialCheckDuplicateType']){case'always':_0x2fdf93[_0xa842('0x26')](db[_0xa842('0x4d')][_0xa842('0x56')](_0x390190(_0x573eec,_0xa842('0x58')))[_0xa842('0x4f')](function(){})['catch'](_0x47ca2b()));break;case _0xa842('0x50'):_0x2fdf93[_0xa842('0x26')](db[_0xa842('0x4d')]['query'](_0x221e29(_0x573eec,_0xa842('0x58')))[_0xa842('0x4f')](function(){})[_0xa842('0x28')](_0x47ca2b()));break;default:_0x2fdf93[_0xa842('0x26')](db[_0xa842('0x4d')][_0xa842('0x56')](_0x515dd4(_0x573eec,_0xa842('0x58')))['then'](function(){})['catch'](_0x47ca2b()));}}}return _0x2fdf93;})['all']();})[_0xa842('0x4f')](function(){return db[_0xa842('0x57')][_0xa842('0x49')]({'attributes':['id'],'include':[{'model':db[_0xa842('0x53')],'as':'BlackLists','where':{'id':LISTID}}]})[_0xa842('0x4f')](function(_0x4a8f59){var _0x4bbb7e=[];if(_0x4a8f59){for(var _0x35cb0c=0x0,_0x50f942;_0x35cb0c<_0x4a8f59[_0xa842('0x22')];_0x35cb0c+=0x1){_0x50f942=_0x4a8f59[_0x35cb0c][_0xa842('0x55')]({'plain':!![]});_0x4bbb7e[_0xa842('0x26')](db[_0xa842('0x4d')][_0xa842('0x56')](_0x7f2ea9(_0x50f942,_0xa842('0x58')))['then'](function(){})[_0xa842('0x28')](_0x47ca2b()));}}return _0x4bbb7e;})[_0xa842('0x51')]();})[_0xa842('0x28')](function(_0x1d6c07){logger[_0xa842('0x11')]('cmContact,\x20%s,\x20%s','generalCheckHopper',_0x1d6c07[_0xa842('0x2a')]);});}var processPromises=function(_0x403381){return BPromise[_0xa842('0x51')](promises)[_0xa842('0x4f')](function(_0x5dbc74){})[_0xa842('0x28')](function(_0x3b59a9){logger[_0xa842('0x11')]('Error\x20processing\x20rows\x20block:',JSON[_0xa842('0x2b')](_0x3b59a9));})['finally'](function(){socket[_0xa842('0x59')](_0xa842('0x5a')+SOCKET_TIMESTAMP,{'success':success,'errors':errors,'duplicates':duplicates,'rows':rows});promises=[];success=0x0;errors=0x0;duplicates=0x0;rows=[];if(_0x403381){return _0x403381[_0xa842('0x5b')]();}});};var endCsv=function(){return BPromise[_0xa842('0x5c')]()[_0xa842('0x4f')](function(){if(hopperContacts){return checkHopper();}})[_0xa842('0x4f')](function(){socket['emit']('contact:csv_'+SOCKET_TIMESTAMP,{'finished':!![],'success':success,'errors':errors,'duplicates':duplicates,'rows':rows});try{fs['unlinkSync'](FILEPATH);}catch(_0x2c7100){logger['error']('Unable\x20to\x20delete\x20temp\x20file:',JSON[_0xa842('0x2b')](_0x2c7100));}finally{process[_0xa842('0x5d')](0x0);}});};process['on'](_0xa842('0x5e'),function(){logger[_0xa842('0x5f')]('CSV\x20import\x20process\x20stopped!');endCsv();});function main(){return BPromise[_0xa842('0x5c')]()[_0xa842('0x4f')](function(){if(DUPLICATES){DUPLICATES=DUPLICATES[_0xa842('0xf')](',');return db['CmContact'][_0xa842('0x49')]({'where':{'ListId':LISTID},'attributes':DUPLICATES,'raw':!![]});}})[_0xa842('0x4f')](function(_0x309a87){var _0x13cc9e=fs['createReadStream'](FILEPATH,{'highWaterMark':0xf*0x400*0x400});Papa[_0xa842('0x60')](_0x13cc9e,{'header':!![],'skipEmptyLines':!![],'step':function(_0x2e0115,_0x344975){total+=0x1;var _0x543921=total;promises[_0xa842('0x26')](checkRow(_0x2e0115,_0x309a87,_0x543921)[_0xa842('0x4f')](function(){success+=0x1;})[_0xa842('0x28')](function(_0x499581){if(_0x499581[_0xa842('0x11')]){errors+=0x1;delete _0x499581[_0xa842('0x11')];}else if(_0x499581[_0xa842('0x61')]){duplicates+=0x1;delete _0x499581[_0xa842('0x61')];}rows['push'](_0x499581);}));if(total%0xc8===0x0){_0x344975[_0xa842('0x62')]();return processPromises(_0x344975);}},'complete':function(){return processPromises()[_0xa842('0x4f')](function(){logger[_0xa842('0x5f')](_0xa842('0x63'));endCsv();});},'error':function(_0x4e2d8e,_0x44d04f){logger[_0xa842('0x5f')](_0xa842('0x64'),JSON[_0xa842('0x2b')](_0x4e2d8e));endCsv();}});})[_0xa842('0x28')](function(_0x4ce491){logger[_0xa842('0x11')]('Error\x20executing\x20contact\x20csv\x20import:',JSON['stringify'](_0x4ce491));});}main(); \ No newline at end of file +var _0xb503=['Lists','then','get','always','sequelize','query','onlyIfOpen','VoiceQueueId','all','CmList','BlackLists','Campaign','dialCheckDuplicateType','CampaignId','cmContact,\x20%s,\x20%s','generalCheckHopper','Error\x20processing\x20rows\x20block:','finally','emit','contact:csv_','resume','resolve','unlinkSync','Unable\x20to\x20delete\x20temp\x20file:','exit','info','createReadStream','parse','pause','CSV\x20parsed\x20correctly!','CSV\x20parse\x20error','Error\x20executing\x20contact\x20csv\x20import:','bluebird','util','lodash','squel','papaparse','ioredis','../../../mysqldb','../../../config/environment','../../../config/logger','redis','defaults','socket.io-emitter','../../../api/cmContact/cmContact.socket','argv','undefined','null','Missing\x20binding\x20parameters!','zipObject','split','Missing\x20ListId\x20parameter!','Missing\x20socket_timestamp\x20parameter!','index','test','error','errors','map','message','join','hasOwnProperty','data','firstName','firstName\x20not\x20specified!','phone','birthDate','YYYY-MM-DD','isValid','birthDate\x20format\x20is\x20invalid,\x20YYYY-MM-DD\x20format\x20is\x20supported!','email','email\x20format\x20is\x20not\x20valid!','ListId','CompanyId','length','find','duplicate','Duplicate\x20Contact','CmContact','keys','push','pick','catch','stringify','cmContact','inspect','into','cm_hopper','scheduledAt','ContactId','updatedAt','select','field','NOW()','toString','createdAt','from','cm_contacts','where','deletedAt\x20IS\x20NULL','phone\x20IS\x20NOT\x20NULL','phone\x20NOT\x20IN\x20(?)','insert','fromQuery','ListId\x20=\x20?','str','calleridnum','\x20=\x20?','id\x20IN\x20?','cm_hopper_black','VoiceQueue','findAll','outbound'];(function(_0x5447fd,_0x52a6b5){var _0x15b28a=function(_0x370d4f){while(--_0x370d4f){_0x5447fd['push'](_0x5447fd['shift']());}};_0x15b28a(++_0x52a6b5);}(_0xb503,0x90));var _0x3b50=function(_0x3cb86f,_0x47844){_0x3cb86f=_0x3cb86f-0x0;var _0x16e246=_0xb503[_0x3cb86f];return _0x16e246;};'use strict';var BPromise=require(_0x3b50('0x0'));var util=require(_0x3b50('0x1'));var _=require(_0x3b50('0x2'));var fs=require('fs');var squel=require(_0x3b50('0x3'));var Papa=require(_0x3b50('0x4'));var Redis=require(_0x3b50('0x5'));var db=require(_0x3b50('0x6'))['db'];var config=require(_0x3b50('0x7'));var logger=require(_0x3b50('0x8'))('api');config[_0x3b50('0x9')]=_[_0x3b50('0xa')](config[_0x3b50('0x9')],{'host':'localhost','port':0x18eb});var socket=require(_0x3b50('0xb'))(new Redis(config[_0x3b50('0x9')]));require(_0x3b50('0xc'))['register'](socket);try{if(!process[_0x3b50('0xd')][0x2]||process[_0x3b50('0xd')][0x2]===_0x3b50('0xe')||process['argv'][0x2]===_0x3b50('0xf')){throw new Error('Missing\x20filepath\x20parameter!');}var FILEPATH=process[_0x3b50('0xd')][0x2];if(!process[_0x3b50('0xd')][0x3]||process[_0x3b50('0xd')][0x3]===_0x3b50('0xe')||process[_0x3b50('0xd')][0x3]==='null'||!process[_0x3b50('0xd')][0x4]||process['argv'][0x4]===_0x3b50('0xe')||process[_0x3b50('0xd')][0x4]==='null'){throw new Error(_0x3b50('0x10'));}var FIELDS=_[_0x3b50('0x11')](process[_0x3b50('0xd')][0x3][_0x3b50('0x12')](','),process[_0x3b50('0xd')][0x4][_0x3b50('0x12')](','));if(!process['argv'][0x5]||process['argv'][0x5]===_0x3b50('0xe')||process[_0x3b50('0xd')][0x5]==='null'){throw new Error(_0x3b50('0x13'));}var LISTID=process[_0x3b50('0xd')][0x5];var COMPANYID=process['argv'][0x6]&&process[_0x3b50('0xd')][0x6]!==_0x3b50('0xe')&&process[_0x3b50('0xd')][0x6]!==_0x3b50('0xf')?process[_0x3b50('0xd')][0x6]:null;var DUPLICATES=process['argv'][0x7]&&process[_0x3b50('0xd')][0x7]!=='undefined'&&process[_0x3b50('0xd')][0x7]!==_0x3b50('0xf')?process['argv'][0x7]:null;if(!process[_0x3b50('0xd')][0x8]||process[_0x3b50('0xd')][0x8]==='undefined'||process[_0x3b50('0xd')][0x8]==='null'){throw new Error(_0x3b50('0x14'));}var SOCKET_TIMESTAMP=process[_0x3b50('0xd')][0x8];}catch(_0x2e4dc){logger['error'](_0x2e4dc);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(_0x5b198d,_0x44e9fe,_0x317cb5,_0x322805){var _0x260942={'message':_0x44e9fe};_0x260942[_0x5b198d]=!![];if(_0x317cb5){_0x260942['contact']=_0x317cb5;}if(_0x322805){_0x260942[_0x3b50('0x15')]=_0x322805;}return _0x260942;}function isEmail(_0x220202){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))*$/[_0x3b50('0x16')](_0x220202);}function checkRow(_0x4385b3,_0x2ca694,_0x52b100){return new BPromise(function(_0x261f72,_0x5d44f4){if(_['isNil'](_0x4385b3)){return _0x5d44f4(handleCheckRowError(_0x3b50('0x17'),'The\x20row\x20is\x20empty\x20or\x20the\x20number\x20of\x20parameters\x20does\x20not\x20match\x20the\x20columns!',null,_0x52b100));}if(_0x4385b3[_0x3b50('0x18')]&&_0x4385b3[_0x3b50('0x18')]['length']){var _0x13dac4=_[_0x3b50('0x19')](_0x4385b3[_0x3b50('0x18')],_0x3b50('0x1a'))[_0x3b50('0x1b')](';');return _0x5d44f4(handleCheckRowError(_0x3b50('0x17'),_0x13dac4,null,_0x52b100));}var _0x14244b={};for(var _0x2eeccd in FIELDS){if(FIELDS[_0x3b50('0x1c')](_0x2eeccd)&&FIELDS[_0x2eeccd]){_0x14244b[_0x2eeccd]=_0x4385b3[_0x3b50('0x1d')][0x0][FIELDS[_0x2eeccd]]||_0x4385b3[_0x3b50('0x1d')][0x0]['\ufeff'+FIELDS[_0x2eeccd]];}}if(!_0x14244b[_0x3b50('0x1e')]){return _0x5d44f4(handleCheckRowError('error',_0x3b50('0x1f'),null,_0x52b100));}if(!_0x14244b[_0x3b50('0x20')]){return _0x5d44f4(handleCheckRowError(_0x3b50('0x17'),'phone\x20not\x20specified!',null,_0x52b100));}if(_0x14244b[_0x3b50('0x21')]){var _0x1c9958=moment(_0x14244b[_0x3b50('0x21')],_0x3b50('0x22'));if(!_0x1c9958[_0x3b50('0x23')]()){return _0x5d44f4(handleCheckRowError(_0x3b50('0x17'),_0x3b50('0x24'),null,_0x52b100));}}if(_0x14244b[_0x3b50('0x25')]){if(!isEmail(_0x14244b['email'])){return _0x5d44f4(handleCheckRowError(_0x3b50('0x17'),_0x3b50('0x26'),null,_0x52b100));}}_0x14244b[_0x3b50('0x27')]=LISTID;_0x14244b[_0x3b50('0x28')]=COMPANYID||undefined;if(DUPLICATES&&DUPLICATES[_0x3b50('0x29')]&&_0x2ca694){var _0x239321={};for(var _0x2e84f4=0x0,_0x248f3b=DUPLICATES[_0x3b50('0x29')];_0x2e84f4<_0x248f3b;_0x2e84f4+=0x1){_0x239321[DUPLICATES[_0x2e84f4]]=_0x14244b[DUPLICATES[_0x2e84f4]];}var _0x25c631=_[_0x3b50('0x2a')](_0x2ca694,_0x239321);if(_0x25c631){return _0x5d44f4(handleCheckRowError(_0x3b50('0x2b'),_0x3b50('0x2c'),_0x25c631,_0x52b100));}}return db[_0x3b50('0x2d')]['create'](_0x14244b,{'raw':!![],'hooks':![],'fields':_[_0x3b50('0x2e')](_0x14244b)})['then'](function(_0x2b9ec8){if(DUPLICATES&&DUPLICATES[_0x3b50('0x29')]&&_0x2ca694){_0x2ca694[_0x3b50('0x2f')](_[_0x3b50('0x30')](_0x14244b,DUPLICATES));}hopperContacts+=(hopperContacts?',':'')+_0x2b9ec8['id'];return _0x261f72();})[_0x3b50('0x31')](function(_0x42027c){return _0x5d44f4(handleCheckRowError(_0x3b50('0x17'),'Error\x20while\x20creating\x20contact:\x20'+(_0x42027c['message']||JSON[_0x3b50('0x32')](_0x42027c)),null,_0x52b100));});});}function checkHopper(){function _0x4ab2e2(){return function(_0x2ac199){logger[_0x3b50('0x17')](_0x3b50('0x33'),'checkHopper',util[_0x3b50('0x34')](_0x2ac199,{'showHidden':![],'depth':null}));};}var _0x57e768=function(_0x22b6c9,_0xf7bbc2){var _0x140361=squel['insert']()[_0x3b50('0x35')](_0x3b50('0x36'))['fromQuery']([_0x3b50('0x20'),_0x3b50('0x37'),_0x3b50('0x38'),_0x3b50('0x27'),_0xf7bbc2,'createdAt',_0x3b50('0x39')],squel[_0x3b50('0x3a')]()[_0x3b50('0x3b')](_0x3b50('0x20'),_0x3b50('0x20'))[_0x3b50('0x3b')](_0x3b50('0x3c'),_0x3b50('0x37'))[_0x3b50('0x3b')]('id',_0x3b50('0x38'))['field'](LISTID[_0x3b50('0x3d')](),_0x3b50('0x27'))[_0x3b50('0x3b')](_0x22b6c9['id']['toString'](),_0xf7bbc2)[_0x3b50('0x3b')](_0x3b50('0x3c'),_0x3b50('0x3e'))[_0x3b50('0x3b')](_0x3b50('0x3c'),_0x3b50('0x39'))[_0x3b50('0x3f')](_0x3b50('0x40'))[_0x3b50('0x41')](_0x3b50('0x42'))[_0x3b50('0x41')]('ListId\x20=\x20?',LISTID[_0x3b50('0x3d')]())[_0x3b50('0x41')](_0x3b50('0x43'))[_0x3b50('0x41')](_0x3b50('0x44'),squel['select']()[_0x3b50('0x3b')](_0x3b50('0x20'))[_0x3b50('0x3f')](_0x3b50('0x36'))[_0x3b50('0x41')](_0xf7bbc2+'\x20=\x20?',_0x22b6c9['id'][_0x3b50('0x3d')]())))[_0x3b50('0x3d')]();return _0x140361;};var _0x19ee46=function(_0x34b03e,_0x5e9968){var _0x4af00c=squel[_0x3b50('0x45')]()['into'](_0x3b50('0x36'))[_0x3b50('0x46')]([_0x3b50('0x20'),_0x3b50('0x37'),_0x3b50('0x38'),'ListId',_0x5e9968,'createdAt',_0x3b50('0x39')],squel['select']()['field'](_0x3b50('0x20'),_0x3b50('0x20'))[_0x3b50('0x3b')]('NOW()',_0x3b50('0x37'))[_0x3b50('0x3b')]('id',_0x3b50('0x38'))['field'](LISTID[_0x3b50('0x3d')](),_0x3b50('0x27'))[_0x3b50('0x3b')](_0x34b03e['id'][_0x3b50('0x3d')](),_0x5e9968)[_0x3b50('0x3b')](_0x3b50('0x3c'),_0x3b50('0x3e'))[_0x3b50('0x3b')]('NOW()',_0x3b50('0x39'))[_0x3b50('0x3f')](_0x3b50('0x40'))[_0x3b50('0x41')](_0x3b50('0x42'))['where'](_0x3b50('0x47'),LISTID[_0x3b50('0x3d')]())['where']('id\x20IN\x20?',squel[_0x3b50('0x48')](hopperContacts))[_0x3b50('0x41')](_0x3b50('0x43'))['where'](_0x3b50('0x44'),squel[_0x3b50('0x3a')]()[_0x3b50('0x3b')](_0x3b50('0x49'))[_0x3b50('0x3f')]('cm_hopper_final')[_0x3b50('0x41')](_0x5e9968+_0x3b50('0x4a'),_0x34b03e['id']['toString']()))[_0x3b50('0x41')](_0x3b50('0x44'),squel[_0x3b50('0x3a')]()[_0x3b50('0x3b')](_0x3b50('0x20'))[_0x3b50('0x3f')](_0x3b50('0x36'))['where'](_0x5e9968+_0x3b50('0x4a'),_0x34b03e['id'][_0x3b50('0x3d')]())))['toString']();return _0x4af00c;};function _0x1f92dc(_0x38c999,_0x3a2195){var _0x5dcf3b=squel[_0x3b50('0x45')]()[_0x3b50('0x35')]('cm_hopper')['fromQuery'](['phone',_0x3b50('0x37'),_0x3b50('0x38'),_0x3b50('0x27'),_0x3a2195,_0x3b50('0x3e'),_0x3b50('0x39')],squel[_0x3b50('0x3a')]()['field'](_0x3b50('0x20'),_0x3b50('0x20'))[_0x3b50('0x3b')](_0x3b50('0x3c'),'scheduledAt')['field']('id',_0x3b50('0x38'))[_0x3b50('0x3b')](LISTID[_0x3b50('0x3d')](),_0x3b50('0x27'))[_0x3b50('0x3b')](_0x38c999['id']['toString'](),_0x3a2195)['field'](_0x3b50('0x3c'),_0x3b50('0x3e'))['field'](_0x3b50('0x3c'),_0x3b50('0x39'))[_0x3b50('0x3f')](_0x3b50('0x40'))[_0x3b50('0x41')]('deletedAt\x20IS\x20NULL')[_0x3b50('0x41')](_0x3b50('0x47'),LISTID[_0x3b50('0x3d')]())[_0x3b50('0x41')](_0x3b50('0x4b'),squel[_0x3b50('0x48')](hopperContacts))['where'](_0x3b50('0x43')))['toString']();return _0x5dcf3b;}function _0x9fc286(_0x207b49,_0x1264a7){var _0x4aca3a=squel[_0x3b50('0x45')]()[_0x3b50('0x35')](_0x3b50('0x4c'))[_0x3b50('0x46')]([_0x3b50('0x20'),_0x3b50('0x38'),_0x3b50('0x27'),_0x1264a7,'createdAt',_0x3b50('0x39')],squel[_0x3b50('0x3a')]()[_0x3b50('0x3b')](_0x3b50('0x20'),_0x3b50('0x20'))[_0x3b50('0x3b')]('id',_0x3b50('0x38'))[_0x3b50('0x3b')](LISTID[_0x3b50('0x3d')](),'ListId')['field'](_0x207b49['id'][_0x3b50('0x3d')](),_0x1264a7)['field'](_0x3b50('0x3c'),'createdAt')['field'](_0x3b50('0x3c'),_0x3b50('0x39'))[_0x3b50('0x3f')](_0x3b50('0x40'))[_0x3b50('0x41')](_0x3b50('0x42'))[_0x3b50('0x41')](_0x3b50('0x47'),LISTID[_0x3b50('0x3d')]())[_0x3b50('0x41')](_0x3b50('0x4b'),squel[_0x3b50('0x48')](hopperContacts))['where'](_0x3b50('0x43')))[_0x3b50('0x3d')]();return _0x4aca3a;}return db[_0x3b50('0x4d')][_0x3b50('0x4e')]({'where':{'type':_0x3b50('0x4f')},'attributes':['id','dialCheckDuplicateType'],'include':[{'model':db['CmList'],'as':_0x3b50('0x50'),'where':{'id':LISTID}}]})[_0x3b50('0x51')](function(_0x5cbaa2){var _0x3ee4f1=[];if(_0x5cbaa2){var _0x5ec106;for(var _0x2be2f4=0x0,_0x5a2929;_0x2be2f4<_0x5cbaa2[_0x3b50('0x29')];_0x2be2f4+=0x1){_0x5a2929=_0x5cbaa2[_0x2be2f4][_0x3b50('0x52')]({'plain':!![]});switch(_0x5a2929['dialCheckDuplicateType']){case _0x3b50('0x53'):_0x3ee4f1[_0x3b50('0x2f')](db[_0x3b50('0x54')][_0x3b50('0x55')](_0x19ee46(_0x5a2929,'VoiceQueueId'))['then'](function(){})[_0x3b50('0x31')](_0x4ab2e2()));break;case _0x3b50('0x56'):_0x3ee4f1[_0x3b50('0x2f')](db[_0x3b50('0x54')][_0x3b50('0x55')](_0x57e768(_0x5a2929,_0x3b50('0x57')))[_0x3b50('0x51')](function(){})[_0x3b50('0x31')](_0x4ab2e2()));break;default:_0x3ee4f1[_0x3b50('0x2f')](db[_0x3b50('0x54')]['query'](_0x1f92dc(_0x5a2929,_0x3b50('0x57')))[_0x3b50('0x51')](function(){})[_0x3b50('0x31')](_0x4ab2e2()));}}}return _0x3ee4f1;})[_0x3b50('0x58')]()['then'](function(){return db[_0x3b50('0x4d')][_0x3b50('0x4e')]({'where':{'type':'outbound'},'attributes':['id'],'include':[{'model':db[_0x3b50('0x59')],'as':_0x3b50('0x5a'),'where':{'id':LISTID}}]})[_0x3b50('0x51')](function(_0x507346){var _0x48bc73=[];if(_0x507346){var _0x56ee2f;for(var _0x3069a6=0x0,_0x3e0f8a;_0x3069a6<_0x507346[_0x3b50('0x29')];_0x3069a6+=0x1){_0x3e0f8a=_0x507346[_0x3069a6][_0x3b50('0x52')]({'plain':!![]});_0x48bc73[_0x3b50('0x2f')](db['sequelize'][_0x3b50('0x55')](_0x9fc286(_0x3e0f8a,_0x3b50('0x57')))[_0x3b50('0x51')](function(){})[_0x3b50('0x31')](_0x4ab2e2()));}}return _0x48bc73;})['all']();})[_0x3b50('0x51')](function(){return db[_0x3b50('0x5b')]['findAll']({'attributes':['id',_0x3b50('0x5c')],'include':[{'model':db[_0x3b50('0x59')],'as':_0x3b50('0x50'),'where':{'id':LISTID}}]})['then'](function(_0x287d59){var _0x1eee41=[];if(_0x287d59){for(var _0x3f5720=0x0,_0x3b686f;_0x3f5720<_0x287d59[_0x3b50('0x29')];_0x3f5720+=0x1){_0x3b686f=_0x287d59[_0x3f5720][_0x3b50('0x52')]({'plain':!![]});switch(_0x3b686f[_0x3b50('0x5c')]){case _0x3b50('0x53'):_0x1eee41[_0x3b50('0x2f')](db[_0x3b50('0x54')]['query'](_0x19ee46(_0x3b686f,'CampaignId'))['then'](function(){})[_0x3b50('0x31')](_0x4ab2e2()));break;case'onlyIfOpen':_0x1eee41[_0x3b50('0x2f')](db[_0x3b50('0x54')][_0x3b50('0x55')](_0x57e768(_0x3b686f,_0x3b50('0x5d')))['then'](function(){})[_0x3b50('0x31')](_0x4ab2e2()));break;default:_0x1eee41[_0x3b50('0x2f')](db[_0x3b50('0x54')][_0x3b50('0x55')](_0x1f92dc(_0x3b686f,_0x3b50('0x5d')))[_0x3b50('0x51')](function(){})[_0x3b50('0x31')](_0x4ab2e2()));}}}return _0x1eee41;})[_0x3b50('0x58')]();})['then'](function(){return db[_0x3b50('0x5b')][_0x3b50('0x4e')]({'attributes':['id'],'include':[{'model':db[_0x3b50('0x59')],'as':'BlackLists','where':{'id':LISTID}}]})[_0x3b50('0x51')](function(_0x41354a){var _0x44536b=[];if(_0x41354a){for(var _0x42a00c=0x0,_0x595bb1;_0x42a00c<_0x41354a['length'];_0x42a00c+=0x1){_0x595bb1=_0x41354a[_0x42a00c]['get']({'plain':!![]});_0x44536b[_0x3b50('0x2f')](db[_0x3b50('0x54')]['query'](_0x9fc286(_0x595bb1,_0x3b50('0x5d')))[_0x3b50('0x51')](function(){})[_0x3b50('0x31')](_0x4ab2e2()));}}return _0x44536b;})[_0x3b50('0x58')]();})['catch'](function(_0x1c80d5){logger['error'](_0x3b50('0x5e'),_0x3b50('0x5f'),_0x1c80d5[_0x3b50('0x1a')]);});}var processPromises=function(_0x3e1fbb){return BPromise['all'](promises)[_0x3b50('0x51')](function(_0x27a420){})[_0x3b50('0x31')](function(_0xf40f8f){logger[_0x3b50('0x17')](_0x3b50('0x60'),JSON[_0x3b50('0x32')](_0xf40f8f));})[_0x3b50('0x61')](function(){socket[_0x3b50('0x62')](_0x3b50('0x63')+SOCKET_TIMESTAMP,{'success':success,'errors':errors,'duplicates':duplicates,'rows':rows});promises=[];success=0x0;errors=0x0;duplicates=0x0;rows=[];if(_0x3e1fbb){return _0x3e1fbb[_0x3b50('0x64')]();}});};var endCsv=function(){return BPromise[_0x3b50('0x65')]()[_0x3b50('0x51')](function(){if(hopperContacts){return checkHopper();}})[_0x3b50('0x51')](function(){socket[_0x3b50('0x62')]('contact:csv_'+SOCKET_TIMESTAMP,{'finished':!![],'success':success,'errors':errors,'duplicates':duplicates,'rows':rows});try{fs[_0x3b50('0x66')](FILEPATH);}catch(_0x5f19c1){logger[_0x3b50('0x17')](_0x3b50('0x67'),JSON['stringify'](_0x5f19c1));}finally{process[_0x3b50('0x68')](0x0);}});};process['on']('SIGINT',function(){logger[_0x3b50('0x69')]('CSV\x20import\x20process\x20stopped!');endCsv();});function main(){return BPromise[_0x3b50('0x65')]()[_0x3b50('0x51')](function(){if(DUPLICATES){DUPLICATES=DUPLICATES[_0x3b50('0x12')](',');return db[_0x3b50('0x2d')][_0x3b50('0x4e')]({'where':{'ListId':LISTID},'attributes':DUPLICATES,'raw':!![]});}})[_0x3b50('0x51')](function(_0x50167c){var _0x38d545=fs[_0x3b50('0x6a')](FILEPATH,{'highWaterMark':0xf*0x400*0x400});Papa[_0x3b50('0x6b')](_0x38d545,{'header':!![],'skipEmptyLines':!![],'step':function(_0x16a0df,_0x115298){total+=0x1;var _0x5a77e5=total;promises[_0x3b50('0x2f')](checkRow(_0x16a0df,_0x50167c,_0x5a77e5)[_0x3b50('0x51')](function(){success+=0x1;})[_0x3b50('0x31')](function(_0x6677e6){if(_0x6677e6[_0x3b50('0x17')]){errors+=0x1;delete _0x6677e6[_0x3b50('0x17')];}else if(_0x6677e6[_0x3b50('0x2b')]){duplicates+=0x1;delete _0x6677e6[_0x3b50('0x2b')];}rows[_0x3b50('0x2f')](_0x6677e6);}));if(total%0xc8===0x0){_0x115298[_0x3b50('0x6c')]();return processPromises(_0x115298);}},'complete':function(){return processPromises()['then'](function(){logger[_0x3b50('0x69')](_0x3b50('0x6d'));endCsv();});},'error':function(_0x215e07,_0x36bc2a){logger[_0x3b50('0x69')](_0x3b50('0x6e'),JSON[_0x3b50('0x32')](_0x215e07));endCsv();}});})[_0x3b50('0x31')](function(_0x2629d8){logger[_0x3b50('0x17')](_0x3b50('0x6f'),JSON[_0x3b50('0x32')](_0x2629d8));});}main(); \ No newline at end of file diff --git a/server/components/import/cm/csv2.js b/server/components/import/cm/csv2.js index 6b3b354..e4fdc80 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 _0xb725=['step','duplicates','cm_contacts_','CREATE\x20TABLE\x20','campaigns_','voice_queues_','(id\x20int,dialTimezone\x20varchar(255),offset\x20int);','each',',\x20scheduledAt\x20=\x20NOW()','DROP\x20TABLE\x20','orderBy','voice_queues_has_cm_blacklists','campaigns_has_cm_blacklists','CampaignId','VoiceQueueId','affectedRows','unlink','complete','argv','file\x20doesn\x27t\x20exists','parse','binding\x20doesn\x27t\x20exists','phone\x20is\x20mandatory','firstName','firstName\x20is\x20mandatory','ListId\x20is\x20mandatory','body\x20id\x20mandatory','map','No\x20agent\x20available','SIGINT','uncaughtException','path','lodash','papaparse','util','bluebird','moment','squel','ioredis','../../../mysqldb','../../../config/environment','../../../config/environment/shared','import','redis','format','YYYY-MM-DD\x20HH:mm:ss','test','select','field','phone','from','join','.id\x20=\x20','\x20=\x20','where','CmContact','AdditionalPhones','then','length','push','all','split','isNil','CmContactHasItem','findOne','update','create','PHONE','inserted','cm_contacts.phone','cm_contacts.id','cm_contacts.updatedAt','insert','cm_hopper','scheduledat','ContactId','createdAt','updatedAt','priority','fields','.CmListId','\x22always\x22','toString','cm_contacts.ListId','cm_contacts.createdAt','cm_hopper_black','ListId','cm_contacts','cm_contacts.ListId\x20=\x20','.CmListId\x20=\x20?','cm_contacts.phone\x20NOT\x20IN\x20(?)','ListId\x20=\x20?','date_add(cm_contacts.scheduledat,interval\x20','cm_contacts.priority','cm_contacts.UserId','into','fromQuery','cm_contacts.createdAt\x20=\x20?','cm_hopper.id','cm_contact_has_items.item','cm_contact_has_items.updatedAt','cm_hopper_additional_phones','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?','concat',')\x20NOT\x20IN\x20?','id\x20IN\x20?','MIN(id)','group','info','Received\x20SIGINT','error','message','exit','errors','code','query','spread','catch','campaigns.id','campaigns','campaigns_has_cm_lists','campaigns.id\x20=\x20campaigns_has_cm_lists.CampaignId','campaigns_has_cm_lists.CmListId=','sequelize','voice_queues.id','voice_queues.dialTimezone','voice_queues','voice_queues_has_cm_lists','voice_queues.id\x20=\x20voice_queues_has_cm_lists.VoiceQueueId','voice_queues_has_cm_lists.CmListId=','timezones','dialTimezone','utcOffset','set','offset','stringify','start','binding','clone','socket_timestamp','root','server/files/tmp','.csv','keys','header','ContactItemType','findAll','name','_description','writeFileSync','rows','find','hasOwnProperty','data','replace','isValid','scheduledat\x20wrong\x20format\x20(YYYY-MM-DD\x20HH:mm:ss)','isNaN','UserId','isNumber','includes','agent\x20not\x20exists','email','email\x20wrong\x20format','dateOfBirth','dateOfBirth\x20wrong\x20format\x20(YYYY-MM-DD)','\x20not\x20specified','trim','itemTypeId','description','SystemRow','appendFileSync','emit','contact:import:','Abort\x20parser','abort'];(function(_0x38998c,_0x520824){var _0x30bfa9=function(_0x2636e0){while(--_0x2636e0){_0x38998c['push'](_0x38998c['shift']());}};_0x30bfa9(++_0x520824);}(_0xb725,0x185));var _0x5b72=function(_0x57f04f,_0x54a970){_0x57f04f=_0x57f04f-0x0;var _0x4c2662=_0xb725[_0x57f04f];return _0x4c2662;};'use strict';var fs=require('fs');var path=require(_0x5b72('0x0'));var _=require(_0x5b72('0x1'));var Papa=require(_0x5b72('0x2'));var util=require(_0x5b72('0x3'));var BPromise=require(_0x5b72('0x4'));var moment=require(_0x5b72('0x5'));var squel=require(_0x5b72('0x6'));var Redis=require(_0x5b72('0x7'));var db=require(_0x5b72('0x8'))['db'];var config=require(_0x5b72('0x9'));var shared=require(_0x5b72('0xa'));var logger=require('../../../config/logger')(_0x5b72('0xb'));config[_0x5b72('0xc')]=_['defaults'](config['redis'],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x5b72('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()[_0x5b72('0xd')](_0x5b72('0xe'));function isEmail(_0x3b8afd){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))*$/[_0x5b72('0xf')](_0x3b8afd);}function selectNotIn(_0x388442,_0x5ed29b,_0xaac585,_0x5af9f8,_0xf4cf8d){return squel[_0x5b72('0x10')]()[_0x5b72('0x11')](_0x5b72('0x12'))[_0x5b72('0x13')](_0x5af9f8)[_0x5b72('0x14')](_0x5ed29b,null,_0x5ed29b+_0x5b72('0x15')+_0x5af9f8+'.'+_0xaac585)['where'](_0x5af9f8+'.'+_0xaac585+_0x5b72('0x16')+_0x388442+'.'+_0xaac585)[_0x5b72('0x17')](_0x5ed29b+'.dialCheckDuplicateType\x20IN\x20('+_0xf4cf8d['join']()+')');}function handleAdditionalPhones(){return new Promise(function(_0x8e5a6,_0x46bf3a){promisesAdditionalPhones=[];return db[_0x5b72('0x18')]['findAll']({'raw':!![],'attributes':['id',_0x5b72('0x19')],'where':{'createdAt':NOW,'AdditionalPhones':{'$ne':null}}})[_0x5b72('0x1a')](function(_0x5946ec){if(_0x5946ec!==null){var _0x2166f6=[];for(var _0x30617c=0x0;_0x30617c<_0x5946ec[_0x5b72('0x1b')];_0x30617c++){var _0x2fc61e=_0x5946ec[_0x30617c];_0x2166f6[_0x5b72('0x1c')](insertAdditionalPhones(_0x2fc61e));}}Promise[_0x5b72('0x1d')](_0x2166f6)[_0x5b72('0x1a')](function(){_0x8e5a6({'val':0x1});});});});}function insertAdditionalPhones(_0x3bac60){return new Promise(function(_0x42f82,_0x33c381){var _0x198346=_0x3bac60[_0x5b72('0x19')];var _0x4d7943=_0x198346['split'](';');var _0x470ee6=[];orderBy=0x0;for(var _0x2fe6fd=0x0;_0x2fe6fd<_0x4d7943[_0x5b72('0x1b')];_0x2fe6fd++){_0x470ee6[_0x5b72('0x1c')](splitAdditionalPhone(_0x3bac60['id'],_0x4d7943[_0x2fe6fd]));}Promise['all'](_0x470ee6)[_0x5b72('0x1a')](function(){_0x42f82({'val':_0x4d7943[_0x5b72('0x1b')]});});});}function splitAdditionalPhone(_0x4518a4,_0x3c8109){return new Promise(function(_0x54e4d3,_0x251113){var _0x46aba4=_0x3c8109[_0x5b72('0x1e')](':');var _0x52bb1c=_0x46aba4[0x0];var _0x1e85d1=_0x46aba4[0x1];if(!_[_0x5b72('0x1f')](_0x1e85d1)){var _0xc574f4=_0x1e85d1[_0x5b72('0x1e')]('|');var _0x1f0eb4=[];for(var _0xfb209c=0x0;_0xfb209c<_0xc574f4['length'];_0xfb209c++){if(_0xc574f4[_0xfb209c]!==''){var _0x194dd7=_['filter'](promisesAdditionalPhones,{'contactId':_0x4518a4,'phone':_0xc574f4[_0xfb209c]});if(_0x194dd7[_0x5b72('0x1b')]==0x0){orderBy++;promisesAdditionalPhones[_0x5b72('0x1c')]({'contactId':_0x4518a4,'contactTypeId':_0x52bb1c,'phone':_0xc574f4[_0xfb209c],'orderBy':orderBy});}}}_0x54e4d3({'ok':0x1});}else _0x54e4d3({'res':0x0});});}function createAdditionalPhone(_0x351676,_0x1cdb57,_0x17f280,_0x2ac944){var _0x3425e7='';var _0xbf8a83='';var _0x3712f9=_0x17f280[_0x5b72('0x1e')]('§');_0x3425e7=_0x3712f9[0x0];if(_0x3712f9[_0x5b72('0x1b')]==0x2)_0xbf8a83=_0x3712f9[0x1];return new Promise(function(_0x453b98,_0x95e8c4){return db[_0x5b72('0x20')][_0x5b72('0x21')]({'where':{'CmContactId':_0x351676,'item':_0x3425e7}})[_0x5b72('0x1a')](function(_0x36edba){if(_0x36edba){return db[_0x5b72('0x20')][_0x5b72('0x22')]({'ItemTypeId':_0x1cdb57,'description':_0xbf8a83,'OrderBy':_0x2ac944},{'where':{'CmContactId':_0x351676,'item':_0x3425e7}})[_0x5b72('0x1a')](function(_0x5ed232){_0x453b98({'res':'updated'});});}else{return db['CmContactHasItem'][_0x5b72('0x23')]({'CmContactId':_0x351676,'item':_0x3425e7,'description':_0xbf8a83,'ItemTypeId':_0x1cdb57,'OrderBy':_0x2ac944,'ItemClass':_0x5b72('0x24')})[_0x5b72('0x1a')](function(_0x30bcc8){_0x453b98({'res':_0x5b72('0x25')});});}});});}function insertCmHopper(_0x11c911,_0x59d470,_0x186d41,_0x2d6736,_0x5be37c){var _0x1abd68=[_0x5b72('0x26'),'cm_contacts.scheduledat',_0x5b72('0x27'),'cm_contacts.ListId',_0x59d470+'.'+_0x2d6736,'cm_contacts.createdAt',_0x5b72('0x28'),'cm_contacts.priority','cm_contacts.UserId','\x22'+_0x5be37c+'\x22'];return squel[_0x5b72('0x29')]()['into'](_0x5b72('0x2a'))['fromQuery']([_0x5b72('0x12'),_0x5b72('0x2b'),_0x5b72('0x2c'),'ListId',_0x2d6736,_0x5b72('0x2d'),_0x5b72('0x2e'),_0x5b72('0x2f'),'UserId','recallme'],squel[_0x5b72('0x10')]()[_0x5b72('0x30')](_0x1abd68)['from'](_0x59d470)['join']('cm_contacts',null,'cm_contacts.ListId\x20=\x20'+_0x59d470+_0x5b72('0x31'))[_0x5b72('0x14')](_0x186d41,null,_0x186d41+_0x5b72('0x15')+_0x59d470+'.'+_0x2d6736)[_0x5b72('0x17')](_0x59d470+'.CmListId\x20=\x20?',_0x11c911)[_0x5b72('0x17')]('cm_contacts.createdAt\x20=\x20?',NOW)[_0x5b72('0x17')]('cm_contacts.phone\x20NOT\x20IN\x20(?)',selectNotIn(_0x59d470,_0x186d41,_0x2d6736,_0x5b72('0x2a'),[_0x5b72('0x32'),'\x22onlyIfOpen\x22']))['where']('cm_contacts.phone\x20NOT\x20IN\x20(?)',selectNotIn(_0x59d470,_0x186d41,_0x2d6736,_0x5b72('0x2a'),[_0x5b72('0x32')])))[_0x5b72('0x33')]();}function insertCmHopperBlack(_0x8eda5a,_0x24709d,_0x4c2aca,_0x448e8a){var _0x49b8d6=[_0x5b72('0x26'),_0x5b72('0x27'),_0x5b72('0x34'),_0x24709d+'.'+_0x448e8a,_0x5b72('0x35'),_0x5b72('0x28')];return squel[_0x5b72('0x29')]()['into'](_0x5b72('0x36'))['fromQuery'](['phone',_0x5b72('0x2c'),_0x5b72('0x37'),_0x448e8a,'createdAt',_0x5b72('0x2e')],squel['select']()[_0x5b72('0x30')](_0x49b8d6)['from'](_0x24709d)['join'](_0x5b72('0x38'),null,_0x5b72('0x39')+_0x24709d+_0x5b72('0x31'))[_0x5b72('0x14')](_0x4c2aca,null,_0x4c2aca+_0x5b72('0x15')+_0x24709d+'.'+_0x448e8a)[_0x5b72('0x17')](_0x24709d+_0x5b72('0x3a'),_0x8eda5a)[_0x5b72('0x17')]('cm_contacts.createdAt\x20=\x20?',NOW)[_0x5b72('0x17')](_0x5b72('0x3b'),squel[_0x5b72('0x10')]()[_0x5b72('0x11')](_0x5b72('0x12'))[_0x5b72('0x13')](_0x5b72('0x36'))[_0x5b72('0x17')](_0x5b72('0x3c'),_0x8eda5a)[_0x5b72('0x17')](_0x448e8a+_0x5b72('0x16')+_0x24709d+'.'+_0x448e8a)))[_0x5b72('0x33')]();}function insertTzCmHopper(_0x4e37a3,_0x4677a6,_0x3f8a5c,_0x7f22d8,_0x14204a,_0x52aeaa){var _0x54e2ed=[_0x5b72('0x26'),_0x5b72('0x3d')+_0x52aeaa+'.offset-cm_contacts.utcOffset\x20minute)',_0x5b72('0x27'),_0x5b72('0x34'),_0x4677a6+'.'+_0x7f22d8,_0x5b72('0x35'),_0x5b72('0x28'),_0x5b72('0x3e'),_0x5b72('0x3f'),'\x22'+_0x14204a+'\x22'];var _0x42fc38=squel[_0x5b72('0x29')]()[_0x5b72('0x40')](_0x5b72('0x2a'))[_0x5b72('0x41')]([_0x5b72('0x12'),_0x5b72('0x2b'),'ContactId',_0x5b72('0x37'),_0x7f22d8,_0x5b72('0x2d'),'updatedAt',_0x5b72('0x2f'),'UserId','recallme'],squel[_0x5b72('0x10')]()[_0x5b72('0x30')](_0x54e2ed)[_0x5b72('0x13')](_0x4677a6)[_0x5b72('0x14')](_0x5b72('0x38'),null,_0x5b72('0x39')+_0x4677a6+'.CmListId')['join'](_0x3f8a5c,null,_0x3f8a5c+_0x5b72('0x15')+_0x4677a6+'.'+_0x7f22d8)[_0x5b72('0x14')](_0x52aeaa,null,_0x52aeaa+_0x5b72('0x15')+_0x4677a6+'.'+_0x7f22d8)[_0x5b72('0x17')](_0x4677a6+_0x5b72('0x3a'),_0x4e37a3)[_0x5b72('0x17')]('cm_contacts.createdAt\x20=\x20?',NOW)[_0x5b72('0x17')](_0x5b72('0x3b'),selectNotIn(_0x4677a6,_0x3f8a5c,_0x7f22d8,_0x5b72('0x2a'),[_0x5b72('0x32'),'\x22onlyIfOpen\x22']))['where'](_0x5b72('0x3b'),selectNotIn(_0x4677a6,_0x3f8a5c,_0x7f22d8,'cm_hopper',['\x22always\x22'])))[_0x5b72('0x33')]();return _0x42fc38;}function insertTzCmHopperBlack(_0x4ddccc,_0x30e1ac,_0x1d0f92,_0x2241d0){var _0x2744ad=[_0x5b72('0x26'),_0x5b72('0x27'),_0x5b72('0x34'),_0x30e1ac+'.'+_0x2241d0,_0x5b72('0x35'),_0x5b72('0x28')];return squel[_0x5b72('0x29')]()['into']('cm_hopper_black')[_0x5b72('0x41')]([_0x5b72('0x12'),_0x5b72('0x2c'),_0x5b72('0x37'),_0x2241d0,_0x5b72('0x2d'),_0x5b72('0x2e')],squel[_0x5b72('0x10')]()['fields'](_0x2744ad)[_0x5b72('0x13')](_0x30e1ac)[_0x5b72('0x14')]('cm_contacts',null,_0x5b72('0x39')+_0x30e1ac+'.CmListId')[_0x5b72('0x14')](_0x1d0f92,null,_0x1d0f92+_0x5b72('0x15')+_0x30e1ac+'.'+_0x2241d0)[_0x5b72('0x17')](_0x30e1ac+_0x5b72('0x3a'),_0x4ddccc)[_0x5b72('0x17')](_0x5b72('0x42'),NOW)[_0x5b72('0x17')](_0x5b72('0x3b'),squel[_0x5b72('0x10')]()[_0x5b72('0x11')](_0x5b72('0x12'))[_0x5b72('0x13')](_0x5b72('0x36'))['where'](_0x5b72('0x3c'),_0x4ddccc)[_0x5b72('0x17')](_0x2241d0+_0x5b72('0x16')+_0x30e1ac+'.'+_0x2241d0)))[_0x5b72('0x33')]();}function insertCmHopperAdditionalPhones(_0x4aeb94){var _0x4538fa=[_0x5b72('0x43'),_0x5b72('0x44'),'cm_contact_has_items.OrderBy','cm_contact_has_items.createdAt',_0x5b72('0x45')];return squel[_0x5b72('0x29')]()[_0x5b72('0x40')](_0x5b72('0x46'))['fromQuery'](['CmHopperId',_0x5b72('0x12'),'OrderBy',_0x5b72('0x2d'),'updatedAt'],squel['select']()[_0x5b72('0x30')](_0x4538fa)[_0x5b72('0x13')]('cm_hopper')[_0x5b72('0x14')](_0x5b72('0x38'),null,_0x5b72('0x47'))['join'](_0x5b72('0x48'),null,_0x5b72('0x49'))[_0x5b72('0x17')](_0x5b72('0x4a'),_0x4aeb94)['where'](_0x5b72('0x42'),NOW))[_0x5b72('0x33')]();}function insertCmContact(_0x25e6b7,_0x555ac2,_0x2cebfa,_0x862e18){var _0x3c3689=_[_0x5b72('0x4b')](_['keys'](_0x862e18),[_0x5b72('0x37'),'CompanyId',_0x5b72('0x2d'),_0x5b72('0x2e'),'scheduledAt']);return squel['insert']()[_0x5b72('0x40')](_0x5b72('0x38'))['fromQuery'](_0x3c3689,squel['select']()[_0x5b72('0x30')](_0x3c3689)[_0x5b72('0x13')](_0x555ac2)[_0x5b72('0x17')]('('+_0x2cebfa[_0x5b72('0x14')](',')+_0x5b72('0x4c'),squel['select']()[_0x5b72('0x30')](_0x2cebfa)[_0x5b72('0x13')](_0x5b72('0x38'))[_0x5b72('0x17')](_0x5b72('0x3c'),_0x25e6b7)[_0x5b72('0x17')]('deletedAt\x20IS\x20NULL'))[_0x5b72('0x17')](_0x5b72('0x4d'),squel[_0x5b72('0x10')]()[_0x5b72('0x11')](_0x5b72('0x4e'),'min_id')[_0x5b72('0x13')](_0x555ac2)[_0x5b72('0x4f')](_0x2cebfa[_0x5b72('0x14')](','))))['toString']();}function handleStop(){logger[_0x5b72('0x50')](_0x5b72('0x51'));stopped=!![];}function handleUncaughtException(_0x28e419){logger[_0x5b72('0x52')](_0x28e419[_0x5b72('0x53')]);process[_0x5b72('0x54')](0x1);}function handleError(_0x1806b5,_0x2ee6b4){stats[_0x5b72('0x55')][_0x5b72('0x1c')]({'name':_0x2ee6b4[_0x5b72('0x56')],'message':_0x2ee6b4[_0x5b72('0x53')],'row':_0x1806b5});}function handleQuery(_0x58cc33){logger[_0x5b72('0x50')](_0x58cc33);return db['sequelize'][_0x5b72('0x57')](_0x58cc33)[_0x5b72('0x58')](function(_0x207e7c){results[_0x5b72('0x1c')](_0x207e7c);})[_0x5b72('0x59')](function(_0x2a29cb){logger[_0x5b72('0x52')](_0x2a29cb[_0x5b72('0x53')]);});}function updateTzCampaigns(_0x1485b6){return new Promise(function(_0xc7592a,_0x188a4b){var _0x25c921=squel[_0x5b72('0x10')]()[_0x5b72('0x30')]([_0x5b72('0x5a'),'campaigns.dialTimezone'])['from'](_0x5b72('0x5b'))[_0x5b72('0x14')](_0x5b72('0x5c'),null,_0x5b72('0x5d'))['where'](_0x5b72('0x5e')+_0x1485b6);db[_0x5b72('0x5f')][_0x5b72('0x57')](_0x25c921[_0x5b72('0x33')]())[_0x5b72('0x58')](function(_0x2da415){var _0xce21c5=[];for(var _0x4047ba=0x0;_0x4047ba<_0x2da415[_0x5b72('0x1b')];_0x4047ba++){_0xce21c5[_0x5b72('0x1c')](getTimezoneData(_0x2da415[_0x4047ba],tmp_campaigns));}BPromise[_0x5b72('0x1d')](_0xce21c5)['then'](function(){_0xc7592a({'val':0x1});});})[_0x5b72('0x59')](function(_0x5cceb7){logger[_0x5b72('0x52')](_0x5cceb7[_0x5b72('0x53')]);_0xc7592a({'val':0x0});});});}function updateTzVoiceQueues(_0x514356){return new Promise(function(_0x26c08c,_0x3c030d){var _0x718f18=squel[_0x5b72('0x10')]()[_0x5b72('0x30')]([_0x5b72('0x60'),_0x5b72('0x61')])[_0x5b72('0x13')](_0x5b72('0x62'))[_0x5b72('0x14')](_0x5b72('0x63'),null,_0x5b72('0x64'))['where'](_0x5b72('0x65')+_0x514356);db[_0x5b72('0x5f')]['query'](_0x718f18['toString']())[_0x5b72('0x58')](function(_0x3324af){var _0x54f123=[];for(var _0x412a69=0x0;_0x412a69<_0x3324af[_0x5b72('0x1b')];_0x412a69++){_0x54f123[_0x5b72('0x1c')](getTimezoneData(_0x3324af[_0x412a69],tmp_voice_queues));}BPromise[_0x5b72('0x1d')](_0x54f123)[_0x5b72('0x1a')](function(){_0x26c08c({'val':0x1});});})[_0x5b72('0x59')](function(_0x576457){logger[_0x5b72('0x52')](_0x576457[_0x5b72('0x53')]);_0x26c08c({'val':0x0});});});}function getTimezoneData(_0x389b00,_0x2b09f5){return new Promise(function(_0x5ba1ca,_0x495112){var _0xd5a8c9=shared[_0x5b72('0x66')];var _0x2d7130=_0xd5a8c9[_0x389b00[_0x5b72('0x67')]];if(_['isNil'](_0x2d7130)){_0x5ba1ca({'ret':0x1});}else{var _0x1cbf37=_0x2d7130[_0x5b72('0x68')];var _0x15b4ce=squel[_0x5b72('0x29')]()['into'](_0x2b09f5)[_0x5b72('0x69')]('id',_0x389b00['id'])[_0x5b72('0x69')](_0x5b72('0x6a'),_0x1cbf37)[_0x5b72('0x69')]('dialTimezone',_0x389b00[_0x5b72('0x67')])[_0x5b72('0x33')]();return db[_0x5b72('0x5f')][_0x5b72('0x57')](_0x15b4ce)[_0x5b72('0x58')](function(_0x2e1e52){_0x5ba1ca({'ret':0x1});})[_0x5b72('0x59')](function(_0x4591bc){logger[_0x5b72('0x52')](_0x4591bc[_0x5b72('0x53')]);_0x495112({'ret':0x1});});}});}function handleTZQuery(_0x41a255){logger[_0x5b72('0x50')](_0x41a255);return db['sequelize'][_0x5b72('0x57')](_0x41a255)[_0x5b72('0x58')](function(_0x857a8f){})['catch'](function(_0x2bc8fc){logger[_0x5b72('0x52')](_0x2bc8fc[_0x5b72('0x53')]);});}function main(_0x4c537b,_0x20b04b,_0xeb031f,_0x19b22c){logger[_0x5b72('0x50')]('main',_0x4c537b,JSON[_0x5b72('0x6b')](_0x20b04b));process['send'](_0x5b72('0x6c'));var _0x2fa51b=_0x20b04b[_0x5b72('0x6d')];var _0x2d519d=_[_0x5b72('0x6e')](_0x2fa51b);var _0x388c9d=_0x20b04b[_0x5b72('0x6f')];var _0x1ac8e1=path[_0x5b72('0x14')](config[_0x5b72('0x70')],_0x5b72('0x71'),_0x388c9d+_0x5b72('0x72'));hasTZ=_[_0x5b72('0x73')](_0x2fa51b)['includes']('dialTimezone');var _0x28166c=_[_0x5b72('0x73')](_0x2fa51b)['join']();logger[_0x5b72('0x50')](_0x5b72('0x74'),_0x28166c);db[_0x5b72('0x75')][_0x5b72('0x76')]({'raw':!![],'attributes':['id',_0x5b72('0x77')]})[_0x5b72('0x1a')](function(_0x3fb304){for(var _0x558ec9=0x0;_0x558ec9<_0x3fb304['length'];_0x558ec9++){if(_0x3fb304[_0x558ec9]['name']in _0x2fa51b){contactItemTypes['push'](_0x3fb304[_0x558ec9]);delete _0x2d519d[_0x3fb304[_0x558ec9]['name']];hasAdditionalPhones=!![];}for(var _0x2c048e in _0x2fa51b){if(_0x3fb304[_0x558ec9][_0x5b72('0x77')]+_0x5b72('0x78')===_0x2c048e){phoneDescriptions[_0x5b72('0x1c')]({'itemTypeId':_0x3fb304[_0x558ec9]['id'],'description':_0x2c048e});delete _0x2d519d[_0x2c048e];}}}if(hasAdditionalPhones)_0x2d519d[_0x5b72('0x19')]='';var _0x45a155=_[_0x5b72('0x73')](_0x2d519d)[_0x5b72('0x14')]();logger['info'](_0x5b72('0x74'),_0x45a155);fs[_0x5b72('0x79')](_0x1ac8e1,_0x45a155+'\x0a');Papa['parse'](fs['createReadStream'](_0x4c537b),{'header':!![],'skipEmptyLines':!![],'step':function(_0x5303fd,_0x525ef3){try{for(var _0x2ebb21=0x0,_0x4cda14=[];_0x2ebb21<_0x5303fd['data'][_0x5b72('0x1b')];_0x2ebb21++){stats[_0x5b72('0x7a')]+=0x1;if(_0x5303fd[_0x5b72('0x55')][_0x2ebb21]){handleError(_0x5303fd['data'][_0x2ebb21],_0x5303fd['errors'][_0x2ebb21]);}else{var _0x7b2b58=[];var _0x1fe792=[];var _0x460bbb={};for(var _0x5f13f2 in _0x2fa51b){let _0x5b6f06=contactItemTypes[_0x5b72('0x7b')](_0x3ec4f7=>_0x3ec4f7['name']===_0x5f13f2);let _0x345a81=contactItemTypes[_0x5b72('0x7b')](_0x5d4beb=>_0x5d4beb[_0x5b72('0x77')]+'_description'===_0x5f13f2);if(_['isNil'](_0x5b6f06)&&_[_0x5b72('0x1f')](_0x345a81)){if(_0x2fa51b[_0x5b72('0x7c')](_0x5f13f2)){if(_0x5303fd[_0x5b72('0x7d')][_0x2ebb21][_0x2fa51b[_0x5f13f2]]){var _0x553400=_['trim'](_0x5303fd[_0x5b72('0x7d')][_0x2ebb21][_0x2fa51b[_0x5f13f2]][_0x5b72('0x7e')](/"/g,'\x27'));switch(_0x5f13f2){case _0x5b72('0x2b'):var _0x27967c=moment(_0x553400,_0x5b72('0xe'),!![]);if(_0x27967c[_0x5b72('0x7f')]()){_0x4cda14[_0x5b72('0x1c')]('\x22'+_0x553400+'\x22');}else{_0x7b2b58[_0x5b72('0x1c')](_0x5b72('0x80'));}break;case _0x5b72('0x2f'):var _0x221f90=parseInt(_0x553400);_0x553400=_[_0x5b72('0x81')](_0x221f90)||_0x221f90<0x0||_0x221f90>0x4?_0x19b22c?0x3:0x2:_0x221f90;_0x4cda14[_0x5b72('0x1c')]('\x22'+_0x553400+'\x22');break;case _0x5b72('0x82'):var _0x11c81e=parseInt(_0x553400);if(_[_0x5b72('0x83')](_0x11c81e)&&_[_0x5b72('0x84')](_0xeb031f,_0x11c81e)){_0x4cda14[_0x5b72('0x1c')]('\x22'+_0x11c81e+'\x22');}else{_0x7b2b58[_0x5b72('0x1c')](_0x5b72('0x85'));}break;case _0x5b72('0x86'):if(isEmail(_0x553400)){_0x4cda14['push']('\x22'+_0x553400+'\x22');}else{_0x7b2b58[_0x5b72('0x1c')](_0x5b72('0x87'));}break;case _0x5b72('0x88'):var _0x261739=moment(_0x553400,'YYYY-MM-DD',!![]);if(_0x261739['isValid']()){_0x4cda14[_0x5b72('0x1c')]('\x22'+_0x553400+'\x22');}else{_0x7b2b58[_0x5b72('0x1c')](_0x5b72('0x89'));}break;case _0x5b72('0x67'):var _0x228e3=shared[_0x5b72('0x66')];var _0x14bbe0=_0x228e3[_0x553400];if(!_['isNil'](_0x14bbe0)){var _0x5db665=_0x14bbe0[_0x5b72('0x68')];_0x4cda14[_0x5b72('0x1c')]('\x22'+_0x553400+'\x22');_0x4cda14['push']('\x22'+_0x5db665+'\x22');}break;default:_0x4cda14[_0x5b72('0x1c')]('\x22'+_0x553400+'\x22');}}else{switch(_0x5f13f2){case'firstName':case _0x5b72('0x12'):_0x7b2b58[_0x5b72('0x1c')](_0x5f13f2+_0x5b72('0x8a'));break;default:_0x4cda14[_0x5b72('0x1c')]('\x22\x22');}}}}else{var _0x1f8c14='';if(!_[_0x5b72('0x1f')](_0x5b6f06)){if(!_0x460bbb[_0x5b72('0x7c')](_0x5b6f06['id'])){if(!_[_0x5b72('0x1f')](_0x5303fd[_0x5b72('0x7d')][_0x2ebb21][_0x2fa51b[_0x5f13f2]])){var _0x553400=_[_0x5b72('0x8b')](_0x5303fd[_0x5b72('0x7d')][_0x2ebb21][_0x2fa51b[_0x5f13f2]][_0x5b72('0x7e')](/"/g,'\x27'));var _0xf4543d=phoneDescriptions['find'](_0x433d9b=>_0x433d9b[_0x5b72('0x8c')]===_0x5b6f06['id']);if(!_['isNil'](_0xf4543d)){var _0xc7dd51=_[_0x5b72('0x8b')](_0x5303fd['data'][_0x2ebb21][_0x2fa51b[_0xf4543d[_0x5b72('0x8d')]]][_0x5b72('0x7e')](/"/g,'\x27'));if(!_[_0x5b72('0x1f')](_0xc7dd51))_0x553400=_0x553400+'§'+_0xc7dd51;}if(_0x1f8c14=='')_0x1f8c14=_0x553400;else _0x1f8c14+='|'+_0x553400;}_0x1fe792[_0x5b72('0x1c')](_0x5b6f06['id']+':'+_0x1f8c14);_0x460bbb[_0x5b6f06['id']]=0x1;}}}}if(hasAdditionalPhones){_0x4cda14[_0x5b72('0x1c')]('\x22'+_0x1fe792[_0x5b72('0x14')](';')+'\x22');}if(_0x7b2b58[_0x5b72('0x1b')]){handleError(_0x5303fd[_0x5b72('0x7d')][_0x2ebb21],{'code':_0x5b72('0x8e'),'message':_0x7b2b58[_0x5b72('0x14')]()});}else{fs[_0x5b72('0x8f')](_0x1ac8e1,_0x4cda14[_0x5b72('0x14')]()+'\x0a');}_0x4cda14=[];}if(!(stats['rows']%0xc8)){socket[_0x5b72('0x90')](_0x5b72('0x91')+_0x388c9d,stats);stats['errors']=[];}}if(stopped){logger[_0x5b72('0x50')](_0x5b72('0x92'));_0x525ef3[_0x5b72('0x93')]();}}catch(_0x298330){handleError(_0x5303fd[_0x5b72('0x7d')][_0x2ebb21],{'code':'SystemError','message':_0x298330['message']});logger[_0x5b72('0x52')](_0x5b72('0x94'),_0x298330['message']);}},'complete':function(){try{var _0xde903c=[];var _0x2bb839=[];var _0x7b42f5='cm_contacts';if(_0x20b04b[_0x5b72('0x95')]&&_0x20b04b[_0x5b72('0x95')][_0x5b72('0x1b')]){_0x7b42f5=_0x5b72('0x96')+_0x388c9d;_0xde903c[_0x5b72('0x1c')](_0x5b72('0x97')+_0x7b42f5+'\x20LIKE\x20cm_contacts;');}tmp_campaigns=_0x5b72('0x98')+_0x388c9d;tmp_voice_queues=_0x5b72('0x99')+_0x388c9d;_0x2bb839[_0x5b72('0x1c')](_0x5b72('0x97')+tmp_campaigns+_0x5b72('0x9a'));_0x2bb839['push'](_0x5b72('0x97')+tmp_voice_queues+_0x5b72('0x9a'));BPromise[_0x5b72('0x9b')](_0x2bb839,handleTZQuery)[_0x5b72('0x1a')](function(_0x32ebe8){updateTzCampaigns(_0x20b04b[_0x5b72('0x37')])['then'](function(_0x21ecfe){updateTzVoiceQueues(_0x20b04b[_0x5b72('0x37')])['then'](function(_0x37c482){if(hasTZ)_0x45a155=_0x45a155[_0x5b72('0x7e')](_0x5b72('0x67'),'dialTimezone,utcOffset');var _0x30ecf3=util[_0x5b72('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',_0x1ac8e1,_0x7b42f5,_0x45a155,_0x20b04b['ListId'],_0x20b04b['CompanyId']||null,NOW,NOW);if(_['isNil'](_0x2fa51b[_0x5b72('0x2b')])){_0x30ecf3+=_0x5b72('0x9c');}_0xde903c[_0x5b72('0x1c')](_0x30ecf3);if(_0x20b04b[_0x5b72('0x95')]&&_0x20b04b[_0x5b72('0x95')][_0x5b72('0x1b')]){_0xde903c[_0x5b72('0x1c')](insertCmContact(_0x20b04b[_0x5b72('0x37')],_0x7b42f5,_0x20b04b[_0x5b72('0x95')],_0x2fa51b));_0xde903c[_0x5b72('0x1c')](_0x5b72('0x9d')+_0x7b42f5+';');}BPromise[_0x5b72('0x9b')](_0xde903c,handleQuery)[_0x5b72('0x1a')](function(_0x5a5fe8){BPromise[_0x5b72('0x1d')]([handleAdditionalPhones()])[_0x5b72('0x1a')](function(){_0xde903c=[];for(var _0x2e6ecd=0x0;_0x2e6ecd\x20\x20');}var _0x3bb2bb=path[_0x5b72('0x14')](config[_0x5b72('0x70')],_0x5b72('0x71'),process['argv'][0x2]);if(!fs['existsSync'](_0x3bb2bb)){throw new Error(_0x5b72('0xa7'));}var _0x5a272d={};try{_0x5a272d=JSON[_0x5b72('0xa8')](process['argv'][0x3]);if(!_0x5a272d[_0x5b72('0x6d')]){throw new Error(_0x5b72('0xa9'));}if(!_0x5a272d[_0x5b72('0x6d')][_0x5b72('0x12')]){throw new Error(_0x5b72('0xaa'));}if(!_0x5a272d['binding'][_0x5b72('0xab')]){throw new Error(_0x5b72('0xac'));}var _0x251c52=0x0;if(_0x5a272d[_0x5b72('0x6d')][_0x5b72('0x82')]){_0x251c52=0x1;}if(!_0x5a272d[_0x5b72('0x37')]){throw new Error(_0x5b72('0xad'));}}catch(_0x363d57){throw new Error(_0x5b72('0xae'));}var _0x5ae612=[];try{_0x5ae612=_[_0x5b72('0xaf')](JSON[_0x5b72('0xa8')](process[_0x5b72('0xa6')][0x4]),'id');}catch(_0x2e4f96){logger[_0x5b72('0x50')](_0x5b72('0xb0'));}main(_0x3bb2bb,_0x5a272d,_0x5ae612,_0x251c52);}validate();process['on'](_0x5b72('0xb1'),handleStop);process['on'](_0x5b72('0xb2'),handleUncaughtException); \ No newline at end of file +var _0xba79=['description','SystemRow','appendFileSync','emit','contact:import:','duplicates','cm_contacts_','\x20LIKE\x20cm_contacts;','campaigns_','voice_queues_','CREATE\x20TABLE\x20','(id\x20int,dialTimezone\x20varchar(255),offset\x20int);','each','dialTimezone,utcOffset',',\x20scheduledAt\x20=\x20NOW()','DROP\x20TABLE\x20','orderBy','VoiceQueueId','voice_queues_has_cm_blacklists','campaigns_has_cm_lists','campaigns_has_cm_blacklists','CampaignId','finish','affectedRows','unlink','exit','complete','argv','arguments\x20\x20\x20','existsSync','file\x20doesn\x27t\x20exists','binding\x20doesn\x27t\x20exists','phone\x20is\x20mandatory','firstName\x20is\x20mandatory','ListId\x20is\x20mandatory','body\x20id\x20mandatory','map','No\x20agent\x20available','SIGINT','uncaughtException','papaparse','bluebird','squel','ioredis','../../../mysqldb','import','redis','localhost','format','YYYY-MM-DD\x20HH:mm:ss','select','field','from','join','.id\x20=\x20','where','\x20=\x20','.dialCheckDuplicateType\x20IN\x20(','CmContact','findAll','then','all','AdditionalPhones','split','length','push','isNil','filter','CmContactHasItem','updated','create','inserted','cm_contacts.phone','cm_contacts.scheduledat','cm_contacts.id','cm_contacts.updatedAt','cm_contacts.UserId','into','cm_hopper','fromQuery','ContactId','ListId','createdAt','UserId','recallme','fields','cm_contacts.ListId\x20=\x20','.CmListId\x20=\x20?','cm_contacts.createdAt\x20=\x20?','cm_contacts.phone\x20NOT\x20IN\x20(?)','\x22always\x22','toString','cm_contacts.createdAt','insert','.CmListId','cm_hopper_black','ListId\x20=\x20?','date_add(cm_contacts.scheduledat,interval\x20','.offset-cm_contacts.utcOffset\x20minute)','cm_contacts.ListId','cm_contacts.priority','phone','scheduledat','updatedAt','priority','\x22onlyIfOpen\x22','cm_contacts','cm_contact_has_items.updatedAt','cm_hopper_additional_phones','CmHopperId','OrderBy','cm_contacts.id\x20=\x20cm_hopper.ContactId','concat','keys','CompanyId','scheduledAt',')\x20NOT\x20IN\x20?','MIN(id)','min_id','info','Received\x20SIGINT','error','message','errors','code','sequelize','spread','campaigns.id','campaigns.dialTimezone','campaigns','campaigns.id\x20=\x20campaigns_has_cm_lists.CampaignId','campaigns_has_cm_lists.CmListId=','query','catch','voice_queues.id','voice_queues.dialTimezone','voice_queues','voice_queues_has_cm_lists','voice_queues.id\x20=\x20voice_queues_has_cm_lists.VoiceQueueId','timezones','dialTimezone','utcOffset','set','send','binding','clone','socket_timestamp','server/files/tmp','.csv','header','ContactItemType','name','_description','parse','createReadStream','data','rows','find','hasOwnProperty','trim','replace','isValid','scheduledat\x20wrong\x20format\x20(YYYY-MM-DD\x20HH:mm:ss)','isNaN','includes','agent\x20not\x20exists','email','email\x20wrong\x20format','YYYY-MM-DD','dateOfBirth\x20wrong\x20format\x20(YYYY-MM-DD)','firstName','\x20not\x20specified','itemTypeId'];(function(_0x4b12ae,_0xf2b3b){var _0x16957b=function(_0x51932c){while(--_0x51932c){_0x4b12ae['push'](_0x4b12ae['shift']());}};_0x16957b(++_0xf2b3b);}(_0xba79,0x182));var _0x9ba7=function(_0x17d45b,_0x41abad){_0x17d45b=_0x17d45b-0x0;var _0x2755ca=_0xba79[_0x17d45b];return _0x2755ca;};'use strict';var fs=require('fs');var path=require('path');var _=require('lodash');var Papa=require(_0x9ba7('0x0'));var util=require('util');var BPromise=require(_0x9ba7('0x1'));var moment=require('moment');var squel=require(_0x9ba7('0x2'));var Redis=require(_0x9ba7('0x3'));var db=require(_0x9ba7('0x4'))['db'];var config=require('../../../config/environment');var shared=require('../../../config/environment/shared');var logger=require('../../../config/logger')(_0x9ba7('0x5'));config[_0x9ba7('0x6')]=_['defaults'](config['redis'],{'host':_0x9ba7('0x7'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));var stats={'finish':![],'errors':[],'rows':0x0,'affectedRows':0x0};var results=[];var promisesAdditionalPhones=[];var orderBy=0x0;var stopped=![];var NOW=moment()[_0x9ba7('0x8')](_0x9ba7('0x9'));var contactItemTypes=[];var phoneDescriptions=[];var hasAdditionalPhones=![];var tmp_voice_queues;var tmp_campaigns;var tzOffset=0x0;var hasTZ;var NOW=moment()[_0x9ba7('0x8')](_0x9ba7('0x9'));function isEmail(_0x235904){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'](_0x235904);}function selectNotIn(_0x5a01d5,_0x5d859a,_0x9de9a3,_0x3260c2,_0x352624){return squel[_0x9ba7('0xa')]()[_0x9ba7('0xb')]('phone')[_0x9ba7('0xc')](_0x3260c2)[_0x9ba7('0xd')](_0x5d859a,null,_0x5d859a+_0x9ba7('0xe')+_0x3260c2+'.'+_0x9de9a3)[_0x9ba7('0xf')](_0x3260c2+'.'+_0x9de9a3+_0x9ba7('0x10')+_0x5a01d5+'.'+_0x9de9a3)[_0x9ba7('0xf')](_0x5d859a+_0x9ba7('0x11')+_0x352624[_0x9ba7('0xd')]()+')');}function handleAdditionalPhones(){return new Promise(function(_0x1767a3,_0x2dfc2f){promisesAdditionalPhones=[];return db[_0x9ba7('0x12')][_0x9ba7('0x13')]({'raw':!![],'attributes':['id','AdditionalPhones'],'where':{'createdAt':NOW,'AdditionalPhones':{'$ne':null}}})[_0x9ba7('0x14')](function(_0x179872){if(_0x179872!==null){var _0x5b7b78=[];for(var _0x4a2db4=0x0;_0x4a2db4<_0x179872['length'];_0x4a2db4++){var _0x4a221e=_0x179872[_0x4a2db4];_0x5b7b78['push'](insertAdditionalPhones(_0x4a221e));}}Promise[_0x9ba7('0x15')](_0x5b7b78)[_0x9ba7('0x14')](function(){_0x1767a3({'val':0x1});});});});}function insertAdditionalPhones(_0xa40ac){return new Promise(function(_0x22585a,_0x14e65e){var _0xc1e7c9=_0xa40ac[_0x9ba7('0x16')];var _0x4be76b=_0xc1e7c9[_0x9ba7('0x17')](';');var _0x3dded9=[];orderBy=0x0;for(var _0x28d558=0x0;_0x28d558<_0x4be76b[_0x9ba7('0x18')];_0x28d558++){_0x3dded9[_0x9ba7('0x19')](splitAdditionalPhone(_0xa40ac['id'],_0x4be76b[_0x28d558]));}Promise[_0x9ba7('0x15')](_0x3dded9)[_0x9ba7('0x14')](function(){_0x22585a({'val':_0x4be76b['length']});});});}function splitAdditionalPhone(_0x11f2de,_0x5a5bc1){return new Promise(function(_0x137440,_0x3cf5e4){var _0x230e0d=_0x5a5bc1[_0x9ba7('0x17')](':');var _0x3c5843=_0x230e0d[0x0];var _0x346897=_0x230e0d[0x1];if(!_[_0x9ba7('0x1a')](_0x346897)){var _0x6f51dc=_0x346897[_0x9ba7('0x17')]('|');var _0x22fc68=[];for(var _0xf6d45a=0x0;_0xf6d45a<_0x6f51dc[_0x9ba7('0x18')];_0xf6d45a++){if(_0x6f51dc[_0xf6d45a]!==''){var _0x1d77c8=_[_0x9ba7('0x1b')](promisesAdditionalPhones,{'contactId':_0x11f2de,'phone':_0x6f51dc[_0xf6d45a]});if(_0x1d77c8[_0x9ba7('0x18')]==0x0){orderBy++;promisesAdditionalPhones[_0x9ba7('0x19')]({'contactId':_0x11f2de,'contactTypeId':_0x3c5843,'phone':_0x6f51dc[_0xf6d45a],'orderBy':orderBy});}}}_0x137440({'ok':0x1});}else _0x137440({'res':0x0});});}function createAdditionalPhone(_0x373a61,_0x100261,_0x4f9f1b,_0xa99846){var _0x4bff5e='';var _0x53ce4b='';var _0x20b29c=_0x4f9f1b[_0x9ba7('0x17')]('§');_0x4bff5e=_0x20b29c[0x0];if(_0x20b29c['length']==0x2)_0x53ce4b=_0x20b29c[0x1];return new Promise(function(_0x4f2873,_0xd7eccb){return db['CmContactHasItem']['findOne']({'where':{'CmContactId':_0x373a61,'item':_0x4bff5e}})[_0x9ba7('0x14')](function(_0x15bcd2){if(_0x15bcd2){return db[_0x9ba7('0x1c')]['update']({'ItemTypeId':_0x100261,'description':_0x53ce4b,'OrderBy':_0xa99846},{'where':{'CmContactId':_0x373a61,'item':_0x4bff5e}})[_0x9ba7('0x14')](function(_0x4cca56){_0x4f2873({'res':_0x9ba7('0x1d')});});}else{return db[_0x9ba7('0x1c')][_0x9ba7('0x1e')]({'CmContactId':_0x373a61,'item':_0x4bff5e,'description':_0x53ce4b,'ItemTypeId':_0x100261,'OrderBy':_0xa99846,'ItemClass':'PHONE'})[_0x9ba7('0x14')](function(_0x49da66){_0x4f2873({'res':_0x9ba7('0x1f')});});}});});}function insertCmHopper(_0x11428e,_0x3e9437,_0x389bc8,_0x4b3c4e,_0xe539ed){var _0x49cbc6=[_0x9ba7('0x20'),_0x9ba7('0x21'),_0x9ba7('0x22'),'cm_contacts.ListId',_0x3e9437+'.'+_0x4b3c4e,'cm_contacts.createdAt',_0x9ba7('0x23'),'cm_contacts.priority',_0x9ba7('0x24'),'\x22'+_0xe539ed+'\x22'];return squel['insert']()[_0x9ba7('0x25')](_0x9ba7('0x26'))[_0x9ba7('0x27')](['phone','scheduledat',_0x9ba7('0x28'),_0x9ba7('0x29'),_0x4b3c4e,_0x9ba7('0x2a'),'updatedAt','priority',_0x9ba7('0x2b'),_0x9ba7('0x2c')],squel[_0x9ba7('0xa')]()[_0x9ba7('0x2d')](_0x49cbc6)[_0x9ba7('0xc')](_0x3e9437)[_0x9ba7('0xd')]('cm_contacts',null,_0x9ba7('0x2e')+_0x3e9437+'.CmListId')[_0x9ba7('0xd')](_0x389bc8,null,_0x389bc8+_0x9ba7('0xe')+_0x3e9437+'.'+_0x4b3c4e)['where'](_0x3e9437+_0x9ba7('0x2f'),_0x11428e)[_0x9ba7('0xf')](_0x9ba7('0x30'),NOW)[_0x9ba7('0xf')](_0x9ba7('0x31'),selectNotIn(_0x3e9437,_0x389bc8,_0x4b3c4e,'cm_hopper',[_0x9ba7('0x32'),'\x22onlyIfOpen\x22']))[_0x9ba7('0xf')](_0x9ba7('0x31'),selectNotIn(_0x3e9437,_0x389bc8,_0x4b3c4e,_0x9ba7('0x26'),[_0x9ba7('0x32')])))[_0x9ba7('0x33')]();}function insertCmHopperBlack(_0x442161,_0x1db3e9,_0x2483aa,_0x54448e){var _0x139ae9=[_0x9ba7('0x20'),'cm_contacts.id','cm_contacts.ListId',_0x1db3e9+'.'+_0x54448e,_0x9ba7('0x34'),'cm_contacts.updatedAt'];return squel[_0x9ba7('0x35')]()[_0x9ba7('0x25')]('cm_hopper_black')['fromQuery'](['phone',_0x9ba7('0x28'),_0x9ba7('0x29'),_0x54448e,_0x9ba7('0x2a'),'updatedAt'],squel['select']()[_0x9ba7('0x2d')](_0x139ae9)[_0x9ba7('0xc')](_0x1db3e9)[_0x9ba7('0xd')]('cm_contacts',null,'cm_contacts.ListId\x20=\x20'+_0x1db3e9+_0x9ba7('0x36'))[_0x9ba7('0xd')](_0x2483aa,null,_0x2483aa+_0x9ba7('0xe')+_0x1db3e9+'.'+_0x54448e)[_0x9ba7('0xf')](_0x1db3e9+_0x9ba7('0x2f'),_0x442161)[_0x9ba7('0xf')](_0x9ba7('0x30'),NOW)['where'](_0x9ba7('0x31'),squel[_0x9ba7('0xa')]()[_0x9ba7('0xb')]('phone')[_0x9ba7('0xc')](_0x9ba7('0x37'))[_0x9ba7('0xf')](_0x9ba7('0x38'),_0x442161)[_0x9ba7('0xf')](_0x54448e+'\x20=\x20'+_0x1db3e9+'.'+_0x54448e)))['toString']();}function insertTzCmHopper(_0x3061df,_0x34449f,_0x452d94,_0x2bc2de,_0x19c5bd,_0x38c1d4){var _0x1fbf5e=[_0x9ba7('0x20'),_0x9ba7('0x39')+_0x38c1d4+_0x9ba7('0x3a'),_0x9ba7('0x22'),_0x9ba7('0x3b'),_0x34449f+'.'+_0x2bc2de,_0x9ba7('0x34'),_0x9ba7('0x23'),_0x9ba7('0x3c'),_0x9ba7('0x24'),'\x22'+_0x19c5bd+'\x22'];var _0x682e8f=squel[_0x9ba7('0x35')]()['into'](_0x9ba7('0x26'))[_0x9ba7('0x27')]([_0x9ba7('0x3d'),_0x9ba7('0x3e'),_0x9ba7('0x28'),_0x9ba7('0x29'),_0x2bc2de,_0x9ba7('0x2a'),_0x9ba7('0x3f'),_0x9ba7('0x40'),_0x9ba7('0x2b'),_0x9ba7('0x2c')],squel[_0x9ba7('0xa')]()['fields'](_0x1fbf5e)['from'](_0x34449f)[_0x9ba7('0xd')]('cm_contacts',null,'cm_contacts.ListId\x20=\x20'+_0x34449f+_0x9ba7('0x36'))[_0x9ba7('0xd')](_0x452d94,null,_0x452d94+'.id\x20=\x20'+_0x34449f+'.'+_0x2bc2de)['join'](_0x38c1d4,null,_0x38c1d4+_0x9ba7('0xe')+_0x34449f+'.'+_0x2bc2de)[_0x9ba7('0xf')](_0x34449f+_0x9ba7('0x2f'),_0x3061df)[_0x9ba7('0xf')]('cm_contacts.createdAt\x20=\x20?',NOW)['where'](_0x9ba7('0x31'),selectNotIn(_0x34449f,_0x452d94,_0x2bc2de,_0x9ba7('0x26'),[_0x9ba7('0x32'),_0x9ba7('0x41')]))[_0x9ba7('0xf')](_0x9ba7('0x31'),selectNotIn(_0x34449f,_0x452d94,_0x2bc2de,'cm_hopper',['\x22always\x22'])))[_0x9ba7('0x33')]();return _0x682e8f;}function insertTzCmHopperBlack(_0x32f3e6,_0x4c2caf,_0x466b7a,_0x387bb6){var _0x52b999=[_0x9ba7('0x20'),_0x9ba7('0x22'),_0x9ba7('0x3b'),_0x4c2caf+'.'+_0x387bb6,_0x9ba7('0x34'),_0x9ba7('0x23')];return squel[_0x9ba7('0x35')]()[_0x9ba7('0x25')](_0x9ba7('0x37'))[_0x9ba7('0x27')]([_0x9ba7('0x3d'),'ContactId',_0x9ba7('0x29'),_0x387bb6,_0x9ba7('0x2a'),_0x9ba7('0x3f')],squel[_0x9ba7('0xa')]()[_0x9ba7('0x2d')](_0x52b999)['from'](_0x4c2caf)['join'](_0x9ba7('0x42'),null,'cm_contacts.ListId\x20=\x20'+_0x4c2caf+'.CmListId')[_0x9ba7('0xd')](_0x466b7a,null,_0x466b7a+_0x9ba7('0xe')+_0x4c2caf+'.'+_0x387bb6)[_0x9ba7('0xf')](_0x4c2caf+_0x9ba7('0x2f'),_0x32f3e6)[_0x9ba7('0xf')](_0x9ba7('0x30'),NOW)['where'](_0x9ba7('0x31'),squel['select']()[_0x9ba7('0xb')]('phone')[_0x9ba7('0xc')]('cm_hopper_black')[_0x9ba7('0xf')](_0x9ba7('0x38'),_0x32f3e6)[_0x9ba7('0xf')](_0x387bb6+_0x9ba7('0x10')+_0x4c2caf+'.'+_0x387bb6)))[_0x9ba7('0x33')]();}function insertCmHopperAdditionalPhones(_0xb8579c){var _0x32991c=['cm_hopper.id','cm_contact_has_items.item','cm_contact_has_items.OrderBy','cm_contact_has_items.createdAt',_0x9ba7('0x43')];return squel[_0x9ba7('0x35')]()[_0x9ba7('0x25')](_0x9ba7('0x44'))[_0x9ba7('0x27')]([_0x9ba7('0x45'),_0x9ba7('0x3d'),_0x9ba7('0x46'),_0x9ba7('0x2a'),_0x9ba7('0x3f')],squel[_0x9ba7('0xa')]()['fields'](_0x32991c)['from']('cm_hopper')[_0x9ba7('0xd')](_0x9ba7('0x42'),null,_0x9ba7('0x47'))['join']('cm_contact_has_items',null,'cm_contacts.id\x20=\x20cm_contact_has_items.CmContactId')[_0x9ba7('0xf')]('cm_hopper.ListId\x20=\x20?',_0xb8579c)['where'](_0x9ba7('0x30'),NOW))[_0x9ba7('0x33')]();}function insertCmContact(_0x1dd438,_0x15fd6c,_0x16117f,_0x2b88b6){var _0x3817ac=_[_0x9ba7('0x48')](_[_0x9ba7('0x49')](_0x2b88b6),[_0x9ba7('0x29'),_0x9ba7('0x4a'),'createdAt','updatedAt',_0x9ba7('0x4b')]);return squel['insert']()[_0x9ba7('0x25')](_0x9ba7('0x42'))[_0x9ba7('0x27')](_0x3817ac,squel[_0x9ba7('0xa')]()['fields'](_0x3817ac)[_0x9ba7('0xc')](_0x15fd6c)[_0x9ba7('0xf')]('('+_0x16117f['join'](',')+_0x9ba7('0x4c'),squel['select']()[_0x9ba7('0x2d')](_0x16117f)[_0x9ba7('0xc')](_0x9ba7('0x42'))[_0x9ba7('0xf')]('ListId\x20=\x20?',_0x1dd438)[_0x9ba7('0xf')]('deletedAt\x20IS\x20NULL'))[_0x9ba7('0xf')]('id\x20IN\x20?',squel[_0x9ba7('0xa')]()[_0x9ba7('0xb')](_0x9ba7('0x4d'),_0x9ba7('0x4e'))['from'](_0x15fd6c)['group'](_0x16117f['join'](','))))[_0x9ba7('0x33')]();}function handleStop(){logger[_0x9ba7('0x4f')](_0x9ba7('0x50'));stopped=!![];}function handleUncaughtException(_0x9b5bdb){logger[_0x9ba7('0x51')](_0x9b5bdb[_0x9ba7('0x52')]);process['exit'](0x1);}function handleError(_0x5c6e6d,_0x52072e){stats[_0x9ba7('0x53')]['push']({'name':_0x52072e[_0x9ba7('0x54')],'message':_0x52072e['message'],'row':_0x5c6e6d});}function handleQuery(_0x51eb2f){logger[_0x9ba7('0x4f')](_0x51eb2f);return db[_0x9ba7('0x55')]['query'](_0x51eb2f)[_0x9ba7('0x56')](function(_0x26ba41){results['push'](_0x26ba41);})['catch'](function(_0x219bb4){logger[_0x9ba7('0x51')](_0x219bb4[_0x9ba7('0x52')]);});}function updateTzCampaigns(_0x5da242){return new Promise(function(_0x55ecda,_0x18c757){var _0x1b1eae=squel['select']()['fields']([_0x9ba7('0x57'),_0x9ba7('0x58')])[_0x9ba7('0xc')](_0x9ba7('0x59'))[_0x9ba7('0xd')]('campaigns_has_cm_lists',null,_0x9ba7('0x5a'))[_0x9ba7('0xf')](_0x9ba7('0x5b')+_0x5da242);db['sequelize'][_0x9ba7('0x5c')](_0x1b1eae[_0x9ba7('0x33')]())[_0x9ba7('0x56')](function(_0x5e3dcb){var _0x4efbc2=[];for(var _0x316686=0x0;_0x316686<_0x5e3dcb['length'];_0x316686++){_0x4efbc2[_0x9ba7('0x19')](getTimezoneData(_0x5e3dcb[_0x316686],tmp_campaigns));}BPromise[_0x9ba7('0x15')](_0x4efbc2)[_0x9ba7('0x14')](function(){_0x55ecda({'val':0x1});});})[_0x9ba7('0x5d')](function(_0x150a14){logger[_0x9ba7('0x51')](_0x150a14[_0x9ba7('0x52')]);_0x55ecda({'val':0x0});});});}function updateTzVoiceQueues(_0x3fb508){return new Promise(function(_0x44f8c4,_0x1848df){var _0x1a0400=squel[_0x9ba7('0xa')]()[_0x9ba7('0x2d')]([_0x9ba7('0x5e'),_0x9ba7('0x5f')])[_0x9ba7('0xc')](_0x9ba7('0x60'))[_0x9ba7('0xd')](_0x9ba7('0x61'),null,_0x9ba7('0x62'))[_0x9ba7('0xf')]('voice_queues_has_cm_lists.CmListId='+_0x3fb508);db['sequelize'][_0x9ba7('0x5c')](_0x1a0400['toString']())[_0x9ba7('0x56')](function(_0x422829){var _0x191fb8=[];for(var _0x259a71=0x0;_0x259a71<_0x422829['length'];_0x259a71++){_0x191fb8['push'](getTimezoneData(_0x422829[_0x259a71],tmp_voice_queues));}BPromise[_0x9ba7('0x15')](_0x191fb8)[_0x9ba7('0x14')](function(){_0x44f8c4({'val':0x1});});})['catch'](function(_0x116b83){logger[_0x9ba7('0x51')](_0x116b83[_0x9ba7('0x52')]);_0x44f8c4({'val':0x0});});});}function getTimezoneData(_0x8da638,_0x1e73b5){return new Promise(function(_0x59ae88,_0x42bb67){var _0x393700=shared[_0x9ba7('0x63')];var _0x28303b=_0x393700[_0x8da638[_0x9ba7('0x64')]];if(_['isNil'](_0x28303b)){_0x59ae88({'ret':0x1});}else{var _0x2aec4f=_0x28303b[_0x9ba7('0x65')];var _0x37540c=squel['insert']()['into'](_0x1e73b5)[_0x9ba7('0x66')]('id',_0x8da638['id'])[_0x9ba7('0x66')]('offset',_0x2aec4f)['set']('dialTimezone',_0x8da638['dialTimezone'])[_0x9ba7('0x33')]();return db[_0x9ba7('0x55')][_0x9ba7('0x5c')](_0x37540c)[_0x9ba7('0x56')](function(_0x7fa832){_0x59ae88({'ret':0x1});})[_0x9ba7('0x5d')](function(_0x311594){logger['error'](_0x311594[_0x9ba7('0x52')]);_0x42bb67({'ret':0x1});});}});}function handleTZQuery(_0x3a4d42){logger[_0x9ba7('0x4f')](_0x3a4d42);return db[_0x9ba7('0x55')][_0x9ba7('0x5c')](_0x3a4d42)[_0x9ba7('0x56')](function(_0x1711b6){})[_0x9ba7('0x5d')](function(_0x31fff0){logger[_0x9ba7('0x51')](_0x31fff0[_0x9ba7('0x52')]);});}function main(_0x3abbca,_0x13a5f9,_0xa3b9ab,_0x3b14d1){logger[_0x9ba7('0x4f')]('main',_0x3abbca,JSON['stringify'](_0x13a5f9));process[_0x9ba7('0x67')]('start');var _0x4d7b71=_0x13a5f9[_0x9ba7('0x68')];var _0x13266b=_[_0x9ba7('0x69')](_0x4d7b71);var _0x46ae96=_0x13a5f9[_0x9ba7('0x6a')];var _0x1444b7=path[_0x9ba7('0xd')](config['root'],_0x9ba7('0x6b'),_0x46ae96+_0x9ba7('0x6c'));hasTZ=_[_0x9ba7('0x49')](_0x4d7b71)['includes'](_0x9ba7('0x64'));var _0x336da3=_[_0x9ba7('0x49')](_0x4d7b71)[_0x9ba7('0xd')]();logger[_0x9ba7('0x4f')](_0x9ba7('0x6d'),_0x336da3);db[_0x9ba7('0x6e')][_0x9ba7('0x13')]({'raw':!![],'attributes':['id','name']})[_0x9ba7('0x14')](function(_0x3629ee){for(var _0x32c7ab=0x0;_0x32c7ab<_0x3629ee['length'];_0x32c7ab++){if(_0x3629ee[_0x32c7ab]['name']in _0x4d7b71){contactItemTypes['push'](_0x3629ee[_0x32c7ab]);delete _0x13266b[_0x3629ee[_0x32c7ab][_0x9ba7('0x6f')]];hasAdditionalPhones=!![];}for(var _0x46aa39 in _0x4d7b71){if(_0x3629ee[_0x32c7ab]['name']+_0x9ba7('0x70')===_0x46aa39){phoneDescriptions['push']({'itemTypeId':_0x3629ee[_0x32c7ab]['id'],'description':_0x46aa39});delete _0x13266b[_0x46aa39];}}}if(hasAdditionalPhones)_0x13266b[_0x9ba7('0x16')]='';var _0x20c21d=_[_0x9ba7('0x49')](_0x13266b)[_0x9ba7('0xd')]();logger[_0x9ba7('0x4f')]('header',_0x20c21d);fs['writeFileSync'](_0x1444b7,_0x20c21d+'\x0a');Papa[_0x9ba7('0x71')](fs[_0x9ba7('0x72')](_0x3abbca),{'header':!![],'skipEmptyLines':!![],'step':function(_0x3f4970,_0x58e1f2){try{for(var _0xe42147=0x0,_0x47d39e=[];_0xe42147<_0x3f4970[_0x9ba7('0x73')][_0x9ba7('0x18')];_0xe42147++){stats[_0x9ba7('0x74')]+=0x1;if(_0x3f4970['errors'][_0xe42147]){handleError(_0x3f4970['data'][_0xe42147],_0x3f4970[_0x9ba7('0x53')][_0xe42147]);}else{var _0x526859=[];var _0x5edaa0=[];var _0x74e37a={};for(var _0x2b096f in _0x4d7b71){let _0x5db731=contactItemTypes[_0x9ba7('0x75')](_0x3db599=>_0x3db599['name']===_0x2b096f);let _0x5074f5=contactItemTypes[_0x9ba7('0x75')](_0x181a8c=>_0x181a8c[_0x9ba7('0x6f')]+_0x9ba7('0x70')===_0x2b096f);if(_[_0x9ba7('0x1a')](_0x5db731)&&_[_0x9ba7('0x1a')](_0x5074f5)){if(_0x4d7b71[_0x9ba7('0x76')](_0x2b096f)){if(_0x3f4970[_0x9ba7('0x73')][_0xe42147][_0x4d7b71[_0x2b096f]]){var _0x2877d9=_[_0x9ba7('0x77')](_0x3f4970[_0x9ba7('0x73')][_0xe42147][_0x4d7b71[_0x2b096f]][_0x9ba7('0x78')](/"/g,'\x27'));switch(_0x2b096f){case'scheduledat':var _0x2777ac=moment(_0x2877d9,'YYYY-MM-DD\x20HH:mm:ss',!![]);if(_0x2777ac[_0x9ba7('0x79')]()){_0x47d39e[_0x9ba7('0x19')]('\x22'+_0x2877d9+'\x22');}else{_0x526859[_0x9ba7('0x19')](_0x9ba7('0x7a'));}break;case _0x9ba7('0x40'):var _0x1892ba=parseInt(_0x2877d9);_0x2877d9=_[_0x9ba7('0x7b')](_0x1892ba)||_0x1892ba<0x0||_0x1892ba>0x4?_0x3b14d1?0x3:0x2:_0x1892ba;_0x47d39e['push']('\x22'+_0x2877d9+'\x22');break;case _0x9ba7('0x2b'):var _0x15c0a1=parseInt(_0x2877d9);if(_['isNumber'](_0x15c0a1)&&_[_0x9ba7('0x7c')](_0xa3b9ab,_0x15c0a1)){_0x47d39e[_0x9ba7('0x19')]('\x22'+_0x15c0a1+'\x22');}else{_0x526859[_0x9ba7('0x19')](_0x9ba7('0x7d'));}break;case _0x9ba7('0x7e'):if(isEmail(_0x2877d9)){_0x47d39e[_0x9ba7('0x19')]('\x22'+_0x2877d9+'\x22');}else{_0x526859[_0x9ba7('0x19')](_0x9ba7('0x7f'));}break;case'dateOfBirth':var _0x5895ba=moment(_0x2877d9,_0x9ba7('0x80'),!![]);if(_0x5895ba[_0x9ba7('0x79')]()){_0x47d39e[_0x9ba7('0x19')]('\x22'+_0x2877d9+'\x22');}else{_0x526859[_0x9ba7('0x19')](_0x9ba7('0x81'));}break;case _0x9ba7('0x64'):var _0x346e73=shared[_0x9ba7('0x63')];var _0x3eaa82=_0x346e73[_0x2877d9];if(!_[_0x9ba7('0x1a')](_0x3eaa82)){var _0x2a2dee=_0x3eaa82[_0x9ba7('0x65')];_0x47d39e[_0x9ba7('0x19')]('\x22'+_0x2877d9+'\x22');_0x47d39e[_0x9ba7('0x19')]('\x22'+_0x2a2dee+'\x22');}break;default:_0x47d39e[_0x9ba7('0x19')]('\x22'+_0x2877d9+'\x22');}}else{switch(_0x2b096f){case _0x9ba7('0x82'):case _0x9ba7('0x3d'):_0x526859[_0x9ba7('0x19')](_0x2b096f+_0x9ba7('0x83'));break;default:_0x47d39e[_0x9ba7('0x19')]('\x22\x22');}}}}else{var _0x18a08d='';if(!_[_0x9ba7('0x1a')](_0x5db731)){if(!_0x74e37a[_0x9ba7('0x76')](_0x5db731['id'])){if(!_[_0x9ba7('0x1a')](_0x3f4970[_0x9ba7('0x73')][_0xe42147][_0x4d7b71[_0x2b096f]])){var _0x2877d9=_['trim'](_0x3f4970['data'][_0xe42147][_0x4d7b71[_0x2b096f]]['replace'](/"/g,'\x27'));var _0x1aad09=phoneDescriptions[_0x9ba7('0x75')](_0xbbceb0=>_0xbbceb0[_0x9ba7('0x84')]===_0x5db731['id']);if(!_[_0x9ba7('0x1a')](_0x1aad09)){var _0x2f24d9=_['trim'](_0x3f4970['data'][_0xe42147][_0x4d7b71[_0x1aad09[_0x9ba7('0x85')]]][_0x9ba7('0x78')](/"/g,'\x27'));if(!_[_0x9ba7('0x1a')](_0x2f24d9))_0x2877d9=_0x2877d9+'§'+_0x2f24d9;}if(_0x18a08d=='')_0x18a08d=_0x2877d9;else _0x18a08d+='|'+_0x2877d9;}_0x5edaa0[_0x9ba7('0x19')](_0x5db731['id']+':'+_0x18a08d);_0x74e37a[_0x5db731['id']]=0x1;}}}}if(hasAdditionalPhones){_0x47d39e[_0x9ba7('0x19')]('\x22'+_0x5edaa0[_0x9ba7('0xd')](';')+'\x22');}if(_0x526859['length']){handleError(_0x3f4970['data'][_0xe42147],{'code':_0x9ba7('0x86'),'message':_0x526859['join']()});}else{fs[_0x9ba7('0x87')](_0x1444b7,_0x47d39e[_0x9ba7('0xd')]()+'\x0a');}_0x47d39e=[];}if(!(stats[_0x9ba7('0x74')]%0xc8)){socket[_0x9ba7('0x88')](_0x9ba7('0x89')+_0x46ae96,stats);stats[_0x9ba7('0x53')]=[];}}if(stopped){logger[_0x9ba7('0x4f')]('Abort\x20parser');_0x58e1f2['abort']();}}catch(_0x2b50c5){handleError(_0x3f4970['data'][_0xe42147],{'code':'SystemError','message':_0x2b50c5[_0x9ba7('0x52')]});logger[_0x9ba7('0x51')]('step',_0x2b50c5[_0x9ba7('0x52')]);}},'complete':function(){try{var _0x3ecec5=[];var _0xd4beaa=[];var _0x46bd29=_0x9ba7('0x42');if(_0x13a5f9[_0x9ba7('0x8a')]&&_0x13a5f9[_0x9ba7('0x8a')][_0x9ba7('0x18')]){_0x46bd29=_0x9ba7('0x8b')+_0x46ae96;_0x3ecec5['push']('CREATE\x20TABLE\x20'+_0x46bd29+_0x9ba7('0x8c'));}tmp_campaigns=_0x9ba7('0x8d')+_0x46ae96;tmp_voice_queues=_0x9ba7('0x8e')+_0x46ae96;_0xd4beaa[_0x9ba7('0x19')](_0x9ba7('0x8f')+tmp_campaigns+_0x9ba7('0x90'));_0xd4beaa['push'](_0x9ba7('0x8f')+tmp_voice_queues+_0x9ba7('0x90'));BPromise[_0x9ba7('0x91')](_0xd4beaa,handleTZQuery)[_0x9ba7('0x14')](function(_0x3e07f5){updateTzCampaigns(_0x13a5f9[_0x9ba7('0x29')])['then'](function(_0xcc10c4){updateTzVoiceQueues(_0x13a5f9[_0x9ba7('0x29')])[_0x9ba7('0x14')](function(_0x1c6d84){if(hasTZ)_0x20c21d=_0x20c21d[_0x9ba7('0x78')](_0x9ba7('0x64'),_0x9ba7('0x92'));var _0x34e8c4=util['format']('LOAD\x20DATA\x20LOCAL\x20INFILE\x20\x27%s\x27\x20INTO\x20TABLE\x20%s\x20CHARACTER\x20SET\x20UTF8\x20FIELDS\x20TERMINATED\x20BY\x20\x27,\x27\x20ENCLOSED\x20BY\x20\x27\x22\x27\x20LINES\x20TERMINATED\x20BY\x20\x27\x0a\x27\x20IGNORE\x201\x20ROWS\x20(%s)\x20SET\x20id\x20=\x20NULL,\x20ListId\x20=\x20%s,\x20CompanyId\x20=\x20%s,\x20createdAt\x20=\x20\x27%s\x27,\x20updatedAt\x20=\x20\x27%s\x27',_0x1444b7,_0x46bd29,_0x20c21d,_0x13a5f9[_0x9ba7('0x29')],_0x13a5f9['CompanyId']||null,NOW,NOW);if(_[_0x9ba7('0x1a')](_0x4d7b71[_0x9ba7('0x3e')])){_0x34e8c4+=_0x9ba7('0x93');}_0x3ecec5[_0x9ba7('0x19')](_0x34e8c4);if(_0x13a5f9[_0x9ba7('0x8a')]&&_0x13a5f9['duplicates']['length']){_0x3ecec5[_0x9ba7('0x19')](insertCmContact(_0x13a5f9[_0x9ba7('0x29')],_0x46bd29,_0x13a5f9[_0x9ba7('0x8a')],_0x4d7b71));_0x3ecec5[_0x9ba7('0x19')](_0x9ba7('0x94')+_0x46bd29+';');}BPromise[_0x9ba7('0x91')](_0x3ecec5,handleQuery)[_0x9ba7('0x14')](function(_0x2b370b){BPromise[_0x9ba7('0x15')]([handleAdditionalPhones()])[_0x9ba7('0x14')](function(){_0x3ecec5=[];for(var _0x33ead7=0x0;_0x33ead7\x20\x20','file\x20doesn\x27t\x20exists','binding\x20doesn\x27t\x20exists','ListId\x20is\x20mandatory','body\x20id\x20mandatory','map','parse','SIGINT','uncaughtException','lodash','papaparse','bluebird','squel','../../../config/logger','import','redis','localhost','socket.io-emitter','cm_contacts_temp_','format','YYYYMMDDHHmmss','test','select','field','.id\x20=\x20','where','\x20=\x20','.dialCheckDuplicateType\x20IN\x20(','join','sequelize','select\x20*\x20from\x20','spread','isNil','phone','AdditionalPhones','all','then','error','message','split','length','push','filter','CmContactHasItem','findOne','update','updated','create','PHONE','CmContact','CmHopper','cm_contacts.phone','cm_contacts.scheduledat','cm_contacts.ListId','cm_contacts.updatedAt','cm_contacts.UserId','insert','into','cm_hopper','fromQuery','scheduledat','ContactId','ListId','createdAt','updatedAt','UserId','recallme','fields','from','cm_contacts.ListId\x20=\x20','.CmListId','.CmListId\x20=\x20?','cm_contacts.createdAt\x20=\x20?','cm_contacts.phone\x20NOT\x20IN\x20(?)','\x22always\x22','toString','cm_contacts.id','cm_contacts.createdAt','cm_hopper_black','cm_contacts','\x20=\x20?','cm_hopper.id','cm_contact_has_items.item','cm_contact_has_items.OrderBy','cm_contact_has_items.createdAt','cm_contact_has_items.updatedAt','cm_hopper_additional_phones','OrderBy','cm_hopper.ListId\x20=\x20?','concat','keys','CompanyId',')\x20NOT\x20IN\x20?','ListId\x20=\x20?','id\x20IN\x20?','MIN(id)','group','exit','errors','code','info','catch','main','start','binding','clone','root','server/files/tmp','.csv','body','ContactItemType','findAll','name','header','writeFileSync','createReadStream','data','rows','find','_description','hasOwnProperty','replace','YYYY-MM-DD\x20HH:mm:ss','isValid','scheduledat\x20wrong\x20format\x20(YYYY-MM-DD\x20HH:mm:ss)','priority','isNaN','isNumber','includes','agent\x20not\x20exists','dateOfBirth','YYYY-MM-DD','dateOfBirth\x20wrong\x20format\x20(YYYY-MM-DD)','firstName','trim','description','appendFileSync','contact:import:','abort','step','CREATE\x20TABLE\x20','\x20LIKE\x20cm_contacts;','CIS\x20len','LOAD\x20DATA\x20LOCAL\x20INFILE\x20\x27%s\x27\x20INTO\x20TABLE\x20%s\x20CHARACTER\x20SET\x20UTF8\x20FIELDS\x20TERMINATED\x20BY\x20\x27,\x27\x20ENCLOSED\x20BY\x20\x27\x22\x27\x20LINES\x20TERMINATED\x20BY\x20\x27\x0a\x27\x20IGNORE\x201\x20ROWS\x20(%s)\x20SET\x20ListId\x20=\x20%s,\x20CompanyId\x20=\x20%s,\x20createdAt\x20=\x20\x27%s\x27,\x20updatedAt\x20=\x20\x27%s\x27','each','contact','contactId','contactTypeId'];(function(_0x3873ca,_0x1ecda9){var _0x4ce3e5=function(_0x2a3d23){while(--_0x2a3d23){_0x3873ca['push'](_0x3873ca['shift']());}};_0x4ce3e5(++_0x1ecda9);}(_0x19cb,0x146));var _0xb19c=function(_0x142a84,_0x373faf){_0x142a84=_0x142a84-0x0;var _0x21cbf3=_0x19cb[_0x142a84];return _0x21cbf3;};'use strict';var fs=require('fs');var path=require('path');var _=require(_0xb19c('0x0'));var Papa=require(_0xb19c('0x1'));var util=require('util');var BPromise=require(_0xb19c('0x2'));var moment=require('moment');var squel=require(_0xb19c('0x3'));var Redis=require('ioredis');var db=require('../../../mysqldb')['db'];var config=require('../../../config/environment');var logger=require(_0xb19c('0x4'))(_0xb19c('0x5'));config['redis']=_['defaults'](config[_0xb19c('0x6')],{'host':_0xb19c('0x7'),'port':0x18eb});var socket=require(_0xb19c('0x8'))(new Redis(config[_0xb19c('0x6')]));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']('YYYY-MM-DD\x20HH:mm:ss');var tempTableName=_0xb19c('0x9')+moment()[_0xb19c('0xa')](_0xb19c('0xb'));var contactItemTypes=[];var phoneDescriptions=[];var hasAdditionalPhones=![];function isEmail(_0x12d1ce){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))*$/[_0xb19c('0xc')](_0x12d1ce);}function selectNotIn(_0x4de417,_0x14d90d,_0xcc851f,_0x13e3c2,_0x3b7448){return squel[_0xb19c('0xd')]()[_0xb19c('0xe')]('phone')['from'](_0x13e3c2)['join'](_0x14d90d,null,_0x14d90d+_0xb19c('0xf')+_0x13e3c2+'.'+_0xcc851f)[_0xb19c('0x10')](_0x13e3c2+'.'+_0xcc851f+_0xb19c('0x11')+_0x4de417+'.'+_0xcc851f)['where'](_0x14d90d+_0xb19c('0x12')+_0x3b7448[_0xb19c('0x13')]()+')');}function handleAdditionalPhones(){return new Promise(function(_0x3be3f4,_0x547c77){promisesAdditionalPhones=[];promisesContact=[];return db[_0xb19c('0x14')]['query'](_0xb19c('0x15')+tempTableName)[_0xb19c('0x16')](function(_0x2d239c){if(_0x2d239c!==null){var _0x1eec19=[];for(var _0x11eea0=0x0;_0x11eea0<_0x2d239c['length'];_0x11eea0++){var _0x4364de=_0x2d239c[_0x11eea0];if(!_[_0xb19c('0x17')](_0x4364de[_0xb19c('0x18')])){if(!_[_0xb19c('0x17')](_0x4364de[_0xb19c('0x19')]))_0x1eec19['push'](insertAdditionalPhones(_0x4364de));promisesContact['push']({'contact':_0x4364de});}}}Promise[_0xb19c('0x1a')](_0x1eec19)[_0xb19c('0x1b')](function(){_0x3be3f4({'val':0x1});});})['catch'](function(_0x55cf87){logger[_0xb19c('0x1c')](_0x55cf87[_0xb19c('0x1d')]);});});}function insertAdditionalPhones(_0xe42795){return new Promise(function(_0x413646,_0x4ec4ae){var _0x3b4537=_0xe42795[_0xb19c('0x19')];if(_[_0xb19c('0x17')](_0x3b4537))_0x4ec4ae({'val':0x0});else{var _0x595773=_0x3b4537[_0xb19c('0x1e')](';');var _0x383878=[];orderBy=0x0;for(var _0x186f47=0x0;_0x186f47<_0x595773[_0xb19c('0x1f')];_0x186f47++){_0x383878[_0xb19c('0x20')](splitAdditionalPhone(_0xe42795['id'],_0x595773[_0x186f47]));}Promise['all'](_0x383878)['then'](function(){_0x413646({'val':_0x595773[_0xb19c('0x1f')]});});}});}function splitAdditionalPhone(_0x5c56cc,_0x7b3f7a){return new Promise(function(_0x562386,_0xdc2623){var _0x1fdc4e=_0x7b3f7a[_0xb19c('0x1e')](':');var _0x3542f7=_0x1fdc4e[0x0];var _0x41bde5=_0x1fdc4e[0x1];if(_0x41bde5!==''){var _0x1774fc=_0x41bde5[_0xb19c('0x1e')]('|');var _0xe06131=[];for(var _0x4bbb72=0x0;_0x4bbb72<_0x1774fc[_0xb19c('0x1f')];_0x4bbb72++){if(_0x1774fc[_0x4bbb72]!==''){var _0x259569=_[_0xb19c('0x21')](promisesAdditionalPhones,{'contactId':_0x5c56cc,'phone':_0x1774fc[_0x4bbb72]});if(_0x259569[_0xb19c('0x1f')]==0x0){orderBy++;promisesAdditionalPhones['push']({'contactId':_0x5c56cc,'contactTypeId':_0x3542f7,'phone':_0x1774fc[_0x4bbb72],'orderBy':orderBy});}}}_0x562386({'ok':0x1});}else _0x562386({'res':0x0});});}function createAdditionalPhone(_0x5d9bcd,_0x5f13fb,_0xaca236,_0x1dd187){var _0x2e3af4='';var _0x168045='';var _0x3ca5c4=_0xaca236['split']('§');_0x2e3af4=_0x3ca5c4[0x0];if(_0x3ca5c4[_0xb19c('0x1f')]==0x2)_0x168045=_0x3ca5c4[0x1];return new Promise(function(_0x1517bf,_0x12fc7c){return db[_0xb19c('0x22')][_0xb19c('0x23')]({'where':{'CmContactId':_0x5d9bcd,'item':_0x2e3af4}})[_0xb19c('0x1b')](function(_0x7b42f5){if(_0x7b42f5){return db['CmContactHasItem'][_0xb19c('0x24')]({'ItemTypeId':_0x5f13fb,'description':_0x168045,'OrderBy':_0x1dd187},{'where':{'CmContactId':_0x5d9bcd,'item':_0x2e3af4}})[_0xb19c('0x1b')](function(_0x4df9f4){_0x1517bf({'res':_0xb19c('0x25')});});}else{return db[_0xb19c('0x22')][_0xb19c('0x26')]({'CmContactId':_0x5d9bcd,'item':_0x2e3af4,'ItemTypeId':_0x5f13fb,'description':_0x168045,'OrderBy':_0x1dd187,'ItemClass':_0xb19c('0x27')})[_0xb19c('0x1b')](function(_0x5abece){_0x1517bf({'res':'inserted'});});}});});}function updateContact(_0x209dfc){return new Promise(function(_0x31028b,_0x1b22e2){var _0x53f9a1=_0x209dfc['id'];delete _0x209dfc['id'];return db[_0xb19c('0x28')][_0xb19c('0x24')](_0x209dfc,{'where':{'id':_0x53f9a1}})[_0xb19c('0x1b')](function(_0x21d0d6){updatedRows+=0x1;return db[_0xb19c('0x29')][_0xb19c('0x24')]({'phone':_0x209dfc[_0xb19c('0x18')]},{'where':{'ContactId':_0x53f9a1}})[_0xb19c('0x1b')](function(_0xa02709){_0x31028b({'ret':'OK'});});});});}function insertCmHopper(_0x52c79b,_0x36fd64,_0x2d8eff,_0x5a1fb7,_0x546e2e){var _0x17147b=[_0xb19c('0x2a'),_0xb19c('0x2b'),'cm_contacts.id',_0xb19c('0x2c'),_0x36fd64+'.'+_0x5a1fb7,'cm_contacts.createdAt',_0xb19c('0x2d'),'cm_contacts.priority',_0xb19c('0x2e'),'\x22'+_0x546e2e+'\x22'];return squel[_0xb19c('0x2f')]()[_0xb19c('0x30')](_0xb19c('0x31'))[_0xb19c('0x32')]([_0xb19c('0x18'),_0xb19c('0x33'),_0xb19c('0x34'),_0xb19c('0x35'),_0x5a1fb7,_0xb19c('0x36'),_0xb19c('0x37'),'priority',_0xb19c('0x38'),_0xb19c('0x39')],squel[_0xb19c('0xd')]()[_0xb19c('0x3a')](_0x17147b)[_0xb19c('0x3b')](_0x36fd64)[_0xb19c('0x13')]('cm_contacts',null,_0xb19c('0x3c')+_0x36fd64+_0xb19c('0x3d'))['join'](_0x2d8eff,null,_0x2d8eff+_0xb19c('0xf')+_0x36fd64+'.'+_0x5a1fb7)['where'](_0x36fd64+_0xb19c('0x3e'),_0x52c79b)[_0xb19c('0x10')](_0xb19c('0x3f'),NOW)[_0xb19c('0x10')](_0xb19c('0x40'),selectNotIn(_0x36fd64,_0x2d8eff,_0x5a1fb7,_0xb19c('0x31'),[_0xb19c('0x41'),'\x22onlyIfOpen\x22']))[_0xb19c('0x10')](_0xb19c('0x40'),selectNotIn(_0x36fd64,_0x2d8eff,_0x5a1fb7,'cm_hopper',[_0xb19c('0x41')])))[_0xb19c('0x42')]();}function insertCmHopperBlack(_0x25acab,_0x3b5161,_0x56f3a6,_0x48b108){var _0x49df44=[_0xb19c('0x2a'),_0xb19c('0x43'),_0xb19c('0x2c'),_0x3b5161+'.'+_0x48b108,_0xb19c('0x44'),_0xb19c('0x2d')];return squel[_0xb19c('0x2f')]()[_0xb19c('0x30')](_0xb19c('0x45'))[_0xb19c('0x32')](['phone',_0xb19c('0x34'),_0xb19c('0x35'),_0x48b108,_0xb19c('0x36'),_0xb19c('0x37')],squel[_0xb19c('0xd')]()[_0xb19c('0x3a')](_0x49df44)[_0xb19c('0x3b')](_0x3b5161)[_0xb19c('0x13')](_0xb19c('0x46'),null,_0xb19c('0x3c')+_0x3b5161+_0xb19c('0x3d'))['join'](_0x56f3a6,null,_0x56f3a6+_0xb19c('0xf')+_0x3b5161+'.'+_0x48b108)[_0xb19c('0x10')](_0x3b5161+_0xb19c('0x3e'),_0x25acab)[_0xb19c('0x10')]('cm_contacts.createdAt\x20=\x20?',NOW)['where'](_0xb19c('0x40'),squel[_0xb19c('0xd')]()[_0xb19c('0xe')](_0xb19c('0x18'))['from'](_0xb19c('0x45'))[_0xb19c('0x10')]('ListId\x20=\x20?',_0x25acab)['where'](_0x48b108+_0xb19c('0x47'),_0x3b5161+'.'+_0x48b108)))[_0xb19c('0x42')]();}function insertCmHopperAdditionalPhones(_0x272d6a){var _0x7a2887=[_0xb19c('0x48'),_0xb19c('0x49'),_0xb19c('0x4a'),_0xb19c('0x4b'),_0xb19c('0x4c')];return squel['insert']()['into'](_0xb19c('0x4d'))[_0xb19c('0x32')](['CmHopperId',_0xb19c('0x18'),_0xb19c('0x4e'),_0xb19c('0x36'),_0xb19c('0x37')],squel[_0xb19c('0xd')]()[_0xb19c('0x3a')](_0x7a2887)[_0xb19c('0x3b')]('cm_hopper')[_0xb19c('0x13')](_0xb19c('0x46'),null,'cm_contacts.id\x20=\x20cm_hopper.ContactId')[_0xb19c('0x13')]('cm_contact_has_items',null,'cm_contacts.id\x20=\x20cm_contact_has_items.CmContactId')['where'](_0xb19c('0x4f'),_0x272d6a)[_0xb19c('0x10')](_0xb19c('0x3f'),NOW))[_0xb19c('0x42')]();}function insertCmContact(_0xcb0169,_0x5f1588,_0x207741,_0x11ef00){var _0x33a7df=_[_0xb19c('0x50')](_[_0xb19c('0x51')](_0x11ef00),['ListId',_0xb19c('0x52'),'createdAt',_0xb19c('0x37')]);return squel['insert']()['into']('cm_contacts')[_0xb19c('0x32')](_0x33a7df,squel['select']()[_0xb19c('0x3a')](_0x33a7df)[_0xb19c('0x3b')](_0x5f1588)[_0xb19c('0x10')]('('+_0x207741[_0xb19c('0x13')](',')+_0xb19c('0x53'),squel['select']()[_0xb19c('0x3a')](_0x207741)[_0xb19c('0x3b')]('cm_contacts')[_0xb19c('0x10')](_0xb19c('0x54'),_0xcb0169))[_0xb19c('0x10')](_0xb19c('0x55'),squel[_0xb19c('0xd')]()[_0xb19c('0xe')](_0xb19c('0x56'),'min_id')[_0xb19c('0x3b')](_0x5f1588)[_0xb19c('0x57')](_0x207741[_0xb19c('0x13')](','))))['toString']();}function handleStop(){logger['info']('Received\x20SIGINT');stopped=!![];}function handleUncaughtException(_0x4c8e9c){logger[_0xb19c('0x1c')](_0x4c8e9c[_0xb19c('0x1d')]);process[_0xb19c('0x58')](0x1);}function handleError(_0x3e9851,_0x43fb4f){stats[_0xb19c('0x59')][_0xb19c('0x20')]({'name':_0x43fb4f[_0xb19c('0x5a')],'message':_0x43fb4f[_0xb19c('0x1d')],'row':_0x3e9851});}function handleQuery(_0x4e0078){logger[_0xb19c('0x5b')](_0x4e0078);return db['sequelize']['query'](_0x4e0078)['spread'](function(_0x405b13){results[_0xb19c('0x20')](_0x405b13);})[_0xb19c('0x5c')](function(_0x3cf5b1){logger[_0xb19c('0x1c')](_0x3cf5b1[_0xb19c('0x1d')]);});}function main(_0x289bc9,_0x398695,_0x3db9f0,_0x375750){logger[_0xb19c('0x5b')](_0xb19c('0x5d'),_0x289bc9,JSON['stringify'](_0x398695));process['send'](_0xb19c('0x5e'));var _0x1f0397=_0x398695[_0xb19c('0x5f')];var _0x26dc2a=_[_0xb19c('0x60')](_0x1f0397);var _0x275ce3=_0x398695['socket_timestamp'];var _0x21acd1=path[_0xb19c('0x13')](config[_0xb19c('0x61')],_0xb19c('0x62'),_0x275ce3+_0xb19c('0x63'));logger[_0xb19c('0x5b')](_0xb19c('0x64'),_0x398695);db[_0xb19c('0x65')][_0xb19c('0x66')]({'raw':!![],'attributes':['id',_0xb19c('0x67')]})['then'](function(_0x11679d){for(var _0x49c872=0x0;_0x49c872<_0x11679d[_0xb19c('0x1f')];_0x49c872++){if(_0x11679d[_0x49c872][_0xb19c('0x67')]in _0x1f0397){contactItemTypes[_0xb19c('0x20')](_0x11679d[_0x49c872]);delete _0x26dc2a[_0x11679d[_0x49c872][_0xb19c('0x67')]];hasAdditionalPhones=!![];}for(var _0x14cf90 in _0x1f0397){if(_0x11679d[_0x49c872][_0xb19c('0x67')]+'_description'===_0x14cf90){phoneDescriptions['push']({'itemTypeId':_0x11679d[_0x49c872]['id'],'description':_0x14cf90});delete _0x26dc2a[_0x14cf90];}}}if(hasAdditionalPhones)_0x26dc2a[_0xb19c('0x19')]='';var _0x46fbd8=_[_0xb19c('0x51')](_0x26dc2a)[_0xb19c('0x13')]();logger[_0xb19c('0x5b')](_0xb19c('0x68'),_0x46fbd8);fs[_0xb19c('0x69')](_0x21acd1,_0x46fbd8+'\x0a');Papa['parse'](fs[_0xb19c('0x6a')](_0x289bc9),{'header':!![],'skipEmptyLines':!![],'step':function(_0x5c4e77,_0x57e3e3){try{for(var _0x97c099=0x0,_0x25c53c=[];_0x97c099<_0x5c4e77[_0xb19c('0x6b')][_0xb19c('0x1f')];_0x97c099++){stats[_0xb19c('0x6c')]+=0x1;if(_0x5c4e77[_0xb19c('0x59')][_0x97c099]){handleError(_0x5c4e77[_0xb19c('0x6b')][_0x97c099],_0x5c4e77[_0xb19c('0x59')][_0x97c099]);}else{var _0x56f4ae=[];var _0x36c7a8=[];var _0xc7fa01={};for(var _0x52c132 in _0x1f0397){let _0x467188=contactItemTypes[_0xb19c('0x6d')](_0x4a1f75=>_0x4a1f75[_0xb19c('0x67')]===_0x52c132);let _0x375f96=contactItemTypes[_0xb19c('0x6d')](_0x918aee=>_0x918aee['name']+_0xb19c('0x6e')===_0x52c132);if(_[_0xb19c('0x17')](_0x467188)&&_['isNil'](_0x375f96)){if(_0x1f0397[_0xb19c('0x6f')](_0x52c132)){if(_0x5c4e77[_0xb19c('0x6b')][_0x97c099][_0x1f0397[_0x52c132]]){var _0xfada18=_['trim'](_0x5c4e77[_0xb19c('0x6b')][_0x97c099][_0x1f0397[_0x52c132]][_0xb19c('0x70')](/"/g,'\x27'));switch(_0x52c132){case _0xb19c('0x33'):var _0x488d63=moment(_0xfada18,_0xb19c('0x71'),!![]);if(_0x488d63[_0xb19c('0x72')]()){_0x25c53c[_0xb19c('0x20')]('\x22'+_0xfada18+'\x22');}else{_0x56f4ae[_0xb19c('0x20')](_0xb19c('0x73'));}break;case _0xb19c('0x74'):var _0x39187f=parseInt(_0xfada18);_0xfada18=_[_0xb19c('0x75')](_0x39187f)||_0x39187f<0x0||_0x39187f>0x4?_0x375750?0x3:0x2:_0x39187f;_0x25c53c[_0xb19c('0x20')]('\x22'+_0xfada18+'\x22');break;case _0xb19c('0x38'):var _0x164034=parseInt(_0xfada18);if(_[_0xb19c('0x76')](_0x164034)&&_[_0xb19c('0x77')](_0x3db9f0,_0x164034)){_0x25c53c[_0xb19c('0x20')]('\x22'+_0x164034+'\x22');}else{_0x56f4ae['push'](_0xb19c('0x78'));}break;case'email':if(isEmail(_0xfada18)){_0x25c53c[_0xb19c('0x20')]('\x22'+_0xfada18+'\x22');}else{_0x56f4ae[_0xb19c('0x20')]('email\x20wrong\x20format');}break;case _0xb19c('0x79'):var _0x237ed1=moment(_0xfada18,_0xb19c('0x7a'),!![]);if(_0x237ed1[_0xb19c('0x72')]()){_0x25c53c['push']('\x22'+_0xfada18+'\x22');}else{_0x56f4ae[_0xb19c('0x20')](_0xb19c('0x7b'));}break;default:_0x25c53c[_0xb19c('0x20')]('\x22'+_0xfada18+'\x22');}}else{switch(_0x52c132){case _0xb19c('0x7c'):case _0xb19c('0x18'):_0x56f4ae[_0xb19c('0x20')](_0x52c132+'\x20not\x20specified');break;default:_0x25c53c[_0xb19c('0x20')]('\x22\x22');}}}}else{var _0x26957f='';if(!_[_0xb19c('0x17')](_0x467188)){if(!_0xc7fa01[_0xb19c('0x6f')](_0x467188['id'])){for(var _0x5607c6=0x0;_0x5607c6<_0x1f0397[_0x52c132][_0xb19c('0x1f')];_0x5607c6++){var _0xfada18=_[_0xb19c('0x7d')](_0x5c4e77[_0xb19c('0x6b')][_0x97c099][_0x1f0397[_0x52c132][_0x5607c6]][_0xb19c('0x70')](/"/g,'\x27'));var _0x379319=phoneDescriptions[_0xb19c('0x6d')](_0x27bb8e=>_0x27bb8e['itemTypeId']===_0x467188['id']);if(!_[_0xb19c('0x17')](_0x379319)){var _0x134b6b=_['trim'](_0x5c4e77[_0xb19c('0x6b')][_0x97c099][_0x1f0397[_0x379319[_0xb19c('0x7e')]][0x0]][_0xb19c('0x70')](/"/g,'\x27'));if(!_[_0xb19c('0x17')](_0x134b6b))_0xfada18=_0xfada18+'§'+_0x134b6b;}if(_0x26957f=='')_0x26957f=_0xfada18;else _0x26957f+='|'+_0xfada18;}_0x36c7a8[_0xb19c('0x20')](_0x467188['id']+':'+_0x26957f);_0xc7fa01[_0x467188['id']]=0x1;}}}}if(hasAdditionalPhones){_0x25c53c[_0xb19c('0x20')]('\x22'+_0x36c7a8[_0xb19c('0x13')](';')+'\x22');}if(_0x56f4ae[_0xb19c('0x1f')]){handleError(_0x5c4e77[_0xb19c('0x6b')][_0x97c099],{'code':'SystemRow','message':_0x56f4ae['join']()});}else{fs[_0xb19c('0x7f')](_0x21acd1,_0x25c53c[_0xb19c('0x13')]()+'\x0a');}_0x25c53c=[];}if(!(stats[_0xb19c('0x6c')]%0xc8)){socket['emit'](_0xb19c('0x80')+_0x275ce3,stats);stats[_0xb19c('0x59')]=[];}}if(stopped){logger[_0xb19c('0x5b')]('Abort\x20parser');_0x57e3e3[_0xb19c('0x81')]();}}catch(_0x2ab734){handleError(_0x5c4e77[_0xb19c('0x6b')][_0x97c099],{'code':'SystemError','message':_0x2ab734[_0xb19c('0x1d')]});logger['error'](_0xb19c('0x82'),_0x2ab734[_0xb19c('0x1d')]);}},'complete':function(){try{var _0x216bd9=[];var _0x5bbe05=tempTableName;_0x216bd9[_0xb19c('0x20')](_0xb19c('0x83')+_0x5bbe05+_0xb19c('0x84'));logger[_0xb19c('0x5b')](_0xb19c('0x85'),contactItemTypes[_0xb19c('0x1f')]);var _0x234449=util[_0xb19c('0xa')](_0xb19c('0x86'),_0x21acd1,_0x5bbe05,_0x46fbd8,_0x398695[_0xb19c('0x35')],_0x398695[_0xb19c('0x52')]||null,NOW,NOW);if(_[_0xb19c('0x17')](_0x1f0397[_0xb19c('0x33')])){_0x234449+=',\x20scheduledAt\x20=\x20NOW()';}_0x216bd9[_0xb19c('0x20')](_0x234449);BPromise[_0xb19c('0x87')](_0x216bd9,handleQuery)[_0xb19c('0x1b')](function(_0xea6a8f){BPromise['all']([handleAdditionalPhones()])[_0xb19c('0x1b')](function(){_0x216bd9=[];for(var _0x5b2df6=0x0;_0x5b2df6_0x1d0e29[_0x9896('0x68')]===_0x24f891);let _0x38c331=contactItemTypes['find'](_0x351561=>_0x351561[_0x9896('0x68')]+'_description'===_0x24f891);if(_['isNil'](_0x53ef6e)&&_['isNil'](_0x38c331)){if(_0x5b1fb3[_0x9896('0x6f')](_0x24f891)){if(_0x32d1c1[_0x9896('0x6e')][_0x59fd1d][_0x5b1fb3[_0x24f891]]){var _0x4ce4ad=_[_0x9896('0x70')](_0x32d1c1[_0x9896('0x6e')][_0x59fd1d][_0x5b1fb3[_0x24f891]][_0x9896('0x71')](/"/g,'\x27'));switch(_0x24f891){case _0x9896('0x72'):var _0x24ef6d=moment(_0x4ce4ad,_0x9896('0xd'),!![]);if(_0x24ef6d[_0x9896('0x73')]()){_0x3e8adc['push']('\x22'+_0x4ce4ad+'\x22');}else{_0x4b89b6[_0x9896('0x1c')](_0x9896('0x74'));}break;case _0x9896('0x37'):var _0x1ec533=parseInt(_0x4ce4ad);_0x4ce4ad=_[_0x9896('0x75')](_0x1ec533)||_0x1ec533<0x0||_0x1ec533>0x4?_0x11dcb5?0x3:0x2:_0x1ec533;_0x3e8adc[_0x9896('0x1c')]('\x22'+_0x4ce4ad+'\x22');break;case'UserId':var _0x72a512=parseInt(_0x4ce4ad);if(_[_0x9896('0x76')](_0x72a512)&&_['includes'](_0x19fd16,_0x72a512)){_0x3e8adc['push']('\x22'+_0x72a512+'\x22');}else{_0x4b89b6['push'](_0x9896('0x77'));}break;case _0x9896('0x78'):if(isEmail(_0x4ce4ad)){_0x3e8adc['push']('\x22'+_0x4ce4ad+'\x22');}else{_0x4b89b6[_0x9896('0x1c')](_0x9896('0x79'));}break;case _0x9896('0x7a'):var _0x25a455=moment(_0x4ce4ad,_0x9896('0x7b'),!![]);if(_0x25a455[_0x9896('0x73')]()){_0x3e8adc[_0x9896('0x1c')]('\x22'+_0x4ce4ad+'\x22');}else{_0x4b89b6[_0x9896('0x1c')](_0x9896('0x7c'));}break;default:_0x3e8adc['push']('\x22'+_0x4ce4ad+'\x22');}}else{switch(_0x24f891){case'firstName':case _0x9896('0x1a'):_0x4b89b6['push'](_0x24f891+'\x20not\x20specified');break;default:_0x3e8adc[_0x9896('0x1c')]('\x22\x22');}}}}else{var _0x27c380='';if(!_[_0x9896('0x19')](_0x53ef6e)){if(!_0x35b6b0[_0x9896('0x6f')](_0x53ef6e['id'])){for(var _0x38a569=0x0;_0x38a569<_0x5b1fb3[_0x24f891]['length'];_0x38a569++){var _0x4ce4ad=_[_0x9896('0x70')](_0x32d1c1[_0x9896('0x6e')][_0x59fd1d][_0x5b1fb3[_0x24f891][_0x38a569]][_0x9896('0x71')](/"/g,'\x27'));var _0xef1815=phoneDescriptions[_0x9896('0x7d')](_0x31c8e0=>_0x31c8e0[_0x9896('0x7e')]===_0x53ef6e['id']);if(!_[_0x9896('0x19')](_0xef1815)){var _0x320ca8=_[_0x9896('0x70')](_0x32d1c1[_0x9896('0x6e')][_0x59fd1d][_0x5b1fb3[_0xef1815[_0x9896('0x7f')]][0x0]][_0x9896('0x71')](/"/g,'\x27'));if(!_[_0x9896('0x19')](_0x320ca8))_0x4ce4ad=_0x4ce4ad+'§'+_0x320ca8;}if(_0x27c380=='')_0x27c380=_0x4ce4ad;else _0x27c380+='|'+_0x4ce4ad;}_0xc35e4f[_0x9896('0x1c')](_0x53ef6e['id']+':'+_0x27c380);_0x35b6b0[_0x53ef6e['id']]=0x1;}}}}if(hasAdditionalPhones){_0x3e8adc['push']('\x22'+_0xc35e4f[_0x9896('0x11')](';')+'\x22');}if(_0x4b89b6['length']){handleError(_0x32d1c1['data'][_0x59fd1d],{'code':_0x9896('0x80'),'message':_0x4b89b6[_0x9896('0x11')]()});}else{fs[_0x9896('0x81')](_0xb02941,_0x3e8adc['join']()+'\x0a');}_0x3e8adc=[];}if(!(stats[_0x9896('0x82')]%0xc8)){socket['emit'](_0x9896('0x83')+_0x1785c1,stats);stats[_0x9896('0x59')]=[];}}if(stopped){logger[_0x9896('0x5b')]('Abort\x20parser');_0x2c19f8[_0x9896('0x84')]();}}catch(_0x53b2f1){handleError(_0x32d1c1[_0x9896('0x6e')][_0x59fd1d],{'code':_0x9896('0x85'),'message':_0x53b2f1[_0x9896('0x20')]});logger[_0x9896('0x1f')](_0x9896('0x86'),_0x53b2f1[_0x9896('0x20')]);}},'complete':function(){try{var _0x5bd7a1=[];var _0x545895=tempTableName;_0x5bd7a1[_0x9896('0x1c')](_0x9896('0x87')+_0x545895+_0x9896('0x88'));logger['info']('CIS\x20len',contactItemTypes[_0x9896('0x18')]);var _0x2cd9b7=util[_0x9896('0xc')](_0x9896('0x89'),_0xb02941,_0x545895,_0x298344,_0x5d1c3c[_0x9896('0x45')],_0x5d1c3c[_0x9896('0x54')]||null,NOW,NOW);if(_['isNil'](_0x5b1fb3['scheduledat'])){_0x2cd9b7+=_0x9896('0x8a');}_0x5bd7a1[_0x9896('0x1c')](_0x2cd9b7);BPromise[_0x9896('0x8b')](_0x5bd7a1,handleQuery)[_0x9896('0x1d')](function(_0x1737ba){BPromise[_0x9896('0x22')]([handleAdditionalPhones()])[_0x9896('0x1d')](function(){_0x5bd7a1=[];for(var _0x5d2e33=0x0;_0x5d2e33\x20\x20');}var _0x1a4dff=path[_0x9896('0x11')](config[_0x9896('0x63')],_0x9896('0x64'),process['argv'][0x2]);if(!fs[_0x9896('0x95')](_0x1a4dff)){throw new Error(_0x9896('0x96'));}var _0x4e431d={};try{_0x4e431d=JSON[_0x9896('0x6d')](process[_0x9896('0x94')][0x3]);if(!_0x4e431d[_0x9896('0x60')]){throw new Error('binding\x20doesn\x27t\x20exists');}var _0x241d82=0x0;if(_0x4e431d[_0x9896('0x60')][_0x9896('0x38')]){_0x241d82=0x1;}if(!_0x4e431d[_0x9896('0x45')]){throw new Error(_0x9896('0x97'));}}catch(_0x4f1e59){throw new Error('body\x20id\x20mandatory');}var _0x30d5b0=[];try{_0x30d5b0=_['map'](JSON['parse'](process['argv'][0x4]),'id');}catch(_0x4db47a){logger[_0x9896('0x5b')]('No\x20agent\x20available');}main(_0x1a4dff,_0x4e431d,_0x30d5b0,_0x241d82);}validate();process['on'](_0x9896('0x98'),handleStop);process['on'](_0x9896('0x99'),handleUncaughtException); \ No newline at end of file diff --git a/server/components/integrations/configuration.js b/server/components/integrations/configuration.js index 9d5c1a1..ed75edf 100644 --- a/server/components/integrations/configuration.js +++ b/server/components/integrations/configuration.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x53e0=['inbound','push','variable','queue','outbound','Outbound\x20Call','destcalleridnum','getDescriptions','toLowerCase','keyValue','Caller\x20Number','Caller\x20Name','calleridname','Call\x20To','destexten','Queue','UniqueId','uniqueid','Date','agentcalledAt','***\x20Agent\x20Info\x20***','Agent\x20Number','***\x20Time\x20Info\x20***','Agent\x20Ring','Agent\x20Connect','agentconnectAt','Agent\x20Complete','agentcompleteAt','Hold\x20Time','holdtime','Talk\x20Time','talktime','Called\x20Number','starttime','Answer\x20Time','answertime','Complete\x20Time','endtime','Duration','duration','Billable\x20Time','getSubjects','string','voice'];(function(_0x4079ce,_0x107123){var _0xe8c0cf=function(_0x53ebae){while(--_0x53ebae){_0x4079ce['push'](_0x4079ce['shift']());}};_0xe8c0cf(++_0x107123);}(_0x53e0,0x189));var _0x053e=function(_0x41e723,_0x5e6494){_0x41e723=_0x41e723-0x0;var _0x5cf973=_0x53e0[_0x41e723];return _0x5cf973;};'use strict';exports[_0x053e('0x0')]=function(_0xa7c614,_0x3d2f48){var _0x16bc65=[{'type':_0x053e('0x1'),'content':'[xCALLY\x20Ticket]','variableName':null}];switch(_0xa7c614['toLowerCase']()){case _0x053e('0x2'):switch(_0x3d2f48['toLowerCase']()){case _0x053e('0x3'):_0x16bc65[_0x053e('0x4')]({'type':_0x053e('0x5'),'content':'','variableName':_0x053e('0x6')});_0x16bc65['push']({'type':_0x053e('0x5'),'content':'','variableName':'calleridnum'});break;case _0x053e('0x7'):_0x16bc65[_0x053e('0x4')]({'type':_0x053e('0x1'),'content':_0x053e('0x8'),'variableName':null});_0x16bc65[_0x053e('0x4')]({'type':_0x053e('0x5'),'content':'','variableName':_0x053e('0x9')});break;}}return _0x16bc65;};exports[_0x053e('0xa')]=function(_0x5e0494,_0x4564ce){var _0x30f28b=[];switch(_0x5e0494['toLowerCase']()){case'voice':switch(_0x4564ce[_0x053e('0xb')]()){case _0x053e('0x3'):_0x30f28b=[{'type':_0x053e('0x1'),'content':'***\x20Call\x20Info\x20***','key':null,'keyType':null,'variableName':null},{'type':_0x053e('0xc'),'content':'','key':_0x053e('0xd'),'keyType':_0x053e('0x5'),'variableName':'calleridnum'},{'type':_0x053e('0xc'),'content':'','key':_0x053e('0xe'),'keyType':_0x053e('0x5'),'variableName':_0x053e('0xf')},{'type':_0x053e('0xc'),'content':'','key':_0x053e('0x10'),'keyType':_0x053e('0x5'),'variableName':_0x053e('0x11')},{'type':_0x053e('0xc'),'content':'','key':_0x053e('0x12'),'keyType':_0x053e('0x5'),'variableName':_0x053e('0x6')},{'type':_0x053e('0xc'),'content':'','key':_0x053e('0x13'),'keyType':_0x053e('0x5'),'variableName':_0x053e('0x14')},{'type':_0x053e('0xc'),'content':'','key':_0x053e('0x15'),'keyType':_0x053e('0x5'),'variableName':_0x053e('0x16')},{'type':_0x053e('0x1'),'content':_0x053e('0x17'),'key':null,'keyType':null,'variableName':null},{'type':_0x053e('0xc'),'content':'','key':'Agent\x20Name','keyType':_0x053e('0x5'),'variableName':'destcalleridname'},{'type':_0x053e('0xc'),'content':'','key':_0x053e('0x18'),'keyType':_0x053e('0x5'),'variableName':_0x053e('0x9')},{'type':_0x053e('0x1'),'content':_0x053e('0x19'),'key':null,'keyType':null,'variableName':null},{'type':_0x053e('0xc'),'content':'','key':_0x053e('0x1a'),'keyType':'variable','variableName':_0x053e('0x16')},{'type':_0x053e('0xc'),'content':'','key':_0x053e('0x1b'),'keyType':'variable','variableName':_0x053e('0x1c')},{'type':_0x053e('0xc'),'content':'','key':_0x053e('0x1d'),'keyType':_0x053e('0x5'),'variableName':_0x053e('0x1e')},{'type':'keyValue','content':'','key':_0x053e('0x1f'),'keyType':'variable','variableName':_0x053e('0x20')},{'type':_0x053e('0xc'),'content':'','key':_0x053e('0x21'),'keyType':_0x053e('0x5'),'variableName':_0x053e('0x22')}];break;case'outbound':_0x30f28b=[{'type':_0x053e('0x1'),'content':'***\x20Call\x20Info\x20***','variableName':null},{'type':_0x053e('0xc'),'content':'','key':_0x053e('0x23'),'keyType':_0x053e('0x5'),'keyContent':'','variableName':_0x053e('0x9')},{'type':'keyValue','content':'','key':'Member\x20Name','keyType':_0x053e('0x5'),'keyContent':'','variableName':'membername'},{'type':_0x053e('0xc'),'content':'','key':'UniqueId','keyType':'variable','keyContent':'','variableName':_0x053e('0x14')},{'type':_0x053e('0xc'),'content':'','key':_0x053e('0x15'),'keyType':_0x053e('0x5'),'keyContent':'','variableName':_0x053e('0x24')},{'type':'string','content':_0x053e('0x19')},{'type':_0x053e('0xc'),'content':'','key':_0x053e('0x25'),'keyType':_0x053e('0x5'),'keyContent':'','variableName':_0x053e('0x26')},{'type':'keyValue','content':'','key':_0x053e('0x27'),'keyType':_0x053e('0x5'),'keyContent':'','variableName':_0x053e('0x28')},{'type':'keyValue','content':'','key':_0x053e('0x29'),'keyType':_0x053e('0x5'),'keyContent':'','variableName':_0x053e('0x2a')},{'type':_0x053e('0xc'),'content':'','key':_0x053e('0x2b'),'keyType':'variable','keyContent':'','variableName':'billableseconds'}];break;}}return _0x30f28b;}; \ No newline at end of file +var _0xcab6=['string','Outbound\x20Call','getDescriptions','voice','***\x20Call\x20Info\x20***','keyValue','Caller\x20Name','calleridname','Call\x20To','destexten','queue','uniqueid','agentcalledAt','***\x20Agent\x20Info\x20***','Agent\x20Name','destcalleridname','Agent\x20Number','***\x20Time\x20Info\x20***','Agent\x20Ring','agentconnectAt','Agent\x20Complete','agentcompleteAt','Hold\x20Time','holdtime','Talk\x20Time','talktime','Called\x20Number','destcalleridnum','UniqueId','Date','starttime','Answer\x20Time','answertime','Complete\x20Time','endtime','Duration','duration','billableseconds','getSubjects','[xCALLY\x20Ticket]','toLowerCase','inbound','push','variable','calleridnum','outbound'];(function(_0x715d76,_0x402d60){var _0x48fe88=function(_0x4dd0ea){while(--_0x4dd0ea){_0x715d76['push'](_0x715d76['shift']());}};_0x48fe88(++_0x402d60);}(_0xcab6,0x10c));var _0x6cab=function(_0x45ee08,_0x1fd538){_0x45ee08=_0x45ee08-0x0;var _0x1e17e7=_0xcab6[_0x45ee08];return _0x1e17e7;};'use strict';exports[_0x6cab('0x0')]=function(_0x593802,_0x395050){var _0x2c3458=[{'type':'string','content':_0x6cab('0x1'),'variableName':null}];switch(_0x593802[_0x6cab('0x2')]()){case'voice':switch(_0x395050['toLowerCase']()){case _0x6cab('0x3'):_0x2c3458[_0x6cab('0x4')]({'type':_0x6cab('0x5'),'content':'','variableName':'queue'});_0x2c3458[_0x6cab('0x4')]({'type':_0x6cab('0x5'),'content':'','variableName':_0x6cab('0x6')});break;case _0x6cab('0x7'):_0x2c3458[_0x6cab('0x4')]({'type':_0x6cab('0x8'),'content':_0x6cab('0x9'),'variableName':null});_0x2c3458[_0x6cab('0x4')]({'type':_0x6cab('0x5'),'content':'','variableName':'destcalleridnum'});break;}}return _0x2c3458;};exports[_0x6cab('0xa')]=function(_0x125183,_0x47751e){var _0x38232f=[];switch(_0x125183[_0x6cab('0x2')]()){case _0x6cab('0xb'):switch(_0x47751e[_0x6cab('0x2')]()){case'inbound':_0x38232f=[{'type':_0x6cab('0x8'),'content':_0x6cab('0xc'),'key':null,'keyType':null,'variableName':null},{'type':_0x6cab('0xd'),'content':'','key':'Caller\x20Number','keyType':_0x6cab('0x5'),'variableName':_0x6cab('0x6')},{'type':_0x6cab('0xd'),'content':'','key':_0x6cab('0xe'),'keyType':_0x6cab('0x5'),'variableName':_0x6cab('0xf')},{'type':_0x6cab('0xd'),'content':'','key':_0x6cab('0x10'),'keyType':'variable','variableName':_0x6cab('0x11')},{'type':_0x6cab('0xd'),'content':'','key':'Queue','keyType':_0x6cab('0x5'),'variableName':_0x6cab('0x12')},{'type':'keyValue','content':'','key':'UniqueId','keyType':_0x6cab('0x5'),'variableName':_0x6cab('0x13')},{'type':'keyValue','content':'','key':'Date','keyType':'variable','variableName':_0x6cab('0x14')},{'type':_0x6cab('0x8'),'content':_0x6cab('0x15'),'key':null,'keyType':null,'variableName':null},{'type':_0x6cab('0xd'),'content':'','key':_0x6cab('0x16'),'keyType':_0x6cab('0x5'),'variableName':_0x6cab('0x17')},{'type':_0x6cab('0xd'),'content':'','key':_0x6cab('0x18'),'keyType':_0x6cab('0x5'),'variableName':'destcalleridnum'},{'type':_0x6cab('0x8'),'content':_0x6cab('0x19'),'key':null,'keyType':null,'variableName':null},{'type':_0x6cab('0xd'),'content':'','key':_0x6cab('0x1a'),'keyType':_0x6cab('0x5'),'variableName':_0x6cab('0x14')},{'type':'keyValue','content':'','key':'Agent\x20Connect','keyType':_0x6cab('0x5'),'variableName':_0x6cab('0x1b')},{'type':_0x6cab('0xd'),'content':'','key':_0x6cab('0x1c'),'keyType':_0x6cab('0x5'),'variableName':_0x6cab('0x1d')},{'type':_0x6cab('0xd'),'content':'','key':_0x6cab('0x1e'),'keyType':_0x6cab('0x5'),'variableName':_0x6cab('0x1f')},{'type':'keyValue','content':'','key':_0x6cab('0x20'),'keyType':_0x6cab('0x5'),'variableName':_0x6cab('0x21')}];break;case'outbound':_0x38232f=[{'type':_0x6cab('0x8'),'content':_0x6cab('0xc'),'variableName':null},{'type':'keyValue','content':'','key':_0x6cab('0x22'),'keyType':_0x6cab('0x5'),'keyContent':'','variableName':_0x6cab('0x23')},{'type':_0x6cab('0xd'),'content':'','key':'Member\x20Name','keyType':_0x6cab('0x5'),'keyContent':'','variableName':'membername'},{'type':_0x6cab('0xd'),'content':'','key':_0x6cab('0x24'),'keyType':_0x6cab('0x5'),'keyContent':'','variableName':_0x6cab('0x13')},{'type':_0x6cab('0xd'),'content':'','key':_0x6cab('0x25'),'keyType':_0x6cab('0x5'),'keyContent':'','variableName':_0x6cab('0x26')},{'type':'string','content':_0x6cab('0x19')},{'type':_0x6cab('0xd'),'content':'','key':_0x6cab('0x27'),'keyType':_0x6cab('0x5'),'keyContent':'','variableName':_0x6cab('0x28')},{'type':'keyValue','content':'','key':_0x6cab('0x29'),'keyType':_0x6cab('0x5'),'keyContent':'','variableName':_0x6cab('0x2a')},{'type':_0x6cab('0xd'),'content':'','key':_0x6cab('0x2b'),'keyType':_0x6cab('0x5'),'keyContent':'','variableName':_0x6cab('0x2c')},{'type':_0x6cab('0xd'),'content':'','key':'Billable\x20Time','keyType':_0x6cab('0x5'),'keyContent':'','variableName':_0x6cab('0x2d')}];break;}}return _0x38232f;}; \ No newline at end of file diff --git a/server/components/interaction/service.js b/server/components/interaction/service.js index e9e3afb..db21a36 100644 --- a/server/components/interaction/service.js +++ b/server/components/interaction/service.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xc7e1=['tracked','user','query','clone','omit','phone','mobile','updateUser','lodash','./sql-utils','findAll','skipInteractionsQuery','resolve','getInteractionsQuery','then','search','parseAdvancedSearchFilter','parseQueryParameters','where','body','contact','default','fields','filter','having','read','tags','checkAccountsRestrictions','group','i.id','countFilteredInteractions','length','count','clause','order','DESC','closed','getFilteredInteractions','rows','catch'];(function(_0x50fef1,_0x3d2138){var _0xa4648d=function(_0xbaaee2){while(--_0xbaaee2){_0x50fef1['push'](_0x50fef1['shift']());}};_0xa4648d(++_0x3d2138);}(_0xc7e1,0x1c0));var _0x1c7e=function(_0x50cc25,_0x20e963){_0x50cc25=_0x50cc25-0x0;var _0x20aee2=_0xc7e1[_0x50cc25];return _0x20aee2;};'use strict';var _=require(_0x1c7e('0x0'));var sqlUtils=require(_0x1c7e('0x1'));var utils=require('./utils');exports[_0x1c7e('0x2')]=function(_0x6d7fb2,_0x52eba3,_0x1b3932,_0x135497,_0x159bf2){var _0x49a289={'count':0x0,'rows':[]};var _0x2e9b12=sqlUtils[_0x1c7e('0x3')](_0x6d7fb2,_0x1b3932,_0x52eba3);if(_0x2e9b12){return Promise[_0x1c7e('0x4')](_0x49a289);}var _0x20388d=sqlUtils[_0x1c7e('0x5')](_0x6d7fb2);var _0x30a847={};return Promise['resolve']()[_0x1c7e('0x6')](function(){if(_0x52eba3[_0x1c7e('0x7')]){return sqlUtils[_0x1c7e('0x8')](_0x52eba3[_0x1c7e('0x7')],_0x159bf2);}else{return sqlUtils[_0x1c7e('0x9')](_0x6d7fb2,_0x52eba3,_0x159bf2);}})[_0x1c7e('0x6')](function(_0x1f0dc1){_0x20388d[_0x1c7e('0xa')](_0x1f0dc1[_0x1c7e('0xb')]);_0x20388d['where'](_0x1f0dc1[_0x1c7e('0xc')]);_0x20388d[_0x1c7e('0xa')](_0x1f0dc1[_0x1c7e('0xd')]);_0x20388d['where'](_0x1f0dc1[_0x1c7e('0xe')]);_0x20388d[_0x1c7e('0xa')](_0x1f0dc1[_0x1c7e('0xf')]);_0x20388d[_0x1c7e('0xa')](_0x1f0dc1['user']);_0x20388d[_0x1c7e('0x10')](_0x1f0dc1[_0x1c7e('0x11')]);_0x30a847=_0x1f0dc1[_0x1c7e('0x12')];return sqlUtils[_0x1c7e('0x13')](_0x6d7fb2,_0x1b3932,_0x52eba3);})[_0x1c7e('0x6')](function(_0x198483){_0x20388d['where'](_0x198483);_0x20388d[_0x1c7e('0x14')](_0x1c7e('0x15'));var _0x292dbf=_0x52eba3[_0x1c7e('0x7')]?_0x30a847['ids']:_0x52eba3['tag'];return sqlUtils[_0x1c7e('0x16')](_0x20388d,_0x292dbf);})[_0x1c7e('0x6')](function(_0x19bc30){_0x49a289['count']=_0x19bc30[_0x1c7e('0x17')];if(_0x49a289[_0x1c7e('0x18')]===0x0){return[];}_0x20388d[_0x1c7e('0x10')](_0x30a847[_0x1c7e('0x19')]);if(_0x135497[_0x1c7e('0x1a')]){_0x135497['order']['forEach'](function(_0x7d11cf){var _0x39754b=_0x7d11cf[0x0]==='contactName'?_0x7d11cf[0x0]:'i.'+_0x7d11cf[0x0];_0x20388d[_0x1c7e('0x1a')](_0x39754b,_0x7d11cf[0x1]===_0x1c7e('0x1b')?![]:!![]);if(_0x7d11cf[0x0]===_0x1c7e('0x1c')){var _0x34e9d7=sqlUtils['getClosedOrderClause'](_0x6d7fb2,_0x52eba3);_0x20388d[_0x1c7e('0x1a')](_0x34e9d7,_0x7d11cf[0x1]===_0x1c7e('0x1b')?![]:!![]);}});}return sqlUtils[_0x1c7e('0x1d')](_0x6d7fb2,_0x20388d,_0x52eba3,_0x135497);})[_0x1c7e('0x6')](function(_0x59ec62){_0x49a289[_0x1c7e('0x1e')]=_0x59ec62;return _0x49a289;})[_0x1c7e('0x1f')](function(_0x35280a){throw _0x35280a;});};exports[_0x1c7e('0x20')]=function(_0x432a43,_0x156402){return function(_0x55111a,_0x361436,_0x3d75fa){var _0x561bf4=_0x55111a[_0x1c7e('0x21')];var _0x890b1d={};var _0x10425c=_0x55111a[_0x1c7e('0x22')];if(_0x890b1d){_0x890b1d=_[_0x1c7e('0x23')](_0x55111a[_0x1c7e('0xb')]);_0x890b1d=_[_0x1c7e('0x24')](_0x890b1d,[_0x1c7e('0xb'),'html',_0x1c7e('0x25'),'fax',_0x1c7e('0x26')]);}utils[_0x1c7e('0x27')](_0x561bf4,_0x890b1d,_0x10425c,_0x432a43,_0x156402);_0x3d75fa(null);};}; \ No newline at end of file +var _0x699d=['where','body','contact','default','fields','filter','user','having','read','tags','checkAccountsRestrictions','group','i.id','tag','countFilteredInteractions','count','length','order','forEach','contactName','DESC','closed','getClosedOrderClause','getFilteredInteractions','tracked','query','clone','omit','html','phone','updateUser','lodash','./utils','findAll','resolve','getInteractionsQuery','parseAdvancedSearchFilter','search','then'];(function(_0x46fafb,_0x5ea8e1){var _0x3cac45=function(_0x2e3a6d){while(--_0x2e3a6d){_0x46fafb['push'](_0x46fafb['shift']());}};_0x3cac45(++_0x5ea8e1);}(_0x699d,0x6d));var _0xd699=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x699d[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0xd699('0x0'));var sqlUtils=require('./sql-utils');var utils=require(_0xd699('0x1'));exports[_0xd699('0x2')]=function(_0x308905,_0x71fb3a,_0x55c708,_0x1b8285,_0x5ccc7d){var _0x3a1f08={'count':0x0,'rows':[]};var _0x2f7969=sqlUtils['skipInteractionsQuery'](_0x308905,_0x55c708,_0x71fb3a);if(_0x2f7969){return Promise[_0xd699('0x3')](_0x3a1f08);}var _0x5cec2b=sqlUtils[_0xd699('0x4')](_0x308905);var _0x575d98={};return Promise[_0xd699('0x3')]()['then'](function(){if(_0x71fb3a['search']){return sqlUtils[_0xd699('0x5')](_0x71fb3a[_0xd699('0x6')],_0x5ccc7d);}else{return sqlUtils['parseQueryParameters'](_0x308905,_0x71fb3a,_0x5ccc7d);}})[_0xd699('0x7')](function(_0x2d4e48){_0x5cec2b[_0xd699('0x8')](_0x2d4e48[_0xd699('0x9')]);_0x5cec2b['where'](_0x2d4e48[_0xd699('0xa')]);_0x5cec2b[_0xd699('0x8')](_0x2d4e48[_0xd699('0xb')]);_0x5cec2b['where'](_0x2d4e48[_0xd699('0xc')]);_0x5cec2b[_0xd699('0x8')](_0x2d4e48[_0xd699('0xd')]);_0x5cec2b[_0xd699('0x8')](_0x2d4e48[_0xd699('0xe')]);_0x5cec2b[_0xd699('0xf')](_0x2d4e48[_0xd699('0x10')]);_0x575d98=_0x2d4e48[_0xd699('0x11')];return sqlUtils[_0xd699('0x12')](_0x308905,_0x55c708,_0x71fb3a);})[_0xd699('0x7')](function(_0x3d9442){_0x5cec2b[_0xd699('0x8')](_0x3d9442);_0x5cec2b[_0xd699('0x13')](_0xd699('0x14'));var _0x5082e5=_0x71fb3a[_0xd699('0x6')]?_0x575d98['ids']:_0x71fb3a[_0xd699('0x15')];return sqlUtils[_0xd699('0x16')](_0x5cec2b,_0x5082e5);})['then'](function(_0x13c5bb){_0x3a1f08[_0xd699('0x17')]=_0x13c5bb[_0xd699('0x18')];if(_0x3a1f08[_0xd699('0x17')]===0x0){return[];}_0x5cec2b['having'](_0x575d98['clause']);if(_0x1b8285[_0xd699('0x19')]){_0x1b8285[_0xd699('0x19')][_0xd699('0x1a')](function(_0x3965f2){var _0x25e156=_0x3965f2[0x0]===_0xd699('0x1b')?_0x3965f2[0x0]:'i.'+_0x3965f2[0x0];_0x5cec2b['order'](_0x25e156,_0x3965f2[0x1]===_0xd699('0x1c')?![]:!![]);if(_0x3965f2[0x0]===_0xd699('0x1d')){var _0x2ae746=sqlUtils[_0xd699('0x1e')](_0x308905,_0x71fb3a);_0x5cec2b[_0xd699('0x19')](_0x2ae746,_0x3965f2[0x1]===_0xd699('0x1c')?![]:!![]);}});}return sqlUtils[_0xd699('0x1f')](_0x308905,_0x5cec2b,_0x71fb3a,_0x1b8285);})[_0xd699('0x7')](function(_0x1fa52e){_0x3a1f08['rows']=_0x1fa52e;return _0x3a1f08;})['catch'](function(_0x635332){throw _0x635332;});};exports[_0xd699('0x20')]=function(_0x4f021e,_0x253601){return function(_0x3084af,_0x18ef4e,_0x57b3b8){var _0x3c14be=_0x3084af['user'];var _0x5cd5f4={};var _0x2edff4=_0x3084af[_0xd699('0x21')];if(_0x5cd5f4){_0x5cd5f4=_[_0xd699('0x22')](_0x3084af[_0xd699('0x9')]);_0x5cd5f4=_[_0xd699('0x23')](_0x5cd5f4,[_0xd699('0x9'),_0xd699('0x24'),_0xd699('0x25'),'fax','mobile']);}utils[_0xd699('0x26')](_0x3c14be,_0x5cd5f4,_0x2edff4,_0x4f021e,_0x253601);_0x57b3b8(null);};}; \ No newline at end of file diff --git a/server/components/interaction/sql-utils.js b/server/components/interaction/sql-utils.js index a8ebacf..f5625c2 100644 --- a/server/components/interaction/sql-utils.js +++ b/server/components/interaction/sql-utils.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xf150=['select','field','name','from','tools_tags','getInteractionFK','user_has_','u.id','ui.','users','length','\x20IN\x20?','map','getAccountFK','interactions','left_join','cm_contacts','o.id\x20=\x20i.UserId','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','replace','{OPERATOR}','isNumeric','i.id\x20LIKE\x20?','sms','whatsapp','includes','i.fax\x20LIKE\x20?','openchannel','i.from\x20LIKE\x20?','isEmail','c.email\x20LIKE\x20?','mail','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)','parseSearch','sqlOperator','conditions','find','buildExpression','default','text','start','value','end','unreadMessages','read','Contact','operator','$substring','split','contact','type','Tag','tags','clause','ids','User','user','CONCAT_WS(\x27\x20\x27,\x20o.name,\x20o.fullname)\x20LIKE\x20?','UserId','body','keys','some','compact','and','concat','createdAt','parse','$gte','null','\x20IS\x20NULL','then','fields','tag','filter','get','chat','Accounts','resolve','role','\x20IS\x20NOT\x20NULL','i.secondDisposition','i.disposition','unshift','i.substatus','closed','join','capitalize','Interaction','Sequelize','QueryTypes','SELECT','sequelize','query','keyBy','attributes','SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)','a.key','Account.key','Account.mandatoryDisposition','a.email','i.id','i.createdAt','i.closed','i.closedAt','i.attach','i.lastMsgAt','i.thirdDisposition','i.to','i.ContactId','i.MailAccountId','i.UserId','CASE\x20WHEN\x20i.from\x20IS\x20NOT\x20NULL\x20AND\x20i.from\x20<>\x20\x27\x27\x20THEN\x20i.from\x20WHEN\x20(c.firstName\x20IS\x20NOT\x20NULL\x20AND\x20c.firstName\x20<>\x20\x27\x27)\x20OR\x20(c.lastName\x20IS\x20NOT\x20NULL\x20AND\x20c.lastName\x20<>\x20\x27\x27)\x20THEN\x20CONCAT(IFNULL(c.firstName,\x20\x27\x27),\x20\x27\x20\x27,\x20IFNULL(c.lastName,\x20\x27\x27))\x20ELSE\x20\x27Unknown\x27\x20END','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','contactName','i.*','c.firstName','Contact.firstName','c.lastName','c.email','Contact.phone','c.mobile','Contact.fax','Owner.fullname','o.internal','Owner.internal','GROUP_CONCAT(DISTINCT\x20t.id)','TagIds','limit','offset','toString','groupBy','Setting','findOne','enableEmailPreview','all','clone','isEmpty','where','t.id\x20IN\x20?','exports','lodash','squel','../parsers/advancedSearch','../parsers/qs','./update-interaction','./utils','../../mysqldb','agent'];(function(_0x2f51e4,_0x43de4c){var _0x26fc81=function(_0x3beb0e){while(--_0x3beb0e){_0x2f51e4['push'](_0x2f51e4['shift']());}};_0x26fc81(++_0x43de4c);}(_0xf150,0x1de));var _0x0f15=function(_0x46812b,_0x3269b9){_0x46812b=_0x46812b-0x0;var _0x4dc3ab=_0xf150[_0x46812b];return _0x4dc3ab;};'use strict';var _=require(_0x0f15('0x0'));var squel=require(_0x0f15('0x1'));var as=require(_0x0f15('0x2'));var qs=require(_0x0f15('0x3'));var updateInteraction=require(_0x0f15('0x4'))['updateInteraction'];var utils=require(_0x0f15('0x5'));var db=require(_0x0f15('0x6'))['db'];function skipInteractionsQuery(_0xa993b5,_0x578e10,_0x81bfd){var _0x386adb=![];var _0x501c65=utils['getAccountFK'](_0xa993b5);if(_0x578e10['role']===_0x0f15('0x7')&&!_0x81bfd['search']&&!_0x81bfd[_0x501c65]){_0x386adb=!![];}return _0x386adb;}function getTagsQuery(){return squel[_0x0f15('0x8')]()[_0x0f15('0x9')]('id')['field'](_0x0f15('0xa'))['field']('color')[_0x0f15('0xb')](_0x0f15('0xc'));}function getUsersQuery(_0x32e36f,_0x40e429){var _0x2948ce=utils[_0x0f15('0xd')](_0x32e36f);var _0x72ba68=_0x0f15('0xe')+_0x32e36f+'_interactions';var _0x528bda=squel[_0x0f15('0x8')]()['field'](_0x0f15('0xf'))[_0x0f15('0x9')]('u.fullname')[_0x0f15('0x9')](_0x0f15('0x10')+_0x2948ce)['from'](_0x72ba68,'ui')['left_join'](_0x0f15('0x11'),'u','u.id\x20=\x20ui.UserId');if(_0x40e429[_0x0f15('0x12')]>0x0){_0x528bda['where']('ui.'+_0x2948ce+_0x0f15('0x13'),_[_0x0f15('0x14')](_0x40e429,'id'));}return _0x528bda;}function getInteractionsQuery(_0x5bf9cf){var _0x247cdd=utils['getInteractionsTables'](_0x5bf9cf);var _0x37a405=utils[_0x0f15('0x15')](_0x5bf9cf);var _0x7b556f=utils[_0x0f15('0xd')](_0x5bf9cf);return squel[_0x0f15('0x8')]()[_0x0f15('0xb')](_0x247cdd[_0x0f15('0x16')],'i')[_0x0f15('0x17')](_0x0f15('0x18'),'c','c.id\x20=\x20i.ContactId\x20AND\x20c.deletedAt\x20IS\x20NULL')[_0x0f15('0x17')](_0x0f15('0x11'),'o',_0x0f15('0x19'))['left_join'](_0x247cdd['accounts'],'a','a.id\x20=\x20i.'+_0x37a405)['left_join'](_0x247cdd[_0x0f15('0x1a')],'me',_0x0f15('0x1b')+_0x7b556f+_0x0f15('0x1c'))[_0x0f15('0x17')](_0x247cdd[_0x0f15('0x1d')],'it',_0x0f15('0x1e')+_0x7b556f+_0x0f15('0x1c'))[_0x0f15('0x17')]('tools_tags','t',_0x0f15('0x1f'));}function getSqlClauses(){var _0x32b16b={'body':squel[_0x0f15('0x20')](),'contact':squel['expr'](),'default':squel[_0x0f15('0x20')](),'fields':squel[_0x0f15('0x20')](),'filter':squel[_0x0f15('0x20')](),'read':squel[_0x0f15('0x20')](),'tags':{'clause':squel[_0x0f15('0x20')](),'ids':null},'user':squel[_0x0f15('0x20')]()};return _0x32b16b;}function parseTagParameter(_0x490235){var _0x333c5c=squel[_0x0f15('0x20')]();if(_0x490235){var _0x12df67=utils[_0x0f15('0x21')](_0x490235);_0x12df67[_0x0f15('0x22')](function(_0x980a9c){_0x333c5c['or'](_0x0f15('0x23'),'%,'+_0x980a9c+',%');});}return _0x333c5c;}function parseReadParameter(_0x31865f){var _0x33e8de='';if(_0x31865f){_0x33e8de=_0x0f15('0x24');if(_0x31865f==='1'){_0x33e8de=_0x33e8de[_0x0f15('0x25')](_0x0f15('0x26'),'=');}else{_0x33e8de=_0x33e8de[_0x0f15('0x25')]('{OPERATOR}','>');}}return _0x33e8de;}function parseSearchFilter(_0x20724c,_0x389130){var _0x1c06db=squel['expr']();if(_0x389130){var _0x1984a2=_0x389130[_0x0f15('0x25')]('\x5c','\x5c\x5c')[_0x0f15('0x25')](/'/g,'\x27\x27');if(qs[_0x0f15('0x27')](_0x1984a2)){_0x1c06db['or'](_0x0f15('0x28'),_0x1984a2+'%');if([_0x0f15('0x29'),_0x0f15('0x2a')][_0x0f15('0x2b')](_0x20724c)){_0x1c06db['or']('i.phone\x20LIKE\x20?',_0x1984a2+'%');}else if(_0x20724c==='fax'){_0x1c06db['or'](_0x0f15('0x2c'),_0x1984a2+'%');}else if(_0x20724c===_0x0f15('0x2d')){_0x1c06db['or'](_0x0f15('0x2e'),_0x1984a2+'%');}}else if(_0x20724c==='mail'&&qs[_0x0f15('0x2f')](_0x1984a2)){_0x1c06db['or'](_0x0f15('0x30'),_0x1984a2+'%');}else{if(_0x20724c===_0x0f15('0x31')){_0x1c06db['or'](_0x0f15('0x32'),qs[_0x0f15('0x33')](_0x1984a2,!![]))['or'](_0x0f15('0x34'),qs[_0x0f15('0x33')](_0x1984a2));}else if(_0x20724c!==_0x0f15('0x35')){_0x1c06db['or'](_0x0f15('0x36'),qs[_0x0f15('0x33')](_0x1984a2));}_0x1c06db['or']('MATCH\x20(c.firstName,\x20c.lastName,\x20c.phone,\x20c.mobile,\x20c.fax,\x20c.email)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)',qs[_0x0f15('0x33')](_0x1984a2,!![]),null);}}return _0x1c06db;}function parseAdvancedSearchFilter(_0x2e5340,_0x1765c0){var _0x40b1a1=getSqlClauses();var _0x51aa0e=as[_0x0f15('0x37')](_0x2e5340);var _0x415109=_0x51aa0e[_0x0f15('0x38')];for(var _0x2d0320=0x0;_0x2d0320<_0x51aa0e[_0x0f15('0x39')]['length'];_0x2d0320++){var _0x3d2cf6=_0x51aa0e[_0x0f15('0x39')][_0x2d0320];var _0x54ff6d='i';var _0x29c730=_[_0x0f15('0x3a')](_0x1765c0,['name',_0x3d2cf6[_0x0f15('0x9')]]);if(_0x29c730){var _0x10bf89=as[_0x0f15('0x3b')](_0x54ff6d,_0x29c730['type'],_0x3d2cf6);_0x40b1a1[_0x0f15('0x3c')][_0x415109](_0x10bf89[_0x0f15('0x3d')],_0x10bf89['value'][_0x0f15('0x3e')],_0x10bf89[_0x0f15('0x3f')][_0x0f15('0x40')]);}else{switch(_0x3d2cf6[_0x0f15('0x9')]){case _0x0f15('0x41'):var _0x6da52f=parseReadParameter(_0x3d2cf6[_0x0f15('0x3f')]);_0x40b1a1[_0x0f15('0x42')]['and'](_0x6da52f);break;case _0x0f15('0x43'):if(_0x3d2cf6[_0x0f15('0x44')]===_0x0f15('0x45')){if(_0x3d2cf6[_0x0f15('0x3f')][_0x0f15('0x46')]('\x20')[_0x0f15('0x12')]>0x1){_0x40b1a1['contact'][_0x415109]('MATCH\x20(c.firstName,\x20c.lastName,\x20c.phone,\x20c.mobile,\x20c.fax,\x20c.email)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)',qs[_0x0f15('0x33')](_0x3d2cf6[_0x0f15('0x3f')],!![]),null);}else{var _0x579b64='%'+_0x3d2cf6[_0x0f15('0x3f')]+'%';_0x40b1a1[_0x0f15('0x47')][_0x415109]('c.firstName\x20LIKE\x20?\x20OR\x20c.lastName\x20LIKE\x20?\x20OR\x20c.email\x20LIKE\x20?',_0x579b64,_0x579b64,_0x579b64);}}else{_0x29c730=_['find'](_0x1765c0,[_0x0f15('0xa'),'ContactId']);_0x3d2cf6[_0x0f15('0x9')]='ContactId';_0x10bf89=as[_0x0f15('0x3b')](_0x54ff6d,_0x29c730[_0x0f15('0x48')],_0x3d2cf6);_0x40b1a1[_0x0f15('0x47')][_0x415109](_0x10bf89[_0x0f15('0x3d')],_0x10bf89[_0x0f15('0x3f')][_0x0f15('0x3e')],_0x10bf89[_0x0f15('0x3f')][_0x0f15('0x40')]);}break;case _0x0f15('0x49'):var _0x3dfe93=_0x3d2cf6[_0x0f15('0x3f')]['split'](',')['map'](function(_0x1844d9){return Number(_0x1844d9);});var _0x553fdb=parseTagParameter(_0x3dfe93);_0x40b1a1[_0x0f15('0x4a')][_0x0f15('0x4b')]['and'](_0x553fdb);_0x40b1a1[_0x0f15('0x4a')][_0x0f15('0x4c')]=_0x3dfe93;break;case _0x0f15('0x4d'):if(_0x3d2cf6[_0x0f15('0x44')]===_0x0f15('0x45')){_0x40b1a1[_0x0f15('0x4e')][_0x415109](_0x0f15('0x4f'),'%'+_0x3d2cf6[_0x0f15('0x3f')]+'%',null);}else{_0x29c730=_[_0x0f15('0x3a')](_0x1765c0,[_0x0f15('0xa'),_0x0f15('0x50')]);_0x3d2cf6[_0x0f15('0x9')]='UserId';_0x10bf89=as[_0x0f15('0x3b')](_0x54ff6d,_0x29c730[_0x0f15('0x48')],_0x3d2cf6);_0x40b1a1['user'][_0x415109](_0x10bf89[_0x0f15('0x3d')],_0x10bf89[_0x0f15('0x3f')][_0x0f15('0x3e')],_0x10bf89[_0x0f15('0x3f')]['end']);}break;case _0x0f15('0x51'):case'plainBody':_0x10bf89=as[_0x0f15('0x3b')]('me',null,_0x3d2cf6);_0x40b1a1[_0x0f15('0x51')][_0x415109](_0x10bf89['text'],_0x10bf89['value'][_0x0f15('0x3e')],_0x10bf89[_0x0f15('0x3f')][_0x0f15('0x40')]);break;}}}return _0x40b1a1;}function parseModelFields(_0x51c1e0,_0x4ada2b,_0x1c4ab4){var _0x324f16=utils[_0x0f15('0x15')](_0x51c1e0);var _0x250561=squel[_0x0f15('0x20')]();var _0x201e01=_(_0x4ada2b)[_0x0f15('0x52')]()['map'](function(_0x199a85){return _[_0x0f15('0x53')](_0x1c4ab4,[_0x0f15('0xa'),_0x199a85])?_0x199a85:undefined;})[_0x0f15('0x54')]()[_0x0f15('0x3f')]();if(_0x201e01[_0x0f15('0x12')]>0x0){_0x201e01[_0x0f15('0x22')](function(_0x354358){if(_0x354358===_0x324f16){_0x250561[_0x0f15('0x55')]('i.'+_0x324f16+_0x0f15('0x13'),[][_0x0f15('0x56')](_0x4ada2b[_0x354358]));}else if(_0x354358===_0x0f15('0x57')){var _0x56c717=JSON[_0x0f15('0x58')](_0x4ada2b[_0x354358])[_0x0f15('0x59')];var _0x4af9e0=JSON[_0x0f15('0x58')](_0x4ada2b[_0x354358])['$lte'];_0x250561[_0x0f15('0x55')]('i.createdAt\x20BETWEEN\x20?\x20AND\x20?',_0x56c717,_0x4af9e0);}else{if(_0x4ada2b[_0x354358]===_0x0f15('0x5a')){_0x250561[_0x0f15('0x55')]('i.'+_0x354358+_0x0f15('0x5b'));}else{_0x250561[_0x0f15('0x55')]('i.'+_0x354358+'\x20=\x20?',_0x4ada2b[_0x354358]);}}});}return _0x250561;}function parseQueryParameters(_0x2bbe30,_0x3a1722,_0x1a32ce){var _0x23a3a7=getSqlClauses();return Promise['resolve']()[_0x0f15('0x5c')](function(){return parseModelFields(_0x2bbe30,_0x3a1722,_0x1a32ce);})[_0x0f15('0x5c')](function(_0xddeb10){_0x23a3a7[_0x0f15('0x5d')][_0x0f15('0x55')](_0xddeb10);return parseReadParameter(_0x3a1722[_0x0f15('0x42')]);})[_0x0f15('0x5c')](function(_0x18ba9e){_0x23a3a7['read'][_0x0f15('0x55')](_0x18ba9e);return parseTagParameter(_0x3a1722[_0x0f15('0x5e')]);})[_0x0f15('0x5c')](function(_0x927721){_0x23a3a7['tags'][_0x0f15('0x4b')]['and'](_0x927721);return parseSearchFilter(_0x2bbe30,_0x3a1722[_0x0f15('0x5f')]);})[_0x0f15('0x5c')](function(_0x53189f){_0x23a3a7[_0x0f15('0x5f')]=_0x53189f;return _0x23a3a7;});}function checkAccountsRestrictions(_0x322700,_0x3d3924,_0x437cc9){var _0x3005de=utils[_0x0f15('0x15')](_0x322700);var _0x3ca30d=_0x0f15('0x60')+_['capitalize'](_0x322700)+(_0x322700===_0x0f15('0x61')?'Websites':_0x0f15('0x62'));var _0x384255=squel['expr']();return Promise[_0x0f15('0x63')]()[_0x0f15('0x5c')](function(){if(_0x437cc9['search']&&_0x3d3924[_0x0f15('0x64')]===_0x0f15('0x7')){return _0x3d3924[_0x3ca30d]({'attributes':['id'],'raw':!![]});}})[_0x0f15('0x5c')](function(_0xc14a77){if(_0xc14a77){if(_0xc14a77[_0x0f15('0x12')]===0x0){_0x384255['and']('i.'+_0x3005de+_0x0f15('0x5b'));}else{_0x384255[_0x0f15('0x55')]('i.'+_0x3005de+_0x0f15('0x13'),_[_0x0f15('0x14')](_0xc14a77,'id'));}}else if(!_0x437cc9[_0x3005de]){_0x384255['and']('i.'+_0x3005de+_0x0f15('0x65'));}})[_0x0f15('0x5c')](function(){return _0x384255;});}function getClosedOrderClause(_0x56601e,_0x5815c4){var _0x45a7a8='';var _0x152119=['i.thirdDisposition',_0x0f15('0x66'),_0x0f15('0x67')];if(_0x56601e===_0x0f15('0x31')){_0x152119[_0x0f15('0x68')](_0x0f15('0x69'));}if(_0x5815c4[_0x0f15('0x6a')]==='0'&&_0x56601e===_0x0f15('0x31')){_0x45a7a8=_0x0f15('0x69');}else{if(_0x5815c4[_0x0f15('0x6a')]==='1'){_0x152119['shift']();}_0x45a7a8='CONCAT_WS(\x27\x27,\x20'+_0x152119[_0x0f15('0x6b')](',\x20')+')';}return _0x45a7a8;}function getFilteredInteractions(_0x424fdb,_0x4abb03,_0x2317d5,_0x3d9390){var _0x5d387=utils[_0x0f15('0xd')](_0x424fdb);var _0x3c6891=_[_0x0f15('0x6c')](_0x424fdb)+_0x0f15('0x6d');var _0x3e8864=[];var _0x56da3d=getTagsQuery();var _0x247cd4={'type':db[_0x0f15('0x6e')][_0x0f15('0x6f')][_0x0f15('0x70')],'raw':!![]};var _0x3ee4b4=[];var _0x11f64c=[];return db[_0x0f15('0x71')][_0x0f15('0x72')](_0x56da3d['toString'](),_0x247cd4)[_0x0f15('0x5c')](function(_0x29e73c){_0x3e8864=_[_0x0f15('0x73')](_0x29e73c,'id');_0x247cd4=_['merge'](_0x247cd4,{'model':db[_0x3c6891],'mapToModel':!![],'nest':!![]});if(_0x2317d5['fields']){_0x3d9390[_0x0f15('0x74')]['forEach'](function(_0xe17e09){_0x4abb03[_0x0f15('0x9')]('i.'+_0xe17e09);});}else{_0x4abb03[_0x0f15('0x9')](_0x0f15('0x75'),_0x0f15('0x41'));_0x4abb03[_0x0f15('0x9')](_0x0f15('0x76'),_0x0f15('0x77'));_0x4abb03[_0x0f15('0x9')]('a.mandatoryDisposition',_0x0f15('0x78'));if(_0x424fdb===_0x0f15('0x31')){_0x4abb03[_0x0f15('0x9')](_0x0f15('0x79'),'Account.email');_0x4abb03[_0x0f15('0x9')]('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');_0x4abb03[_0x0f15('0x9')](_0x0f15('0x7a'));_0x4abb03[_0x0f15('0x9')](_0x0f15('0x7b'));_0x4abb03[_0x0f15('0x9')]('i.updatedAt');_0x4abb03[_0x0f15('0x9')](_0x0f15('0x7c'));_0x4abb03[_0x0f15('0x9')](_0x0f15('0x7d'));_0x4abb03[_0x0f15('0x9')](_0x0f15('0x7e'));_0x4abb03[_0x0f15('0x9')](_0x0f15('0x7f'));_0x4abb03['field']('i.lastMsgDirection');_0x4abb03['field']('i.subject');_0x4abb03['field']('i.disposition');_0x4abb03[_0x0f15('0x9')](_0x0f15('0x66'));_0x4abb03[_0x0f15('0x9')](_0x0f15('0x80'));_0x4abb03[_0x0f15('0x9')](_0x0f15('0x69'));_0x4abb03[_0x0f15('0x9')](_0x0f15('0x81'));_0x4abb03['field'](_0x0f15('0x82'));_0x4abb03[_0x0f15('0x9')](_0x0f15('0x83'));_0x4abb03[_0x0f15('0x9')](_0x0f15('0x84'));}else if(_0x424fdb==='openchannel'){_0x4abb03[_0x0f15('0x9')](_0x0f15('0x85'),'contactName');}else{_0x4abb03[_0x0f15('0x9')](_0x0f15('0x86'),_0x0f15('0x87'));}if(_0x424fdb!==_0x0f15('0x31')){_0x4abb03['field'](_0x0f15('0x88'));}_0x4abb03[_0x0f15('0x9')](_0x0f15('0x89'),_0x0f15('0x8a'));_0x4abb03[_0x0f15('0x9')](_0x0f15('0x8b'),'Contact.lastName');_0x4abb03[_0x0f15('0x9')](_0x0f15('0x8c'),'Contact.email');_0x4abb03[_0x0f15('0x9')]('c.phone',_0x0f15('0x8d'));_0x4abb03[_0x0f15('0x9')](_0x0f15('0x8e'),'Contact.mobile');_0x4abb03['field']('c.fax',_0x0f15('0x8f'));_0x4abb03[_0x0f15('0x9')]('o.fullname',_0x0f15('0x90'));_0x4abb03[_0x0f15('0x9')](_0x0f15('0x91'),_0x0f15('0x92'));_0x4abb03[_0x0f15('0x9')](_0x0f15('0x93'),_0x0f15('0x94'));}if(_0x3d9390[_0x0f15('0x95')]){_0x4abb03[_0x0f15('0x95')](_0x3d9390['limit']);}if(_0x3d9390[_0x0f15('0x96')]){_0x4abb03[_0x0f15('0x96')](_0x3d9390['offset']);}return db[_0x0f15('0x71')][_0x0f15('0x72')](_0x4abb03[_0x0f15('0x97')](),_0x247cd4);})[_0x0f15('0x5c')](function(_0x451222){_0x3ee4b4=_0x451222;var _0x4de507=getUsersQuery(_0x424fdb,_0x3ee4b4);return db[_0x0f15('0x71')]['query'](_0x4de507['toString'](),_0x247cd4);})[_0x0f15('0x5c')](function(_0x5557b7){_0x11f64c=_[_0x0f15('0x98')](_0x5557b7,_0x5d387);if(_0x424fdb===_0x0f15('0x31')){return db[_0x0f15('0x99')][_0x0f15('0x9a')]({'attributes':['enableEmailPreview'],'raw':!![]});}})[_0x0f15('0x5c')](function(_0x5643f0){var _0x1a4a8a=_0x5643f0?_0x5643f0[_0x0f15('0x9b')]:undefined;var _0x300866=_0x3ee4b4['map'](function(_0x2c06bf){return updateInteraction(_0x2c06bf,_0x3e8864,_0x11f64c,_0x1a4a8a);});return Promise[_0x0f15('0x9c')](_0x300866);});}function countFilteredInteractions(_0x548225,_0x54bedf){var _0x4af060=_0x548225[_0x0f15('0x9d')]();_0x4af060[_0x0f15('0x9')]('COUNT(*)');_0x4af060[_0x0f15('0x9')](_0x0f15('0x75'),'unreadMessages');var _0x15193b=utils[_0x0f15('0x21')](_0x54bedf);if(!_[_0x0f15('0x9e')](_0x15193b)){_0x4af060[_0x0f15('0x9f')](_0x0f15('0xa0'),_0x15193b);}var _0x2378e4={'type':db[_0x0f15('0x6e')][_0x0f15('0x6f')][_0x0f15('0x70')],'raw':!![]};return db['sequelize'][_0x0f15('0x72')](_0x4af060['toString'](),_0x2378e4);}module[_0x0f15('0xa1')]={'checkAccountsRestrictions':checkAccountsRestrictions,'countFilteredInteractions':countFilteredInteractions,'getClosedOrderClause':getClosedOrderClause,'getFilteredInteractions':getFilteredInteractions,'getInteractionsQuery':getInteractionsQuery,'parseAdvancedSearchFilter':parseAdvancedSearchFilter,'parseQueryParameters':parseQueryParameters,'skipInteractionsQuery':skipInteractionsQuery}; \ No newline at end of file +var _0x4feb=['QueryTypes','lodash','squel','../parsers/advancedSearch','../parsers/qs','./update-interaction','updateInteraction','../../mysqldb','role','agent','search','field','name','color','from','tools_tags','getInteractionFK','user_has_','select','u.id','u.fullname','left_join','users','where','\x20IN\x20?','map','getAccountFK','interactions','cm_contacts','c.id\x20=\x20i.ContactId\x20AND\x20c.deletedAt\x20IS\x20NULL','accounts','messages','me.','\x20=\x20i.id','it.','t.id\x20=\x20it.TagId','expr','getSelectedTags','forEach','unreadMessages\x20{OPERATOR}\x200','{OPERATOR}','replace','isNumeric','i.id\x20LIKE\x20?','sms','whatsapp','includes','i.phone\x20LIKE\x20?','fax','i.fax\x20LIKE\x20?','i.from\x20LIKE\x20?','c.email\x20LIKE\x20?','mail','MATCH\x20(i.to,\x20i.subject)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','getFullTextValue','MATCH\x20(c.firstName,\x20c.lastName,\x20c.phone,\x20c.mobile,\x20c.fax,\x20c.email)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','parseSearch','sqlOperator','conditions','find','type','default','text','start','value','end','unreadMessages','read','and','Contact','$substring','split','length','contact','c.firstName\x20LIKE\x20?\x20OR\x20c.lastName\x20LIKE\x20?\x20OR\x20c.email\x20LIKE\x20?','ContactId','buildExpression','Tag','tags','clause','ids','User','user','CONCAT_WS(\x27\x20\x27,\x20o.name,\x20o.fullname)\x20LIKE\x20?','UserId','body','keys','some','concat','createdAt','parse','$gte','$lte','i.createdAt\x20BETWEEN\x20?\x20AND\x20?','null','\x20IS\x20NULL','resolve','then','filter','get','capitalize','chat','Websites','Accounts','\x20IS\x20NOT\x20NULL','i.secondDisposition','i.disposition','unshift','i.substatus','closed','shift','CONCAT_WS(\x27\x27,\x20','join','Interaction','SELECT','sequelize','query','toString','keyBy','merge','fields','attributes','SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)','a.key','Account.key','a.mandatoryDisposition','a.email','Account.email','CASE\x20WHEN\x20i.to\x20IS\x20NOT\x20NULL\x20AND\x20i.to\x20<>\x20\x27\x27\x20AND\x20i.to\x20NOT\x20LIKE\x20CONCAT(\x27%\x27,\x20a.email,\x20\x27%\x27)\x20THEN\x20TRIM(SUBSTRING_INDEX(i.to,\x20\x27<\x27,\x201))\x20WHEN\x20(c.firstName\x20IS\x20NOT\x20NULL\x20AND\x20c.firstName\x20<>\x20\x27\x27)\x20OR\x20(c.lastName\x20IS\x20NOT\x20NULL\x20AND\x20c.lastName\x20<>\x20\x27\x27)\x20THEN\x20CONCAT(IFNULL(c.firstName,\x20\x27\x27),\x20\x27\x20\x27,\x20IFNULL(c.lastName,\x20\x27\x27))\x20ELSE\x20\x27Unknown\x27\x20END','contactName','i.id','i.updatedAt','i.closed','i.closedAt','i.lastMsgAt','i.subject','i.thirdDisposition','i.to','i.ContactId','i.UserId','openchannel','CASE\x20WHEN\x20i.from\x20IS\x20NOT\x20NULL\x20AND\x20i.from\x20<>\x20\x27\x27\x20THEN\x20i.from\x20WHEN\x20(c.firstName\x20IS\x20NOT\x20NULL\x20AND\x20c.firstName\x20<>\x20\x27\x27)\x20OR\x20(c.lastName\x20IS\x20NOT\x20NULL\x20AND\x20c.lastName\x20<>\x20\x27\x27)\x20THEN\x20CONCAT(IFNULL(c.firstName,\x20\x27\x27),\x20\x27\x20\x27,\x20IFNULL(c.lastName,\x20\x27\x27))\x20ELSE\x20\x27Unknown\x27\x20END','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','Contact.firstName','c.lastName','c.email','Contact.email','c.phone','Contact.phone','c.mobile','Contact.mobile','c.fax','Contact.fax','o.fullname','Owner.fullname','o.internal','Owner.internal','GROUP_CONCAT(DISTINCT\x20t.id)','TagIds','limit','offset','groupBy','Setting','findOne','enableEmailPreview','all','clone','COUNT(*)','isEmpty','t.id\x20IN\x20?','Sequelize'];(function(_0x42b4dd,_0x583da8){var _0x46f51f=function(_0x552b91){while(--_0x552b91){_0x42b4dd['push'](_0x42b4dd['shift']());}};_0x46f51f(++_0x583da8);}(_0x4feb,0x157));var _0xb4fe=function(_0x20a397,_0x4f0cb2){_0x20a397=_0x20a397-0x0;var _0x4a17d0=_0x4feb[_0x20a397];return _0x4a17d0;};'use strict';var _=require(_0xb4fe('0x0'));var squel=require(_0xb4fe('0x1'));var as=require(_0xb4fe('0x2'));var qs=require(_0xb4fe('0x3'));var updateInteraction=require(_0xb4fe('0x4'))[_0xb4fe('0x5')];var utils=require('./utils');var db=require(_0xb4fe('0x6'))['db'];function skipInteractionsQuery(_0x1dc07b,_0x465804,_0x290d3e){var _0x403fd6=![];var _0x195156=utils['getAccountFK'](_0x1dc07b);if(_0x465804[_0xb4fe('0x7')]===_0xb4fe('0x8')&&!_0x290d3e[_0xb4fe('0x9')]&&!_0x290d3e[_0x195156]){_0x403fd6=!![];}return _0x403fd6;}function getTagsQuery(){return squel['select']()['field']('id')[_0xb4fe('0xa')](_0xb4fe('0xb'))['field'](_0xb4fe('0xc'))[_0xb4fe('0xd')](_0xb4fe('0xe'));}function getUsersQuery(_0x2142da,_0x36923a){var _0x5773ec=utils[_0xb4fe('0xf')](_0x2142da);var _0x14dbbe=_0xb4fe('0x10')+_0x2142da+'_interactions';var _0x3376d9=squel[_0xb4fe('0x11')]()[_0xb4fe('0xa')](_0xb4fe('0x12'))['field'](_0xb4fe('0x13'))['field']('ui.'+_0x5773ec)[_0xb4fe('0xd')](_0x14dbbe,'ui')[_0xb4fe('0x14')](_0xb4fe('0x15'),'u','u.id\x20=\x20ui.UserId');if(_0x36923a['length']>0x0){_0x3376d9[_0xb4fe('0x16')]('ui.'+_0x5773ec+_0xb4fe('0x17'),_[_0xb4fe('0x18')](_0x36923a,'id'));}return _0x3376d9;}function getInteractionsQuery(_0x51d4fd){var _0x368aac=utils['getInteractionsTables'](_0x51d4fd);var _0x46577d=utils[_0xb4fe('0x19')](_0x51d4fd);var _0x315144=utils[_0xb4fe('0xf')](_0x51d4fd);return squel[_0xb4fe('0x11')]()[_0xb4fe('0xd')](_0x368aac[_0xb4fe('0x1a')],'i')[_0xb4fe('0x14')](_0xb4fe('0x1b'),'c',_0xb4fe('0x1c'))[_0xb4fe('0x14')](_0xb4fe('0x15'),'o','o.id\x20=\x20i.UserId')[_0xb4fe('0x14')](_0x368aac[_0xb4fe('0x1d')],'a','a.id\x20=\x20i.'+_0x46577d)[_0xb4fe('0x14')](_0x368aac[_0xb4fe('0x1e')],'me',_0xb4fe('0x1f')+_0x315144+_0xb4fe('0x20'))[_0xb4fe('0x14')](_0x368aac['interactionsTags'],'it',_0xb4fe('0x21')+_0x315144+_0xb4fe('0x20'))[_0xb4fe('0x14')](_0xb4fe('0xe'),'t',_0xb4fe('0x22'));}function getSqlClauses(){var _0x25b2fe={'body':squel[_0xb4fe('0x23')](),'contact':squel[_0xb4fe('0x23')](),'default':squel[_0xb4fe('0x23')](),'fields':squel['expr'](),'filter':squel[_0xb4fe('0x23')](),'read':squel[_0xb4fe('0x23')](),'tags':{'clause':squel[_0xb4fe('0x23')](),'ids':null},'user':squel['expr']()};return _0x25b2fe;}function parseTagParameter(_0x2d2b98){var _0x2db957=squel[_0xb4fe('0x23')]();if(_0x2d2b98){var _0x4e0347=utils[_0xb4fe('0x24')](_0x2d2b98);_0x4e0347[_0xb4fe('0x25')](function(_0xc89518){_0x2db957['or']('CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','%,'+_0xc89518+',%');});}return _0x2db957;}function parseReadParameter(_0x393d68){var _0x272ff4='';if(_0x393d68){_0x272ff4=_0xb4fe('0x26');if(_0x393d68==='1'){_0x272ff4=_0x272ff4['replace'](_0xb4fe('0x27'),'=');}else{_0x272ff4=_0x272ff4[_0xb4fe('0x28')](_0xb4fe('0x27'),'>');}}return _0x272ff4;}function parseSearchFilter(_0x1ad813,_0x2942e7){var _0x4720e1=squel['expr']();if(_0x2942e7){var _0x23fbeb=_0x2942e7[_0xb4fe('0x28')]('\x5c','\x5c\x5c')['replace'](/'/g,'\x27\x27');if(qs[_0xb4fe('0x29')](_0x23fbeb)){_0x4720e1['or'](_0xb4fe('0x2a'),_0x23fbeb+'%');if([_0xb4fe('0x2b'),_0xb4fe('0x2c')][_0xb4fe('0x2d')](_0x1ad813)){_0x4720e1['or'](_0xb4fe('0x2e'),_0x23fbeb+'%');}else if(_0x1ad813===_0xb4fe('0x2f')){_0x4720e1['or'](_0xb4fe('0x30'),_0x23fbeb+'%');}else if(_0x1ad813==='openchannel'){_0x4720e1['or'](_0xb4fe('0x31'),_0x23fbeb+'%');}}else if(_0x1ad813==='mail'&&qs['isEmail'](_0x23fbeb)){_0x4720e1['or'](_0xb4fe('0x32'),_0x23fbeb+'%');}else{if(_0x1ad813===_0xb4fe('0x33')){_0x4720e1['or'](_0xb4fe('0x34'),qs[_0xb4fe('0x35')](_0x23fbeb,!![]))['or']('MATCH\x20(me.plainBody,\x20me.subject)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)',qs[_0xb4fe('0x35')](_0x23fbeb));}else if(_0x1ad813!=='fax'){_0x4720e1['or']('MATCH\x20(me.body)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)',qs[_0xb4fe('0x35')](_0x23fbeb));}_0x4720e1['or'](_0xb4fe('0x36'),qs[_0xb4fe('0x35')](_0x23fbeb,!![]),null);}}return _0x4720e1;}function parseAdvancedSearchFilter(_0x7e3ef9,_0x2121d4){var _0x2ce5d3=getSqlClauses();var _0x4e26a9=as[_0xb4fe('0x37')](_0x7e3ef9);var _0x558990=_0x4e26a9[_0xb4fe('0x38')];for(var _0x2388ac=0x0;_0x2388ac<_0x4e26a9[_0xb4fe('0x39')]['length'];_0x2388ac++){var _0x1975d8=_0x4e26a9[_0xb4fe('0x39')][_0x2388ac];var _0x13ff8a='i';var _0x4bfb83=_[_0xb4fe('0x3a')](_0x2121d4,['name',_0x1975d8['field']]);if(_0x4bfb83){var _0x48c237=as['buildExpression'](_0x13ff8a,_0x4bfb83[_0xb4fe('0x3b')],_0x1975d8);_0x2ce5d3[_0xb4fe('0x3c')][_0x558990](_0x48c237[_0xb4fe('0x3d')],_0x48c237['value'][_0xb4fe('0x3e')],_0x48c237[_0xb4fe('0x3f')][_0xb4fe('0x40')]);}else{switch(_0x1975d8[_0xb4fe('0xa')]){case _0xb4fe('0x41'):var _0x2be1b5=parseReadParameter(_0x1975d8[_0xb4fe('0x3f')]);_0x2ce5d3[_0xb4fe('0x42')][_0xb4fe('0x43')](_0x2be1b5);break;case _0xb4fe('0x44'):if(_0x1975d8['operator']===_0xb4fe('0x45')){if(_0x1975d8[_0xb4fe('0x3f')][_0xb4fe('0x46')]('\x20')[_0xb4fe('0x47')]>0x1){_0x2ce5d3[_0xb4fe('0x48')][_0x558990]('MATCH\x20(c.firstName,\x20c.lastName,\x20c.phone,\x20c.mobile,\x20c.fax,\x20c.email)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)',qs[_0xb4fe('0x35')](_0x1975d8[_0xb4fe('0x3f')],!![]),null);}else{var _0x72acc6='%'+_0x1975d8[_0xb4fe('0x3f')]+'%';_0x2ce5d3[_0xb4fe('0x48')][_0x558990](_0xb4fe('0x49'),_0x72acc6,_0x72acc6,_0x72acc6);}}else{_0x4bfb83=_[_0xb4fe('0x3a')](_0x2121d4,[_0xb4fe('0xb'),_0xb4fe('0x4a')]);_0x1975d8['field']=_0xb4fe('0x4a');_0x48c237=as[_0xb4fe('0x4b')](_0x13ff8a,_0x4bfb83[_0xb4fe('0x3b')],_0x1975d8);_0x2ce5d3[_0xb4fe('0x48')][_0x558990](_0x48c237[_0xb4fe('0x3d')],_0x48c237['value']['start'],_0x48c237[_0xb4fe('0x3f')][_0xb4fe('0x40')]);}break;case _0xb4fe('0x4c'):var _0x57b2a2=_0x1975d8[_0xb4fe('0x3f')][_0xb4fe('0x46')](',')[_0xb4fe('0x18')](function(_0x2cee60){return Number(_0x2cee60);});var _0x3d37aa=parseTagParameter(_0x57b2a2);_0x2ce5d3[_0xb4fe('0x4d')][_0xb4fe('0x4e')][_0xb4fe('0x43')](_0x3d37aa);_0x2ce5d3[_0xb4fe('0x4d')][_0xb4fe('0x4f')]=_0x57b2a2;break;case _0xb4fe('0x50'):if(_0x1975d8['operator']===_0xb4fe('0x45')){_0x2ce5d3[_0xb4fe('0x51')][_0x558990](_0xb4fe('0x52'),'%'+_0x1975d8[_0xb4fe('0x3f')]+'%',null);}else{_0x4bfb83=_[_0xb4fe('0x3a')](_0x2121d4,[_0xb4fe('0xb'),_0xb4fe('0x53')]);_0x1975d8['field']=_0xb4fe('0x53');_0x48c237=as['buildExpression'](_0x13ff8a,_0x4bfb83[_0xb4fe('0x3b')],_0x1975d8);_0x2ce5d3[_0xb4fe('0x51')][_0x558990](_0x48c237['text'],_0x48c237[_0xb4fe('0x3f')][_0xb4fe('0x3e')],_0x48c237[_0xb4fe('0x3f')]['end']);}break;case _0xb4fe('0x54'):case'plainBody':_0x48c237=as[_0xb4fe('0x4b')]('me',null,_0x1975d8);_0x2ce5d3[_0xb4fe('0x54')][_0x558990](_0x48c237[_0xb4fe('0x3d')],_0x48c237['value'][_0xb4fe('0x3e')],_0x48c237[_0xb4fe('0x3f')]['end']);break;}}}return _0x2ce5d3;}function parseModelFields(_0x416fa5,_0x44fe3a,_0x5ef450){var _0x56ec32=utils[_0xb4fe('0x19')](_0x416fa5);var _0x3658f5=squel[_0xb4fe('0x23')]();var _0x31eec2=_(_0x44fe3a)[_0xb4fe('0x55')]()[_0xb4fe('0x18')](function(_0x32b56e){return _[_0xb4fe('0x56')](_0x5ef450,[_0xb4fe('0xb'),_0x32b56e])?_0x32b56e:undefined;})['compact']()[_0xb4fe('0x3f')]();if(_0x31eec2['length']>0x0){_0x31eec2['forEach'](function(_0x2ed6e8){if(_0x2ed6e8===_0x56ec32){_0x3658f5[_0xb4fe('0x43')]('i.'+_0x56ec32+_0xb4fe('0x17'),[][_0xb4fe('0x57')](_0x44fe3a[_0x2ed6e8]));}else if(_0x2ed6e8===_0xb4fe('0x58')){var _0x485b55=JSON[_0xb4fe('0x59')](_0x44fe3a[_0x2ed6e8])[_0xb4fe('0x5a')];var _0x293ad4=JSON[_0xb4fe('0x59')](_0x44fe3a[_0x2ed6e8])[_0xb4fe('0x5b')];_0x3658f5[_0xb4fe('0x43')](_0xb4fe('0x5c'),_0x485b55,_0x293ad4);}else{if(_0x44fe3a[_0x2ed6e8]===_0xb4fe('0x5d')){_0x3658f5[_0xb4fe('0x43')]('i.'+_0x2ed6e8+_0xb4fe('0x5e'));}else{_0x3658f5[_0xb4fe('0x43')]('i.'+_0x2ed6e8+'\x20=\x20?',_0x44fe3a[_0x2ed6e8]);}}});}return _0x3658f5;}function parseQueryParameters(_0x59ae72,_0x37769e,_0x5825d5){var _0xb02f5e=getSqlClauses();return Promise[_0xb4fe('0x5f')]()[_0xb4fe('0x60')](function(){return parseModelFields(_0x59ae72,_0x37769e,_0x5825d5);})[_0xb4fe('0x60')](function(_0x5d7968){_0xb02f5e['fields'][_0xb4fe('0x43')](_0x5d7968);return parseReadParameter(_0x37769e[_0xb4fe('0x42')]);})[_0xb4fe('0x60')](function(_0x49f069){_0xb02f5e['read'][_0xb4fe('0x43')](_0x49f069);return parseTagParameter(_0x37769e['tag']);})[_0xb4fe('0x60')](function(_0x186b9a){_0xb02f5e[_0xb4fe('0x4d')]['clause'][_0xb4fe('0x43')](_0x186b9a);return parseSearchFilter(_0x59ae72,_0x37769e['filter']);})['then'](function(_0x114216){_0xb02f5e[_0xb4fe('0x61')]=_0x114216;return _0xb02f5e;});}function checkAccountsRestrictions(_0x315393,_0x47a7d4,_0x109321){var _0x2e3592=utils[_0xb4fe('0x19')](_0x315393);var _0x5b952a=_0xb4fe('0x62')+_[_0xb4fe('0x63')](_0x315393)+(_0x315393===_0xb4fe('0x64')?_0xb4fe('0x65'):_0xb4fe('0x66'));var _0x614fa9=squel[_0xb4fe('0x23')]();return Promise[_0xb4fe('0x5f')]()[_0xb4fe('0x60')](function(){if(_0x109321[_0xb4fe('0x9')]&&_0x47a7d4[_0xb4fe('0x7')]==='agent'){return _0x47a7d4[_0x5b952a]({'attributes':['id'],'raw':!![]});}})[_0xb4fe('0x60')](function(_0x2616c8){if(_0x2616c8){if(_0x2616c8[_0xb4fe('0x47')]===0x0){_0x614fa9[_0xb4fe('0x43')]('i.'+_0x2e3592+'\x20IS\x20NULL');}else{_0x614fa9['and']('i.'+_0x2e3592+_0xb4fe('0x17'),_[_0xb4fe('0x18')](_0x2616c8,'id'));}}else if(!_0x109321[_0x2e3592]){_0x614fa9[_0xb4fe('0x43')]('i.'+_0x2e3592+_0xb4fe('0x67'));}})['then'](function(){return _0x614fa9;});}function getClosedOrderClause(_0x411069,_0x322adb){var _0xebe061='';var _0x6713b8=['i.thirdDisposition',_0xb4fe('0x68'),_0xb4fe('0x69')];if(_0x411069===_0xb4fe('0x33')){_0x6713b8[_0xb4fe('0x6a')](_0xb4fe('0x6b'));}if(_0x322adb[_0xb4fe('0x6c')]==='0'&&_0x411069===_0xb4fe('0x33')){_0xebe061=_0xb4fe('0x6b');}else{if(_0x322adb['closed']==='1'){_0x6713b8[_0xb4fe('0x6d')]();}_0xebe061=_0xb4fe('0x6e')+_0x6713b8[_0xb4fe('0x6f')](',\x20')+')';}return _0xebe061;}function getFilteredInteractions(_0x36b4c5,_0x16a8f3,_0x548540,_0x460144){var _0x5f418d=utils[_0xb4fe('0xf')](_0x36b4c5);var _0x1ca143=_[_0xb4fe('0x63')](_0x36b4c5)+_0xb4fe('0x70');var _0x49d897=[];var _0x17c670=getTagsQuery();var _0x2189de={'type':db['Sequelize']['QueryTypes'][_0xb4fe('0x71')],'raw':!![]};var _0x52695c=[];var _0x27e9b4=[];return db[_0xb4fe('0x72')][_0xb4fe('0x73')](_0x17c670[_0xb4fe('0x74')](),_0x2189de)[_0xb4fe('0x60')](function(_0x553224){_0x49d897=_[_0xb4fe('0x75')](_0x553224,'id');_0x2189de=_[_0xb4fe('0x76')](_0x2189de,{'model':db[_0x1ca143],'mapToModel':!![],'nest':!![]});if(_0x548540[_0xb4fe('0x77')]){_0x460144[_0xb4fe('0x78')][_0xb4fe('0x25')](function(_0x2943c2){_0x16a8f3[_0xb4fe('0xa')]('i.'+_0x2943c2);});}else{_0x16a8f3['field'](_0xb4fe('0x79'),_0xb4fe('0x41'));_0x16a8f3['field'](_0xb4fe('0x7a'),_0xb4fe('0x7b'));_0x16a8f3[_0xb4fe('0xa')](_0xb4fe('0x7c'),'Account.mandatoryDisposition');if(_0x36b4c5===_0xb4fe('0x33')){_0x16a8f3[_0xb4fe('0xa')](_0xb4fe('0x7d'),_0xb4fe('0x7e'));_0x16a8f3[_0xb4fe('0xa')](_0xb4fe('0x7f'),_0xb4fe('0x80'));_0x16a8f3['field'](_0xb4fe('0x81'));_0x16a8f3[_0xb4fe('0xa')]('i.createdAt');_0x16a8f3[_0xb4fe('0xa')](_0xb4fe('0x82'));_0x16a8f3[_0xb4fe('0xa')](_0xb4fe('0x83'));_0x16a8f3[_0xb4fe('0xa')](_0xb4fe('0x84'));_0x16a8f3[_0xb4fe('0xa')]('i.attach');_0x16a8f3[_0xb4fe('0xa')](_0xb4fe('0x85'));_0x16a8f3['field']('i.lastMsgDirection');_0x16a8f3['field'](_0xb4fe('0x86'));_0x16a8f3['field'](_0xb4fe('0x69'));_0x16a8f3[_0xb4fe('0xa')](_0xb4fe('0x68'));_0x16a8f3[_0xb4fe('0xa')](_0xb4fe('0x87'));_0x16a8f3[_0xb4fe('0xa')](_0xb4fe('0x6b'));_0x16a8f3['field'](_0xb4fe('0x88'));_0x16a8f3[_0xb4fe('0xa')](_0xb4fe('0x89'));_0x16a8f3[_0xb4fe('0xa')]('i.MailAccountId');_0x16a8f3['field'](_0xb4fe('0x8a'));}else if(_0x36b4c5===_0xb4fe('0x8b')){_0x16a8f3[_0xb4fe('0xa')](_0xb4fe('0x8c'),_0xb4fe('0x80'));}else{_0x16a8f3['field'](_0xb4fe('0x8d'),_0xb4fe('0x80'));}if(_0x36b4c5!==_0xb4fe('0x33')){_0x16a8f3[_0xb4fe('0xa')]('i.*');}_0x16a8f3[_0xb4fe('0xa')]('c.firstName',_0xb4fe('0x8e'));_0x16a8f3[_0xb4fe('0xa')](_0xb4fe('0x8f'),'Contact.lastName');_0x16a8f3['field'](_0xb4fe('0x90'),_0xb4fe('0x91'));_0x16a8f3[_0xb4fe('0xa')](_0xb4fe('0x92'),_0xb4fe('0x93'));_0x16a8f3['field'](_0xb4fe('0x94'),_0xb4fe('0x95'));_0x16a8f3['field'](_0xb4fe('0x96'),_0xb4fe('0x97'));_0x16a8f3[_0xb4fe('0xa')](_0xb4fe('0x98'),_0xb4fe('0x99'));_0x16a8f3['field'](_0xb4fe('0x9a'),_0xb4fe('0x9b'));_0x16a8f3[_0xb4fe('0xa')](_0xb4fe('0x9c'),_0xb4fe('0x9d'));}if(_0x460144[_0xb4fe('0x9e')]){_0x16a8f3[_0xb4fe('0x9e')](_0x460144[_0xb4fe('0x9e')]);}if(_0x460144[_0xb4fe('0x9f')]){_0x16a8f3[_0xb4fe('0x9f')](_0x460144[_0xb4fe('0x9f')]);}return db[_0xb4fe('0x72')][_0xb4fe('0x73')](_0x16a8f3[_0xb4fe('0x74')](),_0x2189de);})['then'](function(_0xe90381){_0x52695c=_0xe90381;var _0x5c2f6e=getUsersQuery(_0x36b4c5,_0x52695c);return db['sequelize'][_0xb4fe('0x73')](_0x5c2f6e[_0xb4fe('0x74')](),_0x2189de);})[_0xb4fe('0x60')](function(_0x4fc39e){_0x27e9b4=_[_0xb4fe('0xa0')](_0x4fc39e,_0x5f418d);if(_0x36b4c5===_0xb4fe('0x33')){return db[_0xb4fe('0xa1')][_0xb4fe('0xa2')]({'attributes':[_0xb4fe('0xa3')],'raw':!![]});}})[_0xb4fe('0x60')](function(_0x5df751){var _0x34f3f2=_0x5df751?_0x5df751[_0xb4fe('0xa3')]:undefined;var _0x33113e=_0x52695c[_0xb4fe('0x18')](function(_0x29a699){return updateInteraction(_0x29a699,_0x49d897,_0x27e9b4,_0x34f3f2);});return Promise[_0xb4fe('0xa4')](_0x33113e);});}function countFilteredInteractions(_0x1bf04f,_0x5dc34c){var _0x37d88b=_0x1bf04f[_0xb4fe('0xa5')]();_0x37d88b['field'](_0xb4fe('0xa6'));_0x37d88b['field'](_0xb4fe('0x79'),'unreadMessages');var _0x4fa2dc=utils[_0xb4fe('0x24')](_0x5dc34c);if(!_[_0xb4fe('0xa7')](_0x4fa2dc)){_0x37d88b[_0xb4fe('0x16')](_0xb4fe('0xa8'),_0x4fa2dc);}var _0x2029a9={'type':db[_0xb4fe('0xa9')][_0xb4fe('0xaa')][_0xb4fe('0x71')],'raw':!![]};return db[_0xb4fe('0x72')][_0xb4fe('0x73')](_0x37d88b[_0xb4fe('0x74')](),_0x2029a9);}module['exports']={'checkAccountsRestrictions':checkAccountsRestrictions,'countFilteredInteractions':countFilteredInteractions,'getClosedOrderClause':getClosedOrderClause,'getFilteredInteractions':getFilteredInteractions,'getInteractionsQuery':getInteractionsQuery,'parseAdvancedSearchFilter':parseAdvancedSearchFilter,'parseQueryParameters':parseQueryParameters,'skipInteractionsQuery':skipInteractionsQuery}; \ No newline at end of file diff --git a/server/components/interaction/update-interaction.js b/server/components/interaction/update-interaction.js index 0fb794f..1a8ffc2 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 _0xb27a=['closed','disposition','UserId','answered','MailMessage','findOne','out','plainBody','-id','then','lastMsgText','trimStart','updateInteraction','Users','TagIds','catch','lodash','split','push','waiting','talking','unmanaged','abandoned','total'];(function(_0x32e451,_0x8d30e8){var _0x3f64a6=function(_0x1c32af){while(--_0x1c32af){_0x32e451['push'](_0x32e451['shift']());}};_0x3f64a6(++_0x8d30e8);}(_0xb27a,0xe8));var _0xab27=function(_0x2aee2f,_0xad9887){_0x2aee2f=_0x2aee2f-0x0;var _0x19337f=_0xb27a[_0x2aee2f];return _0x19337f;};'use strict';var _=require(_0xab27('0x0'));var db=require('../../mysqldb')['db'];function getInteractionUsers(_0x900146,_0x4f1654){return new Promise(function(_0x29e444,_0x4d6043){try{var _0x2b4b28=[];if(_0x4f1654[_0x900146]){_0x2b4b28=_0x4f1654[_0x900146]['map'](function(_0x9daeb6){return{'id':_0x9daeb6['id'],'fullname':_0x9daeb6['fullname']};});}return _0x29e444(_0x2b4b28);}catch(_0xe1c96e){_0x4d6043(_0xe1c96e);}});}function getInteractionTags(_0x199089,_0x181d97){var _0x5128ce=[];if(_0x199089){_0x199089[_0xab27('0x1')](',')['forEach'](function(_0x19d3d9){_0x5128ce[_0xab27('0x2')](_0x181d97[_0x19d3d9]);});}return _0x5128ce;}function updateWaitingCounter(_0x1db531){if(_0x1db531['waiting']){_0x1db531[_0xab27('0x3')]-=0x1;}}function updateInteractionCounters(_0x4ff166){_0x4ff166[_0xab27('0x3')]=0x0;_0x4ff166[_0xab27('0x4')]=0x0;_0x4ff166['answered']=0x0;_0x4ff166[_0xab27('0x5')]=0x0;_0x4ff166[_0xab27('0x6')]=0x0;_0x4ff166[_0xab27('0x7')]=0x0;if(_0x4ff166[_0xab27('0x8')]){if(_0x4ff166[_0xab27('0x9')]===_0xab27('0x6')){_0x4ff166[_0xab27('0x6')]+=0x1;updateWaitingCounter(_0x4ff166);}if(_0x4ff166[_0xab27('0xa')]){_0x4ff166[_0xab27('0xb')]+=0x1;if(_0x4ff166[_0xab27('0x4')]){_0x4ff166['talking']-=0x1;}}else{if(_0x4ff166[_0xab27('0x9')]){_0x4ff166['unmanaged']+=0x1;updateWaitingCounter(_0x4ff166);}}}else{if(!_0x4ff166[_0xab27('0xa')]){_0x4ff166[_0xab27('0x3')]+=0x1;}if(_0x4ff166[_0xab27('0xa')]){_0x4ff166[_0xab27('0x4')]+=0x1;updateWaitingCounter(_0x4ff166);}}_0x4ff166['total']+=0x1;return _0x4ff166;}function getLastMessageText(_0x4a56aa){return db[_0xab27('0xc')][_0xab27('0xd')]({'where':{'$and':[{'MailInteractionId':_0x4a56aa['id']},{'$or':[{'direction':'in'},{'$and':[{'direction':_0xab27('0xe')},{'secret':![]},{'UserId':{'$ne':null}}]}]}]},'attributes':[_0xab27('0xf')],'order':_0xab27('0x10'),'raw':!![]})[_0xab27('0x11')](function(_0x53ba4e){if(_0x53ba4e&&_0x53ba4e['plainBody']){_0x4a56aa[_0xab27('0x12')]=_[_0xab27('0x13')](_0x53ba4e['plainBody']);}return _0x4a56aa;})['catch'](function(_0x13bef2){throw _0x13bef2;});}exports[_0xab27('0x14')]=function(_0x3fa6ac,_0xe4a4d1,_0x57ee95,_0x558028){return new Promise(function(_0x510a07,_0x3ccf3c){return getInteractionUsers(_0x3fa6ac['id'],_0x57ee95)[_0xab27('0x11')](function(_0x470dd9){_0x3fa6ac[_0xab27('0x15')]=_0x470dd9;return getInteractionTags(_0x3fa6ac[_0xab27('0x16')],_0xe4a4d1);})[_0xab27('0x11')](function(_0x320bce){_0x3fa6ac['Tags']=_0x320bce;delete _0x3fa6ac[_0xab27('0x16')];return updateInteractionCounters(_0x3fa6ac);})['then'](function(_0x2b12f5){if(_0x558028){return getLastMessageText(_0x2b12f5);}else{return _0x2b12f5;}})[_0xab27('0x11')](function(_0x533426){_0x510a07(_0x533426);})[_0xab27('0x17')](function(_0x213dca){_0x3ccf3c(_0x213dca);});});}; \ No newline at end of file +var _0xd8b2=['-id','then','lastMsgText','trimStart','updateInteraction','Users','TagIds','Tags','catch','lodash','../../mysqldb','map','fullname','split','forEach','push','waiting','answered','unmanaged','abandoned','total','closed','disposition','talking','UserId','findOne','out','plainBody'];(function(_0x235944,_0x28f6b6){var _0x9ea0b8=function(_0x5702ef){while(--_0x5702ef){_0x235944['push'](_0x235944['shift']());}};_0x9ea0b8(++_0x28f6b6);}(_0xd8b2,0x105));var _0x2d8b=function(_0x3ef3e2,_0x55a0c3){_0x3ef3e2=_0x3ef3e2-0x0;var _0x1b11ec=_0xd8b2[_0x3ef3e2];return _0x1b11ec;};'use strict';var _=require(_0x2d8b('0x0'));var db=require(_0x2d8b('0x1'))['db'];function getInteractionUsers(_0x183ec5,_0x413b92){return new Promise(function(_0x504461,_0x3d5d54){try{var _0x5bd593=[];if(_0x413b92[_0x183ec5]){_0x5bd593=_0x413b92[_0x183ec5][_0x2d8b('0x2')](function(_0x551e1d){return{'id':_0x551e1d['id'],'fullname':_0x551e1d[_0x2d8b('0x3')]};});}return _0x504461(_0x5bd593);}catch(_0x2f34cf){_0x3d5d54(_0x2f34cf);}});}function getInteractionTags(_0x371a69,_0x32398c){var _0x141bb9=[];if(_0x371a69){_0x371a69[_0x2d8b('0x4')](',')[_0x2d8b('0x5')](function(_0x3d736e){_0x141bb9[_0x2d8b('0x6')](_0x32398c[_0x3d736e]);});}return _0x141bb9;}function updateWaitingCounter(_0x60a252){if(_0x60a252[_0x2d8b('0x7')]){_0x60a252[_0x2d8b('0x7')]-=0x1;}}function updateInteractionCounters(_0x33e14a){_0x33e14a['waiting']=0x0;_0x33e14a['talking']=0x0;_0x33e14a[_0x2d8b('0x8')]=0x0;_0x33e14a[_0x2d8b('0x9')]=0x0;_0x33e14a[_0x2d8b('0xa')]=0x0;_0x33e14a[_0x2d8b('0xb')]=0x0;if(_0x33e14a[_0x2d8b('0xc')]){if(_0x33e14a[_0x2d8b('0xd')]==='abandoned'){_0x33e14a[_0x2d8b('0xa')]+=0x1;updateWaitingCounter(_0x33e14a);}if(_0x33e14a['UserId']){_0x33e14a[_0x2d8b('0x8')]+=0x1;if(_0x33e14a[_0x2d8b('0xe')]){_0x33e14a[_0x2d8b('0xe')]-=0x1;}}else{if(_0x33e14a[_0x2d8b('0xd')]){_0x33e14a[_0x2d8b('0x9')]+=0x1;updateWaitingCounter(_0x33e14a);}}}else{if(!_0x33e14a[_0x2d8b('0xf')]){_0x33e14a[_0x2d8b('0x7')]+=0x1;}if(_0x33e14a[_0x2d8b('0xf')]){_0x33e14a[_0x2d8b('0xe')]+=0x1;updateWaitingCounter(_0x33e14a);}}_0x33e14a['total']+=0x1;return _0x33e14a;}function getLastMessageText(_0x7af733){return db['MailMessage'][_0x2d8b('0x10')]({'where':{'$and':[{'MailInteractionId':_0x7af733['id']},{'$or':[{'direction':'in'},{'$and':[{'direction':_0x2d8b('0x11')},{'secret':![]},{'UserId':{'$ne':null}}]}]}]},'attributes':[_0x2d8b('0x12')],'order':_0x2d8b('0x13'),'raw':!![]})[_0x2d8b('0x14')](function(_0x38e43f){if(_0x38e43f&&_0x38e43f[_0x2d8b('0x12')]){_0x7af733[_0x2d8b('0x15')]=_[_0x2d8b('0x16')](_0x38e43f[_0x2d8b('0x12')]);}return _0x7af733;})['catch'](function(_0x584d7c){throw _0x584d7c;});}exports[_0x2d8b('0x17')]=function(_0x6eb9f8,_0x241702,_0x8c4506,_0x4f4d82){return new Promise(function(_0x2e1f60,_0xb55577){return getInteractionUsers(_0x6eb9f8['id'],_0x8c4506)[_0x2d8b('0x14')](function(_0x5c448e){_0x6eb9f8[_0x2d8b('0x18')]=_0x5c448e;return getInteractionTags(_0x6eb9f8[_0x2d8b('0x19')],_0x241702);})[_0x2d8b('0x14')](function(_0x597e5a){_0x6eb9f8[_0x2d8b('0x1a')]=_0x597e5a;delete _0x6eb9f8['TagIds'];return updateInteractionCounters(_0x6eb9f8);})[_0x2d8b('0x14')](function(_0x22a70c){if(_0x4f4d82){return getLastMessageText(_0x22a70c);}else{return _0x22a70c;}})[_0x2d8b('0x14')](function(_0x12596d){_0x2e1f60(_0x12596d);})[_0x2d8b('0x1b')](function(_0x1d7464){_0xb55577(_0x1d7464);});});}; \ No newline at end of file diff --git a/server/components/interaction/utils.js b/server/components/interaction/utils.js index afee621..93b302b 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 _0x6c3e=['update','then','info','catch','error','exports','lodash','openchannel-interactions','../../config/logger','mail-interactions','fax-interactions','sms-interactions','chat-interactions','whatsapp-interactions','capitalize','chat','Website','Account','InteractionId','upperFirst','unknown','websites','accounts','_interactions','_interaction_has_tags','_messages','user_has_','isArray','toLowerCase','[%s]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','role','stringify','null','findOne'];(function(_0x39e821,_0x2fde60){var _0x5ce9d7=function(_0x1b79e1){while(--_0x1b79e1){_0x39e821['push'](_0x39e821['shift']());}};_0x5ce9d7(++_0x2fde60);}(_0x6c3e,0x17c));var _0xe6c3=function(_0x355238,_0x411e09){_0x355238=_0x355238-0x0;var _0x2c0977=_0x6c3e[_0x355238];return _0x2c0977;};'use strict';var _=require(_0xe6c3('0x0'));var db=require('../../mysqldb')['db'];var loggers={'openchannel':require('../../config/logger')(_0xe6c3('0x1')),'mail':require(_0xe6c3('0x2'))(_0xe6c3('0x3')),'fax':require(_0xe6c3('0x2'))(_0xe6c3('0x4')),'sms':require(_0xe6c3('0x2'))(_0xe6c3('0x5')),'chat':require(_0xe6c3('0x2'))(_0xe6c3('0x6')),'whatsapp':require(_0xe6c3('0x2'))(_0xe6c3('0x7'))};function getAccountFK(_0x45703d){return _[_0xe6c3('0x8')](_0x45703d)+(_0x45703d===_0xe6c3('0x9')?_0xe6c3('0xa'):_0xe6c3('0xb'))+'Id';}function getInteractionFK(_0xf4d4f5){return _[_0xe6c3('0x8')](_0xf4d4f5)+_0xe6c3('0xc');}function getInteractionId(_0x7e1207,_0x27b688,_0x29fe6f){if(_0x7e1207&&_0x7e1207[_[_0xe6c3('0xd')](_0x29fe6f)+_0xe6c3('0xc')]){return _0x7e1207[_[_0xe6c3('0xd')](_0x29fe6f)+'InteractionId'];}else if(_0x7e1207&&_0x7e1207['id']){return _0x7e1207['id'];}else if(_0x27b688&&_0x27b688['id']){return _0x27b688['id'];}else{return _0xe6c3('0xe');}}function getInteractionsTables(_0x1adb0d){return{'accounts':_0x1adb0d+'_'+(_0x1adb0d===_0xe6c3('0x9')?_0xe6c3('0xf'):_0xe6c3('0x10')),'interactions':_0x1adb0d+_0xe6c3('0x11'),'interactionsTags':_0x1adb0d+_0xe6c3('0x12'),'messages':_0x1adb0d+_0xe6c3('0x13'),'userInteractions':_0xe6c3('0x14')+_0x1adb0d+_0xe6c3('0x11')};}function getSelectedTags(_0x1a76ff){var _0x3cfdb5=[];if(_0x1a76ff){_0x3cfdb5=Array[_0xe6c3('0x15')](_0x1a76ff)?_0x1a76ff:[_0x1a76ff];}return _0x3cfdb5;}function log(_0x588786,_0x1cb4eb,_0x1f90d5,_0x36b684,_0x260343,_0xa2a804){loggers[_0x260343[_0xe6c3('0x16')]()][_0x588786](_0xe6c3('0x17'),_0xa2a804['toUpperCase'](),_0x1cb4eb?_0x1cb4eb['id']:null,_0x1cb4eb?_0x1cb4eb['name']:null,_0x1cb4eb?_0x1cb4eb[_0xe6c3('0x18')]:null,getInteractionId(_0x1f90d5,_0x36b684,_0x260343),_0x1f90d5?JSON[_0xe6c3('0x19')](_0x1f90d5):_0xe6c3('0x1a'));}function updateUser(_0x27a5fc,_0x40815f,_0x2bf233,_0x58f087,_0x5dbb6c){db[_['upperFirst'](_0x58f087)+'Interaction'][_0xe6c3('0x1b')]({'where':{'id':getInteractionId(_0x40815f,_0x2bf233,_0x58f087)}})['then'](function(_0x32b5c9){if(_0x32b5c9){return _0x32b5c9[_0xe6c3('0x1c')]({'UserId':_0x27a5fc?_0x27a5fc['id']:null});}})[_0xe6c3('0x1d')](function(_0x57df0a){if(_0x57df0a){log(_0xe6c3('0x1e'),_0x27a5fc,_0x40815f,_0x2bf233,_0x58f087,_0x5dbb6c);}})[_0xe6c3('0x1f')](function(){log(_0xe6c3('0x20'),_0x27a5fc,_0x40815f,_0x2bf233,_0x58f087,_0x5dbb6c);});}module[_0xe6c3('0x21')]={'getAccountFK':getAccountFK,'getInteractionFK':getInteractionFK,'getInteractionsTables':getInteractionsTables,'getSelectedTags':getSelectedTags,'updateUser':updateUser}; \ No newline at end of file +var _0x84ad=['../../config/logger','fax-interactions','chat-interactions','whatsapp-interactions','capitalize','chat','Website','Account','InteractionId','upperFirst','unknown','accounts','_interactions','_messages','user_has_','[%s]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','toUpperCase','name','role','stringify','null','Interaction','update','then','catch','error','exports','lodash','../../mysqldb'];(function(_0x343506,_0x8c64eb){var _0x5afbe0=function(_0x28e078){while(--_0x28e078){_0x343506['push'](_0x343506['shift']());}};_0x5afbe0(++_0x8c64eb);}(_0x84ad,0x120));var _0xd84a=function(_0x22ee1e,_0x3eff80){_0x22ee1e=_0x22ee1e-0x0;var _0x49a5c9=_0x84ad[_0x22ee1e];return _0x49a5c9;};'use strict';var _=require(_0xd84a('0x0'));var db=require(_0xd84a('0x1'))['db'];var loggers={'openchannel':require(_0xd84a('0x2'))('openchannel-interactions'),'mail':require('../../config/logger')('mail-interactions'),'fax':require(_0xd84a('0x2'))(_0xd84a('0x3')),'sms':require('../../config/logger')('sms-interactions'),'chat':require(_0xd84a('0x2'))(_0xd84a('0x4')),'whatsapp':require(_0xd84a('0x2'))(_0xd84a('0x5'))};function getAccountFK(_0x4a3af6){return _[_0xd84a('0x6')](_0x4a3af6)+(_0x4a3af6===_0xd84a('0x7')?_0xd84a('0x8'):_0xd84a('0x9'))+'Id';}function getInteractionFK(_0x157141){return _[_0xd84a('0x6')](_0x157141)+_0xd84a('0xa');}function getInteractionId(_0x32a2fa,_0x2009e1,_0x2f3055){if(_0x32a2fa&&_0x32a2fa[_['upperFirst'](_0x2f3055)+'InteractionId']){return _0x32a2fa[_[_0xd84a('0xb')](_0x2f3055)+_0xd84a('0xa')];}else if(_0x32a2fa&&_0x32a2fa['id']){return _0x32a2fa['id'];}else if(_0x2009e1&&_0x2009e1['id']){return _0x2009e1['id'];}else{return _0xd84a('0xc');}}function getInteractionsTables(_0x530a22){return{'accounts':_0x530a22+'_'+(_0x530a22==='chat'?'websites':_0xd84a('0xd')),'interactions':_0x530a22+_0xd84a('0xe'),'interactionsTags':_0x530a22+'_interaction_has_tags','messages':_0x530a22+_0xd84a('0xf'),'userInteractions':_0xd84a('0x10')+_0x530a22+_0xd84a('0xe')};}function getSelectedTags(_0x32b9f1){var _0x38957d=[];if(_0x32b9f1){_0x38957d=Array['isArray'](_0x32b9f1)?_0x32b9f1:[_0x32b9f1];}return _0x38957d;}function log(_0x280b2c,_0x3e00ed,_0x30e5ce,_0x270edf,_0x3b42d8,_0x43fc18){loggers[_0x3b42d8['toLowerCase']()][_0x280b2c](_0xd84a('0x11'),_0x43fc18[_0xd84a('0x12')](),_0x3e00ed?_0x3e00ed['id']:null,_0x3e00ed?_0x3e00ed[_0xd84a('0x13')]:null,_0x3e00ed?_0x3e00ed[_0xd84a('0x14')]:null,getInteractionId(_0x30e5ce,_0x270edf,_0x3b42d8),_0x30e5ce?JSON[_0xd84a('0x15')](_0x30e5ce):_0xd84a('0x16'));}function updateUser(_0x12ba92,_0x4f2724,_0x454882,_0x226991,_0x4efbbd){db[_[_0xd84a('0xb')](_0x226991)+_0xd84a('0x17')]['findOne']({'where':{'id':getInteractionId(_0x4f2724,_0x454882,_0x226991)}})['then'](function(_0x48da2f){if(_0x48da2f){return _0x48da2f[_0xd84a('0x18')]({'UserId':_0x12ba92?_0x12ba92['id']:null});}})[_0xd84a('0x19')](function(_0x9b6495){if(_0x9b6495){log('info',_0x12ba92,_0x4f2724,_0x454882,_0x226991,_0x4efbbd);}})[_0xd84a('0x1a')](function(){log(_0xd84a('0x1b'),_0x12ba92,_0x4f2724,_0x454882,_0x226991,_0x4efbbd);});}module[_0xd84a('0x1c')]={'getAccountFK':getAccountFK,'getInteractionFK':getInteractionFK,'getInteractionsTables':getInteractionsTables,'getSelectedTags':getSelectedTags,'updateUser':updateUser}; \ No newline at end of file diff --git a/server/components/license/service.js b/server/components/license/service.js index 8d0a9c1..bb4d1d5 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 _0x2452=['parse','use','findOne','then','status','json','Maximum\x20%s\x20limit\x20have\x20been\x20reached','catch','users','User','user','isUserLimit','crypto','util','composable-middleware','data1','license','createDecipher','format','%s:%s:%s','update','base64','utf8','final'];(function(_0x31b534,_0xad3938){var _0x479c64=function(_0x157ce1){while(--_0x157ce1){_0x31b534['push'](_0x31b534['shift']());}};_0x479c64(++_0xad3938);}(_0x2452,0x1bc));var _0x2245=function(_0x875110,_0x7873af){_0x875110=_0x875110-0x0;var _0x39758a=_0x2452[_0x875110];return _0x39758a;};'use strict';var crypto=require(_0x2245('0x0'));var util=require(_0x2245('0x1'));var compose=require(_0x2245('0x2'));var db=require('../../mysqldb')['db'];var config=require('../../config/environment');function getValueFromLicense(_0x28d3e2,_0x2f9449){if(_0x28d3e2&&_0x2f9449){if(_0x2f9449[_0x2245('0x3')]&&_0x2f9449[_0x2245('0x4')]){var _0x2c6a3d=_0x2f9449[_0x2245('0x3')];var _0x532cdb=_0x2f9449[_0x2245('0x4')];var _0x277e9b=_0x2c6a3d['split']('-')[0x4];var _0x622c53=_0x2c6a3d['split']('-')[0x0];var _0xab9262=crypto[_0x2245('0x5')]('aes-256-ctr',util[_0x2245('0x6')](_0x2245('0x7'),_0x277e9b,_0x2c6a3d,_0x622c53));var _0x584557=_0xab9262[_0x2245('0x8')](_0x532cdb,_0x2245('0x9'),_0x2245('0xa'));_0x584557+=_0xab9262[_0x2245('0xb')](_0x2245('0xa'));var _0x3e08f4=JSON[_0x2245('0xc')](_0x584557);return _0x3e08f4['hasOwnProperty'](_0x28d3e2)?_0x3e08f4[_0x28d3e2]:null;}}return null;}function isLimit(_0x2eb4e4,_0x571d69,_0x1afaeb,_0x38a155){var _0x4a76e9=_0x571d69;return compose()[_0x2245('0xd')](function(_0x123a53,_0x3f7001,_0xae4f6c){return db['License'][_0x2245('0xe')]({'where':{'id':0x1},'raw':!![]})[_0x2245('0xf')](function(_0x170044){var _0x16ac66=getValueFromLicense(_0x2eb4e4,_0x170044);return _0x16ac66?_0x16ac66:_0x4a76e9;})[_0x2245('0xf')](function(_0x23977f){_0x4a76e9=_0x23977f;return _0x1afaeb['count'](_0x38a155);})[_0x2245('0xf')](function(_0x274cb0){if(_0x274cb0>=_0x4a76e9){return _0x3f7001[_0x2245('0x10')](0x193)[_0x2245('0x11')]({'message':util['format'](_0x2245('0x12'),_0x2eb4e4)});}_0xae4f6c();})[_0x2245('0x13')](function(_0x57d683){_0xae4f6c(_0x57d683);});});}function isUserLimit(){return isLimit(_0x2245('0x14'),0x1,db[_0x2245('0x15')],{'where':{'$or':[{'role':'admin'},{'role':_0x2245('0x16')}]}});}exports[_0x2245('0x17')]=isUserLimit; \ No newline at end of file +var _0x8b2e=['createDecipher','aes-256-ctr','format','%s:%s:%s','update','utf8','final','parse','hasOwnProperty','use','License','findOne','then','status','json','Maximum\x20%s\x20limit\x20have\x20been\x20reached','catch','users','User','admin','user','isUserLimit','util','../../mysqldb','license','data1','split'];(function(_0x5cd6a6,_0x271c14){var _0xd9a113=function(_0xbc8924){while(--_0xbc8924){_0x5cd6a6['push'](_0x5cd6a6['shift']());}};_0xd9a113(++_0x271c14);}(_0x8b2e,0x124));var _0xe8b2=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x8b2e[_0x3dd15e];return _0x231fd0;};'use strict';var crypto=require('crypto');var util=require(_0xe8b2('0x0'));var compose=require('composable-middleware');var db=require(_0xe8b2('0x1'))['db'];var config=require('../../config/environment');function getValueFromLicense(_0x493557,_0x4991fa){if(_0x493557&&_0x4991fa){if(_0x4991fa['data1']&&_0x4991fa[_0xe8b2('0x2')]){var _0x22ad1c=_0x4991fa[_0xe8b2('0x3')];var _0x2a42ef=_0x4991fa['license'];var _0xc2d096=_0x22ad1c[_0xe8b2('0x4')]('-')[0x4];var _0x2069f7=_0x22ad1c[_0xe8b2('0x4')]('-')[0x0];var _0x4aff19=crypto[_0xe8b2('0x5')](_0xe8b2('0x6'),util[_0xe8b2('0x7')](_0xe8b2('0x8'),_0xc2d096,_0x22ad1c,_0x2069f7));var _0x12fe85=_0x4aff19[_0xe8b2('0x9')](_0x2a42ef,'base64',_0xe8b2('0xa'));_0x12fe85+=_0x4aff19[_0xe8b2('0xb')](_0xe8b2('0xa'));var _0x455753=JSON[_0xe8b2('0xc')](_0x12fe85);return _0x455753[_0xe8b2('0xd')](_0x493557)?_0x455753[_0x493557]:null;}}return null;}function isLimit(_0x32be22,_0x36c64a,_0x4f1c16,_0x2406b8){var _0x139c18=_0x36c64a;return compose()[_0xe8b2('0xe')](function(_0x28ae53,_0x64ef37,_0xfb87c9){return db[_0xe8b2('0xf')][_0xe8b2('0x10')]({'where':{'id':0x1},'raw':!![]})[_0xe8b2('0x11')](function(_0x5dc4d8){var _0x12c432=getValueFromLicense(_0x32be22,_0x5dc4d8);return _0x12c432?_0x12c432:_0x139c18;})[_0xe8b2('0x11')](function(_0x1aa883){_0x139c18=_0x1aa883;return _0x4f1c16['count'](_0x2406b8);})[_0xe8b2('0x11')](function(_0x3246a5){if(_0x3246a5>=_0x139c18){return _0x64ef37[_0xe8b2('0x12')](0x193)[_0xe8b2('0x13')]({'message':util[_0xe8b2('0x7')](_0xe8b2('0x14'),_0x32be22)});}_0xfb87c9();})[_0xe8b2('0x15')](function(_0x5f4fef){_0xfb87c9(_0x5f4fef);});});}function isUserLimit(){return isLimit(_0xe8b2('0x16'),0x1,db[_0xe8b2('0x17')],{'where':{'$or':[{'role':_0xe8b2('0x18')},{'role':_0xe8b2('0x19')}]}});}exports[_0xe8b2('0x1a')]=isUserLimit; \ No newline at end of file diff --git a/server/components/parsers/advancedSearch.js b/server/components/parsers/advancedSearch.js index 6f55818..f0edf4b 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 _0xd5aa=['field','\x20AS\x20','castTo','$ne','\x20OR\x20','\x20IS\x20NULL)','$in','IN\x20?','$notIn','NOT\x20IN\x20?','=\x20?','$endsWith','LIKE\x20?','$lt','<\x20?','>\x20?','<=\x20?','$gte','>=\x20?','BETWEEN\x20?\x20AND\x20?','start','$substring','$startsWith','utcOffset','minutes','seconds','lodash','moment','parseSearch','sqlOperator','startsWith','and','[$and]','replace','[$or]','split','length','forEach','shift','match','filter','indexOf','map','conditions','push','buildExpression','DATE','$eq','operator','$between','value','includes','$gt','$lte','add','days','format','YYYY-MM-DD','text','CAST('];(function(_0x478de7,_0x3deb50){var _0x290cbd=function(_0x56821b){while(--_0x56821b){_0x478de7['push'](_0x478de7['shift']());}};_0x290cbd(++_0x3deb50);}(_0xd5aa,0x146));var _0xad5a=function(_0x20964f,_0x4b819d){_0x20964f=_0x20964f-0x0;var _0x1b2df4=_0xd5aa[_0x20964f];return _0x1b2df4;};'use strict';var _=require(_0xad5a('0x0'));var moment=require(_0xad5a('0x1'));exports[_0xad5a('0x2')]=function(_0x35b091){var _0x2d86b5={'conditions':[]};_0x2d86b5[_0xad5a('0x3')]=_[_0xad5a('0x4')](_0x35b091,'[$or]')?'or':_0xad5a('0x5');var _0x35e601=_0x35b091['replace'](_0xad5a('0x6'),'')[_0xad5a('0x7')](_0xad5a('0x8'),'')[_0xad5a('0x9')]('||');for(var _0x1bd1ad=0x0;_0x1bd1ad<_0x35e601[_0xad5a('0xa')];_0x1bd1ad++){var _0x1ab0ce=_0x35e601[_0x1bd1ad]['split'](':=');var _0x194189=_0x1ab0ce[0x0];var _0x157911=_0x1ab0ce['slice'](0x1);_0x157911[_0xad5a('0xb')](function(_0x427647){var _0xde39bd=_0x427647[_0xad5a('0x9')]('[')[_0xad5a('0xc')]();var _0x24dc72=_0x427647[_0xad5a('0xd')](/\[(.*?)\]/g);_0x24dc72['forEach'](function(_0x3a7a92){var _0x7d4246=_0x3a7a92[_0xad5a('0x9')]('[')[_0xad5a('0xe')](function(_0x37a147){return _0x37a147[_0xad5a('0xf')](']')>-0x1;})[_0xad5a('0x10')](function(_0x5a37ad){return _0x5a37ad[_0xad5a('0x9')](']')[0x0];})[0x0];_0x2d86b5[_0xad5a('0x11')][_0xad5a('0x12')]({'field':_0x194189,'operator':_0xde39bd,'value':_0x7d4246});});});}return _0x2d86b5;};exports[_0xad5a('0x13')]=function(_0x578fb3,_0x558f8c,_0x19a238){var _0x42de92={};if(_0x558f8c===_0xad5a('0x14')){if(_0x19a238['operator']===_0xad5a('0x15')){_0x19a238[_0xad5a('0x16')]=_0xad5a('0x17');_0x19a238['value']+=','+_0x19a238[_0xad5a('0x18')];}else if(_[_0xad5a('0x19')]([_0xad5a('0x1a'),_0xad5a('0x1b')],_0x19a238[_0xad5a('0x16')])){_0x19a238[_0xad5a('0x18')]=moment(_0x19a238[_0xad5a('0x18')])[_0xad5a('0x1c')](0x1,_0xad5a('0x1d'))[_0xad5a('0x1e')](_0xad5a('0x1f'));}}if(_0x19a238['castTo']){_0x558f8c=_0x19a238['castTo'];_0x42de92[_0xad5a('0x20')]=_0xad5a('0x21')+_0x578fb3+'.'+_0x19a238[_0xad5a('0x22')]+_0xad5a('0x23')+_0x19a238[_0xad5a('0x24')]+')\x20'+parseOperator(_0x19a238['operator']);}else{_0x42de92['text']=_0x578fb3+'.'+_0x19a238['field']+'\x20'+parseOperator(_0x19a238[_0xad5a('0x16')]);}if(_['includes']([_0xad5a('0x25'),'$notIn'],_0x19a238['operator']))_0x42de92['text']='('+_0x42de92[_0xad5a('0x20')]+_0xad5a('0x26')+_0x578fb3+'.'+_0x19a238['field']+_0xad5a('0x27');_0x42de92[_0xad5a('0x18')]=parseValue(_0x558f8c,_0x19a238[_0xad5a('0x16')],_0x19a238[_0xad5a('0x18')]);return _0x42de92;};function parseOperator(_0x4f0cb6){var _0x174175;switch(_0x4f0cb6){case _0xad5a('0x28'):_0x174175=_0xad5a('0x29');break;case _0xad5a('0x2a'):_0x174175=_0xad5a('0x2b');break;case _0xad5a('0x15'):_0x174175=_0xad5a('0x2c');break;case _0xad5a('0x25'):_0x174175='<>\x20?';break;case'$substring':case'$startsWith':case _0xad5a('0x2d'):_0x174175=_0xad5a('0x2e');break;case _0xad5a('0x2f'):_0x174175=_0xad5a('0x30');break;case _0xad5a('0x1a'):_0x174175=_0xad5a('0x31');break;case _0xad5a('0x1b'):_0x174175=_0xad5a('0x32');break;case _0xad5a('0x33'):_0x174175=_0xad5a('0x34');break;case _0xad5a('0x17'):_0x174175=_0xad5a('0x35');break;}return _0x174175;}function parseValue(_0x4021f4,_0x3b0cd6,_0x4d5f7b){var _0x3ee753={'start':undefined,'end':undefined};switch(_0x3b0cd6){case _0xad5a('0x28'):case _0xad5a('0x2a'):_0x3ee753[_0xad5a('0x36')]=_0x4d5f7b[_0xad5a('0x9')](',');break;case _0xad5a('0x37'):_0x3ee753['start']='%'+_0x4d5f7b+'%';break;case _0xad5a('0x38'):_0x3ee753[_0xad5a('0x36')]=_0x4d5f7b+'%';break;case _0xad5a('0x2d'):_0x3ee753[_0xad5a('0x36')]='%'+_0x4d5f7b;break;case'$between':var _0x34db96=_0x4d5f7b[_0xad5a('0x9')](',');var _0x4d5f7b=_0x34db96[_0xad5a('0xc')]();var _0x53976f=_0x34db96['pop']();if(_0x4021f4==='DATE'){_0x4d5f7b=moment(_0x4d5f7b)[_0xad5a('0x39')](0x0,!![])['format']();_0x53976f=moment(_0x53976f)['utcOffset'](0x0,!![])[_0xad5a('0x1c')](0x17,'hours')[_0xad5a('0x1c')](0x3b,_0xad5a('0x3a'))[_0xad5a('0x1c')](0x3b,_0xad5a('0x3b'))[_0xad5a('0x1e')]();}_0x3ee753={'start':_0x4d5f7b,'end':_0x53976f};break;default:_0x3ee753[_0xad5a('0x36')]=_0x4d5f7b;break;}return _0x3ee753;} \ No newline at end of file +var _0x615f=['$lte','add','format','YYYY-MM-DD','castTo','text','CAST(','field','\x20AS\x20','$ne','$notIn','\x20OR\x20','IN\x20?','NOT\x20IN\x20?','=\x20?','<>\x20?','$substring','$startsWith','$lt','<\x20?','>\x20?','<=\x20?','$gte','>=\x20?','BETWEEN\x20?\x20AND\x20?','start','$endsWith','pop','utcOffset','hours','minutes','seconds','lodash','sqlOperator','[$or]','and','replace','split','length','slice','forEach','shift','indexOf','map','conditions','buildExpression','DATE','operator','$eq','$between','value','includes','$gt'];(function(_0x266856,_0x2b24ae){var _0x24e27c=function(_0x11ff4f){while(--_0x11ff4f){_0x266856['push'](_0x266856['shift']());}};_0x24e27c(++_0x2b24ae);}(_0x615f,0xbf));var _0xf615=function(_0x286bd5,_0x3dd725){_0x286bd5=_0x286bd5-0x0;var _0x16efa9=_0x615f[_0x286bd5];return _0x16efa9;};'use strict';var _=require(_0xf615('0x0'));var moment=require('moment');exports['parseSearch']=function(_0x88af3c){var _0x534c9d={'conditions':[]};_0x534c9d[_0xf615('0x1')]=_['startsWith'](_0x88af3c,_0xf615('0x2'))?'or':_0xf615('0x3');var _0x48481b=_0x88af3c[_0xf615('0x4')]('[$and]','')[_0xf615('0x4')](_0xf615('0x2'),'')[_0xf615('0x5')]('||');for(var _0x496a7c=0x0;_0x496a7c<_0x48481b[_0xf615('0x6')];_0x496a7c++){var _0x3bf22e=_0x48481b[_0x496a7c][_0xf615('0x5')](':=');var _0xe1d34b=_0x3bf22e[0x0];var _0x4b82da=_0x3bf22e[_0xf615('0x7')](0x1);_0x4b82da[_0xf615('0x8')](function(_0xc6aae2){var _0xbc021c=_0xc6aae2[_0xf615('0x5')]('[')[_0xf615('0x9')]();var _0x10eadd=_0xc6aae2['match'](/\[(.*?)\]/g);_0x10eadd[_0xf615('0x8')](function(_0x5b527e){var _0x11529f=_0x5b527e[_0xf615('0x5')]('[')['filter'](function(_0x59a401){return _0x59a401[_0xf615('0xa')](']')>-0x1;})[_0xf615('0xb')](function(_0x41aa22){return _0x41aa22[_0xf615('0x5')](']')[0x0];})[0x0];_0x534c9d[_0xf615('0xc')]['push']({'field':_0xe1d34b,'operator':_0xbc021c,'value':_0x11529f});});});}return _0x534c9d;};exports[_0xf615('0xd')]=function(_0x15de42,_0x7abf9d,_0x2d288e){var _0x53e409={};if(_0x7abf9d===_0xf615('0xe')){if(_0x2d288e[_0xf615('0xf')]===_0xf615('0x10')){_0x2d288e['operator']=_0xf615('0x11');_0x2d288e[_0xf615('0x12')]+=','+_0x2d288e[_0xf615('0x12')];}else if(_[_0xf615('0x13')]([_0xf615('0x14'),_0xf615('0x15')],_0x2d288e[_0xf615('0xf')])){_0x2d288e['value']=moment(_0x2d288e['value'])[_0xf615('0x16')](0x1,'days')[_0xf615('0x17')](_0xf615('0x18'));}}if(_0x2d288e['castTo']){_0x7abf9d=_0x2d288e[_0xf615('0x19')];_0x53e409[_0xf615('0x1a')]=_0xf615('0x1b')+_0x15de42+'.'+_0x2d288e[_0xf615('0x1c')]+_0xf615('0x1d')+_0x2d288e['castTo']+')\x20'+parseOperator(_0x2d288e[_0xf615('0xf')]);}else{_0x53e409[_0xf615('0x1a')]=_0x15de42+'.'+_0x2d288e[_0xf615('0x1c')]+'\x20'+parseOperator(_0x2d288e['operator']);}if(_[_0xf615('0x13')]([_0xf615('0x1e'),_0xf615('0x1f')],_0x2d288e['operator']))_0x53e409[_0xf615('0x1a')]='('+_0x53e409['text']+_0xf615('0x20')+_0x15de42+'.'+_0x2d288e[_0xf615('0x1c')]+'\x20IS\x20NULL)';_0x53e409[_0xf615('0x12')]=parseValue(_0x7abf9d,_0x2d288e['operator'],_0x2d288e['value']);return _0x53e409;};function parseOperator(_0x32ad17){var _0x351ce9;switch(_0x32ad17){case'$in':_0x351ce9=_0xf615('0x21');break;case'$notIn':_0x351ce9=_0xf615('0x22');break;case'$eq':_0x351ce9=_0xf615('0x23');break;case _0xf615('0x1e'):_0x351ce9=_0xf615('0x24');break;case _0xf615('0x25'):case _0xf615('0x26'):case'$endsWith':_0x351ce9='LIKE\x20?';break;case _0xf615('0x27'):_0x351ce9=_0xf615('0x28');break;case _0xf615('0x14'):_0x351ce9=_0xf615('0x29');break;case'$lte':_0x351ce9=_0xf615('0x2a');break;case _0xf615('0x2b'):_0x351ce9=_0xf615('0x2c');break;case'$between':_0x351ce9=_0xf615('0x2d');break;}return _0x351ce9;}function parseValue(_0x40511f,_0xfaa5ab,_0x3bf386){var _0x16ece3={'start':undefined,'end':undefined};switch(_0xfaa5ab){case'$in':case _0xf615('0x1f'):_0x16ece3[_0xf615('0x2e')]=_0x3bf386[_0xf615('0x5')](',');break;case _0xf615('0x25'):_0x16ece3[_0xf615('0x2e')]='%'+_0x3bf386+'%';break;case _0xf615('0x26'):_0x16ece3[_0xf615('0x2e')]=_0x3bf386+'%';break;case _0xf615('0x2f'):_0x16ece3['start']='%'+_0x3bf386;break;case _0xf615('0x11'):var _0x5e9a57=_0x3bf386[_0xf615('0x5')](',');var _0x3bf386=_0x5e9a57['shift']();var _0x3b2cf5=_0x5e9a57[_0xf615('0x30')]();if(_0x40511f===_0xf615('0xe')){_0x3bf386=moment(_0x3bf386)[_0xf615('0x31')](0x0,!![])[_0xf615('0x17')]();_0x3b2cf5=moment(_0x3b2cf5)[_0xf615('0x31')](0x0,!![])[_0xf615('0x16')](0x17,_0xf615('0x32'))[_0xf615('0x16')](0x3b,_0xf615('0x33'))[_0xf615('0x16')](0x3b,_0xf615('0x34'))[_0xf615('0x17')]();}_0x16ece3={'start':_0x3bf386,'end':_0x3b2cf5};break;default:_0x16ece3['start']=_0x3bf386;break;}return _0x16ece3;} \ No newline at end of file diff --git a/server/components/parsers/qs.js b/server/components/parsers/qs.js index 2fc961a..21cce60 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 _0x370d=['\x22{EXPR}\x22','forEach','replace','{EXPR}','query','intersection','attributes','limit','order','where','filter','object','columns','merge','VIRTUAL','lower','options','includeAll','push','include','lodash','moment','parse','keys','includes','model','alias','fields','raw','split','filters','forOwn','find','DATE','isPlainObject','$gte','format','YYYY-MM-DD','utc','$lte','subtract','name','uniqueid','isArray','offset','sort','map','indexOf','priority','col','unsigned','DESC','ASC','isEmpty','length','omit','isObject','isString','unset','isNumeric','match','^[+]?[0-9]*$','isEmail','getFullTextValue'];(function(_0xf402ce,_0x4a7b32){var _0x46c801=function(_0x3e535b){while(--_0x3e535b){_0xf402ce['push'](_0xf402ce['shift']());}};_0x46c801(++_0x4a7b32);}(_0x370d,0x194));var _0xd370=function(_0x367c53,_0x524366){_0x367c53=_0x367c53-0x0;var _0x4019f5=_0x370d[_0x367c53];return _0x4019f5;};'use strict';var _=require(_0xd370('0x0'));var sequelize=require('sequelize');var moment=require(_0xd370('0x1'));var db=require('../../mysqldb')['db'];var LIMIT_VALUE=0xfa;function hasSequelizeOperator(_0x293167){var _0x27928b=['ne'];try{var _0xb556a3=JSON[_0xd370('0x2')](_0x293167);var _0x1af247=Object[_0xd370('0x3')](_0xb556a3)[0x0];return _0x27928b[_0xd370('0x4')](_0x1af247);}catch(_0x34e8f0){return![];}}function getOperatorValue(_0xe2940d){var _0x516e57=JSON[_0xd370('0x2')](_0xe2940d);var _0x1f748d=Object['keys'](_0x516e57)[0x0];var _0x3b7eb0=_0x516e57[_0x1f748d];return{['$'+_0x1f748d]:_0x3b7eb0};}function parseIncludeModel(_0x4d2b15){var _0x3e9235=JSON[_0xd370('0x2')](_0x4d2b15);return{'model':db[_0x3e9235[_0xd370('0x5')]],'as':_0x3e9235[_0xd370('0x6')],'attributes':_0x3e9235[_0xd370('0x7')],'raw':_0x3e9235[_0xd370('0x8')]};}exports[_0xd370('0x7')]=function(_0x5f49be){var _0x24fc2c=null;if(_0x5f49be){_0x24fc2c=_0x5f49be[_0xd370('0x9')](',');}return _0x24fc2c;};exports[_0xd370('0xa')]=function(_0xabc330,_0x1007b4){var _0x271404={};if(!_['isEmpty'](_0xabc330)){_[_0xd370('0xb')](_0xabc330,function(_0x15ec10,_0x34860f){try{if(_0x1007b4){var _0x2c0daf=_[_0xd370('0xc')](_0x1007b4,{'name':_0x34860f})||{};if(hasSequelizeOperator(_0x15ec10)){_0x271404[_0x34860f]=getOperatorValue(_0x15ec10);}else if(_0x2c0daf['type']===_0xd370('0xd')&&_[_0xd370('0xe')](_0x15ec10)){var _0x18f9ff=JSON[_0xd370('0x2')](_0x15ec10);var _0x549356={'$gte':moment(moment(_0x18f9ff[_0xd370('0xf')])[_0xd370('0x10')](_0xd370('0x11')))[_0xd370('0x12')]()[_0xd370('0x10')](),'$lte':moment(moment(_0x18f9ff[_0xd370('0x13')])['format'](_0xd370('0x11')))['utc']()[_0xd370('0x14')](0x1,'s')[_0xd370('0x10')]()};_0x271404[_0x34860f]=_0x549356;}else if(_0x2c0daf[_0xd370('0x15')]===_0xd370('0x16')){_0x271404[_0x34860f]=_0x15ec10;}else{_0x271404[_0x34860f]=_[_0xd370('0x17')](_0x15ec10)?_0x15ec10:JSON[_0xd370('0x2')](_0x15ec10);}}else{_0x271404[_0x34860f]=_[_0xd370('0x17')](_0x15ec10)?_0x15ec10:JSON[_0xd370('0x2')](_0x15ec10);}}catch(_0x44670e){_0x271404[_0x34860f]=_0x15ec10[_0xd370('0x9')](',');}});}return _0x271404;};exports['limit']=function(_0x19c6e5){_0x19c6e5=parseInt(_0x19c6e5,0xa);if(!_0x19c6e5||_0x19c6e5<0x0){_0x19c6e5=LIMIT_VALUE;}return _0x19c6e5;};exports[_0xd370('0x18')]=function(_0x40e494){_0x40e494=parseInt(_0x40e494,0xa);if(!_0x40e494||_0x40e494<0x0){_0x40e494=0x0;}return _0x40e494;};exports[_0xd370('0x19')]=function(_0x450e28){var _0x44464e,_0x251436=null;if(_0x450e28){_0x44464e=_0x450e28[_0xd370('0x9')](',');_0x251436=_[_0xd370('0x1a')](_0x44464e,function(_0x26b594){if(_0x26b594[_0xd370('0x1b')]('-')===0x0){return[_0x26b594===_0xd370('0x1c')?sequelize['cast'](sequelize[_0xd370('0x1d')]('priority'),_0xd370('0x1e')):_0x26b594['substr'](0x1),_0xd370('0x1f')];}else{return[_0x26b594===_0xd370('0x1c')?sequelize['cast'](sequelize[_0xd370('0x1d')]('priority'),_0xd370('0x1e')):_0x26b594,_0xd370('0x20')];}});}return _0x251436;};exports['omit']=function(_0x525b8f,_0x4cee28){if(_[_0xd370('0x21')](_0x525b8f)){return _0x525b8f;}if(_[_0xd370('0x17')](_0x525b8f)){for(var _0x5d6b4d=0x0;_0x5d6b4d<_0x525b8f[_0xd370('0x22')];_0x5d6b4d+=0x1){_0x525b8f[_0x5d6b4d]=this[_0xd370('0x23')](_0x525b8f[_0x5d6b4d],_0x4cee28);}return _0x525b8f;}if(!_[_0xd370('0x24')](_0x525b8f)){return _0x525b8f;}if(_[_0xd370('0x25')](_0x4cee28)){_0x4cee28=[_0x4cee28];}if(!_['isArray'](_0x4cee28)){return _0x525b8f;}for(var _0x547851=0x0;_0x547851<_0x4cee28[_0xd370('0x22')];_0x547851+=0x1){_[_0xd370('0x26')](_0x525b8f,_0x4cee28[_0x547851]);}for(var _0x5d58a1 in _0x525b8f){if(_0x525b8f['hasOwnProperty'](_0x5d58a1)){_0x525b8f[_0x5d58a1]=this[_0xd370('0x23')](_0x525b8f[_0x5d58a1],_0x4cee28);}}return _0x525b8f;};exports[_0xd370('0x27')]=function(_0x2823fb){return _0x2823fb[_0xd370('0x28')](RegExp(_0xd370('0x29')))?!![]:![];};exports[_0xd370('0x2a')]=function(_0x4f86bf){return _0x4f86bf['match'](/^\S+@\S+$/)?!![]:![];};exports[_0xd370('0x2b')]=function(_0x173a39,_0x4a7371){var _0x1f4091=[];var _0x374a38=/[ `!@#$%^&*()_\-?~]/;var _0x5aaf4d=_0x4a7371?_0xd370('0x2c'):'{EXPR}';_0x173a39[_0xd370('0x9')](/[ ,]+/)[_0xd370('0x2d')](function(_0x56e4e4){_0x56e4e4=_0x56e4e4[_0xd370('0x2e')](/([^:]")"+/g,'$1');_0x56e4e4='+'+_0x56e4e4+'*';var _0x41c909=_0x56e4e4[_0xd370('0x28')](_0x374a38);if(_0x41c909){_0x56e4e4='\x22'+_0x56e4e4+'\x22';}_0x1f4091['push'](_0x56e4e4);});_0x5aaf4d=_0x5aaf4d[_0xd370('0x2e')](_0xd370('0x2f'),_0x1f4091['join']('\x20'));return _0x5aaf4d;};exports['getOptions']=function(_0x2cf49b,_0x5a1750,_0x28c67a){var _0x3e7cf5={},_0x567a26={};if(_0x5a1750[_0xd370('0x30')]['$id']){_0x5a1750['query']['id']=_0x5a1750[_0xd370('0x30')]['$id'];delete _0x5a1750['query']['$id'];}_0x3e7cf5['model']=_[_0xd370('0x1a')](_0x2cf49b,'name');_0x3e7cf5[_0xd370('0x30')]=_[_0xd370('0x3')](_0x5a1750[_0xd370('0x30')]);_0x3e7cf5['filters']=_[_0xd370('0x31')](_0x3e7cf5[_0xd370('0x5')],_0x3e7cf5['query']);_0x567a26[_0xd370('0x32')]=_[_0xd370('0x31')](_0x3e7cf5['model'],this[_0xd370('0x7')](_0x5a1750[_0xd370('0x30')]['fields']));_0x567a26[_0xd370('0x32')]=_0x567a26['attributes'][_0xd370('0x22')]?_0x567a26[_0xd370('0x32')]:_0x3e7cf5[_0xd370('0x5')];if(!_0x5a1750['query']['hasOwnProperty']('nolimit')){_0x567a26[_0xd370('0x33')]=this['limit'](_0x5a1750['query'][_0xd370('0x33')]);_0x567a26[_0xd370('0x18')]=this[_0xd370('0x18')](_0x5a1750[_0xd370('0x30')][_0xd370('0x18')]);}_0x567a26[_0xd370('0x34')]=this[_0xd370('0x19')](_0x5a1750[_0xd370('0x30')]['sort']);_0x567a26[_0xd370('0x35')]=this['filters'](_['pick'](_0x5a1750[_0xd370('0x30')],_0x3e7cf5[_0xd370('0xa')]),_0x2cf49b);if(_0x5a1750[_0xd370('0x30')][_0xd370('0x36')]){var _0x2182a0=_0x2cf49b;var _0x309940=_0x5a1750[_0xd370('0x30')]['filter'];if(typeof _0x309940===_0xd370('0x37')){_0x2182a0=_['filter'](_0x2cf49b,function(_0x37e176){return _['includes'](_0x309940[_0xd370('0x38')],_0x37e176[_0xd370('0x15')]);});_0x309940=_0x309940['value'];}_0x567a26[_0xd370('0x35')]=_[_0xd370('0x39')](_0x567a26[_0xd370('0x35')],{'$or':_['map'](_0x2182a0,function(_0x3a255e){if(_0x3a255e['type']!==_0xd370('0x3a')){if(_0x28c67a){return sequelize[_0xd370('0x35')](sequelize['fn'](_0xd370('0x3b'),sequelize[_0xd370('0x1d')](_0x3a255e[_0xd370('0x15')])),{'$like':sequelize['fn'](_0xd370('0x3b'),'%'+_0x5a1750[_0xd370('0x30')]['filter']+'%')});}else{var _0xa1a55d={};_0xa1a55d[_0x3a255e[_0xd370('0x15')]]={'$like':'%'+_0x5a1750[_0xd370('0x30')][_0xd370('0x36')]+'%'};return _0xa1a55d;}}})});}_0x567a26=_['merge']({},_0x567a26,_0x5a1750[_0xd370('0x3c')]);return _0x567a26;};exports['include']=function(_0x5be001){var _0x18ec03=[];if(_0x5be001[_0xd370('0x3d')]){_0x18ec03[_0xd370('0x3e')]({'all':!![]});}else if(_0x5be001[_0xd370('0x3f')]){if(Array[_0xd370('0x17')](_0x5be001[_0xd370('0x3f')])){_0x18ec03=Object[_0xd370('0x3')](_0x5be001[_0xd370('0x3f')])[_0xd370('0x1a')](function(_0x5c95ce){return parseIncludeModel(_0x5be001[_0xd370('0x3f')][_0x5c95ce]);});}else{var _0x5c01f1=parseIncludeModel(_0x5be001['include']);_0x18ec03['push'](_0x5c01f1);}}return _0x18ec03;}; \ No newline at end of file +var _0xaffe=['omit','isString','unset','hasOwnProperty','isNumeric','isEmail','getFullTextValue','\x22{EXPR}\x22','push','replace','{EXPR}','join','query','$id','name','intersection','attributes','nolimit','offset','order','filter','object','columns','value','where','merge','VIRTUAL','lower','include','lodash','sequelize','moment','parse','keys','includes','model','alias','fields','raw','split','filters','isEmpty','forOwn','find','type','DATE','isPlainObject','utc','format','$lte','YYYY-MM-DD','isArray','limit','sort','map','indexOf','priority','cast','col','substr','unsigned','ASC','length'];(function(_0x254ee7,_0x9bba53){var _0x19486c=function(_0x4e9276){while(--_0x4e9276){_0x254ee7['push'](_0x254ee7['shift']());}};_0x19486c(++_0x9bba53);}(_0xaffe,0x158));var _0xeaff=function(_0x218ff8,_0x36db2b){_0x218ff8=_0x218ff8-0x0;var _0x81d465=_0xaffe[_0x218ff8];return _0x81d465;};'use strict';var _=require(_0xeaff('0x0'));var sequelize=require(_0xeaff('0x1'));var moment=require(_0xeaff('0x2'));var db=require('../../mysqldb')['db'];var LIMIT_VALUE=0xfa;function hasSequelizeOperator(_0x3cd138){var _0x414275=['ne'];try{var _0x386975=JSON[_0xeaff('0x3')](_0x3cd138);var _0x2a00eb=Object[_0xeaff('0x4')](_0x386975)[0x0];return _0x414275[_0xeaff('0x5')](_0x2a00eb);}catch(_0x288bb6){return![];}}function getOperatorValue(_0xf0d1f1){var _0xe964a0=JSON[_0xeaff('0x3')](_0xf0d1f1);var _0x418a10=Object['keys'](_0xe964a0)[0x0];var _0x123f65=_0xe964a0[_0x418a10];return{['$'+_0x418a10]:_0x123f65};}function parseIncludeModel(_0xf39aa5){var _0x3f5c9c=JSON['parse'](_0xf39aa5);return{'model':db[_0x3f5c9c[_0xeaff('0x6')]],'as':_0x3f5c9c[_0xeaff('0x7')],'attributes':_0x3f5c9c[_0xeaff('0x8')],'raw':_0x3f5c9c[_0xeaff('0x9')]};}exports['fields']=function(_0x599853){var _0x7d6797=null;if(_0x599853){_0x7d6797=_0x599853[_0xeaff('0xa')](',');}return _0x7d6797;};exports[_0xeaff('0xb')]=function(_0x1defaa,_0xef4762){var _0x18f6f2={};if(!_[_0xeaff('0xc')](_0x1defaa)){_[_0xeaff('0xd')](_0x1defaa,function(_0x107443,_0x20b320){try{if(_0xef4762){var _0x33a19f=_[_0xeaff('0xe')](_0xef4762,{'name':_0x20b320})||{};if(hasSequelizeOperator(_0x107443)){_0x18f6f2[_0x20b320]=getOperatorValue(_0x107443);}else if(_0x33a19f[_0xeaff('0xf')]===_0xeaff('0x10')&&_[_0xeaff('0x11')](_0x107443)){var _0x356bba=JSON[_0xeaff('0x3')](_0x107443);var _0x465bbe={'$gte':moment(moment(_0x356bba['$gte'])['format']('YYYY-MM-DD'))[_0xeaff('0x12')]()[_0xeaff('0x13')](),'$lte':moment(moment(_0x356bba[_0xeaff('0x14')])[_0xeaff('0x13')](_0xeaff('0x15')))['utc']()['subtract'](0x1,'s')[_0xeaff('0x13')]()};_0x18f6f2[_0x20b320]=_0x465bbe;}else if(_0x33a19f['name']==='uniqueid'){_0x18f6f2[_0x20b320]=_0x107443;}else{_0x18f6f2[_0x20b320]=_[_0xeaff('0x16')](_0x107443)?_0x107443:JSON[_0xeaff('0x3')](_0x107443);}}else{_0x18f6f2[_0x20b320]=_[_0xeaff('0x16')](_0x107443)?_0x107443:JSON[_0xeaff('0x3')](_0x107443);}}catch(_0x31389e){_0x18f6f2[_0x20b320]=_0x107443[_0xeaff('0xa')](',');}});}return _0x18f6f2;};exports[_0xeaff('0x17')]=function(_0x56d705){_0x56d705=parseInt(_0x56d705,0xa);if(!_0x56d705||_0x56d705<0x0){_0x56d705=LIMIT_VALUE;}return _0x56d705;};exports['offset']=function(_0x5c62f3){_0x5c62f3=parseInt(_0x5c62f3,0xa);if(!_0x5c62f3||_0x5c62f3<0x0){_0x5c62f3=0x0;}return _0x5c62f3;};exports[_0xeaff('0x18')]=function(_0x5f45db){var _0x2a431b,_0xff722a=null;if(_0x5f45db){_0x2a431b=_0x5f45db[_0xeaff('0xa')](',');_0xff722a=_[_0xeaff('0x19')](_0x2a431b,function(_0x2a5e7a){if(_0x2a5e7a[_0xeaff('0x1a')]('-')===0x0){return[_0x2a5e7a===_0xeaff('0x1b')?sequelize[_0xeaff('0x1c')](sequelize[_0xeaff('0x1d')](_0xeaff('0x1b')),'unsigned'):_0x2a5e7a[_0xeaff('0x1e')](0x1),'DESC'];}else{return[_0x2a5e7a===_0xeaff('0x1b')?sequelize[_0xeaff('0x1c')](sequelize['col'](_0xeaff('0x1b')),_0xeaff('0x1f')):_0x2a5e7a,_0xeaff('0x20')];}});}return _0xff722a;};exports['omit']=function(_0x21001c,_0x2700d4){if(_[_0xeaff('0xc')](_0x21001c)){return _0x21001c;}if(_[_0xeaff('0x16')](_0x21001c)){for(var _0x312aac=0x0;_0x312aac<_0x21001c[_0xeaff('0x21')];_0x312aac+=0x1){_0x21001c[_0x312aac]=this[_0xeaff('0x22')](_0x21001c[_0x312aac],_0x2700d4);}return _0x21001c;}if(!_['isObject'](_0x21001c)){return _0x21001c;}if(_[_0xeaff('0x23')](_0x2700d4)){_0x2700d4=[_0x2700d4];}if(!_[_0xeaff('0x16')](_0x2700d4)){return _0x21001c;}for(var _0x12f897=0x0;_0x12f897<_0x2700d4[_0xeaff('0x21')];_0x12f897+=0x1){_[_0xeaff('0x24')](_0x21001c,_0x2700d4[_0x12f897]);}for(var _0x19915e in _0x21001c){if(_0x21001c[_0xeaff('0x25')](_0x19915e)){_0x21001c[_0x19915e]=this[_0xeaff('0x22')](_0x21001c[_0x19915e],_0x2700d4);}}return _0x21001c;};exports[_0xeaff('0x26')]=function(_0x9f96c2){return _0x9f96c2['match'](RegExp('^[+]?[0-9]*$'))?!![]:![];};exports[_0xeaff('0x27')]=function(_0x2905e6){return _0x2905e6['match'](/^\S+@\S+$/)?!![]:![];};exports[_0xeaff('0x28')]=function(_0x48332d,_0x13f4f1){var _0x4cb4d9=[];var _0x237832=/[ `!@#$%^&*()_\-?~]/;var _0x77012b=_0x13f4f1?_0xeaff('0x29'):'{EXPR}';_0x48332d[_0xeaff('0xa')](/[ ,]+/)['forEach'](function(_0x4c89ff){_0x4c89ff=_0x4c89ff['replace'](/([^:]")"+/g,'$1');_0x4c89ff='+'+_0x4c89ff+'*';var _0x4428ca=_0x4c89ff['match'](_0x237832);if(_0x4428ca){_0x4c89ff='\x22'+_0x4c89ff+'\x22';}_0x4cb4d9[_0xeaff('0x2a')](_0x4c89ff);});_0x77012b=_0x77012b[_0xeaff('0x2b')](_0xeaff('0x2c'),_0x4cb4d9[_0xeaff('0x2d')]('\x20'));return _0x77012b;};exports['getOptions']=function(_0x273421,_0x439151,_0x282403){var _0x905069={},_0x54cf75={};if(_0x439151[_0xeaff('0x2e')]['$id']){_0x439151[_0xeaff('0x2e')]['id']=_0x439151['query'][_0xeaff('0x2f')];delete _0x439151['query'][_0xeaff('0x2f')];}_0x905069[_0xeaff('0x6')]=_['map'](_0x273421,_0xeaff('0x30'));_0x905069[_0xeaff('0x2e')]=_[_0xeaff('0x4')](_0x439151[_0xeaff('0x2e')]);_0x905069[_0xeaff('0xb')]=_[_0xeaff('0x31')](_0x905069[_0xeaff('0x6')],_0x905069['query']);_0x54cf75['attributes']=_[_0xeaff('0x31')](_0x905069[_0xeaff('0x6')],this['fields'](_0x439151['query'][_0xeaff('0x8')]));_0x54cf75[_0xeaff('0x32')]=_0x54cf75[_0xeaff('0x32')][_0xeaff('0x21')]?_0x54cf75[_0xeaff('0x32')]:_0x905069[_0xeaff('0x6')];if(!_0x439151[_0xeaff('0x2e')][_0xeaff('0x25')](_0xeaff('0x33'))){_0x54cf75[_0xeaff('0x17')]=this[_0xeaff('0x17')](_0x439151[_0xeaff('0x2e')][_0xeaff('0x17')]);_0x54cf75[_0xeaff('0x34')]=this[_0xeaff('0x34')](_0x439151[_0xeaff('0x2e')]['offset']);}_0x54cf75[_0xeaff('0x35')]=this[_0xeaff('0x18')](_0x439151[_0xeaff('0x2e')][_0xeaff('0x18')]);_0x54cf75['where']=this['filters'](_['pick'](_0x439151[_0xeaff('0x2e')],_0x905069[_0xeaff('0xb')]),_0x273421);if(_0x439151[_0xeaff('0x2e')][_0xeaff('0x36')]){var _0x39b9b0=_0x273421;var _0xd5fbc2=_0x439151['query'][_0xeaff('0x36')];if(typeof _0xd5fbc2===_0xeaff('0x37')){_0x39b9b0=_[_0xeaff('0x36')](_0x273421,function(_0x4c3eb1){return _['includes'](_0xd5fbc2[_0xeaff('0x38')],_0x4c3eb1[_0xeaff('0x30')]);});_0xd5fbc2=_0xd5fbc2[_0xeaff('0x39')];}_0x54cf75[_0xeaff('0x3a')]=_[_0xeaff('0x3b')](_0x54cf75['where'],{'$or':_['map'](_0x39b9b0,function(_0x4ae26f){if(_0x4ae26f[_0xeaff('0xf')]!==_0xeaff('0x3c')){if(_0x282403){return sequelize[_0xeaff('0x3a')](sequelize['fn'](_0xeaff('0x3d'),sequelize[_0xeaff('0x1d')](_0x4ae26f[_0xeaff('0x30')])),{'$like':sequelize['fn'](_0xeaff('0x3d'),'%'+_0x439151['query']['filter']+'%')});}else{var _0x5c8911={};_0x5c8911[_0x4ae26f['name']]={'$like':'%'+_0x439151[_0xeaff('0x2e')][_0xeaff('0x36')]+'%'};return _0x5c8911;}}})});}_0x54cf75=_['merge']({},_0x54cf75,_0x439151['options']);return _0x54cf75;};exports[_0xeaff('0x3e')]=function(_0x188343){var _0x32a18b=[];if(_0x188343['includeAll']){_0x32a18b[_0xeaff('0x2a')]({'all':!![]});}else if(_0x188343[_0xeaff('0x3e')]){if(Array['isArray'](_0x188343[_0xeaff('0x3e')])){_0x32a18b=Object[_0xeaff('0x4')](_0x188343['include'])['map'](function(_0x521d38){return parseIncludeModel(_0x188343[_0xeaff('0x3e')][_0x521d38]);});}else{var _0x32b03f=parseIncludeModel(_0x188343[_0xeaff('0x3e')]);_0x32a18b[_0xeaff('0x2a')](_0x32b03f);}}return _0x32a18b;}; \ No newline at end of file diff --git a/server/components/realtime/agents.js b/server/components/realtime/agents.js index 0ee7aaa..3236816 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 _0xdc97=['openchannelStatusTime','mailStatusTime','smsStatusTime','whatsappStatusTime','faxStatusTime','queue','destconnectedlinenum','screenrecording','phoneBarEnableAutomaticScreenRecording','routealias','omit','pick','value','filterAgentAttributes','role','userpic','voiceStatusTime','mailCapacity','phoneBarEnableScreenRecordingByAgent','onhold','getRealtimeAgentsQueryFields','lodash','jayson/promise','../../mysqldb','http','chatPause','faxPause','mailPause','smsPause','every','filter','length','idle','unknown','unavailable','ringing','isNil','pause','faxStatus','mailStatus','openchannelStatus','smsStatus','voiceStatus','whatsappStatus','Agents','then','error','Unable\x20to\x20retrieve\x20RPC\x20agents\x20(AMI)','result','request','Unable\x20to\x20retrieve\x20RPC\x20agents\x20(Routing)','merge','catch','getRealtimeAgents','*pause','isArray','Queue','map','findOne','uniq','getAgentIdsByQueues','includes','resolve','name','openchannelPause','voicePause','whatsappPause','pauseType','find','getSortedAgentsIdsByStatus','split','fields','globalStatus','order','startsWith','DESC','ASC','fullname,internal','fullname','internal','substring','indexOf','toLowerCase','online','lastLoginAt','lastPauseAt','chatCapacity','openchannelCapacity','smsCapacity','whatsappCapacity','faxCapacity','chatCurrentCapacity','openchannelCurrentCapacity','mailCurrentCapacity','smsCurrentCapacity','whatsappCurrentCapacity','faxCurrentCapacity','chatStatus'];(function(_0x4f939a,_0x5232ee){var _0xb1d4eb=function(_0x19821b){while(--_0x19821b){_0x4f939a['push'](_0x4f939a['shift']());}};_0xb1d4eb(++_0x5232ee);}(_0xdc97,0x13b));var _0x7dc9=function(_0x47bc76,_0x551259){_0x47bc76=_0x47bc76-0x0;var _0x1992a1=_0xdc97[_0x47bc76];return _0x1992a1;};'use strict';var _=require(_0x7dc9('0x0'));var jayson=require(_0x7dc9('0x1'));var db=require(_0x7dc9('0x2'))['db'];var amiClient=jayson['client'][_0x7dc9('0x3')]({'port':0x232a});var routingClient=jayson['client'][_0x7dc9('0x3')]({'port':0x232c});function isAgentPaused(_0x2b86da,_0x478a95){var _0x2a77c1=[_0x2b86da[_0x7dc9('0x4')],_0x2b86da[_0x7dc9('0x5')],_0x2b86da[_0x7dc9('0x6')],_0x2b86da['openchannelPause'],_0x2b86da[_0x7dc9('0x7')],_0x2b86da['voicePause'],_0x2b86da['whatsappPause']];if(!_0x478a95)return _[_0x7dc9('0x8')](_0x2a77c1);var _0x23737d=_[_0x7dc9('0x9')](_0x2a77c1);return _0x23737d[_0x7dc9('0xa')]>0x0&&_0x23737d[_0x7dc9('0xa')]<_0x2a77c1['length']?!![]:![];}function isIdle(_0xb2fa2a){return _0xb2fa2a===_0x7dc9('0xb')||_0xb2fa2a===_0x7dc9('0xc')||_0xb2fa2a===_0x7dc9('0xd')||_0xb2fa2a===_0x7dc9('0xe')||_[_0x7dc9('0xf')](_0xb2fa2a);}function isAgentIdle(_0x1e336a){if(_0x1e336a['voiceStatus']!=='idle'&&_0x1e336a['voicePause']){_0x1e336a['voiceStatus']=_0x7dc9('0x10');return![];}return _[_0x7dc9('0x8')]([_0x1e336a['chatStatus'],_0x1e336a[_0x7dc9('0x11')],_0x1e336a[_0x7dc9('0x12')],_0x1e336a[_0x7dc9('0x13')],_0x1e336a[_0x7dc9('0x14')],_0x1e336a[_0x7dc9('0x15')],_0x1e336a[_0x7dc9('0x16')]],isIdle);}function getRealtimeAgents(){return amiClient['request'](_0x7dc9('0x17'),{})[_0x7dc9('0x18')](function(_0x1b0aa1){if(_0x1b0aa1[_0x7dc9('0x19')]){throw new Error(_0x7dc9('0x1a'));}var _0xbe0437=_0x1b0aa1[_0x7dc9('0x1b')];return routingClient[_0x7dc9('0x1c')](_0x7dc9('0x17'),{})['then'](function(_0x22577e){if(_0x22577e['error']){throw new Error(_0x7dc9('0x1d'));}var _0x1cc237=_0x22577e['result'];return _[_0x7dc9('0x1e')]({},_0xbe0437,_0x1cc237);});})[_0x7dc9('0x1f')](function(_0x12f08d){throw _0x12f08d;});}exports[_0x7dc9('0x20')]=getRealtimeAgents;function getAgentStatus(_0x43ec33){var _0x184bfd=_0x7dc9('0xc');if(isAgentPaused(_0x43ec33))_0x184bfd=_0x7dc9('0x10');else if(isAgentPaused(_0x43ec33,!![]))_0x184bfd=_0x7dc9('0x21');else if(isAgentIdle(_0x43ec33))_0x184bfd=_0x7dc9('0xb');else _0x184bfd='busy';return _0x184bfd;}exports['getAgentStatus']=getAgentStatus;function getAgentIdsByQueues(_0x12954f,_0x5981e2){var _0x596e0f=_[_0x7dc9('0x22')](_0x12954f)?_0x12954f:[_0x12954f];var _0x27f7fa=_['startCase'](_0x5981e2)+_0x7dc9('0x23');var _0x43d31f=_[_0x7dc9('0x24')](_0x596e0f,function(_0x4906b1){return db[_0x27f7fa][_0x7dc9('0x25')]({'where':{'id':_0x4906b1}})[_0x7dc9('0x18')](function(_0xf95336){if(!_0xf95336)return[];return _0xf95336['getAgents']({'attributes':['id'],'raw':!![]});});});return Promise['all'](_0x43d31f)['then'](function(_0x25b383){var _0x32d032=_(_0x25b383)['flatten']()['map']('id')[_0x7dc9('0x26')]()['value']();return _0x32d032;});}exports[_0x7dc9('0x27')]=getAgentIdsByQueues;function getAgentIdsByStatus(_0x1c690b,_0x3a74a0,_0x3e4102){try{if(_0x3a74a0[_0x7dc9('0xa')]>0x0){_0x1c690b=_0x1c690b[_0x7dc9('0x9')](function(_0x236d42){return _0x3a74a0[_0x7dc9('0x28')](_0x236d42['id']);});}var _0x1fcf0e=_0x1c690b[_0x7dc9('0x9')](function(_0x14083d){var _0x2a456c='busy';if(isAgentIdle(_0x14083d)){_0x2a456c='idle';}return _0x2a456c===_0x3e4102;});return _['map'](_0x1fcf0e,'id');}catch(_0x49a4a5){throw _0x49a4a5;}}exports['getAgentIdsByStatus']=getAgentIdsByStatus;function getSortedAgentsIdsByStatus(_0x553a03,_0x58c4e8,_0x59f5d8){return Promise[_0x7dc9('0x29')]()[_0x7dc9('0x18')](function(){if(_0x58c4e8[_0x7dc9('0xa')]>0x0){_0x553a03=_0x553a03[_0x7dc9('0x9')](function(_0x3300ff){return _0x58c4e8[_0x7dc9('0x28')](_0x3300ff['id']);});}return _0x553a03;})['then'](function(){return db['User']['findAll']({'attributes':['id',_0x7dc9('0x2a'),'fullname',_0x7dc9('0x4'),_0x7dc9('0x5'),_0x7dc9('0x6'),_0x7dc9('0x2b'),_0x7dc9('0x7'),_0x7dc9('0x2c'),_0x7dc9('0x2d'),_0x7dc9('0x2e')],'where':{'id':{'$in':_['map'](_0x553a03,'id')}},'raw':!![]});})[_0x7dc9('0x18')](function(_0x4cdec4){return _0x4cdec4[_0x7dc9('0x24')](function(_0x16431a){var _0x3dc8e0=_[_0x7dc9('0x2f')](_0x553a03,['id',_0x16431a['id']]);var _0x48d9b2=filterAgentAttributes(_0x3dc8e0);_[_0x7dc9('0x1e')](_0x16431a,_0x48d9b2);_0x16431a['globalStatus']=getAgentStatus(_0x16431a);return _0x16431a;});})[_0x7dc9('0x18')](function(_0x4f47af){var _0x590bed=sortAgentsByStatus(_0x4f47af,_0x59f5d8);return _[_0x7dc9('0x24')](_0x590bed,'id');})[_0x7dc9('0x1f')](function(_0x21e036){throw _0x21e036;});}exports[_0x7dc9('0x30')]=getSortedAgentsIdsByStatus;function getUpdatedSortOptions(_0x5dac5b){var _0x9376a5={'fields':[],'order':null};var _0x183d87=_0x5dac5b[_0x7dc9('0x31')](',');_0x9376a5[_0x7dc9('0x32')]=_[_0x7dc9('0x9')](_0x183d87,function(_0x21faa6){if(!_0x21faa6[_0x7dc9('0x28')](_0x7dc9('0x33'))){return!![];}_0x9376a5[_0x7dc9('0x34')]=_[_0x7dc9('0x35')](_0x21faa6,'-')?_0x7dc9('0x36'):_0x7dc9('0x37');return![];});return _0x9376a5;}exports['getUpdatedSortOptions']=getUpdatedSortOptions;function validateSortParameter(_0x34b5c9){if(!_0x34b5c9){_0x34b5c9=_0x7dc9('0x38');}if(_0x34b5c9[_0x7dc9('0x28')](_0x7dc9('0x39'))&&!_0x34b5c9['includes'](_0x7dc9('0x3a'))){var _0x89db0e=_0x34b5c9[_0x7dc9('0x3b')](0x0,_0x34b5c9[_0x7dc9('0x3c')](_0x7dc9('0x39')));_0x34b5c9+=','+_0x89db0e+_0x7dc9('0x3a');}return _0x34b5c9;}exports['validateSortParameter']=validateSortParameter;function sortAgentsByStatus(_0x553230,_0x3ef9fd){var _0x36a965=_0x553230['sort'](function(_0x3a705c,_0x4a37ec){if(_0x3a705c[_0x7dc9('0x33')]===_0x4a37ec[_0x7dc9('0x33')]){if(_0x3a705c[_0x7dc9('0x33')]==='pause'){if(_0x3ef9fd===_0x7dc9('0x36')){return(_0x3a705c[_0x7dc9('0x2e')]||'')<(_0x4a37ec[_0x7dc9('0x2e')]||'')||_0x3a705c[_0x7dc9('0x39')][_0x7dc9('0x3d')]()>_0x4a37ec[_0x7dc9('0x39')][_0x7dc9('0x3d')]()?0x1:-0x1;}else{return(_0x3a705c['pauseType']||'')<(_0x4a37ec[_0x7dc9('0x2e')]||'')||_0x3a705c['fullname']['toLowerCase']()>_0x4a37ec[_0x7dc9('0x39')][_0x7dc9('0x3d')]()?-0x1:0x1;}}else{if(_0x3ef9fd===_0x7dc9('0x36')){return _0x3a705c[_0x7dc9('0x39')][_0x7dc9('0x3d')]()<_0x4a37ec[_0x7dc9('0x39')][_0x7dc9('0x3d')]()?0x1:-0x1;}else{return _0x3a705c[_0x7dc9('0x39')][_0x7dc9('0x3d')]()<_0x4a37ec['fullname'][_0x7dc9('0x3d')]()?-0x1:0x1;}}}else{if(_0x3ef9fd===_0x7dc9('0x36')){return _0x3a705c[_0x7dc9('0x33')]<_0x4a37ec[_0x7dc9('0x33')]?0x1:-0x1;}else{return _0x3a705c[_0x7dc9('0x33')]<_0x4a37ec[_0x7dc9('0x33')]?-0x1:0x1;}}});return _0x36a965;}exports['sortAgentsByStatus']=sortAgentsByStatus;function filterAgentAttributes(_0x3774cb){var _0x42e110=['userpic',_0x7dc9('0x3e'),_0x7dc9('0x3f'),_0x7dc9('0x40'),'pauseType',_0x7dc9('0x40'),'internal','address',_0x7dc9('0x4'),_0x7dc9('0x2b'),_0x7dc9('0x6'),'smsPause','whatsappPause',_0x7dc9('0x5'),'voicePause',_0x7dc9('0x41'),_0x7dc9('0x42'),'mailCapacity',_0x7dc9('0x43'),_0x7dc9('0x44'),_0x7dc9('0x45'),_0x7dc9('0x46'),_0x7dc9('0x47'),_0x7dc9('0x48'),_0x7dc9('0x49'),_0x7dc9('0x4a'),_0x7dc9('0x4b'),_0x7dc9('0x4c'),_0x7dc9('0x13'),_0x7dc9('0x12'),_0x7dc9('0x14'),'whatsappStatus',_0x7dc9('0x11'),'voiceStatus','chatStatusTime',_0x7dc9('0x4d'),_0x7dc9('0x4e'),_0x7dc9('0x4f'),_0x7dc9('0x50'),_0x7dc9('0x51'),'voiceStatusTime',_0x7dc9('0x52'),_0x7dc9('0x53'),_0x7dc9('0x54'),'phoneBarEnableScreenRecordingByAgent',_0x7dc9('0x55'),_0x7dc9('0x56')];var _0x2cf133=[_0x7dc9('0x4'),_0x7dc9('0x2b'),_0x7dc9('0x6'),'smsPause',_0x7dc9('0x2d'),_0x7dc9('0x5'),_0x7dc9('0x2c'),_0x7dc9('0x3e')];var _0x877a67=_(_0x3774cb)[_0x7dc9('0x57')](_0x2cf133)[_0x7dc9('0x58')](_0x42e110)[_0x7dc9('0x59')]();return _0x877a67;}exports[_0x7dc9('0x5a')]=filterAgentAttributes;function getRealtimeAgentsQueryFields(){return['id',_0x7dc9('0x2a'),_0x7dc9('0x39'),_0x7dc9('0x5b'),'internal',_0x7dc9('0x3e'),_0x7dc9('0x33'),_0x7dc9('0x5c'),_0x7dc9('0x3f'),_0x7dc9('0x2e'),'lastPauseAt',_0x7dc9('0x5'),_0x7dc9('0x4'),_0x7dc9('0x6'),_0x7dc9('0x2b'),_0x7dc9('0x7'),_0x7dc9('0x2c'),'whatsappPause','chatStatus','faxStatus',_0x7dc9('0x12'),_0x7dc9('0x13'),_0x7dc9('0x14'),_0x7dc9('0x15'),'whatsappStatus','chatStatusTime',_0x7dc9('0x51'),_0x7dc9('0x4e'),_0x7dc9('0x4d'),_0x7dc9('0x4f'),_0x7dc9('0x5d'),_0x7dc9('0x50'),_0x7dc9('0x41'),'faxCapacity',_0x7dc9('0x5e'),_0x7dc9('0x42'),_0x7dc9('0x43'),_0x7dc9('0x44'),_0x7dc9('0x46'),'faxCurrentCapacity',_0x7dc9('0x48'),_0x7dc9('0x47'),_0x7dc9('0x49'),_0x7dc9('0x4a'),_0x7dc9('0x5f'),_0x7dc9('0x55'),_0x7dc9('0x53'),_0x7dc9('0x60'),_0x7dc9('0x52'),_0x7dc9('0x56'),_0x7dc9('0x54')];}exports[_0x7dc9('0x61')]=getRealtimeAgentsQueryFields; \ No newline at end of file +var _0xdc97=['openchannelStatusTime','mailStatusTime','smsStatusTime','whatsappStatusTime','faxStatusTime','queue','destconnectedlinenum','screenrecording','phoneBarEnableAutomaticScreenRecording','routealias','omit','pick','value','filterAgentAttributes','role','userpic','voiceStatusTime','mailCapacity','phoneBarEnableScreenRecordingByAgent','onhold','getRealtimeAgentsQueryFields','lodash','jayson/promise','../../mysqldb','http','chatPause','faxPause','mailPause','smsPause','every','filter','length','idle','unknown','unavailable','ringing','isNil','pause','faxStatus','mailStatus','openchannelStatus','smsStatus','voiceStatus','whatsappStatus','Agents','then','error','Unable\x20to\x20retrieve\x20RPC\x20agents\x20(AMI)','result','request','Unable\x20to\x20retrieve\x20RPC\x20agents\x20(Routing)','merge','catch','getRealtimeAgents','*pause','isArray','Queue','map','findOne','uniq','getAgentIdsByQueues','includes','resolve','name','openchannelPause','voicePause','whatsappPause','pauseType','find','getSortedAgentsIdsByStatus','split','fields','globalStatus','order','startsWith','DESC','ASC','fullname,internal','fullname','internal','substring','indexOf','toLowerCase','online','lastLoginAt','lastPauseAt','chatCapacity','openchannelCapacity','smsCapacity','whatsappCapacity','faxCapacity','chatCurrentCapacity','openchannelCurrentCapacity','mailCurrentCapacity','smsCurrentCapacity','whatsappCurrentCapacity','faxCurrentCapacity','chatStatus'];(function(_0x3f39ab,_0x16c981){var _0x170952=function(_0x45e049){while(--_0x45e049){_0x3f39ab['push'](_0x3f39ab['shift']());}};_0x170952(++_0x16c981);}(_0xdc97,0x13b));var _0x7dc9=function(_0x263054,_0x1a5fe5){_0x263054=_0x263054-0x0;var _0x510c22=_0xdc97[_0x263054];return _0x510c22;};'use strict';var _=require(_0x7dc9('0x0'));var jayson=require(_0x7dc9('0x1'));var db=require(_0x7dc9('0x2'))['db'];var amiClient=jayson['client'][_0x7dc9('0x3')]({'port':0x232a});var routingClient=jayson['client'][_0x7dc9('0x3')]({'port':0x232c});function isAgentPaused(_0x2b86da,_0x478a95){var _0x2a77c1=[_0x2b86da[_0x7dc9('0x4')],_0x2b86da[_0x7dc9('0x5')],_0x2b86da[_0x7dc9('0x6')],_0x2b86da['openchannelPause'],_0x2b86da[_0x7dc9('0x7')],_0x2b86da['voicePause'],_0x2b86da['whatsappPause']];if(!_0x478a95)return _[_0x7dc9('0x8')](_0x2a77c1);var _0x23737d=_[_0x7dc9('0x9')](_0x2a77c1);return _0x23737d[_0x7dc9('0xa')]>0x0&&_0x23737d[_0x7dc9('0xa')]<_0x2a77c1['length']?!![]:![];}function isIdle(_0xb2fa2a){return _0xb2fa2a===_0x7dc9('0xb')||_0xb2fa2a===_0x7dc9('0xc')||_0xb2fa2a===_0x7dc9('0xd')||_0xb2fa2a===_0x7dc9('0xe')||_[_0x7dc9('0xf')](_0xb2fa2a);}function isAgentIdle(_0x1e336a){if(_0x1e336a['voiceStatus']!=='idle'&&_0x1e336a['voicePause']){_0x1e336a['voiceStatus']=_0x7dc9('0x10');return![];}return _[_0x7dc9('0x8')]([_0x1e336a['chatStatus'],_0x1e336a[_0x7dc9('0x11')],_0x1e336a[_0x7dc9('0x12')],_0x1e336a[_0x7dc9('0x13')],_0x1e336a[_0x7dc9('0x14')],_0x1e336a[_0x7dc9('0x15')],_0x1e336a[_0x7dc9('0x16')]],isIdle);}function getRealtimeAgents(){return amiClient['request'](_0x7dc9('0x17'),{})[_0x7dc9('0x18')](function(_0x1b0aa1){if(_0x1b0aa1[_0x7dc9('0x19')]){throw new Error(_0x7dc9('0x1a'));}var _0xbe0437=_0x1b0aa1[_0x7dc9('0x1b')];return routingClient[_0x7dc9('0x1c')](_0x7dc9('0x17'),{})['then'](function(_0x22577e){if(_0x22577e['error']){throw new Error(_0x7dc9('0x1d'));}var _0x1cc237=_0x22577e['result'];return _[_0x7dc9('0x1e')]({},_0xbe0437,_0x1cc237);});})[_0x7dc9('0x1f')](function(_0x12f08d){throw _0x12f08d;});}exports[_0x7dc9('0x20')]=getRealtimeAgents;function getAgentStatus(_0x43ec33){var _0x184bfd=_0x7dc9('0xc');if(isAgentPaused(_0x43ec33))_0x184bfd=_0x7dc9('0x10');else if(isAgentPaused(_0x43ec33,!![]))_0x184bfd=_0x7dc9('0x21');else if(isAgentIdle(_0x43ec33))_0x184bfd=_0x7dc9('0xb');else _0x184bfd='busy';return _0x184bfd;}exports['getAgentStatus']=getAgentStatus;function getAgentIdsByQueues(_0x12954f,_0x5981e2){var _0x596e0f=_[_0x7dc9('0x22')](_0x12954f)?_0x12954f:[_0x12954f];var _0x27f7fa=_['startCase'](_0x5981e2)+_0x7dc9('0x23');var _0x43d31f=_[_0x7dc9('0x24')](_0x596e0f,function(_0x4906b1){return db[_0x27f7fa][_0x7dc9('0x25')]({'where':{'id':_0x4906b1}})[_0x7dc9('0x18')](function(_0xf95336){if(!_0xf95336)return[];return _0xf95336['getAgents']({'attributes':['id'],'raw':!![]});});});return Promise['all'](_0x43d31f)['then'](function(_0x25b383){var _0x32d032=_(_0x25b383)['flatten']()['map']('id')[_0x7dc9('0x26')]()['value']();return _0x32d032;});}exports[_0x7dc9('0x27')]=getAgentIdsByQueues;function getAgentIdsByStatus(_0x1c690b,_0x3a74a0,_0x3e4102){try{if(_0x3a74a0[_0x7dc9('0xa')]>0x0){_0x1c690b=_0x1c690b[_0x7dc9('0x9')](function(_0x236d42){return _0x3a74a0[_0x7dc9('0x28')](_0x236d42['id']);});}var _0x1fcf0e=_0x1c690b[_0x7dc9('0x9')](function(_0x14083d){var _0x2a456c='busy';if(isAgentIdle(_0x14083d)){_0x2a456c='idle';}return _0x2a456c===_0x3e4102;});return _['map'](_0x1fcf0e,'id');}catch(_0x49a4a5){throw _0x49a4a5;}}exports['getAgentIdsByStatus']=getAgentIdsByStatus;function getSortedAgentsIdsByStatus(_0x553a03,_0x58c4e8,_0x59f5d8){return Promise[_0x7dc9('0x29')]()[_0x7dc9('0x18')](function(){if(_0x58c4e8[_0x7dc9('0xa')]>0x0){_0x553a03=_0x553a03[_0x7dc9('0x9')](function(_0x3300ff){return _0x58c4e8[_0x7dc9('0x28')](_0x3300ff['id']);});}return _0x553a03;})['then'](function(){return db['User']['findAll']({'attributes':['id',_0x7dc9('0x2a'),'fullname',_0x7dc9('0x4'),_0x7dc9('0x5'),_0x7dc9('0x6'),_0x7dc9('0x2b'),_0x7dc9('0x7'),_0x7dc9('0x2c'),_0x7dc9('0x2d'),_0x7dc9('0x2e')],'where':{'id':{'$in':_['map'](_0x553a03,'id')}},'raw':!![]});})[_0x7dc9('0x18')](function(_0x4cdec4){return _0x4cdec4[_0x7dc9('0x24')](function(_0x16431a){var _0x3dc8e0=_[_0x7dc9('0x2f')](_0x553a03,['id',_0x16431a['id']]);var _0x48d9b2=filterAgentAttributes(_0x3dc8e0);_[_0x7dc9('0x1e')](_0x16431a,_0x48d9b2);_0x16431a['globalStatus']=getAgentStatus(_0x16431a);return _0x16431a;});})[_0x7dc9('0x18')](function(_0x4f47af){var _0x590bed=sortAgentsByStatus(_0x4f47af,_0x59f5d8);return _[_0x7dc9('0x24')](_0x590bed,'id');})[_0x7dc9('0x1f')](function(_0x21e036){throw _0x21e036;});}exports[_0x7dc9('0x30')]=getSortedAgentsIdsByStatus;function getUpdatedSortOptions(_0x5dac5b){var _0x9376a5={'fields':[],'order':null};var _0x183d87=_0x5dac5b[_0x7dc9('0x31')](',');_0x9376a5[_0x7dc9('0x32')]=_[_0x7dc9('0x9')](_0x183d87,function(_0x21faa6){if(!_0x21faa6[_0x7dc9('0x28')](_0x7dc9('0x33'))){return!![];}_0x9376a5[_0x7dc9('0x34')]=_[_0x7dc9('0x35')](_0x21faa6,'-')?_0x7dc9('0x36'):_0x7dc9('0x37');return![];});return _0x9376a5;}exports['getUpdatedSortOptions']=getUpdatedSortOptions;function validateSortParameter(_0x34b5c9){if(!_0x34b5c9){_0x34b5c9=_0x7dc9('0x38');}if(_0x34b5c9[_0x7dc9('0x28')](_0x7dc9('0x39'))&&!_0x34b5c9['includes'](_0x7dc9('0x3a'))){var _0x89db0e=_0x34b5c9[_0x7dc9('0x3b')](0x0,_0x34b5c9[_0x7dc9('0x3c')](_0x7dc9('0x39')));_0x34b5c9+=','+_0x89db0e+_0x7dc9('0x3a');}return _0x34b5c9;}exports['validateSortParameter']=validateSortParameter;function sortAgentsByStatus(_0x553230,_0x3ef9fd){var _0x36a965=_0x553230['sort'](function(_0x3a705c,_0x4a37ec){if(_0x3a705c[_0x7dc9('0x33')]===_0x4a37ec[_0x7dc9('0x33')]){if(_0x3a705c[_0x7dc9('0x33')]==='pause'){if(_0x3ef9fd===_0x7dc9('0x36')){return(_0x3a705c[_0x7dc9('0x2e')]||'')<(_0x4a37ec[_0x7dc9('0x2e')]||'')||_0x3a705c[_0x7dc9('0x39')][_0x7dc9('0x3d')]()>_0x4a37ec[_0x7dc9('0x39')][_0x7dc9('0x3d')]()?0x1:-0x1;}else{return(_0x3a705c['pauseType']||'')<(_0x4a37ec[_0x7dc9('0x2e')]||'')||_0x3a705c['fullname']['toLowerCase']()>_0x4a37ec[_0x7dc9('0x39')][_0x7dc9('0x3d')]()?-0x1:0x1;}}else{if(_0x3ef9fd===_0x7dc9('0x36')){return _0x3a705c[_0x7dc9('0x39')][_0x7dc9('0x3d')]()<_0x4a37ec[_0x7dc9('0x39')][_0x7dc9('0x3d')]()?0x1:-0x1;}else{return _0x3a705c[_0x7dc9('0x39')][_0x7dc9('0x3d')]()<_0x4a37ec['fullname'][_0x7dc9('0x3d')]()?-0x1:0x1;}}}else{if(_0x3ef9fd===_0x7dc9('0x36')){return _0x3a705c[_0x7dc9('0x33')]<_0x4a37ec[_0x7dc9('0x33')]?0x1:-0x1;}else{return _0x3a705c[_0x7dc9('0x33')]<_0x4a37ec[_0x7dc9('0x33')]?-0x1:0x1;}}});return _0x36a965;}exports['sortAgentsByStatus']=sortAgentsByStatus;function filterAgentAttributes(_0x3774cb){var _0x42e110=['userpic',_0x7dc9('0x3e'),_0x7dc9('0x3f'),_0x7dc9('0x40'),'pauseType',_0x7dc9('0x40'),'internal','address',_0x7dc9('0x4'),_0x7dc9('0x2b'),_0x7dc9('0x6'),'smsPause','whatsappPause',_0x7dc9('0x5'),'voicePause',_0x7dc9('0x41'),_0x7dc9('0x42'),'mailCapacity',_0x7dc9('0x43'),_0x7dc9('0x44'),_0x7dc9('0x45'),_0x7dc9('0x46'),_0x7dc9('0x47'),_0x7dc9('0x48'),_0x7dc9('0x49'),_0x7dc9('0x4a'),_0x7dc9('0x4b'),_0x7dc9('0x4c'),_0x7dc9('0x13'),_0x7dc9('0x12'),_0x7dc9('0x14'),'whatsappStatus',_0x7dc9('0x11'),'voiceStatus','chatStatusTime',_0x7dc9('0x4d'),_0x7dc9('0x4e'),_0x7dc9('0x4f'),_0x7dc9('0x50'),_0x7dc9('0x51'),'voiceStatusTime',_0x7dc9('0x52'),_0x7dc9('0x53'),_0x7dc9('0x54'),'phoneBarEnableScreenRecordingByAgent',_0x7dc9('0x55'),_0x7dc9('0x56')];var _0x2cf133=[_0x7dc9('0x4'),_0x7dc9('0x2b'),_0x7dc9('0x6'),'smsPause',_0x7dc9('0x2d'),_0x7dc9('0x5'),_0x7dc9('0x2c'),_0x7dc9('0x3e')];var _0x877a67=_(_0x3774cb)[_0x7dc9('0x57')](_0x2cf133)[_0x7dc9('0x58')](_0x42e110)[_0x7dc9('0x59')]();return _0x877a67;}exports[_0x7dc9('0x5a')]=filterAgentAttributes;function getRealtimeAgentsQueryFields(){return['id',_0x7dc9('0x2a'),_0x7dc9('0x39'),_0x7dc9('0x5b'),'internal',_0x7dc9('0x3e'),_0x7dc9('0x33'),_0x7dc9('0x5c'),_0x7dc9('0x3f'),_0x7dc9('0x2e'),'lastPauseAt',_0x7dc9('0x5'),_0x7dc9('0x4'),_0x7dc9('0x6'),_0x7dc9('0x2b'),_0x7dc9('0x7'),_0x7dc9('0x2c'),'whatsappPause','chatStatus','faxStatus',_0x7dc9('0x12'),_0x7dc9('0x13'),_0x7dc9('0x14'),_0x7dc9('0x15'),'whatsappStatus','chatStatusTime',_0x7dc9('0x51'),_0x7dc9('0x4e'),_0x7dc9('0x4d'),_0x7dc9('0x4f'),_0x7dc9('0x5d'),_0x7dc9('0x50'),_0x7dc9('0x41'),'faxCapacity',_0x7dc9('0x5e'),_0x7dc9('0x42'),_0x7dc9('0x43'),_0x7dc9('0x44'),_0x7dc9('0x46'),'faxCurrentCapacity',_0x7dc9('0x48'),_0x7dc9('0x47'),_0x7dc9('0x49'),_0x7dc9('0x4a'),_0x7dc9('0x5f'),_0x7dc9('0x55'),_0x7dc9('0x53'),_0x7dc9('0x60'),_0x7dc9('0x52'),_0x7dc9('0x56'),_0x7dc9('0x54')];}exports[_0x7dc9('0x61')]=getRealtimeAgentsQueryFields; \ No newline at end of file diff --git a/server/components/realtime/queues.js b/server/components/realtime/queues.js index 2169196..ae6f7c1 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 _0xc5f8=['available','paused','waiting','busy','inUse','invalid','loggedInDb','notInUse','onHold','ringing','ringInUse','talking','unavailable','unknown','pTalking','originated','message','statusMessage','dialActive','startProgressive','erlangCalls','erlangAbandonmentRate','erlangBusyFactor','dialPredictiveInterval','dialPredictiveIntervalMinThreshold','predictiveIntervalAvailable','predictiveIntervalTotalCalls','predictiveIntervalAnsweredCalls','predictiveIntervalDroppedCallsTimeout','predictiveIntervalDroppedCallsCallersExit','predictiveIntervalAvgHoldtime','voice','request','Queues','error','format','Unable\x20to\x20retrieve\x20RPC\x20%s\x20queues','result','catch','getRealtimeQueues','concat','outbound','map','merge','pick','initializeQueues','lodash','util','client'];(function(_0x2d876c,_0x29c04c){var _0x5d07f7=function(_0x5d327a){while(--_0x5d327a){_0x2d876c['push'](_0x2d876c['shift']());}};_0x5d07f7(++_0x29c04c);}(_0xc5f8,0xf2));var _0x8c5f=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xc5f8[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0x8c5f('0x0'));var jayson=require('jayson/promise');var util=require(_0x8c5f('0x1'));var amiClient=jayson[_0x8c5f('0x2')]['http']({'port':0x232a});var routingClient=jayson['client']['http']({'port':0x232c});var DEFAULT_QUEUE_ATTRIBUTES=[_0x8c5f('0x3'),'loggedIn',_0x8c5f('0x4'),_0x8c5f('0x5')];var VOICE_QUEUE_ATTRIBUTES=[_0x8c5f('0x6'),_0x8c5f('0x7'),_0x8c5f('0x8'),_0x8c5f('0x9'),_0x8c5f('0xa'),_0x8c5f('0xb'),_0x8c5f('0xc'),_0x8c5f('0xd'),_0x8c5f('0xe'),_0x8c5f('0xf'),_0x8c5f('0x10')];var OUTBOUND_QUEUE_ATTRIBUTES=[_0x8c5f('0x11'),_0x8c5f('0x12'),_0x8c5f('0x13'),_0x8c5f('0x14'),_0x8c5f('0x15'),'dialMethod','Trunk','startPredictive',_0x8c5f('0x16'),_0x8c5f('0x17'),'erlangCallToSecond',_0x8c5f('0x18'),_0x8c5f('0x19'),_0x8c5f('0x1a'),'dialPredictiveIntervalMaxThreshold',_0x8c5f('0x1b'),_0x8c5f('0x1c'),_0x8c5f('0x1d'),_0x8c5f('0x1e'),_0x8c5f('0x1f'),_0x8c5f('0x20'),_0x8c5f('0x21'),'predictiveIntervalAvgTalktime'];function getRealtimeQueues(_0x59b710,_0x2f3e75){var _0xfc4780=_0x2f3e75===_0x8c5f('0x22')?amiClient:routingClient;return _0xfc4780[_0x8c5f('0x23')](_['startCase'](_0x2f3e75)+_0x8c5f('0x24'),_0x59b710)['then'](function(_0x543c84){if(_0x543c84[_0x8c5f('0x25')])throw new Error(util[_0x8c5f('0x26')](_0x8c5f('0x27'),_0x2f3e75));return _0x543c84[_0x8c5f('0x28')];})[_0x8c5f('0x29')](function(_0x5e3cb0){throw _0x5e3cb0;});}exports[_0x8c5f('0x2a')]=getRealtimeQueues;function initializeQueues(_0x22481c,_0x43a470,_0xd5e78b,_0x54cac4){var _0x3704cf=DEFAULT_QUEUE_ATTRIBUTES;if(_0xd5e78b==='voice'){if(_0x54cac4==='inbound'){_0x3704cf=_0x3704cf[_0x8c5f('0x2b')](VOICE_QUEUE_ATTRIBUTES);}else if(_0x54cac4===_0x8c5f('0x2c')){_0x3704cf=_0x3704cf[_0x8c5f('0x2b')](VOICE_QUEUE_ATTRIBUTES,OUTBOUND_QUEUE_ATTRIBUTES);}}return _0x22481c[_0x8c5f('0x2d')](function(_0x227a16){var _0x1c3a10=_0x227a16['get']({'plain':!![]});_0x1c3a10[_0x8c5f('0x4')]=0x0;_0x1c3a10['loggedInDb']=0x0;_0x1c3a10['loggedIn']=0x0;_0x1c3a10[_0x8c5f('0x3')]=0x0;_0x1c3a10[_0x8c5f('0x5')]=0x0;if(_0xd5e78b==='voice'){_0x1c3a10[_0x8c5f('0xe')]=0x0;_0x1c3a10[_0x8c5f('0x6')]=0x0;if(_0x54cac4===_0x8c5f('0x2c')){_0x1c3a10[_0x8c5f('0x11')]=0x0;_0x1c3a10[_0x8c5f('0x12')]=0x0;}}var _0x19f596=_['find'](_0x43a470,['id',_0x1c3a10['id']]);if(_0x19f596){_[_0x8c5f('0x2e')](_0x1c3a10,_[_0x8c5f('0x2f')](_0x19f596,_0x3704cf));}return _0x1c3a10;});}exports[_0x8c5f('0x30')]=initializeQueues; \ No newline at end of file +var _0x2754=['originated','find','merge','pick','lodash','jayson/promise','util','http','waiting','inUse','invalid','loggedInDb','notInUse','onHold','ringing','ringInUse','unavailable','unknown','pTalking','statusMessage','dialActive','Trunk','startPredictive','startProgressive','erlangCalls','erlangCallToSecond','erlangAbandonmentRate','erlangBusyFactor','dialPredictiveInterval','dialPredictiveIntervalMaxThreshold','dialPredictiveIntervalMinThreshold','predictiveIntervalAvailable','predictiveIntervalTotalCalls','predictiveIntervalDroppedCallsTimeout','predictiveIntervalAvgHoldtime','predictiveIntervalAvgTalktime','request','startCase','Queues','then','error','Unable\x20to\x20retrieve\x20RPC\x20%s\x20queues','result','getRealtimeQueues','inbound','concat','map','get','paused','loggedIn','available','voice','talking','busy'];(function(_0x386b03,_0x5d0000){var _0xd3d524=function(_0x474754){while(--_0x474754){_0x386b03['push'](_0x386b03['shift']());}};_0xd3d524(++_0x5d0000);}(_0x2754,0x70));var _0x4275=function(_0x56bce4,_0x176888){_0x56bce4=_0x56bce4-0x0;var _0x4eca32=_0x2754[_0x56bce4];return _0x4eca32;};'use strict';var _=require(_0x4275('0x0'));var jayson=require(_0x4275('0x1'));var util=require(_0x4275('0x2'));var amiClient=jayson['client'][_0x4275('0x3')]({'port':0x232a});var routingClient=jayson['client'][_0x4275('0x3')]({'port':0x232c});var DEFAULT_QUEUE_ATTRIBUTES=['available','loggedIn','paused',_0x4275('0x4')];var VOICE_QUEUE_ATTRIBUTES=['busy',_0x4275('0x5'),_0x4275('0x6'),_0x4275('0x7'),_0x4275('0x8'),_0x4275('0x9'),_0x4275('0xa'),_0x4275('0xb'),'talking',_0x4275('0xc'),_0x4275('0xd')];var OUTBOUND_QUEUE_ATTRIBUTES=[_0x4275('0xe'),'originated','message',_0x4275('0xf'),_0x4275('0x10'),'dialMethod',_0x4275('0x11'),_0x4275('0x12'),_0x4275('0x13'),_0x4275('0x14'),_0x4275('0x15'),_0x4275('0x16'),_0x4275('0x17'),_0x4275('0x18'),_0x4275('0x19'),_0x4275('0x1a'),_0x4275('0x1b'),_0x4275('0x1c'),'predictiveIntervalAnsweredCalls',_0x4275('0x1d'),'predictiveIntervalDroppedCallsCallersExit',_0x4275('0x1e'),_0x4275('0x1f')];function getRealtimeQueues(_0x3d94f6,_0x13b458){var _0x101745=_0x13b458==='voice'?amiClient:routingClient;return _0x101745[_0x4275('0x20')](_[_0x4275('0x21')](_0x13b458)+_0x4275('0x22'),_0x3d94f6)[_0x4275('0x23')](function(_0xf7eb31){if(_0xf7eb31[_0x4275('0x24')])throw new Error(util['format'](_0x4275('0x25'),_0x13b458));return _0xf7eb31[_0x4275('0x26')];})['catch'](function(_0x2a8614){throw _0x2a8614;});}exports[_0x4275('0x27')]=getRealtimeQueues;function initializeQueues(_0x1f878f,_0x5f583e,_0x5ed9c1,_0x5d9762){var _0x4b4d77=DEFAULT_QUEUE_ATTRIBUTES;if(_0x5ed9c1==='voice'){if(_0x5d9762===_0x4275('0x28')){_0x4b4d77=_0x4b4d77[_0x4275('0x29')](VOICE_QUEUE_ATTRIBUTES);}else if(_0x5d9762==='outbound'){_0x4b4d77=_0x4b4d77[_0x4275('0x29')](VOICE_QUEUE_ATTRIBUTES,OUTBOUND_QUEUE_ATTRIBUTES);}}return _0x1f878f[_0x4275('0x2a')](function(_0x59e4cd){var _0x251b24=_0x59e4cd[_0x4275('0x2b')]({'plain':!![]});_0x251b24[_0x4275('0x2c')]=0x0;_0x251b24[_0x4275('0x7')]=0x0;_0x251b24[_0x4275('0x2d')]=0x0;_0x251b24[_0x4275('0x2e')]=0x0;_0x251b24[_0x4275('0x4')]=0x0;if(_0x5ed9c1===_0x4275('0x2f')){_0x251b24[_0x4275('0x30')]=0x0;_0x251b24[_0x4275('0x31')]=0x0;if(_0x5d9762==='outbound'){_0x251b24[_0x4275('0xe')]=0x0;_0x251b24[_0x4275('0x32')]=0x0;}}var _0xe93dcb=_[_0x4275('0x33')](_0x5f583e,['id',_0x251b24['id']]);if(_0xe93dcb){_[_0x4275('0x34')](_0x251b24,_[_0x4275('0x35')](_0xe93dcb,_0x4b4d77));}return _0x251b24;});}exports['initializeQueues']=initializeQueues; \ No newline at end of file diff --git a/server/config/express.js b/server/config/express.js index 3db8c5d..90eafd4 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(_0x28107d,_0x2ec8b3){var _0x2b1cbe=function(_0x5b06ad){while(--_0x5b06ad){_0x28107d['push'](_0x28107d['shift']());}};_0x2b1cbe(++_0x2ec8b3);}(_0xa9e0,0x123));var _0x0a9e=function(_0x37c22c,_0x28a70d){_0x37c22c=_0x37c22c-0x0;var _0x119d79=_0xa9e0[_0x37c22c];return _0x119d79;};'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(_0xf61c79,_0x43c6fa){var _0x127d26=function(_0x598bf6){while(--_0x598bf6){_0xf61c79['push'](_0xf61c79['shift']());}};_0x127d26(++_0x43c6fa);}(_0xa9e0,0x123));var _0x0a9e=function(_0x4c7fb5,_0x2548ef){_0x4c7fb5=_0x4c7fb5-0x0;var _0x2e10ac=_0xa9e0[_0x4c7fb5];return _0x2e10ac;};'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 554af19..67e95c1 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 _0x455b=['map','model','join','update','digest','getUuid','platform','licenseToken','test','win32','dmidecode\x20--string\x20system-uuid','utf8','hostname','ipAddress','createHash','md5','hex','substring','lodash','crypto','bimedia-machine-uuid','child_process','orderBy','keys','length','filter','family','internal','concat','head','mac','00:00:00:00:00:00','address','127.0.0.1','getFirstInterface','cpus'];(function(_0x154efd,_0x27c90d){var _0x331e99=function(_0x3458ad){while(--_0x3458ad){_0x154efd['push'](_0x154efd['shift']());}};_0x331e99(++_0x27c90d);}(_0x455b,0x1e6));var _0xb455=function(_0x5471ca,_0xa83bde){_0x5471ca=_0x5471ca-0x0;var _0x4f80d7=_0x455b[_0x5471ca];return _0x4f80d7;};'use strict';var _=require(_0xb455('0x0'));var os=require('os');var crypto=require(_0xb455('0x1'));var machine=require(_0xb455('0x2'));var exec=require(_0xb455('0x3'))['execSync'];var config=require('../environment');function getInterfaces(){var _0x1144e4=[];var _0x334728=os['networkInterfaces']();var _0x14d3db=_[_0xb455('0x4')](_[_0xb455('0x5')](_0x334728));for(var _0x5f0a42=0x0;_0x5f0a42<_0x14d3db[_0xb455('0x6')];_0x5f0a42++){var _0x287b70=_0x334728[_0x14d3db[_0x5f0a42]][_0xb455('0x7')](function(_0xbbbb2){return _0xbbbb2[_0xb455('0x8')]==='IPv4'&&_0xbbbb2[_0xb455('0x9')]===![];});_0x1144e4=_0x1144e4[_0xb455('0xa')](_0x287b70);}return _0x1144e4;}function getFirstInterface(){var _0x262309=_[_0xb455('0xb')](getInterfaces());return{'macAddress':_0x262309&&_0x262309[_0xb455('0xc')]?_0x262309[_0xb455('0xc')]:_0xb455('0xd'),'ipAddress':_0x262309&&_0x262309[_0xb455('0xe')]?_0x262309['address']:_0xb455('0xf')};}exports[_0xb455('0x10')]=getFirstInterface;function getCPUhash(){var _0x55a71b=_[_0xb455('0x4')](os[_0xb455('0x11')]()[_0xb455('0x12')](function(_0x35ecd8){return _0x35ecd8[_0xb455('0x13')];}))[_0xb455('0x14')](':');return crypto['createHash']('md5')[_0xb455('0x15')](_0x55a71b)[_0xb455('0x16')]('hex');}exports[_0xb455('0x17')]=function(){var _0x32c965=os[_0xb455('0x18')]();var _0x2693af=/[0-9a-f-]{36}/;if(config[_0xb455('0x19')]&&_0x2693af[_0xb455('0x1a')](config[_0xb455('0x19')])){return config[_0xb455('0x19')];}else if(_0x32c965===_0xb455('0x1b')){return exec(_0xb455('0x1c'),{'encoding':_0xb455('0x1d')})['replace']('\x0d\x0a','');}else{var _0x2e4d20=getFirstInterface();var _0x5c7a8b=getCPUhash();var _0x9e40d5=_0x5c7a8b+'|'+os[_0xb455('0x1e')]()+'|'+_0x2e4d20['macAddress']+'|'+_0x2e4d20[_0xb455('0x1f')];var _0x3e60ad=crypto[_0xb455('0x20')](_0xb455('0x21'))[_0xb455('0x15')](_0x9e40d5)['digest'](_0xb455('0x22'));return _0x3e60ad[_0xb455('0x23')](0x0,0x8)+'-'+_0x3e60ad[_0xb455('0x23')](0x8,0xc)+'-'+_0x3e60ad[_0xb455('0x23')](0xc,0x10)+'-'+_0x3e60ad[_0xb455('0x23')](0x10,0x14)+'-'+_0x3e60ad['substring'](0x14);}}; \ No newline at end of file +var _0x2ad2=['127.0.0.1','cpus','map','join','createHash','update','digest','hex','getUuid','platform','licenseToken','test','win32','dmidecode\x20--string\x20system-uuid','utf8','replace','macAddress','ipAddress','substring','lodash','crypto','bimedia-machine-uuid','child_process','networkInterfaces','orderBy','keys','length','filter','family','internal','concat','head','mac','00:00:00:00:00:00','address'];(function(_0x3ce0d4,_0x3711c6){var _0x498a62=function(_0x48400b){while(--_0x48400b){_0x3ce0d4['push'](_0x3ce0d4['shift']());}};_0x498a62(++_0x3711c6);}(_0x2ad2,0x9f));var _0x22ad=function(_0x40292e,_0xaa2a7b){_0x40292e=_0x40292e-0x0;var _0x1ed986=_0x2ad2[_0x40292e];return _0x1ed986;};'use strict';var _=require(_0x22ad('0x0'));var os=require('os');var crypto=require(_0x22ad('0x1'));var machine=require(_0x22ad('0x2'));var exec=require(_0x22ad('0x3'))['execSync'];var config=require('../environment');function getInterfaces(){var _0x55e6a7=[];var _0x540215=os[_0x22ad('0x4')]();var _0x3137d0=_[_0x22ad('0x5')](_[_0x22ad('0x6')](_0x540215));for(var _0x295793=0x0;_0x295793<_0x3137d0[_0x22ad('0x7')];_0x295793++){var _0x21ab5d=_0x540215[_0x3137d0[_0x295793]][_0x22ad('0x8')](function(_0xcc1ce5){return _0xcc1ce5[_0x22ad('0x9')]==='IPv4'&&_0xcc1ce5[_0x22ad('0xa')]===![];});_0x55e6a7=_0x55e6a7[_0x22ad('0xb')](_0x21ab5d);}return _0x55e6a7;}function getFirstInterface(){var _0x28cae5=_[_0x22ad('0xc')](getInterfaces());return{'macAddress':_0x28cae5&&_0x28cae5[_0x22ad('0xd')]?_0x28cae5[_0x22ad('0xd')]:_0x22ad('0xe'),'ipAddress':_0x28cae5&&_0x28cae5[_0x22ad('0xf')]?_0x28cae5[_0x22ad('0xf')]:_0x22ad('0x10')};}exports['getFirstInterface']=getFirstInterface;function getCPUhash(){var _0x47af86=_['orderBy'](os[_0x22ad('0x11')]()[_0x22ad('0x12')](function(_0x34dd37){return _0x34dd37['model'];}))[_0x22ad('0x13')](':');return crypto[_0x22ad('0x14')]('md5')[_0x22ad('0x15')](_0x47af86)[_0x22ad('0x16')](_0x22ad('0x17'));}exports[_0x22ad('0x18')]=function(){var _0x2b7f27=os[_0x22ad('0x19')]();var _0x2078ed=/[0-9a-f-]{36}/;if(config[_0x22ad('0x1a')]&&_0x2078ed[_0x22ad('0x1b')](config[_0x22ad('0x1a')])){return config[_0x22ad('0x1a')];}else if(_0x2b7f27===_0x22ad('0x1c')){return exec(_0x22ad('0x1d'),{'encoding':_0x22ad('0x1e')})[_0x22ad('0x1f')]('\x0d\x0a','');}else{var _0x55abfc=getFirstInterface();var _0xc7f638=getCPUhash();var _0x39404a=_0xc7f638+'|'+os['hostname']()+'|'+_0x55abfc[_0x22ad('0x20')]+'|'+_0x55abfc[_0x22ad('0x21')];var _0x1ec304=crypto['createHash']('md5')[_0x22ad('0x15')](_0x39404a)[_0x22ad('0x16')]('hex');return _0x1ec304['substring'](0x0,0x8)+'-'+_0x1ec304[_0x22ad('0x22')](0x8,0xc)+'-'+_0x1ec304[_0x22ad('0x22')](0xc,0x10)+'-'+_0x1ec304['substring'](0x10,0x14)+'-'+_0x1ec304[_0x22ad('0x22')](0x14);}}; \ No newline at end of file diff --git a/server/config/license/index.js b/server/config/license/index.js index 30af5ed..506ab94 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 _0xf213=['data2','info','THE\x20LICENSE\x20HAS\x20BEEN\x20ENABLED','THE\x20LICENSE\x20HAS\x20BEEN\x20UPDATED','update','data1','Disabled','NEW\x20UUID\x20DETECTED:\x20FROM\x20%s\x20TO\x20%s','%s\x20-\x20GRAY\x20PERIOD\x20STARTED\x20AT\x20%s','toUpperCase','YYYY-MM-DD\x20HH:mm','encryptString','decryptString','days','DEMO\x20START\x20AT\x20%s','error','finally','getUuid','License','findOrCreate','SERVICE\x20LICENSE\x20STARTED\x20%s','message','util','moment','request-promise','bluebird','pkginfo','../../mysqldb','../../components/encryptor','./hardware','../logger','license','format','%s/api/servers/%s/check?version=%s','exports','version','GET','then','catch','get'];(function(_0x3fdb14,_0x1a4585){var _0x4fb736=function(_0x5d195b){while(--_0x5d195b){_0x3fdb14['push'](_0x3fdb14['shift']());}};_0x4fb736(++_0x1a4585);}(_0xf213,0x156));var _0x3f21=function(_0x156b2d,_0x396cba){_0x156b2d=_0x156b2d-0x0;var _0x584a81=_0xf213[_0x156b2d];return _0x584a81;};'use strict';var util=require(_0x3f21('0x0'));var moment=require(_0x3f21('0x1'));var rp=require(_0x3f21('0x2'));var BPromise=require(_0x3f21('0x3'));var pkginfo=require(_0x3f21('0x4'))(module,'version');var db=require(_0x3f21('0x5'))['db'];var encryptor=require(_0x3f21('0x6'));var hardware=require(_0x3f21('0x7'));var logger=require(_0x3f21('0x8'))(_0x3f21('0x9'));var HOST='https://www.xcallymotion.com';var TIME=0x3c*0x1388;var DAYS=0x7;var GRAY_PERIOD_REASON;var oldToken;var isOldTokenSent=![];function httpRequest(_0x6a45d7){return new BPromise(function(_0xeaea20,_0x5a2452){var _0x5cc93b=util[_0x3f21('0xa')](_0x3f21('0xb'),HOST,_0x6a45d7,module['exports']['version']);if(oldToken){_0x5cc93b=util[_0x3f21('0xa')]('%s/api/servers/%s/check?version=%s&oldtoken=%s',HOST,_0x6a45d7,module[_0x3f21('0xc')][_0x3f21('0xd')],oldToken);}var _0x288c9c={'uri':_0x5cc93b,'method':_0x3f21('0xe'),'timeout':0xea60,'json':!![]};return rp(_0x288c9c)[_0x3f21('0xf')](function(_0x312b40){_0xeaea20(_0x312b40);})[_0x3f21('0x10')](function(_0x25724e){_0x5a2452(_0x25724e);});});}function manageLicense(_0xc1d43e,_0x424cd4){var _0x47d0e1=_0x424cd4[_0x3f21('0x11')]({'plain':!![]});if(!isOldTokenSent&&_0x47d0e1['data1']!==_0xc1d43e&&!_0x47d0e1[_0x3f21('0x12')]){oldToken=_0x47d0e1['data1'];}httpRequest(_0xc1d43e)['then'](function(_0x560677){if(oldToken){oldToken=undefined;isOldTokenSent=!![];}if(_0x560677['active']){isOldTokenSent=![];if(!_0x47d0e1['license']&&_0x47d0e1[_0x3f21('0x9')]!=_0x560677[_0x3f21('0x9')]||_0x47d0e1[_0x3f21('0x9')]&&_0x47d0e1[_0x3f21('0x12')]){logger[_0x3f21('0x13')](_0x3f21('0x14'));}if(_0x47d0e1[_0x3f21('0x9')]&&!_0x47d0e1[_0x3f21('0x12')]&&_0x47d0e1[_0x3f21('0x9')]!=_0x560677['license']){logger['info'](_0x3f21('0x15'));}if(_0x47d0e1['license']&&!_0x47d0e1['data2']&&_0x47d0e1['license']==_0x560677['license']){return _0x424cd4;}return _0x424cd4[_0x3f21('0x16')]({'data1':_0xc1d43e,'data2':null,'license':_0x560677[_0x3f21('0x9')]});}else{if(_0x560677[_0x3f21('0x9')]||_0x47d0e1[_0x3f21('0x9')]){if(!_0x47d0e1[_0x3f21('0x12')]){if(_0x47d0e1[_0x3f21('0x17')]==_0xc1d43e){GRAY_PERIOD_REASON=_0x3f21('0x18');logger[_0x3f21('0x13')]('THE\x20LICENSE\x20HAS\x20BEEN\x20DISABLED');}else{GRAY_PERIOD_REASON='Changed';logger[_0x3f21('0x13')](_0x3f21('0x19'),_0x47d0e1[_0x3f21('0x17')],_0xc1d43e);}logger[_0x3f21('0x13')](_0x3f21('0x1a'),GRAY_PERIOD_REASON[_0x3f21('0x1b')](),moment()[_0x3f21('0xa')](_0x3f21('0x1c')));return _0x424cd4['update']({'data2':encryptor[_0x3f21('0x1d')](moment()[_0x3f21('0xa')](_0x3f21('0x1c')))});}else{if(moment()['diff'](encryptor[_0x3f21('0x1e')](_0x47d0e1[_0x3f21('0x12')]),_0x3f21('0x1f'))>DAYS){logger[_0x3f21('0x13')](_0x3f21('0x20'),moment()[_0x3f21('0xa')](_0x3f21('0x1c')));isOldTokenSent=![];return _0x424cd4[_0x3f21('0x16')]({'data1':_0xc1d43e,'data2':null,'license':null});}}}else{if(_0x47d0e1[_0x3f21('0x17')]!=_0xc1d43e){logger['info'](_0x3f21('0x19'),_0x47d0e1[_0x3f21('0x17')],_0xc1d43e);return _0x424cd4[_0x3f21('0x16')]({'data1':_0xc1d43e,'data2':null,'license':null});}}}return _0x424cd4;})['then'](function(_0x1f237e){_0x424cd4=_0x1f237e;})[_0x3f21('0x10')](function(_0x2ecc43){logger[_0x3f21('0x21')](_0x2ecc43['message']);})[_0x3f21('0x22')](function(){setTimeout(function(){manageLicense(hardware[_0x3f21('0x23')](),_0x424cd4);},TIME);});}function defaultLicense(){var _0xd62c3b=hardware[_0x3f21('0x23')]();if(_0xd62c3b){return db[_0x3f21('0x24')][_0x3f21('0x25')]({'where':{'id':0x1},'defaults':{'data1':_0xd62c3b}})['spread'](function(_0x3a483e,_0x45a8d2){logger['info'](_0x3f21('0x26'),_0xd62c3b);manageLicense(_0xd62c3b,_0x3a483e);})[_0x3f21('0x10')](function(_0x13ce68){logger[_0x3f21('0x21')](_0x13ce68[_0x3f21('0x27')]);});}}exports['default']=defaultLicense; \ No newline at end of file +var _0xf49d=['data2','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','diff','days','error','finally','getUuid','License','findOrCreate','spread','message','default','moment','request-promise','bluebird','pkginfo','version','../../mysqldb','../../components/encryptor','./hardware','license','https://www.xcallymotion.com','%s/api/servers/%s/check?version=%s','exports','format','%s/api/servers/%s/check?version=%s&oldtoken=%s','GET','then','catch','get','data1','active'];(function(_0xedaf84,_0x2c55e5){var _0x20e286=function(_0x3d548f){while(--_0x3d548f){_0xedaf84['push'](_0xedaf84['shift']());}};_0x20e286(++_0x2c55e5);}(_0xf49d,0x13c));var _0xdf49=function(_0x50c587,_0x1dd1cb){_0x50c587=_0x50c587-0x0;var _0x10b04e=_0xf49d[_0x50c587];return _0x10b04e;};'use strict';var util=require('util');var moment=require(_0xdf49('0x0'));var rp=require(_0xdf49('0x1'));var BPromise=require(_0xdf49('0x2'));var pkginfo=require(_0xdf49('0x3'))(module,_0xdf49('0x4'));var db=require(_0xdf49('0x5'))['db'];var encryptor=require(_0xdf49('0x6'));var hardware=require(_0xdf49('0x7'));var logger=require('../logger')(_0xdf49('0x8'));var HOST=_0xdf49('0x9');var TIME=0x3c*0x1388;var DAYS=0x7;var GRAY_PERIOD_REASON;var oldToken;var isOldTokenSent=![];function httpRequest(_0x3fe96d){return new BPromise(function(_0x1db62d,_0x3e0627){var _0xde0304=util['format'](_0xdf49('0xa'),HOST,_0x3fe96d,module[_0xdf49('0xb')][_0xdf49('0x4')]);if(oldToken){_0xde0304=util[_0xdf49('0xc')](_0xdf49('0xd'),HOST,_0x3fe96d,module['exports'][_0xdf49('0x4')],oldToken);}var _0x54b40b={'uri':_0xde0304,'method':_0xdf49('0xe'),'timeout':0xea60,'json':!![]};return rp(_0x54b40b)[_0xdf49('0xf')](function(_0x80fa19){_0x1db62d(_0x80fa19);})[_0xdf49('0x10')](function(_0x4cc18d){_0x3e0627(_0x4cc18d);});});}function manageLicense(_0xd16114,_0x420baa){var _0x1904fc=_0x420baa[_0xdf49('0x11')]({'plain':!![]});if(!isOldTokenSent&&_0x1904fc[_0xdf49('0x12')]!==_0xd16114&&!_0x1904fc['data2']){oldToken=_0x1904fc[_0xdf49('0x12')];}httpRequest(_0xd16114)[_0xdf49('0xf')](function(_0x5bbeff){if(oldToken){oldToken=undefined;isOldTokenSent=!![];}if(_0x5bbeff[_0xdf49('0x13')]){isOldTokenSent=![];if(!_0x1904fc[_0xdf49('0x8')]&&_0x1904fc['license']!=_0x5bbeff[_0xdf49('0x8')]||_0x1904fc['license']&&_0x1904fc[_0xdf49('0x14')]){logger[_0xdf49('0x15')](_0xdf49('0x16'));}if(_0x1904fc[_0xdf49('0x8')]&&!_0x1904fc[_0xdf49('0x14')]&&_0x1904fc[_0xdf49('0x8')]!=_0x5bbeff[_0xdf49('0x8')]){logger['info'](_0xdf49('0x17'));}if(_0x1904fc['license']&&!_0x1904fc['data2']&&_0x1904fc['license']==_0x5bbeff[_0xdf49('0x8')]){return _0x420baa;}return _0x420baa[_0xdf49('0x18')]({'data1':_0xd16114,'data2':null,'license':_0x5bbeff[_0xdf49('0x8')]});}else{if(_0x5bbeff['license']||_0x1904fc[_0xdf49('0x8')]){if(!_0x1904fc[_0xdf49('0x14')]){if(_0x1904fc[_0xdf49('0x12')]==_0xd16114){GRAY_PERIOD_REASON=_0xdf49('0x19');logger[_0xdf49('0x15')](_0xdf49('0x1a'));}else{GRAY_PERIOD_REASON=_0xdf49('0x1b');logger[_0xdf49('0x15')](_0xdf49('0x1c'),_0x1904fc['data1'],_0xd16114);}logger[_0xdf49('0x15')](_0xdf49('0x1d'),GRAY_PERIOD_REASON[_0xdf49('0x1e')](),moment()[_0xdf49('0xc')](_0xdf49('0x1f')));return _0x420baa['update']({'data2':encryptor['encryptString'](moment()['format'](_0xdf49('0x1f')))});}else{if(moment()[_0xdf49('0x20')](encryptor['decryptString'](_0x1904fc[_0xdf49('0x14')]),_0xdf49('0x21'))>DAYS){logger[_0xdf49('0x15')]('DEMO\x20START\x20AT\x20%s',moment()[_0xdf49('0xc')](_0xdf49('0x1f')));isOldTokenSent=![];return _0x420baa['update']({'data1':_0xd16114,'data2':null,'license':null});}}}else{if(_0x1904fc[_0xdf49('0x12')]!=_0xd16114){logger[_0xdf49('0x15')](_0xdf49('0x1c'),_0x1904fc['data1'],_0xd16114);return _0x420baa[_0xdf49('0x18')]({'data1':_0xd16114,'data2':null,'license':null});}}}return _0x420baa;})[_0xdf49('0xf')](function(_0x1a3a39){_0x420baa=_0x1a3a39;})['catch'](function(_0x3464ea){logger[_0xdf49('0x22')](_0x3464ea['message']);})[_0xdf49('0x23')](function(){setTimeout(function(){manageLicense(hardware[_0xdf49('0x24')](),_0x420baa);},TIME);});}function defaultLicense(){var _0x30b5a1=hardware[_0xdf49('0x24')]();if(_0x30b5a1){return db[_0xdf49('0x25')][_0xdf49('0x26')]({'where':{'id':0x1},'defaults':{'data1':_0x30b5a1}})[_0xdf49('0x27')](function(_0x8c5b80,_0x12b853){logger[_0xdf49('0x15')]('SERVICE\x20LICENSE\x20STARTED\x20%s',_0x30b5a1);manageLicense(_0x30b5a1,_0x8c5b80);})[_0xdf49('0x10')](function(_0x1afbed){logger[_0xdf49('0x22')](_0x1afbed[_0xdf49('0x28')]);});}}exports[_0xdf49('0x29')]=defaultLicense; \ No newline at end of file diff --git a/server/config/license/util.js b/server/config/license/util.js index db27422..e8e497c 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 _0x5a91=['%s:%s:%s','parse','demo','machineUuid','deadline','add','days','grayReason','uuid','changed','message','User','role','sequelize','COUNT','count','admin','user','users','forEach','countBy','telephone','License\x20limit\x20reached\x20for\x20users','License\x20limit\x20reached\x20for\x20telephones','exports','util','lodash','moment','./hardware','../../components/encryptor','../../mysqldb','2027-01-01T00:00:00.000Z','getUuid','Breaking\x20license','find','then','catch','data1','license','isEmpty','License\x20key\x20value\x20not\x20found','data2','split','decryptString','format'];(function(_0x11d25d,_0x1c92f4){var _0x5a7003=function(_0x4f50ca){while(--_0x4f50ca){_0x11d25d['push'](_0x11d25d['shift']());}};_0x5a7003(++_0x1c92f4);}(_0x5a91,0x154));var _0x15a9=function(_0x5a0ed5,_0x83f521){_0x5a0ed5=_0x5a0ed5-0x0;var _0x18601d=_0x5a91[_0x5a0ed5];return _0x18601d;};'use strict';var util=require(_0x15a9('0x0'));var _=require(_0x15a9('0x1'));var moment=require(_0x15a9('0x2'));var BPromise=require('bluebird');var hardware=require(_0x15a9('0x3'));var encryptor=require(_0x15a9('0x4'));var db=require(_0x15a9('0x5'))['db'];const demoLicense={'demo':!![],'agents':0x2,'telephones':0x0,'users':0x1,'expiration':_0x15a9('0x6'),'chat':![],'mail':![],'fax':![],'messaging':![],'whatsapp':![],'cm':![],'dialer':![],'jscripty':![],'openchannel':![],'callysquare':0x2,'webrtc':![],'jaws':![],'custom':![],'description':'Demo\x20license','machineUuid':hardware[_0x15a9('0x7')](),'virtual':0x0,'voice':!![],'screenrecording':![],'preferred':![],'ai':![]};const breakingLicense={'breaking':!![],'demo':!![],'agents':0x2,'telephones':0x0,'users':0x1,'expiration':_0x15a9('0x6'),'chat':![],'mail':![],'fax':![],'messaging':![],'whatsapp':![],'cm':![],'dialer':![],'jscripty':![],'openchannel':![],'callysquare':0x2,'webrtc':![],'jaws':![],'custom':![],'update':![],'description':_0x15a9('0x8'),'machineUuid':hardware[_0x15a9('0x7')](),'virtual':0x0,'voice':!![],'screenrecording':![],'preferred':![],'ai':![]};function getLicense(_0x4723b0){return new BPromise(function(_0x479910,_0x103415){return db['License'][_0x15a9('0x9')](_['defaults'](_0x4723b0,{'raw':!![],'where':{'id':0x1}}))[_0x15a9('0xa')](function(_0x1ccb00){return checkLicense(_0x1ccb00,null);})[_0x15a9('0xa')](function(_0x5d0af4){_0x479910(_0x5d0af4);return;})[_0x15a9('0xb')](function(_0x5ebdcf){_0x103415(_0x5ebdcf);});});}function checkLicense(_0x2329db,_0x2ca09e){if(!_0x2329db){demoLicense['uuid']=_0x2329db[_0x15a9('0xc')];return demoLicense;}try{var _0x413aa8=_0x2ca09e||_0x2329db[_0x15a9('0xd')];if(_[_0x15a9('0xe')](_0x413aa8)){throw new Error(_0x15a9('0xf'));}var _0x10faee=_0x2329db[_0x15a9('0xc')];var _0x22be45=_0x2329db[_0x15a9('0x10')];var _0x4cbd3a=_0x10faee[_0x15a9('0x11')]('-')[0x4];var _0x3f9d4a=_0x10faee[_0x15a9('0x11')]('-')[0x0];var _0x116a0a=encryptor[_0x15a9('0x12')](_0x413aa8,util[_0x15a9('0x13')](_0x15a9('0x14'),_0x4cbd3a,_0x10faee,_0x3f9d4a));var _0x267e2e=JSON[_0x15a9('0x15')](_0x116a0a);_0x267e2e[_0x15a9('0x16')]=![];_0x267e2e['uuid']=_0x10faee;_0x267e2e[_0x15a9('0x17')]=hardware[_0x15a9('0x7')]();if(_0x22be45){var _0x550583=encryptor[_0x15a9('0x12')](_0x22be45);_0x267e2e['gray']=_0x550583;_0x267e2e[_0x15a9('0x18')]=moment(_0x550583)[_0x15a9('0x19')](0x7,_0x15a9('0x1a'))['format']();_0x267e2e[_0x15a9('0x1b')]=_0x267e2e[_0x15a9('0x1c')]!=_0x267e2e[_0x15a9('0x17')]?_0x15a9('0x1d'):'disabled';}return _0x267e2e;}catch(_0x1080c3){breakingLicense[_0x15a9('0x1c')]=_0x2329db[_0x15a9('0xc')];breakingLicense[_0x15a9('0x1e')]=_0x1080c3[_0x15a9('0x1e')];return breakingLicense;}}function getLimits(){return new BPromise(function(_0x25adb6,_0x20186b){getLicense()['then'](function(_0x357dc4){return db[_0x15a9('0x1f')]['findAll']({'attributes':[_0x15a9('0x20'),[db[_0x15a9('0x21')]['fn'](_0x15a9('0x22'),db['sequelize']['col'](_0x15a9('0x20'))),_0x15a9('0x23')]],'group':_0x15a9('0x20'),'where':{'role':{'$or':[_0x15a9('0x24'),_0x15a9('0x25'),'telephone']}},'raw':!![]})[_0x15a9('0xa')](function(_0x5e857f){var _0x62b42e={'user':_0x357dc4[_0x15a9('0x26')]||0x0,'telephone':_0x357dc4['telephones']||0x0};_0x5e857f[_0x15a9('0x27')](function(_0x2f476c){var _0x3931ef=_0x2f476c[_0x15a9('0x20')]===_0x15a9('0x24')?_0x15a9('0x25'):_0x2f476c[_0x15a9('0x20')];_0x62b42e[_0x3931ef]-=_0x2f476c[_0x15a9('0x23')];if(_0x62b42e[_0x3931ef]<0x0)_0x62b42e[_0x3931ef]=0x0;});_0x25adb6(_0x62b42e);return;});})[_0x15a9('0xb')](function(_0x2a1122){_0x20186b(_0x2a1122);});});}function checkUserLimits(_0x28285c){return new BPromise(function(_0xcda6b,_0x3ab681){getLimits()[_0x15a9('0xa')](function(_0x158d70){var _0x5b93e7=_['pick'](_[_0x15a9('0x28')](_0x28285c,_0x15a9('0x20')),[_0x15a9('0x24'),_0x15a9('0x25'),_0x15a9('0x29')]);var _0x2f1f1b=(_0x5b93e7['admin']||0x0)+(_0x5b93e7[_0x15a9('0x25')]||0x0);var _0x5374f6=_0x5b93e7[_0x15a9('0x29')]||0x0;if(_0x2f1f1b>_0x158d70['user'])return _0x3ab681(_0x15a9('0x2a'));if(_0x5374f6>_0x158d70[_0x15a9('0x29')])return _0x3ab681(_0x15a9('0x2b'));return _0xcda6b();})[_0x15a9('0xb')](function(_0x11020f){_0x3ab681(_0x11020f);});});}module[_0x15a9('0x2c')]={'checkLicense':checkLicense,'checkUserLimits':checkUserLimits,'getLicense':getLicense}; \ No newline at end of file +var _0x6750=['role','count','admin','telephone','users','telephones','forEach','user','catch','pick','countBy','exports','../../mysqldb','2027-01-01T00:00:00.000Z','getUuid','defaults','then','data1','license','isEmpty','data2','split','decryptString','parse','demo','machineUuid','gray','days','format','changed','uuid','message','User','findAll','COUNT','sequelize'];(function(_0x1facfa,_0x1acf7d){var _0x9ec701=function(_0x115e37){while(--_0x115e37){_0x1facfa['push'](_0x1facfa['shift']());}};_0x9ec701(++_0x1acf7d);}(_0x6750,0x198));var _0x0675=function(_0x3abd23,_0x7e9e27){_0x3abd23=_0x3abd23-0x0;var _0x467a5a=_0x6750[_0x3abd23];return _0x467a5a;};'use strict';var util=require('util');var _=require('lodash');var moment=require('moment');var BPromise=require('bluebird');var hardware=require('./hardware');var encryptor=require('../../components/encryptor');var db=require(_0x0675('0x0'))['db'];const demoLicense={'demo':!![],'agents':0x2,'telephones':0x0,'users':0x1,'expiration':'2027-01-01T00:00:00.000Z','chat':![],'mail':![],'fax':![],'messaging':![],'whatsapp':![],'cm':![],'dialer':![],'jscripty':![],'openchannel':![],'callysquare':0x2,'webrtc':![],'jaws':![],'custom':![],'description':'Demo\x20license','machineUuid':hardware['getUuid'](),'virtual':0x0,'voice':!![],'screenrecording':![],'preferred':![],'ai':![]};const breakingLicense={'breaking':!![],'demo':!![],'agents':0x2,'telephones':0x0,'users':0x1,'expiration':_0x0675('0x1'),'chat':![],'mail':![],'fax':![],'messaging':![],'whatsapp':![],'cm':![],'dialer':![],'jscripty':![],'openchannel':![],'callysquare':0x2,'webrtc':![],'jaws':![],'custom':![],'update':![],'description':'Breaking\x20license','machineUuid':hardware[_0x0675('0x2')](),'virtual':0x0,'voice':!![],'screenrecording':![],'preferred':![],'ai':![]};function getLicense(_0x6a33c0){return new BPromise(function(_0x86e677,_0x56162c){return db['License']['find'](_[_0x0675('0x3')](_0x6a33c0,{'raw':!![],'where':{'id':0x1}}))[_0x0675('0x4')](function(_0x8d344e){return checkLicense(_0x8d344e,null);})[_0x0675('0x4')](function(_0xd08a85){_0x86e677(_0xd08a85);return;})['catch'](function(_0x475e21){_0x56162c(_0x475e21);});});}function checkLicense(_0x3baf21,_0x481b2d){if(!_0x3baf21){demoLicense['uuid']=_0x3baf21[_0x0675('0x5')];return demoLicense;}try{var _0x59a084=_0x481b2d||_0x3baf21[_0x0675('0x6')];if(_[_0x0675('0x7')](_0x59a084)){throw new Error('License\x20key\x20value\x20not\x20found');}var _0x338b55=_0x3baf21[_0x0675('0x5')];var _0x5db329=_0x3baf21[_0x0675('0x8')];var _0x103e01=_0x338b55[_0x0675('0x9')]('-')[0x4];var _0xb11c19=_0x338b55[_0x0675('0x9')]('-')[0x0];var _0x3a7ab2=encryptor[_0x0675('0xa')](_0x59a084,util['format']('%s:%s:%s',_0x103e01,_0x338b55,_0xb11c19));var _0x5effaa=JSON[_0x0675('0xb')](_0x3a7ab2);_0x5effaa[_0x0675('0xc')]=![];_0x5effaa['uuid']=_0x338b55;_0x5effaa[_0x0675('0xd')]=hardware[_0x0675('0x2')]();if(_0x5db329){var _0x378fd5=encryptor['decryptString'](_0x5db329);_0x5effaa[_0x0675('0xe')]=_0x378fd5;_0x5effaa['deadline']=moment(_0x378fd5)['add'](0x7,_0x0675('0xf'))[_0x0675('0x10')]();_0x5effaa['grayReason']=_0x5effaa['uuid']!=_0x5effaa[_0x0675('0xd')]?_0x0675('0x11'):'disabled';}return _0x5effaa;}catch(_0x19f3b7){breakingLicense[_0x0675('0x12')]=_0x3baf21[_0x0675('0x5')];breakingLicense['message']=_0x19f3b7[_0x0675('0x13')];return breakingLicense;}}function getLimits(){return new BPromise(function(_0x1a4ccf,_0x458c1b){getLicense()[_0x0675('0x4')](function(_0x34c7e1){return db[_0x0675('0x14')][_0x0675('0x15')]({'attributes':['role',[db['sequelize']['fn'](_0x0675('0x16'),db[_0x0675('0x17')]['col'](_0x0675('0x18'))),_0x0675('0x19')]],'group':_0x0675('0x18'),'where':{'role':{'$or':[_0x0675('0x1a'),'user',_0x0675('0x1b')]}},'raw':!![]})['then'](function(_0x15a009){var _0x17b483={'user':_0x34c7e1[_0x0675('0x1c')]||0x0,'telephone':_0x34c7e1[_0x0675('0x1d')]||0x0};_0x15a009[_0x0675('0x1e')](function(_0x175e4f){var _0x1033a6=_0x175e4f[_0x0675('0x18')]===_0x0675('0x1a')?_0x0675('0x1f'):_0x175e4f[_0x0675('0x18')];_0x17b483[_0x1033a6]-=_0x175e4f[_0x0675('0x19')];if(_0x17b483[_0x1033a6]<0x0)_0x17b483[_0x1033a6]=0x0;});_0x1a4ccf(_0x17b483);return;});})[_0x0675('0x20')](function(_0x4b6f8e){_0x458c1b(_0x4b6f8e);});});}function checkUserLimits(_0x52be5d){return new BPromise(function(_0x5209f1,_0x36b9e6){getLimits()[_0x0675('0x4')](function(_0x3d2008){var _0xf25ff=_[_0x0675('0x21')](_[_0x0675('0x22')](_0x52be5d,_0x0675('0x18')),[_0x0675('0x1a'),_0x0675('0x1f'),_0x0675('0x1b')]);var _0xa42836=(_0xf25ff[_0x0675('0x1a')]||0x0)+(_0xf25ff[_0x0675('0x1f')]||0x0);var _0x2da2b2=_0xf25ff[_0x0675('0x1b')]||0x0;if(_0xa42836>_0x3d2008[_0x0675('0x1f')])return _0x36b9e6('License\x20limit\x20reached\x20for\x20users');if(_0x2da2b2>_0x3d2008[_0x0675('0x1b')])return _0x36b9e6('License\x20limit\x20reached\x20for\x20telephones');return _0x5209f1();})['catch'](function(_0xc52600){_0x36b9e6(_0xc52600);});});}module[_0x0675('0x23')]={'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 fc5b165..8721a59 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 _0xe1e3=['http://localhost:9000','app-id','exports'];(function(_0x471ec4,_0x42c871){var _0x43ab60=function(_0x178e9f){while(--_0x178e9f){_0x471ec4['push'](_0x471ec4['shift']());}};_0x43ab60(++_0x42c871);}(_0xe1e3,0x1bb));var _0x3e1e=function(_0x3d1800,_0x13ac8b){_0x3d1800=_0x3d1800-0x0;var _0x58e4f6=_0xe1e3[_0x3d1800];return _0x58e4f6;};'use strict';module[_0x3e1e('0x0')]={'DOMAIN':_0x3e1e('0x1'),'SESSION_SECRET':'myappanuglar-secret','GOOGLE_ID':_0x3e1e('0x2'),'GOOGLE_SECRET':'secret','DEBUG':''}; \ No newline at end of file +var _0x7334=['myappanuglar-secret','exports','http://localhost:9000'];(function(_0x4e3e81,_0x503a9b){var _0x1129b0=function(_0x5c25e2){while(--_0x5c25e2){_0x4e3e81['push'](_0x4e3e81['shift']());}};_0x1129b0(++_0x503a9b);}(_0x7334,0x184));var _0x4733=function(_0x5b0102,_0xc0178a){_0x5b0102=_0x5b0102-0x0;var _0x26326d=_0x7334[_0x5b0102];return _0x26326d;};'use strict';module[_0x4733('0x0')]={'DOMAIN':_0x4733('0x1'),'SESSION_SECRET':_0x4733('0x2'),'GOOGLE_ID':'app-id','GOOGLE_SECRET':'secret','DEBUG':''}; \ No newline at end of file diff --git a/server/config/logger.js b/server/config/logger.js index 6e8e842..e5a72eb 100644 --- a/server/config/logger.js +++ b/server/config/logger.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xdcc5=['../utils/loggers','exports'];(function(_0x171bc0,_0x25d626){var _0x2b8f46=function(_0x481b14){while(--_0x481b14){_0x171bc0['push'](_0x171bc0['shift']());}};_0x2b8f46(++_0x25d626);}(_0xdcc5,0x14c));var _0x5dcc=function(_0x33d5fc,_0x495c31){_0x33d5fc=_0x33d5fc-0x0;var _0xf6a695=_0xdcc5[_0x33d5fc];return _0xf6a695;};'use strict';var fileLogger=require(_0x5dcc('0x0'))['fileLogger'];module[_0x5dcc('0x1')]=fileLogger; \ No newline at end of file +var _0x29ef=['exports','fileLogger'];(function(_0x476590,_0x1584b7){var _0x3ff441=function(_0x2cef19){while(--_0x2cef19){_0x476590['push'](_0x476590['shift']());}};_0x3ff441(++_0x1584b7);}(_0x29ef,0x1f1));var _0xf29e=function(_0x271060,_0x3f86b1){_0x271060=_0x271060-0x0;var _0x40540b=_0x29ef[_0x271060];return _0x40540b;};'use strict';var fileLogger=require('../utils/loggers')[_0xf29e('0x0')];module[_0xf29e('0x1')]=fileLogger; \ No newline at end of file diff --git a/server/config/pm2/config.js b/server/config/pm2/config.js index fff2893..15249e1 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 _0x1a80=['agi','email','../../services/email/index.js','routing','xdr','path','../../config/environment','join','root','legacy-libs','express','../../services/express/index.js','../../services/ami/index.js'];(function(_0x30f2b5,_0x1237b6){var _0x3b6ecc=function(_0x2d8729){while(--_0x2d8729){_0x30f2b5['push'](_0x30f2b5['shift']());}};_0x3b6ecc(++_0x1237b6);}(_0x1a80,0x116));var _0x01a8=function(_0x728c99,_0x54ad14){_0x728c99=_0x728c99-0x0;var _0x36990e=_0x1a80[_0x728c99];return _0x36990e;};'use strict';var path=require(_0x01a8('0x0'));var cfg=require(_0x01a8('0x1'));var env={'NODE_PATH':path['resolve'](path[_0x01a8('0x2')](cfg[_0x01a8('0x3')],_0x01a8('0x4')))};var pm2config={'apps':[{'name':_0x01a8('0x5'),'script':path['join'](__dirname,_0x01a8('0x6')),'env':env},{'name':'ami','script':path[_0x01a8('0x2')](__dirname,_0x01a8('0x7')),'env':env},{'name':_0x01a8('0x8'),'script':path[_0x01a8('0x2')](__dirname,'../../services/agi/index.js'),'env':env},{'name':_0x01a8('0x9'),'script':path[_0x01a8('0x2')](__dirname,_0x01a8('0xa')),'env':env},{'name':_0x01a8('0xb'),'script':path[_0x01a8('0x2')](__dirname,'../../services/routing/index.js'),'env':env},{'name':_0x01a8('0xc'),'script':path[_0x01a8('0x2')](__dirname,'../../services/xdr/index.js'),'env':env}]};module['exports']=pm2config; \ No newline at end of file +var _0x177c=['join','ami','../../services/ami/index.js','agi','../../services/agi/index.js','email','routing','../../services/routing/index.js','exports','root','express'];(function(_0x3f3fc4,_0x956076){var _0xc33c56=function(_0x1d9d91){while(--_0x1d9d91){_0x3f3fc4['push'](_0x3f3fc4['shift']());}};_0xc33c56(++_0x956076);}(_0x177c,0x18a));var _0xc177=function(_0x524734,_0x111db5){_0x524734=_0x524734-0x0;var _0x5b7c62=_0x177c[_0x524734];return _0x5b7c62;};'use strict';var path=require('path');var cfg=require('../../config/environment');var env={'NODE_PATH':path['resolve'](path['join'](cfg[_0xc177('0x0')],'legacy-libs'))};var pm2config={'apps':[{'name':_0xc177('0x1'),'script':path[_0xc177('0x2')](__dirname,'../../services/express/index.js'),'env':env},{'name':_0xc177('0x3'),'script':path[_0xc177('0x2')](__dirname,_0xc177('0x4')),'env':env},{'name':_0xc177('0x5'),'script':path[_0xc177('0x2')](__dirname,_0xc177('0x6')),'env':env},{'name':_0xc177('0x7'),'script':path[_0xc177('0x2')](__dirname,'../../services/email/index.js'),'env':env},{'name':_0xc177('0x8'),'script':path[_0xc177('0x2')](__dirname,_0xc177('0x9')),'env':env},{'name':'xdr','script':path[_0xc177('0x2')](__dirname,'../../services/xdr/index.js'),'env':env}]};module[_0xc177('0xa')]=pm2config; \ No newline at end of file diff --git a/server/config/pm2/index.js b/server/config/pm2/index.js index 3186092..66cb346 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 _0x3718=['bluebird','./config','connect','connected','start','then','disconnect','stop','restart','list','describe','delete','dump','saved','pm2'];(function(_0x48a3e9,_0x5ac87b){var _0x62b564=function(_0x2de3a3){while(--_0x2de3a3){_0x48a3e9['push'](_0x48a3e9['shift']());}};_0x62b564(++_0x5ac87b);}(_0x3718,0x1b2));var _0x8371=function(_0x109a55,_0x343c56){_0x109a55=_0x109a55-0x0;var _0x5038d6=_0x3718[_0x109a55];return _0x5038d6;};'use strict';var pm2=require(_0x8371('0x0'));var BPromise=require(_0x8371('0x1'));var config=require(_0x8371('0x2'));function connect(){return new BPromise(function(_0x5ef453,_0x241da4){return pm2[_0x8371('0x3')](function(_0x12c56b){if(_0x12c56b){return _0x241da4(_0x12c56b);}return _0x5ef453(_0x8371('0x4'));});});};exports[_0x8371('0x5')]=function(_0x1de939){return connect()[_0x8371('0x6')](function(){return new BPromise(function(_0x30fa87,_0x18c055){return pm2['start'](_0x1de939,function(_0x41933f,_0x19f4f8){if(_0x41933f){return _0x18c055(_0x41933f);}pm2[_0x8371('0x7')]();return _0x30fa87(_0x19f4f8);});});});};exports[_0x8371('0x8')]=function(_0x13a912){return connect()[_0x8371('0x6')](function(){return new BPromise(function(_0x15bfa4,_0x18d331){return pm2['stop'](_0x13a912,function(_0x1ad5fa,_0x4781b8){if(_0x1ad5fa){return _0x18d331(_0x1ad5fa);}pm2['disconnect']();return _0x15bfa4(_0x4781b8);});});});};exports[_0x8371('0x9')]=function(_0x162208){return connect()[_0x8371('0x6')](function(){return new BPromise(function(_0x2e7acd,_0x3ae9f7){return pm2[_0x8371('0x9')](_0x162208,function(_0xd2e3d9,_0x2d05a5){if(_0xd2e3d9){return _0x3ae9f7(_0xd2e3d9);}pm2[_0x8371('0x7')]();return _0x2e7acd(_0x2d05a5);});});});};exports['list']=function(){return connect()[_0x8371('0x6')](function(){return new BPromise(function(_0x2dfe85,_0x542945){return pm2[_0x8371('0xa')](function(_0x4d3f8b,_0x636505){if(_0x4d3f8b){return _0x542945(_0x4d3f8b);}pm2[_0x8371('0x7')]();return _0x2dfe85(_0x636505);});});});};exports['describe']=function(_0x443685){return connect()[_0x8371('0x6')](function(){return new BPromise(function(_0x3c8691,_0x2799a8){return pm2[_0x8371('0xb')](_0x443685,function(_0x4c965e,_0x39b160){if(_0x4c965e){return _0x2799a8(_0x4c965e);}pm2[_0x8371('0x7')]();return _0x3c8691(_0x39b160);});});});};exports[_0x8371('0xc')]=function(_0x4086dd){return connect()[_0x8371('0x6')](function(){return new BPromise(function(_0x574749,_0x47927f){return pm2[_0x8371('0xc')](_0x4086dd,function(_0x44fe91,_0x1dde24){if(_0x44fe91){return _0x47927f(_0x44fe91);}pm2[_0x8371('0x7')]();return _0x574749(_0x1dde24);});});});};exports[_0x8371('0xd')]=function(){return connect()[_0x8371('0x6')](function(){return new BPromise(function(_0x5cbb4c,_0xe172f9){return pm2[_0x8371('0xd')](function(_0x4053fe){if(_0x4053fe){return _0xe172f9(_0x4053fe);}return _0x5cbb4c(_0x8371('0xe'));});});});}; \ No newline at end of file +var _0x8240=['stop','restart','list','describe','delete','dump','saved','pm2','./config','connect','connected','start','then','disconnect'];(function(_0x18d797,_0x45bb81){var _0x6d572f=function(_0x30a6b7){while(--_0x30a6b7){_0x18d797['push'](_0x18d797['shift']());}};_0x6d572f(++_0x45bb81);}(_0x8240,0xe7));var _0x0824=function(_0x4fa916,_0x3ec36a){_0x4fa916=_0x4fa916-0x0;var _0x576439=_0x8240[_0x4fa916];return _0x576439;};'use strict';var pm2=require(_0x0824('0x0'));var BPromise=require('bluebird');var config=require(_0x0824('0x1'));function connect(){return new BPromise(function(_0x1078c7,_0x2c3cd7){return pm2[_0x0824('0x2')](function(_0x18afaf){if(_0x18afaf){return _0x2c3cd7(_0x18afaf);}return _0x1078c7(_0x0824('0x3'));});});};exports[_0x0824('0x4')]=function(_0x9b0c6){return connect()[_0x0824('0x5')](function(){return new BPromise(function(_0x1903e8,_0x5d6eb5){return pm2['start'](_0x9b0c6,function(_0xafb5a1,_0x3fc1a4){if(_0xafb5a1){return _0x5d6eb5(_0xafb5a1);}pm2[_0x0824('0x6')]();return _0x1903e8(_0x3fc1a4);});});});};exports['stop']=function(_0x4474ef){return connect()[_0x0824('0x5')](function(){return new BPromise(function(_0x7fb08c,_0xa5c4e0){return pm2[_0x0824('0x7')](_0x4474ef,function(_0x2dca4f,_0x44194d){if(_0x2dca4f){return _0xa5c4e0(_0x2dca4f);}pm2[_0x0824('0x6')]();return _0x7fb08c(_0x44194d);});});});};exports[_0x0824('0x8')]=function(_0x1f77bc){return connect()[_0x0824('0x5')](function(){return new BPromise(function(_0x30f82c,_0x36efe6){return pm2['restart'](_0x1f77bc,function(_0x2b865d,_0x1a77e5){if(_0x2b865d){return _0x36efe6(_0x2b865d);}pm2['disconnect']();return _0x30f82c(_0x1a77e5);});});});};exports[_0x0824('0x9')]=function(){return connect()[_0x0824('0x5')](function(){return new BPromise(function(_0x205e39,_0x353a28){return pm2[_0x0824('0x9')](function(_0x247cbd,_0x2cf3be){if(_0x247cbd){return _0x353a28(_0x247cbd);}pm2[_0x0824('0x6')]();return _0x205e39(_0x2cf3be);});});});};exports[_0x0824('0xa')]=function(_0xe2d67f){return connect()[_0x0824('0x5')](function(){return new BPromise(function(_0x316994,_0x533b05){return pm2[_0x0824('0xa')](_0xe2d67f,function(_0x1ebf14,_0x46ed35){if(_0x1ebf14){return _0x533b05(_0x1ebf14);}pm2['disconnect']();return _0x316994(_0x46ed35);});});});};exports[_0x0824('0xb')]=function(_0x42544f){return connect()[_0x0824('0x5')](function(){return new BPromise(function(_0x5c8fbb,_0x568717){return pm2[_0x0824('0xb')](_0x42544f,function(_0x465ed6,_0x564d22){if(_0x465ed6){return _0x568717(_0x465ed6);}pm2['disconnect']();return _0x5c8fbb(_0x564d22);});});});};exports[_0x0824('0xc')]=function(){return connect()[_0x0824('0x5')](function(){return new BPromise(function(_0x491be4,_0x496902){return pm2[_0x0824('0xc')](function(_0x49e12b){if(_0x49e12b){return _0x496902(_0x49e12b);}return _0x491be4(_0x0824('0xd'));});});});}; \ No newline at end of file diff --git a/server/config/schedule/chat.js b/server/config/schedule/chat.js index 218f212..053eaf3 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 _0x443c=['join','ChatInteraction','update','timeout','YYYY-MM-DD\x20HH:mm:ss','info','emit','catch','error','[CHAT]\x20Error\x20closing\x20interactions','inspect','start','lodash','ioredis','util','../../mysqldb','../logger','schedule','defaults','redis','socket.io-emitter','Setting','find','chatTimeout','then','lastMsgAt','subtract','length','map'];(function(_0x378891,_0x4e3e16){var _0xfbfda2=function(_0x3b7681){while(--_0x3b7681){_0x378891['push'](_0x378891['shift']());}};_0xfbfda2(++_0x4e3e16);}(_0x443c,0xd7));var _0xc443=function(_0x59145c,_0x94d69a){_0x59145c=_0x59145c-0x0;var _0x4651d0=_0x443c[_0x59145c];return _0x4651d0;};'use strict';var _=require(_0xc443('0x0'));var moment=require('moment');var Redis=require(_0xc443('0x1'));var util=require(_0xc443('0x2'));var config=require('../../config/environment');var db=require(_0xc443('0x3'))['db'];var logger=require(_0xc443('0x4'))(_0xc443('0x5'));config['redis']=_[_0xc443('0x6')](config[_0xc443('0x7')],{'host':'localhost','port':0x18eb});var io=require(_0xc443('0x8'))(new Redis(config[_0xc443('0x7')]));function closeInteractions(){var _0x1a7094=0x0;var _0x42e155=[];return db[_0xc443('0x9')][_0xc443('0xa')]({'raw':!![],'attributes':['id',_0xc443('0xb')],'where':{'id':0x1}})[_0xc443('0xc')](function(_0x1834e6){_0x1a7094=_0x1834e6[_0xc443('0xb')];if(_0x1a7094){return db['ChatInteraction']['findAll']({'raw':!![],'attributes':['id',_0xc443('0xd')],'where':{'closed':![],'lastMsgAt':{'$lt':moment()[_0xc443('0xe')](_0x1834e6[_0xc443('0xb')],'minutes')}}});}else{return[];}})[_0xc443('0xc')](function(_0x5a010c){if(_0x5a010c&&_0x5a010c[_0xc443('0xf')]){_0x42e155=_[_0xc443('0x10')](_0x5a010c||[],'id');logger['info']('[CHAT]\x20Interactions\x20to\x20close:',_0x42e155[_0xc443('0x11')]());return db[_0xc443('0x12')][_0xc443('0x13')]({'closeReason':'system','disposition':_0xc443('0x14'),'closed':!![],'closedAt':moment()['format'](_0xc443('0x15'))},{'where':{'id':_0x42e155}});}})[_0xc443('0xc')](function(){if(_0x42e155&&_0x42e155[_0xc443('0xf')]){logger[_0xc443('0x16')]('[CHAT]\x20Sending\x20updates\x20for\x20interactions:',_0x42e155[_0xc443('0x11')]());for(var _0xa8ffe4=0x0;_0xa8ffe4<_0x42e155[_0xc443('0xf')];_0xa8ffe4++){io[_0xc443('0x17')]('chatInteraction:update',{'id':_0x42e155[_0xa8ffe4],'closed':!![]});}}})[_0xc443('0x18')](function(_0x46e0d9){logger[_0xc443('0x19')](_0xc443('0x1a'),_0x46e0d9?util[_0xc443('0x1b')](_0x46e0d9,{'showHidden':![],'depth':null}):'');});}exports[_0xc443('0x1c')]=function(){setInterval(function(){return closeInteractions();},0x3c*0x3e8);return closeInteractions();}; \ No newline at end of file +var _0x765d=['emit','chatInteraction:update','catch','error','[CHAT]\x20Error\x20closing\x20interactions','start','moment','ioredis','util','../../config/environment','../../mysqldb','../logger','schedule','redis','localhost','Setting','find','chatTimeout','then','findAll','lastMsgAt','subtract','minutes','length','info','join','ChatInteraction','update','system','timeout','format','[CHAT]\x20Sending\x20updates\x20for\x20interactions:'];(function(_0x3957dc,_0x525687){var _0x107bc4=function(_0x59ab60){while(--_0x59ab60){_0x3957dc['push'](_0x3957dc['shift']());}};_0x107bc4(++_0x525687);}(_0x765d,0x186));var _0xd765=function(_0x157829,_0x13534f){_0x157829=_0x157829-0x0;var _0x290510=_0x765d[_0x157829];return _0x290510;};'use strict';var _=require('lodash');var moment=require(_0xd765('0x0'));var Redis=require(_0xd765('0x1'));var util=require(_0xd765('0x2'));var config=require(_0xd765('0x3'));var db=require(_0xd765('0x4'))['db'];var logger=require(_0xd765('0x5'))(_0xd765('0x6'));config['redis']=_['defaults'](config[_0xd765('0x7')],{'host':_0xd765('0x8'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0xd765('0x7')]));function closeInteractions(){var _0x2da9d6=0x0;var _0xb8ee1e=[];return db[_0xd765('0x9')][_0xd765('0xa')]({'raw':!![],'attributes':['id',_0xd765('0xb')],'where':{'id':0x1}})[_0xd765('0xc')](function(_0x5a01b3){_0x2da9d6=_0x5a01b3['chatTimeout'];if(_0x2da9d6){return db['ChatInteraction'][_0xd765('0xd')]({'raw':!![],'attributes':['id',_0xd765('0xe')],'where':{'closed':![],'lastMsgAt':{'$lt':moment()[_0xd765('0xf')](_0x5a01b3[_0xd765('0xb')],_0xd765('0x10'))}}});}else{return[];}})[_0xd765('0xc')](function(_0x32dd37){if(_0x32dd37&&_0x32dd37[_0xd765('0x11')]){_0xb8ee1e=_['map'](_0x32dd37||[],'id');logger[_0xd765('0x12')]('[CHAT]\x20Interactions\x20to\x20close:',_0xb8ee1e[_0xd765('0x13')]());return db[_0xd765('0x14')][_0xd765('0x15')]({'closeReason':_0xd765('0x16'),'disposition':_0xd765('0x17'),'closed':!![],'closedAt':moment()[_0xd765('0x18')]('YYYY-MM-DD\x20HH:mm:ss')},{'where':{'id':_0xb8ee1e}});}})[_0xd765('0xc')](function(){if(_0xb8ee1e&&_0xb8ee1e[_0xd765('0x11')]){logger[_0xd765('0x12')](_0xd765('0x19'),_0xb8ee1e[_0xd765('0x13')]());for(var _0xd014d1=0x0;_0xd014d1<_0xb8ee1e[_0xd765('0x11')];_0xd014d1++){io[_0xd765('0x1a')](_0xd765('0x1b'),{'id':_0xb8ee1e[_0xd014d1],'closed':!![]});}}})[_0xd765('0x1c')](function(_0x2129ea){logger[_0xd765('0x1d')](_0xd765('0x1e'),_0x2129ea?util['inspect'](_0x2129ea,{'showHidden':![],'depth':null}):'');});}exports[_0xd765('0x1f')]=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 8bd9b8f..c064c6b 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 _0x73d4=['../../api/cloudProvider/cloudProvider.oauth.js','startAllRefreshIntervals','exports'];(function(_0x22f8c8,_0x173223){var _0x407a36=function(_0x32ff5d){while(--_0x32ff5d){_0x22f8c8['push'](_0x22f8c8['shift']());}};_0x407a36(++_0x173223);}(_0x73d4,0x1d7));var _0x473d=function(_0x3366c5,_0x597f9a){_0x3366c5=_0x3366c5-0x0;var _0x18500d=_0x73d4[_0x3366c5];return _0x18500d;};'use strict';function start(){var _0x4c22e6=require(_0x473d('0x0'));return _0x4c22e6[_0x473d('0x1')]();}module[_0x473d('0x2')]={'intervals':{},'start':start}; \ No newline at end of file +var _0x8b68=['startAllRefreshIntervals'];(function(_0x2ceef8,_0x296799){var _0xa117bf=function(_0x48d4d6){while(--_0x48d4d6){_0x2ceef8['push'](_0x2ceef8['shift']());}};_0xa117bf(++_0x296799);}(_0x8b68,0x1ed));var _0x88b6=function(_0x38f094,_0x21d1e3){_0x38f094=_0x38f094-0x0;var _0x472c1a=_0x8b68[_0x38f094];return _0x472c1a;};'use strict';function start(){var _0x14cb06=require('../../api/cloudProvider/cloudProvider.oauth.js');return _0x14cb06[_0x88b6('0x0')]();}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 4d6f327..b3b9bb2 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 _0x0604=['bcc','subtractNumber','join','../../files/reports','savename','basename','extname','zip','existsSync','status','Sent','message','attachments','text','Info\x20report:\x0a%s\x0aPlease\x20see\x20the\x20attachments\x0aThis\x20is\x20an\x20automatically\x20generated\x20email\x20–\x20please\x20do\x20not\x20reply\x20to\x20it.\x0a\x0a','sendIfEmpty','info','empty\x20file,\x20email\x20not\x20sent','SendMail','then','error','stringify','email\x20sent','error\x20mail','data','Smtp','isNil','subtractNumber\x20null\x20or\x20undefined','subtractUnit','subtractUnit\x20null\x20or\x20undefined','subtract','YYYY-MM-DD\x20HH:mm:ss','scheduled','output','DefaultReportId','runReport','catch','CustomReportId','Schedule','MailServerOut','CloudProvider','keys','map','keyBy','toString','difference','length','exists','stop','deleteJob','toRun','resolve','run\x20job','cron','active','isBetween','endAt','start','stop\x20cron','startAt','update','update\x20cron','run','util','path','bluebird','../logger','../../api/analyticCustomReport/analyticCustomReport.controller','../../api/analyticDefaultReport/analyticDefaultReport.controller','client','Try\x20to\x20send\x20a\x20mail\x20to','email','MailAccount','getSmtpOptions','format','\x22%s\x22\x20<%s>','name','user'];(function(_0x2641f9,_0x26715f){var _0x585741=function(_0x2d1462){while(--_0x2d1462){_0x2641f9['push'](_0x2641f9['shift']());}};_0x585741(++_0x26715f);}(_0x0604,0x8d));var _0x4060=function(_0x277dbd,_0x6fdbc8){_0x277dbd=_0x277dbd-0x0;var _0x14a8c8=_0x0604[_0x277dbd];return _0x14a8c8;};'use strict';var fs=require('fs');var util=require(_0x4060('0x0'));var path=require(_0x4060('0x1'));var _=require('lodash');var moment=require('moment');var CronJobManager=require('cron-job-manager');var jayson=require('jayson/promise');var BPromise=require(_0x4060('0x2'));var logger=require(_0x4060('0x3'))('schedule');var db=require('../../mysqldb')['db'];var analyticCustomReportController=require(_0x4060('0x4'));var analyticDefaultReportController=require(_0x4060('0x5'));var client=jayson[_0x4060('0x6')]['http']({'port':0x232b});var manager=new CronJobManager();function handleSendEmail(_0x4c01ca,_0x2e26f9){return function(){logger['info'](_0x4060('0x7'),_0x4c01ca[_0x4060('0x8')]);var _0x2a2de2=!![];var _0x2dc93a=_0x4c01ca[_0x4060('0x9')][_0x4060('0xa')]();var _0x399fc4={'account':_0x2dc93a,'message':{'from':util[_0x4060('0xb')](_0x4060('0xc'),_0x4c01ca[_0x4060('0x9')][_0x4060('0xd')],_0x4c01ca[_0x4060('0x9')][_0x4060('0x8')]||_0x4c01ca[_0x4060('0x9')]['Smtp'][_0x4060('0xe')]),'to':_0x4c01ca[_0x4060('0x8')],'cc':_0x4c01ca['cc'],'bcc':_0x4c01ca[_0x4060('0xf')],'subject':util[_0x4060('0xb')]('Report\x20%s\x20last\x20%s\x20%s',_0x2e26f9[_0x4060('0xd')],_0x4c01ca[_0x4060('0x10')],_0x4c01ca['subtractUnit'])}};var _0x42e128=path[_0x4060('0x11')](__dirname,_0x4060('0x12'));var _0x2004c2=_0x2e26f9[_0x4060('0x13')];var _0x8211ca=util[_0x4060('0xb')]('%s.%s',path[_0x4060('0x14')](_0x2e26f9['savename'],path[_0x4060('0x15')](_0x2e26f9[_0x4060('0x13')])),_0x4060('0x16'));var _0x24ec45=path['join'](_0x42e128,_0x2004c2);var _0x123072=path[_0x4060('0x11')](_0x42e128,_0x8211ca);if(fs[_0x4060('0x17')](_0x24ec45)){_0x2e26f9[_0x4060('0x18')]=_0x4060('0x19');_0x399fc4[_0x4060('0x1a')][_0x4060('0x1b')]=[{'filename':_0x2004c2,'path':_0x24ec45}];_0x399fc4[_0x4060('0x1a')][_0x4060('0x1c')]=util[_0x4060('0xb')](_0x4060('0x1d'),JSON['stringify'](_0x2e26f9,null,0x2));}else if(fs['existsSync'](_0x123072)){_0x2e26f9[_0x4060('0x18')]=_0x4060('0x19');_0x399fc4[_0x4060('0x1a')]['attachments']=[{'filename':_0x8211ca,'path':_0x123072}];}else{_0x399fc4['message'][_0x4060('0x1c')]='Report\x20empty\x0aThis\x20is\x20an\x20automatically\x20generated\x20email\x20–\x20please\x20do\x20not\x20reply\x20to\x20this\x20email.\x0a\x0a';if(!_0x4c01ca[_0x4060('0x1e')]){_0x2a2de2=![];logger[_0x4060('0x1f')](_0x4060('0x20'));}}if(_0x2a2de2){return client['request'](_0x4060('0x21'),_0x399fc4)[_0x4060('0x22')](function(_0x532251){if(_0x532251[_0x4060('0x23')]){return logger[_0x4060('0x23')]('error\x20mail',JSON[_0x4060('0x24')](_0x532251));}return logger[_0x4060('0x1f')](_0x4060('0x25'));})['catch'](function(_0x157ab3){return logger[_0x4060('0x23')](_0x4060('0x26'),JSON['stringify'](_0x157ab3));});}};}function handleError(){return function(_0x515947){return logger[_0x4060('0x23')](JSON[_0x4060('0x24')](_0x515947));};}function handleResult(_0x2bf675){return function(_0x511080){logger[_0x4060('0x1f')](_0x4060('0x27'),JSON[_0x4060('0x24')](_0x511080));if(_0x2bf675[_0x4060('0x9')]&&_0x2bf675['MailAccount'][_0x4060('0x28')]&&!_[_0x4060('0x29')](_0x2bf675[_0x4060('0x8')])){setTimeout(handleSendEmail(_0x2bf675,_0x511080),0x3c*0x3e8);}};}function handleJob(_0x6d8fff){return function(){try{if(_['isNil'](_0x6d8fff[_0x4060('0x10')])){return logger[_0x4060('0x1f')](_0x4060('0x2a'));}if(_[_0x4060('0x29')](_0x6d8fff[_0x4060('0x2b')])){return logger['info'](_0x4060('0x2c'));}var _0x4a678f={'startDate':moment()[_0x4060('0x2d')](_0x6d8fff[_0x4060('0x10')],_0x6d8fff[_0x4060('0x2b')])['format'](_0x4060('0x2e')),'endDate':moment()[_0x4060('0xb')](_0x4060('0x2e')),'type':_0x4060('0x2f'),'output':_0x6d8fff[_0x4060('0x30')],'name':_0x6d8fff[_0x4060('0xd')]};if(!_[_0x4060('0x29')](_0x6d8fff[_0x4060('0x31')])){logger[_0x4060('0x1f')]('exec\x20defaul\x20report\x20id:%s',_0x6d8fff[_0x4060('0x31')]);return analyticDefaultReportController[_0x4060('0x32')]({'id':_0x6d8fff[_0x4060('0x31')]},_0x4a678f)[_0x4060('0x22')](handleResult(_0x6d8fff))[_0x4060('0x33')](handleError());}if(!_[_0x4060('0x29')](_0x6d8fff['CustomReportId'])){logger[_0x4060('0x1f')]('exec\x20custom\x20report\x20id:%s',_0x6d8fff[_0x4060('0x34')]);return analyticCustomReportController['runReport']({'id':_0x6d8fff[_0x4060('0x34')]},_0x4a678f)['then'](handleResult(_0x6d8fff))[_0x4060('0x33')](handleError());}}catch(_0x4bb8f5){logger['error'](JSON[_0x4060('0x24')](_0x4bb8f5));}return logger[_0x4060('0x1f')]('no\x20report\x20id');};}function getJobs(_0x3a5bc8){var _0x6ce82d={};if(_0x3a5bc8){_0x6ce82d['id']=_0x3a5bc8;}return db[_0x4060('0x35')]['findAll']({'where':_0x6ce82d,'include':[{'model':db[_0x4060('0x9')],'attributes':['id','name',_0x4060('0x8')],'include':[{'model':db[_0x4060('0x36')],'as':_0x4060('0x28'),'include':[{'model':db[_0x4060('0x37')],'as':_0x4060('0x37')}]}]}]})[_0x4060('0x22')](function(_0x581c63){var _0x33257c=_[_0x4060('0x38')](manager['jobs']);var _0x3a15a7=_[_0x4060('0x39')](_0x581c63,function(_0x5a0cd5){return _0x5a0cd5['id']['toString']();});var _0x40108f=_[_0x4060('0x3a')](_0x581c63,function(_0x41e062){return _0x41e062['id'][_0x4060('0x3b')]();});var _0x27d287=_0x3a5bc8?_0x3a15a7:_[_0x4060('0x3c')](_0x3a15a7,_0x33257c);var _0x39c4c4=_['intersection'](_0x3a15a7,_0x33257c);var _0x21256b=_[_0x4060('0x3c')](_0x33257c,_0x3a15a7);var _0x4e7c6a;var _0x32f0b0;for(_0x4e7c6a=0x0;_0x4e7c6a<_0x21256b[_0x4060('0x3d')]&&!_0x3a5bc8;_0x4e7c6a+=0x1){_0x32f0b0=_0x21256b[_0x4e7c6a][_0x4060('0x3b')]();if(manager[_0x4060('0x3e')](_0x32f0b0)){manager[_0x4060('0x3f')](_0x32f0b0);manager[_0x4060('0x40')](_0x32f0b0);logger[_0x4060('0x1f')]('delete\x20cron',_0x32f0b0);}}logger[_0x4060('0x1f')](_0x4060('0x41'),JSON[_0x4060('0x24')](_0x27d287));for(_0x4e7c6a=0x0;_0x4e7c6a<_0x27d287[_0x4060('0x3d')];_0x4e7c6a+=0x1){_0x32f0b0=_0x27d287[_0x4e7c6a][_0x4060('0x3b')]();logger['info']('index',_0x32f0b0);if(_0x3a5bc8){logger['info']('my\x20id',_0x3a5bc8);logger['info'](JSON[_0x4060('0x24')](_0x40108f[_0x32f0b0]));BPromise[_0x4060('0x42')]()['then'](handleJob(_0x40108f[_0x32f0b0]));logger[_0x4060('0x1f')](_0x4060('0x43'),_0x40108f[_0x32f0b0][_0x4060('0xd')],_0x40108f[_0x32f0b0]['cron']);}else if(_0x40108f[_0x32f0b0][_0x4060('0x44')]&&_0x40108f[_0x32f0b0][_0x4060('0x45')]&&moment()[_0x4060('0x46')](_0x40108f[_0x32f0b0]['startAt'],_0x40108f[_0x32f0b0][_0x4060('0x47')])){manager['add'](_0x32f0b0,_0x40108f[_0x32f0b0][_0x4060('0x44')],handleJob(_0x40108f[_0x32f0b0]));manager[_0x4060('0x48')](_0x32f0b0);logger['info']('add\x20cron',_0x40108f[_0x32f0b0][_0x4060('0xd')],_0x40108f[_0x32f0b0][_0x4060('0x44')]);}else if(manager[_0x4060('0x3e')](_0x32f0b0)){manager[_0x4060('0x3f')](_0x32f0b0);manager['deleteJob'](_0x32f0b0);logger[_0x4060('0x1f')](_0x4060('0x49'),_0x40108f[_0x32f0b0][_0x4060('0xd')],_0x40108f[_0x32f0b0][_0x4060('0x44')]);}}for(_0x4e7c6a=0x0,_0x32f0b0;_0x4e7c6a<_0x39c4c4['length']&&!_0x3a5bc8;_0x4e7c6a+=0x1){_0x32f0b0=_0x39c4c4[_0x4e7c6a][_0x4060('0x3b')]();if(manager['exists'](_0x32f0b0)){if(_0x40108f[_0x32f0b0][_0x4060('0x44')]&&_0x40108f[_0x32f0b0][_0x4060('0x45')]&&moment()[_0x4060('0x46')](_0x40108f[_0x32f0b0][_0x4060('0x4a')],_0x40108f[_0x32f0b0][_0x4060('0x47')])){manager[_0x4060('0x4b')](_0x32f0b0,_0x40108f[_0x32f0b0]['cron'],handleJob(_0x40108f[_0x32f0b0]));logger[_0x4060('0x1f')](_0x4060('0x4c'),_0x40108f[_0x32f0b0][_0x4060('0xd')],_0x40108f[_0x32f0b0][_0x4060('0x44')]);}else{manager[_0x4060('0x3f')](_0x32f0b0);manager[_0x4060('0x40')](_0x32f0b0);logger['info']('stop\x20cron',_0x40108f[_0x32f0b0][_0x4060('0xd')],_0x40108f[_0x32f0b0][_0x4060('0x44')]);}}}})['catch'](function(_0x15d669){logger['error'](JSON[_0x4060('0x24')](_0x15d669));});}exports[_0x4060('0x4d')]=function(_0x57d60d){return getJobs(_0x57d60d);};exports[_0x4060('0x48')]=function(){setInterval(function(){return getJobs();},0x3c*0x3e8);return getJobs();}; \ No newline at end of file +var _0x374e=['exec\x20defaul\x20report\x20id:%s','exec\x20custom\x20report\x20id:%s','CustomReportId','runReport','no\x20report\x20id','Schedule','MailServerOut','CloudProvider','keys','jobs','map','toString','keyBy','difference','exists','stop','deleteJob','delete\x20cron','toRun','index','my\x20id','resolve','run\x20job','cron','active','startAt','add','start','stop\x20cron','length','isBetween','endAt','update','run','util','path','lodash','moment','jayson/promise','bluebird','../logger','schedule','../../mysqldb','../../api/analyticDefaultReport/analyticDefaultReport.controller','info','Try\x20to\x20send\x20a\x20mail\x20to','email','MailAccount','getSmtpOptions','format','name','Smtp','user','bcc','Report\x20%s\x20last\x20%s\x20%s','subtractNumber','subtractUnit','join','../../files/reports','savename','basename','zip','message','attachments','stringify','existsSync','Sent','text','Report\x20empty\x0aThis\x20is\x20an\x20automatically\x20generated\x20email\x20–\x20please\x20do\x20not\x20reply\x20to\x20this\x20email.\x0a\x0a','sendIfEmpty','empty\x20file,\x20email\x20not\x20sent','request','SendMail','then','error','error\x20mail','email\x20sent','catch','isNil','subtractNumber\x20null\x20or\x20undefined','subtract','YYYY-MM-DD\x20HH:mm:ss','scheduled','output','DefaultReportId'];(function(_0x39096d,_0x51f8a0){var _0x13da4f=function(_0x11e6b2){while(--_0x11e6b2){_0x39096d['push'](_0x39096d['shift']());}};_0x13da4f(++_0x51f8a0);}(_0x374e,0x121));var _0xe374=function(_0x47063b,_0x184c7b){_0x47063b=_0x47063b-0x0;var _0x567938=_0x374e[_0x47063b];return _0x567938;};'use strict';var fs=require('fs');var util=require(_0xe374('0x0'));var path=require(_0xe374('0x1'));var _=require(_0xe374('0x2'));var moment=require(_0xe374('0x3'));var CronJobManager=require('cron-job-manager');var jayson=require(_0xe374('0x4'));var BPromise=require(_0xe374('0x5'));var logger=require(_0xe374('0x6'))(_0xe374('0x7'));var db=require(_0xe374('0x8'))['db'];var analyticCustomReportController=require('../../api/analyticCustomReport/analyticCustomReport.controller');var analyticDefaultReportController=require(_0xe374('0x9'));var client=jayson['client']['http']({'port':0x232b});var manager=new CronJobManager();function handleSendEmail(_0x2b0a0d,_0x33936a){return function(){logger[_0xe374('0xa')](_0xe374('0xb'),_0x2b0a0d[_0xe374('0xc')]);var _0xfeceb6=!![];var _0x26901d=_0x2b0a0d[_0xe374('0xd')][_0xe374('0xe')]();var _0x51bff2={'account':_0x26901d,'message':{'from':util[_0xe374('0xf')]('\x22%s\x22\x20<%s>',_0x2b0a0d['MailAccount'][_0xe374('0x10')],_0x2b0a0d['MailAccount']['email']||_0x2b0a0d[_0xe374('0xd')][_0xe374('0x11')][_0xe374('0x12')]),'to':_0x2b0a0d[_0xe374('0xc')],'cc':_0x2b0a0d['cc'],'bcc':_0x2b0a0d[_0xe374('0x13')],'subject':util[_0xe374('0xf')](_0xe374('0x14'),_0x33936a[_0xe374('0x10')],_0x2b0a0d[_0xe374('0x15')],_0x2b0a0d[_0xe374('0x16')])}};var _0x1b218a=path[_0xe374('0x17')](__dirname,_0xe374('0x18'));var _0x22f54c=_0x33936a[_0xe374('0x19')];var _0x540dd9=util['format']('%s.%s',path[_0xe374('0x1a')](_0x33936a['savename'],path['extname'](_0x33936a['savename'])),_0xe374('0x1b'));var _0x480927=path[_0xe374('0x17')](_0x1b218a,_0x22f54c);var _0x5bb936=path[_0xe374('0x17')](_0x1b218a,_0x540dd9);if(fs['existsSync'](_0x480927)){_0x33936a['status']='Sent';_0x51bff2[_0xe374('0x1c')][_0xe374('0x1d')]=[{'filename':_0x22f54c,'path':_0x480927}];_0x51bff2[_0xe374('0x1c')]['text']=util[_0xe374('0xf')]('Info\x20report:\x0a%s\x0aPlease\x20see\x20the\x20attachments\x0aThis\x20is\x20an\x20automatically\x20generated\x20email\x20–\x20please\x20do\x20not\x20reply\x20to\x20it.\x0a\x0a',JSON[_0xe374('0x1e')](_0x33936a,null,0x2));}else if(fs[_0xe374('0x1f')](_0x5bb936)){_0x33936a['status']=_0xe374('0x20');_0x51bff2['message']['attachments']=[{'filename':_0x540dd9,'path':_0x5bb936}];}else{_0x51bff2[_0xe374('0x1c')][_0xe374('0x21')]=_0xe374('0x22');if(!_0x2b0a0d[_0xe374('0x23')]){_0xfeceb6=![];logger[_0xe374('0xa')](_0xe374('0x24'));}}if(_0xfeceb6){return client[_0xe374('0x25')](_0xe374('0x26'),_0x51bff2)[_0xe374('0x27')](function(_0x5687c5){if(_0x5687c5[_0xe374('0x28')]){return logger[_0xe374('0x28')](_0xe374('0x29'),JSON[_0xe374('0x1e')](_0x5687c5));}return logger[_0xe374('0xa')](_0xe374('0x2a'));})[_0xe374('0x2b')](function(_0x4ceade){return logger['error']('error\x20mail',JSON[_0xe374('0x1e')](_0x4ceade));});}};}function handleError(){return function(_0x107a6b){return logger[_0xe374('0x28')](JSON[_0xe374('0x1e')](_0x107a6b));};}function handleResult(_0x1aa655){return function(_0x3b9945){logger[_0xe374('0xa')]('data',JSON[_0xe374('0x1e')](_0x3b9945));if(_0x1aa655[_0xe374('0xd')]&&_0x1aa655['MailAccount'][_0xe374('0x11')]&&!_[_0xe374('0x2c')](_0x1aa655[_0xe374('0xc')])){setTimeout(handleSendEmail(_0x1aa655,_0x3b9945),0x3c*0x3e8);}};}function handleJob(_0x34e439){return function(){try{if(_[_0xe374('0x2c')](_0x34e439[_0xe374('0x15')])){return logger[_0xe374('0xa')](_0xe374('0x2d'));}if(_[_0xe374('0x2c')](_0x34e439[_0xe374('0x16')])){return logger[_0xe374('0xa')]('subtractUnit\x20null\x20or\x20undefined');}var _0x5c8835={'startDate':moment()[_0xe374('0x2e')](_0x34e439[_0xe374('0x15')],_0x34e439[_0xe374('0x16')])[_0xe374('0xf')](_0xe374('0x2f')),'endDate':moment()[_0xe374('0xf')](_0xe374('0x2f')),'type':_0xe374('0x30'),'output':_0x34e439[_0xe374('0x31')],'name':_0x34e439['name']};if(!_['isNil'](_0x34e439[_0xe374('0x32')])){logger[_0xe374('0xa')](_0xe374('0x33'),_0x34e439[_0xe374('0x32')]);return analyticDefaultReportController['runReport']({'id':_0x34e439['DefaultReportId']},_0x5c8835)[_0xe374('0x27')](handleResult(_0x34e439))[_0xe374('0x2b')](handleError());}if(!_[_0xe374('0x2c')](_0x34e439['CustomReportId'])){logger[_0xe374('0xa')](_0xe374('0x34'),_0x34e439[_0xe374('0x35')]);return analyticCustomReportController[_0xe374('0x36')]({'id':_0x34e439[_0xe374('0x35')]},_0x5c8835)[_0xe374('0x27')](handleResult(_0x34e439))['catch'](handleError());}}catch(_0x4d3968){logger['error'](JSON['stringify'](_0x4d3968));}return logger['info'](_0xe374('0x37'));};}function getJobs(_0x9dea95){var _0x295788={};if(_0x9dea95){_0x295788['id']=_0x9dea95;}return db[_0xe374('0x38')]['findAll']({'where':_0x295788,'include':[{'model':db[_0xe374('0xd')],'attributes':['id',_0xe374('0x10'),_0xe374('0xc')],'include':[{'model':db[_0xe374('0x39')],'as':_0xe374('0x11'),'include':[{'model':db[_0xe374('0x3a')],'as':_0xe374('0x3a')}]}]}]})['then'](function(_0x592ede){var _0x547f79=_[_0xe374('0x3b')](manager[_0xe374('0x3c')]);var _0x4f74c7=_[_0xe374('0x3d')](_0x592ede,function(_0x191d1e){return _0x191d1e['id'][_0xe374('0x3e')]();});var _0x18e00c=_[_0xe374('0x3f')](_0x592ede,function(_0x5f2c70){return _0x5f2c70['id'][_0xe374('0x3e')]();});var _0x285245=_0x9dea95?_0x4f74c7:_['difference'](_0x4f74c7,_0x547f79);var _0x13c9e4=_['intersection'](_0x4f74c7,_0x547f79);var _0x3a8bcb=_[_0xe374('0x40')](_0x547f79,_0x4f74c7);var _0x4470d6;var _0x3eaf51;for(_0x4470d6=0x0;_0x4470d6<_0x3a8bcb['length']&&!_0x9dea95;_0x4470d6+=0x1){_0x3eaf51=_0x3a8bcb[_0x4470d6][_0xe374('0x3e')]();if(manager[_0xe374('0x41')](_0x3eaf51)){manager[_0xe374('0x42')](_0x3eaf51);manager[_0xe374('0x43')](_0x3eaf51);logger[_0xe374('0xa')](_0xe374('0x44'),_0x3eaf51);}}logger[_0xe374('0xa')](_0xe374('0x45'),JSON[_0xe374('0x1e')](_0x285245));for(_0x4470d6=0x0;_0x4470d6<_0x285245['length'];_0x4470d6+=0x1){_0x3eaf51=_0x285245[_0x4470d6][_0xe374('0x3e')]();logger[_0xe374('0xa')](_0xe374('0x46'),_0x3eaf51);if(_0x9dea95){logger[_0xe374('0xa')](_0xe374('0x47'),_0x9dea95);logger['info'](JSON[_0xe374('0x1e')](_0x18e00c[_0x3eaf51]));BPromise[_0xe374('0x48')]()[_0xe374('0x27')](handleJob(_0x18e00c[_0x3eaf51]));logger['info'](_0xe374('0x49'),_0x18e00c[_0x3eaf51][_0xe374('0x10')],_0x18e00c[_0x3eaf51]['cron']);}else if(_0x18e00c[_0x3eaf51][_0xe374('0x4a')]&&_0x18e00c[_0x3eaf51][_0xe374('0x4b')]&&moment()['isBetween'](_0x18e00c[_0x3eaf51][_0xe374('0x4c')],_0x18e00c[_0x3eaf51]['endAt'])){manager[_0xe374('0x4d')](_0x3eaf51,_0x18e00c[_0x3eaf51][_0xe374('0x4a')],handleJob(_0x18e00c[_0x3eaf51]));manager[_0xe374('0x4e')](_0x3eaf51);logger[_0xe374('0xa')]('add\x20cron',_0x18e00c[_0x3eaf51][_0xe374('0x10')],_0x18e00c[_0x3eaf51][_0xe374('0x4a')]);}else if(manager[_0xe374('0x41')](_0x3eaf51)){manager[_0xe374('0x42')](_0x3eaf51);manager['deleteJob'](_0x3eaf51);logger[_0xe374('0xa')](_0xe374('0x4f'),_0x18e00c[_0x3eaf51][_0xe374('0x10')],_0x18e00c[_0x3eaf51][_0xe374('0x4a')]);}}for(_0x4470d6=0x0,_0x3eaf51;_0x4470d6<_0x13c9e4[_0xe374('0x50')]&&!_0x9dea95;_0x4470d6+=0x1){_0x3eaf51=_0x13c9e4[_0x4470d6][_0xe374('0x3e')]();if(manager[_0xe374('0x41')](_0x3eaf51)){if(_0x18e00c[_0x3eaf51][_0xe374('0x4a')]&&_0x18e00c[_0x3eaf51][_0xe374('0x4b')]&&moment()[_0xe374('0x51')](_0x18e00c[_0x3eaf51][_0xe374('0x4c')],_0x18e00c[_0x3eaf51][_0xe374('0x52')])){manager[_0xe374('0x53')](_0x3eaf51,_0x18e00c[_0x3eaf51][_0xe374('0x4a')],handleJob(_0x18e00c[_0x3eaf51]));logger['info']('update\x20cron',_0x18e00c[_0x3eaf51][_0xe374('0x10')],_0x18e00c[_0x3eaf51][_0xe374('0x4a')]);}else{manager[_0xe374('0x42')](_0x3eaf51);manager[_0xe374('0x43')](_0x3eaf51);logger[_0xe374('0xa')](_0xe374('0x4f'),_0x18e00c[_0x3eaf51][_0xe374('0x10')],_0x18e00c[_0x3eaf51][_0xe374('0x4a')]);}}}})[_0xe374('0x2b')](function(_0x1b4584){logger[_0xe374('0x28')](JSON[_0xe374('0x1e')](_0x1b4584));});}exports[_0xe374('0x54')]=function(_0xc5c0ad){return getJobs(_0xc5c0ad);};exports[_0xe374('0x4e')]=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 16ad0b4..c50aac4 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 _0x1572=['Sentiment','SentimentScore','Mixed','FAILED','FailureReason','tempSentiment','[RECORDING:%d]\x20Sentiment\x20Analysis\x20available','Positive','Negative','Neutral','catch','name','error','[RECORDING:%d]\x20Error\x20running\x20Transcribe\x20&\x20Sentiment\x20Analysis','VoiceRecording','IN_PROGRESS','No\x20transcribe\x20job\x20to\x20check','Setting','Settings\x20not\x20available','transcribeRegion','Transcribe\x20not\x20configured','forEach','push','all','SequelizeValidationError','inspect','lodash','aws-sdk','request-promise','util','bluebird','../../mysqldb','../../config/logger','transcribe','TranscribeService','getTranscriptionJob','Comprehend','detectSentiment','info','format','[RECORDING:%d]\x20Get\x20status\x20for\x20transcript\x20job\x20(%s)','transcribeName','then','[RECORDING:%d]\x20Status\x20of\x20transcript\x20job\x20(%s):\x20%s','TranscriptionJob','TranscriptionJobStatus','COMPLETED','Transcript','TranscriptFileUri','[RECORDING:%d]\x20Transcript\x20downloaded','results','transcripts','length','fileText','transcript','update','[RECORDING:%d]\x20Voice\x20Recording\x20entry\x20updated','Sequelize','ValidationError','Sentiment\x20Analysis\x20not\x20requested','sentiment','sentimentRegion','language','bucket','Sentiment\x20Analysis\x20not\x20configured','Transcript\x20not\x20available','sentimentAccountId','CloudProvider','findOne','data1','data2','Cloud\x20Provider\x20not\x20configured','[RECORDING:%d]\x20Requesting\x20sentiment\x20analysis'];(function(_0x49cc37,_0x273002){var _0x4ffd48=function(_0x185908){while(--_0x185908){_0x49cc37['push'](_0x49cc37['shift']());}};_0x4ffd48(++_0x273002);}(_0x1572,0xf5));var _0x2157=function(_0x8f7114,_0x2e60dd){_0x8f7114=_0x8f7114-0x0;var _0x63af7f=_0x1572[_0x8f7114];return _0x63af7f;};var _=require(_0x2157('0x0'));var AWS=require(_0x2157('0x1'));var rp=require(_0x2157('0x2'));var util=require(_0x2157('0x3'));var BPromise=require(_0x2157('0x4'));var db=require(_0x2157('0x5'))['db'];var logger=require(_0x2157('0x6'))(_0x2157('0x7'));function getTranscriptionJob(_0x214311,_0x30e5c6,_0x2cb065,_0x3c3eb5){return new Promise(function(_0x2f13ab,_0x9e1c46){var _0x286be0=new AWS[(_0x2157('0x8'))]({'accessKeyId':_0x30e5c6,'secretAccessKey':_0x214311,'region':_0x2cb065});_0x286be0[_0x2157('0x9')]({'TranscriptionJobName':_0x3c3eb5},function(_0x91bf75,_0x5e9959){if(_0x91bf75){return _0x9e1c46(_0x91bf75);}else{return _0x2f13ab(_0x5e9959);}});});}function sentiment(_0x2ee42e,_0x4cd82d,_0x91d81,_0xaa87db,_0x17d4c0){return new Promise(function(_0x366643,_0x2ae8d5){var _0x3bcff9=new AWS[(_0x2157('0xa'))]({'accessKeyId':_0x4cd82d,'secretAccessKey':_0x2ee42e,'region':_0x91d81});_0x3bcff9[_0x2157('0xb')]({'Text':_0xaa87db,'LanguageCode':_0x17d4c0['substring'](0x0,0x2)},function(_0x3ff739,_0x2088ab){if(_0x3ff739){return _0x2ae8d5(_0x3ff739);}else{return _0x366643(_0x2088ab);}});});}function checkTranscribeJob(_0xd969d2,_0x1434ee,_0x5d64d3){var _0x32683b;return new BPromise(function(_0x418d29,_0xba98c0){logger[_0x2157('0xc')](util[_0x2157('0xd')](_0x2157('0xe'),_0xd969d2['id'],_0xd969d2[_0x2157('0xf')]));return getTranscriptionJob(_0x5d64d3['data1'],_0x5d64d3['data2'],_0x1434ee['transcribeRegion'],_0xd969d2[_0x2157('0xf')])[_0x2157('0x10')](function(_0x371461){logger[_0x2157('0xc')](util[_0x2157('0xd')](_0x2157('0x11'),_0xd969d2['id'],_0xd969d2[_0x2157('0xf')],_0x371461[_0x2157('0x12')][_0x2157('0x13')]));if(!_0xd969d2['fileText']){switch(_0x371461[_0x2157('0x12')][_0x2157('0x13')]){case _0x2157('0x14'):var _0x5c6661={'transcribeStatus':_0x371461[_0x2157('0x12')][_0x2157('0x13')],'fileUri':_0x371461[_0x2157('0x12')][_0x2157('0x15')][_0x2157('0x16')]};logger['info'](util['format']('[RECORDING:%d]\x20Get\x20transcript',_0xd969d2['id']));return rp({'uri':_0x371461[_0x2157('0x12')]['Transcript'][_0x2157('0x16')],'json':!![]})[_0x2157('0x10')](function(_0x537ada){logger['info'](util[_0x2157('0xd')](_0x2157('0x17'),_0xd969d2['id']));if(_0x537ada&&_0x537ada[_0x2157('0x18')]&&_0x537ada[_0x2157('0x18')]['transcripts']&&_0x537ada[_0x2157('0x18')][_0x2157('0x19')]['length']){_0x5c6661['fileText']='';for(var _0x138c0e=0x0;_0x138c0e<_0x537ada[_0x2157('0x18')][_0x2157('0x19')][_0x2157('0x1a')];_0x138c0e++){_0x5c6661[_0x2157('0x1b')]+=_0x537ada[_0x2157('0x18')]['transcripts'][_0x138c0e][_0x2157('0x1c')]+'';}}return _0xd969d2[_0x2157('0x1d')](_0x5c6661);})[_0x2157('0x10')](function(){logger[_0x2157('0xc')](util[_0x2157('0xd')](_0x2157('0x1e'),_0xd969d2['id']));if(!_0xd969d2['tempSentiment']){throw new db[(_0x2157('0x1f'))][(_0x2157('0x20'))](_0x2157('0x21'));}if(!_0x1434ee[_0x2157('0x22')]||!_0x1434ee['sentimentAccountId']||!_0x1434ee[_0x2157('0x23')]||!_0x1434ee[_0x2157('0x24')]||!_0x1434ee[_0x2157('0x25')]){throw new db[(_0x2157('0x1f'))][(_0x2157('0x20'))](_0x2157('0x26'));}if(!_0x5c6661[_0x2157('0x1b')]){throw new Error(_0x2157('0x27'));}if(_0x1434ee[_0x2157('0x28')]===_0x5d64d3['id']){return _0x5d64d3;}else{return db[_0x2157('0x29')][_0x2157('0x2a')]({'where':{'id':_settings[_0x2157('0x28')]}});}})[_0x2157('0x10')](function(_0x3c887e){if(!_0x3c887e){throw new db[(_0x2157('0x1f'))][(_0x2157('0x20'))]('Cloud\x20Provider\x20not\x20available');}if(!_0x3c887e[_0x2157('0x2b')]||!_0x3c887e[_0x2157('0x2c')]){throw new db[(_0x2157('0x1f'))][(_0x2157('0x20'))](_0x2157('0x2d'));}_0x32683b=_0x3c887e;logger[_0x2157('0xc')](util[_0x2157('0xd')](_0x2157('0x2e'),_0xd969d2['id']));return sentiment(_0x32683b[_0x2157('0x2b')],_0x32683b['data2'],_0x1434ee['sentimentRegion'],_0x5c6661[_0x2157('0x1b')],_0x1434ee[_0x2157('0x24')]);})['then'](function(_0x6096fe){logger[_0x2157('0xc')](util[_0x2157('0xd')]('[RECORDING:%d]\x20Sentiment\x20Analysis\x20available',_0xd969d2['id']));return _0xd969d2[_0x2157('0x1d')]({'sentiment':_0x6096fe[_0x2157('0x2f')],'sPositive':_0x6096fe[_0x2157('0x30')]['Positive'],'sNegative':_0x6096fe[_0x2157('0x30')]['Negative'],'sMixed':_0x6096fe[_0x2157('0x30')][_0x2157('0x31')],'sNeutral':_0x6096fe[_0x2157('0x30')]['Neutral']});})[_0x2157('0x10')](function(){logger[_0x2157('0xc')](util['format']('[RECORDING:%d]\x20Voice\x20Recording\x20entry\x20updated',_0xd969d2['id']));_0x418d29();});case _0x2157('0x32'):return _0xd969d2[_0x2157('0x1d')]({'transcribeStatus':'FAILED','failureReason':_0x371461[_0x2157('0x12')][_0x2157('0x33')]})['then'](function(){logger[_0x2157('0xc')](util['format']('[RECORDING:%d]\x20Voice\x20Recording\x20entry\x20updated',_0xd969d2['id']));_0x418d29();});default:logger[_0x2157('0xc')](util[_0x2157('0xd')]('[RECORDING:%d]\x20Transcript\x20Job\x20status\x20not\x20managed',_0xd969d2['id']));break;}}else{return BPromise['resolve']()[_0x2157('0x10')](function(){if(!_0xd969d2[_0x2157('0x34')]){throw new db[(_0x2157('0x1f'))][(_0x2157('0x20'))](_0x2157('0x21'));}if(!_0x1434ee[_0x2157('0x22')]||!_0x1434ee[_0x2157('0x28')]||!_0x1434ee['sentimentRegion']||!_0x1434ee[_0x2157('0x24')]||!_0x1434ee[_0x2157('0x25')]){throw new db[(_0x2157('0x1f'))][(_0x2157('0x20'))](_0x2157('0x26'));}if(!_0xd969d2[_0x2157('0x1b')]){throw new Error('Transcript\x20not\x20available');}if(_0x1434ee['sentimentAccountId']===_0x5d64d3['id']){return _0x5d64d3;}else{return db['CloudProvider'][_0x2157('0x2a')]({'where':{'id':_settings['sentimentAccountId']}});}})[_0x2157('0x10')](function(_0x10cfc3){if(!_0x10cfc3){throw new db[(_0x2157('0x1f'))][(_0x2157('0x20'))]('Cloud\x20Provider\x20not\x20available');}if(!_0x10cfc3[_0x2157('0x2b')]||!_0x10cfc3[_0x2157('0x2c')]){throw new db[(_0x2157('0x1f'))][(_0x2157('0x20'))](_0x2157('0x2d'));}_0x32683b=_0x10cfc3;logger[_0x2157('0xc')](util[_0x2157('0xd')]('[RECORDING:%d]\x20Requesting\x20sentiment\x20analysis',_0xd969d2['id']));return sentiment(_0x32683b[_0x2157('0x2b')],_0x32683b[_0x2157('0x2c')],_0x1434ee['sentimentRegion'],_0xd969d2[_0x2157('0x1b')],_0x1434ee[_0x2157('0x24')]);})[_0x2157('0x10')](function(_0x5289e0){logger[_0x2157('0xc')](util[_0x2157('0xd')](_0x2157('0x35'),_0xd969d2['id']));return _0xd969d2[_0x2157('0x1d')]({'sentiment':_0x5289e0[_0x2157('0x2f')],'sPositive':_0x5289e0['SentimentScore'][_0x2157('0x36')],'sNegative':_0x5289e0['SentimentScore'][_0x2157('0x37')],'sMixed':_0x5289e0[_0x2157('0x30')][_0x2157('0x31')],'sNeutral':_0x5289e0[_0x2157('0x30')][_0x2157('0x38')],'transcribeStatus':_0x2157('0x14')});})['then'](function(){logger[_0x2157('0xc')](util[_0x2157('0xd')](_0x2157('0x1e'),_0xd969d2['id']));_0x418d29();});}})[_0x2157('0x39')](function(_0x5e04ca){if(_0x5e04ca){if(!_0x5e04ca[_0x2157('0x3a')]||_0x5e04ca[_0x2157('0x3a')]!=='SequelizeValidationError'){logger[_0x2157('0x3b')](util[_0x2157('0xd')](_0x2157('0x3c'),_0xd969d2['id']),util['inspect'](_0x5e04ca,{'showHidden':![],'depth':null}));}}_0x418d29();});});}function checkTranscribe(){var _0x2d0963;var _0x545b46;var _0xb6b619;return db[_0x2157('0x3d')]['findAll']({'where':{'transcribeStatus':_0x2157('0x3e')}})[_0x2157('0x10')](function(_0x1f18f1){if(!_0x1f18f1||!_0x1f18f1[_0x2157('0x1a')]){throw new db[(_0x2157('0x1f'))][(_0x2157('0x20'))](_0x2157('0x3f'));}_0x2d0963=_0x1f18f1;return db[_0x2157('0x40')][_0x2157('0x2a')]({'where':{'id':0x1}});})['then'](function(_0x3c7cbf){if(!_0x3c7cbf){throw new db[(_0x2157('0x1f'))][(_0x2157('0x20'))](_0x2157('0x41'));}_0x545b46=_0x3c7cbf;if(!_0x545b46[_0x2157('0x7')]||!_0x545b46['transcribeAccountId']||!_0x545b46[_0x2157('0x42')]||!_0x545b46['language']||!_0x545b46['bucket']){throw new db[(_0x2157('0x1f'))]['ValidationError'](_0x2157('0x43'));}return db[_0x2157('0x29')][_0x2157('0x2a')]({'where':{'id':_0x545b46['transcribeAccountId']}});})[_0x2157('0x10')](function(_0x2aba0a){if(!_0x2aba0a){throw new db[(_0x2157('0x1f'))][(_0x2157('0x20'))]('Cloud\x20Provider\x20not\x20available');}if(!_0x2aba0a[_0x2157('0x2b')]||!_0x2aba0a[_0x2157('0x2c')]){throw new db['Sequelize'][(_0x2157('0x20'))](_0x2157('0x2d'));}_0xb6b619=_0x2aba0a;var _0x44ee05=[];_0x2d0963[_0x2157('0x44')](function(_0x1dc792){_0x44ee05[_0x2157('0x45')](checkTranscribeJob(_0x1dc792,_0x545b46,_0xb6b619));});return BPromise[_0x2157('0x46')](_0x44ee05);})[_0x2157('0x39')](function(_0x4aca70){if(_0x4aca70){if(!_0x4aca70[_0x2157('0x3a')]||_0x4aca70[_0x2157('0x3a')]!==_0x2157('0x47')){logger[_0x2157('0x3b')](util[_0x2157('0x48')](_0x4aca70,{'showHidden':![],'depth':null}));}}});}exports['start']=function(){setInterval(function(){return checkTranscribe();},0x3c*0x3e8);return checkTranscribe();}; \ No newline at end of file +var _0x0b96=['Sentiment','Positive','catch','name','error','findAll','IN_PROGRESS','No\x20transcribe\x20job\x20to\x20check','Setting','transcribe','transcribeAccountId','Transcribe\x20not\x20configured','forEach','all','SequelizeValidationError','inspect','start','lodash','aws-sdk','request-promise','bluebird','../../mysqldb','../../config/logger','TranscribeService','getTranscriptionJob','Comprehend','detectSentiment','substring','info','format','[RECORDING:%d]\x20Get\x20status\x20for\x20transcript\x20job\x20(%s)','transcribeName','data2','transcribeRegion','then','[RECORDING:%d]\x20Status\x20of\x20transcript\x20job\x20(%s):\x20%s','TranscriptionJob','TranscriptionJobStatus','COMPLETED','TranscriptFileUri','[RECORDING:%d]\x20Get\x20transcript','Transcript','[RECORDING:%d]\x20Transcript\x20downloaded','results','transcripts','length','transcript','update','[RECORDING:%d]\x20Voice\x20Recording\x20entry\x20updated','tempSentiment','Sentiment\x20Analysis\x20not\x20requested','sentiment','sentimentAccountId','sentimentRegion','bucket','Sequelize','fileText','Transcript\x20not\x20available','CloudProvider','ValidationError','Cloud\x20Provider\x20not\x20available','data1','Cloud\x20Provider\x20not\x20configured','[RECORDING:%d]\x20Requesting\x20sentiment\x20analysis','language','[RECORDING:%d]\x20Sentiment\x20Analysis\x20available','SentimentScore','Negative','Mixed','FAILED','FailureReason','[RECORDING:%d]\x20Transcript\x20Job\x20status\x20not\x20managed','resolve','findOne'];(function(_0x5d2803,_0xf375bd){var _0xdcad2c=function(_0x3c3a98){while(--_0x3c3a98){_0x5d2803['push'](_0x5d2803['shift']());}};_0xdcad2c(++_0xf375bd);}(_0x0b96,0xa5));var _0x60b9=function(_0x344e99,_0x530098){_0x344e99=_0x344e99-0x0;var _0x172d28=_0x0b96[_0x344e99];return _0x172d28;};var _=require(_0x60b9('0x0'));var AWS=require(_0x60b9('0x1'));var rp=require(_0x60b9('0x2'));var util=require('util');var BPromise=require(_0x60b9('0x3'));var db=require(_0x60b9('0x4'))['db'];var logger=require(_0x60b9('0x5'))('transcribe');function getTranscriptionJob(_0x348b51,_0x3e232a,_0x5c3e38,_0x393671){return new Promise(function(_0x443326,_0x40e534){var _0x6f397e=new AWS[(_0x60b9('0x6'))]({'accessKeyId':_0x3e232a,'secretAccessKey':_0x348b51,'region':_0x5c3e38});_0x6f397e[_0x60b9('0x7')]({'TranscriptionJobName':_0x393671},function(_0x1e5cef,_0x5dd8e8){if(_0x1e5cef){return _0x40e534(_0x1e5cef);}else{return _0x443326(_0x5dd8e8);}});});}function sentiment(_0x462d22,_0x5be744,_0x4f02a6,_0x2c4117,_0x189652){return new Promise(function(_0x448b43,_0x246bf3){var _0x541aaf=new AWS[(_0x60b9('0x8'))]({'accessKeyId':_0x5be744,'secretAccessKey':_0x462d22,'region':_0x4f02a6});_0x541aaf[_0x60b9('0x9')]({'Text':_0x2c4117,'LanguageCode':_0x189652[_0x60b9('0xa')](0x0,0x2)},function(_0x510924,_0x10a7be){if(_0x510924){return _0x246bf3(_0x510924);}else{return _0x448b43(_0x10a7be);}});});}function checkTranscribeJob(_0x2e12e7,_0x1b2d06,_0xa4144b){var _0x243e4a;return new BPromise(function(_0x225df6,_0x3f69a9){logger[_0x60b9('0xb')](util[_0x60b9('0xc')](_0x60b9('0xd'),_0x2e12e7['id'],_0x2e12e7[_0x60b9('0xe')]));return getTranscriptionJob(_0xa4144b['data1'],_0xa4144b[_0x60b9('0xf')],_0x1b2d06[_0x60b9('0x10')],_0x2e12e7[_0x60b9('0xe')])[_0x60b9('0x11')](function(_0x2d4995){logger['info'](util[_0x60b9('0xc')](_0x60b9('0x12'),_0x2e12e7['id'],_0x2e12e7[_0x60b9('0xe')],_0x2d4995[_0x60b9('0x13')]['TranscriptionJobStatus']));if(!_0x2e12e7['fileText']){switch(_0x2d4995[_0x60b9('0x13')][_0x60b9('0x14')]){case _0x60b9('0x15'):var _0x42eb4f={'transcribeStatus':_0x2d4995[_0x60b9('0x13')][_0x60b9('0x14')],'fileUri':_0x2d4995[_0x60b9('0x13')]['Transcript'][_0x60b9('0x16')]};logger['info'](util[_0x60b9('0xc')](_0x60b9('0x17'),_0x2e12e7['id']));return rp({'uri':_0x2d4995[_0x60b9('0x13')][_0x60b9('0x18')]['TranscriptFileUri'],'json':!![]})[_0x60b9('0x11')](function(_0x305e0b){logger[_0x60b9('0xb')](util['format'](_0x60b9('0x19'),_0x2e12e7['id']));if(_0x305e0b&&_0x305e0b['results']&&_0x305e0b[_0x60b9('0x1a')][_0x60b9('0x1b')]&&_0x305e0b[_0x60b9('0x1a')][_0x60b9('0x1b')][_0x60b9('0x1c')]){_0x42eb4f['fileText']='';for(var _0x127ff4=0x0;_0x127ff4<_0x305e0b[_0x60b9('0x1a')][_0x60b9('0x1b')][_0x60b9('0x1c')];_0x127ff4++){_0x42eb4f['fileText']+=_0x305e0b[_0x60b9('0x1a')]['transcripts'][_0x127ff4][_0x60b9('0x1d')]+'';}}return _0x2e12e7[_0x60b9('0x1e')](_0x42eb4f);})[_0x60b9('0x11')](function(){logger[_0x60b9('0xb')](util[_0x60b9('0xc')](_0x60b9('0x1f'),_0x2e12e7['id']));if(!_0x2e12e7[_0x60b9('0x20')]){throw new db['Sequelize']['ValidationError'](_0x60b9('0x21'));}if(!_0x1b2d06[_0x60b9('0x22')]||!_0x1b2d06[_0x60b9('0x23')]||!_0x1b2d06[_0x60b9('0x24')]||!_0x1b2d06['language']||!_0x1b2d06[_0x60b9('0x25')]){throw new db[(_0x60b9('0x26'))]['ValidationError']('Sentiment\x20Analysis\x20not\x20configured');}if(!_0x42eb4f[_0x60b9('0x27')]){throw new Error(_0x60b9('0x28'));}if(_0x1b2d06[_0x60b9('0x23')]===_0xa4144b['id']){return _0xa4144b;}else{return db[_0x60b9('0x29')]['findOne']({'where':{'id':_settings[_0x60b9('0x23')]}});}})[_0x60b9('0x11')](function(_0x322817){if(!_0x322817){throw new db[(_0x60b9('0x26'))][(_0x60b9('0x2a'))](_0x60b9('0x2b'));}if(!_0x322817[_0x60b9('0x2c')]||!_0x322817['data2']){throw new db[(_0x60b9('0x26'))][(_0x60b9('0x2a'))](_0x60b9('0x2d'));}_0x243e4a=_0x322817;logger[_0x60b9('0xb')](util[_0x60b9('0xc')](_0x60b9('0x2e'),_0x2e12e7['id']));return sentiment(_0x243e4a['data1'],_0x243e4a['data2'],_0x1b2d06[_0x60b9('0x24')],_0x42eb4f[_0x60b9('0x27')],_0x1b2d06[_0x60b9('0x2f')]);})[_0x60b9('0x11')](function(_0xbd60d3){logger['info'](util[_0x60b9('0xc')](_0x60b9('0x30'),_0x2e12e7['id']));return _0x2e12e7[_0x60b9('0x1e')]({'sentiment':_0xbd60d3['Sentiment'],'sPositive':_0xbd60d3[_0x60b9('0x31')]['Positive'],'sNegative':_0xbd60d3['SentimentScore'][_0x60b9('0x32')],'sMixed':_0xbd60d3[_0x60b9('0x31')][_0x60b9('0x33')],'sNeutral':_0xbd60d3[_0x60b9('0x31')]['Neutral']});})[_0x60b9('0x11')](function(){logger[_0x60b9('0xb')](util[_0x60b9('0xc')](_0x60b9('0x1f'),_0x2e12e7['id']));_0x225df6();});case _0x60b9('0x34'):return _0x2e12e7['update']({'transcribeStatus':'FAILED','failureReason':_0x2d4995[_0x60b9('0x13')][_0x60b9('0x35')]})[_0x60b9('0x11')](function(){logger[_0x60b9('0xb')](util['format'](_0x60b9('0x1f'),_0x2e12e7['id']));_0x225df6();});default:logger[_0x60b9('0xb')](util[_0x60b9('0xc')](_0x60b9('0x36'),_0x2e12e7['id']));break;}}else{return BPromise[_0x60b9('0x37')]()['then'](function(){if(!_0x2e12e7[_0x60b9('0x20')]){throw new db[(_0x60b9('0x26'))][(_0x60b9('0x2a'))](_0x60b9('0x21'));}if(!_0x1b2d06[_0x60b9('0x22')]||!_0x1b2d06[_0x60b9('0x23')]||!_0x1b2d06[_0x60b9('0x24')]||!_0x1b2d06[_0x60b9('0x2f')]||!_0x1b2d06['bucket']){throw new db[(_0x60b9('0x26'))][(_0x60b9('0x2a'))]('Sentiment\x20Analysis\x20not\x20configured');}if(!_0x2e12e7[_0x60b9('0x27')]){throw new Error('Transcript\x20not\x20available');}if(_0x1b2d06[_0x60b9('0x23')]===_0xa4144b['id']){return _0xa4144b;}else{return db[_0x60b9('0x29')][_0x60b9('0x38')]({'where':{'id':_settings['sentimentAccountId']}});}})[_0x60b9('0x11')](function(_0x5025bf){if(!_0x5025bf){throw new db['Sequelize'][(_0x60b9('0x2a'))]('Cloud\x20Provider\x20not\x20available');}if(!_0x5025bf[_0x60b9('0x2c')]||!_0x5025bf['data2']){throw new db[(_0x60b9('0x26'))]['ValidationError']('Cloud\x20Provider\x20not\x20configured');}_0x243e4a=_0x5025bf;logger['info'](util[_0x60b9('0xc')](_0x60b9('0x2e'),_0x2e12e7['id']));return sentiment(_0x243e4a[_0x60b9('0x2c')],_0x243e4a['data2'],_0x1b2d06[_0x60b9('0x24')],_0x2e12e7[_0x60b9('0x27')],_0x1b2d06['language']);})[_0x60b9('0x11')](function(_0x36f3da){logger['info'](util[_0x60b9('0xc')](_0x60b9('0x30'),_0x2e12e7['id']));return _0x2e12e7[_0x60b9('0x1e')]({'sentiment':_0x36f3da[_0x60b9('0x39')],'sPositive':_0x36f3da['SentimentScore'][_0x60b9('0x3a')],'sNegative':_0x36f3da['SentimentScore'][_0x60b9('0x32')],'sMixed':_0x36f3da[_0x60b9('0x31')][_0x60b9('0x33')],'sNeutral':_0x36f3da[_0x60b9('0x31')]['Neutral'],'transcribeStatus':_0x60b9('0x15')});})['then'](function(){logger[_0x60b9('0xb')](util['format'](_0x60b9('0x1f'),_0x2e12e7['id']));_0x225df6();});}})[_0x60b9('0x3b')](function(_0x3cf602){if(_0x3cf602){if(!_0x3cf602[_0x60b9('0x3c')]||_0x3cf602['name']!=='SequelizeValidationError'){logger[_0x60b9('0x3d')](util[_0x60b9('0xc')]('[RECORDING:%d]\x20Error\x20running\x20Transcribe\x20&\x20Sentiment\x20Analysis',_0x2e12e7['id']),util['inspect'](_0x3cf602,{'showHidden':![],'depth':null}));}}_0x225df6();});});}function checkTranscribe(){var _0x21bb57;var _0x271f70;var _0x5c8d06;return db['VoiceRecording'][_0x60b9('0x3e')]({'where':{'transcribeStatus':_0x60b9('0x3f')}})[_0x60b9('0x11')](function(_0x129ecd){if(!_0x129ecd||!_0x129ecd['length']){throw new db[(_0x60b9('0x26'))][(_0x60b9('0x2a'))](_0x60b9('0x40'));}_0x21bb57=_0x129ecd;return db[_0x60b9('0x41')][_0x60b9('0x38')]({'where':{'id':0x1}});})['then'](function(_0x354992){if(!_0x354992){throw new db[(_0x60b9('0x26'))][(_0x60b9('0x2a'))]('Settings\x20not\x20available');}_0x271f70=_0x354992;if(!_0x271f70[_0x60b9('0x42')]||!_0x271f70[_0x60b9('0x43')]||!_0x271f70[_0x60b9('0x10')]||!_0x271f70['language']||!_0x271f70['bucket']){throw new db['Sequelize'][(_0x60b9('0x2a'))](_0x60b9('0x44'));}return db[_0x60b9('0x29')][_0x60b9('0x38')]({'where':{'id':_0x271f70[_0x60b9('0x43')]}});})[_0x60b9('0x11')](function(_0x22252a){if(!_0x22252a){throw new db['Sequelize'][(_0x60b9('0x2a'))](_0x60b9('0x2b'));}if(!_0x22252a['data1']||!_0x22252a[_0x60b9('0xf')]){throw new db[(_0x60b9('0x26'))][(_0x60b9('0x2a'))](_0x60b9('0x2d'));}_0x5c8d06=_0x22252a;var _0x216e02=[];_0x21bb57[_0x60b9('0x45')](function(_0x202fda){_0x216e02['push'](checkTranscribeJob(_0x202fda,_0x271f70,_0x5c8d06));});return BPromise[_0x60b9('0x46')](_0x216e02);})['catch'](function(_0x65af99){if(_0x65af99){if(!_0x65af99[_0x60b9('0x3c')]||_0x65af99[_0x60b9('0x3c')]!==_0x60b9('0x47')){logger['error'](util[_0x60b9('0x48')](_0x65af99,{'showHidden':![],'depth':null}));}}});}exports[_0x60b9('0x49')]=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 ecb0169..ab012ad 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 _0xa544=['update','system','timeout','format','YYYY-MM-DD\x20HH:mm:ss','emit','whatsappInteraction:update','catch','error','inspect','start','moment','ioredis','../../config/environment','../../mysqldb','../logger','redis','defaults','localhost','socket.io-emitter','lastMsgAt','subtract','hours','length','map','info','[WHATSAPP]\x20Interactions\x20to\x20close:','join'];(function(_0x43f489,_0x2b4fea){var _0x4134b4=function(_0x4365f6){while(--_0x4365f6){_0x43f489['push'](_0x43f489['shift']());}};_0x4134b4(++_0x2b4fea);}(_0xa544,0x97));var _0x4a54=function(_0x18a962,_0x2fa79b){_0x18a962=_0x18a962-0x0;var _0x32faec=_0xa544[_0x18a962];return _0x32faec;};'use strict';var _=require('lodash');var moment=require(_0x4a54('0x0'));var Redis=require(_0x4a54('0x1'));var util=require('util');var config=require(_0x4a54('0x2'));var db=require(_0x4a54('0x3'))['db'];var logger=require(_0x4a54('0x4'))('schedule');config[_0x4a54('0x5')]=_[_0x4a54('0x6')](config['redis'],{'host':_0x4a54('0x7'),'port':0x18eb});var io=require(_0x4a54('0x8'))(new Redis(config[_0x4a54('0x5')]));function closeInteractions(){var _0x5304d8=[];return db['WhatsappInteraction']['findAll']({'raw':!![],'attributes':['id',_0x4a54('0x9')],'where':{'closed':![],'lastMsgDirection':'in','lastMsgAt':{'$lt':moment()[_0x4a54('0xa')](0x18,_0x4a54('0xb'))}}})['then'](function(_0x5f0b14){if(_0x5f0b14&&_0x5f0b14[_0x4a54('0xc')]){_0x5304d8=_[_0x4a54('0xd')](_0x5f0b14||[],'id');logger[_0x4a54('0xe')](_0x4a54('0xf'),_0x5304d8[_0x4a54('0x10')]());return db['WhatsappInteraction'][_0x4a54('0x11')]({'closeReason':_0x4a54('0x12'),'disposition':_0x4a54('0x13'),'closed':!![],'closedAt':moment()[_0x4a54('0x14')](_0x4a54('0x15'))},{'where':{'id':_0x5304d8}});}})['then'](function(){if(_0x5304d8&&_0x5304d8[_0x4a54('0xc')]){logger['info']('[WHATSAPP]\x20Sending\x20updates\x20for\x20interactions:',_0x5304d8[_0x4a54('0x10')]());for(var _0x61d8fa=0x0;_0x61d8fa<_0x5304d8[_0x4a54('0xc')];_0x61d8fa++){io[_0x4a54('0x16')](_0x4a54('0x17'),{'id':_0x5304d8[_0x61d8fa],'closed':!![]});}}})[_0x4a54('0x18')](function(_0x286d1f){logger[_0x4a54('0x19')]('[WHATSAPP]\x20Error\x20closing\x20interactions',_0x286d1f?util[_0x4a54('0x1a')](_0x286d1f,{'showHidden':![],'depth':null}):'');});}exports[_0x4a54('0x1b')]=function(){setInterval(function(){return closeInteractions();},0x3c*0x3e8);return closeInteractions();}; \ No newline at end of file +var _0x8009=['schedule','defaults','redis','localhost','socket.io-emitter','WhatsappInteraction','lastMsgAt','subtract','hours','then','map','info','[WHATSAPP]\x20Interactions\x20to\x20close:','join','update','system','timeout','format','YYYY-MM-DD\x20HH:mm:ss','[WHATSAPP]\x20Sending\x20updates\x20for\x20interactions:','length','emit','whatsappInteraction:update','catch','error','start','lodash','ioredis','util','../../config/environment','../../mysqldb','../logger'];(function(_0x173d7e,_0x3242fd){var _0x2220d6=function(_0x462828){while(--_0x462828){_0x173d7e['push'](_0x173d7e['shift']());}};_0x2220d6(++_0x3242fd);}(_0x8009,0xba));var _0x9800=function(_0x243c27,_0x5d2026){_0x243c27=_0x243c27-0x0;var _0x148ce1=_0x8009[_0x243c27];return _0x148ce1;};'use strict';var _=require(_0x9800('0x0'));var moment=require('moment');var Redis=require(_0x9800('0x1'));var util=require(_0x9800('0x2'));var config=require(_0x9800('0x3'));var db=require(_0x9800('0x4'))['db'];var logger=require(_0x9800('0x5'))(_0x9800('0x6'));config['redis']=_[_0x9800('0x7')](config[_0x9800('0x8')],{'host':_0x9800('0x9'),'port':0x18eb});var io=require(_0x9800('0xa'))(new Redis(config['redis']));function closeInteractions(){var _0x47ed41=[];return db[_0x9800('0xb')]['findAll']({'raw':!![],'attributes':['id',_0x9800('0xc')],'where':{'closed':![],'lastMsgDirection':'in','lastMsgAt':{'$lt':moment()[_0x9800('0xd')](0x18,_0x9800('0xe'))}}})[_0x9800('0xf')](function(_0x1c25e0){if(_0x1c25e0&&_0x1c25e0['length']){_0x47ed41=_[_0x9800('0x10')](_0x1c25e0||[],'id');logger[_0x9800('0x11')](_0x9800('0x12'),_0x47ed41[_0x9800('0x13')]());return db[_0x9800('0xb')][_0x9800('0x14')]({'closeReason':_0x9800('0x15'),'disposition':_0x9800('0x16'),'closed':!![],'closedAt':moment()[_0x9800('0x17')](_0x9800('0x18'))},{'where':{'id':_0x47ed41}});}})['then'](function(){if(_0x47ed41&&_0x47ed41['length']){logger[_0x9800('0x11')](_0x9800('0x19'),_0x47ed41[_0x9800('0x13')]());for(var _0x5ac26d=0x0;_0x5ac26d<_0x47ed41[_0x9800('0x1a')];_0x5ac26d++){io[_0x9800('0x1b')](_0x9800('0x1c'),{'id':_0x47ed41[_0x5ac26d],'closed':!![]});}}})[_0x9800('0x1d')](function(_0x2227cd){logger[_0x9800('0x1e')]('[WHATSAPP]\x20Error\x20closing\x20interactions',_0x2227cd?util['inspect'](_0x2227cd,{'showHidden':![],'depth':null}):'');});}exports[_0x9800('0x1f')]=function(){setInterval(function(){return closeInteractions();},0x3c*0x3e8);return closeInteractions();}; \ No newline at end of file diff --git a/server/config/seedContact.js b/server/config/seedContact.js index 401082c..29aa26e 100644 --- a/server/config/seedContact.js +++ b/server/config/seedContact.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x9ad5=['now','push','Innocenzo','Biondo','CmContact','destroy','bulkCreate','then','log','finished\x20populating','CmHopper','hopper1','contacts2','hopper2','catch','util','../mysqldb','innocenzo.biondo','@xcally.com'];(function(_0x2af29a,_0x4f44bc){var _0x5ef02f=function(_0x4349ef){while(--_0x4349ef){_0x2af29a['push'](_0x2af29a['shift']());}};_0x5ef02f(++_0x4f44bc);}(_0x9ad5,0x1b1));var _0x59ad=function(_0x57dd01,_0x291d5f){_0x57dd01=_0x57dd01-0x0;var _0x706d85=_0x9ad5[_0x57dd01];return _0x706d85;};'use strict';var util=require(_0x59ad('0x0'));var db=require(_0x59ad('0x1'))['db'];var contacts=[];var hopper=[];var contacts2=[];var hopper2=[];for(var i=0x1;i<=0x4b0;i+=0x1){contacts['push']({'id':i,'firstName':'Innocenzo'+i,'lastName':'Biondo'+i,'phone':0xf879fb460+i,'email':_0x59ad('0x2')+i+_0x59ad('0x3')});}for(var i=0x1;i<=0x4b0;i+=0x1){hopper['push']({'id':i,'active':![],'scheduledat':Date['now'](),'countbusyretry':0x0,'countcongestionretry':0x0,'countnoanswerretry':0x0,'ContactId':i,'ListId':0x1,'UserId':0x1,'VoiceQueueId':0x3fd,'createdAt':Date['now'](),'updatedAt':Date[_0x59ad('0x4')]()});}for(var i=0x4b1;i<=0x960;i+=0x1){contacts2[_0x59ad('0x5')]({'id':i,'firstName':_0x59ad('0x6')+i,'lastName':_0x59ad('0x7')+i,'phone':0xf879fb460+i,'email':'innocenzo.biondo'+i+'@xcally.com'});}for(var i=0x4b1;i<=0x960;i+=0x1){hopper2[_0x59ad('0x5')]({'id':i,'active':![],'scheduledat':Date['now'](),'countbusyretry':0x0,'countcongestionretry':0x0,'countnoanswerretry':0x0,'ContactId':i,'ListId':0x1,'UserId':0x1,'VoiceQueueId':0x3fd,'createdAt':Date[_0x59ad('0x4')](),'updatedAt':Date[_0x59ad('0x4')]()});}db[_0x59ad('0x8')][_0x59ad('0x9')]({'where':{}})['then'](function(){return db['CmContact'][_0x59ad('0xa')](contacts);})[_0x59ad('0xb')](function(){console[_0x59ad('0xc')](_0x59ad('0xd'),'contacts1');return db[_0x59ad('0xe')][_0x59ad('0x9')]({'where':{}});})[_0x59ad('0xb')](function(){return db[_0x59ad('0xe')][_0x59ad('0xa')](hopper);})[_0x59ad('0xb')](function(){console[_0x59ad('0xc')](_0x59ad('0xd'),_0x59ad('0xf'));return db[_0x59ad('0x8')][_0x59ad('0xa')](contacts2);})[_0x59ad('0xb')](function(){console[_0x59ad('0xc')](_0x59ad('0xd'),_0x59ad('0x10'));return db[_0x59ad('0xe')][_0x59ad('0xa')](hopper2);})[_0x59ad('0xb')](function(){console[_0x59ad('0xc')](_0x59ad('0xd'),_0x59ad('0x11'));})[_0x59ad('0x12')](function(_0x634e38){console[_0x59ad('0xc')](_0x634e38);}); \ No newline at end of file +var _0x26e6=['CmHopper','contacts2','hopper2','catch','util','push','Biondo','now','Innocenzo','innocenzo.biondo','@xcally.com','destroy','then','CmContact','bulkCreate','log','finished\x20populating','contacts1'];(function(_0x318634,_0x1f9561){var _0x364703=function(_0x36ab6a){while(--_0x36ab6a){_0x318634['push'](_0x318634['shift']());}};_0x364703(++_0x1f9561);}(_0x26e6,0x70));var _0x626e=function(_0x19d7bf,_0x265436){_0x19d7bf=_0x19d7bf-0x0;var _0x46494c=_0x26e6[_0x19d7bf];return _0x46494c;};'use strict';var util=require(_0x626e('0x0'));var db=require('../mysqldb')['db'];var contacts=[];var hopper=[];var contacts2=[];var hopper2=[];for(var i=0x1;i<=0x4b0;i+=0x1){contacts[_0x626e('0x1')]({'id':i,'firstName':'Innocenzo'+i,'lastName':_0x626e('0x2')+i,'phone':0xf879fb460+i,'email':'innocenzo.biondo'+i+'@xcally.com'});}for(var i=0x1;i<=0x4b0;i+=0x1){hopper['push']({'id':i,'active':![],'scheduledat':Date['now'](),'countbusyretry':0x0,'countcongestionretry':0x0,'countnoanswerretry':0x0,'ContactId':i,'ListId':0x1,'UserId':0x1,'VoiceQueueId':0x3fd,'createdAt':Date[_0x626e('0x3')](),'updatedAt':Date[_0x626e('0x3')]()});}for(var i=0x4b1;i<=0x960;i+=0x1){contacts2['push']({'id':i,'firstName':_0x626e('0x4')+i,'lastName':'Biondo'+i,'phone':0xf879fb460+i,'email':_0x626e('0x5')+i+_0x626e('0x6')});}for(var i=0x4b1;i<=0x960;i+=0x1){hopper2[_0x626e('0x1')]({'id':i,'active':![],'scheduledat':Date[_0x626e('0x3')](),'countbusyretry':0x0,'countcongestionretry':0x0,'countnoanswerretry':0x0,'ContactId':i,'ListId':0x1,'UserId':0x1,'VoiceQueueId':0x3fd,'createdAt':Date[_0x626e('0x3')](),'updatedAt':Date['now']()});}db['CmContact'][_0x626e('0x7')]({'where':{}})[_0x626e('0x8')](function(){return db[_0x626e('0x9')][_0x626e('0xa')](contacts);})[_0x626e('0x8')](function(){console[_0x626e('0xb')](_0x626e('0xc'),_0x626e('0xd'));return db[_0x626e('0xe')][_0x626e('0x7')]({'where':{}});})['then'](function(){return db[_0x626e('0xe')][_0x626e('0xa')](hopper);})[_0x626e('0x8')](function(){console['log'](_0x626e('0xc'),'hopper1');return db[_0x626e('0x9')]['bulkCreate'](contacts2);})[_0x626e('0x8')](function(){console[_0x626e('0xb')]('finished\x20populating',_0x626e('0xf'));return db[_0x626e('0xe')][_0x626e('0xa')](hopper2);})[_0x626e('0x8')](function(){console['log'](_0x626e('0xc'),_0x626e('0x10'));})[_0x626e('0x11')](function(_0x58ed0f){console[_0x626e('0xb')](_0x58ed0f);}); \ No newline at end of file diff --git a/server/config/seedUsers.js b/server/config/seedUsers.js index 5077c0c..145df09 100644 --- a/server/config/seedUsers.js +++ b/server/config/seedUsers.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x526f=['../mysqldb','push','format','%s%s','agent','%s%s@xcally.com','udp','wss','all','yes','/etc/pki/tls/private/motion.key','\x22%s\x22\x20<%s>','bulkCreate','then','log','catch'];(function(_0x593b33,_0x1ea034){var _0x2f17a2=function(_0x2dbb16){while(--_0x2dbb16){_0x593b33['push'](_0x593b33['shift']());}};_0x2f17a2(++_0x1ea034);}(_0x526f,0x1a0));var _0xf526=function(_0x2c8433,_0x4a0b1e){_0x2c8433=_0x2c8433-0x0;var _0xc8dae5=_0x526f[_0x2c8433];return _0xc8dae5;};'use strict';var util=require('util');var db=require(_0xf526('0x0'))['db'];var users=[];for(var i=0x1;i<=0xc8;i+=0x1){users[_0xf526('0x1')]({'name':util[_0xf526('0x2')](_0xf526('0x3'),'agent',i),'fullname':util[_0xf526('0x2')](_0xf526('0x3'),_0xf526('0x4'),i),'email':util[_0xf526('0x2')](_0xf526('0x5'),_0xf526('0x4'),i),'role':_0xf526('0x4'),'password':'password','internal':0xfa0+i,'type':'friend','transport':[_0xf526('0x6'),'ws',_0xf526('0x7')],'disallow':[_0xf526('0x8')],'allow':['ulaw'],'defaultuser':util[_0xf526('0x2')](_0xf526('0x3'),_0xf526('0x4'),i),'encryption':_0xf526('0x9'),'avpf':_0xf526('0x9'),'force_avp':_0xf526('0x9'),'icesupport':'yes','dtlsenable':'yes','dtlsverify':'no','dtlscertfile':'/etc/pki/tls/certs/motion.crt','dtlsprivatekey':_0xf526('0xa'),'dtlssetup':'actpass','callerid':util[_0xf526('0x2')](_0xf526('0xb'),util['format'](_0xf526('0x3'),_0xf526('0x4'),i),0xfa0+i)});}db['User'][_0xf526('0xc')](users)[_0xf526('0xd')](function(){console[_0xf526('0xe')]('add\x20user');})[_0xf526('0xf')](function(_0x3bfa8e){console[_0xf526('0xe')](_0x3bfa8e);}); \ No newline at end of file +var _0x9e80=['wss','all','yes','/etc/pki/tls/certs/motion.crt','/etc/pki/tls/private/motion.key','actpass','User','bulkCreate','then','log','catch','util','../mysqldb','%s%s','agent','format','%s%s@xcally.com','password','friend'];(function(_0xc8babe,_0x349288){var _0x34151b=function(_0x1e3c77){while(--_0x1e3c77){_0xc8babe['push'](_0xc8babe['shift']());}};_0x34151b(++_0x349288);}(_0x9e80,0x187));var _0x09e8=function(_0xf1dc5e,_0x322f44){_0xf1dc5e=_0xf1dc5e-0x0;var _0x1bd9f5=_0x9e80[_0xf1dc5e];return _0x1bd9f5;};'use strict';var util=require(_0x09e8('0x0'));var db=require(_0x09e8('0x1'))['db'];var users=[];for(var i=0x1;i<=0xc8;i+=0x1){users['push']({'name':util['format'](_0x09e8('0x2'),'agent',i),'fullname':util['format']('%s%s',_0x09e8('0x3'),i),'email':util[_0x09e8('0x4')](_0x09e8('0x5'),'agent',i),'role':'agent','password':_0x09e8('0x6'),'internal':0xfa0+i,'type':_0x09e8('0x7'),'transport':['udp','ws',_0x09e8('0x8')],'disallow':[_0x09e8('0x9')],'allow':['ulaw'],'defaultuser':util[_0x09e8('0x4')]('%s%s',_0x09e8('0x3'),i),'encryption':_0x09e8('0xa'),'avpf':_0x09e8('0xa'),'force_avp':_0x09e8('0xa'),'icesupport':_0x09e8('0xa'),'dtlsenable':'yes','dtlsverify':'no','dtlscertfile':_0x09e8('0xb'),'dtlsprivatekey':_0x09e8('0xc'),'dtlssetup':_0x09e8('0xd'),'callerid':util[_0x09e8('0x4')]('\x22%s\x22\x20<%s>',util[_0x09e8('0x4')](_0x09e8('0x2'),_0x09e8('0x3'),i),0xfa0+i)});}db[_0x09e8('0xe')][_0x09e8('0xf')](users)[_0x09e8('0x10')](function(){console[_0x09e8('0x11')]('add\x20user');})[_0x09e8('0x12')](function(_0x4edd66){console[_0x09e8('0x11')](_0x4edd66);}); \ No newline at end of file diff --git a/server/config/socketio.js b/server/config/socketio.js index a2cceef..c5ae6e4 100644 --- a/server/config/socketio.js +++ b/server/config/socketio.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xe1c4=['address','DISCONNECTED','lodash','util','bluebird','name','User','role','telephone','agent','type','ivr','UserProfileSection','findOne','then','autoAssociation','VoiceQueues','FaxQueues','SmsQueues','MailQueues','OpenchannelQueues','findAll','Telephones','Trunks','UserProfileResource','resourceId','map','where','Campaign','format','%s:queue:%s','Agents','length','user:%s','handshake','query','ChatInteraction','ChatInteractions','MailInteraction','MailInteractions','FaxInteractions','SmsInteraction','SmsInteractions','OpenchannelInteraction','OpenchannelInteractions','WhatsappInteractions','admin','voice:outbound','hasOwnProperty','include','VoiceQueue','push','SmsQueue','MailQueue','OpenchannelQueue','WhatsappQueue','Trunk','voice:inbound','userProfileId','ChatQueues','FaxQueue','WhatsappQueues','IvrCampaigns','getChatQueues','getFaxQueues','getMailQueues','getOpenchannelQueues','all','chat','fax','sms','mail','openchannel','whatsapp','trunk:%s','leave','removeChatInteractions','user_has_chat_interactions:remove','removeMailInteractions','emit','removeFaxInteractions','user_has_fax_interactions:remove','removeSmsInteractions','removeOpenchannelInteractions','user_has_openchannel_interactions:remove','removeWhatsappInteractions','user_has_whatsapp_interactions:remove','log','join','default','connection','setMaxListeners','request','remoteAddress','remotePort','connectedAt','SocketIO\x20','nsp'];(function(_0x79b53e,_0x108f8d){var _0x2d4d6c=function(_0x256d7f){while(--_0x256d7f){_0x79b53e['push'](_0x79b53e['shift']());}};_0x2d4d6c(++_0x108f8d);}(_0xe1c4,0x1ec));var _0x4e1c=function(_0x569c95,_0x54f839){_0x569c95=_0x569c95-0x0;var _0x2749b5=_0xe1c4[_0x569c95];return _0x2749b5;};'use strict';var _=require(_0x4e1c('0x0'));var util=require(_0x4e1c('0x1'));var BPromise=require(_0x4e1c('0x2'));var db=require('../mysqldb')['db'];var config=require('./environment');var queryQueues={'attributes':['id',_0x4e1c('0x3')],'include':[{'as':'Agents','model':db[_0x4e1c('0x4')],'attributes':['id',_0x4e1c('0x3'),_0x4e1c('0x5')],'raw':!![],'where':{'role':'agent'},'required':![]}]};var queryTelephones={'raw':!![],'attributes':['id','name'],'where':{'role':_0x4e1c('0x6')}};var queryTrunks={'raw':!![],'attributes':['id',_0x4e1c('0x3')]};var queryAgents={'raw':!![],'attributes':['id',_0x4e1c('0x3')],'where':{'role':_0x4e1c('0x7')}};var queryCampaigns={'raw':!![],'attributes':['id',_0x4e1c('0x3'),_0x4e1c('0x8')],'where':{'type':_0x4e1c('0x9')}};function getAssociatedResources(_0x443447,_0x16c9d8,_0x60e98c){return db[_0x4e1c('0xa')][_0x4e1c('0xb')]({'where':{'name':_0x443447,'userProfileId':_0x16c9d8},'raw':!![]})[_0x4e1c('0xc')](function(_0x4fc396){if(_0x4fc396){if(_0x4fc396[_0x4e1c('0xd')]){switch(_0x443447){case _0x4e1c('0xe'):case'ChatQueues':case _0x4e1c('0xf'):case _0x4e1c('0x10'):case _0x4e1c('0x11'):case _0x4e1c('0x12'):case'WhatsappQueues':return db[_0x60e98c][_0x4e1c('0x13')](queryQueues);case _0x4e1c('0x14'):return db[_0x60e98c][_0x4e1c('0x13')](queryTelephones);case _0x4e1c('0x15'):return db[_0x60e98c]['findAll'](queryTrunks);case'IvrCampaigns':return db[_0x60e98c]['findAll'](queryCampaigns);}}else{return db[_0x4e1c('0x16')][_0x4e1c('0x13')]({'attributes':[_0x4e1c('0x17')],'where':{'sectionId':_0x4fc396['id']},'raw':!![]})[_0x4e1c('0xc')](function(_0x4d47ec){if(_0x4d47ec){var _0x2cd5bc={'where':{'id':_[_0x4e1c('0x18')](_0x4d47ec,_0x4e1c('0x17'))},'raw':!![]};switch(_0x60e98c){case _0x4e1c('0x4'):_0x2cd5bc[_0x4e1c('0x19')][_0x4e1c('0x5')]='telephone';break;case _0x4e1c('0x1a'):_0x2cd5bc[_0x4e1c('0x19')][_0x4e1c('0x8')]=_0x4e1c('0x9');break;}return db[_0x60e98c][_0x4e1c('0x13')](_0x2cd5bc);}else{return[];}});}}else{return[];}})[_0x4e1c('0xc')](function(_0x13d348){return _0x13d348;});}function joinOrLeaveQueues(_0x544b08,_0x2dbfe9,_0x426864,_0x391ade){_0x544b08[_0x2dbfe9](util[_0x4e1c('0x1b')](_0x4e1c('0x1c'),_0x426864,_0x391ade[_0x4e1c('0x3')]));if(_0x391ade[_0x4e1c('0x1d')]){for(var _0x53a020=0x0;_0x53a020<_0x391ade[_0x4e1c('0x1d')][_0x4e1c('0x1e')];_0x53a020+=0x1){_0x544b08[_0x2dbfe9](util[_0x4e1c('0x1b')](_0x4e1c('0x1f'),_0x391ade[_0x4e1c('0x1d')][_0x53a020][_0x4e1c('0x3')]));}}}function joinOrLeave(_0x98868b,_0x19ed77,_0x45c13e){var _0x5ada14;if(_0x98868b[_0x4e1c('0x20')][_0x4e1c('0x21')]['id']){db[_0x4e1c('0x4')]['find']({'attributes':['id','name',_0x4e1c('0x5'),'userProfileId'],'where':{'id':_0x98868b[_0x4e1c('0x20')][_0x4e1c('0x21')]['id']},'include':[{'model':db[_0x4e1c('0x22')],'as':_0x4e1c('0x23'),'attributes':['id'],'raw':!![]},{'model':db[_0x4e1c('0x24')],'as':_0x4e1c('0x25'),'attributes':['id'],'raw':!![]},{'model':db['FaxInteraction'],'as':_0x4e1c('0x26'),'attributes':['id'],'raw':!![]},{'model':db[_0x4e1c('0x27')],'as':_0x4e1c('0x28'),'attributes':['id'],'raw':!![]},{'model':db[_0x4e1c('0x29')],'as':_0x4e1c('0x2a'),'attributes':['id'],'raw':!![]},{'model':db['WhatsappInteraction'],'as':_0x4e1c('0x2b'),'attributes':['id'],'raw':!![]}]})[_0x4e1c('0xc')](function(_0x1b5ba8){if(_0x1b5ba8){_0x5ada14=_0x1b5ba8;_0x98868b[_0x19ed77](util[_0x4e1c('0x1b')]('user:%s',_0x1b5ba8[_0x4e1c('0x3')]));var _0x15fdb4=[];switch(_0x1b5ba8['role']){case _0x4e1c('0x2c'):_0x98868b[_0x19ed77]('voice:inbound');_0x98868b[_0x19ed77](_0x4e1c('0x2d'));if(queryQueues[_0x4e1c('0x2e')](_0x4e1c('0x2f'))){delete queryQueues[_0x4e1c('0x2f')];}_0x15fdb4['push'](db[_0x4e1c('0x30')]['findAll'](queryQueues));_0x15fdb4[_0x4e1c('0x31')](db['ChatQueue'][_0x4e1c('0x13')](queryQueues));_0x15fdb4[_0x4e1c('0x31')](db['FaxQueue'][_0x4e1c('0x13')](queryQueues));_0x15fdb4['push'](db[_0x4e1c('0x32')][_0x4e1c('0x13')](queryQueues));_0x15fdb4[_0x4e1c('0x31')](db[_0x4e1c('0x33')][_0x4e1c('0x13')](queryQueues));_0x15fdb4[_0x4e1c('0x31')](db[_0x4e1c('0x34')][_0x4e1c('0x13')](queryQueues));_0x15fdb4[_0x4e1c('0x31')](db[_0x4e1c('0x35')]['findAll'](queryQueues));_0x15fdb4[_0x4e1c('0x31')](db[_0x4e1c('0x4')][_0x4e1c('0x13')](queryTelephones));_0x15fdb4[_0x4e1c('0x31')](db[_0x4e1c('0x36')][_0x4e1c('0x13')](queryTrunks));_0x15fdb4['push'](db['Campaign'][_0x4e1c('0x13')](queryCampaigns));_0x15fdb4[_0x4e1c('0x31')](db[_0x4e1c('0x4')][_0x4e1c('0x13')](queryAgents));break;case'user':_0x98868b[_0x19ed77](_0x4e1c('0x37'));_0x98868b[_0x19ed77](_0x4e1c('0x2d'));_0x15fdb4['push'](getAssociatedResources(_0x4e1c('0xe'),_0x1b5ba8[_0x4e1c('0x38')],_0x4e1c('0x30')));_0x15fdb4['push'](getAssociatedResources(_0x4e1c('0x39'),_0x1b5ba8[_0x4e1c('0x38')],'ChatQueue'));_0x15fdb4[_0x4e1c('0x31')](getAssociatedResources(_0x4e1c('0xf'),_0x1b5ba8[_0x4e1c('0x38')],_0x4e1c('0x3a')));_0x15fdb4[_0x4e1c('0x31')](getAssociatedResources(_0x4e1c('0x10'),_0x1b5ba8['userProfileId'],'SmsQueue'));_0x15fdb4[_0x4e1c('0x31')](getAssociatedResources(_0x4e1c('0x11'),_0x1b5ba8[_0x4e1c('0x38')],_0x4e1c('0x33')));_0x15fdb4[_0x4e1c('0x31')](getAssociatedResources(_0x4e1c('0x12'),_0x1b5ba8[_0x4e1c('0x38')],_0x4e1c('0x34')));_0x15fdb4[_0x4e1c('0x31')](getAssociatedResources(_0x4e1c('0x3b'),_0x1b5ba8[_0x4e1c('0x38')],'WhatsappQueue'));_0x15fdb4['push'](getAssociatedResources(_0x4e1c('0x14'),_0x1b5ba8[_0x4e1c('0x38')],_0x4e1c('0x4')));_0x15fdb4[_0x4e1c('0x31')](getAssociatedResources(_0x4e1c('0x15'),_0x1b5ba8[_0x4e1c('0x38')],'Trunk'));_0x15fdb4[_0x4e1c('0x31')](getAssociatedResources(_0x4e1c('0x3c'),_0x1b5ba8[_0x4e1c('0x38')],_0x4e1c('0x1a')));_0x15fdb4[_0x4e1c('0x31')](db[_0x4e1c('0x4')][_0x4e1c('0x13')](queryAgents));break;case _0x4e1c('0x7'):_0x98868b[_0x19ed77](_0x4e1c('0x37'));_0x98868b[_0x19ed77](_0x4e1c('0x2d'));_0x15fdb4[_0x4e1c('0x31')](_0x1b5ba8['getVoiceQueues']({'attributes':['id',_0x4e1c('0x3')]}));_0x15fdb4[_0x4e1c('0x31')](_0x1b5ba8[_0x4e1c('0x3d')]({'attributes':['id',_0x4e1c('0x3')]}));_0x15fdb4[_0x4e1c('0x31')](_0x1b5ba8[_0x4e1c('0x3e')]({'attributes':['id',_0x4e1c('0x3')]}));_0x15fdb4[_0x4e1c('0x31')](_0x1b5ba8['getSmsQueues']({'attributes':['id',_0x4e1c('0x3')]}));_0x15fdb4['push'](_0x1b5ba8[_0x4e1c('0x3f')]({'attributes':['id',_0x4e1c('0x3')]}));_0x15fdb4['push'](_0x1b5ba8[_0x4e1c('0x40')]({'attributes':['id',_0x4e1c('0x3')]}));_0x15fdb4['push'](_0x1b5ba8['getWhatsappQueues']({'attributes':['id',_0x4e1c('0x3')]}));break;}return BPromise[_0x4e1c('0x41')](_0x15fdb4);}})[_0x4e1c('0xc')](function(_0x7b26dc){if(_0x7b26dc&&_0x7b26dc['length']){for(var _0x3e6639=0x0;_0x3e6639<_0x7b26dc[_0x4e1c('0x1e')];_0x3e6639+=0x1){for(var _0x2169ae=0x0;_0x2169ae<_0x7b26dc[_0x3e6639][_0x4e1c('0x1e')];_0x2169ae+=0x1){switch(_0x3e6639){case 0x0:joinOrLeaveQueues(_0x98868b,_0x19ed77,'voice',_0x7b26dc[_0x3e6639][_0x2169ae]);break;case 0x1:joinOrLeaveQueues(_0x98868b,_0x19ed77,_0x4e1c('0x42'),_0x7b26dc[_0x3e6639][_0x2169ae]);break;case 0x2:joinOrLeaveQueues(_0x98868b,_0x19ed77,_0x4e1c('0x43'),_0x7b26dc[_0x3e6639][_0x2169ae]);break;case 0x3:joinOrLeaveQueues(_0x98868b,_0x19ed77,_0x4e1c('0x44'),_0x7b26dc[_0x3e6639][_0x2169ae]);break;case 0x4:joinOrLeaveQueues(_0x98868b,_0x19ed77,_0x4e1c('0x45'),_0x7b26dc[_0x3e6639][_0x2169ae]);break;case 0x5:joinOrLeaveQueues(_0x98868b,_0x19ed77,_0x4e1c('0x46'),_0x7b26dc[_0x3e6639][_0x2169ae]);break;case 0x6:joinOrLeaveQueues(_0x98868b,_0x19ed77,_0x4e1c('0x47'),_0x7b26dc[_0x3e6639][_0x2169ae]);break;case 0x7:if(_0x5ada14[_0x4e1c('0x5')]!==_0x4e1c('0x7'))_0x98868b[_0x19ed77](util[_0x4e1c('0x1b')]('telephone:%s',_0x7b26dc[_0x3e6639][_0x2169ae][_0x4e1c('0x3')]));break;case 0x8:if(_0x5ada14['role']!==_0x4e1c('0x7'))_0x98868b[_0x19ed77](util[_0x4e1c('0x1b')](_0x4e1c('0x48'),_0x7b26dc[_0x3e6639][_0x2169ae]['name']));break;case 0x9:if(_0x5ada14['role']!==_0x4e1c('0x7'))_0x98868b[_0x19ed77](util[_0x4e1c('0x1b')]('campaign:%s:%s',_0x7b26dc[_0x3e6639][_0x2169ae][_0x4e1c('0x8')],_0x7b26dc[_0x3e6639][_0x2169ae][_0x4e1c('0x3')]));break;case 0xa:_0x98868b[_0x19ed77](util['format']('user:%s',_0x7b26dc[_0x3e6639][_0x2169ae][_0x4e1c('0x3')]));break;}}}}})['then'](function(){if(_0x19ed77===_0x4e1c('0x49')){var _0x284835=_[_0x4e1c('0x18')](_0x5ada14[_0x4e1c('0x23')],'id');return _0x5ada14[_0x4e1c('0x4a')](_0x284835)[_0x4e1c('0xc')](function(){for(var _0x7eeb2f=0x0;_0x7eeb2f<_0x284835[_0x4e1c('0x1e')];_0x7eeb2f+=0x1){_0x45c13e['emit'](_0x4e1c('0x4b'),{'ChatInteractionId':Number(_0x284835[_0x7eeb2f]),'UserId':Number(_0x5ada14['id'])});}});}})[_0x4e1c('0xc')](function(){if(_0x19ed77==='leave'){var _0x44808e=_['map'](_0x5ada14[_0x4e1c('0x25')],'id');return _0x5ada14[_0x4e1c('0x4c')](_0x44808e)[_0x4e1c('0xc')](function(){for(var _0x4ac25b=0x0;_0x4ac25b<_0x44808e[_0x4e1c('0x1e')];_0x4ac25b+=0x1){_0x45c13e[_0x4e1c('0x4d')]('user_has_mail_interactions:remove',{'MailInteractionId':Number(_0x44808e[_0x4ac25b]),'UserId':Number(_0x5ada14['id'])});}});}})[_0x4e1c('0xc')](function(){if(_0x19ed77===_0x4e1c('0x49')){var _0x356e11=_[_0x4e1c('0x18')](_0x5ada14['FaxInteractions'],'id');return _0x5ada14[_0x4e1c('0x4e')](_0x356e11)[_0x4e1c('0xc')](function(){for(var _0x2a417f=0x0;_0x2a417f<_0x356e11[_0x4e1c('0x1e')];_0x2a417f+=0x1){_0x45c13e[_0x4e1c('0x4d')](_0x4e1c('0x4f'),{'FaxInteractionId':Number(_0x356e11[_0x2a417f]),'UserId':Number(_0x5ada14['id'])});}});}})[_0x4e1c('0xc')](function(){if(_0x19ed77==='leave'){var _0x1d5548=_[_0x4e1c('0x18')](_0x5ada14[_0x4e1c('0x28')],'id');return _0x5ada14[_0x4e1c('0x50')](_0x1d5548)['then'](function(){for(var _0x1b99db=0x0;_0x1b99db<_0x1d5548[_0x4e1c('0x1e')];_0x1b99db+=0x1){_0x45c13e['emit']('user_has_sms_interactions:remove',{'SmsInteractionId':Number(_0x1d5548[_0x1b99db]),'UserId':Number(_0x5ada14['id'])});}});}})[_0x4e1c('0xc')](function(){if(_0x19ed77===_0x4e1c('0x49')){var _0x393a2b=_[_0x4e1c('0x18')](_0x5ada14[_0x4e1c('0x2a')],'id');return _0x5ada14[_0x4e1c('0x51')](_0x393a2b)[_0x4e1c('0xc')](function(){for(var _0x442604=0x0;_0x442604<_0x393a2b[_0x4e1c('0x1e')];_0x442604+=0x1){_0x45c13e['emit'](_0x4e1c('0x52'),{'OpenchannelInteractionId':Number(_0x393a2b[_0x442604]),'UserId':Number(_0x5ada14['id'])});}});}})['then'](function(){if(_0x19ed77===_0x4e1c('0x49')){var _0x65874d=_[_0x4e1c('0x18')](_0x5ada14['WhatsappInteractions'],'id');return _0x5ada14[_0x4e1c('0x53')](_0x65874d)[_0x4e1c('0xc')](function(){for(var _0x4432c1=0x0;_0x4432c1<_0x65874d['length'];_0x4432c1+=0x1){_0x45c13e[_0x4e1c('0x4d')](_0x4e1c('0x54'),{'WhatsappInteractionId':Number(_0x65874d[_0x4432c1]),'UserId':Number(_0x5ada14['id'])});}});}})['catch'](function(_0x335830){_0x98868b[_0x4e1c('0x55')](_0x335830);});}}function onDisconnect(_0x108765,_0x2c2de4){joinOrLeave(_0x108765,_0x4e1c('0x49'),_0x2c2de4);}function onConnect(_0x15ce0a){joinOrLeave(_0x15ce0a,_0x4e1c('0x56'));}exports[_0x4e1c('0x57')]=function(_0x4e7a8d){_0x4e7a8d['on'](_0x4e1c('0x58'),function(_0x455f0b){_0x455f0b[_0x4e1c('0x59')](0x0);_0x455f0b['address']=_0x455f0b[_0x4e1c('0x5a')][_0x4e1c('0x58')][_0x4e1c('0x5b')]+':'+_0x455f0b[_0x4e1c('0x5a')][_0x4e1c('0x58')][_0x4e1c('0x5c')];_0x455f0b[_0x4e1c('0x5d')]=new Date();_0x455f0b[_0x4e1c('0x55')]=function(_0xbfd9e4){console[_0x4e1c('0x55')](_0x4e1c('0x5e')+_0x455f0b[_0x4e1c('0x5f')][_0x4e1c('0x3')]+'['+_0x455f0b[_0x4e1c('0x60')]+']',_0xbfd9e4);};_0x455f0b['on']('disconnect',function(){onDisconnect(_0x455f0b,_0x4e7a8d);_0x455f0b['log'](_0x4e1c('0x61'));});onConnect(_0x455f0b);_0x455f0b['log']('CONNECTED');});}; \ No newline at end of file +var _0xff6f=['UserProfileResource','resourceId','map','where','telephone','Campaign','format','Agents','length','user:%s','handshake','query','find','userProfileId','ChatInteraction','ChatInteractions','MailInteraction','MailInteractions','SmsInteractions','OpenchannelInteractions','WhatsappInteraction','WhatsappInteractions','admin','voice:outbound','hasOwnProperty','include','push','VoiceQueue','ChatQueue','FaxQueue','SmsQueue','MailQueue','OpenchannelQueue','Trunk','voice:inbound','OpenchannelQueues','WhatsappQueue','getVoiceQueues','getChatQueues','getFaxQueues','getSmsQueues','getMailQueues','getOpenchannelQueues','getWhatsappQueues','all','voice','fax','sms','mail','openchannel','whatsapp','telephone:%s','trunk:%s','leave','removeChatInteractions','emit','user_has_chat_interactions:remove','removeMailInteractions','user_has_mail_interactions:remove','FaxInteractions','user_has_fax_interactions:remove','removeSmsInteractions','user_has_sms_interactions:remove','user_has_openchannel_interactions:remove','user_has_whatsapp_interactions:remove','catch','log','join','default','connection','address','request','remoteAddress','remotePort','connectedAt','SocketIO\x20','nsp','disconnect','DISCONNECTED','CONNECTED','lodash','util','bluebird','../mysqldb','./environment','name','User','role','agent','type','ivr','UserProfileSection','then','autoAssociation','VoiceQueues','ChatQueues','FaxQueues','SmsQueues','MailQueues','WhatsappQueues','findAll','Telephones','Trunks'];(function(_0x336135,_0x2eedd9){var _0x4cec3b=function(_0x2e714c){while(--_0x2e714c){_0x336135['push'](_0x336135['shift']());}};_0x4cec3b(++_0x2eedd9);}(_0xff6f,0x11e));var _0xfff6=function(_0x369020,_0x2688d2){_0x369020=_0x369020-0x0;var _0x4ef6b3=_0xff6f[_0x369020];return _0x4ef6b3;};'use strict';var _=require(_0xfff6('0x0'));var util=require(_0xfff6('0x1'));var BPromise=require(_0xfff6('0x2'));var db=require(_0xfff6('0x3'))['db'];var config=require(_0xfff6('0x4'));var queryQueues={'attributes':['id',_0xfff6('0x5')],'include':[{'as':'Agents','model':db[_0xfff6('0x6')],'attributes':['id',_0xfff6('0x5'),_0xfff6('0x7')],'raw':!![],'where':{'role':'agent'},'required':![]}]};var queryTelephones={'raw':!![],'attributes':['id',_0xfff6('0x5')],'where':{'role':'telephone'}};var queryTrunks={'raw':!![],'attributes':['id',_0xfff6('0x5')]};var queryAgents={'raw':!![],'attributes':['id',_0xfff6('0x5')],'where':{'role':_0xfff6('0x8')}};var queryCampaigns={'raw':!![],'attributes':['id',_0xfff6('0x5'),_0xfff6('0x9')],'where':{'type':_0xfff6('0xa')}};function getAssociatedResources(_0x783ba7,_0x28ec16,_0x2e3008){return db[_0xfff6('0xb')]['findOne']({'where':{'name':_0x783ba7,'userProfileId':_0x28ec16},'raw':!![]})[_0xfff6('0xc')](function(_0x365b4e){if(_0x365b4e){if(_0x365b4e[_0xfff6('0xd')]){switch(_0x783ba7){case _0xfff6('0xe'):case _0xfff6('0xf'):case _0xfff6('0x10'):case _0xfff6('0x11'):case _0xfff6('0x12'):case'OpenchannelQueues':case _0xfff6('0x13'):return db[_0x2e3008][_0xfff6('0x14')](queryQueues);case _0xfff6('0x15'):return db[_0x2e3008]['findAll'](queryTelephones);case _0xfff6('0x16'):return db[_0x2e3008]['findAll'](queryTrunks);case'IvrCampaigns':return db[_0x2e3008][_0xfff6('0x14')](queryCampaigns);}}else{return db[_0xfff6('0x17')][_0xfff6('0x14')]({'attributes':[_0xfff6('0x18')],'where':{'sectionId':_0x365b4e['id']},'raw':!![]})[_0xfff6('0xc')](function(_0x4640f7){if(_0x4640f7){var _0x21ee09={'where':{'id':_[_0xfff6('0x19')](_0x4640f7,_0xfff6('0x18'))},'raw':!![]};switch(_0x2e3008){case _0xfff6('0x6'):_0x21ee09[_0xfff6('0x1a')][_0xfff6('0x7')]=_0xfff6('0x1b');break;case _0xfff6('0x1c'):_0x21ee09['where'][_0xfff6('0x9')]='ivr';break;}return db[_0x2e3008]['findAll'](_0x21ee09);}else{return[];}});}}else{return[];}})[_0xfff6('0xc')](function(_0xb6dcf6){return _0xb6dcf6;});}function joinOrLeaveQueues(_0x1c18cc,_0x5d413d,_0x207638,_0x52c65f){_0x1c18cc[_0x5d413d](util[_0xfff6('0x1d')]('%s:queue:%s',_0x207638,_0x52c65f[_0xfff6('0x5')]));if(_0x52c65f[_0xfff6('0x1e')]){for(var _0x4e9bd4=0x0;_0x4e9bd4<_0x52c65f[_0xfff6('0x1e')][_0xfff6('0x1f')];_0x4e9bd4+=0x1){_0x1c18cc[_0x5d413d](util['format'](_0xfff6('0x20'),_0x52c65f[_0xfff6('0x1e')][_0x4e9bd4][_0xfff6('0x5')]));}}}function joinOrLeave(_0x1780fe,_0x208e25,_0x5e3cf1){var _0x59b8a5;if(_0x1780fe[_0xfff6('0x21')][_0xfff6('0x22')]['id']){db['User'][_0xfff6('0x23')]({'attributes':['id',_0xfff6('0x5'),_0xfff6('0x7'),_0xfff6('0x24')],'where':{'id':_0x1780fe[_0xfff6('0x21')][_0xfff6('0x22')]['id']},'include':[{'model':db[_0xfff6('0x25')],'as':_0xfff6('0x26'),'attributes':['id'],'raw':!![]},{'model':db[_0xfff6('0x27')],'as':_0xfff6('0x28'),'attributes':['id'],'raw':!![]},{'model':db['FaxInteraction'],'as':'FaxInteractions','attributes':['id'],'raw':!![]},{'model':db['SmsInteraction'],'as':_0xfff6('0x29'),'attributes':['id'],'raw':!![]},{'model':db['OpenchannelInteraction'],'as':_0xfff6('0x2a'),'attributes':['id'],'raw':!![]},{'model':db[_0xfff6('0x2b')],'as':_0xfff6('0x2c'),'attributes':['id'],'raw':!![]}]})[_0xfff6('0xc')](function(_0x4180b1){if(_0x4180b1){_0x59b8a5=_0x4180b1;_0x1780fe[_0x208e25](util['format'](_0xfff6('0x20'),_0x4180b1[_0xfff6('0x5')]));var _0xffd5bb=[];switch(_0x4180b1[_0xfff6('0x7')]){case _0xfff6('0x2d'):_0x1780fe[_0x208e25]('voice:inbound');_0x1780fe[_0x208e25](_0xfff6('0x2e'));if(queryQueues[_0xfff6('0x2f')](_0xfff6('0x30'))){delete queryQueues['include'];}_0xffd5bb[_0xfff6('0x31')](db[_0xfff6('0x32')]['findAll'](queryQueues));_0xffd5bb[_0xfff6('0x31')](db[_0xfff6('0x33')][_0xfff6('0x14')](queryQueues));_0xffd5bb[_0xfff6('0x31')](db[_0xfff6('0x34')][_0xfff6('0x14')](queryQueues));_0xffd5bb[_0xfff6('0x31')](db[_0xfff6('0x35')]['findAll'](queryQueues));_0xffd5bb[_0xfff6('0x31')](db[_0xfff6('0x36')][_0xfff6('0x14')](queryQueues));_0xffd5bb[_0xfff6('0x31')](db[_0xfff6('0x37')]['findAll'](queryQueues));_0xffd5bb[_0xfff6('0x31')](db['WhatsappQueue']['findAll'](queryQueues));_0xffd5bb[_0xfff6('0x31')](db[_0xfff6('0x6')][_0xfff6('0x14')](queryTelephones));_0xffd5bb[_0xfff6('0x31')](db[_0xfff6('0x38')]['findAll'](queryTrunks));_0xffd5bb['push'](db[_0xfff6('0x1c')][_0xfff6('0x14')](queryCampaigns));_0xffd5bb[_0xfff6('0x31')](db[_0xfff6('0x6')][_0xfff6('0x14')](queryAgents));break;case'user':_0x1780fe[_0x208e25](_0xfff6('0x39'));_0x1780fe[_0x208e25]('voice:outbound');_0xffd5bb[_0xfff6('0x31')](getAssociatedResources('VoiceQueues',_0x4180b1[_0xfff6('0x24')],_0xfff6('0x32')));_0xffd5bb['push'](getAssociatedResources(_0xfff6('0xf'),_0x4180b1['userProfileId'],_0xfff6('0x33')));_0xffd5bb['push'](getAssociatedResources(_0xfff6('0x10'),_0x4180b1['userProfileId'],'FaxQueue'));_0xffd5bb[_0xfff6('0x31')](getAssociatedResources(_0xfff6('0x11'),_0x4180b1[_0xfff6('0x24')],_0xfff6('0x35')));_0xffd5bb['push'](getAssociatedResources('MailQueues',_0x4180b1[_0xfff6('0x24')],_0xfff6('0x36')));_0xffd5bb[_0xfff6('0x31')](getAssociatedResources(_0xfff6('0x3a'),_0x4180b1['userProfileId'],_0xfff6('0x37')));_0xffd5bb[_0xfff6('0x31')](getAssociatedResources('WhatsappQueues',_0x4180b1[_0xfff6('0x24')],_0xfff6('0x3b')));_0xffd5bb[_0xfff6('0x31')](getAssociatedResources(_0xfff6('0x15'),_0x4180b1[_0xfff6('0x24')],'User'));_0xffd5bb[_0xfff6('0x31')](getAssociatedResources('Trunks',_0x4180b1['userProfileId'],_0xfff6('0x38')));_0xffd5bb['push'](getAssociatedResources('IvrCampaigns',_0x4180b1['userProfileId'],_0xfff6('0x1c')));_0xffd5bb[_0xfff6('0x31')](db[_0xfff6('0x6')][_0xfff6('0x14')](queryAgents));break;case'agent':_0x1780fe[_0x208e25](_0xfff6('0x39'));_0x1780fe[_0x208e25](_0xfff6('0x2e'));_0xffd5bb[_0xfff6('0x31')](_0x4180b1[_0xfff6('0x3c')]({'attributes':['id',_0xfff6('0x5')]}));_0xffd5bb['push'](_0x4180b1[_0xfff6('0x3d')]({'attributes':['id',_0xfff6('0x5')]}));_0xffd5bb[_0xfff6('0x31')](_0x4180b1[_0xfff6('0x3e')]({'attributes':['id',_0xfff6('0x5')]}));_0xffd5bb['push'](_0x4180b1[_0xfff6('0x3f')]({'attributes':['id',_0xfff6('0x5')]}));_0xffd5bb[_0xfff6('0x31')](_0x4180b1[_0xfff6('0x40')]({'attributes':['id',_0xfff6('0x5')]}));_0xffd5bb['push'](_0x4180b1[_0xfff6('0x41')]({'attributes':['id',_0xfff6('0x5')]}));_0xffd5bb[_0xfff6('0x31')](_0x4180b1[_0xfff6('0x42')]({'attributes':['id',_0xfff6('0x5')]}));break;}return BPromise[_0xfff6('0x43')](_0xffd5bb);}})[_0xfff6('0xc')](function(_0x575477){if(_0x575477&&_0x575477[_0xfff6('0x1f')]){for(var _0x55876d=0x0;_0x55876d<_0x575477['length'];_0x55876d+=0x1){for(var _0x265d35=0x0;_0x265d35<_0x575477[_0x55876d][_0xfff6('0x1f')];_0x265d35+=0x1){switch(_0x55876d){case 0x0:joinOrLeaveQueues(_0x1780fe,_0x208e25,_0xfff6('0x44'),_0x575477[_0x55876d][_0x265d35]);break;case 0x1:joinOrLeaveQueues(_0x1780fe,_0x208e25,'chat',_0x575477[_0x55876d][_0x265d35]);break;case 0x2:joinOrLeaveQueues(_0x1780fe,_0x208e25,_0xfff6('0x45'),_0x575477[_0x55876d][_0x265d35]);break;case 0x3:joinOrLeaveQueues(_0x1780fe,_0x208e25,_0xfff6('0x46'),_0x575477[_0x55876d][_0x265d35]);break;case 0x4:joinOrLeaveQueues(_0x1780fe,_0x208e25,_0xfff6('0x47'),_0x575477[_0x55876d][_0x265d35]);break;case 0x5:joinOrLeaveQueues(_0x1780fe,_0x208e25,_0xfff6('0x48'),_0x575477[_0x55876d][_0x265d35]);break;case 0x6:joinOrLeaveQueues(_0x1780fe,_0x208e25,_0xfff6('0x49'),_0x575477[_0x55876d][_0x265d35]);break;case 0x7:if(_0x59b8a5[_0xfff6('0x7')]!==_0xfff6('0x8'))_0x1780fe[_0x208e25](util[_0xfff6('0x1d')](_0xfff6('0x4a'),_0x575477[_0x55876d][_0x265d35][_0xfff6('0x5')]));break;case 0x8:if(_0x59b8a5[_0xfff6('0x7')]!=='agent')_0x1780fe[_0x208e25](util[_0xfff6('0x1d')](_0xfff6('0x4b'),_0x575477[_0x55876d][_0x265d35][_0xfff6('0x5')]));break;case 0x9:if(_0x59b8a5['role']!==_0xfff6('0x8'))_0x1780fe[_0x208e25](util[_0xfff6('0x1d')]('campaign:%s:%s',_0x575477[_0x55876d][_0x265d35][_0xfff6('0x9')],_0x575477[_0x55876d][_0x265d35][_0xfff6('0x5')]));break;case 0xa:_0x1780fe[_0x208e25](util[_0xfff6('0x1d')](_0xfff6('0x20'),_0x575477[_0x55876d][_0x265d35][_0xfff6('0x5')]));break;}}}}})[_0xfff6('0xc')](function(){if(_0x208e25===_0xfff6('0x4c')){var _0x2549f6=_[_0xfff6('0x19')](_0x59b8a5['ChatInteractions'],'id');return _0x59b8a5[_0xfff6('0x4d')](_0x2549f6)[_0xfff6('0xc')](function(){for(var _0x599b44=0x0;_0x599b44<_0x2549f6[_0xfff6('0x1f')];_0x599b44+=0x1){_0x5e3cf1[_0xfff6('0x4e')](_0xfff6('0x4f'),{'ChatInteractionId':Number(_0x2549f6[_0x599b44]),'UserId':Number(_0x59b8a5['id'])});}});}})[_0xfff6('0xc')](function(){if(_0x208e25===_0xfff6('0x4c')){var _0x527e45=_['map'](_0x59b8a5['MailInteractions'],'id');return _0x59b8a5[_0xfff6('0x50')](_0x527e45)[_0xfff6('0xc')](function(){for(var _0x34685c=0x0;_0x34685c<_0x527e45['length'];_0x34685c+=0x1){_0x5e3cf1['emit'](_0xfff6('0x51'),{'MailInteractionId':Number(_0x527e45[_0x34685c]),'UserId':Number(_0x59b8a5['id'])});}});}})[_0xfff6('0xc')](function(){if(_0x208e25===_0xfff6('0x4c')){var _0x4a4427=_[_0xfff6('0x19')](_0x59b8a5[_0xfff6('0x52')],'id');return _0x59b8a5['removeFaxInteractions'](_0x4a4427)[_0xfff6('0xc')](function(){for(var _0x107eda=0x0;_0x107eda<_0x4a4427[_0xfff6('0x1f')];_0x107eda+=0x1){_0x5e3cf1[_0xfff6('0x4e')](_0xfff6('0x53'),{'FaxInteractionId':Number(_0x4a4427[_0x107eda]),'UserId':Number(_0x59b8a5['id'])});}});}})['then'](function(){if(_0x208e25===_0xfff6('0x4c')){var _0x1a953=_[_0xfff6('0x19')](_0x59b8a5[_0xfff6('0x29')],'id');return _0x59b8a5[_0xfff6('0x54')](_0x1a953)['then'](function(){for(var _0x3a9568=0x0;_0x3a9568<_0x1a953[_0xfff6('0x1f')];_0x3a9568+=0x1){_0x5e3cf1[_0xfff6('0x4e')](_0xfff6('0x55'),{'SmsInteractionId':Number(_0x1a953[_0x3a9568]),'UserId':Number(_0x59b8a5['id'])});}});}})['then'](function(){if(_0x208e25===_0xfff6('0x4c')){var _0x30ae11=_[_0xfff6('0x19')](_0x59b8a5[_0xfff6('0x2a')],'id');return _0x59b8a5['removeOpenchannelInteractions'](_0x30ae11)[_0xfff6('0xc')](function(){for(var _0xa57aa9=0x0;_0xa57aa9<_0x30ae11['length'];_0xa57aa9+=0x1){_0x5e3cf1['emit'](_0xfff6('0x56'),{'OpenchannelInteractionId':Number(_0x30ae11[_0xa57aa9]),'UserId':Number(_0x59b8a5['id'])});}});}})[_0xfff6('0xc')](function(){if(_0x208e25===_0xfff6('0x4c')){var _0x1f2e79=_['map'](_0x59b8a5[_0xfff6('0x2c')],'id');return _0x59b8a5['removeWhatsappInteractions'](_0x1f2e79)['then'](function(){for(var _0x4ab650=0x0;_0x4ab650<_0x1f2e79['length'];_0x4ab650+=0x1){_0x5e3cf1[_0xfff6('0x4e')](_0xfff6('0x57'),{'WhatsappInteractionId':Number(_0x1f2e79[_0x4ab650]),'UserId':Number(_0x59b8a5['id'])});}});}})[_0xfff6('0x58')](function(_0x34e963){_0x1780fe[_0xfff6('0x59')](_0x34e963);});}}function onDisconnect(_0x5d9156,_0x5e2c6b){joinOrLeave(_0x5d9156,_0xfff6('0x4c'),_0x5e2c6b);}function onConnect(_0x4af038){joinOrLeave(_0x4af038,_0xfff6('0x5a'));}exports[_0xfff6('0x5b')]=function(_0x4d7bad){_0x4d7bad['on'](_0xfff6('0x5c'),function(_0xfb1386){_0xfb1386['setMaxListeners'](0x0);_0xfb1386[_0xfff6('0x5d')]=_0xfb1386[_0xfff6('0x5e')][_0xfff6('0x5c')][_0xfff6('0x5f')]+':'+_0xfb1386[_0xfff6('0x5e')][_0xfff6('0x5c')][_0xfff6('0x60')];_0xfb1386[_0xfff6('0x61')]=new Date();_0xfb1386['log']=function(_0x586f6c){console['log'](_0xfff6('0x62')+_0xfb1386[_0xfff6('0x63')][_0xfff6('0x5')]+'['+_0xfb1386[_0xfff6('0x5d')]+']',_0x586f6c);};_0xfb1386['on'](_0xfff6('0x64'),function(){onDisconnect(_0xfb1386,_0x4d7bad);_0xfb1386[_0xfff6('0x59')](_0xfff6('0x65'));});onConnect(_0xfb1386);_0xfb1386[_0xfff6('0x59')](_0xfff6('0x66'));});}; \ No newline at end of file diff --git a/server/config/triggers/index.js b/server/config/triggers/index.js index 1c4803b..607f32c 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 _0x1fd8=['contact','UserId','format','SIP/%s','name','agent','incomingmessage','outgoingmessage','motionChannel','opened','interface','AfterCreate','changed','closed','substatus','query','fullname','email','internal','hasOwnProperty','model','hook','callback','condition','util','../../mysqldb','jayson/promise','../logger','triggers','http','afterCreate','newinteraction','Chat','ChatInteraction','afterUpdate','closedinteraction','ChatMessage','newmessage','ChatOfflineMessage','Sms','SmsInteraction','WhatsappInteraction','Whatsapp','Fax','FaxInteraction','Mail','MailInteraction','MailMessage','Openchannel','OpenchannelInteraction','OpenchannelMessage','request','EventManager','then','info','error','code','Trigger,\x20%s','catch','get','channel','event','direction','resolve','ContactId','undefined','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','sequelize','Sequelize','QueryTypes','SELECT'];(function(_0x1db52e,_0x2c129e){var _0x765777=function(_0x740774){while(--_0x740774){_0x1db52e['push'](_0x1db52e['shift']());}};_0x765777(++_0x2c129e);}(_0x1fd8,0xa6));var _0x81fd=function(_0x14cc7f,_0x3c0732){_0x14cc7f=_0x14cc7f-0x0;var _0x3dd42f=_0x1fd8[_0x14cc7f];return _0x3dd42f;};'use strict';var util=require(_0x81fd('0x0'));var db=require(_0x81fd('0x1'))['db'];var jayson=require(_0x81fd('0x2'));var logger=require(_0x81fd('0x3'))(_0x81fd('0x4'));var client=jayson['client'][_0x81fd('0x5')]({'port':0x232a});var triggers=[{'channel':'Chat','model':'ChatInteraction','event':_0x81fd('0x6'),'condition':_0x81fd('0x7'),'callback':afterCreate},{'channel':_0x81fd('0x8'),'model':_0x81fd('0x9'),'event':_0x81fd('0xa'),'condition':_0x81fd('0xb'),'callback':afterUpdate},{'channel':_0x81fd('0x8'),'model':_0x81fd('0xc'),'event':_0x81fd('0x6'),'condition':_0x81fd('0xd'),'callback':afterCreateMessage},{'channel':'Chat','model':_0x81fd('0xe'),'event':'afterCreate','condition':_0x81fd('0xd'),'callback':afterCreateOfflineMessage},{'channel':_0x81fd('0xf'),'model':_0x81fd('0x10'),'event':_0x81fd('0x6'),'condition':_0x81fd('0x7'),'callback':afterCreate},{'channel':_0x81fd('0xf'),'model':'SmsInteraction','event':_0x81fd('0xa'),'condition':_0x81fd('0xb'),'callback':afterUpdate},{'channel':'Sms','model':'SmsMessage','event':'afterCreate','condition':'newmessage','callback':afterCreateMessage},{'channel':'Whatsapp','model':_0x81fd('0x11'),'event':'afterCreate','condition':_0x81fd('0x7'),'callback':afterCreate},{'channel':_0x81fd('0x12'),'model':_0x81fd('0x11'),'event':'afterUpdate','condition':_0x81fd('0xb'),'callback':afterUpdate},{'channel':_0x81fd('0x12'),'model':'WhatsappMessage','event':_0x81fd('0x6'),'condition':'newmessage','callback':afterCreateMessage},{'channel':_0x81fd('0x13'),'model':_0x81fd('0x14'),'event':_0x81fd('0x6'),'condition':_0x81fd('0x7'),'callback':afterCreate},{'channel':_0x81fd('0x13'),'model':_0x81fd('0x14'),'event':_0x81fd('0xa'),'condition':_0x81fd('0xb'),'callback':afterUpdate},{'channel':_0x81fd('0x13'),'model':'FaxMessage','event':_0x81fd('0x6'),'condition':'newmessage','callback':afterCreateMessage},{'channel':_0x81fd('0x15'),'model':_0x81fd('0x16'),'event':_0x81fd('0x6'),'condition':_0x81fd('0x7'),'callback':afterCreate},{'channel':_0x81fd('0x15'),'model':_0x81fd('0x16'),'event':_0x81fd('0xa'),'condition':_0x81fd('0xb'),'callback':afterUpdate},{'channel':'Mail','model':_0x81fd('0x17'),'event':'afterCreate','condition':_0x81fd('0xd'),'callback':afterCreateMessage},{'channel':_0x81fd('0x18'),'model':_0x81fd('0x19'),'event':_0x81fd('0x6'),'condition':_0x81fd('0x7'),'callback':afterCreate},{'channel':'Openchannel','model':'OpenchannelInteraction','event':'afterUpdate','condition':_0x81fd('0xb'),'callback':afterUpdate},{'channel':_0x81fd('0x18'),'model':_0x81fd('0x1a'),'event':_0x81fd('0x6'),'condition':_0x81fd('0xd'),'callback':afterCreateMessage}];function request(_0x44e869){return client[_0x81fd('0x1b')](_0x81fd('0x1c'),_0x44e869)[_0x81fd('0x1d')](function(_0x3a17e4){logger[_0x81fd('0x1e')]('Trigger,\x20%s','EventManager',_0x3a17e4);if(_0x3a17e4[_0x81fd('0x1f')]){if(_0x3a17e4[_0x81fd('0x1f')][_0x81fd('0x20')]===0x1f4){logger[_0x81fd('0x1f')](_0x81fd('0x21'),_0x81fd('0x1c'),_0x3a17e4[_0x81fd('0x1f')]);}}})[_0x81fd('0x22')](function(_0x2ad252){logger['error'](_0x81fd('0x21'),'EventManager',_0x2ad252);});}function afterCreateMessage(_0x5d170b){return function(_0x446917){_0x446917=_0x446917[_0x81fd('0x23')]({'plain':!![]});_0x446917[_0x81fd('0x24')]=_0x5d170b;_0x446917['motionChannel']=_0x5d170b;_0x446917[_0x81fd('0x25')]=_0x446917[_0x81fd('0x26')];Promise[_0x81fd('0x27')]()[_0x81fd('0x1d')](function(){if(typeof _0x446917[_0x81fd('0x28')]===_0x81fd('0x29'))return null;var _0x12a80c=_0x81fd('0x2a')+_0x446917[_0x81fd('0x28')];return db[_0x81fd('0x2b')]['query'](_0x12a80c,{'type':db[_0x81fd('0x2c')][_0x81fd('0x2d')][_0x81fd('0x2e')],'raw':!![]});})[_0x81fd('0x1d')](function(_0x569eb3){if(_0x569eb3){_0x446917[_0x81fd('0x2f')]=_0x569eb3[0x0];}if(typeof _0x446917['UserId']===_0x81fd('0x29'))return;return getAgent(_0x446917[_0x81fd('0x30')]);})[_0x81fd('0x1d')](function(_0x8c7d5b){if(_0x8c7d5b){_0x446917['interface']=util[_0x81fd('0x31')](_0x81fd('0x32'),_0x8c7d5b[_0x81fd('0x33')]);_0x446917[_0x81fd('0x34')]=_0x8c7d5b;_0x446917[_0x81fd('0x24')]=_0x5d170b;return request({'event':_0x81fd('0x35'),'message':_0x446917});}else{return request({'event':_0x81fd('0x36'),'message':_0x446917});}})[_0x81fd('0x22')](function(_0x1735e0){logger['error'](_0x81fd('0x21'),'AfterCreateMessage',_0x1735e0);});};}function afterCreateOfflineMessage(_0x1406e2){return function(_0x48ac6f){_0x48ac6f=_0x48ac6f[_0x81fd('0x23')]({'plain':!![]});_0x48ac6f['channel']=_0x1406e2;_0x48ac6f[_0x81fd('0x37')]=_0x1406e2;_0x48ac6f[_0x81fd('0x25')]='offlineMessage';return request({'event':_0x48ac6f['event'],'message':_0x48ac6f});};}function afterCreate(_0x11fe9e,_0x535ba2){return function(_0x344e51){_0x344e51=_0x344e51['get']({'plain':!![]});_0x344e51[_0x81fd('0x24')]=_0x11fe9e;_0x344e51['motionChannel']=_0x11fe9e;_0x344e51['event']=_0x81fd('0x38');Promise[_0x81fd('0x27')]()[_0x81fd('0x1d')](function(){var _0x46f968=_0x81fd('0x2a')+_0x344e51[_0x81fd('0x28')];return db[_0x81fd('0x2b')]['query'](_0x46f968,{'type':db[_0x81fd('0x2c')]['QueryTypes']['SELECT'],'raw':!![]});})[_0x81fd('0x1d')](function(_0x4d5855){if(_0x4d5855){_0x344e51[_0x81fd('0x2f')]=_0x4d5855[0x0];}if(typeof _0x344e51[_0x81fd('0x30')]===_0x81fd('0x29'))return;return getAgent(_0x344e51['UserId']);})['then'](function(_0x3b164b){if(_0x3b164b){_0x344e51[_0x81fd('0x39')]=util[_0x81fd('0x31')](_0x81fd('0x32'),_0x3b164b[_0x81fd('0x33')]);_0x344e51[_0x81fd('0x34')]=_0x3b164b;}return request({'event':_0x535ba2,'message':_0x344e51});})[_0x81fd('0x22')](function(_0x525439){logger[_0x81fd('0x1f')]('Trigger,\x20%s',_0x81fd('0x3a'),_0x525439);});};}function afterUpdate(_0x51330f){return function(_0x311695){var _0x1dc5d5=_0x311695[_0x81fd('0x3b')]('closed')&&_0x311695[_0x81fd('0x3c')];var _0x49316e=_0x311695[_0x81fd('0x3b')](_0x81fd('0x3d'));if(_0x1dc5d5||_0x49316e){var _0x1be584=_0x1dc5d5?_0x81fd('0xb'):_0x81fd('0x3d');var _0x7ae6ff=_0x311695['get']({'plain':!![]});_0x7ae6ff[_0x81fd('0x24')]=_0x51330f;_0x7ae6ff[_0x81fd('0x37')]=_0x51330f;_0x7ae6ff[_0x81fd('0x25')]=_0x1dc5d5?_0x81fd('0x3c'):_0x81fd('0x3d');var _0x2e0d9c=_0x81fd('0x2a')+_0x7ae6ff[_0x81fd('0x28')];return db[_0x81fd('0x2b')][_0x81fd('0x3e')](_0x2e0d9c,{'type':db[_0x81fd('0x2c')][_0x81fd('0x2d')][_0x81fd('0x2e')],'raw':!![]})[_0x81fd('0x1d')](function(_0x3ad0d4){if(_0x3ad0d4){_0x7ae6ff[_0x81fd('0x2f')]=_0x3ad0d4[0x0];}if(typeof _0x7ae6ff[_0x81fd('0x30')]===_0x81fd('0x29'))return;return getAgent(_0x7ae6ff['UserId']);})[_0x81fd('0x1d')](function(_0x5e489d){if(_0x5e489d){_0x7ae6ff['interface']=util['format'](_0x81fd('0x32'),_0x5e489d[_0x81fd('0x33')]);_0x7ae6ff['agent']=_0x5e489d;}return request({'event':_0x1be584,'message':_0x7ae6ff});})[_0x81fd('0x22')](function(_0x48ad7a){logger[_0x81fd('0x1f')](_0x81fd('0x21'),'AfterUpdate',_0x48ad7a);});}};}function getAgent(_0x5eebee){return db['User']['find']({'where':{'id':_0x5eebee},'attributes':['id',_0x81fd('0x33'),_0x81fd('0x3f'),_0x81fd('0x40'),_0x81fd('0x41')],'raw':!![]})[_0x81fd('0x1d')](function(_0x4b1839){return _0x4b1839;});}exports['default']=function(){for(var _0x188a88=0x0;_0x188a88=_0x5d255b[_0x9429('0x12')]){throw Error('Maximum\x20login\x20has\x20been\x20reached');}_0x3add09(_0xb245f1);})['catch'](function(_0x203009){_0x210326(_0x203009);});});}; \ No newline at end of file +var _0xa800=['whatsapp','openchannel','isValidChannel','toLowerCase','includes','clearBlockUser','isUndefined','blockedAt','updateAttributes','role','agent','User','count','agents','Maximum\x20login\x20has\x20been\x20reached','catch','lodash','bluebird','../mysqldb','mail','chat','fax','sms'];(function(_0x1347f8,_0x233feb){var _0x218368=function(_0x3f4ca3){while(--_0x3f4ca3){_0x1347f8['push'](_0x1347f8['shift']());}};_0x218368(++_0x233feb);}(_0xa800,0x169));var _0x0a80=function(_0x1cd23d,_0xec4ea5){_0x1cd23d=_0x1cd23d-0x0;var _0x5e8ad5=_0xa800[_0x1cd23d];return _0x5e8ad5;};'use strict';var _=require(_0x0a80('0x0'));var BPromise=require(_0x0a80('0x1'));var db=require(_0x0a80('0x2'))['db'];var util=require('./license/util');var channels=['voice',_0x0a80('0x3'),_0x0a80('0x4'),_0x0a80('0x5'),_0x0a80('0x6'),_0x0a80('0x7'),_0x0a80('0x8')];exports['getChannels']=function(){return channels;};exports[_0x0a80('0x9')]=function(_0x125196){_0x125196=_0x125196[_0x0a80('0xa')]();return _[_0x0a80('0xb')](channels,_0x125196);};exports[_0x0a80('0xc')]=function(_0x1077c1,_0x775637,_0x4afab9,_0x4efb82){var _0xd7183b={'loginAttempts':_0x775637,'blocked':_0x4afab9};if(!_[_0x0a80('0xd')](_0x4efb82)){_0xd7183b[_0x0a80('0xe')]=_0x4efb82;}return _0x1077c1[_0x0a80('0xf')](_0xd7183b);};exports['getLicense']=function(_0x2ce20e){return new BPromise(function(_0x34e8d3,_0x577bcc){var _0x4055e1=0x0;if(_0x2ce20e[_0x0a80('0x10')]!==_0x0a80('0x11')){_0x34e8d3(_0x2ce20e);}db[_0x0a80('0x12')][_0x0a80('0x13')]({'where':{'role':_0x0a80('0x11'),'online':!![],'id':{'$ne':_0x2ce20e['id']}}})['then'](function(_0x26c4a5){_0x4055e1=_0x26c4a5;return util['getLicense']();})['then'](function(_0x5a9583){if(_0x5a9583&&_0x5a9583['agents']&&_0x4055e1>=_0x5a9583[_0x0a80('0x14')]){throw Error(_0x0a80('0x15'));}_0x34e8d3(_0x2ce20e);})[_0x0a80('0x16')](function(_0x42bfd9){_0x577bcc(_0x42bfd9);});});}; \ No newline at end of file diff --git a/server/errors/api.js b/server/errors/api.js index f5c529b..f8a3f1a 100644 --- a/server/errors/api.js +++ b/server/errors/api.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xe14b=['Out\x20Of\x20Interval','Forbidden','error','stack','statusMessage','status','send','util','../config/logger','message','name','Bad\x20Request','inherits','Not\x20Found'];(function(_0x1804af,_0x85df23){var _0x44b773=function(_0x35e1eb){while(--_0x35e1eb){_0x1804af['push'](_0x1804af['shift']());}};_0x44b773(++_0x85df23);}(_0xe14b,0x93));var _0xbe14=function(_0x4c170c,_0x3118ff){_0x4c170c=_0x4c170c-0x0;var _0xff48d1=_0xe14b[_0x4c170c];return _0xff48d1;};'use strict';var util=require(_0xbe14('0x0'));var logger=require(_0xbe14('0x1'))('api');var APIError=function(_0x5cc4d8,_0x11c3a0){this[_0xbe14('0x2')]=_0x5cc4d8||'Internal\x20Server\x20Error';this[_0xbe14('0x3')]=_0x11c3a0||'Error';util['inherits'](APIError,Error);};var APIBadRequestError=function(_0x1833e3){this[_0xbe14('0x2')]=_0x1833e3||_0xbe14('0x4');this[_0xbe14('0x3')]=_0xbe14('0x4');util[_0xbe14('0x5')](APIBadRequestError,APIError);};var APINotFoundError=function(_0x196fca){this['message']=_0x196fca||'Entity\x20not\x20found';this['name']=_0xbe14('0x6');util[_0xbe14('0x5')](APINotFoundError,APIError);};var APIOutOfIntervalError=function(_0xd68cd7){this[_0xbe14('0x2')]=_0xd68cd7||'Message\x20sent\x20outside\x20a\x20valid\x20interval';this['name']=_0xbe14('0x7');util[_0xbe14('0x5')](APIOutOfIntervalError,APIError);};function getStatusCode(_0x4935cc){switch(_0x4935cc){case _0xbe14('0x4'):return 0x190;case _0xbe14('0x8'),_0xbe14('0x7'):return 0x193;case _0xbe14('0x6'):return 0x194;default:return 0x1f4;}}function getCustomStatusMessage(_0x27792f){if(_0x27792f===_0xbe14('0x7'))return _0x27792f;return null;}function handleError(_0x23a730){return function(_0x2850cb){logger[_0xbe14('0x9')](_0x2850cb[_0xbe14('0xa')]);var _0x1e4826=getStatusCode(_0x2850cb[_0xbe14('0x3')]);var _0x813399=getCustomStatusMessage(_0x2850cb['name']);if(_0x2850cb['name'])delete _0x2850cb[_0xbe14('0x3')];if(_0x813399)_0x23a730[_0xbe14('0xb')]=_0x813399;return _0x23a730[_0xbe14('0xc')](_0x1e4826)[_0xbe14('0xd')](_0x2850cb);};}module['exports']={'APIError':APIError,'APIBadRequestError':APIBadRequestError,'APIOutOfIntervalError':APIOutOfIntervalError,'APINotFoundError':APINotFoundError,'handleError':handleError}; \ No newline at end of file +var _0xc4aa=['stack','statusMessage','status','exports','util','../config/logger','api','message','inherits','Bad\x20Request','name','Not\x20Found','Message\x20sent\x20outside\x20a\x20valid\x20interval','Out\x20Of\x20Interval','error'];(function(_0x38860b,_0xa7f96d){var _0x410e94=function(_0x46d739){while(--_0x46d739){_0x38860b['push'](_0x38860b['shift']());}};_0x410e94(++_0xa7f96d);}(_0xc4aa,0x1b7));var _0xac4a=function(_0x17b6e3,_0x4522ed){_0x17b6e3=_0x17b6e3-0x0;var _0x3906f3=_0xc4aa[_0x17b6e3];return _0x3906f3;};'use strict';var util=require(_0xac4a('0x0'));var logger=require(_0xac4a('0x1'))(_0xac4a('0x2'));var APIError=function(_0x351dd5,_0x275161){this[_0xac4a('0x3')]=_0x351dd5||'Internal\x20Server\x20Error';this['name']=_0x275161||'Error';util[_0xac4a('0x4')](APIError,Error);};var APIBadRequestError=function(_0x15b967){this[_0xac4a('0x3')]=_0x15b967||_0xac4a('0x5');this[_0xac4a('0x6')]=_0xac4a('0x5');util[_0xac4a('0x4')](APIBadRequestError,APIError);};var APINotFoundError=function(_0x10525b){this['message']=_0x10525b||'Entity\x20not\x20found';this[_0xac4a('0x6')]=_0xac4a('0x7');util[_0xac4a('0x4')](APINotFoundError,APIError);};var APIOutOfIntervalError=function(_0x4f4146){this[_0xac4a('0x3')]=_0x4f4146||_0xac4a('0x8');this[_0xac4a('0x6')]='Out\x20Of\x20Interval';util[_0xac4a('0x4')](APIOutOfIntervalError,APIError);};function getStatusCode(_0x488e3c){switch(_0x488e3c){case _0xac4a('0x5'):return 0x190;case'Forbidden',_0xac4a('0x9'):return 0x193;case _0xac4a('0x7'):return 0x194;default:return 0x1f4;}}function getCustomStatusMessage(_0x24291d){if(_0x24291d==='Out\x20Of\x20Interval')return _0x24291d;return null;}function handleError(_0x21a79){return function(_0x68424a){logger[_0xac4a('0xa')](_0x68424a[_0xac4a('0xb')]);var _0x1b4313=getStatusCode(_0x68424a[_0xac4a('0x6')]);var _0x34bc01=getCustomStatusMessage(_0x68424a[_0xac4a('0x6')]);if(_0x68424a[_0xac4a('0x6')])delete _0x68424a[_0xac4a('0x6')];if(_0x34bc01)_0x21a79[_0xac4a('0xc')]=_0x34bc01;return _0x21a79[_0xac4a('0xd')](_0x1b4313)['send'](_0x68424a);};}module[_0xac4a('0xe')]={'APIError':APIError,'APIBadRequestError':APIBadRequestError,'APIOutOfIntervalError':APIOutOfIntervalError,'APINotFoundError':APINotFoundError,'handleError':handleError}; \ No newline at end of file diff --git a/server/errors/index.js b/server/errors/index.js index 26c92f7..1ea42fa 100644 --- a/server/errors/index.js +++ b/server/errors/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x5f6a=['status','render','json','send','exports','404'];(function(_0x2555d0,_0x4150a6){var _0x3bb486=function(_0x1eb89f){while(--_0x1eb89f){_0x2555d0['push'](_0x2555d0['shift']());}};_0x3bb486(++_0x4150a6);}(_0x5f6a,0xc4));var _0xa5f6=function(_0x394b32,_0x41a63c){_0x394b32=_0x394b32-0x0;var _0x2d00a4=_0x5f6a[_0x394b32];return _0x2d00a4;};'use strict';module[_0xa5f6('0x0')][0x194]=function pageNotFound(_0x5cc494,_0x59c041){var _0x3ba94f=_0xa5f6('0x1');var _0x2e23f3=0x194;var _0x1ec17a={'status':_0x2e23f3};_0x59c041['status'](_0x1ec17a[_0xa5f6('0x2')]);_0x59c041[_0xa5f6('0x3')](_0x3ba94f,{},function(_0x199819,_0xde771e){if(_0x199819){return _0x59c041[_0xa5f6('0x2')](_0x1ec17a[_0xa5f6('0x2')])[_0xa5f6('0x4')](_0x1ec17a);}_0x59c041[_0xa5f6('0x5')](_0xde771e);});}; \ No newline at end of file +var _0xc2af=['404','status','render','send','exports'];(function(_0x20c809,_0x26b566){var _0x1064a1=function(_0x39c6db){while(--_0x39c6db){_0x20c809['push'](_0x20c809['shift']());}};_0x1064a1(++_0x26b566);}(_0xc2af,0x1bc));var _0xfc2a=function(_0x11f238,_0x115ac0){_0x11f238=_0x11f238-0x0;var _0x39dc86=_0xc2af[_0x11f238];return _0x39dc86;};'use strict';module[_0xfc2a('0x0')][0x194]=function pageNotFound(_0x53cb69,_0x309c78){var _0x58844b=_0xfc2a('0x1');var _0x2de393=0x194;var _0x35380d={'status':_0x2de393};_0x309c78[_0xfc2a('0x2')](_0x35380d[_0xfc2a('0x2')]);_0x309c78[_0xfc2a('0x3')](_0x58844b,{},function(_0x249039,_0x2d6c24){if(_0x249039){return _0x309c78['status'](_0x35380d[_0xfc2a('0x2')])['json'](_0x35380d);}_0x309c78[_0xfc2a('0x4')](_0x2d6c24);});}; \ No newline at end of file diff --git a/server/mysqldb/index.js b/server/mysqldb/index.js index 2dc7bad..ebe3e97 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(_0x18b344,_0x271f68){var _0x5ef6bb=function(_0x3345b3){while(--_0x3345b3){_0x18b344['push'](_0x18b344['shift']());}};_0x5ef6bb(++_0x271f68);}(_0xa9e0,0x123));var _0x0a9e=function(_0x521929,_0x479be5){_0x521929=_0x521929-0x0;var _0x632436=_0xa9e0[_0x521929];return _0x632436;};'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(_0x10c51f,_0x11270f){var _0x56a0cd=function(_0x563ac6){while(--_0x563ac6){_0x10c51f['push'](_0x10c51f['shift']());}};_0x56a0cd(++_0x11270f);}(_0xa9e0,0x123));var _0x0a9e=function(_0x2cfb58,_0x3d9412){_0x2cfb58=_0x2cfb58-0x0;var _0xd99951=_0xa9e0[_0x2cfb58];return _0xd99951;};'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 3ca7cca..abf7855 100644 --- a/server/routes.js +++ b/server/routes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xad8a=['./api/automation','/api/canned_answers','./api/cannedAnswer','./api/condition','./api/interval','/api/pauses','./api/pause','/api/cdr','./api/cdr','/api/voiceQueuesLog','./api/voiceQueuesLog','/api/schedules','./api/schedule','/api/sounds','./api/sound','/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/integrations/reports','./api/integrationReport','/api/analytics/custom_reports','./api/analyticCustomReport','/api/analytics/default_reports','./api/analyticDefaultReport','./api/analyticExtractedReport','/api/analytics/metrics','./api/analyticMetric','/api/analytics/field_reports','/api/analytics/tree_reports','/api/integrations/salesforce/accounts','./api/intSalesforceAccount','/api/integrations/salesforce/configurations','./api/intSalesforceConfiguration','./api/intSalesforceField','/api/integrations/sugarcrm/accounts','./api/intSugarcrmAccount','/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/integrations/zoho/configurations','/api/integrations/zoho/fields','/api/integrations/zendesk/accounts','./api/intZendeskAccount','/api/integrations/zendesk/configurations','./api/intZendeskConfiguration','/api/integrations/zendesk/fields','./api/intZendeskField','/api/integrations/freshdesk/accounts','./api/intFreshdeskAccount','/api/integrations/freshdesk/configurations','./api/intFreshdeskConfiguration','./api/intFreshdeskField','/api/integrations/vtiger/accounts','/api/integrations/vtiger/configurations','./api/intVtigerConfiguration','/api/integrations/vtiger/fields','/api/integrations/servicenow/accounts','./api/intServicenowAccount','/api/integrations/servicenow/configurations','/api/integrations/servicenow/fields','./api/intServicenowField','/api/integrations/dynamics365/accounts','./api/intDynamics365Account','./api/intDynamics365Configuration','/api/integrations/dynamics365/fields','./api/intDynamics365Field','/api/integrations/freshsales/configurations','./api/intFreshsalesConfiguration','/api/integrations/freshsales/fields','./api/intFreshsalesField','/api/networks','./api/network','/api/chat/reports/queue','./api/chatQueueReport','./api/chatInternalMessage','/api/jscripty/answers/reports','./api/jscriptyAnswerReport','/api/jscripty/questions/reports','./api/jscriptyQuestionReport','/api/jscripty/sessions/reports','/api/sms/reports/queue','./api/smsQueueReport','./api/squareReport','/api/square/details/reports','./api/squareReportDetail','/api/jscripty/projects','./api/jscriptyProject','/api/settings','./api/setting','/api/square/odbc','./api/squareOdbc','./api/squareProject','/api/square/recordings','./api/squareMessage','/api/teams','./api/team','/api/license','./api/license','/api/campaigns','./api/campaign','/api/migrations','./api/migration','/api/attachments','./api/attachment','./api/plugin','./api/mailTransferReport','./api/faxTransferReport','/api/openchannel/reports/transfer','./api/openchannelTransferReport','/api/sms/reports/transfer','./api/smsTransferReport','/api/cm/lists','./api/cmList','/api/voice/prefixes','./api/voicePrefix','/api/userProfiles','./api/userProfile','./api/userProfileSection','./api/userProfileResource','/api/userNotifications','./api/whatsappAccount','./api/whatsappApplication','/api/whatsapp/interactions','/api/whatsapp/messages','./api/whatsappMessage','./api/whatsappQueueReport','/api/whatsapp/reports/transfer','./api/whatsappTransferReport','/api/whatsapp/queues','./api/whatsappQueue','/api/cloudProviders','/api/realtime','./api/realtime','/api/user-settings','./api/user-setting','/api/auth/local','./api/authLocal','/api/auth/google','/api/auth/activedirectory','./api/authActiveDirectory','/api/jira','./api/jira','/api/rpc','./api/rpc','./api/version','/api/system','/api/pm2','/api/webbar','./api/webbar','/apidoc','static','join','root','/demo','/snippet','snippet','/server/files/plugins','route','/:url(api|auth|components|app|bower_components|assets)/*','get','resolve','appPath','/index.html','path','express','./errors','./config/environment','./utils/client-side-logger','./api/client-side-logs','default','use','/api/users','./api/user','/api/voice/chanspy','./api/voiceChanSpy','/api/voice/contexts','./api/voiceContext','/api/voice/mohs','./api/voiceMusicOnHold','/api/voice/queues','./api/voiceQueue','/api/voice/recordings','./api/voiceRecording','/api/screen/recordings','./api/screenRecording','/api/voice/mails','./api/voiceMail','/api/voice/mails/messages','./api/voiceMailMessage','/api/voice/calls/reports','./api/voiceCallReport','/api/voice/dials/reports','/api/voice/agents/reports','/api/voice/queues/reports','./api/voiceQueueReport','/api/members/reports','./api/memberReport','/api/trunks','./api/trunk','/api/voice/transfers/reports','/api/mail/out_servers','./api/mailServerOut','./api/mailAccount','./api/mailQueue','/api/mail/substatuses','/api/mail/interactions','./api/mailInteraction','/api/mail/messages','./api/mailMessage','/api/mail/applications','./api/mailApplication','/api/mail/reports/queue','./api/mailQueueReport','/api/dashboards','./api/dashboard','./api/dashboardItem','/api/fax/accounts','/api/fax/applications','./api/faxApplication','/api/fax/interactions','/api/fax/messages','./api/faxMessage','/api/fax/queues','/api/fax/reports/queue','./api/faxQueueReport','./api/smsAccount','/api/sms/applications','./api/smsApplication','./api/smsInteraction','/api/sms/queues','./api/smsQueue','./api/openchannelAccount','/api/openchannel/interactions','/api/openchannel/queues','/api/chat/websites','./api/chatWebsite','./api/openchannelQueueReport','/api/chat/applications','./api/chatApplication','/api/chat/interactions','/api/chat/messages','./api/chatMessage','/api/chat/offline_messages','./api/chatOfflineMessage','/api/chat/queues','./api/chatQueue','/api/chat/groups','/api/chat/proactive_actions','./api/chatProactiveAction','/api/cm/companies','./api/cmCompany','/api/cm/contacts','./api/cmContact','/api/cm/hopper','./api/cmHopperBlack','/api/cm/hopper_final','/api/cm/hopper_history','/api/cm/custom_fields','./api/cmCustomField','/api/actions','./api/action','/api/automations'];(function(_0x405aeb,_0x5ee732){var _0x50e76a=function(_0x2cded1){while(--_0x2cded1){_0x405aeb['push'](_0x405aeb['shift']());}};_0x50e76a(++_0x5ee732);}(_0xad8a,0xb0));var _0xaad8=function(_0x23d33f,_0x3f6afd){_0x23d33f=_0x23d33f-0x0;var _0x55c2aa=_0xad8a[_0x23d33f];return _0x55c2aa;};'use strict';var path=require(_0xaad8('0x0'));var express=require(_0xaad8('0x1'));var errors=require(_0xaad8('0x2'));var config=require(_0xaad8('0x3'));var setupLoggers=require(_0xaad8('0x4'))['setupLoggers'];var clientSideLogs=require(_0xaad8('0x5'));exports[_0xaad8('0x6')]=function(_0x398fde){return setupLoggers(_0x398fde)['then'](function(){_0x398fde[_0xaad8('0x7')](_0xaad8('0x8'),require(_0xaad8('0x9')));_0x398fde[_0xaad8('0x7')](_0xaad8('0xa'),require(_0xaad8('0xb')));_0x398fde[_0xaad8('0x7')](_0xaad8('0xc'),require(_0xaad8('0xd')));_0x398fde[_0xaad8('0x7')]('/api/voice/extensions',require('./api/voiceExtension'));_0x398fde[_0xaad8('0x7')](_0xaad8('0xe'),require(_0xaad8('0xf')));_0x398fde[_0xaad8('0x7')](_0xaad8('0x10'),require(_0xaad8('0x11')));_0x398fde[_0xaad8('0x7')](_0xaad8('0x12'),require(_0xaad8('0x13')));_0x398fde['use'](_0xaad8('0x14'),require(_0xaad8('0x15')));_0x398fde[_0xaad8('0x7')](_0xaad8('0x16'),require(_0xaad8('0x17')));_0x398fde[_0xaad8('0x7')](_0xaad8('0x18'),require(_0xaad8('0x19')));_0x398fde[_0xaad8('0x7')](_0xaad8('0x1a'),require(_0xaad8('0x1b')));_0x398fde[_0xaad8('0x7')](_0xaad8('0x1c'),require('./api/voiceDialReport'));_0x398fde[_0xaad8('0x7')](_0xaad8('0x1d'),require('./api/voiceAgentReport'));_0x398fde[_0xaad8('0x7')](_0xaad8('0x1e'),require(_0xaad8('0x1f')));_0x398fde[_0xaad8('0x7')](_0xaad8('0x20'),require(_0xaad8('0x21')));_0x398fde['use'](_0xaad8('0x22'),require(_0xaad8('0x23')));_0x398fde['use'](_0xaad8('0x24'),require('./api/voiceTransferReport'));_0x398fde[_0xaad8('0x7')](_0xaad8('0x25'),require(_0xaad8('0x26')));_0x398fde[_0xaad8('0x7')]('/api/mail/accounts',require(_0xaad8('0x27')));_0x398fde[_0xaad8('0x7')]('/api/mail/queues',require(_0xaad8('0x28')));_0x398fde[_0xaad8('0x7')](_0xaad8('0x29'),require('./api/mailSubstatus'));_0x398fde['use'](_0xaad8('0x2a'),require(_0xaad8('0x2b')));_0x398fde[_0xaad8('0x7')](_0xaad8('0x2c'),require(_0xaad8('0x2d')));_0x398fde[_0xaad8('0x7')](_0xaad8('0x2e'),require(_0xaad8('0x2f')));_0x398fde[_0xaad8('0x7')](_0xaad8('0x30'),require(_0xaad8('0x31')));_0x398fde[_0xaad8('0x7')](_0xaad8('0x32'),require(_0xaad8('0x33')));_0x398fde[_0xaad8('0x7')]('/api/dashboards/items',require(_0xaad8('0x34')));_0x398fde[_0xaad8('0x7')](_0xaad8('0x35'),require('./api/faxAccount'));_0x398fde[_0xaad8('0x7')](_0xaad8('0x36'),require(_0xaad8('0x37')));_0x398fde[_0xaad8('0x7')](_0xaad8('0x38'),require('./api/faxInteraction'));_0x398fde[_0xaad8('0x7')](_0xaad8('0x39'),require(_0xaad8('0x3a')));_0x398fde[_0xaad8('0x7')](_0xaad8('0x3b'),require('./api/faxQueue'));_0x398fde[_0xaad8('0x7')](_0xaad8('0x3c'),require(_0xaad8('0x3d')));_0x398fde[_0xaad8('0x7')]('/api/sms/accounts',require(_0xaad8('0x3e')));_0x398fde[_0xaad8('0x7')](_0xaad8('0x3f'),require(_0xaad8('0x40')));_0x398fde[_0xaad8('0x7')]('/api/sms/interactions',require(_0xaad8('0x41')));_0x398fde[_0xaad8('0x7')]('/api/sms/messages',require('./api/smsMessage'));_0x398fde[_0xaad8('0x7')](_0xaad8('0x42'),require(_0xaad8('0x43')));_0x398fde[_0xaad8('0x7')]('/api/openchannel/accounts',require(_0xaad8('0x44')));_0x398fde[_0xaad8('0x7')]('/api/openchannel/applications',require('./api/openchannelApplication'));_0x398fde[_0xaad8('0x7')](_0xaad8('0x45'),require('./api/openchannelInteraction'));_0x398fde[_0xaad8('0x7')]('/api/openchannel/messages',require('./api/openchannelMessage'));_0x398fde[_0xaad8('0x7')](_0xaad8('0x46'),require('./api/openchannelQueue'));_0x398fde[_0xaad8('0x7')](_0xaad8('0x47'),require(_0xaad8('0x48')));_0x398fde[_0xaad8('0x7')]('/api/openchannel/reports/queue',require(_0xaad8('0x49')));_0x398fde[_0xaad8('0x7')](_0xaad8('0x4a'),require(_0xaad8('0x4b')));_0x398fde[_0xaad8('0x7')](_0xaad8('0x4c'),require('./api/chatInteraction'));_0x398fde[_0xaad8('0x7')](_0xaad8('0x4d'),require(_0xaad8('0x4e')));_0x398fde['use'](_0xaad8('0x4f'),require(_0xaad8('0x50')));_0x398fde[_0xaad8('0x7')](_0xaad8('0x51'),require(_0xaad8('0x52')));_0x398fde[_0xaad8('0x7')](_0xaad8('0x53'),require('./api/chatGroup'));_0x398fde[_0xaad8('0x7')](_0xaad8('0x54'),require(_0xaad8('0x55')));_0x398fde[_0xaad8('0x7')](_0xaad8('0x56'),require(_0xaad8('0x57')));_0x398fde['use'](_0xaad8('0x58'),require(_0xaad8('0x59')));_0x398fde[_0xaad8('0x7')](_0xaad8('0x5a'),require('./api/cmHopper'));_0x398fde['use']('/api/cm/hopper_black',require(_0xaad8('0x5b')));_0x398fde[_0xaad8('0x7')](_0xaad8('0x5c'),require('./api/cmHopperFinal'));_0x398fde[_0xaad8('0x7')](_0xaad8('0x5d'),require('./api/cmHopperHistory'));_0x398fde[_0xaad8('0x7')](_0xaad8('0x5e'),require(_0xaad8('0x5f')));_0x398fde[_0xaad8('0x7')](_0xaad8('0x60'),require(_0xaad8('0x61')));_0x398fde[_0xaad8('0x7')](_0xaad8('0x62'),require(_0xaad8('0x63')));_0x398fde[_0xaad8('0x7')](_0xaad8('0x64'),require(_0xaad8('0x65')));_0x398fde['use']('/api/dispositions',require('./api/disposition'));_0x398fde[_0xaad8('0x7')]('/api/conditions',require(_0xaad8('0x66')));_0x398fde['use']('/api/intervals',require(_0xaad8('0x67')));_0x398fde['use'](_0xaad8('0x68'),require(_0xaad8('0x69')));_0x398fde[_0xaad8('0x7')](_0xaad8('0x6a'),require(_0xaad8('0x6b')));_0x398fde[_0xaad8('0x7')](_0xaad8('0x6c'),require(_0xaad8('0x6d')));_0x398fde[_0xaad8('0x7')](_0xaad8('0x6e'),require(_0xaad8('0x6f')));_0x398fde[_0xaad8('0x7')](_0xaad8('0x70'),require(_0xaad8('0x71')));_0x398fde[_0xaad8('0x7')]('/api/tags',require('./api/tag'));_0x398fde[_0xaad8('0x7')](_0xaad8('0x72'),require(_0xaad8('0x73')));_0x398fde['use']('/api/cm_contact_has_items',require(_0xaad8('0x74')));_0x398fde['use'](_0xaad8('0x75'),require(_0xaad8('0x76')));_0x398fde[_0xaad8('0x7')](_0xaad8('0x77'),require(_0xaad8('0x78')));_0x398fde[_0xaad8('0x7')](_0xaad8('0x79'),require(_0xaad8('0x7a')));_0x398fde[_0xaad8('0x7')]('/api/variables',require(_0xaad8('0x7b')));_0x398fde[_0xaad8('0x7')]('/api/integrations',require(_0xaad8('0x7c')));_0x398fde['use'](_0xaad8('0x7d'),require(_0xaad8('0x7e')));_0x398fde[_0xaad8('0x7')](_0xaad8('0x7f'),require(_0xaad8('0x80')));_0x398fde[_0xaad8('0x7')](_0xaad8('0x81'),require(_0xaad8('0x82')));_0x398fde[_0xaad8('0x7')]('/api/analytics/extracted_reports',require(_0xaad8('0x83')));_0x398fde[_0xaad8('0x7')](_0xaad8('0x84'),require(_0xaad8('0x85')));_0x398fde[_0xaad8('0x7')](_0xaad8('0x86'),require('./api/analyticFieldReport'));_0x398fde[_0xaad8('0x7')](_0xaad8('0x87'),require('./api/analyticTreeReport'));_0x398fde['use'](_0xaad8('0x88'),require(_0xaad8('0x89')));_0x398fde[_0xaad8('0x7')](_0xaad8('0x8a'),require(_0xaad8('0x8b')));_0x398fde[_0xaad8('0x7')]('/api/integrations/salesforce/fields',require(_0xaad8('0x8c')));_0x398fde[_0xaad8('0x7')](_0xaad8('0x8d'),require(_0xaad8('0x8e')));_0x398fde[_0xaad8('0x7')]('/api/integrations/sugarcrm/configurations',require('./api/intSugarcrmConfiguration'));_0x398fde[_0xaad8('0x7')](_0xaad8('0x8f'),require(_0xaad8('0x90')));_0x398fde['use'](_0xaad8('0x91'),require(_0xaad8('0x92')));_0x398fde[_0xaad8('0x7')]('/api/integrations/desk/configurations',require(_0xaad8('0x93')));_0x398fde['use'](_0xaad8('0x94'),require(_0xaad8('0x95')));_0x398fde[_0xaad8('0x7')](_0xaad8('0x96'),require('./api/intZohoAccount'));_0x398fde[_0xaad8('0x7')](_0xaad8('0x97'),require('./api/intZohoConfiguration'));_0x398fde['use'](_0xaad8('0x98'),require('./api/intZohoField'));_0x398fde[_0xaad8('0x7')](_0xaad8('0x99'),require(_0xaad8('0x9a')));_0x398fde[_0xaad8('0x7')](_0xaad8('0x9b'),require(_0xaad8('0x9c')));_0x398fde[_0xaad8('0x7')](_0xaad8('0x9d'),require(_0xaad8('0x9e')));_0x398fde['use'](_0xaad8('0x9f'),require(_0xaad8('0xa0')));_0x398fde[_0xaad8('0x7')](_0xaad8('0xa1'),require(_0xaad8('0xa2')));_0x398fde[_0xaad8('0x7')]('/api/integrations/freshdesk/fields',require(_0xaad8('0xa3')));_0x398fde[_0xaad8('0x7')](_0xaad8('0xa4'),require('./api/intVtigerAccount'));_0x398fde['use'](_0xaad8('0xa5'),require(_0xaad8('0xa6')));_0x398fde[_0xaad8('0x7')](_0xaad8('0xa7'),require('./api/intVtigerField'));_0x398fde[_0xaad8('0x7')](_0xaad8('0xa8'),require(_0xaad8('0xa9')));_0x398fde[_0xaad8('0x7')](_0xaad8('0xaa'),require('./api/intServicenowConfiguration'));_0x398fde['use'](_0xaad8('0xab'),require(_0xaad8('0xac')));_0x398fde[_0xaad8('0x7')](_0xaad8('0xad'),require(_0xaad8('0xae')));_0x398fde[_0xaad8('0x7')]('/api/integrations/dynamics365/configurations',require(_0xaad8('0xaf')));_0x398fde[_0xaad8('0x7')](_0xaad8('0xb0'),require(_0xaad8('0xb1')));_0x398fde[_0xaad8('0x7')]('/api/integrations/freshsales/accounts',require('./api/intFreshsalesAccount'));_0x398fde['use'](_0xaad8('0xb2'),require(_0xaad8('0xb3')));_0x398fde['use'](_0xaad8('0xb4'),require(_0xaad8('0xb5')));_0x398fde[_0xaad8('0x7')](_0xaad8('0xb6'),require(_0xaad8('0xb7')));_0x398fde['use'](_0xaad8('0xb8'),require(_0xaad8('0xb9')));_0x398fde[_0xaad8('0x7')]('/api/chat/internal/messages',require(_0xaad8('0xba')));_0x398fde['use'](_0xaad8('0xbb'),require(_0xaad8('0xbc')));_0x398fde['use'](_0xaad8('0xbd'),require(_0xaad8('0xbe')));_0x398fde['use'](_0xaad8('0xbf'),require('./api/jscriptySessionReport'));_0x398fde[_0xaad8('0x7')](_0xaad8('0xc0'),require(_0xaad8('0xc1')));_0x398fde[_0xaad8('0x7')]('/api/square/reports',require(_0xaad8('0xc2')));_0x398fde[_0xaad8('0x7')](_0xaad8('0xc3'),require(_0xaad8('0xc4')));_0x398fde[_0xaad8('0x7')](_0xaad8('0xc5'),require(_0xaad8('0xc6')));_0x398fde['use'](_0xaad8('0xc7'),require(_0xaad8('0xc8')));_0x398fde[_0xaad8('0x7')](_0xaad8('0xc9'),require(_0xaad8('0xca')));_0x398fde[_0xaad8('0x7')]('/api/square/projects',require(_0xaad8('0xcb')));_0x398fde['use'](_0xaad8('0xcc'),require('./api/squareRecording'));_0x398fde[_0xaad8('0x7')]('/api/square/messages',require(_0xaad8('0xcd')));_0x398fde[_0xaad8('0x7')](_0xaad8('0xce'),require(_0xaad8('0xcf')));_0x398fde[_0xaad8('0x7')](_0xaad8('0xd0'),require(_0xaad8('0xd1')));_0x398fde['use'](_0xaad8('0xd2'),require(_0xaad8('0xd3')));_0x398fde['use'](_0xaad8('0xd4'),require(_0xaad8('0xd5')));_0x398fde[_0xaad8('0x7')](_0xaad8('0xd6'),require(_0xaad8('0xd7')));_0x398fde[_0xaad8('0x7')]('/api/plugins',require(_0xaad8('0xd8')));_0x398fde['use']('/api/mail/reports/transfer',require(_0xaad8('0xd9')));_0x398fde[_0xaad8('0x7')]('/api/chat/reports/transfer',require('./api/chatTransferReport'));_0x398fde['use']('/api/fax/reports/transfer',require(_0xaad8('0xda')));_0x398fde[_0xaad8('0x7')](_0xaad8('0xdb'),require(_0xaad8('0xdc')));_0x398fde[_0xaad8('0x7')](_0xaad8('0xdd'),require(_0xaad8('0xde')));_0x398fde[_0xaad8('0x7')](_0xaad8('0xdf'),require(_0xaad8('0xe0')));_0x398fde[_0xaad8('0x7')](_0xaad8('0xe1'),require(_0xaad8('0xe2')));_0x398fde[_0xaad8('0x7')](_0xaad8('0xe3'),require(_0xaad8('0xe4')));_0x398fde[_0xaad8('0x7')]('/api/userProfile/sections',require(_0xaad8('0xe5')));_0x398fde[_0xaad8('0x7')]('/api/userProfile/resources',require(_0xaad8('0xe6')));_0x398fde[_0xaad8('0x7')](_0xaad8('0xe7'),require('./api/userNotification'));_0x398fde[_0xaad8('0x7')]('/api/whatsapp/accounts',require(_0xaad8('0xe8')));_0x398fde[_0xaad8('0x7')]('/api/whatsapp/applications',require(_0xaad8('0xe9')));_0x398fde[_0xaad8('0x7')](_0xaad8('0xea'),require('./api/whatsappInteraction'));_0x398fde[_0xaad8('0x7')](_0xaad8('0xeb'),require(_0xaad8('0xec')));_0x398fde['use']('/api/whatsapp/reports/queue',require(_0xaad8('0xed')));_0x398fde[_0xaad8('0x7')](_0xaad8('0xee'),require(_0xaad8('0xef')));_0x398fde[_0xaad8('0x7')](_0xaad8('0xf0'),require(_0xaad8('0xf1')));_0x398fde[_0xaad8('0x7')](_0xaad8('0xf2'),require('./api/cloudProvider'));_0x398fde['use'](_0xaad8('0xf3'),require(_0xaad8('0xf4')));_0x398fde[_0xaad8('0x7')](_0xaad8('0xf5'),require(_0xaad8('0xf6')));_0x398fde[_0xaad8('0x7')](_0xaad8('0xf7'),require(_0xaad8('0xf8')));_0x398fde['use'](_0xaad8('0xf9'),require('./api/authGoogle'));_0x398fde[_0xaad8('0x7')](_0xaad8('0xfa'),require(_0xaad8('0xfb')));_0x398fde[_0xaad8('0x7')](_0xaad8('0xfc'),require(_0xaad8('0xfd')));_0x398fde['use'](_0xaad8('0xfe'),require(_0xaad8('0xff')));_0x398fde[_0xaad8('0x7')]('/api/version',require(_0xaad8('0x100')));_0x398fde[_0xaad8('0x7')](_0xaad8('0x101'),require('./api/system'));_0x398fde[_0xaad8('0x7')](_0xaad8('0x102'),require('./api/pm2'));_0x398fde[_0xaad8('0x7')](_0xaad8('0x103'),require(_0xaad8('0x104')));_0x398fde[_0xaad8('0x7')]('/api/logs',clientSideLogs);_0x398fde['use'](_0xaad8('0x105'),express[_0xaad8('0x106')](path[_0xaad8('0x107')](config[_0xaad8('0x108')],_0xaad8('0x105'))));_0x398fde['use']('/www',express['static'](path[_0xaad8('0x107')](config['root'],'/www')));_0x398fde[_0xaad8('0x7')]('/demo',express[_0xaad8('0x106')](path['join'](config[_0xaad8('0x108')],_0xaad8('0x109'))));_0x398fde['use'](_0xaad8('0x10a'),express[_0xaad8('0x106')](path[_0xaad8('0x107')](config[_0xaad8('0x108')],_0xaad8('0x10b'),'3.5.0')));_0x398fde[_0xaad8('0x7')]('/plugins',express[_0xaad8('0x106')](path[_0xaad8('0x107')](config[_0xaad8('0x108')],_0xaad8('0x10c'))));_0x398fde[_0xaad8('0x10d')](_0xaad8('0x10e'))[_0xaad8('0x10f')](errors[0x194]);_0x398fde[_0xaad8('0x10d')]('/*')[_0xaad8('0x10f')](function(_0xda1b30,_0x5ed968){_0x5ed968['sendFile'](path[_0xaad8('0x110')](_0x398fde[_0xaad8('0x10f')](_0xaad8('0x111'))+_0xaad8('0x112')));});return _0x398fde;});}; \ No newline at end of file +var _0x1de4=['./api/analyticExtractedReport','/api/analytics/metrics','./api/analyticMetric','./api/analyticFieldReport','/api/analytics/tree_reports','./api/analyticTreeReport','/api/integrations/salesforce/accounts','./api/intSalesforceAccount','/api/integrations/salesforce/configurations','/api/integrations/salesforce/fields','./api/intSalesforceField','/api/integrations/sugarcrm/accounts','./api/intSugarcrmAccount','/api/integrations/sugarcrm/configurations','./api/intSugarcrmConfiguration','/api/integrations/sugarcrm/fields','/api/integrations/desk/accounts','./api/intDeskField','./api/intZohoAccount','/api/integrations/zoho/configurations','/api/integrations/zoho/fields','./api/intZohoField','./api/intZendeskAccount','/api/integrations/zendesk/configurations','/api/integrations/zendesk/fields','./api/intZendeskField','/api/integrations/freshdesk/accounts','./api/intFreshdeskAccount','/api/integrations/freshdesk/configurations','./api/intFreshdeskConfiguration','/api/integrations/freshdesk/fields','./api/intFreshdeskField','/api/integrations/vtiger/accounts','/api/integrations/vtiger/configurations','./api/intVtigerConfiguration','/api/integrations/vtiger/fields','/api/integrations/servicenow/accounts','./api/intServicenowAccount','/api/integrations/servicenow/configurations','./api/intServicenowConfiguration','./api/intServicenowField','/api/integrations/dynamics365/accounts','./api/intDynamics365Account','/api/integrations/dynamics365/configurations','./api/intDynamics365Configuration','/api/integrations/dynamics365/fields','./api/intDynamics365Field','/api/integrations/freshsales/accounts','./api/intFreshsalesAccount','/api/integrations/freshsales/configurations','./api/intFreshsalesConfiguration','/api/integrations/freshsales/fields','./api/intFreshsalesField','./api/network','/api/chat/reports/queue','./api/chatQueueReport','/api/chat/internal/messages','./api/chatInternalMessage','/api/jscripty/answers/reports','./api/jscriptyAnswerReport','/api/jscripty/questions/reports','./api/jscriptyQuestionReport','/api/jscripty/sessions/reports','./api/jscriptySessionReport','/api/sms/reports/queue','./api/smsQueueReport','/api/square/reports','./api/squareReport','/api/square/details/reports','./api/squareReportDetail','./api/jscriptyProject','/api/settings','./api/setting','./api/squareOdbc','/api/square/projects','./api/squareProject','/api/square/recordings','./api/squareRecording','/api/square/messages','./api/squareMessage','/api/teams','./api/team','/api/license','./api/license','/api/migrations','./api/attachment','/api/plugins','/api/mail/reports/transfer','./api/mailTransferReport','/api/chat/reports/transfer','/api/fax/reports/transfer','./api/faxTransferReport','/api/openchannel/reports/transfer','./api/openchannelTransferReport','/api/sms/reports/transfer','./api/smsTransferReport','/api/cm/lists','./api/cmList','/api/voice/prefixes','./api/voicePrefix','/api/userProfiles','./api/userProfile','/api/userProfile/sections','./api/userProfileSection','./api/userNotification','/api/whatsapp/applications','./api/whatsappApplication','/api/whatsapp/interactions','./api/whatsappInteraction','/api/whatsapp/messages','./api/whatsappMessage','/api/whatsapp/reports/queue','./api/whatsappQueueReport','/api/whatsapp/reports/transfer','./api/whatsappTransferReport','/api/whatsapp/queues','/api/cloudProviders','/api/realtime','./api/realtime','/api/auth/local','./api/authLocal','/api/auth/google','./api/authGoogle','/api/auth/activedirectory','/api/jira','./api/jira','./api/rpc','./api/version','/api/system','/api/pm2','./api/pm2','/api/webbar','./api/webbar','/api/logs','static','join','root','/apidoc','/www','/demo','/snippet','snippet','3.5.0','/plugins','route','get','sendFile','/index.html','path','express','./errors','./config/environment','setupLoggers','./api/client-side-logs','default','then','use','./api/user','/api/voice/chanspy','./api/voiceChanSpy','./api/voiceContext','/api/voice/extensions','./api/voiceExtension','/api/voice/mohs','/api/voice/queues','./api/voiceQueue','/api/voice/recordings','./api/voiceRecording','/api/screen/recordings','./api/screenRecording','./api/voiceMail','./api/voiceMailMessage','/api/voice/calls/reports','./api/voiceCallReport','/api/voice/dials/reports','./api/voiceDialReport','/api/voice/agents/reports','./api/voiceAgentReport','./api/voiceQueueReport','./api/memberReport','/api/trunks','./api/trunk','/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/mail/messages','./api/mailMessage','/api/mail/applications','./api/mailApplication','/api/mail/reports/queue','./api/mailQueueReport','/api/dashboards','/api/dashboards/items','/api/fax/accounts','./api/faxAccount','/api/fax/applications','./api/faxApplication','/api/fax/interactions','./api/faxInteraction','./api/faxMessage','/api/fax/queues','./api/faxQueue','/api/fax/reports/queue','/api/sms/accounts','./api/smsAccount','./api/smsApplication','/api/sms/interactions','./api/smsInteraction','./api/smsMessage','/api/sms/queues','/api/openchannel/accounts','/api/openchannel/applications','/api/openchannel/interactions','/api/openchannel/messages','./api/openchannelMessage','./api/openchannelQueue','/api/chat/websites','./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/chatQueue','/api/chat/groups','./api/chatGroup','/api/cm/companies','/api/cm/contacts','./api/cmContact','/api/cm/hopper','/api/cm/hopper_black','./api/cmHopperBlack','/api/cm/hopper_final','./api/cmHopperFinal','/api/cm/custom_fields','./api/cmCustomField','/api/actions','./api/action','/api/canned_answers','./api/cannedAnswer','./api/disposition','/api/conditions','./api/condition','/api/intervals','./api/interval','/api/pauses','./api/pause','/api/cdr','./api/cdr','/api/voiceQueuesLog','./api/voiceQueuesLog','/api/schedules','/api/sounds','./api/sound','/api/cm_contact_has_items','./api/cmContactHasItem','/api/cm_hopper_additional_phones','./api/cmHopperAdditionalPhone','/api/templates','/api/triggers','./api/trigger','/api/variables','/api/integrations','./api/integration','/api/integrations/reports','./api/integrationReport','/api/analytics/custom_reports','./api/analyticCustomReport','./api/analyticDefaultReport','/api/analytics/extracted_reports'];(function(_0x57b54c,_0x54ce0d){var _0x59cc19=function(_0xa33bc6){while(--_0xa33bc6){_0x57b54c['push'](_0x57b54c['shift']());}};_0x59cc19(++_0x54ce0d);}(_0x1de4,0x94));var _0x41de=function(_0x2563e4,_0x456262){_0x2563e4=_0x2563e4-0x0;var _0x53e6d8=_0x1de4[_0x2563e4];return _0x53e6d8;};'use strict';var path=require(_0x41de('0x0'));var express=require(_0x41de('0x1'));var errors=require(_0x41de('0x2'));var config=require(_0x41de('0x3'));var setupLoggers=require('./utils/client-side-logger')[_0x41de('0x4')];var clientSideLogs=require(_0x41de('0x5'));exports[_0x41de('0x6')]=function(_0x5dd1cb){return setupLoggers(_0x5dd1cb)[_0x41de('0x7')](function(){_0x5dd1cb[_0x41de('0x8')]('/api/users',require(_0x41de('0x9')));_0x5dd1cb[_0x41de('0x8')](_0x41de('0xa'),require(_0x41de('0xb')));_0x5dd1cb['use']('/api/voice/contexts',require(_0x41de('0xc')));_0x5dd1cb[_0x41de('0x8')](_0x41de('0xd'),require(_0x41de('0xe')));_0x5dd1cb[_0x41de('0x8')](_0x41de('0xf'),require('./api/voiceMusicOnHold'));_0x5dd1cb[_0x41de('0x8')](_0x41de('0x10'),require(_0x41de('0x11')));_0x5dd1cb[_0x41de('0x8')](_0x41de('0x12'),require(_0x41de('0x13')));_0x5dd1cb['use'](_0x41de('0x14'),require(_0x41de('0x15')));_0x5dd1cb[_0x41de('0x8')]('/api/voice/mails',require(_0x41de('0x16')));_0x5dd1cb[_0x41de('0x8')]('/api/voice/mails/messages',require(_0x41de('0x17')));_0x5dd1cb[_0x41de('0x8')](_0x41de('0x18'),require(_0x41de('0x19')));_0x5dd1cb[_0x41de('0x8')](_0x41de('0x1a'),require(_0x41de('0x1b')));_0x5dd1cb[_0x41de('0x8')](_0x41de('0x1c'),require(_0x41de('0x1d')));_0x5dd1cb[_0x41de('0x8')]('/api/voice/queues/reports',require(_0x41de('0x1e')));_0x5dd1cb[_0x41de('0x8')]('/api/members/reports',require(_0x41de('0x1f')));_0x5dd1cb[_0x41de('0x8')](_0x41de('0x20'),require(_0x41de('0x21')));_0x5dd1cb[_0x41de('0x8')]('/api/voice/transfers/reports',require('./api/voiceTransferReport'));_0x5dd1cb['use'](_0x41de('0x22'),require(_0x41de('0x23')));_0x5dd1cb[_0x41de('0x8')](_0x41de('0x24'),require(_0x41de('0x25')));_0x5dd1cb[_0x41de('0x8')](_0x41de('0x26'),require(_0x41de('0x27')));_0x5dd1cb[_0x41de('0x8')](_0x41de('0x28'),require(_0x41de('0x29')));_0x5dd1cb['use'](_0x41de('0x2a'),require(_0x41de('0x2b')));_0x5dd1cb[_0x41de('0x8')](_0x41de('0x2c'),require(_0x41de('0x2d')));_0x5dd1cb['use'](_0x41de('0x2e'),require(_0x41de('0x2f')));_0x5dd1cb[_0x41de('0x8')](_0x41de('0x30'),require(_0x41de('0x31')));_0x5dd1cb[_0x41de('0x8')](_0x41de('0x32'),require('./api/dashboard'));_0x5dd1cb[_0x41de('0x8')](_0x41de('0x33'),require('./api/dashboardItem'));_0x5dd1cb[_0x41de('0x8')](_0x41de('0x34'),require(_0x41de('0x35')));_0x5dd1cb[_0x41de('0x8')](_0x41de('0x36'),require(_0x41de('0x37')));_0x5dd1cb['use'](_0x41de('0x38'),require(_0x41de('0x39')));_0x5dd1cb[_0x41de('0x8')]('/api/fax/messages',require(_0x41de('0x3a')));_0x5dd1cb[_0x41de('0x8')](_0x41de('0x3b'),require(_0x41de('0x3c')));_0x5dd1cb[_0x41de('0x8')](_0x41de('0x3d'),require('./api/faxQueueReport'));_0x5dd1cb[_0x41de('0x8')](_0x41de('0x3e'),require(_0x41de('0x3f')));_0x5dd1cb[_0x41de('0x8')]('/api/sms/applications',require(_0x41de('0x40')));_0x5dd1cb[_0x41de('0x8')](_0x41de('0x41'),require(_0x41de('0x42')));_0x5dd1cb[_0x41de('0x8')]('/api/sms/messages',require(_0x41de('0x43')));_0x5dd1cb[_0x41de('0x8')](_0x41de('0x44'),require('./api/smsQueue'));_0x5dd1cb['use'](_0x41de('0x45'),require('./api/openchannelAccount'));_0x5dd1cb[_0x41de('0x8')](_0x41de('0x46'),require('./api/openchannelApplication'));_0x5dd1cb[_0x41de('0x8')](_0x41de('0x47'),require('./api/openchannelInteraction'));_0x5dd1cb[_0x41de('0x8')](_0x41de('0x48'),require(_0x41de('0x49')));_0x5dd1cb[_0x41de('0x8')]('/api/openchannel/queues',require(_0x41de('0x4a')));_0x5dd1cb[_0x41de('0x8')](_0x41de('0x4b'),require(_0x41de('0x4c')));_0x5dd1cb[_0x41de('0x8')](_0x41de('0x4d'),require(_0x41de('0x4e')));_0x5dd1cb[_0x41de('0x8')](_0x41de('0x4f'),require(_0x41de('0x50')));_0x5dd1cb[_0x41de('0x8')](_0x41de('0x51'),require(_0x41de('0x52')));_0x5dd1cb[_0x41de('0x8')](_0x41de('0x53'),require(_0x41de('0x54')));_0x5dd1cb[_0x41de('0x8')](_0x41de('0x55'),require(_0x41de('0x56')));_0x5dd1cb[_0x41de('0x8')](_0x41de('0x57'),require(_0x41de('0x58')));_0x5dd1cb['use'](_0x41de('0x59'),require(_0x41de('0x5a')));_0x5dd1cb['use']('/api/chat/proactive_actions',require('./api/chatProactiveAction'));_0x5dd1cb[_0x41de('0x8')](_0x41de('0x5b'),require('./api/cmCompany'));_0x5dd1cb[_0x41de('0x8')](_0x41de('0x5c'),require(_0x41de('0x5d')));_0x5dd1cb[_0x41de('0x8')](_0x41de('0x5e'),require('./api/cmHopper'));_0x5dd1cb[_0x41de('0x8')](_0x41de('0x5f'),require(_0x41de('0x60')));_0x5dd1cb[_0x41de('0x8')](_0x41de('0x61'),require(_0x41de('0x62')));_0x5dd1cb['use']('/api/cm/hopper_history',require('./api/cmHopperHistory'));_0x5dd1cb[_0x41de('0x8')](_0x41de('0x63'),require(_0x41de('0x64')));_0x5dd1cb[_0x41de('0x8')](_0x41de('0x65'),require(_0x41de('0x66')));_0x5dd1cb[_0x41de('0x8')]('/api/automations',require('./api/automation'));_0x5dd1cb[_0x41de('0x8')](_0x41de('0x67'),require(_0x41de('0x68')));_0x5dd1cb[_0x41de('0x8')]('/api/dispositions',require(_0x41de('0x69')));_0x5dd1cb['use'](_0x41de('0x6a'),require(_0x41de('0x6b')));_0x5dd1cb[_0x41de('0x8')](_0x41de('0x6c'),require(_0x41de('0x6d')));_0x5dd1cb[_0x41de('0x8')](_0x41de('0x6e'),require(_0x41de('0x6f')));_0x5dd1cb[_0x41de('0x8')](_0x41de('0x70'),require(_0x41de('0x71')));_0x5dd1cb[_0x41de('0x8')](_0x41de('0x72'),require(_0x41de('0x73')));_0x5dd1cb['use'](_0x41de('0x74'),require('./api/schedule'));_0x5dd1cb['use'](_0x41de('0x75'),require(_0x41de('0x76')));_0x5dd1cb[_0x41de('0x8')]('/api/tags',require('./api/tag'));_0x5dd1cb[_0x41de('0x8')]('/api/contact_item_types',require('./api/contactItemType'));_0x5dd1cb['use'](_0x41de('0x77'),require(_0x41de('0x78')));_0x5dd1cb[_0x41de('0x8')](_0x41de('0x79'),require(_0x41de('0x7a')));_0x5dd1cb[_0x41de('0x8')](_0x41de('0x7b'),require('./api/template'));_0x5dd1cb['use'](_0x41de('0x7c'),require(_0x41de('0x7d')));_0x5dd1cb[_0x41de('0x8')](_0x41de('0x7e'),require('./api/variable'));_0x5dd1cb[_0x41de('0x8')](_0x41de('0x7f'),require(_0x41de('0x80')));_0x5dd1cb[_0x41de('0x8')](_0x41de('0x81'),require(_0x41de('0x82')));_0x5dd1cb[_0x41de('0x8')](_0x41de('0x83'),require(_0x41de('0x84')));_0x5dd1cb[_0x41de('0x8')]('/api/analytics/default_reports',require(_0x41de('0x85')));_0x5dd1cb[_0x41de('0x8')](_0x41de('0x86'),require(_0x41de('0x87')));_0x5dd1cb[_0x41de('0x8')](_0x41de('0x88'),require(_0x41de('0x89')));_0x5dd1cb[_0x41de('0x8')]('/api/analytics/field_reports',require(_0x41de('0x8a')));_0x5dd1cb[_0x41de('0x8')](_0x41de('0x8b'),require(_0x41de('0x8c')));_0x5dd1cb[_0x41de('0x8')](_0x41de('0x8d'),require(_0x41de('0x8e')));_0x5dd1cb[_0x41de('0x8')](_0x41de('0x8f'),require('./api/intSalesforceConfiguration'));_0x5dd1cb['use'](_0x41de('0x90'),require(_0x41de('0x91')));_0x5dd1cb[_0x41de('0x8')](_0x41de('0x92'),require(_0x41de('0x93')));_0x5dd1cb[_0x41de('0x8')](_0x41de('0x94'),require(_0x41de('0x95')));_0x5dd1cb['use'](_0x41de('0x96'),require('./api/intSugarcrmField'));_0x5dd1cb[_0x41de('0x8')](_0x41de('0x97'),require('./api/intDeskAccount'));_0x5dd1cb[_0x41de('0x8')]('/api/integrations/desk/configurations',require('./api/intDeskConfiguration'));_0x5dd1cb[_0x41de('0x8')]('/api/integrations/desk/fields',require(_0x41de('0x98')));_0x5dd1cb[_0x41de('0x8')]('/api/integrations/zoho/accounts',require(_0x41de('0x99')));_0x5dd1cb['use'](_0x41de('0x9a'),require('./api/intZohoConfiguration'));_0x5dd1cb['use'](_0x41de('0x9b'),require(_0x41de('0x9c')));_0x5dd1cb[_0x41de('0x8')]('/api/integrations/zendesk/accounts',require(_0x41de('0x9d')));_0x5dd1cb['use'](_0x41de('0x9e'),require('./api/intZendeskConfiguration'));_0x5dd1cb[_0x41de('0x8')](_0x41de('0x9f'),require(_0x41de('0xa0')));_0x5dd1cb[_0x41de('0x8')](_0x41de('0xa1'),require(_0x41de('0xa2')));_0x5dd1cb[_0x41de('0x8')](_0x41de('0xa3'),require(_0x41de('0xa4')));_0x5dd1cb['use'](_0x41de('0xa5'),require(_0x41de('0xa6')));_0x5dd1cb[_0x41de('0x8')](_0x41de('0xa7'),require('./api/intVtigerAccount'));_0x5dd1cb[_0x41de('0x8')](_0x41de('0xa8'),require(_0x41de('0xa9')));_0x5dd1cb['use'](_0x41de('0xaa'),require('./api/intVtigerField'));_0x5dd1cb[_0x41de('0x8')](_0x41de('0xab'),require(_0x41de('0xac')));_0x5dd1cb[_0x41de('0x8')](_0x41de('0xad'),require(_0x41de('0xae')));_0x5dd1cb['use']('/api/integrations/servicenow/fields',require(_0x41de('0xaf')));_0x5dd1cb[_0x41de('0x8')](_0x41de('0xb0'),require(_0x41de('0xb1')));_0x5dd1cb[_0x41de('0x8')](_0x41de('0xb2'),require(_0x41de('0xb3')));_0x5dd1cb[_0x41de('0x8')](_0x41de('0xb4'),require(_0x41de('0xb5')));_0x5dd1cb[_0x41de('0x8')](_0x41de('0xb6'),require(_0x41de('0xb7')));_0x5dd1cb[_0x41de('0x8')](_0x41de('0xb8'),require(_0x41de('0xb9')));_0x5dd1cb[_0x41de('0x8')](_0x41de('0xba'),require(_0x41de('0xbb')));_0x5dd1cb[_0x41de('0x8')]('/api/networks',require(_0x41de('0xbc')));_0x5dd1cb[_0x41de('0x8')](_0x41de('0xbd'),require(_0x41de('0xbe')));_0x5dd1cb[_0x41de('0x8')](_0x41de('0xbf'),require(_0x41de('0xc0')));_0x5dd1cb[_0x41de('0x8')](_0x41de('0xc1'),require(_0x41de('0xc2')));_0x5dd1cb[_0x41de('0x8')](_0x41de('0xc3'),require(_0x41de('0xc4')));_0x5dd1cb[_0x41de('0x8')](_0x41de('0xc5'),require(_0x41de('0xc6')));_0x5dd1cb[_0x41de('0x8')](_0x41de('0xc7'),require(_0x41de('0xc8')));_0x5dd1cb[_0x41de('0x8')](_0x41de('0xc9'),require(_0x41de('0xca')));_0x5dd1cb[_0x41de('0x8')](_0x41de('0xcb'),require(_0x41de('0xcc')));_0x5dd1cb['use']('/api/jscripty/projects',require(_0x41de('0xcd')));_0x5dd1cb[_0x41de('0x8')](_0x41de('0xce'),require(_0x41de('0xcf')));_0x5dd1cb[_0x41de('0x8')]('/api/square/odbc',require(_0x41de('0xd0')));_0x5dd1cb[_0x41de('0x8')](_0x41de('0xd1'),require(_0x41de('0xd2')));_0x5dd1cb[_0x41de('0x8')](_0x41de('0xd3'),require(_0x41de('0xd4')));_0x5dd1cb['use'](_0x41de('0xd5'),require(_0x41de('0xd6')));_0x5dd1cb[_0x41de('0x8')](_0x41de('0xd7'),require(_0x41de('0xd8')));_0x5dd1cb[_0x41de('0x8')](_0x41de('0xd9'),require(_0x41de('0xda')));_0x5dd1cb[_0x41de('0x8')]('/api/campaigns',require('./api/campaign'));_0x5dd1cb[_0x41de('0x8')](_0x41de('0xdb'),require('./api/migration'));_0x5dd1cb['use']('/api/attachments',require(_0x41de('0xdc')));_0x5dd1cb[_0x41de('0x8')](_0x41de('0xdd'),require('./api/plugin'));_0x5dd1cb[_0x41de('0x8')](_0x41de('0xde'),require(_0x41de('0xdf')));_0x5dd1cb[_0x41de('0x8')](_0x41de('0xe0'),require('./api/chatTransferReport'));_0x5dd1cb[_0x41de('0x8')](_0x41de('0xe1'),require(_0x41de('0xe2')));_0x5dd1cb['use'](_0x41de('0xe3'),require(_0x41de('0xe4')));_0x5dd1cb[_0x41de('0x8')](_0x41de('0xe5'),require(_0x41de('0xe6')));_0x5dd1cb[_0x41de('0x8')](_0x41de('0xe7'),require(_0x41de('0xe8')));_0x5dd1cb[_0x41de('0x8')](_0x41de('0xe9'),require(_0x41de('0xea')));_0x5dd1cb['use'](_0x41de('0xeb'),require(_0x41de('0xec')));_0x5dd1cb[_0x41de('0x8')](_0x41de('0xed'),require(_0x41de('0xee')));_0x5dd1cb[_0x41de('0x8')]('/api/userProfile/resources',require('./api/userProfileResource'));_0x5dd1cb['use']('/api/userNotifications',require(_0x41de('0xef')));_0x5dd1cb[_0x41de('0x8')]('/api/whatsapp/accounts',require('./api/whatsappAccount'));_0x5dd1cb[_0x41de('0x8')](_0x41de('0xf0'),require(_0x41de('0xf1')));_0x5dd1cb['use'](_0x41de('0xf2'),require(_0x41de('0xf3')));_0x5dd1cb[_0x41de('0x8')](_0x41de('0xf4'),require(_0x41de('0xf5')));_0x5dd1cb[_0x41de('0x8')](_0x41de('0xf6'),require(_0x41de('0xf7')));_0x5dd1cb['use'](_0x41de('0xf8'),require(_0x41de('0xf9')));_0x5dd1cb['use'](_0x41de('0xfa'),require('./api/whatsappQueue'));_0x5dd1cb[_0x41de('0x8')](_0x41de('0xfb'),require('./api/cloudProvider'));_0x5dd1cb['use'](_0x41de('0xfc'),require(_0x41de('0xfd')));_0x5dd1cb[_0x41de('0x8')]('/api/user-settings',require('./api/user-setting'));_0x5dd1cb['use'](_0x41de('0xfe'),require(_0x41de('0xff')));_0x5dd1cb['use'](_0x41de('0x100'),require(_0x41de('0x101')));_0x5dd1cb[_0x41de('0x8')](_0x41de('0x102'),require('./api/authActiveDirectory'));_0x5dd1cb[_0x41de('0x8')](_0x41de('0x103'),require(_0x41de('0x104')));_0x5dd1cb[_0x41de('0x8')]('/api/rpc',require(_0x41de('0x105')));_0x5dd1cb[_0x41de('0x8')]('/api/version',require(_0x41de('0x106')));_0x5dd1cb['use'](_0x41de('0x107'),require('./api/system'));_0x5dd1cb[_0x41de('0x8')](_0x41de('0x108'),require(_0x41de('0x109')));_0x5dd1cb[_0x41de('0x8')](_0x41de('0x10a'),require(_0x41de('0x10b')));_0x5dd1cb[_0x41de('0x8')](_0x41de('0x10c'),clientSideLogs);_0x5dd1cb[_0x41de('0x8')]('/apidoc',express[_0x41de('0x10d')](path[_0x41de('0x10e')](config[_0x41de('0x10f')],_0x41de('0x110'))));_0x5dd1cb[_0x41de('0x8')](_0x41de('0x111'),express[_0x41de('0x10d')](path[_0x41de('0x10e')](config['root'],_0x41de('0x111'))));_0x5dd1cb[_0x41de('0x8')](_0x41de('0x112'),express['static'](path[_0x41de('0x10e')](config[_0x41de('0x10f')],_0x41de('0x112'))));_0x5dd1cb[_0x41de('0x8')](_0x41de('0x113'),express[_0x41de('0x10d')](path[_0x41de('0x10e')](config['root'],_0x41de('0x114'),_0x41de('0x115'))));_0x5dd1cb[_0x41de('0x8')](_0x41de('0x116'),express[_0x41de('0x10d')](path[_0x41de('0x10e')](config['root'],'/server/files/plugins')));_0x5dd1cb[_0x41de('0x117')]('/:url(api|auth|components|app|bower_components|assets)/*')[_0x41de('0x118')](errors[0x194]);_0x5dd1cb[_0x41de('0x117')]('/*')[_0x41de('0x118')](function(_0x5296a8,_0x3dfee9){_0x3dfee9[_0x41de('0x119')](path['resolve'](_0x5dd1cb[_0x41de('0x118')]('appPath')+_0x41de('0x11a')));});return _0x5dd1cb;});}; \ No newline at end of file diff --git a/server/rpc/index.js b/server/rpc/index.js index 50b0a1e..9fe6aa7 100644 --- a/server/rpc/index.js +++ b/server/rpc/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x808f=['../api/reportAgentPreview/reportAgentPreview.rpc','../api/interval/interval.rpc','../api/pause/pause.rpc','../api/sound/sound.rpc','../api/intSalesforceAccount/intSalesforceAccount.rpc','../api/intSugarcrmAccount/intSugarcrmAccount.rpc','../api/intZohoAccount/intZohoAccount.rpc','../api/intVtigerAccount/intVtigerAccount.rpc','../api/intServicenowAccount/intServicenowAccount.rpc','../api/intFreshsalesAccount/intFreshsalesAccount.rpc','../api/chatQueueReport/chatQueueReport.rpc','../api/smsQueueReport/smsQueueReport.rpc','../api/squareReport/squareReport.rpc','../api/squareReportDetail/squareReportDetail.rpc','../api/setting/setting.rpc','../api/squareOdbc/squareOdbc.rpc','../api/squareProject/squareProject.rpc','../api/squareRecording/squareRecording.rpc','../api/squareMessage/squareMessage.rpc','../api/campaign/campaign.rpc','../api/attachment/attachment.rpc','../api/plugin/plugin.rpc','../api/whatsappAccount/whatsappAccount.rpc','../api/whatsappMessage/whatsappMessage.rpc','../api/whatsappQueueReport/whatsappQueueReport.rpc','../api/whatsappQueue/whatsappQueue.rpc','server','rpc','port','localhost','error','listen','Express\x20RPC\x20server\x20listening\x20on\x20%s:%d!','../config/triggers','RPC\x20listening\x20on\x20','lodash','../config/environment','merge','../api/user/user.rpc','../api/voiceQueue/voiceQueue.rpc','../api/voiceCallReport/voiceCallReport.rpc','../api/voiceAgentReport/voiceAgentReport.rpc','../api/trunk/trunk.rpc','../api/voiceTransferReport/voiceTransferReport.rpc','../api/userVoiceQueueRt/userVoiceQueueRt.rpc','../api/mailServerIn/mailServerIn.rpc','../api/mailAccount/mailAccount.rpc','../api/mailQueue/mailQueue.rpc','../api/mailInteraction/mailInteraction.rpc','../api/mailMessage/mailMessage.rpc','../api/faxAccount/faxAccount.rpc','../api/faxApplication/faxApplication.rpc','../api/faxMessage/faxMessage.rpc','../api/faxQueue/faxQueue.rpc','../api/smsAccount/smsAccount.rpc','../api/smsInteraction/smsInteraction.rpc','../api/smsQueue/smsQueue.rpc','../api/openchannelApplication/openchannelApplication.rpc','../api/openchannelMessage/openchannelMessage.rpc','../api/openchannelQueue/openchannelQueue.rpc','../api/chatMessage/chatMessage.rpc','../api/chatQueue/chatQueue.rpc','../api/cmContact/cmContact.rpc','../api/cmHopper/cmHopper.rpc','../api/cmHopperBlack/cmHopperBlack.rpc'];(function(_0x4e40b6,_0x30d1c2){var _0x5438bb=function(_0x1abde7){while(--_0x1abde7){_0x4e40b6['push'](_0x4e40b6['shift']());}};_0x5438bb(++_0x30d1c2);}(_0x808f,0x1ea));var _0xf808=function(_0x2aa041,_0x46d6f1){_0x2aa041=_0x2aa041-0x0;var _0x4d0c80=_0x808f[_0x2aa041];return _0x4d0c80;};'use strict';var jayson=require('jayson/promise');var _=require(_0xf808('0x0'));var config=require(_0xf808('0x1'));exports['listen']=function(){return new Promise(function(_0x526ef8,_0x19ba9c){var _0x59d101={};_0x59d101=_[_0xf808('0x2')](_0x59d101,require(_0xf808('0x3')));_0x59d101=_['merge'](_0x59d101,require('../api/voiceExtension/voiceExtension.rpc'));_0x59d101=_[_0xf808('0x2')](_0x59d101,require(_0xf808('0x4')));_0x59d101=_[_0xf808('0x2')](_0x59d101,require('../api/voiceRecording/voiceRecording.rpc'));_0x59d101=_[_0xf808('0x2')](_0x59d101,require(_0xf808('0x5')));_0x59d101=_['merge'](_0x59d101,require('../api/voiceDialReport/voiceDialReport.rpc'));_0x59d101=_['merge'](_0x59d101,require(_0xf808('0x6')));_0x59d101=_['merge'](_0x59d101,require('../api/voiceQueueReport/voiceQueueReport.rpc'));_0x59d101=_[_0xf808('0x2')](_0x59d101,require('../api/memberReport/memberReport.rpc'));_0x59d101=_['merge'](_0x59d101,require(_0xf808('0x7')));_0x59d101=_[_0xf808('0x2')](_0x59d101,require(_0xf808('0x8')));_0x59d101=_[_0xf808('0x2')](_0x59d101,require(_0xf808('0x9')));_0x59d101=_[_0xf808('0x2')](_0x59d101,require(_0xf808('0xa')));_0x59d101=_['merge'](_0x59d101,require(_0xf808('0xb')));_0x59d101=_[_0xf808('0x2')](_0x59d101,require(_0xf808('0xc')));_0x59d101=_[_0xf808('0x2')](_0x59d101,require(_0xf808('0xd')));_0x59d101=_[_0xf808('0x2')](_0x59d101,require(_0xf808('0xe')));_0x59d101=_['merge'](_0x59d101,require('../api/mailApplication/mailApplication.rpc'));_0x59d101=_['merge'](_0x59d101,require('../api/mailQueueReport/mailQueueReport.rpc'));_0x59d101=_[_0xf808('0x2')](_0x59d101,require(_0xf808('0xf')));_0x59d101=_[_0xf808('0x2')](_0x59d101,require(_0xf808('0x10')));_0x59d101=_['merge'](_0x59d101,require('../api/faxInteraction/faxInteraction.rpc'));_0x59d101=_['merge'](_0x59d101,require(_0xf808('0x11')));_0x59d101=_[_0xf808('0x2')](_0x59d101,require(_0xf808('0x12')));_0x59d101=_[_0xf808('0x2')](_0x59d101,require('../api/faxQueueReport/faxQueueReport.rpc'));_0x59d101=_['merge'](_0x59d101,require(_0xf808('0x13')));_0x59d101=_[_0xf808('0x2')](_0x59d101,require(_0xf808('0x14')));_0x59d101=_['merge'](_0x59d101,require('../api/smsMessage/smsMessage.rpc'));_0x59d101=_['merge'](_0x59d101,require(_0xf808('0x15')));_0x59d101=_[_0xf808('0x2')](_0x59d101,require(_0xf808('0x16')));_0x59d101=_[_0xf808('0x2')](_0x59d101,require('../api/openchannelInteraction/openchannelInteraction.rpc'));_0x59d101=_[_0xf808('0x2')](_0x59d101,require(_0xf808('0x17')));_0x59d101=_[_0xf808('0x2')](_0x59d101,require(_0xf808('0x18')));_0x59d101=_[_0xf808('0x2')](_0x59d101,require('../api/openchannelQueueReport/openchannelQueueReport.rpc'));_0x59d101=_[_0xf808('0x2')](_0x59d101,require('../api/chatInteraction/chatInteraction.rpc'));_0x59d101=_[_0xf808('0x2')](_0x59d101,require(_0xf808('0x19')));_0x59d101=_[_0xf808('0x2')](_0x59d101,require(_0xf808('0x1a')));_0x59d101=_[_0xf808('0x2')](_0x59d101,require(_0xf808('0x1b')));_0x59d101=_[_0xf808('0x2')](_0x59d101,require(_0xf808('0x1c')));_0x59d101=_[_0xf808('0x2')](_0x59d101,require(_0xf808('0x1d')));_0x59d101=_[_0xf808('0x2')](_0x59d101,require('../api/cmHopperFinal/cmHopperFinal.rpc'));_0x59d101=_[_0xf808('0x2')](_0x59d101,require('../api/cmHopperHistory/cmHopperHistory.rpc'));_0x59d101=_[_0xf808('0x2')](_0x59d101,require(_0xf808('0x1e')));_0x59d101=_[_0xf808('0x2')](_0x59d101,require(_0xf808('0x1f')));_0x59d101=_[_0xf808('0x2')](_0x59d101,require(_0xf808('0x20')));_0x59d101=_[_0xf808('0x2')](_0x59d101,require(_0xf808('0x21')));_0x59d101=_[_0xf808('0x2')](_0x59d101,require('../api/cmHopperAdditionalPhone/cmHopperAdditionalPhone.rpc'));_0x59d101=_[_0xf808('0x2')](_0x59d101,require('../api/template/template.rpc'));_0x59d101=_[_0xf808('0x2')](_0x59d101,require('../api/trigger/trigger.rpc'));_0x59d101=_[_0xf808('0x2')](_0x59d101,require('../api/variable/variable.rpc'));_0x59d101=_[_0xf808('0x2')](_0x59d101,require(_0xf808('0x22')));_0x59d101=_['merge'](_0x59d101,require(_0xf808('0x23')));_0x59d101=_[_0xf808('0x2')](_0x59d101,require('../api/intDeskAccount/intDeskAccount.rpc'));_0x59d101=_[_0xf808('0x2')](_0x59d101,require(_0xf808('0x24')));_0x59d101=_[_0xf808('0x2')](_0x59d101,require('../api/intZendeskAccount/intZendeskAccount.rpc'));_0x59d101=_[_0xf808('0x2')](_0x59d101,require('../api/intFreshdeskAccount/intFreshdeskAccount.rpc'));_0x59d101=_[_0xf808('0x2')](_0x59d101,require(_0xf808('0x25')));_0x59d101=_['merge'](_0x59d101,require(_0xf808('0x26')));_0x59d101=_[_0xf808('0x2')](_0x59d101,require('../api/intDynamics365Account/intDynamics365Account.rpc'));_0x59d101=_[_0xf808('0x2')](_0x59d101,require(_0xf808('0x27')));_0x59d101=_['merge'](_0x59d101,require(_0xf808('0x28')));_0x59d101=_[_0xf808('0x2')](_0x59d101,require(_0xf808('0x29')));_0x59d101=_['merge'](_0x59d101,require(_0xf808('0x2a')));_0x59d101=_[_0xf808('0x2')](_0x59d101,require(_0xf808('0x2b')));_0x59d101=_[_0xf808('0x2')](_0x59d101,require(_0xf808('0x2c')));_0x59d101=_[_0xf808('0x2')](_0x59d101,require(_0xf808('0x2d')));_0x59d101=_[_0xf808('0x2')](_0x59d101,require(_0xf808('0x2e')));_0x59d101=_[_0xf808('0x2')](_0x59d101,require(_0xf808('0x2f')));_0x59d101=_[_0xf808('0x2')](_0x59d101,require(_0xf808('0x30')));_0x59d101=_[_0xf808('0x2')](_0x59d101,require(_0xf808('0x31')));_0x59d101=_[_0xf808('0x2')](_0x59d101,require(_0xf808('0x32')));_0x59d101=_['merge'](_0x59d101,require(_0xf808('0x33')));_0x59d101=_[_0xf808('0x2')](_0x59d101,require(_0xf808('0x34')));_0x59d101=_[_0xf808('0x2')](_0x59d101,require('../api/whatsappInteraction/whatsappInteraction.rpc'));_0x59d101=_[_0xf808('0x2')](_0x59d101,require(_0xf808('0x35')));_0x59d101=_[_0xf808('0x2')](_0x59d101,require(_0xf808('0x36')));_0x59d101=_[_0xf808('0x2')](_0x59d101,require(_0xf808('0x37')));var _0x27c858=jayson[_0xf808('0x38')](_0x59d101)['http']();var _0x44bb54=config[_0xf808('0x39')][_0xf808('0x3a')]||config['port']+0x1;var _0x3a2d53=config[_0xf808('0x39')]['ip']||_0xf808('0x3b');_0x27c858['on'](_0xf808('0x3c'),function(_0x44d0ee){return _0x19ba9c(_0x44d0ee);});_0x27c858[_0xf808('0x3d')](_0x44bb54,_0x3a2d53,function(){console['log'](_0xf808('0x3e'),_0x3a2d53,_0x44bb54);require(_0xf808('0x3f'))['default']();return _0x526ef8(_0xf808('0x40')+_0x3a2d53+':'+_0x44bb54);});});}; \ No newline at end of file +var _0x7b27=['../api/reportAgentPreview/reportAgentPreview.rpc','../api/interval/interval.rpc','../api/pause/pause.rpc','../api/sound/sound.rpc','../api/cmHopperAdditionalPhone/cmHopperAdditionalPhone.rpc','../api/template/template.rpc','../api/trigger/trigger.rpc','../api/variable/variable.rpc','../api/intSalesforceAccount/intSalesforceAccount.rpc','../api/intSugarcrmAccount/intSugarcrmAccount.rpc','../api/intZendeskAccount/intZendeskAccount.rpc','../api/intServicenowAccount/intServicenowAccount.rpc','../api/intDynamics365Account/intDynamics365Account.rpc','../api/intFreshsalesAccount/intFreshsalesAccount.rpc','../api/chatQueueReport/chatQueueReport.rpc','../api/smsQueueReport/smsQueueReport.rpc','../api/squareReport/squareReport.rpc','../api/setting/setting.rpc','../api/squareRecording/squareRecording.rpc','../api/attachment/attachment.rpc','../api/plugin/plugin.rpc','../api/whatsappAccount/whatsappAccount.rpc','../api/whatsappInteraction/whatsappInteraction.rpc','../api/whatsappMessage/whatsappMessage.rpc','../api/whatsappQueue/whatsappQueue.rpc','server','rpc','port','localhost','error','log','Express\x20RPC\x20server\x20listening\x20on\x20%s:%d!','../config/triggers','default','RPC\x20listening\x20on\x20','jayson/promise','../config/environment','listen','merge','../api/user/user.rpc','../api/voiceExtension/voiceExtension.rpc','../api/voiceQueue/voiceQueue.rpc','../api/voiceRecording/voiceRecording.rpc','../api/voiceCallReport/voiceCallReport.rpc','../api/voiceAgentReport/voiceAgentReport.rpc','../api/voiceQueueReport/voiceQueueReport.rpc','../api/memberReport/memberReport.rpc','../api/trunk/trunk.rpc','../api/voiceTransferReport/voiceTransferReport.rpc','../api/mailAccount/mailAccount.rpc','../api/mailQueue/mailQueue.rpc','../api/mailInteraction/mailInteraction.rpc','../api/mailMessage/mailMessage.rpc','../api/mailApplication/mailApplication.rpc','../api/mailQueueReport/mailQueueReport.rpc','../api/faxAccount/faxAccount.rpc','../api/faxInteraction/faxInteraction.rpc','../api/faxMessage/faxMessage.rpc','../api/faxQueue/faxQueue.rpc','../api/smsAccount/smsAccount.rpc','../api/smsInteraction/smsInteraction.rpc','../api/openchannelApplication/openchannelApplication.rpc','../api/openchannelInteraction/openchannelInteraction.rpc','../api/openchannelMessage/openchannelMessage.rpc','../api/chatInteraction/chatInteraction.rpc','../api/chatMessage/chatMessage.rpc','../api/chatQueue/chatQueue.rpc','../api/cmHopper/cmHopper.rpc','../api/cmHopperBlack/cmHopperBlack.rpc','../api/cmHopperFinal/cmHopperFinal.rpc','../api/cmHopperHistory/cmHopperHistory.rpc'];(function(_0x4d6298,_0x502f6b){var _0x57ccf0=function(_0x3cef94){while(--_0x3cef94){_0x4d6298['push'](_0x4d6298['shift']());}};_0x57ccf0(++_0x502f6b);}(_0x7b27,0x186));var _0x77b2=function(_0x3e85ef,_0x1c2284){_0x3e85ef=_0x3e85ef-0x0;var _0x503835=_0x7b27[_0x3e85ef];return _0x503835;};'use strict';var jayson=require(_0x77b2('0x0'));var _=require('lodash');var config=require(_0x77b2('0x1'));exports[_0x77b2('0x2')]=function(){return new Promise(function(_0x4000dd,_0x2f5a3a){var _0x511dfe={};_0x511dfe=_[_0x77b2('0x3')](_0x511dfe,require(_0x77b2('0x4')));_0x511dfe=_['merge'](_0x511dfe,require(_0x77b2('0x5')));_0x511dfe=_[_0x77b2('0x3')](_0x511dfe,require(_0x77b2('0x6')));_0x511dfe=_['merge'](_0x511dfe,require(_0x77b2('0x7')));_0x511dfe=_[_0x77b2('0x3')](_0x511dfe,require(_0x77b2('0x8')));_0x511dfe=_[_0x77b2('0x3')](_0x511dfe,require('../api/voiceDialReport/voiceDialReport.rpc'));_0x511dfe=_[_0x77b2('0x3')](_0x511dfe,require(_0x77b2('0x9')));_0x511dfe=_[_0x77b2('0x3')](_0x511dfe,require(_0x77b2('0xa')));_0x511dfe=_[_0x77b2('0x3')](_0x511dfe,require(_0x77b2('0xb')));_0x511dfe=_[_0x77b2('0x3')](_0x511dfe,require(_0x77b2('0xc')));_0x511dfe=_['merge'](_0x511dfe,require(_0x77b2('0xd')));_0x511dfe=_[_0x77b2('0x3')](_0x511dfe,require('../api/userVoiceQueueRt/userVoiceQueueRt.rpc'));_0x511dfe=_[_0x77b2('0x3')](_0x511dfe,require('../api/mailServerIn/mailServerIn.rpc'));_0x511dfe=_[_0x77b2('0x3')](_0x511dfe,require(_0x77b2('0xe')));_0x511dfe=_['merge'](_0x511dfe,require(_0x77b2('0xf')));_0x511dfe=_['merge'](_0x511dfe,require(_0x77b2('0x10')));_0x511dfe=_[_0x77b2('0x3')](_0x511dfe,require(_0x77b2('0x11')));_0x511dfe=_[_0x77b2('0x3')](_0x511dfe,require(_0x77b2('0x12')));_0x511dfe=_[_0x77b2('0x3')](_0x511dfe,require(_0x77b2('0x13')));_0x511dfe=_[_0x77b2('0x3')](_0x511dfe,require(_0x77b2('0x14')));_0x511dfe=_['merge'](_0x511dfe,require('../api/faxApplication/faxApplication.rpc'));_0x511dfe=_[_0x77b2('0x3')](_0x511dfe,require(_0x77b2('0x15')));_0x511dfe=_[_0x77b2('0x3')](_0x511dfe,require(_0x77b2('0x16')));_0x511dfe=_[_0x77b2('0x3')](_0x511dfe,require(_0x77b2('0x17')));_0x511dfe=_[_0x77b2('0x3')](_0x511dfe,require('../api/faxQueueReport/faxQueueReport.rpc'));_0x511dfe=_[_0x77b2('0x3')](_0x511dfe,require(_0x77b2('0x18')));_0x511dfe=_[_0x77b2('0x3')](_0x511dfe,require(_0x77b2('0x19')));_0x511dfe=_[_0x77b2('0x3')](_0x511dfe,require('../api/smsMessage/smsMessage.rpc'));_0x511dfe=_[_0x77b2('0x3')](_0x511dfe,require('../api/smsQueue/smsQueue.rpc'));_0x511dfe=_[_0x77b2('0x3')](_0x511dfe,require(_0x77b2('0x1a')));_0x511dfe=_[_0x77b2('0x3')](_0x511dfe,require(_0x77b2('0x1b')));_0x511dfe=_[_0x77b2('0x3')](_0x511dfe,require(_0x77b2('0x1c')));_0x511dfe=_[_0x77b2('0x3')](_0x511dfe,require('../api/openchannelQueue/openchannelQueue.rpc'));_0x511dfe=_['merge'](_0x511dfe,require('../api/openchannelQueueReport/openchannelQueueReport.rpc'));_0x511dfe=_[_0x77b2('0x3')](_0x511dfe,require(_0x77b2('0x1d')));_0x511dfe=_[_0x77b2('0x3')](_0x511dfe,require(_0x77b2('0x1e')));_0x511dfe=_[_0x77b2('0x3')](_0x511dfe,require(_0x77b2('0x1f')));_0x511dfe=_[_0x77b2('0x3')](_0x511dfe,require('../api/cmContact/cmContact.rpc'));_0x511dfe=_[_0x77b2('0x3')](_0x511dfe,require(_0x77b2('0x20')));_0x511dfe=_[_0x77b2('0x3')](_0x511dfe,require(_0x77b2('0x21')));_0x511dfe=_[_0x77b2('0x3')](_0x511dfe,require(_0x77b2('0x22')));_0x511dfe=_[_0x77b2('0x3')](_0x511dfe,require(_0x77b2('0x23')));_0x511dfe=_[_0x77b2('0x3')](_0x511dfe,require(_0x77b2('0x24')));_0x511dfe=_['merge'](_0x511dfe,require(_0x77b2('0x25')));_0x511dfe=_[_0x77b2('0x3')](_0x511dfe,require(_0x77b2('0x26')));_0x511dfe=_[_0x77b2('0x3')](_0x511dfe,require(_0x77b2('0x27')));_0x511dfe=_['merge'](_0x511dfe,require(_0x77b2('0x28')));_0x511dfe=_[_0x77b2('0x3')](_0x511dfe,require(_0x77b2('0x29')));_0x511dfe=_[_0x77b2('0x3')](_0x511dfe,require(_0x77b2('0x2a')));_0x511dfe=_[_0x77b2('0x3')](_0x511dfe,require(_0x77b2('0x2b')));_0x511dfe=_[_0x77b2('0x3')](_0x511dfe,require(_0x77b2('0x2c')));_0x511dfe=_[_0x77b2('0x3')](_0x511dfe,require(_0x77b2('0x2d')));_0x511dfe=_[_0x77b2('0x3')](_0x511dfe,require('../api/intDeskAccount/intDeskAccount.rpc'));_0x511dfe=_['merge'](_0x511dfe,require('../api/intZohoAccount/intZohoAccount.rpc'));_0x511dfe=_['merge'](_0x511dfe,require(_0x77b2('0x2e')));_0x511dfe=_[_0x77b2('0x3')](_0x511dfe,require('../api/intFreshdeskAccount/intFreshdeskAccount.rpc'));_0x511dfe=_['merge'](_0x511dfe,require('../api/intVtigerAccount/intVtigerAccount.rpc'));_0x511dfe=_[_0x77b2('0x3')](_0x511dfe,require(_0x77b2('0x2f')));_0x511dfe=_[_0x77b2('0x3')](_0x511dfe,require(_0x77b2('0x30')));_0x511dfe=_['merge'](_0x511dfe,require(_0x77b2('0x31')));_0x511dfe=_['merge'](_0x511dfe,require(_0x77b2('0x32')));_0x511dfe=_[_0x77b2('0x3')](_0x511dfe,require(_0x77b2('0x33')));_0x511dfe=_[_0x77b2('0x3')](_0x511dfe,require(_0x77b2('0x34')));_0x511dfe=_[_0x77b2('0x3')](_0x511dfe,require('../api/squareReportDetail/squareReportDetail.rpc'));_0x511dfe=_[_0x77b2('0x3')](_0x511dfe,require(_0x77b2('0x35')));_0x511dfe=_[_0x77b2('0x3')](_0x511dfe,require('../api/squareOdbc/squareOdbc.rpc'));_0x511dfe=_[_0x77b2('0x3')](_0x511dfe,require('../api/squareProject/squareProject.rpc'));_0x511dfe=_[_0x77b2('0x3')](_0x511dfe,require(_0x77b2('0x36')));_0x511dfe=_[_0x77b2('0x3')](_0x511dfe,require('../api/squareMessage/squareMessage.rpc'));_0x511dfe=_['merge'](_0x511dfe,require('../api/campaign/campaign.rpc'));_0x511dfe=_['merge'](_0x511dfe,require(_0x77b2('0x37')));_0x511dfe=_['merge'](_0x511dfe,require(_0x77b2('0x38')));_0x511dfe=_[_0x77b2('0x3')](_0x511dfe,require(_0x77b2('0x39')));_0x511dfe=_[_0x77b2('0x3')](_0x511dfe,require(_0x77b2('0x3a')));_0x511dfe=_[_0x77b2('0x3')](_0x511dfe,require(_0x77b2('0x3b')));_0x511dfe=_['merge'](_0x511dfe,require('../api/whatsappQueueReport/whatsappQueueReport.rpc'));_0x511dfe=_[_0x77b2('0x3')](_0x511dfe,require(_0x77b2('0x3c')));var _0x2b76fb=jayson[_0x77b2('0x3d')](_0x511dfe)['http']();var _0x18a419=config[_0x77b2('0x3e')][_0x77b2('0x3f')]||config['port']+0x1;var _0x5c3d18=config[_0x77b2('0x3e')]['ip']||_0x77b2('0x40');_0x2b76fb['on'](_0x77b2('0x41'),function(_0x35b418){return _0x2f5a3a(_0x35b418);});_0x2b76fb['listen'](_0x18a419,_0x5c3d18,function(){console[_0x77b2('0x42')](_0x77b2('0x43'),_0x5c3d18,_0x18a419);require(_0x77b2('0x44'))[_0x77b2('0x45')]();return _0x4000dd(_0x77b2('0x46')+_0x5c3d18+':'+_0x18a419);});});}; \ No newline at end of file diff --git a/server/services/agi/channel.js b/server/services/agi/channel.js index cc2acaa..7c3de51 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 _0x1be0=['prototype','sendRequest','sync','answer','ANSWER','getData','beep','format','GET\x20DATA\x20\x22%s\x22\x20%s\x20%s','noop','VERBOSE\x20\x22%s\x22','isArray','EXEC\x20%s\x20%s','join','setContext','SET\x20CONTEXT\x20%s','setExtension','SET\x20EXTENSION\x20%s','setPriority','SET\x20PRIORITY\x20%s','HANGUP','setVariable','isBoolean','toString','SET\x20VARIABLE\x20%s\x20\x22%s\x22','SAY\x20NUMBER\x20%s\x20%s','sayDigits','sayPhonetic','SAY\x20PHONETIC\x20\x22%s\x22\x20%s','continueAt','extension','GOTO\x20%s\x20%s\x20%s','getVariable','GET\x20VARIABLE\x20\x22%s\x22','wav','STREAM\x20FILE\x20\x22%s\x22\x20\x22%s\x22','agi','exec','AGI','WAIT','ID:%s\x20-\x20LABEL:\x20%s\x20-\x20MSG:\x20%s','label','exports','lodash','events','EventEmitter','./reply','call','setEncoding','utf8','headers','emit','ready','line','hangup','substring','520-Invalid','search','520\x20End\x20of\x20proper','function','no\x20code','replace','indexOf','substr','startsWith','split','length','match','error','E_AGI_SOCKET_ERROR','code','close','E_AGI_SOCKET_CLOSE','timeout','E_AGI_SOCKET_TIMEOUT','destroy','pipe','command','write','inherits'];(function(_0x62c958,_0x2bfdbc){var _0x57ec61=function(_0x5c0094){while(--_0x5c0094){_0x62c958['push'](_0x62c958['shift']());}};_0x57ec61(++_0x2bfdbc);}(_0x1be0,0x16b));var _0x01be=function(_0x198e7f,_0x1fbfb4){_0x198e7f=_0x198e7f-0x0;var _0x4e854e=_0x1be0[_0x198e7f];return _0x4e854e;};'use strict';var util=require('util');var _=require(_0x01be('0x0'));var EventEmitter=require(_0x01be('0x1'))[_0x01be('0x2')];var AGIReply=require(_0x01be('0x3'));var AGIError=require('./error');function AGIChannel(_0x2fab52){var _0x225de0=this,_0x3b9df4=new AGIReply(),_0xd632ab=![],_0x53a68b={};EventEmitter[_0x01be('0x4')](_0x225de0);_0x2fab52[_0x01be('0x5')]('utf8');_0x2fab52['setTimeout'](0x8*0x3c*0x3c*0x3e8);_0x3b9df4[_0x01be('0x5')](_0x01be('0x6'));_0x3b9df4['on'](_0x01be('0x7'),function(_0x478a41){for(var _0x17f9ad in _0x478a41){_0x225de0[_0x17f9ad]=_0x478a41[_0x17f9ad];}_0x225de0[_0x01be('0x8')](_0x01be('0x9'));});_0x3b9df4['on'](_0x01be('0xa'),function(_0x55d716){if(_0x55d716['toLowerCase']()=='hangup'){_0x225de0[_0x01be('0x8')](_0x01be('0xb'));return;}if(_0x55d716[_0x01be('0xc')](0x0,0xb)==_0x01be('0xd')){_0xd632ab=!![];}if(_0xd632ab){_0x53a68b['rx']+=_0x55d716+'\x0a';if(_0x55d716[_0x01be('0xe')](_0x01be('0xf'))!=-0x1){_0xd632ab=![];}}else{_0x53a68b['rx']=_0x55d716;}if(_0xd632ab){return;}if(typeof _0x53a68b['cb']==_0x01be('0x10')){var _0x6146b5=_0x53a68b['rx'][_0x01be('0xc')](0x0,0x3),_0x500b61=null,_0x5e4bb0=null;_0x6146b5=parseInt(_0x6146b5);if(isNaN(_0x6146b5)){_0x53a68b['cb'](null,{'code':0x1f4,'result':-0x1,'extra':_0x01be('0x11')});return;}if(_0x6146b5!=0xc8){_0x53a68b['cb'](null,{'code':_0x6146b5,'result':-0x1,'extra':'KO'});return;}_0x500b61=_0x53a68b['rx']['substring'](0x4)[_0x01be('0x12')]('result=','');if(_0x500b61[_0x01be('0x13')]('\x20')!=-0x1){_0x500b61=_0x500b61[_0x01be('0x14')](0x0,_0x500b61[_0x01be('0x13')]('\x20'));}if(_[_0x01be('0x15')](_0x500b61,'-1')){_0x500b61=parseInt(_0x500b61);}_0x5e4bb0=_0x53a68b['rx'][_0x01be('0x16')]('\x20');if(_0x5e4bb0[_0x01be('0x17')]==0x3){_0x5e4bb0=_0x5e4bb0[0x2][_0x01be('0xc')](0x1,_0x5e4bb0[0x2][_0x01be('0x17')]-0x1);}else if(_0x5e4bb0[_0x01be('0x17')]>0x3){var _0x1245b8=/\((.+)\)/;var _0x20f40c=_0x53a68b['rx'][_0x01be('0x18')](_0x1245b8);if(_0x20f40c){_0x5e4bb0=_0x20f40c[0x1];}else{_0x5e4bb0=null;}}else{_0x5e4bb0=null;}_0x53a68b['cb'](null,{'code':_0x6146b5,'result':_0x500b61,'extra':_0x5e4bb0});}});_0x2fab52['on'](_0x01be('0x19'),function(_0x4bb952){_0x225de0['emit']('error',new AGIError(_0x01be('0x1a'),_0x4bb952[_0x01be('0x1b')]));});_0x2fab52['on'](_0x01be('0x1c'),function(){_0x225de0['emit']('close',new AGIError(_0x01be('0x1d')));});_0x2fab52['on'](_0x01be('0x1e'),function(){_0x225de0[_0x01be('0x8')](_0x01be('0x1e'),new AGIError(_0x01be('0x1f')));_0x2fab52[_0x01be('0x20')]();});_0x2fab52[_0x01be('0x21')](_0x3b9df4);this[_0x01be('0x22')]=function(_0x1b5d9d,_0x6502c2){var _0x1b5d9d=_0x1b5d9d||'',_0x6502c2=typeof _0x6502c2==_0x01be('0x10')?_0x6502c2:new Function();_0x53a68b={'tx':_0x1b5d9d,'rx':'','cb':_0x6502c2};_0x2fab52[_0x01be('0x23')](_0x1b5d9d+'\x0a');},this[_0x01be('0x1c')]=function(){_0x2fab52[_0x01be('0x20')]();};}util[_0x01be('0x24')](AGIChannel,EventEmitter);AGIChannel[_0x01be('0x25')][_0x01be('0x26')]=function(_0x3227ee){return this[_0x01be('0x22')][_0x01be('0x27')](this,_0x3227ee);};AGIChannel[_0x01be('0x25')][_0x01be('0x28')]=function(){return this[_0x01be('0x26')](_0x01be('0x29'));};AGIChannel[_0x01be('0x25')][_0x01be('0x2a')]=function(_0x4f32fc,_0x311d04,_0x1303d1){_0x4f32fc=_0x4f32fc===undefined?_0x01be('0x2b'):_0x4f32fc;_0x311d04=_0x311d04===undefined?'5':_0x311d04;_0x1303d1=_0x1303d1===undefined?'1':_0x1303d1;return this[_0x01be('0x26')](util[_0x01be('0x2c')](_0x01be('0x2d'),_0x4f32fc,_0x311d04*0x3e8,_0x1303d1));};AGIChannel[_0x01be('0x25')][_0x01be('0x2e')]=function(_0x25abb3){_0x25abb3=_0x25abb3||'NO\x20MESSAGE';return this['sendRequest'](util[_0x01be('0x2c')](_0x01be('0x2f'),_0x25abb3));};AGIChannel[_0x01be('0x25')]['exec']=function(_0x9ed8c3,_0x5d4894){if(_[_0x01be('0x30')](_0x5d4894)){return this[_0x01be('0x26')](util['format'](_0x01be('0x31'),_0x9ed8c3,_0x5d4894[_0x01be('0x32')](',')));}return this[_0x01be('0x26')](util['format'](_0x01be('0x31'),_0x9ed8c3,_0x5d4894));};AGIChannel['prototype'][_0x01be('0x33')]=function(_0x4900c9){return this[_0x01be('0x26')](util[_0x01be('0x2c')](_0x01be('0x34'),_0x4900c9));};AGIChannel[_0x01be('0x25')][_0x01be('0x35')]=function(_0x2d1126){return this[_0x01be('0x26')](util[_0x01be('0x2c')](_0x01be('0x36'),_0x2d1126));};AGIChannel['prototype'][_0x01be('0x37')]=function(_0x186724){return this['sendRequest'](util[_0x01be('0x2c')](_0x01be('0x38'),_0x186724));};AGIChannel['prototype'][_0x01be('0xb')]=function(){return this[_0x01be('0x26')](_0x01be('0x39'));};AGIChannel['prototype'][_0x01be('0x3a')]=function(_0x3ec271,_0x457d25){var _0x234329=_[_0x01be('0x3b')](_0x457d25)||_['isNumber'](_0x457d25)?_0x457d25[_0x01be('0x3c')]():_0x457d25;return this[_0x01be('0x26')](util['format'](_0x01be('0x3d'),_0x3ec271,_0x234329?_0x234329[_0x01be('0x3c')]()[_0x01be('0x12')](/(\r\n|\n|\r)/gm,'\x20'):''));};AGIChannel['prototype']['sayNumber']=function(_0x2e32ef,_0x1be7a0){return this[_0x01be('0x26')](util[_0x01be('0x2c')](_0x01be('0x3e'),_0x2e32ef,_0x1be7a0));};AGIChannel['prototype'][_0x01be('0x3f')]=function(_0x4858df,_0x487e3b){return this[_0x01be('0x26')](util[_0x01be('0x2c')]('SAY\x20DIGITS\x20%s\x20%s',_0x4858df,_0x487e3b));};AGIChannel['prototype'][_0x01be('0x40')]=function(_0x489d22,_0x1bb5b1){return this[_0x01be('0x26')](util[_0x01be('0x2c')](_0x01be('0x41'),_0x489d22,_0x1bb5b1));};AGIChannel[_0x01be('0x25')][_0x01be('0x42')]=function(_0x604040,_0x17de40,_0x4ebbed){_0x17de40=_0x17de40||this[_0x01be('0x43')];_0x4ebbed=_0x4ebbed||0x1;this[_0x01be('0x33')](_0x604040);this[_0x01be('0x35')](_0x17de40);this[_0x01be('0x37')](_0x4ebbed);return this[_0x01be('0x2e')](util['format'](_0x01be('0x44'),_0x604040,_0x17de40,_0x4ebbed));};AGIChannel[_0x01be('0x25')][_0x01be('0x45')]=function(_0x1be4e2){return this[_0x01be('0x26')](util[_0x01be('0x2c')](_0x01be('0x46'),_0x1be4e2));};AGIChannel['prototype']['recordFile']=function(_0x3ee936,_0x343dab,_0x56a6c1,_0x29160a,_0x2c0967,_0x747b02){_0x343dab=_0x343dab||_0x01be('0x47');_0x56a6c1=_0x56a6c1||'';_0x29160a=_0x29160a===undefined?-0x1:_0x29160a==='-1'?-0x1:_0x29160a*0x3e8;_0x2c0967=_0x2c0967===undefined?'':'s='+_0x2c0967;_0x747b02=_0x747b02?'BEEP':'';return this[_0x01be('0x26')](util[_0x01be('0x2c')]('RECORD\x20FILE\x20\x22%s\x22\x20\x22%s\x22\x20\x22%s\x22\x20%s\x20%s\x20%s',_0x3ee936,_0x343dab,_0x56a6c1,_0x29160a,_0x747b02,_0x2c0967));};AGIChannel[_0x01be('0x25')]['streamFile']=function(_0x4c3a47,_0xd162a4){_0xd162a4=_0xd162a4||'';return this[_0x01be('0x26')](util[_0x01be('0x2c')](_0x01be('0x48'),_0x4c3a47,_0xd162a4));};AGIChannel[_0x01be('0x25')][_0x01be('0x49')]=function(_0x4246dd){return this[_0x01be('0x4a')](_0x01be('0x4b'),_0x4246dd);};AGIChannel[_0x01be('0x25')]['wait']=function(_0x36f861){return this['exec'](_0x01be('0x4c'),_0x36f861);};AGIChannel['prototype'][_0x01be('0x19')]=function(_0x878731,_0x376404){this['noop'](util[_0x01be('0x2c')](_0x01be('0x4d'),_0x878731['id'],_0x878731[_0x01be('0x4e')],_0x376404));return{'code':0x1f4,'result':'-1','extra':''};};module[_0x01be('0x4f')]=AGIChannel; \ No newline at end of file +var _0x6c65=['destroy','command','write','prototype','sendRequest','sync','ANSWER','GET\x20DATA\x20\x22%s\x22\x20%s\x20%s','noop','NO\x20MESSAGE','format','VERBOSE\x20\x22%s\x22','exec','isArray','join','setContext','SET\x20CONTEXT\x20%s','setExtension','SET\x20EXTENSION\x20%s','setPriority','HANGUP','setVariable','isBoolean','isNumber','toString','SET\x20VARIABLE\x20%s\x20\x22%s\x22','sayNumber','SAY\x20NUMBER\x20%s\x20%s','sayDigits','SAY\x20DIGITS\x20%s\x20%s','sayPhonetic','SAY\x20PHONETIC\x20\x22%s\x22\x20%s','continueAt','extension','GOTO\x20%s\x20%s\x20%s','getVariable','GET\x20VARIABLE\x20\x22%s\x22','recordFile','wav','RECORD\x20FILE\x20\x22%s\x22\x20\x22%s\x22\x20\x22%s\x22\x20%s\x20%s\x20%s','streamFile','agi','AGI','wait','WAIT','ID:%s\x20-\x20LABEL:\x20%s\x20-\x20MSG:\x20%s','exports','util','lodash','events','EventEmitter','./reply','./error','call','utf8','setTimeout','setEncoding','headers','emit','ready','toLowerCase','hangup','substring','search','result=','substr','split','length','error','code','close','timeout','E_AGI_SOCKET_TIMEOUT'];(function(_0xf77b1c,_0x5f07f5){var _0x4e9ec1=function(_0x170932){while(--_0x170932){_0xf77b1c['push'](_0xf77b1c['shift']());}};_0x4e9ec1(++_0x5f07f5);}(_0x6c65,0x78));var _0x56c6=function(_0x41a49c,_0x33be78){_0x41a49c=_0x41a49c-0x0;var _0x534b4e=_0x6c65[_0x41a49c];return _0x534b4e;};'use strict';var util=require(_0x56c6('0x0'));var _=require(_0x56c6('0x1'));var EventEmitter=require(_0x56c6('0x2'))[_0x56c6('0x3')];var AGIReply=require(_0x56c6('0x4'));var AGIError=require(_0x56c6('0x5'));function AGIChannel(_0x57c6ff){var _0x43d710=this,_0x4321ef=new AGIReply(),_0x3f532d=![],_0x1e70f2={};EventEmitter[_0x56c6('0x6')](_0x43d710);_0x57c6ff['setEncoding'](_0x56c6('0x7'));_0x57c6ff[_0x56c6('0x8')](0x8*0x3c*0x3c*0x3e8);_0x4321ef[_0x56c6('0x9')](_0x56c6('0x7'));_0x4321ef['on'](_0x56c6('0xa'),function(_0x5f35af){for(var _0x3e0810 in _0x5f35af){_0x43d710[_0x3e0810]=_0x5f35af[_0x3e0810];}_0x43d710[_0x56c6('0xb')](_0x56c6('0xc'));});_0x4321ef['on']('line',function(_0x3786de){if(_0x3786de[_0x56c6('0xd')]()==_0x56c6('0xe')){_0x43d710[_0x56c6('0xb')](_0x56c6('0xe'));return;}if(_0x3786de[_0x56c6('0xf')](0x0,0xb)=='520-Invalid'){_0x3f532d=!![];}if(_0x3f532d){_0x1e70f2['rx']+=_0x3786de+'\x0a';if(_0x3786de[_0x56c6('0x10')]('520\x20End\x20of\x20proper')!=-0x1){_0x3f532d=![];}}else{_0x1e70f2['rx']=_0x3786de;}if(_0x3f532d){return;}if(typeof _0x1e70f2['cb']=='function'){var _0x1d7c67=_0x1e70f2['rx'][_0x56c6('0xf')](0x0,0x3),_0x2bb84e=null,_0x3310ed=null;_0x1d7c67=parseInt(_0x1d7c67);if(isNaN(_0x1d7c67)){_0x1e70f2['cb'](null,{'code':0x1f4,'result':-0x1,'extra':'no\x20code'});return;}if(_0x1d7c67!=0xc8){_0x1e70f2['cb'](null,{'code':_0x1d7c67,'result':-0x1,'extra':'KO'});return;}_0x2bb84e=_0x1e70f2['rx'][_0x56c6('0xf')](0x4)['replace'](_0x56c6('0x11'),'');if(_0x2bb84e['indexOf']('\x20')!=-0x1){_0x2bb84e=_0x2bb84e[_0x56c6('0x12')](0x0,_0x2bb84e['indexOf']('\x20'));}if(_['startsWith'](_0x2bb84e,'-1')){_0x2bb84e=parseInt(_0x2bb84e);}_0x3310ed=_0x1e70f2['rx'][_0x56c6('0x13')]('\x20');if(_0x3310ed['length']==0x3){_0x3310ed=_0x3310ed[0x2][_0x56c6('0xf')](0x1,_0x3310ed[0x2]['length']-0x1);}else if(_0x3310ed[_0x56c6('0x14')]>0x3){var _0x5daebf=/\((.+)\)/;var _0x457156=_0x1e70f2['rx']['match'](_0x5daebf);if(_0x457156){_0x3310ed=_0x457156[0x1];}else{_0x3310ed=null;}}else{_0x3310ed=null;}_0x1e70f2['cb'](null,{'code':_0x1d7c67,'result':_0x2bb84e,'extra':_0x3310ed});}});_0x57c6ff['on'](_0x56c6('0x15'),function(_0x5625f2){_0x43d710[_0x56c6('0xb')](_0x56c6('0x15'),new AGIError('E_AGI_SOCKET_ERROR',_0x5625f2[_0x56c6('0x16')]));});_0x57c6ff['on'](_0x56c6('0x17'),function(){_0x43d710[_0x56c6('0xb')](_0x56c6('0x17'),new AGIError('E_AGI_SOCKET_CLOSE'));});_0x57c6ff['on'](_0x56c6('0x18'),function(){_0x43d710[_0x56c6('0xb')](_0x56c6('0x18'),new AGIError(_0x56c6('0x19')));_0x57c6ff[_0x56c6('0x1a')]();});_0x57c6ff['pipe'](_0x4321ef);this[_0x56c6('0x1b')]=function(_0x1bc637,_0x55271c){var _0x1bc637=_0x1bc637||'',_0x55271c=typeof _0x55271c=='function'?_0x55271c:new Function();_0x1e70f2={'tx':_0x1bc637,'rx':'','cb':_0x55271c};_0x57c6ff[_0x56c6('0x1c')](_0x1bc637+'\x0a');},this[_0x56c6('0x17')]=function(){_0x57c6ff[_0x56c6('0x1a')]();};}util['inherits'](AGIChannel,EventEmitter);AGIChannel[_0x56c6('0x1d')][_0x56c6('0x1e')]=function(_0x44664f){return this[_0x56c6('0x1b')][_0x56c6('0x1f')](this,_0x44664f);};AGIChannel[_0x56c6('0x1d')]['answer']=function(){return this['sendRequest'](_0x56c6('0x20'));};AGIChannel[_0x56c6('0x1d')]['getData']=function(_0x33f95e,_0x53766a,_0x2e6b1a){_0x33f95e=_0x33f95e===undefined?'beep':_0x33f95e;_0x53766a=_0x53766a===undefined?'5':_0x53766a;_0x2e6b1a=_0x2e6b1a===undefined?'1':_0x2e6b1a;return this[_0x56c6('0x1e')](util['format'](_0x56c6('0x21'),_0x33f95e,_0x53766a*0x3e8,_0x2e6b1a));};AGIChannel[_0x56c6('0x1d')][_0x56c6('0x22')]=function(_0x2e6b07){_0x2e6b07=_0x2e6b07||_0x56c6('0x23');return this[_0x56c6('0x1e')](util[_0x56c6('0x24')](_0x56c6('0x25'),_0x2e6b07));};AGIChannel[_0x56c6('0x1d')][_0x56c6('0x26')]=function(_0x47ac1c,_0x492d80){if(_[_0x56c6('0x27')](_0x492d80)){return this[_0x56c6('0x1e')](util['format']('EXEC\x20%s\x20%s',_0x47ac1c,_0x492d80[_0x56c6('0x28')](',')));}return this['sendRequest'](util[_0x56c6('0x24')]('EXEC\x20%s\x20%s',_0x47ac1c,_0x492d80));};AGIChannel[_0x56c6('0x1d')][_0x56c6('0x29')]=function(_0x1658b2){return this['sendRequest'](util[_0x56c6('0x24')](_0x56c6('0x2a'),_0x1658b2));};AGIChannel[_0x56c6('0x1d')][_0x56c6('0x2b')]=function(_0x6d20d5){return this[_0x56c6('0x1e')](util[_0x56c6('0x24')](_0x56c6('0x2c'),_0x6d20d5));};AGIChannel[_0x56c6('0x1d')][_0x56c6('0x2d')]=function(_0x5313dd){return this[_0x56c6('0x1e')](util[_0x56c6('0x24')]('SET\x20PRIORITY\x20%s',_0x5313dd));};AGIChannel[_0x56c6('0x1d')][_0x56c6('0xe')]=function(){return this[_0x56c6('0x1e')](_0x56c6('0x2e'));};AGIChannel[_0x56c6('0x1d')][_0x56c6('0x2f')]=function(_0x4654ed,_0x5aa1d7){var _0x456d5c=_[_0x56c6('0x30')](_0x5aa1d7)||_[_0x56c6('0x31')](_0x5aa1d7)?_0x5aa1d7[_0x56c6('0x32')]():_0x5aa1d7;return this[_0x56c6('0x1e')](util[_0x56c6('0x24')](_0x56c6('0x33'),_0x4654ed,_0x456d5c?_0x456d5c['toString']()['replace'](/(\r\n|\n|\r)/gm,'\x20'):''));};AGIChannel[_0x56c6('0x1d')][_0x56c6('0x34')]=function(_0x6668d3,_0x36fff9){return this[_0x56c6('0x1e')](util[_0x56c6('0x24')](_0x56c6('0x35'),_0x6668d3,_0x36fff9));};AGIChannel[_0x56c6('0x1d')][_0x56c6('0x36')]=function(_0x241cb2,_0x493865){return this[_0x56c6('0x1e')](util[_0x56c6('0x24')](_0x56c6('0x37'),_0x241cb2,_0x493865));};AGIChannel['prototype'][_0x56c6('0x38')]=function(_0x74516a,_0x253394){return this['sendRequest'](util['format'](_0x56c6('0x39'),_0x74516a,_0x253394));};AGIChannel[_0x56c6('0x1d')][_0x56c6('0x3a')]=function(_0x1aea30,_0xf5fc4d,_0x32c546){_0xf5fc4d=_0xf5fc4d||this[_0x56c6('0x3b')];_0x32c546=_0x32c546||0x1;this[_0x56c6('0x29')](_0x1aea30);this[_0x56c6('0x2b')](_0xf5fc4d);this[_0x56c6('0x2d')](_0x32c546);return this[_0x56c6('0x22')](util[_0x56c6('0x24')](_0x56c6('0x3c'),_0x1aea30,_0xf5fc4d,_0x32c546));};AGIChannel['prototype'][_0x56c6('0x3d')]=function(_0x851bbe){return this[_0x56c6('0x1e')](util['format'](_0x56c6('0x3e'),_0x851bbe));};AGIChannel[_0x56c6('0x1d')][_0x56c6('0x3f')]=function(_0x3a65d3,_0x284bbc,_0xf79ec4,_0x293708,_0x2ad49e,_0x4e15e4){_0x284bbc=_0x284bbc||_0x56c6('0x40');_0xf79ec4=_0xf79ec4||'';_0x293708=_0x293708===undefined?-0x1:_0x293708==='-1'?-0x1:_0x293708*0x3e8;_0x2ad49e=_0x2ad49e===undefined?'':'s='+_0x2ad49e;_0x4e15e4=_0x4e15e4?'BEEP':'';return this['sendRequest'](util[_0x56c6('0x24')](_0x56c6('0x41'),_0x3a65d3,_0x284bbc,_0xf79ec4,_0x293708,_0x4e15e4,_0x2ad49e));};AGIChannel[_0x56c6('0x1d')][_0x56c6('0x42')]=function(_0x5e3490,_0x9c0f96){_0x9c0f96=_0x9c0f96||'';return this[_0x56c6('0x1e')](util[_0x56c6('0x24')]('STREAM\x20FILE\x20\x22%s\x22\x20\x22%s\x22',_0x5e3490,_0x9c0f96));};AGIChannel[_0x56c6('0x1d')][_0x56c6('0x43')]=function(_0x2e13c3){return this[_0x56c6('0x26')](_0x56c6('0x44'),_0x2e13c3);};AGIChannel['prototype'][_0x56c6('0x45')]=function(_0x275de2){return this[_0x56c6('0x26')](_0x56c6('0x46'),_0x275de2);};AGIChannel[_0x56c6('0x1d')][_0x56c6('0x15')]=function(_0x421e08,_0x1b6ac4){this[_0x56c6('0x22')](util[_0x56c6('0x24')](_0x56c6('0x47'),_0x421e08['id'],_0x421e08['label'],_0x1b6ac4));return{'code':0x1f4,'result':'-1','extra':''};};module[_0x56c6('0x48')]=AGIChannel; \ No newline at end of file diff --git a/server/services/agi/error.js b/server/services/agi/error.js index 2ef52f7..16c7a62 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 _0x873e=['Server\x20closed.','[LICENSE\x20VOICE]\x20Server\x20license\x20voice\x20disabled.','Socket\x20closed.','Socket\x20timeout.','Empty\x20command.','Missing\x20\x27ivr.agi_network_script\x27.','push','format','apply','message','name','exports','util','Argument\x20\x27port\x27\x20missing\x20in\x20function\x20call.','Server\x20error.\x20Code:\x20%s.'];(function(_0x35748b,_0x27f885){var _0x544082=function(_0x5074c7){while(--_0x5074c7){_0x35748b['push'](_0x35748b['shift']());}};_0x544082(++_0x27f885);}(_0x873e,0xc0));var _0xe873=function(_0x219b13,_0x28c391){_0x219b13=_0x219b13-0x0;var _0x19cd91=_0x873e[_0x219b13];return _0x19cd91;};'use strict';var util=require(_0xe873('0x0'));var error={'E_AGI_UNDEFINED':'Undefined\x20error.','E_AGI_ARGUMENT_PORT':_0xe873('0x1'),'E_AGI_SERVER_ERROR':_0xe873('0x2'),'E_AGI_SERVER_CLOSE':_0xe873('0x3'),'E_AGI_SERVER_MAXCONNECTION':'[LICENSE]\x20Server\x20max\x20connection.\x20Count:\x20%s.','E_AGI_SERVER_VOICE_DISABLED':_0xe873('0x4'),'E_AGI_SOCKET_ERROR':'Socket\x20error.\x20Code:\x20%s.','E_AGI_SOCKET_CLOSE':_0xe873('0x5'),'E_AGI_SOCKET_TIMEOUT':_0xe873('0x6'),'E_AGI_COMMAND_EMPTY':_0xe873('0x7'),'E_AGI_IVR_AGI_NETWORK_SCRIPT':_0xe873('0x8'),'E_AGI_IVR_ENTRY':'Missing\x20\x27ivr.entry\x27\x20menu.'};function AGIError(_0x52c711){var _0x52c711=_0x52c711||null,_0x31377a=_0x31377a||[],_0x29b1e5=0x1,_0x1f3c72='';if(!error[_0x52c711]){_0x52c711='E_AGI_UNDEFINED';}_0x31377a['push'](error[_0x52c711]);while(arguments[_0x29b1e5]){_0x31377a[_0xe873('0x9')](arguments[_0x29b1e5]);_0x29b1e5++;}_0x1f3c72=util[_0xe873('0xa')][_0xe873('0xb')](util,_0x31377a);this[_0xe873('0xc')]=_0x1f3c72;this[_0xe873('0xd')]=_0x52c711;}module[_0xe873('0xe')]=AGIError; \ No newline at end of file +var _0x35fe=['Socket\x20error.\x20Code:\x20%s.','Socket\x20closed.','Socket\x20timeout.','Empty\x20command.','Missing\x20\x27ivr.agi_network_script\x27.','Missing\x20\x27ivr.entry\x27\x20menu.','push','message','name','exports','util','Undefined\x20error.','Argument\x20\x27port\x27\x20missing\x20in\x20function\x20call.','Server\x20error.\x20Code:\x20%s.'];(function(_0x2d513f,_0x126f93){var _0x2488c3=function(_0x59599c){while(--_0x59599c){_0x2d513f['push'](_0x2d513f['shift']());}};_0x2488c3(++_0x126f93);}(_0x35fe,0x106));var _0xe35f=function(_0x710815,_0x520da8){_0x710815=_0x710815-0x0;var _0x5b3b89=_0x35fe[_0x710815];return _0x5b3b89;};'use strict';var util=require(_0xe35f('0x0'));var error={'E_AGI_UNDEFINED':_0xe35f('0x1'),'E_AGI_ARGUMENT_PORT':_0xe35f('0x2'),'E_AGI_SERVER_ERROR':_0xe35f('0x3'),'E_AGI_SERVER_CLOSE':'Server\x20closed.','E_AGI_SERVER_MAXCONNECTION':'[LICENSE]\x20Server\x20max\x20connection.\x20Count:\x20%s.','E_AGI_SERVER_VOICE_DISABLED':'[LICENSE\x20VOICE]\x20Server\x20license\x20voice\x20disabled.','E_AGI_SOCKET_ERROR':_0xe35f('0x4'),'E_AGI_SOCKET_CLOSE':_0xe35f('0x5'),'E_AGI_SOCKET_TIMEOUT':_0xe35f('0x6'),'E_AGI_COMMAND_EMPTY':_0xe35f('0x7'),'E_AGI_IVR_AGI_NETWORK_SCRIPT':_0xe35f('0x8'),'E_AGI_IVR_ENTRY':_0xe35f('0x9')};function AGIError(_0x4144d2){var _0x4144d2=_0x4144d2||null,_0x2ca795=_0x2ca795||[],_0xb5ab22=0x1,_0x441c0d='';if(!error[_0x4144d2]){_0x4144d2='E_AGI_UNDEFINED';}_0x2ca795['push'](error[_0x4144d2]);while(arguments[_0xb5ab22]){_0x2ca795[_0xe35f('0xa')](arguments[_0xb5ab22]);_0xb5ab22++;}_0x441c0d=util['format']['apply'](util,_0x2ca795);this[_0xe35f('0xb')]=_0x441c0d;this[_0xe35f('0xc')]=_0x4144d2;}module[_0xe35f('0xd')]=AGIError; \ No newline at end of file diff --git a/server/services/agi/events.js b/server/services/agi/events.js index d319efe..d61037c 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 _0x7a81=['error','E_AGI_SERVER_ERROR','parse','exports','lodash','events','EventEmitter','./error','../../config/environment','redis','localhost','subscribe','agi','emit'];(function(_0x286e97,_0x300e06){var _0x126fa9=function(_0x513e98){while(--_0x513e98){_0x286e97['push'](_0x286e97['shift']());}};_0x126fa9(++_0x300e06);}(_0x7a81,0xba));var _0x17a8=function(_0x3be791,_0x1c6814){_0x3be791=_0x3be791-0x0;var _0x5d2401=_0x7a81[_0x3be791];return _0x5d2401;};'use strict';var _=require(_0x17a8('0x0'));var EventEmitter=require(_0x17a8('0x1'))[_0x17a8('0x2')];var Redis=require('ioredis');var AGIError=require(_0x17a8('0x3'));var config=require(_0x17a8('0x4'));config[_0x17a8('0x5')]=_['defaults'](config['redis'],{'host':_0x17a8('0x6'),'port':0x18eb});var eventEmitter=new EventEmitter();var sub=new Redis(config[_0x17a8('0x5')]);sub[_0x17a8('0x7')](_0x17a8('0x8'),function(_0x2c2da1){if(_0x2c2da1)return eventEmitter[_0x17a8('0x9')](_0x17a8('0xa'),new AGIError(_0x17a8('0xb'),_0x2c2da1));});sub['on']('message',function(_0x1343eb,_0xfd6aab){if(_0x1343eb!=='agi')return;try{var _0x3477f7=JSON[_0x17a8('0xc')](_0xfd6aab);eventEmitter['emit']('projectUpdate',_0x3477f7);}catch(_0x353ae8){eventEmitter['emit'](_0x17a8('0xa'),new AGIError('E_AGI_SERVER_ERROR',_0x353ae8));}});module[_0x17a8('0xd')]={'EventEmitter':eventEmitter}; \ No newline at end of file +var _0x2eda=['lodash','events','ioredis','./error','defaults','redis','localhost','subscribe','emit','error','E_AGI_SERVER_ERROR','message','agi','parse','projectUpdate','exports'];(function(_0x204ec3,_0x1c96d8){var _0xc79355=function(_0x121b33){while(--_0x121b33){_0x204ec3['push'](_0x204ec3['shift']());}};_0xc79355(++_0x1c96d8);}(_0x2eda,0x70));var _0xa2ed=function(_0x2e864c,_0xbd87b3){_0x2e864c=_0x2e864c-0x0;var _0xda95ca=_0x2eda[_0x2e864c];return _0xda95ca;};'use strict';var _=require(_0xa2ed('0x0'));var EventEmitter=require(_0xa2ed('0x1'))['EventEmitter'];var Redis=require(_0xa2ed('0x2'));var AGIError=require(_0xa2ed('0x3'));var config=require('../../config/environment');config['redis']=_[_0xa2ed('0x4')](config[_0xa2ed('0x5')],{'host':_0xa2ed('0x6'),'port':0x18eb});var eventEmitter=new EventEmitter();var sub=new Redis(config[_0xa2ed('0x5')]);sub[_0xa2ed('0x7')]('agi',function(_0x28906f){if(_0x28906f)return eventEmitter[_0xa2ed('0x8')](_0xa2ed('0x9'),new AGIError(_0xa2ed('0xa'),_0x28906f));});sub['on'](_0xa2ed('0xb'),function(_0x380ecd,_0x41b24a){if(_0x380ecd!==_0xa2ed('0xc'))return;try{var _0x52922c=JSON[_0xa2ed('0xd')](_0x41b24a);eventEmitter[_0xa2ed('0x8')](_0xa2ed('0xe'),_0x52922c);}catch(_0x5b51b6){eventEmitter[_0xa2ed('0x8')](_0xa2ed('0x9'),new AGIError(_0xa2ed('0xa'),_0x5b51b6));}});module[_0xa2ed('0xf')]={'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 4acd6c5..24ac44e 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 _0x0e40=['no\x20vertex\x20found','length','condition','split','agicommand','vswitch','target','invalid','default\x20on\x20switch\x20not\x20found','max\x20retry\x20reach','condition\x20not\x20found','exports','../../../config/logger','agi','menu','getdigits','getsecretdigits','vertices','edges','numberOfEdges','prototype','addEdge','push','size','getVertex','traverseBFS','info'];(function(_0x5b070b,_0x4a45b2){var _0x252df3=function(_0x340cb6){while(--_0x340cb6){_0x5b070b['push'](_0x5b070b['shift']());}};_0x252df3(++_0x4a45b2);}(_0x0e40,0x1bc));var _0x00e4=function(_0x1a3237,_0xd69b2e){_0x1a3237=_0x1a3237-0x0;var _0x3a7261=_0x0e40[_0x1a3237];return _0x3a7261;};'use strict';var _=require('lodash');var logger=require(_0x00e4('0x0'))(_0x00e4('0x1'));var verticesWithRetry=[_0x00e4('0x2'),_0x00e4('0x3'),_0x00e4('0x4')];var Graph=function(){this[_0x00e4('0x5')]={};this[_0x00e4('0x6')]={};this[_0x00e4('0x7')]=0x0;};Graph[_0x00e4('0x8')]['addVertex']=function(_0x1df772){this[_0x00e4('0x5')][_0x1df772['id']]=_0x1df772;this[_0x00e4('0x6')][_0x1df772['id']]=[];};Graph['prototype'][_0x00e4('0x9')]=function(_0x902dc3,_0x23859e,_0x9de447){this[_0x00e4('0x6')][_0x902dc3][_0x00e4('0xa')]({'target':_0x23859e,'condition':_0x9de447});this['numberOfEdges']+=0x1;};Graph['prototype']['size']=function(){return _[_0x00e4('0xb')](this[_0x00e4('0x5')]);};Graph[_0x00e4('0x8')]['relations']=function(){return this[_0x00e4('0x7')];};Graph[_0x00e4('0x8')][_0x00e4('0xc')]=function(_0x532e4b){return this['vertices'][_0x532e4b];};Graph[_0x00e4('0x8')][_0x00e4('0xd')]=function(_0x56c0b9,_0x4e9813){if(!this[_0x00e4('0x5')][_0x56c0b9]){return logger[_0x00e4('0xe')](_0x00e4('0xf'));}var _0x31e974=_0x4e9813(this[_0x00e4('0x5')][_0x56c0b9]);if(!_0x31e974){return logger[_0x00e4('0xe')]('stop\x20traverse');}if(this['edges'][_0x56c0b9][_0x00e4('0x10')]===0x0){return logger[_0x00e4('0xe')]('no\x20edge/s\x20available');}for(var _0x3ce014=0x0,_0x494a64=[],_0xb6a180=![];_0x3ce014\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s','arg_1','calleridname','dnid','uniqueid','[TIMEOUT]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s','callerid','catch','indexOf','agi_','substring','debug','stringify','[START]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s','close','timeout','evtHangup','hangup','name','handleNotFound','production','handleUnpublished','initialize','then','voice','callysquare','[LICENSE]\x20CHANNELS:\x20%s','[LICENSE]\x20VOICE\x20IS\x20DISABLED','getAll','[LICENSE]','finally','./server','listening','lodash','util','../../config/environment','../../config/logger','agi','./events','EventEmitter','nextTick','error','stack','findIndex','deleted','push','log'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0x748a,0x1bd));var _0xa748=function(_0xfae23b,_0x2be4ba){_0xfae23b=_0xfae23b-0x0;var _0x200640=_0x748a[_0xfae23b];return _0x200640;};'use strict';var _=require(_0xa748('0x0'));var syncho=require('syncho');var util=require(_0xa748('0x1'));var config=require(_0xa748('0x2'));var logger=require(_0xa748('0x3'))(_0xa748('0x4'));var utilLicense=require('../../config/license/util');var rpc=require('./rpc');var Project=require('./project');var AGIEmitter=require(_0xa748('0x5'))[_0xa748('0x6')];var projects=[];config[_0xa748('0x4')]=_['defaults'](config[_0xa748('0x4')],{'ip':'127.0.0.1','port':0x11dd});AGIEmitter['on']('projectUpdate',projectUpdateHandler);function connectionHandler(_0x3d4846){process[_0xa748('0x7')](function(){syncho(function(){try{setChannelVariables(_0x3d4846);agiHandler(_0x3d4846);}catch(_0x531efa){logger[_0xa748('0x8')](_0x531efa[_0xa748('0x9')]);}});});}function projectUpdateHandler(_0x513f02){try{var _0x5011f8=_[_0xa748('0xa')](projects,['id',_0x513f02['id']]);if(_0x5011f8>-0x1){if(_0x513f02[_0xa748('0xb')]===!![]){projects['splice'](_0x5011f8,0x1);}else{projects[_0x5011f8]=_0x513f02;}}else{projects[_0xa748('0xc')](_0x513f02);}}catch(_0x3d7923){logger[_0xa748('0x8')](_0x3d7923['stack']);}}function listeningHandler(){console[_0xa748('0xd')]('Cally\x20Square\x20server\x20listening\x20on\x20port\x20%d!',config[_0xa748('0x4')][_0xa748('0xe')]);logger[_0xa748('0xf')](util[_0xa748('0x10')]('[LISTENING]\x20Cally\x20Square\x20listening\x20%s:%d',config[_0xa748('0x4')]['ip'],config[_0xa748('0x4')][_0xa748('0xe')]));}function errorHandler(_0x3691f8){if(_0x3691f8&&_0x3691f8['name']&&_0x3691f8[_0xa748('0x11')]){logger['error'](util['format']('[%s]\x20%s',_0x3691f8['name'],_0x3691f8[_0xa748('0x11')]));}else{logger[_0xa748('0x8')](util[_0xa748('0x10')]('[ERROR]\x20%s',_0x3691f8[_0xa748('0x9')]));}}function closeHandler(){logger[_0xa748('0xf')](util[_0xa748('0x10')](_0xa748('0x12'),this[_0xa748('0x13')],this[_0xa748('0x14')],this['callerid'],this[_0xa748('0x15')],this[_0xa748('0x16')]));try{createSquareReport(this);}catch(_0x1ecad7){logger[_0xa748('0x8')](_0x1ecad7[_0xa748('0x9')]);}}function timeoutHandler(){logger[_0xa748('0xf')](util['format'](_0xa748('0x17'),this['arg_1'],this[_0xa748('0x14')],this[_0xa748('0x18')],this[_0xa748('0x15')],this[_0xa748('0x16')]));}function hangupHandler(){logger[_0xa748('0xf')](util[_0xa748('0x10')]('[HANGUP]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s',this[_0xa748('0x13')],this[_0xa748('0x14')],this[_0xa748('0x18')],this[_0xa748('0x15')],this[_0xa748('0x16')]));this['evtHangup']=!![];}function createSquareReport(_0x444383,_0x42ac81){rpc['createSquareReport'](_0x444383)['then'](function(_0x1b156c){if(_0x42ac81){_0x42ac81(null,_0x1b156c);}})[_0xa748('0x19')](function(_0x522bf3){if(_0x42ac81){_0x42ac81(null,_0x522bf3);}});}function setChannelVariables(_0x41f4e4){for(var _0x4b9ec2 in _0x41f4e4){if(_0x41f4e4['hasOwnProperty'](_0x4b9ec2)){if(_0x4b9ec2[_0xa748('0x1a')](_0xa748('0x1b'))===0x0){_0x41f4e4[_0x4b9ec2[_0xa748('0x1c')](0x4)]=_0x41f4e4[_0x4b9ec2];delete _0x41f4e4[_0x4b9ec2];}}}}function agiHandler(_0x520aef){logger[_0xa748('0x1d')]('variables',JSON[_0xa748('0x1e')](_0x520aef,null,0x2));logger['info'](util[_0xa748('0x10')](_0xa748('0x1f'),_0x520aef[_0xa748('0x13')],_0x520aef[_0xa748('0x14')],_0x520aef[_0xa748('0x18')],_0x520aef['dnid'],_0x520aef[_0xa748('0x16')]));_0x520aef['on'](_0xa748('0x8'),errorHandler);_0x520aef['on'](_0xa748('0x20'),closeHandler);_0x520aef['on'](_0xa748('0x21'),timeoutHandler);_0x520aef[_0xa748('0x22')]=![];_0x520aef['on'](_0xa748('0x23'),hangupHandler);var _0x5ab3b9=_['find'](projects,[_0xa748('0x24'),_0x520aef['arg_1']]);if(!_0x5ab3b9)return Project[_0xa748('0x25')](_0x520aef);if(!_0x5ab3b9[_0xa748('0x26')])return Project[_0xa748('0x27')](_0x520aef);return Project[_0xa748('0x28')](_0x5ab3b9,_0x520aef);}function main(){var _0x404258;return utilLicense['getLicense']()[_0xa748('0x29')](function(_0x9794d7){if(!_0x9794d7)return;if(_0x9794d7[_0xa748('0x2a')]){if(_0x9794d7[_0xa748('0x2b')]&&_0x9794d7[_0xa748('0x2b')]>0x0){logger[_0xa748('0xf')](util['format'](_0xa748('0x2c'),_0x9794d7[_0xa748('0x2b')]));_0x404258=_0x9794d7[_0xa748('0x2b')];}else{logger[_0xa748('0xf')]('[LICENSE]\x20CHANNELS:\x20UNLIMITED');}}else{logger['info'](_0xa748('0x2d'));_0x404258=-0x1;}})[_0xa748('0x29')](function(){return Project[_0xa748('0x2e')]();})[_0xa748('0x29')](function(_0x148446){projects=_0x148446;return;})['catch'](function(_0x211314){logger[_0xa748('0x8')](_0xa748('0x2f'),_0x211314['stack']);})[_0xa748('0x30')](function(){var _0x4b6071=require(_0xa748('0x31'))(config['agi'][_0xa748('0xe')],config[_0xa748('0x4')]['ip'],_0x404258);_0x4b6071['on'](_0xa748('0x8'),errorHandler);_0x4b6071['on'](_0xa748('0x32'),listeningHandler);_0x4b6071['on']('connection',connectionHandler);_0x4b6071['on'](_0xa748('0x20'),closeHandler);});}main(); \ No newline at end of file +var _0x5bf8=['dnid','uniqueid','[TIMEOUT]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s','[HANGUP]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s','calleridname','evtHangup','createSquareReport','then','catch','hasOwnProperty','agi_','debug','variables','stringify','[START]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s','close','timeout','find','handleNotFound','production','handleUnpublished','initialize','getLicense','voice','callysquare','[LICENSE]\x20CHANNELS:\x20%s','[LICENSE]\x20VOICE\x20IS\x20DISABLED','getAll','[LICENSE]','finally','connection','lodash','syncho','util','../../config/logger','agi','../../config/license/util','./rpc','./project','./events','defaults','projectUpdate','nextTick','error','stack','deleted','splice','push','log','port','info','format','[LISTENING]\x20Cally\x20Square\x20listening\x20%s:%d','name','message','[ERROR]\x20%s','[CLOSE]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s','arg_1','callerid'];(function(_0x48d3fc,_0x3b120f){var _0x4905c6=function(_0x214812){while(--_0x214812){_0x48d3fc['push'](_0x48d3fc['shift']());}};_0x4905c6(++_0x3b120f);}(_0x5bf8,0x146));var _0x85bf=function(_0x34a6e9,_0x25cabe){_0x34a6e9=_0x34a6e9-0x0;var _0x11015c=_0x5bf8[_0x34a6e9];return _0x11015c;};'use strict';var _=require(_0x85bf('0x0'));var syncho=require(_0x85bf('0x1'));var util=require(_0x85bf('0x2'));var config=require('../../config/environment');var logger=require(_0x85bf('0x3'))(_0x85bf('0x4'));var utilLicense=require(_0x85bf('0x5'));var rpc=require(_0x85bf('0x6'));var Project=require(_0x85bf('0x7'));var AGIEmitter=require(_0x85bf('0x8'))['EventEmitter'];var projects=[];config['agi']=_[_0x85bf('0x9')](config[_0x85bf('0x4')],{'ip':'127.0.0.1','port':0x11dd});AGIEmitter['on'](_0x85bf('0xa'),projectUpdateHandler);function connectionHandler(_0x4206c8){process[_0x85bf('0xb')](function(){syncho(function(){try{setChannelVariables(_0x4206c8);agiHandler(_0x4206c8);}catch(_0x2bc6b4){logger[_0x85bf('0xc')](_0x2bc6b4[_0x85bf('0xd')]);}});});}function projectUpdateHandler(_0x1acc66){try{var _0x5e257d=_['findIndex'](projects,['id',_0x1acc66['id']]);if(_0x5e257d>-0x1){if(_0x1acc66[_0x85bf('0xe')]===!![]){projects[_0x85bf('0xf')](_0x5e257d,0x1);}else{projects[_0x5e257d]=_0x1acc66;}}else{projects[_0x85bf('0x10')](_0x1acc66);}}catch(_0x23efce){logger[_0x85bf('0xc')](_0x23efce[_0x85bf('0xd')]);}}function listeningHandler(){console[_0x85bf('0x11')]('Cally\x20Square\x20server\x20listening\x20on\x20port\x20%d!',config[_0x85bf('0x4')][_0x85bf('0x12')]);logger[_0x85bf('0x13')](util[_0x85bf('0x14')](_0x85bf('0x15'),config[_0x85bf('0x4')]['ip'],config[_0x85bf('0x4')][_0x85bf('0x12')]));}function errorHandler(_0x3b78ff){if(_0x3b78ff&&_0x3b78ff[_0x85bf('0x16')]&&_0x3b78ff[_0x85bf('0x17')]){logger[_0x85bf('0xc')](util[_0x85bf('0x14')]('[%s]\x20%s',_0x3b78ff[_0x85bf('0x16')],_0x3b78ff[_0x85bf('0x17')]));}else{logger[_0x85bf('0xc')](util['format'](_0x85bf('0x18'),_0x3b78ff[_0x85bf('0xd')]));}}function closeHandler(){logger[_0x85bf('0x13')](util['format'](_0x85bf('0x19'),this[_0x85bf('0x1a')],this['calleridname'],this[_0x85bf('0x1b')],this[_0x85bf('0x1c')],this[_0x85bf('0x1d')]));try{createSquareReport(this);}catch(_0x1daa04){logger[_0x85bf('0xc')](_0x1daa04[_0x85bf('0xd')]);}}function timeoutHandler(){logger['info'](util[_0x85bf('0x14')](_0x85bf('0x1e'),this[_0x85bf('0x1a')],this['calleridname'],this[_0x85bf('0x1b')],this['dnid'],this[_0x85bf('0x1d')]));}function hangupHandler(){logger[_0x85bf('0x13')](util[_0x85bf('0x14')](_0x85bf('0x1f'),this[_0x85bf('0x1a')],this[_0x85bf('0x20')],this[_0x85bf('0x1b')],this['dnid'],this[_0x85bf('0x1d')]));this[_0x85bf('0x21')]=!![];}function createSquareReport(_0x16ac11,_0xeac186){rpc[_0x85bf('0x22')](_0x16ac11)[_0x85bf('0x23')](function(_0x51896c){if(_0xeac186){_0xeac186(null,_0x51896c);}})[_0x85bf('0x24')](function(_0x3282ec){if(_0xeac186){_0xeac186(null,_0x3282ec);}});}function setChannelVariables(_0x56bd4d){for(var _0x1a4e2d in _0x56bd4d){if(_0x56bd4d[_0x85bf('0x25')](_0x1a4e2d)){if(_0x1a4e2d['indexOf'](_0x85bf('0x26'))===0x0){_0x56bd4d[_0x1a4e2d['substring'](0x4)]=_0x56bd4d[_0x1a4e2d];delete _0x56bd4d[_0x1a4e2d];}}}}function agiHandler(_0x2eacdd){logger[_0x85bf('0x27')](_0x85bf('0x28'),JSON[_0x85bf('0x29')](_0x2eacdd,null,0x2));logger[_0x85bf('0x13')](util[_0x85bf('0x14')](_0x85bf('0x2a'),_0x2eacdd[_0x85bf('0x1a')],_0x2eacdd['calleridname'],_0x2eacdd[_0x85bf('0x1b')],_0x2eacdd[_0x85bf('0x1c')],_0x2eacdd[_0x85bf('0x1d')]));_0x2eacdd['on']('error',errorHandler);_0x2eacdd['on'](_0x85bf('0x2b'),closeHandler);_0x2eacdd['on'](_0x85bf('0x2c'),timeoutHandler);_0x2eacdd['evtHangup']=![];_0x2eacdd['on']('hangup',hangupHandler);var _0x3446bb=_[_0x85bf('0x2d')](projects,[_0x85bf('0x16'),_0x2eacdd[_0x85bf('0x1a')]]);if(!_0x3446bb)return Project[_0x85bf('0x2e')](_0x2eacdd);if(!_0x3446bb[_0x85bf('0x2f')])return Project[_0x85bf('0x30')](_0x2eacdd);return Project[_0x85bf('0x31')](_0x3446bb,_0x2eacdd);}function main(){var _0x3bf157;return utilLicense[_0x85bf('0x32')]()[_0x85bf('0x23')](function(_0x37da78){if(!_0x37da78)return;if(_0x37da78[_0x85bf('0x33')]){if(_0x37da78[_0x85bf('0x34')]&&_0x37da78['callysquare']>0x0){logger['info'](util[_0x85bf('0x14')](_0x85bf('0x35'),_0x37da78[_0x85bf('0x34')]));_0x3bf157=_0x37da78['callysquare'];}else{logger[_0x85bf('0x13')]('[LICENSE]\x20CHANNELS:\x20UNLIMITED');}}else{logger['info'](_0x85bf('0x36'));_0x3bf157=-0x1;}})[_0x85bf('0x23')](function(){return Project[_0x85bf('0x37')]();})['then'](function(_0x904f91){projects=_0x904f91;return;})[_0x85bf('0x24')](function(_0x343130){logger[_0x85bf('0xc')](_0x85bf('0x38'),_0x343130['stack']);})[_0x85bf('0x39')](function(){var _0x5b2474=require('./server')(config[_0x85bf('0x4')][_0x85bf('0x12')],config[_0x85bf('0x4')]['ip'],_0x3bf157);_0x5b2474['on'](_0x85bf('0xc'),errorHandler);_0x5b2474['on']('listening',listeningHandler);_0x5b2474['on'](_0x85bf('0x3a'),connectionHandler);_0x5b2474['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 43d296b..621cada 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 _0x7c80=['http','request','then','error','result','catch','SendMail','bluebird','jayson/promise'];(function(_0x4ef555,_0x50d48a){var _0x2ad0ef=function(_0x2b7c77){while(--_0x2b7c77){_0x4ef555['push'](_0x4ef555['shift']());}};_0x2ad0ef(++_0x50d48a);}(_0x7c80,0x14b));var _0x07c8=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x7c80[_0x3dd15e];return _0x231fd0;};'use strict';var BPromise=require(_0x07c8('0x0'));var jayson=require(_0x07c8('0x1'));var client=jayson['client'][_0x07c8('0x2')]({'port':0x232b});function request(_0x3a8c08,_0x1f37fa){return new BPromise(function(_0x5d3f88,_0x4d84a0){return client[_0x07c8('0x3')](_0x3a8c08,_0x1f37fa)[_0x07c8('0x4')](function(_0x571fc5){if(_0x571fc5[_0x07c8('0x5')]){return _0x4d84a0(_0x571fc5[_0x07c8('0x5')]['message']);}else{return _0x5d3f88(_0x571fc5[_0x07c8('0x6')]);}})[_0x07c8('0x7')](function(_0x1b7928){return _0x4d84a0(_0x1b7928);});});}exports['sendMailMessage']=function(_0x361e88,_0x2b0ec6){return request(_0x07c8('0x8'),{'account':_0x361e88,'message':_0x2b0ec6});}; \ No newline at end of file +var _0xd99c=['SendMail','jayson/promise','client','request','then','error','message','result','catch','sendMailMessage'];(function(_0x3a83c8,_0x489ffd){var _0x5c89db=function(_0x35a94a){while(--_0x35a94a){_0x3a83c8['push'](_0x3a83c8['shift']());}};_0x5c89db(++_0x489ffd);}(_0xd99c,0xc9));var _0xcd99=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xd99c[_0x3dd15e];return _0x231fd0;};'use strict';var BPromise=require('bluebird');var jayson=require(_0xcd99('0x0'));var client=jayson[_0xcd99('0x1')]['http']({'port':0x232b});function request(_0xa66130,_0x26b920){return new BPromise(function(_0x5ad3ff,_0x2d79a0){return client[_0xcd99('0x2')](_0xa66130,_0x26b920)[_0xcd99('0x3')](function(_0x1cb49b){if(_0x1cb49b[_0xcd99('0x4')]){return _0x2d79a0(_0x1cb49b[_0xcd99('0x4')][_0xcd99('0x5')]);}else{return _0x5ad3ff(_0x1cb49b[_0xcd99('0x6')]);}})[_0xcd99('0x7')](function(_0x5d1fff){return _0x2d79a0(_0x5d1fff);});});}exports[_0xcd99('0x8')]=function(_0x43a26b,_0x55068b){return request(_0xcd99('0x9'),{'account':_0x43a26b,'message':_0x55068b});}; \ No newline at end of file diff --git a/server/services/agi/project.js b/server/services/agi/project.js index 22bd908..e5f85ed 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 _0x888e=['./rpc','./mailRpc','./graph','./vertices','getSquareProjects','catch','error','Unable\x20to\x20download\x20CallySquare\x20projects','stack','agicommand','hasOwnProperty','retry','maxRetry','omit','length','source','target','value','mxGraphModel','root','production','start','debug','joinAt','format','mxCell','info','[START\x20TRAVERSE]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s','arg_1','dnid','uniqueid','traverseBFS','clear','vertex','gotoc','gotoc\x20block\x20stop\x20traverse\x20BFS','context','extension','priority','stringify','code','result','evtHangup','response','isUndefined','toString','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','[GOTO]\x20context:\x20%s\x20extension:\x20%s\x20priority:\x20%s','continueAt','Project\x20%s\x20not\x20found','close','exports','lodash','moment','xml2json','util','../../config/logger','agi'];(function(_0x2bc3f4,_0x470b26){var _0x14ac53=function(_0x5121bd){while(--_0x5121bd){_0x2bc3f4['push'](_0x2bc3f4['shift']());}};_0x14ac53(++_0x470b26);}(_0x888e,0x1ac));var _0xe888=function(_0x1d705d,_0x1a51ea){_0x1d705d=_0x1d705d-0x0;var _0x3221f4=_0x888e[_0x1d705d];return _0x3221f4;};'use strict';var _=require(_0xe888('0x0'));var moment=require(_0xe888('0x1'));var parser=require(_0xe888('0x2'));var util=require(_0xe888('0x3'));var logger=require(_0xe888('0x4'))(_0xe888('0x5'));var rpc=require(_0xe888('0x6'));var mailRpc=require(_0xe888('0x7'));var Graph=require(_0xe888('0x8'));var Vertices=require(_0xe888('0x9'));var AGI_CODE_SUCCESS=0xc8;var AGI_RESULT_ERROR=-0x1;function getAll(){return rpc[_0xe888('0xa')]()[_0xe888('0xb')](function(_0x32194){logger[_0xe888('0xc')](_0xe888('0xd'),_0x32194[_0xe888('0xe')]);return[];});}function addVertex(_0x3a086e,_0x27094e,_0x33bfd4){_0x27094e[_0xe888('0xf')]=_0x33bfd4;if(_0x27094e[_0xe888('0x10')](_0xe888('0x11'))){_0x27094e[_0xe888('0x12')]=parseInt(_0x27094e[_0xe888('0x11')],0xa);}_0x3a086e['addVertex'](_[_0xe888('0x13')](_0x27094e,'mxCell'));}function initGraph(_0x105b19,_0x2b1778){var _0x4f9722=new Graph();for(var _0x4a8374 in _0x105b19){if(_0x105b19[_0xe888('0x10')](_0x4a8374)){if(_['isArray'](_0x105b19[_0x4a8374])){for(var _0x4e2fcb=0x0;_0x4e2fcb<_0x105b19[_0x4a8374]['length'];_0x4e2fcb+=0x1){addVertex(_0x4f9722,_0x105b19[_0x4a8374][_0x4e2fcb],_0x4a8374);}}else{addVertex(_0x4f9722,_0x105b19[_0x4a8374],_0x4a8374);}}}for(var _0x239775=0x0;_0x239775<_0x2b1778[_0xe888('0x14')];_0x239775+=0x1){if(_0x2b1778[_0x239775][_0xe888('0x15')]&&_0x2b1778[_0x239775]['target']){_0x4f9722['addEdge'](_0x2b1778[_0x239775]['source'],_0x2b1778[_0x239775][_0xe888('0x16')],_0x2b1778[_0x239775][_0xe888('0x17')]);}}return _0x4f9722;}function getRoot(_0x4418ff){return parser['toJson'](_0x4418ff,{'object':!![]})[_0xe888('0x18')][_0xe888('0x19')];}function inspect(_0x142b4a){return util['inspect'](_0x142b4a,{'showHidden':![],'depth':null});}function initialize(_0x88421b,_0x49505b){var _0xd059ea=getRoot(_0x88421b[_0xe888('0x1a')]);if(!_0xd059ea||!_0xd059ea[_0xe888('0x1b')])return;var _0x127d7e,_0x3291b7,_0x5679e8;logger[_0xe888('0x1c')](_0xe888('0x19'),JSON['stringify'](_0xd059ea,null,0x2));_0x49505b[_0xe888('0x1d')]=moment()[_0xe888('0x1e')]('YYYY-MM-DD\x20HH:mm:ss');_0x127d7e=initGraph(_['omit'](_0xd059ea,_0xe888('0x1f')),_0xd059ea['mxCell']);_0x3291b7=new Vertices(_0x49505b,rpc,mailRpc);logger[_0xe888('0x20')](util['format'](_0xe888('0x21'),_0x49505b[_0xe888('0x22')],_0x49505b['calleridname'],_0x49505b['callerid'],_0x49505b[_0xe888('0x23')],_0x49505b[_0xe888('0x24')]));_0x127d7e[_0xe888('0x25')](_0xd059ea[_0xe888('0x1b')]['id'],function(_0x35fc4c){try{_0x35fc4c=_0x3291b7[_0xe888('0x26')](_0x35fc4c);logger['debug'](_0xe888('0x27'),JSON['stringify'](_0x35fc4c,null,0x2));if(_0x35fc4c['agicommand']===_0xe888('0x28')){logger[_0xe888('0x20')](_0xe888('0x29'));_0x49505b[_0xe888('0x2a')]=_0x35fc4c['context']||_0x49505b['context'];_0x49505b[_0xe888('0x2b')]=_0x35fc4c['extension'];_0x49505b[_0xe888('0x2c')]=_0x35fc4c['priority']?_0x35fc4c[_0xe888('0x2c')]-0x1:0x1;return null;}else if(_0x35fc4c&&_0x3291b7[_0x35fc4c[_0xe888('0xf')]]){_0x5679e8=_0x3291b7[_0x35fc4c[_0xe888('0xf')]](_0x35fc4c);logger[_0xe888('0x20')]('response',JSON[_0xe888('0x2d')](_0x5679e8,null,0x2));if(_0x5679e8&&_0x5679e8[_0xe888('0x2e')]===AGI_CODE_SUCCESS&&_0x5679e8[_0xe888('0x2f')]!==AGI_RESULT_ERROR&&!_0x49505b[_0xe888('0x30')]){logger[_0xe888('0x1c')](_0xe888('0x31'),inspect(_0x5679e8));return _[_0xe888('0x32')](_0x5679e8[_0xe888('0x2f')])?null:_0x5679e8[_0xe888('0x2f')][_0xe888('0x33')]();}else{logger[_0xe888('0xc')]('response',inspect(_0x5679e8));return null;}}else{logger[_0xe888('0xc')](_0xe888('0x34'));return null;}}catch(_0x262210){logger[_0xe888('0xc')](_0x262210[_0xe888('0xe')]);return null;}});if(_0xd059ea[_0xe888('0x35')]){logger[_0xe888('0x20')](util['format'](_0xe888('0x36'),_0x49505b[_0xe888('0x22')],_0x49505b[_0xe888('0x37')],_0x49505b['callerid'],_0x49505b[_0xe888('0x23')],_0x49505b['uniqueid']));_0x127d7e['traverseBFS'](_0xd059ea[_0xe888('0x35')]['id'],function(_0x3628d2){try{_0x3628d2=_0x3291b7[_0xe888('0x26')](_0x3628d2);logger[_0xe888('0x1c')](_0xe888('0x27'),JSON[_0xe888('0x2d')](_0x3628d2,null,0x2));if(_0x3628d2&&_0x3291b7[_0x3628d2[_0xe888('0xf')]]){_0x5679e8=_0x3291b7[_0x3628d2[_0xe888('0xf')]](_0x3628d2);if(_0x5679e8){logger[_0xe888('0x1c')](_0xe888('0x31'),inspect(_0x5679e8));return _[_0xe888('0x32')](_0x5679e8[_0xe888('0x2f')])?null:_0x5679e8[_0xe888('0x2f')][_0xe888('0x33')]();}else{logger[_0xe888('0xc')]('response',inspect(_0x5679e8));return null;}}else{logger['error'](_0xe888('0x34'));return null;}}catch(_0x2634b6){logger[_0xe888('0xc')](_0x2634b6[_0xe888('0xe')]);return null;}});}logger['info'](util[_0xe888('0x1e')](_0xe888('0x38'),_0x49505b[_0xe888('0x22')],_0x49505b[_0xe888('0x37')],_0x49505b['callerid'],_0x49505b[_0xe888('0x23')],_0x49505b[_0xe888('0x24')]));logger[_0xe888('0x20')](util[_0xe888('0x1e')](_0xe888('0x39'),_0x49505b['context'],_0x49505b['extension'],parseInt(_0x49505b[_0xe888('0x2c')],0xa)+0x1));_0x49505b[_0xe888('0x3a')](_0x49505b[_0xe888('0x2a')],_0x49505b[_0xe888('0x2b')],parseInt(_0x49505b['priority'],0xa)+0x1);_0x49505b['close']();}function handleNotFound(_0x1fd7f1){logger[_0xe888('0xc')](util[_0xe888('0x1e')](_0xe888('0x3b'),_0x1fd7f1[_0xe888('0x22')]));_0x1fd7f1[_0xe888('0x3a')](_0x1fd7f1[_0xe888('0x2a')],_0x1fd7f1['extension'],parseInt(_0x1fd7f1['priority'],0xa)+0x1);_0x1fd7f1['close']();}function handleUnpublished(_0x32ee14){logger['error'](util[_0xe888('0x1e')]('Project\x20%s\x20not\x20published',_0x32ee14[_0xe888('0x22')]));_0x32ee14[_0xe888('0x3a')](_0x32ee14[_0xe888('0x2a')],_0x32ee14[_0xe888('0x2b')],parseInt(_0x32ee14[_0xe888('0x2c')],0xa)+0x1);_0x32ee14[_0xe888('0x3c')]();}module[_0xe888('0x3d')]={'getAll':getAll,'handleNotFound':handleNotFound,'handleUnpublished':handleUnpublished,'initialize':initialize}; \ No newline at end of file +var _0x5051=['vertex','gotoc\x20block\x20stop\x20traverse\x20BFS','context','extension','priority','response','evtHangup','isUndefined','result','error','agicommand\x20not\x20found','finally','[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','util','../../config/logger','agi','./rpc','./mailRpc','./graph','./vertices','getSquareProjects','catch','Unable\x20to\x20download\x20CallySquare\x20projects','stack','agicommand','hasOwnProperty','maxRetry','retry','mxCell','isArray','length','source','target','addEdge','value','mxGraphModel','root','start','debug','stringify','YYYY-MM-DD\x20HH:mm:ss','omit','info','format','[START\x20TRAVERSE]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s','arg_1','calleridname','callerid','dnid','uniqueid','traverseBFS','clear'];(function(_0x16df47,_0x403ffa){var _0x45559f=function(_0x115ca0){while(--_0x115ca0){_0x16df47['push'](_0x16df47['shift']());}};_0x45559f(++_0x403ffa);}(_0x5051,0x161));var _0x1505=function(_0x547da5,_0x5c0cb3){_0x547da5=_0x547da5-0x0;var _0x4f9f6a=_0x5051[_0x547da5];return _0x4f9f6a;};'use strict';var _=require('lodash');var moment=require('moment');var parser=require('xml2json');var util=require(_0x1505('0x0'));var logger=require(_0x1505('0x1'))(_0x1505('0x2'));var rpc=require(_0x1505('0x3'));var mailRpc=require(_0x1505('0x4'));var Graph=require(_0x1505('0x5'));var Vertices=require(_0x1505('0x6'));var AGI_CODE_SUCCESS=0xc8;var AGI_RESULT_ERROR=-0x1;function getAll(){return rpc[_0x1505('0x7')]()[_0x1505('0x8')](function(_0x1e09ee){logger['error'](_0x1505('0x9'),_0x1e09ee[_0x1505('0xa')]);return[];});}function addVertex(_0x4b987a,_0x5532e6,_0x17dd29){_0x5532e6[_0x1505('0xb')]=_0x17dd29;if(_0x5532e6[_0x1505('0xc')]('retry')){_0x5532e6[_0x1505('0xd')]=parseInt(_0x5532e6[_0x1505('0xe')],0xa);}_0x4b987a['addVertex'](_['omit'](_0x5532e6,_0x1505('0xf')));}function initGraph(_0x50dc34,_0x12c02a){var _0x8bbba=new Graph();for(var _0x21b0ec in _0x50dc34){if(_0x50dc34['hasOwnProperty'](_0x21b0ec)){if(_[_0x1505('0x10')](_0x50dc34[_0x21b0ec])){for(var _0x1ad12c=0x0;_0x1ad12c<_0x50dc34[_0x21b0ec][_0x1505('0x11')];_0x1ad12c+=0x1){addVertex(_0x8bbba,_0x50dc34[_0x21b0ec][_0x1ad12c],_0x21b0ec);}}else{addVertex(_0x8bbba,_0x50dc34[_0x21b0ec],_0x21b0ec);}}}for(var _0x4f77b8=0x0;_0x4f77b8<_0x12c02a[_0x1505('0x11')];_0x4f77b8+=0x1){if(_0x12c02a[_0x4f77b8][_0x1505('0x12')]&&_0x12c02a[_0x4f77b8][_0x1505('0x13')]){_0x8bbba[_0x1505('0x14')](_0x12c02a[_0x4f77b8][_0x1505('0x12')],_0x12c02a[_0x4f77b8][_0x1505('0x13')],_0x12c02a[_0x4f77b8][_0x1505('0x15')]);}}return _0x8bbba;}function getRoot(_0x1f72c3){return parser['toJson'](_0x1f72c3,{'object':!![]})[_0x1505('0x16')][_0x1505('0x17')];}function inspect(_0x59620d){return util['inspect'](_0x59620d,{'showHidden':![],'depth':null});}function initialize(_0x55453e,_0x4c449d){var _0x262fe3=getRoot(_0x55453e['production']);if(!_0x262fe3||!_0x262fe3[_0x1505('0x18')])return;var _0x566bd6,_0x30cec1,_0x21cf4f;logger[_0x1505('0x19')](_0x1505('0x17'),JSON[_0x1505('0x1a')](_0x262fe3,null,0x2));_0x4c449d['joinAt']=moment()['format'](_0x1505('0x1b'));_0x566bd6=initGraph(_[_0x1505('0x1c')](_0x262fe3,_0x1505('0xf')),_0x262fe3['mxCell']);_0x30cec1=new Vertices(_0x4c449d,rpc,mailRpc);logger[_0x1505('0x1d')](util[_0x1505('0x1e')](_0x1505('0x1f'),_0x4c449d[_0x1505('0x20')],_0x4c449d[_0x1505('0x21')],_0x4c449d[_0x1505('0x22')],_0x4c449d[_0x1505('0x23')],_0x4c449d[_0x1505('0x24')]));_0x566bd6[_0x1505('0x25')](_0x262fe3[_0x1505('0x18')]['id'],function(_0x21ccc8){try{_0x21ccc8=_0x30cec1[_0x1505('0x26')](_0x21ccc8);logger[_0x1505('0x19')](_0x1505('0x27'),JSON[_0x1505('0x1a')](_0x21ccc8,null,0x2));if(_0x21ccc8[_0x1505('0xb')]==='gotoc'){logger[_0x1505('0x1d')](_0x1505('0x28'));_0x4c449d[_0x1505('0x29')]=_0x21ccc8[_0x1505('0x29')]||_0x4c449d['context'];_0x4c449d[_0x1505('0x2a')]=_0x21ccc8['extension'];_0x4c449d['priority']=_0x21ccc8[_0x1505('0x2b')]?_0x21ccc8[_0x1505('0x2b')]-0x1:0x1;return null;}else if(_0x21ccc8&&_0x30cec1[_0x21ccc8['agicommand']]){_0x21cf4f=_0x30cec1[_0x21ccc8[_0x1505('0xb')]](_0x21ccc8);logger[_0x1505('0x1d')](_0x1505('0x2c'),JSON['stringify'](_0x21cf4f,null,0x2));if(_0x21cf4f&&_0x21cf4f['code']===AGI_CODE_SUCCESS&&_0x21cf4f['result']!==AGI_RESULT_ERROR&&!_0x4c449d[_0x1505('0x2d')]){logger[_0x1505('0x19')]('response',inspect(_0x21cf4f));return _[_0x1505('0x2e')](_0x21cf4f[_0x1505('0x2f')])?null:_0x21cf4f['result']['toString']();}else{logger[_0x1505('0x30')](_0x1505('0x2c'),inspect(_0x21cf4f));return null;}}else{logger[_0x1505('0x30')](_0x1505('0x31'));return null;}}catch(_0x7aaa67){logger[_0x1505('0x30')](_0x7aaa67[_0x1505('0xa')]);return null;}});if(_0x262fe3[_0x1505('0x32')]){logger[_0x1505('0x1d')](util[_0x1505('0x1e')]('[FINALLY\x20TRAVERSE]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s',_0x4c449d['arg_1'],_0x4c449d[_0x1505('0x21')],_0x4c449d['callerid'],_0x4c449d[_0x1505('0x23')],_0x4c449d[_0x1505('0x24')]));_0x566bd6[_0x1505('0x25')](_0x262fe3[_0x1505('0x32')]['id'],function(_0x4c4c56){try{_0x4c4c56=_0x30cec1[_0x1505('0x26')](_0x4c4c56);logger[_0x1505('0x19')](_0x1505('0x27'),JSON[_0x1505('0x1a')](_0x4c4c56,null,0x2));if(_0x4c4c56&&_0x30cec1[_0x4c4c56[_0x1505('0xb')]]){_0x21cf4f=_0x30cec1[_0x4c4c56[_0x1505('0xb')]](_0x4c4c56);if(_0x21cf4f){logger[_0x1505('0x19')](_0x1505('0x2c'),inspect(_0x21cf4f));return _[_0x1505('0x2e')](_0x21cf4f['result'])?null:_0x21cf4f[_0x1505('0x2f')]['toString']();}else{logger[_0x1505('0x30')](_0x1505('0x2c'),inspect(_0x21cf4f));return null;}}else{logger[_0x1505('0x30')]('agicommand\x20not\x20found');return null;}}catch(_0x5330ce){logger[_0x1505('0x30')](_0x5330ce[_0x1505('0xa')]);return null;}});}logger[_0x1505('0x1d')](util[_0x1505('0x1e')](_0x1505('0x33'),_0x4c449d[_0x1505('0x20')],_0x4c449d[_0x1505('0x21')],_0x4c449d[_0x1505('0x22')],_0x4c449d[_0x1505('0x23')],_0x4c449d[_0x1505('0x24')]));logger[_0x1505('0x1d')](util['format'](_0x1505('0x34'),_0x4c449d[_0x1505('0x29')],_0x4c449d[_0x1505('0x2a')],parseInt(_0x4c449d[_0x1505('0x2b')],0xa)+0x1));_0x4c449d[_0x1505('0x35')](_0x4c449d[_0x1505('0x29')],_0x4c449d[_0x1505('0x2a')],parseInt(_0x4c449d[_0x1505('0x2b')],0xa)+0x1);_0x4c449d[_0x1505('0x36')]();}function handleNotFound(_0xd01a0c){logger[_0x1505('0x30')](util[_0x1505('0x1e')](_0x1505('0x37'),_0xd01a0c['arg_1']));_0xd01a0c['continueAt'](_0xd01a0c[_0x1505('0x29')],_0xd01a0c[_0x1505('0x2a')],parseInt(_0xd01a0c[_0x1505('0x2b')],0xa)+0x1);_0xd01a0c[_0x1505('0x36')]();}function handleUnpublished(_0x46ce3e){logger[_0x1505('0x30')](util['format']('Project\x20%s\x20not\x20published',_0x46ce3e[_0x1505('0x20')]));_0x46ce3e[_0x1505('0x35')](_0x46ce3e[_0x1505('0x29')],_0x46ce3e['extension'],parseInt(_0x46ce3e[_0x1505('0x2b')],0xa)+0x1);_0x46ce3e[_0x1505('0x36')]();}module['exports']={'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 4030d0b..35af8d3 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 _0x6e69=['exports','util','Transform','call','_localBuffer','_inBody','prototype','_transform','toString','substring','length','split','indexOf','slice','trim','emit','headers'];(function(_0x182a35,_0x2ce245){var _0x1aac89=function(_0x47d42c){while(--_0x47d42c){_0x182a35['push'](_0x182a35['shift']());}};_0x1aac89(++_0x2ce245);}(_0x6e69,0x9a));var _0x96e6=function(_0x331580,_0x207b6b){_0x331580=_0x331580-0x0;var _0x155e37=_0x6e69[_0x331580];return _0x155e37;};'use strict';var util=require(_0x96e6('0x0'));var Transform=require('stream')[_0x96e6('0x1')];function AGIReply(_0x44c548){Transform[_0x96e6('0x2')](this,_0x44c548);this[_0x96e6('0x3')]='';this[_0x96e6('0x4')]=![];}util['inherits'](AGIReply,Transform);AGIReply[_0x96e6('0x5')][_0x96e6('0x6')]=function(_0x3f1036,_0x3c09c7,_0x15b45c){var _0x55e4f5='\x0a',_0x3d5dd9=['\x0a\x0a','\x0d\x0a\x0d\x0a'],_0x2cd016=-0x1,_0x3f4216=-0x1,_0x227d56='',_0x15bc74=0x0,_0xfe9123='',_0x21ec9e='';this[_0x96e6('0x3')]+=_0x3f1036[_0x96e6('0x7')]();_0xfe9123=this[_0x96e6('0x3')];if(!this[_0x96e6('0x4')]){_0x15bc74=0x0;while(_0x3d5dd9[_0x15bc74]){while((_0x3f4216=_0xfe9123['indexOf'](_0x3d5dd9[_0x15bc74]))!=-0x1){_0x227d56=_0x3d5dd9[_0x15bc74];_0x21ec9e=_0xfe9123[_0x96e6('0x8')](0x0,_0x3f4216);_0xfe9123=_0xfe9123['substring'](_0x3f4216+_0x227d56[_0x96e6('0x9')]);var _0x2a6de5=_0x21ec9e[_0x96e6('0xa')](_0x55e4f5),_0x34f1e3=0x0,_0x2e14cf={},_0x32b050='',_0x5b2c01='',_0x3ed67a=-0x1;while(_0x2a6de5[_0x34f1e3]){_0x3ed67a=_0x2a6de5[_0x34f1e3][_0x96e6('0xb')](':');if(_0x3ed67a!=-0x1){_0x32b050=_0x2a6de5[_0x34f1e3][_0x96e6('0xc')](0x0,_0x3ed67a)[_0x96e6('0xd')]();_0x5b2c01=_0x2a6de5[_0x34f1e3][_0x96e6('0xc')](_0x3ed67a+0x1)[_0x96e6('0xd')]();if(_0x32b050[_0x96e6('0x9')]>0x0){_0x2e14cf[_0x32b050]=_0x5b2c01;}}else{}_0x34f1e3++;}this[_0x96e6('0xe')](_0x96e6('0xf'),_0x2e14cf);this[_0x96e6('0x4')]=!![];}_0x15bc74++;}this['_localBuffer']=_0xfe9123;}else{while((_0x2cd016=_0xfe9123[_0x96e6('0xb')](_0x55e4f5))!=-0x1){_0x21ec9e=_0xfe9123[_0x96e6('0x8')](0x0,_0x2cd016);this['emit']('line',_0x21ec9e);_0xfe9123=_0xfe9123[_0x96e6('0x8')](_0x2cd016+_0x55e4f5['length']);}this[_0x96e6('0x3')]=_0xfe9123;}_0x15b45c();};module[_0x96e6('0x10')]=AGIReply; \ No newline at end of file +var _0x92e7=['toString','_inBody','indexOf','substring','length','slice','trim','emit','headers','line','exports','util','Transform','call','_localBuffer','prototype'];(function(_0xa464c9,_0x7c86d8){var _0x3d73c4=function(_0x5c2056){while(--_0x5c2056){_0xa464c9['push'](_0xa464c9['shift']());}};_0x3d73c4(++_0x7c86d8);}(_0x92e7,0x1ab));var _0x792e=function(_0x47192d,_0x1c21fc){_0x47192d=_0x47192d-0x0;var _0x32c9dd=_0x92e7[_0x47192d];return _0x32c9dd;};'use strict';var util=require(_0x792e('0x0'));var Transform=require('stream')[_0x792e('0x1')];function AGIReply(_0x1f4a7b){Transform[_0x792e('0x2')](this,_0x1f4a7b);this[_0x792e('0x3')]='';this['_inBody']=![];}util['inherits'](AGIReply,Transform);AGIReply[_0x792e('0x4')]['_transform']=function(_0x31d7ea,_0x343b7a,_0x517276){var _0x1d9407='\x0a',_0x590d91=['\x0a\x0a','\x0d\x0a\x0d\x0a'],_0x42c834=-0x1,_0x1630d9=-0x1,_0x44ebf1='',_0x34d439=0x0,_0x2659f8='',_0x460d27='';this[_0x792e('0x3')]+=_0x31d7ea[_0x792e('0x5')]();_0x2659f8=this[_0x792e('0x3')];if(!this[_0x792e('0x6')]){_0x34d439=0x0;while(_0x590d91[_0x34d439]){while((_0x1630d9=_0x2659f8[_0x792e('0x7')](_0x590d91[_0x34d439]))!=-0x1){_0x44ebf1=_0x590d91[_0x34d439];_0x460d27=_0x2659f8[_0x792e('0x8')](0x0,_0x1630d9);_0x2659f8=_0x2659f8[_0x792e('0x8')](_0x1630d9+_0x44ebf1[_0x792e('0x9')]);var _0x3955a2=_0x460d27['split'](_0x1d9407),_0x1afc8d=0x0,_0xd4917e={},_0x264a96='',_0x3efd84='',_0x4218c2=-0x1;while(_0x3955a2[_0x1afc8d]){_0x4218c2=_0x3955a2[_0x1afc8d]['indexOf'](':');if(_0x4218c2!=-0x1){_0x264a96=_0x3955a2[_0x1afc8d][_0x792e('0xa')](0x0,_0x4218c2)[_0x792e('0xb')]();_0x3efd84=_0x3955a2[_0x1afc8d][_0x792e('0xa')](_0x4218c2+0x1)[_0x792e('0xb')]();if(_0x264a96['length']>0x0){_0xd4917e[_0x264a96]=_0x3efd84;}}else{}_0x1afc8d++;}this[_0x792e('0xc')](_0x792e('0xd'),_0xd4917e);this['_inBody']=!![];}_0x34d439++;}this['_localBuffer']=_0x2659f8;}else{while((_0x42c834=_0x2659f8[_0x792e('0x7')](_0x1d9407))!=-0x1){_0x460d27=_0x2659f8['substring'](0x0,_0x42c834);this[_0x792e('0xc')](_0x792e('0xe'),_0x460d27);_0x2659f8=_0x2659f8['substring'](_0x42c834+_0x1d9407['length']);}this[_0x792e('0x3')]=_0x2659f8;}_0x517276();};module[_0x792e('0xf')]=AGIReply; \ No newline at end of file diff --git a/server/services/agi/rpc/index.js b/server/services/agi/rpc/index.js index 76b6406..00ca7e0 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 _0xf874=['CreateSquareReport','arg_1','arg_2','format','YYYY-MM-DD\x20HH:mm:ss','createSquareRecording','CreateSquareRecording','createSquareMessage','CreateSquareMessage','createCmContact','ShowCmHopper','ListId','CreateCmContact','ShowPause','agentLogin','LoginUser','agentPause','PauseUser','UnpauseUser','agentLogout','LogoutUser','lodash','jayson/promise','client','http','then','GetSquareProjects','name','production','getSquareProject','ShowSquareProject','getMailAccountById','ShowMailAccount','MailServerOut','Smtp','CloudProvider','email','getVariableById','ShowVariable','getSquareOdbcById','ShowSquareOdbc','dsn','getUserById','ShowUser','getContactByPhone','GetContactByPhone','phone','getTrunkById','getSoundById','ShowSound','save_name','ShowInterval','Interval','Intervals','ShowSmsAccount','CreateSmsMessage','createSquareDetailsReport','CreateSquareDetailsReport','createSquareReport'];(function(_0x5b86f6,_0x417f9f){var _0x309a26=function(_0x4ac5b4){while(--_0x4ac5b4){_0x5b86f6['push'](_0x5b86f6['shift']());}};_0x309a26(++_0x417f9f);}(_0xf874,0x177));var _0x4f87=function(_0x298e42,_0x13c55e){_0x298e42=_0x298e42-0x0;var _0x53f5d1=_0xf874[_0x298e42];return _0x53f5d1;};'use strict';var _=require(_0x4f87('0x0'));var moment=require('moment');var jayson=require(_0x4f87('0x1'));var client=jayson[_0x4f87('0x2')][_0x4f87('0x3')]({'port':0x2329});function request(_0xe07d73,_0x18fe31){return new Promise(function(_0xe4464e,_0x87123d){return client['request'](_0xe07d73,_0x18fe31)[_0x4f87('0x4')](function(_0xe6e413){if(_0xe6e413['error']){return _0x87123d(_0xe6e413['error']['message']);}else{return _0xe4464e(_0xe6e413['result']);}})['catch'](function(_0x2aeac4){return _0x87123d(_0x2aeac4);});});}exports['getSquareProjects']=function(){return request(_0x4f87('0x5'),{'options':{'raw':![],'attributes':['id',_0x4f87('0x6'),_0x4f87('0x7')]}});};exports[_0x4f87('0x8')]=function(_0x4dfb28){return request(_0x4f87('0x9'),{'options':{'raw':![],'where':{'name':_0x4dfb28},'attributes':[_0x4f87('0x7')]}});};exports[_0x4f87('0xa')]=function(_0x1777bb){return request(_0x4f87('0xb'),{'options':{'raw':![],'where':{'id':_0x1777bb},'include':[{'model':_0x4f87('0xc'),'as':_0x4f87('0xd'),'include':[{'model':_0x4f87('0xe'),'as':_0x4f87('0xe')}]}],'attributes':['id',_0x4f87('0x6'),_0x4f87('0xf')],'smtp':!![]}});};exports['getSquareProjectById']=function(_0x2ccfda){return request(_0x4f87('0x9'),{'options':{'where':{'id':_0x2ccfda},'attributes':['name']}});};exports['getVoiceQueueById']=function(_0x1dcbf9){return request('ShowVoiceQueue',{'options':{'where':{'id':_0x1dcbf9},'attributes':[_0x4f87('0x6')]}});};exports[_0x4f87('0x10')]=function(_0x24ac31){return request(_0x4f87('0x11'),{'options':{'where':{'id':_0x24ac31},'attributes':[_0x4f87('0x6')]}});};exports[_0x4f87('0x12')]=function(_0x3c327b){return request(_0x4f87('0x13'),{'options':{'where':{'id':_0x3c327b},'attributes':[_0x4f87('0x14')]}});};exports[_0x4f87('0x15')]=function(_0x3ffd7b){return request(_0x4f87('0x16'),{'options':{'where':{'id':_0x3ffd7b},'attributes':[_0x4f87('0x6')]}});};exports[_0x4f87('0x17')]=function(_0x8b401b){return request(_0x4f87('0x18'),{'options':{'where':{'phone':_0x8b401b[_0x4f87('0x19')]},'attributes':['id']}});};exports[_0x4f87('0x1a')]=function(_0x135f44){return request('ShowTrunk',{'options':{'where':{'id':_0x135f44},'attributes':[_0x4f87('0x6')]}});};exports[_0x4f87('0x1b')]=function(_0x4f1934){return request(_0x4f87('0x1c'),{'options':{'where':{'id':_0x4f1934},'attributes':[_0x4f87('0x1d')]}});};exports['getIntervalById']=function(_0x26ac97){return request(_0x4f87('0x1e'),{'options':{'raw':![],'where':{'id':_0x26ac97},'include':[{'model':_0x4f87('0x1f'),'as':_0x4f87('0x20')}]}});};exports['getSmsAccountById']=function(_0x2eded4){return request(_0x4f87('0x21'),{'options':{'where':{'id':_0x2eded4},'attributes':['id','name']}});};exports['createSmsMessage']=function(_0x345622){return request(_0x4f87('0x22'),{'body':_0x345622});};exports[_0x4f87('0x23')]=function(_0x1179eb){return request(_0x4f87('0x24'),{'body':_0x1179eb});};exports[_0x4f87('0x25')]=function(_0x23ce03){return request(_0x4f87('0x26'),{'body':_['merge'](_0x23ce03,{'project_name':_0x23ce03[_0x4f87('0x27')],'prev_project_name':_0x23ce03[_0x4f87('0x28')]||'','is_subproject':_0x23ce03[_0x4f87('0x28')]?!![]:![],'leaveAt':moment()[_0x4f87('0x29')](_0x4f87('0x2a'))})});};exports[_0x4f87('0x2b')]=function(_0x24d2bb){return request(_0x4f87('0x2c'),{'body':_0x24d2bb});};exports[_0x4f87('0x2d')]=function(_0x1d7421){return request(_0x4f87('0x2e'),{'body':_0x1d7421});};exports[_0x4f87('0x2f')]=function(_0x3c2b61){return request(_0x4f87('0x30'),{'options':{'raw':![],'where':{'phone':_0x3c2b61[_0x4f87('0x19')],'ListId':_0x3c2b61[_0x4f87('0x31')]}}})[_0x4f87('0x4')](function(_0x214a96){if(_0x214a96){return _0x214a96;}return request(_0x4f87('0x32'),{'body':_0x3c2b61});});};exports['getPauseById']=function(_0x3c8c8c){return request(_0x4f87('0x33'),{'options':{'where':{'id':_0x3c8c8c},'attributes':['name']}});};exports[_0x4f87('0x34')]=function(_0x331c52,_0x3a0046){return request(_0x4f87('0x35'),{'body':{'interface':_0x3a0046},'options':{'where':_0x331c52}});};exports[_0x4f87('0x36')]=function(_0x4bc337,_0x1c8e17,_0x370b0f){return request(_0x4f87('0x37'),{'body':{'type':_0x1c8e17,'uniqueid':_0x370b0f},'options':{'where':_0x4bc337}});};exports['agentUnpause']=function(_0x8df7f9){return request(_0x4f87('0x38'),{'body':{},'options':{'where':_0x8df7f9}});};exports[_0x4f87('0x39')]=function(_0x396e17){return request(_0x4f87('0x3a'),{'body':{},'options':{'where':_0x396e17}});}; \ No newline at end of file +var _0x385b=['UnpauseUser','agentLogout','LogoutUser','moment','client','http','request','then','error','message','result','getSquareProjects','GetSquareProjects','name','getSquareProject','production','getMailAccountById','ShowMailAccount','MailServerOut','Smtp','CloudProvider','getSquareProjectById','ShowSquareProject','getVoiceQueueById','ShowVoiceQueue','getVariableById','ShowVariable','getSquareOdbcById','ShowSquareOdbc','dsn','getUserById','ShowUser','getContactByPhone','phone','getTrunkById','getSoundById','ShowSound','save_name','getIntervalById','Interval','Intervals','getSmsAccountById','ShowSmsAccount','CreateSquareReport','merge','arg_1','arg_2','format','YYYY-MM-DD\x20HH:mm:ss','createSquareRecording','CreateSquareRecording','createSquareMessage','createCmContact','ShowCmHopper','ListId','CreateCmContact','getPauseById','agentPause','PauseUser','agentUnpause'];(function(_0x53a34c,_0x25cffd){var _0x3dda74=function(_0x559ccd){while(--_0x559ccd){_0x53a34c['push'](_0x53a34c['shift']());}};_0x3dda74(++_0x25cffd);}(_0x385b,0x1a7));var _0xb385=function(_0x14cba0,_0x1db963){_0x14cba0=_0x14cba0-0x0;var _0x4da603=_0x385b[_0x14cba0];return _0x4da603;};'use strict';var _=require('lodash');var moment=require(_0xb385('0x0'));var jayson=require('jayson/promise');var client=jayson[_0xb385('0x1')][_0xb385('0x2')]({'port':0x2329});function request(_0x12124b,_0x1f7c4f){return new Promise(function(_0x55c2c8,_0x2ea8dd){return client[_0xb385('0x3')](_0x12124b,_0x1f7c4f)[_0xb385('0x4')](function(_0x3d81aa){if(_0x3d81aa[_0xb385('0x5')]){return _0x2ea8dd(_0x3d81aa[_0xb385('0x5')][_0xb385('0x6')]);}else{return _0x55c2c8(_0x3d81aa[_0xb385('0x7')]);}})['catch'](function(_0x397ddc){return _0x2ea8dd(_0x397ddc);});});}exports[_0xb385('0x8')]=function(){return request(_0xb385('0x9'),{'options':{'raw':![],'attributes':['id',_0xb385('0xa'),'production']}});};exports[_0xb385('0xb')]=function(_0x40f65e){return request('ShowSquareProject',{'options':{'raw':![],'where':{'name':_0x40f65e},'attributes':[_0xb385('0xc')]}});};exports[_0xb385('0xd')]=function(_0x35a5c9){return request(_0xb385('0xe'),{'options':{'raw':![],'where':{'id':_0x35a5c9},'include':[{'model':_0xb385('0xf'),'as':_0xb385('0x10'),'include':[{'model':'CloudProvider','as':_0xb385('0x11')}]}],'attributes':['id','name','email'],'smtp':!![]}});};exports[_0xb385('0x12')]=function(_0x4e859e){return request(_0xb385('0x13'),{'options':{'where':{'id':_0x4e859e},'attributes':[_0xb385('0xa')]}});};exports[_0xb385('0x14')]=function(_0x4fb070){return request(_0xb385('0x15'),{'options':{'where':{'id':_0x4fb070},'attributes':[_0xb385('0xa')]}});};exports[_0xb385('0x16')]=function(_0x580524){return request(_0xb385('0x17'),{'options':{'where':{'id':_0x580524},'attributes':[_0xb385('0xa')]}});};exports[_0xb385('0x18')]=function(_0x5401ff){return request(_0xb385('0x19'),{'options':{'where':{'id':_0x5401ff},'attributes':[_0xb385('0x1a')]}});};exports[_0xb385('0x1b')]=function(_0x2cb36e){return request(_0xb385('0x1c'),{'options':{'where':{'id':_0x2cb36e},'attributes':[_0xb385('0xa')]}});};exports[_0xb385('0x1d')]=function(_0x1202c8){return request('GetContactByPhone',{'options':{'where':{'phone':_0x1202c8[_0xb385('0x1e')]},'attributes':['id']}});};exports[_0xb385('0x1f')]=function(_0x19c4ce){return request('ShowTrunk',{'options':{'where':{'id':_0x19c4ce},'attributes':[_0xb385('0xa')]}});};exports[_0xb385('0x20')]=function(_0x3985b5){return request(_0xb385('0x21'),{'options':{'where':{'id':_0x3985b5},'attributes':[_0xb385('0x22')]}});};exports[_0xb385('0x23')]=function(_0x30d716){return request('ShowInterval',{'options':{'raw':![],'where':{'id':_0x30d716},'include':[{'model':_0xb385('0x24'),'as':_0xb385('0x25')}]}});};exports[_0xb385('0x26')]=function(_0x510e2b){return request(_0xb385('0x27'),{'options':{'where':{'id':_0x510e2b},'attributes':['id',_0xb385('0xa')]}});};exports['createSmsMessage']=function(_0x3a5a95){return request('CreateSmsMessage',{'body':_0x3a5a95});};exports['createSquareDetailsReport']=function(_0x31ec56){return request('CreateSquareDetailsReport',{'body':_0x31ec56});};exports['createSquareReport']=function(_0x17b887){return request(_0xb385('0x28'),{'body':_[_0xb385('0x29')](_0x17b887,{'project_name':_0x17b887[_0xb385('0x2a')],'prev_project_name':_0x17b887[_0xb385('0x2b')]||'','is_subproject':_0x17b887[_0xb385('0x2b')]?!![]:![],'leaveAt':moment()[_0xb385('0x2c')](_0xb385('0x2d'))})});};exports[_0xb385('0x2e')]=function(_0x276a31){return request(_0xb385('0x2f'),{'body':_0x276a31});};exports[_0xb385('0x30')]=function(_0x115e4c){return request('CreateSquareMessage',{'body':_0x115e4c});};exports[_0xb385('0x31')]=function(_0x13fdb9){return request(_0xb385('0x32'),{'options':{'raw':![],'where':{'phone':_0x13fdb9['phone'],'ListId':_0x13fdb9[_0xb385('0x33')]}}})[_0xb385('0x4')](function(_0x2a0eb4){if(_0x2a0eb4){return _0x2a0eb4;}return request(_0xb385('0x34'),{'body':_0x13fdb9});});};exports[_0xb385('0x35')]=function(_0x3b375a){return request('ShowPause',{'options':{'where':{'id':_0x3b375a},'attributes':['name']}});};exports['agentLogin']=function(_0x31bc6c,_0x5372be){return request('LoginUser',{'body':{'interface':_0x5372be},'options':{'where':_0x31bc6c}});};exports[_0xb385('0x36')]=function(_0x5992ca,_0x40bd39,_0x5cad1){return request(_0xb385('0x37'),{'body':{'type':_0x40bd39,'uniqueid':_0x5cad1},'options':{'where':_0x5992ca}});};exports[_0xb385('0x38')]=function(_0x3954c3){return request(_0xb385('0x39'),{'body':{},'options':{'where':_0x3954c3}});};exports[_0xb385('0x3a')]=function(_0x29551){return request(_0xb385('0x3b'),{'body':{},'options':{'where':_0x29551}});}; \ 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 2a6156a..f7ae8a2 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 _0xc1db=['./polly','exports'];(function(_0x2c91e9,_0x2fb965){var _0x13f0ff=function(_0xb39edf){while(--_0xb39edf){_0x2c91e9['push'](_0x2c91e9['shift']());}};_0x13f0ff(++_0x2fb965);}(_0xc1db,0x120));var _0xbc1d=function(_0x1bd4ac,_0x3aaac2){_0x1bd4ac=_0x1bd4ac-0x0;var _0x1bba58=_0xc1db[_0x1bd4ac];return _0x1bba58;};var polly=require(_0xbc1d('0x0'));var lex=require('./lex');module[_0xbc1d('0x1')]={'polly':polly,'lex':lex}; \ No newline at end of file +var _0x6c99=['exports','./polly'];(function(_0x12fc8d,_0x19ee33){var _0x3f9d04=function(_0x52e51c){while(--_0x52e51c){_0x12fc8d['push'](_0x12fc8d['shift']());}};_0x3f9d04(++_0x19ee33);}(_0x6c99,0x9b));var _0x96c9=function(_0x1a37e3,_0x5db8f6){_0x1a37e3=_0x1a37e3-0x0;var _0x4db78a=_0x6c99[_0x1a37e3];return _0x4db78a;};var polly=require(_0x96c9('0x0'));var lex=require('./lex');module[_0x96c9('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 146a12f..0410243 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 _0x9c00=['./lib/api','exports'];(function(_0x7c5676,_0x46c0fd){var _0x3eefc6=function(_0x531498){while(--_0x531498){_0x7c5676['push'](_0x7c5676['shift']());}};_0x3eefc6(++_0x46c0fd);}(_0x9c00,0x1a0));var _0x09c0=function(_0x270adf,_0x1daaa3){_0x270adf=_0x270adf-0x0;var _0x29eda9=_0x9c00[_0x270adf];return _0x29eda9;};'use strict';var lex=require(_0x09c0('0x0'));module[_0x09c0('0x1')]=function(_0x4dff21,_0x5e32e7,_0xe0d293,_0x8c9907,_0x5d1967,_0x220c0c){return lex(_0x4dff21,_0x5e32e7,_0xe0d293,_0x8c9907,_0x5d1967,_0x220c0c);}; \ No newline at end of file +var _0xb7e7=['./lib/api'];(function(_0x587678,_0x515ff2){var _0x3cf004=function(_0x411fd5){while(--_0x411fd5){_0x587678['push'](_0x587678['shift']());}};_0x3cf004(++_0x515ff2);}(_0xb7e7,0x121));var _0x7b7e=function(_0x3947c9,_0x4d6c97){_0x3947c9=_0x3947c9-0x0;var _0x2e7871=_0xb7e7[_0x3947c9];return _0x2e7871;};'use strict';var lex=require(_0x7b7e('0x0'));module['exports']=function(_0x40e269,_0x518dc6,_0x1b7cc7,_0x54a37f,_0x3f5804,_0x556d68){return lex(_0x40e269,_0x518dc6,_0x1b7cc7,_0x54a37f,_0x3f5804,_0x556d68);}; \ 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 c475da5..ef3c132 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(_0x4f1a14,_0x556aa0){var _0x432390=function(_0x47ce3c){while(--_0x47ce3c){_0x4f1a14['push'](_0x4f1a14['shift']());}};_0x432390(++_0x556aa0);}(_0xa9e0,0x123));var _0x0a9e=function(_0x2576d7,_0x167624){_0x2576d7=_0x2576d7-0x0;var _0x16a08c=_0xa9e0[_0x2576d7];return _0x16a08c;};'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(_0x33f1de,_0x38d5ac){var _0x37f788=function(_0x18379e){while(--_0x18379e){_0x33f1de['push'](_0x33f1de['shift']());}};_0x37f788(++_0x38d5ac);}(_0xa9e0,0x123));var _0x0a9e=function(_0x2f3848,_0x48564d){_0x2f3848=_0x2f3848-0x0;var _0x102668=_0xa9e0[_0x2f3848];return _0x102668;};'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 dee0501..7fb8f22 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 _0x5df9=['./lib/api','exports'];(function(_0x2950d9,_0x19b43d){var _0x1bb04c=function(_0x4742a9){while(--_0x4742a9){_0x2950d9['push'](_0x2950d9['shift']());}};_0x1bb04c(++_0x19b43d);}(_0x5df9,0x176));var _0x95df=function(_0x545bef,_0x212189){_0x545bef=_0x545bef-0x0;var _0x4cb90c=_0x5df9[_0x545bef];return _0x4cb90c;};'use strict';var polly=require(_0x95df('0x0'));module[_0x95df('0x1')]=function(_0x629234,_0xaa8a11,_0x39aaea,_0x3a4b83,_0x219256,_0x2adbdf,_0x508f06){return polly(_0x629234,_0xaa8a11,_0x39aaea,_0x3a4b83,_0x219256,_0x2adbdf,_0x508f06);}; \ No newline at end of file +var _0x43cc=['exports','./lib/api'];(function(_0x15c8f5,_0x2f1791){var _0x596af4=function(_0x1c4d2d){while(--_0x1c4d2d){_0x15c8f5['push'](_0x15c8f5['shift']());}};_0x596af4(++_0x2f1791);}(_0x43cc,0x19b));var _0xc43c=function(_0x1d6a82,_0x37c315){_0x1d6a82=_0x1d6a82-0x0;var _0x5834ac=_0x43cc[_0x1d6a82];return _0x5834ac;};'use strict';var polly=require(_0xc43c('0x0'));module[_0xc43c('0x1')]=function(_0x5949b3,_0x5d9f12,_0x238a8d,_0x11bd46,_0x189ade,_0x2601c7,_0x46c2ca){return polly(_0x5949b3,_0x5d9f12,_0x238a8d,_0x11bd46,_0x189ade,_0x2601c7,_0x46c2ca);}; \ 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 1b84853..66f4264 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 _0x8772=['AudioStream','writeFile','Invalid\x20data\x20response\x20from\x20aws\x20Polly!','No\x20data\x20response\x20from\x20aws\x20Polly!','exports','mp3','bluebird','aws-sdk'];(function(_0x4bb874,_0x37183c){var _0x316fb4=function(_0x1ee0f5){while(--_0x1ee0f5){_0x4bb874['push'](_0x4bb874['shift']());}};_0x316fb4(++_0x37183c);}(_0x8772,0x116));var _0x2877=function(_0x2b2d5b,_0x4a2fb1){_0x2b2d5b=_0x2b2d5b-0x0;var _0x80b73f=_0x8772[_0x2b2d5b];return _0x80b73f;};'use strict';var fs=require('fs');var path=require('path');var BPromise=require(_0x2877('0x0'));var rs=require('randomstring');var AWS=require(_0x2877('0x1'));function pollyResult(_0x5bdcc6,_0x59f572,_0x33675f){return new BPromise(function(_0x41e8a6,_0x3ce2a9){_0x5bdcc6['synthesizeSpeech'](_0x59f572,function(_0x364ee7,_0x3a8f2b){if(_0x364ee7){_0x3ce2a9(_0x364ee7);}else if(_0x3a8f2b){if(_0x3a8f2b[_0x2877('0x2')]instanceof Buffer){fs[_0x2877('0x3')](_0x33675f,_0x3a8f2b[_0x2877('0x2')],function(_0x3912c2){if(_0x3912c2){_0x3ce2a9(_0x3912c2);}else{_0x41e8a6();}});}else{_0x3ce2a9(new Error(_0x2877('0x4')));}}else{_0x3ce2a9(new Error(_0x2877('0x5')));}});});}module[_0x2877('0x6')]=function(_0x1ae243,_0x2fa852,_0x26878d,_0x1c534b,_0x30adee,_0x1e8e59,_0x4e7a63){var _0x5dc1e9=new AWS['Polly']({'accessKeyId':_0x1ae243,'secretAccessKey':_0x2fa852,'region':_0x26878d});var _0x2abb08={'Text':_0x30adee,'TextType':_0x1e8e59||'text','OutputFormat':_0x2877('0x7'),'VoiceId':_0x1c534b};return pollyResult(_0x5dc1e9,_0x2abb08,_0x4e7a63);}; \ No newline at end of file +var _0xeb1e=['Invalid\x20data\x20response\x20from\x20aws\x20Polly!','No\x20data\x20response\x20from\x20aws\x20Polly!','exports','Polly','text','mp3','randomstring','synthesizeSpeech','AudioStream'];(function(_0x48822b,_0x508845){var _0x4a69a2=function(_0x479850){while(--_0x479850){_0x48822b['push'](_0x48822b['shift']());}};_0x4a69a2(++_0x508845);}(_0xeb1e,0x1a4));var _0xeeb1=function(_0x156e8c,_0x2d2488){_0x156e8c=_0x156e8c-0x0;var _0x54cd49=_0xeb1e[_0x156e8c];return _0x54cd49;};'use strict';var fs=require('fs');var path=require('path');var BPromise=require('bluebird');var rs=require(_0xeeb1('0x0'));var AWS=require('aws-sdk');function pollyResult(_0x5de171,_0x108d82,_0x3b1b77){return new BPromise(function(_0x414953,_0x210905){_0x5de171[_0xeeb1('0x1')](_0x108d82,function(_0x256e87,_0x9b2455){if(_0x256e87){_0x210905(_0x256e87);}else if(_0x9b2455){if(_0x9b2455[_0xeeb1('0x2')]instanceof Buffer){fs['writeFile'](_0x3b1b77,_0x9b2455[_0xeeb1('0x2')],function(_0x5b9d09){if(_0x5b9d09){_0x210905(_0x5b9d09);}else{_0x414953();}});}else{_0x210905(new Error(_0xeeb1('0x3')));}}else{_0x210905(new Error(_0xeeb1('0x4')));}});});}module[_0xeeb1('0x5')]=function(_0x4af8cd,_0x13aa5a,_0x3e776d,_0x516398,_0x1f7bb6,_0x555e67,_0x4c793c){var _0x26131e=new AWS[(_0xeeb1('0x6'))]({'accessKeyId':_0x4af8cd,'secretAccessKey':_0x13aa5a,'region':_0x3e776d});var _0xbf6a06={'Text':_0x1f7bb6,'TextType':_0x555e67||_0xeeb1('0x7'),'OutputFormat':_0xeeb1('0x8'),'VoiceId':_0x516398};return pollyResult(_0x26131e,_0xbf6a06,_0x4c793c);}; \ 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 1b6aa2b..05d99b2 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 _0x6b6f=['exports'];(function(_0x388960,_0x2a8993){var _0x8237db=function(_0x4e7c61){while(--_0x4e7c61){_0x388960['push'](_0x388960['shift']());}};_0x8237db(++_0x2a8993);}(_0x6b6f,0xe9));var _0xf6b6=function(_0x45fb04,_0x3136f6){_0x45fb04=_0x45fb04-0x0;var _0xd52a12=_0x6b6f[_0x45fb04];return _0xd52a12;};'use strict';var asr=require('./lib/api');module[_0xf6b6('0x0')]=function(_0xc5ed5d,_0x343176,_0x4671a9,_0x33aad7){return asr(_0xc5ed5d,_0x343176,_0x4671a9);}; \ No newline at end of file +var _0x16c9=['./lib/api'];(function(_0x2c0f41,_0x15d4b1){var _0x357969=function(_0x3ec205){while(--_0x3ec205){_0x2c0f41['push'](_0x2c0f41['shift']());}};_0x357969(++_0x15d4b1);}(_0x16c9,0x128));var _0x916c=function(_0x217ae3,_0xb1c89c){_0x217ae3=_0x217ae3-0x0;var _0x1ab09b=_0x16c9[_0x217ae3];return _0x1ab09b;};'use strict';var asr=require(_0x916c('0x0'));module['exports']=function(_0x267960,_0x195e47,_0x155689,_0x15f2c9){return asr(_0x267960,_0x195e47,_0x155689);}; \ 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 5b3fa65..f21a83c 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 _0xb2ff=['readFileSync','base64','POST','LINEAR16','8000','url','bluebird','exports','string','length','filepath\x20should\x20be\x20a\x20string','key\x20should\x20be\x20a\x20string','lang\x20should\x20be\x20a\x20string'];(function(_0x25bea7,_0x49ab45){var _0x175952=function(_0x56a0b5){while(--_0x56a0b5){_0x25bea7['push'](_0x25bea7['shift']());}};_0x175952(++_0x49ab45);}(_0xb2ff,0x123));var _0xfb2f=function(_0x4b369d,_0x265eb8){_0x4b369d=_0x4b369d-0x0;var _0x571a98=_0xb2ff[_0x4b369d];return _0x571a98;};'use strict';var url=require(_0xfb2f('0x0'));var BPromise=require(_0xfb2f('0x1'));var fs=require('fs');var host='https://speech.googleapis.com';module[_0xfb2f('0x2')]=function(_0x54e80d,_0x584330,_0x51e1fe){return new BPromise(function(_0x13cb60,_0x484368){var _0x145e77;if(typeof _0x54e80d!==_0xfb2f('0x3')||_0x54e80d[_0xfb2f('0x4')]===0x0){return _0x484368(_0xfb2f('0x5'));}if(typeof _0x584330!=='string'||_0x584330['length']===0x0){return _0x484368(_0xfb2f('0x6'));}if(typeof _0x51e1fe!=='undefined'&&(typeof _0x51e1fe!==_0xfb2f('0x3')||_0x51e1fe[_0xfb2f('0x4')]===0x0)){return _0x484368(_0xfb2f('0x7'));}try{_0x145e77=fs[_0xfb2f('0x8')](_0x54e80d)['toString'](_0xfb2f('0x9'));}catch(_0x5084f0){return _0x484368(_0x5084f0);}return _0x13cb60({'method':_0xfb2f('0xa'),'uri':host+'/v1/speech:recognize?key='+_0x584330,'body':{'config':{'encoding':_0xfb2f('0xb'),'sampleRateHertz':_0xfb2f('0xc'),'languageCode':_0x51e1fe},'audio':{'content':_0x145e77}},'json':!![]});});}; \ No newline at end of file +var _0xad36=['POST','/v1/speech:recognize?key=','LINEAR16','8000','bluebird','https://speech.googleapis.com','exports','length','filepath\x20should\x20be\x20a\x20string','string','lang\x20should\x20be\x20a\x20string','readFileSync','toString','base64'];(function(_0x1deb03,_0xd05ad8){var _0x189fe7=function(_0x321225){while(--_0x321225){_0x1deb03['push'](_0x1deb03['shift']());}};_0x189fe7(++_0xd05ad8);}(_0xad36,0x11c));var _0x6ad3=function(_0x43a31f,_0x1edfeb){_0x43a31f=_0x43a31f-0x0;var _0x49144c=_0xad36[_0x43a31f];return _0x49144c;};'use strict';var url=require('url');var BPromise=require(_0x6ad3('0x0'));var fs=require('fs');var host=_0x6ad3('0x1');module[_0x6ad3('0x2')]=function(_0x1164e0,_0x32fb2f,_0x35a0ee){return new BPromise(function(_0xef54ab,_0x17a9b2){var _0x3d8fee;if(typeof _0x1164e0!=='string'||_0x1164e0[_0x6ad3('0x3')]===0x0){return _0x17a9b2(_0x6ad3('0x4'));}if(typeof _0x32fb2f!==_0x6ad3('0x5')||_0x32fb2f[_0x6ad3('0x3')]===0x0){return _0x17a9b2('key\x20should\x20be\x20a\x20string');}if(typeof _0x35a0ee!=='undefined'&&(typeof _0x35a0ee!=='string'||_0x35a0ee['length']===0x0)){return _0x17a9b2(_0x6ad3('0x6'));}try{_0x3d8fee=fs[_0x6ad3('0x7')](_0x1164e0)[_0x6ad3('0x8')](_0x6ad3('0x9'));}catch(_0x236745){return _0x17a9b2(_0x236745);}return _0xef54ab({'method':_0x6ad3('0xa'),'uri':host+_0x6ad3('0xb')+_0x32fb2f,'body':{'config':{'encoding':_0x6ad3('0xc'),'sampleRateHertz':_0x6ad3('0xd'),'languageCode':_0x35a0ee},'audio':{'content':_0x3d8fee}},'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 9afc5a9..159ecad 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 _0x3d8a=['./asr'];(function(_0x5a8954,_0x4c6d17){var _0x4b29f5=function(_0x39ecea){while(--_0x39ecea){_0x5a8954['push'](_0x5a8954['shift']());}};_0x4b29f5(++_0x4c6d17);}(_0x3d8a,0xa1));var _0xa3d8=function(_0x20e2bb,_0x10e3db){_0x20e2bb=_0x20e2bb-0x0;var _0x2c944c=_0x3d8a[_0x20e2bb];return _0x2c944c;};var asr=require(_0xa3d8('0x0'));module['exports']={'asr':asr}; \ No newline at end of file +var _0x625f=['./asr'];(function(_0x487b0c,_0x14ff74){var _0x1adbdc=function(_0x2e7b9d){while(--_0x2e7b9d){_0x487b0c['push'](_0x487b0c['shift']());}};_0x1adbdc(++_0x14ff74);}(_0x625f,0x17e));var _0xf625=function(_0x35f7f5,_0x4e2ee1){_0x35f7f5=_0x35f7f5-0x0;var _0x5567a4=_0x625f[_0x35f7f5];return _0x5567a4;};var asr=require(_0xf625('0x0'));module['exports']={'asr':asr}; \ No newline at end of file diff --git a/server/services/agi/scripts/index.js b/server/services/agi/scripts/index.js index e711337..4d14e4a 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 _0x3f9e=['dirName','bluebird','dialogflow','http','https','md5','path','querystring','request-promise','sox','google-tts-api','url','parse','util','./google','./sestek','./tilde','agi','protocol','host','WHAT_EVER','get','statusCode','error','request\x20to\x20','statusMessage','\x20failed,\x20status\x20code\x20=\x20','createWriteStream','finish','finish\x20download\x20file','unlink','download\x20error','pipe','end','https:','data','error\x20convert','info','finish\x20to\x20convert','start','generate','.wav','base64','then','chmodSync','777','readFileSync','googleCloudTTS','https://texttospeech.googleapis.com/v1/','?key=','ssml','input','MP3','text:synthesize','POST','tmp','.mp3','from','audioContent','resolve','googleCloudTTS\x20path','split','googleTTS','https://translate.google.com/_/TranslateWebserverUi/data/batchexecute','utf8','application/x-www-form-urlencoded','stringify','null','generic','slice','length','text\x20length\x20limit\x20reached','lang\x20\x22','\x22\x20might\x20not\x20exist','parse\x20response\x20failed:\x0a','writeFileSync','goggleTTS\x20path','googleASR','asr','results','alternatives','transcript','join','map','confidence','googleASR\x20transcription','[%s]\x20%s:%s','googleDialogflow','textRequest','result','source','action','fulfillment','speech','endConversation','metadata','googleDialogflowV2','SessionsClient','sessionPath','detectIntent','Dialogflow\x20V2\x20response:','queryResult','allRequiredParamsPresent','diagnosticInfo','fields','end_conversation','boolValue','intent','name','isFallback','languageCode','responseId','intentDetectionConfidence','tildeASR','polly','awsLex','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','freeform=3','sestekNDA','channelData','CustomAction','CustomActionData','AudioFromTts','audiofile'];(function(_0x19fa2e,_0x15755b){var _0x2118ec=function(_0x241bf6){while(--_0x241bf6){_0x19fa2e['push'](_0x19fa2e['shift']());}};_0x2118ec(++_0x15755b);}(_0x3f9e,0x181));var _0xe3f9=function(_0xfde968,_0x3f9dfc){_0xfde968=_0xfde968-0x0;var _0x4038bd=_0x3f9e[_0xfde968];return _0x4038bd;};'use strict';var apiai=require('apiai-promise');var BPromise=require(_0xe3f9('0x0'));var dialogflow=require(_0xe3f9('0x1'));var fs=require('fs');var http=require(_0xe3f9('0x2'));var https=require(_0xe3f9('0x3'));var md5=require(_0xe3f9('0x4'));var path=require(_0xe3f9('0x5'));var querystring=require(_0xe3f9('0x6'));var rp=require(_0xe3f9('0x7'));var rs=require('randomstring');var sox=require(_0xe3f9('0x8'));var tts=require(_0xe3f9('0x9'));var urlParse=require(_0xe3f9('0xa'))[_0xe3f9('0xb')];var util=require(_0xe3f9('0xc'));var aws=require('./aws');var google=require(_0xe3f9('0xd'));var sestek=require(_0xe3f9('0xe'));var tilde=require(_0xe3f9('0xf'));var logger=require('../../../config/logger')(_0xe3f9('0x10'));var ISPEECH_API='https://api.ispeech.org/api/rest';function downloadFile(_0x485ca2,_0x5dd3e6){return new BPromise(function(_0x523f68,_0x11871d){var _0x1c691f=urlParse(_0x485ca2);var _0x532bd0=_0x1c691f[_0xe3f9('0x11')]==='https:'?https:http;var _0x101f97={'host':_0x1c691f[_0xe3f9('0x12')],'path':_0x1c691f['path'],'headers':{'user-agent':_0xe3f9('0x13')}};_0x532bd0[_0xe3f9('0x14')](_0x101f97,function(_0x868b59){if(_0x868b59[_0xe3f9('0x15')]!==0xc8){logger[_0xe3f9('0x16')](_0xe3f9('0x17')+_0x485ca2+'\x20failed,\x20status\x20code\x20=\x20'+_0x868b59[_0xe3f9('0x15')]+'\x20('+_0x868b59[_0xe3f9('0x18')]+')');_0x11871d(new Error(_0xe3f9('0x17')+_0x485ca2+_0xe3f9('0x19')+_0x868b59[_0xe3f9('0x15')]+'\x20('+_0x868b59[_0xe3f9('0x18')]+')'));return;}var _0x3c45cc=fs[_0xe3f9('0x1a')](_0x5dd3e6);_0x3c45cc['on'](_0xe3f9('0x1b'),function(){logger['info'](_0xe3f9('0x1c'));_0x3c45cc['close'](_0x523f68);});_0x3c45cc['on'](_0xe3f9('0x16'),function(_0x39f14d){fs[_0xe3f9('0x1d')](_0x5dd3e6);logger[_0xe3f9('0x16')](_0xe3f9('0x1e'),_0x39f14d);_0x11871d(_0x39f14d);});_0x868b59[_0xe3f9('0x1f')](_0x3c45cc);})['on'](_0xe3f9('0x16'),function(_0x3d6747){logger[_0xe3f9('0x16')](_0x3d6747);_0x11871d(_0x3d6747);})[_0xe3f9('0x20')]();});}function uploadFile(_0x3ce524){return new BPromise(function(_0x186c67,_0x184d80){var _0x9bdde=urlParse(_0x3ce524);var _0x203833=_0x9bdde[_0xe3f9('0x11')]===_0xe3f9('0x21')?https:http;var _0x254996={'host':_0x9bdde[_0xe3f9('0x12')],'path':_0x9bdde[_0xe3f9('0x5')],'headers':{'user-agent':_0xe3f9('0x13')}};_0x203833['get'](_0x254996,function(_0x2e8341){if(_0x2e8341['statusCode']!==0xc8){_0x184d80(new Error(_0xe3f9('0x17')+_0x3ce524+_0xe3f9('0x19')+_0x2e8341[_0xe3f9('0x15')]+'\x20('+_0x2e8341['statusMessage']+')'));return;}var _0x3abbd5='';_0x2e8341['on'](_0xe3f9('0x22'),function(_0x409ed1){_0x3abbd5+=_0x409ed1;});_0x2e8341['on'](_0xe3f9('0x20'),function(){_0x186c67(_0x3abbd5);});})['on']('error',function(_0x5b679d){_0x184d80(_0x5b679d);})[_0xe3f9('0x20')]();});}function convertFile(_0x227d94,_0x3991cb){return new BPromise(function(_0x25d936,_0x225329){var _0x2b9344=sox['transcode'](_0x227d94,_0x3991cb,{'sampleRate':0x1f40,'format':'wav','channelCount':0x1,'bitRate':0xc0*0x400,'compressionQuality':0x5});_0x2b9344['on'](_0xe3f9('0x16'),function(_0x228c36){logger['error'](_0xe3f9('0x23'),_0x228c36);_0x225329(_0x228c36);});_0x2b9344['on'](_0xe3f9('0x20'),function(){logger[_0xe3f9('0x24')](_0xe3f9('0x25'));_0x25d936();});_0x2b9344[_0xe3f9('0x26')]();});}function base64Decode(_0x5b6f78,_0x52a92b){var _0x533a0e=path['resolve'](__dirname,'tmp',rs[_0xe3f9('0x27')](0x4)+_0xe3f9('0x28'));fs['writeFileSync'](_0x533a0e,_0x5b6f78,_0xe3f9('0x29'));return convertFile(_0x533a0e,_0x52a92b)[_0xe3f9('0x2a')](function(){try{fs['unlink'](_0x533a0e);fs[_0xe3f9('0x2b')](_0x52a92b,_0xe3f9('0x2c'));}catch(_0x1cefeb){logger[_0xe3f9('0x16')](_0x1cefeb);}return _0x52a92b['split']('.')[0x0];});}function base64Encode(_0x36ab01){var _0x5b11e1=fs[_0xe3f9('0x2d')](_0x36ab01);return new Buffer(_0x5b11e1)['toString'](_0xe3f9('0x29'));}exports[_0xe3f9('0x2e')]=function(_0xdb5646,_0x40e9b5,_0x4819b8,_0x5b6d64,_0x4f02d9,_0x34f0ad){var _0x13e732,_0x1bd867;var _0xed27d5=_0xe3f9('0x2f');var _0x598380=_0xe3f9('0x30')+_0xdb5646;var _0x581e09={};if(_0x40e9b5===_0xe3f9('0x31')){_0x581e09[_0xe3f9('0x32')]={'ssml':_0x4819b8};}else{_0x581e09['input']={'text':_0x4819b8};};_0x581e09['voice']={'languageCode':_0x5b6d64,'ssmlGender':_0x4f02d9};_0x581e09['audioConfig']={'audioEncoding':_0xe3f9('0x33'),'sampleRateHertz':0x1f40};var _0x6bb335={'url':_0xed27d5+_0xe3f9('0x34')+_0x598380,'method':_0xe3f9('0x35'),'json':!![],'body':_0x581e09};return rp(_0x6bb335)[_0xe3f9('0x2a')](function(_0x1e6bb3){return new BPromise(function(_0x2e584f,_0x255c6b){_0x13e732=path['resolve'](__dirname,_0xe3f9('0x36'),rs[_0xe3f9('0x27')](0x4)+_0xe3f9('0x37'));var _0x751531=Buffer[_0xe3f9('0x38')](_0x1e6bb3[_0xe3f9('0x39')],_0xe3f9('0x29'));return fs['writeFile'](_0x13e732,_0x751531,function(_0x4d9172){_0x255c6b(_0x4d9172);},function(_0x482084){fs['chmodSync'](_0x13e732,_0xe3f9('0x2c'));_0x2e584f(_0x482084);});});})['then'](function(_0x5322d0){_0x1bd867=path[_0xe3f9('0x3a')](__dirname,_0xe3f9('0x36'),rs['generate'](0x4)+_0xe3f9('0x28'));return convertFile(_0x13e732,_0x1bd867);})[_0xe3f9('0x2a')](function(){try{fs[_0xe3f9('0x1d')](_0x13e732);fs[_0xe3f9('0x2b')](_0x1bd867,_0xe3f9('0x2c'));}catch(_0x9d9fb4){logger[_0xe3f9('0x16')](_0x9d9fb4);}logger[_0xe3f9('0x24')](_0xe3f9('0x3b'),_0x1bd867[_0xe3f9('0x3c')]('.')[0x0]);return _0x1bd867[_0xe3f9('0x3c')]('.')[0x0];});};exports[_0xe3f9('0x3d')]=function(_0x2847e1,_0x567642){var _0x5bb5b0=_0xe3f9('0x3e');var _0x54a07c,_0x3dd207;var _0x25f967;var _0x5100a7={'encoding':_0xe3f9('0x3f'),'method':_0xe3f9('0x35'),'timeout':0x2710,'url':_0x5bb5b0,'headers':{'Content-Type':_0xe3f9('0x40')},'body':'f.req='+encodeURIComponent(JSON[_0xe3f9('0x41')]([[['jQ1olc',JSON[_0xe3f9('0x41')]([_0x2847e1,_0x567642||'en',![],_0xe3f9('0x42')]),null,_0xe3f9('0x43')]]]))};return rp(_0x5100a7)[_0xe3f9('0x2a')](function(_0x5aff46){try{_0x25f967=eval(_0x5aff46[_0xe3f9('0x44')](0x5))[0x0][0x2];}catch(_0x32b8a8){throw new Error('parse\x20response\x20failed:\x0a'+_0x5aff46[_0xe3f9('0x22')]);}if(!_0x25f967){if(_0x2847e1[_0xe3f9('0x45')]>0xc8){throw new Error(_0xe3f9('0x46'));}else{throw new Error(_0xe3f9('0x47')+_0x567642+_0xe3f9('0x48'));}}try{_0x25f967=eval(_0x25f967)[0x0];}catch(_0x3ff96d){throw new Error(_0xe3f9('0x49')+res[_0xe3f9('0x22')]);}const _0x5418b2=_0x25f967;_0x54a07c=path[_0xe3f9('0x3a')](__dirname,_0xe3f9('0x36'),rs[_0xe3f9('0x27')](0x4)+_0xe3f9('0x37'));fs[_0xe3f9('0x4a')](_0x54a07c,_0x25f967,{'encoding':_0xe3f9('0x29')});_0x3dd207=path['resolve'](__dirname,_0xe3f9('0x36'),rs[_0xe3f9('0x27')](0x4)+'.wav');return convertFile(_0x54a07c,_0x3dd207);})[_0xe3f9('0x2a')](function(){try{fs[_0xe3f9('0x1d')](_0x54a07c);fs[_0xe3f9('0x2b')](_0x3dd207,_0xe3f9('0x2c'));}catch(_0x3a57c4){logger[_0xe3f9('0x16')](_0x3a57c4);}logger[_0xe3f9('0x24')](_0xe3f9('0x4b'),_0x3dd207[_0xe3f9('0x3c')]('.')[0x0]);return _0x3dd207[_0xe3f9('0x3c')]('.')[0x0];});};exports[_0xe3f9('0x4c')]=function(_0x30e437,_0x860044,_0x315425){return google[_0xe3f9('0x4d')](_0x30e437,_0x860044,_0x315425)[_0xe3f9('0x2a')](function(_0x4a8f22){logger[_0xe3f9('0x24')](_0x4a8f22['uri']);return rp(_0x4a8f22);})[_0xe3f9('0x2a')](function(_0x581b47){var _0xccc71b='';var _0xcd03bf=0x0;try{fs[_0xe3f9('0x1d')](_0x30e437);}catch(_0x2e92ad){logger[_0xe3f9('0x16')](_0x2e92ad);}if(_0x581b47&&_0x581b47[_0xe3f9('0x4e')]){_0xccc71b=_0x581b47['results']['map'](function(_0x50d18d){return _0x50d18d&&_0x50d18d[_0xe3f9('0x4f')][0x0]&&_0x50d18d['alternatives'][0x0][_0xe3f9('0x50')]?_0x50d18d[_0xe3f9('0x4f')][0x0][_0xe3f9('0x50')]:'';})[_0xe3f9('0x51')]('\x0a');_0xcd03bf=_0x581b47[_0xe3f9('0x4e')][_0xe3f9('0x52')](function(_0x2119d8){return _0x2119d8&&_0x2119d8['alternatives'][0x0]&&_0x2119d8[_0xe3f9('0x4f')][0x0][_0xe3f9('0x53')]?_0x2119d8[_0xe3f9('0x4f')][0x0]['confidence']:0x0;})[_0xe3f9('0x51')]('\x0a');}logger['info'](_0xe3f9('0x54'),_0xccc71b);logger[_0xe3f9('0x24')]('googleASR\x20confidence',_0xcd03bf);return{'transcript':_0xccc71b,'confidence':_0xcd03bf};})['catch'](function(_0x219d65){logger['error'](_0xe3f9('0x55'),_0x219d65['statusCode'],_0x219d65['name'],_0x219d65['message']);});};exports[_0xe3f9('0x56')]=function(_0x106f49,_0x203caf,_0x7c1bf9,_0x3dd4ff){var _0x1c8d71=apiai(_0x203caf,{'language':_0x3dd4ff||'en'});return _0x1c8d71[_0xe3f9('0x57')](_0x7c1bf9,{'sessionId':md5(_0x106f49)})[_0xe3f9('0x2a')](function(_0x5ee7b1){logger[_0xe3f9('0x24')](JSON[_0xe3f9('0x41')](_0x5ee7b1));return{'source':_0x5ee7b1[_0xe3f9('0x58')][_0xe3f9('0x59')],'resolvedQuery':_0x5ee7b1[_0xe3f9('0x58')]['resolvedQuery'],'action':_0x5ee7b1[_0xe3f9('0x58')][_0xe3f9('0x5a')],'actionIncomplete':_0x5ee7b1[_0xe3f9('0x58')]['actionIncomplete'],'speech':_0x5ee7b1['result'][_0xe3f9('0x5b')][_0xe3f9('0x5c')],'score':_0x5ee7b1['result']['score'],'statusCode':_0x5ee7b1['status']['code'],'endConversation':_0x5ee7b1[_0xe3f9('0x58')]['metadata'][_0xe3f9('0x5d')]||![],'isFallbackIntent':_0x5ee7b1[_0xe3f9('0x58')][_0xe3f9('0x5e')]['isFallbackIntent']};});};exports[_0xe3f9('0x5f')]=function(_0x5f57ca,_0x6d2c08,_0x52abef,_0x112267,_0xfa1a5e,_0x3dd3e3){var _0x59f7e8=_0x112267['replace'](/\\n/g,'\x0a');var _0x2736f4={'credentials':{'private_key':_0x59f7e8,'client_email':_0x52abef}};var _0x10c397=new dialogflow[(_0xe3f9('0x60'))](_0x2736f4);var _0x485e2b=_0x10c397[_0xe3f9('0x61')](_0x6d2c08,md5(_0x5f57ca));var _0x1083b1={'session':_0x485e2b,'queryInput':{'text':{'text':_0xfa1a5e,'languageCode':_0x3dd3e3}}};return _0x10c397[_0xe3f9('0x62')](_0x1083b1)['then'](function(_0x408e90){if(_0x408e90&&_0x408e90[_0xe3f9('0x45')]){logger['info'](_0xe3f9('0x63'),JSON[_0xe3f9('0x41')](_0x408e90));var _0x32c593=_0x408e90[0x0];if(_0x32c593){var _0x539ccc={'action':_0x32c593[_0xe3f9('0x64')][_0xe3f9('0x5a')],'allRequiredParamsPresent':_0x32c593[_0xe3f9('0x64')][_0xe3f9('0x65')],'endConversation':_0x32c593['queryResult']['diagnosticInfo']&&_0x32c593[_0xe3f9('0x64')][_0xe3f9('0x66')][_0xe3f9('0x67')]?_0x32c593['queryResult'][_0xe3f9('0x66')][_0xe3f9('0x67')][_0xe3f9('0x68')][_0xe3f9('0x69')]:![],'fulfillmentText':_0x32c593[_0xe3f9('0x64')]['fulfillmentText'],'intentName':_0x32c593[_0xe3f9('0x64')][_0xe3f9('0x6a')][_0xe3f9('0x6b')],'intentDisplayName':_0x32c593[_0xe3f9('0x64')][_0xe3f9('0x6a')]['displayName'],'isFallbackIntent':_0x32c593[_0xe3f9('0x64')][_0xe3f9('0x6a')][_0xe3f9('0x6c')],'languageCode':_0x32c593[_0xe3f9('0x64')][_0xe3f9('0x6d')],'queryText':_0x32c593[_0xe3f9('0x64')]['queryText'],'responseId':_0x32c593[_0xe3f9('0x6e')],'score':_0x32c593[_0xe3f9('0x64')][_0xe3f9('0x6f')],'speech':_0x32c593[_0xe3f9('0x64')]['fulfillmentText'],'providerResponse':JSON[_0xe3f9('0x41')](_0x408e90)};return _0x539ccc;}}});};exports[_0xe3f9('0x70')]=function(_0x4720c2,_0x1aa3ec,_0x4ba47e,_0x4feb3a){return tilde['asr'](_0x4720c2,_0x1aa3ec,_0x4ba47e,_0x4feb3a)[_0xe3f9('0x2a')](function(_0x346a6d){try{fs[_0xe3f9('0x1d')](_0x4720c2);}catch(_0x40895a){logger['error'](_0x40895a);}logger[_0xe3f9('0x24')]('Tilde\x20ASR\x20transcription',_0x346a6d['transcript']);logger[_0xe3f9('0x24')]('Tilde\x20ASR\x20confidence',_0x346a6d[_0xe3f9('0x53')]);return _0x346a6d;});};exports['awsPolly']=function(_0x42a41e,_0x6f6b68,_0x32c5a8,_0x24ddfc,_0x1a016,_0x295d69){var _0x22ecd4=path[_0xe3f9('0x3a')](__dirname,_0xe3f9('0x36'),rs[_0xe3f9('0x27')](0x4)+_0xe3f9('0x37'));var _0x208d99;return aws[_0xe3f9('0x71')](_0x42a41e,_0x6f6b68,_0x32c5a8,_0x24ddfc,_0x1a016,_0x295d69,_0x22ecd4)[_0xe3f9('0x2a')](function(){_0x208d99=path['resolve'](__dirname,_0xe3f9('0x36'),rs[_0xe3f9('0x27')](0x4)+_0xe3f9('0x28'));return convertFile(_0x22ecd4,_0x208d99);})[_0xe3f9('0x2a')](function(){try{fs[_0xe3f9('0x1d')](_0x22ecd4);fs['chmodSync'](_0x208d99,_0xe3f9('0x2c'));}catch(_0x14cfd2){logger[_0xe3f9('0x16')](_0x14cfd2);}return _0x208d99[_0xe3f9('0x3c')]('.')[0x0];});};exports[_0xe3f9('0x72')]=function(_0x1fd404,_0x173090,_0x5af9ba,_0x2e6f6a,_0xa7fd17,_0x29bd4d){return aws['lex'](_0x1fd404,_0x173090,_0x5af9ba,_0x2e6f6a,_0xa7fd17,_0x29bd4d)[_0xe3f9('0x2a')](function(_0x524a26){logger['info'](JSON[_0xe3f9('0x41')](_0x524a26));return _0x524a26;});};exports[_0xe3f9('0x73')]=function(_0x1a3c0b,_0x33fd99,_0x1d9862,_0x3cee63){var _0x10aae1=util[_0xe3f9('0x74')](_0xe3f9('0x75'),ISPEECH_API,_0x1a3c0b,encodeURIComponent(_0x33fd99),_0x1d9862,_0x3cee63);var _0x4e3957=path[_0xe3f9('0x3a')](__dirname,_0xe3f9('0x36'),rs[_0xe3f9('0x27')](0x4)+'.mp3');var _0x3644f7;return downloadFile(_0x10aae1,_0x4e3957)[_0xe3f9('0x2a')](function(){_0x3644f7=path[_0xe3f9('0x3a')](__dirname,'tmp',rs[_0xe3f9('0x27')](0x4)+_0xe3f9('0x28'));return convertFile(_0x4e3957,_0x3644f7);})[_0xe3f9('0x2a')](function(){try{fs['unlink'](_0x4e3957);fs[_0xe3f9('0x2b')](_0x3644f7,'777');}catch(_0x24342b){logger[_0xe3f9('0x16')](_0x24342b);}return _0x3644f7[_0xe3f9('0x3c')]('.')[0x0];});};exports[_0xe3f9('0x76')]=function(_0x41b0d1,_0x41535a,_0x1da3bc,_0x2e40a2){var _0x108eff=util['format'](_0xe3f9('0x77'),ISPEECH_API,_0x41535a,_0x1da3bc,base64Encode(_0x41b0d1),_0x2e40a2?util['format']('model=%s',encodeURIComponent(_0x2e40a2)):_0xe3f9('0x78'));return uploadFile(_0x108eff)[_0xe3f9('0x2a')](function(_0x21a4d2){return querystring[_0xe3f9('0xb')](_0x21a4d2);});};exports[_0xe3f9('0x79')]=function(_0x5576ee,_0x19c2ba){return sestek['nda'](_0x5576ee,_0x19c2ba)['then'](function(_0x98b13b){logger[_0xe3f9('0x24')](JSON[_0xe3f9('0x41')](_0x98b13b));var _0x11b63a={'speech':_0x98b13b['text'],'action':_0x98b13b['channelData']?_0x98b13b[_0xe3f9('0x7a')][_0xe3f9('0x7b')]:undefined,'actiondata':_0x98b13b['channelData']?_0x98b13b[_0xe3f9('0x7a')][_0xe3f9('0x7c')]:undefined};if(_0x98b13b[_0xe3f9('0x7a')]&&_0x98b13b['channelData'][_0xe3f9('0x7d')]){return base64Decode(_0x98b13b['channelData'][_0xe3f9('0x7d')]['Data'],path['resolve'](__dirname,_0xe3f9('0x36'),rs[_0xe3f9('0x27')](0x4)+_0xe3f9('0x28')))[_0xe3f9('0x2a')](function(_0x272c98){_0x11b63a[_0xe3f9('0x7e')]=_0x272c98;return _0x11b63a;});}return _0x11b63a;});};exports[_0xe3f9('0x7f')]=function(){return __dirname;}; \ No newline at end of file +var _0xf37b=['finish\x20to\x20convert','start','resolve','tmp','generate','writeFileSync','base64','then','777','readFileSync','googleCloudTTS','https://texttospeech.googleapis.com/v1/','?key=','input','audioConfig','MP3','POST','.mp3','from','writeFile','chmodSync','.wav','googleCloudTTS\x20path','split','googleTTS','https://translate.google.com/_/TranslateWebserverUi/data/batchexecute','utf8','application/x-www-form-urlencoded','f.req=','stringify','jQ1olc','null','data','lang\x20\x22','\x22\x20might\x20not\x20exist','goggleTTS\x20path','googleASR','asr','uri','results','map','alternatives','transcript','join','confidence','googleASR\x20confidence','catch','name','message','googleDialogflow','textRequest','source','result','resolvedQuery','fulfillment','speech','score','code','endConversation','isFallbackIntent','replace','SessionsClient','length','Dialogflow\x20V2\x20response:','queryResult','action','diagnosticInfo','fields','end_conversation','boolValue','intent','isFallback','fulfillmentText','Tilde\x20ASR\x20transcription','Tilde\x20ASR\x20confidence','awsPolly','polly','awsLex','lex','%s?apikey=%s&action=convert&text=%s&voice=%s&speed=%s&format=mp3','ispeechASR','format','%s?apikey=%s&action=recognize&locale=%s&content-type=audio/x-wav&audio=%s&%s','model=%s','sestekNDA','text','channelData','CustomAction','AudioFromTts','Data','audiofile','dirName','apiai-promise','bluebird','dialogflow','http','https','md5','path','randomstring','sox','parse','util','./aws','./tilde','../../../config/logger','agi','https://api.ispeech.org/api/rest','host','WHAT_EVER','get','statusCode','error','request\x20to\x20','\x20failed,\x20status\x20code\x20=\x20','statusMessage','finish','info','finish\x20download\x20file','close','unlink','download\x20error','pipe','end','protocol','https:','transcode','error\x20convert'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xf37b,0x15c));var _0xbf37=function(_0x424a9a,_0x2dd9af){_0x424a9a=_0x424a9a-0x0;var _0xa7831c=_0xf37b[_0x424a9a];return _0xa7831c;};'use strict';var apiai=require(_0xbf37('0x0'));var BPromise=require(_0xbf37('0x1'));var dialogflow=require(_0xbf37('0x2'));var fs=require('fs');var http=require(_0xbf37('0x3'));var https=require(_0xbf37('0x4'));var md5=require(_0xbf37('0x5'));var path=require(_0xbf37('0x6'));var querystring=require('querystring');var rp=require('request-promise');var rs=require(_0xbf37('0x7'));var sox=require(_0xbf37('0x8'));var tts=require('google-tts-api');var urlParse=require('url')[_0xbf37('0x9')];var util=require(_0xbf37('0xa'));var aws=require(_0xbf37('0xb'));var google=require('./google');var sestek=require('./sestek');var tilde=require(_0xbf37('0xc'));var logger=require(_0xbf37('0xd'))(_0xbf37('0xe'));var ISPEECH_API=_0xbf37('0xf');function downloadFile(_0xae6449,_0xa38c2a){return new BPromise(function(_0x168e42,_0x176043){var _0xa09ba=urlParse(_0xae6449);var _0x256eac=_0xa09ba['protocol']==='https:'?https:http;var _0x2e42b7={'host':_0xa09ba[_0xbf37('0x10')],'path':_0xa09ba[_0xbf37('0x6')],'headers':{'user-agent':_0xbf37('0x11')}};_0x256eac[_0xbf37('0x12')](_0x2e42b7,function(_0x1cd533){if(_0x1cd533[_0xbf37('0x13')]!==0xc8){logger[_0xbf37('0x14')](_0xbf37('0x15')+_0xae6449+_0xbf37('0x16')+_0x1cd533[_0xbf37('0x13')]+'\x20('+_0x1cd533[_0xbf37('0x17')]+')');_0x176043(new Error(_0xbf37('0x15')+_0xae6449+_0xbf37('0x16')+_0x1cd533['statusCode']+'\x20('+_0x1cd533[_0xbf37('0x17')]+')'));return;}var _0x513fcd=fs['createWriteStream'](_0xa38c2a);_0x513fcd['on'](_0xbf37('0x18'),function(){logger[_0xbf37('0x19')](_0xbf37('0x1a'));_0x513fcd[_0xbf37('0x1b')](_0x168e42);});_0x513fcd['on'](_0xbf37('0x14'),function(_0xa81325){fs[_0xbf37('0x1c')](_0xa38c2a);logger['error'](_0xbf37('0x1d'),_0xa81325);_0x176043(_0xa81325);});_0x1cd533[_0xbf37('0x1e')](_0x513fcd);})['on'](_0xbf37('0x14'),function(_0x2d6605){logger[_0xbf37('0x14')](_0x2d6605);_0x176043(_0x2d6605);})[_0xbf37('0x1f')]();});}function uploadFile(_0x557821){return new BPromise(function(_0x13dac7,_0x23c20b){var _0x29f86f=urlParse(_0x557821);var _0x4e2b52=_0x29f86f[_0xbf37('0x20')]===_0xbf37('0x21')?https:http;var _0x4c21eb={'host':_0x29f86f[_0xbf37('0x10')],'path':_0x29f86f[_0xbf37('0x6')],'headers':{'user-agent':'WHAT_EVER'}};_0x4e2b52[_0xbf37('0x12')](_0x4c21eb,function(_0x5dee78){if(_0x5dee78['statusCode']!==0xc8){_0x23c20b(new Error(_0xbf37('0x15')+_0x557821+'\x20failed,\x20status\x20code\x20=\x20'+_0x5dee78['statusCode']+'\x20('+_0x5dee78[_0xbf37('0x17')]+')'));return;}var _0xeb122e='';_0x5dee78['on']('data',function(_0x50dd16){_0xeb122e+=_0x50dd16;});_0x5dee78['on']('end',function(){_0x13dac7(_0xeb122e);});})['on'](_0xbf37('0x14'),function(_0x203dbd){_0x23c20b(_0x203dbd);})[_0xbf37('0x1f')]();});}function convertFile(_0x3da0b7,_0x63c8d5){return new BPromise(function(_0x1c80dd,_0x186dc8){var _0x4484a1=sox[_0xbf37('0x22')](_0x3da0b7,_0x63c8d5,{'sampleRate':0x1f40,'format':'wav','channelCount':0x1,'bitRate':0xc0*0x400,'compressionQuality':0x5});_0x4484a1['on'](_0xbf37('0x14'),function(_0x48e4d5){logger[_0xbf37('0x14')](_0xbf37('0x23'),_0x48e4d5);_0x186dc8(_0x48e4d5);});_0x4484a1['on'](_0xbf37('0x1f'),function(){logger[_0xbf37('0x19')](_0xbf37('0x24'));_0x1c80dd();});_0x4484a1[_0xbf37('0x25')]();});}function base64Decode(_0x40d2fd,_0x1306be){var _0x15d358=path[_0xbf37('0x26')](__dirname,_0xbf37('0x27'),rs[_0xbf37('0x28')](0x4)+'.wav');fs[_0xbf37('0x29')](_0x15d358,_0x40d2fd,_0xbf37('0x2a'));return convertFile(_0x15d358,_0x1306be)[_0xbf37('0x2b')](function(){try{fs['unlink'](_0x15d358);fs['chmodSync'](_0x1306be,_0xbf37('0x2c'));}catch(_0xf58d45){logger[_0xbf37('0x14')](_0xf58d45);}return _0x1306be['split']('.')[0x0];});}function base64Encode(_0x1252ab){var _0x12538a=fs[_0xbf37('0x2d')](_0x1252ab);return new Buffer(_0x12538a)['toString'](_0xbf37('0x2a'));}exports[_0xbf37('0x2e')]=function(_0xb4e4a9,_0x5e770b,_0x3b1bd5,_0x244333,_0x36cf6c,_0x194cbf){var _0x436038,_0x12f531;var _0x377bd1=_0xbf37('0x2f');var _0x36152c=_0xbf37('0x30')+_0xb4e4a9;var _0x3c1dc4={};if(_0x5e770b==='ssml'){_0x3c1dc4[_0xbf37('0x31')]={'ssml':_0x3b1bd5};}else{_0x3c1dc4['input']={'text':_0x3b1bd5};};_0x3c1dc4['voice']={'languageCode':_0x244333,'ssmlGender':_0x36cf6c};_0x3c1dc4[_0xbf37('0x32')]={'audioEncoding':_0xbf37('0x33'),'sampleRateHertz':0x1f40};var _0x23a8a5={'url':_0x377bd1+'text:synthesize'+_0x36152c,'method':_0xbf37('0x34'),'json':!![],'body':_0x3c1dc4};return rp(_0x23a8a5)['then'](function(_0x2b1132){return new BPromise(function(_0xda99be,_0x565654){_0x436038=path[_0xbf37('0x26')](__dirname,_0xbf37('0x27'),rs[_0xbf37('0x28')](0x4)+_0xbf37('0x35'));var _0x50a106=Buffer[_0xbf37('0x36')](_0x2b1132['audioContent'],_0xbf37('0x2a'));return fs[_0xbf37('0x37')](_0x436038,_0x50a106,function(_0x5371b5){_0x565654(_0x5371b5);},function(_0x39378f){fs[_0xbf37('0x38')](_0x436038,_0xbf37('0x2c'));_0xda99be(_0x39378f);});});})['then'](function(_0x2f3b3b){_0x12f531=path[_0xbf37('0x26')](__dirname,'tmp',rs['generate'](0x4)+_0xbf37('0x39'));return convertFile(_0x436038,_0x12f531);})[_0xbf37('0x2b')](function(){try{fs[_0xbf37('0x1c')](_0x436038);fs[_0xbf37('0x38')](_0x12f531,_0xbf37('0x2c'));}catch(_0x56b7d8){logger[_0xbf37('0x14')](_0x56b7d8);}logger['info'](_0xbf37('0x3a'),_0x12f531[_0xbf37('0x3b')]('.')[0x0]);return _0x12f531['split']('.')[0x0];});};exports[_0xbf37('0x3c')]=function(_0x5c79c8,_0x586bde){var _0x3ea7a8=_0xbf37('0x3d');var _0x5a386c,_0x421e80;var _0x5c1535;var _0x3db9af={'encoding':_0xbf37('0x3e'),'method':_0xbf37('0x34'),'timeout':0x2710,'url':_0x3ea7a8,'headers':{'Content-Type':_0xbf37('0x3f')},'body':_0xbf37('0x40')+encodeURIComponent(JSON[_0xbf37('0x41')]([[[_0xbf37('0x42'),JSON[_0xbf37('0x41')]([_0x5c79c8,_0x586bde||'en',![],_0xbf37('0x43')]),null,'generic']]]))};return rp(_0x3db9af)['then'](function(_0x36e5aa){try{_0x5c1535=eval(_0x36e5aa['slice'](0x5))[0x0][0x2];}catch(_0x5755e9){throw new Error('parse\x20response\x20failed:\x0a'+_0x36e5aa[_0xbf37('0x44')]);}if(!_0x5c1535){if(_0x5c79c8['length']>0xc8){throw new Error('text\x20length\x20limit\x20reached');}else{throw new Error(_0xbf37('0x45')+_0x586bde+_0xbf37('0x46'));}}try{_0x5c1535=eval(_0x5c1535)[0x0];}catch(_0x1bf0c6){throw new Error('parse\x20response\x20failed:\x0a'+res[_0xbf37('0x44')]);}const _0x13b079=_0x5c1535;_0x5a386c=path[_0xbf37('0x26')](__dirname,_0xbf37('0x27'),rs['generate'](0x4)+'.mp3');fs['writeFileSync'](_0x5a386c,_0x5c1535,{'encoding':_0xbf37('0x2a')});_0x421e80=path[_0xbf37('0x26')](__dirname,_0xbf37('0x27'),rs[_0xbf37('0x28')](0x4)+_0xbf37('0x39'));return convertFile(_0x5a386c,_0x421e80);})[_0xbf37('0x2b')](function(){try{fs[_0xbf37('0x1c')](_0x5a386c);fs[_0xbf37('0x38')](_0x421e80,_0xbf37('0x2c'));}catch(_0x326a79){logger[_0xbf37('0x14')](_0x326a79);}logger['info'](_0xbf37('0x47'),_0x421e80[_0xbf37('0x3b')]('.')[0x0]);return _0x421e80[_0xbf37('0x3b')]('.')[0x0];});};exports[_0xbf37('0x48')]=function(_0x1ee819,_0x38d221,_0x199b5e){return google[_0xbf37('0x49')](_0x1ee819,_0x38d221,_0x199b5e)[_0xbf37('0x2b')](function(_0x18d2e6){logger[_0xbf37('0x19')](_0x18d2e6[_0xbf37('0x4a')]);return rp(_0x18d2e6);})[_0xbf37('0x2b')](function(_0x1590ae){var _0x5bd46a='';var _0x1f83a3=0x0;try{fs[_0xbf37('0x1c')](_0x1ee819);}catch(_0x44a375){logger[_0xbf37('0x14')](_0x44a375);}if(_0x1590ae&&_0x1590ae[_0xbf37('0x4b')]){_0x5bd46a=_0x1590ae[_0xbf37('0x4b')][_0xbf37('0x4c')](function(_0x1bc34b){return _0x1bc34b&&_0x1bc34b[_0xbf37('0x4d')][0x0]&&_0x1bc34b[_0xbf37('0x4d')][0x0][_0xbf37('0x4e')]?_0x1bc34b[_0xbf37('0x4d')][0x0]['transcript']:'';})[_0xbf37('0x4f')]('\x0a');_0x1f83a3=_0x1590ae[_0xbf37('0x4b')][_0xbf37('0x4c')](function(_0x9c5803){return _0x9c5803&&_0x9c5803[_0xbf37('0x4d')][0x0]&&_0x9c5803[_0xbf37('0x4d')][0x0][_0xbf37('0x50')]?_0x9c5803[_0xbf37('0x4d')][0x0][_0xbf37('0x50')]:0x0;})[_0xbf37('0x4f')]('\x0a');}logger[_0xbf37('0x19')]('googleASR\x20transcription',_0x5bd46a);logger[_0xbf37('0x19')](_0xbf37('0x51'),_0x1f83a3);return{'transcript':_0x5bd46a,'confidence':_0x1f83a3};})[_0xbf37('0x52')](function(_0x2ec52d){logger[_0xbf37('0x14')]('[%s]\x20%s:%s',_0x2ec52d['statusCode'],_0x2ec52d[_0xbf37('0x53')],_0x2ec52d[_0xbf37('0x54')]);});};exports[_0xbf37('0x55')]=function(_0x47145d,_0x199ee8,_0x33e7f4,_0x5588b2){var _0x470ec4=apiai(_0x199ee8,{'language':_0x5588b2||'en'});return _0x470ec4[_0xbf37('0x56')](_0x33e7f4,{'sessionId':md5(_0x47145d)})[_0xbf37('0x2b')](function(_0x529fc9){logger[_0xbf37('0x19')](JSON['stringify'](_0x529fc9));return{'source':_0x529fc9['result'][_0xbf37('0x57')],'resolvedQuery':_0x529fc9[_0xbf37('0x58')][_0xbf37('0x59')],'action':_0x529fc9[_0xbf37('0x58')]['action'],'actionIncomplete':_0x529fc9['result']['actionIncomplete'],'speech':_0x529fc9[_0xbf37('0x58')][_0xbf37('0x5a')][_0xbf37('0x5b')],'score':_0x529fc9[_0xbf37('0x58')][_0xbf37('0x5c')],'statusCode':_0x529fc9['status'][_0xbf37('0x5d')],'endConversation':_0x529fc9[_0xbf37('0x58')]['metadata'][_0xbf37('0x5e')]||![],'isFallbackIntent':_0x529fc9[_0xbf37('0x58')]['metadata'][_0xbf37('0x5f')]};});};exports['googleDialogflowV2']=function(_0x3ba354,_0x1c7250,_0x2eb859,_0x2a2fc3,_0x30e5fc,_0x1897e2){var _0x3adc64=_0x2a2fc3[_0xbf37('0x60')](/\\n/g,'\x0a');var _0x1cbb57={'credentials':{'private_key':_0x3adc64,'client_email':_0x2eb859}};var _0x3a0e36=new dialogflow[(_0xbf37('0x61'))](_0x1cbb57);var _0x3367bd=_0x3a0e36['sessionPath'](_0x1c7250,md5(_0x3ba354));var _0x303f74={'session':_0x3367bd,'queryInput':{'text':{'text':_0x30e5fc,'languageCode':_0x1897e2}}};return _0x3a0e36['detectIntent'](_0x303f74)['then'](function(_0xb1b5fc){if(_0xb1b5fc&&_0xb1b5fc[_0xbf37('0x62')]){logger[_0xbf37('0x19')](_0xbf37('0x63'),JSON['stringify'](_0xb1b5fc));var _0x2e3020=_0xb1b5fc[0x0];if(_0x2e3020){var _0xce500={'action':_0x2e3020[_0xbf37('0x64')][_0xbf37('0x65')],'allRequiredParamsPresent':_0x2e3020[_0xbf37('0x64')]['allRequiredParamsPresent'],'endConversation':_0x2e3020['queryResult'][_0xbf37('0x66')]&&_0x2e3020['queryResult'][_0xbf37('0x66')][_0xbf37('0x67')]?_0x2e3020[_0xbf37('0x64')][_0xbf37('0x66')]['fields'][_0xbf37('0x68')][_0xbf37('0x69')]:![],'fulfillmentText':_0x2e3020[_0xbf37('0x64')]['fulfillmentText'],'intentName':_0x2e3020[_0xbf37('0x64')][_0xbf37('0x6a')][_0xbf37('0x53')],'intentDisplayName':_0x2e3020[_0xbf37('0x64')][_0xbf37('0x6a')]['displayName'],'isFallbackIntent':_0x2e3020[_0xbf37('0x64')]['intent'][_0xbf37('0x6b')],'languageCode':_0x2e3020[_0xbf37('0x64')]['languageCode'],'queryText':_0x2e3020[_0xbf37('0x64')]['queryText'],'responseId':_0x2e3020['responseId'],'score':_0x2e3020[_0xbf37('0x64')]['intentDetectionConfidence'],'speech':_0x2e3020[_0xbf37('0x64')][_0xbf37('0x6c')],'providerResponse':JSON[_0xbf37('0x41')](_0xb1b5fc)};return _0xce500;}}});};exports['tildeASR']=function(_0x2995f0,_0x1cbe8f,_0x59371a,_0x295113){return tilde[_0xbf37('0x49')](_0x2995f0,_0x1cbe8f,_0x59371a,_0x295113)[_0xbf37('0x2b')](function(_0x4bb316){try{fs['unlink'](_0x2995f0);}catch(_0x3328d3){logger[_0xbf37('0x14')](_0x3328d3);}logger[_0xbf37('0x19')](_0xbf37('0x6d'),_0x4bb316['transcript']);logger[_0xbf37('0x19')](_0xbf37('0x6e'),_0x4bb316['confidence']);return _0x4bb316;});};exports[_0xbf37('0x6f')]=function(_0x4c2d95,_0x5ac116,_0x2a91aa,_0x6cd799,_0x10bcc1,_0x95066f){var _0x1c8a29=path['resolve'](__dirname,'tmp',rs[_0xbf37('0x28')](0x4)+_0xbf37('0x35'));var _0x16df7;return aws[_0xbf37('0x70')](_0x4c2d95,_0x5ac116,_0x2a91aa,_0x6cd799,_0x10bcc1,_0x95066f,_0x1c8a29)[_0xbf37('0x2b')](function(){_0x16df7=path[_0xbf37('0x26')](__dirname,_0xbf37('0x27'),rs[_0xbf37('0x28')](0x4)+_0xbf37('0x39'));return convertFile(_0x1c8a29,_0x16df7);})[_0xbf37('0x2b')](function(){try{fs['unlink'](_0x1c8a29);fs[_0xbf37('0x38')](_0x16df7,_0xbf37('0x2c'));}catch(_0x515e70){logger['error'](_0x515e70);}return _0x16df7[_0xbf37('0x3b')]('.')[0x0];});};exports[_0xbf37('0x71')]=function(_0x455572,_0x4e6bfa,_0x69efbb,_0x3e2399,_0x51bfa1,_0x188ef9){return aws[_0xbf37('0x72')](_0x455572,_0x4e6bfa,_0x69efbb,_0x3e2399,_0x51bfa1,_0x188ef9)['then'](function(_0x314f64){logger[_0xbf37('0x19')](JSON[_0xbf37('0x41')](_0x314f64));return _0x314f64;});};exports['ispeechTTS']=function(_0x5c4f65,_0x2843d5,_0x5e4382,_0x55a74f){var _0x10a736=util['format'](_0xbf37('0x73'),ISPEECH_API,_0x5c4f65,encodeURIComponent(_0x2843d5),_0x5e4382,_0x55a74f);var _0x2161b4=path['resolve'](__dirname,'tmp',rs[_0xbf37('0x28')](0x4)+_0xbf37('0x35'));var _0x2dddb1;return downloadFile(_0x10a736,_0x2161b4)[_0xbf37('0x2b')](function(){_0x2dddb1=path[_0xbf37('0x26')](__dirname,_0xbf37('0x27'),rs['generate'](0x4)+_0xbf37('0x39'));return convertFile(_0x2161b4,_0x2dddb1);})['then'](function(){try{fs[_0xbf37('0x1c')](_0x2161b4);fs[_0xbf37('0x38')](_0x2dddb1,_0xbf37('0x2c'));}catch(_0x1eca1d){logger[_0xbf37('0x14')](_0x1eca1d);}return _0x2dddb1[_0xbf37('0x3b')]('.')[0x0];});};exports[_0xbf37('0x74')]=function(_0x552e80,_0x1bfa24,_0x5e3071,_0x542633){var _0x6bef83=util[_0xbf37('0x75')](_0xbf37('0x76'),ISPEECH_API,_0x1bfa24,_0x5e3071,base64Encode(_0x552e80),_0x542633?util[_0xbf37('0x75')](_0xbf37('0x77'),encodeURIComponent(_0x542633)):'freeform=3');return uploadFile(_0x6bef83)['then'](function(_0x521257){return querystring[_0xbf37('0x9')](_0x521257);});};exports[_0xbf37('0x78')]=function(_0x5677de,_0x88674a){return sestek['nda'](_0x5677de,_0x88674a)[_0xbf37('0x2b')](function(_0x55e5d8){logger['info'](JSON[_0xbf37('0x41')](_0x55e5d8));var _0x1b8e23={'speech':_0x55e5d8[_0xbf37('0x79')],'action':_0x55e5d8['channelData']?_0x55e5d8[_0xbf37('0x7a')][_0xbf37('0x7b')]:undefined,'actiondata':_0x55e5d8['channelData']?_0x55e5d8[_0xbf37('0x7a')]['CustomActionData']:undefined};if(_0x55e5d8[_0xbf37('0x7a')]&&_0x55e5d8[_0xbf37('0x7a')][_0xbf37('0x7c')]){return base64Decode(_0x55e5d8[_0xbf37('0x7a')]['AudioFromTts'][_0xbf37('0x7d')],path['resolve'](__dirname,_0xbf37('0x27'),rs['generate'](0x4)+_0xbf37('0x39')))[_0xbf37('0x2b')](function(_0x4c7470){_0x1b8e23[_0xbf37('0x7e')]=_0x4c7470;return _0x1b8e23;});}return _0x1b8e23;});};exports[_0xbf37('0x7f')]=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 2aadd3a..5c538fe 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 _0xe76a=['exports','./nda'];(function(_0x85dfd0,_0x161180){var _0x1fdff5=function(_0x4cbe1a){while(--_0x4cbe1a){_0x85dfd0['push'](_0x85dfd0['shift']());}};_0x1fdff5(++_0x161180);}(_0xe76a,0x1af));var _0xae76=function(_0x18fd01,_0x3e4a0a){_0x18fd01=_0x18fd01-0x0;var _0xafd22=_0xe76a[_0x18fd01];return _0xafd22;};var nda=require(_0xae76('0x0'));module[_0xae76('0x1')]={'nda':nda}; \ No newline at end of file +var _0x96cc=['exports'];(function(_0x1ed354,_0x4bb5be){var _0x532757=function(_0x574f3e){while(--_0x574f3e){_0x1ed354['push'](_0x1ed354['shift']());}};_0x532757(++_0x4bb5be);}(_0x96cc,0x160));var _0xc96c=function(_0x3c330d,_0x4488d7){_0x3c330d=_0x3c330d-0x0;var _0x4be4eb=_0x96cc[_0x3c330d];return _0x4be4eb;};var nda=require('./nda');module[_0xc96c('0x0')]={'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 7247110..d1f6404 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 _0x8d53=['calleridname','dnid','Bearer\x20','access_token','body','ProjectName','project','ndagenerate_audio','channelData','AudioOutputSettings','custom_action','custom_action_data','CustomActionData','info','stringify','request-promise','url','agi','exports','POST','resolve','ndauth_url','password','username','ndassistant_url','ndaactivity_type','message','uniqueid','callerid'];(function(_0x1a830e,_0x35c437){var _0xf03675=function(_0x2ceb63){while(--_0x2ceb63){_0x1a830e['push'](_0x1a830e['shift']());}};_0xf03675(++_0x35c437);}(_0x8d53,0x1c2));var _0x38d5=function(_0x377e23,_0x2dc8fc){_0x377e23=_0x377e23-0x0;var _0x19e26a=_0x8d53[_0x377e23];return _0x19e26a;};'use strict';var rp=require(_0x38d5('0x0'));var url=require(_0x38d5('0x1'));var logger=require('../../../../../config/logger')(_0x38d5('0x2'));module[_0x38d5('0x3')]=function(_0x108137,_0x453bf8){var _0x3a7660={'method':_0x38d5('0x4'),'uri':url[_0x38d5('0x5')](_0x453bf8[_0x38d5('0x6')],'/token'),'form':{'grant_type':_0x38d5('0x7'),'username':_0x453bf8[_0x38d5('0x8')],'password':_0x453bf8[_0x38d5('0x7')]},'json':!![]};return rp(_0x3a7660)['then'](function(_0x5ebf9a){var _0x284f7b={'method':_0x38d5('0x4'),'uri':url[_0x38d5('0x5')](_0x453bf8[_0x38d5('0x9')],'/api/NaturalDialogAssistant/v1/Run'),'body':{'type':_0x453bf8[_0x38d5('0xa')]||_0x38d5('0xb'),'channelId':'Nda','conversation':{'id':_0x108137[_0x38d5('0xc')]},'from':{'id':_0x108137[_0x38d5('0xd')],'name':_0x108137[_0x38d5('0xe')]},'recipient':{'id':_0x108137[_0x38d5('0xf')],'name':_0x108137['extension']},'text':_0x453bf8['text'],'channelData':{}},'headers':{'Authorization':_0x38d5('0x10')+_0x5ebf9a[_0x38d5('0x11')]},'json':!![]};if(_0x453bf8['project']){_0x284f7b[_0x38d5('0x12')]['channelData'][_0x38d5('0x13')]=_0x453bf8[_0x38d5('0x14')];}if(_0x453bf8[_0x38d5('0x15')]=='1'){_0x284f7b[_0x38d5('0x12')][_0x38d5('0x16')][_0x38d5('0x17')]={'Generate':!![],'PutInStructuredPart':![],'ExpectedFormat':'audio/wav'};}if(_0x453bf8[_0x38d5('0x18')]){_0x284f7b['body'][_0x38d5('0x16')]['CustomAction']=_0x453bf8[_0x38d5('0x18')];if(_0x453bf8[_0x38d5('0x19')]){_0x284f7b[_0x38d5('0x12')]['channelData'][_0x38d5('0x1a')]=_0x453bf8[_0x38d5('0x19')];}}logger[_0x38d5('0x1b')](JSON[_0x38d5('0x1c')](_0x284f7b));return rp(_0x284f7b);});}; \ No newline at end of file +var _0xeea4=['ndauth_url','password','username','resolve','ndassistant_url','/api/NaturalDialogAssistant/v1/Run','ndaactivity_type','Nda','uniqueid','callerid','calleridname','dnid','extension','text','Bearer\x20','access_token','project','ProjectName','ndagenerate_audio','body','channelData','AudioOutputSettings','audio/wav','custom_action','CustomAction','custom_action_data','CustomActionData','info','stringify','request-promise','url','../../../../../config/logger','agi','exports','POST'];(function(_0x261bbf,_0x567f53){var _0x3434e5=function(_0x5c194c){while(--_0x5c194c){_0x261bbf['push'](_0x261bbf['shift']());}};_0x3434e5(++_0x567f53);}(_0xeea4,0x19e));var _0x4eea=function(_0x4c196c,_0xb13422){_0x4c196c=_0x4c196c-0x0;var _0x9a69af=_0xeea4[_0x4c196c];return _0x9a69af;};'use strict';var rp=require(_0x4eea('0x0'));var url=require(_0x4eea('0x1'));var logger=require(_0x4eea('0x2'))(_0x4eea('0x3'));module[_0x4eea('0x4')]=function(_0x38a9e8,_0x2a47d5){var _0x2028ed={'method':_0x4eea('0x5'),'uri':url['resolve'](_0x2a47d5[_0x4eea('0x6')],'/token'),'form':{'grant_type':_0x4eea('0x7'),'username':_0x2a47d5[_0x4eea('0x8')],'password':_0x2a47d5[_0x4eea('0x7')]},'json':!![]};return rp(_0x2028ed)['then'](function(_0x1a2e5e){var _0x44116a={'method':'POST','uri':url[_0x4eea('0x9')](_0x2a47d5[_0x4eea('0xa')],_0x4eea('0xb')),'body':{'type':_0x2a47d5[_0x4eea('0xc')]||'message','channelId':_0x4eea('0xd'),'conversation':{'id':_0x38a9e8[_0x4eea('0xe')]},'from':{'id':_0x38a9e8[_0x4eea('0xf')],'name':_0x38a9e8[_0x4eea('0x10')]},'recipient':{'id':_0x38a9e8[_0x4eea('0x11')],'name':_0x38a9e8[_0x4eea('0x12')]},'text':_0x2a47d5[_0x4eea('0x13')],'channelData':{}},'headers':{'Authorization':_0x4eea('0x14')+_0x1a2e5e[_0x4eea('0x15')]},'json':!![]};if(_0x2a47d5[_0x4eea('0x16')]){_0x44116a['body']['channelData'][_0x4eea('0x17')]=_0x2a47d5[_0x4eea('0x16')];}if(_0x2a47d5[_0x4eea('0x18')]=='1'){_0x44116a[_0x4eea('0x19')][_0x4eea('0x1a')][_0x4eea('0x1b')]={'Generate':!![],'PutInStructuredPart':![],'ExpectedFormat':_0x4eea('0x1c')};}if(_0x2a47d5[_0x4eea('0x1d')]){_0x44116a['body'][_0x4eea('0x1a')][_0x4eea('0x1e')]=_0x2a47d5[_0x4eea('0x1d')];if(_0x2a47d5[_0x4eea('0x1f')]){_0x44116a['body'][_0x4eea('0x1a')][_0x4eea('0x20')]=_0x2a47d5[_0x4eea('0x1f')];}}logger[_0x4eea('0x21')](JSON[_0x4eea('0x22')](_0x44116a));return rp(_0x44116a);});}; \ 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 45ec1dd..7cada64 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 _0x5e9a=['./lib/api','exports'];(function(_0x3dde18,_0x11bdb0){var _0x436d04=function(_0x3f86ba){while(--_0x3f86ba){_0x3dde18['push'](_0x3dde18['shift']());}};_0x436d04(++_0x11bdb0);}(_0x5e9a,0x160));var _0xa5e9=function(_0x258d2a,_0x227588){_0x258d2a=_0x258d2a-0x0;var _0x48aad5=_0x5e9a[_0x258d2a];return _0x48aad5;};'use strict';var asr=require(_0xa5e9('0x0'));module[_0xa5e9('0x1')]=function(_0x3940a5,_0x3bba95,_0x52ba10,_0x57dc89){return asr(_0x3940a5,_0x3bba95,_0x52ba10,_0x57dc89);}; \ No newline at end of file +var _0x39cd=['exports'];(function(_0x3dc240,_0x108c2a){var _0x38aca2=function(_0x3a3705){while(--_0x3a3705){_0x3dc240['push'](_0x3dc240['shift']());}};_0x38aca2(++_0x108c2a);}(_0x39cd,0x13c));var _0xd39c=function(_0x1a7846,_0x59723e){_0x1a7846=_0x1a7846-0x0;var _0x48049=_0x39cd[_0x1a7846];return _0x48049;};'use strict';var asr=require('./lib/api');module[_0xd39c('0x0')]=function(_0xe0fee2,_0x4e037b,_0x26e6ab,_0x5d7585){return asr(_0xe0fee2,_0x4e037b,_0x26e6ab,_0x5d7585);}; \ 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 ffe7515..589ec9d 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 _0x0d57=['data','error','Tilde\x20ASR\x20send\x20error','terminate','parse','result','final','Tilde\x20ASR\x20hypoteses','hypotheses','transcript','likelihood','Success.','No\x20speech.\x20Sent\x20when\x20the\x20incoming\x20audio\x20contains\x20a\x20large\x20portion\x20of\x20silence\x20or\x20non-speech','Aborted.\x20Recognition\x20was\x20aborted\x20for\x20some\x20reason.','Not\x20available.\x20Max\x20load\x20limit\x20reached.','Authentication\x20failed.','All\x20recognition\x20workers\x20are\x20currently\x20in\x20use\x20and\x20real-time\x20recognition\x20is\x20not\x20possible.','Tilde\x20ASR\x20parse\x20error','Close\x20Tilde\x20ASR\x20socket','Error\x20Tilde\x20ASR\x20socket','isNil','isObject','message','close','bluebird','lodash','exports','Tilde\x20URI','wss://runa.tilde.lv/client/ws/speech/LVASR-ONLINE','createHash','sha1','update','hex','info','Open\x20Tilde\x20ASR\x20socket','unix','send','stringify','createReadStream'];(function(_0xee3a8c,_0x13146c){var _0x41a2e2=function(_0x1c84a5){while(--_0x1c84a5){_0xee3a8c['push'](_0xee3a8c['shift']());}};_0x41a2e2(++_0x13146c);}(_0x0d57,0x66));var _0x70d5=function(_0x2dafbe,_0x5d04de){_0x2dafbe=_0x2dafbe-0x0;var _0x58a45a=_0x0d57[_0x2dafbe];return _0x58a45a;};'use strict';var BPromise=require(_0x70d5('0x0'));var _=require(_0x70d5('0x1'));var fs=require('fs');var WebSocket=require('ws');var moment=require('moment');var crypto=require('crypto');var logger=require('../../../../../../config/logger')('agi');module[_0x70d5('0x2')]=function(_0x45a25b,_0x197640,_0x32556b,_0x280b80){return new BPromise(function(_0xa6319b,_0x11f352){logger['info'](_0x70d5('0x3'),_0x280b80||_0x70d5('0x4'));var _0x56be66=new WebSocket(_0x280b80||_0x70d5('0x4'),{'perMessageDeflate':![]});var _0x5d018d='';var _0x3cd9fa='0';var _0xa4a572='1';var _0x13981d='No\x20speech.\x20Sent\x20when\x20the\x20incoming\x20audio\x20contains\x20a\x20large\x20portion\x20of\x20silence\x20or\x20non-speech';function _0x2240e8(_0x580961){var _0xa09608=crypto[_0x70d5('0x5')](_0x70d5('0x6'));_0xa09608[_0x70d5('0x7')](_0x580961);return _0xa09608['digest'](_0x70d5('0x8'));}function _0xb12c3c(){try{logger[_0x70d5('0x9')](_0x70d5('0xa'));var _0x21ede9=moment()[_0x70d5('0xb')]();var _0x1ce77b=_0x2240e8(_0x21ede9+_0x197640+_0x32556b);_0x56be66[_0x70d5('0xc')](JSON[_0x70d5('0xd')]({'appID':_0x197640,'timestamp':_0x21ede9,'appKey':_0x1ce77b}));var _0x40bc98=fs[_0x70d5('0xe')](_0x45a25b);_0x40bc98['on'](_0x70d5('0xf'),function(_0x1a819a){_0x56be66[_0x70d5('0xc')](_0x1a819a);});_0x40bc98['on']('close',function(){_0x56be66[_0x70d5('0xc')]('EOS');});}catch(_0x38d96b){logger[_0x70d5('0x10')](_0x70d5('0x11'),JSON[_0x70d5('0xd')](_0x38d96b));_0x56be66[_0x70d5('0x12')]();}}function _0x2dc5a4(_0x2fcdb7){try{if(_0x2fcdb7){var _0x149bf2=JSON[_0x70d5('0x13')](_0x2fcdb7);switch(_0x149bf2['status']){case 0x0:if(_0x149bf2['result']){if(_0x149bf2[_0x70d5('0x14')][_0x70d5('0x15')]){logger[_0x70d5('0x9')](_0x70d5('0x16'),JSON[_0x70d5('0xd')](_0x149bf2['result'][_0x70d5('0x17')]));_0x5d018d=_0x149bf2[_0x70d5('0x14')]['hypotheses'][0x0][_0x70d5('0x18')];_0x3cd9fa=_0x149bf2[_0x70d5('0x14')][_0x70d5('0x17')][0x0][_0x70d5('0x19')];_0xa4a572='0';_0x13981d=_0x70d5('0x1a');_0x56be66[_0x70d5('0x12')]();}}break;case 0x1:logger[_0x70d5('0x9')](_0x70d5('0x1b'));_0xa4a572='1';_0x13981d='No\x20speech.\x20Sent\x20when\x20the\x20incoming\x20audio\x20contains\x20a\x20large\x20portion\x20of\x20silence\x20or\x20non-speech';break;case 0x2:logger[_0x70d5('0x9')](_0x70d5('0x1c'));_0xa4a572='2';_0x13981d='Aborted.\x20Recognition\x20was\x20aborted\x20for\x20some\x20reason.';break;case 0x9:logger[_0x70d5('0x9')](_0x70d5('0x1d'));_0xa4a572='9';_0x13981d=_0x70d5('0x1d');break;case 0xa:logger['info'](_0x70d5('0x1e'));_0xa4a572='10';_0x13981d='Authentication\x20failed.';break;case 0xb:logger['info']('All\x20recognition\x20workers\x20are\x20currently\x20in\x20use\x20and\x20real-time\x20recognition\x20is\x20not\x20possible.');_0xa4a572='11';_0x13981d=_0x70d5('0x1f');}}}catch(_0x56447e){logger[_0x70d5('0x10')](_0x70d5('0x20'),JSON[_0x70d5('0xd')](_0x56447e));_0x56be66[_0x70d5('0x12')]();}}function _0x42d59b(){logger[_0x70d5('0x9')](_0x70d5('0x21'));_0xa6319b({'transcript':_0x5d018d,'confidence':_0x3cd9fa,'status':_0xa4a572,'status_message':_0x13981d});}function _0x4d281a(_0x577b6a){logger[_0x70d5('0x10')](_0x70d5('0x22'));if(!_[_0x70d5('0x23')](_0x577b6a)){logger['error'](_[_0x70d5('0x24')](_0x577b6a)?JSON[_0x70d5('0xd')](_0x577b6a):_0x577b6a);}}_0x56be66['on']('open',_0xb12c3c);_0x56be66['on'](_0x70d5('0x25'),_0x2dc5a4);_0x56be66['on'](_0x70d5('0x26'),_0x42d59b);_0x56be66['on'](_0x70d5('0x10'),_0x4d281a);});}; \ No newline at end of file +var _0x456f=['createReadStream','data','close','EOS','error','Tilde\x20ASR\x20send\x20error','terminate','parse','status','result','hypotheses','transcript','Success.','Aborted.\x20Recognition\x20was\x20aborted\x20for\x20some\x20reason.','Not\x20available.\x20Max\x20load\x20limit\x20reached.','Authentication\x20failed.','All\x20recognition\x20workers\x20are\x20currently\x20in\x20use\x20and\x20real-time\x20recognition\x20is\x20not\x20possible.','Tilde\x20ASR\x20parse\x20error','Close\x20Tilde\x20ASR\x20socket','Error\x20Tilde\x20ASR\x20socket','isNil','isObject','open','message','bluebird','lodash','moment','crypto','../../../../../../config/logger','agi','exports','info','Tilde\x20URI','wss://runa.tilde.lv/client/ws/speech/LVASR-ONLINE','No\x20speech.\x20Sent\x20when\x20the\x20incoming\x20audio\x20contains\x20a\x20large\x20portion\x20of\x20silence\x20or\x20non-speech','createHash','sha1','update','digest','hex','unix','send','stringify'];(function(_0x106840,_0x4ace2c){var _0x428086=function(_0x34b144){while(--_0x34b144){_0x106840['push'](_0x106840['shift']());}};_0x428086(++_0x4ace2c);}(_0x456f,0x1f1));var _0xf456=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x456f[_0x3dd15e];return _0x231fd0;};'use strict';var BPromise=require(_0xf456('0x0'));var _=require(_0xf456('0x1'));var fs=require('fs');var WebSocket=require('ws');var moment=require(_0xf456('0x2'));var crypto=require(_0xf456('0x3'));var logger=require(_0xf456('0x4'))(_0xf456('0x5'));module[_0xf456('0x6')]=function(_0x28c980,_0x209201,_0xac60a,_0x527680){return new BPromise(function(_0x3ab601,_0x3290af){logger[_0xf456('0x7')](_0xf456('0x8'),_0x527680||_0xf456('0x9'));var _0x25e026=new WebSocket(_0x527680||_0xf456('0x9'),{'perMessageDeflate':![]});var _0x4d6938='';var _0x12188d='0';var _0xd98e61='1';var _0x4ef692=_0xf456('0xa');function _0x2cef1d(_0x3b3433){var _0x3f5ffe=crypto[_0xf456('0xb')](_0xf456('0xc'));_0x3f5ffe[_0xf456('0xd')](_0x3b3433);return _0x3f5ffe[_0xf456('0xe')](_0xf456('0xf'));}function _0x5d8911(){try{logger['info']('Open\x20Tilde\x20ASR\x20socket');var _0x34be20=moment()[_0xf456('0x10')]();var _0x5359ac=_0x2cef1d(_0x34be20+_0x209201+_0xac60a);_0x25e026[_0xf456('0x11')](JSON[_0xf456('0x12')]({'appID':_0x209201,'timestamp':_0x34be20,'appKey':_0x5359ac}));var _0x38d647=fs[_0xf456('0x13')](_0x28c980);_0x38d647['on'](_0xf456('0x14'),function(_0x10236b){_0x25e026['send'](_0x10236b);});_0x38d647['on'](_0xf456('0x15'),function(){_0x25e026[_0xf456('0x11')](_0xf456('0x16'));});}catch(_0x5170c6){logger[_0xf456('0x17')](_0xf456('0x18'),JSON[_0xf456('0x12')](_0x5170c6));_0x25e026[_0xf456('0x19')]();}}function _0x5d1599(_0x413833){try{if(_0x413833){var _0x75e3dd=JSON[_0xf456('0x1a')](_0x413833);switch(_0x75e3dd[_0xf456('0x1b')]){case 0x0:if(_0x75e3dd[_0xf456('0x1c')]){if(_0x75e3dd[_0xf456('0x1c')]['final']){logger[_0xf456('0x7')]('Tilde\x20ASR\x20hypoteses',JSON[_0xf456('0x12')](_0x75e3dd[_0xf456('0x1c')]['hypotheses']));_0x4d6938=_0x75e3dd[_0xf456('0x1c')][_0xf456('0x1d')][0x0][_0xf456('0x1e')];_0x12188d=_0x75e3dd[_0xf456('0x1c')][_0xf456('0x1d')][0x0]['likelihood'];_0xd98e61='0';_0x4ef692=_0xf456('0x1f');_0x25e026[_0xf456('0x19')]();}}break;case 0x1:logger['info'](_0xf456('0xa'));_0xd98e61='1';_0x4ef692=_0xf456('0xa');break;case 0x2:logger[_0xf456('0x7')](_0xf456('0x20'));_0xd98e61='2';_0x4ef692=_0xf456('0x20');break;case 0x9:logger[_0xf456('0x7')](_0xf456('0x21'));_0xd98e61='9';_0x4ef692='Not\x20available.\x20Max\x20load\x20limit\x20reached.';break;case 0xa:logger[_0xf456('0x7')](_0xf456('0x22'));_0xd98e61='10';_0x4ef692='Authentication\x20failed.';break;case 0xb:logger[_0xf456('0x7')](_0xf456('0x23'));_0xd98e61='11';_0x4ef692=_0xf456('0x23');}}}catch(_0x47df52){logger[_0xf456('0x17')](_0xf456('0x24'),JSON[_0xf456('0x12')](_0x47df52));_0x25e026[_0xf456('0x19')]();}}function _0x2c1d98(){logger[_0xf456('0x7')](_0xf456('0x25'));_0x3ab601({'transcript':_0x4d6938,'confidence':_0x12188d,'status':_0xd98e61,'status_message':_0x4ef692});}function _0x430965(_0x180f48){logger[_0xf456('0x17')](_0xf456('0x26'));if(!_[_0xf456('0x27')](_0x180f48)){logger[_0xf456('0x17')](_[_0xf456('0x28')](_0x180f48)?JSON['stringify'](_0x180f48):_0x180f48);}}_0x25e026['on'](_0xf456('0x29'),_0x5d8911);_0x25e026['on'](_0xf456('0x2a'),_0x5d1599);_0x25e026['on'](_0xf456('0x15'),_0x2c1d98);_0x25e026['on'](_0xf456('0x17'),_0x430965);});}; \ 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 ff11021..10cb4be 100644 --- a/server/services/agi/scripts/tilde/index.js +++ b/server/services/agi/scripts/tilde/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x2994=['exports','./asr'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x2994,0x79));var _0x4299=function(_0x82f586,_0x382c19){_0x82f586=_0x82f586-0x0;var _0x591ec8=_0x2994[_0x82f586];return _0x591ec8;};var asr=require(_0x4299('0x0'));module[_0x4299('0x1')]={'asr':asr}; \ No newline at end of file +var asr=require('./asr');module['exports']={'asr':asr}; \ No newline at end of file diff --git a/server/services/agi/server.js b/server/services/agi/server.js index 08bd206..9f5233f 100644 --- a/server/services/agi/server.js +++ b/server/services/agi/server.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x9c44=['./error','./channel','127.0.0.1','call','emit','error','createServer','listen','listening','getConnections','destroy','E_AGI_SERVER_MAXCONNECTION','ready','connection','E_AGI_SERVER_ERROR','code','close','E_AGI_SERVER_CLOSE','nextTick','events','EventEmitter'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x9c44,0x178));var _0x49c4=function(_0x3511d3,_0x4107ae){_0x3511d3=_0x3511d3-0x0;var _0x5d6321=_0x9c44[_0x3511d3];return _0x5d6321;};'use strict';var util=require('util');var net=require('net');var EventEmitter=require(_0x49c4('0x0'))[_0x49c4('0x1')];var AGIError=require(_0x49c4('0x2'));var AGIChannel=require(_0x49c4('0x3'));var AGIServer=function(_0x455700,_0x2ad237,_0x4e0313){var _0x4941f1=this;var _0x41a183=null;var _0x57effd=0x0;if(!_0x455700)_0x455700=0x11dd;if(!_0x2ad237)_0x2ad237=_0x49c4('0x4');EventEmitter[_0x49c4('0x5')](_0x4941f1);function _0x69bc41(){if(!_0x455700){_0x4941f1[_0x49c4('0x6')](_0x49c4('0x7'),new AGIError('E_AGI_ARGUMENT_PORT'));return![];}_0x41a183=net[_0x49c4('0x8')]();_0x41a183[_0x49c4('0x9')](_0x455700,_0x2ad237);_0x41a183['on'](_0x49c4('0xa'),function(){_0x4941f1[_0x49c4('0x6')]('listening');});_0x41a183['on']('connection',function(_0x451ea6){_0x41a183[_0x49c4('0xb')](function(_0x58cad7,_0xb611a1){if(_0x58cad7){_0x4941f1[_0x49c4('0x6')]('error',new AGIError('E_AGI_SERVER_ERROR',_0x58cad7));}else if(_0x4e0313&&_0x4e0313<0x0){_0x4941f1[_0x49c4('0x6')](_0x49c4('0x7'),new AGIError('E_AGI_SERVER_VOICE_DISABLED'));_0x451ea6[_0x49c4('0xc')]();}else if(_0x4e0313&&_0x4e0313>0x0&&_0x4e0313<_0xb611a1){_0x57effd+=0x1;_0x4941f1[_0x49c4('0x6')]('error',new AGIError(_0x49c4('0xd'),_0x57effd));_0x451ea6[_0x49c4('0xc')]();}else{var _0x21f15a=new AGIChannel(_0x451ea6);_0x21f15a['on'](_0x49c4('0xe'),function(){_0x4941f1[_0x49c4('0x6')](_0x49c4('0xf'),_0x21f15a);});}});});_0x41a183['on'](_0x49c4('0x7'),function(_0x3de397){_0x4941f1['emit'](_0x49c4('0x7'),new AGIError(_0x49c4('0x10'),_0x3de397[_0x49c4('0x11')]));});_0x41a183['on'](_0x49c4('0x12'),function(){_0x4941f1[_0x49c4('0x6')]('close',new AGIError(_0x49c4('0x13')));});}process[_0x49c4('0x14')](function(){_0x69bc41();});};util['inherits'](AGIServer,EventEmitter);module['exports']=function(_0x3c782d,_0x2f82d5,_0x3addb2){return new AGIServer(_0x3c782d,_0x2f82d5,_0x3addb2);}; \ No newline at end of file +var _0x9c44=['./error','./channel','127.0.0.1','call','emit','error','createServer','listen','listening','getConnections','destroy','E_AGI_SERVER_MAXCONNECTION','ready','connection','E_AGI_SERVER_ERROR','code','close','E_AGI_SERVER_CLOSE','nextTick','events','EventEmitter'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x9c44,0x178));var _0x49c4=function(_0x53ccf2,_0x13cb67){_0x53ccf2=_0x53ccf2-0x0;var _0x5a2964=_0x9c44[_0x53ccf2];return _0x5a2964;};'use strict';var util=require('util');var net=require('net');var EventEmitter=require(_0x49c4('0x0'))[_0x49c4('0x1')];var AGIError=require(_0x49c4('0x2'));var AGIChannel=require(_0x49c4('0x3'));var AGIServer=function(_0x455700,_0x2ad237,_0x4e0313){var _0x4941f1=this;var _0x41a183=null;var _0x57effd=0x0;if(!_0x455700)_0x455700=0x11dd;if(!_0x2ad237)_0x2ad237=_0x49c4('0x4');EventEmitter[_0x49c4('0x5')](_0x4941f1);function _0x69bc41(){if(!_0x455700){_0x4941f1[_0x49c4('0x6')](_0x49c4('0x7'),new AGIError('E_AGI_ARGUMENT_PORT'));return![];}_0x41a183=net[_0x49c4('0x8')]();_0x41a183[_0x49c4('0x9')](_0x455700,_0x2ad237);_0x41a183['on'](_0x49c4('0xa'),function(){_0x4941f1[_0x49c4('0x6')]('listening');});_0x41a183['on']('connection',function(_0x451ea6){_0x41a183[_0x49c4('0xb')](function(_0x58cad7,_0xb611a1){if(_0x58cad7){_0x4941f1[_0x49c4('0x6')]('error',new AGIError('E_AGI_SERVER_ERROR',_0x58cad7));}else if(_0x4e0313&&_0x4e0313<0x0){_0x4941f1[_0x49c4('0x6')](_0x49c4('0x7'),new AGIError('E_AGI_SERVER_VOICE_DISABLED'));_0x451ea6[_0x49c4('0xc')]();}else if(_0x4e0313&&_0x4e0313>0x0&&_0x4e0313<_0xb611a1){_0x57effd+=0x1;_0x4941f1[_0x49c4('0x6')]('error',new AGIError(_0x49c4('0xd'),_0x57effd));_0x451ea6[_0x49c4('0xc')]();}else{var _0x21f15a=new AGIChannel(_0x451ea6);_0x21f15a['on'](_0x49c4('0xe'),function(){_0x4941f1[_0x49c4('0x6')](_0x49c4('0xf'),_0x21f15a);});}});});_0x41a183['on'](_0x49c4('0x7'),function(_0x3de397){_0x4941f1['emit'](_0x49c4('0x7'),new AGIError(_0x49c4('0x10'),_0x3de397[_0x49c4('0x11')]));});_0x41a183['on'](_0x49c4('0x12'),function(){_0x4941f1[_0x49c4('0x6')]('close',new AGIError(_0x49c4('0x13')));});}process[_0x49c4('0x14')](function(){_0x69bc41();});};util['inherits'](AGIServer,EventEmitter);module['exports']=function(_0x3c782d,_0x2f82d5,_0x3addb2){return new AGIServer(_0x3c782d,_0x2f82d5,_0x3addb2);}; \ No newline at end of file diff --git a/server/services/agi/vertices.js b/server/services/agi/vertices.js index cbf80dd..04830bf 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 _0x2d17=['context','extension','priority','accountcode','file','createSquareMessage','createCmContact','isEmpty','isNil','random','lastName','phone','list_id','scheduledAt','callback','toString','callback_priority','getPause','agentPause','agent','callerid','agentUnpause','agentLogin','internal','%s/%s@from-sip/n','LOCAL','shellCommand','exec','trim','replace','googleCloudTTS','apiKey','text','en-US','ssmlGender','MALE','audioEncoding','googleTTS','google_tts_language','method','timeout','number','includes','POST','PUT','toUpperCase','body','parse','An\x20incorrect\x20formatted\x20json\x20body\x20has\x20been\x20passed\x20to\x20the\x20function','An\x20incorrect\x20formatted\x20json\x20headers\x20has\x20been\x20passed\x20to\x20the\x20function','computedVariables','sync','uri','render','url','headers','stringify','statusCode','statusMessage','message','500\x20-\x20Internal\x20Server\x20Error','options','googleDialogflow','dialogflow_language','googleDialogflowV2','dialogflowV2_project_id','client_email','private_key','sestekNDA','ispeechTTS','key','ispeech_tts_language','ispeechASR','ispeech_asr_language','model','awsPolly','aws_access_key_id','aws_polly_voice','awsLex','aws_bot_name','googleASR','google_asr_language','tildeASR','appsecret','clear','hasOwnProperty','isString','replaceObjectAllVariables','replaceAllVariables','recursiveNodeIndex','isArray','saveRestApiResult','%s.%s','length','setVariable','split','replaceAll','extra','getAndSetVariable','result','The\x20\x22%s\x22\x20variable\x20value\x20is:\x20%s','isConfigured','maxRetry','retry','mrcpsynth','Enter\x20in\x20MRCPSynth\x20(%s)\x20block','noop','no\x20text\x20configured','MRCPSynth','Executed\x20command\x20MRCPSynth\x20%s','mrcprecog','no\x20grammar\x20configured','grammar','RECOG_INPUT()','MRCP_RECOG_INSTANCE','Enter\x20in\x20AGI\x20(%s)\x20block','command','args','answer','Wait\x20%s\x20seconds\x20before\x20answer','Enter\x20in\x20CALLBACK\x20(%s)\x20block','no\x20list\x20selected','delay','add','minutes','CALLBACK\x20added\x20phone:\x20%s\x20on\x20list:\x20%s\x20at\x20%s','custom_app','application','Executed\x20command\x20%s\x20%s','lumenvoxtts','Enter\x20in\x20LUMENVOXTTS\x20(%s)\x20block','sestektts','Enter\x20in\x20SESTEKTTS\x20(%s)\x20block','lumenvoxasr','Enter\x20in\x20LUMENVOXASR\x20(%s)\x20block','MRCPRecog','RECOG_CONFIDENCE()','LUMENVOX_ASR_CONFIDENCE','LUMENVOX_ASR_TRANSCRIPT','RECOG_INSTANCE()','Executed\x20command\x20MRCPRecog\x20%s','sestekasr','Enter\x20in\x20SESTEKASR\x20(%s)\x20block','SESTEK_ASR_TRANSCRIPT','database','Enter\x20in\x20DATABASE\x20(%s)\x20block','odbc_id','no\x20database\x20selected','no\x20odbc\x20database\x20found','no\x20query\x20configured','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','sip_id','DIAL','SIP/%s','opts','Executed\x20command\x20%s','dialogflow','Enter\x20in\x20DIALOGFLOW\x20(%s)\x20block','DIALOGFLOW_%s','speech','out','Dialogflow\x20Result\x20%s','Dialogflow\x20is\x20unreachable','dialogflowV2','Enter\x20in\x20DIALOGFLOW\x20V2\x20(%s)\x20block','no\x20project_id\x20configured','no\x20client_email\x20configured','no\x20private_key\x20configured','dialogflowV2_language','no\x20anguage\x20configured','Trying\x20DialogflowV2:\x20%s','providerResponse','DialogflowV2\x20Result\x20%s','DialogflowV2\x20is\x20unreachable','sesteknda','Enter\x20in\x20SESTEKNDA\x20(%s)\x20block','ndauth_url','no\x20ndauth\x20url\x20configured','username','no\x20username\x20configured','no\x20password\x20configured','ndassistant_url','bot','Trying\x20SestekNDA:\x20%s','SESTEK_NDA_%s','audiofile','Sestek\x20NDA\x20%s\x20file\x20created','streamFile','.wav','SestekNDA\x20Result\x20%s','end','Enter\x20in\x20EXTERNAL\x20DIAL\x20(%s)\x20block','trunk_id','no\x20trunk\x20selected','getTrunk','no\x20trunk\x20found','trunk_name','SIP/%s/%s','finally','Enter\x20in\x20FINALLY\x20(%s)\x20block','file_id','no\x20file\x20audio\x20found','getData','response','maxdigit','test','mindigit','hiddendigitsnum','generate','first','substr','Enter\x20in\x20GETSECRETDIGITS\x20(%s)\x20block','goal','Enter\x20in\x20GOAL\x20(%s)\x20block','goalname','GOAL\x20%s','[AGI]\x20Enter\x20in\x20AWSPOLLY\x20(%s)\x20block','aws_secret_access_key','Trying\x20aws\x20Polly\x20%s','aws\x20Polly\x20is\x20unreachable','awslex','Enter\x20in\x20Amazon\x20Lex\x20(%s)\x20block','no\x20valid\x20credentials\x20configured','no\x20bot\x20name\x20configured','Trying\x20Amazon\x20Lex:\x20%s','AWS_LEX_%s','Amazon\x20Lex\x20ready\x20for\x20fulfillment','amazonlex','Amazon\x20Lex\x20Result\x20%s','Amazon\x20Lex\x20is\x20unreachable','wav','%s/recordings/%s','beep','NOBEEP','intKey','google\x20%s\x20file\x20created','GOOGLE_ASR_%s','Enter\x20in\x20TILDEASR\x20(%s)\x20block','no\x20appid\x20configured','no\x20appsecret\x20configured','tilde\x20%s\x20file\x20created','TildeASR\x20Result\x20%s','continueAt','gotoif','Enter\x20in\x20GOTOIF\x20(%s)\x20block','true','EVAL\x20CONDITION\x20%s\x20%s','condition','false','Enter\x20in\x20GOTOIFTIME\x20(%s)\x20block','interval_id','IFTIME(%s?true:false)','IFTIME\x20%s\x20%s','hangup','Enter\x20in\x20ISPEECHASR\x20(%s)\x20block','no\x20key\x20configured','ispeech\x20%s\x20file\x20created','ISPEECH_ASR_%s','IspeechASR\x20Result\x20%s','ispeechtts','Enter\x20in\x20ISPEECHTTS\x20(%s)\x20block','Trying\x20ispeech\x20TTS\x20%s','unlink','Enter\x20in\x20LOGIN\x20(%s)\x20block','no\x20find\x20by\x20configured','FIND\x20AGENT\x20%s\x20BY\x20%s','findBy','AGENT\x20%s\x20FOUND\x20BY','AGENT\x20%s\x20NOT\x20FOUND\x20BY','failure','logout','Enter\x20in\x20LOGOUT\x20(%s)\x20block','agentLogout','success','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\x20selected','digit','Enter\x20in\x20NOOP\x20(%s)\x20block','output','pause','Enter\x20in\x20PAUSE\x20(%s)\x20block','Enter\x20in\x20PLAYBACK\x20(%s)\x20block','PLAYBACK','queue','queue_id','no\x20queue\x20selected','indexOf','XMCS-QUEUE','toLowerCase','QUEUE','macro','gosub','record','Enter\x20in\x20RECORD\x20(%s)\x20block','recordingFormat','RECORDING_SAVENAME','Recording\x20%s\x20%s\x20%s\x20%s','escape_digits','restapi','Enter\x20in\x20RESTAPI\x20(%s)\x20block','no\x20url\x20configured','200','%s_STATUS_MESSAGE','Unable\x20to\x20set\x20result\x20in\x20variable\x20%s','saydigits','Enter\x20in\x20SAYDIGITS\x20(%s)\x20block','saynumber','Enter\x20in\x20SAYNUMBER\x20(%s)\x20block','sayNumber','sayphonetic','Enter\x20in\x20SAYPHONETIC\x20(%s)\x20block','sayPhonetic','sendMail','Enter\x20in\x20SENDMAIL\x20(%s)\x20block','no\x20mail\x20account\x20configured','Smtp','no\x20mail\x20account\x20found','email','bcc','subject','template_id','sendMail\x20message','account_id','Trying\x20SendMail\x20with\x20account\x20%s','Enter\x20in\x20SENDFAX\x20(%s)\x20block','SENDFAX\x20block\x20not\x20implemented','sendSMS','Enter\x20in\x20SENDSMS\x20(%s)\x20block','no\x20sms\x20account\x20configured','sms_account_id','no\x20sms\x20account\x20found','sms_text','Sms\x20message\x20added\x20to\x20outgoing\x20process','set','Enter\x20in\x20SET\x20(%s)\x20block','variable_value','yes','Answer','Skipped\x20Answer','subproject','Enter\x20in\x20SUBPROJECT\x20(%s)\x20block','project_id','no\x20subproject\x20selected','no\x20subproject\x20found\x20with\x20id\x20%d','project\x20in\x20subproject\x20must\x20be\x20different\x20from\x20the\x20called\x20project','AGI','agi://%s/square,\x22%s\x22,\x22%s\x22','host','system','sh\x20command:\x20%s\x20result\x20on\x20variable:\x20%s','sh\x20command:\x20%s\x20result\x20no\x20stored','Enter\x20in\x20Google\x20Cloud\x20TTS\x20(%s)\x20block','Google\x20Cloud\x20TTS\x20is\x20unreachable','tts','Trying\x20Google\x20TTS\x20%s','Google\x20TTS\x20is\x20unreachable','unpause','voicemail','Enter\x20in\x20VOICEMAIL\x20(%s)\x20block','VOICEMAIL','vswitch','Enter\x20in\x20SWITCH\x20(%s)\x20block','no\x20variable\x20selected','join','util','lodash','odbc','randomstring','mustache','request-promise','agi','./scripts','rawHeaders','rawBody','getdigits','getsecretdigits','channel','rpc','prototype','getVariable','getVariableById','then','name','catch','getVoiceQueue','getVoiceQueueById','getSquareProject','getSquareProjectById','getSquareOdbcById','dsn','getUserById','getTrunkById','getSound','getSoundPath','save_name','getMailAccount','sendMailMessage','getIntervals','getIntervalById','IntervalId','interval','map','Intervals','format','%s/sounds/converted/%s','error','Error\x20getting\x20ODBC\x20connection\x20%s','ODBC\x20connection\x20successfully','query','info','Error\x20executing\x20query\x20%s','Query\x20executed\x20correctly\x20%s','close','getSmsAccount','getSmsAccountById','createSmsMessage','createSquareDetailsReport','label','agicommand','arg_1','createSquareRecording','uniqueid'];(function(_0x34bc6c,_0x10d089){var _0x168820=function(_0xb058d9){while(--_0xb058d9){_0x34bc6c['push'](_0x34bc6c['shift']());}};_0x168820(++_0x10d089);}(_0x2d17,0x17e));var _0x72d1=function(_0x3edf4e,_0x201e89){_0x3edf4e=_0x3edf4e-0x0;var _0xaa1eaa=_0x2d17[_0x3edf4e];return _0xaa1eaa;};'use strict';var fs=require('fs');var util=require(_0x72d1('0x0'));var _=require(_0x72d1('0x1'));var sh=require('shelljs');var odbc=require(_0x72d1('0x2'))();var rs=require(_0x72d1('0x3'));var moment=require('moment');var Mustache=require(_0x72d1('0x4'));var rp=require(_0x72d1('0x5'));var logger=require('../../config/logger')(_0x72d1('0x6'));var config=require('../../config/environment');var scripts=require(_0x72d1('0x7'));var FILES_PATH='/var/opt/motion2/server/files';var recursiveMapAttributes=[_0x72d1('0x8'),_0x72d1('0x9')];var verticesWithRetry=['menu',_0x72d1('0xa'),_0x72d1('0xb')];var AGIVertices=function(_0x19e248,_0x4e7f3e,_0x215536){this[_0x72d1('0xc')]=_0x19e248;this[_0x72d1('0xd')]=_0x4e7f3e;this['mailRpc']=_0x215536;};AGIVertices[_0x72d1('0xe')][_0x72d1('0xf')]=function(_0x45eb4a,_0x14a41e){this[_0x72d1('0xd')][_0x72d1('0x10')](_0x45eb4a)[_0x72d1('0x11')](function(_0x14ef98){_0x14a41e(null,_0x14ef98?_0x14ef98[_0x72d1('0x12')]:![]);})[_0x72d1('0x13')](function(_0x5ad4df){_0x14a41e(_0x5ad4df);});};AGIVertices[_0x72d1('0xe')][_0x72d1('0x14')]=function(_0x4c1038,_0x115cd7){this[_0x72d1('0xd')][_0x72d1('0x15')](_0x4c1038)[_0x72d1('0x11')](function(_0x383bb){_0x115cd7(null,_0x383bb?_0x383bb[_0x72d1('0x12')]:![]);})[_0x72d1('0x13')](function(_0x21c85e){_0x115cd7(_0x21c85e);});};AGIVertices[_0x72d1('0xe')][_0x72d1('0x16')]=function(_0x491af4,_0x46fa3d){this['rpc'][_0x72d1('0x17')](_0x491af4)[_0x72d1('0x11')](function(_0x59d7b5){_0x46fa3d(null,_0x59d7b5?_0x59d7b5[_0x72d1('0x12')]:![]);})[_0x72d1('0x13')](function(_0x1ca18d){_0x46fa3d(_0x1ca18d);});};AGIVertices['prototype']['getSquareOdbc']=function(_0x313d7b,_0x10d464){this[_0x72d1('0xd')][_0x72d1('0x18')](_0x313d7b)[_0x72d1('0x11')](function(_0x2253fd){_0x10d464(null,_0x2253fd?_0x2253fd[_0x72d1('0x19')]:![]);})['catch'](function(_0x1c695c){_0x10d464(_0x1c695c);});};AGIVertices['prototype']['getUser']=function(_0x5b85cc,_0x585243){this[_0x72d1('0xd')][_0x72d1('0x1a')](_0x5b85cc)['then'](function(_0x2a421a){_0x585243(null,_0x2a421a?_0x2a421a[_0x72d1('0x12')]:![]);})[_0x72d1('0x13')](function(_0x1431ee){_0x585243(_0x1431ee);});};AGIVertices[_0x72d1('0xe')]['getTrunk']=function(_0x5e0f73,_0x188eca){this[_0x72d1('0xd')][_0x72d1('0x1b')](_0x5e0f73)[_0x72d1('0x11')](function(_0xdf6a69){_0x188eca(null,_0xdf6a69?_0xdf6a69[_0x72d1('0x12')]:![]);})[_0x72d1('0x13')](function(_0x589f7c){_0x188eca(_0x589f7c);});};AGIVertices['prototype'][_0x72d1('0x1c')]=function(_0x482cb8,_0x18ca85){var _0x3454fc=this;this[_0x72d1('0xd')]['getSoundById'](_0x482cb8)[_0x72d1('0x11')](function(_0x4c4c41){_0x18ca85(null,_0x4c4c41?_0x3454fc[_0x72d1('0x1d')](_0x4c4c41[_0x72d1('0x1e')]):![]);})[_0x72d1('0x13')](function(_0x2cc0c8){_0x18ca85(_0x2cc0c8);});};AGIVertices['prototype'][_0x72d1('0x1f')]=function(_0x562e83,_0x42c03c){this[_0x72d1('0xd')]['getMailAccountById'](_0x562e83)[_0x72d1('0x11')](function(_0x358b0c){_0x42c03c(null,_0x358b0c?_0x358b0c:![]);})[_0x72d1('0x13')](function(_0x11ea2f){_0x42c03c(_0x11ea2f);});};AGIVertices[_0x72d1('0xe')]['sendMailMessage']=function(_0x95c44a,_0x60941a,_0x9efc2f){this['mailRpc'][_0x72d1('0x20')](_0x95c44a,_0x60941a)[_0x72d1('0x11')](function(){_0x9efc2f(null);})['catch'](function(_0x3372a5){_0x9efc2f(_0x3372a5);});};AGIVertices[_0x72d1('0xe')][_0x72d1('0x21')]=function(_0x5a63d9,_0x348692){this['rpc'][_0x72d1('0x22')](_0x5a63d9)[_0x72d1('0x11')](function(_0x23418d){if(_0x23418d){if(_0x23418d[_0x72d1('0x23')]){_0x348692(null,[_0x23418d[_0x72d1('0x24')]]);}else{_0x348692(null,_[_0x72d1('0x25')](_0x23418d[_0x72d1('0x26')],_0x72d1('0x24')));}}else{_0x348692(null,![]);}})[_0x72d1('0x13')](function(_0x24be04){_0x348692(_0x24be04);});};AGIVertices[_0x72d1('0xe')]['getSoundPath']=function(_0x20a14b){return util[_0x72d1('0x27')](_0x72d1('0x28'),FILES_PATH,_0x20a14b);};AGIVertices[_0x72d1('0xe')]['getQueryOdbc']=function(_0x3eb3da,_0x3ae025,_0x2783bb){odbc['open'](_0x3eb3da,function(_0x3fe9e9){if(_0x3fe9e9){logger[_0x72d1('0x29')](_0x72d1('0x2a'),_0x3fe9e9);_0x2783bb(_0x3fe9e9);}else{logger['info'](_0x72d1('0x2b'));odbc[_0x72d1('0x2c')](_0x3ae025,function(_0x34f159,_0x53e5a1){if(_0x34f159){logger[_0x72d1('0x2d')](_0x72d1('0x2e'),_0x3ae025);_0x2783bb(_0x34f159);}else{logger[_0x72d1('0x2d')](_0x72d1('0x2f'),_0x3ae025);odbc[_0x72d1('0x30')](function(_0x785820){if(_0x785820){logger[_0x72d1('0x29')]('Error\x20closing\x20connection\x20to\x20odbc\x20%s',_0x785820);}_0x2783bb(null,_0x53e5a1);});}});}});};AGIVertices[_0x72d1('0xe')][_0x72d1('0x31')]=function(_0x440ac5,_0x16407a){this[_0x72d1('0xd')][_0x72d1('0x32')](_0x440ac5)[_0x72d1('0x11')](function(_0x1d4fdf){_0x16407a(null,_0x1d4fdf?_0x1d4fdf:![]);})['catch'](function(_0x44d5b2){_0x16407a(_0x44d5b2);});};AGIVertices[_0x72d1('0xe')][_0x72d1('0x33')]=function(_0x1d6704,_0x45870b){this[_0x72d1('0xd')][_0x72d1('0x33')](_0x1d6704)[_0x72d1('0x11')](function(_0x5620f0){_0x45870b(null,_0x5620f0);})['catch'](function(_0x1359bd){_0x45870b(_0x1359bd);});};AGIVertices[_0x72d1('0xe')][_0x72d1('0x34')]=function(_0x21d361,_0x5a6bc4,_0x3fe286){this[_0x72d1('0xd')]['createSquareDetailsReport']({'uniqueid':this[_0x72d1('0xc')]['uniqueid'],'node':_0x21d361[_0x72d1('0x35')],'application':_0x21d361[_0x72d1('0x36')],'data':_0x5a6bc4||null,'project_name':this['channel'][_0x72d1('0x37')],'callerid':this['channel']['callerid']})['then'](function(_0x334bfe){if(_0x3fe286){_0x3fe286(null,_0x334bfe);}})['catch'](function(_0x42ac27){if(_0x3fe286){_0x3fe286(_0x42ac27);}});};AGIVertices[_0x72d1('0xe')][_0x72d1('0x38')]=function(_0x4e5519,_0x4a5c1c,_0x263fcb,_0x58e2c1){this['rpc'][_0x72d1('0x38')]({'uniqueid':this[_0x72d1('0xc')][_0x72d1('0x39')],'callerid':this['channel']['callerid'],'calleridname':this['channel']['calleridname'],'context':this[_0x72d1('0xc')][_0x72d1('0x3a')],'extension':this[_0x72d1('0xc')][_0x72d1('0x3b')],'priority':this[_0x72d1('0xc')][_0x72d1('0x3c')],'accountcode':this[_0x72d1('0xc')][_0x72d1('0x3d')],'dnid':this[_0x72d1('0xc')]['dnid'],'projectName':this[_0x72d1('0xc')][_0x72d1('0x37')],'saveName':_0x4a5c1c,'filename':_0x4e5519[_0x72d1('0x3e')]||_0x4a5c1c,'savePath':_0x263fcb})['then'](function(_0x418e6f){_0x58e2c1(null,_0x418e6f);})[_0x72d1('0x13')](function(_0x12ad75){_0x58e2c1(_0x12ad75);});};AGIVertices['prototype'][_0x72d1('0x3f')]=function(_0x2b60f0,_0x343da3,_0x1bf626,_0x48c20d,_0x5de802){this[_0x72d1('0xd')][_0x72d1('0x3f')]({'uniqueid':this[_0x72d1('0xc')]['uniqueid'],'body':_0x2b60f0,'direction':_0x343da3,'providerName':_0x1bf626,'providerResponse':_0x48c20d})[_0x72d1('0x11')](function(_0xee3c52){if(_0x5de802){_0x5de802(null,_0xee3c52);}})[_0x72d1('0x13')](function(_0x463670){if(_0x5de802){_0x5de802(_0x463670);}});};AGIVertices[_0x72d1('0xe')][_0x72d1('0x40')]=function(_0x3146cf,_0xebe855){this[_0x72d1('0xd')][_0x72d1('0x40')]({'firstName':_[_0x72d1('0x41')](_0x3146cf['name'])||_[_0x72d1('0x42')](_0x3146cf['name'])?'callback_'+Math[_0x72d1('0x43')]():_0x3146cf['name'],'lastName':_[_0x72d1('0x41')](_0x3146cf[_0x72d1('0x44')])||_[_0x72d1('0x42')](_0x3146cf[_0x72d1('0x44')])?null:_0x3146cf[_0x72d1('0x44')],'phone':_0x3146cf[_0x72d1('0x45')],'ListId':_0x3146cf[_0x72d1('0x46')],'scheduledat':_0x3146cf[_0x72d1('0x47')],'callbackUniqueid':this[_0x72d1('0xc')][_0x72d1('0x39')],'tags':_0x72d1('0x48'),'description':'Callback\x20scheduled\x20at\x20'+_0x3146cf[_0x72d1('0x47')][_0x72d1('0x49')](),'priority':_0x3146cf[_0x72d1('0x4a')]})['then'](function(_0x53bd97){_0xebe855(null,_0x53bd97);})[_0x72d1('0x13')](function(_0x140f0b){_0xebe855(_0x140f0b);});};AGIVertices[_0x72d1('0xe')][_0x72d1('0x4b')]=function(_0x444583,_0x480b5d){this[_0x72d1('0xd')]['getPauseById'](_0x444583)[_0x72d1('0x11')](function(_0x41c6a6){_0x480b5d(null,_0x41c6a6?_0x41c6a6[_0x72d1('0x12')]:![]);})[_0x72d1('0x13')](function(_0x2ff81f){_0x480b5d(_0x2ff81f);});};AGIVertices[_0x72d1('0xe')][_0x72d1('0x4c')]=function(_0x2f07c1,_0x384f0a,_0x3a2dfe){var _0xc3a6b9={'role':_0x72d1('0x4d')};_0xc3a6b9[_0x2f07c1]=this[_0x72d1('0xc')][_0x72d1('0x4e')];this[_0x72d1('0xd')][_0x72d1('0x4c')](_0xc3a6b9,_0x384f0a,this[_0x72d1('0xc')]['uniqueid'])[_0x72d1('0x11')](function(_0x3dceb7){_0x3a2dfe(null,_[_0x72d1('0x42')](_0x3dceb7)?![]:!![]);})[_0x72d1('0x13')](function(_0xb947ef){logger[_0x72d1('0x29')](_0xb947ef);_0x3a2dfe(null,![]);});};AGIVertices['prototype'][_0x72d1('0x4f')]=function(_0x303508,_0xb05cd9){var _0x5319d2={'role':'agent'};_0x5319d2[_0x303508]=this[_0x72d1('0xc')]['callerid'];this[_0x72d1('0xd')][_0x72d1('0x4f')](_0x5319d2)[_0x72d1('0x11')](function(_0x41525c){_0xb05cd9(null,_[_0x72d1('0x42')](_0x41525c)?![]:!![]);})[_0x72d1('0x13')](function(_0x3224c2){logger[_0x72d1('0x29')](_0x3224c2);_0xb05cd9(null,![]);});};AGIVertices[_0x72d1('0xe')]['agentLogout']=function(_0x5d3b27,_0x4042e5){var _0x1d44f0={'role':_0x72d1('0x4d')};_0x1d44f0[_0x5d3b27]=this['channel'][_0x72d1('0x4e')];this[_0x72d1('0xd')]['agentLogout'](_0x1d44f0)[_0x72d1('0x11')](function(_0x5a8442){_0x4042e5(null,_[_0x72d1('0x42')](_0x5a8442)?![]:!![]);})[_0x72d1('0x13')](function(_0x17ac0e){logger[_0x72d1('0x29')](_0x17ac0e);_0x4042e5(null,![]);});};AGIVertices[_0x72d1('0xe')][_0x72d1('0x50')]=function(_0x3c4dec,_0x115c72){var _0x2f2750={'role':_0x72d1('0x4d')};_0x2f2750[_0x3c4dec]=this['channel']['callerid'];var _0x15e0e0=_0x3c4dec!=_0x72d1('0x51')?util[_0x72d1('0x27')](_0x72d1('0x52'),_0x72d1('0x53'),this[_0x72d1('0xc')][_0x72d1('0x4e')]):undefined;this[_0x72d1('0xd')]['agentLogin'](_0x2f2750,_0x15e0e0)[_0x72d1('0x11')](function(_0x5a7687){_0x115c72(null,_[_0x72d1('0x42')](_0x5a7687)?![]:!![]);})[_0x72d1('0x13')](function(_0x565257){logger['error'](_0x565257);_0x115c72(null,![]);});};AGIVertices[_0x72d1('0xe')][_0x72d1('0x54')]=function(_0x22ca95,_0x44d076){sh[_0x72d1('0x55')](_[_0x72d1('0x56')](_0x22ca95),function(_0x27d3be,_0x574b6e){var _0x2d24f0=_0x574b6e[_0x72d1('0x57')](/(\r\n|\n|\r)/gm,'');_0x44d076(null,_0x2d24f0);});};AGIVertices[_0x72d1('0xe')]['googleCloudTTS']=function(_0x61b30b,_0x4970ac){scripts[_0x72d1('0x58')](_0x61b30b[_0x72d1('0x59')],_0x61b30b['google_cloud_tts_text_type']||_0x72d1('0x5a'),_0x61b30b[_0x72d1('0x5a')],_0x61b30b['languageCode']||_0x72d1('0x5b'),_0x61b30b[_0x72d1('0x5c')]||_0x72d1('0x5d'),_0x61b30b[_0x72d1('0x5e')]||'MP3')['then'](function(_0x532298){_0x4970ac(null,_0x532298);})[_0x72d1('0x13')](function(_0x1753e7){_0x4970ac(_0x1753e7);});};AGIVertices[_0x72d1('0xe')][_0x72d1('0x5f')]=function(_0x146b06,_0x3de4a6){scripts['googleTTS'](_0x146b06['text'],_0x146b06[_0x72d1('0x60')]||'en',0x1)[_0x72d1('0x11')](function(_0x36827e){_0x3de4a6(null,_0x36827e);})[_0x72d1('0x13')](function(_0x3ff429){_0x3de4a6(_0x3ff429);});};AGIVertices[_0x72d1('0xe')]['restAPI']=function(_0x23f0e3,_0x4511a4){var _0x18cec8={'uri':_0x23f0e3['url'],'method':_0x23f0e3[_0x72d1('0x61')],'json':!![],'resolveWithFullResponse':!![],'strictSSL':![],'timeout':typeof parseInt(_0x23f0e3[_0x72d1('0x62')])===_0x72d1('0x63')&&parseInt(_0x23f0e3[_0x72d1('0x62')])>=0x1?parseInt(_0x23f0e3[_0x72d1('0x62')])*0x3e8:0x5*0x3e8};if(_[_0x72d1('0x64')]([_0x72d1('0x65'),_0x72d1('0x66')],_0x18cec8['method'][_0x72d1('0x67')]())){try{_0x18cec8[_0x72d1('0x68')]=_0x23f0e3[_0x72d1('0x9')]?JSON[_0x72d1('0x69')](_0x23f0e3['rawBody']):{};}catch(_0x4f1b2f){logger[_0x72d1('0x29')](_0x72d1('0x6a'),_0x4f1b2f);}}try{_0x18cec8['headers']=_0x23f0e3[_0x72d1('0x8')]?JSON[_0x72d1('0x69')](_0x23f0e3[_0x72d1('0x8')]):{};}catch(_0x305fd9){logger[_0x72d1('0x29')](_0x72d1('0x6b'),_0x305fd9);}if(_0x23f0e3[_0x72d1('0x6c')]){try{var _0xaacd06=require(_0x23f0e3['computedVariables'])[_0x72d1('0x6d')](this,_0x18cec8);_0x18cec8[_0x72d1('0x6e')]=Mustache[_0x72d1('0x6f')](_0x23f0e3[_0x72d1('0x70')],_0xaacd06,{},['$$','$$']);if(_0x18cec8[_0x72d1('0x71')]){_0x18cec8[_0x72d1('0x71')]=JSON[_0x72d1('0x69')](Mustache[_0x72d1('0x6f')](JSON['stringify'](_0x18cec8[_0x72d1('0x71')]),_0xaacd06,{},['$$','$$']));}if(_0x18cec8[_0x72d1('0x68')]){_0x18cec8[_0x72d1('0x68')]=JSON[_0x72d1('0x69')](Mustache[_0x72d1('0x6f')](JSON[_0x72d1('0x72')](_0x18cec8['body']),_0xaacd06,{},['$$','$$']));}}catch(_0x1c6547){logger[_0x72d1('0x29')]('An\x20incorrect\x20formatted\x20json\x20has\x20been\x20passed\x20to\x20the\x20function',_0x1c6547);}}rp(_0x18cec8)[_0x72d1('0x11')](function(_0x4057ec){var _0x239cdb={'statusCode':_0x4057ec[_0x72d1('0x73')]||0xc8,'statusMessage':_0x4057ec[_0x72d1('0x74')]||'OK','headers':_0x4057ec[_0x72d1('0x71')]||{},'body':_0x4057ec['body']||{}};_0x4511a4(null,_0x239cdb);})[_0x72d1('0x13')](function(_0x4255c0){var _0x5074b9={'statusCode':_0x4255c0['statusCode']||0x1f4,'statusMessage':_0x4255c0[_0x72d1('0x75')]||_0x72d1('0x76'),'headers':_0x4255c0[_0x72d1('0x77')][_0x72d1('0x71')]||{},'body':_0x4255c0['options'][_0x72d1('0x68')]||{}};_0x4511a4(null,_0x5074b9);});};AGIVertices[_0x72d1('0xe')][_0x72d1('0x78')]=function(_0x353b96,_0xe967e2){scripts[_0x72d1('0x78')](this[_0x72d1('0xc')][_0x72d1('0x39')],_0x353b96['key'],_0x353b96[_0x72d1('0x5a')],_0x353b96[_0x72d1('0x79')]||'en')[_0x72d1('0x11')](function(_0x1b06f3){_0xe967e2(null,_0x1b06f3);})['catch'](function(_0x39b8f7){_0xe967e2(_0x39b8f7);});};AGIVertices[_0x72d1('0xe')]['googleDialogflowV2']=function(_0xb8b082,_0x5e3bd1){scripts[_0x72d1('0x7a')](this['channel'][_0x72d1('0x39')],_0xb8b082[_0x72d1('0x7b')],_0xb8b082[_0x72d1('0x7c')],_0xb8b082[_0x72d1('0x7d')],_0xb8b082[_0x72d1('0x5a')],_0xb8b082['dialogflowV2_language']||'en')[_0x72d1('0x11')](function(_0x5e810){_0x5e3bd1(null,_0x5e810);})[_0x72d1('0x13')](function(_0x4b3d33){_0x5e3bd1(_0x4b3d33);});};AGIVertices[_0x72d1('0xe')][_0x72d1('0x7e')]=function(_0x52dd76,_0x26f1b0){scripts[_0x72d1('0x7e')](this[_0x72d1('0xc')],_0x52dd76)['then'](function(_0x1d0db0){_0x26f1b0(null,_0x1d0db0);})[_0x72d1('0x13')](function(_0x8968c4){_0x26f1b0(_0x8968c4);});};AGIVertices['prototype'][_0x72d1('0x7f')]=function(_0x51c8f9,_0x38a32c){scripts['ispeechTTS'](_0x51c8f9[_0x72d1('0x80')],_0x51c8f9[_0x72d1('0x5a')],_0x51c8f9[_0x72d1('0x81')]||_0x72d1('0x5b'),_0x51c8f9['speed'])[_0x72d1('0x11')](function(_0x13311e){_0x38a32c(null,_0x13311e);})[_0x72d1('0x13')](function(_0x17184a){_0x38a32c(_0x17184a);});};AGIVertices['prototype'][_0x72d1('0x82')]=function(_0x3e28f5,_0x430905,_0x1408df){scripts[_0x72d1('0x82')](_0x430905,_0x3e28f5[_0x72d1('0x80')],_0x3e28f5[_0x72d1('0x83')]||'en-US',this['isConfigured'](_0x3e28f5['model'])?_0x3e28f5[_0x72d1('0x84')]:undefined)['then'](function(_0x2d6f12){_0x1408df(null,_0x2d6f12);})[_0x72d1('0x13')](function(_0x487bb1){_0x1408df(_0x487bb1);});};AGIVertices[_0x72d1('0xe')]['awsPolly']=function(_0x280fc9,_0x378cf0){scripts[_0x72d1('0x85')](_0x280fc9[_0x72d1('0x86')],_0x280fc9['aws_secret_access_key'],_0x280fc9['aws_polly_region'],_0x280fc9[_0x72d1('0x87')]||'Amy',_0x280fc9['text'],_0x280fc9['aws_text_type']||_0x72d1('0x5a'))[_0x72d1('0x11')](function(_0x1fd6b1){_0x378cf0(null,_0x1fd6b1);})[_0x72d1('0x13')](function(_0x2340ff){_0x378cf0(_0x2340ff);});};AGIVertices[_0x72d1('0xe')][_0x72d1('0x88')]=function(_0x4e9d08,_0x5e7785){scripts[_0x72d1('0x88')](this[_0x72d1('0xc')]['uniqueid'],_0x4e9d08[_0x72d1('0x86')],_0x4e9d08['aws_secret_access_key'],_0x4e9d08['aws_lex_region'],_0x4e9d08[_0x72d1('0x5a')],_0x4e9d08[_0x72d1('0x89')])[_0x72d1('0x11')](function(_0x42944e){_0x5e7785(null,_0x42944e);})[_0x72d1('0x13')](function(_0x20c5a7){_0x5e7785(_0x20c5a7);});};AGIVertices['prototype'][_0x72d1('0x8a')]=function(_0x17180e,_0x4ceefd,_0x3e1ae0){scripts['googleASR'](_0x4ceefd,_0x17180e[_0x72d1('0x80')],_0x17180e[_0x72d1('0x8b')]||_0x72d1('0x5b'))[_0x72d1('0x11')](function(_0x391df5){_0x3e1ae0(null,_0x391df5);})[_0x72d1('0x13')](function(_0x25a748){_0x3e1ae0(_0x25a748);});};AGIVertices[_0x72d1('0xe')][_0x72d1('0x8c')]=function(_0x52249a,_0x27d69e,_0x1c18c2){scripts['tildeASR'](_0x27d69e,_0x52249a['appid'],_0x52249a[_0x72d1('0x8d')],_0x52249a[_0x72d1('0x6e')])[_0x72d1('0x11')](function(_0x1c044d){_0x1c18c2(null,_0x1c044d);})[_0x72d1('0x13')](function(_0x2c9864){_0x1c18c2(_0x2c9864);});};AGIVertices[_0x72d1('0xe')][_0x72d1('0x8e')]=function(_0x33db90){var _0x51a6ca=_[_0x72d1('0x64')](verticesWithRetry,_0x33db90[_0x72d1('0x36')])?_0x33db90:_['clone'](_0x33db90);for(var _0x19258c in _0x51a6ca){if(_0x51a6ca[_0x72d1('0x8f')](_0x19258c)){if(_0x51a6ca[_0x19258c]&&_[_0x72d1('0x90')](_0x51a6ca[_0x19258c])){if(_[_0x72d1('0x64')](recursiveMapAttributes,_0x19258c)){_0x51a6ca[_0x19258c]=this[_0x72d1('0x91')](_0x51a6ca[_0x19258c]);}else{_0x51a6ca[_0x19258c]=this[_0x72d1('0x92')](_0x51a6ca[_0x19258c]);}}}}return _0x51a6ca;};AGIVertices[_0x72d1('0xe')][_0x72d1('0x93')]=function(_0x5289ff){for(var _0x3b83da in _0x5289ff){if(_0x5289ff[_0x72d1('0x8f')](_0x3b83da)){if(_['isPlainObject'](_0x5289ff[_0x3b83da])){this['recursiveNodeIndex'](_0x5289ff[_0x3b83da]);}else if(_[_0x72d1('0x94')](_0x5289ff[_0x3b83da])){for(var _0x113d59=0x0;_0x113d59<_0x5289ff[_0x3b83da]['length'];_0x113d59++){this[_0x72d1('0x93')](_0x5289ff[_0x3b83da][_0x113d59]);}}else if(_['isString'](_0x5289ff[_0x3b83da])){_0x5289ff[_0x3b83da]=this['replaceAllVariables'](_0x5289ff[_0x3b83da]);}}}};AGIVertices[_0x72d1('0xe')][_0x72d1('0x95')]=function(_0x3982ee,_0x23db54){for(var _0xdc9fe3 in _0x3982ee){if(_0x3982ee['hasOwnProperty'](_0xdc9fe3)){if(_['isPlainObject'](_0x3982ee[_0xdc9fe3])){if(!_[_0x72d1('0x41')](_0x3982ee[_0xdc9fe3])){this[_0x72d1('0x95')](_0x3982ee[_0xdc9fe3],util[_0x72d1('0x27')](_0x72d1('0x96'),_0x23db54,_0xdc9fe3));}}else if(_['isArray'](_0x3982ee[_0xdc9fe3])){for(var _0x3b46a9=0x0;_0x3b46a9<_0x3982ee[_0xdc9fe3][_0x72d1('0x97')];_0x3b46a9++){this[_0x72d1('0x95')](_0x3982ee[_0xdc9fe3][_0x3b46a9],util[_0x72d1('0x27')](_0x72d1('0x96'),_0x23db54,_0xdc9fe3+'['+_0x3b46a9+']'));}}else{if(!_[_0x72d1('0x42')](_0x3982ee[_0xdc9fe3])){this['channel'][_0x72d1('0x98')](util[_0x72d1('0x27')](_0x72d1('0x96'),_0x23db54,_0xdc9fe3),_0x3982ee[_0xdc9fe3]);}}}}};AGIVertices['prototype'][_0x72d1('0x91')]=function(_0x3e8b52){try{var _0x412a62=JSON['parse'](_0x3e8b52);this[_0x72d1('0x93')](_0x412a62);return JSON['stringify'](_0x412a62);}catch(_0x352ae2){return this[_0x72d1('0x92')](_0x3e8b52);}};AGIVertices['prototype'][_0x72d1('0x92')]=function(_0x170333){var _0x9d7fac=_0x170333[_0x72d1('0x99')]('{');for(var _0xc2a5a4=0x1;_0xc2a5a4<_0x9d7fac[_0x72d1('0x97')];_0xc2a5a4+=0x1){var _0x49797d=_0x9d7fac[_0xc2a5a4][_0x72d1('0x99')]('}');if(_0x49797d[_0x72d1('0x97')]>0x1){_0x170333=_0x170333[_0x72d1('0x9a')]('{'+_0x49797d[0x0]+'}',this['channel'][_0x72d1('0xf')](_0x49797d[0x0])[_0x72d1('0x9b')]||_0x49797d[0x0]);}}if(_0x9d7fac[_0x72d1('0x97')]===0x1){return _0x170333[_0x72d1('0x49')]();}return this['replaceAllVariables'](_0x170333);};AGIVertices[_0x72d1('0xe')][_0x72d1('0x9c')]=function(_0xf94aa1,_0x317e18){var _0xc8f14b=this[_0x72d1('0xc')]['getVariable'](_0xf94aa1);if(_0xc8f14b[_0x72d1('0x9d')]===-0x1){return _0xc8f14b;}logger[_0x72d1('0x2d')](util[_0x72d1('0x27')](_0x72d1('0x9e'),_0x317e18,_0xc8f14b['extra']));return this['channel'][_0x72d1('0x98')](_0x317e18,_0xc8f14b['extra']);};AGIVertices[_0x72d1('0xe')][_0x72d1('0x9f')]=function(_0x2bd855){return _0x2bd855&&_0x2bd855!=='0'&&_0x2bd855!=='-1'&&_0x2bd855!=='';};AGIVertices[_0x72d1('0xe')][_0x72d1('0xa0')]=function(_0x4dcfef){this[_0x72d1('0x34')][_0x72d1('0x6d')](this,_0x4dcfef,'-');_0x4dcfef[_0x72d1('0xa1')]=_0x4dcfef[_0x72d1('0xa0')];return{'code':0xc8,'result':'-'};};AGIVertices[_0x72d1('0xe')][_0x72d1('0xa2')]=function(_0x6d9b75){logger[_0x72d1('0x2d')](util['format'](_0x72d1('0xa3'),_0x6d9b75[_0x72d1('0x35')]));if(!this[_0x72d1('0x9f')](_0x6d9b75[_0x72d1('0x5a')])){return this[_0x72d1('0xc')][_0x72d1('0xa4')](_0x72d1('0xa5'));}var _0x585a2a='\x22'+_0x6d9b75['text']+'\x22';if(this['isConfigured'](_0x6d9b75[_0x72d1('0x77')])){_0x585a2a+=','+_0x6d9b75['options'];}var _0x5c4774=this[_0x72d1('0xc')][_0x72d1('0x55')](_0x72d1('0xa6'),_0x585a2a);if(_0x5c4774['result']===-0x1){return _0x5c4774;}return this['channel']['noop'](util[_0x72d1('0x27')](_0x72d1('0xa7'),_0x585a2a));};AGIVertices[_0x72d1('0xe')][_0x72d1('0xa8')]=function(_0x2868d8){logger[_0x72d1('0x2d')](util['format']('Enter\x20in\x20MRCPRecog\x20(%s)\x20block',_0x2868d8[_0x72d1('0x35')]));if(!this['isConfigured'](_0x2868d8['grammar'])){return this[_0x72d1('0xc')]['noop'](_0x72d1('0xa9'));}var _0x3dbbe5=_0x2868d8[_0x72d1('0xaa')];if(this[_0x72d1('0x9f')](_0x2868d8['options'])){_0x3dbbe5+=','+_0x2868d8[_0x72d1('0x77')];}var _0x549ec6=this[_0x72d1('0xc')][_0x72d1('0x55')]('MRCPRecog',_0x3dbbe5);if(_0x549ec6[_0x72d1('0x9d')]===-0x1){return _0x549ec6;}var _0x47fc64=this[_0x72d1('0x9c')]('RECOG_CONFIDENCE()','MRCP_RECOG_CONFIDENCE');if(_0x47fc64[_0x72d1('0x9d')]===-0x1){return _0x47fc64;}var _0x3e3065=this[_0x72d1('0x9c')](_0x72d1('0xab'),'MRCP_RECOG_TRANSCRIPT');if(_0x3e3065['result']===-0x1){return _0x3e3065;}var _0x284c67=this[_0x72d1('0x9c')]('RECOG_INSTANCE()',_0x72d1('0xac'));if(_0x284c67['result']===-0x1){return _0x284c67;}return this[_0x72d1('0xc')][_0x72d1('0xa4')](util[_0x72d1('0x27')]('Executed\x20command\x20MRCPRecog\x20%s',_0x3dbbe5));};AGIVertices['prototype'][_0x72d1('0x6')]=function(_0x1ed28f){logger[_0x72d1('0x2d')](util[_0x72d1('0x27')](_0x72d1('0xad'),_0x1ed28f['label']));return this[_0x72d1('0xc')][_0x72d1('0x6')]([_0x1ed28f[_0x72d1('0xae')],_0x1ed28f[_0x72d1('0xaf')]]);};AGIVertices[_0x72d1('0xe')][_0x72d1('0xb0')]=function(_0x3ded2f){logger[_0x72d1('0x2d')](util[_0x72d1('0x27')]('Enter\x20in\x20ANSWER\x20(%s)\x20block',_0x3ded2f[_0x72d1('0x35')]));if(this['isConfigured'](_0x3ded2f[_0x72d1('0x62')])){logger[_0x72d1('0x2d')](util[_0x72d1('0x27')](_0x72d1('0xb1'),_0x3ded2f[_0x72d1('0x62')]));var _0x15b256=this['channel']['wait'](_0x3ded2f[_0x72d1('0x62')]);if(_0x15b256['result']===-0x1){return _0x15b256;}}return this[_0x72d1('0xc')][_0x72d1('0xb0')]();};AGIVertices[_0x72d1('0xe')]['callback']=function(_0x2c324f){logger[_0x72d1('0x2d')](util[_0x72d1('0x27')](_0x72d1('0xb2'),_0x2c324f[_0x72d1('0x35')]));if(!this[_0x72d1('0x9f')](_0x2c324f[_0x72d1('0x46')])){return this['channel'][_0x72d1('0x29')](_0x2c324f,_0x72d1('0xb3'));}_0x2c324f[_0x72d1('0x47')]=moment();if(this[_0x72d1('0x9f')](_0x2c324f[_0x72d1('0xb4')])){_0x2c324f[_0x72d1('0x47')]=moment()[_0x72d1('0xb5')](_0x2c324f[_0x72d1('0xb4')],_0x72d1('0xb6'));}if(!this[_0x72d1('0x9f')](_0x2c324f[_0x72d1('0x4a')])){_0x2c324f['callback_priority']=0x2;}this[_0x72d1('0x40')]['sync'](this,_0x2c324f);return this[_0x72d1('0xc')][_0x72d1('0xa4')](util[_0x72d1('0x27')](_0x72d1('0xb7'),_0x2c324f[_0x72d1('0x45')],_0x2c324f[_0x72d1('0x46')],_0x2c324f['scheduledAt']));};AGIVertices[_0x72d1('0xe')][_0x72d1('0xb8')]=function(_0xf50257){logger[_0x72d1('0x2d')](util[_0x72d1('0x27')]('Enter\x20in\x20CUSTOM\x20APP\x20(%s)\x20block',_0xf50257[_0x72d1('0x35')]));var _0x38abcb=this[_0x72d1('0xc')][_0x72d1('0x55')](_0xf50257[_0x72d1('0xb9')],_0xf50257[_0x72d1('0x77')]);if(_0x38abcb[_0x72d1('0x9d')]===-0x1){return _0x38abcb;}return this['channel']['noop'](util[_0x72d1('0x27')](_0x72d1('0xba'),_0xf50257[_0x72d1('0xb9')],_0xf50257[_0x72d1('0x77')]));};AGIVertices['prototype'][_0x72d1('0xbb')]=function(_0x4296e6){logger[_0x72d1('0x2d')](util[_0x72d1('0x27')](_0x72d1('0xbc'),_0x4296e6[_0x72d1('0x35')]));if(!this[_0x72d1('0x9f')](_0x4296e6[_0x72d1('0x5a')])){return this[_0x72d1('0xc')][_0x72d1('0xa4')](_0x72d1('0xa5'));}var _0x1065d8='\x22'+_0x4296e6['text']+'\x22';if(this[_0x72d1('0x9f')](_0x4296e6['options'])){_0x1065d8+=','+_0x4296e6[_0x72d1('0x77')];}var _0x20ad96=this['channel'][_0x72d1('0x55')](_0x72d1('0xa6'),_0x1065d8);if(_0x20ad96[_0x72d1('0x9d')]===-0x1){return _0x20ad96;}return this[_0x72d1('0xc')]['noop'](util[_0x72d1('0x27')](_0x72d1('0xa7'),_0x1065d8));};AGIVertices[_0x72d1('0xe')][_0x72d1('0xbd')]=function(_0x499fac){logger[_0x72d1('0x2d')](util[_0x72d1('0x27')](_0x72d1('0xbe'),_0x499fac[_0x72d1('0x35')]));if(!this[_0x72d1('0x9f')](_0x499fac['text'])){return this['channel'][_0x72d1('0xa4')]('no\x20text\x20configured');}var _0x22be3c='\x22'+_0x499fac['text']+'\x22';if(this[_0x72d1('0x9f')](_0x499fac['options'])){_0x22be3c+=','+_0x499fac[_0x72d1('0x77')];}var _0x8d5068=this[_0x72d1('0xc')]['exec'](_0x72d1('0xa6'),_0x22be3c);if(_0x8d5068[_0x72d1('0x9d')]===-0x1){return _0x8d5068;}return this[_0x72d1('0xc')][_0x72d1('0xa4')](util['format'](_0x72d1('0xa7'),_0x22be3c));};AGIVertices[_0x72d1('0xe')][_0x72d1('0xbf')]=function(_0x3121d5){logger[_0x72d1('0x2d')](util['format'](_0x72d1('0xc0'),_0x3121d5[_0x72d1('0x35')]));if(!this[_0x72d1('0x9f')](_0x3121d5[_0x72d1('0xaa')])){return this[_0x72d1('0xc')][_0x72d1('0xa4')](_0x72d1('0xa9'));}var _0x5a1b7c=_0x3121d5['grammar'];if(this[_0x72d1('0x9f')](_0x3121d5['options'])){_0x5a1b7c+=','+_0x3121d5[_0x72d1('0x77')];}var _0x411347=this[_0x72d1('0xc')][_0x72d1('0x55')](_0x72d1('0xc1'),_0x5a1b7c);if(_0x411347[_0x72d1('0x9d')]===-0x1){return _0x411347;}var _0x2e67a5=this[_0x72d1('0x9c')](_0x72d1('0xc2'),_0x72d1('0xc3'));if(_0x2e67a5['result']===-0x1){return _0x2e67a5;}var _0x14068a=this[_0x72d1('0x9c')]('RECOG_INPUT()',_0x72d1('0xc4'));if(_0x14068a['result']===-0x1){return _0x14068a;}var _0x3ab940=this['getAndSetVariable'](_0x72d1('0xc5'),'LUMENVOX_ASR_INSTANCE');if(_0x3ab940['result']===-0x1){return _0x3ab940;}return this[_0x72d1('0xc')][_0x72d1('0xa4')](util[_0x72d1('0x27')](_0x72d1('0xc6'),_0x5a1b7c));};AGIVertices[_0x72d1('0xe')][_0x72d1('0xc7')]=function(_0x34b338){logger[_0x72d1('0x2d')](util[_0x72d1('0x27')](_0x72d1('0xc8'),_0x34b338['label']));if(!this['isConfigured'](_0x34b338[_0x72d1('0xaa')])){return this[_0x72d1('0xc')][_0x72d1('0xa4')](_0x72d1('0xa9'));}var _0x24c52a=_0x34b338[_0x72d1('0xaa')];if(this[_0x72d1('0x9f')](_0x34b338['options'])){_0x24c52a+=','+_0x34b338[_0x72d1('0x77')];}var _0xf850f0=this[_0x72d1('0xc')][_0x72d1('0x55')]('MRCPRecog',_0x24c52a);if(_0xf850f0[_0x72d1('0x9d')]===-0x1){return _0xf850f0;}var _0x1c9ca8=this[_0x72d1('0x9c')]('RECOG_CONFIDENCE()','SESTEK_ASR_CONFIDENCE');if(_0x1c9ca8[_0x72d1('0x9d')]===-0x1){return _0x1c9ca8;}var _0x1730dc=this[_0x72d1('0x9c')](_0x72d1('0xab'),_0x72d1('0xc9'));if(_0x1730dc[_0x72d1('0x9d')]===-0x1){return _0x1730dc;}var _0x2bca96=this[_0x72d1('0x9c')]('RECOG_INSTANCE()','SESTEK_ASR_INSTANCE');if(_0x2bca96[_0x72d1('0x9d')]===-0x1){return _0x2bca96;}return this['channel'][_0x72d1('0xa4')](util['format'](_0x72d1('0xc6'),_0x24c52a));};AGIVertices[_0x72d1('0xe')][_0x72d1('0xca')]=function(_0x5de544){logger[_0x72d1('0x2d')](util[_0x72d1('0x27')](_0x72d1('0xcb'),_0x5de544[_0x72d1('0x35')]));if(!this['isConfigured'](_0x5de544[_0x72d1('0xcc')])){return this[_0x72d1('0xc')]['error'](_0x5de544,_0x72d1('0xcd'));}var _0xb226a3=this['getSquareOdbc'][_0x72d1('0x6d')](this,_0x5de544[_0x72d1('0xcc')]);if(!_0xb226a3){return this[_0x72d1('0xc')]['error'](_0x5de544,_0x72d1('0xce'));}if(!this[_0x72d1('0x9f')](_0x5de544['query'])){return this[_0x72d1('0xc')]['error'](_0x5de544,_0x72d1('0xcf'));}var _0x84904=_0x5de544[_0x72d1('0x2c')][_0x72d1('0x57')](/(\r\n|\n|\r)/gm,'\x20');this[_0x72d1('0xc')][_0x72d1('0xa4')](util[_0x72d1('0x27')]('query:\x20%s',_0x84904));var _0x354832=this['getQueryOdbc'][_0x72d1('0x6d')](this,_0xb226a3,_0x84904);this[_0x72d1('0x34')][_0x72d1('0x6d')](this,_0x5de544,_0x84904);if(!this[_0x72d1('0x9f')](_0x5de544[_0x72d1('0xd0')])){return this[_0x72d1('0xc')]['noop'](_0x72d1('0xd1'));}var _0x2288e2=this[_0x72d1('0xf')][_0x72d1('0x6d')](this,_0x5de544[_0x72d1('0xd0')]);if(!_0x2288e2){return this[_0x72d1('0xc')][_0x72d1('0x29')](_0x5de544,_0x72d1('0xd2'));}var _0x59fb89=this;_0x354832[_0x72d1('0xd3')](function(_0x54333f,_0x44b1f9){Object[_0x72d1('0xd4')](_0x54333f)[_0x72d1('0xd3')](function(_0x35fbf4){_0x59fb89[_0x72d1('0xc')][_0x72d1('0x98')](util[_0x72d1('0x27')](_0x72d1('0xd5'),_0x2288e2,_0x44b1f9,_0x35fbf4),_0x54333f[_0x35fbf4]);});});this[_0x72d1('0xc')][_0x72d1('0x98')](util[_0x72d1('0x27')]('%s_ROWS_COUNT',_0x2288e2),_0x354832[_0x72d1('0x97')]);return this[_0x72d1('0xc')][_0x72d1('0xa4')](util[_0x72d1('0x27')](_0x72d1('0xd6'),_0x2288e2));};AGIVertices[_0x72d1('0xe')][_0x72d1('0xd7')]=function(_0x574cd4){logger[_0x72d1('0xd8')](util[_0x72d1('0x27')](_0x72d1('0xd9'),_0x574cd4[_0x72d1('0x35')]));if(!this[_0x72d1('0x9f')](_0x574cd4['sip_id'])){return this[_0x72d1('0xc')]['error'](_0x574cd4,_0x72d1('0xda'));}var _0x4fe8dc=this['getUser']['sync'](this,_0x574cd4[_0x72d1('0xdb')]);if(!_0x4fe8dc){return this[_0x72d1('0xc')][_0x72d1('0x29')](_0x574cd4,'no\x20user\x20found');}var _0x268eea=this[_0x72d1('0xc')]['exec'](_0x72d1('0xdc'),[util['format'](_0x72d1('0xdd'),_0x4fe8dc),_0x574cd4['timeout'],_0x574cd4[_0x72d1('0xde')],_0x574cd4[_0x72d1('0x70')]]);if(_0x268eea[_0x72d1('0x9d')]===-0x1){return _0x268eea;}return this[_0x72d1('0xc')][_0x72d1('0xa4')](util['format'](_0x72d1('0xdf'),'DIAL'));};AGIVertices[_0x72d1('0xe')][_0x72d1('0xe0')]=function(_0xed1ab2){logger[_0x72d1('0x2d')](util[_0x72d1('0x27')](_0x72d1('0xe1'),_0xed1ab2[_0x72d1('0x35')]));if(!this[_0x72d1('0x9f')](_0xed1ab2['key'])){return this['channel'][_0x72d1('0xa4')]('no\x20key\x20configured');}if(!this[_0x72d1('0x9f')](_0xed1ab2[_0x72d1('0x5a')])){return this[_0x72d1('0xc')][_0x72d1('0xa4')](_0x72d1('0xa5'));}this['channel']['bot']=!![];this[_0x72d1('0x34')](_0xed1ab2);this[_0x72d1('0x3f')](_0xed1ab2[_0x72d1('0x5a')],'in','','');this[_0x72d1('0xc')][_0x72d1('0xa4')](util[_0x72d1('0x27')]('Trying\x20Dialogflow:\x20%s',_0xed1ab2[_0x72d1('0x5a')]));var _0x1cd699=this[_0x72d1('0x78')]['sync'](this,_0xed1ab2);if(_0x1cd699){for(var _0x507bb0 in _0x1cd699){if(_0x1cd699[_0x72d1('0x8f')](_0x507bb0)){this[_0x72d1('0xc')][_0x72d1('0x98')](util[_0x72d1('0x27')](_0x72d1('0xe2'),_0x507bb0['toUpperCase']()),_0x1cd699[_0x507bb0]);}}this['createSquareMessage'](_0x1cd699[_0x72d1('0xe3')],_0x72d1('0xe4'),_0x72d1('0xe0'),'');return this[_0x72d1('0xc')][_0x72d1('0xa4')](util[_0x72d1('0x27')](_0x72d1('0xe5'),_0x1cd699[_0x72d1('0xe3')]));}return this['channel'][_0x72d1('0x29')](_0xed1ab2,_0x72d1('0xe6'));};AGIVertices[_0x72d1('0xe')][_0x72d1('0xe7')]=function(_0x1ffd3e){logger['info'](util[_0x72d1('0x27')](_0x72d1('0xe8'),_0x1ffd3e[_0x72d1('0x35')]));if(!this[_0x72d1('0x9f')](_0x1ffd3e[_0x72d1('0x7b')])){return this[_0x72d1('0xc')][_0x72d1('0xa4')](_0x72d1('0xe9'));}if(!this[_0x72d1('0x9f')](_0x1ffd3e[_0x72d1('0x7c')])){return this[_0x72d1('0xc')][_0x72d1('0xa4')](_0x72d1('0xea'));}if(!this[_0x72d1('0x9f')](_0x1ffd3e['private_key'])){return this[_0x72d1('0xc')][_0x72d1('0xa4')](_0x72d1('0xeb'));}if(!this['isConfigured'](_0x1ffd3e[_0x72d1('0xec')])){return this['channel'][_0x72d1('0xa4')](_0x72d1('0xed'));}if(!this[_0x72d1('0x9f')](_0x1ffd3e['text'])){return this[_0x72d1('0xc')][_0x72d1('0xa4')]('no\x20text\x20configured');}this['channel']['bot']=!![];this[_0x72d1('0x34')](_0x1ffd3e);this['createSquareMessage'](_0x1ffd3e[_0x72d1('0x5a')],'in','','');this[_0x72d1('0xc')][_0x72d1('0xa4')](util[_0x72d1('0x27')](_0x72d1('0xee'),_0x1ffd3e[_0x72d1('0x5a')]));var _0x3b263c=this[_0x72d1('0x7a')][_0x72d1('0x6d')](this,_0x1ffd3e);if(_0x3b263c){for(var _0x389055 in _0x3b263c){if(_0x3b263c[_0x72d1('0x8f')](_0x389055)){if(_0x389055!=='providerResponse'){this['channel'][_0x72d1('0x98')](util[_0x72d1('0x27')](_0x72d1('0xe2'),_0x389055[_0x72d1('0x67')]()),_0x3b263c[_0x389055]);}}}this[_0x72d1('0x3f')](_0x3b263c[_0x72d1('0xe3')],_0x72d1('0xe4'),_0x72d1('0xe7'),_0x3b263c[_0x72d1('0xef')]);return this[_0x72d1('0xc')][_0x72d1('0xa4')](util[_0x72d1('0x27')](_0x72d1('0xf0'),_0x3b263c['speech']));}return this[_0x72d1('0xc')][_0x72d1('0x29')](_0x1ffd3e,_0x72d1('0xf1'));};AGIVertices['prototype'][_0x72d1('0xf2')]=function(_0x21e5e1){logger['info'](util[_0x72d1('0x27')](_0x72d1('0xf3'),_0x21e5e1[_0x72d1('0x35')]));if(!this[_0x72d1('0x9f')](_0x21e5e1[_0x72d1('0xf4')])){return this['channel']['noop'](_0x72d1('0xf5'));}if(!this[_0x72d1('0x9f')](_0x21e5e1[_0x72d1('0xf6')])){return this[_0x72d1('0xc')][_0x72d1('0xa4')](_0x72d1('0xf7'));}if(!this['isConfigured'](_0x21e5e1['password'])){return this[_0x72d1('0xc')][_0x72d1('0xa4')](_0x72d1('0xf8'));}if(!this[_0x72d1('0x9f')](_0x21e5e1[_0x72d1('0xf9')])){return this[_0x72d1('0xc')][_0x72d1('0xa4')]('no\x20text\x20configured');}this['channel'][_0x72d1('0xfa')]=!![];this[_0x72d1('0x34')](_0x21e5e1);this['createSquareMessage'](_0x21e5e1[_0x72d1('0x5a')],'in','','');this[_0x72d1('0xc')][_0x72d1('0xa4')](util[_0x72d1('0x27')](_0x72d1('0xfb'),_0x21e5e1[_0x72d1('0x5a')]));var _0x1c35c5=this['sestekNDA'][_0x72d1('0x6d')](this,_0x21e5e1);if(_0x1c35c5){for(var _0x4c95c8 in _0x1c35c5){if(_0x1c35c5['hasOwnProperty'](_0x4c95c8)){this['channel'][_0x72d1('0x98')](util[_0x72d1('0x27')](_0x72d1('0xfc'),_0x4c95c8[_0x72d1('0x67')]()),_0x1c35c5[_0x4c95c8]);}}this['createSquareMessage'](_0x1c35c5[_0x72d1('0xe3')],_0x72d1('0xe4'),_0x72d1('0xf2'),'');if(_0x1c35c5[_0x72d1('0xfd')]){this['channel'][_0x72d1('0xa4')](util[_0x72d1('0x27')](_0x72d1('0xfe'),_0x1c35c5[_0x72d1('0xfd')]));var _0x55672a=this['channel'][_0x72d1('0xff')](_0x1c35c5['audiofile']);try{fs['unlink'](_0x1c35c5['audiofile']+_0x72d1('0x100'));}catch(_0x2fc085){logger[_0x72d1('0x29')](_0x2fc085);}return _0x55672a;}else{return this[_0x72d1('0xc')][_0x72d1('0xa4')](util['format'](_0x72d1('0x101'),_0x1c35c5[_0x72d1('0xe3')]));}}return this['channel'][_0x72d1('0x29')](_0x21e5e1,'SestekNDA\x20is\x20unreachable');};AGIVertices[_0x72d1('0xe')][_0x72d1('0x102')]=function(_0x29f83e){logger[_0x72d1('0x2d')](util['format']('Enter\x20in\x20END\x20(%s)\x20block',_0x29f83e[_0x72d1('0x35')]));return this['channel']['noop'](_0x72d1('0x102'));};AGIVertices['prototype']['ext_dial']=function(_0x541615){logger[_0x72d1('0x2d')](util[_0x72d1('0x27')](_0x72d1('0x103'),_0x541615[_0x72d1('0x35')]));var _0x2f1001='';if(_0x541615['trunk_id']){if(!this[_0x72d1('0x9f')](_0x541615[_0x72d1('0x104')])){return this['channel'][_0x72d1('0x29')](_0x541615,_0x72d1('0x105'));}else{var _0x55ba85=parseInt(_0x541615[_0x72d1('0x104')],0xa);if(isNaN(_0x55ba85)){_0x2f1001=_0x541615[_0x72d1('0x104')];}else{_0x2f1001=this[_0x72d1('0x106')][_0x72d1('0x6d')](this,_0x541615[_0x72d1('0x104')]);if(!_0x2f1001){return this[_0x72d1('0xc')][_0x72d1('0x29')](_0x541615,_0x72d1('0x107'));}}}}else if(_0x541615[_0x72d1('0x108')]){_0x2f1001=_0x541615['trunk_name'];}else{return this[_0x72d1('0xc')][_0x72d1('0x29')](_0x541615,'no\x20trunk\x20selected');}var _0x4da2c4=this[_0x72d1('0xc')]['exec'](_0x72d1('0xdc'),[util[_0x72d1('0x27')](_0x72d1('0x109'),_0x2f1001,_0x541615['phone']),_0x541615[_0x72d1('0x62')],_0x541615[_0x72d1('0xde')],_0x541615['url']]);if(_0x4da2c4[_0x72d1('0x9d')]===-0x1){return _0x4da2c4;}return this['channel'][_0x72d1('0xa4')](util[_0x72d1('0x27')](_0x72d1('0xdf'),_0x72d1('0xdc')));};AGIVertices[_0x72d1('0xe')][_0x72d1('0x10a')]=function(_0x4959a9){logger[_0x72d1('0x2d')](util[_0x72d1('0x27')](_0x72d1('0x10b'),_0x4959a9[_0x72d1('0x35')]));return this[_0x72d1('0xc')][_0x72d1('0xa4')](_0x72d1('0x10a'));};AGIVertices[_0x72d1('0xe')][_0x72d1('0xa')]=function(_0x1ea17d){logger[_0x72d1('0x2d')](util[_0x72d1('0x27')]('Enter\x20in\x20GETDIGITS\x20(%s)\x20block',_0x1ea17d[_0x72d1('0x35')]));if(_0x1ea17d[_0x72d1('0xa1')]===0x0){return this['maxRetry'](_0x1ea17d);}_0x1ea17d[_0x72d1('0xa1')]-=0x1;if(!this['isConfigured'](_0x1ea17d[_0x72d1('0x10c')])){return this[_0x72d1('0xc')][_0x72d1('0x29')](_0x1ea17d,'no\x20file\x20audio\x20selected');}var _0x3de1a3=this[_0x72d1('0x1c')][_0x72d1('0x6d')](this,_0x1ea17d[_0x72d1('0x10c')]);if(!_0x3de1a3){return this[_0x72d1('0xc')]['error'](_0x1ea17d,_0x72d1('0x10d'));}if(!this[_0x72d1('0x9f')](_0x1ea17d['variable_id'])){return this['channel'][_0x72d1('0x29')](_0x72d1('0xd1'));}var _0x52cb91=this[_0x72d1('0xc')][_0x72d1('0x10e')](_0x3de1a3,_0x1ea17d[_0x72d1('0x10f')],_0x1ea17d[_0x72d1('0x110')]);var _0x40fcfd=_0x52cb91[_0x72d1('0x9d')]?_0x52cb91[_0x72d1('0x9d')]['toString']():'';logger['info'](_0x72d1('0x111'),JSON[_0x72d1('0x72')](_0x52cb91));if(_0x52cb91[_0x72d1('0x9d')]===-0x1){this[_0x72d1('0x34')][_0x72d1('0x6d')](this,_0x1ea17d,_0x40fcfd);return _0x52cb91;}else if(_0x52cb91[_0x72d1('0x9b')]===_0x72d1('0x62')){_0x52cb91[_0x72d1('0x9d')]=_0x40fcfd[_0x72d1('0x97')]>=parseInt(_0x1ea17d[_0x72d1('0x112')])?'x':'i';}else{_0x52cb91[_0x72d1('0x9d')]=_0x40fcfd[_0x72d1('0x97')]>=parseInt(_0x1ea17d['mindigit'])&&_0x40fcfd[_0x72d1('0x97')]<=parseInt(_0x1ea17d[_0x72d1('0x110')])?'x':'i';}var _0x23fb0a=this[_0x72d1('0xf')][_0x72d1('0x6d')](this,_0x1ea17d[_0x72d1('0xd0')]);if(!_0x23fb0a){return this[_0x72d1('0xc')][_0x72d1('0x29')](_0x1ea17d,'no\x20variable\x20found');}this['channel'][_0x72d1('0x98')](_0x23fb0a,_0x40fcfd);if(this['isConfigured'](_0x1ea17d[_0x72d1('0x113')])){var _0x4e68ae=parseInt(_0x1ea17d[_0x72d1('0x113')],0xa);var _0x3847e0=rs[_0x72d1('0x114')]({'charset':'*','length':_0x4e68ae});var _0xeb380=_0x40fcfd['length'];if(_0xeb380>0x0){if(_0xeb380>_0x4e68ae){this[_0x72d1('0x34')]['sync'](this,_0x1ea17d,_0x1ea17d['hiddendigitspos']===_0x72d1('0x115')?_0x3847e0+_0x40fcfd[_0x72d1('0x116')](_0x4e68ae):_0x40fcfd['substr'](0x0,_0xeb380-_0x4e68ae)+_0x3847e0);}else{this['createSquareDetailsReport']['sync'](this,_0x1ea17d,rs[_0x72d1('0x114')]({'charset':'*','length':_0xeb380}));}}else{this[_0x72d1('0x34')]['sync'](this,_0x1ea17d,'');}}else{this[_0x72d1('0x34')]['sync'](this,_0x1ea17d,_0x40fcfd);}return _0x52cb91;};AGIVertices[_0x72d1('0xe')][_0x72d1('0xb')]=function(_0x72321a){logger[_0x72d1('0x2d')](util['format'](_0x72d1('0x117'),_0x72321a[_0x72d1('0x35')]));return this[_0x72d1('0xa')](_0x72321a);};AGIVertices[_0x72d1('0xe')][_0x72d1('0x118')]=function(_0x32bd8d){logger[_0x72d1('0x2d')](util['format'](_0x72d1('0x119'),_0x32bd8d[_0x72d1('0x35')]));this['createSquareDetailsReport'][_0x72d1('0x6d')](this,_0x32bd8d,_0x32bd8d[_0x72d1('0x11a')]);return this[_0x72d1('0xc')][_0x72d1('0xa4')](util[_0x72d1('0x27')](_0x72d1('0x11b'),_0x32bd8d[_0x72d1('0x11a')]));};AGIVertices['prototype']['awspolly']=function(_0x2e9a8a){logger[_0x72d1('0x2d')](util[_0x72d1('0x27')](_0x72d1('0x11c'),_0x2e9a8a['label']));if(!this[_0x72d1('0x9f')](_0x2e9a8a[_0x72d1('0x86')])||!this[_0x72d1('0x9f')](_0x2e9a8a[_0x72d1('0x11d')])){return this[_0x72d1('0xc')][_0x72d1('0xa4')]('no\x20valid\x20credentials\x20configured');}if(!this['isConfigured'](_0x2e9a8a['text'])){return this[_0x72d1('0xc')][_0x72d1('0xa4')](_0x72d1('0xa5'));}this['channel'][_0x72d1('0xa4')](util[_0x72d1('0x27')](_0x72d1('0x11e'),_0x2e9a8a[_0x72d1('0x5a')]));var _0xf4b74f=this[_0x72d1('0x85')][_0x72d1('0x6d')](this,_0x2e9a8a);if(_0xf4b74f){this[_0x72d1('0xc')][_0x72d1('0xa4')](util[_0x72d1('0x27')]('aws\x20Polly\x20%s\x20file\x20created',_0xf4b74f));var _0x47f440=this[_0x72d1('0xc')][_0x72d1('0xff')](_0xf4b74f);try{fs['unlink'](_0xf4b74f+_0x72d1('0x100'));}catch(_0x313d87){logger[_0x72d1('0x29')](_0x313d87);}return _0x47f440;}return this[_0x72d1('0xc')][_0x72d1('0x29')](_0x2e9a8a,_0x72d1('0x11f'));};AGIVertices[_0x72d1('0xe')][_0x72d1('0x120')]=function(_0x18ad49){logger[_0x72d1('0x2d')](util['format'](_0x72d1('0x121'),_0x18ad49[_0x72d1('0x35')]));if(!this[_0x72d1('0x9f')](_0x18ad49[_0x72d1('0x86')])||!this[_0x72d1('0x9f')](_0x18ad49['aws_secret_access_key'])){return this[_0x72d1('0xc')][_0x72d1('0xa4')](_0x72d1('0x122'));}if(!this[_0x72d1('0x9f')](_0x18ad49[_0x72d1('0x89')])){return this[_0x72d1('0xc')]['noop'](_0x72d1('0x123'));}if(!this[_0x72d1('0x9f')](_0x18ad49['text'])){return this['channel'][_0x72d1('0xa4')](_0x72d1('0xa5'));}this[_0x72d1('0xc')][_0x72d1('0xfa')]=!![];this[_0x72d1('0x34')](_0x18ad49);this['createSquareMessage'](_0x18ad49[_0x72d1('0x5a')],'in','','');this['channel'][_0x72d1('0xa4')](util[_0x72d1('0x27')](_0x72d1('0x124'),_0x18ad49['text']));var _0x145efe=this[_0x72d1('0x88')][_0x72d1('0x6d')](this,_0x18ad49);if(_0x145efe){for(var _0x34b950 in _0x145efe){if(_0x145efe[_0x72d1('0x8f')](_0x34b950)&&_[_0x72d1('0x90')](_0x145efe[_0x34b950])){this[_0x72d1('0xc')][_0x72d1('0x98')](util[_0x72d1('0x27')](_0x72d1('0x125'),_0x34b950[_0x72d1('0x67')]()),_0x145efe[_0x34b950]);}}if(_['isNil'](_0x145efe[_0x72d1('0x75')])){return this['channel'][_0x72d1('0xa4')](_0x72d1('0x126'));}else{this['createSquareMessage'](_0x145efe[_0x72d1('0x75')],_0x72d1('0xe4'),_0x72d1('0x127'),'');return this[_0x72d1('0xc')][_0x72d1('0xa4')](util[_0x72d1('0x27')](_0x72d1('0x128'),_0x145efe[_0x72d1('0x75')]));}}return this[_0x72d1('0xc')]['error'](_0x18ad49,_0x72d1('0x129'));};AGIVertices[_0x72d1('0xe')]['googleasr']=function(_0x166521){logger['info'](util['format']('Enter\x20in\x20GOOGLEASR\x20(%s)\x20block\x20%s',_0x166521[_0x72d1('0x35')],_0x166521['timeout']));if(!this['isConfigured'](_0x166521[_0x72d1('0x80')])){return this[_0x72d1('0xc')][_0x72d1('0xa4')]('no\x20key\x20configured');}var _0x348c70=_0x72d1('0x12a');var _0x315cc4=util[_0x72d1('0x27')](_0x72d1('0x12b'),FILES_PATH,rs[_0x72d1('0x114')](0x4));var _0xd3d2b6=util['format']('%s.%s',_0x315cc4,_0x348c70);var _0x544198=!![];if(_0x166521[_0x72d1('0x12c')]===_0x72d1('0x12d')){_0x544198=![];}var _0x46151f=this[_0x72d1('0xc')]['recordFile'](_0x315cc4,_0x348c70,_0x166521[_0x72d1('0x12e')],_0x166521[_0x72d1('0x62')],undefined,_0x544198);if(_0x46151f['result']!==-0x1){this[_0x72d1('0xc')][_0x72d1('0xa4')](util['format'](_0x72d1('0x12f'),_0xd3d2b6));var _0x20919c=this[_0x72d1('0x8a')]['sync'](this,_0x166521,_0xd3d2b6);if(_0x20919c){for(var _0x165c30 in _0x20919c){if(_0x20919c[_0x72d1('0x8f')](_0x165c30)){this[_0x72d1('0xc')][_0x72d1('0x98')](util['format'](_0x72d1('0x130'),_0x165c30[_0x72d1('0x67')]()),_0x20919c[_0x165c30]);}}return this['channel'][_0x72d1('0xa4')](util[_0x72d1('0x27')]('GoogleASR\x20Result\x20%s',JSON['stringify'](_0x20919c)));}}return _0x46151f;};AGIVertices[_0x72d1('0xe')]['tildeasr']=function(_0x2c46e6){logger['info'](util['format'](_0x72d1('0x131'),_0x2c46e6[_0x72d1('0x35')]));if(!this[_0x72d1('0x9f')](_0x2c46e6['appid'])){return this['channel'][_0x72d1('0xa4')](_0x72d1('0x132'));}if(!this[_0x72d1('0x9f')](_0x2c46e6[_0x72d1('0x8d')])){return this[_0x72d1('0xc')][_0x72d1('0xa4')](_0x72d1('0x133'));}var _0x3e1f47=_0x72d1('0x12a');var _0x5299d9=util[_0x72d1('0x27')](_0x72d1('0x12b'),FILES_PATH,rs[_0x72d1('0x114')](0x4));var _0x214bff=util[_0x72d1('0x27')]('%s.%s',_0x5299d9,_0x3e1f47);var _0x4297e6=!![];if(_0x2c46e6['beep']===_0x72d1('0x12d')){_0x4297e6=![];}var _0x32939f=this[_0x72d1('0xc')]['recordFile'](_0x5299d9,_0x3e1f47,_0x2c46e6[_0x72d1('0x12e')],_0x2c46e6['timeout'],undefined,_0x4297e6);if(_0x32939f[_0x72d1('0x9d')]!==-0x1){this['channel'][_0x72d1('0xa4')](util[_0x72d1('0x27')](_0x72d1('0x134'),_0x214bff));var _0x222789=this[_0x72d1('0x8c')][_0x72d1('0x6d')](this,_0x2c46e6,_0x214bff);if(_0x222789){for(var _0x568136 in _0x222789){if(_0x222789[_0x72d1('0x8f')](_0x568136)){this[_0x72d1('0xc')][_0x72d1('0x98')](util['format']('TILDE_ASR_%s',_0x568136[_0x72d1('0x67')]()),_0x222789[_0x568136]);}}return this[_0x72d1('0xc')]['noop'](util['format'](_0x72d1('0x135'),JSON[_0x72d1('0x72')](_0x222789)));}}return _0x32939f;};AGIVertices['prototype']['gotoc']=function(_0x392f98){logger[_0x72d1('0x2d')](util[_0x72d1('0x27')]('Enter\x20in\x20GOTO\x20(%s)\x20block',_0x392f98[_0x72d1('0x35')]));return this['channel'][_0x72d1('0x136')](_0x392f98['context'],_0x392f98[_0x72d1('0x3b')],_0x392f98[_0x72d1('0x3c')]);};AGIVertices[_0x72d1('0xe')][_0x72d1('0x137')]=function(_0x28ff50){logger[_0x72d1('0x2d')](util[_0x72d1('0x27')](_0x72d1('0x138'),_0x28ff50[_0x72d1('0x35')]));if(!this[_0x72d1('0x9f')](_0x28ff50['condition'])){return this[_0x72d1('0xc')][_0x72d1('0x29')](_0x28ff50,'no\x20condition\x20configured');}try{var _0x370047=eval(_0x28ff50['condition'])?_0x72d1('0x139'):'false';this[_0x72d1('0xc')][_0x72d1('0xa4')](util[_0x72d1('0x27')](_0x72d1('0x13a'),_0x28ff50[_0x72d1('0x13b')],_0x370047));return{'code':0xc8,'result':_0x370047};}catch(_0x2bace2){return{'code':0xc8,'result':_0x72d1('0x13c')};}};AGIVertices[_0x72d1('0xe')]['gotoiftime']=function(_0x455917){logger[_0x72d1('0x2d')](util['format'](_0x72d1('0x13d'),_0x455917[_0x72d1('0x35')]));if(!this[_0x72d1('0x9f')](_0x455917[_0x72d1('0x13e')])){return this['channel']['error'](_0x455917,'no\x20interval\x20configured');}var _0x251a47=this[_0x72d1('0x21')][_0x72d1('0x6d')](this,_0x455917['interval_id']);if(!_0x251a47){return this[_0x72d1('0xc')][_0x72d1('0x29')](_0x455917,'no\x20intervals\x20found');}for(var _0x501a09=0x0;_0x501a09<_0x251a47['length'];_0x501a09+=0x1){var _0x372591=this[_0x72d1('0xc')][_0x72d1('0xf')](util[_0x72d1('0x27')](_0x72d1('0x13f'),_0x251a47[_0x501a09]));if(_0x372591[_0x72d1('0x9d')]===-0x1){return _0x372591;}logger[_0x72d1('0x2d')](util[_0x72d1('0x27')](_0x72d1('0x140'),_0x251a47[_0x501a09],_0x372591[_0x72d1('0x9b')]));if(_0x372591[_0x72d1('0x9b')]==='true'){logger['info'](util['format'](_0x72d1('0x140'),_0x251a47[_0x501a09],_0x72d1('0x139')));this[_0x72d1('0xc')][_0x72d1('0xa4')](util[_0x72d1('0x27')](_0x72d1('0x140'),_0x251a47[_0x501a09],'true'));return{'code':0xc8,'result':'true'};}else{logger['info'](util[_0x72d1('0x27')](_0x72d1('0x140'),_0x251a47[_0x501a09],_0x72d1('0x13c')));this[_0x72d1('0xc')]['noop'](util[_0x72d1('0x27')](_0x72d1('0x140'),_0x251a47[_0x501a09],_0x72d1('0x13c')));}}return{'code':0xc8,'result':_0x72d1('0x13c')};};AGIVertices[_0x72d1('0xe')][_0x72d1('0x141')]=function(_0x55ec15){logger[_0x72d1('0x2d')](util[_0x72d1('0x27')]('Enter\x20in\x20HANGUP\x20(%s)\x20block',_0x55ec15[_0x72d1('0x35')]));return this['channel'][_0x72d1('0x141')]();};AGIVertices['prototype']['ispeechasr']=function(_0x5f4af9){logger[_0x72d1('0x2d')](util[_0x72d1('0x27')](_0x72d1('0x142'),_0x5f4af9[_0x72d1('0x35')]));if(!this['isConfigured'](_0x5f4af9[_0x72d1('0x80')])){return this['channel']['noop'](_0x72d1('0x143'));}var _0xd6c9a4=_0x72d1('0x12a');var _0x1525ab=util['format'](_0x72d1('0x12b'),FILES_PATH,rs[_0x72d1('0x114')](0x4));var _0xdf16b6=util[_0x72d1('0x27')](_0x72d1('0x96'),_0x1525ab,_0xd6c9a4);var _0x2ea6a7=!![];if(_0x5f4af9[_0x72d1('0x12c')]===_0x72d1('0x12d')){_0x2ea6a7=![];}var _0x1216f3=this[_0x72d1('0xc')]['recordFile'](_0x1525ab,_0xd6c9a4,_0x5f4af9[_0x72d1('0x12e')],_0x5f4af9[_0x72d1('0x62')],undefined,_0x2ea6a7);if(_0x1216f3[_0x72d1('0x9d')]!==-0x1){this['channel'][_0x72d1('0xa4')](util[_0x72d1('0x27')](_0x72d1('0x144'),_0xdf16b6));var _0x1e3801=this[_0x72d1('0x82')][_0x72d1('0x6d')](this,_0x5f4af9,_0xdf16b6);if(_0x1e3801){for(var _0x130ef4 in _0x1e3801){if(_0x1e3801[_0x72d1('0x8f')](_0x130ef4)){this['channel']['setVariable'](util['format'](_0x72d1('0x145'),_0x130ef4['toUpperCase']()),_0x1e3801[_0x130ef4]);}}return this[_0x72d1('0xc')][_0x72d1('0xa4')](util['format'](_0x72d1('0x146'),JSON[_0x72d1('0x72')](_0x1e3801)));}}return _0x1216f3;};AGIVertices[_0x72d1('0xe')][_0x72d1('0x147')]=function(_0x48a53f){logger[_0x72d1('0x2d')](util[_0x72d1('0x27')](_0x72d1('0x148'),_0x48a53f['label']));if(!this['isConfigured'](_0x48a53f[_0x72d1('0x80')])){return this[_0x72d1('0xc')]['noop'](_0x72d1('0x143'));}if(!this[_0x72d1('0x9f')](_0x48a53f[_0x72d1('0x5a')])){return this[_0x72d1('0xc')][_0x72d1('0xa4')]('no\x20text\x20configured');}this[_0x72d1('0xc')][_0x72d1('0xa4')](util[_0x72d1('0x27')](_0x72d1('0x149'),_0x48a53f[_0x72d1('0x5a')]));var _0x1a5df9=this[_0x72d1('0x7f')][_0x72d1('0x6d')](this,_0x48a53f);if(_0x1a5df9){this['channel']['noop'](util[_0x72d1('0x27')](_0x72d1('0x144'),_0x1a5df9));var _0x47f66c=this[_0x72d1('0xc')][_0x72d1('0xff')](_0x1a5df9,_0x48a53f['intKey']);try{fs[_0x72d1('0x14a')](_0x1a5df9+_0x72d1('0x100'));}catch(_0x23d35e){logger[_0x72d1('0x29')](_0x23d35e);}return _0x47f66c;}return this['channel'][_0x72d1('0x29')](_0x48a53f,'ispeech\x20TTS\x20is\x20unreachable');};AGIVertices[_0x72d1('0xe')]['login']=function(_0x2d0b34){logger[_0x72d1('0x2d')](util[_0x72d1('0x27')](_0x72d1('0x14b'),_0x2d0b34[_0x72d1('0x35')]));if(!this[_0x72d1('0x9f')](_0x2d0b34['findBy'])){return this['channel'][_0x72d1('0x29')](_0x2d0b34,_0x72d1('0x14c'));}logger[_0x72d1('0x2d')](util['format'](_0x72d1('0x14d'),this[_0x72d1('0xc')][_0x72d1('0x4e')],_0x2d0b34[_0x72d1('0x14e')]));var _0x52aca3=this['agentLogin'][_0x72d1('0x6d')](this,_0x2d0b34[_0x72d1('0x14e')]);if(_0x52aca3){logger[_0x72d1('0x2d')](util[_0x72d1('0x27')]('AGENT\x20%s\x20FOUND\x20BY',this[_0x72d1('0xc')][_0x72d1('0x4e')],_0x2d0b34[_0x72d1('0x14e')]));this[_0x72d1('0xc')][_0x72d1('0xa4')](util['format'](_0x72d1('0x14f'),this[_0x72d1('0xc')][_0x72d1('0x4e')],_0x2d0b34[_0x72d1('0x14e')]));return{'code':0xc8,'result':'success'};}else{logger['info'](util[_0x72d1('0x27')](_0x72d1('0x150'),this[_0x72d1('0xc')][_0x72d1('0x4e')],_0x2d0b34[_0x72d1('0x14e')]));this[_0x72d1('0xc')][_0x72d1('0xa4')](util['format'](_0x72d1('0x150'),this['channel'][_0x72d1('0x4e')],_0x2d0b34[_0x72d1('0x14e')]));return{'code':0xc8,'result':_0x72d1('0x151')};}};AGIVertices[_0x72d1('0xe')][_0x72d1('0x152')]=function(_0xdf071b){logger['info'](util[_0x72d1('0x27')](_0x72d1('0x153'),_0xdf071b[_0x72d1('0x35')]));if(!this[_0x72d1('0x9f')](_0xdf071b[_0x72d1('0x14e')])){return this[_0x72d1('0xc')]['error'](_0xdf071b,_0x72d1('0x14c'));}logger['info'](util[_0x72d1('0x27')](_0x72d1('0x14d'),this[_0x72d1('0xc')]['callerid'],_0xdf071b['findBy']));var _0x21d024=this[_0x72d1('0x154')][_0x72d1('0x6d')](this,_0xdf071b[_0x72d1('0x14e')]);if(_0x21d024){logger['info'](util[_0x72d1('0x27')](_0x72d1('0x14f'),this[_0x72d1('0xc')][_0x72d1('0x4e')],_0xdf071b[_0x72d1('0x14e')]));this['channel'][_0x72d1('0xa4')](util[_0x72d1('0x27')](_0x72d1('0x14f'),this[_0x72d1('0xc')][_0x72d1('0x4e')],_0xdf071b[_0x72d1('0x14e')]));return{'code':0xc8,'result':_0x72d1('0x155')};}else{logger['info'](util[_0x72d1('0x27')](_0x72d1('0x150'),this[_0x72d1('0xc')][_0x72d1('0x4e')],_0xdf071b[_0x72d1('0x14e')]));this[_0x72d1('0xc')][_0x72d1('0xa4')](util[_0x72d1('0x27')](_0x72d1('0x150'),this[_0x72d1('0xc')][_0x72d1('0x4e')],_0xdf071b[_0x72d1('0x14e')]));return{'code':0xc8,'result':'failure'};}};AGIVertices[_0x72d1('0xe')][_0x72d1('0x156')]=function(_0x59ecc8){logger['info'](util[_0x72d1('0x27')](_0x72d1('0x157'),_0x59ecc8[_0x72d1('0x35')]));if(!this[_0x72d1('0x9f')](_0x59ecc8[_0x72d1('0x158')])){return this['channel'][_0x72d1('0x29')](_0x59ecc8,_0x72d1('0x159'));}this[_0x72d1('0xc')][_0x72d1('0xa4')](util['format'](_0x72d1('0x15a'),_0x59ecc8[_0x72d1('0x158')]));var _0x57ec5c=eval(_0x59ecc8[_0x72d1('0x158')]);if(!this[_0x72d1('0x9f')](_0x59ecc8[_0x72d1('0xd0')])){return this[_0x72d1('0xc')]['noop']('no\x20variable\x20selected\x20for\x20the\x20result');}var _0xc81d38=this[_0x72d1('0xf')]['sync'](this,_0x59ecc8[_0x72d1('0xd0')]);if(!_0xc81d38){return this[_0x72d1('0xc')][_0x72d1('0x29')](_0x59ecc8,'no\x20variable\x20found');}if(_[_0x72d1('0x94')](_0x57ec5c)){var _0xabd2d4=this;_0x57ec5c['forEach'](function(_0x5159b5,_0x2185e0){_0xabd2d4[_0x72d1('0xc')][_0x72d1('0x98')](util[_0x72d1('0x27')](_0x72d1('0x15b'),_0xc81d38,_0x2185e0),_0x5159b5);});return this[_0x72d1('0xc')][_0x72d1('0xa4')](util[_0x72d1('0x27')](_0x72d1('0x15c'),_0xc81d38));}else{return this[_0x72d1('0xc')][_0x72d1('0x98')](_0xc81d38,_0x57ec5c);}};AGIVertices['prototype'][_0x72d1('0x15d')]=function(_0x20be11){logger[_0x72d1('0x2d')](util[_0x72d1('0x27')](_0x72d1('0x15e'),_0x20be11['label']));if(_0x20be11[_0x72d1('0xa1')]===0x0){return this[_0x72d1('0xa0')](_0x20be11);}_0x20be11[_0x72d1('0xa1')]-=0x1;if(!this[_0x72d1('0x9f')](_0x20be11[_0x72d1('0x10c')])){return this[_0x72d1('0xc')][_0x72d1('0x29')](_0x20be11,_0x72d1('0x15f'));}var _0xf723c6=this['getSound'][_0x72d1('0x6d')](this,_0x20be11['file_id']);if(!_0xf723c6){return this['channel'][_0x72d1('0x29')](_0x20be11,'no\x20file\x20audio\x20found');}var _0x5bfa24=this[_0x72d1('0xc')]['getData'](_0xf723c6,_0x20be11[_0x72d1('0x10f')],_0x20be11[_0x72d1('0x160')]);var _0x3e9110=_0x5bfa24['result'];if(_0x5bfa24[_0x72d1('0x9d')]===-0x1){this[_0x72d1('0x34')][_0x72d1('0x6d')](this,_0x20be11,'-1');return _0x5bfa24;}else if(_0x5bfa24['extra']===_0x72d1('0x62')){_0x5bfa24[_0x72d1('0x9d')]=_0x5bfa24[_0x72d1('0x9d')][_0x72d1('0x97')]>0x0?_0x5bfa24['result']:'t';}else if(_[_0x72d1('0x41')](_0x5bfa24[_0x72d1('0x9d')])){_0x5bfa24['result']='#';_0x3e9110='#';}if(!this['isConfigured'](_0x20be11[_0x72d1('0xd0')])){this[_0x72d1('0xc')][_0x72d1('0xa4')](_0x72d1('0xd1'));}else{var _0x5131a0=this[_0x72d1('0xf')][_0x72d1('0x6d')](this,_0x20be11[_0x72d1('0xd0')]);if(!_0x5131a0){return this[_0x72d1('0xc')][_0x72d1('0x29')](_0x20be11,_0x72d1('0xd2'));}this[_0x72d1('0xc')]['setVariable'](_0x5131a0,_0x3e9110);}this[_0x72d1('0x34')]['sync'](this,_0x20be11,_0x3e9110);return _0x5bfa24;};AGIVertices[_0x72d1('0xe')][_0x72d1('0xa4')]=function(_0x1e943a){logger['info'](util[_0x72d1('0x27')](_0x72d1('0x161'),_0x1e943a[_0x72d1('0x35')]));return this[_0x72d1('0xc')]['noop'](_0x1e943a[_0x72d1('0x162')]||_0x1e943a['label']);};AGIVertices[_0x72d1('0xe')][_0x72d1('0x163')]=function(_0x131f5f){logger[_0x72d1('0x2d')](util[_0x72d1('0x27')](_0x72d1('0x164'),_0x131f5f[_0x72d1('0x35')]));if(!this[_0x72d1('0x9f')](_0x131f5f[_0x72d1('0x14e')])){return this['channel'][_0x72d1('0x29')](_0x131f5f,_0x72d1('0x14c'));}logger[_0x72d1('0x2d')](util['format'](_0x72d1('0x14d'),this[_0x72d1('0xc')][_0x72d1('0x4e')],_0x131f5f['findBy']));var _0x44fdd6=this[_0x72d1('0x4b')][_0x72d1('0x6d')](this,_0x131f5f['pause_id']);var _0x175b78=this[_0x72d1('0x4c')]['sync'](this,_0x131f5f[_0x72d1('0x14e')],_0x44fdd6);if(_0x175b78){logger[_0x72d1('0x2d')](util[_0x72d1('0x27')](_0x72d1('0x14f'),this[_0x72d1('0xc')][_0x72d1('0x4e')],_0x131f5f['findBy']));this[_0x72d1('0xc')]['noop'](util['format'](_0x72d1('0x14f'),this['channel'][_0x72d1('0x4e')],_0x131f5f['findBy']));return{'code':0xc8,'result':_0x72d1('0x155')};}else{logger[_0x72d1('0x2d')](util[_0x72d1('0x27')](_0x72d1('0x150'),this[_0x72d1('0xc')][_0x72d1('0x4e')],_0x131f5f['findBy']));this[_0x72d1('0xc')][_0x72d1('0xa4')](util['format']('AGENT\x20%s\x20FOUND\x20BY',this['channel'][_0x72d1('0x4e')],_0x131f5f[_0x72d1('0x14e')]));return{'code':0xc8,'result':_0x72d1('0x151')};}};AGIVertices[_0x72d1('0xe')]['playback']=function(_0x30bd79){logger['info'](util[_0x72d1('0x27')](_0x72d1('0x165'),_0x30bd79[_0x72d1('0x35')]));if(!this[_0x72d1('0x9f')](_0x30bd79[_0x72d1('0x10c')])){return this[_0x72d1('0xc')][_0x72d1('0x29')](_0x30bd79,_0x72d1('0x15f'));}var _0x57d32c=this[_0x72d1('0x1c')][_0x72d1('0x6d')](this,_0x30bd79[_0x72d1('0x10c')]);if(!_0x57d32c){return this[_0x72d1('0xc')][_0x72d1('0x29')](_0x30bd79,'no\x20file\x20audio\x20found');}var _0x5cb193=this[_0x72d1('0xc')][_0x72d1('0x55')](_0x72d1('0x166'),[_0x57d32c,_0x30bd79['opts']]);if(_0x5cb193['result']===-0x1){return _0x5cb193;}return this[_0x72d1('0xc')]['noop'](util['format'](_0x72d1('0xba'),'PLAYBACK',_0x57d32c));};AGIVertices[_0x72d1('0xe')][_0x72d1('0x167')]=function(_0x45a8f0){logger[_0x72d1('0x2d')](util[_0x72d1('0x27')]('Enter\x20in\x20QUEUE\x20(%s)\x20block',_0x45a8f0[_0x72d1('0x35')]));if(!this['isConfigured'](_0x45a8f0[_0x72d1('0x168')])){return this[_0x72d1('0xc')]['error'](_0x45a8f0,_0x72d1('0x169'));}var _0x47aca5='';var _0x316e60=parseInt(_0x45a8f0[_0x72d1('0x168')],0xa);if(isNaN(_0x316e60)){_0x47aca5=_0x45a8f0[_0x72d1('0x168')];}else{_0x47aca5=this[_0x72d1('0x14')][_0x72d1('0x6d')](this,_0x45a8f0['queue_id']);if(!_0x47aca5){return this['channel'][_0x72d1('0x29')](_0x45a8f0,'no\x20queue\x20found');}}var _0x56b0ce='';if(this[_0x72d1('0x9f')](_0x45a8f0[_0x72d1('0x10c')])){var _0x21ed96=this[_0x72d1('0x1c')][_0x72d1('0x6d')](this,_0x45a8f0['file_id']);if(_0x21ed96){_0x56b0ce=_0x21ed96;}}this[_0x72d1('0x34')][_0x72d1('0x6d')](this,_0x45a8f0,_0x47aca5);if(_0x45a8f0[_0x72d1('0xde')][_0x72d1('0x16a')]('x')<0x0){_0x45a8f0[_0x72d1('0xde')]+='x';}if(_0x45a8f0[_0x72d1('0xde')][_0x72d1('0x16a')]('X')<0x0){_0x45a8f0['opts']+='X';}this[_0x72d1('0xc')][_0x72d1('0x98')](_0x72d1('0x16b'),_0x47aca5?_0x47aca5[_0x72d1('0x16c')]():'');var _0x2c22af=this['channel'][_0x72d1('0x55')](_0x72d1('0x16d'),[_0x47aca5,_0x45a8f0[_0x72d1('0xde')],_0x45a8f0[_0x72d1('0x70')],_0x56b0ce,_0x45a8f0[_0x72d1('0x62')],_0x45a8f0[_0x72d1('0x6')],_0x45a8f0[_0x72d1('0x16e')],_0x45a8f0[_0x72d1('0x16f')],'',_0x45a8f0['position']]);if(_0x2c22af[_0x72d1('0x9d')]===-0x1){return _0x2c22af;}return this[_0x72d1('0xc')][_0x72d1('0xa4')](util['format'](_0x72d1('0xba'),_0x72d1('0x16d'),_0x47aca5));};AGIVertices[_0x72d1('0xe')][_0x72d1('0x170')]=function(_0x57871e){logger[_0x72d1('0x2d')](util[_0x72d1('0x27')](_0x72d1('0x171'),_0x57871e[_0x72d1('0x35')]));var _0x46f076=_0x57871e[_0x72d1('0x172')]||_0x72d1('0x12a');var _0x1624d8=util[_0x72d1('0x27')]('%s_%s',this[_0x72d1('0xc')]['uniqueid'],rs[_0x72d1('0x114')](0x5));var _0x3718b7=util['format']('%s/recordings/%s.%s',FILES_PATH,_0x1624d8,_0x46f076);var _0x4af5ba=util[_0x72d1('0x27')](_0x72d1('0x12b'),FILES_PATH,_0x1624d8);this[_0x72d1('0x38')][_0x72d1('0x6d')](this,_0x57871e,_0x1624d8,_0x3718b7);this[_0x72d1('0xc')][_0x72d1('0x98')](_0x72d1('0x173'),_0x1624d8);logger[_0x72d1('0x2d')](_0x72d1('0x174'),_0x4af5ba,_0x46f076,_0x57871e['escape_digits'],_0x57871e[_0x72d1('0x62')]);return this['channel']['recordFile'](_0x4af5ba,_0x46f076,_0x57871e[_0x72d1('0x175')],_0x57871e[_0x72d1('0x62')],undefined,!![]);};AGIVertices[_0x72d1('0xe')][_0x72d1('0x176')]=function(_0x565968){logger[_0x72d1('0x2d')](util[_0x72d1('0x27')](_0x72d1('0x177'),_0x565968[_0x72d1('0x35')]));if(!this[_0x72d1('0x9f')](_0x565968[_0x72d1('0x70')])){return this[_0x72d1('0xc')][_0x72d1('0xa4')](_0x72d1('0x178'));}var _0x56c665=this['restAPI']['sync'](this,_0x565968);logger[_0x72d1('0x2d')](util[_0x72d1('0x27')]('Response:',util['inspect'](_0x56c665,{'showHidden':![],'depth':null})));if(!this[_0x72d1('0x9f')](_0x565968[_0x72d1('0xd0')])){return this[_0x72d1('0xc')][_0x72d1('0xa4')]('no\x20variable\x20selected\x20for\x20the\x20response');}var _0x332f28=this['getVariable'][_0x72d1('0x6d')](this,_0x565968[_0x72d1('0xd0')]);if(!_0x332f28){return this[_0x72d1('0xc')]['error'](_0x565968,'no\x20variable\x20found');}this['channel']['setVariable'](util['format']('%s_STATUS_CODE',_0x332f28),_0x56c665[_0x72d1('0x73')]?_0x56c665['statusCode']:_0x72d1('0x179'));this['channel']['setVariable'](util[_0x72d1('0x27')](_0x72d1('0x17a'),_0x332f28),_0x56c665[_0x72d1('0x74')]?_0x56c665[_0x72d1('0x74')]:'OK');if(_0x56c665[_0x72d1('0x68')]){try{this['saveRestApiResult'](_0x56c665['body'],_0x332f28);}catch(_0x39a678){logger[_0x72d1('0x29')](util['format'](_0x72d1('0x17b'),_0x332f28));}}return this[_0x72d1('0xc')]['noop'](util[_0x72d1('0x27')](_0x72d1('0xd6'),_0x332f28));};AGIVertices[_0x72d1('0xe')][_0x72d1('0x17c')]=function(_0xddcc94){logger[_0x72d1('0x2d')](util['format'](_0x72d1('0x17d'),_0xddcc94[_0x72d1('0x35')]));return this[_0x72d1('0xc')]['sayDigits'](_0xddcc94['digits'][_0x72d1('0x57')](/\s+/g,''),_0xddcc94[_0x72d1('0x175')]);};AGIVertices[_0x72d1('0xe')][_0x72d1('0x17e')]=function(_0x1aea73){logger[_0x72d1('0x2d')](util[_0x72d1('0x27')](_0x72d1('0x17f'),_0x1aea73[_0x72d1('0x35')]));return this[_0x72d1('0xc')][_0x72d1('0x180')](_0x1aea73['number'][_0x72d1('0x57')](/\s+/g,''),_0x1aea73[_0x72d1('0x175')]);};AGIVertices['prototype'][_0x72d1('0x181')]=function(_0x439765){logger[_0x72d1('0x2d')](util[_0x72d1('0x27')](_0x72d1('0x182'),_0x439765[_0x72d1('0x35')]));return this['channel'][_0x72d1('0x183')](_0x439765['text'],_0x439765[_0x72d1('0x175')]);};AGIVertices[_0x72d1('0xe')][_0x72d1('0x184')]=function(_0x162d21){logger[_0x72d1('0x2d')](util['format'](_0x72d1('0x185'),_0x162d21[_0x72d1('0x35')]));if(!this[_0x72d1('0x9f')](_0x162d21['account_id'])){return this['channel'][_0x72d1('0xa4')](_0x72d1('0x186'));}var _0x28dac6=this[_0x72d1('0x1f')][_0x72d1('0x6d')](this,_0x162d21['account_id']);if(!_0x28dac6||!_0x28dac6[_0x72d1('0x187')]){return this[_0x72d1('0xc')][_0x72d1('0x29')](_0x162d21,_0x72d1('0x188'));}var _0x522afd={'from':util[_0x72d1('0x27')]('\x22%s\x22\x20<%s>',_0x28dac6[_0x72d1('0x12')],_0x28dac6[_0x72d1('0x189')]||_0x28dac6[_0x72d1('0x187')]['user']),'to':_0x162d21['to']||'','cc':_0x162d21['cc']||'','bcc':_0x162d21[_0x72d1('0x18a')]||'','subject':_0x162d21[_0x72d1('0x18b')],'html':_0x162d21[_0x72d1('0x5a')],'text':_0x162d21[_0x72d1('0x5a')]};if(this[_0x72d1('0x9f')](_0x162d21[_0x72d1('0x18c')])){}logger['debug'](_0x72d1('0x18d'),JSON['stringify'](_0x522afd));this[_0x72d1('0x34')][_0x72d1('0x6d')](this,_0x162d21,_0x162d21[_0x72d1('0x18e')]);this[_0x72d1('0xc')][_0x72d1('0xa4')](util[_0x72d1('0x27')](_0x72d1('0x18f'),_0x28dac6[_0x72d1('0x12')]));this[_0x72d1('0x20')][_0x72d1('0x6d')](this,_0x28dac6['smtpOptions'],_0x522afd);return this[_0x72d1('0xc')][_0x72d1('0xa4')]('Mail\x20message\x20added\x20to\x20outgoing\x20process');};AGIVertices['prototype']['sendFax']=function(_0x4bc01a){logger[_0x72d1('0x2d')](util[_0x72d1('0x27')](_0x72d1('0x190'),_0x4bc01a[_0x72d1('0x35')]));return this[_0x72d1('0xc')][_0x72d1('0xa4')](_0x72d1('0x191'));};AGIVertices[_0x72d1('0xe')][_0x72d1('0x192')]=function(_0x5a8f0c){logger[_0x72d1('0x2d')](util[_0x72d1('0x27')](_0x72d1('0x193'),_0x5a8f0c[_0x72d1('0x35')]));if(!this[_0x72d1('0x9f')](_0x5a8f0c['sms_account_id'])){return this[_0x72d1('0xc')][_0x72d1('0xa4')](_0x72d1('0x194'));}var _0x274e41=this[_0x72d1('0x31')][_0x72d1('0x6d')](this,_0x5a8f0c[_0x72d1('0x195')]);if(!_0x274e41){return this[_0x72d1('0xc')]['error'](_0x5a8f0c,_0x72d1('0x196'));}var _0x341b56={'body':_0x5a8f0c[_0x72d1('0x197')],'phone':_0x5a8f0c['to']||'','SmsAccountId':_0x274e41['id']};logger['debug']('sendSMS\x20message',JSON[_0x72d1('0x72')](_0x341b56));this['createSquareDetailsReport'][_0x72d1('0x6d')](this,_0x5a8f0c,_0x5a8f0c[_0x72d1('0x195')]);this['channel'][_0x72d1('0xa4')](util[_0x72d1('0x27')]('Trying\x20SendSMS\x20with\x20account\x20%s',_0x274e41['name']));this[_0x72d1('0x33')][_0x72d1('0x6d')](this,_0x341b56);return this[_0x72d1('0xc')][_0x72d1('0xa4')](_0x72d1('0x198'));};AGIVertices[_0x72d1('0xe')][_0x72d1('0x199')]=function(_0x41f2b6){logger[_0x72d1('0x2d')](util[_0x72d1('0x27')](_0x72d1('0x19a'),_0x41f2b6[_0x72d1('0x35')]));if(!this[_0x72d1('0x9f')](_0x41f2b6[_0x72d1('0xd0')])){return this[_0x72d1('0xc')][_0x72d1('0x29')](_0x41f2b6,'no\x20variable\x20selected');}var _0x1fcd06=this[_0x72d1('0xf')][_0x72d1('0x6d')](this,_0x41f2b6['variable_id']);if(!_0x1fcd06){return this[_0x72d1('0xc')][_0x72d1('0x29')](_0x41f2b6,_0x72d1('0xd2'));}return this['channel'][_0x72d1('0x98')](_0x1fcd06,_0x41f2b6[_0x72d1('0x19b')]);};AGIVertices[_0x72d1('0xe')]['start']=function(_0x474ed8){logger[_0x72d1('0x2d')](util[_0x72d1('0x27')]('Enter\x20in\x20START\x20(%s)\x20block',_0x474ed8[_0x72d1('0x35')]));this[_0x72d1('0xc')][_0x72d1('0xa4')]('START\x20CALLY\x20SQUARE');var _0x5627cf=this['channel'][_0x72d1('0xf')]('XMCS-UNIQUEID');if(!_[_0x72d1('0x41')](_0x5627cf[_0x72d1('0x9b')])){this[_0x72d1('0xc')][_0x72d1('0x39')]=_0x5627cf[_0x72d1('0x9b')];}if(_0x474ed8[_0x72d1('0xb0')]===_0x72d1('0x19c')){this[_0x72d1('0xc')][_0x72d1('0xa4')](_0x72d1('0x19d'));return this[_0x72d1('0xc')][_0x72d1('0xb0')]();}return this[_0x72d1('0xc')][_0x72d1('0xa4')](_0x72d1('0x19e'));};AGIVertices['prototype'][_0x72d1('0x19f')]=function(_0x4634ba){logger[_0x72d1('0x2d')](util[_0x72d1('0x27')](_0x72d1('0x1a0'),_0x4634ba['label']));if(!this[_0x72d1('0x9f')](_0x4634ba[_0x72d1('0x1a1')])){return this[_0x72d1('0xc')][_0x72d1('0x29')](_0x4634ba,_0x72d1('0x1a2'));}var _0x5606ab=this[_0x72d1('0x16')][_0x72d1('0x6d')](this,_0x4634ba[_0x72d1('0x1a1')]);if(!this[_0x72d1('0x9f')](_0x5606ab)){return this[_0x72d1('0xc')][_0x72d1('0x29')](_0x4634ba,util[_0x72d1('0x27')](_0x72d1('0x1a3'),_0x4634ba['project_id']));}if(_0x5606ab===this[_0x72d1('0xc')][_0x72d1('0x37')]){return this[_0x72d1('0xc')][_0x72d1('0x29')](_0x4634ba,_0x72d1('0x1a4'));}this[_0x72d1('0x34')][_0x72d1('0x6d')](this,_0x4634ba,_0x5606ab);var _0x4c8049=this[_0x72d1('0xc')]['exec'](_0x72d1('0x1a5'),util[_0x72d1('0x27')](_0x72d1('0x1a6'),config[_0x72d1('0x6')][_0x72d1('0x1a7')]||'127.0.0.1',_0x5606ab,this[_0x72d1('0xc')][_0x72d1('0x37')]));if(_0x4c8049[_0x72d1('0x9d')]===-0x1){return _0x4c8049;}return this[_0x72d1('0xc')][_0x72d1('0xa4')](util[_0x72d1('0x27')](_0x72d1('0xba'),_0x72d1('0x1a5'),_0x5606ab));};AGIVertices[_0x72d1('0xe')][_0x72d1('0x1a8')]=function(_0xf49b2d){logger[_0x72d1('0x2d')](util[_0x72d1('0x27')]('Enter\x20in\x20SYSTEM\x20(%s)\x20block',_0xf49b2d[_0x72d1('0x35')]));var _0x4a9501=this['shellCommand'][_0x72d1('0x6d')](this,_0xf49b2d[_0x72d1('0xae')]);this[_0x72d1('0x34')][_0x72d1('0x6d')](this,_0xf49b2d,_0xf49b2d['command']);if(this[_0x72d1('0x9f')](_0xf49b2d[_0x72d1('0xd0')])){var _0x5799fe=this[_0x72d1('0xf')][_0x72d1('0x6d')](this,_0xf49b2d[_0x72d1('0xd0')]);if(_0x5799fe){this[_0x72d1('0xc')][_0x72d1('0x98')](_0x5799fe,_0x4a9501);return this['channel']['noop'](util[_0x72d1('0x27')](_0x72d1('0x1a9'),_0xf49b2d[_0x72d1('0xae')],_0x5799fe));}}return this[_0x72d1('0xc')][_0x72d1('0xa4')](util[_0x72d1('0x27')](_0x72d1('0x1aa'),_0xf49b2d[_0x72d1('0xae')]));};AGIVertices[_0x72d1('0xe')]['google_cloud_tts']=function(_0x59b7a7){logger[_0x72d1('0x2d')](util['format'](_0x72d1('0x1ab'),_0x59b7a7[_0x72d1('0x35')]));_0x59b7a7[_0x72d1('0x5a')]=_0x59b7a7[_0x72d1('0x5a')][_0x72d1('0x57')](/(\r\n|\n|\r)/gm,'\x20');if(!this['isConfigured'](_0x59b7a7[_0x72d1('0x59')])){return this['channel'][_0x72d1('0xa4')]('no\x20apiKey\x20configured');}if(!this[_0x72d1('0x9f')](_0x59b7a7[_0x72d1('0x5a')])){return this[_0x72d1('0xc')][_0x72d1('0xa4')]('no\x20text\x20configured');}this[_0x72d1('0xc')][_0x72d1('0xa4')](util[_0x72d1('0x27')]('Trying\x20Google\x20Cloud\x20TTS\x20%s',_0x59b7a7[_0x72d1('0x5a')]));var _0x298b35=this[_0x72d1('0x58')][_0x72d1('0x6d')](this,_0x59b7a7);if(_0x298b35){this[_0x72d1('0xc')]['noop'](util['format']('Google\x20Cloud\x20TTS\x20%s\x20file\x20created',_0x298b35));var _0x56e9fe=this['channel'][_0x72d1('0xff')](_0x298b35);try{fs[_0x72d1('0x14a')](_0x298b35+_0x72d1('0x100'));}catch(_0x266ace){logger[_0x72d1('0x29')](_0x266ace);}return _0x56e9fe;}return this[_0x72d1('0xc')]['error'](_0x59b7a7,_0x72d1('0x1ac'));};AGIVertices[_0x72d1('0xe')][_0x72d1('0x1ad')]=function(_0x54cb7e){logger['info'](util[_0x72d1('0x27')]('Enter\x20in\x20GOOGLETTS\x20(%s)\x20block',_0x54cb7e[_0x72d1('0x35')]));_0x54cb7e[_0x72d1('0x5a')]=_0x54cb7e[_0x72d1('0x5a')][_0x72d1('0x57')](/(\r\n|\n|\r)/gm,'\x20');if(!this['isConfigured'](_0x54cb7e[_0x72d1('0x5a')])){return this[_0x72d1('0xc')]['noop'](_0x72d1('0xa5'));}this[_0x72d1('0xc')][_0x72d1('0xa4')](util[_0x72d1('0x27')](_0x72d1('0x1ae'),_0x54cb7e['text']));var _0x484310=this[_0x72d1('0x5f')][_0x72d1('0x6d')](this,_0x54cb7e);if(_0x484310){this[_0x72d1('0xc')]['noop'](util['format']('Google\x20TTS\x20%s\x20file\x20created',_0x484310));var _0x126b9c=this[_0x72d1('0xc')][_0x72d1('0xff')](_0x484310);try{fs[_0x72d1('0x14a')](_0x484310+'.wav');}catch(_0x49e0a4){logger['error'](_0x49e0a4);}return _0x126b9c;}return this[_0x72d1('0xc')]['error'](_0x54cb7e,_0x72d1('0x1af'));};AGIVertices[_0x72d1('0xe')][_0x72d1('0x1b0')]=function(_0x1dc7dc){logger[_0x72d1('0x2d')](util[_0x72d1('0x27')]('Enter\x20in\x20UNPAUSE\x20(%s)\x20block',_0x1dc7dc[_0x72d1('0x35')]));if(!this[_0x72d1('0x9f')](_0x1dc7dc[_0x72d1('0x14e')])){return this[_0x72d1('0xc')][_0x72d1('0x29')](_0x1dc7dc,'no\x20find\x20by\x20configured');}logger[_0x72d1('0x2d')](util[_0x72d1('0x27')](_0x72d1('0x14d'),this[_0x72d1('0xc')]['callerid'],_0x1dc7dc[_0x72d1('0x14e')]));var _0x491cca=this[_0x72d1('0x4f')][_0x72d1('0x6d')](this,_0x1dc7dc[_0x72d1('0x14e')]);if(_0x491cca){logger[_0x72d1('0x2d')](util[_0x72d1('0x27')](_0x72d1('0x14f'),this['channel']['callerid'],_0x1dc7dc[_0x72d1('0x14e')]));this[_0x72d1('0xc')][_0x72d1('0xa4')](util['format'](_0x72d1('0x14f'),this[_0x72d1('0xc')][_0x72d1('0x4e')],_0x1dc7dc[_0x72d1('0x14e')]));return{'code':0xc8,'result':'success'};}else{logger[_0x72d1('0x2d')](util[_0x72d1('0x27')]('AGENT\x20%s\x20NOT\x20FOUND\x20BY',this[_0x72d1('0xc')]['callerid'],_0x1dc7dc['findBy']));this[_0x72d1('0xc')][_0x72d1('0xa4')](util[_0x72d1('0x27')](_0x72d1('0x150'),this[_0x72d1('0xc')][_0x72d1('0x4e')],_0x1dc7dc[_0x72d1('0x14e')]));return{'code':0xc8,'result':_0x72d1('0x151')};}};AGIVertices[_0x72d1('0xe')][_0x72d1('0x1b1')]=function(_0x4168e7){logger[_0x72d1('0x2d')](util[_0x72d1('0x27')](_0x72d1('0x1b2'),_0x4168e7[_0x72d1('0x35')]));var _0x39a1da=this[_0x72d1('0xc')][_0x72d1('0x55')](_0x72d1('0x1b3'),[_0x4168e7['mailbox'],_0x4168e7[_0x72d1('0x77')]]);if(_0x39a1da['result']===-0x1){return _0x39a1da;}return this[_0x72d1('0xc')][_0x72d1('0xa4')](util[_0x72d1('0x27')]('Executed\x20command\x20%s\x20%s',_0x72d1('0x1b3'),_0x4168e7['mailbox']));};AGIVertices[_0x72d1('0xe')][_0x72d1('0x1b4')]=function(_0x2c1043){logger[_0x72d1('0x2d')](util[_0x72d1('0x27')](_0x72d1('0x1b5'),_0x2c1043['label']));if(!this[_0x72d1('0x9f')](_0x2c1043[_0x72d1('0xd0')])){return this['channel']['error'](_0x2c1043,_0x72d1('0x1b6'));}var _0x32949a=this['getVariable']['sync'](this,_0x2c1043[_0x72d1('0xd0')]);if(!_0x32949a){return this['channel']['error'](_0x2c1043,'no\x20variable\x20found');}var _0x189d7a=this['channel'][_0x72d1('0xf')](_0x32949a);return{'code':0xc8,'result':_0x189d7a[_0x72d1('0x9b')]?_0x189d7a[_0x72d1('0x9b')]:'-'};};String[_0x72d1('0xe')][_0x72d1('0x9a')]=function(_0x53b582,_0x440161){return this[_0x72d1('0x99')](_0x53b582)[_0x72d1('0x1b7')](_0x440161);};module['exports']=AGIVertices; \ No newline at end of file +var _0x3e74=['agentLogout','agentLogin','internal','%s/%s@from-sip/n','LOCAL','shellCommand','exec','trim','googleCloudTTS','apiKey','text','languageCode','ssmlGender','MALE','audioEncoding','MP3','googleTTS','restAPI','url','timeout','number','includes','POST','PUT','method','toUpperCase','body','rawBody','parse','An\x20incorrect\x20formatted\x20json\x20body\x20has\x20been\x20passed\x20to\x20the\x20function','headers','computedVariables','sync','render','stringify','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','private_key','dialogflowV2_language','sestekNDA','ispeechTTS','ispeech_tts_language','en-US','speed','ispeechASR','ispeech_asr_language','model','awsPolly','aws_polly_voice','aws_text_type','awsLex','aws_access_key_id','aws_secret_access_key','aws_lex_region','aws_bot_name','googleASR','google_asr_language','tildeASR','appid','appsecret','uri','clear','hasOwnProperty','isString','recursiveNodeIndex','isPlainObject','replaceAllVariables','saveRestApiResult','%s.%s','isArray','length','setVariable','split','extra','getAndSetVariable','The\x20\x22%s\x22\x20variable\x20value\x20is:\x20%s','maxRetry','retry','mrcpsynth','Enter\x20in\x20MRCPSynth\x20(%s)\x20block','isConfigured','noop','MRCPSynth','result','mrcprecog','Enter\x20in\x20MRCPRecog\x20(%s)\x20block','grammar','no\x20grammar\x20configured','MRCPRecog','RECOG_CONFIDENCE()','MRCP_RECOG_CONFIDENCE','RECOG_INPUT()','MRCP_RECOG_TRANSCRIPT','RECOG_INSTANCE()','MRCP_RECOG_INSTANCE','Executed\x20command\x20MRCPRecog\x20%s','Enter\x20in\x20AGI\x20(%s)\x20block','command','args','answer','Enter\x20in\x20ANSWER\x20(%s)\x20block','Wait\x20%s\x20seconds\x20before\x20answer','wait','Enter\x20in\x20CALLBACK\x20(%s)\x20block','list_id','no\x20list\x20selected','delay','add','minutes','CALLBACK\x20added\x20phone:\x20%s\x20on\x20list:\x20%s\x20at\x20%s','custom_app','Enter\x20in\x20CUSTOM\x20APP\x20(%s)\x20block','application','Executed\x20command\x20%s\x20%s','Enter\x20in\x20LUMENVOXTTS\x20(%s)\x20block','Executed\x20command\x20MRCPSynth\x20%s','sestektts','Enter\x20in\x20SESTEKTTS\x20(%s)\x20block','no\x20text\x20configured','Enter\x20in\x20LUMENVOXASR\x20(%s)\x20block','LUMENVOX_ASR_CONFIDENCE','LUMENVOX_ASR_TRANSCRIPT','LUMENVOX_ASR_INSTANCE','sestekasr','Enter\x20in\x20SESTEKASR\x20(%s)\x20block','SESTEK_ASR_TRANSCRIPT','SESTEK_ASR_INSTANCE','database','Enter\x20in\x20DATABASE\x20(%s)\x20block','no\x20database\x20selected','odbc_id','query:\x20%s','variable_id','no\x20variable\x20selected\x20for\x20the\x20result','no\x20variable\x20found','forEach','%s_ROWS_COUNT','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','Executed\x20command\x20%s','Enter\x20in\x20DIALOGFLOW\x20(%s)\x20block','bot','Trying\x20Dialogflow:\x20%s','DIALOGFLOW_%s','speech','out','dialogflow','Dialogflow\x20Result\x20%s','Dialogflow\x20is\x20unreachable','Enter\x20in\x20DIALOGFLOW\x20V2\x20(%s)\x20block','no\x20project_id\x20configured','no\x20client_email\x20configured','no\x20anguage\x20configured','Trying\x20DialogflowV2:\x20%s','providerResponse','dialogflowV2','DialogflowV2\x20Result\x20%s','sesteknda','Enter\x20in\x20SESTEKNDA\x20(%s)\x20block','ndauth_url','no\x20ndauth\x20url\x20configured','username','no\x20username\x20configured','password','no\x20password\x20configured','ndassistant_url','Trying\x20SestekNDA:\x20%s','audiofile','streamFile','unlink','SestekNDA\x20is\x20unreachable','end','Enter\x20in\x20END\x20(%s)\x20block','ext_dial','Enter\x20in\x20EXTERNAL\x20DIAL\x20(%s)\x20block','trunk_id','no\x20trunk\x20selected','no\x20trunk\x20found','trunk_name','SIP/%s/%s','finally','Enter\x20in\x20FINALLY\x20(%s)\x20block','file_id','getSound','getData','response','mindigit','maxdigit','hiddendigitsnum','generate','hiddendigitspos','substr','Enter\x20in\x20GETSECRETDIGITS\x20(%s)\x20block','Enter\x20in\x20GOAL\x20(%s)\x20block','goalname','awspolly','no\x20valid\x20credentials\x20configured','Trying\x20aws\x20Polly\x20%s','aws\x20Polly\x20is\x20unreachable','Enter\x20in\x20Amazon\x20Lex\x20(%s)\x20block','Trying\x20Amazon\x20Lex:\x20%s','AWS_LEX_%s','message','Amazon\x20Lex\x20ready\x20for\x20fulfillment','amazonlex','googleasr','Enter\x20in\x20GOOGLEASR\x20(%s)\x20block\x20%s','no\x20key\x20configured','wav','%s/recordings/%s','NOBEEP','recordFile','GOOGLE_ASR_%s','tildeasr','Enter\x20in\x20TILDEASR\x20(%s)\x20block','no\x20appid\x20configured','no\x20appsecret\x20configured','beep','intKey','TILDE_ASR_%s','TildeASR\x20Result\x20%s','gotoc','continueAt','context','condition','true','false','gotoiftime','Enter\x20in\x20GOTOIFTIME\x20(%s)\x20block','interval_id','IFTIME\x20%s\x20%s','Enter\x20in\x20HANGUP\x20(%s)\x20block','hangup','Enter\x20in\x20ISPEECHASR\x20(%s)\x20block','ispeech\x20%s\x20file\x20created','ISPEECH_ASR_%s','ispeechtts','Enter\x20in\x20ISPEECHTTS\x20(%s)\x20block','.wav','ispeech\x20TTS\x20is\x20unreachable','login','Enter\x20in\x20LOGIN\x20(%s)\x20block','findBy','AGENT\x20%s\x20FOUND\x20BY','AGENT\x20%s\x20NOT\x20FOUND\x20BY','failure','logout','no\x20find\x20by\x20configured','FIND\x20AGENT\x20%s\x20BY\x20%s','success','math','Enter\x20in\x20MATH\x20(%s)\x20block','no\x20operation\x20configured','operation','%s[%s]','Enter\x20in\x20MENU\x20(%s)\x20block','no\x20file\x20audio\x20selected','no\x20file\x20audio\x20found','digit','output','pause','Enter\x20in\x20PAUSE\x20(%s)\x20block','pause_id','playback','Enter\x20in\x20PLAYBACK\x20(%s)\x20block','PLAYBACK','queue','queue_id','no\x20queue\x20selected','getVoiceQueue','no\x20queue\x20found','indexOf','XMCS-QUEUE','toLowerCase','gosub','position','QUEUE','%s_%s','%s/recordings/%s.%s','RECORDING_SAVENAME','Recording\x20%s\x20%s\x20%s\x20%s','escape_digits','restapi','Enter\x20in\x20RESTAPI\x20(%s)\x20block','Response:','inspect','no\x20variable\x20selected\x20for\x20the\x20response','200','%s_STATUS_MESSAGE','Unable\x20to\x20set\x20result\x20in\x20variable\x20%s','saydigits','sayDigits','digits','replace','sayNumber','sayphonetic','sayPhonetic','sendMail','Enter\x20in\x20SENDMAIL\x20(%s)\x20block','account_id','Smtp','no\x20mail\x20account\x20found','\x22%s\x22\x20<%s>','email','user','bcc','subject','sendMail\x20message','smtpOptions','sendFax','Enter\x20in\x20SENDFAX\x20(%s)\x20block','SENDFAX\x20block\x20not\x20implemented','no\x20sms\x20account\x20configured','getSmsAccount','sms_account_id','no\x20sms\x20account\x20found','sms_text','sendSMS\x20message','Trying\x20SendSMS\x20with\x20account\x20%s','Sms\x20message\x20added\x20to\x20outgoing\x20process','set','Enter\x20in\x20SET\x20(%s)\x20block','no\x20variable\x20selected','variable_value','START\x20CALLY\x20SQUARE','XMCS-UNIQUEID','yes','Skipped\x20Answer','subproject','Enter\x20in\x20SUBPROJECT\x20(%s)\x20block','project_id','no\x20subproject\x20selected','getSquareProject','project\x20in\x20subproject\x20must\x20be\x20different\x20from\x20the\x20called\x20project','AGI','host','127.0.0.1','system','sh\x20command:\x20%s\x20result\x20no\x20stored','google_cloud_tts','Enter\x20in\x20Google\x20Cloud\x20TTS\x20(%s)\x20block','no\x20apiKey\x20configured','Trying\x20Google\x20Cloud\x20TTS\x20%s','Google\x20Cloud\x20TTS\x20%s\x20file\x20created','tts','Enter\x20in\x20GOOGLETTS\x20(%s)\x20block','Google\x20TTS\x20%s\x20file\x20created','Google\x20TTS\x20is\x20unreachable','voicemail','Enter\x20in\x20VOICEMAIL\x20(%s)\x20block','VOICEMAIL','mailbox','vswitch','replaceAll','exports','util','shelljs','odbc','randomstring','request-promise','agi','../../config/environment','./scripts','/var/opt/motion2/server/files','rawHeaders','menu','getdigits','getsecretdigits','channel','prototype','getVariable','getVariableById','then','name','catch','rpc','getVoiceQueueById','getSquareProjectById','getSquareOdbc','getSquareOdbcById','dsn','getUserById','getTrunk','getSoundById','save_name','getMailAccount','getMailAccountById','mailRpc','sendMailMessage','getIntervals','getIntervalById','IntervalId','interval','map','format','getQueryOdbc','open','ODBC\x20connection\x20successfully','query','info','Error\x20executing\x20query\x20%s','Query\x20executed\x20correctly\x20%s','error','getSmsAccountById','createSmsMessage','createSquareDetailsReport','label','agicommand','arg_1','createSquareRecording','uniqueid','callerid','calleridname','extension','priority','dnid','file','createSquareMessage','createCmContact','isEmpty','callback_','lastName','isNil','phone','callback','Callback\x20scheduled\x20at\x20','scheduledAt','toString','callback_priority','getPause','getPauseById','agentPause','agent','agentUnpause'];(function(_0x161c6b,_0x29edbf){var _0x11b9c4=function(_0x5e6a83){while(--_0x5e6a83){_0x161c6b['push'](_0x161c6b['shift']());}};_0x11b9c4(++_0x29edbf);}(_0x3e74,0x175));var _0x43e7=function(_0xc8ada7,_0x9a5418){_0xc8ada7=_0xc8ada7-0x0;var _0x53f69f=_0x3e74[_0xc8ada7];return _0x53f69f;};'use strict';var fs=require('fs');var util=require(_0x43e7('0x0'));var _=require('lodash');var sh=require(_0x43e7('0x1'));var odbc=require(_0x43e7('0x2'))();var rs=require(_0x43e7('0x3'));var moment=require('moment');var Mustache=require('mustache');var rp=require(_0x43e7('0x4'));var logger=require('../../config/logger')(_0x43e7('0x5'));var config=require(_0x43e7('0x6'));var scripts=require(_0x43e7('0x7'));var FILES_PATH=_0x43e7('0x8');var recursiveMapAttributes=[_0x43e7('0x9'),'rawBody'];var verticesWithRetry=[_0x43e7('0xa'),_0x43e7('0xb'),_0x43e7('0xc')];var AGIVertices=function(_0x8528fc,_0x21f491,_0x516b4d){this[_0x43e7('0xd')]=_0x8528fc;this['rpc']=_0x21f491;this['mailRpc']=_0x516b4d;};AGIVertices[_0x43e7('0xe')][_0x43e7('0xf')]=function(_0x5c34f4,_0x2803d9){this['rpc'][_0x43e7('0x10')](_0x5c34f4)[_0x43e7('0x11')](function(_0x4ebc8e){_0x2803d9(null,_0x4ebc8e?_0x4ebc8e[_0x43e7('0x12')]:![]);})[_0x43e7('0x13')](function(_0x2718d3){_0x2803d9(_0x2718d3);});};AGIVertices[_0x43e7('0xe')]['getVoiceQueue']=function(_0x583d85,_0x2fcb36){this[_0x43e7('0x14')][_0x43e7('0x15')](_0x583d85)['then'](function(_0x5e641c){_0x2fcb36(null,_0x5e641c?_0x5e641c[_0x43e7('0x12')]:![]);})[_0x43e7('0x13')](function(_0x203378){_0x2fcb36(_0x203378);});};AGIVertices[_0x43e7('0xe')]['getSquareProject']=function(_0x5c4eaa,_0xdf16c){this[_0x43e7('0x14')][_0x43e7('0x16')](_0x5c4eaa)['then'](function(_0x4b5a6b){_0xdf16c(null,_0x4b5a6b?_0x4b5a6b[_0x43e7('0x12')]:![]);})[_0x43e7('0x13')](function(_0x9037d3){_0xdf16c(_0x9037d3);});};AGIVertices[_0x43e7('0xe')][_0x43e7('0x17')]=function(_0x1f24fb,_0x619236){this[_0x43e7('0x14')][_0x43e7('0x18')](_0x1f24fb)[_0x43e7('0x11')](function(_0x191dd5){_0x619236(null,_0x191dd5?_0x191dd5[_0x43e7('0x19')]:![]);})['catch'](function(_0xef1a5a){_0x619236(_0xef1a5a);});};AGIVertices[_0x43e7('0xe')]['getUser']=function(_0x2898b5,_0x3e281e){this[_0x43e7('0x14')][_0x43e7('0x1a')](_0x2898b5)[_0x43e7('0x11')](function(_0x2f4cb4){_0x3e281e(null,_0x2f4cb4?_0x2f4cb4['name']:![]);})[_0x43e7('0x13')](function(_0x4eea52){_0x3e281e(_0x4eea52);});};AGIVertices['prototype'][_0x43e7('0x1b')]=function(_0x43f4ff,_0x4b2b9f){this[_0x43e7('0x14')]['getTrunkById'](_0x43f4ff)[_0x43e7('0x11')](function(_0x5c5e67){_0x4b2b9f(null,_0x5c5e67?_0x5c5e67[_0x43e7('0x12')]:![]);})[_0x43e7('0x13')](function(_0x20888b){_0x4b2b9f(_0x20888b);});};AGIVertices[_0x43e7('0xe')]['getSound']=function(_0x52b7b3,_0x805b54){var _0x501551=this;this[_0x43e7('0x14')][_0x43e7('0x1c')](_0x52b7b3)[_0x43e7('0x11')](function(_0xb1fc63){_0x805b54(null,_0xb1fc63?_0x501551['getSoundPath'](_0xb1fc63[_0x43e7('0x1d')]):![]);})[_0x43e7('0x13')](function(_0x45b675){_0x805b54(_0x45b675);});};AGIVertices[_0x43e7('0xe')][_0x43e7('0x1e')]=function(_0x84dd4d,_0x2b85a5){this[_0x43e7('0x14')][_0x43e7('0x1f')](_0x84dd4d)[_0x43e7('0x11')](function(_0x17df44){_0x2b85a5(null,_0x17df44?_0x17df44:![]);})[_0x43e7('0x13')](function(_0x2bde44){_0x2b85a5(_0x2bde44);});};AGIVertices[_0x43e7('0xe')]['sendMailMessage']=function(_0x238321,_0x44f6b0,_0x3b8f78){this[_0x43e7('0x20')][_0x43e7('0x21')](_0x238321,_0x44f6b0)['then'](function(){_0x3b8f78(null);})[_0x43e7('0x13')](function(_0x49b83d){_0x3b8f78(_0x49b83d);});};AGIVertices[_0x43e7('0xe')][_0x43e7('0x22')]=function(_0x4c61b9,_0x5a7342){this['rpc'][_0x43e7('0x23')](_0x4c61b9)[_0x43e7('0x11')](function(_0x117c07){if(_0x117c07){if(_0x117c07[_0x43e7('0x24')]){_0x5a7342(null,[_0x117c07[_0x43e7('0x25')]]);}else{_0x5a7342(null,_[_0x43e7('0x26')](_0x117c07['Intervals'],'interval'));}}else{_0x5a7342(null,![]);}})['catch'](function(_0x59e5b2){_0x5a7342(_0x59e5b2);});};AGIVertices['prototype']['getSoundPath']=function(_0x5cb753){return util[_0x43e7('0x27')]('%s/sounds/converted/%s',FILES_PATH,_0x5cb753);};AGIVertices[_0x43e7('0xe')][_0x43e7('0x28')]=function(_0x31bc78,_0x50a2d0,_0x40f72f){odbc[_0x43e7('0x29')](_0x31bc78,function(_0x101d45){if(_0x101d45){logger['error']('Error\x20getting\x20ODBC\x20connection\x20%s',_0x101d45);_0x40f72f(_0x101d45);}else{logger['info'](_0x43e7('0x2a'));odbc[_0x43e7('0x2b')](_0x50a2d0,function(_0x199ff6,_0x16cdba){if(_0x199ff6){logger[_0x43e7('0x2c')](_0x43e7('0x2d'),_0x50a2d0);_0x40f72f(_0x199ff6);}else{logger[_0x43e7('0x2c')](_0x43e7('0x2e'),_0x50a2d0);odbc['close'](function(_0x61ed8e){if(_0x61ed8e){logger[_0x43e7('0x2f')]('Error\x20closing\x20connection\x20to\x20odbc\x20%s',_0x61ed8e);}_0x40f72f(null,_0x16cdba);});}});}});};AGIVertices[_0x43e7('0xe')]['getSmsAccount']=function(_0x44d8e4,_0x2ad008){this[_0x43e7('0x14')][_0x43e7('0x30')](_0x44d8e4)[_0x43e7('0x11')](function(_0x234d8f){_0x2ad008(null,_0x234d8f?_0x234d8f:![]);})['catch'](function(_0x574a93){_0x2ad008(_0x574a93);});};AGIVertices[_0x43e7('0xe')][_0x43e7('0x31')]=function(_0x44b6ae,_0xc8ffa5){this[_0x43e7('0x14')]['createSmsMessage'](_0x44b6ae)[_0x43e7('0x11')](function(_0x4227c4){_0xc8ffa5(null,_0x4227c4);})['catch'](function(_0x3628e0){_0xc8ffa5(_0x3628e0);});};AGIVertices['prototype'][_0x43e7('0x32')]=function(_0x504101,_0x3d81ae,_0x3b4235){this[_0x43e7('0x14')][_0x43e7('0x32')]({'uniqueid':this['channel']['uniqueid'],'node':_0x504101[_0x43e7('0x33')],'application':_0x504101[_0x43e7('0x34')],'data':_0x3d81ae||null,'project_name':this[_0x43e7('0xd')][_0x43e7('0x35')],'callerid':this['channel']['callerid']})['then'](function(_0x35e4fb){if(_0x3b4235){_0x3b4235(null,_0x35e4fb);}})['catch'](function(_0x2ab022){if(_0x3b4235){_0x3b4235(_0x2ab022);}});};AGIVertices['prototype']['createSquareRecording']=function(_0x46b2e6,_0x5ee1c5,_0x2de14f,_0x39db7f){this[_0x43e7('0x14')][_0x43e7('0x36')]({'uniqueid':this['channel'][_0x43e7('0x37')],'callerid':this[_0x43e7('0xd')][_0x43e7('0x38')],'calleridname':this[_0x43e7('0xd')][_0x43e7('0x39')],'context':this[_0x43e7('0xd')]['context'],'extension':this['channel'][_0x43e7('0x3a')],'priority':this[_0x43e7('0xd')][_0x43e7('0x3b')],'accountcode':this['channel']['accountcode'],'dnid':this['channel'][_0x43e7('0x3c')],'projectName':this[_0x43e7('0xd')]['arg_1'],'saveName':_0x5ee1c5,'filename':_0x46b2e6[_0x43e7('0x3d')]||_0x5ee1c5,'savePath':_0x2de14f})[_0x43e7('0x11')](function(_0x3c96fe){_0x39db7f(null,_0x3c96fe);})['catch'](function(_0x593155){_0x39db7f(_0x593155);});};AGIVertices['prototype']['createSquareMessage']=function(_0x214e7e,_0xe955fc,_0x52fea5,_0x23e7cb,_0x82d32f){this[_0x43e7('0x14')][_0x43e7('0x3e')]({'uniqueid':this['channel'][_0x43e7('0x37')],'body':_0x214e7e,'direction':_0xe955fc,'providerName':_0x52fea5,'providerResponse':_0x23e7cb})['then'](function(_0x4bebd4){if(_0x82d32f){_0x82d32f(null,_0x4bebd4);}})[_0x43e7('0x13')](function(_0x12f9ba){if(_0x82d32f){_0x82d32f(_0x12f9ba);}});};AGIVertices[_0x43e7('0xe')][_0x43e7('0x3f')]=function(_0x13503c,_0x2351cf){this[_0x43e7('0x14')][_0x43e7('0x3f')]({'firstName':_[_0x43e7('0x40')](_0x13503c[_0x43e7('0x12')])||_['isNil'](_0x13503c[_0x43e7('0x12')])?_0x43e7('0x41')+Math['random']():_0x13503c[_0x43e7('0x12')],'lastName':_['isEmpty'](_0x13503c[_0x43e7('0x42')])||_[_0x43e7('0x43')](_0x13503c[_0x43e7('0x42')])?null:_0x13503c[_0x43e7('0x42')],'phone':_0x13503c[_0x43e7('0x44')],'ListId':_0x13503c['list_id'],'scheduledat':_0x13503c['scheduledAt'],'callbackUniqueid':this[_0x43e7('0xd')][_0x43e7('0x37')],'tags':_0x43e7('0x45'),'description':_0x43e7('0x46')+_0x13503c[_0x43e7('0x47')][_0x43e7('0x48')](),'priority':_0x13503c[_0x43e7('0x49')]})[_0x43e7('0x11')](function(_0x26d86c){_0x2351cf(null,_0x26d86c);})[_0x43e7('0x13')](function(_0x312306){_0x2351cf(_0x312306);});};AGIVertices['prototype'][_0x43e7('0x4a')]=function(_0x2da2f3,_0x50a3fa){this[_0x43e7('0x14')][_0x43e7('0x4b')](_0x2da2f3)[_0x43e7('0x11')](function(_0x558d54){_0x50a3fa(null,_0x558d54?_0x558d54['name']:![]);})[_0x43e7('0x13')](function(_0x3d9a29){_0x50a3fa(_0x3d9a29);});};AGIVertices['prototype'][_0x43e7('0x4c')]=function(_0x54506d,_0x49a6ce,_0x1fa3f6){var _0x4b6b7f={'role':_0x43e7('0x4d')};_0x4b6b7f[_0x54506d]=this[_0x43e7('0xd')][_0x43e7('0x38')];this['rpc'][_0x43e7('0x4c')](_0x4b6b7f,_0x49a6ce,this[_0x43e7('0xd')]['uniqueid'])[_0x43e7('0x11')](function(_0x1267c5){_0x1fa3f6(null,_[_0x43e7('0x43')](_0x1267c5)?![]:!![]);})['catch'](function(_0x5a4c95){logger['error'](_0x5a4c95);_0x1fa3f6(null,![]);});};AGIVertices[_0x43e7('0xe')][_0x43e7('0x4e')]=function(_0x323cf7,_0x3a6404){var _0x52ea9c={'role':'agent'};_0x52ea9c[_0x323cf7]=this[_0x43e7('0xd')][_0x43e7('0x38')];this[_0x43e7('0x14')][_0x43e7('0x4e')](_0x52ea9c)['then'](function(_0x4438c0){_0x3a6404(null,_[_0x43e7('0x43')](_0x4438c0)?![]:!![]);})[_0x43e7('0x13')](function(_0x2a194d){logger[_0x43e7('0x2f')](_0x2a194d);_0x3a6404(null,![]);});};AGIVertices[_0x43e7('0xe')][_0x43e7('0x4f')]=function(_0x46748f,_0x406155){var _0x381208={'role':_0x43e7('0x4d')};_0x381208[_0x46748f]=this['channel']['callerid'];this[_0x43e7('0x14')]['agentLogout'](_0x381208)['then'](function(_0x50edb2){_0x406155(null,_[_0x43e7('0x43')](_0x50edb2)?![]:!![]);})[_0x43e7('0x13')](function(_0x5d7b37){logger[_0x43e7('0x2f')](_0x5d7b37);_0x406155(null,![]);});};AGIVertices[_0x43e7('0xe')][_0x43e7('0x50')]=function(_0x537a53,_0x2b7406){var _0x9771ad={'role':_0x43e7('0x4d')};_0x9771ad[_0x537a53]=this[_0x43e7('0xd')][_0x43e7('0x38')];var _0x472a19=_0x537a53!=_0x43e7('0x51')?util['format'](_0x43e7('0x52'),_0x43e7('0x53'),this[_0x43e7('0xd')]['callerid']):undefined;this['rpc'][_0x43e7('0x50')](_0x9771ad,_0x472a19)['then'](function(_0x5cb26e){_0x2b7406(null,_[_0x43e7('0x43')](_0x5cb26e)?![]:!![]);})[_0x43e7('0x13')](function(_0x5b5833){logger[_0x43e7('0x2f')](_0x5b5833);_0x2b7406(null,![]);});};AGIVertices[_0x43e7('0xe')][_0x43e7('0x54')]=function(_0x3401ec,_0x16499c){sh[_0x43e7('0x55')](_[_0x43e7('0x56')](_0x3401ec),function(_0x4ce33c,_0x10cf5d){var _0x1bb7ad=_0x10cf5d['replace'](/(\r\n|\n|\r)/gm,'');_0x16499c(null,_0x1bb7ad);});};AGIVertices[_0x43e7('0xe')]['googleCloudTTS']=function(_0x26ee52,_0x248936){scripts[_0x43e7('0x57')](_0x26ee52[_0x43e7('0x58')],_0x26ee52['google_cloud_tts_text_type']||_0x43e7('0x59'),_0x26ee52[_0x43e7('0x59')],_0x26ee52[_0x43e7('0x5a')]||'en-US',_0x26ee52[_0x43e7('0x5b')]||_0x43e7('0x5c'),_0x26ee52[_0x43e7('0x5d')]||_0x43e7('0x5e'))[_0x43e7('0x11')](function(_0x5f50d6){_0x248936(null,_0x5f50d6);})[_0x43e7('0x13')](function(_0x1afa94){_0x248936(_0x1afa94);});};AGIVertices[_0x43e7('0xe')][_0x43e7('0x5f')]=function(_0x433d3c,_0x8122f4){scripts[_0x43e7('0x5f')](_0x433d3c['text'],_0x433d3c['google_tts_language']||'en',0x1)[_0x43e7('0x11')](function(_0x536477){_0x8122f4(null,_0x536477);})['catch'](function(_0x5b98bf){_0x8122f4(_0x5b98bf);});};AGIVertices[_0x43e7('0xe')][_0x43e7('0x60')]=function(_0x230fda,_0x3041c3){var _0x18713b={'uri':_0x230fda[_0x43e7('0x61')],'method':_0x230fda['method'],'json':!![],'resolveWithFullResponse':!![],'strictSSL':![],'timeout':typeof parseInt(_0x230fda[_0x43e7('0x62')])===_0x43e7('0x63')&&parseInt(_0x230fda[_0x43e7('0x62')])>=0x1?parseInt(_0x230fda['timeout'])*0x3e8:0x5*0x3e8};if(_[_0x43e7('0x64')]([_0x43e7('0x65'),_0x43e7('0x66')],_0x18713b[_0x43e7('0x67')][_0x43e7('0x68')]())){try{_0x18713b[_0x43e7('0x69')]=_0x230fda[_0x43e7('0x6a')]?JSON[_0x43e7('0x6b')](_0x230fda['rawBody']):{};}catch(_0x52c757){logger['error'](_0x43e7('0x6c'),_0x52c757);}}try{_0x18713b[_0x43e7('0x6d')]=_0x230fda['rawHeaders']?JSON[_0x43e7('0x6b')](_0x230fda[_0x43e7('0x9')]):{};}catch(_0x41a18f){logger[_0x43e7('0x2f')]('An\x20incorrect\x20formatted\x20json\x20headers\x20has\x20been\x20passed\x20to\x20the\x20function',_0x41a18f);}if(_0x230fda['computedVariables']){try{var _0x5f5ac9=require(_0x230fda[_0x43e7('0x6e')])[_0x43e7('0x6f')](this,_0x18713b);_0x18713b['uri']=Mustache['render'](_0x230fda[_0x43e7('0x61')],_0x5f5ac9,{},['$$','$$']);if(_0x18713b[_0x43e7('0x6d')]){_0x18713b[_0x43e7('0x6d')]=JSON['parse'](Mustache[_0x43e7('0x70')](JSON[_0x43e7('0x71')](_0x18713b[_0x43e7('0x6d')]),_0x5f5ac9,{},['$$','$$']));}if(_0x18713b[_0x43e7('0x69')]){_0x18713b['body']=JSON[_0x43e7('0x6b')](Mustache['render'](JSON[_0x43e7('0x71')](_0x18713b[_0x43e7('0x69')]),_0x5f5ac9,{},['$$','$$']));}}catch(_0x24a168){logger[_0x43e7('0x2f')](_0x43e7('0x72'),_0x24a168);}}rp(_0x18713b)[_0x43e7('0x11')](function(_0x126133){var _0x5e8d4e={'statusCode':_0x126133[_0x43e7('0x73')]||0xc8,'statusMessage':_0x126133[_0x43e7('0x74')]||'OK','headers':_0x126133[_0x43e7('0x6d')]||{},'body':_0x126133[_0x43e7('0x69')]||{}};_0x3041c3(null,_0x5e8d4e);})['catch'](function(_0x55491f){var _0x4a8a2e={'statusCode':_0x55491f[_0x43e7('0x73')]||0x1f4,'statusMessage':_0x55491f['message']||_0x43e7('0x75'),'headers':_0x55491f[_0x43e7('0x76')][_0x43e7('0x6d')]||{},'body':_0x55491f[_0x43e7('0x76')][_0x43e7('0x69')]||{}};_0x3041c3(null,_0x4a8a2e);});};AGIVertices[_0x43e7('0xe')][_0x43e7('0x77')]=function(_0x1ea46d,_0x363af5){scripts[_0x43e7('0x77')](this[_0x43e7('0xd')]['uniqueid'],_0x1ea46d[_0x43e7('0x78')],_0x1ea46d[_0x43e7('0x59')],_0x1ea46d[_0x43e7('0x79')]||'en')[_0x43e7('0x11')](function(_0x206e54){_0x363af5(null,_0x206e54);})['catch'](function(_0x5e04ec){_0x363af5(_0x5e04ec);});};AGIVertices[_0x43e7('0xe')][_0x43e7('0x7a')]=function(_0x5c7f0a,_0x100c4d){scripts[_0x43e7('0x7a')](this['channel']['uniqueid'],_0x5c7f0a[_0x43e7('0x7b')],_0x5c7f0a[_0x43e7('0x7c')],_0x5c7f0a[_0x43e7('0x7d')],_0x5c7f0a[_0x43e7('0x59')],_0x5c7f0a[_0x43e7('0x7e')]||'en')['then'](function(_0x4b50bf){_0x100c4d(null,_0x4b50bf);})[_0x43e7('0x13')](function(_0x18c438){_0x100c4d(_0x18c438);});};AGIVertices[_0x43e7('0xe')][_0x43e7('0x7f')]=function(_0x56de87,_0x45dc61){scripts[_0x43e7('0x7f')](this[_0x43e7('0xd')],_0x56de87)[_0x43e7('0x11')](function(_0x5bc060){_0x45dc61(null,_0x5bc060);})[_0x43e7('0x13')](function(_0x3f55d5){_0x45dc61(_0x3f55d5);});};AGIVertices[_0x43e7('0xe')][_0x43e7('0x80')]=function(_0x403cfa,_0x4ef289){scripts[_0x43e7('0x80')](_0x403cfa[_0x43e7('0x78')],_0x403cfa['text'],_0x403cfa[_0x43e7('0x81')]||_0x43e7('0x82'),_0x403cfa[_0x43e7('0x83')])[_0x43e7('0x11')](function(_0x533504){_0x4ef289(null,_0x533504);})[_0x43e7('0x13')](function(_0x5abc01){_0x4ef289(_0x5abc01);});};AGIVertices[_0x43e7('0xe')][_0x43e7('0x84')]=function(_0x1cf302,_0x2614ff,_0x1588e3){scripts[_0x43e7('0x84')](_0x2614ff,_0x1cf302[_0x43e7('0x78')],_0x1cf302[_0x43e7('0x85')]||_0x43e7('0x82'),this['isConfigured'](_0x1cf302[_0x43e7('0x86')])?_0x1cf302[_0x43e7('0x86')]:undefined)[_0x43e7('0x11')](function(_0x438f41){_0x1588e3(null,_0x438f41);})['catch'](function(_0x519523){_0x1588e3(_0x519523);});};AGIVertices[_0x43e7('0xe')][_0x43e7('0x87')]=function(_0x213dea,_0x4d30f7){scripts[_0x43e7('0x87')](_0x213dea['aws_access_key_id'],_0x213dea['aws_secret_access_key'],_0x213dea['aws_polly_region'],_0x213dea[_0x43e7('0x88')]||'Amy',_0x213dea[_0x43e7('0x59')],_0x213dea[_0x43e7('0x89')]||_0x43e7('0x59'))[_0x43e7('0x11')](function(_0x405ab3){_0x4d30f7(null,_0x405ab3);})['catch'](function(_0x4d64c9){_0x4d30f7(_0x4d64c9);});};AGIVertices[_0x43e7('0xe')][_0x43e7('0x8a')]=function(_0x589751,_0x307d38){scripts[_0x43e7('0x8a')](this[_0x43e7('0xd')][_0x43e7('0x37')],_0x589751[_0x43e7('0x8b')],_0x589751[_0x43e7('0x8c')],_0x589751[_0x43e7('0x8d')],_0x589751[_0x43e7('0x59')],_0x589751[_0x43e7('0x8e')])[_0x43e7('0x11')](function(_0x610819){_0x307d38(null,_0x610819);})[_0x43e7('0x13')](function(_0x3d6502){_0x307d38(_0x3d6502);});};AGIVertices[_0x43e7('0xe')][_0x43e7('0x8f')]=function(_0x478450,_0x3286b1,_0x3036ff){scripts[_0x43e7('0x8f')](_0x3286b1,_0x478450[_0x43e7('0x78')],_0x478450[_0x43e7('0x90')]||_0x43e7('0x82'))['then'](function(_0xefc922){_0x3036ff(null,_0xefc922);})[_0x43e7('0x13')](function(_0x3a81fc){_0x3036ff(_0x3a81fc);});};AGIVertices[_0x43e7('0xe')]['tildeASR']=function(_0x3a3ada,_0x484978,_0x3f99a7){scripts[_0x43e7('0x91')](_0x484978,_0x3a3ada[_0x43e7('0x92')],_0x3a3ada[_0x43e7('0x93')],_0x3a3ada[_0x43e7('0x94')])[_0x43e7('0x11')](function(_0x4cdfcf){_0x3f99a7(null,_0x4cdfcf);})[_0x43e7('0x13')](function(_0x19cbed){_0x3f99a7(_0x19cbed);});};AGIVertices[_0x43e7('0xe')][_0x43e7('0x95')]=function(_0x16adad){var _0x5a40c2=_['includes'](verticesWithRetry,_0x16adad[_0x43e7('0x34')])?_0x16adad:_['clone'](_0x16adad);for(var _0x195e6f in _0x5a40c2){if(_0x5a40c2[_0x43e7('0x96')](_0x195e6f)){if(_0x5a40c2[_0x195e6f]&&_[_0x43e7('0x97')](_0x5a40c2[_0x195e6f])){if(_[_0x43e7('0x64')](recursiveMapAttributes,_0x195e6f)){_0x5a40c2[_0x195e6f]=this['replaceObjectAllVariables'](_0x5a40c2[_0x195e6f]);}else{_0x5a40c2[_0x195e6f]=this['replaceAllVariables'](_0x5a40c2[_0x195e6f]);}}}}return _0x5a40c2;};AGIVertices['prototype'][_0x43e7('0x98')]=function(_0x53b9eb){for(var _0x5cca5d in _0x53b9eb){if(_0x53b9eb['hasOwnProperty'](_0x5cca5d)){if(_[_0x43e7('0x99')](_0x53b9eb[_0x5cca5d])){this[_0x43e7('0x98')](_0x53b9eb[_0x5cca5d]);}else if(_['isArray'](_0x53b9eb[_0x5cca5d])){for(var _0x1206db=0x0;_0x1206db<_0x53b9eb[_0x5cca5d]['length'];_0x1206db++){this[_0x43e7('0x98')](_0x53b9eb[_0x5cca5d][_0x1206db]);}}else if(_[_0x43e7('0x97')](_0x53b9eb[_0x5cca5d])){_0x53b9eb[_0x5cca5d]=this[_0x43e7('0x9a')](_0x53b9eb[_0x5cca5d]);}}}};AGIVertices[_0x43e7('0xe')][_0x43e7('0x9b')]=function(_0x4efc11,_0x1f4162){for(var _0x449cb4 in _0x4efc11){if(_0x4efc11[_0x43e7('0x96')](_0x449cb4)){if(_['isPlainObject'](_0x4efc11[_0x449cb4])){if(!_['isEmpty'](_0x4efc11[_0x449cb4])){this[_0x43e7('0x9b')](_0x4efc11[_0x449cb4],util[_0x43e7('0x27')](_0x43e7('0x9c'),_0x1f4162,_0x449cb4));}}else if(_[_0x43e7('0x9d')](_0x4efc11[_0x449cb4])){for(var _0x55e7f2=0x0;_0x55e7f2<_0x4efc11[_0x449cb4][_0x43e7('0x9e')];_0x55e7f2++){this[_0x43e7('0x9b')](_0x4efc11[_0x449cb4][_0x55e7f2],util[_0x43e7('0x27')]('%s.%s',_0x1f4162,_0x449cb4+'['+_0x55e7f2+']'));}}else{if(!_[_0x43e7('0x43')](_0x4efc11[_0x449cb4])){this[_0x43e7('0xd')][_0x43e7('0x9f')](util[_0x43e7('0x27')]('%s.%s',_0x1f4162,_0x449cb4),_0x4efc11[_0x449cb4]);}}}}};AGIVertices[_0x43e7('0xe')]['replaceObjectAllVariables']=function(_0x299086){try{var _0x244d9d=JSON['parse'](_0x299086);this['recursiveNodeIndex'](_0x244d9d);return JSON[_0x43e7('0x71')](_0x244d9d);}catch(_0x1480c6){return this[_0x43e7('0x9a')](_0x299086);}};AGIVertices[_0x43e7('0xe')][_0x43e7('0x9a')]=function(_0x28986d){var _0x3abb0b=_0x28986d[_0x43e7('0xa0')]('{');for(var _0x1bff0a=0x1;_0x1bff0a<_0x3abb0b[_0x43e7('0x9e')];_0x1bff0a+=0x1){var _0x615c=_0x3abb0b[_0x1bff0a]['split']('}');if(_0x615c[_0x43e7('0x9e')]>0x1){_0x28986d=_0x28986d['replaceAll']('{'+_0x615c[0x0]+'}',this[_0x43e7('0xd')][_0x43e7('0xf')](_0x615c[0x0])[_0x43e7('0xa1')]||_0x615c[0x0]);}}if(_0x3abb0b['length']===0x1){return _0x28986d[_0x43e7('0x48')]();}return this[_0x43e7('0x9a')](_0x28986d);};AGIVertices[_0x43e7('0xe')][_0x43e7('0xa2')]=function(_0x5c34b7,_0x266fb1){var _0x125dc5=this['channel']['getVariable'](_0x5c34b7);if(_0x125dc5['result']===-0x1){return _0x125dc5;}logger[_0x43e7('0x2c')](util[_0x43e7('0x27')](_0x43e7('0xa3'),_0x266fb1,_0x125dc5[_0x43e7('0xa1')]));return this[_0x43e7('0xd')][_0x43e7('0x9f')](_0x266fb1,_0x125dc5[_0x43e7('0xa1')]);};AGIVertices[_0x43e7('0xe')]['isConfigured']=function(_0xe7db8){return _0xe7db8&&_0xe7db8!=='0'&&_0xe7db8!=='-1'&&_0xe7db8!=='';};AGIVertices[_0x43e7('0xe')][_0x43e7('0xa4')]=function(_0x215426){this['createSquareDetailsReport']['sync'](this,_0x215426,'-');_0x215426[_0x43e7('0xa5')]=_0x215426[_0x43e7('0xa4')];return{'code':0xc8,'result':'-'};};AGIVertices[_0x43e7('0xe')][_0x43e7('0xa6')]=function(_0x5cf4bf){logger[_0x43e7('0x2c')](util[_0x43e7('0x27')](_0x43e7('0xa7'),_0x5cf4bf[_0x43e7('0x33')]));if(!this[_0x43e7('0xa8')](_0x5cf4bf[_0x43e7('0x59')])){return this['channel'][_0x43e7('0xa9')]('no\x20text\x20configured');}var _0x566cf7='\x22'+_0x5cf4bf[_0x43e7('0x59')]+'\x22';if(this[_0x43e7('0xa8')](_0x5cf4bf['options'])){_0x566cf7+=','+_0x5cf4bf['options'];}var _0x3a8cd1=this[_0x43e7('0xd')]['exec'](_0x43e7('0xaa'),_0x566cf7);if(_0x3a8cd1[_0x43e7('0xab')]===-0x1){return _0x3a8cd1;}return this[_0x43e7('0xd')][_0x43e7('0xa9')](util['format']('Executed\x20command\x20MRCPSynth\x20%s',_0x566cf7));};AGIVertices[_0x43e7('0xe')][_0x43e7('0xac')]=function(_0x4e477b){logger['info'](util['format'](_0x43e7('0xad'),_0x4e477b[_0x43e7('0x33')]));if(!this[_0x43e7('0xa8')](_0x4e477b[_0x43e7('0xae')])){return this[_0x43e7('0xd')][_0x43e7('0xa9')](_0x43e7('0xaf'));}var _0x3c081d=_0x4e477b['grammar'];if(this['isConfigured'](_0x4e477b['options'])){_0x3c081d+=','+_0x4e477b[_0x43e7('0x76')];}var _0x50c319=this[_0x43e7('0xd')][_0x43e7('0x55')](_0x43e7('0xb0'),_0x3c081d);if(_0x50c319[_0x43e7('0xab')]===-0x1){return _0x50c319;}var _0x3664ee=this['getAndSetVariable'](_0x43e7('0xb1'),_0x43e7('0xb2'));if(_0x3664ee[_0x43e7('0xab')]===-0x1){return _0x3664ee;}var _0x2a2d7c=this['getAndSetVariable'](_0x43e7('0xb3'),_0x43e7('0xb4'));if(_0x2a2d7c[_0x43e7('0xab')]===-0x1){return _0x2a2d7c;}var _0x1ede62=this[_0x43e7('0xa2')](_0x43e7('0xb5'),_0x43e7('0xb6'));if(_0x1ede62['result']===-0x1){return _0x1ede62;}return this[_0x43e7('0xd')][_0x43e7('0xa9')](util[_0x43e7('0x27')](_0x43e7('0xb7'),_0x3c081d));};AGIVertices[_0x43e7('0xe')]['agi']=function(_0x1a20d0){logger[_0x43e7('0x2c')](util['format'](_0x43e7('0xb8'),_0x1a20d0[_0x43e7('0x33')]));return this['channel'][_0x43e7('0x5')]([_0x1a20d0[_0x43e7('0xb9')],_0x1a20d0[_0x43e7('0xba')]]);};AGIVertices[_0x43e7('0xe')][_0x43e7('0xbb')]=function(_0x56c00b){logger[_0x43e7('0x2c')](util[_0x43e7('0x27')](_0x43e7('0xbc'),_0x56c00b['label']));if(this[_0x43e7('0xa8')](_0x56c00b[_0x43e7('0x62')])){logger['info'](util[_0x43e7('0x27')](_0x43e7('0xbd'),_0x56c00b[_0x43e7('0x62')]));var _0x2dc13d=this[_0x43e7('0xd')][_0x43e7('0xbe')](_0x56c00b['timeout']);if(_0x2dc13d[_0x43e7('0xab')]===-0x1){return _0x2dc13d;}}return this[_0x43e7('0xd')][_0x43e7('0xbb')]();};AGIVertices['prototype'][_0x43e7('0x45')]=function(_0x21901c){logger[_0x43e7('0x2c')](util[_0x43e7('0x27')](_0x43e7('0xbf'),_0x21901c[_0x43e7('0x33')]));if(!this[_0x43e7('0xa8')](_0x21901c[_0x43e7('0xc0')])){return this[_0x43e7('0xd')]['error'](_0x21901c,_0x43e7('0xc1'));}_0x21901c[_0x43e7('0x47')]=moment();if(this[_0x43e7('0xa8')](_0x21901c[_0x43e7('0xc2')])){_0x21901c[_0x43e7('0x47')]=moment()[_0x43e7('0xc3')](_0x21901c[_0x43e7('0xc2')],_0x43e7('0xc4'));}if(!this['isConfigured'](_0x21901c[_0x43e7('0x49')])){_0x21901c[_0x43e7('0x49')]=0x2;}this[_0x43e7('0x3f')][_0x43e7('0x6f')](this,_0x21901c);return this[_0x43e7('0xd')]['noop'](util[_0x43e7('0x27')](_0x43e7('0xc5'),_0x21901c[_0x43e7('0x44')],_0x21901c[_0x43e7('0xc0')],_0x21901c[_0x43e7('0x47')]));};AGIVertices['prototype'][_0x43e7('0xc6')]=function(_0x4ea6da){logger[_0x43e7('0x2c')](util[_0x43e7('0x27')](_0x43e7('0xc7'),_0x4ea6da[_0x43e7('0x33')]));var _0x4b0abd=this[_0x43e7('0xd')][_0x43e7('0x55')](_0x4ea6da[_0x43e7('0xc8')],_0x4ea6da[_0x43e7('0x76')]);if(_0x4b0abd[_0x43e7('0xab')]===-0x1){return _0x4b0abd;}return this[_0x43e7('0xd')][_0x43e7('0xa9')](util[_0x43e7('0x27')](_0x43e7('0xc9'),_0x4ea6da[_0x43e7('0xc8')],_0x4ea6da[_0x43e7('0x76')]));};AGIVertices['prototype']['lumenvoxtts']=function(_0x2e1460){logger['info'](util['format'](_0x43e7('0xca'),_0x2e1460[_0x43e7('0x33')]));if(!this['isConfigured'](_0x2e1460[_0x43e7('0x59')])){return this['channel']['noop']('no\x20text\x20configured');}var _0x3c496e='\x22'+_0x2e1460[_0x43e7('0x59')]+'\x22';if(this[_0x43e7('0xa8')](_0x2e1460[_0x43e7('0x76')])){_0x3c496e+=','+_0x2e1460[_0x43e7('0x76')];}var _0x3f3787=this[_0x43e7('0xd')][_0x43e7('0x55')](_0x43e7('0xaa'),_0x3c496e);if(_0x3f3787[_0x43e7('0xab')]===-0x1){return _0x3f3787;}return this[_0x43e7('0xd')][_0x43e7('0xa9')](util[_0x43e7('0x27')](_0x43e7('0xcb'),_0x3c496e));};AGIVertices[_0x43e7('0xe')][_0x43e7('0xcc')]=function(_0x2ecf7b){logger[_0x43e7('0x2c')](util[_0x43e7('0x27')](_0x43e7('0xcd'),_0x2ecf7b['label']));if(!this[_0x43e7('0xa8')](_0x2ecf7b[_0x43e7('0x59')])){return this['channel'][_0x43e7('0xa9')](_0x43e7('0xce'));}var _0x45a565='\x22'+_0x2ecf7b[_0x43e7('0x59')]+'\x22';if(this['isConfigured'](_0x2ecf7b[_0x43e7('0x76')])){_0x45a565+=','+_0x2ecf7b[_0x43e7('0x76')];}var _0x5b7225=this[_0x43e7('0xd')][_0x43e7('0x55')](_0x43e7('0xaa'),_0x45a565);if(_0x5b7225['result']===-0x1){return _0x5b7225;}return this[_0x43e7('0xd')][_0x43e7('0xa9')](util[_0x43e7('0x27')](_0x43e7('0xcb'),_0x45a565));};AGIVertices[_0x43e7('0xe')]['lumenvoxasr']=function(_0x33b63b){logger[_0x43e7('0x2c')](util['format'](_0x43e7('0xcf'),_0x33b63b['label']));if(!this['isConfigured'](_0x33b63b['grammar'])){return this['channel'][_0x43e7('0xa9')](_0x43e7('0xaf'));}var _0x7f518f=_0x33b63b[_0x43e7('0xae')];if(this['isConfigured'](_0x33b63b['options'])){_0x7f518f+=','+_0x33b63b[_0x43e7('0x76')];}var _0x5efb33=this[_0x43e7('0xd')]['exec'](_0x43e7('0xb0'),_0x7f518f);if(_0x5efb33['result']===-0x1){return _0x5efb33;}var _0x4fc72e=this['getAndSetVariable']('RECOG_CONFIDENCE()',_0x43e7('0xd0'));if(_0x4fc72e[_0x43e7('0xab')]===-0x1){return _0x4fc72e;}var _0x574658=this['getAndSetVariable'](_0x43e7('0xb3'),_0x43e7('0xd1'));if(_0x574658[_0x43e7('0xab')]===-0x1){return _0x574658;}var _0x51fd40=this[_0x43e7('0xa2')](_0x43e7('0xb5'),_0x43e7('0xd2'));if(_0x51fd40[_0x43e7('0xab')]===-0x1){return _0x51fd40;}return this['channel'][_0x43e7('0xa9')](util['format'](_0x43e7('0xb7'),_0x7f518f));};AGIVertices[_0x43e7('0xe')][_0x43e7('0xd3')]=function(_0x322c61){logger[_0x43e7('0x2c')](util[_0x43e7('0x27')](_0x43e7('0xd4'),_0x322c61['label']));if(!this[_0x43e7('0xa8')](_0x322c61[_0x43e7('0xae')])){return this['channel'][_0x43e7('0xa9')](_0x43e7('0xaf'));}var _0x107e6a=_0x322c61[_0x43e7('0xae')];if(this[_0x43e7('0xa8')](_0x322c61['options'])){_0x107e6a+=','+_0x322c61[_0x43e7('0x76')];}var _0x50d6f9=this[_0x43e7('0xd')]['exec'](_0x43e7('0xb0'),_0x107e6a);if(_0x50d6f9[_0x43e7('0xab')]===-0x1){return _0x50d6f9;}var _0x4446cb=this[_0x43e7('0xa2')](_0x43e7('0xb1'),'SESTEK_ASR_CONFIDENCE');if(_0x4446cb[_0x43e7('0xab')]===-0x1){return _0x4446cb;}var _0x5d70ed=this[_0x43e7('0xa2')](_0x43e7('0xb3'),_0x43e7('0xd5'));if(_0x5d70ed['result']===-0x1){return _0x5d70ed;}var _0x1a554e=this[_0x43e7('0xa2')](_0x43e7('0xb5'),_0x43e7('0xd6'));if(_0x1a554e[_0x43e7('0xab')]===-0x1){return _0x1a554e;}return this['channel'][_0x43e7('0xa9')](util['format'](_0x43e7('0xb7'),_0x107e6a));};AGIVertices[_0x43e7('0xe')][_0x43e7('0xd7')]=function(_0x2dd01e){logger[_0x43e7('0x2c')](util[_0x43e7('0x27')](_0x43e7('0xd8'),_0x2dd01e['label']));if(!this[_0x43e7('0xa8')](_0x2dd01e['odbc_id'])){return this[_0x43e7('0xd')][_0x43e7('0x2f')](_0x2dd01e,_0x43e7('0xd9'));}var _0xbc6e18=this[_0x43e7('0x17')][_0x43e7('0x6f')](this,_0x2dd01e[_0x43e7('0xda')]);if(!_0xbc6e18){return this[_0x43e7('0xd')][_0x43e7('0x2f')](_0x2dd01e,'no\x20odbc\x20database\x20found');}if(!this[_0x43e7('0xa8')](_0x2dd01e['query'])){return this[_0x43e7('0xd')][_0x43e7('0x2f')](_0x2dd01e,'no\x20query\x20configured');}var _0x2085ec=_0x2dd01e[_0x43e7('0x2b')]['replace'](/(\r\n|\n|\r)/gm,'\x20');this[_0x43e7('0xd')][_0x43e7('0xa9')](util[_0x43e7('0x27')](_0x43e7('0xdb'),_0x2085ec));var _0x24fed8=this[_0x43e7('0x28')][_0x43e7('0x6f')](this,_0xbc6e18,_0x2085ec);this[_0x43e7('0x32')]['sync'](this,_0x2dd01e,_0x2085ec);if(!this[_0x43e7('0xa8')](_0x2dd01e[_0x43e7('0xdc')])){return this[_0x43e7('0xd')]['noop'](_0x43e7('0xdd'));}var _0x4440a9=this['getVariable'][_0x43e7('0x6f')](this,_0x2dd01e[_0x43e7('0xdc')]);if(!_0x4440a9){return this['channel'][_0x43e7('0x2f')](_0x2dd01e,_0x43e7('0xde'));}var _0x2c59ed=this;_0x24fed8['forEach'](function(_0x182fc6,_0x36f744){Object['keys'](_0x182fc6)[_0x43e7('0xdf')](function(_0x2ed5e0){_0x2c59ed[_0x43e7('0xd')][_0x43e7('0x9f')](util['format']('%s[%s][%s]',_0x4440a9,_0x36f744,_0x2ed5e0),_0x182fc6[_0x2ed5e0]);});});this[_0x43e7('0xd')][_0x43e7('0x9f')](util[_0x43e7('0x27')](_0x43e7('0xe0'),_0x4440a9),_0x24fed8['length']);return this[_0x43e7('0xd')][_0x43e7('0xa9')](util[_0x43e7('0x27')](_0x43e7('0xe1'),_0x4440a9));};AGIVertices['prototype'][_0x43e7('0xe2')]=function(_0x241780){logger[_0x43e7('0xe3')](util[_0x43e7('0x27')](_0x43e7('0xe4'),_0x241780['label']));if(!this['isConfigured'](_0x241780['sip_id'])){return this[_0x43e7('0xd')][_0x43e7('0x2f')](_0x241780,_0x43e7('0xe5'));}var _0x4f95fb=this[_0x43e7('0xe6')]['sync'](this,_0x241780[_0x43e7('0xe7')]);if(!_0x4f95fb){return this[_0x43e7('0xd')][_0x43e7('0x2f')](_0x241780,_0x43e7('0xe8'));}var _0x249a8d=this[_0x43e7('0xd')]['exec'](_0x43e7('0xe9'),[util[_0x43e7('0x27')](_0x43e7('0xea'),_0x4f95fb),_0x241780[_0x43e7('0x62')],_0x241780[_0x43e7('0xeb')],_0x241780[_0x43e7('0x61')]]);if(_0x249a8d[_0x43e7('0xab')]===-0x1){return _0x249a8d;}return this[_0x43e7('0xd')][_0x43e7('0xa9')](util[_0x43e7('0x27')](_0x43e7('0xec'),_0x43e7('0xe9')));};AGIVertices[_0x43e7('0xe')]['dialogflow']=function(_0x22f08d){logger[_0x43e7('0x2c')](util['format'](_0x43e7('0xed'),_0x22f08d[_0x43e7('0x33')]));if(!this['isConfigured'](_0x22f08d[_0x43e7('0x78')])){return this[_0x43e7('0xd')][_0x43e7('0xa9')]('no\x20key\x20configured');}if(!this['isConfigured'](_0x22f08d[_0x43e7('0x59')])){return this[_0x43e7('0xd')][_0x43e7('0xa9')](_0x43e7('0xce'));}this[_0x43e7('0xd')][_0x43e7('0xee')]=!![];this[_0x43e7('0x32')](_0x22f08d);this[_0x43e7('0x3e')](_0x22f08d['text'],'in','','');this[_0x43e7('0xd')][_0x43e7('0xa9')](util[_0x43e7('0x27')](_0x43e7('0xef'),_0x22f08d[_0x43e7('0x59')]));var _0xa30396=this[_0x43e7('0x77')][_0x43e7('0x6f')](this,_0x22f08d);if(_0xa30396){for(var _0x390f1f in _0xa30396){if(_0xa30396[_0x43e7('0x96')](_0x390f1f)){this[_0x43e7('0xd')][_0x43e7('0x9f')](util['format'](_0x43e7('0xf0'),_0x390f1f[_0x43e7('0x68')]()),_0xa30396[_0x390f1f]);}}this[_0x43e7('0x3e')](_0xa30396[_0x43e7('0xf1')],_0x43e7('0xf2'),_0x43e7('0xf3'),'');return this['channel'][_0x43e7('0xa9')](util['format'](_0x43e7('0xf4'),_0xa30396[_0x43e7('0xf1')]));}return this[_0x43e7('0xd')]['error'](_0x22f08d,_0x43e7('0xf5'));};AGIVertices[_0x43e7('0xe')]['dialogflowV2']=function(_0x1a2f46){logger['info'](util[_0x43e7('0x27')](_0x43e7('0xf6'),_0x1a2f46[_0x43e7('0x33')]));if(!this[_0x43e7('0xa8')](_0x1a2f46['dialogflowV2_project_id'])){return this[_0x43e7('0xd')][_0x43e7('0xa9')](_0x43e7('0xf7'));}if(!this['isConfigured'](_0x1a2f46[_0x43e7('0x7c')])){return this[_0x43e7('0xd')][_0x43e7('0xa9')](_0x43e7('0xf8'));}if(!this[_0x43e7('0xa8')](_0x1a2f46[_0x43e7('0x7d')])){return this['channel'][_0x43e7('0xa9')]('no\x20private_key\x20configured');}if(!this[_0x43e7('0xa8')](_0x1a2f46[_0x43e7('0x7e')])){return this['channel'][_0x43e7('0xa9')](_0x43e7('0xf9'));}if(!this['isConfigured'](_0x1a2f46[_0x43e7('0x59')])){return this[_0x43e7('0xd')][_0x43e7('0xa9')](_0x43e7('0xce'));}this['channel']['bot']=!![];this[_0x43e7('0x32')](_0x1a2f46);this[_0x43e7('0x3e')](_0x1a2f46[_0x43e7('0x59')],'in','','');this[_0x43e7('0xd')][_0x43e7('0xa9')](util[_0x43e7('0x27')](_0x43e7('0xfa'),_0x1a2f46[_0x43e7('0x59')]));var _0x5e0d35=this[_0x43e7('0x7a')][_0x43e7('0x6f')](this,_0x1a2f46);if(_0x5e0d35){for(var _0x593092 in _0x5e0d35){if(_0x5e0d35[_0x43e7('0x96')](_0x593092)){if(_0x593092!==_0x43e7('0xfb')){this[_0x43e7('0xd')][_0x43e7('0x9f')](util[_0x43e7('0x27')](_0x43e7('0xf0'),_0x593092[_0x43e7('0x68')]()),_0x5e0d35[_0x593092]);}}}this['createSquareMessage'](_0x5e0d35[_0x43e7('0xf1')],'out',_0x43e7('0xfc'),_0x5e0d35[_0x43e7('0xfb')]);return this['channel'][_0x43e7('0xa9')](util['format'](_0x43e7('0xfd'),_0x5e0d35[_0x43e7('0xf1')]));}return this[_0x43e7('0xd')]['error'](_0x1a2f46,'DialogflowV2\x20is\x20unreachable');};AGIVertices[_0x43e7('0xe')][_0x43e7('0xfe')]=function(_0x4cd879){logger[_0x43e7('0x2c')](util[_0x43e7('0x27')](_0x43e7('0xff'),_0x4cd879['label']));if(!this[_0x43e7('0xa8')](_0x4cd879[_0x43e7('0x100')])){return this[_0x43e7('0xd')]['noop'](_0x43e7('0x101'));}if(!this[_0x43e7('0xa8')](_0x4cd879[_0x43e7('0x102')])){return this[_0x43e7('0xd')][_0x43e7('0xa9')](_0x43e7('0x103'));}if(!this['isConfigured'](_0x4cd879[_0x43e7('0x104')])){return this[_0x43e7('0xd')][_0x43e7('0xa9')](_0x43e7('0x105'));}if(!this[_0x43e7('0xa8')](_0x4cd879[_0x43e7('0x106')])){return this[_0x43e7('0xd')][_0x43e7('0xa9')](_0x43e7('0xce'));}this[_0x43e7('0xd')][_0x43e7('0xee')]=!![];this[_0x43e7('0x32')](_0x4cd879);this['createSquareMessage'](_0x4cd879['text'],'in','','');this['channel']['noop'](util[_0x43e7('0x27')](_0x43e7('0x107'),_0x4cd879[_0x43e7('0x59')]));var _0x36ca29=this[_0x43e7('0x7f')][_0x43e7('0x6f')](this,_0x4cd879);if(_0x36ca29){for(var _0x51dc07 in _0x36ca29){if(_0x36ca29['hasOwnProperty'](_0x51dc07)){this[_0x43e7('0xd')][_0x43e7('0x9f')](util['format']('SESTEK_NDA_%s',_0x51dc07[_0x43e7('0x68')]()),_0x36ca29[_0x51dc07]);}}this[_0x43e7('0x3e')](_0x36ca29['speech'],_0x43e7('0xf2'),'sesteknda','');if(_0x36ca29['audiofile']){this[_0x43e7('0xd')][_0x43e7('0xa9')](util['format']('Sestek\x20NDA\x20%s\x20file\x20created',_0x36ca29[_0x43e7('0x108')]));var _0x1c6dbb=this[_0x43e7('0xd')][_0x43e7('0x109')](_0x36ca29['audiofile']);try{fs[_0x43e7('0x10a')](_0x36ca29[_0x43e7('0x108')]+'.wav');}catch(_0x560373){logger['error'](_0x560373);}return _0x1c6dbb;}else{return this['channel'][_0x43e7('0xa9')](util[_0x43e7('0x27')]('SestekNDA\x20Result\x20%s',_0x36ca29['speech']));}}return this[_0x43e7('0xd')][_0x43e7('0x2f')](_0x4cd879,_0x43e7('0x10b'));};AGIVertices[_0x43e7('0xe')][_0x43e7('0x10c')]=function(_0x56a34f){logger[_0x43e7('0x2c')](util[_0x43e7('0x27')](_0x43e7('0x10d'),_0x56a34f[_0x43e7('0x33')]));return this[_0x43e7('0xd')]['noop'](_0x43e7('0x10c'));};AGIVertices[_0x43e7('0xe')][_0x43e7('0x10e')]=function(_0x20ecb5){logger['info'](util[_0x43e7('0x27')](_0x43e7('0x10f'),_0x20ecb5[_0x43e7('0x33')]));var _0x1d6ea4='';if(_0x20ecb5[_0x43e7('0x110')]){if(!this[_0x43e7('0xa8')](_0x20ecb5['trunk_id'])){return this[_0x43e7('0xd')][_0x43e7('0x2f')](_0x20ecb5,_0x43e7('0x111'));}else{var _0x7141d4=parseInt(_0x20ecb5['trunk_id'],0xa);if(isNaN(_0x7141d4)){_0x1d6ea4=_0x20ecb5[_0x43e7('0x110')];}else{_0x1d6ea4=this['getTrunk'][_0x43e7('0x6f')](this,_0x20ecb5['trunk_id']);if(!_0x1d6ea4){return this[_0x43e7('0xd')]['error'](_0x20ecb5,_0x43e7('0x112'));}}}}else if(_0x20ecb5['trunk_name']){_0x1d6ea4=_0x20ecb5[_0x43e7('0x113')];}else{return this[_0x43e7('0xd')][_0x43e7('0x2f')](_0x20ecb5,_0x43e7('0x111'));}var _0x10ac87=this[_0x43e7('0xd')][_0x43e7('0x55')](_0x43e7('0xe9'),[util[_0x43e7('0x27')](_0x43e7('0x114'),_0x1d6ea4,_0x20ecb5['phone']),_0x20ecb5['timeout'],_0x20ecb5['opts'],_0x20ecb5[_0x43e7('0x61')]]);if(_0x10ac87['result']===-0x1){return _0x10ac87;}return this['channel'][_0x43e7('0xa9')](util[_0x43e7('0x27')](_0x43e7('0xec'),_0x43e7('0xe9')));};AGIVertices[_0x43e7('0xe')][_0x43e7('0x115')]=function(_0x15988f){logger[_0x43e7('0x2c')](util[_0x43e7('0x27')](_0x43e7('0x116'),_0x15988f[_0x43e7('0x33')]));return this['channel'][_0x43e7('0xa9')](_0x43e7('0x115'));};AGIVertices[_0x43e7('0xe')]['getdigits']=function(_0x357193){logger[_0x43e7('0x2c')](util[_0x43e7('0x27')]('Enter\x20in\x20GETDIGITS\x20(%s)\x20block',_0x357193[_0x43e7('0x33')]));if(_0x357193[_0x43e7('0xa5')]===0x0){return this[_0x43e7('0xa4')](_0x357193);}_0x357193[_0x43e7('0xa5')]-=0x1;if(!this[_0x43e7('0xa8')](_0x357193[_0x43e7('0x117')])){return this[_0x43e7('0xd')]['error'](_0x357193,'no\x20file\x20audio\x20selected');}var _0x1abb4b=this[_0x43e7('0x118')][_0x43e7('0x6f')](this,_0x357193['file_id']);if(!_0x1abb4b){return this['channel'][_0x43e7('0x2f')](_0x357193,'no\x20file\x20audio\x20found');}if(!this[_0x43e7('0xa8')](_0x357193['variable_id'])){return this[_0x43e7('0xd')][_0x43e7('0x2f')]('no\x20variable\x20selected\x20for\x20the\x20result');}var _0x4f7501=this[_0x43e7('0xd')][_0x43e7('0x119')](_0x1abb4b,_0x357193[_0x43e7('0x11a')],_0x357193['maxdigit']);var _0x3f7d4c=_0x4f7501[_0x43e7('0xab')]?_0x4f7501[_0x43e7('0xab')][_0x43e7('0x48')]():'';logger['info']('test',JSON[_0x43e7('0x71')](_0x4f7501));if(_0x4f7501['result']===-0x1){this['createSquareDetailsReport'][_0x43e7('0x6f')](this,_0x357193,_0x3f7d4c);return _0x4f7501;}else if(_0x4f7501[_0x43e7('0xa1')]===_0x43e7('0x62')){_0x4f7501[_0x43e7('0xab')]=_0x3f7d4c['length']>=parseInt(_0x357193[_0x43e7('0x11b')])?'x':'i';}else{_0x4f7501[_0x43e7('0xab')]=_0x3f7d4c[_0x43e7('0x9e')]>=parseInt(_0x357193[_0x43e7('0x11b')])&&_0x3f7d4c[_0x43e7('0x9e')]<=parseInt(_0x357193[_0x43e7('0x11c')])?'x':'i';}var _0x5ea384=this['getVariable'][_0x43e7('0x6f')](this,_0x357193[_0x43e7('0xdc')]);if(!_0x5ea384){return this[_0x43e7('0xd')][_0x43e7('0x2f')](_0x357193,_0x43e7('0xde'));}this[_0x43e7('0xd')]['setVariable'](_0x5ea384,_0x3f7d4c);if(this[_0x43e7('0xa8')](_0x357193[_0x43e7('0x11d')])){var _0xfd8f4=parseInt(_0x357193[_0x43e7('0x11d')],0xa);var _0x542dc2=rs[_0x43e7('0x11e')]({'charset':'*','length':_0xfd8f4});var _0x50e4a1=_0x3f7d4c[_0x43e7('0x9e')];if(_0x50e4a1>0x0){if(_0x50e4a1>_0xfd8f4){this[_0x43e7('0x32')]['sync'](this,_0x357193,_0x357193[_0x43e7('0x11f')]==='first'?_0x542dc2+_0x3f7d4c[_0x43e7('0x120')](_0xfd8f4):_0x3f7d4c[_0x43e7('0x120')](0x0,_0x50e4a1-_0xfd8f4)+_0x542dc2);}else{this['createSquareDetailsReport'][_0x43e7('0x6f')](this,_0x357193,rs[_0x43e7('0x11e')]({'charset':'*','length':_0x50e4a1}));}}else{this[_0x43e7('0x32')][_0x43e7('0x6f')](this,_0x357193,'');}}else{this[_0x43e7('0x32')][_0x43e7('0x6f')](this,_0x357193,_0x3f7d4c);}return _0x4f7501;};AGIVertices[_0x43e7('0xe')][_0x43e7('0xc')]=function(_0x215509){logger['info'](util['format'](_0x43e7('0x121'),_0x215509[_0x43e7('0x33')]));return this[_0x43e7('0xb')](_0x215509);};AGIVertices[_0x43e7('0xe')]['goal']=function(_0x35e832){logger[_0x43e7('0x2c')](util[_0x43e7('0x27')](_0x43e7('0x122'),_0x35e832[_0x43e7('0x33')]));this[_0x43e7('0x32')][_0x43e7('0x6f')](this,_0x35e832,_0x35e832['goalname']);return this[_0x43e7('0xd')]['noop'](util['format']('GOAL\x20%s',_0x35e832[_0x43e7('0x123')]));};AGIVertices[_0x43e7('0xe')][_0x43e7('0x124')]=function(_0x11aae6){logger[_0x43e7('0x2c')](util['format']('[AGI]\x20Enter\x20in\x20AWSPOLLY\x20(%s)\x20block',_0x11aae6[_0x43e7('0x33')]));if(!this['isConfigured'](_0x11aae6[_0x43e7('0x8b')])||!this['isConfigured'](_0x11aae6[_0x43e7('0x8c')])){return this[_0x43e7('0xd')][_0x43e7('0xa9')](_0x43e7('0x125'));}if(!this['isConfigured'](_0x11aae6['text'])){return this[_0x43e7('0xd')][_0x43e7('0xa9')]('no\x20text\x20configured');}this['channel'][_0x43e7('0xa9')](util[_0x43e7('0x27')](_0x43e7('0x126'),_0x11aae6[_0x43e7('0x59')]));var _0x764c70=this[_0x43e7('0x87')][_0x43e7('0x6f')](this,_0x11aae6);if(_0x764c70){this[_0x43e7('0xd')][_0x43e7('0xa9')](util[_0x43e7('0x27')]('aws\x20Polly\x20%s\x20file\x20created',_0x764c70));var _0x43bda1=this[_0x43e7('0xd')][_0x43e7('0x109')](_0x764c70);try{fs[_0x43e7('0x10a')](_0x764c70+'.wav');}catch(_0x17091a){logger['error'](_0x17091a);}return _0x43bda1;}return this[_0x43e7('0xd')][_0x43e7('0x2f')](_0x11aae6,_0x43e7('0x127'));};AGIVertices[_0x43e7('0xe')]['awslex']=function(_0x52928f){logger[_0x43e7('0x2c')](util['format'](_0x43e7('0x128'),_0x52928f[_0x43e7('0x33')]));if(!this[_0x43e7('0xa8')](_0x52928f[_0x43e7('0x8b')])||!this['isConfigured'](_0x52928f[_0x43e7('0x8c')])){return this[_0x43e7('0xd')]['noop']('no\x20valid\x20credentials\x20configured');}if(!this[_0x43e7('0xa8')](_0x52928f[_0x43e7('0x8e')])){return this[_0x43e7('0xd')][_0x43e7('0xa9')]('no\x20bot\x20name\x20configured');}if(!this['isConfigured'](_0x52928f[_0x43e7('0x59')])){return this[_0x43e7('0xd')][_0x43e7('0xa9')](_0x43e7('0xce'));}this[_0x43e7('0xd')][_0x43e7('0xee')]=!![];this[_0x43e7('0x32')](_0x52928f);this['createSquareMessage'](_0x52928f[_0x43e7('0x59')],'in','','');this[_0x43e7('0xd')][_0x43e7('0xa9')](util[_0x43e7('0x27')](_0x43e7('0x129'),_0x52928f[_0x43e7('0x59')]));var _0x43cf45=this[_0x43e7('0x8a')][_0x43e7('0x6f')](this,_0x52928f);if(_0x43cf45){for(var _0x2f24d4 in _0x43cf45){if(_0x43cf45[_0x43e7('0x96')](_0x2f24d4)&&_[_0x43e7('0x97')](_0x43cf45[_0x2f24d4])){this[_0x43e7('0xd')][_0x43e7('0x9f')](util[_0x43e7('0x27')](_0x43e7('0x12a'),_0x2f24d4[_0x43e7('0x68')]()),_0x43cf45[_0x2f24d4]);}}if(_['isNil'](_0x43cf45[_0x43e7('0x12b')])){return this[_0x43e7('0xd')][_0x43e7('0xa9')](_0x43e7('0x12c'));}else{this[_0x43e7('0x3e')](_0x43cf45['message'],_0x43e7('0xf2'),_0x43e7('0x12d'),'');return this[_0x43e7('0xd')][_0x43e7('0xa9')](util[_0x43e7('0x27')]('Amazon\x20Lex\x20Result\x20%s',_0x43cf45[_0x43e7('0x12b')]));}}return this['channel']['error'](_0x52928f,'Amazon\x20Lex\x20is\x20unreachable');};AGIVertices[_0x43e7('0xe')][_0x43e7('0x12e')]=function(_0x2a023c){logger['info'](util[_0x43e7('0x27')](_0x43e7('0x12f'),_0x2a023c['label'],_0x2a023c[_0x43e7('0x62')]));if(!this[_0x43e7('0xa8')](_0x2a023c['key'])){return this[_0x43e7('0xd')][_0x43e7('0xa9')](_0x43e7('0x130'));}var _0x3827a3=_0x43e7('0x131');var _0x57cc9e=util[_0x43e7('0x27')](_0x43e7('0x132'),FILES_PATH,rs[_0x43e7('0x11e')](0x4));var _0xd589e8=util[_0x43e7('0x27')]('%s.%s',_0x57cc9e,_0x3827a3);var _0x5b046d=!![];if(_0x2a023c['beep']===_0x43e7('0x133')){_0x5b046d=![];}var _0x2287b9=this[_0x43e7('0xd')][_0x43e7('0x134')](_0x57cc9e,_0x3827a3,_0x2a023c['intKey'],_0x2a023c[_0x43e7('0x62')],undefined,_0x5b046d);if(_0x2287b9[_0x43e7('0xab')]!==-0x1){this[_0x43e7('0xd')]['noop'](util[_0x43e7('0x27')]('google\x20%s\x20file\x20created',_0xd589e8));var _0x20ee93=this[_0x43e7('0x8f')][_0x43e7('0x6f')](this,_0x2a023c,_0xd589e8);if(_0x20ee93){for(var _0x40cc83 in _0x20ee93){if(_0x20ee93[_0x43e7('0x96')](_0x40cc83)){this[_0x43e7('0xd')][_0x43e7('0x9f')](util[_0x43e7('0x27')](_0x43e7('0x135'),_0x40cc83['toUpperCase']()),_0x20ee93[_0x40cc83]);}}return this[_0x43e7('0xd')][_0x43e7('0xa9')](util['format']('GoogleASR\x20Result\x20%s',JSON[_0x43e7('0x71')](_0x20ee93)));}}return _0x2287b9;};AGIVertices[_0x43e7('0xe')][_0x43e7('0x136')]=function(_0x31ef9c){logger[_0x43e7('0x2c')](util[_0x43e7('0x27')](_0x43e7('0x137'),_0x31ef9c[_0x43e7('0x33')]));if(!this[_0x43e7('0xa8')](_0x31ef9c[_0x43e7('0x92')])){return this[_0x43e7('0xd')]['noop'](_0x43e7('0x138'));}if(!this['isConfigured'](_0x31ef9c[_0x43e7('0x93')])){return this[_0x43e7('0xd')][_0x43e7('0xa9')](_0x43e7('0x139'));}var _0x58cba1=_0x43e7('0x131');var _0x43fc5b=util['format'](_0x43e7('0x132'),FILES_PATH,rs[_0x43e7('0x11e')](0x4));var _0x44b8f3=util[_0x43e7('0x27')](_0x43e7('0x9c'),_0x43fc5b,_0x58cba1);var _0x42cbe5=!![];if(_0x31ef9c[_0x43e7('0x13a')]==='NOBEEP'){_0x42cbe5=![];}var _0x29acad=this[_0x43e7('0xd')][_0x43e7('0x134')](_0x43fc5b,_0x58cba1,_0x31ef9c[_0x43e7('0x13b')],_0x31ef9c[_0x43e7('0x62')],undefined,_0x42cbe5);if(_0x29acad[_0x43e7('0xab')]!==-0x1){this[_0x43e7('0xd')][_0x43e7('0xa9')](util[_0x43e7('0x27')]('tilde\x20%s\x20file\x20created',_0x44b8f3));var _0x9050c8=this['tildeASR'][_0x43e7('0x6f')](this,_0x31ef9c,_0x44b8f3);if(_0x9050c8){for(var _0x2189f7 in _0x9050c8){if(_0x9050c8[_0x43e7('0x96')](_0x2189f7)){this[_0x43e7('0xd')][_0x43e7('0x9f')](util[_0x43e7('0x27')](_0x43e7('0x13c'),_0x2189f7['toUpperCase']()),_0x9050c8[_0x2189f7]);}}return this[_0x43e7('0xd')]['noop'](util['format'](_0x43e7('0x13d'),JSON['stringify'](_0x9050c8)));}}return _0x29acad;};AGIVertices['prototype'][_0x43e7('0x13e')]=function(_0x759eb5){logger[_0x43e7('0x2c')](util[_0x43e7('0x27')]('Enter\x20in\x20GOTO\x20(%s)\x20block',_0x759eb5[_0x43e7('0x33')]));return this['channel'][_0x43e7('0x13f')](_0x759eb5[_0x43e7('0x140')],_0x759eb5[_0x43e7('0x3a')],_0x759eb5[_0x43e7('0x3b')]);};AGIVertices[_0x43e7('0xe')]['gotoif']=function(_0x5e0c9a){logger[_0x43e7('0x2c')](util[_0x43e7('0x27')]('Enter\x20in\x20GOTOIF\x20(%s)\x20block',_0x5e0c9a[_0x43e7('0x33')]));if(!this[_0x43e7('0xa8')](_0x5e0c9a[_0x43e7('0x141')])){return this[_0x43e7('0xd')][_0x43e7('0x2f')](_0x5e0c9a,'no\x20condition\x20configured');}try{var _0x43b379=eval(_0x5e0c9a[_0x43e7('0x141')])?_0x43e7('0x142'):_0x43e7('0x143');this[_0x43e7('0xd')][_0x43e7('0xa9')](util[_0x43e7('0x27')]('EVAL\x20CONDITION\x20%s\x20%s',_0x5e0c9a[_0x43e7('0x141')],_0x43b379));return{'code':0xc8,'result':_0x43b379};}catch(_0x266119){return{'code':0xc8,'result':_0x43e7('0x143')};}};AGIVertices[_0x43e7('0xe')][_0x43e7('0x144')]=function(_0x1c5068){logger['info'](util[_0x43e7('0x27')](_0x43e7('0x145'),_0x1c5068[_0x43e7('0x33')]));if(!this[_0x43e7('0xa8')](_0x1c5068[_0x43e7('0x146')])){return this[_0x43e7('0xd')]['error'](_0x1c5068,'no\x20interval\x20configured');}var _0x2fed6f=this[_0x43e7('0x22')]['sync'](this,_0x1c5068['interval_id']);if(!_0x2fed6f){return this['channel'][_0x43e7('0x2f')](_0x1c5068,'no\x20intervals\x20found');}for(var _0x4f6ada=0x0;_0x4f6ada<_0x2fed6f[_0x43e7('0x9e')];_0x4f6ada+=0x1){var _0x2566bb=this[_0x43e7('0xd')]['getVariable'](util['format']('IFTIME(%s?true:false)',_0x2fed6f[_0x4f6ada]));if(_0x2566bb[_0x43e7('0xab')]===-0x1){return _0x2566bb;}logger[_0x43e7('0x2c')](util[_0x43e7('0x27')](_0x43e7('0x147'),_0x2fed6f[_0x4f6ada],_0x2566bb['extra']));if(_0x2566bb['extra']===_0x43e7('0x142')){logger[_0x43e7('0x2c')](util[_0x43e7('0x27')](_0x43e7('0x147'),_0x2fed6f[_0x4f6ada],_0x43e7('0x142')));this['channel'][_0x43e7('0xa9')](util[_0x43e7('0x27')](_0x43e7('0x147'),_0x2fed6f[_0x4f6ada],'true'));return{'code':0xc8,'result':'true'};}else{logger[_0x43e7('0x2c')](util[_0x43e7('0x27')](_0x43e7('0x147'),_0x2fed6f[_0x4f6ada],'false'));this['channel']['noop'](util[_0x43e7('0x27')](_0x43e7('0x147'),_0x2fed6f[_0x4f6ada],_0x43e7('0x143')));}}return{'code':0xc8,'result':_0x43e7('0x143')};};AGIVertices[_0x43e7('0xe')]['hangup']=function(_0x1a0e07){logger[_0x43e7('0x2c')](util['format'](_0x43e7('0x148'),_0x1a0e07[_0x43e7('0x33')]));return this[_0x43e7('0xd')][_0x43e7('0x149')]();};AGIVertices[_0x43e7('0xe')]['ispeechasr']=function(_0x2f779c){logger[_0x43e7('0x2c')](util[_0x43e7('0x27')](_0x43e7('0x14a'),_0x2f779c[_0x43e7('0x33')]));if(!this['isConfigured'](_0x2f779c[_0x43e7('0x78')])){return this[_0x43e7('0xd')][_0x43e7('0xa9')](_0x43e7('0x130'));}var _0x441bff=_0x43e7('0x131');var _0x164489=util[_0x43e7('0x27')](_0x43e7('0x132'),FILES_PATH,rs[_0x43e7('0x11e')](0x4));var _0x3b0fd9=util['format']('%s.%s',_0x164489,_0x441bff);var _0x16bde9=!![];if(_0x2f779c[_0x43e7('0x13a')]===_0x43e7('0x133')){_0x16bde9=![];}var _0x54f172=this[_0x43e7('0xd')]['recordFile'](_0x164489,_0x441bff,_0x2f779c[_0x43e7('0x13b')],_0x2f779c[_0x43e7('0x62')],undefined,_0x16bde9);if(_0x54f172['result']!==-0x1){this[_0x43e7('0xd')][_0x43e7('0xa9')](util[_0x43e7('0x27')](_0x43e7('0x14b'),_0x3b0fd9));var _0x245f41=this[_0x43e7('0x84')]['sync'](this,_0x2f779c,_0x3b0fd9);if(_0x245f41){for(var _0x4418f7 in _0x245f41){if(_0x245f41['hasOwnProperty'](_0x4418f7)){this[_0x43e7('0xd')][_0x43e7('0x9f')](util[_0x43e7('0x27')](_0x43e7('0x14c'),_0x4418f7['toUpperCase']()),_0x245f41[_0x4418f7]);}}return this[_0x43e7('0xd')]['noop'](util['format']('IspeechASR\x20Result\x20%s',JSON[_0x43e7('0x71')](_0x245f41)));}}return _0x54f172;};AGIVertices[_0x43e7('0xe')][_0x43e7('0x14d')]=function(_0xee437a){logger['info'](util[_0x43e7('0x27')](_0x43e7('0x14e'),_0xee437a[_0x43e7('0x33')]));if(!this[_0x43e7('0xa8')](_0xee437a[_0x43e7('0x78')])){return this['channel'][_0x43e7('0xa9')]('no\x20key\x20configured');}if(!this[_0x43e7('0xa8')](_0xee437a['text'])){return this[_0x43e7('0xd')][_0x43e7('0xa9')]('no\x20text\x20configured');}this[_0x43e7('0xd')][_0x43e7('0xa9')](util[_0x43e7('0x27')]('Trying\x20ispeech\x20TTS\x20%s',_0xee437a[_0x43e7('0x59')]));var _0x4e9660=this['ispeechTTS'][_0x43e7('0x6f')](this,_0xee437a);if(_0x4e9660){this['channel'][_0x43e7('0xa9')](util[_0x43e7('0x27')](_0x43e7('0x14b'),_0x4e9660));var _0x314ad0=this[_0x43e7('0xd')][_0x43e7('0x109')](_0x4e9660,_0xee437a[_0x43e7('0x13b')]);try{fs[_0x43e7('0x10a')](_0x4e9660+_0x43e7('0x14f'));}catch(_0x326728){logger[_0x43e7('0x2f')](_0x326728);}return _0x314ad0;}return this[_0x43e7('0xd')][_0x43e7('0x2f')](_0xee437a,_0x43e7('0x150'));};AGIVertices[_0x43e7('0xe')][_0x43e7('0x151')]=function(_0x2053aa){logger['info'](util['format'](_0x43e7('0x152'),_0x2053aa[_0x43e7('0x33')]));if(!this['isConfigured'](_0x2053aa[_0x43e7('0x153')])){return this[_0x43e7('0xd')]['error'](_0x2053aa,'no\x20find\x20by\x20configured');}logger[_0x43e7('0x2c')](util['format']('FIND\x20AGENT\x20%s\x20BY\x20%s',this[_0x43e7('0xd')]['callerid'],_0x2053aa[_0x43e7('0x153')]));var _0x6c6a87=this[_0x43e7('0x50')][_0x43e7('0x6f')](this,_0x2053aa[_0x43e7('0x153')]);if(_0x6c6a87){logger['info'](util[_0x43e7('0x27')](_0x43e7('0x154'),this[_0x43e7('0xd')][_0x43e7('0x38')],_0x2053aa[_0x43e7('0x153')]));this[_0x43e7('0xd')][_0x43e7('0xa9')](util['format']('AGENT\x20%s\x20FOUND\x20BY',this['channel'][_0x43e7('0x38')],_0x2053aa[_0x43e7('0x153')]));return{'code':0xc8,'result':'success'};}else{logger['info'](util[_0x43e7('0x27')](_0x43e7('0x155'),this[_0x43e7('0xd')][_0x43e7('0x38')],_0x2053aa[_0x43e7('0x153')]));this[_0x43e7('0xd')]['noop'](util[_0x43e7('0x27')](_0x43e7('0x155'),this[_0x43e7('0xd')][_0x43e7('0x38')],_0x2053aa['findBy']));return{'code':0xc8,'result':_0x43e7('0x156')};}};AGIVertices[_0x43e7('0xe')][_0x43e7('0x157')]=function(_0x310650){logger[_0x43e7('0x2c')](util[_0x43e7('0x27')]('Enter\x20in\x20LOGOUT\x20(%s)\x20block',_0x310650['label']));if(!this[_0x43e7('0xa8')](_0x310650[_0x43e7('0x153')])){return this['channel'][_0x43e7('0x2f')](_0x310650,_0x43e7('0x158'));}logger[_0x43e7('0x2c')](util[_0x43e7('0x27')](_0x43e7('0x159'),this[_0x43e7('0xd')][_0x43e7('0x38')],_0x310650[_0x43e7('0x153')]));var _0xe7efc9=this[_0x43e7('0x4f')]['sync'](this,_0x310650[_0x43e7('0x153')]);if(_0xe7efc9){logger[_0x43e7('0x2c')](util['format'](_0x43e7('0x154'),this[_0x43e7('0xd')][_0x43e7('0x38')],_0x310650[_0x43e7('0x153')]));this[_0x43e7('0xd')][_0x43e7('0xa9')](util['format']('AGENT\x20%s\x20FOUND\x20BY',this[_0x43e7('0xd')][_0x43e7('0x38')],_0x310650[_0x43e7('0x153')]));return{'code':0xc8,'result':_0x43e7('0x15a')};}else{logger[_0x43e7('0x2c')](util[_0x43e7('0x27')](_0x43e7('0x155'),this[_0x43e7('0xd')][_0x43e7('0x38')],_0x310650[_0x43e7('0x153')]));this[_0x43e7('0xd')][_0x43e7('0xa9')](util['format'](_0x43e7('0x155'),this[_0x43e7('0xd')][_0x43e7('0x38')],_0x310650['findBy']));return{'code':0xc8,'result':_0x43e7('0x156')};}};AGIVertices[_0x43e7('0xe')][_0x43e7('0x15b')]=function(_0x5459cc){logger['info'](util[_0x43e7('0x27')](_0x43e7('0x15c'),_0x5459cc[_0x43e7('0x33')]));if(!this['isConfigured'](_0x5459cc['operation'])){return this[_0x43e7('0xd')][_0x43e7('0x2f')](_0x5459cc,_0x43e7('0x15d'));}this[_0x43e7('0xd')]['noop'](util[_0x43e7('0x27')]('math\x20%s',_0x5459cc[_0x43e7('0x15e')]));var _0x262cc1=eval(_0x5459cc[_0x43e7('0x15e')]);if(!this[_0x43e7('0xa8')](_0x5459cc[_0x43e7('0xdc')])){return this[_0x43e7('0xd')][_0x43e7('0xa9')](_0x43e7('0xdd'));}var _0x3f86d0=this['getVariable']['sync'](this,_0x5459cc[_0x43e7('0xdc')]);if(!_0x3f86d0){return this[_0x43e7('0xd')]['error'](_0x5459cc,_0x43e7('0xde'));}if(_['isArray'](_0x262cc1)){var _0x76fd0=this;_0x262cc1[_0x43e7('0xdf')](function(_0xbd8c44,_0x2fba80){_0x76fd0[_0x43e7('0xd')][_0x43e7('0x9f')](util[_0x43e7('0x27')](_0x43e7('0x15f'),_0x3f86d0,_0x2fba80),_0xbd8c44);});return this[_0x43e7('0xd')][_0x43e7('0xa9')](util[_0x43e7('0x27')]('variable\x20%s[key]\x20set',_0x3f86d0));}else{return this[_0x43e7('0xd')][_0x43e7('0x9f')](_0x3f86d0,_0x262cc1);}};AGIVertices[_0x43e7('0xe')][_0x43e7('0xa')]=function(_0x3da446){logger[_0x43e7('0x2c')](util[_0x43e7('0x27')](_0x43e7('0x160'),_0x3da446[_0x43e7('0x33')]));if(_0x3da446['retry']===0x0){return this['maxRetry'](_0x3da446);}_0x3da446[_0x43e7('0xa5')]-=0x1;if(!this[_0x43e7('0xa8')](_0x3da446[_0x43e7('0x117')])){return this[_0x43e7('0xd')][_0x43e7('0x2f')](_0x3da446,_0x43e7('0x161'));}var _0x4a7185=this[_0x43e7('0x118')][_0x43e7('0x6f')](this,_0x3da446[_0x43e7('0x117')]);if(!_0x4a7185){return this['channel']['error'](_0x3da446,_0x43e7('0x162'));}var _0x2c5000=this['channel'][_0x43e7('0x119')](_0x4a7185,_0x3da446[_0x43e7('0x11a')],_0x3da446[_0x43e7('0x163')]);var _0x63bad=_0x2c5000['result'];if(_0x2c5000[_0x43e7('0xab')]===-0x1){this[_0x43e7('0x32')][_0x43e7('0x6f')](this,_0x3da446,'-1');return _0x2c5000;}else if(_0x2c5000['extra']===_0x43e7('0x62')){_0x2c5000[_0x43e7('0xab')]=_0x2c5000[_0x43e7('0xab')][_0x43e7('0x9e')]>0x0?_0x2c5000[_0x43e7('0xab')]:'t';}else if(_[_0x43e7('0x40')](_0x2c5000[_0x43e7('0xab')])){_0x2c5000[_0x43e7('0xab')]='#';_0x63bad='#';}if(!this[_0x43e7('0xa8')](_0x3da446[_0x43e7('0xdc')])){this['channel']['noop'](_0x43e7('0xdd'));}else{var _0x14f20e=this[_0x43e7('0xf')][_0x43e7('0x6f')](this,_0x3da446[_0x43e7('0xdc')]);if(!_0x14f20e){return this['channel'][_0x43e7('0x2f')](_0x3da446,_0x43e7('0xde'));}this[_0x43e7('0xd')][_0x43e7('0x9f')](_0x14f20e,_0x63bad);}this['createSquareDetailsReport']['sync'](this,_0x3da446,_0x63bad);return _0x2c5000;};AGIVertices[_0x43e7('0xe')][_0x43e7('0xa9')]=function(_0x356745){logger[_0x43e7('0x2c')](util[_0x43e7('0x27')]('Enter\x20in\x20NOOP\x20(%s)\x20block',_0x356745[_0x43e7('0x33')]));return this['channel']['noop'](_0x356745[_0x43e7('0x164')]||_0x356745['label']);};AGIVertices['prototype'][_0x43e7('0x165')]=function(_0x533ff1){logger['info'](util[_0x43e7('0x27')](_0x43e7('0x166'),_0x533ff1[_0x43e7('0x33')]));if(!this['isConfigured'](_0x533ff1[_0x43e7('0x153')])){return this[_0x43e7('0xd')][_0x43e7('0x2f')](_0x533ff1,_0x43e7('0x158'));}logger[_0x43e7('0x2c')](util[_0x43e7('0x27')](_0x43e7('0x159'),this['channel']['callerid'],_0x533ff1[_0x43e7('0x153')]));var _0x13373e=this[_0x43e7('0x4a')][_0x43e7('0x6f')](this,_0x533ff1[_0x43e7('0x167')]);var _0x10d4a6=this['agentPause'][_0x43e7('0x6f')](this,_0x533ff1[_0x43e7('0x153')],_0x13373e);if(_0x10d4a6){logger[_0x43e7('0x2c')](util[_0x43e7('0x27')](_0x43e7('0x154'),this['channel'][_0x43e7('0x38')],_0x533ff1[_0x43e7('0x153')]));this[_0x43e7('0xd')][_0x43e7('0xa9')](util['format'](_0x43e7('0x154'),this[_0x43e7('0xd')][_0x43e7('0x38')],_0x533ff1[_0x43e7('0x153')]));return{'code':0xc8,'result':_0x43e7('0x15a')};}else{logger[_0x43e7('0x2c')](util[_0x43e7('0x27')](_0x43e7('0x155'),this[_0x43e7('0xd')][_0x43e7('0x38')],_0x533ff1[_0x43e7('0x153')]));this[_0x43e7('0xd')][_0x43e7('0xa9')](util[_0x43e7('0x27')](_0x43e7('0x154'),this['channel'][_0x43e7('0x38')],_0x533ff1[_0x43e7('0x153')]));return{'code':0xc8,'result':'failure'};}};AGIVertices[_0x43e7('0xe')][_0x43e7('0x168')]=function(_0xbfea5a){logger[_0x43e7('0x2c')](util[_0x43e7('0x27')](_0x43e7('0x169'),_0xbfea5a['label']));if(!this['isConfigured'](_0xbfea5a[_0x43e7('0x117')])){return this[_0x43e7('0xd')][_0x43e7('0x2f')](_0xbfea5a,_0x43e7('0x161'));}var _0xeb8ae5=this['getSound'][_0x43e7('0x6f')](this,_0xbfea5a[_0x43e7('0x117')]);if(!_0xeb8ae5){return this[_0x43e7('0xd')][_0x43e7('0x2f')](_0xbfea5a,_0x43e7('0x162'));}var _0x5067aa=this[_0x43e7('0xd')]['exec'](_0x43e7('0x16a'),[_0xeb8ae5,_0xbfea5a['opts']]);if(_0x5067aa['result']===-0x1){return _0x5067aa;}return this[_0x43e7('0xd')][_0x43e7('0xa9')](util['format'](_0x43e7('0xc9'),_0x43e7('0x16a'),_0xeb8ae5));};AGIVertices[_0x43e7('0xe')][_0x43e7('0x16b')]=function(_0x279962){logger[_0x43e7('0x2c')](util[_0x43e7('0x27')]('Enter\x20in\x20QUEUE\x20(%s)\x20block',_0x279962[_0x43e7('0x33')]));if(!this[_0x43e7('0xa8')](_0x279962[_0x43e7('0x16c')])){return this[_0x43e7('0xd')][_0x43e7('0x2f')](_0x279962,_0x43e7('0x16d'));}var _0x2cb397='';var _0x5efc41=parseInt(_0x279962[_0x43e7('0x16c')],0xa);if(isNaN(_0x5efc41)){_0x2cb397=_0x279962[_0x43e7('0x16c')];}else{_0x2cb397=this[_0x43e7('0x16e')][_0x43e7('0x6f')](this,_0x279962[_0x43e7('0x16c')]);if(!_0x2cb397){return this[_0x43e7('0xd')][_0x43e7('0x2f')](_0x279962,_0x43e7('0x16f'));}}var _0x25211a='';if(this[_0x43e7('0xa8')](_0x279962['file_id'])){var _0x48af25=this[_0x43e7('0x118')][_0x43e7('0x6f')](this,_0x279962[_0x43e7('0x117')]);if(_0x48af25){_0x25211a=_0x48af25;}}this['createSquareDetailsReport'][_0x43e7('0x6f')](this,_0x279962,_0x2cb397);if(_0x279962[_0x43e7('0xeb')][_0x43e7('0x170')]('x')<0x0){_0x279962[_0x43e7('0xeb')]+='x';}if(_0x279962['opts'][_0x43e7('0x170')]('X')<0x0){_0x279962[_0x43e7('0xeb')]+='X';}this[_0x43e7('0xd')]['setVariable'](_0x43e7('0x171'),_0x2cb397?_0x2cb397[_0x43e7('0x172')]():'');var _0x49ca8e=this[_0x43e7('0xd')][_0x43e7('0x55')]('QUEUE',[_0x2cb397,_0x279962[_0x43e7('0xeb')],_0x279962[_0x43e7('0x61')],_0x25211a,_0x279962[_0x43e7('0x62')],_0x279962[_0x43e7('0x5')],_0x279962['macro'],_0x279962[_0x43e7('0x173')],'',_0x279962[_0x43e7('0x174')]]);if(_0x49ca8e[_0x43e7('0xab')]===-0x1){return _0x49ca8e;}return this[_0x43e7('0xd')][_0x43e7('0xa9')](util[_0x43e7('0x27')]('Executed\x20command\x20%s\x20%s',_0x43e7('0x175'),_0x2cb397));};AGIVertices[_0x43e7('0xe')]['record']=function(_0x29d378){logger[_0x43e7('0x2c')](util['format']('Enter\x20in\x20RECORD\x20(%s)\x20block',_0x29d378[_0x43e7('0x33')]));var _0x3e0a10=_0x29d378['recordingFormat']||_0x43e7('0x131');var _0x42e2bd=util[_0x43e7('0x27')](_0x43e7('0x176'),this[_0x43e7('0xd')]['uniqueid'],rs[_0x43e7('0x11e')](0x5));var _0x5544de=util[_0x43e7('0x27')](_0x43e7('0x177'),FILES_PATH,_0x42e2bd,_0x3e0a10);var _0x400d36=util[_0x43e7('0x27')](_0x43e7('0x132'),FILES_PATH,_0x42e2bd);this['createSquareRecording'][_0x43e7('0x6f')](this,_0x29d378,_0x42e2bd,_0x5544de);this[_0x43e7('0xd')][_0x43e7('0x9f')](_0x43e7('0x178'),_0x42e2bd);logger['info'](_0x43e7('0x179'),_0x400d36,_0x3e0a10,_0x29d378[_0x43e7('0x17a')],_0x29d378[_0x43e7('0x62')]);return this[_0x43e7('0xd')][_0x43e7('0x134')](_0x400d36,_0x3e0a10,_0x29d378[_0x43e7('0x17a')],_0x29d378[_0x43e7('0x62')],undefined,!![]);};AGIVertices[_0x43e7('0xe')][_0x43e7('0x17b')]=function(_0x3b5ce3){logger[_0x43e7('0x2c')](util[_0x43e7('0x27')](_0x43e7('0x17c'),_0x3b5ce3[_0x43e7('0x33')]));if(!this[_0x43e7('0xa8')](_0x3b5ce3[_0x43e7('0x61')])){return this['channel']['noop']('no\x20url\x20configured');}var _0x417af7=this[_0x43e7('0x60')][_0x43e7('0x6f')](this,_0x3b5ce3);logger['info'](util[_0x43e7('0x27')](_0x43e7('0x17d'),util[_0x43e7('0x17e')](_0x417af7,{'showHidden':![],'depth':null})));if(!this[_0x43e7('0xa8')](_0x3b5ce3['variable_id'])){return this[_0x43e7('0xd')][_0x43e7('0xa9')](_0x43e7('0x17f'));}var _0x485904=this[_0x43e7('0xf')][_0x43e7('0x6f')](this,_0x3b5ce3['variable_id']);if(!_0x485904){return this[_0x43e7('0xd')]['error'](_0x3b5ce3,'no\x20variable\x20found');}this[_0x43e7('0xd')]['setVariable'](util['format']('%s_STATUS_CODE',_0x485904),_0x417af7[_0x43e7('0x73')]?_0x417af7['statusCode']:_0x43e7('0x180'));this[_0x43e7('0xd')]['setVariable'](util[_0x43e7('0x27')](_0x43e7('0x181'),_0x485904),_0x417af7[_0x43e7('0x74')]?_0x417af7[_0x43e7('0x74')]:'OK');if(_0x417af7[_0x43e7('0x69')]){try{this[_0x43e7('0x9b')](_0x417af7[_0x43e7('0x69')],_0x485904);}catch(_0x649d9f){logger[_0x43e7('0x2f')](util[_0x43e7('0x27')](_0x43e7('0x182'),_0x485904));}}return this[_0x43e7('0xd')][_0x43e7('0xa9')](util['format']('variable\x20%s\x20set',_0x485904));};AGIVertices['prototype'][_0x43e7('0x183')]=function(_0x5b1ef3){logger[_0x43e7('0x2c')](util[_0x43e7('0x27')]('Enter\x20in\x20SAYDIGITS\x20(%s)\x20block',_0x5b1ef3[_0x43e7('0x33')]));return this[_0x43e7('0xd')][_0x43e7('0x184')](_0x5b1ef3[_0x43e7('0x185')][_0x43e7('0x186')](/\s+/g,''),_0x5b1ef3[_0x43e7('0x17a')]);};AGIVertices[_0x43e7('0xe')]['saynumber']=function(_0x47f1ed){logger[_0x43e7('0x2c')](util[_0x43e7('0x27')]('Enter\x20in\x20SAYNUMBER\x20(%s)\x20block',_0x47f1ed['label']));return this[_0x43e7('0xd')][_0x43e7('0x187')](_0x47f1ed[_0x43e7('0x63')][_0x43e7('0x186')](/\s+/g,''),_0x47f1ed[_0x43e7('0x17a')]);};AGIVertices['prototype'][_0x43e7('0x188')]=function(_0x50463a){logger[_0x43e7('0x2c')](util[_0x43e7('0x27')]('Enter\x20in\x20SAYPHONETIC\x20(%s)\x20block',_0x50463a['label']));return this[_0x43e7('0xd')][_0x43e7('0x189')](_0x50463a[_0x43e7('0x59')],_0x50463a[_0x43e7('0x17a')]);};AGIVertices[_0x43e7('0xe')][_0x43e7('0x18a')]=function(_0x82490c){logger[_0x43e7('0x2c')](util[_0x43e7('0x27')](_0x43e7('0x18b'),_0x82490c['label']));if(!this[_0x43e7('0xa8')](_0x82490c[_0x43e7('0x18c')])){return this[_0x43e7('0xd')][_0x43e7('0xa9')]('no\x20mail\x20account\x20configured');}var _0x12d098=this[_0x43e7('0x1e')]['sync'](this,_0x82490c[_0x43e7('0x18c')]);if(!_0x12d098||!_0x12d098[_0x43e7('0x18d')]){return this[_0x43e7('0xd')][_0x43e7('0x2f')](_0x82490c,_0x43e7('0x18e'));}var _0x5124d2={'from':util['format'](_0x43e7('0x18f'),_0x12d098[_0x43e7('0x12')],_0x12d098[_0x43e7('0x190')]||_0x12d098[_0x43e7('0x18d')][_0x43e7('0x191')]),'to':_0x82490c['to']||'','cc':_0x82490c['cc']||'','bcc':_0x82490c[_0x43e7('0x192')]||'','subject':_0x82490c[_0x43e7('0x193')],'html':_0x82490c[_0x43e7('0x59')],'text':_0x82490c[_0x43e7('0x59')]};if(this[_0x43e7('0xa8')](_0x82490c['template_id'])){}logger[_0x43e7('0xe3')](_0x43e7('0x194'),JSON[_0x43e7('0x71')](_0x5124d2));this['createSquareDetailsReport']['sync'](this,_0x82490c,_0x82490c[_0x43e7('0x18c')]);this['channel']['noop'](util['format']('Trying\x20SendMail\x20with\x20account\x20%s',_0x12d098[_0x43e7('0x12')]));this[_0x43e7('0x21')][_0x43e7('0x6f')](this,_0x12d098[_0x43e7('0x195')],_0x5124d2);return this[_0x43e7('0xd')][_0x43e7('0xa9')]('Mail\x20message\x20added\x20to\x20outgoing\x20process');};AGIVertices[_0x43e7('0xe')][_0x43e7('0x196')]=function(_0x3a829b){logger['info'](util[_0x43e7('0x27')](_0x43e7('0x197'),_0x3a829b[_0x43e7('0x33')]));return this[_0x43e7('0xd')][_0x43e7('0xa9')](_0x43e7('0x198'));};AGIVertices[_0x43e7('0xe')]['sendSMS']=function(_0x1907db){logger[_0x43e7('0x2c')](util[_0x43e7('0x27')]('Enter\x20in\x20SENDSMS\x20(%s)\x20block',_0x1907db['label']));if(!this[_0x43e7('0xa8')](_0x1907db['sms_account_id'])){return this[_0x43e7('0xd')][_0x43e7('0xa9')](_0x43e7('0x199'));}var _0x2028a2=this[_0x43e7('0x19a')]['sync'](this,_0x1907db[_0x43e7('0x19b')]);if(!_0x2028a2){return this[_0x43e7('0xd')][_0x43e7('0x2f')](_0x1907db,_0x43e7('0x19c'));}var _0x3b5210={'body':_0x1907db[_0x43e7('0x19d')],'phone':_0x1907db['to']||'','SmsAccountId':_0x2028a2['id']};logger[_0x43e7('0xe3')](_0x43e7('0x19e'),JSON[_0x43e7('0x71')](_0x3b5210));this[_0x43e7('0x32')][_0x43e7('0x6f')](this,_0x1907db,_0x1907db[_0x43e7('0x19b')]);this[_0x43e7('0xd')][_0x43e7('0xa9')](util[_0x43e7('0x27')](_0x43e7('0x19f'),_0x2028a2['name']));this[_0x43e7('0x31')][_0x43e7('0x6f')](this,_0x3b5210);return this[_0x43e7('0xd')][_0x43e7('0xa9')](_0x43e7('0x1a0'));};AGIVertices[_0x43e7('0xe')][_0x43e7('0x1a1')]=function(_0xd0cd39){logger[_0x43e7('0x2c')](util[_0x43e7('0x27')](_0x43e7('0x1a2'),_0xd0cd39[_0x43e7('0x33')]));if(!this[_0x43e7('0xa8')](_0xd0cd39[_0x43e7('0xdc')])){return this[_0x43e7('0xd')]['error'](_0xd0cd39,_0x43e7('0x1a3'));}var _0x43d11f=this['getVariable']['sync'](this,_0xd0cd39[_0x43e7('0xdc')]);if(!_0x43d11f){return this[_0x43e7('0xd')]['error'](_0xd0cd39,_0x43e7('0xde'));}return this[_0x43e7('0xd')][_0x43e7('0x9f')](_0x43d11f,_0xd0cd39[_0x43e7('0x1a4')]);};AGIVertices['prototype']['start']=function(_0x255b2c){logger[_0x43e7('0x2c')](util['format']('Enter\x20in\x20START\x20(%s)\x20block',_0x255b2c[_0x43e7('0x33')]));this[_0x43e7('0xd')][_0x43e7('0xa9')](_0x43e7('0x1a5'));var _0xf0f1bc=this[_0x43e7('0xd')][_0x43e7('0xf')](_0x43e7('0x1a6'));if(!_['isEmpty'](_0xf0f1bc['extra'])){this[_0x43e7('0xd')]['uniqueid']=_0xf0f1bc['extra'];}if(_0x255b2c['answer']===_0x43e7('0x1a7')){this[_0x43e7('0xd')][_0x43e7('0xa9')]('Answer');return this[_0x43e7('0xd')][_0x43e7('0xbb')]();}return this['channel'][_0x43e7('0xa9')](_0x43e7('0x1a8'));};AGIVertices[_0x43e7('0xe')][_0x43e7('0x1a9')]=function(_0x3e63dc){logger[_0x43e7('0x2c')](util[_0x43e7('0x27')](_0x43e7('0x1aa'),_0x3e63dc[_0x43e7('0x33')]));if(!this[_0x43e7('0xa8')](_0x3e63dc[_0x43e7('0x1ab')])){return this[_0x43e7('0xd')]['error'](_0x3e63dc,_0x43e7('0x1ac'));}var _0x3aaa9d=this[_0x43e7('0x1ad')][_0x43e7('0x6f')](this,_0x3e63dc['project_id']);if(!this[_0x43e7('0xa8')](_0x3aaa9d)){return this[_0x43e7('0xd')][_0x43e7('0x2f')](_0x3e63dc,util[_0x43e7('0x27')]('no\x20subproject\x20found\x20with\x20id\x20%d',_0x3e63dc[_0x43e7('0x1ab')]));}if(_0x3aaa9d===this[_0x43e7('0xd')][_0x43e7('0x35')]){return this[_0x43e7('0xd')][_0x43e7('0x2f')](_0x3e63dc,_0x43e7('0x1ae'));}this[_0x43e7('0x32')][_0x43e7('0x6f')](this,_0x3e63dc,_0x3aaa9d);var _0x50fffd=this[_0x43e7('0xd')][_0x43e7('0x55')](_0x43e7('0x1af'),util[_0x43e7('0x27')]('agi://%s/square,\x22%s\x22,\x22%s\x22',config[_0x43e7('0x5')][_0x43e7('0x1b0')]||_0x43e7('0x1b1'),_0x3aaa9d,this['channel'][_0x43e7('0x35')]));if(_0x50fffd['result']===-0x1){return _0x50fffd;}return this['channel'][_0x43e7('0xa9')](util[_0x43e7('0x27')](_0x43e7('0xc9'),_0x43e7('0x1af'),_0x3aaa9d));};AGIVertices[_0x43e7('0xe')][_0x43e7('0x1b2')]=function(_0x2fcea8){logger[_0x43e7('0x2c')](util['format']('Enter\x20in\x20SYSTEM\x20(%s)\x20block',_0x2fcea8[_0x43e7('0x33')]));var _0x31262a=this[_0x43e7('0x54')][_0x43e7('0x6f')](this,_0x2fcea8[_0x43e7('0xb9')]);this[_0x43e7('0x32')][_0x43e7('0x6f')](this,_0x2fcea8,_0x2fcea8['command']);if(this[_0x43e7('0xa8')](_0x2fcea8[_0x43e7('0xdc')])){var _0x446b98=this[_0x43e7('0xf')][_0x43e7('0x6f')](this,_0x2fcea8['variable_id']);if(_0x446b98){this['channel'][_0x43e7('0x9f')](_0x446b98,_0x31262a);return this[_0x43e7('0xd')]['noop'](util['format']('sh\x20command:\x20%s\x20result\x20on\x20variable:\x20%s',_0x2fcea8[_0x43e7('0xb9')],_0x446b98));}}return this[_0x43e7('0xd')][_0x43e7('0xa9')](util['format'](_0x43e7('0x1b3'),_0x2fcea8[_0x43e7('0xb9')]));};AGIVertices[_0x43e7('0xe')][_0x43e7('0x1b4')]=function(_0x47818e){logger[_0x43e7('0x2c')](util[_0x43e7('0x27')](_0x43e7('0x1b5'),_0x47818e[_0x43e7('0x33')]));_0x47818e[_0x43e7('0x59')]=_0x47818e[_0x43e7('0x59')][_0x43e7('0x186')](/(\r\n|\n|\r)/gm,'\x20');if(!this['isConfigured'](_0x47818e[_0x43e7('0x58')])){return this[_0x43e7('0xd')][_0x43e7('0xa9')](_0x43e7('0x1b6'));}if(!this[_0x43e7('0xa8')](_0x47818e[_0x43e7('0x59')])){return this['channel']['noop'](_0x43e7('0xce'));}this[_0x43e7('0xd')][_0x43e7('0xa9')](util[_0x43e7('0x27')](_0x43e7('0x1b7'),_0x47818e[_0x43e7('0x59')]));var _0x255cb6=this[_0x43e7('0x57')][_0x43e7('0x6f')](this,_0x47818e);if(_0x255cb6){this['channel'][_0x43e7('0xa9')](util[_0x43e7('0x27')](_0x43e7('0x1b8'),_0x255cb6));var _0x3002c7=this[_0x43e7('0xd')]['streamFile'](_0x255cb6);try{fs['unlink'](_0x255cb6+_0x43e7('0x14f'));}catch(_0x17ceb2){logger[_0x43e7('0x2f')](_0x17ceb2);}return _0x3002c7;}return this[_0x43e7('0xd')]['error'](_0x47818e,'Google\x20Cloud\x20TTS\x20is\x20unreachable');};AGIVertices['prototype'][_0x43e7('0x1b9')]=function(_0xd7893e){logger[_0x43e7('0x2c')](util[_0x43e7('0x27')](_0x43e7('0x1ba'),_0xd7893e[_0x43e7('0x33')]));_0xd7893e[_0x43e7('0x59')]=_0xd7893e[_0x43e7('0x59')][_0x43e7('0x186')](/(\r\n|\n|\r)/gm,'\x20');if(!this[_0x43e7('0xa8')](_0xd7893e[_0x43e7('0x59')])){return this['channel'][_0x43e7('0xa9')](_0x43e7('0xce'));}this[_0x43e7('0xd')][_0x43e7('0xa9')](util[_0x43e7('0x27')]('Trying\x20Google\x20TTS\x20%s',_0xd7893e[_0x43e7('0x59')]));var _0xe3503=this[_0x43e7('0x5f')][_0x43e7('0x6f')](this,_0xd7893e);if(_0xe3503){this[_0x43e7('0xd')][_0x43e7('0xa9')](util[_0x43e7('0x27')](_0x43e7('0x1bb'),_0xe3503));var _0x35d32b=this[_0x43e7('0xd')][_0x43e7('0x109')](_0xe3503);try{fs[_0x43e7('0x10a')](_0xe3503+'.wav');}catch(_0x5cdb03){logger[_0x43e7('0x2f')](_0x5cdb03);}return _0x35d32b;}return this[_0x43e7('0xd')][_0x43e7('0x2f')](_0xd7893e,_0x43e7('0x1bc'));};AGIVertices['prototype']['unpause']=function(_0x260f5f){logger[_0x43e7('0x2c')](util['format']('Enter\x20in\x20UNPAUSE\x20(%s)\x20block',_0x260f5f[_0x43e7('0x33')]));if(!this[_0x43e7('0xa8')](_0x260f5f[_0x43e7('0x153')])){return this[_0x43e7('0xd')][_0x43e7('0x2f')](_0x260f5f,'no\x20find\x20by\x20configured');}logger[_0x43e7('0x2c')](util[_0x43e7('0x27')]('FIND\x20AGENT\x20%s\x20BY\x20%s',this['channel']['callerid'],_0x260f5f[_0x43e7('0x153')]));var _0x4059b3=this['agentUnpause']['sync'](this,_0x260f5f[_0x43e7('0x153')]);if(_0x4059b3){logger[_0x43e7('0x2c')](util[_0x43e7('0x27')](_0x43e7('0x154'),this['channel'][_0x43e7('0x38')],_0x260f5f[_0x43e7('0x153')]));this[_0x43e7('0xd')][_0x43e7('0xa9')](util[_0x43e7('0x27')](_0x43e7('0x154'),this['channel'][_0x43e7('0x38')],_0x260f5f[_0x43e7('0x153')]));return{'code':0xc8,'result':_0x43e7('0x15a')};}else{logger[_0x43e7('0x2c')](util[_0x43e7('0x27')](_0x43e7('0x155'),this[_0x43e7('0xd')][_0x43e7('0x38')],_0x260f5f[_0x43e7('0x153')]));this['channel'][_0x43e7('0xa9')](util[_0x43e7('0x27')](_0x43e7('0x155'),this['channel'][_0x43e7('0x38')],_0x260f5f['findBy']));return{'code':0xc8,'result':_0x43e7('0x156')};}};AGIVertices[_0x43e7('0xe')][_0x43e7('0x1bd')]=function(_0x3572a1){logger[_0x43e7('0x2c')](util[_0x43e7('0x27')](_0x43e7('0x1be'),_0x3572a1[_0x43e7('0x33')]));var _0x48f3d8=this[_0x43e7('0xd')]['exec'](_0x43e7('0x1bf'),[_0x3572a1['mailbox'],_0x3572a1[_0x43e7('0x76')]]);if(_0x48f3d8['result']===-0x1){return _0x48f3d8;}return this[_0x43e7('0xd')][_0x43e7('0xa9')](util[_0x43e7('0x27')]('Executed\x20command\x20%s\x20%s','VOICEMAIL',_0x3572a1[_0x43e7('0x1c0')]));};AGIVertices['prototype'][_0x43e7('0x1c1')]=function(_0x518b33){logger[_0x43e7('0x2c')](util['format']('Enter\x20in\x20SWITCH\x20(%s)\x20block',_0x518b33[_0x43e7('0x33')]));if(!this['isConfigured'](_0x518b33[_0x43e7('0xdc')])){return this[_0x43e7('0xd')][_0x43e7('0x2f')](_0x518b33,'no\x20variable\x20selected');}var _0x1db40f=this[_0x43e7('0xf')][_0x43e7('0x6f')](this,_0x518b33[_0x43e7('0xdc')]);if(!_0x1db40f){return this['channel'][_0x43e7('0x2f')](_0x518b33,_0x43e7('0xde'));}var _0x1ffde1=this[_0x43e7('0xd')][_0x43e7('0xf')](_0x1db40f);return{'code':0xc8,'result':_0x1ffde1[_0x43e7('0xa1')]?_0x1ffde1['extra']:'-'};};String[_0x43e7('0xe')][_0x43e7('0x1c2')]=function(_0x26414b,_0x311b47){return this[_0x43e7('0xa0')](_0x26414b)['join'](_0x311b47);};module[_0x43e7('0x1c3')]=AGIVertices; \ No newline at end of file diff --git a/server/services/ami/acw/index.js b/server/services/ami/acw/index.js index 3d6f7ef..f48ba40 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 _0x7096=['syncHangupRequest','isUndefined','[%s][HANGUP:UNIQUEID]','linkedid','[%s][HANGUPATTENDEDTRANSFER:UNIQUEID]','[%s][HANGUPATTENDEDTRANSFER:LINKEDID]','isNil','transfereeuniqueid','secondtransfereruniqueid','transfertargetuniqueid','origtransfereruniqueid','[ACW][syncAttendedTransfer]\x20%s','[%s][BLINDTRANSFER:UNIQUEID]','stringify','transfereruniqueid','transfererlinkedid','[ACW][syncBlindTransfer]\x20%s','autopause','all','[%s][AUTOPAUSE][AGENT:%s][QUEUE:%]','[ACW][syncAgentRingNoAnswer]\x20%s','exports','moment','../../../config/logger','../rpc/user','../rpc/voiceAgentReport','voiceQueues','agents','timers','channels','agentconnect','syncAgentConnect','bind','hangup','syncHangup','agentringnoanswer','syncAgentRingNoAnswer','syncAttendedTransfer','blindtransfer','syncBlindTransfer','custom:agentConnectPreview','syncAgentConnectPreview','milliseconds','seconds','updateAcw','timer','uniqueid','then','info','[%s][UPDATE][ACWTIME:%s]','catch','[%s][UPDATE][ERRORS:%s]','finally','prototype','startAcw','interface','ACW','mandatoryDisposition','mandatoryDispositionPause','name','getAgent','voicePause','[%s][INPAUSE][AGENT:%s][QUEUE:%s]','[%s][START][AGENT:%s][QUEUE:%s]','attended','destlinkedid','savePause','[%s][TIMER:%s][AGENT:%s][QUEUE:%s]','acwTimeout','stopAcw','lastPauseAt','format','YYYY-MM-DD\x20HH:mm:ss','queue','error','[ACW][START]\x20%s','message','saveUnpause','update','[ACW][STOP]\x20Interface\x20%s\x20doesn\x27t\x20have\x20timer','[ACW][STOP]\x20%s','acw'];(function(_0x1ac595,_0x5d2081){var _0x455fff=function(_0x3043ee){while(--_0x3043ee){_0x1ac595['push'](_0x1ac595['shift']());}};_0x455fff(++_0x5d2081);}(_0x7096,0x10c));var _0x6709=function(_0x47b58b,_0x41a189){_0x47b58b=_0x47b58b-0x0;var _0x46bebe=_0x7096[_0x47b58b];return _0x46bebe;};'use strict';var _=require('lodash');var moment=require(_0x6709('0x0'));var ami=require('../ami');var logger=require(_0x6709('0x1'))('acw');var RpcUser=require(_0x6709('0x2'));var RpcVoiceAgentReport=require(_0x6709('0x3'));function Acw(_0x3e85e4){this[_0x6709('0x4')]=_0x3e85e4[_0x6709('0x4')];this[_0x6709('0x5')]=_0x3e85e4[_0x6709('0x5')];this[_0x6709('0x6')]=_0x3e85e4[_0x6709('0x6')];this[_0x6709('0x7')]={};ami['on'](_0x6709('0x8'),this[_0x6709('0x9')][_0x6709('0xa')](this));ami['on']('hanguprequest',this['syncHangupRequest'][_0x6709('0xa')](this));ami['on'](_0x6709('0xb'),this[_0x6709('0xc')][_0x6709('0xa')](this));ami['on'](_0x6709('0xd'),this[_0x6709('0xe')]['bind'](this));ami['on']('attendedtransfer',this[_0x6709('0xf')][_0x6709('0xa')](this));ami['on'](_0x6709('0x10'),this[_0x6709('0x11')][_0x6709('0xa')](this));ami['on'](_0x6709('0x12'),this[_0x6709('0x13')][_0x6709('0xa')](this));}function getDiff(_0x5a8ebb){var _0x78ce3=moment()[_0x6709('0x14')](0x0);var _0x4d5255=moment(_0x5a8ebb)[_0x6709('0x14')](0x0);return _0x78ce3['diff'](_0x4d5255,_0x6709('0x15'));}Acw['prototype'][_0x6709('0x16')]=function(_0x4bc059,_0x149233){var _0x28866a=this;var _0x95c0c2=getDiff(_0x28866a[_0x6709('0x6')][_0x4bc059]['lastPauseAt']);clearTimeout(_0x28866a['timers'][_0x4bc059]['timer']);_0x28866a[_0x6709('0x6')][_0x4bc059][_0x6709('0x17')]=![];return RpcVoiceAgentReport['update']({'acwtime':_0x95c0c2},_0x28866a[_0x6709('0x6')][_0x4bc059][_0x6709('0x18')],_0x4bc059)[_0x6709('0x19')](function(_0x5a3263){logger[_0x6709('0x1a')](_0x6709('0x1b'),_0x149233,_0x95c0c2,_0x5a3263);})[_0x6709('0x1c')](function(_0x27a27b){logger['error'](_0x6709('0x1d'),_0x149233,_0x27a27b);})[_0x6709('0x1e')](function(){delete _0x28866a[_0x6709('0x6')][_0x4bc059];});};Acw[_0x6709('0x1f')][_0x6709('0x20')]=function(_0x224e8a){try{var _0x45921e=this;var _0x17763d=this[_0x6709('0x7')][_0x224e8a][_0x6709('0x21')];var _0x2f3415=this[_0x6709('0x7')][_0x224e8a]['queue'];var _0x29f25f=this[_0x6709('0x4')][_0x2f3415];var _0x2bcc73=![];var _0x5c7982=_0x6709('0x22');if(_0x29f25f[_0x6709('0x23')]&&_0x29f25f[_0x6709('0x24')][_0x6709('0x25')]){_0x2bcc73=!![];_0x5c7982=_0x29f25f['mandatoryDispositionPause'][_0x6709('0x25')];}if(!_0x45921e[_0x6709('0x5')][_0x17763d]){return Promise['resolve']();}return RpcUser[_0x6709('0x26')](_0x45921e[_0x6709('0x5')][_0x17763d]['id'])['then'](function(_0x444b0e){if(!_0x444b0e||_0x444b0e[_0x6709('0x27')]){logger['info'](_0x6709('0x28'),_0x224e8a,_0x17763d,_0x2f3415);return;}logger['info'](_0x6709('0x29'),_0x224e8a,_0x17763d,_0x2f3415);var _0x3cd555=_0x45921e['channels'][_0x224e8a][_0x6709('0x2a')]&&_0x45921e['channels'][_0x224e8a][_0x6709('0x2b')]?_0x45921e[_0x6709('0x7')][_0x224e8a]['destlinkedid']:_0x224e8a;return RpcUser[_0x6709('0x2c')](_0x45921e['agents'][_0x17763d],_0x5c7982,_0x3cd555);})[_0x6709('0x19')](function(_0x135f46){if(_0x2bcc73||!_0x135f46){return;}_0x45921e['timers'][_0x17763d]={};logger['info'](_0x6709('0x2d'),_0x224e8a,_0x45921e[_0x6709('0x4')][_0x2f3415][_0x6709('0x2e')],_0x17763d,_0x2f3415);_0x45921e[_0x6709('0x6')][_0x17763d][_0x6709('0x17')]=setTimeout(_0x45921e[_0x6709('0x2f')][_0x6709('0xa')](_0x45921e,_0x17763d),_0x45921e[_0x6709('0x4')][_0x2f3415][_0x6709('0x2e')]*0x3e8);_0x45921e['timers'][_0x17763d][_0x6709('0x30')]=moment()[_0x6709('0x31')](_0x6709('0x32'));_0x45921e[_0x6709('0x6')][_0x17763d]['uniqueid']=_0x224e8a;_0x45921e[_0x6709('0x6')][_0x17763d][_0x6709('0x33')]=_0x2f3415;_0x45921e[_0x6709('0x6')][_0x17763d][_0x6709('0x16')]=_0x45921e['updateAcw'][_0x6709('0xa')](_0x45921e,_0x17763d,_0x224e8a);})[_0x6709('0x1c')](function(){logger['error'](_0x6709('0x2d'),_0x224e8a,_0x45921e[_0x6709('0x4')][_0x2f3415]['acwTimeout'],_0x17763d,_0x2f3415);})[_0x6709('0x1e')](function(){delete _0x45921e[_0x6709('0x7')][_0x224e8a];});}catch(_0x65d1b7){logger[_0x6709('0x34')](_0x6709('0x35'),_0x65d1b7[_0x6709('0x36')]);}};Acw[_0x6709('0x1f')]['stopAcw']=function(_0x1cd361){try{var _0x34df09=this;if(_0x34df09['timers'][_0x1cd361]){_0x34df09[_0x6709('0x6')][_0x1cd361][_0x6709('0x17')]=![];var _0x6b5f39=_0x34df09[_0x6709('0x6')][_0x1cd361][_0x6709('0x18')];var _0x1c12bb=_0x34df09['timers'][_0x1cd361][_0x6709('0x33')];var _0x557a9b=_0x34df09[_0x6709('0x4')][_0x1c12bb][_0x6709('0x2e')];logger[_0x6709('0x1a')]('[%s][TIMER][STOP][AGENT:%s]',_0x6b5f39,_0x1cd361);RpcUser[_0x6709('0x37')](this[_0x6709('0x5')][_0x1cd361]);RpcVoiceAgentReport[_0x6709('0x38')]({'acwtime':_0x557a9b,'agentacw':!![]},_0x6b5f39,_0x1cd361)[_0x6709('0x19')](function(_0x2a0948){logger[_0x6709('0x1a')](_0x6709('0x1b'),_0x6b5f39,_0x557a9b,_0x2a0948);})['catch'](function(_0x3233a0){logger[_0x6709('0x34')](_0x6709('0x1d'),_0x6b5f39,_0x3233a0);});}else{logger[_0x6709('0x34')](_0x6709('0x39'),_0x1cd361);if(_0x34df09[_0x6709('0x6')]){logger[_0x6709('0x1a')]('[ACW][TIMERS]',JSON['stringify'](_0x34df09[_0x6709('0x6')]));}}}catch(_0x3f0da1){logger[_0x6709('0x34')](_0x6709('0x3a'),_0x3f0da1['message']);}};Acw['prototype']['syncAgentConnect']=function(_0x3d4237){try{if(this[_0x6709('0x4')][_0x3d4237['queue']]&&(this[_0x6709('0x4')][_0x3d4237[_0x6709('0x33')]]['acw']||this['voiceQueues'][_0x3d4237[_0x6709('0x33')]][_0x6709('0x23')])){if(this[_0x6709('0x5')][_0x3d4237[_0x6709('0x21')]]){this[_0x6709('0x7')][_0x3d4237['uniqueid']]={'queue':_0x3d4237[_0x6709('0x33')],'interface':_0x3d4237['interface'],'destlinkedid':_0x3d4237[_0x6709('0x2b')]};}}}catch(_0x409b84){logger[_0x6709('0x34')]('[ACW][syncAgentConnect]\x20%s',_0x409b84[_0x6709('0x36')]);}};Acw['prototype']['syncAgentConnectPreview']=function(_0x22100d){try{if(this[_0x6709('0x4')][_0x22100d[_0x6709('0x33')]]&&(this[_0x6709('0x4')][_0x22100d[_0x6709('0x33')]][_0x6709('0x3b')]||this[_0x6709('0x4')][_0x22100d[_0x6709('0x33')]][_0x6709('0x23')])){if(this[_0x6709('0x5')][_0x22100d[_0x6709('0x21')]]){this[_0x6709('0x7')][_0x22100d[_0x6709('0x18')]]={'queue':_0x22100d[_0x6709('0x33')],'interface':_0x22100d[_0x6709('0x21')]};}}}catch(_0x4f82a0){logger[_0x6709('0x34')]('[ACW][syncAgentConnectPreview]\x20%s',_0x4f82a0['message']);}};Acw[_0x6709('0x1f')][_0x6709('0x3c')]=function(_0x483e15){try{if(this[_0x6709('0x7')][_0x483e15[_0x6709('0x18')]]&&_[_0x6709('0x3d')](this[_0x6709('0x7')][_0x483e15[_0x6709('0x18')]]['attended'])){logger[_0x6709('0x1a')](_0x6709('0x3e'),_0x483e15[_0x6709('0x18')]);this[_0x6709('0x20')](_0x483e15['uniqueid']);}else if(this[_0x6709('0x7')][_0x483e15['linkedid']]&&_[_0x6709('0x3d')](this[_0x6709('0x7')][_0x483e15[_0x6709('0x3f')]][_0x6709('0x2a')])){logger[_0x6709('0x1a')]('[%s][HANGUP:LINKEDID]',_0x483e15[_0x6709('0x3f')]);this[_0x6709('0x20')](_0x483e15[_0x6709('0x3f')]);}}catch(_0x199591){logger[_0x6709('0x34')]('[ACW][syncHangupRequest]\x20%s',_0x199591['message']);}};Acw[_0x6709('0x1f')]['syncHangup']=function(_0x4ec506){try{if(this[_0x6709('0x7')][_0x4ec506[_0x6709('0x18')]]&&this[_0x6709('0x7')][_0x4ec506[_0x6709('0x18')]][_0x6709('0x2a')]){logger[_0x6709('0x1a')](_0x6709('0x40'),_0x4ec506[_0x6709('0x18')]);this[_0x6709('0x20')](_0x4ec506[_0x6709('0x18')]);}else if(this[_0x6709('0x7')][_0x4ec506['linkedid']]&&this[_0x6709('0x7')][_0x4ec506[_0x6709('0x3f')]]['attended']){logger['info'](_0x6709('0x41'),_0x4ec506[_0x6709('0x3f')]);this[_0x6709('0x20')](_0x4ec506[_0x6709('0x3f')]);}}catch(_0x521e83){logger[_0x6709('0x34')]('[ACW][syncHangup]\x20%s',_0x521e83[_0x6709('0x36')]);}};Acw[_0x6709('0x1f')][_0x6709('0xf')]=function(_0xeec99c){try{if(!_[_0x6709('0x42')](this['channels'][_0xeec99c['transfereeuniqueid']])){this[_0x6709('0x20')](_0xeec99c[_0x6709('0x43')]);if(this['channels'][_0xeec99c[_0x6709('0x44')]]){this[_0x6709('0x7')][_0xeec99c['secondtransfereruniqueid']][_0x6709('0x2a')]=!![];this[_0x6709('0x7')][_0xeec99c[_0x6709('0x45')]]=this[_0x6709('0x7')][_0xeec99c['secondtransfereruniqueid']];delete this['channels'][_0xeec99c[_0x6709('0x44')]];}}else if(!_['isNil'](this[_0x6709('0x7')][_0xeec99c[_0x6709('0x45')]])){this[_0x6709('0x20')](_0xeec99c['transfertargetuniqueid']);if(this[_0x6709('0x7')][_0xeec99c['origtransfereruniqueid']]){this['channels'][_0xeec99c[_0x6709('0x46')]]['attended']=!![];this[_0x6709('0x7')][_0xeec99c['transfereeuniqueid']]=this[_0x6709('0x7')][_0xeec99c[_0x6709('0x46')]];delete this[_0x6709('0x7')][_0xeec99c[_0x6709('0x46')]];}}}catch(_0x5bc444){logger[_0x6709('0x34')](_0x6709('0x47'),_0x5bc444[_0x6709('0x36')]);}};Acw[_0x6709('0x1f')][_0x6709('0x11')]=function(_0x3d4d1c){try{if(this[_0x6709('0x7')][_0x3d4d1c['transfereruniqueid']]){logger[_0x6709('0x1a')](_0x6709('0x48'),JSON[_0x6709('0x49')](_0x3d4d1c[_0x6709('0x4a')]));this[_0x6709('0x20')](_0x3d4d1c[_0x6709('0x4a')]);}else if(this[_0x6709('0x7')][_0x3d4d1c[_0x6709('0x4b')]]){logger[_0x6709('0x1a')]('[%s][BLINDTRANSFER:LINKEDID]',JSON[_0x6709('0x49')](_0x3d4d1c[_0x6709('0x4b')]));this['startAcw'](_0x3d4d1c[_0x6709('0x4b')]);}}catch(_0x18b4fa){logger[_0x6709('0x34')](_0x6709('0x4c'),_0x18b4fa[_0x6709('0x36')]);}};Acw[_0x6709('0x1f')][_0x6709('0xe')]=function(_0x475449){try{if(this[_0x6709('0x4')][_0x475449['queue']]&&this[_0x6709('0x4')][_0x475449[_0x6709('0x33')]][_0x6709('0x4d')]===_0x6709('0x4e')){if(this[_0x6709('0x5')][_0x475449[_0x6709('0x21')]]){logger[_0x6709('0x1a')](_0x6709('0x4f'),_0x475449[_0x6709('0x18')],_0x475449[_0x6709('0x21')],_0x475449[_0x6709('0x33')]);return RpcUser['savePause'](this[_0x6709('0x5')][_0x475449['interface']],'Auto-Pause',_0x475449[_0x6709('0x18')]);}}}catch(_0xc65c7d){logger[_0x6709('0x34')](_0x6709('0x50'),_0xc65c7d[_0x6709('0x36')]);}};module[_0x6709('0x51')]=Acw; \ No newline at end of file +var _0x27a0=['linkedid','[%s][HANGUPATTENDEDTRANSFER:UNIQUEID]','[%s][HANGUPATTENDEDTRANSFER:LINKEDID]','[ACW][syncHangup]\x20%s','isNil','transfereeuniqueid','secondtransfereruniqueid','transfertargetuniqueid','origtransfereruniqueid','[ACW][syncAttendedTransfer]\x20%s','transfereruniqueid','[%s][BLINDTRANSFER:UNIQUEID]','transfererlinkedid','[%s][BLINDTRANSFER:LINKEDID]','[ACW][syncBlindTransfer]\x20%s','autopause','all','[%s][AUTOPAUSE][AGENT:%s][QUEUE:%]','savePause','Auto-Pause','exports','moment','../ami','../../../config/logger','acw','../rpc/user','agents','timers','channels','agentconnect','bind','hanguprequest','syncHangupRequest','hangup','syncHangup','syncAgentRingNoAnswer','attendedtransfer','syncAttendedTransfer','blindtransfer','syncBlindTransfer','custom:agentConnectPreview','syncAgentConnectPreview','milliseconds','diff','updateAcw','timer','update','uniqueid','then','[%s][UPDATE][ACWTIME:%s]','prototype','startAcw','interface','queue','ACW','mandatoryDisposition','mandatoryDispositionPause','name','resolve','getAgent','info','destlinkedid','[%s][TIMER:%s][AGENT:%s][QUEUE:%s]','voiceQueues','acwTimeout','stopAcw','format','YYYY-MM-DD\x20HH:mm:ss','catch','error','finally','[ACW][START]\x20%s','message','[%s][TIMER][STOP][AGENT:%s]','[%s][UPDATE][ERRORS:%s]','[ACW][STOP]\x20Interface\x20%s\x20doesn\x27t\x20have\x20timer','[ACW][TIMERS]','stringify','[ACW][STOP]\x20%s','syncAgentConnect','[ACW][syncAgentConnect]\x20%s','[ACW][syncAgentConnectPreview]\x20%s','isUndefined','[%s][HANGUP:UNIQUEID]','attended'];(function(_0x40a045,_0x516f0e){var _0x1a687c=function(_0x48c9fe){while(--_0x48c9fe){_0x40a045['push'](_0x40a045['shift']());}};_0x1a687c(++_0x516f0e);}(_0x27a0,0xbf));var _0x027a=function(_0x45767e,_0x144e19){_0x45767e=_0x45767e-0x0;var _0xae68f4=_0x27a0[_0x45767e];return _0xae68f4;};'use strict';var _=require('lodash');var moment=require(_0x027a('0x0'));var ami=require(_0x027a('0x1'));var logger=require(_0x027a('0x2'))(_0x027a('0x3'));var RpcUser=require(_0x027a('0x4'));var RpcVoiceAgentReport=require('../rpc/voiceAgentReport');function Acw(_0x58a58b){this['voiceQueues']=_0x58a58b['voiceQueues'];this[_0x027a('0x5')]=_0x58a58b[_0x027a('0x5')];this[_0x027a('0x6')]=_0x58a58b[_0x027a('0x6')];this[_0x027a('0x7')]={};ami['on'](_0x027a('0x8'),this['syncAgentConnect'][_0x027a('0x9')](this));ami['on'](_0x027a('0xa'),this[_0x027a('0xb')]['bind'](this));ami['on'](_0x027a('0xc'),this[_0x027a('0xd')][_0x027a('0x9')](this));ami['on']('agentringnoanswer',this[_0x027a('0xe')][_0x027a('0x9')](this));ami['on'](_0x027a('0xf'),this[_0x027a('0x10')][_0x027a('0x9')](this));ami['on'](_0x027a('0x11'),this[_0x027a('0x12')][_0x027a('0x9')](this));ami['on'](_0x027a('0x13'),this[_0x027a('0x14')][_0x027a('0x9')](this));}function getDiff(_0x52f5de){var _0xe64d3a=moment()[_0x027a('0x15')](0x0);var _0x2d27f8=moment(_0x52f5de)[_0x027a('0x15')](0x0);return _0xe64d3a[_0x027a('0x16')](_0x2d27f8,'seconds');}Acw['prototype'][_0x027a('0x17')]=function(_0x5cfc6d,_0x2b3870){var _0x559d13=this;var _0x432007=getDiff(_0x559d13['timers'][_0x5cfc6d]['lastPauseAt']);clearTimeout(_0x559d13['timers'][_0x5cfc6d][_0x027a('0x18')]);_0x559d13[_0x027a('0x6')][_0x5cfc6d][_0x027a('0x18')]=![];return RpcVoiceAgentReport[_0x027a('0x19')]({'acwtime':_0x432007},_0x559d13['timers'][_0x5cfc6d][_0x027a('0x1a')],_0x5cfc6d)[_0x027a('0x1b')](function(_0x4ad813){logger['info'](_0x027a('0x1c'),_0x2b3870,_0x432007,_0x4ad813);})['catch'](function(_0x1d4a7a){logger['error']('[%s][UPDATE][ERRORS:%s]',_0x2b3870,_0x1d4a7a);})['finally'](function(){delete _0x559d13['timers'][_0x5cfc6d];});};Acw[_0x027a('0x1d')][_0x027a('0x1e')]=function(_0x266c9e){try{var _0xdf8756=this;var _0x51b870=this[_0x027a('0x7')][_0x266c9e][_0x027a('0x1f')];var _0x20e2da=this[_0x027a('0x7')][_0x266c9e][_0x027a('0x20')];var _0x3bbd46=this['voiceQueues'][_0x20e2da];var _0x27741f=![];var _0x5c281f=_0x027a('0x21');if(_0x3bbd46[_0x027a('0x22')]&&_0x3bbd46[_0x027a('0x23')][_0x027a('0x24')]){_0x27741f=!![];_0x5c281f=_0x3bbd46['mandatoryDispositionPause']['name'];}if(!_0xdf8756[_0x027a('0x5')][_0x51b870]){return Promise[_0x027a('0x25')]();}return RpcUser[_0x027a('0x26')](_0xdf8756[_0x027a('0x5')][_0x51b870]['id'])['then'](function(_0x1b5325){if(!_0x1b5325||_0x1b5325['voicePause']){logger[_0x027a('0x27')]('[%s][INPAUSE][AGENT:%s][QUEUE:%s]',_0x266c9e,_0x51b870,_0x20e2da);return;}logger[_0x027a('0x27')]('[%s][START][AGENT:%s][QUEUE:%s]',_0x266c9e,_0x51b870,_0x20e2da);var _0x578ea5=_0xdf8756[_0x027a('0x7')][_0x266c9e]['attended']&&_0xdf8756['channels'][_0x266c9e][_0x027a('0x28')]?_0xdf8756['channels'][_0x266c9e][_0x027a('0x28')]:_0x266c9e;return RpcUser['savePause'](_0xdf8756[_0x027a('0x5')][_0x51b870],_0x5c281f,_0x578ea5);})[_0x027a('0x1b')](function(_0x4d9a29){if(_0x27741f||!_0x4d9a29){return;}_0xdf8756[_0x027a('0x6')][_0x51b870]={};logger['info'](_0x027a('0x29'),_0x266c9e,_0xdf8756[_0x027a('0x2a')][_0x20e2da][_0x027a('0x2b')],_0x51b870,_0x20e2da);_0xdf8756[_0x027a('0x6')][_0x51b870][_0x027a('0x18')]=setTimeout(_0xdf8756[_0x027a('0x2c')]['bind'](_0xdf8756,_0x51b870),_0xdf8756[_0x027a('0x2a')][_0x20e2da]['acwTimeout']*0x3e8);_0xdf8756[_0x027a('0x6')][_0x51b870]['lastPauseAt']=moment()[_0x027a('0x2d')](_0x027a('0x2e'));_0xdf8756[_0x027a('0x6')][_0x51b870][_0x027a('0x1a')]=_0x266c9e;_0xdf8756[_0x027a('0x6')][_0x51b870]['queue']=_0x20e2da;_0xdf8756[_0x027a('0x6')][_0x51b870][_0x027a('0x17')]=_0xdf8756[_0x027a('0x17')][_0x027a('0x9')](_0xdf8756,_0x51b870,_0x266c9e);})[_0x027a('0x2f')](function(){logger[_0x027a('0x30')](_0x027a('0x29'),_0x266c9e,_0xdf8756[_0x027a('0x2a')][_0x20e2da][_0x027a('0x2b')],_0x51b870,_0x20e2da);})[_0x027a('0x31')](function(){delete _0xdf8756[_0x027a('0x7')][_0x266c9e];});}catch(_0x5e2d2a){logger[_0x027a('0x30')](_0x027a('0x32'),_0x5e2d2a[_0x027a('0x33')]);}};Acw[_0x027a('0x1d')][_0x027a('0x2c')]=function(_0x163dce){try{var _0x2378b9=this;if(_0x2378b9['timers'][_0x163dce]){_0x2378b9[_0x027a('0x6')][_0x163dce][_0x027a('0x18')]=![];var _0xb646de=_0x2378b9['timers'][_0x163dce][_0x027a('0x1a')];var _0x5b7602=_0x2378b9[_0x027a('0x6')][_0x163dce][_0x027a('0x20')];var _0x308e04=_0x2378b9['voiceQueues'][_0x5b7602]['acwTimeout'];logger[_0x027a('0x27')](_0x027a('0x34'),_0xb646de,_0x163dce);RpcUser['saveUnpause'](this[_0x027a('0x5')][_0x163dce]);RpcVoiceAgentReport[_0x027a('0x19')]({'acwtime':_0x308e04,'agentacw':!![]},_0xb646de,_0x163dce)[_0x027a('0x1b')](function(_0x1b173e){logger[_0x027a('0x27')](_0x027a('0x1c'),_0xb646de,_0x308e04,_0x1b173e);})[_0x027a('0x2f')](function(_0x1866b9){logger[_0x027a('0x30')](_0x027a('0x35'),_0xb646de,_0x1866b9);});}else{logger[_0x027a('0x30')](_0x027a('0x36'),_0x163dce);if(_0x2378b9[_0x027a('0x6')]){logger[_0x027a('0x27')](_0x027a('0x37'),JSON[_0x027a('0x38')](_0x2378b9[_0x027a('0x6')]));}}}catch(_0x5a3dee){logger[_0x027a('0x30')](_0x027a('0x39'),_0x5a3dee[_0x027a('0x33')]);}};Acw[_0x027a('0x1d')][_0x027a('0x3a')]=function(_0x24d370){try{if(this['voiceQueues'][_0x24d370[_0x027a('0x20')]]&&(this[_0x027a('0x2a')][_0x24d370['queue']][_0x027a('0x3')]||this['voiceQueues'][_0x24d370['queue']][_0x027a('0x22')])){if(this['agents'][_0x24d370[_0x027a('0x1f')]]){this[_0x027a('0x7')][_0x24d370[_0x027a('0x1a')]]={'queue':_0x24d370[_0x027a('0x20')],'interface':_0x24d370[_0x027a('0x1f')],'destlinkedid':_0x24d370['destlinkedid']};}}}catch(_0x30e89f){logger[_0x027a('0x30')](_0x027a('0x3b'),_0x30e89f['message']);}};Acw['prototype']['syncAgentConnectPreview']=function(_0x5852bf){try{if(this[_0x027a('0x2a')][_0x5852bf[_0x027a('0x20')]]&&(this[_0x027a('0x2a')][_0x5852bf[_0x027a('0x20')]][_0x027a('0x3')]||this[_0x027a('0x2a')][_0x5852bf['queue']]['mandatoryDisposition'])){if(this[_0x027a('0x5')][_0x5852bf[_0x027a('0x1f')]]){this[_0x027a('0x7')][_0x5852bf[_0x027a('0x1a')]]={'queue':_0x5852bf[_0x027a('0x20')],'interface':_0x5852bf[_0x027a('0x1f')]};}}}catch(_0x235a38){logger[_0x027a('0x30')](_0x027a('0x3c'),_0x235a38['message']);}};Acw[_0x027a('0x1d')][_0x027a('0xb')]=function(_0x37be38){try{if(this[_0x027a('0x7')][_0x37be38[_0x027a('0x1a')]]&&_[_0x027a('0x3d')](this[_0x027a('0x7')][_0x37be38[_0x027a('0x1a')]]['attended'])){logger[_0x027a('0x27')](_0x027a('0x3e'),_0x37be38['uniqueid']);this[_0x027a('0x1e')](_0x37be38[_0x027a('0x1a')]);}else if(this['channels'][_0x37be38['linkedid']]&&_['isUndefined'](this[_0x027a('0x7')][_0x37be38['linkedid']][_0x027a('0x3f')])){logger['info']('[%s][HANGUP:LINKEDID]',_0x37be38['linkedid']);this['startAcw'](_0x37be38[_0x027a('0x40')]);}}catch(_0x352479){logger['error']('[ACW][syncHangupRequest]\x20%s',_0x352479[_0x027a('0x33')]);}};Acw[_0x027a('0x1d')][_0x027a('0xd')]=function(_0x42bef1){try{if(this['channels'][_0x42bef1[_0x027a('0x1a')]]&&this['channels'][_0x42bef1[_0x027a('0x1a')]][_0x027a('0x3f')]){logger[_0x027a('0x27')](_0x027a('0x41'),_0x42bef1[_0x027a('0x1a')]);this[_0x027a('0x1e')](_0x42bef1[_0x027a('0x1a')]);}else if(this[_0x027a('0x7')][_0x42bef1['linkedid']]&&this[_0x027a('0x7')][_0x42bef1[_0x027a('0x40')]][_0x027a('0x3f')]){logger[_0x027a('0x27')](_0x027a('0x42'),_0x42bef1[_0x027a('0x40')]);this[_0x027a('0x1e')](_0x42bef1['linkedid']);}}catch(_0xabd56e){logger[_0x027a('0x30')](_0x027a('0x43'),_0xabd56e[_0x027a('0x33')]);}};Acw[_0x027a('0x1d')][_0x027a('0x10')]=function(_0x44c12b){try{if(!_[_0x027a('0x44')](this[_0x027a('0x7')][_0x44c12b[_0x027a('0x45')]])){this[_0x027a('0x1e')](_0x44c12b[_0x027a('0x45')]);if(this[_0x027a('0x7')][_0x44c12b[_0x027a('0x46')]]){this[_0x027a('0x7')][_0x44c12b['secondtransfereruniqueid']][_0x027a('0x3f')]=!![];this[_0x027a('0x7')][_0x44c12b[_0x027a('0x47')]]=this[_0x027a('0x7')][_0x44c12b[_0x027a('0x46')]];delete this[_0x027a('0x7')][_0x44c12b[_0x027a('0x46')]];}}else if(!_[_0x027a('0x44')](this[_0x027a('0x7')][_0x44c12b['transfertargetuniqueid']])){this['startAcw'](_0x44c12b['transfertargetuniqueid']);if(this['channels'][_0x44c12b[_0x027a('0x48')]]){this[_0x027a('0x7')][_0x44c12b[_0x027a('0x48')]][_0x027a('0x3f')]=!![];this[_0x027a('0x7')][_0x44c12b['transfereeuniqueid']]=this['channels'][_0x44c12b[_0x027a('0x48')]];delete this['channels'][_0x44c12b['origtransfereruniqueid']];}}}catch(_0x364a8b){logger[_0x027a('0x30')](_0x027a('0x49'),_0x364a8b[_0x027a('0x33')]);}};Acw[_0x027a('0x1d')][_0x027a('0x12')]=function(_0xc28a){try{if(this[_0x027a('0x7')][_0xc28a[_0x027a('0x4a')]]){logger['info'](_0x027a('0x4b'),JSON[_0x027a('0x38')](_0xc28a[_0x027a('0x4a')]));this[_0x027a('0x1e')](_0xc28a[_0x027a('0x4a')]);}else if(this[_0x027a('0x7')][_0xc28a[_0x027a('0x4c')]]){logger[_0x027a('0x27')](_0x027a('0x4d'),JSON[_0x027a('0x38')](_0xc28a[_0x027a('0x4c')]));this[_0x027a('0x1e')](_0xc28a[_0x027a('0x4c')]);}}catch(_0x1f547f){logger['error'](_0x027a('0x4e'),_0x1f547f[_0x027a('0x33')]);}};Acw[_0x027a('0x1d')][_0x027a('0xe')]=function(_0x51afb8){try{if(this['voiceQueues'][_0x51afb8[_0x027a('0x20')]]&&this[_0x027a('0x2a')][_0x51afb8[_0x027a('0x20')]][_0x027a('0x4f')]===_0x027a('0x50')){if(this[_0x027a('0x5')][_0x51afb8[_0x027a('0x1f')]]){logger[_0x027a('0x27')](_0x027a('0x51'),_0x51afb8['uniqueid'],_0x51afb8[_0x027a('0x1f')],_0x51afb8[_0x027a('0x20')]);return RpcUser[_0x027a('0x52')](this['agents'][_0x51afb8[_0x027a('0x1f')]],_0x027a('0x53'),_0x51afb8['uniqueid']);}}}catch(_0x894c26){logger[_0x027a('0x30')]('[ACW][syncAgentRingNoAnswer]\x20%s',_0x894c26['message']);}};module[_0x027a('0x54')]=Acw; \ No newline at end of file diff --git a/server/services/ami/ami.js b/server/services/ami/ami.js index 80b8093..7b199f3 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 _0xf0aa=['error','format','Manager\x20\x22%s\x22\x20error\x20to\x20%s:%s\x20with:\x0a%s','username','inspect','Manager\x20\x22%s\x22\x20closed\x20to\x20%s:%s','actionSipShowRegistry','Action','sipshowregistry','actionDeviceStateList','devicestatelist','actionSipPeerStatus','actionQueueSummary','actionCoreShowChannels','info','Manager\x20\x22%s\x22\x20logged\x20on\x20to\x20%s:%s','once','close','connect','shutdown','Shutdown\x20\x22%s\x22\x20to\x20%s:%s\x20with:\x0a%s','fullybooted','Fullybooted\x20\x22%s\x22\x20to\x20%s:%s','resolve','then','catch','[ami.js][fullybooted]','exports','bluebird','../../config/logger','ami','../../config/environment','asterisk','port','password','keepConnected','promisify','action'];(function(_0x28d111,_0x591d2e){var _0x173a3f=function(_0xb54650){while(--_0xb54650){_0x28d111['push'](_0x28d111['shift']());}};_0x173a3f(++_0x591d2e);}(_0xf0aa,0x68));var _0xaf0a=function(_0x19e294,_0x4ded18){_0x19e294=_0x19e294-0x0;var _0x66bd74=_0xf0aa[_0x19e294];return _0x66bd74;};'use strict';var Manager=require('asterisk-manager');var BPromise=require(_0xaf0a('0x0'));var util=require('util');var logger=require(_0xaf0a('0x1'))(_0xaf0a('0x2'));var config=require(_0xaf0a('0x3'));var ami=new Manager(config[_0xaf0a('0x4')][_0xaf0a('0x5')],config[_0xaf0a('0x4')]['ip'],config[_0xaf0a('0x4')]['username'],config[_0xaf0a('0x4')][_0xaf0a('0x6')],!![]);ami[_0xaf0a('0x7')]();ami['Action']=BPromise[_0xaf0a('0x8')](ami[_0xaf0a('0x9')]);function error(_0x2aac1c){logger[_0xaf0a('0xa')](util[_0xaf0a('0xb')](_0xaf0a('0xc'),config['asterisk'][_0xaf0a('0xd')],config[_0xaf0a('0x4')]['ip'],config[_0xaf0a('0x4')][_0xaf0a('0x5')],util[_0xaf0a('0xe')](_0x2aac1c,![],null)));}function close(){logger[_0xaf0a('0xa')](util[_0xaf0a('0xb')](_0xaf0a('0xf'),config[_0xaf0a('0x4')]['username'],config[_0xaf0a('0x4')]['ip'],config[_0xaf0a('0x4')][_0xaf0a('0x5')]));}ami[_0xaf0a('0x10')]=function(){return function(){return ami[_0xaf0a('0x11')]({'action':_0xaf0a('0x12')});};};ami[_0xaf0a('0x13')]=function(){return function(){return ami['Action']({'action':_0xaf0a('0x14')});};};ami[_0xaf0a('0x15')]=function(){return function(){return ami['Action']({'action':'sippeerstatus'});};};ami[_0xaf0a('0x16')]=function(){return function(){return ami[_0xaf0a('0x11')]({'action':'queuesummary'});};};ami[_0xaf0a('0x17')]=function(){return function(){return ami[_0xaf0a('0x11')]({'action':'coreshowchannels'});};};function connect(){logger[_0xaf0a('0x18')](util[_0xaf0a('0xb')](_0xaf0a('0x19'),config[_0xaf0a('0x4')][_0xaf0a('0xd')],config[_0xaf0a('0x4')]['ip'],config[_0xaf0a('0x4')][_0xaf0a('0x5')]));ami[_0xaf0a('0x1a')]('error',error);ami[_0xaf0a('0x1a')](_0xaf0a('0x1b'),close);}ami['on'](_0xaf0a('0x1c'),connect);ami['on'](_0xaf0a('0x1d'),function(_0x14168d){logger['info'](util['format'](_0xaf0a('0x1e'),config['asterisk'][_0xaf0a('0xd')],config[_0xaf0a('0x4')]['ip'],config[_0xaf0a('0x4')][_0xaf0a('0x5')],util['inspect'](_0x14168d,![],null)));});ami['on'](_0xaf0a('0x1f'),function(){logger[_0xaf0a('0x18')](util['format'](_0xaf0a('0x20'),config[_0xaf0a('0x4')][_0xaf0a('0xd')],config[_0xaf0a('0x4')]['ip'],config[_0xaf0a('0x4')][_0xaf0a('0x5')]));return Promise[_0xaf0a('0x21')]()[_0xaf0a('0x22')](ami[_0xaf0a('0x10')]())[_0xaf0a('0x22')](ami['actionDeviceStateList']())[_0xaf0a('0x22')](ami[_0xaf0a('0x15')]())['then'](ami[_0xaf0a('0x16')]())[_0xaf0a('0x22')](ami[_0xaf0a('0x17')]())[_0xaf0a('0x23')](function(_0x1759fc){logger[_0xaf0a('0xa')](_0xaf0a('0x24'),util[_0xaf0a('0xe')](_0x1759fc,{'showHidden':![],'depth':null}));});});ami[_0xaf0a('0x1a')]('error',error);ami['once'](_0xaf0a('0x1b'),close);module[_0xaf0a('0x25')]=ami; \ No newline at end of file +var _0xcaf4=['then','catch','[ami.js][fullybooted]','close','asterisk-manager','util','../../config/logger','../../config/environment','asterisk','port','username','Action','promisify','error','Manager\x20\x22%s\x22\x20error\x20to\x20%s:%s\x20with:\x0a%s','inspect','format','Manager\x20\x22%s\x22\x20closed\x20to\x20%s:%s','sipshowregistry','actionDeviceStateList','devicestatelist','actionSipPeerStatus','sippeerstatus','actionQueueSummary','actionCoreShowChannels','coreshowchannels','info','Manager\x20\x22%s\x22\x20logged\x20on\x20to\x20%s:%s','once','connect','shutdown','Shutdown\x20\x22%s\x22\x20to\x20%s:%s\x20with:\x0a%s','fullybooted','Fullybooted\x20\x22%s\x22\x20to\x20%s:%s','resolve','actionSipShowRegistry'];(function(_0x5df312,_0x4f350d){var _0x398335=function(_0x45e843){while(--_0x45e843){_0x5df312['push'](_0x5df312['shift']());}};_0x398335(++_0x4f350d);}(_0xcaf4,0x100));var _0x4caf=function(_0x41260d,_0x8e3565){_0x41260d=_0x41260d-0x0;var _0x3d095d=_0xcaf4[_0x41260d];return _0x3d095d;};'use strict';var Manager=require(_0x4caf('0x0'));var BPromise=require('bluebird');var util=require(_0x4caf('0x1'));var logger=require(_0x4caf('0x2'))('ami');var config=require(_0x4caf('0x3'));var ami=new Manager(config[_0x4caf('0x4')][_0x4caf('0x5')],config[_0x4caf('0x4')]['ip'],config[_0x4caf('0x4')][_0x4caf('0x6')],config[_0x4caf('0x4')]['password'],!![]);ami['keepConnected']();ami[_0x4caf('0x7')]=BPromise[_0x4caf('0x8')](ami['action']);function error(_0x4a58aa){logger[_0x4caf('0x9')](util['format'](_0x4caf('0xa'),config[_0x4caf('0x4')][_0x4caf('0x6')],config[_0x4caf('0x4')]['ip'],config[_0x4caf('0x4')][_0x4caf('0x5')],util[_0x4caf('0xb')](_0x4a58aa,![],null)));}function close(){logger[_0x4caf('0x9')](util[_0x4caf('0xc')](_0x4caf('0xd'),config[_0x4caf('0x4')][_0x4caf('0x6')],config[_0x4caf('0x4')]['ip'],config[_0x4caf('0x4')]['port']));}ami['actionSipShowRegistry']=function(){return function(){return ami['Action']({'action':_0x4caf('0xe')});};};ami[_0x4caf('0xf')]=function(){return function(){return ami[_0x4caf('0x7')]({'action':_0x4caf('0x10')});};};ami[_0x4caf('0x11')]=function(){return function(){return ami['Action']({'action':_0x4caf('0x12')});};};ami[_0x4caf('0x13')]=function(){return function(){return ami[_0x4caf('0x7')]({'action':'queuesummary'});};};ami[_0x4caf('0x14')]=function(){return function(){return ami[_0x4caf('0x7')]({'action':_0x4caf('0x15')});};};function connect(){logger[_0x4caf('0x16')](util[_0x4caf('0xc')](_0x4caf('0x17'),config['asterisk'][_0x4caf('0x6')],config[_0x4caf('0x4')]['ip'],config[_0x4caf('0x4')][_0x4caf('0x5')]));ami[_0x4caf('0x18')](_0x4caf('0x9'),error);ami[_0x4caf('0x18')]('close',close);}ami['on'](_0x4caf('0x19'),connect);ami['on'](_0x4caf('0x1a'),function(_0x3b3af6){logger['info'](util[_0x4caf('0xc')](_0x4caf('0x1b'),config[_0x4caf('0x4')][_0x4caf('0x6')],config['asterisk']['ip'],config['asterisk'][_0x4caf('0x5')],util[_0x4caf('0xb')](_0x3b3af6,![],null)));});ami['on'](_0x4caf('0x1c'),function(){logger['info'](util['format'](_0x4caf('0x1d'),config[_0x4caf('0x4')][_0x4caf('0x6')],config[_0x4caf('0x4')]['ip'],config['asterisk'][_0x4caf('0x5')]));return Promise[_0x4caf('0x1e')]()['then'](ami[_0x4caf('0x1f')]())['then'](ami[_0x4caf('0xf')]())[_0x4caf('0x20')](ami[_0x4caf('0x11')]())[_0x4caf('0x20')](ami[_0x4caf('0x13')]())['then'](ami[_0x4caf('0x14')]())[_0x4caf('0x21')](function(_0x1e6f85){logger[_0x4caf('0x9')](_0x4caf('0x22'),util[_0x4caf('0xb')](_0x1e6f85,{'showHidden':![],'depth':null}));});});ami[_0x4caf('0x18')]('error',error);ami[_0x4caf('0x18')](_0x4caf('0x23'),close);module['exports']=ami; \ No newline at end of file diff --git a/server/services/ami/client.js b/server/services/ami/client.js index 44c5340..4f427c8 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 _0x0713=['rpc','memberReport','error','message','result','catch','exports','../../config/logger','ami','client','http','Request','request','then','debug'];(function(_0x193077,_0x8fc002){var _0x255135=function(_0x428564){while(--_0x428564){_0x193077['push'](_0x193077['shift']());}};_0x255135(++_0x8fc002);}(_0x0713,0x1ba));var _0x3071=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x0713[_0x3dd15e];return _0x231fd0;};'use strict';var jayson=require('jayson/promise');var BPromise=require('bluebird');var logger=require(_0x3071('0x0'))(_0x3071('0x1'));var client=jayson[_0x3071('0x2')][_0x3071('0x3')]({'port':0x2329});client[_0x3071('0x4')]=function(_0x52b5fb,_0x2c547f){return new BPromise(function(_0x7b18a4,_0x33a70c){return client[_0x3071('0x5')](_0x52b5fb,_0x2c547f)[_0x3071('0x6')](function(_0x41cf76){logger[_0x3071('0x7')](_0x3071('0x8'),_0x3071('0x9'),_0x52b5fb,_0x2c547f,_0x41cf76);if(_0x41cf76[_0x3071('0xa')]){logger[_0x3071('0xa')](_0x3071('0x8'),_0x3071('0x9'),_0x52b5fb,_0x41cf76['error'][_0x3071('0xb')],_0x2c547f);return _0x33a70c(_0x41cf76[_0x3071('0xa')][_0x3071('0xb')]);}else{return _0x7b18a4(_0x41cf76[_0x3071('0xc')]);}})[_0x3071('0xd')](function(_0x4a470a){logger[_0x3071('0xa')](_0x3071('0x8'),_0x3071('0x9'),_0x52b5fb,_0x4a470a,_0x2c547f);return _0x33a70c(_0x4a470a);});});};module[_0x3071('0xe')]=client; \ No newline at end of file +var _0x0713=['rpc','memberReport','error','message','result','catch','exports','../../config/logger','ami','client','http','Request','request','then','debug'];(function(_0x5153fd,_0x237b93){var _0x5ee7bc=function(_0x51a7de){while(--_0x51a7de){_0x5153fd['push'](_0x5153fd['shift']());}};_0x5ee7bc(++_0x237b93);}(_0x0713,0x1ba));var _0x3071=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x0713[_0x3dd15e];return _0x231fd0;};'use strict';var jayson=require('jayson/promise');var BPromise=require('bluebird');var logger=require(_0x3071('0x0'))(_0x3071('0x1'));var client=jayson[_0x3071('0x2')][_0x3071('0x3')]({'port':0x2329});client[_0x3071('0x4')]=function(_0x52b5fb,_0x2c547f){return new BPromise(function(_0x7b18a4,_0x33a70c){return client[_0x3071('0x5')](_0x52b5fb,_0x2c547f)[_0x3071('0x6')](function(_0x41cf76){logger[_0x3071('0x7')](_0x3071('0x8'),_0x3071('0x9'),_0x52b5fb,_0x2c547f,_0x41cf76);if(_0x41cf76[_0x3071('0xa')]){logger[_0x3071('0xa')](_0x3071('0x8'),_0x3071('0x9'),_0x52b5fb,_0x41cf76['error'][_0x3071('0xb')],_0x2c547f);return _0x33a70c(_0x41cf76[_0x3071('0xa')][_0x3071('0xb')]);}else{return _0x7b18a4(_0x41cf76[_0x3071('0xc')]);}})[_0x3071('0xd')](function(_0x4a470a){logger[_0x3071('0xa')](_0x3071('0x8'),_0x3071('0x9'),_0x52b5fb,_0x4a470a,_0x2c547f);return _0x33a70c(_0x4a470a);});});};module[_0x3071('0xe')]=client; \ No newline at end of file diff --git a/server/services/ami/dialer/index.js b/server/services/ami/dialer/index.js index 25e2545..3289603 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 _0xdabd=['[rescheduleContact][AgentReject]','callProgressDetecting','object','[callProgressDetecting]','evt\x20is\x20undefine','outboundNoSuchCallsDay','NoSuchNumber','custom:agentnosuchnumber','nosuchnumber','dialNoSuchNumberMaxRetry','reason\x200\x20no\x20such\x20number....','outboundNoAnswerCallsDay','NoAnswer','buildNoAnswerEventPayload','custom:agentnoanswer','[syncAgentComplete][createHistory][3]','reason\x203\x20ringing\x20no\x20answer','outboundBusyCallsDay','Busy','custom:agentbusy','busy','[syncAgentComplete][createHistory][5]','reason\x205\x20busy','outboundCongestionCallsDay','Congestion','congestion','reason\x208\x20congestion','reason\x2011\x20abandoned','outboundRejectCallsDay','AgentReject','custom:agentreject','agentreject','[syncAgentComplete][createHistory][20]','reason\x2020\x20agentreject','[syncAgentComplete][createHistory][?]','Global','[moveContactManagedDialer][0]','contact\x20not\x20moved','outboundDropCallsDayTimeout','predictiveIntervalAvailable','predictiveIntervalMinThreshold','floor','predictiveIntervalHitRate','[startMethodPredictive][StartProgressive]','dialPredictiveInterval','dialPredictiveOptimization','dropRate','[stopMethodPredictive][ReStartProgressive][ExceededDropDay]','Drop\x20in\x20this\x20interval','started\x20in\x20predictive\x20at','avgHandleTime','getDataPredictive','startMethodPredictive','Predictive\x20after\x20first\x20interval','recalculate\x20predictive\x20at','Predictive\x20for\x20every\x20interval','switch\x20in\x20progressive\x20because\x20available\x20agents\x20(','predictiveIntervalAnsweredCalls','dialPredictiveOptimizationPercentage','abandonmentRate','agentBusyFactor','busyFactor','[getDataPredictive]','Unknown\x20Predictive','getDataPredictiveOld','loggedIn','outboundQueuePauses','predictiveIntervalPauses','[CatchErlangB]','check\x20failure','one\x20call\x20every:','[handlePredictive]','fail\x20to\x20scheduled\x20calls','checkContactBlack','recallme','booked','[booked][checkContactBlack]','queueStatusComplete:\x20','Queue:\x20','queuestatus','[unlockOriginate][syncQueueStatusComplete]','[booked][checkContactBlack][else]','scheduledat','dialRecallMeTimeout','voicePause','unlockContact','outboundReCallsDay','dialRecallInQueue','[rescheduleContact][dialRecallInQueue]','RecallInQueue','[Originate][HistoryDialRecallInQueue][historyCatch]','RECALL_TIMEOUT','RecallFailedTimeout','[Originate][HistoryRecallClose]','outboundBlacklistCallsDay','Blacklist','[Originate][historyBlacklist]','[Originate][MoveBlacklist]','inBlackList','handleIvr','limitCalls','temp','getContactDialerIvr','checkContactEmpty','RUNNING','ivrTotalCallsDays','emptyContact','[actionOriginate]\x20','checkIsBlackListIvr','[actionOriginateIvr]\x20','dialLimitQueue','undefined','push','countReScheduled','[countReScheduled]\x20','Contact','[getContactDialer2]','tryOriginatePredictive','[handlePredictive][limitChannel]','not_inuse','getContactDialer','dialOrderByScheduledAt','checkContactLowerLimitOriginate','checkIsBlackList','[actionOriginatePredictive]\x20','[getContactDialerPredictive]','M:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','Ts:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','Amax:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','[abandonmentRate]','Ts\x20=\x20','interval\x20=\x20','Amax\x20=\x20','erlangb','----\x20Agent\x20Busy\x20Factor\x20----','Interval:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','P:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','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','p\x20=\x20','Umin\x20=\x20','exports','util','uuid','ioredis','./utils/hopper','../preview/util/util','../../../config/logger','dialer','predictive','predictiveCalls','syncQueueSummary','../ami','redis','defaults','socket.io-emitter','../rpc/setting','../rpc/interval','./models/action','./models/final','./models/agentComplete','./models/queueCallerAbandon','./models/hangup','env','127.0.0.1','prototype','enqueue','tail','sequence','preview','voiceQueues','campaigns','agents','trunks','maxNumberOriginate','channels','actions','contactsId','optionPredictive','startPredictive','startProgressive','ivrOriginated','queueBooked','queueBookedRR','syncAgentConnect','queuecallerabandon','syncQueueCallerAbandon','bind','originateresponse','syncOriginateResponse','syncAgentComplete','custom:queuesummary','syncQueueSummaryComplete','hangup','syncNewExten','syncVarSet','syncQueueMember','queuestatuscomplete','syncQueueStatusComplete','loopClearZombieChannels','getSettings','then','previewRecallmeReminderInterval','emit','type','outbound','debug','[voiceQueueReport][queuesummary]\x20sending\x20voice_queue:save\x20event:','inspect','voice_queue:save','isEmpty','-----\x20Stats\x20Predictive\x20---','Total\x20Calls:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','predictiveIntervalTotalCalls','info','predictiveIntervalDroppedCallsTimeout','Dropped\x20Exit:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','predictiveIntervalDroppedCallsCallersExit','AVG\x20Hold\x20Time:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','AVG\x20Talk\x20Time:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','predictiveIntervalAvgTalktime','---------------------------','isUndefined','Avg\x20Talk\x20Time\x20is\x20not\x20enough\x20for\x20predictive','predictiveIntervalAvgHoldtime','Avg\x20Hold\x20Time\x20is\x20not\x20enough\x20for\x20predictive','Total\x20Calls\x20are\x20not\x20enough\x20for\x20predictive','History\x20information\x20are\x20empty','---------\x20ErlangB\x20---------','Scheduled\x20Calls:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','erlangCalls','One\x20call\x20every:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','erlangCallToSecond','erlangAbandonmentRate','Agent\x20Busy\x20Factor:\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','merge','getSeconds','name','startProgressive\x20value\x20cleared','handlePredictive','handlePredictive\x20interval\x20cleared','error','stack','contactsRescheduled','CAMPAIGN_STATUS','CONTACTS_RESCHEDULED','[getContactDialer2][ReScheduled]','message','NO_AVAILABLE_CONTACTS','[getContactDialer2][Empty]','state','statedesc','endtime','starttime','queueStatusComplete','[booked][unlockQueueStatus]','stringify','NULL_INTERVAL','Intervals','Interval','isIVRCampaignActive','INACTIVE','\x20NOT\x20Active','isIVRCampaign','campaign:ivr:%s','originated','sendMessageOneNotActive','is\x20not\x20active','DISACTIVED','[syncQueueSummary]\x20Campaign\x20Ivr:\x20','is\x20disactive','[ifTime][Action]','Error','isTrunkReachable','active','status','format','SIP/%s','unmonitored','checkIsTrunkReachable','TrunkBackup','TRUNK_NOT_REACHABLE','\x20trunk\x20is\x20not\x20reachable','ifTimeIvr','Failure','\x20Intervals\x20is\x20null\x20','EMPTY_INTERVAL','UNKNOWN_TIMEZONE','ifTime','isArray','length','command','iftime\x20%s,%s','interval','timezones','indexOf','true','Action','content','catch','some','OVERTIME_GLOBAL_INTERVAL','[ifTime][promiseAll]','Global:\x20','\x20Interval\x20is\x20overtime:\x20','Timezone:\x20','loopCampaigns','resetActiveCalls','syncCampaigns','resolve','dialGlobalInterval','checkIfTimeIntervals','dialTimezone','launchHandleIvr','[syncCampaigns]','checkDialMethod','dialMethod','progressive','handlePower','power','Queue','silly','Dialer::ifTime()','intervalIftime','OVERTIME_INTERVAL','Dialer::ifTime()\x20errResponse\x20NOT\x20NULL:','AMI\x20IfTime','queue','uniqueId','uniqueid','ivr','updateOriginated','outboundAnswerCallsDay','reason','agiafterat','dialAgiAfterHangupAgent','createHistory','[syncAgentComplete][createHistory]','moveContactManagedDialer','[syncAgentComplete]','YYYY-MM-DD\x20HH:mm:ss','droptime','predictiveIntervalErlangCallsDroppedCalls','TIMEOUT','dialQueueProject2','countdropretry','countglobal','dialDropRetryFrequency','callAdditionalPhoneAfterMin','verifyAdditionalPhones','voiceQueue','dialDropMaxRetry','queueCallerAbandonCreateState','rescheduleContact','add','minutes','ListId','VoiceQueueId','CampaignId','[rescheduleContact][Drop]','Drop','calleridname','calleridnum','swapAdditionalPhones','outboundDropCallsDayCallersExit','Abandoned','CALLEREXIT','countabandonedretry','dialAbandonedRetryFrequency','dialAbandonedMaxRetry','additional','ContactId','[syncAgentComplete][createHistory][11]','channel','actionid','rrmemory','isNil','locked','paused','stateinterface','pick','idHopper','strategy','roundrobin','[unlock][syncQueueStatusComplete]','_rr','unlockRR','[booked][RR]','Agent:\x20','contactAgent-idHopper:\x20','run','finally','[booked][RR][finaly]','[booked][unlock]','[unlock2][syncQueueStatusComplete]','[booked][unlock3]','[unlock3][syncQueueStatusComplete]','responsetime','getQueue','response','Success','[callProgressDetecting]\x20','variable','exten','xcally-motion-dialer','dialAMDActive','value','HANGUP','membername','AMD','custom:amd','amd','saveInDb','[syncHangupInAMD][createHistory]','[syncHangupInAMD]','Machine','countmachineretry','buildObj','[syncAgentComplete][createHistory][0]','countbusyretry','countnoanswerretry','countnosuchnumberretry','countagentrejectretry','dialGlobalMaxRetry','stateGlobal','reason19\x20machine....','dialMachineMaxRetry','createStateFinal','reason\x2019\x20machine....','dialMachineRetryFrequency','[rescheduleContact][Machine]','HangupInAMD','[syncHangupInAMDIvr][createHistory]','[syncHangupInAMDIvr]','outboundAnswerAgiCallsDay','countcongestionretry','syncHangup','ivrAnswerCallsDay','[syncHangupIvr][createHistory]','[syncHangupIvr]','dialQueueProject','outboundUnknownCallsDay','cause-txt','queuesSummary','running','isPreviewCampaign','statusMessage','available','talking','pTalking','ACTIVE','[syncQueueSummary]','compareToOutboundQueue','updateReportFromOutboundQueue','assign','dialPreviewRecallmeReminder','filter','online','reachable','map','Agent','user:%s','user:dialPreviewRecallReminder','clearZombieChannels','[uniqueid]','[actions]','No\x20such\x20channel','[Dialer][checkChannel]','[Dialer][checkChannel][ivr]','getVoiceQueueRtPauses','[getVoiceQueueRtPauses]\x20','[updateOriginated]\x20object\x20originated\x20is\x20negative','[updateOriginated]\x20is\x20null\x20or\x20undefined','loggerHandler','notFound','UserId','[emptyContact][createHistory]','checkPreviewRecallReminder','handlePreviewRecallNotifications','actionOriginate','originate','voiceQueue\x20is\x20undefine','contact\x20is\x20undefine','getCaller','\x22agi://%s/square,%s\x22','NONE','dialQueueOptions','dialQueueTimeout','dialAMDInitialSilence','XMD-AMDGREETING','XMD-AMDTOTALANALYSISTIME','dialAMDTotalAnalysisTime','XMD-AMDMINWORDLENGTH','dialAMDMinWordLength','XMD-AMDBETWEENWORDSSILENCE','dialAMDMaximumNumberOfWords','dialAMDSilenceThreshold','XMD-AMDMAXIMUMWORDLENGTH','dialAMDMaximumWordLength','isOutboundQueue','XMD-VOICEQUEUEID','setXMDContactVariables','Trunk','getCallerId','callerid','dialOriginateCallerIdName','getCallerIdRandom','dialOriginateCallerIdNumber','dialRandomLastDigitCallerIdNumber','XMD-ORIGINATECALLERIDNAME','originatecalleridname','extractCalleridName','XMD-ORIGINATECALLERIDNUM','phone','variables','SIP/%s/%s%s','dialPrefix','trim','dialCutDigit','substring','from-sip','dialOriginateTimeout','outboundOriginateFailureCallsDay','[originateError]:\x20%s','OriginateError','[originate][error]','checkRetriveMax','dialNoAnswerMaxRetry','dialNoAnswerRetryFrequency','[rescheduleContact][NoAnswer]','dialBusyMaxRetry','dialBusyRetryFrequency','dialCongestionMaxRetry','dialCongestionRetryFrequency','dialNoSuchNumberRetryFrequency','[rescheduleContact][NoSuchNumber]','[rescheduleContact][Abandoned]','dialAgentRejectMaxRetry'];(function(_0x41d42b,_0x555bd3){var _0xc7f5a0=function(_0x1c578a){while(--_0x1c578a){_0x41d42b['push'](_0x41d42b['shift']());}};_0xc7f5a0(++_0x555bd3);}(_0xdabd,0x8f));var _0xddab=function(_0x599e60,_0x5b6519){_0x599e60=_0x599e60-0x0;var _0x468e19=_0xdabd[_0x599e60];return _0x468e19;};'use strict';var util=require(_0xddab('0x0'));var _=require('lodash');var uuid=require(_0xddab('0x1'));var moment=require('moment');var rr=require('rr');var Redis=require(_0xddab('0x2'));var utils=require('./utils');var hopperUtils=require(_0xddab('0x3'));var ut=require(_0xddab('0x4'));var config=require('../../../config/environment/');var logger=require(_0xddab('0x5'))(_0xddab('0x6'));var loggerBooked=require(_0xddab('0x5'))('booked');var loggerPredictive=require(_0xddab('0x5'))(_0xddab('0x7'));var loggerPredictiveCalls=require(_0xddab('0x5'))(_0xddab('0x8'));var loggerSyncQueueSummary=require(_0xddab('0x5'))(_0xddab('0x9'));var ami=require(_0xddab('0xa'));config[_0xddab('0xb')]=_[_0xddab('0xc')](config['redis'],{'host':'localhost','port':0x18eb});var io=require(_0xddab('0xd'))(new Redis(config[_0xddab('0xb')]));var cmHopper=require('../rpc/cmHopper');var voiceQueueRt=require('../rpc/voiceQueueRt');var RpcSetting=require(_0xddab('0xe'));var Interval=require(_0xddab('0xf'));var Action=require(_0xddab('0x10'));var History=require('./models/history');var Final=require(_0xddab('0x11'));var AgentComplete=require(_0xddab('0x12'));var QueueCallerAbandon=require(_0xddab('0x13'));var Hangup=require(_0xddab('0x14'));var ipAgi=process[_0xddab('0x15')]['XCALLY_IP_AGI']||_0xddab('0x16');var previewRecallmeReminderInterval=0x1;var Sequence=function(){};Sequence[_0xddab('0x17')][_0xddab('0x18')]=function(_0x2fa78c){this[_0xddab('0x19')]=this[_0xddab('0x19')]?this[_0xddab('0x19')]['finally'](_0x2fa78c):_0x2fa78c();};function Dialer(_0x574b9d,_0x2de4c2){this[_0xddab('0x1a')]=new Sequence();this[_0xddab('0x1b')]=_0x2de4c2;this[_0xddab('0x1c')]=_0x574b9d[_0xddab('0x1c')];this[_0xddab('0x1d')]=_0x574b9d[_0xddab('0x1d')];this[_0xddab('0x1e')]=_0x574b9d[_0xddab('0x1e')];this[_0xddab('0x1f')]=_0x574b9d['trunks'];this[_0xddab('0x20')]=config[_0xddab('0x20')]||0x2;this[_0xddab('0x21')]={};this[_0xddab('0x22')]={};this[_0xddab('0x23')]={};this['uniqueId']={};this[_0xddab('0x24')]={};this[_0xddab('0x25')]={};this[_0xddab('0x26')]={};this[_0xddab('0x27')]={};this[_0xddab('0x28')]={};this[_0xddab('0x29')]={};this['queuesSummary']={};ami['on']('agentconnect',this[_0xddab('0x2a')]['bind'](this));ami['on'](_0xddab('0x2b'),this[_0xddab('0x2c')][_0xddab('0x2d')](this));ami['on'](_0xddab('0x2e'),this[_0xddab('0x2f')][_0xddab('0x2d')](this));ami['on']('agentcomplete',this[_0xddab('0x30')][_0xddab('0x2d')](this));ami['on'](_0xddab('0x31'),this[_0xddab('0x9')][_0xddab('0x2d')](this));ami['on']('custom:queuesummarycomplete',this[_0xddab('0x32')][_0xddab('0x2d')](this));ami['on'](_0xddab('0x33'),this['syncHangup'][_0xddab('0x2d')](this));ami['on']('newexten',this[_0xddab('0x34')]['bind'](this));ami['on']('varset',this[_0xddab('0x35')][_0xddab('0x2d')](this));ami['on']('queuemember',this[_0xddab('0x36')][_0xddab('0x2d')](this));ami['on'](_0xddab('0x37'),this[_0xddab('0x38')][_0xddab('0x2d')](this));this['loopCampaigns']();this[_0xddab('0x39')]();RpcSetting[_0xddab('0x3a')]()[_0xddab('0x3b')](function(_0x438f7d){previewRecallmeReminderInterval=_0x438f7d[_0xddab('0x3c')];});}function isNotNull(_0x40866b){return _0x40866b!==null&&!_['isUndefined'](_0x40866b);}function msgResponse(_0x1690c4,_0x57c177,_0x34b75f){return{'action':_0x1690c4,'response':_0x57c177,'message':_0x34b75f,'stack':_0x34b75f};}function emit(_0x2fbdce,_0x49cbe6,_0x2f731a){io['to'](_0x2fbdce)[_0xddab('0x3d')](_0x49cbe6,_0x2f731a);}function emitOutboundVoiceQueueSummary(_0x262122){if(_0x262122[_0xddab('0x3e')]===_0xddab('0x3f')){logger[_0xddab('0x40')](_0xddab('0x41'),util[_0xddab('0x42')](_0x262122,{'showHidden':![],'depth':null}));emit(util['format']('voice:queue:%s',_0x262122['name']),_0xddab('0x43'),_0x262122);}}function checkGetDataPredictive(_0x353b4){if(isNotNull(_0x353b4)&&!_[_0xddab('0x44')](_0x353b4)){loggerPredictive['info'](_0xddab('0x45'));loggerPredictive['info'](_0xddab('0x46'),_0x353b4[_0xddab('0x47')]);loggerPredictive[_0xddab('0x48')]('Answered\x20Calls:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20',_0x353b4['predictiveIntervalAnsweredCalls']);loggerPredictive[_0xddab('0x48')]('Dropped\x20Timeout:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20',_0x353b4[_0xddab('0x49')]);loggerPredictive[_0xddab('0x48')](_0xddab('0x4a'),_0x353b4[_0xddab('0x4b')]);loggerPredictive[_0xddab('0x48')](_0xddab('0x4c'),_0x353b4['predictiveIntervalAvgHoldtime']);loggerPredictive[_0xddab('0x48')](_0xddab('0x4d'),_0x353b4[_0xddab('0x4e')]);loggerPredictive[_0xddab('0x48')](_0xddab('0x4f'));if(_0x353b4[_0xddab('0x47')]>0x0){if(!_[_0xddab('0x50')](_0x353b4[_0xddab('0x4e')])&&_0x353b4[_0xddab('0x4e')]>0x0){return!![];}loggerPredictive[_0xddab('0x48')](_0xddab('0x51'));if(!_[_0xddab('0x50')](_0x353b4[_0xddab('0x52')])&&_0x353b4[_0xddab('0x52')]>0x0){return!![];}loggerPredictive[_0xddab('0x48')](_0xddab('0x53'));}else{loggerPredictive[_0xddab('0x48')](_0xddab('0x54'));}}else{loggerPredictive[_0xddab('0x48')](_0xddab('0x55'));}return![];}function mergeDataErlangB(_0x14319d){return function(_0x536534){loggerPredictive[_0xddab('0x48')](_0xddab('0x56'));loggerPredictive[_0xddab('0x48')](_0xddab('0x57'),_0x536534[_0xddab('0x58')]);loggerPredictive['info'](_0xddab('0x59'),_0x536534[_0xddab('0x5a')]);loggerPredictive[_0xddab('0x48')]('Drop\x20Rate:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20',_0x536534[_0xddab('0x5b')]);loggerPredictive[_0xddab('0x48')](_0xddab('0x5c'),_0x536534['erlangBusyFactor']);loggerPredictive[_0xddab('0x48')](_0xddab('0x5d'),_0x536534[_0xddab('0x5b')]);loggerPredictive['info']('---------------------------');_[_0xddab('0x5e')](_0x14319d,_0x536534);};}function ifInterval(_0x5a1943,_0x505cb4){if(_['isUndefined'](_0x505cb4)){return![];}return utils[_0xddab('0x5f')](undefined,_0x505cb4)<_0x5a1943*0x3c;}function clearPredictiveAttributes(_0x39a449){if(_0x39a449[_0xddab('0x26')]){_0x39a449[_0xddab('0x26')]=undefined;loggerPredictive[_0xddab('0x40')](_0x39a449[_0xddab('0x60')],_0xddab('0x61'));}if(_0x39a449['startPredictive']){_0x39a449[_0xddab('0x25')]=undefined;loggerPredictive[_0xddab('0x40')](_0x39a449[_0xddab('0x60')],'startPredictive\x20value\x20cleared');}if(_0x39a449[_0xddab('0x62')]){clearInterval(_0x39a449['handlePredictive']);_0x39a449[_0xddab('0x62')]=undefined;loggerPredictive[_0xddab('0x40')](_0x39a449[_0xddab('0x60')],_0xddab('0x63'));}}function loggerCatchPredictive(_0x2de991,_0x37b3d1){return function(_0x5bd839){loggerPredictive[_0xddab('0x64')](_0x37b3d1[_0xddab('0x60')],_0x2de991);loggerPredictive['error'](_0x5bd839[_0xddab('0x65')]);clearPredictiveAttributes(_0x37b3d1);};}function loggerCatch(_0x3ae90a){return function(_0x2b7fda){logger['error'](_0x3ae90a,util['inspect'](_0x2b7fda,{'showHidden':![],'depth':null}));};}function loggerGetContactDialer(_0x2351e4,_0x4be3ad,_0x11ecb2){return function(_0x2d93b6){utils['checkContactLowerLimitOriginate'](_0x4be3ad,_0x11ecb2,0x0);_0x4be3ad['temp']=0x0;logger[_0xddab('0x64')](_0x2351e4,util[_0xddab('0x42')](_0x2d93b6,{'showHidden':![],'depth':null}));};}function sendMessageReschedule(_0x31f29f){return function(_0x295c4a){if(isNotNull(_0x295c4a)&&isNotNull(_0x295c4a[0x0])){if(_0x295c4a[0x0][_0xddab('0x66')]>0x0){_0x31f29f['message']=utils[_0xddab('0x67')][_0xddab('0x68')];logger[_0xddab('0x48')](_0xddab('0x69')+_0x31f29f[_0xddab('0x60')],_0x295c4a[0x0][_0xddab('0x66')],'contacts');}else{_0x31f29f[_0xddab('0x6a')]=utils[_0xddab('0x67')][_0xddab('0x6b')];logger[_0xddab('0x48')](_0xddab('0x6c')+_0x31f29f[_0xddab('0x60')]);}}};}function createObjHistory(_0x2c0421,_0x5c9c1d,_0x4edf6d,_0xdffdae,_0x206bb2){_0x2c0421[_0xddab('0x6a')]=_0x4edf6d;var _0x59e5e4=new Action(_0x2c0421,_0x5c9c1d);var _0xe51884=new History(_0x59e5e4);_0xe51884[_0xddab('0x6d')]=_0xdffdae;_0xe51884[_0xddab('0x6e')]=_0x206bb2;_0xe51884[_0xddab('0x6f')]=_0x59e5e4[_0xddab('0x70')];return _0xe51884;}function unlockQueueStatus(_0x35e38d,_0x15d4c0){setTimeout(function(){if(_[_0xddab('0x50')](_0x35e38d[_0xddab('0x71')])){loggerBooked[_0xddab('0x64')]('[unlockQueueStatus][undefined]',_0x15d4c0);}_0x35e38d[_0xddab('0x71')]=!![];loggerBooked[_0xddab('0x48')](_0xddab('0x72'),_0x15d4c0,JSON[_0xddab('0x73')](_['pick'](_0x35e38d,[_0xddab('0x60'),_0xddab('0x71')])));},0x1f3);}function checkInterval(_0x39e2b8){return function(){if(!isNotNull(_0x39e2b8['Interval'])){_0x39e2b8[_0xddab('0x6a')]=utils[_0xddab('0x67')][_0xddab('0x74')];throw _0x39e2b8['name']+'\x20INTERVAL_IS_NULL';}if(!isNotNull(_0x39e2b8['Interval'][_0xddab('0x75')])){_0x39e2b8[_0xddab('0x6a')]=utils[_0xddab('0x67')][_0xddab('0x74')];throw _0x39e2b8[_0xddab('0x60')]+'\x20INTERVAL_IS_NULL';}if(!isNotNull(_[_0xddab('0x44')](_0x39e2b8[_0xddab('0x76')]['Intervals']))){_0x39e2b8[_0xddab('0x6a')]=utils[_0xddab('0x67')][_0xddab('0x74')];throw _0x39e2b8['name']+'\x20INTERVAL_IS_NULL';}};}function checkIsIVRCampaignActive(_0xa1c15){return function(){if(!utils[_0xddab('0x77')](_0xa1c15)){_0xa1c15[_0xddab('0x6a')]=utils[_0xddab('0x67')][_0xddab('0x78')];throw _0xa1c15[_0xddab('0x60')]+_0xddab('0x79');}};}function emitCampaignSummary(_0x285ba7){if(utils[_0xddab('0x7a')](_0x285ba7)){emit(util['format'](_0xddab('0x7b'),_0x285ba7['name']),'campaign:save',_0x285ba7);}}function loggerCatchQueueSummary(_0x1796e5,_0xcc4d13){return function(_0x1a579b){clearPredictiveAttributes(_0xcc4d13);emitCampaignSummary(_0xcc4d13);loggerSyncQueueSummary['debug'](_0x1796e5,util[_0xddab('0x42')](_0x1a579b,{'showHidden':![],'depth':null}));};}function notSendMessagesCampaign(_0x33284a){if(_0x33284a['sendMessageOneNotActive']){if(_0x33284a[_0xddab('0x7c')]===0x0){_0x33284a[_0xddab('0x7d')]=![];_0x33284a['message']=utils['CAMPAIGN_STATUS'][_0xddab('0x78')];loggerSyncQueueSummary[_0xddab('0x40')]('[syncQueueSummary]\x20Campaign\x20Ivr:\x20',_0x33284a[_0xddab('0x60')],_0xddab('0x7e'));}else{_0x33284a[_0xddab('0x6a')]=utils[_0xddab('0x67')][_0xddab('0x7f')];loggerSyncQueueSummary[_0xddab('0x40')](_0xddab('0x80'),_0x33284a[_0xddab('0x60')],_0xddab('0x81'));}emitCampaignSummary(_0x33284a);}}function myreject(_0x26d663){return function(_0x33fb90){return _0x26d663(msgResponse(_0xddab('0x82'),_0xddab('0x83'),JSON['stringify'](_0x33fb90)));};}Dialer[_0xddab('0x17')][_0xddab('0x84')]=function(_0x5ae1d6){return!_[_0xddab('0x50')](_0x5ae1d6)&&_0x5ae1d6&&!_[_0xddab('0x50')](_0x5ae1d6[_0xddab('0x60')])&&!_[_0xddab('0x50')](_0x5ae1d6[_0xddab('0x85')])&&_0x5ae1d6['active']&&(this['trunks'][util['format']('SIP/%s',_0x5ae1d6[_0xddab('0x60')])][_0xddab('0x86')]==='reachable'||this[_0xddab('0x1f')][util[_0xddab('0x87')](_0xddab('0x88'),_0x5ae1d6['name'])][_0xddab('0x86')]===_0xddab('0x89'));};Dialer[_0xddab('0x17')][_0xddab('0x8a')]=function(_0xe94439){var _0x60e3f4=this;return function(){if(!_0x60e3f4[_0xddab('0x84')](_0xe94439['Trunk'])){if(!_0x60e3f4[_0xddab('0x84')](_0xe94439[_0xddab('0x8b')])){_0xe94439['message']=utils[_0xddab('0x67')][_0xddab('0x8c')];throw _0xe94439[_0xddab('0x60')]+_0xddab('0x8d');}}};};Dialer['prototype']['checkIfTime']=function(_0xce43c2,_0xc5cbc2,_0x25c023,_0x440768){var _0x8cc4f7=this;return function(){var _0x393e00=!![];return _0x8cc4f7[_0xddab('0x8e')](_0xce43c2,_0xc5cbc2,_0x25c023,_0x440768,_0x393e00);};};Dialer[_0xddab('0x17')]['checkIfTimeIntervals']=function(_0x25c39b,_0x4216d7,_0x5092db,_0x3507b0){var _0x52c240=this;return function(){var _0x8bf94a=![];return _0x52c240[_0xddab('0x8e')](_0x25c39b[_0xddab('0x75')],_0x4216d7,_0x5092db,_0x3507b0,_0x8bf94a);};};Dialer['prototype'][_0xddab('0x8e')]=function(_0x49aae2,_0x25b231,_0x16321b,_0x1b753f,_0x2b800b){var _0x4db29e=[];return new Promise(function(_0x4a4dd7,_0x2fdcf1){if(!isNotNull(_0x49aae2)){_0x1b753f[_0xddab('0x6a')]=utils[_0xddab('0x67')]['NULL_INTERVAL'];return _0x2fdcf1(msgResponse('ifTime',_0xddab('0x8f'),_0x16321b+_0xddab('0x90')));}if(_[_0xddab('0x44')](_0x49aae2)){_0x1b753f[_0xddab('0x6a')]=utils[_0xddab('0x67')][_0xddab('0x91')];return _0x2fdcf1(msgResponse('ifTime',_0xddab('0x8f'),_0x16321b+'\x20Intervals\x20is\x20empty\x20'));}if(_0x25b231&&_[_0xddab('0x50')](config['timezones'][_0x25b231])){_0x1b753f[_0xddab('0x6a')]=utils[_0xddab('0x67')][_0xddab('0x92')];return _0x2fdcf1(msgResponse(_0xddab('0x93'),_0xddab('0x8f'),_0x16321b+'\x20Timezone\x20unknow\x20'+_0x25b231));}if(_[_0xddab('0x94')](_0x49aae2)){for(var _0x55aad9=0x0;_0x55aad9<_0x49aae2[_0xddab('0x95')];_0x55aad9+=0x1){_0x4db29e['push'](ami['Action']({'action':_0xddab('0x96'),'command':util[_0xddab('0x87')](_0xddab('0x97'),_0x49aae2[_0x55aad9][_0xddab('0x98')],!_['isUndefined'](config[_0xddab('0x99')][_0x25b231])?_0x25b231:'')})[_0xddab('0x3b')](function(_0x37f6fc){return _0x37f6fc['content'][_0xddab('0x9a')](_0xddab('0x9b'))>=0x0;})['catch'](myreject(_0x2fdcf1)));}}else{_0x4db29e['push'](ami[_0xddab('0x9c')]({'action':_0xddab('0x96'),'command':util[_0xddab('0x87')]('iftime\x20%s,%s',_0x49aae2,!_[_0xddab('0x50')](config['timezones'][_0x25b231])?_0x25b231:'')})[_0xddab('0x3b')](function(_0x212ebc){return _0x212ebc[_0xddab('0x9d')][_0xddab('0x9a')](_0xddab('0x9b'))>=0x0;})[_0xddab('0x9e')](myreject(_0x2fdcf1)));}Promise['all'](_0x4db29e)[_0xddab('0x3b')](function(_0xa0b1ed){var _0x5e2a6a=_[_0xddab('0x9f')](_0xa0b1ed);if(_0x5e2a6a){return _0x4a4dd7(_0x5e2a6a);}else{_0x1b753f[_0xddab('0x6a')]=_0x2b800b?utils[_0xddab('0x67')][_0xddab('0xa0')]:utils[_0xddab('0x67')]['OVERTIME_INTERVAL'];return _0x2fdcf1(msgResponse(_0xddab('0xa1'),_0xddab('0x8f'),_0xddab('0xa2')+_0x2b800b+'\x20'+_0x16321b+_0xddab('0xa3')+util[_0xddab('0x42')](_0x49aae2,{'showHidden':![],'depth':null})+_0xddab('0xa4')+_0x25b231));}})[_0xddab('0x9e')](function(_0x4c305e){return _0x2fdcf1(msgResponse('ifTime','Failure',JSON[_0xddab('0x73')](_0x4c305e)));});});};Dialer[_0xddab('0x17')][_0xddab('0xa5')]=function(){var _0x14ce1e=this;return cmHopper[_0xddab('0xa6')]({'active':![]},{'where':{'active':!![]}})[_0xddab('0x3b')](function(){setInterval(function(){_0x14ce1e['syncCampaigns']();},0x3e8);});};Dialer[_0xddab('0x17')][_0xddab('0xa7')]=function(){var _0x37374c=this;var _0xfc0807;for(var _0xa3dc33 in this[_0xddab('0x1d')]){if(typeof this[_0xddab('0x1d')][_0xa3dc33]!=='undefined'){_0xfc0807=this[_0xddab('0x1d')][_0xa3dc33];if(utils[_0xddab('0x7a')](_0xfc0807)&&utils['isIVRCampaignActive'](_0xfc0807)){_0xfc0807[_0xddab('0x7d')]=!![];Promise[_0xddab('0xa8')]()['then'](checkIsIVRCampaignActive(_0xfc0807))[_0xddab('0x3b')](checkInterval(_0xfc0807))[_0xddab('0x3b')](_0x37374c[_0xddab('0x8a')](_0xfc0807))[_0xddab('0x3b')](_0x37374c['checkIfTime'](_0xfc0807[_0xddab('0xa9')],_0xfc0807['dialTimezone'],_0xfc0807['name'],_0xfc0807))[_0xddab('0x3b')](_0x37374c[_0xddab('0xaa')](_0xfc0807['Interval'],_0xfc0807[_0xddab('0xab')],_0xfc0807[_0xddab('0x60')],_0xfc0807))[_0xddab('0x3b')](_0x37374c[_0xddab('0xac')](_0xfc0807))[_0xddab('0x9e')](loggerCatchQueueSummary(_0xddab('0xad'),_0xfc0807));}else{notSendMessagesCampaign(_0xfc0807);}}}};Dialer[_0xddab('0x17')][_0xddab('0xae')]=function(_0x13ee33){if(_0x13ee33[_0xddab('0xaf')]!=='predictive'){clearPredictiveAttributes(_0x13ee33);}switch(_0x13ee33[_0xddab('0xaf')]){case _0xddab('0xb0'):this[_0xddab('0xb1')](_0x13ee33,0x1);break;case _0xddab('0xb2'):this[_0xddab('0xb1')](_0x13ee33,_0x13ee33['dialPowerLevel']);break;case _0xddab('0x7'):this[_0xddab('0x7')](_0x13ee33);break;case'booked':this[_0xddab('0xb1')](_0x13ee33,0x1);break;default:logger[_0xddab('0x64')](_0xddab('0xb3'),_0x13ee33[_0xddab('0x60')],'method\x20not\x20recognized');}};Dialer['prototype']['ifTime']=function(_0x3514c8,_0x463822){var _0x59b3ca=_0x3514c8[_0xddab('0xab')];var _0x469de7=_0x463822?_0x3514c8[_0xddab('0xa9')]:_0x3514c8[_0xddab('0x76')][_0xddab('0x75')];logger[_0xddab('0xb4')](_0xddab('0xb5'),_0x469de7,_0x59b3ca,_0x3514c8[_0xddab('0x60')],util['format']('Voice\x20Queue\x20%s\x20$s',_0x3514c8[_0xddab('0x60')],_0x3514c8['id']));var _0x9542dc=null;return Interval[_0xddab('0xb6')](_0x469de7,_0x59b3ca)[_0xddab('0x3b')](function(_0x16d527){if(_0x16d527===!![]){return _0x16d527;}else{_0x3514c8[_0xddab('0x6a')]=_0x463822?utils[_0xddab('0x67')][_0xddab('0xa0')]:utils[_0xddab('0x67')][_0xddab('0xb7')];_0x9542dc=msgResponse('[ifTime][promiseAll]',_0xddab('0x8f'),_0xddab('0xa2')+_0x463822+'\x20'+_0x3514c8[_0xddab('0x60')]+_0xddab('0xa3')+util[_0xddab('0x42')](_0x469de7,{'showHidden':![],'depth':null})+_0xddab('0xa4')+_0x59b3ca);}if(_0x9542dc!==null){logger[_0xddab('0xb4')](_0xddab('0xb8'),_0x9542dc);_0x9542dc['isGlobal']=_0x463822;throw _0x9542dc;}})[_0xddab('0x9e')](function(_0x422ff3){logger['error'](_0xddab('0xb9'),_0x422ff3);throw msgResponse(_0xddab('0x82'),_0xddab('0x83'),util[_0xddab('0x42')](_0x422ff3,{'showHidden':![],'depth':null}));});};Dialer['prototype'][_0xddab('0x2a')]=function(_0x387b99){if(this[_0xddab('0x1c')][_0x387b99[_0xddab('0xba')]]){if(this[_0xddab('0xbb')][_0x387b99[_0xddab('0xbc')]]&&this[_0xddab('0xbb')][_0x387b99['uniqueid']]['type']!==_0xddab('0xbd')){this[_0xddab('0xbe')](this[_0xddab('0x1c')][_0x387b99['queue']]);this[_0xddab('0xbb')][_0x387b99[_0xddab('0xbc')]]['answertime']=moment()[_0xddab('0x87')]('YYYY-MM-DD\x20HH:mm:ss');}}};Dialer['prototype']['syncAgentComplete']=function(_0x480091){var _0x33834c=this[_0xddab('0xbb')][_0x480091[_0xddab('0xbc')]];if(this[_0xddab('0x1c')][_0x480091[_0xddab('0xba')]]){if(_0x33834c&&_0x33834c[_0xddab('0x3e')]!==_0xddab('0xbd')){delete this['uniqueId'][_0x480091[_0xddab('0xbc')]];this[_0xddab('0x1c')][_0x480091['queue']][_0xddab('0xbf')]+=0x1;var _0xc70375=new AgentComplete(_0x33834c,_0x480091);if(_0x480091[_0xddab('0xc0')]==='agent'){_0xc70375[_0xddab('0xc1')]=this[_0xddab('0x1c')][_0x480091['queue']]['dialQueueProject2']&&this[_0xddab('0x1c')][_0x480091[_0xddab('0xba')]][_0xddab('0xc2')]?moment()[_0xddab('0x87')]('YYYY-MM-DD\x20HH:mm:ss'):undefined;}hopperUtils[_0xddab('0xc3')](_0xc70375)['catch'](loggerCatch(_0xddab('0xc4')));hopperUtils[_0xddab('0xc5')](_0xc70375)[_0xddab('0x9e')](loggerCatch(_0xddab('0xc6')));}}};Dialer[_0xddab('0x17')][_0xddab('0x2c')]=function(_0x9833c6){var _0x3f12c2=this[_0xddab('0xbb')][_0x9833c6['uniqueid']];var _0x498cf3=this;var _0xb6374=![];var _0x4df003;var _0x180d03;if(this[_0xddab('0x1c')][_0x9833c6[_0xddab('0xba')]]){if(_0x3f12c2&&_0x3f12c2[_0xddab('0x3e')]!==_0xddab('0xbd')){delete this['uniqueId'][_0x9833c6[_0xddab('0xbc')]];this[_0xddab('0xbe')](this[_0xddab('0x1c')][_0x9833c6[_0xddab('0xba')]]);_0x3f12c2['droptime']=moment()[_0xddab('0x87')](_0xddab('0xc7'));var _0x22e1f1=new QueueCallerAbandon(_0x3f12c2,_0x9833c6);if(utils[_0xddab('0x5f')](_0x3f12c2[_0xddab('0xc8')],_0x3f12c2['responsetime'])>=_0x3f12c2['dialQueueTimeout']){this['voiceQueues'][_0x9833c6['queue']][_0xddab('0x49')]+=0x1;this[_0xddab('0x1c')][_0x9833c6[_0xddab('0xba')]]['outboundDropCallsDayTimeout']+=0x1;this[_0xddab('0x1c')][_0x9833c6[_0xddab('0xba')]][_0xddab('0xc9')]+=0x1;_0x22e1f1[_0xddab('0x6d')]=0xa;_0x22e1f1[_0xddab('0x6e')]='Drop';_0x22e1f1['dropreason']=_0xddab('0xca');_0x22e1f1['agiafterat']=this[_0xddab('0x1c')][_0x9833c6[_0xddab('0xba')]][_0xddab('0xcb')]?moment()[_0xddab('0x87')](_0xddab('0xc7')):undefined;_0x22e1f1[_0xddab('0xcc')]+=0x1;_0x22e1f1[_0xddab('0xcd')]+=0x1;_0x4df003=this['voiceQueues'][_0x9833c6[_0xddab('0xba')]][_0xddab('0xce')];_0x180d03=this[_0xddab('0x1c')][_0x9833c6['queue']][_0xddab('0xcf')];hopperUtils[_0xddab('0xd0')](_0x22e1f1,_0x22e1f1[_0xddab('0x6d')],_0x3f12c2[_0xddab('0xd1')])[_0xddab('0x3b')](function(_0xc13e33){_0xb6374=_0xc13e33['additional']==0x1;if(_0x22e1f1['countdropretry']>=_0x498cf3[_0xddab('0x1c')][_0x9833c6['queue']][_0xddab('0xd2')]){_0x498cf3[_0xddab('0xd3')](_0x22e1f1,_0xc13e33['additional']);}else{hopperUtils[_0xddab('0xd4')]({'active':![],'countdropretry':_0x22e1f1[_0xddab('0xcc')],'scheduledat':moment()[_0xddab('0xd5')](_0x498cf3[_0xddab('0x1c')][_0x9833c6['queue']][_0xddab('0xce')],_0xddab('0xd6'))[_0xddab('0x87')](_0xddab('0xc7')),'ContactId':_0x3f12c2['ContactId'],'ListId':_0x3f12c2[_0xddab('0xd7')],'VoiceQueueId':_0x3f12c2[_0xddab('0xd8')]||undefined,'CampaignId':_0x3f12c2[_0xddab('0xd9')]||undefined})[_0xddab('0x9e')](loggerCatch(_0xddab('0xda')));var _0x31d567=new History(_0x22e1f1);_0x31d567[_0xddab('0x6d')]=0xa;_0x31d567[_0xddab('0x6e')]=_0xddab('0xdb');_0x31d567[_0xddab('0x70')]=moment()[_0xddab('0x87')](_0xddab('0xc7'));_0x31d567[_0xddab('0x6f')]=_0x31d567[_0xddab('0x70')];_0x31d567[_0xddab('0xdc')]=_0x22e1f1[_0xddab('0xdc')];_0x31d567[_0xddab('0xdd')]=_0x22e1f1[_0xddab('0xdd')];hopperUtils['createHistory'](_0x31d567)['catch'](loggerCatch('[syncAgentComplete][createHistory][10]'));}})[_0xddab('0x3b')](function(){if(_0xb6374)hopperUtils[_0xddab('0xde')](_0x22e1f1,_0x4df003,_0x180d03)[_0xddab('0x3b')](function(){return 0x1;});});}else{this[_0xddab('0x1c')][_0x9833c6['queue']][_0xddab('0x4b')]+=0x1;this['voiceQueues'][_0x9833c6[_0xddab('0xba')]][_0xddab('0xdf')]+=0x1;_0x22e1f1[_0xddab('0x6d')]=0xb;_0x22e1f1['statedesc']=_0xddab('0xe0');_0x22e1f1['dropreason']=_0xddab('0xe1');_0x22e1f1[_0xddab('0xe2')]+=0x1;_0x22e1f1[_0xddab('0xcd')]+=0x1;_0x4df003=this[_0xddab('0x1c')][_0x9833c6[_0xddab('0xba')]][_0xddab('0xe3')];_0x180d03=this[_0xddab('0x1c')][_0x9833c6[_0xddab('0xba')]][_0xddab('0xcf')];hopperUtils['verifyAdditionalPhones'](_0x22e1f1,_0x22e1f1[_0xddab('0x6d')],_0x3f12c2[_0xddab('0xd1')])[_0xddab('0x3b')](function(_0x30563d){if(_0x22e1f1['countabandonedretry']>=_0x498cf3[_0xddab('0x1c')][_0x9833c6[_0xddab('0xba')]][_0xddab('0xe4')]){_0x498cf3[_0xddab('0xd3')](_0x22e1f1,_0x30563d[_0xddab('0xe5')]);}else{hopperUtils[_0xddab('0xd4')]({'active':![],'countabandonedretry':_0x22e1f1['countabandonedretry'],'scheduledat':moment()[_0xddab('0xd5')](_0x498cf3['voiceQueues'][_0x9833c6[_0xddab('0xba')]][_0xddab('0xe3')],'minutes')[_0xddab('0x87')](_0xddab('0xc7')),'ContactId':_0x3f12c2[_0xddab('0xe6')],'ListId':_0x3f12c2['ListId'],'VoiceQueueId':_0x3f12c2[_0xddab('0xd8')]||undefined,'CampaignId':_0x3f12c2[_0xddab('0xd9')]||undefined})[_0xddab('0x9e')](loggerCatch('[rescheduleContact][Abandoned]'));var _0x111933=new History(_0x22e1f1);_0x111933[_0xddab('0x6d')]=0xb;_0x111933[_0xddab('0x6e')]='Abandoned';_0x111933['starttime']=moment()[_0xddab('0x87')](_0xddab('0xc7'));_0x111933[_0xddab('0x6f')]=_0x111933[_0xddab('0x70')];_0x111933[_0xddab('0xdc')]=_0x22e1f1[_0xddab('0xdc')];_0x111933[_0xddab('0xdd')]=_0x22e1f1[_0xddab('0xdd')];hopperUtils[_0xddab('0xc3')](_0x111933)[_0xddab('0x9e')](loggerCatch(_0xddab('0xe7')));}})[_0xddab('0x3b')](function(){if(_0xb6374)hopperUtils['swapAdditionalPhones'](_0x22e1f1,_0x4df003,_0x180d03)['then'](function(){return 0x1;});});}}}};Dialer[_0xddab('0x17')][_0xddab('0x34')]=function(_0x38af3e){if(this[_0xddab('0x22')][_0x38af3e[_0xddab('0xbc')]]){this['actions'][_0x38af3e[_0xddab('0xbc')]][_0xddab('0xe8')]=_0x38af3e['channel'];}if(this[_0xddab('0xbb')][_0x38af3e[_0xddab('0xbc')]]){this[_0xddab('0xbb')][_0x38af3e['uniqueid']][_0xddab('0xe8')]=_0x38af3e[_0xddab('0xe8')];}};Dialer[_0xddab('0x17')]['syncQueueMember']=function(_0x51212b){if(!this[_0xddab('0x22')][_0x51212b[_0xddab('0xe9')]]){return;}var _0x3074cb=this[_0xddab('0x1c')][this[_0xddab('0x22')][_0x51212b[_0xddab('0xe9')]][_0xddab('0xba')]]['strategy']||_0xddab('0xea');if(_0x3074cb==='roundrobin'){if(this['actions'][_0x51212b['actionid']]&&_[_0xddab('0xeb')](this['actions'][_0x51212b[_0xddab('0xe9')]][_0xddab('0xec')])&&_0x51212b[_0xddab('0x86')]==='1'&&_0x51212b[_0xddab('0xed')]==='0'){if(this['agents'][_0x51212b[_0xddab('0xee')]]){if(!this['agents'][_0x51212b['stateinterface']][_0xddab('0xec')]){this[_0xddab('0x1e')][_0x51212b[_0xddab('0xee')]][_0xddab('0xec')]=!![];this[_0xddab('0x22')][_0x51212b[_0xddab('0xe9')]][_0xddab('0xec')]=!![];this[_0xddab('0x22')][_0x51212b[_0xddab('0xe9')]][_0xddab('0xee')]=_0x51212b['stateinterface'];}}}}else if(_0x3074cb===_0xddab('0xea')){if(this[_0xddab('0x22')][_0x51212b[_0xddab('0xe9')]]){if(this[_0xddab('0x1e')][_0x51212b[_0xddab('0xee')]]){this[_0xddab('0x22')][_0x51212b[_0xddab('0xe9')]][_0xddab('0xee')]=_0x51212b[_0xddab('0xee')];if(_[_0xddab('0xeb')](this['queueBooked'][this[_0xddab('0x22')][_0x51212b[_0xddab('0xe9')]][_0xddab('0xba')]])){this[_0xddab('0x28')][this[_0xddab('0x22')][_0x51212b[_0xddab('0xe9')]][_0xddab('0xba')]]=[];}this[_0xddab('0x28')][this[_0xddab('0x22')][_0x51212b[_0xddab('0xe9')]][_0xddab('0xba')]]['push'](_[_0xddab('0x5e')](_[_0xddab('0xef')](this[_0xddab('0x22')][_0x51212b[_0xddab('0xe9')]],[_0xddab('0xf0'),_0xddab('0xee')]),{'status':_0x51212b[_0xddab('0x86')],'paused':_0x51212b[_0xddab('0xed')]}));}}}};Dialer[_0xddab('0x17')][_0xddab('0x38')]=function(_0x1795c1){if(!this[_0xddab('0x22')][_0x1795c1[_0xddab('0xe9')]]){return;}var _0x17da7b=this;var _0x3a6a63=this[_0xddab('0x1c')][this[_0xddab('0x22')][_0x1795c1[_0xddab('0xe9')]][_0xddab('0xba')]];var _0x210144=_0x3a6a63[_0xddab('0xf1')]||'rrmemory';if(_0x210144===_0xddab('0xf2')){if(this[_0xddab('0x22')][_0x1795c1['actionid']]&&this[_0xddab('0x22')][_0x1795c1[_0xddab('0xe9')]][_0xddab('0xee')]){this[_0xddab('0x1b')]['run'](this[_0xddab('0x22')][_0x1795c1[_0xddab('0xe9')]][_0xddab('0xf0')],this[_0xddab('0x22')][_0x1795c1['actionid']][_0xddab('0xee')])[_0xddab('0x9e')](function(_0x3ca178){logger[_0xddab('0x64')]('[Catch][Preview][syncQueueStatusComplete]',util[_0xddab('0x42')](_0x3ca178,{'showHidden':![],'depth':null}));})['finally'](function(){_0x17da7b[_0xddab('0xbe')](_0x17da7b[_0xddab('0x1c')][_0x17da7b[_0xddab('0x22')][_0x1795c1[_0xddab('0xe9')]][_0xddab('0xba')]]);_0x17da7b[_0xddab('0x1e')][_0x17da7b['actions'][_0x1795c1[_0xddab('0xe9')]][_0xddab('0xee')]][_0xddab('0xec')]=![];delete _0x17da7b[_0xddab('0x22')][_0x1795c1[_0xddab('0xe9')]];unlockQueueStatus(_0x3a6a63);});}else{this[_0xddab('0xbe')](this[_0xddab('0x1c')][this[_0xddab('0x22')][_0x1795c1[_0xddab('0xe9')]][_0xddab('0xba')]]);hopperUtils[_0xddab('0xd4')]({'active':![],'ContactId':this['actions'][_0x1795c1[_0xddab('0xe9')]]['ContactId'],'ListId':this[_0xddab('0x22')][_0x1795c1[_0xddab('0xe9')]][_0xddab('0xd7')],'VoiceQueueId':this[_0xddab('0x22')][_0x1795c1[_0xddab('0xe9')]][_0xddab('0xd8')]||undefined,'CampaignId':this[_0xddab('0x22')][_0x1795c1[_0xddab('0xe9')]]['CampaignId']||undefined})[_0xddab('0x9e')](loggerCatch(_0xddab('0xf3')));delete this[_0xddab('0x22')][_0x1795c1['actionid']];unlockQueueStatus(_0x3a6a63);}}else if(_0x210144===_0xddab('0xea')){var _0x43df9b;if(this['actions'][_0x1795c1[_0xddab('0xe9')]]&&!_[_0xddab('0x44')](this[_0xddab('0x28')][this[_0xddab('0x22')][_0x1795c1[_0xddab('0xe9')]]['queue']])){if(this[_0xddab('0x29')][_0x17da7b[_0xddab('0x22')][_0x1795c1[_0xddab('0xe9')]][_0xddab('0xba')]]){this[_0xddab('0x29')][_0x17da7b[_0xddab('0x22')][_0x1795c1['actionid']][_0xddab('0xba')]]=this[_0xddab('0x29')][this['actions'][_0x1795c1[_0xddab('0xe9')]][_0xddab('0xba')]]?this['queueBookedRR'][this[_0xddab('0x22')][_0x1795c1[_0xddab('0xe9')]][_0xddab('0xba')]]:this[_0xddab('0x28')][this[_0xddab('0x22')][_0x1795c1['actionid']][_0xddab('0xba')]]?this[_0xddab('0x28')][this[_0xddab('0x22')][_0x1795c1[_0xddab('0xe9')]][_0xddab('0xba')]]['_rr']||0x0:0x0;}this[_0xddab('0x28')][this[_0xddab('0x22')][_0x1795c1[_0xddab('0xe9')]][_0xddab('0xba')]][_0xddab('0xf4')]=this[_0xddab('0x29')][this[_0xddab('0x22')][_0x1795c1[_0xddab('0xe9')]][_0xddab('0xba')]];for(var _0x57b2dd=0x0;_0x57b2dd=_0x5b7bb6[_0xddab('0x11a')]){_0x54ef9b[_0xddab('0x11b')](_0x2443c4,_0x1831eb,_0xf499ea,_0xddab('0x11c'));}else{if(_0x2443c4[_0xddab('0x113')]>=_0x5b7bb6[_0xddab('0x11d')]){_0x54ef9b[_0xddab('0x11e')](_0x2443c4,_0x1831eb,_0xf499ea,_0xddab('0x11f'));}else{hopperUtils['rescheduleContact']({'active':![],'countmachineretry':_0x2443c4[_0xddab('0x113')],'scheduledat':moment()[_0xddab('0xd5')](_0x5b7bb6[_0xddab('0x120')],_0xddab('0xd6'))[_0xddab('0x87')](_0xddab('0xc7')),'ContactId':_0x2443c4['ContactId'],'ListId':_0x2443c4[_0xddab('0xd7')],'VoiceQueueId':_0x2443c4[_0xddab('0xd8')]||undefined,'CampaignId':_0x2443c4['CampaignId']||undefined})[_0xddab('0x9e')](loggerCatch(_0xddab('0x121')));_0x1831eb({'reschedule':0x1});}}});}if(_0x4a477c['type']===_0xddab('0xbd')&&this[_0xddab('0x1d')][_0x4a477c[_0xddab('0xba')]]['dialAMDActive']&&_0x4446f2['value']===_0xddab('0x10a')){delete this['uniqueId'][_0x4446f2['uniqueid']];this['updateOriginated'](this[_0xddab('0x1d')][_0x4a477c['queue']]);_0x58633c=new Hangup(_0x4a477c,_0x4446f2);_0x58633c[_0xddab('0x6d')]=0x12;_0x58633c[_0xddab('0x6e')]=_0xddab('0x122');_0x58633c[_0xddab('0x10b')]=_0xddab('0x10c');ami[_0xddab('0x3d')]('custom:amd',ut[_0xddab('0x114')](_0x58633c,_0xddab('0x10e')));this[_0xddab('0x10f')](_0x58633c,_0xddab('0x123'),_0xddab('0x124'));}if(_0x4a477c[_0xddab('0x3e')]===_0xddab('0xbd')&&this[_0xddab('0x1d')][_0x4a477c[_0xddab('0xba')]][_0xddab('0x108')]&&_0x4446f2['value']==='MACHINE'){return new Promise(function(_0x5c7f9e,_0x274a67){delete _0x54ef9b[_0xddab('0xbb')][_0x4446f2[_0xddab('0xbc')]];_0x54ef9b[_0xddab('0xbe')](_0x54ef9b[_0xddab('0x1d')][_0x4a477c['queue']]);_0x54ef9b['campaigns'][_0x4a477c[_0xddab('0xba')]][_0xddab('0xbf')]+=0x1;_0x54ef9b['campaigns'][_0x4a477c[_0xddab('0xba')]][_0xddab('0x125')]+=0x1;var _0x1b1831=_0x54ef9b['campaigns'][_0x4a477c[_0xddab('0xba')]];var _0x1ddf3e=new Hangup(_0x4a477c,_0x4446f2);_0x1ddf3e[_0xddab('0x6d')]=0x13;_0x1ddf3e[_0xddab('0x6e')]=_0xddab('0x112');_0x1ddf3e['membername']=_0xddab('0x10c');_0x1ddf3e[_0xddab('0x113')]+=0x1;_0x1ddf3e['countglobal']+=0x1;_0x1ddf3e['amd']=!![];ami['emit']('custom:amd',ut[_0xddab('0x114')](_0x1ddf3e,_0xddab('0x10e')));hopperUtils[_0xddab('0xc3')](_0x1ddf3e)[_0xddab('0x9e')](loggerCatch('[syncAgentComplete][createHistory][0]'));if(_0x1ddf3e[_0xddab('0x116')]+_0x1ddf3e[_0xddab('0x126')]+_0x1ddf3e[_0xddab('0x117')]+_0x1ddf3e[_0xddab('0x118')]+_0x1ddf3e[_0xddab('0xcc')]+_0x1ddf3e[_0xddab('0xe2')]+_0x1ddf3e[_0xddab('0x113')]+_0x1ddf3e['countagentrejectretry']>=_0x1b1831[_0xddab('0x11a')]){_0x54ef9b[_0xddab('0x11b')](_0x1ddf3e,_0x5c7f9e,_0x274a67,'reason19\x20machine....');}else{if(_0x1ddf3e[_0xddab('0x113')]>=_0x1b1831['dialMachineMaxRetry']){_0x54ef9b[_0xddab('0x11e')](_0x1ddf3e,_0x5c7f9e,_0x274a67,'reason\x2019\x20machine....');}else{hopperUtils[_0xddab('0xd4')]({'active':![],'countmachineretry':_0x1ddf3e['countmachineretry'],'scheduledat':moment()['add'](_0x1b1831[_0xddab('0x120')],_0xddab('0xd6'))['format'](_0xddab('0xc7')),'ContactId':_0x1ddf3e[_0xddab('0xe6')],'ListId':_0x1ddf3e[_0xddab('0xd7')],'VoiceQueueId':_0x1ddf3e['VoiceQueueId']||undefined,'CampaignId':_0x1ddf3e[_0xddab('0xd9')]||undefined})['catch'](loggerCatch(_0xddab('0x121')));_0x5c7f9e({'reschedule':0x1});}}});}}};Dialer[_0xddab('0x17')][_0xddab('0x127')]=function(_0x3d17de){var _0x177a4a=this[_0xddab('0xbb')][_0x3d17de[_0xddab('0xbc')]];var _0x3a2ec2;if(_0x177a4a&&_0x177a4a['type']===_0xddab('0xbd')){delete this[_0xddab('0xbb')][_0x3d17de['uniqueid']];this[_0xddab('0xbe')](this[_0xddab('0x1d')][_0x177a4a[_0xddab('0xba')]]);this[_0xddab('0x1d')][_0x177a4a[_0xddab('0xba')]][_0xddab('0x128')]+=0x1;_0x3a2ec2=new Hangup(_0x177a4a,_0x3d17de);hopperUtils['createHistory'](_0x3a2ec2)[_0xddab('0x9e')](loggerCatch(_0xddab('0x129')));hopperUtils[_0xddab('0xc5')](_0x3a2ec2)[_0xddab('0x9e')](loggerCatch(_0xddab('0x12a')));}if(_0x177a4a&&_0x177a4a[_0xddab('0x3e')]!==_0xddab('0xbd')&&isNotNull(this[_0xddab('0x1c')][_0x177a4a[_0xddab('0xba')]][_0xddab('0x12b')])){delete this[_0xddab('0xbb')][_0x3d17de[_0xddab('0xbc')]];this['updateOriginated'](this[_0xddab('0x1c')][_0x177a4a[_0xddab('0xba')]]);this[_0xddab('0x1c')][_0x177a4a['queue']][_0xddab('0xbf')]+=0x1;this['voiceQueues'][_0x177a4a['queue']]['outboundAnswerAgiCallsDay']+=0x1;_0x3a2ec2=new Hangup(_0x177a4a,_0x3d17de);_0x3a2ec2['state']=0x10;_0x3a2ec2[_0xddab('0x6e')]='AnswerAGI';_0x3a2ec2[_0xddab('0x10b')]='AGI';hopperUtils[_0xddab('0xc3')](_0x3a2ec2)[_0xddab('0x9e')](loggerCatch(_0xddab('0x129')));hopperUtils[_0xddab('0xc5')](_0x3a2ec2)['catch'](loggerCatch(_0xddab('0x12a')));}if(_0x177a4a&&_0x177a4a['type']!==_0xddab('0xbd')&&!isNotNull(this['voiceQueues'][_0x177a4a['queue']]['dialQueueProject'])){delete this['uniqueId'][_0x3d17de[_0xddab('0xbc')]];this[_0xddab('0xbe')](this[_0xddab('0x1c')][_0x177a4a[_0xddab('0xba')]]);this[_0xddab('0x1c')][_0x177a4a[_0xddab('0xba')]][_0xddab('0x12c')]+=0x1;_0x3a2ec2=new Hangup(_0x177a4a,_0x3d17de);_0x3a2ec2[_0xddab('0x6d')]=0xc;_0x3a2ec2['statedesc']=_0x3d17de[_0xddab('0x12d')];_0x3a2ec2[_0xddab('0x10b')]='Unknow';hopperUtils['createHistory'](_0x3a2ec2)[_0xddab('0x9e')](loggerCatch('[syncHangupIvr][createHistory]'));hopperUtils['moveContactManagedDialer'](_0x3a2ec2)[_0xddab('0x9e')](loggerCatch(_0xddab('0x12a')));}};Dialer[_0xddab('0x17')][_0xddab('0x9')]=function(_0x135137){var _0x1bf511=this;if(!_0x1bf511[_0xddab('0x12e')][_0x135137[_0xddab('0x60')]]){_0x1bf511[_0xddab('0x12e')][_0x135137[_0xddab('0x60')]]={'running':![]};}else if(_0x1bf511[_0xddab('0x12e')][_0x135137[_0xddab('0x60')]][_0xddab('0x12f')]===!![]){return;}else if(_0x1bf511[_0xddab('0x12e')][_0x135137[_0xddab('0x60')]][_0xddab('0x12f')]===![]){_0x1bf511['queuesSummary'][_0x135137[_0xddab('0x60')]][_0xddab('0x12f')]=!![];}var _0x1825cc=_0x1bf511[_0xddab('0x1c')][_0x135137[_0xddab('0x60')]];var _0x551225=_0x1825cc[_0xddab('0x6a')]!==utils[_0xddab('0x67')][_0xddab('0x78')];var _0x245432=utils[_0xddab('0x130')](_0x1825cc);_0x1825cc[_0xddab('0x131')]=utils['getQueueCampaignStatusMessage'](_0x1825cc,_0x1bf511['trunks']);Promise[_0xddab('0xa8')]()[_0xddab('0x3b')](function(){if(_0x1825cc[_0xddab('0x131')]===utils[_0xddab('0x67')][_0xddab('0x78')]){if(_0x551225){clearPredictiveAttributes(_0x1825cc);_0x135137[_0xddab('0x25')]=undefined;_0x135137[_0xddab('0x26')]=undefined;}if(_0x1825cc['statusMessage']===utils[_0xddab('0x67')]['INACTIVE']){_0x135137[_0xddab('0x132')]=0x0;_0x135137[_0xddab('0xed')]=0x0;_0x135137['inUse']=0x0;_0x135137[_0xddab('0x133')]=0x0;_0x135137[_0xddab('0x134')]=0x0;}}else if(_0x1825cc[_0xddab('0x131')]===utils['CAMPAIGN_STATUS'][_0xddab('0x135')]&&!_0x245432){return _0x1bf511[_0xddab('0x93')](_0x1825cc,!![])[_0xddab('0x3b')](function(){return _0x1bf511[_0xddab('0x93')](_0x1825cc,![]);})[_0xddab('0x3b')](function(){return _0x1bf511[_0xddab('0xae')](_0x1825cc);})['catch'](function(_0x3defbb){loggerSyncQueueSummary[_0xddab('0x40')](_0xddab('0x136'),util[_0xddab('0x42')](_0x3defbb,{'showHidden':![],'depth':null}));clearPredictiveAttributes(_0x1825cc);});}else{clearPredictiveAttributes(_0x1825cc);}})['then'](function(){var _0xa3e50f=_0x135137[_0xddab('0x137')](_0x1825cc);if(_0xa3e50f||_0x1825cc['queueSummaryCountersUpdated']){_0x1825cc['queueSummaryCountersUpdated']=![];_0x135137[_0xddab('0x138')](_0x1825cc);Object[_0xddab('0x139')](_0x1825cc,_0x135137);emitOutboundVoiceQueueSummary(_0x135137);}_0x1bf511[_0xddab('0x12e')][_0x1825cc[_0xddab('0x60')]][_0xddab('0x12f')]=![];})['catch'](function(_0x580833){logger[_0xddab('0x64')](_0xddab('0x136'),util['inspect'](_0x580833,{'showHidden':![],'depth':null}));_0x1bf511[_0xddab('0x12e')][_0x1825cc[_0xddab('0x60')]][_0xddab('0x12f')]=![];});};Dialer['prototype'][_0xddab('0x32')]=_['throttle'](function(){var _0x35e2e9=_['filter'](this['voiceQueues'],function(_0x30aa5d){return _0x30aa5d[_0xddab('0x13a')];});var _0x1c67a7=_[_0xddab('0x13b')](this[_0xddab('0x1e')],function(_0x3adf55){return _0x3adf55[_0xddab('0x13c')]&&_0x3adf55[_0xddab('0x86')]===_0xddab('0x13d');});if(_0x35e2e9[_0xddab('0x95')]>0x0&&_0x1c67a7[_0xddab('0x95')]>0x0){return Promise[_0xddab('0xa8')]()[_0xddab('0x3b')](cmHopper['handlePreviewRecallNotifications'](_[_0xddab('0x13e')](_0x35e2e9,'id'),previewRecallmeReminderInterval,_['map'](_0x1c67a7,'id')))['then'](function(_0x154112){for(var _0xe55fd8=0x0;_0xe55fd8<_0x154112['length'];_0xe55fd8++){var _0x130fff=_0x154112[_0xe55fd8][_0xddab('0x13f')][_0xddab('0x60')];if(_0x130fff)io['to'](util[_0xddab('0x87')](_0xddab('0x140'),_0x130fff))[_0xddab('0x3d')](_0xddab('0x141'),{'hopper':_0x154112[_0xe55fd8]});}})[_0xddab('0x9e')](function(_0x123bb9){logger[_0xddab('0x64')]('checkPreviewRecallReminder',_0x123bb9);});}},0x3c*0x3e8,{'leading':!![]});Dialer['prototype']['loopClearZombieChannels']=function(){var _0x22ed15=this;setInterval(function(){_0x22ed15[_0xddab('0x142')](_0x22ed15[_0xddab('0xbb')],_0xddab('0x143'));_0x22ed15[_0xddab('0x142')](_0x22ed15['actions'],_0xddab('0x144'));},0x32c8);};Dialer[_0xddab('0x17')][_0xddab('0x142')]=function(_0x3886a7,_0x40c03f){var _0x3fccc6=this;for(var _0x48ef10 in _0x3886a7){if(typeof _0x3886a7[_0x48ef10]!=='undefined'){this['sequence'][_0xddab('0x18')](function(){if(!_['isNil'](_0x3886a7[_0x48ef10])){return ami[_0xddab('0x9c')]({'action':'status','channel':_0x3886a7[_0x48ef10][_0xddab('0xe8')]})[_0xddab('0x9e')](function(_0xbe790d){if(_0xbe790d['message']===_0xddab('0x145')){setTimeout(function(){if(_0x3886a7[_0x48ef10]&&_0x3886a7[_0x48ef10][_0xddab('0x3e')]!==_0xddab('0xbd')){_0x3fccc6[_0xddab('0xbe')](_0x3fccc6['voiceQueues'][_0x3886a7[_0x48ef10]['queue']]);logger[_0xddab('0x64')](_0xddab('0x146'),_0x40c03f,_0x48ef10,_0x3886a7[_0x48ef10][_0xddab('0xba')]);delete _0x3886a7[_0x48ef10];}if(_0x3886a7[_0x48ef10]&&_0x3886a7[_0x48ef10][_0xddab('0x3e')]===_0xddab('0xbd')){_0x3fccc6[_0xddab('0xbe')](_0x3fccc6[_0xddab('0x1d')][_0x3886a7[_0x48ef10][_0xddab('0xba')]]);logger[_0xddab('0x64')](_0xddab('0x147'),_0x40c03f,_0x48ef10,_0x3886a7[_0x48ef10][_0xddab('0xba')]);delete _0x3886a7[_0x48ef10];}},0x2328);}});}});}}};Dialer[_0xddab('0x17')][_0xddab('0x148')]=function(_0x56d091){return Promise[_0xddab('0xa8')]()[_0xddab('0x3b')](voiceQueueRt[_0xddab('0x148')](_0x56d091))[_0xddab('0x9e')](loggerCatch(_0xddab('0x149')));};Dialer['prototype']['updateOriginated']=function(_0x54ea38){if(!_[_0xddab('0x50')](_0x54ea38)&&_0x54ea38!==null){if(typeof _0x54ea38[_0xddab('0x7c')]!=='undefined'){if(_0x54ea38['originated']>0x0){_0x54ea38['originated']-=0x1;}else{logger['error'](_0xddab('0x14a'));}}}else{logger[_0xddab('0x64')](_0xddab('0x14b'));}};Dialer['prototype'][_0xddab('0x14c')]=function(_0x23e3c5,_0x36a0d3){var _0x32667a=this;return function(_0x2a6f2d){_0x32667a[_0xddab('0xbe')](_0x36a0d3);logger[_0xddab('0x64')](_0x23e3c5,util[_0xddab('0x42')](_0x2a6f2d,{'showHidden':![],'depth':null}));};};Dialer[_0xddab('0x17')]['emptyContact']=function(_0xd794e,_0x6bdf2,_0x461f1f){var _0x41c82e={'state':0x19,'statedesc':_0xddab('0x14d')};this[_0xddab('0xbe')](_0x6bdf2);this['saveInDb'](_['merge'](_0x41c82e,_['pick'](_0x461f1f,[_0xddab('0xe6'),_0xddab('0xd7'),_0xddab('0x14e'),_0xddab('0xd8'),_0xddab('0xd9')])),_0xddab('0x14f'),'[emptyContact]');logger[_0xddab('0x64')](_0xd794e);};Dialer[_0xddab('0x17')]['saveInDb']=function(_0x522513,_0xe20fbe,_0xc5d587){hopperUtils[_0xddab('0xc3')](_0x522513)['catch'](loggerCatch(_0xe20fbe));hopperUtils['moveContactManagedDialer'](_0x522513)['catch'](loggerCatch(_0xc5d587));};Dialer[_0xddab('0x17')]['queueCallerAbandonCreateState']=function(_0x3fbae2,_0x69b252){hopperUtils[_0xddab('0xc3')](_0x3fbae2)[_0xddab('0x9e')](loggerCatch('[syncAgentComplete][createHistory]'));if(_0x69b252==0x0){hopperUtils[_0xddab('0xc5')](_0x3fbae2)[_0xddab('0x9e')](loggerCatch('[syncQueueCallerAbandon]\x20[Drop]'));}};Dialer[_0xddab('0x17')][_0xddab('0x150')]=function(_0x1abebd){return Promise['resolve']()['then'](cmHopper[_0xddab('0x151')](_0x1abebd['id'],previewRecallmeReminderInterval))[_0xddab('0x3b')](function(_0x3f6341){for(var _0xaabd3d=0x0;_0xaabd3d<_0x3f6341[_0xddab('0x95')];_0xaabd3d++){var _0x11db51=_0x3f6341[_0xaabd3d]['Agent'][_0xddab('0x60')];if(_0x11db51)io['to'](util['format'](_0xddab('0x140'),_0x11db51))['emit'](_0xddab('0x141'),{'hopper':_0x3f6341[_0xaabd3d]});}})[_0xddab('0x9e')](function(){});};Dialer[_0xddab('0x17')][_0xddab('0xac')]=function(_0x21b9cd){var _0x3e8cf0=this;return function(){_0x3e8cf0['handleIvr'](_0x21b9cd);};};Dialer[_0xddab('0x17')][_0xddab('0x152')]=function(_0x23f146,_0x6cb7ec){var _0x2eef52=this;var _0x3f4b7d=uuid['v4']();this['actions'][_0x3f4b7d]=new Action(_0x23f146,_0x6cb7ec,_0x3f4b7d);return new Promise(function(_0x597857,_0x1d3f17){if(_['isUndefined'](_0x23f146)&&typeof _0x23f146!=='object'){return _0x1d3f17(msgResponse(_0xddab('0x153'),_0xddab('0x8f'),_0xddab('0x154')));}if(_[_0xddab('0x50')](_0x6cb7ec['phone'])||_0x6cb7ec['phone']===null){return _0x1d3f17(msgResponse(_0xddab('0x153'),'Failure',_0xddab('0x155')));}var _0x536cb0={'XMD-CALLERID':_0x2eef52[_0xddab('0x22')][_0x3f4b7d][_0xddab('0x156')](),'XMD-AGI':_0x23f146[_0xddab('0x12b')]?util[_0xddab('0x87')](_0xddab('0x157'),ipAgi,_0x23f146['dialQueueProject']):'NONE','XMD-AGIAFTER':_0x23f146['dialQueueProject2']?util[_0xddab('0x87')](_0xddab('0x157'),ipAgi,_0x23f146[_0xddab('0xcb')]):_0xddab('0x158'),'XMD-QUEUE':utils['isOutboundQueue'](_0x23f146)?util[_0xddab('0x87')]('\x22%s,%s%s,,,%s\x22',_0x23f146['name'],_0x23f146[_0xddab('0x159')]||'',_0x23f146[_0xddab('0xc2')]?'c':'',_0x23f146[_0xddab('0x15a')]||0x3):_0xddab('0x158'),'XMD-CONTACTID':_0x6cb7ec[_0xddab('0xe6')],'XMD-CDRTYPE':_0xddab('0x6'),'CALLERID(all)':_0x2eef52[_0xddab('0x22')][_0x3f4b7d][_0xddab('0x156')](),'XMD-AMD':_0x23f146[_0xddab('0x108')]?_0xddab('0x135'):_0xddab('0x158'),'XMD-DESTINATION':_0xddab('0x107')};if(_0x23f146['dialAMDActive']){_0x536cb0['XMD-AMDINITIALSILENCE']=_0x23f146[_0xddab('0x15b')]||0x9c4;_0x536cb0[_0xddab('0x15c')]=_0x23f146['dialAMDGreeting']||0x5dc;_0x536cb0['XMD-AMDAFTERGREETINGSILENCE']=_0x23f146['dialAMDAfterGreetingSilence']||0x320;_0x536cb0[_0xddab('0x15d')]=_0x23f146[_0xddab('0x15e')]||0x1388;_0x536cb0[_0xddab('0x15f')]=_0x23f146[_0xddab('0x160')]||0x64;_0x536cb0[_0xddab('0x161')]=_0x23f146['dialAMDBetweenWordsSilence']||0x32;_0x536cb0['XMD-AMDMAXIMUMNUMBEROFWORDS']=_0x23f146[_0xddab('0x162')]||0x3;_0x536cb0['XMD-AMDSILENCETHRESHOLD']=_0x23f146[_0xddab('0x163')]||0x100;_0x536cb0[_0xddab('0x164')]=_0x23f146[_0xddab('0x165')]||0x1388;}if(utils[_0xddab('0x166')](_0x23f146)){_0x536cb0[_0xddab('0x167')]=_0x6cb7ec[_0xddab('0xd8')];}else{_0x536cb0['XMD-CAMPAIGNID']=_0x6cb7ec['CampaignId'];}var _0x2d3c68=utils[_0xddab('0x168')](_0x6cb7ec['Contact']);Object['assign'](_0x536cb0,_0x2d3c68);var _0x5802f0=_0x2eef52[_0xddab('0x84')](_0x23f146[_0xddab('0x169')])?utils[_0xddab('0x16a')](_0x23f146[_0xddab('0x169')][_0xddab('0x16b')],_0x23f146[_0xddab('0x16c')],_0x23f146['dialRandomLastDigitCallerIdNumber']>0x0?utils[_0xddab('0x16d')](_0x23f146[_0xddab('0x16e')],_0x23f146[_0xddab('0x16f')]):_0x23f146[_0xddab('0x16e')]):utils['getCallerId'](_[_0xddab('0xeb')](_0x23f146['TrunkBackup'])?_0x23f146['Trunk'][_0xddab('0x16b')]:_0x23f146['TrunkBackup']['callerid'],_0x23f146[_0xddab('0x16c')],_0x23f146[_0xddab('0x16f')]>0x0?utils[_0xddab('0x16d')](_0x23f146[_0xddab('0x16e')],_0x23f146['dialRandomLastDigitCallerIdNumber']):_0x23f146[_0xddab('0x16e')]);if(_0x5802f0){_0x536cb0[_0xddab('0x170')]=_0x2eef52['actions'][_0x3f4b7d][_0xddab('0x171')]=utils[_0xddab('0x172')](_0x5802f0);_0x536cb0[_0xddab('0x173')]=_0x6cb7ec[_0xddab('0x174')];}_0x23f146[_0xddab('0x175')]=_0x536cb0;return ami[_0xddab('0x9c')]({'actionid':_0x3f4b7d,'action':_0xddab('0x153'),'channel':_0x2eef52['isTrunkReachable'](_0x23f146[_0xddab('0x169')])?util[_0xddab('0x87')](_0xddab('0x176'),_0x23f146[_0xddab('0x169')][_0xddab('0x60')],isNotNull(_0x23f146[_0xddab('0x177')])?_0x23f146[_0xddab('0x177')][_0xddab('0x178')]()||'':'',_0x23f146[_0xddab('0x179')]>0x0?_0x6cb7ec[_0xddab('0x174')][_0xddab('0x17a')](_0x23f146[_0xddab('0x179')]):_0x6cb7ec[_0xddab('0x174')]):util[_0xddab('0x87')](_0xddab('0x176'),_[_0xddab('0xeb')](_0x23f146['TrunkBackup'])?_0x23f146['Trunk'][_0xddab('0x60')]:_0x23f146[_0xddab('0x8b')][_0xddab('0x60')],isNotNull(_0x23f146['dialPrefix'])?_0x23f146[_0xddab('0x177')][_0xddab('0x178')]()||'':'',_0x23f146['dialCutDigit']>0x0?_0x6cb7ec[_0xddab('0x174')][_0xddab('0x17a')](_0x23f146[_0xddab('0x179')]):_0x6cb7ec[_0xddab('0x174')]),'callerid':_0x5802f0,'Exten':'xcally-motion-dialer','Context':_0xddab('0x17b'),'Priority':'1','variable':_0x536cb0,'timeout':(_0x23f146[_0xddab('0x17c')]||0x1e)*0x3e8,'async':!![],'channelid':_0x3f4b7d})[_0xddab('0x3b')](function(_0x4107a2){return _0x597857(_0x4107a2);})['catch'](function(_0x1ec801){_0x23f146[_0xddab('0x17d')]+=0x1;var _0x29b35c=new History(_0x2eef52[_0xddab('0x22')][_0x3f4b7d]);logger[_0xddab('0x64')](util[_0xddab('0x87')](_0xddab('0x17e'),JSON[_0xddab('0x73')](_0x1ec801)));_0x29b35c[_0xddab('0x6d')]=0xe;_0x29b35c[_0xddab('0x6e')]=_0xddab('0x17f');_0x29b35c['starttime']=moment()[_0xddab('0x87')](_0xddab('0xc7'));_0x29b35c[_0xddab('0x6f')]=_0x29b35c['starttime'];hopperUtils[_0xddab('0xc3')](_0x29b35c)[_0xddab('0x9e')](loggerCatch(_0xddab('0x180')));_0x2eef52[_0xddab('0xc5')](_0x29b35c)[_0xddab('0x9e')](loggerCatch(_0xddab('0x180')))['finally'](function(){delete _0x2eef52['actions'][_0x3f4b7d];return _0x1d3f17(msgResponse(_0xddab('0x153'),'Error','originate\x20action\x20Error'));});});});};Dialer[_0xddab('0x17')][_0xddab('0x181')]=function(_0x27a777,_0x3bc496,_0x5af9f7){var _0x2a4169=new History(_0x3bc496);if(_0x2a4169[_0xddab('0x116')]+_0x2a4169['countcongestionretry']+_0x2a4169[_0xddab('0x117')]+_0x2a4169['countnosuchnumberretry']+_0x2a4169[_0xddab('0xcc')]+_0x2a4169[_0xddab('0xe2')]+_0x2a4169[_0xddab('0x113')]+_0x2a4169[_0xddab('0x119')]>=_0x5af9f7['dialGlobalMaxRetry']-0x1){return!![];}switch(_0x27a777){case 0x3:if(_0x2a4169[_0xddab('0x117')]>=_0x5af9f7[_0xddab('0x182')]-0x1){return!![];}hopperUtils[_0xddab('0xd4')]({'active':![],'countnoanswerretry':_0x2a4169[_0xddab('0x117')]+=0x1,'scheduledat':moment()[_0xddab('0xd5')](_0x5af9f7[_0xddab('0x183')],_0xddab('0xd6'))['format']('YYYY-MM-DD\x20HH:mm:ss'),'ContactId':_0x2a4169[_0xddab('0xe6')],'ListId':_0x2a4169['ListId'],'VoiceQueueId':_0x2a4169['VoiceQueueId']||undefined,'CampaignId':_0x2a4169[_0xddab('0xd9')]||undefined})[_0xddab('0x9e')](loggerCatch(_0xddab('0x184')));break;case 0x5:if(_0x2a4169[_0xddab('0x116')]>=_0x5af9f7[_0xddab('0x185')]-0x1){return!![];}hopperUtils[_0xddab('0xd4')]({'active':![],'countbusyretry':_0x2a4169[_0xddab('0x116')]+=0x1,'scheduledat':moment()[_0xddab('0xd5')](_0x5af9f7[_0xddab('0x186')],_0xddab('0xd6'))['format'](_0xddab('0xc7')),'ContactId':_0x2a4169[_0xddab('0xe6')],'ListId':_0x2a4169[_0xddab('0xd7')],'VoiceQueueId':_0x2a4169['VoiceQueueId']||undefined,'CampaignId':_0x2a4169[_0xddab('0xd9')]||undefined})[_0xddab('0x9e')](loggerCatch('[rescheduleContact]\x20[Busy]'));break;case 0x8:if(_0x2a4169[_0xddab('0x126')]>=_0x5af9f7[_0xddab('0x187')]-0x1){return!![];}hopperUtils[_0xddab('0xd4')]({'active':![],'countcongestionretry':_0x2a4169[_0xddab('0x126')]+=0x1,'scheduledat':moment()[_0xddab('0xd5')](_0x5af9f7[_0xddab('0x188')],'minutes')[_0xddab('0x87')]('YYYY-MM-DD\x20HH:mm:ss'),'ContactId':_0x2a4169['ContactId'],'ListId':_0x2a4169[_0xddab('0xd7')],'VoiceQueueId':_0x2a4169[_0xddab('0xd8')]||undefined,'CampaignId':_0x2a4169[_0xddab('0xd9')]||undefined})[_0xddab('0x9e')](loggerCatch('[rescheduleContact]\x20[Congestion]'));break;case 0x0:if(_0x2a4169[_0xddab('0x118')]>=_0x5af9f7['dialNoSuchNumberMaxRetry']-0x1){return!![];}else{hopperUtils['rescheduleContact']({'active':![],'countnosuchnumberretry':_0x2a4169[_0xddab('0x118')]+=0x1,'scheduledat':moment()['add'](_0x5af9f7[_0xddab('0x189')],_0xddab('0xd6'))['format'](_0xddab('0xc7')),'ContactId':_0x2a4169[_0xddab('0xe6')],'ListId':_0x2a4169[_0xddab('0xd7')],'VoiceQueueId':_0x2a4169[_0xddab('0xd8')]||undefined,'CampaignId':_0x2a4169[_0xddab('0xd9')]||undefined})[_0xddab('0x9e')](loggerCatch(_0xddab('0x18a')));}break;case 0xa:if(_0x2a4169[_0xddab('0xcc')]>=_0x5af9f7[_0xddab('0xd2')]-0x1){return!![];}hopperUtils['rescheduleContact']({'active':![],'countdropretry':_0x2a4169[_0xddab('0xcc')]+=0x1,'scheduledat':moment()[_0xddab('0xd5')](_0x5af9f7[_0xddab('0xce')],'minutes')[_0xddab('0x87')](_0xddab('0xc7')),'ContactId':_0x2a4169['ContactId'],'ListId':_0x2a4169[_0xddab('0xd7')],'VoiceQueueId':_0x2a4169[_0xddab('0xd8')]||undefined,'CampaignId':_0x2a4169[_0xddab('0xd9')]||undefined})[_0xddab('0x9e')](loggerCatch('[rescheduleContact][Drop]'));break;case 0xb:if(_0x2a4169[_0xddab('0xe2')]>=_0x5af9f7['dialAbandonedMaxRetry']-0x1){return!![];}hopperUtils[_0xddab('0xd4')]({'active':![],'countabandonedretry':_0x2a4169[_0xddab('0xe2')]+=0x1,'scheduledat':moment()[_0xddab('0xd5')](_0x5af9f7[_0xddab('0xe3')],_0xddab('0xd6'))[_0xddab('0x87')](_0xddab('0xc7')),'ContactId':_0x2a4169['ContactId'],'ListId':_0x2a4169[_0xddab('0xd7')],'VoiceQueueId':_0x2a4169[_0xddab('0xd8')]||undefined,'CampaignId':_0x2a4169['CampaignId']||undefined})[_0xddab('0x9e')](loggerCatch(_0xddab('0x18b')));break;case 0x13:if(_0x2a4169[_0xddab('0x113')]>=_0x5af9f7['dialMachineMaxRetry']-0x1){return!![];}hopperUtils['rescheduleContact']({'active':![],'countmachineretry':_0x2a4169[_0xddab('0x113')]+=0x1,'scheduledat':moment()[_0xddab('0xd5')](_0x5af9f7['dialMachineRetryFrequency'],_0xddab('0xd6'))[_0xddab('0x87')]('YYYY-MM-DD\x20HH:mm:ss'),'ContactId':_0x2a4169[_0xddab('0xe6')],'ListId':_0x2a4169[_0xddab('0xd7')],'VoiceQueueId':_0x2a4169[_0xddab('0xd8')]||undefined,'CampaignId':_0x2a4169[_0xddab('0xd9')]||undefined})[_0xddab('0x9e')](loggerCatch('[rescheduleContact][Machine]'));break;case 0x14:if(_0x2a4169[_0xddab('0x119')]>=_0x5af9f7[_0xddab('0x18c')]-0x1){return!![];}hopperUtils['rescheduleContact']({'active':![],'countagentrejectretry':_0x2a4169[_0xddab('0x119')]+=0x1,'scheduledat':moment()[_0xddab('0xd5')](_0x5af9f7['dialAgentRejectRetryFrequency'],_0xddab('0xd6'))[_0xddab('0x87')](_0xddab('0xc7')),'ContactId':_0x2a4169[_0xddab('0xe6')],'ListId':_0x2a4169[_0xddab('0xd7')],'VoiceQueueId':_0x2a4169[_0xddab('0xd8')]||undefined,'CampaignId':_0x2a4169[_0xddab('0xd9')]||undefined})[_0xddab('0x9e')](loggerCatch(_0xddab('0x18d')));break;default:return!![];}};Dialer[_0xddab('0x17')][_0xddab('0x18e')]=function(_0x212401,_0x9d360c,_0x18bccd){var _0x19991a=this;var _0x391bf8=new History(_0x212401);var _0x28278c=![];var _0x50d986;var _0x5dd977;return new Promise(function(_0x35fdbf,_0x3808a5){if(_[_0xddab('0x50')](_0x9d360c)&&typeof _0x9d360c!==_0xddab('0x18f')){return _0x3808a5(msgResponse(_0xddab('0x190'),_0xddab('0x8f'),'entity\x20is\x20undefine'));}if(_[_0xddab('0x50')](_0x18bccd)&&typeof _0x18bccd!==_0xddab('0x18f')){return _0x3808a5(msgResponse(_0xddab('0x190'),_0xddab('0x8f'),_0xddab('0x191')));}hopperUtils[_0xddab('0xd0')](_0x391bf8,_0x18bccd[_0xddab('0xc0')],_0x9d360c)[_0xddab('0x3b')](function(_0x1b7759){if(_0x1b7759[_0xddab('0xe5')]==0x1)_0x28278c=!![];switch(_0x18bccd[_0xddab('0xc0')]){case'0':_0x9d360c[_0xddab('0x192')]+=0x1;_0x391bf8[_0xddab('0x6d')]=0x0;_0x391bf8[_0xddab('0x6e')]=_0xddab('0x193');_0x391bf8[_0xddab('0x118')]+=0x1;_0x391bf8[_0xddab('0xcd')]+=0x1;ami[_0xddab('0x3d')](_0xddab('0x194'),ut['buildObj'](_0x212401,_0xddab('0x195')));_0x50d986=_0x9d360c[_0xddab('0x189')];_0x5dd977=_0x9d360c[_0xddab('0xcf')];hopperUtils[_0xddab('0xc3')](_0x391bf8)[_0xddab('0x9e')](loggerCatch('[syncAgentComplete][createHistory][0]'));if(_0x19991a[_0xddab('0x181')](0x0,_0x212401,_0x9d360c)&&!_0x28278c){if(_0x391bf8[_0xddab('0x118')]>=_0x9d360c[_0xddab('0x196')]){_0x19991a[_0xddab('0x11e')](_0x391bf8,_0x35fdbf,_0x3808a5,_0xddab('0x197'));}else{_0x19991a[_0xddab('0x11b')](_0x391bf8,_0x35fdbf,_0x3808a5,'reason\x200\x20no\x20such\x20number....');}}break;case'3':_0x9d360c[_0xddab('0x198')]+=0x1;_0x391bf8[_0xddab('0x6d')]=0x3;_0x391bf8[_0xddab('0x6e')]=_0xddab('0x199');_0x391bf8[_0xddab('0x117')]+=0x1;_0x391bf8['countglobal']+=0x1;var _0x3e8ff1=ut[_0xddab('0x19a')](_0x212401,_0x9d360c);ami['emit'](_0xddab('0x19b'),_0x3e8ff1);_0x50d986=_0x9d360c[_0xddab('0x183')];_0x5dd977=_0x9d360c[_0xddab('0xcf')];hopperUtils['createHistory'](_0x391bf8)[_0xddab('0x9e')](loggerCatch(_0xddab('0x19c')));if(_0x19991a[_0xddab('0x181')](0x3,_0x212401,_0x9d360c)&&!_0x28278c){if(_0x391bf8[_0xddab('0x117')]>=_0x9d360c['dialNoAnswerMaxRetry']){_0x19991a['createStateFinal'](_0x391bf8,_0x35fdbf,_0x3808a5,_0xddab('0x19d'));}else{_0x19991a[_0xddab('0x11b')](_0x391bf8,_0x35fdbf,_0x3808a5,_0xddab('0x19d'));}}break;case'5':_0x9d360c[_0xddab('0x19e')]+=0x1;_0x391bf8[_0xddab('0x6d')]=0x5;_0x391bf8[_0xddab('0x6e')]=_0xddab('0x19f');_0x391bf8['countbusyretry']+=0x1;_0x391bf8[_0xddab('0xcd')]+=0x1;ami[_0xddab('0x3d')](_0xddab('0x1a0'),ut[_0xddab('0x114')](_0x212401,_0xddab('0x1a1')));_0x50d986=_0x9d360c[_0xddab('0x186')];_0x5dd977=_0x9d360c[_0xddab('0xcf')];hopperUtils[_0xddab('0xc3')](_0x391bf8)[_0xddab('0x9e')](loggerCatch(_0xddab('0x1a2')));if(_0x19991a[_0xddab('0x181')](0x5,_0x212401,_0x9d360c)&&!_0x28278c){if(_0x391bf8[_0xddab('0x116')]>=_0x9d360c['dialBusyMaxRetry']){_0x19991a['createStateFinal'](_0x391bf8,_0x35fdbf,_0x3808a5,_0xddab('0x1a3'));}else{_0x19991a['stateGlobal'](_0x391bf8,_0x35fdbf,_0x3808a5,_0xddab('0x1a3'));}}break;case'8':_0x9d360c[_0xddab('0x1a4')]+=0x1;_0x391bf8[_0xddab('0x6d')]=0x8;_0x391bf8[_0xddab('0x6e')]=_0xddab('0x1a5');_0x391bf8[_0xddab('0x126')]+=0x1;_0x391bf8[_0xddab('0xcd')]+=0x1;_0x50d986=_0x9d360c[_0xddab('0x188')];_0x5dd977=_0x9d360c[_0xddab('0xcf')];ami[_0xddab('0x3d')]('custom:agentcongestion',ut['buildObj'](_0x212401,_0xddab('0x1a6')));hopperUtils['createHistory'](_0x391bf8)['catch'](loggerCatch('[syncAgentComplete][createHistory][8]'));if(_0x19991a[_0xddab('0x181')](0x8,_0x212401,_0x9d360c)&&!_0x28278c){if(_0x391bf8['countcongestionretry']>=_0x9d360c['dialCongestionMaxRetry']){_0x19991a[_0xddab('0x11e')](_0x391bf8,_0x35fdbf,_0x3808a5,_0xddab('0x1a7'));}else{_0x19991a[_0xddab('0x11b')](_0x391bf8,_0x35fdbf,_0x3808a5,_0xddab('0x1a7'));}}break;case'11':_0x9d360c['outboundAbandonedCallsDay']+=0x1;_0x391bf8[_0xddab('0x6d')]=0xb;_0x391bf8['statedesc']=_0xddab('0xe0');_0x391bf8[_0xddab('0xe2')]+=0x1;_0x391bf8[_0xddab('0xcd')]+=0x1;_0x50d986=_0x9d360c[_0xddab('0xe3')];_0x5dd977=_0x9d360c[_0xddab('0xcf')];hopperUtils[_0xddab('0xc3')](_0x391bf8)[_0xddab('0x9e')](loggerCatch(_0xddab('0xe7')));if(_0x19991a[_0xddab('0x181')](0xb,_0x212401,_0x9d360c)&&!_0x28278c){if(_0x391bf8[_0xddab('0xe2')]>=_0x9d360c[_0xddab('0xe4')]){_0x19991a['createStateFinal'](_0x391bf8,_0x35fdbf,_0x3808a5,_0xddab('0x1a8'));}else{_0x19991a[_0xddab('0x11b')](_0x391bf8,_0x35fdbf,_0x3808a5,'reason\x2011\x20abandoned');}}break;case'20':_0x9d360c[_0xddab('0x1a9')]+=0x1;_0x391bf8[_0xddab('0x6d')]=0x14;_0x391bf8[_0xddab('0x6e')]=_0xddab('0x1aa');_0x391bf8[_0xddab('0x119')]+=0x1;_0x391bf8[_0xddab('0xcd')]+=0x1;_0x50d986=_0x9d360c['dialAgentRejectRetryFrequency'];_0x5dd977=_0x9d360c[_0xddab('0xcf')];ami[_0xddab('0x3d')](_0xddab('0x1ab'),ut[_0xddab('0x114')](_0x212401,_0xddab('0x1ac')));hopperUtils['createHistory'](_0x391bf8)[_0xddab('0x9e')](loggerCatch(_0xddab('0x1ad')));if(_0x19991a[_0xddab('0x181')](0x14,_0x212401,_0x9d360c)&&!_0x28278c){if(_0x391bf8[_0xddab('0x119')]>=_0x9d360c['dialAgentRejectMaxRetry']){_0x19991a[_0xddab('0x11e')](_0x391bf8,_0x35fdbf,_0x3808a5,_0xddab('0x1ae'));}else{_0x19991a[_0xddab('0x11b')](_0x391bf8,_0x35fdbf,_0x3808a5,_0xddab('0x1ae'));}}break;default:_0x9d360c[_0xddab('0x12c')]+=0x1;_0x391bf8['state']=0xc;_0x391bf8[_0xddab('0x6e')]=_0x18bccd['reason'];_0x50d986=_0x9d360c['dialAgentRejectRetryFrequency'];_0x5dd977=_0x9d360c[_0xddab('0xcf')];hopperUtils[_0xddab('0xc3')](_0x391bf8)['catch'](loggerCatch(_0xddab('0x1af')));if(_0x19991a[_0xddab('0x181')](_0x18bccd['reason'],_0x212401,_0x9d360c)&&!_0x28278c){if(_0x391bf8[_0xddab('0x116')]+_0x391bf8[_0xddab('0x126')]+_0x391bf8['countnoanswerretry']+_0x391bf8[_0xddab('0x118')]+_0x391bf8['countdropretry']+_0x391bf8['countabandonedretry']+_0x391bf8[_0xddab('0x113')]+_0x391bf8[_0xddab('0x119')]>=_0x9d360c['dialGlobalMaxRetry']){_0x19991a[_0xddab('0x11b')](_0x391bf8,_0x35fdbf,_0x3808a5,_0x18bccd['reason']);}else{_0x19991a[_0xddab('0x11e')](_0x391bf8,_0x35fdbf,_0x3808a5,_0x18bccd[_0xddab('0xc0')]);}}}})['then'](function(){if(_0x28278c){hopperUtils[_0xddab('0xde')](_0x391bf8,_0x50d986,_0x5dd977)[_0xddab('0x3b')](function(){return _0x35fdbf(0x1);});}});});};Dialer[_0xddab('0x17')][_0xddab('0x11b')]=function(_0x284c5,_0x423066,_0x17ac44,_0x5a9074){var _0x2c4d8d=new Final(_0x284c5);_0x2c4d8d[_0xddab('0x6d')]=0xf;_0x2c4d8d['statedesc']=_0xddab('0x1b0');this[_0xddab('0x11e')](_0x2c4d8d,_0x423066,_0x17ac44,_0x5a9074);};Dialer[_0xddab('0x17')]['createStateFinal']=function(_0x519406,_0x29e0f9,_0x36d16b,_0x568aa6){hopperUtils[_0xddab('0xc5')](_0x519406)[_0xddab('0x3b')](function(){return _0x29e0f9(msgResponse(_0xddab('0x190'),_0xddab('0x103'),_0x568aa6));})[_0xddab('0x9e')](function(){return _0x36d16b(msgResponse(_0xddab('0x1b1'),_0xddab('0x8f'),_0xddab('0x1b2')));});};Dialer[_0xddab('0x17')][_0xddab('0x7')]=function(_0x178809){var _0x4db4b4=_0x178809['dialPredictiveOptimizationPercentage']/0x64;var _0x1bb34c=_0x178809[_0xddab('0x1b3')]/(_0x178809[_0xddab('0x1b3')]+_0x178809[_0xddab('0xbf')]);var _0x87d40a=Math['round'](_0x178809[_0xddab('0x1b4')]*(_0x178809['predictiveIntervalMaxThreshold']/0x64));var _0x1b954f=Math['round'](_0x178809[_0xddab('0x1b4')]*(_0x178809[_0xddab('0x1b5')]/0x64));var _0x5234ac=_0x178809[_0xddab('0x132')]+_0x178809[_0xddab('0x133')];var _0x2b6497=Math[_0xddab('0x1b6')](_0x178809[_0xddab('0x58')]*_0x178809[_0xddab('0x5b')]*_0x178809[_0xddab('0x1b7')]*_0x178809['predictiveIntervalMultiplicativeFactor']);if(_[_0xddab('0x50')](_0x178809[_0xddab('0x26')])){if(!_[_0xddab('0x50')](_0x178809[_0xddab('0x25')])){_0x178809[_0xddab('0x25')]=undefined;loggerPredictive[_0xddab('0x64')](_0xddab('0x1b8'),'check\x20predictive\x20is\x20not\x20undefine');}if(!_['isUndefined'](_0x178809['handlePredictive'])){loggerPredictive['error'](_0xddab('0x1b8'),'check\x20handlePredictive\x20is\x20not\x20undefine');clearInterval(_0x178809[_0xddab('0x62')]);_0x178809[_0xddab('0x62')]=undefined;}_0x178809[_0xddab('0x26')]=moment()[_0xddab('0x87')](_0xddab('0xc7'));loggerPredictive['info'](_0x178809[_0xddab('0x60')],'collection\x20data\x20in\x20progressive\x20at',_0x178809[_0xddab('0x26')]);this[_0xddab('0xb1')](_0x178809,0x1);}else if(ifInterval(_0x178809[_0xddab('0x1b9')],_0x178809[_0xddab('0x26')])){this[_0xddab('0xb1')](_0x178809,0x1);loggerPredictiveCalls[_0xddab('0x48')]('[startMethodPredictive][StartProgressive][Loop]',_0x178809[_0xddab('0x26')],_0x178809[_0xddab('0x60')]);_0x178809[_0xddab('0x58')]=0x0;_0x178809[_0xddab('0xc9')]=0x0;}else if(_0x4db4b4<_0x1bb34c&&_0x178809[_0xddab('0x1ba')]===_0xddab('0x1bb')){clearPredictiveAttributes(_0x178809);loggerPredictive[_0xddab('0x48')](_0xddab('0x1bc'),'Dropped\x20calls\x20day',_0x1bb34c,'startProgressive',_0x178809[_0xddab('0x60')]);}else if(_0x2b6497<_0x178809[_0xddab('0xc9')]&&_0x178809['dialPredictiveOptimization']===_0xddab('0x1bb')){clearPredictiveAttributes(_0x178809);loggerPredictive[_0xddab('0x48')]('[stopMethodPredictive][ReStartProgressive][ExceededDropInterval]','Max\x20Drop\x20',_0x2b6497,_0xddab('0x1bd'),_0x178809[_0xddab('0xc9')],_0xddab('0x26'),_0x178809['name']);}else if(!ifInterval(_0x178809['dialPredictiveInterval'],_0x178809[_0xddab('0x26')])&&_[_0xddab('0x50')](_0x178809[_0xddab('0x25')])&&!_['isUndefined'](_0x178809[_0xddab('0x26')])){_0x178809[_0xddab('0x25')]=moment()[_0xddab('0x87')](_0xddab('0xc7'));loggerPredictive[_0xddab('0x48')](_0x178809['name'],_0xddab('0x1be'),_0x178809[_0xddab('0x25')]);hopperUtils[_0xddab('0x1bf')](_0x178809[_0xddab('0x1b9')])[_0xddab('0x3b')](this[_0xddab('0x1c0')](_0x178809))[_0xddab('0x3b')](mergeDataErlangB(_0x178809))['then'](this[_0xddab('0x1c1')](_0x178809))[_0xddab('0x9e')](loggerCatchPredictive(_0xddab('0x1c2'),_0x178809));}else if(!ifInterval(_0x178809[_0xddab('0x1b9')],_0x178809[_0xddab('0x25')])){_0x178809['predictiveIntervalErlangCallsDroppedCalls']=0x0;_0x178809[_0xddab('0x25')]=moment()[_0xddab('0x87')](_0xddab('0xc7'));loggerPredictive[_0xddab('0x48')](_0x178809[_0xddab('0x60')],_0xddab('0x1c3'),_0x178809['startPredictive']);clearInterval(_0x178809[_0xddab('0x62')]);_0x178809[_0xddab('0x62')]=undefined;hopperUtils[_0xddab('0x1bf')](_0x178809['dialPredictiveInterval'])[_0xddab('0x3b')](this['getDataPredictive'](_0x178809))[_0xddab('0x3b')](mergeDataErlangB(_0x178809))[_0xddab('0x3b')](this['startMethodPredictive'](_0x178809))[_0xddab('0x9e')](loggerCatchPredictive(_0xddab('0x1c4'),_0x178809));}else if(_0x178809['predictiveIntervalAvailable']&&_0x5234ac<_0x178809[_0xddab('0x1b4')]-_0x1b954f){clearPredictiveAttributes(_0x178809);loggerPredictive[_0xddab('0x48')](_0x178809['name'],'switch\x20in\x20progressive\x20because\x20available\x20agents\x20(',_0x5234ac,')\x20are\x20less\x20than\x20threshold\x20(',_0x178809[_0xddab('0x1b4')],'-',_0x1b954f,'=',_0x178809[_0xddab('0x1b4')]-_0x1b954f,')');}else if(_0x178809[_0xddab('0x1b4')]&&_0x5234ac>_0x178809[_0xddab('0x1b4')]+_0x87d40a){clearPredictiveAttributes(_0x178809);loggerPredictive['info'](_0x178809[_0xddab('0x60')],_0xddab('0x1c5'),_0x5234ac,')\x20are\x20more\x20than\x20threshold\x20(',_0x178809['predictiveIntervalAvailable'],'+',_0x87d40a,'=',_0x178809['predictiveIntervalAvailable']+_0x87d40a,')');}};Dialer[_0xddab('0x17')][_0xddab('0x1c0')]=function(_0x1c9aef){var _0x3412af=this;return function(_0x274a3d){return new Promise(function(_0x1d6f4e,_0x5209ea){_[_0xddab('0x5e')](_0x1c9aef,_0x274a3d[0x0]);if(checkGetDataPredictive(_0x274a3d[0x0])){var _0x3abef7=_0x1c9aef[_0xddab('0x1b4')]=_0x1c9aef[_0xddab('0x133')]+_0x1c9aef[_0xddab('0x132')];var _0x181721=_0x1c9aef[_0xddab('0x1b9')]*0x3c;var _0x24f851=_0x274a3d[0x0]['predictiveIntervalAvgTalktime']+_0x274a3d[0x0]['predictiveIntervalAvgHoldtime'];var _0x2c0c66=(_0x274a3d[0x0][_0xddab('0x1c6')]+_0x274a3d[0x0][_0xddab('0x49')]+_0x274a3d[0x0][_0xddab('0x4b')])/_0x274a3d[0x0][_0xddab('0x47')];_0x1c9aef[_0xddab('0x1b7')]=_0x2c0c66>0x0?_0x2c0c66:0x1;switch(_0x1c9aef['dialPredictiveOptimization']){case'dropRate':var _0x329455=_0x1c9aef[_0xddab('0x1c7')]/0x64;return _0x3412af[_0xddab('0x1c8')](_0x3abef7,_0x181721,_0x24f851,_0x2c0c66,_0x329455)[_0xddab('0x3b')](function(_0x9aba30){return _0x1d6f4e(_0x9aba30);});case _0xddab('0x1c9'):var _0x30378f=_0x1c9aef[_0xddab('0x1c7')]/0x64;return _0x3412af[_0xddab('0x1ca')](_0x3abef7,_0x181721,_0x24f851,_0x2c0c66,_0x30378f)[_0xddab('0x3b')](function(_0x5c9976){return _0x1d6f4e(_0x5c9976);});default:return _0x5209ea(msgResponse(_0xddab('0x1cb'),_0xddab('0x8f'),_0xddab('0x1cc')));}}else{return _0x5209ea(msgResponse(_0xddab('0x1cb'),_0xddab('0x8f'),'check\x20failure'));}});};};Dialer['prototype'][_0xddab('0x1cd')]=function(_0x547297){var _0x31bb55=this;return function(_0x4b18f2){return new Promise(function(_0x53dad2,_0x20de96){_[_0xddab('0x5e')](_0x547297,_0x4b18f2[0x0]);if(checkGetDataPredictive(_0x4b18f2[0x0])){loggerPredictive[_0xddab('0x48')](JSON[_0xddab('0x73')](_0x4b18f2[0x0]));if(_0x547297['dialPredictiveOptimization']===_0xddab('0x1bb')){return _0x31bb55['getVoiceQueueRtPauses'](_0x547297['id'])[_0xddab('0x3b')](function(_0x7f183e){var _0x4664b5=_0x547297[_0xddab('0x1ce')]-_0x7f183e[0x0][_0xddab('0x1cf')];var _0xad814d=_0x547297['dialPredictiveInterval']*0x3c;var _0x558d40=_0x4b18f2[0x0]['predictiveIntervalAvgTalktime']+_0x4b18f2[0x0][_0xddab('0x52')];var _0x558a2d=(_0x4b18f2[0x0][_0xddab('0x1c6')]+_0x4b18f2[0x0]['predictiveIntervalDroppedCallsTimeout']+_0x4b18f2[0x0][_0xddab('0x4b')])/_0x4b18f2[0x0][_0xddab('0x47')];var _0x3d45e1=_0x547297[_0xddab('0x1c7')]/0x64;_0x547297[_0xddab('0x1d0')]=_0x7f183e[0x0][_0xddab('0x1cf')]||0x0;_0x547297[_0xddab('0x1b7')]=_0x558a2d>0x0?_0x558a2d:0x1;return _0x31bb55['abandonmentRate'](_0x4664b5,_0xad814d,_0x558d40,_0x558a2d,_0x3d45e1);})[_0xddab('0x3b')](function(_0x4fb4f8){return _0x53dad2(_0x4fb4f8);})[_0xddab('0x9e')](function(_0x4db8b3){return _0x20de96(msgResponse(_0xddab('0x1d1'),_0xddab('0x8f'),JSON[_0xddab('0x73')](_0x4db8b3)));});}if(_0x547297[_0xddab('0x1ba')]==='agentBusyFactor'){return _0x31bb55[_0xddab('0x148')](_0x547297['id'])[_0xddab('0x3b')](function(_0xc7227f){var _0xee1610=_0x547297[_0xddab('0x1ce')]-_0xc7227f[0x0][_0xddab('0x1cf')];var _0x5dac93=_0x547297[_0xddab('0x1b9')]*0x3c;var _0x5be01f=_0x4b18f2[0x0][_0xddab('0x4e')]+_0x4b18f2[0x0][_0xddab('0x52')];var _0x2ea58b=(_0x4b18f2[0x0]['predictiveIntervalAnsweredCalls']+_0x4b18f2[0x0][_0xddab('0x49')]+_0x4b18f2[0x0][_0xddab('0x4b')])/_0x4b18f2[0x0][_0xddab('0x47')];var _0x16c5c9=_0x547297[_0xddab('0x1c7')]/0x64;_0x547297[_0xddab('0x1d0')]=_0xc7227f[0x0]['outboundQueuePauses']||0x0;_0x547297[_0xddab('0x1b7')]=_0x2ea58b>0x0?_0x2ea58b:0x1;return _0x31bb55[_0xddab('0x1ca')](_0xee1610,_0x5dac93,_0x5be01f,_0x2ea58b,_0x16c5c9);})['then'](function(_0x1ceaa5){return _0x53dad2(_0x1ceaa5);})[_0xddab('0x9e')](function(_0x5b03a4){return _0x20de96(msgResponse(_0xddab('0x1d1'),_0xddab('0x8f'),JSON[_0xddab('0x73')](_0x5b03a4)));});}}else{return _0x20de96(msgResponse(_0xddab('0x1cb'),_0xddab('0x8f'),_0xddab('0x1d2')));}});};};Dialer['prototype']['startMethodPredictive']=function(_0x40449e){var _0x1f332d=this;return function(){var _0x17cac7=0x0;var _0x4d5abf=Math[_0xddab('0x1b6')](_0x40449e[_0xddab('0x5a')]*0x3e8);if(_0x4d5abf>0x0){_0x4d5abf=_0x4d5abf<0x64?0x64:_0x4d5abf;loggerPredictive['info'](_0x40449e[_0xddab('0x60')],_0xddab('0x1d3'),_0x4d5abf,'milliseconds');_0x40449e['handlePredictive']=setInterval(function(){_0x1f332d['handlePredictive'](_0x40449e);loggerPredictiveCalls[_0xddab('0x48')](_0xddab('0x1d4'),_0x17cac7+=0x1);},_0x4d5abf);}else{loggerPredictive[_0xddab('0x48')](_0x40449e['name'],_0xddab('0x1d5'));}};};Dialer['prototype'][_0xddab('0x1d6')]=function(_0x382506,_0x2b19f9){var _0x2400ca=this;return function(_0x2f7d09){if(_[_0xddab('0x44')](_0x2f7d09)){if(_['isNil'](_0x2b19f9[_0xddab('0x14e')])||!_0x2b19f9[_0xddab('0x1d7')]){if(_0x382506['dialMethod']===_0xddab('0x1d8')){_0x382506['queueStatusComplete']=_[_0xddab('0x50')](_0x382506[_0xddab('0x71')])?!![]:_0x382506[_0xddab('0x71')];var _0x589f9b=uuid['v4']();_0x2400ca[_0xddab('0x22')][_0x589f9b]=new Action(_0x382506,_0x2b19f9,_0x589f9b);loggerBooked['info'](_0xddab('0x1d9'),_0x589f9b,_0xddab('0x1da'),JSON[_0xddab('0x73')](_0x382506[_0xddab('0x71')]),_0xddab('0x1db'),_0x382506[_0xddab('0x60')]);if(_0x382506['queueStatusComplete']){_0x382506[_0xddab('0x71')]=![];_0x2400ca[_0xddab('0x28')][_0x2400ca[_0xddab('0x22')][_0x589f9b][_0xddab('0xba')]]=[];ami['Action']({'actionid':_0x589f9b,'action':_0xddab('0x1dc'),'queue':_0x382506[_0xddab('0x60')]})['catch'](function(){_0x2400ca[_0xddab('0xbe')](_0x382506);hopperUtils[_0xddab('0xd4')]({'active':![],'ContactId':_0x2400ca[_0xddab('0x22')][_0x589f9b]['ContactId'],'ListId':_0x2400ca[_0xddab('0x22')][_0x589f9b][_0xddab('0xd7')],'VoiceQueueId':_0x2400ca[_0xddab('0x22')][_0x589f9b][_0xddab('0xd8')]||undefined,'CampaignId':_0x2400ca[_0xddab('0x22')][_0x589f9b]['CampaignId']||undefined})['catch'](loggerCatch(_0xddab('0x1dd')));delete _0x2400ca[_0xddab('0x22')][_0x589f9b];});}else{loggerBooked[_0xddab('0x48')](_0xddab('0x1de'),JSON[_0xddab('0x73')](_0x382506[_0xddab('0x71')]),_0xddab('0x1db'),_0x382506[_0xddab('0x60')]);_0x2400ca[_0xddab('0xbe')](_0x382506);hopperUtils[_0xddab('0xd4')]({'active':![],'ContactId':_0x2400ca[_0xddab('0x22')][_0x589f9b][_0xddab('0xe6')],'ListId':_0x2400ca[_0xddab('0x22')][_0x589f9b]['ListId'],'VoiceQueueId':_0x2400ca['actions'][_0x589f9b]['VoiceQueueId']||undefined,'CampaignId':_0x2400ca['actions'][_0x589f9b][_0xddab('0xd9')]||undefined})[_0xddab('0x9e')](loggerCatch(_0xddab('0x1dd')));delete _0x2400ca[_0xddab('0x22')][_0x589f9b];}}else{return _0x2400ca[_0xddab('0x152')](_0x382506,_0x2b19f9);}}else{if(utils['getSeconds'](undefined,_0x2b19f9[_0xddab('0x1df')])<_0x382506[_0xddab('0x1e0')]*0x3c){if(_0x2b19f9['Agent']&&!_0x2b19f9[_0xddab('0x13f')][_0xddab('0x1e1')]){_0x2400ca[_0xddab('0x1b')][_0xddab('0xf9')](_0x2b19f9['id'])[_0xddab('0xfa')](function(){_0x2400ca[_0xddab('0xbe')](_0x382506);});}else{hopperUtils[_0xddab('0x1e2')]({'active':![]},_0x2b19f9['id'],0x1)[_0xddab('0xfa')](function(){_0x2400ca[_0xddab('0xbe')](_0x382506);});}}else{_0x382506[_0xddab('0x1e3')]+=0x1;_0x2400ca[_0xddab('0xbe')](_0x382506);if(_0x382506[_0xddab('0x1e4')]){hopperUtils['rescheduleContact']({'active':![],'recallme':![],'UserId':null,'ContactId':_0x2b19f9[_0xddab('0xe6')],'ListId':_0x2b19f9['ListId'],'VoiceQueueId':_0x2b19f9[_0xddab('0xd8')]||undefined,'CampaignId':_0x2b19f9[_0xddab('0xd9')]||undefined})['catch'](loggerCatch(_0xddab('0x1e5')));hopperUtils['createHistory'](createObjHistory(_0x382506,_0x2b19f9,utils[_0xddab('0x67')]['QUEUE_RECALL'],0x17,_0xddab('0x1e6')))[_0xddab('0x9e')](loggerCatch(_0xddab('0x1e7')));}else{_0x2400ca[_0xddab('0x10f')](createObjHistory(_0x382506,_0x2b19f9,utils['CAMPAIGN_STATUS'][_0xddab('0x1e8')],0x16,_0xddab('0x1e9')),'[Originate][HistoryRecallClose][historyCatch]',_0xddab('0x1ea'));}}}}else{_0x382506[_0xddab('0x1eb')]+=0x1;_0x2400ca[_0xddab('0x10f')](createObjHistory(_0x382506,_0x2b19f9,utils[_0xddab('0x67')]['BLACKLIST'],0xd,_0xddab('0x1ec')),_0xddab('0x1ed'),_0xddab('0x1ee'));throw _0xddab('0x1ef');}};};Dialer[_0xddab('0x17')][_0xddab('0x1f0')]=function(_0x5ca1bf){var _0x3bee45=this;var _0x3c49da=_0x5ca1bf[_0xddab('0x1f1')]-_0x5ca1bf[_0xddab('0x7c')];emitCampaignSummary(_0x5ca1bf);if(_0x3c49da>0x0&&_0x5ca1bf[_0xddab('0x1f2')]==0x0){if(_0x3c49da>this[_0xddab('0x20')]){_0x3c49da=this[_0xddab('0x20')];}_0x5ca1bf[_0xddab('0x1f2')]=0x1;hopperUtils[_0xddab('0x1f3')](_0x5ca1bf,_0x3c49da)[_0xddab('0x3b')](function(_0x27093c){_0x5ca1bf[_0xddab('0x1f2')]=0x0;if(_0x27093c){if(!utils[_0xddab('0x1f4')](_0x27093c)){_0x5ca1bf[_0xddab('0x6a')]=utils[_0xddab('0x67')][_0xddab('0x6b')];logger[_0xddab('0x48')]('[getContactCampaign2][Empty]'+_0x5ca1bf['name']);}else{_0x5ca1bf[_0xddab('0x7c')]+=_0x27093c['length'];_0x5ca1bf[_0xddab('0x6a')]=utils[_0xddab('0x67')][_0xddab('0x1f5')];for(var _0x15ea28=0x0;_0x15ea28<_0x27093c[_0xddab('0x95')];_0x15ea28+=0x1){_0x5ca1bf[_0xddab('0x1f6')]+=0x1;if(_[_0xddab('0xeb')](_0x27093c[_0x15ea28])||_[_0xddab('0xeb')](_0x27093c[_0x15ea28]['Contact'])||_[_0xddab('0xeb')](_0x27093c[_0x15ea28][_0xddab('0x174')])){_0x3bee45[_0xddab('0x1f7')](_0xddab('0x1f8'),_0x5ca1bf,_0x27093c[_0x15ea28]);}else{hopperUtils[_0xddab('0x1f9')](_[_0xddab('0xef')](_0x27093c[_0x15ea28],[_0xddab('0xd9'),_0xddab('0x174')]))[_0xddab('0x3b')](_0x3bee45['checkContactBlack'](_0x5ca1bf,_0x27093c[_0x15ea28]))[_0xddab('0x9e')](_0x3bee45['loggerHandler'](_0xddab('0x1fa'),_0x5ca1bf));}}}}})[_0xddab('0x9e')](loggerGetContactDialer('[getContactCampaign2]',_0x5ca1bf,_0x3c49da));}};Dialer['prototype'][_0xddab('0xb1')]=function(_0x4826b5,_0x336640){var _0x1aae5c=this;var _0x4be526=[];if(_0x336640<0x1||_0x4826b5[_0xddab('0xaf')]===_0xddab('0x1d8')){_0x336640=0x1;}var _0x272fee=Math[_0xddab('0x1b6')](_0x4826b5[_0xddab('0x132')]*_0x336640)-_0x4826b5[_0xddab('0x7c')];if(_0x4826b5[_0xddab('0x1fb')]>0x0){var _0x4b5c86=_0x4826b5[_0xddab('0x1fb')]-_0x4826b5[_0xddab('0x7c')]-_0x4826b5[_0xddab('0x133')]-_0x4826b5[_0xddab('0x134')];if(_0x272fee>_0x4b5c86){_0x272fee=_0x4b5c86;}}if(_0x272fee>0x0&&_0x4826b5['temp']==0x0){if(_0x4826b5[_0xddab('0xaf')]===_0xddab('0x1d8')){_0x272fee=0x1;}if(_0x272fee>this[_0xddab('0x20')]){_0x272fee=this[_0xddab('0x20')];}for(var _0x536f4f in this[_0xddab('0x1e')]){if(typeof this['agents'][_0x536f4f]!==_0xddab('0x1fc')){if(this['agents'][_0x536f4f][_0xddab('0x6d')]==='not_inuse'&&this[_0xddab('0x1e')][_0x536f4f][_0xddab('0x86')]===_0xddab('0x13d')){_0x4be526[_0xddab('0x1fd')](this[_0xddab('0x1e')][_0x536f4f]['id']);}}}_0x4826b5[_0xddab('0x1f2')]=0x1;hopperUtils['getContactDialer'](_0x4826b5,_0x4be526,_0x272fee)[_0xddab('0x3b')](function(_0x989b3e){_0x4826b5[_0xddab('0x1f2')]=0x0;if(_0x989b3e){if(!utils[_0xddab('0x1f4')](_0x989b3e)){hopperUtils[_0xddab('0x1fe')](_0x4826b5)['then'](sendMessageReschedule(_0x4826b5))['catch'](loggerCatch(_0xddab('0x1ff')));}else{_0x4826b5[_0xddab('0x7c')]+=_0x989b3e[_0xddab('0x95')];_0x4826b5[_0xddab('0x6a')]=_0x4826b5[_0xddab('0xaf')]===_0xddab('0x1d8')?utils[_0xddab('0x67')]['ACTIVE']:utils[_0xddab('0x67')][_0xddab('0x1f5')];for(var _0x274f40=0x0;_0x274f40<_0x989b3e[_0xddab('0x95')];_0x274f40+=0x1){if(_[_0xddab('0xeb')](_0x989b3e[_0x274f40])||_[_0xddab('0xeb')](_0x989b3e[_0x274f40][_0xddab('0x200')])||_[_0xddab('0xeb')](_0x989b3e[_0x274f40]['phone'])){_0x1aae5c[_0xddab('0x1f7')](_0xddab('0x1f8'),_0x4826b5,_0x989b3e[_0x274f40]);}else{hopperUtils['checkIsBlackList'](_[_0xddab('0xef')](_0x989b3e[_0x274f40],[_0xddab('0xd8'),_0xddab('0x174')]))[_0xddab('0x3b')](_0x1aae5c['checkContactBlack'](_0x4826b5,_0x989b3e[_0x274f40]))[_0xddab('0x9e')](_0x1aae5c[_0xddab('0x14c')]('[actionOriginate]\x20',_0x4826b5));}}}}})[_0xddab('0x9e')](loggerGetContactDialer(_0xddab('0x201'),_0x4826b5,_0x272fee));}};Dialer[_0xddab('0x17')][_0xddab('0x62')]=function(_0x3d8c40){if(_0x3d8c40[_0xddab('0x1fb')]>0x0){var _0x328082=_0x3d8c40[_0xddab('0x1fb')]-_0x3d8c40['originated']-_0x3d8c40[_0xddab('0x133')];if(_0x328082>0x0&&_0x3d8c40['temp']==0x0){this[_0xddab('0x202')](_0x3d8c40);}else{loggerPredictiveCalls[_0xddab('0x48')](_0xddab('0x203'));}}else{this['tryOriginatePredictive'](_0x3d8c40);}};Dialer['prototype'][_0xddab('0x202')]=function(_0x1a2b11){var _0x521f5f=this;var _0x28c804=[];_0x1a2b11[_0xddab('0x7c')]+=0x1;for(var _0x346867 in this['agents']){if(typeof this[_0xddab('0x1e')][_0x346867]!==_0xddab('0x1fc')){if(this[_0xddab('0x1e')][_0x346867]['state']===_0xddab('0x204')&&this[_0xddab('0x1e')][_0x346867][_0xddab('0x86')]===_0xddab('0x13d')){_0x28c804[_0xddab('0x1fd')](this[_0xddab('0x1e')][_0x346867]['id']);}}}_0x1a2b11[_0xddab('0x1f2')]=0x1;return this[_0xddab('0x205')](_0x1a2b11['id'],_0x28c804,0x1,_0x1a2b11[_0xddab('0x206')],_0x1a2b11)['then'](function(_0x16c104){_0x1a2b11[_0xddab('0x1f2')]=0x1;if(_0x16c104){if(!utils[_0xddab('0x1f4')](_0x16c104)){utils[_0xddab('0x207')](_0x1a2b11,0x1,0x0);return hopperUtils[_0xddab('0x1fe')](_0x1a2b11)[_0xddab('0x3b')](sendMessageReschedule(_0x1a2b11))[_0xddab('0x9e')](loggerCatch(_0xddab('0x1ff')));}else{_0x1a2b11['message']=utils['CAMPAIGN_STATUS']['RUNNING'];if(_[_0xddab('0xeb')](_0x16c104[0x0])||_['isNil'](_0x16c104[0x0][_0xddab('0x200')])||_[_0xddab('0xeb')](_0x16c104[0x0][_0xddab('0x174')])){_0x521f5f[_0xddab('0x1f7')](_0xddab('0x1f8'),_0x1a2b11,_0x16c104[0x0]);}else{return hopperUtils[_0xddab('0x208')](_[_0xddab('0xef')](_0x16c104[0x0],[_0xddab('0xd8'),_0xddab('0x174')]))[_0xddab('0x3b')](_0x521f5f[_0xddab('0x1d6')](_0x1a2b11,_0x16c104[0x0]))['catch'](_0x521f5f['loggerHandler'](_0xddab('0x209'),_0x1a2b11));}}}})[_0xddab('0x9e')](loggerGetContactDialer(_0xddab('0x20a'),_0x1a2b11,0x1));};Dialer[_0xddab('0x17')][_0xddab('0x1c8')]=function(_0x1d9d83,_0x42852b,_0x2b2442,_0x3a500b,_0x37df63,_0xd4d79c){loggerPredictive[_0xddab('0x48')]('--------\x20Drop\x20Rate\x20--------');loggerPredictive[_0xddab('0x48')](_0xddab('0x20b'),_0x1d9d83);loggerPredictive[_0xddab('0x48')]('Interval:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20',_0x42852b);loggerPredictive[_0xddab('0x48')](_0xddab('0x20c'),_0x2b2442);loggerPredictive['info']('P:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20',_0x3a500b);loggerPredictive['info'](_0xddab('0x20d'),_0x37df63);loggerPredictive['info']('---------------------------');return new Promise(function(_0x2ae1cc,_0x57201e){if(_0x1d9d83<=0x0||isNaN(_0x1d9d83)){return _0x57201e(msgResponse(_0xddab('0x20e'),'Error','m\x20=\x20'+_0x1d9d83));}if(_0x2b2442<=0x0||isNaN(_0x2b2442)){return _0x57201e(msgResponse('[abandonmentRate]','Error',_0xddab('0x20f')+_0x2b2442));}if(_0x3a500b<=0x0||isNaN(_0x3a500b)){return _0x57201e(msgResponse(_0xddab('0x20e'),_0xddab('0x83'),'p\x20=\x20'+_0x3a500b));}if(_0x42852b<=0x0||isNaN(_0x42852b)){return _0x57201e(msgResponse(_0xddab('0x20e'),_0xddab('0x83'),_0xddab('0x210')+_0x42852b));}if(_0x37df63<=0x0||isNaN(_0x37df63)){return _0x57201e(msgResponse(_0xddab('0x20e'),_0xddab('0x83'),_0xddab('0x211')+_0x37df63));}_0xd4d79c=_0xd4d79c||0x0;var _0x28f668=0x1/_0x2b2442;var _0x1df000=0x0;var _0x375f4a=0x0;var _0x36d1e3=0x0;var _0x17da39=0x0;for(var _0x35dfa5=0x0;_0x36d1e3<_0x37df63;_0x35dfa5+=0x1){_0x375f4a=_0x35dfa5/_0x42852b;_0x1df000=(_0x3a500b*_0x375f4a+_0xd4d79c)/_0x28f668;_0x36d1e3=utils[_0xddab('0x212')](_0x1df000,_0x1d9d83);_0x17da39=_0x1df000/_0x1d9d83*(0x1-utils['erlangb'](_0x1df000,_0x1d9d83));}return _0x2ae1cc({'erlangCalls':_0x35dfa5,'erlangCallToSecond':_0x42852b/_0x35dfa5,'erlangAbandonmentRate':_0x36d1e3,'erlangBusyFactor':_0x17da39});});};Dialer[_0xddab('0x17')][_0xddab('0x1ca')]=function(_0x1ae6a0,_0x54b6a9,_0x39bb4f,_0x14ff02,_0x272d6b,_0x395523){loggerPredictive['info'](_0xddab('0x213'));loggerPredictive[_0xddab('0x48')](_0xddab('0x20b'),_0x1ae6a0);loggerPredictive[_0xddab('0x48')](_0xddab('0x214'),_0x54b6a9);loggerPredictive[_0xddab('0x48')]('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',_0x39bb4f);loggerPredictive[_0xddab('0x48')](_0xddab('0x215'),_0x14ff02);loggerPredictive['info'](_0xddab('0x216'),_0x272d6b);loggerPredictive[_0xddab('0x48')]('---------------------------');return new Promise(function(_0x3e8fec,_0x2b05d7){if(_0x1ae6a0<=0x0||isNaN(_0x1ae6a0)){return _0x2b05d7(msgResponse(_0xddab('0x217'),_0xddab('0x83'),_0xddab('0x218')+_0x1ae6a0));}if(_0x39bb4f<=0x0||isNaN(_0x39bb4f)){return _0x2b05d7(msgResponse(_0xddab('0x217'),_0xddab('0x83'),_0xddab('0x20f')+_0x39bb4f));}if(_0x14ff02<=0x0||isNaN(_0x14ff02)){return _0x2b05d7(msgResponse('[busyFactor]',_0xddab('0x83'),_0xddab('0x219')+_0x14ff02));}if(_0x54b6a9<=0x0||isNaN(_0x54b6a9)){return _0x2b05d7(msgResponse('[busyFactor]',_0xddab('0x83'),'interval\x20=\x20'+_0x54b6a9));}if(_0x272d6b<=0x0||isNaN(_0x272d6b)){return _0x2b05d7(msgResponse('[busyFactor]',_0xddab('0x83'),_0xddab('0x21a')+_0x272d6b));}_0x395523=_0x395523||0x0;var _0x4a029e=0x1/_0x39bb4f;var _0xf18d70=0x0;var _0x44e8d2=0x0;var _0x368da6=0x0;var _0x95faf0=0x0;for(var _0x187621=0x0;_0x95faf0<_0x272d6b;_0x187621+=0x1){_0x44e8d2=_0x187621/_0x54b6a9;_0xf18d70=(_0x14ff02*_0x44e8d2+_0x395523)/_0x4a029e;_0x368da6=utils[_0xddab('0x212')](_0xf18d70,_0x1ae6a0);_0x95faf0=_0xf18d70/_0x1ae6a0*(0x1-utils[_0xddab('0x212')](_0xf18d70,_0x1ae6a0));}return _0x3e8fec({'erlangCalls':_0x187621,'erlangCallToSecond':_0x54b6a9/_0x187621,'erlangAbandonmentRate':_0x368da6,'erlangBusyFactor':_0x95faf0});});};module[_0xddab('0x21b')]=Dialer; \ No newline at end of file +var _0x9c78=['EMPTY_INTERVAL','ifTime','\x20Intervals\x20is\x20empty\x20','timezones','\x20Timezone\x20unknow\x20','isArray','push','Action','command','iftime\x20%s,%s','interval','content','indexOf','true','catch','all','OVERTIME_INTERVAL','[ifTime][promiseAll]','Global:\x20','\x20Interval\x20is\x20overtime:\x20','Timezone:\x20','syncCampaigns','resolve','dialGlobalInterval','dialTimezone','checkIfTimeIntervals','launchHandleIvr','[syncCampaigns]','checkDialMethod','predictive','dialMethod','progressive','handlePower','power','Queue','method\x20not\x20recognized','silly','Dialer::ifTime()','Voice\x20Queue\x20%s\x20$s','intervalIftime','OVERTIME_GLOBAL_INTERVAL','isGlobal','Error','syncAgentConnect','queue','uniqueid','ivr','updateOriginated','answertime','YYYY-MM-DD\x20HH:mm:ss','type','outboundAnswerCallsDay','reason','agent','agiafterat','dialQueueProject2','dialAgiAfterHangupAgent','createHistory','[syncAgentComplete][createHistory]','moveContactManagedDialer','droptime','dialQueueTimeout','outboundDropCallsDayTimeout','predictiveIntervalErlangCallsDroppedCalls','state','dropreason','TIMEOUT','countglobal','dialDropRetryFrequency','verifyAdditionalPhones','voiceQueue','additional','countdropretry','dialDropMaxRetry','queueCallerAbandonCreateState','rescheduleContact','CampaignId','[rescheduleContact][Drop]','Drop','calleridname','calleridnum','swapAdditionalPhones','statedesc','Abandoned','CALLEREXIT','countabandonedretry','dialAbandonedRetryFrequency','callAdditionalPhoneAfterMin','dialAbandonedMaxRetry','add','minutes','ContactId','ListId','VoiceQueueId','[rescheduleContact][Abandoned]','[syncAgentComplete][createHistory][11]','channel','actionid','strategy','rrmemory','roundrobin','paused','stateinterface','locked','isNil','syncQueueStatusComplete','run','[Catch][Preview][syncQueueStatusComplete]','[unlock][syncQueueStatusComplete]','_rr','unlockRR','[booked][RR]','Agent:\x20','contactAgent-idHopper:\x20','idHopper','finally','[booked][RR][finaly]','[unlock2][syncQueueStatusComplete]','[booked][unlock3]','[unlock3][syncQueueStatusComplete]','syncOriginateResponse','responsetime','getQueue','response','Success','variable','amdstatus','xcally-motion-dialer','dialAMDActive','outboundAnswerAgiCallsDay','HangupInAMD','membername','AMD','emit','custom:amd','buildObj','saveInDb','[syncHangupInAMD][createHistory]','value','Machine','countmachineretry','amd','[syncAgentComplete][createHistory][0]','countbusyretry','countcongestionretry','countnoanswerretry','countnosuchnumberretry','dialGlobalMaxRetry','stateGlobal','reason19\x20machine....','createStateFinal','reason\x2019\x20machine....','dialMachineRetryFrequency','[rescheduleContact][Machine]','HANGUP','[syncHangupInAMDIvr][createHistory]','[syncHangupInAMDIvr]','MACHINE','countagentrejectretry','dialMachineMaxRetry','syncHangup','ivrAnswerCallsDay','[syncHangupIvr]','dialQueueProject','AnswerAGI','[syncHangupIvr][createHistory]','outboundUnknownCallsDay','cause-txt','running','statusMessage','getQueueCampaignStatusMessage','available','inUse','talking','pTalking','[syncQueueSummary]','queueSummaryCountersUpdated','updateReportFromOutboundQueue','assign','syncQueueSummaryComplete','throttle','filter','dialPreviewRecallmeReminder','online','length','handlePreviewRecallNotifications','map','Agent','user:%s','user:dialPreviewRecallReminder','checkPreviewRecallReminder','clearZombieChannels','[uniqueid]','[actions]','undefined','No\x20such\x20channel','[Dialer][checkChannel]','[Dialer][checkChannel][ivr]','getVoiceQueueRtPauses','[getVoiceQueueRtPauses]\x20','[updateOriginated]\x20object\x20originated\x20is\x20negative','[updateOriginated]\x20is\x20null\x20or\x20undefined','loggerHandler','emptyContact','UserId','[emptyContact][createHistory]','[emptyContact]','[syncQueueCallerAbandon]\x20[Drop]','handleIvr','originate','phone','contact\x20is\x20undefine','\x22agi://%s/square,%s\x22','NONE','isOutboundQueue','\x22%s,%s%s,,,%s\x22','getCaller','ACTIVE','XMD-AMDINITIALSILENCE','XMD-AMDGREETING','XMD-AMDAFTERGREETINGSILENCE','dialAMDAfterGreetingSilence','XMD-AMDTOTALANALYSISTIME','dialAMDTotalAnalysisTime','XMD-AMDMINWORDLENGTH','dialAMDMinWordLength','XMD-AMDBETWEENWORDSSILENCE','XMD-AMDMAXIMUMNUMBEROFWORDS','dialAMDMaximumNumberOfWords','XMD-AMDSILENCETHRESHOLD','dialAMDSilenceThreshold','XMD-AMDMAXIMUMWORDLENGTH','XMD-CAMPAIGNID','Contact','getCallerId','dialRandomLastDigitCallerIdNumber','dialOriginateCallerIdNumber','TrunkBackup','callerid','getCallerIdRandom','XMD-ORIGINATECALLERIDNAME','extractCalleridName','XMD-ORIGINATECALLERIDNUM','variables','SIP/%s/%s%s','dialPrefix','dialCutDigit','substring','from-sip','dialOriginateTimeout','outboundOriginateFailureCallsDay','OriginateError','[originate][error]','originate\x20action\x20Error','checkRetriveMax','dialNoAnswerMaxRetry','[rescheduleContact][NoAnswer]','dialBusyMaxRetry','[rescheduleContact]\x20[Busy]','[rescheduleContact]\x20[Congestion]','dialNoSuchNumberMaxRetry','[rescheduleContact][NoSuchNumber]','dialAgentRejectRetryFrequency','callProgressDetecting','object','[callProgressDetecting]','entity\x20is\x20undefine','evt\x20is\x20undefine','NoSuchNumber','custom:agentnosuchnumber','nosuchnumber','dialNoSuchNumberRetryFrequency','reason\x200\x20no\x20such\x20number....','outboundNoAnswerCallsDay','NoAnswer','buildNoAnswerEventPayload','dialNoAnswerRetryFrequency','[syncAgentComplete][createHistory][3]','reason\x203\x20ringing\x20no\x20answer','outboundBusyCallsDay','Busy','custom:agentbusy','dialBusyRetryFrequency','reason\x205\x20busy','Congestion','dialCongestionRetryFrequency','congestion','[syncAgentComplete][createHistory][8]','dialCongestionMaxRetry','reason\x208\x20congestion','outboundAbandonedCallsDay','reason\x2011\x20abandoned','AgentReject','custom:agentreject','agentreject','reason\x2020\x20agentreject','[syncAgentComplete][createHistory][?]','Global','[moveContactManagedDialer][0]','contact\x20not\x20moved','round','predictiveIntervalMinThreshold','floor','predictiveIntervalHitRate','predictiveIntervalMultiplicativeFactor','[startMethodPredictive][StartProgressive]','check\x20handlePredictive\x20is\x20not\x20undefine','dialPredictiveInterval','dialPredictiveOptimization','[stopMethodPredictive][ReStartProgressive][ExceededDropDay]','Dropped\x20calls\x20day','dropRate','[stopMethodPredictive][ReStartProgressive][ExceededDropInterval]','Max\x20Drop\x20','Drop\x20in\x20this\x20interval','started\x20in\x20predictive\x20at','avgHandleTime','getDataPredictive','startMethodPredictive','Predictive\x20after\x20first\x20interval','recalculate\x20predictive\x20at','predictiveIntervalAvailable',')\x20are\x20more\x20than\x20threshold\x20(','dialPredictiveOptimizationPercentage','agentBusyFactor','busyFactor','[getDataPredictive]','check\x20failure','getDataPredictiveOld','loggedIn','predictiveIntervalPauses','outboundQueuePauses','abandonmentRate','[CatchErlangB]','one\x20call\x20every:','milliseconds','[handlePredictive]','fail\x20to\x20scheduled\x20calls','recallme','[unlockOriginate][syncQueueStatusComplete]','[booked][checkContactBlack][else]','actionOriginate','scheduledat','dialRecallMeTimeout','voicePause','unlockContact','[rescheduleContact][dialRecallInQueue]','QUEUE_RECALL','RecallInQueue','[Originate][HistoryDialRecallInQueue][historyCatch]','RECALL_TIMEOUT','[Originate][HistoryRecallClose][historyCatch]','[Originate][HistoryRecallClose]','BLACKLIST','Blacklist','[Originate][historyBlacklist]','[Originate][MoveBlacklist]','inBlackList','limitCalls','getContactDialerIvr','checkContactEmpty','[getContactCampaign2][Empty]','ivrTotalCallsDays','[actionOriginate]\x20','checkIsBlackListIvr','checkContactBlack','[getContactCampaign2]','dialLimitQueue','getContactDialer','countReScheduled','[countReScheduled]\x20','RUNNING','checkIsBlackList','[getContactDialer2]','[handlePredictive][limitChannel]','tryOriginatePredictive','dialOrderByScheduledAt','checkContactLowerLimitOriginate','[actionOriginatePredictive]\x20','--------\x20Drop\x20Rate\x20--------','Interval:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','P:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','[abandonmentRate]','p\x20=\x20','interval\x20=\x20','Amax\x20=\x20','erlangb','----\x20Agent\x20Busy\x20Factor\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','[busyFactor]','m\x20=\x20','Umin\x20=\x20','util','uuid','moment','ioredis','./utils','../preview/util/util','../../../config/environment/','../../../config/logger','booked','predictiveCalls','localhost','socket.io-emitter','redis','../rpc/cmHopper','../rpc/setting','../rpc/interval','./models/agentComplete','./models/hangup','env','XCALLY_IP_AGI','127.0.0.1','prototype','enqueue','tail','sequence','preview','voiceQueues','campaigns','agents','trunks','maxNumberOriginate','actions','contactsId','uniqueId','optionPredictive','startPredictive','startProgressive','ivrOriginated','queueBooked','queueBookedRR','queuesSummary','agentconnect','bind','queuecallerabandon','syncQueueCallerAbandon','agentcomplete','syncAgentComplete','custom:queuesummary','custom:queuesummarycomplete','newexten','syncNewExten','varset','syncVarSet','queuemember','syncQueueMember','loopCampaigns','loopClearZombieChannels','then','previewRecallmeReminderInterval','outbound','debug','[voiceQueueReport][queuesummary]\x20sending\x20voice_queue:save\x20event:','format','voice:queue:%s','name','voice_queue:save','info','Total\x20Calls:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','predictiveIntervalTotalCalls','Answered\x20Calls:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','predictiveIntervalAnsweredCalls','Dropped\x20Timeout:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','predictiveIntervalDroppedCallsTimeout','Dropped\x20Exit:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','predictiveIntervalDroppedCallsCallersExit','AVG\x20Hold\x20Time:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','predictiveIntervalAvgHoldtime','AVG\x20Talk\x20Time:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','predictiveIntervalAvgTalktime','---------------------------','Avg\x20Talk\x20Time\x20is\x20not\x20enough\x20for\x20predictive','isUndefined','Avg\x20Hold\x20Time\x20is\x20not\x20enough\x20for\x20predictive','Total\x20Calls\x20are\x20not\x20enough\x20for\x20predictive','---------\x20ErlangB\x20---------','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','erlangCallToSecond','Drop\x20Rate:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','erlangAbandonmentRate','Agent\x20Busy\x20Factor:\x20\x20\x20\x20\x20\x20\x20\x20\x20','erlangBusyFactor','merge','getSeconds','startProgressive\x20value\x20cleared','startPredictive\x20value\x20cleared','handlePredictive','handlePredictive\x20interval\x20cleared','error','stack','temp','inspect','contactsRescheduled','message','CAMPAIGN_STATUS','CONTACTS_RESCHEDULED','[getContactDialer2][ReScheduled]','NO_AVAILABLE_CONTACTS','endtime','starttime','[unlockQueueStatus][undefined]','queueStatusComplete','[booked][unlockQueueStatus]','stringify','pick','Interval','NULL_INTERVAL','\x20INTERVAL_IS_NULL','Intervals','isEmpty','INACTIVE','\x20NOT\x20Active','isIVRCampaign','campaign:ivr:%s','campaign:save','sendMessageOneNotActive','originated','[syncQueueSummary]\x20Campaign\x20Ivr:\x20','DISACTIVED','is\x20disactive','[ifTime][Action]','isTrunkReachable','active','SIP/%s','status','reachable','unmonitored','checkIsTrunkReachable','Trunk','TRUNK_NOT_REACHABLE','checkIfTime','ifTimeIvr','Failure'];(function(_0xcb148,_0x24795f){var _0x21ecfc=function(_0x5a389d){while(--_0x5a389d){_0xcb148['push'](_0xcb148['shift']());}};_0x21ecfc(++_0x24795f);}(_0x9c78,0x188));var _0x89c7=function(_0x242639,_0x2902ae){_0x242639=_0x242639-0x0;var _0x58c860=_0x9c78[_0x242639];return _0x58c860;};'use strict';var util=require(_0x89c7('0x0'));var _=require('lodash');var uuid=require(_0x89c7('0x1'));var moment=require(_0x89c7('0x2'));var rr=require('rr');var Redis=require(_0x89c7('0x3'));var utils=require(_0x89c7('0x4'));var hopperUtils=require('./utils/hopper');var ut=require(_0x89c7('0x5'));var config=require(_0x89c7('0x6'));var logger=require(_0x89c7('0x7'))('dialer');var loggerBooked=require(_0x89c7('0x7'))(_0x89c7('0x8'));var loggerPredictive=require(_0x89c7('0x7'))('predictive');var loggerPredictiveCalls=require(_0x89c7('0x7'))(_0x89c7('0x9'));var loggerSyncQueueSummary=require(_0x89c7('0x7'))('syncQueueSummary');var ami=require('../ami');config['redis']=_['defaults'](config['redis'],{'host':_0x89c7('0xa'),'port':0x18eb});var io=require(_0x89c7('0xb'))(new Redis(config[_0x89c7('0xc')]));var cmHopper=require(_0x89c7('0xd'));var voiceQueueRt=require('../rpc/voiceQueueRt');var RpcSetting=require(_0x89c7('0xe'));var Interval=require(_0x89c7('0xf'));var Action=require('./models/action');var History=require('./models/history');var Final=require('./models/final');var AgentComplete=require(_0x89c7('0x10'));var QueueCallerAbandon=require('./models/queueCallerAbandon');var Hangup=require(_0x89c7('0x11'));var ipAgi=process[_0x89c7('0x12')][_0x89c7('0x13')]||_0x89c7('0x14');var previewRecallmeReminderInterval=0x1;var Sequence=function(){};Sequence[_0x89c7('0x15')][_0x89c7('0x16')]=function(_0x17cc56){this['tail']=this[_0x89c7('0x17')]?this[_0x89c7('0x17')]['finally'](_0x17cc56):_0x17cc56();};function Dialer(_0x273145,_0x31a747){this[_0x89c7('0x18')]=new Sequence();this[_0x89c7('0x19')]=_0x31a747;this[_0x89c7('0x1a')]=_0x273145[_0x89c7('0x1a')];this[_0x89c7('0x1b')]=_0x273145['campaigns'];this[_0x89c7('0x1c')]=_0x273145['agents'];this[_0x89c7('0x1d')]=_0x273145[_0x89c7('0x1d')];this[_0x89c7('0x1e')]=config[_0x89c7('0x1e')]||0x2;this['channels']={};this[_0x89c7('0x1f')]={};this[_0x89c7('0x20')]={};this[_0x89c7('0x21')]={};this[_0x89c7('0x22')]={};this[_0x89c7('0x23')]={};this[_0x89c7('0x24')]={};this[_0x89c7('0x25')]={};this[_0x89c7('0x26')]={};this[_0x89c7('0x27')]={};this[_0x89c7('0x28')]={};ami['on'](_0x89c7('0x29'),this['syncAgentConnect'][_0x89c7('0x2a')](this));ami['on'](_0x89c7('0x2b'),this[_0x89c7('0x2c')][_0x89c7('0x2a')](this));ami['on']('originateresponse',this['syncOriginateResponse'][_0x89c7('0x2a')](this));ami['on'](_0x89c7('0x2d'),this[_0x89c7('0x2e')][_0x89c7('0x2a')](this));ami['on'](_0x89c7('0x2f'),this['syncQueueSummary'][_0x89c7('0x2a')](this));ami['on'](_0x89c7('0x30'),this['syncQueueSummaryComplete'][_0x89c7('0x2a')](this));ami['on']('hangup',this['syncHangup'][_0x89c7('0x2a')](this));ami['on'](_0x89c7('0x31'),this[_0x89c7('0x32')][_0x89c7('0x2a')](this));ami['on'](_0x89c7('0x33'),this[_0x89c7('0x34')]['bind'](this));ami['on'](_0x89c7('0x35'),this[_0x89c7('0x36')]['bind'](this));ami['on']('queuestatuscomplete',this['syncQueueStatusComplete']['bind'](this));this[_0x89c7('0x37')]();this[_0x89c7('0x38')]();RpcSetting['getSettings']()[_0x89c7('0x39')](function(_0x7f28bc){previewRecallmeReminderInterval=_0x7f28bc[_0x89c7('0x3a')];});}function isNotNull(_0xf8a3b1){return _0xf8a3b1!==null&&!_['isUndefined'](_0xf8a3b1);}function msgResponse(_0x33705d,_0x4e4fd1,_0x9b475b){return{'action':_0x33705d,'response':_0x4e4fd1,'message':_0x9b475b,'stack':_0x9b475b};}function emit(_0x522b53,_0xba5c41,_0x4148dc){io['to'](_0x522b53)['emit'](_0xba5c41,_0x4148dc);}function emitOutboundVoiceQueueSummary(_0x198010){if(_0x198010['type']===_0x89c7('0x3b')){logger[_0x89c7('0x3c')](_0x89c7('0x3d'),util['inspect'](_0x198010,{'showHidden':![],'depth':null}));emit(util[_0x89c7('0x3e')](_0x89c7('0x3f'),_0x198010[_0x89c7('0x40')]),_0x89c7('0x41'),_0x198010);}}function checkGetDataPredictive(_0x462280){if(isNotNull(_0x462280)&&!_['isEmpty'](_0x462280)){loggerPredictive[_0x89c7('0x42')]('-----\x20Stats\x20Predictive\x20---');loggerPredictive[_0x89c7('0x42')](_0x89c7('0x43'),_0x462280[_0x89c7('0x44')]);loggerPredictive[_0x89c7('0x42')](_0x89c7('0x45'),_0x462280[_0x89c7('0x46')]);loggerPredictive['info'](_0x89c7('0x47'),_0x462280[_0x89c7('0x48')]);loggerPredictive[_0x89c7('0x42')](_0x89c7('0x49'),_0x462280[_0x89c7('0x4a')]);loggerPredictive[_0x89c7('0x42')](_0x89c7('0x4b'),_0x462280[_0x89c7('0x4c')]);loggerPredictive['info'](_0x89c7('0x4d'),_0x462280[_0x89c7('0x4e')]);loggerPredictive[_0x89c7('0x42')](_0x89c7('0x4f'));if(_0x462280[_0x89c7('0x44')]>0x0){if(!_['isUndefined'](_0x462280[_0x89c7('0x4e')])&&_0x462280['predictiveIntervalAvgTalktime']>0x0){return!![];}loggerPredictive[_0x89c7('0x42')](_0x89c7('0x50'));if(!_[_0x89c7('0x51')](_0x462280['predictiveIntervalAvgHoldtime'])&&_0x462280[_0x89c7('0x4c')]>0x0){return!![];}loggerPredictive[_0x89c7('0x42')](_0x89c7('0x52'));}else{loggerPredictive[_0x89c7('0x42')](_0x89c7('0x53'));}}else{loggerPredictive[_0x89c7('0x42')]('History\x20information\x20are\x20empty');}return![];}function mergeDataErlangB(_0x2a2c60){return function(_0x53982d){loggerPredictive[_0x89c7('0x42')](_0x89c7('0x54'));loggerPredictive[_0x89c7('0x42')](_0x89c7('0x55'),_0x53982d[_0x89c7('0x56')]);loggerPredictive[_0x89c7('0x42')](_0x89c7('0x57'),_0x53982d[_0x89c7('0x58')]);loggerPredictive['info'](_0x89c7('0x59'),_0x53982d[_0x89c7('0x5a')]);loggerPredictive[_0x89c7('0x42')](_0x89c7('0x5b'),_0x53982d[_0x89c7('0x5c')]);loggerPredictive[_0x89c7('0x42')]('Drop\x20Rate:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20',_0x53982d[_0x89c7('0x5a')]);loggerPredictive[_0x89c7('0x42')](_0x89c7('0x4f'));_[_0x89c7('0x5d')](_0x2a2c60,_0x53982d);};}function ifInterval(_0x2403e5,_0x1a996b){if(_[_0x89c7('0x51')](_0x1a996b)){return![];}return utils[_0x89c7('0x5e')](undefined,_0x1a996b)<_0x2403e5*0x3c;}function clearPredictiveAttributes(_0x14c504){if(_0x14c504['startProgressive']){_0x14c504[_0x89c7('0x24')]=undefined;loggerPredictive[_0x89c7('0x3c')](_0x14c504['name'],_0x89c7('0x5f'));}if(_0x14c504[_0x89c7('0x23')]){_0x14c504[_0x89c7('0x23')]=undefined;loggerPredictive[_0x89c7('0x3c')](_0x14c504[_0x89c7('0x40')],_0x89c7('0x60'));}if(_0x14c504['handlePredictive']){clearInterval(_0x14c504[_0x89c7('0x61')]);_0x14c504[_0x89c7('0x61')]=undefined;loggerPredictive[_0x89c7('0x3c')](_0x14c504[_0x89c7('0x40')],_0x89c7('0x62'));}}function loggerCatchPredictive(_0xc2118c,_0x591b66){return function(_0x19c954){loggerPredictive['error'](_0x591b66[_0x89c7('0x40')],_0xc2118c);loggerPredictive[_0x89c7('0x63')](_0x19c954[_0x89c7('0x64')]);clearPredictiveAttributes(_0x591b66);};}function loggerCatch(_0x44d4ca){return function(_0x5bfe6c){logger[_0x89c7('0x63')](_0x44d4ca,util['inspect'](_0x5bfe6c,{'showHidden':![],'depth':null}));};}function loggerGetContactDialer(_0x50a135,_0x132c77,_0x300b02){return function(_0x46f84a){utils['checkContactLowerLimitOriginate'](_0x132c77,_0x300b02,0x0);_0x132c77[_0x89c7('0x65')]=0x0;logger[_0x89c7('0x63')](_0x50a135,util[_0x89c7('0x66')](_0x46f84a,{'showHidden':![],'depth':null}));};}function sendMessageReschedule(_0x1a4e8d){return function(_0x2f60b9){if(isNotNull(_0x2f60b9)&&isNotNull(_0x2f60b9[0x0])){if(_0x2f60b9[0x0][_0x89c7('0x67')]>0x0){_0x1a4e8d[_0x89c7('0x68')]=utils[_0x89c7('0x69')][_0x89c7('0x6a')];logger[_0x89c7('0x42')](_0x89c7('0x6b')+_0x1a4e8d['name'],_0x2f60b9[0x0][_0x89c7('0x67')],'contacts');}else{_0x1a4e8d['message']=utils[_0x89c7('0x69')][_0x89c7('0x6c')];logger[_0x89c7('0x42')]('[getContactDialer2][Empty]'+_0x1a4e8d['name']);}}};}function createObjHistory(_0x379370,_0x4cfabf,_0x1f2d8b,_0x5f4344,_0x52ac20){_0x379370[_0x89c7('0x68')]=_0x1f2d8b;var _0x586b3e=new Action(_0x379370,_0x4cfabf);var _0x3e6e1f=new History(_0x586b3e);_0x3e6e1f['state']=_0x5f4344;_0x3e6e1f['statedesc']=_0x52ac20;_0x3e6e1f[_0x89c7('0x6d')]=_0x586b3e[_0x89c7('0x6e')];return _0x3e6e1f;}function unlockQueueStatus(_0x188efe,_0x124dc0){setTimeout(function(){if(_[_0x89c7('0x51')](_0x188efe['queueStatusComplete'])){loggerBooked['error'](_0x89c7('0x6f'),_0x124dc0);}_0x188efe[_0x89c7('0x70')]=!![];loggerBooked['info'](_0x89c7('0x71'),_0x124dc0,JSON[_0x89c7('0x72')](_[_0x89c7('0x73')](_0x188efe,[_0x89c7('0x40'),_0x89c7('0x70')])));},0x1f3);}function checkInterval(_0x304363){return function(){if(!isNotNull(_0x304363[_0x89c7('0x74')])){_0x304363[_0x89c7('0x68')]=utils['CAMPAIGN_STATUS'][_0x89c7('0x75')];throw _0x304363[_0x89c7('0x40')]+_0x89c7('0x76');}if(!isNotNull(_0x304363[_0x89c7('0x74')][_0x89c7('0x77')])){_0x304363[_0x89c7('0x68')]=utils[_0x89c7('0x69')][_0x89c7('0x75')];throw _0x304363[_0x89c7('0x40')]+'\x20INTERVAL_IS_NULL';}if(!isNotNull(_[_0x89c7('0x78')](_0x304363[_0x89c7('0x74')][_0x89c7('0x77')]))){_0x304363['message']=utils['CAMPAIGN_STATUS'][_0x89c7('0x75')];throw _0x304363[_0x89c7('0x40')]+_0x89c7('0x76');}};}function checkIsIVRCampaignActive(_0x4cca01){return function(){if(!utils['isIVRCampaignActive'](_0x4cca01)){_0x4cca01[_0x89c7('0x68')]=utils[_0x89c7('0x69')][_0x89c7('0x79')];throw _0x4cca01[_0x89c7('0x40')]+_0x89c7('0x7a');}};}function emitCampaignSummary(_0x2b1d3e){if(utils[_0x89c7('0x7b')](_0x2b1d3e)){emit(util[_0x89c7('0x3e')](_0x89c7('0x7c'),_0x2b1d3e['name']),_0x89c7('0x7d'),_0x2b1d3e);}}function loggerCatchQueueSummary(_0x257e1a,_0x4ddbb2){return function(_0x4021a5){clearPredictiveAttributes(_0x4ddbb2);emitCampaignSummary(_0x4ddbb2);loggerSyncQueueSummary[_0x89c7('0x3c')](_0x257e1a,util['inspect'](_0x4021a5,{'showHidden':![],'depth':null}));};}function notSendMessagesCampaign(_0x6a51e0){if(_0x6a51e0[_0x89c7('0x7e')]){if(_0x6a51e0[_0x89c7('0x7f')]===0x0){_0x6a51e0['sendMessageOneNotActive']=![];_0x6a51e0[_0x89c7('0x68')]=utils['CAMPAIGN_STATUS'][_0x89c7('0x79')];loggerSyncQueueSummary[_0x89c7('0x3c')](_0x89c7('0x80'),_0x6a51e0[_0x89c7('0x40')],'is\x20not\x20active');}else{_0x6a51e0[_0x89c7('0x68')]=utils[_0x89c7('0x69')][_0x89c7('0x81')];loggerSyncQueueSummary['debug'](_0x89c7('0x80'),_0x6a51e0['name'],_0x89c7('0x82'));}emitCampaignSummary(_0x6a51e0);}}function myreject(_0x1d5fd2){return function(_0x31617b){return _0x1d5fd2(msgResponse(_0x89c7('0x83'),'Error',JSON[_0x89c7('0x72')](_0x31617b)));};}Dialer[_0x89c7('0x15')][_0x89c7('0x84')]=function(_0xae154f){return!_[_0x89c7('0x51')](_0xae154f)&&_0xae154f&&!_[_0x89c7('0x51')](_0xae154f['name'])&&!_[_0x89c7('0x51')](_0xae154f[_0x89c7('0x85')])&&_0xae154f[_0x89c7('0x85')]&&(this['trunks'][util['format'](_0x89c7('0x86'),_0xae154f[_0x89c7('0x40')])][_0x89c7('0x87')]===_0x89c7('0x88')||this['trunks'][util[_0x89c7('0x3e')]('SIP/%s',_0xae154f[_0x89c7('0x40')])][_0x89c7('0x87')]===_0x89c7('0x89'));};Dialer[_0x89c7('0x15')][_0x89c7('0x8a')]=function(_0x3b12ae){var _0x3ed21a=this;return function(){if(!_0x3ed21a[_0x89c7('0x84')](_0x3b12ae[_0x89c7('0x8b')])){if(!_0x3ed21a['isTrunkReachable'](_0x3b12ae['TrunkBackup'])){_0x3b12ae['message']=utils['CAMPAIGN_STATUS'][_0x89c7('0x8c')];throw _0x3b12ae['name']+'\x20trunk\x20is\x20not\x20reachable';}}};};Dialer[_0x89c7('0x15')][_0x89c7('0x8d')]=function(_0x295ba3,_0x192c10,_0x274c86,_0x4dd257){var _0x6a8464=this;return function(){var _0x58f968=!![];return _0x6a8464['ifTimeIvr'](_0x295ba3,_0x192c10,_0x274c86,_0x4dd257,_0x58f968);};};Dialer[_0x89c7('0x15')]['checkIfTimeIntervals']=function(_0x11c6f2,_0x71320b,_0xa1567b,_0x24e31c){var _0x2a49e8=this;return function(){var _0x2024c2=![];return _0x2a49e8[_0x89c7('0x8e')](_0x11c6f2['Intervals'],_0x71320b,_0xa1567b,_0x24e31c,_0x2024c2);};};Dialer[_0x89c7('0x15')]['ifTimeIvr']=function(_0x128eae,_0xed80b,_0x2fc664,_0x318e4e,_0x296725){var _0x291473=[];return new Promise(function(_0x1b8b72,_0x1bf7ee){if(!isNotNull(_0x128eae)){_0x318e4e[_0x89c7('0x68')]=utils[_0x89c7('0x69')][_0x89c7('0x75')];return _0x1bf7ee(msgResponse('ifTime',_0x89c7('0x8f'),_0x2fc664+'\x20Intervals\x20is\x20null\x20'));}if(_[_0x89c7('0x78')](_0x128eae)){_0x318e4e[_0x89c7('0x68')]=utils[_0x89c7('0x69')][_0x89c7('0x90')];return _0x1bf7ee(msgResponse(_0x89c7('0x91'),_0x89c7('0x8f'),_0x2fc664+_0x89c7('0x92')));}if(_0xed80b&&_[_0x89c7('0x51')](config[_0x89c7('0x93')][_0xed80b])){_0x318e4e[_0x89c7('0x68')]=utils[_0x89c7('0x69')]['UNKNOWN_TIMEZONE'];return _0x1bf7ee(msgResponse(_0x89c7('0x91'),'Failure',_0x2fc664+_0x89c7('0x94')+_0xed80b));}if(_[_0x89c7('0x95')](_0x128eae)){for(var _0x13721b=0x0;_0x13721b<_0x128eae['length'];_0x13721b+=0x1){_0x291473[_0x89c7('0x96')](ami[_0x89c7('0x97')]({'action':_0x89c7('0x98'),'command':util['format'](_0x89c7('0x99'),_0x128eae[_0x13721b][_0x89c7('0x9a')],!_['isUndefined'](config[_0x89c7('0x93')][_0xed80b])?_0xed80b:'')})[_0x89c7('0x39')](function(_0x2d5afe){return _0x2d5afe[_0x89c7('0x9b')][_0x89c7('0x9c')](_0x89c7('0x9d'))>=0x0;})[_0x89c7('0x9e')](myreject(_0x1bf7ee)));}}else{_0x291473[_0x89c7('0x96')](ami[_0x89c7('0x97')]({'action':_0x89c7('0x98'),'command':util[_0x89c7('0x3e')](_0x89c7('0x99'),_0x128eae,!_[_0x89c7('0x51')](config['timezones'][_0xed80b])?_0xed80b:'')})[_0x89c7('0x39')](function(_0x3e0709){return _0x3e0709[_0x89c7('0x9b')]['indexOf'](_0x89c7('0x9d'))>=0x0;})[_0x89c7('0x9e')](myreject(_0x1bf7ee)));}Promise[_0x89c7('0x9f')](_0x291473)[_0x89c7('0x39')](function(_0xb68dac){var _0x16e826=_['some'](_0xb68dac);if(_0x16e826){return _0x1b8b72(_0x16e826);}else{_0x318e4e['message']=_0x296725?utils[_0x89c7('0x69')]['OVERTIME_GLOBAL_INTERVAL']:utils[_0x89c7('0x69')][_0x89c7('0xa0')];return _0x1bf7ee(msgResponse(_0x89c7('0xa1'),'Failure',_0x89c7('0xa2')+_0x296725+'\x20'+_0x2fc664+_0x89c7('0xa3')+util[_0x89c7('0x66')](_0x128eae,{'showHidden':![],'depth':null})+_0x89c7('0xa4')+_0xed80b));}})[_0x89c7('0x9e')](function(_0x288e8f){return _0x1bf7ee(msgResponse(_0x89c7('0x91'),_0x89c7('0x8f'),JSON[_0x89c7('0x72')](_0x288e8f)));});});};Dialer[_0x89c7('0x15')]['loopCampaigns']=function(){var _0x2b6829=this;return cmHopper['resetActiveCalls']({'active':![]},{'where':{'active':!![]}})[_0x89c7('0x39')](function(){setInterval(function(){_0x2b6829['syncCampaigns']();},0x3e8);});};Dialer[_0x89c7('0x15')][_0x89c7('0xa5')]=function(){var _0x3a3439=this;var _0x5d9886;for(var _0x59a2bd in this[_0x89c7('0x1b')]){if(typeof this[_0x89c7('0x1b')][_0x59a2bd]!=='undefined'){_0x5d9886=this[_0x89c7('0x1b')][_0x59a2bd];if(utils['isIVRCampaign'](_0x5d9886)&&utils['isIVRCampaignActive'](_0x5d9886)){_0x5d9886[_0x89c7('0x7e')]=!![];Promise[_0x89c7('0xa6')]()[_0x89c7('0x39')](checkIsIVRCampaignActive(_0x5d9886))['then'](checkInterval(_0x5d9886))[_0x89c7('0x39')](_0x3a3439['checkIsTrunkReachable'](_0x5d9886))[_0x89c7('0x39')](_0x3a3439['checkIfTime'](_0x5d9886[_0x89c7('0xa7')],_0x5d9886[_0x89c7('0xa8')],_0x5d9886[_0x89c7('0x40')],_0x5d9886))[_0x89c7('0x39')](_0x3a3439[_0x89c7('0xa9')](_0x5d9886[_0x89c7('0x74')],_0x5d9886['dialTimezone'],_0x5d9886[_0x89c7('0x40')],_0x5d9886))['then'](_0x3a3439[_0x89c7('0xaa')](_0x5d9886))[_0x89c7('0x9e')](loggerCatchQueueSummary(_0x89c7('0xab'),_0x5d9886));}else{notSendMessagesCampaign(_0x5d9886);}}}};Dialer[_0x89c7('0x15')][_0x89c7('0xac')]=function(_0x362667){if(_0x362667['dialMethod']!==_0x89c7('0xad')){clearPredictiveAttributes(_0x362667);}switch(_0x362667[_0x89c7('0xae')]){case _0x89c7('0xaf'):this[_0x89c7('0xb0')](_0x362667,0x1);break;case _0x89c7('0xb1'):this[_0x89c7('0xb0')](_0x362667,_0x362667['dialPowerLevel']);break;case _0x89c7('0xad'):this[_0x89c7('0xad')](_0x362667);break;case _0x89c7('0x8'):this[_0x89c7('0xb0')](_0x362667,0x1);break;default:logger[_0x89c7('0x63')](_0x89c7('0xb2'),_0x362667['name'],_0x89c7('0xb3'));}};Dialer['prototype']['ifTime']=function(_0x5e4cc6,_0x43611f){var _0x1f6958=_0x5e4cc6[_0x89c7('0xa8')];var _0x37b34e=_0x43611f?_0x5e4cc6[_0x89c7('0xa7')]:_0x5e4cc6[_0x89c7('0x74')][_0x89c7('0x77')];logger[_0x89c7('0xb4')](_0x89c7('0xb5'),_0x37b34e,_0x1f6958,_0x5e4cc6['name'],util[_0x89c7('0x3e')](_0x89c7('0xb6'),_0x5e4cc6['name'],_0x5e4cc6['id']));var _0x31779b=null;return Interval[_0x89c7('0xb7')](_0x37b34e,_0x1f6958)[_0x89c7('0x39')](function(_0x5b37fe){if(_0x5b37fe===!![]){return _0x5b37fe;}else{_0x5e4cc6['message']=_0x43611f?utils[_0x89c7('0x69')][_0x89c7('0xb8')]:utils[_0x89c7('0x69')][_0x89c7('0xa0')];_0x31779b=msgResponse(_0x89c7('0xa1'),_0x89c7('0x8f'),_0x89c7('0xa2')+_0x43611f+'\x20'+_0x5e4cc6[_0x89c7('0x40')]+_0x89c7('0xa3')+util['inspect'](_0x37b34e,{'showHidden':![],'depth':null})+_0x89c7('0xa4')+_0x1f6958);}if(_0x31779b!==null){logger['silly']('Dialer::ifTime()\x20errResponse\x20NOT\x20NULL:',_0x31779b);_0x31779b[_0x89c7('0xb9')]=_0x43611f;throw _0x31779b;}})[_0x89c7('0x9e')](function(_0xeffeca){logger[_0x89c7('0x63')]('AMI\x20IfTime',_0xeffeca);throw msgResponse(_0x89c7('0x83'),_0x89c7('0xba'),util[_0x89c7('0x66')](_0xeffeca,{'showHidden':![],'depth':null}));});};Dialer['prototype'][_0x89c7('0xbb')]=function(_0x52d042){if(this[_0x89c7('0x1a')][_0x52d042[_0x89c7('0xbc')]]){if(this['uniqueId'][_0x52d042[_0x89c7('0xbd')]]&&this['uniqueId'][_0x52d042[_0x89c7('0xbd')]]['type']!==_0x89c7('0xbe')){this[_0x89c7('0xbf')](this[_0x89c7('0x1a')][_0x52d042[_0x89c7('0xbc')]]);this[_0x89c7('0x21')][_0x52d042[_0x89c7('0xbd')]][_0x89c7('0xc0')]=moment()['format'](_0x89c7('0xc1'));}}};Dialer['prototype']['syncAgentComplete']=function(_0x56527c){var _0x4e26d2=this[_0x89c7('0x21')][_0x56527c[_0x89c7('0xbd')]];if(this[_0x89c7('0x1a')][_0x56527c['queue']]){if(_0x4e26d2&&_0x4e26d2[_0x89c7('0xc2')]!=='ivr'){delete this['uniqueId'][_0x56527c[_0x89c7('0xbd')]];this[_0x89c7('0x1a')][_0x56527c[_0x89c7('0xbc')]][_0x89c7('0xc3')]+=0x1;var _0x12f4ac=new AgentComplete(_0x4e26d2,_0x56527c);if(_0x56527c[_0x89c7('0xc4')]===_0x89c7('0xc5')){_0x12f4ac[_0x89c7('0xc6')]=this['voiceQueues'][_0x56527c[_0x89c7('0xbc')]][_0x89c7('0xc7')]&&this[_0x89c7('0x1a')][_0x56527c['queue']][_0x89c7('0xc8')]?moment()[_0x89c7('0x3e')](_0x89c7('0xc1')):undefined;}hopperUtils[_0x89c7('0xc9')](_0x12f4ac)[_0x89c7('0x9e')](loggerCatch(_0x89c7('0xca')));hopperUtils[_0x89c7('0xcb')](_0x12f4ac)['catch'](loggerCatch('[syncAgentComplete]'));}}};Dialer[_0x89c7('0x15')]['syncQueueCallerAbandon']=function(_0xa45d1b){var _0x2f196c=this[_0x89c7('0x21')][_0xa45d1b[_0x89c7('0xbd')]];var _0x2231c1=this;var _0x13fd8f=![];var _0x2d2a46;var _0x3377b1;if(this[_0x89c7('0x1a')][_0xa45d1b[_0x89c7('0xbc')]]){if(_0x2f196c&&_0x2f196c[_0x89c7('0xc2')]!==_0x89c7('0xbe')){delete this['uniqueId'][_0xa45d1b[_0x89c7('0xbd')]];this['updateOriginated'](this[_0x89c7('0x1a')][_0xa45d1b['queue']]);_0x2f196c[_0x89c7('0xcc')]=moment()[_0x89c7('0x3e')]('YYYY-MM-DD\x20HH:mm:ss');var _0x3ac64f=new QueueCallerAbandon(_0x2f196c,_0xa45d1b);if(utils[_0x89c7('0x5e')](_0x2f196c[_0x89c7('0xcc')],_0x2f196c['responsetime'])>=_0x2f196c[_0x89c7('0xcd')]){this[_0x89c7('0x1a')][_0xa45d1b[_0x89c7('0xbc')]][_0x89c7('0x48')]+=0x1;this[_0x89c7('0x1a')][_0xa45d1b[_0x89c7('0xbc')]][_0x89c7('0xce')]+=0x1;this[_0x89c7('0x1a')][_0xa45d1b[_0x89c7('0xbc')]][_0x89c7('0xcf')]+=0x1;_0x3ac64f[_0x89c7('0xd0')]=0xa;_0x3ac64f['statedesc']='Drop';_0x3ac64f[_0x89c7('0xd1')]=_0x89c7('0xd2');_0x3ac64f[_0x89c7('0xc6')]=this['voiceQueues'][_0xa45d1b[_0x89c7('0xbc')]][_0x89c7('0xc7')]?moment()[_0x89c7('0x3e')]('YYYY-MM-DD\x20HH:mm:ss'):undefined;_0x3ac64f['countdropretry']+=0x1;_0x3ac64f[_0x89c7('0xd3')]+=0x1;_0x2d2a46=this[_0x89c7('0x1a')][_0xa45d1b[_0x89c7('0xbc')]][_0x89c7('0xd4')];_0x3377b1=this[_0x89c7('0x1a')][_0xa45d1b[_0x89c7('0xbc')]]['callAdditionalPhoneAfterMin'];hopperUtils[_0x89c7('0xd5')](_0x3ac64f,_0x3ac64f[_0x89c7('0xd0')],_0x2f196c[_0x89c7('0xd6')])[_0x89c7('0x39')](function(_0x3a0c46){_0x13fd8f=_0x3a0c46[_0x89c7('0xd7')]==0x1;if(_0x3ac64f[_0x89c7('0xd8')]>=_0x2231c1[_0x89c7('0x1a')][_0xa45d1b[_0x89c7('0xbc')]][_0x89c7('0xd9')]){_0x2231c1[_0x89c7('0xda')](_0x3ac64f,_0x3a0c46[_0x89c7('0xd7')]);}else{hopperUtils[_0x89c7('0xdb')]({'active':![],'countdropretry':_0x3ac64f[_0x89c7('0xd8')],'scheduledat':moment()['add'](_0x2231c1['voiceQueues'][_0xa45d1b[_0x89c7('0xbc')]][_0x89c7('0xd4')],'minutes')[_0x89c7('0x3e')](_0x89c7('0xc1')),'ContactId':_0x2f196c['ContactId'],'ListId':_0x2f196c['ListId'],'VoiceQueueId':_0x2f196c['VoiceQueueId']||undefined,'CampaignId':_0x2f196c[_0x89c7('0xdc')]||undefined})[_0x89c7('0x9e')](loggerCatch(_0x89c7('0xdd')));var _0x19b921=new History(_0x3ac64f);_0x19b921['state']=0xa;_0x19b921['statedesc']=_0x89c7('0xde');_0x19b921['starttime']=moment()['format']('YYYY-MM-DD\x20HH:mm:ss');_0x19b921[_0x89c7('0x6d')]=_0x19b921[_0x89c7('0x6e')];_0x19b921[_0x89c7('0xdf')]=_0x3ac64f[_0x89c7('0xdf')];_0x19b921[_0x89c7('0xe0')]=_0x3ac64f['calleridnum'];hopperUtils[_0x89c7('0xc9')](_0x19b921)[_0x89c7('0x9e')](loggerCatch('[syncAgentComplete][createHistory][10]'));}})[_0x89c7('0x39')](function(){if(_0x13fd8f)hopperUtils[_0x89c7('0xe1')](_0x3ac64f,_0x2d2a46,_0x3377b1)[_0x89c7('0x39')](function(){return 0x1;});});}else{this[_0x89c7('0x1a')][_0xa45d1b[_0x89c7('0xbc')]][_0x89c7('0x4a')]+=0x1;this[_0x89c7('0x1a')][_0xa45d1b[_0x89c7('0xbc')]]['outboundDropCallsDayCallersExit']+=0x1;_0x3ac64f[_0x89c7('0xd0')]=0xb;_0x3ac64f[_0x89c7('0xe2')]=_0x89c7('0xe3');_0x3ac64f[_0x89c7('0xd1')]=_0x89c7('0xe4');_0x3ac64f[_0x89c7('0xe5')]+=0x1;_0x3ac64f[_0x89c7('0xd3')]+=0x1;_0x2d2a46=this[_0x89c7('0x1a')][_0xa45d1b[_0x89c7('0xbc')]][_0x89c7('0xe6')];_0x3377b1=this['voiceQueues'][_0xa45d1b[_0x89c7('0xbc')]][_0x89c7('0xe7')];hopperUtils['verifyAdditionalPhones'](_0x3ac64f,_0x3ac64f[_0x89c7('0xd0')],_0x2f196c[_0x89c7('0xd6')])[_0x89c7('0x39')](function(_0x260507){if(_0x3ac64f['countabandonedretry']>=_0x2231c1[_0x89c7('0x1a')][_0xa45d1b['queue']][_0x89c7('0xe8')]){_0x2231c1[_0x89c7('0xda')](_0x3ac64f,_0x260507[_0x89c7('0xd7')]);}else{hopperUtils['rescheduleContact']({'active':![],'countabandonedretry':_0x3ac64f[_0x89c7('0xe5')],'scheduledat':moment()[_0x89c7('0xe9')](_0x2231c1[_0x89c7('0x1a')][_0xa45d1b[_0x89c7('0xbc')]]['dialAbandonedRetryFrequency'],_0x89c7('0xea'))[_0x89c7('0x3e')]('YYYY-MM-DD\x20HH:mm:ss'),'ContactId':_0x2f196c[_0x89c7('0xeb')],'ListId':_0x2f196c[_0x89c7('0xec')],'VoiceQueueId':_0x2f196c[_0x89c7('0xed')]||undefined,'CampaignId':_0x2f196c[_0x89c7('0xdc')]||undefined})['catch'](loggerCatch(_0x89c7('0xee')));var _0x5e2a35=new History(_0x3ac64f);_0x5e2a35[_0x89c7('0xd0')]=0xb;_0x5e2a35[_0x89c7('0xe2')]=_0x89c7('0xe3');_0x5e2a35[_0x89c7('0x6e')]=moment()[_0x89c7('0x3e')](_0x89c7('0xc1'));_0x5e2a35[_0x89c7('0x6d')]=_0x5e2a35[_0x89c7('0x6e')];_0x5e2a35['calleridname']=_0x3ac64f[_0x89c7('0xdf')];_0x5e2a35[_0x89c7('0xe0')]=_0x3ac64f[_0x89c7('0xe0')];hopperUtils[_0x89c7('0xc9')](_0x5e2a35)[_0x89c7('0x9e')](loggerCatch(_0x89c7('0xef')));}})['then'](function(){if(_0x13fd8f)hopperUtils[_0x89c7('0xe1')](_0x3ac64f,_0x2d2a46,_0x3377b1)['then'](function(){return 0x1;});});}}}};Dialer[_0x89c7('0x15')][_0x89c7('0x32')]=function(_0x3894f9){if(this[_0x89c7('0x1f')][_0x3894f9[_0x89c7('0xbd')]]){this[_0x89c7('0x1f')][_0x3894f9[_0x89c7('0xbd')]][_0x89c7('0xf0')]=_0x3894f9[_0x89c7('0xf0')];}if(this[_0x89c7('0x21')][_0x3894f9[_0x89c7('0xbd')]]){this[_0x89c7('0x21')][_0x3894f9[_0x89c7('0xbd')]]['channel']=_0x3894f9['channel'];}};Dialer[_0x89c7('0x15')][_0x89c7('0x36')]=function(_0x2b5e39){if(!this['actions'][_0x2b5e39['actionid']]){return;}var _0xa17330=this['voiceQueues'][this['actions'][_0x2b5e39[_0x89c7('0xf1')]]['queue']][_0x89c7('0xf2')]||_0x89c7('0xf3');if(_0xa17330===_0x89c7('0xf4')){if(this[_0x89c7('0x1f')][_0x2b5e39[_0x89c7('0xf1')]]&&_['isNil'](this['actions'][_0x2b5e39[_0x89c7('0xf1')]]['locked'])&&_0x2b5e39[_0x89c7('0x87')]==='1'&&_0x2b5e39[_0x89c7('0xf5')]==='0'){if(this[_0x89c7('0x1c')][_0x2b5e39[_0x89c7('0xf6')]]){if(!this[_0x89c7('0x1c')][_0x2b5e39[_0x89c7('0xf6')]][_0x89c7('0xf7')]){this[_0x89c7('0x1c')][_0x2b5e39['stateinterface']]['locked']=!![];this[_0x89c7('0x1f')][_0x2b5e39[_0x89c7('0xf1')]][_0x89c7('0xf7')]=!![];this[_0x89c7('0x1f')][_0x2b5e39['actionid']][_0x89c7('0xf6')]=_0x2b5e39[_0x89c7('0xf6')];}}}}else if(_0xa17330===_0x89c7('0xf3')){if(this[_0x89c7('0x1f')][_0x2b5e39[_0x89c7('0xf1')]]){if(this[_0x89c7('0x1c')][_0x2b5e39['stateinterface']]){this[_0x89c7('0x1f')][_0x2b5e39['actionid']][_0x89c7('0xf6')]=_0x2b5e39[_0x89c7('0xf6')];if(_[_0x89c7('0xf8')](this[_0x89c7('0x26')][this['actions'][_0x2b5e39[_0x89c7('0xf1')]][_0x89c7('0xbc')]])){this[_0x89c7('0x26')][this[_0x89c7('0x1f')][_0x2b5e39[_0x89c7('0xf1')]]['queue']]=[];}this['queueBooked'][this[_0x89c7('0x1f')][_0x2b5e39[_0x89c7('0xf1')]]['queue']]['push'](_[_0x89c7('0x5d')](_[_0x89c7('0x73')](this[_0x89c7('0x1f')][_0x2b5e39[_0x89c7('0xf1')]],['idHopper',_0x89c7('0xf6')]),{'status':_0x2b5e39['status'],'paused':_0x2b5e39[_0x89c7('0xf5')]}));}}}};Dialer['prototype'][_0x89c7('0xf9')]=function(_0x44c979){if(!this[_0x89c7('0x1f')][_0x44c979[_0x89c7('0xf1')]]){return;}var _0x73d49a=this;var _0x480160=this[_0x89c7('0x1a')][this['actions'][_0x44c979[_0x89c7('0xf1')]][_0x89c7('0xbc')]];var _0x51445f=_0x480160['strategy']||_0x89c7('0xf3');if(_0x51445f==='roundrobin'){if(this[_0x89c7('0x1f')][_0x44c979[_0x89c7('0xf1')]]&&this['actions'][_0x44c979[_0x89c7('0xf1')]]['stateinterface']){this[_0x89c7('0x19')][_0x89c7('0xfa')](this[_0x89c7('0x1f')][_0x44c979[_0x89c7('0xf1')]]['idHopper'],this['actions'][_0x44c979['actionid']]['stateinterface'])[_0x89c7('0x9e')](function(_0x5974a4){logger[_0x89c7('0x63')](_0x89c7('0xfb'),util[_0x89c7('0x66')](_0x5974a4,{'showHidden':![],'depth':null}));})['finally'](function(){_0x73d49a[_0x89c7('0xbf')](_0x73d49a[_0x89c7('0x1a')][_0x73d49a[_0x89c7('0x1f')][_0x44c979[_0x89c7('0xf1')]][_0x89c7('0xbc')]]);_0x73d49a[_0x89c7('0x1c')][_0x73d49a[_0x89c7('0x1f')][_0x44c979['actionid']][_0x89c7('0xf6')]][_0x89c7('0xf7')]=![];delete _0x73d49a[_0x89c7('0x1f')][_0x44c979['actionid']];unlockQueueStatus(_0x480160);});}else{this[_0x89c7('0xbf')](this[_0x89c7('0x1a')][this['actions'][_0x44c979[_0x89c7('0xf1')]][_0x89c7('0xbc')]]);hopperUtils['rescheduleContact']({'active':![],'ContactId':this[_0x89c7('0x1f')][_0x44c979[_0x89c7('0xf1')]][_0x89c7('0xeb')],'ListId':this[_0x89c7('0x1f')][_0x44c979[_0x89c7('0xf1')]][_0x89c7('0xec')],'VoiceQueueId':this['actions'][_0x44c979[_0x89c7('0xf1')]]['VoiceQueueId']||undefined,'CampaignId':this[_0x89c7('0x1f')][_0x44c979[_0x89c7('0xf1')]][_0x89c7('0xdc')]||undefined})['catch'](loggerCatch(_0x89c7('0xfc')));delete this[_0x89c7('0x1f')][_0x44c979[_0x89c7('0xf1')]];unlockQueueStatus(_0x480160);}}else if(_0x51445f==='rrmemory'){var _0x5b065d;if(this[_0x89c7('0x1f')][_0x44c979[_0x89c7('0xf1')]]&&!_[_0x89c7('0x78')](this[_0x89c7('0x26')][this[_0x89c7('0x1f')][_0x44c979['actionid']][_0x89c7('0xbc')]])){if(this[_0x89c7('0x27')][_0x73d49a[_0x89c7('0x1f')][_0x44c979[_0x89c7('0xf1')]]['queue']]){this[_0x89c7('0x27')][_0x73d49a[_0x89c7('0x1f')][_0x44c979[_0x89c7('0xf1')]][_0x89c7('0xbc')]]=this[_0x89c7('0x27')][this['actions'][_0x44c979[_0x89c7('0xf1')]][_0x89c7('0xbc')]]?this[_0x89c7('0x27')][this['actions'][_0x44c979[_0x89c7('0xf1')]][_0x89c7('0xbc')]]:this['queueBooked'][this[_0x89c7('0x1f')][_0x44c979['actionid']][_0x89c7('0xbc')]]?this['queueBooked'][this[_0x89c7('0x1f')][_0x44c979[_0x89c7('0xf1')]][_0x89c7('0xbc')]][_0x89c7('0xfd')]||0x0:0x0;}this[_0x89c7('0x26')][this[_0x89c7('0x1f')][_0x44c979[_0x89c7('0xf1')]][_0x89c7('0xbc')]][_0x89c7('0xfd')]=this['queueBookedRR'][this['actions'][_0x44c979[_0x89c7('0xf1')]][_0x89c7('0xbc')]];for(var _0x42926d=0x0;_0x42926d=_0x39d86b[_0x89c7('0x123')]){_0x28ae6d[_0x89c7('0x124')](_0x291a3e,_0x274cb6,_0x5cd869,_0x89c7('0x125'));}else{if(_0x291a3e['countmachineretry']>=_0x39d86b['dialMachineMaxRetry']){_0x28ae6d[_0x89c7('0x126')](_0x291a3e,_0x274cb6,_0x5cd869,_0x89c7('0x127'));}else{hopperUtils['rescheduleContact']({'active':![],'countmachineretry':_0x291a3e[_0x89c7('0x11c')],'scheduledat':moment()[_0x89c7('0xe9')](_0x39d86b[_0x89c7('0x128')],_0x89c7('0xea'))['format']('YYYY-MM-DD\x20HH:mm:ss'),'ContactId':_0x291a3e[_0x89c7('0xeb')],'ListId':_0x291a3e['ListId'],'VoiceQueueId':_0x291a3e['VoiceQueueId']||undefined,'CampaignId':_0x291a3e[_0x89c7('0xdc')]||undefined})[_0x89c7('0x9e')](loggerCatch(_0x89c7('0x129')));_0x274cb6({'reschedule':0x1});}}});}if(_0x12c829[_0x89c7('0xc2')]===_0x89c7('0xbe')&&this['campaigns'][_0x12c829[_0x89c7('0xbc')]]['dialAMDActive']&&_0x219f63[_0x89c7('0x11a')]===_0x89c7('0x12a')){delete this['uniqueId'][_0x219f63[_0x89c7('0xbd')]];this[_0x89c7('0xbf')](this[_0x89c7('0x1b')][_0x12c829[_0x89c7('0xbc')]]);_0x3d8c0c=new Hangup(_0x12c829,_0x219f63);_0x3d8c0c[_0x89c7('0xd0')]=0x12;_0x3d8c0c[_0x89c7('0xe2')]=_0x89c7('0x112');_0x3d8c0c['membername']=_0x89c7('0x114');ami[_0x89c7('0x115')](_0x89c7('0x116'),ut[_0x89c7('0x117')](_0x3d8c0c,_0x89c7('0x11d')));this['saveInDb'](_0x3d8c0c,_0x89c7('0x12b'),_0x89c7('0x12c'));}if(_0x12c829['type']===_0x89c7('0xbe')&&this[_0x89c7('0x1b')][_0x12c829[_0x89c7('0xbc')]][_0x89c7('0x110')]&&_0x219f63[_0x89c7('0x11a')]===_0x89c7('0x12d')){return new Promise(function(_0xf54c3c,_0x5d68dd){delete _0x28ae6d[_0x89c7('0x21')][_0x219f63['uniqueid']];_0x28ae6d['updateOriginated'](_0x28ae6d[_0x89c7('0x1b')][_0x12c829[_0x89c7('0xbc')]]);_0x28ae6d[_0x89c7('0x1b')][_0x12c829[_0x89c7('0xbc')]][_0x89c7('0xc3')]+=0x1;_0x28ae6d[_0x89c7('0x1b')][_0x12c829['queue']]['outboundAnswerAgiCallsDay']+=0x1;var _0x20b682=_0x28ae6d[_0x89c7('0x1b')][_0x12c829[_0x89c7('0xbc')]];var _0x36cccf=new Hangup(_0x12c829,_0x219f63);_0x36cccf[_0x89c7('0xd0')]=0x13;_0x36cccf[_0x89c7('0xe2')]=_0x89c7('0x11b');_0x36cccf[_0x89c7('0x113')]=_0x89c7('0x114');_0x36cccf['countmachineretry']+=0x1;_0x36cccf['countglobal']+=0x1;_0x36cccf[_0x89c7('0x11d')]=!![];ami['emit'](_0x89c7('0x116'),ut[_0x89c7('0x117')](_0x36cccf,_0x89c7('0x11d')));hopperUtils[_0x89c7('0xc9')](_0x36cccf)[_0x89c7('0x9e')](loggerCatch(_0x89c7('0x11e')));if(_0x36cccf['countbusyretry']+_0x36cccf[_0x89c7('0x120')]+_0x36cccf[_0x89c7('0x121')]+_0x36cccf['countnosuchnumberretry']+_0x36cccf[_0x89c7('0xd8')]+_0x36cccf[_0x89c7('0xe5')]+_0x36cccf[_0x89c7('0x11c')]+_0x36cccf[_0x89c7('0x12e')]>=_0x20b682['dialGlobalMaxRetry']){_0x28ae6d[_0x89c7('0x124')](_0x36cccf,_0xf54c3c,_0x5d68dd,'reason19\x20machine....');}else{if(_0x36cccf[_0x89c7('0x11c')]>=_0x20b682[_0x89c7('0x12f')]){_0x28ae6d['createStateFinal'](_0x36cccf,_0xf54c3c,_0x5d68dd,_0x89c7('0x127'));}else{hopperUtils['rescheduleContact']({'active':![],'countmachineretry':_0x36cccf[_0x89c7('0x11c')],'scheduledat':moment()[_0x89c7('0xe9')](_0x20b682['dialMachineRetryFrequency'],_0x89c7('0xea'))['format'](_0x89c7('0xc1')),'ContactId':_0x36cccf[_0x89c7('0xeb')],'ListId':_0x36cccf[_0x89c7('0xec')],'VoiceQueueId':_0x36cccf[_0x89c7('0xed')]||undefined,'CampaignId':_0x36cccf[_0x89c7('0xdc')]||undefined})[_0x89c7('0x9e')](loggerCatch('[rescheduleContact][Machine]'));_0xf54c3c({'reschedule':0x1});}}});}}};Dialer['prototype'][_0x89c7('0x130')]=function(_0x2f599b){var _0x306a1d=this[_0x89c7('0x21')][_0x2f599b[_0x89c7('0xbd')]];var _0x5b8396;if(_0x306a1d&&_0x306a1d[_0x89c7('0xc2')]===_0x89c7('0xbe')){delete this['uniqueId'][_0x2f599b[_0x89c7('0xbd')]];this['updateOriginated'](this['campaigns'][_0x306a1d[_0x89c7('0xbc')]]);this[_0x89c7('0x1b')][_0x306a1d[_0x89c7('0xbc')]][_0x89c7('0x131')]+=0x1;_0x5b8396=new Hangup(_0x306a1d,_0x2f599b);hopperUtils[_0x89c7('0xc9')](_0x5b8396)[_0x89c7('0x9e')](loggerCatch('[syncHangupIvr][createHistory]'));hopperUtils[_0x89c7('0xcb')](_0x5b8396)['catch'](loggerCatch(_0x89c7('0x132')));}if(_0x306a1d&&_0x306a1d[_0x89c7('0xc2')]!==_0x89c7('0xbe')&&isNotNull(this[_0x89c7('0x1a')][_0x306a1d['queue']][_0x89c7('0x133')])){delete this[_0x89c7('0x21')][_0x2f599b[_0x89c7('0xbd')]];this[_0x89c7('0xbf')](this[_0x89c7('0x1a')][_0x306a1d[_0x89c7('0xbc')]]);this[_0x89c7('0x1a')][_0x306a1d[_0x89c7('0xbc')]][_0x89c7('0xc3')]+=0x1;this['voiceQueues'][_0x306a1d[_0x89c7('0xbc')]][_0x89c7('0x111')]+=0x1;_0x5b8396=new Hangup(_0x306a1d,_0x2f599b);_0x5b8396[_0x89c7('0xd0')]=0x10;_0x5b8396[_0x89c7('0xe2')]=_0x89c7('0x134');_0x5b8396[_0x89c7('0x113')]='AGI';hopperUtils[_0x89c7('0xc9')](_0x5b8396)[_0x89c7('0x9e')](loggerCatch(_0x89c7('0x135')));hopperUtils['moveContactManagedDialer'](_0x5b8396)[_0x89c7('0x9e')](loggerCatch(_0x89c7('0x132')));}if(_0x306a1d&&_0x306a1d[_0x89c7('0xc2')]!=='ivr'&&!isNotNull(this['voiceQueues'][_0x306a1d[_0x89c7('0xbc')]][_0x89c7('0x133')])){delete this[_0x89c7('0x21')][_0x2f599b['uniqueid']];this['updateOriginated'](this[_0x89c7('0x1a')][_0x306a1d['queue']]);this[_0x89c7('0x1a')][_0x306a1d[_0x89c7('0xbc')]][_0x89c7('0x136')]+=0x1;_0x5b8396=new Hangup(_0x306a1d,_0x2f599b);_0x5b8396[_0x89c7('0xd0')]=0xc;_0x5b8396[_0x89c7('0xe2')]=_0x2f599b[_0x89c7('0x137')];_0x5b8396['membername']='Unknow';hopperUtils['createHistory'](_0x5b8396)[_0x89c7('0x9e')](loggerCatch(_0x89c7('0x135')));hopperUtils[_0x89c7('0xcb')](_0x5b8396)[_0x89c7('0x9e')](loggerCatch(_0x89c7('0x132')));}};Dialer['prototype']['syncQueueSummary']=function(_0x3f4f66){var _0x470a56=this;if(!_0x470a56['queuesSummary'][_0x3f4f66['name']]){_0x470a56['queuesSummary'][_0x3f4f66[_0x89c7('0x40')]]={'running':![]};}else if(_0x470a56[_0x89c7('0x28')][_0x3f4f66['name']][_0x89c7('0x138')]===!![]){return;}else if(_0x470a56[_0x89c7('0x28')][_0x3f4f66['name']][_0x89c7('0x138')]===![]){_0x470a56[_0x89c7('0x28')][_0x3f4f66[_0x89c7('0x40')]][_0x89c7('0x138')]=!![];}var _0x38bc79=_0x470a56[_0x89c7('0x1a')][_0x3f4f66[_0x89c7('0x40')]];var _0x4d80b6=_0x38bc79['message']!==utils[_0x89c7('0x69')][_0x89c7('0x79')];var _0x316ce7=utils['isPreviewCampaign'](_0x38bc79);_0x38bc79[_0x89c7('0x139')]=utils[_0x89c7('0x13a')](_0x38bc79,_0x470a56[_0x89c7('0x1d')]);Promise['resolve']()[_0x89c7('0x39')](function(){if(_0x38bc79['statusMessage']===utils[_0x89c7('0x69')][_0x89c7('0x79')]){if(_0x4d80b6){clearPredictiveAttributes(_0x38bc79);_0x3f4f66[_0x89c7('0x23')]=undefined;_0x3f4f66[_0x89c7('0x24')]=undefined;}if(_0x38bc79[_0x89c7('0x139')]===utils[_0x89c7('0x69')]['INACTIVE']){_0x3f4f66[_0x89c7('0x13b')]=0x0;_0x3f4f66[_0x89c7('0xf5')]=0x0;_0x3f4f66[_0x89c7('0x13c')]=0x0;_0x3f4f66[_0x89c7('0x13d')]=0x0;_0x3f4f66[_0x89c7('0x13e')]=0x0;}}else if(_0x38bc79[_0x89c7('0x139')]===utils['CAMPAIGN_STATUS']['ACTIVE']&&!_0x316ce7){return _0x470a56[_0x89c7('0x91')](_0x38bc79,!![])[_0x89c7('0x39')](function(){return _0x470a56['ifTime'](_0x38bc79,![]);})[_0x89c7('0x39')](function(){return _0x470a56['checkDialMethod'](_0x38bc79);})[_0x89c7('0x9e')](function(_0x5a4e98){loggerSyncQueueSummary[_0x89c7('0x3c')](_0x89c7('0x13f'),util[_0x89c7('0x66')](_0x5a4e98,{'showHidden':![],'depth':null}));clearPredictiveAttributes(_0x38bc79);});}else{clearPredictiveAttributes(_0x38bc79);}})['then'](function(){var _0x413ed6=_0x3f4f66['compareToOutboundQueue'](_0x38bc79);if(_0x413ed6||_0x38bc79[_0x89c7('0x140')]){_0x38bc79[_0x89c7('0x140')]=![];_0x3f4f66[_0x89c7('0x141')](_0x38bc79);Object[_0x89c7('0x142')](_0x38bc79,_0x3f4f66);emitOutboundVoiceQueueSummary(_0x3f4f66);}_0x470a56[_0x89c7('0x28')][_0x38bc79['name']]['running']=![];})[_0x89c7('0x9e')](function(_0x3f1718){logger[_0x89c7('0x63')](_0x89c7('0x13f'),util['inspect'](_0x3f1718,{'showHidden':![],'depth':null}));_0x470a56[_0x89c7('0x28')][_0x38bc79[_0x89c7('0x40')]][_0x89c7('0x138')]=![];});};Dialer[_0x89c7('0x15')][_0x89c7('0x143')]=_[_0x89c7('0x144')](function(){var _0x2782a5=_[_0x89c7('0x145')](this[_0x89c7('0x1a')],function(_0xeecdf5){return _0xeecdf5[_0x89c7('0x146')];});var _0x475595=_[_0x89c7('0x145')](this[_0x89c7('0x1c')],function(_0x41eb95){return _0x41eb95[_0x89c7('0x147')]&&_0x41eb95['status']==='reachable';});if(_0x2782a5['length']>0x0&&_0x475595[_0x89c7('0x148')]>0x0){return Promise[_0x89c7('0xa6')]()[_0x89c7('0x39')](cmHopper[_0x89c7('0x149')](_[_0x89c7('0x14a')](_0x2782a5,'id'),previewRecallmeReminderInterval,_['map'](_0x475595,'id')))[_0x89c7('0x39')](function(_0x2d9ae0){for(var _0x10db10=0x0;_0x10db10<_0x2d9ae0[_0x89c7('0x148')];_0x10db10++){var _0x3fa9f3=_0x2d9ae0[_0x10db10][_0x89c7('0x14b')][_0x89c7('0x40')];if(_0x3fa9f3)io['to'](util[_0x89c7('0x3e')](_0x89c7('0x14c'),_0x3fa9f3))[_0x89c7('0x115')](_0x89c7('0x14d'),{'hopper':_0x2d9ae0[_0x10db10]});}})['catch'](function(_0x28a35b){logger[_0x89c7('0x63')](_0x89c7('0x14e'),_0x28a35b);});}},0x3c*0x3e8,{'leading':!![]});Dialer[_0x89c7('0x15')][_0x89c7('0x38')]=function(){var _0x694ff5=this;setInterval(function(){_0x694ff5[_0x89c7('0x14f')](_0x694ff5[_0x89c7('0x21')],_0x89c7('0x150'));_0x694ff5[_0x89c7('0x14f')](_0x694ff5['actions'],_0x89c7('0x151'));},0x32c8);};Dialer[_0x89c7('0x15')][_0x89c7('0x14f')]=function(_0x229fcd,_0x2161e5){var _0x103521=this;for(var _0x1b3366 in _0x229fcd){if(typeof _0x229fcd[_0x1b3366]!==_0x89c7('0x152')){this['sequence']['enqueue'](function(){if(!_['isNil'](_0x229fcd[_0x1b3366])){return ami[_0x89c7('0x97')]({'action':_0x89c7('0x87'),'channel':_0x229fcd[_0x1b3366][_0x89c7('0xf0')]})[_0x89c7('0x9e')](function(_0x1e6b37){if(_0x1e6b37[_0x89c7('0x68')]===_0x89c7('0x153')){setTimeout(function(){if(_0x229fcd[_0x1b3366]&&_0x229fcd[_0x1b3366][_0x89c7('0xc2')]!=='ivr'){_0x103521['updateOriginated'](_0x103521['voiceQueues'][_0x229fcd[_0x1b3366][_0x89c7('0xbc')]]);logger[_0x89c7('0x63')](_0x89c7('0x154'),_0x2161e5,_0x1b3366,_0x229fcd[_0x1b3366][_0x89c7('0xbc')]);delete _0x229fcd[_0x1b3366];}if(_0x229fcd[_0x1b3366]&&_0x229fcd[_0x1b3366][_0x89c7('0xc2')]===_0x89c7('0xbe')){_0x103521[_0x89c7('0xbf')](_0x103521[_0x89c7('0x1b')][_0x229fcd[_0x1b3366][_0x89c7('0xbc')]]);logger['error'](_0x89c7('0x155'),_0x2161e5,_0x1b3366,_0x229fcd[_0x1b3366]['queue']);delete _0x229fcd[_0x1b3366];}},0x2328);}});}});}}};Dialer[_0x89c7('0x15')][_0x89c7('0x156')]=function(_0x958fc7){return Promise[_0x89c7('0xa6')]()['then'](voiceQueueRt[_0x89c7('0x156')](_0x958fc7))['catch'](loggerCatch(_0x89c7('0x157')));};Dialer[_0x89c7('0x15')][_0x89c7('0xbf')]=function(_0x4c3afa){if(!_[_0x89c7('0x51')](_0x4c3afa)&&_0x4c3afa!==null){if(typeof _0x4c3afa[_0x89c7('0x7f')]!==_0x89c7('0x152')){if(_0x4c3afa[_0x89c7('0x7f')]>0x0){_0x4c3afa[_0x89c7('0x7f')]-=0x1;}else{logger[_0x89c7('0x63')](_0x89c7('0x158'));}}}else{logger[_0x89c7('0x63')](_0x89c7('0x159'));}};Dialer[_0x89c7('0x15')][_0x89c7('0x15a')]=function(_0x175e7d,_0x3b0c26){var _0x43eccd=this;return function(_0x2c367b){_0x43eccd[_0x89c7('0xbf')](_0x3b0c26);logger[_0x89c7('0x63')](_0x175e7d,util[_0x89c7('0x66')](_0x2c367b,{'showHidden':![],'depth':null}));};};Dialer[_0x89c7('0x15')][_0x89c7('0x15b')]=function(_0x339c7f,_0x2c100a,_0x51f30a){var _0x1c1748={'state':0x19,'statedesc':'notFound'};this[_0x89c7('0xbf')](_0x2c100a);this[_0x89c7('0x118')](_[_0x89c7('0x5d')](_0x1c1748,_['pick'](_0x51f30a,[_0x89c7('0xeb'),_0x89c7('0xec'),_0x89c7('0x15c'),_0x89c7('0xed'),'CampaignId'])),_0x89c7('0x15d'),_0x89c7('0x15e'));logger['error'](_0x339c7f);};Dialer[_0x89c7('0x15')][_0x89c7('0x118')]=function(_0x56eea4,_0x12dbe4,_0x5e08c8){hopperUtils[_0x89c7('0xc9')](_0x56eea4)[_0x89c7('0x9e')](loggerCatch(_0x12dbe4));hopperUtils[_0x89c7('0xcb')](_0x56eea4)['catch'](loggerCatch(_0x5e08c8));};Dialer[_0x89c7('0x15')][_0x89c7('0xda')]=function(_0x3dcb8d,_0x3b08aa){hopperUtils[_0x89c7('0xc9')](_0x3dcb8d)[_0x89c7('0x9e')](loggerCatch(_0x89c7('0xca')));if(_0x3b08aa==0x0){hopperUtils[_0x89c7('0xcb')](_0x3dcb8d)[_0x89c7('0x9e')](loggerCatch(_0x89c7('0x15f')));}};Dialer[_0x89c7('0x15')][_0x89c7('0x14e')]=function(_0xd31ec5){return Promise['resolve']()[_0x89c7('0x39')](cmHopper['handlePreviewRecallNotifications'](_0xd31ec5['id'],previewRecallmeReminderInterval))[_0x89c7('0x39')](function(_0xee1c70){for(var _0x32ca45=0x0;_0x32ca45<_0xee1c70[_0x89c7('0x148')];_0x32ca45++){var _0x1f3e10=_0xee1c70[_0x32ca45][_0x89c7('0x14b')][_0x89c7('0x40')];if(_0x1f3e10)io['to'](util[_0x89c7('0x3e')]('user:%s',_0x1f3e10))[_0x89c7('0x115')](_0x89c7('0x14d'),{'hopper':_0xee1c70[_0x32ca45]});}})[_0x89c7('0x9e')](function(){});};Dialer[_0x89c7('0x15')]['launchHandleIvr']=function(_0x23b0a2){var _0x496732=this;return function(){_0x496732[_0x89c7('0x160')](_0x23b0a2);};};Dialer[_0x89c7('0x15')]['actionOriginate']=function(_0x53b2a1,_0x5f1d37){var _0x740f69=this;var _0x28edbc=uuid['v4']();this[_0x89c7('0x1f')][_0x28edbc]=new Action(_0x53b2a1,_0x5f1d37,_0x28edbc);return new Promise(function(_0x377feb,_0x23a3de){if(_[_0x89c7('0x51')](_0x53b2a1)&&typeof _0x53b2a1!=='object'){return _0x23a3de(msgResponse(_0x89c7('0x161'),'Failure','voiceQueue\x20is\x20undefine'));}if(_[_0x89c7('0x51')](_0x5f1d37['phone'])||_0x5f1d37[_0x89c7('0x162')]===null){return _0x23a3de(msgResponse(_0x89c7('0x161'),_0x89c7('0x8f'),_0x89c7('0x163')));}var _0x876895={'XMD-CALLERID':_0x740f69[_0x89c7('0x1f')][_0x28edbc]['getCaller'](),'XMD-AGI':_0x53b2a1[_0x89c7('0x133')]?util[_0x89c7('0x3e')](_0x89c7('0x164'),ipAgi,_0x53b2a1[_0x89c7('0x133')]):_0x89c7('0x165'),'XMD-AGIAFTER':_0x53b2a1['dialQueueProject2']?util[_0x89c7('0x3e')](_0x89c7('0x164'),ipAgi,_0x53b2a1[_0x89c7('0xc7')]):'NONE','XMD-QUEUE':utils[_0x89c7('0x166')](_0x53b2a1)?util[_0x89c7('0x3e')](_0x89c7('0x167'),_0x53b2a1['name'],_0x53b2a1['dialQueueOptions']||'',_0x53b2a1[_0x89c7('0xc8')]?'c':'',_0x53b2a1['dialQueueTimeout']||0x3):_0x89c7('0x165'),'XMD-CONTACTID':_0x5f1d37[_0x89c7('0xeb')],'XMD-CDRTYPE':'dialer','CALLERID(all)':_0x740f69[_0x89c7('0x1f')][_0x28edbc][_0x89c7('0x168')](),'XMD-AMD':_0x53b2a1[_0x89c7('0x110')]?_0x89c7('0x169'):_0x89c7('0x165'),'XMD-DESTINATION':_0x89c7('0x10f')};if(_0x53b2a1[_0x89c7('0x110')]){_0x876895[_0x89c7('0x16a')]=_0x53b2a1['dialAMDInitialSilence']||0x9c4;_0x876895[_0x89c7('0x16b')]=_0x53b2a1['dialAMDGreeting']||0x5dc;_0x876895[_0x89c7('0x16c')]=_0x53b2a1[_0x89c7('0x16d')]||0x320;_0x876895[_0x89c7('0x16e')]=_0x53b2a1[_0x89c7('0x16f')]||0x1388;_0x876895[_0x89c7('0x170')]=_0x53b2a1[_0x89c7('0x171')]||0x64;_0x876895[_0x89c7('0x172')]=_0x53b2a1['dialAMDBetweenWordsSilence']||0x32;_0x876895[_0x89c7('0x173')]=_0x53b2a1[_0x89c7('0x174')]||0x3;_0x876895[_0x89c7('0x175')]=_0x53b2a1[_0x89c7('0x176')]||0x100;_0x876895[_0x89c7('0x177')]=_0x53b2a1['dialAMDMaximumWordLength']||0x1388;}if(utils[_0x89c7('0x166')](_0x53b2a1)){_0x876895['XMD-VOICEQUEUEID']=_0x5f1d37[_0x89c7('0xed')];}else{_0x876895[_0x89c7('0x178')]=_0x5f1d37[_0x89c7('0xdc')];}var _0x514e11=utils['setXMDContactVariables'](_0x5f1d37[_0x89c7('0x179')]);Object['assign'](_0x876895,_0x514e11);var _0x19c2c6=_0x740f69['isTrunkReachable'](_0x53b2a1[_0x89c7('0x8b')])?utils[_0x89c7('0x17a')](_0x53b2a1[_0x89c7('0x8b')]['callerid'],_0x53b2a1['dialOriginateCallerIdName'],_0x53b2a1[_0x89c7('0x17b')]>0x0?utils['getCallerIdRandom'](_0x53b2a1[_0x89c7('0x17c')],_0x53b2a1[_0x89c7('0x17b')]):_0x53b2a1['dialOriginateCallerIdNumber']):utils[_0x89c7('0x17a')](_[_0x89c7('0xf8')](_0x53b2a1[_0x89c7('0x17d')])?_0x53b2a1[_0x89c7('0x8b')][_0x89c7('0x17e')]:_0x53b2a1[_0x89c7('0x17d')][_0x89c7('0x17e')],_0x53b2a1['dialOriginateCallerIdName'],_0x53b2a1[_0x89c7('0x17b')]>0x0?utils[_0x89c7('0x17f')](_0x53b2a1[_0x89c7('0x17c')],_0x53b2a1[_0x89c7('0x17b')]):_0x53b2a1[_0x89c7('0x17c')]);if(_0x19c2c6){_0x876895[_0x89c7('0x180')]=_0x740f69['actions'][_0x28edbc]['originatecalleridname']=utils[_0x89c7('0x181')](_0x19c2c6);_0x876895[_0x89c7('0x182')]=_0x5f1d37[_0x89c7('0x162')];}_0x53b2a1[_0x89c7('0x183')]=_0x876895;return ami[_0x89c7('0x97')]({'actionid':_0x28edbc,'action':_0x89c7('0x161'),'channel':_0x740f69['isTrunkReachable'](_0x53b2a1[_0x89c7('0x8b')])?util['format'](_0x89c7('0x184'),_0x53b2a1[_0x89c7('0x8b')][_0x89c7('0x40')],isNotNull(_0x53b2a1[_0x89c7('0x185')])?_0x53b2a1['dialPrefix']['trim']()||'':'',_0x53b2a1[_0x89c7('0x186')]>0x0?_0x5f1d37['phone'][_0x89c7('0x187')](_0x53b2a1['dialCutDigit']):_0x5f1d37['phone']):util[_0x89c7('0x3e')]('SIP/%s/%s%s',_[_0x89c7('0xf8')](_0x53b2a1['TrunkBackup'])?_0x53b2a1[_0x89c7('0x8b')][_0x89c7('0x40')]:_0x53b2a1[_0x89c7('0x17d')][_0x89c7('0x40')],isNotNull(_0x53b2a1[_0x89c7('0x185')])?_0x53b2a1[_0x89c7('0x185')]['trim']()||'':'',_0x53b2a1[_0x89c7('0x186')]>0x0?_0x5f1d37[_0x89c7('0x162')]['substring'](_0x53b2a1[_0x89c7('0x186')]):_0x5f1d37[_0x89c7('0x162')]),'callerid':_0x19c2c6,'Exten':_0x89c7('0x10f'),'Context':_0x89c7('0x188'),'Priority':'1','variable':_0x876895,'timeout':(_0x53b2a1[_0x89c7('0x189')]||0x1e)*0x3e8,'async':!![],'channelid':_0x28edbc})[_0x89c7('0x39')](function(_0x3204cf){return _0x377feb(_0x3204cf);})[_0x89c7('0x9e')](function(_0x1c73cb){_0x53b2a1[_0x89c7('0x18a')]+=0x1;var _0xe3bcea=new History(_0x740f69['actions'][_0x28edbc]);logger['error'](util[_0x89c7('0x3e')]('[originateError]:\x20%s',JSON['stringify'](_0x1c73cb)));_0xe3bcea[_0x89c7('0xd0')]=0xe;_0xe3bcea[_0x89c7('0xe2')]=_0x89c7('0x18b');_0xe3bcea[_0x89c7('0x6e')]=moment()[_0x89c7('0x3e')](_0x89c7('0xc1'));_0xe3bcea[_0x89c7('0x6d')]=_0xe3bcea[_0x89c7('0x6e')];hopperUtils[_0x89c7('0xc9')](_0xe3bcea)[_0x89c7('0x9e')](loggerCatch(_0x89c7('0x18c')));_0x740f69['moveContactManagedDialer'](_0xe3bcea)[_0x89c7('0x9e')](loggerCatch(_0x89c7('0x18c')))[_0x89c7('0x103')](function(){delete _0x740f69[_0x89c7('0x1f')][_0x28edbc];return _0x23a3de(msgResponse('originate',_0x89c7('0xba'),_0x89c7('0x18d')));});});});};Dialer[_0x89c7('0x15')][_0x89c7('0x18e')]=function(_0x5bcbba,_0x2c5317,_0x1c67c3){var _0x580b49=new History(_0x2c5317);if(_0x580b49[_0x89c7('0x11f')]+_0x580b49['countcongestionretry']+_0x580b49[_0x89c7('0x121')]+_0x580b49[_0x89c7('0x122')]+_0x580b49['countdropretry']+_0x580b49[_0x89c7('0xe5')]+_0x580b49[_0x89c7('0x11c')]+_0x580b49[_0x89c7('0x12e')]>=_0x1c67c3['dialGlobalMaxRetry']-0x1){return!![];}switch(_0x5bcbba){case 0x3:if(_0x580b49[_0x89c7('0x121')]>=_0x1c67c3[_0x89c7('0x18f')]-0x1){return!![];}hopperUtils[_0x89c7('0xdb')]({'active':![],'countnoanswerretry':_0x580b49[_0x89c7('0x121')]+=0x1,'scheduledat':moment()['add'](_0x1c67c3['dialNoAnswerRetryFrequency'],'minutes')[_0x89c7('0x3e')](_0x89c7('0xc1')),'ContactId':_0x580b49[_0x89c7('0xeb')],'ListId':_0x580b49[_0x89c7('0xec')],'VoiceQueueId':_0x580b49[_0x89c7('0xed')]||undefined,'CampaignId':_0x580b49[_0x89c7('0xdc')]||undefined})[_0x89c7('0x9e')](loggerCatch(_0x89c7('0x190')));break;case 0x5:if(_0x580b49[_0x89c7('0x11f')]>=_0x1c67c3[_0x89c7('0x191')]-0x1){return!![];}hopperUtils[_0x89c7('0xdb')]({'active':![],'countbusyretry':_0x580b49[_0x89c7('0x11f')]+=0x1,'scheduledat':moment()['add'](_0x1c67c3['dialBusyRetryFrequency'],_0x89c7('0xea'))[_0x89c7('0x3e')](_0x89c7('0xc1')),'ContactId':_0x580b49[_0x89c7('0xeb')],'ListId':_0x580b49[_0x89c7('0xec')],'VoiceQueueId':_0x580b49[_0x89c7('0xed')]||undefined,'CampaignId':_0x580b49[_0x89c7('0xdc')]||undefined})[_0x89c7('0x9e')](loggerCatch(_0x89c7('0x192')));break;case 0x8:if(_0x580b49[_0x89c7('0x120')]>=_0x1c67c3['dialCongestionMaxRetry']-0x1){return!![];}hopperUtils[_0x89c7('0xdb')]({'active':![],'countcongestionretry':_0x580b49[_0x89c7('0x120')]+=0x1,'scheduledat':moment()[_0x89c7('0xe9')](_0x1c67c3['dialCongestionRetryFrequency'],_0x89c7('0xea'))[_0x89c7('0x3e')](_0x89c7('0xc1')),'ContactId':_0x580b49[_0x89c7('0xeb')],'ListId':_0x580b49[_0x89c7('0xec')],'VoiceQueueId':_0x580b49[_0x89c7('0xed')]||undefined,'CampaignId':_0x580b49[_0x89c7('0xdc')]||undefined})[_0x89c7('0x9e')](loggerCatch(_0x89c7('0x193')));break;case 0x0:if(_0x580b49[_0x89c7('0x122')]>=_0x1c67c3[_0x89c7('0x194')]-0x1){return!![];}else{hopperUtils[_0x89c7('0xdb')]({'active':![],'countnosuchnumberretry':_0x580b49[_0x89c7('0x122')]+=0x1,'scheduledat':moment()[_0x89c7('0xe9')](_0x1c67c3['dialNoSuchNumberRetryFrequency'],'minutes')[_0x89c7('0x3e')](_0x89c7('0xc1')),'ContactId':_0x580b49[_0x89c7('0xeb')],'ListId':_0x580b49['ListId'],'VoiceQueueId':_0x580b49[_0x89c7('0xed')]||undefined,'CampaignId':_0x580b49['CampaignId']||undefined})['catch'](loggerCatch(_0x89c7('0x195')));}break;case 0xa:if(_0x580b49[_0x89c7('0xd8')]>=_0x1c67c3[_0x89c7('0xd9')]-0x1){return!![];}hopperUtils[_0x89c7('0xdb')]({'active':![],'countdropretry':_0x580b49[_0x89c7('0xd8')]+=0x1,'scheduledat':moment()[_0x89c7('0xe9')](_0x1c67c3['dialDropRetryFrequency'],_0x89c7('0xea'))['format'](_0x89c7('0xc1')),'ContactId':_0x580b49[_0x89c7('0xeb')],'ListId':_0x580b49[_0x89c7('0xec')],'VoiceQueueId':_0x580b49[_0x89c7('0xed')]||undefined,'CampaignId':_0x580b49['CampaignId']||undefined})[_0x89c7('0x9e')](loggerCatch(_0x89c7('0xdd')));break;case 0xb:if(_0x580b49[_0x89c7('0xe5')]>=_0x1c67c3['dialAbandonedMaxRetry']-0x1){return!![];}hopperUtils[_0x89c7('0xdb')]({'active':![],'countabandonedretry':_0x580b49[_0x89c7('0xe5')]+=0x1,'scheduledat':moment()[_0x89c7('0xe9')](_0x1c67c3[_0x89c7('0xe6')],'minutes')[_0x89c7('0x3e')](_0x89c7('0xc1')),'ContactId':_0x580b49[_0x89c7('0xeb')],'ListId':_0x580b49[_0x89c7('0xec')],'VoiceQueueId':_0x580b49[_0x89c7('0xed')]||undefined,'CampaignId':_0x580b49[_0x89c7('0xdc')]||undefined})['catch'](loggerCatch('[rescheduleContact][Abandoned]'));break;case 0x13:if(_0x580b49[_0x89c7('0x11c')]>=_0x1c67c3[_0x89c7('0x12f')]-0x1){return!![];}hopperUtils[_0x89c7('0xdb')]({'active':![],'countmachineretry':_0x580b49[_0x89c7('0x11c')]+=0x1,'scheduledat':moment()['add'](_0x1c67c3[_0x89c7('0x128')],'minutes')[_0x89c7('0x3e')]('YYYY-MM-DD\x20HH:mm:ss'),'ContactId':_0x580b49['ContactId'],'ListId':_0x580b49[_0x89c7('0xec')],'VoiceQueueId':_0x580b49['VoiceQueueId']||undefined,'CampaignId':_0x580b49[_0x89c7('0xdc')]||undefined})[_0x89c7('0x9e')](loggerCatch(_0x89c7('0x129')));break;case 0x14:if(_0x580b49['countagentrejectretry']>=_0x1c67c3['dialAgentRejectMaxRetry']-0x1){return!![];}hopperUtils[_0x89c7('0xdb')]({'active':![],'countagentrejectretry':_0x580b49[_0x89c7('0x12e')]+=0x1,'scheduledat':moment()[_0x89c7('0xe9')](_0x1c67c3[_0x89c7('0x196')],_0x89c7('0xea'))[_0x89c7('0x3e')](_0x89c7('0xc1')),'ContactId':_0x580b49[_0x89c7('0xeb')],'ListId':_0x580b49['ListId'],'VoiceQueueId':_0x580b49[_0x89c7('0xed')]||undefined,'CampaignId':_0x580b49['CampaignId']||undefined})['catch'](loggerCatch('[rescheduleContact][AgentReject]'));break;default:return!![];}};Dialer[_0x89c7('0x15')][_0x89c7('0x197')]=function(_0x523deb,_0x378b35,_0xe4f508){var _0x649fe8=this;var _0xcd626=new History(_0x523deb);var _0x1399e7=![];var _0xe47043;var _0x326d1e;return new Promise(function(_0x526bfc,_0x55b4cc){if(_[_0x89c7('0x51')](_0x378b35)&&typeof _0x378b35!==_0x89c7('0x198')){return _0x55b4cc(msgResponse(_0x89c7('0x199'),_0x89c7('0x8f'),_0x89c7('0x19a')));}if(_[_0x89c7('0x51')](_0xe4f508)&&typeof _0xe4f508!==_0x89c7('0x198')){return _0x55b4cc(msgResponse('[callProgressDetecting]',_0x89c7('0x8f'),_0x89c7('0x19b')));}hopperUtils[_0x89c7('0xd5')](_0xcd626,_0xe4f508['reason'],_0x378b35)[_0x89c7('0x39')](function(_0x206294){if(_0x206294[_0x89c7('0xd7')]==0x1)_0x1399e7=!![];switch(_0xe4f508[_0x89c7('0xc4')]){case'0':_0x378b35['outboundNoSuchCallsDay']+=0x1;_0xcd626['state']=0x0;_0xcd626[_0x89c7('0xe2')]=_0x89c7('0x19c');_0xcd626['countnosuchnumberretry']+=0x1;_0xcd626[_0x89c7('0xd3')]+=0x1;ami[_0x89c7('0x115')](_0x89c7('0x19d'),ut[_0x89c7('0x117')](_0x523deb,_0x89c7('0x19e')));_0xe47043=_0x378b35[_0x89c7('0x19f')];_0x326d1e=_0x378b35['callAdditionalPhoneAfterMin'];hopperUtils[_0x89c7('0xc9')](_0xcd626)[_0x89c7('0x9e')](loggerCatch(_0x89c7('0x11e')));if(_0x649fe8[_0x89c7('0x18e')](0x0,_0x523deb,_0x378b35)&&!_0x1399e7){if(_0xcd626[_0x89c7('0x122')]>=_0x378b35[_0x89c7('0x194')]){_0x649fe8[_0x89c7('0x126')](_0xcd626,_0x526bfc,_0x55b4cc,_0x89c7('0x1a0'));}else{_0x649fe8['stateGlobal'](_0xcd626,_0x526bfc,_0x55b4cc,_0x89c7('0x1a0'));}}break;case'3':_0x378b35[_0x89c7('0x1a1')]+=0x1;_0xcd626[_0x89c7('0xd0')]=0x3;_0xcd626[_0x89c7('0xe2')]=_0x89c7('0x1a2');_0xcd626['countnoanswerretry']+=0x1;_0xcd626[_0x89c7('0xd3')]+=0x1;var _0x1c85fc=ut[_0x89c7('0x1a3')](_0x523deb,_0x378b35);ami[_0x89c7('0x115')]('custom:agentnoanswer',_0x1c85fc);_0xe47043=_0x378b35[_0x89c7('0x1a4')];_0x326d1e=_0x378b35['callAdditionalPhoneAfterMin'];hopperUtils['createHistory'](_0xcd626)[_0x89c7('0x9e')](loggerCatch(_0x89c7('0x1a5')));if(_0x649fe8['checkRetriveMax'](0x3,_0x523deb,_0x378b35)&&!_0x1399e7){if(_0xcd626[_0x89c7('0x121')]>=_0x378b35['dialNoAnswerMaxRetry']){_0x649fe8[_0x89c7('0x126')](_0xcd626,_0x526bfc,_0x55b4cc,'reason\x203\x20ringing\x20no\x20answer');}else{_0x649fe8[_0x89c7('0x124')](_0xcd626,_0x526bfc,_0x55b4cc,_0x89c7('0x1a6'));}}break;case'5':_0x378b35[_0x89c7('0x1a7')]+=0x1;_0xcd626[_0x89c7('0xd0')]=0x5;_0xcd626[_0x89c7('0xe2')]=_0x89c7('0x1a8');_0xcd626[_0x89c7('0x11f')]+=0x1;_0xcd626[_0x89c7('0xd3')]+=0x1;ami[_0x89c7('0x115')](_0x89c7('0x1a9'),ut['buildObj'](_0x523deb,'busy'));_0xe47043=_0x378b35[_0x89c7('0x1aa')];_0x326d1e=_0x378b35[_0x89c7('0xe7')];hopperUtils['createHistory'](_0xcd626)[_0x89c7('0x9e')](loggerCatch('[syncAgentComplete][createHistory][5]'));if(_0x649fe8[_0x89c7('0x18e')](0x5,_0x523deb,_0x378b35)&&!_0x1399e7){if(_0xcd626[_0x89c7('0x11f')]>=_0x378b35['dialBusyMaxRetry']){_0x649fe8[_0x89c7('0x126')](_0xcd626,_0x526bfc,_0x55b4cc,_0x89c7('0x1ab'));}else{_0x649fe8[_0x89c7('0x124')](_0xcd626,_0x526bfc,_0x55b4cc,_0x89c7('0x1ab'));}}break;case'8':_0x378b35['outboundCongestionCallsDay']+=0x1;_0xcd626[_0x89c7('0xd0')]=0x8;_0xcd626[_0x89c7('0xe2')]=_0x89c7('0x1ac');_0xcd626[_0x89c7('0x120')]+=0x1;_0xcd626[_0x89c7('0xd3')]+=0x1;_0xe47043=_0x378b35[_0x89c7('0x1ad')];_0x326d1e=_0x378b35[_0x89c7('0xe7')];ami['emit']('custom:agentcongestion',ut[_0x89c7('0x117')](_0x523deb,_0x89c7('0x1ae')));hopperUtils[_0x89c7('0xc9')](_0xcd626)['catch'](loggerCatch(_0x89c7('0x1af')));if(_0x649fe8[_0x89c7('0x18e')](0x8,_0x523deb,_0x378b35)&&!_0x1399e7){if(_0xcd626['countcongestionretry']>=_0x378b35[_0x89c7('0x1b0')]){_0x649fe8[_0x89c7('0x126')](_0xcd626,_0x526bfc,_0x55b4cc,_0x89c7('0x1b1'));}else{_0x649fe8[_0x89c7('0x124')](_0xcd626,_0x526bfc,_0x55b4cc,_0x89c7('0x1b1'));}}break;case'11':_0x378b35[_0x89c7('0x1b2')]+=0x1;_0xcd626[_0x89c7('0xd0')]=0xb;_0xcd626[_0x89c7('0xe2')]=_0x89c7('0xe3');_0xcd626[_0x89c7('0xe5')]+=0x1;_0xcd626[_0x89c7('0xd3')]+=0x1;_0xe47043=_0x378b35[_0x89c7('0xe6')];_0x326d1e=_0x378b35[_0x89c7('0xe7')];hopperUtils[_0x89c7('0xc9')](_0xcd626)['catch'](loggerCatch('[syncAgentComplete][createHistory][11]'));if(_0x649fe8[_0x89c7('0x18e')](0xb,_0x523deb,_0x378b35)&&!_0x1399e7){if(_0xcd626[_0x89c7('0xe5')]>=_0x378b35[_0x89c7('0xe8')]){_0x649fe8[_0x89c7('0x126')](_0xcd626,_0x526bfc,_0x55b4cc,_0x89c7('0x1b3'));}else{_0x649fe8['stateGlobal'](_0xcd626,_0x526bfc,_0x55b4cc,_0x89c7('0x1b3'));}}break;case'20':_0x378b35['outboundRejectCallsDay']+=0x1;_0xcd626[_0x89c7('0xd0')]=0x14;_0xcd626[_0x89c7('0xe2')]=_0x89c7('0x1b4');_0xcd626[_0x89c7('0x12e')]+=0x1;_0xcd626[_0x89c7('0xd3')]+=0x1;_0xe47043=_0x378b35[_0x89c7('0x196')];_0x326d1e=_0x378b35['callAdditionalPhoneAfterMin'];ami[_0x89c7('0x115')](_0x89c7('0x1b5'),ut[_0x89c7('0x117')](_0x523deb,_0x89c7('0x1b6')));hopperUtils[_0x89c7('0xc9')](_0xcd626)[_0x89c7('0x9e')](loggerCatch('[syncAgentComplete][createHistory][20]'));if(_0x649fe8[_0x89c7('0x18e')](0x14,_0x523deb,_0x378b35)&&!_0x1399e7){if(_0xcd626['countagentrejectretry']>=_0x378b35['dialAgentRejectMaxRetry']){_0x649fe8[_0x89c7('0x126')](_0xcd626,_0x526bfc,_0x55b4cc,_0x89c7('0x1b7'));}else{_0x649fe8[_0x89c7('0x124')](_0xcd626,_0x526bfc,_0x55b4cc,'reason\x2020\x20agentreject');}}break;default:_0x378b35[_0x89c7('0x136')]+=0x1;_0xcd626[_0x89c7('0xd0')]=0xc;_0xcd626['statedesc']=_0xe4f508['reason'];_0xe47043=_0x378b35['dialAgentRejectRetryFrequency'];_0x326d1e=_0x378b35[_0x89c7('0xe7')];hopperUtils['createHistory'](_0xcd626)['catch'](loggerCatch(_0x89c7('0x1b8')));if(_0x649fe8[_0x89c7('0x18e')](_0xe4f508['reason'],_0x523deb,_0x378b35)&&!_0x1399e7){if(_0xcd626['countbusyretry']+_0xcd626['countcongestionretry']+_0xcd626[_0x89c7('0x121')]+_0xcd626[_0x89c7('0x122')]+_0xcd626['countdropretry']+_0xcd626['countabandonedretry']+_0xcd626['countmachineretry']+_0xcd626['countagentrejectretry']>=_0x378b35['dialGlobalMaxRetry']){_0x649fe8[_0x89c7('0x124')](_0xcd626,_0x526bfc,_0x55b4cc,_0xe4f508[_0x89c7('0xc4')]);}else{_0x649fe8[_0x89c7('0x126')](_0xcd626,_0x526bfc,_0x55b4cc,_0xe4f508['reason']);}}}})['then'](function(){if(_0x1399e7){hopperUtils[_0x89c7('0xe1')](_0xcd626,_0xe47043,_0x326d1e)[_0x89c7('0x39')](function(){return _0x526bfc(0x1);});}});});};Dialer[_0x89c7('0x15')]['stateGlobal']=function(_0x423939,_0x40b314,_0x4d3b8d,_0xb20c55){var _0x2086a9=new Final(_0x423939);_0x2086a9[_0x89c7('0xd0')]=0xf;_0x2086a9['statedesc']=_0x89c7('0x1b9');this['createStateFinal'](_0x2086a9,_0x40b314,_0x4d3b8d,_0xb20c55);};Dialer[_0x89c7('0x15')][_0x89c7('0x126')]=function(_0x360fef,_0x1d57a5,_0x4c5d7d,_0x4f26d2){hopperUtils['moveContactManagedDialer'](_0x360fef)['then'](function(){return _0x1d57a5(msgResponse('[callProgressDetecting]',_0x89c7('0x10c'),_0x4f26d2));})['catch'](function(){return _0x4c5d7d(msgResponse(_0x89c7('0x1ba'),_0x89c7('0x8f'),_0x89c7('0x1bb')));});};Dialer[_0x89c7('0x15')]['predictive']=function(_0x58062c){var _0x3dfa8e=_0x58062c['dialPredictiveOptimizationPercentage']/0x64;var _0x2eaa85=_0x58062c[_0x89c7('0xce')]/(_0x58062c[_0x89c7('0xce')]+_0x58062c[_0x89c7('0xc3')]);var _0x4598e6=Math[_0x89c7('0x1bc')](_0x58062c['predictiveIntervalAvailable']*(_0x58062c['predictiveIntervalMaxThreshold']/0x64));var _0x34c974=Math['round'](_0x58062c['predictiveIntervalAvailable']*(_0x58062c[_0x89c7('0x1bd')]/0x64));var _0x57945d=_0x58062c['available']+_0x58062c[_0x89c7('0x13d')];var _0x50feed=Math[_0x89c7('0x1be')](_0x58062c[_0x89c7('0x56')]*_0x58062c[_0x89c7('0x5a')]*_0x58062c[_0x89c7('0x1bf')]*_0x58062c[_0x89c7('0x1c0')]);if(_[_0x89c7('0x51')](_0x58062c['startProgressive'])){if(!_[_0x89c7('0x51')](_0x58062c[_0x89c7('0x23')])){_0x58062c[_0x89c7('0x23')]=undefined;loggerPredictive[_0x89c7('0x63')](_0x89c7('0x1c1'),'check\x20predictive\x20is\x20not\x20undefine');}if(!_[_0x89c7('0x51')](_0x58062c[_0x89c7('0x61')])){loggerPredictive[_0x89c7('0x63')](_0x89c7('0x1c1'),_0x89c7('0x1c2'));clearInterval(_0x58062c[_0x89c7('0x61')]);_0x58062c[_0x89c7('0x61')]=undefined;}_0x58062c['startProgressive']=moment()[_0x89c7('0x3e')]('YYYY-MM-DD\x20HH:mm:ss');loggerPredictive['info'](_0x58062c[_0x89c7('0x40')],'collection\x20data\x20in\x20progressive\x20at',_0x58062c[_0x89c7('0x24')]);this['handlePower'](_0x58062c,0x1);}else if(ifInterval(_0x58062c[_0x89c7('0x1c3')],_0x58062c['startProgressive'])){this['handlePower'](_0x58062c,0x1);loggerPredictiveCalls['info']('[startMethodPredictive][StartProgressive][Loop]',_0x58062c['startProgressive'],_0x58062c['name']);_0x58062c[_0x89c7('0x56')]=0x0;_0x58062c['predictiveIntervalErlangCallsDroppedCalls']=0x0;}else if(_0x3dfa8e<_0x2eaa85&&_0x58062c[_0x89c7('0x1c4')]==='dropRate'){clearPredictiveAttributes(_0x58062c);loggerPredictive[_0x89c7('0x42')](_0x89c7('0x1c5'),_0x89c7('0x1c6'),_0x2eaa85,_0x89c7('0x24'),_0x58062c[_0x89c7('0x40')]);}else if(_0x50feed<_0x58062c[_0x89c7('0xcf')]&&_0x58062c['dialPredictiveOptimization']===_0x89c7('0x1c7')){clearPredictiveAttributes(_0x58062c);loggerPredictive[_0x89c7('0x42')](_0x89c7('0x1c8'),_0x89c7('0x1c9'),_0x50feed,_0x89c7('0x1ca'),_0x58062c[_0x89c7('0xcf')],_0x89c7('0x24'),_0x58062c['name']);}else if(!ifInterval(_0x58062c['dialPredictiveInterval'],_0x58062c[_0x89c7('0x24')])&&_[_0x89c7('0x51')](_0x58062c[_0x89c7('0x23')])&&!_['isUndefined'](_0x58062c[_0x89c7('0x24')])){_0x58062c[_0x89c7('0x23')]=moment()[_0x89c7('0x3e')](_0x89c7('0xc1'));loggerPredictive[_0x89c7('0x42')](_0x58062c['name'],_0x89c7('0x1cb'),_0x58062c[_0x89c7('0x23')]);hopperUtils[_0x89c7('0x1cc')](_0x58062c[_0x89c7('0x1c3')])[_0x89c7('0x39')](this[_0x89c7('0x1cd')](_0x58062c))[_0x89c7('0x39')](mergeDataErlangB(_0x58062c))['then'](this[_0x89c7('0x1ce')](_0x58062c))['catch'](loggerCatchPredictive(_0x89c7('0x1cf'),_0x58062c));}else if(!ifInterval(_0x58062c[_0x89c7('0x1c3')],_0x58062c[_0x89c7('0x23')])){_0x58062c[_0x89c7('0xcf')]=0x0;_0x58062c[_0x89c7('0x23')]=moment()[_0x89c7('0x3e')](_0x89c7('0xc1'));loggerPredictive[_0x89c7('0x42')](_0x58062c['name'],_0x89c7('0x1d0'),_0x58062c[_0x89c7('0x23')]);clearInterval(_0x58062c['handlePredictive']);_0x58062c[_0x89c7('0x61')]=undefined;hopperUtils[_0x89c7('0x1cc')](_0x58062c[_0x89c7('0x1c3')])[_0x89c7('0x39')](this[_0x89c7('0x1cd')](_0x58062c))[_0x89c7('0x39')](mergeDataErlangB(_0x58062c))[_0x89c7('0x39')](this[_0x89c7('0x1ce')](_0x58062c))['catch'](loggerCatchPredictive('Predictive\x20for\x20every\x20interval',_0x58062c));}else if(_0x58062c[_0x89c7('0x1d1')]&&_0x57945d<_0x58062c[_0x89c7('0x1d1')]-_0x34c974){clearPredictiveAttributes(_0x58062c);loggerPredictive[_0x89c7('0x42')](_0x58062c[_0x89c7('0x40')],'switch\x20in\x20progressive\x20because\x20available\x20agents\x20(',_0x57945d,')\x20are\x20less\x20than\x20threshold\x20(',_0x58062c[_0x89c7('0x1d1')],'-',_0x34c974,'=',_0x58062c[_0x89c7('0x1d1')]-_0x34c974,')');}else if(_0x58062c[_0x89c7('0x1d1')]&&_0x57945d>_0x58062c[_0x89c7('0x1d1')]+_0x4598e6){clearPredictiveAttributes(_0x58062c);loggerPredictive[_0x89c7('0x42')](_0x58062c[_0x89c7('0x40')],'switch\x20in\x20progressive\x20because\x20available\x20agents\x20(',_0x57945d,_0x89c7('0x1d2'),_0x58062c[_0x89c7('0x1d1')],'+',_0x4598e6,'=',_0x58062c[_0x89c7('0x1d1')]+_0x4598e6,')');}};Dialer[_0x89c7('0x15')][_0x89c7('0x1cd')]=function(_0x5e9cbe){var _0xc68f22=this;return function(_0x184b62){return new Promise(function(_0x181141,_0x47603d){_[_0x89c7('0x5d')](_0x5e9cbe,_0x184b62[0x0]);if(checkGetDataPredictive(_0x184b62[0x0])){var _0x17a40c=_0x5e9cbe['predictiveIntervalAvailable']=_0x5e9cbe[_0x89c7('0x13d')]+_0x5e9cbe[_0x89c7('0x13b')];var _0x33976c=_0x5e9cbe[_0x89c7('0x1c3')]*0x3c;var _0x1fa7a6=_0x184b62[0x0][_0x89c7('0x4e')]+_0x184b62[0x0]['predictiveIntervalAvgHoldtime'];var _0x2a89d9=(_0x184b62[0x0][_0x89c7('0x46')]+_0x184b62[0x0][_0x89c7('0x48')]+_0x184b62[0x0][_0x89c7('0x4a')])/_0x184b62[0x0]['predictiveIntervalTotalCalls'];_0x5e9cbe[_0x89c7('0x1bf')]=_0x2a89d9>0x0?_0x2a89d9:0x1;switch(_0x5e9cbe[_0x89c7('0x1c4')]){case'dropRate':var _0x2e42cc=_0x5e9cbe[_0x89c7('0x1d3')]/0x64;return _0xc68f22['abandonmentRate'](_0x17a40c,_0x33976c,_0x1fa7a6,_0x2a89d9,_0x2e42cc)[_0x89c7('0x39')](function(_0x4ac7bd){return _0x181141(_0x4ac7bd);});case _0x89c7('0x1d4'):var _0x4b9ee2=_0x5e9cbe[_0x89c7('0x1d3')]/0x64;return _0xc68f22[_0x89c7('0x1d5')](_0x17a40c,_0x33976c,_0x1fa7a6,_0x2a89d9,_0x4b9ee2)[_0x89c7('0x39')](function(_0x5b591a){return _0x181141(_0x5b591a);});default:return _0x47603d(msgResponse('[getDataPredictive]',_0x89c7('0x8f'),'Unknown\x20Predictive'));}}else{return _0x47603d(msgResponse(_0x89c7('0x1d6'),'Failure',_0x89c7('0x1d7')));}});};};Dialer[_0x89c7('0x15')][_0x89c7('0x1d8')]=function(_0x3a40d4){var _0x45ec86=this;return function(_0x5865e5){return new Promise(function(_0x2a8e09,_0x48faf6){_[_0x89c7('0x5d')](_0x3a40d4,_0x5865e5[0x0]);if(checkGetDataPredictive(_0x5865e5[0x0])){loggerPredictive['info'](JSON[_0x89c7('0x72')](_0x5865e5[0x0]));if(_0x3a40d4[_0x89c7('0x1c4')]==='dropRate'){return _0x45ec86['getVoiceQueueRtPauses'](_0x3a40d4['id'])[_0x89c7('0x39')](function(_0x486192){var _0xb16075=_0x3a40d4[_0x89c7('0x1d9')]-_0x486192[0x0]['outboundQueuePauses'];var _0x354281=_0x3a40d4[_0x89c7('0x1c3')]*0x3c;var _0x15ecfa=_0x5865e5[0x0][_0x89c7('0x4e')]+_0x5865e5[0x0][_0x89c7('0x4c')];var _0xf5e270=(_0x5865e5[0x0]['predictiveIntervalAnsweredCalls']+_0x5865e5[0x0][_0x89c7('0x48')]+_0x5865e5[0x0][_0x89c7('0x4a')])/_0x5865e5[0x0][_0x89c7('0x44')];var _0x34580b=_0x3a40d4[_0x89c7('0x1d3')]/0x64;_0x3a40d4[_0x89c7('0x1da')]=_0x486192[0x0][_0x89c7('0x1db')]||0x0;_0x3a40d4['predictiveIntervalHitRate']=_0xf5e270>0x0?_0xf5e270:0x1;return _0x45ec86[_0x89c7('0x1dc')](_0xb16075,_0x354281,_0x15ecfa,_0xf5e270,_0x34580b);})[_0x89c7('0x39')](function(_0x2e94fd){return _0x2a8e09(_0x2e94fd);})[_0x89c7('0x9e')](function(_0x270526){return _0x48faf6(msgResponse('[CatchErlangB]',_0x89c7('0x8f'),JSON[_0x89c7('0x72')](_0x270526)));});}if(_0x3a40d4['dialPredictiveOptimization']===_0x89c7('0x1d4')){return _0x45ec86[_0x89c7('0x156')](_0x3a40d4['id'])[_0x89c7('0x39')](function(_0x198617){var _0x38663e=_0x3a40d4['loggedIn']-_0x198617[0x0][_0x89c7('0x1db')];var _0x7959bf=_0x3a40d4[_0x89c7('0x1c3')]*0x3c;var _0x44aed5=_0x5865e5[0x0]['predictiveIntervalAvgTalktime']+_0x5865e5[0x0][_0x89c7('0x4c')];var _0x429b4a=(_0x5865e5[0x0][_0x89c7('0x46')]+_0x5865e5[0x0][_0x89c7('0x48')]+_0x5865e5[0x0][_0x89c7('0x4a')])/_0x5865e5[0x0][_0x89c7('0x44')];var _0x499595=_0x3a40d4['dialPredictiveOptimizationPercentage']/0x64;_0x3a40d4[_0x89c7('0x1da')]=_0x198617[0x0][_0x89c7('0x1db')]||0x0;_0x3a40d4[_0x89c7('0x1bf')]=_0x429b4a>0x0?_0x429b4a:0x1;return _0x45ec86[_0x89c7('0x1d5')](_0x38663e,_0x7959bf,_0x44aed5,_0x429b4a,_0x499595);})[_0x89c7('0x39')](function(_0x33ca37){return _0x2a8e09(_0x33ca37);})['catch'](function(_0x1183be){return _0x48faf6(msgResponse(_0x89c7('0x1dd'),_0x89c7('0x8f'),JSON['stringify'](_0x1183be)));});}}else{return _0x48faf6(msgResponse(_0x89c7('0x1d6'),_0x89c7('0x8f'),_0x89c7('0x1d7')));}});};};Dialer['prototype'][_0x89c7('0x1ce')]=function(_0x545761){var _0x2bd2e1=this;return function(){var _0x163787=0x0;var _0x36f7d1=Math[_0x89c7('0x1be')](_0x545761['erlangCallToSecond']*0x3e8);if(_0x36f7d1>0x0){_0x36f7d1=_0x36f7d1<0x64?0x64:_0x36f7d1;loggerPredictive['info'](_0x545761[_0x89c7('0x40')],_0x89c7('0x1de'),_0x36f7d1,_0x89c7('0x1df'));_0x545761[_0x89c7('0x61')]=setInterval(function(){_0x2bd2e1[_0x89c7('0x61')](_0x545761);loggerPredictiveCalls[_0x89c7('0x42')](_0x89c7('0x1e0'),_0x163787+=0x1);},_0x36f7d1);}else{loggerPredictive[_0x89c7('0x42')](_0x545761[_0x89c7('0x40')],_0x89c7('0x1e1'));}};};Dialer['prototype']['checkContactBlack']=function(_0x40d07d,_0x1e2b9c){var _0x592d03=this;return function(_0x2d5d2f){if(_[_0x89c7('0x78')](_0x2d5d2f)){if(_['isNil'](_0x1e2b9c[_0x89c7('0x15c')])||!_0x1e2b9c[_0x89c7('0x1e2')]){if(_0x40d07d[_0x89c7('0xae')]===_0x89c7('0x8')){_0x40d07d[_0x89c7('0x70')]=_['isUndefined'](_0x40d07d[_0x89c7('0x70')])?!![]:_0x40d07d[_0x89c7('0x70')];var _0x1a2b4e=uuid['v4']();_0x592d03[_0x89c7('0x1f')][_0x1a2b4e]=new Action(_0x40d07d,_0x1e2b9c,_0x1a2b4e);loggerBooked['info']('[booked][checkContactBlack]',_0x1a2b4e,'queueStatusComplete:\x20',JSON[_0x89c7('0x72')](_0x40d07d[_0x89c7('0x70')]),'Queue:\x20',_0x40d07d['name']);if(_0x40d07d[_0x89c7('0x70')]){_0x40d07d[_0x89c7('0x70')]=![];_0x592d03[_0x89c7('0x26')][_0x592d03[_0x89c7('0x1f')][_0x1a2b4e]['queue']]=[];ami[_0x89c7('0x97')]({'actionid':_0x1a2b4e,'action':'queuestatus','queue':_0x40d07d[_0x89c7('0x40')]})[_0x89c7('0x9e')](function(){_0x592d03[_0x89c7('0xbf')](_0x40d07d);hopperUtils[_0x89c7('0xdb')]({'active':![],'ContactId':_0x592d03['actions'][_0x1a2b4e]['ContactId'],'ListId':_0x592d03[_0x89c7('0x1f')][_0x1a2b4e][_0x89c7('0xec')],'VoiceQueueId':_0x592d03['actions'][_0x1a2b4e]['VoiceQueueId']||undefined,'CampaignId':_0x592d03[_0x89c7('0x1f')][_0x1a2b4e][_0x89c7('0xdc')]||undefined})[_0x89c7('0x9e')](loggerCatch(_0x89c7('0x1e3')));delete _0x592d03['actions'][_0x1a2b4e];});}else{loggerBooked[_0x89c7('0x42')](_0x89c7('0x1e4'),JSON[_0x89c7('0x72')](_0x40d07d[_0x89c7('0x70')]),'Queue:\x20',_0x40d07d['name']);_0x592d03[_0x89c7('0xbf')](_0x40d07d);hopperUtils[_0x89c7('0xdb')]({'active':![],'ContactId':_0x592d03[_0x89c7('0x1f')][_0x1a2b4e][_0x89c7('0xeb')],'ListId':_0x592d03[_0x89c7('0x1f')][_0x1a2b4e][_0x89c7('0xec')],'VoiceQueueId':_0x592d03[_0x89c7('0x1f')][_0x1a2b4e][_0x89c7('0xed')]||undefined,'CampaignId':_0x592d03[_0x89c7('0x1f')][_0x1a2b4e]['CampaignId']||undefined})[_0x89c7('0x9e')](loggerCatch(_0x89c7('0x1e3')));delete _0x592d03[_0x89c7('0x1f')][_0x1a2b4e];}}else{return _0x592d03[_0x89c7('0x1e5')](_0x40d07d,_0x1e2b9c);}}else{if(utils[_0x89c7('0x5e')](undefined,_0x1e2b9c[_0x89c7('0x1e6')])<_0x40d07d[_0x89c7('0x1e7')]*0x3c){if(_0x1e2b9c['Agent']&&!_0x1e2b9c[_0x89c7('0x14b')][_0x89c7('0x1e8')]){_0x592d03[_0x89c7('0x19')]['run'](_0x1e2b9c['id'])[_0x89c7('0x103')](function(){_0x592d03[_0x89c7('0xbf')](_0x40d07d);});}else{hopperUtils[_0x89c7('0x1e9')]({'active':![]},_0x1e2b9c['id'],0x1)['finally'](function(){_0x592d03[_0x89c7('0xbf')](_0x40d07d);});}}else{_0x40d07d['outboundReCallsDay']+=0x1;_0x592d03[_0x89c7('0xbf')](_0x40d07d);if(_0x40d07d['dialRecallInQueue']){hopperUtils[_0x89c7('0xdb')]({'active':![],'recallme':![],'UserId':null,'ContactId':_0x1e2b9c[_0x89c7('0xeb')],'ListId':_0x1e2b9c['ListId'],'VoiceQueueId':_0x1e2b9c[_0x89c7('0xed')]||undefined,'CampaignId':_0x1e2b9c[_0x89c7('0xdc')]||undefined})['catch'](loggerCatch(_0x89c7('0x1ea')));hopperUtils[_0x89c7('0xc9')](createObjHistory(_0x40d07d,_0x1e2b9c,utils[_0x89c7('0x69')][_0x89c7('0x1eb')],0x17,_0x89c7('0x1ec')))[_0x89c7('0x9e')](loggerCatch(_0x89c7('0x1ed')));}else{_0x592d03[_0x89c7('0x118')](createObjHistory(_0x40d07d,_0x1e2b9c,utils[_0x89c7('0x69')][_0x89c7('0x1ee')],0x16,'RecallFailedTimeout'),_0x89c7('0x1ef'),_0x89c7('0x1f0'));}}}}else{_0x40d07d['outboundBlacklistCallsDay']+=0x1;_0x592d03[_0x89c7('0x118')](createObjHistory(_0x40d07d,_0x1e2b9c,utils[_0x89c7('0x69')][_0x89c7('0x1f1')],0xd,_0x89c7('0x1f2')),_0x89c7('0x1f3'),_0x89c7('0x1f4'));throw _0x89c7('0x1f5');}};};Dialer[_0x89c7('0x15')][_0x89c7('0x160')]=function(_0x20616c){var _0x2053cb=this;var _0xd32d7b=_0x20616c[_0x89c7('0x1f6')]-_0x20616c[_0x89c7('0x7f')];emitCampaignSummary(_0x20616c);if(_0xd32d7b>0x0&&_0x20616c['temp']==0x0){if(_0xd32d7b>this[_0x89c7('0x1e')]){_0xd32d7b=this[_0x89c7('0x1e')];}_0x20616c['temp']=0x1;hopperUtils[_0x89c7('0x1f7')](_0x20616c,_0xd32d7b)[_0x89c7('0x39')](function(_0x47a375){_0x20616c['temp']=0x0;if(_0x47a375){if(!utils[_0x89c7('0x1f8')](_0x47a375)){_0x20616c[_0x89c7('0x68')]=utils[_0x89c7('0x69')][_0x89c7('0x6c')];logger[_0x89c7('0x42')](_0x89c7('0x1f9')+_0x20616c[_0x89c7('0x40')]);}else{_0x20616c[_0x89c7('0x7f')]+=_0x47a375['length'];_0x20616c['message']=utils[_0x89c7('0x69')]['RUNNING'];for(var _0x78cf84=0x0;_0x78cf84<_0x47a375['length'];_0x78cf84+=0x1){_0x20616c[_0x89c7('0x1fa')]+=0x1;if(_[_0x89c7('0xf8')](_0x47a375[_0x78cf84])||_[_0x89c7('0xf8')](_0x47a375[_0x78cf84]['Contact'])||_[_0x89c7('0xf8')](_0x47a375[_0x78cf84][_0x89c7('0x162')])){_0x2053cb[_0x89c7('0x15b')](_0x89c7('0x1fb'),_0x20616c,_0x47a375[_0x78cf84]);}else{hopperUtils[_0x89c7('0x1fc')](_[_0x89c7('0x73')](_0x47a375[_0x78cf84],[_0x89c7('0xdc'),_0x89c7('0x162')]))[_0x89c7('0x39')](_0x2053cb[_0x89c7('0x1fd')](_0x20616c,_0x47a375[_0x78cf84]))[_0x89c7('0x9e')](_0x2053cb[_0x89c7('0x15a')]('[actionOriginateIvr]\x20',_0x20616c));}}}}})['catch'](loggerGetContactDialer(_0x89c7('0x1fe'),_0x20616c,_0xd32d7b));}};Dialer['prototype'][_0x89c7('0xb0')]=function(_0x7ede90,_0x310325){var _0x1408bc=this;var _0x4c9688=[];if(_0x310325<0x1||_0x7ede90[_0x89c7('0xae')]==='booked'){_0x310325=0x1;}var _0x2b0ece=Math['floor'](_0x7ede90[_0x89c7('0x13b')]*_0x310325)-_0x7ede90[_0x89c7('0x7f')];if(_0x7ede90[_0x89c7('0x1ff')]>0x0){var _0x56f538=_0x7ede90[_0x89c7('0x1ff')]-_0x7ede90['originated']-_0x7ede90[_0x89c7('0x13d')]-_0x7ede90['pTalking'];if(_0x2b0ece>_0x56f538){_0x2b0ece=_0x56f538;}}if(_0x2b0ece>0x0&&_0x7ede90[_0x89c7('0x65')]==0x0){if(_0x7ede90['dialMethod']===_0x89c7('0x8')){_0x2b0ece=0x1;}if(_0x2b0ece>this[_0x89c7('0x1e')]){_0x2b0ece=this[_0x89c7('0x1e')];}for(var _0x24b2bd in this[_0x89c7('0x1c')]){if(typeof this[_0x89c7('0x1c')][_0x24b2bd]!==_0x89c7('0x152')){if(this[_0x89c7('0x1c')][_0x24b2bd][_0x89c7('0xd0')]==='not_inuse'&&this[_0x89c7('0x1c')][_0x24b2bd][_0x89c7('0x87')]==='reachable'){_0x4c9688['push'](this['agents'][_0x24b2bd]['id']);}}}_0x7ede90[_0x89c7('0x65')]=0x1;hopperUtils[_0x89c7('0x200')](_0x7ede90,_0x4c9688,_0x2b0ece)[_0x89c7('0x39')](function(_0x39d79c){_0x7ede90[_0x89c7('0x65')]=0x0;if(_0x39d79c){if(!utils['checkContactEmpty'](_0x39d79c)){hopperUtils[_0x89c7('0x201')](_0x7ede90)['then'](sendMessageReschedule(_0x7ede90))[_0x89c7('0x9e')](loggerCatch(_0x89c7('0x202')));}else{_0x7ede90['originated']+=_0x39d79c[_0x89c7('0x148')];_0x7ede90[_0x89c7('0x68')]=_0x7ede90[_0x89c7('0xae')]==='booked'?utils[_0x89c7('0x69')]['ACTIVE']:utils['CAMPAIGN_STATUS'][_0x89c7('0x203')];for(var _0x1e251a=0x0;_0x1e251a<_0x39d79c[_0x89c7('0x148')];_0x1e251a+=0x1){if(_[_0x89c7('0xf8')](_0x39d79c[_0x1e251a])||_[_0x89c7('0xf8')](_0x39d79c[_0x1e251a][_0x89c7('0x179')])||_[_0x89c7('0xf8')](_0x39d79c[_0x1e251a][_0x89c7('0x162')])){_0x1408bc[_0x89c7('0x15b')](_0x89c7('0x1fb'),_0x7ede90,_0x39d79c[_0x1e251a]);}else{hopperUtils[_0x89c7('0x204')](_[_0x89c7('0x73')](_0x39d79c[_0x1e251a],['VoiceQueueId',_0x89c7('0x162')]))[_0x89c7('0x39')](_0x1408bc['checkContactBlack'](_0x7ede90,_0x39d79c[_0x1e251a]))['catch'](_0x1408bc[_0x89c7('0x15a')](_0x89c7('0x1fb'),_0x7ede90));}}}}})[_0x89c7('0x9e')](loggerGetContactDialer(_0x89c7('0x205'),_0x7ede90,_0x2b0ece));}};Dialer[_0x89c7('0x15')][_0x89c7('0x61')]=function(_0x3bfa75){if(_0x3bfa75[_0x89c7('0x1ff')]>0x0){var _0x7d78f3=_0x3bfa75[_0x89c7('0x1ff')]-_0x3bfa75[_0x89c7('0x7f')]-_0x3bfa75[_0x89c7('0x13d')];if(_0x7d78f3>0x0&&_0x3bfa75[_0x89c7('0x65')]==0x0){this['tryOriginatePredictive'](_0x3bfa75);}else{loggerPredictiveCalls[_0x89c7('0x42')](_0x89c7('0x206'));}}else{this['tryOriginatePredictive'](_0x3bfa75);}};Dialer[_0x89c7('0x15')][_0x89c7('0x207')]=function(_0x4ac6da){var _0x1a736a=this;var _0x4635fe=[];_0x4ac6da[_0x89c7('0x7f')]+=0x1;for(var _0x3a8d04 in this[_0x89c7('0x1c')]){if(typeof this[_0x89c7('0x1c')][_0x3a8d04]!=='undefined'){if(this[_0x89c7('0x1c')][_0x3a8d04][_0x89c7('0xd0')]==='not_inuse'&&this[_0x89c7('0x1c')][_0x3a8d04][_0x89c7('0x87')]===_0x89c7('0x88')){_0x4635fe[_0x89c7('0x96')](this['agents'][_0x3a8d04]['id']);}}}_0x4ac6da[_0x89c7('0x65')]=0x1;return this[_0x89c7('0x200')](_0x4ac6da['id'],_0x4635fe,0x1,_0x4ac6da[_0x89c7('0x208')],_0x4ac6da)[_0x89c7('0x39')](function(_0x276dcf){_0x4ac6da['temp']=0x1;if(_0x276dcf){if(!utils[_0x89c7('0x1f8')](_0x276dcf)){utils[_0x89c7('0x209')](_0x4ac6da,0x1,0x0);return hopperUtils['countReScheduled'](_0x4ac6da)[_0x89c7('0x39')](sendMessageReschedule(_0x4ac6da))[_0x89c7('0x9e')](loggerCatch(_0x89c7('0x202')));}else{_0x4ac6da[_0x89c7('0x68')]=utils[_0x89c7('0x69')][_0x89c7('0x203')];if(_[_0x89c7('0xf8')](_0x276dcf[0x0])||_['isNil'](_0x276dcf[0x0][_0x89c7('0x179')])||_[_0x89c7('0xf8')](_0x276dcf[0x0][_0x89c7('0x162')])){_0x1a736a[_0x89c7('0x15b')](_0x89c7('0x1fb'),_0x4ac6da,_0x276dcf[0x0]);}else{return hopperUtils[_0x89c7('0x204')](_['pick'](_0x276dcf[0x0],[_0x89c7('0xed'),_0x89c7('0x162')]))[_0x89c7('0x39')](_0x1a736a[_0x89c7('0x1fd')](_0x4ac6da,_0x276dcf[0x0]))[_0x89c7('0x9e')](_0x1a736a[_0x89c7('0x15a')](_0x89c7('0x20a'),_0x4ac6da));}}}})[_0x89c7('0x9e')](loggerGetContactDialer('[getContactDialerPredictive]',_0x4ac6da,0x1));};Dialer['prototype'][_0x89c7('0x1dc')]=function(_0x2ad35b,_0x23aec8,_0x31fb59,_0x57c65a,_0x1c366a,_0x53b3c2){loggerPredictive[_0x89c7('0x42')](_0x89c7('0x20b'));loggerPredictive['info']('M:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20',_0x2ad35b);loggerPredictive['info'](_0x89c7('0x20c'),_0x23aec8);loggerPredictive[_0x89c7('0x42')]('Ts:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20',_0x31fb59);loggerPredictive[_0x89c7('0x42')](_0x89c7('0x20d'),_0x57c65a);loggerPredictive[_0x89c7('0x42')]('Amax:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20',_0x1c366a);loggerPredictive[_0x89c7('0x42')]('---------------------------');return new Promise(function(_0x2fc197,_0x291cd8){if(_0x2ad35b<=0x0||isNaN(_0x2ad35b)){return _0x291cd8(msgResponse(_0x89c7('0x20e'),_0x89c7('0xba'),'m\x20=\x20'+_0x2ad35b));}if(_0x31fb59<=0x0||isNaN(_0x31fb59)){return _0x291cd8(msgResponse(_0x89c7('0x20e'),_0x89c7('0xba'),'Ts\x20=\x20'+_0x31fb59));}if(_0x57c65a<=0x0||isNaN(_0x57c65a)){return _0x291cd8(msgResponse(_0x89c7('0x20e'),'Error',_0x89c7('0x20f')+_0x57c65a));}if(_0x23aec8<=0x0||isNaN(_0x23aec8)){return _0x291cd8(msgResponse(_0x89c7('0x20e'),_0x89c7('0xba'),_0x89c7('0x210')+_0x23aec8));}if(_0x1c366a<=0x0||isNaN(_0x1c366a)){return _0x291cd8(msgResponse(_0x89c7('0x20e'),'Error',_0x89c7('0x211')+_0x1c366a));}_0x53b3c2=_0x53b3c2||0x0;var _0x2dc69f=0x1/_0x31fb59;var _0x15ca24=0x0;var _0x428700=0x0;var _0x2aa3d9=0x0;var _0x21a10c=0x0;for(var _0x55e72e=0x0;_0x2aa3d9<_0x1c366a;_0x55e72e+=0x1){_0x428700=_0x55e72e/_0x23aec8;_0x15ca24=(_0x57c65a*_0x428700+_0x53b3c2)/_0x2dc69f;_0x2aa3d9=utils[_0x89c7('0x212')](_0x15ca24,_0x2ad35b);_0x21a10c=_0x15ca24/_0x2ad35b*(0x1-utils['erlangb'](_0x15ca24,_0x2ad35b));}return _0x2fc197({'erlangCalls':_0x55e72e,'erlangCallToSecond':_0x23aec8/_0x55e72e,'erlangAbandonmentRate':_0x2aa3d9,'erlangBusyFactor':_0x21a10c});});};Dialer[_0x89c7('0x15')][_0x89c7('0x1d5')]=function(_0xd396aa,_0x436e3c,_0x1be25b,_0x4da29e,_0x2b7441,_0x340ee7){loggerPredictive['info'](_0x89c7('0x213'));loggerPredictive['info'](_0x89c7('0x214'),_0xd396aa);loggerPredictive[_0x89c7('0x42')](_0x89c7('0x20c'),_0x436e3c);loggerPredictive['info']('Ts:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20',_0x1be25b);loggerPredictive[_0x89c7('0x42')](_0x89c7('0x20d'),_0x4da29e);loggerPredictive['info']('Umin:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20',_0x2b7441);loggerPredictive['info']('---------------------------');return new Promise(function(_0x2bdaa1,_0x233683){if(_0xd396aa<=0x0||isNaN(_0xd396aa)){return _0x233683(msgResponse(_0x89c7('0x215'),'Error',_0x89c7('0x216')+_0xd396aa));}if(_0x1be25b<=0x0||isNaN(_0x1be25b)){return _0x233683(msgResponse(_0x89c7('0x215'),_0x89c7('0xba'),'Ts\x20=\x20'+_0x1be25b));}if(_0x4da29e<=0x0||isNaN(_0x4da29e)){return _0x233683(msgResponse(_0x89c7('0x215'),_0x89c7('0xba'),'p\x20=\x20'+_0x4da29e));}if(_0x436e3c<=0x0||isNaN(_0x436e3c)){return _0x233683(msgResponse(_0x89c7('0x215'),_0x89c7('0xba'),_0x89c7('0x210')+_0x436e3c));}if(_0x2b7441<=0x0||isNaN(_0x2b7441)){return _0x233683(msgResponse(_0x89c7('0x215'),'Error',_0x89c7('0x217')+_0x2b7441));}_0x340ee7=_0x340ee7||0x0;var _0x49a963=0x1/_0x1be25b;var _0x5b782d=0x0;var _0x408aae=0x0;var _0x1a9dac=0x0;var _0x44eb5f=0x0;for(var _0x2b49ed=0x0;_0x44eb5f<_0x2b7441;_0x2b49ed+=0x1){_0x408aae=_0x2b49ed/_0x436e3c;_0x5b782d=(_0x4da29e*_0x408aae+_0x340ee7)/_0x49a963;_0x1a9dac=utils[_0x89c7('0x212')](_0x5b782d,_0xd396aa);_0x44eb5f=_0x5b782d/_0xd396aa*(0x1-utils[_0x89c7('0x212')](_0x5b782d,_0xd396aa));}return _0x2bdaa1({'erlangCalls':_0x2b49ed,'erlangCallToSecond':_0x436e3c/_0x2b49ed,'erlangAbandonmentRate':_0x1a9dac,'erlangBusyFactor':_0x44eb5f});});};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 a50c91a..6eddffd 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 _0xe9f6=['ContactId','ListId','UserId','VoiceQueueId','idHopper','starttime','format','YYYY-MM-DD\x20HH:mm:ss','callback','callbackuniqueid','callbackat','recallme','originatecalleridnum','getCaller','dialCutDigit','substring','exports','util','moment','isNil','string','voiceQueue','uniqueid','name','Contact','firstName','lastName','number','active','type','dialQueueTimeout','countbusyretry','countcongestionretry','countnoanswerretry','countnosuchnumberretry','countdropretry','countabandonedretry','countmachineretry'];(function(_0x1c82ea,_0x45ee10){var _0x248140=function(_0x385d6a){while(--_0x385d6a){_0x1c82ea['push'](_0x1c82ea['shift']());}};_0x248140(++_0x45ee10);}(_0xe9f6,0x141));var _0x6e9f=function(_0x4c2f5d,_0x3a2108){_0x4c2f5d=_0x4c2f5d-0x0;var _0x4eaf29=_0xe9f6[_0x4c2f5d];return _0x4eaf29;};'use strict';var util=require(_0x6e9f('0x0'));var _=require('lodash');var moment=require(_0x6e9f('0x1'));function checkNameSurname(_0x4cd420,_0x522f42,_0x6c865e){var _0xd0f08='';if(!_[_0x6e9f('0x2')](_0x522f42)&&'string'===typeof _0x522f42){_0xd0f08+=_0x522f42;}if(!_[_0x6e9f('0x2')](_0x6c865e)&&_0x6e9f('0x3')===typeof _0x6c865e){_0xd0f08+='\x20'+_0x6c865e;}if(_0xd0f08!==''){return _0xd0f08;}return _0x4cd420;}function Action(_0xf26028,_0x517eca,_0x5395db){this[_0x6e9f('0x4')]=_0xf26028;this[_0x6e9f('0x5')]=_0x5395db||undefined;this[_0x6e9f('0x6')]=checkNameSurname(_0x517eca['Contact']['phone'],_0x517eca[_0x6e9f('0x7')][_0x6e9f('0x8')],_0x517eca[_0x6e9f('0x7')][_0x6e9f('0x9')]);this[_0x6e9f('0xa')]=_0x517eca['phone'];this['queue']=_0xf26028[_0x6e9f('0x6')];this[_0x6e9f('0xb')]=_0x517eca[_0x6e9f('0xb')]||![];this['type']=_0xf26028[_0x6e9f('0xc')];this['dialQueueTimeout']=_0xf26028[_0x6e9f('0xd')]||0x3;this['scheduledat']=_0x517eca['scheduledat'];this[_0x6e9f('0xe')]=_0x517eca[_0x6e9f('0xe')];this[_0x6e9f('0xf')]=_0x517eca[_0x6e9f('0xf')];this['countnoanswerretry']=_0x517eca[_0x6e9f('0x10')];this[_0x6e9f('0x11')]=_0x517eca[_0x6e9f('0x11')];this['countdropretry']=_0x517eca[_0x6e9f('0x12')];this[_0x6e9f('0x13')]=_0x517eca['countabandonedretry'];this['countmachineretry']=_0x517eca[_0x6e9f('0x14')];this['countagentrejectretry']=_0x517eca['countagentrejectretry'];this[_0x6e9f('0x15')]=_0x517eca[_0x6e9f('0x15')];this[_0x6e9f('0x16')]=_0x517eca[_0x6e9f('0x16')];this['UserId']=_0x517eca[_0x6e9f('0x17')];this[_0x6e9f('0x18')]=_0x517eca[_0x6e9f('0x18')];this['CampaignId']=_0x517eca['CampaignId'];this[_0x6e9f('0x19')]=_0x517eca['id'];this['ContactFirstName']=_0x517eca['Contact'][_0x6e9f('0x8')]||'';this[_0x6e9f('0x1a')]=moment()[_0x6e9f('0x1b')](_0x6e9f('0x1c'));this[_0x6e9f('0x1d')]=_0x517eca[_0x6e9f('0x1d')];this[_0x6e9f('0x1e')]=_0x517eca[_0x6e9f('0x1e')];this[_0x6e9f('0x1f')]=_0x517eca[_0x6e9f('0x1f')];this[_0x6e9f('0x20')]=_0x517eca[_0x6e9f('0x20')];this[_0x6e9f('0x21')]='';this['originatecalleridname']='';}Action['prototype'][_0x6e9f('0x22')]=function(){return util[_0x6e9f('0x1b')]('\x22%s\x22\x20<%s>',this[_0x6e9f('0x6')],this['voiceQueue'][_0x6e9f('0x23')]>0x0?this['number'][_0x6e9f('0x24')](this[_0x6e9f('0x4')][_0x6e9f('0x23')]):this[_0x6e9f('0xa')]);};Action['prototype']['getQueue']=function(){return this['queue'];};module[_0x6e9f('0x25')]=Action; \ No newline at end of file +var _0x22ee=['prototype','getCaller','format','\x22%s\x22\x20<%s>','dialCutDigit','number','exports','util','lodash','isNil','string','voiceQueue','uniqueid','name','Contact','phone','queue','active','type','dialQueueTimeout','countbusyretry','countcongestionretry','countnoanswerretry','countdropretry','countabandonedretry','countmachineretry','countagentrejectretry','ContactId','UserId','VoiceQueueId','CampaignId','idHopper','ContactFirstName','YYYY-MM-DD\x20HH:mm:ss','callback','callbackuniqueid','callbackat','recallme','originatecalleridnum'];(function(_0x585700,_0x5eaa85){var _0x57eebb=function(_0x98ee7d){while(--_0x98ee7d){_0x585700['push'](_0x585700['shift']());}};_0x57eebb(++_0x5eaa85);}(_0x22ee,0x18d));var _0xe22e=function(_0x2cee7f,_0xfcc5c1){_0x2cee7f=_0x2cee7f-0x0;var _0xa5dccb=_0x22ee[_0x2cee7f];return _0xa5dccb;};'use strict';var util=require(_0xe22e('0x0'));var _=require(_0xe22e('0x1'));var moment=require('moment');function checkNameSurname(_0x5e91bc,_0x319c79,_0x1bd00b){var _0x26b186='';if(!_[_0xe22e('0x2')](_0x319c79)&&_0xe22e('0x3')===typeof _0x319c79){_0x26b186+=_0x319c79;}if(!_['isNil'](_0x1bd00b)&&'string'===typeof _0x1bd00b){_0x26b186+='\x20'+_0x1bd00b;}if(_0x26b186!==''){return _0x26b186;}return _0x5e91bc;}function Action(_0x579734,_0x889646,_0x55ceea){this[_0xe22e('0x4')]=_0x579734;this[_0xe22e('0x5')]=_0x55ceea||undefined;this[_0xe22e('0x6')]=checkNameSurname(_0x889646[_0xe22e('0x7')][_0xe22e('0x8')],_0x889646['Contact']['firstName'],_0x889646[_0xe22e('0x7')]['lastName']);this['number']=_0x889646[_0xe22e('0x8')];this[_0xe22e('0x9')]=_0x579734[_0xe22e('0x6')];this[_0xe22e('0xa')]=_0x889646[_0xe22e('0xa')]||![];this[_0xe22e('0xb')]=_0x579734[_0xe22e('0xb')];this['dialQueueTimeout']=_0x579734[_0xe22e('0xc')]||0x3;this['scheduledat']=_0x889646['scheduledat'];this[_0xe22e('0xd')]=_0x889646[_0xe22e('0xd')];this[_0xe22e('0xe')]=_0x889646['countcongestionretry'];this[_0xe22e('0xf')]=_0x889646[_0xe22e('0xf')];this['countnosuchnumberretry']=_0x889646['countnosuchnumberretry'];this[_0xe22e('0x10')]=_0x889646[_0xe22e('0x10')];this[_0xe22e('0x11')]=_0x889646[_0xe22e('0x11')];this[_0xe22e('0x12')]=_0x889646['countmachineretry'];this['countagentrejectretry']=_0x889646[_0xe22e('0x13')];this[_0xe22e('0x14')]=_0x889646[_0xe22e('0x14')];this['ListId']=_0x889646['ListId'];this[_0xe22e('0x15')]=_0x889646[_0xe22e('0x15')];this[_0xe22e('0x16')]=_0x889646[_0xe22e('0x16')];this[_0xe22e('0x17')]=_0x889646[_0xe22e('0x17')];this[_0xe22e('0x18')]=_0x889646['id'];this[_0xe22e('0x19')]=_0x889646['Contact']['firstName']||'';this['starttime']=moment()['format'](_0xe22e('0x1a'));this['callback']=_0x889646[_0xe22e('0x1b')];this[_0xe22e('0x1c')]=_0x889646[_0xe22e('0x1c')];this[_0xe22e('0x1d')]=_0x889646[_0xe22e('0x1d')];this[_0xe22e('0x1e')]=_0x889646[_0xe22e('0x1e')];this[_0xe22e('0x1f')]='';this['originatecalleridname']='';}Action[_0xe22e('0x20')][_0xe22e('0x21')]=function(){return util[_0xe22e('0x22')](_0xe22e('0x23'),this[_0xe22e('0x6')],this['voiceQueue'][_0xe22e('0x24')]>0x0?this[_0xe22e('0x25')]['substring'](this[_0xe22e('0x4')]['dialCutDigit']):this['number']);};Action[_0xe22e('0x20')]['getQueue']=function(){return this[_0xe22e('0x9')];};module[_0xe22e('0x26')]=Action; \ No newline at end of file diff --git a/server/services/ami/dialer/models/agentComplete.js b/server/services/ami/dialer/models/agentComplete.js index 12bf5a5..1fd3e5f 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 _0xc76f=['moment','../utils','statedesc','Answer','type','campaigntype','outbound','countbusyretry','countnoanswerretry','countglobal','countnosuchnumberretry','countdropretry','countabandonedretry','countmachineretry','countagentrejectretry','uniqueid','calleridname','name','calleridnum','number','starttime','responsetime','answertime','format','ringtime','getSeconds','holdtime','talktime','endtime','queue','membername','reason','callback','callbackuniqueid','callbackat','recallme','ContactId','ListId','UserId','VoiceQueueId','CampaignId','originatecalleridnum','originatecalleridname','agiafterat','exports'];(function(_0x107fbc,_0x45d5d0){var _0x5ede57=function(_0xaf6f33){while(--_0xaf6f33){_0x107fbc['push'](_0x107fbc['shift']());}};_0x5ede57(++_0x45d5d0);}(_0xc76f,0x87));var _0xfc76=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xc76f[_0x3dd15e];return _0x231fd0;};'use strict';var moment=require(_0xfc76('0x0'));var utils=require(_0xfc76('0x1'));function AgentComplete(_0x263f88,_0x1c99e0){this['state']=0x4;this[_0xfc76('0x2')]=_0xfc76('0x3');this['scheduledat']=_0x263f88['scheduledat'];this[_0xfc76('0x4')]=_0x263f88[_0xfc76('0x4')];this[_0xfc76('0x5')]=_0x263f88['type']===_0xfc76('0x6')?'queue':_0x263f88[_0xfc76('0x4')];this[_0xfc76('0x7')]=_0x263f88['countbusyretry'];this['countcongestionretry']=_0x263f88['countcongestionretry'];this[_0xfc76('0x8')]=_0x263f88['countnoanswerretry'];this[_0xfc76('0x9')]=_0x263f88[_0xfc76('0x7')]+_0x263f88['countcongestionretry']+_0x263f88[_0xfc76('0x8')]+_0x263f88[_0xfc76('0xa')]+_0x263f88[_0xfc76('0xb')]+_0x263f88[_0xfc76('0xc')]+_0x263f88[_0xfc76('0xd')]+_0x263f88['countagentrejectretry'];this['countnosuchnumberretry']=_0x263f88[_0xfc76('0xa')];this[_0xfc76('0xb')]=_0x263f88['countdropretry'];this[_0xfc76('0xc')]=_0x263f88['countabandonedretry'];this[_0xfc76('0xd')]=_0x263f88[_0xfc76('0xd')];this[_0xfc76('0xe')]=_0x263f88['countagentrejectretry'];this[_0xfc76('0xf')]=_0x1c99e0['uniqueid'];this[_0xfc76('0x10')]=_0x263f88[_0xfc76('0x11')];this[_0xfc76('0x12')]=_0x263f88[_0xfc76('0x13')];this[_0xfc76('0x14')]=_0x263f88[_0xfc76('0x14')];this[_0xfc76('0x15')]=_0x263f88[_0xfc76('0x15')];this[_0xfc76('0x16')]=_0x263f88[_0xfc76('0x16')];this['endtime']=moment()[_0xfc76('0x17')]('YYYY-MM-DD\x20HH:mm:ss');this[_0xfc76('0x18')]=utils[_0xfc76('0x19')](_0x263f88[_0xfc76('0x15')],_0x263f88[_0xfc76('0x14')]);this[_0xfc76('0x1a')]=utils[_0xfc76('0x19')](_0x263f88[_0xfc76('0x16')],_0x263f88[_0xfc76('0x15')]);this[_0xfc76('0x1b')]=utils[_0xfc76('0x19')](this[_0xfc76('0x1c')],_0x263f88['answertime']);this[_0xfc76('0x1d')]=_0x1c99e0['queue'];this['membername']=_0x1c99e0[_0xfc76('0x1e')];this[_0xfc76('0x1f')]=_0x1c99e0[_0xfc76('0x1f')];this['callback']=_0x263f88[_0xfc76('0x20')];this['callbackuniqueid']=_0x263f88[_0xfc76('0x21')];this[_0xfc76('0x22')]=_0x263f88['callbackat'];this[_0xfc76('0x23')]=_0x263f88[_0xfc76('0x23')];this[_0xfc76('0x24')]=_0x263f88[_0xfc76('0x24')];this[_0xfc76('0x25')]=_0x263f88[_0xfc76('0x25')];this[_0xfc76('0x26')]=_0x263f88[_0xfc76('0x26')];this[_0xfc76('0x27')]=_0x263f88[_0xfc76('0x27')];this[_0xfc76('0x28')]=_0x263f88[_0xfc76('0x28')];this[_0xfc76('0x29')]=_0x263f88[_0xfc76('0x29')]||'';this[_0xfc76('0x2a')]=_0x263f88['originatecalleridname']||'';this[_0xfc76('0x2b')]=_0x263f88[_0xfc76('0x2b')];}module[_0xfc76('0x2c')]=AgentComplete; \ No newline at end of file +var _0xc7c2=['YYYY-MM-DD\x20HH:mm:ss','ringtime','getSeconds','holdtime','membername','reason','callback','callbackuniqueid','callbackat','recallme','ContactId','ListId','UserId','VoiceQueueId','CampaignId','originatecalleridnum','originatecalleridname','agiafterat','exports','moment','../utils','state','Answer','scheduledat','type','campaigntype','outbound','queue','countcongestionretry','countnoanswerretry','countglobal','countbusyretry','countnosuchnumberretry','countdropretry','countabandonedretry','countmachineretry','countagentrejectretry','uniqueid','calleridname','name','number','starttime','responsetime','answertime','endtime'];(function(_0x431c26,_0x4b8f47){var _0x3092fd=function(_0x4dca59){while(--_0x4dca59){_0x431c26['push'](_0x431c26['shift']());}};_0x3092fd(++_0x4b8f47);}(_0xc7c2,0x121));var _0x2c7c=function(_0x4d4c76,_0x38cdba){_0x4d4c76=_0x4d4c76-0x0;var _0x14662a=_0xc7c2[_0x4d4c76];return _0x14662a;};'use strict';var moment=require(_0x2c7c('0x0'));var utils=require(_0x2c7c('0x1'));function AgentComplete(_0x5aee73,_0x43b394){this[_0x2c7c('0x2')]=0x4;this['statedesc']=_0x2c7c('0x3');this[_0x2c7c('0x4')]=_0x5aee73['scheduledat'];this[_0x2c7c('0x5')]=_0x5aee73[_0x2c7c('0x5')];this[_0x2c7c('0x6')]=_0x5aee73[_0x2c7c('0x5')]===_0x2c7c('0x7')?_0x2c7c('0x8'):_0x5aee73[_0x2c7c('0x5')];this['countbusyretry']=_0x5aee73['countbusyretry'];this['countcongestionretry']=_0x5aee73[_0x2c7c('0x9')];this[_0x2c7c('0xa')]=_0x5aee73[_0x2c7c('0xa')];this[_0x2c7c('0xb')]=_0x5aee73[_0x2c7c('0xc')]+_0x5aee73['countcongestionretry']+_0x5aee73[_0x2c7c('0xa')]+_0x5aee73[_0x2c7c('0xd')]+_0x5aee73[_0x2c7c('0xe')]+_0x5aee73[_0x2c7c('0xf')]+_0x5aee73[_0x2c7c('0x10')]+_0x5aee73[_0x2c7c('0x11')];this[_0x2c7c('0xd')]=_0x5aee73['countnosuchnumberretry'];this[_0x2c7c('0xe')]=_0x5aee73[_0x2c7c('0xe')];this['countabandonedretry']=_0x5aee73[_0x2c7c('0xf')];this['countmachineretry']=_0x5aee73[_0x2c7c('0x10')];this[_0x2c7c('0x11')]=_0x5aee73[_0x2c7c('0x11')];this[_0x2c7c('0x12')]=_0x43b394[_0x2c7c('0x12')];this[_0x2c7c('0x13')]=_0x5aee73[_0x2c7c('0x14')];this['calleridnum']=_0x5aee73[_0x2c7c('0x15')];this[_0x2c7c('0x16')]=_0x5aee73[_0x2c7c('0x16')];this[_0x2c7c('0x17')]=_0x5aee73[_0x2c7c('0x17')];this[_0x2c7c('0x18')]=_0x5aee73[_0x2c7c('0x18')];this[_0x2c7c('0x19')]=moment()['format'](_0x2c7c('0x1a'));this[_0x2c7c('0x1b')]=utils[_0x2c7c('0x1c')](_0x5aee73[_0x2c7c('0x17')],_0x5aee73[_0x2c7c('0x16')]);this[_0x2c7c('0x1d')]=utils[_0x2c7c('0x1c')](_0x5aee73[_0x2c7c('0x18')],_0x5aee73[_0x2c7c('0x17')]);this['talktime']=utils['getSeconds'](this[_0x2c7c('0x19')],_0x5aee73[_0x2c7c('0x18')]);this[_0x2c7c('0x8')]=_0x43b394['queue'];this[_0x2c7c('0x1e')]=_0x43b394[_0x2c7c('0x1e')];this[_0x2c7c('0x1f')]=_0x43b394[_0x2c7c('0x1f')];this[_0x2c7c('0x20')]=_0x5aee73['callback'];this['callbackuniqueid']=_0x5aee73[_0x2c7c('0x21')];this[_0x2c7c('0x22')]=_0x5aee73[_0x2c7c('0x22')];this[_0x2c7c('0x23')]=_0x5aee73[_0x2c7c('0x23')];this[_0x2c7c('0x24')]=_0x5aee73[_0x2c7c('0x24')];this[_0x2c7c('0x25')]=_0x5aee73['ListId'];this[_0x2c7c('0x26')]=_0x5aee73[_0x2c7c('0x26')];this[_0x2c7c('0x27')]=_0x5aee73['VoiceQueueId'];this[_0x2c7c('0x28')]=_0x5aee73['CampaignId'];this[_0x2c7c('0x29')]=_0x5aee73['originatecalleridnum']||'';this['originatecalleridname']=_0x5aee73[_0x2c7c('0x2a')]||'';this[_0x2c7c('0x2b')]=_0x5aee73['agiafterat'];}module[_0x2c7c('0x2c')]=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 ee7baaa..da0d4d2 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 _0x454e=['starttime','responsetime','endtime','ringtime','holdtime','talktime','callback','callbackuniqueid','callbackat','ContactId','UserId','VoiceQueueId','CampaignId','originatecalleridnum','originatecalleridname','state','statedesc','exports','uniqueid','scheduledat','type','campaigntype','outbound','queue','countbusyretry','countcongestionretry','countnoanswerretry','countglobal','countnosuchnumberretry','countabandonedretry','countagentrejectretry','countdropretry','countmachineretry','calleridname','calleridnum'];(function(_0x2be8c2,_0x14a4b5){var _0x97f531=function(_0xcee58d){while(--_0xcee58d){_0x2be8c2['push'](_0x2be8c2['shift']());}};_0x97f531(++_0x14a4b5);}(_0x454e,0x193));var _0xe454=function(_0x49b86c,_0x4fa07f){_0x49b86c=_0x49b86c-0x0;var _0x5e0711=_0x454e[_0x49b86c];return _0x5e0711;};'use strict';function Final(_0x1d57ac){this[_0xe454('0x0')]=_0x1d57ac[_0xe454('0x0')];this[_0xe454('0x1')]=_0x1d57ac[_0xe454('0x1')];this[_0xe454('0x2')]=_0x1d57ac[_0xe454('0x2')];this[_0xe454('0x3')]=_0x1d57ac[_0xe454('0x2')]===_0xe454('0x4')?_0xe454('0x5'):_0x1d57ac[_0xe454('0x2')];this[_0xe454('0x6')]=_0x1d57ac[_0xe454('0x6')];this[_0xe454('0x7')]=_0x1d57ac[_0xe454('0x7')];this[_0xe454('0x8')]=_0x1d57ac[_0xe454('0x8')];this[_0xe454('0x9')]=_0x1d57ac[_0xe454('0x6')]+_0x1d57ac[_0xe454('0x7')]+_0x1d57ac[_0xe454('0x8')]+_0x1d57ac[_0xe454('0xa')]+_0x1d57ac['countdropretry']+_0x1d57ac[_0xe454('0xb')]+_0x1d57ac['countmachineretry']+_0x1d57ac[_0xe454('0xc')];this[_0xe454('0xa')]=_0x1d57ac[_0xe454('0xa')];this['countdropretry']=_0x1d57ac[_0xe454('0xd')];this['countabandonedretry']=_0x1d57ac[_0xe454('0xb')];this[_0xe454('0xe')]=_0x1d57ac[_0xe454('0xe')];this[_0xe454('0xc')]=_0x1d57ac['countagentrejectretry'];this[_0xe454('0x5')]=_0x1d57ac[_0xe454('0x5')];this['calleridname']=_0x1d57ac[_0xe454('0xf')];this[_0xe454('0x10')]=_0x1d57ac[_0xe454('0x10')];this['starttime']=_0x1d57ac[_0xe454('0x11')];this[_0xe454('0x12')]=_0x1d57ac[_0xe454('0x12')];this[_0xe454('0x13')]=_0x1d57ac[_0xe454('0x12')];this[_0xe454('0x14')]=_0x1d57ac['ringtime']||0x0;this[_0xe454('0x15')]=_0x1d57ac[_0xe454('0x15')]||0x0;this[_0xe454('0x16')]=_0x1d57ac['talktime']||0x0;this[_0xe454('0x17')]=_0x1d57ac[_0xe454('0x17')];this[_0xe454('0x18')]=_0x1d57ac[_0xe454('0x18')];this[_0xe454('0x19')]=_0x1d57ac[_0xe454('0x19')];this['recallme']=_0x1d57ac['recallme'];this[_0xe454('0x1a')]=_0x1d57ac['ContactId'];this['ListId']=_0x1d57ac['ListId'];this['UserId']=_0x1d57ac[_0xe454('0x1b')];this[_0xe454('0x1c')]=_0x1d57ac[_0xe454('0x1c')];this[_0xe454('0x1d')]=_0x1d57ac[_0xe454('0x1d')];this[_0xe454('0x1e')]=_0x1d57ac[_0xe454('0x1e')]||'';this[_0xe454('0x1f')]=_0x1d57ac[_0xe454('0x1f')]||'';this[_0xe454('0x20')]=_0x1d57ac[_0xe454('0x20')];this[_0xe454('0x21')]=_0x1d57ac['statedesc'];}module[_0xe454('0x22')]=Final; \ No newline at end of file +var _0x3618=['countdropretry','countabandonedretry','countmachineretry','countagentrejectretry','calleridnum','starttime','responsetime','endtime','ringtime','holdtime','talktime','callback','callbackuniqueid','callbackat','recallme','ContactId','ListId','UserId','VoiceQueueId','CampaignId','originatecalleridnum','originatecalleridname','state','statedesc','uniqueid','scheduledat','type','campaigntype','queue','countbusyretry','countnoanswerretry','countglobal','countcongestionretry','countnosuchnumberretry'];(function(_0x1035c1,_0x2d8583){var _0x308d67=function(_0x58ddb6){while(--_0x58ddb6){_0x1035c1['push'](_0x1035c1['shift']());}};_0x308d67(++_0x2d8583);}(_0x3618,0x1b0));var _0x8361=function(_0x279d37,_0x14de3f){_0x279d37=_0x279d37-0x0;var _0x530173=_0x3618[_0x279d37];return _0x530173;};'use strict';function Final(_0x3b7454){this[_0x8361('0x0')]=_0x3b7454['uniqueid'];this[_0x8361('0x1')]=_0x3b7454['scheduledat'];this[_0x8361('0x2')]=_0x3b7454[_0x8361('0x2')];this[_0x8361('0x3')]=_0x3b7454['type']==='outbound'?_0x8361('0x4'):_0x3b7454[_0x8361('0x2')];this[_0x8361('0x5')]=_0x3b7454[_0x8361('0x5')];this['countcongestionretry']=_0x3b7454['countcongestionretry'];this[_0x8361('0x6')]=_0x3b7454[_0x8361('0x6')];this[_0x8361('0x7')]=_0x3b7454[_0x8361('0x5')]+_0x3b7454[_0x8361('0x8')]+_0x3b7454[_0x8361('0x6')]+_0x3b7454[_0x8361('0x9')]+_0x3b7454[_0x8361('0xa')]+_0x3b7454['countabandonedretry']+_0x3b7454['countmachineretry']+_0x3b7454['countagentrejectretry'];this['countnosuchnumberretry']=_0x3b7454[_0x8361('0x9')];this[_0x8361('0xa')]=_0x3b7454[_0x8361('0xa')];this[_0x8361('0xb')]=_0x3b7454['countabandonedretry'];this[_0x8361('0xc')]=_0x3b7454[_0x8361('0xc')];this['countagentrejectretry']=_0x3b7454[_0x8361('0xd')];this[_0x8361('0x4')]=_0x3b7454['queue'];this['calleridname']=_0x3b7454['calleridname'];this[_0x8361('0xe')]=_0x3b7454[_0x8361('0xe')];this['starttime']=_0x3b7454[_0x8361('0xf')];this[_0x8361('0x10')]=_0x3b7454[_0x8361('0x10')];this[_0x8361('0x11')]=_0x3b7454[_0x8361('0x10')];this[_0x8361('0x12')]=_0x3b7454[_0x8361('0x12')]||0x0;this[_0x8361('0x13')]=_0x3b7454[_0x8361('0x13')]||0x0;this['talktime']=_0x3b7454[_0x8361('0x14')]||0x0;this[_0x8361('0x15')]=_0x3b7454[_0x8361('0x15')];this[_0x8361('0x16')]=_0x3b7454[_0x8361('0x16')];this[_0x8361('0x17')]=_0x3b7454[_0x8361('0x17')];this[_0x8361('0x18')]=_0x3b7454['recallme'];this[_0x8361('0x19')]=_0x3b7454['ContactId'];this[_0x8361('0x1a')]=_0x3b7454[_0x8361('0x1a')];this[_0x8361('0x1b')]=_0x3b7454[_0x8361('0x1b')];this['VoiceQueueId']=_0x3b7454[_0x8361('0x1c')];this[_0x8361('0x1d')]=_0x3b7454[_0x8361('0x1d')];this[_0x8361('0x1e')]=_0x3b7454['originatecalleridnum']||'';this[_0x8361('0x1f')]=_0x3b7454[_0x8361('0x1f')]||'';this[_0x8361('0x20')]=_0x3b7454[_0x8361('0x20')];this[_0x8361('0x21')]=_0x3b7454[_0x8361('0x21')];}module['exports']=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 81f5c85..0a76258 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 _0xf47e=['countbusyretry','countcongestionretry','countnoanswerretry','countglobal','countdropretry','countabandonedretry','countmachineretry','countagentrejectretry','countnosuchnumberretry','uniqueid','name','calleridnum','number','starttime','responsetime','endtime','getSeconds','holdtime','queue','membername','IVR','callback','callbackuniqueid','callbackat','recallme','ContactId','ListId','UserId','CampaignId','exports','../utils','state','Answer','scheduledat','type','campaigntype','outbound'];(function(_0x337e3b,_0x4964b6){var _0x3ecc7d=function(_0x3c6b47){while(--_0x3c6b47){_0x337e3b['push'](_0x337e3b['shift']());}};_0x3ecc7d(++_0x4964b6);}(_0xf47e,0x68));var _0xef47=function(_0x3b8ffd,_0xfe57b0){_0x3b8ffd=_0x3b8ffd-0x0;var _0x4028f4=_0xf47e[_0x3b8ffd];return _0x4028f4;};'use strict';var moment=require('moment');var utils=require(_0xef47('0x0'));function Hangup(_0xfd4a91,_0x4ebcf9){this[_0xef47('0x1')]=0x4;this['statedesc']=_0xef47('0x2');this[_0xef47('0x3')]=_0xfd4a91[_0xef47('0x3')];this['type']=_0xfd4a91[_0xef47('0x4')];this[_0xef47('0x5')]=_0xfd4a91[_0xef47('0x4')]===_0xef47('0x6')?'queue':_0xfd4a91[_0xef47('0x4')];this['amd']=_0xfd4a91['amd']||![];this[_0xef47('0x7')]=_0xfd4a91[_0xef47('0x7')];this[_0xef47('0x8')]=_0xfd4a91['countcongestionretry'];this[_0xef47('0x9')]=_0xfd4a91[_0xef47('0x9')];this[_0xef47('0xa')]=_0xfd4a91['countbusyretry']+_0xfd4a91['countcongestionretry']+_0xfd4a91['countnoanswerretry']+_0xfd4a91['countnosuchnumberretry']+_0xfd4a91[_0xef47('0xb')]+_0xfd4a91[_0xef47('0xc')]+_0xfd4a91[_0xef47('0xd')]+_0xfd4a91[_0xef47('0xe')];this[_0xef47('0xf')]=_0xfd4a91[_0xef47('0xf')];this[_0xef47('0xb')]=_0xfd4a91[_0xef47('0xb')];this[_0xef47('0xc')]=_0xfd4a91[_0xef47('0xc')];this[_0xef47('0xd')]=_0xfd4a91[_0xef47('0xd')];this[_0xef47('0xe')]=_0xfd4a91[_0xef47('0xe')];this[_0xef47('0x10')]=_0x4ebcf9[_0xef47('0x10')];this['calleridname']=_0xfd4a91[_0xef47('0x11')];this[_0xef47('0x12')]=_0xfd4a91[_0xef47('0x13')];this[_0xef47('0x14')]=_0xfd4a91[_0xef47('0x14')];this['responsetime']=_0xfd4a91[_0xef47('0x15')];this[_0xef47('0x16')]=moment()['format']('YYYY-MM-DD\x20HH:mm:ss');this['ringtime']=utils[_0xef47('0x17')](_0xfd4a91[_0xef47('0x15')],_0xfd4a91[_0xef47('0x14')]);this[_0xef47('0x18')]=0x0;this['talktime']=utils[_0xef47('0x17')](this[_0xef47('0x16')],_0xfd4a91[_0xef47('0x15')]);this[_0xef47('0x19')]=_0xfd4a91['queue'];this[_0xef47('0x1a')]=_0xef47('0x1b');this['reason']=_0x4ebcf9['cause-txt'];this[_0xef47('0x1c')]=_0xfd4a91['callback'];this[_0xef47('0x1d')]=_0xfd4a91['callbackuniqueid'];this[_0xef47('0x1e')]=_0xfd4a91[_0xef47('0x1e')];this[_0xef47('0x1f')]=_0xfd4a91['recallme'];this[_0xef47('0x20')]=_0xfd4a91[_0xef47('0x20')];this[_0xef47('0x21')]=_0xfd4a91[_0xef47('0x21')];this[_0xef47('0x22')]=_0xfd4a91[_0xef47('0x22')];this['VoiceQueueId']=_0xfd4a91['VoiceQueueId'];this['CampaignId']=_0xfd4a91[_0xef47('0x23')];}module[_0xef47('0x24')]=Hangup; \ No newline at end of file +var _0xe444=['../utils','state','scheduledat','type','campaigntype','outbound','amd','countbusyretry','countcongestionretry','countnoanswerretry','countglobal','countnosuchnumberretry','countdropretry','countabandonedretry','countagentrejectretry','countmachineretry','calleridname','number','starttime','responsetime','endtime','format','YYYY-MM-DD\x20HH:mm:ss','getSeconds','holdtime','queue','membername','reason','callback','callbackat','recallme','ContactId','ListId','UserId','VoiceQueueId','CampaignId','exports','moment'];(function(_0x39772f,_0x5605cb){var _0xc9edbf=function(_0x106a39){while(--_0x106a39){_0x39772f['push'](_0x39772f['shift']());}};_0xc9edbf(++_0x5605cb);}(_0xe444,0x12f));var _0x4e44=function(_0x488292,_0x1aba12){_0x488292=_0x488292-0x0;var _0x17a003=_0xe444[_0x488292];return _0x17a003;};'use strict';var moment=require(_0x4e44('0x0'));var utils=require(_0x4e44('0x1'));function Hangup(_0x20ca7c,_0x4ad96b){this[_0x4e44('0x2')]=0x4;this['statedesc']='Answer';this[_0x4e44('0x3')]=_0x20ca7c[_0x4e44('0x3')];this[_0x4e44('0x4')]=_0x20ca7c[_0x4e44('0x4')];this[_0x4e44('0x5')]=_0x20ca7c[_0x4e44('0x4')]===_0x4e44('0x6')?'queue':_0x20ca7c[_0x4e44('0x4')];this[_0x4e44('0x7')]=_0x20ca7c[_0x4e44('0x7')]||![];this[_0x4e44('0x8')]=_0x20ca7c[_0x4e44('0x8')];this[_0x4e44('0x9')]=_0x20ca7c[_0x4e44('0x9')];this[_0x4e44('0xa')]=_0x20ca7c['countnoanswerretry'];this[_0x4e44('0xb')]=_0x20ca7c[_0x4e44('0x8')]+_0x20ca7c[_0x4e44('0x9')]+_0x20ca7c[_0x4e44('0xa')]+_0x20ca7c[_0x4e44('0xc')]+_0x20ca7c[_0x4e44('0xd')]+_0x20ca7c[_0x4e44('0xe')]+_0x20ca7c['countmachineretry']+_0x20ca7c[_0x4e44('0xf')];this[_0x4e44('0xc')]=_0x20ca7c[_0x4e44('0xc')];this[_0x4e44('0xd')]=_0x20ca7c[_0x4e44('0xd')];this[_0x4e44('0xe')]=_0x20ca7c[_0x4e44('0xe')];this['countmachineretry']=_0x20ca7c[_0x4e44('0x10')];this['countagentrejectretry']=_0x20ca7c['countagentrejectretry'];this['uniqueid']=_0x4ad96b['uniqueid'];this[_0x4e44('0x11')]=_0x20ca7c['name'];this['calleridnum']=_0x20ca7c[_0x4e44('0x12')];this[_0x4e44('0x13')]=_0x20ca7c[_0x4e44('0x13')];this[_0x4e44('0x14')]=_0x20ca7c[_0x4e44('0x14')];this[_0x4e44('0x15')]=moment()[_0x4e44('0x16')](_0x4e44('0x17'));this['ringtime']=utils[_0x4e44('0x18')](_0x20ca7c[_0x4e44('0x14')],_0x20ca7c[_0x4e44('0x13')]);this[_0x4e44('0x19')]=0x0;this['talktime']=utils[_0x4e44('0x18')](this['endtime'],_0x20ca7c[_0x4e44('0x14')]);this[_0x4e44('0x1a')]=_0x20ca7c[_0x4e44('0x1a')];this[_0x4e44('0x1b')]='IVR';this[_0x4e44('0x1c')]=_0x4ad96b['cause-txt'];this['callback']=_0x20ca7c[_0x4e44('0x1d')];this['callbackuniqueid']=_0x20ca7c['callbackuniqueid'];this[_0x4e44('0x1e')]=_0x20ca7c['callbackat'];this[_0x4e44('0x1f')]=_0x20ca7c[_0x4e44('0x1f')];this[_0x4e44('0x20')]=_0x20ca7c[_0x4e44('0x20')];this[_0x4e44('0x21')]=_0x20ca7c[_0x4e44('0x21')];this['UserId']=_0x20ca7c[_0x4e44('0x22')];this[_0x4e44('0x23')]=_0x20ca7c[_0x4e44('0x23')];this[_0x4e44('0x24')]=_0x20ca7c[_0x4e44('0x24')];}module[_0x4e44('0x25')]=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 1ee8996..30432d1 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 _0xd804=['countglobal','countnosuchnumberretry','countdropretry','countabandonedretry','countagentrejectretry','countmachineretry','calleridname','name','calleridnum','number','endtime','responsetime','ringtime','getSeconds','starttime','holdtime','talktime','callback','callbackuniqueid','callbackat','recallme','ContactId','ListId','UserId','VoiceQueueId','CampaignId','originatecalleridnum','originatecalleridname','state','statedesc','exports','uniqueid','scheduledat','type','outbound','queue','countbusyretry','countcongestionretry','countnoanswerretry'];(function(_0x558e1e,_0x4d1811){var _0x1796ba=function(_0x576663){while(--_0x576663){_0x558e1e['push'](_0x558e1e['shift']());}};_0x1796ba(++_0x4d1811);}(_0xd804,0x94));var _0x4d80=function(_0x256773,_0x598214){_0x256773=_0x256773-0x0;var _0xc0a4bb=_0xd804[_0x256773];return _0xc0a4bb;};'use strict';var utils=require('../utils');function History(_0x12579b){this[_0x4d80('0x0')]=_0x12579b[_0x4d80('0x0')];this[_0x4d80('0x1')]=_0x12579b[_0x4d80('0x1')]||undefined;this[_0x4d80('0x2')]=_0x12579b[_0x4d80('0x2')];this['campaigntype']=_0x12579b[_0x4d80('0x2')]===_0x4d80('0x3')?_0x4d80('0x4'):_0x12579b['type'];this[_0x4d80('0x5')]=_0x12579b[_0x4d80('0x5')];this[_0x4d80('0x6')]=_0x12579b[_0x4d80('0x6')];this[_0x4d80('0x7')]=_0x12579b['countnoanswerretry'];this[_0x4d80('0x8')]=_0x12579b[_0x4d80('0x5')]+_0x12579b[_0x4d80('0x6')]+_0x12579b[_0x4d80('0x7')]+_0x12579b[_0x4d80('0x9')]+_0x12579b[_0x4d80('0xa')]+_0x12579b[_0x4d80('0xb')]+_0x12579b['countmachineretry']+_0x12579b[_0x4d80('0xc')];this[_0x4d80('0x9')]=_0x12579b[_0x4d80('0x9')];this[_0x4d80('0xa')]=_0x12579b['countdropretry'];this['countabandonedretry']=_0x12579b['countabandonedretry'];this['countmachineretry']=_0x12579b[_0x4d80('0xd')];this['countagentrejectretry']=_0x12579b[_0x4d80('0xc')];this[_0x4d80('0x4')]=_0x12579b['queue'];this[_0x4d80('0xe')]=_0x12579b[_0x4d80('0xf')];this[_0x4d80('0x10')]=_0x12579b[_0x4d80('0x11')];this['starttime']=_0x12579b['starttime'];this['responsetime']=_0x12579b['responsetime'];this[_0x4d80('0x12')]=_0x12579b[_0x4d80('0x13')];this[_0x4d80('0x14')]=utils[_0x4d80('0x15')](_0x12579b[_0x4d80('0x13')],_0x12579b[_0x4d80('0x16')]);this[_0x4d80('0x17')]=0x0;this[_0x4d80('0x18')]=0x0;this['callback']=_0x12579b[_0x4d80('0x19')];this['callbackuniqueid']=_0x12579b[_0x4d80('0x1a')];this[_0x4d80('0x1b')]=_0x12579b[_0x4d80('0x1b')];this[_0x4d80('0x1c')]=_0x12579b[_0x4d80('0x1c')];this[_0x4d80('0x1d')]=_0x12579b[_0x4d80('0x1d')];this[_0x4d80('0x1e')]=_0x12579b[_0x4d80('0x1e')];this['UserId']=_0x12579b[_0x4d80('0x1f')];this[_0x4d80('0x20')]=_0x12579b[_0x4d80('0x20')];this['CampaignId']=_0x12579b[_0x4d80('0x21')];this['originatecalleridnum']=_0x12579b[_0x4d80('0x22')]||'';this['originatecalleridname']=_0x12579b[_0x4d80('0x23')]||'';this[_0x4d80('0x24')]=_0x12579b[_0x4d80('0x24')];this[_0x4d80('0x25')]=_0x12579b[_0x4d80('0x25')];}module[_0x4d80('0x26')]=History; \ No newline at end of file +var _0x3114=['recallme','ContactId','ListId','UserId','VoiceQueueId','CampaignId','originatecalleridnum','originatecalleridname','state','statedesc','exports','uniqueid','scheduledat','type','campaigntype','outbound','countbusyretry','countcongestionretry','countnoanswerretry','countglobal','countnosuchnumberretry','countabandonedretry','countmachineretry','countagentrejectretry','countdropretry','queue','calleridname','calleridnum','number','starttime','responsetime','getSeconds','holdtime','callback','callbackuniqueid'];(function(_0x2fb10b,_0x511a31){var _0x388b52=function(_0x44ac6a){while(--_0x44ac6a){_0x2fb10b['push'](_0x2fb10b['shift']());}};_0x388b52(++_0x511a31);}(_0x3114,0xdd));var _0x4311=function(_0x3ec59a,_0x2ef985){_0x3ec59a=_0x3ec59a-0x0;var _0xc7cb76=_0x3114[_0x3ec59a];return _0xc7cb76;};'use strict';var utils=require('../utils');function History(_0x3fb22a){this[_0x4311('0x0')]=_0x3fb22a['uniqueid'];this[_0x4311('0x1')]=_0x3fb22a['scheduledat']||undefined;this[_0x4311('0x2')]=_0x3fb22a['type'];this[_0x4311('0x3')]=_0x3fb22a[_0x4311('0x2')]===_0x4311('0x4')?'queue':_0x3fb22a[_0x4311('0x2')];this['countbusyretry']=_0x3fb22a[_0x4311('0x5')];this[_0x4311('0x6')]=_0x3fb22a[_0x4311('0x6')];this[_0x4311('0x7')]=_0x3fb22a[_0x4311('0x7')];this[_0x4311('0x8')]=_0x3fb22a[_0x4311('0x5')]+_0x3fb22a[_0x4311('0x6')]+_0x3fb22a[_0x4311('0x7')]+_0x3fb22a[_0x4311('0x9')]+_0x3fb22a['countdropretry']+_0x3fb22a[_0x4311('0xa')]+_0x3fb22a[_0x4311('0xb')]+_0x3fb22a[_0x4311('0xc')];this[_0x4311('0x9')]=_0x3fb22a[_0x4311('0x9')];this['countdropretry']=_0x3fb22a[_0x4311('0xd')];this['countabandonedretry']=_0x3fb22a[_0x4311('0xa')];this[_0x4311('0xb')]=_0x3fb22a['countmachineretry'];this[_0x4311('0xc')]=_0x3fb22a[_0x4311('0xc')];this[_0x4311('0xe')]=_0x3fb22a['queue'];this[_0x4311('0xf')]=_0x3fb22a['name'];this[_0x4311('0x10')]=_0x3fb22a[_0x4311('0x11')];this['starttime']=_0x3fb22a[_0x4311('0x12')];this['responsetime']=_0x3fb22a[_0x4311('0x13')];this['endtime']=_0x3fb22a[_0x4311('0x13')];this['ringtime']=utils[_0x4311('0x14')](_0x3fb22a[_0x4311('0x13')],_0x3fb22a[_0x4311('0x12')]);this[_0x4311('0x15')]=0x0;this['talktime']=0x0;this[_0x4311('0x16')]=_0x3fb22a['callback'];this['callbackuniqueid']=_0x3fb22a[_0x4311('0x17')];this['callbackat']=_0x3fb22a['callbackat'];this['recallme']=_0x3fb22a[_0x4311('0x18')];this[_0x4311('0x19')]=_0x3fb22a[_0x4311('0x19')];this[_0x4311('0x1a')]=_0x3fb22a['ListId'];this[_0x4311('0x1b')]=_0x3fb22a[_0x4311('0x1b')];this[_0x4311('0x1c')]=_0x3fb22a[_0x4311('0x1c')];this['CampaignId']=_0x3fb22a[_0x4311('0x1d')];this[_0x4311('0x1e')]=_0x3fb22a[_0x4311('0x1e')]||'';this['originatecalleridname']=_0x3fb22a[_0x4311('0x1f')]||'';this['state']=_0x3fb22a[_0x4311('0x20')];this[_0x4311('0x21')]=_0x3fb22a[_0x4311('0x21')];}module[_0x4311('0x22')]=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 34c22be..e771152 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 _0xe80a=['VoiceQueueId','CampaignId','originatecalleridnum','originatecalleridname','agiafterat','state','statedesc','exports','../utils','scheduledat','type','campaigntype','outbound','countbusyretry','countcongestionretry','countnoanswerretry','countglobal','countnosuchnumberretry','countdropretry','countabandonedretry','countmachineretry','countagentrejectretry','uniqueid','calleridname','name','calleridnum','number','starttime','responsetime','dropreason','droptime','ringtime','talktime','queue','membername','connectedlinename','reason','callback','callbackuniqueid','callbackat','recallme','ContactId','ListId','UserId'];(function(_0xa464c9,_0x7c86d8){var _0x3d73c4=function(_0x5c2056){while(--_0x5c2056){_0xa464c9['push'](_0xa464c9['shift']());}};_0x3d73c4(++_0x7c86d8);}(_0xe80a,0x8c));var _0xae80=function(_0x4cf98e,_0xba4b79){_0x4cf98e=_0x4cf98e-0x0;var _0x1623ac=_0xe80a[_0x4cf98e];return _0x1623ac;};'use strict';var utils=require(_0xae80('0x0'));function QueueCallerAbandon(_0x3991b6,_0x374c2b){this[_0xae80('0x1')]=_0x3991b6['scheduledat'];this[_0xae80('0x2')]=_0x3991b6[_0xae80('0x2')];this[_0xae80('0x3')]=_0x3991b6[_0xae80('0x2')]===_0xae80('0x4')?'queue':_0x3991b6[_0xae80('0x2')];this[_0xae80('0x5')]=_0x3991b6[_0xae80('0x5')];this['countcongestionretry']=_0x3991b6[_0xae80('0x6')];this[_0xae80('0x7')]=_0x3991b6[_0xae80('0x7')];this[_0xae80('0x8')]=_0x3991b6[_0xae80('0x5')]+_0x3991b6[_0xae80('0x6')]+_0x3991b6[_0xae80('0x7')]+_0x3991b6[_0xae80('0x9')]+_0x3991b6[_0xae80('0xa')]+_0x3991b6[_0xae80('0xb')]+_0x3991b6[_0xae80('0xc')]+_0x3991b6[_0xae80('0xd')];this[_0xae80('0x9')]=_0x3991b6[_0xae80('0x9')];this[_0xae80('0xa')]=_0x3991b6[_0xae80('0xa')];this['countabandonedretry']=_0x3991b6[_0xae80('0xb')];this['countmachineretry']=_0x3991b6['countmachineretry'];this[_0xae80('0xd')]=_0x3991b6['countagentrejectretry'];this[_0xae80('0xe')]=_0x374c2b[_0xae80('0xe')];this[_0xae80('0xf')]=_0x3991b6[_0xae80('0x10')];this[_0xae80('0x11')]=_0x3991b6[_0xae80('0x12')];this[_0xae80('0x13')]=_0x3991b6[_0xae80('0x13')];this[_0xae80('0x14')]=_0x3991b6['responsetime'];this['droptime']=_0x3991b6['droptime'];this['dropreason']=_0x3991b6[_0xae80('0x15')];this['endtime']=this[_0xae80('0x16')];this[_0xae80('0x17')]=utils['getSeconds'](_0x3991b6['responsetime'],_0x3991b6[_0xae80('0x13')]);this['holdtime']=utils['getSeconds'](this['droptime'],_0x3991b6['responsetime']);this[_0xae80('0x18')]=0x0;this[_0xae80('0x19')]=_0x374c2b[_0xae80('0x19')];this[_0xae80('0x1a')]=_0x374c2b[_0xae80('0x1b')];this['reason']=_0x374c2b[_0xae80('0x1c')];this[_0xae80('0x1d')]=_0x3991b6[_0xae80('0x1d')];this[_0xae80('0x1e')]=_0x3991b6['callbackuniqueid'];this[_0xae80('0x1f')]=_0x3991b6[_0xae80('0x1f')];this[_0xae80('0x20')]=_0x3991b6[_0xae80('0x20')];this['ContactId']=_0x3991b6[_0xae80('0x21')];this['ListId']=_0x3991b6[_0xae80('0x22')];this['UserId']=_0x3991b6[_0xae80('0x23')];this[_0xae80('0x24')]=_0x3991b6[_0xae80('0x24')];this[_0xae80('0x25')]=_0x3991b6['CampaignId'];this['originatecalleridnum']=_0x3991b6[_0xae80('0x26')]||'';this[_0xae80('0x27')]=_0x3991b6[_0xae80('0x27')]||'';this[_0xae80('0x28')]=_0x3991b6['agiafterat'];this['state']=_0x3991b6[_0xae80('0x29')];this['statedesc']=_0x3991b6[_0xae80('0x2a')];}module[_0xae80('0x2b')]=QueueCallerAbandon; \ No newline at end of file +var _0x4ad3=['number','starttime','responsetime','droptime','dropreason','endtime','ringtime','getSeconds','holdtime','talktime','membername','connectedlinename','reason','callback','callbackuniqueid','callbackat','recallme','ContactId','ListId','UserId','VoiceQueueId','CampaignId','originatecalleridnum','originatecalleridname','agiafterat','state','statedesc','exports','../utils','scheduledat','type','campaigntype','outbound','queue','countbusyretry','countcongestionretry','countnoanswerretry','countnosuchnumberretry','countabandonedretry','countmachineretry','countagentrejectretry','countdropretry','uniqueid','calleridname','calleridnum'];(function(_0x1012bf,_0x57dd10){var _0x15b94f=function(_0x20f983){while(--_0x20f983){_0x1012bf['push'](_0x1012bf['shift']());}};_0x15b94f(++_0x57dd10);}(_0x4ad3,0x1b1));var _0x34ad=function(_0x1c4c1e,_0x37ae2c){_0x1c4c1e=_0x1c4c1e-0x0;var _0x308b62=_0x4ad3[_0x1c4c1e];return _0x308b62;};'use strict';var utils=require(_0x34ad('0x0'));function QueueCallerAbandon(_0x1902a5,_0x3b3764){this[_0x34ad('0x1')]=_0x1902a5[_0x34ad('0x1')];this[_0x34ad('0x2')]=_0x1902a5['type'];this[_0x34ad('0x3')]=_0x1902a5[_0x34ad('0x2')]===_0x34ad('0x4')?_0x34ad('0x5'):_0x1902a5[_0x34ad('0x2')];this[_0x34ad('0x6')]=_0x1902a5[_0x34ad('0x6')];this[_0x34ad('0x7')]=_0x1902a5[_0x34ad('0x7')];this[_0x34ad('0x8')]=_0x1902a5['countnoanswerretry'];this['countglobal']=_0x1902a5[_0x34ad('0x6')]+_0x1902a5[_0x34ad('0x7')]+_0x1902a5[_0x34ad('0x8')]+_0x1902a5[_0x34ad('0x9')]+_0x1902a5['countdropretry']+_0x1902a5[_0x34ad('0xa')]+_0x1902a5[_0x34ad('0xb')]+_0x1902a5[_0x34ad('0xc')];this[_0x34ad('0x9')]=_0x1902a5[_0x34ad('0x9')];this[_0x34ad('0xd')]=_0x1902a5[_0x34ad('0xd')];this[_0x34ad('0xa')]=_0x1902a5[_0x34ad('0xa')];this[_0x34ad('0xb')]=_0x1902a5[_0x34ad('0xb')];this[_0x34ad('0xc')]=_0x1902a5[_0x34ad('0xc')];this[_0x34ad('0xe')]=_0x3b3764[_0x34ad('0xe')];this[_0x34ad('0xf')]=_0x1902a5['name'];this[_0x34ad('0x10')]=_0x1902a5[_0x34ad('0x11')];this[_0x34ad('0x12')]=_0x1902a5['starttime'];this[_0x34ad('0x13')]=_0x1902a5[_0x34ad('0x13')];this[_0x34ad('0x14')]=_0x1902a5[_0x34ad('0x14')];this[_0x34ad('0x15')]=_0x1902a5['dropreason'];this[_0x34ad('0x16')]=this['droptime'];this[_0x34ad('0x17')]=utils[_0x34ad('0x18')](_0x1902a5[_0x34ad('0x13')],_0x1902a5[_0x34ad('0x12')]);this[_0x34ad('0x19')]=utils['getSeconds'](this[_0x34ad('0x14')],_0x1902a5[_0x34ad('0x13')]);this[_0x34ad('0x1a')]=0x0;this[_0x34ad('0x5')]=_0x3b3764[_0x34ad('0x5')];this[_0x34ad('0x1b')]=_0x3b3764[_0x34ad('0x1c')];this[_0x34ad('0x1d')]=_0x3b3764[_0x34ad('0x1d')];this['callback']=_0x1902a5[_0x34ad('0x1e')];this['callbackuniqueid']=_0x1902a5[_0x34ad('0x1f')];this['callbackat']=_0x1902a5[_0x34ad('0x20')];this[_0x34ad('0x21')]=_0x1902a5[_0x34ad('0x21')];this[_0x34ad('0x22')]=_0x1902a5[_0x34ad('0x22')];this[_0x34ad('0x23')]=_0x1902a5['ListId'];this[_0x34ad('0x24')]=_0x1902a5['UserId'];this[_0x34ad('0x25')]=_0x1902a5['VoiceQueueId'];this['CampaignId']=_0x1902a5[_0x34ad('0x26')];this[_0x34ad('0x27')]=_0x1902a5[_0x34ad('0x27')]||'';this[_0x34ad('0x28')]=_0x1902a5[_0x34ad('0x28')]||'';this[_0x34ad('0x29')]=_0x1902a5[_0x34ad('0x29')];this[_0x34ad('0x2a')]=_0x1902a5[_0x34ad('0x2a')];this[_0x34ad('0x2b')]=_0x1902a5['statedesc'];}module[_0x34ad('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 0730d2c..2a7775b 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 _0x814b=['rescheduleContact','[rescheduleContact]','unlockContact','[unlockContact]','[checkIsBlackList]','[checkIsBlackListIvr]','checkIsBlackListIvr','verifyAdditionalPhones','[verifyAdditionalPhone]','[swapAdditionalPhone]','swapAdditionalPhones','avgHandleTime','[avgHandleTime]','createHistory','[createHistory]','util','../../../../config/logger','dialer','../../rpc/cmHopper','../../rpc/cmHopperAdditionalPhone','../../rpc/cmHopperBlack','inspect','getContactDialer','catch','error','[getContactDialer]','getContactDialerIvr','dialOrderByScheduledAt','temp','countReScheduled','[countReScheduled]'];(function(_0x580647,_0x43d2c3){var _0x5f0792=function(_0x386cef){while(--_0x386cef){_0x580647['push'](_0x580647['shift']());}};_0x5f0792(++_0x43d2c3);}(_0x814b,0x1a2));var _0xb814=function(_0x31880d,_0x4f0ff3){_0x31880d=_0x31880d-0x0;var _0x423823=_0x814b[_0x31880d];return _0x423823;};'use strict';var util=require(_0xb814('0x0'));var logger=require(_0xb814('0x1'))(_0xb814('0x2'));var cmHopper=require(_0xb814('0x3'));var cmHopperAdditionalPhone=require(_0xb814('0x4'));var cmHopperBlack=require(_0xb814('0x5'));var cmHopperHistory=require('../../rpc/cmHopperHistory');function inspectError(_0x38c21a){return util[_0xb814('0x6')](_0x38c21a,{'showHidden':![],'depth':null});}function getContactDialer(_0x258866,_0x4237bc,_0x44931c){return cmHopper[_0xb814('0x7')](_0x258866['id'],_0x4237bc,_0x44931c,_0x258866['dialOrderByScheduledAt'])[_0xb814('0x8')](function(_0x2e6272){_0x258866['temp']=0x0;logger[_0xb814('0x9')](_0xb814('0xa'),inspectError(_0x2e6272));});}exports[_0xb814('0x7')]=getContactDialer;function getContactDialerIvr(_0x41166c,_0x1fea33){return cmHopper[_0xb814('0xb')](_0x41166c['id'],_0x1fea33,_0x41166c[_0xb814('0xc')])[_0xb814('0x8')](function(_0x207dbc){_0x41166c[_0xb814('0xd')]=0x0;logger[_0xb814('0x9')]('[getContactDialerIvr]',inspectError(_0x207dbc));});}exports[_0xb814('0xb')]=getContactDialerIvr;function countReScheduled(_0x56278f){return cmHopper[_0xb814('0xe')](_0x56278f)[_0xb814('0x8')](function(_0x35b10d){logger[_0xb814('0x9')](_0xb814('0xf'),inspectError(_0x35b10d));});}exports[_0xb814('0xe')]=countReScheduled;function rescheduleContact(_0x1438e7){return cmHopper[_0xb814('0x10')](_0x1438e7)[_0xb814('0x8')](function(_0x2ab627){logger[_0xb814('0x9')](_0xb814('0x11'),inspectError(_0x2ab627));});}exports[_0xb814('0x10')]=rescheduleContact;function unlockContact(_0x39bfcf,_0x303aca,_0x3a71d6){return cmHopper[_0xb814('0x12')](_0x39bfcf,_0x303aca,_0x3a71d6)[_0xb814('0x8')](function(_0x125ce2){logger[_0xb814('0x9')](_0xb814('0x13'),inspectError(_0x125ce2));});}exports['unlockContact']=unlockContact;function moveContactManagedDialer(_0x168a48){return cmHopper['moveContactManagedDialer'](_0x168a48)[_0xb814('0x8')](function(_0xfac75b){logger['error']('[moveContactManagedDialer]',inspectError(_0xfac75b));});}exports['moveContactManagedDialer']=moveContactManagedDialer;function checkIsBlackList(_0x399b43){return cmHopperBlack['checkIsBlackList'](_0x399b43)['catch'](function(_0xb684ea){logger[_0xb814('0x9')](_0xb814('0x14'),inspectError(_0xb684ea));});}exports['checkIsBlackList']=checkIsBlackList;function checkIsBlackListIvr(_0xf5b8aa){return cmHopperBlack['checkIsBlackListIvr'](_0xf5b8aa)[_0xb814('0x8')](function(_0x1808a3){logger[_0xb814('0x9')](_0xb814('0x15'),inspectError(_0x1808a3));});}exports[_0xb814('0x16')]=checkIsBlackListIvr;function verifyAdditionalPhones(_0x2bd039,_0x1f5d40,_0x594470){return cmHopperAdditionalPhone[_0xb814('0x17')](_0x2bd039,_0x1f5d40,_0x594470)['catch'](function(_0x3f81d0){logger[_0xb814('0x9')](_0xb814('0x18'),inspectError(_0x3f81d0));});}exports[_0xb814('0x17')]=verifyAdditionalPhones;function swapAdditionalPhones(_0x1c8a2e,_0xb9e57d,_0x3d836c){return cmHopperAdditionalPhone['swapAdditionalPhones'](_0x1c8a2e,_0xb9e57d,_0x3d836c)[_0xb814('0x8')](function(_0xc0ef66){logger[_0xb814('0x9')](_0xb814('0x19'),inspectError(_0xc0ef66));});}exports[_0xb814('0x1a')]=swapAdditionalPhones;function avgHandleTime(_0x1d5965){return cmHopperHistory[_0xb814('0x1b')](_0x1d5965)[_0xb814('0x8')](function(_0x5a6291){logger[_0xb814('0x9')](_0xb814('0x1c'),inspectError(_0x5a6291));});}exports['avgHandleTime']=avgHandleTime;function createHistory(_0x9008b2){return cmHopperHistory[_0xb814('0x1d')](_0x9008b2)[_0xb814('0x8')](function(_0x499f22){logger[_0xb814('0x9')](_0xb814('0x1e'),inspectError(_0x499f22));});}exports['createHistory']=createHistory; \ No newline at end of file +var _0x7278=['unlockContact','[unlockContact]','moveContactManagedDialer','checkIsBlackList','[checkIsBlackList]','checkIsBlackListIvr','[checkIsBlackListIvr]','verifyAdditionalPhones','swapAdditionalPhones','[swapAdditionalPhone]','avgHandleTime','createHistory','util','../../../../config/logger','dialer','../../rpc/cmHopper','../../rpc/cmHopperAdditionalPhone','../../rpc/cmHopperHistory','inspect','getContactDialer','catch','temp','error','[getContactDialer]','getContactDialerIvr','dialOrderByScheduledAt','[getContactDialerIvr]','countReScheduled','[countReScheduled]','rescheduleContact','[rescheduleContact]'];(function(_0xdc5354,_0x168dab){var _0x489e7f=function(_0x1ea233){while(--_0x1ea233){_0xdc5354['push'](_0xdc5354['shift']());}};_0x489e7f(++_0x168dab);}(_0x7278,0x161));var _0x8727=function(_0x2bb208,_0x2c6519){_0x2bb208=_0x2bb208-0x0;var _0x2862a9=_0x7278[_0x2bb208];return _0x2862a9;};'use strict';var util=require(_0x8727('0x0'));var logger=require(_0x8727('0x1'))(_0x8727('0x2'));var cmHopper=require(_0x8727('0x3'));var cmHopperAdditionalPhone=require(_0x8727('0x4'));var cmHopperBlack=require('../../rpc/cmHopperBlack');var cmHopperHistory=require(_0x8727('0x5'));function inspectError(_0x19c8ac){return util[_0x8727('0x6')](_0x19c8ac,{'showHidden':![],'depth':null});}function getContactDialer(_0x221021,_0x2df052,_0xfd8084){return cmHopper[_0x8727('0x7')](_0x221021['id'],_0x2df052,_0xfd8084,_0x221021['dialOrderByScheduledAt'])[_0x8727('0x8')](function(_0x2f491c){_0x221021[_0x8727('0x9')]=0x0;logger[_0x8727('0xa')](_0x8727('0xb'),inspectError(_0x2f491c));});}exports['getContactDialer']=getContactDialer;function getContactDialerIvr(_0x4b1985,_0x4df6f8){return cmHopper[_0x8727('0xc')](_0x4b1985['id'],_0x4df6f8,_0x4b1985[_0x8727('0xd')])[_0x8727('0x8')](function(_0x280fb3){_0x4b1985[_0x8727('0x9')]=0x0;logger[_0x8727('0xa')](_0x8727('0xe'),inspectError(_0x280fb3));});}exports[_0x8727('0xc')]=getContactDialerIvr;function countReScheduled(_0x4af9d2){return cmHopper[_0x8727('0xf')](_0x4af9d2)[_0x8727('0x8')](function(_0x176389){logger['error'](_0x8727('0x10'),inspectError(_0x176389));});}exports[_0x8727('0xf')]=countReScheduled;function rescheduleContact(_0x58e6f3){return cmHopper[_0x8727('0x11')](_0x58e6f3)[_0x8727('0x8')](function(_0x47c29d){logger[_0x8727('0xa')](_0x8727('0x12'),inspectError(_0x47c29d));});}exports[_0x8727('0x11')]=rescheduleContact;function unlockContact(_0x3865e9,_0x1916f7,_0x11c828){return cmHopper[_0x8727('0x13')](_0x3865e9,_0x1916f7,_0x11c828)['catch'](function(_0x17baba){logger[_0x8727('0xa')](_0x8727('0x14'),inspectError(_0x17baba));});}exports[_0x8727('0x13')]=unlockContact;function moveContactManagedDialer(_0x112f04){return cmHopper[_0x8727('0x15')](_0x112f04)['catch'](function(_0x575d29){logger[_0x8727('0xa')]('[moveContactManagedDialer]',inspectError(_0x575d29));});}exports[_0x8727('0x15')]=moveContactManagedDialer;function checkIsBlackList(_0xfd266f){return cmHopperBlack[_0x8727('0x16')](_0xfd266f)[_0x8727('0x8')](function(_0x2dae91){logger['error'](_0x8727('0x17'),inspectError(_0x2dae91));});}exports[_0x8727('0x16')]=checkIsBlackList;function checkIsBlackListIvr(_0x8cde82){return cmHopperBlack[_0x8727('0x18')](_0x8cde82)[_0x8727('0x8')](function(_0x3140e8){logger[_0x8727('0xa')](_0x8727('0x19'),inspectError(_0x3140e8));});}exports[_0x8727('0x18')]=checkIsBlackListIvr;function verifyAdditionalPhones(_0x56ffd5,_0x268a13,_0x1a69d5){return cmHopperAdditionalPhone['verifyAdditionalPhones'](_0x56ffd5,_0x268a13,_0x1a69d5)[_0x8727('0x8')](function(_0x3d3592){logger['error']('[verifyAdditionalPhone]',inspectError(_0x3d3592));});}exports[_0x8727('0x1a')]=verifyAdditionalPhones;function swapAdditionalPhones(_0x318684,_0x15e8bf,_0x5de6fa){return cmHopperAdditionalPhone[_0x8727('0x1b')](_0x318684,_0x15e8bf,_0x5de6fa)[_0x8727('0x8')](function(_0x267008){logger[_0x8727('0xa')](_0x8727('0x1c'),inspectError(_0x267008));});}exports[_0x8727('0x1b')]=swapAdditionalPhones;function avgHandleTime(_0x262f36){return cmHopperHistory[_0x8727('0x1d')](_0x262f36)['catch'](function(_0x243f15){logger[_0x8727('0xa')]('[avgHandleTime]',inspectError(_0x243f15));});}exports[_0x8727('0x1d')]=avgHandleTime;function createHistory(_0x163989){return cmHopperHistory[_0x8727('0x1e')](_0x163989)[_0x8727('0x8')](function(_0x416da8){logger[_0x8727('0xa')]('[createHistory]',inspectError(_0x416da8));});}exports[_0x8727('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 dfe144e..00db472 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 _0x3558=['NO_AGENTS_LOGGED','UNREACHABLE_TRUNK','getQueueCampaignActiveStatusMessage','extractCalleridName','string','format','\x22%s\x22\x20<%s>','getCallerId','\x5cw{0,','pow','replace','random','toString','getCallerIdRandom','decrementOriginate','length','createdAt','description','%s%s','XMD-','toUpperCase','setXMDContactVariables','lodash','moment','util','../../../../config/logger','dialer','../../../../config/environment/shared','timezones','ACTIVE','BLACKLIST','IS_DISACTIVED','INTERVAL_IS_EMPTY','NOT_ACTIVE','AVAILABLE_CONTACTS_FINISHED','INTERVAL_IS_NULL','INTERVAL_IS_OVERTIME','GLOBAL_INTERVAL_IS_OVERTIME','RECALLINQUEUE','RECALLFAILEDTIMEOUT','RUNNING','TIMEZONE_UNKNOW','CAMPAIGN_STATUS','preview','isPreviewCampaign','type','ivr','isIVRCampaign','isOutboundQueue','active','diff','seconds','getSeconds','dialMethod','dialActive','message','available','loggedIn','loggedInDb','paused','talking','pTalking','waiting','inUse','originated','Trunk','name','dialTimezone','isNil','dialGlobalInterval','Interval','Intervals','NULL_INTERVAL','isEmpty','EMPTY_INTERVAL','SIP/','unmonitored','includes','status','TrunkBackup','INACTIVE','DISACTIVED'];(function(_0x4315b1,_0x160c06){var _0x12a1a9=function(_0x1c0abf){while(--_0x1c0abf){_0x4315b1['push'](_0x4315b1['shift']());}};_0x12a1a9(++_0x160c06);}(_0x3558,0x15e));var _0x8355=function(_0xce6f11,_0x3c3137){_0xce6f11=_0xce6f11-0x0;var _0x35b709=_0x3558[_0xce6f11];return _0x35b709;};'use strict';var _=require(_0x8355('0x0'));var moment=require(_0x8355('0x1'));var util=require(_0x8355('0x2'));var logger=require(_0x8355('0x3'))(_0x8355('0x4'));var timezones=require(_0x8355('0x5'))[_0x8355('0x6')];var CAMPAIGN_STATUS={'ACTIVE':_0x8355('0x7'),'BLACKLIST':_0x8355('0x8'),'CONTACTS_RESCHEDULED':'RESCHEDULED_CONTACTS','DEACTIVATED':'DEACTIVATED','DISACTIVED':_0x8355('0x9'),'EMPTY_INTERVAL':_0x8355('0xa'),'INACTIVE':_0x8355('0xb'),'NO_AGENTS_LOGGED':'AGENTS_NOT_LOGGED','NO_AVAILABLE_CONTACTS':_0x8355('0xc'),'NULL_INTERVAL':_0x8355('0xd'),'OVERTIME_INTERVAL':_0x8355('0xe'),'OVERTIME_GLOBAL_INTERVAL':_0x8355('0xf'),'QUEUE_RECALL':_0x8355('0x10'),'RECALL_TIMEOUT':_0x8355('0x11'),'RUNNING':_0x8355('0x12'),'UNKNOWN_TIMEZONE':_0x8355('0x13'),'UNREACHABLE_TRUNK':'TRUNK_IS_NOT_REACHABLE'};exports[_0x8355('0x14')]=CAMPAIGN_STATUS;function isPreviewCampaign(_0x5d8420){return _0x5d8420['dialMethod']===_0x8355('0x15');}exports[_0x8355('0x16')]=isPreviewCampaign;function isIVRCampaign(_0x352c8c){return _0x352c8c[_0x8355('0x17')]===_0x8355('0x18');}exports[_0x8355('0x19')]=isIVRCampaign;function isOutboundQueue(_0x197cad){return _0x197cad[_0x8355('0x17')]==='outbound';}exports[_0x8355('0x1a')]=isOutboundQueue;function isQueueCampaignActive(_0x15d05d){return _0x15d05d['dialActive'];}exports['isQueueCampaignActive']=isQueueCampaignActive;function isIVRCampaignActive(_0x272793){return _0x272793[_0x8355('0x1b')];}exports['isIVRCampaignActive']=isIVRCampaignActive;function getSeconds(_0x370773,_0x12490f){var _0x4b53cf=moment(_0x370773)['milliseconds'](0x0);var _0x21f0ef=moment(_0x12490f)['milliseconds'](0x0);return _0x4b53cf[_0x8355('0x1c')](_0x21f0ef,_0x8355('0x1d'));}exports[_0x8355('0x1e')]=getSeconds;function hasQueueCampaignDataChanged(_0x4304e6,_0x181737){var _0x7d8ca1=![];var _0x51e6be=_0x4304e6['dialMethod']!==_0x181737[_0x8355('0x1f')]||_0x4304e6[_0x8355('0x20')]!==_0x181737['dialActive']||_0x4304e6[_0x8355('0x21')]!==_0x181737[_0x8355('0x21')];var _0x23412b=_0x4304e6[_0x8355('0x22')]!==_0x181737[_0x8355('0x22')]||_0x4304e6[_0x8355('0x23')]!==_0x181737['loggedIn']||_0x4304e6[_0x8355('0x24')]!==_0x181737[_0x8355('0x24')]||_0x4304e6[_0x8355('0x25')]!==_0x181737[_0x8355('0x25')]||_0x4304e6[_0x8355('0x26')]!==_0x181737[_0x8355('0x26')]||_0x4304e6[_0x8355('0x27')]!==_0x181737[_0x8355('0x27')]||_0x4304e6[_0x8355('0x28')]!==_0x181737[_0x8355('0x28')]||_0x4304e6[_0x8355('0x29')]!==_0x181737['inUse']||_0x4304e6[_0x8355('0x2a')]!==_0x181737['originated'];if(_0x4304e6['Trunk']&&_0x181737[_0x8355('0x2b')]){_0x7d8ca1=_0x4304e6[_0x8355('0x2b')][_0x8355('0x2c')]!==_0x181737[_0x8355('0x2b')][_0x8355('0x2c')]||_0x4304e6[_0x8355('0x2b')][_0x8355('0x1b')]!==_0x181737[_0x8355('0x2b')][_0x8355('0x1b')];}return _0x51e6be||_0x23412b||_0x7d8ca1;}exports['hasQueueCampaignDataChanged']=hasQueueCampaignDataChanged;function checkAnyValidQueueCampaignInterval(_0x3d9063){var _0x3a807f=null;var _0x201138=_0x3d9063[_0x8355('0x2d')];if(_[_0x8355('0x2e')](_0x3d9063[_0x8355('0x2f')])||_[_0x8355('0x2e')](_0x3d9063['Interval'])||_[_0x8355('0x2e')](_0x3d9063[_0x8355('0x30')][_0x8355('0x31')])){_0x3a807f=CAMPAIGN_STATUS[_0x8355('0x32')];}else if(_[_0x8355('0x33')](_0x3d9063['dialGlobalInterval'])||_[_0x8355('0x33')](_0x3d9063[_0x8355('0x30')][_0x8355('0x31')])){_0x3a807f=CAMPAIGN_STATUS[_0x8355('0x34')];}else if(_0x201138&&!timezones[_0x201138]){_0x3a807f=CAMPAIGN_STATUS['UNKNOWN_TIMEZONE'];}return _0x3a807f;}function checkAnyValidTrunk(_0x3e8025,_0x458196){var _0x133417=null;var _0x10df8c=_0x8355('0x35');var _0x2d8d38=['reachable',_0x8355('0x36')];var _0x272747=!![];if(_0x3e8025[_0x8355('0x2b')]&&_0x3e8025[_0x8355('0x2b')][_0x8355('0x1b')]){_0x10df8c+=_0x3e8025[_0x8355('0x2b')][_0x8355('0x2c')];_0x133417=_0x458196[_0x10df8c];_0x272747=_0x2d8d38[_0x8355('0x37')](_0x133417[_0x8355('0x38')]);}else if(_0x3e8025['TrunkBackup']&&_0x3e8025[_0x8355('0x39')][_0x8355('0x1b')]){_0x10df8c+=_0x3e8025[_0x8355('0x39')]['name'];_0x133417=_0x458196[_0x10df8c];_0x272747=_0x2d8d38[_0x8355('0x37')](_0x133417[_0x8355('0x38')]);}return _0x272747;}function getQueueCampaignStatusMessage(_0x2e2808,_0x4ebe79){var _0x4166a7=CAMPAIGN_STATUS[_0x8355('0x7')];var _0x577b56=isPreviewCampaign(_0x2e2808);if(!isQueueCampaignActive(_0x2e2808)){if(_0x577b56){_0x4166a7=CAMPAIGN_STATUS['INACTIVE'];}else{if(_0x2e2808[_0x8355('0x2a')]===0x0&&_0x2e2808['talking']===0x0&&_0x2e2808[_0x8355('0x28')]===0x0&&(_0x2e2808[_0x8355('0x27')]||0x0)===0x0){_0x4166a7=CAMPAIGN_STATUS[_0x8355('0x3a')];}else{_0x4166a7=CAMPAIGN_STATUS[_0x8355('0x3b')];}}}else if(_0x2e2808[_0x8355('0x23')]===0x0){_0x4166a7=CAMPAIGN_STATUS[_0x8355('0x3c')];}else if(!checkAnyValidTrunk(_0x2e2808,_0x4ebe79)){_0x4166a7=CAMPAIGN_STATUS[_0x8355('0x3d')];}else if(!isPreviewCampaign(_0x2e2808)){var _0x568c87=checkAnyValidQueueCampaignInterval(_0x2e2808);if(_0x568c87){_0x4166a7=_0x568c87;}}return _0x4166a7;}exports['getQueueCampaignStatusMessage']=getQueueCampaignStatusMessage;function getQueueCampaignActiveStatusMessage(_0x40131b){var _0xfd0d26=CAMPAIGN_STATUS[_0x8355('0x3b')];if(_0x40131b['originated']===0x0&&_0x40131b[_0x8355('0x26')]===0x0&&_0x40131b[_0x8355('0x28')]===0x0&&(_0x40131b[_0x8355('0x27')]||0x0)===0x0){_0xfd0d26=CAMPAIGN_STATUS[_0x8355('0x3a')];}return _0xfd0d26;}exports[_0x8355('0x3e')]=getQueueCampaignActiveStatusMessage;function extractCalleridName(_0x53b2b2){var _0x2934cf=_0x53b2b2['match'](/"(.*?)"/);return _0x2934cf?_0x2934cf[0x1]:_0x53b2b2;}exports[_0x8355('0x3f')]=extractCalleridName;function getCallerId(_0x7a2f99,_0x50f617,_0x2a8812){if(!_['isUndefined'](_0x2a8812)&&typeof _0x2a8812===_0x8355('0x40')&&!_[_0x8355('0x33')](_0x2a8812)){if(!_['isUndefined'](_0x50f617)&&typeof _0x50f617==='string'&&!_[_0x8355('0x33')](_0x50f617)){return util[_0x8355('0x41')](_0x8355('0x42'),_0x50f617,_0x2a8812);}return util[_0x8355('0x41')](_0x8355('0x42'),_0x2a8812,_0x2a8812);}if(!_['isUndefined'](_0x7a2f99)&&typeof _0x7a2f99===_0x8355('0x40')&&!_[_0x8355('0x33')](_0x7a2f99)){return _0x7a2f99;}return'\x22\x22\x20<>';}exports[_0x8355('0x43')]=getCallerId;function getCallerIdRandom(_0x188d0e,_0x399ba2){var _0x54245b;var _0x42fc2c;var _0x2a8f72;if(_0x399ba2<=0x0){_0x399ba2=0x1;}_0x54245b=new RegExp(_0x8355('0x44')+_0x399ba2+'}$');_0x42fc2c=Math[_0x8355('0x45')](0xa,_0x399ba2-0x1);_0x2a8f72=Math[_0x8355('0x45')](0xa,_0x399ba2)-0x1;return util[_0x8355('0x41')]('%s',_[_0x8355('0x46')](_0x188d0e,_0x54245b,_[_0x8355('0x47')](_0x42fc2c,_0x2a8f72)[_0x8355('0x48')]()));}exports[_0x8355('0x49')]=getCallerIdRandom;function decrementOriginate(_0x3d1bad){if(_0x3d1bad[_0x8355('0x2a')]&&_0x3d1bad[_0x8355('0x2a')]>0x0){_0x3d1bad['originated']-=0x1;}else{logger['error']('[decrementOriginate]\x20queue\x20originate\x20value\x20is\x20negative');}}exports[_0x8355('0x4a')]=decrementOriginate;function checkContactEmpty(_0x4fb69b){return _0x4fb69b&&_0x4fb69b[_0x8355('0x4b')]>0x0;}exports['checkContactEmpty']=checkContactEmpty;function erlangb(_0x4c277e,_0x2e4c07){if(_0x2e4c07===0x0){return 0x0;}var _0x51c5ed=0x1;for(var _0x314392=0x1;_0x314392<=_0x2e4c07;_0x314392+=0x1){_0x51c5ed=0x1+_0x51c5ed*_0x314392/_0x4c277e;}return 0x1/_0x51c5ed;}exports['erlangb']=erlangb;function checkContactLowerLimitOriginate(_0x379da5,_0x187f70,_0x45a357){if(_0x187f70>_0x45a357){for(var _0x3bf2cf=0x0;_0x3bf2cf<_0x187f70-_0x45a357;_0x3bf2cf+=0x1){decrementOriginate(_0x379da5);}}}exports['checkContactLowerLimitOriginate']=checkContactLowerLimitOriginate;function setXMDContactVariables(_0x40ad98){var _0x1c9005={};var _0x3ebce6=['id',_0x8355('0x4c'),_0x8355('0x4d'),'tags','updatedAt'];if(_0x40ad98){for(var _0x26975d in _0x40ad98){if(typeof _0x40ad98[_0x26975d]!=='undefined'){if(!_[_0x8355('0x2e')](_0x40ad98[_0x26975d])&&!_0x3ebce6[_0x8355('0x37')](_0x26975d)){_0x1c9005[util['format'](_0x8355('0x4e'),_0x8355('0x4f'),_0x26975d[_0x8355('0x50')]())]=_0x40ad98[_0x26975d];}}}}return _0x1c9005;}exports[_0x8355('0x51')]=setXMDContactVariables; \ No newline at end of file +var _0xba01=['length','createdAt','description','tags','updatedAt','XMD-','toUpperCase','setXMDContactVariables','lodash','moment','util','../../../../config/logger','dialer','../../../../config/environment/shared','timezones','ACTIVE','BLACKLIST','RESCHEDULED_CONTACTS','DEACTIVATED','IS_DISACTIVED','INTERVAL_IS_EMPTY','NOT_ACTIVE','AVAILABLE_CONTACTS_FINISHED','INTERVAL_IS_NULL','INTERVAL_IS_OVERTIME','GLOBAL_INTERVAL_IS_OVERTIME','RECALLINQUEUE','RECALLFAILEDTIMEOUT','RUNNING','TIMEZONE_UNKNOW','TRUNK_IS_NOT_REACHABLE','CAMPAIGN_STATUS','preview','type','ivr','outbound','isQueueCampaignActive','active','isIVRCampaignActive','milliseconds','diff','seconds','getSeconds','dialActive','message','available','loggedIn','loggedInDb','paused','talking','pTalking','waiting','inUse','originated','Trunk','name','hasQueueCampaignDataChanged','dialTimezone','dialGlobalInterval','isNil','Interval','NULL_INTERVAL','isEmpty','Intervals','UNKNOWN_TIMEZONE','SIP/','reachable','unmonitored','includes','status','TrunkBackup','INACTIVE','DISACTIVED','NO_AGENTS_LOGGED','getQueueCampaignStatusMessage','getQueueCampaignActiveStatusMessage','extractCalleridName','isUndefined','string','format','\x22%s\x22\x20<%s>','\x22\x22\x20<>','getCallerId','\x5cw{0,','random','[decrementOriginate]\x20queue\x20originate\x20value\x20is\x20negative','decrementOriginate'];(function(_0x406c4a,_0x5b7de9){var _0x4e49b4=function(_0xa6b273){while(--_0xa6b273){_0x406c4a['push'](_0x406c4a['shift']());}};_0x4e49b4(++_0x5b7de9);}(_0xba01,0x10d));var _0x1ba0=function(_0x18a636,_0x40543f){_0x18a636=_0x18a636-0x0;var _0x57feb5=_0xba01[_0x18a636];return _0x57feb5;};'use strict';var _=require(_0x1ba0('0x0'));var moment=require(_0x1ba0('0x1'));var util=require(_0x1ba0('0x2'));var logger=require(_0x1ba0('0x3'))(_0x1ba0('0x4'));var timezones=require(_0x1ba0('0x5'))[_0x1ba0('0x6')];var CAMPAIGN_STATUS={'ACTIVE':_0x1ba0('0x7'),'BLACKLIST':_0x1ba0('0x8'),'CONTACTS_RESCHEDULED':_0x1ba0('0x9'),'DEACTIVATED':_0x1ba0('0xa'),'DISACTIVED':_0x1ba0('0xb'),'EMPTY_INTERVAL':_0x1ba0('0xc'),'INACTIVE':_0x1ba0('0xd'),'NO_AGENTS_LOGGED':'AGENTS_NOT_LOGGED','NO_AVAILABLE_CONTACTS':_0x1ba0('0xe'),'NULL_INTERVAL':_0x1ba0('0xf'),'OVERTIME_INTERVAL':_0x1ba0('0x10'),'OVERTIME_GLOBAL_INTERVAL':_0x1ba0('0x11'),'QUEUE_RECALL':_0x1ba0('0x12'),'RECALL_TIMEOUT':_0x1ba0('0x13'),'RUNNING':_0x1ba0('0x14'),'UNKNOWN_TIMEZONE':_0x1ba0('0x15'),'UNREACHABLE_TRUNK':_0x1ba0('0x16')};exports[_0x1ba0('0x17')]=CAMPAIGN_STATUS;function isPreviewCampaign(_0xef157c){return _0xef157c['dialMethod']===_0x1ba0('0x18');}exports['isPreviewCampaign']=isPreviewCampaign;function isIVRCampaign(_0x33346f){return _0x33346f[_0x1ba0('0x19')]===_0x1ba0('0x1a');}exports['isIVRCampaign']=isIVRCampaign;function isOutboundQueue(_0x230cfd){return _0x230cfd[_0x1ba0('0x19')]===_0x1ba0('0x1b');}exports['isOutboundQueue']=isOutboundQueue;function isQueueCampaignActive(_0x425f2c){return _0x425f2c['dialActive'];}exports[_0x1ba0('0x1c')]=isQueueCampaignActive;function isIVRCampaignActive(_0x31fe4){return _0x31fe4[_0x1ba0('0x1d')];}exports[_0x1ba0('0x1e')]=isIVRCampaignActive;function getSeconds(_0x5f2c0a,_0x1d8cd){var _0x157245=moment(_0x5f2c0a)['milliseconds'](0x0);var _0x5a0237=moment(_0x1d8cd)[_0x1ba0('0x1f')](0x0);return _0x157245[_0x1ba0('0x20')](_0x5a0237,_0x1ba0('0x21'));}exports[_0x1ba0('0x22')]=getSeconds;function hasQueueCampaignDataChanged(_0x21f246,_0x1d4815){var _0x18b439=![];var _0x5c4ef1=_0x21f246['dialMethod']!==_0x1d4815['dialMethod']||_0x21f246['dialActive']!==_0x1d4815[_0x1ba0('0x23')]||_0x21f246[_0x1ba0('0x24')]!==_0x1d4815[_0x1ba0('0x24')];var _0x5e6305=_0x21f246['available']!==_0x1d4815[_0x1ba0('0x25')]||_0x21f246[_0x1ba0('0x26')]!==_0x1d4815[_0x1ba0('0x26')]||_0x21f246['loggedInDb']!==_0x1d4815[_0x1ba0('0x27')]||_0x21f246[_0x1ba0('0x28')]!==_0x1d4815[_0x1ba0('0x28')]||_0x21f246[_0x1ba0('0x29')]!==_0x1d4815[_0x1ba0('0x29')]||_0x21f246[_0x1ba0('0x2a')]!==_0x1d4815[_0x1ba0('0x2a')]||_0x21f246[_0x1ba0('0x2b')]!==_0x1d4815[_0x1ba0('0x2b')]||_0x21f246[_0x1ba0('0x2c')]!==_0x1d4815[_0x1ba0('0x2c')]||_0x21f246[_0x1ba0('0x2d')]!==_0x1d4815[_0x1ba0('0x2d')];if(_0x21f246[_0x1ba0('0x2e')]&&_0x1d4815[_0x1ba0('0x2e')]){_0x18b439=_0x21f246[_0x1ba0('0x2e')]['name']!==_0x1d4815[_0x1ba0('0x2e')][_0x1ba0('0x2f')]||_0x21f246[_0x1ba0('0x2e')][_0x1ba0('0x1d')]!==_0x1d4815[_0x1ba0('0x2e')][_0x1ba0('0x1d')];}return _0x5c4ef1||_0x5e6305||_0x18b439;}exports[_0x1ba0('0x30')]=hasQueueCampaignDataChanged;function checkAnyValidQueueCampaignInterval(_0x2798b2){var _0x43f5d6=null;var _0x44c6c9=_0x2798b2[_0x1ba0('0x31')];if(_['isNil'](_0x2798b2[_0x1ba0('0x32')])||_[_0x1ba0('0x33')](_0x2798b2[_0x1ba0('0x34')])||_[_0x1ba0('0x33')](_0x2798b2[_0x1ba0('0x34')]['Intervals'])){_0x43f5d6=CAMPAIGN_STATUS[_0x1ba0('0x35')];}else if(_[_0x1ba0('0x36')](_0x2798b2[_0x1ba0('0x32')])||_['isEmpty'](_0x2798b2[_0x1ba0('0x34')][_0x1ba0('0x37')])){_0x43f5d6=CAMPAIGN_STATUS['EMPTY_INTERVAL'];}else if(_0x44c6c9&&!timezones[_0x44c6c9]){_0x43f5d6=CAMPAIGN_STATUS[_0x1ba0('0x38')];}return _0x43f5d6;}function checkAnyValidTrunk(_0x5e6cb2,_0x51d376){var _0x11d0b5=null;var _0x3ba77b=_0x1ba0('0x39');var _0xc45c22=[_0x1ba0('0x3a'),_0x1ba0('0x3b')];var _0x3811ff=!![];if(_0x5e6cb2[_0x1ba0('0x2e')]&&_0x5e6cb2[_0x1ba0('0x2e')][_0x1ba0('0x1d')]){_0x3ba77b+=_0x5e6cb2[_0x1ba0('0x2e')][_0x1ba0('0x2f')];_0x11d0b5=_0x51d376[_0x3ba77b];_0x3811ff=_0xc45c22[_0x1ba0('0x3c')](_0x11d0b5[_0x1ba0('0x3d')]);}else if(_0x5e6cb2[_0x1ba0('0x3e')]&&_0x5e6cb2[_0x1ba0('0x3e')]['active']){_0x3ba77b+=_0x5e6cb2[_0x1ba0('0x3e')][_0x1ba0('0x2f')];_0x11d0b5=_0x51d376[_0x3ba77b];_0x3811ff=_0xc45c22[_0x1ba0('0x3c')](_0x11d0b5[_0x1ba0('0x3d')]);}return _0x3811ff;}function getQueueCampaignStatusMessage(_0x21bd94,_0x1c8b0e){var _0x1f16ea=CAMPAIGN_STATUS[_0x1ba0('0x7')];var _0x2216c1=isPreviewCampaign(_0x21bd94);if(!isQueueCampaignActive(_0x21bd94)){if(_0x2216c1){_0x1f16ea=CAMPAIGN_STATUS[_0x1ba0('0x3f')];}else{if(_0x21bd94[_0x1ba0('0x2d')]===0x0&&_0x21bd94[_0x1ba0('0x29')]===0x0&&_0x21bd94[_0x1ba0('0x2b')]===0x0&&(_0x21bd94[_0x1ba0('0x2a')]||0x0)===0x0){_0x1f16ea=CAMPAIGN_STATUS['INACTIVE'];}else{_0x1f16ea=CAMPAIGN_STATUS[_0x1ba0('0x40')];}}}else if(_0x21bd94[_0x1ba0('0x26')]===0x0){_0x1f16ea=CAMPAIGN_STATUS[_0x1ba0('0x41')];}else if(!checkAnyValidTrunk(_0x21bd94,_0x1c8b0e)){_0x1f16ea=CAMPAIGN_STATUS['UNREACHABLE_TRUNK'];}else if(!isPreviewCampaign(_0x21bd94)){var _0x4008b8=checkAnyValidQueueCampaignInterval(_0x21bd94);if(_0x4008b8){_0x1f16ea=_0x4008b8;}}return _0x1f16ea;}exports[_0x1ba0('0x42')]=getQueueCampaignStatusMessage;function getQueueCampaignActiveStatusMessage(_0x3379e4){var _0x46a464=CAMPAIGN_STATUS['DISACTIVED'];if(_0x3379e4[_0x1ba0('0x2d')]===0x0&&_0x3379e4[_0x1ba0('0x29')]===0x0&&_0x3379e4[_0x1ba0('0x2b')]===0x0&&(_0x3379e4[_0x1ba0('0x2a')]||0x0)===0x0){_0x46a464=CAMPAIGN_STATUS[_0x1ba0('0x3f')];}return _0x46a464;}exports[_0x1ba0('0x43')]=getQueueCampaignActiveStatusMessage;function extractCalleridName(_0x3e5e5a){var _0x4d809c=_0x3e5e5a['match'](/"(.*?)"/);return _0x4d809c?_0x4d809c[0x1]:_0x3e5e5a;}exports[_0x1ba0('0x44')]=extractCalleridName;function getCallerId(_0x3fe25c,_0x25ef3f,_0x30b88e){if(!_[_0x1ba0('0x45')](_0x30b88e)&&typeof _0x30b88e==='string'&&!_[_0x1ba0('0x36')](_0x30b88e)){if(!_[_0x1ba0('0x45')](_0x25ef3f)&&typeof _0x25ef3f===_0x1ba0('0x46')&&!_[_0x1ba0('0x36')](_0x25ef3f)){return util[_0x1ba0('0x47')]('\x22%s\x22\x20<%s>',_0x25ef3f,_0x30b88e);}return util[_0x1ba0('0x47')](_0x1ba0('0x48'),_0x30b88e,_0x30b88e);}if(!_[_0x1ba0('0x45')](_0x3fe25c)&&typeof _0x3fe25c==='string'&&!_[_0x1ba0('0x36')](_0x3fe25c)){return _0x3fe25c;}return _0x1ba0('0x49');}exports[_0x1ba0('0x4a')]=getCallerId;function getCallerIdRandom(_0x9fdc65,_0x3987d5){var _0x56ba80;var _0x2ab501;var _0x2b5dda;if(_0x3987d5<=0x0){_0x3987d5=0x1;}_0x56ba80=new RegExp(_0x1ba0('0x4b')+_0x3987d5+'}$');_0x2ab501=Math['pow'](0xa,_0x3987d5-0x1);_0x2b5dda=Math['pow'](0xa,_0x3987d5)-0x1;return util['format']('%s',_['replace'](_0x9fdc65,_0x56ba80,_[_0x1ba0('0x4c')](_0x2ab501,_0x2b5dda)['toString']()));}exports['getCallerIdRandom']=getCallerIdRandom;function decrementOriginate(_0x49503a){if(_0x49503a[_0x1ba0('0x2d')]&&_0x49503a[_0x1ba0('0x2d')]>0x0){_0x49503a[_0x1ba0('0x2d')]-=0x1;}else{logger['error'](_0x1ba0('0x4d'));}}exports[_0x1ba0('0x4e')]=decrementOriginate;function checkContactEmpty(_0x1ca653){return _0x1ca653&&_0x1ca653[_0x1ba0('0x4f')]>0x0;}exports['checkContactEmpty']=checkContactEmpty;function erlangb(_0xce4c32,_0x1d8c47){if(_0x1d8c47===0x0){return 0x0;}var _0x45b47f=0x1;for(var _0x49d76c=0x1;_0x49d76c<=_0x1d8c47;_0x49d76c+=0x1){_0x45b47f=0x1+_0x45b47f*_0x49d76c/_0xce4c32;}return 0x1/_0x45b47f;}exports['erlangb']=erlangb;function checkContactLowerLimitOriginate(_0x38949e,_0x483899,_0x470f4b){if(_0x483899>_0x470f4b){for(var _0x246e71=0x0;_0x246e71<_0x483899-_0x470f4b;_0x246e71+=0x1){decrementOriginate(_0x38949e);}}}exports['checkContactLowerLimitOriginate']=checkContactLowerLimitOriginate;function setXMDContactVariables(_0x5f1c30){var _0x59c7e5={};var _0x3d4d50=['id',_0x1ba0('0x50'),_0x1ba0('0x51'),_0x1ba0('0x52'),_0x1ba0('0x53')];if(_0x5f1c30){for(var _0x57916a in _0x5f1c30){if(typeof _0x5f1c30[_0x57916a]!=='undefined'){if(!_[_0x1ba0('0x33')](_0x5f1c30[_0x57916a])&&!_0x3d4d50[_0x1ba0('0x3c')](_0x57916a)){_0x59c7e5[util[_0x1ba0('0x47')]('%s%s',_0x1ba0('0x54'),_0x57916a[_0x1ba0('0x55')]())]=_0x5f1c30[_0x57916a];}}}}return _0x59c7e5;}exports[_0x1ba0('0x56')]=setXMDContactVariables; \ No newline at end of file diff --git a/server/services/ami/fax/action.js b/server/services/ami/fax/action.js index 52f302a..e14508e 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(_0x4d49d8,_0x1eb52d){var _0x2873f0=function(_0xb2dd57){while(--_0xb2dd57){_0x4d49d8['push'](_0x4d49d8['shift']());}};_0x2873f0(++_0x1eb52d);}(_0xa9e0,0x123));var _0x0a9e=function(_0x92c450,_0x41f1e3){_0x92c450=_0x92c450-0x0;var _0x2a9599=_0xa9e0[_0x92c450];return _0x2a9599;};'use strict';var util=require(_0x0a9e('0x0'));var _=require(_0x0a9e('0x1'));var 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(_0xb715dc,_0x5c039e){var _0x8521e9=function(_0x238a0f){while(--_0x238a0f){_0xb715dc['push'](_0xb715dc['shift']());}};_0x8521e9(++_0x5c039e);}(_0xa9e0,0x123));var _0x0a9e=function(_0x2f3848,_0x48564d){_0x2f3848=_0x2f3848-0x0;var _0x102668=_0xa9e0[_0x2f3848];return _0x102668;};'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 f017632..0ce6239 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 _0xab34=['Is\x20Valid','exports','util','lodash','bluebird','uuid','moment','path','./util/gs','fax','../ami','./rpcDb','./util/util','./action','../rpc/faxAccount','../rpc/attachment','../rpc/faxMessage','channels','faxAccounts','trunks','actions','newchannel','syncNewchannel','bind','syncVarSet','syncNewState','syncNewExten','syncFaxStatus','syncReceiveFax','hangup','syncOriginateResponse','prototype','context','from-voip-provider','hasOwnProperty','exten','uniqueid','channel','name','info','\x20syncNewchannel\x20','variable','value','channelstate','channelstatedesc','operation','status','localstationid','filename','\x20syncFaxStatus\x20','remotestationid','pagestransferred','transferrate','calleridnum','\x20result\x20conversion\x20file\x20','create','parse','application/pdf','then','notify','.pdf','catch','error','\x20notify\x20','\x20receiveFax\x20','stringify','merge','response','reason','update','logger','[Fax][Message][Error][Updated]','[Fax][Message][Error][NoUpdate1]','[Fax][Message][Error][NoUpdate2]','updateStatus','AttachmentId','[Fax][Message][NoUpdate1]','[Fax][Message][NoUpdate2]','syncHangup','faxpages','faxstatus','SUCCESS','faxstatusstring','execOriginate','FaxAccountId','[Fax][execOriginate][success]','message','Fax\x20received','[Fax][execOriginate][failure]','Fax\x20failed','checkTrunk','Trunk','isValid','format','gs\x20-q\x20-dNOPAUSE\x20-dBATCH\x20-sDEVICE=tiffg4\x20-sPAPERSIZE=letter\x20-sOutputFile=/var/opt/motion2/server/files/attachments/%s.tif\x20\x20%s\x20-c\x20quit','execute','%s/%s.tif','dir','XMF-PATH','Convert\x20pdf\x20to\x20tif','variablesAction','Action','addVariables','ext','isNil','active','SIP/%s','reachable','unmonitored','[Fax][checkTrunk][Trunk\x20not\x20working\x20correctly]','\x20Trunk\x20is\x20not\x20active','Trunk\x20not\x20working\x20correctly','Empty\x20Fax','[Fax][checkTrunk][Empty\x20path]','Empty\x20path'];(function(_0x228b96,_0x5c02fd){var _0x32fe9a=function(_0x25e29d){while(--_0x25e29d){_0x228b96['push'](_0x228b96['shift']());}};_0x32fe9a(++_0x5c02fd);}(_0xab34,0xe8));var _0x4ab3=function(_0x2dc5fb,_0x5d0ad4){_0x2dc5fb=_0x2dc5fb-0x0;var _0x282c17=_0xab34[_0x2dc5fb];return _0x282c17;};'use strict';var util=require(_0x4ab3('0x0'));var _=require(_0x4ab3('0x1'));var BPromise=require(_0x4ab3('0x2'));var uuid=require(_0x4ab3('0x3'));var moment=require(_0x4ab3('0x4'));var path=require(_0x4ab3('0x5'));var tiff2pdf=require('tiff2pdf');var gs=require(_0x4ab3('0x6'));var logger=require('../../../config/logger')(_0x4ab3('0x7'));var ami=require(_0x4ab3('0x8'));var rpcDb=require(_0x4ab3('0x9'));var Channel=require('./channel');var ut=require(_0x4ab3('0xa'));var Action=require(_0x4ab3('0xb'));var faxAccount=require(_0x4ab3('0xc'));var attachment=require(_0x4ab3('0xd'));var faxMessage=require(_0x4ab3('0xe'));function Fax(_0x4a0f11){this[_0x4ab3('0xf')]={};this[_0x4ab3('0x10')]=_0x4a0f11[_0x4ab3('0x10')];this['trunks']=_0x4a0f11[_0x4ab3('0x11')];this[_0x4ab3('0x12')]={};ami['on'](_0x4ab3('0x13'),this[_0x4ab3('0x14')][_0x4ab3('0x15')](this));ami['on']('varset',this[_0x4ab3('0x16')][_0x4ab3('0x15')](this));ami['on']('newstate',this[_0x4ab3('0x17')][_0x4ab3('0x15')](this));ami['on']('newexten',this[_0x4ab3('0x18')][_0x4ab3('0x15')](this));ami['on']('faxstatus',this[_0x4ab3('0x19')][_0x4ab3('0x15')](this));ami['on']('receivefax',this[_0x4ab3('0x1a')][_0x4ab3('0x15')](this));ami['on'](_0x4ab3('0x1b'),this['syncHangup'][_0x4ab3('0x15')](this));ami['on']('originateresponse',this[_0x4ab3('0x1c')]['bind'](this));}Fax[_0x4ab3('0x1d')][_0x4ab3('0x14')]=function(_0x299743){if(_0x299743[_0x4ab3('0x1e')]===_0x4ab3('0x1f')){for(var _0x1bda8c in this['faxAccounts']){if(this['faxAccounts'][_0x4ab3('0x20')](_0x1bda8c)){if(_0x299743[_0x4ab3('0x21')]===this[_0x4ab3('0x10')][_0x1bda8c]['localstationid']){this[_0x4ab3('0xf')][_0x299743[_0x4ab3('0x22')]]={};this[_0x4ab3('0xf')][_0x299743[_0x4ab3('0x22')]][_0x4ab3('0x23')]=_0x299743[_0x4ab3('0x23')];this[_0x4ab3('0xf')][_0x299743['uniqueid']]['id']=this['faxAccounts'][_0x1bda8c]['id'];this[_0x4ab3('0xf')][_0x299743[_0x4ab3('0x22')]][_0x4ab3('0x24')]=this[_0x4ab3('0x10')][_0x1bda8c][_0x4ab3('0x24')];logger[_0x4ab3('0x25')](_0x299743[_0x4ab3('0x22')],_0x4ab3('0x26'));}}}}if(this[_0x4ab3('0x12')][_0x299743[_0x4ab3('0x22')]]){this[_0x4ab3('0xf')][_0x299743[_0x4ab3('0x22')]]={};this['channels'][_0x299743[_0x4ab3('0x22')]][_0x4ab3('0x23')]=_0x299743[_0x4ab3('0x23')];logger[_0x4ab3('0x25')](_0x299743[_0x4ab3('0x22')],'\x20syncNewchannel\x20');}};Fax[_0x4ab3('0x1d')][_0x4ab3('0x16')]=function(_0x5e7091){if(this[_0x4ab3('0xf')][_0x5e7091[_0x4ab3('0x22')]]){for(var _0x512843 in _0x5e7091['variable']){if(_0x5e7091[_0x4ab3('0x27')]['hasOwnProperty'](_0x512843)){this[_0x4ab3('0xf')][_0x5e7091[_0x4ab3('0x22')]][_0x512843]=_0x5e7091[_0x4ab3('0x28')];}}}};Fax[_0x4ab3('0x1d')][_0x4ab3('0x17')]=function(_0x5059e3){if(this[_0x4ab3('0xf')][_0x5059e3[_0x4ab3('0x22')]]){this['channels'][_0x5059e3[_0x4ab3('0x22')]][_0x4ab3('0x29')]=_0x5059e3[_0x4ab3('0x29')];this[_0x4ab3('0xf')][_0x5059e3[_0x4ab3('0x22')]][_0x4ab3('0x2a')]=_0x5059e3['channelstatedesc'];}};Fax[_0x4ab3('0x1d')][_0x4ab3('0x18')]=function(_0x420cf0){if(this[_0x4ab3('0xf')][_0x420cf0[_0x4ab3('0x22')]]){for(var _0x456dd6 in _0x420cf0[_0x4ab3('0x27')]){if(_0x420cf0[_0x4ab3('0x27')]['hasOwnProperty'](_0x456dd6)){this[_0x4ab3('0xf')][_0x420cf0['uniqueid']][_0x456dd6]=_0x420cf0[_0x4ab3('0x28')];}}}};Fax[_0x4ab3('0x1d')][_0x4ab3('0x19')]=function(_0x4e37fd){if(this[_0x4ab3('0xf')][_0x4e37fd[_0x4ab3('0x22')]]){this[_0x4ab3('0xf')][_0x4e37fd[_0x4ab3('0x22')]][_0x4ab3('0x2b')]=_0x4e37fd[_0x4ab3('0x2b')];this[_0x4ab3('0xf')][_0x4e37fd[_0x4ab3('0x22')]]['status']=_0x4e37fd[_0x4ab3('0x2c')];this[_0x4ab3('0xf')][_0x4e37fd[_0x4ab3('0x22')]]['localstationid']=_0x4e37fd[_0x4ab3('0x2d')];this[_0x4ab3('0xf')][_0x4e37fd[_0x4ab3('0x22')]]['filename']=_0x4e37fd[_0x4ab3('0x2e')];logger[_0x4ab3('0x25')](_0x4e37fd[_0x4ab3('0x22')],_0x4ab3('0x2f'));}};Fax[_0x4ab3('0x1d')][_0x4ab3('0x1a')]=function(_0x3ce5c7){var _0x21328e=this;if(this[_0x4ab3('0xf')][_0x3ce5c7[_0x4ab3('0x22')]]){var _0x4ee722=this[_0x4ab3('0xf')][_0x3ce5c7[_0x4ab3('0x22')]]['id'];this[_0x4ab3('0xf')][_0x3ce5c7[_0x4ab3('0x22')]][_0x4ab3('0x30')]=_0x3ce5c7[_0x4ab3('0x30')];this[_0x4ab3('0xf')][_0x3ce5c7['uniqueid']][_0x4ab3('0x31')]=_0x3ce5c7[_0x4ab3('0x31')];this[_0x4ab3('0xf')][_0x3ce5c7[_0x4ab3('0x22')]][_0x4ab3('0x2d')]=_0x3ce5c7[_0x4ab3('0x2d')];this[_0x4ab3('0xf')][_0x3ce5c7['uniqueid']]['resolution']=_0x3ce5c7['resolution'];this['channels'][_0x3ce5c7[_0x4ab3('0x22')]][_0x4ab3('0x32')]=_0x3ce5c7[_0x4ab3('0x32')];this[_0x4ab3('0xf')][_0x3ce5c7['uniqueid']][_0x4ab3('0x2e')]=_0x3ce5c7[_0x4ab3('0x2e')];this[_0x4ab3('0xf')][_0x3ce5c7[_0x4ab3('0x22')]][_0x4ab3('0x33')]=_0x3ce5c7['calleridnum'];if(this[_0x4ab3('0xf')][_0x3ce5c7[_0x4ab3('0x22')]][_0x4ab3('0x31')]>0x0){tiff2pdf(_0x3ce5c7[_0x4ab3('0x2e')],'/var/opt/motion2/server/files/attachments/',function(_0x2f0a23){logger[_0x4ab3('0x25')](_0x3ce5c7[_0x4ab3('0x22')],_0x4ab3('0x34'),_0x2f0a23['message']);attachment[_0x4ab3('0x35')]({'name':path['parse'](_0x3ce5c7[_0x4ab3('0x2e')])[_0x4ab3('0x24')],'basename':path[_0x4ab3('0x36')](_0x3ce5c7[_0x4ab3('0x2e')])[_0x4ab3('0x24')]+'.pdf','type':_0x4ab3('0x37')})[_0x4ab3('0x38')](function(_0x1b4ee1){faxAccount[_0x4ab3('0x39')](_0x4ee722,{'from':_0x3ce5c7['calleridnum'],'mapKey':_0x4ab3('0x7'),'body':path[_0x4ab3('0x36')](_0x3ce5c7[_0x4ab3('0x2e')])[_0x4ab3('0x24')]+_0x4ab3('0x3a'),'AttachmentId':_0x1b4ee1['id']})[_0x4ab3('0x3b')](function(_0x3d758c){logger[_0x4ab3('0x3c')](_0x3ce5c7[_0x4ab3('0x22')],_0x4ab3('0x3d'),JSON['stringify'](_0x3d758c));});})[_0x4ab3('0x3b')](function(_0x57c7bd){logger['error'](_0x3ce5c7[_0x4ab3('0x22')],_0x4ab3('0x3e'),JSON[_0x4ab3('0x3f')](_0x57c7bd));});});}logger[_0x4ab3('0x25')](_0x3ce5c7[_0x4ab3('0x22')],_0x4ab3('0x3e'));}};Fax[_0x4ab3('0x1d')][_0x4ab3('0x1c')]=function(_0x486f01){if(this[_0x4ab3('0x12')][_0x486f01['uniqueid']]){_[_0x4ab3('0x40')](this[_0x4ab3('0xf')][_0x486f01[_0x4ab3('0x22')]],_['pick'](_0x486f01,[_0x4ab3('0x41'),_0x4ab3('0x42')]));}};function updateStatus(_0x1e489b){if(_0x1e489b['AttachmentId']){faxMessage[_0x4ab3('0x43')](_0x1e489b['AttachmentId'],{'failMessage':'SENDING\x20FAILED\x20'})[_0x4ab3('0x38')](function(_0x58cba5){ut[_0x4ab3('0x44')](_0x4ab3('0x45'),_0x58cba5);})[_0x4ab3('0x3b')](function(_0x5d0694){ut[_0x4ab3('0x44')](_0x4ab3('0x46'),_0x5d0694);});}else{ut[_0x4ab3('0x44')](_0x4ab3('0x47'));}}Fax[_0x4ab3('0x1d')][_0x4ab3('0x48')]=function(_0x5baf92,_0x736921,_0x10a098){var _0x4f83c5=this;var _0x7d7e3b={};if(_0x736921){_0x7d7e3b={'read':_0x736921};}else{_0x7d7e3b={'failMessage':_0x10a098};}if(this[_0x4ab3('0x12')][_0x5baf92][_0x4ab3('0x49')]){faxMessage[_0x4ab3('0x43')](this[_0x4ab3('0x12')][_0x5baf92][_0x4ab3('0x49')],_0x7d7e3b)[_0x4ab3('0x38')](function(_0x17c1c3){ut[_0x4ab3('0x44')]('[Fax][Message][Updated]',_0x17c1c3);})[_0x4ab3('0x3b')](function(_0x180222){ut[_0x4ab3('0x44')](_0x4ab3('0x4a'),_0x180222);})['finally'](function(){delete _0x4f83c5[_0x4ab3('0xf')][_0x5baf92];delete _0x4f83c5[_0x4ab3('0x12')][_0x5baf92];});}else{ut[_0x4ab3('0x44')](_0x4ab3('0x4b'));delete this['channels'][_0x5baf92];delete this[_0x4ab3('0x12')][_0x5baf92];}};Fax['prototype'][_0x4ab3('0x4c')]=function(_0x2bbd69){var _0x5c347b=this;if(this[_0x4ab3('0xf')][_0x2bbd69[_0x4ab3('0x22')]]){if(this[_0x4ab3('0x12')][_0x2bbd69[_0x4ab3('0x22')]]){this[_0x4ab3('0xf')][_0x2bbd69[_0x4ab3('0x22')]]['id']=this[_0x4ab3('0x12')][_0x2bbd69['uniqueid']]['id'];this[_0x4ab3('0xf')][_0x2bbd69[_0x4ab3('0x22')]][_0x4ab3('0x24')]=this['actions'][_0x2bbd69[_0x4ab3('0x22')]][_0x4ab3('0x24')];}logger[_0x4ab3('0x25')](_0x2bbd69[_0x4ab3('0x22')],this[_0x4ab3('0x12')][_0x2bbd69[_0x4ab3('0x22')]]?'\x20hangup\x20sendFile\x20':'\x20hangup\x20faxRiceive\x20',JSON[_0x4ab3('0x3f')](this['channels'][_0x2bbd69[_0x4ab3('0x22')]]));if(this[_0x4ab3('0x12')][_0x2bbd69['uniqueid']]){if(this[_0x4ab3('0xf')][_0x2bbd69['uniqueid']][_0x4ab3('0x4d')]>0x0&&this[_0x4ab3('0xf')][_0x2bbd69[_0x4ab3('0x22')]][_0x4ab3('0x4e')]===_0x4ab3('0x4f')){this['updateStatus'](_0x2bbd69[_0x4ab3('0x22')],!![]);}else{this[_0x4ab3('0x48')](_0x2bbd69[_0x4ab3('0x22')],![],this[_0x4ab3('0xf')][_0x2bbd69['uniqueid']][_0x4ab3('0x50')]?'SENDING\x20FAILED:\x20'+this['channels'][_0x2bbd69[_0x4ab3('0x22')]][_0x4ab3('0x50')]:'SENDING\x20FAILED');}}}};Fax['prototype']['send']=function(_0x593604){var _0xaf2c34=this;return new BPromise(function(_0x2b0ead,_0x41650d){_0xaf2c34[_0x4ab3('0x51')](_0x593604,_0xaf2c34[_0x4ab3('0x10')][_0x593604[_0x4ab3('0x52')]])[_0x4ab3('0x38')](function(_0x107de0){ut['logger'](_0x4ab3('0x53'),_0x107de0);_0x2b0ead(ut[_0x4ab3('0x54')](_0x4ab3('0x55')));})[_0x4ab3('0x3b')](function(_0x2ecca5){ut[_0x4ab3('0x44')](_0x4ab3('0x56'),_0x2ecca5);updateStatus(_0x593604);_0x41650d(ut[_0x4ab3('0x54')](_0x4ab3('0x57')));});});};Fax[_0x4ab3('0x1d')]['checkAfterSend']=function(_0x1bb941){var _0x726d07=this;return new BPromise(function(_0x40c200,_0x3c59bb){var _0x35b1b4=_0x726d07[_0x4ab3('0x58')](_0x726d07[_0x4ab3('0x10')][_0x1bb941[_0x4ab3('0x52')]][_0x4ab3('0x59')],_0x1bb941);if(_0x35b1b4[_0x4ab3('0x5a')]){_0x40c200(ut['message']('Trunk\x20Reachable'));}else{_0x3c59bb(ut['message'](_0x35b1b4[_0x4ab3('0x54')]));}});};function originate(_0x3f5740,_0x5b310a,_0x8fb46e){return new BPromise(function(_0x37e1d4,_0x1c745f){if(_0x8fb46e){var _0x15fb60=util[_0x4ab3('0x5b')](_0x4ab3('0x5c'),path[_0x4ab3('0x36')](_0x3f5740['path'])[_0x4ab3('0x24')],_0x3f5740[_0x4ab3('0x5')]);gs[_0x4ab3('0x5d')](_0x15fb60)[_0x4ab3('0x38')](function(){_0x3f5740[_0x4ab3('0x5')]=util['format'](_0x4ab3('0x5e'),path['parse'](_0x3f5740['path'])[_0x4ab3('0x5f')],path[_0x4ab3('0x36')](_0x3f5740[_0x4ab3('0x5')])[_0x4ab3('0x24')]);_0x5b310a[_0x4ab3('0x60')]=_0x3f5740[_0x4ab3('0x5')];ut[_0x4ab3('0x44')](_0x4ab3('0x61'),'');ami['Action'](ut[_0x4ab3('0x62')](_0x3f5740,_0x5b310a))['then'](function(_0x132f91){_0x37e1d4(_0x132f91);})[_0x4ab3('0x3b')](function(_0x95e693){_0x1c745f(_0x95e693);});})[_0x4ab3('0x3b')](function(_0x23ddc8){_0x1c745f(_0x23ddc8);});}else{ami[_0x4ab3('0x63')](ut[_0x4ab3('0x62')](_0x3f5740,_0x5b310a))['then'](function(_0x5e45f2){_0x37e1d4(_0x5e45f2);})[_0x4ab3('0x3b')](function(_0xe6a6ab){_0x1c745f(_0xe6a6ab);});}});}Fax['prototype']['execOriginate']=function(_0x526997,_0x2ee73a){var _0x50a0cb=this;return new BPromise(function(_0x432039,_0x30fc9e){var _0x13de67=uuid['v4']();var _0xaa7d76=ut[_0x4ab3('0x64')](_0x526997,_0x2ee73a);_0x50a0cb[_0x4ab3('0x12')][_0x13de67]=new Action(_0x13de67,_0x2ee73a,_0x526997);var _0x1356ee=_0x50a0cb[_0x4ab3('0x12')][_0x13de67];if(path['parse'](_0x526997[_0x4ab3('0x5')])[_0x4ab3('0x65')]===_0x4ab3('0x3a')){originate(_0x1356ee,_0xaa7d76,!![])[_0x4ab3('0x38')](function(_0x16fa50){_0x432039(_0x16fa50);})[_0x4ab3('0x3b')](function(_0x40724d){_0x30fc9e(_0x40724d);});}else{originate(_0x1356ee,_0xaa7d76,![])[_0x4ab3('0x38')](function(_0xdef802){_0x432039(_0xdef802);})[_0x4ab3('0x3b')](function(_0x35800b){_0x30fc9e(_0x35800b);});}});};Fax[_0x4ab3('0x1d')]['isTrunkReachable']=function(_0x2d7814){return!_[_0x4ab3('0x66')](_0x2d7814)&&!_[_0x4ab3('0x66')](_0x2d7814[_0x4ab3('0x24')])&&!_[_0x4ab3('0x66')](_0x2d7814[_0x4ab3('0x67')])&&_0x2d7814[_0x4ab3('0x67')]&&!_[_0x4ab3('0x66')](this[_0x4ab3('0x11')][util[_0x4ab3('0x5b')]('SIP/%s',_0x2d7814['name'])])&&!_['isNil'](this[_0x4ab3('0x11')][util[_0x4ab3('0x5b')](_0x4ab3('0x68'),_0x2d7814[_0x4ab3('0x24')])]['status'])&&(this[_0x4ab3('0x11')][util[_0x4ab3('0x5b')]('SIP/%s',_0x2d7814[_0x4ab3('0x24')])][_0x4ab3('0x2c')]===_0x4ab3('0x69')||this[_0x4ab3('0x11')][util[_0x4ab3('0x5b')](_0x4ab3('0x68'),_0x2d7814['name'])][_0x4ab3('0x2c')]===_0x4ab3('0x6a'));};Fax[_0x4ab3('0x1d')][_0x4ab3('0x58')]=function(_0x1a320d,_0x295d06){if(!this['isTrunkReachable'](_0x1a320d)){ut[_0x4ab3('0x44')](_0x4ab3('0x6b'),_['isNil'](_0x1a320d)?'':_0x1a320d[_0x4ab3('0x24')]+_0x4ab3('0x6c'));return{'isValid':![],'message':_0x4ab3('0x6d')};}if(_[_0x4ab3('0x66')](_0x295d06[_0x4ab3('0x7')])){ut[_0x4ab3('0x44')]('[Fax][checkTrunk][Empty\x20Fax]',JSON[_0x4ab3('0x3f')](_0x295d06));return{'isValid':![],'message':_0x4ab3('0x6e')};}if(_[_0x4ab3('0x66')](_0x295d06[_0x4ab3('0x5')])){ut[_0x4ab3('0x44')](_0x4ab3('0x6f'),JSON['stringify'](_0x295d06));return{'isValid':![],'message':_0x4ab3('0x70')};}return{'isValid':!![],'message':_0x4ab3('0x71')};};module[_0x4ab3('0x72')]=Fax; \ No newline at end of file +var _0x9c90=['dir','XMF-PATH','variablesAction','execOriginate','addVariables','ext','isNil','active','SIP/%s','reachable','checkTrunk','isTrunkReachable','[Fax][checkTrunk][Trunk\x20not\x20working\x20correctly]','\x20Trunk\x20is\x20not\x20active','Trunk\x20not\x20working\x20correctly','[Fax][checkTrunk][Empty\x20Fax]','stringify','Empty\x20path','util','bluebird','moment','path','../../../config/logger','fax','../ami','./rpcDb','./util/util','../rpc/faxAccount','channels','faxAccounts','trunks','actions','newchannel','syncNewchannel','varset','syncVarSet','bind','newstate','syncNewState','newexten','syncNewExten','faxstatus','syncFaxStatus','hangup','syncHangup','originateresponse','syncOriginateResponse','prototype','from-voip-provider','hasOwnProperty','localstationid','uniqueid','channel','name','info','\x20syncNewchannel\x20','variable','value','channelstate','channelstatedesc','operation','status','filename','\x20syncFaxStatus\x20','remotestationid','resolution','transferrate','calleridnum','pagestransferred','/var/opt/motion2/server/files/attachments/','\x20result\x20conversion\x20file\x20','message','create','parse','.pdf','application/pdf','catch','error','\x20notify\x20','\x20receiveFax\x20','pick','reason','AttachmentId','update','then','[Fax][Message][Error][Updated]','logger','[Fax][Message][Error][NoUpdate1]','[Fax][Message][Error][NoUpdate2]','updateStatus','[Fax][Message][Updated]','[Fax][Message][NoUpdate1]','finally','[Fax][Message][NoUpdate2]','\x20hangup\x20sendFile\x20','\x20hangup\x20faxRiceive\x20','SUCCESS','faxstatusstring','SENDING\x20FAILED','send','[Fax][execOriginate][success]','Fax\x20received','[Fax][execOriginate][failure]','Fax\x20failed','FaxAccountId','Trunk','isValid','Trunk\x20Reachable','format','gs\x20-q\x20-dNOPAUSE\x20-dBATCH\x20-sDEVICE=tiffg4\x20-sPAPERSIZE=letter\x20-sOutputFile=/var/opt/motion2/server/files/attachments/%s.tif\x20\x20%s\x20-c\x20quit','%s/%s.tif'];(function(_0x28f8ce,_0x112706){var _0x20ad2d=function(_0x1dcfc3){while(--_0x1dcfc3){_0x28f8ce['push'](_0x28f8ce['shift']());}};_0x20ad2d(++_0x112706);}(_0x9c90,0x1ce));var _0x09c9=function(_0x1b8e60,_0x21b885){_0x1b8e60=_0x1b8e60-0x0;var _0x363363=_0x9c90[_0x1b8e60];return _0x363363;};'use strict';var util=require(_0x09c9('0x0'));var _=require('lodash');var BPromise=require(_0x09c9('0x1'));var uuid=require('uuid');var moment=require(_0x09c9('0x2'));var path=require(_0x09c9('0x3'));var tiff2pdf=require('tiff2pdf');var gs=require('./util/gs');var logger=require(_0x09c9('0x4'))(_0x09c9('0x5'));var ami=require(_0x09c9('0x6'));var rpcDb=require(_0x09c9('0x7'));var Channel=require('./channel');var ut=require(_0x09c9('0x8'));var Action=require('./action');var faxAccount=require(_0x09c9('0x9'));var attachment=require('../rpc/attachment');var faxMessage=require('../rpc/faxMessage');function Fax(_0x3b1956){this[_0x09c9('0xa')]={};this[_0x09c9('0xb')]=_0x3b1956['faxAccounts'];this[_0x09c9('0xc')]=_0x3b1956[_0x09c9('0xc')];this[_0x09c9('0xd')]={};ami['on'](_0x09c9('0xe'),this[_0x09c9('0xf')]['bind'](this));ami['on'](_0x09c9('0x10'),this[_0x09c9('0x11')][_0x09c9('0x12')](this));ami['on'](_0x09c9('0x13'),this[_0x09c9('0x14')][_0x09c9('0x12')](this));ami['on'](_0x09c9('0x15'),this[_0x09c9('0x16')]['bind'](this));ami['on'](_0x09c9('0x17'),this[_0x09c9('0x18')][_0x09c9('0x12')](this));ami['on']('receivefax',this['syncReceiveFax'][_0x09c9('0x12')](this));ami['on'](_0x09c9('0x19'),this[_0x09c9('0x1a')]['bind'](this));ami['on'](_0x09c9('0x1b'),this[_0x09c9('0x1c')][_0x09c9('0x12')](this));}Fax[_0x09c9('0x1d')][_0x09c9('0xf')]=function(_0x1f1364){if(_0x1f1364['context']===_0x09c9('0x1e')){for(var _0x3647bb in this[_0x09c9('0xb')]){if(this[_0x09c9('0xb')][_0x09c9('0x1f')](_0x3647bb)){if(_0x1f1364['exten']===this['faxAccounts'][_0x3647bb][_0x09c9('0x20')]){this[_0x09c9('0xa')][_0x1f1364['uniqueid']]={};this[_0x09c9('0xa')][_0x1f1364[_0x09c9('0x21')]][_0x09c9('0x22')]=_0x1f1364[_0x09c9('0x22')];this['channels'][_0x1f1364[_0x09c9('0x21')]]['id']=this[_0x09c9('0xb')][_0x3647bb]['id'];this[_0x09c9('0xa')][_0x1f1364[_0x09c9('0x21')]][_0x09c9('0x23')]=this[_0x09c9('0xb')][_0x3647bb][_0x09c9('0x23')];logger[_0x09c9('0x24')](_0x1f1364['uniqueid'],'\x20syncNewchannel\x20');}}}}if(this[_0x09c9('0xd')][_0x1f1364['uniqueid']]){this['channels'][_0x1f1364[_0x09c9('0x21')]]={};this[_0x09c9('0xa')][_0x1f1364['uniqueid']][_0x09c9('0x22')]=_0x1f1364[_0x09c9('0x22')];logger['info'](_0x1f1364[_0x09c9('0x21')],_0x09c9('0x25'));}};Fax['prototype'][_0x09c9('0x11')]=function(_0xb32e18){if(this['channels'][_0xb32e18['uniqueid']]){for(var _0x45240f in _0xb32e18[_0x09c9('0x26')]){if(_0xb32e18[_0x09c9('0x26')][_0x09c9('0x1f')](_0x45240f)){this[_0x09c9('0xa')][_0xb32e18[_0x09c9('0x21')]][_0x45240f]=_0xb32e18[_0x09c9('0x27')];}}}};Fax[_0x09c9('0x1d')][_0x09c9('0x14')]=function(_0x39d87a){if(this[_0x09c9('0xa')][_0x39d87a[_0x09c9('0x21')]]){this['channels'][_0x39d87a['uniqueid']][_0x09c9('0x28')]=_0x39d87a['channelstate'];this[_0x09c9('0xa')][_0x39d87a['uniqueid']][_0x09c9('0x29')]=_0x39d87a[_0x09c9('0x29')];}};Fax[_0x09c9('0x1d')][_0x09c9('0x16')]=function(_0x604d49){if(this[_0x09c9('0xa')][_0x604d49[_0x09c9('0x21')]]){for(var _0x46bc8b in _0x604d49[_0x09c9('0x26')]){if(_0x604d49[_0x09c9('0x26')][_0x09c9('0x1f')](_0x46bc8b)){this['channels'][_0x604d49[_0x09c9('0x21')]][_0x46bc8b]=_0x604d49[_0x09c9('0x27')];}}}};Fax[_0x09c9('0x1d')][_0x09c9('0x18')]=function(_0x3cdc41){if(this['channels'][_0x3cdc41[_0x09c9('0x21')]]){this[_0x09c9('0xa')][_0x3cdc41[_0x09c9('0x21')]][_0x09c9('0x2a')]=_0x3cdc41[_0x09c9('0x2a')];this[_0x09c9('0xa')][_0x3cdc41[_0x09c9('0x21')]][_0x09c9('0x2b')]=_0x3cdc41['status'];this[_0x09c9('0xa')][_0x3cdc41[_0x09c9('0x21')]]['localstationid']=_0x3cdc41['localstationid'];this['channels'][_0x3cdc41[_0x09c9('0x21')]][_0x09c9('0x2c')]=_0x3cdc41[_0x09c9('0x2c')];logger[_0x09c9('0x24')](_0x3cdc41['uniqueid'],_0x09c9('0x2d'));}};Fax[_0x09c9('0x1d')]['syncReceiveFax']=function(_0x315670){var _0x4ff988=this;if(this['channels'][_0x315670['uniqueid']]){var _0x2d8493=this['channels'][_0x315670['uniqueid']]['id'];this[_0x09c9('0xa')][_0x315670[_0x09c9('0x21')]]['remotestationid']=_0x315670[_0x09c9('0x2e')];this[_0x09c9('0xa')][_0x315670[_0x09c9('0x21')]]['pagestransferred']=_0x315670['pagestransferred'];this[_0x09c9('0xa')][_0x315670[_0x09c9('0x21')]][_0x09c9('0x20')]=_0x315670[_0x09c9('0x20')];this[_0x09c9('0xa')][_0x315670['uniqueid']][_0x09c9('0x2f')]=_0x315670[_0x09c9('0x2f')];this[_0x09c9('0xa')][_0x315670[_0x09c9('0x21')]]['transferrate']=_0x315670[_0x09c9('0x30')];this['channels'][_0x315670[_0x09c9('0x21')]][_0x09c9('0x2c')]=_0x315670[_0x09c9('0x2c')];this['channels'][_0x315670[_0x09c9('0x21')]][_0x09c9('0x31')]=_0x315670[_0x09c9('0x31')];if(this[_0x09c9('0xa')][_0x315670[_0x09c9('0x21')]][_0x09c9('0x32')]>0x0){tiff2pdf(_0x315670[_0x09c9('0x2c')],_0x09c9('0x33'),function(_0x4d51a5){logger['info'](_0x315670[_0x09c9('0x21')],_0x09c9('0x34'),_0x4d51a5[_0x09c9('0x35')]);attachment[_0x09c9('0x36')]({'name':path[_0x09c9('0x37')](_0x315670[_0x09c9('0x2c')])[_0x09c9('0x23')],'basename':path['parse'](_0x315670[_0x09c9('0x2c')])['name']+_0x09c9('0x38'),'type':_0x09c9('0x39')})['then'](function(_0x3a8b6a){faxAccount['notify'](_0x2d8493,{'from':_0x315670[_0x09c9('0x31')],'mapKey':_0x09c9('0x5'),'body':path[_0x09c9('0x37')](_0x315670[_0x09c9('0x2c')])[_0x09c9('0x23')]+_0x09c9('0x38'),'AttachmentId':_0x3a8b6a['id']})[_0x09c9('0x3a')](function(_0x4e28d3){logger[_0x09c9('0x3b')](_0x315670[_0x09c9('0x21')],_0x09c9('0x3c'),JSON['stringify'](_0x4e28d3));});})[_0x09c9('0x3a')](function(_0x546683){logger[_0x09c9('0x3b')](_0x315670[_0x09c9('0x21')],'\x20receiveFax\x20',JSON['stringify'](_0x546683));});});}logger[_0x09c9('0x24')](_0x315670[_0x09c9('0x21')],_0x09c9('0x3d'));}};Fax['prototype'][_0x09c9('0x1c')]=function(_0x3c11d3){if(this[_0x09c9('0xd')][_0x3c11d3[_0x09c9('0x21')]]){_['merge'](this[_0x09c9('0xa')][_0x3c11d3[_0x09c9('0x21')]],_[_0x09c9('0x3e')](_0x3c11d3,['response',_0x09c9('0x3f')]));}};function updateStatus(_0x2658ed){if(_0x2658ed[_0x09c9('0x40')]){faxMessage[_0x09c9('0x41')](_0x2658ed[_0x09c9('0x40')],{'failMessage':'SENDING\x20FAILED\x20'})[_0x09c9('0x42')](function(_0x582c76){ut['logger'](_0x09c9('0x43'),_0x582c76);})[_0x09c9('0x3a')](function(_0x65d520){ut[_0x09c9('0x44')](_0x09c9('0x45'),_0x65d520);});}else{ut[_0x09c9('0x44')](_0x09c9('0x46'));}}Fax[_0x09c9('0x1d')][_0x09c9('0x47')]=function(_0x231c79,_0x1e3045,_0x1b9cdc){var _0x3fe21a=this;var _0x23d758={};if(_0x1e3045){_0x23d758={'read':_0x1e3045};}else{_0x23d758={'failMessage':_0x1b9cdc};}if(this['actions'][_0x231c79][_0x09c9('0x40')]){faxMessage[_0x09c9('0x41')](this[_0x09c9('0xd')][_0x231c79][_0x09c9('0x40')],_0x23d758)[_0x09c9('0x42')](function(_0x36f5c2){ut['logger'](_0x09c9('0x48'),_0x36f5c2);})[_0x09c9('0x3a')](function(_0x1d5106){ut[_0x09c9('0x44')](_0x09c9('0x49'),_0x1d5106);})[_0x09c9('0x4a')](function(){delete _0x3fe21a[_0x09c9('0xa')][_0x231c79];delete _0x3fe21a[_0x09c9('0xd')][_0x231c79];});}else{ut[_0x09c9('0x44')](_0x09c9('0x4b'));delete this[_0x09c9('0xa')][_0x231c79];delete this[_0x09c9('0xd')][_0x231c79];}};Fax['prototype'][_0x09c9('0x1a')]=function(_0x3a5966){var _0x39944c=this;if(this[_0x09c9('0xa')][_0x3a5966[_0x09c9('0x21')]]){if(this[_0x09c9('0xd')][_0x3a5966[_0x09c9('0x21')]]){this['channels'][_0x3a5966[_0x09c9('0x21')]]['id']=this[_0x09c9('0xd')][_0x3a5966['uniqueid']]['id'];this[_0x09c9('0xa')][_0x3a5966[_0x09c9('0x21')]][_0x09c9('0x23')]=this[_0x09c9('0xd')][_0x3a5966[_0x09c9('0x21')]][_0x09c9('0x23')];}logger[_0x09c9('0x24')](_0x3a5966[_0x09c9('0x21')],this['actions'][_0x3a5966[_0x09c9('0x21')]]?_0x09c9('0x4c'):_0x09c9('0x4d'),JSON['stringify'](this[_0x09c9('0xa')][_0x3a5966['uniqueid']]));if(this[_0x09c9('0xd')][_0x3a5966[_0x09c9('0x21')]]){if(this[_0x09c9('0xa')][_0x3a5966[_0x09c9('0x21')]]['faxpages']>0x0&&this[_0x09c9('0xa')][_0x3a5966[_0x09c9('0x21')]][_0x09c9('0x17')]===_0x09c9('0x4e')){this[_0x09c9('0x47')](_0x3a5966[_0x09c9('0x21')],!![]);}else{this[_0x09c9('0x47')](_0x3a5966[_0x09c9('0x21')],![],this['channels'][_0x3a5966['uniqueid']][_0x09c9('0x4f')]?'SENDING\x20FAILED:\x20'+this[_0x09c9('0xa')][_0x3a5966['uniqueid']]['faxstatusstring']:_0x09c9('0x50'));}}}};Fax[_0x09c9('0x1d')][_0x09c9('0x51')]=function(_0x247915){var _0x49c53c=this;return new BPromise(function(_0x577a46,_0x2101f6){_0x49c53c['execOriginate'](_0x247915,_0x49c53c[_0x09c9('0xb')][_0x247915['FaxAccountId']])[_0x09c9('0x42')](function(_0x4a59eb){ut[_0x09c9('0x44')](_0x09c9('0x52'),_0x4a59eb);_0x577a46(ut[_0x09c9('0x35')](_0x09c9('0x53')));})[_0x09c9('0x3a')](function(_0x125f7e){ut[_0x09c9('0x44')](_0x09c9('0x54'),_0x125f7e);updateStatus(_0x247915);_0x2101f6(ut[_0x09c9('0x35')](_0x09c9('0x55')));});});};Fax[_0x09c9('0x1d')]['checkAfterSend']=function(_0x1d7ea2){var _0xcaa41c=this;return new BPromise(function(_0x33cb10,_0x30ff35){var _0x10d952=_0xcaa41c['checkTrunk'](_0xcaa41c[_0x09c9('0xb')][_0x1d7ea2[_0x09c9('0x56')]][_0x09c9('0x57')],_0x1d7ea2);if(_0x10d952[_0x09c9('0x58')]){_0x33cb10(ut[_0x09c9('0x35')](_0x09c9('0x59')));}else{_0x30ff35(ut['message'](_0x10d952[_0x09c9('0x35')]));}});};function originate(_0x1cb762,_0x25733a,_0x5daca9){return new BPromise(function(_0x593bae,_0x18b56d){if(_0x5daca9){var _0x3d0c42=util[_0x09c9('0x5a')](_0x09c9('0x5b'),path[_0x09c9('0x37')](_0x1cb762[_0x09c9('0x3')])[_0x09c9('0x23')],_0x1cb762[_0x09c9('0x3')]);gs['execute'](_0x3d0c42)[_0x09c9('0x42')](function(){_0x1cb762['path']=util[_0x09c9('0x5a')](_0x09c9('0x5c'),path[_0x09c9('0x37')](_0x1cb762[_0x09c9('0x3')])[_0x09c9('0x5d')],path[_0x09c9('0x37')](_0x1cb762[_0x09c9('0x3')])[_0x09c9('0x23')]);_0x25733a[_0x09c9('0x5e')]=_0x1cb762[_0x09c9('0x3')];ut[_0x09c9('0x44')]('Convert\x20pdf\x20to\x20tif','');ami['Action'](ut[_0x09c9('0x5f')](_0x1cb762,_0x25733a))[_0x09c9('0x42')](function(_0x3b27d8){_0x593bae(_0x3b27d8);})[_0x09c9('0x3a')](function(_0x3c04d7){_0x18b56d(_0x3c04d7);});})['catch'](function(_0x1e0c19){_0x18b56d(_0x1e0c19);});}else{ami['Action'](ut[_0x09c9('0x5f')](_0x1cb762,_0x25733a))[_0x09c9('0x42')](function(_0x2c11f2){_0x593bae(_0x2c11f2);})['catch'](function(_0x5b18ca){_0x18b56d(_0x5b18ca);});}});}Fax[_0x09c9('0x1d')][_0x09c9('0x60')]=function(_0x57da55,_0x4ddc5f){var _0x410c2d=this;return new BPromise(function(_0x2960b6,_0x7ec2ea){var _0x2da90c=uuid['v4']();var _0x5d8747=ut[_0x09c9('0x61')](_0x57da55,_0x4ddc5f);_0x410c2d[_0x09c9('0xd')][_0x2da90c]=new Action(_0x2da90c,_0x4ddc5f,_0x57da55);var _0x2a9e8e=_0x410c2d[_0x09c9('0xd')][_0x2da90c];if(path[_0x09c9('0x37')](_0x57da55[_0x09c9('0x3')])[_0x09c9('0x62')]===_0x09c9('0x38')){originate(_0x2a9e8e,_0x5d8747,!![])[_0x09c9('0x42')](function(_0xa3fb55){_0x2960b6(_0xa3fb55);})[_0x09c9('0x3a')](function(_0x118d52){_0x7ec2ea(_0x118d52);});}else{originate(_0x2a9e8e,_0x5d8747,![])[_0x09c9('0x42')](function(_0x564eac){_0x2960b6(_0x564eac);})[_0x09c9('0x3a')](function(_0x97f34b){_0x7ec2ea(_0x97f34b);});}});};Fax['prototype']['isTrunkReachable']=function(_0x3d13b5){return!_[_0x09c9('0x63')](_0x3d13b5)&&!_[_0x09c9('0x63')](_0x3d13b5['name'])&&!_[_0x09c9('0x63')](_0x3d13b5[_0x09c9('0x64')])&&_0x3d13b5[_0x09c9('0x64')]&&!_['isNil'](this[_0x09c9('0xc')][util[_0x09c9('0x5a')]('SIP/%s',_0x3d13b5[_0x09c9('0x23')])])&&!_[_0x09c9('0x63')](this[_0x09c9('0xc')][util[_0x09c9('0x5a')](_0x09c9('0x65'),_0x3d13b5[_0x09c9('0x23')])][_0x09c9('0x2b')])&&(this[_0x09c9('0xc')][util[_0x09c9('0x5a')]('SIP/%s',_0x3d13b5['name'])][_0x09c9('0x2b')]===_0x09c9('0x66')||this[_0x09c9('0xc')][util[_0x09c9('0x5a')](_0x09c9('0x65'),_0x3d13b5[_0x09c9('0x23')])]['status']==='unmonitored');};Fax[_0x09c9('0x1d')][_0x09c9('0x67')]=function(_0x2cbe83,_0xcf7738){if(!this[_0x09c9('0x68')](_0x2cbe83)){ut[_0x09c9('0x44')](_0x09c9('0x69'),_['isNil'](_0x2cbe83)?'':_0x2cbe83[_0x09c9('0x23')]+_0x09c9('0x6a'));return{'isValid':![],'message':_0x09c9('0x6b')};}if(_[_0x09c9('0x63')](_0xcf7738[_0x09c9('0x5')])){ut['logger'](_0x09c9('0x6c'),JSON['stringify'](_0xcf7738));return{'isValid':![],'message':'Empty\x20Fax'};}if(_['isNil'](_0xcf7738[_0x09c9('0x3')])){ut[_0x09c9('0x44')]('[Fax][checkTrunk][Empty\x20path]',JSON[_0x09c9('0x6d')](_0xcf7738));return{'isValid':![],'message':_0x09c9('0x6e')};}return{'isValid':!![],'message':'Is\x20Valid'};};module['exports']=Fax; \ No newline at end of file diff --git a/server/services/ami/fax/rpcDb.js b/server/services/ami/fax/rpcDb.js index 49ce745..c1d84fd 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 _0xd7a8=['catch','[Notify]\x20','util','../../../config/logger','preview','lodash','../rpc/faxAccount','error','resolve'];(function(_0x2c984d,_0x5a6f2f){var _0x31df62=function(_0x180acd){while(--_0x180acd){_0x2c984d['push'](_0x2c984d['shift']());}};_0x31df62(++_0x5a6f2f);}(_0xd7a8,0x185));var _0x8d7a=function(_0x341e0f,_0x4a09d0){_0x341e0f=_0x341e0f-0x0;var _0x59555a=_0xd7a8[_0x341e0f];return _0x59555a;};'use strict';var util=require(_0x8d7a('0x0'));var BPromise=require('bluebird');var logger=require(_0x8d7a('0x1'))(_0x8d7a('0x2'));var _=require(_0x8d7a('0x3'));var faxAccount=require(_0x8d7a('0x4'));function loggerCatch(_0x111daf){return function(_0x40273c){logger[_0x8d7a('0x5')](_0x111daf,util['inspect'](_0x40273c,{'showHidden':![],'depth':null}));};}exports['notify']=function(_0x35702b,_0x2b3363){return BPromise[_0x8d7a('0x6')]()['then'](faxAccount['notify'](_0x35702b,_0x2b3363))[_0x8d7a('0x7')](loggerCatch(_0x8d7a('0x8')));}; \ No newline at end of file +var _0x83a4=['catch','[Notify]\x20','../../../config/logger','../rpc/faxAccount','error','notify','then'];(function(_0xe70757,_0xb7f6fa){var _0x31b0b4=function(_0x1115d3){while(--_0x1115d3){_0xe70757['push'](_0xe70757['shift']());}};_0x31b0b4(++_0xb7f6fa);}(_0x83a4,0x144));var _0x483a=function(_0x17b6e3,_0x4522ed){_0x17b6e3=_0x17b6e3-0x0;var _0x3906f3=_0x83a4[_0x17b6e3];return _0x3906f3;};'use strict';var util=require('util');var BPromise=require('bluebird');var logger=require(_0x483a('0x0'))('preview');var _=require('lodash');var faxAccount=require(_0x483a('0x1'));function loggerCatch(_0x206b2a){return function(_0x34fd65){logger[_0x483a('0x2')](_0x206b2a,util['inspect'](_0x34fd65,{'showHidden':![],'depth':null}));};}exports[_0x483a('0x3')]=function(_0x54a943,_0x2bdb49){return BPromise['resolve']()[_0x483a('0x4')](faxAccount[_0x483a('0x3')](_0x54a943,_0x2bdb49))[_0x483a('0x5')](loggerCatch(_0x483a('0x6')));}; \ 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 af6c485..8cd63a0 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 _0x93df=['Exec\x20gs','\x20Error\x20:','inspect','util','fax','bluebird','child_process','exec','execute','info'];(function(_0x49249c,_0x1e0997){var _0x484741=function(_0xd8eb04){while(--_0xd8eb04){_0x49249c['push'](_0x49249c['shift']());}};_0x484741(++_0x1e0997);}(_0x93df,0xa3));var _0xf93d=function(_0x55dbd0,_0x341a80){_0x55dbd0=_0x55dbd0-0x0;var _0xda1a93=_0x93df[_0x55dbd0];return _0xda1a93;};'use strict';var util=require(_0xf93d('0x0'));var logger=require('../../../../config/logger')(_0xf93d('0x1'));var BPromise=require(_0xf93d('0x2'));var exec=require(_0xf93d('0x3'))[_0xf93d('0x4')];exports[_0xf93d('0x5')]=function(_0x234231){return new BPromise(function(_0x9306ca,_0x9ec14f){exec(_0x234231,function(_0x4f74eb,_0x51a8f8,_0x4f9d3b){logger[_0xf93d('0x6')](_0xf93d('0x7'),_0x51a8f8);if(_0x4f74eb){logger[_0xf93d('0x6')](_0xf93d('0x7'),_0xf93d('0x8'),util[_0xf93d('0x9')](_0x4f74eb,{'showHidden':![],'depth':null}),_0x51a8f8,_0x4f9d3b);_0x9ec14f(_0x4f74eb);}_0x9306ca(_0x51a8f8);});});}; \ No newline at end of file +var _0xdd74=['Exec\x20gs','info','util','../../../../config/logger','fax','bluebird','child_process','exec','execute'];(function(_0x29dc12,_0x9c3116){var _0x2681ca=function(_0x49ac34){while(--_0x49ac34){_0x29dc12['push'](_0x29dc12['shift']());}};_0x2681ca(++_0x9c3116);}(_0xdd74,0x18e));var _0x4dd7=function(_0x58bac9,_0x5a8b4c){_0x58bac9=_0x58bac9-0x0;var _0x1c2d06=_0xdd74[_0x58bac9];return _0x1c2d06;};'use strict';var util=require(_0x4dd7('0x0'));var logger=require(_0x4dd7('0x1'))(_0x4dd7('0x2'));var BPromise=require(_0x4dd7('0x3'));var exec=require(_0x4dd7('0x4'))[_0x4dd7('0x5')];exports[_0x4dd7('0x6')]=function(_0x1fc2c2){return new BPromise(function(_0x1338e6,_0x2b6bb5){exec(_0x1fc2c2,function(_0x19bdda,_0x1b535d,_0x312d8a){logger['info'](_0x4dd7('0x7'),_0x1b535d);if(_0x19bdda){logger[_0x4dd7('0x8')](_0x4dd7('0x7'),'\x20Error\x20:',util['inspect'](_0x19bdda,{'showHidden':![],'depth':null}),_0x1b535d,_0x312d8a);_0x2b6bb5(_0x19bdda);}_0x1338e6(_0x1b535d);});});}; \ 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 f9501c6..161765a 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 _0xc6ef=['../../../../config/logger','fax','message','logger','info','inspect','addVariables','minrate','maxrate','modem','gateway','faxdetect','t38timeout','path','variablesAction','channel','xcally-motion-fax','from-sip','\x22%s\x22\x20<%s>','headerinfo','util','moment'];(function(_0x4c3c19,_0x198b34){var _0x2ab88d=function(_0x16325b){while(--_0x16325b){_0x4c3c19['push'](_0x4c3c19['shift']());}};_0x2ab88d(++_0x198b34);}(_0xc6ef,0x1a0));var _0xfc6e=function(_0xe8ccaa,_0x2eb2f7){_0xe8ccaa=_0xe8ccaa-0x0;var _0x2d0812=_0xc6ef[_0xe8ccaa];return _0x2d0812;};'use strict';var util=require(_0xfc6e('0x0'));var _=require('lodash');var moment=require(_0xfc6e('0x1'));var logger=require(_0xfc6e('0x2'))(_0xfc6e('0x3'));exports[_0xfc6e('0x4')]=function(_0x17219e){return{'message':_0x17219e};};exports[_0xfc6e('0x5')]=function(_0xefe71c,_0x2752cc){logger[_0xfc6e('0x6')](_0xefe71c,util[_0xfc6e('0x7')](_0x2752cc,{'showHidden':![],'depth':null}));};exports[_0xfc6e('0x8')]=function(_0x268309,_0x4ca2bc){var _0x4b7257={'XMF-ECM':_0x4ca2bc['ecm'],'XMF-HEADERINFO':_0x4ca2bc['headerinfo'],'XMF-MINRATE':_0x4ca2bc[_0xfc6e('0x9')],'XMF-MAXRATE':_0x4ca2bc[_0xfc6e('0xa')],'XMF-MODEM':util['format']('\x22%s\x22',_0x4ca2bc[_0xfc6e('0xb')]),'XMF-GATEWAY':_0x4ca2bc[_0xfc6e('0xc')],'XMF-FAXDETECT':_0x4ca2bc[_0xfc6e('0xd')],'XMF-T38TIMEOUT':_0x4ca2bc[_0xfc6e('0xe')],'XMF-LOCALSTATIONID':_0x4ca2bc['localstationid'],'XMF-PATH':_0x268309[_0xfc6e('0xf')]};return _0x4b7257;};exports[_0xfc6e('0x10')]=function(_0x67d055,_0x4542c9){return{'actionid':_0x67d055['uniqueid'],'action':'originate','channel':_0x67d055[_0xfc6e('0x11')],'Exten':_0xfc6e('0x12'),'Context':_0xfc6e('0x13'),'Priority':'1','callerid':util['format'](_0xfc6e('0x14'),_0x67d055['headerinfo']?_0x67d055[_0xfc6e('0x15')]:'',_0x67d055['localstationid']),'variable':_0x4542c9,'timeout':0x1e*0x3e8,'async':!![],'channelid':_0x67d055['uniqueid']};}; \ No newline at end of file +var _0x2516=['\x22%s\x22','modem','gateway','faxdetect','localstationid','path','variablesAction','uniqueid','from-sip','\x22%s\x22\x20<%s>','util','lodash','moment','../../../../config/logger','message','info','inspect','addVariables','headerinfo','minrate','format'];(function(_0x2cf033,_0x1719ad){var _0x5da216=function(_0x211a77){while(--_0x211a77){_0x2cf033['push'](_0x2cf033['shift']());}};_0x5da216(++_0x1719ad);}(_0x2516,0x16f));var _0x6251=function(_0x2f3848,_0x48564d){_0x2f3848=_0x2f3848-0x0;var _0x102668=_0x2516[_0x2f3848];return _0x102668;};'use strict';var util=require(_0x6251('0x0'));var _=require(_0x6251('0x1'));var moment=require(_0x6251('0x2'));var logger=require(_0x6251('0x3'))('fax');exports[_0x6251('0x4')]=function(_0x3e24e8){return{'message':_0x3e24e8};};exports['logger']=function(_0x54da49,_0xb4dc3e){logger[_0x6251('0x5')](_0x54da49,util[_0x6251('0x6')](_0xb4dc3e,{'showHidden':![],'depth':null}));};exports[_0x6251('0x7')]=function(_0x34aba1,_0x1e47fa){var _0x3eabad={'XMF-ECM':_0x1e47fa['ecm'],'XMF-HEADERINFO':_0x1e47fa[_0x6251('0x8')],'XMF-MINRATE':_0x1e47fa[_0x6251('0x9')],'XMF-MAXRATE':_0x1e47fa['maxrate'],'XMF-MODEM':util[_0x6251('0xa')](_0x6251('0xb'),_0x1e47fa[_0x6251('0xc')]),'XMF-GATEWAY':_0x1e47fa[_0x6251('0xd')],'XMF-FAXDETECT':_0x1e47fa[_0x6251('0xe')],'XMF-T38TIMEOUT':_0x1e47fa['t38timeout'],'XMF-LOCALSTATIONID':_0x1e47fa[_0x6251('0xf')],'XMF-PATH':_0x34aba1[_0x6251('0x10')]};return _0x3eabad;};exports[_0x6251('0x11')]=function(_0x13801b,_0x8b2ccf){return{'actionid':_0x13801b[_0x6251('0x12')],'action':'originate','channel':_0x13801b['channel'],'Exten':'xcally-motion-fax','Context':_0x6251('0x13'),'Priority':'1','callerid':util[_0x6251('0xa')](_0x6251('0x14'),_0x13801b[_0x6251('0x8')]?_0x13801b[_0x6251('0x8')]:'',_0x13801b['localstationid']),'variable':_0x8b2ccf,'timeout':0x1e*0x3e8,'async':!![],'channelid':_0x13801b[_0x6251('0x12')]};}; \ No newline at end of file diff --git a/server/services/ami/index.js b/server/services/ami/index.js index 6165b36..2561cc7 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 _0x8b56=['sync','util','moment','./server','./realtime','./trigger','./dialer','./preview','./fax','./rpc/user','./rpc/voiceQueueReport','./rpc/voiceCallReport','./rpc/template','./rpc/cmHopperHistory','./rpc/campaign','./rpc/voiceExtension','./rpc/integrations/zendesk','./rpc/integrations/salesforce','./rpc/integrations/sugarcrm','./rpc/integrations/freshdesk','./rpc/integrations/zoho','./rpc/integrations/vtiger','./rpc/integrations/freshsales','./rpc/integrations/servicenow','./rpc/integrations/dynamics365','../../config/logger','ami','get','resolve','then','getAgents','initAgents','getTrunks','initTrunks','initVoiceQueues','getTriggers','initTemplates','getZendeskAccounts','initZendeskAccounts','initSalesforceAccounts','getSugarcrmAccounts','initSugarcrmAccounts','getDeskAccounts','getZohoAccounts','initZohoAccounts','getVtigerAccounts','initVtigerAccounts','getFreshsalesAccounts','getServicenowAccounts','initServicenowAccounts','getDynamics365Accounts','initDynamics365Accounts','getCampaigns','initCampaigns','getVoiceExtensions','initVoiceExtensions','initFaxAccounts','initVoiceQueueReports','getVoiceQueueHopperHistory','initVoiceQueueHopperHistory','getCampaignHopperHistory','initCampaignHopperHistory','getVoiceCallReports','initVoiceCallReports','catch','error','[index.js][initParams]','inspect','listen'];(function(_0x25c936,_0x50ae88){var _0x50f4fe=function(_0x214b38){while(--_0x214b38){_0x25c936['push'](_0x25c936['shift']());}};_0x50f4fe(++_0x50ae88);}(_0x8b56,0x15a));var _0x68b5=function(_0x5aa9ba,_0x9829aa){_0x5aa9ba=_0x5aa9ba-0x0;var _0x407364=_0x8b56[_0x5aa9ba];return _0x407364;};'use strict';var util=require(_0x68b5('0x0'));var moment=require(_0x68b5('0x1'));var server=require(_0x68b5('0x2'));var Realtime=require(_0x68b5('0x3'));var Report=require('./report');var Acw=require('./acw');var Trigger=require(_0x68b5('0x4'));var Dialer=require(_0x68b5('0x5'));var Preview=require(_0x68b5('0x6'));var Fax=require(_0x68b5('0x7'));var user=require(_0x68b5('0x8'));var voiceQueue=require('./rpc/voiceQueue');var voiceQueueReport=require(_0x68b5('0x9'));var voiceCallReport=require(_0x68b5('0xa'));var trunk=require('./rpc/trunk');var trigger=require('./rpc/trigger');var template=require(_0x68b5('0xb'));var cmHopperHistory=require(_0x68b5('0xc'));var campaign=require(_0x68b5('0xd'));var voiceExtension=require(_0x68b5('0xe'));var faxAccount=require('./rpc/faxAccount');var zendesk=require(_0x68b5('0xf'));var salesforce=require(_0x68b5('0x10'));var sugarcrm=require(_0x68b5('0x11'));var freshdesk=require(_0x68b5('0x12'));var desk=require('./rpc/integrations/desk');var zoho=require(_0x68b5('0x13'));var vtiger=require(_0x68b5('0x14'));var freshsales=require(_0x68b5('0x15'));var servicenow=require(_0x68b5('0x16'));var dynamics365=require(_0x68b5('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(_0x68b5('0x18'))(_0x68b5('0x19'));var isTrue=!![];var initP=!![];function ifMidnight(){if(moment()['get']('hour')===0x0&&initP){initP=![];isTrue=!![];initParams();}if(moment()[_0x68b5('0x1a')]('hour')===0x1&&isTrue){isTrue=![];initP=!![];}}function initRealtime(){ifMidnight();return Promise[_0x68b5('0x1b')]()[_0x68b5('0x1c')](user[_0x68b5('0x1d')]())['then'](realtime[_0x68b5('0x1e')]())[_0x68b5('0x1c')](user['getTelephones']())['then'](realtime['initTelephones']())[_0x68b5('0x1c')](trunk[_0x68b5('0x1f')]())[_0x68b5('0x1c')](realtime[_0x68b5('0x20')]())[_0x68b5('0x1c')](voiceQueue['getVoiceQueues']())[_0x68b5('0x1c')](realtime[_0x68b5('0x21')]())['then'](trigger[_0x68b5('0x22')]())[_0x68b5('0x1c')](realtime['initTriggers']())['then'](template['getTemplates']())[_0x68b5('0x1c')](realtime[_0x68b5('0x23')]())[_0x68b5('0x1c')](zendesk[_0x68b5('0x24')]())[_0x68b5('0x1c')](realtime[_0x68b5('0x25')]())[_0x68b5('0x1c')](salesforce['getSalesforceAccounts']())[_0x68b5('0x1c')](realtime[_0x68b5('0x26')]())[_0x68b5('0x1c')](sugarcrm[_0x68b5('0x27')]())[_0x68b5('0x1c')](realtime[_0x68b5('0x28')]())[_0x68b5('0x1c')](freshdesk['getFreshdeskAccounts']())[_0x68b5('0x1c')](realtime['initFreshdeskAccounts']())[_0x68b5('0x1c')](desk[_0x68b5('0x29')]())[_0x68b5('0x1c')](realtime['initDeskAccounts']())['then'](zoho[_0x68b5('0x2a')]())[_0x68b5('0x1c')](realtime[_0x68b5('0x2b')]())['then'](vtiger[_0x68b5('0x2c')]())['then'](realtime[_0x68b5('0x2d')]())['then'](freshsales[_0x68b5('0x2e')]())[_0x68b5('0x1c')](realtime['initFreshsalesAccounts']())[_0x68b5('0x1c')](servicenow[_0x68b5('0x2f')]())[_0x68b5('0x1c')](realtime[_0x68b5('0x30')]())[_0x68b5('0x1c')](dynamics365[_0x68b5('0x31')]())[_0x68b5('0x1c')](realtime[_0x68b5('0x32')]())['then'](campaign[_0x68b5('0x33')]())['then'](realtime[_0x68b5('0x34')]())['then'](voiceExtension[_0x68b5('0x35')]())['then'](realtime[_0x68b5('0x36')]())[_0x68b5('0x1c')](faxAccount['getFaxAccounts']())['then'](realtime[_0x68b5('0x37')]())[_0x68b5('0x1c')](function(){return realtime;});}function initParams(){return Promise[_0x68b5('0x1b')]()['then'](voiceQueueReport['getVoiceQueueReports']())[_0x68b5('0x1c')](realtime[_0x68b5('0x38')]())[_0x68b5('0x1c')](cmHopperHistory[_0x68b5('0x39')]())['then'](realtime[_0x68b5('0x3a')]())[_0x68b5('0x1c')](cmHopperHistory[_0x68b5('0x3b')]())[_0x68b5('0x1c')](realtime[_0x68b5('0x3c')]())[_0x68b5('0x1c')](voiceCallReport[_0x68b5('0x3d')]())[_0x68b5('0x1c')](realtime[_0x68b5('0x3e')]())[_0x68b5('0x3f')](function(_0x4caa77){logger[_0x68b5('0x40')](_0x68b5('0x41'),util[_0x68b5('0x42')](_0x4caa77,{'showHidden':![],'depth':null}));});}function main(){return server[_0x68b5('0x43')](realtime,preview,fax)[_0x68b5('0x1c')](function(){return initRealtime();})[_0x68b5('0x1c')](function(){return initParams();})[_0x68b5('0x1c')](function(){report[_0x68b5('0x44')]();setInterval(initRealtime,0x1388);})[_0x68b5('0x3f')](function(_0x328400){logger[_0x68b5('0x40')]('[index.js][main]',util[_0x68b5('0x42')](_0x328400,{'showHidden':![],'depth':null}));});}main(); \ No newline at end of file +var _0x7ef3=['./rpc/template','./rpc/cmHopperHistory','./rpc/campaign','./rpc/voiceExtension','./rpc/faxAccount','./rpc/integrations/zendesk','./rpc/integrations/salesforce','./rpc/integrations/sugarcrm','./rpc/integrations/freshdesk','./rpc/integrations/zoho','./rpc/integrations/freshsales','./rpc/integrations/servicenow','./rpc/integrations/dynamics365','../../config/logger','ami','hour','resolve','getAgents','then','getTelephones','initTelephones','getTrunks','initVoiceQueues','getTriggers','initTriggers','initTemplates','getZendeskAccounts','initZendeskAccounts','initSalesforceAccounts','getSugarcrmAccounts','getFreshdeskAccounts','initFreshdeskAccounts','getDeskAccounts','initDeskAccounts','getZohoAccounts','initZohoAccounts','initFreshsalesAccounts','getServicenowAccounts','initServicenowAccounts','initDynamics365Accounts','getCampaigns','initCampaigns','getVoiceExtensions','initVoiceExtensions','getFaxAccounts','getVoiceQueueReports','initVoiceQueueReports','getVoiceQueueHopperHistory','initVoiceQueueHopperHistory','getCampaignHopperHistory','initCampaignHopperHistory','getVoiceCallReports','initVoiceCallReports','catch','inspect','listen','[index.js][main]','util','./server','./realtime','./acw','./trigger','./dialer','./preview','./rpc/user','./rpc/voiceQueue','./rpc/voiceCallReport','./rpc/trunk','./rpc/trigger'];(function(_0x425f05,_0x3db28c){var _0x341eed=function(_0x2f2675){while(--_0x2f2675){_0x425f05['push'](_0x425f05['shift']());}};_0x341eed(++_0x3db28c);}(_0x7ef3,0x1d7));var _0x37ef=function(_0x5519a9,_0x1c5147){_0x5519a9=_0x5519a9-0x0;var _0x32f2cc=_0x7ef3[_0x5519a9];return _0x32f2cc;};'use strict';var util=require(_0x37ef('0x0'));var moment=require('moment');var server=require(_0x37ef('0x1'));var Realtime=require(_0x37ef('0x2'));var Report=require('./report');var Acw=require(_0x37ef('0x3'));var Trigger=require(_0x37ef('0x4'));var Dialer=require(_0x37ef('0x5'));var Preview=require(_0x37ef('0x6'));var Fax=require('./fax');var user=require(_0x37ef('0x7'));var voiceQueue=require(_0x37ef('0x8'));var voiceQueueReport=require('./rpc/voiceQueueReport');var voiceCallReport=require(_0x37ef('0x9'));var trunk=require(_0x37ef('0xa'));var trigger=require(_0x37ef('0xb'));var template=require(_0x37ef('0xc'));var cmHopperHistory=require(_0x37ef('0xd'));var campaign=require(_0x37ef('0xe'));var voiceExtension=require(_0x37ef('0xf'));var faxAccount=require(_0x37ef('0x10'));var zendesk=require(_0x37ef('0x11'));var salesforce=require(_0x37ef('0x12'));var sugarcrm=require(_0x37ef('0x13'));var freshdesk=require(_0x37ef('0x14'));var desk=require('./rpc/integrations/desk');var zoho=require(_0x37ef('0x15'));var vtiger=require('./rpc/integrations/vtiger');var freshsales=require(_0x37ef('0x16'));var servicenow=require(_0x37ef('0x17'));var dynamics365=require(_0x37ef('0x18'));var realtime=new Realtime();var report=new Report(realtime);var acw=new Acw(realtime);var channelTrigger=new Trigger(realtime);var preview=new Preview(realtime);var dialer=new Dialer(realtime,preview);var fax=new Fax(realtime);var logger=require(_0x37ef('0x19'))(_0x37ef('0x1a'));var isTrue=!![];var initP=!![];function ifMidnight(){if(moment()['get'](_0x37ef('0x1b'))===0x0&&initP){initP=![];isTrue=!![];initParams();}if(moment()['get'](_0x37ef('0x1b'))===0x1&&isTrue){isTrue=![];initP=!![];}}function initRealtime(){ifMidnight();return Promise[_0x37ef('0x1c')]()['then'](user[_0x37ef('0x1d')]())[_0x37ef('0x1e')](realtime['initAgents']())[_0x37ef('0x1e')](user[_0x37ef('0x1f')]())[_0x37ef('0x1e')](realtime[_0x37ef('0x20')]())[_0x37ef('0x1e')](trunk[_0x37ef('0x21')]())[_0x37ef('0x1e')](realtime['initTrunks']())[_0x37ef('0x1e')](voiceQueue['getVoiceQueues']())[_0x37ef('0x1e')](realtime[_0x37ef('0x22')]())['then'](trigger[_0x37ef('0x23')]())[_0x37ef('0x1e')](realtime[_0x37ef('0x24')]())[_0x37ef('0x1e')](template['getTemplates']())[_0x37ef('0x1e')](realtime[_0x37ef('0x25')]())[_0x37ef('0x1e')](zendesk[_0x37ef('0x26')]())[_0x37ef('0x1e')](realtime[_0x37ef('0x27')]())['then'](salesforce['getSalesforceAccounts']())[_0x37ef('0x1e')](realtime[_0x37ef('0x28')]())['then'](sugarcrm[_0x37ef('0x29')]())['then'](realtime['initSugarcrmAccounts']())['then'](freshdesk[_0x37ef('0x2a')]())[_0x37ef('0x1e')](realtime[_0x37ef('0x2b')]())['then'](desk[_0x37ef('0x2c')]())[_0x37ef('0x1e')](realtime[_0x37ef('0x2d')]())[_0x37ef('0x1e')](zoho[_0x37ef('0x2e')]())['then'](realtime[_0x37ef('0x2f')]())[_0x37ef('0x1e')](vtiger['getVtigerAccounts']())['then'](realtime['initVtigerAccounts']())[_0x37ef('0x1e')](freshsales['getFreshsalesAccounts']())['then'](realtime[_0x37ef('0x30')]())[_0x37ef('0x1e')](servicenow[_0x37ef('0x31')]())[_0x37ef('0x1e')](realtime[_0x37ef('0x32')]())[_0x37ef('0x1e')](dynamics365['getDynamics365Accounts']())['then'](realtime[_0x37ef('0x33')]())[_0x37ef('0x1e')](campaign[_0x37ef('0x34')]())[_0x37ef('0x1e')](realtime[_0x37ef('0x35')]())[_0x37ef('0x1e')](voiceExtension[_0x37ef('0x36')]())[_0x37ef('0x1e')](realtime[_0x37ef('0x37')]())['then'](faxAccount[_0x37ef('0x38')]())[_0x37ef('0x1e')](realtime['initFaxAccounts']())[_0x37ef('0x1e')](function(){return realtime;});}function initParams(){return Promise[_0x37ef('0x1c')]()[_0x37ef('0x1e')](voiceQueueReport[_0x37ef('0x39')]())[_0x37ef('0x1e')](realtime[_0x37ef('0x3a')]())[_0x37ef('0x1e')](cmHopperHistory[_0x37ef('0x3b')]())[_0x37ef('0x1e')](realtime[_0x37ef('0x3c')]())['then'](cmHopperHistory[_0x37ef('0x3d')]())[_0x37ef('0x1e')](realtime[_0x37ef('0x3e')]())[_0x37ef('0x1e')](voiceCallReport[_0x37ef('0x3f')]())[_0x37ef('0x1e')](realtime[_0x37ef('0x40')]())[_0x37ef('0x41')](function(_0x224e67){logger['error']('[index.js][initParams]',util[_0x37ef('0x42')](_0x224e67,{'showHidden':![],'depth':null}));});}function main(){return server[_0x37ef('0x43')](realtime,preview,fax)[_0x37ef('0x1e')](function(){return initRealtime();})[_0x37ef('0x1e')](function(){return initParams();})[_0x37ef('0x1e')](function(){report['sync']();setInterval(initRealtime,0x1388);})['catch'](function(_0x5645ee){logger['error'](_0x37ef('0x44'),util['inspect'](_0x5645ee,{'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 145979f..d82670e 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 _0x1c8e=['accountcode','fullname','state','unknown','stateTime','address','mobile','interface','online','voiceStatusTime','updateStatusRealtime','not_inuse','inuse','talking','statePause','toNumber','format','voiceStatus','voiceStatusCallerIdNumber','voiceStatusQueue','onhold','stringify','omit','emit','exports','lodash','util','md5','ioredis','defaults','redis','socket.io-emitter','name','email'];(function(_0x4e09ec,_0x530418){var _0x347fa2=function(_0x201dc3){while(--_0x201dc3){_0x4e09ec['push'](_0x4e09ec['shift']());}};_0x347fa2(++_0x530418);}(_0x1c8e,0x18f));var _0xe1c8=function(_0x23e0c1,_0x3db138){_0x23e0c1=_0x23e0c1-0x0;var _0x5b19e6=_0x1c8e[_0x23e0c1];return _0x5b19e6;};'use strict';var _=require(_0xe1c8('0x0'));var util=require(_0xe1c8('0x1'));var moment=require('moment');var md5=require(_0xe1c8('0x2'));var Redis=require(_0xe1c8('0x3'));var config=require('../../../config/environment');config['redis']=_[_0xe1c8('0x4')](config[_0xe1c8('0x5')],{'host':'localhost','port':0x18eb});var io=require(_0xe1c8('0x6'))(new Redis(config['redis']));function Agent(_0x50b039){this['id']=_0x50b039['id']||0x0;this[_0xe1c8('0x7')]=_0x50b039[_0xe1c8('0x7')]||'';this['email']=_0x50b039[_0xe1c8('0x8')]||'';this[_0xe1c8('0x9')]=_0x50b039[_0xe1c8('0x9')]||'';this[_0xe1c8('0xa')]=_0x50b039[_0xe1c8('0xa')]||'';this[_0xe1c8('0xb')]=_0xe1c8('0xc');this[_0xe1c8('0xd')]=0x0;this['status']='unknown';this[_0xe1c8('0xe')]='';this['phone']='';this[_0xe1c8('0xf')]='';this[_0xe1c8('0x10')]='';this[_0xe1c8('0x11')]=_0x50b039[_0xe1c8('0x11')]||![];this['voiceStatus']='unknown';this[_0xe1c8('0x12')]=0x0;this['voiceStatusCallerIdNumber']='';this['voiceStatusQueue']='';this['onhold']=![];this['local']=![];this[_0xe1c8('0x2')]='';}Agent['prototype'][_0xe1c8('0x13')]=function(_0x30450d){var _0x23cd4a;if(_0x30450d&&_0x30450d[_0xe1c8('0xb')]){_0x23cd4a=_0x30450d[_0xe1c8('0xb')]['toLowerCase']();switch(_0x23cd4a){case _0xe1c8('0x14'):_0x23cd4a='idle';break;case _0xe1c8('0x15'):_0x23cd4a=_0xe1c8('0x16');break;}}if(_0x23cd4a&&this['voiceStatus']!==_0x23cd4a||_0x30450d[_0xe1c8('0x17')]){this['voiceStatusTime']=_[_0xe1c8('0x18')](moment()[_0xe1c8('0x19')]('x'));}if(_0x23cd4a){this[_0xe1c8('0x1a')]=_0x23cd4a;}var _0x48f4f0={'id':this['id'],'name':this[_0xe1c8('0x7')],'email':this[_0xe1c8('0x8')],'accountcode':this[_0xe1c8('0x9')],'fullname':this[_0xe1c8('0xa')],'state':this[_0xe1c8('0xb')],'stateTime':this['stateTime'],'status':this['status'],'address':this[_0xe1c8('0xe')],'online':this[_0xe1c8('0x11')],'voiceStatus':this[_0xe1c8('0x1a')],'voiceStatusTime':this[_0xe1c8('0x12')],'voiceStatusCallerIdNumber':this[_0xe1c8('0x1b')],'voiceStatusQueue':this[_0xe1c8('0x1c')],'interface':this[_0xe1c8('0x10')],'onhold':this[_0xe1c8('0x1d')]};var _0x5cb9b5=md5(JSON[_0xe1c8('0x1e')](_0x48f4f0));if(this['md5']!==_0x5cb9b5){this['md5']=_0x5cb9b5;io['to'](util['format']('user:%s',_0x48f4f0[_0xe1c8('0x7')]))['emit']('user:ami:update',_[_0xe1c8('0x1f')](_0x48f4f0,[_0xe1c8('0x11')]));io[_0xe1c8('0x20')]('user:presence',_0x48f4f0);}};module[_0xe1c8('0x21')]=Agent; \ No newline at end of file +var _0x3122=['accountcode','fullname','state','unknown','stateTime','status','address','phone','mobile','interface','online','voiceStatus','voiceStatusTime','voiceStatusCallerIdNumber','prototype','updateStatusRealtime','toLowerCase','not_inuse','idle','talking','toNumber','format','voiceStatusQueue','onhold','user:%s','user:ami:update','emit','user:presence','exports','lodash','util','moment','md5','redis','defaults','localhost','socket.io-emitter','name'];(function(_0x16da8f,_0x4ddb80){var _0xd5dca8=function(_0x3b7cb6){while(--_0x3b7cb6){_0x16da8f['push'](_0x16da8f['shift']());}};_0xd5dca8(++_0x4ddb80);}(_0x3122,0x199));var _0x2312=function(_0x3bf83f,_0x181cac){_0x3bf83f=_0x3bf83f-0x0;var _0x22c4a9=_0x3122[_0x3bf83f];return _0x22c4a9;};'use strict';var _=require(_0x2312('0x0'));var util=require(_0x2312('0x1'));var moment=require(_0x2312('0x2'));var md5=require(_0x2312('0x3'));var Redis=require('ioredis');var config=require('../../../config/environment');config[_0x2312('0x4')]=_[_0x2312('0x5')](config[_0x2312('0x4')],{'host':_0x2312('0x6'),'port':0x18eb});var io=require(_0x2312('0x7'))(new Redis(config[_0x2312('0x4')]));function Agent(_0x1a4237){this['id']=_0x1a4237['id']||0x0;this[_0x2312('0x8')]=_0x1a4237[_0x2312('0x8')]||'';this['email']=_0x1a4237['email']||'';this['accountcode']=_0x1a4237[_0x2312('0x9')]||'';this[_0x2312('0xa')]=_0x1a4237[_0x2312('0xa')]||'';this[_0x2312('0xb')]=_0x2312('0xc');this[_0x2312('0xd')]=0x0;this[_0x2312('0xe')]='unknown';this[_0x2312('0xf')]='';this[_0x2312('0x10')]='';this[_0x2312('0x11')]='';this[_0x2312('0x12')]='';this[_0x2312('0x13')]=_0x1a4237['online']||![];this[_0x2312('0x14')]=_0x2312('0xc');this[_0x2312('0x15')]=0x0;this[_0x2312('0x16')]='';this['voiceStatusQueue']='';this['onhold']=![];this['local']=![];this[_0x2312('0x3')]='';}Agent[_0x2312('0x17')][_0x2312('0x18')]=function(_0x1a42b9){var _0x4c7357;if(_0x1a42b9&&_0x1a42b9['state']){_0x4c7357=_0x1a42b9[_0x2312('0xb')][_0x2312('0x19')]();switch(_0x4c7357){case _0x2312('0x1a'):_0x4c7357=_0x2312('0x1b');break;case'inuse':_0x4c7357=_0x2312('0x1c');break;}}if(_0x4c7357&&this[_0x2312('0x14')]!==_0x4c7357||_0x1a42b9['statePause']){this[_0x2312('0x15')]=_[_0x2312('0x1d')](moment()[_0x2312('0x1e')]('x'));}if(_0x4c7357){this[_0x2312('0x14')]=_0x4c7357;}var _0x1d48bc={'id':this['id'],'name':this[_0x2312('0x8')],'email':this['email'],'accountcode':this[_0x2312('0x9')],'fullname':this[_0x2312('0xa')],'state':this[_0x2312('0xb')],'stateTime':this['stateTime'],'status':this[_0x2312('0xe')],'address':this[_0x2312('0xf')],'online':this[_0x2312('0x13')],'voiceStatus':this[_0x2312('0x14')],'voiceStatusTime':this[_0x2312('0x15')],'voiceStatusCallerIdNumber':this[_0x2312('0x16')],'voiceStatusQueue':this[_0x2312('0x1f')],'interface':this[_0x2312('0x12')],'onhold':this[_0x2312('0x20')]};var _0xf46255=md5(JSON['stringify'](_0x1d48bc));if(this[_0x2312('0x3')]!==_0xf46255){this[_0x2312('0x3')]=_0xf46255;io['to'](util[_0x2312('0x1e')](_0x2312('0x21'),_0x1d48bc[_0x2312('0x8')]))['emit'](_0x2312('0x22'),_['omit'](_0x1d48bc,[_0x2312('0x13')]));io[_0x2312('0x23')](_0x2312('0x24'),_0x1d48bc);}};module[_0x2312('0x25')]=Agent; \ No newline at end of file diff --git a/server/services/ami/model/campaign.js b/server/services/ami/model/campaign.js index 6aa808f..0d9c64c 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 _0x85be=['dialMachineRetryFrequency','dialAgentRejectMaxRetry','dialAgentRejectRetryFrequency','dialOrderByScheduledAt','dialPrefix','dialRandomLastDigitCallerIdNumber','dialCutDigit','TrunkBackup','Trunk','Interval','SquareProject','dialQueueProject','dialAMDActive','dialAMDInitialSilence','dialAMDGreeting','dialAMDAfterGreetingSilence','dialAMDTotalAnalysisTime','dialAMDBetweenWordsSilence','dialAMDMaximumNumberOfWords','dialAMDSilenceThreshold','dialAMDMaximumWordLength','exports','name','campaign','originated','ivrAnswerCallsDay','ivrTotalCallsDays','sendMessageOneNotActive','active','limitCalls','dialTimezone','dialGlobalInterval','dialOriginateCallerIdName','dialOriginateCallerIdNumber','dialOriginateTimeout','dialCongestionMaxRetry','dialCongestionRetryFrequency','dialBusyMaxRetry','dialBusyRetryFrequency','dialNoAnswerRetryFrequency','dialGlobalMaxRetry','dialNoSuchNumberMaxRetry','dialNoSuchNumberRetryFrequency','dialDropMaxRetry','dialAbandonedMaxRetry','dialAbandonedRetryFrequency','dialMachineMaxRetry'];(function(_0x668885,_0x545393){var _0x5088ad=function(_0x1bcebb){while(--_0x1bcebb){_0x668885['push'](_0x668885['shift']());}};_0x5088ad(++_0x545393);}(_0x85be,0x1bd));var _0xe85b=function(_0x19391,_0x27b376){_0x19391=_0x19391-0x0;var _0x139631=_0x85be[_0x19391];return _0x139631;};'use strict';function Campaign(_0x18e549){this['id']=_0x18e549['id']||0x0;this['name']=_0x18e549[_0xe85b('0x0')]||'';this['type']=_0x18e549['type']||_0xe85b('0x1');this[_0xe85b('0x2')]=0x0;this['temp']=0x0;this[_0xe85b('0x3')]=0x0;this[_0xe85b('0x4')]=0x0;this['message']='';this[_0xe85b('0x5')]=!![];this['active']=_0x18e549[_0xe85b('0x6')];this[_0xe85b('0x7')]=_0x18e549[_0xe85b('0x7')];this['dialTimezone']=_0x18e549[_0xe85b('0x8')]||null;this[_0xe85b('0x9')]=_0x18e549['dialGlobalInterval']?_0x18e549[_0xe85b('0x9')]:null;this[_0xe85b('0xa')]=_0x18e549[_0xe85b('0xa')];this[_0xe85b('0xb')]=_0x18e549[_0xe85b('0xb')];this[_0xe85b('0xc')]=_0x18e549[_0xe85b('0xc')]||0x1e;this[_0xe85b('0xd')]=_0x18e549[_0xe85b('0xd')];this[_0xe85b('0xe')]=_0x18e549[_0xe85b('0xe')];this[_0xe85b('0xf')]=_0x18e549[_0xe85b('0xf')];this[_0xe85b('0x10')]=_0x18e549['dialBusyRetryFrequency'];this['dialNoAnswerMaxRetry']=_0x18e549['dialNoAnswerMaxRetry'];this[_0xe85b('0x11')]=_0x18e549[_0xe85b('0x11')];this['dialGlobalMaxRetry']=_0x18e549[_0xe85b('0x12')];this[_0xe85b('0x13')]=_0x18e549[_0xe85b('0x13')]||0x3;this[_0xe85b('0x14')]=_0x18e549[_0xe85b('0x14')]||0x96;this['dialDropMaxRetry']=_0x18e549[_0xe85b('0x15')]||0x3;this['dialDropRetryFrequency']=_0x18e549['dialDropRetryFrequency']||0x96;this['dialAbandonedMaxRetry']=_0x18e549[_0xe85b('0x16')]||0x3;this[_0xe85b('0x17')]=_0x18e549[_0xe85b('0x17')]||0x96;this[_0xe85b('0x18')]=_0x18e549[_0xe85b('0x18')]||0x3;this[_0xe85b('0x19')]=_0x18e549['dialMachineRetryFrequency']||0x96;this[_0xe85b('0x1a')]=_0x18e549[_0xe85b('0x1a')]||0x3;this[_0xe85b('0x1b')]=_0x18e549['dialAgentRejectRetryFrequency']||0x96;this[_0xe85b('0x1c')]=_0x18e549[_0xe85b('0x1c')]||'DESC';this[_0xe85b('0x1d')]=_0x18e549[_0xe85b('0x1d')]||undefined;this['dialRandomLastDigitCallerIdNumber']=_0x18e549[_0xe85b('0x1e')]||undefined;this[_0xe85b('0x1f')]=_0x18e549[_0xe85b('0x1f')]||undefined;this[_0xe85b('0x20')]=_0x18e549['TrunkBackup']?_0x18e549['TrunkBackup']:undefined;this['Trunk']=_0x18e549[_0xe85b('0x21')]?_0x18e549[_0xe85b('0x21')]:undefined;this[_0xe85b('0x22')]=_0x18e549['Interval']?_0x18e549[_0xe85b('0x22')]:undefined;this[_0xe85b('0x23')]=_0x18e549[_0xe85b('0x23')]?_0x18e549[_0xe85b('0x23')]:undefined;this[_0xe85b('0x24')]=_0x18e549['SquareProject']?_0x18e549[_0xe85b('0x23')]['name']:undefined;this[_0xe85b('0x25')]=_0x18e549['dialAMDActive']||![];this[_0xe85b('0x26')]=_0x18e549[_0xe85b('0x26')];this[_0xe85b('0x27')]=_0x18e549[_0xe85b('0x27')];this[_0xe85b('0x28')]=_0x18e549['dialAMDAfterGreetingSilence'];this['dialAMDTotalAnalysisTime']=_0x18e549[_0xe85b('0x29')];this['dialAMDMinWordLength']=_0x18e549['dialAMDMinWordLength'];this[_0xe85b('0x2a')]=_0x18e549[_0xe85b('0x2a')];this[_0xe85b('0x2b')]=_0x18e549[_0xe85b('0x2b')];this[_0xe85b('0x2c')]=_0x18e549[_0xe85b('0x2c')];this[_0xe85b('0x2d')]=_0x18e549[_0xe85b('0x2d')];}module[_0xe85b('0x2e')]=Campaign; \ No newline at end of file +var _0x5632=['dialCongestionRetryFrequency','dialBusyMaxRetry','dialBusyRetryFrequency','dialNoAnswerMaxRetry','dialNoAnswerRetryFrequency','dialGlobalMaxRetry','dialNoSuchNumberMaxRetry','dialNoSuchNumberRetryFrequency','dialDropMaxRetry','dialDropRetryFrequency','dialAbandonedMaxRetry','dialAbandonedRetryFrequency','dialMachineMaxRetry','dialMachineRetryFrequency','dialAgentRejectMaxRetry','dialAgentRejectRetryFrequency','dialOrderByScheduledAt','DESC','dialPrefix','dialRandomLastDigitCallerIdNumber','dialCutDigit','TrunkBackup','Trunk','Interval','SquareProject','dialQueueProject','dialAMDActive','dialAMDInitialSilence','dialAMDGreeting','dialAMDAfterGreetingSilence','dialAMDTotalAnalysisTime','dialAMDMinWordLength','dialAMDBetweenWordsSilence','dialAMDMaximumWordLength','exports','name','type','campaign','originated','temp','message','sendMessageOneNotActive','active','limitCalls','dialTimezone','dialGlobalInterval','dialOriginateCallerIdName','dialOriginateCallerIdNumber','dialOriginateTimeout','dialCongestionMaxRetry'];(function(_0x53561b,_0x1706b3){var _0x3fa06d=function(_0x234ea1){while(--_0x234ea1){_0x53561b['push'](_0x53561b['shift']());}};_0x3fa06d(++_0x1706b3);}(_0x5632,0xeb));var _0x2563=function(_0x20265a,_0x12d62d){_0x20265a=_0x20265a-0x0;var _0x1c373e=_0x5632[_0x20265a];return _0x1c373e;};'use strict';function Campaign(_0x12f59c){this['id']=_0x12f59c['id']||0x0;this[_0x2563('0x0')]=_0x12f59c[_0x2563('0x0')]||'';this[_0x2563('0x1')]=_0x12f59c[_0x2563('0x1')]||_0x2563('0x2');this[_0x2563('0x3')]=0x0;this[_0x2563('0x4')]=0x0;this['ivrAnswerCallsDay']=0x0;this['ivrTotalCallsDays']=0x0;this[_0x2563('0x5')]='';this[_0x2563('0x6')]=!![];this['active']=_0x12f59c[_0x2563('0x7')];this[_0x2563('0x8')]=_0x12f59c['limitCalls'];this[_0x2563('0x9')]=_0x12f59c[_0x2563('0x9')]||null;this[_0x2563('0xa')]=_0x12f59c['dialGlobalInterval']?_0x12f59c['dialGlobalInterval']:null;this[_0x2563('0xb')]=_0x12f59c[_0x2563('0xb')];this[_0x2563('0xc')]=_0x12f59c[_0x2563('0xc')];this[_0x2563('0xd')]=_0x12f59c[_0x2563('0xd')]||0x1e;this[_0x2563('0xe')]=_0x12f59c['dialCongestionMaxRetry'];this['dialCongestionRetryFrequency']=_0x12f59c[_0x2563('0xf')];this[_0x2563('0x10')]=_0x12f59c['dialBusyMaxRetry'];this[_0x2563('0x11')]=_0x12f59c[_0x2563('0x11')];this['dialNoAnswerMaxRetry']=_0x12f59c[_0x2563('0x12')];this[_0x2563('0x13')]=_0x12f59c[_0x2563('0x13')];this['dialGlobalMaxRetry']=_0x12f59c[_0x2563('0x14')];this[_0x2563('0x15')]=_0x12f59c[_0x2563('0x15')]||0x3;this[_0x2563('0x16')]=_0x12f59c[_0x2563('0x16')]||0x96;this[_0x2563('0x17')]=_0x12f59c[_0x2563('0x17')]||0x3;this[_0x2563('0x18')]=_0x12f59c[_0x2563('0x18')]||0x96;this[_0x2563('0x19')]=_0x12f59c['dialAbandonedMaxRetry']||0x3;this[_0x2563('0x1a')]=_0x12f59c[_0x2563('0x1a')]||0x96;this[_0x2563('0x1b')]=_0x12f59c[_0x2563('0x1b')]||0x3;this['dialMachineRetryFrequency']=_0x12f59c[_0x2563('0x1c')]||0x96;this[_0x2563('0x1d')]=_0x12f59c[_0x2563('0x1d')]||0x3;this['dialAgentRejectRetryFrequency']=_0x12f59c[_0x2563('0x1e')]||0x96;this[_0x2563('0x1f')]=_0x12f59c['dialOrderByScheduledAt']||_0x2563('0x20');this[_0x2563('0x21')]=_0x12f59c[_0x2563('0x21')]||undefined;this[_0x2563('0x22')]=_0x12f59c[_0x2563('0x22')]||undefined;this['dialCutDigit']=_0x12f59c[_0x2563('0x23')]||undefined;this[_0x2563('0x24')]=_0x12f59c['TrunkBackup']?_0x12f59c[_0x2563('0x24')]:undefined;this[_0x2563('0x25')]=_0x12f59c[_0x2563('0x25')]?_0x12f59c[_0x2563('0x25')]:undefined;this['Interval']=_0x12f59c[_0x2563('0x26')]?_0x12f59c[_0x2563('0x26')]:undefined;this[_0x2563('0x27')]=_0x12f59c[_0x2563('0x27')]?_0x12f59c[_0x2563('0x27')]:undefined;this[_0x2563('0x28')]=_0x12f59c[_0x2563('0x27')]?_0x12f59c[_0x2563('0x27')]['name']:undefined;this[_0x2563('0x29')]=_0x12f59c[_0x2563('0x29')]||![];this[_0x2563('0x2a')]=_0x12f59c[_0x2563('0x2a')];this[_0x2563('0x2b')]=_0x12f59c[_0x2563('0x2b')];this['dialAMDAfterGreetingSilence']=_0x12f59c[_0x2563('0x2c')];this[_0x2563('0x2d')]=_0x12f59c[_0x2563('0x2d')];this['dialAMDMinWordLength']=_0x12f59c[_0x2563('0x2e')];this[_0x2563('0x2f')]=_0x12f59c['dialAMDBetweenWordsSilence'];this['dialAMDMaximumNumberOfWords']=_0x12f59c['dialAMDMaximumNumberOfWords'];this['dialAMDSilenceThreshold']=_0x12f59c['dialAMDSilenceThreshold'];this[_0x2563('0x30')]=_0x12f59c[_0x2563('0x30')];}module[_0x2563('0x31')]=Campaign; \ No newline at end of file diff --git a/server/services/ami/model/channel.js b/server/services/ami/model/channel.js index 4bce521..9ab6bf3 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 _0xc5c0=['monitors','transferconnectedlinenum','mohtime','exports','starttime','channel','destinationchannel','connectedlinenum','connectedlinename','context','uniqueid','linkedid','exten','answered','answertime','endtime','abandoned','lastapplication','duration','billableseconds','holdtime','type','disposition','monitor','monitorFilename','queue'];(function(_0x1f97c4,_0x5e1a71){var _0x2ade2e=function(_0xcc45a0){while(--_0xcc45a0){_0x1f97c4['push'](_0x1f97c4['shift']());}};_0x2ade2e(++_0x5e1a71);}(_0xc5c0,0x6c));var _0x0c5c=function(_0xcb766e,_0x397152){_0xcb766e=_0xcb766e-0x0;var _0x527c6e=_0xc5c0[_0xcb766e];return _0x527c6e;};'use strict';function Channel(){this[_0x0c5c('0x0')]=null;this[_0x0c5c('0x1')]='';this[_0x0c5c('0x2')]='';this['calleridnum']=0x0;this['calleridname']='';this[_0x0c5c('0x3')]=undefined;this[_0x0c5c('0x4')]=undefined;this['accountcode']=0x0;this[_0x0c5c('0x5')]='';this[_0x0c5c('0x6')]=0x0;this[_0x0c5c('0x7')]=0x0;this[_0x0c5c('0x8')]=0x0;this[_0x0c5c('0x9')]=![];this[_0x0c5c('0xa')]=null;this[_0x0c5c('0xb')]=null;this['unmanaged']=![];this[_0x0c5c('0xc')]=![];this[_0x0c5c('0xd')]='';this['lastdata']='';this[_0x0c5c('0xe')]=0x0;this[_0x0c5c('0xf')]=0x0;this[_0x0c5c('0x10')]=0x0;this[_0x0c5c('0x11')]=null;this['tag']=null;this[_0x0c5c('0x12')]=null;this[_0x0c5c('0x13')]=![];this[_0x0c5c('0x14')]=null;this[_0x0c5c('0x15')]=null;this[_0x0c5c('0x16')]=[];this['transfercalleridnum']=undefined;this[_0x0c5c('0x17')]=undefined;this['transferType']=undefined;this[_0x0c5c('0x18')]=0x0;}module[_0x0c5c('0x19')]=Channel; \ No newline at end of file +var _0xcae2=['lastapplication','type','tag','disposition','monitor','monitorFilename','queue','transfercalleridnum','transferType','mohtime','exports','starttime','channel','destinationchannel','calleridnum','calleridname','connectedlinenum','connectedlinename','context','uniqueid','linkedid','exten','answertime','endtime','unmanaged','abandoned'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xcae2,0x143));var _0x2cae=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0xcae2[_0x321bb2];return _0x9c12ed;};'use strict';function Channel(){this[_0x2cae('0x0')]=null;this[_0x2cae('0x1')]='';this[_0x2cae('0x2')]='';this[_0x2cae('0x3')]=0x0;this[_0x2cae('0x4')]='';this[_0x2cae('0x5')]=undefined;this[_0x2cae('0x6')]=undefined;this['accountcode']=0x0;this[_0x2cae('0x7')]='';this[_0x2cae('0x8')]=0x0;this[_0x2cae('0x9')]=0x0;this[_0x2cae('0xa')]=0x0;this['answered']=![];this[_0x2cae('0xb')]=null;this[_0x2cae('0xc')]=null;this[_0x2cae('0xd')]=![];this[_0x2cae('0xe')]=![];this[_0x2cae('0xf')]='';this['lastdata']='';this['duration']=0x0;this['billableseconds']=0x0;this['holdtime']=0x0;this[_0x2cae('0x10')]=null;this[_0x2cae('0x11')]=null;this[_0x2cae('0x12')]=null;this[_0x2cae('0x13')]=![];this[_0x2cae('0x14')]=null;this[_0x2cae('0x15')]=null;this['monitors']=[];this[_0x2cae('0x16')]=undefined;this['transferconnectedlinenum']=undefined;this[_0x2cae('0x17')]=undefined;this[_0x2cae('0x18')]=0x0;}module[_0x2cae('0x19')]=Channel; \ No newline at end of file diff --git a/server/services/ami/model/deskAccount.js b/server/services/ami/model/deskAccount.js index d494e50..718e9f4 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 _0xcf38=['consumerKey','consumerSecret','token','tokenSecret','type','serverUrl','Configurations','exports','name','username','authType','password'];(function(_0x341e0f,_0x4a09d0){var _0x59555a=function(_0x4343a8){while(--_0x4343a8){_0x341e0f['push'](_0x341e0f['shift']());}};_0x59555a(++_0x4a09d0);}(_0xcf38,0x80));var _0x8cf3=function(_0x353c9a,_0x289c6a){_0x353c9a=_0x353c9a-0x0;var _0x34c141=_0xcf38[_0x353c9a];return _0x34c141;};'use strict';function DeskAccount(_0x5198f9){this['id']=_0x5198f9['id']||0x0;this['name']=_0x5198f9[_0x8cf3('0x0')]||'';this[_0x8cf3('0x1')]=_0x5198f9[_0x8cf3('0x1')]||'';this['remoteUri']=_0x5198f9['remoteUri']||'';this[_0x8cf3('0x2')]=_0x5198f9[_0x8cf3('0x2')]||'';this[_0x8cf3('0x3')]=_0x5198f9['password']||'';this[_0x8cf3('0x4')]=_0x5198f9['consumerKey']||'';this[_0x8cf3('0x5')]=_0x5198f9[_0x8cf3('0x5')]||'';this['token']=_0x5198f9[_0x8cf3('0x6')]||'';this['tokenSecret']=_0x5198f9[_0x8cf3('0x7')]||'';this[_0x8cf3('0x8')]=_0x5198f9[_0x8cf3('0x8')]||'';this[_0x8cf3('0x9')]=_0x5198f9['serverUrl']||'';this[_0x8cf3('0xa')]=_0x5198f9['Configurations']||{};}module[_0x8cf3('0xb')]=DeskAccount; \ No newline at end of file +var _0xd61d=['username','remoteUri','authType','consumerKey','consumerSecret','token','tokenSecret','type','serverUrl','Configurations','exports','name'];(function(_0x19115e,_0x507bab){var _0x45bbd4=function(_0x1308bf){while(--_0x1308bf){_0x19115e['push'](_0x19115e['shift']());}};_0x45bbd4(++_0x507bab);}(_0xd61d,0x14f));var _0xdd61=function(_0xea318c,_0x41f26e){_0xea318c=_0xea318c-0x0;var _0x3b28de=_0xd61d[_0xea318c];return _0x3b28de;};'use strict';function DeskAccount(_0x4739cd){this['id']=_0x4739cd['id']||0x0;this[_0xdd61('0x0')]=_0x4739cd['name']||'';this['username']=_0x4739cd[_0xdd61('0x1')]||'';this[_0xdd61('0x2')]=_0x4739cd[_0xdd61('0x2')]||'';this['authType']=_0x4739cd[_0xdd61('0x3')]||'';this['password']=_0x4739cd['password']||'';this[_0xdd61('0x4')]=_0x4739cd['consumerKey']||'';this[_0xdd61('0x5')]=_0x4739cd[_0xdd61('0x5')]||'';this[_0xdd61('0x6')]=_0x4739cd[_0xdd61('0x6')]||'';this['tokenSecret']=_0x4739cd[_0xdd61('0x7')]||'';this[_0xdd61('0x8')]=_0x4739cd['type']||'';this['serverUrl']=_0x4739cd[_0xdd61('0x9')]||'';this[_0xdd61('0xa')]=_0x4739cd[_0xdd61('0xa')]||{};}module[_0xdd61('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 aa59bc0..149e626 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 _0xb0ba=['remoteUri','tenantId','clientId','clientSecret','serverUrl','modernAuthentication','Configurations','CloudProvider','exports','name','username','password'];(function(_0x3f9aef,_0x1acb89){var _0x27d60d=function(_0x597aea){while(--_0x597aea){_0x3f9aef['push'](_0x3f9aef['shift']());}};_0x27d60d(++_0x1acb89);}(_0xb0ba,0x129));var _0xab0b=function(_0xf11fc3,_0x3ef6f7){_0xf11fc3=_0xf11fc3-0x0;var _0x338298=_0xb0ba[_0xf11fc3];return _0x338298;};'use strict';function Dynamics365Account(_0x3d33bd){this['id']=_0x3d33bd['id']||0x0;this[_0xab0b('0x0')]=_0x3d33bd[_0xab0b('0x0')]||'';this['username']=_0x3d33bd[_0xab0b('0x1')]||'';this['password']=_0x3d33bd[_0xab0b('0x2')]||'';this[_0xab0b('0x3')]=_0x3d33bd[_0xab0b('0x3')]||'';this[_0xab0b('0x4')]=_0x3d33bd[_0xab0b('0x4')]||'';this[_0xab0b('0x5')]=_0x3d33bd[_0xab0b('0x5')]||'';this[_0xab0b('0x6')]=_0x3d33bd[_0xab0b('0x6')]||{};this['serverUrl']=_0x3d33bd[_0xab0b('0x7')]||'';this[_0xab0b('0x8')]=_0x3d33bd['modernAuthentication']||![];this['Configurations']=_0x3d33bd[_0xab0b('0x9')]||{};this[_0xab0b('0xa')]=_0x3d33bd[_0xab0b('0xa')]||{};}module[_0xab0b('0xb')]=Dynamics365Account; \ No newline at end of file +var _0x4b66=['remoteUri','tenantId','clientSecret','modernAuthentication','Configurations','CloudProvider','exports','name','username','password'];(function(_0x14363e,_0x4f0e0d){var _0x17c56d=function(_0x1c7bac){while(--_0x1c7bac){_0x14363e['push'](_0x14363e['shift']());}};_0x17c56d(++_0x4f0e0d);}(_0x4b66,0x115));var _0x64b6=function(_0x2641f9,_0x26715f){_0x2641f9=_0x2641f9-0x0;var _0x585741=_0x4b66[_0x2641f9];return _0x585741;};'use strict';function Dynamics365Account(_0x5deed3){this['id']=_0x5deed3['id']||0x0;this['name']=_0x5deed3[_0x64b6('0x0')]||'';this[_0x64b6('0x1')]=_0x5deed3[_0x64b6('0x1')]||'';this[_0x64b6('0x2')]=_0x5deed3[_0x64b6('0x2')]||'';this[_0x64b6('0x3')]=_0x5deed3[_0x64b6('0x3')]||'';this[_0x64b6('0x4')]=_0x5deed3[_0x64b6('0x4')]||'';this['clientId']=_0x5deed3['clientId']||'';this[_0x64b6('0x5')]=_0x5deed3[_0x64b6('0x5')]||{};this['serverUrl']=_0x5deed3['serverUrl']||'';this[_0x64b6('0x6')]=_0x5deed3[_0x64b6('0x6')]||![];this[_0x64b6('0x7')]=_0x5deed3[_0x64b6('0x7')]||{};this[_0x64b6('0x8')]=_0x5deed3['CloudProvider']||{};}module[_0x64b6('0x9')]=Dynamics365Account; \ No newline at end of file diff --git a/server/services/ami/model/faxAccount.js b/server/services/ami/model/faxAccount.js index 073e5e2..0732920 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 _0xd006=['ListId','key','exports','name','description','ecm','headerinfo','localstationid','maxrate','modem','v17,v27,v29','gateway','faxdetect','t38timeout','tech','SIP','Trunk'];(function(_0x932068,_0x204ebb){var _0x27643d=function(_0x3c97ef){while(--_0x3c97ef){_0x932068['push'](_0x932068['shift']());}};_0x27643d(++_0x204ebb);}(_0xd006,0x102));var _0x6d00=function(_0x48e1ec,_0x35f468){_0x48e1ec=_0x48e1ec-0x0;var _0x3b33eb=_0xd006[_0x48e1ec];return _0x3b33eb;};'use strict';function FaxAccount(_0x1a36d5){this['id']=_0x1a36d5['id']||0x0;this[_0x6d00('0x0')]=_0x1a36d5[_0x6d00('0x0')]||'';this[_0x6d00('0x1')]=_0x1a36d5['description'];this[_0x6d00('0x2')]=_0x1a36d5[_0x6d00('0x2')];this['headerinfo']=_0x1a36d5[_0x6d00('0x3')];this[_0x6d00('0x4')]=_0x1a36d5[_0x6d00('0x4')];this['minrate']=_0x1a36d5['minrate']||0x960;this[_0x6d00('0x5')]=_0x1a36d5[_0x6d00('0x5')]||0x3840;this[_0x6d00('0x6')]=_0x1a36d5[_0x6d00('0x6')]||_0x6d00('0x7');this['gateway']=_0x1a36d5[_0x6d00('0x8')]||'no';this[_0x6d00('0x9')]=_0x1a36d5[_0x6d00('0x9')]||'no';this[_0x6d00('0xa')]=_0x1a36d5[_0x6d00('0xa')]||0x1388;this[_0x6d00('0xb')]=_0x1a36d5[_0x6d00('0xb')]||_0x6d00('0xc');this[_0x6d00('0xd')]=_0x1a36d5['Trunk']?_0x1a36d5[_0x6d00('0xd')]:undefined;this[_0x6d00('0xe')]=_0x1a36d5[_0x6d00('0xe')];this['key']=_0x1a36d5[_0x6d00('0xf')];}module[_0x6d00('0x10')]=FaxAccount; \ No newline at end of file +var _0xbd76=['minrate','modem','v17,v27,v29','gateway','faxdetect','t38timeout','Trunk','ListId','key','name','description','ecm','headerinfo','localstationid'];(function(_0x45471a,_0x3d2e45){var _0x339cf8=function(_0x1c2a05){while(--_0x1c2a05){_0x45471a['push'](_0x45471a['shift']());}};_0x339cf8(++_0x3d2e45);}(_0xbd76,0x1ad));var _0x6bd7=function(_0x126558,_0x143c9a){_0x126558=_0x126558-0x0;var _0x1f6d14=_0xbd76[_0x126558];return _0x1f6d14;};'use strict';function FaxAccount(_0x1f428e){this['id']=_0x1f428e['id']||0x0;this[_0x6bd7('0x0')]=_0x1f428e[_0x6bd7('0x0')]||'';this[_0x6bd7('0x1')]=_0x1f428e[_0x6bd7('0x1')];this[_0x6bd7('0x2')]=_0x1f428e[_0x6bd7('0x2')];this[_0x6bd7('0x3')]=_0x1f428e['headerinfo'];this[_0x6bd7('0x4')]=_0x1f428e[_0x6bd7('0x4')];this[_0x6bd7('0x5')]=_0x1f428e[_0x6bd7('0x5')]||0x960;this['maxrate']=_0x1f428e['maxrate']||0x3840;this['modem']=_0x1f428e[_0x6bd7('0x6')]||_0x6bd7('0x7');this[_0x6bd7('0x8')]=_0x1f428e[_0x6bd7('0x8')]||'no';this['faxdetect']=_0x1f428e[_0x6bd7('0x9')]||'no';this[_0x6bd7('0xa')]=_0x1f428e[_0x6bd7('0xa')]||0x1388;this['tech']=_0x1f428e['tech']||'SIP';this[_0x6bd7('0xb')]=_0x1f428e[_0x6bd7('0xb')]?_0x1f428e[_0x6bd7('0xb')]:undefined;this[_0x6bd7('0xc')]=_0x1f428e[_0x6bd7('0xc')];this['key']=_0x1f428e[_0x6bd7('0xd')];}module['exports']=FaxAccount; \ No newline at end of file diff --git a/server/services/ami/model/freshdeskAccount.js b/server/services/ami/model/freshdeskAccount.js index ac4e6e2..e559250 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 _0xfecc=['apiKey','token','serverUrl','exports','name'];(function(_0x1bb812,_0x23eacc){var _0x372adb=function(_0x5ad456){while(--_0x5ad456){_0x1bb812['push'](_0x1bb812['shift']());}};_0x372adb(++_0x23eacc);}(_0xfecc,0x1f3));var _0xcfec=function(_0x3a3c3d,_0x19fb39){_0x3a3c3d=_0x3a3c3d-0x0;var _0x3ac6ad=_0xfecc[_0x3a3c3d];return _0x3ac6ad;};'use strict';function FreshdeskAccount(_0x320980){this['id']=_0x320980['id']||0x0;this['name']=_0x320980[_0xcfec('0x0')]||'';this['username']=_0x320980['username']||'';this[_0xcfec('0x1')]=_0x320980[_0xcfec('0x2')]||'';this['remoteUri']=_0x320980['remoteUri']||'';this['serverUrl']=_0x320980[_0xcfec('0x3')]||'';this['Configurations']=_0x320980['Configurations']||{};}module[_0xcfec('0x4')]=FreshdeskAccount; \ No newline at end of file +var _0xcf75=['remoteUri','serverUrl','Configurations','name','username','token'];(function(_0x4b369d,_0x265eb8){var _0x571a98=function(_0x56341a){while(--_0x56341a){_0x4b369d['push'](_0x4b369d['shift']());}};_0x571a98(++_0x265eb8);}(_0xcf75,0xb1));var _0x5cf7=function(_0x5c9c0f,_0x36c608){_0x5c9c0f=_0x5c9c0f-0x0;var _0x180fe6=_0xcf75[_0x5c9c0f];return _0x180fe6;};'use strict';function FreshdeskAccount(_0x4455b6){this['id']=_0x4455b6['id']||0x0;this[_0x5cf7('0x0')]=_0x4455b6['name']||'';this[_0x5cf7('0x1')]=_0x4455b6[_0x5cf7('0x1')]||'';this['apiKey']=_0x4455b6[_0x5cf7('0x2')]||'';this[_0x5cf7('0x3')]=_0x4455b6[_0x5cf7('0x3')]||'';this[_0x5cf7('0x4')]=_0x4455b6[_0x5cf7('0x4')]||'';this[_0x5cf7('0x5')]=_0x4455b6['Configurations']||{};}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 158bf8f..dc7eb7e 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 _0x2975=['apiKey','token','serverUrl','Configurations','exports','name','username'];(function(_0x5ce60e,_0x723a77){var _0x4e2444=function(_0x2fb58e){while(--_0x2fb58e){_0x5ce60e['push'](_0x5ce60e['shift']());}};_0x4e2444(++_0x723a77);}(_0x2975,0x1c5));var _0x5297=function(_0x57eb9f,_0x4b159c){_0x57eb9f=_0x57eb9f-0x0;var _0x279f57=_0x2975[_0x57eb9f];return _0x279f57;};'use strict';function FreshsalesAccount(_0xda2e11){this['id']=_0xda2e11['id']||0x0;this[_0x5297('0x0')]=_0xda2e11[_0x5297('0x0')]||'';this[_0x5297('0x1')]=_0xda2e11[_0x5297('0x1')]||'';this[_0x5297('0x2')]=_0xda2e11[_0x5297('0x3')]||'';this['remoteUri']=_0xda2e11['remoteUri']||'';this['serverUrl']=_0xda2e11[_0x5297('0x4')]||'';this[_0x5297('0x5')]=_0xda2e11[_0x5297('0x5')]||{};}module[_0x5297('0x6')]=FreshsalesAccount; \ No newline at end of file +var _0x15c6=['username','apiKey','token','remoteUri','Configurations','exports','name'];(function(_0x4a53d,_0x58a95e){var _0x27410e=function(_0x38fc90){while(--_0x38fc90){_0x4a53d['push'](_0x4a53d['shift']());}};_0x27410e(++_0x58a95e);}(_0x15c6,0x1cd));var _0x615c=function(_0x4565bf,_0x5ad9d6){_0x4565bf=_0x4565bf-0x0;var _0x5610ba=_0x15c6[_0x4565bf];return _0x5610ba;};'use strict';function FreshsalesAccount(_0x151ccb){this['id']=_0x151ccb['id']||0x0;this[_0x615c('0x0')]=_0x151ccb[_0x615c('0x0')]||'';this[_0x615c('0x1')]=_0x151ccb[_0x615c('0x1')]||'';this[_0x615c('0x2')]=_0x151ccb[_0x615c('0x3')]||'';this[_0x615c('0x4')]=_0x151ccb['remoteUri']||'';this['serverUrl']=_0x151ccb['serverUrl']||'';this[_0x615c('0x5')]=_0x151ccb[_0x615c('0x5')]||{};}module[_0x615c('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 844f8ae..154fbaf 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 _0x96ac=['mohtime','variables','exports','type','inbound','uniqueid','calleridnum','queue','queuecallerjoinAt','position','count','queuecallercomplete','queuecallercompleteAt','channel','connectedlinenum','connectedlinename','accountcode','context','exten','priority','holdtime','lastAssignedTo','motionChannel','voice'];(function(_0x4b33c0,_0x17fb55){var _0x43c889=function(_0x410c0d){while(--_0x410c0d){_0x4b33c0['push'](_0x4b33c0['shift']());}};_0x43c889(++_0x17fb55);}(_0x96ac,0x13b));var _0xc96a=function(_0x43aa05,_0x209827){_0x43aa05=_0x43aa05-0x0;var _0x3d0c15=_0x96ac[_0x43aa05];return _0x3d0c15;};'use strict';function QueueReport(){this[_0xc96a('0x0')]=_0xc96a('0x1');this[_0xc96a('0x2')]='';this[_0xc96a('0x3')]='';this['calleridname']='';this[_0xc96a('0x4')]='';this[_0xc96a('0x5')]=null;this['queuecallerleaveAt']=null;this[_0xc96a('0x6')]=0x1;this[_0xc96a('0x7')]=0x1;this['queuecallerabandon']=![];this['queuecallerabandonAt']=null;this[_0xc96a('0x8')]=![];this[_0xc96a('0x9')]=null;this['queuecallerexit']=![];this['queuecallerexitAt']=null;this['originalposition']=0x1;this[_0xc96a('0xa')]='';this[_0xc96a('0xb')]='';this[_0xc96a('0xc')]='';this[_0xc96a('0xd')]='';this[_0xc96a('0xe')]='';this[_0xc96a('0xf')]='';this[_0xc96a('0x10')]='';this[_0xc96a('0x11')]=0x0;this['assigned']=![];this[_0xc96a('0x12')]='';this[_0xc96a('0x13')]=_0xc96a('0x14');this['routealias']=null;this[_0xc96a('0x15')]=0x0;this[_0xc96a('0x16')]={};}module[_0xc96a('0x17')]=QueueReport; \ No newline at end of file +var _0xac12=['queuecallerleaveAt','position','count','queuecallerabandonAt','queuecallercomplete','queuecallercompleteAt','queuecallerexit','queuecallerexitAt','channel','accountcode','context','exten','lastAssignedTo','motionChannel','voice','variables','exports','type','inbound','uniqueid','calleridname','queue'];(function(_0x562263,_0x52c3e6){var _0x1d6475=function(_0x3d0d37){while(--_0x3d0d37){_0x562263['push'](_0x562263['shift']());}};_0x1d6475(++_0x52c3e6);}(_0xac12,0x69));var _0x2ac1=function(_0x3889e9,_0x90d424){_0x3889e9=_0x3889e9-0x0;var _0x8a6c56=_0xac12[_0x3889e9];return _0x8a6c56;};'use strict';function QueueReport(){this[_0x2ac1('0x0')]=_0x2ac1('0x1');this[_0x2ac1('0x2')]='';this['calleridnum']='';this[_0x2ac1('0x3')]='';this[_0x2ac1('0x4')]='';this['queuecallerjoinAt']=null;this[_0x2ac1('0x5')]=null;this[_0x2ac1('0x6')]=0x1;this[_0x2ac1('0x7')]=0x1;this['queuecallerabandon']=![];this[_0x2ac1('0x8')]=null;this[_0x2ac1('0x9')]=![];this[_0x2ac1('0xa')]=null;this[_0x2ac1('0xb')]=![];this[_0x2ac1('0xc')]=null;this['originalposition']=0x1;this[_0x2ac1('0xd')]='';this['connectedlinenum']='';this['connectedlinename']='';this[_0x2ac1('0xe')]='';this[_0x2ac1('0xf')]='';this[_0x2ac1('0x10')]='';this['priority']='';this['holdtime']=0x0;this['assigned']=![];this[_0x2ac1('0x11')]='';this[_0x2ac1('0x12')]=_0x2ac1('0x13');this['routealias']=null;this['mohtime']=0x0;this[_0x2ac1('0x14')]={};}module[_0x2ac1('0x15')]=QueueReport; \ No newline at end of file diff --git a/server/services/ami/model/salesforceAccount.js b/server/services/ami/model/salesforceAccount.js index 184b531..2a15b87 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 _0x946c=['securityToken','type','integrationTab','serverUrl','Configurations','exports','name','username','remoteUri','password','clientId','clientSecret'];(function(_0x5447fd,_0x52a6b5){var _0x15b28a=function(_0x370d4f){while(--_0x370d4f){_0x5447fd['push'](_0x5447fd['shift']());}};_0x15b28a(++_0x52a6b5);}(_0x946c,0x17a));var _0xc946=function(_0x47b58b,_0x41a189){_0x47b58b=_0x47b58b-0x0;var _0x46bebe=_0x946c[_0x47b58b];return _0x46bebe;};'use strict';function SalesforceAccount(_0x4eff8a){this['id']=_0x4eff8a['id']||0x0;this[_0xc946('0x0')]=_0x4eff8a[_0xc946('0x0')]||'';this[_0xc946('0x1')]=_0x4eff8a[_0xc946('0x1')]||'';this[_0xc946('0x2')]=_0x4eff8a[_0xc946('0x2')]||'';this['password']=_0x4eff8a[_0xc946('0x3')]||'';this['clientId']=_0x4eff8a[_0xc946('0x4')]||'';this['clientSecret']=_0x4eff8a[_0xc946('0x5')]||'';this[_0xc946('0x6')]=_0x4eff8a[_0xc946('0x6')]||'';this[_0xc946('0x7')]=_0x4eff8a['type']||_0xc946('0x8');this[_0xc946('0x9')]=_0x4eff8a[_0xc946('0x9')]||'';this[_0xc946('0xa')]=_0x4eff8a[_0xc946('0xa')]||{};}module[_0xc946('0xb')]=SalesforceAccount; \ No newline at end of file +var _0xaee1=['password','clientId','securityToken','type','serverUrl','Configurations','name','username','remoteUri'];(function(_0x2a453b,_0x479c50){var _0x132f79=function(_0x5e3d83){while(--_0x5e3d83){_0x2a453b['push'](_0x2a453b['shift']());}};_0x132f79(++_0x479c50);}(_0xaee1,0x12f));var _0x1aee=function(_0x1c42df,_0x7ae086){_0x1c42df=_0x1c42df-0x0;var _0x32218b=_0xaee1[_0x1c42df];return _0x32218b;};'use strict';function SalesforceAccount(_0x5ac827){this['id']=_0x5ac827['id']||0x0;this['name']=_0x5ac827[_0x1aee('0x0')]||'';this['username']=_0x5ac827[_0x1aee('0x1')]||'';this[_0x1aee('0x2')]=_0x5ac827[_0x1aee('0x2')]||'';this[_0x1aee('0x3')]=_0x5ac827[_0x1aee('0x3')]||'';this['clientId']=_0x5ac827[_0x1aee('0x4')]||'';this['clientSecret']=_0x5ac827['clientSecret']||'';this[_0x1aee('0x5')]=_0x5ac827[_0x1aee('0x5')]||'';this[_0x1aee('0x6')]=_0x5ac827[_0x1aee('0x6')]||'integrationTab';this[_0x1aee('0x7')]=_0x5ac827[_0x1aee('0x7')]||'';this[_0x1aee('0x8')]=_0x5ac827[_0x1aee('0x8')]||{};}module['exports']=SalesforceAccount; \ No newline at end of file diff --git a/server/services/ami/model/servicenowAccount.js b/server/services/ami/model/servicenowAccount.js index a1cf663..a1baf24 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 _0xa1e2=['serverUrl','Configurations','exports','name','username','password','remoteUri'];(function(_0x352a93,_0x2d9522){var _0x4a0982=function(_0x26129c){while(--_0x26129c){_0x352a93['push'](_0x352a93['shift']());}};_0x4a0982(++_0x2d9522);}(_0xa1e2,0x1f4));var _0x2a1e=function(_0x4d1329,_0x2b1ee0){_0x4d1329=_0x4d1329-0x0;var _0x218625=_0xa1e2[_0x4d1329];return _0x218625;};'use strict';function ServicenowAccount(_0x1c1280){this['id']=_0x1c1280['id']||0x0;this['name']=_0x1c1280[_0x2a1e('0x0')]||'';this[_0x2a1e('0x1')]=_0x1c1280['username']||'';this['password']=_0x1c1280[_0x2a1e('0x2')]||'';this['remoteUri']=_0x1c1280[_0x2a1e('0x3')]||'';this[_0x2a1e('0x4')]=_0x1c1280['serverUrl']||'';this[_0x2a1e('0x5')]=_0x1c1280[_0x2a1e('0x5')]||{};}module[_0x2a1e('0x6')]=ServicenowAccount; \ No newline at end of file +var _0xa1c0=['name','username','password','remoteUri','serverUrl','Configurations','exports'];(function(_0x377a6e,_0x59b99d){var _0x37f751=function(_0x2ed25c){while(--_0x2ed25c){_0x377a6e['push'](_0x377a6e['shift']());}};_0x37f751(++_0x59b99d);}(_0xa1c0,0x77));var _0x0a1c=function(_0x3947c9,_0x4d6c97){_0x3947c9=_0x3947c9-0x0;var _0x2e7871=_0xa1c0[_0x3947c9];return _0x2e7871;};'use strict';function ServicenowAccount(_0x5d92de){this['id']=_0x5d92de['id']||0x0;this[_0x0a1c('0x0')]=_0x5d92de[_0x0a1c('0x0')]||'';this[_0x0a1c('0x1')]=_0x5d92de[_0x0a1c('0x1')]||'';this[_0x0a1c('0x2')]=_0x5d92de[_0x0a1c('0x2')]||'';this[_0x0a1c('0x3')]=_0x5d92de[_0x0a1c('0x3')]||'';this[_0x0a1c('0x4')]=_0x5d92de[_0x0a1c('0x4')]||'';this[_0x0a1c('0x5')]=_0x5d92de[_0x0a1c('0x5')]||{};}module[_0x0a1c('0x6')]=ServicenowAccount; \ No newline at end of file diff --git a/server/services/ami/model/sugarcrmAccount.js b/server/services/ami/model/sugarcrmAccount.js index e56a47d..64255be 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 _0xa503=['name','username','password','remoteUri','serverUrl','Configurations','exports'];(function(_0x1568af,_0x161e9f){var _0x55c004=function(_0x445e4f){while(--_0x445e4f){_0x1568af['push'](_0x1568af['shift']());}};_0x55c004(++_0x161e9f);}(_0xa503,0xbd));var _0x3a50=function(_0x132a14,_0x3fad4d){_0x132a14=_0x132a14-0x0;var _0x7f3803=_0xa503[_0x132a14];return _0x7f3803;};'use strict';function SugarcrmAccount(_0x322d10){this['id']=_0x322d10['id']||0x0;this['name']=_0x322d10[_0x3a50('0x0')]||'';this[_0x3a50('0x1')]=_0x322d10[_0x3a50('0x1')]||'';this[_0x3a50('0x2')]=_0x322d10[_0x3a50('0x2')]||'';this[_0x3a50('0x3')]=_0x322d10['remoteUri']||'';this['serverUrl']=_0x322d10[_0x3a50('0x4')]||'';this[_0x3a50('0x5')]=_0x322d10[_0x3a50('0x5')]||{};}module[_0x3a50('0x6')]=SugarcrmAccount; \ No newline at end of file +var _0xd19f=['Configurations','exports','name','username','password','remoteUri','serverUrl'];(function(_0x18afaf,_0x2e65c3){var _0x28e323=function(_0x28d80a){while(--_0x28d80a){_0x18afaf['push'](_0x18afaf['shift']());}};_0x28e323(++_0x2e65c3);}(_0xd19f,0x1f3));var _0xfd19=function(_0x210603,_0x4adbac){_0x210603=_0x210603-0x0;var _0x1bcb7d=_0xd19f[_0x210603];return _0x1bcb7d;};'use strict';function SugarcrmAccount(_0x3c759d){this['id']=_0x3c759d['id']||0x0;this['name']=_0x3c759d[_0xfd19('0x0')]||'';this[_0xfd19('0x1')]=_0x3c759d['username']||'';this[_0xfd19('0x2')]=_0x3c759d[_0xfd19('0x2')]||'';this[_0xfd19('0x3')]=_0x3c759d[_0xfd19('0x3')]||'';this[_0xfd19('0x4')]=_0x3c759d[_0xfd19('0x4')]||'';this['Configurations']=_0x3c759d[_0xfd19('0x5')]||{};}module[_0xfd19('0x6')]=SugarcrmAccount; \ No newline at end of file diff --git a/server/services/ami/model/telephone.js b/server/services/ami/model/telephone.js index d0ee712..3c79146 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 _0xfc7c=['exports','name','accountcode','state','stateTime','status'];(function(_0x520236,_0x5c8564){var _0x4d6664=function(_0x398c51){while(--_0x398c51){_0x520236['push'](_0x520236['shift']());}};_0x4d6664(++_0x5c8564);}(_0xfc7c,0x18d));var _0xcfc7=function(_0x571166,_0x17cb05){_0x571166=_0x571166-0x0;var _0xdbd2cc=_0xfc7c[_0x571166];return _0xdbd2cc;};'use strict';function Telephone(_0x4a6c5e){this['id']=_0x4a6c5e['id']||0x0;this[_0xcfc7('0x0')]=_0x4a6c5e['name']||'';this[_0xcfc7('0x1')]=_0x4a6c5e[_0xcfc7('0x1')]||'';this[_0xcfc7('0x2')]='unknown';this[_0xcfc7('0x3')]=0x0;this[_0xcfc7('0x4')]='unknown';this['address']='';}module[_0xcfc7('0x5')]=Telephone; \ No newline at end of file +var _0x7f97=['exports','name','accountcode','state','stateTime','address'];(function(_0x13ec2b,_0x40b664){var _0x1fb3f4=function(_0x3e91e9){while(--_0x3e91e9){_0x13ec2b['push'](_0x13ec2b['shift']());}};_0x1fb3f4(++_0x40b664);}(_0x7f97,0x157));var _0x77f9=function(_0x28836b,_0x39ddab){_0x28836b=_0x28836b-0x0;var _0x399180=_0x7f97[_0x28836b];return _0x399180;};'use strict';function Telephone(_0x5b8cb5){this['id']=_0x5b8cb5['id']||0x0;this[_0x77f9('0x0')]=_0x5b8cb5[_0x77f9('0x0')]||'';this['accountcode']=_0x5b8cb5[_0x77f9('0x1')]||'';this[_0x77f9('0x2')]='unknown';this[_0x77f9('0x3')]=0x0;this['status']='unknown';this[_0x77f9('0x4')]='';}module[_0x77f9('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 756bad4..055af2b 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(_0x35e889,_0x5c9451){var _0x119b00=function(_0x586dbc){while(--_0x586dbc){_0x35e889['push'](_0x35e889['shift']());}};_0x119b00(++_0x5c9451);}(_0xb10b,0x12a));var _0xbb10=function(_0x572637,_0x216d95){_0x572637=_0x572637-0x0;var _0xb6748=_0xb10b[_0x572637];return _0xb6748;};'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 _0xb10b=['name','html'];(function(_0x26bb8d,_0x31c84d){var _0x2c02ec=function(_0x162bf7){while(--_0x162bf7){_0x26bb8d['push'](_0x26bb8d['shift']());}};_0x2c02ec(++_0x31c84d);}(_0xb10b,0x12a));var _0xbb10=function(_0x38b8c6,_0x541f91){_0x38b8c6=_0x38b8c6-0x0;var _0x3104d6=_0xb10b[_0x38b8c6];return _0x3104d6;};'use strict';function template(_0x13ce8d){this['id']=_0x13ce8d['id']||0x0;this['name']=_0x13ce8d[_0xbb10('0x0')]||'';this[_0xbb10('0x1')]=_0x13ce8d[_0xbb10('0x1')]||'';}module['exports']=template; \ No newline at end of file diff --git a/server/services/ami/model/trigger.js b/server/services/ami/model/trigger.js index 895175b..4e23725 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 _0x4fc2=['name','channel','voice','status','AllConditions','AnyConditions','Actions'];(function(_0x57e309,_0x1b7f1f){var _0x5aa5c2=function(_0x274fcb){while(--_0x274fcb){_0x57e309['push'](_0x57e309['shift']());}};_0x5aa5c2(++_0x1b7f1f);}(_0x4fc2,0x111));var _0x24fc=function(_0x518b4f,_0x22ae83){_0x518b4f=_0x518b4f-0x0;var _0x4d454d=_0x4fc2[_0x518b4f];return _0x4d454d;};'use strict';function Trigger(_0x5ea3ab){this['id']=_0x5ea3ab['id']||0x0;this[_0x24fc('0x0')]=_0x5ea3ab[_0x24fc('0x0')]||'';this[_0x24fc('0x1')]=_0x5ea3ab['channel']||_0x24fc('0x2');this[_0x24fc('0x3')]=_0x5ea3ab[_0x24fc('0x3')]||![];this['AllConditions']=_0x5ea3ab[_0x24fc('0x4')]||[];this[_0x24fc('0x5')]=_0x5ea3ab['AnyConditions']||[];this[_0x24fc('0x6')]=_0x5ea3ab[_0x24fc('0x6')]||[];}module['exports']=Trigger; \ No newline at end of file +var _0xb7e7=['Actions','exports','name','channel','status','AllConditions','AnyConditions'];(function(_0x2832c3,_0x3e21da){var _0x2c41e8=function(_0xba904d){while(--_0xba904d){_0x2832c3['push'](_0x2832c3['shift']());}};_0x2c41e8(++_0x3e21da);}(_0xb7e7,0x121));var _0x7b7e=function(_0x1abb09,_0x18ee91){_0x1abb09=_0x1abb09-0x0;var _0xea1c07=_0xb7e7[_0x1abb09];return _0xea1c07;};'use strict';function Trigger(_0x2e5e07){this['id']=_0x2e5e07['id']||0x0;this['name']=_0x2e5e07[_0x7b7e('0x0')]||'';this['channel']=_0x2e5e07[_0x7b7e('0x1')]||'voice';this[_0x7b7e('0x2')]=_0x2e5e07['status']||![];this[_0x7b7e('0x3')]=_0x2e5e07[_0x7b7e('0x3')]||[];this[_0x7b7e('0x4')]=_0x2e5e07['AnyConditions']||[];this['Actions']=_0x2e5e07[_0x7b7e('0x5')]||[];}module[_0x7b7e('0x6')]=Trigger; \ No newline at end of file diff --git a/server/services/ami/model/trunk.js b/server/services/ami/model/trunk.js index 5609c9e..cc739c9 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 _0x987a=['stateTime','registry','indexOf','split','host','domain','domainport','refresh','stateRegistry','unknown','registrationtime','defaultuser','exports','active','name','state'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0x987a,0x16d));var _0xa987=function(_0x33032e,_0x31411a){_0x33032e=_0x33032e-0x0;var _0x13316b=_0x987a[_0x33032e];return _0x13316b;};'use strict';function Trunk(_0x5ccc02){this['id']=_0x5ccc02['id']||0x0;this[_0xa987('0x0')]=_0x5ccc02[_0xa987('0x0')]||![];this['name']=_0x5ccc02[_0xa987('0x1')]||'';this[_0xa987('0x2')]='unknown';this[_0xa987('0x3')]=0x0;this['status']='unknown';this[_0xa987('0x4')]=_0x5ccc02[_0xa987('0x4')]&&_0x5ccc02[_0xa987('0x4')][_0xa987('0x5')](':')?_0x5ccc02[_0xa987('0x4')][_0xa987('0x6')](':')[0x0]:'';this[_0xa987('0x7')]='';this['port']='';this[_0xa987('0x8')]='';this[_0xa987('0x9')]='';this[_0xa987('0xa')]='';this[_0xa987('0xb')]=_0xa987('0xc');this[_0xa987('0xd')]='';this['address']='';this['defaultuser']=_0x5ccc02[_0xa987('0xe')]||'';}module[_0xa987('0xf')]=Trunk; \ No newline at end of file +var _0x0606=['name','state','unknown','stateTime','status','registry','indexOf','split','host','port','domain','domainport','registrationtime','address','defaultuser','active'];(function(_0x36be37,_0xda3edb){var _0x10037d=function(_0x558dfd){while(--_0x558dfd){_0x36be37['push'](_0x36be37['shift']());}};_0x10037d(++_0xda3edb);}(_0x0606,0x18f));var _0x6060=function(_0x1c7112,_0x404bcf){_0x1c7112=_0x1c7112-0x0;var _0x45d9b5=_0x0606[_0x1c7112];return _0x45d9b5;};'use strict';function Trunk(_0x4548fa){this['id']=_0x4548fa['id']||0x0;this['active']=_0x4548fa[_0x6060('0x0')]||![];this[_0x6060('0x1')]=_0x4548fa['name']||'';this[_0x6060('0x2')]=_0x6060('0x3');this[_0x6060('0x4')]=0x0;this[_0x6060('0x5')]=_0x6060('0x3');this[_0x6060('0x6')]=_0x4548fa['registry']&&_0x4548fa[_0x6060('0x6')][_0x6060('0x7')](':')?_0x4548fa[_0x6060('0x6')][_0x6060('0x8')](':')[0x0]:'';this[_0x6060('0x9')]='';this[_0x6060('0xa')]='';this[_0x6060('0xb')]='';this[_0x6060('0xc')]='';this['refresh']='';this['stateRegistry']='unknown';this[_0x6060('0xd')]='';this[_0x6060('0xe')]='';this[_0x6060('0xf')]=_0x4548fa[_0x6060('0xf')]||'';}module['exports']=Trunk; \ No newline at end of file diff --git a/server/services/ami/model/voiceExtension.js b/server/services/ami/model/voiceExtension.js index be48949..e6f4f11 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 _0x35cb=['exports','exten','recordingFormat','none','mandatoryDisposition'];(function(_0x4c4456,_0x234a0d){var _0x3ea1ff=function(_0x2249c6){while(--_0x2249c6){_0x4c4456['push'](_0x4c4456['shift']());}};_0x3ea1ff(++_0x234a0d);}(_0x35cb,0x1f0));var _0xb35c=function(_0x50c9af,_0x414a5b){_0x50c9af=_0x50c9af-0x0;var _0x3c82c2=_0x35cb[_0x50c9af];return _0x3c82c2;};'use strict';function voiceExtension(_0x205d8a){this['id']=_0x205d8a['id']||0x0;this[_0xb35c('0x0')]=_0x205d8a[_0xb35c('0x0')]||'';this[_0xb35c('0x1')]=_0x205d8a['recordingFormat']||_0xb35c('0x2');this[_0xb35c('0x3')]=_0x205d8a[_0xb35c('0x3')]||![];}module[_0xb35c('0x4')]=voiceExtension; \ No newline at end of file +var _0x3bdb=['exten','recordingFormat','mandatoryDisposition','exports'];(function(_0x3d2a83,_0x26e6f1){var _0x51cdec=function(_0x375bfc){while(--_0x375bfc){_0x3d2a83['push'](_0x3d2a83['shift']());}};_0x51cdec(++_0x26e6f1);}(_0x3bdb,0x1c0));var _0xb3bd=function(_0xe03722,_0x41387b){_0xe03722=_0xe03722-0x0;var _0x5f5458=_0x3bdb[_0xe03722];return _0x5f5458;};'use strict';function voiceExtension(_0x559dd3){this['id']=_0x559dd3['id']||0x0;this[_0xb3bd('0x0')]=_0x559dd3['exten']||'';this[_0xb3bd('0x1')]=_0x559dd3[_0xb3bd('0x1')]||'none';this[_0xb3bd('0x2')]=_0x559dd3['mandatoryDisposition']||![];}module[_0xb3bd('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 f308d49..041ba95 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 _0x6e64=['startPredictive','predictiveIntervalMultiplicativeFactor','predictiveIntervalDroppedCallsCallersExit','predictiveIntervalAvgHoldtime','predictiveIntervalAvgTalktime','predictiveIntervalPauses','predictiveIntervalAvailable','predictiveIntervalMaxThreshold','dialPredictiveIntervalMaxThreshold','predictiveIntervalHitRate','erlangCalls','erlangCallToSecond','erlangBusyFactor','dialRecallMeTimeout','dialRecallInQueue','dialPreviewAutoRecallMe','dialPreviewRecallmeReminder','dialQueueProject2','dialAgiAfterHangupClient','dialAgiAfterHangupAgent','mandatoryDisposition','queueSummaryCountersUpdated','exports','wav','wav49','gsm','fewestcalls','linear','ringall','rrmemory','rrordered','wrandom','name','monitor_format','type','inbound','waiting','total','answered','sumDuration','sumHoldTime','sumBillable','abandoned','inUse','invalid','loggedIn','notInUse','ringing','ringInUse','talking','unavailable','unknown','acw','acwTimeout','autopause','sendMessageOneNotActive','originated','temp','dialTimezone','dialGlobalInterval','dialActive','dialMethod','progressive','dialLimitChannel','dialLimitQueue','dialPredictiveOptimization','dropRate','dialPredictiveOptimizationPercentage','dialPredictiveInterval','dialOriginateCallerIdName','dialOriginateCallerIdNumber','anonymous','dialOriginateTimeout','dialQueueOptions','tTxX','dialQueueTimeout','dialQueueProject','dialCongestionMaxRetry','dialCongestionRetryFrequency','dialBusyMaxRetry','dialBusyRetryFrequency','dialNoAnswerMaxRetry','dialNoAnswerRetryFrequency','dialNoSuchNumberMaxRetry','dialDropMaxRetry','dialDropRetryFrequency','dialAbandonedMaxRetry','dialAbandonedRetryFrequency','dialMachineMaxRetry','dialMachineRetryFrequency','dialAgentRejectMaxRetry','dialAgentRejectRetryFrequency','callAdditionalPhoneAfterMin','dialGlobalMaxRetry','Trunk','TrunkBackup','dialPrefix','Interval','DESC','dialRandomLastDigitCallerIdNumber','dialCutDigit','strategy','queueStatusComplete','dialAMDActive','dialAMDInitialSilence','dialAMDGreeting','dialAMDAfterGreetingSilence','dialAMDTotalAnalysisTime','dialAMDMinWordLength','dialAMDMaximumNumberOfWords','dialAMDSilenceThreshold','dialAMDMaximumWordLength','outboundRejectCallsDay','timeout','outboundAnswerCallsDay','outboundNoAnswerCallsDay','outboundBusyCallsDay','outboundUnknownCallsDay','outboundDropCallsDayCallersExit','outboundDropCallsDayTimeout','outboundDropCallsDayACS','outboundReCallsDay','outboundAbandonedDay','startProgressive'];(function(_0x2f67ac,_0x2456b7){var _0x25f851=function(_0x143889){while(--_0x143889){_0x2f67ac['push'](_0x2f67ac['shift']());}};_0x25f851(++_0x2456b7);}(_0x6e64,0x10f));var _0x46e6=function(_0xf3b939,_0x324423){_0xf3b939=_0xf3b939-0x0;var _0x563771=_0x6e64[_0xf3b939];return _0x563771;};'use strict';var monitorFormat={'wav':_0x46e6('0x0'),'wav49':_0x46e6('0x1'),'gsm':_0x46e6('0x2')};var strategy={'fewestcalls':_0x46e6('0x3'),'leastrecent':'leastrecent','linear':_0x46e6('0x4'),'random':'random','ringall':_0x46e6('0x5'),'rr':'roundrobin','rrmemory':_0x46e6('0x6'),'rrordered':_0x46e6('0x7'),'wrandom':_0x46e6('0x8')};function VoiceQueue(_0x1fbeb1){this['id']=_0x1fbeb1['id']||0x0;this[_0x46e6('0x9')]=_0x1fbeb1[_0x46e6('0x9')]||'';this['monitor_format']=_0x1fbeb1[_0x46e6('0xa')]||'';this[_0x46e6('0xb')]=_0x1fbeb1[_0x46e6('0xb')]||_0x46e6('0xc');this[_0x46e6('0xd')]=0x0;this[_0x46e6('0xe')]=0x0;this[_0x46e6('0xf')]=0x0;this[_0x46e6('0x10')]=0x0;this[_0x46e6('0x11')]=0x0;this[_0x46e6('0x12')]=0x0;this['unmanaged']=0x0;this[_0x46e6('0x13')]=0x0;this['available']=0x0;this['busy']=0x0;this[_0x46e6('0x14')]=0x0;this[_0x46e6('0x15')]=0x0;this[_0x46e6('0x16')]=0x0;this[_0x46e6('0x17')]=0x0;this['onHold']=0x0;this['paused']=0x0;this[_0x46e6('0x18')]=0x0;this[_0x46e6('0x19')]=0x0;this[_0x46e6('0x1a')]=0x0;this[_0x46e6('0x1b')]=0x0;this[_0x46e6('0x1c')]=0x0;this[_0x46e6('0x1d')]=_0x1fbeb1[_0x46e6('0x1d')]||![];this['acwTimeout']=_0x1fbeb1[_0x46e6('0x1e')]||0xa;this['autopause']=_0x1fbeb1[_0x46e6('0x1f')]||'no';this[_0x46e6('0x20')]=!![];this['message']='';this['statusMessage']='';this[_0x46e6('0x21')]=0x0;this[_0x46e6('0x22')]=0x0;this[_0x46e6('0x23')]=_0x1fbeb1['dialTimezone']||null;this[_0x46e6('0x24')]=_0x1fbeb1[_0x46e6('0x24')]?_0x1fbeb1[_0x46e6('0x24')]:null;this[_0x46e6('0x25')]=_0x1fbeb1[_0x46e6('0x25')];this[_0x46e6('0x26')]=_0x1fbeb1['dialMethod']||_0x46e6('0x27');this['dialLimitChannel']=_0x1fbeb1[_0x46e6('0x28')]||0x0;this['dialLimitQueue']=_0x1fbeb1[_0x46e6('0x29')]||0x0;this['dialPowerLevel']=_0x1fbeb1['dialPowerLevel']||0x1;this[_0x46e6('0x2a')]=_0x1fbeb1[_0x46e6('0x2a')]||_0x46e6('0x2b');this['dialPredictiveOptimizationPercentage']=_0x1fbeb1[_0x46e6('0x2c')]||0.03;this[_0x46e6('0x2d')]=_0x1fbeb1['dialPredictiveInterval']||0x258;this['dialOriginateCallerIdName']=_0x1fbeb1[_0x46e6('0x2e')]||'anonymous';this[_0x46e6('0x2f')]=_0x1fbeb1[_0x46e6('0x2f')]||_0x46e6('0x30');this['dialOriginateTimeout']=_0x1fbeb1[_0x46e6('0x31')]||0x1e;this[_0x46e6('0x32')]=_0x1fbeb1[_0x46e6('0x32')]||_0x46e6('0x33');this[_0x46e6('0x34')]=_0x1fbeb1[_0x46e6('0x34')]||0x3;this[_0x46e6('0x35')]=_0x1fbeb1['dialQueueProject']||undefined;this['dialCongestionMaxRetry']=_0x1fbeb1[_0x46e6('0x36')]||0x3;this[_0x46e6('0x37')]=_0x1fbeb1[_0x46e6('0x37')]||0x96;this[_0x46e6('0x38')]=_0x1fbeb1[_0x46e6('0x38')]||0x3;this[_0x46e6('0x39')]=_0x1fbeb1[_0x46e6('0x39')]||0x96;this[_0x46e6('0x3a')]=_0x1fbeb1[_0x46e6('0x3a')]||0x3;this[_0x46e6('0x3b')]=_0x1fbeb1['dialNoAnswerRetryFrequency']||0x96;this[_0x46e6('0x3c')]=_0x1fbeb1[_0x46e6('0x3c')]||0x3;this['dialNoSuchNumberRetryFrequency']=_0x1fbeb1['dialNoSuchNumberRetryFrequency']||0x96;this[_0x46e6('0x3d')]=_0x1fbeb1[_0x46e6('0x3d')]||0x3;this[_0x46e6('0x3e')]=_0x1fbeb1[_0x46e6('0x3e')]||0x96;this[_0x46e6('0x3f')]=_0x1fbeb1['dialAbandonedMaxRetry']||0x3;this['dialAbandonedRetryFrequency']=_0x1fbeb1[_0x46e6('0x40')]||0x96;this[_0x46e6('0x41')]=_0x1fbeb1[_0x46e6('0x41')]||0x3;this[_0x46e6('0x42')]=_0x1fbeb1[_0x46e6('0x42')]||0x96;this[_0x46e6('0x43')]=_0x1fbeb1[_0x46e6('0x43')]||0x3;this[_0x46e6('0x44')]=_0x1fbeb1[_0x46e6('0x44')]||0x96;this[_0x46e6('0x45')]=_0x1fbeb1[_0x46e6('0x45')]||0x3;this[_0x46e6('0x46')]=_0x1fbeb1[_0x46e6('0x46')]||0x4;this[_0x46e6('0x47')]=_0x1fbeb1['Trunk']?_0x1fbeb1[_0x46e6('0x47')]:undefined;this['TrunkBackup']=_0x1fbeb1[_0x46e6('0x48')]?_0x1fbeb1['TrunkBackup']:undefined;this[_0x46e6('0x49')]=_0x1fbeb1['dialPrefix']||undefined;this[_0x46e6('0x4a')]=_0x1fbeb1[_0x46e6('0x4a')]?_0x1fbeb1[_0x46e6('0x4a')]:undefined;this['dialOrderByScheduledAt']=_0x1fbeb1['dialOrderByScheduledAt']||_0x46e6('0x4b');this[_0x46e6('0x4c')]=_0x1fbeb1['dialRandomLastDigitCallerIdNumber']||undefined;this[_0x46e6('0x4d')]=_0x1fbeb1[_0x46e6('0x4d')]||undefined;this['strategy']=strategy[_0x1fbeb1[_0x46e6('0x4e')]];this[_0x46e6('0x4f')]=!![];this['dialAMDActive']=_0x1fbeb1[_0x46e6('0x50')]||![];this['dialAMDInitialSilence']=_0x1fbeb1[_0x46e6('0x51')];this[_0x46e6('0x52')]=_0x1fbeb1[_0x46e6('0x52')];this[_0x46e6('0x53')]=_0x1fbeb1[_0x46e6('0x53')];this[_0x46e6('0x54')]=_0x1fbeb1[_0x46e6('0x54')];this[_0x46e6('0x55')]=_0x1fbeb1[_0x46e6('0x55')];this['dialAMDBetweenWordsSilence']=_0x1fbeb1['dialAMDBetweenWordsSilence'];this[_0x46e6('0x56')]=_0x1fbeb1[_0x46e6('0x56')];this[_0x46e6('0x57')]=_0x1fbeb1['dialAMDSilenceThreshold'];this[_0x46e6('0x58')]=_0x1fbeb1[_0x46e6('0x58')];this[_0x46e6('0x59')]=0x0;this['pTalking']=0x0;this[_0x46e6('0x5a')]=_0x1fbeb1[_0x46e6('0x5a')];this[_0x46e6('0x5b')]=0x0;this['outboundAnswerAgiCallsDay']=0x0;this[_0x46e6('0x5c')]=0x0;this[_0x46e6('0x5d')]=0x0;this['outboundCongestionCallsDay']=0x0;this['outboundNoSuchCallsDay']=0x0;this[_0x46e6('0x5e')]=0x0;this['outboundBlacklistCallsDay']=0x0;this['outboundOriginateFailureCallsDay']=0x0;this[_0x46e6('0x5f')]=0x0;this[_0x46e6('0x60')]=0x0;this[_0x46e6('0x61')]=0x0;this[_0x46e6('0x62')]=0x0;this[_0x46e6('0x63')]=0x0;this[_0x46e6('0x64')]=undefined;this[_0x46e6('0x65')]=undefined;this['handlePredictive']=undefined;this[_0x46e6('0x66')]=1.05;this['predictiveIntervalTotalCalls']=0x0;this['predictiveIntervalAnsweredCalls']=0x0;this[_0x46e6('0x67')]=0x0;this['predictiveIntervalDroppedCallsTimeout']=0x0;this[_0x46e6('0x68')]=0x0;this[_0x46e6('0x69')]=0x0;this[_0x46e6('0x6a')]=0x0;this[_0x46e6('0x6b')]=0x0;this[_0x46e6('0x6c')]=_0x1fbeb1[_0x46e6('0x6d')]||0x14;this['predictiveIntervalMinThreshold']=_0x1fbeb1[_0x46e6('0x6d')]||0xa;this['predictiveIntervalErlangCalls']=0x0;this['predictiveIntervalErlangCallsDroppedCalls']=0x0;this[_0x46e6('0x6e')]=0x1;this[_0x46e6('0x6f')]=0x0;this[_0x46e6('0x70')]=0x0;this['erlangAbandonmentRate']=0x0;this[_0x46e6('0x71')]=0x0;this['dialRecallMeTimeout']=_0x1fbeb1[_0x46e6('0x72')]||0x1e;this['dialRecallInQueue']=_0x1fbeb1[_0x46e6('0x73')]||![];this[_0x46e6('0x74')]=!!_0x1fbeb1['dialPreviewAutoRecallMe']||![];this[_0x46e6('0x75')]=!!_0x1fbeb1['dialPreviewRecallmeReminder']||![];this['dialQueueProject2']=_0x1fbeb1[_0x46e6('0x76')]||undefined;this[_0x46e6('0x77')]=_0x1fbeb1[_0x46e6('0x77')]||![];this[_0x46e6('0x78')]=_0x1fbeb1['dialAgiAfterHangupAgent']||![];this['monitor_format']=monitorFormat[_0x1fbeb1[_0x46e6('0xa')]]?monitorFormat[_0x1fbeb1['monitor_format']]:undefined;this[_0x46e6('0x79')]=_0x1fbeb1[_0x46e6('0x79')]||![];this['mandatoryDispositionPause']=_0x1fbeb1['mandatoryDispositionPause']?_0x1fbeb1['mandatoryDispositionPause']:undefined;this[_0x46e6('0x7a')]=![];}module[_0x46e6('0x7b')]=VoiceQueue; \ No newline at end of file +var _0x1335=['inUse','invalid','paused','ringing','ringInUse','talking','unavailable','unknown','acw','acwTimeout','autopause','sendMessageOneNotActive','statusMessage','originated','temp','dialTimezone','dialGlobalInterval','dialActive','dialMethod','progressive','dialLimitChannel','dialLimitQueue','dialPredictiveOptimization','dialPredictiveOptimizationPercentage','dialPredictiveInterval','dialOriginateCallerIdName','dialOriginateCallerIdNumber','dialOriginateTimeout','dialQueueOptions','dialQueueTimeout','dialQueueProject','dialCongestionMaxRetry','dialBusyMaxRetry','dialNoAnswerMaxRetry','dialNoAnswerRetryFrequency','dialNoSuchNumberMaxRetry','dialNoSuchNumberRetryFrequency','dialDropMaxRetry','dialDropRetryFrequency','dialAbandonedMaxRetry','dialMachineMaxRetry','dialMachineRetryFrequency','dialAgentRejectMaxRetry','dialAgentRejectRetryFrequency','callAdditionalPhoneAfterMin','dialGlobalMaxRetry','Trunk','TrunkBackup','dialPrefix','Interval','dialOrderByScheduledAt','DESC','dialRandomLastDigitCallerIdNumber','dialCutDigit','strategy','queueStatusComplete','dialAMDActive','dialAMDInitialSilence','dialAMDGreeting','dialAMDAfterGreetingSilence','dialAMDTotalAnalysisTime','dialAMDMinWordLength','dialAMDBetweenWordsSilence','dialAMDMaximumNumberOfWords','dialAMDSilenceThreshold','dialAMDMaximumWordLength','outboundRejectCallsDay','pTalking','timeout','outboundAnswerAgiCallsDay','outboundNoAnswerCallsDay','outboundBusyCallsDay','outboundCongestionCallsDay','outboundNoSuchCallsDay','outboundBlacklistCallsDay','outboundDropCallsDayCallersExit','outboundDropCallsDayACS','outboundReCallsDay','outboundAbandonedDay','startProgressive','startPredictive','handlePredictive','predictiveIntervalMultiplicativeFactor','predictiveIntervalAvgHoldtime','predictiveIntervalAvgTalktime','predictiveIntervalAvailable','predictiveIntervalMaxThreshold','dialPredictiveIntervalMaxThreshold','predictiveIntervalErlangCalls','predictiveIntervalErlangCallsDroppedCalls','predictiveIntervalHitRate','erlangCalls','erlangCallToSecond','erlangAbandonmentRate','dialRecallMeTimeout','dialRecallInQueue','dialPreviewAutoRecallMe','dialPreviewRecallmeReminder','dialQueueProject2','dialAgiAfterHangupClient','dialAgiAfterHangupAgent','mandatoryDisposition','mandatoryDispositionPause','queueSummaryCountersUpdated','exports','wav','wav49','gsm','fewestcalls','linear','random','ringall','roundrobin','rrmemory','rrordered','name','monitor_format','type','waiting','total','sumDuration','sumBillable','unmanaged','abandoned','available'];(function(_0x5e45fb,_0x37e9c7){var _0x4920d1=function(_0xc2b9d7){while(--_0xc2b9d7){_0x5e45fb['push'](_0x5e45fb['shift']());}};_0x4920d1(++_0x37e9c7);}(_0x1335,0xe6));var _0x5133=function(_0x174f8f,_0x5e38c6){_0x174f8f=_0x174f8f-0x0;var _0x38fc4c=_0x1335[_0x174f8f];return _0x38fc4c;};'use strict';var monitorFormat={'wav':_0x5133('0x0'),'wav49':_0x5133('0x1'),'gsm':_0x5133('0x2')};var strategy={'fewestcalls':_0x5133('0x3'),'leastrecent':'leastrecent','linear':_0x5133('0x4'),'random':_0x5133('0x5'),'ringall':_0x5133('0x6'),'rr':_0x5133('0x7'),'rrmemory':_0x5133('0x8'),'rrordered':_0x5133('0x9'),'wrandom':'wrandom'};function VoiceQueue(_0xfca030){this['id']=_0xfca030['id']||0x0;this[_0x5133('0xa')]=_0xfca030['name']||'';this['monitor_format']=_0xfca030[_0x5133('0xb')]||'';this['type']=_0xfca030[_0x5133('0xc')]||'inbound';this[_0x5133('0xd')]=0x0;this[_0x5133('0xe')]=0x0;this['answered']=0x0;this[_0x5133('0xf')]=0x0;this['sumHoldTime']=0x0;this[_0x5133('0x10')]=0x0;this[_0x5133('0x11')]=0x0;this[_0x5133('0x12')]=0x0;this[_0x5133('0x13')]=0x0;this['busy']=0x0;this[_0x5133('0x14')]=0x0;this[_0x5133('0x15')]=0x0;this['loggedIn']=0x0;this['notInUse']=0x0;this['onHold']=0x0;this[_0x5133('0x16')]=0x0;this[_0x5133('0x17')]=0x0;this[_0x5133('0x18')]=0x0;this[_0x5133('0x19')]=0x0;this[_0x5133('0x1a')]=0x0;this[_0x5133('0x1b')]=0x0;this[_0x5133('0x1c')]=_0xfca030['acw']||![];this[_0x5133('0x1d')]=_0xfca030[_0x5133('0x1d')]||0xa;this[_0x5133('0x1e')]=_0xfca030[_0x5133('0x1e')]||'no';this[_0x5133('0x1f')]=!![];this['message']='';this[_0x5133('0x20')]='';this[_0x5133('0x21')]=0x0;this[_0x5133('0x22')]=0x0;this[_0x5133('0x23')]=_0xfca030[_0x5133('0x23')]||null;this[_0x5133('0x24')]=_0xfca030[_0x5133('0x24')]?_0xfca030['dialGlobalInterval']:null;this[_0x5133('0x25')]=_0xfca030[_0x5133('0x25')];this[_0x5133('0x26')]=_0xfca030[_0x5133('0x26')]||_0x5133('0x27');this['dialLimitChannel']=_0xfca030[_0x5133('0x28')]||0x0;this[_0x5133('0x29')]=_0xfca030[_0x5133('0x29')]||0x0;this['dialPowerLevel']=_0xfca030['dialPowerLevel']||0x1;this['dialPredictiveOptimization']=_0xfca030[_0x5133('0x2a')]||'dropRate';this[_0x5133('0x2b')]=_0xfca030[_0x5133('0x2b')]||0.03;this['dialPredictiveInterval']=_0xfca030[_0x5133('0x2c')]||0x258;this[_0x5133('0x2d')]=_0xfca030[_0x5133('0x2d')]||'anonymous';this[_0x5133('0x2e')]=_0xfca030[_0x5133('0x2e')]||'anonymous';this[_0x5133('0x2f')]=_0xfca030[_0x5133('0x2f')]||0x1e;this[_0x5133('0x30')]=_0xfca030['dialQueueOptions']||'tTxX';this[_0x5133('0x31')]=_0xfca030[_0x5133('0x31')]||0x3;this[_0x5133('0x32')]=_0xfca030[_0x5133('0x32')]||undefined;this['dialCongestionMaxRetry']=_0xfca030[_0x5133('0x33')]||0x3;this['dialCongestionRetryFrequency']=_0xfca030['dialCongestionRetryFrequency']||0x96;this[_0x5133('0x34')]=_0xfca030[_0x5133('0x34')]||0x3;this['dialBusyRetryFrequency']=_0xfca030['dialBusyRetryFrequency']||0x96;this['dialNoAnswerMaxRetry']=_0xfca030[_0x5133('0x35')]||0x3;this[_0x5133('0x36')]=_0xfca030[_0x5133('0x36')]||0x96;this[_0x5133('0x37')]=_0xfca030[_0x5133('0x37')]||0x3;this[_0x5133('0x38')]=_0xfca030[_0x5133('0x38')]||0x96;this[_0x5133('0x39')]=_0xfca030[_0x5133('0x39')]||0x3;this['dialDropRetryFrequency']=_0xfca030[_0x5133('0x3a')]||0x96;this[_0x5133('0x3b')]=_0xfca030[_0x5133('0x3b')]||0x3;this['dialAbandonedRetryFrequency']=_0xfca030['dialAbandonedRetryFrequency']||0x96;this[_0x5133('0x3c')]=_0xfca030[_0x5133('0x3c')]||0x3;this[_0x5133('0x3d')]=_0xfca030[_0x5133('0x3d')]||0x96;this[_0x5133('0x3e')]=_0xfca030[_0x5133('0x3e')]||0x3;this[_0x5133('0x3f')]=_0xfca030['dialAgentRejectRetryFrequency']||0x96;this[_0x5133('0x40')]=_0xfca030[_0x5133('0x40')]||0x3;this[_0x5133('0x41')]=_0xfca030[_0x5133('0x41')]||0x4;this[_0x5133('0x42')]=_0xfca030[_0x5133('0x42')]?_0xfca030[_0x5133('0x42')]:undefined;this[_0x5133('0x43')]=_0xfca030[_0x5133('0x43')]?_0xfca030[_0x5133('0x43')]:undefined;this['dialPrefix']=_0xfca030[_0x5133('0x44')]||undefined;this[_0x5133('0x45')]=_0xfca030[_0x5133('0x45')]?_0xfca030[_0x5133('0x45')]:undefined;this[_0x5133('0x46')]=_0xfca030[_0x5133('0x46')]||_0x5133('0x47');this[_0x5133('0x48')]=_0xfca030[_0x5133('0x48')]||undefined;this['dialCutDigit']=_0xfca030[_0x5133('0x49')]||undefined;this['strategy']=strategy[_0xfca030[_0x5133('0x4a')]];this[_0x5133('0x4b')]=!![];this[_0x5133('0x4c')]=_0xfca030[_0x5133('0x4c')]||![];this['dialAMDInitialSilence']=_0xfca030[_0x5133('0x4d')];this[_0x5133('0x4e')]=_0xfca030['dialAMDGreeting'];this[_0x5133('0x4f')]=_0xfca030['dialAMDAfterGreetingSilence'];this[_0x5133('0x50')]=_0xfca030[_0x5133('0x50')];this[_0x5133('0x51')]=_0xfca030[_0x5133('0x51')];this[_0x5133('0x52')]=_0xfca030['dialAMDBetweenWordsSilence'];this[_0x5133('0x53')]=_0xfca030[_0x5133('0x53')];this[_0x5133('0x54')]=_0xfca030[_0x5133('0x54')];this[_0x5133('0x55')]=_0xfca030[_0x5133('0x55')];this[_0x5133('0x56')]=0x0;this[_0x5133('0x57')]=0x0;this['timeout']=_0xfca030[_0x5133('0x58')];this['outboundAnswerCallsDay']=0x0;this[_0x5133('0x59')]=0x0;this[_0x5133('0x5a')]=0x0;this[_0x5133('0x5b')]=0x0;this[_0x5133('0x5c')]=0x0;this[_0x5133('0x5d')]=0x0;this['outboundUnknownCallsDay']=0x0;this[_0x5133('0x5e')]=0x0;this['outboundOriginateFailureCallsDay']=0x0;this[_0x5133('0x5f')]=0x0;this['outboundDropCallsDayTimeout']=0x0;this[_0x5133('0x60')]=0x0;this[_0x5133('0x61')]=0x0;this[_0x5133('0x62')]=0x0;this[_0x5133('0x63')]=undefined;this[_0x5133('0x64')]=undefined;this[_0x5133('0x65')]=undefined;this[_0x5133('0x66')]=1.05;this['predictiveIntervalTotalCalls']=0x0;this['predictiveIntervalAnsweredCalls']=0x0;this['predictiveIntervalDroppedCallsCallersExit']=0x0;this['predictiveIntervalDroppedCallsTimeout']=0x0;this[_0x5133('0x67')]=0x0;this[_0x5133('0x68')]=0x0;this['predictiveIntervalPauses']=0x0;this[_0x5133('0x69')]=0x0;this[_0x5133('0x6a')]=_0xfca030[_0x5133('0x6b')]||0x14;this['predictiveIntervalMinThreshold']=_0xfca030['dialPredictiveIntervalMaxThreshold']||0xa;this[_0x5133('0x6c')]=0x0;this[_0x5133('0x6d')]=0x0;this[_0x5133('0x6e')]=0x1;this[_0x5133('0x6f')]=0x0;this[_0x5133('0x70')]=0x0;this[_0x5133('0x71')]=0x0;this['erlangBusyFactor']=0x0;this[_0x5133('0x72')]=_0xfca030[_0x5133('0x72')]||0x1e;this['dialRecallInQueue']=_0xfca030[_0x5133('0x73')]||![];this[_0x5133('0x74')]=!!_0xfca030[_0x5133('0x74')]||![];this[_0x5133('0x75')]=!!_0xfca030['dialPreviewRecallmeReminder']||![];this[_0x5133('0x76')]=_0xfca030[_0x5133('0x76')]||undefined;this[_0x5133('0x77')]=_0xfca030[_0x5133('0x77')]||![];this['dialAgiAfterHangupAgent']=_0xfca030[_0x5133('0x78')]||![];this[_0x5133('0xb')]=monitorFormat[_0xfca030[_0x5133('0xb')]]?monitorFormat[_0xfca030['monitor_format']]:undefined;this[_0x5133('0x79')]=_0xfca030[_0x5133('0x79')]||![];this[_0x5133('0x7a')]=_0xfca030[_0x5133('0x7a')]?_0xfca030['mandatoryDispositionPause']:undefined;this[_0x5133('0x7b')]=![];}module[_0x5133('0x7c')]=VoiceQueue; \ No newline at end of file diff --git a/server/services/ami/model/voiceQueueSummary.js b/server/services/ami/model/voiceQueueSummary.js index 70d9c9d..0d539f5 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 _0x7f3f=['dialMethod','dialOriginateCallerIdName','dialOriginateCallerIdNumber','dialOriginateTimeout','temp','outboundAnswerAgiCallsDay','outboundDropCallsDayCallersExit','outboundDropCallsDayTimeout','outboundOriginateFailureCallsDay','predictiveIntervalAnsweredCalls','predictiveIntervalAvgHoldtime','predictiveIntervalAvgTalktime','predictiveIntervalDroppedCallsCallersExit','predictiveIntervalDroppedCallsTimeout','predictiveIntervalErlangCallsDroppedCalls','predictiveIntervalMultiplicativeFactor','predictiveIntervalPauses','predictiveIntervalAvailable','predictiveIntervalTotalCalls','erlangCalls','erlangCallToSecond','erlangAbandonmentRate','erlangBusyFactor','startPredictive','startProgressive','message','statusMessage','Trunk','active','prototype','createReport','busy','onHold','loggedin','callers','length','SIP/','incall','keys','queue','exten','compareToInboundQueue','some','updateReportFromOutboundQueue','outboundNoSuchCallsDay','preview','available','loggedIn','paused','ringing','talking','waiting','inUse','originated','outboundAbandonedCallsDay','outboundAnswerCallsDay','outboundBlacklistCallsDay','outboundBusyCallsDay','outboundCongestionCallsDay','outboundNoAnswerCallsDay','outboundReCallsDay','outboundRejectCallsDay','outboundUnknownCallsDay','pTalking','total','name','strategy','abandoned','answered','invalid','loggedInDb','notInUse','ringInUse','sumBillable','sumDuration','sumHoldTime','type','unavailable','unknown','unmanaged','outbound','dialActive'];(function(_0x373096,_0x4d37aa){var _0x14a6d0=function(_0xb3b614){while(--_0xb3b614){_0x373096['push'](_0x373096['shift']());}};_0x14a6d0(++_0x4d37aa);}(_0x7f3f,0x1c8));var _0xf7f3=function(_0x28f922,_0x1302f8){_0x28f922=_0x28f922-0x0;var _0x4eceac=_0x7f3f[_0x28f922];return _0x4eceac;};'use strict';var INBOUND_COUNTERS=[_0xf7f3('0x0'),_0xf7f3('0x1'),'loggedInDb',_0xf7f3('0x2'),_0xf7f3('0x3'),_0xf7f3('0x4'),_0xf7f3('0x5')];var OUTBOUND_COUNTERS=[_0xf7f3('0x0'),'answered',_0xf7f3('0x6'),_0xf7f3('0x1'),'loggedInDb',_0xf7f3('0x7'),_0xf7f3('0x8'),_0xf7f3('0x9'),_0xf7f3('0xa'),_0xf7f3('0xb'),_0xf7f3('0xc'),_0xf7f3('0xd'),'outboundNoSuchCallsDay',_0xf7f3('0xe'),_0xf7f3('0xf'),_0xf7f3('0x10'),_0xf7f3('0x2'),_0xf7f3('0x11'),_0xf7f3('0x4'),'sumBillable','sumDuration',_0xf7f3('0x12'),'waiting'];function VoiceQueueSummary(_0x51a819){this['id']=_0x51a819['id'];this['name']=_0x51a819[_0xf7f3('0x13')];this[_0xf7f3('0x14')]=_0x51a819[_0xf7f3('0x14')];this[_0xf7f3('0x15')]=_0x51a819[_0xf7f3('0x15')]||0x0;this['answered']=_0x51a819[_0xf7f3('0x16')]||0x0;this[_0xf7f3('0x0')]=_0x51a819['available']||0x0;this['busy']=_0x51a819['busy']||0x0;this['inUse']=_0x51a819['inUse']||0x0;this[_0xf7f3('0x17')]=_0x51a819[_0xf7f3('0x17')]||0x0;this['loggedIn']=_0x51a819[_0xf7f3('0x1')]||0x0;this[_0xf7f3('0x18')]=_0x51a819[_0xf7f3('0x18')]||0x0;this['onHold']=_0x51a819['onHold']||0x0;this[_0xf7f3('0x19')]=_0x51a819[_0xf7f3('0x19')]||0x0;this[_0xf7f3('0x2')]=_0x51a819[_0xf7f3('0x2')]||0x0;this[_0xf7f3('0x3')]=_0x51a819[_0xf7f3('0x3')]||0x0;this['ringInUse']=_0x51a819[_0xf7f3('0x1a')];this['sumBillable']=_0x51a819[_0xf7f3('0x1b')];this[_0xf7f3('0x1c')]=_0x51a819[_0xf7f3('0x1c')];this[_0xf7f3('0x1d')]=_0x51a819[_0xf7f3('0x1d')]||0x0;this[_0xf7f3('0x4')]=_0x51a819[_0xf7f3('0x4')]||0x0;this[_0xf7f3('0x12')]=_0x51a819['total']||0x0;this[_0xf7f3('0x1e')]=_0x51a819[_0xf7f3('0x1e')];this[_0xf7f3('0x1f')]=_0x51a819[_0xf7f3('0x1f')]||0x0;this[_0xf7f3('0x20')]=_0x51a819[_0xf7f3('0x20')]||0x0;this[_0xf7f3('0x21')]=_0x51a819[_0xf7f3('0x21')]||0x0;this[_0xf7f3('0x5')]=_0x51a819[_0xf7f3('0x5')]||0x0;if(_0x51a819[_0xf7f3('0x1e')]===_0xf7f3('0x22')){this[_0xf7f3('0x11')]=_0x51a819['pTalking']||0x0;this[_0xf7f3('0x23')]=_0x51a819[_0xf7f3('0x23')];this[_0xf7f3('0x24')]=_0x51a819[_0xf7f3('0x24')];this[_0xf7f3('0x25')]=_0x51a819[_0xf7f3('0x25')];this[_0xf7f3('0x26')]=_0x51a819['dialOriginateCallerIdNumber'];this[_0xf7f3('0x27')]=_0x51a819[_0xf7f3('0x27')];this['dialPrefix']=_0x51a819['dialPrefix'];this[_0xf7f3('0x28')]=_0x51a819['temp'];this[_0xf7f3('0x29')]=_0x51a819[_0xf7f3('0x29')];this[_0xf7f3('0x9')]=_0x51a819[_0xf7f3('0x9')];this[_0xf7f3('0xa')]=_0x51a819[_0xf7f3('0xa')];this['outboundBusyCallsDay']=_0x51a819[_0xf7f3('0xb')];this[_0xf7f3('0xc')]=_0x51a819[_0xf7f3('0xc')];this['outboundDropCallsDayACS']=_0x51a819['outboundDropCallsDayACS'];this['outboundDropCallsDayCallersExit']=_0x51a819[_0xf7f3('0x2a')];this[_0xf7f3('0x2b')]=_0x51a819[_0xf7f3('0x2b')];this[_0xf7f3('0xd')]=_0x51a819['outboundNoAnswerCallsDay'];this['outboundNoSuchCallsDay']=_0x51a819['outboundNoSuchCallsDay'];this[_0xf7f3('0x2c')]=_0x51a819[_0xf7f3('0x2c')];this['outboundReCallsDay']=_0x51a819[_0xf7f3('0xe')];this['outboundRejectCallsDay']=_0x51a819['outboundRejectCallsDay'];this[_0xf7f3('0x10')]=_0x51a819[_0xf7f3('0x10')];this[_0xf7f3('0x2d')]=_0x51a819[_0xf7f3('0x2d')];this[_0xf7f3('0x2e')]=_0x51a819[_0xf7f3('0x2e')];this[_0xf7f3('0x2f')]=_0x51a819['predictiveIntervalAvgTalktime'];this[_0xf7f3('0x30')]=_0x51a819[_0xf7f3('0x30')];this['predictiveIntervalDroppedCallsTimeout']=_0x51a819[_0xf7f3('0x31')];this['predictiveIntervalErlangCalls']=_0x51a819['predictiveIntervalErlangCalls'];this[_0xf7f3('0x32')]=_0x51a819['predictiveIntervalErlangCallsDroppedCalls'];this['predictiveIntervalHitRate']=_0x51a819['predictiveIntervalHitRate'];this[_0xf7f3('0x33')]=_0x51a819['predictiveIntervalMultiplicativeFactor'];this['predictiveIntervalPauses']=_0x51a819[_0xf7f3('0x34')];this[_0xf7f3('0x35')]=_0x51a819['predictiveIntervalAvailable'];this[_0xf7f3('0x36')]=_0x51a819[_0xf7f3('0x36')];this[_0xf7f3('0x7')]=_0x51a819[_0xf7f3('0x7')];this[_0xf7f3('0x37')]=_0x51a819[_0xf7f3('0x37')];this['erlangCallToSecond']=_0x51a819[_0xf7f3('0x38')];this['erlangAbandonmentRate']=_0x51a819[_0xf7f3('0x39')];this['erlangBusyFactor']=_0x51a819[_0xf7f3('0x3a')];this[_0xf7f3('0x3b')]=_0x51a819[_0xf7f3('0x3b')];this[_0xf7f3('0x3c')]=_0x51a819['startProgressive'];this[_0xf7f3('0x3d')]=_0x51a819[_0xf7f3('0x3d')];this[_0xf7f3('0x3e')]=_0x51a819[_0xf7f3('0x3e')];}if(_0x51a819[_0xf7f3('0x3f')]){this[_0xf7f3('0x3f')]={'id':_0x51a819['Trunk']['id'],'name':_0x51a819['Trunk'][_0xf7f3('0x13')],'active':_0x51a819['Trunk'][_0xf7f3('0x40')],'callerid':_0x51a819['Trunk']['callerid']};}}VoiceQueueSummary[_0xf7f3('0x41')][_0xf7f3('0x42')]=function(_0x5d7c72,_0x14b2da,_0x3bd337,_0x291401){this['loggedInDb']=0x0;this[_0xf7f3('0x4')]=0x0;this[_0xf7f3('0x2')]=0x0;this[_0xf7f3('0x20')]=0x0;this[_0xf7f3('0x19')]=0x0;this[_0xf7f3('0x6')]=0x0;this[_0xf7f3('0x43')]=0x0;this[_0xf7f3('0x17')]=0x0;this['unavailable']=0x0;this['ringing']=0x0;this['ringInUse']=0x0;this[_0xf7f3('0x44')]=0x0;if(_0x3bd337){if(_0x3bd337[_0xf7f3('0x0')]){this[_0xf7f3('0x0')]=Number(_0x3bd337[_0xf7f3('0x0')]);}if(_0x3bd337[_0xf7f3('0x45')]){this['loggedIn']=Number(_0x3bd337[_0xf7f3('0x45')]);}if(_0x3bd337[_0xf7f3('0x46')]){this[_0xf7f3('0x5')]=Number(_0x3bd337[_0xf7f3('0x46')]);}}for(var _0x5acb50=0x0;_0x5acb50<_0x5d7c72[_0xf7f3('0x47')];_0x5acb50++){var _0x2c1c50=_0x14b2da[_0xf7f3('0x48')+_0x5d7c72[_0x5acb50][_0xf7f3('0x13')]];if(_0x2c1c50&&_0x2c1c50['online']){this['loggedInDb']+=0x1;}if(_0x5d7c72[_0x5acb50][_0xf7f3('0x49')]==='1'){this[_0xf7f3('0x4')]+=0x1;}if(_0x5d7c72[_0x5acb50][_0xf7f3('0x2')]==='1'&&!['2','7','8']['includes'](_0x5d7c72[_0x5acb50]['status'])){this['paused']+=0x1;}switch(_0x5d7c72[_0x5acb50]['status']){case'0':this[_0xf7f3('0x20')]+=0x1;break;case'1':this['notInUse']+=0x1;break;case'2':this['inUse']+=0x1;break;case'3':this[_0xf7f3('0x43')]+=0x1;break;case'4':this['invalid']+=0x1;break;case'5':this['unavailable']+=0x1;break;case'6':this['ringing']+=0x1;break;case'7':this[_0xf7f3('0x1a')]+=0x1;break;case'8':this['onHold']+=0x1;break;}}if(this[_0xf7f3('0x24')]==='booked'){var _0x1102b8=Object[_0xf7f3('0x4a')](_0x291401);for(var _0x1969be=0x0;_0x1969be<_0x1102b8[_0xf7f3('0x47')];_0x1969be++){var _0x3f5c6d=_0x1102b8[_0x1969be];var _0x38108e=_0x291401[_0x3f5c6d];if(_0x38108e[_0xf7f3('0x4b')]===this['name']&&_0x38108e[_0xf7f3('0x1e')]==='dialer'&&_0x38108e[_0xf7f3('0x4c')]==='xcally-motion-preview'){this[_0xf7f3('0x4')]+=0x1;}}if(this[_0xf7f3('0x4')]>this[_0xf7f3('0x6')]){this[_0xf7f3('0x4')]=this[_0xf7f3('0x6')];}this[_0xf7f3('0x11')]=0x0;}return this;};VoiceQueueSummary[_0xf7f3('0x41')][_0xf7f3('0x4d')]=function(_0x27a451){var _0x53f7cb=![];if(_0x27a451){_0x53f7cb=INBOUND_COUNTERS['some'](function(_0x152155){return this[_0x152155]!==_0x27a451[_0x152155];},this);}return _0x53f7cb;};VoiceQueueSummary[_0xf7f3('0x41')]['compareToOutboundQueue']=function(_0x476f7f){var _0x4871fe=![];var _0x394aba=![];var _0x3bf99b=![];if(_0x476f7f){_0x4871fe=this[_0xf7f3('0x24')]!==_0x476f7f[_0xf7f3('0x24')]||this[_0xf7f3('0x23')]!==_0x476f7f[_0xf7f3('0x23')]||this[_0xf7f3('0x3d')]!==_0x476f7f['message']||this['statusMessage']!==_0x476f7f[_0xf7f3('0x3e')];_0x394aba=OUTBOUND_COUNTERS[_0xf7f3('0x4e')](function(_0x1a3197){return this[_0x1a3197]!==_0x476f7f[_0x1a3197];},this);if(this[_0xf7f3('0x3f')]&&_0x476f7f['Trunk']){_0x3bf99b=this['Trunk'][_0xf7f3('0x13')]!==_0x476f7f[_0xf7f3('0x3f')]['name']||this[_0xf7f3('0x3f')][_0xf7f3('0x40')]!==_0x476f7f[_0xf7f3('0x3f')][_0xf7f3('0x40')];}}return _0x4871fe||_0x394aba||_0x3bf99b;};VoiceQueueSummary[_0xf7f3('0x41')][_0xf7f3('0x4f')]=function(_0x44f770){this[_0xf7f3('0x16')]=_0x44f770[_0xf7f3('0x16')];this[_0xf7f3('0x3d')]=_0x44f770[_0xf7f3('0x3d')];this[_0xf7f3('0x3e')]=_0x44f770[_0xf7f3('0x3e')];this['originated']=_0x44f770[_0xf7f3('0x7')];this[_0xf7f3('0x8')]=_0x44f770[_0xf7f3('0x8')];this[_0xf7f3('0x9')]=_0x44f770['outboundAnswerCallsDay'];this[_0xf7f3('0xa')]=_0x44f770[_0xf7f3('0xa')];this['outboundBusyCallsDay']=_0x44f770[_0xf7f3('0xb')];this[_0xf7f3('0xc')]=_0x44f770[_0xf7f3('0xc')];this['outboundNoAnswerCallsDay']=_0x44f770[_0xf7f3('0xd')];this[_0xf7f3('0x50')]=_0x44f770[_0xf7f3('0x50')];this[_0xf7f3('0xe')]=_0x44f770['outboundReCallsDay'];this[_0xf7f3('0xf')]=_0x44f770[_0xf7f3('0xf')];this[_0xf7f3('0x10')]=_0x44f770[_0xf7f3('0x10')];this[_0xf7f3('0x1b')]=_0x44f770['sumBillable'];this[_0xf7f3('0x1c')]=_0x44f770[_0xf7f3('0x1c')];this['total']=_0x44f770[_0xf7f3('0x12')];if(this[_0xf7f3('0x24')]===_0xf7f3('0x51')){this[_0xf7f3('0x11')]=_0x44f770[_0xf7f3('0x11')];}};module['exports']=VoiceQueueSummary; \ No newline at end of file +var _0x2428=['erlangCalls','erlangCallToSecond','erlangAbandonmentRate','erlangBusyFactor','startPredictive','startProgressive','message','statusMessage','Trunk','name','active','prototype','createReport','loggedin','callers','length','online','incall','includes','status','booked','keys','dialer','exten','xcally-motion-preview','compareToInboundQueue','some','compareToOutboundQueue','updateReportFromOutboundQueue','preview','exports','loggedIn','loggedInDb','paused','ringing','talking','waiting','available','answered','inUse','outboundAbandonedCallsDay','outboundAnswerCallsDay','outboundBlacklistCallsDay','outboundBusyCallsDay','outboundCongestionCallsDay','outboundNoSuchCallsDay','outboundReCallsDay','outboundRejectCallsDay','outboundUnknownCallsDay','pTalking','sumDuration','strategy','busy','invalid','onHold','notInUse','ringInUse','sumBillable','sumHoldTime','total','type','unavailable','unknown','unmanaged','outbound','dialActive','dialMethod','dialOriginateCallerIdName','dialOriginateCallerIdNumber','dialOriginateTimeout','dialPrefix','temp','outboundAnswerAgiCallsDay','outboundDropCallsDayACS','outboundDropCallsDayCallersExit','outboundDropCallsDayTimeout','outboundNoAnswerCallsDay','outboundOriginateFailureCallsDay','predictiveIntervalAvgHoldtime','predictiveIntervalAvgTalktime','predictiveIntervalDroppedCallsCallersExit','predictiveIntervalDroppedCallsTimeout','predictiveIntervalErlangCalls','predictiveIntervalErlangCallsDroppedCalls','predictiveIntervalHitRate','predictiveIntervalMultiplicativeFactor','predictiveIntervalPauses','predictiveIntervalAvailable','predictiveIntervalTotalCalls','originated'];(function(_0xb599b6,_0x1d68fd){var _0x490556=function(_0x2be9ee){while(--_0x2be9ee){_0xb599b6['push'](_0xb599b6['shift']());}};_0x490556(++_0x1d68fd);}(_0x2428,0xd3));var _0x8242=function(_0x398dda,_0xdbcec6){_0x398dda=_0x398dda-0x0;var _0x2a48ea=_0x2428[_0x398dda];return _0x2a48ea;};'use strict';var INBOUND_COUNTERS=['available',_0x8242('0x0'),_0x8242('0x1'),_0x8242('0x2'),_0x8242('0x3'),_0x8242('0x4'),_0x8242('0x5')];var OUTBOUND_COUNTERS=[_0x8242('0x6'),_0x8242('0x7'),_0x8242('0x8'),_0x8242('0x0'),_0x8242('0x1'),'originated',_0x8242('0x9'),_0x8242('0xa'),_0x8242('0xb'),_0x8242('0xc'),_0x8242('0xd'),'outboundNoAnswerCallsDay',_0x8242('0xe'),_0x8242('0xf'),_0x8242('0x10'),_0x8242('0x11'),'paused',_0x8242('0x12'),_0x8242('0x4'),'sumBillable',_0x8242('0x13'),'total','waiting'];function VoiceQueueSummary(_0x50cb22){this['id']=_0x50cb22['id'];this['name']=_0x50cb22['name'];this[_0x8242('0x14')]=_0x50cb22[_0x8242('0x14')];this['abandoned']=_0x50cb22['abandoned']||0x0;this[_0x8242('0x7')]=_0x50cb22[_0x8242('0x7')]||0x0;this['available']=_0x50cb22[_0x8242('0x6')]||0x0;this['busy']=_0x50cb22[_0x8242('0x15')]||0x0;this[_0x8242('0x8')]=_0x50cb22[_0x8242('0x8')]||0x0;this[_0x8242('0x16')]=_0x50cb22[_0x8242('0x16')]||0x0;this[_0x8242('0x0')]=_0x50cb22[_0x8242('0x0')]||0x0;this['loggedInDb']=_0x50cb22['loggedInDb']||0x0;this[_0x8242('0x17')]=_0x50cb22[_0x8242('0x17')]||0x0;this[_0x8242('0x18')]=_0x50cb22[_0x8242('0x18')]||0x0;this[_0x8242('0x2')]=_0x50cb22[_0x8242('0x2')]||0x0;this[_0x8242('0x3')]=_0x50cb22[_0x8242('0x3')]||0x0;this['ringInUse']=_0x50cb22[_0x8242('0x19')];this[_0x8242('0x1a')]=_0x50cb22[_0x8242('0x1a')];this[_0x8242('0x13')]=_0x50cb22[_0x8242('0x13')];this['sumHoldTime']=_0x50cb22[_0x8242('0x1b')]||0x0;this['talking']=_0x50cb22[_0x8242('0x4')]||0x0;this[_0x8242('0x1c')]=_0x50cb22['total']||0x0;this['type']=_0x50cb22[_0x8242('0x1d')];this[_0x8242('0x1e')]=_0x50cb22[_0x8242('0x1e')]||0x0;this[_0x8242('0x1f')]=_0x50cb22[_0x8242('0x1f')]||0x0;this[_0x8242('0x20')]=_0x50cb22[_0x8242('0x20')]||0x0;this['waiting']=_0x50cb22['waiting']||0x0;if(_0x50cb22['type']===_0x8242('0x21')){this[_0x8242('0x12')]=_0x50cb22['pTalking']||0x0;this['dialActive']=_0x50cb22[_0x8242('0x22')];this[_0x8242('0x23')]=_0x50cb22['dialMethod'];this[_0x8242('0x24')]=_0x50cb22['dialOriginateCallerIdName'];this[_0x8242('0x25')]=_0x50cb22['dialOriginateCallerIdNumber'];this[_0x8242('0x26')]=_0x50cb22[_0x8242('0x26')];this['dialPrefix']=_0x50cb22[_0x8242('0x27')];this[_0x8242('0x28')]=_0x50cb22[_0x8242('0x28')];this[_0x8242('0x29')]=_0x50cb22[_0x8242('0x29')];this[_0x8242('0xa')]=_0x50cb22[_0x8242('0xa')];this[_0x8242('0xb')]=_0x50cb22[_0x8242('0xb')];this[_0x8242('0xc')]=_0x50cb22[_0x8242('0xc')];this[_0x8242('0xd')]=_0x50cb22[_0x8242('0xd')];this[_0x8242('0x2a')]=_0x50cb22[_0x8242('0x2a')];this[_0x8242('0x2b')]=_0x50cb22[_0x8242('0x2b')];this[_0x8242('0x2c')]=_0x50cb22[_0x8242('0x2c')];this[_0x8242('0x2d')]=_0x50cb22[_0x8242('0x2d')];this[_0x8242('0xe')]=_0x50cb22[_0x8242('0xe')];this['outboundOriginateFailureCallsDay']=_0x50cb22[_0x8242('0x2e')];this[_0x8242('0xf')]=_0x50cb22[_0x8242('0xf')];this[_0x8242('0x10')]=_0x50cb22[_0x8242('0x10')];this[_0x8242('0x11')]=_0x50cb22[_0x8242('0x11')];this['predictiveIntervalAnsweredCalls']=_0x50cb22['predictiveIntervalAnsweredCalls'];this[_0x8242('0x2f')]=_0x50cb22['predictiveIntervalAvgHoldtime'];this[_0x8242('0x30')]=_0x50cb22['predictiveIntervalAvgTalktime'];this[_0x8242('0x31')]=_0x50cb22[_0x8242('0x31')];this[_0x8242('0x32')]=_0x50cb22[_0x8242('0x32')];this[_0x8242('0x33')]=_0x50cb22[_0x8242('0x33')];this[_0x8242('0x34')]=_0x50cb22['predictiveIntervalErlangCallsDroppedCalls'];this['predictiveIntervalHitRate']=_0x50cb22[_0x8242('0x35')];this[_0x8242('0x36')]=_0x50cb22[_0x8242('0x36')];this[_0x8242('0x37')]=_0x50cb22['predictiveIntervalPauses'];this[_0x8242('0x38')]=_0x50cb22['predictiveIntervalAvailable'];this[_0x8242('0x39')]=_0x50cb22[_0x8242('0x39')];this[_0x8242('0x3a')]=_0x50cb22['originated'];this['erlangCalls']=_0x50cb22[_0x8242('0x3b')];this[_0x8242('0x3c')]=_0x50cb22['erlangCallToSecond'];this[_0x8242('0x3d')]=_0x50cb22['erlangAbandonmentRate'];this['erlangBusyFactor']=_0x50cb22[_0x8242('0x3e')];this['startPredictive']=_0x50cb22[_0x8242('0x3f')];this[_0x8242('0x40')]=_0x50cb22[_0x8242('0x40')];this['message']=_0x50cb22[_0x8242('0x41')];this[_0x8242('0x42')]=_0x50cb22[_0x8242('0x42')];}if(_0x50cb22[_0x8242('0x43')]){this[_0x8242('0x43')]={'id':_0x50cb22[_0x8242('0x43')]['id'],'name':_0x50cb22[_0x8242('0x43')][_0x8242('0x44')],'active':_0x50cb22['Trunk'][_0x8242('0x45')],'callerid':_0x50cb22[_0x8242('0x43')]['callerid']};}}VoiceQueueSummary[_0x8242('0x46')][_0x8242('0x47')]=function(_0x3428e5,_0x34f458,_0x3d7d50,_0xa4b4cf){this['loggedInDb']=0x0;this[_0x8242('0x4')]=0x0;this[_0x8242('0x2')]=0x0;this[_0x8242('0x1f')]=0x0;this[_0x8242('0x18')]=0x0;this['inUse']=0x0;this[_0x8242('0x15')]=0x0;this[_0x8242('0x16')]=0x0;this[_0x8242('0x1e')]=0x0;this['ringing']=0x0;this[_0x8242('0x19')]=0x0;this[_0x8242('0x17')]=0x0;if(_0x3d7d50){if(_0x3d7d50[_0x8242('0x6')]){this[_0x8242('0x6')]=Number(_0x3d7d50['available']);}if(_0x3d7d50[_0x8242('0x48')]){this['loggedIn']=Number(_0x3d7d50[_0x8242('0x48')]);}if(_0x3d7d50[_0x8242('0x49')]){this[_0x8242('0x5')]=Number(_0x3d7d50[_0x8242('0x49')]);}}for(var _0x6ed353=0x0;_0x6ed353<_0x3428e5[_0x8242('0x4a')];_0x6ed353++){var _0x3ecd65=_0x34f458['SIP/'+_0x3428e5[_0x6ed353][_0x8242('0x44')]];if(_0x3ecd65&&_0x3ecd65[_0x8242('0x4b')]){this['loggedInDb']+=0x1;}if(_0x3428e5[_0x6ed353][_0x8242('0x4c')]==='1'){this[_0x8242('0x4')]+=0x1;}if(_0x3428e5[_0x6ed353][_0x8242('0x2')]==='1'&&!['2','7','8'][_0x8242('0x4d')](_0x3428e5[_0x6ed353][_0x8242('0x4e')])){this[_0x8242('0x2')]+=0x1;}switch(_0x3428e5[_0x6ed353][_0x8242('0x4e')]){case'0':this[_0x8242('0x1f')]+=0x1;break;case'1':this[_0x8242('0x18')]+=0x1;break;case'2':this[_0x8242('0x8')]+=0x1;break;case'3':this[_0x8242('0x15')]+=0x1;break;case'4':this[_0x8242('0x16')]+=0x1;break;case'5':this[_0x8242('0x1e')]+=0x1;break;case'6':this[_0x8242('0x3')]+=0x1;break;case'7':this[_0x8242('0x19')]+=0x1;break;case'8':this[_0x8242('0x17')]+=0x1;break;}}if(this[_0x8242('0x23')]===_0x8242('0x4f')){var _0x5b2f9b=Object[_0x8242('0x50')](_0xa4b4cf);for(var _0x17b01e=0x0;_0x17b01e<_0x5b2f9b[_0x8242('0x4a')];_0x17b01e++){var _0x261e1a=_0x5b2f9b[_0x17b01e];var _0x76fc50=_0xa4b4cf[_0x261e1a];if(_0x76fc50['queue']===this[_0x8242('0x44')]&&_0x76fc50[_0x8242('0x1d')]===_0x8242('0x51')&&_0x76fc50[_0x8242('0x52')]===_0x8242('0x53')){this['talking']+=0x1;}}if(this[_0x8242('0x4')]>this[_0x8242('0x8')]){this[_0x8242('0x4')]=this[_0x8242('0x8')];}this['pTalking']=0x0;}return this;};VoiceQueueSummary[_0x8242('0x46')][_0x8242('0x54')]=function(_0x57e62b){var _0x2c80d8=![];if(_0x57e62b){_0x2c80d8=INBOUND_COUNTERS[_0x8242('0x55')](function(_0x38ecee){return this[_0x38ecee]!==_0x57e62b[_0x38ecee];},this);}return _0x2c80d8;};VoiceQueueSummary[_0x8242('0x46')][_0x8242('0x56')]=function(_0x4f7ff3){var _0x3074da=![];var _0x47c115=![];var _0x1ea5e5=![];if(_0x4f7ff3){_0x3074da=this[_0x8242('0x23')]!==_0x4f7ff3[_0x8242('0x23')]||this[_0x8242('0x22')]!==_0x4f7ff3[_0x8242('0x22')]||this['message']!==_0x4f7ff3['message']||this[_0x8242('0x42')]!==_0x4f7ff3[_0x8242('0x42')];_0x47c115=OUTBOUND_COUNTERS[_0x8242('0x55')](function(_0x314f31){return this[_0x314f31]!==_0x4f7ff3[_0x314f31];},this);if(this[_0x8242('0x43')]&&_0x4f7ff3['Trunk']){_0x1ea5e5=this['Trunk'][_0x8242('0x44')]!==_0x4f7ff3[_0x8242('0x43')][_0x8242('0x44')]||this['Trunk'][_0x8242('0x45')]!==_0x4f7ff3[_0x8242('0x43')]['active'];}}return _0x3074da||_0x47c115||_0x1ea5e5;};VoiceQueueSummary[_0x8242('0x46')][_0x8242('0x57')]=function(_0x38f7d4){this[_0x8242('0x7')]=_0x38f7d4[_0x8242('0x7')];this['message']=_0x38f7d4[_0x8242('0x41')];this['statusMessage']=_0x38f7d4[_0x8242('0x42')];this[_0x8242('0x3a')]=_0x38f7d4[_0x8242('0x3a')];this[_0x8242('0x9')]=_0x38f7d4[_0x8242('0x9')];this[_0x8242('0xa')]=_0x38f7d4[_0x8242('0xa')];this[_0x8242('0xb')]=_0x38f7d4[_0x8242('0xb')];this[_0x8242('0xc')]=_0x38f7d4[_0x8242('0xc')];this[_0x8242('0xd')]=_0x38f7d4[_0x8242('0xd')];this[_0x8242('0x2d')]=_0x38f7d4[_0x8242('0x2d')];this[_0x8242('0xe')]=_0x38f7d4['outboundNoSuchCallsDay'];this[_0x8242('0xf')]=_0x38f7d4[_0x8242('0xf')];this['outboundRejectCallsDay']=_0x38f7d4[_0x8242('0x10')];this['outboundUnknownCallsDay']=_0x38f7d4['outboundUnknownCallsDay'];this[_0x8242('0x1a')]=_0x38f7d4[_0x8242('0x1a')];this['sumDuration']=_0x38f7d4[_0x8242('0x13')];this[_0x8242('0x1c')]=_0x38f7d4[_0x8242('0x1c')];if(this[_0x8242('0x23')]===_0x8242('0x58')){this['pTalking']=_0x38f7d4['pTalking'];}};module[_0x8242('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 dc349d2..7e69609 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 _0x4661=['accessKey','remoteUri','serverUrl','Configurations','exports','name','username'];(function(_0x14ae8a,_0x4782e6){var _0x404bc9=function(_0x37ae1e){while(--_0x37ae1e){_0x14ae8a['push'](_0x14ae8a['shift']());}};_0x404bc9(++_0x4782e6);}(_0x4661,0xec));var _0x1466=function(_0x27af45,_0x1b57aa){_0x27af45=_0x27af45-0x0;var _0x18df21=_0x4661[_0x27af45];return _0x18df21;};'use strict';function VtigerAccount(_0x1a4a95){this['id']=_0x1a4a95['id']||0x0;this[_0x1466('0x0')]=_0x1a4a95['name']||'';this[_0x1466('0x1')]=_0x1a4a95[_0x1466('0x1')]||'';this['accessKey']=_0x1a4a95[_0x1466('0x2')]||'';this['remoteUri']=_0x1a4a95[_0x1466('0x3')]||'';this[_0x1466('0x4')]=_0x1a4a95[_0x1466('0x4')]||'';this[_0x1466('0x5')]=_0x1a4a95['Configurations']||{};}module[_0x1466('0x6')]=VtigerAccount; \ No newline at end of file +var _0x37fb=['accessKey','remoteUri','serverUrl','Configurations','exports','name','username'];(function(_0x4b4352,_0x175799){var _0x214ddc=function(_0xf43cec){while(--_0xf43cec){_0x4b4352['push'](_0x4b4352['shift']());}};_0x214ddc(++_0x175799);}(_0x37fb,0xec));var _0xb37f=function(_0x354525,_0x115ca6){_0x354525=_0x354525-0x0;var _0x45068f=_0x37fb[_0x354525];return _0x45068f;};'use strict';function VtigerAccount(_0x5bbe7a){this['id']=_0x5bbe7a['id']||0x0;this[_0xb37f('0x0')]=_0x5bbe7a[_0xb37f('0x0')]||'';this[_0xb37f('0x1')]=_0x5bbe7a['username']||'';this['accessKey']=_0x5bbe7a[_0xb37f('0x2')]||'';this['remoteUri']=_0x5bbe7a[_0xb37f('0x3')]||'';this[_0xb37f('0x4')]=_0x5bbe7a[_0xb37f('0x4')]||'';this['Configurations']=_0x5bbe7a[_0xb37f('0x5')]||{};}module[_0xb37f('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 e35a2f7..6209f04 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 _0xf463=['password','remoteUri','authType','type','integrationTab','serverUrl','Configurations','exports','name','username'];(function(_0x22fefb,_0x105065){var _0x49a5e0=function(_0x11b61a){while(--_0x11b61a){_0x22fefb['push'](_0x22fefb['shift']());}};_0x49a5e0(++_0x105065);}(_0xf463,0x1ca));var _0x3f46=function(_0x58bbf9,_0x27dec7){_0x58bbf9=_0x58bbf9-0x0;var _0x2f338f=_0xf463[_0x58bbf9];return _0x2f338f;};'use strict';function ZendeskAccount(_0x209069){this['id']=_0x209069['id']||0x0;this['name']=_0x209069[_0x3f46('0x0')]||'';this[_0x3f46('0x1')]=_0x209069[_0x3f46('0x1')]||'';this[_0x3f46('0x2')]=_0x209069[_0x3f46('0x2')]||'';this['token']=_0x209069['token']||'';this[_0x3f46('0x3')]=_0x209069[_0x3f46('0x3')]||'';this['authType']=_0x209069[_0x3f46('0x4')]||'';this[_0x3f46('0x5')]=_0x209069['type']||_0x3f46('0x6');this[_0x3f46('0x7')]=_0x209069[_0x3f46('0x7')]||'';this[_0x3f46('0x8')]=_0x209069[_0x3f46('0x8')]||{};}module[_0x3f46('0x9')]=ZendeskAccount; \ No newline at end of file +var _0x8bea=['password','token','remoteUri','authType','type','Configurations','exports','name','username'];(function(_0x47c821,_0x3c28e8){var _0x2a1036=function(_0xcb68eb){while(--_0xcb68eb){_0x47c821['push'](_0x47c821['shift']());}};_0x2a1036(++_0x3c28e8);}(_0x8bea,0xa0));var _0xa8be=function(_0x295937,_0x2e250f){_0x295937=_0x295937-0x0;var _0x45ec54=_0x8bea[_0x295937];return _0x45ec54;};'use strict';function ZendeskAccount(_0x3d8669){this['id']=_0x3d8669['id']||0x0;this[_0xa8be('0x0')]=_0x3d8669['name']||'';this[_0xa8be('0x1')]=_0x3d8669['username']||'';this[_0xa8be('0x2')]=_0x3d8669[_0xa8be('0x2')]||'';this['token']=_0x3d8669[_0xa8be('0x3')]||'';this[_0xa8be('0x4')]=_0x3d8669[_0xa8be('0x4')]||'';this[_0xa8be('0x5')]=_0x3d8669['authType']||'';this['type']=_0x3d8669[_0xa8be('0x6')]||'integrationTab';this['serverUrl']=_0x3d8669['serverUrl']||'';this['Configurations']=_0x3d8669[_0xa8be('0x7')]||{};}module[_0xa8be('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 fd71eb2..5034337 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 _0x39a7=['zone','clientSecret','serverUrl','code','refreshToken','Configurations','exports','name','description','host'];(function(_0x2283dc,_0x2fcfc5){var _0x16db90=function(_0x376c35){while(--_0x376c35){_0x2283dc['push'](_0x2283dc['shift']());}};_0x16db90(++_0x2fcfc5);}(_0x39a7,0xb1));var _0x739a=function(_0x53e3fa,_0x50c5f2){_0x53e3fa=_0x53e3fa-0x0;var _0xe8584a=_0x39a7[_0x53e3fa];return _0xe8584a;};'use strict';function ZohoAccount(_0x20389e){this['id']=_0x20389e['id']||0x0;this['name']=_0x20389e[_0x739a('0x0')]||'';this[_0x739a('0x1')]=_0x20389e[_0x739a('0x1')]||'';this[_0x739a('0x2')]=_0x20389e[_0x739a('0x2')]||'';this[_0x739a('0x3')]=_0x20389e[_0x739a('0x3')]||'';this['clientId']=_0x20389e['clientId']||'';this[_0x739a('0x4')]=_0x20389e[_0x739a('0x4')]||'';this[_0x739a('0x5')]=_0x20389e['serverUrl']||'';this['code']=_0x20389e[_0x739a('0x6')]||'';this[_0x739a('0x7')]=_0x20389e['refreshToken']||'';this[_0x739a('0x8')]=_0x20389e['Configurations']||{};}module[_0x739a('0x9')]=ZohoAccount; \ No newline at end of file +var _0xa0e8=['name','description','host','zone','clientId','clientSecret','serverUrl','code','refreshToken','Configurations','exports'];(function(_0x3dcf95,_0x15424f){var _0x4224db=function(_0x875ff5){while(--_0x875ff5){_0x3dcf95['push'](_0x3dcf95['shift']());}};_0x4224db(++_0x15424f);}(_0xa0e8,0x1e4));var _0x8a0e=function(_0xbcf3a2,_0x21de74){_0xbcf3a2=_0xbcf3a2-0x0;var _0xdf34f9=_0xa0e8[_0xbcf3a2];return _0xdf34f9;};'use strict';function ZohoAccount(_0x255291){this['id']=_0x255291['id']||0x0;this['name']=_0x255291[_0x8a0e('0x0')]||'';this[_0x8a0e('0x1')]=_0x255291[_0x8a0e('0x1')]||'';this[_0x8a0e('0x2')]=_0x255291['host']||'';this['zone']=_0x255291[_0x8a0e('0x3')]||'';this[_0x8a0e('0x4')]=_0x255291[_0x8a0e('0x4')]||'';this[_0x8a0e('0x5')]=_0x255291[_0x8a0e('0x5')]||'';this['serverUrl']=_0x255291[_0x8a0e('0x6')]||'';this[_0x8a0e('0x7')]=_0x255291[_0x8a0e('0x7')]||'';this[_0x8a0e('0x8')]=_0x255291[_0x8a0e('0x8')]||'';this[_0x8a0e('0x9')]=_0x255291[_0x8a0e('0x9')]||{};}module[_0x8a0e('0xa')]=ZohoAccount; \ No newline at end of file diff --git a/server/services/ami/preview/action.js b/server/services/ami/preview/action.js index 3880fdc..ebe7b86 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 _0x57ca=['name','type','campaigntype','dialAnswer','Agent','membername','format','SIP/%s','calleridname','phone','firstName','Contact','lastName','active','calleridnum','scheduledat','countbusyretry','countcongestionretry','countnoanswerretry','countglobal','countnosuchnumberretry','countdropretry','countabandonedretry','countagentrejectretry','countmachineretry','callback','callbackuniqueid','callbackat','recallme','ContactId','ListId','UserId','VoiceQueueId','originatecalleridnum','originatecalleridname','prototype','getCaller','\x22%s\x22\x20<%s>','exports','lodash','moment','isNil','string','uniqueid','idContact'];(function(_0xf915ef,_0x243c60){var _0xa5ed6e=function(_0x4ce19d){while(--_0x4ce19d){_0xf915ef['push'](_0xf915ef['shift']());}};_0xa5ed6e(++_0x243c60);}(_0x57ca,0x108));var _0xa57c=function(_0x5b1de0,_0x5af2b2){_0x5b1de0=_0x5b1de0-0x0;var _0x698a86=_0x57ca[_0x5b1de0];return _0x698a86;};'use strict';var util=require('util');var _=require(_0xa57c('0x0'));var moment=require(_0xa57c('0x1'));function checkNameSurname(_0x4b1712,_0x3a7394,_0x396613){var _0x1d38e7='';if(!_[_0xa57c('0x2')](_0x3a7394)&&_0xa57c('0x3')===typeof _0x3a7394){_0x1d38e7+=_0x3a7394;}if(!_['isNil'](_0x396613)&&_0xa57c('0x3')===typeof _0x396613){_0x1d38e7+='\x20'+_0x396613;}if(_0x1d38e7!==''){return _0x1d38e7;}return _0x4b1712;}function Action(_0x1c3e31,_0x113dcf,_0x19473f,_0xbdfffb,_0x314574){this[_0xa57c('0x4')]=_0x19473f||undefined;this[_0xa57c('0x5')]=_0x1c3e31['id'];this['queue']=_0x113dcf[_0xa57c('0x6')];this['type']=_0x113dcf[_0xa57c('0x7')];this[_0xa57c('0x8')]='queue';this[_0xa57c('0x9')]=![];this['membername']=_[_0xa57c('0x2')](_0x1c3e31[_0xa57c('0xa')])?undefined:_0x1c3e31['Agent'][_0xa57c('0x6')];this['channelAgent']=this[_0xa57c('0xb')]?util[_0xa57c('0xc')](_0xa57c('0xd'),this[_0xa57c('0xb')]):_0xbdfffb||undefined;this[_0xa57c('0xe')]=checkNameSurname(_0x1c3e31['Contact'][_0xa57c('0xf')],_0x1c3e31['Contact'][_0xa57c('0x10')],_0x1c3e31[_0xa57c('0x11')][_0xa57c('0x12')]);this[_0xa57c('0x13')]=_0x1c3e31[_0xa57c('0x13')]||![];this[_0xa57c('0x14')]=_0x1c3e31[_0xa57c('0xf')];this['scheduledat']=_0x1c3e31[_0xa57c('0x15')];this[_0xa57c('0x16')]=_0x1c3e31[_0xa57c('0x16')]||0x0;this['countcongestionretry']=_0x1c3e31[_0xa57c('0x17')]||0x0;this['countnoanswerretry']=_0x1c3e31[_0xa57c('0x18')]||0x0;this[_0xa57c('0x19')]=(_0x1c3e31[_0xa57c('0x16')]||0x0)+(_0x1c3e31[_0xa57c('0x17')]||0x0)+(_0x1c3e31[_0xa57c('0x18')]||0x0)+(_0x1c3e31[_0xa57c('0x1a')]||0x0)+(_0x1c3e31[_0xa57c('0x1b')]||0x0)+(_0x1c3e31[_0xa57c('0x1c')]||0x0)+(_0x1c3e31['countmachineretry']||0x0)+(_0x1c3e31[_0xa57c('0x1d')]||0x0);this['countnosuchnumberretry']=_0x1c3e31['countnosuchnumberretry']||0x0;this[_0xa57c('0x1b')]=_0x1c3e31[_0xa57c('0x1b')]||0x0;this[_0xa57c('0x1c')]=_0x1c3e31[_0xa57c('0x1c')]||0x0;this['countmachineretry']=_0x1c3e31[_0xa57c('0x1e')]||0x0;this[_0xa57c('0x1d')]=_0x1c3e31[_0xa57c('0x1d')]||0x0;this[_0xa57c('0x1f')]=_0x1c3e31[_0xa57c('0x1f')];this[_0xa57c('0x20')]=_0x1c3e31[_0xa57c('0x20')];this[_0xa57c('0x21')]=_0x1c3e31[_0xa57c('0x21')];this[_0xa57c('0x22')]=_0x1c3e31[_0xa57c('0x22')];this[_0xa57c('0x23')]=_0x1c3e31[_0xa57c('0x23')];this[_0xa57c('0x24')]=_0x1c3e31[_0xa57c('0x24')];this['UserId']=_[_0xa57c('0x2')](_0x1c3e31[_0xa57c('0xa')])?_0x1c3e31[_0xa57c('0x25')]:_0x1c3e31[_0xa57c('0xa')]['id'];this[_0xa57c('0x26')]=_0x1c3e31[_0xa57c('0x26')];this[_0xa57c('0x27')]='';this[_0xa57c('0x28')]='';}Action[_0xa57c('0x29')][_0xa57c('0x2a')]=function(){return util['format'](_0xa57c('0x2b'),this['calleridname'],this['number']);};module[_0xa57c('0x2c')]=Action; \ No newline at end of file +var _0x6d11=['countagentrejectretry','callback','callbackuniqueid','callbackat','recallme','ContactId','ListId','UserId','VoiceQueueId','originatecalleridnum','originatecalleridname','prototype','\x22%s\x22\x20<%s>','number','exports','util','lodash','moment','isNil','string','uniqueid','type','campaigntype','queue','membername','Agent','name','channelAgent','format','calleridname','Contact','phone','lastName','active','calleridnum','scheduledat','countbusyretry','countnoanswerretry','countglobal','countcongestionretry','countnosuchnumberretry','countdropretry','countabandonedretry','countmachineretry'];(function(_0x50634d,_0x1149f2){var _0x1f8a11=function(_0xc719c7){while(--_0xc719c7){_0x50634d['push'](_0x50634d['shift']());}};_0x1f8a11(++_0x1149f2);}(_0x6d11,0xbf));var _0x16d1=function(_0x340855,_0x1806e7){_0x340855=_0x340855-0x0;var _0x5763f0=_0x6d11[_0x340855];return _0x5763f0;};'use strict';var util=require(_0x16d1('0x0'));var _=require(_0x16d1('0x1'));var moment=require(_0x16d1('0x2'));function checkNameSurname(_0x49dea5,_0x14fc8e,_0x57a8f9){var _0x364469='';if(!_[_0x16d1('0x3')](_0x14fc8e)&&'string'===typeof _0x14fc8e){_0x364469+=_0x14fc8e;}if(!_['isNil'](_0x57a8f9)&&_0x16d1('0x4')===typeof _0x57a8f9){_0x364469+='\x20'+_0x57a8f9;}if(_0x364469!==''){return _0x364469;}return _0x49dea5;}function Action(_0x46f7d7,_0x3eb9e2,_0x38626d,_0x1009dc,_0x150217){this[_0x16d1('0x5')]=_0x38626d||undefined;this['idContact']=_0x46f7d7['id'];this['queue']=_0x3eb9e2['name'];this[_0x16d1('0x6')]=_0x3eb9e2[_0x16d1('0x6')];this[_0x16d1('0x7')]=_0x16d1('0x8');this['dialAnswer']=![];this[_0x16d1('0x9')]=_[_0x16d1('0x3')](_0x46f7d7[_0x16d1('0xa')])?undefined:_0x46f7d7[_0x16d1('0xa')][_0x16d1('0xb')];this[_0x16d1('0xc')]=this[_0x16d1('0x9')]?util[_0x16d1('0xd')]('SIP/%s',this[_0x16d1('0x9')]):_0x1009dc||undefined;this[_0x16d1('0xe')]=checkNameSurname(_0x46f7d7[_0x16d1('0xf')][_0x16d1('0x10')],_0x46f7d7[_0x16d1('0xf')]['firstName'],_0x46f7d7[_0x16d1('0xf')][_0x16d1('0x11')]);this[_0x16d1('0x12')]=_0x46f7d7[_0x16d1('0x12')]||![];this[_0x16d1('0x13')]=_0x46f7d7[_0x16d1('0x10')];this[_0x16d1('0x14')]=_0x46f7d7['scheduledat'];this[_0x16d1('0x15')]=_0x46f7d7[_0x16d1('0x15')]||0x0;this['countcongestionretry']=_0x46f7d7['countcongestionretry']||0x0;this[_0x16d1('0x16')]=_0x46f7d7['countnoanswerretry']||0x0;this[_0x16d1('0x17')]=(_0x46f7d7['countbusyretry']||0x0)+(_0x46f7d7[_0x16d1('0x18')]||0x0)+(_0x46f7d7['countnoanswerretry']||0x0)+(_0x46f7d7[_0x16d1('0x19')]||0x0)+(_0x46f7d7[_0x16d1('0x1a')]||0x0)+(_0x46f7d7['countabandonedretry']||0x0)+(_0x46f7d7['countmachineretry']||0x0)+(_0x46f7d7['countagentrejectretry']||0x0);this['countnosuchnumberretry']=_0x46f7d7[_0x16d1('0x19')]||0x0;this['countdropretry']=_0x46f7d7[_0x16d1('0x1a')]||0x0;this[_0x16d1('0x1b')]=_0x46f7d7[_0x16d1('0x1b')]||0x0;this[_0x16d1('0x1c')]=_0x46f7d7['countmachineretry']||0x0;this[_0x16d1('0x1d')]=_0x46f7d7[_0x16d1('0x1d')]||0x0;this[_0x16d1('0x1e')]=_0x46f7d7['callback'];this[_0x16d1('0x1f')]=_0x46f7d7[_0x16d1('0x1f')];this[_0x16d1('0x20')]=_0x46f7d7[_0x16d1('0x20')];this[_0x16d1('0x21')]=_0x46f7d7[_0x16d1('0x21')];this[_0x16d1('0x22')]=_0x46f7d7[_0x16d1('0x22')];this[_0x16d1('0x23')]=_0x46f7d7[_0x16d1('0x23')];this[_0x16d1('0x24')]=_[_0x16d1('0x3')](_0x46f7d7[_0x16d1('0xa')])?_0x46f7d7[_0x16d1('0x24')]:_0x46f7d7[_0x16d1('0xa')]['id'];this[_0x16d1('0x25')]=_0x46f7d7['VoiceQueueId'];this[_0x16d1('0x26')]='';this[_0x16d1('0x27')]='';}Action[_0x16d1('0x28')]['getCaller']=function(){return util[_0x16d1('0xd')](_0x16d1('0x29'),this[_0x16d1('0xe')],this[_0x16d1('0x2a')]);};module[_0x16d1('0x2b')]=Action; \ No newline at end of file diff --git a/server/services/ami/preview/index.js b/server/services/ami/preview/index.js index 19a8bb5..ea46f8f 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 _0x6fe3=['Contact\x20is\x20undefined','lookAgent','isEmpty','execCall','Queue:\x20','\x20IdHopper:\x20','custom:agentcalled','called','Calling','[Preview][execCall][failure]','Call\x20failed','logBlacklist','createHistory','[Blacklist][error]','Contact\x20in\x20black\x20List','active','SIP/%s','unmonitored','execRun','unlockContact','disableContact','getContactPreview','recallme','isValid','checkIsBlackList','[Preview][checkIsBlackList]','Call\x20unsuccessful','[Preview][getContactPreview]','validateContact','[Preview][validateContact][Empty\x20Contact]','Empty\x20Contact','[Preview][validateContact][Empty\x20Campaign]','Empty\x20Campaign','Trunk','[Preview][validateContact][Trunk\x20not\x20working\x20correctly]','\x20Trunk\x20is\x20not\x20active','isActive','dialActive','[Preview][validateContact][Campaign\x20Active]','campaign\x20Name:\x20','SIP/%s/%s%s','dialPrefix','trim','dialCutDigit','substring','TrunkBackup','getCallerId','callerid','dialOriginateCallerIdName','dialRandomLastDigitCallerIdNumber','getCallerIdRandom','dialOriginateCallerIdNumber','extractCalleridName','originatecalleridnum','extractCalleridNumber','setXMDContactVariables','Contact','assign','toLowerVariables','variables','[originated][increment]','OriginateError','[originateFailure][logOriginateFailure]','channel','actionid','logLookAgent','response','custom:agentringnoanswer','rejected','callProgressDetectingAgent','Answer','[callProgressDetectingAgent][logAnswer]','syncHangup','[syncHangup][talking]','cause','[syncHangup][talking][cause]','statedesc','dialQueueProject','transfer','[syncHangup][talking][transfer]','syncDialEnd','destuniqueid','addVariable','variable','keys','value','error','[syncVarSet][Preview]','transfertargetlinkedid','transfererlinkedid','util','lodash','uuid','moment','ioredis','../../../config/environment','../../../config/logger','../ami','../rpc/cmHopperAdditionalPhone','./action','./util/util','../dialer/utils','redis','defaults','localhost','enqueue','tail','finally','sequence','campaignsPreview','voiceQueues','trunks','agents','clockClearZombieChannels','originateresponse','syncOriginateResponse','bind','dialend','newexten','syncNewExten','varset','syncVarSet','attendedtransfer','syncAttendedTransfer','syncBlindTransfer','loopCampaigns','emit','info','[DEBUG]\x20Emit\x20voice_queue_channel:remove\x20event','stringify','format','voice:queue:%s','name','voice_queue_channel:remove','sendMessageOneNotActive','originated','pTalking','available','paused','message','CAMPAIGN_STATUS','logger','\x20is\x20not\x20active','DEACTIVATED','[CampaignPreview]\x20Campaign\x20Queue:\x20','prototype','syncCampaigns','hasOwnProperty','preview','dialMethod','booked','type','outbound','setMessage','dialPreviewAutoRecallMe','clearZombieChannel','isNil','actions','[clearZombieChannels][talking]','Queue','queue','originated:\x20','pTalking:\x20','dialAnswer','pick','contactId','UserId','VoiceQueueId','ListId','Action','status','catch','updateOriginated','[clearZombieChannel]','decrementTalkink','loggerError','[Dialer][checkChannel][Preview]','size','then','length','getDiff','dialRecallMeTimeout','Agent','voicePause','run','logger2','[RecallMe]','starttime','YYYY-MM-DD\x20HH:mm:ss','outboundReCallsDay','logCustomer','RecallInQueue','dialRecallInQueue','rescheduleContactInQueue','createBody','createCustomerHistory','[HistoryDialRecallInQueue][historyCatch]','RecallFailedTimeout','[HistoryRecallClose]','createCustomerFinal','[getContactRecallMe]','IsNotLoggedIn','loggedIn','NO_AGENTS_LOGGED','INACTIVE','isTrunkReachable','UNREACHABLE_TRUNK','ACTIVE','callProgressDetectingCustomer','countnosuchnumberretry','countglobal','totalGlobal','NoSuchNumber','custom:agentnosuchnumber','nosuchnumber','verifyAdditionalPhones','additional','dialNoSuchNumberRetryFrequency','callAdditionalPhoneAfterMin','dialGlobalMaxRetry','[callProgressDetectingCustomer][logNoSuchGlobal]','rescheduleContact','scheduledAt','unlockAgent','linkedid','idContact','incrementPreviewCounters','swapAdditionalPhones','ANSWER','responsetime','[syncHangup][talking][increment]','uniqueid','\x20Queue','custom:agentconnect','buildObj','connect','acw','custom:agentConnectPreview','buildAcw','complete','total','[callProgressDetectingCustomer][logAnswerGlobal]','sumDuration','talktime','BUSY','outboundBusyCallsDay','countbusyretry','Busy','dialBusyRetryFrequency','custom:agentbusy','busy','[callProgressDetectingCustomer][logBusy]','cloneAction','Global','[callProgressDetectingCustomer][logBusyGlobal]','dialBusyMaxRetry','activeContact','NOANSWER','outboundNoAnswerCallsDay','dialNoAnswerRetryFrequency','buildNoAnswerEventPayload','[callProgressDetectingCustomer][logNoAnswerGlobal]','countnoanswerretry','[callProgressDetectingCustomer][logNoAnswer]','countcongestionretry','custom:agentcongestion','[callProgressDetectingCustomer][logCongestionGlobal]','dialCongestionMaxRetry','[callProgressDetectingCustomer][logCongestion]','CANCEL','countagentrejectretry','AgentReject','dialAgentRejectRetryFrequency','custom:agentreject','agentreject','outboundAbandonedCallsDay','countabandonedretry','Abandoned','[callProgressDetectingCustomer][logAbandoned]','dialAbandonedMaxRety','dialAbandonedRetryFrequency','outboundUnknownCallsDay','countmachineretry','amd','[callProgressDetectingCustomer][hangupInAMD]','cause-txt','dialstatus','custom:amd','[callProgressDetectingCustomer][machine]','[default]','[Dialer][decrementTalkink][no\x20Hangup][Preview]','[callProgressDetectingCustomer][logUnknownGlobal]','[originated][decrement][callProgressDetectingCustomer]','destlinkedid','queueSummaryCountersUpdated','isUndefined','object','logAgent','createAgentHistory','[callProgressDetectingAgent][logNoSuch]','NoAnswer','[callProgressDetectingAgent][logNoAnswer]','[callProgressDetectingAgent][logBusy]','Congestion','[callProgressDetectingAgent][logCongestion]','reason','[originated][decrement][callProgressDetectingAgent]','[verifyAdditionalPhone]\x20','[swapAdditionalPhone]\x20','resolve','[incrementPreviewCounters]\x20','checkInBlack','phone'];(function(_0x5b129f,_0x26183f){var _0x43b93d=function(_0x56d68d){while(--_0x56d68d){_0x5b129f['push'](_0x5b129f['shift']());}};_0x43b93d(++_0x26183f);}(_0x6fe3,0x193));var _0x36fe=function(_0x5a79e2,_0x319b1a){_0x5a79e2=_0x5a79e2-0x0;var _0x266c45=_0x6fe3[_0x5a79e2];return _0x266c45;};'use strict';var util=require(_0x36fe('0x0'));var _=require(_0x36fe('0x1'));var uuid=require(_0x36fe('0x2'));var moment=require(_0x36fe('0x3'));var Redis=require(_0x36fe('0x4'));var config=require(_0x36fe('0x5'));var logger=require(_0x36fe('0x6'))('preview');var loggerAction=require('../../../config/logger')('actionPreview');var ami=require(_0x36fe('0x7'));var rpcDb=require('./rpcDb');var cmHopperAdditionalPhone=require(_0x36fe('0x8'));var Action=require(_0x36fe('0x9'));var ut=require(_0x36fe('0xa'));var utils=require(_0x36fe('0xb'));config[_0x36fe('0xc')]=_[_0x36fe('0xd')](config[_0x36fe('0xc')],{'host':_0x36fe('0xe'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0x36fe('0xc')]));var Sequence=function(){};Sequence['prototype'][_0x36fe('0xf')]=function(_0x358317){this[_0x36fe('0x10')]=this['tail']?this[_0x36fe('0x10')][_0x36fe('0x11')](_0x358317):_0x358317();};function Preview(_0x59d954){this[_0x36fe('0x12')]=new Sequence();this[_0x36fe('0x13')]=_0x59d954[_0x36fe('0x14')];this[_0x36fe('0x15')]=_0x59d954[_0x36fe('0x15')];this['actions']={};this[_0x36fe('0x16')]=_0x59d954[_0x36fe('0x16')];this[_0x36fe('0x17')]=0x0;ami['on'](_0x36fe('0x18'),this[_0x36fe('0x19')][_0x36fe('0x1a')](this));ami['on']('hangup',this['syncHangup']['bind'](this));ami['on']('hanguprequest',this['syncHangupRequest'][_0x36fe('0x1a')](this));ami['on'](_0x36fe('0x1b'),this['syncDialEnd'][_0x36fe('0x1a')](this));ami['on'](_0x36fe('0x1c'),this[_0x36fe('0x1d')][_0x36fe('0x1a')](this));ami['on'](_0x36fe('0x1e'),this[_0x36fe('0x1f')][_0x36fe('0x1a')](this));ami['on'](_0x36fe('0x20'),this[_0x36fe('0x21')][_0x36fe('0x1a')](this));ami['on']('blindtransfer',this[_0x36fe('0x22')]['bind'](this));this[_0x36fe('0x23')](this['campaignsPreview']);}function emit(_0x15e9f2,_0x270ee5,_0x42d464){io['to'](_0x15e9f2)[_0x36fe('0x24')](_0x270ee5,_0x42d464);}function emitVoiceQueueChannelRemove(_0x4bb22b){logger[_0x36fe('0x25')](_0x36fe('0x26'),JSON[_0x36fe('0x27')](_0x4bb22b));emit(util[_0x36fe('0x28')](_0x36fe('0x29'),_0x4bb22b[_0x36fe('0x2a')]),_0x36fe('0x2b'),_0x4bb22b);io[_0x36fe('0x24')]('voice_queue_presence:remove',_0x4bb22b);}function notSendMessagesQueue(_0x2d4abf){if(_0x2d4abf[_0x36fe('0x2c')]){if(_0x2d4abf[_0x36fe('0x2d')]===0x0&&_0x2d4abf[_0x36fe('0x2e')]===0x0){_0x2d4abf[_0x36fe('0x2c')]=![];_0x2d4abf[_0x36fe('0x2f')]=0x0;_0x2d4abf[_0x36fe('0x30')]=0x0;_0x2d4abf[_0x36fe('0x31')]=utils[_0x36fe('0x32')]['INACTIVE'];ut[_0x36fe('0x33')]('[CampaignPreview]\x20Campaign\x20Queue:\x20',_0x2d4abf[_0x36fe('0x2a')]+_0x36fe('0x34'));}else{_0x2d4abf[_0x36fe('0x31')]=utils['CAMPAIGN_STATUS'][_0x36fe('0x35')];ut[_0x36fe('0x33')](_0x36fe('0x36'),_0x2d4abf[_0x36fe('0x2a')]+'\x20is\x20deactivated');}}}Preview[_0x36fe('0x37')][_0x36fe('0x23')]=function(){var _0x41dcc1=this;setInterval(function(){_0x41dcc1[_0x36fe('0x38')]();},0x7cf);};Preview[_0x36fe('0x37')]['syncCampaigns']=function(){var _0x51c106=this[_0x36fe('0x13')];this[_0x36fe('0x17')]+=0x1;for(var _0x260964 in _0x51c106){if(_0x51c106[_0x36fe('0x39')](_0x260964)&&(_0x51c106[_0x260964]['dialMethod']===_0x36fe('0x3a')||_0x51c106[_0x260964][_0x36fe('0x3b')]===_0x36fe('0x3c'))&&_0x51c106[_0x260964][_0x36fe('0x3d')]==='outbound'){if(this['clockClearZombieChannels']>0x7){this[_0x36fe('0x17')]=0x0;this['clearZombieChannels']();}}if(_0x51c106[_0x36fe('0x39')](_0x260964)&&_0x51c106[_0x260964][_0x36fe('0x3b')]==='preview'&&_0x51c106[_0x260964]['type']===_0x36fe('0x3e')){if(_0x51c106[_0x260964]['dialActive']){this[_0x36fe('0x3f')](_0x51c106[_0x260964]);if(_0x51c106[_0x260964][_0x36fe('0x40')])this['recallMe'](_0x51c106[_0x260964]);}else{notSendMessagesQueue(_0x51c106[_0x260964]);}}}};Preview[_0x36fe('0x37')][_0x36fe('0x41')]=function(_0xa799ae){var _0x3c139d=this;this[_0x36fe('0x12')]['enqueue'](function(){if(!_[_0x36fe('0x42')](_0x3c139d[_0x36fe('0x43')][_0xa799ae])){loggerAction['info'](_0x36fe('0x44'),_0xa799ae,_0x36fe('0x45'),_0x3c139d[_0x36fe('0x43')][_0xa799ae][_0x36fe('0x46')],_0x36fe('0x47'),JSON[_0x36fe('0x27')](_0x3c139d['campaignsPreview'][_0x3c139d[_0x36fe('0x43')][_0xa799ae][_0x36fe('0x46')]]['originated']),_0x36fe('0x48'),JSON['stringify'](_0x3c139d[_0x36fe('0x13')][_0x3c139d['actions'][_0xa799ae]['queue']][_0x36fe('0x2e')]),JSON[_0x36fe('0x27')](_0x3c139d[_0x36fe('0x43')][_0xa799ae][_0x36fe('0x49')]),JSON['stringify'](_[_0x36fe('0x4a')](_0x3c139d[_0x36fe('0x43')][_0xa799ae],[_0x36fe('0x4b'),_0x36fe('0x4c'),_0x36fe('0x4d'),_0x36fe('0x4e')])));return ami[_0x36fe('0x4f')]({'action':_0x36fe('0x50'),'channel':_0x3c139d[_0x36fe('0x43')][_0xa799ae]['channel']})[_0x36fe('0x51')](function(_0x571d52){if(_0x571d52[_0x36fe('0x31')]==='No\x20such\x20channel'){setTimeout(function(){if(_0x3c139d['actions'][_0xa799ae]){ut[_0x36fe('0x52')](_0x3c139d[_0x36fe('0x13')][_0x3c139d['actions'][_0xa799ae]['queue']],_0x36fe('0x53'));if(_0x3c139d[_0x36fe('0x43')][_0xa799ae][_0x36fe('0x49')]===!![]){ut[_0x36fe('0x54')](_0x3c139d[_0x36fe('0x13')][_0x3c139d[_0x36fe('0x43')][_0xa799ae][_0x36fe('0x46')]],'[clearZombieChannel]');ut['loggerError']('[Dialer][checkChannel][pTalking][Preview]'+_0xa799ae,_0x3c139d['actions'][_0xa799ae][_0x36fe('0x46')]);}ut[_0x36fe('0x55')](_0x36fe('0x56')+_0xa799ae,_0x3c139d['actions'][_0xa799ae][_0x36fe('0x46')]);delete _0x3c139d['actions'][_0xa799ae];}},0x2328);}});}});};Preview[_0x36fe('0x37')]['clearZombieChannels']=function(){var _0x334083=this;loggerAction[_0x36fe('0x25')]('[action]',_[_0x36fe('0x57')](this[_0x36fe('0x43')]));for(var _0x3f15cf in this[_0x36fe('0x43')]){if(_0x334083['actions'][_0x36fe('0x39')](_0x3f15cf)){_0x334083['clearZombieChannel'](_0x3f15cf);}}};Preview[_0x36fe('0x37')]['recallMe']=function(_0x5a82b6){var _0x56efd7=this;rpcDb['getContactRecallMe'](_0x5a82b6['id'],ut['agentReadyId'](this[_0x36fe('0x16')]))[_0x36fe('0x58')](function(_0x13553e){if(!_[_0x36fe('0x42')](_0x13553e)){for(var _0x3d5b3e=0x0;_0x3d5b3e<_0x13553e[_0x36fe('0x59')];_0x3d5b3e+=0x1){if(ut[_0x36fe('0x5a')](_0x13553e[_0x3d5b3e]['scheduledat'])<_0x5a82b6[_0x36fe('0x5b')]*0x3c){if(_0x13553e[_0x3d5b3e]['Agent']&&!_0x13553e[_0x3d5b3e][_0x36fe('0x5c')][_0x36fe('0x5d')]){_0x56efd7[_0x36fe('0x5e')](_0x13553e[_0x3d5b3e]['id'])[_0x36fe('0x58')](ut[_0x36fe('0x5f')](_0x36fe('0x60')))['catch'](ut[_0x36fe('0x5f')]('[RecallMe]'));}else{rpcDb['disableContact'](_0x13553e[_0x3d5b3e]['id']);}}else{var _0x1a0e6b=new Action(_0x13553e[_0x3d5b3e],_0x5a82b6);_0x1a0e6b[_0x36fe('0x61')]=moment()[_0x36fe('0x28')](_0x36fe('0x62'));_0x5a82b6[_0x36fe('0x63')]+=0x1;ut[_0x36fe('0x64')](_0x1a0e6b,0x17,_0x36fe('0x65'));if(_0x5a82b6[_0x36fe('0x66')]){rpcDb[_0x36fe('0x67')](ut[_0x36fe('0x68')](_0x13553e[_0x3d5b3e]));rpcDb[_0x36fe('0x69')](_0x1a0e6b,_0x36fe('0x6a'));}else{ut[_0x36fe('0x64')](_0x1a0e6b,0x16,_0x36fe('0x6b'));rpcDb['createCustomerHistory'](_0x1a0e6b,_0x36fe('0x6c'));rpcDb[_0x36fe('0x6d')](_0x1a0e6b,_0x36fe('0x6c'));}}}}})[_0x36fe('0x51')](ut[_0x36fe('0x5f')](_0x36fe('0x6e')));};Preview[_0x36fe('0x37')][_0x36fe('0x3f')]=function(_0x4beed6){_0x4beed6[_0x36fe('0x2c')]=!![];if(ut[_0x36fe('0x6f')](_0x4beed6[_0x36fe('0x70')])){_0x4beed6['message']=utils[_0x36fe('0x32')][_0x36fe('0x71')];}else if(!ut['isActive'](_0x4beed6['dialActive'])){_0x4beed6[_0x36fe('0x31')]=utils[_0x36fe('0x32')][_0x36fe('0x72')];}else if(!this[_0x36fe('0x73')](_0x4beed6['Trunk'])){if(!this[_0x36fe('0x73')](_0x4beed6['TrunkBackup'])){_0x4beed6[_0x36fe('0x31')]=utils[_0x36fe('0x32')][_0x36fe('0x74')];}else{_0x4beed6[_0x36fe('0x31')]=utils[_0x36fe('0x32')][_0x36fe('0x75')];}}else{_0x4beed6[_0x36fe('0x31')]=utils[_0x36fe('0x32')][_0x36fe('0x75')];}};Preview[_0x36fe('0x37')][_0x36fe('0x76')]=function(_0x5b1b6b,_0x4b869f,_0x2dfe00){var _0x2ea7be=this;var _0x16536a=this[_0x36fe('0x43')][_0x4b869f];var _0x268b05=this['campaignsPreview'][_0x16536a[_0x36fe('0x46')]];var _0x293e9b;var _0x72808a=![];var _0x3f9a9c=0x2;var _0x3bc513=0x3;if(_0x268b05){switch(_0x2dfe00){case'1':_0x268b05['outboundNoSuchCallsDay']+=0x1;_0x16536a[_0x36fe('0x77')]+=0x1;_0x16536a[_0x36fe('0x78')]=ut[_0x36fe('0x79')](_0x16536a);ut['logCustomer'](_0x16536a,0x0,_0x36fe('0x7a'));ami[_0x36fe('0x24')](_0x36fe('0x7b'),ut['buildObj'](_0x16536a,_0x36fe('0x7c')));rpcDb[_0x36fe('0x69')](_0x16536a,'[callProgressDetectingCustomer][logNoSuch]');_0x2ea7be[_0x36fe('0x7d')](_0x16536a,'0',_0x268b05)[_0x36fe('0x58')](function(_0x4d7237){_0x72808a=_0x4d7237[_0x36fe('0x7e')]==0x1;_0x3f9a9c=_0x268b05[_0x36fe('0x7f')];_0x3bc513=_0x268b05[_0x36fe('0x80')];if(!_0x72808a){if(ut[_0x36fe('0x79')](_0x16536a)>=_0x268b05[_0x36fe('0x81')]){_0x293e9b=ut['cloneAction'](_0x16536a,0xf,'Global');rpcDb[_0x36fe('0x6d')](_0x293e9b,'[callProgressDetectingCustomer][logNoSuchGlobal]');}else{if(_0x16536a[_0x36fe('0x77')]>=_0x268b05['dialNoSuchNumberMaxRetry']){rpcDb[_0x36fe('0x6d')](_0x16536a,_0x36fe('0x82'));}else{rpcDb[_0x36fe('0x83')](ut[_0x36fe('0x84')](_0x16536a,_0x36fe('0x77'),_0x268b05[_0x36fe('0x7f')]),_0x16536a[_0x36fe('0x85')],_0x16536a['activeContact']);}}delete this[_0x36fe('0x43')][_0x5b1b6b[_0x36fe('0x86')]];}else{_0x16536a['countnosuchnumberretry']++;logger[_0x36fe('0x25')]('actioncountonusuch',_0x16536a[_0x36fe('0x77')]);logger[_0x36fe('0x25')]('id',_0x16536a[_0x36fe('0x87')]);_0x2ea7be[_0x36fe('0x88')]({'id':_0x16536a[_0x36fe('0x87')],'field':{'countnosuchnumberretry':_0x16536a['countnosuchnumberretry']}})[_0x36fe('0x58')](function(){_0x2ea7be[_0x36fe('0x89')](_0x16536a,_0x3f9a9c,_0x3bc513)[_0x36fe('0x58')](function(){});});}});break;case _0x36fe('0x8a'):var _0x3f4060=moment()[_0x36fe('0x28')]('YYYY-MM-DD\x20HH:mm:ss');_0x16536a[_0x36fe('0x8b')]=_0x3f4060;_0x16536a['answertime']=_0x3f4060;_0x16536a[_0x36fe('0x49')]=!![];_0x268b05[_0x36fe('0x2e')]+=0x1;logger[_0x36fe('0x25')](_0x36fe('0x8c'),_0x16536a[_0x36fe('0x8d')],_0x36fe('0x8e'),_0x268b05[_0x36fe('0x2a')],_0x36fe('0x48'),_0x268b05['pTalking']);ami[_0x36fe('0x24')](_0x36fe('0x8f'),ut[_0x36fe('0x90')](_0x16536a,_0x36fe('0x91'),this[_0x36fe('0x13')][_0x16536a['queue']]));if(_0x268b05[_0x36fe('0x92')]){ami[_0x36fe('0x24')](_0x36fe('0x93'),ut[_0x36fe('0x94')](_0x16536a));}break;case'16':ami['emit']('custom:agentcomplete',ut[_0x36fe('0x90')](_0x16536a,_0x36fe('0x95'),this[_0x36fe('0x13')][_0x16536a[_0x36fe('0x46')]]));emitVoiceQueueChannelRemove(ut['buildObj'](_0x16536a,_0x36fe('0x95')));_0x268b05['outboundAnswerCallsDay']+=0x1;_0x268b05[_0x36fe('0x96')]+=0x1;_0x268b05['answered']+=0x1;ut[_0x36fe('0x54')](_0x268b05,'[16]');_0x16536a[_0x36fe('0x78')]=ut[_0x36fe('0x79')](_0x16536a);ut[_0x36fe('0x64')](_0x16536a,0x4,'Answer');rpcDb[_0x36fe('0x69')](_0x16536a,'[callProgressDetectingCustomer][logAnswer]');rpcDb['createCustomerFinal'](_0x16536a,_0x36fe('0x97'));rpcDb['crateCustomerReportQueue'](_0x16536a);_0x268b05[_0x36fe('0x98')]+=_0x16536a['talktime'];_0x268b05['sumBillable']+=_0x16536a[_0x36fe('0x99')];logger[_0x36fe('0x25')]('[syncHangup][talking][decrement]',_0x16536a[_0x36fe('0x8d')],_0x36fe('0x8e'),_0x268b05['name'],'pTalking:\x20',_0x268b05['pTalking']);delete this[_0x36fe('0x43')][_0x5b1b6b['linkedid']];break;case _0x36fe('0x9a'):_0x268b05[_0x36fe('0x9b')]+=0x1;_0x16536a[_0x36fe('0x9c')]+=0x1;_0x16536a[_0x36fe('0x78')]=ut[_0x36fe('0x79')](_0x16536a);ut[_0x36fe('0x64')](_0x16536a,0x5,_0x36fe('0x9d'));_0x3f9a9c=_0x268b05[_0x36fe('0x9e')];_0x3bc513=_0x268b05['callAdditionalPhoneAfterMin'];ami['emit'](_0x36fe('0x9f'),ut[_0x36fe('0x90')](_0x16536a,_0x36fe('0xa0')));rpcDb[_0x36fe('0x69')](_0x16536a,_0x36fe('0xa1'));_0x2ea7be[_0x36fe('0x7d')](_0x16536a,'5',_0x268b05)[_0x36fe('0x58')](function(_0x15e276){_0x72808a=_0x15e276[_0x36fe('0x7e')]==0x1;if(!_0x72808a){if(ut[_0x36fe('0x79')](_0x16536a)>=_0x268b05[_0x36fe('0x81')]){_0x293e9b=ut[_0x36fe('0xa2')](_0x16536a,0xf,_0x36fe('0xa3'));rpcDb[_0x36fe('0x6d')](_0x293e9b,_0x36fe('0xa4'));}else{if(_0x16536a[_0x36fe('0x9c')]>=_0x268b05[_0x36fe('0xa5')]){rpcDb[_0x36fe('0x6d')](_0x16536a,_0x36fe('0xa1'));}else{rpcDb['rescheduleContact'](ut[_0x36fe('0x84')](_0x16536a,_0x36fe('0x9c'),_0x268b05[_0x36fe('0x9e')]),_0x16536a[_0x36fe('0x85')],_0x16536a[_0x36fe('0xa6')]);}}}else{_0x16536a[_0x36fe('0x9c')]++;_0x2ea7be['incrementPreviewCounters']({'id':_0x16536a['idContact'],'field':{'countbusyretry':_0x16536a[_0x36fe('0x9c')]}})[_0x36fe('0x58')](function(){_0x2ea7be[_0x36fe('0x89')](_0x16536a,_0x3f9a9c,_0x3bc513)['then'](function(){});});}});break;case _0x36fe('0xa7'):_0x268b05[_0x36fe('0xa8')]+=0x1;_0x16536a['countnoanswerretry']+=0x1;_0x16536a[_0x36fe('0x78')]=ut['totalGlobal'](_0x16536a);ut['logCustomer'](_0x16536a,0x3,'NoAnswer');_0x3f9a9c=_0x268b05[_0x36fe('0xa9')];_0x3bc513=_0x268b05[_0x36fe('0x80')];var _0x4f1365=ut[_0x36fe('0xaa')](_0x16536a,_0x268b05);ami[_0x36fe('0x24')]('custom:agentnoanswer',_0x4f1365);rpcDb[_0x36fe('0x69')](_0x16536a,'[callProgressDetectingCustomer][logNoAnswer]');_0x2ea7be[_0x36fe('0x7d')](_0x16536a,'3',_0x268b05)['then'](function(_0x270815){_0x72808a=_0x270815[_0x36fe('0x7e')]==0x1;if(!_0x72808a){if(ut[_0x36fe('0x79')](_0x16536a)>=_0x268b05[_0x36fe('0x81')]){_0x293e9b=ut[_0x36fe('0xa2')](_0x16536a,0xf,_0x36fe('0xa3'));rpcDb[_0x36fe('0x6d')](_0x293e9b,_0x36fe('0xab'));}else{if(_0x16536a[_0x36fe('0xac')]>=_0x268b05['dialNoAnswerMaxRetry']){rpcDb[_0x36fe('0x6d')](_0x16536a,_0x36fe('0xad'));}else{rpcDb['rescheduleContact'](ut['scheduledAt'](_0x16536a,'countnoanswerretry',_0x268b05[_0x36fe('0xa9')]),_0x16536a['unlockAgent'],_0x16536a[_0x36fe('0xa6')]);}}}else{_0x16536a['countnoanswerretry']++;_0x2ea7be[_0x36fe('0x88')]({'id':_0x16536a[_0x36fe('0x87')],'field':{'countnoanswerretry':_0x16536a[_0x36fe('0xac')]}})['then'](function(){_0x2ea7be['swapAdditionalPhones'](_0x16536a,_0x3f9a9c,_0x3bc513)[_0x36fe('0x58')](function(){});});}});break;case'CONGESTION':_0x268b05['outboundCongestionCallsDay']+=0x1;_0x16536a[_0x36fe('0xae')]+=0x1;_0x16536a[_0x36fe('0x78')]=ut[_0x36fe('0x79')](_0x16536a);ut['logCustomer'](_0x16536a,0x8,'Congestion');_0x3f9a9c=_0x268b05['dialCongestionRetryFrequency'];_0x3bc513=_0x268b05['callAdditionalPhoneAfterMin'];ami[_0x36fe('0x24')](_0x36fe('0xaf'),ut['buildObj'](_0x16536a,'congestion'));rpcDb['createCustomerHistory'](_0x16536a,'[callProgressDetectingCustomer][logCongestion]');_0x2ea7be[_0x36fe('0x7d')](_0x16536a,'8',_0x268b05)[_0x36fe('0x58')](function(_0x431ac2){_0x72808a=_0x431ac2[_0x36fe('0x7e')]==0x1;if(!_0x72808a){if(ut['totalGlobal'](_0x16536a)>=_0x268b05[_0x36fe('0x81')]){_0x293e9b=ut[_0x36fe('0xa2')](_0x16536a,0xf,_0x36fe('0xa3'));rpcDb[_0x36fe('0x6d')](_0x293e9b,_0x36fe('0xb0'));}else{if(_0x16536a[_0x36fe('0xae')]>=_0x268b05[_0x36fe('0xb1')]){rpcDb[_0x36fe('0x6d')](_0x16536a,_0x36fe('0xb2'));}else{rpcDb[_0x36fe('0x83')](ut['scheduledAt'](_0x16536a,_0x36fe('0xae'),_0x268b05[_0x36fe('0x9e')]),_0x16536a[_0x36fe('0x85')],_0x16536a['activeContact']);}}}else{_0x16536a['countcongestionretry']++;_0x2ea7be['incrementPreviewCounters']({'id':_0x16536a[_0x36fe('0x87')],'field':{'countcongestionretry':_0x16536a[_0x36fe('0xae')]}})[_0x36fe('0x58')](function(){_0x2ea7be[_0x36fe('0x89')](_0x16536a,_0x3f9a9c,_0x3bc513)[_0x36fe('0x58')](function(){});});}});break;case _0x36fe('0xb3'):_0x268b05['outboundRejectCallsDay']+=0x1;_0x16536a[_0x36fe('0xb4')]+=0x1;_0x16536a[_0x36fe('0x78')]=ut['totalGlobal'](_0x16536a);ut[_0x36fe('0x64')](_0x16536a,0x14,_0x36fe('0xb5'));_0x3f9a9c=_0x268b05[_0x36fe('0xb6')];_0x3bc513=_0x268b05[_0x36fe('0x80')];ami[_0x36fe('0x24')](_0x36fe('0xb7'),ut[_0x36fe('0x90')](_0x16536a,_0x36fe('0xb8')));rpcDb[_0x36fe('0x69')](_0x16536a,'[syncHangupRequest][logAgentReject]');_0x2ea7be[_0x36fe('0x7d')](_0x16536a,'20',_0x268b05)[_0x36fe('0x58')](function(_0x5d940a){_0x72808a=_0x5d940a[_0x36fe('0x7e')]==0x1;if(!_0x72808a){if(ut[_0x36fe('0x79')](_0x16536a)>=_0x268b05[_0x36fe('0x81')]){_0x293e9b=ut[_0x36fe('0xa2')](_0x16536a,0x14,'AgentReject');rpcDb['createCustomerFinal'](_0x293e9b,'[callProgressDetectingCustomer][logAgentReject]');}else{if(_0x16536a[_0x36fe('0xb4')]>=_0x268b05['dialAgentRejectMaxRetry']){rpcDb[_0x36fe('0x6d')](_0x16536a,'[callProgressDetectingCustomer][logAgentReject]');}else{rpcDb[_0x36fe('0x83')](ut['scheduledAt'](_0x16536a,_0x36fe('0xb4'),_0x268b05[_0x36fe('0xb6')]),_0x16536a[_0x36fe('0x85')],_0x16536a['activeContact']);}}}else{_0x16536a[_0x36fe('0xac')]++;_0x2ea7be[_0x36fe('0x88')]({'id':_0x16536a[_0x36fe('0x87')],'field':{'countnoanswerretry':_0x16536a['countnoanswerretry']}})['then'](function(){_0x2ea7be[_0x36fe('0x89')](_0x16536a,_0x3f9a9c,_0x3bc513)['then'](function(){});});}});break;case'ABANDONED':_0x268b05[_0x36fe('0xb9')]+=0x1;_0x16536a[_0x36fe('0xba')]+=0x1;_0x16536a[_0x36fe('0x78')]=ut[_0x36fe('0x79')](_0x16536a);ut[_0x36fe('0x64')](_0x16536a,0xb,_0x36fe('0xbb'));rpcDb[_0x36fe('0x69')](_0x16536a,_0x36fe('0xbc'));_0x2ea7be['verifyAdditionalPhones'](_0x16536a,'11',_0x268b05)[_0x36fe('0x58')](function(_0x1ba902){_0x72808a=_0x1ba902[_0x36fe('0x7e')]==0x1;if(!_0x72808a){if(ut[_0x36fe('0x79')](_0x16536a)>=_0x268b05[_0x36fe('0x81')]){_0x293e9b=ut[_0x36fe('0xa2')](_0x16536a,0xf,_0x36fe('0xa3'));rpcDb['createCustomerFinal'](_0x293e9b,_0x36fe('0xbc'));}else{if(_0x16536a['countabandonedetry']>=_0x268b05[_0x36fe('0xbd')]){rpcDb[_0x36fe('0x6d')](_0x16536a,_0x36fe('0xbc'));}else{rpcDb[_0x36fe('0x83')](ut[_0x36fe('0x84')](_0x16536a,'countabandonedretry',_0x268b05[_0x36fe('0xbe')]),_0x16536a[_0x36fe('0x85')],_0x16536a[_0x36fe('0xa6')]);}}}else{_0x16536a[_0x36fe('0xac')]++;_0x2ea7be[_0x36fe('0x88')]({'id':_0x16536a[_0x36fe('0x87')],'field':{'countnoanswerretry':_0x16536a[_0x36fe('0xac')]}})['then'](function(){_0x2ea7be[_0x36fe('0x89')](_0x16536a,_0x3f9a9c,_0x3bc513)[_0x36fe('0x58')](function(){});});}});break;case'18':_0x268b05[_0x36fe('0xbf')]+=0x1;_0x16536a[_0x36fe('0xc0')]+=0x1;_0x16536a['countglobal']=ut[_0x36fe('0x79')](_0x16536a);ut[_0x36fe('0x64')](_0x16536a,0x12,_0x5b1b6b['cause-txt']||_0x5b1b6b['dialstatus']);ami[_0x36fe('0x24')]('custom:amd',ut[_0x36fe('0x90')](_0x16536a,_0x36fe('0xc1')));rpcDb[_0x36fe('0x69')](_0x16536a,_0x36fe('0xc2'));_0x2ea7be['verifyAdditionalPhones'](_0x16536a,'18',_0x268b05)[_0x36fe('0x58')](function(_0x5db9cd){_0x72808a=_0x5db9cd[_0x36fe('0x7e')]==0x1;if(!_0x72808a){if(ut[_0x36fe('0x79')](_0x16536a)>=_0x268b05['dialGlobalMaxRetry']){_0x293e9b=ut[_0x36fe('0xa2')](_0x16536a,0x12,'Global');rpcDb['createCustomerFinal'](_0x293e9b,_0x36fe('0xc2'));}else{rpcDb[_0x36fe('0x6d')](_0x16536a,_0x36fe('0xc2'));}}else{_0x16536a[_0x36fe('0xac')]++;_0x2ea7be[_0x36fe('0x88')]({'id':_0x16536a['idContact'],'field':{'countnoanswerretry':_0x16536a['countnoanswerretry']}})[_0x36fe('0x58')](function(){_0x2ea7be['swapAdditionalPhones'](_0x16536a,_0x3f9a9c,_0x3bc513)[_0x36fe('0x58')](function(){});});}});delete this['actions'][_0x5b1b6b[_0x36fe('0x86')]];break;case'19':_0x268b05[_0x36fe('0xbf')]+=0x1;_0x16536a['countglobal']=ut[_0x36fe('0x79')](_0x16536a);ut[_0x36fe('0x64')](_0x16536a,0x13,_0x5b1b6b[_0x36fe('0xc3')]||_0x5b1b6b[_0x36fe('0xc4')]);ami['emit'](_0x36fe('0xc5'),ut['buildObj'](_0x16536a,'amd'));rpcDb[_0x36fe('0x69')](_0x16536a,_0x36fe('0xc6'));_0x2ea7be[_0x36fe('0x7d')](_0x16536a,'18',_0x268b05)['then'](function(_0x450a27){_0x72808a=_0x450a27[_0x36fe('0x7e')]==0x1;if(!_0x72808a){if(ut[_0x36fe('0x79')](_0x16536a)>=_0x268b05[_0x36fe('0x81')]){_0x293e9b=ut[_0x36fe('0xa2')](_0x16536a,0xf,'Global');rpcDb[_0x36fe('0x6d')](_0x293e9b,_0x36fe('0xc6'));}else{rpcDb[_0x36fe('0x6d')](_0x16536a,_0x36fe('0xc6'));}}else{_0x16536a[_0x36fe('0xac')]++;_0x2ea7be['incrementPreviewCounters']({'id':_0x16536a[_0x36fe('0x87')],'field':{'countnoanswerretry':_0x16536a[_0x36fe('0xac')]}})[_0x36fe('0x58')](function(){_0x2ea7be['swapAdditionalPhones'](_0x16536a,_0x3f9a9c,_0x3bc513)[_0x36fe('0x58')](function(){});});}});delete this[_0x36fe('0x43')][_0x5b1b6b[_0x36fe('0x86')]];break;default:if(_0x16536a['dialAnswer']){ut[_0x36fe('0x54')](_0x268b05,_0x36fe('0xc7'));ut[_0x36fe('0x55')](_0x36fe('0xc8')+_0x268b05[_0x36fe('0x2a')],_0x5b1b6b);}_0x268b05[_0x36fe('0xbf')]+=0x1;_0x16536a[_0x36fe('0x78')]=ut[_0x36fe('0x79')](_0x16536a);ut['logCustomer'](_0x16536a,0xc,_0x5b1b6b[_0x36fe('0xc3')]||_0x5b1b6b[_0x36fe('0xc4')]);_0x3f9a9c=_0x268b05['dialAgentRejectRetryFrequency'];_0x3bc513=_0x268b05[_0x36fe('0x80')];rpcDb['createCustomerHistory'](_0x16536a,'[callProgressDetectingCustomer][logUnknown]');_0x2ea7be[_0x36fe('0x7d')](_0x16536a,'20',_0x268b05)[_0x36fe('0x58')](function(_0x175269){_0x72808a=_0x175269[_0x36fe('0x7e')]==0x1;if(!_0x72808a){if(ut[_0x36fe('0x79')](_0x16536a)>=_0x268b05[_0x36fe('0x81')]){_0x293e9b=ut[_0x36fe('0xa2')](_0x16536a,0xf,_0x36fe('0xa3'));rpcDb[_0x36fe('0x6d')](_0x293e9b,_0x36fe('0xc9'));}else{rpcDb[_0x36fe('0x6d')](_0x16536a,_0x36fe('0xc9'));}delete this[_0x36fe('0x43')][_0x5b1b6b[_0x36fe('0x86')]];}else{_0x2ea7be[_0x36fe('0x89')](_0x16536a,_0x3f9a9c,_0x3bc513)['then'](function(){});}});}if(!(_0x16536a[_0x36fe('0x49')]&&_0x2dfe00==='16')){ut[_0x36fe('0x52')](_0x268b05,'[callProgressDetectingCustomer]');logger['info'](_0x36fe('0xca'),_0x16536a['uniqueid'],_0x36fe('0x8e'),_0x268b05['name'],'originated:\x20',_0x268b05[_0x36fe('0x2d')]);}if(_0x2dfe00!==_0x36fe('0x8a')){delete this['actions'][_0x5b1b6b[_0x36fe('0x86')]];delete this[_0x36fe('0x43')][_0x5b1b6b[_0x36fe('0xcb')]];}_0x268b05[_0x36fe('0xcc')]=!![];}};Preview[_0x36fe('0x37')]['callProgressDetectingAgent']=function(_0x17b9b7,_0x26a1ae,_0x513558){if(_[_0x36fe('0xcd')](_0x26a1ae)&&_0x36fe('0xce')!==typeof _0x26a1ae){return;}if(_[_0x36fe('0xcd')](_0x513558)&&_0x36fe('0xce')!==typeof _0x513558){return;}switch(_0x513558['reason']){case'0':ut[_0x36fe('0xcf')](_0x17b9b7,0x0,_0x36fe('0x7a'));rpcDb[_0x36fe('0xd0')](_0x17b9b7,_0x36fe('0xd1'));break;case'3':ut[_0x36fe('0xcf')](_0x17b9b7,0x3,_0x36fe('0xd2'));rpcDb[_0x36fe('0xd0')](_0x17b9b7,_0x36fe('0xd3'));break;case'5':ut[_0x36fe('0xcf')](_0x17b9b7,0x5,_0x36fe('0x9d'));rpcDb[_0x36fe('0xd0')](_0x17b9b7,_0x36fe('0xd4'));break;case'8':ut['logAgent'](_0x17b9b7,0x8,_0x36fe('0xd5'));rpcDb[_0x36fe('0xd0')](_0x17b9b7,_0x36fe('0xd6'));break;case'22':ut['logAgent'](_0x17b9b7,0x16,'AnswerAGI');rpcDb[_0x36fe('0xd0')](_0x17b9b7,'[callProgressDetectingAgent][logAnswerAGI]');break;default:ut['logAgent'](_0x17b9b7,0xc,_0x513558[_0x36fe('0xd7')]);rpcDb[_0x36fe('0xd0')](_0x17b9b7,_0x36fe('0xd6'));}ut[_0x36fe('0x52')](_0x26a1ae,'[callProgressDetectingAgent]');logger[_0x36fe('0x25')](_0x36fe('0xd8'),_0x17b9b7[_0x36fe('0x8d')],'\x20Queue',_0x26a1ae['name'],_0x36fe('0x47'),_0x26a1ae[_0x36fe('0x2d')]);delete this[_0x36fe('0x43')][_0x17b9b7[_0x36fe('0x8d')]];};Preview[_0x36fe('0x37')]['verifyAdditionalPhones']=function(_0x4a826d,_0xb8b907,_0x1c31e9){return cmHopperAdditionalPhone['verifyAdditionalPhones'](_0x4a826d,_0xb8b907,_0x1c31e9)[_0x36fe('0x51')](logger['info'](_0x36fe('0xd9')));};Preview[_0x36fe('0x37')][_0x36fe('0x89')]=function(_0x1a0d23,_0x128e03,_0x2274d2){return cmHopperAdditionalPhone[_0x36fe('0x89')](_0x1a0d23,_0x128e03,_0x2274d2)['catch'](logger[_0x36fe('0x25')](_0x36fe('0xda')));};Preview[_0x36fe('0x37')][_0x36fe('0x88')]=function(_0x2abe83){return Promise[_0x36fe('0xdb')]()[_0x36fe('0x58')](cmHopperAdditionalPhone[_0x36fe('0x88')](_0x2abe83))[_0x36fe('0x51')](logger['info'](_0x36fe('0xdc')));};Preview[_0x36fe('0x37')][_0x36fe('0xdd')]=function(_0x57a748,_0x35cb44,_0x52e85d,_0x55312a,_0x3b70aa){var _0x2a00ed=this;return new Promise(function(_0x4a7801,_0x1f9852){if(_[_0x36fe('0x42')](_0x35cb44)||_[_0x36fe('0x42')](_0x35cb44['Contact'])||_[_0x36fe('0x42')](_0x35cb44[_0x36fe('0xde')])||_[_0x36fe('0x42')](_0x35cb44[_0x36fe('0x4d')])){_0x1f9852(ut['message'](_0x36fe('0xdf'),_0x55312a,_0x3b70aa));return;}var _0x420dd5=uuid['v4']();var _0x2b3363=_0x2a00ed[_0x36fe('0x13')][_0x35cb44['Queue'][_0x36fe('0x2a')]];var _0x297bac=_0x52e85d?_0x2a00ed['agents'][_0x52e85d]['id']:undefined;_0x2a00ed['actions'][_0x420dd5]=new Action(_0x35cb44,_0x2b3363,_0x420dd5,_0x52e85d,_0x297bac);var _0x54cf99=_0x2a00ed[_0x36fe('0x43')][_0x420dd5];_0x54cf99[_0x36fe('0x85')]=_0x55312a;_0x54cf99['activeContact']=_0x3b70aa;_0x54cf99[_0x36fe('0xe0')]=_0x52e85d;if(_[_0x36fe('0xe1')](_0x57a748)){_0x2a00ed[_0x36fe('0xe2')](_0x54cf99,_0x2b3363,_0x35cb44,_0x52e85d)[_0x36fe('0x58')](function(_0x4d2ce1){logger[_0x36fe('0x25')]('[Preview][execCall][success]',_0x36fe('0xe3')+_0x54cf99[_0x36fe('0x46')]+_0x36fe('0xe4')+_0x54cf99[_0x36fe('0x87')],JSON[_0x36fe('0x27')](_0x4d2ce1));ami[_0x36fe('0x24')](_0x36fe('0xe5'),ut['buildObj'](_0x54cf99,_0x36fe('0xe6'),_0x2a00ed['campaignsPreview'][_0x54cf99[_0x36fe('0x46')]]));_0x4a7801(ut[_0x36fe('0x31')](_0x36fe('0xe7')));})[_0x36fe('0x51')](function(_0x274f9f){ut[_0x36fe('0x33')](_0x36fe('0xe8'),_0x274f9f);_0x1f9852(ut[_0x36fe('0x31')](_0x36fe('0xe9'),_0x55312a,_0x3b70aa));});}else{_0x2b3363['outboundBlacklistCallsDay']+=0x1;ut[_0x36fe('0xea')](_0x54cf99);rpcDb[_0x36fe('0xeb')](_0x54cf99,_0x36fe('0xec'));delete _0x2a00ed[_0x36fe('0x43')][_0x420dd5];_0x1f9852(ut[_0x36fe('0x31')](_0x36fe('0xed'),_0x55312a,_0x3b70aa));}});};Preview[_0x36fe('0x37')][_0x36fe('0x73')]=function(_0x415de0){return!_[_0x36fe('0x42')](_0x415de0)&&!_[_0x36fe('0x42')](_0x415de0[_0x36fe('0x2a')])&&!_[_0x36fe('0x42')](_0x415de0['active'])&&_0x415de0[_0x36fe('0xee')]&&!_[_0x36fe('0x42')](this[_0x36fe('0x15')][util[_0x36fe('0x28')](_0x36fe('0xef'),_0x415de0[_0x36fe('0x2a')])])&&!_['isNil'](this[_0x36fe('0x15')][util[_0x36fe('0x28')](_0x36fe('0xef'),_0x415de0['name'])][_0x36fe('0x50')])&&(this[_0x36fe('0x15')][util[_0x36fe('0x28')](_0x36fe('0xef'),_0x415de0['name'])]['status']==='reachable'||this['trunks'][util['format']('SIP/%s',_0x415de0['name'])]['status']===_0x36fe('0xf0'));};Preview[_0x36fe('0x37')][_0x36fe('0x5e')]=function(_0x3571e0,_0x577cf4){return this[_0x36fe('0xf1')](_0x3571e0,_0x577cf4)[_0x36fe('0x58')](function(_0x2648a0){return _[_0x36fe('0x4a')](_0x2648a0,['message']);})[_0x36fe('0x51')](function(_0x5336a7){if(_0x5336a7['unlock']){rpcDb[_0x36fe('0xf2')](_0x3571e0);}if(_0x5336a7[_0x36fe('0xee')]){rpcDb[_0x36fe('0xf3')](_0x3571e0);}throw _[_0x36fe('0x4a')](_0x5336a7,[_0x36fe('0x31')]);});};Preview['prototype']['execRun']=function(_0xd1910c,_0x51eb3c){var _0x522a62=this;var _0x2384b3,_0x5c3e65;return rpcDb[_0x36fe('0xf4')](_0xd1910c)[_0x36fe('0x58')](function(_0x282d5e){if(!_[_0x36fe('0x42')](_0x282d5e[0x0])){_0x5c3e65=_0x282d5e[0x0][_0x36fe('0xf5')]?![]:!![];_0x2384b3=_0x282d5e[0x0][_0x36fe('0xf5')]?!![]:![];_0x2384b3=_0x51eb3c?!![]:_0x2384b3;}var _0x1473f7=_0x522a62['validateContact'](_0x282d5e);if(_0x1473f7[_0x36fe('0xf6')]){rpcDb[_0x36fe('0xf7')](_['pick'](_0x282d5e[0x0],[_0x36fe('0x4d'),_0x36fe('0xde')]))[_0x36fe('0x58')](function(_0x4f2d06){_0x522a62[_0x36fe('0xdd')](_0x4f2d06,_0x282d5e[0x0],_0x51eb3c,_0x5c3e65,_0x2384b3)[_0x36fe('0x58')](function(_0x2f6731){return _0x2f6731;})[_0x36fe('0x51')](function(_0x24e4a9){throw _0x24e4a9;});})[_0x36fe('0x51')](function(_0x160bb4){ut['logger'](_0x36fe('0xf8'),_0x160bb4);throw ut[_0x36fe('0x31')](_0x36fe('0xf9'),_0x5c3e65,_0x2384b3);});}else{throw ut['message'](_0x1473f7[_0x36fe('0x31')],_0x5c3e65,_0x2384b3);}})[_0x36fe('0x51')](function(_0x33b387){ut[_0x36fe('0x33')](_0x36fe('0xfa'),_0x33b387);throw ut[_0x36fe('0x31')](_0x36fe('0xf9'),![],!![]);});};Preview[_0x36fe('0x37')][_0x36fe('0xfb')]=function(_0x21bbf2){if(_[_0x36fe('0x42')](_0x21bbf2)||_[_0x36fe('0xe1')](_0x21bbf2)||!_[_0x36fe('0x42')](_0x21bbf2[0x0][_0x36fe('0x5c')])&&_[_0x36fe('0x42')](_0x21bbf2[0x0]['Agent'][_0x36fe('0x2a')])){ut['logger'](_0x36fe('0xfc'),_0x21bbf2);return{'isValid':![],'message':_0x36fe('0xfd')};}var _0x4d6467=this[_0x36fe('0x13')][_0x21bbf2[0x0][_0x36fe('0x45')][_0x36fe('0x2a')]];_0x4d6467[_0x36fe('0x31')]=utils['CAMPAIGN_STATUS'][_0x36fe('0x75')];if(_['isNil'](_0x4d6467)){ut['logger'](_0x36fe('0xfe'),_0x4d6467);return{'isValid':![],'message':_0x36fe('0xff')};}if(!this[_0x36fe('0x73')](_0x4d6467[_0x36fe('0x100')])){ut['logger'](_0x36fe('0x101'),'campaign\x20Name:\x20'+_0x4d6467[_0x36fe('0x2a')]+_0x36fe('0x102'));if(!this[_0x36fe('0x73')](_0x4d6467['TrunkBackup'])){ut[_0x36fe('0x33')](_0x36fe('0x101'),_0x4d6467[_0x36fe('0x2a')]+'\x20Trunk\x20Backup\x20is\x20not\x20active');return{'isValid':![],'message':'Trunk\x20not\x20working\x20correctly'};}}if(!ut[_0x36fe('0x103')](_0x4d6467[_0x36fe('0x104')])){ut[_0x36fe('0x33')](_0x36fe('0x105'),_0x4d6467[_0x36fe('0x2a')]+'\x20Not\x20Active');return{'isValid':![],'message':_0x36fe('0x106')+_0x4d6467[_0x36fe('0x2a')]+'\x20Not\x20Active'};}return{'isValid':!![],'message':'Is\x20Valid'};};Preview[_0x36fe('0x37')]['execCall']=function(_0xcc8d8f,_0x16a341,_0x2ab818,_0x1886f9){var _0x3d622b=this;return new Promise(function(_0x3bd049,_0x48bd7e){var _0x52664c=_0xcc8d8f[_0x36fe('0x8d')];var _0x2ce4de=_0x3d622b[_0x36fe('0x73')](_0x16a341['Trunk'])?util[_0x36fe('0x28')](_0x36fe('0x107'),_0x16a341['Trunk'][_0x36fe('0x2a')],_[_0x36fe('0x42')](_0x16a341['dialPrefix'])?'':_0x16a341[_0x36fe('0x108')][_0x36fe('0x109')]()||'',_0x16a341[_0x36fe('0x10a')]>0x0?_0x2ab818[_0x36fe('0xde')][_0x36fe('0x10b')](_0x16a341[_0x36fe('0x10a')]):_0x2ab818[_0x36fe('0xde')]):util[_0x36fe('0x28')]('SIP/%s/%s%s',_[_0x36fe('0x42')](_0x16a341[_0x36fe('0x10c')])?_0x16a341[_0x36fe('0x100')]['name']:_0x16a341['TrunkBackup'][_0x36fe('0x2a')],_[_0x36fe('0x42')](_0x16a341['dialPrefix'])?'':_0x16a341[_0x36fe('0x108')][_0x36fe('0x109')]()||'',_0x16a341[_0x36fe('0x10a')]>0x0?_0x2ab818[_0x36fe('0xde')][_0x36fe('0x10b')](_0x16a341[_0x36fe('0x10a')]):_0x2ab818[_0x36fe('0xde')]);var _0x3a7e1d=_0x3d622b['isTrunkReachable'](_0x16a341[_0x36fe('0x100')])?ut[_0x36fe('0x10d')](_0x16a341[_0x36fe('0x100')][_0x36fe('0x10e')],_0x16a341[_0x36fe('0x10f')],_0x16a341[_0x36fe('0x110')]>0x0?ut[_0x36fe('0x111')](_0x16a341[_0x36fe('0x112')],_0x16a341[_0x36fe('0x110')]):_0x16a341[_0x36fe('0x112')]):ut[_0x36fe('0x10d')](_['isNil'](_0x16a341['TrunkBackup'])?_0x16a341[_0x36fe('0x100')][_0x36fe('0x10e')]:_0x16a341[_0x36fe('0x10c')]['callerid'],_0x16a341[_0x36fe('0x10f')],_0x16a341['dialRandomLastDigitCallerIdNumber']>0x0?ut['getCallerIdRandom'](_0x16a341[_0x36fe('0x112')],_0x16a341['dialRandomLastDigitCallerIdNumber']):_0x16a341['dialOriginateCallerIdNumber']);if(_0x3a7e1d){_0xcc8d8f['originatecalleridname']=ut[_0x36fe('0x113')](_0x3a7e1d);_0xcc8d8f[_0x36fe('0x114')]=ut[_0x36fe('0x115')](_0x3a7e1d);}var _0x29131e=ut['addVariables'](_0x16a341,_0x2ab818,_0x2ce4de,_0x3a7e1d,_0x52664c,_0xcc8d8f);var _0x5a9280=utils[_0x36fe('0x116')](_0x2ab818[_0x36fe('0x117')]);Object[_0x36fe('0x118')](_0x29131e,_0x5a9280);_['merge'](_0xcc8d8f,ut[_0x36fe('0x119')](_0x29131e));_0xcc8d8f['starttime']=moment()['format'](_0x36fe('0x62'));_0x16a341[_0x36fe('0x11a')]=_0x29131e;var _0x49243d=ut['variablesAction'](_0xcc8d8f,_0x16a341,_0x29131e,_0xcc8d8f[_0x36fe('0xa6')],_0x1886f9);return ami[_0x36fe('0x4f')](_0x49243d)[_0x36fe('0x58')](function(_0x2252d2){_0x16a341['originated']+=0x1;logger[_0x36fe('0x25')](_0x36fe('0x11b'),_0x52664c,_0x36fe('0x8e'),_0x16a341['name'],_0x36fe('0x47'),_0x16a341['originated']);_0x3bd049(_0x2252d2);})[_0x36fe('0x51')](function(_0x1fc88c){ut['logAgent'](_0xcc8d8f,0xe,_0x36fe('0x11c'));rpcDb[_0x36fe('0xd0')](_0xcc8d8f,_0x36fe('0x11d'));_0x48bd7e(_0x1fc88c);});});};Preview[_0x36fe('0x37')][_0x36fe('0x1d')]=function(_0x50b52b){if(this[_0x36fe('0x43')][_0x50b52b['linkedid']]){this[_0x36fe('0x43')][_0x50b52b[_0x36fe('0x86')]]['channel']=_0x50b52b[_0x36fe('0x11e')];}};Preview['prototype'][_0x36fe('0x19')]=function(_0x10fc13){var _0x50ec43=this;var _0x3f5957=this[_0x36fe('0x43')][_0x10fc13[_0x36fe('0x11f')]];if(_0x3f5957){if(_0x3f5957[_0x36fe('0xe0')]&&this['agents'][_0x3f5957[_0x36fe('0xe0')]]){ut[_0x36fe('0x120')](_0x3f5957,this[_0x36fe('0x16')][_0x3f5957[_0x36fe('0xe0')]][_0x36fe('0x2a')],this[_0x36fe('0x16')][_0x3f5957[_0x36fe('0xe0')]]['id']);}var _0x5b57e5=_['clone'](_0x3f5957);_0x5b57e5['responsetime']=moment()[_0x36fe('0x28')](_0x36fe('0x62'));var _0x1aa8e7=_0x50ec43[_0x36fe('0x13')][_0x3f5957[_0x36fe('0x46')]];if(ut['isFailure'](_0x10fc13[_0x36fe('0x121')])){if(_0x3f5957['unlockAgent']){rpcDb[_0x36fe('0xf2')](_0x3f5957[_0x36fe('0x87')]);}if(_0x3f5957['activeContact']){rpcDb[_0x36fe('0xf3')](_0x3f5957[_0x36fe('0x87')]);}ami[_0x36fe('0x24')](_0x36fe('0x122'),ut[_0x36fe('0x90')](_0x3f5957,_0x36fe('0x123'),this[_0x36fe('0x13')][_0x3f5957[_0x36fe('0x46')]]));this[_0x36fe('0x124')](_0x5b57e5,_0x1aa8e7,_0x10fc13);}else{_0x3f5957[_0x36fe('0x61')]=moment()[_0x36fe('0x28')]('YYYY-MM-DD\x20HH:mm:ss');ut[_0x36fe('0xcf')](_0x5b57e5,0x4,_0x36fe('0x125'));rpcDb[_0x36fe('0xd0')](_0x5b57e5,_0x36fe('0x126'));}}};Preview[_0x36fe('0x37')][_0x36fe('0x127')]=function(_0x43666b){var _0x45a618=this[_0x36fe('0x43')][_0x43666b[_0x36fe('0x86')]];var _0x5cdd7b;if(_0x45a618){_0x5cdd7b=this[_0x36fe('0x13')][_0x45a618[_0x36fe('0x46')]];logger[_0x36fe('0x25')](_0x36fe('0x128'),_0x43666b['linkedid'],_0x36fe('0x8e'),_0x5cdd7b['name'],'pTalking:\x20',_0x5cdd7b[_0x36fe('0x2e')]);}if(this[_0x36fe('0x43')][_0x43666b['linkedid']]&&_0x43666b[_0x36fe('0x86')]!==_0x43666b['uniqueid']){if(_0x43666b[_0x36fe('0x129')]==='16'&&this[_0x36fe('0x43')][_0x43666b['linkedid']][_0x36fe('0x49')]){this['callProgressDetectingCustomer'](_0x43666b,_0x43666b['linkedid'],_0x43666b['cause']);}else if(this[_0x36fe('0x43')][_0x43666b[_0x36fe('0x86')]][_0x36fe('0x49')]){logger[_0x36fe('0x25')](_0x36fe('0x12a'),_0x43666b[_0x36fe('0x86')],_0x43666b[_0x36fe('0x129')],_0x36fe('0x8e'),_0x5cdd7b['name'],'pTalking:\x20',_0x5cdd7b['pTalking']);this[_0x36fe('0x76')](_0x43666b,_0x43666b[_0x36fe('0x86')],_0x43666b[_0x36fe('0x129')]);}}else if(_0x45a618&&_[_0x36fe('0x42')](_0x45a618[_0x36fe('0x12b')])&&_0x5cdd7b[_0x36fe('0x12c')]&&_0x43666b[_0x36fe('0x86')]===_0x43666b[_0x36fe('0x8d')]&&_['isNil'](_0x43666b[_0x36fe('0xd7')])&&_0x43666b[_0x36fe('0x129')]==='16'&&_0x43666b['channelstate']==='6'&&_[_0x36fe('0xcd')](_0x45a618[_0x36fe('0x12d')])){if(_0x45a618['unlockAgent']){rpcDb['unlockContact'](_0x45a618['idContact']);}if(_0x45a618[_0x36fe('0xa6')]){rpcDb[_0x36fe('0xf3')](_0x45a618[_0x36fe('0x87')]);}_0x43666b['reason']='22';this['callProgressDetectingAgent'](_0x45a618,_0x5cdd7b,_0x43666b);}else if(_0x45a618&&_0x45a618[_0x36fe('0x12d')]){if(_0x43666b[_0x36fe('0x129')]==='16'&&this[_0x36fe('0x43')][_0x43666b[_0x36fe('0x86')]]['dialAnswer']){logger['info'](_0x36fe('0x12e'),_0x43666b[_0x36fe('0x86')],_0x43666b['cause'],_0x36fe('0x8e'),_0x5cdd7b[_0x36fe('0x2a')],'pTalking:\x20',_0x5cdd7b[_0x36fe('0x2e')]);this[_0x36fe('0x76')](_0x43666b,_0x43666b['linkedid'],_0x43666b[_0x36fe('0x129')]);}else if(this['actions'][_0x43666b['linkedid']][_0x36fe('0x49')]){logger['info']('[syncHangup][talking][cause]',_0x43666b[_0x36fe('0x86')],_0x43666b[_0x36fe('0x129')],_0x36fe('0x8e'),_0x5cdd7b[_0x36fe('0x2a')],_0x36fe('0x48'),_0x5cdd7b[_0x36fe('0x2e')]);this[_0x36fe('0x76')](_0x43666b,_0x43666b[_0x36fe('0x86')],_0x43666b[_0x36fe('0x129')]);}}};Preview[_0x36fe('0x37')][_0x36fe('0x12f')]=function(_0x4eecd3){if(this[_0x36fe('0x43')][_0x4eecd3[_0x36fe('0xcb')]]&&_0x4eecd3[_0x36fe('0xcb')]!==_0x4eecd3[_0x36fe('0x130')]){this['callProgressDetectingCustomer'](_0x4eecd3,_0x4eecd3[_0x36fe('0xcb')],_0x4eecd3[_0x36fe('0xc4')]);}};Preview['prototype']['syncHangupRequest']=function(_0x3da2df){if(this[_0x36fe('0x43')][_0x3da2df[_0x36fe('0x86')]]&&_0x3da2df[_0x36fe('0x86')]!==_0x3da2df['uniqueid']&&!this[_0x36fe('0x43')][_0x3da2df['linkedid']][_0x36fe('0x49')]){if(_0x3da2df['cause']==='1'){this[_0x36fe('0x76')](_0x3da2df,_0x3da2df['linkedid'],_0x3da2df[_0x36fe('0x129')]);}}};Preview[_0x36fe('0x37')][_0x36fe('0x131')]=function(_0x97b2cf,_0x4d5002,_0x5e8eb8){if(this[_0x36fe('0x43')][_0x97b2cf]){if(_[_0x36fe('0x42')](this[_0x36fe('0x43')][_0x97b2cf][_0x36fe('0x11a')])){this[_0x36fe('0x43')][_0x97b2cf][_0x36fe('0x11a')]={};}this[_0x36fe('0x43')][_0x97b2cf][_0x36fe('0x11a')][_0x4d5002]=_0x5e8eb8;}};Preview[_0x36fe('0x37')]['syncVarSet']=function(_0x46de26){try{if(!_[_0x36fe('0x42')](_0x46de26)){if(ut['filterKey'](_['keys'](_0x46de26[_0x36fe('0x132')])[0x0])){this['addVariable'](_0x46de26[_0x36fe('0x8d')],_[_0x36fe('0x133')](_0x46de26['variable'])[0x0],_0x46de26[_0x36fe('0x134')]);}}}catch(_0x1f0524){logger[_0x36fe('0x135')](_0x36fe('0x136'),util['inspect'](_0x1f0524,{'showHidden':![],'depth':null}));}};Preview[_0x36fe('0x37')][_0x36fe('0x21')]=function(_0x5ba189){if(_0x5ba189){if(this[_0x36fe('0x43')][_0x5ba189['transfertargetlinkedid']]){this['actions'][_0x5ba189[_0x36fe('0x137')]]['transfer']=!![];}}};Preview[_0x36fe('0x37')]['syncBlindTransfer']=function(_0x7b4720){if(_0x7b4720){if(this[_0x36fe('0x43')][_0x7b4720[_0x36fe('0x138')]]){this[_0x36fe('0x43')][_0x7b4720['transfererlinkedid']][_0x36fe('0x12d')]=!![];}}};module['exports']=Preview; \ No newline at end of file +var _0x07e8=['message','CAMPAIGN_STATUS','INACTIVE','[CampaignPreview]\x20Campaign\x20Queue:\x20','\x20is\x20not\x20active','DEACTIVATED','\x20is\x20deactivated','syncCampaigns','hasOwnProperty','dialMethod','preview','booked','clearZombieChannels','outbound','dialActive','dialPreviewAutoRecallMe','recallMe','clearZombieChannel','isNil','[clearZombieChannels][talking]','Queue','originated:\x20','queue','dialAnswer','pick','UserId','ListId','Action','status','channel','catch','updateOriginated','decrementTalkink','[clearZombieChannel]','loggerError','[Dialer][checkChannel][pTalking][Preview]','[Dialer][checkChannel][Preview]','[action]','size','getContactRecallMe','length','getDiff','scheduledat','Agent','voicePause','run','then','logger2','[RecallMe]','disableContact','dialRecallInQueue','createBody','createCustomerHistory','logCustomer','RecallFailedTimeout','[HistoryRecallClose]','createCustomerFinal','[getContactRecallMe]','setMessage','NO_AGENTS_LOGGED','isActive','isTrunkReachable','Trunk','UNREACHABLE_TRUNK','ACTIVE','callProgressDetectingCustomer','outboundNoSuchCallsDay','countnosuchnumberretry','countglobal','totalGlobal','NoSuchNumber','nosuchnumber','[callProgressDetectingCustomer][logNoSuch]','verifyAdditionalPhones','additional','dialNoSuchNumberRetryFrequency','callAdditionalPhoneAfterMin','dialGlobalMaxRetry','cloneAction','dialNoSuchNumberMaxRetry','[callProgressDetectingCustomer][logNoSuchGlobal]','rescheduleContact','scheduledAt','activeContact','linkedid','incrementPreviewCounters','idContact','ANSWER','responsetime','answertime','[syncHangup][talking][increment]','uniqueid','\x20Queue','pTalking:\x20','custom:agentconnect','buildObj','connect','buildAcw','complete','outboundAnswerCallsDay','total','answered','[16]','Answer','[callProgressDetectingCustomer][logAnswer]','crateCustomerReportQueue','sumDuration','talktime','sumBillable','[syncHangup][talking][decrement]','BUSY','outboundBusyCallsDay','countbusyretry','Busy','custom:agentbusy','busy','[callProgressDetectingCustomer][logBusy]','[callProgressDetectingCustomer][logBusyGlobal]','dialBusyMaxRetry','dialBusyRetryFrequency','unlockAgent','NOANSWER','outboundNoAnswerCallsDay','countnoanswerretry','dialNoAnswerRetryFrequency','buildNoAnswerEventPayload','custom:agentnoanswer','[callProgressDetectingCustomer][logNoAnswer]','Global','[callProgressDetectingCustomer][logNoAnswerGlobal]','dialNoAnswerMaxRetry','swapAdditionalPhones','outboundCongestionCallsDay','countcongestionretry','Congestion','dialCongestionRetryFrequency','custom:agentcongestion','[callProgressDetectingCustomer][logCongestion]','[callProgressDetectingCustomer][logCongestionGlobal]','CANCEL','outboundRejectCallsDay','countagentrejectretry','dialAgentRejectRetryFrequency','custom:agentreject','[syncHangupRequest][logAgentReject]','AgentReject','[callProgressDetectingCustomer][logAgentReject]','dialAgentRejectMaxRetry','ABANDONED','outboundAbandonedCallsDay','countabandonedretry','Abandoned','[callProgressDetectingCustomer][logAbandoned]','dialAbandonedMaxRety','dialAbandonedRetryFrequency','outboundUnknownCallsDay','dialstatus','custom:amd','[callProgressDetectingCustomer][hangupInAMD]','cause-txt','[callProgressDetectingCustomer][machine]','[default]','[callProgressDetectingCustomer][logUnknown]','[callProgressDetectingCustomer][logUnknownGlobal]','[originated][decrement][callProgressDetectingCustomer]','destlinkedid','queueSummaryCountersUpdated','callProgressDetectingAgent','isUndefined','object','reason','logAgent','createAgentHistory','[callProgressDetectingAgent][logNoSuch]','NoAnswer','[callProgressDetectingAgent][logNoAnswer]','[callProgressDetectingAgent][logBusy]','[callProgressDetectingAgent][logCongestion]','AnswerAGI','[callProgressDetectingAgent][logAnswerAGI]','[verifyAdditionalPhone]\x20','[swapAdditionalPhone]\x20','resolve','checkInBlack','Contact','phone','VoiceQueueId','Contact\x20is\x20undefined','lookAgent','isEmpty','[Preview][execCall][success]','\x20IdHopper:\x20','custom:agentcalled','called','Calling','logger','[Preview][execCall][failure]','Call\x20failed','outboundBlacklistCallsDay','logBlacklist','createHistory','[Blacklist][error]','Contact\x20in\x20black\x20List','SIP/%s','reachable','unmonitored','execRun','unlock','unlockContact','active','getContactPreview','recallme','validateContact','checkIsBlackList','Call\x20unsuccessful','[Preview][validateContact][Empty\x20Contact]','[Preview][validateContact][Empty\x20Campaign]','Empty\x20Campaign','[Preview][validateContact][Trunk\x20not\x20working\x20correctly]','\x20Trunk\x20is\x20not\x20active','TrunkBackup','Trunk\x20not\x20working\x20correctly','\x20Not\x20Active','campaign\x20Name:\x20','SIP/%s/%s%s','dialPrefix','trim','dialCutDigit','substring','getCallerId','dialRandomLastDigitCallerIdNumber','getCallerIdRandom','dialOriginateCallerIdNumber','callerid','dialOriginateCallerIdName','extractCalleridName','originatecalleridnum','extractCalleridNumber','addVariables','setXMDContactVariables','assign','merge','toLowerVariables','YYYY-MM-DD\x20HH:mm:ss','variables','[originated][increment]','OriginateError','actionid','clone','isFailure','response','custom:agentringnoanswer','starttime','[callProgressDetectingAgent][logAnswer]','[syncHangup][talking]','cause','statedesc','dialQueueProject','channelstate','transfer','destuniqueid','filterKey','keys','variable','addVariable','value','error','[syncVarSet][Preview]','transfertargetlinkedid','transfererlinkedid','exports','util','lodash','uuid','ioredis','../../../config/logger','actionPreview','../ami','./rpcDb','./action','./util/util','../dialer/utils','redis','defaults','localhost','socket.io-emitter','prototype','enqueue','tail','finally','sequence','campaignsPreview','voiceQueues','trunks','actions','agents','clockClearZombieChannels','originateresponse','syncOriginateResponse','syncHangup','bind','hanguprequest','syncHangupRequest','dialend','syncDialEnd','newexten','syncNewExten','syncVarSet','attendedtransfer','syncAttendedTransfer','blindtransfer','syncBlindTransfer','loopCampaigns','emit','info','[DEBUG]\x20Emit\x20voice_queue_channel:remove\x20event','stringify','format','voice:queue:%s','name','voice_queue_presence:remove','sendMessageOneNotActive','originated','pTalking','available'];(function(_0x2ef714,_0x49e1c4){var _0x252ab0=function(_0x868e73){while(--_0x868e73){_0x2ef714['push'](_0x2ef714['shift']());}};_0x252ab0(++_0x49e1c4);}(_0x07e8,0x10f));var _0x807e=function(_0x4cb263,_0x23e54b){_0x4cb263=_0x4cb263-0x0;var _0x4bf53b=_0x07e8[_0x4cb263];return _0x4bf53b;};'use strict';var util=require(_0x807e('0x0'));var _=require(_0x807e('0x1'));var uuid=require(_0x807e('0x2'));var moment=require('moment');var Redis=require(_0x807e('0x3'));var config=require('../../../config/environment');var logger=require(_0x807e('0x4'))('preview');var loggerAction=require('../../../config/logger')(_0x807e('0x5'));var ami=require(_0x807e('0x6'));var rpcDb=require(_0x807e('0x7'));var cmHopperAdditionalPhone=require('../rpc/cmHopperAdditionalPhone');var Action=require(_0x807e('0x8'));var ut=require(_0x807e('0x9'));var utils=require(_0x807e('0xa'));config[_0x807e('0xb')]=_[_0x807e('0xc')](config['redis'],{'host':_0x807e('0xd'),'port':0x18eb});var io=require(_0x807e('0xe'))(new Redis(config[_0x807e('0xb')]));var Sequence=function(){};Sequence[_0x807e('0xf')][_0x807e('0x10')]=function(_0x45e953){this[_0x807e('0x11')]=this[_0x807e('0x11')]?this[_0x807e('0x11')][_0x807e('0x12')](_0x45e953):_0x45e953();};function Preview(_0x2ca6f0){this[_0x807e('0x13')]=new Sequence();this[_0x807e('0x14')]=_0x2ca6f0[_0x807e('0x15')];this['trunks']=_0x2ca6f0[_0x807e('0x16')];this[_0x807e('0x17')]={};this[_0x807e('0x18')]=_0x2ca6f0[_0x807e('0x18')];this[_0x807e('0x19')]=0x0;ami['on'](_0x807e('0x1a'),this[_0x807e('0x1b')]['bind'](this));ami['on']('hangup',this[_0x807e('0x1c')][_0x807e('0x1d')](this));ami['on'](_0x807e('0x1e'),this[_0x807e('0x1f')]['bind'](this));ami['on'](_0x807e('0x20'),this[_0x807e('0x21')][_0x807e('0x1d')](this));ami['on'](_0x807e('0x22'),this[_0x807e('0x23')][_0x807e('0x1d')](this));ami['on']('varset',this[_0x807e('0x24')]['bind'](this));ami['on'](_0x807e('0x25'),this[_0x807e('0x26')][_0x807e('0x1d')](this));ami['on'](_0x807e('0x27'),this[_0x807e('0x28')][_0x807e('0x1d')](this));this[_0x807e('0x29')](this[_0x807e('0x14')]);}function emit(_0x3da4d6,_0x47a2d0,_0x5ca377){io['to'](_0x3da4d6)[_0x807e('0x2a')](_0x47a2d0,_0x5ca377);}function emitVoiceQueueChannelRemove(_0x23db10){logger[_0x807e('0x2b')](_0x807e('0x2c'),JSON[_0x807e('0x2d')](_0x23db10));emit(util[_0x807e('0x2e')](_0x807e('0x2f'),_0x23db10[_0x807e('0x30')]),'voice_queue_channel:remove',_0x23db10);io[_0x807e('0x2a')](_0x807e('0x31'),_0x23db10);}function notSendMessagesQueue(_0x36ef02){if(_0x36ef02[_0x807e('0x32')]){if(_0x36ef02[_0x807e('0x33')]===0x0&&_0x36ef02[_0x807e('0x34')]===0x0){_0x36ef02['sendMessageOneNotActive']=![];_0x36ef02[_0x807e('0x35')]=0x0;_0x36ef02['paused']=0x0;_0x36ef02[_0x807e('0x36')]=utils[_0x807e('0x37')][_0x807e('0x38')];ut['logger'](_0x807e('0x39'),_0x36ef02[_0x807e('0x30')]+_0x807e('0x3a'));}else{_0x36ef02[_0x807e('0x36')]=utils[_0x807e('0x37')][_0x807e('0x3b')];ut['logger'](_0x807e('0x39'),_0x36ef02['name']+_0x807e('0x3c'));}}}Preview[_0x807e('0xf')][_0x807e('0x29')]=function(){var _0x546a04=this;setInterval(function(){_0x546a04[_0x807e('0x3d')]();},0x7cf);};Preview[_0x807e('0xf')]['syncCampaigns']=function(){var _0xf0138b=this[_0x807e('0x14')];this['clockClearZombieChannels']+=0x1;for(var _0x344eec in _0xf0138b){if(_0xf0138b[_0x807e('0x3e')](_0x344eec)&&(_0xf0138b[_0x344eec][_0x807e('0x3f')]===_0x807e('0x40')||_0xf0138b[_0x344eec][_0x807e('0x3f')]===_0x807e('0x41'))&&_0xf0138b[_0x344eec]['type']==='outbound'){if(this[_0x807e('0x19')]>0x7){this[_0x807e('0x19')]=0x0;this[_0x807e('0x42')]();}}if(_0xf0138b[_0x807e('0x3e')](_0x344eec)&&_0xf0138b[_0x344eec][_0x807e('0x3f')]==='preview'&&_0xf0138b[_0x344eec]['type']===_0x807e('0x43')){if(_0xf0138b[_0x344eec][_0x807e('0x44')]){this['setMessage'](_0xf0138b[_0x344eec]);if(_0xf0138b[_0x344eec][_0x807e('0x45')])this[_0x807e('0x46')](_0xf0138b[_0x344eec]);}else{notSendMessagesQueue(_0xf0138b[_0x344eec]);}}}};Preview[_0x807e('0xf')][_0x807e('0x47')]=function(_0x172036){var _0x1416df=this;this[_0x807e('0x13')][_0x807e('0x10')](function(){if(!_[_0x807e('0x48')](_0x1416df[_0x807e('0x17')][_0x172036])){loggerAction['info'](_0x807e('0x49'),_0x172036,_0x807e('0x4a'),_0x1416df[_0x807e('0x17')][_0x172036]['queue'],_0x807e('0x4b'),JSON[_0x807e('0x2d')](_0x1416df[_0x807e('0x14')][_0x1416df['actions'][_0x172036]['queue']][_0x807e('0x33')]),'pTalking:\x20',JSON['stringify'](_0x1416df[_0x807e('0x14')][_0x1416df[_0x807e('0x17')][_0x172036][_0x807e('0x4c')]][_0x807e('0x34')]),JSON[_0x807e('0x2d')](_0x1416df[_0x807e('0x17')][_0x172036][_0x807e('0x4d')]),JSON[_0x807e('0x2d')](_[_0x807e('0x4e')](_0x1416df['actions'][_0x172036],['contactId',_0x807e('0x4f'),'VoiceQueueId',_0x807e('0x50')])));return ami[_0x807e('0x51')]({'action':_0x807e('0x52'),'channel':_0x1416df['actions'][_0x172036][_0x807e('0x53')]})[_0x807e('0x54')](function(_0x39cecd){if(_0x39cecd[_0x807e('0x36')]==='No\x20such\x20channel'){setTimeout(function(){if(_0x1416df['actions'][_0x172036]){ut[_0x807e('0x55')](_0x1416df[_0x807e('0x14')][_0x1416df[_0x807e('0x17')][_0x172036][_0x807e('0x4c')]],'[clearZombieChannel]');if(_0x1416df['actions'][_0x172036][_0x807e('0x4d')]===!![]){ut[_0x807e('0x56')](_0x1416df[_0x807e('0x14')][_0x1416df[_0x807e('0x17')][_0x172036][_0x807e('0x4c')]],_0x807e('0x57'));ut[_0x807e('0x58')](_0x807e('0x59')+_0x172036,_0x1416df[_0x807e('0x17')][_0x172036][_0x807e('0x4c')]);}ut[_0x807e('0x58')](_0x807e('0x5a')+_0x172036,_0x1416df[_0x807e('0x17')][_0x172036]['queue']);delete _0x1416df[_0x807e('0x17')][_0x172036];}},0x2328);}});}});};Preview['prototype'][_0x807e('0x42')]=function(){var _0x33c3de=this;loggerAction['info'](_0x807e('0x5b'),_[_0x807e('0x5c')](this['actions']));for(var _0x4fb1ae in this['actions']){if(_0x33c3de['actions'][_0x807e('0x3e')](_0x4fb1ae)){_0x33c3de[_0x807e('0x47')](_0x4fb1ae);}}};Preview[_0x807e('0xf')][_0x807e('0x46')]=function(_0xe6c0d8){var _0x1c3a1b=this;rpcDb[_0x807e('0x5d')](_0xe6c0d8['id'],ut['agentReadyId'](this['agents']))['then'](function(_0x1d6bdd){if(!_[_0x807e('0x48')](_0x1d6bdd)){for(var _0xf59443=0x0;_0xf59443<_0x1d6bdd[_0x807e('0x5e')];_0xf59443+=0x1){if(ut[_0x807e('0x5f')](_0x1d6bdd[_0xf59443][_0x807e('0x60')])<_0xe6c0d8['dialRecallMeTimeout']*0x3c){if(_0x1d6bdd[_0xf59443][_0x807e('0x61')]&&!_0x1d6bdd[_0xf59443][_0x807e('0x61')][_0x807e('0x62')]){_0x1c3a1b[_0x807e('0x63')](_0x1d6bdd[_0xf59443]['id'])[_0x807e('0x64')](ut[_0x807e('0x65')](_0x807e('0x66')))[_0x807e('0x54')](ut[_0x807e('0x65')](_0x807e('0x66')));}else{rpcDb[_0x807e('0x67')](_0x1d6bdd[_0xf59443]['id']);}}else{var _0x5b41ac=new Action(_0x1d6bdd[_0xf59443],_0xe6c0d8);_0x5b41ac['starttime']=moment()[_0x807e('0x2e')]('YYYY-MM-DD\x20HH:mm:ss');_0xe6c0d8['outboundReCallsDay']+=0x1;ut['logCustomer'](_0x5b41ac,0x17,'RecallInQueue');if(_0xe6c0d8[_0x807e('0x68')]){rpcDb['rescheduleContactInQueue'](ut[_0x807e('0x69')](_0x1d6bdd[_0xf59443]));rpcDb[_0x807e('0x6a')](_0x5b41ac,'[HistoryDialRecallInQueue][historyCatch]');}else{ut[_0x807e('0x6b')](_0x5b41ac,0x16,_0x807e('0x6c'));rpcDb[_0x807e('0x6a')](_0x5b41ac,_0x807e('0x6d'));rpcDb[_0x807e('0x6e')](_0x5b41ac,_0x807e('0x6d'));}}}}})[_0x807e('0x54')](ut[_0x807e('0x65')](_0x807e('0x6f')));};Preview[_0x807e('0xf')][_0x807e('0x70')]=function(_0x454356){_0x454356['sendMessageOneNotActive']=!![];if(ut['IsNotLoggedIn'](_0x454356['loggedIn'])){_0x454356[_0x807e('0x36')]=utils[_0x807e('0x37')][_0x807e('0x71')];}else if(!ut[_0x807e('0x72')](_0x454356[_0x807e('0x44')])){_0x454356[_0x807e('0x36')]=utils[_0x807e('0x37')][_0x807e('0x38')];}else if(!this[_0x807e('0x73')](_0x454356[_0x807e('0x74')])){if(!this[_0x807e('0x73')](_0x454356['TrunkBackup'])){_0x454356[_0x807e('0x36')]=utils[_0x807e('0x37')][_0x807e('0x75')];}else{_0x454356['message']=utils[_0x807e('0x37')][_0x807e('0x76')];}}else{_0x454356[_0x807e('0x36')]=utils[_0x807e('0x37')]['ACTIVE'];}};Preview['prototype'][_0x807e('0x77')]=function(_0x5e0ba6,_0x2c0962,_0x565477){var _0x181057=this;var _0x2375bb=this[_0x807e('0x17')][_0x2c0962];var _0x40692b=this[_0x807e('0x14')][_0x2375bb[_0x807e('0x4c')]];var _0x32ecea;var _0x31670b=![];var _0x23cb8c=0x2;var _0x4f61de=0x3;if(_0x40692b){switch(_0x565477){case'1':_0x40692b[_0x807e('0x78')]+=0x1;_0x2375bb[_0x807e('0x79')]+=0x1;_0x2375bb[_0x807e('0x7a')]=ut[_0x807e('0x7b')](_0x2375bb);ut[_0x807e('0x6b')](_0x2375bb,0x0,_0x807e('0x7c'));ami[_0x807e('0x2a')]('custom:agentnosuchnumber',ut['buildObj'](_0x2375bb,_0x807e('0x7d')));rpcDb[_0x807e('0x6a')](_0x2375bb,_0x807e('0x7e'));_0x181057[_0x807e('0x7f')](_0x2375bb,'0',_0x40692b)[_0x807e('0x64')](function(_0x1ef593){_0x31670b=_0x1ef593[_0x807e('0x80')]==0x1;_0x23cb8c=_0x40692b[_0x807e('0x81')];_0x4f61de=_0x40692b[_0x807e('0x82')];if(!_0x31670b){if(ut[_0x807e('0x7b')](_0x2375bb)>=_0x40692b[_0x807e('0x83')]){_0x32ecea=ut[_0x807e('0x84')](_0x2375bb,0xf,'Global');rpcDb[_0x807e('0x6e')](_0x32ecea,'[callProgressDetectingCustomer][logNoSuchGlobal]');}else{if(_0x2375bb[_0x807e('0x79')]>=_0x40692b[_0x807e('0x85')]){rpcDb[_0x807e('0x6e')](_0x2375bb,_0x807e('0x86'));}else{rpcDb[_0x807e('0x87')](ut[_0x807e('0x88')](_0x2375bb,'countnosuchnumberretry',_0x40692b[_0x807e('0x81')]),_0x2375bb['unlockAgent'],_0x2375bb[_0x807e('0x89')]);}}delete this['actions'][_0x5e0ba6[_0x807e('0x8a')]];}else{_0x2375bb[_0x807e('0x79')]++;logger['info']('actioncountonusuch',_0x2375bb[_0x807e('0x79')]);logger[_0x807e('0x2b')]('id',_0x2375bb['idContact']);_0x181057[_0x807e('0x8b')]({'id':_0x2375bb[_0x807e('0x8c')],'field':{'countnosuchnumberretry':_0x2375bb[_0x807e('0x79')]}})[_0x807e('0x64')](function(){_0x181057['swapAdditionalPhones'](_0x2375bb,_0x23cb8c,_0x4f61de)[_0x807e('0x64')](function(){});});}});break;case _0x807e('0x8d'):var _0x588403=moment()[_0x807e('0x2e')]('YYYY-MM-DD\x20HH:mm:ss');_0x2375bb[_0x807e('0x8e')]=_0x588403;_0x2375bb[_0x807e('0x8f')]=_0x588403;_0x2375bb[_0x807e('0x4d')]=!![];_0x40692b[_0x807e('0x34')]+=0x1;logger[_0x807e('0x2b')](_0x807e('0x90'),_0x2375bb[_0x807e('0x91')],_0x807e('0x92'),_0x40692b['name'],_0x807e('0x93'),_0x40692b[_0x807e('0x34')]);ami[_0x807e('0x2a')](_0x807e('0x94'),ut[_0x807e('0x95')](_0x2375bb,_0x807e('0x96'),this[_0x807e('0x14')][_0x2375bb[_0x807e('0x4c')]]));if(_0x40692b['acw']){ami[_0x807e('0x2a')]('custom:agentConnectPreview',ut[_0x807e('0x97')](_0x2375bb));}break;case'16':ami['emit']('custom:agentcomplete',ut['buildObj'](_0x2375bb,_0x807e('0x98'),this[_0x807e('0x14')][_0x2375bb['queue']]));emitVoiceQueueChannelRemove(ut[_0x807e('0x95')](_0x2375bb,_0x807e('0x98')));_0x40692b[_0x807e('0x99')]+=0x1;_0x40692b[_0x807e('0x9a')]+=0x1;_0x40692b[_0x807e('0x9b')]+=0x1;ut[_0x807e('0x56')](_0x40692b,_0x807e('0x9c'));_0x2375bb['countglobal']=ut[_0x807e('0x7b')](_0x2375bb);ut['logCustomer'](_0x2375bb,0x4,_0x807e('0x9d'));rpcDb[_0x807e('0x6a')](_0x2375bb,_0x807e('0x9e'));rpcDb['createCustomerFinal'](_0x2375bb,'[callProgressDetectingCustomer][logAnswerGlobal]');rpcDb[_0x807e('0x9f')](_0x2375bb);_0x40692b[_0x807e('0xa0')]+=_0x2375bb[_0x807e('0xa1')];_0x40692b[_0x807e('0xa2')]+=_0x2375bb[_0x807e('0xa1')];logger[_0x807e('0x2b')](_0x807e('0xa3'),_0x2375bb[_0x807e('0x91')],_0x807e('0x92'),_0x40692b['name'],_0x807e('0x93'),_0x40692b[_0x807e('0x34')]);delete this[_0x807e('0x17')][_0x5e0ba6[_0x807e('0x8a')]];break;case _0x807e('0xa4'):_0x40692b[_0x807e('0xa5')]+=0x1;_0x2375bb[_0x807e('0xa6')]+=0x1;_0x2375bb[_0x807e('0x7a')]=ut[_0x807e('0x7b')](_0x2375bb);ut['logCustomer'](_0x2375bb,0x5,_0x807e('0xa7'));_0x23cb8c=_0x40692b['dialBusyRetryFrequency'];_0x4f61de=_0x40692b[_0x807e('0x82')];ami[_0x807e('0x2a')](_0x807e('0xa8'),ut[_0x807e('0x95')](_0x2375bb,_0x807e('0xa9')));rpcDb['createCustomerHistory'](_0x2375bb,_0x807e('0xaa'));_0x181057['verifyAdditionalPhones'](_0x2375bb,'5',_0x40692b)[_0x807e('0x64')](function(_0x3b1225){_0x31670b=_0x3b1225['additional']==0x1;if(!_0x31670b){if(ut[_0x807e('0x7b')](_0x2375bb)>=_0x40692b[_0x807e('0x83')]){_0x32ecea=ut[_0x807e('0x84')](_0x2375bb,0xf,'Global');rpcDb[_0x807e('0x6e')](_0x32ecea,_0x807e('0xab'));}else{if(_0x2375bb['countbusyretry']>=_0x40692b[_0x807e('0xac')]){rpcDb[_0x807e('0x6e')](_0x2375bb,_0x807e('0xaa'));}else{rpcDb[_0x807e('0x87')](ut['scheduledAt'](_0x2375bb,_0x807e('0xa6'),_0x40692b[_0x807e('0xad')]),_0x2375bb[_0x807e('0xae')],_0x2375bb[_0x807e('0x89')]);}}}else{_0x2375bb['countbusyretry']++;_0x181057[_0x807e('0x8b')]({'id':_0x2375bb[_0x807e('0x8c')],'field':{'countbusyretry':_0x2375bb[_0x807e('0xa6')]}})[_0x807e('0x64')](function(){_0x181057['swapAdditionalPhones'](_0x2375bb,_0x23cb8c,_0x4f61de)['then'](function(){});});}});break;case _0x807e('0xaf'):_0x40692b[_0x807e('0xb0')]+=0x1;_0x2375bb[_0x807e('0xb1')]+=0x1;_0x2375bb[_0x807e('0x7a')]=ut[_0x807e('0x7b')](_0x2375bb);ut[_0x807e('0x6b')](_0x2375bb,0x3,'NoAnswer');_0x23cb8c=_0x40692b[_0x807e('0xb2')];_0x4f61de=_0x40692b['callAdditionalPhoneAfterMin'];var _0x24a6f3=ut[_0x807e('0xb3')](_0x2375bb,_0x40692b);ami[_0x807e('0x2a')](_0x807e('0xb4'),_0x24a6f3);rpcDb[_0x807e('0x6a')](_0x2375bb,_0x807e('0xb5'));_0x181057[_0x807e('0x7f')](_0x2375bb,'3',_0x40692b)[_0x807e('0x64')](function(_0xb14341){_0x31670b=_0xb14341['additional']==0x1;if(!_0x31670b){if(ut[_0x807e('0x7b')](_0x2375bb)>=_0x40692b[_0x807e('0x83')]){_0x32ecea=ut['cloneAction'](_0x2375bb,0xf,_0x807e('0xb6'));rpcDb[_0x807e('0x6e')](_0x32ecea,_0x807e('0xb7'));}else{if(_0x2375bb[_0x807e('0xb1')]>=_0x40692b[_0x807e('0xb8')]){rpcDb[_0x807e('0x6e')](_0x2375bb,_0x807e('0xb5'));}else{rpcDb[_0x807e('0x87')](ut[_0x807e('0x88')](_0x2375bb,_0x807e('0xb1'),_0x40692b[_0x807e('0xb2')]),_0x2375bb[_0x807e('0xae')],_0x2375bb[_0x807e('0x89')]);}}}else{_0x2375bb[_0x807e('0xb1')]++;_0x181057[_0x807e('0x8b')]({'id':_0x2375bb[_0x807e('0x8c')],'field':{'countnoanswerretry':_0x2375bb[_0x807e('0xb1')]}})[_0x807e('0x64')](function(){_0x181057[_0x807e('0xb9')](_0x2375bb,_0x23cb8c,_0x4f61de)[_0x807e('0x64')](function(){});});}});break;case'CONGESTION':_0x40692b[_0x807e('0xba')]+=0x1;_0x2375bb[_0x807e('0xbb')]+=0x1;_0x2375bb[_0x807e('0x7a')]=ut[_0x807e('0x7b')](_0x2375bb);ut[_0x807e('0x6b')](_0x2375bb,0x8,_0x807e('0xbc'));_0x23cb8c=_0x40692b[_0x807e('0xbd')];_0x4f61de=_0x40692b['callAdditionalPhoneAfterMin'];ami[_0x807e('0x2a')](_0x807e('0xbe'),ut[_0x807e('0x95')](_0x2375bb,'congestion'));rpcDb[_0x807e('0x6a')](_0x2375bb,_0x807e('0xbf'));_0x181057[_0x807e('0x7f')](_0x2375bb,'8',_0x40692b)[_0x807e('0x64')](function(_0x69a8e5){_0x31670b=_0x69a8e5[_0x807e('0x80')]==0x1;if(!_0x31670b){if(ut[_0x807e('0x7b')](_0x2375bb)>=_0x40692b['dialGlobalMaxRetry']){_0x32ecea=ut[_0x807e('0x84')](_0x2375bb,0xf,'Global');rpcDb[_0x807e('0x6e')](_0x32ecea,_0x807e('0xc0'));}else{if(_0x2375bb[_0x807e('0xbb')]>=_0x40692b['dialCongestionMaxRetry']){rpcDb['createCustomerFinal'](_0x2375bb,'[callProgressDetectingCustomer][logCongestion]');}else{rpcDb[_0x807e('0x87')](ut[_0x807e('0x88')](_0x2375bb,_0x807e('0xbb'),_0x40692b[_0x807e('0xad')]),_0x2375bb['unlockAgent'],_0x2375bb[_0x807e('0x89')]);}}}else{_0x2375bb[_0x807e('0xbb')]++;_0x181057['incrementPreviewCounters']({'id':_0x2375bb['idContact'],'field':{'countcongestionretry':_0x2375bb['countcongestionretry']}})[_0x807e('0x64')](function(){_0x181057[_0x807e('0xb9')](_0x2375bb,_0x23cb8c,_0x4f61de)[_0x807e('0x64')](function(){});});}});break;case _0x807e('0xc1'):_0x40692b[_0x807e('0xc2')]+=0x1;_0x2375bb[_0x807e('0xc3')]+=0x1;_0x2375bb[_0x807e('0x7a')]=ut[_0x807e('0x7b')](_0x2375bb);ut[_0x807e('0x6b')](_0x2375bb,0x14,'AgentReject');_0x23cb8c=_0x40692b[_0x807e('0xc4')];_0x4f61de=_0x40692b['callAdditionalPhoneAfterMin'];ami[_0x807e('0x2a')](_0x807e('0xc5'),ut[_0x807e('0x95')](_0x2375bb,'agentreject'));rpcDb[_0x807e('0x6a')](_0x2375bb,_0x807e('0xc6'));_0x181057['verifyAdditionalPhones'](_0x2375bb,'20',_0x40692b)[_0x807e('0x64')](function(_0x14afa8){_0x31670b=_0x14afa8[_0x807e('0x80')]==0x1;if(!_0x31670b){if(ut['totalGlobal'](_0x2375bb)>=_0x40692b['dialGlobalMaxRetry']){_0x32ecea=ut[_0x807e('0x84')](_0x2375bb,0x14,_0x807e('0xc7'));rpcDb[_0x807e('0x6e')](_0x32ecea,_0x807e('0xc8'));}else{if(_0x2375bb[_0x807e('0xc3')]>=_0x40692b[_0x807e('0xc9')]){rpcDb[_0x807e('0x6e')](_0x2375bb,_0x807e('0xc8'));}else{rpcDb[_0x807e('0x87')](ut['scheduledAt'](_0x2375bb,_0x807e('0xc3'),_0x40692b[_0x807e('0xc4')]),_0x2375bb['unlockAgent'],_0x2375bb[_0x807e('0x89')]);}}}else{_0x2375bb[_0x807e('0xb1')]++;_0x181057['incrementPreviewCounters']({'id':_0x2375bb[_0x807e('0x8c')],'field':{'countnoanswerretry':_0x2375bb[_0x807e('0xb1')]}})[_0x807e('0x64')](function(){_0x181057[_0x807e('0xb9')](_0x2375bb,_0x23cb8c,_0x4f61de)['then'](function(){});});}});break;case _0x807e('0xca'):_0x40692b[_0x807e('0xcb')]+=0x1;_0x2375bb[_0x807e('0xcc')]+=0x1;_0x2375bb[_0x807e('0x7a')]=ut['totalGlobal'](_0x2375bb);ut[_0x807e('0x6b')](_0x2375bb,0xb,_0x807e('0xcd'));rpcDb[_0x807e('0x6a')](_0x2375bb,_0x807e('0xce'));_0x181057[_0x807e('0x7f')](_0x2375bb,'11',_0x40692b)[_0x807e('0x64')](function(_0xd1a1e3){_0x31670b=_0xd1a1e3[_0x807e('0x80')]==0x1;if(!_0x31670b){if(ut[_0x807e('0x7b')](_0x2375bb)>=_0x40692b['dialGlobalMaxRetry']){_0x32ecea=ut[_0x807e('0x84')](_0x2375bb,0xf,_0x807e('0xb6'));rpcDb[_0x807e('0x6e')](_0x32ecea,'[callProgressDetectingCustomer][logAbandoned]');}else{if(_0x2375bb['countabandonedetry']>=_0x40692b[_0x807e('0xcf')]){rpcDb[_0x807e('0x6e')](_0x2375bb,_0x807e('0xce'));}else{rpcDb[_0x807e('0x87')](ut['scheduledAt'](_0x2375bb,_0x807e('0xcc'),_0x40692b[_0x807e('0xd0')]),_0x2375bb[_0x807e('0xae')],_0x2375bb[_0x807e('0x89')]);}}}else{_0x2375bb[_0x807e('0xb1')]++;_0x181057['incrementPreviewCounters']({'id':_0x2375bb['idContact'],'field':{'countnoanswerretry':_0x2375bb[_0x807e('0xb1')]}})['then'](function(){_0x181057['swapAdditionalPhones'](_0x2375bb,_0x23cb8c,_0x4f61de)[_0x807e('0x64')](function(){});});}});break;case'18':_0x40692b[_0x807e('0xd1')]+=0x1;_0x2375bb['countmachineretry']+=0x1;_0x2375bb['countglobal']=ut[_0x807e('0x7b')](_0x2375bb);ut[_0x807e('0x6b')](_0x2375bb,0x12,_0x5e0ba6['cause-txt']||_0x5e0ba6[_0x807e('0xd2')]);ami[_0x807e('0x2a')](_0x807e('0xd3'),ut[_0x807e('0x95')](_0x2375bb,'amd'));rpcDb[_0x807e('0x6a')](_0x2375bb,'[callProgressDetectingCustomer][hangupInAMD]');_0x181057[_0x807e('0x7f')](_0x2375bb,'18',_0x40692b)[_0x807e('0x64')](function(_0x2fffd2){_0x31670b=_0x2fffd2['additional']==0x1;if(!_0x31670b){if(ut['totalGlobal'](_0x2375bb)>=_0x40692b[_0x807e('0x83')]){_0x32ecea=ut['cloneAction'](_0x2375bb,0x12,_0x807e('0xb6'));rpcDb[_0x807e('0x6e')](_0x32ecea,_0x807e('0xd4'));}else{rpcDb[_0x807e('0x6e')](_0x2375bb,'[callProgressDetectingCustomer][hangupInAMD]');}}else{_0x2375bb[_0x807e('0xb1')]++;_0x181057['incrementPreviewCounters']({'id':_0x2375bb[_0x807e('0x8c')],'field':{'countnoanswerretry':_0x2375bb[_0x807e('0xb1')]}})[_0x807e('0x64')](function(){_0x181057[_0x807e('0xb9')](_0x2375bb,_0x23cb8c,_0x4f61de)[_0x807e('0x64')](function(){});});}});delete this[_0x807e('0x17')][_0x5e0ba6[_0x807e('0x8a')]];break;case'19':_0x40692b['outboundUnknownCallsDay']+=0x1;_0x2375bb[_0x807e('0x7a')]=ut['totalGlobal'](_0x2375bb);ut[_0x807e('0x6b')](_0x2375bb,0x13,_0x5e0ba6[_0x807e('0xd5')]||_0x5e0ba6[_0x807e('0xd2')]);ami['emit'](_0x807e('0xd3'),ut[_0x807e('0x95')](_0x2375bb,'amd'));rpcDb[_0x807e('0x6a')](_0x2375bb,_0x807e('0xd6'));_0x181057[_0x807e('0x7f')](_0x2375bb,'18',_0x40692b)[_0x807e('0x64')](function(_0xbcc14a){_0x31670b=_0xbcc14a['additional']==0x1;if(!_0x31670b){if(ut[_0x807e('0x7b')](_0x2375bb)>=_0x40692b[_0x807e('0x83')]){_0x32ecea=ut[_0x807e('0x84')](_0x2375bb,0xf,_0x807e('0xb6'));rpcDb[_0x807e('0x6e')](_0x32ecea,_0x807e('0xd6'));}else{rpcDb[_0x807e('0x6e')](_0x2375bb,_0x807e('0xd6'));}}else{_0x2375bb[_0x807e('0xb1')]++;_0x181057[_0x807e('0x8b')]({'id':_0x2375bb[_0x807e('0x8c')],'field':{'countnoanswerretry':_0x2375bb[_0x807e('0xb1')]}})[_0x807e('0x64')](function(){_0x181057[_0x807e('0xb9')](_0x2375bb,_0x23cb8c,_0x4f61de)['then'](function(){});});}});delete this[_0x807e('0x17')][_0x5e0ba6[_0x807e('0x8a')]];break;default:if(_0x2375bb[_0x807e('0x4d')]){ut[_0x807e('0x56')](_0x40692b,_0x807e('0xd7'));ut['loggerError']('[Dialer][decrementTalkink][no\x20Hangup][Preview]'+_0x40692b[_0x807e('0x30')],_0x5e0ba6);}_0x40692b['outboundUnknownCallsDay']+=0x1;_0x2375bb[_0x807e('0x7a')]=ut[_0x807e('0x7b')](_0x2375bb);ut[_0x807e('0x6b')](_0x2375bb,0xc,_0x5e0ba6[_0x807e('0xd5')]||_0x5e0ba6[_0x807e('0xd2')]);_0x23cb8c=_0x40692b[_0x807e('0xc4')];_0x4f61de=_0x40692b[_0x807e('0x82')];rpcDb[_0x807e('0x6a')](_0x2375bb,_0x807e('0xd8'));_0x181057[_0x807e('0x7f')](_0x2375bb,'20',_0x40692b)['then'](function(_0x36e924){_0x31670b=_0x36e924[_0x807e('0x80')]==0x1;if(!_0x31670b){if(ut[_0x807e('0x7b')](_0x2375bb)>=_0x40692b['dialGlobalMaxRetry']){_0x32ecea=ut[_0x807e('0x84')](_0x2375bb,0xf,'Global');rpcDb[_0x807e('0x6e')](_0x32ecea,_0x807e('0xd9'));}else{rpcDb[_0x807e('0x6e')](_0x2375bb,'[callProgressDetectingCustomer][logUnknownGlobal]');}delete this[_0x807e('0x17')][_0x5e0ba6[_0x807e('0x8a')]];}else{_0x181057[_0x807e('0xb9')](_0x2375bb,_0x23cb8c,_0x4f61de)['then'](function(){});}});}if(!(_0x2375bb[_0x807e('0x4d')]&&_0x565477==='16')){ut[_0x807e('0x55')](_0x40692b,'[callProgressDetectingCustomer]');logger[_0x807e('0x2b')](_0x807e('0xda'),_0x2375bb[_0x807e('0x91')],_0x807e('0x92'),_0x40692b[_0x807e('0x30')],_0x807e('0x4b'),_0x40692b[_0x807e('0x33')]);}if(_0x565477!=='ANSWER'){delete this[_0x807e('0x17')][_0x5e0ba6[_0x807e('0x8a')]];delete this[_0x807e('0x17')][_0x5e0ba6[_0x807e('0xdb')]];}_0x40692b[_0x807e('0xdc')]=!![];}};Preview[_0x807e('0xf')][_0x807e('0xdd')]=function(_0x1de836,_0x4220ea,_0x54438f){if(_[_0x807e('0xde')](_0x4220ea)&&_0x807e('0xdf')!==typeof _0x4220ea){return;}if(_[_0x807e('0xde')](_0x54438f)&&'object'!==typeof _0x54438f){return;}switch(_0x54438f[_0x807e('0xe0')]){case'0':ut[_0x807e('0xe1')](_0x1de836,0x0,_0x807e('0x7c'));rpcDb[_0x807e('0xe2')](_0x1de836,_0x807e('0xe3'));break;case'3':ut[_0x807e('0xe1')](_0x1de836,0x3,_0x807e('0xe4'));rpcDb[_0x807e('0xe2')](_0x1de836,_0x807e('0xe5'));break;case'5':ut[_0x807e('0xe1')](_0x1de836,0x5,_0x807e('0xa7'));rpcDb[_0x807e('0xe2')](_0x1de836,_0x807e('0xe6'));break;case'8':ut[_0x807e('0xe1')](_0x1de836,0x8,'Congestion');rpcDb[_0x807e('0xe2')](_0x1de836,_0x807e('0xe7'));break;case'22':ut[_0x807e('0xe1')](_0x1de836,0x16,_0x807e('0xe8'));rpcDb[_0x807e('0xe2')](_0x1de836,_0x807e('0xe9'));break;default:ut[_0x807e('0xe1')](_0x1de836,0xc,_0x54438f['reason']);rpcDb[_0x807e('0xe2')](_0x1de836,'[callProgressDetectingAgent][logCongestion]');}ut[_0x807e('0x55')](_0x4220ea,'[callProgressDetectingAgent]');logger['info']('[originated][decrement][callProgressDetectingAgent]',_0x1de836[_0x807e('0x91')],_0x807e('0x92'),_0x4220ea[_0x807e('0x30')],_0x807e('0x4b'),_0x4220ea[_0x807e('0x33')]);delete this[_0x807e('0x17')][_0x1de836[_0x807e('0x91')]];};Preview['prototype'][_0x807e('0x7f')]=function(_0x1c297a,_0x15386a,_0x2872e6){return cmHopperAdditionalPhone[_0x807e('0x7f')](_0x1c297a,_0x15386a,_0x2872e6)[_0x807e('0x54')](logger[_0x807e('0x2b')](_0x807e('0xea')));};Preview[_0x807e('0xf')][_0x807e('0xb9')]=function(_0x1cfe6e,_0x48407c,_0xb825ee){return cmHopperAdditionalPhone['swapAdditionalPhones'](_0x1cfe6e,_0x48407c,_0xb825ee)[_0x807e('0x54')](logger[_0x807e('0x2b')](_0x807e('0xeb')));};Preview[_0x807e('0xf')]['incrementPreviewCounters']=function(_0x3d76be){return Promise[_0x807e('0xec')]()[_0x807e('0x64')](cmHopperAdditionalPhone[_0x807e('0x8b')](_0x3d76be))[_0x807e('0x54')](logger[_0x807e('0x2b')]('[incrementPreviewCounters]\x20'));};Preview[_0x807e('0xf')][_0x807e('0xed')]=function(_0x1001bb,_0x540543,_0x41ced6,_0x1cb80c,_0x27190e){var _0x5d1537=this;return new Promise(function(_0x5bb281,_0x20effe){if(_[_0x807e('0x48')](_0x540543)||_[_0x807e('0x48')](_0x540543[_0x807e('0xee')])||_[_0x807e('0x48')](_0x540543[_0x807e('0xef')])||_[_0x807e('0x48')](_0x540543[_0x807e('0xf0')])){_0x20effe(ut[_0x807e('0x36')](_0x807e('0xf1'),_0x1cb80c,_0x27190e));return;}var _0x1e9a6e=uuid['v4']();var _0x46d8a3=_0x5d1537[_0x807e('0x14')][_0x540543['Queue']['name']];var _0x299e86=_0x41ced6?_0x5d1537[_0x807e('0x18')][_0x41ced6]['id']:undefined;_0x5d1537[_0x807e('0x17')][_0x1e9a6e]=new Action(_0x540543,_0x46d8a3,_0x1e9a6e,_0x41ced6,_0x299e86);var _0x5759e4=_0x5d1537['actions'][_0x1e9a6e];_0x5759e4[_0x807e('0xae')]=_0x1cb80c;_0x5759e4[_0x807e('0x89')]=_0x27190e;_0x5759e4[_0x807e('0xf2')]=_0x41ced6;if(_[_0x807e('0xf3')](_0x1001bb)){_0x5d1537['execCall'](_0x5759e4,_0x46d8a3,_0x540543,_0x41ced6)[_0x807e('0x64')](function(_0x3d2329){logger[_0x807e('0x2b')](_0x807e('0xf4'),'Queue:\x20'+_0x5759e4[_0x807e('0x4c')]+_0x807e('0xf5')+_0x5759e4[_0x807e('0x8c')],JSON[_0x807e('0x2d')](_0x3d2329));ami[_0x807e('0x2a')](_0x807e('0xf6'),ut[_0x807e('0x95')](_0x5759e4,_0x807e('0xf7'),_0x5d1537[_0x807e('0x14')][_0x5759e4['queue']]));_0x5bb281(ut[_0x807e('0x36')](_0x807e('0xf8')));})[_0x807e('0x54')](function(_0x5a8adf){ut[_0x807e('0xf9')](_0x807e('0xfa'),_0x5a8adf);_0x20effe(ut['message'](_0x807e('0xfb'),_0x1cb80c,_0x27190e));});}else{_0x46d8a3[_0x807e('0xfc')]+=0x1;ut[_0x807e('0xfd')](_0x5759e4);rpcDb[_0x807e('0xfe')](_0x5759e4,_0x807e('0xff'));delete _0x5d1537[_0x807e('0x17')][_0x1e9a6e];_0x20effe(ut[_0x807e('0x36')](_0x807e('0x100'),_0x1cb80c,_0x27190e));}});};Preview[_0x807e('0xf')][_0x807e('0x73')]=function(_0x116335){return!_[_0x807e('0x48')](_0x116335)&&!_[_0x807e('0x48')](_0x116335[_0x807e('0x30')])&&!_[_0x807e('0x48')](_0x116335['active'])&&_0x116335['active']&&!_[_0x807e('0x48')](this['trunks'][util[_0x807e('0x2e')](_0x807e('0x101'),_0x116335['name'])])&&!_[_0x807e('0x48')](this[_0x807e('0x16')][util['format']('SIP/%s',_0x116335[_0x807e('0x30')])][_0x807e('0x52')])&&(this['trunks'][util[_0x807e('0x2e')](_0x807e('0x101'),_0x116335['name'])][_0x807e('0x52')]===_0x807e('0x102')||this[_0x807e('0x16')][util[_0x807e('0x2e')](_0x807e('0x101'),_0x116335[_0x807e('0x30')])][_0x807e('0x52')]===_0x807e('0x103'));};Preview[_0x807e('0xf')]['run']=function(_0x1e991a,_0x9673d6){return this[_0x807e('0x104')](_0x1e991a,_0x9673d6)[_0x807e('0x64')](function(_0xceb606){return _[_0x807e('0x4e')](_0xceb606,[_0x807e('0x36')]);})['catch'](function(_0x3dabd3){if(_0x3dabd3[_0x807e('0x105')]){rpcDb[_0x807e('0x106')](_0x1e991a);}if(_0x3dabd3[_0x807e('0x107')]){rpcDb['disableContact'](_0x1e991a);}throw _[_0x807e('0x4e')](_0x3dabd3,[_0x807e('0x36')]);});};Preview[_0x807e('0xf')]['execRun']=function(_0x2e24ac,_0x331cf){var _0x2307ac=this;var _0x57952b,_0x7a3dd4;return rpcDb[_0x807e('0x108')](_0x2e24ac)[_0x807e('0x64')](function(_0x343c52){if(!_[_0x807e('0x48')](_0x343c52[0x0])){_0x7a3dd4=_0x343c52[0x0][_0x807e('0x109')]?![]:!![];_0x57952b=_0x343c52[0x0]['recallme']?!![]:![];_0x57952b=_0x331cf?!![]:_0x57952b;}var _0x2c6e08=_0x2307ac[_0x807e('0x10a')](_0x343c52);if(_0x2c6e08['isValid']){rpcDb[_0x807e('0x10b')](_[_0x807e('0x4e')](_0x343c52[0x0],[_0x807e('0xf0'),_0x807e('0xef')]))[_0x807e('0x64')](function(_0x4bb018){_0x2307ac['checkInBlack'](_0x4bb018,_0x343c52[0x0],_0x331cf,_0x7a3dd4,_0x57952b)[_0x807e('0x64')](function(_0x1ce29e){return _0x1ce29e;})[_0x807e('0x54')](function(_0x14e641){throw _0x14e641;});})[_0x807e('0x54')](function(_0x1ed61e){ut[_0x807e('0xf9')]('[Preview][checkIsBlackList]',_0x1ed61e);throw ut['message'](_0x807e('0x10c'),_0x7a3dd4,_0x57952b);});}else{throw ut['message'](_0x2c6e08[_0x807e('0x36')],_0x7a3dd4,_0x57952b);}})[_0x807e('0x54')](function(_0x4f0e98){ut[_0x807e('0xf9')]('[Preview][getContactPreview]',_0x4f0e98);throw ut[_0x807e('0x36')](_0x807e('0x10c'),![],!![]);});};Preview[_0x807e('0xf')]['validateContact']=function(_0x5d1d40){if(_[_0x807e('0x48')](_0x5d1d40)||_[_0x807e('0xf3')](_0x5d1d40)||!_[_0x807e('0x48')](_0x5d1d40[0x0][_0x807e('0x61')])&&_['isNil'](_0x5d1d40[0x0]['Agent'][_0x807e('0x30')])){ut['logger'](_0x807e('0x10d'),_0x5d1d40);return{'isValid':![],'message':'Empty\x20Contact'};}var _0x5a0e38=this[_0x807e('0x14')][_0x5d1d40[0x0][_0x807e('0x4a')]['name']];_0x5a0e38[_0x807e('0x36')]=utils[_0x807e('0x37')][_0x807e('0x76')];if(_[_0x807e('0x48')](_0x5a0e38)){ut[_0x807e('0xf9')](_0x807e('0x10e'),_0x5a0e38);return{'isValid':![],'message':_0x807e('0x10f')};}if(!this[_0x807e('0x73')](_0x5a0e38[_0x807e('0x74')])){ut[_0x807e('0xf9')](_0x807e('0x110'),'campaign\x20Name:\x20'+_0x5a0e38[_0x807e('0x30')]+_0x807e('0x111'));if(!this[_0x807e('0x73')](_0x5a0e38[_0x807e('0x112')])){ut[_0x807e('0xf9')](_0x807e('0x110'),_0x5a0e38[_0x807e('0x30')]+'\x20Trunk\x20Backup\x20is\x20not\x20active');return{'isValid':![],'message':_0x807e('0x113')};}}if(!ut[_0x807e('0x72')](_0x5a0e38[_0x807e('0x44')])){ut['logger']('[Preview][validateContact][Campaign\x20Active]',_0x5a0e38[_0x807e('0x30')]+_0x807e('0x114'));return{'isValid':![],'message':_0x807e('0x115')+_0x5a0e38[_0x807e('0x30')]+_0x807e('0x114')};}return{'isValid':!![],'message':'Is\x20Valid'};};Preview[_0x807e('0xf')]['execCall']=function(_0x335e50,_0x2ea75c,_0x3a5c0c,_0x15b9f8){var _0x5e2f89=this;return new Promise(function(_0x5cfcc8,_0x33f933){var _0x4a59aa=_0x335e50[_0x807e('0x91')];var _0x161224=_0x5e2f89[_0x807e('0x73')](_0x2ea75c[_0x807e('0x74')])?util[_0x807e('0x2e')](_0x807e('0x116'),_0x2ea75c[_0x807e('0x74')][_0x807e('0x30')],_[_0x807e('0x48')](_0x2ea75c[_0x807e('0x117')])?'':_0x2ea75c[_0x807e('0x117')][_0x807e('0x118')]()||'',_0x2ea75c[_0x807e('0x119')]>0x0?_0x3a5c0c['phone'][_0x807e('0x11a')](_0x2ea75c['dialCutDigit']):_0x3a5c0c[_0x807e('0xef')]):util[_0x807e('0x2e')](_0x807e('0x116'),_[_0x807e('0x48')](_0x2ea75c[_0x807e('0x112')])?_0x2ea75c[_0x807e('0x74')][_0x807e('0x30')]:_0x2ea75c[_0x807e('0x112')][_0x807e('0x30')],_[_0x807e('0x48')](_0x2ea75c['dialPrefix'])?'':_0x2ea75c['dialPrefix']['trim']()||'',_0x2ea75c[_0x807e('0x119')]>0x0?_0x3a5c0c[_0x807e('0xef')][_0x807e('0x11a')](_0x2ea75c['dialCutDigit']):_0x3a5c0c[_0x807e('0xef')]);var _0x231986=_0x5e2f89[_0x807e('0x73')](_0x2ea75c[_0x807e('0x74')])?ut[_0x807e('0x11b')](_0x2ea75c['Trunk']['callerid'],_0x2ea75c['dialOriginateCallerIdName'],_0x2ea75c[_0x807e('0x11c')]>0x0?ut[_0x807e('0x11d')](_0x2ea75c[_0x807e('0x11e')],_0x2ea75c['dialRandomLastDigitCallerIdNumber']):_0x2ea75c[_0x807e('0x11e')]):ut[_0x807e('0x11b')](_[_0x807e('0x48')](_0x2ea75c[_0x807e('0x112')])?_0x2ea75c[_0x807e('0x74')][_0x807e('0x11f')]:_0x2ea75c[_0x807e('0x112')][_0x807e('0x11f')],_0x2ea75c[_0x807e('0x120')],_0x2ea75c[_0x807e('0x11c')]>0x0?ut[_0x807e('0x11d')](_0x2ea75c[_0x807e('0x11e')],_0x2ea75c[_0x807e('0x11c')]):_0x2ea75c[_0x807e('0x11e')]);if(_0x231986){_0x335e50['originatecalleridname']=ut[_0x807e('0x121')](_0x231986);_0x335e50[_0x807e('0x122')]=ut[_0x807e('0x123')](_0x231986);}var _0x327c98=ut[_0x807e('0x124')](_0x2ea75c,_0x3a5c0c,_0x161224,_0x231986,_0x4a59aa,_0x335e50);var _0x41cd1a=utils[_0x807e('0x125')](_0x3a5c0c['Contact']);Object[_0x807e('0x126')](_0x327c98,_0x41cd1a);_[_0x807e('0x127')](_0x335e50,ut[_0x807e('0x128')](_0x327c98));_0x335e50['starttime']=moment()[_0x807e('0x2e')](_0x807e('0x129'));_0x2ea75c[_0x807e('0x12a')]=_0x327c98;var _0x32ed59=ut['variablesAction'](_0x335e50,_0x2ea75c,_0x327c98,_0x335e50[_0x807e('0x89')],_0x15b9f8);return ami['Action'](_0x32ed59)['then'](function(_0x23efa8){_0x2ea75c[_0x807e('0x33')]+=0x1;logger[_0x807e('0x2b')](_0x807e('0x12b'),_0x4a59aa,'\x20Queue',_0x2ea75c['name'],'originated:\x20',_0x2ea75c['originated']);_0x5cfcc8(_0x23efa8);})[_0x807e('0x54')](function(_0x11f087){ut[_0x807e('0xe1')](_0x335e50,0xe,_0x807e('0x12c'));rpcDb[_0x807e('0xe2')](_0x335e50,'[originateFailure][logOriginateFailure]');_0x33f933(_0x11f087);});});};Preview[_0x807e('0xf')][_0x807e('0x23')]=function(_0xffbbaf){if(this['actions'][_0xffbbaf[_0x807e('0x8a')]]){this[_0x807e('0x17')][_0xffbbaf['linkedid']]['channel']=_0xffbbaf['channel'];}};Preview['prototype']['syncOriginateResponse']=function(_0x3a4e83){var _0x518d58=this;var _0xe942f5=this[_0x807e('0x17')][_0x3a4e83[_0x807e('0x12d')]];if(_0xe942f5){if(_0xe942f5[_0x807e('0xf2')]&&this[_0x807e('0x18')][_0xe942f5[_0x807e('0xf2')]]){ut['logLookAgent'](_0xe942f5,this[_0x807e('0x18')][_0xe942f5[_0x807e('0xf2')]][_0x807e('0x30')],this[_0x807e('0x18')][_0xe942f5[_0x807e('0xf2')]]['id']);}var _0x26d785=_[_0x807e('0x12e')](_0xe942f5);_0x26d785['responsetime']=moment()[_0x807e('0x2e')](_0x807e('0x129'));var _0x4ea575=_0x518d58[_0x807e('0x14')][_0xe942f5[_0x807e('0x4c')]];if(ut[_0x807e('0x12f')](_0x3a4e83[_0x807e('0x130')])){if(_0xe942f5[_0x807e('0xae')]){rpcDb[_0x807e('0x106')](_0xe942f5[_0x807e('0x8c')]);}if(_0xe942f5[_0x807e('0x89')]){rpcDb[_0x807e('0x67')](_0xe942f5[_0x807e('0x8c')]);}ami['emit'](_0x807e('0x131'),ut[_0x807e('0x95')](_0xe942f5,'rejected',this['campaignsPreview'][_0xe942f5['queue']]));this[_0x807e('0xdd')](_0x26d785,_0x4ea575,_0x3a4e83);}else{_0xe942f5[_0x807e('0x132')]=moment()[_0x807e('0x2e')](_0x807e('0x129'));ut[_0x807e('0xe1')](_0x26d785,0x4,_0x807e('0x9d'));rpcDb['createAgentHistory'](_0x26d785,_0x807e('0x133'));}}};Preview[_0x807e('0xf')][_0x807e('0x1c')]=function(_0x31a100){var _0x171223=this[_0x807e('0x17')][_0x31a100[_0x807e('0x8a')]];var _0x37a156;if(_0x171223){_0x37a156=this[_0x807e('0x14')][_0x171223[_0x807e('0x4c')]];logger[_0x807e('0x2b')](_0x807e('0x134'),_0x31a100[_0x807e('0x8a')],_0x807e('0x92'),_0x37a156[_0x807e('0x30')],_0x807e('0x93'),_0x37a156[_0x807e('0x34')]);}if(this[_0x807e('0x17')][_0x31a100['linkedid']]&&_0x31a100['linkedid']!==_0x31a100[_0x807e('0x91')]){if(_0x31a100[_0x807e('0x135')]==='16'&&this[_0x807e('0x17')][_0x31a100[_0x807e('0x8a')]]['dialAnswer']){this[_0x807e('0x77')](_0x31a100,_0x31a100[_0x807e('0x8a')],_0x31a100['cause']);}else if(this[_0x807e('0x17')][_0x31a100[_0x807e('0x8a')]][_0x807e('0x4d')]){logger[_0x807e('0x2b')]('[syncHangup][talking][cause]',_0x31a100[_0x807e('0x8a')],_0x31a100['cause'],'\x20Queue',_0x37a156[_0x807e('0x30')],'pTalking:\x20',_0x37a156[_0x807e('0x34')]);this['callProgressDetectingCustomer'](_0x31a100,_0x31a100[_0x807e('0x8a')],_0x31a100[_0x807e('0x135')]);}}else if(_0x171223&&_['isNil'](_0x171223[_0x807e('0x136')])&&_0x37a156[_0x807e('0x137')]&&_0x31a100[_0x807e('0x8a')]===_0x31a100['uniqueid']&&_[_0x807e('0x48')](_0x31a100[_0x807e('0xe0')])&&_0x31a100['cause']==='16'&&_0x31a100[_0x807e('0x138')]==='6'&&_[_0x807e('0xde')](_0x171223[_0x807e('0x139')])){if(_0x171223[_0x807e('0xae')]){rpcDb[_0x807e('0x106')](_0x171223[_0x807e('0x8c')]);}if(_0x171223['activeContact']){rpcDb['disableContact'](_0x171223[_0x807e('0x8c')]);}_0x31a100[_0x807e('0xe0')]='22';this[_0x807e('0xdd')](_0x171223,_0x37a156,_0x31a100);}else if(_0x171223&&_0x171223[_0x807e('0x139')]){if(_0x31a100[_0x807e('0x135')]==='16'&&this[_0x807e('0x17')][_0x31a100[_0x807e('0x8a')]][_0x807e('0x4d')]){logger['info']('[syncHangup][talking][transfer]',_0x31a100['linkedid'],_0x31a100[_0x807e('0x135')],_0x807e('0x92'),_0x37a156[_0x807e('0x30')],'pTalking:\x20',_0x37a156[_0x807e('0x34')]);this[_0x807e('0x77')](_0x31a100,_0x31a100['linkedid'],_0x31a100[_0x807e('0x135')]);}else if(this[_0x807e('0x17')][_0x31a100[_0x807e('0x8a')]]['dialAnswer']){logger[_0x807e('0x2b')]('[syncHangup][talking][cause]',_0x31a100[_0x807e('0x8a')],_0x31a100[_0x807e('0x135')],_0x807e('0x92'),_0x37a156[_0x807e('0x30')],'pTalking:\x20',_0x37a156[_0x807e('0x34')]);this['callProgressDetectingCustomer'](_0x31a100,_0x31a100[_0x807e('0x8a')],_0x31a100[_0x807e('0x135')]);}}};Preview['prototype'][_0x807e('0x21')]=function(_0x2803bd){if(this['actions'][_0x2803bd[_0x807e('0xdb')]]&&_0x2803bd[_0x807e('0xdb')]!==_0x2803bd[_0x807e('0x13a')]){this['callProgressDetectingCustomer'](_0x2803bd,_0x2803bd['destlinkedid'],_0x2803bd[_0x807e('0xd2')]);}};Preview[_0x807e('0xf')][_0x807e('0x1f')]=function(_0x1cb07f){if(this[_0x807e('0x17')][_0x1cb07f[_0x807e('0x8a')]]&&_0x1cb07f[_0x807e('0x8a')]!==_0x1cb07f['uniqueid']&&!this['actions'][_0x1cb07f[_0x807e('0x8a')]][_0x807e('0x4d')]){if(_0x1cb07f[_0x807e('0x135')]==='1'){this['callProgressDetectingCustomer'](_0x1cb07f,_0x1cb07f['linkedid'],_0x1cb07f[_0x807e('0x135')]);}}};Preview[_0x807e('0xf')]['addVariable']=function(_0x3b0ea2,_0x95e5fa,_0x34d546){if(this[_0x807e('0x17')][_0x3b0ea2]){if(_[_0x807e('0x48')](this['actions'][_0x3b0ea2]['variables'])){this['actions'][_0x3b0ea2][_0x807e('0x12a')]={};}this[_0x807e('0x17')][_0x3b0ea2]['variables'][_0x95e5fa]=_0x34d546;}};Preview['prototype'][_0x807e('0x24')]=function(_0x3bdd57){try{if(!_[_0x807e('0x48')](_0x3bdd57)){if(ut[_0x807e('0x13b')](_[_0x807e('0x13c')](_0x3bdd57[_0x807e('0x13d')])[0x0])){this[_0x807e('0x13e')](_0x3bdd57[_0x807e('0x91')],_['keys'](_0x3bdd57['variable'])[0x0],_0x3bdd57[_0x807e('0x13f')]);}}}catch(_0x539206){logger[_0x807e('0x140')](_0x807e('0x141'),util['inspect'](_0x539206,{'showHidden':![],'depth':null}));}};Preview[_0x807e('0xf')][_0x807e('0x26')]=function(_0x9a1c9c){if(_0x9a1c9c){if(this[_0x807e('0x17')][_0x9a1c9c[_0x807e('0x142')]]){this[_0x807e('0x17')][_0x9a1c9c[_0x807e('0x142')]][_0x807e('0x139')]=!![];}}};Preview[_0x807e('0xf')][_0x807e('0x28')]=function(_0x122b8d){if(_0x122b8d){if(this[_0x807e('0x17')][_0x122b8d['transfererlinkedid']]){this[_0x807e('0x17')][_0x122b8d[_0x807e('0x143')]][_0x807e('0x139')]=!![];}}};module[_0x807e('0x144')]=Preview; \ No newline at end of file diff --git a/server/services/ami/preview/rpcDb.js b/server/services/ami/preview/rpcDb.js index e02c2bb..e9e8359 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 _0x8864=['holdtime','assigned','lastAssignedTo','queuecallerexitreason','COMPLETED','create','[voiceQueueReport]\x20','getContactRecallMe','[GetContactRecallMe]\x20','bluebird','../../../config/logger','preview','../rpc/cmHopper','../rpc/cmHopperHistory','../rpc/cmHopperBlack','../rpc/voiceQueueReport','error','createHistory','catch','[createHistory]\x20','resolve','then','moveContactManagedDialer','[moveContactManagedDialer]\x20','checkIsBlackList','[checkIsBlackList]\x20','getContactPreview','[getContactPreview]\x20','createAgentHistory','createCustomerFinal','rescheduleContact','UserId','[rescheduleContact]\x20','countReScheduled','[countReScheduled]\x20','unlockContact','[unlockContact]\x20','disableContact','[activeContact]\x20','crateCustomerReportQueue','uniqueid','calleridnum','calleridname','queue','queuecallerleaveAt','answertime','queuecallercomplete','queuecallercompleteAt','endtime','connectedlinename','membername','context','from-sip','xcally-motion-preview'];(function(_0x2a236c,_0x4ea8c9){var _0x1c0ebc=function(_0x23c484){while(--_0x23c484){_0x2a236c['push'](_0x2a236c['shift']());}};_0x1c0ebc(++_0x4ea8c9);}(_0x8864,0x14d));var _0x4886=function(_0x58eec7,_0x2353db){_0x58eec7=_0x58eec7-0x0;var _0x25c5d3=_0x8864[_0x58eec7];return _0x25c5d3;};'use strict';var util=require('util');var BPromise=require(_0x4886('0x0'));var logger=require(_0x4886('0x1'))(_0x4886('0x2'));var cmHopper=require(_0x4886('0x3'));var cmHopperHistory=require(_0x4886('0x4'));var cmHopperBlack=require(_0x4886('0x5'));var agentReportPreview=require('../rpc/agentReportPreview');var voiceQueueReport=require(_0x4886('0x6'));function loggerCatch(_0x1153e9){return function(_0x181078){logger[_0x4886('0x7')](_0x1153e9,util['inspect'](_0x181078,{'showHidden':![],'depth':null}));};}function create(_0x33ae58){return cmHopperHistory[_0x4886('0x8')](_0x33ae58)[_0x4886('0x9')](loggerCatch(_0x4886('0xa')));}function createAgent(_0x341568){return BPromise[_0x4886('0xb')]()[_0x4886('0xc')](agentReportPreview[_0x4886('0x8')](_0x341568))[_0x4886('0x9')](loggerCatch(_0x4886('0xa')));}function moveContact(_0xf22858){return cmHopper[_0x4886('0xd')](_0xf22858,!![])[_0x4886('0x9')](loggerCatch(_0x4886('0xe')));}exports[_0x4886('0xf')]=function(_0x38a38d){return cmHopperBlack[_0x4886('0xf')](_0x38a38d)['catch'](loggerCatch(_0x4886('0x10')));};exports[_0x4886('0x11')]=function(_0x350c82){return BPromise['resolve']()[_0x4886('0xc')](cmHopper[_0x4886('0x11')](_0x350c82))['catch'](loggerCatch(_0x4886('0x12')));};exports[_0x4886('0x8')]=function(_0x3d3549,_0x319259){create(_0x3d3549)[_0x4886('0x9')](loggerCatch(_0x319259));moveContact(_0x3d3549)[_0x4886('0x9')](loggerCatch(_0x319259));};exports[_0x4886('0x13')]=function(_0x5f47c2,_0x3cbe28){createAgent(_0x5f47c2)[_0x4886('0x9')](loggerCatch(_0x3cbe28));};exports['createCustomerHistory']=function(_0x128c0f,_0x2476b8){create(_0x128c0f)['catch'](loggerCatch(_0x2476b8));};exports[_0x4886('0x14')]=function(_0x2df9c5,_0x2a7e70){moveContact(_0x2df9c5)['catch'](loggerCatch(_0x2a7e70));};exports[_0x4886('0x15')]=function(_0x276702,_0x150336,_0x59c356){if(_0x150336){_0x276702[_0x4886('0x16')]=null;}if(_0x59c356){_0x276702['active']=![];}return cmHopper[_0x4886('0x15')](_0x276702)[_0x4886('0x9')](loggerCatch(_0x4886('0x17')));};exports[_0x4886('0x18')]=function(_0x4e30d0){return cmHopper[_0x4886('0x18')](_0x4e30d0)[_0x4886('0x9')](loggerCatch(_0x4886('0x19')));};exports[_0x4886('0x1a')]=function(_0x3b498c){return cmHopper[_0x4886('0x1a')]({'UserId':null},_0x3b498c,0x1)[_0x4886('0x9')](loggerCatch(_0x4886('0x1b')));};exports[_0x4886('0x1c')]=function(_0x10a949){return cmHopper[_0x4886('0x1a')]({'active':![]},_0x10a949,0x1)['catch'](loggerCatch(_0x4886('0x1d')));};exports[_0x4886('0x1e')]=function(_0x55602d){var _0x14cc0e={};_0x14cc0e['type']=_0x55602d['type'];_0x14cc0e[_0x4886('0x1f')]=_0x55602d[_0x4886('0x1f')];_0x14cc0e[_0x4886('0x20')]=_0x55602d[_0x4886('0x20')];_0x14cc0e[_0x4886('0x21')]=_0x55602d[_0x4886('0x21')];_0x14cc0e[_0x4886('0x22')]=_0x55602d['queue'];_0x14cc0e['queuecallerjoinAt']=_0x55602d['answertime'];_0x14cc0e[_0x4886('0x23')]=_0x55602d[_0x4886('0x24')];_0x14cc0e[_0x4886('0x25')]=0x1;_0x14cc0e[_0x4886('0x26')]=_0x55602d[_0x4886('0x27')];_0x14cc0e[_0x4886('0x28')]=_0x55602d[_0x4886('0x29')];_0x14cc0e[_0x4886('0x2a')]=_0x4886('0x2b');_0x14cc0e['exten']=_0x4886('0x2c');_0x14cc0e[_0x4886('0x2d')]=0x0;_0x14cc0e[_0x4886('0x2e')]=0x1;_0x14cc0e[_0x4886('0x2f')]=_0x55602d[_0x4886('0x29')];_0x14cc0e[_0x4886('0x30')]=_0x4886('0x31');return BPromise[_0x4886('0xb')]()['then'](voiceQueueReport[_0x4886('0x32')](_0x14cc0e))[_0x4886('0x9')](loggerCatch(_0x4886('0x33')));};exports[_0x4886('0x34')]=function(_0x2c51ab,_0x5f2450){return BPromise[_0x4886('0xb')]()[_0x4886('0xc')](cmHopper[_0x4886('0x34')](_0x2c51ab,_0x5f2450))['catch'](loggerCatch(_0x4886('0x35')));};exports['rescheduleContactInQueue']=function(_0x38868c){return cmHopper[_0x4886('0x15')](_0x38868c,!![],!![])[_0x4886('0x9')](loggerCatch('[rescheduleContactInQueue]\x20'));}; \ No newline at end of file +var _0xf7a2=['countReScheduled','unlockContact','disableContact','[activeContact]\x20','crateCustomerReportQueue','type','calleridnum','calleridname','queuecallerjoinAt','answertime','queuecallerleaveAt','queuecallercomplete','queuecallercompleteAt','connectedlinename','membername','context','from-sip','exten','xcally-motion-preview','holdtime','assigned','COMPLETED','[voiceQueueReport]\x20','[GetContactRecallMe]\x20','rescheduleContactInQueue','util','bluebird','../../../config/logger','../rpc/cmHopper','../rpc/cmHopperHistory','error','createHistory','catch','[createHistory]\x20','resolve','then','checkIsBlackList','[checkIsBlackList]\x20','getContactPreview','[getContactPreview]\x20','createAgentHistory','createCustomerHistory','createCustomerFinal','rescheduleContact','UserId','active','[rescheduleContact]\x20'];(function(_0x334846,_0x4a70a4){var _0x46c967=function(_0x2b2ee7){while(--_0x2b2ee7){_0x334846['push'](_0x334846['shift']());}};_0x46c967(++_0x4a70a4);}(_0xf7a2,0xd5));var _0x2f7a=function(_0x528575,_0x2e067d){_0x528575=_0x528575-0x0;var _0x3063b7=_0xf7a2[_0x528575];return _0x3063b7;};'use strict';var util=require(_0x2f7a('0x0'));var BPromise=require(_0x2f7a('0x1'));var logger=require(_0x2f7a('0x2'))('preview');var cmHopper=require(_0x2f7a('0x3'));var cmHopperHistory=require(_0x2f7a('0x4'));var cmHopperBlack=require('../rpc/cmHopperBlack');var agentReportPreview=require('../rpc/agentReportPreview');var voiceQueueReport=require('../rpc/voiceQueueReport');function loggerCatch(_0x264f3c){return function(_0x47bf81){logger[_0x2f7a('0x5')](_0x264f3c,util['inspect'](_0x47bf81,{'showHidden':![],'depth':null}));};}function create(_0x4f3be4){return cmHopperHistory[_0x2f7a('0x6')](_0x4f3be4)[_0x2f7a('0x7')](loggerCatch(_0x2f7a('0x8')));}function createAgent(_0x324467){return BPromise[_0x2f7a('0x9')]()[_0x2f7a('0xa')](agentReportPreview[_0x2f7a('0x6')](_0x324467))['catch'](loggerCatch(_0x2f7a('0x8')));}function moveContact(_0x515c8a){return cmHopper['moveContactManagedDialer'](_0x515c8a,!![])['catch'](loggerCatch('[moveContactManagedDialer]\x20'));}exports[_0x2f7a('0xb')]=function(_0x2a7b6e){return cmHopperBlack[_0x2f7a('0xb')](_0x2a7b6e)[_0x2f7a('0x7')](loggerCatch(_0x2f7a('0xc')));};exports[_0x2f7a('0xd')]=function(_0x924985){return BPromise['resolve']()['then'](cmHopper[_0x2f7a('0xd')](_0x924985))['catch'](loggerCatch(_0x2f7a('0xe')));};exports[_0x2f7a('0x6')]=function(_0x1ab6f9,_0xd1ec29){create(_0x1ab6f9)[_0x2f7a('0x7')](loggerCatch(_0xd1ec29));moveContact(_0x1ab6f9)['catch'](loggerCatch(_0xd1ec29));};exports[_0x2f7a('0xf')]=function(_0x380dd2,_0x1285c7){createAgent(_0x380dd2)[_0x2f7a('0x7')](loggerCatch(_0x1285c7));};exports[_0x2f7a('0x10')]=function(_0x6eaec7,_0x482e36){create(_0x6eaec7)[_0x2f7a('0x7')](loggerCatch(_0x482e36));};exports[_0x2f7a('0x11')]=function(_0x505a98,_0x5b4a53){moveContact(_0x505a98)[_0x2f7a('0x7')](loggerCatch(_0x5b4a53));};exports[_0x2f7a('0x12')]=function(_0x1de422,_0x45fa49,_0x3985bb){if(_0x45fa49){_0x1de422[_0x2f7a('0x13')]=null;}if(_0x3985bb){_0x1de422[_0x2f7a('0x14')]=![];}return cmHopper[_0x2f7a('0x12')](_0x1de422)[_0x2f7a('0x7')](loggerCatch(_0x2f7a('0x15')));};exports[_0x2f7a('0x16')]=function(_0x199596){return cmHopper['countReScheduled'](_0x199596)[_0x2f7a('0x7')](loggerCatch('[countReScheduled]\x20'));};exports[_0x2f7a('0x17')]=function(_0x305dec){return cmHopper[_0x2f7a('0x17')]({'UserId':null},_0x305dec,0x1)[_0x2f7a('0x7')](loggerCatch('[unlockContact]\x20'));};exports[_0x2f7a('0x18')]=function(_0xa91218){return cmHopper['unlockContact']({'active':![]},_0xa91218,0x1)[_0x2f7a('0x7')](loggerCatch(_0x2f7a('0x19')));};exports[_0x2f7a('0x1a')]=function(_0x50fd62){var _0x4cce51={};_0x4cce51['type']=_0x50fd62[_0x2f7a('0x1b')];_0x4cce51['uniqueid']=_0x50fd62['uniqueid'];_0x4cce51[_0x2f7a('0x1c')]=_0x50fd62[_0x2f7a('0x1c')];_0x4cce51[_0x2f7a('0x1d')]=_0x50fd62[_0x2f7a('0x1d')];_0x4cce51['queue']=_0x50fd62['queue'];_0x4cce51[_0x2f7a('0x1e')]=_0x50fd62[_0x2f7a('0x1f')];_0x4cce51[_0x2f7a('0x20')]=_0x50fd62['answertime'];_0x4cce51[_0x2f7a('0x21')]=0x1;_0x4cce51[_0x2f7a('0x22')]=_0x50fd62['endtime'];_0x4cce51[_0x2f7a('0x23')]=_0x50fd62[_0x2f7a('0x24')];_0x4cce51[_0x2f7a('0x25')]=_0x2f7a('0x26');_0x4cce51[_0x2f7a('0x27')]=_0x2f7a('0x28');_0x4cce51[_0x2f7a('0x29')]=0x0;_0x4cce51[_0x2f7a('0x2a')]=0x1;_0x4cce51['lastAssignedTo']=_0x50fd62[_0x2f7a('0x24')];_0x4cce51['queuecallerexitreason']=_0x2f7a('0x2b');return BPromise['resolve']()['then'](voiceQueueReport['create'](_0x4cce51))[_0x2f7a('0x7')](loggerCatch(_0x2f7a('0x2c')));};exports['getContactRecallMe']=function(_0x3c1986,_0x112d8a){return BPromise[_0x2f7a('0x9')]()[_0x2f7a('0xa')](cmHopper['getContactRecallMe'](_0x3c1986,_0x112d8a))[_0x2f7a('0x7')](loggerCatch(_0x2f7a('0x2d')));};exports[_0x2f7a('0x2e')]=function(_0x19f8f8){return cmHopper[_0x2f7a('0x12')](_0x19f8f8,!![],!![])[_0x2f7a('0x7')](loggerCatch('[rescheduleContactInQueue]\x20'));}; \ No newline at end of file diff --git a/server/services/ami/preview/util/util.js b/server/services/ami/preview/util/util.js index 19afbf3..de48d2f 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 _0xc8da=['xmd-dialoptions','xmd-dialid','xmd-dialchannel','xmd-contactid','xmd-callerid','xmd-agi','rtpaudioqos','rtpaudioqosbridged','rtpaudioqosjitterbridged','rtpaudioqosloss','rtpaudioqosrtt','rtpaudioqosrttbridged','rtpaudioqosjitter','rtpaudioqoslossbridged','bridgepeer','bridgepvtcallid','getCallerIdRandom','\x5cw{0,','pow','replace','random','extractCalleridName','match','noanswer','variables','forEach','buildNoAnswerEventPayload','util','lodash','moment','../../../../config/logger','preview','127.0.0.1','../../dialer/utils','loggerCatch','error','logger','info','inspect','loggerError','logger2','getCallerId','string','isEmpty','isUndefined','format','\x22%s\x22\x20<%s>','\x22\x22\x20<>','isActive','isNil','addVariables','ContactId','VoiceQueueId','dialOriginateTimeout','\x22rtTxX%s%s\x22','monitor_format','dialQueueProject','\x22agi://%s/square,%s\x22','NONE','dialQueueProject2','originatecalleridname','xcally-motion-preview','Call-Type:\x20PREVIEW','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','endtime','logAgent','getSeconds','logLookAgent','logCustomer','responsetime','ringtime','talktime','answertime','isFailure','Failure','variablesAction','RECALL','calleridname','uniqueid','channelAgent','calleridnum','from-sip','timeout','totalGlobal','countbusyretry','countcongestionretry','countnoanswerretry','cloneAction','clone','active','scheduledat','add','minutes','ListId','pTalking','[decrementTalkink]\x20object\x20talking\x20is\x20negative','[decrementTalkink]\x20is\x20null\x20or\x20undefined','IsNotLoggedIn','lastevent','name','queue','interface','motionChannel','mandatoryDisposition','buildAcw','agentReadyId','not_inuse','status','push','getDiff','milliseconds','CampaignId','filterKey','idContact','type','campaigntype','membername','callback','callbackuniqueid','callbackat','UserId','sipcallid','xmd-voicequeueid','xmd-queue','xmd-listid','xmd-dialtimeout'];(function(_0x3f2a90,_0x50baf1){var _0xb46279=function(_0x5e47b5){while(--_0x5e47b5){_0x3f2a90['push'](_0x3f2a90['shift']());}};_0xb46279(++_0x50baf1);}(_0xc8da,0xa4));var _0xac8d=function(_0xe588e8,_0x3eb47c){_0xe588e8=_0xe588e8-0x0;var _0x15ad36=_0xc8da[_0xe588e8];return _0x15ad36;};'use strict';var util=require(_0xac8d('0x0'));var _=require(_0xac8d('0x1'));var moment=require(_0xac8d('0x2'));var logger=require(_0xac8d('0x3'))(_0xac8d('0x4'));var ipAgi=process['env']['XCALLY_IP_AGI']||_0xac8d('0x5');var utils=require(_0xac8d('0x6'));exports[_0xac8d('0x7')]=function(_0x54edc2){return function(_0x131be7){logger[_0xac8d('0x8')](_0x54edc2,util['inspect'](_0x131be7,{'showHidden':![],'depth':null}));};};exports[_0xac8d('0x9')]=function(_0x51fb25,_0x2fb0e8){logger[_0xac8d('0xa')](_0x51fb25,util[_0xac8d('0xb')](_0x2fb0e8,{'showHidden':![],'depth':null}));};exports[_0xac8d('0xc')]=function(_0x1c780e,_0x479230){logger[_0xac8d('0x8')](_0x1c780e,util[_0xac8d('0xb')](_0x479230,{'showHidden':![],'depth':null}));};exports[_0xac8d('0xd')]=function(_0x2692f2){return function(_0x4da153){logger[_0xac8d('0xa')](_0x2692f2,util[_0xac8d('0xb')](_0x4da153,{'showHidden':![],'depth':null}));};};exports['message']=function(_0x24202a,_0x1cf93b,_0x423618){return{'message':_0x24202a,'unlock':_0x1cf93b,'active':_0x423618};};exports[_0xac8d('0xe')]=function(_0x31c482,_0x412acf,_0x257a71){if(!_['isUndefined'](_0x257a71)&&_0xac8d('0xf')===typeof _0x257a71&&!_[_0xac8d('0x10')](_0x257a71)){if(!_[_0xac8d('0x11')](_0x412acf)&&_0xac8d('0xf')===typeof _0x412acf&&!_[_0xac8d('0x10')](_0x412acf)){return util[_0xac8d('0x12')](_0xac8d('0x13'),_0x412acf,_0x257a71);}return util[_0xac8d('0x12')]('\x22%s\x22\x20<%s>',_0x257a71,_0x257a71);}if(!_['isUndefined'](_0x31c482)&&'string'===typeof _0x31c482&&!_['isEmpty'](_0x31c482)){return _0x31c482;}return _0xac8d('0x14');};exports[_0xac8d('0x15')]=function(_0x2db434){if(_[_0xac8d('0x16')](_0x2db434)){return![];}return _0x2db434;};exports[_0xac8d('0x17')]=function(_0x55c4c4,_0x3ec61c,_0x342cd8,_0x4b376e,_0x1c637f,_0x527fce){var _0xaf2962={'XMD-QUEUE':_0x3ec61c['Queue']?_0x3ec61c['Queue']['name']:'','XMD-CALLERID':_0x4b376e,'XMD-CALLERID-PREVIEW':_0x527fce?util[_0xac8d('0x12')]('\x22%s\x22\x20<%s>',_0x527fce['calleridname'],_0x527fce['calleridnum']):_0x4b376e,'XMD-DIALID':_0x1c637f,'XMD-CONTACTID':_0x3ec61c[_0xac8d('0x18')],'XMD-CDRTYPE':'dialer','CALLERID(all)':_0x4b376e,'XMD-VOICEQUEUEID':_0x3ec61c[_0xac8d('0x19')],'XMD-DIALCHANNEL':_0x342cd8,'XMD-DIALTIMEOUT':_0x55c4c4[_0xac8d('0x1a')]||0x1e,'XMD-DIALOPTIONS':util[_0xac8d('0x12')](_0xac8d('0x1b'),_0x55c4c4['dialQueueProject2']?'g':'',_[_0xac8d('0x10')](_0x55c4c4[_0xac8d('0x1c')])?'':'U(xcally-mixmonitor-context)'),'XMD-DIALURL':_0x55c4c4['dialPreviewUrl']||'','XMD-AGI':_0x55c4c4[_0xac8d('0x1d')]?util[_0xac8d('0x12')](_0xac8d('0x1e'),ipAgi,_0x55c4c4['dialQueueProject']):_0xac8d('0x1f'),'XMD-AGIAFTER':_0x55c4c4[_0xac8d('0x20')]?util[_0xac8d('0x12')](_0xac8d('0x1e'),ipAgi,_0x55c4c4['dialQueueProject2']):_0xac8d('0x1f'),'XMD-ORIGINATECALLERIDNUM':_0x527fce?_0x527fce['originatecalleridnum']:'','XMD-ORIGINATECALLERIDNAME':_0x527fce?_0x527fce[_0xac8d('0x21')]:'','XMD-DESTINATION':_0xac8d('0x22'),'SIPADDHEADER':_0xac8d('0x23')};if(!_['isEmpty'](_0x55c4c4[_0xac8d('0x1c')])){_0xaf2962[util[_0xac8d('0x12')]('%s','_XCALLY_MIXMONITOR_FORMAT')]=_0x55c4c4['monitor_format'];_0xaf2962[util[_0xac8d('0x12')]('%s','_XCALLY_MIXMONITOR_UNIQUEID')]=_0x1c637f;}return _0xaf2962;};exports[_0xac8d('0x24')]=function(_0x4a2433){var _0x3c2e7b={};for(var _0x1363f0 in _0x4a2433){if(_0x4a2433[_0xac8d('0x25')](_0x1363f0)){_0x3c2e7b[util[_0xac8d('0x12')]('%s',_['toLower'](_0x1363f0))]=_0x4a2433[_0x1363f0];}}return{'variables':_0x3c2e7b};};exports[_0xac8d('0x26')]=function(_0x196a8a,_0x1d36e0){if(!_[_0xac8d('0x16')](_0x196a8a)){if(_0x196a8a[_0xac8d('0x25')](_0xac8d('0x27'))){if(_0x196a8a[_0xac8d('0x27')]>0x0){_0x196a8a[_0xac8d('0x27')]-=0x1;}else{logger['error'](_0xac8d('0x28'),_0x1d36e0);}}}else{logger[_0xac8d('0x8')](_0xac8d('0x29'),_0x1d36e0);}};exports[_0xac8d('0x2a')]=function(_0x3fece8){var _0x362049=moment()[_0xac8d('0x12')](_0xac8d('0x2b'));_0x3fece8[_0xac8d('0x2c')]=0xd;_0x3fece8[_0xac8d('0x2d')]=_0xac8d('0x2e');_0x3fece8[_0xac8d('0x2f')]=_0x362049;_0x3fece8['responsetime']=_0x362049;_0x3fece8[_0xac8d('0x30')]=_0x362049;};exports[_0xac8d('0x31')]=function(_0x457088,_0x26d92f,_0xe35ac2){var _0x5af9af=moment()[_0xac8d('0x12')](_0xac8d('0x2b'));_0x457088['state']=_0x26d92f;_0x457088[_0xac8d('0x2d')]=_0xe35ac2;_0x457088['responsetime']=_0x5af9af;_0x457088['ringtime']=utils[_0xac8d('0x32')](_0x457088['responsetime'],_0x457088[_0xac8d('0x2f')]);};exports[_0xac8d('0x33')]=function(_0x3ffa41,_0x1d9e29,_0x4e0db4){_0x3ffa41['membername']=_0x1d9e29;_0x3ffa41['UserId']=_0x4e0db4;};exports[_0xac8d('0x34')]=function(_0x5c8ff7,_0x460db4,_0x387ad5){var _0x327247=moment()[_0xac8d('0x12')](_0xac8d('0x2b'));_0x5c8ff7['state']=_0x460db4;_0x5c8ff7[_0xac8d('0x2d')]=_0x387ad5;_0x5c8ff7[_0xac8d('0x35')]=_0x5c8ff7[_0xac8d('0x35')]?_0x5c8ff7['responsetime']:_0x327247;_0x5c8ff7['endtime']=_0x5c8ff7[_0xac8d('0x30')]?_0x5c8ff7[_0xac8d('0x30')]:_0x327247;_0x5c8ff7[_0xac8d('0x36')]=utils['getSeconds'](_0x5c8ff7['responsetime']||0x0,_0x5c8ff7[_0xac8d('0x2f')]||0x0);_0x5c8ff7[_0xac8d('0x37')]=_0x5c8ff7[_0xac8d('0x38')]?utils['getSeconds'](_0x5c8ff7[_0xac8d('0x30')],_0x5c8ff7[_0xac8d('0x38')]):0x0;};exports[_0xac8d('0x39')]=function(_0x72bac9){return _0x72bac9===_0xac8d('0x3a');};exports[_0xac8d('0x3b')]=function(_0x1855ee,_0x2f2a17,_0x318658,_0x540e54,_0x30c30d){var _0x1753c4=_0x540e54?_0xac8d('0x3c'):_0x1855ee[_0xac8d('0x3d')];_0x1753c4=_0x30c30d?'BOOKED':_0x1753c4;return{'actionid':_0x1855ee[_0xac8d('0x3e')],'action':'originate','channel':_0x1855ee[_0xac8d('0x3f')],'callerid':util[_0xac8d('0x12')](_0xac8d('0x13'),_0x1753c4,_0x1855ee[_0xac8d('0x40')]),'Exten':_0xac8d('0x22'),'Context':_0xac8d('0x41'),'Priority':'1','variable':_0x318658,'timeout':(_0x2f2a17[_0xac8d('0x42')]||0x1e)*0x3e8,'async':!![],'channelid':_0x1855ee[_0xac8d('0x3e')]};};exports[_0xac8d('0x43')]=function(_0x5bb7f4){return _0x5bb7f4[_0xac8d('0x44')]+_0x5bb7f4[_0xac8d('0x45')]+_0x5bb7f4[_0xac8d('0x46')]+_0x5bb7f4['countagentrejectretry']+_0x5bb7f4['countnosuchnumberretry'];};exports[_0xac8d('0x47')]=function(_0x47bdab){var _0x4704a4=_[_0xac8d('0x48')](_0x47bdab);_0x4704a4[_0xac8d('0x2c')]=0xf;_0x4704a4[_0xac8d('0x2d')]='Global';return _0x4704a4;};exports['scheduledAt']=function(_0x669c4a,_0x3600e9,_0x50aade){var _0x368eac={};_0x368eac[_0x3600e9]=_0x669c4a[_0x3600e9];_0x368eac[_0xac8d('0x49')]=![];_0x368eac[_0xac8d('0x4a')]=moment()[_0xac8d('0x4b')](_0x50aade,_0xac8d('0x4c'))[_0xac8d('0x12')](_0xac8d('0x2b'));_0x368eac[_0xac8d('0x18')]=_0x669c4a[_0xac8d('0x18')];_0x368eac[_0xac8d('0x4d')]=_0x669c4a[_0xac8d('0x4d')];_0x368eac[_0xac8d('0x19')]=_0x669c4a[_0xac8d('0x19')]||undefined;return _0x368eac;};exports['decrementTalkink']=function(_0x3b3eeb,_0x4840ff){if(!_[_0xac8d('0x16')](_0x3b3eeb)){if(_0x3b3eeb[_0xac8d('0x4e')]>0x0){_0x3b3eeb['pTalking']-=0x1;}else{logger[_0xac8d('0x8')](_0x4840ff,_0xac8d('0x4f'));}}else{logger[_0xac8d('0x8')](_0x4840ff,_0xac8d('0x50'));}};exports[_0xac8d('0x51')]=function(_0x2659e4){if(_0x2659e4<=0x0){return!![];}return![];};function buildObj(_0x2af06b,_0x38c9f7,_0x59321b){_0x2af06b[_0xac8d('0x52')]=_0x38c9f7;_0x2af06b[_0xac8d('0x53')]=_0x2af06b[_0xac8d('0x54')];_0x2af06b[_0xac8d('0x55')]=_0x2af06b[_0xac8d('0x3f')];_0x2af06b[_0xac8d('0x56')]='voice';if(_0x59321b){_0x2af06b[_0xac8d('0x57')]=_0x59321b['mandatoryDisposition'];}return _0x2af06b;}exports['buildObj']=buildObj;exports[_0xac8d('0x58')]=function(_0x168851){var _0x842c6c={};_0x842c6c[_0xac8d('0x54')]=_0x168851[_0xac8d('0x54')];_0x842c6c[_0xac8d('0x55')]=_0x168851[_0xac8d('0x3f')];_0x842c6c['uniqueid']=_0x168851[_0xac8d('0x3e')];return _0x842c6c;};exports[_0xac8d('0x59')]=function(_0x22fe8b){var _0x276f3f=[];for(var _0x2c574f in _0x22fe8b){if(_0x22fe8b[_0xac8d('0x25')](_0x2c574f)){if(!_[_0xac8d('0x16')](_0x22fe8b[_0x2c574f])&&_0x22fe8b[_0x2c574f][_0xac8d('0x2c')]===_0xac8d('0x5a')&&_0x22fe8b[_0x2c574f][_0xac8d('0x5b')]==='reachable'){_0x276f3f[_0xac8d('0x5c')](_0x22fe8b[_0x2c574f]['id']);}}}return _0x276f3f;};exports[_0xac8d('0x5d')]=function(_0x496b6d){var _0x4c185f=moment()[_0xac8d('0x5e')](0x0);var _0x4dbf12=moment(_0x496b6d)['milliseconds'](0x0);return _0x4c185f['diff'](_0x4dbf12,'seconds');};exports['createBody']=function(_0x2251bf){return{'active':![],'recallme':![],'UserId':null,'ContactId':_0x2251bf[_0xac8d('0x18')],'ListId':_0x2251bf[_0xac8d('0x4d')],'VoiceQueueId':_0x2251bf['VoiceQueueId']||undefined,'CampaignId':_0x2251bf[_0xac8d('0x5f')]||undefined};};exports[_0xac8d('0x60')]=function(_0x4c6370){if(_0x4c6370==='uniqueid'||_0x4c6370===_0xac8d('0x61')||_0x4c6370===_0xac8d('0x54')||_0x4c6370===_0xac8d('0x62')||_0x4c6370===_0xac8d('0x63')||_0x4c6370==='dialAnswer'||_0x4c6370===_0xac8d('0x64')||_0x4c6370===_0xac8d('0x3f')||_0x4c6370===_0xac8d('0x3d')||_0x4c6370===_0xac8d('0x49')||_0x4c6370==='calleridnum'||_0x4c6370===_0xac8d('0x4a')||_0x4c6370===_0xac8d('0x44')||_0x4c6370===_0xac8d('0x45')||_0x4c6370==='countnoanswerretry'||_0x4c6370==='countglobal'||_0x4c6370===_0xac8d('0x65')||_0x4c6370===_0xac8d('0x66')||_0x4c6370===_0xac8d('0x67')||_0x4c6370==='recallme'||_0x4c6370===_0xac8d('0x18')||_0x4c6370==='ListId'||_0x4c6370===_0xac8d('0x68')||_0x4c6370==='VoiceQueueId'||_0x4c6370===_0xac8d('0x69')||_0x4c6370===_0xac8d('0x6a')||_0x4c6370===_0xac8d('0x6b')||_0x4c6370==='xmd-phone'||_0x4c6370===_0xac8d('0x6c')||_0x4c6370==='xmd-dialurl'||_0x4c6370===_0xac8d('0x6d')||_0x4c6370===_0xac8d('0x6e')||_0x4c6370===_0xac8d('0x6f')||_0x4c6370===_0xac8d('0x70')||_0x4c6370===_0xac8d('0x71')||_0x4c6370==='xmd-cdrtype'||_0x4c6370===_0xac8d('0x72')||_0x4c6370==='xmd-agiafter'||_0x4c6370===_0xac8d('0x73')||_0x4c6370===_0xac8d('0x74')||_0x4c6370===_0xac8d('0x75')||_0x4c6370==='rtpaudioqosjitter'||_0x4c6370===_0xac8d('0x76')||_0x4c6370===_0xac8d('0x77')||_0x4c6370==='rtpaudioqoslossbridged'||_0x4c6370===_0xac8d('0x78')||_0x4c6370===_0xac8d('0x79')||_0x4c6370===_0xac8d('0x74')||_0x4c6370===_0xac8d('0x75')||_0x4c6370===_0xac8d('0x7a')||_0x4c6370==='rtpaudioqosjitterbridged'||_0x4c6370===_0xac8d('0x77')||_0x4c6370===_0xac8d('0x7b')||_0x4c6370===_0xac8d('0x78')||_0x4c6370==='rtpaudioqosrttbridged'||_0x4c6370===_0xac8d('0x7c')||_0x4c6370===_0xac8d('0x7d')||_0x4c6370===_0xac8d('0x2c')||_0x4c6370===_0xac8d('0x2d')){return![];}return!![];};exports[_0xac8d('0x7e')]=function(_0x507862,_0x5cc2cf){var _0x46d505,_0x598453,_0x178bcf;if(_0x5cc2cf<=0x0){_0x5cc2cf=0x1;}_0x46d505=new RegExp(_0xac8d('0x7f')+_0x5cc2cf+'}$');_0x598453=Math['pow'](0xa,_0x5cc2cf-0x1);_0x178bcf=Math[_0xac8d('0x80')](0xa,_0x5cc2cf)-0x1;return util[_0xac8d('0x12')]('%s',_[_0xac8d('0x81')](_0x507862,_0x46d505,_[_0xac8d('0x82')](_0x598453,_0x178bcf)));};exports[_0xac8d('0x83')]=function(_0x4948de){var _0x2ebc38=_0x4948de[_0xac8d('0x84')](/"(.*?)"/);return _0x2ebc38?_0x2ebc38[0x1]:_0x4948de;};exports['extractCalleridNumber']=function(_0x39410a){var _0x50041e=_0x39410a['match'](/<(.*?)>/);return _0x50041e?_0x50041e[0x1]:_0x39410a;};function buildNoAnswerEventPayload(_0x302024,_0x395d4a){var _0x341a20=buildObj(_0x302024,_0xac8d('0x85'));if(!_['isEmpty'](_0x395d4a[_0xac8d('0x86')])){Object['keys'](_0x395d4a['variables'])[_0xac8d('0x87')](function(_0x2abf6f){_0x341a20[_0x2abf6f['toLowerCase']()]=_0x395d4a['variables'][_0x2abf6f];});}return _0x341a20;}exports[_0xac8d('0x88')]=buildNoAnswerEventPayload; \ No newline at end of file +var _0x7ffb=['hasOwnProperty','originated','[updateOriginated]\x20is\x20null\x20or\x20undefined','logBlacklist','YYYY-MM-DD\x20HH:mm:ss','state','statedesc','starttime','responsetime','endtime','logAgent','ringtime','getSeconds','logLookAgent','membername','UserId','logCustomer','talktime','answertime','isFailure','Failure','variablesAction','RECALL','BOOKED','uniqueid','originate','channelAgent','timeout','totalGlobal','countbusyretry','countcongestionretry','countnoanswerretry','countagentrejectretry','countnosuchnumberretry','clone','Global','active','ContactId','ListId','decrementTalkink','pTalking','IsNotLoggedIn','lastevent','queue','voice','mandatoryDisposition','buildAcw','interface','agentReadyId','status','reachable','push','milliseconds','seconds','CampaignId','filterKey','idContact','type','campaigntype','dialAnswer','scheduledat','callback','callbackuniqueid','recallme','sipcallid','xmd-queue','xmd-listid','xmd-dialurl','xmd-dialoptions','xmd-cdrtype','xmd-callerid','xmd-agiafter','rtpaudioqos','rtpaudioqosjitter','rtpaudioqosjitterbridged','rtpaudioqosloss','rtpaudioqosrtt','rtpaudioqosrttbridged','rtpaudioqosbridged','rtpaudioqoslossbridged','bridgepeer','bridgepvtcallid','getCallerIdRandom','\x5cw{0,','pow','replace','match','extractCalleridNumber','variables','forEach','toLowerCase','buildNoAnswerEventPayload','util','lodash','moment','preview','env','XCALLY_IP_AGI','127.0.0.1','../../dialer/utils','loggerCatch','error','info','loggerError','inspect','logger2','message','getCallerId','isUndefined','string','isEmpty','format','\x22%s\x22\x20<%s>','isActive','isNil','Queue','calleridname','calleridnum','dialer','VoiceQueueId','\x22rtTxX%s%s\x22','dialQueueProject2','monitor_format','U(xcally-mixmonitor-context)','dialPreviewUrl','dialQueueProject','\x22agi://%s/square,%s\x22','NONE','originatecalleridnum','xcally-motion-preview','Call-Type:\x20PREVIEW','_XCALLY_MIXMONITOR_FORMAT','_XCALLY_MIXMONITOR_UNIQUEID','toLowerVariables','toLower','updateOriginated'];(function(_0x3235ef,_0x3f5365){var _0x1a2daa=function(_0x1bb027){while(--_0x1bb027){_0x3235ef['push'](_0x3235ef['shift']());}};_0x1a2daa(++_0x3f5365);}(_0x7ffb,0xe4));var _0xb7ff=function(_0xd73d53,_0x598443){_0xd73d53=_0xd73d53-0x0;var _0x560148=_0x7ffb[_0xd73d53];return _0x560148;};'use strict';var util=require(_0xb7ff('0x0'));var _=require(_0xb7ff('0x1'));var moment=require(_0xb7ff('0x2'));var logger=require('../../../../config/logger')(_0xb7ff('0x3'));var ipAgi=process[_0xb7ff('0x4')][_0xb7ff('0x5')]||_0xb7ff('0x6');var utils=require(_0xb7ff('0x7'));exports[_0xb7ff('0x8')]=function(_0x566940){return function(_0x300475){logger[_0xb7ff('0x9')](_0x566940,util['inspect'](_0x300475,{'showHidden':![],'depth':null}));};};exports['logger']=function(_0x20ff6e,_0x52f4fd){logger[_0xb7ff('0xa')](_0x20ff6e,util['inspect'](_0x52f4fd,{'showHidden':![],'depth':null}));};exports[_0xb7ff('0xb')]=function(_0x3b7e0b,_0x4df46f){logger['error'](_0x3b7e0b,util[_0xb7ff('0xc')](_0x4df46f,{'showHidden':![],'depth':null}));};exports[_0xb7ff('0xd')]=function(_0x10abb7){return function(_0xfc8486){logger[_0xb7ff('0xa')](_0x10abb7,util[_0xb7ff('0xc')](_0xfc8486,{'showHidden':![],'depth':null}));};};exports[_0xb7ff('0xe')]=function(_0x5e2429,_0x24c6f6,_0x285ab9){return{'message':_0x5e2429,'unlock':_0x24c6f6,'active':_0x285ab9};};exports[_0xb7ff('0xf')]=function(_0xdf7903,_0x590b72,_0x105005){if(!_[_0xb7ff('0x10')](_0x105005)&&_0xb7ff('0x11')===typeof _0x105005&&!_[_0xb7ff('0x12')](_0x105005)){if(!_[_0xb7ff('0x10')](_0x590b72)&&_0xb7ff('0x11')===typeof _0x590b72&&!_['isEmpty'](_0x590b72)){return util[_0xb7ff('0x13')]('\x22%s\x22\x20<%s>',_0x590b72,_0x105005);}return util['format'](_0xb7ff('0x14'),_0x105005,_0x105005);}if(!_[_0xb7ff('0x10')](_0xdf7903)&&_0xb7ff('0x11')===typeof _0xdf7903&&!_['isEmpty'](_0xdf7903)){return _0xdf7903;}return'\x22\x22\x20<>';};exports[_0xb7ff('0x15')]=function(_0x14882e){if(_[_0xb7ff('0x16')](_0x14882e)){return![];}return _0x14882e;};exports['addVariables']=function(_0x1805a0,_0x571f21,_0x2d2280,_0x2ba601,_0x36cece,_0x5d2b21){var _0x5bf6a2={'XMD-QUEUE':_0x571f21['Queue']?_0x571f21[_0xb7ff('0x17')]['name']:'','XMD-CALLERID':_0x2ba601,'XMD-CALLERID-PREVIEW':_0x5d2b21?util[_0xb7ff('0x13')](_0xb7ff('0x14'),_0x5d2b21[_0xb7ff('0x18')],_0x5d2b21[_0xb7ff('0x19')]):_0x2ba601,'XMD-DIALID':_0x36cece,'XMD-CONTACTID':_0x571f21['ContactId'],'XMD-CDRTYPE':_0xb7ff('0x1a'),'CALLERID(all)':_0x2ba601,'XMD-VOICEQUEUEID':_0x571f21[_0xb7ff('0x1b')],'XMD-DIALCHANNEL':_0x2d2280,'XMD-DIALTIMEOUT':_0x1805a0['dialOriginateTimeout']||0x1e,'XMD-DIALOPTIONS':util[_0xb7ff('0x13')](_0xb7ff('0x1c'),_0x1805a0[_0xb7ff('0x1d')]?'g':'',_[_0xb7ff('0x12')](_0x1805a0[_0xb7ff('0x1e')])?'':_0xb7ff('0x1f')),'XMD-DIALURL':_0x1805a0[_0xb7ff('0x20')]||'','XMD-AGI':_0x1805a0[_0xb7ff('0x21')]?util[_0xb7ff('0x13')](_0xb7ff('0x22'),ipAgi,_0x1805a0[_0xb7ff('0x21')]):'NONE','XMD-AGIAFTER':_0x1805a0[_0xb7ff('0x1d')]?util[_0xb7ff('0x13')](_0xb7ff('0x22'),ipAgi,_0x1805a0[_0xb7ff('0x1d')]):_0xb7ff('0x23'),'XMD-ORIGINATECALLERIDNUM':_0x5d2b21?_0x5d2b21[_0xb7ff('0x24')]:'','XMD-ORIGINATECALLERIDNAME':_0x5d2b21?_0x5d2b21['originatecalleridname']:'','XMD-DESTINATION':_0xb7ff('0x25'),'SIPADDHEADER':_0xb7ff('0x26')};if(!_['isEmpty'](_0x1805a0[_0xb7ff('0x1e')])){_0x5bf6a2[util[_0xb7ff('0x13')]('%s',_0xb7ff('0x27'))]=_0x1805a0['monitor_format'];_0x5bf6a2[util[_0xb7ff('0x13')]('%s',_0xb7ff('0x28'))]=_0x36cece;}return _0x5bf6a2;};exports[_0xb7ff('0x29')]=function(_0x81a834){var _0x475a16={};for(var _0x615601 in _0x81a834){if(_0x81a834['hasOwnProperty'](_0x615601)){_0x475a16[util['format']('%s',_[_0xb7ff('0x2a')](_0x615601))]=_0x81a834[_0x615601];}}return{'variables':_0x475a16};};exports[_0xb7ff('0x2b')]=function(_0x133178,_0xb709a4){if(!_[_0xb7ff('0x16')](_0x133178)){if(_0x133178[_0xb7ff('0x2c')](_0xb7ff('0x2d'))){if(_0x133178[_0xb7ff('0x2d')]>0x0){_0x133178[_0xb7ff('0x2d')]-=0x1;}else{logger[_0xb7ff('0x9')]('[updateOriginated]\x20object\x20originated\x20is\x20negative',_0xb709a4);}}}else{logger[_0xb7ff('0x9')](_0xb7ff('0x2e'),_0xb709a4);}};exports[_0xb7ff('0x2f')]=function(_0x3939b8){var _0x1e9a44=moment()['format'](_0xb7ff('0x30'));_0x3939b8[_0xb7ff('0x31')]=0xd;_0x3939b8[_0xb7ff('0x32')]='Blacklist';_0x3939b8[_0xb7ff('0x33')]=_0x1e9a44;_0x3939b8[_0xb7ff('0x34')]=_0x1e9a44;_0x3939b8[_0xb7ff('0x35')]=_0x1e9a44;};exports[_0xb7ff('0x36')]=function(_0x16b299,_0x246699,_0x1b60e6){var _0x3132ee=moment()[_0xb7ff('0x13')](_0xb7ff('0x30'));_0x16b299[_0xb7ff('0x31')]=_0x246699;_0x16b299[_0xb7ff('0x32')]=_0x1b60e6;_0x16b299[_0xb7ff('0x34')]=_0x3132ee;_0x16b299[_0xb7ff('0x37')]=utils[_0xb7ff('0x38')](_0x16b299['responsetime'],_0x16b299['starttime']);};exports[_0xb7ff('0x39')]=function(_0x198b2f,_0x57258e,_0x57bb02){_0x198b2f[_0xb7ff('0x3a')]=_0x57258e;_0x198b2f[_0xb7ff('0x3b')]=_0x57bb02;};exports[_0xb7ff('0x3c')]=function(_0x908944,_0x37dc0f,_0x2c68a8){var _0x45e2d3=moment()[_0xb7ff('0x13')](_0xb7ff('0x30'));_0x908944[_0xb7ff('0x31')]=_0x37dc0f;_0x908944[_0xb7ff('0x32')]=_0x2c68a8;_0x908944['responsetime']=_0x908944[_0xb7ff('0x34')]?_0x908944['responsetime']:_0x45e2d3;_0x908944[_0xb7ff('0x35')]=_0x908944[_0xb7ff('0x35')]?_0x908944[_0xb7ff('0x35')]:_0x45e2d3;_0x908944[_0xb7ff('0x37')]=utils['getSeconds'](_0x908944[_0xb7ff('0x34')]||0x0,_0x908944[_0xb7ff('0x33')]||0x0);_0x908944[_0xb7ff('0x3d')]=_0x908944[_0xb7ff('0x3e')]?utils[_0xb7ff('0x38')](_0x908944[_0xb7ff('0x35')],_0x908944[_0xb7ff('0x3e')]):0x0;};exports[_0xb7ff('0x3f')]=function(_0x261b02){return _0x261b02===_0xb7ff('0x40');};exports[_0xb7ff('0x41')]=function(_0x42c405,_0x534946,_0x56bc5e,_0x122fbc,_0x49bcbf){var _0x2983f3=_0x122fbc?_0xb7ff('0x42'):_0x42c405[_0xb7ff('0x18')];_0x2983f3=_0x49bcbf?_0xb7ff('0x43'):_0x2983f3;return{'actionid':_0x42c405[_0xb7ff('0x44')],'action':_0xb7ff('0x45'),'channel':_0x42c405[_0xb7ff('0x46')],'callerid':util[_0xb7ff('0x13')](_0xb7ff('0x14'),_0x2983f3,_0x42c405[_0xb7ff('0x19')]),'Exten':_0xb7ff('0x25'),'Context':'from-sip','Priority':'1','variable':_0x56bc5e,'timeout':(_0x534946[_0xb7ff('0x47')]||0x1e)*0x3e8,'async':!![],'channelid':_0x42c405['uniqueid']};};exports[_0xb7ff('0x48')]=function(_0x2051a3){return _0x2051a3[_0xb7ff('0x49')]+_0x2051a3[_0xb7ff('0x4a')]+_0x2051a3[_0xb7ff('0x4b')]+_0x2051a3[_0xb7ff('0x4c')]+_0x2051a3[_0xb7ff('0x4d')];};exports['cloneAction']=function(_0x47012b){var _0xdaa897=_[_0xb7ff('0x4e')](_0x47012b);_0xdaa897['state']=0xf;_0xdaa897[_0xb7ff('0x32')]=_0xb7ff('0x4f');return _0xdaa897;};exports['scheduledAt']=function(_0x27a588,_0x4a53ff,_0x48db05){var _0x44e84d={};_0x44e84d[_0x4a53ff]=_0x27a588[_0x4a53ff];_0x44e84d[_0xb7ff('0x50')]=![];_0x44e84d['scheduledat']=moment()['add'](_0x48db05,'minutes')[_0xb7ff('0x13')]('YYYY-MM-DD\x20HH:mm:ss');_0x44e84d[_0xb7ff('0x51')]=_0x27a588['ContactId'];_0x44e84d[_0xb7ff('0x52')]=_0x27a588['ListId'];_0x44e84d['VoiceQueueId']=_0x27a588['VoiceQueueId']||undefined;return _0x44e84d;};exports[_0xb7ff('0x53')]=function(_0xe44570,_0xf70ea9){if(!_['isNil'](_0xe44570)){if(_0xe44570['pTalking']>0x0){_0xe44570[_0xb7ff('0x54')]-=0x1;}else{logger[_0xb7ff('0x9')](_0xf70ea9,'[decrementTalkink]\x20object\x20talking\x20is\x20negative');}}else{logger[_0xb7ff('0x9')](_0xf70ea9,'[decrementTalkink]\x20is\x20null\x20or\x20undefined');}};exports[_0xb7ff('0x55')]=function(_0x2abb34){if(_0x2abb34<=0x0){return!![];}return![];};function buildObj(_0xf5f855,_0x5e9c2c,_0x657c08){_0xf5f855[_0xb7ff('0x56')]=_0x5e9c2c;_0xf5f855['name']=_0xf5f855[_0xb7ff('0x57')];_0xf5f855['interface']=_0xf5f855['channelAgent'];_0xf5f855['motionChannel']=_0xb7ff('0x58');if(_0x657c08){_0xf5f855[_0xb7ff('0x59')]=_0x657c08['mandatoryDisposition'];}return _0xf5f855;}exports['buildObj']=buildObj;exports[_0xb7ff('0x5a')]=function(_0x15103b){var _0x478ee7={};_0x478ee7[_0xb7ff('0x57')]=_0x15103b[_0xb7ff('0x57')];_0x478ee7[_0xb7ff('0x5b')]=_0x15103b[_0xb7ff('0x46')];_0x478ee7['uniqueid']=_0x15103b[_0xb7ff('0x44')];return _0x478ee7;};exports[_0xb7ff('0x5c')]=function(_0x19ec4c){var _0x44f289=[];for(var _0x487d57 in _0x19ec4c){if(_0x19ec4c[_0xb7ff('0x2c')](_0x487d57)){if(!_['isNil'](_0x19ec4c[_0x487d57])&&_0x19ec4c[_0x487d57][_0xb7ff('0x31')]==='not_inuse'&&_0x19ec4c[_0x487d57][_0xb7ff('0x5d')]===_0xb7ff('0x5e')){_0x44f289[_0xb7ff('0x5f')](_0x19ec4c[_0x487d57]['id']);}}}return _0x44f289;};exports['getDiff']=function(_0x3c333c){var _0x161f11=moment()['milliseconds'](0x0);var _0x5a495d=moment(_0x3c333c)[_0xb7ff('0x60')](0x0);return _0x161f11['diff'](_0x5a495d,_0xb7ff('0x61'));};exports['createBody']=function(_0x3d357b){return{'active':![],'recallme':![],'UserId':null,'ContactId':_0x3d357b[_0xb7ff('0x51')],'ListId':_0x3d357b[_0xb7ff('0x52')],'VoiceQueueId':_0x3d357b[_0xb7ff('0x1b')]||undefined,'CampaignId':_0x3d357b[_0xb7ff('0x62')]||undefined};};exports[_0xb7ff('0x63')]=function(_0x290ab4){if(_0x290ab4===_0xb7ff('0x44')||_0x290ab4===_0xb7ff('0x64')||_0x290ab4===_0xb7ff('0x57')||_0x290ab4===_0xb7ff('0x65')||_0x290ab4===_0xb7ff('0x66')||_0x290ab4===_0xb7ff('0x67')||_0x290ab4===_0xb7ff('0x3a')||_0x290ab4===_0xb7ff('0x46')||_0x290ab4===_0xb7ff('0x18')||_0x290ab4===_0xb7ff('0x50')||_0x290ab4===_0xb7ff('0x19')||_0x290ab4===_0xb7ff('0x68')||_0x290ab4==='countbusyretry'||_0x290ab4===_0xb7ff('0x4a')||_0x290ab4===_0xb7ff('0x4b')||_0x290ab4==='countglobal'||_0x290ab4===_0xb7ff('0x69')||_0x290ab4===_0xb7ff('0x6a')||_0x290ab4==='callbackat'||_0x290ab4===_0xb7ff('0x6b')||_0x290ab4==='ContactId'||_0x290ab4===_0xb7ff('0x52')||_0x290ab4===_0xb7ff('0x3b')||_0x290ab4==='VoiceQueueId'||_0x290ab4===_0xb7ff('0x6c')||_0x290ab4==='xmd-voicequeueid'||_0x290ab4===_0xb7ff('0x6d')||_0x290ab4==='xmd-phone'||_0x290ab4===_0xb7ff('0x6e')||_0x290ab4===_0xb7ff('0x6f')||_0x290ab4==='xmd-dialtimeout'||_0x290ab4===_0xb7ff('0x70')||_0x290ab4==='xmd-dialid'||_0x290ab4==='xmd-dialchannel'||_0x290ab4==='xmd-contactid'||_0x290ab4===_0xb7ff('0x71')||_0x290ab4===_0xb7ff('0x72')||_0x290ab4===_0xb7ff('0x73')||_0x290ab4==='xmd-agi'||_0x290ab4===_0xb7ff('0x74')||_0x290ab4==='rtpaudioqosbridged'||_0x290ab4===_0xb7ff('0x75')||_0x290ab4===_0xb7ff('0x76')||_0x290ab4===_0xb7ff('0x77')||_0x290ab4==='rtpaudioqoslossbridged'||_0x290ab4===_0xb7ff('0x78')||_0x290ab4===_0xb7ff('0x79')||_0x290ab4===_0xb7ff('0x74')||_0x290ab4===_0xb7ff('0x7a')||_0x290ab4==='rtpaudioqosjitter'||_0x290ab4==='rtpaudioqosjitterbridged'||_0x290ab4===_0xb7ff('0x77')||_0x290ab4===_0xb7ff('0x7b')||_0x290ab4===_0xb7ff('0x78')||_0x290ab4===_0xb7ff('0x79')||_0x290ab4===_0xb7ff('0x7c')||_0x290ab4===_0xb7ff('0x7d')||_0x290ab4===_0xb7ff('0x31')||_0x290ab4===_0xb7ff('0x32')){return![];}return!![];};exports[_0xb7ff('0x7e')]=function(_0x49a210,_0x468036){var _0x1bcb02,_0x38a4dc,_0x388256;if(_0x468036<=0x0){_0x468036=0x1;}_0x1bcb02=new RegExp(_0xb7ff('0x7f')+_0x468036+'}$');_0x38a4dc=Math[_0xb7ff('0x80')](0xa,_0x468036-0x1);_0x388256=Math['pow'](0xa,_0x468036)-0x1;return util[_0xb7ff('0x13')]('%s',_[_0xb7ff('0x81')](_0x49a210,_0x1bcb02,_['random'](_0x38a4dc,_0x388256)));};exports['extractCalleridName']=function(_0x10bd63){var _0x4b2447=_0x10bd63[_0xb7ff('0x82')](/"(.*?)"/);return _0x4b2447?_0x4b2447[0x1]:_0x10bd63;};exports[_0xb7ff('0x83')]=function(_0x5cc5dd){var _0x2b06b2=_0x5cc5dd[_0xb7ff('0x82')](/<(.*?)>/);return _0x2b06b2?_0x2b06b2[0x1]:_0x5cc5dd;};function buildNoAnswerEventPayload(_0x5bdf02,_0x17b9e1){var _0x136811=buildObj(_0x5bdf02,'noanswer');if(!_[_0xb7ff('0x12')](_0x17b9e1[_0xb7ff('0x84')])){Object['keys'](_0x17b9e1['variables'])[_0xb7ff('0x85')](function(_0x1e8678){_0x136811[_0x1e8678[_0xb7ff('0x86')]()]=_0x17b9e1[_0xb7ff('0x84')][_0x1e8678];});}return _0x136811;}exports[_0xb7ff('0x87')]=buildNoAnswerEventPayload; \ No newline at end of file diff --git a/server/services/ami/properties.js b/server/services/ami/properties.js index 119aa11..8e9d5f0 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 _0x6c4c=['boolean','reload','voicequeuechannel','voicequeuechannelhangup','voicequeuechannelredirect','string','number','queueremove','queuepause'];(function(_0x1f3aec,_0x24c18e){var _0x409f0d=function(_0x52b818){while(--_0x52b818){_0x1f3aec['push'](_0x1f3aec['shift']());}};_0x409f0d(++_0x24c18e);}(_0x6c4c,0x7a));var _0xc6c4=function(_0x4d935e,_0x1a9d41){_0x4d935e=_0x4d935e-0x0;var _0x3a6e8f=_0x6c4c[_0x4d935e];return _0x3a6e8f;};'use strict';exports['queueadd']={'queue':{'type':_0xc6c4('0x0'),'required':!![]},'interface':{'type':'string','required':!![]},'membername':{'type':_0xc6c4('0x0'),'required':!![]},'penalty':{'type':_0xc6c4('0x1'),'required':![]},'paused':{'type':'boolean','required':![]}};exports[_0xc6c4('0x2')]={'queue':{'type':_0xc6c4('0x0'),'required':!![]},'interface':{'type':_0xc6c4('0x0'),'required':!![]}};exports[_0xc6c4('0x3')]={'interface':{'type':_0xc6c4('0x0'),'required':!![]},'paused':{'type':_0xc6c4('0x4')},'reason':{'type':_0xc6c4('0x0'),'required':![]}};exports[_0xc6c4('0x5')]={'module':{'type':_0xc6c4('0x0'),'required':![]}};exports[_0xc6c4('0x6')]={'uniqueid':{'type':_0xc6c4('0x0'),'required':!![]}};exports['voicechannel']={'uniqueid':{'type':'string','required':!![]},'filename':{'type':_0xc6c4('0x0')},'format':{'type':_0xc6c4('0x0')},'mixmonitorid':{'type':_0xc6c4('0x0')}};exports[_0xc6c4('0x7')]={'uniqueid':{'type':'string','required':!![]}};exports[_0xc6c4('0x8')]={'uniqueid':{'type':_0xc6c4('0x0'),'required':!![]},'exten':{'type':_0xc6c4('0x0'),'required':!![]},'context':{'type':_0xc6c4('0x0')}}; \ No newline at end of file +var _0xc785=['voicequeuechannelredirect','queueadd','string','number','boolean','queueremove','reload','voicechannel','voicequeuechannelhangup'];(function(_0x11f557,_0x1db2ea){var _0x82684c=function(_0x4b8e6e){while(--_0x4b8e6e){_0x11f557['push'](_0x11f557['shift']());}};_0x82684c(++_0x1db2ea);}(_0xc785,0x76));var _0x5c78=function(_0x570b41,_0x3092a3){_0x570b41=_0x570b41-0x0;var _0x140f0b=_0xc785[_0x570b41];return _0x140f0b;};'use strict';exports[_0x5c78('0x0')]={'queue':{'type':_0x5c78('0x1'),'required':!![]},'interface':{'type':'string','required':!![]},'membername':{'type':'string','required':!![]},'penalty':{'type':_0x5c78('0x2'),'required':![]},'paused':{'type':_0x5c78('0x3'),'required':![]}};exports[_0x5c78('0x4')]={'queue':{'type':_0x5c78('0x1'),'required':!![]},'interface':{'type':_0x5c78('0x1'),'required':!![]}};exports['queuepause']={'interface':{'type':_0x5c78('0x1'),'required':!![]},'paused':{'type':_0x5c78('0x3')},'reason':{'type':'string','required':![]}};exports[_0x5c78('0x5')]={'module':{'type':'string','required':![]}};exports['voicequeuechannel']={'uniqueid':{'type':'string','required':!![]}};exports[_0x5c78('0x6')]={'uniqueid':{'type':_0x5c78('0x1'),'required':!![]},'filename':{'type':'string'},'format':{'type':_0x5c78('0x1')},'mixmonitorid':{'type':_0x5c78('0x1')}};exports[_0x5c78('0x7')]={'uniqueid':{'type':_0x5c78('0x1'),'required':!![]}};exports[_0x5c78('0x8')]={'uniqueid':{'type':'string','required':!![]},'exten':{'type':_0x5c78('0x1'),'required':!![]},'context':{'type':_0x5c78('0x1')}}; \ No newline at end of file diff --git a/server/services/ami/realtime/index.js b/server/services/ami/realtime/index.js index ffaf58f..d9fb9ca 100644 --- a/server/services/ami/realtime/index.js +++ b/server/services/ami/realtime/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x5f2f=['initCampaignHopperHistory','merge','initFaxAccounts','initVoiceQueues','exports','lodash','moment','util','../model/agent','../model/telephone','../model/trunk','../model/voiceQueue','../model/trigger','../model/voiceExtension','../model/zendeskAccount','../model/salesforceAccount','../model/freshdeskAccount','../model/sugarcrmAccount','../model/zohoAccount','../model/vtigerAccount','../model/servicenowAccount','../model/dynamics365Account','../model/faxAccount','agents','telephones','voiceQueues','templates','outbound','channels','queueChannels','outboundChannels','timers','settings','zendeskAccounts','sugarcrmAccounts','freshdeskAccounts','zohoAccounts','deskAccounts','vtigerAccounts','dynamics365Accounts','freshsalesAccounts','faxAccounts','mapKeys','hasOwnProperty','format','name','isNil','interface','sumHoldTime','sumDuration','sumBillable','isEmpty','ivrTotalCallsDays','ivrAnswerCallsDay','total','answered','unmanaged','outboundAnswerAgiCallsDay','outboundCongestionCallsDay','outboundNoSuchCallsDay','outboundUnknownCallsDay','outboundDropCallsDayTimeout','outboundDropCallsDayCallersExit','outboundRejectCallsDay','queueStatusComplete','prototype','mergeFromDatabase','length','isUndefined','initTelephones','SIP/%s','trunks','initTriggers','triggers','initTemplates','initZendeskAccounts','initSalesforceAccounts','salesforceAccounts','initFreshdeskAccounts','initDeskAccounts','initSugarcrmAccounts','initVtigerAccounts','initServicenowAccounts','servicenowAccounts','initDynamics365Accounts','initFreshsalesAccounts','initVoiceQueueHopperHistory','initVoiceQueueReports','groupBy','uniqueid','queue','queuecallerexit','abandoned','queuecallerleaveAt','diff','seconds','queuecallercompleteAt','queuecallerexitAt','queuecallercomplete','initVoiceCallReports','duration','disposition','ANSWERED','billableseconds','initCampaigns','campaigns','dialQueueProject','SquareProject','initVoiceExtensions','voiceExtensions'];(function(_0x39fd8f,_0x5ca4f9){var _0x5d9e16=function(_0x4816e2){while(--_0x4816e2){_0x39fd8f['push'](_0x39fd8f['shift']());}};_0x5d9e16(++_0x5ca4f9);}(_0x5f2f,0x73));var _0xf5f2=function(_0x4c060b,_0x4c5e75){_0x4c060b=_0x4c060b-0x0;var _0x5b9790=_0x5f2f[_0x4c060b];return _0x5b9790;};'use strict';var _=require(_0xf5f2('0x0'));var moment=require(_0xf5f2('0x1'));var util=require(_0xf5f2('0x2'));var Agent=require(_0xf5f2('0x3'));var Telephone=require(_0xf5f2('0x4'));var Trunk=require(_0xf5f2('0x5'));var VoiceQueue=require(_0xf5f2('0x6'));var Trigger=require(_0xf5f2('0x7'));var Template=require('../model/template');var Campaign=require('../model/campaign');var VoiceExtension=require(_0xf5f2('0x8'));var ZendeskAccount=require(_0xf5f2('0x9'));var SalesforceAccount=require(_0xf5f2('0xa'));var FreshdeskAccount=require(_0xf5f2('0xb'));var SugarcrmAccount=require(_0xf5f2('0xc'));var ZohoAccount=require(_0xf5f2('0xd'));var DeskAccount=require('../model/deskAccount');var VtigerAccount=require(_0xf5f2('0xe'));var ServicenowAccount=require(_0xf5f2('0xf'));var Dynamics365Account=require(_0xf5f2('0x10'));var FreshsalesAccount=require('../model/freshsalesAccount');var FaxAccount=require(_0xf5f2('0x11'));function Realtime(){this[_0xf5f2('0x12')]={};this[_0xf5f2('0x13')]={};this['trunks']={};this[_0xf5f2('0x14')]={};this['triggers']={};this['campaigns']={};this[_0xf5f2('0x15')]={};this[_0xf5f2('0x16')]={'total':0x0,'answered':0x0,'sumHoldTime':0x0,'sumDuration':0x0,'sumBillable':0x0};this['voiceExtensions']={};this[_0xf5f2('0x17')]={};this[_0xf5f2('0x18')]={};this[_0xf5f2('0x19')]={};this[_0xf5f2('0x1a')]={};this[_0xf5f2('0x1b')]={};this[_0xf5f2('0x1c')]={};this['salesforceAccounts']={};this[_0xf5f2('0x1d')]={};this[_0xf5f2('0x1e')]={};this[_0xf5f2('0x1f')]={};this[_0xf5f2('0x20')]={};this[_0xf5f2('0x21')]={};this['servicenowAccounts']={};this[_0xf5f2('0x22')]={};this[_0xf5f2('0x23')]={};this[_0xf5f2('0x24')]={};}function freeIsNotKey(_0x1b6dd2,_0x23e23a,_0x3a9dbb){var _0xdb61b3=_[_0xf5f2('0x25')](_0x1b6dd2,function(_0x11f702){return _0x11f702[_0x3a9dbb];});for(var _0x228ace in _0x23e23a){if(_0x23e23a[_0xf5f2('0x26')](_0x228ace)){if(!_0xdb61b3[_0x228ace]){delete _0x23e23a[_0x228ace];}}}}function freeIsNotKeySip(_0x28e097,_0x4ff59b){var _0x3ee69=_[_0xf5f2('0x25')](_0x28e097,function(_0x626999){return util[_0xf5f2('0x27')]('SIP/%s',_0x626999[_0xf5f2('0x28')]);});for(var _0x47101e in _0x4ff59b){if(_0x4ff59b['hasOwnProperty'](_0x47101e)){if(!_0x3ee69[_0x47101e]){delete _0x4ff59b[_0x47101e];}}}}function freeIsNotKeyAgent(_0x47acfc,_0x2d2805){var _0x388e6c=_['mapKeys'](_0x47acfc,function(_0x45b74f){var _0x170042=_[_0xf5f2('0x29')](_0x45b74f[_0xf5f2('0x2a')])?util[_0xf5f2('0x27')]('SIP/%s',_0x45b74f[_0xf5f2('0x28')]):_0x45b74f[_0xf5f2('0x2a')];return _0x170042;});for(var _0x4e8bda in _0x2d2805){if(_0x2d2805[_0xf5f2('0x26')](_0x4e8bda)){if(!_0x388e6c[_0x4e8bda]){delete _0x2d2805[_0x4e8bda];}}}}function clearVoiceCallReports(_0x287ad5){_0x287ad5['total']=0x0;_0x287ad5['answered']=0x0;_0x287ad5[_0xf5f2('0x2b')]=0x0;_0x287ad5[_0xf5f2('0x2c')]=0x0;_0x287ad5[_0xf5f2('0x2d')]=0x0;}function clearCampaigns(_0x1a5bb3){if(!_[_0xf5f2('0x2e')](_0x1a5bb3)){for(var _0x788a8d in _0x1a5bb3){if(_0x1a5bb3[_0xf5f2('0x26')](_0x788a8d)){_0x1a5bb3[_0x788a8d][_0xf5f2('0x2f')]=0x0;_0x1a5bb3[_0x788a8d][_0xf5f2('0x30')]=0x0;}}}}function clearVoiceQueues(_0x4ab014){if(!_[_0xf5f2('0x2e')](_0x4ab014)){for(var _0x102449 in _0x4ab014){if(_0x4ab014[_0xf5f2('0x26')](_0x102449)){_0x4ab014[_0x102449][_0xf5f2('0x31')]=0x0;_0x4ab014[_0x102449][_0xf5f2('0x32')]=0x0;_0x4ab014[_0x102449][_0xf5f2('0x33')]=0x0;_0x4ab014[_0x102449]['abandoned']=0x0;_0x4ab014[_0x102449]['sumHoldTime']=0x0;_0x4ab014[_0x102449][_0xf5f2('0x2c')]=0x0;_0x4ab014[_0x102449][_0xf5f2('0x2d')]=0x0;_0x4ab014[_0x102449][_0xf5f2('0x34')]=0x0;_0x4ab014[_0x102449]['outboundNoAnswerCallsDay']=0x0;_0x4ab014[_0x102449]['outboundBusyCallsDay']=0x0;_0x4ab014[_0x102449][_0xf5f2('0x35')]=0x0;_0x4ab014[_0x102449][_0xf5f2('0x36')]=0x0;_0x4ab014[_0x102449][_0xf5f2('0x37')]=0x0;_0x4ab014[_0x102449][_0xf5f2('0x38')]=0x0;_0x4ab014[_0x102449][_0xf5f2('0x39')]=0x0;_0x4ab014[_0x102449]['outboundBlacklistCallsDay']=0x0;_0x4ab014[_0x102449]['outboundOriginateFailureCallsDay']=0x0;_0x4ab014[_0x102449][_0xf5f2('0x3a')]=0x0;_0x4ab014[_0x102449]['outboundReCallsDay']=0x0;_0x4ab014[_0x102449][_0xf5f2('0x34')]=0x0;_0x4ab014[_0x102449]['outboundAnswerCallsDay']=0x0;_0x4ab014[_0x102449][_0xf5f2('0x3b')]=!![];}}}}Realtime[_0xf5f2('0x3c')][_0xf5f2('0x3d')]=function(_0x428770,_0x256bd9){for(var _0x277eee in _0x256bd9){if(_0x428770[_0xf5f2('0x26')](_0x277eee)){_0x428770[_0x277eee]=_0x256bd9[_0x277eee];}}};Realtime[_0xf5f2('0x3c')]['initAgents']=function(){var _0x4149e6=this;return function(_0x43e4ff){if(_0x43e4ff){freeIsNotKeyAgent(_0x43e4ff,_0x4149e6[_0xf5f2('0x12')]);for(var _0x43c77d=0x0,_0x1408b9={};_0x43c77d<_0x43e4ff[_0xf5f2('0x3e')];_0x43c77d+=0x1){_0x1408b9=_0x43e4ff[_0x43c77d];var _0x297c0c=_['isNil'](_0x1408b9[_0xf5f2('0x2a')])?util[_0xf5f2('0x27')]('SIP/%s',_0x1408b9[_0xf5f2('0x28')]):_0x1408b9['interface'];if(_[_0xf5f2('0x3f')](_0x4149e6[_0xf5f2('0x12')][_0x297c0c])){_0x4149e6[_0xf5f2('0x12')][_0x297c0c]=new Agent(_0x1408b9);}else{_0x4149e6[_0xf5f2('0x3d')](_0x4149e6['agents'][_0x297c0c],_0x1408b9);}}}return _0x4149e6['agents'];};};Realtime[_0xf5f2('0x3c')][_0xf5f2('0x40')]=function(){var _0x20eb74=this;return function(_0x4ec8fb){if(_0x4ec8fb){freeIsNotKeySip(_0x4ec8fb,_0x20eb74[_0xf5f2('0x13')]);for(var _0x4f7f80=0x0,_0x9da533={};_0x4f7f80<_0x4ec8fb['length'];_0x4f7f80+=0x1){_0x9da533=_0x4ec8fb[_0x4f7f80];if(_[_0xf5f2('0x3f')](_0x20eb74[_0xf5f2('0x13')][util['format'](_0xf5f2('0x41'),_0x9da533[_0xf5f2('0x28')])])){_0x20eb74[_0xf5f2('0x13')][util[_0xf5f2('0x27')]('SIP/%s',_0x9da533['name'])]=new Telephone(_0x9da533);}else{_0x20eb74[_0xf5f2('0x3d')](_0x20eb74[_0xf5f2('0x13')][util[_0xf5f2('0x27')](_0xf5f2('0x41'),_0x9da533[_0xf5f2('0x28')])],_0x9da533);}}}return _0x20eb74[_0xf5f2('0x13')];};};Realtime[_0xf5f2('0x3c')]['initTrunks']=function(){var _0x110fe5=this;return function(_0x3b4ea6){if(_0x3b4ea6){freeIsNotKeySip(_0x3b4ea6,_0x110fe5['trunks']);for(var _0xc6a1ae=0x0,_0x3f3895={};_0xc6a1ae<_0x3b4ea6[_0xf5f2('0x3e')];_0xc6a1ae+=0x1){_0x3f3895=_0x3b4ea6[_0xc6a1ae];if(_[_0xf5f2('0x3f')](_0x110fe5[_0xf5f2('0x42')][util[_0xf5f2('0x27')](_0xf5f2('0x41'),_0x3f3895[_0xf5f2('0x28')])])){_0x110fe5['trunks'][util[_0xf5f2('0x27')](_0xf5f2('0x41'),_0x3f3895[_0xf5f2('0x28')])]=new Trunk(_0x3f3895);}else{_0x110fe5['mergeFromDatabase'](_0x110fe5['trunks'][util['format'](_0xf5f2('0x41'),_0x3f3895[_0xf5f2('0x28')])],_0x3f3895);}}}return _0x110fe5['trunks'];};};Realtime[_0xf5f2('0x3c')][_0xf5f2('0x43')]=function(){var _0x28e33f=this;return function(_0x31f86c){if(_0x31f86c){freeIsNotKey(_0x31f86c,_0x28e33f[_0xf5f2('0x44')],'id');for(var _0x2b3b1c=0x0,_0x1a6ec1={};_0x2b3b1c<_0x31f86c[_0xf5f2('0x3e')];_0x2b3b1c+=0x1){_0x1a6ec1=_0x31f86c[_0x2b3b1c];if(_[_0xf5f2('0x3f')](_0x28e33f[_0xf5f2('0x44')][_0x1a6ec1['id']])){_0x28e33f[_0xf5f2('0x44')][_0x1a6ec1['id']]=new Trigger(_0x1a6ec1);}else{_0x28e33f[_0xf5f2('0x3d')](_0x28e33f[_0xf5f2('0x44')][_0x1a6ec1['id']],_0x1a6ec1);}}}return _0x28e33f[_0xf5f2('0x44')];};};Realtime['prototype'][_0xf5f2('0x45')]=function(){var _0x578c93=this;return function(_0x3d62c1){if(_0x3d62c1){freeIsNotKey(_0x3d62c1,_0x578c93[_0xf5f2('0x15')],'id');for(var _0x218def=0x0,_0x36a4b0={};_0x218def<_0x3d62c1[_0xf5f2('0x3e')];_0x218def+=0x1){_0x36a4b0=_0x3d62c1[_0x218def];if(_[_0xf5f2('0x3f')](_0x578c93['templates'][_0x36a4b0['id']])){_0x578c93[_0xf5f2('0x15')][_0x36a4b0['id']]=new Template(_0x36a4b0);}else{_0x578c93[_0xf5f2('0x3d')](_0x578c93[_0xf5f2('0x15')][_0x36a4b0['id']],_0x36a4b0);}}}return _0x578c93[_0xf5f2('0x15')];};};Realtime[_0xf5f2('0x3c')][_0xf5f2('0x46')]=function(){var _0xf638ff=this;return function(_0x297f07){if(_0x297f07){freeIsNotKey(_0x297f07,_0xf638ff['zendeskAccounts'],'id');for(var _0x35dece=0x0,_0x33ec29={};_0x35dece<_0x297f07[_0xf5f2('0x3e')];_0x35dece+=0x1){_0x33ec29=_0x297f07[_0x35dece];if(_['isUndefined'](_0xf638ff[_0xf5f2('0x1c')][_0x33ec29['id']])){_0xf638ff[_0xf5f2('0x1c')][_0x33ec29['id']]=new ZendeskAccount(_0x33ec29);}else{_0xf638ff[_0xf5f2('0x3d')](_0xf638ff['zendeskAccounts'][_0x33ec29['id']],_0x33ec29);}}}return _0xf638ff['zendeskAccounts'];};};Realtime[_0xf5f2('0x3c')][_0xf5f2('0x47')]=function(){var _0x5db519=this;return function(_0x14aa81){if(_0x14aa81){freeIsNotKey(_0x14aa81,_0x5db519['salesforceAccounts'],'id');for(var _0x740321=0x0,_0x497eb8={};_0x740321<_0x14aa81[_0xf5f2('0x3e')];_0x740321+=0x1){_0x497eb8=_0x14aa81[_0x740321];if(_['isUndefined'](_0x5db519[_0xf5f2('0x48')][_0x497eb8['id']])){_0x5db519[_0xf5f2('0x48')][_0x497eb8['id']]=new SalesforceAccount(_0x497eb8);}else{_0x5db519[_0xf5f2('0x3d')](_0x5db519[_0xf5f2('0x48')][_0x497eb8['id']],_0x497eb8);}}}return _0x5db519['salesforceAccounts'];};};Realtime[_0xf5f2('0x3c')][_0xf5f2('0x49')]=function(){var _0x4f6b01=this;return function(_0x58213b){if(_0x58213b){freeIsNotKey(_0x58213b,_0x4f6b01[_0xf5f2('0x1e')],'id');for(var _0x3dc0c4=0x0,_0x57782c={};_0x3dc0c4<_0x58213b[_0xf5f2('0x3e')];_0x3dc0c4+=0x1){_0x57782c=_0x58213b[_0x3dc0c4];if(_[_0xf5f2('0x3f')](_0x4f6b01[_0xf5f2('0x1e')][_0x57782c['id']])){_0x4f6b01[_0xf5f2('0x1e')][_0x57782c['id']]=new FreshdeskAccount(_0x57782c);}else{_0x4f6b01['mergeFromDatabase'](_0x4f6b01['freshdeskAccounts'][_0x57782c['id']],_0x57782c);}}}return _0x4f6b01[_0xf5f2('0x1e')];};};Realtime[_0xf5f2('0x3c')]['initZohoAccounts']=function(){var _0x40eef=this;return function(_0x43fc49){if(_0x43fc49){freeIsNotKey(_0x43fc49,_0x40eef[_0xf5f2('0x1f')],'id');for(var _0x14029e=0x0,_0x2b038e={};_0x14029e<_0x43fc49[_0xf5f2('0x3e')];_0x14029e+=0x1){_0x2b038e=_0x43fc49[_0x14029e];if(_[_0xf5f2('0x3f')](_0x40eef['zohoAccounts'][_0x2b038e['id']])){_0x40eef['zohoAccounts'][_0x2b038e['id']]=new ZohoAccount(_0x2b038e);}else{_0x40eef[_0xf5f2('0x3d')](_0x40eef[_0xf5f2('0x1f')][_0x2b038e['id']],_0x2b038e);}}}return _0x40eef[_0xf5f2('0x1f')];};};Realtime[_0xf5f2('0x3c')][_0xf5f2('0x4a')]=function(){var _0x5a861d=this;return function(_0xdb1106){if(_0xdb1106){freeIsNotKey(_0xdb1106,_0x5a861d[_0xf5f2('0x20')],'id');for(var _0x18b124=0x0,_0x519c24={};_0x18b124<_0xdb1106[_0xf5f2('0x3e')];_0x18b124+=0x1){_0x519c24=_0xdb1106[_0x18b124];if(_['isUndefined'](_0x5a861d[_0xf5f2('0x20')][_0x519c24['id']])){_0x5a861d[_0xf5f2('0x20')][_0x519c24['id']]=new DeskAccount(_0x519c24);}else{_0x5a861d[_0xf5f2('0x3d')](_0x5a861d[_0xf5f2('0x20')][_0x519c24['id']],_0x519c24);}}}return _0x5a861d['deskAccounts'];};};Realtime['prototype'][_0xf5f2('0x4b')]=function(){var _0x4de303=this;return function(_0xa39c65){if(_0xa39c65){freeIsNotKey(_0xa39c65,_0x4de303[_0xf5f2('0x1d')],'id');for(var _0x572ec1=0x0,_0x3f0579={};_0x572ec1<_0xa39c65[_0xf5f2('0x3e')];_0x572ec1+=0x1){_0x3f0579=_0xa39c65[_0x572ec1];if(_[_0xf5f2('0x3f')](_0x4de303['sugarcrmAccounts'][_0x3f0579['id']])){_0x4de303[_0xf5f2('0x1d')][_0x3f0579['id']]=new SugarcrmAccount(_0x3f0579);}else{_0x4de303[_0xf5f2('0x3d')](_0x4de303[_0xf5f2('0x1d')][_0x3f0579['id']],_0x3f0579);}}}return _0x4de303[_0xf5f2('0x1d')];};};Realtime['prototype'][_0xf5f2('0x4c')]=function(){var _0x506fe5=this;return function(_0x2cbe1e){if(_0x2cbe1e){freeIsNotKey(_0x2cbe1e,_0x506fe5[_0xf5f2('0x21')],'id');for(var _0x2e6f5d=0x0,_0x380c08={};_0x2e6f5d<_0x2cbe1e[_0xf5f2('0x3e')];_0x2e6f5d+=0x1){_0x380c08=_0x2cbe1e[_0x2e6f5d];if(_['isUndefined'](_0x506fe5[_0xf5f2('0x21')][_0x380c08['id']])){_0x506fe5[_0xf5f2('0x21')][_0x380c08['id']]=new VtigerAccount(_0x380c08);}else{_0x506fe5[_0xf5f2('0x3d')](_0x506fe5[_0xf5f2('0x21')][_0x380c08['id']],_0x380c08);}}}return _0x506fe5[_0xf5f2('0x21')];};};Realtime['prototype'][_0xf5f2('0x4d')]=function(){var _0x5ee6bc=this;return function(_0x4c96ee){if(_0x4c96ee){freeIsNotKey(_0x4c96ee,_0x5ee6bc[_0xf5f2('0x4e')],'id');for(var _0x4802c5=0x0,_0x10f2b8={};_0x4802c5<_0x4c96ee[_0xf5f2('0x3e')];_0x4802c5+=0x1){_0x10f2b8=_0x4c96ee[_0x4802c5];if(_[_0xf5f2('0x3f')](_0x5ee6bc[_0xf5f2('0x4e')][_0x10f2b8['id']])){_0x5ee6bc['servicenowAccounts'][_0x10f2b8['id']]=new ServicenowAccount(_0x10f2b8);}else{_0x5ee6bc[_0xf5f2('0x3d')](_0x5ee6bc[_0xf5f2('0x4e')][_0x10f2b8['id']],_0x10f2b8);}}}return _0x5ee6bc[_0xf5f2('0x4e')];};};Realtime[_0xf5f2('0x3c')][_0xf5f2('0x4f')]=function(){var _0x35d868=this;return function(_0x158768){if(_0x158768){freeIsNotKey(_0x158768,_0x35d868['dynamics365Accounts'],'id');for(var _0x1f55af=0x0,_0x2d171d={};_0x1f55af<_0x158768[_0xf5f2('0x3e')];_0x1f55af+=0x1){_0x2d171d=_0x158768[_0x1f55af];if(_[_0xf5f2('0x3f')](_0x35d868['dynamics365Accounts'][_0x2d171d['id']])){_0x35d868[_0xf5f2('0x22')][_0x2d171d['id']]=new Dynamics365Account(_0x2d171d);}else{_0x35d868['mergeFromDatabase'](_0x35d868[_0xf5f2('0x22')][_0x2d171d['id']],_0x2d171d);}}}return _0x35d868[_0xf5f2('0x22')];};};Realtime['prototype'][_0xf5f2('0x50')]=function(){var _0x975bd8=this;return function(_0xa0c139){if(_0xa0c139){freeIsNotKey(_0xa0c139,_0x975bd8[_0xf5f2('0x23')],'id');for(var _0x146462=0x0,_0x4bd113={};_0x146462<_0xa0c139[_0xf5f2('0x3e')];_0x146462+=0x1){_0x4bd113=_0xa0c139[_0x146462];if(_[_0xf5f2('0x3f')](_0x975bd8[_0xf5f2('0x23')][_0x4bd113['id']])){_0x975bd8[_0xf5f2('0x23')][_0x4bd113['id']]=new FreshsalesAccount(_0x4bd113);}else{_0x975bd8[_0xf5f2('0x3d')](_0x975bd8[_0xf5f2('0x23')][_0x4bd113['id']],_0x4bd113);}}}return _0x975bd8['freshsalesAccounts'];};};Realtime[_0xf5f2('0x3c')][_0xf5f2('0x51')]=function(){var _0x4800fe=this;return function(_0x3f677e){for(var _0x36503c=0x0;_0x36503c<_0x3f677e[_0xf5f2('0x3e')];_0x36503c+=0x1){_['merge'](_0x4800fe['voiceQueues'][_0x3f677e[_0x36503c]['name']],_0x3f677e[_0x36503c]);}return _0x4800fe[_0xf5f2('0x14')];};};Realtime[_0xf5f2('0x3c')][_0xf5f2('0x52')]=function(){var _0x450691=this;return function(_0x55da4d){clearVoiceQueues(_0x450691['voiceQueues']);if(_0x55da4d){_0x55da4d=_[_0xf5f2('0x53')](_0x55da4d,_0xf5f2('0x54'));for(var _0xc10cf3 in _0x55da4d){if(_0x55da4d[_0xf5f2('0x26')](_0xc10cf3)){for(var _0x794e0c=0x0;_0x794e0c<_0x55da4d[_0xc10cf3][_0xf5f2('0x3e')];_0x794e0c+=0x1){var _0x11c302=_0x55da4d[_0xc10cf3][_0x794e0c][_0xf5f2('0x55')];if(_0x450691[_0xf5f2('0x14')][_0x11c302]){if(_0x55da4d[_0xc10cf3][_0x794e0c][_0xf5f2('0x56')]){_0x450691[_0xf5f2('0x14')][_0x11c302]['unmanaged']+=0x1;}if(_0x55da4d[_0xc10cf3][_0x794e0c]['queuecallerabandon']){_0x450691['voiceQueues'][_0x11c302][_0xf5f2('0x57')]+=0x1;}_0x450691[_0xf5f2('0x14')][_0x11c302][_0xf5f2('0x2b')]+=moment(_0x55da4d[_0xc10cf3][_0x794e0c][_0xf5f2('0x58')])[_0xf5f2('0x59')](moment(_0x55da4d[_0xc10cf3][_0x794e0c]['queuecallerjoinAt']),_0xf5f2('0x5a'))||0x0;if(_0x794e0c===_0x55da4d[_0xc10cf3][_0xf5f2('0x3e')]-0x1){_0x450691[_0xf5f2('0x14')][_0x11c302][_0xf5f2('0x2c')]+=moment(_0x55da4d[_0xc10cf3][_0x794e0c][_0xf5f2('0x5b')]||_0x55da4d[_0xc10cf3][_0x794e0c]['queuecallerabandonAt']||_0x55da4d[_0xc10cf3][_0x794e0c][_0xf5f2('0x5c')])[_0xf5f2('0x59')](moment(_0x55da4d[_0xc10cf3][_0x794e0c]['queuecallerjoinAt']),_0xf5f2('0x5a'))||0x0;_0x450691[_0xf5f2('0x14')][_0x11c302][_0xf5f2('0x31')]+=0x1;if(_0x55da4d[_0xc10cf3][_0x794e0c][_0xf5f2('0x5d')]){_0x450691['voiceQueues'][_0x11c302][_0xf5f2('0x32')]+=0x1;_0x450691[_0xf5f2('0x14')][_0x11c302][_0xf5f2('0x2d')]+=moment(_0x55da4d[_0xc10cf3][_0x794e0c][_0xf5f2('0x5b')])[_0xf5f2('0x59')](moment(_0x55da4d[_0xc10cf3][_0x794e0c]['queuecallerleaveAt']),'seconds')||0x0;}}else{_0x450691[_0xf5f2('0x14')][_0x11c302][_0xf5f2('0x2c')]+=_0x450691[_0xf5f2('0x14')][_0x11c302][_0xf5f2('0x2b')]||0x0;}}}}}}return _0x450691['voiceQueues'];};};Realtime['prototype'][_0xf5f2('0x5e')]=function(){var _0x4f2fcc=this;return function(_0x4c4420){clearVoiceCallReports(_0x4f2fcc['outbound']);if(_0x4c4420){for(var _0x57cb18=0x0;_0x57cb18<_0x4c4420[_0xf5f2('0x3e')];_0x57cb18+=0x1){_0x4f2fcc[_0xf5f2('0x16')][_0xf5f2('0x31')]+=0x1;_0x4f2fcc[_0xf5f2('0x16')][_0xf5f2('0x2c')]+=_0x4c4420[_0x57cb18][_0xf5f2('0x5f')];if(_0x4c4420[_0x57cb18][_0xf5f2('0x60')]===_0xf5f2('0x61')){_0x4f2fcc[_0xf5f2('0x16')][_0xf5f2('0x32')]+=0x1;_0x4f2fcc[_0xf5f2('0x16')][_0xf5f2('0x2b')]+=_0x4c4420[_0x57cb18][_0xf5f2('0x5f')]-_0x4c4420[_0x57cb18][_0xf5f2('0x62')]||0x0;_0x4f2fcc[_0xf5f2('0x16')][_0xf5f2('0x2d')]+=_0x4c4420[_0x57cb18][_0xf5f2('0x62')];}}}return _0x4f2fcc[_0xf5f2('0x16')];};};Realtime['prototype'][_0xf5f2('0x63')]=function(){var _0x35299d=this;return function(_0x21043b){if(_0x21043b){freeIsNotKey(_0x21043b,_0x35299d[_0xf5f2('0x64')],_0xf5f2('0x28'));for(var _0x308220=0x0,_0x16491c={};_0x308220<_0x21043b[_0xf5f2('0x3e')];_0x308220+=0x1){_0x16491c=_0x21043b[_0x308220];if(_['isUndefined'](_0x35299d[_0xf5f2('0x64')][_0x16491c['name']])){_0x35299d['campaigns'][_0x16491c['name']]=new Campaign(_0x16491c);}else{_0x35299d['mergeFromDatabase'](_0x35299d['campaigns'][_0x16491c['name']],_0x16491c);_0x35299d[_0xf5f2('0x64')][_0x16491c[_0xf5f2('0x28')]][_0xf5f2('0x65')]=_0x16491c[_0xf5f2('0x66')]?_0x16491c[_0xf5f2('0x66')][_0xf5f2('0x28')]:undefined;}}}return _0x35299d['campaigns'];};};Realtime['prototype'][_0xf5f2('0x67')]=function(){var _0x578a22=this;return function(_0x418ece){if(_0x418ece){freeIsNotKey(_0x418ece,_0x578a22[_0xf5f2('0x68')],'id');for(var _0x59161c=0x0,_0x4f3ad4={};_0x59161c<_0x418ece[_0xf5f2('0x3e')];_0x59161c+=0x1){_0x4f3ad4=_0x418ece[_0x59161c];if(_[_0xf5f2('0x3f')](_0x578a22['voiceExtensions'][_0x4f3ad4['id']])){_0x578a22[_0xf5f2('0x68')][_0x4f3ad4['id']]=new VoiceExtension(_0x4f3ad4);}else{_0x578a22[_0xf5f2('0x3d')](_0x578a22['voiceExtensions'][_0x4f3ad4['id']],_0x4f3ad4);}}}return _0x578a22[_0xf5f2('0x68')];};};Realtime[_0xf5f2('0x3c')][_0xf5f2('0x69')]=function(){var _0x4c1678=this;return function(_0x33e9ad){clearCampaigns(_0x4c1678[_0xf5f2('0x64')]);for(var _0x14db86=0x0;_0x14db86<_0x33e9ad[_0xf5f2('0x3e')];_0x14db86+=0x1){_[_0xf5f2('0x6a')](_0x4c1678[_0xf5f2('0x64')][_0x33e9ad[_0x14db86][_0xf5f2('0x28')]],_0x33e9ad[_0x14db86]);}return _0x4c1678[_0xf5f2('0x64')];};};Realtime[_0xf5f2('0x3c')][_0xf5f2('0x6b')]=function(){var _0x191af3=this;return function(_0x2601aa){if(_0x2601aa){freeIsNotKey(_0x2601aa,_0x191af3[_0xf5f2('0x24')],'id');for(var _0x407dd8=0x0,_0xe900ea={};_0x407dd8<_0x2601aa[_0xf5f2('0x3e')];_0x407dd8+=0x1){_0xe900ea=_0x2601aa[_0x407dd8];if(_[_0xf5f2('0x3f')](_0x191af3[_0xf5f2('0x24')][_0xe900ea['id']])){_0x191af3[_0xf5f2('0x24')][_0xe900ea['id']]=new FaxAccount(_0xe900ea);}else{_0x191af3[_0xf5f2('0x3d')](_0x191af3[_0xf5f2('0x24')][_0xe900ea['id']],_0xe900ea);}}}return _0x191af3['faxAccounts'];};};Realtime[_0xf5f2('0x3c')][_0xf5f2('0x6c')]=function(){var _0x5d6c6e=this;return function(_0x2e49ce){if(_0x2e49ce){freeIsNotKey(_0x2e49ce,_0x5d6c6e[_0xf5f2('0x14')],'name');for(var _0xb56304=0x0,_0x2f54eb={};_0xb56304<_0x2e49ce[_0xf5f2('0x3e')];_0xb56304+=0x1){_0x2f54eb=_0x2e49ce[_0xb56304];if(_['isUndefined'](_0x5d6c6e['voiceQueues'][_0x2f54eb[_0xf5f2('0x28')]])){_0x5d6c6e[_0xf5f2('0x14')][_0x2f54eb[_0xf5f2('0x28')]]=new VoiceQueue(_0x2f54eb);}else{_0x5d6c6e['mergeFromDatabase'](_0x5d6c6e['voiceQueues'][_0x2f54eb[_0xf5f2('0x28')]],_0x2f54eb);}}}return _0x5d6c6e[_0xf5f2('0x14')];};};module[_0xf5f2('0x6d')]=Realtime; \ No newline at end of file +var _0x2032=['voiceExtensions','initCampaignHopperHistory','merge','initFaxAccounts','exports','moment','util','../model/agent','../model/trunk','../model/voiceQueue','../model/template','../model/campaign','../model/voiceExtension','../model/zendeskAccount','../model/salesforceAccount','../model/freshdeskAccount','../model/sugarcrmAccount','../model/zohoAccount','../model/deskAccount','../model/vtigerAccount','../model/servicenowAccount','../model/faxAccount','telephones','trunks','voiceQueues','campaigns','outbound','channels','queueChannels','sugarcrmAccounts','deskAccounts','vtigerAccounts','servicenowAccounts','dynamics365Accounts','freshsalesAccounts','faxAccounts','mapKeys','format','SIP/%s','name','hasOwnProperty','interface','total','answered','sumHoldTime','sumDuration','sumBillable','ivrTotalCallsDays','isEmpty','unmanaged','abandoned','outboundAnswerAgiCallsDay','outboundNoAnswerCallsDay','outboundBusyCallsDay','outboundCongestionCallsDay','outboundUnknownCallsDay','outboundDropCallsDayTimeout','outboundDropCallsDayCallersExit','outboundBlacklistCallsDay','outboundRejectCallsDay','outboundReCallsDay','queueStatusComplete','prototype','length','isNil','isUndefined','agents','initTelephones','initTrunks','mergeFromDatabase','initTriggers','triggers','initTemplates','templates','initZendeskAccounts','zendeskAccounts','initSalesforceAccounts','salesforceAccounts','initFreshdeskAccounts','freshdeskAccounts','initZohoAccounts','zohoAccounts','initDeskAccounts','initVtigerAccounts','initServicenowAccounts','initDynamics365Accounts','initFreshsalesAccounts','initVoiceQueueHopperHistory','initVoiceQueueReports','queue','queuecallerexit','queuecallerabandon','queuecallerleaveAt','diff','queuecallerjoinAt','seconds','queuecallercompleteAt','queuecallerexitAt','queuecallercomplete','initVoiceCallReports','duration','ANSWERED','billableseconds','initCampaigns','dialQueueProject','SquareProject'];(function(_0x501510,_0x61caa9){var _0x1e6ee5=function(_0x32845b){while(--_0x32845b){_0x501510['push'](_0x501510['shift']());}};_0x1e6ee5(++_0x61caa9);}(_0x2032,0xd9));var _0x2203=function(_0x53eb1f,_0x905696){_0x53eb1f=_0x53eb1f-0x0;var _0x57b092=_0x2032[_0x53eb1f];return _0x57b092;};'use strict';var _=require('lodash');var moment=require(_0x2203('0x0'));var util=require(_0x2203('0x1'));var Agent=require(_0x2203('0x2'));var Telephone=require('../model/telephone');var Trunk=require(_0x2203('0x3'));var VoiceQueue=require(_0x2203('0x4'));var Trigger=require('../model/trigger');var Template=require(_0x2203('0x5'));var Campaign=require(_0x2203('0x6'));var VoiceExtension=require(_0x2203('0x7'));var ZendeskAccount=require(_0x2203('0x8'));var SalesforceAccount=require(_0x2203('0x9'));var FreshdeskAccount=require(_0x2203('0xa'));var SugarcrmAccount=require(_0x2203('0xb'));var ZohoAccount=require(_0x2203('0xc'));var DeskAccount=require(_0x2203('0xd'));var VtigerAccount=require(_0x2203('0xe'));var ServicenowAccount=require(_0x2203('0xf'));var Dynamics365Account=require('../model/dynamics365Account');var FreshsalesAccount=require('../model/freshsalesAccount');var FaxAccount=require(_0x2203('0x10'));function Realtime(){this['agents']={};this[_0x2203('0x11')]={};this[_0x2203('0x12')]={};this[_0x2203('0x13')]={};this['triggers']={};this[_0x2203('0x14')]={};this['templates']={};this[_0x2203('0x15')]={'total':0x0,'answered':0x0,'sumHoldTime':0x0,'sumDuration':0x0,'sumBillable':0x0};this['voiceExtensions']={};this[_0x2203('0x16')]={};this[_0x2203('0x17')]={};this['outboundChannels']={};this['timers']={};this['settings']={};this['zendeskAccounts']={};this['salesforceAccounts']={};this[_0x2203('0x18')]={};this['freshdeskAccounts']={};this['zohoAccounts']={};this[_0x2203('0x19')]={};this[_0x2203('0x1a')]={};this[_0x2203('0x1b')]={};this[_0x2203('0x1c')]={};this[_0x2203('0x1d')]={};this[_0x2203('0x1e')]={};}function freeIsNotKey(_0x2c36e6,_0x2c085c,_0xdf9d0b){var _0x3053f3=_['mapKeys'](_0x2c36e6,function(_0x280eda){return _0x280eda[_0xdf9d0b];});for(var _0x2ee127 in _0x2c085c){if(_0x2c085c['hasOwnProperty'](_0x2ee127)){if(!_0x3053f3[_0x2ee127]){delete _0x2c085c[_0x2ee127];}}}}function freeIsNotKeySip(_0x3f9ef6,_0x8906e1){var _0x4aeb9f=_[_0x2203('0x1f')](_0x3f9ef6,function(_0x5ee83c){return util[_0x2203('0x20')](_0x2203('0x21'),_0x5ee83c[_0x2203('0x22')]);});for(var _0x3b4034 in _0x8906e1){if(_0x8906e1[_0x2203('0x23')](_0x3b4034)){if(!_0x4aeb9f[_0x3b4034]){delete _0x8906e1[_0x3b4034];}}}}function freeIsNotKeyAgent(_0x449039,_0x538c23){var _0x13d3f7=_['mapKeys'](_0x449039,function(_0x5ac866){var _0x15f543=_['isNil'](_0x5ac866[_0x2203('0x24')])?util[_0x2203('0x20')]('SIP/%s',_0x5ac866[_0x2203('0x22')]):_0x5ac866['interface'];return _0x15f543;});for(var _0x5c8da9 in _0x538c23){if(_0x538c23[_0x2203('0x23')](_0x5c8da9)){if(!_0x13d3f7[_0x5c8da9]){delete _0x538c23[_0x5c8da9];}}}}function clearVoiceCallReports(_0x2718f5){_0x2718f5[_0x2203('0x25')]=0x0;_0x2718f5[_0x2203('0x26')]=0x0;_0x2718f5[_0x2203('0x27')]=0x0;_0x2718f5[_0x2203('0x28')]=0x0;_0x2718f5[_0x2203('0x29')]=0x0;}function clearCampaigns(_0x250349){if(!_['isEmpty'](_0x250349)){for(var _0x143f41 in _0x250349){if(_0x250349[_0x2203('0x23')](_0x143f41)){_0x250349[_0x143f41][_0x2203('0x2a')]=0x0;_0x250349[_0x143f41]['ivrAnswerCallsDay']=0x0;}}}}function clearVoiceQueues(_0xb2071b){if(!_[_0x2203('0x2b')](_0xb2071b)){for(var _0x5c5fd3 in _0xb2071b){if(_0xb2071b[_0x2203('0x23')](_0x5c5fd3)){_0xb2071b[_0x5c5fd3][_0x2203('0x25')]=0x0;_0xb2071b[_0x5c5fd3][_0x2203('0x26')]=0x0;_0xb2071b[_0x5c5fd3][_0x2203('0x2c')]=0x0;_0xb2071b[_0x5c5fd3][_0x2203('0x2d')]=0x0;_0xb2071b[_0x5c5fd3][_0x2203('0x27')]=0x0;_0xb2071b[_0x5c5fd3][_0x2203('0x28')]=0x0;_0xb2071b[_0x5c5fd3]['sumBillable']=0x0;_0xb2071b[_0x5c5fd3][_0x2203('0x2e')]=0x0;_0xb2071b[_0x5c5fd3][_0x2203('0x2f')]=0x0;_0xb2071b[_0x5c5fd3][_0x2203('0x30')]=0x0;_0xb2071b[_0x5c5fd3][_0x2203('0x31')]=0x0;_0xb2071b[_0x5c5fd3]['outboundNoSuchCallsDay']=0x0;_0xb2071b[_0x5c5fd3][_0x2203('0x32')]=0x0;_0xb2071b[_0x5c5fd3][_0x2203('0x33')]=0x0;_0xb2071b[_0x5c5fd3][_0x2203('0x34')]=0x0;_0xb2071b[_0x5c5fd3][_0x2203('0x35')]=0x0;_0xb2071b[_0x5c5fd3]['outboundOriginateFailureCallsDay']=0x0;_0xb2071b[_0x5c5fd3][_0x2203('0x36')]=0x0;_0xb2071b[_0x5c5fd3][_0x2203('0x37')]=0x0;_0xb2071b[_0x5c5fd3]['outboundAnswerAgiCallsDay']=0x0;_0xb2071b[_0x5c5fd3]['outboundAnswerCallsDay']=0x0;_0xb2071b[_0x5c5fd3][_0x2203('0x38')]=!![];}}}}Realtime['prototype']['mergeFromDatabase']=function(_0x125dfc,_0x464c88){for(var _0x191894 in _0x464c88){if(_0x125dfc[_0x2203('0x23')](_0x191894)){_0x125dfc[_0x191894]=_0x464c88[_0x191894];}}};Realtime[_0x2203('0x39')]['initAgents']=function(){var _0xb22e28=this;return function(_0x2324c0){if(_0x2324c0){freeIsNotKeyAgent(_0x2324c0,_0xb22e28['agents']);for(var _0x2a2ee7=0x0,_0x20fbe1={};_0x2a2ee7<_0x2324c0[_0x2203('0x3a')];_0x2a2ee7+=0x1){_0x20fbe1=_0x2324c0[_0x2a2ee7];var _0x4187b4=_[_0x2203('0x3b')](_0x20fbe1[_0x2203('0x24')])?util[_0x2203('0x20')](_0x2203('0x21'),_0x20fbe1[_0x2203('0x22')]):_0x20fbe1['interface'];if(_[_0x2203('0x3c')](_0xb22e28[_0x2203('0x3d')][_0x4187b4])){_0xb22e28['agents'][_0x4187b4]=new Agent(_0x20fbe1);}else{_0xb22e28['mergeFromDatabase'](_0xb22e28[_0x2203('0x3d')][_0x4187b4],_0x20fbe1);}}}return _0xb22e28['agents'];};};Realtime[_0x2203('0x39')][_0x2203('0x3e')]=function(){var _0x127ee3=this;return function(_0x5221f0){if(_0x5221f0){freeIsNotKeySip(_0x5221f0,_0x127ee3['telephones']);for(var _0x34cdeb=0x0,_0x47c93a={};_0x34cdeb<_0x5221f0[_0x2203('0x3a')];_0x34cdeb+=0x1){_0x47c93a=_0x5221f0[_0x34cdeb];if(_['isUndefined'](_0x127ee3[_0x2203('0x11')][util['format'](_0x2203('0x21'),_0x47c93a[_0x2203('0x22')])])){_0x127ee3[_0x2203('0x11')][util[_0x2203('0x20')](_0x2203('0x21'),_0x47c93a['name'])]=new Telephone(_0x47c93a);}else{_0x127ee3['mergeFromDatabase'](_0x127ee3['telephones'][util[_0x2203('0x20')](_0x2203('0x21'),_0x47c93a[_0x2203('0x22')])],_0x47c93a);}}}return _0x127ee3[_0x2203('0x11')];};};Realtime[_0x2203('0x39')][_0x2203('0x3f')]=function(){var _0x1c7e3d=this;return function(_0x590b4e){if(_0x590b4e){freeIsNotKeySip(_0x590b4e,_0x1c7e3d[_0x2203('0x12')]);for(var _0x1b12c3=0x0,_0x108fde={};_0x1b12c3<_0x590b4e[_0x2203('0x3a')];_0x1b12c3+=0x1){_0x108fde=_0x590b4e[_0x1b12c3];if(_['isUndefined'](_0x1c7e3d['trunks'][util[_0x2203('0x20')]('SIP/%s',_0x108fde[_0x2203('0x22')])])){_0x1c7e3d[_0x2203('0x12')][util[_0x2203('0x20')]('SIP/%s',_0x108fde['name'])]=new Trunk(_0x108fde);}else{_0x1c7e3d[_0x2203('0x40')](_0x1c7e3d[_0x2203('0x12')][util[_0x2203('0x20')](_0x2203('0x21'),_0x108fde[_0x2203('0x22')])],_0x108fde);}}}return _0x1c7e3d[_0x2203('0x12')];};};Realtime['prototype'][_0x2203('0x41')]=function(){var _0x165a3f=this;return function(_0x3a866c){if(_0x3a866c){freeIsNotKey(_0x3a866c,_0x165a3f[_0x2203('0x42')],'id');for(var _0x16b452=0x0,_0x36b99f={};_0x16b452<_0x3a866c[_0x2203('0x3a')];_0x16b452+=0x1){_0x36b99f=_0x3a866c[_0x16b452];if(_[_0x2203('0x3c')](_0x165a3f[_0x2203('0x42')][_0x36b99f['id']])){_0x165a3f[_0x2203('0x42')][_0x36b99f['id']]=new Trigger(_0x36b99f);}else{_0x165a3f['mergeFromDatabase'](_0x165a3f[_0x2203('0x42')][_0x36b99f['id']],_0x36b99f);}}}return _0x165a3f[_0x2203('0x42')];};};Realtime[_0x2203('0x39')][_0x2203('0x43')]=function(){var _0x4c3259=this;return function(_0x58bd5c){if(_0x58bd5c){freeIsNotKey(_0x58bd5c,_0x4c3259[_0x2203('0x44')],'id');for(var _0x48129c=0x0,_0x273e5f={};_0x48129c<_0x58bd5c[_0x2203('0x3a')];_0x48129c+=0x1){_0x273e5f=_0x58bd5c[_0x48129c];if(_[_0x2203('0x3c')](_0x4c3259[_0x2203('0x44')][_0x273e5f['id']])){_0x4c3259['templates'][_0x273e5f['id']]=new Template(_0x273e5f);}else{_0x4c3259[_0x2203('0x40')](_0x4c3259[_0x2203('0x44')][_0x273e5f['id']],_0x273e5f);}}}return _0x4c3259['templates'];};};Realtime[_0x2203('0x39')][_0x2203('0x45')]=function(){var _0x35b2e9=this;return function(_0x2600a9){if(_0x2600a9){freeIsNotKey(_0x2600a9,_0x35b2e9['zendeskAccounts'],'id');for(var _0x4c1a29=0x0,_0x21b8ab={};_0x4c1a29<_0x2600a9['length'];_0x4c1a29+=0x1){_0x21b8ab=_0x2600a9[_0x4c1a29];if(_['isUndefined'](_0x35b2e9[_0x2203('0x46')][_0x21b8ab['id']])){_0x35b2e9[_0x2203('0x46')][_0x21b8ab['id']]=new ZendeskAccount(_0x21b8ab);}else{_0x35b2e9[_0x2203('0x40')](_0x35b2e9['zendeskAccounts'][_0x21b8ab['id']],_0x21b8ab);}}}return _0x35b2e9['zendeskAccounts'];};};Realtime[_0x2203('0x39')][_0x2203('0x47')]=function(){var _0x12d7fa=this;return function(_0x21d2d7){if(_0x21d2d7){freeIsNotKey(_0x21d2d7,_0x12d7fa[_0x2203('0x48')],'id');for(var _0x21fd78=0x0,_0x4a7f4e={};_0x21fd78<_0x21d2d7[_0x2203('0x3a')];_0x21fd78+=0x1){_0x4a7f4e=_0x21d2d7[_0x21fd78];if(_['isUndefined'](_0x12d7fa[_0x2203('0x48')][_0x4a7f4e['id']])){_0x12d7fa[_0x2203('0x48')][_0x4a7f4e['id']]=new SalesforceAccount(_0x4a7f4e);}else{_0x12d7fa[_0x2203('0x40')](_0x12d7fa[_0x2203('0x48')][_0x4a7f4e['id']],_0x4a7f4e);}}}return _0x12d7fa['salesforceAccounts'];};};Realtime['prototype'][_0x2203('0x49')]=function(){var _0x1f772d=this;return function(_0x126aad){if(_0x126aad){freeIsNotKey(_0x126aad,_0x1f772d[_0x2203('0x4a')],'id');for(var _0x559370=0x0,_0x4de47a={};_0x559370<_0x126aad['length'];_0x559370+=0x1){_0x4de47a=_0x126aad[_0x559370];if(_[_0x2203('0x3c')](_0x1f772d[_0x2203('0x4a')][_0x4de47a['id']])){_0x1f772d['freshdeskAccounts'][_0x4de47a['id']]=new FreshdeskAccount(_0x4de47a);}else{_0x1f772d[_0x2203('0x40')](_0x1f772d[_0x2203('0x4a')][_0x4de47a['id']],_0x4de47a);}}}return _0x1f772d['freshdeskAccounts'];};};Realtime[_0x2203('0x39')][_0x2203('0x4b')]=function(){var _0x172c6a=this;return function(_0x6a1877){if(_0x6a1877){freeIsNotKey(_0x6a1877,_0x172c6a['zohoAccounts'],'id');for(var _0x120db1=0x0,_0x5268d6={};_0x120db1<_0x6a1877[_0x2203('0x3a')];_0x120db1+=0x1){_0x5268d6=_0x6a1877[_0x120db1];if(_[_0x2203('0x3c')](_0x172c6a['zohoAccounts'][_0x5268d6['id']])){_0x172c6a[_0x2203('0x4c')][_0x5268d6['id']]=new ZohoAccount(_0x5268d6);}else{_0x172c6a[_0x2203('0x40')](_0x172c6a[_0x2203('0x4c')][_0x5268d6['id']],_0x5268d6);}}}return _0x172c6a[_0x2203('0x4c')];};};Realtime[_0x2203('0x39')][_0x2203('0x4d')]=function(){var _0x569d4a=this;return function(_0x562a3d){if(_0x562a3d){freeIsNotKey(_0x562a3d,_0x569d4a[_0x2203('0x19')],'id');for(var _0x524356=0x0,_0x56e881={};_0x524356<_0x562a3d[_0x2203('0x3a')];_0x524356+=0x1){_0x56e881=_0x562a3d[_0x524356];if(_[_0x2203('0x3c')](_0x569d4a[_0x2203('0x19')][_0x56e881['id']])){_0x569d4a['deskAccounts'][_0x56e881['id']]=new DeskAccount(_0x56e881);}else{_0x569d4a[_0x2203('0x40')](_0x569d4a['deskAccounts'][_0x56e881['id']],_0x56e881);}}}return _0x569d4a['deskAccounts'];};};Realtime[_0x2203('0x39')]['initSugarcrmAccounts']=function(){var _0x54ec71=this;return function(_0x5efc59){if(_0x5efc59){freeIsNotKey(_0x5efc59,_0x54ec71[_0x2203('0x18')],'id');for(var _0x31256b=0x0,_0x367122={};_0x31256b<_0x5efc59[_0x2203('0x3a')];_0x31256b+=0x1){_0x367122=_0x5efc59[_0x31256b];if(_[_0x2203('0x3c')](_0x54ec71[_0x2203('0x18')][_0x367122['id']])){_0x54ec71[_0x2203('0x18')][_0x367122['id']]=new SugarcrmAccount(_0x367122);}else{_0x54ec71[_0x2203('0x40')](_0x54ec71[_0x2203('0x18')][_0x367122['id']],_0x367122);}}}return _0x54ec71[_0x2203('0x18')];};};Realtime[_0x2203('0x39')][_0x2203('0x4e')]=function(){var _0x58ff57=this;return function(_0x585bde){if(_0x585bde){freeIsNotKey(_0x585bde,_0x58ff57[_0x2203('0x1a')],'id');for(var _0x43d8c0=0x0,_0x2511bd={};_0x43d8c0<_0x585bde[_0x2203('0x3a')];_0x43d8c0+=0x1){_0x2511bd=_0x585bde[_0x43d8c0];if(_[_0x2203('0x3c')](_0x58ff57[_0x2203('0x1a')][_0x2511bd['id']])){_0x58ff57['vtigerAccounts'][_0x2511bd['id']]=new VtigerAccount(_0x2511bd);}else{_0x58ff57['mergeFromDatabase'](_0x58ff57[_0x2203('0x1a')][_0x2511bd['id']],_0x2511bd);}}}return _0x58ff57[_0x2203('0x1a')];};};Realtime[_0x2203('0x39')][_0x2203('0x4f')]=function(){var _0xcab922=this;return function(_0x7b0b9c){if(_0x7b0b9c){freeIsNotKey(_0x7b0b9c,_0xcab922[_0x2203('0x1b')],'id');for(var _0x191b67=0x0,_0x2c6bcc={};_0x191b67<_0x7b0b9c[_0x2203('0x3a')];_0x191b67+=0x1){_0x2c6bcc=_0x7b0b9c[_0x191b67];if(_[_0x2203('0x3c')](_0xcab922['servicenowAccounts'][_0x2c6bcc['id']])){_0xcab922[_0x2203('0x1b')][_0x2c6bcc['id']]=new ServicenowAccount(_0x2c6bcc);}else{_0xcab922[_0x2203('0x40')](_0xcab922[_0x2203('0x1b')][_0x2c6bcc['id']],_0x2c6bcc);}}}return _0xcab922[_0x2203('0x1b')];};};Realtime[_0x2203('0x39')][_0x2203('0x50')]=function(){var _0x52c159=this;return function(_0x544756){if(_0x544756){freeIsNotKey(_0x544756,_0x52c159[_0x2203('0x1c')],'id');for(var _0x35b7b9=0x0,_0x49e795={};_0x35b7b9<_0x544756[_0x2203('0x3a')];_0x35b7b9+=0x1){_0x49e795=_0x544756[_0x35b7b9];if(_[_0x2203('0x3c')](_0x52c159[_0x2203('0x1c')][_0x49e795['id']])){_0x52c159[_0x2203('0x1c')][_0x49e795['id']]=new Dynamics365Account(_0x49e795);}else{_0x52c159[_0x2203('0x40')](_0x52c159[_0x2203('0x1c')][_0x49e795['id']],_0x49e795);}}}return _0x52c159[_0x2203('0x1c')];};};Realtime[_0x2203('0x39')][_0x2203('0x51')]=function(){var _0x519120=this;return function(_0x468619){if(_0x468619){freeIsNotKey(_0x468619,_0x519120[_0x2203('0x1d')],'id');for(var _0x465898=0x0,_0x4e461e={};_0x465898<_0x468619[_0x2203('0x3a')];_0x465898+=0x1){_0x4e461e=_0x468619[_0x465898];if(_[_0x2203('0x3c')](_0x519120[_0x2203('0x1d')][_0x4e461e['id']])){_0x519120[_0x2203('0x1d')][_0x4e461e['id']]=new FreshsalesAccount(_0x4e461e);}else{_0x519120[_0x2203('0x40')](_0x519120['freshsalesAccounts'][_0x4e461e['id']],_0x4e461e);}}}return _0x519120[_0x2203('0x1d')];};};Realtime[_0x2203('0x39')][_0x2203('0x52')]=function(){var _0x4dde80=this;return function(_0x5507b6){for(var _0x5d9ae2=0x0;_0x5d9ae2<_0x5507b6['length'];_0x5d9ae2+=0x1){_['merge'](_0x4dde80[_0x2203('0x13')][_0x5507b6[_0x5d9ae2][_0x2203('0x22')]],_0x5507b6[_0x5d9ae2]);}return _0x4dde80[_0x2203('0x13')];};};Realtime[_0x2203('0x39')][_0x2203('0x53')]=function(){var _0x169845=this;return function(_0x3f7926){clearVoiceQueues(_0x169845[_0x2203('0x13')]);if(_0x3f7926){_0x3f7926=_['groupBy'](_0x3f7926,'uniqueid');for(var _0xb54e51 in _0x3f7926){if(_0x3f7926[_0x2203('0x23')](_0xb54e51)){for(var _0xafcc82=0x0;_0xafcc82<_0x3f7926[_0xb54e51][_0x2203('0x3a')];_0xafcc82+=0x1){var _0x1bbd2d=_0x3f7926[_0xb54e51][_0xafcc82][_0x2203('0x54')];if(_0x169845[_0x2203('0x13')][_0x1bbd2d]){if(_0x3f7926[_0xb54e51][_0xafcc82][_0x2203('0x55')]){_0x169845[_0x2203('0x13')][_0x1bbd2d][_0x2203('0x2c')]+=0x1;}if(_0x3f7926[_0xb54e51][_0xafcc82][_0x2203('0x56')]){_0x169845[_0x2203('0x13')][_0x1bbd2d][_0x2203('0x2d')]+=0x1;}_0x169845[_0x2203('0x13')][_0x1bbd2d][_0x2203('0x27')]+=moment(_0x3f7926[_0xb54e51][_0xafcc82][_0x2203('0x57')])[_0x2203('0x58')](moment(_0x3f7926[_0xb54e51][_0xafcc82][_0x2203('0x59')]),_0x2203('0x5a'))||0x0;if(_0xafcc82===_0x3f7926[_0xb54e51]['length']-0x1){_0x169845[_0x2203('0x13')][_0x1bbd2d]['sumDuration']+=moment(_0x3f7926[_0xb54e51][_0xafcc82][_0x2203('0x5b')]||_0x3f7926[_0xb54e51][_0xafcc82]['queuecallerabandonAt']||_0x3f7926[_0xb54e51][_0xafcc82][_0x2203('0x5c')])[_0x2203('0x58')](moment(_0x3f7926[_0xb54e51][_0xafcc82][_0x2203('0x59')]),_0x2203('0x5a'))||0x0;_0x169845[_0x2203('0x13')][_0x1bbd2d][_0x2203('0x25')]+=0x1;if(_0x3f7926[_0xb54e51][_0xafcc82][_0x2203('0x5d')]){_0x169845[_0x2203('0x13')][_0x1bbd2d]['answered']+=0x1;_0x169845['voiceQueues'][_0x1bbd2d][_0x2203('0x29')]+=moment(_0x3f7926[_0xb54e51][_0xafcc82][_0x2203('0x5b')])[_0x2203('0x58')](moment(_0x3f7926[_0xb54e51][_0xafcc82]['queuecallerleaveAt']),'seconds')||0x0;}}else{_0x169845['voiceQueues'][_0x1bbd2d][_0x2203('0x28')]+=_0x169845[_0x2203('0x13')][_0x1bbd2d][_0x2203('0x27')]||0x0;}}}}}}return _0x169845[_0x2203('0x13')];};};Realtime['prototype'][_0x2203('0x5e')]=function(){var _0x47a2c7=this;return function(_0x48bd5){clearVoiceCallReports(_0x47a2c7[_0x2203('0x15')]);if(_0x48bd5){for(var _0xe3bee5=0x0;_0xe3bee5<_0x48bd5[_0x2203('0x3a')];_0xe3bee5+=0x1){_0x47a2c7[_0x2203('0x15')]['total']+=0x1;_0x47a2c7[_0x2203('0x15')][_0x2203('0x28')]+=_0x48bd5[_0xe3bee5][_0x2203('0x5f')];if(_0x48bd5[_0xe3bee5]['disposition']===_0x2203('0x60')){_0x47a2c7[_0x2203('0x15')][_0x2203('0x26')]+=0x1;_0x47a2c7[_0x2203('0x15')][_0x2203('0x27')]+=_0x48bd5[_0xe3bee5][_0x2203('0x5f')]-_0x48bd5[_0xe3bee5][_0x2203('0x61')]||0x0;_0x47a2c7[_0x2203('0x15')][_0x2203('0x29')]+=_0x48bd5[_0xe3bee5][_0x2203('0x61')];}}}return _0x47a2c7[_0x2203('0x15')];};};Realtime['prototype'][_0x2203('0x62')]=function(){var _0x7f71b8=this;return function(_0x21b755){if(_0x21b755){freeIsNotKey(_0x21b755,_0x7f71b8[_0x2203('0x14')],_0x2203('0x22'));for(var _0x52c35e=0x0,_0x23f7b1={};_0x52c35e<_0x21b755[_0x2203('0x3a')];_0x52c35e+=0x1){_0x23f7b1=_0x21b755[_0x52c35e];if(_[_0x2203('0x3c')](_0x7f71b8[_0x2203('0x14')][_0x23f7b1[_0x2203('0x22')]])){_0x7f71b8[_0x2203('0x14')][_0x23f7b1['name']]=new Campaign(_0x23f7b1);}else{_0x7f71b8['mergeFromDatabase'](_0x7f71b8[_0x2203('0x14')][_0x23f7b1[_0x2203('0x22')]],_0x23f7b1);_0x7f71b8[_0x2203('0x14')][_0x23f7b1[_0x2203('0x22')]][_0x2203('0x63')]=_0x23f7b1['SquareProject']?_0x23f7b1[_0x2203('0x64')][_0x2203('0x22')]:undefined;}}}return _0x7f71b8['campaigns'];};};Realtime['prototype']['initVoiceExtensions']=function(){var _0x4fc51a=this;return function(_0x5e07d7){if(_0x5e07d7){freeIsNotKey(_0x5e07d7,_0x4fc51a[_0x2203('0x65')],'id');for(var _0x6319a3=0x0,_0x437095={};_0x6319a3<_0x5e07d7['length'];_0x6319a3+=0x1){_0x437095=_0x5e07d7[_0x6319a3];if(_['isUndefined'](_0x4fc51a['voiceExtensions'][_0x437095['id']])){_0x4fc51a[_0x2203('0x65')][_0x437095['id']]=new VoiceExtension(_0x437095);}else{_0x4fc51a[_0x2203('0x40')](_0x4fc51a[_0x2203('0x65')][_0x437095['id']],_0x437095);}}}return _0x4fc51a[_0x2203('0x65')];};};Realtime[_0x2203('0x39')][_0x2203('0x66')]=function(){var _0x3d1797=this;return function(_0x52f25e){clearCampaigns(_0x3d1797[_0x2203('0x14')]);for(var _0x74843=0x0;_0x74843<_0x52f25e[_0x2203('0x3a')];_0x74843+=0x1){_[_0x2203('0x67')](_0x3d1797[_0x2203('0x14')][_0x52f25e[_0x74843][_0x2203('0x22')]],_0x52f25e[_0x74843]);}return _0x3d1797[_0x2203('0x14')];};};Realtime['prototype'][_0x2203('0x68')]=function(){var _0x51a2fe=this;return function(_0x5d0176){if(_0x5d0176){freeIsNotKey(_0x5d0176,_0x51a2fe[_0x2203('0x1e')],'id');for(var _0x5cd030=0x0,_0xb9588e={};_0x5cd030<_0x5d0176[_0x2203('0x3a')];_0x5cd030+=0x1){_0xb9588e=_0x5d0176[_0x5cd030];if(_['isUndefined'](_0x51a2fe[_0x2203('0x1e')][_0xb9588e['id']])){_0x51a2fe[_0x2203('0x1e')][_0xb9588e['id']]=new FaxAccount(_0xb9588e);}else{_0x51a2fe[_0x2203('0x40')](_0x51a2fe[_0x2203('0x1e')][_0xb9588e['id']],_0xb9588e);}}}return _0x51a2fe[_0x2203('0x1e')];};};Realtime[_0x2203('0x39')]['initVoiceQueues']=function(){var _0x215638=this;return function(_0x3541b3){if(_0x3541b3){freeIsNotKey(_0x3541b3,_0x215638['voiceQueues'],'name');for(var _0x377176=0x0,_0x3fe71b={};_0x377176<_0x3541b3[_0x2203('0x3a')];_0x377176+=0x1){_0x3fe71b=_0x3541b3[_0x377176];if(_[_0x2203('0x3c')](_0x215638[_0x2203('0x13')][_0x3fe71b[_0x2203('0x22')]])){_0x215638[_0x2203('0x13')][_0x3fe71b[_0x2203('0x22')]]=new VoiceQueue(_0x3fe71b);}else{_0x215638[_0x2203('0x40')](_0x215638[_0x2203('0x13')][_0x3fe71b[_0x2203('0x22')]],_0x3fe71b);}}}return _0x215638[_0x2203('0x13')];};};module[_0x2203('0x69')]=Realtime; \ No newline at end of file diff --git a/server/services/ami/realtime/utils.js b/server/services/ami/realtime/utils.js index df47854..389f8ec 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 _0x9b6b=['assign','hasOwnProperty'];(function(_0x5581ba,_0x268887){var _0x1e927f=function(_0x1803b2){while(--_0x1803b2){_0x5581ba['push'](_0x5581ba['shift']());}};_0x1e927f(++_0x268887);}(_0x9b6b,0x172));var _0xb9b6=function(_0x4c14ee,_0x21c1ea){_0x4c14ee=_0x4c14ee-0x0;var _0x1daf81=_0x9b6b[_0x4c14ee];return _0x1daf81;};'use strict';function mergeDBDataToRealtime(_0x51f1aa,_0x64fe8e){var _0xf73bf8=Object[_0xb9b6('0x0')]({},_0x51f1aa);for(var _0x5e7cc0 in _0x64fe8e){if(_0xf73bf8[_0xb9b6('0x1')](_0x5e7cc0)){_0xf73bf8[_0x5e7cc0]=_0x64fe8e[_0x5e7cc0];}}return _0xf73bf8;}exports['mergeDBDataToRealtime']=mergeDBDataToRealtime; \ No newline at end of file +var _0x951f=['mergeDBDataToRealtime','assign'];(function(_0x11005e,_0x20c3d2){var _0x29338f=function(_0x3384e9){while(--_0x3384e9){_0x11005e['push'](_0x11005e['shift']());}};_0x29338f(++_0x20c3d2);}(_0x951f,0x73));var _0xf951=function(_0x500419,_0x549162){_0x500419=_0x500419-0x0;var _0x241c1a=_0x951f[_0x500419];return _0x241c1a;};'use strict';function mergeDBDataToRealtime(_0x19c1dd,_0x2e80c2){var _0x6d3042=Object[_0xf951('0x0')]({},_0x19c1dd);for(var _0x58edd8 in _0x2e80c2){if(_0x6d3042['hasOwnProperty'](_0x58edd8)){_0x6d3042[_0x58edd8]=_0x2e80c2[_0x58edd8];}}return _0x6d3042;}exports[_0xf951('0x1')]=mergeDBDataToRealtime; \ No newline at end of file diff --git a/server/services/ami/report/index.js b/server/services/ami/report/index.js index 67224fa..5d14b08 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 _0x1ce8=['channel','split','calleridnum','internal','destination','exten','type','lastapplication','lastdata','queue','callerid','xcally-motion-preview','originatecalleridnum','destinationchannel','calleridpreview','disposition','ANSWERED','\x22%s\x22\x20<%s>','transfers','linkedid','transfereelinkedid','uniqueid','UserId','membername','monitor','monitors','monitorFilename','filename','createdAt','connectedlinename','xcally-motion-dialer','forEach','voiceDialReport','startsWith','Local','substring','indexOf','mobile','exports','../../../config/environment','../ami','../rpc/voiceAgentReport','../rpc/voiceDialReport','../rpc/memberReport','../rpc/voiceQueueReport','../rpc/voiceTransferReport','./voiceQueueReport','./voiceCallReport','./voiceAgentReport','./voiceDialReport','realtime','agents','telephones','prototype','sync','xdr','disabled','custom:voiceQueueReport','voiceQueueReport','bind','custom:voiceCallReport','voiceCallReport','voiceAgentReport','custom:voiceDialReport','blindtransfer','blindTransfer','attendedtransfer','attendedTransfer','findAgent','accountcode','isNil','name','find','SIP/%s','length','connectedlinenum','assigned','lastAssignedTo','interface','queuecallercomplete','queuecallercompleteAt','format','YYYY-MM-DD\x20HH:mm:ss','queuecallerexitAt','create','match','getAgentByInternal','keys','getCallType'];(function(_0x5afd1c,_0x5a8be5){var _0x477364=function(_0x51394b){while(--_0x51394b){_0x5afd1c['push'](_0x5afd1c['shift']());}};_0x477364(++_0x5a8be5);}(_0x1ce8,0xd9));var _0x81ce=function(_0x4ae962,_0x5d195d){_0x4ae962=_0x4ae962-0x0;var _0x405686=_0x1ce8[_0x4ae962];return _0x405686;};'use strict';var _=require('lodash');var moment=require('moment');var util=require('util');var config=require(_0x81ce('0x0'));var ami=require(_0x81ce('0x1'));var RpcVoiceAgentReport=require(_0x81ce('0x2'));var RpcVoiceCallReport=require('../rpc/voiceCallReport');var RpcVoiceDialReport=require(_0x81ce('0x3'));var RpcMemberReport=require(_0x81ce('0x4'));var RpcVoiceQueueReport=require(_0x81ce('0x5'));var RpcVoiceRecording=require('../rpc/voiceRecording');var RpcVoiceTransferReport=require(_0x81ce('0x6'));var VoiceQueueReport=require(_0x81ce('0x7'));var VoiceCallReport=require(_0x81ce('0x8'));var VoiceAgentReport=require(_0x81ce('0x9'));var VoiceDialReport=require(_0x81ce('0xa'));var UserReport=require('./userReport');function Report(_0x8ac89f){this[_0x81ce('0xb')]=_0x8ac89f;this[_0x81ce('0xc')]=_0x8ac89f['agents'];this[_0x81ce('0xd')]=_0x8ac89f[_0x81ce('0xd')];}Report[_0x81ce('0xe')][_0x81ce('0xf')]=function(_0x4a3e4c){var _0x3de55b=new VoiceQueueReport(this['realtime']);var _0x3fe64c=new VoiceAgentReport(this[_0x81ce('0xb')]);var _0x15fb70=new VoiceDialReport(this[_0x81ce('0xb')]);var _0x550219=new VoiceCallReport(this['realtime']);var _0x399a06=new UserReport(this[_0x81ce('0xb')]);if(config[_0x81ce('0x10')]&&config[_0x81ce('0x10')][_0x81ce('0x11')]){ami['on'](_0x81ce('0x12'),this[_0x81ce('0x13')][_0x81ce('0x14')](this));ami['on'](_0x81ce('0x15'),this[_0x81ce('0x16')]['bind'](this));ami['on']('custom:voiceAgentReport',this[_0x81ce('0x17')]['bind'](this));ami['on'](_0x81ce('0x18'),this['voiceDialReport'][_0x81ce('0x14')](this));ami['on'](_0x81ce('0x19'),this[_0x81ce('0x1a')][_0x81ce('0x14')](this));ami['on'](_0x81ce('0x1b'),this[_0x81ce('0x1c')][_0x81ce('0x14')](this));}};Report[_0x81ce('0xe')][_0x81ce('0x1d')]=function(_0x9c1104){var _0x58b294;_0x58b294=_['find'](this[_0x81ce('0xc')],function(_0xa53e7e){return _0xa53e7e[_0x81ce('0x1e')]==_0x9c1104||_0xa53e7e['name']==_0x9c1104;});if(_[_0x81ce('0x1f')](_0x58b294)){var _0x3449c9=_['find'](this[_0x81ce('0xd')],function(_0x5ac3b8){return _0x5ac3b8[_0x81ce('0x1e')]==_0x9c1104||_0x5ac3b8[_0x81ce('0x20')]==_0x9c1104;});if(_0x3449c9){_0x58b294=_[_0x81ce('0x21')](this[_0x81ce('0xc')],function(_0x27bdc4){return _0x27bdc4['interface']==util['format'](_0x81ce('0x22'),_0x3449c9[_0x81ce('0x20')]);});}}return _0x58b294;};Report[_0x81ce('0xe')][_0x81ce('0x13')]=function(_0x1485c9){for(var _0x2c4bd3=0x0;_0x2c4bd3<_0x1485c9[_0x81ce('0x23')];_0x2c4bd3+=0x1){var _0x2f45e5=this[_0x81ce('0x1d')](_0x1485c9[_0x2c4bd3][_0x81ce('0x24')]);if(_0x2f45e5){_0x1485c9[_0x2c4bd3][_0x81ce('0x1e')]=_0x2f45e5[_0x81ce('0x1e')];_0x1485c9[_0x2c4bd3][_0x81ce('0x25')]=!![];_0x1485c9[_0x2c4bd3][_0x81ce('0x26')]=_0x2f45e5[_0x81ce('0x20')];_0x1485c9[_0x2c4bd3]['interface']=_[_0x81ce('0x1f')](_0x2f45e5[_0x81ce('0x27')])?util['format'](_0x81ce('0x22'),_0x2f45e5[_0x81ce('0x20')]):_0x2f45e5['interface'];if(_0x1485c9[_0x2c4bd3][_0x81ce('0x28')]){_0x1485c9[_0x2c4bd3][_0x81ce('0x29')]=moment()[_0x81ce('0x2a')](_0x81ce('0x2b'));}if(_0x1485c9[_0x2c4bd3]['queuecallerexit']){_0x1485c9[_0x2c4bd3][_0x81ce('0x2c')]=moment()[_0x81ce('0x2a')](_0x81ce('0x2b'));}RpcMemberReport['voiceQueueReport'](_0x1485c9[_0x2c4bd3]);}RpcVoiceQueueReport[_0x81ce('0x2d')](_0x1485c9[_0x2c4bd3]);}};function extractCalleridNumber(_0x3a6a34){var _0x360731=_0x3a6a34[_0x81ce('0x2e')](/<(.*?)>/);return _0x360731?_0x360731[0x1]:_0x3a6a34;}Report[_0x81ce('0xe')][_0x81ce('0x2f')]=function(_0x1af0c1){for(var _0x38d796=0x0;_0x38d796/);return _0xc75b03?_0xc75b03[0x1]:_0xa71427;}Report[_0xdda7('0xc')]['getAgentByInternal']=function(_0x36b51b){for(var _0x3a59a5=0x0;_0x3a59a5',_0xe3470b[_0xdda7('0x3d')],_0xe3470b[_0xdda7('0x38')]);}if(RpcVoiceTransferReport[_0xdda7('0x3e')][_0xe3470b['linkedid']]){var _0x424d66=RpcVoiceTransferReport[_0xdda7('0x3e')][_0xe3470b[_0xdda7('0x3f')]];_0x424d66[_0xdda7('0x40')]=_0xe3470b[_0xdda7('0x41')];RpcVoiceTransferReport['blindTransfer'](_0x424d66);delete RpcVoiceTransferReport['transfers'][_0xe3470b[_0xdda7('0x3f')]];}if(_['isNil'](_0xe3470b['type'])){_0xe3470b[_0xdda7('0x2e')]=this[_0xdda7('0x42')](_0xe3470b);}if(_[_0xdda7('0x1d')](_0xe3470b[_0xdda7('0x43')])){var _0x30aa07=_0xe3470b[_0xdda7('0x2a')][_0xdda7('0x44')]('-')[0x0];var _0x37184f=this[_0xdda7('0xa')][_0x30aa07];if(!_0x37184f)_0x37184f=this['getAgentByInternal'](_0xe3470b['accountcode']);if(_0x37184f){_0xe3470b['UserId']=_0x37184f['id'];_0xe3470b[_0xdda7('0x45')]=_0x37184f[_0xdda7('0x1c')];}}RpcVoiceCallReport[_0xdda7('0x28')](_0xe3470b);if(_0xe3470b[_0xdda7('0x46')]){for(var _0x281987=0x0;_0x281987<_0xe3470b['monitors'][_0xdda7('0x21')];_0x281987+=0x1){_0xe3470b['monitorFilename']=_0xe3470b[_0xdda7('0x47')][_0x281987]['filename'];_0xe3470b[_0xdda7('0x48')]=_0xe3470b['monitors'][_0x281987][_0xdda7('0x48')];if(_0xe3470b[_0xdda7('0x2d')]==_0xdda7('0x36')){_0xe3470b['calleridnum']=_0xe3470b[_0xdda7('0x3c')];_0xe3470b[_0xdda7('0x3d')]=_0xe3470b[_0xdda7('0x49')];_0xe3470b[_0xdda7('0x3c')]=_0xe3470b[_0xdda7('0x1e')];_0xe3470b[_0xdda7('0x49')]=_0xe3470b[_0xdda7('0x45')];_0xe3470b[_0xdda7('0x2d')]=_0xe3470b['originatecalleridnum'];}else if(_0xe3470b[_0xdda7('0x2d')]=='xcally-motion-dialer'){_0xe3470b[_0xdda7('0x38')]=_0xe3470b['destination'];_0xe3470b[_0xdda7('0x2d')]=_0xe3470b[_0xdda7('0x39')];}RpcVoiceRecording[_0xdda7('0x28')](_0xe3470b);}}};Report['prototype'][_0xdda7('0x14')]=function(_0x2fc8ba){if(_[_0xdda7('0x4a')](_0x2fc8ba)){_0x2fc8ba['forEach'](function(_0x1bc5bd){RpcVoiceAgentReport[_0xdda7('0x28')](_0x1bc5bd);});}else{RpcVoiceAgentReport[_0xdda7('0x28')](_0x2fc8ba);}};Report['prototype']['voiceDialReport']=function(_0x54ee26){RpcVoiceDialReport['create'](_0x54ee26);var _0x1f08be;var _0x4e48a2;var _0x12bf62=_0x54ee26['channel'];if(_[_0xdda7('0x4b')](_0x12bf62,'Local')){_0x4e48a2=_0x12bf62[_0xdda7('0x4c')](_0x12bf62[_0xdda7('0x4d')]('/')+0x1,_0x12bf62[_0xdda7('0x4d')]('@'));_0x1f08be=_[_0xdda7('0x1b')](this[_0xdda7('0xa')],function(_0x57594b){return _0x57594b['mobile']==_0x4e48a2||_0x57594b[_0xdda7('0x4e')]==_0x4e48a2||_0x57594b['accountcode']==_0x4e48a2;});}else{_0x4e48a2=_0x12bf62['substring'](_0x12bf62['indexOf']('/')+0x1,_0x12bf62[_0xdda7('0x4f')]('-'));_0x1f08be=this[_0xdda7('0x22')](_0x4e48a2);}if(_0x1f08be){_0x54ee26[_0xdda7('0x1f')]=_[_0xdda7('0x1d')](_0x1f08be['interface'])?util['format']('SIP/%s',_0x1f08be[_0xdda7('0x1c')]):_0x1f08be[_0xdda7('0x1f')];_0x54ee26[_0xdda7('0x45')]=_0x1f08be['name'];_0x54ee26[_0xdda7('0x1e')]=_0x1f08be[_0xdda7('0x1e')];RpcMemberReport[_0xdda7('0x16')](_0x54ee26);}};Report[_0xdda7('0xc')][_0xdda7('0x18')]=function(_0x55cc96){RpcVoiceTransferReport[_0xdda7('0x3e')][_0x55cc96[_0xdda7('0x50')]]=_0x55cc96;};Report['prototype']['attendedTransfer']=function(_0x19d5d8){RpcVoiceTransferReport[_0xdda7('0x1a')](_0x19d5d8);};module['exports']=Report; \ No newline at end of file diff --git a/server/services/ami/report/userReport.js b/server/services/ami/report/userReport.js index 470cca6..a0bbb38 100644 --- a/server/services/ami/report/userReport.js +++ b/server/services/ami/report/userReport.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x0ccc=['[userReport][devicestatelist]','inspect','actionSipPeerStatus','prototype','then','isUndefined','emit','info','state','debug','[userReport][registry]','find','trunks','stateRegistry','merge','omit','event','actionid','username','[userReport][registry]\x20sending\x20trunk:save\x20event:','format','trunk:%s','name','trunk:save','syncDeviceState','isNotNull','[userReport][devicestatechange]','agents','device','local','toLowerCase','inuse','stateTime','toNumber','updateStatusRealtime','[userReport][devicestatechange]\x20sending\x20telephone:save\x20event:','[userReport][devicestatechange]\x20sending\x20trunk:save\x20event:','startsWith','Local','indexOf','mobile','phone','accountcode','[userReport][peerstatus]\x20peer:%s\x20address:%s\x20status:%s','address','[userReport][peerstatus]','peer','registered','status','[userReport][peerstatus]\x20sending\x20telephone:save\x20event:','telephone:%s','lodash','moment','util','ioredis','bluebird','../../../config/environment','../../../config/logger','../ami','defaults','redis','localhost','socket.io-emitter','telephones','registryentry','syncRegistry','bind','devicestatechange','peerstatus','syncPeerStatus','syncRealtimeShow','resolve','actionSipShowRegistry','catch','error','actionDeviceStateList'];(function(_0x11b419,_0x4cf49e){var _0x230706=function(_0x2ee13b){while(--_0x2ee13b){_0x11b419['push'](_0x11b419['shift']());}};_0x230706(++_0x4cf49e);}(_0x0ccc,0x7f));var _0xc0cc=function(_0x41d15a,_0x5e3ded){_0x41d15a=_0x41d15a-0x0;var _0x9f3554=_0x0ccc[_0x41d15a];return _0x9f3554;};'use strict';var _=require(_0xc0cc('0x0'));var moment=require(_0xc0cc('0x1'));var util=require(_0xc0cc('0x2'));var Redis=require(_0xc0cc('0x3'));var BPromise=require(_0xc0cc('0x4'));var config=require(_0xc0cc('0x5'));var logger=require(_0xc0cc('0x6'))('ami');var ami=require(_0xc0cc('0x7'));config['redis']=_[_0xc0cc('0x8')](config[_0xc0cc('0x9')],{'host':_0xc0cc('0xa'),'port':0x18eb});var io=require(_0xc0cc('0xb'))(new Redis(config[_0xc0cc('0x9')]));function UserReport(_0x21ee04){this['trunks']=_0x21ee04['trunks'];this['agents']=_0x21ee04['agents'];this[_0xc0cc('0xc')]=_0x21ee04[_0xc0cc('0xc')];ami['on'](_0xc0cc('0xd'),this[_0xc0cc('0xe')]['bind'](this));ami['on']('registry',this[_0xc0cc('0xe')][_0xc0cc('0xf')](this));ami['on'](_0xc0cc('0x10'),this['syncDeviceState'][_0xc0cc('0xf')](this));ami['on'](_0xc0cc('0x11'),this[_0xc0cc('0x12')]['bind'](this));return this[_0xc0cc('0x13')]();}function showSipRegistrations(){Promise[_0xc0cc('0x14')]()['then'](ami[_0xc0cc('0x15')]())[_0xc0cc('0x16')](function(_0x38125c){logger[_0xc0cc('0x17')]('[userReport][sipshowregistry]',util['inspect'](_0x38125c,{'showHidden':![],'depth':null}));});}function listDeviceStates(){Promise['resolve']()['then'](ami[_0xc0cc('0x18')]())[_0xc0cc('0x16')](function(_0x448900){logger[_0xc0cc('0x17')](_0xc0cc('0x19'),util[_0xc0cc('0x1a')](_0x448900,{'showHidden':![],'depth':null}));});}function showPeersStatus(){Promise[_0xc0cc('0x14')]()['then'](ami[_0xc0cc('0x1b')]())['catch'](function(_0x35fcfe){logger[_0xc0cc('0x17')]('[userReport][sippeerstatus]',util[_0xc0cc('0x1a')](_0x35fcfe,{'showHidden':![],'depth':null}));});}UserReport[_0xc0cc('0x1c')][_0xc0cc('0x13')]=function(){setInterval(function(){BPromise[_0xc0cc('0x14')]()[_0xc0cc('0x1d')](showSipRegistrations())[_0xc0cc('0x1d')](listDeviceStates())[_0xc0cc('0x1d')](showPeersStatus());},0x32c8);};UserReport[_0xc0cc('0x1c')]['isNotNull']=function(_0x52250f){return _0x52250f!==null&&!_[_0xc0cc('0x1e')](_0x52250f);};UserReport[_0xc0cc('0x1c')]['emit']=function(_0x3eb805,_0x337f9c,_0x18f477){io['to'](_0x3eb805)[_0xc0cc('0x1f')](_0x337f9c,_0x18f477);};UserReport[_0xc0cc('0x1c')]['syncRegistry']=function(_0x1ae494){try{if(this['isNotNull'](_0x1ae494)){logger[_0xc0cc('0x20')]('[userReport][registry]\x20registry:%s\x20state:%s',_0x1ae494['username'],_0x1ae494[_0xc0cc('0x21')]);logger[_0xc0cc('0x22')](_0xc0cc('0x23'),util[_0xc0cc('0x1a')](_0x1ae494,{'showHidden':![],'depth':null}));var _0x5a6c4a=_[_0xc0cc('0x24')](this[_0xc0cc('0x25')],{'defaultuser':_0x1ae494['username']});if(_0x5a6c4a){_0x1ae494[_0xc0cc('0x26')]=_0x1ae494[_0xc0cc('0x21')];_[_0xc0cc('0x27')](_0x5a6c4a,_[_0xc0cc('0x28')](_0x1ae494,[_0xc0cc('0x29'),_0xc0cc('0x2a'),_0xc0cc('0x2b'),_0xc0cc('0x21')]));logger[_0xc0cc('0x22')](_0xc0cc('0x2c'),util[_0xc0cc('0x1a')](_0x5a6c4a,{'showHidden':![],'depth':null}));this[_0xc0cc('0x1f')](util[_0xc0cc('0x2d')](_0xc0cc('0x2e'),_0x5a6c4a[_0xc0cc('0x2f')]),_0xc0cc('0x30'),_0x5a6c4a);}}}catch(_0x2a9d08){logger['error'](_0xc0cc('0x23'),util[_0xc0cc('0x1a')](_0x2a9d08,{'showHidden':![],'depth':null}));}};UserReport[_0xc0cc('0x1c')][_0xc0cc('0x31')]=function(_0x58e2f1){try{if(this[_0xc0cc('0x32')](_0x58e2f1)){logger['info']('[userReport][devicestatechange]\x20device:%s\x20state:%s',_0x58e2f1['device'],_0x58e2f1[_0xc0cc('0x21')]);logger[_0xc0cc('0x22')](_0xc0cc('0x33'),util[_0xc0cc('0x1a')](_0x58e2f1,{'showHidden':![],'depth':null}));if(this[_0xc0cc('0x34')][_0x58e2f1[_0xc0cc('0x35')]]){if(!this[_0xc0cc('0x34')][_0x58e2f1['device']][_0xc0cc('0x36')]||_0x58e2f1['state'][_0xc0cc('0x37')]()==_0xc0cc('0x38')){this[_0xc0cc('0x34')][_0x58e2f1[_0xc0cc('0x35')]][_0xc0cc('0x36')]=![];if(this['agents'][_0x58e2f1[_0xc0cc('0x35')]][_0xc0cc('0x21')]!==_0x58e2f1[_0xc0cc('0x21')][_0xc0cc('0x37')]()){this[_0xc0cc('0x34')][_0x58e2f1[_0xc0cc('0x35')]][_0xc0cc('0x39')]=_[_0xc0cc('0x3a')](moment()[_0xc0cc('0x2d')]('x'));}this['agents'][_0x58e2f1[_0xc0cc('0x35')]][_0xc0cc('0x21')]=_0x58e2f1[_0xc0cc('0x21')][_0xc0cc('0x37')]();this[_0xc0cc('0x34')][_0x58e2f1[_0xc0cc('0x35')]][_0xc0cc('0x3b')](_0x58e2f1);}}else if(this[_0xc0cc('0xc')][_0x58e2f1[_0xc0cc('0x35')]]){if(this['telephones'][_0x58e2f1[_0xc0cc('0x35')]][_0xc0cc('0x21')]!==_0x58e2f1[_0xc0cc('0x21')][_0xc0cc('0x37')]()){this[_0xc0cc('0xc')][_0x58e2f1[_0xc0cc('0x35')]][_0xc0cc('0x39')]=_[_0xc0cc('0x3a')](moment()[_0xc0cc('0x2d')]('x'));}this[_0xc0cc('0xc')][_0x58e2f1[_0xc0cc('0x35')]][_0xc0cc('0x21')]=_0x58e2f1['state'][_0xc0cc('0x37')]();logger[_0xc0cc('0x22')](_0xc0cc('0x3c'),util['inspect'](this[_0xc0cc('0xc')][_0x58e2f1[_0xc0cc('0x35')]],{'showHidden':![],'depth':null}));this[_0xc0cc('0x1f')](util[_0xc0cc('0x2d')]('telephone:%s',this[_0xc0cc('0xc')][_0x58e2f1['device']]['name']),'telephone:save',this[_0xc0cc('0xc')][_0x58e2f1[_0xc0cc('0x35')]]);}else if(this[_0xc0cc('0x25')][_0x58e2f1['device']]){if(this[_0xc0cc('0x25')][_0x58e2f1[_0xc0cc('0x35')]][_0xc0cc('0x21')]!==_0x58e2f1['state']['toLowerCase']()){this[_0xc0cc('0x25')][_0x58e2f1[_0xc0cc('0x35')]][_0xc0cc('0x39')]=_[_0xc0cc('0x3a')](moment()['format']('x'));}this[_0xc0cc('0x25')][_0x58e2f1[_0xc0cc('0x35')]][_0xc0cc('0x21')]=_0x58e2f1['state'][_0xc0cc('0x37')]();logger[_0xc0cc('0x22')](_0xc0cc('0x3d'),util['inspect'](this[_0xc0cc('0x25')][_0x58e2f1['device']],{'showHidden':![],'depth':null}));this[_0xc0cc('0x1f')](util[_0xc0cc('0x2d')](_0xc0cc('0x2e'),this['trunks'][_0x58e2f1[_0xc0cc('0x35')]]['name']),_0xc0cc('0x30'),this[_0xc0cc('0x25')][_0x58e2f1[_0xc0cc('0x35')]]);}else if(_[_0xc0cc('0x3e')](_0x58e2f1[_0xc0cc('0x35')],_0xc0cc('0x3f'))){var _0x54ca6e=_0x58e2f1['device'];var _0x3ba729=_0x54ca6e['substring'](_0x54ca6e[_0xc0cc('0x40')]('/')+0x1,_0x54ca6e[_0xc0cc('0x40')]('@'));var _0x101abc=_[_0xc0cc('0x24')](this[_0xc0cc('0x34')],function(_0x2dd63d){return _0x2dd63d[_0xc0cc('0x41')]==_0x3ba729||_0x2dd63d[_0xc0cc('0x42')]==_0x3ba729||_0x2dd63d[_0xc0cc('0x43')]==_0x3ba729;});if(_0x101abc){if(_0x101abc[_0xc0cc('0x21')]!==_0x58e2f1[_0xc0cc('0x21')][_0xc0cc('0x37')]()){_0x101abc[_0xc0cc('0x39')]=_['toNumber'](moment()[_0xc0cc('0x2d')]('x'));}_0x101abc[_0xc0cc('0x21')]=_0x58e2f1['state'][_0xc0cc('0x37')]();_0x101abc[_0xc0cc('0x36')]=!![];_0x101abc[_0xc0cc('0x3b')](_0x58e2f1);}}}}catch(_0x8116f2){logger['error'](_0xc0cc('0x33'),util[_0xc0cc('0x1a')](_0x8116f2,{'showHidden':![],'depth':null}));}};UserReport[_0xc0cc('0x1c')][_0xc0cc('0x12')]=function(_0x3fc126){try{if(this[_0xc0cc('0x32')](_0x3fc126)&&this['isNotNull'](_0x3fc126[_0xc0cc('0x11')])){logger[_0xc0cc('0x20')](_0xc0cc('0x44'),_0x3fc126['peer'],_0x3fc126[_0xc0cc('0x45')],_0x3fc126[_0xc0cc('0x11')]);logger[_0xc0cc('0x22')](_0xc0cc('0x46'),util[_0xc0cc('0x1a')](_0x3fc126,{'showHidden':![],'depth':null}));if(this[_0xc0cc('0x34')][_0x3fc126[_0xc0cc('0x47')]]){if(!this[_0xc0cc('0x34')][_0x3fc126[_0xc0cc('0x47')]][_0xc0cc('0x36')]||_0x3fc126[_0xc0cc('0x11')]['toLowerCase']()==_0xc0cc('0x48')){this['agents'][_0x3fc126['peer']][_0xc0cc('0x36')]=![];this[_0xc0cc('0x34')][_0x3fc126[_0xc0cc('0x47')]]['status']=_0x3fc126[_0xc0cc('0x11')][_0xc0cc('0x37')]();this[_0xc0cc('0x34')][_0x3fc126[_0xc0cc('0x47')]][_0xc0cc('0x45')]=_0x3fc126[_0xc0cc('0x45')];this['agents'][_0x3fc126[_0xc0cc('0x47')]][_0xc0cc('0x3b')](_0x3fc126);}}else if(this['telephones'][_0x3fc126['peer']]){this[_0xc0cc('0xc')][_0x3fc126[_0xc0cc('0x47')]][_0xc0cc('0x49')]=_0x3fc126['peerstatus']['toLowerCase']();this[_0xc0cc('0xc')][_0x3fc126[_0xc0cc('0x47')]][_0xc0cc('0x45')]=_0x3fc126['address'];logger['debug'](_0xc0cc('0x4a'),util[_0xc0cc('0x1a')](this[_0xc0cc('0xc')][_0x3fc126[_0xc0cc('0x47')]],{'showHidden':![],'depth':null}));this[_0xc0cc('0x1f')](util[_0xc0cc('0x2d')](_0xc0cc('0x4b'),this[_0xc0cc('0xc')][_0x3fc126[_0xc0cc('0x47')]][_0xc0cc('0x2f')]),'telephone:save',this[_0xc0cc('0xc')][_0x3fc126['peer']]);}else if(this['trunks'][_0x3fc126[_0xc0cc('0x47')]]){this[_0xc0cc('0x25')][_0x3fc126[_0xc0cc('0x47')]][_0xc0cc('0x49')]=_0x3fc126[_0xc0cc('0x11')][_0xc0cc('0x37')]();this[_0xc0cc('0x25')][_0x3fc126[_0xc0cc('0x47')]][_0xc0cc('0x45')]=_0x3fc126[_0xc0cc('0x45')];logger[_0xc0cc('0x22')]('[userReport][peerstatus]\x20sending\x20trunk:save\x20event:',util[_0xc0cc('0x1a')](this[_0xc0cc('0x25')][_0x3fc126[_0xc0cc('0x47')]],{'showHidden':![],'depth':null}));this[_0xc0cc('0x1f')](util['format'](_0xc0cc('0x2e'),this['trunks'][_0x3fc126[_0xc0cc('0x47')]][_0xc0cc('0x2f')]),_0xc0cc('0x30'),this[_0xc0cc('0x25')][_0x3fc126[_0xc0cc('0x47')]]);}}}catch(_0x4c53e0){logger['error']('[userReport][peerstatus]',util[_0xc0cc('0x1a')](_0x4c53e0,{'showHidden':![],'depth':null}));}};module['exports']=UserReport; \ No newline at end of file +var _0x5539=['trunks','agents','telephones','registryentry','registry','syncRegistry','bind','devicestatechange','syncDeviceState','peerstatus','syncPeerStatus','resolve','then','actionSipShowRegistry','catch','error','[userReport][sipshowregistry]','inspect','actionDeviceStateList','[userReport][devicestatelist]','actionSipPeerStatus','prototype','syncRealtimeShow','isNotNull','emit','info','username','state','debug','[userReport][registry]','find','stateRegistry','merge','omit','event','actionid','[userReport][registry]\x20sending\x20trunk:save\x20event:','format','name','trunk:save','device','[userReport][devicestatechange]','local','toLowerCase','stateTime','toNumber','updateStatusRealtime','[userReport][devicestatechange]\x20sending\x20telephone:save\x20event:','telephone:%s','telephone:save','[userReport][devicestatechange]\x20sending\x20trunk:save\x20event:','trunk:%s','startsWith','substring','indexOf','mobile','accountcode','[userReport][peerstatus]\x20peer:%s\x20address:%s\x20status:%s','address','[userReport][peerstatus]','registered','peer','status','[userReport][peerstatus]\x20sending\x20trunk:save\x20event:','util','ioredis','bluebird','../../../config/environment','ami','../ami','redis','defaults','socket.io-emitter'];(function(_0x1f70f7,_0xdff896){var _0x5e4d46=function(_0x5a4b37){while(--_0x5a4b37){_0x1f70f7['push'](_0x1f70f7['shift']());}};_0x5e4d46(++_0xdff896);}(_0x5539,0x11b));var _0x9553=function(_0x52b93c,_0x3b416c){_0x52b93c=_0x52b93c-0x0;var _0x5e6b76=_0x5539[_0x52b93c];return _0x5e6b76;};'use strict';var _=require('lodash');var moment=require('moment');var util=require(_0x9553('0x0'));var Redis=require(_0x9553('0x1'));var BPromise=require(_0x9553('0x2'));var config=require(_0x9553('0x3'));var logger=require('../../../config/logger')(_0x9553('0x4'));var ami=require(_0x9553('0x5'));config[_0x9553('0x6')]=_[_0x9553('0x7')](config[_0x9553('0x6')],{'host':'localhost','port':0x18eb});var io=require(_0x9553('0x8'))(new Redis(config[_0x9553('0x6')]));function UserReport(_0x1e7911){this[_0x9553('0x9')]=_0x1e7911[_0x9553('0x9')];this['agents']=_0x1e7911[_0x9553('0xa')];this[_0x9553('0xb')]=_0x1e7911[_0x9553('0xb')];ami['on'](_0x9553('0xc'),this['syncRegistry']['bind'](this));ami['on'](_0x9553('0xd'),this[_0x9553('0xe')][_0x9553('0xf')](this));ami['on'](_0x9553('0x10'),this[_0x9553('0x11')][_0x9553('0xf')](this));ami['on'](_0x9553('0x12'),this[_0x9553('0x13')][_0x9553('0xf')](this));return this['syncRealtimeShow']();}function showSipRegistrations(){Promise[_0x9553('0x14')]()[_0x9553('0x15')](ami[_0x9553('0x16')]())[_0x9553('0x17')](function(_0x338770){logger[_0x9553('0x18')](_0x9553('0x19'),util[_0x9553('0x1a')](_0x338770,{'showHidden':![],'depth':null}));});}function listDeviceStates(){Promise[_0x9553('0x14')]()[_0x9553('0x15')](ami[_0x9553('0x1b')]())['catch'](function(_0xa3c959){logger[_0x9553('0x18')](_0x9553('0x1c'),util[_0x9553('0x1a')](_0xa3c959,{'showHidden':![],'depth':null}));});}function showPeersStatus(){Promise[_0x9553('0x14')]()[_0x9553('0x15')](ami[_0x9553('0x1d')]())['catch'](function(_0x1374c8){logger[_0x9553('0x18')]('[userReport][sippeerstatus]',util[_0x9553('0x1a')](_0x1374c8,{'showHidden':![],'depth':null}));});}UserReport[_0x9553('0x1e')][_0x9553('0x1f')]=function(){setInterval(function(){BPromise['resolve']()[_0x9553('0x15')](showSipRegistrations())[_0x9553('0x15')](listDeviceStates())[_0x9553('0x15')](showPeersStatus());},0x32c8);};UserReport[_0x9553('0x1e')][_0x9553('0x20')]=function(_0x11a909){return _0x11a909!==null&&!_['isUndefined'](_0x11a909);};UserReport[_0x9553('0x1e')][_0x9553('0x21')]=function(_0x413c1c,_0x2f187c,_0xe38e5f){io['to'](_0x413c1c)['emit'](_0x2f187c,_0xe38e5f);};UserReport[_0x9553('0x1e')][_0x9553('0xe')]=function(_0x4abd6d){try{if(this[_0x9553('0x20')](_0x4abd6d)){logger[_0x9553('0x22')]('[userReport][registry]\x20registry:%s\x20state:%s',_0x4abd6d[_0x9553('0x23')],_0x4abd6d[_0x9553('0x24')]);logger[_0x9553('0x25')](_0x9553('0x26'),util[_0x9553('0x1a')](_0x4abd6d,{'showHidden':![],'depth':null}));var _0x2a40e6=_[_0x9553('0x27')](this['trunks'],{'defaultuser':_0x4abd6d[_0x9553('0x23')]});if(_0x2a40e6){_0x4abd6d[_0x9553('0x28')]=_0x4abd6d[_0x9553('0x24')];_[_0x9553('0x29')](_0x2a40e6,_[_0x9553('0x2a')](_0x4abd6d,[_0x9553('0x2b'),_0x9553('0x2c'),'username','state']));logger[_0x9553('0x25')](_0x9553('0x2d'),util['inspect'](_0x2a40e6,{'showHidden':![],'depth':null}));this[_0x9553('0x21')](util[_0x9553('0x2e')]('trunk:%s',_0x2a40e6[_0x9553('0x2f')]),_0x9553('0x30'),_0x2a40e6);}}}catch(_0xf96317){logger['error'](_0x9553('0x26'),util['inspect'](_0xf96317,{'showHidden':![],'depth':null}));}};UserReport[_0x9553('0x1e')][_0x9553('0x11')]=function(_0x599c4a){try{if(this[_0x9553('0x20')](_0x599c4a)){logger['info']('[userReport][devicestatechange]\x20device:%s\x20state:%s',_0x599c4a[_0x9553('0x31')],_0x599c4a[_0x9553('0x24')]);logger[_0x9553('0x25')](_0x9553('0x32'),util[_0x9553('0x1a')](_0x599c4a,{'showHidden':![],'depth':null}));if(this[_0x9553('0xa')][_0x599c4a[_0x9553('0x31')]]){if(!this[_0x9553('0xa')][_0x599c4a[_0x9553('0x31')]][_0x9553('0x33')]||_0x599c4a['state'][_0x9553('0x34')]()=='inuse'){this['agents'][_0x599c4a[_0x9553('0x31')]][_0x9553('0x33')]=![];if(this[_0x9553('0xa')][_0x599c4a[_0x9553('0x31')]][_0x9553('0x24')]!==_0x599c4a[_0x9553('0x24')]['toLowerCase']()){this[_0x9553('0xa')][_0x599c4a[_0x9553('0x31')]][_0x9553('0x35')]=_[_0x9553('0x36')](moment()[_0x9553('0x2e')]('x'));}this[_0x9553('0xa')][_0x599c4a[_0x9553('0x31')]][_0x9553('0x24')]=_0x599c4a[_0x9553('0x24')][_0x9553('0x34')]();this[_0x9553('0xa')][_0x599c4a[_0x9553('0x31')]][_0x9553('0x37')](_0x599c4a);}}else if(this[_0x9553('0xb')][_0x599c4a['device']]){if(this[_0x9553('0xb')][_0x599c4a[_0x9553('0x31')]]['state']!==_0x599c4a[_0x9553('0x24')][_0x9553('0x34')]()){this[_0x9553('0xb')][_0x599c4a[_0x9553('0x31')]][_0x9553('0x35')]=_[_0x9553('0x36')](moment()[_0x9553('0x2e')]('x'));}this['telephones'][_0x599c4a['device']][_0x9553('0x24')]=_0x599c4a[_0x9553('0x24')]['toLowerCase']();logger[_0x9553('0x25')](_0x9553('0x38'),util[_0x9553('0x1a')](this['telephones'][_0x599c4a['device']],{'showHidden':![],'depth':null}));this[_0x9553('0x21')](util[_0x9553('0x2e')](_0x9553('0x39'),this['telephones'][_0x599c4a[_0x9553('0x31')]][_0x9553('0x2f')]),_0x9553('0x3a'),this[_0x9553('0xb')][_0x599c4a[_0x9553('0x31')]]);}else if(this[_0x9553('0x9')][_0x599c4a[_0x9553('0x31')]]){if(this[_0x9553('0x9')][_0x599c4a[_0x9553('0x31')]][_0x9553('0x24')]!==_0x599c4a[_0x9553('0x24')][_0x9553('0x34')]()){this[_0x9553('0x9')][_0x599c4a[_0x9553('0x31')]][_0x9553('0x35')]=_['toNumber'](moment()[_0x9553('0x2e')]('x'));}this[_0x9553('0x9')][_0x599c4a['device']]['state']=_0x599c4a['state'][_0x9553('0x34')]();logger['debug'](_0x9553('0x3b'),util[_0x9553('0x1a')](this[_0x9553('0x9')][_0x599c4a['device']],{'showHidden':![],'depth':null}));this[_0x9553('0x21')](util[_0x9553('0x2e')](_0x9553('0x3c'),this[_0x9553('0x9')][_0x599c4a[_0x9553('0x31')]][_0x9553('0x2f')]),_0x9553('0x30'),this[_0x9553('0x9')][_0x599c4a[_0x9553('0x31')]]);}else if(_[_0x9553('0x3d')](_0x599c4a[_0x9553('0x31')],'Local')){var _0x1c0001=_0x599c4a[_0x9553('0x31')];var _0x22a6fc=_0x1c0001[_0x9553('0x3e')](_0x1c0001[_0x9553('0x3f')]('/')+0x1,_0x1c0001['indexOf']('@'));var _0x2b021a=_[_0x9553('0x27')](this[_0x9553('0xa')],function(_0x210f82){return _0x210f82[_0x9553('0x40')]==_0x22a6fc||_0x210f82['phone']==_0x22a6fc||_0x210f82[_0x9553('0x41')]==_0x22a6fc;});if(_0x2b021a){if(_0x2b021a[_0x9553('0x24')]!==_0x599c4a[_0x9553('0x24')][_0x9553('0x34')]()){_0x2b021a[_0x9553('0x35')]=_[_0x9553('0x36')](moment()[_0x9553('0x2e')]('x'));}_0x2b021a[_0x9553('0x24')]=_0x599c4a[_0x9553('0x24')][_0x9553('0x34')]();_0x2b021a[_0x9553('0x33')]=!![];_0x2b021a[_0x9553('0x37')](_0x599c4a);}}}}catch(_0xc7fe60){logger[_0x9553('0x18')](_0x9553('0x32'),util['inspect'](_0xc7fe60,{'showHidden':![],'depth':null}));}};UserReport[_0x9553('0x1e')][_0x9553('0x13')]=function(_0x5232fe){try{if(this[_0x9553('0x20')](_0x5232fe)&&this[_0x9553('0x20')](_0x5232fe[_0x9553('0x12')])){logger[_0x9553('0x22')](_0x9553('0x42'),_0x5232fe['peer'],_0x5232fe[_0x9553('0x43')],_0x5232fe['peerstatus']);logger[_0x9553('0x25')](_0x9553('0x44'),util[_0x9553('0x1a')](_0x5232fe,{'showHidden':![],'depth':null}));if(this[_0x9553('0xa')][_0x5232fe['peer']]){if(!this[_0x9553('0xa')][_0x5232fe['peer']][_0x9553('0x33')]||_0x5232fe[_0x9553('0x12')][_0x9553('0x34')]()==_0x9553('0x45')){this[_0x9553('0xa')][_0x5232fe[_0x9553('0x46')]][_0x9553('0x33')]=![];this[_0x9553('0xa')][_0x5232fe[_0x9553('0x46')]][_0x9553('0x47')]=_0x5232fe[_0x9553('0x12')][_0x9553('0x34')]();this[_0x9553('0xa')][_0x5232fe['peer']][_0x9553('0x43')]=_0x5232fe[_0x9553('0x43')];this[_0x9553('0xa')][_0x5232fe[_0x9553('0x46')]]['updateStatusRealtime'](_0x5232fe);}}else if(this[_0x9553('0xb')][_0x5232fe[_0x9553('0x46')]]){this[_0x9553('0xb')][_0x5232fe[_0x9553('0x46')]][_0x9553('0x47')]=_0x5232fe[_0x9553('0x12')][_0x9553('0x34')]();this[_0x9553('0xb')][_0x5232fe[_0x9553('0x46')]][_0x9553('0x43')]=_0x5232fe['address'];logger[_0x9553('0x25')]('[userReport][peerstatus]\x20sending\x20telephone:save\x20event:',util['inspect'](this[_0x9553('0xb')][_0x5232fe[_0x9553('0x46')]],{'showHidden':![],'depth':null}));this[_0x9553('0x21')](util[_0x9553('0x2e')](_0x9553('0x39'),this[_0x9553('0xb')][_0x5232fe['peer']][_0x9553('0x2f')]),'telephone:save',this[_0x9553('0xb')][_0x5232fe[_0x9553('0x46')]]);}else if(this[_0x9553('0x9')][_0x5232fe['peer']]){this[_0x9553('0x9')][_0x5232fe[_0x9553('0x46')]][_0x9553('0x47')]=_0x5232fe[_0x9553('0x12')][_0x9553('0x34')]();this[_0x9553('0x9')][_0x5232fe[_0x9553('0x46')]]['address']=_0x5232fe[_0x9553('0x43')];logger[_0x9553('0x25')](_0x9553('0x48'),util[_0x9553('0x1a')](this['trunks'][_0x5232fe['peer']],{'showHidden':![],'depth':null}));this[_0x9553('0x21')](util[_0x9553('0x2e')]('trunk:%s',this[_0x9553('0x9')][_0x5232fe[_0x9553('0x46')]][_0x9553('0x2f')]),'trunk:save',this[_0x9553('0x9')][_0x5232fe[_0x9553('0x46')]]);}}}catch(_0x5f8b90){logger[_0x9553('0x18')]('[userReport][peerstatus]',util[_0x9553('0x1a')](_0x5f8b90,{'showHidden':![],'depth':null}));}};module['exports']=UserReport; \ No newline at end of file diff --git a/server/services/ami/report/voiceAgentReport.js b/server/services/ami/report/voiceAgentReport.js index d69c8e2..bdc6fc0 100644 --- a/server/services/ami/report/voiceAgentReport.js +++ b/server/services/ami/report/voiceAgentReport.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xaea1=['variable','[%s][voiceAgentReport][varset]\x20destuniqueid:%s\x20variable:%s\x20value:%s','value','rtpaudioqos','rtpaudioqosbridged','rtpaudioqosjitter','rtpaudioqosloss','rtpaudioqoslossbridged','rtpaudioqosrtt','rtpaudioqosrttbridged','sipcallid','sipuri','bridgepeer','bridgepvtcallid','membercalls','memberdynamic','memberinterface','memberlastcall','memberpenalty','memberrealtime','includes','syncHangup','[%s][voiceAgentReport][hangup]\x20event:','transfer','[%s][voiceAgentReport][hangup]\x20sending\x20voiceAgentReport\x20event:','custom:voiceAgentReport','values','[%s][voiceAgentReport][hangup]','[%s][voiceAgentReport][attendedtransfer]\x20event:','transfereeuniqueid','origtransfereruniqueid','[%s][voiceAgentReport][attendedtransfer]\x20agent:%s\x20destuniqueid:%s\x20lastevent:complete','complete','diff','seconds','secondtransfereruniqueid','[%s][voiceAgentReport][attendedtransfer]','[%s][voiceAgentReport][blindtransfer]\x20agent:%s\x20destuniqueid:%s\x20lastevent:complete','[%s][voiceAgentReport][blindtransfer]','channel','substring','lastIndexOf','[%s][voiceAgentReport][musiconholdstart]\x20interface:%s','onhold','[%s][voiceAgentReport][musiconholdstart]','[%s][voiceAgentReport][musiconholdstop]\x20event:','[%s][voiceAgentReport][musiconholdstop]\x20interface:%s','[%s][voiceAgentReport][musiconholdstop]','exports','moment','ioredis','../../../config/environment','../../../config/logger','ami','../ami','redis','defaults','socket.io-emitter','channels','voiceChannels','voiceQueues','agents','variables','syncAgentCalled','agentconnect','bind','syncAgentRingNoAnswer','syncQueueCallerAbandon','syncAgentComplete','varset','syncVarSet','hangup','syncMusicOnHoldStart','musiconholdstop','syncMusicOnHoldStop','syncAttendedTransfer','blindtransfer','syncBlindTransfer','emit','prototype','isUndefined','[%s][voiceAgentReport][agentcalled]\x20agent:%s\x20destuniqueid:%s\x20lastevent:called','uniqueid','membername','destuniqueid','debug','inspect','YYYY-MM-DD\x20HH:mm:ss','called','mandatoryDisposition','type','voice','omit','event','privilege','[%s][voiceAgentReport][agentcalled]\x20sending\x20agentcalled\x20event:','[%s][voiceAgentReport][agentcalled]\x20sending\x20user:called\x20event:','format','user:%s','user:called','error','[%s][voiceAgentReport][agentcalled]','syncAgentConnect','isNotNull','hasOwnProperty','info','[%s][voiceAgentReport][agentconnect]\x20agent:%s\x20destuniqueid:%s\x20lastevent:connect','agentconnectAt','connectedlinename','connectedlinenum','destchannelstate','destchannelstatedesc','holdtime','routealias','merge','pick','queue','destconnectedlinenum','interface','name','exten','custom:agentconnect','user:agentconnect','agentringnoanswer','agentcomplete','[%s][voiceAgentReport][agentconnect]\x20agent:%s\x20destuniqueid:%s\x20lastevent:answered_elsewhere','agentringnoanswerAt','answeredelsewheredestinationuniqueid','answeredelsewheremembername','lastevent','answered_elsewhere','reason','[%s][voiceAgentReport][agentconnect]\x20sending\x20agentansweredelsewhere\x20event:','custom:agentansweredelsewhere','[%s][voiceAgentReport][agentconnect]\x20Else\x20path\x20should\x20never\x20be\x20taken','[%s][voiceAgentReport][agentringnoanswer]\x20event:','[%s][voiceAgentReport][agentringnoanswer]\x20agent:%s\x20destuniqueid:%s\x20lastevent:rejected','rejected','[%s][voiceAgentReport][agentringnoanswer]\x20sending\x20agentringnoanswer\x20event:','user:agentringnoanswer','custom:agentringnoanswer','assign','[%s][voiceAgentReport][queuecallerabandon]\x20event:','abandoned','[%s][voiceAgentReport][queuecallerabandon]\x20sending\x20agentqueuecallerabandon\x20event:','[%s][voiceAgentReport][queuecallerabandon]','[%s][voiceAgentReport][agentcomplete]\x20event:','agentcompleteAt','agent','talktime','acwtime','acwTimeout','agentacw','custom:agentcomplete','[%s][voiceAgentReport][agentcomplete]\x20sending\x20user:agentcomplete\x20event:','user:agentcomplete','destaccountcode','[%s][voiceAgentReport][agentcomplete]','[%s][voiceAgentReport][varset]\x20event:','keys'];(function(_0x89ab90,_0x1daef2){var _0x22e5b7=function(_0x2bad10){while(--_0x2bad10){_0x89ab90['push'](_0x89ab90['shift']());}};_0x22e5b7(++_0x1daef2);}(_0xaea1,0xd1));var _0x1aea=function(_0x1facfa,_0x1acf7d){_0x1facfa=_0x1facfa-0x0;var _0x9ec701=_0xaea1[_0x1facfa];return _0x9ec701;};'use strict';var _=require('lodash');var moment=require(_0x1aea('0x0'));var util=require('util');var Redis=require(_0x1aea('0x1'));var config=require(_0x1aea('0x2'));var logger=require(_0x1aea('0x3'))(_0x1aea('0x4'));var ami=require(_0x1aea('0x5'));config[_0x1aea('0x6')]=_[_0x1aea('0x7')](config[_0x1aea('0x6')],{'host':'localhost','port':0x18eb});var io=require(_0x1aea('0x8'))(new Redis(config[_0x1aea('0x6')]));function VoiceAgentReport(_0x4e8fc4){this[_0x1aea('0x9')]={};this[_0x1aea('0xa')]=_0x4e8fc4['channels'];this[_0x1aea('0xb')]=_0x4e8fc4['voiceQueues'];this[_0x1aea('0xc')]=_0x4e8fc4[_0x1aea('0xc')];this[_0x1aea('0xd')]={};ami['on']('agentcalled',this[_0x1aea('0xe')]['bind'](this));ami['on'](_0x1aea('0xf'),this['syncAgentConnect'][_0x1aea('0x10')](this));ami['on']('agentringnoanswer',this[_0x1aea('0x11')][_0x1aea('0x10')](this));ami['on']('queuecallerabandon',this[_0x1aea('0x12')]['bind'](this));ami['on']('agentcomplete',this[_0x1aea('0x13')][_0x1aea('0x10')](this));ami['on'](_0x1aea('0x14'),this[_0x1aea('0x15')][_0x1aea('0x10')](this));ami['on'](_0x1aea('0x16'),this['syncHangup'][_0x1aea('0x10')](this));ami['on']('musiconholdstart',this[_0x1aea('0x17')]['bind'](this));ami['on'](_0x1aea('0x18'),this[_0x1aea('0x19')]['bind'](this));ami['on']('attendedtransfer',this[_0x1aea('0x1a')][_0x1aea('0x10')](this));ami['on'](_0x1aea('0x1b'),this[_0x1aea('0x1c')][_0x1aea('0x10')](this));}VoiceAgentReport['prototype']['emit']=function(_0x26717e,_0x25d6c5,_0x3d763f){io['to'](_0x26717e)[_0x1aea('0x1d')](_0x25d6c5,_0x3d763f);};VoiceAgentReport[_0x1aea('0x1e')]['isNotNull']=function(_0x483d87){return _0x483d87!==null&&!_[_0x1aea('0x1f')](_0x483d87);};VoiceAgentReport[_0x1aea('0x1e')][_0x1aea('0xe')]=function(_0x4be418){try{if(this['isNotNull'](_0x4be418)){logger['info'](_0x1aea('0x20'),_0x4be418[_0x1aea('0x21')],_0x4be418[_0x1aea('0x22')],_0x4be418[_0x1aea('0x23')]);logger[_0x1aea('0x24')]('[%s][voiceAgentReport][agentcalled]\x20event:',_0x4be418['uniqueid'],util[_0x1aea('0x25')](_0x4be418,{'showHidden':![],'depth':null}));if(_['isUndefined'](this[_0x1aea('0x9')][_0x4be418[_0x1aea('0x21')]])){this[_0x1aea('0x9')][_0x4be418[_0x1aea('0x21')]]={};}var _0x1fdf1a=this[_0x1aea('0xc')][_0x4be418['interface']];var _0x567dae=this[_0x1aea('0x9')][_0x4be418['uniqueid']][_0x4be418[_0x1aea('0x23')]];var _0x8a33f4=this['voiceQueues'][_0x4be418['queue']];var _0x4fe23a=this[_0x1aea('0xd')][_0x4be418[_0x1aea('0x21')]];if(_[_0x1aea('0x1f')](_0x567dae)){_0x567dae={'agentcalledAt':moment()['format'](_0x1aea('0x26')),'lastevent':_0x1aea('0x27'),'mandatoryDisposition':_0x8a33f4&&_0x8a33f4['mandatoryDisposition']?_0x8a33f4[_0x1aea('0x28')]:![],'type':_0x8a33f4&&_0x8a33f4[_0x1aea('0x29')]?_0x8a33f4[_0x1aea('0x29')]:'inbound','variables':_0x4fe23a,'motionChannel':_0x1aea('0x2a')};}Object['assign'](_0x567dae,_[_0x1aea('0x2b')](_0x4be418,[_0x1aea('0x2c'),_0x1aea('0x2d')]));this[_0x1aea('0x9')][_0x4be418[_0x1aea('0x21')]][_0x4be418[_0x1aea('0x23')]]=_0x567dae;logger[_0x1aea('0x24')](_0x1aea('0x2e'),_0x4be418[_0x1aea('0x21')],util[_0x1aea('0x25')](_0x567dae,{'showHidden':![],'depth':null}));ami['emit']('custom:agentcalled',_0x567dae);var _0x397a70={'id':_0x1fdf1a['id'],'calleridnum':_0x567dae['calleridnum'],'queue':_0x567dae['queue'],'variables':_0x567dae[_0x1aea('0xd')],'uniqueid':_0x4be418[_0x1aea('0x21')]};logger[_0x1aea('0x24')](_0x1aea('0x2f'),_0x4be418['uniqueid'],util['inspect'](_0x397a70,{'showHidden':![],'depth':null}));this[_0x1aea('0x1d')](util[_0x1aea('0x30')](_0x1aea('0x31'),_0x4be418['membername']),_0x1aea('0x32'),_0x397a70);}}catch(_0x114cd9){logger[_0x1aea('0x33')](_0x1aea('0x34'),_0x4be418[_0x1aea('0x21')],util[_0x1aea('0x25')](_0x114cd9,{'showHidden':![],'depth':null}));}};VoiceAgentReport[_0x1aea('0x1e')][_0x1aea('0x35')]=function(_0x2c757f){try{if(this[_0x1aea('0x36')](_0x2c757f)){if(this[_0x1aea('0x9')][_0x2c757f['uniqueid']]){for(var _0x76f0b6 in this[_0x1aea('0x9')][_0x2c757f['uniqueid']]){if(this[_0x1aea('0x9')][_0x2c757f[_0x1aea('0x21')]][_0x1aea('0x37')](_0x76f0b6)){if(_0x2c757f[_0x1aea('0x23')]===_0x76f0b6){logger[_0x1aea('0x38')](_0x1aea('0x39'),_0x2c757f['uniqueid'],_0x2c757f[_0x1aea('0x22')],_0x2c757f[_0x1aea('0x23')]);this['channels'][_0x2c757f[_0x1aea('0x21')]][_0x76f0b6][_0x1aea('0x3a')]=moment()[_0x1aea('0x30')](_0x1aea('0x26'));this[_0x1aea('0x9')][_0x2c757f[_0x1aea('0x21')]][_0x76f0b6][_0x1aea('0x3b')]=_0x2c757f[_0x1aea('0x3b')];this[_0x1aea('0x9')][_0x2c757f['uniqueid']][_0x76f0b6][_0x1aea('0x3c')]=_0x2c757f['connectedlinenum'];this[_0x1aea('0x9')][_0x2c757f[_0x1aea('0x21')]][_0x76f0b6][_0x1aea('0x3d')]=_0x2c757f['destchannelstate'];this[_0x1aea('0x9')][_0x2c757f[_0x1aea('0x21')]][_0x76f0b6][_0x1aea('0x3e')]=_0x2c757f['destchannelstatedesc'];this[_0x1aea('0x9')][_0x2c757f[_0x1aea('0x21')]][_0x76f0b6][_0x1aea('0x3f')]=_0x2c757f[_0x1aea('0x3f')];this[_0x1aea('0x9')][_0x2c757f['uniqueid']][_0x76f0b6]['lastevent']='connect';if(this[_0x1aea('0xa')][this['channels'][_0x2c757f[_0x1aea('0x21')]][_0x76f0b6]['uniqueid']]){var _0x2c94b7=this[_0x1aea('0xa')][this['channels'][_0x2c757f[_0x1aea('0x21')]][_0x76f0b6]['uniqueid']]['routealias'];this[_0x1aea('0x9')][_0x2c757f[_0x1aea('0x21')]][_0x76f0b6][_0x1aea('0x40')]=_0x2c94b7;_0x2c757f[_0x1aea('0x40')]=_0x2c94b7;}_[_0x1aea('0x41')](this['agents'][_0x2c757f['interface']],_[_0x1aea('0x42')](_0x2c757f,[_0x1aea('0x43'),_0x1aea('0x44'),'routealias']));var _0x2b0f93=this['agents'][_0x2c757f[_0x1aea('0x45')]];var _0x523bbb={'id':_0x2b0f93['id'],'name':_0x2b0f93[_0x1aea('0x46')],'agentconnected':!![],'destaccountcode':_0x2b0f93['accountcode'],'destconnectedlinenum':this[_0x1aea('0x9')][_0x2c757f[_0x1aea('0x21')]][_0x2c757f[_0x1aea('0x23')]][_0x1aea('0x47')],'queue':this[_0x1aea('0x9')][_0x2c757f[_0x1aea('0x21')]][_0x2c757f[_0x1aea('0x23')]][_0x1aea('0x43')],'routealias':this[_0x1aea('0x9')][_0x2c757f[_0x1aea('0x21')]][_0x2c757f['destuniqueid']][_0x1aea('0x40')],'uniqueid':this[_0x1aea('0x9')][_0x2c757f[_0x1aea('0x21')]][_0x2c757f[_0x1aea('0x23')]][_0x1aea('0x21')]};ami[_0x1aea('0x1d')](_0x1aea('0x48'),this['channels'][_0x2c757f[_0x1aea('0x21')]][_0x2c757f[_0x1aea('0x23')]]);this['emit'](util[_0x1aea('0x30')](_0x1aea('0x31'),_0x2c757f[_0x1aea('0x22')]),_0x1aea('0x49'),_0x523bbb);}else if(!this[_0x1aea('0x9')][_0x2c757f[_0x1aea('0x21')]][_0x76f0b6][_0x1aea('0x4a')]&&!this['channels'][_0x2c757f[_0x1aea('0x21')]][_0x76f0b6][_0x1aea('0x4b')]){logger[_0x1aea('0x38')](_0x1aea('0x4c'),_0x2c757f['uniqueid'],this[_0x1aea('0x9')][_0x2c757f[_0x1aea('0x21')]][_0x76f0b6][_0x1aea('0x22')],_0x76f0b6);this[_0x1aea('0x9')][_0x2c757f[_0x1aea('0x21')]][_0x76f0b6][_0x1aea('0x4a')]=!![];this['channels'][_0x2c757f[_0x1aea('0x21')]][_0x76f0b6][_0x1aea('0x4d')]=moment()[_0x1aea('0x30')]('YYYY-MM-DD\x20HH:mm:ss');this[_0x1aea('0x9')][_0x2c757f['uniqueid']][_0x76f0b6][_0x1aea('0x4e')]=_0x2c757f[_0x1aea('0x23')];this[_0x1aea('0x9')][_0x2c757f[_0x1aea('0x21')]][_0x76f0b6][_0x1aea('0x4f')]=_0x2c757f['membername'];this['channels'][_0x2c757f[_0x1aea('0x21')]][_0x76f0b6][_0x1aea('0x50')]=_0x1aea('0x51');this[_0x1aea('0x9')][_0x2c757f[_0x1aea('0x21')]][_0x76f0b6][_0x1aea('0x52')]=_0x1aea('0x51');logger[_0x1aea('0x24')](_0x1aea('0x53'),_0x2c757f[_0x1aea('0x21')],util[_0x1aea('0x25')](this[_0x1aea('0x9')][_0x2c757f[_0x1aea('0x21')]][_0x76f0b6],{'showHidden':![],'depth':null}));ami[_0x1aea('0x1d')](_0x1aea('0x54'),this[_0x1aea('0x9')][_0x2c757f[_0x1aea('0x21')]][_0x76f0b6]);}else{logger['debug'](_0x1aea('0x55'),_0x2c757f[_0x1aea('0x21')]);}}}}}}catch(_0x31cdb4){logger[_0x1aea('0x33')]('[%s][voiceAgentReport][agentconnect]',_0x2c757f[_0x1aea('0x21')],util['inspect'](_0x31cdb4,{'showHidden':![],'depth':null}));}};VoiceAgentReport['prototype'][_0x1aea('0x11')]=function(_0x8807f1){try{if(this['isNotNull'](_0x8807f1)){logger[_0x1aea('0x24')](_0x1aea('0x56'),_0x8807f1['uniqueid'],util[_0x1aea('0x25')](_0x8807f1,{'showHidden':![],'depth':null}));if(this[_0x1aea('0x9')][_0x8807f1[_0x1aea('0x21')]]&&this[_0x1aea('0x9')][_0x8807f1[_0x1aea('0x21')]][_0x8807f1['destuniqueid']]){logger[_0x1aea('0x38')](_0x1aea('0x57'),_0x8807f1['uniqueid'],_0x8807f1['membername'],_0x8807f1[_0x1aea('0x23')]);var _0x102a1d=this[_0x1aea('0xc')][_0x8807f1['interface']];var _0x1bc790=this[_0x1aea('0x9')][_0x8807f1['uniqueid']][_0x8807f1[_0x1aea('0x23')]];_0x1bc790['agentringnoanswer']=!![];_0x1bc790['agentringnoanswerAt']=moment()[_0x1aea('0x30')](_0x1aea('0x26'));_0x1bc790[_0x1aea('0x50')]='rejected';_0x1bc790[_0x1aea('0x52')]=_0x1aea('0x58');var _0x43d9cf={'id':_0x102a1d['id'],'name':_0x102a1d[_0x1aea('0x46')],'queue':_0x1bc790['queue'],'uniqueid':_0x1bc790[_0x1aea('0x21')]};logger[_0x1aea('0x24')](_0x1aea('0x59'),_0x8807f1[_0x1aea('0x21')],util['inspect'](_0x43d9cf,{'showHidden':![],'depth':null}));this[_0x1aea('0x1d')](util['format']('user:%s',_0x102a1d['name']),_0x1aea('0x5a'),_0x43d9cf);ami['emit'](_0x1aea('0x5b'),_0x1bc790);this[_0x1aea('0x9')][_0x8807f1[_0x1aea('0x21')]][_0x8807f1[_0x1aea('0x23')]]=Object[_0x1aea('0x5c')]({},_0x1bc790);}}}catch(_0xc8e64d){logger[_0x1aea('0x33')]('[%s][voiceAgentReport][agentringnoanswer]',_0x8807f1[_0x1aea('0x21')],util[_0x1aea('0x25')](_0xc8e64d,{'showHidden':![],'depth':null}));}};VoiceAgentReport[_0x1aea('0x1e')][_0x1aea('0x12')]=function(_0x1badbc){try{if(this['isNotNull'](_0x1badbc)){logger[_0x1aea('0x24')](_0x1aea('0x5d'),_0x1badbc[_0x1aea('0x21')],util[_0x1aea('0x25')](_0x1badbc,{'showHidden':![],'depth':null}));if(this[_0x1aea('0x9')][_0x1badbc[_0x1aea('0x21')]]){for(var _0x521b44 in this['channels'][_0x1badbc[_0x1aea('0x21')]]){if(this[_0x1aea('0x9')][_0x1badbc[_0x1aea('0x21')]][_0x1aea('0x37')](_0x521b44)&&!this['channels'][_0x1badbc['uniqueid']][_0x521b44]['agentringnoanswer']&&!this['channels'][_0x1badbc[_0x1aea('0x21')]][_0x521b44][_0x1aea('0x4b')]){logger[_0x1aea('0x38')]('[%s][voiceAgentReport][queuecallerabandon]\x20agent:%s\x20destuniqueid:%s\x20lastevent:abandoned',_0x1badbc[_0x1aea('0x21')],this['channels'][_0x1badbc[_0x1aea('0x21')]][_0x521b44][_0x1aea('0x22')],_0x521b44);this['channels'][_0x1badbc[_0x1aea('0x21')]][_0x521b44]['agentringnoanswer']=!![];this[_0x1aea('0x9')][_0x1badbc[_0x1aea('0x21')]][_0x521b44]['agentringnoanswerAt']=moment()[_0x1aea('0x30')](_0x1aea('0x26'));this[_0x1aea('0x9')][_0x1badbc[_0x1aea('0x21')]][_0x521b44][_0x1aea('0x50')]=_0x1aea('0x5e');this[_0x1aea('0x9')][_0x1badbc[_0x1aea('0x21')]][_0x521b44][_0x1aea('0x52')]=_0x1aea('0x5e');logger[_0x1aea('0x24')](_0x1aea('0x5f'),_0x1badbc[_0x1aea('0x21')],util[_0x1aea('0x25')](this[_0x1aea('0x9')][_0x1badbc[_0x1aea('0x21')]][_0x521b44],{'showHidden':![],'depth':null}));ami[_0x1aea('0x1d')]('custom:agentqueuecallerabandon',this[_0x1aea('0x9')][_0x1badbc[_0x1aea('0x21')]][_0x521b44]);}}}}}catch(_0x4cc51b){logger['error'](_0x1aea('0x60'),_0x1badbc[_0x1aea('0x21')],util[_0x1aea('0x25')](_0x4cc51b,{'showHidden':![],'depth':null}));}};VoiceAgentReport['prototype'][_0x1aea('0x13')]=function(_0x5edc3a){try{if(this['isNotNull'](_0x5edc3a)){logger['debug'](_0x1aea('0x61'),_0x5edc3a['uniqueid'],util[_0x1aea('0x25')](_0x5edc3a,{'showHidden':![],'depth':null}));if(this[_0x1aea('0x9')][_0x5edc3a[_0x1aea('0x21')]]){for(var _0x3d1ee8 in this[_0x1aea('0x9')][_0x5edc3a[_0x1aea('0x21')]]){if(this[_0x1aea('0x9')][_0x5edc3a[_0x1aea('0x21')]][_0x1aea('0x37')](_0x3d1ee8)){if(this[_0x1aea('0x9')][_0x5edc3a[_0x1aea('0x21')]][_0x3d1ee8][_0x1aea('0x3a')]&&!this[_0x1aea('0x9')][_0x5edc3a[_0x1aea('0x21')]][_0x3d1ee8][_0x1aea('0x4b')]){logger[_0x1aea('0x38')]('[%s][voiceAgentReport][agentcomplete]\x20agent:%s\x20destuniqueid:%s\x20lastevent:complete',_0x5edc3a[_0x1aea('0x21')],this['channels'][_0x5edc3a[_0x1aea('0x21')]][_0x3d1ee8]['membername'],_0x3d1ee8);this[_0x1aea('0x9')][_0x5edc3a[_0x1aea('0x21')]][_0x3d1ee8]['agentcomplete']=!![];this[_0x1aea('0x9')][_0x5edc3a['uniqueid']][_0x3d1ee8][_0x1aea('0x62')]=moment()[_0x1aea('0x30')](_0x1aea('0x26'));this[_0x1aea('0x9')][_0x5edc3a[_0x1aea('0x21')]][_0x3d1ee8][_0x1aea('0x50')]='complete';this['channels'][_0x5edc3a[_0x1aea('0x21')]][_0x3d1ee8][_0x1aea('0x52')]=_0x5edc3a[_0x1aea('0x52')]=='transfer'?_0x1aea('0x63'):_0x5edc3a[_0x1aea('0x52')];this[_0x1aea('0x9')][_0x5edc3a[_0x1aea('0x21')]][_0x3d1ee8]['talktime']=_0x5edc3a[_0x1aea('0x64')];if(this[_0x1aea('0xb')][_0x5edc3a[_0x1aea('0x43')]]&&this[_0x1aea('0xb')][_0x5edc3a[_0x1aea('0x43')]]['acw']){this['channels'][_0x5edc3a[_0x1aea('0x21')]][_0x3d1ee8][_0x1aea('0x65')]=this[_0x1aea('0xb')][_0x5edc3a[_0x1aea('0x43')]][_0x1aea('0x66')];this[_0x1aea('0x9')][_0x5edc3a[_0x1aea('0x21')]][_0x3d1ee8][_0x1aea('0x67')]=!![];}this[_0x1aea('0xc')][_0x5edc3a['interface']]=_[_0x1aea('0x2b')](this[_0x1aea('0xc')][_0x5edc3a[_0x1aea('0x45')]],[_0x1aea('0x43'),_0x1aea('0x44')]);logger['debug']('[%s][voiceAgentReport][agentcomplete]\x20sending\x20agentcomplete\x20event:',_0x5edc3a[_0x1aea('0x21')],util['inspect'](this[_0x1aea('0x9')][_0x5edc3a['uniqueid']][_0x3d1ee8],{'showHidden':![],'depth':null}));ami[_0x1aea('0x1d')](_0x1aea('0x68'),this['channels'][_0x5edc3a[_0x1aea('0x21')]][_0x3d1ee8]);logger[_0x1aea('0x24')](_0x1aea('0x69'),_0x5edc3a['uniqueid'],util['inspect']({'id':this[_0x1aea('0xc')][_0x5edc3a[_0x1aea('0x45')]]['id'],'destaccountcode':_0x5edc3a['destaccountcode']},{'showHidden':![],'depth':null}));this[_0x1aea('0x1d')](util[_0x1aea('0x30')](_0x1aea('0x31'),_0x5edc3a['membername']),_0x1aea('0x6a'),{'id':this[_0x1aea('0xc')][_0x5edc3a[_0x1aea('0x45')]]['id'],'destaccountcode':Number(_0x5edc3a[_0x1aea('0x6b')])});}}}}}}catch(_0x317f6b){logger[_0x1aea('0x33')](_0x1aea('0x6c'),_0x5edc3a[_0x1aea('0x21')],util[_0x1aea('0x25')](_0x317f6b,{'showHidden':![],'depth':null}));}};VoiceAgentReport[_0x1aea('0x1e')][_0x1aea('0x15')]=function(_0xc8e57d){try{if(this[_0x1aea('0x36')](_0xc8e57d)){logger['debug'](_0x1aea('0x6d'),_0xc8e57d[_0x1aea('0x21')],util[_0x1aea('0x25')](_0xc8e57d,{'showHidden':![],'depth':null}));this['addVariable'](_0xc8e57d['uniqueid'],_[_0x1aea('0x6e')](_0xc8e57d[_0x1aea('0x6f')])[0x0],_0xc8e57d['value']);if(this[_0x1aea('0x9')][_0xc8e57d['uniqueid']]){for(var _0x13248b in this['channels'][_0xc8e57d['uniqueid']]){if(this['channels'][_0xc8e57d[_0x1aea('0x21')]][_0x1aea('0x37')](_0x13248b)){logger['info'](_0x1aea('0x70'),_0xc8e57d[_0x1aea('0x21')],_0x13248b,_['keys'](_0xc8e57d[_0x1aea('0x6f')])[0x0],_0xc8e57d[_0x1aea('0x71')]);if(_[_0x1aea('0x1f')](this[_0x1aea('0x9')][_0xc8e57d[_0x1aea('0x21')]][_0x13248b][_0x1aea('0xd')])){this[_0x1aea('0x9')][_0xc8e57d['uniqueid']][_0x13248b][_0x1aea('0xd')]={};}this[_0x1aea('0x9')][_0xc8e57d['uniqueid']][_0x13248b][_0x1aea('0xd')]=this[_0x1aea('0xd')][_0xc8e57d[_0x1aea('0x21')]];}}}}}catch(_0x416916){logger['error']('[%s][voiceAgentReport][varset]',_0xc8e57d[_0x1aea('0x21')],util['inspect'](_0x416916,{'showHidden':![],'depth':null}));}};VoiceAgentReport[_0x1aea('0x1e')]['addVariable']=function(_0x1b73c2,_0x343e29,_0x5e0649){var _0x4acefe=[_0x1aea('0x72'),_0x1aea('0x73'),_0x1aea('0x74'),'rtpaudioqosjitterbridged',_0x1aea('0x75'),_0x1aea('0x76'),_0x1aea('0x77'),_0x1aea('0x78'),_0x1aea('0x79'),_0x1aea('0x7a'),_0x1aea('0x7b'),_0x1aea('0x7c'),_0x1aea('0x7d'),_0x1aea('0x7e'),_0x1aea('0x7f'),_0x1aea('0x80'),_0x1aea('0x22'),_0x1aea('0x81'),_0x1aea('0x82')];if(!_['isNil'](_0x343e29)&&!_[_0x1aea('0x83')](_0x4acefe,_0x343e29)){if(_['isUndefined'](this[_0x1aea('0xd')][_0x1b73c2])){this[_0x1aea('0xd')][_0x1b73c2]={};}this[_0x1aea('0xd')][_0x1b73c2][_0x343e29]=_0x5e0649;}};VoiceAgentReport['prototype'][_0x1aea('0x84')]=function(_0x2d5728){try{if(this[_0x1aea('0x36')](_0x2d5728)){logger['debug'](_0x1aea('0x85'),_0x2d5728['uniqueid'],util[_0x1aea('0x25')](_0x2d5728,{'showHidden':![],'depth':null}));if(this[_0x1aea('0x9')][_0x2d5728[_0x1aea('0x21')]]){for(var _0x31d31c in this[_0x1aea('0x9')][_0x2d5728[_0x1aea('0x21')]]){if(this[_0x1aea('0x9')][_0x2d5728[_0x1aea('0x21')]]['hasOwnProperty'](_0x31d31c)){if(this[_0x1aea('0x9')][_0x2d5728[_0x1aea('0x21')]][_0x31d31c][_0x1aea('0x52')]==_0x1aea('0x86')&&this[_0x1aea('0x9')][_0x2d5728['uniqueid']][_0x31d31c][_0x1aea('0x4b')]){logger[_0x1aea('0x38')]('[%s][voiceAgentReport][hangup]\x20destuniqueid:%s',_0x2d5728[_0x1aea('0x21')],_0x31d31c);this[_0x1aea('0x9')][_0x2d5728[_0x1aea('0x21')]][_0x31d31c][_0x1aea('0x62')]=moment()['format'](_0x1aea('0x26'));}}}logger['debug'](_0x1aea('0x87'),_0x2d5728[_0x1aea('0x21')],util[_0x1aea('0x25')](_['values'](this[_0x1aea('0x9')][_0x2d5728[_0x1aea('0x21')]]),{'showHidden':![],'depth':null}));ami[_0x1aea('0x1d')](_0x1aea('0x88'),_[_0x1aea('0x89')](this[_0x1aea('0x9')][_0x2d5728['uniqueid']]));delete this[_0x1aea('0x9')][_0x2d5728[_0x1aea('0x21')]];}if(this['variables'][_0x2d5728[_0x1aea('0x21')]]){delete this[_0x1aea('0xd')][_0x2d5728[_0x1aea('0x21')]];}}}catch(_0x2e8705){logger[_0x1aea('0x33')](_0x1aea('0x8a'),_0x2d5728[_0x1aea('0x21')],util[_0x1aea('0x25')](_0x2e8705,{'showHidden':![],'depth':null}));}};VoiceAgentReport[_0x1aea('0x1e')][_0x1aea('0x1a')]=function(_0x31c763){try{if(this[_0x1aea('0x36')](_0x31c763)){logger[_0x1aea('0x24')](_0x1aea('0x8b'),_0x31c763[_0x1aea('0x21')],util[_0x1aea('0x25')](_0x31c763,{'showHidden':![],'depth':null}));if(this[_0x1aea('0x9')][_0x31c763[_0x1aea('0x8c')]]){for(var _0x3efde1 in this[_0x1aea('0x9')][_0x31c763[_0x1aea('0x8c')]]){if(this['channels'][_0x31c763['transfereeuniqueid']]['hasOwnProperty'](_0x3efde1)){if(_0x31c763[_0x1aea('0x8d')]===_0x3efde1){logger[_0x1aea('0x38')](_0x1aea('0x8e'),_0x31c763[_0x1aea('0x21')],this[_0x1aea('0x9')][_0x31c763['transfereeuniqueid']][_0x3efde1][_0x1aea('0x22')],_0x3efde1);var _0x445535=moment();this[_0x1aea('0x9')][_0x31c763[_0x1aea('0x8c')]][_0x3efde1][_0x1aea('0x4b')]=!![];this['channels'][_0x31c763['transfereeuniqueid']][_0x3efde1]['agentcompleteAt']=moment()[_0x1aea('0x30')](_0x1aea('0x26'));this[_0x1aea('0x9')][_0x31c763[_0x1aea('0x8c')]][_0x3efde1][_0x1aea('0x50')]=_0x1aea('0x8f');this[_0x1aea('0x9')][_0x31c763[_0x1aea('0x8c')]][_0x3efde1][_0x1aea('0x52')]=_0x1aea('0x86');this[_0x1aea('0x9')][_0x31c763[_0x1aea('0x8c')]][_0x3efde1][_0x1aea('0x64')]=_0x445535[_0x1aea('0x90')](this['channels'][_0x31c763[_0x1aea('0x8c')]][_0x3efde1]['agentconnectAt'],_0x1aea('0x91'));}}}}if(this[_0x1aea('0x9')][_0x31c763[_0x1aea('0x92')]]){var _0x496772=this[_0x1aea('0x9')][_0x31c763[_0x1aea('0x92')]];this[_0x1aea('0x9')][_0x31c763[_0x1aea('0x92')]]=this[_0x1aea('0x9')][_0x31c763[_0x1aea('0x8c')]];this[_0x1aea('0x9')][_0x31c763[_0x1aea('0x8c')]]=_0x496772;}}}catch(_0x5e8c89){logger[_0x1aea('0x33')](_0x1aea('0x93'),_0x31c763[_0x1aea('0x21')],util[_0x1aea('0x25')](_0x5e8c89,{'showHidden':![],'depth':null}));}};VoiceAgentReport[_0x1aea('0x1e')][_0x1aea('0x1c')]=function(_0x599df2){try{if(this[_0x1aea('0x36')](_0x599df2)){logger['debug']('[%s][voiceAgentReport][blindtransfer]\x20event:',_0x599df2[_0x1aea('0x21')],util[_0x1aea('0x25')](_0x599df2,{'showHidden':![],'depth':null}));if(this[_0x1aea('0x9')][_0x599df2[_0x1aea('0x8c')]]){for(var _0x235c69 in this[_0x1aea('0x9')][_0x599df2[_0x1aea('0x8c')]]){if(this['channels'][_0x599df2[_0x1aea('0x8c')]][_0x1aea('0x37')](_0x235c69)){if(_0x599df2['transfereruniqueid']===_0x235c69){logger[_0x1aea('0x38')](_0x1aea('0x94'),_0x599df2[_0x1aea('0x21')],this['channels'][_0x599df2[_0x1aea('0x8c')]][_0x235c69][_0x1aea('0x22')],_0x235c69);var _0x48aefa=moment();this['channels'][_0x599df2[_0x1aea('0x8c')]][_0x235c69][_0x1aea('0x4b')]=!![];this[_0x1aea('0x9')][_0x599df2[_0x1aea('0x8c')]][_0x235c69][_0x1aea('0x62')]=_0x48aefa;this[_0x1aea('0x9')][_0x599df2[_0x1aea('0x8c')]][_0x235c69]['lastevent']=_0x1aea('0x8f');this['channels'][_0x599df2['transfereeuniqueid']][_0x235c69][_0x1aea('0x52')]='transfer';this[_0x1aea('0x9')][_0x599df2[_0x1aea('0x8c')]][_0x235c69][_0x1aea('0x64')]=_0x48aefa[_0x1aea('0x90')](this[_0x1aea('0x9')][_0x599df2['transfereeuniqueid']][_0x235c69][_0x1aea('0x3a')],_0x1aea('0x91'));}}}}}}catch(_0x3d7fb5){logger[_0x1aea('0x33')](_0x1aea('0x95'),_0x599df2[_0x1aea('0x21')],util[_0x1aea('0x25')](_0x3d7fb5,{'showHidden':![],'depth':null}));}};VoiceAgentReport[_0x1aea('0x1e')][_0x1aea('0x17')]=function(_0x1583fe){var _0x2b05b4='';try{if(this['isNotNull'](_0x1583fe)){logger['debug']('[%s][voiceAgentReport][musiconholdstart]\x20event:',_0x1583fe[_0x1aea('0x21')],util['inspect'](_0x1583fe,{'showHidden':![],'depth':null}));if(_0x1583fe['channel']){_0x2b05b4=_0x1583fe[_0x1aea('0x96')][_0x1aea('0x97')](0x0,_0x1583fe[_0x1aea('0x96')][_0x1aea('0x98')]('-'));if(this[_0x1aea('0xc')][_0x2b05b4]){logger[_0x1aea('0x38')](_0x1aea('0x99'),_0x1583fe[_0x1aea('0x21')],_0x2b05b4);this['agents'][_0x2b05b4][_0x1aea('0x9a')]=!![];}}}}catch(_0x3c9e7d){logger[_0x1aea('0x33')](_0x1aea('0x9b'),_0x1583fe['uniqueid'],util[_0x1aea('0x25')](_0x3c9e7d,{'showHidden':![],'depth':null}));}};VoiceAgentReport[_0x1aea('0x1e')][_0x1aea('0x19')]=function(_0x35b4b5){var _0x517015='';try{if(this[_0x1aea('0x36')](_0x35b4b5)){logger[_0x1aea('0x24')](_0x1aea('0x9c'),_0x35b4b5['uniqueid'],util[_0x1aea('0x25')](_0x35b4b5,{'showHidden':![],'depth':null}));if(_0x35b4b5[_0x1aea('0x96')]){_0x517015=_0x35b4b5[_0x1aea('0x96')]['substring'](0x0,_0x35b4b5[_0x1aea('0x96')][_0x1aea('0x98')]('-'));if(this[_0x1aea('0xc')][_0x517015]){logger['info'](_0x1aea('0x9d'),_0x35b4b5['uniqueid'],_0x517015);this[_0x1aea('0xc')][_0x517015]['onhold']=![];}}}}catch(_0x5e7e5c){logger[_0x1aea('0x33')](_0x1aea('0x9e'),_0x35b4b5[_0x1aea('0x21')],util['inspect'](_0x5e7e5c,{'showHidden':![],'depth':null}));}};module[_0x1aea('0x9f')]=VoiceAgentReport; \ No newline at end of file +var _0x3539=['channels','voiceQueues','agents','variables','agentcalled','syncAgentCalled','syncAgentConnect','bind','agentringnoanswer','queuecallerabandon','syncQueueCallerAbandon','agentcomplete','syncHangup','musiconholdstart','syncMusicOnHoldStart','musiconholdstop','syncMusicOnHoldStop','attendedtransfer','syncAttendedTransfer','blindtransfer','syncBlindTransfer','prototype','emit','isUndefined','isNotNull','uniqueid','destuniqueid','debug','[%s][voiceAgentReport][agentcalled]\x20event:','inspect','interface','queue','format','YYYY-MM-DD\x20HH:mm:ss','mandatoryDisposition','type','inbound','assign','omit','event','privilege','[%s][voiceAgentReport][agentcalled]\x20sending\x20agentcalled\x20event:','custom:agentcalled','calleridnum','[%s][voiceAgentReport][agentcalled]\x20sending\x20user:called\x20event:','user:%s','error','hasOwnProperty','info','membername','agentconnectAt','connectedlinename','connectedlinenum','destchannelstate','destchannelstatedesc','holdtime','lastevent','voiceChannels','routealias','merge','pick','destconnectedlinenum','name','accountcode','exten','agentringnoanswerAt','answeredelsewheremembername','answered_elsewhere','[%s][voiceAgentReport][agentconnect]\x20sending\x20agentansweredelsewhere\x20event:','custom:agentansweredelsewhere','[%s][voiceAgentReport][agentconnect]','syncAgentRingNoAnswer','[%s][voiceAgentReport][agentringnoanswer]\x20agent:%s\x20destuniqueid:%s\x20lastevent:rejected','rejected','[%s][voiceAgentReport][agentringnoanswer]\x20sending\x20agentringnoanswer\x20event:','user:agentringnoanswer','custom:agentringnoanswer','[%s][voiceAgentReport][agentringnoanswer]','[%s][voiceAgentReport][queuecallerabandon]\x20event:','[%s][voiceAgentReport][queuecallerabandon]\x20agent:%s\x20destuniqueid:%s\x20lastevent:abandoned','abandoned','custom:agentqueuecallerabandon','[%s][voiceAgentReport][queuecallerabandon]','syncAgentComplete','[%s][voiceAgentReport][agentcomplete]\x20event:','[%s][voiceAgentReport][agentcomplete]\x20agent:%s\x20destuniqueid:%s\x20lastevent:complete','complete','reason','talktime','acwtime','acwTimeout','agentacw','[%s][voiceAgentReport][agentcomplete]\x20sending\x20agentcomplete\x20event:','user:agentcomplete','destaccountcode','syncVarSet','addVariable','keys','variable','value','[%s][voiceAgentReport][varset]\x20destuniqueid:%s\x20variable:%s\x20value:%s','[%s][voiceAgentReport][varset]','rtpaudioqos','rtpaudioqosbridged','rtpaudioqosjitter','rtpaudioqosloss','rtpaudioqoslossbridged','rtpaudioqosrtt','rtpaudioqosrttbridged','sipcallid','sipuri','bridgepeer','bridgepvtcallid','membercalls','memberdynamic','memberlastcall','memberpenalty','memberrealtime','isNil','[%s][voiceAgentReport][hangup]\x20event:','transfer','[%s][voiceAgentReport][hangup]\x20destuniqueid:%s','[%s][voiceAgentReport][hangup]\x20sending\x20voiceAgentReport\x20event:','values','custom:voiceAgentReport','[%s][voiceAgentReport][hangup]','[%s][voiceAgentReport][attendedtransfer]\x20event:','transfereeuniqueid','origtransfereruniqueid','[%s][voiceAgentReport][attendedtransfer]\x20agent:%s\x20destuniqueid:%s\x20lastevent:complete','diff','seconds','secondtransfereruniqueid','[%s][voiceAgentReport][attendedtransfer]','[%s][voiceAgentReport][blindtransfer]\x20event:','transfereruniqueid','agentcompleteAt','[%s][voiceAgentReport][blindtransfer]','[%s][voiceAgentReport][musiconholdstart]\x20event:','channel','substring','onhold','[%s][voiceAgentReport][musiconholdstart]','[%s][voiceAgentReport][musiconholdstop]\x20event:','lastIndexOf','[%s][voiceAgentReport][musiconholdstop]\x20interface:%s','[%s][voiceAgentReport][musiconholdstop]','exports','lodash','moment','../../../config/environment','ami','redis','localhost','socket.io-emitter'];(function(_0x522366,_0xd411c3){var _0x2eff98=function(_0x19c32b){while(--_0x19c32b){_0x522366['push'](_0x522366['shift']());}};_0x2eff98(++_0xd411c3);}(_0x3539,0x1ca));var _0x9353=function(_0x541997,_0x4a8f97){_0x541997=_0x541997-0x0;var _0x57737c=_0x3539[_0x541997];return _0x57737c;};'use strict';var _=require(_0x9353('0x0'));var moment=require(_0x9353('0x1'));var util=require('util');var Redis=require('ioredis');var config=require(_0x9353('0x2'));var logger=require('../../../config/logger')(_0x9353('0x3'));var ami=require('../ami');config[_0x9353('0x4')]=_['defaults'](config[_0x9353('0x4')],{'host':_0x9353('0x5'),'port':0x18eb});var io=require(_0x9353('0x6'))(new Redis(config[_0x9353('0x4')]));function VoiceAgentReport(_0x56711b){this[_0x9353('0x7')]={};this['voiceChannels']=_0x56711b[_0x9353('0x7')];this['voiceQueues']=_0x56711b[_0x9353('0x8')];this[_0x9353('0x9')]=_0x56711b[_0x9353('0x9')];this[_0x9353('0xa')]={};ami['on'](_0x9353('0xb'),this[_0x9353('0xc')]['bind'](this));ami['on']('agentconnect',this[_0x9353('0xd')][_0x9353('0xe')](this));ami['on'](_0x9353('0xf'),this['syncAgentRingNoAnswer'][_0x9353('0xe')](this));ami['on'](_0x9353('0x10'),this[_0x9353('0x11')][_0x9353('0xe')](this));ami['on'](_0x9353('0x12'),this['syncAgentComplete']['bind'](this));ami['on']('varset',this['syncVarSet'][_0x9353('0xe')](this));ami['on']('hangup',this[_0x9353('0x13')][_0x9353('0xe')](this));ami['on'](_0x9353('0x14'),this[_0x9353('0x15')][_0x9353('0xe')](this));ami['on'](_0x9353('0x16'),this[_0x9353('0x17')][_0x9353('0xe')](this));ami['on'](_0x9353('0x18'),this[_0x9353('0x19')]['bind'](this));ami['on'](_0x9353('0x1a'),this[_0x9353('0x1b')][_0x9353('0xe')](this));}VoiceAgentReport[_0x9353('0x1c')][_0x9353('0x1d')]=function(_0x5cfc46,_0x3c45d7,_0x5d3dbf){io['to'](_0x5cfc46)[_0x9353('0x1d')](_0x3c45d7,_0x5d3dbf);};VoiceAgentReport[_0x9353('0x1c')]['isNotNull']=function(_0x1c7cfc){return _0x1c7cfc!==null&&!_[_0x9353('0x1e')](_0x1c7cfc);};VoiceAgentReport['prototype'][_0x9353('0xc')]=function(_0x522113){try{if(this[_0x9353('0x1f')](_0x522113)){logger['info']('[%s][voiceAgentReport][agentcalled]\x20agent:%s\x20destuniqueid:%s\x20lastevent:called',_0x522113[_0x9353('0x20')],_0x522113['membername'],_0x522113[_0x9353('0x21')]);logger[_0x9353('0x22')](_0x9353('0x23'),_0x522113[_0x9353('0x20')],util[_0x9353('0x24')](_0x522113,{'showHidden':![],'depth':null}));if(_[_0x9353('0x1e')](this['channels'][_0x522113[_0x9353('0x20')]])){this[_0x9353('0x7')][_0x522113[_0x9353('0x20')]]={};}var _0x1a5b08=this[_0x9353('0x9')][_0x522113[_0x9353('0x25')]];var _0x5cd5b2=this[_0x9353('0x7')][_0x522113[_0x9353('0x20')]][_0x522113[_0x9353('0x21')]];var _0x22ef81=this['voiceQueues'][_0x522113[_0x9353('0x26')]];var _0x493fe5=this[_0x9353('0xa')][_0x522113[_0x9353('0x20')]];if(_['isUndefined'](_0x5cd5b2)){_0x5cd5b2={'agentcalledAt':moment()[_0x9353('0x27')](_0x9353('0x28')),'lastevent':'called','mandatoryDisposition':_0x22ef81&&_0x22ef81['mandatoryDisposition']?_0x22ef81[_0x9353('0x29')]:![],'type':_0x22ef81&&_0x22ef81[_0x9353('0x2a')]?_0x22ef81[_0x9353('0x2a')]:_0x9353('0x2b'),'variables':_0x493fe5,'motionChannel':'voice'};}Object[_0x9353('0x2c')](_0x5cd5b2,_[_0x9353('0x2d')](_0x522113,[_0x9353('0x2e'),_0x9353('0x2f')]));this['channels'][_0x522113[_0x9353('0x20')]][_0x522113[_0x9353('0x21')]]=_0x5cd5b2;logger[_0x9353('0x22')](_0x9353('0x30'),_0x522113[_0x9353('0x20')],util[_0x9353('0x24')](_0x5cd5b2,{'showHidden':![],'depth':null}));ami[_0x9353('0x1d')](_0x9353('0x31'),_0x5cd5b2);var _0x367a12={'id':_0x1a5b08['id'],'calleridnum':_0x5cd5b2[_0x9353('0x32')],'queue':_0x5cd5b2['queue'],'variables':_0x5cd5b2[_0x9353('0xa')],'uniqueid':_0x522113[_0x9353('0x20')]};logger['debug'](_0x9353('0x33'),_0x522113[_0x9353('0x20')],util[_0x9353('0x24')](_0x367a12,{'showHidden':![],'depth':null}));this[_0x9353('0x1d')](util['format'](_0x9353('0x34'),_0x522113['membername']),'user:called',_0x367a12);}}catch(_0x1561f5){logger[_0x9353('0x35')]('[%s][voiceAgentReport][agentcalled]',_0x522113[_0x9353('0x20')],util[_0x9353('0x24')](_0x1561f5,{'showHidden':![],'depth':null}));}};VoiceAgentReport['prototype']['syncAgentConnect']=function(_0x388ab6){try{if(this[_0x9353('0x1f')](_0x388ab6)){if(this['channels'][_0x388ab6[_0x9353('0x20')]]){for(var _0x32ef02 in this[_0x9353('0x7')][_0x388ab6['uniqueid']]){if(this[_0x9353('0x7')][_0x388ab6['uniqueid']][_0x9353('0x36')](_0x32ef02)){if(_0x388ab6[_0x9353('0x21')]===_0x32ef02){logger[_0x9353('0x37')]('[%s][voiceAgentReport][agentconnect]\x20agent:%s\x20destuniqueid:%s\x20lastevent:connect',_0x388ab6[_0x9353('0x20')],_0x388ab6[_0x9353('0x38')],_0x388ab6[_0x9353('0x21')]);this[_0x9353('0x7')][_0x388ab6[_0x9353('0x20')]][_0x32ef02][_0x9353('0x39')]=moment()[_0x9353('0x27')](_0x9353('0x28'));this[_0x9353('0x7')][_0x388ab6[_0x9353('0x20')]][_0x32ef02][_0x9353('0x3a')]=_0x388ab6[_0x9353('0x3a')];this[_0x9353('0x7')][_0x388ab6[_0x9353('0x20')]][_0x32ef02][_0x9353('0x3b')]=_0x388ab6[_0x9353('0x3b')];this[_0x9353('0x7')][_0x388ab6['uniqueid']][_0x32ef02]['destchannelstate']=_0x388ab6[_0x9353('0x3c')];this[_0x9353('0x7')][_0x388ab6[_0x9353('0x20')]][_0x32ef02]['destchannelstatedesc']=_0x388ab6[_0x9353('0x3d')];this[_0x9353('0x7')][_0x388ab6['uniqueid']][_0x32ef02][_0x9353('0x3e')]=_0x388ab6[_0x9353('0x3e')];this[_0x9353('0x7')][_0x388ab6['uniqueid']][_0x32ef02][_0x9353('0x3f')]='connect';if(this[_0x9353('0x40')][this['channels'][_0x388ab6[_0x9353('0x20')]][_0x32ef02]['uniqueid']]){var _0x4a1977=this[_0x9353('0x40')][this[_0x9353('0x7')][_0x388ab6[_0x9353('0x20')]][_0x32ef02]['uniqueid']][_0x9353('0x41')];this['channels'][_0x388ab6[_0x9353('0x20')]][_0x32ef02][_0x9353('0x41')]=_0x4a1977;_0x388ab6[_0x9353('0x41')]=_0x4a1977;}_[_0x9353('0x42')](this[_0x9353('0x9')][_0x388ab6['interface']],_[_0x9353('0x43')](_0x388ab6,[_0x9353('0x26'),_0x9353('0x44'),_0x9353('0x41')]));var _0x178c34=this[_0x9353('0x9')][_0x388ab6['interface']];var _0x565369={'id':_0x178c34['id'],'name':_0x178c34[_0x9353('0x45')],'agentconnected':!![],'destaccountcode':_0x178c34[_0x9353('0x46')],'destconnectedlinenum':this['channels'][_0x388ab6[_0x9353('0x20')]][_0x388ab6[_0x9353('0x21')]][_0x9353('0x47')],'queue':this[_0x9353('0x7')][_0x388ab6[_0x9353('0x20')]][_0x388ab6['destuniqueid']][_0x9353('0x26')],'routealias':this['channels'][_0x388ab6[_0x9353('0x20')]][_0x388ab6[_0x9353('0x21')]][_0x9353('0x41')],'uniqueid':this[_0x9353('0x7')][_0x388ab6[_0x9353('0x20')]][_0x388ab6['destuniqueid']]['uniqueid']};ami[_0x9353('0x1d')]('custom:agentconnect',this['channels'][_0x388ab6[_0x9353('0x20')]][_0x388ab6['destuniqueid']]);this['emit'](util[_0x9353('0x27')](_0x9353('0x34'),_0x388ab6[_0x9353('0x38')]),'user:agentconnect',_0x565369);}else if(!this[_0x9353('0x7')][_0x388ab6['uniqueid']][_0x32ef02][_0x9353('0xf')]&&!this[_0x9353('0x7')][_0x388ab6[_0x9353('0x20')]][_0x32ef02][_0x9353('0x12')]){logger['info']('[%s][voiceAgentReport][agentconnect]\x20agent:%s\x20destuniqueid:%s\x20lastevent:answered_elsewhere',_0x388ab6['uniqueid'],this['channels'][_0x388ab6[_0x9353('0x20')]][_0x32ef02][_0x9353('0x38')],_0x32ef02);this[_0x9353('0x7')][_0x388ab6['uniqueid']][_0x32ef02][_0x9353('0xf')]=!![];this[_0x9353('0x7')][_0x388ab6[_0x9353('0x20')]][_0x32ef02][_0x9353('0x48')]=moment()['format'](_0x9353('0x28'));this['channels'][_0x388ab6[_0x9353('0x20')]][_0x32ef02]['answeredelsewheredestinationuniqueid']=_0x388ab6[_0x9353('0x21')];this[_0x9353('0x7')][_0x388ab6[_0x9353('0x20')]][_0x32ef02][_0x9353('0x49')]=_0x388ab6[_0x9353('0x38')];this[_0x9353('0x7')][_0x388ab6[_0x9353('0x20')]][_0x32ef02][_0x9353('0x3f')]=_0x9353('0x4a');this[_0x9353('0x7')][_0x388ab6['uniqueid']][_0x32ef02]['reason']='answered_elsewhere';logger['debug'](_0x9353('0x4b'),_0x388ab6[_0x9353('0x20')],util[_0x9353('0x24')](this[_0x9353('0x7')][_0x388ab6[_0x9353('0x20')]][_0x32ef02],{'showHidden':![],'depth':null}));ami[_0x9353('0x1d')](_0x9353('0x4c'),this[_0x9353('0x7')][_0x388ab6[_0x9353('0x20')]][_0x32ef02]);}else{logger[_0x9353('0x22')]('[%s][voiceAgentReport][agentconnect]\x20Else\x20path\x20should\x20never\x20be\x20taken',_0x388ab6[_0x9353('0x20')]);}}}}}}catch(_0x5159e8){logger[_0x9353('0x35')](_0x9353('0x4d'),_0x388ab6['uniqueid'],util['inspect'](_0x5159e8,{'showHidden':![],'depth':null}));}};VoiceAgentReport[_0x9353('0x1c')][_0x9353('0x4e')]=function(_0xb9bcb3){try{if(this[_0x9353('0x1f')](_0xb9bcb3)){logger[_0x9353('0x22')]('[%s][voiceAgentReport][agentringnoanswer]\x20event:',_0xb9bcb3[_0x9353('0x20')],util[_0x9353('0x24')](_0xb9bcb3,{'showHidden':![],'depth':null}));if(this['channels'][_0xb9bcb3['uniqueid']]&&this[_0x9353('0x7')][_0xb9bcb3[_0x9353('0x20')]][_0xb9bcb3[_0x9353('0x21')]]){logger['info'](_0x9353('0x4f'),_0xb9bcb3[_0x9353('0x20')],_0xb9bcb3[_0x9353('0x38')],_0xb9bcb3[_0x9353('0x21')]);var _0xec24f4=this[_0x9353('0x9')][_0xb9bcb3['interface']];var _0x5a1c8d=this[_0x9353('0x7')][_0xb9bcb3[_0x9353('0x20')]][_0xb9bcb3[_0x9353('0x21')]];_0x5a1c8d['agentringnoanswer']=!![];_0x5a1c8d[_0x9353('0x48')]=moment()[_0x9353('0x27')](_0x9353('0x28'));_0x5a1c8d[_0x9353('0x3f')]=_0x9353('0x50');_0x5a1c8d['reason']='rejected';var _0xed3bcb={'id':_0xec24f4['id'],'name':_0xec24f4[_0x9353('0x45')],'queue':_0x5a1c8d[_0x9353('0x26')],'uniqueid':_0x5a1c8d['uniqueid']};logger[_0x9353('0x22')](_0x9353('0x51'),_0xb9bcb3['uniqueid'],util['inspect'](_0xed3bcb,{'showHidden':![],'depth':null}));this['emit'](util['format']('user:%s',_0xec24f4[_0x9353('0x45')]),_0x9353('0x52'),_0xed3bcb);ami[_0x9353('0x1d')](_0x9353('0x53'),_0x5a1c8d);this[_0x9353('0x7')][_0xb9bcb3[_0x9353('0x20')]][_0xb9bcb3[_0x9353('0x21')]]=Object[_0x9353('0x2c')]({},_0x5a1c8d);}}}catch(_0x564401){logger[_0x9353('0x35')](_0x9353('0x54'),_0xb9bcb3[_0x9353('0x20')],util[_0x9353('0x24')](_0x564401,{'showHidden':![],'depth':null}));}};VoiceAgentReport[_0x9353('0x1c')][_0x9353('0x11')]=function(_0x5ec407){try{if(this[_0x9353('0x1f')](_0x5ec407)){logger[_0x9353('0x22')](_0x9353('0x55'),_0x5ec407['uniqueid'],util[_0x9353('0x24')](_0x5ec407,{'showHidden':![],'depth':null}));if(this['channels'][_0x5ec407[_0x9353('0x20')]]){for(var _0x176e25 in this[_0x9353('0x7')][_0x5ec407[_0x9353('0x20')]]){if(this[_0x9353('0x7')][_0x5ec407[_0x9353('0x20')]]['hasOwnProperty'](_0x176e25)&&!this[_0x9353('0x7')][_0x5ec407[_0x9353('0x20')]][_0x176e25][_0x9353('0xf')]&&!this['channels'][_0x5ec407[_0x9353('0x20')]][_0x176e25][_0x9353('0x12')]){logger[_0x9353('0x37')](_0x9353('0x56'),_0x5ec407[_0x9353('0x20')],this[_0x9353('0x7')][_0x5ec407[_0x9353('0x20')]][_0x176e25]['membername'],_0x176e25);this[_0x9353('0x7')][_0x5ec407['uniqueid']][_0x176e25][_0x9353('0xf')]=!![];this['channels'][_0x5ec407[_0x9353('0x20')]][_0x176e25]['agentringnoanswerAt']=moment()[_0x9353('0x27')]('YYYY-MM-DD\x20HH:mm:ss');this[_0x9353('0x7')][_0x5ec407[_0x9353('0x20')]][_0x176e25]['lastevent']=_0x9353('0x57');this[_0x9353('0x7')][_0x5ec407['uniqueid']][_0x176e25]['reason']=_0x9353('0x57');logger['debug']('[%s][voiceAgentReport][queuecallerabandon]\x20sending\x20agentqueuecallerabandon\x20event:',_0x5ec407[_0x9353('0x20')],util[_0x9353('0x24')](this['channels'][_0x5ec407[_0x9353('0x20')]][_0x176e25],{'showHidden':![],'depth':null}));ami[_0x9353('0x1d')](_0x9353('0x58'),this['channels'][_0x5ec407['uniqueid']][_0x176e25]);}}}}}catch(_0x4b1265){logger[_0x9353('0x35')](_0x9353('0x59'),_0x5ec407['uniqueid'],util[_0x9353('0x24')](_0x4b1265,{'showHidden':![],'depth':null}));}};VoiceAgentReport[_0x9353('0x1c')][_0x9353('0x5a')]=function(_0x5c66fb){try{if(this[_0x9353('0x1f')](_0x5c66fb)){logger['debug'](_0x9353('0x5b'),_0x5c66fb[_0x9353('0x20')],util['inspect'](_0x5c66fb,{'showHidden':![],'depth':null}));if(this['channels'][_0x5c66fb['uniqueid']]){for(var _0x4b8e0a in this[_0x9353('0x7')][_0x5c66fb[_0x9353('0x20')]]){if(this['channels'][_0x5c66fb[_0x9353('0x20')]]['hasOwnProperty'](_0x4b8e0a)){if(this[_0x9353('0x7')][_0x5c66fb['uniqueid']][_0x4b8e0a]['agentconnectAt']&&!this[_0x9353('0x7')][_0x5c66fb['uniqueid']][_0x4b8e0a][_0x9353('0x12')]){logger['info'](_0x9353('0x5c'),_0x5c66fb[_0x9353('0x20')],this[_0x9353('0x7')][_0x5c66fb['uniqueid']][_0x4b8e0a][_0x9353('0x38')],_0x4b8e0a);this[_0x9353('0x7')][_0x5c66fb[_0x9353('0x20')]][_0x4b8e0a]['agentcomplete']=!![];this['channels'][_0x5c66fb[_0x9353('0x20')]][_0x4b8e0a]['agentcompleteAt']=moment()[_0x9353('0x27')](_0x9353('0x28'));this[_0x9353('0x7')][_0x5c66fb['uniqueid']][_0x4b8e0a][_0x9353('0x3f')]=_0x9353('0x5d');this[_0x9353('0x7')][_0x5c66fb[_0x9353('0x20')]][_0x4b8e0a][_0x9353('0x5e')]=_0x5c66fb[_0x9353('0x5e')]=='transfer'?'agent':_0x5c66fb['reason'];this[_0x9353('0x7')][_0x5c66fb[_0x9353('0x20')]][_0x4b8e0a][_0x9353('0x5f')]=_0x5c66fb['talktime'];if(this['voiceQueues'][_0x5c66fb[_0x9353('0x26')]]&&this[_0x9353('0x8')][_0x5c66fb[_0x9353('0x26')]]['acw']){this[_0x9353('0x7')][_0x5c66fb[_0x9353('0x20')]][_0x4b8e0a][_0x9353('0x60')]=this[_0x9353('0x8')][_0x5c66fb['queue']][_0x9353('0x61')];this[_0x9353('0x7')][_0x5c66fb[_0x9353('0x20')]][_0x4b8e0a][_0x9353('0x62')]=!![];}this[_0x9353('0x9')][_0x5c66fb[_0x9353('0x25')]]=_[_0x9353('0x2d')](this['agents'][_0x5c66fb[_0x9353('0x25')]],[_0x9353('0x26'),_0x9353('0x44')]);logger[_0x9353('0x22')](_0x9353('0x63'),_0x5c66fb[_0x9353('0x20')],util[_0x9353('0x24')](this[_0x9353('0x7')][_0x5c66fb[_0x9353('0x20')]][_0x4b8e0a],{'showHidden':![],'depth':null}));ami[_0x9353('0x1d')]('custom:agentcomplete',this[_0x9353('0x7')][_0x5c66fb[_0x9353('0x20')]][_0x4b8e0a]);logger[_0x9353('0x22')]('[%s][voiceAgentReport][agentcomplete]\x20sending\x20user:agentcomplete\x20event:',_0x5c66fb[_0x9353('0x20')],util[_0x9353('0x24')]({'id':this['agents'][_0x5c66fb[_0x9353('0x25')]]['id'],'destaccountcode':_0x5c66fb['destaccountcode']},{'showHidden':![],'depth':null}));this['emit'](util[_0x9353('0x27')](_0x9353('0x34'),_0x5c66fb[_0x9353('0x38')]),_0x9353('0x64'),{'id':this[_0x9353('0x9')][_0x5c66fb[_0x9353('0x25')]]['id'],'destaccountcode':Number(_0x5c66fb[_0x9353('0x65')])});}}}}}}catch(_0x39da23){logger['error']('[%s][voiceAgentReport][agentcomplete]',_0x5c66fb[_0x9353('0x20')],util[_0x9353('0x24')](_0x39da23,{'showHidden':![],'depth':null}));}};VoiceAgentReport[_0x9353('0x1c')][_0x9353('0x66')]=function(_0x1e8405){try{if(this[_0x9353('0x1f')](_0x1e8405)){logger['debug']('[%s][voiceAgentReport][varset]\x20event:',_0x1e8405[_0x9353('0x20')],util[_0x9353('0x24')](_0x1e8405,{'showHidden':![],'depth':null}));this[_0x9353('0x67')](_0x1e8405[_0x9353('0x20')],_[_0x9353('0x68')](_0x1e8405[_0x9353('0x69')])[0x0],_0x1e8405[_0x9353('0x6a')]);if(this['channels'][_0x1e8405[_0x9353('0x20')]]){for(var _0x249a96 in this[_0x9353('0x7')][_0x1e8405['uniqueid']]){if(this[_0x9353('0x7')][_0x1e8405['uniqueid']]['hasOwnProperty'](_0x249a96)){logger[_0x9353('0x37')](_0x9353('0x6b'),_0x1e8405[_0x9353('0x20')],_0x249a96,_['keys'](_0x1e8405[_0x9353('0x69')])[0x0],_0x1e8405['value']);if(_[_0x9353('0x1e')](this[_0x9353('0x7')][_0x1e8405[_0x9353('0x20')]][_0x249a96]['variables'])){this[_0x9353('0x7')][_0x1e8405[_0x9353('0x20')]][_0x249a96]['variables']={};}this[_0x9353('0x7')][_0x1e8405[_0x9353('0x20')]][_0x249a96]['variables']=this[_0x9353('0xa')][_0x1e8405[_0x9353('0x20')]];}}}}}catch(_0x35ecbc){logger[_0x9353('0x35')](_0x9353('0x6c'),_0x1e8405[_0x9353('0x20')],util[_0x9353('0x24')](_0x35ecbc,{'showHidden':![],'depth':null}));}};VoiceAgentReport[_0x9353('0x1c')][_0x9353('0x67')]=function(_0x2736a8,_0x385588,_0x1ab06b){var _0x14cd4d=[_0x9353('0x6d'),_0x9353('0x6e'),_0x9353('0x6f'),'rtpaudioqosjitterbridged',_0x9353('0x70'),_0x9353('0x71'),_0x9353('0x72'),_0x9353('0x73'),_0x9353('0x74'),_0x9353('0x75'),_0x9353('0x76'),_0x9353('0x77'),_0x9353('0x78'),_0x9353('0x79'),'memberinterface',_0x9353('0x7a'),_0x9353('0x38'),_0x9353('0x7b'),_0x9353('0x7c')];if(!_[_0x9353('0x7d')](_0x385588)&&!_['includes'](_0x14cd4d,_0x385588)){if(_['isUndefined'](this[_0x9353('0xa')][_0x2736a8])){this[_0x9353('0xa')][_0x2736a8]={};}this[_0x9353('0xa')][_0x2736a8][_0x385588]=_0x1ab06b;}};VoiceAgentReport['prototype'][_0x9353('0x13')]=function(_0x5d6aef){try{if(this[_0x9353('0x1f')](_0x5d6aef)){logger[_0x9353('0x22')](_0x9353('0x7e'),_0x5d6aef[_0x9353('0x20')],util[_0x9353('0x24')](_0x5d6aef,{'showHidden':![],'depth':null}));if(this[_0x9353('0x7')][_0x5d6aef[_0x9353('0x20')]]){for(var _0x28b941 in this[_0x9353('0x7')][_0x5d6aef[_0x9353('0x20')]]){if(this['channels'][_0x5d6aef[_0x9353('0x20')]][_0x9353('0x36')](_0x28b941)){if(this[_0x9353('0x7')][_0x5d6aef['uniqueid']][_0x28b941][_0x9353('0x5e')]==_0x9353('0x7f')&&this[_0x9353('0x7')][_0x5d6aef[_0x9353('0x20')]][_0x28b941]['agentcomplete']){logger[_0x9353('0x37')](_0x9353('0x80'),_0x5d6aef[_0x9353('0x20')],_0x28b941);this[_0x9353('0x7')][_0x5d6aef['uniqueid']][_0x28b941]['agentcompleteAt']=moment()[_0x9353('0x27')](_0x9353('0x28'));}}}logger[_0x9353('0x22')](_0x9353('0x81'),_0x5d6aef[_0x9353('0x20')],util['inspect'](_[_0x9353('0x82')](this[_0x9353('0x7')][_0x5d6aef[_0x9353('0x20')]]),{'showHidden':![],'depth':null}));ami[_0x9353('0x1d')](_0x9353('0x83'),_['values'](this[_0x9353('0x7')][_0x5d6aef[_0x9353('0x20')]]));delete this[_0x9353('0x7')][_0x5d6aef[_0x9353('0x20')]];}if(this[_0x9353('0xa')][_0x5d6aef[_0x9353('0x20')]]){delete this[_0x9353('0xa')][_0x5d6aef[_0x9353('0x20')]];}}}catch(_0x5d0211){logger['error'](_0x9353('0x84'),_0x5d6aef['uniqueid'],util[_0x9353('0x24')](_0x5d0211,{'showHidden':![],'depth':null}));}};VoiceAgentReport[_0x9353('0x1c')]['syncAttendedTransfer']=function(_0x486b86){try{if(this['isNotNull'](_0x486b86)){logger[_0x9353('0x22')](_0x9353('0x85'),_0x486b86[_0x9353('0x20')],util[_0x9353('0x24')](_0x486b86,{'showHidden':![],'depth':null}));if(this[_0x9353('0x7')][_0x486b86[_0x9353('0x86')]]){for(var _0x5de0ac in this[_0x9353('0x7')][_0x486b86['transfereeuniqueid']]){if(this[_0x9353('0x7')][_0x486b86[_0x9353('0x86')]][_0x9353('0x36')](_0x5de0ac)){if(_0x486b86[_0x9353('0x87')]===_0x5de0ac){logger[_0x9353('0x37')](_0x9353('0x88'),_0x486b86[_0x9353('0x20')],this['channels'][_0x486b86['transfereeuniqueid']][_0x5de0ac][_0x9353('0x38')],_0x5de0ac);var _0x242317=moment();this[_0x9353('0x7')][_0x486b86[_0x9353('0x86')]][_0x5de0ac][_0x9353('0x12')]=!![];this[_0x9353('0x7')][_0x486b86['transfereeuniqueid']][_0x5de0ac]['agentcompleteAt']=moment()['format']('YYYY-MM-DD\x20HH:mm:ss');this[_0x9353('0x7')][_0x486b86[_0x9353('0x86')]][_0x5de0ac]['lastevent']=_0x9353('0x5d');this[_0x9353('0x7')][_0x486b86[_0x9353('0x86')]][_0x5de0ac][_0x9353('0x5e')]=_0x9353('0x7f');this[_0x9353('0x7')][_0x486b86[_0x9353('0x86')]][_0x5de0ac][_0x9353('0x5f')]=_0x242317[_0x9353('0x89')](this['channels'][_0x486b86['transfereeuniqueid']][_0x5de0ac][_0x9353('0x39')],_0x9353('0x8a'));}}}}if(this[_0x9353('0x7')][_0x486b86['secondtransfereruniqueid']]){var _0x1841b3=this[_0x9353('0x7')][_0x486b86[_0x9353('0x8b')]];this['channels'][_0x486b86[_0x9353('0x8b')]]=this[_0x9353('0x7')][_0x486b86[_0x9353('0x86')]];this[_0x9353('0x7')][_0x486b86['transfereeuniqueid']]=_0x1841b3;}}}catch(_0x5b330a){logger[_0x9353('0x35')](_0x9353('0x8c'),_0x486b86[_0x9353('0x20')],util[_0x9353('0x24')](_0x5b330a,{'showHidden':![],'depth':null}));}};VoiceAgentReport[_0x9353('0x1c')]['syncBlindTransfer']=function(_0x46c4fe){try{if(this['isNotNull'](_0x46c4fe)){logger[_0x9353('0x22')](_0x9353('0x8d'),_0x46c4fe[_0x9353('0x20')],util['inspect'](_0x46c4fe,{'showHidden':![],'depth':null}));if(this[_0x9353('0x7')][_0x46c4fe[_0x9353('0x86')]]){for(var _0x3ab0e5 in this[_0x9353('0x7')][_0x46c4fe[_0x9353('0x86')]]){if(this[_0x9353('0x7')][_0x46c4fe['transfereeuniqueid']][_0x9353('0x36')](_0x3ab0e5)){if(_0x46c4fe[_0x9353('0x8e')]===_0x3ab0e5){logger[_0x9353('0x37')]('[%s][voiceAgentReport][blindtransfer]\x20agent:%s\x20destuniqueid:%s\x20lastevent:complete',_0x46c4fe[_0x9353('0x20')],this[_0x9353('0x7')][_0x46c4fe[_0x9353('0x86')]][_0x3ab0e5]['membername'],_0x3ab0e5);var _0xe4cbcf=moment();this[_0x9353('0x7')][_0x46c4fe[_0x9353('0x86')]][_0x3ab0e5]['agentcomplete']=!![];this['channels'][_0x46c4fe[_0x9353('0x86')]][_0x3ab0e5][_0x9353('0x8f')]=_0xe4cbcf;this[_0x9353('0x7')][_0x46c4fe[_0x9353('0x86')]][_0x3ab0e5][_0x9353('0x3f')]='complete';this[_0x9353('0x7')][_0x46c4fe[_0x9353('0x86')]][_0x3ab0e5][_0x9353('0x5e')]=_0x9353('0x7f');this[_0x9353('0x7')][_0x46c4fe[_0x9353('0x86')]][_0x3ab0e5][_0x9353('0x5f')]=_0xe4cbcf[_0x9353('0x89')](this[_0x9353('0x7')][_0x46c4fe[_0x9353('0x86')]][_0x3ab0e5][_0x9353('0x39')],'seconds');}}}}}}catch(_0x24577e){logger['error'](_0x9353('0x90'),_0x46c4fe[_0x9353('0x20')],util['inspect'](_0x24577e,{'showHidden':![],'depth':null}));}};VoiceAgentReport[_0x9353('0x1c')][_0x9353('0x15')]=function(_0x5b1f6a){var _0x59afdd='';try{if(this[_0x9353('0x1f')](_0x5b1f6a)){logger['debug'](_0x9353('0x91'),_0x5b1f6a[_0x9353('0x20')],util[_0x9353('0x24')](_0x5b1f6a,{'showHidden':![],'depth':null}));if(_0x5b1f6a['channel']){_0x59afdd=_0x5b1f6a[_0x9353('0x92')][_0x9353('0x93')](0x0,_0x5b1f6a['channel']['lastIndexOf']('-'));if(this[_0x9353('0x9')][_0x59afdd]){logger[_0x9353('0x37')]('[%s][voiceAgentReport][musiconholdstart]\x20interface:%s',_0x5b1f6a['uniqueid'],_0x59afdd);this[_0x9353('0x9')][_0x59afdd][_0x9353('0x94')]=!![];}}}}catch(_0xbd899d){logger[_0x9353('0x35')](_0x9353('0x95'),_0x5b1f6a['uniqueid'],util['inspect'](_0xbd899d,{'showHidden':![],'depth':null}));}};VoiceAgentReport[_0x9353('0x1c')][_0x9353('0x17')]=function(_0x4b2d43){var _0x4c7c82='';try{if(this[_0x9353('0x1f')](_0x4b2d43)){logger[_0x9353('0x22')](_0x9353('0x96'),_0x4b2d43[_0x9353('0x20')],util['inspect'](_0x4b2d43,{'showHidden':![],'depth':null}));if(_0x4b2d43[_0x9353('0x92')]){_0x4c7c82=_0x4b2d43[_0x9353('0x92')]['substring'](0x0,_0x4b2d43['channel'][_0x9353('0x97')]('-'));if(this[_0x9353('0x9')][_0x4c7c82]){logger['info'](_0x9353('0x98'),_0x4b2d43[_0x9353('0x20')],_0x4c7c82);this[_0x9353('0x9')][_0x4c7c82][_0x9353('0x94')]=![];}}}}catch(_0x4046c8){logger[_0x9353('0x35')](_0x9353('0x99'),_0x4b2d43[_0x9353('0x20')],util[_0x9353('0x24')](_0x4046c8,{'showHidden':![],'depth':null}));}};module[_0x9353('0x9a')]=VoiceAgentReport; \ No newline at end of file diff --git a/server/services/ami/report/voiceCallReport.js b/server/services/ami/report/voiceCallReport.js index 83fdaf6..da8ee91 100644 --- a/server/services/ami/report/voiceCallReport.js +++ b/server/services/ami/report/voiceCallReport.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x6d2c=['NO\x20ANSWER','FAILED','ANSWERED','BUSY','redis','defaults','channels','agents','blindTransfers','coreshowchannel','bind','newexten','newstate','syncNewState','varset','syncHangup','newcallerid','syncNewCallerId','blindtransfer','syncBlindTransfer','musiconholdstart','syncMusicOnHoldStart','syncMusicOnHoldStop','info','[voiceCallReport][coreshowchannels]\x20started','error','[voiceCallReport][coreshowchannels]','inspect','prototype','isUndefined','emit','[%s][voiceCallReport][newcallerid]\x20calleridname:%s\x20calleridnum:%s','uniqueid','calleridname','calleridnum','[%s][voiceCallReport][newcallerid]\x20event:','linkedid','pick','context','channel','split','exten','xcally-motion-preview','format','user:%s','name','user:agentconnect','accountcode','connectedlinenum','syncNewChannel','isNotNull','[%s][voiceCallReport][newchannel]\x20context:%s\x20exten:%s','starttime','YYYY-MM-DD\x20HH:mm:ss','disposition','channelstate','merge','keys','undefined','destconnectedlinenum','debug','[%s][voiceCallReport][newchannel]\x20sending\x20user:agentconnect\x20event:','[%s][voiceCallReport][newchannel]','syncNewExten','[%s][voiceCallReport][newexten]\x20event:','OutgoingSpoolFailed','application','toLowerCase','appdata','applicationdata','startsWith','CDR(routeAlias)','[%s][voiceCallReport][newexten]\x20application:%s\x20appdata:%s','duration','subtract','seconds','includes','lastapplication','lastdata','cdr(','match','isNil','[%s][voiceCallReport][newexten]','[%s][voiceCallReport][newstate]\x20linkedid:%s\x20calleridname:%s\x20calleridnum:%s','answered','answertime','holdtime','destinationchannel','toNumber','UserId','membername','connectedlinename','routealias','[%s][voiceCallReport][newstate]','monitor','endsWith','.wav49','replace','monitorFilename','monitors','rec','[%s][voiceCallReport][mixMonitorFilename]','[%s][voiceCallReport][varset]\x20event:','variable','mixmonitor_filename','[%s][voiceCallReport][varset]\x20variable:mixmonitor_filename\x20value:%s','value','syncMixMonitorFilename','[%s][voiceCallReport][varset]\x20variable:xmd-callerid\x20value:%s','callerid','xmd-cdrtype','[%s][voiceCallReport][varset]\x20variable:xmd-cdrtype\x20value:%s','xmd-queue','[%s][voiceCallReport][varset]\x20variable:xmd-queue\x20value:%s','xmd-originatecalleridnum','[%s][voiceCallReport][varset]\x20variable:xmd-originatecalleridnum\x20value:%s','originatecalleridnum','xmd-destination','[%s][voiceCallReport][varset]\x20variable:xmd-destination\x20value:%s','xmd-callerid-preview','calleridpreview','[%s][voiceCallReport][varset]\x20variable:xmcs-queue\x20value:%s','sipcallid','[%s][voiceCallReport][varset]\x20variable:sipcallid\x20value:%s','sipcalluniqueid','parse','sipcalllinkedid','[%s][voiceCallReport][varset]','[%s][voiceCallReport][hangup]\x20event:','[%s][voiceCallReport][hangup]\x20reason:%s','cause-txt','diff','billableseconds','[%s][voiceCallReport][hangup]\x20sending\x20user:agentcomplete\x20event:','length','user:agentcomplete','transferType','resolve','then','transferToInternal','isEmpty','getSettings','stopRecordingOnTransfer','StopMixMonitor','catch','Action','finally','webbar:stopmonitors','event','BlindTransfer','outbound','[%s][voiceCallReport][hangup]\x20sending\x20hangup\x20event:','custom:voiceCallReport','origtransferercalleridnum','transfertargetcalleridnum','[%s][voiceCallReport][attendedtransfer]\x20event:','transfereeuniqueid','transfercalleridnum','secondtransfereruniqueid','transfertargetuniqueid','transferconnectedlinenum','origtransfereruniqueid','ATTENDED','origtransfererlinkedid','some','type','routeid','[%s][voiceCallReport][blindtransfer]\x20transfercalleridnum:%s\x20transferconnectedlinenum:%s','transfereecalleridnum','extension','[%s][voiceCallReport][blindtransfer]\x20event:','BLIND','transfereruniqueid','transfererchannel','[%s][voiceCallReport][musiconholdstart]\x20event:','mohstarttime','[%s][voiceCallReport][musiconholdstart]\x20mohstarttime:%s','[%s][voiceCallReport][musiconholdstart]','[%s][voiceCallReport][musiconholdstop]\x20event:','milliseconds','mohtime','[%s][voiceCallReport][musiconholdstop]','exports','lodash','moment','path','ioredis','../../../config/environment','../../../config/logger','ami','../rpc/setting','set','queue','agi','dial','playback','voicemail'];(function(_0x500e16,_0x30ec9a){var _0x54f1d1=function(_0x80d24b){while(--_0x80d24b){_0x500e16['push'](_0x500e16['shift']());}};_0x54f1d1(++_0x30ec9a);}(_0x6d2c,0xb7));var _0xc6d2=function(_0x50af25,_0xc0db01){_0x50af25=_0x50af25-0x0;var _0x1ef3a6=_0x6d2c[_0x50af25];return _0x1ef3a6;};'use strict';var _=require(_0xc6d2('0x0'));var moment=require(_0xc6d2('0x1'));var util=require('util');var path=require(_0xc6d2('0x2'));var Redis=require(_0xc6d2('0x3'));var config=require(_0xc6d2('0x4'));var logger=require(_0xc6d2('0x5'))(_0xc6d2('0x6'));var ami=require('../ami');var Channel=require('../model/channel');var RpcSetting=require(_0xc6d2('0x7'));var applications=[_0xc6d2('0x8'),_0xc6d2('0x9'),_0xc6d2('0xa'),_0xc6d2('0xb'),_0xc6d2('0xc'),_0xc6d2('0xd')];var dispositions=[_0xc6d2('0xe'),_0xc6d2('0xf'),_0xc6d2('0xf'),_0xc6d2('0xe'),_0xc6d2('0xe'),_0xc6d2('0xe'),_0xc6d2('0x10'),_0xc6d2('0x11'),_0xc6d2('0xf'),'FAILED','FAILED'];config[_0xc6d2('0x12')]=_[_0xc6d2('0x13')](config[_0xc6d2('0x12')],{'host':'localhost','port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0xc6d2('0x12')]));function VoiceCallReport(_0x3da370){this[_0xc6d2('0x14')]=_0x3da370[_0xc6d2('0x14')];this[_0xc6d2('0x15')]=_0x3da370['agents'];this[_0xc6d2('0x16')]={};ami['on'](_0xc6d2('0x17'),this['syncNewExten'][_0xc6d2('0x18')](this));ami['on'](_0xc6d2('0x19'),this['syncNewExten'][_0xc6d2('0x18')](this));ami['on']('newchannel',this['syncNewChannel'][_0xc6d2('0x18')](this));ami['on'](_0xc6d2('0x1a'),this[_0xc6d2('0x1b')]['bind'](this));ami['on'](_0xc6d2('0x1c'),this['syncVarSet'][_0xc6d2('0x18')](this));ami['on']('hangup',this[_0xc6d2('0x1d')]['bind'](this));ami['on'](_0xc6d2('0x1e'),this[_0xc6d2('0x1f')][_0xc6d2('0x18')](this));ami['on']('attendedtransfer',this['syncAttendedTransfer'][_0xc6d2('0x18')](this));ami['on'](_0xc6d2('0x20'),this[_0xc6d2('0x21')][_0xc6d2('0x18')](this));ami['on'](_0xc6d2('0x22'),this[_0xc6d2('0x23')][_0xc6d2('0x18')](this));ami['on']('musiconholdstop',this[_0xc6d2('0x24')]['bind'](this));try{logger[_0xc6d2('0x25')](_0xc6d2('0x26'));ami['actionCoreShowChannels']();}catch(_0x5bfe97){logger[_0xc6d2('0x27')](_0xc6d2('0x28'),util[_0xc6d2('0x29')](_0x5bfe97,{'showHidden':![],'depth':null}));}}VoiceCallReport[_0xc6d2('0x2a')]['isNotNull']=function(_0x3aa305){return _0x3aa305!==null&&!_[_0xc6d2('0x2b')](_0x3aa305);};VoiceCallReport[_0xc6d2('0x2a')][_0xc6d2('0x2c')]=function(_0x441cf1,_0xa51c22,_0x5512b3){io['to'](_0x441cf1)[_0xc6d2('0x2c')](_0xa51c22,_0x5512b3);};VoiceCallReport['prototype']['syncNewCallerId']=function(_0xcbac1c){try{if(this['isNotNull'](_0xcbac1c)){logger[_0xc6d2('0x25')](_0xc6d2('0x2d'),_0xcbac1c[_0xc6d2('0x2e')],_0xcbac1c[_0xc6d2('0x2f')],_0xcbac1c[_0xc6d2('0x30')]);logger['debug'](_0xc6d2('0x31'),_0xcbac1c[_0xc6d2('0x2e')],util[_0xc6d2('0x29')](_0xcbac1c,{'showHidden':![],'depth':null}));if(_0xcbac1c['uniqueid']===_0xcbac1c[_0xc6d2('0x32')]){if(!_[_0xc6d2('0x2b')](this['channels'][_0xcbac1c['uniqueid']])){_['merge'](this[_0xc6d2('0x14')][_0xcbac1c[_0xc6d2('0x2e')]],_[_0xc6d2('0x33')](_0xcbac1c,_['keys'](this[_0xc6d2('0x14')][_0xcbac1c[_0xc6d2('0x2e')]])));}}if(_0xcbac1c[_0xc6d2('0x34')]==='from-sip'){var _0x5757f1=this[_0xc6d2('0x15')][_0xcbac1c[_0xc6d2('0x35')][_0xc6d2('0x36')]('-')[0x0]];if(_0x5757f1){if(_0xcbac1c[_0xc6d2('0x37')]==_0xc6d2('0x38')){_0x5757f1['destconnectedlinenum']=_0xcbac1c['connectedlinenum'];this['emit'](util[_0xc6d2('0x39')](_0xc6d2('0x3a'),_0x5757f1[_0xc6d2('0x3b')]),_0xc6d2('0x3c'),{'id':_0x5757f1['id'],'destaccountcode':_0x5757f1[_0xc6d2('0x3d')],'destconnectedlinenum':_0xcbac1c[_0xc6d2('0x3e')]});}}}}}catch(_0x45b640){logger[_0xc6d2('0x27')]('[%s][voiceCallReport][newcallerid]',_0xcbac1c[_0xc6d2('0x2e')],util['inspect'](_0x45b640,{'showHidden':![],'depth':null}));}};VoiceCallReport[_0xc6d2('0x2a')][_0xc6d2('0x3f')]=function(_0x3b1359){try{if(this[_0xc6d2('0x40')](_0x3b1359)){logger['debug']('[%s][voiceCallReport][newchannel]\x20event:',_0x3b1359[_0xc6d2('0x2e')],util[_0xc6d2('0x29')](_0x3b1359,{'showHidden':![],'depth':null}));if(this[_0xc6d2('0x14')][_0x3b1359['uniqueid']]){return;}if(_0x3b1359[_0xc6d2('0x35')]==='OutgoingSpoolFailed'){return;}if(_0x3b1359[_0xc6d2('0x2e')]!==_0x3b1359['linkedid']&&!this[_0xc6d2('0x16')][_0x3b1359['linkedid']]){return;}logger[_0xc6d2('0x25')](_0xc6d2('0x41'),_0x3b1359[_0xc6d2('0x2e')],_0x3b1359[_0xc6d2('0x34')],_0x3b1359[_0xc6d2('0x37')]);this[_0xc6d2('0x14')][_0x3b1359[_0xc6d2('0x2e')]]=new Channel();this[_0xc6d2('0x14')][_0x3b1359[_0xc6d2('0x2e')]][_0xc6d2('0x42')]=moment()['format'](_0xc6d2('0x43'));this[_0xc6d2('0x14')][_0x3b1359[_0xc6d2('0x2e')]][_0xc6d2('0x44')]=dispositions[_['toNumber'](_0x3b1359[_0xc6d2('0x45')])];_[_0xc6d2('0x46')](this[_0xc6d2('0x14')][_0x3b1359['uniqueid']],_[_0xc6d2('0x33')](_0x3b1359,_[_0xc6d2('0x47')](this['channels'][_0x3b1359['uniqueid']])));if(_0x3b1359['context']==='from-sip'){var _0x53010e=this['agents'][_0x3b1359[_0xc6d2('0x35')][_0xc6d2('0x36')]('-')[0x0]];if(_0x53010e&&typeof _0x53010e['destconnectedlinenum']===_0xc6d2('0x48')){_0x53010e[_0xc6d2('0x49')]=_0x3b1359[_0xc6d2('0x37')];logger[_0xc6d2('0x4a')](_0xc6d2('0x4b'),_0x3b1359[_0xc6d2('0x2e')],util[_0xc6d2('0x29')]({'id':_0x53010e['id'],'destaccountcode':_0x53010e[_0xc6d2('0x3d')],'destconnectedlinenum':_0x3b1359[_0xc6d2('0x37')]},{'showHidden':![],'depth':null}));this[_0xc6d2('0x2c')](util[_0xc6d2('0x39')]('user:%s',_0x53010e[_0xc6d2('0x3b')]),_0xc6d2('0x3c'),{'id':_0x53010e['id'],'destaccountcode':_0x53010e[_0xc6d2('0x3d')],'destconnectedlinenum':_0x3b1359[_0xc6d2('0x37')]});}}}}catch(_0x42b94d){logger[_0xc6d2('0x27')](_0xc6d2('0x4c'),_0x3b1359[_0xc6d2('0x2e')],util[_0xc6d2('0x29')](_0x42b94d,{'showHidden':![],'depth':null}));}};VoiceCallReport['prototype'][_0xc6d2('0x4d')]=function(_0x253fd6){try{if(this[_0xc6d2('0x40')](_0x253fd6)){logger[_0xc6d2('0x4a')](_0xc6d2('0x4e'),_0x253fd6[_0xc6d2('0x2e')],util['inspect'](_0x253fd6,{'showHidden':![],'depth':null}));if(_0x253fd6[_0xc6d2('0x35')]===_0xc6d2('0x4f')||_0x253fd6[_0xc6d2('0x37')]==='h')return;if(_0x253fd6['uniqueid']===_0x253fd6[_0xc6d2('0x32')]||this[_0xc6d2('0x16')][_0x253fd6['linkedid']]){_0x253fd6[_0xc6d2('0x50')]=_0x253fd6['application']?_0x253fd6[_0xc6d2('0x50')][_0xc6d2('0x51')]():undefined;_0x253fd6['applicationdata']=_0x253fd6[_0xc6d2('0x52')]||_0x253fd6[_0xc6d2('0x53')];if(_0x253fd6[_0xc6d2('0x52')]&&!_0x253fd6['appdata'][_0xc6d2('0x54')](_0xc6d2('0x55'))&&_0x253fd6[_0xc6d2('0x50')]!=='queue'){_0x253fd6['applicationdata']=_0x253fd6[_0xc6d2('0x53')]['toLowerCase']();}logger[_0xc6d2('0x25')](_0xc6d2('0x56'),_0x253fd6['uniqueid'],_0x253fd6[_0xc6d2('0x50')],_0x253fd6[_0xc6d2('0x53')]);if(_[_0xc6d2('0x2b')](this[_0xc6d2('0x14')][_0x253fd6[_0xc6d2('0x2e')]])){this[_0xc6d2('0x14')][_0x253fd6[_0xc6d2('0x2e')]]=new Channel();this[_0xc6d2('0x14')][_0x253fd6[_0xc6d2('0x2e')]]['starttime']=_0x253fd6[_0xc6d2('0x57')]?moment()[_0xc6d2('0x58')](moment[_0xc6d2('0x57')](_0x253fd6[_0xc6d2('0x57')])[_0xc6d2('0x59')](),_0xc6d2('0x59'))[_0xc6d2('0x39')](_0xc6d2('0x43')):moment()['format']('YYYY-MM-DD\x20HH:mm:ss');this[_0xc6d2('0x14')][_0x253fd6['uniqueid']][_0xc6d2('0x44')]=_0xc6d2('0xe');}_[_0xc6d2('0x46')](this['channels'][_0x253fd6[_0xc6d2('0x2e')]],_['pick'](_0x253fd6,_[_0xc6d2('0x47')](this[_0xc6d2('0x14')][_0x253fd6[_0xc6d2('0x2e')]])));if(_[_0xc6d2('0x5a')](applications,_0x253fd6[_0xc6d2('0x50')])){this[_0xc6d2('0x14')][_0x253fd6['uniqueid']][_0xc6d2('0x5b')]=_0x253fd6[_0xc6d2('0x50')];this['channels'][_0x253fd6[_0xc6d2('0x2e')]][_0xc6d2('0x5c')]=_0x253fd6[_0xc6d2('0x53')];if(_0x253fd6[_0xc6d2('0x50')]==='set'&&_['startsWith'](_0x253fd6[_0xc6d2('0x53')][_0xc6d2('0x51')](),_0xc6d2('0x5d'))){var _0x8fd892=_0x253fd6[_0xc6d2('0x53')]['split']('=');var _0x59fc87=_0x8fd892[0x0]['toLowerCase']()[_0xc6d2('0x5e')](/cdr\((.*)\)/);if(_0x59fc87){if(_0x59fc87[0x1]==='type'&&!_[_0xc6d2('0x5f')](this[_0xc6d2('0x14')][_0x253fd6[_0xc6d2('0x2e')]][_0x59fc87[0x1]]))return;this[_0xc6d2('0x14')][_0x253fd6[_0xc6d2('0x2e')]][_0x59fc87[0x1]]=_0x8fd892[0x1];}}else if(_0x253fd6[_0xc6d2('0x50')]===_0xc6d2('0x9')){this['channels'][_0x253fd6['uniqueid']][_0xc6d2('0x9')]=_0x253fd6[_0xc6d2('0x53')][_0xc6d2('0x36')](',')[0x0];}}}}}catch(_0x499537){logger[_0xc6d2('0x27')](_0xc6d2('0x60'),_0x253fd6[_0xc6d2('0x2e')],util['inspect'](_0x499537,{'showHidden':![],'depth':null}));}};VoiceCallReport['prototype']['syncNewState']=function(_0x4f168b){try{if(this[_0xc6d2('0x40')](_0x4f168b)){logger[_0xc6d2('0x25')](_0xc6d2('0x61'),_0x4f168b['uniqueid'],_0x4f168b[_0xc6d2('0x32')],_0x4f168b['calleridname'],_0x4f168b['calleridnum']);logger['debug']('[%s][voiceCallReport][newstate]\x20event:',_0x4f168b[_0xc6d2('0x2e')],util[_0xc6d2('0x29')](_0x4f168b,{'showHidden':![],'depth':null}));if(_0x4f168b['channelstate']!=='6')return;var _0x50a1f5=this['agents'][_0x4f168b[_0xc6d2('0x35')][_0xc6d2('0x36')]('-')[0x0]];if(_0x4f168b['uniqueid']!==_0x4f168b[_0xc6d2('0x32')]){var _0x57687b=moment();if(this[_0xc6d2('0x14')][_0x4f168b['linkedid']]){if(!this[_0xc6d2('0x14')][_0x4f168b[_0xc6d2('0x32')]][_0xc6d2('0x62')]){this[_0xc6d2('0x14')][_0x4f168b[_0xc6d2('0x32')]][_0xc6d2('0x62')]=!![];this[_0xc6d2('0x14')][_0x4f168b[_0xc6d2('0x32')]][_0xc6d2('0x63')]=_0x57687b[_0xc6d2('0x39')](_0xc6d2('0x43'));if(this['channels'][_0x4f168b[_0xc6d2('0x32')]][_0xc6d2('0x42')]){this['channels'][_0x4f168b[_0xc6d2('0x32')]][_0xc6d2('0x64')]=_0x57687b['diff'](this[_0xc6d2('0x14')][_0x4f168b['linkedid']][_0xc6d2('0x42')],'seconds');}}this['channels'][_0x4f168b[_0xc6d2('0x32')]][_0xc6d2('0x32')]=_0x4f168b[_0xc6d2('0x2e')];if(_0x4f168b[_0xc6d2('0x30')]!==_0xc6d2('0x38')){this[_0xc6d2('0x14')][_0x4f168b['linkedid']]['connectedlinenum']=_0x4f168b[_0xc6d2('0x30')];}this['channels'][_0x4f168b[_0xc6d2('0x32')]]['connectedlinename']=_0x4f168b[_0xc6d2('0x2f')];this[_0xc6d2('0x14')][_0x4f168b[_0xc6d2('0x32')]][_0xc6d2('0x65')]=_0x4f168b['channel'];this[_0xc6d2('0x14')][_0x4f168b[_0xc6d2('0x32')]]['disposition']=dispositions[_[_0xc6d2('0x66')](_0x4f168b[_0xc6d2('0x45')])];if(_0x50a1f5){this[_0xc6d2('0x14')][_0x4f168b[_0xc6d2('0x32')]][_0xc6d2('0x67')]=_0x50a1f5['id'];this[_0xc6d2('0x14')][_0x4f168b[_0xc6d2('0x32')]][_0xc6d2('0x68')]=_0x50a1f5[_0xc6d2('0x3b')];}}if(this[_0xc6d2('0x14')][_0x4f168b['uniqueid']]){if(!this[_0xc6d2('0x14')][_0x4f168b[_0xc6d2('0x2e')]][_0xc6d2('0x62')]){this[_0xc6d2('0x14')][_0x4f168b[_0xc6d2('0x2e')]][_0xc6d2('0x62')]=!![];this[_0xc6d2('0x14')][_0x4f168b[_0xc6d2('0x2e')]]['answertime']=_0x57687b[_0xc6d2('0x39')](_0xc6d2('0x43'));if(this[_0xc6d2('0x14')][_0x4f168b[_0xc6d2('0x2e')]][_0xc6d2('0x42')]){this['channels'][_0x4f168b[_0xc6d2('0x2e')]]['holdtime']=_0x57687b['diff'](this[_0xc6d2('0x14')][_0x4f168b[_0xc6d2('0x2e')]][_0xc6d2('0x42')],_0xc6d2('0x59'));}}if(_0x4f168b['calleridnum']!=='xcally-motion-preview'){this[_0xc6d2('0x14')][_0x4f168b['uniqueid']][_0xc6d2('0x3e')]=_0x4f168b[_0xc6d2('0x30')];}this[_0xc6d2('0x14')][_0x4f168b[_0xc6d2('0x2e')]][_0xc6d2('0x69')]=_0x4f168b[_0xc6d2('0x2f')];this[_0xc6d2('0x14')][_0x4f168b[_0xc6d2('0x2e')]][_0xc6d2('0x65')]=_0x4f168b[_0xc6d2('0x35')];this[_0xc6d2('0x14')][_0x4f168b[_0xc6d2('0x2e')]]['disposition']=dispositions[_['toNumber'](_0x4f168b[_0xc6d2('0x45')])];}}else{if(this[_0xc6d2('0x14')][_0x4f168b[_0xc6d2('0x2e')]]){if(_0x50a1f5){this['channels'][_0x4f168b[_0xc6d2('0x2e')]]['UserId']=_0x50a1f5['id'];this[_0xc6d2('0x14')][_0x4f168b[_0xc6d2('0x2e')]][_0xc6d2('0x68')]=_0x50a1f5['name'];}}}if(_0x4f168b[_0xc6d2('0x34')]==='from-sip'){if(_0x50a1f5){_0x50a1f5[_0xc6d2('0x49')]=_0x4f168b[_0xc6d2('0x37')];var _0x1ddefb,_0x466e76;if(this[_0xc6d2('0x14')][_0x4f168b[_0xc6d2('0x2e')]]){_0x1ddefb=this[_0xc6d2('0x14')][_0x4f168b['uniqueid']][_0xc6d2('0x6a')];_0x466e76=this['channels'][_0x4f168b['uniqueid']][_0xc6d2('0x9')];}else if(this[_0xc6d2('0x14')][_0x4f168b[_0xc6d2('0x32')]]){_0x1ddefb=this[_0xc6d2('0x14')][_0x4f168b[_0xc6d2('0x32')]][_0xc6d2('0x6a')];_0x466e76=this[_0xc6d2('0x14')][_0x4f168b['linkedid']][_0xc6d2('0x9')];}_0x50a1f5[_0xc6d2('0x9')]=_0x466e76;_0x50a1f5['routealias']=_0x1ddefb;var _0x48a136={'id':_0x50a1f5['id'],'name':_0x50a1f5[_0xc6d2('0x3b')],'agentconnected':!![],'destaccountcode':_0x50a1f5['accountcode'],'destconnectedlinenum':_0x4f168b[_0xc6d2('0x37')],'queue':_0x466e76||undefined,'routealias':_0x1ddefb,'uniqueid':_0x4f168b[_0xc6d2('0x32')]};logger['debug']('[%s][voiceCallReport][newstate]\x20sending\x20user:agentconnect\x20event:',_0x4f168b[_0xc6d2('0x2e')],util[_0xc6d2('0x29')](_0x48a136,{'showHidden':![],'depth':null}));this[_0xc6d2('0x2c')](util[_0xc6d2('0x39')]('user:%s',_0x50a1f5[_0xc6d2('0x3b')]),'user:agentconnect',_0x48a136);}}}}catch(_0x50dd73){logger[_0xc6d2('0x27')](_0xc6d2('0x6b'),_0x4f168b[_0xc6d2('0x2e')],util['inspect'](_0x50dd73,{'showHidden':![],'depth':null}));}};VoiceCallReport[_0xc6d2('0x2a')]['syncMixMonitorFilename']=function(_0x46d35d,_0x3a1c51){try{if(this[_0xc6d2('0x14')][_0x46d35d]){logger[_0xc6d2('0x25')]('[%s][voiceCallReport][mixMonitorFilename]\x20monitorFilename:%s',_0x46d35d,_0x3a1c51);this[_0xc6d2('0x14')][_0x46d35d][_0xc6d2('0x6c')]=!![];if(_[_0xc6d2('0x6d')](_0x3a1c51,_0xc6d2('0x6e'))){_0x3a1c51=_0x3a1c51[_0xc6d2('0x6f')]('.wav49','.WAV');}this['channels'][_0x46d35d][_0xc6d2('0x70')]=_0x3a1c51;var _0x3f7a8b=_['find'](this[_0xc6d2('0x14')][_0x46d35d][_0xc6d2('0x71')],{'filename':_0x3a1c51});if(_['isNil'](_0x3f7a8b)){this[_0xc6d2('0x14')][_0x46d35d][_0xc6d2('0x71')]['push']({'filename':_0x3a1c51,'createdAt':moment()[_0xc6d2('0x39')](_0xc6d2('0x43')),'mixmonitorid':'','status':_0xc6d2('0x72')});}}}catch(_0x4659e5){logger[_0xc6d2('0x27')](_0xc6d2('0x73'),_0x46d35d,util[_0xc6d2('0x29')](_0x4659e5,{'showHidden':![],'depth':null}));}};VoiceCallReport['prototype']['syncVarSet']=function(_0x46e295){try{if(this['isNotNull'](_0x46e295)){logger[_0xc6d2('0x4a')](_0xc6d2('0x74'),_0x46e295['uniqueid'],util[_0xc6d2('0x29')](_0x46e295,{'showHidden':![],'depth':null}));if(this[_0xc6d2('0x14')][_0x46e295[_0xc6d2('0x2e')]]&&_0x46e295[_0xc6d2('0x35')]!=_0xc6d2('0x4f')){if(this[_0xc6d2('0x40')](_0x46e295[_0xc6d2('0x75')])){if(this['isNotNull'](_0x46e295[_0xc6d2('0x75')][_0xc6d2('0x76')])){logger[_0xc6d2('0x25')](_0xc6d2('0x77'),_0x46e295[_0xc6d2('0x2e')],_0x46e295[_0xc6d2('0x78')]);this[_0xc6d2('0x79')](_0x46e295['uniqueid'],_0x46e295[_0xc6d2('0x78')]);}else if(this[_0xc6d2('0x40')](_0x46e295[_0xc6d2('0x75')]['xmd-phone'])){logger['info']('[%s][voiceCallReport][varset]\x20variable:xmd-phone\x20value:%s',_0x46e295['uniqueid'],_0x46e295[_0xc6d2('0x78')]);this[_0xc6d2('0x14')][_0x46e295[_0xc6d2('0x2e')]][_0xc6d2('0x30')]=_0x46e295[_0xc6d2('0x78')];}else if(this['isNotNull'](_0x46e295[_0xc6d2('0x75')]['xmd-callerid'])){logger[_0xc6d2('0x25')](_0xc6d2('0x7a'),_0x46e295[_0xc6d2('0x2e')],_0x46e295[_0xc6d2('0x78')]);this[_0xc6d2('0x14')][_0x46e295[_0xc6d2('0x2e')]][_0xc6d2('0x7b')]=_0x46e295[_0xc6d2('0x78')];}else if(this['isNotNull'](_0x46e295['variable'][_0xc6d2('0x7c')])){logger[_0xc6d2('0x25')](_0xc6d2('0x7d'),_0x46e295[_0xc6d2('0x2e')],_0x46e295[_0xc6d2('0x78')]);this['channels'][_0x46e295[_0xc6d2('0x2e')]]['type']=_0x46e295[_0xc6d2('0x78')];}else if(this[_0xc6d2('0x40')](_0x46e295[_0xc6d2('0x75')][_0xc6d2('0x7e')])){logger['info'](_0xc6d2('0x7f'),_0x46e295['uniqueid'],_0x46e295[_0xc6d2('0x78')]['split'](',')[0x0]);this['channels'][_0x46e295[_0xc6d2('0x2e')]]['queue']=_0x46e295['value'][_0xc6d2('0x36')](',')[0x0];}else if(this[_0xc6d2('0x40')](_0x46e295[_0xc6d2('0x75')][_0xc6d2('0x80')])){logger[_0xc6d2('0x25')](_0xc6d2('0x81'),_0x46e295[_0xc6d2('0x2e')],_0x46e295[_0xc6d2('0x78')]);this['channels'][_0x46e295[_0xc6d2('0x2e')]][_0xc6d2('0x82')]=_0x46e295[_0xc6d2('0x78')];}else if(this[_0xc6d2('0x40')](_0x46e295[_0xc6d2('0x75')][_0xc6d2('0x83')])){logger[_0xc6d2('0x25')](_0xc6d2('0x84'),_0x46e295[_0xc6d2('0x2e')],_0x46e295[_0xc6d2('0x78')]);this[_0xc6d2('0x14')][_0x46e295[_0xc6d2('0x2e')]]['destination']=_0x46e295[_0xc6d2('0x78')];}else if(this[_0xc6d2('0x40')](_0x46e295[_0xc6d2('0x75')][_0xc6d2('0x85')])){logger[_0xc6d2('0x25')]('[%s][voiceCallReport][varset]\x20variable:xmd-callerid-preview\x20value:%s',_0x46e295['uniqueid'],_0x46e295['value']);this['channels'][_0x46e295['uniqueid']][_0xc6d2('0x86')]=_0x46e295['value'];}else if(this[_0xc6d2('0x40')](_0x46e295[_0xc6d2('0x75')]['xmcs-queue'])){logger[_0xc6d2('0x25')](_0xc6d2('0x87'),_0x46e295['uniqueid'],_0x46e295['value']);this[_0xc6d2('0x14')][_0x46e295[_0xc6d2('0x2e')]][_0xc6d2('0x9')]=_0x46e295[_0xc6d2('0x78')];}else if(this[_0xc6d2('0x40')](_0x46e295[_0xc6d2('0x75')][_0xc6d2('0x88')])){logger[_0xc6d2('0x25')](_0xc6d2('0x89'),_0x46e295[_0xc6d2('0x2e')],_0x46e295[_0xc6d2('0x78')]);this[_0xc6d2('0x14')][_0x46e295['uniqueid']][_0xc6d2('0x8a')]=_0x46e295[_0xc6d2('0x78')];}}}else if(this['isNotNull'](_0x46e295[_0xc6d2('0x75')][_0xc6d2('0x76')])){if(_0x46e295[_0xc6d2('0x78')]){var _0x563168=path[_0xc6d2('0x8b')](_0x46e295[_0xc6d2('0x78')])['name'];logger[_0xc6d2('0x25')](_0xc6d2('0x77'),_0x563168,_0x46e295[_0xc6d2('0x78')]);this[_0xc6d2('0x79')](_0x563168,_0x46e295['value']);}}else if(this[_0xc6d2('0x14')][_0x46e295['linkedid']]){if(this[_0xc6d2('0x40')](_0x46e295[_0xc6d2('0x75')])){if(this[_0xc6d2('0x40')](_0x46e295[_0xc6d2('0x75')][_0xc6d2('0x88')])){logger['info']('[%s][voiceCallReport][varset]\x20variable:sipcallid\x20value:%s',_0x46e295['linkedid'],_0x46e295[_0xc6d2('0x78')]);this[_0xc6d2('0x14')][_0x46e295[_0xc6d2('0x32')]][_0xc6d2('0x8c')]=_0x46e295[_0xc6d2('0x78')];}}}}}catch(_0x147224){logger[_0xc6d2('0x27')](_0xc6d2('0x8d'),_0x46e295['uniqueid'],util['inspect'](_0x147224,{'showHidden':![],'depth':null}));}};VoiceCallReport[_0xc6d2('0x2a')][_0xc6d2('0x1d')]=function(_0x3c4981){try{if(this[_0xc6d2('0x40')](_0x3c4981)){logger['debug'](_0xc6d2('0x8e'),_0x3c4981[_0xc6d2('0x2e')],util[_0xc6d2('0x29')](_0x3c4981,{'showHidden':![],'depth':null}));if(this['blindTransfers'][_0x3c4981[_0xc6d2('0x32')]]){if(this['channels'][this[_0xc6d2('0x16')][_0x3c4981[_0xc6d2('0x32')]][_0xc6d2('0x32')]]){this[_0xc6d2('0x14')][this[_0xc6d2('0x16')][_0x3c4981[_0xc6d2('0x32')]][_0xc6d2('0x32')]]['uniqueid']=_0x3c4981['uniqueid'];this[_0xc6d2('0x14')][this[_0xc6d2('0x16')][_0x3c4981[_0xc6d2('0x32')]]['linkedid']][_0xc6d2('0x62')]=this[_0xc6d2('0x14')][_0x3c4981[_0xc6d2('0x2e')]][_0xc6d2('0x62')];this[_0xc6d2('0x14')][this[_0xc6d2('0x16')][_0x3c4981['linkedid']][_0xc6d2('0x32')]][_0xc6d2('0x63')]=this[_0xc6d2('0x14')][_0x3c4981[_0xc6d2('0x2e')]][_0xc6d2('0x63')];this['channels'][this[_0xc6d2('0x16')][_0x3c4981[_0xc6d2('0x32')]][_0xc6d2('0x32')]]['destinationchannel']=this[_0xc6d2('0x14')][this[_0xc6d2('0x16')][_0x3c4981['linkedid']][_0xc6d2('0x32')]][_0xc6d2('0x35')];this[_0xc6d2('0x14')][this['blindTransfers'][_0x3c4981[_0xc6d2('0x32')]]['linkedid']][_0xc6d2('0x44')]=this['channels'][_0x3c4981[_0xc6d2('0x2e')]][_0xc6d2('0x44')];this[_0xc6d2('0x14')][_0x3c4981[_0xc6d2('0x2e')]]=this['channels'][this['blindTransfers'][_0x3c4981[_0xc6d2('0x32')]]['linkedid']];delete this[_0xc6d2('0x14')][this[_0xc6d2('0x16')][_0x3c4981['linkedid']][_0xc6d2('0x32')]];}else if(this[_0xc6d2('0x14')][this[_0xc6d2('0x16')][_0x3c4981[_0xc6d2('0x32')]][_0xc6d2('0x2e')]]){this[_0xc6d2('0x14')][this[_0xc6d2('0x16')][_0x3c4981[_0xc6d2('0x32')]][_0xc6d2('0x2e')]][_0xc6d2('0x2e')]=[this[_0xc6d2('0x14')][this['blindTransfers'][_0x3c4981[_0xc6d2('0x32')]][_0xc6d2('0x2e')]][_0xc6d2('0x32')],this[_0xc6d2('0x14')][this['blindTransfers'][_0x3c4981['linkedid']][_0xc6d2('0x2e')]][_0xc6d2('0x32')]=this[_0xc6d2('0x14')][this['blindTransfers'][_0x3c4981['linkedid']]['uniqueid']]['uniqueid']][0x0];this[_0xc6d2('0x14')][this[_0xc6d2('0x16')][_0x3c4981[_0xc6d2('0x32')]][_0xc6d2('0x2e')]][_0xc6d2('0x62')]=this['channels'][_0x3c4981[_0xc6d2('0x2e')]][_0xc6d2('0x62')];this[_0xc6d2('0x14')][this['blindTransfers'][_0x3c4981['linkedid']][_0xc6d2('0x2e')]][_0xc6d2('0x63')]=this[_0xc6d2('0x14')][_0x3c4981[_0xc6d2('0x2e')]][_0xc6d2('0x63')];this[_0xc6d2('0x14')][this[_0xc6d2('0x16')][_0x3c4981['linkedid']][_0xc6d2('0x2e')]]['destinationchannel']=this['channels'][this[_0xc6d2('0x16')][_0x3c4981[_0xc6d2('0x32')]][_0xc6d2('0x2e')]][_0xc6d2('0x35')];this[_0xc6d2('0x14')][this[_0xc6d2('0x16')][_0x3c4981[_0xc6d2('0x32')]][_0xc6d2('0x2e')]][_0xc6d2('0x44')]=this[_0xc6d2('0x14')][_0x3c4981[_0xc6d2('0x2e')]][_0xc6d2('0x44')];this[_0xc6d2('0x14')][_0x3c4981[_0xc6d2('0x2e')]]=this[_0xc6d2('0x14')][this[_0xc6d2('0x16')][_0x3c4981['linkedid']]['uniqueid']];delete this[_0xc6d2('0x14')][this[_0xc6d2('0x16')][_0x3c4981[_0xc6d2('0x32')]][_0xc6d2('0x2e')]];}}if(this[_0xc6d2('0x14')][_0x3c4981[_0xc6d2('0x2e')]]){logger['info'](_0xc6d2('0x8f'),_0x3c4981[_0xc6d2('0x2e')],_0x3c4981[_0xc6d2('0x90')]);var _0x1f5725=moment();this[_0xc6d2('0x14')][_0x3c4981[_0xc6d2('0x2e')]]['endtime']=_0x1f5725[_0xc6d2('0x39')](_0xc6d2('0x43'));this[_0xc6d2('0x14')][_0x3c4981[_0xc6d2('0x2e')]]['duration']=_0x1f5725[_0xc6d2('0x91')](this[_0xc6d2('0x14')][_0x3c4981[_0xc6d2('0x2e')]][_0xc6d2('0x42')],_0xc6d2('0x59'));if(this['channels'][_0x3c4981['uniqueid']][_0xc6d2('0x62')]){this[_0xc6d2('0x14')][_0x3c4981[_0xc6d2('0x2e')]]['billableseconds']=_0x1f5725[_0xc6d2('0x91')](this[_0xc6d2('0x14')][_0x3c4981[_0xc6d2('0x2e')]][_0xc6d2('0x63')],_0xc6d2('0x59'));this[_0xc6d2('0x14')][_0x3c4981[_0xc6d2('0x2e')]][_0xc6d2('0x64')]=this[_0xc6d2('0x14')][_0x3c4981[_0xc6d2('0x2e')]]['duration']-this[_0xc6d2('0x14')][_0x3c4981[_0xc6d2('0x2e')]][_0xc6d2('0x92')];}if(_0x3c4981[_0xc6d2('0x34')]==='from-sip'){if(this[_0xc6d2('0x15')][_0x3c4981[_0xc6d2('0x35')]['split']('-')[0x0]]){this[_0xc6d2('0x15')][_0x3c4981[_0xc6d2('0x35')][_0xc6d2('0x36')]('-')[0x0]]=_['omit'](this[_0xc6d2('0x15')][_0x3c4981[_0xc6d2('0x35')]['split']('-')[0x0]],[_0xc6d2('0x49')]);logger['debug'](_0xc6d2('0x93'),_0x3c4981['uniqueid'],util[_0xc6d2('0x29')]({'id':this[_0xc6d2('0x15')][_0x3c4981[_0xc6d2('0x35')][_0xc6d2('0x36')]('-')[0x0]]['id'],'destaccountcode':this[_0xc6d2('0x15')][_0x3c4981[_0xc6d2('0x35')][_0xc6d2('0x36')]('-')[0x0]][_0xc6d2('0x3d')]},{'showHidden':![],'depth':null}));this['emit'](util[_0xc6d2('0x39')](_0xc6d2('0x3a'),this[_0xc6d2('0x15')][_0x3c4981['channel']['split']('-')[0x0]][_0xc6d2('0x3b')]),'user:agentcomplete',{'id':this[_0xc6d2('0x15')][_0x3c4981['channel']['split']('-')[0x0]]['id'],'destaccountcode':this[_0xc6d2('0x15')][_0x3c4981['channel'][_0xc6d2('0x36')]('-')[0x0]][_0xc6d2('0x3d')]});for(var _0x565ed7=0x0;_0x565ed70x0?!![]:![];if(!_0x179a17){return this['syncQueueSummaryComplete'](this[_0x5184('0x16')]['completeEvent']);}};VoiceQueueReport[_0x5184('0xb')][_0x5184('0x1d')]=function(_0x5745b6){var _0x245e66=this[_0x5184('0x16')]['id'];if(this[_0x5184('0x16')][_0x5184('0x6b')][_0x245e66]&&this[_0x5184('0x16')][_0x5184('0x6b')][_0x245e66][_0x5745b6[_0x5184('0x66')]]){this[_0x5184('0x16')]['queuestatus'][_0x245e66][_0x5745b6[_0x5184('0x66')]][_0x5184('0x11')]['push'](_0x5745b6);}};VoiceQueueReport[_0x5184('0xb')][_0x5184('0x19')]=function(_0x1e330c){var _0xe3fa63=this;try{if(this[_0x5184('0x6f')](_0x1e330c)&&this[_0x5184('0x6f')](_0x1e330c[_0x5184('0x5a')])){logger[_0x5184('0x4f')]('[voiceQueueReport][queuesummary]\x20event:',util[_0x5184('0x46')](_0x1e330c,{'showHidden':![],'depth':null}));var _0x3ccc95=this[_0x5184('0x14')][_0x1e330c['queue']];if(_0x3ccc95){logger[_0x5184('0x4f')](_0x5184('0x70'),_0x3ccc95[_0x5184('0x60')]);this[_0x5184('0x16')]['queues'][_0x3ccc95[_0x5184('0x60')]]={'summaryEvent':_0x1e330c};this[_0x5184('0x16')]['statusRequests']+=0x1;return ami[_0x5184('0x62')]({'action':_0x5184('0x6b'),'queue':_0x3ccc95[_0x5184('0x60')]})[_0x5184('0x65')](function(_0x1a34c2){if(!_0xe3fa63['summary'][_0x5184('0x6b')][_0x1e330c[_0x5184('0x66')]]){_0xe3fa63[_0x5184('0x16')][_0x5184('0x6b')][_0x1e330c[_0x5184('0x66')]]={};}_0xe3fa63[_0x5184('0x16')][_0x5184('0x6b')][_0x1e330c[_0x5184('0x66')]][_0x1a34c2[_0x5184('0x66')]]={'queue':_0x3ccc95[_0x5184('0x60')],'agents':[]};})[_0x5184('0x42')](function(_0x56aedc){throw _0x56aedc;});}}}catch(_0x30656e){logger[_0x5184('0x44')](_0x5184('0x67'),util['inspect'](_0x30656e,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0x5184('0xb')]['syncQueueSummaryComplete']=function(_0x2b5517){if(this[_0x5184('0x16')][_0x5184('0x6e')]>0x0){this[_0x5184('0x16')]['completeEvent']=_0x2b5517;return;}logger[_0x5184('0x4f')](_0x5184('0x71'),util['inspect'](_0x2b5517,{'showHidden':![],'depth':null}));this[_0x5184('0x16')]=initializeSummary();ami[_0x5184('0x4e')](_0x5184('0x72'),{});};VoiceQueueReport[_0x5184('0xb')]['syncQueueCallerJoin']=function(_0x42fdd0){try{if(this[_0x5184('0x6f')](_0x42fdd0)){logger[_0x5184('0x4f')](_0x5184('0x73'),_0x42fdd0[_0x5184('0x51')],util['inspect'](_0x42fdd0,{'showHidden':![],'depth':null}));if(_['isUndefined'](this[_0x5184('0x47')][_0x42fdd0[_0x5184('0x51')]])){this['queueReports'][_0x42fdd0[_0x5184('0x51')]]=[];}if(_[_0x5184('0x61')](this['channels'][_0x42fdd0[_0x5184('0x51')]])){this[_0x5184('0x12')][_0x42fdd0[_0x5184('0x51')]]={};}var _0x393ac5=new QueueReport();_0x393ac5[_0x5184('0x5a')]=_0x42fdd0[_0x5184('0x5a')];_0x393ac5['type']=this[_0x5184('0x14')][_0x393ac5[_0x5184('0x5a')]]&&this[_0x5184('0x14')][_0x393ac5[_0x5184('0x5a')]]['type']?this[_0x5184('0x14')][_0x393ac5[_0x5184('0x5a')]]['type']||_0x5184('0x5e'):_0x5184('0x5e');_0x393ac5[_0x5184('0x74')]=moment()[_0x5184('0x59')](_0x5184('0x75'));_0x393ac5[_0x5184('0x76')]=_0x42fdd0[_0x5184('0x76')];_0x393ac5['count']=_0x42fdd0[_0x5184('0x77')];_0x393ac5[_0x5184('0x51')]=_0x42fdd0[_0x5184('0x51')];_0x393ac5['routealias']=this[_0x5184('0x12')][_0x42fdd0['uniqueid']][_0x5184('0x78')];logger[_0x5184('0x79')](_0x5184('0x7a'),_0x393ac5[_0x5184('0x5a')],_0x393ac5['type']);Object[_0x5184('0x6a')](_0x393ac5,_['pick'](_0x42fdd0,_[_0x5184('0x7b')](_0x393ac5)));this[_0x5184('0x47')][_0x42fdd0['uniqueid']][_0x5184('0x7c')](_0x393ac5);this[_0x5184('0x12')][_0x42fdd0[_0x5184('0x51')]]=_0x393ac5;this['emitVoiceQueueChannelSave'](_0x393ac5,'queuecallerjoin');}}catch(_0x462a9e){logger[_0x5184('0x44')](_0x5184('0x73'),_0x42fdd0['uniqueid'],util['inspect'](_0x462a9e,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0x5184('0xb')]['syncQueueCallerAbandon']=function(_0xa7330a){try{if(this[_0x5184('0x6f')](_0xa7330a)){logger['debug'](_0x5184('0x7d'),_0xa7330a[_0x5184('0x51')],util[_0x5184('0x46')](_0xa7330a,{'showHidden':![],'depth':null}));if(this['queueReports'][_0xa7330a[_0x5184('0x51')]]){var _0x23b787=_['last'](this[_0x5184('0x47')][_0xa7330a[_0x5184('0x51')]]);_0x23b787[_0x5184('0x3c')]=![];_0x23b787[_0x5184('0x7e')]=null;_0x23b787[_0x5184('0x7f')]=_0xa7330a['holdtime'];_0x23b787['originalposition']=_0xa7330a['originalposition'];_0x23b787[_0x5184('0x22')]=!![];_0x23b787['queuecallerabandonAt']=moment()[_0x5184('0x59')]('YYYY-MM-DD\x20HH:mm:ss');_0x23b787[_0x5184('0x57')]=_0x5184('0x80');_0x23b787[_0x5184('0x81')]=null;logger['info'](_0x5184('0x82'),_0x23b787[_0x5184('0x5a')],_0x23b787[_0x5184('0x5d')]);this[_0x5184('0x12')][_0xa7330a[_0x5184('0x51')]]=_0x23b787;this[_0x5184('0x4c')](_0x23b787,_0x5184('0x22'));}}}catch(_0x4fb8d3){logger['error'](_0x5184('0x7d'),_0xa7330a['uniqueid'],util['inspect'](_0x4fb8d3,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0x5184('0xb')][_0x5184('0x24')]=function(_0x71856e){try{if(this['isNotNull'](_0x71856e)){logger[_0x5184('0x4f')]('[%s][voiceQueueReport][queuecallerleave]',_0x71856e[_0x5184('0x51')],util[_0x5184('0x46')](_0x71856e,{'showHidden':![],'depth':null}));if(this[_0x5184('0x47')][_0x71856e[_0x5184('0x51')]]){var _0x4c005e=_[_0x5184('0x83')](this['queueReports'][_0x71856e[_0x5184('0x51')]]);_0x4c005e[_0x5184('0x84')]=moment()[_0x5184('0x59')](_0x5184('0x75'));_0x4c005e[_0x5184('0x85')]=_0x71856e['connectedlinenum'];_0x4c005e[_0x5184('0x86')]=_0x71856e[_0x5184('0x86')];logger['info'](_0x5184('0x87'),_0x4c005e['queue'],_0x4c005e[_0x5184('0x5d')],_0x71856e[_0x5184('0x85')],_0x71856e['connectedlinename']);this[_0x5184('0x12')][_0x71856e[_0x5184('0x51')]]=_0x4c005e;this[_0x5184('0x88')](_0x4c005e,_0x5184('0x89'));}}}catch(_0x478567){logger['error']('[%s][voiceQueueReport][queuecallerleave]',_0x71856e[_0x5184('0x51')],util[_0x5184('0x46')](_0x478567,{'showHidden':![],'depth':null}));}};VoiceQueueReport['prototype'][_0x5184('0x28')]=function(_0x206d72){try{if(this[_0x5184('0x6f')](_0x206d72)){logger[_0x5184('0x4f')](_0x5184('0x8a'),_0x206d72['uniqueid'],util['inspect'](_0x206d72,{'showHidden':![],'depth':null}));if(this[_0x5184('0x47')][_0x206d72[_0x5184('0x51')]]){var _0xe4db05=_[_0x5184('0x83')](this[_0x5184('0x47')][_0x206d72['uniqueid']]);_0xe4db05['queuecallercomplete']=!![];_0xe4db05[_0x5184('0x57')]=_0x5184('0x8b');logger['info'](_0x5184('0x8c'),_0xe4db05[_0x5184('0x5a')],_0xe4db05[_0x5184('0x5d')]);}}}catch(_0x12ab39){logger['error'](_0x5184('0x8a'),_0x206d72['uniqueid'],util[_0x5184('0x46')](_0x12ab39,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0x5184('0xb')]['syncAgentComplete']=function(_0x8dfb63){try{if(this[_0x5184('0x6f')](_0x8dfb63)){logger[_0x5184('0x4f')](_0x5184('0x8d'),_0x8dfb63['uniqueid'],util[_0x5184('0x46')](_0x8dfb63,{'showHidden':![],'depth':null}));if(this[_0x5184('0x47')][_0x8dfb63['uniqueid']]){var _0x1ce2b4=_[_0x5184('0x83')](this['queueReports'][_0x8dfb63[_0x5184('0x51')]]);_0x1ce2b4['queuecallerabandon']=![];_0x1ce2b4['queuecallerabandonAt']=null;_0x1ce2b4['assigned']=!![];_0x1ce2b4[_0x5184('0x81')]=_0x8dfb63['membername'];_0x1ce2b4['holdtime']=_0x8dfb63[_0x5184('0x7f')];_0x1ce2b4[_0x5184('0x3c')]=!![];_0x1ce2b4[_0x5184('0x3b')]=![];_0x1ce2b4[_0x5184('0x8e')]=null;if(!_0x1ce2b4[_0x5184('0x8f')]){if(_0x8dfb63['reason']==_0x5184('0x8f')){_0x1ce2b4[_0x5184('0x57')]=_0x5184('0x90');logger['info']('[voiceQueueReport][agentcomplete]\x20name:%s\x20type:%s\x20queuecallerexitreason:COMPLETED',_0x1ce2b4['queue'],_0x1ce2b4[_0x5184('0x5d')]);}else{if(_['startsWith'](_0x8dfb63[_0x5184('0x41')][_0x5184('0x91')](),_0x5184('0x92'))){if(this[_0x5184('0x47')][_0x8dfb63[_0x5184('0x93')]]){var _0x21b105=_[_0x5184('0x83')](this[_0x5184('0x47')][_0x8dfb63[_0x5184('0x93')]]);_0x21b105[_0x5184('0x3c')]=![];_0x21b105[_0x5184('0x3b')]=!![];_0x21b105[_0x5184('0x8e')]=moment(_0x1ce2b4[_0x5184('0x74')])['add'](_0x8dfb63[_0x5184('0x7f')],_0x5184('0x94'))[_0x5184('0x59')](_0x5184('0x75'));_0x21b105['queuecallerexitreason']=_0x5184('0x95');_0x21b105[_0x5184('0x8f')]=!![];_0x21b105[_0x5184('0x96')]=_0x5184('0x97');_0x21b105['transferexten']=_0x8dfb63[_0x5184('0x98')];_0x21b105['transferuniqueid']=_0x8dfb63[_0x5184('0x51')];logger[_0x5184('0x79')](_0x5184('0x99'),_0x21b105[_0x5184('0x5a')],_0x21b105[_0x5184('0x5d')]);var _0x57ac02=this['queueReports'][_0x8dfb63[_0x5184('0x93')]];this['queueReports'][_0x8dfb63[_0x5184('0x93')]]=this[_0x5184('0x47')][_0x8dfb63[_0x5184('0x51')]];this[_0x5184('0x47')][_0x8dfb63['uniqueid']]=_0x57ac02;}}else{_0x1ce2b4['queuecallerexitreason']=_0x5184('0x9a')+_0x8dfb63[_0x5184('0x9b')][_0x5184('0x9c')]();logger[_0x5184('0x79')](_0x5184('0x9d'),_0x1ce2b4[_0x5184('0x5a')],_0x1ce2b4['type'],_0x1ce2b4[_0x5184('0x57')]);}}}this[_0x5184('0x12')][_0x8dfb63[_0x5184('0x51')]]=_0x1ce2b4;}}}catch(_0x3045b4){logger[_0x5184('0x44')]('[%s][voiceQueueReport][agentcomplete]',_0x8dfb63[_0x5184('0x51')],util[_0x5184('0x46')](_0x3045b4,{'showHidden':![],'depth':null}));}};VoiceQueueReport['prototype'][_0x5184('0x29')]=function(_0x31494d){try{if(this['isNotNull'](_0x31494d)){logger[_0x5184('0x4f')]('[%s][voiceQueueReport][varset]',_0x31494d[_0x5184('0x51')],util['inspect'](_0x31494d,{'showHidden':![],'depth':null}));this[_0x5184('0x9e')](_0x31494d[_0x5184('0x51')],_[_0x5184('0x7b')](_0x31494d[_0x5184('0x9f')])[0x0],_0x31494d[_0x5184('0xa0')]);if(this['queueReports'][_0x31494d['uniqueid']]){var _0x81ec75=_[_0x5184('0x83')](this[_0x5184('0x47')][_0x31494d[_0x5184('0x51')]]);if(_0x81ec75){if(this['isNotNull'](_0x31494d['variable'])&&this['isNotNull'](_0x31494d['variable'][_0x5184('0x6b')])){switch(_0x31494d[_0x5184('0xa0')]){case _0x5184('0xa1'):_0x81ec75[_0x5184('0x3b')]=![];_0x81ec75[_0x5184('0x8e')]=null;break;case _0x5184('0xa2'):_0x81ec75[_0x5184('0xa3')]=_0x5184('0xa4');_0x81ec75[_0x5184('0x3b')]=!![];_0x81ec75[_0x5184('0x8e')]=moment()[_0x5184('0x59')](_0x5184('0x75'));_0x81ec75[_0x5184('0x84')]=moment()[_0x5184('0x59')](_0x5184('0x75'));logger[_0x5184('0x4f')](_0x5184('0xa5'),_0x31494d[_0x5184('0x51')],util['inspect'](_0x81ec75,{'showHidden':![],'depth':null}));ami[_0x5184('0x4e')]('custom:timeout',_0x81ec75);break;default:_0x81ec75[_0x5184('0x3b')]=!![];_0x81ec75[_0x5184('0x8e')]=moment()['format'](_0x5184('0x75'));_0x81ec75['queuecallerleaveAt']=moment()[_0x5184('0x59')](_0x5184('0x75'));}_0x81ec75[_0x5184('0x22')]=![];_0x81ec75[_0x5184('0xa6')]=null;_0x81ec75[_0x5184('0x57')]=_0x31494d[_0x5184('0xa0')];this[_0x5184('0x12')][_0x31494d[_0x5184('0x51')]]=_0x81ec75;this['emitVoiceQueueChannelRemove'](_0x81ec75,_0x5184('0xa7'));}else if(this[_0x5184('0x6f')](_0x31494d[_0x5184('0x9f')])&&this['isNotNull'](_0x31494d[_0x5184('0x9f')][_0x5184('0xa8')])){if(!_0x81ec75[_0x5184('0x22')]){_0x81ec75['queuecallerexit']=!![];_0x81ec75[_0x5184('0x8e')]=moment()[_0x5184('0x59')]('YYYY-MM-DD\x20HH:mm:ss');_0x81ec75[_0x5184('0x57')]=_0x5184('0xa9');_0x81ec75[_0x5184('0x84')]=moment()['format'](_0x5184('0x75'));this[_0x5184('0x12')][_0x31494d[_0x5184('0x51')]]=_0x81ec75;}}logger[_0x5184('0x79')](_0x5184('0xaa'),_0x31494d[_0x5184('0x51')],_0x81ec75[_0x5184('0x5a')],_0x81ec75[_0x5184('0x5d')],_[_0x5184('0x7b')](_0x31494d[_0x5184('0x9f')])[0x0],_0x31494d[_0x5184('0xa0')]);_0x81ec75['variables']=this['variables'][_0x31494d[_0x5184('0x51')]];}}}}catch(_0x563a05){logger[_0x5184('0x44')](_0x5184('0xab'),_0x31494d[_0x5184('0x51')],util[_0x5184('0x46')](_0x563a05,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0x5184('0xb')][_0x5184('0x9e')]=function(_0xc83c0e,_0x2353df,_0x4e8c50){var _0x4baf86=[_0x5184('0xac'),_0x5184('0xad'),_0x5184('0xae'),_0x5184('0xaf'),_0x5184('0xb0'),_0x5184('0xb1'),_0x5184('0xb2'),_0x5184('0xb3'),_0x5184('0xb4'),_0x5184('0xb5'),_0x5184('0xb6'),_0x5184('0xb7'),_0x5184('0xb8'),'memberdynamic',_0x5184('0xb9'),_0x5184('0xba'),_0x5184('0xbb'),_0x5184('0xbc'),_0x5184('0xbd')];if(!_['isNil'](_0x2353df)&&!_['includes'](_0x4baf86,_0x2353df)){if(_[_0x5184('0x61')](this[_0x5184('0x17')][_0xc83c0e])){this['variables'][_0xc83c0e]={};}this[_0x5184('0x17')][_0xc83c0e][_0x2353df]=_0x4e8c50;}};VoiceQueueReport['prototype'][_0x5184('0xbe')]=function(_0x9cd138,_0x17777a,_0x4166e0){try{var _0x36290f={};if(this[_0x5184('0x47')][_0x9cd138]){for(var _0x3a104a=0x0;_0x3a104a0x0?!![]:![];if(!_0x3ab17d){return this[_0x7e68('0x1c')](this[_0x7e68('0x50')][_0x7e68('0x74')]);}};VoiceQueueReport['prototype']['syncQueueMember']=function(_0x411e2e){var _0x4299cd=this['summary']['id'];if(this[_0x7e68('0x50')][_0x7e68('0x69')][_0x4299cd]&&this[_0x7e68('0x50')][_0x7e68('0x69')][_0x4299cd][_0x411e2e[_0x7e68('0x68')]]){this[_0x7e68('0x50')][_0x7e68('0x69')][_0x4299cd][_0x411e2e[_0x7e68('0x68')]][_0x7e68('0x13')][_0x7e68('0x75')](_0x411e2e);}};VoiceQueueReport[_0x7e68('0xc')][_0x7e68('0x19')]=function(_0x2efa0d){var _0x2ebec1=this;try{if(this[_0x7e68('0x65')](_0x2efa0d)&&this[_0x7e68('0x65')](_0x2efa0d[_0x7e68('0x57')])){logger['debug'](_0x7e68('0x76'),util[_0x7e68('0x49')](_0x2efa0d,{'showHidden':![],'depth':null}));var _0x31dc51=this[_0x7e68('0x16')][_0x2efa0d['queue']];if(_0x31dc51){logger['debug'](_0x7e68('0x77'),_0x31dc51[_0x7e68('0x63')]);this[_0x7e68('0x50')][_0x7e68('0x6c')][_0x31dc51[_0x7e68('0x63')]]={'summaryEvent':_0x2efa0d};this['summary'][_0x7e68('0x73')]+=0x1;return ami[_0x7e68('0x41')]({'action':_0x7e68('0x69'),'queue':_0x31dc51[_0x7e68('0x63')]})['then'](function(_0x22ae9d){if(!_0x2ebec1[_0x7e68('0x50')][_0x7e68('0x69')][_0x2efa0d[_0x7e68('0x68')]]){_0x2ebec1[_0x7e68('0x50')][_0x7e68('0x69')][_0x2efa0d[_0x7e68('0x68')]]={};}_0x2ebec1[_0x7e68('0x50')][_0x7e68('0x69')][_0x2efa0d[_0x7e68('0x68')]][_0x22ae9d['actionid']]={'queue':_0x31dc51[_0x7e68('0x63')],'agents':[]};})[_0x7e68('0x44')](function(_0x5b42bd){throw _0x5b42bd;});}}}catch(_0x372249){logger[_0x7e68('0x47')](_0x7e68('0x6a'),util['inspect'](_0x372249,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0x7e68('0xc')][_0x7e68('0x1c')]=function(_0x1d3792){if(this[_0x7e68('0x50')]['statusRequests']>0x0){this[_0x7e68('0x50')][_0x7e68('0x74')]=_0x1d3792;return;}logger[_0x7e68('0x54')](_0x7e68('0x78'),util[_0x7e68('0x49')](_0x1d3792,{'showHidden':![],'depth':null}));this[_0x7e68('0x50')]=initializeSummary();ami[_0x7e68('0x52')](_0x7e68('0x79'),{});};VoiceQueueReport['prototype'][_0x7e68('0x20')]=function(_0x12c486){try{if(this[_0x7e68('0x65')](_0x12c486)){logger[_0x7e68('0x54')](_0x7e68('0x7a'),_0x12c486[_0x7e68('0x5c')],util[_0x7e68('0x49')](_0x12c486,{'showHidden':![],'depth':null}));if(_[_0x7e68('0x7b')](this[_0x7e68('0x11')][_0x12c486[_0x7e68('0x5c')]])){this[_0x7e68('0x11')][_0x12c486[_0x7e68('0x5c')]]=[];}if(_[_0x7e68('0x7b')](this[_0x7e68('0x14')][_0x12c486['uniqueid']])){this['channels'][_0x12c486[_0x7e68('0x5c')]]={};}var _0x1e0064=new QueueReport();_0x1e0064['queue']=_0x12c486[_0x7e68('0x57')];_0x1e0064[_0x7e68('0x61')]=this['voiceQueues'][_0x1e0064[_0x7e68('0x57')]]&&this[_0x7e68('0x16')][_0x1e0064['queue']]['type']?this[_0x7e68('0x16')][_0x1e0064[_0x7e68('0x57')]]['type']||_0x7e68('0x71'):_0x7e68('0x71');_0x1e0064['queuecallerjoinAt']=moment()[_0x7e68('0x55')]('YYYY-MM-DD\x20HH:mm:ss');_0x1e0064[_0x7e68('0x7c')]=_0x12c486[_0x7e68('0x7c')];_0x1e0064['count']=_0x12c486['count'];_0x1e0064[_0x7e68('0x5c')]=_0x12c486['uniqueid'];_0x1e0064['routealias']=this['channels'][_0x12c486[_0x7e68('0x5c')]][_0x7e68('0x7d')];logger[_0x7e68('0x7e')](_0x7e68('0x7f'),_0x1e0064['queue'],_0x1e0064['type']);Object[_0x7e68('0x70')](_0x1e0064,_[_0x7e68('0x80')](_0x12c486,_[_0x7e68('0x81')](_0x1e0064)));this[_0x7e68('0x11')][_0x12c486['uniqueid']]['push'](_0x1e0064);this[_0x7e68('0x14')][_0x12c486[_0x7e68('0x5c')]]=_0x1e0064;this[_0x7e68('0x53')](_0x1e0064,_0x7e68('0x82'));}}catch(_0x22b914){logger[_0x7e68('0x47')]('[%s][voiceQueueReport][queuecallerjoin]',_0x12c486[_0x7e68('0x5c')],util[_0x7e68('0x49')](_0x22b914,{'showHidden':![],'depth':null}));}};VoiceQueueReport['prototype']['syncQueueCallerAbandon']=function(_0x549c48){try{if(this[_0x7e68('0x65')](_0x549c48)){logger[_0x7e68('0x54')](_0x7e68('0x83'),_0x549c48[_0x7e68('0x5c')],util[_0x7e68('0x49')](_0x549c48,{'showHidden':![],'depth':null}));if(this[_0x7e68('0x11')][_0x549c48[_0x7e68('0x5c')]]){var _0x2fe55c=_[_0x7e68('0x84')](this[_0x7e68('0x11')][_0x549c48['uniqueid']]);_0x2fe55c[_0x7e68('0x3d')]=![];_0x2fe55c[_0x7e68('0x85')]=null;_0x2fe55c[_0x7e68('0x86')]=_0x549c48['holdtime'];_0x2fe55c['originalposition']=_0x549c48[_0x7e68('0x87')];_0x2fe55c['queuecallerabandon']=!![];_0x2fe55c[_0x7e68('0x88')]=moment()[_0x7e68('0x55')]('YYYY-MM-DD\x20HH:mm:ss');_0x2fe55c[_0x7e68('0x5d')]=_0x7e68('0x89');_0x2fe55c[_0x7e68('0x8a')]=null;logger['info'](_0x7e68('0x8b'),_0x2fe55c[_0x7e68('0x57')],_0x2fe55c[_0x7e68('0x61')]);this[_0x7e68('0x14')][_0x549c48[_0x7e68('0x5c')]]=_0x2fe55c;this[_0x7e68('0x5a')](_0x2fe55c,_0x7e68('0x21'));}}}catch(_0x1edb18){logger[_0x7e68('0x47')](_0x7e68('0x83'),_0x549c48[_0x7e68('0x5c')],util[_0x7e68('0x49')](_0x1edb18,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0x7e68('0xc')]['syncQueueCallerLeave']=function(_0x35fa2b){try{if(this[_0x7e68('0x65')](_0x35fa2b)){logger[_0x7e68('0x54')](_0x7e68('0x8c'),_0x35fa2b['uniqueid'],util[_0x7e68('0x49')](_0x35fa2b,{'showHidden':![],'depth':null}));if(this[_0x7e68('0x11')][_0x35fa2b[_0x7e68('0x5c')]]){var _0xdbc0da=_[_0x7e68('0x84')](this[_0x7e68('0x11')][_0x35fa2b[_0x7e68('0x5c')]]);_0xdbc0da[_0x7e68('0x8d')]=moment()['format'](_0x7e68('0x8e'));_0xdbc0da[_0x7e68('0x8f')]=_0x35fa2b[_0x7e68('0x8f')];_0xdbc0da['connectedlinename']=_0x35fa2b[_0x7e68('0x90')];logger[_0x7e68('0x7e')]('[voiceQueueReport][queuecallerleave]\x20name:%s\x20type:%s\x20connectedlinenum:%s\x20connectedlinename:%s',_0xdbc0da[_0x7e68('0x57')],_0xdbc0da[_0x7e68('0x61')],_0x35fa2b[_0x7e68('0x8f')],_0x35fa2b[_0x7e68('0x90')]);this['channels'][_0x35fa2b[_0x7e68('0x5c')]]=_0xdbc0da;this['emitVoiceQueueChannelSave'](_0xdbc0da,'queuecallerleave');}}}catch(_0x2d4cf8){logger[_0x7e68('0x47')](_0x7e68('0x8c'),_0x35fa2b[_0x7e68('0x5c')],util[_0x7e68('0x49')](_0x2d4cf8,{'showHidden':![],'depth':null}));}};VoiceQueueReport['prototype']['syncAgentConnect']=function(_0x52fd4e){try{if(this[_0x7e68('0x65')](_0x52fd4e)){logger['debug']('[%s][voiceQueueReport][agentconnect]',_0x52fd4e['uniqueid'],util['inspect'](_0x52fd4e,{'showHidden':![],'depth':null}));if(this[_0x7e68('0x11')][_0x52fd4e[_0x7e68('0x5c')]]){var _0x55baa0=_[_0x7e68('0x84')](this[_0x7e68('0x11')][_0x52fd4e['uniqueid']]);_0x55baa0[_0x7e68('0x3d')]=!![];_0x55baa0[_0x7e68('0x5d')]='COMPLETEDBYAGENT';logger['info'](_0x7e68('0x91'),_0x55baa0[_0x7e68('0x57')],_0x55baa0[_0x7e68('0x61')]);}}}catch(_0xf2cded){logger[_0x7e68('0x47')](_0x7e68('0x92'),_0x52fd4e['uniqueid'],util[_0x7e68('0x49')](_0xf2cded,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0x7e68('0xc')]['syncAgentComplete']=function(_0xcf18f9){try{if(this['isNotNull'](_0xcf18f9)){logger[_0x7e68('0x54')](_0x7e68('0x93'),_0xcf18f9[_0x7e68('0x5c')],util[_0x7e68('0x49')](_0xcf18f9,{'showHidden':![],'depth':null}));if(this[_0x7e68('0x11')][_0xcf18f9[_0x7e68('0x5c')]]){var _0x5ce207=_[_0x7e68('0x84')](this['queueReports'][_0xcf18f9[_0x7e68('0x5c')]]);_0x5ce207[_0x7e68('0x21')]=![];_0x5ce207[_0x7e68('0x88')]=null;_0x5ce207[_0x7e68('0x94')]=!![];_0x5ce207[_0x7e68('0x8a')]=_0xcf18f9['membername'];_0x5ce207['holdtime']=_0xcf18f9[_0x7e68('0x86')];_0x5ce207[_0x7e68('0x3d')]=!![];_0x5ce207[_0x7e68('0x3c')]=![];_0x5ce207['queuecallerexitAt']=null;if(!_0x5ce207[_0x7e68('0x95')]){if(_0xcf18f9[_0x7e68('0x96')]=='transfer'){_0x5ce207[_0x7e68('0x5d')]=_0x7e68('0x97');logger[_0x7e68('0x7e')](_0x7e68('0x98'),_0x5ce207[_0x7e68('0x57')],_0x5ce207[_0x7e68('0x61')]);}else{if(_[_0x7e68('0x99')](_0xcf18f9[_0x7e68('0x43')][_0x7e68('0x9a')](),_0x7e68('0x9b'))){if(this[_0x7e68('0x11')][_0xcf18f9[_0x7e68('0x9c')]]){var _0x293665=_[_0x7e68('0x84')](this[_0x7e68('0x11')][_0xcf18f9[_0x7e68('0x9c')]]);_0x293665['queuecallercomplete']=![];_0x293665['queuecallerexit']=!![];_0x293665[_0x7e68('0x9d')]=moment(_0x5ce207['queuecallerjoinAt'])['add'](_0xcf18f9[_0x7e68('0x86')],_0x7e68('0x9e'))[_0x7e68('0x55')]('YYYY-MM-DD\x20HH:mm:ss');_0x293665[_0x7e68('0x5d')]=_0x7e68('0x9f');_0x293665[_0x7e68('0x95')]=!![];_0x293665[_0x7e68('0xa0')]='FORWARD';_0x293665[_0x7e68('0xa1')]=_0xcf18f9[_0x7e68('0xa2')];_0x293665[_0x7e68('0xa3')]=_0xcf18f9[_0x7e68('0x5c')];logger[_0x7e68('0x7e')](_0x7e68('0xa4'),_0x293665[_0x7e68('0x57')],_0x293665['type']);var _0xd51e0b=this[_0x7e68('0x11')][_0xcf18f9[_0x7e68('0x9c')]];this[_0x7e68('0x11')][_0xcf18f9[_0x7e68('0x9c')]]=this[_0x7e68('0x11')][_0xcf18f9[_0x7e68('0x5c')]];this[_0x7e68('0x11')][_0xcf18f9[_0x7e68('0x5c')]]=_0xd51e0b;}}else{_0x5ce207[_0x7e68('0x5d')]=_0x7e68('0xa5')+_0xcf18f9['reason'][_0x7e68('0xa6')]();logger['info'](_0x7e68('0xa7'),_0x5ce207[_0x7e68('0x57')],_0x5ce207[_0x7e68('0x61')],_0x5ce207[_0x7e68('0x5d')]);}}}this[_0x7e68('0x14')][_0xcf18f9['uniqueid']]=_0x5ce207;}}}catch(_0x254d6d){logger[_0x7e68('0x47')](_0x7e68('0x93'),_0xcf18f9[_0x7e68('0x5c')],util[_0x7e68('0x49')](_0x254d6d,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0x7e68('0xc')][_0x7e68('0x28')]=function(_0x4d0348){try{if(this[_0x7e68('0x65')](_0x4d0348)){logger[_0x7e68('0x54')]('[%s][voiceQueueReport][varset]',_0x4d0348[_0x7e68('0x5c')],util[_0x7e68('0x49')](_0x4d0348,{'showHidden':![],'depth':null}));this[_0x7e68('0xa8')](_0x4d0348[_0x7e68('0x5c')],_[_0x7e68('0x81')](_0x4d0348[_0x7e68('0xa9')])[0x0],_0x4d0348[_0x7e68('0xaa')]);if(this['queueReports'][_0x4d0348[_0x7e68('0x5c')]]){var _0x19d362=_[_0x7e68('0x84')](this['queueReports'][_0x4d0348[_0x7e68('0x5c')]]);if(_0x19d362){if(this[_0x7e68('0x65')](_0x4d0348[_0x7e68('0xa9')])&&this['isNotNull'](_0x4d0348[_0x7e68('0xa9')][_0x7e68('0x69')])){switch(_0x4d0348['value']){case _0x7e68('0xab'):_0x19d362[_0x7e68('0x3c')]=![];_0x19d362[_0x7e68('0x9d')]=null;break;case _0x7e68('0xac'):_0x19d362[_0x7e68('0xad')]='timeout';_0x19d362[_0x7e68('0x3c')]=!![];_0x19d362[_0x7e68('0x9d')]=moment()['format']('YYYY-MM-DD\x20HH:mm:ss');_0x19d362[_0x7e68('0x8d')]=moment()[_0x7e68('0x55')]('YYYY-MM-DD\x20HH:mm:ss');logger['debug']('[%s][voiceQueueReport][varset]\x20sending\x20timeout\x20event:',_0x4d0348[_0x7e68('0x5c')],util[_0x7e68('0x49')](_0x19d362,{'showHidden':![],'depth':null}));ami[_0x7e68('0x52')](_0x7e68('0xae'),_0x19d362);break;default:_0x19d362[_0x7e68('0x3c')]=!![];_0x19d362[_0x7e68('0x9d')]=moment()[_0x7e68('0x55')](_0x7e68('0x8e'));_0x19d362['queuecallerleaveAt']=moment()[_0x7e68('0x55')](_0x7e68('0x8e'));}_0x19d362[_0x7e68('0x21')]=![];_0x19d362['queuecallerabandonAt']=null;_0x19d362[_0x7e68('0x5d')]=_0x4d0348[_0x7e68('0xaa')];this[_0x7e68('0x14')][_0x4d0348[_0x7e68('0x5c')]]=_0x19d362;this['emitVoiceQueueChannelRemove'](_0x19d362,_0x7e68('0xaf'));}else if(this[_0x7e68('0x65')](_0x4d0348[_0x7e68('0xa9')])&&this[_0x7e68('0x65')](_0x4d0348['variable']['queueposition'])){if(!_0x19d362[_0x7e68('0x21')]){_0x19d362[_0x7e68('0x3c')]=!![];_0x19d362[_0x7e68('0x9d')]=moment()['format'](_0x7e68('0x8e'));_0x19d362[_0x7e68('0x5d')]='EXITWITHKEY';_0x19d362['queuecallerleaveAt']=moment()['format'](_0x7e68('0x8e'));this[_0x7e68('0x14')][_0x4d0348[_0x7e68('0x5c')]]=_0x19d362;}}logger[_0x7e68('0x7e')]('[%s][voiceQueueReport][varset]\x20name:%s\x20type:%s\x20variable:%s\x20value:%s',_0x4d0348[_0x7e68('0x5c')],_0x19d362[_0x7e68('0x57')],_0x19d362[_0x7e68('0x61')],_[_0x7e68('0x81')](_0x4d0348[_0x7e68('0xa9')])[0x0],_0x4d0348['value']);_0x19d362[_0x7e68('0x4b')]=this[_0x7e68('0x4b')][_0x4d0348[_0x7e68('0x5c')]];}}}}catch(_0x322d06){logger['error']('[%s][voiceQueueReport][varset]',_0x4d0348[_0x7e68('0x5c')],util['inspect'](_0x322d06,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0x7e68('0xc')][_0x7e68('0xa8')]=function(_0x5eb6fb,_0xc0aa50,_0x58b525){var _0x34f702=[_0x7e68('0xb0'),_0x7e68('0xb1'),_0x7e68('0xb2'),_0x7e68('0xb3'),'rtpaudioqosloss',_0x7e68('0xb4'),'rtpaudioqosrtt',_0x7e68('0xb5'),_0x7e68('0xb6'),_0x7e68('0xb7'),_0x7e68('0xb8'),'bridgepvtcallid',_0x7e68('0xb9'),'memberdynamic',_0x7e68('0xba'),_0x7e68('0xbb'),_0x7e68('0xbc'),_0x7e68('0xbd'),_0x7e68('0xbe')];if(!_[_0x7e68('0x40')](_0xc0aa50)&&!_[_0x7e68('0xbf')](_0x34f702,_0xc0aa50)){if(_['isUndefined'](this[_0x7e68('0x4b')][_0x5eb6fb])){this[_0x7e68('0x4b')][_0x5eb6fb]={};}this['variables'][_0x5eb6fb][_0xc0aa50]=_0x58b525;}};VoiceQueueReport[_0x7e68('0xc')][_0x7e68('0xc0')]=function(_0x324a69,_0x25255d,_0x21a844){try{var _0x55255a={};if(this[_0x7e68('0x11')][_0x324a69]){for(var _0x370be4=0x0;_0x370be4=0x0?moment(_0x22eb4c[_0x7b2f('0x18')])['diff'](_0x22eb4c[_0x7b2f('0x17')],_0x7b2f('0xf')):null,'data1':_0x7b2f('0x19'),'data2':_0x22eb4c[_0x7b2f('0x14')],'data3':_0x22eb4c[_0x7b2f('0x12')],'data4':_0x22eb4c[_0x7b2f('0x1a')]||null,'role':'agent','internal':_0x22eb4c['accountcode']?_[_0x7b2f('0x1b')](_0x22eb4c['accountcode']):undefined,'uniqueid':_0x22eb4c['uniqueid']},'log':_0x7b2f('0x6')});}; \ No newline at end of file +var _0x6371=['exten','queue','agent','accountcode','toNumber','uniqueid','voiceDialReport','starttime','endtime','diff','outbound','dialstring','moment','util','../client','voiceQueueReport','queuecallercompleteAt','queuecallerexitAt','Request','CreateMemberReport','voice','lastAssignedTo','interface','TALKING','queuecallerleaveAt','seconds','inbound'];(function(_0x1f24ac,_0x590846){var _0x2b71c7=function(_0x2d0953){while(--_0x2d0953){_0x1f24ac['push'](_0x1f24ac['shift']());}};_0x2b71c7(++_0x590846);}(_0x6371,0x1bc));var _0x1637=function(_0x2b4448,_0x5bcc69){_0x2b4448=_0x2b4448-0x0;var _0xb4b465=_0x6371[_0x2b4448];return _0xb4b465;};'use strict';var moment=require(_0x1637('0x0'));var _=require('lodash');var util=require(_0x1637('0x1'));var client=require(_0x1637('0x2'));exports[_0x1637('0x3')]=function(_0x155495){var _0x494ba7=_0x155495[_0x1637('0x4')]||_0x155495[_0x1637('0x5')];return client[_0x1637('0x6')](_0x1637('0x7'),{'body':{'channel':_0x1637('0x8'),'membername':_0x155495[_0x1637('0x9')],'interface':_['isNil'](_0x155495[_0x1637('0xa')])?util['format']('SIP/%s',_0x155495['lastAssignedTo']):_0x155495[_0x1637('0xa')],'type':_0x1637('0xb'),'enterAt':_0x155495[_0x1637('0xc')],'exitAt':_0x494ba7,'duration':moment(_0x494ba7)['diff'](_0x155495['queuecallerleaveAt'],_0x1637('0xd')),'data1':_0x1637('0xe'),'data2':_0x155495['calleridnum'],'data3':_0x155495[_0x1637('0xf')],'data4':null,'data5':_0x155495[_0x1637('0x10')],'role':_0x1637('0x11'),'internal':_0x155495[_0x1637('0x12')]?_[_0x1637('0x13')](_0x155495[_0x1637('0x12')]):undefined,'uniqueid':_0x155495[_0x1637('0x14')]},'log':'CreateMemberReport'});};exports[_0x1637('0x15')]=function(_0xadc555){return client['Request'](_0x1637('0x7'),{'body':{'channel':_0x1637('0x8'),'membername':_0xadc555['membername'],'interface':_0xadc555[_0x1637('0xa')],'type':_0x1637('0xb'),'enterAt':_0xadc555[_0x1637('0x16')],'exitAt':_0xadc555[_0x1637('0x17')],'duration':moment(_0xadc555[_0x1637('0x17')])['diff'](_0xadc555[_0x1637('0x16')],_0x1637('0xd'))>=0x0?moment(_0xadc555[_0x1637('0x17')])[_0x1637('0x18')](_0xadc555[_0x1637('0x16')],_0x1637('0xd')):null,'data1':_0x1637('0x19'),'data2':_0xadc555[_0x1637('0x12')],'data3':_0xadc555[_0x1637('0xf')],'data4':_0xadc555[_0x1637('0x1a')]||null,'role':_0x1637('0x11'),'internal':_0xadc555[_0x1637('0x12')]?_[_0x1637('0x13')](_0xadc555['accountcode']):undefined,'uniqueid':_0xadc555[_0x1637('0x14')]},'log':_0x1637('0x7')});}; \ No newline at end of file diff --git a/server/services/ami/rpc/setting.js b/server/services/ami/rpc/setting.js index 9e5e0af..349bd14 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 _0x61d0=['Request','ShowSetting','previewRecallmeReminderInterval','../client'];(function(_0x1deb72,_0x3f6338){var _0x18bbdf=function(_0x1b4b9b){while(--_0x1b4b9b){_0x1deb72['push'](_0x1deb72['shift']());}};_0x18bbdf(++_0x3f6338);}(_0x61d0,0x187));var _0x061d=function(_0x1aeda2,_0x1217eb){_0x1aeda2=_0x1aeda2-0x0;var _0x32dc6d=_0x61d0[_0x1aeda2];return _0x32dc6d;};'use strict';var client=require(_0x061d('0x0'));exports['getSettings']=function(){return client[_0x061d('0x1')](_0x061d('0x2'),{'options':{'raw':!![],'where':{'id':0x1},'attributes':['stopRecordingOnTransfer',_0x061d('0x3')]},'log':'GetSettings'});}; \ No newline at end of file +var _0xf5c4=['Request','ShowSetting','stopRecordingOnTransfer','previewRecallmeReminderInterval','../client','getSettings'];(function(_0x3a177b,_0x10d9fe){var _0x205959=function(_0x39f5fe){while(--_0x39f5fe){_0x3a177b['push'](_0x3a177b['shift']());}};_0x205959(++_0x10d9fe);}(_0xf5c4,0x1ae));var _0x4f5c=function(_0x1e4305,_0x5b1de6){_0x1e4305=_0x1e4305-0x0;var _0x27b4ec=_0xf5c4[_0x1e4305];return _0x27b4ec;};'use strict';var client=require(_0x4f5c('0x0'));exports[_0x4f5c('0x1')]=function(){return client[_0x4f5c('0x2')](_0x4f5c('0x3'),{'options':{'raw':!![],'where':{'id':0x1},'attributes':[_0x4f5c('0x4'),_0x4f5c('0x5')]},'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 2aa2b77..c815ce3 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 _0x4189=['../client','Request','GetTemplate','html'];(function(_0x5bd3f2,_0x49f10b){var _0x444bfb=function(_0xae7210){while(--_0xae7210){_0x5bd3f2['push'](_0x5bd3f2['shift']());}};_0x444bfb(++_0x49f10b);}(_0x4189,0x13c));var _0x9418=function(_0x52b2db,_0x5e4db4){_0x52b2db=_0x52b2db-0x0;var _0x5a80db=_0x4189[_0x52b2db];return _0x5a80db;};'use strict';var client=require(_0x9418('0x0'));exports['getTemplates']=function(_0x114af8){return function(_0xbc128d){return client[_0x9418('0x1')](_0x9418('0x2'),{'options':{'raw':!![],'attributes':['id','name',_0x9418('0x3')]},'log':'GetTemplate'});};}; \ No newline at end of file +var _0x65ef=['getTemplates','Request','GetTemplate','name','html','../client'];(function(_0x464269,_0x1a8039){var _0xeb4b41=function(_0x203f0b){while(--_0x203f0b){_0x464269['push'](_0x464269['shift']());}};_0xeb4b41(++_0x1a8039);}(_0x65ef,0x7d));var _0xf65e=function(_0x103182,_0x507265){_0x103182=_0x103182-0x0;var _0x558ce8=_0x65ef[_0x103182];return _0x558ce8;};'use strict';var client=require(_0xf65e('0x0'));exports[_0xf65e('0x1')]=function(_0x5f3994){return function(_0x21bd89){return client[_0xf65e('0x2')](_0xf65e('0x3'),{'options':{'raw':!![],'attributes':['id',_0xf65e('0x4'),_0xf65e('0x5')]},'log':_0xf65e('0x3')});};}; \ No newline at end of file diff --git a/server/services/ami/rpc/trigger.js b/server/services/ami/rpc/trigger.js index 19a9c91..dc35dad 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 _0x1661=['Request','name','status','Condition','AllConditions','field','operator','AnyConditions','value','Action','data1','data2','data4','data5','data7','GetTrigger','../client','getTriggers'];(function(_0x373096,_0x4d37aa){var _0x14a6d0=function(_0xb3b614){while(--_0xb3b614){_0x373096['push'](_0x373096['shift']());}};_0x14a6d0(++_0x4d37aa);}(_0x1661,0x178));var _0x1166=function(_0x4b7a68,_0x2d75b8){_0x4b7a68=_0x4b7a68-0x0;var _0x192677=_0x1661[_0x4b7a68];return _0x192677;};'use strict';var client=require(_0x1166('0x0'));exports[_0x1166('0x1')]=function(_0x564147){return function(_0x3a0965){return client[_0x1166('0x2')]('GetTrigger',{'options':{'raw':![],'attributes':['id',_0x1166('0x3'),'channel',_0x1166('0x4')],'include':[{'model':_0x1166('0x5'),'as':_0x1166('0x6'),'attributes':['id',_0x1166('0x7'),_0x1166('0x8'),'value']},{'model':_0x1166('0x5'),'as':_0x1166('0x9'),'attributes':['id',_0x1166('0x7'),'operator',_0x1166('0xa')]},{'model':_0x1166('0xb'),'as':'Actions','attributes':['id','action',_0x1166('0xc'),_0x1166('0xd'),'data3',_0x1166('0xe'),_0x1166('0xf'),'data6',_0x1166('0x10')]}]},'log':_0x1166('0x11')});};}; \ No newline at end of file +var _0x3431=['name','channel','status','Condition','field','operator','value','AnyConditions','Action','action','data1','data2','data3','data4','data5','../client','GetTrigger'];(function(_0x504f7b,_0x1ac4e0){var _0x2b0904=function(_0x28e51d){while(--_0x28e51d){_0x504f7b['push'](_0x504f7b['shift']());}};_0x2b0904(++_0x1ac4e0);}(_0x3431,0x11f));var _0x1343=function(_0x11ce46,_0x177a85){_0x11ce46=_0x11ce46-0x0;var _0x368a1e=_0x3431[_0x11ce46];return _0x368a1e;};'use strict';var client=require(_0x1343('0x0'));exports['getTriggers']=function(_0x3cb66e){return function(_0x25efbb){return client['Request'](_0x1343('0x1'),{'options':{'raw':![],'attributes':['id',_0x1343('0x2'),_0x1343('0x3'),_0x1343('0x4')],'include':[{'model':_0x1343('0x5'),'as':'AllConditions','attributes':['id',_0x1343('0x6'),_0x1343('0x7'),_0x1343('0x8')]},{'model':'Condition','as':_0x1343('0x9'),'attributes':['id',_0x1343('0x6'),'operator','value']},{'model':_0x1343('0xa'),'as':'Actions','attributes':['id',_0x1343('0xb'),_0x1343('0xc'),_0x1343('0xd'),_0x1343('0xe'),_0x1343('0xf'),_0x1343('0x10'),'data6','data7']}]},'log':_0x1343('0x1')});};}; \ No newline at end of file diff --git a/server/services/ami/rpc/trunk.js b/server/services/ami/rpc/trunk.js index fc431b0..72e8030 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 _0x3773=['Request','GetTrunk','name','registry','defaultuser','getTrunks'];(function(_0x1aa2d1,_0x346f58){var _0x447dc3=function(_0x47d082){while(--_0x47d082){_0x1aa2d1['push'](_0x1aa2d1['shift']());}};_0x447dc3(++_0x346f58);}(_0x3773,0x1a9));var _0x3377=function(_0x50a0c2,_0x4befab){_0x50a0c2=_0x50a0c2-0x0;var _0x5ebadd=_0x3773[_0x50a0c2];return _0x5ebadd;};'use strict';var client=require('../client');exports[_0x3377('0x0')]=function(_0xd5c921){return function(_0x4a0655){return client[_0x3377('0x1')](_0x3377('0x2'),{'options':{'raw':!![],'where':{'active':0x1},'attributes':['id',_0x3377('0x3'),_0x3377('0x4'),_0x3377('0x5')]},'log':_0x3377('0x2')});};}; \ No newline at end of file +var _0xc7b4=['../client','GetTrunk','name','registry','defaultuser'];(function(_0x185ecb,_0x53381e){var _0x2547a1=function(_0x53e6ad){while(--_0x53e6ad){_0x185ecb['push'](_0x185ecb['shift']());}};_0x2547a1(++_0x53381e);}(_0xc7b4,0x15e));var _0x4c7b=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0xc7b4[_0x321bb2];return _0x9c12ed;};'use strict';var client=require(_0x4c7b('0x0'));exports['getTrunks']=function(_0x6edfa6){return function(_0x14a4c3){return client['Request'](_0x4c7b('0x1'),{'options':{'raw':!![],'where':{'active':0x1},'attributes':['id',_0x4c7b('0x2'),_0x4c7b('0x3'),_0x4c7b('0x4')]},'log':_0x4c7b('0x1')});};}; \ No newline at end of file diff --git a/server/services/ami/rpc/user.js b/server/services/ami/rpc/user.js index 7013dcb..c7cdbf3 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 _0x70e0=['getAgents','Request','name','email','accountcode','fullname','lastLoginAt','lastPauseAt','interface','getTelephones','GetUser','telephone','savePause','PauseUser','saveUnpause','getAgent','agent','online','pauseType','../client'];(function(_0x17e95b,_0x1815ff){var _0x4b7398=function(_0x3205f6){while(--_0x3205f6){_0x17e95b['push'](_0x17e95b['shift']());}};_0x4b7398(++_0x1815ff);}(_0x70e0,0x17b));var _0x070e=function(_0x17db82,_0x5d2b34){_0x17db82=_0x17db82-0x0;var _0x1b1abc=_0x70e0[_0x17db82];return _0x1b1abc;};'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 +var _0xedd9=['mobile','getTelephones','internal','PauseUser','savePause','saveUnpause','UnpauseUser','ShowUser','interface','getAgent','getAgents','Request','GetUser','agent','name','email','accountcode','fullname','lastLoginAt','pauseType','lastPauseAt','voicePause'];(function(_0x483ce4,_0x41af3e){var _0x473c15=function(_0x48365c){while(--_0x48365c){_0x483ce4['push'](_0x483ce4['shift']());}};_0x473c15(++_0x41af3e);}(_0xedd9,0xfc));var _0x9edd=function(_0x2138a1,_0x24225e){_0x2138a1=_0x2138a1-0x0;var _0x34fe97=_0xedd9[_0x2138a1];return _0x34fe97;};'use strict';var client=require('../client');exports[_0x9edd('0x0')]=function(){return function(){return client[_0x9edd('0x1')](_0x9edd('0x2'),{'options':{'raw':![],'where':{'role':_0x9edd('0x3')},'attributes':['id',_0x9edd('0x4'),_0x9edd('0x5'),_0x9edd('0x6'),_0x9edd('0x7'),'online',_0x9edd('0x8'),_0x9edd('0x9'),_0x9edd('0xa'),_0x9edd('0xb'),'phone',_0x9edd('0xc'),'interface']},'log':_0x9edd('0x0')});};};exports[_0x9edd('0xd')]=function(){return function(){return client[_0x9edd('0x1')](_0x9edd('0x2'),{'options':{'raw':!![],'where':{'role':'telephone'},'attributes':['id',_0x9edd('0x4'),'accountcode',_0x9edd('0xe')]},'log':_0x9edd('0xd')});};};exports['savePause']=function(_0xbf9da6,_0x13dc4f,_0x5b6c00){return client[_0x9edd('0x1')](_0x9edd('0xf'),{'body':{'type':_0x13dc4f,'uniqueid':_0x5b6c00},'options':{'where':{'id':_0xbf9da6['id']}},'log':_0x9edd('0x10')});};exports[_0x9edd('0x11')]=function(_0x287ddd){return client[_0x9edd('0x1')](_0x9edd('0x12'),{'body':{},'options':{'where':{'id':_0x287ddd['id']}},'log':_0x9edd('0x10')});};exports['getAgent']=function(_0x176bfa){return client[_0x9edd('0x1')](_0x9edd('0x13'),{'options':{'raw':![],'where':{'role':_0x9edd('0x3'),'id':_0x176bfa},'attributes':['id',_0x9edd('0x4'),_0x9edd('0x5'),_0x9edd('0x6'),_0x9edd('0x7'),'online',_0x9edd('0x8'),_0x9edd('0x9'),_0x9edd('0xa'),'voicePause',_0x9edd('0x14')]},'log':_0x9edd('0x15')});}; \ No newline at end of file diff --git a/server/services/ami/rpc/voiceAgentReport.js b/server/services/ami/rpc/voiceAgentReport.js index 3ddba98..75d6f11 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 _0x2de7=['Request','UpdateVoiceAgentReport','../client','create'];(function(_0x1702d5,_0x99a8ca){var _0x2639f1=function(_0x133300){while(--_0x133300){_0x1702d5['push'](_0x1702d5['shift']());}};_0x2639f1(++_0x99a8ca);}(_0x2de7,0xda));var _0x72de=function(_0x51bb92,_0x4eaf84){_0x51bb92=_0x51bb92-0x0;var _0x3b1232=_0x2de7[_0x51bb92];return _0x3b1232;};'use strict';var client=require(_0x72de('0x0'));exports[_0x72de('0x1')]=function(_0x3e19fd){return client[_0x72de('0x2')]('CreateVoiceAgentReport',{'body':_0x3e19fd,'log':'CreateVoiceAgentReport'});};exports['update']=function(_0x106218,_0x2847f4,_0x57d166){return client['Request'](_0x72de('0x3'),{'body':_0x106218,'options':{'where':{'uniqueid':_0x2847f4,'interface':_0x57d166,'agentcomplete':!![]}},'log':_0x72de('0x3')});}; \ No newline at end of file +var _0x7926=['CreateVoiceAgentReport','update','Request','UpdateVoiceAgentReport'];(function(_0x2bda14,_0x4fab1b){var _0xb5dd49=function(_0x1da71e){while(--_0x1da71e){_0x2bda14['push'](_0x2bda14['shift']());}};_0xb5dd49(++_0x4fab1b);}(_0x7926,0x1b8));var _0x6792=function(_0x401484,_0x36b812){_0x401484=_0x401484-0x0;var _0x56ae16=_0x7926[_0x401484];return _0x56ae16;};'use strict';var client=require('../client');exports['create']=function(_0x2577ba){return client['Request'](_0x6792('0x0'),{'body':_0x2577ba,'log':'CreateVoiceAgentReport'});};exports[_0x6792('0x1')]=function(_0x5e836e,_0x13d5fd,_0x260420){return client[_0x6792('0x2')](_0x6792('0x3'),{'body':_0x5e836e,'options':{'where':{'uniqueid':_0x13d5fd,'interface':_0x260420,'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 47ce183..c870bd1 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 _0x5d75=['GetVoiceCallReport','startOf','day','YYYY-MM-DD\x20HH:mm:ss','endOf','format','type','disposition','duration','billableseconds','GetVoiceCallReports','moment','util','lodash','Request','CreateVoiceCallReport','merge','calleridnum','context','DOCUMENTATION','getVoiceCallReports'];(function(_0x20e135,_0x2e46e1){var _0x3ab6cb=function(_0x349463){while(--_0x349463){_0x20e135['push'](_0x20e135['shift']());}};_0x3ab6cb(++_0x2e46e1);}(_0x5d75,0x15b));var _0x55d7=function(_0x3c6d0c,_0x33b1f5){_0x3c6d0c=_0x3c6d0c-0x0;var _0x2c3e2e=_0x5d75[_0x3c6d0c];return _0x2c3e2e;};'use strict';var moment=require(_0x55d7('0x0'));var util=require(_0x55d7('0x1'));var _=require(_0x55d7('0x2'));var client=require('../client');exports['create']=function(_0x43b8a5){return client[_0x55d7('0x3')](_0x55d7('0x4'),{'body':_[_0x55d7('0x5')](_0x43b8a5,{'source':_0x43b8a5[_0x55d7('0x6')],'destinationcontext':_0x43b8a5[_0x55d7('0x7')],'callerid':_0x43b8a5['callerid'],'amaflags':_0x55d7('0x8')}),'log':_0x55d7('0x4')});};exports[_0x55d7('0x9')]=function(){return function(){return client['Request'](_0x55d7('0xa'),{'options':{'where':{'type':['outbound'],'createdAt':{'$between':[moment()[_0x55d7('0xb')](_0x55d7('0xc'))['format'](_0x55d7('0xd')),moment()[_0x55d7('0xe')](_0x55d7('0xc'))[_0x55d7('0xf')](_0x55d7('0xd'))]}},'attributes':[_0x55d7('0x10'),_0x55d7('0x11'),_0x55d7('0x12'),_0x55d7('0x13')]},'log':_0x55d7('0x14')});};}; \ No newline at end of file +var _0xafb0=['startOf','YYYY-MM-DD\x20HH:mm:ss','endOf','type','duration','GetVoiceCallReports','moment','util','lodash','../client','create','Request','CreateVoiceCallReport','merge','calleridnum','callerid','DOCUMENTATION','getVoiceCallReports','GetVoiceCallReport'];(function(_0x49272b,_0x4f7ee6){var _0x4bfdbc=function(_0x78496b){while(--_0x78496b){_0x49272b['push'](_0x49272b['shift']());}};_0x4bfdbc(++_0x4f7ee6);}(_0xafb0,0x1e1));var _0x0afb=function(_0x403c20,_0x4a7b99){_0x403c20=_0x403c20-0x0;var _0x2b271a=_0xafb0[_0x403c20];return _0x2b271a;};'use strict';var moment=require(_0x0afb('0x0'));var util=require(_0x0afb('0x1'));var _=require(_0x0afb('0x2'));var client=require(_0x0afb('0x3'));exports[_0x0afb('0x4')]=function(_0x12d320){return client[_0x0afb('0x5')](_0x0afb('0x6'),{'body':_[_0x0afb('0x7')](_0x12d320,{'source':_0x12d320[_0x0afb('0x8')],'destinationcontext':_0x12d320['context'],'callerid':_0x12d320[_0x0afb('0x9')],'amaflags':_0x0afb('0xa')}),'log':_0x0afb('0x6')});};exports[_0x0afb('0xb')]=function(){return function(){return client['Request'](_0x0afb('0xc'),{'options':{'where':{'type':['outbound'],'createdAt':{'$between':[moment()[_0x0afb('0xd')]('day')['format'](_0x0afb('0xe')),moment()[_0x0afb('0xf')]('day')['format']('YYYY-MM-DD\x20HH:mm:ss')]}},'attributes':[_0x0afb('0x10'),'disposition',_0x0afb('0x11'),'billableseconds']},'log':_0x0afb('0x12')});};}; \ No newline at end of file diff --git a/server/services/ami/rpc/voiceDialReport.js b/server/services/ami/rpc/voiceDialReport.js index f66cdb0..ccaf07d 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 _0x72f4=['CreateVoiceDialReport','Request'];(function(_0x14f456,_0x3b6bb7){var _0x444e80=function(_0x76c6f3){while(--_0x76c6f3){_0x14f456['push'](_0x14f456['shift']());}};_0x444e80(++_0x3b6bb7);}(_0x72f4,0xd9));var _0x472f=function(_0x355494,_0x5a2f21){_0x355494=_0x355494-0x0;var _0x18b7e0=_0x72f4[_0x355494];return _0x18b7e0;};'use strict';var client=require('../client');exports['create']=function(_0x2e2893){return client[_0x472f('0x0')](_0x472f('0x1'),{'body':_0x2e2893,'log':'CreateVoiceDialReport'});}; \ No newline at end of file +var _0x9e17=['create','Request','CreateVoiceDialReport','../client'];(function(_0xb2d84c,_0x33c739){var _0x291779=function(_0x4b6d58){while(--_0x4b6d58){_0xb2d84c['push'](_0xb2d84c['shift']());}};_0x291779(++_0x33c739);}(_0x9e17,0x1c7));var _0x79e1=function(_0x39fd11,_0x5d7883){_0x39fd11=_0x39fd11-0x0;var _0x302799=_0x9e17[_0x39fd11];return _0x302799;};'use strict';var client=require(_0x79e1('0x0'));exports[_0x79e1('0x1')]=function(_0x3c2abb){return client[_0x79e1('0x2')](_0x79e1('0x3'),{'body':_0x3c2abb,'log':_0x79e1('0x3')});}; \ No newline at end of file diff --git a/server/services/ami/rpc/voiceExtension.js b/server/services/ami/rpc/voiceExtension.js index e335b66..346cc27 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 _0xb332=['recordingFormat','../client','Request','GetVoiceExtension'];(function(_0x3c52a2,_0x381c78){var _0x5860e8=function(_0x5a9bbd){while(--_0x5a9bbd){_0x3c52a2['push'](_0x3c52a2['shift']());}};_0x5860e8(++_0x381c78);}(_0xb332,0xd9));var _0x2b33=function(_0x2cfb58,_0x3d9412){_0x2cfb58=_0x2cfb58-0x0;var _0xd99951=_0xb332[_0x2cfb58];return _0xd99951;};'use strict';var client=require(_0x2b33('0x0'));exports['getVoiceExtensions']=function(){return function(){return client[_0x2b33('0x1')](_0x2b33('0x2'),{'options':{'raw':!![],'attributes':['id','exten',_0x2b33('0x3')],'where':{'VoiceExtensionId':null}},'log':'getVoiceExtensions'});};}; \ No newline at end of file +var _0x8b29=['GetVoiceExtension','getVoiceExtensions','../client','Request'];(function(_0xd639fb,_0x5b2085){var _0xe39b60=function(_0x187c00){while(--_0x187c00){_0xd639fb['push'](_0xd639fb['shift']());}};_0xe39b60(++_0x5b2085);}(_0x8b29,0xbe));var _0x98b2=function(_0x475eaa,_0x3df6a7){_0x475eaa=_0x475eaa-0x0;var _0x214e04=_0x8b29[_0x475eaa];return _0x214e04;};'use strict';var client=require(_0x98b2('0x0'));exports['getVoiceExtensions']=function(){return function(){return client[_0x98b2('0x1')](_0x98b2('0x2'),{'options':{'raw':!![],'attributes':['id','exten','recordingFormat'],'where':{'VoiceExtensionId':null}},'log':_0x98b2('0x3')});};}; \ No newline at end of file diff --git a/server/services/ami/rpc/voiceQueue.js b/server/services/ami/rpc/voiceQueue.js index 455e5e4..39f1b8d 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 _0x4560=['dialQueueProject','dialCongestionMaxRetry','dialCongestionRetryFrequency','dialBusyRetryFrequency','dialNoAnswerRetryFrequency','dialGlobalMaxRetry','dialTimezone','dialGlobalInterval','dialCheckDuplicateType','dialAMDActive','dialAMDInitialSilence','dialAMDAfterGreetingSilence','dialAMDTotalAnalysisTime','dialAMDMinWordLength','dialAMDBetweenWordsSilence','dialAMDMaximumNumberOfWords','dialAMDSilenceThreshold','dialAMDMaximumWordLength','timeout','dialRecallMeTimeout','dialRecallInQueue','dialOrderByScheduledAt','dialAgiAfterHangupClient','dialQueueProject2','dialNoSuchNumberMaxRetry','dialNoSuchNumberRetryFrequency','dialDropMaxRetry','dialDropRetryFrequency','dialAbandonedMaxRetry','dialAbandonedRetryFrequency','dialMachineMaxRetry','dialAgentRejectMaxRetry','dialAgentRejectRetryFrequency','mandatoryDisposition','dialPredictiveIntervalMaxThreshold','dialPreviewAutoRecallMe','Trunk','Pause','mandatoryDispositionPause','TrunkBackup','callerid','active','Interval','Intervals','interval','../client','getVoiceQueues','Request','name','acw','acwTimeout','autopause','monitor_format','type','dialLimitChannel','dialPredictiveOptimization','dialPredictiveOptimizationPercentage','dialPredictiveInterval','dialOriginateTimeout','dialQueueOptions'];(function(_0x5d2b4d,_0x814f08){var _0xa7cef5=function(_0x4dfcbf){while(--_0x4dfcbf){_0x5d2b4d['push'](_0x5d2b4d['shift']());}};_0xa7cef5(++_0x814f08);}(_0x4560,0x195));var _0x0456=function(_0x1b75f3,_0x522344){_0x1b75f3=_0x1b75f3-0x0;var _0x520c35=_0x4560[_0x1b75f3];return _0x520c35;};'use strict';var client=require(_0x0456('0x0'));exports[_0x0456('0x1')]=function(){return function(){return client[_0x0456('0x2')]('GetVoiceQueue',{'options':{'raw':![],'attributes':['id',_0x0456('0x3'),_0x0456('0x4'),_0x0456('0x5'),_0x0456('0x6'),_0x0456('0x7'),_0x0456('0x8'),'dialActive','dialMethod',_0x0456('0x9'),'dialLimitQueue','dialPowerLevel',_0x0456('0xa'),_0x0456('0xb'),_0x0456('0xc'),'dialOriginateCallerIdName','dialOriginateCallerIdNumber',_0x0456('0xd'),_0x0456('0xe'),'dialQueueTimeout',_0x0456('0xf'),_0x0456('0x10'),_0x0456('0x11'),'dialBusyMaxRetry',_0x0456('0x12'),'dialNoAnswerMaxRetry',_0x0456('0x13'),_0x0456('0x14'),_0x0456('0x15'),_0x0456('0x16'),'dialPrefix',_0x0456('0x17'),_0x0456('0x18'),_0x0456('0x19'),'dialAMDGreeting',_0x0456('0x1a'),_0x0456('0x1b'),_0x0456('0x1c'),_0x0456('0x1d'),_0x0456('0x1e'),_0x0456('0x1f'),_0x0456('0x20'),_0x0456('0x21'),_0x0456('0x22'),_0x0456('0x23'),_0x0456('0x24'),'dialAgiAfterHangupAgent',_0x0456('0x25'),_0x0456('0x26'),'monitor_format','strategy','dialRandomLastDigitCallerIdNumber','dialCutDigit',_0x0456('0x27'),_0x0456('0x28'),_0x0456('0x29'),_0x0456('0x2a'),_0x0456('0x2b'),_0x0456('0x2c'),_0x0456('0x2d'),'dialMachineRetryFrequency',_0x0456('0x2e'),_0x0456('0x2f'),_0x0456('0x30'),_0x0456('0x31'),'dialPredictiveIntervalMinThreshold',_0x0456('0x32'),'dialPreviewRecallmeReminder'],'include':[{'model':'Trunk','as':_0x0456('0x33'),'attributes':['id',_0x0456('0x3'),'callerid','active']},{'model':_0x0456('0x34'),'as':_0x0456('0x35'),'attributes':['id',_0x0456('0x3')]},{'model':_0x0456('0x33'),'as':_0x0456('0x36'),'attributes':['id',_0x0456('0x3'),_0x0456('0x37'),_0x0456('0x38')]},{'model':_0x0456('0x39'),'as':'Interval','attributes':['id',_0x0456('0x3')],'include':[{'model':_0x0456('0x39'),'as':_0x0456('0x3a'),'attributes':['id',_0x0456('0x3'),_0x0456('0x3b')]}]}]},'log':_0x0456('0x1')});};}; \ No newline at end of file +var _0xcebd=['dialCongestionRetryFrequency','dialBusyRetryFrequency','dialNoAnswerRetryFrequency','dialTimezone','dialGlobalInterval','dialPrefix','dialCheckDuplicateType','dialAMDInitialSilence','dialAMDGreeting','dialAMDAfterGreetingSilence','dialAMDTotalAnalysisTime','dialAMDMinWordLength','dialAMDMaximumNumberOfWords','dialAMDSilenceThreshold','timeout','dialRecallMeTimeout','dialRecallInQueue','dialAgiAfterHangupAgent','dialAgiAfterHangupClient','dialQueueProject2','strategy','dialRandomLastDigitCallerIdNumber','dialNoSuchNumberRetryFrequency','dialDropMaxRetry','dialAbandonedMaxRetry','dialAbandonedRetryFrequency','dialMachineMaxRetry','dialMachineRetryFrequency','mandatoryDisposition','dialPredictiveIntervalMaxThreshold','dialPredictiveIntervalMinThreshold','dialPreviewAutoRecallMe','dialPreviewRecallmeReminder','Trunk','callerid','active','Pause','mandatoryDispositionPause','TrunkBackup','Interval','Intervals','interval','getVoiceQueues','../client','Request','GetVoiceQueue','name','acwTimeout','autopause','monitor_format','type','dialActive','dialLimitQueue','dialPowerLevel','dialPredictiveOptimization','dialPredictiveInterval','dialOriginateCallerIdName','dialOriginateCallerIdNumber','dialOriginateTimeout','dialQueueTimeout','dialCongestionMaxRetry'];(function(_0x208d75,_0x92d742){var _0x382d27=function(_0x3aaba3){while(--_0x3aaba3){_0x208d75['push'](_0x208d75['shift']());}};_0x382d27(++_0x92d742);}(_0xcebd,0x15c));var _0xdceb=function(_0x236c9f,_0x16f456){_0x236c9f=_0x236c9f-0x0;var _0x206ebb=_0xcebd[_0x236c9f];return _0x206ebb;};'use strict';var client=require(_0xdceb('0x0'));exports['getVoiceQueues']=function(){return function(){return client[_0xdceb('0x1')](_0xdceb('0x2'),{'options':{'raw':![],'attributes':['id',_0xdceb('0x3'),'acw',_0xdceb('0x4'),_0xdceb('0x5'),_0xdceb('0x6'),_0xdceb('0x7'),_0xdceb('0x8'),'dialMethod','dialLimitChannel',_0xdceb('0x9'),_0xdceb('0xa'),_0xdceb('0xb'),'dialPredictiveOptimizationPercentage',_0xdceb('0xc'),_0xdceb('0xd'),_0xdceb('0xe'),_0xdceb('0xf'),'dialQueueOptions',_0xdceb('0x10'),'dialQueueProject',_0xdceb('0x11'),_0xdceb('0x12'),'dialBusyMaxRetry',_0xdceb('0x13'),'dialNoAnswerMaxRetry',_0xdceb('0x14'),'dialGlobalMaxRetry',_0xdceb('0x15'),_0xdceb('0x16'),_0xdceb('0x17'),_0xdceb('0x18'),'dialAMDActive',_0xdceb('0x19'),_0xdceb('0x1a'),_0xdceb('0x1b'),_0xdceb('0x1c'),_0xdceb('0x1d'),'dialAMDBetweenWordsSilence',_0xdceb('0x1e'),_0xdceb('0x1f'),'dialAMDMaximumWordLength',_0xdceb('0x20'),_0xdceb('0x21'),_0xdceb('0x22'),'dialOrderByScheduledAt',_0xdceb('0x23'),_0xdceb('0x24'),_0xdceb('0x25'),_0xdceb('0x6'),_0xdceb('0x26'),_0xdceb('0x27'),'dialCutDigit','dialNoSuchNumberMaxRetry',_0xdceb('0x28'),_0xdceb('0x29'),'dialDropRetryFrequency',_0xdceb('0x2a'),_0xdceb('0x2b'),_0xdceb('0x2c'),_0xdceb('0x2d'),'dialAgentRejectMaxRetry','dialAgentRejectRetryFrequency',_0xdceb('0x2e'),_0xdceb('0x2f'),_0xdceb('0x30'),_0xdceb('0x31'),_0xdceb('0x32')],'include':[{'model':_0xdceb('0x33'),'as':'Trunk','attributes':['id',_0xdceb('0x3'),_0xdceb('0x34'),_0xdceb('0x35')]},{'model':_0xdceb('0x36'),'as':_0xdceb('0x37'),'attributes':['id',_0xdceb('0x3')]},{'model':_0xdceb('0x33'),'as':_0xdceb('0x38'),'attributes':['id',_0xdceb('0x3'),_0xdceb('0x34'),_0xdceb('0x35')]},{'model':_0xdceb('0x39'),'as':_0xdceb('0x39'),'attributes':['id',_0xdceb('0x3')],'include':[{'model':_0xdceb('0x39'),'as':_0xdceb('0x3a'),'attributes':['id','name',_0xdceb('0x3b')]}]}]},'log':_0xdceb('0x3c')});};}; \ No newline at end of file diff --git a/server/services/ami/rpc/voiceQueueReport.js b/server/services/ami/rpc/voiceQueueReport.js index dc6f1db..5ae7477 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(_0x38c639,_0x35b5bd){var _0x1fcfa8=function(_0x134dc5){while(--_0x134dc5){_0x38c639['push'](_0x38c639['shift']());}};_0x1fcfa8(++_0x35b5bd);}(_0xa9e0,0x123));var _0x0a9e=function(_0x34bc30,_0x177cb0){_0x34bc30=_0x34bc30-0x0;var _0x5706de=_0xa9e0[_0x34bc30];return _0x5706de;};'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(_0x4fc879,_0xfa7900){var _0x2946b7=function(_0xbb9a3f){while(--_0xbb9a3f){_0x4fc879['push'](_0x4fc879['shift']());}};_0x2946b7(++_0xfa7900);}(_0xa9e0,0x123));var _0x0a9e=function(_0x40ac5e,_0x2de228){_0x40ac5e=_0x40ac5e-0x0;var _0x2839d6=_0xa9e0[_0x40ac5e];return _0x2839d6;};'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 6b5b408..5030b3f 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 _0xd760=['../client','getVoiceQueueRtPauses','GetVoiceQueueRtPauses'];(function(_0x411017,_0x4a8117){var _0x2adeea=function(_0x545222){while(--_0x545222){_0x411017['push'](_0x411017['shift']());}};_0x2adeea(++_0x4a8117);}(_0xd760,0x1b3));var _0x0d76=function(_0x3a5153,_0x521a9f){_0x3a5153=_0x3a5153-0x0;var _0x3df18e=_0xd760[_0x3a5153];return _0x3df18e;};'use strict';var client=require(_0x0d76('0x0'));exports[_0x0d76('0x1')]=function(_0x2ce5e7){return function(){return client['Request'](_0x0d76('0x2'),{'options':{'where':{'VoiceQueueId':_0x2ce5e7,'paused':!![]},'raw':!![]},'log':'getVoiceQueueRtPauses'});};}; \ No newline at end of file +var _0xfdb1=['../client','getVoiceQueueRtPauses','Request','GetVoiceQueueRtPauses'];(function(_0x2db667,_0x193cf5){var _0x83ff9=function(_0x5da022){while(--_0x5da022){_0x2db667['push'](_0x2db667['shift']());}};_0x83ff9(++_0x193cf5);}(_0xfdb1,0x94));var _0x1fdb=function(_0x95235d,_0x573339){_0x95235d=_0x95235d-0x0;var _0x37dade=_0xfdb1[_0x95235d];return _0x37dade;};'use strict';var client=require(_0x1fdb('0x0'));exports[_0x1fdb('0x1')]=function(_0x4e082a){return function(){return client[_0x1fdb('0x2')](_0x1fdb('0x3'),{'options':{'where':{'VoiceQueueId':_0x4e082a,'paused':!![]},'raw':!![]},'log':_0x1fdb('0x1')});};}; \ No newline at end of file diff --git a/server/services/ami/rpc/voiceRecording.js b/server/services/ami/rpc/voiceRecording.js index d24dec5..35c308d 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(_0x5a972e,_0x109a57){var _0x1e44d6=function(_0x463dfa){while(--_0x463dfa){_0x5a972e['push'](_0x5a972e['shift']());}};_0x1e44d6(++_0x109a57);}(_0x9957,0x93));var _0x7995=function(_0x501510,_0x61caa9){_0x501510=_0x501510-0x0;var _0x1e6ee5=_0x9957[_0x501510];return _0x1e6ee5;};'use strict';var _=require(_0x7995('0x0'));var client=require(_0x7995('0x1'));exports[_0x7995('0x2')]=function(_0x10a05d){return client['Request'](_0x7995('0x3'),{'body':_[_0x7995('0x4')](_0x10a05d,{'value':_0x10a05d[_0x7995('0x5')]}),'log':_0x7995('0x3')});}; \ No newline at end of file +var _0x9957=['CreateVoiceRecording','merge','monitorFilename','lodash','../client','create'];(function(_0x4c4104,_0x5328b8){var _0x2d3071=function(_0x45f167){while(--_0x45f167){_0x4c4104['push'](_0x4c4104['shift']());}};_0x2d3071(++_0x5328b8);}(_0x9957,0x93));var _0x7995=function(_0x2f5ac5,_0x1ee939){_0x2f5ac5=_0x2f5ac5-0x0;var _0x37c9a8=_0x9957[_0x2f5ac5];return _0x37c9a8;};'use strict';var _=require(_0x7995('0x0'));var client=require(_0x7995('0x1'));exports[_0x7995('0x2')]=function(_0x10a05d){return client['Request'](_0x7995('0x3'),{'body':_[_0x7995('0x4')](_0x10a05d,{'value':_0x10a05d[_0x7995('0x5')]}),'log':_0x7995('0x3')});}; \ No newline at end of file diff --git a/server/services/ami/rpc/voiceTransferReport.js b/server/services/ami/rpc/voiceTransferReport.js index 1a1174f..17d4ab0 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 _0x3865=['transfererchannel','transferercalleridname','transfererconnectedlinenum','transfererconnectedlinename','transfereraccountcode','transferercontext','transfererexten','transfereecalleridnum','transfereecalleridname','transfereeconnectedlinenum','transfereeaccountcode','transfereeexten','transfereelinkedid','isexternal','context','extension','blind','attendedTransfer','origtransfererchannel','origtransferercalleridnum','origtransferercalleridname','secondtransfererexten','origtransfererlinkedid','transfertargetchannel','transfertargetcalleridnum','transfertargetconnectedlinenum','transfertargetconnectedlinename','transfertargetaccountcode','transfertargetcontext','transfertargetlinkedid','origtransferercontext','origtransfererexten','attended','transfers','blindTransfer','Request','CreateVoiceTransferReport','result'];(function(_0x180391,_0x55d9ff){var _0x4ded40=function(_0x395160){while(--_0x395160){_0x180391['push'](_0x180391['shift']());}};_0x4ded40(++_0x55d9ff);}(_0x3865,0x1c3));var _0x5386=function(_0x221226,_0x17a0d3){_0x221226=_0x221226-0x0;var _0x438159=_0x3865[_0x221226];return _0x438159;};'use strict';var client=require('../client');exports[_0x5386('0x0')]={};exports[_0x5386('0x1')]=function(_0x286df2){return client[_0x5386('0x2')](_0x5386('0x3'),{'body':{'result':_0x286df2[_0x5386('0x4')],'transfererchannel':_0x286df2[_0x5386('0x5')],'transferercalleridnum':_0x286df2['transferercalleridnum'],'transferercalleridname':_0x286df2[_0x5386('0x6')],'transfererconnectedlinenum':_0x286df2[_0x5386('0x7')],'transfererconnectedlinename':_0x286df2[_0x5386('0x8')],'transfereraccountcode':_0x286df2[_0x5386('0x9')],'transferercontext':_0x286df2[_0x5386('0xa')],'transfererexten':_0x286df2[_0x5386('0xb')],'transfererlinkedid':_0x286df2['transfererlinkedid'],'transfereechannel':_0x286df2['transfereechannel'],'transfereecalleridnum':_0x286df2[_0x5386('0xc')],'transfereecalleridname':_0x286df2[_0x5386('0xd')],'transfereeconnectedlinenum':_0x286df2[_0x5386('0xe')],'transfereeconnectedlinename':_0x286df2['transfereeconnectedlinename'],'transfereeaccountcode':_0x286df2[_0x5386('0xf')],'transfereecontext':_0x286df2['transfereecontext'],'transfereeexten':_0x286df2[_0x5386('0x10')],'transfereelinkedid':_0x286df2[_0x5386('0x11')],'isexternal':_0x286df2[_0x5386('0x12')],'context':_0x286df2[_0x5386('0x13')],'extension':_0x286df2[_0x5386('0x14')],'type':_0x5386('0x15')},'log':'CreateVoiceTransferReport'});};exports[_0x5386('0x16')]=function(_0x233353){return client[_0x5386('0x2')](_0x5386('0x3'),{'body':{'result':_0x233353[_0x5386('0x4')],'transfererchannel':_0x233353[_0x5386('0x17')],'transferercalleridnum':_0x233353[_0x5386('0x18')],'transferercalleridname':_0x233353[_0x5386('0x19')],'transfererconnectedlinenum':_0x233353['secondtransfererconnectedlinenum'],'transfererconnectedlinename':_0x233353['secondtransfererconnectedlinename'],'transfereraccountcode':_0x233353['origtransfereraccountcode'],'transferercontext':_0x233353['secondtransferercontext'],'transfererexten':_0x233353[_0x5386('0x1a')],'transfererlinkedid':_0x233353[_0x5386('0x1b')],'transfereechannel':_0x233353[_0x5386('0x1c')],'transfereecalleridnum':_0x233353[_0x5386('0x1d')],'transfereecalleridname':_0x233353['transfertargetcalleridname'],'transfereeconnectedlinenum':_0x233353[_0x5386('0x1e')],'transfereeconnectedlinename':_0x233353[_0x5386('0x1f')],'transfereeaccountcode':_0x233353[_0x5386('0x20')],'transfereecontext':_0x233353[_0x5386('0x21')],'transfereeexten':_0x233353['transfertargetexten'],'transfereelinkedid':_0x233353[_0x5386('0x22')],'isexternal':_0x233353[_0x5386('0x12')],'context':_0x233353[_0x5386('0x23')],'extension':_0x233353[_0x5386('0x24')],'type':_0x5386('0x25')},'log':'CreateVoiceTransferReport'});}; \ No newline at end of file +var _0xb9dc=['transfertargetcalleridname','transfertargetconnectedlinenum','transfertargetconnectedlinename','transfertargetcontext','transfertargetlinkedid','origtransferercontext','origtransfererexten','attended','../client','transfers','blindTransfer','Request','CreateVoiceTransferReport','result','transfererchannel','transferercalleridnum','transfererconnectedlinename','transfereraccountcode','transferercontext','transfererexten','transfererlinkedid','transfereechannel','transfereecalleridnum','transfereecalleridname','transfereeaccountcode','transfereecontext','transfereeexten','isexternal','blind','attendedTransfer','origtransfererchannel','origtransferercalleridnum','origtransferercalleridname','origtransfereraccountcode','secondtransferercontext','secondtransfererexten','transfertargetchannel','transfertargetcalleridnum'];(function(_0x4c6dac,_0x49b005){var _0x1a2305=function(_0x440741){while(--_0x440741){_0x4c6dac['push'](_0x4c6dac['shift']());}};_0x1a2305(++_0x49b005);}(_0xb9dc,0xec));var _0xcb9d=function(_0x253af5,_0xcc364b){_0x253af5=_0x253af5-0x0;var _0x17d5b0=_0xb9dc[_0x253af5];return _0x17d5b0;};'use strict';var client=require(_0xcb9d('0x0'));exports[_0xcb9d('0x1')]={};exports[_0xcb9d('0x2')]=function(_0x3b0cb6){return client[_0xcb9d('0x3')](_0xcb9d('0x4'),{'body':{'result':_0x3b0cb6[_0xcb9d('0x5')],'transfererchannel':_0x3b0cb6[_0xcb9d('0x6')],'transferercalleridnum':_0x3b0cb6[_0xcb9d('0x7')],'transferercalleridname':_0x3b0cb6['transferercalleridname'],'transfererconnectedlinenum':_0x3b0cb6['transfererconnectedlinenum'],'transfererconnectedlinename':_0x3b0cb6[_0xcb9d('0x8')],'transfereraccountcode':_0x3b0cb6[_0xcb9d('0x9')],'transferercontext':_0x3b0cb6[_0xcb9d('0xa')],'transfererexten':_0x3b0cb6[_0xcb9d('0xb')],'transfererlinkedid':_0x3b0cb6[_0xcb9d('0xc')],'transfereechannel':_0x3b0cb6[_0xcb9d('0xd')],'transfereecalleridnum':_0x3b0cb6[_0xcb9d('0xe')],'transfereecalleridname':_0x3b0cb6[_0xcb9d('0xf')],'transfereeconnectedlinenum':_0x3b0cb6['transfereeconnectedlinenum'],'transfereeconnectedlinename':_0x3b0cb6['transfereeconnectedlinename'],'transfereeaccountcode':_0x3b0cb6[_0xcb9d('0x10')],'transfereecontext':_0x3b0cb6[_0xcb9d('0x11')],'transfereeexten':_0x3b0cb6[_0xcb9d('0x12')],'transfereelinkedid':_0x3b0cb6['transfereelinkedid'],'isexternal':_0x3b0cb6[_0xcb9d('0x13')],'context':_0x3b0cb6['context'],'extension':_0x3b0cb6['extension'],'type':_0xcb9d('0x14')},'log':_0xcb9d('0x4')});};exports[_0xcb9d('0x15')]=function(_0x3899a9){return client['Request']('CreateVoiceTransferReport',{'body':{'result':_0x3899a9[_0xcb9d('0x5')],'transfererchannel':_0x3899a9[_0xcb9d('0x16')],'transferercalleridnum':_0x3899a9[_0xcb9d('0x17')],'transferercalleridname':_0x3899a9[_0xcb9d('0x18')],'transfererconnectedlinenum':_0x3899a9['secondtransfererconnectedlinenum'],'transfererconnectedlinename':_0x3899a9['secondtransfererconnectedlinename'],'transfereraccountcode':_0x3899a9[_0xcb9d('0x19')],'transferercontext':_0x3899a9[_0xcb9d('0x1a')],'transfererexten':_0x3899a9[_0xcb9d('0x1b')],'transfererlinkedid':_0x3899a9['origtransfererlinkedid'],'transfereechannel':_0x3899a9[_0xcb9d('0x1c')],'transfereecalleridnum':_0x3899a9[_0xcb9d('0x1d')],'transfereecalleridname':_0x3899a9[_0xcb9d('0x1e')],'transfereeconnectedlinenum':_0x3899a9[_0xcb9d('0x1f')],'transfereeconnectedlinename':_0x3899a9[_0xcb9d('0x20')],'transfereeaccountcode':_0x3899a9['transfertargetaccountcode'],'transfereecontext':_0x3899a9[_0xcb9d('0x21')],'transfereeexten':_0x3899a9['transfertargetexten'],'transfereelinkedid':_0x3899a9[_0xcb9d('0x22')],'isexternal':_0x3899a9['isexternal'],'context':_0x3899a9[_0xcb9d('0x23')],'extension':_0x3899a9[_0xcb9d('0x24')],'type':_0xcb9d('0x25')},'log':_0xcb9d('0x4')});}; \ No newline at end of file diff --git a/server/services/ami/server/index.js b/server/services/ami/server/index.js index c053575..65c0ba3 100644 --- a/server/services/ami/server/index.js +++ b/server/services/ami/server/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x7a54=['http','127.0.0.1','log','RPC\x20listening\x20on\x20port:','lodash','util','jayson/promise','moment','../../../config/environment','../ami','../model/voiceQueueSummary','listen','name','timers','updateAcw','agents','updateStatusRealtime','voiceStatus','pause','isConnected','error','asterisk','ami\x20disconnected','join','pick','keys','reload','Reload','message','catch','username','command','action','Command','then','voiceQueues','hasOwnProperty','push','length','find','omit','undefined','values','channels','validate','map','uniqueid','channel','format','wav','MixMonitor','ai(mixmonitorid)','monitors','/var/spool/asterisk/monitor/','isNil','toLowerCase','mixmonitorid','rec','status','Channel\x20doesn\x27t\x20exist','Action','StopMixMonitor','destinationchannel','stop','filename','queueChannels','type','outbound','includes','Invalid\x20type\x20parameter.\x20Allowed\x20values:\x20inbound,\x20outbound','filter','count','rows','voicequeuechannelhangup','voicequeuechannelredirect','Redirect','exten','context','telephones','trunks','outboundChannels','run','custom:','event','faxAccounts','send'];(function(_0x1ae5e5,_0x43c317){var _0x4e5044=function(_0x3a1783){while(--_0x3a1783){_0x1ae5e5['push'](_0x1ae5e5['shift']());}};_0x4e5044(++_0x43c317);}(_0x7a54,0x106));var _0x47a5=function(_0x50db23,_0x35b91c){_0x50db23=_0x50db23-0x0;var _0xd6bd1a=_0x7a54[_0x50db23];return _0xd6bd1a;};'use strict';var _=require(_0x47a5('0x0'));var util=require(_0x47a5('0x1'));var jayson=require(_0x47a5('0x2'));var schema=require('validate');var moment=require(_0x47a5('0x3'));var config=require(_0x47a5('0x4'));var properties=require('../properties');var ami=require(_0x47a5('0x5'));var VoiceQueueSummary=require(_0x47a5('0x6'));exports[_0x47a5('0x7')]=function(_0x3717e1,_0xfdf934,_0x545a97){return new Promise(function(_0x3d5629,_0x59199c){var _0x343372={'QueuePause':function(_0x30e405){return new Promise(function(_0x506eda){var _0x194fb0=util['format']('%s/%s','SIP',_0x30e405[_0x47a5('0x8')]);if(_0x3717e1[_0x47a5('0x9')]&&_0x3717e1['timers'][_0x194fb0]&&_0x3717e1[_0x47a5('0x9')][_0x194fb0]['timer']){_0x3717e1['timers'][_0x194fb0][_0x47a5('0xa')]();}if(_0x3717e1[_0x47a5('0xb')][_0x194fb0]){_0x3717e1[_0x47a5('0xb')][_0x194fb0][_0x47a5('0xc')]({'state':_0x3717e1[_0x47a5('0xb')][_0x194fb0][_0x47a5('0xd')],'statePause':_0x30e405[_0x47a5('0xe')]?!![]:![]});}_0x506eda({'code':0xc8,'message':'QueuePause'});});},'Reload':function(_0x44bd3e){var _0x221b54=this;return new Promise(function(_0x1cf309,_0x711793){if(ami[_0x47a5('0xf')]()==![]){return _0x711793(_0x221b54[_0x47a5('0x10')](0x1f4,[config[_0x47a5('0x11')]['ip'],config[_0x47a5('0x11')]['username'],_0x47a5('0x12')][_0x47a5('0x13')]('\x20')));}_0x44bd3e=_[_0x47a5('0x14')](_0x44bd3e,_[_0x47a5('0x15')](properties[_0x47a5('0x16')]['module']));_0x44bd3e['action']=_0x47a5('0x17');return ami['Action'](_0x44bd3e)['then'](function(_0x423a81){_0x1cf309({'code':0xc8,'message':_0x423a81[_0x47a5('0x18')]});})[_0x47a5('0x19')](function(_0x1ef371){_0x711793(_0x221b54[_0x47a5('0x10')](0x1f5,_0x1ef371[_0x47a5('0x18')]));});});},'Command':function(_0x2763d6){var _0xe3c618=this;return new Promise(function(_0x3aed38,_0x4a9fcb){if(ami[_0x47a5('0xf')]()==![]){return _0x4a9fcb(_0xe3c618[_0x47a5('0x10')](0x1f4,[config['asterisk']['ip'],config[_0x47a5('0x11')][_0x47a5('0x1a')],_0x47a5('0x12')]['join']('\x20')));}_0x2763d6=_[_0x47a5('0x14')](_0x2763d6,_0x47a5('0x1b'));_0x2763d6[_0x47a5('0x1c')]=_0x47a5('0x1d');return ami['Action'](_0x2763d6)[_0x47a5('0x1e')](function(_0x385687){_0x3aed38({'code':0xc8,'message':_0x385687['content']});})[_0x47a5('0x19')](function(_0xc4cd63){_0x4a9fcb(_0xe3c618[_0x47a5('0x10')](0x1f5,_0xc4cd63[_0x47a5('0x18')]));});});},'VoiceQueues':function(){return new Promise(function(_0x3abd6a){var _0x50bf17=[];for(var _0x53078a in _0x3717e1[_0x47a5('0x1f')]){if(_0x3717e1['voiceQueues'][_0x47a5('0x20')](_0x53078a)){var _0x5b6c4e=_0x3717e1[_0x47a5('0x1f')][_0x53078a];var _0x378208=new VoiceQueueSummary(_0x5b6c4e);_0x50bf17[_0x47a5('0x21')](_0x378208);}}_0x3abd6a({'count':_0x50bf17[_0x47a5('0x22')],'rows':_0x50bf17});});},'UpdateVoiceQueue':function(_0x21f296){return new Promise(function(_0x3ba0b7,_0x24b162){var _0x136b14=_[_0x47a5('0x23')](_0x3717e1[_0x47a5('0x1f')],{'id':parseInt(_0x21f296['id'])});var _0x1127f8=_[_0x47a5('0x24')](_0x21f296,['id']);if(_0x136b14){for(var _0x3ad507 in _0x1127f8){if(typeof _0x1127f8[_0x3ad507]!=='undefined'&&typeof _0x136b14[_0x3ad507]!==_0x47a5('0x25')){_0x136b14[_0x3ad507]=_0x1127f8[_0x3ad507];}}_0x3ba0b7(_0x136b14);}else{_0x24b162();}});},'VoiceChannels':function(){return new Promise(function(_0x51833b){var _0x2ef875=_[_0x47a5('0x26')](_0x3717e1[_0x47a5('0x27')]);_0x51833b({'count':_0x2ef875['length'],'rows':_0x2ef875});});},'VoiceChannelMixMonitor':function(_0x256650){var _0x625952=this;return new Promise(function(_0x39b50b,_0x1f1c68){if(ami['isConnected']()==![]){return _0x1f1c68(_0x625952['error'](0x1f4,[config[_0x47a5('0x11')]['ip'],config[_0x47a5('0x11')]['username'],'ami\x20disconnected'][_0x47a5('0x13')]('\x20')));}var _0x51544e=schema(properties['voicechannel'])[_0x47a5('0x28')](_0x256650);if(_0x51544e['length']>0x0){return _0x1f1c68(_0x625952[_0x47a5('0x10')](0x1f4,_[_0x47a5('0x29')](_0x51544e,'message')['join'](',\x20')));}var _0x274e34=_['find'](_0x3717e1[_0x47a5('0x27')],{'uniqueid':_0x256650[_0x47a5('0x2a')]});if(_0x274e34&&_0x274e34[_0x47a5('0x2b')]){var _0x52749b=util[_0x47a5('0x2c')]('%s.%s',_0x256650['filename']||_0x256650[_0x47a5('0x2a')],_0x256650['format']||_0x47a5('0x2d'));return ami['Action']({'action':_0x47a5('0x2e'),'channel':_0x274e34[_0x47a5('0x2b')],'file':_0x52749b,'options':_0x47a5('0x2f')})[_0x47a5('0x1e')](function(_0x36add5){var _0xed6320=_[_0x47a5('0x23')](_0x274e34[_0x47a5('0x30')],{'filename':_0x47a5('0x31')+_0x52749b['toLowerCase']()});if(_[_0x47a5('0x32')](_0xed6320)){_0x274e34[_0x47a5('0x30')]['push']({'filename':_0x47a5('0x31')+_0x52749b[_0x47a5('0x33')](),'createdAt':moment()[_0x47a5('0x2c')]('YYYY-MM-DD\x20HH:mm:ss'),'mixmonitorid':_0x36add5[_0x47a5('0x34')],'status':_0x47a5('0x35')});}else{_0xed6320['mixmonitorid']=_0x36add5[_0x47a5('0x34')];_0xed6320[_0x47a5('0x36')]='rec';}_0x39b50b({'code':0xc8,'message':[_0x256650['uniqueid'],'MixMonitor\x20Success',_0x36add5[_0x47a5('0x34')]]['join']('\x20'),'mixmonitorid':_0x36add5[_0x47a5('0x34')]});})[_0x47a5('0x19')](function(_0x301a85){_0x1f1c68(_0x625952[_0x47a5('0x10')](0x1f5,[_0x256650[_0x47a5('0x2a')],_0x301a85[_0x47a5('0x18')][_0x47a5('0x33')]()][_0x47a5('0x13')]('\x20')));});}else{return _0x1f1c68(_0x625952[_0x47a5('0x10')](0x1f5,_0x47a5('0x37')));}});},'VoiceChannelStopMixMonitor':function(_0x280500){var _0x1658e8=this;return new Promise(function(_0x23d6d8,_0x56dbbd){if(ami[_0x47a5('0xf')]()==![]){return _0x56dbbd(_0x1658e8[_0x47a5('0x10')](0x1f4,[config[_0x47a5('0x11')]['ip'],config[_0x47a5('0x11')]['username'],_0x47a5('0x12')]['join']('\x20')));}var _0x47c7a2=schema(properties['voicechannel'])['validate'](_0x280500);if(_0x47c7a2[_0x47a5('0x22')]>0x0){return _0x56dbbd(_0x1658e8['error'](0x1f4,_[_0x47a5('0x29')](_0x47c7a2,_0x47a5('0x18'))[_0x47a5('0x13')](',\x20')));}var _0x494526=_[_0x47a5('0x23')](_0x3717e1[_0x47a5('0x27')],{'uniqueid':_0x280500['uniqueid']});if(_0x494526){return Promise['resolve']()[_0x47a5('0x1e')](function(){if(_0x494526['channel']){return ami[_0x47a5('0x38')]({'action':_0x47a5('0x39'),'channel':_0x494526[_0x47a5('0x2b')],'mixmonitorid':_0x280500[_0x47a5('0x34')]})[_0x47a5('0x19')](function(){});}})[_0x47a5('0x1e')](function(){if(_0x494526[_0x47a5('0x3a')]){return ami[_0x47a5('0x38')]({'action':_0x47a5('0x39'),'channel':_0x494526[_0x47a5('0x3a')],'mixmonitorid':_0x280500[_0x47a5('0x34')]})[_0x47a5('0x19')](function(){});}})[_0x47a5('0x1e')](function(){var _0x3574d4=_[_0x47a5('0x23')](_0x494526[_0x47a5('0x30')],{'mixmonitorid':_0x280500['mixmonitorid']});if(_0x3574d4){_0x3574d4[_0x47a5('0x36')]=_0x47a5('0x3b');}})['then'](function(){var _0x52b3a8=util[_0x47a5('0x2c')]('%s.%s',_0x280500[_0x47a5('0x3c')]||_0x280500[_0x47a5('0x2a')],_0x280500['format']||'wav');var _0x3d85cc=_['find'](_0x494526[_0x47a5('0x30')],{'filename':_0x47a5('0x31')+_0x52b3a8[_0x47a5('0x33')]()});if(_0x3d85cc){_0x3d85cc[_0x47a5('0x36')]=_0x47a5('0x3b');}})[_0x47a5('0x1e')](function(){_0x23d6d8({'code':0xc8,'message':[_0x280500[_0x47a5('0x2a')],'StopMixMonitor\x20Success']['join']('\x20')});})[_0x47a5('0x19')](function(_0x411230){_0x56dbbd(_0x1658e8[_0x47a5('0x10')](0x1f5,[_0x280500[_0x47a5('0x2a')],_0x411230[_0x47a5('0x18')][_0x47a5('0x33')]()][_0x47a5('0x13')]('\x20')));});}else{return _0x56dbbd(_0x1658e8['error'](0x1f5,_0x47a5('0x37')));}});},'VoiceQueuesChannels':function(_0x1c9a62){var _0x5f6a=this;return new Promise(function(_0x5c3c75){var _0x12ca40=_['values'](_0x3717e1[_0x47a5('0x3d')]);var _0xe31817={'count':_0x12ca40[_0x47a5('0x22')],'rows':_0x12ca40};if(_0x1c9a62&&_0x1c9a62[_0x47a5('0x3e')]){if(!['inbound',_0x47a5('0x3f')][_0x47a5('0x40')](_0x1c9a62[_0x47a5('0x3e')])){return _0x59199c(_0x5f6a[_0x47a5('0x10')](0x190,_0x47a5('0x41')));}var _0x6a53b3=_[_0x47a5('0x42')](_0x12ca40,function(_0x481089){return _0x481089[_0x47a5('0x3e')]===_0x1c9a62[_0x47a5('0x3e')];});_0xe31817[_0x47a5('0x43')]=_0x6a53b3[_0x47a5('0x22')];_0xe31817[_0x47a5('0x44')]=_0x6a53b3;}_0x5c3c75(_0xe31817);});},'VoiceQueuesChannel':function(_0x1ab0bf){var _0x572233=this;return new Promise(function(_0x1ad6a9,_0x245a15){var _0x1aa581=schema(properties['voicequeuechannel'])[_0x47a5('0x28')](_0x1ab0bf);if(_0x1aa581[_0x47a5('0x22')]>0x0){return _0x245a15(_0x572233[_0x47a5('0x10')](0x1f4,_['map'](_0x1aa581,'message')[_0x47a5('0x13')](',\x20')));}var _0x376e1d=_['find'](_0x3717e1['queueChannels'],{'uniqueid':_0x1ab0bf[_0x47a5('0x2a')]});if(_0x376e1d){_0x1ad6a9(_0x376e1d);}else{return _0x245a15(_0x572233['error'](0x1f5,_0x47a5('0x37')));}});},'VoiceQueuesChannelHangup':function(_0x5d383d){var _0x482de6=this;return new Promise(function(_0x389ed9,_0x46d2d3){if(ami['isConnected']()==![]){return _0x46d2d3(_0x482de6[_0x47a5('0x10')](0x1f4,[config[_0x47a5('0x11')]['ip'],config['asterisk']['username'],_0x47a5('0x12')][_0x47a5('0x13')]('\x20')));}var _0x867da0=schema(properties[_0x47a5('0x45')])['validate'](_0x5d383d);if(_0x867da0[_0x47a5('0x22')]>0x0){return _0x46d2d3(_0x482de6[_0x47a5('0x10')](0x1f4,_[_0x47a5('0x29')](_0x867da0,'message')[_0x47a5('0x13')](',\x20')));}var _0x4db625=_[_0x47a5('0x23')](_0x3717e1[_0x47a5('0x3d')],{'uniqueid':_0x5d383d[_0x47a5('0x2a')]});if(_0x4db625&&_0x4db625[_0x47a5('0x2b')]){return ami[_0x47a5('0x38')]({'action':'Hangup','channel':_0x4db625[_0x47a5('0x2b')]})['then'](function(_0x5cbe97){_0x389ed9({'code':0xc8,'message':[_0x5d383d['uniqueid'],_0x5cbe97['message'][_0x47a5('0x33')]()][_0x47a5('0x13')]('\x20')});})[_0x47a5('0x19')](function(_0x52e3ee){_0x46d2d3(_0x482de6['error'](0x1f5,[_0x5d383d[_0x47a5('0x2a')],_0x52e3ee[_0x47a5('0x18')][_0x47a5('0x33')]()][_0x47a5('0x13')]('\x20')));});}else{return _0x46d2d3(_0x482de6[_0x47a5('0x10')](0x1f5,'Channel\x20doesn\x27t\x20exist'));}});},'VoiceQueuesChannelRedirect':function(_0x3474b7){var _0x519e9e=this;return new Promise(function(_0x22c886,_0x274d31){if(ami['isConnected']()==![]){return _0x274d31(_0x519e9e[_0x47a5('0x10')](0x1f4,[config[_0x47a5('0x11')]['ip'],config[_0x47a5('0x11')][_0x47a5('0x1a')],_0x47a5('0x12')][_0x47a5('0x13')]('\x20')));}var _0x35cca8=schema(properties[_0x47a5('0x46')])['validate'](_0x3474b7);if(_0x35cca8[_0x47a5('0x22')]>0x0){return _0x274d31(_0x519e9e[_0x47a5('0x10')](0x1f4,_[_0x47a5('0x29')](_0x35cca8,_0x47a5('0x18'))[_0x47a5('0x13')](',\x20')));}var _0x4bbe14=_[_0x47a5('0x23')](_0x3717e1[_0x47a5('0x3d')],{'uniqueid':_0x3474b7[_0x47a5('0x2a')]});if(_0x4bbe14&&_0x4bbe14[_0x47a5('0x2b')]){return ami[_0x47a5('0x38')]({'action':_0x47a5('0x47'),'channel':_0x4bbe14[_0x47a5('0x2b')],'exten':_0x3474b7[_0x47a5('0x48')],'context':_0x3474b7[_0x47a5('0x49')]||_0x4bbe14[_0x47a5('0x49')],'priority':0x1})[_0x47a5('0x1e')](function(_0x44fda9){_0x22c886({'code':0xc8,'message':[_0x3474b7[_0x47a5('0x2a')],_0x44fda9[_0x47a5('0x18')][_0x47a5('0x33')]()]['join']('\x20')});})[_0x47a5('0x19')](function(_0x284fb8){_0x274d31(_0x519e9e[_0x47a5('0x10')](0x1f5,[_0x3474b7['uniqueid'],_0x284fb8[_0x47a5('0x18')][_0x47a5('0x33')]()][_0x47a5('0x13')]('\x20')));});}else{return _0x274d31(_0x519e9e[_0x47a5('0x10')](0x1f5,'Channel\x20doesn\x27t\x20exist'));}});},'Agents':function(_0x3ac402){return new Promise(function(_0x522ccf){var _0x2d5ee6=_['values'](_0x3717e1[_0x47a5('0xb')]);if(_0x3ac402&&_0x3ac402['id']){var _0x4cf7c5=_[_0x47a5('0x23')](_0x2d5ee6,function(_0x2f27c3){return _0x2f27c3['id']===_0x3ac402['id'];});_0x522ccf(_0x4cf7c5);}else{_0x522ccf({'count':_0x2d5ee6[_0x47a5('0x22')],'rows':_0x2d5ee6});}});},'Telephones':function(){return new Promise(function(_0x58473b){var _0x4af557=_['values'](_0x3717e1[_0x47a5('0x4a')]);_0x58473b({'count':_0x4af557[_0x47a5('0x22')],'rows':_0x4af557});});},'Trunks':function(){return new Promise(function(_0xe3c0a7){var _0x117510=_['values'](_0x3717e1[_0x47a5('0x4b')]);_0xe3c0a7({'count':_0x117510[_0x47a5('0x22')],'rows':_0x117510});});},'OutboundChannels':function(){return new Promise(function(_0x390bc0){var _0xd5b23f=_[_0x47a5('0x26')](_0x3717e1[_0x47a5('0x4c')]);_0x390bc0({'count':_0xd5b23f[_0x47a5('0x22')],'rows':_0xd5b23f});});},'Outbound':function(){return new Promise(function(_0x39939a){_0x39939a(_0x3717e1[_0x47a5('0x3f')]);});},'Campaigns':function(){return new Promise(function(_0xc69a68){var _0x2e6fcc=_[_0x47a5('0x26')](_0x3717e1['campaigns']);_0xc69a68({'count':_0x2e6fcc[_0x47a5('0x22')],'rows':_0x2e6fcc});});},'VoiceQueuesPreview':function(_0x4833be){var _0x2ad00a=this;return new Promise(function(_0x2ac30f,_0x281e5f){_0xfdf934[_0x47a5('0x4d')](_0x4833be['id'])[_0x47a5('0x1e')](function(_0xa9c853){_0x2ac30f({'code':0xc8,'message':_0xa9c853[_0x47a5('0x18')]});})[_0x47a5('0x19')](function(_0x11c1db){_0x281e5f(_0x2ad00a[_0x47a5('0x10')](0x1f4,_0x11c1db[_0x47a5('0x18')]));});});},'EventManager':function(_0x1f07ac){var _0x8f0035=this;return new Promise(function(_0x2d434c,_0x441d64){if(!_0x1f07ac['event']){return _0x441d64(_0x8f0035['error'](0x1f4,'Event\x20name\x20mandatory'));}ami['emit'](_0x47a5('0x4e')+_0x1f07ac[_0x47a5('0x4f')],_0x1f07ac['message']);_0x2d434c({'code':0xc8,'message':_0x1f07ac});});},'FaxAccounts':function(){return new Promise(function(_0x732e00){var _0x44dda2=_[_0x47a5('0x26')](_0x3717e1[_0x47a5('0x50')]);_0x732e00({'count':_0x44dda2[_0x47a5('0x22')],'rows':_0x44dda2});});},'SendFax':function(_0x930d25){var _0x218dfa=this;return new Promise(function(_0x1c7302,_0x2e9a96){_0x545a97[_0x47a5('0x51')](_0x930d25)[_0x47a5('0x1e')](function(_0x5e5f16){_0x1c7302({'code':0xc8,'message':_0x5e5f16[_0x47a5('0x18')]});})[_0x47a5('0x19')](function(_0x420671){_0x2e9a96(_0x218dfa['error'](0x1f4,_0x420671[_0x47a5('0x18')]));});});},'CheckAfterSend':function(_0x32f393){var _0x17b61d=this;return new Promise(function(_0x5d41d8,_0x19dc8c){_0x545a97['checkAfterSend'](_0x32f393)['then'](function(_0x356e16){_0x5d41d8({'code':0xc8,'message':_0x356e16[_0x47a5('0x18')]});})[_0x47a5('0x19')](function(_0x27333e){_0x19dc8c(_0x17b61d[_0x47a5('0x10')](0x1f4,_0x27333e[_0x47a5('0x18')]));});});}};var _0x479a82=jayson['server'](_0x343372)[_0x47a5('0x52')]();_0x479a82['on']('error',function(_0x24dbee){return _0x59199c(_0x24dbee);});_0x479a82[_0x47a5('0x7')](0x232a,_0x47a5('0x53'),function(){console[_0x47a5('0x54')]('AMI\x20RPC\x20server\x20listening\x20on\x20127.0.0.1:%d!',0x232a);return _0x3d5629(_0x47a5('0x55')+0x232a);});});}; \ No newline at end of file +var _0xb10b=['type','Invalid\x20type\x20parameter.\x20Allowed\x20values:\x20inbound,\x20outbound','filter','count','rows','voicequeuechannel','voicequeuechannelhangup','Hangup','voicequeuechannelredirect','Redirect','telephones','trunks','run','event','Event\x20name\x20mandatory','faxAccounts','send','checkAfterSend','server','http','127.0.0.1','RPC\x20listening\x20on\x20port:','lodash','jayson/promise','validate','moment','../properties','../ami','../model/voiceQueueSummary','listen','format','%s/%s','SIP','name','timers','timer','updateAcw','agents','voiceStatus','pause','QueuePause','isConnected','error','asterisk','username','ami\x20disconnected','join','pick','keys','module','action','Reload','Action','then','message','catch','command','Command','content','voiceQueues','hasOwnProperty','push','length','find','omit','undefined','values','voicechannel','map','channels','uniqueid','channel','%s.%s','filename','wav','ai(mixmonitorid)','/var/spool/asterisk/monitor/','toLowerCase','mixmonitorid','rec','status','MixMonitor\x20Success','Channel\x20doesn\x27t\x20exist','resolve','StopMixMonitor','destinationchannel','monitors','stop','queueChannels','inbound','outbound','includes'];(function(_0x115a96,_0x2abf7f){var _0x19ba73=function(_0x486411){while(--_0x486411){_0x115a96['push'](_0x115a96['shift']());}};_0x19ba73(++_0x2abf7f);}(_0xb10b,0x12a));var _0xbb10=function(_0x305486,_0x24acd4){_0x305486=_0x305486-0x0;var _0xa04940=_0xb10b[_0x305486];return _0xa04940;};'use strict';var _=require(_0xbb10('0x0'));var util=require('util');var jayson=require(_0xbb10('0x1'));var schema=require(_0xbb10('0x2'));var moment=require(_0xbb10('0x3'));var config=require('../../../config/environment');var properties=require(_0xbb10('0x4'));var ami=require(_0xbb10('0x5'));var VoiceQueueSummary=require(_0xbb10('0x6'));exports[_0xbb10('0x7')]=function(_0x49baf4,_0x312b72,_0x481979){return new Promise(function(_0x328583,_0x3cdd53){var _0x513741={'QueuePause':function(_0x1b9e94){return new Promise(function(_0x3fb675){var _0x21370f=util[_0xbb10('0x8')](_0xbb10('0x9'),_0xbb10('0xa'),_0x1b9e94[_0xbb10('0xb')]);if(_0x49baf4[_0xbb10('0xc')]&&_0x49baf4['timers'][_0x21370f]&&_0x49baf4['timers'][_0x21370f][_0xbb10('0xd')]){_0x49baf4[_0xbb10('0xc')][_0x21370f][_0xbb10('0xe')]();}if(_0x49baf4['agents'][_0x21370f]){_0x49baf4[_0xbb10('0xf')][_0x21370f]['updateStatusRealtime']({'state':_0x49baf4[_0xbb10('0xf')][_0x21370f][_0xbb10('0x10')],'statePause':_0x1b9e94[_0xbb10('0x11')]?!![]:![]});}_0x3fb675({'code':0xc8,'message':_0xbb10('0x12')});});},'Reload':function(_0x442548){var _0x147230=this;return new Promise(function(_0x58a612,_0x26e021){if(ami[_0xbb10('0x13')]()==![]){return _0x26e021(_0x147230[_0xbb10('0x14')](0x1f4,[config[_0xbb10('0x15')]['ip'],config[_0xbb10('0x15')][_0xbb10('0x16')],_0xbb10('0x17')][_0xbb10('0x18')]('\x20')));}_0x442548=_[_0xbb10('0x19')](_0x442548,_[_0xbb10('0x1a')](properties['reload'][_0xbb10('0x1b')]));_0x442548[_0xbb10('0x1c')]=_0xbb10('0x1d');return ami[_0xbb10('0x1e')](_0x442548)[_0xbb10('0x1f')](function(_0x1682a4){_0x58a612({'code':0xc8,'message':_0x1682a4[_0xbb10('0x20')]});})[_0xbb10('0x21')](function(_0xbf2906){_0x26e021(_0x147230[_0xbb10('0x14')](0x1f5,_0xbf2906['message']));});});},'Command':function(_0x5ff0cf){var _0x19f48d=this;return new Promise(function(_0x388fab,_0x109908){if(ami[_0xbb10('0x13')]()==![]){return _0x109908(_0x19f48d[_0xbb10('0x14')](0x1f4,[config['asterisk']['ip'],config[_0xbb10('0x15')][_0xbb10('0x16')],'ami\x20disconnected']['join']('\x20')));}_0x5ff0cf=_[_0xbb10('0x19')](_0x5ff0cf,_0xbb10('0x22'));_0x5ff0cf[_0xbb10('0x1c')]=_0xbb10('0x23');return ami[_0xbb10('0x1e')](_0x5ff0cf)[_0xbb10('0x1f')](function(_0x407cb4){_0x388fab({'code':0xc8,'message':_0x407cb4[_0xbb10('0x24')]});})[_0xbb10('0x21')](function(_0x395404){_0x109908(_0x19f48d[_0xbb10('0x14')](0x1f5,_0x395404[_0xbb10('0x20')]));});});},'VoiceQueues':function(){return new Promise(function(_0x537898){var _0x4fedac=[];for(var _0x4fb5e0 in _0x49baf4[_0xbb10('0x25')]){if(_0x49baf4[_0xbb10('0x25')][_0xbb10('0x26')](_0x4fb5e0)){var _0x4e25ff=_0x49baf4[_0xbb10('0x25')][_0x4fb5e0];var _0x24d586=new VoiceQueueSummary(_0x4e25ff);_0x4fedac[_0xbb10('0x27')](_0x24d586);}}_0x537898({'count':_0x4fedac[_0xbb10('0x28')],'rows':_0x4fedac});});},'UpdateVoiceQueue':function(_0x1acce9){return new Promise(function(_0x20d946,_0x2a0e8b){var _0x4aabb9=_[_0xbb10('0x29')](_0x49baf4[_0xbb10('0x25')],{'id':parseInt(_0x1acce9['id'])});var _0xfc3595=_[_0xbb10('0x2a')](_0x1acce9,['id']);if(_0x4aabb9){for(var _0x1d30aa in _0xfc3595){if(typeof _0xfc3595[_0x1d30aa]!==_0xbb10('0x2b')&&typeof _0x4aabb9[_0x1d30aa]!=='undefined'){_0x4aabb9[_0x1d30aa]=_0xfc3595[_0x1d30aa];}}_0x20d946(_0x4aabb9);}else{_0x2a0e8b();}});},'VoiceChannels':function(){return new Promise(function(_0x221624){var _0x4ee02e=_[_0xbb10('0x2c')](_0x49baf4['channels']);_0x221624({'count':_0x4ee02e[_0xbb10('0x28')],'rows':_0x4ee02e});});},'VoiceChannelMixMonitor':function(_0x1dcc9c){var _0x1b59f9=this;return new Promise(function(_0x491db4,_0x518d47){if(ami[_0xbb10('0x13')]()==![]){return _0x518d47(_0x1b59f9[_0xbb10('0x14')](0x1f4,[config['asterisk']['ip'],config[_0xbb10('0x15')][_0xbb10('0x16')],_0xbb10('0x17')][_0xbb10('0x18')]('\x20')));}var _0x37a83f=schema(properties[_0xbb10('0x2d')])[_0xbb10('0x2')](_0x1dcc9c);if(_0x37a83f['length']>0x0){return _0x518d47(_0x1b59f9[_0xbb10('0x14')](0x1f4,_[_0xbb10('0x2e')](_0x37a83f,_0xbb10('0x20'))[_0xbb10('0x18')](',\x20')));}var _0xfb2c5e=_[_0xbb10('0x29')](_0x49baf4[_0xbb10('0x2f')],{'uniqueid':_0x1dcc9c[_0xbb10('0x30')]});if(_0xfb2c5e&&_0xfb2c5e[_0xbb10('0x31')]){var _0x56943c=util[_0xbb10('0x8')](_0xbb10('0x32'),_0x1dcc9c[_0xbb10('0x33')]||_0x1dcc9c[_0xbb10('0x30')],_0x1dcc9c['format']||_0xbb10('0x34'));return ami['Action']({'action':'MixMonitor','channel':_0xfb2c5e[_0xbb10('0x31')],'file':_0x56943c,'options':_0xbb10('0x35')})[_0xbb10('0x1f')](function(_0x120d21){var _0x15d895=_[_0xbb10('0x29')](_0xfb2c5e['monitors'],{'filename':_0xbb10('0x36')+_0x56943c[_0xbb10('0x37')]()});if(_['isNil'](_0x15d895)){_0xfb2c5e['monitors']['push']({'filename':_0xbb10('0x36')+_0x56943c[_0xbb10('0x37')](),'createdAt':moment()[_0xbb10('0x8')]('YYYY-MM-DD\x20HH:mm:ss'),'mixmonitorid':_0x120d21[_0xbb10('0x38')],'status':_0xbb10('0x39')});}else{_0x15d895[_0xbb10('0x38')]=_0x120d21['mixmonitorid'];_0x15d895[_0xbb10('0x3a')]=_0xbb10('0x39');}_0x491db4({'code':0xc8,'message':[_0x1dcc9c[_0xbb10('0x30')],_0xbb10('0x3b'),_0x120d21['mixmonitorid']][_0xbb10('0x18')]('\x20'),'mixmonitorid':_0x120d21[_0xbb10('0x38')]});})['catch'](function(_0xe2040f){_0x518d47(_0x1b59f9[_0xbb10('0x14')](0x1f5,[_0x1dcc9c[_0xbb10('0x30')],_0xe2040f[_0xbb10('0x20')][_0xbb10('0x37')]()][_0xbb10('0x18')]('\x20')));});}else{return _0x518d47(_0x1b59f9['error'](0x1f5,_0xbb10('0x3c')));}});},'VoiceChannelStopMixMonitor':function(_0x1c7fae){var _0x3e7b4c=this;return new Promise(function(_0x3d3c41,_0x4943d9){if(ami[_0xbb10('0x13')]()==![]){return _0x4943d9(_0x3e7b4c[_0xbb10('0x14')](0x1f4,[config[_0xbb10('0x15')]['ip'],config[_0xbb10('0x15')]['username'],_0xbb10('0x17')][_0xbb10('0x18')]('\x20')));}var _0x54ac18=schema(properties['voicechannel'])[_0xbb10('0x2')](_0x1c7fae);if(_0x54ac18['length']>0x0){return _0x4943d9(_0x3e7b4c[_0xbb10('0x14')](0x1f4,_[_0xbb10('0x2e')](_0x54ac18,'message')[_0xbb10('0x18')](',\x20')));}var _0x1d82bf=_[_0xbb10('0x29')](_0x49baf4['channels'],{'uniqueid':_0x1c7fae[_0xbb10('0x30')]});if(_0x1d82bf){return Promise[_0xbb10('0x3d')]()[_0xbb10('0x1f')](function(){if(_0x1d82bf[_0xbb10('0x31')]){return ami[_0xbb10('0x1e')]({'action':_0xbb10('0x3e'),'channel':_0x1d82bf[_0xbb10('0x31')],'mixmonitorid':_0x1c7fae[_0xbb10('0x38')]})[_0xbb10('0x21')](function(){});}})[_0xbb10('0x1f')](function(){if(_0x1d82bf[_0xbb10('0x3f')]){return ami[_0xbb10('0x1e')]({'action':'StopMixMonitor','channel':_0x1d82bf[_0xbb10('0x3f')],'mixmonitorid':_0x1c7fae[_0xbb10('0x38')]})['catch'](function(){});}})[_0xbb10('0x1f')](function(){var _0x2f5027=_[_0xbb10('0x29')](_0x1d82bf[_0xbb10('0x40')],{'mixmonitorid':_0x1c7fae[_0xbb10('0x38')]});if(_0x2f5027){_0x2f5027[_0xbb10('0x3a')]=_0xbb10('0x41');}})['then'](function(){var _0x4a9793=util[_0xbb10('0x8')](_0xbb10('0x32'),_0x1c7fae[_0xbb10('0x33')]||_0x1c7fae['uniqueid'],_0x1c7fae['format']||_0xbb10('0x34'));var _0x34cf4e=_[_0xbb10('0x29')](_0x1d82bf[_0xbb10('0x40')],{'filename':_0xbb10('0x36')+_0x4a9793[_0xbb10('0x37')]()});if(_0x34cf4e){_0x34cf4e[_0xbb10('0x3a')]=_0xbb10('0x41');}})[_0xbb10('0x1f')](function(){_0x3d3c41({'code':0xc8,'message':[_0x1c7fae[_0xbb10('0x30')],'StopMixMonitor\x20Success']['join']('\x20')});})[_0xbb10('0x21')](function(_0x467dba){_0x4943d9(_0x3e7b4c[_0xbb10('0x14')](0x1f5,[_0x1c7fae[_0xbb10('0x30')],_0x467dba[_0xbb10('0x20')][_0xbb10('0x37')]()][_0xbb10('0x18')]('\x20')));});}else{return _0x4943d9(_0x3e7b4c[_0xbb10('0x14')](0x1f5,_0xbb10('0x3c')));}});},'VoiceQueuesChannels':function(_0x1214f7){var _0x19ca3e=this;return new Promise(function(_0x20e18a){var _0x61e689=_[_0xbb10('0x2c')](_0x49baf4[_0xbb10('0x42')]);var _0x547a7a={'count':_0x61e689[_0xbb10('0x28')],'rows':_0x61e689};if(_0x1214f7&&_0x1214f7['type']){if(![_0xbb10('0x43'),_0xbb10('0x44')][_0xbb10('0x45')](_0x1214f7[_0xbb10('0x46')])){return _0x3cdd53(_0x19ca3e[_0xbb10('0x14')](0x190,_0xbb10('0x47')));}var _0x2e3326=_[_0xbb10('0x48')](_0x61e689,function(_0x180400){return _0x180400[_0xbb10('0x46')]===_0x1214f7[_0xbb10('0x46')];});_0x547a7a[_0xbb10('0x49')]=_0x2e3326[_0xbb10('0x28')];_0x547a7a[_0xbb10('0x4a')]=_0x2e3326;}_0x20e18a(_0x547a7a);});},'VoiceQueuesChannel':function(_0x4475e1){var _0x5de0cc=this;return new Promise(function(_0x4571b6,_0x466eb7){var _0x1b83a9=schema(properties[_0xbb10('0x4b')])[_0xbb10('0x2')](_0x4475e1);if(_0x1b83a9[_0xbb10('0x28')]>0x0){return _0x466eb7(_0x5de0cc['error'](0x1f4,_[_0xbb10('0x2e')](_0x1b83a9,_0xbb10('0x20'))[_0xbb10('0x18')](',\x20')));}var _0x14fed3=_[_0xbb10('0x29')](_0x49baf4[_0xbb10('0x42')],{'uniqueid':_0x4475e1[_0xbb10('0x30')]});if(_0x14fed3){_0x4571b6(_0x14fed3);}else{return _0x466eb7(_0x5de0cc[_0xbb10('0x14')](0x1f5,_0xbb10('0x3c')));}});},'VoiceQueuesChannelHangup':function(_0x40c4fb){var _0x2eb05a=this;return new Promise(function(_0x2a1ce1,_0x16932f){if(ami['isConnected']()==![]){return _0x16932f(_0x2eb05a['error'](0x1f4,[config[_0xbb10('0x15')]['ip'],config[_0xbb10('0x15')][_0xbb10('0x16')],_0xbb10('0x17')]['join']('\x20')));}var _0x506498=schema(properties[_0xbb10('0x4c')])[_0xbb10('0x2')](_0x40c4fb);if(_0x506498[_0xbb10('0x28')]>0x0){return _0x16932f(_0x2eb05a[_0xbb10('0x14')](0x1f4,_[_0xbb10('0x2e')](_0x506498,_0xbb10('0x20'))[_0xbb10('0x18')](',\x20')));}var _0x4a5fb9=_[_0xbb10('0x29')](_0x49baf4[_0xbb10('0x42')],{'uniqueid':_0x40c4fb['uniqueid']});if(_0x4a5fb9&&_0x4a5fb9['channel']){return ami['Action']({'action':_0xbb10('0x4d'),'channel':_0x4a5fb9[_0xbb10('0x31')]})[_0xbb10('0x1f')](function(_0x5bd1c0){_0x2a1ce1({'code':0xc8,'message':[_0x40c4fb['uniqueid'],_0x5bd1c0['message'][_0xbb10('0x37')]()][_0xbb10('0x18')]('\x20')});})[_0xbb10('0x21')](function(_0x4e9fbd){_0x16932f(_0x2eb05a[_0xbb10('0x14')](0x1f5,[_0x40c4fb[_0xbb10('0x30')],_0x4e9fbd['message']['toLowerCase']()][_0xbb10('0x18')]('\x20')));});}else{return _0x16932f(_0x2eb05a[_0xbb10('0x14')](0x1f5,_0xbb10('0x3c')));}});},'VoiceQueuesChannelRedirect':function(_0x237246){var _0x54b7c5=this;return new Promise(function(_0x43eaec,_0xec48ac){if(ami[_0xbb10('0x13')]()==![]){return _0xec48ac(_0x54b7c5['error'](0x1f4,[config[_0xbb10('0x15')]['ip'],config[_0xbb10('0x15')][_0xbb10('0x16')],'ami\x20disconnected'][_0xbb10('0x18')]('\x20')));}var _0x31e85e=schema(properties[_0xbb10('0x4e')])[_0xbb10('0x2')](_0x237246);if(_0x31e85e['length']>0x0){return _0xec48ac(_0x54b7c5[_0xbb10('0x14')](0x1f4,_[_0xbb10('0x2e')](_0x31e85e,_0xbb10('0x20'))[_0xbb10('0x18')](',\x20')));}var _0x56b3a3=_[_0xbb10('0x29')](_0x49baf4[_0xbb10('0x42')],{'uniqueid':_0x237246[_0xbb10('0x30')]});if(_0x56b3a3&&_0x56b3a3[_0xbb10('0x31')]){return ami[_0xbb10('0x1e')]({'action':_0xbb10('0x4f'),'channel':_0x56b3a3[_0xbb10('0x31')],'exten':_0x237246['exten'],'context':_0x237246['context']||_0x56b3a3['context'],'priority':0x1})[_0xbb10('0x1f')](function(_0x9c672d){_0x43eaec({'code':0xc8,'message':[_0x237246[_0xbb10('0x30')],_0x9c672d['message']['toLowerCase']()][_0xbb10('0x18')]('\x20')});})[_0xbb10('0x21')](function(_0xd9e743){_0xec48ac(_0x54b7c5[_0xbb10('0x14')](0x1f5,[_0x237246[_0xbb10('0x30')],_0xd9e743[_0xbb10('0x20')]['toLowerCase']()][_0xbb10('0x18')]('\x20')));});}else{return _0xec48ac(_0x54b7c5[_0xbb10('0x14')](0x1f5,_0xbb10('0x3c')));}});},'Agents':function(_0x14f16b){return new Promise(function(_0x2aaaa6){var _0x5bfc68=_['values'](_0x49baf4['agents']);if(_0x14f16b&&_0x14f16b['id']){var _0x329da7=_[_0xbb10('0x29')](_0x5bfc68,function(_0x36917f){return _0x36917f['id']===_0x14f16b['id'];});_0x2aaaa6(_0x329da7);}else{_0x2aaaa6({'count':_0x5bfc68[_0xbb10('0x28')],'rows':_0x5bfc68});}});},'Telephones':function(){return new Promise(function(_0x2f7d2a){var _0x1d40b8=_['values'](_0x49baf4[_0xbb10('0x50')]);_0x2f7d2a({'count':_0x1d40b8['length'],'rows':_0x1d40b8});});},'Trunks':function(){return new Promise(function(_0x4fe3b5){var _0x519a54=_[_0xbb10('0x2c')](_0x49baf4[_0xbb10('0x51')]);_0x4fe3b5({'count':_0x519a54[_0xbb10('0x28')],'rows':_0x519a54});});},'OutboundChannels':function(){return new Promise(function(_0x108f99){var _0x5ce94f=_[_0xbb10('0x2c')](_0x49baf4['outboundChannels']);_0x108f99({'count':_0x5ce94f['length'],'rows':_0x5ce94f});});},'Outbound':function(){return new Promise(function(_0x165fe9){_0x165fe9(_0x49baf4[_0xbb10('0x44')]);});},'Campaigns':function(){return new Promise(function(_0x29529c){var _0x2bd2ab=_[_0xbb10('0x2c')](_0x49baf4['campaigns']);_0x29529c({'count':_0x2bd2ab[_0xbb10('0x28')],'rows':_0x2bd2ab});});},'VoiceQueuesPreview':function(_0x19fcec){var _0x2c6429=this;return new Promise(function(_0x3f3d38,_0x43cdb7){_0x312b72[_0xbb10('0x52')](_0x19fcec['id'])[_0xbb10('0x1f')](function(_0x53fa98){_0x3f3d38({'code':0xc8,'message':_0x53fa98[_0xbb10('0x20')]});})[_0xbb10('0x21')](function(_0x30f3ea){_0x43cdb7(_0x2c6429[_0xbb10('0x14')](0x1f4,_0x30f3ea[_0xbb10('0x20')]));});});},'EventManager':function(_0x172be3){var _0xa3b23=this;return new Promise(function(_0x312a08,_0x5a4429){if(!_0x172be3[_0xbb10('0x53')]){return _0x5a4429(_0xa3b23[_0xbb10('0x14')](0x1f4,_0xbb10('0x54')));}ami['emit']('custom:'+_0x172be3['event'],_0x172be3[_0xbb10('0x20')]);_0x312a08({'code':0xc8,'message':_0x172be3});});},'FaxAccounts':function(){return new Promise(function(_0x5a3c44){var _0x4e3d6a=_[_0xbb10('0x2c')](_0x49baf4[_0xbb10('0x55')]);_0x5a3c44({'count':_0x4e3d6a[_0xbb10('0x28')],'rows':_0x4e3d6a});});},'SendFax':function(_0x12ed63){var _0x32ec27=this;return new Promise(function(_0x24dca6,_0x33116){_0x481979[_0xbb10('0x56')](_0x12ed63)[_0xbb10('0x1f')](function(_0x5206e1){_0x24dca6({'code':0xc8,'message':_0x5206e1[_0xbb10('0x20')]});})[_0xbb10('0x21')](function(_0x46b6d2){_0x33116(_0x32ec27[_0xbb10('0x14')](0x1f4,_0x46b6d2['message']));});});},'CheckAfterSend':function(_0x4c0795){var _0x3547a3=this;return new Promise(function(_0x2280bd,_0x30f0a4){_0x481979[_0xbb10('0x57')](_0x4c0795)['then'](function(_0x17d596){_0x2280bd({'code':0xc8,'message':_0x17d596[_0xbb10('0x20')]});})[_0xbb10('0x21')](function(_0xf7b3e1){_0x30f0a4(_0x3547a3[_0xbb10('0x14')](0x1f4,_0xf7b3e1['message']));});});}};var _0x5f0691=jayson[_0xbb10('0x58')](_0x513741)[_0xbb10('0x59')]();_0x5f0691['on'](_0xbb10('0x14'),function(_0x5239da){return _0x3cdd53(_0x5239da);});_0x5f0691[_0xbb10('0x7')](0x232a,_0xbb10('0x5a'),function(){console['log']('AMI\x20RPC\x20server\x20listening\x20on\x20127.0.0.1:%d!',0x232a);return _0x328583(_0xbb10('0x5b')+0x232a);});});}; \ No newline at end of file diff --git a/server/services/ami/trigger/cmContact/index.js b/server/services/ami/trigger/cmContact/index.js index 1b190b8..afcc3da 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 _0xbef0=['destcalleridname','createContact','[CM][%s][%s]\x20Contact\x20created:%s','[CM][%s][%s]\x20Autocreate\x20disabled','push','user:%s','name','format','action','merge','lodash','../../../../config/logger','trigger','../../rpc/cmContact','defaults','localhost','socket.io-emitter','info','stringify','emit','exec','data2','data5','xmd-contactid','ListId','data3','split','phone','$or','map','destcalleridnum','calleridnum','routeId','firstName','lastName','mobile','fax','createdAt','scheduledAt','updatedAt','union','resolve','getContacts','[CM][%s][%s]\x20Contact\x20found:%s','uniqueid','[CM][%s][%s]\x20Multiple\x20contacts\x20found:[%s]','join','[CM][%s][%s]\x20Contact\x20not\x20found','isNil','calleridname','','Unknown'];(function(_0x119eb9,_0x3a550c){var _0x2d62b9=function(_0x44b064){while(--_0x44b064){_0x119eb9['push'](_0x119eb9['shift']());}};_0x2d62b9(++_0x3a550c);}(_0xbef0,0x72));var _0x0bef=function(_0x5c5d0c,_0x1af375){_0x5c5d0c=_0x5c5d0c-0x0;var _0x4e2331=_0xbef0[_0x5c5d0c];return _0x4e2331;};'use strict';var _=require(_0x0bef('0x0'));var BPromise=require('bluebird');var Redis=require('ioredis');var util=require('util');var config=require('../../../../config/environment');var logger=require(_0x0bef('0x1'))(_0x0bef('0x2'));var cmContactRpc=require(_0x0bef('0x3'));config['redis']=_[_0x0bef('0x4')](config['redis'],{'host':_0x0bef('0x5'),'port':0x18eb});var io=require(_0x0bef('0x6'))(new Redis(config['redis']));function emit(_0x24660b,_0x29873b,_0x183dc7,_0x5e6b6b,_0x40039c){logger[_0x0bef('0x7')]('[CM][%s][%s]',_0x24660b,_0x29873b['id'],_0x183dc7,_0x5e6b6b,JSON[_0x0bef('0x8')](_0x40039c));io['to'](_0x183dc7)[_0x0bef('0x9')](_0x5e6b6b,_0x40039c);}exports[_0x0bef('0xa')]=function(_0xa8abaf,_0x2c7d67,_0x229ab6,_0x44ced9){var _0x572408,_0x2b9e62;var _0x2122ba={};var _0x41ab26;var _0x573b2b=Number(_0x229ab6['data1']);var _0x40759d=_0x229ab6[_0x0bef('0xb')]?Boolean(Number(_0x229ab6['data2'])):![];var _0x5e5c43;var _0x25876c=![];if(!_['isNil'](_0x229ab6[_0x0bef('0xc')])){if(_0x229ab6['data5']=='1')_0x25876c=!![];}if(!_0x25876c){if(_0x44ced9[_0x0bef('0xd')]){_0x2122ba['id']=_0x44ced9[_0x0bef('0xd')];}}if(!_0x2122ba['id']){_0x2122ba[_0x0bef('0xe')]=_0x573b2b;_0x5e5c43=_0x229ab6[_0x0bef('0xf')]&&_0x229ab6[_0x0bef('0xf')]!=='0'?_0x229ab6[_0x0bef('0xf')][_0x0bef('0x10')](','):[_0x0bef('0x11')];_0x2122ba[_0x0bef('0x12')]=_[_0x0bef('0x13')](_0x5e5c43,function(_0x4b0515){var _0x1b8b62={};_0x1b8b62[_0x4b0515]=_0x44ced9['routeId']?_0x44ced9[_0x0bef('0x14')]:_0x44ced9[_0x0bef('0x15')];return _0x1b8b62;});_0x41ab26=_0x44ced9[_0x0bef('0x16')]?_0x44ced9[_0x0bef('0x14')]:_0x44ced9[_0x0bef('0x15')];}var _0x13bc09=['id',_0x0bef('0x17'),_0x0bef('0x18'),'phone',_0x0bef('0x19'),_0x0bef('0x1a'),_0x0bef('0xe'),_0x0bef('0x1b'),_0x0bef('0x1c'),_0x0bef('0x1d')];var _0x3a7d8c=_[_0x0bef('0x1e')](_0x13bc09,_0x5e5c43);BPromise[_0x0bef('0x1f')]()['then'](cmContactRpc[_0x0bef('0x20')]({'attributes':_0x3a7d8c,'where':_0x2122ba,'phone':_0x41ab26}))['then'](function(_0x410e78){_0x2b9e62=_0x410e78;if(!_['isEmpty'](_0x2b9e62)){if(_0x2b9e62['length']===0x1){_0x572408=_0x2b9e62[0x0];logger[_0x0bef('0x7')](_0x0bef('0x21'),_0x44ced9[_0x0bef('0x22')],_0x2c7d67['id'],_0x572408['id']);}else{logger[_0x0bef('0x7')](_0x0bef('0x23'),_0x44ced9[_0x0bef('0x22')],_0x2c7d67['id'],_[_0x0bef('0x13')](_0x2b9e62,'id')[_0x0bef('0x24')](','));}return;}else{logger[_0x0bef('0x7')](_0x0bef('0x25'),_0x44ced9['uniqueid'],_0x2c7d67['id']);var _0x5e549b={'ListId':_0x573b2b};var _0x356015=_0x229ab6['data4']&&_0x229ab6['data4']!=='0'?_0x229ab6['data4']:_0x0bef('0x11');if(_0x40759d){logger['info']('[CM][%s][%s]\x20Autocreate\x20enabled',_0x44ced9[_0x0bef('0x22')],_0x2c7d67['id']);_0x5e549b[_0x356015]=_[_0x0bef('0x26')](_0x44ced9[_0x0bef('0x16')])?_0x44ced9[_0x0bef('0x15')]:_0x44ced9[_0x0bef('0x14')];if(_['isNil'](_0x44ced9[_0x0bef('0x16')])){_0x5e549b[_0x0bef('0x17')]=_0x44ced9[_0x0bef('0x27')]&&_0x44ced9[_0x0bef('0x27')]!==_0x0bef('0x28')?_0x44ced9['calleridname']:_0x0bef('0x29');}else{_0x5e549b[_0x0bef('0x17')]=_0x44ced9[_0x0bef('0x2a')]&&_0x44ced9[_0x0bef('0x2a')]!==''?_0x44ced9['destcalleridname']:_0x0bef('0x29');}return BPromise['resolve']()['then'](cmContactRpc[_0x0bef('0x2b')](_0x5e549b))['then'](function(_0x2f2d05){_0x572408=_0x2f2d05;_0x2b9e62['push'](_0x2f2d05);if(_0x572408){logger['info'](_0x0bef('0x2c'),_0x44ced9[_0x0bef('0x22')],_0x2c7d67['id'],_0x572408['id']);}return;});}else{logger[_0x0bef('0x7')](_0x0bef('0x2d'),_0x44ced9[_0x0bef('0x22')],_0x2c7d67['id']);_0x5e549b[_0x356015]=_[_0x0bef('0x26')](_0x44ced9[_0x0bef('0x16')])?_0x44ced9[_0x0bef('0x15')]:_0x44ced9[_0x0bef('0x14')];if(_[_0x0bef('0x26')](_0x44ced9[_0x0bef('0x16')])){_0x5e549b['firstName']=_0x44ced9[_0x0bef('0x27')]&&_0x44ced9[_0x0bef('0x27')]!==_0x0bef('0x28')?_0x44ced9[_0x0bef('0x27')]:'Unknown';}else{_0x5e549b[_0x0bef('0x17')]=_0x44ced9[_0x0bef('0x2a')]&&_0x44ced9[_0x0bef('0x2a')]!==_0x0bef('0x28')?_0x44ced9[_0x0bef('0x2a')]:_0x0bef('0x29');}_0x572408=_0x5e549b;_0x2b9e62[_0x0bef('0x2e')](_0x5e549b);return;}}})['then'](function(){if(_0xa8abaf){emit(_0x44ced9['uniqueid'],_0x2c7d67,util['format'](_0x0bef('0x2f'),_0xa8abaf[_0x0bef('0x30')]),util[_0x0bef('0x31')]('trigger:%s',_0x229ab6[_0x0bef('0x32')]['toLowerCase']()),{'evt':_[_0x0bef('0x33')](_0x44ced9,{'autoCreate':_0x40759d}),'contact':_0x572408===undefined?{}:_0x572408,'contacts':_0x2b9e62['length']===0x0?undefined:_0x2b9e62});}});}; \ No newline at end of file +var _0x9fcd=['routeId','destcalleridnum','calleridnum','firstName','lastName','mobile','fax','createdAt','updatedAt','union','resolve','then','getContacts','isEmpty','length','[CM][%s][%s]\x20Contact\x20found:%s','uniqueid','[CM][%s][%s]\x20Multiple\x20contacts\x20found:[%s]','join','data4','[CM][%s][%s]\x20Autocreate\x20enabled','calleridname','','Unknown','destcalleridname','createContact','[CM][%s][%s]\x20Contact\x20created:%s','[CM][%s][%s]\x20Autocreate\x20disabled','format','user:%s','name','trigger:%s','action','toLowerCase','merge','ioredis','util','../../../../config/environment','../../../../config/logger','redis','defaults','localhost','socket.io-emitter','info','stringify','emit','data2','isNil','data5','xmd-contactid','data3','split','phone','map'];(function(_0x387026,_0x10ae02){var _0x4fe7ff=function(_0x333a48){while(--_0x333a48){_0x387026['push'](_0x387026['shift']());}};_0x4fe7ff(++_0x10ae02);}(_0x9fcd,0x19d));var _0xd9fc=function(_0x1c5538,_0x5bb7b2){_0x1c5538=_0x1c5538-0x0;var _0x57dad3=_0x9fcd[_0x1c5538];return _0x57dad3;};'use strict';var _=require('lodash');var BPromise=require('bluebird');var Redis=require(_0xd9fc('0x0'));var util=require(_0xd9fc('0x1'));var config=require(_0xd9fc('0x2'));var logger=require(_0xd9fc('0x3'))('trigger');var cmContactRpc=require('../../rpc/cmContact');config[_0xd9fc('0x4')]=_[_0xd9fc('0x5')](config['redis'],{'host':_0xd9fc('0x6'),'port':0x18eb});var io=require(_0xd9fc('0x7'))(new Redis(config[_0xd9fc('0x4')]));function emit(_0x4d41aa,_0x2b2d3e,_0x48730e,_0x15e1e4,_0x5031cb){logger[_0xd9fc('0x8')]('[CM][%s][%s]',_0x4d41aa,_0x2b2d3e['id'],_0x48730e,_0x15e1e4,JSON[_0xd9fc('0x9')](_0x5031cb));io['to'](_0x48730e)[_0xd9fc('0xa')](_0x15e1e4,_0x5031cb);}exports['exec']=function(_0x407bd1,_0x586518,_0x2a7564,_0x14b132){var _0x49760b,_0xf80e67;var _0x357932={};var _0x44bbc3;var _0x325a88=Number(_0x2a7564['data1']);var _0x2ad528=_0x2a7564['data2']?Boolean(Number(_0x2a7564[_0xd9fc('0xb')])):![];var _0x269d20;var _0x34f05e=![];if(!_[_0xd9fc('0xc')](_0x2a7564[_0xd9fc('0xd')])){if(_0x2a7564[_0xd9fc('0xd')]=='1')_0x34f05e=!![];}if(!_0x34f05e){if(_0x14b132[_0xd9fc('0xe')]){_0x357932['id']=_0x14b132[_0xd9fc('0xe')];}}if(!_0x357932['id']){_0x357932['ListId']=_0x325a88;_0x269d20=_0x2a7564['data3']&&_0x2a7564[_0xd9fc('0xf')]!=='0'?_0x2a7564[_0xd9fc('0xf')][_0xd9fc('0x10')](','):[_0xd9fc('0x11')];_0x357932['$or']=_[_0xd9fc('0x12')](_0x269d20,function(_0x1df3ba){var _0x466715={};_0x466715[_0x1df3ba]=_0x14b132[_0xd9fc('0x13')]?_0x14b132[_0xd9fc('0x14')]:_0x14b132[_0xd9fc('0x15')];return _0x466715;});_0x44bbc3=_0x14b132['routeId']?_0x14b132[_0xd9fc('0x14')]:_0x14b132[_0xd9fc('0x15')];}var _0x2852f6=['id',_0xd9fc('0x16'),_0xd9fc('0x17'),_0xd9fc('0x11'),_0xd9fc('0x18'),_0xd9fc('0x19'),'ListId',_0xd9fc('0x1a'),'scheduledAt',_0xd9fc('0x1b')];var _0x8cdf2d=_[_0xd9fc('0x1c')](_0x2852f6,_0x269d20);BPromise[_0xd9fc('0x1d')]()[_0xd9fc('0x1e')](cmContactRpc[_0xd9fc('0x1f')]({'attributes':_0x8cdf2d,'where':_0x357932,'phone':_0x44bbc3}))[_0xd9fc('0x1e')](function(_0xab3e7f){_0xf80e67=_0xab3e7f;if(!_[_0xd9fc('0x20')](_0xf80e67)){if(_0xf80e67[_0xd9fc('0x21')]===0x1){_0x49760b=_0xf80e67[0x0];logger[_0xd9fc('0x8')](_0xd9fc('0x22'),_0x14b132[_0xd9fc('0x23')],_0x586518['id'],_0x49760b['id']);}else{logger[_0xd9fc('0x8')](_0xd9fc('0x24'),_0x14b132['uniqueid'],_0x586518['id'],_[_0xd9fc('0x12')](_0xf80e67,'id')[_0xd9fc('0x25')](','));}return;}else{logger[_0xd9fc('0x8')]('[CM][%s][%s]\x20Contact\x20not\x20found',_0x14b132[_0xd9fc('0x23')],_0x586518['id']);var _0x21b75d={'ListId':_0x325a88};var _0x172e4f=_0x2a7564[_0xd9fc('0x26')]&&_0x2a7564['data4']!=='0'?_0x2a7564['data4']:_0xd9fc('0x11');if(_0x2ad528){logger[_0xd9fc('0x8')](_0xd9fc('0x27'),_0x14b132[_0xd9fc('0x23')],_0x586518['id']);_0x21b75d[_0x172e4f]=_[_0xd9fc('0xc')](_0x14b132[_0xd9fc('0x13')])?_0x14b132['calleridnum']:_0x14b132[_0xd9fc('0x14')];if(_[_0xd9fc('0xc')](_0x14b132['routeId'])){_0x21b75d['firstName']=_0x14b132[_0xd9fc('0x28')]&&_0x14b132[_0xd9fc('0x28')]!==_0xd9fc('0x29')?_0x14b132[_0xd9fc('0x28')]:_0xd9fc('0x2a');}else{_0x21b75d[_0xd9fc('0x16')]=_0x14b132[_0xd9fc('0x2b')]&&_0x14b132[_0xd9fc('0x2b')]!==_0xd9fc('0x29')?_0x14b132[_0xd9fc('0x2b')]:'Unknown';}return BPromise[_0xd9fc('0x1d')]()[_0xd9fc('0x1e')](cmContactRpc[_0xd9fc('0x2c')](_0x21b75d))[_0xd9fc('0x1e')](function(_0xce131e){_0x49760b=_0xce131e;_0xf80e67['push'](_0xce131e);if(_0x49760b){logger[_0xd9fc('0x8')](_0xd9fc('0x2d'),_0x14b132[_0xd9fc('0x23')],_0x586518['id'],_0x49760b['id']);}return;});}else{logger['info'](_0xd9fc('0x2e'),_0x14b132[_0xd9fc('0x23')],_0x586518['id']);_0x21b75d[_0x172e4f]=_[_0xd9fc('0xc')](_0x14b132['routeId'])?_0x14b132['calleridnum']:_0x14b132[_0xd9fc('0x14')];if(_[_0xd9fc('0xc')](_0x14b132['routeId'])){_0x21b75d[_0xd9fc('0x16')]=_0x14b132[_0xd9fc('0x28')]&&_0x14b132[_0xd9fc('0x28')]!==_0xd9fc('0x29')?_0x14b132[_0xd9fc('0x28')]:_0xd9fc('0x2a');}else{_0x21b75d[_0xd9fc('0x16')]=_0x14b132[_0xd9fc('0x2b')]&&_0x14b132[_0xd9fc('0x2b')]!==_0xd9fc('0x29')?_0x14b132[_0xd9fc('0x2b')]:'Unknown';}_0x49760b=_0x21b75d;_0xf80e67['push'](_0x21b75d);return;}}})[_0xd9fc('0x1e')](function(){if(_0x407bd1){emit(_0x14b132['uniqueid'],_0x586518,util[_0xd9fc('0x2f')](_0xd9fc('0x30'),_0x407bd1[_0xd9fc('0x31')]),util[_0xd9fc('0x2f')](_0xd9fc('0x32'),_0x2a7564[_0xd9fc('0x33')][_0xd9fc('0x34')]()),{'evt':_[_0xd9fc('0x35')](_0x14b132,{'autoCreate':_0x2ad528}),'contact':_0x49760b===undefined?{}:_0x49760b,'contacts':_0xf80e67[_0xd9fc('0x21')]===0x0?undefined:_0xf80e67});}});}; \ No newline at end of file diff --git a/server/services/ami/trigger/index.js b/server/services/ami/trigger/index.js index 54e1973..7215b3b 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 _0x7785=['urlforward','script','buildUri','replace','channel','length','every','AllConditions','checkConditions','some','AnyConditions','checkTrigger:\x20trigger','evt','account','ChatWebsiteId','operator','value','AccountId','interaction','message','event','agent','membername','lastevent','mailSubstatus','substatus','created','exports','url','mustache','./urlforward','./integration','../../../config/logger','../ami','redis','defaults','localhost','socket.io-emitter','triggers','agents','voiceQueues','templates','voiceExtensions','zendeskAccounts','freshdeskAccounts','salesforceAccounts','sugarcrmAccounts','zohoAccounts','deskAccounts','vtigerAccounts','servicenowAccounts','dynamics365Accounts','freshsalesAccounts','accounts','custom:agentcalled','syncCustomEvent','custom:agentconnect','bind','custom:agentnosuchnumber','custom:agentbusy','custom:agentcongestion','custom:agentreject','custom:amd','custom:queuecallerabandon','custom:timeout','syncAgentDial','custom:dialend','custom:newinteraction','custom:substatus','custom:acceptmessage','custom:rejectmessage','prototype','emit','info','clone','motionChannel','undefined','voice','debug','inspect','checkTriggers','interface','hasOwnProperty','status','checkTrigger','merge','Actions','action','contactmanager','motionbar','browser','data2','html','render','uri','isNil','data3','data4','location','data5','data6','600','winapp','winApplication','winArguments','format','user:%s','name','trigger:%s:%s','toLowerCase','data1','trigger:%s','exec','integration','queue','routeId'];(function(_0x5d8907,_0x5e11ba){var _0x48037b=function(_0x8422fb){while(--_0x8422fb){_0x5d8907['push'](_0x5d8907['shift']());}};_0x48037b(++_0x5e11ba);}(_0x7785,0x104));var _0x5778=function(_0x316ef9,_0x1b7dbe){_0x316ef9=_0x316ef9-0x0;var _0x5b21dc=_0x7785[_0x316ef9];return _0x5b21dc;};'use strict';var util=require('util');var _=require('lodash');var url=require(_0x5778('0x0'));var Mustache=require(_0x5778('0x1'));var Redis=require('ioredis');var urlforward=require(_0x5778('0x2'));var integration=require(_0x5778('0x3'));var cmContact=require('./cmContact');var script=require('./script');var config=require('../../../config/environment');var logger=require(_0x5778('0x4'))('trigger');var ami=require(_0x5778('0x5'));config[_0x5778('0x6')]=_[_0x5778('0x7')](config[_0x5778('0x6')],{'host':_0x5778('0x8'),'port':0x18eb});var io=require(_0x5778('0x9'))(new Redis(config[_0x5778('0x6')]));var operators={'equals':function(_0x24f14d,_0x22e243){return _0x24f14d==_0x22e243;},'not_equals':function(_0x4acc1d,_0x3f84df){return _0x4acc1d!=_0x3f84df;}};var barAndWebActions=['popup',_0x5778('0x0'),'winapp'];function Trigger(_0x30d753){this[_0x5778('0xa')]=_0x30d753['triggers'];this[_0x5778('0xb')]=_0x30d753[_0x5778('0xb')];this[_0x5778('0xc')]=_0x30d753['voiceQueues'];this[_0x5778('0xd')]=_0x30d753[_0x5778('0xd')];this[_0x5778('0xe')]=_0x30d753[_0x5778('0xe')];this[_0x5778('0xf')]=_0x30d753['zendeskAccounts'];this[_0x5778('0x10')]=_0x30d753[_0x5778('0x10')];this[_0x5778('0x11')]=_0x30d753[_0x5778('0x11')];this[_0x5778('0x12')]=_0x30d753['sugarcrmAccounts'];this[_0x5778('0x13')]=_0x30d753[_0x5778('0x13')];this['deskAccounts']=_0x30d753[_0x5778('0x14')];this[_0x5778('0x15')]=_0x30d753[_0x5778('0x15')];this[_0x5778('0x16')]=_0x30d753[_0x5778('0x16')];this['dynamics365Accounts']=_0x30d753[_0x5778('0x17')];this[_0x5778('0x18')]=_0x30d753[_0x5778('0x18')];this[_0x5778('0x19')]={'zendesk':this[_0x5778('0xf')],'salesforce':this[_0x5778('0x11')],'freshdesk':this[_0x5778('0x10')],'sugarcrm':this[_0x5778('0x12')],'zoho':this[_0x5778('0x13')],'desk':this[_0x5778('0x14')],'vtiger':this[_0x5778('0x15')],'dynamics365':this[_0x5778('0x17')],'freshsales':this[_0x5778('0x18')],'servicenow':this['servicenowAccounts']};ami['on'](_0x5778('0x1a'),this[_0x5778('0x1b')]['bind'](this));ami['on'](_0x5778('0x1c'),this['syncCustomEvent']['bind'](this));ami['on']('custom:agentringnoanswer',this['syncCustomEvent'][_0x5778('0x1d')](this));ami['on']('custom:agentcomplete',this['syncCustomEvent'][_0x5778('0x1d')](this));ami['on'](_0x5778('0x1e'),this['syncCustomEvent'][_0x5778('0x1d')](this));ami['on']('custom:agentnoanswer',this[_0x5778('0x1b')][_0x5778('0x1d')](this));ami['on'](_0x5778('0x1f'),this['syncCustomEvent'][_0x5778('0x1d')](this));ami['on'](_0x5778('0x20'),this[_0x5778('0x1b')][_0x5778('0x1d')](this));ami['on'](_0x5778('0x21'),this[_0x5778('0x1b')][_0x5778('0x1d')](this));ami['on'](_0x5778('0x22'),this[_0x5778('0x1b')][_0x5778('0x1d')](this));ami['on'](_0x5778('0x23'),this[_0x5778('0x1b')]['bind'](this));ami['on'](_0x5778('0x24'),this[_0x5778('0x1b')]['bind'](this));ami['on']('custom:dialbegin',this[_0x5778('0x25')][_0x5778('0x1d')](this));ami['on']('custom:dialconnect',this[_0x5778('0x25')][_0x5778('0x1d')](this));ami['on'](_0x5778('0x26'),this['syncAgentDial'][_0x5778('0x1d')](this));ami['on'](_0x5778('0x27'),this['syncCustomEvent'][_0x5778('0x1d')](this));ami['on']('custom:closedinteraction',this[_0x5778('0x1b')][_0x5778('0x1d')](this));ami['on'](_0x5778('0x28'),this[_0x5778('0x1b')]['bind'](this));ami['on']('custom:incomingmessage',this['syncCustomEvent'][_0x5778('0x1d')](this));ami['on']('custom:outgoingmessage',this[_0x5778('0x1b')][_0x5778('0x1d')](this));ami['on'](_0x5778('0x29'),this[_0x5778('0x1b')][_0x5778('0x1d')](this));ami['on'](_0x5778('0x2a'),this[_0x5778('0x1b')][_0x5778('0x1d')](this));ami['on']('custom:offlineMessage',this[_0x5778('0x1b')]['bind'](this));}Trigger[_0x5778('0x2b')][_0x5778('0x2c')]=function(_0x285ccd,_0xbf9cf8,_0x3d3a0c){logger[_0x5778('0x2d')](_0x285ccd,_0xbf9cf8,JSON['stringify'](_0x3d3a0c));io['to'](_0x285ccd)[_0x5778('0x2c')](_0xbf9cf8,_0x3d3a0c);};Trigger[_0x5778('0x2b')][_0x5778('0x1b')]=function(_0x4e3806){var _0xc85e25=_[_0x5778('0x2e')](_0x4e3806);if(typeof _0xc85e25[_0x5778('0x2f')]===_0x5778('0x30')){_0xc85e25[_0x5778('0x2f')]=_0x5778('0x31');}logger[_0x5778('0x32')](_0x5778('0x1b'),util[_0x5778('0x33')](_0xc85e25,{'showHidden':!![],'depth':null}));this[_0x5778('0x34')](_0xc85e25);};Trigger['prototype'][_0x5778('0x25')]=function(_0x3f85ba){if(this[_0x5778('0xb')][_0x3f85ba[_0x5778('0x35')]]){this[_0x5778('0x1b')](_0x3f85ba);}};Trigger[_0x5778('0x2b')]['checkTriggers']=function(_0x2697f){var _0x2f7d12;for(var _0x486369 in this['triggers']){if(this['triggers'][_0x5778('0x36')](_0x486369)){if(this[_0x5778('0xa')][_0x486369][_0x5778('0x37')]){_0x2f7d12=this[_0x5778('0x38')](this['triggers'][_0x486369],_0x2697f);if(_0x2f7d12){_[_0x5778('0x39')](_0x2697f,_0x2697f['variables']);for(var _0x217e31=0x0,_0x23039d,_0x1ea7d1,_0x512e98;_0x217e310x0){_0x1c9f6b=_['map'](_0x430d55,_0x28814f);}return _0x1c9f6b;}function getCustomFields(_0x1377b0,_0x22f6b6){var _0x1b8388=[];var _0x201941={'custom_fields':{}};if(_0x1377b0[_0xa55c('0x28')]>0x0){_[_0xa55c('0x29')](_0x1377b0,function(_0x52d37f){if(_[_0xa55c('0x2a')](['string',_0xa55c('0x2b')],_0x52d37f[_0xa55c('0x2c')])&&_0x52d37f[_0xa55c('0x2d')]&&!_0x52d37f[_0xa55c('0x2e')]){_0x201941[_0x52d37f['nameField'][_0xa55c('0x2f')]()]=_0x52d37f[_0xa55c('0x30')][_0xa55c('0x1f')]();}else if(_[_0xa55c('0x2a')]([_0xa55c('0x31'),_0xa55c('0x2b')],_0x52d37f[_0xa55c('0x2c')])&&_0x52d37f[_0xa55c('0x32')]&&_0x52d37f[_0xa55c('0x2e')]){_0x201941[_0xa55c('0x33')][_0x52d37f[_0xa55c('0x32')]]=_0x52d37f['content']['toString']();}else if(_0x52d37f[_0xa55c('0x2c')]===_0xa55c('0x34')&&_0x52d37f['variableName']&&_0x52d37f[_0xa55c('0x32')]&&_0x52d37f[_0xa55c('0x2e')]){_0x22f6b6[_0x52d37f[_0xa55c('0x35')]]&&(_0x201941[_0xa55c('0x33')][_0x52d37f[_0xa55c('0x32')]]=_0x22f6b6[_0x52d37f[_0xa55c('0x35')]][_0xa55c('0x1f')]());}else if(_0x52d37f[_0xa55c('0x2c')]===_0xa55c('0x36')&&_0x52d37f['Variable']&&_0x52d37f['Variable']['name']&&_0x52d37f[_0xa55c('0x32')]&&_0x52d37f[_0xa55c('0x2e')]){_0x22f6b6[_0x52d37f[_0xa55c('0x37')]['name'][_0xa55c('0x2f')]()]&&(_0x201941['custom_fields'][_0x52d37f[_0xa55c('0x32')]]=_0x22f6b6[_0x52d37f['Variable'][_0xa55c('0x38')][_0xa55c('0x2f')]()][_0xa55c('0x1f')]());}});}if(_0x201941['priority']){_0x201941[_0xa55c('0x39')]=Number(_0x201941[_0xa55c('0x39')]);}return _0x201941;}function getTicket(_0x47e93c,_0x6f9c4c,_0x194e78,_0x4d9083,_0x529ff8){logger[_0xa55c('0xb')]('Creating\x20new\x20ticket...');var _0x1e75dc=_[_0xa55c('0x3a')]({'subject':intUtil['getString'](_0x4d9083['Subjects'],_0x529ff8,'\x20'),'type':'phone','status':'new','labels':[_0xa55c('0x3b'),_0xa55c('0x3c'),_0xa55c('0x3d')][_0xa55c('0x3e')](getTags(_0x4d9083[_0xa55c('0x3f')],'name')),'description':intUtil[_0xa55c('0x40')](_0x4d9083[_0xa55c('0x41')],_0x529ff8,'\x0a'),'_links':{'assigned_user':{'href':util[_0xa55c('0xd')](_0xa55c('0x42'),_0x6f9c4c['id']),'class':_0xa55c('0x43')}},'message':{'direction':'in','body':intUtil[_0xa55c('0x40')](_0x4d9083['Descriptions'],_0x529ff8,'\x0a')}},getCustomFields(_0x4d9083[_0xa55c('0x44')],_0x529ff8));return request({'uri':util['format']('%s/customers/%d/cases',_0x47e93c[_0xa55c('0xf')],_0x194e78['id']),'method':_0xa55c('0x27'),'body':_0x1e75dc});}exports['queue']=function(_0x2bd98b,_0x508bd3,_0x5f25f7,_0x2f8449,_0x3fea03,_0x1630ac){var _0x540337,_0x1b2708;_0x1630ac[_0xa55c('0xf')]=intUtil['stripTrailingSlash'](_0x1630ac[_0xa55c('0xf')]);_0x1630ac['serverUrl']=intUtil[_0xa55c('0x45')](_0x1630ac[_0xa55c('0x46')]);if(_0x3fea03&&_0x3fea03['monitor_format']){logger[_0xa55c('0xb')](_0xa55c('0x47'),'Recording\x20is\x20enabled!');_0x508bd3[_0xa55c('0x48')]=util[_0xa55c('0xd')](_0xa55c('0x49'),_0x1630ac['serverUrl'],_0x508bd3[_0xa55c('0x4a')],md5(_0x508bd3['uniqueid']));}else{_0x508bd3[_0xa55c('0x48')]='';}headers[_0xa55c('0x4b')]=getAuth(_0x1630ac);return getUser(_0x1630ac,_0x2f8449[_0xa55c('0x4c')])['then'](function(_0x41eab1){_0x540337=_0x41eab1;logger[_0xa55c('0xb')]('The\x20User\x20ID\x20is:',_0x540337['id']);return getEndUser(_0x1630ac,_0x508bd3[_0xa55c('0x4d')],_0x508bd3[_0xa55c('0x4e')]);})['then'](function(_0x11ff1d){_0x1b2708=_0x11ff1d;logger[_0xa55c('0xb')]('The\x20Enduser\x20ID\x20is:',_0x1b2708['id']);return getTicket(_0x1630ac,_0x540337,_0x1b2708,_0x5f25f7,_0x508bd3);})[_0xa55c('0x10')](function(_0x81cee8){if(_0x81cee8){logger[_0xa55c('0xb')](_0xa55c('0x4f'));logger['info'](_0xa55c('0x50'),_0x81cee8['id']);switch(_0x1630ac['type']){case _0xa55c('0x51'):logger[_0xa55c('0xb')](_0xa55c('0x47'),'Displaying\x20ticket\x20to\x20agent...');emit(util[_0xa55c('0xd')](_0xa55c('0x52'),_0x2f8449['name']),_0xa55c('0x53'),{'recordId':_0x81cee8['id']});break;case _0xa55c('0x54'):logger[_0xa55c('0xb')](_0xa55c('0x47'),_0xa55c('0x55'));emit(util[_0xa55c('0xd')](_0xa55c('0x52'),_0x2f8449[_0xa55c('0x38')]),_0xa55c('0x56'),{'uri':util[_0xa55c('0xd')]('https://xcally.desk.com/web/agent/case/%d',_0x81cee8['id'])});break;default:logger[_0xa55c('0x57')](_0xa55c('0x47'),_0xa55c('0x58'));}}})['catch'](function(_0x4c3095){console[_0xa55c('0x57')](_0x4c3095);logger['error'](_0xa55c('0x47'),JSON['stringify'](_0x4c3095));});};exports[_0xa55c('0x59')]=function(_0x228df4,_0x181802,_0x3f9313,_0x2ecf79,_0x5b1cf3,_0x44b7c1,_0x4607ca){var _0x4b85cc,_0x3929a6;_0x44b7c1[_0xa55c('0xf')]=intUtil[_0xa55c('0x45')](_0x44b7c1[_0xa55c('0xf')]);_0x44b7c1['serverUrl']=intUtil['stripTrailingSlash'](_0x44b7c1[_0xa55c('0x46')]);if(_0x4607ca&&_0x4607ca[_0xa55c('0x5a')]&&_0x4607ca[_0xa55c('0x5a')]!==_0xa55c('0x5b')){logger['info'](_0xa55c('0x5c'),'Recording\x20is\x20enabled!');_0x181802[_0xa55c('0x48')]=util[_0xa55c('0xd')](_0xa55c('0x49'),_0x44b7c1[_0xa55c('0x46')],_0x181802[_0xa55c('0x4a')],md5(_0x181802['uniqueid']));}headers[_0xa55c('0x4b')]=getAuth(_0x44b7c1);return getUser(_0x44b7c1,_0x2ecf79['email'])[_0xa55c('0x10')](function(_0x157afe){_0x4b85cc=_0x157afe;logger[_0xa55c('0xb')](_0xa55c('0x5d'),_0x4b85cc['id']);return getEndUser(_0x44b7c1,_0x181802[_0xa55c('0x5e')],_0x181802[_0xa55c('0x5f')]);})[_0xa55c('0x10')](function(_0x53e2be){_0x3929a6=_0x53e2be;logger[_0xa55c('0xb')](_0xa55c('0x60'),_0x3929a6['id']);return getTicket(_0x44b7c1,_0x4b85cc,_0x3929a6,_0x3f9313,_0x181802);})[_0xa55c('0x10')](function(_0x23a30e){if(_0x23a30e){logger[_0xa55c('0xb')]('Ticket\x20created!');logger[_0xa55c('0xb')](_0xa55c('0x50'),_0x23a30e['id']);switch(_0x44b7c1[_0xa55c('0x2c')]){case _0xa55c('0x51'):logger[_0xa55c('0xb')]('[QUEUE]',_0xa55c('0x61'));emit(util[_0xa55c('0xd')](_0xa55c('0x52'),_0x2ecf79[_0xa55c('0x38')]),_0xa55c('0x53'),{'recordId':_0x23a30e['id']});break;case'newTab':logger[_0xa55c('0xb')]('[QUEUE]',_0xa55c('0x55'));emit(util['format'](_0xa55c('0x52'),_0x2ecf79['name']),_0xa55c('0x56'),{'uri':util[_0xa55c('0xd')](_0xa55c('0x62'),_0x44b7c1[_0xa55c('0xf')],_0x23a30e['id'])});break;default:logger[_0xa55c('0x57')](_0xa55c('0x5c'),_0xa55c('0x58'));}}})[_0xa55c('0x63')](function(_0x14b515){logger[_0xa55c('0x57')]('[OUTBOUND]',JSON[_0xa55c('0x17')](_0x14b515));});};exports[_0xa55c('0x64')]=function(_0x4ef914,_0x18b928,_0x2b8b88,_0x3e3b4b,_0x9fe234,_0x1b8b06){var _0xa38271,_0x3cef1f;_0x1b8b06[_0xa55c('0xf')]=intUtil['stripTrailingSlash'](_0x1b8b06[_0xa55c('0xf')]);_0x1b8b06[_0xa55c('0x46')]=intUtil[_0xa55c('0x45')](_0x1b8b06[_0xa55c('0x46')]);if(_0x9fe234&&_0x9fe234[_0xa55c('0x65')]){logger[_0xa55c('0xb')]('['+_0x18b928[_0xa55c('0x66')][_0xa55c('0x67')]()+']',_0xa55c('0x68'));_0x18b928['recordingURL']=util[_0xa55c('0xd')](_0xa55c('0x49'),_0x1b8b06[_0xa55c('0x46')],_0x18b928[_0xa55c('0x4a')],md5(_0x18b928[_0xa55c('0x4a')]));}else{_0x18b928[_0xa55c('0x48')]='';}headers[_0xa55c('0x4b')]=getAuth(_0x1b8b06);return getUser(_0x1b8b06)[_0xa55c('0x10')](function(_0x2e4cf7){_0xa38271=_0x2e4cf7;logger[_0xa55c('0xb')](_0xa55c('0x5d'),_0xa38271['id']);return getEndUser(_0x1b8b06,_0x18b928['calleridname'],_0x18b928[_0xa55c('0x4e')]);})['then'](function(_0x1228a4){_0x3cef1f=_0x1228a4;logger[_0xa55c('0xb')](_0xa55c('0x60'),_0x3cef1f['id']);return getTicket(_0x1b8b06,_0xa38271,_0x3cef1f,_0x2b8b88,_0x18b928);})['then'](function(_0x4d9722){if(_0x4d9722){logger[_0xa55c('0xb')](_0xa55c('0x4f'));logger[_0xa55c('0xb')](_0xa55c('0x50'),_0x4d9722['id']);}})['catch'](function(_0x149cb9){logger[_0xa55c('0x57')]('['+_0x18b928[_0xa55c('0x66')][_0xa55c('0x67')]()+']',JSON[_0xa55c('0x17')](_0x149cb9));});}; \ No newline at end of file +var _0xe14b=['CTI','concat','Tags','Descriptions','/api/v2/users/%d','user','%s/customers/%d/cases','serverUrl','stripTrailingSlash','monitor_format','[QUEUE]','Recording\x20is\x20enabled!','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','uniqueid','recordingURL','The\x20User\x20ID\x20is:','calleridnum','The\x20Enduser\x20ID\x20is:','The\x20Ticket\x20ID\x20is:','Displaying\x20ticket\x20to\x20agent...','user:%s','trigger:desk:display','Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...','trigger:browser:url','https://xcally.desk.com/web/agent/case/%d','error','Desk\x20account\x20type\x20not\x20recognized','recordingFormat','none','[OUTBOUND]','Authorization','destcalleridname','destcalleridnum','integrationTab','newTab','catch','unmanaged','lastevent','toUpperCase','calleridname','lodash','request-promise','ioredis','./util','../../../../config/logger','defaults','redis','localhost','socket.io-emitter','application/json','validateEmail','format','%s/users','then','total_entries','find','_embedded','entries','info','Agent\x20found!','Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!','Invalid\x20email\x20format,\x20using\x20the\x20admin\x20account!','%s/users/me','debug','[HTTP]','stringify','GET','authType','basic','%s:%s','username','password','token','%s/token:%s','Basic\x20%s','base64','Searching\x20enduser\x20with\x20phone','%s/customers/search','Enduser\x20found!','%s/customers','remoteUri','POST','length','map','forEach','includes','string','picklist','type','nameField','customField','toLowerCase','content','toString','idField','variableName','custom_fields','Variable','name','priority','Creating\x20new\x20ticket...','merge','getString','Subjects','phone','new','xCALLY'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0xe14b,0x93));var _0xbe14=function(_0x31bd9d,_0x147017){_0x31bd9d=_0x31bd9d-0x0;var _0x3c58ec=_0xe14b[_0x31bd9d];return _0x3c58ec;};'use strict';var _=require(_0xbe14('0x0'));var rp=require(_0xbe14('0x1'));var md5=require('md5');var util=require('util');var Redis=require(_0xbe14('0x2'));var intUtil=require(_0xbe14('0x3'));var config=require('../../../../config/environment');var logger=require(_0xbe14('0x4'))('desk');config['redis']=_[_0xbe14('0x5')](config[_0xbe14('0x6')],{'host':_0xbe14('0x7'),'port':0x18eb});var io=require(_0xbe14('0x8'))(new Redis(config[_0xbe14('0x6')]));function emit(_0x39387e,_0x196fca,_0x566ae7){io['to'](_0x39387e)['emit'](_0x196fca,_0x566ae7);}var headers={'Content-Type':'application/json','Accept':_0xbe14('0x9')};function getUser(_0x6fceff,_0xd68cd7){if(intUtil[_0xbe14('0xa')](_0xd68cd7)===!![]){logger['info']('Getting\x20agent\x20with\x20email',_0xd68cd7);return request({'uri':util[_0xbe14('0xb')](_0xbe14('0xc'),_0x6fceff['remoteUri'])})[_0xbe14('0xd')](function(_0x35aa19){if(_0x35aa19[_0xbe14('0xe')]){return _[_0xbe14('0xf')](_0x35aa19[_0xbe14('0x10')][_0xbe14('0x11')],{'email':_0xd68cd7});}})[_0xbe14('0xd')](function(_0x2850cb){if(_0x2850cb){logger[_0xbe14('0x12')](_0xbe14('0x13'));return _0x2850cb;}else{logger[_0xbe14('0x12')](_0xbe14('0x14'));return request({'uri':util[_0xbe14('0xb')]('%s/users/me',_0x6fceff['remoteUri'])});}});}else{logger[_0xbe14('0x12')](_0xbe14('0x15'));return request({'uri':util[_0xbe14('0xb')](_0xbe14('0x16'),_0x6fceff['remoteUri'])});}}function request(_0x21c789){logger[_0xbe14('0x17')](_0xbe14('0x18'),JSON[_0xbe14('0x19')](_0x21c789));return rp(_[_0xbe14('0x5')](_0x21c789,{'method':_0xbe14('0x1a'),'headers':headers,'json':!![]}));}function getAuth(_0x17ae86){var _0x5ea1f8;if(_0x17ae86[_0xbe14('0x1b')]===_0xbe14('0x1c')){_0x5ea1f8=util[_0xbe14('0xb')](_0xbe14('0x1d'),_0x17ae86[_0xbe14('0x1e')],_0x17ae86[_0xbe14('0x1f')]);}else if(_0x17ae86['authType']===_0xbe14('0x20')){_0x5ea1f8=util[_0xbe14('0xb')](_0xbe14('0x21'),_0x17ae86[_0xbe14('0x1e')],_0x17ae86[_0xbe14('0x20')]);}return util['format'](_0xbe14('0x22'),new Buffer(_0x5ea1f8)['toString'](_0xbe14('0x23')));}function getEndUser(_0x56e80c,_0x32e8eb,_0x4a25fa){logger[_0xbe14('0x12')](_0xbe14('0x24'),_0x4a25fa);return request({'uri':util['format'](_0xbe14('0x25'),_0x56e80c['remoteUri']),'qs':{'phone':_0x4a25fa}})[_0xbe14('0xd')](function(_0x4851f8){if(_0x4851f8[_0xbe14('0xe')]){logger[_0xbe14('0x12')](_0xbe14('0x26'));return _0x4851f8[_0xbe14('0x10')][_0xbe14('0x11')][0x0];}else{logger[_0xbe14('0x12')]('Enduser\x20not\x20found,\x20creating\x20a\x20new\x20enduser!');return request({'uri':util[_0xbe14('0xb')](_0xbe14('0x27'),_0x56e80c[_0xbe14('0x28')]),'method':_0xbe14('0x29'),'body':{'first_name':_0x32e8eb,'title':_0x32e8eb,'phone_numbers':[{'type':'work','value':_0x4a25fa}]}});}});}function getTags(_0x16f884,_0x29fc64){var _0x59bf34=[];if(_0x16f884&&_0x16f884[_0xbe14('0x2a')]>0x0){_0x59bf34=_[_0xbe14('0x2b')](_0x16f884,_0x29fc64);}return _0x59bf34;}function getCustomFields(_0x1c7cc7,_0x19252f){var _0x34d648=[];var _0x36d4b2={'custom_fields':{}};if(_0x1c7cc7[_0xbe14('0x2a')]>0x0){_[_0xbe14('0x2c')](_0x1c7cc7,function(_0x4168c8){if(_[_0xbe14('0x2d')]([_0xbe14('0x2e'),_0xbe14('0x2f')],_0x4168c8[_0xbe14('0x30')])&&_0x4168c8[_0xbe14('0x31')]&&!_0x4168c8[_0xbe14('0x32')]){_0x36d4b2[_0x4168c8[_0xbe14('0x31')][_0xbe14('0x33')]()]=_0x4168c8[_0xbe14('0x34')][_0xbe14('0x35')]();}else if(_[_0xbe14('0x2d')](['string',_0xbe14('0x2f')],_0x4168c8['type'])&&_0x4168c8['idField']&&_0x4168c8[_0xbe14('0x32')]){_0x36d4b2['custom_fields'][_0x4168c8[_0xbe14('0x36')]]=_0x4168c8[_0xbe14('0x34')]['toString']();}else if(_0x4168c8['type']==='variable'&&_0x4168c8[_0xbe14('0x37')]&&_0x4168c8[_0xbe14('0x36')]&&_0x4168c8['customField']){_0x19252f[_0x4168c8[_0xbe14('0x37')]]&&(_0x36d4b2[_0xbe14('0x38')][_0x4168c8[_0xbe14('0x36')]]=_0x19252f[_0x4168c8[_0xbe14('0x37')]][_0xbe14('0x35')]());}else if(_0x4168c8['type']==='customVariable'&&_0x4168c8[_0xbe14('0x39')]&&_0x4168c8['Variable']['name']&&_0x4168c8['idField']&&_0x4168c8[_0xbe14('0x32')]){_0x19252f[_0x4168c8[_0xbe14('0x39')][_0xbe14('0x3a')][_0xbe14('0x33')]()]&&(_0x36d4b2[_0xbe14('0x38')][_0x4168c8[_0xbe14('0x36')]]=_0x19252f[_0x4168c8[_0xbe14('0x39')][_0xbe14('0x3a')][_0xbe14('0x33')]()][_0xbe14('0x35')]());}});}if(_0x36d4b2[_0xbe14('0x3b')]){_0x36d4b2[_0xbe14('0x3b')]=Number(_0x36d4b2['priority']);}return _0x36d4b2;}function getTicket(_0x4f51f8,_0x43cdaa,_0x2951e1,_0x13bfcf,_0x520e09){logger[_0xbe14('0x12')](_0xbe14('0x3c'));var _0xeda70e=_[_0xbe14('0x3d')]({'subject':intUtil[_0xbe14('0x3e')](_0x13bfcf[_0xbe14('0x3f')],_0x520e09,'\x20'),'type':_0xbe14('0x40'),'status':_0xbe14('0x41'),'labels':[_0xbe14('0x42'),'Motion',_0xbe14('0x43')][_0xbe14('0x44')](getTags(_0x13bfcf[_0xbe14('0x45')],_0xbe14('0x3a'))),'description':intUtil[_0xbe14('0x3e')](_0x13bfcf[_0xbe14('0x46')],_0x520e09,'\x0a'),'_links':{'assigned_user':{'href':util['format'](_0xbe14('0x47'),_0x43cdaa['id']),'class':_0xbe14('0x48')}},'message':{'direction':'in','body':intUtil[_0xbe14('0x3e')](_0x13bfcf[_0xbe14('0x46')],_0x520e09,'\x0a')}},getCustomFields(_0x13bfcf['Fields'],_0x520e09));return request({'uri':util['format'](_0xbe14('0x49'),_0x4f51f8[_0xbe14('0x28')],_0x2951e1['id']),'method':_0xbe14('0x29'),'body':_0xeda70e});}exports['queue']=function(_0x5d5318,_0x6b6aa8,_0x59ae4d,_0x5657fe,_0x3593f8,_0x1f0355){var _0x8216c3,_0x5051e4;_0x1f0355['remoteUri']=intUtil['stripTrailingSlash'](_0x1f0355[_0xbe14('0x28')]);_0x1f0355[_0xbe14('0x4a')]=intUtil[_0xbe14('0x4b')](_0x1f0355['serverUrl']);if(_0x3593f8&&_0x3593f8[_0xbe14('0x4c')]){logger[_0xbe14('0x12')](_0xbe14('0x4d'),_0xbe14('0x4e'));_0x6b6aa8['recordingURL']=util['format'](_0xbe14('0x4f'),_0x1f0355[_0xbe14('0x4a')],_0x6b6aa8[_0xbe14('0x50')],md5(_0x6b6aa8[_0xbe14('0x50')]));}else{_0x6b6aa8[_0xbe14('0x51')]='';}headers['Authorization']=getAuth(_0x1f0355);return getUser(_0x1f0355,_0x5657fe['email'])[_0xbe14('0xd')](function(_0x2a3623){_0x8216c3=_0x2a3623;logger[_0xbe14('0x12')](_0xbe14('0x52'),_0x8216c3['id']);return getEndUser(_0x1f0355,_0x6b6aa8['calleridname'],_0x6b6aa8[_0xbe14('0x53')]);})[_0xbe14('0xd')](function(_0x53e8ab){_0x5051e4=_0x53e8ab;logger[_0xbe14('0x12')](_0xbe14('0x54'),_0x5051e4['id']);return getTicket(_0x1f0355,_0x8216c3,_0x5051e4,_0x59ae4d,_0x6b6aa8);})[_0xbe14('0xd')](function(_0x36c20c){if(_0x36c20c){logger['info']('Ticket\x20created!');logger[_0xbe14('0x12')](_0xbe14('0x55'),_0x36c20c['id']);switch(_0x1f0355['type']){case'integrationTab':logger[_0xbe14('0x12')](_0xbe14('0x4d'),_0xbe14('0x56'));emit(util[_0xbe14('0xb')](_0xbe14('0x57'),_0x5657fe[_0xbe14('0x3a')]),_0xbe14('0x58'),{'recordId':_0x36c20c['id']});break;case'newTab':logger[_0xbe14('0x12')](_0xbe14('0x4d'),_0xbe14('0x59'));emit(util[_0xbe14('0xb')](_0xbe14('0x57'),_0x5657fe['name']),_0xbe14('0x5a'),{'uri':util[_0xbe14('0xb')](_0xbe14('0x5b'),_0x36c20c['id'])});break;default:logger[_0xbe14('0x5c')](_0xbe14('0x4d'),_0xbe14('0x5d'));}}})['catch'](function(_0x5aeea9){console[_0xbe14('0x5c')](_0x5aeea9);logger[_0xbe14('0x5c')](_0xbe14('0x4d'),JSON['stringify'](_0x5aeea9));});};exports['outbound']=function(_0x44fe0d,_0x134878,_0x50d78f,_0x339a86,_0x32496a,_0x50c2a0,_0x28f995){var _0x4a40d2,_0x41ba58;_0x50c2a0[_0xbe14('0x28')]=intUtil[_0xbe14('0x4b')](_0x50c2a0['remoteUri']);_0x50c2a0[_0xbe14('0x4a')]=intUtil[_0xbe14('0x4b')](_0x50c2a0['serverUrl']);if(_0x28f995&&_0x28f995[_0xbe14('0x5e')]&&_0x28f995[_0xbe14('0x5e')]!==_0xbe14('0x5f')){logger[_0xbe14('0x12')](_0xbe14('0x60'),'Recording\x20is\x20enabled!');_0x134878[_0xbe14('0x51')]=util[_0xbe14('0xb')](_0xbe14('0x4f'),_0x50c2a0[_0xbe14('0x4a')],_0x134878[_0xbe14('0x50')],md5(_0x134878[_0xbe14('0x50')]));}headers[_0xbe14('0x61')]=getAuth(_0x50c2a0);return getUser(_0x50c2a0,_0x339a86['email'])[_0xbe14('0xd')](function(_0x1b47a4){_0x4a40d2=_0x1b47a4;logger[_0xbe14('0x12')](_0xbe14('0x52'),_0x4a40d2['id']);return getEndUser(_0x50c2a0,_0x134878[_0xbe14('0x62')],_0x134878[_0xbe14('0x63')]);})[_0xbe14('0xd')](function(_0x32df3c){_0x41ba58=_0x32df3c;logger[_0xbe14('0x12')](_0xbe14('0x54'),_0x41ba58['id']);return getTicket(_0x50c2a0,_0x4a40d2,_0x41ba58,_0x50d78f,_0x134878);})[_0xbe14('0xd')](function(_0x4bccfc){if(_0x4bccfc){logger['info']('Ticket\x20created!');logger[_0xbe14('0x12')](_0xbe14('0x55'),_0x4bccfc['id']);switch(_0x50c2a0[_0xbe14('0x30')]){case _0xbe14('0x64'):logger[_0xbe14('0x12')](_0xbe14('0x4d'),_0xbe14('0x56'));emit(util[_0xbe14('0xb')](_0xbe14('0x57'),_0x339a86[_0xbe14('0x3a')]),_0xbe14('0x58'),{'recordId':_0x4bccfc['id']});break;case _0xbe14('0x65'):logger[_0xbe14('0x12')](_0xbe14('0x4d'),_0xbe14('0x59'));emit(util[_0xbe14('0xb')](_0xbe14('0x57'),_0x339a86[_0xbe14('0x3a')]),_0xbe14('0x5a'),{'uri':util[_0xbe14('0xb')]('%s/agent/tickets/%s',_0x50c2a0[_0xbe14('0x28')],_0x4bccfc['id'])});break;default:logger[_0xbe14('0x5c')](_0xbe14('0x60'),_0xbe14('0x5d'));}}})[_0xbe14('0x66')](function(_0x222944){logger[_0xbe14('0x5c')](_0xbe14('0x60'),JSON[_0xbe14('0x19')](_0x222944));});};exports[_0xbe14('0x67')]=function(_0x5917d5,_0x18be56,_0x442ec4,_0x2d4dd4,_0xfd32a3,_0x3ac6d8){var _0x5a1ea6,_0x42b341;_0x3ac6d8[_0xbe14('0x28')]=intUtil[_0xbe14('0x4b')](_0x3ac6d8[_0xbe14('0x28')]);_0x3ac6d8[_0xbe14('0x4a')]=intUtil['stripTrailingSlash'](_0x3ac6d8[_0xbe14('0x4a')]);if(_0xfd32a3&&_0xfd32a3[_0xbe14('0x4c')]){logger[_0xbe14('0x12')]('['+_0x18be56[_0xbe14('0x68')][_0xbe14('0x69')]()+']',_0xbe14('0x4e'));_0x18be56[_0xbe14('0x51')]=util[_0xbe14('0xb')]('%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s',_0x3ac6d8[_0xbe14('0x4a')],_0x18be56[_0xbe14('0x50')],md5(_0x18be56[_0xbe14('0x50')]));}else{_0x18be56[_0xbe14('0x51')]='';}headers[_0xbe14('0x61')]=getAuth(_0x3ac6d8);return getUser(_0x3ac6d8)[_0xbe14('0xd')](function(_0x445302){_0x5a1ea6=_0x445302;logger['info']('The\x20User\x20ID\x20is:',_0x5a1ea6['id']);return getEndUser(_0x3ac6d8,_0x18be56[_0xbe14('0x6a')],_0x18be56[_0xbe14('0x53')]);})[_0xbe14('0xd')](function(_0x2510a0){_0x42b341=_0x2510a0;logger[_0xbe14('0x12')](_0xbe14('0x54'),_0x42b341['id']);return getTicket(_0x3ac6d8,_0x5a1ea6,_0x42b341,_0x442ec4,_0x18be56);})[_0xbe14('0xd')](function(_0x43511e){if(_0x43511e){logger['info']('Ticket\x20created!');logger[_0xbe14('0x12')](_0xbe14('0x55'),_0x43511e['id']);}})[_0xbe14('0x66')](function(_0x57729f){logger[_0xbe14('0x5c')]('['+_0x18be56[_0xbe14('0x68')][_0xbe14('0x69')]()+']',JSON[_0xbe14('0x19')](_0x57729f));});}; \ No newline at end of file diff --git a/server/services/ami/trigger/integration/dynamics365.js b/server/services/ami/trigger/integration/dynamics365.js index d7bd9a3..ad2cf51 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 _0xa555=['customField','idField','indexOf','content','ticketType','incident','incidents','assign','getString','Subjects','Descriptions','/contacts(','Fields','phonecall','callDirection','queue','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','tenantId','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','uniqueid','monitor_format','[QUEUE]','Recording\x20is\x20enabled!','recordingURL','recordingFormat','none','[OUTBOUND]',']\x20The\x20User\x20email\x20is:','moduleCreate','additionalSearchContact',']\x20The\x20Enduser\x20phone\x20is:',']\x20The\x20%s\x20ID\x20is:\x20%s','unmanaged','openNewTab','name',']\x20Error\x20running\x20Dynamics365\x20integration','Error\x20running\x20Dynamics365\x20integration','lodash','request-promise','util','./util','md5','ioredis','../../../../config/logger','dynamics365','../../../../config/environment','defaults','localhost','socket.io-emitter','redis','remoteUri','data7','CloudProvider','data2','data5','POST','username','password','clientSecret','then','catch','error','toUpperCase',']\x20Wrong\x20credentials!','message','GET','systemusers?$select=internalemailaddress,isdisabled,systemuserid','Bearer\x20','4.0','value','isNil','email','userEmail','internalemailaddress','isdisabled',']\x20Agent\x20found\x20','systemuserid','userId','info',']\x20Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!','length','toLowerCase','outbound','destcalleridnum','calleridnum','/systemusers(','headers','odata-entityid','substring','lastIndexOf','enduserId','telephone1','contacts?$select=','&$filter=','\x20eq\x20\x27','replace','%2b','nothing',']\x20Enduser\x20NOT\x20Created\x20-\x20ModuleCreate\x20=\x20Nothing','string','picklist','type','nameField'];(function(_0x2be8c2,_0x14a4b5){var _0x97f531=function(_0xcee58d){while(--_0xcee58d){_0x2be8c2['push'](_0x2be8c2['shift']());}};_0x97f531(++_0x14a4b5);}(_0xa555,0x1ee));var _0x5a55=function(_0x4704dc,_0x575a5f){_0x4704dc=_0x4704dc-0x0;var _0x254d81=_0xa555[_0x4704dc];return _0x254d81;};'use strict';var _=require(_0x5a55('0x0'));var rp=require(_0x5a55('0x1'));var util=require(_0x5a55('0x2'));var intUtil=require(_0x5a55('0x3'));var md5=require(_0x5a55('0x4'));var Redis=require(_0x5a55('0x5'));var logger=require(_0x5a55('0x6'))(_0x5a55('0x7'));var config=require(_0x5a55('0x8'));config['redis']=_[_0x5a55('0x9')](config['redis'],{'host':_0x5a55('0xa'),'port':0x18eb});var io=require(_0x5a55('0xb'))(new Redis(config[_0x5a55('0xc')]));function getAuthToken(_0x3e3508,_0x286251,_0x3a7915){if(_0x3e3508['modernAuthentication']){_0x3e3508[_0x5a55('0xd')]=_0x3e3508['CloudProvider'][_0x5a55('0xe')];_0x3e3508['tenantId']=_0x3e3508[_0x5a55('0xf')][_0x5a55('0x10')];return Promise['resolve'](_0x3e3508['CloudProvider'][_0x5a55('0x11')]);}var _0x48229e={'method':_0x5a55('0x12'),'uri':_0x286251,'form':{'client_id':_0x3e3508['clientId'],'resource':_0x3e3508[_0x5a55('0xd')],'username':_0x3e3508[_0x5a55('0x13')],'password':_0x3e3508['password'],'grant_type':_0x5a55('0x14'),'client_secret':_0x3e3508[_0x5a55('0x15')]},'json':!![]};return rp(_0x48229e)[_0x5a55('0x16')](function(_0x412909){return _0x412909['access_token'];})[_0x5a55('0x17')](function(_0x388fbb){logger[_0x5a55('0x18')]('['+[_0x3a7915[_0x5a55('0x19')]()]+_0x5a55('0x1a'));return _0x388fbb[_0x5a55('0x1b')];});}function getUser(_0x5415da,_0x4dcee5,_0x13cdd5,_0x355328,_0x21ff79,_0xe452ab){return new Promise(function(_0x130f52,_0x4b8300){return getAuthToken(_0x4dcee5,_0x355328,_0xe452ab)[_0x5a55('0x16')](function(_0x3a7361){var _0x405824={'method':_0x5a55('0x1c'),'uri':_0x21ff79+_0x5a55('0x1d'),'headers':{'Authorization':_0x5a55('0x1e')+_0x3a7361,'OData-Version':_0x5a55('0x1f')},'json':!![]};return rp(_0x405824);})[_0x5a55('0x16')](function(_0x3e906d){var _0x2a1b36=_0x3e906d[_0x5a55('0x20')];var _0x16ca72=![];var _0x457e50=null;if(!_[_0x5a55('0x21')](_0x13cdd5)){if(intUtil['validateEmail'](_0x13cdd5[_0x5a55('0x22')])){_0x5415da[_0x5a55('0x23')]=_0x13cdd5[_0x5a55('0x22')];for(_0x457e50=0x0;_0x457e50<_0x2a1b36['length'];_0x457e50++){if(_0x2a1b36[_0x457e50][_0x5a55('0x24')]===_0x13cdd5[_0x5a55('0x22')]&&!_0x2a1b36[_0x457e50][_0x5a55('0x25')]){_0x16ca72=!![];logger['info']('['+[_0xe452ab[_0x5a55('0x19')]()]+_0x5a55('0x26')+_0x2a1b36[_0x457e50][_0x5a55('0x27')]+'!');_0x5415da[_0x5a55('0x28')]=_0x2a1b36[_0x457e50][_0x5a55('0x27')];}}}}if(!_0x16ca72){logger[_0x5a55('0x29')]('['+[_0xe452ab[_0x5a55('0x19')]()]+_0x5a55('0x2a'));_0x5415da['userEmail']=_0x4dcee5['username'];for(_0x457e50=0x0;_0x457e50<_0x2a1b36[_0x5a55('0x2b')];_0x457e50++){if(_0x2a1b36[_0x457e50][_0x5a55('0x24')]===_0x4dcee5[_0x5a55('0x13')]){_0x5415da[_0x5a55('0x28')]=_0x2a1b36[_0x457e50][_0x5a55('0x27')];}}}_0x130f52(_0x5415da);})[_0x5a55('0x17')](function(_0x2c1b27){_0x4b8300(_0x2c1b27[_0x5a55('0x1b')]);});});}function createEndUser(_0x1f8f54,_0x2773a5,_0xb328fb,_0x78640d,_0x25b7ec,_0x416645,_0xd51c67){return new Promise(function(_0x222490,_0x4b1880){return getAuthToken(_0x2773a5,_0xb328fb,_0x416645)[_0x5a55('0x16')](function(_0x48c654){var _0x1ca6e9=_0x416645[_0x5a55('0x2c')]()===_0x5a55('0x2d')?_0x25b7ec[_0x5a55('0x2e')]:_0x25b7ec[_0x5a55('0x2f')];var _0x4c3f0e={'method':_0x5a55('0x12'),'uri':_0x78640d+'contacts','body':{'fullname':_0x1ca6e9,'firstname':_0x1ca6e9,'lastname':'_','mobilephone':null,'address1_telephone1':null,'ownerid@odata.bind':_0x5a55('0x30')+_0x1f8f54[_0x5a55('0x28')]+')'},'headers':{'Authorization':'Bearer\x20'+_0x48c654,'OData-Version':_0x5a55('0x1f')},'json':!![],'resolveWithFullResponse':!![]};_0x4c3f0e['body'][_0xd51c67]=_0x1ca6e9;return rp(_0x4c3f0e);})[_0x5a55('0x16')](function(_0x123bd2){var _0x261efd=_0x123bd2[_0x5a55('0x31')][_0x5a55('0x32')];var _0x360f16=_0x261efd[_0x5a55('0x33')](_0x261efd[_0x5a55('0x34')]('(')+0x1,_0x261efd['lastIndexOf'](')'));_0x1f8f54[_0x5a55('0x35')]=_0x360f16;_0x222490(_0x1f8f54);})[_0x5a55('0x17')](function(_0x492c16){_0x4b1880(_0x492c16[_0x5a55('0x1b')]);});});}function getEndUser(_0x15995a,_0x46712f,_0xc88292,_0x2df58e,_0x3c4c51,_0x5ae88c,_0x1df1ad,_0x44e4df){var _0x2f8bfd=_0x5ae88c[_0x5a55('0x2c')]()===_0x5a55('0x2d')?_0x3c4c51[_0x5a55('0x2e')]:_0x3c4c51[_0x5a55('0x2f')];return getAuthToken(_0x46712f,_0xc88292,_0x5ae88c)[_0x5a55('0x16')](function(_0x1722a3){_0x44e4df=_0x44e4df?_0x44e4df:_0x5a55('0x36');var _0x32492f={'method':_0x5a55('0x1c'),'uri':_0x2df58e+_0x5a55('0x37')+_0x44e4df+_0x5a55('0x38')+_0x44e4df+_0x5a55('0x39')+_0x2f8bfd[_0x5a55('0x3a')]('+',_0x5a55('0x3b'))+'\x27','headers':{'Authorization':_0x5a55('0x1e')+_0x1722a3,'If-None-Match':null,'OData-Version':'4.0'},'json':!![]};return rp(_0x32492f);})[_0x5a55('0x16')](function(_0x12a2bc){var _0x56f729=![];if(!_0x12a2bc)return _0x56f729;var _0x26ecc3=_0x12a2bc[_0x5a55('0x20')];for(var _0x443749=0x0;_0x443749<_0x26ecc3['length'];_0x443749++){if(_0x26ecc3[_0x443749][_0x44e4df]===_0x2f8bfd){_0x56f729=!![];_0x15995a['enduserId']=_0x26ecc3[_0x443749]['contactid'];}}return _0x56f729;})[_0x5a55('0x16')](function(_0xbf4a30){if(_0xbf4a30)return _0x15995a;if(_0x1df1ad===_0x5a55('0x3c')){logger[_0x5a55('0x29')]('['+[_0x5ae88c[_0x5a55('0x19')]()]+_0x5a55('0x3d'));return _0x15995a;}return createEndUser(_0x15995a,_0x46712f,_0xc88292,_0x2df58e,_0x3c4c51,_0x5ae88c,_0x44e4df)[_0x5a55('0x16')](function(_0x59090d){logger[_0x5a55('0x29')]('['+[_0x5ae88c[_0x5a55('0x19')]()]+']\x20Enduser\x20created!',_0x59090d['enduserId']);return _0x59090d;});});}function getCustomFields(_0x2970fa,_0x210c6e,_0x288d68){var _0x260624={};if(_0x2970fa[_0x5a55('0x2b')]>0x0){_['forEach'](_0x2970fa,function(_0x2d3db7){if(_['includes']([_0x5a55('0x3e'),_0x5a55('0x3f')],_0x2d3db7[_0x5a55('0x40')])&&_0x2d3db7[_0x5a55('0x41')]&&!_0x2d3db7[_0x5a55('0x42')]){var _0x309a13=_0x2d3db7[_0x5a55('0x43')][_0x5a55('0x2c')]();var _0xb60906=_0x309a13[_0x5a55('0x33')](0x0,_0x309a13[_0x5a55('0x44')]('_'));var _0x1ae71a=_0x309a13[_0x5a55('0x33')](_0x309a13['indexOf']('_')+0x1);if(_0xb60906===_0x288d68){_0x260624[_0x1ae71a]=_0x2d3db7[_0x5a55('0x45')];}}});}return _0x260624;}function getTicket(_0x4fc38d,_0x3cfb1e,_0x2670d9,_0x5b32ed,_0x2cfb2e,_0x598bc3,_0x6a22f0){return new Promise(function(_0x4b8af7,_0x13ab1e){var _0x47226c;return getAuthToken(_0x3cfb1e,_0x2670d9,_0x6a22f0)[_0x5a55('0x16')](function(_0x1ccb5b){if(_0x598bc3[_0x5a55('0x46')]===_0x5a55('0x47')){_0x47226c={'method':'POST','uri':_0x5b32ed+_0x5a55('0x48'),'body':Object[_0x5a55('0x49')]({},{'title':intUtil[_0x5a55('0x4a')](_0x598bc3[_0x5a55('0x4b')],_0x2cfb2e,'\x20'),'description':intUtil[_0x5a55('0x4a')](_0x598bc3[_0x5a55('0x4c')],_0x2cfb2e,'\x0a'),'customerid_contact@odata.bind':_0x4fc38d[_0x5a55('0x35')]?_0x5a55('0x4d')+_0x4fc38d['enduserId']+')':undefined,'ownerid@odata.bind':_0x5a55('0x30')+_0x4fc38d[_0x5a55('0x28')]+')','caseorigincode':'1'},getCustomFields(_0x598bc3[_0x5a55('0x4e')],_0x2cfb2e,_0x598bc3[_0x5a55('0x46')])),'headers':{'Authorization':_0x5a55('0x1e')+_0x1ccb5b,'OData-Version':'4.0'},'json':!![],'resolveWithFullResponse':!![]};}if(_0x598bc3[_0x5a55('0x46')]===_0x5a55('0x4f')){var _0x550047=_0x4fc38d[_0x5a55('0x35')]?[{'partyid_systemuser@odata.bind':_0x5a55('0x30')+_0x4fc38d[_0x5a55('0x28')]+')','participationtypemask':_0x4fc38d[_0x5a55('0x50')]===_0x5a55('0x51')?0x2:0x1},{'partyid_contact@odata.bind':_0x5a55('0x4d')+_0x4fc38d[_0x5a55('0x35')]+')','participationtypemask':_0x4fc38d[_0x5a55('0x50')]===_0x5a55('0x51')?0x1:0x2}]:[{'partyid_systemuser@odata.bind':_0x5a55('0x30')+_0x4fc38d[_0x5a55('0x28')]+')','participationtypemask':_0x4fc38d[_0x5a55('0x50')]===_0x5a55('0x51')?0x2:0x1}];_0x47226c={'method':'POST','uri':_0x5b32ed+'phonecalls','body':Object[_0x5a55('0x49')]({},{'subject':intUtil[_0x5a55('0x4a')](_0x598bc3[_0x5a55('0x4b')],_0x2cfb2e,'\x20'),'phonenumber':String(_0x2cfb2e[_0x5a55('0x2f')]),'description':intUtil[_0x5a55('0x4a')](_0x598bc3['Descriptions'],_0x2cfb2e,'\x0a'),'regardingobjectid_contact@odata.bind':_0x4fc38d[_0x5a55('0x35')]?_0x5a55('0x4d')+_0x4fc38d[_0x5a55('0x35')]+')':undefined,'ownerid@odata.bind':'/systemusers('+_0x4fc38d[_0x5a55('0x28')]+')','directioncode':_0x4fc38d['callDirection']===_0x5a55('0x51')?![]:!![],'phonecall_activity_parties':_0x550047},getCustomFields(_0x598bc3[_0x5a55('0x4e')],_0x2cfb2e,_0x598bc3[_0x5a55('0x46')])),'headers':{'Authorization':_0x5a55('0x1e')+_0x1ccb5b,'OData-Version':_0x5a55('0x1f')},'json':!![],'resolveWithFullResponse':!![]};}return rp(_0x47226c);})['then'](function(_0x3b922d){var _0x1f8788=_0x3b922d[_0x5a55('0x31')][_0x5a55('0x32')];var _0x1bc0f4=_0x1f8788[_0x5a55('0x33')](_0x1f8788[_0x5a55('0x34')]('(')+0x1,_0x1f8788[_0x5a55('0x34')](')'));_0x4fc38d[_0x5a55('0x52')]=_0x1bc0f4;_0x4b8af7(_0x4fc38d);})[_0x5a55('0x17')](function(_0x5d7cf8){_0x13ab1e(_0x5d7cf8['message']);});});}function emit(_0x57d1ad,_0x4bf104,_0x94fc2,_0x385d42){var _0x2c8903={'uri':util[_0x5a55('0x53')](_0x5a55('0x54'),_0x57d1ad,_0x94fc2,_0x385d42)};io['to'](util['format'](_0x5a55('0x55'),_0x4bf104))[_0x5a55('0x56')](_0x5a55('0x57'),_0x2c8903);}exports['cs']=function(_0x552dee,_0x14d731,_0x5f5051,_0x14a4af,_0x168a07,_0x2890b4,_0x2380d8,_0x5b5038){var _0x204a5a={};_0x2890b4['remoteUri']=_0x2890b4['modernAuthentication']?intUtil[_0x5a55('0x58')](_0x2890b4[_0x5a55('0xf')][_0x5a55('0xe')]):intUtil[_0x5a55('0x58')](_0x2890b4[_0x5a55('0xd')]);_0x2890b4['serverUrl']=intUtil[_0x5a55('0x58')](_0x2890b4[_0x5a55('0x59')]);_0x204a5a['callDirection']=_0x5b5038===_0x5a55('0x51')||_0x5b5038==='unmanaged'?_0x5a55('0x51'):'outbound';var _0x38dc9b=_0x2890b4['modernAuthentication']?util[_0x5a55('0x53')](_0x5a55('0x5a'),_0x2890b4[_0x5a55('0xf')][_0x5a55('0xe')]):util[_0x5a55('0x53')](_0x5a55('0x5a'),_0x2890b4[_0x5a55('0xd')]);var _0x2581e8=util[_0x5a55('0x53')](_0x5a55('0x5b'),_0x2890b4[_0x5a55('0x5c')]);var _0x5c1149=util['format'](_0x5a55('0x5d'),_0x2890b4[_0x5a55('0x59')],_0x14d731[_0x5a55('0x5e')],md5(_0x14d731[_0x5a55('0x5e')]));if(_0x168a07&&_0x168a07[_0x5a55('0x5f')]){logger['info'](_0x5a55('0x60'),_0x5a55('0x61'));_0x14d731[_0x5a55('0x62')]=_0x5c1149;}else if(_0x2380d8&&_0x2380d8[_0x5a55('0x63')]&&_0x2380d8[_0x5a55('0x63')]!==_0x5a55('0x64')){logger[_0x5a55('0x29')](_0x5a55('0x65'),_0x5a55('0x61'));_0x14d731[_0x5a55('0x62')]=_0x5c1149;}else{_0x14d731[_0x5a55('0x62')]='';}return getUser(_0x204a5a,_0x2890b4,_0x14a4af,_0x2581e8,_0x38dc9b,_0x5b5038)[_0x5a55('0x16')](function(_0x1923d7){logger['info']('['+_0x5b5038[_0x5a55('0x19')]()+']\x20The\x20User\x20ID\x20is:',_0x1923d7['userId']);logger[_0x5a55('0x29')]('['+_0x5b5038[_0x5a55('0x19')]()+_0x5a55('0x66'),_0x1923d7[_0x5a55('0x23')]);return getEndUser(_0x1923d7,_0x2890b4,_0x2581e8,_0x38dc9b,_0x14d731,_0x5b5038,_0x5f5051[_0x5a55('0x67')],_0x5f5051[_0x5a55('0x68')]);})[_0x5a55('0x16')](function(_0x55309b){logger['info']('['+_0x5b5038[_0x5a55('0x19')]()+']\x20The\x20Enduser\x20ID\x20is:',_0x55309b[_0x5a55('0x35')]);logger[_0x5a55('0x29')]('['+_0x5b5038[_0x5a55('0x19')]()+_0x5a55('0x69'),_0x14d731[_0x5a55('0x2f')]);return getTicket(_0x55309b,_0x2890b4,_0x2581e8,_0x38dc9b,_0x14d731,_0x5f5051,_0x5b5038);})[_0x5a55('0x16')](function(_0x3284bd){logger[_0x5a55('0x29')](util[_0x5a55('0x53')]('['+_0x5b5038[_0x5a55('0x19')]()+_0x5a55('0x6a'),_0x5f5051[_0x5a55('0x46')],_0x3284bd['ticketId']));logger[_0x5a55('0x29')](util[_0x5a55('0x53')]('['+_0x5b5038[_0x5a55('0x19')]()+']\x20Call\x20direction:\x20%s',_0x5b5038));if(_0x5b5038!==_0x5a55('0x6b')&&_0x5f5051[_0x5a55('0x6c')]){logger[_0x5a55('0x29')]('['+_0x5b5038[_0x5a55('0x19')]()+']','Displaying\x20call\x20in\x20a\x20new\x20tab...');emit(_0x2890b4[_0x5a55('0xd')],_0x14a4af[_0x5a55('0x6d')],_0x5f5051['ticketType'],_0x3284bd[_0x5a55('0x52')]);}})['catch'](function(_0x1da35a){logger[_0x5a55('0x18')]('['+_0x5b5038[_0x5a55('0x19')]()+_0x5a55('0x6e'),_0x1da35a[_0x5a55('0x1b')]);console[_0x5a55('0x18')](_0x5a55('0x6f'),_0x1da35a);});}; \ No newline at end of file +var _0xe6b7=['content','ticketType','incident','incidents','assign','getString','/contacts(','Fields','phonecall','callDirection','queue','phonecalls','Subjects','ticketId','format','%s/main.aspx?pagetype=entityrecord&etn=%s&id=%s','user:%s','emit','trigger:browser:url','remoteUri','stripTrailingSlash','serverUrl','unmanaged','outbound','%s/api/data/v9.0/','https://login.microsoftonline.com/%s/oauth2/token','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','uniqueid','monitor_format','[QUEUE]','Recording\x20is\x20enabled!','recordingURL','recordingFormat','none','[OUTBOUND]',']\x20The\x20User\x20ID\x20is:','moduleCreate','additionalSearchContact',']\x20The\x20Enduser\x20ID\x20is:',']\x20The\x20Enduser\x20phone\x20is:',']\x20The\x20%s\x20ID\x20is:\x20%s',']\x20Call\x20direction:\x20%s','openNewTab','Displaying\x20call\x20in\x20a\x20new\x20tab...','name',']\x20Error\x20running\x20Dynamics365\x20integration','error','Error\x20running\x20Dynamics365\x20integration','lodash','util','md5','ioredis','../../../../config/logger','dynamics365','redis','localhost','socket.io-emitter','modernAuthentication','CloudProvider','data7','tenantId','data2','resolve','data5','POST','clientId','password','catch','toUpperCase','message','then','GET','systemusers?$select=internalemailaddress,isdisabled,systemuserid','Bearer\x20','4.0','value','isNil','validateEmail','email','length','isdisabled','info','userId',']\x20Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!','userEmail','username','toLowerCase','calleridnum','contacts','/systemusers(','body','headers','odata-entityid','substring','lastIndexOf','enduserId','telephone1','replace','%2b','nothing',']\x20Enduser\x20NOT\x20Created\x20-\x20ModuleCreate\x20=\x20Nothing',']\x20Enduser\x20created!','includes','string','picklist','type','nameField','customField','indexOf'];(function(_0x122ef9,_0x451d2a){var _0x42fba0=function(_0x17c9d3){while(--_0x17c9d3){_0x122ef9['push'](_0x122ef9['shift']());}};_0x42fba0(++_0x451d2a);}(_0xe6b7,0x9d));var _0x7e6b=function(_0xa9f4ce,_0x34c89b){_0xa9f4ce=_0xa9f4ce-0x0;var _0x541f55=_0xe6b7[_0xa9f4ce];return _0x541f55;};'use strict';var _=require(_0x7e6b('0x0'));var rp=require('request-promise');var util=require(_0x7e6b('0x1'));var intUtil=require('./util');var md5=require(_0x7e6b('0x2'));var Redis=require(_0x7e6b('0x3'));var logger=require(_0x7e6b('0x4'))(_0x7e6b('0x5'));var config=require('../../../../config/environment');config[_0x7e6b('0x6')]=_['defaults'](config[_0x7e6b('0x6')],{'host':_0x7e6b('0x7'),'port':0x18eb});var io=require(_0x7e6b('0x8'))(new Redis(config[_0x7e6b('0x6')]));function getAuthToken(_0x5cb58e,_0x48f599,_0x2898ba){if(_0x5cb58e[_0x7e6b('0x9')]){_0x5cb58e['remoteUri']=_0x5cb58e[_0x7e6b('0xa')][_0x7e6b('0xb')];_0x5cb58e[_0x7e6b('0xc')]=_0x5cb58e[_0x7e6b('0xa')][_0x7e6b('0xd')];return Promise[_0x7e6b('0xe')](_0x5cb58e[_0x7e6b('0xa')][_0x7e6b('0xf')]);}var _0x6e4320={'method':_0x7e6b('0x10'),'uri':_0x48f599,'form':{'client_id':_0x5cb58e[_0x7e6b('0x11')],'resource':_0x5cb58e['remoteUri'],'username':_0x5cb58e['username'],'password':_0x5cb58e['password'],'grant_type':_0x7e6b('0x12'),'client_secret':_0x5cb58e['clientSecret']},'json':!![]};return rp(_0x6e4320)['then'](function(_0x3f6eb9){return _0x3f6eb9['access_token'];})[_0x7e6b('0x13')](function(_0x5f45b1){logger['error']('['+[_0x2898ba[_0x7e6b('0x14')]()]+']\x20Wrong\x20credentials!');return _0x5f45b1[_0x7e6b('0x15')];});}function getUser(_0x20b051,_0x163880,_0x17f40a,_0x44398d,_0x5495ad,_0x58cce9){return new Promise(function(_0x49ca7a,_0x47f3ef){return getAuthToken(_0x163880,_0x44398d,_0x58cce9)[_0x7e6b('0x16')](function(_0x2dcb06){var _0x18fc7d={'method':_0x7e6b('0x17'),'uri':_0x5495ad+_0x7e6b('0x18'),'headers':{'Authorization':_0x7e6b('0x19')+_0x2dcb06,'OData-Version':_0x7e6b('0x1a')},'json':!![]};return rp(_0x18fc7d);})['then'](function(_0x52e976){var _0x1d3c3c=_0x52e976[_0x7e6b('0x1b')];var _0x353adc=![];var _0x5713cf=null;if(!_[_0x7e6b('0x1c')](_0x17f40a)){if(intUtil[_0x7e6b('0x1d')](_0x17f40a['email'])){_0x20b051['userEmail']=_0x17f40a[_0x7e6b('0x1e')];for(_0x5713cf=0x0;_0x5713cf<_0x1d3c3c[_0x7e6b('0x1f')];_0x5713cf++){if(_0x1d3c3c[_0x5713cf]['internalemailaddress']===_0x17f40a[_0x7e6b('0x1e')]&&!_0x1d3c3c[_0x5713cf][_0x7e6b('0x20')]){_0x353adc=!![];logger[_0x7e6b('0x21')]('['+[_0x58cce9['toUpperCase']()]+']\x20Agent\x20found\x20'+_0x1d3c3c[_0x5713cf]['systemuserid']+'!');_0x20b051[_0x7e6b('0x22')]=_0x1d3c3c[_0x5713cf]['systemuserid'];}}}}if(!_0x353adc){logger[_0x7e6b('0x21')]('['+[_0x58cce9[_0x7e6b('0x14')]()]+_0x7e6b('0x23'));_0x20b051[_0x7e6b('0x24')]=_0x163880[_0x7e6b('0x25')];for(_0x5713cf=0x0;_0x5713cf<_0x1d3c3c[_0x7e6b('0x1f')];_0x5713cf++){if(_0x1d3c3c[_0x5713cf]['internalemailaddress']===_0x163880[_0x7e6b('0x25')]){_0x20b051[_0x7e6b('0x22')]=_0x1d3c3c[_0x5713cf]['systemuserid'];}}}_0x49ca7a(_0x20b051);})['catch'](function(_0xfff2c1){_0x47f3ef(_0xfff2c1['message']);});});}function createEndUser(_0x2d45ce,_0x395cfa,_0x375a33,_0x2e7911,_0xfb6dfc,_0x243b4d,_0x5ecd68){return new Promise(function(_0x5824ef,_0x53f8ee){return getAuthToken(_0x395cfa,_0x375a33,_0x243b4d)['then'](function(_0x1f066a){var _0x1059ed=_0x243b4d[_0x7e6b('0x26')]()==='outbound'?_0xfb6dfc['destcalleridnum']:_0xfb6dfc[_0x7e6b('0x27')];var _0xff907={'method':_0x7e6b('0x10'),'uri':_0x2e7911+_0x7e6b('0x28'),'body':{'fullname':_0x1059ed,'firstname':_0x1059ed,'lastname':'_','mobilephone':null,'address1_telephone1':null,'ownerid@odata.bind':_0x7e6b('0x29')+_0x2d45ce[_0x7e6b('0x22')]+')'},'headers':{'Authorization':_0x7e6b('0x19')+_0x1f066a,'OData-Version':_0x7e6b('0x1a')},'json':!![],'resolveWithFullResponse':!![]};_0xff907[_0x7e6b('0x2a')][_0x5ecd68]=_0x1059ed;return rp(_0xff907);})[_0x7e6b('0x16')](function(_0x57d19c){var _0x24ec5d=_0x57d19c[_0x7e6b('0x2b')][_0x7e6b('0x2c')];var _0x5ac643=_0x24ec5d[_0x7e6b('0x2d')](_0x24ec5d[_0x7e6b('0x2e')]('(')+0x1,_0x24ec5d['lastIndexOf'](')'));_0x2d45ce[_0x7e6b('0x2f')]=_0x5ac643;_0x5824ef(_0x2d45ce);})[_0x7e6b('0x13')](function(_0x3e4dee){_0x53f8ee(_0x3e4dee['message']);});});}function getEndUser(_0x29b2b5,_0x1c5f7d,_0xfd3ec1,_0x48fb73,_0x179e1c,_0x52cd95,_0x50675f,_0x5c663f){var _0x125faf=_0x52cd95['toLowerCase']()==='outbound'?_0x179e1c['destcalleridnum']:_0x179e1c['calleridnum'];return getAuthToken(_0x1c5f7d,_0xfd3ec1,_0x52cd95)[_0x7e6b('0x16')](function(_0x2ba76c){_0x5c663f=_0x5c663f?_0x5c663f:_0x7e6b('0x30');var _0x1375db={'method':_0x7e6b('0x17'),'uri':_0x48fb73+'contacts?$select='+_0x5c663f+'&$filter='+_0x5c663f+'\x20eq\x20\x27'+_0x125faf[_0x7e6b('0x31')]('+',_0x7e6b('0x32'))+'\x27','headers':{'Authorization':'Bearer\x20'+_0x2ba76c,'If-None-Match':null,'OData-Version':_0x7e6b('0x1a')},'json':!![]};return rp(_0x1375db);})[_0x7e6b('0x16')](function(_0x30f59b){var _0x1856b7=![];if(!_0x30f59b)return _0x1856b7;var _0x2a20ab=_0x30f59b[_0x7e6b('0x1b')];for(var _0x2f664f=0x0;_0x2f664f<_0x2a20ab[_0x7e6b('0x1f')];_0x2f664f++){if(_0x2a20ab[_0x2f664f][_0x5c663f]===_0x125faf){_0x1856b7=!![];_0x29b2b5[_0x7e6b('0x2f')]=_0x2a20ab[_0x2f664f]['contactid'];}}return _0x1856b7;})[_0x7e6b('0x16')](function(_0x1e1be8){if(_0x1e1be8)return _0x29b2b5;if(_0x50675f===_0x7e6b('0x33')){logger['info']('['+[_0x52cd95[_0x7e6b('0x14')]()]+_0x7e6b('0x34'));return _0x29b2b5;}return createEndUser(_0x29b2b5,_0x1c5f7d,_0xfd3ec1,_0x48fb73,_0x179e1c,_0x52cd95,_0x5c663f)[_0x7e6b('0x16')](function(_0x5226f8){logger['info']('['+[_0x52cd95['toUpperCase']()]+_0x7e6b('0x35'),_0x5226f8[_0x7e6b('0x2f')]);return _0x5226f8;});});}function getCustomFields(_0x570265,_0x31c52b,_0x1054be){var _0xd11789={};if(_0x570265[_0x7e6b('0x1f')]>0x0){_['forEach'](_0x570265,function(_0x2c75d3){if(_[_0x7e6b('0x36')]([_0x7e6b('0x37'),_0x7e6b('0x38')],_0x2c75d3[_0x7e6b('0x39')])&&_0x2c75d3[_0x7e6b('0x3a')]&&!_0x2c75d3[_0x7e6b('0x3b')]){var _0x23171a=_0x2c75d3['idField']['toLowerCase']();var _0x3e03bc=_0x23171a['substring'](0x0,_0x23171a[_0x7e6b('0x3c')]('_'));var _0x5a997d=_0x23171a[_0x7e6b('0x2d')](_0x23171a['indexOf']('_')+0x1);if(_0x3e03bc===_0x1054be){_0xd11789[_0x5a997d]=_0x2c75d3[_0x7e6b('0x3d')];}}});}return _0xd11789;}function getTicket(_0xdd89be,_0x59c14c,_0x19db9b,_0x5a5992,_0x4ea29f,_0x2937fc,_0x33c738){return new Promise(function(_0x1c088c,_0x24b2f9){var _0x45079e;return getAuthToken(_0x59c14c,_0x19db9b,_0x33c738)[_0x7e6b('0x16')](function(_0x162019){if(_0x2937fc[_0x7e6b('0x3e')]===_0x7e6b('0x3f')){_0x45079e={'method':_0x7e6b('0x10'),'uri':_0x5a5992+_0x7e6b('0x40'),'body':Object[_0x7e6b('0x41')]({},{'title':intUtil[_0x7e6b('0x42')](_0x2937fc['Subjects'],_0x4ea29f,'\x20'),'description':intUtil[_0x7e6b('0x42')](_0x2937fc['Descriptions'],_0x4ea29f,'\x0a'),'customerid_contact@odata.bind':_0xdd89be[_0x7e6b('0x2f')]?_0x7e6b('0x43')+_0xdd89be[_0x7e6b('0x2f')]+')':undefined,'ownerid@odata.bind':_0x7e6b('0x29')+_0xdd89be[_0x7e6b('0x22')]+')','caseorigincode':'1'},getCustomFields(_0x2937fc[_0x7e6b('0x44')],_0x4ea29f,_0x2937fc[_0x7e6b('0x3e')])),'headers':{'Authorization':'Bearer\x20'+_0x162019,'OData-Version':'4.0'},'json':!![],'resolveWithFullResponse':!![]};}if(_0x2937fc[_0x7e6b('0x3e')]===_0x7e6b('0x45')){var _0x3c8793=_0xdd89be[_0x7e6b('0x2f')]?[{'partyid_systemuser@odata.bind':_0x7e6b('0x29')+_0xdd89be[_0x7e6b('0x22')]+')','participationtypemask':_0xdd89be['callDirection']==='queue'?0x2:0x1},{'partyid_contact@odata.bind':_0x7e6b('0x43')+_0xdd89be[_0x7e6b('0x2f')]+')','participationtypemask':_0xdd89be[_0x7e6b('0x46')]===_0x7e6b('0x47')?0x1:0x2}]:[{'partyid_systemuser@odata.bind':_0x7e6b('0x29')+_0xdd89be['userId']+')','participationtypemask':_0xdd89be[_0x7e6b('0x46')]==='queue'?0x2:0x1}];_0x45079e={'method':'POST','uri':_0x5a5992+_0x7e6b('0x48'),'body':Object[_0x7e6b('0x41')]({},{'subject':intUtil[_0x7e6b('0x42')](_0x2937fc[_0x7e6b('0x49')],_0x4ea29f,'\x20'),'phonenumber':String(_0x4ea29f['calleridnum']),'description':intUtil[_0x7e6b('0x42')](_0x2937fc['Descriptions'],_0x4ea29f,'\x0a'),'regardingobjectid_contact@odata.bind':_0xdd89be[_0x7e6b('0x2f')]?_0x7e6b('0x43')+_0xdd89be[_0x7e6b('0x2f')]+')':undefined,'ownerid@odata.bind':_0x7e6b('0x29')+_0xdd89be[_0x7e6b('0x22')]+')','directioncode':_0xdd89be[_0x7e6b('0x46')]===_0x7e6b('0x47')?![]:!![],'phonecall_activity_parties':_0x3c8793},getCustomFields(_0x2937fc[_0x7e6b('0x44')],_0x4ea29f,_0x2937fc[_0x7e6b('0x3e')])),'headers':{'Authorization':_0x7e6b('0x19')+_0x162019,'OData-Version':_0x7e6b('0x1a')},'json':!![],'resolveWithFullResponse':!![]};}return rp(_0x45079e);})[_0x7e6b('0x16')](function(_0x186b65){var _0x259e79=_0x186b65[_0x7e6b('0x2b')][_0x7e6b('0x2c')];var _0x18e860=_0x259e79[_0x7e6b('0x2d')](_0x259e79['lastIndexOf']('(')+0x1,_0x259e79[_0x7e6b('0x2e')](')'));_0xdd89be[_0x7e6b('0x4a')]=_0x18e860;_0x1c088c(_0xdd89be);})[_0x7e6b('0x13')](function(_0x20dbfe){_0x24b2f9(_0x20dbfe[_0x7e6b('0x15')]);});});}function emit(_0x276dfa,_0x15e57e,_0x337a10,_0x1026b0){var _0x510a01={'uri':util[_0x7e6b('0x4b')](_0x7e6b('0x4c'),_0x276dfa,_0x337a10,_0x1026b0)};io['to'](util[_0x7e6b('0x4b')](_0x7e6b('0x4d'),_0x15e57e))[_0x7e6b('0x4e')](_0x7e6b('0x4f'),_0x510a01);}exports['cs']=function(_0xb01b82,_0x4b663d,_0x7123cb,_0x2d455d,_0xa881f6,_0x589786,_0x2c8eb5,_0x42a2b3){var _0x2947e5={};_0x589786[_0x7e6b('0x50')]=_0x589786[_0x7e6b('0x9')]?intUtil[_0x7e6b('0x51')](_0x589786[_0x7e6b('0xa')][_0x7e6b('0xb')]):intUtil[_0x7e6b('0x51')](_0x589786['remoteUri']);_0x589786[_0x7e6b('0x52')]=intUtil[_0x7e6b('0x51')](_0x589786[_0x7e6b('0x52')]);_0x2947e5['callDirection']=_0x42a2b3===_0x7e6b('0x47')||_0x42a2b3===_0x7e6b('0x53')?_0x7e6b('0x47'):_0x7e6b('0x54');var _0x2d925b=_0x589786[_0x7e6b('0x9')]?util['format'](_0x7e6b('0x55'),_0x589786[_0x7e6b('0xa')][_0x7e6b('0xb')]):util[_0x7e6b('0x4b')](_0x7e6b('0x55'),_0x589786[_0x7e6b('0x50')]);var _0x31ccae=util[_0x7e6b('0x4b')](_0x7e6b('0x56'),_0x589786[_0x7e6b('0xc')]);var _0x499c2f=util[_0x7e6b('0x4b')](_0x7e6b('0x57'),_0x589786[_0x7e6b('0x52')],_0x4b663d['uniqueid'],md5(_0x4b663d[_0x7e6b('0x58')]));if(_0xa881f6&&_0xa881f6[_0x7e6b('0x59')]){logger[_0x7e6b('0x21')](_0x7e6b('0x5a'),_0x7e6b('0x5b'));_0x4b663d[_0x7e6b('0x5c')]=_0x499c2f;}else if(_0x2c8eb5&&_0x2c8eb5[_0x7e6b('0x5d')]&&_0x2c8eb5['recordingFormat']!==_0x7e6b('0x5e')){logger[_0x7e6b('0x21')](_0x7e6b('0x5f'),_0x7e6b('0x5b'));_0x4b663d[_0x7e6b('0x5c')]=_0x499c2f;}else{_0x4b663d[_0x7e6b('0x5c')]='';}return getUser(_0x2947e5,_0x589786,_0x2d455d,_0x31ccae,_0x2d925b,_0x42a2b3)['then'](function(_0x2455a1){logger['info']('['+_0x42a2b3[_0x7e6b('0x14')]()+_0x7e6b('0x60'),_0x2455a1[_0x7e6b('0x22')]);logger[_0x7e6b('0x21')]('['+_0x42a2b3[_0x7e6b('0x14')]()+']\x20The\x20User\x20email\x20is:',_0x2455a1[_0x7e6b('0x24')]);return getEndUser(_0x2455a1,_0x589786,_0x31ccae,_0x2d925b,_0x4b663d,_0x42a2b3,_0x7123cb[_0x7e6b('0x61')],_0x7123cb[_0x7e6b('0x62')]);})[_0x7e6b('0x16')](function(_0x4ca5dc){logger[_0x7e6b('0x21')]('['+_0x42a2b3[_0x7e6b('0x14')]()+_0x7e6b('0x63'),_0x4ca5dc[_0x7e6b('0x2f')]);logger['info']('['+_0x42a2b3[_0x7e6b('0x14')]()+_0x7e6b('0x64'),_0x4b663d[_0x7e6b('0x27')]);return getTicket(_0x4ca5dc,_0x589786,_0x31ccae,_0x2d925b,_0x4b663d,_0x7123cb,_0x42a2b3);})[_0x7e6b('0x16')](function(_0x3c7f82){logger['info'](util[_0x7e6b('0x4b')]('['+_0x42a2b3[_0x7e6b('0x14')]()+_0x7e6b('0x65'),_0x7123cb[_0x7e6b('0x3e')],_0x3c7f82[_0x7e6b('0x4a')]));logger[_0x7e6b('0x21')](util[_0x7e6b('0x4b')]('['+_0x42a2b3[_0x7e6b('0x14')]()+_0x7e6b('0x66'),_0x42a2b3));if(_0x42a2b3!=='unmanaged'&&_0x7123cb[_0x7e6b('0x67')]){logger[_0x7e6b('0x21')]('['+_0x42a2b3[_0x7e6b('0x14')]()+']',_0x7e6b('0x68'));emit(_0x589786[_0x7e6b('0x50')],_0x2d455d[_0x7e6b('0x69')],_0x7123cb['ticketType'],_0x3c7f82[_0x7e6b('0x4a')]);}})[_0x7e6b('0x13')](function(_0x2a15c9){logger['error']('['+_0x42a2b3['toUpperCase']()+_0x7e6b('0x6a'),_0x2a15c9[_0x7e6b('0x15')]);console[_0x7e6b('0x6b')](_0x7e6b('0x6c'),_0x2a15c9);});}; \ 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 1f97077..fcb17bf 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 _0x8101=['calleridnum','The\x20Enduser\x20ID\x20is:','The\x20Ticket\x20ID\x20is:','user:%s','trigger:browser:url','%s/helpdesk/tickets/%d','catch','error','recordingFormat','none','[OUTBOUND]','Recording\x20is\x20enabled!','destcalleridname','destcalleridnum','unmanaged','lastevent','toUpperCase','lodash','request-promise','md5','util','ioredis','../../../../config/environment','freshdesk','redis','defaults','localhost','socket.io-emitter','application/json','emit','info','Creating\x20new\x20ticket...','calleridname','getString','
','Tags','name','custom_fields','mapValues','keyBy','format','%s/api/v2/tickets','remoteUri','POST','Ticket\x20created!','validateEmail','then','length','Agent\x20found!','Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!','%s/api/v2/agents/me','Admin\x20account\x20selected.','Invalid\x20email\x20format,\x20using\x20the\x20admin\x20account!','Searching\x20enduser\x20with\x20phone','Enduser\x20found!','%s/api/v2/contacts','Basic\x20%s','apiKey','toString','debug','[HTTP]','stringify','map','includes','picklist','type','nameField','customField','content','string','idField','variable','variableName','push','customVariable','Variable','toLowerCase','queue','stripTrailingSlash','serverUrl','monitor_format','[QUEUE]','recordingURL','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','uniqueid','Authorization','email','The\x20User\x20ID\x20is:'];(function(_0x4d4a74,_0x344a11){var _0x5491d8=function(_0x400056){while(--_0x400056){_0x4d4a74['push'](_0x4d4a74['shift']());}};_0x5491d8(++_0x344a11);}(_0x8101,0x69));var _0x1810=function(_0x11fb16,_0x29a381){_0x11fb16=_0x11fb16-0x0;var _0x343de1=_0x8101[_0x11fb16];return _0x343de1;};'use strict';var _=require(_0x1810('0x0'));var rp=require(_0x1810('0x1'));var md5=require(_0x1810('0x2'));var util=require(_0x1810('0x3'));var Redis=require(_0x1810('0x4'));var intUtil=require('./util');var config=require(_0x1810('0x5'));var logger=require('../../../../config/logger')(_0x1810('0x6'));config[_0x1810('0x7')]=_[_0x1810('0x8')](config[_0x1810('0x7')],{'host':_0x1810('0x9'),'port':0x18eb});var io=require(_0x1810('0xa'))(new Redis(config[_0x1810('0x7')]));var headers={'Content-Type':_0x1810('0xb'),'Accept':_0x1810('0xb')};function emit(_0x552029,_0x35e8d8,_0x78c36c){io['to'](_0x552029)[_0x1810('0xc')](_0x35e8d8,_0x78c36c);}function getTicket(_0x4d933e,_0x344b61,_0xc054b4,_0x1197e9,_0x66834f){logger[_0x1810('0xd')](_0x1810('0xe'));var _0x53d7d1=_['merge']({'responder_id':_0x344b61['id'],'requester_id':_0xc054b4['id'],'name':util['format']('Caller\x20-\x20%s',_0x66834f[_0x1810('0xf')]),'phone':_0x66834f['calleridnum'],'source':0x3,'priority':0x1,'status':0x2,'subject':intUtil['getString'](_0x1197e9['Subjects'],_0x66834f,'\x20'),'description':intUtil[_0x1810('0x10')](_0x1197e9['Descriptions'],_0x66834f,_0x1810('0x11')),'tags':getTags(_0x1197e9[_0x1810('0x12')],_0x1810('0x13'))},getCustomFields(_0x1197e9['Fields'],_0x66834f));_0x53d7d1[_0x1810('0x14')]=_[_0x1810('0x15')](_[_0x1810('0x16')](_0x53d7d1[_0x1810('0x14')],'id'),'value');return request({'uri':util[_0x1810('0x17')](_0x1810('0x18'),_0x4d933e[_0x1810('0x19')]),'method':_0x1810('0x1a'),'body':_0x53d7d1})['then'](function(_0x33aa98){logger[_0x1810('0xd')](_0x1810('0x1b'));return _0x33aa98;});}function getUser(_0x324779,_0xa399b8){if(intUtil[_0x1810('0x1c')](_0xa399b8)){return request({'uri':util[_0x1810('0x17')]('%s/api/v2/agents',_0x324779[_0x1810('0x19')]),'qs':{'email':_0xa399b8}})[_0x1810('0x1d')](function(_0x94d609){if(_0x94d609[_0x1810('0x1e')]){logger['info'](_0x1810('0x1f'));return _['find'](_0x94d609,function(_0x412ab0){return _0x412ab0['contact']['email']===_0xa399b8;});}else{logger[_0x1810('0xd')](_0x1810('0x20'));return request({'uri':util['format'](_0x1810('0x21'),_0x324779['remoteUri'])})[_0x1810('0x1d')](function(_0x212b32){logger['info'](_0x1810('0x22'));return _0x212b32;});}});}else{logger[_0x1810('0xd')](_0x1810('0x23'));return request({'uri':util[_0x1810('0x17')](_0x1810('0x21'),_0x324779[_0x1810('0x19')])})[_0x1810('0x1d')](function(_0x3f817f){logger['info'](_0x1810('0x22'));return _0x3f817f;});}}function getEndUser(_0x3e97f9,_0x612689,_0x5e2394){logger[_0x1810('0xd')](_0x1810('0x24'),_0x5e2394);return request({'uri':util[_0x1810('0x17')]('%s/api/v2/contacts',_0x3e97f9['remoteUri']),'qs':{'phone':_0x5e2394}})[_0x1810('0x1d')](function(_0x1e208d){if(_0x1e208d[_0x1810('0x1e')]){logger['info'](_0x1810('0x25'));return _['find'](_0x1e208d,{'phone':_0x5e2394});}else{logger[_0x1810('0xd')]('Enduser\x20not\x20found,\x20creating\x20a\x20new\x20enduser!');return request({'uri':util['format'](_0x1810('0x26'),_0x3e97f9[_0x1810('0x19')]),'method':_0x1810('0x1a'),'body':{'name':_0x612689,'phone':_0x5e2394}})['then'](function(_0x34827a){logger[_0x1810('0xd')]('Enduser\x20created.');return _0x34827a;});}});}function getAuth(_0x4b13db){return util[_0x1810('0x17')](_0x1810('0x27'),new Buffer(_0x4b13db[_0x1810('0x28')]+':X')[_0x1810('0x29')]('base64'));}function request(_0x598939){logger[_0x1810('0x2a')](_0x1810('0x2b'),JSON[_0x1810('0x2c')](_0x598939));return rp(_[_0x1810('0x8')](_0x598939,{'method':'GET','headers':headers,'json':!![]}));}function getTags(_0x2d715d,_0x2a720c){var _0x37810d=[];if(_0x2d715d&&_0x2d715d[_0x1810('0x1e')]>0x0){_0x37810d=_[_0x1810('0x2d')](_0x2d715d,_0x2a720c);}return _0x37810d;}function getCustomFields(_0x5efce3,_0x1fa418){var _0xcb24db=[];var _0x464747={'custom_fields':[]};if(_0x5efce3[_0x1810('0x1e')]>0x0){_['forEach'](_0x5efce3,function(_0x324aaf){if(_[_0x1810('0x2e')](['string',_0x1810('0x2f')],_0x324aaf[_0x1810('0x30')])&&_0x324aaf[_0x1810('0x31')]&&!_0x324aaf[_0x1810('0x32')]){_0x464747[_0x324aaf['nameField']['toLowerCase']()]=_0x324aaf[_0x1810('0x33')][_0x1810('0x29')]();}else if(_[_0x1810('0x2e')]([_0x1810('0x34'),_0x1810('0x2f')],_0x324aaf['type'])&&_0x324aaf[_0x1810('0x35')]&&_0x324aaf['customField']){_0x464747['custom_fields']['push']({'id':_0x324aaf[_0x1810('0x35')],'value':_0x324aaf[_0x1810('0x33')][_0x1810('0x29')]()});}else if(_0x324aaf['type']===_0x1810('0x36')&&_0x324aaf[_0x1810('0x37')]&&_0x324aaf['idField']&&_0x324aaf[_0x1810('0x32')]){_0x1fa418[_0x324aaf[_0x1810('0x37')]]&&_0x464747[_0x1810('0x14')][_0x1810('0x38')]({'id':_0x324aaf['idField'],'value':_0x1fa418[_0x324aaf['variableName']]['toString']()});}else if(_0x324aaf[_0x1810('0x30')]===_0x1810('0x39')&&_0x324aaf[_0x1810('0x3a')]&&_0x324aaf[_0x1810('0x3a')][_0x1810('0x13')]&&_0x324aaf['idField']&&_0x324aaf[_0x1810('0x32')]){_0x1fa418[_0x324aaf[_0x1810('0x3a')][_0x1810('0x13')][_0x1810('0x3b')]()]&&_0x464747[_0x1810('0x14')][_0x1810('0x38')]({'id':_0x324aaf[_0x1810('0x35')],'value':_0x1fa418[_0x324aaf[_0x1810('0x3a')][_0x1810('0x13')][_0x1810('0x3b')]()][_0x1810('0x29')]()});}});}return _0x464747;}exports[_0x1810('0x3c')]=function(_0x434920,_0x8f11b9,_0x198237,_0x252e66,_0x374349,_0x4076ef){var _0x25747f,_0xf503c;_0x4076ef[_0x1810('0x19')]=intUtil[_0x1810('0x3d')](_0x4076ef['remoteUri']);_0x4076ef[_0x1810('0x3e')]=intUtil[_0x1810('0x3d')](_0x4076ef['serverUrl']);if(_0x374349&&_0x374349[_0x1810('0x3f')]){logger[_0x1810('0xd')](_0x1810('0x40'),'Recording\x20is\x20enabled!');_0x8f11b9[_0x1810('0x41')]=util[_0x1810('0x17')](_0x1810('0x42'),_0x4076ef[_0x1810('0x3e')],_0x8f11b9[_0x1810('0x43')],md5(_0x8f11b9['uniqueid']));}else{_0x8f11b9[_0x1810('0x41')]='';}headers[_0x1810('0x44')]=getAuth(_0x4076ef);return getUser(_0x4076ef,_0x252e66[_0x1810('0x45')])[_0x1810('0x1d')](function(_0x30a985){_0x25747f=_0x30a985;logger[_0x1810('0xd')](_0x1810('0x46'),_0x25747f['id']);return getEndUser(_0x4076ef,_0x8f11b9[_0x1810('0xf')],_0x8f11b9[_0x1810('0x47')]);})[_0x1810('0x1d')](function(_0xb8d8d2){_0xf503c=_0xb8d8d2;logger[_0x1810('0xd')](_0x1810('0x48'),_0xf503c['id']);return getTicket(_0x4076ef,_0x25747f,_0xf503c,_0x198237,_0x8f11b9);})['then'](function(_0x3cbe69){if(_0x3cbe69&&_0x3cbe69['id']){logger['info'](_0x1810('0x1b'));logger[_0x1810('0xd')](_0x1810('0x49'),_0x3cbe69['id']);logger[_0x1810('0xd')](_0x1810('0x40'),'Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...');emit(util[_0x1810('0x17')](_0x1810('0x4a'),_0x252e66[_0x1810('0x13')]),_0x1810('0x4b'),{'uri':util[_0x1810('0x17')](_0x1810('0x4c'),_0x4076ef['remoteUri'],_0x3cbe69['id'])});}})[_0x1810('0x4d')](function(_0x27bae0){logger[_0x1810('0x4e')]('[QUEUE]',JSON[_0x1810('0x2c')](_0x27bae0));});};exports['outbound']=function(_0x2558bd,_0x4dc50f,_0x18a696,_0x2ad0a4,_0x21e52e,_0x20a99a,_0x131ce0){var _0x1927e2,_0x238018;_0x20a99a['remoteUri']=intUtil['stripTrailingSlash'](_0x20a99a['remoteUri']);_0x20a99a[_0x1810('0x3e')]=intUtil['stripTrailingSlash'](_0x20a99a[_0x1810('0x3e')]);if(_0x131ce0&&_0x131ce0[_0x1810('0x4f')]&&_0x131ce0[_0x1810('0x4f')]!==_0x1810('0x50')){logger['info'](_0x1810('0x51'),_0x1810('0x52'));_0x4dc50f['recordingURL']=util[_0x1810('0x17')]('%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s',_0x20a99a[_0x1810('0x3e')],_0x4dc50f[_0x1810('0x43')],md5(_0x4dc50f[_0x1810('0x43')]));}headers[_0x1810('0x44')]=getAuth(_0x20a99a);return getUser(_0x20a99a,_0x2ad0a4[_0x1810('0x45')])[_0x1810('0x1d')](function(_0x385501){_0x1927e2=_0x385501;logger[_0x1810('0xd')](_0x1810('0x46'),_0x1927e2['id']);return getEndUser(_0x20a99a,_0x4dc50f[_0x1810('0x53')],_0x4dc50f[_0x1810('0x54')]);})[_0x1810('0x1d')](function(_0x24fcda){_0x238018=_0x24fcda;logger[_0x1810('0xd')](_0x1810('0x48'),_0x238018['id']);return getTicket(_0x20a99a,_0x1927e2,_0x238018,_0x18a696,_0x4dc50f);})[_0x1810('0x1d')](function(_0x2f5263){if(_0x2f5263&&_0x2f5263['id']){logger[_0x1810('0xd')](_0x1810('0x1b'));logger[_0x1810('0xd')](_0x1810('0x49'),_0x2f5263['id']);logger[_0x1810('0xd')](_0x1810('0x51'),'Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...');emit(util['format'](_0x1810('0x4a'),_0x2ad0a4[_0x1810('0x13')]),_0x1810('0x4b'),{'uri':util[_0x1810('0x17')]('%s/helpdesk/tickets/%d',_0x20a99a[_0x1810('0x19')],_0x2f5263['id'])});}})['catch'](function(_0x13b8e1){logger['error']('[OUTBOUND]',JSON[_0x1810('0x2c')](_0x13b8e1));});};exports[_0x1810('0x55')]=function(_0x179eeb,_0x5c4533,_0x43f703,_0x395871,_0x332edc,_0x145203){var _0x596899,_0x229a4f;_0x145203[_0x1810('0x19')]=intUtil['stripTrailingSlash'](_0x145203[_0x1810('0x19')]);_0x145203[_0x1810('0x3e')]=intUtil[_0x1810('0x3d')](_0x145203[_0x1810('0x3e')]);if(_0x332edc&&_0x332edc[_0x1810('0x3f')]){logger[_0x1810('0xd')]('['+_0x5c4533[_0x1810('0x56')][_0x1810('0x57')]()+']','Recording\x20is\x20enabled!');_0x5c4533[_0x1810('0x41')]=util[_0x1810('0x17')]('%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s',_0x145203['serverUrl'],_0x5c4533['uniqueid'],md5(_0x5c4533[_0x1810('0x43')]));}else{_0x5c4533['recordingURL']='';}headers[_0x1810('0x44')]=getAuth(_0x145203);return getUser(_0x145203,'')[_0x1810('0x1d')](function(_0x228a1d){_0x596899=_0x228a1d;logger[_0x1810('0xd')]('The\x20User\x20ID\x20is:',_0x596899['id']);return getEndUser(_0x145203,_0x5c4533['calleridname'],_0x5c4533[_0x1810('0x47')]);})[_0x1810('0x1d')](function(_0x15f38e){_0x229a4f=_0x15f38e;logger[_0x1810('0xd')]('The\x20Enduser\x20ID\x20is:',_0x229a4f['id']);return getTicket(_0x145203,_0x596899,_0x229a4f,_0x43f703,_0x5c4533);})[_0x1810('0x1d')](function(_0x40c2f6){if(_0x40c2f6){logger[_0x1810('0xd')]('Ticket\x20created!');logger[_0x1810('0xd')](_0x1810('0x49'),_0x40c2f6['id']);}})[_0x1810('0x4d')](function(_0x1cbe6f){logger[_0x1810('0x4e')]('['+_0x5c4533[_0x1810('0x56')][_0x1810('0x57')]()+']',JSON[_0x1810('0x2c')](_0x1cbe6f));});}; \ No newline at end of file +var _0xb35c=['%s/api/v2/tickets','remoteUri','POST','info','Ticket\x20created!','validateEmail','%s/api/v2/agents','then','length','find','contact','%s/api/v2/agents/me','Admin\x20account\x20selected.','Searching\x20enduser\x20with\x20phone','Enduser\x20not\x20found,\x20creating\x20a\x20new\x20enduser!','Enduser\x20created.','Basic\x20%s','toString','base64','[HTTP]','stringify','GET','map','string','picklist','nameField','customField','toLowerCase','content','idField','push','type','variable','variableName','Variable','name','serverUrl','monitor_format','[QUEUE]','Recording\x20is\x20enabled!','uniqueid','recordingURL','Authorization','email','The\x20User\x20ID\x20is:','calleridname','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','error','outbound','stripTrailingSlash','recordingFormat','none','[OUTBOUND]','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','destcalleridname','destcalleridnum','unmanaged','lastevent','toUpperCase','catch','lodash','util','./util','../../../../config/environment','../../../../config/logger','freshdesk','redis','defaults','localhost','socket.io-emitter','application/json','emit','Creating\x20new\x20ticket...','merge','format','calleridnum','getString','Subjects','Descriptions','Fields','mapValues','keyBy','custom_fields','value'];(function(_0x504df1,_0x289598){var _0x1063b5=function(_0x627abd){while(--_0x627abd){_0x504df1['push'](_0x504df1['shift']());}};_0x1063b5(++_0x289598);}(_0xb35c,0x1a5));var _0xcb35=function(_0x56a202,_0xad0393){_0x56a202=_0x56a202-0x0;var _0x2914e8=_0xb35c[_0x56a202];return _0x2914e8;};'use strict';var _=require(_0xcb35('0x0'));var rp=require('request-promise');var md5=require('md5');var util=require(_0xcb35('0x1'));var Redis=require('ioredis');var intUtil=require(_0xcb35('0x2'));var config=require(_0xcb35('0x3'));var logger=require(_0xcb35('0x4'))(_0xcb35('0x5'));config[_0xcb35('0x6')]=_[_0xcb35('0x7')](config[_0xcb35('0x6')],{'host':_0xcb35('0x8'),'port':0x18eb});var io=require(_0xcb35('0x9'))(new Redis(config['redis']));var headers={'Content-Type':'application/json','Accept':_0xcb35('0xa')};function emit(_0x23bb54,_0x5ae4e5,_0x2a8338){io['to'](_0x23bb54)[_0xcb35('0xb')](_0x5ae4e5,_0x2a8338);}function getTicket(_0x3e71ec,_0x1caf3c,_0xdc8d2e,_0x5dbe29,_0x4915dc){logger['info'](_0xcb35('0xc'));var _0x12513f=_[_0xcb35('0xd')]({'responder_id':_0x1caf3c['id'],'requester_id':_0xdc8d2e['id'],'name':util[_0xcb35('0xe')]('Caller\x20-\x20%s',_0x4915dc['calleridname']),'phone':_0x4915dc[_0xcb35('0xf')],'source':0x3,'priority':0x1,'status':0x2,'subject':intUtil[_0xcb35('0x10')](_0x5dbe29[_0xcb35('0x11')],_0x4915dc,'\x20'),'description':intUtil[_0xcb35('0x10')](_0x5dbe29[_0xcb35('0x12')],_0x4915dc,'
'),'tags':getTags(_0x5dbe29['Tags'],'name')},getCustomFields(_0x5dbe29[_0xcb35('0x13')],_0x4915dc));_0x12513f['custom_fields']=_[_0xcb35('0x14')](_[_0xcb35('0x15')](_0x12513f[_0xcb35('0x16')],'id'),_0xcb35('0x17'));return request({'uri':util[_0xcb35('0xe')](_0xcb35('0x18'),_0x3e71ec[_0xcb35('0x19')]),'method':_0xcb35('0x1a'),'body':_0x12513f})['then'](function(_0x11102d){logger[_0xcb35('0x1b')](_0xcb35('0x1c'));return _0x11102d;});}function getUser(_0x5e450a,_0x3c61af){if(intUtil[_0xcb35('0x1d')](_0x3c61af)){return request({'uri':util[_0xcb35('0xe')](_0xcb35('0x1e'),_0x5e450a[_0xcb35('0x19')]),'qs':{'email':_0x3c61af}})[_0xcb35('0x1f')](function(_0x522974){if(_0x522974[_0xcb35('0x20')]){logger[_0xcb35('0x1b')]('Agent\x20found!');return _[_0xcb35('0x21')](_0x522974,function(_0x4089fc){return _0x4089fc[_0xcb35('0x22')]['email']===_0x3c61af;});}else{logger[_0xcb35('0x1b')]('Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!');return request({'uri':util[_0xcb35('0xe')](_0xcb35('0x23'),_0x5e450a[_0xcb35('0x19')])})[_0xcb35('0x1f')](function(_0x5649ba){logger[_0xcb35('0x1b')](_0xcb35('0x24'));return _0x5649ba;});}});}else{logger[_0xcb35('0x1b')]('Invalid\x20email\x20format,\x20using\x20the\x20admin\x20account!');return request({'uri':util[_0xcb35('0xe')](_0xcb35('0x23'),_0x5e450a[_0xcb35('0x19')])})[_0xcb35('0x1f')](function(_0x6b85b0){logger[_0xcb35('0x1b')]('Admin\x20account\x20selected.');return _0x6b85b0;});}}function getEndUser(_0x494200,_0x2ef9fd,_0x61a25b){logger[_0xcb35('0x1b')](_0xcb35('0x25'),_0x61a25b);return request({'uri':util[_0xcb35('0xe')]('%s/api/v2/contacts',_0x494200[_0xcb35('0x19')]),'qs':{'phone':_0x61a25b}})[_0xcb35('0x1f')](function(_0x31eb13){if(_0x31eb13[_0xcb35('0x20')]){logger[_0xcb35('0x1b')]('Enduser\x20found!');return _['find'](_0x31eb13,{'phone':_0x61a25b});}else{logger['info'](_0xcb35('0x26'));return request({'uri':util['format']('%s/api/v2/contacts',_0x494200[_0xcb35('0x19')]),'method':_0xcb35('0x1a'),'body':{'name':_0x2ef9fd,'phone':_0x61a25b}})[_0xcb35('0x1f')](function(_0x333ae6){logger[_0xcb35('0x1b')](_0xcb35('0x27'));return _0x333ae6;});}});}function getAuth(_0x32c0f8){return util['format'](_0xcb35('0x28'),new Buffer(_0x32c0f8['apiKey']+':X')[_0xcb35('0x29')](_0xcb35('0x2a')));}function request(_0x2e0284){logger['debug'](_0xcb35('0x2b'),JSON[_0xcb35('0x2c')](_0x2e0284));return rp(_[_0xcb35('0x7')](_0x2e0284,{'method':_0xcb35('0x2d'),'headers':headers,'json':!![]}));}function getTags(_0x1a985b,_0x55cb2e){var _0xf98b18=[];if(_0x1a985b&&_0x1a985b[_0xcb35('0x20')]>0x0){_0xf98b18=_[_0xcb35('0x2e')](_0x1a985b,_0x55cb2e);}return _0xf98b18;}function getCustomFields(_0x5629c8,_0x5bf4c8){var _0x27b1a0=[];var _0x37e882={'custom_fields':[]};if(_0x5629c8[_0xcb35('0x20')]>0x0){_['forEach'](_0x5629c8,function(_0x4b572e){if(_['includes']([_0xcb35('0x2f'),_0xcb35('0x30')],_0x4b572e['type'])&&_0x4b572e[_0xcb35('0x31')]&&!_0x4b572e[_0xcb35('0x32')]){_0x37e882[_0x4b572e[_0xcb35('0x31')][_0xcb35('0x33')]()]=_0x4b572e[_0xcb35('0x34')][_0xcb35('0x29')]();}else if(_['includes'](['string',_0xcb35('0x30')],_0x4b572e['type'])&&_0x4b572e[_0xcb35('0x35')]&&_0x4b572e[_0xcb35('0x32')]){_0x37e882[_0xcb35('0x16')][_0xcb35('0x36')]({'id':_0x4b572e['idField'],'value':_0x4b572e[_0xcb35('0x34')]['toString']()});}else if(_0x4b572e[_0xcb35('0x37')]===_0xcb35('0x38')&&_0x4b572e[_0xcb35('0x39')]&&_0x4b572e['idField']&&_0x4b572e[_0xcb35('0x32')]){_0x5bf4c8[_0x4b572e[_0xcb35('0x39')]]&&_0x37e882['custom_fields'][_0xcb35('0x36')]({'id':_0x4b572e['idField'],'value':_0x5bf4c8[_0x4b572e['variableName']][_0xcb35('0x29')]()});}else if(_0x4b572e[_0xcb35('0x37')]==='customVariable'&&_0x4b572e[_0xcb35('0x3a')]&&_0x4b572e[_0xcb35('0x3a')]['name']&&_0x4b572e[_0xcb35('0x35')]&&_0x4b572e[_0xcb35('0x32')]){_0x5bf4c8[_0x4b572e[_0xcb35('0x3a')][_0xcb35('0x3b')][_0xcb35('0x33')]()]&&_0x37e882[_0xcb35('0x16')][_0xcb35('0x36')]({'id':_0x4b572e[_0xcb35('0x35')],'value':_0x5bf4c8[_0x4b572e[_0xcb35('0x3a')]['name'][_0xcb35('0x33')]()]['toString']()});}});}return _0x37e882;}exports['queue']=function(_0x4ac0dd,_0x4fbb6d,_0x5e6a2a,_0x46b990,_0x3d1653,_0xf17f69){var _0x34080b,_0x5ecd04;_0xf17f69[_0xcb35('0x19')]=intUtil['stripTrailingSlash'](_0xf17f69[_0xcb35('0x19')]);_0xf17f69[_0xcb35('0x3c')]=intUtil['stripTrailingSlash'](_0xf17f69[_0xcb35('0x3c')]);if(_0x3d1653&&_0x3d1653[_0xcb35('0x3d')]){logger[_0xcb35('0x1b')](_0xcb35('0x3e'),_0xcb35('0x3f'));_0x4fbb6d['recordingURL']=util[_0xcb35('0xe')]('%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s',_0xf17f69[_0xcb35('0x3c')],_0x4fbb6d[_0xcb35('0x40')],md5(_0x4fbb6d[_0xcb35('0x40')]));}else{_0x4fbb6d[_0xcb35('0x41')]='';}headers[_0xcb35('0x42')]=getAuth(_0xf17f69);return getUser(_0xf17f69,_0x46b990[_0xcb35('0x43')])[_0xcb35('0x1f')](function(_0x1d4cde){_0x34080b=_0x1d4cde;logger['info'](_0xcb35('0x44'),_0x34080b['id']);return getEndUser(_0xf17f69,_0x4fbb6d[_0xcb35('0x45')],_0x4fbb6d[_0xcb35('0xf')]);})[_0xcb35('0x1f')](function(_0xa3f6a5){_0x5ecd04=_0xa3f6a5;logger[_0xcb35('0x1b')](_0xcb35('0x46'),_0x5ecd04['id']);return getTicket(_0xf17f69,_0x34080b,_0x5ecd04,_0x5e6a2a,_0x4fbb6d);})[_0xcb35('0x1f')](function(_0x124ac8){if(_0x124ac8&&_0x124ac8['id']){logger[_0xcb35('0x1b')](_0xcb35('0x1c'));logger[_0xcb35('0x1b')](_0xcb35('0x47'),_0x124ac8['id']);logger[_0xcb35('0x1b')](_0xcb35('0x3e'),_0xcb35('0x48'));emit(util[_0xcb35('0xe')](_0xcb35('0x49'),_0x46b990[_0xcb35('0x3b')]),_0xcb35('0x4a'),{'uri':util['format'](_0xcb35('0x4b'),_0xf17f69[_0xcb35('0x19')],_0x124ac8['id'])});}})['catch'](function(_0x55a2f4){logger[_0xcb35('0x4c')]('[QUEUE]',JSON[_0xcb35('0x2c')](_0x55a2f4));});};exports[_0xcb35('0x4d')]=function(_0x437cc2,_0x10531e,_0x2db538,_0x16d162,_0x131e79,_0x5048d0,_0x3fa02f){var _0x2709b,_0x5bfdf6;_0x5048d0[_0xcb35('0x19')]=intUtil[_0xcb35('0x4e')](_0x5048d0[_0xcb35('0x19')]);_0x5048d0[_0xcb35('0x3c')]=intUtil[_0xcb35('0x4e')](_0x5048d0['serverUrl']);if(_0x3fa02f&&_0x3fa02f[_0xcb35('0x4f')]&&_0x3fa02f[_0xcb35('0x4f')]!==_0xcb35('0x50')){logger[_0xcb35('0x1b')](_0xcb35('0x51'),_0xcb35('0x3f'));_0x10531e['recordingURL']=util['format'](_0xcb35('0x52'),_0x5048d0['serverUrl'],_0x10531e['uniqueid'],md5(_0x10531e[_0xcb35('0x40')]));}headers[_0xcb35('0x42')]=getAuth(_0x5048d0);return getUser(_0x5048d0,_0x16d162['email'])[_0xcb35('0x1f')](function(_0x121bae){_0x2709b=_0x121bae;logger['info'](_0xcb35('0x44'),_0x2709b['id']);return getEndUser(_0x5048d0,_0x10531e[_0xcb35('0x53')],_0x10531e[_0xcb35('0x54')]);})['then'](function(_0x10fb03){_0x5bfdf6=_0x10fb03;logger['info'](_0xcb35('0x46'),_0x5bfdf6['id']);return getTicket(_0x5048d0,_0x2709b,_0x5bfdf6,_0x2db538,_0x10531e);})['then'](function(_0x201910){if(_0x201910&&_0x201910['id']){logger['info']('Ticket\x20created!');logger[_0xcb35('0x1b')](_0xcb35('0x47'),_0x201910['id']);logger[_0xcb35('0x1b')](_0xcb35('0x51'),_0xcb35('0x48'));emit(util[_0xcb35('0xe')](_0xcb35('0x49'),_0x16d162['name']),_0xcb35('0x4a'),{'uri':util[_0xcb35('0xe')](_0xcb35('0x4b'),_0x5048d0[_0xcb35('0x19')],_0x201910['id'])});}})['catch'](function(_0x5acfac){logger[_0xcb35('0x4c')](_0xcb35('0x51'),JSON[_0xcb35('0x2c')](_0x5acfac));});};exports[_0xcb35('0x55')]=function(_0x16715e,_0x1461e6,_0x321fd5,_0x408f9c,_0x3121f6,_0x3fbc2a){var _0x316334,_0x463c8f;_0x3fbc2a[_0xcb35('0x19')]=intUtil[_0xcb35('0x4e')](_0x3fbc2a[_0xcb35('0x19')]);_0x3fbc2a[_0xcb35('0x3c')]=intUtil[_0xcb35('0x4e')](_0x3fbc2a['serverUrl']);if(_0x3121f6&&_0x3121f6[_0xcb35('0x3d')]){logger[_0xcb35('0x1b')]('['+_0x1461e6[_0xcb35('0x56')][_0xcb35('0x57')]()+']',_0xcb35('0x3f'));_0x1461e6[_0xcb35('0x41')]=util[_0xcb35('0xe')](_0xcb35('0x52'),_0x3fbc2a['serverUrl'],_0x1461e6['uniqueid'],md5(_0x1461e6[_0xcb35('0x40')]));}else{_0x1461e6[_0xcb35('0x41')]='';}headers[_0xcb35('0x42')]=getAuth(_0x3fbc2a);return getUser(_0x3fbc2a,'')['then'](function(_0x1497ef){_0x316334=_0x1497ef;logger[_0xcb35('0x1b')](_0xcb35('0x44'),_0x316334['id']);return getEndUser(_0x3fbc2a,_0x1461e6[_0xcb35('0x45')],_0x1461e6['calleridnum']);})[_0xcb35('0x1f')](function(_0x2ffe47){_0x463c8f=_0x2ffe47;logger[_0xcb35('0x1b')]('The\x20Enduser\x20ID\x20is:',_0x463c8f['id']);return getTicket(_0x3fbc2a,_0x316334,_0x463c8f,_0x321fd5,_0x1461e6);})[_0xcb35('0x1f')](function(_0x5d1a04){if(_0x5d1a04){logger[_0xcb35('0x1b')](_0xcb35('0x1c'));logger[_0xcb35('0x1b')](_0xcb35('0x47'),_0x5d1a04['id']);}})[_0xcb35('0x58')](function(_0x58e13f){logger[_0xcb35('0x4c')]('['+_0x1461e6[_0xcb35('0x56')][_0xcb35('0x57')]()+']',JSON['stringify'](_0x58e13f));});}; \ 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 0718f2a..55d2277 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 _0x7b50=['unmanaged','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','uniqueid','monitor_format','[QUEUE]','recordingURL','recordingFormat','none','Recording\x20is\x20enabled!','The\x20ticket\x20ID\x20is:\x20%s','name','lodash','request-promise','md5','util','moment','bluebird','ioredis','./util','../../../../config/environment','freshsales','redis','defaults','socket.io-emitter','GET','/api/selector/owners','info','Getting\x20admin\x20information','then','users','email','adminEmail','adminId','Admin\x20found:','Requested\x20Resource\x20not\x20Found','catch','error','toUpperCase','message','headers','Getting\x20user\x20list','agentEmail','Getting\x20user\x20with\x20email','userEmail','length','userId','User\x20found:','Admin\x20selected','/api/lookup?q=','&f=','&entities=contact','contacts','Searching\x20contact\x20with\x20phone\x20%s','contactNumber','mobile_number','endUserId','Contact\x20found\x20mobile_number:','work_number','Contact\x20found\x20work_number:','Contact\x20created:','/api/contacts','format','YYYY-MM-DDTHH:mm:ss','Contact\x20not\x20found,\x20creating\x20a\x20new\x20contact','contact','Creating\x20new\x20task','/api/tasks','getString','Subjects','Contact','add','ticketId','Task\x20created:','user:%s','trigger:browser:url','Token\x20token=','remoteUri','stripTrailingSlash','serverUrl','username','outbound','destcalleridnum','calleridnum','callDirection'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x7b50,0xb3));var _0x07b5=function(_0x5a5cc9,_0x1ebc95){_0x5a5cc9=_0x5a5cc9-0x0;var _0xf70eee=_0x7b50[_0x5a5cc9];return _0xf70eee;};'use strict';var _=require(_0x07b5('0x0'));var rp=require(_0x07b5('0x1'));var md5=require(_0x07b5('0x2'));var util=require(_0x07b5('0x3'));var moment=require(_0x07b5('0x4'));var Promise=require(_0x07b5('0x5'));var Redis=require(_0x07b5('0x6'));var intUtil=require(_0x07b5('0x7'));var config=require(_0x07b5('0x8'));var logger=require('../../../../config/logger')(_0x07b5('0x9'));config[_0x07b5('0xa')]=_[_0x07b5('0xb')](config[_0x07b5('0xa')],{'host':'localhost','port':0x18eb});var io=require(_0x07b5('0xc'))(new Redis(config['redis']));function getAdminId(_0xbccfde,_0xa4375b,_0x65a798,_0x928c40){return new Promise(function(_0x1f7e1d,_0xfe2342){var _0x2a33a5=![];var _0x162f96={'method':_0x07b5('0xd'),'uri':_0x928c40+_0x07b5('0xe'),'json':!![]};_0x162f96['headers']=_0x65a798;logger[_0x07b5('0xf')](_0x07b5('0x10'));return rp(_0x162f96)[_0x07b5('0x11')](function(_0x582d4c){if(_0x582d4c){var _0x17648c=_0x582d4c[_0x07b5('0x12')];var _0x5575af=null;for(_0x5575af=0x0;_0x5575af<_0x17648c['length'];_0x5575af++){if(_0x17648c[_0x5575af][_0x07b5('0x13')]===_0xbccfde[_0x07b5('0x14')]){_0xbccfde[_0x07b5('0x15')]=_0x17648c[_0x5575af]['id'];_0x2a33a5=!![];}}if(_0x2a33a5){logger[_0x07b5('0xf')](_0x07b5('0x16'),_0xbccfde[_0x07b5('0x15')]);_0x1f7e1d(_0xbccfde);}else{_0xfe2342({'statusCode':0x194,'message':_0x07b5('0x17')});}}else{_0xfe2342({'statusCode':0x194,'message':'Requested\x20Resource\x20not\x20Found'});}})[_0x07b5('0x18')](function(_0x347752){logger[_0x07b5('0x19')]('['+[_0xa4375b[_0x07b5('0x1a')]()]+']',_0x347752[_0x07b5('0x1b')]);_0xfe2342(_0x347752);});});}function getUser(_0x28eea0,_0x6b0eb1,_0x2d5db1){return function(_0x1088a4){return new Promise(function(_0x29b71e,_0x136d5f){var _0xbb561f={'method':'GET','uri':_0x2d5db1+_0x07b5('0xe'),'json':!![]};_0xbb561f[_0x07b5('0x1c')]=_0x6b0eb1;logger[_0x07b5('0xf')](_0x07b5('0x1d'));return rp(_0xbb561f)[_0x07b5('0x11')](function(_0x306673){if(_0x306673){var _0x2a63c0=_0x306673['users'];var _0x13a9a7=![];var _0x1ac12d=null;if(_0x1088a4[_0x07b5('0x1e')]!==null){logger[_0x07b5('0xf')](_0x07b5('0x1f'),_0x1088a4[_0x07b5('0x1e')]);_0x1088a4[_0x07b5('0x20')]=_0x1088a4[_0x07b5('0x1e')];for(_0x1ac12d=0x0;_0x1ac12d<_0x2a63c0[_0x07b5('0x21')];_0x1ac12d++){if(_0x2a63c0[_0x1ac12d][_0x07b5('0x13')]===_0x1088a4[_0x07b5('0x1e')]){_0x13a9a7=!![];_0x1088a4[_0x07b5('0x22')]=_0x2a63c0[_0x1ac12d]['id'];logger[_0x07b5('0xf')](_0x07b5('0x23'),_0x1088a4[_0x07b5('0x22')]);}}}if(!_0x13a9a7){logger[_0x07b5('0xf')](_0x07b5('0x24'));_0x1088a4['userEmail']=_0x1088a4[_0x07b5('0x14')];_0x1088a4[_0x07b5('0x22')]=_0x1088a4[_0x07b5('0x15')];_0x13a9a7=!![];}if(_0x13a9a7){_0x29b71e(_0x1088a4);}else{_0x136d5f({'statusCode':0x194,'message':_0x07b5('0x17')});}}else{_0x136d5f({'statusCode':0x194,'message':'Requested\x20Resource\x20not\x20Found'});}})[_0x07b5('0x18')](function(_0x9f43ba){logger['error']('['+[_0x28eea0[_0x07b5('0x1a')]()]+']',_0x9f43ba[_0x07b5('0x1b')]);_0x136d5f(_0x9f43ba);});});};}function searchContact(_0x55ee78,_0x36f432,_0x3cd9d1,_0x25d6f4){return new Promise(function(_0x393956,_0x247f65){var _0x4a489d={'method':_0x07b5('0xd'),'headers':_0x36f432,'uri':_0x55ee78+_0x07b5('0x25')+_0x25d6f4+_0x07b5('0x26')+_0x3cd9d1+_0x07b5('0x27'),'json':!![]};rp(_0x4a489d)[_0x07b5('0x11')](function(_0x470fbf){var _0x24548c=_['find'](_0x470fbf[_0x07b5('0x28')][_0x07b5('0x28')],[_0x3cd9d1,_0x25d6f4]);_0x393956(_0x24548c);})[_0x07b5('0x18')](function(_0x2ae05a){_0x247f65(_0x2ae05a);});});}function getEndUser(_0x40757c,_0x13d7ec,_0x2c07c5){return function(_0x2bd50c){return new Promise(function(_0x22dbf7,_0x9eaaef){logger['info'](util['format'](_0x07b5('0x29'),_0x2bd50c[_0x07b5('0x2a')]));searchContact(_0x2c07c5,_0x13d7ec,_0x07b5('0x2b'),_0x2bd50c[_0x07b5('0x2a')])[_0x07b5('0x11')](function(_0x3846df){if(_0x3846df){_0x2bd50c[_0x07b5('0x2c')]=_0x3846df['id'];logger[_0x07b5('0xf')](_0x07b5('0x2d'),_0x2bd50c['endUserId']);return _0x22dbf7(_0x2bd50c);}searchContact(_0x2c07c5,_0x13d7ec,_0x07b5('0x2e'),_0x2bd50c[_0x07b5('0x2a')])[_0x07b5('0x11')](function(_0x6199d8){if(_0x6199d8){_0x2bd50c[_0x07b5('0x2c')]=_0x6199d8['id'];logger['info'](_0x07b5('0x2f'),_0x2bd50c[_0x07b5('0x2c')]);return _0x22dbf7(_0x2bd50c);}createEndUser(_0x2bd50c,_0x40757c,_0x13d7ec,_0x2c07c5)['then'](function(_0x2b5cbd){logger[_0x07b5('0xf')](_0x07b5('0x30'),_0x2b5cbd[_0x07b5('0x2c')]);return _0x22dbf7(_0x2b5cbd);});});})[_0x07b5('0x18')](function(_0x2d6da3){_0x9eaaef(_0x2d6da3);});});};}function createEndUser(_0xfe4938,_0x543c15,_0x389529,_0x293f72){return new Promise(function(_0x2d1e06,_0x1ffe34){var _0x46a1fe=moment();var _0x594aeb={'method':'POST','uri':_0x293f72+_0x07b5('0x31'),'body':{'contact':{'last_name':_0xfe4938[_0x07b5('0x2a')],'work_number':_0xfe4938[_0x07b5('0x2a')],'mobile_number':_0xfe4938[_0x07b5('0x2a')],'owner_id':_0xfe4938[_0x07b5('0x22')],'created_at':_0x46a1fe[_0x07b5('0x32')](_0x07b5('0x33'))}},'json':!![]};_0x594aeb[_0x07b5('0x1c')]=_0x389529;logger[_0x07b5('0xf')](_0x07b5('0x34'));return rp(_0x594aeb)['then'](function(_0x282f37){_0xfe4938['endUserId']=_0x282f37[_0x07b5('0x35')]['id'];_0x2d1e06(_0xfe4938);})['catch'](function(_0x5275cd){logger[_0x07b5('0x19')]('['+[_0x543c15[_0x07b5('0x1a')]()]+']',_0x5275cd[_0x07b5('0x1b')]);_0x1ffe34(_0x5275cd[_0x07b5('0x1b')]);});});}function getTicket(_0xb5feb6,_0x1bc193,_0x34be0f,_0xc91d2,_0x32d346){return function(_0x413183){logger['info'](_0x07b5('0x36'));return new Promise(function(_0x9a6f70,_0x5653b1){var _0x49ac18=moment();var _0x427bc0={'method':'POST','uri':_0x34be0f+_0x07b5('0x37'),'body':{'title':intUtil[_0x07b5('0x38')](_0xc91d2[_0x07b5('0x39')],_0x32d346,'\x20'),'description':intUtil[_0x07b5('0x38')](_0xc91d2['Descriptions'],_0x32d346,'\x0a'),'owner_id':_0x413183[_0x07b5('0x22')],'creater_id':_0x413183['adminId'],'targetable_id':_0x413183[_0x07b5('0x2c')],'targetable_type':_0x07b5('0x3a'),'created_at':_0x49ac18[_0x07b5('0x32')](_0x07b5('0x33')),'due_date':_0x49ac18[_0x07b5('0x3b')](0x1e,'m')['format'](_0x07b5('0x33'))},'json':!![]};_0x427bc0[_0x07b5('0x1c')]=_0x1bc193;return rp(_0x427bc0)['then'](function(_0x5c304b){_0x413183[_0x07b5('0x3c')]=_0x5c304b['task']['id'];logger[_0x07b5('0xf')](_0x07b5('0x3d'),_0x413183[_0x07b5('0x3c')]);_0x9a6f70(_0x413183);})[_0x07b5('0x18')](function(_0x194e07){logger[_0x07b5('0x19')]('['+[_0xb5feb6[_0x07b5('0x1a')]()]+']',_0x194e07['message']);_0x5653b1(_0x194e07['message']);});});};}function emit(_0x17174e,_0x2a6dc6,_0x56b0a4){var _0x2a2e89={'uri':_0x17174e+'/contacts/'+_0x56b0a4};io['to'](util[_0x07b5('0x32')](_0x07b5('0x3e'),_0x2a6dc6))['emit'](_0x07b5('0x3f'),_0x2a2e89);}exports['cs']=function(_0x1c2757,_0x18d459,_0x136f4e,_0x20c450,_0x238e9f,_0x233fd1,_0x1708db,_0x4d43e0){var _0x4c9cf6={};var _0x12ed96={'Authorization':_0x07b5('0x40')+_0x233fd1['apiKey']};_0x233fd1[_0x07b5('0x41')]=intUtil[_0x07b5('0x42')](_0x233fd1[_0x07b5('0x41')]);_0x233fd1[_0x07b5('0x43')]=intUtil[_0x07b5('0x42')](_0x233fd1['serverUrl']);var _0x1c2a74=_0x233fd1[_0x07b5('0x41')];_0x4c9cf6[_0x07b5('0x14')]=_0x233fd1[_0x07b5('0x44')];_0x4c9cf6[_0x07b5('0x2a')]=_0x4d43e0['toLowerCase']()===_0x07b5('0x45')?_0x18d459[_0x07b5('0x46')]:_0x18d459[_0x07b5('0x47')];_0x4c9cf6[_0x07b5('0x48')]=_0x4d43e0==='queue'||_0x4d43e0===_0x07b5('0x49')?'queue':_0x07b5('0x45');if(_0x20c450){_0x4c9cf6[_0x07b5('0x1e')]=_0x20c450[_0x07b5('0x13')];}var _0x2e481c=util[_0x07b5('0x32')](_0x07b5('0x4a'),_0x233fd1[_0x07b5('0x43')],_0x18d459[_0x07b5('0x4b')],md5(_0x18d459['uniqueid']));if(_0x238e9f&&_0x238e9f[_0x07b5('0x4c')]){logger[_0x07b5('0xf')](_0x07b5('0x4d'),'Recording\x20is\x20enabled!');_0x18d459[_0x07b5('0x4e')]=_0x2e481c;}else if(_0x1708db&&_0x1708db[_0x07b5('0x4f')]&&_0x1708db[_0x07b5('0x4f')]!==_0x07b5('0x50')){logger[_0x07b5('0xf')]('[OUTBOUND]',_0x07b5('0x51'));_0x18d459[_0x07b5('0x4e')]=_0x2e481c;}else{_0x18d459[_0x07b5('0x4e')]='';}return getAdminId(_0x4c9cf6,_0x4d43e0,_0x12ed96,_0x1c2a74)[_0x07b5('0x11')](getUser(_0x4d43e0,_0x12ed96,_0x1c2a74))[_0x07b5('0x11')](getEndUser(_0x4d43e0,_0x12ed96,_0x1c2a74))[_0x07b5('0x11')](getTicket(_0x4d43e0,_0x12ed96,_0x1c2a74,_0x136f4e,_0x18d459))[_0x07b5('0x11')](function(_0xf320bc){logger[_0x07b5('0xf')](util['format'](_0x07b5('0x52'),_0xf320bc[_0x07b5('0x3c')]));if(_0x4d43e0!==_0x07b5('0x49')){logger[_0x07b5('0xf')]('['+[_0x4d43e0['toUpperCase']()]+']','Displaying\x20task\x20in\x20a\x20new\x20tab...');emit(_0x1c2a74,_0x20c450[_0x07b5('0x53')],_0xf320bc[_0x07b5('0x2c')]);}})['catch'](function(_0x336d2d){logger[_0x07b5('0x19')]('['+[_0x4d43e0[_0x07b5('0x1a')]()]+']\x20Error\x20running\x20Freshsales\x20integration',util['inspect'](_0x336d2d,{'showHidden':!![],'depth':null}));});}; \ No newline at end of file +var _0x2b00=['lodash','request-promise','util','bluebird','ioredis','./util','../../../../config/environment','../../../../config/logger','freshsales','redis','defaults','localhost','socket.io-emitter','GET','info','users','length','email','adminEmail','adminId','Admin\x20found:','Requested\x20Resource\x20not\x20Found','catch','error','toUpperCase','message','/api/selector/owners','headers','then','agentEmail','Getting\x20user\x20with\x20email','userEmail','userId','User\x20found:','Admin\x20selected','/api/lookup?q=','&f=','&entities=contact','contacts','format','Searching\x20contact\x20with\x20phone\x20%s','contactNumber','endUserId','Contact\x20found\x20mobile_number:','work_number','Contact\x20created:','POST','/api/contacts','YYYY-MM-DDTHH:mm:ss','Contact\x20not\x20found,\x20creating\x20a\x20new\x20contact','contact','Creating\x20new\x20task','/api/tasks','getString','Descriptions','add','ticketId','/contacts/','trigger:browser:url','apiKey','stripTrailingSlash','remoteUri','serverUrl','outbound','destcalleridnum','calleridnum','queue','unmanaged','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','uniqueid','[QUEUE]','Recording\x20is\x20enabled!','recordingFormat','none','recordingURL','The\x20ticket\x20ID\x20is:\x20%s','Displaying\x20task\x20in\x20a\x20new\x20tab...','name',']\x20Error\x20running\x20Freshsales\x20integration','inspect'];(function(_0x18feb3,_0x1b9d62){var _0x16e7a0=function(_0x3cb24b){while(--_0x3cb24b){_0x18feb3['push'](_0x18feb3['shift']());}};_0x16e7a0(++_0x1b9d62);}(_0x2b00,0x190));var _0x02b0=function(_0x3857b1,_0x8ac71f){_0x3857b1=_0x3857b1-0x0;var _0x1ad85c=_0x2b00[_0x3857b1];return _0x1ad85c;};'use strict';var _=require(_0x02b0('0x0'));var rp=require(_0x02b0('0x1'));var md5=require('md5');var util=require(_0x02b0('0x2'));var moment=require('moment');var Promise=require(_0x02b0('0x3'));var Redis=require(_0x02b0('0x4'));var intUtil=require(_0x02b0('0x5'));var config=require(_0x02b0('0x6'));var logger=require(_0x02b0('0x7'))(_0x02b0('0x8'));config[_0x02b0('0x9')]=_[_0x02b0('0xa')](config[_0x02b0('0x9')],{'host':_0x02b0('0xb'),'port':0x18eb});var io=require(_0x02b0('0xc'))(new Redis(config[_0x02b0('0x9')]));function getAdminId(_0x547cc2,_0x1264d5,_0x204498,_0x2023dc){return new Promise(function(_0x41cd89,_0x14de6e){var _0xd1ca26=![];var _0xef4524={'method':_0x02b0('0xd'),'uri':_0x2023dc+'/api/selector/owners','json':!![]};_0xef4524['headers']=_0x204498;logger[_0x02b0('0xe')]('Getting\x20admin\x20information');return rp(_0xef4524)['then'](function(_0x152c25){if(_0x152c25){var _0x172253=_0x152c25[_0x02b0('0xf')];var _0x2b75d6=null;for(_0x2b75d6=0x0;_0x2b75d6<_0x172253[_0x02b0('0x10')];_0x2b75d6++){if(_0x172253[_0x2b75d6][_0x02b0('0x11')]===_0x547cc2[_0x02b0('0x12')]){_0x547cc2[_0x02b0('0x13')]=_0x172253[_0x2b75d6]['id'];_0xd1ca26=!![];}}if(_0xd1ca26){logger[_0x02b0('0xe')](_0x02b0('0x14'),_0x547cc2[_0x02b0('0x13')]);_0x41cd89(_0x547cc2);}else{_0x14de6e({'statusCode':0x194,'message':_0x02b0('0x15')});}}else{_0x14de6e({'statusCode':0x194,'message':_0x02b0('0x15')});}})[_0x02b0('0x16')](function(_0x1bfa00){logger[_0x02b0('0x17')]('['+[_0x1264d5[_0x02b0('0x18')]()]+']',_0x1bfa00[_0x02b0('0x19')]);_0x14de6e(_0x1bfa00);});});}function getUser(_0x1db141,_0x1f8400,_0x5973b4){return function(_0x151242){return new Promise(function(_0xa8426e,_0x29d589){var _0x2d6854={'method':_0x02b0('0xd'),'uri':_0x5973b4+_0x02b0('0x1a'),'json':!![]};_0x2d6854[_0x02b0('0x1b')]=_0x1f8400;logger['info']('Getting\x20user\x20list');return rp(_0x2d6854)[_0x02b0('0x1c')](function(_0x519738){if(_0x519738){var _0x2ebbc2=_0x519738[_0x02b0('0xf')];var _0x493cb9=![];var _0x38d7d7=null;if(_0x151242[_0x02b0('0x1d')]!==null){logger['info'](_0x02b0('0x1e'),_0x151242[_0x02b0('0x1d')]);_0x151242[_0x02b0('0x1f')]=_0x151242['agentEmail'];for(_0x38d7d7=0x0;_0x38d7d7<_0x2ebbc2[_0x02b0('0x10')];_0x38d7d7++){if(_0x2ebbc2[_0x38d7d7][_0x02b0('0x11')]===_0x151242[_0x02b0('0x1d')]){_0x493cb9=!![];_0x151242[_0x02b0('0x20')]=_0x2ebbc2[_0x38d7d7]['id'];logger['info'](_0x02b0('0x21'),_0x151242[_0x02b0('0x20')]);}}}if(!_0x493cb9){logger['info'](_0x02b0('0x22'));_0x151242[_0x02b0('0x1f')]=_0x151242[_0x02b0('0x12')];_0x151242[_0x02b0('0x20')]=_0x151242['adminId'];_0x493cb9=!![];}if(_0x493cb9){_0xa8426e(_0x151242);}else{_0x29d589({'statusCode':0x194,'message':_0x02b0('0x15')});}}else{_0x29d589({'statusCode':0x194,'message':'Requested\x20Resource\x20not\x20Found'});}})[_0x02b0('0x16')](function(_0x655e37){logger['error']('['+[_0x1db141[_0x02b0('0x18')]()]+']',_0x655e37[_0x02b0('0x19')]);_0x29d589(_0x655e37);});});};}function searchContact(_0x5f5d40,_0x2a34fb,_0x23a8ed,_0x53d9a4){return new Promise(function(_0x116108,_0x42a9c8){var _0x16bae5={'method':_0x02b0('0xd'),'headers':_0x2a34fb,'uri':_0x5f5d40+_0x02b0('0x23')+_0x53d9a4+_0x02b0('0x24')+_0x23a8ed+_0x02b0('0x25'),'json':!![]};rp(_0x16bae5)[_0x02b0('0x1c')](function(_0x4227fc){var _0x19a566=_['find'](_0x4227fc[_0x02b0('0x26')][_0x02b0('0x26')],[_0x23a8ed,_0x53d9a4]);_0x116108(_0x19a566);})[_0x02b0('0x16')](function(_0x2a2adc){_0x42a9c8(_0x2a2adc);});});}function getEndUser(_0xf69427,_0x333695,_0x12d686){return function(_0x577fb1){return new Promise(function(_0xcf9b94,_0x1da2c5){logger[_0x02b0('0xe')](util[_0x02b0('0x27')](_0x02b0('0x28'),_0x577fb1[_0x02b0('0x29')]));searchContact(_0x12d686,_0x333695,'mobile_number',_0x577fb1['contactNumber'])[_0x02b0('0x1c')](function(_0xd84da6){if(_0xd84da6){_0x577fb1[_0x02b0('0x2a')]=_0xd84da6['id'];logger['info'](_0x02b0('0x2b'),_0x577fb1[_0x02b0('0x2a')]);return _0xcf9b94(_0x577fb1);}searchContact(_0x12d686,_0x333695,_0x02b0('0x2c'),_0x577fb1['contactNumber'])[_0x02b0('0x1c')](function(_0x5dd595){if(_0x5dd595){_0x577fb1[_0x02b0('0x2a')]=_0x5dd595['id'];logger['info']('Contact\x20found\x20work_number:',_0x577fb1['endUserId']);return _0xcf9b94(_0x577fb1);}createEndUser(_0x577fb1,_0xf69427,_0x333695,_0x12d686)[_0x02b0('0x1c')](function(_0x11aa5c){logger[_0x02b0('0xe')](_0x02b0('0x2d'),_0x11aa5c['endUserId']);return _0xcf9b94(_0x11aa5c);});});})['catch'](function(_0x472ae3){_0x1da2c5(_0x472ae3);});});};}function createEndUser(_0x18f85a,_0x139715,_0x5e4cfd,_0x3d5d30){return new Promise(function(_0x2f3d70,_0x18f8cd){var _0x33e557=moment();var _0x214628={'method':_0x02b0('0x2e'),'uri':_0x3d5d30+_0x02b0('0x2f'),'body':{'contact':{'last_name':_0x18f85a[_0x02b0('0x29')],'work_number':_0x18f85a[_0x02b0('0x29')],'mobile_number':_0x18f85a[_0x02b0('0x29')],'owner_id':_0x18f85a[_0x02b0('0x20')],'created_at':_0x33e557[_0x02b0('0x27')](_0x02b0('0x30'))}},'json':!![]};_0x214628[_0x02b0('0x1b')]=_0x5e4cfd;logger[_0x02b0('0xe')](_0x02b0('0x31'));return rp(_0x214628)[_0x02b0('0x1c')](function(_0x3c10d2){_0x18f85a['endUserId']=_0x3c10d2[_0x02b0('0x32')]['id'];_0x2f3d70(_0x18f85a);})[_0x02b0('0x16')](function(_0x3a7769){logger[_0x02b0('0x17')]('['+[_0x139715[_0x02b0('0x18')]()]+']',_0x3a7769['message']);_0x18f8cd(_0x3a7769['message']);});});}function getTicket(_0xc6ab33,_0x536a11,_0x432e4c,_0x4cba5c,_0x120b40){return function(_0x2a089b){logger['info'](_0x02b0('0x33'));return new Promise(function(_0x149eab,_0x43d813){var _0x38804e=moment();var _0x19a194={'method':_0x02b0('0x2e'),'uri':_0x432e4c+_0x02b0('0x34'),'body':{'title':intUtil[_0x02b0('0x35')](_0x4cba5c['Subjects'],_0x120b40,'\x20'),'description':intUtil[_0x02b0('0x35')](_0x4cba5c[_0x02b0('0x36')],_0x120b40,'\x0a'),'owner_id':_0x2a089b[_0x02b0('0x20')],'creater_id':_0x2a089b['adminId'],'targetable_id':_0x2a089b[_0x02b0('0x2a')],'targetable_type':'Contact','created_at':_0x38804e[_0x02b0('0x27')]('YYYY-MM-DDTHH:mm:ss'),'due_date':_0x38804e[_0x02b0('0x37')](0x1e,'m')[_0x02b0('0x27')]('YYYY-MM-DDTHH:mm:ss')},'json':!![]};_0x19a194[_0x02b0('0x1b')]=_0x536a11;return rp(_0x19a194)[_0x02b0('0x1c')](function(_0x39f62c){_0x2a089b[_0x02b0('0x38')]=_0x39f62c['task']['id'];logger[_0x02b0('0xe')]('Task\x20created:',_0x2a089b[_0x02b0('0x38')]);_0x149eab(_0x2a089b);})[_0x02b0('0x16')](function(_0x431d48){logger[_0x02b0('0x17')]('['+[_0xc6ab33[_0x02b0('0x18')]()]+']',_0x431d48[_0x02b0('0x19')]);_0x43d813(_0x431d48[_0x02b0('0x19')]);});});};}function emit(_0x317364,_0x30a0ff,_0x48b2d2){var _0x5bb30d={'uri':_0x317364+_0x02b0('0x39')+_0x48b2d2};io['to'](util['format']('user:%s',_0x30a0ff))['emit'](_0x02b0('0x3a'),_0x5bb30d);}exports['cs']=function(_0x508ceb,_0x3c62c0,_0x47d7be,_0x2f8936,_0x2867c7,_0x4771ab,_0x300991,_0x2bdb5f){var _0x48005={};var _0x346018={'Authorization':'Token\x20token='+_0x4771ab[_0x02b0('0x3b')]};_0x4771ab['remoteUri']=intUtil[_0x02b0('0x3c')](_0x4771ab[_0x02b0('0x3d')]);_0x4771ab[_0x02b0('0x3e')]=intUtil[_0x02b0('0x3c')](_0x4771ab[_0x02b0('0x3e')]);var _0x3fa66d=_0x4771ab['remoteUri'];_0x48005[_0x02b0('0x12')]=_0x4771ab['username'];_0x48005[_0x02b0('0x29')]=_0x2bdb5f['toLowerCase']()===_0x02b0('0x3f')?_0x3c62c0[_0x02b0('0x40')]:_0x3c62c0[_0x02b0('0x41')];_0x48005['callDirection']=_0x2bdb5f===_0x02b0('0x42')||_0x2bdb5f===_0x02b0('0x43')?'queue':_0x02b0('0x3f');if(_0x2f8936){_0x48005[_0x02b0('0x1d')]=_0x2f8936[_0x02b0('0x11')];}var _0x142798=util[_0x02b0('0x27')](_0x02b0('0x44'),_0x4771ab[_0x02b0('0x3e')],_0x3c62c0[_0x02b0('0x45')],md5(_0x3c62c0[_0x02b0('0x45')]));if(_0x2867c7&&_0x2867c7['monitor_format']){logger[_0x02b0('0xe')](_0x02b0('0x46'),_0x02b0('0x47'));_0x3c62c0['recordingURL']=_0x142798;}else if(_0x300991&&_0x300991[_0x02b0('0x48')]&&_0x300991[_0x02b0('0x48')]!==_0x02b0('0x49')){logger[_0x02b0('0xe')]('[OUTBOUND]','Recording\x20is\x20enabled!');_0x3c62c0[_0x02b0('0x4a')]=_0x142798;}else{_0x3c62c0[_0x02b0('0x4a')]='';}return getAdminId(_0x48005,_0x2bdb5f,_0x346018,_0x3fa66d)[_0x02b0('0x1c')](getUser(_0x2bdb5f,_0x346018,_0x3fa66d))[_0x02b0('0x1c')](getEndUser(_0x2bdb5f,_0x346018,_0x3fa66d))['then'](getTicket(_0x2bdb5f,_0x346018,_0x3fa66d,_0x47d7be,_0x3c62c0))[_0x02b0('0x1c')](function(_0x376674){logger[_0x02b0('0xe')](util[_0x02b0('0x27')](_0x02b0('0x4b'),_0x376674[_0x02b0('0x38')]));if(_0x2bdb5f!==_0x02b0('0x43')){logger[_0x02b0('0xe')]('['+[_0x2bdb5f[_0x02b0('0x18')]()]+']',_0x02b0('0x4c'));emit(_0x3fa66d,_0x2f8936[_0x02b0('0x4d')],_0x376674['endUserId']);}})[_0x02b0('0x16')](function(_0x4fd098){logger[_0x02b0('0x17')]('['+[_0x2bdb5f[_0x02b0('0x18')]()]+_0x02b0('0x4e'),util[_0x02b0('0x4f')](_0x4fd098,{'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 f9b9a63..c387221 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 _0xb96f=['exec','includes','data1','toLowerCase','data2','find','Configurations','data3','queue','routeId','EVENT\x20UNKNOWN','unmanaged','servicenow','unknown\x20integration','../../../../config/logger','[EXEC]','format','%s\x20configuration\x20#%s\x20not\x20found','error','%s\x20account\x20#%s\x20not\x20found','util','./salesforce','./sugarcrm','./freshdesk','./zoho','./desk','./vtiger','./servicenow','./dynamics365','zendesk','salesforce','sugarcrm','freshdesk','zoho','desk','vtiger','dynamics365','freshsales'];(function(_0x43026c,_0x16e088){var _0x4c35b4=function(_0x12ee61){while(--_0x12ee61){_0x43026c['push'](_0x43026c['shift']());}};_0x4c35b4(++_0x16e088);}(_0xb96f,0xac));var _0xfb96=function(_0x466f54,_0x36263a){_0x466f54=_0x466f54-0x0;var _0x283b67=_0xb96f[_0x466f54];return _0x283b67;};'use strict';var _=require('lodash');var util=require(_0xfb96('0x0'));var zendesk=require('./zendesk');var salesforce=require(_0xfb96('0x1'));var sugarcrm=require(_0xfb96('0x2'));var freshdesk=require(_0xfb96('0x3'));var zoho=require(_0xfb96('0x4'));var desk=require(_0xfb96('0x5'));var vtiger=require(_0xfb96('0x6'));var servicenow=require(_0xfb96('0x7'));var dynamics365=require(_0xfb96('0x8'));var freshsales=require('./freshsales');var integrations=[_0xfb96('0x9'),_0xfb96('0xa'),_0xfb96('0xb'),_0xfb96('0xc'),_0xfb96('0xd'),_0xfb96('0xe'),_0xfb96('0xf'),_0xfb96('0x10'),_0xfb96('0x11'),'servicenow'];exports[_0xfb96('0x12')]=function(_0x28ec12,_0xca5a37,_0x43f57c,_0x562906,_0x3dfb93,_0x5f4eb8){if(_0x43f57c){if(_[_0xfb96('0x13')](integrations,_0x28ec12[_0xfb96('0x14')][_0xfb96('0x15')]())){try{var _0xe0e897=null;var _0x9e4e8b='';var _0x292f43=_0x43f57c[_0x28ec12['data1'][_0xfb96('0x15')]()];if(_0x292f43){var _0x52c68a=_0x292f43[_0x28ec12[_0xfb96('0x16')]];if(_0x52c68a){var _0x4d96dd=_[_0xfb96('0x17')](_0x52c68a[_0xfb96('0x18')],{'id':parseInt(_0x28ec12[_0xfb96('0x19')],0xa)});if(_0x4d96dd){if(_0x562906){if(_0x3dfb93&&_0xca5a37[_0xfb96('0x1a')]){_0x9e4e8b=_0xfb96('0x1a');}else if(_0xca5a37[_0xfb96('0x1b')]){_0x9e4e8b='outbound';}else{console['log'](_0xfb96('0x1c'),_0xca5a37);}}else{_0x9e4e8b=_0xfb96('0x1d');}switch(_0x28ec12[_0xfb96('0x14')]['toLowerCase']()){case _0xfb96('0x9'):zendesk[_0x9e4e8b](_0x28ec12,_0xca5a37,_0x4d96dd,_0x562906,_0x3dfb93,_0x52c68a,_0x5f4eb8);break;case _0xfb96('0xa'):salesforce[_0x9e4e8b](_0x28ec12,_0xca5a37,_0x4d96dd,_0x562906,_0x3dfb93,_0x52c68a,_0x5f4eb8);break;case _0xfb96('0xb'):sugarcrm[_0x9e4e8b](_0x28ec12,_0xca5a37,_0x4d96dd,_0x562906,_0x3dfb93,_0x52c68a,_0x5f4eb8);break;case'freshdesk':freshdesk[_0x9e4e8b](_0x28ec12,_0xca5a37,_0x4d96dd,_0x562906,_0x3dfb93,_0x52c68a,_0x5f4eb8);break;case'zoho':zoho[_0x9e4e8b](_0x28ec12,_0xca5a37,_0x4d96dd,_0x562906,_0x3dfb93,_0x52c68a,_0x5f4eb8);break;case _0xfb96('0xe'):desk[_0x9e4e8b](_0x28ec12,_0xca5a37,_0x4d96dd,_0x562906,_0x3dfb93,_0x52c68a,_0x5f4eb8);break;case _0xfb96('0xf'):vtiger[_0x9e4e8b](_0x28ec12,_0xca5a37,_0x4d96dd,_0x562906,_0x3dfb93,_0x52c68a,_0x5f4eb8);break;case'freshsales':freshsales['cs'](_0x28ec12,_0xca5a37,_0x4d96dd,_0x562906,_0x3dfb93,_0x52c68a,_0x5f4eb8,_0x9e4e8b);break;case _0xfb96('0x1e'):servicenow['cs'](_0x28ec12,_0xca5a37,_0x4d96dd,_0x562906,_0x3dfb93,_0x52c68a,_0x5f4eb8,_0x9e4e8b);break;case _0xfb96('0x10'):dynamics365['cs'](_0x28ec12,_0xca5a37,_0x4d96dd,_0x562906,_0x3dfb93,_0x52c68a,_0x5f4eb8,_0x9e4e8b);break;default:console['log'](_0xfb96('0x1f'));}}else{_0xe0e897=require(_0xfb96('0x20'))(_0x28ec12[_0xfb96('0x14')][_0xfb96('0x15')]());_0xe0e897['error'](_0xfb96('0x21'),util[_0xfb96('0x22')](_0xfb96('0x23'),_0x28ec12['data1'][_0xfb96('0x15')](),_0x28ec12[_0xfb96('0x19')]));}}else{_0xe0e897=require(_0xfb96('0x20'))(_0x28ec12[_0xfb96('0x14')][_0xfb96('0x15')]());_0xe0e897[_0xfb96('0x24')]('[EXEC]',util['format'](_0xfb96('0x25'),_0x28ec12[_0xfb96('0x14')]['toLowerCase'](),_0x28ec12[_0xfb96('0x16')]));}}else{}}catch(_0x395cdc){console[_0xfb96('0x24')](_0x395cdc);}}}}; \ No newline at end of file +var _0xb7db=['log','zoho','unknown\x20integration','../../../../config/logger','error','[EXEC]','format','%s\x20configuration\x20#%s\x20not\x20found','util','./sugarcrm','./freshdesk','./zoho','./desk','./vtiger','./dynamics365','./freshsales','zendesk','salesforce','freshdesk','desk','vtiger','dynamics365','freshsales','servicenow','data1','toLowerCase','Configurations','data3','routeId'];(function(_0xa464c9,_0x7c86d8){var _0x3d73c4=function(_0x5c2056){while(--_0x5c2056){_0xa464c9['push'](_0xa464c9['shift']());}};_0x3d73c4(++_0x7c86d8);}(_0xb7db,0x19e));var _0xbb7d=function(_0x20879e,_0x2ffafd){_0x20879e=_0x20879e-0x0;var _0x4a6ee6=_0xb7db[_0x20879e];return _0x4a6ee6;};'use strict';var _=require('lodash');var util=require(_0xbb7d('0x0'));var zendesk=require('./zendesk');var salesforce=require('./salesforce');var sugarcrm=require(_0xbb7d('0x1'));var freshdesk=require(_0xbb7d('0x2'));var zoho=require(_0xbb7d('0x3'));var desk=require(_0xbb7d('0x4'));var vtiger=require(_0xbb7d('0x5'));var servicenow=require('./servicenow');var dynamics365=require(_0xbb7d('0x6'));var freshsales=require(_0xbb7d('0x7'));var integrations=[_0xbb7d('0x8'),_0xbb7d('0x9'),'sugarcrm',_0xbb7d('0xa'),'zoho',_0xbb7d('0xb'),_0xbb7d('0xc'),_0xbb7d('0xd'),_0xbb7d('0xe'),_0xbb7d('0xf')];exports['exec']=function(_0x23a75f,_0x47ce8e,_0x323f6e,_0x1b3268,_0x5e576b,_0x1e940c){if(_0x323f6e){if(_['includes'](integrations,_0x23a75f[_0xbb7d('0x10')]['toLowerCase']())){try{var _0x2331c6=null;var _0x2124bd='';var _0x522d9c=_0x323f6e[_0x23a75f[_0xbb7d('0x10')][_0xbb7d('0x11')]()];if(_0x522d9c){var _0x40d2ea=_0x522d9c[_0x23a75f['data2']];if(_0x40d2ea){var _0x37f526=_['find'](_0x40d2ea[_0xbb7d('0x12')],{'id':parseInt(_0x23a75f[_0xbb7d('0x13')],0xa)});if(_0x37f526){if(_0x1b3268){if(_0x5e576b&&_0x47ce8e['queue']){_0x2124bd='queue';}else if(_0x47ce8e[_0xbb7d('0x14')]){_0x2124bd='outbound';}else{console[_0xbb7d('0x15')]('EVENT\x20UNKNOWN',_0x47ce8e);}}else{_0x2124bd='unmanaged';}switch(_0x23a75f[_0xbb7d('0x10')][_0xbb7d('0x11')]()){case _0xbb7d('0x8'):zendesk[_0x2124bd](_0x23a75f,_0x47ce8e,_0x37f526,_0x1b3268,_0x5e576b,_0x40d2ea,_0x1e940c);break;case'salesforce':salesforce[_0x2124bd](_0x23a75f,_0x47ce8e,_0x37f526,_0x1b3268,_0x5e576b,_0x40d2ea,_0x1e940c);break;case'sugarcrm':sugarcrm[_0x2124bd](_0x23a75f,_0x47ce8e,_0x37f526,_0x1b3268,_0x5e576b,_0x40d2ea,_0x1e940c);break;case _0xbb7d('0xa'):freshdesk[_0x2124bd](_0x23a75f,_0x47ce8e,_0x37f526,_0x1b3268,_0x5e576b,_0x40d2ea,_0x1e940c);break;case _0xbb7d('0x16'):zoho[_0x2124bd](_0x23a75f,_0x47ce8e,_0x37f526,_0x1b3268,_0x5e576b,_0x40d2ea,_0x1e940c);break;case _0xbb7d('0xb'):desk[_0x2124bd](_0x23a75f,_0x47ce8e,_0x37f526,_0x1b3268,_0x5e576b,_0x40d2ea,_0x1e940c);break;case _0xbb7d('0xc'):vtiger[_0x2124bd](_0x23a75f,_0x47ce8e,_0x37f526,_0x1b3268,_0x5e576b,_0x40d2ea,_0x1e940c);break;case'freshsales':freshsales['cs'](_0x23a75f,_0x47ce8e,_0x37f526,_0x1b3268,_0x5e576b,_0x40d2ea,_0x1e940c,_0x2124bd);break;case _0xbb7d('0xf'):servicenow['cs'](_0x23a75f,_0x47ce8e,_0x37f526,_0x1b3268,_0x5e576b,_0x40d2ea,_0x1e940c,_0x2124bd);break;case _0xbb7d('0xd'):dynamics365['cs'](_0x23a75f,_0x47ce8e,_0x37f526,_0x1b3268,_0x5e576b,_0x40d2ea,_0x1e940c,_0x2124bd);break;default:console[_0xbb7d('0x15')](_0xbb7d('0x17'));}}else{_0x2331c6=require(_0xbb7d('0x18'))(_0x23a75f[_0xbb7d('0x10')][_0xbb7d('0x11')]());_0x2331c6[_0xbb7d('0x19')](_0xbb7d('0x1a'),util[_0xbb7d('0x1b')](_0xbb7d('0x1c'),_0x23a75f[_0xbb7d('0x10')][_0xbb7d('0x11')](),_0x23a75f[_0xbb7d('0x13')]));}}else{_0x2331c6=require('../../../../config/logger')(_0x23a75f['data1'][_0xbb7d('0x11')]());_0x2331c6['error'](_0xbb7d('0x1a'),util[_0xbb7d('0x1b')]('%s\x20account\x20#%s\x20not\x20found',_0x23a75f['data1']['toLowerCase'](),_0x23a75f['data2']));}}else{}}catch(_0x588ac7){console['error'](_0x588ac7);}}}}; \ 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 e18dc26..cd5b6f3 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 _0xd316=['display_name','then','user_id','Searching\x20enduser\x20with\x20phone\x20%s.\x20Serching\x20method\x20used\x20%s.','moduleSearch','contact_lead','cloneDeep','additionalSearchContact','merge','$or','additionalSearchLead','account_contact_lead','additionalSearchAccount','Account','first','Phone','attributes','type','toLowerCase','Enduser\x20with\x20phone\x20%s\x20not\x20found','moduleCreate','Enduser\x20with\x20phone\x20%s.\x20Creating\x20method\x20used\x20%s.','LastName','','format','Company','No\x20Company','Name','Caller\x20-\x20%s','includes','string','idField','content','toString','variableName','customVariable','Variable','name','password','Connection','remoteUri','https://login.salesforce.com','clientSecret','login','username','Connection\x20established.','queue','serverUrl','stripTrailingSlash','monitor_format','Recording\x20is\x20enabled!','recordingURL','uniqueid','calleridname','calleridnum','[QUEUE]\x20Ticket\x20%s\x20created','[QUEUE]\x20Displaying\x20ticket\x20%s\x20to\x20agent\x20%s.\x20Integration\x20account\x20type\x20%s.','integrationTab','user:%s','trigger:salesforce:display','trigger:browser:url','%s/%s/e','instanceUrl','error','[QUEUE]\x20Salesforce\x20account\x20type\x20not\x20recognized.','catch','outbound','recordingFormat','none','[OUTBOUND]','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','email','destcalleridname','destcalleridnum','Fields','[OUTBOUND]\x20Displaying\x20ticket\x20%s\x20to\x20agent\x20%s.\x20Integration\x20account\x20type\x20%s.','newTab','unmanaged','lastevent','toUpperCase',']\x20Ticket\x20%s\x20created.',']\x20Integration\x20account\x20type\x20%s.','request-promise','moment','bluebird','../../../../config/environment','redis','defaults','localhost','socket.io-emitter','emit','assign','getString','Subjects','Descriptions','Task','ActivityDate','utc','IsRecurrence','endUserType','contact','lead','WhoId','account','WhatId','ticketType','ContactId','AccountId','leadId','Association\x20between\x20Case\x20and\x20Lead\x20skipped','sobject','create','isNil','validateEmail','User','find','execute','length','info','Agent\x20%s\x20found.','resolve','Agent\x20%s\x20not\x20found.\x20Switch\x20to\x20the\x20admin\x20account.','identity'];(function(_0x39032a,_0x147be5){var _0x25b409=function(_0x5005c3){while(--_0x5005c3){_0x39032a['push'](_0x39032a['shift']());}};_0x25b409(++_0x147be5);}(_0xd316,0x1c3));var _0x6d31=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xd316[_0x3dd15e];return _0x231fd0;};'use strict';var _=require('lodash');var rp=require(_0x6d31('0x0'));var moment=require(_0x6d31('0x1'));var BPromise=require(_0x6d31('0x2'));var md5=require('md5');var jsforce=require('jsforce');var util=require('util');var Redis=require('ioredis');var intUtil=require('./util');var config=require(_0x6d31('0x3'));var logger=require('../../../../config/logger')('salesforce');config[_0x6d31('0x4')]=_[_0x6d31('0x5')](config[_0x6d31('0x4')],{'host':_0x6d31('0x6'),'port':0x18eb});var io=require(_0x6d31('0x7'))(new Redis(config['redis']));function emit(_0x3ebc48,_0x31ad5e,_0x3a523e){io['to'](_0x3ebc48)[_0x6d31('0x8')](_0x31ad5e,_0x3a523e);}function getTicket(_0x2f809c,_0x2adcc6,_0x35b9df,_0x5a9391,_0x57f933,_0x579ff2,_0x170cee,_0x587a69){var _0x16d8e6=Object[_0x6d31('0x9')]({},{'OwnerId':_0x2adcc6['id'],'Subject':intUtil[_0x6d31('0xa')](_0x5a9391[_0x6d31('0xb')],_0x57f933,'\x20'),'Description':intUtil[_0x6d31('0xa')](_0x5a9391[_0x6d31('0xc')],_0x57f933,'\x0a')},getCustomFields(_0x579ff2,_0x57f933));if(_0x35b9df){if(_0x5a9391['ticketType']===_0x6d31('0xd')){_0x16d8e6[_0x6d31('0xe')]=moment[_0x6d31('0xf')]();_0x16d8e6['IsReminderSet']=![];_0x16d8e6[_0x6d31('0x10')]=![];if(_0x35b9df[_0x6d31('0x11')]===_0x6d31('0x12')||_0x35b9df[_0x6d31('0x11')]===_0x6d31('0x13')){_0x16d8e6[_0x6d31('0x14')]=_0x35b9df['id'];}else if(_0x35b9df[_0x6d31('0x11')]===_0x6d31('0x15')){_0x16d8e6[_0x6d31('0x16')]=_0x35b9df['id'];}}else if(_0x5a9391[_0x6d31('0x17')]==='Case'){if(_0x35b9df[_0x6d31('0x11')]===_0x6d31('0x12')){_0x16d8e6[_0x6d31('0x18')]=_0x35b9df['id'];}else if(_0x35b9df[_0x6d31('0x11')]===_0x6d31('0x15')){_0x16d8e6[_0x6d31('0x19')]=_0x35b9df['id'];}else if(_0x35b9df[_0x6d31('0x11')]==='lead'&&_0x5a9391[_0x6d31('0x1a')]){_0x16d8e6[_0x5a9391[_0x6d31('0x1a')]]=_0x35b9df['id'];}else{logger['info'](_0x6d31('0x1b'));}}}return _0x170cee[_0x6d31('0x1c')](_0x5a9391[_0x6d31('0x17')])[_0x6d31('0x1d')](_0x16d8e6);}function getUser(_0x530336,_0x50bbb4,_0x32aae2){if(!_[_0x6d31('0x1e')](_0x50bbb4)&&intUtil[_0x6d31('0x1f')](_0x50bbb4)){var _0x23dbb={'Email':_0x50bbb4};var _0x250a05={'Id':!![],'Username':!![],'Name':!![],'Email':!![]};return _0x32aae2[_0x6d31('0x1c')](_0x6d31('0x20'))[_0x6d31('0x21')](_0x23dbb,_0x250a05)[_0x6d31('0x22')]()['then'](function(_0x5934ff){if(_0x5934ff[_0x6d31('0x23')]){var _0x599afd=_['find'](_0x5934ff,function(_0x52888c){return _0x52888c['Email']===_0x50bbb4;});if(_0x599afd){logger[_0x6d31('0x24')](_0x6d31('0x25'),_0x50bbb4);return BPromise[_0x6d31('0x26')]({'id':_0x599afd['Id'],'name':_0x599afd['Name']});}}else{logger[_0x6d31('0x24')](_0x6d31('0x27'),_0x50bbb4);return _0x32aae2[_0x6d31('0x28')]()['then'](function(_0x29a5d9){return BPromise['resolve']({'id':_0x29a5d9['user_id'],'name':_0x29a5d9[_0x6d31('0x29')]});});}});}else{logger[_0x6d31('0x24')]('Agent\x20%s\x20not\x20found.\x20Switch\x20to\x20the\x20admin\x20account.',_0x50bbb4);return _0x32aae2[_0x6d31('0x28')]()[_0x6d31('0x2a')](function(_0x5af917){return BPromise['resolve']({'id':_0x5af917[_0x6d31('0x2b')],'name':_0x5af917[_0x6d31('0x29')]});});}}function getEndUser(_0x3f2faa,_0x16a3d0,_0x66d07d,_0x5561cf,_0x38c954){var _0x35d0a0={'$or':{'Phone':_0x5561cf}};var _0x39e2c5={'Id':!![],'Name':!![],'Phone':!![]};return BPromise['resolve']()[_0x6d31('0x2a')](function(){logger[_0x6d31('0x24')](_0x6d31('0x2c'),_0x5561cf,_0x16a3d0['moduleSearch']);switch(_0x16a3d0[_0x6d31('0x2d')]){case _0x6d31('0x2e'):var _0x272ef8=_[_0x6d31('0x2f')](_0x35d0a0);if(_0x16a3d0[_0x6d31('0x30')]){var _0x4120b9={};_0x4120b9[_0x16a3d0[_0x6d31('0x30')]]=_0x5561cf;_[_0x6d31('0x31')](_0x272ef8[_0x6d31('0x32')],_0x4120b9);}return _0x38c954[_0x6d31('0x1c')]('Contact')[_0x6d31('0x21')](_0x272ef8,_0x39e2c5)[_0x6d31('0x22')]()[_0x6d31('0x2a')](function(_0xa6c3e9){if(_0xa6c3e9&&_0xa6c3e9[_0x6d31('0x23')]){return _0xa6c3e9;}else{var _0x4bd523=_[_0x6d31('0x2f')](_0x35d0a0);if(_0x16a3d0[_0x6d31('0x33')]){var _0x530d29={};_0x530d29[_0x16a3d0[_0x6d31('0x33')]]=_0x5561cf;_['merge'](_0x4bd523[_0x6d31('0x32')],_0x530d29);}return _0x38c954[_0x6d31('0x1c')]('Lead')[_0x6d31('0x21')](_0x4bd523,_0x39e2c5);}});case _0x6d31('0x34'):var _0x1fbe72=_[_0x6d31('0x2f')](_0x35d0a0);if(_0x16a3d0[_0x6d31('0x35')]){var _0x4120b9={};_0x4120b9[_0x16a3d0[_0x6d31('0x35')]]=_0x5561cf;_[_0x6d31('0x31')](_0x1fbe72['$or'],_0x4120b9);}return _0x38c954[_0x6d31('0x1c')]('Account')[_0x6d31('0x21')](_0x1fbe72,_0x39e2c5)[_0x6d31('0x22')]()[_0x6d31('0x2a')](function(_0x164d6b){if(_0x164d6b&&_0x164d6b[_0x6d31('0x23')]){return _0x164d6b;}else{var _0x12eac3=_[_0x6d31('0x2f')](_0x35d0a0);if(_0x16a3d0[_0x6d31('0x30')]){var _0x9f7dbf={};_0x9f7dbf[_0x16a3d0[_0x6d31('0x30')]]=_0x5561cf;_[_0x6d31('0x31')](_0x12eac3[_0x6d31('0x32')],_0x9f7dbf);}return _0x38c954[_0x6d31('0x1c')]('Contact')[_0x6d31('0x21')](_0x12eac3,_0x39e2c5)[_0x6d31('0x2a')](function(_0x550174){if(_0x550174&&_0x550174[_0x6d31('0x23')]){return _0x550174;}else{var _0x2e7ff1=_[_0x6d31('0x2f')](_0x35d0a0);if(_0x16a3d0[_0x6d31('0x33')]){var _0x308b94={};_0x308b94[_0x16a3d0['additionalSearchLead']]=_0x5561cf;_['merge'](_0x2e7ff1['$or'],_0x308b94);}return _0x38c954[_0x6d31('0x1c')]('Lead')[_0x6d31('0x21')](_0x2e7ff1,_0x39e2c5);}});}});case _0x6d31('0x12'):var _0x272ef8=_[_0x6d31('0x2f')](_0x35d0a0);if(_0x16a3d0[_0x6d31('0x30')]){var _0x4120b9={};_0x4120b9[_0x16a3d0[_0x6d31('0x30')]]=_0x5561cf;_[_0x6d31('0x31')](_0x272ef8['$or'],_0x4120b9);}return _0x38c954['sobject']('Contact')[_0x6d31('0x21')](_0x272ef8,_0x39e2c5)[_0x6d31('0x22')]();case'lead':var _0x35bf66=_[_0x6d31('0x2f')](_0x35d0a0);if(_0x16a3d0['additionalSearchLead']){var _0x4120b9={};_0x4120b9[_0x16a3d0[_0x6d31('0x33')]]=_0x5561cf;_[_0x6d31('0x31')](_0x35bf66['$or'],_0x4120b9);}return _0x38c954[_0x6d31('0x1c')]('Lead')[_0x6d31('0x21')](_0x35bf66,_0x39e2c5);case'account':var _0x1fbe72=_[_0x6d31('0x2f')](_0x35d0a0);if(_0x16a3d0[_0x6d31('0x35')]){var _0x4120b9={};_0x4120b9[_0x16a3d0[_0x6d31('0x35')]]=_0x5561cf;_['merge'](_0x1fbe72[_0x6d31('0x32')],_0x4120b9);}return _0x38c954[_0x6d31('0x1c')](_0x6d31('0x36'))['find'](_0x1fbe72,_0x39e2c5);default:return null;}})[_0x6d31('0x2a')](function(_0x2d7b23){if(_0x2d7b23&&_0x2d7b23[_0x6d31('0x23')]){var _0x3a0e57=_[_0x6d31('0x37')](_0x2d7b23);if(_0x3a0e57){return BPromise['resolve']({'id':_0x3a0e57['Id'],'name':_0x3a0e57['Name'],'phone':_0x3a0e57[_0x6d31('0x38')],'endUserType':_0x3a0e57[_0x6d31('0x39')][_0x6d31('0x3a')][_0x6d31('0x3b')]()});}}})[_0x6d31('0x2a')](function(_0x3f8675){if(_0x3f8675){logger[_0x6d31('0x24')]('Enduser\x20(%s)\x20with\x20phone\x20%s\x20found',_0x3f8675['endUserType'],_0x5561cf);return BPromise['resolve'](_0x3f8675);}else{logger['info'](_0x6d31('0x3c'),_0x5561cf);var _0xdc4de8={'Phone':_0x5561cf};if(_0x16a3d0[_0x6d31('0x3d')]){if(_0x16a3d0[_0x6d31('0x3d')]==='contact'){logger[_0x6d31('0x24')](_0x6d31('0x3e'),_0x5561cf,_0x16a3d0[_0x6d31('0x3d')]);_0xdc4de8[_0x6d31('0x3f')]=_0x66d07d!==_0x6d31('0x40')?_0x66d07d:util[_0x6d31('0x41')]('Caller\x20-\x20%s',_0x5561cf);}else if(_0x16a3d0[_0x6d31('0x3d')]==='lead'){logger[_0x6d31('0x24')](_0x6d31('0x3e'),_0x5561cf,_0x16a3d0[_0x6d31('0x3d')]);_0xdc4de8[_0x6d31('0x3f')]=_0x66d07d!==_0x6d31('0x40')?_0x66d07d:util['format']('Caller\x20-\x20%s',_0x5561cf);_0xdc4de8[_0x6d31('0x42')]=_0x6d31('0x43');}else if(_0x16a3d0[_0x6d31('0x3d')]===_0x6d31('0x15')){logger[_0x6d31('0x24')]('Enduser\x20with\x20phone\x20%s.\x20Creating\x20method\x20used\x20%s.',_0x5561cf,_0x16a3d0['moduleCreate']);_0xdc4de8[_0x6d31('0x44')]=_0x66d07d!==_0x6d31('0x40')?_0x66d07d:util[_0x6d31('0x41')](_0x6d31('0x45'),_0x5561cf);}else{return null;}}return _0x38c954[_0x6d31('0x1c')](_['upperFirst'](_0x16a3d0[_0x6d31('0x3d')]))[_0x6d31('0x1d')](_0xdc4de8)[_0x6d31('0x2a')](function(_0x435162){return BPromise[_0x6d31('0x26')]({'id':_0x435162['id'],'endUserType':_0x16a3d0['moduleCreate']});});}});}function getCustomFields(_0x4a8b33,_0x2a7852){var _0xf7e067={};if(_0x4a8b33['length']>0x0){_['forEach'](_0x4a8b33,function(_0x51faa4){if(_[_0x6d31('0x46')]([_0x6d31('0x47'),'picklist'],_0x51faa4['type'])&&_0x51faa4[_0x6d31('0x48')]){_0xf7e067[_0x51faa4['idField']]=_0x51faa4[_0x6d31('0x49')][_0x6d31('0x4a')]();}else if(_0x51faa4[_0x6d31('0x3a')]==='variable'&&_0x51faa4[_0x6d31('0x4b')]&&_0x51faa4[_0x6d31('0x48')]){_0x2a7852[_0x51faa4[_0x6d31('0x4b')]]&&(_0xf7e067[_0x51faa4['idField']]=_0x2a7852[_0x51faa4['variableName']][_0x6d31('0x4a')]());}else if(_0x51faa4[_0x6d31('0x3a')]===_0x6d31('0x4c')&&_0x51faa4[_0x6d31('0x4d')]&&_0x51faa4[_0x6d31('0x4d')][_0x6d31('0x4e')]&&_0x51faa4[_0x6d31('0x48')]){_0x2a7852[_0x51faa4[_0x6d31('0x4d')]['name'][_0x6d31('0x3b')]()]&&(_0xf7e067[_0x51faa4[_0x6d31('0x48')]]=_0x2a7852[_0x51faa4['Variable'][_0x6d31('0x4e')]['toLowerCase']()]['toString']());}});}return _0xf7e067;}function getConnection(_0x18715e){var _0x42a593=_0x18715e[_0x6d31('0x4f')]['concat'](_0x18715e['securityToken']);var _0x55029a=new jsforce[(_0x6d31('0x50'))]({'oauth2':{'loginUrl':_0x18715e[_0x6d31('0x51')]||_0x6d31('0x52'),'clientId':_0x18715e['clientId'],'clientSecret':_0x18715e[_0x6d31('0x53')]}});return _0x55029a[_0x6d31('0x54')](_0x18715e[_0x6d31('0x55')],_0x42a593)['then'](function(){logger['info'](_0x6d31('0x56'));return _0x55029a;});}exports[_0x6d31('0x57')]=function(_0x21f8bd,_0x2d55bb,_0x10724a,_0x340583,_0x46298b,_0xd7978b){var _0x3ba50d,_0x34e34b,_0x200730,_0x3236c4;_0xd7978b[_0x6d31('0x58')]=intUtil['stripTrailingSlash'](_0xd7978b['serverUrl']);_0xd7978b['remoteUri']=intUtil[_0x6d31('0x59')](_0xd7978b[_0x6d31('0x51')]);if(_0x46298b&&_0x46298b[_0x6d31('0x5a')]){logger[_0x6d31('0x24')]('[QUEUE]',_0x6d31('0x5b'));_0x2d55bb[_0x6d31('0x5c')]=util[_0x6d31('0x41')]('%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s',_0xd7978b[_0x6d31('0x58')],_0x2d55bb[_0x6d31('0x5d')],md5(_0x2d55bb[_0x6d31('0x5d')]));}else{_0x2d55bb[_0x6d31('0x5c')]='';}return getConnection(_0xd7978b)['then'](function(_0x271baf){_0x3236c4=_0x271baf;return getUser(_0xd7978b,_0x340583['email'],_0x3236c4);})[_0x6d31('0x2a')](function(_0x198395){_0x3ba50d=_0x198395;return getEndUser(_0xd7978b,_0x10724a,_0x2d55bb[_0x6d31('0x5e')],_0x2d55bb[_0x6d31('0x5f')],_0x3236c4);})[_0x6d31('0x2a')](function(_0x1ad2fd){_0x34e34b=_0x1ad2fd;return getTicket(_0xd7978b,_0x3ba50d,_0x34e34b,_0x10724a,_0x2d55bb,_0x10724a['Fields'],_0x3236c4,_0x6d31('0x57'));})[_0x6d31('0x2a')](function(_0x20f1a3){_0x200730=_0x20f1a3;logger['info'](_0x6d31('0x60'),_0x200730['id']);logger['info'](_0x6d31('0x61'),_0x200730['id'],_0x340583[_0x6d31('0x4e')],_0xd7978b[_0x6d31('0x3a')]);switch(_0xd7978b[_0x6d31('0x3a')]){case _0x6d31('0x62'):emit(util[_0x6d31('0x41')](_0x6d31('0x63'),_0x340583[_0x6d31('0x4e')]),_0x6d31('0x64'),{'recordId':_0x200730['id']});break;case'newTab':emit(util[_0x6d31('0x41')](_0x6d31('0x63'),_0x340583[_0x6d31('0x4e')]),_0x6d31('0x65'),{'uri':util[_0x6d31('0x41')](_0x6d31('0x66'),_0x3236c4[_0x6d31('0x67')],_0x200730['id'])});break;default:logger[_0x6d31('0x68')](_0x6d31('0x69'));}})[_0x6d31('0x6a')](function(_0x302ce9){logger['error']('[QUEUE]',_0x302ce9);});};exports[_0x6d31('0x6b')]=function(_0x28fac3,_0x1693a5,_0x39a6ea,_0xb08269,_0x1215a0,_0x2147d3,_0x5e136b){var _0x5206a6,_0x5867b5,_0x3f9ae5,_0x3f749e;_0x2147d3[_0x6d31('0x58')]=intUtil[_0x6d31('0x59')](_0x2147d3[_0x6d31('0x58')]);_0x2147d3[_0x6d31('0x51')]=intUtil[_0x6d31('0x59')](_0x2147d3[_0x6d31('0x51')]);if(_0x5e136b&&_0x5e136b[_0x6d31('0x6c')]&&_0x5e136b[_0x6d31('0x6c')]!==_0x6d31('0x6d')){logger[_0x6d31('0x24')](_0x6d31('0x6e'),'Recording\x20is\x20enabled!');_0x1693a5['recordingURL']=util[_0x6d31('0x41')](_0x6d31('0x6f'),_0x2147d3[_0x6d31('0x58')],_0x1693a5['uniqueid'],md5(_0x1693a5[_0x6d31('0x5d')]));}return getConnection(_0x2147d3)[_0x6d31('0x2a')](function(_0x252bb3){_0x3f749e=_0x252bb3;return getUser(_0x2147d3,_0xb08269[_0x6d31('0x70')],_0x3f749e);})[_0x6d31('0x2a')](function(_0x356b76){_0x5206a6=_0x356b76;return getEndUser(_0x2147d3,_0x39a6ea,_0x1693a5[_0x6d31('0x71')],_0x1693a5[_0x6d31('0x72')],_0x3f749e);})['then'](function(_0x7a3f59){_0x5867b5=_0x7a3f59;return getTicket(_0x2147d3,_0x5206a6,_0x5867b5,_0x39a6ea,_0x1693a5,_0x39a6ea[_0x6d31('0x73')],_0x3f749e,_0x6d31('0x6b'));})[_0x6d31('0x2a')](function(_0x574a81){_0x3f9ae5=_0x574a81;logger[_0x6d31('0x24')]('[OUTBOUND]\x20Ticket\x20%s\x20created.',_0x3f9ae5['id']);logger['info'](_0x6d31('0x74'),_0x3f9ae5['id'],_0xb08269[_0x6d31('0x4e')],_0x2147d3[_0x6d31('0x3a')]);switch(_0x2147d3['type']){case _0x6d31('0x62'):emit(util[_0x6d31('0x41')]('user:%s',_0xb08269[_0x6d31('0x4e')]),_0x6d31('0x64'),{'recordId':_0x3f9ae5['id']});break;case _0x6d31('0x75'):emit(util[_0x6d31('0x41')](_0x6d31('0x63'),_0xb08269[_0x6d31('0x4e')]),'trigger:browser:url',{'uri':util[_0x6d31('0x41')]('%s/%s/e',_0x3f749e[_0x6d31('0x67')],_0x3f9ae5['id'])});break;default:logger['error'](_0x6d31('0x6e'),'Salesforce\x20account\x20type\x20not\x20recognized');}})['catch'](function(_0x4f18d3){logger[_0x6d31('0x68')]('[OUTBOUND]',_0x4f18d3);});};exports[_0x6d31('0x76')]=function(_0x54dc60,_0x1d95e5,_0x582197,_0x35b290,_0x414919,_0x8ad81c){var _0x457cbc,_0x4fcee3,_0x5dd5e2,_0x515a8e;_0x8ad81c[_0x6d31('0x58')]=intUtil['stripTrailingSlash'](_0x8ad81c[_0x6d31('0x58')]);_0x8ad81c['remoteUri']=intUtil['stripTrailingSlash'](_0x8ad81c[_0x6d31('0x51')]);if(_0x414919&&_0x414919[_0x6d31('0x5a')]){logger['info']('['+_0x1d95e5[_0x6d31('0x77')][_0x6d31('0x78')]()+']',_0x6d31('0x5b'));_0x1d95e5[_0x6d31('0x5c')]=util[_0x6d31('0x41')]('%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s',_0x8ad81c['serverUrl'],_0x1d95e5[_0x6d31('0x5d')],md5(_0x1d95e5[_0x6d31('0x5d')]));}else{_0x1d95e5[_0x6d31('0x5c')]='';}return getConnection(_0x8ad81c)[_0x6d31('0x2a')](function(_0x20f534){_0x515a8e=_0x20f534;if(!_[_0x6d31('0x1e')](_0x35b290)){return getUser(_0x8ad81c,_0x35b290[_0x6d31('0x4e')],_0x515a8e);}else{return getUser(_0x8ad81c,null,_0x515a8e);}})[_0x6d31('0x2a')](function(_0x531db){_0x457cbc=_0x531db;return getEndUser(_0x8ad81c,_0x582197,_0x1d95e5[_0x6d31('0x5e')],_0x1d95e5[_0x6d31('0x5f')],_0x515a8e);})[_0x6d31('0x2a')](function(_0x3b67b7){_0x4fcee3=_0x3b67b7;return getTicket(_0x8ad81c,_0x457cbc,_0x4fcee3,_0x582197,_0x1d95e5,_0x582197[_0x6d31('0x73')],_0x515a8e);})[_0x6d31('0x2a')](function(_0x2a0160){_0x5dd5e2=_0x2a0160;logger['info']('['+_0x1d95e5[_0x6d31('0x77')]['toUpperCase']()+_0x6d31('0x79'),_0x5dd5e2['id']);logger['info']('['+_0x1d95e5[_0x6d31('0x77')][_0x6d31('0x78')]()+_0x6d31('0x7a'),_0x8ad81c[_0x6d31('0x3a')]);})[_0x6d31('0x6a')](function(_0x13a378){logger[_0x6d31('0x68')]('['+_0x1d95e5[_0x6d31('0x77')]['toUpperCase']()+']',_0x13a378);});}; \ No newline at end of file +var _0xba9f=['bluebird','md5','util','ioredis','./util','../../../../config/environment','../../../../config/logger','salesforce','redis','localhost','socket.io-emitter','emit','assign','Subjects','getString','Descriptions','ticketType','Task','ActivityDate','WhoId','endUserType','contact','AccountId','lead','leadId','info','Association\x20between\x20Case\x20and\x20Lead\x20skipped','sobject','create','isNil','validateEmail','User','find','execute','then','length','Email','Agent\x20%s\x20found.','Agent\x20%s\x20not\x20found.\x20Switch\x20to\x20the\x20admin\x20account.','identity','user_id','resolve','display_name','Searching\x20enduser\x20with\x20phone\x20%s.\x20Serching\x20method\x20used\x20%s.','moduleSearch','contact_lead','cloneDeep','merge','$or','Contact','additionalSearchLead','Lead','account_contact_lead','additionalSearchAccount','additionalSearchContact','account','Account','first','Name','Phone','attributes','type','toLowerCase','Enduser\x20(%s)\x20with\x20phone\x20%s\x20found','Enduser\x20with\x20phone\x20%s\x20not\x20found','moduleCreate','LastName','','format','Caller\x20-\x20%s','Enduser\x20with\x20phone\x20%s.\x20Creating\x20method\x20used\x20%s.','Company','No\x20Company','upperFirst','forEach','includes','string','idField','toString','variable','variableName','customVariable','name','Variable','concat','securityToken','Connection','remoteUri','clientSecret','login','username','Connection\x20established.','queue','serverUrl','stripTrailingSlash','monitor_format','[QUEUE]','Recording\x20is\x20enabled!','uniqueid','recordingURL','email','calleridname','calleridnum','Fields','[QUEUE]\x20Ticket\x20%s\x20created','[QUEUE]\x20Displaying\x20ticket\x20%s\x20to\x20agent\x20%s.\x20Integration\x20account\x20type\x20%s.','integrationTab','user:%s','trigger:salesforce:display','newTab','trigger:browser:url','%s/%s/e','instanceUrl','catch','error','outbound','recordingFormat','none','[OUTBOUND]','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','destcalleridname','[OUTBOUND]\x20Ticket\x20%s\x20created.','[OUTBOUND]\x20Displaying\x20ticket\x20%s\x20to\x20agent\x20%s.\x20Integration\x20account\x20type\x20%s.','Salesforce\x20account\x20type\x20not\x20recognized','unmanaged','lastevent','toUpperCase',']\x20Ticket\x20%s\x20created.',']\x20Integration\x20account\x20type\x20%s.','lodash','moment'];(function(_0x123d3d,_0x114ea5){var _0x5707bf=function(_0x9e1a39){while(--_0x9e1a39){_0x123d3d['push'](_0x123d3d['shift']());}};_0x5707bf(++_0x114ea5);}(_0xba9f,0x81));var _0xfba9=function(_0x5340e3,_0xc89871){_0x5340e3=_0x5340e3-0x0;var _0x573d8b=_0xba9f[_0x5340e3];return _0x573d8b;};'use strict';var _=require(_0xfba9('0x0'));var rp=require('request-promise');var moment=require(_0xfba9('0x1'));var BPromise=require(_0xfba9('0x2'));var md5=require(_0xfba9('0x3'));var jsforce=require('jsforce');var util=require(_0xfba9('0x4'));var Redis=require(_0xfba9('0x5'));var intUtil=require(_0xfba9('0x6'));var config=require(_0xfba9('0x7'));var logger=require(_0xfba9('0x8'))(_0xfba9('0x9'));config[_0xfba9('0xa')]=_['defaults'](config[_0xfba9('0xa')],{'host':_0xfba9('0xb'),'port':0x18eb});var io=require(_0xfba9('0xc'))(new Redis(config[_0xfba9('0xa')]));function emit(_0x25b813,_0x2a348b,_0x1ae86a){io['to'](_0x25b813)[_0xfba9('0xd')](_0x2a348b,_0x1ae86a);}function getTicket(_0x11ff01,_0x3289b9,_0x568162,_0x57413c,_0x493285,_0x51b475,_0x547bec,_0x4c692f){var _0x140dd5=Object[_0xfba9('0xe')]({},{'OwnerId':_0x3289b9['id'],'Subject':intUtil['getString'](_0x57413c[_0xfba9('0xf')],_0x493285,'\x20'),'Description':intUtil[_0xfba9('0x10')](_0x57413c[_0xfba9('0x11')],_0x493285,'\x0a')},getCustomFields(_0x51b475,_0x493285));if(_0x568162){if(_0x57413c[_0xfba9('0x12')]===_0xfba9('0x13')){_0x140dd5[_0xfba9('0x14')]=moment['utc']();_0x140dd5['IsReminderSet']=![];_0x140dd5['IsRecurrence']=![];if(_0x568162['endUserType']==='contact'||_0x568162['endUserType']==='lead'){_0x140dd5[_0xfba9('0x15')]=_0x568162['id'];}else if(_0x568162['endUserType']==='account'){_0x140dd5['WhatId']=_0x568162['id'];}}else if(_0x57413c[_0xfba9('0x12')]==='Case'){if(_0x568162[_0xfba9('0x16')]===_0xfba9('0x17')){_0x140dd5['ContactId']=_0x568162['id'];}else if(_0x568162[_0xfba9('0x16')]==='account'){_0x140dd5[_0xfba9('0x18')]=_0x568162['id'];}else if(_0x568162[_0xfba9('0x16')]===_0xfba9('0x19')&&_0x57413c[_0xfba9('0x1a')]){_0x140dd5[_0x57413c['leadId']]=_0x568162['id'];}else{logger[_0xfba9('0x1b')](_0xfba9('0x1c'));}}}return _0x547bec[_0xfba9('0x1d')](_0x57413c[_0xfba9('0x12')])[_0xfba9('0x1e')](_0x140dd5);}function getUser(_0x40caf9,_0x6667ec,_0x1564de){if(!_[_0xfba9('0x1f')](_0x6667ec)&&intUtil[_0xfba9('0x20')](_0x6667ec)){var _0x1ae67b={'Email':_0x6667ec};var _0x3ff46e={'Id':!![],'Username':!![],'Name':!![],'Email':!![]};return _0x1564de[_0xfba9('0x1d')](_0xfba9('0x21'))[_0xfba9('0x22')](_0x1ae67b,_0x3ff46e)[_0xfba9('0x23')]()[_0xfba9('0x24')](function(_0x3601bd){if(_0x3601bd[_0xfba9('0x25')]){var _0x27d8b3=_[_0xfba9('0x22')](_0x3601bd,function(_0x195752){return _0x195752[_0xfba9('0x26')]===_0x6667ec;});if(_0x27d8b3){logger[_0xfba9('0x1b')](_0xfba9('0x27'),_0x6667ec);return BPromise['resolve']({'id':_0x27d8b3['Id'],'name':_0x27d8b3['Name']});}}else{logger[_0xfba9('0x1b')](_0xfba9('0x28'),_0x6667ec);return _0x1564de[_0xfba9('0x29')]()[_0xfba9('0x24')](function(_0x238f1d){return BPromise['resolve']({'id':_0x238f1d[_0xfba9('0x2a')],'name':_0x238f1d['display_name']});});}});}else{logger[_0xfba9('0x1b')](_0xfba9('0x28'),_0x6667ec);return _0x1564de[_0xfba9('0x29')]()['then'](function(_0x4ba968){return BPromise[_0xfba9('0x2b')]({'id':_0x4ba968[_0xfba9('0x2a')],'name':_0x4ba968[_0xfba9('0x2c')]});});}}function getEndUser(_0x1cb7fb,_0x14b505,_0x2c9317,_0x545431,_0x785505){var _0xe50484={'$or':{'Phone':_0x545431}};var _0x1c9c18={'Id':!![],'Name':!![],'Phone':!![]};return BPromise[_0xfba9('0x2b')]()[_0xfba9('0x24')](function(){logger[_0xfba9('0x1b')](_0xfba9('0x2d'),_0x545431,_0x14b505[_0xfba9('0x2e')]);switch(_0x14b505['moduleSearch']){case _0xfba9('0x2f'):var _0x353d9f=_[_0xfba9('0x30')](_0xe50484);if(_0x14b505['additionalSearchContact']){var _0xd73b9c={};_0xd73b9c[_0x14b505['additionalSearchContact']]=_0x545431;_[_0xfba9('0x31')](_0x353d9f[_0xfba9('0x32')],_0xd73b9c);}return _0x785505[_0xfba9('0x1d')](_0xfba9('0x33'))[_0xfba9('0x22')](_0x353d9f,_0x1c9c18)[_0xfba9('0x23')]()[_0xfba9('0x24')](function(_0x1d9230){if(_0x1d9230&&_0x1d9230[_0xfba9('0x25')]){return _0x1d9230;}else{var _0x5e3688=_[_0xfba9('0x30')](_0xe50484);if(_0x14b505[_0xfba9('0x34')]){var _0x56d06d={};_0x56d06d[_0x14b505[_0xfba9('0x34')]]=_0x545431;_[_0xfba9('0x31')](_0x5e3688[_0xfba9('0x32')],_0x56d06d);}return _0x785505[_0xfba9('0x1d')](_0xfba9('0x35'))[_0xfba9('0x22')](_0x5e3688,_0x1c9c18);}});case _0xfba9('0x36'):var _0x15e9c2=_[_0xfba9('0x30')](_0xe50484);if(_0x14b505[_0xfba9('0x37')]){var _0xd73b9c={};_0xd73b9c[_0x14b505[_0xfba9('0x37')]]=_0x545431;_['merge'](_0x15e9c2[_0xfba9('0x32')],_0xd73b9c);}return _0x785505['sobject']('Account')[_0xfba9('0x22')](_0x15e9c2,_0x1c9c18)[_0xfba9('0x23')]()[_0xfba9('0x24')](function(_0x65948e){if(_0x65948e&&_0x65948e[_0xfba9('0x25')]){return _0x65948e;}else{var _0x509156=_[_0xfba9('0x30')](_0xe50484);if(_0x14b505['additionalSearchContact']){var _0x5bf450={};_0x5bf450[_0x14b505[_0xfba9('0x38')]]=_0x545431;_[_0xfba9('0x31')](_0x509156[_0xfba9('0x32')],_0x5bf450);}return _0x785505['sobject'](_0xfba9('0x33'))[_0xfba9('0x22')](_0x509156,_0x1c9c18)[_0xfba9('0x24')](function(_0x170761){if(_0x170761&&_0x170761['length']){return _0x170761;}else{var _0x45b19a=_[_0xfba9('0x30')](_0xe50484);if(_0x14b505[_0xfba9('0x34')]){var _0x3672ea={};_0x3672ea[_0x14b505[_0xfba9('0x34')]]=_0x545431;_[_0xfba9('0x31')](_0x45b19a['$or'],_0x3672ea);}return _0x785505[_0xfba9('0x1d')](_0xfba9('0x35'))['find'](_0x45b19a,_0x1c9c18);}});}});case _0xfba9('0x17'):var _0x353d9f=_['cloneDeep'](_0xe50484);if(_0x14b505[_0xfba9('0x38')]){var _0xd73b9c={};_0xd73b9c[_0x14b505[_0xfba9('0x38')]]=_0x545431;_[_0xfba9('0x31')](_0x353d9f[_0xfba9('0x32')],_0xd73b9c);}return _0x785505[_0xfba9('0x1d')]('Contact')[_0xfba9('0x22')](_0x353d9f,_0x1c9c18)['execute']();case _0xfba9('0x19'):var _0x196159=_[_0xfba9('0x30')](_0xe50484);if(_0x14b505[_0xfba9('0x34')]){var _0xd73b9c={};_0xd73b9c[_0x14b505[_0xfba9('0x34')]]=_0x545431;_[_0xfba9('0x31')](_0x196159[_0xfba9('0x32')],_0xd73b9c);}return _0x785505['sobject'](_0xfba9('0x35'))[_0xfba9('0x22')](_0x196159,_0x1c9c18);case _0xfba9('0x39'):var _0x15e9c2=_['cloneDeep'](_0xe50484);if(_0x14b505[_0xfba9('0x37')]){var _0xd73b9c={};_0xd73b9c[_0x14b505[_0xfba9('0x37')]]=_0x545431;_[_0xfba9('0x31')](_0x15e9c2[_0xfba9('0x32')],_0xd73b9c);}return _0x785505[_0xfba9('0x1d')](_0xfba9('0x3a'))[_0xfba9('0x22')](_0x15e9c2,_0x1c9c18);default:return null;}})[_0xfba9('0x24')](function(_0x208db5){if(_0x208db5&&_0x208db5[_0xfba9('0x25')]){var _0x54c070=_[_0xfba9('0x3b')](_0x208db5);if(_0x54c070){return BPromise[_0xfba9('0x2b')]({'id':_0x54c070['Id'],'name':_0x54c070[_0xfba9('0x3c')],'phone':_0x54c070[_0xfba9('0x3d')],'endUserType':_0x54c070[_0xfba9('0x3e')][_0xfba9('0x3f')][_0xfba9('0x40')]()});}}})['then'](function(_0x40fa9d){if(_0x40fa9d){logger[_0xfba9('0x1b')](_0xfba9('0x41'),_0x40fa9d[_0xfba9('0x16')],_0x545431);return BPromise['resolve'](_0x40fa9d);}else{logger['info'](_0xfba9('0x42'),_0x545431);var _0x1c565a={'Phone':_0x545431};if(_0x14b505[_0xfba9('0x43')]){if(_0x14b505[_0xfba9('0x43')]===_0xfba9('0x17')){logger['info']('Enduser\x20with\x20phone\x20%s.\x20Creating\x20method\x20used\x20%s.',_0x545431,_0x14b505['moduleCreate']);_0x1c565a[_0xfba9('0x44')]=_0x2c9317!==_0xfba9('0x45')?_0x2c9317:util[_0xfba9('0x46')](_0xfba9('0x47'),_0x545431);}else if(_0x14b505[_0xfba9('0x43')]===_0xfba9('0x19')){logger[_0xfba9('0x1b')](_0xfba9('0x48'),_0x545431,_0x14b505[_0xfba9('0x43')]);_0x1c565a[_0xfba9('0x44')]=_0x2c9317!==_0xfba9('0x45')?_0x2c9317:util['format'](_0xfba9('0x47'),_0x545431);_0x1c565a[_0xfba9('0x49')]=_0xfba9('0x4a');}else if(_0x14b505['moduleCreate']===_0xfba9('0x39')){logger[_0xfba9('0x1b')](_0xfba9('0x48'),_0x545431,_0x14b505[_0xfba9('0x43')]);_0x1c565a['Name']=_0x2c9317!==_0xfba9('0x45')?_0x2c9317:util['format'](_0xfba9('0x47'),_0x545431);}else{return null;}}return _0x785505['sobject'](_[_0xfba9('0x4b')](_0x14b505[_0xfba9('0x43')]))[_0xfba9('0x1e')](_0x1c565a)[_0xfba9('0x24')](function(_0x364905){return BPromise[_0xfba9('0x2b')]({'id':_0x364905['id'],'endUserType':_0x14b505['moduleCreate']});});}});}function getCustomFields(_0x34b114,_0x197e03){var _0x243157={};if(_0x34b114['length']>0x0){_[_0xfba9('0x4c')](_0x34b114,function(_0x34d513){if(_[_0xfba9('0x4d')]([_0xfba9('0x4e'),'picklist'],_0x34d513[_0xfba9('0x3f')])&&_0x34d513[_0xfba9('0x4f')]){_0x243157[_0x34d513[_0xfba9('0x4f')]]=_0x34d513['content'][_0xfba9('0x50')]();}else if(_0x34d513[_0xfba9('0x3f')]===_0xfba9('0x51')&&_0x34d513[_0xfba9('0x52')]&&_0x34d513[_0xfba9('0x4f')]){_0x197e03[_0x34d513[_0xfba9('0x52')]]&&(_0x243157[_0x34d513['idField']]=_0x197e03[_0x34d513[_0xfba9('0x52')]][_0xfba9('0x50')]());}else if(_0x34d513[_0xfba9('0x3f')]===_0xfba9('0x53')&&_0x34d513['Variable']&&_0x34d513['Variable'][_0xfba9('0x54')]&&_0x34d513[_0xfba9('0x4f')]){_0x197e03[_0x34d513[_0xfba9('0x55')][_0xfba9('0x54')]['toLowerCase']()]&&(_0x243157[_0x34d513['idField']]=_0x197e03[_0x34d513[_0xfba9('0x55')][_0xfba9('0x54')][_0xfba9('0x40')]()][_0xfba9('0x50')]());}});}return _0x243157;}function getConnection(_0x3c94fa){var _0x1765c4=_0x3c94fa['password'][_0xfba9('0x56')](_0x3c94fa[_0xfba9('0x57')]);var _0x560324=new jsforce[(_0xfba9('0x58'))]({'oauth2':{'loginUrl':_0x3c94fa[_0xfba9('0x59')]||'https://login.salesforce.com','clientId':_0x3c94fa['clientId'],'clientSecret':_0x3c94fa[_0xfba9('0x5a')]}});return _0x560324[_0xfba9('0x5b')](_0x3c94fa[_0xfba9('0x5c')],_0x1765c4)[_0xfba9('0x24')](function(){logger[_0xfba9('0x1b')](_0xfba9('0x5d'));return _0x560324;});}exports[_0xfba9('0x5e')]=function(_0x49609d,_0x56234a,_0xa2ff67,_0x4c8e2c,_0x5b3fb0,_0xd17b0c){var _0x57c9b6,_0x58979b,_0x51508f,_0xf64a57;_0xd17b0c[_0xfba9('0x5f')]=intUtil[_0xfba9('0x60')](_0xd17b0c[_0xfba9('0x5f')]);_0xd17b0c[_0xfba9('0x59')]=intUtil['stripTrailingSlash'](_0xd17b0c[_0xfba9('0x59')]);if(_0x5b3fb0&&_0x5b3fb0[_0xfba9('0x61')]){logger[_0xfba9('0x1b')](_0xfba9('0x62'),_0xfba9('0x63'));_0x56234a['recordingURL']=util['format']('%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s',_0xd17b0c[_0xfba9('0x5f')],_0x56234a[_0xfba9('0x64')],md5(_0x56234a['uniqueid']));}else{_0x56234a[_0xfba9('0x65')]='';}return getConnection(_0xd17b0c)[_0xfba9('0x24')](function(_0xdb4372){_0xf64a57=_0xdb4372;return getUser(_0xd17b0c,_0x4c8e2c[_0xfba9('0x66')],_0xf64a57);})[_0xfba9('0x24')](function(_0x337aae){_0x57c9b6=_0x337aae;return getEndUser(_0xd17b0c,_0xa2ff67,_0x56234a[_0xfba9('0x67')],_0x56234a[_0xfba9('0x68')],_0xf64a57);})[_0xfba9('0x24')](function(_0x4f0184){_0x58979b=_0x4f0184;return getTicket(_0xd17b0c,_0x57c9b6,_0x58979b,_0xa2ff67,_0x56234a,_0xa2ff67[_0xfba9('0x69')],_0xf64a57,_0xfba9('0x5e'));})[_0xfba9('0x24')](function(_0x29829e){_0x51508f=_0x29829e;logger[_0xfba9('0x1b')](_0xfba9('0x6a'),_0x51508f['id']);logger['info'](_0xfba9('0x6b'),_0x51508f['id'],_0x4c8e2c[_0xfba9('0x54')],_0xd17b0c[_0xfba9('0x3f')]);switch(_0xd17b0c[_0xfba9('0x3f')]){case _0xfba9('0x6c'):emit(util[_0xfba9('0x46')](_0xfba9('0x6d'),_0x4c8e2c[_0xfba9('0x54')]),_0xfba9('0x6e'),{'recordId':_0x51508f['id']});break;case _0xfba9('0x6f'):emit(util[_0xfba9('0x46')](_0xfba9('0x6d'),_0x4c8e2c[_0xfba9('0x54')]),_0xfba9('0x70'),{'uri':util[_0xfba9('0x46')](_0xfba9('0x71'),_0xf64a57[_0xfba9('0x72')],_0x51508f['id'])});break;default:logger['error']('[QUEUE]\x20Salesforce\x20account\x20type\x20not\x20recognized.');}})[_0xfba9('0x73')](function(_0x1bbd00){logger[_0xfba9('0x74')](_0xfba9('0x62'),_0x1bbd00);});};exports[_0xfba9('0x75')]=function(_0x2f1732,_0x31ba40,_0x2663a7,_0x194082,_0x4fe453,_0x16d980,_0x191191){var _0x318121,_0x4f7cf0,_0x1986c3,_0x3d147a;_0x16d980[_0xfba9('0x5f')]=intUtil['stripTrailingSlash'](_0x16d980[_0xfba9('0x5f')]);_0x16d980[_0xfba9('0x59')]=intUtil['stripTrailingSlash'](_0x16d980[_0xfba9('0x59')]);if(_0x191191&&_0x191191['recordingFormat']&&_0x191191[_0xfba9('0x76')]!==_0xfba9('0x77')){logger['info'](_0xfba9('0x78'),'Recording\x20is\x20enabled!');_0x31ba40[_0xfba9('0x65')]=util[_0xfba9('0x46')](_0xfba9('0x79'),_0x16d980['serverUrl'],_0x31ba40[_0xfba9('0x64')],md5(_0x31ba40[_0xfba9('0x64')]));}return getConnection(_0x16d980)[_0xfba9('0x24')](function(_0x494756){_0x3d147a=_0x494756;return getUser(_0x16d980,_0x194082['email'],_0x3d147a);})[_0xfba9('0x24')](function(_0x32c04b){_0x318121=_0x32c04b;return getEndUser(_0x16d980,_0x2663a7,_0x31ba40[_0xfba9('0x7a')],_0x31ba40['destcalleridnum'],_0x3d147a);})[_0xfba9('0x24')](function(_0x461c84){_0x4f7cf0=_0x461c84;return getTicket(_0x16d980,_0x318121,_0x4f7cf0,_0x2663a7,_0x31ba40,_0x2663a7[_0xfba9('0x69')],_0x3d147a,_0xfba9('0x75'));})[_0xfba9('0x24')](function(_0x5711df){_0x1986c3=_0x5711df;logger['info'](_0xfba9('0x7b'),_0x1986c3['id']);logger[_0xfba9('0x1b')](_0xfba9('0x7c'),_0x1986c3['id'],_0x194082['name'],_0x16d980[_0xfba9('0x3f')]);switch(_0x16d980[_0xfba9('0x3f')]){case'integrationTab':emit(util['format'](_0xfba9('0x6d'),_0x194082[_0xfba9('0x54')]),_0xfba9('0x6e'),{'recordId':_0x1986c3['id']});break;case _0xfba9('0x6f'):emit(util[_0xfba9('0x46')](_0xfba9('0x6d'),_0x194082['name']),_0xfba9('0x70'),{'uri':util[_0xfba9('0x46')](_0xfba9('0x71'),_0x3d147a['instanceUrl'],_0x1986c3['id'])});break;default:logger[_0xfba9('0x74')]('[OUTBOUND]',_0xfba9('0x7d'));}})[_0xfba9('0x73')](function(_0x53b2a3){logger[_0xfba9('0x74')](_0xfba9('0x78'),_0x53b2a3);});};exports[_0xfba9('0x7e')]=function(_0x371f91,_0x11345e,_0x3b2d12,_0x3b9061,_0x43aa8c,_0x3ee469){var _0x3d4906,_0x29e15b,_0x192b4a,_0x34295a;_0x3ee469[_0xfba9('0x5f')]=intUtil[_0xfba9('0x60')](_0x3ee469[_0xfba9('0x5f')]);_0x3ee469[_0xfba9('0x59')]=intUtil['stripTrailingSlash'](_0x3ee469[_0xfba9('0x59')]);if(_0x43aa8c&&_0x43aa8c[_0xfba9('0x61')]){logger[_0xfba9('0x1b')]('['+_0x11345e[_0xfba9('0x7f')]['toUpperCase']()+']',_0xfba9('0x63'));_0x11345e[_0xfba9('0x65')]=util['format'](_0xfba9('0x79'),_0x3ee469[_0xfba9('0x5f')],_0x11345e['uniqueid'],md5(_0x11345e[_0xfba9('0x64')]));}else{_0x11345e[_0xfba9('0x65')]='';}return getConnection(_0x3ee469)[_0xfba9('0x24')](function(_0x3152d1){_0x34295a=_0x3152d1;if(!_[_0xfba9('0x1f')](_0x3b9061)){return getUser(_0x3ee469,_0x3b9061[_0xfba9('0x54')],_0x34295a);}else{return getUser(_0x3ee469,null,_0x34295a);}})[_0xfba9('0x24')](function(_0x2ca662){_0x3d4906=_0x2ca662;return getEndUser(_0x3ee469,_0x3b2d12,_0x11345e[_0xfba9('0x67')],_0x11345e[_0xfba9('0x68')],_0x34295a);})[_0xfba9('0x24')](function(_0x14217b){_0x29e15b=_0x14217b;return getTicket(_0x3ee469,_0x3d4906,_0x29e15b,_0x3b2d12,_0x11345e,_0x3b2d12['Fields'],_0x34295a);})[_0xfba9('0x24')](function(_0x2ef78b){_0x192b4a=_0x2ef78b;logger[_0xfba9('0x1b')]('['+_0x11345e['lastevent'][_0xfba9('0x80')]()+_0xfba9('0x81'),_0x192b4a['id']);logger['info']('['+_0x11345e[_0xfba9('0x7f')][_0xfba9('0x80')]()+_0xfba9('0x82'),_0x3ee469[_0xfba9('0x3f')]);})[_0xfba9('0x73')](function(_0x5c5f9b){logger[_0xfba9('0x74')]('['+_0x11345e[_0xfba9('0x7f')][_0xfba9('0x80')]()+']',_0x5c5f9b);});}; \ 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 a112f04..ded506e 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 _0x5555=['Subjects','getString','Descriptions','Fields',']\x20POST\x20incident\x20entity\x20schema','ticketId','ticketNumber','number','label','label_entry','Incident','all','push','Tags','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','trigger:browser:url','password','sysparm_limit=1','remoteUri','stripTrailingSlash','serverUrl','%s/api/now/table/','isNil','email','destcalleridnum','callDirection','queue','unmanaged','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','uniqueid','monitor_format','[QUEUE]','Recording\x20is\x20enabled!','recordingURL','recordingFormat','none','[OUTBOUND]','The\x20ticket\x20ID\x20is:\x20%s','call\x20direction:\x20%s','Displaying\x20call\x20in\x20a\x20new\x20tab...',']\x20Error\x20running\x20ServiceNow\x20integration','lodash','bluebird','util','md5','ioredis','./util','../../../../config/environment','../../../../config/logger','servicenow','redis','defaults','localhost','socket.io-emitter','GET','sys_user?sysparm_query=user_name%3Dadmin','then','adminId','result','sys_id','info','error','toUpperCase','message','],\x20getUser\x20input\x20crm','userEmail','sys_user?sysparm_query=email%3D','],\x20getUser\x20rp\x20obj','],\x20getUser\x20entity','active','true','userId','adminEmail','],\x20getUser\x20crm','catch',']\x20using\x20admin\x20profile','POST','sys_user?','endUserNumber','user','System','],\x20EndUser\x20schema','endUserId','length','],\x20getEndUser\x20crm','],\x20createEndUser\x20crm','forEach','includes','picklist','type','nameField','customField','toLowerCase','toString','string','idField','variableName','Variable','name',']\x20getTicket\x20input\x20crm','outbound','incident','assign'];(function(_0x2462ef,_0x10fef3){var _0x448d77=function(_0x1a5fbc){while(--_0x1a5fbc){_0x2462ef['push'](_0x2462ef['shift']());}};_0x448d77(++_0x10fef3);}(_0x5555,0x1e8));var _0x5555=function(_0x14058e,_0x25c44d){_0x14058e=_0x14058e-0x0;var _0x105762=_0x5555[_0x14058e];return _0x105762;};'use strict';var _=require(_0x5555('0x0'));var Promise=require(_0x5555('0x1'));var rp=require('request-promise');var util=require(_0x5555('0x2'));var md5=require(_0x5555('0x3'));var Redis=require(_0x5555('0x4'));var intUtil=require(_0x5555('0x5'));var config=require(_0x5555('0x6'));var logger=require(_0x5555('0x7'))(_0x5555('0x8'));config[_0x5555('0x9')]=_[_0x5555('0xa')](config['redis'],{'host':_0x5555('0xb'),'port':0x18eb});var io=require(_0x5555('0xc'))(new Redis(config[_0x5555('0x9')]));function getAdminUser(_0x3b6e9c,_0x444bc0,_0x222c40,_0x5b1d52,_0x116f1e,_0x4b769e){return new Promise(function(_0x343387,_0x8d69b2){var _0x52c4b9={'method':_0x5555('0xd'),'uri':_0x5b1d52+_0x5555('0xe')+'&'+_0x116f1e+'&'+_0x4b769e,'auth':_0x444bc0,'json':!![]};return rp(_0x52c4b9)[_0x5555('0xf')](function(_0x3e0e36){if(_0x3e0e36['result']['length']>0x0){_0x222c40[_0x5555('0x10')]=_0x3e0e36[_0x5555('0x11')][0x0][_0x5555('0x12')];}logger[_0x5555('0x13')]('['+[_0x3b6e9c['toUpperCase']()]+'],\x20getAdminUser\x20crm',_0x222c40);_0x343387(_0x222c40);})['catch'](function(_0x1df301){logger[_0x5555('0x14')]('['+[_0x3b6e9c[_0x5555('0x15')]()]+']',_0x1df301[_0x5555('0x16')]);_0x8d69b2(_0x1df301[_0x5555('0x16')]);});});}function getUser(_0x226d93,_0x3ac139,_0x3a33e6,_0x3e3990,_0x226b84){return function(_0x199e87){logger[_0x5555('0x13')]('['+[_0x226d93[_0x5555('0x15')]()]+_0x5555('0x17'),_0x199e87);return new Promise(function(_0x6bdb16,_0xeabb56){if(intUtil['validateEmail'](_0x199e87[_0x5555('0x18')])){var _0x37ab64={'method':_0x5555('0xd'),'uri':_0x3a33e6+_0x5555('0x19')+_0x199e87['userEmail']+'&'+_0x3e3990+'&'+_0x226b84,'auth':_0x3ac139,'json':!![]};logger['info']('['+[_0x226d93[_0x5555('0x15')]()]+_0x5555('0x1a'),_0x37ab64);return rp(_0x37ab64)[_0x5555('0xf')](function(_0x3359a1){logger['info']('['+[_0x226d93['toUpperCase']()]+_0x5555('0x1b'),_0x3359a1);if(_0x3359a1[_0x5555('0x11')]['length']>0x0&&String(_0x3359a1[_0x5555('0x11')][0x0][_0x5555('0x1c')])===_0x5555('0x1d')){_0x199e87[_0x5555('0x1e')]=_0x3359a1[_0x5555('0x11')][0x0][_0x5555('0x12')];}else{_0x199e87[_0x5555('0x1e')]=_0x199e87[_0x5555('0x10')];_0x199e87[_0x5555('0x18')]=_0x199e87[_0x5555('0x1f')];}logger[_0x5555('0x13')]('['+[_0x226d93['toUpperCase']()]+_0x5555('0x20'),_0x199e87);_0x6bdb16(_0x199e87);})[_0x5555('0x21')](function(_0x513e17){logger[_0x5555('0x14')]('['+[_0x226d93['toUpperCase']()]+']',_0x513e17['message']);_0xeabb56(_0x513e17[_0x5555('0x16')]);});}else{logger[_0x5555('0x13')]('['+[_0x226d93[_0x5555('0x15')]()]+_0x5555('0x22'));_0x199e87[_0x5555('0x1e')]=_0x199e87[_0x5555('0x10')];_0x199e87[_0x5555('0x18')]=_0x199e87[_0x5555('0x1f')];_0x6bdb16(_0x199e87);}});};}function createEndUser(_0x337eb0,_0x30d220,_0x3b0cec,_0x342be0,_0x29d43b){logger[_0x5555('0x13')]('['+[_0x337eb0[_0x5555('0x15')]()]+'],\x20createEndUser\x20input\x20crm',_0x3b0cec);return new Promise(function(_0x51a876,_0x1caf82){var _0x48195a={'method':_0x5555('0x23'),'uri':_0x342be0+_0x5555('0x24')+_0x29d43b,'body':{'user_name':_0x3b0cec[_0x5555('0x25')],'roles':_0x5555('0x26'),'first_name':_0x3b0cec[_0x5555('0x25')],'active':_0x5555('0x1d'),'date_format':_0x5555('0x27'),'phone':_0x3b0cec[_0x5555('0x25')]},'auth':_0x30d220,'json':!![]};return rp(_0x48195a)['then'](function(_0x631fd1){logger[_0x5555('0x13')]('['+[_0x337eb0[_0x5555('0x15')]()]+_0x5555('0x28'),_0x631fd1[_0x5555('0x11')]);_0x3b0cec[_0x5555('0x29')]=_0x631fd1['result']['sys_id'];_0x51a876(_0x3b0cec);})['catch'](function(_0x44fd7c){logger[_0x5555('0x14')]('['+[_0x337eb0['toUpperCase']()]+']',_0x44fd7c['message']);_0x1caf82(_0x44fd7c['message']);});});}function getEndUser(_0x4b916e,_0x54b57f,_0x1c28f6,_0x3f7f06,_0x477afe){return function(_0x3ef05f){logger[_0x5555('0x13')]('['+[_0x4b916e['toUpperCase']()]+'],\x20getEndUser\x20input\x20crm',_0x3ef05f);return new Promise(function(_0x5628be,_0x5ac651){var _0xc52650={'method':_0x5555('0xd'),'uri':_0x1c28f6+'sys_user?sysparm_query=phone%3D'+_0x3ef05f[_0x5555('0x25')]+'&'+_0x3f7f06+'&'+_0x477afe,'auth':_0x54b57f,'json':!![]};return rp(_0xc52650)['then'](function(_0x3d4c04){if(_0x3d4c04[_0x5555('0x11')][_0x5555('0x2a')]>0x0){_0x3ef05f[_0x5555('0x29')]=_0x3d4c04[_0x5555('0x11')][0x0][_0x5555('0x12')];logger[_0x5555('0x13')]('['+[_0x4b916e[_0x5555('0x15')]()]+_0x5555('0x2b'),_0x3ef05f);_0x5628be(_0x3ef05f);}else{return createEndUser(_0x4b916e,_0x54b57f,_0x3ef05f,_0x1c28f6,_0x3f7f06)[_0x5555('0xf')](function(_0x21ca36){logger[_0x5555('0x13')]('['+[_0x4b916e[_0x5555('0x15')]()]+_0x5555('0x2c'),_0x21ca36);_0x5628be(_0x21ca36);});}})[_0x5555('0x21')](function(_0x42f3ad){logger[_0x5555('0x14')]('['+[_0x4b916e[_0x5555('0x15')]()]+']',_0x42f3ad[_0x5555('0x16')]);_0x5ac651(_0x42f3ad[_0x5555('0x16')]);});});};}function getCustomFields(_0x303ca0,_0xbf438d){var _0x4008dd={};if(_0x303ca0[_0x5555('0x2a')]>0x0){_[_0x5555('0x2d')](_0x303ca0,function(_0x4b3044){if(_[_0x5555('0x2e')](['string',_0x5555('0x2f')],_0x4b3044[_0x5555('0x30')])&&_0x4b3044[_0x5555('0x31')]&&!_0x4b3044[_0x5555('0x32')]){_0x4008dd[_0x4b3044['nameField'][_0x5555('0x33')]()]=_0x4b3044['content'][_0x5555('0x34')]();}else if(_[_0x5555('0x2e')]([_0x5555('0x35'),_0x5555('0x2f')],_0x4b3044[_0x5555('0x30')])&&_0x4b3044[_0x5555('0x36')]&&_0x4b3044[_0x5555('0x32')]){_0x4008dd[_0x4b3044[_0x5555('0x36')][_0x5555('0x33')]()]=_0x4b3044['content'][_0x5555('0x34')]();}else if(_0x4b3044['type']==='variable'&&_0x4b3044[_0x5555('0x37')]&&_0x4b3044[_0x5555('0x36')]&&_0x4b3044[_0x5555('0x32')]){_0x4008dd[_0x4b3044[_0x5555('0x36')][_0x5555('0x33')]()]=_0xbf438d[_0x4b3044[_0x5555('0x37')]]['toString']();}else if(_0x4b3044['type']==='customVariable'&&_0x4b3044[_0x5555('0x38')]&&_0x4b3044[_0x5555('0x38')]['name']&&_0x4b3044['idField']&&_0x4b3044['customField']){_0x4008dd[_0x4b3044[_0x5555('0x36')]['toLowerCase']()]=_0xbf438d[_0x4b3044[_0x5555('0x38')][_0x5555('0x39')][_0x5555('0x33')]()][_0x5555('0x34')]();}});}return _0x4008dd;}function getTicket(_0x50779e,_0x531720,_0x5b9c6c,_0x1eefc1,_0x172238,_0x57428a){return function(_0x2e0562){logger[_0x5555('0x13')]('['+[_0x50779e[_0x5555('0x15')]()]+_0x5555('0x3a'),_0x2e0562);return new Promise(function(_0x160523,_0x27df5b){var _0x304f46=_0x50779e[_0x5555('0x33')]()===_0x5555('0x3b')?_0x2e0562[_0x5555('0x1e')]:_0x2e0562[_0x5555('0x29')];var _0x4e757e={'method':_0x5555('0x23'),'uri':_0x5b9c6c+_0x5555('0x3c')+'?'+_0x57428a,'body':Object[_0x5555('0x3d')]({},{'active':_0x5555('0x1d'),'caller_id':_0x304f46,'assigned_to':_0x2e0562[_0x5555('0x1e')],'short_description':intUtil['getString'](_0x1eefc1[_0x5555('0x3e')],_0x172238,'\x20'),'description':intUtil[_0x5555('0x3f')](_0x1eefc1[_0x5555('0x40')],_0x172238,'\x0a')},getCustomFields(_0x1eefc1[_0x5555('0x41')],_0x172238)),'auth':_0x531720,'json':!![]};return rp(_0x4e757e)[_0x5555('0xf')](function(_0x1a1c58){logger[_0x5555('0x13')]('['+[_0x50779e[_0x5555('0x15')]()]+_0x5555('0x42'),_0x1a1c58[_0x5555('0x11')]);_0x2e0562[_0x5555('0x43')]=_0x1a1c58[_0x5555('0x11')][_0x5555('0x12')];_0x2e0562[_0x5555('0x44')]=_0x1a1c58[_0x5555('0x11')][_0x5555('0x45')];logger[_0x5555('0x13')]('['+[_0x50779e['toUpperCase']()]+']\x20getTicket\x20crm',_0x2e0562);_0x160523(_0x2e0562);})[_0x5555('0x21')](function(_0x3c8694){logger[_0x5555('0x14')]('['+[_0x50779e[_0x5555('0x15')]()]+']',_0x3c8694[_0x5555('0x16')]);_0x27df5b(_0x3c8694[_0x5555('0x16')]);});});};}function createRemoteTag(_0x26df10,_0x3d9d25,_0x24480c,_0xf7d73e){return new Promise(function(_0x6f8f28,_0x51909f){var _0x1d0f31={'method':'POST','uri':_0x24480c+_0x5555('0x46')+'?'+_0xf7d73e,'body':{'short_description':_0x26df10,'global':!![],'active':!![],'name':_0x26df10},'auth':_0x3d9d25,'json':!![]};return rp(_0x1d0f31)['then'](function(_0x367905){var _0x491cfc=_0x367905[_0x5555('0x11')][_0x5555('0x12')];_0x6f8f28(_0x491cfc);});});}function getRemoteTag(_0x36eb29,_0xff0cd0,_0x33695f,_0x4cb88b,_0x29abb8){return new Promise(function(_0x542f1d,_0x5b5815){var _0x25b026={'method':'GET','uri':_0x33695f+_0x5555('0x46')+'?sysparm_query=name%3D'+_0x36eb29+'&'+_0x4cb88b,'auth':_0xff0cd0,'json':!![]};return rp(_0x25b026)[_0x5555('0xf')](function(_0x181228){if(_0x181228['result']['length']>0x0){var _0x253500=_0x181228['result'][0x0][_0x5555('0x12')];_0x542f1d(_0x253500);}else{return createRemoteTag(_0x36eb29,_0xff0cd0,_0x33695f,_0x4cb88b)[_0x5555('0xf')](function(_0x515fcb){_0x542f1d(_0x515fcb);});}});});}function assignTagToIncident(_0x6452fb,_0x15eed0,_0x37fb2d,_0x79a88f,_0x400cb2){return new Promise(function(_0x1803b4,_0x2ca925){var _0x1f6a7a={'method':_0x5555('0x23'),'uri':_0x37fb2d+_0x5555('0x47')+'?'+_0x400cb2,'body':{'label':_0x6452fb,'table':_0x5555('0x3c'),'id_type':_0x5555('0x48'),'table_key':_0x79a88f[_0x5555('0x43')],'title':'Incident\x20-\x20'+_0x79a88f['ticketNumber'],'id_display':_0x79a88f[_0x5555('0x44')]},'auth':_0x15eed0,'json':!![]};return rp(_0x1f6a7a)[_0x5555('0xf')](function(_0x3f2d14){_0x1803b4();})[_0x5555('0x21')](function(){_0x1803b4();});});}function manageTags(_0x1af54c,_0x2d5559,_0xb09509,_0x545479,_0x32ad5e,_0x357cd2,_0xae47dc){return new Promise(function(_0x2adcb1,_0x256cb8){var _0x529126=[];_0x2d5559['forEach'](function(_0x554549){_0x529126['push'](getRemoteTag(_0x554549,_0xb09509,_0x545479,_0x357cd2,_0xae47dc));});return Promise[_0x5555('0x49')](_0x529126)[_0x5555('0xf')](function(_0x27ffb5){if(_0x27ffb5[_0x5555('0x2a')]){logger[_0x5555('0x13')]('['+[_0x1af54c['toUpperCase']()]+']\x20arrayPromises:\x20IDs\x20in\x20table\x20label',_0x27ffb5);var _0x4e3f39=[];_0x27ffb5[_0x5555('0x2d')](function(_0x2b9e0a){_0x4e3f39[_0x5555('0x4a')](assignTagToIncident(_0x2b9e0a,_0xb09509,_0x545479,_0x32ad5e,_0x357cd2));});return Promise['all'](_0x4e3f39)[_0x5555('0xf')](function(){_0x2adcb1();})[_0x5555('0x21')](function(){_0x2adcb1();});}else{_0x2adcb1();}});});}function getTags(_0x14da4d,_0x41ceb3,_0x4bcf54,_0x3367e3,_0x5bd9c4,_0xabb00b){return function(_0x21ac13){return new Promise(function(_0x2d500a,_0x307553){var _0x1f3878=[];var _0x195747=_0x3367e3[_0x5555('0x4b')];if(_0x195747&&_0x195747[_0x5555('0x2a')]>0x0){_0x1f3878=_[_0x5555('0x4c')](_0x195747,_0x5555('0x39'));}if(_0x1f3878[_0x5555('0x2a')]>0x0){return manageTags(_0x14da4d,_0x1f3878,_0x41ceb3,_0x4bcf54,_0x21ac13,_0x5bd9c4,_0xabb00b)[_0x5555('0xf')](function(){_0x2d500a(_0x21ac13);});}else{_0x2d500a(_0x21ac13);}});};}function emit(_0x534c4a,_0x161c1b,_0x48daa6){var _0xbdf32e=_0x5555('0x4d')+_0x5555('0x4e')+_0x5555('0x4f')+_0x5555('0x50');var _0x3532f0={'uri':_0x534c4a+_0x5555('0x51')+_0x48daa6+_0xbdf32e};io['to'](util[_0x5555('0x52')](_0x5555('0x53'),_0x161c1b))['emit'](_0x5555('0x54'),_0x3532f0);}exports['cs']=function(_0x389bc8,_0x41bc8c,_0x1439b4,_0x1589bb,_0x50c2d9,_0x33ac71,_0x4566ab,_0x572fda){var _0x3d54f7={};var _0x571844={'user':_0x33ac71['username'],'pass':_0x33ac71[_0x5555('0x55')]};var _0x1a8336=_0x5555('0x56');var _0x59b58a='sysparm_display_value=true';_0x33ac71[_0x5555('0x57')]=intUtil[_0x5555('0x58')](_0x33ac71[_0x5555('0x57')]);_0x33ac71[_0x5555('0x59')]=intUtil[_0x5555('0x58')](_0x33ac71[_0x5555('0x59')]);var _0x1dcbde=util[_0x5555('0x52')](_0x5555('0x5a'),_0x33ac71['remoteUri']);_0x3d54f7['userEmail']=!_[_0x5555('0x5b')](_0x1589bb)?_0x1589bb[_0x5555('0x5c')]:null;_0x3d54f7[_0x5555('0x1f')]=_0x33ac71[_0x5555('0x5c')];_0x3d54f7['endUserNumber']=_0x572fda[_0x5555('0x33')]()===_0x5555('0x3b')?_0x41bc8c[_0x5555('0x5d')]:_0x41bc8c['calleridnum'];_0x3d54f7[_0x5555('0x5e')]=_0x572fda===_0x5555('0x5f')||_0x572fda===_0x5555('0x60')?_0x5555('0x5f'):'outbound';var _0x547103=util['format'](_0x5555('0x61'),_0x33ac71[_0x5555('0x59')],_0x41bc8c[_0x5555('0x62')],md5(_0x41bc8c[_0x5555('0x62')]));if(_0x50c2d9&&_0x50c2d9[_0x5555('0x63')]){logger[_0x5555('0x13')](_0x5555('0x64'),_0x5555('0x65'));_0x41bc8c[_0x5555('0x66')]=_0x547103;}else if(_0x4566ab&&_0x4566ab[_0x5555('0x67')]&&_0x4566ab['recordingFormat']!==_0x5555('0x68')){logger[_0x5555('0x13')](_0x5555('0x69'),_0x5555('0x65'));_0x41bc8c[_0x5555('0x66')]=_0x547103;}else{_0x41bc8c[_0x5555('0x66')]='';}return getAdminUser(_0x572fda,_0x571844,_0x3d54f7,_0x1dcbde,_0x59b58a,_0x1a8336)[_0x5555('0xf')](getUser(_0x572fda,_0x571844,_0x1dcbde,_0x59b58a,_0x1a8336))[_0x5555('0xf')](getEndUser(_0x572fda,_0x571844,_0x1dcbde,_0x59b58a,_0x1a8336))[_0x5555('0xf')](getTicket(_0x572fda,_0x571844,_0x1dcbde,_0x1439b4,_0x41bc8c,_0x59b58a))[_0x5555('0xf')](function(_0x34b7a6){logger[_0x5555('0x13')](util[_0x5555('0x52')](_0x5555('0x6a'),_0x34b7a6[_0x5555('0x43')]));logger[_0x5555('0x13')](util[_0x5555('0x52')](_0x5555('0x6b'),_0x572fda));if(_0x572fda!=='unmanaged'){logger['info']('['+[_0x572fda[_0x5555('0x15')]()]+']',_0x5555('0x6c'));emit(_0x33ac71[_0x5555('0x57')],_0x1589bb[_0x5555('0x39')],_0x34b7a6[_0x5555('0x43')]);}})['catch'](function(_0x1b4064){logger[_0x5555('0x14')]('['+[_0x572fda[_0x5555('0x15')]()]+_0x5555('0x6d'),util['inspect'](_0x1b4064,{'showHidden':!![],'depth':null}));});}; \ No newline at end of file +var _0xcfa1=['validateEmail','userEmail','],\x20getUser\x20entity','active','userId','catch',']\x20using\x20admin\x20profile','adminId','POST','sys_user?','endUserNumber','user','true','System','],\x20getEndUser\x20input\x20crm','endUserId','],\x20createEndUser\x20crm','error','string','picklist','type','customField','nameField','toLowerCase','toString','includes','idField','content','variableName','customVariable','Variable','name',']\x20getTicket\x20input\x20crm','outbound','getString','Subjects','Fields',']\x20POST\x20incident\x20entity\x20schema','ticketId','ticketNumber','number','label','label_entry','Incident','Incident\x20-\x20','forEach','push','all','map','%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','password','sysparm_display_value=true','remoteUri','stripTrailingSlash','serverUrl','isNil','adminEmail','destcalleridnum','calleridnum','callDirection','queue','unmanaged','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','uniqueid','[QUEUE]','Recording\x20is\x20enabled!','recordingURL','recordingFormat','[OUTBOUND]','The\x20ticket\x20ID\x20is:\x20%s','call\x20direction:\x20%s',']\x20Error\x20running\x20ServiceNow\x20integration','lodash','bluebird','request-promise','util','md5','ioredis','./util','../../../../config/logger','redis','defaults','localhost','GET','sys_user?sysparm_query=user_name%3Dadmin','then','result','length','sys_id','info','toUpperCase','],\x20getAdminUser\x20crm','message'];(function(_0x2565c3,_0x17765c){var _0x2d9a4c=function(_0x1142f0){while(--_0x1142f0){_0x2565c3['push'](_0x2565c3['shift']());}};_0x2d9a4c(++_0x17765c);}(_0xcfa1,0xb3));var _0x1cfa=function(_0x3ab51d,_0x2fa01d){_0x3ab51d=_0x3ab51d-0x0;var _0x29a04e=_0xcfa1[_0x3ab51d];return _0x29a04e;};'use strict';var _=require(_0x1cfa('0x0'));var Promise=require(_0x1cfa('0x1'));var rp=require(_0x1cfa('0x2'));var util=require(_0x1cfa('0x3'));var md5=require(_0x1cfa('0x4'));var Redis=require(_0x1cfa('0x5'));var intUtil=require(_0x1cfa('0x6'));var config=require('../../../../config/environment');var logger=require(_0x1cfa('0x7'))('servicenow');config[_0x1cfa('0x8')]=_[_0x1cfa('0x9')](config['redis'],{'host':_0x1cfa('0xa'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config['redis']));function getAdminUser(_0x5835a7,_0x53d1da,_0x2d3cbf,_0x615db6,_0x1be5b9,_0x392ca3){return new Promise(function(_0x280a86,_0x373b7d){var _0xda3bf5={'method':_0x1cfa('0xb'),'uri':_0x615db6+_0x1cfa('0xc')+'&'+_0x1be5b9+'&'+_0x392ca3,'auth':_0x53d1da,'json':!![]};return rp(_0xda3bf5)[_0x1cfa('0xd')](function(_0x55e5ae){if(_0x55e5ae[_0x1cfa('0xe')][_0x1cfa('0xf')]>0x0){_0x2d3cbf['adminId']=_0x55e5ae[_0x1cfa('0xe')][0x0][_0x1cfa('0x10')];}logger[_0x1cfa('0x11')]('['+[_0x5835a7[_0x1cfa('0x12')]()]+_0x1cfa('0x13'),_0x2d3cbf);_0x280a86(_0x2d3cbf);})['catch'](function(_0x13aebe){logger['error']('['+[_0x5835a7[_0x1cfa('0x12')]()]+']',_0x13aebe['message']);_0x373b7d(_0x13aebe[_0x1cfa('0x14')]);});});}function getUser(_0x16e428,_0x11101d,_0x56a005,_0x4e8e97,_0x28832b){return function(_0x4daad7){logger[_0x1cfa('0x11')]('['+[_0x16e428[_0x1cfa('0x12')]()]+'],\x20getUser\x20input\x20crm',_0x4daad7);return new Promise(function(_0x40ef8e,_0x406af1){if(intUtil[_0x1cfa('0x15')](_0x4daad7[_0x1cfa('0x16')])){var _0x463817={'method':_0x1cfa('0xb'),'uri':_0x56a005+'sys_user?sysparm_query=email%3D'+_0x4daad7[_0x1cfa('0x16')]+'&'+_0x4e8e97+'&'+_0x28832b,'auth':_0x11101d,'json':!![]};logger[_0x1cfa('0x11')]('['+[_0x16e428[_0x1cfa('0x12')]()]+'],\x20getUser\x20rp\x20obj',_0x463817);return rp(_0x463817)[_0x1cfa('0xd')](function(_0x43bbc2){logger[_0x1cfa('0x11')]('['+[_0x16e428['toUpperCase']()]+_0x1cfa('0x17'),_0x43bbc2);if(_0x43bbc2['result']['length']>0x0&&String(_0x43bbc2[_0x1cfa('0xe')][0x0][_0x1cfa('0x18')])==='true'){_0x4daad7['userId']=_0x43bbc2[_0x1cfa('0xe')][0x0][_0x1cfa('0x10')];}else{_0x4daad7[_0x1cfa('0x19')]=_0x4daad7['adminId'];_0x4daad7['userEmail']=_0x4daad7['adminEmail'];}logger[_0x1cfa('0x11')]('['+[_0x16e428[_0x1cfa('0x12')]()]+'],\x20getUser\x20crm',_0x4daad7);_0x40ef8e(_0x4daad7);})[_0x1cfa('0x1a')](function(_0x543598){logger['error']('['+[_0x16e428['toUpperCase']()]+']',_0x543598[_0x1cfa('0x14')]);_0x406af1(_0x543598[_0x1cfa('0x14')]);});}else{logger['info']('['+[_0x16e428[_0x1cfa('0x12')]()]+_0x1cfa('0x1b'));_0x4daad7[_0x1cfa('0x19')]=_0x4daad7[_0x1cfa('0x1c')];_0x4daad7['userEmail']=_0x4daad7['adminEmail'];_0x40ef8e(_0x4daad7);}});};}function createEndUser(_0x2545b1,_0x5d2ca0,_0x1222e9,_0x6be93b,_0x32a04b){logger['info']('['+[_0x2545b1['toUpperCase']()]+'],\x20createEndUser\x20input\x20crm',_0x1222e9);return new Promise(function(_0x27e4c6,_0x169d16){var _0x53eddd={'method':_0x1cfa('0x1d'),'uri':_0x6be93b+_0x1cfa('0x1e')+_0x32a04b,'body':{'user_name':_0x1222e9[_0x1cfa('0x1f')],'roles':_0x1cfa('0x20'),'first_name':_0x1222e9[_0x1cfa('0x1f')],'active':_0x1cfa('0x21'),'date_format':_0x1cfa('0x22'),'phone':_0x1222e9[_0x1cfa('0x1f')]},'auth':_0x5d2ca0,'json':!![]};return rp(_0x53eddd)[_0x1cfa('0xd')](function(_0x363bf1){logger[_0x1cfa('0x11')]('['+[_0x2545b1[_0x1cfa('0x12')]()]+'],\x20EndUser\x20schema',_0x363bf1['result']);_0x1222e9['endUserId']=_0x363bf1['result']['sys_id'];_0x27e4c6(_0x1222e9);})[_0x1cfa('0x1a')](function(_0x1ef95f){logger['error']('['+[_0x2545b1[_0x1cfa('0x12')]()]+']',_0x1ef95f[_0x1cfa('0x14')]);_0x169d16(_0x1ef95f[_0x1cfa('0x14')]);});});}function getEndUser(_0x89ff15,_0x3d68e4,_0x12e0a2,_0x55ea3c,_0x2ce66b){return function(_0x52a1ae){logger[_0x1cfa('0x11')]('['+[_0x89ff15[_0x1cfa('0x12')]()]+_0x1cfa('0x23'),_0x52a1ae);return new Promise(function(_0x51ecff,_0xdfe788){var _0x2f326d={'method':'GET','uri':_0x12e0a2+'sys_user?sysparm_query=phone%3D'+_0x52a1ae[_0x1cfa('0x1f')]+'&'+_0x55ea3c+'&'+_0x2ce66b,'auth':_0x3d68e4,'json':!![]};return rp(_0x2f326d)['then'](function(_0xbe2a3b){if(_0xbe2a3b[_0x1cfa('0xe')]['length']>0x0){_0x52a1ae[_0x1cfa('0x24')]=_0xbe2a3b[_0x1cfa('0xe')][0x0][_0x1cfa('0x10')];logger[_0x1cfa('0x11')]('['+[_0x89ff15[_0x1cfa('0x12')]()]+'],\x20getEndUser\x20crm',_0x52a1ae);_0x51ecff(_0x52a1ae);}else{return createEndUser(_0x89ff15,_0x3d68e4,_0x52a1ae,_0x12e0a2,_0x55ea3c)[_0x1cfa('0xd')](function(_0x17afef){logger[_0x1cfa('0x11')]('['+[_0x89ff15[_0x1cfa('0x12')]()]+_0x1cfa('0x25'),_0x17afef);_0x51ecff(_0x17afef);});}})[_0x1cfa('0x1a')](function(_0x2f7b28){logger[_0x1cfa('0x26')]('['+[_0x89ff15['toUpperCase']()]+']',_0x2f7b28[_0x1cfa('0x14')]);_0xdfe788(_0x2f7b28['message']);});});};}function getCustomFields(_0x15e702,_0x50e0cc){var _0x32433a={};if(_0x15e702['length']>0x0){_['forEach'](_0x15e702,function(_0x3da502){if(_['includes']([_0x1cfa('0x27'),_0x1cfa('0x28')],_0x3da502[_0x1cfa('0x29')])&&_0x3da502['nameField']&&!_0x3da502[_0x1cfa('0x2a')]){_0x32433a[_0x3da502[_0x1cfa('0x2b')][_0x1cfa('0x2c')]()]=_0x3da502['content'][_0x1cfa('0x2d')]();}else if(_[_0x1cfa('0x2e')]([_0x1cfa('0x27'),'picklist'],_0x3da502[_0x1cfa('0x29')])&&_0x3da502[_0x1cfa('0x2f')]&&_0x3da502[_0x1cfa('0x2a')]){_0x32433a[_0x3da502['idField'][_0x1cfa('0x2c')]()]=_0x3da502[_0x1cfa('0x30')][_0x1cfa('0x2d')]();}else if(_0x3da502['type']==='variable'&&_0x3da502[_0x1cfa('0x31')]&&_0x3da502['idField']&&_0x3da502[_0x1cfa('0x2a')]){_0x32433a[_0x3da502['idField'][_0x1cfa('0x2c')]()]=_0x50e0cc[_0x3da502[_0x1cfa('0x31')]][_0x1cfa('0x2d')]();}else if(_0x3da502[_0x1cfa('0x29')]===_0x1cfa('0x32')&&_0x3da502[_0x1cfa('0x33')]&&_0x3da502[_0x1cfa('0x33')][_0x1cfa('0x34')]&&_0x3da502[_0x1cfa('0x2f')]&&_0x3da502[_0x1cfa('0x2a')]){_0x32433a[_0x3da502[_0x1cfa('0x2f')]['toLowerCase']()]=_0x50e0cc[_0x3da502[_0x1cfa('0x33')][_0x1cfa('0x34')][_0x1cfa('0x2c')]()]['toString']();}});}return _0x32433a;}function getTicket(_0x56a8a5,_0x28dbaa,_0x45c53c,_0x2fff67,_0x50d22d,_0x21edfa){return function(_0x4fd255){logger[_0x1cfa('0x11')]('['+[_0x56a8a5[_0x1cfa('0x12')]()]+_0x1cfa('0x35'),_0x4fd255);return new Promise(function(_0xbb4787,_0x2a6920){var _0x45f826=_0x56a8a5[_0x1cfa('0x2c')]()===_0x1cfa('0x36')?_0x4fd255[_0x1cfa('0x19')]:_0x4fd255[_0x1cfa('0x24')];var _0x186520={'method':_0x1cfa('0x1d'),'uri':_0x45c53c+'incident'+'?'+_0x21edfa,'body':Object['assign']({},{'active':_0x1cfa('0x21'),'caller_id':_0x45f826,'assigned_to':_0x4fd255[_0x1cfa('0x19')],'short_description':intUtil[_0x1cfa('0x37')](_0x2fff67[_0x1cfa('0x38')],_0x50d22d,'\x20'),'description':intUtil['getString'](_0x2fff67['Descriptions'],_0x50d22d,'\x0a')},getCustomFields(_0x2fff67[_0x1cfa('0x39')],_0x50d22d)),'auth':_0x28dbaa,'json':!![]};return rp(_0x186520)[_0x1cfa('0xd')](function(_0x40b81d){logger[_0x1cfa('0x11')]('['+[_0x56a8a5[_0x1cfa('0x12')]()]+_0x1cfa('0x3a'),_0x40b81d['result']);_0x4fd255[_0x1cfa('0x3b')]=_0x40b81d[_0x1cfa('0xe')]['sys_id'];_0x4fd255[_0x1cfa('0x3c')]=_0x40b81d[_0x1cfa('0xe')][_0x1cfa('0x3d')];logger[_0x1cfa('0x11')]('['+[_0x56a8a5['toUpperCase']()]+']\x20getTicket\x20crm',_0x4fd255);_0xbb4787(_0x4fd255);})['catch'](function(_0x257a0e){logger[_0x1cfa('0x26')]('['+[_0x56a8a5[_0x1cfa('0x12')]()]+']',_0x257a0e[_0x1cfa('0x14')]);_0x2a6920(_0x257a0e['message']);});});};}function createRemoteTag(_0x369e86,_0x123cea,_0x1f38d2,_0x2b9458){return new Promise(function(_0x3b4b59,_0x26032c){var _0x1a1112={'method':_0x1cfa('0x1d'),'uri':_0x1f38d2+_0x1cfa('0x3e')+'?'+_0x2b9458,'body':{'short_description':_0x369e86,'global':!![],'active':!![],'name':_0x369e86},'auth':_0x123cea,'json':!![]};return rp(_0x1a1112)['then'](function(_0x208fe5){var _0x215f9e=_0x208fe5['result'][_0x1cfa('0x10')];_0x3b4b59(_0x215f9e);});});}function getRemoteTag(_0x277bdd,_0x8150d0,_0x211980,_0x1106c1,_0x28e212){return new Promise(function(_0x25c6ae,_0x4dd6d9){var _0x5c211a={'method':_0x1cfa('0xb'),'uri':_0x211980+_0x1cfa('0x3e')+'?sysparm_query=name%3D'+_0x277bdd+'&'+_0x1106c1,'auth':_0x8150d0,'json':!![]};return rp(_0x5c211a)[_0x1cfa('0xd')](function(_0x16556f){if(_0x16556f['result'][_0x1cfa('0xf')]>0x0){var _0x10a0a8=_0x16556f[_0x1cfa('0xe')][0x0][_0x1cfa('0x10')];_0x25c6ae(_0x10a0a8);}else{return createRemoteTag(_0x277bdd,_0x8150d0,_0x211980,_0x1106c1)[_0x1cfa('0xd')](function(_0x19415a){_0x25c6ae(_0x19415a);});}});});}function assignTagToIncident(_0x2eb716,_0x37d1ce,_0x5832ea,_0x5b119d,_0x595d08){return new Promise(function(_0x2bc521,_0xdf321a){var _0x5a74e9={'method':_0x1cfa('0x1d'),'uri':_0x5832ea+_0x1cfa('0x3f')+'?'+_0x595d08,'body':{'label':_0x2eb716,'table':'incident','id_type':_0x1cfa('0x40'),'table_key':_0x5b119d[_0x1cfa('0x3b')],'title':_0x1cfa('0x41')+_0x5b119d[_0x1cfa('0x3c')],'id_display':_0x5b119d['ticketNumber']},'auth':_0x37d1ce,'json':!![]};return rp(_0x5a74e9)[_0x1cfa('0xd')](function(_0x4b3348){_0x2bc521();})[_0x1cfa('0x1a')](function(){_0x2bc521();});});}function manageTags(_0xe6548,_0x550da2,_0x320e40,_0x6cacd4,_0x273d46,_0x3af92b,_0x1231eb){return new Promise(function(_0x34fa9f,_0xc68fd1){var _0x39a507=[];_0x550da2[_0x1cfa('0x42')](function(_0x10adbb){_0x39a507[_0x1cfa('0x43')](getRemoteTag(_0x10adbb,_0x320e40,_0x6cacd4,_0x3af92b,_0x1231eb));});return Promise[_0x1cfa('0x44')](_0x39a507)[_0x1cfa('0xd')](function(_0xc7c5b){if(_0xc7c5b[_0x1cfa('0xf')]){logger[_0x1cfa('0x11')]('['+[_0xe6548[_0x1cfa('0x12')]()]+']\x20arrayPromises:\x20IDs\x20in\x20table\x20label',_0xc7c5b);var _0x1ac30a=[];_0xc7c5b['forEach'](function(_0x180f2a){_0x1ac30a[_0x1cfa('0x43')](assignTagToIncident(_0x180f2a,_0x320e40,_0x6cacd4,_0x273d46,_0x3af92b));});return Promise['all'](_0x1ac30a)[_0x1cfa('0xd')](function(){_0x34fa9f();})[_0x1cfa('0x1a')](function(){_0x34fa9f();});}else{_0x34fa9f();}});});}function getTags(_0x51bd32,_0x55c3aa,_0x371b35,_0x1e71d4,_0x17c5b5,_0x2186a7){return function(_0x533ca3){return new Promise(function(_0x1ec775,_0x1dd520){var _0x125b77=[];var _0x265925=_0x1e71d4['Tags'];if(_0x265925&&_0x265925[_0x1cfa('0xf')]>0x0){_0x125b77=_[_0x1cfa('0x45')](_0x265925,_0x1cfa('0x34'));}if(_0x125b77[_0x1cfa('0xf')]>0x0){return manageTags(_0x51bd32,_0x125b77,_0x55c3aa,_0x371b35,_0x533ca3,_0x17c5b5,_0x2186a7)[_0x1cfa('0xd')](function(){_0x1ec775(_0x533ca3);});}else{_0x1ec775(_0x533ca3);}});};}function emit(_0x4ff6fb,_0x5517d3,_0x23509f){var _0x3245f5='%26sysparm_record_target%3Dincident'+_0x1cfa('0x46')+_0x1cfa('0x47')+_0x1cfa('0x48');var _0x12c7ad={'uri':_0x4ff6fb+_0x1cfa('0x49')+_0x23509f+_0x3245f5};io['to'](util[_0x1cfa('0x4a')](_0x1cfa('0x4b'),_0x5517d3))[_0x1cfa('0x4c')](_0x1cfa('0x4d'),_0x12c7ad);}exports['cs']=function(_0x26dc5a,_0x16648b,_0x390617,_0x285d89,_0x36332f,_0x269f1f,_0x566da1,_0x55b36e){var _0x299bb7={};var _0xdd9acb={'user':_0x269f1f['username'],'pass':_0x269f1f[_0x1cfa('0x4e')]};var _0x1b372c='sysparm_limit=1';var _0x49a027=_0x1cfa('0x4f');_0x269f1f[_0x1cfa('0x50')]=intUtil[_0x1cfa('0x51')](_0x269f1f[_0x1cfa('0x50')]);_0x269f1f['serverUrl']=intUtil[_0x1cfa('0x51')](_0x269f1f[_0x1cfa('0x52')]);var _0x32f62c=util['format']('%s/api/now/table/',_0x269f1f[_0x1cfa('0x50')]);_0x299bb7['userEmail']=!_[_0x1cfa('0x53')](_0x285d89)?_0x285d89['email']:null;_0x299bb7[_0x1cfa('0x54')]=_0x269f1f['email'];_0x299bb7[_0x1cfa('0x1f')]=_0x55b36e[_0x1cfa('0x2c')]()===_0x1cfa('0x36')?_0x16648b[_0x1cfa('0x55')]:_0x16648b[_0x1cfa('0x56')];_0x299bb7[_0x1cfa('0x57')]=_0x55b36e===_0x1cfa('0x58')||_0x55b36e===_0x1cfa('0x59')?_0x1cfa('0x58'):'outbound';var _0x53b8bf=util['format'](_0x1cfa('0x5a'),_0x269f1f[_0x1cfa('0x52')],_0x16648b['uniqueid'],md5(_0x16648b[_0x1cfa('0x5b')]));if(_0x36332f&&_0x36332f['monitor_format']){logger['info'](_0x1cfa('0x5c'),_0x1cfa('0x5d'));_0x16648b[_0x1cfa('0x5e')]=_0x53b8bf;}else if(_0x566da1&&_0x566da1[_0x1cfa('0x5f')]&&_0x566da1[_0x1cfa('0x5f')]!=='none'){logger[_0x1cfa('0x11')](_0x1cfa('0x60'),_0x1cfa('0x5d'));_0x16648b[_0x1cfa('0x5e')]=_0x53b8bf;}else{_0x16648b[_0x1cfa('0x5e')]='';}return getAdminUser(_0x55b36e,_0xdd9acb,_0x299bb7,_0x32f62c,_0x49a027,_0x1b372c)['then'](getUser(_0x55b36e,_0xdd9acb,_0x32f62c,_0x49a027,_0x1b372c))[_0x1cfa('0xd')](getEndUser(_0x55b36e,_0xdd9acb,_0x32f62c,_0x49a027,_0x1b372c))[_0x1cfa('0xd')](getTicket(_0x55b36e,_0xdd9acb,_0x32f62c,_0x390617,_0x16648b,_0x49a027))['then'](function(_0xe9a864){logger[_0x1cfa('0x11')](util['format'](_0x1cfa('0x61'),_0xe9a864[_0x1cfa('0x3b')]));logger[_0x1cfa('0x11')](util[_0x1cfa('0x4a')](_0x1cfa('0x62'),_0x55b36e));if(_0x55b36e!==_0x1cfa('0x59')){logger[_0x1cfa('0x11')]('['+[_0x55b36e['toUpperCase']()]+']','Displaying\x20call\x20in\x20a\x20new\x20tab...');emit(_0x269f1f[_0x1cfa('0x50')],_0x285d89['name'],_0xe9a864[_0x1cfa('0x3b')]);}})['catch'](function(_0x588efd){logger['error']('['+[_0x55b36e[_0x1cfa('0x12')]()]+_0x1cfa('0x63'),util['inspect'](_0x588efd,{'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 14ba0b2..102384d 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 _0x8141=['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','Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...','user:%s','catch','error','outbound','recordingFormat','none','[OUTBOUND]','destcalleridname','Fields','Outbound','trigger:browser:url','unmanaged','lastevent','recordingURL','calleridname','lodash','request-promise','util','ioredis','./util','../../../../config/environment','../../../../config/logger','sugarcrm','redis','defaults','localhost','socket.io-emitter','emit','info','Creating\x20new\x20ticket...','name','getString','assigned_user_id','created_by','description','Descriptions','date_start','toISOString','replace','duration_minutes','parent_type','Contacts','parent_name','direction','forEach','variableName','set_entry','JSON','Calls','format','Basic\x20%s','apiKey','toString','get_server_info','stringify','isNil','get_entry_list','Employees','INSTR\x20(\x20users.user_name,\x20\x22%s\x22)\x20>\x200','user_name','then','entry_list','value','Agent\x20found!','resolve','name_value_list','Agent\x20not\x20available,\x20using\x20the\x20admin\x20account!','Searching\x20enduser\x20with\x20phone','contacts.phone_home\x20=\x20\x22%s\x22','length','find','phone_home','Enduser\x20not\x20found,\x20creating\x20a\x20new\x20enduser!','first_name','Caller\x20-\x20%s','Enduser\x20created.','[HTTP]','merge','string','nameField','customField','toLowerCase','content','idField','custom_fields','push','type','customVariable','Variable','POST','login','username','password','sessionID','Account\x20%d\x20is\x20not\x20valid','set_relationship','remoteUri','stripTrailingSlash','serverUrl','uri','%s/service/v4_1/rest.php','monitor_format','[QUEUE]','Recording\x20is\x20enabled!','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','uniqueid','The\x20User\x20ID\x20is:','calleridnum'];(function(_0x504582,_0x5b3965){var _0x43c6ce=function(_0x1199a4){while(--_0x1199a4){_0x504582['push'](_0x504582['shift']());}};_0x43c6ce(++_0x5b3965);}(_0x8141,0x91));var _0x1814=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0x8141[_0x14add3];return _0x4a174f;};'use strict';var _=require(_0x1814('0x0'));var rp=require(_0x1814('0x1'));var BPromise=require('bluebird');var md5=require('md5');var util=require(_0x1814('0x2'));var Redis=require(_0x1814('0x3'));var intUtil=require(_0x1814('0x4'));var config=require(_0x1814('0x5'));var logger=require(_0x1814('0x6'))(_0x1814('0x7'));config[_0x1814('0x8')]=_[_0x1814('0x9')](config[_0x1814('0x8')],{'host':_0x1814('0xa'),'port':0x18eb});var io=require(_0x1814('0xb'))(new Redis(config['redis']));var def={'method':'POST','json':!![]};function emit(_0x147669,_0x30ebf,_0x533b84){io['to'](_0x147669)[_0x1814('0xc')](_0x30ebf,_0x533b84);}function getTicket(_0x39b019,_0x5a31bf,_0x2756ff,_0x3527be,_0x1f9832,_0x1f0c38,_0x5882e9,_0x65742e){logger[_0x1814('0xd')](_0x1814('0xe'));var _0x446803=new Date();var _0x1e29c6=[{'name':_0x1814('0xf'),'value':intUtil[_0x1814('0x10')](_0x3527be['Subjects'],_0x1f9832,'\x20')},{'name':_0x1814('0x11'),'value':_0x5a31bf['id']},{'name':_0x1814('0x12'),'value':_0x5a31bf['id']},{'name':_0x1814('0x13'),'value':intUtil[_0x1814('0x10')](_0x3527be[_0x1814('0x14')],_0x1f9832,'\x0a')},{'name':_0x1814('0x15'),'value':_0x446803[_0x1814('0x16')]()['slice'](0x0,0x13)[_0x1814('0x17')]('T','\x20')},{'name':'duration_hours','value':'0'},{'name':_0x1814('0x18'),'value':'15'},{'name':'parent_id','value':_0x2756ff['id']},{'name':_0x1814('0x19'),'value':_0x1814('0x1a')},{'name':_0x1814('0x1b'),'value':_0x2756ff[_0x1814('0xf')]},{'name':_0x1814('0x1c'),'value':_0x65742e}];if(_0x1f0c38['length']){_[_0x1814('0x1d')](_0x1f0c38,function(_0x1792fe){if(_0x1f9832[_0x1792fe['variableName']]){_0x1e29c6['push']({'name':_0x1792fe['idField'],'value':_0x1f9832[_0x1792fe[_0x1814('0x1e')]]});}});}return request({'form':{'method':_0x1814('0x1f'),'input_type':_0x1814('0x20'),'response_type':_0x1814('0x20'),'rest_data':JSON['stringify']({'session':_0x5882e9['id'],'module_name':_0x1814('0x21'),'name_value_list':_0x1e29c6})}});}function getAuth(_0x2a72da){return util[_0x1814('0x22')](_0x1814('0x23'),new Buffer(_0x2a72da[_0x1814('0x24')]+':X')[_0x1814('0x25')]('base64'));}function getServerInfo(_0x3f0087){return request({'form':{'method':_0x1814('0x26'),'input_type':'JSON','response_type':_0x1814('0x20'),'rest_data':JSON[_0x1814('0x27')]({'session':_0x3f0087['id']})}});}function getUser(_0x3d6b0e,_0x5940fc,_0x9020f3){if(!_[_0x1814('0x28')](_0x5940fc)){logger[_0x1814('0xd')]('Getting\x20agent\x20with\x20name',_0x5940fc);return request({'form':{'method':_0x1814('0x29'),'input_type':'JSON','response_type':_0x1814('0x20'),'rest_data':JSON[_0x1814('0x27')]({'session':_0x9020f3['id'],'module_name':_0x1814('0x2a'),'query':util['format'](_0x1814('0x2b'),_0x5940fc),'order_by':'','offset':'0','select_fields':['id',_0x1814('0xf'),_0x1814('0x2c')],'link_name_to_fields_array':[],'max_results':-0x1,'deleted':'0'})}})[_0x1814('0x2d')](function(_0x138632){if(_0x138632['entry_list']['length']){var _0x4d49ef=_['find'](_0x138632[_0x1814('0x2e')],function(_0xf59414){return _0xf59414['name_value_list'][_0x1814('0x2c')][_0x1814('0x2f')]===_0x5940fc;});if(_0x4d49ef){logger[_0x1814('0xd')](_0x1814('0x30'));return BPromise[_0x1814('0x31')]({'id':_0x4d49ef[_0x1814('0x32')]['id'][_0x1814('0x2f')],'name':_0x4d49ef[_0x1814('0x32')][_0x1814('0xf')][_0x1814('0x2f')]});}}logger[_0x1814('0xd')]('Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!');return BPromise[_0x1814('0x31')]({'id':_0x9020f3[_0x1814('0x32')]['user_id'][_0x1814('0x2f')],'name':_0x9020f3['name_value_list']['user_name']['value']});});}else{logger['info'](_0x1814('0x33'));return BPromise['resolve']({'id':_0x9020f3[_0x1814('0x32')]['user_id']['value'],'name':_0x9020f3[_0x1814('0x32')][_0x1814('0x2c')]['value']});}}function getEndUser(_0x466c5d,_0x19380f,_0x195eea,_0x3ad963){logger[_0x1814('0xd')](_0x1814('0x34'),_0x195eea);return request({'form':{'method':'get_entry_list','input_type':_0x1814('0x20'),'response_type':'JSON','rest_data':JSON['stringify']({'session':_0x3ad963['id'],'module_name':_0x1814('0x1a'),'query':util[_0x1814('0x22')](_0x1814('0x35'),_0x195eea),'order_by':'','offset':'0','select_fields':['id','name','phone_home'],'link_name_to_fields_array':[],'max_results':-0x1,'deleted':'0'})}})[_0x1814('0x2d')](function(_0x1ac1d3){if(_0x1ac1d3[_0x1814('0x2e')][_0x1814('0x36')]){var _0x36fe04=_[_0x1814('0x37')](_0x1ac1d3[_0x1814('0x2e')],function(_0x480f0f){return _0x480f0f[_0x1814('0x32')]['phone_home'][_0x1814('0x2f')]===_0x195eea;});if(_0x36fe04){logger[_0x1814('0xd')]('Enduser\x20found!');return BPromise[_0x1814('0x31')]({'id':_0x36fe04['name_value_list']['id'][_0x1814('0x2f')],'name':_0x36fe04[_0x1814('0x32')][_0x1814('0xf')][_0x1814('0x2f')],'phone':_0x36fe04[_0x1814('0x32')][_0x1814('0x38')][_0x1814('0x2f')]});}}else{logger['info'](_0x1814('0x39'));return request({'form':{'method':_0x1814('0x1f'),'input_type':'JSON','response_type':_0x1814('0x20'),'rest_data':JSON[_0x1814('0x27')]({'session':_0x3ad963['id'],'module_name':'Contacts','name_value_list':[{'name':_0x1814('0x3a'),'value':_0x19380f!==''?_0x19380f:util[_0x1814('0x22')](_0x1814('0x3b'),_0x195eea)},{'name':_0x1814('0x38'),'value':_0x195eea}]})}})[_0x1814('0x2d')](function(_0x5a92f6){logger['info'](_0x1814('0x3c'));return BPromise[_0x1814('0x31')]({'id':_0x5a92f6['id'],'name':_0x5a92f6[_0x1814('0x2e')][_0x1814('0x3a')][_0x1814('0x2f')],'phone':_0x5a92f6[_0x1814('0x2e')][_0x1814('0x38')][_0x1814('0x2f')]});});}});}function request(_0xe07703){logger['debug'](_0x1814('0x3d'),JSON['stringify'](_0xe07703));return rp(_[_0x1814('0x3e')](def,_0xe07703));}function getTags(_0x5d240b,_0x2980dd){var _0x3d1898=[];if(_0x5d240b&&_0x5d240b['length']>0x0){_0x3d1898=_['map'](_0x5d240b,_0x2980dd);}return _0x3d1898;}function getCustomFields(_0x13e793,_0x4f44ec){var _0x5d003b=[];var _0x2f9361={'custom_fields':[]};if(_0x13e793[_0x1814('0x36')]>0x0){_['forEach'](_0x13e793,function(_0x4ea3b3){if(_0x4ea3b3['type']===_0x1814('0x3f')&&_0x4ea3b3[_0x1814('0x40')]&&!_0x4ea3b3[_0x1814('0x41')]){_0x2f9361[_0x4ea3b3[_0x1814('0x40')][_0x1814('0x42')]()]=_0x4ea3b3[_0x1814('0x43')][_0x1814('0x25')]();}else if(_0x4ea3b3['type']===_0x1814('0x3f')&&_0x4ea3b3[_0x1814('0x44')]&&_0x4ea3b3['customField']){_0x2f9361[_0x1814('0x45')][_0x1814('0x46')]({'id':_0x4ea3b3['idField'],'value':_0x4ea3b3[_0x1814('0x43')][_0x1814('0x25')]()});}else if(_0x4ea3b3[_0x1814('0x47')]==='variable'&&_0x4ea3b3[_0x1814('0x1e')]&&_0x4ea3b3[_0x1814('0x44')]&&_0x4ea3b3[_0x1814('0x41')]){_0x4f44ec[_0x4ea3b3[_0x1814('0x1e')]]&&_0x2f9361[_0x1814('0x45')]['push']({'id':_0x4ea3b3[_0x1814('0x44')],'value':_0x4f44ec[_0x4ea3b3['variableName']]['toString']()});}else if(_0x4ea3b3['type']===_0x1814('0x48')&&_0x4ea3b3[_0x1814('0x49')]&&_0x4ea3b3['Variable'][_0x1814('0xf')]&&_0x4ea3b3[_0x1814('0x44')]&&_0x4ea3b3['customField']){_0x4f44ec[_0x4ea3b3[_0x1814('0x49')]['name'][_0x1814('0x42')]()]&&_0x2f9361['custom_fields'][_0x1814('0x46')]({'id':_0x4ea3b3[_0x1814('0x44')],'value':_0x4f44ec[_0x4ea3b3[_0x1814('0x49')][_0x1814('0xf')][_0x1814('0x42')]()][_0x1814('0x25')]()});}});}return _0x2f9361;}function getConnection(_0x269614){return request({'method':_0x1814('0x4a'),'form':{'method':_0x1814('0x4b'),'input_type':_0x1814('0x20'),'response_type':_0x1814('0x20'),'rest_data':JSON[_0x1814('0x27')]({'user_auth':{'user_name':_0x269614[_0x1814('0x4c')],'password':_0x269614[_0x1814('0x4d')],'encryption':'PLAIN'},'application':'xCALLY\x20Motion\x20integration'})}})[_0x1814('0x2d')](function(_0x435ae6){var _0x5b44d6=_0x435ae6;if(_0x5b44d6['id']){def[_0x1814('0x4e')]=_0x5b44d6['id'];return BPromise[_0x1814('0x31')](_0x5b44d6);}else{throw new Error(util[_0x1814('0x22')](_0x1814('0x4f'),_0x269614['id']));}});}function setRelationship(_0x193dcd,_0x498e7d,_0x34dd74,_0x1d940f){return request({'form':{'method':_0x1814('0x50'),'input_type':_0x1814('0x20'),'response_type':_0x1814('0x20'),'rest_data':JSON[_0x1814('0x27')]({'session':_0x193dcd['id'],'module_name':_0x1814('0x21'),'module_id':_0x34dd74['id'],'link_field_name':_0x1d940f,'related_ids':[_0x498e7d['id']],'name_value_list':[],'delete':0x0})}});}exports['queue']=function(_0x56a052,_0x5c405b,_0x341187,_0x772ce8,_0x5bd238,_0x3dad76){var _0x167e32,_0x4eca95,_0x1fd6ea,_0x56ccf7;_0x3dad76[_0x1814('0x51')]=intUtil[_0x1814('0x52')](_0x3dad76[_0x1814('0x51')]);_0x3dad76[_0x1814('0x53')]=intUtil['stripTrailingSlash'](_0x3dad76[_0x1814('0x53')]);def[_0x1814('0x54')]=util['format'](_0x1814('0x55'),_0x3dad76[_0x1814('0x51')]);if(_0x5bd238&&_0x5bd238[_0x1814('0x56')]){logger[_0x1814('0xd')](_0x1814('0x57'),_0x1814('0x58'));_0x5c405b['recordingURL']=util['format'](_0x1814('0x59'),_0x3dad76[_0x1814('0x53')],_0x5c405b[_0x1814('0x5a')],md5(_0x5c405b[_0x1814('0x5a')]));}else{_0x5c405b['recordingURL']='';}return getConnection(_0x3dad76)[_0x1814('0x2d')](function(_0x35c181){_0x56ccf7=_0x35c181;return getUser(_0x3dad76,_0x772ce8['name'],_0x56ccf7);})[_0x1814('0x2d')](function(_0x434549){_0x167e32=_0x434549;logger['info'](_0x1814('0x5b'),_0x167e32['id']);return getEndUser(_0x3dad76,_0x5c405b['calleridname'],_0x5c405b[_0x1814('0x5c')],_0x56ccf7);})['then'](function(_0x208aee){_0x4eca95=_0x208aee;logger[_0x1814('0xd')](_0x1814('0x5d'),_0x4eca95['id']);return getTicket(_0x3dad76,_0x167e32,_0x4eca95,_0x341187,_0x5c405b,_0x341187['Fields'],_0x56ccf7,_0x1814('0x5e'));})[_0x1814('0x2d')](function(_0x1640fd){_0x1fd6ea=_0x1640fd;logger['info'](_0x1814('0x5f'));logger[_0x1814('0xd')](_0x1814('0x60'),_0x1fd6ea['id']);return setRelationship(_0x56ccf7,_0x167e32,_0x1fd6ea,_0x1814('0x61'));})[_0x1814('0x2d')](function(){return setRelationship(_0x56ccf7,_0x4eca95,_0x1fd6ea,_0x1814('0x62'));})['then'](function(){return getServerInfo(_0x56ccf7);})[_0x1814('0x2d')](function(_0x5a214a){var _0x24e1f6=parseInt(_0x5a214a[_0x1814('0x63')][_0x1814('0x64')](0x0));var _0x2434d9=util[_0x1814('0x22')](_0x1814('0x65'),_0x3dad76[_0x1814('0x51')],_0x1fd6ea['id']);if(_0x24e1f6>0x6){_0x2434d9=util['format'](_0x1814('0x66'),_0x3dad76[_0x1814('0x51')],_0x1fd6ea['id']);}logger[_0x1814('0xd')]('[QUEUE]',_0x1814('0x67'));emit(util[_0x1814('0x22')](_0x1814('0x68'),_0x772ce8[_0x1814('0xf')]),'trigger:browser:url',{'uri':_0x2434d9});})[_0x1814('0x69')](function(_0x57e463){logger[_0x1814('0x6a')](_0x1814('0x57'),JSON[_0x1814('0x27')](_0x57e463));});};exports[_0x1814('0x6b')]=function(_0x1676c4,_0x3804a0,_0x4bb765,_0x11a561,_0x5171c3,_0x362333,_0x44bc22){var _0x3f175b,_0x3a6b31,_0x137b6f,_0x310237;_0x362333['remoteUri']=intUtil[_0x1814('0x52')](_0x362333['remoteUri']);_0x362333[_0x1814('0x53')]=intUtil[_0x1814('0x52')](_0x362333[_0x1814('0x53')]);def['uri']=util['format'](_0x1814('0x55'),_0x362333[_0x1814('0x51')]);if(_0x44bc22&&_0x44bc22[_0x1814('0x6c')]&&_0x44bc22[_0x1814('0x6c')]!==_0x1814('0x6d')){logger[_0x1814('0xd')](_0x1814('0x6e'),'Recording\x20is\x20enabled!');_0x3804a0['recordingURL']=util[_0x1814('0x22')](_0x1814('0x59'),_0x362333[_0x1814('0x53')],_0x3804a0[_0x1814('0x5a')],md5(_0x3804a0[_0x1814('0x5a')]));}return getConnection(_0x362333)[_0x1814('0x2d')](function(_0x34fc92){_0x310237=_0x34fc92;return getUser(_0x362333,_0x11a561['name'],_0x310237);})['then'](function(_0x33d441){_0x3f175b=_0x33d441;logger[_0x1814('0xd')]('The\x20User\x20ID\x20is:',_0x3f175b['id']);return getEndUser(_0x362333,_0x3804a0[_0x1814('0x6f')],_0x3804a0['destcalleridnum'],_0x310237);})[_0x1814('0x2d')](function(_0x2a5221){_0x3a6b31=_0x2a5221;logger['info'](_0x1814('0x5d'),_0x3a6b31['id']);return getTicket(_0x362333,_0x3f175b,_0x3a6b31,_0x4bb765,_0x3804a0,_0x4bb765[_0x1814('0x70')],_0x310237,_0x1814('0x71'));})[_0x1814('0x2d')](function(_0x3f8213){_0x137b6f=_0x3f8213;logger['info'](_0x1814('0x5f'));logger[_0x1814('0xd')]('The\x20Ticket\x20ID\x20is:',_0x137b6f['id']);return setRelationship(_0x310237,_0x3f175b,_0x137b6f,_0x1814('0x61'));})['then'](function(){return setRelationship(_0x310237,_0x3a6b31,_0x137b6f,'contacts');})[_0x1814('0x2d')](function(){return getServerInfo(_0x310237);})[_0x1814('0x2d')](function(_0x1936a9){var _0xc6a1df=parseInt(_0x1936a9[_0x1814('0x63')][_0x1814('0x64')](0x0));var _0x211fdc=util['format'](_0x1814('0x65'),_0x362333[_0x1814('0x51')],_0x137b6f['id']);if(_0xc6a1df>0x6){_0x211fdc=util[_0x1814('0x22')](_0x1814('0x66'),_0x362333['remoteUri'],_0x137b6f['id']);}logger[_0x1814('0xd')](_0x1814('0x6e'),'Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...');emit(util[_0x1814('0x22')](_0x1814('0x68'),_0x11a561[_0x1814('0xf')]),_0x1814('0x72'),{'uri':_0x211fdc});})['catch'](function(_0x4f3917){logger[_0x1814('0x6a')](_0x1814('0x6e'),JSON[_0x1814('0x27')](_0x4f3917));});};exports[_0x1814('0x73')]=function(_0x408921,_0x15d743,_0x5d7f26,_0x5aa13a,_0x4746cb,_0x124825){var _0x2d4481,_0x24a3be,_0x3ded26,_0x200fd7;_0x124825['remoteUri']=intUtil[_0x1814('0x52')](_0x124825[_0x1814('0x51')]);_0x124825[_0x1814('0x53')]=intUtil[_0x1814('0x52')](_0x124825[_0x1814('0x53')]);def[_0x1814('0x54')]=util[_0x1814('0x22')](_0x1814('0x55'),_0x124825[_0x1814('0x51')]);if(_0x4746cb&&_0x4746cb[_0x1814('0x56')]){logger[_0x1814('0xd')]('['+_0x15d743[_0x1814('0x74')]['toUpperCase']()+']',_0x1814('0x58'));_0x15d743[_0x1814('0x75')]=util[_0x1814('0x22')]('%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s',_0x124825[_0x1814('0x53')],_0x15d743['uniqueid'],md5(_0x15d743[_0x1814('0x5a')]));}else{_0x15d743[_0x1814('0x75')]='';}return getConnection(_0x124825)['then'](function(_0x2eb522){_0x200fd7=_0x2eb522;if(!_[_0x1814('0x28')](_0x5aa13a)){return getUser(_0x124825,_0x5aa13a[_0x1814('0xf')],_0x200fd7);}else{return getUser(_0x124825,null,_0x200fd7);}})[_0x1814('0x2d')](function(_0x5ec25e){_0x2d4481=_0x5ec25e;logger[_0x1814('0xd')](_0x1814('0x5b'),_0x2d4481['id']);return getEndUser(_0x124825,_0x15d743[_0x1814('0x76')],_0x15d743[_0x1814('0x5c')],_0x200fd7);})[_0x1814('0x2d')](function(_0x1efa2b){_0x24a3be=_0x1efa2b;logger[_0x1814('0xd')](_0x1814('0x5d'),_0x24a3be['id']);return getTicket(_0x124825,_0x2d4481,_0x24a3be,_0x5d7f26,_0x15d743,_0x5d7f26[_0x1814('0x70')],_0x200fd7,'Inbound');})[_0x1814('0x2d')](function(_0x58cb39){_0x3ded26=_0x58cb39;logger[_0x1814('0xd')](_0x1814('0x5f'));logger['info'](_0x1814('0x60'),_0x3ded26['id']);return setRelationship(_0x200fd7,_0x2d4481,_0x3ded26,_0x1814('0x61'));})[_0x1814('0x2d')](function(){return setRelationship(_0x200fd7,_0x24a3be,_0x3ded26,'contacts');})[_0x1814('0x2d')](function(){return getServerInfo(_0x200fd7);})[_0x1814('0x69')](function(_0x3c5a49){logger['error']('['+_0x15d743[_0x1814('0x74')]['toUpperCase']()+']',JSON[_0x1814('0x27')](_0x3c5a49));});}; \ No newline at end of file +var _0xa223=['find','phone_home','Enduser\x20not\x20found,\x20creating\x20a\x20new\x20enduser!','set_entry','first_name','','Caller\x20-\x20%s','Enduser\x20created.','debug','merge','map','forEach','type','string','nameField','customField','toLowerCase','custom_fields','idField','content','variable','variableName','customVariable','Variable','username','password','PLAIN','xCALLY\x20Motion\x20integration','sessionID','set_relationship','remoteUri','stripTrailingSlash','serverUrl','uri','%s/service/v4_1/rest.php','[QUEUE]','Recording\x20is\x20enabled!','recordingURL','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','uniqueid','The\x20User\x20ID\x20is:','calleridname','calleridnum','Inbound','The\x20Ticket\x20ID\x20is:','users','contacts','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','Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...','user:%s','trigger:browser:url','catch','error','none','[OUTBOUND]','destcalleridname','destcalleridnum','Fields','Outbound','version','unmanaged','monitor_format','lastevent','toUpperCase','The\x20Enduser\x20ID\x20is:','Ticket\x20created!','lodash','md5','util','../../../../config/environment','../../../../config/logger','sugarcrm','redis','defaults','localhost','POST','emit','info','getString','Subjects','assigned_user_id','description','Descriptions','date_start','toISOString','replace','duration_hours','duration_minutes','parent_id','parent_type','Contacts','parent_name','name','direction','push','JSON','stringify','Calls','format','Basic\x20%s','apiKey','toString','get_server_info','isNil','Getting\x20agent\x20with\x20name','get_entry_list','Employees','user_name','then','length','entry_list','name_value_list','value','Agent\x20found!','resolve','Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!','user_id','Agent\x20not\x20available,\x20using\x20the\x20admin\x20account!','Searching\x20enduser\x20with\x20phone','contacts.phone_home\x20=\x20\x22%s\x22'];(function(_0x22da50,_0x56ed53){var _0x163baa=function(_0x465a75){while(--_0x465a75){_0x22da50['push'](_0x22da50['shift']());}};_0x163baa(++_0x56ed53);}(_0xa223,0xbe));var _0x3a22=function(_0x5c1948,_0x3830f4){_0x5c1948=_0x5c1948-0x0;var _0x392103=_0xa223[_0x5c1948];return _0x392103;};'use strict';var _=require(_0x3a22('0x0'));var rp=require('request-promise');var BPromise=require('bluebird');var md5=require(_0x3a22('0x1'));var util=require(_0x3a22('0x2'));var Redis=require('ioredis');var intUtil=require('./util');var config=require(_0x3a22('0x3'));var logger=require(_0x3a22('0x4'))(_0x3a22('0x5'));config[_0x3a22('0x6')]=_[_0x3a22('0x7')](config[_0x3a22('0x6')],{'host':_0x3a22('0x8'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config['redis']));var def={'method':_0x3a22('0x9'),'json':!![]};function emit(_0x340efe,_0x46f8e0,_0x555ed0){io['to'](_0x340efe)[_0x3a22('0xa')](_0x46f8e0,_0x555ed0);}function getTicket(_0x32d10f,_0x18381c,_0x1a0bcd,_0x4c9106,_0x2189a7,_0x17a8ae,_0x1dc7a1,_0x2ab916){logger[_0x3a22('0xb')]('Creating\x20new\x20ticket...');var _0xe438dc=new Date();var _0x3a5d6a=[{'name':'name','value':intUtil[_0x3a22('0xc')](_0x4c9106[_0x3a22('0xd')],_0x2189a7,'\x20')},{'name':_0x3a22('0xe'),'value':_0x18381c['id']},{'name':'created_by','value':_0x18381c['id']},{'name':_0x3a22('0xf'),'value':intUtil[_0x3a22('0xc')](_0x4c9106[_0x3a22('0x10')],_0x2189a7,'\x0a')},{'name':_0x3a22('0x11'),'value':_0xe438dc[_0x3a22('0x12')]()['slice'](0x0,0x13)[_0x3a22('0x13')]('T','\x20')},{'name':_0x3a22('0x14'),'value':'0'},{'name':_0x3a22('0x15'),'value':'15'},{'name':_0x3a22('0x16'),'value':_0x1a0bcd['id']},{'name':_0x3a22('0x17'),'value':_0x3a22('0x18')},{'name':_0x3a22('0x19'),'value':_0x1a0bcd[_0x3a22('0x1a')]},{'name':_0x3a22('0x1b'),'value':_0x2ab916}];if(_0x17a8ae['length']){_['forEach'](_0x17a8ae,function(_0x582517){if(_0x2189a7[_0x582517['variableName']]){_0x3a5d6a[_0x3a22('0x1c')]({'name':_0x582517['idField'],'value':_0x2189a7[_0x582517['variableName']]});}});}return request({'form':{'method':'set_entry','input_type':_0x3a22('0x1d'),'response_type':_0x3a22('0x1d'),'rest_data':JSON[_0x3a22('0x1e')]({'session':_0x1dc7a1['id'],'module_name':_0x3a22('0x1f'),'name_value_list':_0x3a5d6a})}});}function getAuth(_0x26177e){return util[_0x3a22('0x20')](_0x3a22('0x21'),new Buffer(_0x26177e[_0x3a22('0x22')]+':X')[_0x3a22('0x23')]('base64'));}function getServerInfo(_0x2eaeeb){return request({'form':{'method':_0x3a22('0x24'),'input_type':'JSON','response_type':_0x3a22('0x1d'),'rest_data':JSON[_0x3a22('0x1e')]({'session':_0x2eaeeb['id']})}});}function getUser(_0x531d36,_0x304d94,_0x448d60){if(!_[_0x3a22('0x25')](_0x304d94)){logger[_0x3a22('0xb')](_0x3a22('0x26'),_0x304d94);return request({'form':{'method':_0x3a22('0x27'),'input_type':'JSON','response_type':_0x3a22('0x1d'),'rest_data':JSON[_0x3a22('0x1e')]({'session':_0x448d60['id'],'module_name':_0x3a22('0x28'),'query':util[_0x3a22('0x20')]('INSTR\x20(\x20users.user_name,\x20\x22%s\x22)\x20>\x200',_0x304d94),'order_by':'','offset':'0','select_fields':['id','name',_0x3a22('0x29')],'link_name_to_fields_array':[],'max_results':-0x1,'deleted':'0'})}})[_0x3a22('0x2a')](function(_0x2795ac){if(_0x2795ac['entry_list'][_0x3a22('0x2b')]){var _0x1da510=_['find'](_0x2795ac[_0x3a22('0x2c')],function(_0x3710fd){return _0x3710fd[_0x3a22('0x2d')][_0x3a22('0x29')][_0x3a22('0x2e')]===_0x304d94;});if(_0x1da510){logger[_0x3a22('0xb')](_0x3a22('0x2f'));return BPromise[_0x3a22('0x30')]({'id':_0x1da510['name_value_list']['id'][_0x3a22('0x2e')],'name':_0x1da510['name_value_list'][_0x3a22('0x1a')][_0x3a22('0x2e')]});}}logger[_0x3a22('0xb')](_0x3a22('0x31'));return BPromise['resolve']({'id':_0x448d60['name_value_list'][_0x3a22('0x32')]['value'],'name':_0x448d60[_0x3a22('0x2d')][_0x3a22('0x29')][_0x3a22('0x2e')]});});}else{logger[_0x3a22('0xb')](_0x3a22('0x33'));return BPromise['resolve']({'id':_0x448d60[_0x3a22('0x2d')][_0x3a22('0x32')][_0x3a22('0x2e')],'name':_0x448d60[_0x3a22('0x2d')][_0x3a22('0x29')][_0x3a22('0x2e')]});}}function getEndUser(_0x5e63cf,_0x5f3a7e,_0x3ea308,_0x4a172e){logger[_0x3a22('0xb')](_0x3a22('0x34'),_0x3ea308);return request({'form':{'method':_0x3a22('0x27'),'input_type':_0x3a22('0x1d'),'response_type':'JSON','rest_data':JSON[_0x3a22('0x1e')]({'session':_0x4a172e['id'],'module_name':_0x3a22('0x18'),'query':util[_0x3a22('0x20')](_0x3a22('0x35'),_0x3ea308),'order_by':'','offset':'0','select_fields':['id',_0x3a22('0x1a'),'phone_home'],'link_name_to_fields_array':[],'max_results':-0x1,'deleted':'0'})}})[_0x3a22('0x2a')](function(_0x442a33){if(_0x442a33[_0x3a22('0x2c')][_0x3a22('0x2b')]){var _0x15f4c7=_[_0x3a22('0x36')](_0x442a33['entry_list'],function(_0x11c5e3){return _0x11c5e3[_0x3a22('0x2d')][_0x3a22('0x37')][_0x3a22('0x2e')]===_0x3ea308;});if(_0x15f4c7){logger[_0x3a22('0xb')]('Enduser\x20found!');return BPromise[_0x3a22('0x30')]({'id':_0x15f4c7[_0x3a22('0x2d')]['id']['value'],'name':_0x15f4c7[_0x3a22('0x2d')]['name']['value'],'phone':_0x15f4c7[_0x3a22('0x2d')][_0x3a22('0x37')]['value']});}}else{logger[_0x3a22('0xb')](_0x3a22('0x38'));return request({'form':{'method':_0x3a22('0x39'),'input_type':_0x3a22('0x1d'),'response_type':'JSON','rest_data':JSON[_0x3a22('0x1e')]({'session':_0x4a172e['id'],'module_name':'Contacts','name_value_list':[{'name':_0x3a22('0x3a'),'value':_0x5f3a7e!==_0x3a22('0x3b')?_0x5f3a7e:util[_0x3a22('0x20')](_0x3a22('0x3c'),_0x3ea308)},{'name':_0x3a22('0x37'),'value':_0x3ea308}]})}})[_0x3a22('0x2a')](function(_0x5cb6c0){logger[_0x3a22('0xb')](_0x3a22('0x3d'));return BPromise[_0x3a22('0x30')]({'id':_0x5cb6c0['id'],'name':_0x5cb6c0['entry_list'][_0x3a22('0x3a')][_0x3a22('0x2e')],'phone':_0x5cb6c0['entry_list'][_0x3a22('0x37')]['value']});});}});}function request(_0x4cebe7){logger[_0x3a22('0x3e')]('[HTTP]',JSON['stringify'](_0x4cebe7));return rp(_[_0x3a22('0x3f')](def,_0x4cebe7));}function getTags(_0x2c8eb2,_0x27a706){var _0xa36af8=[];if(_0x2c8eb2&&_0x2c8eb2[_0x3a22('0x2b')]>0x0){_0xa36af8=_[_0x3a22('0x40')](_0x2c8eb2,_0x27a706);}return _0xa36af8;}function getCustomFields(_0x21063,_0x4d7468){var _0x2e62c2=[];var _0x1fa034={'custom_fields':[]};if(_0x21063[_0x3a22('0x2b')]>0x0){_[_0x3a22('0x41')](_0x21063,function(_0x47ca4a){if(_0x47ca4a[_0x3a22('0x42')]===_0x3a22('0x43')&&_0x47ca4a[_0x3a22('0x44')]&&!_0x47ca4a[_0x3a22('0x45')]){_0x1fa034[_0x47ca4a['nameField'][_0x3a22('0x46')]()]=_0x47ca4a['content'][_0x3a22('0x23')]();}else if(_0x47ca4a['type']===_0x3a22('0x43')&&_0x47ca4a['idField']&&_0x47ca4a[_0x3a22('0x45')]){_0x1fa034[_0x3a22('0x47')]['push']({'id':_0x47ca4a[_0x3a22('0x48')],'value':_0x47ca4a[_0x3a22('0x49')][_0x3a22('0x23')]()});}else if(_0x47ca4a['type']===_0x3a22('0x4a')&&_0x47ca4a[_0x3a22('0x4b')]&&_0x47ca4a[_0x3a22('0x48')]&&_0x47ca4a[_0x3a22('0x45')]){_0x4d7468[_0x47ca4a[_0x3a22('0x4b')]]&&_0x1fa034[_0x3a22('0x47')][_0x3a22('0x1c')]({'id':_0x47ca4a[_0x3a22('0x48')],'value':_0x4d7468[_0x47ca4a[_0x3a22('0x4b')]]['toString']()});}else if(_0x47ca4a[_0x3a22('0x42')]===_0x3a22('0x4c')&&_0x47ca4a['Variable']&&_0x47ca4a['Variable'][_0x3a22('0x1a')]&&_0x47ca4a[_0x3a22('0x48')]&&_0x47ca4a[_0x3a22('0x45')]){_0x4d7468[_0x47ca4a[_0x3a22('0x4d')][_0x3a22('0x1a')][_0x3a22('0x46')]()]&&_0x1fa034['custom_fields']['push']({'id':_0x47ca4a[_0x3a22('0x48')],'value':_0x4d7468[_0x47ca4a[_0x3a22('0x4d')]['name']['toLowerCase']()]['toString']()});}});}return _0x1fa034;}function getConnection(_0x1d8592){return request({'method':_0x3a22('0x9'),'form':{'method':'login','input_type':_0x3a22('0x1d'),'response_type':'JSON','rest_data':JSON[_0x3a22('0x1e')]({'user_auth':{'user_name':_0x1d8592[_0x3a22('0x4e')],'password':_0x1d8592[_0x3a22('0x4f')],'encryption':_0x3a22('0x50')},'application':_0x3a22('0x51')})}})[_0x3a22('0x2a')](function(_0x5c4e90){var _0x4413ca=_0x5c4e90;if(_0x4413ca['id']){def[_0x3a22('0x52')]=_0x4413ca['id'];return BPromise[_0x3a22('0x30')](_0x4413ca);}else{throw new Error(util[_0x3a22('0x20')]('Account\x20%d\x20is\x20not\x20valid',_0x1d8592['id']));}});}function setRelationship(_0x30b991,_0x2d3fc8,_0x3c4e7a,_0xab1784){return request({'form':{'method':_0x3a22('0x53'),'input_type':_0x3a22('0x1d'),'response_type':_0x3a22('0x1d'),'rest_data':JSON[_0x3a22('0x1e')]({'session':_0x30b991['id'],'module_name':'Calls','module_id':_0x3c4e7a['id'],'link_field_name':_0xab1784,'related_ids':[_0x2d3fc8['id']],'name_value_list':[],'delete':0x0})}});}exports['queue']=function(_0x566cd3,_0x161329,_0x1f66d9,_0x4591c0,_0x895a7a,_0x509804){var _0x381a65,_0x19564c,_0x4e36a7,_0x2741e6;_0x509804[_0x3a22('0x54')]=intUtil[_0x3a22('0x55')](_0x509804[_0x3a22('0x54')]);_0x509804[_0x3a22('0x56')]=intUtil[_0x3a22('0x55')](_0x509804['serverUrl']);def[_0x3a22('0x57')]=util[_0x3a22('0x20')](_0x3a22('0x58'),_0x509804[_0x3a22('0x54')]);if(_0x895a7a&&_0x895a7a['monitor_format']){logger[_0x3a22('0xb')](_0x3a22('0x59'),_0x3a22('0x5a'));_0x161329[_0x3a22('0x5b')]=util['format'](_0x3a22('0x5c'),_0x509804[_0x3a22('0x56')],_0x161329[_0x3a22('0x5d')],md5(_0x161329[_0x3a22('0x5d')]));}else{_0x161329[_0x3a22('0x5b')]='';}return getConnection(_0x509804)['then'](function(_0xc17b5){_0x2741e6=_0xc17b5;return getUser(_0x509804,_0x4591c0[_0x3a22('0x1a')],_0x2741e6);})[_0x3a22('0x2a')](function(_0x3ed158){_0x381a65=_0x3ed158;logger['info'](_0x3a22('0x5e'),_0x381a65['id']);return getEndUser(_0x509804,_0x161329[_0x3a22('0x5f')],_0x161329[_0x3a22('0x60')],_0x2741e6);})[_0x3a22('0x2a')](function(_0x297174){_0x19564c=_0x297174;logger[_0x3a22('0xb')]('The\x20Enduser\x20ID\x20is:',_0x19564c['id']);return getTicket(_0x509804,_0x381a65,_0x19564c,_0x1f66d9,_0x161329,_0x1f66d9['Fields'],_0x2741e6,_0x3a22('0x61'));})[_0x3a22('0x2a')](function(_0x305987){_0x4e36a7=_0x305987;logger[_0x3a22('0xb')]('Ticket\x20created!');logger[_0x3a22('0xb')](_0x3a22('0x62'),_0x4e36a7['id']);return setRelationship(_0x2741e6,_0x381a65,_0x4e36a7,_0x3a22('0x63'));})[_0x3a22('0x2a')](function(){return setRelationship(_0x2741e6,_0x19564c,_0x4e36a7,_0x3a22('0x64'));})[_0x3a22('0x2a')](function(){return getServerInfo(_0x2741e6);})[_0x3a22('0x2a')](function(_0x58a1ae){var _0x2b8466=parseInt(_0x58a1ae['version'][_0x3a22('0x65')](0x0));var _0x5cb68a=util['format'](_0x3a22('0x66'),_0x509804[_0x3a22('0x54')],_0x4e36a7['id']);if(_0x2b8466>0x6){_0x5cb68a=util['format'](_0x3a22('0x67'),_0x509804[_0x3a22('0x54')],_0x4e36a7['id']);}logger[_0x3a22('0xb')](_0x3a22('0x59'),_0x3a22('0x68'));emit(util[_0x3a22('0x20')](_0x3a22('0x69'),_0x4591c0[_0x3a22('0x1a')]),_0x3a22('0x6a'),{'uri':_0x5cb68a});})[_0x3a22('0x6b')](function(_0x395e71){logger[_0x3a22('0x6c')]('[QUEUE]',JSON[_0x3a22('0x1e')](_0x395e71));});};exports['outbound']=function(_0x374a8b,_0x4439e1,_0x1e7624,_0x2205ed,_0x37d95e,_0x45ad98,_0x2cf59b){var _0x1b0636,_0x8b7e96,_0x2f8d62,_0x546879;_0x45ad98[_0x3a22('0x54')]=intUtil[_0x3a22('0x55')](_0x45ad98[_0x3a22('0x54')]);_0x45ad98[_0x3a22('0x56')]=intUtil[_0x3a22('0x55')](_0x45ad98[_0x3a22('0x56')]);def[_0x3a22('0x57')]=util[_0x3a22('0x20')](_0x3a22('0x58'),_0x45ad98[_0x3a22('0x54')]);if(_0x2cf59b&&_0x2cf59b['recordingFormat']&&_0x2cf59b['recordingFormat']!==_0x3a22('0x6d')){logger[_0x3a22('0xb')](_0x3a22('0x6e'),_0x3a22('0x5a'));_0x4439e1[_0x3a22('0x5b')]=util[_0x3a22('0x20')](_0x3a22('0x5c'),_0x45ad98['serverUrl'],_0x4439e1[_0x3a22('0x5d')],md5(_0x4439e1['uniqueid']));}return getConnection(_0x45ad98)[_0x3a22('0x2a')](function(_0x383831){_0x546879=_0x383831;return getUser(_0x45ad98,_0x2205ed['name'],_0x546879);})[_0x3a22('0x2a')](function(_0x562f2d){_0x1b0636=_0x562f2d;logger[_0x3a22('0xb')]('The\x20User\x20ID\x20is:',_0x1b0636['id']);return getEndUser(_0x45ad98,_0x4439e1[_0x3a22('0x6f')],_0x4439e1[_0x3a22('0x70')],_0x546879);})[_0x3a22('0x2a')](function(_0x55cb69){_0x8b7e96=_0x55cb69;logger[_0x3a22('0xb')]('The\x20Enduser\x20ID\x20is:',_0x8b7e96['id']);return getTicket(_0x45ad98,_0x1b0636,_0x8b7e96,_0x1e7624,_0x4439e1,_0x1e7624[_0x3a22('0x71')],_0x546879,_0x3a22('0x72'));})[_0x3a22('0x2a')](function(_0x1ec51f){_0x2f8d62=_0x1ec51f;logger[_0x3a22('0xb')]('Ticket\x20created!');logger['info'](_0x3a22('0x62'),_0x2f8d62['id']);return setRelationship(_0x546879,_0x1b0636,_0x2f8d62,_0x3a22('0x63'));})[_0x3a22('0x2a')](function(){return setRelationship(_0x546879,_0x8b7e96,_0x2f8d62,_0x3a22('0x64'));})[_0x3a22('0x2a')](function(){return getServerInfo(_0x546879);})[_0x3a22('0x2a')](function(_0x27d0fe){var _0x65a41b=parseInt(_0x27d0fe[_0x3a22('0x73')][_0x3a22('0x65')](0x0));var _0x4b18f6=util[_0x3a22('0x20')]('%s/index.php?action=ajaxui#ajaxUILoc=index.php%3Fmodule%3DCalls%26action%3DEditView%26record%3D%s',_0x45ad98[_0x3a22('0x54')],_0x2f8d62['id']);if(_0x65a41b>0x6){_0x4b18f6=util[_0x3a22('0x20')](_0x3a22('0x67'),_0x45ad98[_0x3a22('0x54')],_0x2f8d62['id']);}logger[_0x3a22('0xb')](_0x3a22('0x6e'),'Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...');emit(util[_0x3a22('0x20')](_0x3a22('0x69'),_0x2205ed[_0x3a22('0x1a')]),_0x3a22('0x6a'),{'uri':_0x4b18f6});})[_0x3a22('0x6b')](function(_0x2836aa){logger[_0x3a22('0x6c')](_0x3a22('0x6e'),JSON[_0x3a22('0x1e')](_0x2836aa));});};exports[_0x3a22('0x74')]=function(_0x4edd66,_0x39681b,_0x2ac786,_0x1d3a9e,_0x53abe9,_0x1be202){var _0xbbde52,_0x266f50,_0x1eee2e,_0x140c80;_0x1be202[_0x3a22('0x54')]=intUtil['stripTrailingSlash'](_0x1be202['remoteUri']);_0x1be202[_0x3a22('0x56')]=intUtil[_0x3a22('0x55')](_0x1be202[_0x3a22('0x56')]);def['uri']=util[_0x3a22('0x20')](_0x3a22('0x58'),_0x1be202[_0x3a22('0x54')]);if(_0x53abe9&&_0x53abe9[_0x3a22('0x75')]){logger[_0x3a22('0xb')]('['+_0x39681b[_0x3a22('0x76')][_0x3a22('0x77')]()+']','Recording\x20is\x20enabled!');_0x39681b[_0x3a22('0x5b')]=util[_0x3a22('0x20')]('%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s',_0x1be202['serverUrl'],_0x39681b[_0x3a22('0x5d')],md5(_0x39681b[_0x3a22('0x5d')]));}else{_0x39681b[_0x3a22('0x5b')]='';}return getConnection(_0x1be202)[_0x3a22('0x2a')](function(_0x1d3f70){_0x140c80=_0x1d3f70;if(!_['isNil'](_0x1d3a9e)){return getUser(_0x1be202,_0x1d3a9e[_0x3a22('0x1a')],_0x140c80);}else{return getUser(_0x1be202,null,_0x140c80);}})['then'](function(_0x3ae0e3){_0xbbde52=_0x3ae0e3;logger[_0x3a22('0xb')]('The\x20User\x20ID\x20is:',_0xbbde52['id']);return getEndUser(_0x1be202,_0x39681b[_0x3a22('0x5f')],_0x39681b[_0x3a22('0x60')],_0x140c80);})[_0x3a22('0x2a')](function(_0x573d57){_0x266f50=_0x573d57;logger[_0x3a22('0xb')](_0x3a22('0x78'),_0x266f50['id']);return getTicket(_0x1be202,_0xbbde52,_0x266f50,_0x2ac786,_0x39681b,_0x2ac786['Fields'],_0x140c80,_0x3a22('0x61'));})[_0x3a22('0x2a')](function(_0x3626b1){_0x1eee2e=_0x3626b1;logger[_0x3a22('0xb')](_0x3a22('0x79'));logger[_0x3a22('0xb')](_0x3a22('0x62'),_0x1eee2e['id']);return setRelationship(_0x140c80,_0xbbde52,_0x1eee2e,_0x3a22('0x63'));})[_0x3a22('0x2a')](function(){return setRelationship(_0x140c80,_0x266f50,_0x1eee2e,_0x3a22('0x64'));})[_0x3a22('0x2a')](function(){return getServerInfo(_0x140c80);})[_0x3a22('0x6b')](function(_0x21ad42){logger[_0x3a22('0x6c')]('['+_0x39681b['lastevent'][_0x3a22('0x77')]()+']',JSON[_0x3a22('0x1e')](_0x21ad42));});}; \ 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 24927ee..3741e18 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 _0x0188=['%s:\x20%s','keyContent','variable','join','slice','substring','lastIndexOf','validateEmail','isNil','test','lodash','getString','length','sortBy','string','push','type','variableName','customVariable','Variable','toLowerCase','name','toString','keyValue','keyType','key','format'];(function(_0x5cd51d,_0x20d4fa){var _0x444608=function(_0x32a9dc){while(--_0x32a9dc){_0x5cd51d['push'](_0x5cd51d['shift']());}};_0x444608(++_0x20d4fa);}(_0x0188,0x1f0));var _0x8018=function(_0x455c6c,_0x1e78b7){_0x455c6c=_0x455c6c-0x0;var _0x488242=_0x0188[_0x455c6c];return _0x488242;};'use strict';var _=require(_0x8018('0x0'));var util=require('util');exports[_0x8018('0x1')]=function(_0x4a94d5,_0x248859,_0xf216e0){var _0x29750f=[];if(_0x4a94d5[_0x8018('0x2')]>0x0){var _0x2e8c1a=_[_0x8018('0x3')](_0x4a94d5,['id']);for(var _0x399a27=0x0;_0x399a27<_0x2e8c1a[_0x8018('0x2')];_0x399a27++){var _0x590866=_0x2e8c1a[_0x399a27];if(_0x590866['type']===_0x8018('0x4')){_0x29750f[_0x8018('0x5')](_0x590866['content']);}else if(_0x590866[_0x8018('0x6')]==='variable'&&_0x590866['variableName']){_0x248859[_0x590866[_0x8018('0x7')]]&&_0x29750f[_0x8018('0x5')](_0x248859[_0x590866[_0x8018('0x7')]]['toString']());}else if(_0x590866['type']===_0x8018('0x8')&&_0x590866['Variable']&&_0x590866[_0x8018('0x9')]['name']){_0x248859[_0x590866[_0x8018('0x9')]['name'][_0x8018('0xa')]()]&&_0x29750f[_0x8018('0x5')](_0x248859[_0x590866[_0x8018('0x9')][_0x8018('0xb')][_0x8018('0xa')]()][_0x8018('0xc')]());}else if(_0x590866[_0x8018('0x6')]===_0x8018('0xd')){if(_0x590866[_0x8018('0xe')]===_0x8018('0x4')&&_0x590866[_0x8018('0xf')]){_0x29750f[_0x8018('0x5')](util[_0x8018('0x10')](_0x8018('0x11'),_0x590866['key'],_0x590866[_0x8018('0x12')]));}else if(_0x590866[_0x8018('0xe')]===_0x8018('0x13')&&_0x590866[_0x8018('0x7')]&&_0x590866[_0x8018('0xf')]){_0x248859[_0x590866['variableName']]&&_0x29750f[_0x8018('0x5')](util[_0x8018('0x10')](_0x8018('0x11'),_0x590866[_0x8018('0xf')],_0x248859[_0x590866[_0x8018('0x7')]]));}else if(_0x590866['keyType']===_0x8018('0x8')&&_0x590866[_0x8018('0x9')]&&_0x590866[_0x8018('0x9')][_0x8018('0xb')]&&_0x590866[_0x8018('0xf')]){_0x248859[_0x590866[_0x8018('0x9')][_0x8018('0xb')][_0x8018('0xa')]()]&&_0x29750f[_0x8018('0x5')](util[_0x8018('0x10')]('%s:\x20%s',_0x590866[_0x8018('0xf')],_0x248859[_0x590866[_0x8018('0x9')][_0x8018('0xb')]['toLowerCase']()]));}}}}return _0x29750f[_0x8018('0x14')](_0xf216e0);};exports['stripTrailingSlash']=function(_0x1955ec){var _0x5eb67d=_0x1955ec[_0x8018('0x15')](-0x1);if(_0x5eb67d==='/'){_0x1955ec=_0x1955ec[_0x8018('0x16')](0x0,_0x1955ec[_0x8018('0x17')](_0x5eb67d));}return _0x1955ec;};exports[_0x8018('0x18')]=function(_0xce2191){if(!_[_0x8018('0x19')](_0xce2191)&&_0xce2191!==''){var _0x23507a=/^(([^<>()\[\]\\.,;:\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 _0x23507a[_0x8018('0x1a')](String(_0xce2191)[_0x8018('0xa')]());}else{return![];}}; \ No newline at end of file +var _0x9fc5=['validateEmail','isNil','test','lodash','util','getString','length','sortBy','string','push','content','type','variable','variableName','toString','Variable','name','toLowerCase','key','format','%s:\x20%s','keyType','join','stripTrailingSlash','slice','substring','lastIndexOf'];(function(_0x11f43e,_0x3dc143){var _0x12a6e7=function(_0x4ea3dc){while(--_0x4ea3dc){_0x11f43e['push'](_0x11f43e['shift']());}};_0x12a6e7(++_0x3dc143);}(_0x9fc5,0xa5));var _0x59fc=function(_0x8bb4c1,_0x2d6e53){_0x8bb4c1=_0x8bb4c1-0x0;var _0x67a6e1=_0x9fc5[_0x8bb4c1];return _0x67a6e1;};'use strict';var _=require(_0x59fc('0x0'));var util=require(_0x59fc('0x1'));exports[_0x59fc('0x2')]=function(_0x395d25,_0x1dac41,_0xc60b7a){var _0x532615=[];if(_0x395d25[_0x59fc('0x3')]>0x0){var _0x2eb42d=_[_0x59fc('0x4')](_0x395d25,['id']);for(var _0x513e0b=0x0;_0x513e0b<_0x2eb42d[_0x59fc('0x3')];_0x513e0b++){var _0xfcde8b=_0x2eb42d[_0x513e0b];if(_0xfcde8b['type']===_0x59fc('0x5')){_0x532615[_0x59fc('0x6')](_0xfcde8b[_0x59fc('0x7')]);}else if(_0xfcde8b[_0x59fc('0x8')]===_0x59fc('0x9')&&_0xfcde8b[_0x59fc('0xa')]){_0x1dac41[_0xfcde8b['variableName']]&&_0x532615['push'](_0x1dac41[_0xfcde8b[_0x59fc('0xa')]][_0x59fc('0xb')]());}else if(_0xfcde8b[_0x59fc('0x8')]==='customVariable'&&_0xfcde8b['Variable']&&_0xfcde8b[_0x59fc('0xc')][_0x59fc('0xd')]){_0x1dac41[_0xfcde8b['Variable']['name'][_0x59fc('0xe')]()]&&_0x532615[_0x59fc('0x6')](_0x1dac41[_0xfcde8b[_0x59fc('0xc')]['name']['toLowerCase']()][_0x59fc('0xb')]());}else if(_0xfcde8b[_0x59fc('0x8')]==='keyValue'){if(_0xfcde8b['keyType']===_0x59fc('0x5')&&_0xfcde8b[_0x59fc('0xf')]){_0x532615[_0x59fc('0x6')](util[_0x59fc('0x10')](_0x59fc('0x11'),_0xfcde8b['key'],_0xfcde8b['keyContent']));}else if(_0xfcde8b[_0x59fc('0x12')]==='variable'&&_0xfcde8b['variableName']&&_0xfcde8b[_0x59fc('0xf')]){_0x1dac41[_0xfcde8b['variableName']]&&_0x532615[_0x59fc('0x6')](util['format'](_0x59fc('0x11'),_0xfcde8b[_0x59fc('0xf')],_0x1dac41[_0xfcde8b[_0x59fc('0xa')]]));}else if(_0xfcde8b[_0x59fc('0x12')]==='customVariable'&&_0xfcde8b['Variable']&&_0xfcde8b[_0x59fc('0xc')][_0x59fc('0xd')]&&_0xfcde8b['key']){_0x1dac41[_0xfcde8b['Variable'][_0x59fc('0xd')][_0x59fc('0xe')]()]&&_0x532615[_0x59fc('0x6')](util[_0x59fc('0x10')](_0x59fc('0x11'),_0xfcde8b['key'],_0x1dac41[_0xfcde8b[_0x59fc('0xc')]['name'][_0x59fc('0xe')]()]));}}}}return _0x532615[_0x59fc('0x13')](_0xc60b7a);};exports[_0x59fc('0x14')]=function(_0x4c17c0){var _0x21274c=_0x4c17c0[_0x59fc('0x15')](-0x1);if(_0x21274c==='/'){_0x4c17c0=_0x4c17c0[_0x59fc('0x16')](0x0,_0x4c17c0[_0x59fc('0x17')](_0x21274c));}return _0x4c17c0;};exports[_0x59fc('0x18')]=function(_0x2c6247){if(!_[_0x59fc('0x19')](_0x2c6247)&&_0x2c6247!==''){var _0x1788ef=/^(([^<>()\[\]\\.,;:\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 _0x1788ef[_0x59fc('0x1a')](String(_0x2c6247)[_0x59fc('0xe')]());}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 977433b..27ecf58 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 _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(_0x2c1acc,_0x485af9){var _0x90bd4e=function(_0x43ee90){while(--_0x43ee90){_0x2c1acc['push'](_0x2c1acc['shift']());}};_0x90bd4e(++_0x485af9);}(_0x9c44,0x178));var _0x49c4=function(_0x3ff085,_0x27c92e){_0x3ff085=_0x3ff085-0x0;var _0x2b68c3=_0x9c44[_0x3ff085];return _0x2b68c3;};'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 +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(_0x33cbe3,_0x5b0f58){var _0x537b81=function(_0xa45a2b){while(--_0xa45a2b){_0x33cbe3['push'](_0x33cbe3['shift']());}};_0x537b81(++_0x5b0f58);}(_0x9c44,0x178));var _0x49c4=function(_0x1035c1,_0x2d8583){_0x1035c1=_0x1035c1-0x0;var _0x308d67=_0x9c44[_0x1035c1];return _0x308d67;};'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 e4b64cd..bf1cae2 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 _0xdaec=['stringify','map','forEach','includes','string','picklist','type','nameField','toLowerCase','content','toString','customField','custom_fields','push','variable','variableName','idField','customVariable','Variable','queue','stripTrailingSlash','serverUrl','monitor_format','[QUEUE]','Recording\x20is\x20enabled!','recordingURL','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','uniqueid','Authorization','email','calleridname','calleridnum','The\x20Enduser\x20ID\x20is:','The\x20Ticket\x20ID\x20is:','integrationTab','%s/channels/voice/agents/%d/tickets/%d/display.json','Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...','user:%s','trigger:browser:url','%s/agent/tickets/%s','error','Zendesk\x20account\x20type\x20not\x20recognized','catch','[QUEUE]\x20Error\x20running\x20Zendesk\x20integration','inspect','outbound','recordingFormat','[OUTBOUND]','The\x20User\x20ID\x20is:','destcalleridnum','Displaying\x20ticket\x20to\x20agent...','newTab','replace','/api/v2','[OUTBOUND]\x20Error\x20running\x20Zendesk\x20integration','unmanaged','toUpperCase','lastevent','\x20Error\x20running\x20Zendesk\x20integration','lodash','request-promise','md5','util','../../../../config/logger','zendesk','redis','defaults','application/json','info','Creating\x20new\x20ticket...','%s/tickets.json','remoteUri','Tags','name','getString','Subjects','Descriptions','Fields','then','Ticket\x20created!','ticket','format','type:user\x20role:agent\x20email:%s','Agent\x20found!','find','results','Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!','%s/users/me.json','Admin\x20account\x20selected.','user','%s/search.json','type:user\x20role:end-user\x20phone:%s','length','filter','end-user','first','Enduser\x20not\x20found,\x20creating\x20a\x20new\x20enduser!','%s/users.json','POST','Caller\x20-\x20%s','Enduser\x20created.','password','%s:%s','username','authType','%s/token:%s','token','Basic\x20%s','base64','debug','[HTTP]'];(function(_0x5e3a45,_0x45f0c5){var _0x13419f=function(_0x5ac996){while(--_0x5ac996){_0x5e3a45['push'](_0x5e3a45['shift']());}};_0x13419f(++_0x45f0c5);}(_0xdaec,0x188));var _0xcdae=function(_0x31b2d3,_0x2a787){_0x31b2d3=_0x31b2d3-0x0;var _0x583cfc=_0xdaec[_0x31b2d3];return _0x583cfc;};'use strict';var _=require(_0xcdae('0x0'));var rp=require(_0xcdae('0x1'));var md5=require(_0xcdae('0x2'));var util=require(_0xcdae('0x3'));var Redis=require('ioredis');var intUtil=require('./util');var config=require('../../../../config/environment');var logger=require(_0xcdae('0x4'))(_0xcdae('0x5'));config[_0xcdae('0x6')]=_[_0xcdae('0x7')](config['redis'],{'host':'localhost','port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0xcdae('0x6')]));function emit(_0x553978,_0x32f686,_0x33a53b){io['to'](_0x553978)['emit'](_0x32f686,_0x33a53b);}var headers={'Content-Type':'application/json','Accept':_0xcdae('0x8')};function getTicket(_0x1fb91f,_0x6945eb,_0x4f8ceb,_0x54a9f4,_0xf91798){logger[_0xcdae('0x9')](_0xcdae('0xa'));return request({'uri':util['format'](_0xcdae('0xb'),_0x1fb91f[_0xcdae('0xc')]),'method':'POST','body':{'ticket':_['merge']({'requester_id':_0x4f8ceb['id'],'submitter_id':_0x6945eb?_0x6945eb['id']:undefined,'assignee_id':_0x6945eb?_0x6945eb['id']:undefined,'tags':getTags(_0x54a9f4[_0xcdae('0xd')],_0xcdae('0xe')),'subject':intUtil[_0xcdae('0xf')](_0x54a9f4[_0xcdae('0x10')],_0xf91798,'\x20'),'description':intUtil[_0xcdae('0xf')](_0x54a9f4[_0xcdae('0x11')],_0xf91798,'\x0a'),'comment':{'public':![],'body':intUtil[_0xcdae('0xf')](_0x54a9f4[_0xcdae('0x11')],_0xf91798,'\x0a')}},getCustomFields(_0x54a9f4[_0xcdae('0x12')],_0xf91798))}})[_0xcdae('0x13')](function(_0x146a7f){logger['info'](_0xcdae('0x14'));return _0x146a7f[_0xcdae('0x15')];});}function getUser(_0x963aaf,_0x469727){if(intUtil['validateEmail'](_0x469727)){logger['info']('Getting\x20agent\x20with\x20email',_0x469727);return request({'uri':util[_0xcdae('0x16')]('%s/search.json',_0x963aaf['remoteUri']),'qs':{'query':util[_0xcdae('0x16')](_0xcdae('0x17'),_0x469727)}})['then'](function(_0x450bdc){if(_0x450bdc['count']){logger['info'](_0xcdae('0x18'));return _[_0xcdae('0x19')](_0x450bdc[_0xcdae('0x1a')],{'email':_0x469727,'role':'agent'});}else{logger['info'](_0xcdae('0x1b'));return request({'uri':util[_0xcdae('0x16')](_0xcdae('0x1c'),_0x963aaf['remoteUri'])})[_0xcdae('0x13')](function(_0x591d23){logger[_0xcdae('0x9')](_0xcdae('0x1d'));return _0x591d23[_0xcdae('0x1e')];});}});}else{logger['info']('Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!');return request({'uri':util[_0xcdae('0x16')](_0xcdae('0x1c'),_0x963aaf[_0xcdae('0xc')])})[_0xcdae('0x13')](function(_0x401a81){logger[_0xcdae('0x9')](_0xcdae('0x1d'));return _0x401a81['user'];});}}function getEndUser(_0x3f21d7,_0x24990f,_0x22a3a5){logger[_0xcdae('0x9')]('Searching\x20enduser\x20with\x20phone',_0x22a3a5);return request({'uri':util[_0xcdae('0x16')](_0xcdae('0x1f'),_0x3f21d7['remoteUri']),'qs':{'query':util['format'](_0xcdae('0x20'),_0x22a3a5)}})['then'](function(_0x3bb5cd){var _0x5ed79c;if(_0x3bb5cd[_0xcdae('0x1a')][_0xcdae('0x21')]){_0x3bb5cd['results']=_[_0xcdae('0x22')](_0x3bb5cd[_0xcdae('0x1a')],{'suspended':![],'role':_0xcdae('0x23')});if(_0x3bb5cd[_0xcdae('0x1a')]['length']){_0x5ed79c=_[_0xcdae('0x24')](_0x3bb5cd[_0xcdae('0x1a')]);}}if(_0x5ed79c){logger[_0xcdae('0x9')]('Enduser\x20found!');return _0x5ed79c;}else{logger[_0xcdae('0x9')](_0xcdae('0x25'));return request({'uri':util[_0xcdae('0x16')](_0xcdae('0x26'),_0x3f21d7[_0xcdae('0xc')]),'method':_0xcdae('0x27'),'body':{'user':{'role':_0xcdae('0x23'),'name':util['format'](_0xcdae('0x28'),_0x24990f||_0x22a3a5),'phone':_0x22a3a5}}})[_0xcdae('0x13')](function(_0x399a9a){logger[_0xcdae('0x9')](_0xcdae('0x29'));return _0x399a9a[_0xcdae('0x1e')];});}});}function getAuth(_0x46b935){var _0x5967b3;if(_0x46b935['authType']===_0xcdae('0x2a')){_0x5967b3=util[_0xcdae('0x16')](_0xcdae('0x2b'),_0x46b935[_0xcdae('0x2c')],_0x46b935[_0xcdae('0x2a')]);}else if(_0x46b935[_0xcdae('0x2d')]==='token'){_0x5967b3=util[_0xcdae('0x16')](_0xcdae('0x2e'),_0x46b935[_0xcdae('0x2c')],_0x46b935[_0xcdae('0x2f')]);}return util['format'](_0xcdae('0x30'),new Buffer(_0x5967b3)['toString'](_0xcdae('0x31')));}function request(_0x5328c4){logger[_0xcdae('0x32')](_0xcdae('0x33'),JSON[_0xcdae('0x34')](_0x5328c4));return rp(_[_0xcdae('0x7')](_0x5328c4,{'method':'GET','headers':headers,'json':!![]}));}function getTags(_0x507dd2,_0x54cbc2){var _0x52a1e3=[];if(_0x507dd2&&_0x507dd2['length']>0x0){_0x52a1e3=_[_0xcdae('0x35')](_0x507dd2,_0x54cbc2);}return _0x52a1e3;}function getCustomFields(_0x3af4ed,_0xd2a1b2){var _0x3f9aa6=[];var _0x210056={'custom_fields':[]};if(_0x3af4ed[_0xcdae('0x21')]>0x0){_[_0xcdae('0x36')](_0x3af4ed,function(_0x3d2b92){if(_[_0xcdae('0x37')]([_0xcdae('0x38'),_0xcdae('0x39')],_0x3d2b92[_0xcdae('0x3a')])&&_0x3d2b92[_0xcdae('0x3b')]&&!_0x3d2b92['customField']){_0x210056[_0x3d2b92['nameField'][_0xcdae('0x3c')]()]=_0x3d2b92[_0xcdae('0x3d')][_0xcdae('0x3e')]();}else if(_[_0xcdae('0x37')]([_0xcdae('0x38'),_0xcdae('0x39')],_0x3d2b92['type'])&&_0x3d2b92['idField']&&_0x3d2b92[_0xcdae('0x3f')]){_0x210056[_0xcdae('0x40')][_0xcdae('0x41')]({'id':_0x3d2b92['idField'],'value':_0x3d2b92[_0xcdae('0x3d')]['toString']()});}else if(_0x3d2b92[_0xcdae('0x3a')]===_0xcdae('0x42')&&_0x3d2b92[_0xcdae('0x43')]&&_0x3d2b92['idField']&&_0x3d2b92[_0xcdae('0x3f')]){_0xd2a1b2[_0x3d2b92['variableName']]&&_0x210056[_0xcdae('0x40')][_0xcdae('0x41')]({'id':_0x3d2b92[_0xcdae('0x44')],'value':_0xd2a1b2[_0x3d2b92[_0xcdae('0x43')]]['toString']()});}else if(_0x3d2b92[_0xcdae('0x3a')]===_0xcdae('0x45')&&_0x3d2b92['Variable']&&_0x3d2b92[_0xcdae('0x46')][_0xcdae('0xe')]&&_0x3d2b92['idField']&&_0x3d2b92[_0xcdae('0x3f')]){_0xd2a1b2[_0x3d2b92[_0xcdae('0x46')][_0xcdae('0xe')][_0xcdae('0x3c')]()]&&_0x210056[_0xcdae('0x40')][_0xcdae('0x41')]({'id':_0x3d2b92[_0xcdae('0x44')],'value':_0xd2a1b2[_0x3d2b92[_0xcdae('0x46')][_0xcdae('0xe')][_0xcdae('0x3c')]()][_0xcdae('0x3e')]()});}});}return _0x210056;}exports[_0xcdae('0x47')]=function(_0x1eaaa8,_0x5246c6,_0x255e9b,_0x4616f3,_0x9e92ee,_0x1ab202){var _0x52c847,_0x348050;_0x1ab202['remoteUri']=intUtil[_0xcdae('0x48')](_0x1ab202[_0xcdae('0xc')]);_0x1ab202['serverUrl']=intUtil['stripTrailingSlash'](_0x1ab202[_0xcdae('0x49')]);if(_0x9e92ee&&_0x9e92ee[_0xcdae('0x4a')]){logger[_0xcdae('0x9')](_0xcdae('0x4b'),_0xcdae('0x4c'));_0x5246c6[_0xcdae('0x4d')]=util['format'](_0xcdae('0x4e'),_0x1ab202[_0xcdae('0x49')],_0x5246c6['uniqueid'],md5(_0x5246c6[_0xcdae('0x4f')]));}else{_0x5246c6[_0xcdae('0x4d')]='';}headers[_0xcdae('0x50')]=getAuth(_0x1ab202);return getUser(_0x1ab202,_0x4616f3[_0xcdae('0x51')])[_0xcdae('0x13')](function(_0x4b47c7){_0x52c847=_0x4b47c7;logger[_0xcdae('0x9')]('The\x20User\x20ID\x20is:',_0x52c847['id']);return getEndUser(_0x1ab202,_0x5246c6[_0xcdae('0x52')],_0x5246c6[_0xcdae('0x53')]);})[_0xcdae('0x13')](function(_0x41f50b){_0x348050=_0x41f50b;logger[_0xcdae('0x9')](_0xcdae('0x54'),_0x348050['id']);return getTicket(_0x1ab202,_0x52c847,_0x348050,_0x255e9b,_0x5246c6);})[_0xcdae('0x13')](function(_0x4e031b){if(_0x4e031b){logger['info'](_0xcdae('0x55'),_0x4e031b['id']);switch(_0x1ab202['type']){case _0xcdae('0x56'):logger[_0xcdae('0x9')]('[QUEUE]','Displaying\x20ticket\x20to\x20agent...');return request({'uri':util[_0xcdae('0x16')](_0xcdae('0x57'),_0x1ab202[_0xcdae('0xc')],_0x52c847['id'],_0x4e031b['id']),'method':_0xcdae('0x27')});case'newTab':logger[_0xcdae('0x9')]('[QUEUE]',_0xcdae('0x58'));emit(util[_0xcdae('0x16')](_0xcdae('0x59'),_0x4616f3[_0xcdae('0xe')]),_0xcdae('0x5a'),{'uri':util['format'](_0xcdae('0x5b'),_0x1ab202[_0xcdae('0xc')]['replace']('/api/v2',''),_0x4e031b['id'])});break;default:logger[_0xcdae('0x5c')](_0xcdae('0x4b'),_0xcdae('0x5d'));}}})[_0xcdae('0x5e')](function(_0x39032d){logger[_0xcdae('0x5c')](_0xcdae('0x5f'),util[_0xcdae('0x60')](_0x39032d,{'showHidden':!![],'depth':null}));});};exports[_0xcdae('0x61')]=function(_0x542381,_0x57b3b5,_0x5a68fd,_0x139b8a,_0x25116f,_0x4d2409,_0x1484c5){var _0x184e73,_0x100c31;_0x4d2409['remoteUri']=intUtil[_0xcdae('0x48')](_0x4d2409['remoteUri']);_0x4d2409[_0xcdae('0x49')]=intUtil[_0xcdae('0x48')](_0x4d2409[_0xcdae('0x49')]);if(_0x1484c5&&_0x1484c5[_0xcdae('0x62')]&&_0x1484c5['recordingFormat']!=='none'){logger[_0xcdae('0x9')](_0xcdae('0x63'),_0xcdae('0x4c'));_0x57b3b5[_0xcdae('0x4d')]=util[_0xcdae('0x16')](_0xcdae('0x4e'),_0x4d2409[_0xcdae('0x49')],_0x57b3b5['uniqueid'],md5(_0x57b3b5[_0xcdae('0x4f')]));}headers[_0xcdae('0x50')]=getAuth(_0x4d2409);return getUser(_0x4d2409,_0x139b8a['email'])[_0xcdae('0x13')](function(_0x3b6ce1){_0x184e73=_0x3b6ce1;logger[_0xcdae('0x9')](_0xcdae('0x64'),_0x184e73['id']);return getEndUser(_0x4d2409,_0x57b3b5['destcalleridname'],_0x57b3b5[_0xcdae('0x65')]);})[_0xcdae('0x13')](function(_0x5ddf8f){_0x100c31=_0x5ddf8f;logger['info'](_0xcdae('0x54'),_0x100c31['id']);return getTicket(_0x4d2409,_0x184e73,_0x100c31,_0x5a68fd,_0x57b3b5);})['then'](function(_0x3213b0){if(_0x3213b0){logger['info'](_0xcdae('0x55'),_0x3213b0['id']);switch(_0x4d2409['type']){case _0xcdae('0x56'):logger[_0xcdae('0x9')]('[OUTBOUND]',_0xcdae('0x66'));return request({'uri':util[_0xcdae('0x16')]('%s/channels/voice/agents/%d/tickets/%d/display.json',_0x4d2409[_0xcdae('0xc')],_0x184e73['id'],_0x3213b0['id']),'method':'POST'});case _0xcdae('0x67'):logger['info'](_0xcdae('0x63'),_0xcdae('0x58'));emit(util[_0xcdae('0x16')](_0xcdae('0x59'),_0x139b8a[_0xcdae('0xe')]),_0xcdae('0x5a'),{'uri':util[_0xcdae('0x16')](_0xcdae('0x5b'),_0x4d2409[_0xcdae('0xc')][_0xcdae('0x68')](_0xcdae('0x69'),''),_0x3213b0['id'])});break;default:logger['error'](_0xcdae('0x63'),_0xcdae('0x5d'));}}})[_0xcdae('0x5e')](function(_0x4e80f3){logger[_0xcdae('0x5c')](_0xcdae('0x6a'),util[_0xcdae('0x60')](_0x4e80f3,{'showHidden':!![],'depth':null}));});};exports[_0xcdae('0x6b')]=function(_0x329a1f,_0x1c78ec,_0x35277e,_0x179831,_0x1ccb09,_0x2dfe53){var _0x286823,_0x23c5d6;_0x2dfe53[_0xcdae('0xc')]=intUtil[_0xcdae('0x48')](_0x2dfe53[_0xcdae('0xc')]);_0x2dfe53['serverUrl']=intUtil[_0xcdae('0x48')](_0x2dfe53[_0xcdae('0x49')]);if(_0x1ccb09&&_0x1ccb09[_0xcdae('0x4a')]){logger[_0xcdae('0x9')]('['+_0x1c78ec['lastevent'][_0xcdae('0x6c')]()+']','Recording\x20is\x20enabled!');_0x1c78ec[_0xcdae('0x4d')]=util[_0xcdae('0x16')](_0xcdae('0x4e'),_0x2dfe53[_0xcdae('0x49')],_0x1c78ec[_0xcdae('0x4f')],md5(_0x1c78ec[_0xcdae('0x4f')]));}else{_0x1c78ec[_0xcdae('0x4d')]='';}headers[_0xcdae('0x50')]=getAuth(_0x2dfe53);return getUser(_0x2dfe53)[_0xcdae('0x13')](function(_0x2b1105){_0x286823=_0x2b1105;logger[_0xcdae('0x9')](_0xcdae('0x64'),_0x286823['id']);return getEndUser(_0x2dfe53,_0x1c78ec[_0xcdae('0x52')],_0x1c78ec['calleridnum']);})['then'](function(_0x6d50bf){_0x23c5d6=_0x6d50bf;logger['info'](_0xcdae('0x54'),_0x23c5d6['id']);return getTicket(_0x2dfe53,_0x286823,_0x23c5d6,_0x35277e,_0x1c78ec);})[_0xcdae('0x13')](function(_0xa9b7d8){if(_0xa9b7d8){logger[_0xcdae('0x9')](_0xcdae('0x55'),_0xa9b7d8['id']);}})[_0xcdae('0x5e')](function(_0x2ffafd){logger[_0xcdae('0x5c')]('['+_0x1c78ec[_0xcdae('0x6d')][_0xcdae('0x6c')]()+']'+_0xcdae('0x6e'),util['inspect'](_0x2ffafd,{'showHidden':!![],'depth':null}));});}; \ No newline at end of file +var _0xe1c5=['Enduser\x20not\x20found,\x20creating\x20a\x20new\x20enduser!','end-user','Caller\x20-\x20%s','Enduser\x20created.','password','%s:%s','username','authType','token','%s/token:%s','Basic\x20%s','base64','debug','[HTTP]','stringify','map','forEach','includes','string','type','nameField','customField','toLowerCase','content','toString','picklist','idField','custom_fields','push','variable','variableName','customVariable','Variable','queue','serverUrl','stripTrailingSlash','monitor_format','[QUEUE]','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:','Displaying\x20ticket\x20to\x20agent...','%s/channels/voice/agents/%d/tickets/%d/display.json','POST','newTab','Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...','user:%s','trigger:browser:url','%s/agent/tickets/%s','/api/v2','error','Zendesk\x20account\x20type\x20not\x20recognized','catch','[QUEUE]\x20Error\x20running\x20Zendesk\x20integration','outbound','recordingFormat','none','[OUTBOUND]','destcalleridnum','integrationTab','[OUTBOUND]\x20Error\x20running\x20Zendesk\x20integration','inspect','unmanaged','toUpperCase','lastevent','lodash','request-promise','util','ioredis','../../../../config/environment','../../../../config/logger','zendesk','redis','defaults','socket.io-emitter','emit','application/json','info','Creating\x20new\x20ticket...','%s/tickets.json','remoteUri','merge','Tags','name','Subjects','getString','Descriptions','Fields','then','Ticket\x20created!','ticket','validateEmail','Getting\x20agent\x20with\x20email','format','%s/search.json','type:user\x20role:agent\x20email:%s','count','Agent\x20found!','agent','Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!','%s/users/me.json','user','Searching\x20enduser\x20with\x20phone','type:user\x20role:end-user\x20phone:%s','results','length','first','Enduser\x20found!'];(function(_0x30b699,_0x414ca2){var _0x581a58=function(_0x377c17){while(--_0x377c17){_0x30b699['push'](_0x30b699['shift']());}};_0x581a58(++_0x414ca2);}(_0xe1c5,0xbd));var _0x5e1c=function(_0x16a565,_0xe6b30b){_0x16a565=_0x16a565-0x0;var _0x3778f1=_0xe1c5[_0x16a565];return _0x3778f1;};'use strict';var _=require(_0x5e1c('0x0'));var rp=require(_0x5e1c('0x1'));var md5=require('md5');var util=require(_0x5e1c('0x2'));var Redis=require(_0x5e1c('0x3'));var intUtil=require('./util');var config=require(_0x5e1c('0x4'));var logger=require(_0x5e1c('0x5'))(_0x5e1c('0x6'));config[_0x5e1c('0x7')]=_[_0x5e1c('0x8')](config[_0x5e1c('0x7')],{'host':'localhost','port':0x18eb});var io=require(_0x5e1c('0x9'))(new Redis(config[_0x5e1c('0x7')]));function emit(_0x75fd72,_0x1bb1a1,_0x58df7c){io['to'](_0x75fd72)[_0x5e1c('0xa')](_0x1bb1a1,_0x58df7c);}var headers={'Content-Type':_0x5e1c('0xb'),'Accept':_0x5e1c('0xb')};function getTicket(_0x54391b,_0x506bfb,_0x3bc03b,_0x1d23a6,_0x220a69){logger[_0x5e1c('0xc')](_0x5e1c('0xd'));return request({'uri':util['format'](_0x5e1c('0xe'),_0x54391b[_0x5e1c('0xf')]),'method':'POST','body':{'ticket':_[_0x5e1c('0x10')]({'requester_id':_0x3bc03b['id'],'submitter_id':_0x506bfb?_0x506bfb['id']:undefined,'assignee_id':_0x506bfb?_0x506bfb['id']:undefined,'tags':getTags(_0x1d23a6[_0x5e1c('0x11')],_0x5e1c('0x12')),'subject':intUtil['getString'](_0x1d23a6[_0x5e1c('0x13')],_0x220a69,'\x20'),'description':intUtil[_0x5e1c('0x14')](_0x1d23a6[_0x5e1c('0x15')],_0x220a69,'\x0a'),'comment':{'public':![],'body':intUtil[_0x5e1c('0x14')](_0x1d23a6[_0x5e1c('0x15')],_0x220a69,'\x0a')}},getCustomFields(_0x1d23a6[_0x5e1c('0x16')],_0x220a69))}})[_0x5e1c('0x17')](function(_0xa77319){logger['info'](_0x5e1c('0x18'));return _0xa77319[_0x5e1c('0x19')];});}function getUser(_0x48f34b,_0x269d0b){if(intUtil[_0x5e1c('0x1a')](_0x269d0b)){logger[_0x5e1c('0xc')](_0x5e1c('0x1b'),_0x269d0b);return request({'uri':util[_0x5e1c('0x1c')](_0x5e1c('0x1d'),_0x48f34b[_0x5e1c('0xf')]),'qs':{'query':util[_0x5e1c('0x1c')](_0x5e1c('0x1e'),_0x269d0b)}})[_0x5e1c('0x17')](function(_0x3a2c0a){if(_0x3a2c0a[_0x5e1c('0x1f')]){logger[_0x5e1c('0xc')](_0x5e1c('0x20'));return _['find'](_0x3a2c0a['results'],{'email':_0x269d0b,'role':_0x5e1c('0x21')});}else{logger[_0x5e1c('0xc')](_0x5e1c('0x22'));return request({'uri':util[_0x5e1c('0x1c')]('%s/users/me.json',_0x48f34b[_0x5e1c('0xf')])})[_0x5e1c('0x17')](function(_0x5a4e7f){logger[_0x5e1c('0xc')]('Admin\x20account\x20selected.');return _0x5a4e7f['user'];});}});}else{logger[_0x5e1c('0xc')](_0x5e1c('0x22'));return request({'uri':util[_0x5e1c('0x1c')](_0x5e1c('0x23'),_0x48f34b['remoteUri'])})[_0x5e1c('0x17')](function(_0x56ca41){logger[_0x5e1c('0xc')]('Admin\x20account\x20selected.');return _0x56ca41[_0x5e1c('0x24')];});}}function getEndUser(_0x18e74b,_0x469506,_0x3a4fca){logger[_0x5e1c('0xc')](_0x5e1c('0x25'),_0x3a4fca);return request({'uri':util[_0x5e1c('0x1c')](_0x5e1c('0x1d'),_0x18e74b[_0x5e1c('0xf')]),'qs':{'query':util[_0x5e1c('0x1c')](_0x5e1c('0x26'),_0x3a4fca)}})[_0x5e1c('0x17')](function(_0x539fc4){var _0x5a0e38;if(_0x539fc4[_0x5e1c('0x27')][_0x5e1c('0x28')]){_0x539fc4[_0x5e1c('0x27')]=_['filter'](_0x539fc4[_0x5e1c('0x27')],{'suspended':![],'role':'end-user'});if(_0x539fc4[_0x5e1c('0x27')]['length']){_0x5a0e38=_[_0x5e1c('0x29')](_0x539fc4[_0x5e1c('0x27')]);}}if(_0x5a0e38){logger[_0x5e1c('0xc')](_0x5e1c('0x2a'));return _0x5a0e38;}else{logger[_0x5e1c('0xc')](_0x5e1c('0x2b'));return request({'uri':util[_0x5e1c('0x1c')]('%s/users.json',_0x18e74b[_0x5e1c('0xf')]),'method':'POST','body':{'user':{'role':_0x5e1c('0x2c'),'name':util[_0x5e1c('0x1c')](_0x5e1c('0x2d'),_0x469506||_0x3a4fca),'phone':_0x3a4fca}}})[_0x5e1c('0x17')](function(_0xe66b0b){logger['info'](_0x5e1c('0x2e'));return _0xe66b0b[_0x5e1c('0x24')];});}});}function getAuth(_0x2ce903){var _0x348583;if(_0x2ce903['authType']===_0x5e1c('0x2f')){_0x348583=util[_0x5e1c('0x1c')](_0x5e1c('0x30'),_0x2ce903[_0x5e1c('0x31')],_0x2ce903[_0x5e1c('0x2f')]);}else if(_0x2ce903[_0x5e1c('0x32')]===_0x5e1c('0x33')){_0x348583=util['format'](_0x5e1c('0x34'),_0x2ce903['username'],_0x2ce903[_0x5e1c('0x33')]);}return util[_0x5e1c('0x1c')](_0x5e1c('0x35'),new Buffer(_0x348583)['toString'](_0x5e1c('0x36')));}function request(_0x3214b8){logger[_0x5e1c('0x37')](_0x5e1c('0x38'),JSON[_0x5e1c('0x39')](_0x3214b8));return rp(_[_0x5e1c('0x8')](_0x3214b8,{'method':'GET','headers':headers,'json':!![]}));}function getTags(_0x14d3b6,_0x44f174){var _0x5b1660=[];if(_0x14d3b6&&_0x14d3b6[_0x5e1c('0x28')]>0x0){_0x5b1660=_[_0x5e1c('0x3a')](_0x14d3b6,_0x44f174);}return _0x5b1660;}function getCustomFields(_0x1b8deb,_0x4d294b){var _0x3a13c2=[];var _0x49bb40={'custom_fields':[]};if(_0x1b8deb['length']>0x0){_[_0x5e1c('0x3b')](_0x1b8deb,function(_0x15b016){if(_[_0x5e1c('0x3c')]([_0x5e1c('0x3d'),'picklist'],_0x15b016[_0x5e1c('0x3e')])&&_0x15b016[_0x5e1c('0x3f')]&&!_0x15b016[_0x5e1c('0x40')]){_0x49bb40[_0x15b016[_0x5e1c('0x3f')][_0x5e1c('0x41')]()]=_0x15b016[_0x5e1c('0x42')][_0x5e1c('0x43')]();}else if(_[_0x5e1c('0x3c')](['string',_0x5e1c('0x44')],_0x15b016[_0x5e1c('0x3e')])&&_0x15b016[_0x5e1c('0x45')]&&_0x15b016[_0x5e1c('0x40')]){_0x49bb40[_0x5e1c('0x46')][_0x5e1c('0x47')]({'id':_0x15b016['idField'],'value':_0x15b016[_0x5e1c('0x42')][_0x5e1c('0x43')]()});}else if(_0x15b016[_0x5e1c('0x3e')]===_0x5e1c('0x48')&&_0x15b016[_0x5e1c('0x49')]&&_0x15b016[_0x5e1c('0x45')]&&_0x15b016[_0x5e1c('0x40')]){_0x4d294b[_0x15b016[_0x5e1c('0x49')]]&&_0x49bb40[_0x5e1c('0x46')][_0x5e1c('0x47')]({'id':_0x15b016[_0x5e1c('0x45')],'value':_0x4d294b[_0x15b016[_0x5e1c('0x49')]][_0x5e1c('0x43')]()});}else if(_0x15b016['type']===_0x5e1c('0x4a')&&_0x15b016['Variable']&&_0x15b016[_0x5e1c('0x4b')][_0x5e1c('0x12')]&&_0x15b016['idField']&&_0x15b016[_0x5e1c('0x40')]){_0x4d294b[_0x15b016[_0x5e1c('0x4b')][_0x5e1c('0x12')][_0x5e1c('0x41')]()]&&_0x49bb40[_0x5e1c('0x46')][_0x5e1c('0x47')]({'id':_0x15b016['idField'],'value':_0x4d294b[_0x15b016[_0x5e1c('0x4b')][_0x5e1c('0x12')][_0x5e1c('0x41')]()][_0x5e1c('0x43')]()});}});}return _0x49bb40;}exports[_0x5e1c('0x4c')]=function(_0x8ff5fa,_0x40500b,_0x3d9517,_0x256ec8,_0x43314e,_0x34ba60){var _0x50f108,_0x1e8faa;_0x34ba60[_0x5e1c('0xf')]=intUtil['stripTrailingSlash'](_0x34ba60[_0x5e1c('0xf')]);_0x34ba60[_0x5e1c('0x4d')]=intUtil[_0x5e1c('0x4e')](_0x34ba60['serverUrl']);if(_0x43314e&&_0x43314e[_0x5e1c('0x4f')]){logger[_0x5e1c('0xc')](_0x5e1c('0x50'),_0x5e1c('0x51'));_0x40500b[_0x5e1c('0x52')]=util['format'](_0x5e1c('0x53'),_0x34ba60['serverUrl'],_0x40500b['uniqueid'],md5(_0x40500b[_0x5e1c('0x54')]));}else{_0x40500b[_0x5e1c('0x52')]='';}headers[_0x5e1c('0x55')]=getAuth(_0x34ba60);return getUser(_0x34ba60,_0x256ec8[_0x5e1c('0x56')])[_0x5e1c('0x17')](function(_0x2aa3ff){_0x50f108=_0x2aa3ff;logger[_0x5e1c('0xc')](_0x5e1c('0x57'),_0x50f108['id']);return getEndUser(_0x34ba60,_0x40500b[_0x5e1c('0x58')],_0x40500b[_0x5e1c('0x59')]);})[_0x5e1c('0x17')](function(_0x41666f){_0x1e8faa=_0x41666f;logger[_0x5e1c('0xc')](_0x5e1c('0x5a'),_0x1e8faa['id']);return getTicket(_0x34ba60,_0x50f108,_0x1e8faa,_0x3d9517,_0x40500b);})[_0x5e1c('0x17')](function(_0x2d41ce){if(_0x2d41ce){logger['info'](_0x5e1c('0x5b'),_0x2d41ce['id']);switch(_0x34ba60[_0x5e1c('0x3e')]){case'integrationTab':logger[_0x5e1c('0xc')](_0x5e1c('0x50'),_0x5e1c('0x5c'));return request({'uri':util[_0x5e1c('0x1c')](_0x5e1c('0x5d'),_0x34ba60[_0x5e1c('0xf')],_0x50f108['id'],_0x2d41ce['id']),'method':_0x5e1c('0x5e')});case _0x5e1c('0x5f'):logger[_0x5e1c('0xc')](_0x5e1c('0x50'),_0x5e1c('0x60'));emit(util['format'](_0x5e1c('0x61'),_0x256ec8['name']),_0x5e1c('0x62'),{'uri':util[_0x5e1c('0x1c')](_0x5e1c('0x63'),_0x34ba60[_0x5e1c('0xf')]['replace'](_0x5e1c('0x64'),''),_0x2d41ce['id'])});break;default:logger[_0x5e1c('0x65')](_0x5e1c('0x50'),_0x5e1c('0x66'));}}})[_0x5e1c('0x67')](function(_0xcbfb40){logger['error'](_0x5e1c('0x68'),util['inspect'](_0xcbfb40,{'showHidden':!![],'depth':null}));});};exports[_0x5e1c('0x69')]=function(_0x3fa88b,_0x25a864,_0x1f0cfc,_0x1bc527,_0xbe945b,_0x33dc19,_0x4fef89){var _0x320f79,_0x5a8281;_0x33dc19[_0x5e1c('0xf')]=intUtil[_0x5e1c('0x4e')](_0x33dc19[_0x5e1c('0xf')]);_0x33dc19[_0x5e1c('0x4d')]=intUtil['stripTrailingSlash'](_0x33dc19[_0x5e1c('0x4d')]);if(_0x4fef89&&_0x4fef89[_0x5e1c('0x6a')]&&_0x4fef89[_0x5e1c('0x6a')]!==_0x5e1c('0x6b')){logger[_0x5e1c('0xc')](_0x5e1c('0x6c'),_0x5e1c('0x51'));_0x25a864['recordingURL']=util['format'](_0x5e1c('0x53'),_0x33dc19['serverUrl'],_0x25a864[_0x5e1c('0x54')],md5(_0x25a864['uniqueid']));}headers['Authorization']=getAuth(_0x33dc19);return getUser(_0x33dc19,_0x1bc527[_0x5e1c('0x56')])[_0x5e1c('0x17')](function(_0x1f2e7d){_0x320f79=_0x1f2e7d;logger[_0x5e1c('0xc')](_0x5e1c('0x57'),_0x320f79['id']);return getEndUser(_0x33dc19,_0x25a864['destcalleridname'],_0x25a864[_0x5e1c('0x6d')]);})[_0x5e1c('0x17')](function(_0x288026){_0x5a8281=_0x288026;logger['info'](_0x5e1c('0x5a'),_0x5a8281['id']);return getTicket(_0x33dc19,_0x320f79,_0x5a8281,_0x1f0cfc,_0x25a864);})[_0x5e1c('0x17')](function(_0x52a239){if(_0x52a239){logger[_0x5e1c('0xc')](_0x5e1c('0x5b'),_0x52a239['id']);switch(_0x33dc19[_0x5e1c('0x3e')]){case _0x5e1c('0x6e'):logger[_0x5e1c('0xc')](_0x5e1c('0x6c'),_0x5e1c('0x5c'));return request({'uri':util[_0x5e1c('0x1c')]('%s/channels/voice/agents/%d/tickets/%d/display.json',_0x33dc19[_0x5e1c('0xf')],_0x320f79['id'],_0x52a239['id']),'method':_0x5e1c('0x5e')});case'newTab':logger['info']('[OUTBOUND]',_0x5e1c('0x60'));emit(util[_0x5e1c('0x1c')](_0x5e1c('0x61'),_0x1bc527[_0x5e1c('0x12')]),_0x5e1c('0x62'),{'uri':util[_0x5e1c('0x1c')](_0x5e1c('0x63'),_0x33dc19['remoteUri']['replace'](_0x5e1c('0x64'),''),_0x52a239['id'])});break;default:logger[_0x5e1c('0x65')](_0x5e1c('0x6c'),_0x5e1c('0x66'));}}})[_0x5e1c('0x67')](function(_0x1a74b2){logger[_0x5e1c('0x65')](_0x5e1c('0x6f'),util[_0x5e1c('0x70')](_0x1a74b2,{'showHidden':!![],'depth':null}));});};exports[_0x5e1c('0x71')]=function(_0x48e924,_0x22f889,_0x24c2dc,_0x57eb4f,_0x55452b,_0x3e7301){var _0x6a1307,_0x46c303;_0x3e7301[_0x5e1c('0xf')]=intUtil[_0x5e1c('0x4e')](_0x3e7301['remoteUri']);_0x3e7301[_0x5e1c('0x4d')]=intUtil['stripTrailingSlash'](_0x3e7301[_0x5e1c('0x4d')]);if(_0x55452b&&_0x55452b['monitor_format']){logger[_0x5e1c('0xc')]('['+_0x22f889['lastevent'][_0x5e1c('0x72')]()+']',_0x5e1c('0x51'));_0x22f889['recordingURL']=util[_0x5e1c('0x1c')](_0x5e1c('0x53'),_0x3e7301[_0x5e1c('0x4d')],_0x22f889[_0x5e1c('0x54')],md5(_0x22f889[_0x5e1c('0x54')]));}else{_0x22f889[_0x5e1c('0x52')]='';}headers[_0x5e1c('0x55')]=getAuth(_0x3e7301);return getUser(_0x3e7301)[_0x5e1c('0x17')](function(_0x2419dc){_0x6a1307=_0x2419dc;logger[_0x5e1c('0xc')](_0x5e1c('0x57'),_0x6a1307['id']);return getEndUser(_0x3e7301,_0x22f889[_0x5e1c('0x58')],_0x22f889['calleridnum']);})[_0x5e1c('0x17')](function(_0x13dd97){_0x46c303=_0x13dd97;logger[_0x5e1c('0xc')](_0x5e1c('0x5a'),_0x46c303['id']);return getTicket(_0x3e7301,_0x6a1307,_0x46c303,_0x24c2dc,_0x22f889);})['then'](function(_0x59fe0a){if(_0x59fe0a){logger[_0x5e1c('0xc')](_0x5e1c('0x5b'),_0x59fe0a['id']);}})[_0x5e1c('0x67')](function(_0x4d26e8){logger[_0x5e1c('0x65')]('['+_0x22f889[_0x5e1c('0x73')][_0x5e1c('0x72')]()+']'+'\x20Error\x20running\x20Zendesk\x20integration',util[_0x5e1c('0x70')](_0x4d26e8,{'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 3476269..107b07e 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 _0x781f=['Call\x20created!','err','stripTrailingSlash','host','serverUrl','monitor_format','Recording\x20is\x20enabled!','recordingURL','/api/voice/recordings/','uniqueid','/downloads?type=uniqueid&token=','zoho.eu','com','The\x20User\x20ID\x20is:','calleridname','[QUEUE]','Displaying\x20call\x20to\x20agent\x20in\x20a\x20new\x20tab...','user:%s','trigger:browser:url','https://crm.','/crm/EntityInfo.do?module=Calls&id=','recordingFormat','destcalleridname','Outbound','The\x20Call\x20ID\x20is:','[OUTBOUND]','unmanaged','toUpperCase','calleridnum','lodash','request-promise','util','moment','ioredis','bluebird','../../../../config/environment','../../../../config/logger','zoho','redis','defaults','localhost','socket.io-emitter','debug','[HTTP]','stringify','length','forEach','includes','string','picklist','idField','variable','variableName','toString','type','customVariable','Variable','name','toLowerCase','split','isNil','expires_in','access_token','https://accounts.zoho.eu','https://accounts.zoho.com.cn','POST','/oauth/v2/token','clientId','refresh_token','then','add','seconds','error','Failing\x20creating\x20the\x20access_token','stack','info','GET','format','ActiveUsers','Zoho-oauthtoken\x20','users','isArrayLikeObject','findIndex','email','Agent\x20found!','Using\x20the\x20admin\x20account!','Administrator','profile','user','The\x20failing\x20result\x20is','Unable\x20to\x20retrieve\x20zoho\x20account\x20users:\x20','data','enduserType','catch','https://www.zohoapis.','startCase','moduleCreate','role','first_name','code','details','Error:\x20','log','contact_lead','Contacts','uri','/crm/v2/Leads/search?criteria=((Phone:equals:','Leads','nothing','contact','Creating\x20new\x20call...','Owner','administrator','last_name','Subject','getString','Description','Descriptions','Who_Id','Full_Name','First_Name','Last_Name','talktime','utc','mm:ss','answertime','endtime','Call_Duration','YYYY-MM-DDTHH:mm:ss','starttime','lastevent','called','Called','complete','connect','Call_Result','Rejected','Abandoned','timeout','Timeout','outbound','agentcalledAt','Inbound','merge','/crm/v2/Calls'];(function(_0x48bceb,_0x3658d8){var _0x274484=function(_0x37b589){while(--_0x37b589){_0x48bceb['push'](_0x48bceb['shift']());}};_0x274484(++_0x3658d8);}(_0x781f,0x13f));var _0xf781=function(_0x56e0e8,_0x16ef91){_0x56e0e8=_0x56e0e8-0x0;var _0x2dab50=_0x781f[_0x56e0e8];return _0x2dab50;};'use strict';var _=require(_0xf781('0x0'));var rp=require(_0xf781('0x1'));var md5=require('md5');var util=require(_0xf781('0x2'));var intUtil=require('./util');var moment=require(_0xf781('0x3'));var Redis=require(_0xf781('0x4'));var BPromise=require(_0xf781('0x5'));var config=require(_0xf781('0x6'));var logger=require(_0xf781('0x7'))(_0xf781('0x8'));config[_0xf781('0x9')]=_[_0xf781('0xa')](config[_0xf781('0x9')],{'host':_0xf781('0xb'),'port':0x18eb});var io=require(_0xf781('0xc'))(new Redis(config[_0xf781('0x9')]));function emit(_0x51678a,_0x3df5b0,_0x380ddb){io['to'](_0x51678a)['emit'](_0x3df5b0,_0x380ddb);}function request(_0x404523){logger[_0xf781('0xd')](_0xf781('0xe'),JSON[_0xf781('0xf')](_0x404523));return rp(_0x404523);}function getCustomFields(_0x1fbf91,_0x34a34d){var _0x466b94={};if(_0x1fbf91[_0xf781('0x10')]>0x0){_[_0xf781('0x11')](_0x1fbf91,function(_0x24aea8){if(_[_0xf781('0x12')]([_0xf781('0x13'),_0xf781('0x14')],_0x24aea8['type'])&&_0x24aea8['idField']){_0x466b94[_0x24aea8[_0xf781('0x15')]]=_0x24aea8['content']['toString']();}else if(_0x24aea8['type']===_0xf781('0x16')&&_0x24aea8[_0xf781('0x17')]&&_0x24aea8['idField']&&_0x34a34d[_0x24aea8[_0xf781('0x17')]]){_0x466b94[_0x24aea8['idField']]=_0x34a34d[_0x24aea8[_0xf781('0x17')]][_0xf781('0x18')]();}else if(_0x24aea8[_0xf781('0x19')]===_0xf781('0x1a')&&_0x24aea8['Variable']&&_0x24aea8[_0xf781('0x1b')]['name']&&_0x24aea8[_0xf781('0x15')]&&_0x34a34d[_0x24aea8[_0xf781('0x1b')][_0xf781('0x1c')]['toLowerCase']()]){_0x466b94[_0x24aea8[_0xf781('0x15')]]=_0x34a34d[_0x24aea8['Variable'][_0xf781('0x1c')][_0xf781('0x1d')]()]['toString']();}});}return _0x466b94;}function getName(_0x2b3ff2){if(_0x2b3ff2['indexOf']('\x20')>0x0){var _0x4f7b18=_0x2b3ff2[_0xf781('0x1e')](/ (.+)/);if(_0x4f7b18[0x1]){return _0x4f7b18;}}return[_0x2b3ff2,_0x2b3ff2];}var accountsTokens={};function getAccessToken(_0x574c3c){return new Promise(function(_0x5b7439,_0x105d46){if(!_[_0xf781('0x1f')](accountsTokens[_0x574c3c['id']])&&!_[_0xf781('0x1f')](accountsTokens[_0x574c3c['id']]['access_token'])){if(moment()['isBefore'](accountsTokens[_0x574c3c['id']][_0xf781('0x20')])){_0x5b7439(accountsTokens[_0x574c3c['id']][_0xf781('0x21')]);}}var _0x2de693;switch(_0x574c3c['zone']){case'US':_0x2de693='https://accounts.zoho.com';break;case'AU':_0x2de693='https://accounts.zoho.com.au';break;case'EU':_0x2de693=_0xf781('0x22');break;case'IN':_0x2de693='https://accounts.zoho.in';break;case'CN':_0x2de693=_0xf781('0x23');break;default:_0x2de693=_0xf781('0x22');break;}var _0x35c2e8={'method':_0xf781('0x24'),'uri':_0x2de693+_0xf781('0x25'),'qs':{'refresh_token':_0x574c3c['refreshToken'],'client_id':_0x574c3c[_0xf781('0x26')],'client_secret':_0x574c3c['clientSecret'],'grant_type':_0xf781('0x27')},'json':!![]};return rp(_0x35c2e8)[_0xf781('0x28')](function(_0xe1a2a9){accountsTokens[_0x574c3c['id']]={'access_token':_0xe1a2a9[_0xf781('0x21')],'expires_in':moment()[_0xf781('0x29')](_0xe1a2a9[_0xf781('0x20')],_0xf781('0x2a'))};_0x5b7439(_0xe1a2a9[_0xf781('0x21')]);})['catch'](function(_0x57d6d6){logger[_0xf781('0x2b')](_0xf781('0x2c'),_0x57d6d6[_0xf781('0x2d')]);_0x105d46(_0x57d6d6);});});}function getUser(_0x216eff,_0x1ba624,_0x26e6d6,_0x421546){logger[_0xf781('0x2e')]('Search\x20user');return request({'method':_0xf781('0x2f'),'uri':util[_0xf781('0x30')]('https://www.zohoapis.%s/crm/v2/users',_0x1ba624),'qs':{'type':_0xf781('0x31')},'headers':{'Authorization':_0xf781('0x32')+_0x216eff},'json':!![]})['then'](function(_0x198231){if(_0x198231[_0xf781('0x33')]){var _0x5578dc=-0x1;if(_[_0xf781('0x34')](_0x198231[_0xf781('0x33')])){if(!_['isNil'](_0x421546)){_0x5578dc=_[_0xf781('0x35')](_0x198231['users'],function(_0x33cbd6){return _0x33cbd6[_0xf781('0x36')]===_0x421546;});}if(_0x5578dc>=0x0){logger[_0xf781('0x2e')](_0xf781('0x37'));}else{logger['info'](_0xf781('0x38'));_0x5578dc=_[_0xf781('0x35')](_0x198231[_0xf781('0x33')],function(_0x3cbcfb){return _0x3cbcfb['profile']['name']===_0xf781('0x39');});}return _0x198231[_0xf781('0x33')][_0x5578dc];}else{if(_0x198231['user'][_0xf781('0x3a')][_0xf781('0x1c')]==='Administrator'){logger['info'](_0xf781('0x38'));user=_0x198231[_0xf781('0x3b')];return user;}else{logger['error'](_0xf781('0x3c'),JSON[_0xf781('0xf')](_0x198231));throw new Error(_0xf781('0x3d')+JSON[_0xf781('0xf')](_0x198231));}}}else{logger[_0xf781('0x2b')]('The\x20failing\x20result\x20is',JSON['stringify'](_0x198231));throw new Error(_0xf781('0x3d')+JSON[_0xf781('0xf')](_0x198231));}})['catch'](function(_0x213725){console['error'](_0x213725);});}function getZohoUser(_0x29f262,_0x212305){return new BPromise(function(_0x2515ca,_0x565ecc){request(_0x29f262)['then'](function(_0x1cc639){var _0x3ac404=null;if(_0x1cc639){_0x3ac404=_0x1cc639[_0xf781('0x3e')][0x0];_0x3ac404[_0xf781('0x3f')]=_0x212305;}_0x2515ca(_0x3ac404);})[_0xf781('0x40')](function(_0x3fbce1){_0x565ecc(_0x3fbce1);});});}function createEndUser(_0x192a69,_0x4a7441,_0x335d72,_0x5413d5,_0x539a1a,_0x5003ff){var _0x335d72=getName(_0x335d72);return request({'method':_0xf781('0x24'),'uri':_0xf781('0x41')+_0x4a7441+'/crm/v2/'+_[_0xf781('0x42')](_0x5003ff[_0xf781('0x43')])+'s','body':{'data':[{'Last_Name':_0x335d72[0x1],'First_Name':_0x335d72[0x0],'Phone':_0x5413d5,'Owner':{'name':!_['isNil'](_0x539a1a[_0xf781('0x44')][_0xf781('0x1c')])?_0x539a1a['role'][_0xf781('0x1c')]:!_['isNil'](_0x539a1a[_0xf781('0x45')])?_0x539a1a[_0xf781('0x45')]+'\x20'+_0x539a1a['last_name']:_0x539a1a['last_name'],'id':_0x539a1a['id']}}]},'headers':{'Authorization':_0xf781('0x32')+_0x192a69},'json':!![]})[_0xf781('0x28')](function(_0x212ac3){if(_0x212ac3&&_0x212ac3['data'][0x0][_0xf781('0x46')]==='SUCCESS'){var _0x5dbbc9=_0x212ac3[_0xf781('0x3e')][0x0][_0xf781('0x47')];_0x5dbbc9[_0xf781('0x3f')]=_[_0xf781('0x42')](_0x5003ff[_0xf781('0x43')])+'s';return _0x5dbbc9;}logger[_0xf781('0x2b')](_0xf781('0x3c'),JSON[_0xf781('0xf')](data));throw new Error(_0xf781('0x48')+JSON[_0xf781('0xf')](data));})[_0xf781('0x40')](function(_0x4d4a83){console[_0xf781('0x49')]('CREATE\x20ERROR',_0x4d4a83);});}function getEndUser(_0x4cf976,_0x2713e8,_0x111325,_0x4dc59f,_0x2df118,_0x4d8649,_0x5c188d){var _0x96d75c={'method':'GET','uri':'','headers':{'Authorization':_0xf781('0x32')+_0x4cf976},'json':!![]};switch(_0x5c188d['moduleSearch']){case _0xf781('0x4a'):_0x96d75c['uri']=_0xf781('0x41')+_0x2713e8+'/crm/v2/Contacts/search?criteria=((Phone:equals:'+_0x2df118+'))';return getZohoUser(_0x96d75c,_0xf781('0x4b'))[_0xf781('0x28')](function(_0x25c324){if(_0x25c324)return _0x25c324;_0x96d75c[_0xf781('0x4c')]=_0xf781('0x41')+_0x2713e8+_0xf781('0x4d')+_0x2df118+'))';return getZohoUser(_0x96d75c,_0xf781('0x4e'))[_0xf781('0x28')](function(_0x21b512){if(_0x21b512)return _0x21b512;if(_0x5c188d[_0xf781('0x43')]!=_0xf781('0x4f')){return createEndUser(_0x4cf976,_0x2713e8,_0x4dc59f,_0x2df118,_0x4d8649,_0x5c188d);}else{return{};}});});break;case _0xf781('0x50'):_0x96d75c[_0xf781('0x4c')]=_0xf781('0x41')+_0x2713e8+'/crm/v2/Contacts/search?criteria=((Phone:equals:'+_0x2df118+'))';return getZohoUser(_0x96d75c,_0xf781('0x4b'))['then'](function(_0x2d678a){if(_0x2d678a)return _0x2d678a;if(_0x5c188d[_0xf781('0x43')]!='nothing'){return createEndUser(_0x4cf976,_0x2713e8,_0x4dc59f,_0x2df118,_0x4d8649,_0x5c188d);}else{return{};}});break;case'lead':_0x96d75c[_0xf781('0x4c')]=_0xf781('0x41')+_0x2713e8+'/crm/v2/Leads/search?criteria=((Phone:equals:'+_0x2df118+'))';return getZohoUser(_0x96d75c,_0xf781('0x4e'))['then'](function(_0xa62002){if(_0xa62002)return _0xa62002;if(_0x5c188d[_0xf781('0x43')]!=_0xf781('0x4f')){return createEndUser(_0x4cf976,_0x2713e8,_0x4dc59f,_0x2df118,_0x4d8649,_0x5c188d);}else{return{};}});break;}}function getCall(_0x439495,_0x23e6ca,_0x45b195,_0x2bc046,_0x4041a1,_0xa149a6,_0xae4775,_0x460799){logger['info'](_0xf781('0x51'));var _0x5b78ac={};_0x5b78ac[_0xf781('0x52')]={'name':!_['isNil'](_0x2bc046[_0xf781('0x44')]['name'])&&!_['isNil'](_0x2bc046[_0xf781('0x3a')][_0xf781('0x1c')])&&_0x2bc046[_0xf781('0x3a')][_0xf781('0x1c')]===_0xf781('0x53')?_0x2bc046[_0xf781('0x44')][_0xf781('0x1c')]:!_['isNil'](_0x2bc046[_0xf781('0x45')])?_0x2bc046[_0xf781('0x45')]+'\x20'+_0x2bc046[_0xf781('0x54')]:_0x2bc046[_0xf781('0x54')],'id':_0x2bc046['id']};_0x5b78ac[_0xf781('0x55')]=intUtil[_0xf781('0x56')](_0xa149a6['Subjects'],_0xae4775,'\x20');_0x5b78ac[_0xf781('0x57')]=intUtil[_0xf781('0x56')](_0xa149a6[_0xf781('0x58')],_0xae4775,'\x0a');if(_0x4041a1['enduserType']===_0xf781('0x4b')){_0x5b78ac[_0xf781('0x59')]={'name':!_['isNil'](_0x4041a1[_0xf781('0x5a')])?_0x4041a1[_0xf781('0x5a')]:!_[_0xf781('0x1f')](_0x4041a1[_0xf781('0x5b')])?_0x4041a1[_0xf781('0x5b')]+'\x20'+_0x4041a1[_0xf781('0x5c')]:_0x4041a1['Last_Name'],'id':_0x4041a1['id']};}if(_0x4041a1[_0xf781('0x3f')]===_0xf781('0x4e')){_0x5b78ac['What_Id']={'name':!_[_0xf781('0x1f')](_0x4041a1[_0xf781('0x5a')])?_0x4041a1[_0xf781('0x5a')]:!_[_0xf781('0x1f')](_0x4041a1['First_Name'])?_0x4041a1[_0xf781('0x5b')]+'\x20'+_0x4041a1[_0xf781('0x5c')]:_0x4041a1[_0xf781('0x5c')],'id':_0x4041a1['id']};_0x5b78ac['$se_module']=_[_0xf781('0x42')](_0x4041a1[_0xf781('0x3f')]);}if(_0xae4775[_0xf781('0x5d')]){_0x5b78ac['Call_Duration']=moment[_0xf781('0x5e')](parseInt(_0xae4775[_0xf781('0x5d')])*0x3e8)['format'](_0xf781('0x5f'));}else if(_0xae4775[_0xf781('0x60')]&&_0xae4775[_0xf781('0x61')]){_0x5b78ac[_0xf781('0x62')]=moment[_0xf781('0x5e')](moment(_0xae4775[_0xf781('0x61')],_0xf781('0x63'))['diff'](moment(_0xae4775[_0xf781('0x64')],_0xf781('0x63'))))[_0xf781('0x30')](_0xf781('0x5f'));}switch(_0xae4775[_0xf781('0x65')]){case _0xf781('0x66'):_0x5b78ac['Call_Result']=_0xf781('0x67');break;case _0xf781('0x68'):case _0xf781('0x69'):_0x5b78ac[_0xf781('0x6a')]='Answered';break;case'rejected':_0x5b78ac[_0xf781('0x6a')]=_0xf781('0x6b');break;case'abandoned':_0x5b78ac[_0xf781('0x6a')]=_0xf781('0x6c');break;case _0xf781('0x6d'):_0x5b78ac[_0xf781('0x6a')]=_0xf781('0x6e');default:}_0x5b78ac['Call_Start_Time']=(_0x460799===_0xf781('0x6f')?moment(_0xae4775[_0xf781('0x64')])[_0xf781('0x30')](_0xf781('0x63')):moment(_0xae4775[_0xf781('0x70')])[_0xf781('0x30')](_0xf781('0x63')))||moment()[_0xf781('0x30')](_0xf781('0x63'));_0x5b78ac['Call_Type']=_0x460799||_0xf781('0x71');_0x5b78ac=_[_0xf781('0x72')](_0x5b78ac,getCustomFields(_0xa149a6['Fields'],_0xae4775));return request({'method':_0xf781('0x24'),'uri':_0xf781('0x41')+_0x23e6ca+_0xf781('0x73'),'headers':{'Authorization':'Zoho-oauthtoken\x20'+_0x439495},'body':{'data':[_0x5b78ac]},'json':!![]})['then'](function(_0x3ebcc1){if(_0x3ebcc1&&_0x3ebcc1['data'][0x0][_0xf781('0x46')]==='SUCCESS'){logger[_0xf781('0x2e')](_0xf781('0x74'));return{'id':_0x3ebcc1['data'][0x0]['details']['id']};}})[_0xf781('0x40')](function(_0x4f87b8){logger[_0xf781('0x2e')]('err',_0x4f87b8[_0xf781('0x2d')]);console[_0xf781('0x49')](_0xf781('0x75'),_0x4f87b8);});}exports['queue']=function(_0x1da81f,_0x38d545,_0x245499,_0x4f06a7,_0x47c1f2,_0x155abc){var _0x252a19,_0x4c514f,_0xd5aa1a;_0x155abc['host']=intUtil[_0xf781('0x76')](_0x155abc[_0xf781('0x77')]);_0x155abc[_0xf781('0x78')]=intUtil[_0xf781('0x76')](_0x155abc[_0xf781('0x78')]);if(_0x47c1f2&&_0x47c1f2[_0xf781('0x79')]){logger[_0xf781('0x2e')]('[QUEUE]',_0xf781('0x7a'));_0x38d545[_0xf781('0x7b')]=_0x155abc[_0xf781('0x78')]+_0xf781('0x7c')+_0x38d545[_0xf781('0x7d')]+_0xf781('0x7e')+md5(_0x38d545[_0xf781('0x7d')]);}else{_0x38d545[_0xf781('0x7b')]='';}var _0x4148fa=_0x155abc[_0xf781('0x77')]===_0xf781('0x7f')?'eu':_0xf781('0x80');return getAccessToken(_0x155abc)[_0xf781('0x28')](function(_0x5f11e5){_0xd5aa1a=_0x5f11e5;return getUser(_0xd5aa1a,_0x4148fa,_0x155abc,_0x4f06a7['email']);})[_0xf781('0x28')](function(_0xe52956){_0x252a19=_0xe52956;logger[_0xf781('0x2e')](_0xf781('0x81'),_0x252a19['id']);return getEndUser(_0xd5aa1a,_0x4148fa,_0x155abc,_0x38d545[_0xf781('0x82')],_0x38d545['calleridnum'],_0x252a19,_0x245499);})['then'](function(_0x57133b){_0x4c514f=_0x57133b;return getCall(_0xd5aa1a,_0x4148fa,_0x155abc,_0x252a19,_0x4c514f,_0x245499,_0x38d545,_0xf781('0x71'));})[_0xf781('0x28')](function(_0x35b23d){if(_0x35b23d){logger[_0xf781('0x2e')]('The\x20Call\x20ID\x20is:',_0x35b23d['id']);logger['info'](_0xf781('0x83'),_0xf781('0x84'));emit(util[_0xf781('0x30')](_0xf781('0x85'),_0x4f06a7['name']),_0xf781('0x86'),{'uri':_0xf781('0x87')+_0x155abc[_0xf781('0x77')]+_0xf781('0x88')+_0x35b23d['id']});}})[_0xf781('0x40')](function(_0x173b16){logger[_0xf781('0x2b')](_0xf781('0x83'),JSON[_0xf781('0xf')](_0x173b16));});};exports[_0xf781('0x6f')]=function(_0x34a0bb,_0x4226ef,_0x3c7831,_0x405b8d,_0x2525bd,_0x434709,_0xa1a5f9){var _0x1dd134,_0x1ebdb0,_0xa2daa;_0x434709[_0xf781('0x77')]=intUtil['stripTrailingSlash'](_0x434709['host']);_0x434709[_0xf781('0x78')]=intUtil[_0xf781('0x76')](_0x434709['serverUrl']);if(_0xa1a5f9&&_0xa1a5f9[_0xf781('0x89')]&&_0xa1a5f9[_0xf781('0x89')]!=='none'){logger['info']('[OUTBOUND]',_0xf781('0x7a'));_0x4226ef[_0xf781('0x7b')]=_0x434709[_0xf781('0x78')]+_0xf781('0x7c')+_0x4226ef[_0xf781('0x7d')]+_0xf781('0x7e')+md5(_0x4226ef['uniqueid']);}var _0x5678c6=_0x434709[_0xf781('0x77')]===_0xf781('0x7f')?'eu':_0xf781('0x80');return getAccessToken(_0x434709)[_0xf781('0x28')](function(_0x412afc){_0xa2daa=_0x412afc;return getUser(_0xa2daa,_0x5678c6,_0x434709,_0x405b8d[_0xf781('0x36')]);})[_0xf781('0x28')](function(_0x19a162){_0x1dd134=_0x19a162;logger[_0xf781('0x2e')](_0xf781('0x81'),_0x1dd134['id']);return getEndUser(_0xa2daa,_0x5678c6,_0x434709,_0x4226ef[_0xf781('0x8a')],_0x4226ef['destcalleridnum'],_0x1dd134,_0x3c7831);})[_0xf781('0x28')](function(_0x162106){_0x1ebdb0=_0x162106;return getCall(_0xa2daa,_0x5678c6,_0x434709,_0x1dd134,_0x1ebdb0,_0x3c7831,_0x4226ef,_0xf781('0x8b'));})[_0xf781('0x28')](function(_0x19abf1){if(_0x19abf1){logger['info'](_0xf781('0x8c'),_0x19abf1['id']);logger[_0xf781('0x2e')](_0xf781('0x8d'),_0xf781('0x84'));emit(util[_0xf781('0x30')]('user:%s',_0x405b8d[_0xf781('0x1c')]),_0xf781('0x86'),{'uri':_0xf781('0x87')+_0x434709[_0xf781('0x77')]+'/crm/EntityInfo.do?module=Calls&id='+_0x19abf1['id']});}})[_0xf781('0x40')](function(_0x584e70){logger['error'](_0xf781('0x8d'),JSON[_0xf781('0xf')](_0x584e70));});};exports[_0xf781('0x8e')]=function(_0x30601a,_0x314ade,_0x4dd349,_0x84b266,_0x5e33bf,_0x5ee0e9){var _0x2d7395,_0x30b87e,_0x2313a2;_0x5ee0e9[_0xf781('0x77')]=intUtil[_0xf781('0x76')](_0x5ee0e9[_0xf781('0x77')]);_0x5ee0e9['serverUrl']=intUtil[_0xf781('0x76')](_0x5ee0e9[_0xf781('0x78')]);if(_0x5e33bf&&_0x5e33bf['monitor_format']){logger['info']('['+_0x314ade[_0xf781('0x65')][_0xf781('0x8f')]()+']',_0xf781('0x7a'));_0x314ade[_0xf781('0x7b')]=_0x5ee0e9['serverUrl']+'/api/voice/recordings/'+_0x314ade['uniqueid']+_0xf781('0x7e')+md5(_0x314ade['uniqueid']);}else{_0x314ade['recordingURL']='';}var _0x39f16e=_0x5ee0e9['host']==='zoho.eu'?'eu':_0xf781('0x80');return getAccessToken(_0x5ee0e9)['then'](function(_0x42a43a){_0x2313a2=_0x42a43a;return getUser(_0x2313a2,_0x39f16e,_0x5ee0e9);})[_0xf781('0x28')](function(_0x3c1b8d){_0x2d7395=_0x3c1b8d;logger[_0xf781('0x2e')](_0xf781('0x81'),_0x2d7395['id']);return getEndUser(_0x2313a2,_0x39f16e,_0x5ee0e9,_0x314ade[_0xf781('0x82')],_0x314ade[_0xf781('0x90')],_0x2d7395,_0x4dd349);})[_0xf781('0x28')](function(_0x26dcc7){_0x30b87e=_0x26dcc7;return getCall(_0x2313a2,_0x39f16e,_0x5ee0e9,_0x2d7395,_0x30b87e,_0x4dd349,_0x314ade,_0xf781('0x71'));})['then'](function(_0x4a40a3){if(_0x4a40a3){logger['info']('The\x20Call\x20ID\x20is:',_0x4a40a3['id']);}})[_0xf781('0x40')](function(_0x40f682){logger[_0xf781('0x2b')]('['+_0x314ade[_0xf781('0x65')]['toUpperCase']()+']',JSON['stringify'](_0x40f682));});}; \ No newline at end of file +var _0xbf5c=['Inbound','merge','Fields','/crm/v2/Calls','Call\x20created!','err','host','stripTrailingSlash','serverUrl','monitor_format','[QUEUE]','recordingURL','uniqueid','/downloads?type=uniqueid&token=','zoho.eu','com','email','The\x20Call\x20ID\x20is:','Displaying\x20call\x20to\x20agent\x20in\x20a\x20new\x20tab...','user:%s','trigger:browser:url','https://crm.','/crm/EntityInfo.do?module=Calls&id=','recordingFormat','none','[OUTBOUND]','Recording\x20is\x20enabled!','/api/voice/recordings/','The\x20User\x20ID\x20is:','destcalleridnum','Outbound','toUpperCase','calleridname','lodash','request-promise','md5','./util','moment','ioredis','../../../../config/environment','../../../../config/logger','redis','defaults','socket.io-emitter','emit','[HTTP]','stringify','length','includes','string','idField','content','toString','type','variable','variableName','customVariable','Variable','name','toLowerCase','indexOf','isNil','access_token','isBefore','expires_in','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','then','add','seconds','catch','error','Failing\x20creating\x20the\x20access_token','stack','info','Search\x20user','GET','format','https://www.zohoapis.%s/crm/v2/users','ActiveUsers','Zoho-oauthtoken\x20','users','isArrayLikeObject','findIndex','Agent\x20found!','Using\x20the\x20admin\x20account!','Administrator','user','Unable\x20to\x20retrieve\x20zoho\x20account\x20users:\x20','data','enduserType','https://www.zohoapis.','/crm/v2/','startCase','first_name','last_name','code','SUCCESS','details','Error:\x20','log','CREATE\x20ERROR','moduleSearch','contact_lead','uri','/crm/v2/Contacts/search?criteria=((Phone:equals:','Contacts','/crm/v2/Leads/search?criteria=((Phone:equals:','moduleCreate','nothing','lead','Leads','Creating\x20new\x20call...','Owner','role','profile','administrator','getString','Description','Descriptions','Who_Id','Full_Name','First_Name','Last_Name','What_Id','$se_module','talktime','Call_Duration','utc','mm:ss','answertime','endtime','YYYY-MM-DDTHH:mm:ss','lastevent','called','Call_Result','complete','connect','Answered','rejected','timeout','Timeout','outbound'];(function(_0x538767,_0x3599d7){var _0x4d6e81=function(_0x29f0cf){while(--_0x29f0cf){_0x538767['push'](_0x538767['shift']());}};_0x4d6e81(++_0x3599d7);}(_0xbf5c,0xb8));var _0xcbf5=function(_0x4d66f3,_0x4a4d2f){_0x4d66f3=_0x4d66f3-0x0;var _0x2dcb0c=_0xbf5c[_0x4d66f3];return _0x2dcb0c;};'use strict';var _=require(_0xcbf5('0x0'));var rp=require(_0xcbf5('0x1'));var md5=require(_0xcbf5('0x2'));var util=require('util');var intUtil=require(_0xcbf5('0x3'));var moment=require(_0xcbf5('0x4'));var Redis=require(_0xcbf5('0x5'));var BPromise=require('bluebird');var config=require(_0xcbf5('0x6'));var logger=require(_0xcbf5('0x7'))('zoho');config[_0xcbf5('0x8')]=_[_0xcbf5('0x9')](config[_0xcbf5('0x8')],{'host':'localhost','port':0x18eb});var io=require(_0xcbf5('0xa'))(new Redis(config[_0xcbf5('0x8')]));function emit(_0x54d2d4,_0x52f784,_0x36c122){io['to'](_0x54d2d4)[_0xcbf5('0xb')](_0x52f784,_0x36c122);}function request(_0x230a6c){logger['debug'](_0xcbf5('0xc'),JSON[_0xcbf5('0xd')](_0x230a6c));return rp(_0x230a6c);}function getCustomFields(_0x29b871,_0x1b1822){var _0x4352b4={};if(_0x29b871[_0xcbf5('0xe')]>0x0){_['forEach'](_0x29b871,function(_0x22f7fa){if(_[_0xcbf5('0xf')]([_0xcbf5('0x10'),'picklist'],_0x22f7fa['type'])&&_0x22f7fa[_0xcbf5('0x11')]){_0x4352b4[_0x22f7fa['idField']]=_0x22f7fa[_0xcbf5('0x12')][_0xcbf5('0x13')]();}else if(_0x22f7fa[_0xcbf5('0x14')]===_0xcbf5('0x15')&&_0x22f7fa['variableName']&&_0x22f7fa['idField']&&_0x1b1822[_0x22f7fa[_0xcbf5('0x16')]]){_0x4352b4[_0x22f7fa['idField']]=_0x1b1822[_0x22f7fa[_0xcbf5('0x16')]]['toString']();}else if(_0x22f7fa['type']===_0xcbf5('0x17')&&_0x22f7fa[_0xcbf5('0x18')]&&_0x22f7fa[_0xcbf5('0x18')][_0xcbf5('0x19')]&&_0x22f7fa[_0xcbf5('0x11')]&&_0x1b1822[_0x22f7fa[_0xcbf5('0x18')][_0xcbf5('0x19')]['toLowerCase']()]){_0x4352b4[_0x22f7fa[_0xcbf5('0x11')]]=_0x1b1822[_0x22f7fa[_0xcbf5('0x18')][_0xcbf5('0x19')][_0xcbf5('0x1a')]()][_0xcbf5('0x13')]();}});}return _0x4352b4;}function getName(_0x3b3022){if(_0x3b3022[_0xcbf5('0x1b')]('\x20')>0x0){var _0x28a065=_0x3b3022['split'](/ (.+)/);if(_0x28a065[0x1]){return _0x28a065;}}return[_0x3b3022,_0x3b3022];}var accountsTokens={};function getAccessToken(_0x155147){return new Promise(function(_0x4e8874,_0x297b86){if(!_['isNil'](accountsTokens[_0x155147['id']])&&!_[_0xcbf5('0x1c')](accountsTokens[_0x155147['id']][_0xcbf5('0x1d')])){if(moment()[_0xcbf5('0x1e')](accountsTokens[_0x155147['id']][_0xcbf5('0x1f')])){_0x4e8874(accountsTokens[_0x155147['id']][_0xcbf5('0x1d')]);}}var _0x278f30;switch(_0x155147['zone']){case'US':_0x278f30=_0xcbf5('0x20');break;case'AU':_0x278f30='https://accounts.zoho.com.au';break;case'EU':_0x278f30=_0xcbf5('0x21');break;case'IN':_0x278f30=_0xcbf5('0x22');break;case'CN':_0x278f30=_0xcbf5('0x23');break;default:_0x278f30=_0xcbf5('0x21');break;}var _0x4c8d12={'method':_0xcbf5('0x24'),'uri':_0x278f30+_0xcbf5('0x25'),'qs':{'refresh_token':_0x155147[_0xcbf5('0x26')],'client_id':_0x155147[_0xcbf5('0x27')],'client_secret':_0x155147[_0xcbf5('0x28')],'grant_type':_0xcbf5('0x29')},'json':!![]};return rp(_0x4c8d12)[_0xcbf5('0x2a')](function(_0xe6742){accountsTokens[_0x155147['id']]={'access_token':_0xe6742['access_token'],'expires_in':moment()[_0xcbf5('0x2b')](_0xe6742[_0xcbf5('0x1f')],_0xcbf5('0x2c'))};_0x4e8874(_0xe6742[_0xcbf5('0x1d')]);})[_0xcbf5('0x2d')](function(_0x57e453){logger[_0xcbf5('0x2e')](_0xcbf5('0x2f'),_0x57e453[_0xcbf5('0x30')]);_0x297b86(_0x57e453);});});}function getUser(_0x3389a1,_0x14e61d,_0x13024d,_0x4b22f3){logger[_0xcbf5('0x31')](_0xcbf5('0x32'));return request({'method':_0xcbf5('0x33'),'uri':util[_0xcbf5('0x34')](_0xcbf5('0x35'),_0x14e61d),'qs':{'type':_0xcbf5('0x36')},'headers':{'Authorization':_0xcbf5('0x37')+_0x3389a1},'json':!![]})['then'](function(_0x4d2a50){if(_0x4d2a50[_0xcbf5('0x38')]){var _0x482104=-0x1;if(_[_0xcbf5('0x39')](_0x4d2a50[_0xcbf5('0x38')])){if(!_[_0xcbf5('0x1c')](_0x4b22f3)){_0x482104=_[_0xcbf5('0x3a')](_0x4d2a50[_0xcbf5('0x38')],function(_0x5cbe12){return _0x5cbe12['email']===_0x4b22f3;});}if(_0x482104>=0x0){logger[_0xcbf5('0x31')](_0xcbf5('0x3b'));}else{logger[_0xcbf5('0x31')](_0xcbf5('0x3c'));_0x482104=_[_0xcbf5('0x3a')](_0x4d2a50[_0xcbf5('0x38')],function(_0x202331){return _0x202331['profile'][_0xcbf5('0x19')]===_0xcbf5('0x3d');});}return _0x4d2a50[_0xcbf5('0x38')][_0x482104];}else{if(_0x4d2a50[_0xcbf5('0x3e')]['profile'][_0xcbf5('0x19')]===_0xcbf5('0x3d')){logger['info'](_0xcbf5('0x3c'));user=_0x4d2a50[_0xcbf5('0x3e')];return user;}else{logger['error']('The\x20failing\x20result\x20is',JSON[_0xcbf5('0xd')](_0x4d2a50));throw new Error(_0xcbf5('0x3f')+JSON[_0xcbf5('0xd')](_0x4d2a50));}}}else{logger[_0xcbf5('0x2e')]('The\x20failing\x20result\x20is',JSON[_0xcbf5('0xd')](_0x4d2a50));throw new Error(_0xcbf5('0x3f')+JSON[_0xcbf5('0xd')](_0x4d2a50));}})[_0xcbf5('0x2d')](function(_0x580dec){console[_0xcbf5('0x2e')](_0x580dec);});}function getZohoUser(_0x366c09,_0x5c3d22){return new BPromise(function(_0x4d76eb,_0x2b9107){request(_0x366c09)[_0xcbf5('0x2a')](function(_0x4cbcf8){var _0x3acbb3=null;if(_0x4cbcf8){_0x3acbb3=_0x4cbcf8[_0xcbf5('0x40')][0x0];_0x3acbb3[_0xcbf5('0x41')]=_0x5c3d22;}_0x4d76eb(_0x3acbb3);})[_0xcbf5('0x2d')](function(_0x41eeca){_0x2b9107(_0x41eeca);});});}function createEndUser(_0x50c390,_0x33959b,_0x1bb4b5,_0x5d1d96,_0x2fb0fc,_0x494ce1){var _0x1bb4b5=getName(_0x1bb4b5);return request({'method':'POST','uri':_0xcbf5('0x42')+_0x33959b+_0xcbf5('0x43')+_[_0xcbf5('0x44')](_0x494ce1['moduleCreate'])+'s','body':{'data':[{'Last_Name':_0x1bb4b5[0x1],'First_Name':_0x1bb4b5[0x0],'Phone':_0x5d1d96,'Owner':{'name':!_[_0xcbf5('0x1c')](_0x2fb0fc['role']['name'])?_0x2fb0fc['role'][_0xcbf5('0x19')]:!_['isNil'](_0x2fb0fc['first_name'])?_0x2fb0fc[_0xcbf5('0x45')]+'\x20'+_0x2fb0fc[_0xcbf5('0x46')]:_0x2fb0fc['last_name'],'id':_0x2fb0fc['id']}}]},'headers':{'Authorization':_0xcbf5('0x37')+_0x50c390},'json':!![]})['then'](function(_0x3c1fb9){if(_0x3c1fb9&&_0x3c1fb9[_0xcbf5('0x40')][0x0][_0xcbf5('0x47')]===_0xcbf5('0x48')){var _0x38299c=_0x3c1fb9[_0xcbf5('0x40')][0x0][_0xcbf5('0x49')];_0x38299c['enduserType']=_['startCase'](_0x494ce1['moduleCreate'])+'s';return _0x38299c;}logger[_0xcbf5('0x2e')]('The\x20failing\x20result\x20is',JSON[_0xcbf5('0xd')](data));throw new Error(_0xcbf5('0x4a')+JSON[_0xcbf5('0xd')](data));})[_0xcbf5('0x2d')](function(_0x3e1b22){console[_0xcbf5('0x4b')](_0xcbf5('0x4c'),_0x3e1b22);});}function getEndUser(_0x383398,_0x334839,_0x200b17,_0xff80ad,_0x272694,_0x77b6f0,_0x3e7b2f){var _0x53403e={'method':_0xcbf5('0x33'),'uri':'','headers':{'Authorization':'Zoho-oauthtoken\x20'+_0x383398},'json':!![]};switch(_0x3e7b2f[_0xcbf5('0x4d')]){case _0xcbf5('0x4e'):_0x53403e[_0xcbf5('0x4f')]=_0xcbf5('0x42')+_0x334839+_0xcbf5('0x50')+_0x272694+'))';return getZohoUser(_0x53403e,_0xcbf5('0x51'))[_0xcbf5('0x2a')](function(_0x3db994){if(_0x3db994)return _0x3db994;_0x53403e['uri']='https://www.zohoapis.'+_0x334839+_0xcbf5('0x52')+_0x272694+'))';return getZohoUser(_0x53403e,'Leads')['then'](function(_0x305f93){if(_0x305f93)return _0x305f93;if(_0x3e7b2f[_0xcbf5('0x53')]!=_0xcbf5('0x54')){return createEndUser(_0x383398,_0x334839,_0xff80ad,_0x272694,_0x77b6f0,_0x3e7b2f);}else{return{};}});});break;case'contact':_0x53403e[_0xcbf5('0x4f')]='https://www.zohoapis.'+_0x334839+_0xcbf5('0x50')+_0x272694+'))';return getZohoUser(_0x53403e,'Contacts')[_0xcbf5('0x2a')](function(_0x11fd0d){if(_0x11fd0d)return _0x11fd0d;if(_0x3e7b2f[_0xcbf5('0x53')]!=_0xcbf5('0x54')){return createEndUser(_0x383398,_0x334839,_0xff80ad,_0x272694,_0x77b6f0,_0x3e7b2f);}else{return{};}});break;case _0xcbf5('0x55'):_0x53403e['uri']=_0xcbf5('0x42')+_0x334839+_0xcbf5('0x52')+_0x272694+'))';return getZohoUser(_0x53403e,_0xcbf5('0x56'))[_0xcbf5('0x2a')](function(_0x547357){if(_0x547357)return _0x547357;if(_0x3e7b2f[_0xcbf5('0x53')]!='nothing'){return createEndUser(_0x383398,_0x334839,_0xff80ad,_0x272694,_0x77b6f0,_0x3e7b2f);}else{return{};}});break;}}function getCall(_0x52a3df,_0x497f9a,_0x5c8951,_0x30c38c,_0x5ee439,_0x1d07e2,_0x329536,_0x5ada8c){logger[_0xcbf5('0x31')](_0xcbf5('0x57'));var _0x4b3e68={};_0x4b3e68[_0xcbf5('0x58')]={'name':!_[_0xcbf5('0x1c')](_0x30c38c[_0xcbf5('0x59')]['name'])&&!_[_0xcbf5('0x1c')](_0x30c38c[_0xcbf5('0x5a')][_0xcbf5('0x19')])&&_0x30c38c['profile'][_0xcbf5('0x19')]===_0xcbf5('0x5b')?_0x30c38c['role'][_0xcbf5('0x19')]:!_[_0xcbf5('0x1c')](_0x30c38c[_0xcbf5('0x45')])?_0x30c38c[_0xcbf5('0x45')]+'\x20'+_0x30c38c[_0xcbf5('0x46')]:_0x30c38c['last_name'],'id':_0x30c38c['id']};_0x4b3e68['Subject']=intUtil[_0xcbf5('0x5c')](_0x1d07e2['Subjects'],_0x329536,'\x20');_0x4b3e68[_0xcbf5('0x5d')]=intUtil['getString'](_0x1d07e2[_0xcbf5('0x5e')],_0x329536,'\x0a');if(_0x5ee439[_0xcbf5('0x41')]==='Contacts'){_0x4b3e68[_0xcbf5('0x5f')]={'name':!_[_0xcbf5('0x1c')](_0x5ee439['Full_Name'])?_0x5ee439[_0xcbf5('0x60')]:!_['isNil'](_0x5ee439[_0xcbf5('0x61')])?_0x5ee439[_0xcbf5('0x61')]+'\x20'+_0x5ee439[_0xcbf5('0x62')]:_0x5ee439['Last_Name'],'id':_0x5ee439['id']};}if(_0x5ee439['enduserType']===_0xcbf5('0x56')){_0x4b3e68[_0xcbf5('0x63')]={'name':!_[_0xcbf5('0x1c')](_0x5ee439[_0xcbf5('0x60')])?_0x5ee439[_0xcbf5('0x60')]:!_[_0xcbf5('0x1c')](_0x5ee439[_0xcbf5('0x61')])?_0x5ee439['First_Name']+'\x20'+_0x5ee439['Last_Name']:_0x5ee439[_0xcbf5('0x62')],'id':_0x5ee439['id']};_0x4b3e68[_0xcbf5('0x64')]=_[_0xcbf5('0x44')](_0x5ee439[_0xcbf5('0x41')]);}if(_0x329536[_0xcbf5('0x65')]){_0x4b3e68[_0xcbf5('0x66')]=moment[_0xcbf5('0x67')](parseInt(_0x329536[_0xcbf5('0x65')])*0x3e8)[_0xcbf5('0x34')](_0xcbf5('0x68'));}else if(_0x329536[_0xcbf5('0x69')]&&_0x329536['endtime']){_0x4b3e68['Call_Duration']=moment['utc'](moment(_0x329536[_0xcbf5('0x6a')],'YYYY-MM-DDTHH:mm:ss')['diff'](moment(_0x329536['starttime'],_0xcbf5('0x6b'))))[_0xcbf5('0x34')]('mm:ss');}switch(_0x329536[_0xcbf5('0x6c')]){case _0xcbf5('0x6d'):_0x4b3e68[_0xcbf5('0x6e')]='Called';break;case _0xcbf5('0x6f'):case _0xcbf5('0x70'):_0x4b3e68['Call_Result']=_0xcbf5('0x71');break;case _0xcbf5('0x72'):_0x4b3e68[_0xcbf5('0x6e')]='Rejected';break;case'abandoned':_0x4b3e68[_0xcbf5('0x6e')]='Abandoned';break;case _0xcbf5('0x73'):_0x4b3e68[_0xcbf5('0x6e')]=_0xcbf5('0x74');default:}_0x4b3e68['Call_Start_Time']=(_0x5ada8c===_0xcbf5('0x75')?moment(_0x329536['starttime'])[_0xcbf5('0x34')](_0xcbf5('0x6b')):moment(_0x329536['agentcalledAt'])[_0xcbf5('0x34')]('YYYY-MM-DDTHH:mm:ss'))||moment()[_0xcbf5('0x34')](_0xcbf5('0x6b'));_0x4b3e68['Call_Type']=_0x5ada8c||_0xcbf5('0x76');_0x4b3e68=_[_0xcbf5('0x77')](_0x4b3e68,getCustomFields(_0x1d07e2[_0xcbf5('0x78')],_0x329536));return request({'method':'POST','uri':_0xcbf5('0x42')+_0x497f9a+_0xcbf5('0x79'),'headers':{'Authorization':_0xcbf5('0x37')+_0x52a3df},'body':{'data':[_0x4b3e68]},'json':!![]})['then'](function(_0x584db6){if(_0x584db6&&_0x584db6['data'][0x0][_0xcbf5('0x47')]===_0xcbf5('0x48')){logger['info'](_0xcbf5('0x7a'));return{'id':_0x584db6[_0xcbf5('0x40')][0x0]['details']['id']};}})[_0xcbf5('0x2d')](function(_0x3eb3fc){logger[_0xcbf5('0x31')]('err',_0x3eb3fc[_0xcbf5('0x30')]);console[_0xcbf5('0x4b')](_0xcbf5('0x7b'),_0x3eb3fc);});}exports['queue']=function(_0x10f6a5,_0x52c97c,_0x2758a4,_0x3a027f,_0x2c9d36,_0x3258a8){var _0x4ff6b8,_0x1a33a8,_0x3f25f4;_0x3258a8[_0xcbf5('0x7c')]=intUtil['stripTrailingSlash'](_0x3258a8['host']);_0x3258a8['serverUrl']=intUtil[_0xcbf5('0x7d')](_0x3258a8[_0xcbf5('0x7e')]);if(_0x2c9d36&&_0x2c9d36[_0xcbf5('0x7f')]){logger['info'](_0xcbf5('0x80'),'Recording\x20is\x20enabled!');_0x52c97c[_0xcbf5('0x81')]=_0x3258a8['serverUrl']+'/api/voice/recordings/'+_0x52c97c[_0xcbf5('0x82')]+_0xcbf5('0x83')+md5(_0x52c97c[_0xcbf5('0x82')]);}else{_0x52c97c[_0xcbf5('0x81')]='';}var _0x376524=_0x3258a8['host']===_0xcbf5('0x84')?'eu':_0xcbf5('0x85');return getAccessToken(_0x3258a8)['then'](function(_0x12c6b9){_0x3f25f4=_0x12c6b9;return getUser(_0x3f25f4,_0x376524,_0x3258a8,_0x3a027f[_0xcbf5('0x86')]);})[_0xcbf5('0x2a')](function(_0x3d28ea){_0x4ff6b8=_0x3d28ea;logger[_0xcbf5('0x31')]('The\x20User\x20ID\x20is:',_0x4ff6b8['id']);return getEndUser(_0x3f25f4,_0x376524,_0x3258a8,_0x52c97c['calleridname'],_0x52c97c['calleridnum'],_0x4ff6b8,_0x2758a4);})[_0xcbf5('0x2a')](function(_0x4a3aa7){_0x1a33a8=_0x4a3aa7;return getCall(_0x3f25f4,_0x376524,_0x3258a8,_0x4ff6b8,_0x1a33a8,_0x2758a4,_0x52c97c,_0xcbf5('0x76'));})[_0xcbf5('0x2a')](function(_0x53e598){if(_0x53e598){logger[_0xcbf5('0x31')](_0xcbf5('0x87'),_0x53e598['id']);logger[_0xcbf5('0x31')](_0xcbf5('0x80'),_0xcbf5('0x88'));emit(util[_0xcbf5('0x34')](_0xcbf5('0x89'),_0x3a027f['name']),_0xcbf5('0x8a'),{'uri':_0xcbf5('0x8b')+_0x3258a8[_0xcbf5('0x7c')]+_0xcbf5('0x8c')+_0x53e598['id']});}})[_0xcbf5('0x2d')](function(_0x2f00f){logger[_0xcbf5('0x2e')](_0xcbf5('0x80'),JSON['stringify'](_0x2f00f));});};exports[_0xcbf5('0x75')]=function(_0x58485e,_0x48c75a,_0x1453d4,_0x3c6c1f,_0x4f026f,_0x272157,_0x150341){var _0x4b2f14,_0x4b9c7f,_0x40ae86;_0x272157[_0xcbf5('0x7c')]=intUtil[_0xcbf5('0x7d')](_0x272157[_0xcbf5('0x7c')]);_0x272157[_0xcbf5('0x7e')]=intUtil['stripTrailingSlash'](_0x272157[_0xcbf5('0x7e')]);if(_0x150341&&_0x150341[_0xcbf5('0x8d')]&&_0x150341[_0xcbf5('0x8d')]!==_0xcbf5('0x8e')){logger[_0xcbf5('0x31')](_0xcbf5('0x8f'),_0xcbf5('0x90'));_0x48c75a[_0xcbf5('0x81')]=_0x272157[_0xcbf5('0x7e')]+_0xcbf5('0x91')+_0x48c75a[_0xcbf5('0x82')]+_0xcbf5('0x83')+md5(_0x48c75a['uniqueid']);}var _0x3e7e93=_0x272157[_0xcbf5('0x7c')]===_0xcbf5('0x84')?'eu':_0xcbf5('0x85');return getAccessToken(_0x272157)[_0xcbf5('0x2a')](function(_0x3cd012){_0x40ae86=_0x3cd012;return getUser(_0x40ae86,_0x3e7e93,_0x272157,_0x3c6c1f[_0xcbf5('0x86')]);})['then'](function(_0x4365f6){_0x4b2f14=_0x4365f6;logger['info'](_0xcbf5('0x92'),_0x4b2f14['id']);return getEndUser(_0x40ae86,_0x3e7e93,_0x272157,_0x48c75a['destcalleridname'],_0x48c75a[_0xcbf5('0x93')],_0x4b2f14,_0x1453d4);})[_0xcbf5('0x2a')](function(_0x51b7fc){_0x4b9c7f=_0x51b7fc;return getCall(_0x40ae86,_0x3e7e93,_0x272157,_0x4b2f14,_0x4b9c7f,_0x1453d4,_0x48c75a,_0xcbf5('0x94'));})[_0xcbf5('0x2a')](function(_0xd8a10f){if(_0xd8a10f){logger['info']('The\x20Call\x20ID\x20is:',_0xd8a10f['id']);logger[_0xcbf5('0x31')](_0xcbf5('0x8f'),_0xcbf5('0x88'));emit(util['format'](_0xcbf5('0x89'),_0x3c6c1f[_0xcbf5('0x19')]),_0xcbf5('0x8a'),{'uri':'https://crm.'+_0x272157['host']+'/crm/EntityInfo.do?module=Calls&id='+_0xd8a10f['id']});}})[_0xcbf5('0x2d')](function(_0x321978){logger[_0xcbf5('0x2e')]('[OUTBOUND]',JSON['stringify'](_0x321978));});};exports['unmanaged']=function(_0x1f5153,_0x1968c2,_0x4b5b98,_0x18ffcb,_0x28b76c,_0x349afd){var _0x50d56a,_0xa52a13,_0x5e337d;_0x349afd['host']=intUtil[_0xcbf5('0x7d')](_0x349afd['host']);_0x349afd[_0xcbf5('0x7e')]=intUtil[_0xcbf5('0x7d')](_0x349afd[_0xcbf5('0x7e')]);if(_0x28b76c&&_0x28b76c[_0xcbf5('0x7f')]){logger[_0xcbf5('0x31')]('['+_0x1968c2['lastevent'][_0xcbf5('0x95')]()+']',_0xcbf5('0x90'));_0x1968c2[_0xcbf5('0x81')]=_0x349afd[_0xcbf5('0x7e')]+_0xcbf5('0x91')+_0x1968c2[_0xcbf5('0x82')]+'/downloads?type=uniqueid&token='+md5(_0x1968c2[_0xcbf5('0x82')]);}else{_0x1968c2[_0xcbf5('0x81')]='';}var _0x5121ec=_0x349afd[_0xcbf5('0x7c')]===_0xcbf5('0x84')?'eu':_0xcbf5('0x85');return getAccessToken(_0x349afd)['then'](function(_0x43b6b1){_0x5e337d=_0x43b6b1;return getUser(_0x5e337d,_0x5121ec,_0x349afd);})[_0xcbf5('0x2a')](function(_0xda3e5d){_0x50d56a=_0xda3e5d;logger['info'](_0xcbf5('0x92'),_0x50d56a['id']);return getEndUser(_0x5e337d,_0x5121ec,_0x349afd,_0x1968c2[_0xcbf5('0x96')],_0x1968c2['calleridnum'],_0x50d56a,_0x4b5b98);})[_0xcbf5('0x2a')](function(_0x22c378){_0xa52a13=_0x22c378;return getCall(_0x5e337d,_0x5121ec,_0x349afd,_0x50d56a,_0xa52a13,_0x4b5b98,_0x1968c2,'Inbound');})[_0xcbf5('0x2a')](function(_0x549f8d){if(_0x549f8d){logger[_0xcbf5('0x31')](_0xcbf5('0x87'),_0x549f8d['id']);}})[_0xcbf5('0x2d')](function(_0x669b20){logger[_0xcbf5('0x2e')]('['+_0x1968c2[_0xcbf5('0x6c')][_0xcbf5('0x95')]()+']',JSON[_0xcbf5('0xd')](_0x669b20));});}; \ 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 9c0fc43..dab8a31 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 _0x45e4=['error','%s\x20\x27%s\x27\x20failed\x20with\x20code\x20%d\x20and\x20error:\x20%s','info','format','%s\x20\x27%s\x27\x20succeeded\x20with\x20output:\x20%s','util','shelljs','../../../../config/logger','trigger','data2','Script','data3','render'];(function(_0x42cae2,_0x284ef8){var _0x5f256f=function(_0x41abc8){while(--_0x41abc8){_0x42cae2['push'](_0x42cae2['shift']());}};_0x5f256f(++_0x284ef8);}(_0x45e4,0xe2));var _0x445e=function(_0x5af4f7,_0x1e4ce9){_0x5af4f7=_0x5af4f7-0x0;var _0x28f222=_0x45e4[_0x5af4f7];return _0x28f222;};'use strict';var util=require(_0x445e('0x0'));var sh=require(_0x445e('0x1'));var Mustache=require('mustache');var logger=require(_0x445e('0x2'))(_0x445e('0x3'));exports['exec']=function(_0x1a926d,_0x256266){var _0x58644d=_0x1a926d[_0x445e('0x4')]?_0x1a926d['data2']:_0x445e('0x5');var _0x1c620b=_0x1a926d[_0x445e('0x6')]?Mustache[_0x445e('0x7')](_0x1a926d[_0x445e('0x6')],_0x256266):_0x256266;sh['exec'](_0x1c620b,function(_0x4c559f,_0x24dd02,_0x4393dd){if(_0x4c559f!==0x0){logger[_0x445e('0x8')](util['format'](_0x445e('0x9'),_0x58644d,_0x1c620b,_0x4c559f,_0x4393dd));}else{logger[_0x445e('0xa')](util[_0x445e('0xb')](_0x445e('0xc'),_0x58644d,_0x1c620b,_0x24dd02));}});}; \ No newline at end of file +var _0xbe8b=['%s\x20\x27%s\x27\x20failed\x20with\x20code\x20%d\x20and\x20error:\x20%s','%s\x20\x27%s\x27\x20succeeded\x20with\x20output:\x20%s','shelljs','mustache','../../../../config/logger','trigger','exec','data2','Script','render','data3','format'];(function(_0x2627c7,_0x26416d){var _0x3e9d45=function(_0x3ac5d6){while(--_0x3ac5d6){_0x2627c7['push'](_0x2627c7['shift']());}};_0x3e9d45(++_0x26416d);}(_0xbe8b,0x6e));var _0xbbe8=function(_0x943390,_0x502c46){_0x943390=_0x943390-0x0;var _0x10563a=_0xbe8b[_0x943390];return _0x10563a;};'use strict';var util=require('util');var sh=require(_0xbbe8('0x0'));var Mustache=require(_0xbbe8('0x1'));var logger=require(_0xbbe8('0x2'))(_0xbbe8('0x3'));exports[_0xbbe8('0x4')]=function(_0x342785,_0x4a375d){var _0x262ca7=_0x342785[_0xbbe8('0x5')]?_0x342785[_0xbbe8('0x5')]:_0xbbe8('0x6');var _0x4b1c00=_0x342785['data3']?Mustache[_0xbbe8('0x7')](_0x342785[_0xbbe8('0x8')],_0x4a375d):_0x4a375d;sh[_0xbbe8('0x4')](_0x4b1c00,function(_0x24219d,_0x4b1b26,_0x4bd3f3){if(_0x24219d!==0x0){logger['error'](util[_0xbbe8('0x9')](_0xbbe8('0xa'),_0x262ca7,_0x4b1c00,_0x24219d,_0x4bd3f3));}else{logger['info'](util[_0xbbe8('0x9')](_0xbbe8('0xb'),_0x262ca7,_0x4b1c00,_0x4b1b26));}});}; \ 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 685f239..92c4697 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 _0xed8d=['format','stringify','isNil','object','info','statusCode','catch','message','request-promise','util','mustache','exec','data1','toUpperCase','render','data2','data5','number','headers','data6','parse','error','stack','GET','DELETE','POST','PUT','data7','body','body\x20has\x20been\x20passed\x20to\x20URLforward\x20in\x20a\x20wrong\x20format'];(function(_0x21c7e4,_0x2d61be){var _0x310cd2=function(_0x27820b){while(--_0x27820b){_0x21c7e4['push'](_0x21c7e4['shift']());}};_0x310cd2(++_0x2d61be);}(_0xed8d,0x1ac));var _0xded8=function(_0x378d60,_0x39713d){_0x378d60=_0x378d60-0x0;var _0x137bff=_0xed8d[_0x378d60];return _0x137bff;};'use strict';var rp=require(_0xded8('0x0'));var util=require(_0xded8('0x1'));var _=require('lodash');var Mustache=require(_0xded8('0x2'));var logger=require('../../../../config/logger')('trigger');exports[_0xded8('0x3')]=function(_0x5af017,_0xceea05){var _0x57ffd0,_0x4111b7;var _0x16ba20={'method':_0x5af017[_0xded8('0x4')][_0xded8('0x5')](),'uri':Mustache[_0xded8('0x6')](_0x5af017[_0xded8('0x7')],_0xceea05),'json':!![],'resolveWithFullResponse':!![],'timeout':typeof parseInt(_0x5af017[_0xded8('0x8')])===_0xded8('0x9')&&parseInt(_0x5af017['data5'])>=0x1&&parseInt(_0x5af017['data5'])<=0xa?parseInt(_0x5af017[_0xded8('0x8')])*0x3e8:0x5*0x3e8};try{_0x16ba20[_0xded8('0xa')]=_0x5af017[_0xded8('0xb')]?JSON[_0xded8('0xc')](Mustache[_0xded8('0x6')](_0x5af017[_0xded8('0xb')],_0xceea05)):{};}catch(_0x58fb94){logger[_0xded8('0xd')](_0x58fb94[_0xded8('0xe')]);}switch(_0x5af017[_0xded8('0x4')][_0xded8('0x5')]()){case _0xded8('0xf'):case _0xded8('0x10'):_0x57ffd0=null;_0x16ba20['qs']=_0xceea05;break;case _0xded8('0x11'):case _0xded8('0x12'):if(_0x5af017[_0xded8('0x13')]){try{_0x57ffd0=JSON[_0xded8('0xc')](Mustache[_0xded8('0x6')](_0x5af017[_0xded8('0x13')],_0xceea05));_0x16ba20[_0xded8('0x14')]=_0x57ffd0;}catch(_0x2859bc){logger[_0xded8('0xd')](_0x2859bc[_0xded8('0xe')]);logger[_0xded8('0xd')](_0xded8('0x15'));}}else{_0x57ffd0=_0xceea05;_0x16ba20[_0xded8('0x14')]=_0x57ffd0;}break;}logger['info'](util[_0xded8('0x16')]('%s\x20%s\x20sending\x20request\x20with\x20following\x20options:\x20%s',_0x5af017[_0xded8('0x4')],_0x5af017[_0xded8('0x7')],JSON[_0xded8('0x17')](_0x16ba20)));rp(_0x16ba20)['then'](function(_0x100706){_0x57ffd0=!_[_0xded8('0x18')](_0x57ffd0)?',\x20request\x20body:\x20'+_0x57ffd0:'';_0x4111b7=typeof _0x100706[_0xded8('0x14')]===_0xded8('0x19')?JSON['stringify'](_0x100706[_0xded8('0x14')]):_0x100706[_0xded8('0x14')];logger[_0xded8('0x1a')](util[_0xded8('0x16')]('%s\x20%s\x20succeeded\x20with\x20status:\x20%d\x20and\x20response:\x20%s',_0x5af017[_0xded8('0x4')],_0x5af017[_0xded8('0x7')],_0x100706[_0xded8('0x1b')],_0x4111b7));})[_0xded8('0x1c')](function(_0x32ae90){logger[_0xded8('0xd')](util['format']('%s\x20%s\x20failed\x20with\x20status:\x20%d\x20and\x20error:\x20%s\x20%s',_0x5af017[_0xded8('0x4')],_0x5af017[_0xded8('0x7')],_0x32ae90[_0xded8('0x1b')],_0x32ae90['name'],_0x32ae90[_0xded8('0x1d')]));});}; \ No newline at end of file +var _0xe6a9=['trigger','exec','render','data5','number','headers','data6','parse','error','stack','data1','toUpperCase','GET','DELETE','PUT','data7','body','body\x20has\x20been\x20passed\x20to\x20URLforward\x20in\x20a\x20wrong\x20format','info','format','%s\x20%s\x20sending\x20request\x20with\x20following\x20options:\x20%s','data2','stringify','then',',\x20request\x20body:\x20','statusCode','catch','%s\x20%s\x20failed\x20with\x20status:\x20%d\x20and\x20error:\x20%s\x20%s','name','request-promise','lodash','mustache','../../../../config/logger'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0xe6a9,0x1eb));var _0x9e6a=function(_0x4a3636,_0x3ffb3d){_0x4a3636=_0x4a3636-0x0;var _0x338212=_0xe6a9[_0x4a3636];return _0x338212;};'use strict';var rp=require(_0x9e6a('0x0'));var util=require('util');var _=require(_0x9e6a('0x1'));var Mustache=require(_0x9e6a('0x2'));var logger=require(_0x9e6a('0x3'))(_0x9e6a('0x4'));exports[_0x9e6a('0x5')]=function(_0x5d3dd2,_0x3cc0fe){var _0x127012,_0x69ea5e;var _0x13d639={'method':_0x5d3dd2['data1']['toUpperCase'](),'uri':Mustache[_0x9e6a('0x6')](_0x5d3dd2['data2'],_0x3cc0fe),'json':!![],'resolveWithFullResponse':!![],'timeout':typeof parseInt(_0x5d3dd2[_0x9e6a('0x7')])===_0x9e6a('0x8')&&parseInt(_0x5d3dd2[_0x9e6a('0x7')])>=0x1&&parseInt(_0x5d3dd2[_0x9e6a('0x7')])<=0xa?parseInt(_0x5d3dd2[_0x9e6a('0x7')])*0x3e8:0x5*0x3e8};try{_0x13d639[_0x9e6a('0x9')]=_0x5d3dd2[_0x9e6a('0xa')]?JSON[_0x9e6a('0xb')](Mustache[_0x9e6a('0x6')](_0x5d3dd2[_0x9e6a('0xa')],_0x3cc0fe)):{};}catch(_0x43c823){logger[_0x9e6a('0xc')](_0x43c823[_0x9e6a('0xd')]);}switch(_0x5d3dd2[_0x9e6a('0xe')][_0x9e6a('0xf')]()){case _0x9e6a('0x10'):case _0x9e6a('0x11'):_0x127012=null;_0x13d639['qs']=_0x3cc0fe;break;case'POST':case _0x9e6a('0x12'):if(_0x5d3dd2[_0x9e6a('0x13')]){try{_0x127012=JSON['parse'](Mustache['render'](_0x5d3dd2[_0x9e6a('0x13')],_0x3cc0fe));_0x13d639[_0x9e6a('0x14')]=_0x127012;}catch(_0xd8273){logger[_0x9e6a('0xc')](_0xd8273['stack']);logger[_0x9e6a('0xc')](_0x9e6a('0x15'));}}else{_0x127012=_0x3cc0fe;_0x13d639['body']=_0x127012;}break;}logger[_0x9e6a('0x16')](util[_0x9e6a('0x17')](_0x9e6a('0x18'),_0x5d3dd2[_0x9e6a('0xe')],_0x5d3dd2[_0x9e6a('0x19')],JSON[_0x9e6a('0x1a')](_0x13d639)));rp(_0x13d639)[_0x9e6a('0x1b')](function(_0x327ef5){_0x127012=!_['isNil'](_0x127012)?_0x9e6a('0x1c')+_0x127012:'';_0x69ea5e=typeof _0x327ef5['body']==='object'?JSON[_0x9e6a('0x1a')](_0x327ef5[_0x9e6a('0x14')]):_0x327ef5[_0x9e6a('0x14')];logger[_0x9e6a('0x16')](util[_0x9e6a('0x17')]('%s\x20%s\x20succeeded\x20with\x20status:\x20%d\x20and\x20response:\x20%s',_0x5d3dd2[_0x9e6a('0xe')],_0x5d3dd2['data2'],_0x327ef5[_0x9e6a('0x1d')],_0x69ea5e));})[_0x9e6a('0x1e')](function(_0x2e892a){logger[_0x9e6a('0xc')](util[_0x9e6a('0x17')](_0x9e6a('0x1f'),_0x5d3dd2[_0x9e6a('0xe')],_0x5d3dd2[_0x9e6a('0x19')],_0x2e892a[_0x9e6a('0x1d')],_0x2e892a[_0x9e6a('0x20')],_0x2e892a['message']));});}; \ No newline at end of file diff --git a/server/services/email/client.js b/server/services/email/client.js index c43bf4b..5016fee 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 _0x7aec=['message','result','catch','exports','jayson/promise','../../config/logger','routing','client','http','Request','request','then','error','rpc'];(function(_0x14477e,_0x44d4da){var _0x5d4a05=function(_0x5e0fa3){while(--_0x5e0fa3){_0x14477e['push'](_0x14477e['shift']());}};_0x5d4a05(++_0x44d4da);}(_0x7aec,0x1e0));var _0xc7ae=function(_0x2aec52,_0x59d962){_0x2aec52=_0x2aec52-0x0;var _0x3b8835=_0x7aec[_0x2aec52];return _0x3b8835;};'use strict';var jayson=require(_0xc7ae('0x0'));var BPromise=require('bluebird');var logger=require(_0xc7ae('0x1'))(_0xc7ae('0x2'));var client=jayson[_0xc7ae('0x3')][_0xc7ae('0x4')]({'port':0x2329});client[_0xc7ae('0x5')]=function(_0x359eb8,_0x1e59bf){return new BPromise(function(_0x352071,_0x37db7f){return client[_0xc7ae('0x6')](_0x359eb8,_0x1e59bf)[_0xc7ae('0x7')](function(_0x395da4){logger['debug']('rpc','routing',_0x359eb8,_0x1e59bf,_0x395da4);if(_0x395da4[_0xc7ae('0x8')]){logger[_0xc7ae('0x8')](_0xc7ae('0x9'),_0xc7ae('0x2'),_0x359eb8,_0x395da4[_0xc7ae('0x8')][_0xc7ae('0xa')],_0x1e59bf);return _0x37db7f(_0x395da4[_0xc7ae('0x8')]['message']);}else{return _0x352071(_0x395da4[_0xc7ae('0xb')]);}})[_0xc7ae('0xc')](function(_0x1e0370){logger[_0xc7ae('0x8')](_0xc7ae('0x9'),_0xc7ae('0x2'),_0x359eb8,_0x1e0370,_0x1e59bf);return _0x37db7f(_0x1e0370);});});};module[_0xc7ae('0xd')]=client; \ No newline at end of file +var _0x65fd=['error','message','result','catch','exports','jayson/promise','routing','client','http','Request','request','then','rpc'];(function(_0x6d68a2,_0xb91108){var _0x468717=function(_0x380717){while(--_0x380717){_0x6d68a2['push'](_0x6d68a2['shift']());}};_0x468717(++_0xb91108);}(_0x65fd,0x7a));var _0xd65f=function(_0x1a19f9,_0x46dfe4){_0x1a19f9=_0x1a19f9-0x0;var _0x1e7d9e=_0x65fd[_0x1a19f9];return _0x1e7d9e;};'use strict';var jayson=require(_0xd65f('0x0'));var BPromise=require('bluebird');var logger=require('../../config/logger')(_0xd65f('0x1'));var client=jayson[_0xd65f('0x2')][_0xd65f('0x3')]({'port':0x2329});client[_0xd65f('0x4')]=function(_0xd98eea,_0x185660){return new BPromise(function(_0x3b93b0,_0x2783c5){return client[_0xd65f('0x5')](_0xd98eea,_0x185660)[_0xd65f('0x6')](function(_0x3ba55f){logger['debug'](_0xd65f('0x7'),_0xd65f('0x1'),_0xd98eea,_0x185660,_0x3ba55f);if(_0x3ba55f[_0xd65f('0x8')]){logger[_0xd65f('0x8')]('rpc',_0xd65f('0x1'),_0xd98eea,_0x3ba55f['error']['message'],_0x185660);return _0x2783c5(_0x3ba55f[_0xd65f('0x8')][_0xd65f('0x9')]);}else{return _0x3b93b0(_0x3ba55f[_0xd65f('0xa')]);}})[_0xd65f('0xb')](function(_0x56a0d5){logger[_0xd65f('0x8')](_0xd65f('0x7'),_0xd65f('0x1'),_0xd98eea,_0x56a0d5,_0x185660);return _0x2783c5(_0x56a0d5);});});};module[_0xd65f('0xc')]=client; \ No newline at end of file diff --git a/server/services/email/index.js b/server/services/email/index.js index d2cccfd..8055411 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 _0x8468=['getMailAccounts','refresh','mailAccounts','listen','Email\x20service\x20initialization','./server','./realtime','./lib/email','./rpc/mailAccount','../../config/logger','email','then'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0x8468,0x95));var _0x8846=function(_0x38f481,_0x5a4ebf){_0x38f481=_0x38f481-0x0;var _0x574b89=_0x8468[_0x38f481];return _0x574b89;};'use strict';var server=require(_0x8846('0x0'));var Realtime=require(_0x8846('0x1'));var EmailChannel=require(_0x8846('0x2'));var mailAccount=require(_0x8846('0x3'));var setting=require('./rpc/setting');var logger=require(_0x8846('0x4'))(_0x8846('0x5'));var realtime=new Realtime();var email=new EmailChannel(realtime);function initRealtime(){return Promise['resolve']()[_0x8846('0x6')](mailAccount[_0x8846('0x7')]())[_0x8846('0x6')](realtime['initMailAccounts']())[_0x8846('0x6')](function(){email[_0x8846('0x8')](realtime[_0x8846('0x9')]);return realtime;});}function main(){return server[_0x8846('0xa')](realtime,email)[_0x8846('0x6')](function(){return initRealtime();})[_0x8846('0x6')](function(){return setting['getSettings']();})[_0x8846('0x6')](function(_0x2dfa2b){return setInterval(initRealtime,_0x2dfa2b['loginMailFrequency']*0x3e8);})['catch'](function(_0x316907){logger['error'](_0x8846('0xb'),_0x316907);});}main(); \ No newline at end of file +var _0xa812=['loginMailFrequency','catch','Email\x20service\x20initialization','./realtime','./lib/email','./rpc/mailAccount','./rpc/setting','email','resolve','then','getMailAccounts'];(function(_0x4be27a,_0x208578){var _0x10de26=function(_0x551f30){while(--_0x551f30){_0x4be27a['push'](_0x4be27a['shift']());}};_0x10de26(++_0x208578);}(_0xa812,0x12c));var _0x2a81=function(_0x11005e,_0x20c3d2){_0x11005e=_0x11005e-0x0;var _0x29338f=_0xa812[_0x11005e];return _0x29338f;};'use strict';var server=require('./server');var Realtime=require(_0x2a81('0x0'));var EmailChannel=require(_0x2a81('0x1'));var mailAccount=require(_0x2a81('0x2'));var setting=require(_0x2a81('0x3'));var logger=require('../../config/logger')(_0x2a81('0x4'));var realtime=new Realtime();var email=new EmailChannel(realtime);function initRealtime(){return Promise[_0x2a81('0x5')]()[_0x2a81('0x6')](mailAccount[_0x2a81('0x7')]())[_0x2a81('0x6')](realtime['initMailAccounts']())[_0x2a81('0x6')](function(){email['refresh'](realtime['mailAccounts']);return realtime;});}function main(){return server['listen'](realtime,email)['then'](function(){return initRealtime();})[_0x2a81('0x6')](function(){return setting['getSettings']();})[_0x2a81('0x6')](function(_0x37d3f5){return setInterval(initRealtime,_0x37d3f5[_0x2a81('0x8')]*0x3e8);})[_0x2a81('0x9')](function(_0x5adf84){logger['error'](_0x2a81('0xa'),_0x5adf84);});}main(); \ No newline at end of file diff --git a/server/services/email/lib/email.js b/server/services/email/lib/email.js index 71e5356..3c56f18 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 _0x366b=['send','verifySmtp','Smtp','verify','exports','moment','bluebird','ioredis','../../../config/environment','email','redis','defaults','localhost','./imap','./smtp','../rpc/mailAccount','mailAccounts','imapAccounts','smtp','prototype','emit','name','key','active','Imap','status','messageStatus','total','md5','mailAccount:update','refresh','provider','custom','service','hasOwnProperty','bind','end','disabled','handleImapBox','messages','handleImapEmail','info','New\x20email\x20from\x20%s\x20%s\x20%s\x20to\x20%s','notify','then','Mail\x20accepted\x20from\x20routing','catch','error','Mail\x20not\x20accepted\x20from\x20routing\x20%s','stringify','handleImapEnd','lastSync','sendMail'];(function(_0x2641f9,_0x26715f){var _0x585741=function(_0x2d1462){while(--_0x2d1462){_0x2641f9['push'](_0x2641f9['shift']());}};_0x585741(++_0x26715f);}(_0x366b,0x10e));var _0xb366=function(_0x33bc95,_0x2fed14){_0x33bc95=_0x33bc95-0x0;var _0x2f10a3=_0x366b[_0x33bc95];return _0x2f10a3;};'use strict';var _=require('lodash');var moment=require(_0xb366('0x0'));var BPromise=require(_0xb366('0x1'));var md5=require('md5');var Redis=require(_0xb366('0x2'));var config=require(_0xb366('0x3'));var logger=require('../../../config/logger')(_0xb366('0x4'));config[_0xb366('0x5')]=_[_0xb366('0x6')](config['redis'],{'host':_0xb366('0x7'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0xb366('0x5')]));var EmailImap=require(_0xb366('0x8'));var EmailSmtp=require(_0xb366('0x9'));var mailAccount=require(_0xb366('0xa'));var md5Accounts={};function EmailChannel(_0x290dba){logger['info']('start\x20email\x20channel');this[_0xb366('0xb')]=_0x290dba[_0xb366('0xb')];this[_0xb366('0xc')]={};this[_0xb366('0xd')]=new EmailSmtp();}EmailChannel[_0xb366('0xe')][_0xb366('0xf')]=function(_0x4c010d){var _0x5bb9a0=this[_0xb366('0xb')][_0x4c010d];var _0x1933af={'id':_0x5bb9a0['id'],'name':_0x5bb9a0[_0xb366('0x10')],'key':_0x5bb9a0[_0xb366('0x11')],'active':_0x5bb9a0[_0xb366('0x12')],'Imap':{'status':_0x5bb9a0[_0xb366('0x13')][_0xb366('0x14')],'messageStatus':_0x5bb9a0['Imap'][_0xb366('0x15')],'total':_0x5bb9a0[_0xb366('0x13')][_0xb366('0x16')]}};if(_['isNil'](md5Accounts[_0x4c010d])){md5Accounts[_0x4c010d]={};}var _0x357de1=md5(JSON['stringify'](_0x1933af));if(md5Accounts[_0x4c010d][_0xb366('0x17')]!==_0x357de1){md5Accounts[_0x4c010d]['md5']=_0x357de1;io[_0xb366('0xf')](_0xb366('0x18'),_0x1933af);}};EmailChannel[_0xb366('0xe')][_0xb366('0x19')]=function(_0x2c6706){for(var _0x3e6915 in _0x2c6706){if(_0x2c6706['hasOwnProperty'](_0x3e6915)){if(_0x2c6706[_0x3e6915][_0xb366('0x13')]&&_0x2c6706[_0x3e6915][_0xb366('0x12')]){var _0x55558d=_0x2c6706[_0x3e6915][_0xb366('0x13')];if(!_0x55558d['service']&&_0x2c6706[_0x3e6915][_0xb366('0x1a')]!==_0xb366('0x1b'))_0x55558d[_0xb366('0x1c')]=_0x2c6706[_0x3e6915][_0xb366('0x1a')];if(!this[_0xb366('0xc')][_0xb366('0x1d')](_0x55558d['id'])){this[_0xb366('0xc')][_0x55558d['id']]=new EmailImap(_0x55558d,_0x2c6706[_0x3e6915][_0xb366('0x4')]);this['imapAccounts'][_0x55558d['id']]['on']('box',this['handleImapBox'][_0xb366('0x1e')](this,_0x3e6915));this[_0xb366('0xc')][_0x55558d['id']]['on'](_0xb366('0x4'),this['handleImapEmail'][_0xb366('0x1e')](this,_0x3e6915));this[_0xb366('0xc')][_0x55558d['id']]['on'](_0xb366('0x1f'),this['handleImapEnd'][_0xb366('0x1e')](this,_0x3e6915));this[_0xb366('0xc')][_0x55558d['id']]['on']('error',this['handleImapError'][_0xb366('0x1e')](this,_0x3e6915));}}else{if(_['isNil'](this['mailAccounts'][_0x3e6915][_0xb366('0x13')])){this[_0xb366('0xb')][_0x3e6915]['Imap']={};}this['mailAccounts'][_0x3e6915][_0xb366('0x13')][_0xb366('0x14')]=_0xb366('0x20');this['mailAccounts'][_0x3e6915][_0xb366('0x13')][_0xb366('0x15')]='';this[_0xb366('0xf')](_0x3e6915);}}}};EmailChannel[_0xb366('0xe')][_0xb366('0x21')]=function(_0x242d9b,_0x2bbb9b){if(this[_0xb366('0xb')][_0x242d9b]){this[_0xb366('0xb')][_0x242d9b][_0xb366('0x13')][_0xb366('0x14')]='connected';this[_0xb366('0xb')][_0x242d9b][_0xb366('0x13')]['messageStatus']=_0x2bbb9b[_0xb366('0x10')];if(_0x2bbb9b[_0xb366('0x22')]){this[_0xb366('0xb')][_0x242d9b][_0xb366('0x13')]['total']=_0x2bbb9b['messages']['total'];}return this[_0xb366('0xf')](_0x242d9b);}};EmailChannel[_0xb366('0xe')][_0xb366('0x23')]=function(_0x101ba4,_0x595014){logger[_0xb366('0x24')](_0xb366('0x25'),_0x595014['firstName'],_0x595014['lastName'],_0x595014['from'],_0x101ba4);if(this[_0xb366('0xb')][_0x101ba4]){return mailAccount[_0xb366('0x26')](_0x101ba4,_0x595014)[_0xb366('0x27')](function(_0xc0440b){if(_0xc0440b){logger[_0xb366('0x24')](_0xb366('0x28'));}})[_0xb366('0x29')](function(_0x35e95f){logger[_0xb366('0x2a')](_0xb366('0x2b'),JSON[_0xb366('0x2c')](_0x35e95f));});}};EmailChannel[_0xb366('0xe')][_0xb366('0x2d')]=function(_0x417aec){if(this[_0xb366('0xb')][_0x417aec]&&this['mailAccounts'][_0x417aec][_0xb366('0x13')]){if(this[_0xb366('0xc')][this[_0xb366('0xb')][_0x417aec][_0xb366('0x13')]['id']]){delete this[_0xb366('0xc')][this[_0xb366('0xb')][_0x417aec][_0xb366('0x13')]['id']];}this[_0xb366('0xb')][_0x417aec][_0xb366('0x13')][_0xb366('0x2e')]=moment();this[_0xb366('0xf')](_0x417aec);}};EmailChannel['prototype']['handleImapError']=function(_0x40f265,_0x558c88){if(this[_0xb366('0xb')][_0x40f265]){this[_0xb366('0xb')][_0x40f265]['Imap'][_0xb366('0x14')]='error';this['mailAccounts'][_0x40f265][_0xb366('0x13')]['messageStatus']=_0x558c88;return this[_0xb366('0xf')](_0x40f265);}};EmailChannel['prototype'][_0xb366('0x2f')]=function(_0x115af5,_0x4aa0ec){return this['smtp'][_0xb366('0x30')](_0x115af5,_0x4aa0ec);};EmailChannel[_0xb366('0xe')][_0xb366('0x31')]=function(_0x3fb084){var _0x349afc=this;if(this[_0xb366('0xb')][_0x3fb084['id']]){if(_['isNil'](this[_0xb366('0xb')][_0x3fb084['id']][_0xb366('0x32')])){this[_0xb366('0xb')][_0x3fb084['id']][_0xb366('0x32')]={};}this['mailAccounts'][_0x3fb084['id']][_0xb366('0x32')]['lastSync']=moment();return new BPromise(function(_0x295f89,_0x30192d){return _0x349afc['smtp'][_0xb366('0x33')](_0x3fb084)['then'](function(_0x194286){_0x349afc[_0xb366('0xb')][_0x3fb084['id']]['Smtp'][_0xb366('0x14')]='verified';_0x349afc[_0xb366('0xb')][_0x3fb084['id']][_0xb366('0x32')][_0xb366('0x15')]='';_0x349afc[_0xb366('0xf')](_0x3fb084['id']);_0x295f89(_0x194286);})[_0xb366('0x29')](function(_0xf7d715){_0x349afc[_0xb366('0xb')][_0x3fb084['id']]['Smtp'][_0xb366('0x14')]=_0xb366('0x2a');_0x349afc[_0xb366('0xb')][_0x3fb084['id']][_0xb366('0x32')][_0xb366('0x15')]=_0xf7d715;_0x349afc['emit'](_0x3fb084['id']);_0x30192d(_0xf7d715);});});}return this[_0xb366('0xd')][_0xb366('0x33')](_0x3fb084);};module[_0xb366('0x34')]=EmailChannel; \ No newline at end of file +var _0xd3f4=['stringify','refresh','hasOwnProperty','service','custom','provider','email','box','bind','end','handleImapEnd','disabled','handleImapBox','messages','total','handleImapEmail','New\x20email\x20from\x20%s\x20%s\x20%s\x20to\x20%s','firstName','lastName','from','notify','then','Mail\x20accepted\x20from\x20routing','error','lastSync','sendMail','send','verifySmtp','verify','Smtp','lodash','moment','bluebird','md5','ioredis','../../../config/environment','redis','./smtp','../rpc/mailAccount','info','mailAccounts','imapAccounts','smtp','prototype','emit','key','active','Imap','status','messageStatus','isNil'];(function(_0x157e68,_0x34ea6c){var _0x5651d9=function(_0x461ff9){while(--_0x461ff9){_0x157e68['push'](_0x157e68['shift']());}};_0x5651d9(++_0x34ea6c);}(_0xd3f4,0x1e9));var _0x4d3f=function(_0x4eb53e,_0x22a6a8){_0x4eb53e=_0x4eb53e-0x0;var _0x2caf7d=_0xd3f4[_0x4eb53e];return _0x2caf7d;};'use strict';var _=require(_0x4d3f('0x0'));var moment=require(_0x4d3f('0x1'));var BPromise=require(_0x4d3f('0x2'));var md5=require(_0x4d3f('0x3'));var Redis=require(_0x4d3f('0x4'));var config=require(_0x4d3f('0x5'));var logger=require('../../../config/logger')('email');config[_0x4d3f('0x6')]=_['defaults'](config['redis'],{'host':'localhost','port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0x4d3f('0x6')]));var EmailImap=require('./imap');var EmailSmtp=require(_0x4d3f('0x7'));var mailAccount=require(_0x4d3f('0x8'));var md5Accounts={};function EmailChannel(_0x35f556){logger[_0x4d3f('0x9')]('start\x20email\x20channel');this['mailAccounts']=_0x35f556[_0x4d3f('0xa')];this[_0x4d3f('0xb')]={};this[_0x4d3f('0xc')]=new EmailSmtp();}EmailChannel[_0x4d3f('0xd')][_0x4d3f('0xe')]=function(_0x343aca){var _0x480bd3=this['mailAccounts'][_0x343aca];var _0x12311f={'id':_0x480bd3['id'],'name':_0x480bd3['name'],'key':_0x480bd3[_0x4d3f('0xf')],'active':_0x480bd3[_0x4d3f('0x10')],'Imap':{'status':_0x480bd3[_0x4d3f('0x11')][_0x4d3f('0x12')],'messageStatus':_0x480bd3[_0x4d3f('0x11')][_0x4d3f('0x13')],'total':_0x480bd3[_0x4d3f('0x11')]['total']}};if(_[_0x4d3f('0x14')](md5Accounts[_0x343aca])){md5Accounts[_0x343aca]={};}var _0x2f8e54=md5(JSON[_0x4d3f('0x15')](_0x12311f));if(md5Accounts[_0x343aca][_0x4d3f('0x3')]!==_0x2f8e54){md5Accounts[_0x343aca][_0x4d3f('0x3')]=_0x2f8e54;io[_0x4d3f('0xe')]('mailAccount:update',_0x12311f);}};EmailChannel['prototype'][_0x4d3f('0x16')]=function(_0xbdb2da){for(var _0x4ed2eb in _0xbdb2da){if(_0xbdb2da[_0x4d3f('0x17')](_0x4ed2eb)){if(_0xbdb2da[_0x4ed2eb][_0x4d3f('0x11')]&&_0xbdb2da[_0x4ed2eb]['active']){var _0x40b90f=_0xbdb2da[_0x4ed2eb]['Imap'];if(!_0x40b90f[_0x4d3f('0x18')]&&_0xbdb2da[_0x4ed2eb]['provider']!==_0x4d3f('0x19'))_0x40b90f[_0x4d3f('0x18')]=_0xbdb2da[_0x4ed2eb][_0x4d3f('0x1a')];if(!this['imapAccounts'][_0x4d3f('0x17')](_0x40b90f['id'])){this['imapAccounts'][_0x40b90f['id']]=new EmailImap(_0x40b90f,_0xbdb2da[_0x4ed2eb][_0x4d3f('0x1b')]);this[_0x4d3f('0xb')][_0x40b90f['id']]['on'](_0x4d3f('0x1c'),this['handleImapBox'][_0x4d3f('0x1d')](this,_0x4ed2eb));this[_0x4d3f('0xb')][_0x40b90f['id']]['on'](_0x4d3f('0x1b'),this['handleImapEmail'][_0x4d3f('0x1d')](this,_0x4ed2eb));this[_0x4d3f('0xb')][_0x40b90f['id']]['on'](_0x4d3f('0x1e'),this[_0x4d3f('0x1f')]['bind'](this,_0x4ed2eb));this[_0x4d3f('0xb')][_0x40b90f['id']]['on']('error',this['handleImapError'][_0x4d3f('0x1d')](this,_0x4ed2eb));}}else{if(_[_0x4d3f('0x14')](this[_0x4d3f('0xa')][_0x4ed2eb]['Imap'])){this[_0x4d3f('0xa')][_0x4ed2eb]['Imap']={};}this[_0x4d3f('0xa')][_0x4ed2eb][_0x4d3f('0x11')]['status']=_0x4d3f('0x20');this['mailAccounts'][_0x4ed2eb][_0x4d3f('0x11')][_0x4d3f('0x13')]='';this['emit'](_0x4ed2eb);}}}};EmailChannel[_0x4d3f('0xd')][_0x4d3f('0x21')]=function(_0x1ee2d5,_0x5474c3){if(this[_0x4d3f('0xa')][_0x1ee2d5]){this[_0x4d3f('0xa')][_0x1ee2d5][_0x4d3f('0x11')][_0x4d3f('0x12')]='connected';this[_0x4d3f('0xa')][_0x1ee2d5][_0x4d3f('0x11')][_0x4d3f('0x13')]=_0x5474c3['name'];if(_0x5474c3[_0x4d3f('0x22')]){this[_0x4d3f('0xa')][_0x1ee2d5][_0x4d3f('0x11')][_0x4d3f('0x23')]=_0x5474c3['messages'][_0x4d3f('0x23')];}return this[_0x4d3f('0xe')](_0x1ee2d5);}};EmailChannel[_0x4d3f('0xd')][_0x4d3f('0x24')]=function(_0x4af5e8,_0x2f63b0){logger[_0x4d3f('0x9')](_0x4d3f('0x25'),_0x2f63b0[_0x4d3f('0x26')],_0x2f63b0[_0x4d3f('0x27')],_0x2f63b0[_0x4d3f('0x28')],_0x4af5e8);if(this[_0x4d3f('0xa')][_0x4af5e8]){return mailAccount[_0x4d3f('0x29')](_0x4af5e8,_0x2f63b0)[_0x4d3f('0x2a')](function(_0x32d212){if(_0x32d212){logger['info'](_0x4d3f('0x2b'));}})['catch'](function(_0x206d48){logger[_0x4d3f('0x2c')]('Mail\x20not\x20accepted\x20from\x20routing\x20%s',JSON[_0x4d3f('0x15')](_0x206d48));});}};EmailChannel[_0x4d3f('0xd')]['handleImapEnd']=function(_0x4ce3bf){if(this[_0x4d3f('0xa')][_0x4ce3bf]&&this[_0x4d3f('0xa')][_0x4ce3bf][_0x4d3f('0x11')]){if(this[_0x4d3f('0xb')][this[_0x4d3f('0xa')][_0x4ce3bf][_0x4d3f('0x11')]['id']]){delete this['imapAccounts'][this[_0x4d3f('0xa')][_0x4ce3bf][_0x4d3f('0x11')]['id']];}this[_0x4d3f('0xa')][_0x4ce3bf][_0x4d3f('0x11')][_0x4d3f('0x2d')]=moment();this[_0x4d3f('0xe')](_0x4ce3bf);}};EmailChannel[_0x4d3f('0xd')]['handleImapError']=function(_0x5f5cd0,_0x4f6f98){if(this['mailAccounts'][_0x5f5cd0]){this['mailAccounts'][_0x5f5cd0]['Imap'][_0x4d3f('0x12')]='error';this['mailAccounts'][_0x5f5cd0][_0x4d3f('0x11')][_0x4d3f('0x13')]=_0x4f6f98;return this[_0x4d3f('0xe')](_0x5f5cd0);}};EmailChannel[_0x4d3f('0xd')][_0x4d3f('0x2e')]=function(_0x2d7a49,_0x5206ad){return this[_0x4d3f('0xc')][_0x4d3f('0x2f')](_0x2d7a49,_0x5206ad);};EmailChannel[_0x4d3f('0xd')][_0x4d3f('0x30')]=function(_0x4e59f9){var _0xed8748=this;if(this[_0x4d3f('0xa')][_0x4e59f9['id']]){if(_[_0x4d3f('0x14')](this[_0x4d3f('0xa')][_0x4e59f9['id']]['Smtp'])){this[_0x4d3f('0xa')][_0x4e59f9['id']]['Smtp']={};}this['mailAccounts'][_0x4e59f9['id']]['Smtp']['lastSync']=moment();return new BPromise(function(_0x3cfc6c,_0x58947d){return _0xed8748[_0x4d3f('0xc')][_0x4d3f('0x31')](_0x4e59f9)['then'](function(_0x35bd0e){_0xed8748[_0x4d3f('0xa')][_0x4e59f9['id']][_0x4d3f('0x32')][_0x4d3f('0x12')]='verified';_0xed8748['mailAccounts'][_0x4e59f9['id']][_0x4d3f('0x32')][_0x4d3f('0x13')]='';_0xed8748['emit'](_0x4e59f9['id']);_0x3cfc6c(_0x35bd0e);})['catch'](function(_0x5a470c){_0xed8748['mailAccounts'][_0x4e59f9['id']][_0x4d3f('0x32')]['status']=_0x4d3f('0x2c');_0xed8748[_0x4d3f('0xa')][_0x4e59f9['id']]['Smtp']['messageStatus']=_0x5a470c;_0xed8748[_0x4d3f('0xe')](_0x4e59f9['id']);_0x58947d(_0x5a470c);});});}return this['smtp'][_0x4d3f('0x31')](_0x4e59f9);};module['exports']=EmailChannel; \ No newline at end of file diff --git a/server/services/email/lib/imap.js b/server/services/email/lib/imap.js index 9a21f36..17fee40 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 _0x008e=['required','openBox','handleOpenBox','bind','handleError','emit','readUnseen','handleCloseBox','search','UNSEEN','handleReadUnseen','length','fetch','handleFetchMessage','handleFetchError','end','closeBox','body','handleMessageBody','attributes','handleMessageAttributes','handleMessageEnd','parser','textCode','hasOwnProperty','upperFirst','util','imap','simpleParser','iconv','Iconv','events','EventEmitter','../../../config/logger','mailbox','account','once','handleReady','handleEnd','error','connect','inherits','prototype','getAccount','connTimeout','authTimeout','service','user','modernAuthentication','xoauth2','generateXOAuth2Token','CloudProvider','password','authentication','email','anonymous@xcally.com','host','port','tls','autotls'];(function(_0x5447c1,_0x3635ab){var _0x3ebcab=function(_0x10178c){while(--_0x10178c){_0x5447c1['push'](_0x5447c1['shift']());}};_0x3ebcab(++_0x3635ab);}(_0x008e,0x182));var _0xe008=function(_0x358365,_0x259198){_0x358365=_0x358365-0x0;var _0x476c61=_0x008e[_0x358365];return _0x476c61;};'use strict';var _=require('lodash');var util=require(_0xe008('0x0'));var Imap=require(_0xe008('0x1'));var simpleParser=require('mailparser')[_0xe008('0x2')];var Iconv=require(_0xe008('0x3'))[_0xe008('0x4')];var EventEmitter=require(_0xe008('0x5'))[_0xe008('0x6')];var utils=require('./utils');var logger=require(_0xe008('0x7'))('email');function EmailImap(_0x59da9e,_0x2a7db8){this['mailbox']=_0x59da9e[_0xe008('0x8')];this[_0xe008('0x9')]=this['getAccount'](_0x59da9e,_0x2a7db8);this['imap']=new Imap(this[_0xe008('0x9')]);this[_0xe008('0x1')][_0xe008('0xa')]('ready',this[_0xe008('0xb')]['bind'](this));this[_0xe008('0x1')][_0xe008('0xa')]('end',this[_0xe008('0xc')]['bind'](this));this[_0xe008('0x1')]['on'](_0xe008('0xd'),this['handleError']['bind'](this));this[_0xe008('0x1')][_0xe008('0xe')]();}util[_0xe008('0xf')](EmailImap,EventEmitter);EmailImap[_0xe008('0x10')][_0xe008('0x11')]=function(_0x5bea92,_0x122cd3){var _0x165f9a={'connTimeout':_0x5bea92[_0xe008('0x12')]?_0x5bea92[_0xe008('0x12')]*0x3e8:0x2710,'authTimeout':_0x5bea92['authTimeout']?_0x5bea92[_0xe008('0x13')]*0x3e8:0x1388};if(_0x5bea92[_0xe008('0x14')]){_0x165f9a[_0xe008('0x15')]=_0x5bea92[_0xe008('0x15')];if(_0x5bea92[_0xe008('0x16')]){_0x165f9a[_0xe008('0x17')]=utils[_0xe008('0x18')](_0x5bea92[_0xe008('0x19')]['data5'],_0x5bea92[_0xe008('0x15')]);}else{_0x165f9a[_0xe008('0x1a')]=_0x5bea92[_0xe008('0x1a')];}}else{if(_0x5bea92[_0xe008('0x1b')]){_0x165f9a[_0xe008('0x15')]=_0x5bea92[_0xe008('0x15')];_0x165f9a[_0xe008('0x1a')]=_0x5bea92[_0xe008('0x1a')];}}_0x165f9a[_0xe008('0x1c')]=_0x122cd3||_0x5bea92[_0xe008('0x15')]||_0xe008('0x1d');_0x165f9a[_0xe008('0x1e')]=_0x5bea92[_0xe008('0x1e')];_0x165f9a[_0xe008('0x1f')]=_0x5bea92[_0xe008('0x1f')]||0x3e1;if(_0x5bea92[_0xe008('0x20')]){_0x165f9a[_0xe008('0x20')]=!![];}else{_0x165f9a[_0xe008('0x20')]=![];_0x165f9a[_0xe008('0x21')]=_0xe008('0x22');}return _0x165f9a;};EmailImap['prototype'][_0xe008('0xb')]=function(){this[_0xe008('0x1')][_0xe008('0x23')](this['mailbox'],![],this[_0xe008('0x24')][_0xe008('0x25')](this));};EmailImap[_0xe008('0x10')][_0xe008('0x24')]=function(_0x4553a2,_0x161da8){if(_0x4553a2){this[_0xe008('0x26')](_0x4553a2,!![]);}else{this[_0xe008('0x27')]('box',_0x161da8);this[_0xe008('0x28')]();}};EmailImap['prototype'][_0xe008('0x29')]=function(_0x12d8f5){if(_0x12d8f5){this[_0xe008('0x26')](_0x12d8f5,!![]);}else{this[_0xe008('0x1')]['end']();}};EmailImap[_0xe008('0x10')][_0xe008('0x28')]=function(){this[_0xe008('0x1')][_0xe008('0x2a')]([_0xe008('0x2b')],this[_0xe008('0x2c')][_0xe008('0x25')](this));};EmailImap[_0xe008('0x10')]['handleReadUnseen']=function(_0x6f83af,_0x4f8098){if(_0x6f83af){this[_0xe008('0x26')](_0x6f83af,!![]);}else{if(_0x4f8098[_0xe008('0x2d')]){try{var _0x104b4b=this[_0xe008('0x1')][_0xe008('0x2e')](_0x4f8098,{'bodies':'','markSeen':!![]});_0x104b4b['on']('message',this[_0xe008('0x2f')][_0xe008('0x25')](this));_0x104b4b[_0xe008('0xa')]('error',this[_0xe008('0x30')][_0xe008('0x25')](this));_0x104b4b[_0xe008('0xa')](_0xe008('0x31'),this['handleFetchEnd']['bind'](this));}catch(_0x4752b4){logger[_0xe008('0xd')](_0x4752b4);}}else{this[_0xe008('0x1')][_0xe008('0x32')](!![],this[_0xe008('0x29')][_0xe008('0x25')](this));}}};EmailImap['prototype'][_0xe008('0x2f')]=function(_0x4a33c4){_0x4a33c4['on'](_0xe008('0x33'),this[_0xe008('0x34')][_0xe008('0x25')](this));_0x4a33c4[_0xe008('0xa')](_0xe008('0x35'),this[_0xe008('0x36')][_0xe008('0x25')](this));_0x4a33c4[_0xe008('0xa')]('end',this[_0xe008('0x37')]['bind'](this));};EmailImap[_0xe008('0x10')]['handleMessageBody']=function(_0x332174){simpleParser(_0x332174,{'Iconv':Iconv},this['handleSimpleParser'][_0xe008('0x25')](this));};EmailImap[_0xe008('0x10')][_0xe008('0x36')]=function(){};EmailImap['prototype'][_0xe008('0x37')]=function(){};EmailImap[_0xe008('0x10')]['handleSimpleParser']=function(_0x4d5195,_0x39458d){if(_0x4d5195){logger[_0xe008('0xd')](_0x4d5195);}else{var _0x33278b=this;utils[_0xe008('0x38')](this[_0xe008('0x9')],_0x39458d,function(_0x3d700e){_0x33278b[_0xe008('0x27')](_0xe008('0x1c'),_0x3d700e);});}};EmailImap[_0xe008('0x10')]['handleFetchEnd']=function(){this[_0xe008('0x1')][_0xe008('0x32')](!![],this[_0xe008('0x29')]['bind'](this));};EmailImap['prototype'][_0xe008('0x30')]=function(_0x5cc61){this[_0xe008('0x26')](_0x5cc61);this[_0xe008('0x1')][_0xe008('0x32')](!![],this[_0xe008('0x29')]['bind'](this));};EmailImap['prototype'][_0xe008('0xc')]=function(){this[_0xe008('0x27')](_0xe008('0x31'));};EmailImap['prototype'][_0xe008('0x26')]=function(_0x9407a4,_0x503146){logger[_0xe008('0xd')](_0xe008('0x26'),this[_0xe008('0x9')][_0xe008('0x1c')],JSON['stringify'](_0x9407a4));var _0x16738e='';if(_0x9407a4){if(_0x9407a4[_0xe008('0x39')]){_0x16738e=_0x9407a4[_0xe008('0x39')];}else{for(var _0x58ff35 in _0x9407a4){if(_0x9407a4[_0xe008('0x3a')](_0x58ff35)){_0x16738e+=_[_0xe008('0x3b')](_0x58ff35)+':\x20'+_0x9407a4[_0x58ff35]+'\x0a';}}}}if(_0x503146){this[_0xe008('0x1')]['end']();}else{this[_0xe008('0x27')](_0xe008('0xd'),_0x16738e);this[_0xe008('0x27')](_0xe008('0x31'));}};module['exports']=EmailImap; \ No newline at end of file +var _0x8550=['handleMessageEnd','handleSimpleParser','parser','closeBox','textCode','upperFirst','exports','lodash','util','mailparser','simpleParser','iconv','Iconv','events','EventEmitter','../../../config/logger','email','mailbox','account','getAccount','imap','once','ready','bind','end','handleEnd','connect','inherits','prototype','connTimeout','authTimeout','service','user','modernAuthentication','generateXOAuth2Token','CloudProvider','data5','password','authentication','host','port','tls','autotls','required','handleReady','openBox','handleOpenBox','handleError','emit','box','readUnseen','search','UNSEEN','handleReadUnseen','length','message','handleFetchMessage','error','handleFetchError','handleFetchEnd','handleCloseBox','handleMessageAttributes'];(function(_0x4a9fb1,_0x273043){var _0x348672=function(_0x142b69){while(--_0x142b69){_0x4a9fb1['push'](_0x4a9fb1['shift']());}};_0x348672(++_0x273043);}(_0x8550,0x1b9));var _0x0855=function(_0x498a1f,_0x254434){_0x498a1f=_0x498a1f-0x0;var _0x1832bf=_0x8550[_0x498a1f];return _0x1832bf;};'use strict';var _=require(_0x0855('0x0'));var util=require(_0x0855('0x1'));var Imap=require('imap');var simpleParser=require(_0x0855('0x2'))[_0x0855('0x3')];var Iconv=require(_0x0855('0x4'))[_0x0855('0x5')];var EventEmitter=require(_0x0855('0x6'))[_0x0855('0x7')];var utils=require('./utils');var logger=require(_0x0855('0x8'))(_0x0855('0x9'));function EmailImap(_0x3c990e,_0x52186c){this['mailbox']=_0x3c990e[_0x0855('0xa')];this[_0x0855('0xb')]=this[_0x0855('0xc')](_0x3c990e,_0x52186c);this['imap']=new Imap(this['account']);this[_0x0855('0xd')][_0x0855('0xe')](_0x0855('0xf'),this['handleReady'][_0x0855('0x10')](this));this[_0x0855('0xd')][_0x0855('0xe')](_0x0855('0x11'),this[_0x0855('0x12')][_0x0855('0x10')](this));this[_0x0855('0xd')]['on']('error',this['handleError'][_0x0855('0x10')](this));this['imap'][_0x0855('0x13')]();}util[_0x0855('0x14')](EmailImap,EventEmitter);EmailImap[_0x0855('0x15')]['getAccount']=function(_0x301ddd,_0x257885){var _0x26d1c4={'connTimeout':_0x301ddd[_0x0855('0x16')]?_0x301ddd[_0x0855('0x16')]*0x3e8:0x2710,'authTimeout':_0x301ddd[_0x0855('0x17')]?_0x301ddd[_0x0855('0x17')]*0x3e8:0x1388};if(_0x301ddd[_0x0855('0x18')]){_0x26d1c4['user']=_0x301ddd[_0x0855('0x19')];if(_0x301ddd[_0x0855('0x1a')]){_0x26d1c4['xoauth2']=utils[_0x0855('0x1b')](_0x301ddd[_0x0855('0x1c')][_0x0855('0x1d')],_0x301ddd[_0x0855('0x19')]);}else{_0x26d1c4[_0x0855('0x1e')]=_0x301ddd['password'];}}else{if(_0x301ddd[_0x0855('0x1f')]){_0x26d1c4[_0x0855('0x19')]=_0x301ddd[_0x0855('0x19')];_0x26d1c4[_0x0855('0x1e')]=_0x301ddd[_0x0855('0x1e')];}}_0x26d1c4[_0x0855('0x9')]=_0x257885||_0x301ddd[_0x0855('0x19')]||'anonymous@xcally.com';_0x26d1c4[_0x0855('0x20')]=_0x301ddd[_0x0855('0x20')];_0x26d1c4[_0x0855('0x21')]=_0x301ddd['port']||0x3e1;if(_0x301ddd[_0x0855('0x22')]){_0x26d1c4[_0x0855('0x22')]=!![];}else{_0x26d1c4[_0x0855('0x22')]=![];_0x26d1c4[_0x0855('0x23')]=_0x0855('0x24');}return _0x26d1c4;};EmailImap['prototype'][_0x0855('0x25')]=function(){this[_0x0855('0xd')][_0x0855('0x26')](this[_0x0855('0xa')],![],this[_0x0855('0x27')][_0x0855('0x10')](this));};EmailImap['prototype']['handleOpenBox']=function(_0x24714f,_0x15f10d){if(_0x24714f){this[_0x0855('0x28')](_0x24714f,!![]);}else{this[_0x0855('0x29')](_0x0855('0x2a'),_0x15f10d);this['readUnseen']();}};EmailImap[_0x0855('0x15')]['handleCloseBox']=function(_0x2b2fff){if(_0x2b2fff){this[_0x0855('0x28')](_0x2b2fff,!![]);}else{this[_0x0855('0xd')]['end']();}};EmailImap[_0x0855('0x15')][_0x0855('0x2b')]=function(){this[_0x0855('0xd')][_0x0855('0x2c')]([_0x0855('0x2d')],this[_0x0855('0x2e')][_0x0855('0x10')](this));};EmailImap['prototype']['handleReadUnseen']=function(_0x5256d6,_0x5cf81b){if(_0x5256d6){this[_0x0855('0x28')](_0x5256d6,!![]);}else{if(_0x5cf81b[_0x0855('0x2f')]){try{var _0x96db71=this['imap']['fetch'](_0x5cf81b,{'bodies':'','markSeen':!![]});_0x96db71['on'](_0x0855('0x30'),this[_0x0855('0x31')][_0x0855('0x10')](this));_0x96db71[_0x0855('0xe')](_0x0855('0x32'),this[_0x0855('0x33')][_0x0855('0x10')](this));_0x96db71['once'](_0x0855('0x11'),this[_0x0855('0x34')][_0x0855('0x10')](this));}catch(_0x594944){logger[_0x0855('0x32')](_0x594944);}}else{this[_0x0855('0xd')]['closeBox'](!![],this[_0x0855('0x35')][_0x0855('0x10')](this));}}};EmailImap['prototype'][_0x0855('0x31')]=function(_0x24c17e){_0x24c17e['on']('body',this['handleMessageBody'][_0x0855('0x10')](this));_0x24c17e['once']('attributes',this[_0x0855('0x36')][_0x0855('0x10')](this));_0x24c17e[_0x0855('0xe')](_0x0855('0x11'),this[_0x0855('0x37')][_0x0855('0x10')](this));};EmailImap[_0x0855('0x15')]['handleMessageBody']=function(_0x31730c){simpleParser(_0x31730c,{'Iconv':Iconv},this[_0x0855('0x38')][_0x0855('0x10')](this));};EmailImap[_0x0855('0x15')]['handleMessageAttributes']=function(){};EmailImap[_0x0855('0x15')][_0x0855('0x37')]=function(){};EmailImap[_0x0855('0x15')][_0x0855('0x38')]=function(_0x4c4943,_0x460120){if(_0x4c4943){logger['error'](_0x4c4943);}else{var _0x290ca0=this;utils[_0x0855('0x39')](this[_0x0855('0xb')],_0x460120,function(_0x553b83){_0x290ca0[_0x0855('0x29')](_0x0855('0x9'),_0x553b83);});}};EmailImap[_0x0855('0x15')][_0x0855('0x34')]=function(){this['imap']['closeBox'](!![],this[_0x0855('0x35')][_0x0855('0x10')](this));};EmailImap[_0x0855('0x15')][_0x0855('0x33')]=function(_0x12a868){this[_0x0855('0x28')](_0x12a868);this[_0x0855('0xd')][_0x0855('0x3a')](!![],this[_0x0855('0x35')][_0x0855('0x10')](this));};EmailImap[_0x0855('0x15')][_0x0855('0x12')]=function(){this[_0x0855('0x29')](_0x0855('0x11'));};EmailImap[_0x0855('0x15')][_0x0855('0x28')]=function(_0x15b45f,_0x53df20){logger[_0x0855('0x32')]('handleError',this['account'][_0x0855('0x9')],JSON['stringify'](_0x15b45f));var _0x504048='';if(_0x15b45f){if(_0x15b45f[_0x0855('0x3b')]){_0x504048=_0x15b45f['textCode'];}else{for(var _0xd8f208 in _0x15b45f){if(_0x15b45f['hasOwnProperty'](_0xd8f208)){_0x504048+=_[_0x0855('0x3c')](_0xd8f208)+':\x20'+_0x15b45f[_0xd8f208]+'\x0a';}}}}if(_0x53df20){this['imap'][_0x0855('0x11')]();}else{this['emit']('error',_0x504048);this['emit'](_0x0855('0x11'));}};module[_0x0855('0x3d')]=EmailImap; \ No newline at end of file diff --git a/server/services/email/lib/smtp.js b/server/services/email/lib/smtp.js index d9335de..85177e6 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 _0x2693=['use','compile','toString','Not\x20verifired','nodemailer-plugin-inline-base64','prototype','createTransport'];(function(_0x999b85,_0x1edc2b){var _0x1d7124=function(_0x59cd29){while(--_0x59cd29){_0x999b85['push'](_0x999b85['shift']());}};_0x1d7124(++_0x1edc2b);}(_0x2693,0x14d));var _0x3269=function(_0x2795d9,_0x349289){_0x2795d9=_0x2795d9-0x0;var _0x29a3ec=_0x2693[_0x2795d9];return _0x29a3ec;};'use strict';var nodemailer=require('nodemailer');var inlineBase64=require(_0x3269('0x0'));function EmailSmtp(){}EmailSmtp[_0x3269('0x1')]['send']=function(_0x421555,_0x24b0c9){return new Promise(function(_0x340329,_0x11d090){var _0x5d5dcb=nodemailer[_0x3269('0x2')](_0x421555);_0x5d5dcb[_0x3269('0x3')](_0x3269('0x4'),inlineBase64());_0x5d5dcb['sendMail'](_0x24b0c9,function(_0x52e7cb,_0x92c3f3){if(_0x52e7cb){_0x11d090(_0x52e7cb[_0x3269('0x5')]());}else{_0x340329(_0x92c3f3);}});});};EmailSmtp['prototype']['verify']=function(_0x163d0b){return new Promise(function(_0x3070bb,_0x34db82){var _0x48761a=nodemailer[_0x3269('0x2')](_0x163d0b);_0x48761a['verify'](function(_0x27d923,_0x4c93e8){if(_0x27d923){_0x34db82(_0x27d923[_0x3269('0x5')]());}else{if(_0x4c93e8){_0x3070bb(_0x4c93e8);}else{_0x34db82(_0x3269('0x6'));}}});});};module['exports']=EmailSmtp; \ No newline at end of file +var _0xa5c9=['nodemailer-plugin-inline-base64','prototype','createTransport','use','compile','sendMail','toString','verify','Not\x20verifired','exports','nodemailer'];(function(_0x4b2ed9,_0x5a6e74){var _0xa3a1c9=function(_0x3f987f){while(--_0x3f987f){_0x4b2ed9['push'](_0x4b2ed9['shift']());}};_0xa3a1c9(++_0x5a6e74);}(_0xa5c9,0x18b));var _0x9a5c=function(_0x1b1e76,_0x31695b){_0x1b1e76=_0x1b1e76-0x0;var _0x3d743a=_0xa5c9[_0x1b1e76];return _0x3d743a;};'use strict';var nodemailer=require(_0x9a5c('0x0'));var inlineBase64=require(_0x9a5c('0x1'));function EmailSmtp(){}EmailSmtp[_0x9a5c('0x2')]['send']=function(_0x312d03,_0x3454a9){return new Promise(function(_0x1d69cb,_0x294c59){var _0x3c90c0=nodemailer[_0x9a5c('0x3')](_0x312d03);_0x3c90c0[_0x9a5c('0x4')](_0x9a5c('0x5'),inlineBase64());_0x3c90c0[_0x9a5c('0x6')](_0x3454a9,function(_0x54d70b,_0x8ee886){if(_0x54d70b){_0x294c59(_0x54d70b[_0x9a5c('0x7')]());}else{_0x1d69cb(_0x8ee886);}});});};EmailSmtp[_0x9a5c('0x2')]['verify']=function(_0x4ae692){return new Promise(function(_0x23d29c,_0x5da543){var _0x1d08f4=nodemailer[_0x9a5c('0x3')](_0x4ae692);_0x1d08f4[_0x9a5c('0x8')](function(_0x175355,_0x59ca35){if(_0x175355){_0x5da543(_0x175355[_0x9a5c('0x7')]());}else{if(_0x59ca35){_0x23d29c(_0x59ca35);}else{_0x5da543(_0x9a5c('0x9'));}}});});};module[_0x9a5c('0xa')]=EmailSmtp; \ No newline at end of file diff --git a/server/services/email/lib/utils.js b/server/services/email/lib/utils.js index 7470a99..214ec11 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 _0x846e=['Auto-Submitted:\x20auto-replied','X-Auto-Response-Suppress:\x20All','Precedence:\x20auto_reply','indexOf','line','parser','from','messageId','inReplyTo','date','YYYY-MM-DD\x20HH:mm:ss','textAsHtml','application/ms-tnef','info','Email\x20message\x20%s\x20is\x20in\x20TNEF\x20format:\x20message\x20content\x20will\x20be\x20converted\x20by\x20the\x20system','parseBuffer','content','

Empty\x20message

','Attachments','Data','generateXOAuth2Token','user=','auth=Bearer\x20','toString','base64','lodash','moment','randomstring','node-tnef','email','address','anonymous','generate','@xcally.com','head','value','name','slice','join','Anonymous','split','length','pop','isEmpty','test','html','replace','includes','forEach','push','_IMG','\x20]','body','0x1?_0x11fa7b[_0xe846('0xc')](0x0,-0x1)[_0xe846('0xd')]('\x20'):_0x59f058[_0xe846('0xb')];}return _0xe846('0xe');}function getLastName(_0x245a00){var _0x52fb27=_['head'](_0x245a00[_0xe846('0xa')]);if(_0x52fb27&&_0x52fb27['name']){var _0x39c444=_0x52fb27[_0xe846('0xb')][_0xe846('0xf')](/\s+/);return _0x39c444[_0xe846('0x10')]>0x1?_0x39c444[_0xe846('0x11')]():'';}return'';}function getMails(_0x11ee56,_0x20f938){var _0x987ecd='';for(var _0x248b07=0x0;_0x248b07<_0x20f938['value'][_0xe846('0x10')];_0x248b07+=0x1){if(_0x20f938[_0xe846('0xa')][_0x248b07][_0xe846('0x5')]!==_0x11ee56){if(!_[_0xe846('0x12')](_0x987ecd)){_0x987ecd+=',';}_0x987ecd+=_0x20f938['value'][_0x248b07]['name']||_0x20f938[_0xe846('0xa')][_0x248b07][_0xe846('0x5')]||'';_0x987ecd+='\x20<';_0x987ecd+=_0x20f938[_0xe846('0xa')][_0x248b07][_0xe846('0x5')]?_0x20f938[_0xe846('0xa')][_0x248b07][_0xe846('0x5')]:_0xe846('0x6')+random[_0xe846('0x7')](0x6)+'@xcally.com';_0x987ecd+='>';}}return _0x987ecd;}function parseEmail(_0x33661e,_0x4ff4ac,_0x131cf9){if(_0x4ff4ac['html']){var _0x581423=/)<[^<]*)*<\/script>/gi;while(_0x581423[_0xe846('0x13')](_0x4ff4ac['html'])){_0x4ff4ac['html']=_0x4ff4ac[_0xe846('0x14')][_0xe846('0x15')](_0x581423,'');}if(_0x4ff4ac['html'][_0xe846('0x16')]('{_0x3c7748[_0xe846('0x18')](_0x177a04['filename']);});var _0x28eb15=/]+>/g;var _0x20b69c=/src="data:image\/([a-zA-Z]*);base64,([^"]*)"/g;var _0x4b4612=_0x4ff4ac[_0xe846('0x14')][_0xe846('0x15')](_0x20b69c,'_SRC');var _0x5a26bf=_0x4b4612[_0xe846('0x15')](_0x28eb15,_0xe846('0x19'));for(let _0x1f8b82=0x0;_0x1f8b82<_0x3c7748[_0xe846('0x10')];_0x1f8b82++){var _0x2627c2=_0x5a26bf[_0xe846('0x15')](_0xe846('0x19'),'\x20[Attachment:\x20'+_0x3c7748[_0x1f8b82]+_0xe846('0x1a'));_0x5a26bf=_0x2627c2;}_0x4ff4ac[_0xe846('0x14')]=_0x5a26bf;}_0x131cf9[_0xe846('0x1b')]=_0x4ff4ac['html'];}else{_0x131cf9[_0xe846('0x1b')]=_0x4ff4ac['textAsHtml'];}if(_0x131cf9[_0xe846('0x1b')]){_0x131cf9[_0xe846('0x1b')]=_0x131cf9[_0xe846('0x1b')]['replace'](/0x0){var _0x1b4c08=[_0xe846('0x2c'),_0xe846('0x2d'),_0xe846('0x2e')];for(var _0x54387f=0x0;_0x54387f<_0x4ff4ac[_0xe846('0x2b')]['length'];_0x54387f++){var _0x9d8337=_[_0xe846('0x2f')](_0x1b4c08,_0x4ff4ac[_0xe846('0x2b')][_0x54387f][_0xe846('0x30')]);if(_0x9d8337>=0x0){_0x131cf9['isAutoreply']=!![];}}}return _0x131cf9;}exports[_0xe846('0x31')]=function(_0x32a3cd,_0x3157f4,_0x33e36f){var _0x22ba30={'from':getAddress(_0x3157f4['from']),'firstName':getFirstName(_0x3157f4[_0xe846('0x32')]),'lastName':getLastName(_0x3157f4[_0xe846('0x32')]),'mapKey':_0xe846('0x4'),'message':{'from':getMails(_0x32a3cd['email'],_0x3157f4['from']),'to':_0x32a3cd['email'],'cc':'','subject':_0x3157f4['subject']||'','messageId':_0x3157f4[_0xe846('0x33')],'inReplyTo':_0x3157f4[_0xe846('0x34')],'sentAt':moment(_0x3157f4[_0xe846('0x35')])['format'](_0xe846('0x36')),'attach':![],'attachments':[]}};if(!_0x3157f4['html']&&!_0x3157f4[_0xe846('0x37')]){var _0x5a76e7=_['filter'](_0x3157f4[_0xe846('0x20')],{'contentType':_0xe846('0x38')});if(_0x5a76e7['length']){logger[_0xe846('0x39')](util['format'](_0xe846('0x3a'),_0x3157f4[_0xe846('0x33')]));tnef[_0xe846('0x3b')](_['first'](_0x5a76e7)[_0xe846('0x3c')],function(_0x1d1c22,_0x10de61){if(_0x10de61){_0x3157f4[_0xe846('0x14')]=_0x10de61['BodyHTML']||_0xe846('0x3d');if(_0x10de61[_0xe846('0x3e')]){for(var _0x47691d=0x0;_0x47691d<_0x10de61['Attachments'][_0xe846('0x10')];_0x47691d++){var _0x12628f=_0x10de61[_0xe846('0x3e')][_0x47691d];_0x22ba30[_0xe846('0x1d')][_0xe846('0x20')][_0xe846('0x18')]({'filename':_0x12628f['Title'],'content':Buffer[_0xe846('0x32')](_0x12628f[_0xe846('0x3f')])});}}}_0x33e36f(parseEmail(_0x32a3cd,_0x3157f4,_0x22ba30));});}else{_0x3157f4[_0xe846('0x14')]='

Empty\x20message

';_0x33e36f(parseEmail(_0x32a3cd,_0x3157f4,_0x22ba30));}}else{_0x33e36f(parseEmail(_0x32a3cd,_0x3157f4,_0x22ba30));}};exports[_0xe846('0x40')]=function(_0x517a7d,_0x4ede35){var _0x1c9f08=[_0xe846('0x41')+(_0x4ede35||''),_0xe846('0x42')+_0x517a7d,'',''];return Buffer[_0xe846('0x32')](_0x1c9f08[_0xe846('0xd')](''),'utf-8')[_0xe846('0x43')](_0xe846('0x44'));}; \ No newline at end of file +var _0x92f3=['join','Anonymous','isEmpty','address','html','replace','includes','forEach','push','filename','_SRC','_IMG','\x20[Attachment:\x20','\x20]','body','textAsHtml','Empty\x20message

','Attachments','Title','Data','generateXOAuth2Token','user=','auth=Bearer\x20','toString','base64','lodash','moment','randomstring','path','util','../../../config/logger','email','../../../config/environment','head','value','anonymous','generate','@xcally.com','name','substring','indexOf','split','length','slice'];(function(_0x3cba93,_0x5c2fd8){var _0x4a2991=function(_0x3cf95b){while(--_0x3cf95b){_0x3cba93['push'](_0x3cba93['shift']());}};_0x4a2991(++_0x5c2fd8);}(_0x92f3,0x11d));var _0x392f=function(_0x4deb98,_0x29ebdd){_0x4deb98=_0x4deb98-0x0;var _0x2c5f93=_0x92f3[_0x4deb98];return _0x2c5f93;};'use strict';var _=require(_0x392f('0x0'));var moment=require(_0x392f('0x1'));var random=require(_0x392f('0x2'));var fs=require('fs');var path=require(_0x392f('0x3'));var util=require(_0x392f('0x4'));var tnef=require('node-tnef');var logger=require(_0x392f('0x5'))(_0x392f('0x6'));var config=require(_0x392f('0x7'));function getAddress(_0x1889a0){var _0x35e9bf=_[_0x392f('0x8')](_0x1889a0[_0x392f('0x9')]);return _0x35e9bf&&_0x35e9bf['address']?_0x35e9bf['address']:_0x392f('0xa')+random[_0x392f('0xb')](0x6)+_0x392f('0xc');}function getFirstName(_0x2be7f2){var _0x5d4fe2=_[_0x392f('0x8')](_0x2be7f2[_0x392f('0x9')]);if(_0x5d4fe2&&_0x5d4fe2[_0x392f('0xd')]){if(_0x5d4fe2['name']==_0x5d4fe2['address']){return _0x5d4fe2[_0x392f('0xd')][_0x392f('0xe')](0x0,_0x5d4fe2[_0x392f('0xd')][_0x392f('0xf')]('@'));}var _0x6c3055=_0x5d4fe2[_0x392f('0xd')][_0x392f('0x10')](/\s+/);return _0x6c3055[_0x392f('0x11')]>0x1?_0x6c3055[_0x392f('0x12')](0x0,-0x1)[_0x392f('0x13')]('\x20'):_0x5d4fe2['name'];}return _0x392f('0x14');}function getLastName(_0x4aa479){var _0x47fad1=_[_0x392f('0x8')](_0x4aa479[_0x392f('0x9')]);if(_0x47fad1&&_0x47fad1['name']){var _0x25cc65=_0x47fad1[_0x392f('0xd')]['split'](/\s+/);return _0x25cc65[_0x392f('0x11')]>0x1?_0x25cc65['pop']():'';}return'';}function getMails(_0x50fd6c,_0x4e7970){var _0x240836='';for(var _0x41d27f=0x0;_0x41d27f<_0x4e7970[_0x392f('0x9')][_0x392f('0x11')];_0x41d27f+=0x1){if(_0x4e7970[_0x392f('0x9')][_0x41d27f]['address']!==_0x50fd6c){if(!_[_0x392f('0x15')](_0x240836)){_0x240836+=',';}_0x240836+=_0x4e7970[_0x392f('0x9')][_0x41d27f][_0x392f('0xd')]||_0x4e7970[_0x392f('0x9')][_0x41d27f]['address']||'';_0x240836+='\x20<';_0x240836+=_0x4e7970['value'][_0x41d27f][_0x392f('0x16')]?_0x4e7970['value'][_0x41d27f][_0x392f('0x16')]:_0x392f('0xa')+random['generate'](0x6)+_0x392f('0xc');_0x240836+='>';}}return _0x240836;}function parseEmail(_0x2b1b48,_0x118c68,_0x1f401b){if(_0x118c68[_0x392f('0x17')]){var _0x2666b0=/)<[^<]*)*<\/script>/gi;while(_0x2666b0['test'](_0x118c68[_0x392f('0x17')])){_0x118c68[_0x392f('0x17')]=_0x118c68[_0x392f('0x17')][_0x392f('0x18')](_0x2666b0,'');}if(_0x118c68[_0x392f('0x17')][_0x392f('0x19')]('{_0x2a4c5c[_0x392f('0x1b')](_0xe0708c[_0x392f('0x1c')]);});var _0x2b8d55=/]+>/g;var _0x48d5b3=/src="data:image\/([a-zA-Z]*);base64,([^"]*)"/g;var _0x145648=_0x118c68[_0x392f('0x17')][_0x392f('0x18')](_0x48d5b3,_0x392f('0x1d'));var _0x2914c1=_0x145648[_0x392f('0x18')](_0x2b8d55,'_IMG');for(let _0x88f6a5=0x0;_0x88f6a5<_0x2a4c5c[_0x392f('0x11')];_0x88f6a5++){var _0xf45a75=_0x2914c1[_0x392f('0x18')](_0x392f('0x1e'),_0x392f('0x1f')+_0x2a4c5c[_0x88f6a5]+_0x392f('0x20'));_0x2914c1=_0xf45a75;}_0x118c68['html']=_0x2914c1;}_0x1f401b[_0x392f('0x21')]=_0x118c68['html'];}else{_0x1f401b[_0x392f('0x21')]=_0x118c68[_0x392f('0x22')];}if(_0x1f401b[_0x392f('0x21')]){_0x1f401b['body']=_0x1f401b[_0x392f('0x21')][_0x392f('0x18')](/0x0){var _0x1e8d83=[_0x392f('0x31'),_0x392f('0x32'),_0x392f('0x33')];for(var _0x152ce8=0x0;_0x152ce8<_0x118c68[_0x392f('0x30')]['length'];_0x152ce8++){var _0xd8bc22=_[_0x392f('0xf')](_0x1e8d83,_0x118c68['headerLines'][_0x152ce8][_0x392f('0x34')]);if(_0xd8bc22>=0x0){_0x1f401b[_0x392f('0x35')]=!![];}}}return _0x1f401b;}exports[_0x392f('0x36')]=function(_0x5198df,_0x1da887,_0x2f4331){var _0xdc34ab={'from':getAddress(_0x1da887[_0x392f('0x37')]),'firstName':getFirstName(_0x1da887['from']),'lastName':getLastName(_0x1da887[_0x392f('0x37')]),'mapKey':_0x392f('0x6'),'message':{'from':getMails(_0x5198df['email'],_0x1da887[_0x392f('0x37')]),'to':_0x5198df[_0x392f('0x6')],'cc':'','subject':_0x1da887[_0x392f('0x38')]||'','messageId':_0x1da887[_0x392f('0x39')],'inReplyTo':_0x1da887[_0x392f('0x3a')],'sentAt':moment(_0x1da887[_0x392f('0x3b')])[_0x392f('0x2b')](_0x392f('0x3c')),'attach':![],'attachments':[]}};if(!_0x1da887[_0x392f('0x17')]&&!_0x1da887['textAsHtml']){var _0x31b45b=_[_0x392f('0x3d')](_0x1da887[_0x392f('0x28')],{'contentType':_0x392f('0x3e')});if(_0x31b45b['length']){logger[_0x392f('0x3f')](util[_0x392f('0x2b')](_0x392f('0x40'),_0x1da887[_0x392f('0x39')]));tnef['parseBuffer'](_[_0x392f('0x41')](_0x31b45b)[_0x392f('0x2f')],function(_0x540491,_0x133c45){if(_0x133c45){_0x1da887[_0x392f('0x17')]=_0x133c45[_0x392f('0x42')]||_0x392f('0x43');if(_0x133c45[_0x392f('0x44')]){for(var _0x29a4e7=0x0;_0x29a4e7<_0x133c45[_0x392f('0x44')][_0x392f('0x11')];_0x29a4e7++){var _0x4aa5f7=_0x133c45[_0x392f('0x44')][_0x29a4e7];_0xdc34ab[_0x392f('0x24')]['attachments'][_0x392f('0x1b')]({'filename':_0x4aa5f7[_0x392f('0x45')],'content':Buffer['from'](_0x4aa5f7[_0x392f('0x46')])});}}}_0x2f4331(parseEmail(_0x5198df,_0x1da887,_0xdc34ab));});}else{_0x1da887[_0x392f('0x17')]=_0x392f('0x43');_0x2f4331(parseEmail(_0x5198df,_0x1da887,_0xdc34ab));}}else{_0x2f4331(parseEmail(_0x5198df,_0x1da887,_0xdc34ab));}};exports[_0x392f('0x47')]=function(_0x3154ef,_0x283686){var _0x5aba7f=[_0x392f('0x48')+(_0x283686||''),_0x392f('0x49')+_0x3154ef,'',''];return Buffer[_0x392f('0x37')](_0x5aba7f[_0x392f('0x13')](''),'utf-8')[_0x392f('0x4a')](_0x392f('0x4b'));}; \ No newline at end of file diff --git a/server/services/email/model/mailAccount.js b/server/services/email/model/mailAccount.js index 5659dc0..4e435fb 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 _0x74a3=['Smtp','exports','lodash','name','key','SERV','active','Imap'];(function(_0x24c353,_0x396ac8){var _0x32acad=function(_0x945125){while(--_0x945125){_0x24c353['push'](_0x24c353['shift']());}};_0x32acad(++_0x396ac8);}(_0x74a3,0x19a));var _0x374a=function(_0x3b380d,_0x4bf247){_0x3b380d=_0x3b380d-0x0;var _0x54502b=_0x74a3[_0x3b380d];return _0x54502b;};'use strict';var _=require(_0x374a('0x0'));function MailAccount(_0x17d0e6){this['id']=_0x17d0e6['id']||0x0;this[_0x374a('0x1')]=_0x17d0e6[_0x374a('0x1')]||'Service';this[_0x374a('0x2')]=_0x17d0e6[_0x374a('0x2')]||_0x374a('0x3');this[_0x374a('0x4')]=_0x17d0e6[_0x374a('0x4')]||![];this[_0x374a('0x5')]=_0x17d0e6[_0x374a('0x5')]||[];this[_0x374a('0x6')]=_0x17d0e6[_0x374a('0x6')]||[];}module[_0x374a('0x7')]=MailAccount; \ No newline at end of file +var _0x6ed2=['SERV','active','Imap','Smtp','exports','lodash','name','Service','key'];(function(_0x5c03f2,_0x29cdce){var _0x46aac9=function(_0x5d2006){while(--_0x5d2006){_0x5c03f2['push'](_0x5c03f2['shift']());}};_0x46aac9(++_0x29cdce);}(_0x6ed2,0x1d9));var _0x26ed=function(_0x188917,_0x1ec7cf){_0x188917=_0x188917-0x0;var _0x4ff346=_0x6ed2[_0x188917];return _0x4ff346;};'use strict';var _=require(_0x26ed('0x0'));function MailAccount(_0x533745){this['id']=_0x533745['id']||0x0;this[_0x26ed('0x1')]=_0x533745[_0x26ed('0x1')]||_0x26ed('0x2');this[_0x26ed('0x3')]=_0x533745[_0x26ed('0x3')]||_0x26ed('0x4');this[_0x26ed('0x5')]=_0x533745[_0x26ed('0x5')]||![];this[_0x26ed('0x6')]=_0x533745[_0x26ed('0x6')]||[];this['Smtp']=_0x533745[_0x26ed('0x7')]||[];}module[_0x26ed('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 3cca0ec..aacf2f5 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 _0xbf22=['merge','exports','lodash','../model/mailAccount','mailAccounts','mapKeys','hasOwnProperty','prototype','mergeFromDatabase','isUndefined'];(function(_0x24c988,_0x4d7960){var _0x58168d=function(_0x473fad){while(--_0x473fad){_0x24c988['push'](_0x24c988['shift']());}};_0x58168d(++_0x4d7960);}(_0xbf22,0x160));var _0x2bf2=function(_0x39b0e2,_0x305f73){_0x39b0e2=_0x39b0e2-0x0;var _0x44d899=_0xbf22[_0x39b0e2];return _0x44d899;};'use strict';var _=require(_0x2bf2('0x0'));var MailAccount=require(_0x2bf2('0x1'));var Realtime=function(){this[_0x2bf2('0x2')]={};};function freeIsNotKey(_0xbb31d8,_0x572c17,_0x249b16){var _0xb00ba5=_[_0x2bf2('0x3')](_0xbb31d8,function(_0x3bf9d6,_0x5881b7){return _0x3bf9d6[_0x249b16];});for(var _0x6c13d2 in _0x572c17){if(_0x572c17[_0x2bf2('0x4')](_0x6c13d2)){if(!_0xb00ba5[_0x6c13d2]){delete _0x572c17[_0x6c13d2];}}}}Realtime[_0x2bf2('0x5')][_0x2bf2('0x6')]=function(_0x1c3514,_0x3b6b9f){for(var _0x116bdc in _0x3b6b9f){if(_0x1c3514['hasOwnProperty'](_0x116bdc)){_0x1c3514[_0x116bdc]=_0x3b6b9f[_0x116bdc];}}};Realtime[_0x2bf2('0x5')]['initMailAccounts']=function(){var _0x399b0c=this;return function(_0x15411d){if(_0x15411d){freeIsNotKey(_0x15411d,_0x399b0c[_0x2bf2('0x2')],'id');for(var _0xfebf24=0x0,_0x26c456={},_0x596f53={};_0xfebf24<_0x15411d['length'];_0xfebf24+=0x1){_0x26c456=_0x15411d[_0xfebf24];if(_[_0x2bf2('0x7')](_0x399b0c[_0x2bf2('0x2')][_0x26c456['id']])){_0x399b0c[_0x2bf2('0x2')][_0x26c456['id']]=new MailAccount(_0x26c456);}else{_[_0x2bf2('0x8')](_0x399b0c[_0x2bf2('0x2')][_0x26c456['id']],_0x26c456);}}}return _0x399b0c[_0x2bf2('0x2')];};};module[_0x2bf2('0x9')]=Realtime; \ No newline at end of file +var _0xf1b7=['hasOwnProperty','prototype','mailAccounts','../model/mailAccount'];(function(_0x4d2c26,_0x2701f9){var _0x5bf9b4=function(_0x52edc6){while(--_0x52edc6){_0x4d2c26['push'](_0x4d2c26['shift']());}};_0x5bf9b4(++_0x2701f9);}(_0xf1b7,0x1df));var _0x7f1b=function(_0x378d41,_0x4d688c){_0x378d41=_0x378d41-0x0;var _0xa8c290=_0xf1b7[_0x378d41];return _0xa8c290;};'use strict';var _=require('lodash');var MailAccount=require(_0x7f1b('0x0'));var Realtime=function(){this['mailAccounts']={};};function freeIsNotKey(_0x3a1252,_0x25af9c,_0x8fefb6){var _0x401b19=_['mapKeys'](_0x3a1252,function(_0x5ae0b7,_0x57026e){return _0x5ae0b7[_0x8fefb6];});for(var _0x1c617c in _0x25af9c){if(_0x25af9c[_0x7f1b('0x1')](_0x1c617c)){if(!_0x401b19[_0x1c617c]){delete _0x25af9c[_0x1c617c];}}}}Realtime[_0x7f1b('0x2')]['mergeFromDatabase']=function(_0x3656f3,_0x38002f){for(var _0x5353af in _0x38002f){if(_0x3656f3['hasOwnProperty'](_0x5353af)){_0x3656f3[_0x5353af]=_0x38002f[_0x5353af];}}};Realtime[_0x7f1b('0x2')]['initMailAccounts']=function(){var _0x42b5ca=this;return function(_0x5af252){if(_0x5af252){freeIsNotKey(_0x5af252,_0x42b5ca[_0x7f1b('0x3')],'id');for(var _0x5cdd19=0x0,_0x234bb6={},_0x203761={};_0x5cdd19<_0x5af252['length'];_0x5cdd19+=0x1){_0x234bb6=_0x5af252[_0x5cdd19];if(_['isUndefined'](_0x42b5ca[_0x7f1b('0x3')][_0x234bb6['id']])){_0x42b5ca['mailAccounts'][_0x234bb6['id']]=new MailAccount(_0x234bb6);}else{_['merge'](_0x42b5ca[_0x7f1b('0x3')][_0x234bb6['id']],_0x234bb6);}}}return _0x42b5ca['mailAccounts'];};};module['exports']=Realtime; \ No newline at end of file diff --git a/server/services/email/rpc/mailAccount.js b/server/services/email/rpc/mailAccount.js index a4cfac4..1c544f7 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 _0xbc48=['NotifyMailAccount','../client','getMailAccounts','Request','GetMailAccount','provider','service','email','active','ListId','CloudProvider','type','MailServerOut','Smtp','data5','getMailAccount','notify'];(function(_0x5dbdde,_0x58e5b2){var _0x1a5095=function(_0x3a2de3){while(--_0x3a2de3){_0x5dbdde['push'](_0x5dbdde['shift']());}};_0x1a5095(++_0x58e5b2);}(_0xbc48,0x111));var _0x8bc4=function(_0xc105b1,_0x401b6e){_0xc105b1=_0xc105b1-0x0;var _0x33d44d=_0xbc48[_0xc105b1];return _0x33d44d;};'use strict';var client=require(_0x8bc4('0x0'));exports[_0x8bc4('0x1')]=function(){return function(){return client[_0x8bc4('0x2')](_0x8bc4('0x3'),{'options':{'attributes':['id','name',_0x8bc4('0x4'),_0x8bc4('0x5'),_0x8bc4('0x6'),_0x8bc4('0x7'),'key',_0x8bc4('0x8'),'TemplateId'],'raw':![],'include':[{'model':'MailServerIn','as':'Imap','include':[{'model':_0x8bc4('0x9'),'attributes':['id','name','service',_0x8bc4('0xa'),'data5'],'as':_0x8bc4('0x9')}]},{'model':_0x8bc4('0xb'),'as':_0x8bc4('0xc'),'include':[{'model':_0x8bc4('0x9'),'attributes':['id','name',_0x8bc4('0x5'),_0x8bc4('0xa'),_0x8bc4('0xd')],'as':_0x8bc4('0x9')}]}]},'log':_0x8bc4('0xe')});};};exports[_0x8bc4('0xf')]=function(_0x462a7c,_0x6049b3){return client[_0x8bc4('0x2')](_0x8bc4('0x10'),{'account':{'id':_0x462a7c},'body':_0x6049b3,'log':_0x8bc4('0x10')});}; \ No newline at end of file +var _0x42fa=['key','ListId','TemplateId','Imap','CloudProvider','type','data5','MailServerOut','Smtp','notify','NotifyMailAccount','../client','getMailAccounts','name','provider','service','email','active'];(function(_0xe6e723,_0x5af822){var _0x1585b3=function(_0xef3b6d){while(--_0xef3b6d){_0xe6e723['push'](_0xe6e723['shift']());}};_0x1585b3(++_0x5af822);}(_0x42fa,0x161));var _0xa42f=function(_0x5eaae7,_0x577c09){_0x5eaae7=_0x5eaae7-0x0;var _0x591743=_0x42fa[_0x5eaae7];return _0x591743;};'use strict';var client=require(_0xa42f('0x0'));exports[_0xa42f('0x1')]=function(){return function(){return client['Request']('GetMailAccount',{'options':{'attributes':['id',_0xa42f('0x2'),_0xa42f('0x3'),_0xa42f('0x4'),_0xa42f('0x5'),_0xa42f('0x6'),_0xa42f('0x7'),_0xa42f('0x8'),_0xa42f('0x9')],'raw':![],'include':[{'model':'MailServerIn','as':_0xa42f('0xa'),'include':[{'model':_0xa42f('0xb'),'attributes':['id','name',_0xa42f('0x4'),_0xa42f('0xc'),_0xa42f('0xd')],'as':_0xa42f('0xb')}]},{'model':_0xa42f('0xe'),'as':_0xa42f('0xf'),'include':[{'model':_0xa42f('0xb'),'attributes':['id',_0xa42f('0x2'),_0xa42f('0x4'),_0xa42f('0xc'),_0xa42f('0xd')],'as':'CloudProvider'}]}]},'log':'getMailAccount'});};};exports[_0xa42f('0x10')]=function(_0x29a2fc,_0xb82d7){return client['Request'](_0xa42f('0x11'),{'account':{'id':_0x29a2fc},'body':_0xb82d7,'log':_0xa42f('0x11')});}; \ No newline at end of file diff --git a/server/services/email/rpc/setting.js b/server/services/email/rpc/setting.js index 8473025..1373e49 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 _0xf2f0=['Request','ShowSetting','loginMailFrequency','GetSettings','getSettings'];(function(_0x2c1335,_0x138446){var _0x10732e=function(_0x1a6a8a){while(--_0x1a6a8a){_0x2c1335['push'](_0x2c1335['shift']());}};_0x10732e(++_0x138446);}(_0xf2f0,0x112));var _0x0f2f=function(_0x2e14f2,_0x377d0d){_0x2e14f2=_0x2e14f2-0x0;var _0x12cc03=_0xf2f0[_0x2e14f2];return _0x12cc03;};'use strict';var client=require('../client');exports[_0x0f2f('0x0')]=function(){return client[_0x0f2f('0x1')](_0x0f2f('0x2'),{'options':{'raw':!![],'where':{'id':0x1},'attributes':[_0x0f2f('0x3')]},'log':_0x0f2f('0x4')});}; \ No newline at end of file +var _0x1d38=['GetSettings'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0x1d38,0xca));var _0x81d3=function(_0x73add,_0x341322){_0x73add=_0x73add-0x0;var _0xdeed5a=_0x1d38[_0x73add];return _0xdeed5a;};'use strict';var client=require('../client');exports['getSettings']=function(){return client['Request']('ShowSetting',{'options':{'raw':!![],'where':{'id':0x1},'attributes':['loginMailFrequency']},'log':_0x81d3('0x0')});}; \ No newline at end of file diff --git a/server/services/email/server/index.js b/server/services/email/server/index.js index 413548a..6c9dd3d 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(_0x37c22c,_0x28a70d){_0x37c22c=_0x37c22c-0x0;var _0x119d79=_0xa9e0[_0x37c22c];return _0x119d79;};'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(_0x57b54c,_0x54ce0d){var _0x59cc19=function(_0xa33bc6){while(--_0xa33bc6){_0x57b54c['push'](_0x57b54c['shift']());}};_0x59cc19(++_0x54ce0d);}(_0xa9e0,0x123));var _0x0a9e=function(_0x5037ab,_0x43209e){_0x5037ab=_0x5037ab-0x0;var _0x512adb=_0xa9e0[_0x5037ab];return _0x512adb;};'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 21f87db..f120c97 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 _0xdea7=['socket.io-redis','../../config/triggers','default','../../config/socketio','../../config/express','once','listening','Express\x20server\x20listening\x20on\x20port\x20%d!','exports','lodash','express','sticky-session','ioredis','../../config/environment','createServer','timeout','listen','port','socket.io','websocket','redis','defaults','localhost'];(function(_0x2dcf00,_0x579a6f){var _0x5bdf97=function(_0xbb360){while(--_0xbb360){_0x2dcf00['push'](_0x2dcf00['shift']());}};_0x5bdf97(++_0x579a6f);}(_0xdea7,0x162));var _0x7dea=function(_0x443b7d,_0x5b64ff){_0x443b7d=_0x443b7d-0x0;var _0x5d96f9=_0xdea7[_0x443b7d];return _0x5d96f9;};'use strict';var _=require(_0x7dea('0x0'));var http=require('http');var express=require(_0x7dea('0x1'));var sticky=require(_0x7dea('0x2'));var Redis=require(_0x7dea('0x3'));var config=require(_0x7dea('0x4'));var app=express();var server=http[_0x7dea('0x5')](app);server[_0x7dea('0x6')]=0xdbba0;if(sticky[_0x7dea('0x7')](server,config[_0x7dea('0x8')])){var socketio=require(_0x7dea('0x9'))(server,{'transports':[_0x7dea('0xa'),'polling']});config[_0x7dea('0xb')]=_[_0x7dea('0xc')](config[_0x7dea('0xb')],{'host':_0x7dea('0xd'),'port':0x18eb});socketio['adapter'](require(_0x7dea('0xe'))({'pubClient':new Redis(config[_0x7dea('0xb')]),'subClient':new Redis(config[_0x7dea('0xb')])}));require(_0x7dea('0xf'))[_0x7dea('0x10')]();require(_0x7dea('0x11'))[_0x7dea('0x10')](socketio);require(_0x7dea('0x12'))['default'](app);require('../../routes')[_0x7dea('0x10')](app);}else{server[_0x7dea('0x13')](_0x7dea('0x14'),function(){console['log'](_0x7dea('0x15'),config[_0x7dea('0x8')]);});}exports=module[_0x7dea('0x16')]=app; \ No newline at end of file +var _0x555f=['../../config/environment','timeout','listen','port','socket.io','websocket','defaults','localhost','adapter','socket.io-redis','redis','../../config/triggers','../../config/express','default','once','listening','Express\x20server\x20listening\x20on\x20port\x20%d!','exports','lodash','http'];(function(_0x2f62aa,_0x108e95){var _0x1a341f=function(_0x3aedcf){while(--_0x3aedcf){_0x2f62aa['push'](_0x2f62aa['shift']());}};_0x1a341f(++_0x108e95);}(_0x555f,0x18e));var _0xf555=function(_0x4f5108,_0x46a54b){_0x4f5108=_0x4f5108-0x0;var _0x2d56ca=_0x555f[_0x4f5108];return _0x2d56ca;};'use strict';var _=require(_0xf555('0x0'));var http=require(_0xf555('0x1'));var express=require('express');var sticky=require('sticky-session');var Redis=require('ioredis');var config=require(_0xf555('0x2'));var app=express();var server=http['createServer'](app);server[_0xf555('0x3')]=0xdbba0;if(sticky[_0xf555('0x4')](server,config[_0xf555('0x5')])){var socketio=require(_0xf555('0x6'))(server,{'transports':[_0xf555('0x7'),'polling']});config['redis']=_[_0xf555('0x8')](config['redis'],{'host':_0xf555('0x9'),'port':0x18eb});socketio[_0xf555('0xa')](require(_0xf555('0xb'))({'pubClient':new Redis(config[_0xf555('0xc')]),'subClient':new Redis(config['redis'])}));require(_0xf555('0xd'))['default']();require('../../config/socketio')['default'](socketio);require(_0xf555('0xe'))[_0xf555('0xf')](app);require('../../routes')['default'](app);}else{server[_0xf555('0x10')](_0xf555('0x11'),function(){console['log'](_0xf555('0x12'),config['port']);});}exports=module[_0xf555('0x13')]=app; \ No newline at end of file diff --git a/server/services/routing/client.js b/server/services/routing/client.js index 99a725f..86e3ba9 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 _0x9132=['result','rpc','exports','bluebird','../../config/logger','client','http','request','then','debug','error','routing','message'];(function(_0x468e71,_0x171468){var _0x2c9045=function(_0x3607c1){while(--_0x3607c1){_0x468e71['push'](_0x468e71['shift']());}};_0x2c9045(++_0x171468);}(_0x9132,0x12e));var _0x2913=function(_0x3f1683,_0x13c78){_0x3f1683=_0x3f1683-0x0;var _0x10c22c=_0x9132[_0x3f1683];return _0x10c22c;};'use strict';var jayson=require('jayson/promise');var BPromise=require(_0x2913('0x0'));var logger=require(_0x2913('0x1'))('routing');var client=jayson[_0x2913('0x2')][_0x2913('0x3')]({'port':0x2329});client['Request']=function(_0x46a38b,_0x1d36ac){return new BPromise(function(_0x23ddad,_0x7ab9fa){return client[_0x2913('0x4')](_0x46a38b,_0x1d36ac)[_0x2913('0x5')](function(_0x54614e){logger[_0x2913('0x6')]('rpc','routing',_0x46a38b,_0x1d36ac,_0x54614e);if(_0x54614e[_0x2913('0x7')]){logger[_0x2913('0x7')]('rpc',_0x2913('0x8'),_0x46a38b,_0x54614e[_0x2913('0x7')]['message'],_0x1d36ac);return _0x7ab9fa(_0x54614e[_0x2913('0x7')][_0x2913('0x9')]);}else{return _0x23ddad(_0x54614e[_0x2913('0xa')]);}})['catch'](function(_0x51636b){logger[_0x2913('0x7')](_0x2913('0xb'),_0x2913('0x8'),_0x46a38b,_0x51636b,_0x1d36ac);return _0x7ab9fa(_0x51636b);});});};module[_0x2913('0xc')]=client; \ No newline at end of file +var _0xa4d9=['Request','request','error','rpc','message','catch','exports','jayson/promise','bluebird','../../config/logger','routing','client'];(function(_0x1417af,_0x4820c6){var _0x56b469=function(_0x28414d){while(--_0x28414d){_0x1417af['push'](_0x1417af['shift']());}};_0x56b469(++_0x4820c6);}(_0xa4d9,0x13f));var _0x9a4d=function(_0x2e1d01,_0x2fea92){_0x2e1d01=_0x2e1d01-0x0;var _0x38aa2e=_0xa4d9[_0x2e1d01];return _0x38aa2e;};'use strict';var jayson=require(_0x9a4d('0x0'));var BPromise=require(_0x9a4d('0x1'));var logger=require(_0x9a4d('0x2'))(_0x9a4d('0x3'));var client=jayson[_0x9a4d('0x4')]['http']({'port':0x2329});client[_0x9a4d('0x5')]=function(_0x1bccb9,_0x58cc64){return new BPromise(function(_0x96549f,_0x4b21da){return client[_0x9a4d('0x6')](_0x1bccb9,_0x58cc64)['then'](function(_0x24cbe8){logger['debug']('rpc',_0x9a4d('0x3'),_0x1bccb9,_0x58cc64,_0x24cbe8);if(_0x24cbe8[_0x9a4d('0x7')]){logger['error'](_0x9a4d('0x8'),_0x9a4d('0x3'),_0x1bccb9,_0x24cbe8['error'][_0x9a4d('0x9')],_0x58cc64);return _0x4b21da(_0x24cbe8[_0x9a4d('0x7')]['message']);}else{return _0x96549f(_0x24cbe8['result']);}})[_0x9a4d('0xa')](function(_0x2b73ca){logger[_0x9a4d('0x7')]('rpc',_0x9a4d('0x3'),_0x1bccb9,_0x2b73ca,_0x58cc64);return _0x4b21da(_0x2b73ca);});});};module[_0x9a4d('0xb')]=client; \ No newline at end of file diff --git a/server/services/routing/index.js b/server/services/routing/index.js index dab9ca6..cb8a9df 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 _0xf058=['./rpc/faxQueue','./rpc/whatsappQueue','resolve','then','initAgents','initIntervals','getOpenchannelQueues','getChatQueues','initChatQueues','getSmsQueues','initSmsQueues','initMailQueues','getFaxQueues','initFaxQueues','getWhatsappQueues','initWhatsappQueues','catch','bluebird','./server','./rpc/user','./rpc/openchannelQueue','./rpc/chatQueue','./rpc/mailQueue'];(function(_0x4243a3,_0x447337){var _0x1b2a33=function(_0x6a8200){while(--_0x6a8200){_0x4243a3['push'](_0x4243a3['shift']());}};_0x1b2a33(++_0x447337);}(_0xf058,0x9b));var _0x8f05=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xf058[_0x3dd15e];return _0x231fd0;};'use strict';var BPromise=require(_0x8f05('0x0'));var server=require(_0x8f05('0x1'));var Realtime=require('./realtime');var user=require(_0x8f05('0x2'));var interval=require('./rpc/interval');var openchannelQueue=require(_0x8f05('0x3'));var chatQueue=require(_0x8f05('0x4'));var smsQueue=require('./rpc/smsQueue');var mailQueue=require(_0x8f05('0x5'));var faxQueue=require(_0x8f05('0x6'));var whatsappQueue=require(_0x8f05('0x7'));var realtime=new Realtime();function initRealtime(){return BPromise[_0x8f05('0x8')]()[_0x8f05('0x9')](user['getAgents']())[_0x8f05('0x9')](realtime[_0x8f05('0xa')]())[_0x8f05('0x9')](interval['getIntervals']())[_0x8f05('0x9')](realtime[_0x8f05('0xb')]())[_0x8f05('0x9')](openchannelQueue[_0x8f05('0xc')]())['then'](realtime['initOpenchannelQueues']())[_0x8f05('0x9')](chatQueue[_0x8f05('0xd')]())[_0x8f05('0x9')](realtime[_0x8f05('0xe')]())['then'](smsQueue[_0x8f05('0xf')]())['then'](realtime[_0x8f05('0x10')]())['then'](mailQueue['getMailQueues']())[_0x8f05('0x9')](realtime[_0x8f05('0x11')]())['then'](faxQueue[_0x8f05('0x12')]())['then'](realtime[_0x8f05('0x13')]())[_0x8f05('0x9')](whatsappQueue[_0x8f05('0x14')]())[_0x8f05('0x9')](realtime[_0x8f05('0x15')]())[_0x8f05('0x9')](function(){return realtime;});}function main(){return server['listen'](realtime)['then'](function(_0x3c83b3){return initRealtime();})['then'](function(_0x5c357e){return setInterval(initRealtime,0x1388);})[_0x8f05('0x16')](function(_0x503bf2){console['log'](_0x503bf2);});}main(); \ No newline at end of file +var _0x5159=['initChatQueues','initSmsQueues','getMailQueues','initMailQueues','getFaxQueues','getWhatsappQueues','initWhatsappQueues','listen','log','./realtime','./rpc/user','./rpc/interval','./rpc/openchannelQueue','./rpc/chatQueue','./rpc/mailQueue','./rpc/faxQueue','resolve','then','getAgents','initIntervals','getOpenchannelQueues','initOpenchannelQueues','getChatQueues'];(function(_0x21a9d9,_0x4d5ac8){var _0x46adce=function(_0xfdd336){while(--_0xfdd336){_0x21a9d9['push'](_0x21a9d9['shift']());}};_0x46adce(++_0x4d5ac8);}(_0x5159,0x65));var _0x9515=function(_0x3ae690,_0x9ad2a8){_0x3ae690=_0x3ae690-0x0;var _0x1de304=_0x5159[_0x3ae690];return _0x1de304;};'use strict';var BPromise=require('bluebird');var server=require('./server');var Realtime=require(_0x9515('0x0'));var user=require(_0x9515('0x1'));var interval=require(_0x9515('0x2'));var openchannelQueue=require(_0x9515('0x3'));var chatQueue=require(_0x9515('0x4'));var smsQueue=require('./rpc/smsQueue');var mailQueue=require(_0x9515('0x5'));var faxQueue=require(_0x9515('0x6'));var whatsappQueue=require('./rpc/whatsappQueue');var realtime=new Realtime();function initRealtime(){return BPromise[_0x9515('0x7')]()[_0x9515('0x8')](user[_0x9515('0x9')]())['then'](realtime['initAgents']())['then'](interval['getIntervals']())[_0x9515('0x8')](realtime[_0x9515('0xa')]())[_0x9515('0x8')](openchannelQueue[_0x9515('0xb')]())['then'](realtime[_0x9515('0xc')]())[_0x9515('0x8')](chatQueue[_0x9515('0xd')]())[_0x9515('0x8')](realtime[_0x9515('0xe')]())['then'](smsQueue['getSmsQueues']())[_0x9515('0x8')](realtime[_0x9515('0xf')]())[_0x9515('0x8')](mailQueue[_0x9515('0x10')]())['then'](realtime[_0x9515('0x11')]())['then'](faxQueue[_0x9515('0x12')]())[_0x9515('0x8')](realtime['initFaxQueues']())[_0x9515('0x8')](whatsappQueue[_0x9515('0x13')]())[_0x9515('0x8')](realtime[_0x9515('0x14')]())['then'](function(){return realtime;});}function main(){return server[_0x9515('0x15')](realtime)[_0x9515('0x8')](function(_0x10263f){return initRealtime();})[_0x9515('0x8')](function(_0x3502b0){return setInterval(initRealtime,0x1388);})['catch'](function(_0x82a046){console[_0x9515('0x16')](_0x82a046);});}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 4ef8708..756edce 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 _0xe14b=['next','restart','condition','noop','findRules','matches','turn','length','prioritize','priority','toJSON','map','toString','fromJSON','isString','object','register','exports','lodash','util','isNil','ignoreFactChanges','inherits','prototype','init','rules','activeRules','isArray','concat','push','sync','filter','orderBy','asc','execute','result','clone','consequence','ruleRef','name','index_','nextTick','call'];(function(_0x565d72,_0x3101c2){var _0x371f4d=function(_0x4abbbb){while(--_0x4abbbb){_0x565d72['push'](_0x565d72['shift']());}};_0x371f4d(++_0x3101c2);}(_0xe14b,0x93));var _0xbe14=function(_0x14b4dd,_0x5e9096){_0x14b4dd=_0x14b4dd-0x0;var _0x5d176b=_0xe14b[_0x14b4dd];return _0x5d176b;};'use strict';var _=require(_0xbe14('0x0'));var util=require(_0xbe14('0x1'));var EventEmitter=require('events')['EventEmitter'];function RuleEngine(_0x11c3a0,_0x36393a){this['init']();if(!_[_0xbe14('0x2')](_0x11c3a0)){this['register'](_0x11c3a0);}if(_0x36393a){this['ignoreFactChanges']=_0x36393a[_0xbe14('0x3')];}return this;}util[_0xbe14('0x4')](RuleEngine,EventEmitter);RuleEngine[_0xbe14('0x5')][_0xbe14('0x6')]=function(_0x1d9ade){this[_0xbe14('0x7')]=[];this[_0xbe14('0x8')]=[];};RuleEngine['prototype']['register']=function(_0x496063){if(Array[_0xbe14('0x9')](_0x496063)){this[_0xbe14('0x7')]=this[_0xbe14('0x7')][_0xbe14('0xa')](_0x496063);}else if(_0x496063!==null&&_['isObject'](_0x496063)){this['rules'][_0xbe14('0xb')](_0x496063);}this[_0xbe14('0xc')]();};RuleEngine['prototype'][_0xbe14('0xc')]=function(){this[_0xbe14('0x8')]=this[_0xbe14('0x7')][_0xbe14('0xd')](function(_0x27792f){if(_[_0xbe14('0x2')](_0x27792f['on'])){_0x27792f['on']=!![];}if(_0x27792f['on']===!![]){return _0x27792f;}});this[_0xbe14('0x8')]=_[_0xbe14('0xe')](this[_0xbe14('0x8')],['p'],[_0xbe14('0xf')]);};RuleEngine[_0xbe14('0x5')][_0xbe14('0x10')]=function(_0x813399,_0x530538){var _0x55b3a7=![];_0x813399[_0xbe14('0x11')]=!![];var _0x3dc4a9=_[_0xbe14('0x12')](_0x813399);var _0x37ce4e=_['clone'](_0x813399);var _0x21c789=this[_0xbe14('0x8')];var _0xfd7b8f=[];var _0x123ede=this[_0xbe14('0x3')];(function FnRuleLoop(_0x29ab73){var _0x17ae86={'rules':function(){return _0x21c789;},'rule':function(){return _0x21c789[_0x29ab73];},'when':function(_0x5ea1f8){if(_0x5ea1f8){var _0x137ee5=_0x21c789[_0x29ab73][_0xbe14('0x13')];_0x137ee5[_0xbe14('0x14')]=_0x21c789[_0x29ab73]['id']||_0x21c789[_0x29ab73][_0xbe14('0x15')]||_0xbe14('0x16')+_0x29ab73;process[_0xbe14('0x17')](function(){_0xfd7b8f['push'](_0x137ee5[_0xbe14('0x14')]);_0x137ee5[_0xbe14('0x18')](_0x3dc4a9,_0x17ae86);});}else{process[_0xbe14('0x17')](function(){_0x17ae86[_0xbe14('0x19')]();});}},'restart':function(){return FnRuleLoop(0x0);},'stop':function(){_0x55b3a7=!![];return FnRuleLoop(0x0);},'next':function(_0x188ec4){if(!_0x123ede&&!_['isEqual'](_0x37ce4e,_0x3dc4a9)){_0x37ce4e=_[_0xbe14('0x12')](_0x3dc4a9);process['nextTick'](function(){_0x17ae86[_0xbe14('0x1a')]();});}else{process['nextTick'](function(){if(_[_0xbe14('0x2')](_0x188ec4)){return FnRuleLoop(_0x29ab73+0x1);}else{return FnRuleLoop(_0x188ec4);}});}}};if(_0x29ab73<_0x21c789['length']&&_0x55b3a7===![]){var _0x274018=_0x21c789[_0x29ab73][_0xbe14('0x1b')];_0x274018['call'](_0x3dc4a9,_0x17ae86);}else{process[_0xbe14('0x17')](function(){_0x3dc4a9['matchPath']=_0xfd7b8f;return _0x530538?_0x530538(_0x3dc4a9):_[_0xbe14('0x1c')]();});}}(0x0));};RuleEngine['prototype'][_0xbe14('0x1d')]=function(_0x5fa043){if(_[_0xbe14('0x2')](_0x5fa043)){return this[_0xbe14('0x7')];}else{var _0x15ef02=_[_0xbe14('0x1e')](_0x5fa043);return _['filter'](this[_0xbe14('0x7')],_0x15ef02);}};RuleEngine[_0xbe14('0x5')][_0xbe14('0x1f')]=function(_0x169369,_0x5dd475){var _0x16f884=_0x169369==='on'||_0x169369==='ON'?!![]:![];var _0x29fc64=this['findRules'](_0x5dd475);for(var _0x3c3613=0x0,_0x3b3e84=_0x29fc64[_0xbe14('0x20')];_0x3c3613<_0x3b3e84;_0x3c3613+=0x1){_0x29fc64[_0x3c3613]['on']=_0x16f884;}this[_0xbe14('0xc')]();};RuleEngine[_0xbe14('0x5')][_0xbe14('0x21')]=function(_0x31a664,_0x2b05cb){_0x31a664=parseInt(_0x31a664,0xa);var _0x4168c8=this[_0xbe14('0x1d')](_0x2b05cb);for(var _0x40538f=0x0,_0x3bf43c=_0x4168c8[_0xbe14('0x20')];_0x40538f<_0x3bf43c;_0x40538f+=0x1){_0x4168c8[_0x40538f][_0xbe14('0x22')]=_0x31a664;}this[_0xbe14('0xc')]();};RuleEngine[_0xbe14('0x5')][_0xbe14('0x23')]=function(){var _0x2ff48e=this[_0xbe14('0x7')];if(_0x2ff48e instanceof Array){_0x2ff48e=_0x2ff48e[_0xbe14('0x24')](function(_0x581e86){_0x581e86[_0xbe14('0x1b')]=_0x581e86['condition']['toString']();_0x581e86[_0xbe14('0x13')]=_0x581e86['consequence'][_0xbe14('0x25')]();return _0x581e86;});}else if(!_[_0xbe14('0x2')](_0x2ff48e)){_0x2ff48e['condition']=_0x2ff48e['condition']['toString']();_0x2ff48e[_0xbe14('0x13')]=_0x2ff48e[_0xbe14('0x13')]['toString']();}return _0x2ff48e;};RuleEngine[_0xbe14('0x5')][_0xbe14('0x26')]=function(_0x452635){this[_0xbe14('0x6')]();if(_[_0xbe14('0x27')](_0x452635)){_0x452635=JSON['parse'](_0x452635);}if(_0x452635 instanceof Array){_0x452635=_0x452635['map'](function(_0x15a997){_0x15a997['condition']=eval('('+_0x15a997['condition']+')');_0x15a997['consequence']=eval('('+_0x15a997[_0xbe14('0x13')]+')');return _0x15a997;});}else if(_0x452635!==null&&typeof _0x452635==_0xbe14('0x28')){_0x452635[_0xbe14('0x1b')]=eval('('+_0x452635[_0xbe14('0x1b')]+')');_0x452635[_0xbe14('0x13')]=eval('('+_0x452635[_0xbe14('0x13')]+')');}this[_0xbe14('0x29')](_0x452635);};module[_0xbe14('0x2a')]=RuleEngine; \ No newline at end of file +var _0x5fc3=['lodash','util','EventEmitter','init','isNil','ignoreFactChanges','inherits','activeRules','prototype','register','isArray','rules','isObject','sync','orderBy','asc','execute','clone','ruleRef','name','index_','push','call','nextTick','next','isEqual','restart','length','condition','matchPath','noop','findRules','filter','prioritize','priority','toJSON','map','consequence','toString','fromJSON','isString','parse'];(function(_0x33c01c,_0x3ef3f4){var _0x146e2f=function(_0x2adeca){while(--_0x2adeca){_0x33c01c['push'](_0x33c01c['shift']());}};_0x146e2f(++_0x3ef3f4);}(_0x5fc3,0xa8));var _0x35fc=function(_0x29a29f,_0x155ce7){_0x29a29f=_0x29a29f-0x0;var _0x443ea3=_0x5fc3[_0x29a29f];return _0x443ea3;};'use strict';var _=require(_0x35fc('0x0'));var util=require(_0x35fc('0x1'));var EventEmitter=require('events')[_0x35fc('0x2')];function RuleEngine(_0x2ac6da,_0x196bc2){this[_0x35fc('0x3')]();if(!_[_0x35fc('0x4')](_0x2ac6da)){this['register'](_0x2ac6da);}if(_0x196bc2){this[_0x35fc('0x5')]=_0x196bc2[_0x35fc('0x5')];}return this;}util[_0x35fc('0x6')](RuleEngine,EventEmitter);RuleEngine['prototype']['init']=function(_0x19a0d1){this['rules']=[];this[_0x35fc('0x7')]=[];};RuleEngine[_0x35fc('0x8')][_0x35fc('0x9')]=function(_0x1e5f90){if(Array[_0x35fc('0xa')](_0x1e5f90)){this[_0x35fc('0xb')]=this[_0x35fc('0xb')]['concat'](_0x1e5f90);}else if(_0x1e5f90!==null&&_[_0x35fc('0xc')](_0x1e5f90)){this[_0x35fc('0xb')]['push'](_0x1e5f90);}this[_0x35fc('0xd')]();};RuleEngine[_0x35fc('0x8')]['sync']=function(){this[_0x35fc('0x7')]=this[_0x35fc('0xb')]['filter'](function(_0x4cbe74){if(_[_0x35fc('0x4')](_0x4cbe74['on'])){_0x4cbe74['on']=!![];}if(_0x4cbe74['on']===!![]){return _0x4cbe74;}});this['activeRules']=_[_0x35fc('0xe')](this[_0x35fc('0x7')],['p'],[_0x35fc('0xf')]);};RuleEngine[_0x35fc('0x8')][_0x35fc('0x10')]=function(_0x5cfe94,_0x59507a){var _0x5eac0f=![];_0x5cfe94['result']=!![];var _0x398b67=_[_0x35fc('0x11')](_0x5cfe94);var _0x53b898=_[_0x35fc('0x11')](_0x5cfe94);var _0x227a49=this[_0x35fc('0x7')];var _0x480851=[];var _0x26ba54=this[_0x35fc('0x5')];(function FnRuleLoop(_0x553677){var _0x41e165={'rules':function(){return _0x227a49;},'rule':function(){return _0x227a49[_0x553677];},'when':function(_0x363e47){if(_0x363e47){var _0x2e513b=_0x227a49[_0x553677]['consequence'];_0x2e513b[_0x35fc('0x12')]=_0x227a49[_0x553677]['id']||_0x227a49[_0x553677][_0x35fc('0x13')]||_0x35fc('0x14')+_0x553677;process['nextTick'](function(){_0x480851[_0x35fc('0x15')](_0x2e513b[_0x35fc('0x12')]);_0x2e513b[_0x35fc('0x16')](_0x398b67,_0x41e165);});}else{process[_0x35fc('0x17')](function(){_0x41e165[_0x35fc('0x18')]();});}},'restart':function(){return FnRuleLoop(0x0);},'stop':function(){_0x5eac0f=!![];return FnRuleLoop(0x0);},'next':function(_0x21f1a9){if(!_0x26ba54&&!_[_0x35fc('0x19')](_0x53b898,_0x398b67)){_0x53b898=_[_0x35fc('0x11')](_0x398b67);process[_0x35fc('0x17')](function(){_0x41e165[_0x35fc('0x1a')]();});}else{process['nextTick'](function(){if(_[_0x35fc('0x4')](_0x21f1a9)){return FnRuleLoop(_0x553677+0x1);}else{return FnRuleLoop(_0x21f1a9);}});}}};if(_0x553677<_0x227a49[_0x35fc('0x1b')]&&_0x5eac0f===![]){var _0x257719=_0x227a49[_0x553677][_0x35fc('0x1c')];_0x257719[_0x35fc('0x16')](_0x398b67,_0x41e165);}else{process['nextTick'](function(){_0x398b67[_0x35fc('0x1d')]=_0x480851;return _0x59507a?_0x59507a(_0x398b67):_[_0x35fc('0x1e')]();});}}(0x0));};RuleEngine['prototype'][_0x35fc('0x1f')]=function(_0x5a93df){if(_[_0x35fc('0x4')](_0x5a93df)){return this['rules'];}else{var _0x4086e9=_['matches'](_0x5a93df);return _[_0x35fc('0x20')](this[_0x35fc('0xb')],_0x4086e9);}};RuleEngine['prototype']['turn']=function(_0x47774c,_0x58edb6){var _0x274208=_0x47774c==='on'||_0x47774c==='ON'?!![]:![];var _0x1a5d92=this['findRules'](_0x58edb6);for(var _0x26b7cb=0x0,_0x645eac=_0x1a5d92[_0x35fc('0x1b')];_0x26b7cb<_0x645eac;_0x26b7cb+=0x1){_0x1a5d92[_0x26b7cb]['on']=_0x274208;}this[_0x35fc('0xd')]();};RuleEngine[_0x35fc('0x8')][_0x35fc('0x21')]=function(_0x11ccdb,_0x451f0c){_0x11ccdb=parseInt(_0x11ccdb,0xa);var _0x54aedc=this[_0x35fc('0x1f')](_0x451f0c);for(var _0x220931=0x0,_0x22af18=_0x54aedc['length'];_0x220931<_0x22af18;_0x220931+=0x1){_0x54aedc[_0x220931][_0x35fc('0x22')]=_0x11ccdb;}this[_0x35fc('0xd')]();};RuleEngine[_0x35fc('0x8')][_0x35fc('0x23')]=function(){var _0xd8a4ca=this[_0x35fc('0xb')];if(_0xd8a4ca instanceof Array){_0xd8a4ca=_0xd8a4ca[_0x35fc('0x24')](function(_0x37b435){_0x37b435[_0x35fc('0x1c')]=_0x37b435[_0x35fc('0x1c')]['toString']();_0x37b435['consequence']=_0x37b435[_0x35fc('0x25')]['toString']();return _0x37b435;});}else if(!_[_0x35fc('0x4')](_0xd8a4ca)){_0xd8a4ca[_0x35fc('0x1c')]=_0xd8a4ca[_0x35fc('0x1c')][_0x35fc('0x26')]();_0xd8a4ca[_0x35fc('0x25')]=_0xd8a4ca[_0x35fc('0x25')]['toString']();}return _0xd8a4ca;};RuleEngine[_0x35fc('0x8')][_0x35fc('0x27')]=function(_0x46b9ef){this[_0x35fc('0x3')]();if(_[_0x35fc('0x28')](_0x46b9ef)){_0x46b9ef=JSON[_0x35fc('0x29')](_0x46b9ef);}if(_0x46b9ef instanceof Array){_0x46b9ef=_0x46b9ef['map'](function(_0x2483be){_0x2483be[_0x35fc('0x1c')]=eval('('+_0x2483be[_0x35fc('0x1c')]+')');_0x2483be['consequence']=eval('('+_0x2483be[_0x35fc('0x25')]+')');return _0x2483be;});}else if(_0x46b9ef!==null&&typeof _0x46b9ef=='object'){_0x46b9ef[_0x35fc('0x1c')]=eval('('+_0x46b9ef[_0x35fc('0x1c')]+')');_0x46b9ef[_0x35fc('0x25')]=eval('('+_0x46b9ef[_0x35fc('0x25')]+')');}this['register'](_0x46b9ef);};module['exports']=RuleEngine; \ No newline at end of file diff --git a/server/services/routing/mailRpc/index.js b/server/services/routing/mailRpc/index.js index bd17bcf..a87db4b 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 _0x51e2=['bluebird','request','then','error','catch','sendMailMessage','SendMail'];(function(_0x90c697,_0x360339){var _0x13e320=function(_0x46e513){while(--_0x46e513){_0x90c697['push'](_0x90c697['shift']());}};_0x13e320(++_0x360339);}(_0x51e2,0x118));var _0x251e=function(_0x44c5ac,_0x56f86d){_0x44c5ac=_0x44c5ac-0x0;var _0x5b2895=_0x51e2[_0x44c5ac];return _0x5b2895;};'use strict';var BPromise=require(_0x251e('0x0'));var jayson=require('jayson/promise');var client=jayson['client']['http']({'port':0x232b});function request(_0x1f1d6e,_0x54ebe8){return new BPromise(function(_0x44370d,_0x4a889d){return client[_0x251e('0x1')](_0x1f1d6e,_0x54ebe8)[_0x251e('0x2')](function(_0x5afc58){if(_0x5afc58[_0x251e('0x3')]){return _0x4a889d(_0x5afc58[_0x251e('0x3')]['message']);}else{return _0x44370d(_0x5afc58['result']);}})[_0x251e('0x4')](function(_0x32b1a3){return _0x4a889d(_0x32b1a3);});});}exports[_0x251e('0x5')]=function(_0x4278c5,_0x3a4fcb){return request(_0x251e('0x6'),{'account':_0x4278c5,'message':_0x3a4fcb});}; \ No newline at end of file +var _0x1187=['result','catch','sendMailMessage','bluebird','jayson/promise','client','http','request','then','error'];(function(_0x133fc7,_0x1927cf){var _0x37aa18=function(_0x29d6ae){while(--_0x29d6ae){_0x133fc7['push'](_0x133fc7['shift']());}};_0x37aa18(++_0x1927cf);}(_0x1187,0xcb));var _0x7118=function(_0x5f9dcf,_0x5eefda){_0x5f9dcf=_0x5f9dcf-0x0;var _0x1f69f8=_0x1187[_0x5f9dcf];return _0x1f69f8;};'use strict';var BPromise=require(_0x7118('0x0'));var jayson=require(_0x7118('0x1'));var client=jayson[_0x7118('0x2')][_0x7118('0x3')]({'port':0x232b});function request(_0x23f6df,_0x234470){return new BPromise(function(_0x18a856,_0xb9c550){return client[_0x7118('0x4')](_0x23f6df,_0x234470)[_0x7118('0x5')](function(_0x11fcea){if(_0x11fcea[_0x7118('0x6')]){return _0xb9c550(_0x11fcea[_0x7118('0x6')]['message']);}else{return _0x18a856(_0x11fcea[_0x7118('0x7')]);}})[_0x7118('0x8')](function(_0x4f0407){return _0xb9c550(_0x4f0407);});});}exports[_0x7118('0x9')]=function(_0x5e376d,_0x56e852){return request('SendMail',{'account':_0x5e376d,'message':_0x56e852});}; \ No newline at end of file diff --git a/server/services/routing/model/agent.js b/server/services/routing/model/agent.js index 6f8b0d0..cbc825f 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 _0x2a07=['faxCapacity','faxCurrentCapacity','smsStatus','smsStatusTime','smsCapacity','smsCurrentCapacity','whatsappStatus','whatsappStatusTime','whatsappCapacity','openchannelStatus','openchannelStatusTime','openchannelCapacity','openchannelCurrentCapacity','busyQueue','chatWaitingInteractions','mailWaitingInteractions','openchannelWaitingInteractions','smsWaitingInteractions','whatsappWaitingInteractions','prototype','getChannelStatus','CurrentCapacity','Capacity','working','idle','updateRealtime','mail','chat','openchannel','fax','sms','length','Status','StatusTime','toNumber','format','mailCurrentCapacity','faxStatus','whatsappCurrentCapacity','busy','faxWaitingInteractions','stringify','emit','user:routing:update','omit','lodash','md5','moment','ioredis','../../../config/environment','defaults','redis','localhost','socket.io-emitter','name','online','voicePause','chatPause','mailPause','faxPause','smsPause','openchannelPause','chatStatus','unknown','chatStatusTime','chatCapacity','chatCurrentCapacity','mailStatus','mailStatusTime','mailCapacity','faxStatusTime'];(function(_0x16ae34,_0x1dc6d){var _0x184836=function(_0x1e48b7){while(--_0x1e48b7){_0x16ae34['push'](_0x16ae34['shift']());}};_0x184836(++_0x1dc6d);}(_0x2a07,0x74));var _0x72a0=function(_0x217e5b,_0x53776f){_0x217e5b=_0x217e5b-0x0;var _0x38f156=_0x2a07[_0x217e5b];return _0x38f156;};'use strict';var _=require(_0x72a0('0x0'));var md5=require(_0x72a0('0x1'));var moment=require(_0x72a0('0x2'));var Redis=require(_0x72a0('0x3'));var config=require(_0x72a0('0x4'));config['redis']=_[_0x72a0('0x5')](config[_0x72a0('0x6')],{'host':_0x72a0('0x7'),'port':0x18eb});var io=require(_0x72a0('0x8'))(new Redis(config[_0x72a0('0x6')]));function Agent(_0xce74c){this['id']=_0xce74c['id']||0x0;this[_0x72a0('0x9')]=_0xce74c[_0x72a0('0x9')]||'';this[_0x72a0('0xa')]=_0xce74c[_0x72a0('0xa')]||!![];this[_0x72a0('0xb')]=_0xce74c[_0x72a0('0xb')]||![];this[_0x72a0('0xc')]=_0xce74c[_0x72a0('0xc')]||![];this[_0x72a0('0xd')]=_0xce74c[_0x72a0('0xd')]||![];this['faxPause']=_0xce74c[_0x72a0('0xe')]||![];this[_0x72a0('0xf')]=_0xce74c['smsPause']||![];this[_0x72a0('0x10')]=_0xce74c[_0x72a0('0x10')]||![];this[_0x72a0('0x11')]=_0x72a0('0x12');this[_0x72a0('0x13')]=0x0;this['chatCapacity']=_0xce74c[_0x72a0('0x14')]||0x0;this[_0x72a0('0x15')]=0x0;this[_0x72a0('0x16')]=_0x72a0('0x12');this[_0x72a0('0x17')]=0x0;this[_0x72a0('0x18')]=_0xce74c[_0x72a0('0x18')]||0x0;this['mailCurrentCapacity']=0x0;this['faxStatus']=_0x72a0('0x12');this[_0x72a0('0x19')]=0x0;this[_0x72a0('0x1a')]=_0xce74c[_0x72a0('0x1a')]||0x0;this[_0x72a0('0x1b')]=0x0;this[_0x72a0('0x1c')]='unknown';this[_0x72a0('0x1d')]=0x0;this[_0x72a0('0x1e')]=_0xce74c[_0x72a0('0x1e')]||0x0;this[_0x72a0('0x1f')]=0x0;this[_0x72a0('0x20')]='unknown';this[_0x72a0('0x21')]=0x0;this[_0x72a0('0x22')]=_0xce74c[_0x72a0('0x22')]||0x0;this['whatsappCurrentCapacity']=0x0;this[_0x72a0('0x23')]=_0x72a0('0x12');this[_0x72a0('0x24')]=0x0;this[_0x72a0('0x25')]=_0xce74c['openchannelCapacity']||0x0;this[_0x72a0('0x26')]=0x0;this['busy']=![];this[_0x72a0('0x27')]=undefined;this[_0x72a0('0x1')]='';this[_0x72a0('0x28')]={};this['faxWaitingInteractions']={};this[_0x72a0('0x29')]={};this[_0x72a0('0x2a')]={};this[_0x72a0('0x2b')]={};this[_0x72a0('0x2c')]={};this['updateRealtime']();}Agent[_0x72a0('0x2d')][_0x72a0('0x2e')]=function(_0x1ddd54){if(this[_0x1ddd54+_0x72a0('0x2f')]>0x0){if(this[_0x1ddd54+_0x72a0('0x30')]>0x0&&this[_0x1ddd54+_0x72a0('0x2f')]>=this[_0x1ddd54+'Capacity']){return'maxcapacity';}else{return _0x72a0('0x31');}}else{return _0x72a0('0x32');}};Agent[_0x72a0('0x2d')][_0x72a0('0x33')]=function(){var _0xf5cb49=[_0x72a0('0x34'),_0x72a0('0x35'),_0x72a0('0x36'),_0x72a0('0x37'),_0x72a0('0x38'),'whatsapp'];for(var _0x304b92=0x0;_0x304b92<_0xf5cb49[_0x72a0('0x39')];_0x304b92+=0x1){var _0xc22d18=this[_0x72a0('0x2e')](_0xf5cb49[_0x304b92]);if(this[_0xf5cb49[_0x304b92]+_0x72a0('0x3a')]!==_0xc22d18){this[_0xf5cb49[_0x304b92]+_0x72a0('0x3b')]=_[_0x72a0('0x3c')](moment()[_0x72a0('0x3d')]('x'));}this[_0xf5cb49[_0x304b92]+_0x72a0('0x3a')]=_0xc22d18;}var _0x916733={'id':this['id'],'name':this['name'],'online':this[_0x72a0('0xa')],'voicePause':this[_0x72a0('0xb')],'chatPause':this[_0x72a0('0xc')],'mailPause':this[_0x72a0('0xd')],'smsPause':this[_0x72a0('0xf')],'faxPause':this[_0x72a0('0xe')],'openchannelPause':this[_0x72a0('0x10')],'chatStatus':this['chatStatus'],'chatStatusTime':this[_0x72a0('0x13')],'chatCapacity':this[_0x72a0('0x14')],'chatCurrentCapacity':this[_0x72a0('0x15')],'mailStatus':this[_0x72a0('0x16')],'mailStatusTime':this[_0x72a0('0x17')],'mailCapacity':this[_0x72a0('0x18')],'mailCurrentCapacity':this[_0x72a0('0x3e')],'faxStatus':this[_0x72a0('0x3f')],'faxStatusTime':this['faxStatusTime'],'faxCapacity':this[_0x72a0('0x1a')],'faxCurrentCapacity':this[_0x72a0('0x1b')],'smsStatus':this[_0x72a0('0x1c')],'smsStatusTime':this['smsStatusTime'],'smsCapacity':this[_0x72a0('0x1e')],'smsCurrentCapacity':this['smsCurrentCapacity'],'whatsappStatus':this[_0x72a0('0x20')],'whatsappStatusTime':this[_0x72a0('0x21')],'whatsappCapacity':this[_0x72a0('0x22')],'whatsappCurrentCapacity':this[_0x72a0('0x40')],'openchannelStatus':this[_0x72a0('0x23')],'openchannelStatusTime':this[_0x72a0('0x24')],'openchannelCapacity':this[_0x72a0('0x25')],'openchannelCurrentCapacity':this[_0x72a0('0x26')],'busy':this[_0x72a0('0x41')],'busyQueue':this[_0x72a0('0x27')],'chatWaitingInteractions':this[_0x72a0('0x28')],'faxWaitingInteractions':this[_0x72a0('0x42')],'mailWaitingInteractions':this['mailWaitingInteractions'],'openchannelWaitingInteractions':this[_0x72a0('0x2a')],'smsWaitingInteractions':this['smsWaitingInteractions'],'whatsappWaitingInteractions':this[_0x72a0('0x2c')]};var _0x13c251=md5(JSON[_0x72a0('0x43')](_0x916733));if(this[_0x72a0('0x1')]!==_0x13c251){this[_0x72a0('0x1')]=_0x13c251;io[_0x72a0('0x44')](_0x72a0('0x45'),_[_0x72a0('0x46')](_0x916733,[_0x72a0('0xa')]));}};module['exports']=Agent; \ No newline at end of file +var _0x4e2e=['mailCapacity','mailCurrentCapacity','faxStatus','faxCapacity','faxCurrentCapacity','smsStatus','smsStatusTime','smsCapacity','smsCurrentCapacity','whatsappStatus','whatsappStatusTime','whatsappCapacity','whatsappCurrentCapacity','openchannelStatus','openchannelStatusTime','openchannelCapacity','openchannelCurrentCapacity','busy','busyQueue','chatWaitingInteractions','faxWaitingInteractions','mailWaitingInteractions','openchannelWaitingInteractions','smsWaitingInteractions','whatsappWaitingInteractions','updateRealtime','getChannelStatus','CurrentCapacity','Capacity','working','idle','prototype','chat','openchannel','fax','whatsapp','length','StatusTime','toNumber','Status','mailStatusTime','emit','user:routing:update','md5','moment','ioredis','../../../config/environment','redis','defaults','localhost','socket.io-emitter','name','online','voicePause','chatPause','mailPause','faxPause','smsPause','openchannelPause','chatStatus','unknown','chatStatusTime','chatCapacity','chatCurrentCapacity','mailStatus'];(function(_0x269930,_0x400126){var _0x3b8f69=function(_0x5511af){while(--_0x5511af){_0x269930['push'](_0x269930['shift']());}};_0x3b8f69(++_0x400126);}(_0x4e2e,0x1f2));var _0xe4e2=function(_0x319a51,_0xfdcf08){_0x319a51=_0x319a51-0x0;var _0x4173b9=_0x4e2e[_0x319a51];return _0x4173b9;};'use strict';var _=require('lodash');var md5=require(_0xe4e2('0x0'));var moment=require(_0xe4e2('0x1'));var Redis=require(_0xe4e2('0x2'));var config=require(_0xe4e2('0x3'));config[_0xe4e2('0x4')]=_[_0xe4e2('0x5')](config['redis'],{'host':_0xe4e2('0x6'),'port':0x18eb});var io=require(_0xe4e2('0x7'))(new Redis(config[_0xe4e2('0x4')]));function Agent(_0x38c84c){this['id']=_0x38c84c['id']||0x0;this['name']=_0x38c84c[_0xe4e2('0x8')]||'';this[_0xe4e2('0x9')]=_0x38c84c[_0xe4e2('0x9')]||!![];this[_0xe4e2('0xa')]=_0x38c84c[_0xe4e2('0xa')]||![];this[_0xe4e2('0xb')]=_0x38c84c[_0xe4e2('0xb')]||![];this[_0xe4e2('0xc')]=_0x38c84c['mailPause']||![];this[_0xe4e2('0xd')]=_0x38c84c[_0xe4e2('0xd')]||![];this[_0xe4e2('0xe')]=_0x38c84c['smsPause']||![];this[_0xe4e2('0xf')]=_0x38c84c[_0xe4e2('0xf')]||![];this[_0xe4e2('0x10')]=_0xe4e2('0x11');this[_0xe4e2('0x12')]=0x0;this['chatCapacity']=_0x38c84c[_0xe4e2('0x13')]||0x0;this[_0xe4e2('0x14')]=0x0;this[_0xe4e2('0x15')]=_0xe4e2('0x11');this['mailStatusTime']=0x0;this[_0xe4e2('0x16')]=_0x38c84c[_0xe4e2('0x16')]||0x0;this[_0xe4e2('0x17')]=0x0;this[_0xe4e2('0x18')]=_0xe4e2('0x11');this['faxStatusTime']=0x0;this['faxCapacity']=_0x38c84c[_0xe4e2('0x19')]||0x0;this[_0xe4e2('0x1a')]=0x0;this[_0xe4e2('0x1b')]=_0xe4e2('0x11');this[_0xe4e2('0x1c')]=0x0;this['smsCapacity']=_0x38c84c[_0xe4e2('0x1d')]||0x0;this[_0xe4e2('0x1e')]=0x0;this[_0xe4e2('0x1f')]='unknown';this[_0xe4e2('0x20')]=0x0;this['whatsappCapacity']=_0x38c84c[_0xe4e2('0x21')]||0x0;this[_0xe4e2('0x22')]=0x0;this[_0xe4e2('0x23')]=_0xe4e2('0x11');this[_0xe4e2('0x24')]=0x0;this[_0xe4e2('0x25')]=_0x38c84c[_0xe4e2('0x25')]||0x0;this[_0xe4e2('0x26')]=0x0;this[_0xe4e2('0x27')]=![];this[_0xe4e2('0x28')]=undefined;this['md5']='';this[_0xe4e2('0x29')]={};this[_0xe4e2('0x2a')]={};this[_0xe4e2('0x2b')]={};this[_0xe4e2('0x2c')]={};this[_0xe4e2('0x2d')]={};this[_0xe4e2('0x2e')]={};this[_0xe4e2('0x2f')]();}Agent['prototype'][_0xe4e2('0x30')]=function(_0x2ab435){if(this[_0x2ab435+_0xe4e2('0x31')]>0x0){if(this[_0x2ab435+'Capacity']>0x0&&this[_0x2ab435+_0xe4e2('0x31')]>=this[_0x2ab435+_0xe4e2('0x32')]){return'maxcapacity';}else{return _0xe4e2('0x33');}}else{return _0xe4e2('0x34');}};Agent[_0xe4e2('0x35')][_0xe4e2('0x2f')]=function(){var _0x249b7e=['mail',_0xe4e2('0x36'),_0xe4e2('0x37'),_0xe4e2('0x38'),'sms',_0xe4e2('0x39')];for(var _0x41cfd9=0x0;_0x41cfd9<_0x249b7e[_0xe4e2('0x3a')];_0x41cfd9+=0x1){var _0x5ec692=this[_0xe4e2('0x30')](_0x249b7e[_0x41cfd9]);if(this[_0x249b7e[_0x41cfd9]+'Status']!==_0x5ec692){this[_0x249b7e[_0x41cfd9]+_0xe4e2('0x3b')]=_[_0xe4e2('0x3c')](moment()['format']('x'));}this[_0x249b7e[_0x41cfd9]+_0xe4e2('0x3d')]=_0x5ec692;}var _0x18e2e5={'id':this['id'],'name':this[_0xe4e2('0x8')],'online':this[_0xe4e2('0x9')],'voicePause':this[_0xe4e2('0xa')],'chatPause':this['chatPause'],'mailPause':this['mailPause'],'smsPause':this[_0xe4e2('0xe')],'faxPause':this[_0xe4e2('0xd')],'openchannelPause':this[_0xe4e2('0xf')],'chatStatus':this[_0xe4e2('0x10')],'chatStatusTime':this[_0xe4e2('0x12')],'chatCapacity':this[_0xe4e2('0x13')],'chatCurrentCapacity':this[_0xe4e2('0x14')],'mailStatus':this[_0xe4e2('0x15')],'mailStatusTime':this[_0xe4e2('0x3e')],'mailCapacity':this[_0xe4e2('0x16')],'mailCurrentCapacity':this[_0xe4e2('0x17')],'faxStatus':this[_0xe4e2('0x18')],'faxStatusTime':this['faxStatusTime'],'faxCapacity':this[_0xe4e2('0x19')],'faxCurrentCapacity':this[_0xe4e2('0x1a')],'smsStatus':this[_0xe4e2('0x1b')],'smsStatusTime':this[_0xe4e2('0x1c')],'smsCapacity':this[_0xe4e2('0x1d')],'smsCurrentCapacity':this[_0xe4e2('0x1e')],'whatsappStatus':this['whatsappStatus'],'whatsappStatusTime':this[_0xe4e2('0x20')],'whatsappCapacity':this[_0xe4e2('0x21')],'whatsappCurrentCapacity':this[_0xe4e2('0x22')],'openchannelStatus':this[_0xe4e2('0x23')],'openchannelStatusTime':this[_0xe4e2('0x24')],'openchannelCapacity':this[_0xe4e2('0x25')],'openchannelCurrentCapacity':this[_0xe4e2('0x26')],'busy':this[_0xe4e2('0x27')],'busyQueue':this[_0xe4e2('0x28')],'chatWaitingInteractions':this[_0xe4e2('0x29')],'faxWaitingInteractions':this[_0xe4e2('0x2a')],'mailWaitingInteractions':this['mailWaitingInteractions'],'openchannelWaitingInteractions':this[_0xe4e2('0x2c')],'smsWaitingInteractions':this['smsWaitingInteractions'],'whatsappWaitingInteractions':this[_0xe4e2('0x2e')]};var _0x2cd933=md5(JSON['stringify'](_0x18e2e5));if(this[_0xe4e2('0x0')]!==_0x2cd933){this[_0xe4e2('0x0')]=_0x2cd933;io[_0xe4e2('0x3f')](_0xe4e2('0x40'),_['omit'](_0x18e2e5,[_0xe4e2('0x9')]));}};module['exports']=Agent; \ No newline at end of file diff --git a/server/services/routing/model/chatQueue.js b/server/services/routing/model/chatQueue.js index d0461e7..dc4051b 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 _0xcf53=['strategy','beepall','Agents','mapAgentsId','waiting','updateRouting','updateRealtime','prototype','_rr','map','loggedIn','paused','length','chatPause','available','stringify','format','chat:queue:%s','chat_queue:save','exports','lodash','md5','util','../../../config/environment','redis','defaults','localhost','socket.io-emitter','name','timeout'];(function(_0x2e66c9,_0x570d10){var _0x835aac=function(_0x7fcb44){while(--_0x7fcb44){_0x2e66c9['push'](_0x2e66c9['shift']());}};_0x835aac(++_0x570d10);}(_0xcf53,0x8c));var _0x3cf5=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0xcf53[_0x14add3];return _0x4a174f;};'use strict';var _=require(_0x3cf5('0x0'));var md5=require(_0x3cf5('0x1'));var util=require(_0x3cf5('0x2'));var Redis=require('ioredis');var config=require(_0x3cf5('0x3'));config[_0x3cf5('0x4')]=_[_0x3cf5('0x5')](config[_0x3cf5('0x4')],{'host':_0x3cf5('0x6'),'port':0x18eb});var io=require(_0x3cf5('0x7'))(new Redis(config['redis']));function ChatQueue(_0xd10ca1){this['id']=_0xd10ca1['id']||0x0;this[_0x3cf5('0x8')]=_0xd10ca1[_0x3cf5('0x8')]||'';this[_0x3cf5('0x9')]=_0xd10ca1['timeout']||0xa;this[_0x3cf5('0xa')]=_0xd10ca1['strategy']||_0x3cf5('0xb');this['Agents']=_0xd10ca1[_0x3cf5('0xc')];this[_0x3cf5('0xd')]={};this[_0x3cf5('0xe')]=0x0;this[_0x3cf5('0x1')]='';this[_0x3cf5('0xf')]();this[_0x3cf5('0x10')]();}ChatQueue[_0x3cf5('0x11')][_0x3cf5('0xf')]=function(){var _0x22cdb1=this[_0x3cf5('0xd')][_0x3cf5('0x12')];this[_0x3cf5('0xd')]=_[_0x3cf5('0x13')](this[_0x3cf5('0xc')],'id');this['mapAgentsId'][_0x3cf5('0x12')]=_0x22cdb1;};ChatQueue[_0x3cf5('0x11')][_0x3cf5('0x10')]=function(){this[_0x3cf5('0x14')]=0x0;this[_0x3cf5('0x15')]=0x0;for(var _0x5a4bf4=0x0;_0x5a4bf4=0x0?this[_0x3cf5('0x18')]:0x0;var _0x3817c2={'id':this['id'],'available':this['available'],'loggedIn':this['loggedIn'],'name':this[_0x3cf5('0x8')],'paused':this['paused'],'waiting':this[_0x3cf5('0xe')]};var _0x299846=md5(JSON[_0x3cf5('0x19')](_0x3817c2));if(this[_0x3cf5('0x1')]!==_0x299846){this[_0x3cf5('0x1')]=_0x299846;io['to'](util[_0x3cf5('0x1a')](_0x3cf5('0x1b'),_0x3817c2[_0x3cf5('0x8')]))['emit'](_0x3cf5('0x1c'),_0x3817c2);}};module[_0x3cf5('0x1d')]=ChatQueue; \ No newline at end of file +var _0xdbb3=['online','chatPause','paused','available','waiting','stringify','format','chat:queue:%s','emit','chat_queue:save','exports','lodash','md5','util','../../../config/environment','redis','localhost','socket.io-emitter','name','timeout','strategy','Agents','updateRealtime','prototype','updateRouting','mapAgentsId','_rr','map','loggedIn','length'];(function(_0x5b2081,_0xfec3f1){var _0x402cad=function(_0x72de51){while(--_0x72de51){_0x5b2081['push'](_0x5b2081['shift']());}};_0x402cad(++_0xfec3f1);}(_0xdbb3,0x155));var _0x3dbb=function(_0x18ab2a,_0x4debcd){_0x18ab2a=_0x18ab2a-0x0;var _0x16dcee=_0xdbb3[_0x18ab2a];return _0x16dcee;};'use strict';var _=require(_0x3dbb('0x0'));var md5=require(_0x3dbb('0x1'));var util=require(_0x3dbb('0x2'));var Redis=require('ioredis');var config=require(_0x3dbb('0x3'));config[_0x3dbb('0x4')]=_['defaults'](config[_0x3dbb('0x4')],{'host':_0x3dbb('0x5'),'port':0x18eb});var io=require(_0x3dbb('0x6'))(new Redis(config[_0x3dbb('0x4')]));function ChatQueue(_0x1c617c){this['id']=_0x1c617c['id']||0x0;this[_0x3dbb('0x7')]=_0x1c617c[_0x3dbb('0x7')]||'';this[_0x3dbb('0x8')]=_0x1c617c[_0x3dbb('0x8')]||0xa;this[_0x3dbb('0x9')]=_0x1c617c[_0x3dbb('0x9')]||'beepall';this[_0x3dbb('0xa')]=_0x1c617c[_0x3dbb('0xa')];this['mapAgentsId']={};this['waiting']=0x0;this[_0x3dbb('0x1')]='';this['updateRouting']();this[_0x3dbb('0xb')]();}ChatQueue[_0x3dbb('0xc')][_0x3dbb('0xd')]=function(){var _0xb6fe1c=this[_0x3dbb('0xe')][_0x3dbb('0xf')];this[_0x3dbb('0xe')]=_[_0x3dbb('0x10')](this[_0x3dbb('0xa')],'id');this[_0x3dbb('0xe')]['_rr']=_0xb6fe1c;};ChatQueue[_0x3dbb('0xc')][_0x3dbb('0xb')]=function(){this[_0x3dbb('0x11')]=0x0;this['paused']=0x0;for(var _0x4be6ab=0x0;_0x4be6ab=0x0?this[_0x3dbb('0x16')]:0x0;var _0x511e95={'id':this['id'],'available':this[_0x3dbb('0x16')],'loggedIn':this[_0x3dbb('0x11')],'name':this['name'],'paused':this['paused'],'waiting':this[_0x3dbb('0x17')]};var _0x509eea=md5(JSON[_0x3dbb('0x18')](_0x511e95));if(this[_0x3dbb('0x1')]!==_0x509eea){this[_0x3dbb('0x1')]=_0x509eea;io['to'](util[_0x3dbb('0x19')](_0x3dbb('0x1a'),_0x511e95[_0x3dbb('0x7')]))[_0x3dbb('0x1b')](_0x3dbb('0x1c'),_0x511e95);}};module[_0x3dbb('0x1d')]=ChatQueue; \ No newline at end of file diff --git a/server/services/routing/model/faxQueue.js b/server/services/routing/model/faxQueue.js index 6581efd..8332d5e 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 _0x78fc=['timeout','strategy','beepall','Agents','updateRouting','updateRealtime','prototype','mapAgentsId','_rr','map','loggedIn','faxPause','available','paused','stringify','fax:queue:%s','emit','fax_queue:save','exports','lodash','md5','util','ioredis','../../../config/environment','redis','localhost','socket.io-emitter','name'];(function(_0x5678c9,_0x2bf9f){var _0x58bf55=function(_0x218608){while(--_0x218608){_0x5678c9['push'](_0x5678c9['shift']());}};_0x58bf55(++_0x2bf9f);}(_0x78fc,0x1d3));var _0xc78f=function(_0x680821,_0x23e67f){_0x680821=_0x680821-0x0;var _0x3f132c=_0x78fc[_0x680821];return _0x3f132c;};'use strict';var _=require(_0xc78f('0x0'));var md5=require(_0xc78f('0x1'));var util=require(_0xc78f('0x2'));var Redis=require(_0xc78f('0x3'));var config=require(_0xc78f('0x4'));config['redis']=_['defaults'](config[_0xc78f('0x5')],{'host':_0xc78f('0x6'),'port':0x18eb});var io=require(_0xc78f('0x7'))(new Redis(config[_0xc78f('0x5')]));function FaxQueue(_0x5bd65c){this['id']=_0x5bd65c['id']||0x0;this[_0xc78f('0x8')]=_0x5bd65c[_0xc78f('0x8')]||'';this[_0xc78f('0x9')]=_0x5bd65c[_0xc78f('0x9')]||0xa;this[_0xc78f('0xa')]=_0x5bd65c[_0xc78f('0xa')]||_0xc78f('0xb');this[_0xc78f('0xc')]=_0x5bd65c[_0xc78f('0xc')];this['mapAgentsId']={};this['waiting']=0x0;this[_0xc78f('0x1')]='';this[_0xc78f('0xd')]();this[_0xc78f('0xe')]();}FaxQueue[_0xc78f('0xf')]['updateRouting']=function(){var _0x11e5cd=this[_0xc78f('0x10')][_0xc78f('0x11')];this['mapAgentsId']=_[_0xc78f('0x12')](this[_0xc78f('0xc')],'id');this[_0xc78f('0x10')][_0xc78f('0x11')]=_0x11e5cd;};FaxQueue[_0xc78f('0xf')][_0xc78f('0xe')]=function(){this[_0xc78f('0x13')]=0x0;this['paused']=0x0;for(var _0x12c5a2=0x0;_0x12c5a2=0x0?this['available']:0x0;var _0xd85de5={'id':this['id'],'available':this[_0xc78f('0x15')],'loggedIn':this[_0xc78f('0x13')],'name':this[_0xc78f('0x8')],'paused':this['paused'],'waiting':this['waiting']};var _0x49b9c8=md5(JSON[_0xc78f('0x17')](_0xd85de5));if(this[_0xc78f('0x1')]!==_0x49b9c8){this[_0xc78f('0x1')]=_0x49b9c8;io['to'](util['format'](_0xc78f('0x18'),_0xd85de5['name']))[_0xc78f('0x19')](_0xc78f('0x1a'),_0xd85de5);}};module[_0xc78f('0x1b')]=FaxQueue; \ No newline at end of file +var _0x26d7=['lodash','md5','util','ioredis','../../../config/environment','redis','defaults','localhost','name','timeout','strategy','beepall','Agents','mapAgentsId','updateRouting','prototype','_rr','map','updateRealtime','loggedIn','paused','online','faxPause','available','waiting','stringify','format','fax:queue:%s','emit','fax_queue:save'];(function(_0x10bae6,_0x41d85f){var _0x251123=function(_0x548886){while(--_0x548886){_0x10bae6['push'](_0x10bae6['shift']());}};_0x251123(++_0x41d85f);}(_0x26d7,0x168));var _0x726d=function(_0x479e0b,_0x42fc9d){_0x479e0b=_0x479e0b-0x0;var _0x18cff1=_0x26d7[_0x479e0b];return _0x18cff1;};'use strict';var _=require(_0x726d('0x0'));var md5=require(_0x726d('0x1'));var util=require(_0x726d('0x2'));var Redis=require(_0x726d('0x3'));var config=require(_0x726d('0x4'));config[_0x726d('0x5')]=_[_0x726d('0x6')](config['redis'],{'host':_0x726d('0x7'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0x726d('0x5')]));function FaxQueue(_0x500c79){this['id']=_0x500c79['id']||0x0;this[_0x726d('0x8')]=_0x500c79['name']||'';this[_0x726d('0x9')]=_0x500c79[_0x726d('0x9')]||0xa;this['strategy']=_0x500c79[_0x726d('0xa')]||_0x726d('0xb');this[_0x726d('0xc')]=_0x500c79[_0x726d('0xc')];this[_0x726d('0xd')]={};this['waiting']=0x0;this[_0x726d('0x1')]='';this[_0x726d('0xe')]();this['updateRealtime']();}FaxQueue[_0x726d('0xf')][_0x726d('0xe')]=function(){var _0x21d0dc=this[_0x726d('0xd')][_0x726d('0x10')];this['mapAgentsId']=_[_0x726d('0x11')](this['Agents'],'id');this[_0x726d('0xd')][_0x726d('0x10')]=_0x21d0dc;};FaxQueue[_0x726d('0xf')][_0x726d('0x12')]=function(){this[_0x726d('0x13')]=0x0;this[_0x726d('0x14')]=0x0;for(var _0x3e6886=0x0;_0x3e6886=0x0?this[_0x726d('0x17')]:0x0;var _0x3e8a83={'id':this['id'],'available':this[_0x726d('0x17')],'loggedIn':this[_0x726d('0x13')],'name':this[_0x726d('0x8')],'paused':this[_0x726d('0x14')],'waiting':this[_0x726d('0x18')]};var _0x52dba8=md5(JSON[_0x726d('0x19')](_0x3e8a83));if(this['md5']!==_0x52dba8){this[_0x726d('0x1')]=_0x52dba8;io['to'](util[_0x726d('0x1a')](_0x726d('0x1b'),_0x3e8a83['name']))[_0x726d('0x1c')](_0x726d('0x1d'),_0x3e8a83);}};module['exports']=FaxQueue; \ No newline at end of file diff --git a/server/services/routing/model/interval.js b/server/services/routing/model/interval.js index 24fd833..6573df7 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 _0xf482=['exports','Intervals'];(function(_0x2d43bf,_0x11328a){var _0x6abec9=function(_0x137a67){while(--_0x137a67){_0x2d43bf['push'](_0x2d43bf['shift']());}};_0x6abec9(++_0x11328a);}(_0xf482,0x16f));var _0x2f48=function(_0x28809a,_0x573a8f){_0x28809a=_0x28809a-0x0;var _0x45b659=_0xf482[_0x28809a];return _0x45b659;};'use strict';function Interval(_0x1ee152){this['id']=_0x1ee152['id']||0x0;this['name']=_0x1ee152['name']||'';this[_0x2f48('0x0')]=_0x1ee152[_0x2f48('0x0')]||{};}module[_0x2f48('0x1')]=Interval; \ No newline at end of file +var _0xfc4a=['exports','name','Intervals'];(function(_0x34cee9,_0x21c4f4){var _0xe6016e=function(_0x11a6d6){while(--_0x11a6d6){_0x34cee9['push'](_0x34cee9['shift']());}};_0xe6016e(++_0x21c4f4);}(_0xfc4a,0x1f3));var _0xafc4=function(_0x2dbca3,_0x11762c){_0x2dbca3=_0x2dbca3-0x0;var _0x47c6f2=_0xfc4a[_0x2dbca3];return _0x47c6f2;};'use strict';function Interval(_0x4e73a3){this['id']=_0x4e73a3['id']||0x0;this[_0xafc4('0x0')]=_0x4e73a3[_0xafc4('0x0')]||'';this['Intervals']=_0x4e73a3[_0xafc4('0x1')]||{};}module[_0xafc4('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 483f3e5..23b4965 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 _0xcf99=['name','waiting','stringify','mail:queue:%s','emit','mail_queue:save','exports','lodash','util','ioredis','../../../config/environment','redis','localhost','strategy','Agents','mapAgentsId','md5','updateRouting','updateRealtime','prototype','_rr','loggedIn','paused','length','online','mailPause','available'];(function(_0x4a522f,_0x90a85f){var _0x25d72=function(_0x1caaf6){while(--_0x1caaf6){_0x4a522f['push'](_0x4a522f['shift']());}};_0x25d72(++_0x90a85f);}(_0xcf99,0x130));var _0x9cf9=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xcf99[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0x9cf9('0x0'));var md5=require('md5');var util=require(_0x9cf9('0x1'));var Redis=require(_0x9cf9('0x2'));var config=require(_0x9cf9('0x3'));config['redis']=_['defaults'](config[_0x9cf9('0x4')],{'host':_0x9cf9('0x5'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0x9cf9('0x4')]));function MailQueue(_0x127720){this['id']=_0x127720['id']||0x0;this['name']=_0x127720['name']||'';this['timeout']=_0x127720['timeout']||0xa;this[_0x9cf9('0x6')]=_0x127720[_0x9cf9('0x6')]||'beepall';this['Agents']=_0x127720[_0x9cf9('0x7')];this[_0x9cf9('0x8')]={};this['waiting']=0x0;this[_0x9cf9('0x9')]='';this[_0x9cf9('0xa')]();this[_0x9cf9('0xb')]();}MailQueue[_0x9cf9('0xc')][_0x9cf9('0xa')]=function(){var _0x3c4641=this[_0x9cf9('0x8')][_0x9cf9('0xd')];this[_0x9cf9('0x8')]=_['map'](this[_0x9cf9('0x7')],'id');this[_0x9cf9('0x8')][_0x9cf9('0xd')]=_0x3c4641;};MailQueue[_0x9cf9('0xc')][_0x9cf9('0xb')]=function(){this[_0x9cf9('0xe')]=0x0;this[_0x9cf9('0xf')]=0x0;for(var _0x56aa3c=0x0;_0x56aa3c=0x0?this[_0x9cf9('0x13')]:0x0;var _0x5015c8={'id':this['id'],'available':this[_0x9cf9('0x13')],'loggedIn':this['loggedIn'],'name':this[_0x9cf9('0x14')],'paused':this[_0x9cf9('0xf')],'waiting':this[_0x9cf9('0x15')]};var _0x357915=md5(JSON[_0x9cf9('0x16')](_0x5015c8));if(this['md5']!==_0x357915){this['md5']=_0x357915;io['to'](util['format'](_0x9cf9('0x17'),_0x5015c8[_0x9cf9('0x14')]))[_0x9cf9('0x18')](_0x9cf9('0x19'),_0x5015c8);}};module[_0x9cf9('0x1a')]=MailQueue; \ No newline at end of file +var _0x3b62=['mailPause','available','waiting','stringify','format','mail:queue:%s','emit','mail_queue:save','exports','lodash','md5','util','ioredis','../../../config/environment','redis','localhost','name','timeout','strategy','beepall','Agents','updateRealtime','updateRouting','mapAgentsId','_rr','map','prototype','loggedIn','paused','length','online'];(function(_0x452ccb,_0x109ae7){var _0x43f005=function(_0x3e10e3){while(--_0x3e10e3){_0x452ccb['push'](_0x452ccb['shift']());}};_0x43f005(++_0x109ae7);}(_0x3b62,0xa4));var _0x23b6=function(_0x593fa0,_0x23b388){_0x593fa0=_0x593fa0-0x0;var _0x452eee=_0x3b62[_0x593fa0];return _0x452eee;};'use strict';var _=require(_0x23b6('0x0'));var md5=require(_0x23b6('0x1'));var util=require(_0x23b6('0x2'));var Redis=require(_0x23b6('0x3'));var config=require(_0x23b6('0x4'));config[_0x23b6('0x5')]=_['defaults'](config['redis'],{'host':_0x23b6('0x6'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0x23b6('0x5')]));function MailQueue(_0x24cf0a){this['id']=_0x24cf0a['id']||0x0;this[_0x23b6('0x7')]=_0x24cf0a[_0x23b6('0x7')]||'';this[_0x23b6('0x8')]=_0x24cf0a['timeout']||0xa;this[_0x23b6('0x9')]=_0x24cf0a['strategy']||_0x23b6('0xa');this[_0x23b6('0xb')]=_0x24cf0a[_0x23b6('0xb')];this['mapAgentsId']={};this['waiting']=0x0;this[_0x23b6('0x1')]='';this['updateRouting']();this[_0x23b6('0xc')]();}MailQueue['prototype'][_0x23b6('0xd')]=function(){var _0x1da9b5=this[_0x23b6('0xe')][_0x23b6('0xf')];this[_0x23b6('0xe')]=_[_0x23b6('0x10')](this[_0x23b6('0xb')],'id');this[_0x23b6('0xe')][_0x23b6('0xf')]=_0x1da9b5;};MailQueue[_0x23b6('0x11')]['updateRealtime']=function(){this[_0x23b6('0x12')]=0x0;this[_0x23b6('0x13')]=0x0;for(var _0x1c5b6c=0x0;_0x1c5b6c=0x0?this[_0x23b6('0x17')]:0x0;var _0x1027b0={'id':this['id'],'available':this[_0x23b6('0x17')],'loggedIn':this[_0x23b6('0x12')],'name':this[_0x23b6('0x7')],'paused':this['paused'],'waiting':this[_0x23b6('0x18')]};var _0x3ed837=md5(JSON[_0x23b6('0x19')](_0x1027b0));if(this[_0x23b6('0x1')]!==_0x3ed837){this[_0x23b6('0x1')]=_0x3ed837;io['to'](util[_0x23b6('0x1a')](_0x23b6('0x1b'),_0x1027b0[_0x23b6('0x7')]))[_0x23b6('0x1c')](_0x23b6('0x1d'),_0x1027b0);}};module[_0x23b6('0x1e')]=MailQueue; \ No newline at end of file diff --git a/server/services/routing/model/openchannelQueue.js b/server/services/routing/model/openchannelQueue.js index e9486b4..2b97203 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 _0x5fc3=['format','openchannel:queue:%s','name','emit','openchannel_queue:save','exports','lodash','md5','ioredis','../../../config/environment','redis','defaults','socket.io-emitter','timeout','strategy','beepall','Agents','mapAgentsId','waiting','updateRouting','updateRealtime','_rr','prototype','loggedIn','paused','openchannelPause','available'];(function(_0x146f25,_0x1d6489){var _0x2c17a2=function(_0x368e9a){while(--_0x368e9a){_0x146f25['push'](_0x146f25['shift']());}};_0x2c17a2(++_0x1d6489);}(_0x5fc3,0xa8));var _0x35fc=function(_0x279d37,_0x14de3f){_0x279d37=_0x279d37-0x0;var _0x530173=_0x5fc3[_0x279d37];return _0x530173;};'use strict';var _=require(_0x35fc('0x0'));var md5=require(_0x35fc('0x1'));var util=require('util');var Redis=require(_0x35fc('0x2'));var config=require(_0x35fc('0x3'));config[_0x35fc('0x4')]=_[_0x35fc('0x5')](config[_0x35fc('0x4')],{'host':'localhost','port':0x18eb});var io=require(_0x35fc('0x6'))(new Redis(config[_0x35fc('0x4')]));function OpenchannelQueue(_0x186a06){this['id']=_0x186a06['id']||0x0;this['name']=_0x186a06['name']||'';this[_0x35fc('0x7')]=_0x186a06['timeout']||0xa;this[_0x35fc('0x8')]=_0x186a06[_0x35fc('0x8')]||_0x35fc('0x9');this[_0x35fc('0xa')]=_0x186a06[_0x35fc('0xa')];this[_0x35fc('0xb')]={};this[_0x35fc('0xc')]=0x0;this['md5']='';this[_0x35fc('0xd')]();this[_0x35fc('0xe')]();}OpenchannelQueue['prototype'][_0x35fc('0xd')]=function(){var _0x33f491=this['mapAgentsId'][_0x35fc('0xf')];this[_0x35fc('0xb')]=_['map'](this['Agents'],'id');this[_0x35fc('0xb')]['_rr']=_0x33f491;};OpenchannelQueue[_0x35fc('0x10')][_0x35fc('0xe')]=function(){this[_0x35fc('0x11')]=0x0;this[_0x35fc('0x12')]=0x0;for(var _0x38d9f2=0x0;_0x38d9f2=0x0?this['available']:0x0;var _0x41e165={'id':this['id'],'available':this[_0x35fc('0x14')],'loggedIn':this[_0x35fc('0x11')],'name':this['name'],'paused':this[_0x35fc('0x12')],'waiting':this[_0x35fc('0xc')]};var _0x465eb3=md5(JSON['stringify'](_0x41e165));if(this[_0x35fc('0x1')]!==_0x465eb3){this[_0x35fc('0x1')]=_0x465eb3;io['to'](util[_0x35fc('0x15')](_0x35fc('0x16'),_0x41e165[_0x35fc('0x17')]))[_0x35fc('0x18')](_0x35fc('0x19'),_0x41e165);}};module[_0x35fc('0x1a')]=OpenchannelQueue; \ No newline at end of file +var _0xc4aa=['strategy','Agents','mapAgentsId','updateRouting','updateRealtime','map','_rr','prototype','loggedIn','paused','length','online','available','waiting','stringify','format','openchannel:queue:%s','emit','openchannel_queue:save','lodash','md5','util','ioredis','../../../config/environment','redis','socket.io-emitter','name','timeout'];(function(_0x45783c,_0x49c56d){var _0x1161da=function(_0x3c5d41){while(--_0x3c5d41){_0x45783c['push'](_0x45783c['shift']());}};_0x1161da(++_0x49c56d);}(_0xc4aa,0x1b7));var _0xac4a=function(_0x4a747d,_0x3b747f){_0x4a747d=_0x4a747d-0x0;var _0x3a5b5c=_0xc4aa[_0x4a747d];return _0x3a5b5c;};'use strict';var _=require(_0xac4a('0x0'));var md5=require(_0xac4a('0x1'));var util=require(_0xac4a('0x2'));var Redis=require(_0xac4a('0x3'));var config=require(_0xac4a('0x4'));config[_0xac4a('0x5')]=_['defaults'](config['redis'],{'host':'localhost','port':0x18eb});var io=require(_0xac4a('0x6'))(new Redis(config[_0xac4a('0x5')]));function OpenchannelQueue(_0x730a38){this['id']=_0x730a38['id']||0x0;this[_0xac4a('0x7')]=_0x730a38[_0xac4a('0x7')]||'';this[_0xac4a('0x8')]=_0x730a38[_0xac4a('0x8')]||0xa;this[_0xac4a('0x9')]=_0x730a38['strategy']||'beepall';this[_0xac4a('0xa')]=_0x730a38[_0xac4a('0xa')];this[_0xac4a('0xb')]={};this['waiting']=0x0;this[_0xac4a('0x1')]='';this[_0xac4a('0xc')]();this[_0xac4a('0xd')]();}OpenchannelQueue['prototype'][_0xac4a('0xc')]=function(){var _0x488e3c=this[_0xac4a('0xb')]['_rr'];this[_0xac4a('0xb')]=_[_0xac4a('0xe')](this[_0xac4a('0xa')],'id');this['mapAgentsId'][_0xac4a('0xf')]=_0x488e3c;};OpenchannelQueue[_0xac4a('0x10')][_0xac4a('0xd')]=function(){this[_0xac4a('0x11')]=0x0;this[_0xac4a('0x12')]=0x0;for(var _0x3b71c0=0x0;_0x3b71c0=0x0?this[_0xac4a('0x15')]:0x0;var _0x44ec59={'id':this['id'],'available':this['available'],'loggedIn':this['loggedIn'],'name':this[_0xac4a('0x7')],'paused':this[_0xac4a('0x12')],'waiting':this[_0xac4a('0x16')]};var _0x4d837c=md5(JSON[_0xac4a('0x17')](_0x44ec59));if(this[_0xac4a('0x1')]!==_0x4d837c){this[_0xac4a('0x1')]=_0x4d837c;io['to'](util[_0xac4a('0x18')](_0xac4a('0x19'),_0x44ec59[_0xac4a('0x7')]))[_0xac4a('0x1a')](_0xac4a('0x1b'),_0x44ec59);}};module['exports']=OpenchannelQueue; \ No newline at end of file diff --git a/server/services/routing/model/smsQueue.js b/server/services/routing/model/smsQueue.js index d3325f9..49f32f9 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 _0x61a5=['lodash','util','ioredis','../../../config/environment','redis','defaults','localhost','socket.io-emitter','name','timeout','strategy','Agents','mapAgentsId','waiting','updateRouting','updateRealtime','_rr','map','prototype','loggedIn','paused','length','online','smsPause','available','md5','sms:queue:%s','emit','sms_queue:save','exports'];(function(_0x59943d,_0x2e751b){var _0x46ace9=function(_0xfbd5f2){while(--_0xfbd5f2){_0x59943d['push'](_0x59943d['shift']());}};_0x46ace9(++_0x2e751b);}(_0x61a5,0xf0));var _0x561a=function(_0x584b9d,_0x1cb5c5){_0x584b9d=_0x584b9d-0x0;var _0x172053=_0x61a5[_0x584b9d];return _0x172053;};'use strict';var _=require(_0x561a('0x0'));var md5=require('md5');var util=require(_0x561a('0x1'));var Redis=require(_0x561a('0x2'));var config=require(_0x561a('0x3'));config[_0x561a('0x4')]=_[_0x561a('0x5')](config['redis'],{'host':_0x561a('0x6'),'port':0x18eb});var io=require(_0x561a('0x7'))(new Redis(config['redis']));function SmsQueue(_0x18902a){this['id']=_0x18902a['id']||0x0;this[_0x561a('0x8')]=_0x18902a[_0x561a('0x8')]||'';this[_0x561a('0x9')]=_0x18902a[_0x561a('0x9')]||0xa;this[_0x561a('0xa')]=_0x18902a[_0x561a('0xa')]||'beepall';this[_0x561a('0xb')]=_0x18902a['Agents'];this[_0x561a('0xc')]={};this[_0x561a('0xd')]=0x0;this['md5']='';this[_0x561a('0xe')]();this[_0x561a('0xf')]();}SmsQueue['prototype'][_0x561a('0xe')]=function(){var _0x5cc8ed=this[_0x561a('0xc')][_0x561a('0x10')];this[_0x561a('0xc')]=_[_0x561a('0x11')](this[_0x561a('0xb')],'id');this[_0x561a('0xc')][_0x561a('0x10')]=_0x5cc8ed;};SmsQueue[_0x561a('0x12')][_0x561a('0xf')]=function(){this[_0x561a('0x13')]=0x0;this[_0x561a('0x14')]=0x0;for(var _0x28638b=0x0;_0x28638b=0x0?this[_0x561a('0x18')]:0x0;var _0x190057={'id':this['id'],'available':this['available'],'loggedIn':this[_0x561a('0x13')],'name':this[_0x561a('0x8')],'paused':this['paused'],'waiting':this[_0x561a('0xd')]};var _0x567399=md5(JSON['stringify'](_0x190057));if(this[_0x561a('0x19')]!==_0x567399){this[_0x561a('0x19')]=_0x567399;io['to'](util['format'](_0x561a('0x1a'),_0x190057[_0x561a('0x8')]))[_0x561a('0x1b')](_0x561a('0x1c'),_0x190057);}};module[_0x561a('0x1d')]=SmsQueue; \ No newline at end of file +var _0xde64=['sms_queue:save','exports','lodash','md5','util','ioredis','../../../config/environment','redis','localhost','name','timeout','strategy','beepall','Agents','waiting','updateRouting','prototype','mapAgentsId','_rr','map','updateRealtime','loggedIn','paused','length','available','stringify','format'];(function(_0x5785c2,_0x4bef9a){var _0xf58ddc=function(_0x23f3a9){while(--_0x23f3a9){_0x5785c2['push'](_0x5785c2['shift']());}};_0xf58ddc(++_0x4bef9a);}(_0xde64,0x17c));var _0x4de6=function(_0x129575,_0x59ddc2){_0x129575=_0x129575-0x0;var _0x186de6=_0xde64[_0x129575];return _0x186de6;};'use strict';var _=require(_0x4de6('0x0'));var md5=require(_0x4de6('0x1'));var util=require(_0x4de6('0x2'));var Redis=require(_0x4de6('0x3'));var config=require(_0x4de6('0x4'));config[_0x4de6('0x5')]=_['defaults'](config[_0x4de6('0x5')],{'host':_0x4de6('0x6'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config['redis']));function SmsQueue(_0xe0bed){this['id']=_0xe0bed['id']||0x0;this[_0x4de6('0x7')]=_0xe0bed['name']||'';this['timeout']=_0xe0bed[_0x4de6('0x8')]||0xa;this[_0x4de6('0x9')]=_0xe0bed[_0x4de6('0x9')]||_0x4de6('0xa');this[_0x4de6('0xb')]=_0xe0bed[_0x4de6('0xb')];this['mapAgentsId']={};this[_0x4de6('0xc')]=0x0;this[_0x4de6('0x1')]='';this[_0x4de6('0xd')]();this['updateRealtime']();}SmsQueue[_0x4de6('0xe')][_0x4de6('0xd')]=function(){var _0x2e205b=this[_0x4de6('0xf')][_0x4de6('0x10')];this['mapAgentsId']=_[_0x4de6('0x11')](this[_0x4de6('0xb')],'id');this[_0x4de6('0xf')]['_rr']=_0x2e205b;};SmsQueue[_0x4de6('0xe')][_0x4de6('0x12')]=function(){this[_0x4de6('0x13')]=0x0;this[_0x4de6('0x14')]=0x0;for(var _0x58b0c1=0x0;_0x58b0c1=0x0?this[_0x4de6('0x16')]:0x0;var _0x5aacb4={'id':this['id'],'available':this[_0x4de6('0x16')],'loggedIn':this[_0x4de6('0x13')],'name':this[_0x4de6('0x7')],'paused':this[_0x4de6('0x14')],'waiting':this[_0x4de6('0xc')]};var _0x360cf7=md5(JSON[_0x4de6('0x17')](_0x5aacb4));if(this[_0x4de6('0x1')]!==_0x360cf7){this[_0x4de6('0x1')]=_0x360cf7;io['to'](util[_0x4de6('0x18')]('sms:queue:%s',_0x5aacb4[_0x4de6('0x7')]))['emit'](_0x4de6('0x19'),_0x5aacb4);}};module[_0x4de6('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 47d0d4e..ba1ef46 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 _0x16ec=['timeout','strategy','beepall','Agents','mapAgentsId','waiting','updateRouting','updateRealtime','_rr','map','loggedIn','paused','length','online','whatsappPause','available','stringify','format','whatsapp:queue:%s','emit','whatsapp_queue:save','md5','ioredis','defaults','redis','socket.io-emitter','name'];(function(_0x16b10e,_0x9f999d){var _0x5324b5=function(_0x3b82f6){while(--_0x3b82f6){_0x16b10e['push'](_0x16b10e['shift']());}};_0x5324b5(++_0x9f999d);}(_0x16ec,0x13e));var _0xc16e=function(_0x506c5e,_0x518311){_0x506c5e=_0x506c5e-0x0;var _0x5b11f7=_0x16ec[_0x506c5e];return _0x5b11f7;};'use strict';var _=require('lodash');var md5=require(_0xc16e('0x0'));var util=require('util');var Redis=require(_0xc16e('0x1'));var config=require('../../../config/environment');config['redis']=_[_0xc16e('0x2')](config[_0xc16e('0x3')],{'host':'localhost','port':0x18eb});var io=require(_0xc16e('0x4'))(new Redis(config[_0xc16e('0x3')]));function WhatsappQueue(_0x437f07){this['id']=_0x437f07['id']||0x0;this['name']=_0x437f07[_0xc16e('0x5')]||'';this[_0xc16e('0x6')]=_0x437f07[_0xc16e('0x6')]||0xa;this[_0xc16e('0x7')]=_0x437f07[_0xc16e('0x7')]||_0xc16e('0x8');this[_0xc16e('0x9')]=_0x437f07[_0xc16e('0x9')];this[_0xc16e('0xa')]={};this[_0xc16e('0xb')]=0x0;this[_0xc16e('0x0')]='';this[_0xc16e('0xc')]();this[_0xc16e('0xd')]();}WhatsappQueue['prototype'][_0xc16e('0xc')]=function(){var _0x13812b=this['mapAgentsId'][_0xc16e('0xe')];this[_0xc16e('0xa')]=_[_0xc16e('0xf')](this['Agents'],'id');this[_0xc16e('0xa')][_0xc16e('0xe')]=_0x13812b;};WhatsappQueue['prototype'][_0xc16e('0xd')]=function(){this[_0xc16e('0x10')]=0x0;this[_0xc16e('0x11')]=0x0;for(var _0x2c89b5=0x0;_0x2c89b5=0x0?this['available']:0x0;var _0x434c17={'id':this['id'],'available':this['available'],'loggedIn':this[_0xc16e('0x10')],'name':this['name'],'paused':this[_0xc16e('0x11')],'waiting':this[_0xc16e('0xb')]};var _0x30ef66=md5(JSON[_0xc16e('0x16')](_0x434c17));if(this[_0xc16e('0x0')]!==_0x30ef66){this[_0xc16e('0x0')]=_0x30ef66;io['to'](util[_0xc16e('0x17')](_0xc16e('0x18'),_0x434c17[_0xc16e('0x5')]))[_0xc16e('0x19')](_0xc16e('0x1a'),_0x434c17);}};module['exports']=WhatsappQueue; \ No newline at end of file +var _0x1dae=['socket.io-emitter','name','timeout','strategy','beepall','Agents','updateRouting','updateRealtime','prototype','mapAgentsId','_rr','map','length','loggedIn','whatsappPause','paused','available','waiting','format','whatsapp:queue:%s','emit','exports','lodash','md5','util','ioredis','../../../config/environment','redis','localhost'];(function(_0x5e88a1,_0x3a9f75){var _0x32a879=function(_0x300eec){while(--_0x300eec){_0x5e88a1['push'](_0x5e88a1['shift']());}};_0x32a879(++_0x3a9f75);}(_0x1dae,0x1e6));var _0xe1da=function(_0x3673f1,_0x47f6d7){_0x3673f1=_0x3673f1-0x0;var _0x4bd6fd=_0x1dae[_0x3673f1];return _0x4bd6fd;};'use strict';var _=require(_0xe1da('0x0'));var md5=require(_0xe1da('0x1'));var util=require(_0xe1da('0x2'));var Redis=require(_0xe1da('0x3'));var config=require(_0xe1da('0x4'));config[_0xe1da('0x5')]=_['defaults'](config[_0xe1da('0x5')],{'host':_0xe1da('0x6'),'port':0x18eb});var io=require(_0xe1da('0x7'))(new Redis(config[_0xe1da('0x5')]));function WhatsappQueue(_0x1d5191){this['id']=_0x1d5191['id']||0x0;this[_0xe1da('0x8')]=_0x1d5191[_0xe1da('0x8')]||'';this['timeout']=_0x1d5191[_0xe1da('0x9')]||0xa;this[_0xe1da('0xa')]=_0x1d5191[_0xe1da('0xa')]||_0xe1da('0xb');this[_0xe1da('0xc')]=_0x1d5191['Agents'];this['mapAgentsId']={};this['waiting']=0x0;this[_0xe1da('0x1')]='';this[_0xe1da('0xd')]();this[_0xe1da('0xe')]();}WhatsappQueue[_0xe1da('0xf')][_0xe1da('0xd')]=function(){var _0xea4a0=this[_0xe1da('0x10')][_0xe1da('0x11')];this[_0xe1da('0x10')]=_[_0xe1da('0x12')](this['Agents'],'id');this[_0xe1da('0x10')][_0xe1da('0x11')]=_0xea4a0;};WhatsappQueue[_0xe1da('0xf')][_0xe1da('0xe')]=function(){this['loggedIn']=0x0;this['paused']=0x0;for(var _0xaeb7a1=0x0;_0xaeb7a1=0x0?this[_0xe1da('0x17')]:0x0;var _0x2127ac={'id':this['id'],'available':this[_0xe1da('0x17')],'loggedIn':this['loggedIn'],'name':this[_0xe1da('0x8')],'paused':this[_0xe1da('0x16')],'waiting':this[_0xe1da('0x18')]};var _0xde173f=md5(JSON['stringify'](_0x2127ac));if(this[_0xe1da('0x1')]!==_0xde173f){this[_0xe1da('0x1')]=_0xde173f;io['to'](util[_0xe1da('0x19')](_0xe1da('0x1a'),_0x2127ac['name']))[_0xe1da('0x1b')]('whatsapp_queue:save',_0x2127ac);}};module[_0xe1da('0x1c')]=WhatsappQueue; \ No newline at end of file diff --git a/server/services/routing/realtime/index.js b/server/services/routing/realtime/index.js index e2a2052..b978420 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(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xa9e0,0x123));var _0x0a9e=function(_0x411add,_0x1aed38){_0x411add=_0x411add-0x0;var _0x238242=_0xa9e0[_0x411add];return _0x238242;};'use strict';var BPromise=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var _=require(_0x0a9e('0x2'));var moment=require('moment');var Agent=require('../model/agent');var Interval=require(_0x0a9e('0x3'));var OpenchannelQueue=require('../model/openchannelQueue');var ChatQueue=require(_0x0a9e('0x4'));var SmsQueue=require(_0x0a9e('0x5'));var MailQueue=require(_0x0a9e('0x6'));var FaxQueue=require(_0x0a9e('0x7'));var WhatsappQueue=require(_0x0a9e('0x8'));var Realtime=function(){this['agents']={};this[_0x0a9e('0x9')]={};this[_0x0a9e('0xa')]={};this[_0x0a9e('0xb')]={};this['smsQueues']={};this['mailQueues']={};this[_0x0a9e('0xc')]={};this['whatsappQueues']={};this['chatQueuesWaitingInteractions']={};this[_0x0a9e('0xd')]={};this[_0x0a9e('0xe')]={};this[_0x0a9e('0xf')]={};this[_0x0a9e('0x10')]={};this[_0x0a9e('0x11')]={};};function freeIsNotKey(_0xbd1168,_0x4a4c56,_0x50dfb2){var _0x527cdd=_['mapKeys'](_0xbd1168,function(_0x273d4d,_0x36471c){return _0x273d4d[_0x50dfb2];});for(var _0xd5b662 in _0x4a4c56){if(_0x4a4c56[_0x0a9e('0x12')](_0xd5b662)){if(!_0x527cdd[_0xd5b662]){delete _0x4a4c56[_0xd5b662];}}}}Realtime[_0x0a9e('0x13')][_0x0a9e('0x14')]=function(_0x5db4b0,_0x4283ce){for(var _0x239b12 in _0x4283ce){if(_0x5db4b0[_0x0a9e('0x12')](_0x239b12)){_0x5db4b0[_0x239b12]=_0x4283ce[_0x239b12];}}};Realtime[_0x0a9e('0x13')][_0x0a9e('0x15')]=function(){var _0x4d5611=this;return function(_0x52a03d){if(_0x52a03d){freeIsNotKey(_0x52a03d,_0x4d5611[_0x0a9e('0x16')],'id');for(var _0x5d0880=0x0,_0x1985b6={},_0x519dfd={};_0x5d0880<_0x52a03d[_0x0a9e('0x17')];_0x5d0880+=0x1){_0x1985b6=_0x52a03d[_0x5d0880];if(_[_0x0a9e('0x18')](_0x4d5611['agents'][_0x1985b6['id']])){_0x4d5611[_0x0a9e('0x16')][_0x1985b6['id']]=new Agent(_0x1985b6);}else{_0x4d5611['mergeFromDatabase'](_0x4d5611[_0x0a9e('0x16')][_0x1985b6['id']],_0x1985b6);}}}return _0x4d5611[_0x0a9e('0x16')];};};Realtime[_0x0a9e('0x13')][_0x0a9e('0x19')]=function(){var _0x31b1ca=this;return function(_0x2eb11f){if(_0x2eb11f){freeIsNotKey(_0x2eb11f,_0x31b1ca[_0x0a9e('0x9')],'id');for(var _0x20559e=0x0,_0x1314ae={},_0x112016={};_0x20559e<_0x2eb11f[_0x0a9e('0x17')];_0x20559e+=0x1){_0x1314ae=_0x2eb11f[_0x20559e];if(_[_0x0a9e('0x18')](_0x31b1ca['intervals'][_0x1314ae['id']])){_0x31b1ca[_0x0a9e('0x9')][_0x1314ae['id']]=new Interval(_0x1314ae);}else{_0x31b1ca[_0x0a9e('0x14')](_0x31b1ca['intervals'][_0x1314ae['id']],_0x1314ae);}}}return _0x31b1ca[_0x0a9e('0x9')];};};Realtime['prototype']['initOpenchannelQueues']=function(){var _0x3a02e1=this;return function(_0x432e56){if(_0x432e56){freeIsNotKey(_0x432e56,_0x3a02e1[_0x0a9e('0xa')],'id');for(var _0x30bae6=0x0,_0x4abc77={},_0xfb6e48={};_0x30bae6<_0x432e56[_0x0a9e('0x17')];_0x30bae6+=0x1){_0x4abc77=_0x432e56[_0x30bae6];if(_[_0x0a9e('0x18')](_0x3a02e1[_0x0a9e('0xa')][_0x4abc77['id']])){_0x3a02e1[_0x0a9e('0xa')][_0x4abc77['id']]=new OpenchannelQueue(_0x4abc77);}else{_0x3a02e1[_0x0a9e('0x14')](_0x3a02e1[_0x0a9e('0xa')][_0x4abc77['id']],_0x4abc77);}_0x3a02e1['openchannelQueues'][_0x4abc77['id']]['updateRouting']();_0x3a02e1[_0x0a9e('0xa')][_0x4abc77['id']][_0x0a9e('0x1a')]();}}return _0x3a02e1[_0x0a9e('0xa')];};};Realtime[_0x0a9e('0x13')]['initChatQueues']=function(){var _0x384319=this;return function(_0x479bc4){if(_0x479bc4){freeIsNotKey(_0x479bc4,_0x384319[_0x0a9e('0xb')],'id');for(var _0x5bfb33=0x0,_0x1dc186={},_0x34dc65={};_0x5bfb33<_0x479bc4[_0x0a9e('0x17')];_0x5bfb33+=0x1){_0x1dc186=_0x479bc4[_0x5bfb33];if(_[_0x0a9e('0x18')](_0x384319[_0x0a9e('0xb')][_0x1dc186['id']])){_0x384319[_0x0a9e('0xb')][_0x1dc186['id']]=new ChatQueue(_0x1dc186);}else{_0x384319[_0x0a9e('0x14')](_0x384319[_0x0a9e('0xb')][_0x1dc186['id']],_0x1dc186);}_0x384319['chatQueues'][_0x1dc186['id']][_0x0a9e('0x1b')]();_0x384319[_0x0a9e('0xb')][_0x1dc186['id']][_0x0a9e('0x1a')]();}}return _0x384319[_0x0a9e('0xb')];};};Realtime['prototype'][_0x0a9e('0x1c')]=function(){var _0x40e7a3=this;return function(_0x1843b2){if(_0x1843b2){freeIsNotKey(_0x1843b2,_0x40e7a3[_0x0a9e('0x1d')],'id');for(var _0x58b06f=0x0,_0x563b45={},_0x296f41={};_0x58b06f<_0x1843b2[_0x0a9e('0x17')];_0x58b06f+=0x1){_0x563b45=_0x1843b2[_0x58b06f];if(_[_0x0a9e('0x18')](_0x40e7a3['smsQueues'][_0x563b45['id']])){_0x40e7a3[_0x0a9e('0x1d')][_0x563b45['id']]=new SmsQueue(_0x563b45);}else{_0x40e7a3['mergeFromDatabase'](_0x40e7a3[_0x0a9e('0x1d')][_0x563b45['id']],_0x563b45);}_0x40e7a3[_0x0a9e('0x1d')][_0x563b45['id']][_0x0a9e('0x1b')]();_0x40e7a3[_0x0a9e('0x1d')][_0x563b45['id']][_0x0a9e('0x1a')]();}}return _0x40e7a3['smsQueues'];};};Realtime[_0x0a9e('0x13')][_0x0a9e('0x1e')]=function(){var _0x40cb85=this;return function(_0x2da5c0){if(_0x2da5c0){freeIsNotKey(_0x2da5c0,_0x40cb85[_0x0a9e('0x1f')],'id');for(var _0x409319=0x0,_0x332d35={},_0x39e565={};_0x409319<_0x2da5c0['length'];_0x409319+=0x1){_0x332d35=_0x2da5c0[_0x409319];if(_[_0x0a9e('0x18')](_0x40cb85['mailQueues'][_0x332d35['id']])){_0x40cb85[_0x0a9e('0x1f')][_0x332d35['id']]=new MailQueue(_0x332d35);}else{_0x40cb85[_0x0a9e('0x14')](_0x40cb85[_0x0a9e('0x1f')][_0x332d35['id']],_0x332d35);}_0x40cb85[_0x0a9e('0x1f')][_0x332d35['id']]['updateRouting']();_0x40cb85[_0x0a9e('0x1f')][_0x332d35['id']][_0x0a9e('0x1a')]();}}return _0x40cb85[_0x0a9e('0x1f')];};};Realtime[_0x0a9e('0x13')]['initFaxQueues']=function(){var _0x54135e=this;return function(_0x1e8694){if(_0x1e8694){freeIsNotKey(_0x1e8694,_0x54135e['faxQueues'],'id');for(var _0x24936a=0x0,_0x3d9717={},_0x381c37={};_0x24936a<_0x1e8694[_0x0a9e('0x17')];_0x24936a+=0x1){_0x3d9717=_0x1e8694[_0x24936a];if(_['isUndefined'](_0x54135e[_0x0a9e('0xc')][_0x3d9717['id']])){_0x54135e[_0x0a9e('0xc')][_0x3d9717['id']]=new FaxQueue(_0x3d9717);}else{_0x54135e[_0x0a9e('0x14')](_0x54135e['faxQueues'][_0x3d9717['id']],_0x3d9717);}_0x54135e[_0x0a9e('0xc')][_0x3d9717['id']][_0x0a9e('0x1b')]();_0x54135e[_0x0a9e('0xc')][_0x3d9717['id']]['updateRealtime']();}}return _0x54135e['faxQueues'];};};Realtime[_0x0a9e('0x13')][_0x0a9e('0x20')]=function(){var _0x5adda1=this;return function(_0x2b814e){if(_0x2b814e){freeIsNotKey(_0x2b814e,_0x5adda1[_0x0a9e('0x21')],'id');for(var _0x2e1b3a=0x0,_0x148f55={},_0x4b38d9={};_0x2e1b3a<_0x2b814e['length'];_0x2e1b3a+=0x1){_0x148f55=_0x2b814e[_0x2e1b3a];if(_[_0x0a9e('0x18')](_0x5adda1[_0x0a9e('0x21')][_0x148f55['id']])){_0x5adda1['whatsappQueues'][_0x148f55['id']]=new WhatsappQueue(_0x148f55);}else{_0x5adda1[_0x0a9e('0x14')](_0x5adda1[_0x0a9e('0x21')][_0x148f55['id']],_0x148f55);}_0x5adda1[_0x0a9e('0x21')][_0x148f55['id']]['updateRouting']();_0x5adda1[_0x0a9e('0x21')][_0x148f55['id']][_0x0a9e('0x1a')]();}}return _0x5adda1[_0x0a9e('0x21')];};};module[_0x0a9e('0x22')]=Realtime; \ No newline at end of file +var _0xa9e0=['isUndefined','initIntervals','updateRealtime','updateRouting','initSmsQueues','smsQueues','initMailQueues','mailQueues','initWhatsappQueues','whatsappQueues','exports','bluebird','util','lodash','../model/interval','../model/chatQueue','../model/smsQueue','../model/mailQueue','../model/faxQueue','../model/whatsappQueue','intervals','openchannelQueues','chatQueues','faxQueues','mailQueuesWaitingInteractions','openchannelQueuesWaitingInteractions','smsQueuesWaitingInteractions','faxQueuesWaitingInteractions','whatsappQueuesWaitingInteractions','hasOwnProperty','prototype','mergeFromDatabase','initAgents','agents','length'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0xa9e0,0x123));var _0x0a9e=function(_0x21aec3,_0x5c97e9){_0x21aec3=_0x21aec3-0x0;var _0x288bbc=_0xa9e0[_0x21aec3];return _0x288bbc;};'use strict';var BPromise=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var _=require(_0x0a9e('0x2'));var moment=require('moment');var Agent=require('../model/agent');var Interval=require(_0x0a9e('0x3'));var OpenchannelQueue=require('../model/openchannelQueue');var ChatQueue=require(_0x0a9e('0x4'));var SmsQueue=require(_0x0a9e('0x5'));var MailQueue=require(_0x0a9e('0x6'));var FaxQueue=require(_0x0a9e('0x7'));var WhatsappQueue=require(_0x0a9e('0x8'));var Realtime=function(){this['agents']={};this[_0x0a9e('0x9')]={};this[_0x0a9e('0xa')]={};this[_0x0a9e('0xb')]={};this['smsQueues']={};this['mailQueues']={};this[_0x0a9e('0xc')]={};this['whatsappQueues']={};this['chatQueuesWaitingInteractions']={};this[_0x0a9e('0xd')]={};this[_0x0a9e('0xe')]={};this[_0x0a9e('0xf')]={};this[_0x0a9e('0x10')]={};this[_0x0a9e('0x11')]={};};function freeIsNotKey(_0xbd1168,_0x4a4c56,_0x50dfb2){var _0x527cdd=_['mapKeys'](_0xbd1168,function(_0x273d4d,_0x36471c){return _0x273d4d[_0x50dfb2];});for(var _0xd5b662 in _0x4a4c56){if(_0x4a4c56[_0x0a9e('0x12')](_0xd5b662)){if(!_0x527cdd[_0xd5b662]){delete _0x4a4c56[_0xd5b662];}}}}Realtime[_0x0a9e('0x13')][_0x0a9e('0x14')]=function(_0x5db4b0,_0x4283ce){for(var _0x239b12 in _0x4283ce){if(_0x5db4b0[_0x0a9e('0x12')](_0x239b12)){_0x5db4b0[_0x239b12]=_0x4283ce[_0x239b12];}}};Realtime[_0x0a9e('0x13')][_0x0a9e('0x15')]=function(){var _0x4d5611=this;return function(_0x52a03d){if(_0x52a03d){freeIsNotKey(_0x52a03d,_0x4d5611[_0x0a9e('0x16')],'id');for(var _0x5d0880=0x0,_0x1985b6={},_0x519dfd={};_0x5d0880<_0x52a03d[_0x0a9e('0x17')];_0x5d0880+=0x1){_0x1985b6=_0x52a03d[_0x5d0880];if(_[_0x0a9e('0x18')](_0x4d5611['agents'][_0x1985b6['id']])){_0x4d5611[_0x0a9e('0x16')][_0x1985b6['id']]=new Agent(_0x1985b6);}else{_0x4d5611['mergeFromDatabase'](_0x4d5611[_0x0a9e('0x16')][_0x1985b6['id']],_0x1985b6);}}}return _0x4d5611[_0x0a9e('0x16')];};};Realtime[_0x0a9e('0x13')][_0x0a9e('0x19')]=function(){var _0x31b1ca=this;return function(_0x2eb11f){if(_0x2eb11f){freeIsNotKey(_0x2eb11f,_0x31b1ca[_0x0a9e('0x9')],'id');for(var _0x20559e=0x0,_0x1314ae={},_0x112016={};_0x20559e<_0x2eb11f[_0x0a9e('0x17')];_0x20559e+=0x1){_0x1314ae=_0x2eb11f[_0x20559e];if(_[_0x0a9e('0x18')](_0x31b1ca['intervals'][_0x1314ae['id']])){_0x31b1ca[_0x0a9e('0x9')][_0x1314ae['id']]=new Interval(_0x1314ae);}else{_0x31b1ca[_0x0a9e('0x14')](_0x31b1ca['intervals'][_0x1314ae['id']],_0x1314ae);}}}return _0x31b1ca[_0x0a9e('0x9')];};};Realtime['prototype']['initOpenchannelQueues']=function(){var _0x3a02e1=this;return function(_0x432e56){if(_0x432e56){freeIsNotKey(_0x432e56,_0x3a02e1[_0x0a9e('0xa')],'id');for(var _0x30bae6=0x0,_0x4abc77={},_0xfb6e48={};_0x30bae6<_0x432e56[_0x0a9e('0x17')];_0x30bae6+=0x1){_0x4abc77=_0x432e56[_0x30bae6];if(_[_0x0a9e('0x18')](_0x3a02e1[_0x0a9e('0xa')][_0x4abc77['id']])){_0x3a02e1[_0x0a9e('0xa')][_0x4abc77['id']]=new OpenchannelQueue(_0x4abc77);}else{_0x3a02e1[_0x0a9e('0x14')](_0x3a02e1[_0x0a9e('0xa')][_0x4abc77['id']],_0x4abc77);}_0x3a02e1['openchannelQueues'][_0x4abc77['id']]['updateRouting']();_0x3a02e1[_0x0a9e('0xa')][_0x4abc77['id']][_0x0a9e('0x1a')]();}}return _0x3a02e1[_0x0a9e('0xa')];};};Realtime[_0x0a9e('0x13')]['initChatQueues']=function(){var _0x384319=this;return function(_0x479bc4){if(_0x479bc4){freeIsNotKey(_0x479bc4,_0x384319[_0x0a9e('0xb')],'id');for(var _0x5bfb33=0x0,_0x1dc186={},_0x34dc65={};_0x5bfb33<_0x479bc4[_0x0a9e('0x17')];_0x5bfb33+=0x1){_0x1dc186=_0x479bc4[_0x5bfb33];if(_[_0x0a9e('0x18')](_0x384319[_0x0a9e('0xb')][_0x1dc186['id']])){_0x384319[_0x0a9e('0xb')][_0x1dc186['id']]=new ChatQueue(_0x1dc186);}else{_0x384319[_0x0a9e('0x14')](_0x384319[_0x0a9e('0xb')][_0x1dc186['id']],_0x1dc186);}_0x384319['chatQueues'][_0x1dc186['id']][_0x0a9e('0x1b')]();_0x384319[_0x0a9e('0xb')][_0x1dc186['id']][_0x0a9e('0x1a')]();}}return _0x384319[_0x0a9e('0xb')];};};Realtime['prototype'][_0x0a9e('0x1c')]=function(){var _0x40e7a3=this;return function(_0x1843b2){if(_0x1843b2){freeIsNotKey(_0x1843b2,_0x40e7a3[_0x0a9e('0x1d')],'id');for(var _0x58b06f=0x0,_0x563b45={},_0x296f41={};_0x58b06f<_0x1843b2[_0x0a9e('0x17')];_0x58b06f+=0x1){_0x563b45=_0x1843b2[_0x58b06f];if(_[_0x0a9e('0x18')](_0x40e7a3['smsQueues'][_0x563b45['id']])){_0x40e7a3[_0x0a9e('0x1d')][_0x563b45['id']]=new SmsQueue(_0x563b45);}else{_0x40e7a3['mergeFromDatabase'](_0x40e7a3[_0x0a9e('0x1d')][_0x563b45['id']],_0x563b45);}_0x40e7a3[_0x0a9e('0x1d')][_0x563b45['id']][_0x0a9e('0x1b')]();_0x40e7a3[_0x0a9e('0x1d')][_0x563b45['id']][_0x0a9e('0x1a')]();}}return _0x40e7a3['smsQueues'];};};Realtime[_0x0a9e('0x13')][_0x0a9e('0x1e')]=function(){var _0x40cb85=this;return function(_0x2da5c0){if(_0x2da5c0){freeIsNotKey(_0x2da5c0,_0x40cb85[_0x0a9e('0x1f')],'id');for(var _0x409319=0x0,_0x332d35={},_0x39e565={};_0x409319<_0x2da5c0['length'];_0x409319+=0x1){_0x332d35=_0x2da5c0[_0x409319];if(_[_0x0a9e('0x18')](_0x40cb85['mailQueues'][_0x332d35['id']])){_0x40cb85[_0x0a9e('0x1f')][_0x332d35['id']]=new MailQueue(_0x332d35);}else{_0x40cb85[_0x0a9e('0x14')](_0x40cb85[_0x0a9e('0x1f')][_0x332d35['id']],_0x332d35);}_0x40cb85[_0x0a9e('0x1f')][_0x332d35['id']]['updateRouting']();_0x40cb85[_0x0a9e('0x1f')][_0x332d35['id']][_0x0a9e('0x1a')]();}}return _0x40cb85[_0x0a9e('0x1f')];};};Realtime[_0x0a9e('0x13')]['initFaxQueues']=function(){var _0x54135e=this;return function(_0x1e8694){if(_0x1e8694){freeIsNotKey(_0x1e8694,_0x54135e['faxQueues'],'id');for(var _0x24936a=0x0,_0x3d9717={},_0x381c37={};_0x24936a<_0x1e8694[_0x0a9e('0x17')];_0x24936a+=0x1){_0x3d9717=_0x1e8694[_0x24936a];if(_['isUndefined'](_0x54135e[_0x0a9e('0xc')][_0x3d9717['id']])){_0x54135e[_0x0a9e('0xc')][_0x3d9717['id']]=new FaxQueue(_0x3d9717);}else{_0x54135e[_0x0a9e('0x14')](_0x54135e['faxQueues'][_0x3d9717['id']],_0x3d9717);}_0x54135e[_0x0a9e('0xc')][_0x3d9717['id']][_0x0a9e('0x1b')]();_0x54135e[_0x0a9e('0xc')][_0x3d9717['id']]['updateRealtime']();}}return _0x54135e['faxQueues'];};};Realtime[_0x0a9e('0x13')][_0x0a9e('0x20')]=function(){var _0x5adda1=this;return function(_0x2b814e){if(_0x2b814e){freeIsNotKey(_0x2b814e,_0x5adda1[_0x0a9e('0x21')],'id');for(var _0x2e1b3a=0x0,_0x148f55={},_0x4b38d9={};_0x2e1b3a<_0x2b814e['length'];_0x2e1b3a+=0x1){_0x148f55=_0x2b814e[_0x2e1b3a];if(_[_0x0a9e('0x18')](_0x5adda1[_0x0a9e('0x21')][_0x148f55['id']])){_0x5adda1['whatsappQueues'][_0x148f55['id']]=new WhatsappQueue(_0x148f55);}else{_0x5adda1[_0x0a9e('0x14')](_0x5adda1[_0x0a9e('0x21')][_0x148f55['id']],_0x148f55);}_0x5adda1[_0x0a9e('0x21')][_0x148f55['id']]['updateRouting']();_0x5adda1[_0x0a9e('0x21')][_0x148f55['id']][_0x0a9e('0x1a')]();}}return _0x5adda1[_0x0a9e('0x21')];};};module[_0x0a9e('0x22')]=Realtime; \ No newline at end of file diff --git a/server/services/routing/rpc/chatInteraction.js b/server/services/routing/rpc/chatInteraction.js index 51c7025..1ff71af 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 _0x10c9=['../client','UpdateChatInteraction','updateChatInteraction','addTags','Request','addTagsToChatInteraction'];(function(_0x4b055c,_0x4b870b){var _0x4b62bb=function(_0x4884c2){while(--_0x4884c2){_0x4b055c['push'](_0x4b055c['shift']());}};_0x4b62bb(++_0x4b870b);}(_0x10c9,0xea));var _0x910c=function(_0xe73080,_0x24c56d){_0xe73080=_0xe73080-0x0;var _0x12cbc4=_0x10c9[_0xe73080];return _0x12cbc4;};'use strict';var client=require(_0x910c('0x0'));exports['update']=function(_0x987a7c,_0x5ac14b){return client['Request'](_0x910c('0x1'),{'body':_0x5ac14b,'options':{'where':{'id':_0x987a7c}},'log':_0x910c('0x2')});};exports[_0x910c('0x3')]=function(_0x1ab8b4,_0x21a5de){return client[_0x910c('0x4')]('AddTagsToChatInteraction',{'body':_0x21a5de,'options':{'where':{'id':_0x1ab8b4}},'log':_0x910c('0x5')});}; \ No newline at end of file +var _0x6457=['AddTagsToChatInteraction','addTagsToChatInteraction','Request','UpdateChatInteraction','updateChatInteraction','addTags'];(function(_0xda1de5,_0x231f2c){var _0x52079b=function(_0x2cfa6f){while(--_0x2cfa6f){_0xda1de5['push'](_0xda1de5['shift']());}};_0x52079b(++_0x231f2c);}(_0x6457,0xa4));var _0x7645=function(_0x4eeeec,_0x7cc776){_0x4eeeec=_0x4eeeec-0x0;var _0x1157ae=_0x6457[_0x4eeeec];return _0x1157ae;};'use strict';var client=require('../client');exports['update']=function(_0x3ff9fd,_0x5975ba){return client[_0x7645('0x0')](_0x7645('0x1'),{'body':_0x5975ba,'options':{'where':{'id':_0x3ff9fd}},'log':_0x7645('0x2')});};exports[_0x7645('0x3')]=function(_0x1e7fec,_0x4f5a44){return client[_0x7645('0x0')](_0x7645('0x4'),{'body':_0x4f5a44,'options':{'where':{'id':_0x1e7fec}},'log':_0x7645('0x5')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/chatMessage.js b/server/services/routing/rpc/chatMessage.js index 064f1f1..16b1583 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 _0xd09f=['CreateChatMessage','createChatMessage','../client','create'];(function(_0x384f83,_0x4047d0){var _0x2a1f1a=function(_0x5cf392){while(--_0x5cf392){_0x384f83['push'](_0x384f83['shift']());}};_0x2a1f1a(++_0x4047d0);}(_0xd09f,0x152));var _0xfd09=function(_0x44714c,_0x2ac454){_0x44714c=_0x44714c-0x0;var _0x57d4d5=_0xd09f[_0x44714c];return _0x57d4d5;};'use strict';var client=require(_0xfd09('0x0'));exports[_0xfd09('0x1')]=function(_0x3a4705){return client['Request'](_0xfd09('0x2'),{'body':_0x3a4705,'log':_0xfd09('0x3')});}; \ No newline at end of file +var _0x043a=['../client','create','CreateChatMessage','createChatMessage'];(function(_0x9e2651,_0x13adf6){var _0x41d7b6=function(_0x236dd7){while(--_0x236dd7){_0x9e2651['push'](_0x9e2651['shift']());}};_0x41d7b6(++_0x13adf6);}(_0x043a,0x104));var _0xa043=function(_0x34b935,_0x1b0e16){_0x34b935=_0x34b935-0x0;var _0x4acb3c=_0x043a[_0x34b935];return _0x4acb3c;};'use strict';var client=require(_0xa043('0x0'));exports[_0xa043('0x1')]=function(_0x2729b9){return client['Request'](_0xa043('0x2'),{'body':_0x2729b9,'log':_0xa043('0x3')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/chatQueue.js b/server/services/routing/rpc/chatQueue.js index e7dadd1..0d7416f 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 _0xe1dc=['strategy','Agents','chatPause','../client','getChatQueues','Request','GetChatQueue','name','timeout'];(function(_0x5e9d35,_0x382c91){var _0x3beb2e=function(_0x4242cf){while(--_0x4242cf){_0x5e9d35['push'](_0x5e9d35['shift']());}};_0x3beb2e(++_0x382c91);}(_0xe1dc,0x8a));var _0xce1d=function(_0x278ef8,_0x3fdac3){_0x278ef8=_0x278ef8-0x0;var _0x481ad0=_0xe1dc[_0x278ef8];return _0x481ad0;};'use strict';var client=require(_0xce1d('0x0'));exports[_0xce1d('0x1')]=function(){return function(){return client[_0xce1d('0x2')](_0xce1d('0x3'),{'options':{'raw':![],'attributes':['id',_0xce1d('0x4'),_0xce1d('0x5'),_0xce1d('0x6')],'include':[{'model':'User','as':_0xce1d('0x7'),'attributes':['id','name','online',_0xce1d('0x8')]}]},'log':_0xce1d('0x1')});};}; \ No newline at end of file +var _0x1793=['User','Agents','name','../client','getChatQueues','Request','GetChatQueue','timeout','strategy'];(function(_0x40911a,_0x55ec99){var _0x27e8e3=function(_0x2ba910){while(--_0x2ba910){_0x40911a['push'](_0x40911a['shift']());}};_0x27e8e3(++_0x55ec99);}(_0x1793,0x1ce));var _0x3179=function(_0x303d9d,_0x363884){_0x303d9d=_0x303d9d-0x0;var _0x4ccd15=_0x1793[_0x303d9d];return _0x4ccd15;};'use strict';var client=require(_0x3179('0x0'));exports[_0x3179('0x1')]=function(){return function(){return client[_0x3179('0x2')](_0x3179('0x3'),{'options':{'raw':![],'attributes':['id','name',_0x3179('0x4'),_0x3179('0x5')],'include':[{'model':_0x3179('0x6'),'as':_0x3179('0x7'),'attributes':['id',_0x3179('0x8'),'online','chatPause']}]},'log':_0x3179('0x1')});};}; \ No newline at end of file diff --git a/server/services/routing/rpc/chatQueueReport.js b/server/services/routing/rpc/chatQueueReport.js index 39e43fe..32bc4d0 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 _0x43f3=['UpdateChatQueueReport','create','CreateChatQueueReport','update','Request'];(function(_0x103421,_0x4d7fe7){var _0x3272c9=function(_0x5219ef){while(--_0x5219ef){_0x103421['push'](_0x103421['shift']());}};_0x3272c9(++_0x4d7fe7);}(_0x43f3,0xab));var _0x343f=function(_0x101e7b,_0x4ef05b){_0x101e7b=_0x101e7b-0x0;var _0x4995c0=_0x43f3[_0x101e7b];return _0x4995c0;};'use strict';var client=require('../client');exports[_0x343f('0x0')]=function(_0x177f01){return client['Request'](_0x343f('0x1'),{'body':_0x177f01,'log':'CreateChatQueueReport'});};exports[_0x343f('0x2')]=function(_0x48008f,_0x3339a9){return client[_0x343f('0x3')](_0x343f('0x4'),{'body':_0x3339a9,'options':{'where':{'uniqueid':_0x48008f},'order':[['id','DESC']],'limit':0x1},'log':_0x343f('0x4')});}; \ No newline at end of file +var _0xb3ea=['Request','UpdateChatQueueReport','DESC','../client','create','CreateChatQueueReport','update'];(function(_0x1c15ca,_0x27c25f){var _0x1481b4=function(_0x80741f){while(--_0x80741f){_0x1c15ca['push'](_0x1c15ca['shift']());}};_0x1481b4(++_0x27c25f);}(_0xb3ea,0x10d));var _0xab3e=function(_0x463b6a,_0x4cd36e){_0x463b6a=_0x463b6a-0x0;var _0x6b1a8f=_0xb3ea[_0x463b6a];return _0x6b1a8f;};'use strict';var client=require(_0xab3e('0x0'));exports[_0xab3e('0x1')]=function(_0x1d7916){return client['Request'](_0xab3e('0x2'),{'body':_0x1d7916,'log':'CreateChatQueueReport'});};exports[_0xab3e('0x3')]=function(_0x5d862a,_0x30e8e6){return client[_0xab3e('0x4')](_0xab3e('0x5'),{'body':_0x30e8e6,'options':{'where':{'uniqueid':_0x5d862a},'order':[['id',_0xab3e('0x6')]],'limit':0x1},'log':_0xab3e('0x5')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/faxInteraction.js b/server/services/routing/rpc/faxInteraction.js index 8cb4990..1fdbade 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(_0x2ac5f8,_0x4c3a9f){var _0x3b8229=function(_0x46a3c0){while(--_0x46a3c0){_0x2ac5f8['push'](_0x2ac5f8['shift']());}};_0x3b8229(++_0x4c3a9f);}(_0x7a54,0x106));var _0x47a5=function(_0x1ca89d,_0x205060){_0x1ca89d=_0x1ca89d-0x0;var _0x4986f4=_0x7a54[_0x1ca89d];return _0x4986f4;};'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 _0x7a54=['Request','UpdateFaxInteraction','addTags','AddTagsToFaxInteraction','../client','update'];(function(_0x5ecadc,_0x1cf9f1){var _0x565037=function(_0x22908b){while(--_0x22908b){_0x5ecadc['push'](_0x5ecadc['shift']());}};_0x565037(++_0x1cf9f1);}(_0x7a54,0x106));var _0x47a5=function(_0x1f3676,_0x344c58){_0x1f3676=_0x1f3676-0x0;var _0x2a4f73=_0x7a54[_0x1f3676];return _0x2a4f73;};'use strict';var client=require(_0x47a5('0x0'));exports[_0x47a5('0x1')]=function(_0x44b31e,_0x58157c){return client[_0x47a5('0x2')](_0x47a5('0x3'),{'body':_0x58157c,'options':{'where':{'id':_0x44b31e}},'log':'updateFaxInteraction'});};exports[_0x47a5('0x4')]=function(_0x11bf85,_0x2a1a7e){return client[_0x47a5('0x2')](_0x47a5('0x5'),{'body':_0x2a1a7e,'options':{'where':{'id':_0x11bf85}},'log':'addTagsToFaxInteraction'});}; \ No newline at end of file diff --git a/server/services/routing/rpc/faxMessage.js b/server/services/routing/rpc/faxMessage.js index 20065c9..f445428 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 _0x1fca=['Request','CreateFaxMessage','createFaxMessage','../client','create'];(function(_0x3c07c8,_0x553ecd){var _0x1ef9b1=function(_0x9a2e55){while(--_0x9a2e55){_0x3c07c8['push'](_0x3c07c8['shift']());}};_0x1ef9b1(++_0x553ecd);}(_0x1fca,0x1d9));var _0xa1fc=function(_0x1db998,_0x4f9a45){_0x1db998=_0x1db998-0x0;var _0x155d91=_0x1fca[_0x1db998];return _0x155d91;};'use strict';var client=require(_0xa1fc('0x0'));exports[_0xa1fc('0x1')]=function(_0x1e2032){return client[_0xa1fc('0x2')](_0xa1fc('0x3'),{'body':_0x1e2032,'log':_0xa1fc('0x4')});}; \ No newline at end of file +var _0xfb4b=['Request','CreateFaxMessage','../client'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0xfb4b,0x194));var _0xbfb4=function(_0x86a735,_0x19bf36){_0x86a735=_0x86a735-0x0;var _0x2b2f63=_0xfb4b[_0x86a735];return _0x2b2f63;};'use strict';var client=require(_0xbfb4('0x0'));exports['create']=function(_0x33e5be){return client[_0xbfb4('0x1')](_0xbfb4('0x2'),{'body':_0x33e5be,'log':'createFaxMessage'});}; \ No newline at end of file diff --git a/server/services/routing/rpc/faxQueue.js b/server/services/routing/rpc/faxQueue.js index 2d5a207..e76e29d 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 _0x518c=['getFaxQueues','Request','name','timeout','strategy','User','Agents','online','faxPause'];(function(_0x12cec3,_0x5dfbb2){var _0x236122=function(_0x3808e7){while(--_0x3808e7){_0x12cec3['push'](_0x12cec3['shift']());}};_0x236122(++_0x5dfbb2);}(_0x518c,0x118));var _0xc518=function(_0xcd8f58,_0x394acd){_0xcd8f58=_0xcd8f58-0x0;var _0x408c94=_0x518c[_0xcd8f58];return _0x408c94;};'use strict';var client=require('../client');exports['getFaxQueues']=function(){return function(){return client[_0xc518('0x0')]('GetFaxQueue',{'options':{'raw':![],'attributes':['id',_0xc518('0x1'),_0xc518('0x2'),_0xc518('0x3')],'include':[{'model':_0xc518('0x4'),'as':_0xc518('0x5'),'attributes':['id',_0xc518('0x1'),_0xc518('0x6'),_0xc518('0x7')]}]},'log':_0xc518('0x8')});};}; \ No newline at end of file +var _0x7cd4=['timeout','Agents','online','faxPause','getFaxQueues','../client','name'];(function(_0x37adca,_0x5a2963){var _0x530eff=function(_0x3cb201){while(--_0x3cb201){_0x37adca['push'](_0x37adca['shift']());}};_0x530eff(++_0x5a2963);}(_0x7cd4,0x15c));var _0x47cd=function(_0x4f2b44,_0x13d29a){_0x4f2b44=_0x4f2b44-0x0;var _0x421a43=_0x7cd4[_0x4f2b44];return _0x421a43;};'use strict';var client=require(_0x47cd('0x0'));exports['getFaxQueues']=function(){return function(){return client['Request']('GetFaxQueue',{'options':{'raw':![],'attributes':['id',_0x47cd('0x1'),_0x47cd('0x2'),'strategy'],'include':[{'model':'User','as':_0x47cd('0x3'),'attributes':['id',_0x47cd('0x1'),_0x47cd('0x4'),_0x47cd('0x5')]}]},'log':_0x47cd('0x6')});};}; \ No newline at end of file diff --git a/server/services/routing/rpc/faxQueueReport.js b/server/services/routing/rpc/faxQueueReport.js index 797b07c..e38640f 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 _0xa9eb=['create','Request','CreateFaxQueueReport','UpdateFaxQueueReport','DESC','../client'];(function(_0x595bd1,_0xb1e7a){var _0xd0344f=function(_0x5eb2fd){while(--_0x5eb2fd){_0x595bd1['push'](_0x595bd1['shift']());}};_0xd0344f(++_0xb1e7a);}(_0xa9eb,0x1f1));var _0xba9e=function(_0x256b72,_0x340985){_0x256b72=_0x256b72-0x0;var _0x2183e3=_0xa9eb[_0x256b72];return _0x2183e3;};'use strict';var client=require(_0xba9e('0x0'));exports[_0xba9e('0x1')]=function(_0x122ad8){return client[_0xba9e('0x2')](_0xba9e('0x3'),{'body':_0x122ad8,'log':_0xba9e('0x3')});};exports['update']=function(_0x169c83,_0x2b087a){return client['Request'](_0xba9e('0x4'),{'body':_0x2b087a,'options':{'where':{'uniqueid':_0x169c83},'order':[['id',_0xba9e('0x5')]],'limit':0x1},'log':'UpdateFaxQueueReport'});}; \ No newline at end of file +var _0xbc1c=['create','Request','CreateFaxQueueReport','update','UpdateFaxQueueReport','DESC'];(function(_0x3c4062,_0x3767fc){var _0x3f5bf3=function(_0x105e55){while(--_0x105e55){_0x3c4062['push'](_0x3c4062['shift']());}};_0x3f5bf3(++_0x3767fc);}(_0xbc1c,0xd8));var _0xcbc1=function(_0x5ac4b6,_0x4d9360){_0x5ac4b6=_0x5ac4b6-0x0;var _0x29ced8=_0xbc1c[_0x5ac4b6];return _0x29ced8;};'use strict';var client=require('../client');exports[_0xcbc1('0x0')]=function(_0x5743ae){return client[_0xcbc1('0x1')]('CreateFaxQueueReport',{'body':_0x5743ae,'log':_0xcbc1('0x2')});};exports[_0xcbc1('0x3')]=function(_0x39e45b,_0x2d19b9){return client['Request'](_0xcbc1('0x4'),{'body':_0x2d19b9,'options':{'where':{'uniqueid':_0x39e45b},'order':[['id',_0xcbc1('0x5')]],'limit':0x1},'log':_0xcbc1('0x4')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/interval.js b/server/services/routing/rpc/interval.js index ae14eb6..c04aeec 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 _0xe7e9=['name','../client','getIntervals'];(function(_0x2b7806,_0x3b0257){var _0x162485=function(_0x5174f3){while(--_0x5174f3){_0x2b7806['push'](_0x2b7806['shift']());}};_0x162485(++_0x3b0257);}(_0xe7e9,0x160));var _0x9e7e=function(_0x38b8c6,_0x541f91){_0x38b8c6=_0x38b8c6-0x0;var _0x3104d6=_0xe7e9[_0x38b8c6];return _0x3104d6;};'use strict';var client=require(_0x9e7e('0x0'));exports[_0x9e7e('0x1')]=function(){return function(){return client['Request']('GetInterval',{'options':{'raw':![],'where':{'IntervalId':null},'attributes':['id',_0x9e7e('0x2')],'include':[{'model':'Interval','as':'Intervals','attributes':['id',_0x9e7e('0x2'),'interval']}]},'log':_0x9e7e('0x1')});};}; \ No newline at end of file +var _0x8757=['GetInterval','name','Interval','Intervals','getIntervals','Request'];(function(_0x7c0074,_0x1ffdcf){var _0x13e95b=function(_0x521212){while(--_0x521212){_0x7c0074['push'](_0x7c0074['shift']());}};_0x13e95b(++_0x1ffdcf);}(_0x8757,0x184));var _0x7875=function(_0x3d793c,_0x234c37){_0x3d793c=_0x3d793c-0x0;var _0x4a7ae3=_0x8757[_0x3d793c];return _0x4a7ae3;};'use strict';var client=require('../client');exports[_0x7875('0x0')]=function(){return function(){return client[_0x7875('0x1')](_0x7875('0x2'),{'options':{'raw':![],'where':{'IntervalId':null},'attributes':['id',_0x7875('0x3')],'include':[{'model':_0x7875('0x4'),'as':_0x7875('0x5'),'attributes':['id',_0x7875('0x3'),'interval']}]},'log':_0x7875('0x0')});};}; \ No newline at end of file diff --git a/server/services/routing/rpc/mailInteraction.js b/server/services/routing/rpc/mailInteraction.js index b65c3d0..0cf339e 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 _0xcf2f=['update','Request','updateMailInteraction','addTags','AddTagsToMailInteraction','addTagsToChatInteraction','../client'];(function(_0xb247d5,_0x423231){var _0x5ac8a5=function(_0x7cea2d){while(--_0x7cea2d){_0xb247d5['push'](_0xb247d5['shift']());}};_0x5ac8a5(++_0x423231);}(_0xcf2f,0xa7));var _0xfcf2=function(_0x2cb1d7,_0x17ca41){_0x2cb1d7=_0x2cb1d7-0x0;var _0x1ca645=_0xcf2f[_0x2cb1d7];return _0x1ca645;};'use strict';var client=require(_0xfcf2('0x0'));exports[_0xfcf2('0x1')]=function(_0xe6b3a5,_0x3165cf){return client[_0xfcf2('0x2')]('UpdateMailInteraction',{'body':_0x3165cf,'options':{'where':{'id':_0xe6b3a5}},'log':_0xfcf2('0x3')});};exports[_0xfcf2('0x4')]=function(_0x1e3661,_0x34bcaf){return client[_0xfcf2('0x2')](_0xfcf2('0x5'),{'body':_0x34bcaf,'options':{'where':{'id':_0x1e3661}},'log':_0xfcf2('0x6')});}; \ No newline at end of file +var _0xdd4f=['../client','Request','UpdateMailInteraction','addTags','AddTagsToMailInteraction','addTagsToChatInteraction'];(function(_0x2077c2,_0x275ab5){var _0x312f9f=function(_0x331435){while(--_0x331435){_0x2077c2['push'](_0x2077c2['shift']());}};_0x312f9f(++_0x275ab5);}(_0xdd4f,0x1ce));var _0xfdd4=function(_0x14bcea,_0x7bcd6){_0x14bcea=_0x14bcea-0x0;var _0x3e8813=_0xdd4f[_0x14bcea];return _0x3e8813;};'use strict';var client=require(_0xfdd4('0x0'));exports['update']=function(_0x5656ab,_0x55d8f9){return client[_0xfdd4('0x1')](_0xfdd4('0x2'),{'body':_0x55d8f9,'options':{'where':{'id':_0x5656ab}},'log':'updateMailInteraction'});};exports[_0xfdd4('0x3')]=function(_0x3175f6,_0x6b2b0d){return client['Request'](_0xfdd4('0x4'),{'body':_0x6b2b0d,'options':{'where':{'id':_0x3175f6}},'log':_0xfdd4('0x5')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/mailMessage.js b/server/services/routing/rpc/mailMessage.js index 5cbd69d..f4df23f 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 _0xd8ac=['CreateMailMessage','createMailMessage','../client'];(function(_0xf70b9c,_0x3b8e10){var _0x3785f9=function(_0xdafe1b){while(--_0xdafe1b){_0xf70b9c['push'](_0xf70b9c['shift']());}};_0x3785f9(++_0x3b8e10);}(_0xd8ac,0x182));var _0xcd8a=function(_0x2641f9,_0x26715f){_0x2641f9=_0x2641f9-0x0;var _0x585741=_0xd8ac[_0x2641f9];return _0x585741;};'use strict';var client=require(_0xcd8a('0x0'));exports['create']=function(_0x1962b6){return client['Request'](_0xcd8a('0x1'),{'body':_0x1962b6,'log':_0xcd8a('0x2')});}; \ No newline at end of file +var _0x6546=['Request','createMailMessage','../client','create'];(function(_0x51299d,_0x47e7f2){var _0xaeac51=function(_0x24a3f3){while(--_0x24a3f3){_0x51299d['push'](_0x51299d['shift']());}};_0xaeac51(++_0x47e7f2);}(_0x6546,0x1da));var _0x6654=function(_0x460901,_0x285fa9){_0x460901=_0x460901-0x0;var _0x9f4e92=_0x6546[_0x460901];return _0x9f4e92;};'use strict';var client=require(_0x6654('0x0'));exports[_0x6654('0x1')]=function(_0x35f11e){return client[_0x6654('0x2')]('CreateMailMessage',{'body':_0x35f11e,'log':_0x6654('0x3')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/mailQueue.js b/server/services/routing/rpc/mailQueue.js index 0c58862..01885ba 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 _0x214e=['timeout','User','name','online','getMailQueues','GetMailQueue'];(function(_0x205eca,_0x138c20){var _0x193e81=function(_0x3e8c88){while(--_0x3e8c88){_0x205eca['push'](_0x205eca['shift']());}};_0x193e81(++_0x138c20);}(_0x214e,0x148));var _0xe214=function(_0x4f96f6,_0x578f1){_0x4f96f6=_0x4f96f6-0x0;var _0x2d1508=_0x214e[_0x4f96f6];return _0x2d1508;};'use strict';var client=require('../client');exports[_0xe214('0x0')]=function(){return function(){return client['Request'](_0xe214('0x1'),{'options':{'raw':![],'attributes':['id','name',_0xe214('0x2'),'strategy'],'include':[{'model':_0xe214('0x3'),'as':'Agents','attributes':['id',_0xe214('0x4'),_0xe214('0x5'),'mailPause']}]},'log':'getMailQueues'});};}; \ No newline at end of file +var _0x0133=['User','Agents','online','mailPause','../client','getMailQueues','Request','name','timeout','strategy'];(function(_0x2045ec,_0x543794){var _0xc513a=function(_0x130e66){while(--_0x130e66){_0x2045ec['push'](_0x2045ec['shift']());}};_0xc513a(++_0x543794);}(_0x0133,0x90));var _0x3013=function(_0x37c22c,_0x28a70d){_0x37c22c=_0x37c22c-0x0;var _0x119d79=_0x0133[_0x37c22c];return _0x119d79;};'use strict';var client=require(_0x3013('0x0'));exports[_0x3013('0x1')]=function(){return function(){return client[_0x3013('0x2')]('GetMailQueue',{'options':{'raw':![],'attributes':['id',_0x3013('0x3'),_0x3013('0x4'),_0x3013('0x5')],'include':[{'model':_0x3013('0x6'),'as':_0x3013('0x7'),'attributes':['id',_0x3013('0x3'),_0x3013('0x8'),_0x3013('0x9')]}]},'log':_0x3013('0x1')});};}; \ No newline at end of file diff --git a/server/services/routing/rpc/mailQueueReport.js b/server/services/routing/rpc/mailQueueReport.js index 3f840e6..2c775dc 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 _0xd365=['DESC','../client','create','CreateMailQueueReport','UpdateMailQueueReport'];(function(_0x31d079,_0x397bbc){var _0x6170d9=function(_0x2996f0){while(--_0x2996f0){_0x31d079['push'](_0x31d079['shift']());}};_0x6170d9(++_0x397bbc);}(_0xd365,0x1b9));var _0x5d36=function(_0x1d8a55,_0x2a8717){_0x1d8a55=_0x1d8a55-0x0;var _0x56174e=_0xd365[_0x1d8a55];return _0x56174e;};'use strict';var client=require(_0x5d36('0x0'));exports[_0x5d36('0x1')]=function(_0x48ac77){return client['Request'](_0x5d36('0x2'),{'body':_0x48ac77,'log':_0x5d36('0x2')});};exports['update']=function(_0x29c25e,_0x23eb0f){return client['Request'](_0x5d36('0x3'),{'body':_0x23eb0f,'options':{'where':{'uniqueid':_0x29c25e},'order':[['id',_0x5d36('0x4')]],'limit':0x1},'log':'UpdateMailQueueReport'});}; \ No newline at end of file +var _0xf1e3=['../client','CreateMailQueueReport','update','Request','UpdateMailQueueReport','DESC'];(function(_0x28f5f7,_0x52b09c){var _0x5c7167=function(_0x328484){while(--_0x328484){_0x28f5f7['push'](_0x28f5f7['shift']());}};_0x5c7167(++_0x52b09c);}(_0xf1e3,0x7e));var _0x3f1e=function(_0x4fdc46,_0x2a3759){_0x4fdc46=_0x4fdc46-0x0;var _0x2c178a=_0xf1e3[_0x4fdc46];return _0x2c178a;};'use strict';var client=require(_0x3f1e('0x0'));exports['create']=function(_0x287536){return client['Request'](_0x3f1e('0x1'),{'body':_0x287536,'log':_0x3f1e('0x1')});};exports[_0x3f1e('0x2')]=function(_0x28e1ac,_0x5bb927){return client[_0x3f1e('0x3')](_0x3f1e('0x4'),{'body':_0x5bb927,'options':{'where':{'uniqueid':_0x28e1ac},'order':[['id',_0x3f1e('0x5')]],'limit':0x1},'log':'UpdateMailQueueReport'});}; \ No newline at end of file diff --git a/server/services/routing/rpc/openchannelInteraction.js b/server/services/routing/rpc/openchannelInteraction.js index dc2ba25..54018fc 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 _0xffb1=['addTags','AddTagsToOpenchannelInteraction','addTagsToChatInteraction','../client','update','UpdateOpenchannelInteraction','updateOpenchannelInteraction'];(function(_0x4fbd57,_0x4ebb60){var _0x96138c=function(_0x51b6c3){while(--_0x51b6c3){_0x4fbd57['push'](_0x4fbd57['shift']());}};_0x96138c(++_0x4ebb60);}(_0xffb1,0xce));var _0x1ffb=function(_0x54d4fe,_0x55e869){_0x54d4fe=_0x54d4fe-0x0;var _0x1ab5bb=_0xffb1[_0x54d4fe];return _0x1ab5bb;};'use strict';var client=require(_0x1ffb('0x0'));exports[_0x1ffb('0x1')]=function(_0xc3ba56,_0x333577){return client['Request'](_0x1ffb('0x2'),{'body':_0x333577,'options':{'where':{'id':_0xc3ba56}},'log':_0x1ffb('0x3')});};exports[_0x1ffb('0x4')]=function(_0x4a98cd,_0x365ed5){return client['Request'](_0x1ffb('0x5'),{'body':_0x365ed5,'options':{'where':{'id':_0x4a98cd}},'log':_0x1ffb('0x6')});}; \ No newline at end of file +var _0x0cb6=['addTagsToChatInteraction','../client','update','Request','updateOpenchannelInteraction','addTags','AddTagsToOpenchannelInteraction'];(function(_0x4cbbb4,_0x181e3d){var _0x4f70cf=function(_0x988b53){while(--_0x988b53){_0x4cbbb4['push'](_0x4cbbb4['shift']());}};_0x4f70cf(++_0x181e3d);}(_0x0cb6,0x143));var _0x60cb=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x0cb6[_0x3dd15e];return _0x231fd0;};'use strict';var client=require(_0x60cb('0x0'));exports[_0x60cb('0x1')]=function(_0x51a1ba,_0x417f2b){return client[_0x60cb('0x2')]('UpdateOpenchannelInteraction',{'body':_0x417f2b,'options':{'where':{'id':_0x51a1ba}},'log':_0x60cb('0x3')});};exports[_0x60cb('0x4')]=function(_0x3f2820,_0x3772bd){return client['Request'](_0x60cb('0x5'),{'body':_0x3772bd,'options':{'where':{'id':_0x3f2820}},'log':_0x60cb('0x6')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/openchannelMessage.js b/server/services/routing/rpc/openchannelMessage.js index 31c994f..e5b53c2 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 _0x024a=['create','Request','createOpenchannelMessage'];(function(_0x2c1390,_0x3bfb7e){var _0x250d2a=function(_0x1936b1){while(--_0x1936b1){_0x2c1390['push'](_0x2c1390['shift']());}};_0x250d2a(++_0x3bfb7e);}(_0x024a,0xc9));var _0xa024=function(_0x27e2e0,_0x2be956){_0x27e2e0=_0x27e2e0-0x0;var _0x2f4ba6=_0x024a[_0x27e2e0];return _0x2f4ba6;};'use strict';var client=require('../client');exports[_0xa024('0x0')]=function(_0x4942aa){return client[_0xa024('0x1')]('CreateOpenchannelMessage',{'body':_0x4942aa,'log':_0xa024('0x2')});}; \ No newline at end of file +var _0xe2ff=['createOpenchannelMessage','../client','Request','CreateOpenchannelMessage'];(function(_0x1969a7,_0x5a133a){var _0x3d665f=function(_0x39c64b){while(--_0x39c64b){_0x1969a7['push'](_0x1969a7['shift']());}};_0x3d665f(++_0x5a133a);}(_0xe2ff,0x151));var _0xfe2f=function(_0x277768,_0x2c4d8d){_0x277768=_0x277768-0x0;var _0x1f9d1f=_0xe2ff[_0x277768];return _0x1f9d1f;};'use strict';var client=require(_0xfe2f('0x0'));exports['create']=function(_0x51cf4c){return client[_0xfe2f('0x1')](_0xfe2f('0x2'),{'body':_0x51cf4c,'log':_0xfe2f('0x3')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/openchannelQueue.js b/server/services/routing/rpc/openchannelQueue.js index 576d93d..f6059de 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 _0x6ab8=['Request','strategy','User','Agents','online','openchannelPause','../client','getOpenchannelQueues'];(function(_0x3984c2,_0xcee754){var _0x3b3fe4=function(_0xea47dd){while(--_0xea47dd){_0x3984c2['push'](_0x3984c2['shift']());}};_0x3b3fe4(++_0xcee754);}(_0x6ab8,0x66));var _0x86ab=function(_0x4c0fff,_0x28ebf9){_0x4c0fff=_0x4c0fff-0x0;var _0x3f650e=_0x6ab8[_0x4c0fff];return _0x3f650e;};'use strict';var client=require(_0x86ab('0x0'));exports[_0x86ab('0x1')]=function(){return function(){return client[_0x86ab('0x2')]('GetOpenchannelQueue',{'options':{'raw':![],'attributes':['id','name','timeout',_0x86ab('0x3')],'include':[{'model':_0x86ab('0x4'),'as':_0x86ab('0x5'),'attributes':['id','name',_0x86ab('0x6'),_0x86ab('0x7')]}]},'log':_0x86ab('0x1')});};}; \ No newline at end of file +var _0x80eb=['timeout','User','Agents','../client','getOpenchannelQueues','Request','name'];(function(_0x54c67f,_0x418c64){var _0x18bbec=function(_0x2ff5d7){while(--_0x2ff5d7){_0x54c67f['push'](_0x54c67f['shift']());}};_0x18bbec(++_0x418c64);}(_0x80eb,0x1ae));var _0xb80e=function(_0x445304,_0x2b1d98){_0x445304=_0x445304-0x0;var _0x250243=_0x80eb[_0x445304];return _0x250243;};'use strict';var client=require(_0xb80e('0x0'));exports[_0xb80e('0x1')]=function(){return function(){return client[_0xb80e('0x2')]('GetOpenchannelQueue',{'options':{'raw':![],'attributes':['id',_0xb80e('0x3'),_0xb80e('0x4'),'strategy'],'include':[{'model':_0xb80e('0x5'),'as':_0xb80e('0x6'),'attributes':['id',_0xb80e('0x3'),'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 21e0e57..0aaed84 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 _0xc932=['update','UpdateOpenchannelQueueReport','DESC','../client','Request','CreateOpenchannelQueueReport'];(function(_0x575487,_0x23efcc){var _0x2a881b=function(_0x145e27){while(--_0x145e27){_0x575487['push'](_0x575487['shift']());}};_0x2a881b(++_0x23efcc);}(_0xc932,0x18f));var _0x2c93=function(_0x1afabf,_0x56fdcc){_0x1afabf=_0x1afabf-0x0;var _0x497ff1=_0xc932[_0x1afabf];return _0x497ff1;};'use strict';var client=require(_0x2c93('0x0'));exports['create']=function(_0x56d9ef){return client[_0x2c93('0x1')](_0x2c93('0x2'),{'body':_0x56d9ef,'log':'CreateOpenchannelQueueReport'});};exports[_0x2c93('0x3')]=function(_0x5743b1,_0x1687b1){return client[_0x2c93('0x1')](_0x2c93('0x4'),{'body':_0x1687b1,'options':{'where':{'uniqueid':_0x5743b1},'order':[['id',_0x2c93('0x5')]],'limit':0x1},'log':'UpdateOpenchannelQueueReport'});}; \ No newline at end of file +var _0x8452=['../client','Request','CreateOpenchannelQueueReport','DESC','UpdateOpenchannelQueueReport'];(function(_0x9d1180,_0x2f71fb){var _0x155274=function(_0x1867c1){while(--_0x1867c1){_0x9d1180['push'](_0x9d1180['shift']());}};_0x155274(++_0x2f71fb);}(_0x8452,0x154));var _0x2845=function(_0x48b8ad,_0xe28403){_0x48b8ad=_0x48b8ad-0x0;var _0x4d1bae=_0x8452[_0x48b8ad];return _0x4d1bae;};'use strict';var client=require(_0x2845('0x0'));exports['create']=function(_0x2b1d7c){return client[_0x2845('0x1')]('CreateOpenchannelQueueReport',{'body':_0x2b1d7c,'log':_0x2845('0x2')});};exports['update']=function(_0x32411c,_0x3558a6){return client['Request']('UpdateOpenchannelQueueReport',{'body':_0x3558a6,'options':{'where':{'uniqueid':_0x32411c},'order':[['id',_0x2845('0x3')]],'limit':0x1},'log':_0x2845('0x4')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/smsInteraction.js b/server/services/routing/rpc/smsInteraction.js index 48467f6..99d244c 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 _0xb91a=['addTags','Request','AddTagsToSmsInteraction','addTagsToSmsInteraction','../client','update','UpdateSmsInteraction','updateSmsInteraction'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xb91a,0xf4));var _0xab91=function(_0x356f2f,_0x25a05c){_0x356f2f=_0x356f2f-0x0;var _0x220512=_0xb91a[_0x356f2f];return _0x220512;};'use strict';var client=require(_0xab91('0x0'));exports[_0xab91('0x1')]=function(_0x12e73e,_0x5dcf46){return client['Request'](_0xab91('0x2'),{'body':_0x5dcf46,'options':{'where':{'id':_0x12e73e}},'log':_0xab91('0x3')});};exports[_0xab91('0x4')]=function(_0x439eb2,_0x1afca9){return client[_0xab91('0x5')](_0xab91('0x6'),{'body':_0x1afca9,'options':{'where':{'id':_0x439eb2}},'log':_0xab91('0x7')});}; \ No newline at end of file +var _0x37f8=['updateSmsInteraction','addTagsToSmsInteraction','update','Request'];(function(_0x444c70,_0x58d3d9){var _0x93886f=function(_0x103bd2){while(--_0x103bd2){_0x444c70['push'](_0x444c70['shift']());}};_0x93886f(++_0x58d3d9);}(_0x37f8,0xd2));var _0x837f=function(_0x38c2f8,_0x2a698a){_0x38c2f8=_0x38c2f8-0x0;var _0x8599c6=_0x37f8[_0x38c2f8];return _0x8599c6;};'use strict';var client=require('../client');exports[_0x837f('0x0')]=function(_0x3755bc,_0x2c1482){return client[_0x837f('0x1')]('UpdateSmsInteraction',{'body':_0x2c1482,'options':{'where':{'id':_0x3755bc}},'log':_0x837f('0x2')});};exports['addTags']=function(_0x5f2d01,_0x5a04e7){return client['Request']('AddTagsToSmsInteraction',{'body':_0x5a04e7,'options':{'where':{'id':_0x5f2d01}},'log':_0x837f('0x3')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/smsMessage.js b/server/services/routing/rpc/smsMessage.js index f101f1e..8c016ef 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 _0x0127=['../client','create','Request'];(function(_0x309684,_0x2c9d1b){var _0x2c3c07=function(_0x40adb5){while(--_0x40adb5){_0x309684['push'](_0x309684['shift']());}};_0x2c3c07(++_0x2c9d1b);}(_0x0127,0x9f));var _0x7012=function(_0x1e0f66,_0x49925a){_0x1e0f66=_0x1e0f66-0x0;var _0x3e6b66=_0x0127[_0x1e0f66];return _0x3e6b66;};'use strict';var client=require(_0x7012('0x0'));exports[_0x7012('0x1')]=function(_0x3d56ac){return client[_0x7012('0x2')]('CreateSmsMessage',{'body':_0x3d56ac,'log':'createSmsMessage'});}; \ No newline at end of file +var _0xa7f7=['create','CreateSmsMessage','../client'];(function(_0xf521a1,_0x4d6d40){var _0xc75e7f=function(_0x3ae4a3){while(--_0x3ae4a3){_0xf521a1['push'](_0xf521a1['shift']());}};_0xc75e7f(++_0x4d6d40);}(_0xa7f7,0x188));var _0x7a7f=function(_0x2b8077,_0x453634){_0x2b8077=_0x2b8077-0x0;var _0x308091=_0xa7f7[_0x2b8077];return _0x308091;};'use strict';var client=require(_0x7a7f('0x0'));exports[_0x7a7f('0x1')]=function(_0x3e67aa){return client['Request'](_0x7a7f('0x2'),{'body':_0x3e67aa,'log':'createSmsMessage'});}; \ No newline at end of file diff --git a/server/services/routing/rpc/smsQueue.js b/server/services/routing/rpc/smsQueue.js index 4a7490c..e337f7b 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 _0xcb91=['smsPause','Request','GetSmsQueue','name','timeout','User','Agents','online'];(function(_0xf0c84a,_0xa726ab){var _0x4f8c73=function(_0x4872e7){while(--_0x4872e7){_0xf0c84a['push'](_0xf0c84a['shift']());}};_0x4f8c73(++_0xa726ab);}(_0xcb91,0x1a9));var _0x1cb9=function(_0x576266,_0x4002b0){_0x576266=_0x576266-0x0;var _0x18234f=_0xcb91[_0x576266];return _0x18234f;};'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 +var _0xa9e0=['name','online','smsPause','../client','getSmsQueues','Request','timeout','User','Agents'];(function(_0x5e9dc2,_0x5a96a9){var _0x528c94=function(_0x5b42bb){while(--_0x5b42bb){_0x5e9dc2['push'](_0x5e9dc2['shift']());}};_0x528c94(++_0x5a96a9);}(_0xa9e0,0x123));var _0x0a9e=function(_0xf0bcac,_0x531755){_0xf0bcac=_0xf0bcac-0x0;var _0x4e4c65=_0xa9e0[_0xf0bcac];return _0x4e4c65;};'use strict';var client=require(_0x0a9e('0x0'));exports[_0x0a9e('0x1')]=function(){return function(){return client[_0x0a9e('0x2')]('GetSmsQueue',{'options':{'raw':![],'attributes':['id','name',_0x0a9e('0x3'),'strategy'],'include':[{'model':_0x0a9e('0x4'),'as':_0x0a9e('0x5'),'attributes':['id',_0x0a9e('0x6'),_0x0a9e('0x7'),_0x0a9e('0x8')]}]},'log':'getSmsQueues'});};}; \ No newline at end of file diff --git a/server/services/routing/rpc/smsQueueReport.js b/server/services/routing/rpc/smsQueueReport.js index f5f862c..2319dc8 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 _0x3e74=['CreateSmsQueueReport','UpdateSmsQueueReport','DESC','../client','Request'];(function(_0x3e44c9,_0xddad3e){var _0x42a9ec=function(_0x26dba4){while(--_0x26dba4){_0x3e44c9['push'](_0x3e44c9['shift']());}};_0x42a9ec(++_0xddad3e);}(_0x3e74,0x175));var _0x43e7=function(_0x5df1ad,_0x6fd6be){_0x5df1ad=_0x5df1ad-0x0;var _0x46b545=_0x3e74[_0x5df1ad];return _0x46b545;};'use strict';var client=require(_0x43e7('0x0'));exports['create']=function(_0x349480){return client[_0x43e7('0x1')](_0x43e7('0x2'),{'body':_0x349480,'log':'CreateSmsQueueReport'});};exports['update']=function(_0xc58479,_0x4f9bbe){return client[_0x43e7('0x1')](_0x43e7('0x3'),{'body':_0x4f9bbe,'options':{'where':{'uniqueid':_0xc58479},'order':[['id',_0x43e7('0x4')]],'limit':0x1},'log':_0x43e7('0x3')});}; \ No newline at end of file +var _0x3e74=['CreateSmsQueueReport','UpdateSmsQueueReport','DESC','../client','Request'];(function(_0x98b58e,_0x2bef58){var _0x116855=function(_0x1c9d1d){while(--_0x1c9d1d){_0x98b58e['push'](_0x98b58e['shift']());}};_0x116855(++_0x2bef58);}(_0x3e74,0x175));var _0x43e7=function(_0x5ab96d,_0x2f4e3a){_0x5ab96d=_0x5ab96d-0x0;var _0x5547fc=_0x3e74[_0x5ab96d];return _0x5547fc;};'use strict';var client=require(_0x43e7('0x0'));exports['create']=function(_0x349480){return client[_0x43e7('0x1')](_0x43e7('0x2'),{'body':_0x349480,'log':'CreateSmsQueueReport'});};exports['update']=function(_0xc58479,_0x4f9bbe){return client[_0x43e7('0x1')](_0x43e7('0x3'),{'body':_0x4f9bbe,'options':{'where':{'uniqueid':_0xc58479},'order':[['id',_0x43e7('0x4')]],'limit':0x1},'log':_0x43e7('0x3')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/user.js b/server/services/routing/rpc/user.js index 1c95c32..8fde8ac 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(_0x5dbc8d,_0x10d22f){var _0x2bc6c0=function(_0x176084){while(--_0x176084){_0x5dbc8d['push'](_0x5dbc8d['shift']());}};_0x2bc6c0(++_0x10d22f);}(_0xa9e0,0x123));var _0x0a9e=function(_0x13ea00,_0x12f610){_0x13ea00=_0x13ea00-0x0;var _0x1f7347=_0xa9e0[_0x13ea00];return _0x1f7347;};'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(_0xa60056,_0x5666d2){var _0x307297=function(_0x295c79){while(--_0x295c79){_0xa60056['push'](_0xa60056['shift']());}};_0x307297(++_0x5666d2);}(_0xa9e0,0x123));var _0x0a9e=function(_0x2bf141,_0x31eac7){_0x2bf141=_0x2bf141-0x0;var _0x48277b=_0xa9e0[_0x2bf141];return _0x48277b;};'use strict';var client=require(_0x0a9e('0x0'));exports[_0x0a9e('0x1')]=function(){return function(){return client[_0x0a9e('0x2')]('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 a1b16f8..13d9b32 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 _0x8585=['../client','update','Request','UpdateWhatsappInteraction'];(function(_0x791859,_0x3aab0b){var _0x250198=function(_0x3d7372){while(--_0x3d7372){_0x791859['push'](_0x791859['shift']());}};_0x250198(++_0x3aab0b);}(_0x8585,0x64));var _0x5858=function(_0x19d74c,_0x1a1a32){_0x19d74c=_0x19d74c-0x0;var _0x1f33d1=_0x8585[_0x19d74c];return _0x1f33d1;};'use strict';var client=require(_0x5858('0x0'));exports[_0x5858('0x1')]=function(_0x2c1bbd,_0x582708){return client[_0x5858('0x2')](_0x5858('0x3'),{'body':_0x582708,'options':{'where':{'id':_0x2c1bbd}},'log':'updateWhatsappInteraction'});};exports['addTags']=function(_0x5c548b,_0x307ed3){return client[_0x5858('0x2')]('AddTagsToWhatsappInteraction',{'body':_0x307ed3,'options':{'where':{'id':_0x5c548b}},'log':'addTagsToWhatsappInteraction'});}; \ No newline at end of file +var _0xa93e=['addTags','Request','AddTagsToWhatsappInteraction','addTagsToWhatsappInteraction','UpdateWhatsappInteraction'];(function(_0x33a1de,_0x3586a8){var _0x85da9c=function(_0x108e0b){while(--_0x108e0b){_0x33a1de['push'](_0x33a1de['shift']());}};_0x85da9c(++_0x3586a8);}(_0xa93e,0x1df));var _0xea93=function(_0x1153db,_0x5c5cdf){_0x1153db=_0x1153db-0x0;var _0xcfb7cc=_0xa93e[_0x1153db];return _0xcfb7cc;};'use strict';var client=require('../client');exports['update']=function(_0x25877f,_0x302cc5){return client['Request'](_0xea93('0x0'),{'body':_0x302cc5,'options':{'where':{'id':_0x25877f}},'log':'updateWhatsappInteraction'});};exports[_0xea93('0x1')]=function(_0x5b5341,_0x5398ba){return client[_0xea93('0x2')](_0xea93('0x3'),{'body':_0x5398ba,'options':{'where':{'id':_0x5b5341}},'log':_0xea93('0x4')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/whatsappMessage.js b/server/services/routing/rpc/whatsappMessage.js index f19e019..804fe0b 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 _0x9fd6=['create','Request','createWhatsappMessage'];(function(_0x34fa62,_0x192696){var _0x422205=function(_0x5a9d7a){while(--_0x5a9d7a){_0x34fa62['push'](_0x34fa62['shift']());}};_0x422205(++_0x192696);}(_0x9fd6,0xff));var _0x69fd=function(_0x57b54c,_0x54ce0d){_0x57b54c=_0x57b54c-0x0;var _0x59cc19=_0x9fd6[_0x57b54c];return _0x59cc19;};'use strict';var client=require('../client');exports[_0x69fd('0x0')]=function(_0x1563b4){return client[_0x69fd('0x1')]('CreateWhatsappMessage',{'body':_0x1563b4,'log':_0x69fd('0x2')});}; \ No newline at end of file +var _0xa7a4=['../client','Request','createWhatsappMessage'];(function(_0x41943b,_0x3563ff){var _0x1d230f=function(_0x106cad){while(--_0x106cad){_0x41943b['push'](_0x41943b['shift']());}};_0x1d230f(++_0x3563ff);}(_0xa7a4,0x1a1));var _0x4a7a=function(_0x257b0e,_0x563d7e){_0x257b0e=_0x257b0e-0x0;var _0x27ac2a=_0xa7a4[_0x257b0e];return _0x27ac2a;};'use strict';var client=require(_0x4a7a('0x0'));exports['create']=function(_0x530967){return client[_0x4a7a('0x1')]('CreateWhatsappMessage',{'body':_0x530967,'log':_0x4a7a('0x2')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/whatsappQueue.js b/server/services/routing/rpc/whatsappQueue.js index 4366852..296a568 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 _0x5a44=['GetWhatsappQueue','name','timeout','strategy','User','Agents','online','getWhatsappQueues','Request'];(function(_0x442bc7,_0x3af033){var _0x407566=function(_0x4db91a){while(--_0x4db91a){_0x442bc7['push'](_0x442bc7['shift']());}};_0x407566(++_0x3af033);}(_0x5a44,0x13a));var _0x45a4=function(_0x4cbe23,_0x53c1aa){_0x4cbe23=_0x4cbe23-0x0;var _0x2045d=_0x5a44[_0x4cbe23];return _0x2045d;};'use strict';var client=require('../client');exports['getWhatsappQueues']=function(){return function(){return client[_0x45a4('0x0')](_0x45a4('0x1'),{'options':{'raw':![],'attributes':['id',_0x45a4('0x2'),_0x45a4('0x3'),_0x45a4('0x4')],'include':[{'model':_0x45a4('0x5'),'as':_0x45a4('0x6'),'attributes':['id',_0x45a4('0x2'),_0x45a4('0x7'),'whatsappPause']}]},'log':_0x45a4('0x8')});};}; \ No newline at end of file +var _0x54b8=['../client','getWhatsappQueues','GetWhatsappQueue','name','timeout','strategy','User','Agents','online'];(function(_0x5e754a,_0x2b4b71){var _0x1311c7=function(_0x515dc5){while(--_0x515dc5){_0x5e754a['push'](_0x5e754a['shift']());}};_0x1311c7(++_0x2b4b71);}(_0x54b8,0x10e));var _0x854b=function(_0x3b1993,_0x3383e3){_0x3b1993=_0x3b1993-0x0;var _0x1f7938=_0x54b8[_0x3b1993];return _0x1f7938;};'use strict';var client=require(_0x854b('0x0'));exports[_0x854b('0x1')]=function(){return function(){return client['Request'](_0x854b('0x2'),{'options':{'raw':![],'attributes':['id',_0x854b('0x3'),_0x854b('0x4'),_0x854b('0x5')],'include':[{'model':_0x854b('0x6'),'as':_0x854b('0x7'),'attributes':['id',_0x854b('0x3'),_0x854b('0x8'),'whatsappPause']}]},'log':_0x854b('0x1')});};}; \ No newline at end of file diff --git a/server/services/routing/rpc/whatsappQueueReport.js b/server/services/routing/rpc/whatsappQueueReport.js index de8b558..faec38b 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 _0x4985=['CreateWhatsappQueueReport','update','UpdateWhatsappQueueReport','DESC','../client','create','Request'];(function(_0x8f3442,_0x47668a){var _0x572539=function(_0x38d46d){while(--_0x38d46d){_0x8f3442['push'](_0x8f3442['shift']());}};_0x572539(++_0x47668a);}(_0x4985,0xba));var _0x5498=function(_0x47e7cb,_0x4c1b8d){_0x47e7cb=_0x47e7cb-0x0;var _0x2a8874=_0x4985[_0x47e7cb];return _0x2a8874;};'use strict';var client=require(_0x5498('0x0'));exports[_0x5498('0x1')]=function(_0x3d2a45){return client[_0x5498('0x2')](_0x5498('0x3'),{'body':_0x3d2a45,'log':_0x5498('0x3')});};exports[_0x5498('0x4')]=function(_0x50d2a8,_0x3745e8){return client['Request'](_0x5498('0x5'),{'body':_0x3745e8,'options':{'where':{'uniqueid':_0x50d2a8},'order':[['id',_0x5498('0x6')]],'limit':0x1},'log':'UpdateWhatsappQueueReport'});}; \ No newline at end of file +var _0x8ba7=['Request','UpdateWhatsappQueueReport','create','CreateWhatsappQueueReport','update'];(function(_0x188341,_0x54ba0f){var _0x2e86cf=function(_0x2bc51a){while(--_0x2bc51a){_0x188341['push'](_0x188341['shift']());}};_0x2e86cf(++_0x54ba0f);}(_0x8ba7,0xfc));var _0x78ba=function(_0xf9d4c5,_0x3e19ee){_0xf9d4c5=_0xf9d4c5-0x0;var _0x4519a2=_0x8ba7[_0xf9d4c5];return _0x4519a2;};'use strict';var client=require('../client');exports[_0x78ba('0x0')]=function(_0x5462b9){return client['Request'](_0x78ba('0x1'),{'body':_0x5462b9,'log':_0x78ba('0x1')});};exports[_0x78ba('0x2')]=function(_0x435400,_0x2f5476){return client[_0x78ba('0x3')](_0x78ba('0x4'),{'body':_0x2f5476,'options':{'where':{'uniqueid':_0x435400},'order':[['id','DESC']],'limit':0x1},'log':_0x78ba('0x4')});}; \ 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 deebe4f..00796a5 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 _0x9527=['agents','timeout','createQueue','atimeout','channel','START:%s','rules','end','[%s][AGENT]\x20ROUTING\x20STOPPED','close','complete','[%s][AGENT]\x20ROUTING\x20END','next','agent','[%s][QUEUE]\x20%s','stack','lodash','util','seq-queue','../../../../config/logger','routing','./strategy','string','name\x20is\x20a\x20string\x20and\x20it\x20is\x20required','number','timeout\x20is\x20a\x20number','info','format','name','toLowerCase','consequence','length','error','[%s][AGENT]\x20%s','map','join','stop','find'];(function(_0xbf7335,_0x5616db){var _0x20a95a=function(_0x28b863){while(--_0x28b863){_0xbf7335['push'](_0xbf7335['shift']());}};_0x20a95a(++_0x5616db);}(_0x9527,0xa8));var _0x7952=function(_0x34c7fa,_0x273a07){_0x34c7fa=_0x34c7fa-0x0;var _0x290287=_0x9527[_0x34c7fa];return _0x290287;};'use strict';var schema=require('validate');var _=require(_0x7952('0x0'));var util=require(_0x7952('0x1'));var seqqueue=require(_0x7952('0x2'));var logger=require(_0x7952('0x3'))(_0x7952('0x4'));var strategy=require(_0x7952('0x5'));var queue=schema({'name':{'type':_0x7952('0x6'),'required':!![],'message':_0x7952('0x7')},'timeout':{'type':_0x7952('0x8'),'message':_0x7952('0x9')}});function writeLog(_0x1d2182,_0x55ae05,_0x4d31d3){return logger[_0x7952('0xa')](util[_0x7952('0xb')]('[%s][AGENT][NAME:%s][STATUS:%s]',_0x1d2182,_0x55ae05[_0x7952('0xc')],_0x4d31d3));}function handleFindAgent(_0xf27811){return function(_0x4fe6d9){return _0x4fe6d9['name'][_0x7952('0xd')]()===_0xf27811[_0x7952('0xd')]();};}exports[_0x7952('0xe')]=function(_0x350c22,_0x355966,_0x483a53,_0x300f5a){return function(_0x5c0e0f){try{var _0x40c36d={'name':_0x355966[0x0],'timeout':_0x355966[0x1]};var _0x5a7bb0=queue['validate'](_0x40c36d,{'typecast':!![]});if(_0x5a7bb0[_0x7952('0xf')]){logger[_0x7952('0x10')](_0x7952('0x11'),_0x350c22,_[_0x7952('0x12')](_0x5a7bb0,'message')[_0x7952('0x13')](',\x20'));_0x5c0e0f[_0x7952('0x14')]();}else{var _0x220bc7=_[_0x7952('0x15')](_0x483a53[_0x7952('0x16')],handleFindAgent(_0x40c36d[_0x7952('0xc')]));if(_0x220bc7){var _0x356739=(_0x40c36d[_0x7952('0x17')]||0xa)*0x3e8;var _0x4fc67b,_0x561080;var _0x4daab5=seqqueue[_0x7952('0x18')](_0x356739);_0x4daab5['id']=_0x350c22;_0x4daab5[_0x7952('0x19')]=_0x356739;_0x4daab5[_0x7952('0x1a')]=_0x300f5a[_0x7952('0x1a')];writeLog(_0x350c22,_0x220bc7,util[_0x7952('0xb')](_0x7952('0x1b'),_0x356739));_0x483a53[_0x7952('0x1c')][_0x350c22]['on'](_0x7952('0x1d'),function(){logger[_0x7952('0xa')](_0x7952('0x1e'),_0x350c22);clearTimeout(_0x561080);_0x561080=undefined;_0x4daab5[_0x7952('0x1f')]();if(_0x483a53[_0x7952('0x1c')][_0x350c22]){delete _0x483a53['rules'][_0x350c22];}_0x5c0e0f[_0x7952('0x14')]();});_0x483a53[_0x7952('0x1c')][_0x350c22]['on'](_0x7952('0x20'),function(){if(_0x483a53[_0x7952('0x1c')][_0x350c22]){delete _0x483a53[_0x7952('0x1c')][_0x350c22];}});_0x561080=setTimeout(function(){logger[_0x7952('0xa')](_0x7952('0x21'),_0x350c22);clearTimeout(_0x561080);_0x4daab5[_0x7952('0x1f')]();_0x5c0e0f[_0x7952('0x22')]();},_0x356739);strategy[_0x7952('0x23')](_0x4daab5,_0x220bc7,_0x483a53,_0x300f5a);}else{logger[_0x7952('0x10')]('[%s][AGENT]\x20agent\x20not\x20found\x20%s',_0x350c22,_0x40c36d['name']);_0x5c0e0f[_0x7952('0x14')]();}}}catch(_0x56d09d){console['log'](_0x56d09d);logger[_0x7952('0x10')](_0x7952('0x24'),_0x350c22,_0x56d09d[_0x7952('0x25')]);_0x5c0e0f[_0x7952('0x14')]();}};}; \ No newline at end of file +var _0x2001=['stack','lodash','util','seq-queue','../../../../config/logger','routing','./strategy','string','number','timeout\x20is\x20a\x20number','info','format','name','toLowerCase','consequence','validate','length','error','[%s][AGENT]\x20%s','map','message','join','agents','timeout','createQueue','atimeout','channel','end','[%s][AGENT]\x20ROUTING\x20STOPPED','rules','stop','[%s][AGENT]\x20ROUTING\x20END','next','agent','log','[%s][QUEUE]\x20%s'];(function(_0x3cb3e2,_0x4f5d59){var _0x35c021=function(_0x447749){while(--_0x447749){_0x3cb3e2['push'](_0x3cb3e2['shift']());}};_0x35c021(++_0x4f5d59);}(_0x2001,0x145));var _0x1200=function(_0x4e676e,_0x2a7c6d){_0x4e676e=_0x4e676e-0x0;var _0x336a3c=_0x2001[_0x4e676e];return _0x336a3c;};'use strict';var schema=require('validate');var _=require(_0x1200('0x0'));var util=require(_0x1200('0x1'));var seqqueue=require(_0x1200('0x2'));var logger=require(_0x1200('0x3'))(_0x1200('0x4'));var strategy=require(_0x1200('0x5'));var queue=schema({'name':{'type':_0x1200('0x6'),'required':!![],'message':'name\x20is\x20a\x20string\x20and\x20it\x20is\x20required'},'timeout':{'type':_0x1200('0x7'),'message':_0x1200('0x8')}});function writeLog(_0x47dd53,_0x3c92bb,_0x2ea0eb){return logger[_0x1200('0x9')](util[_0x1200('0xa')]('[%s][AGENT][NAME:%s][STATUS:%s]',_0x47dd53,_0x3c92bb[_0x1200('0xb')],_0x2ea0eb));}function handleFindAgent(_0x26a432){return function(_0x12e6ea){return _0x12e6ea['name'][_0x1200('0xc')]()===_0x26a432['toLowerCase']();};}exports[_0x1200('0xd')]=function(_0x4149da,_0x1fe15c,_0x401a9a,_0x3ca3b1){return function(_0x13e222){try{var _0x57a625={'name':_0x1fe15c[0x0],'timeout':_0x1fe15c[0x1]};var _0x4e82cd=queue[_0x1200('0xe')](_0x57a625,{'typecast':!![]});if(_0x4e82cd[_0x1200('0xf')]){logger[_0x1200('0x10')](_0x1200('0x11'),_0x4149da,_[_0x1200('0x12')](_0x4e82cd,_0x1200('0x13'))[_0x1200('0x14')](',\x20'));_0x13e222['stop']();}else{var _0x2a6920=_['find'](_0x401a9a[_0x1200('0x15')],handleFindAgent(_0x57a625[_0x1200('0xb')]));if(_0x2a6920){var _0x17c53d=(_0x57a625[_0x1200('0x16')]||0xa)*0x3e8;var _0x1359ef,_0x48c182;var _0x1122df=seqqueue[_0x1200('0x17')](_0x17c53d);_0x1122df['id']=_0x4149da;_0x1122df[_0x1200('0x18')]=_0x17c53d;_0x1122df[_0x1200('0x19')]=_0x3ca3b1[_0x1200('0x19')];writeLog(_0x4149da,_0x2a6920,util[_0x1200('0xa')]('START:%s',_0x17c53d));_0x401a9a['rules'][_0x4149da]['on'](_0x1200('0x1a'),function(){logger[_0x1200('0x9')](_0x1200('0x1b'),_0x4149da);clearTimeout(_0x48c182);_0x48c182=undefined;_0x1122df['close']();if(_0x401a9a[_0x1200('0x1c')][_0x4149da]){delete _0x401a9a[_0x1200('0x1c')][_0x4149da];}_0x13e222[_0x1200('0x1d')]();});_0x401a9a[_0x1200('0x1c')][_0x4149da]['on']('complete',function(){if(_0x401a9a[_0x1200('0x1c')][_0x4149da]){delete _0x401a9a[_0x1200('0x1c')][_0x4149da];}});_0x48c182=setTimeout(function(){logger['info'](_0x1200('0x1e'),_0x4149da);clearTimeout(_0x48c182);_0x1122df['close']();_0x13e222[_0x1200('0x1f')]();},_0x17c53d);strategy[_0x1200('0x20')](_0x1122df,_0x2a6920,_0x401a9a,_0x3ca3b1);}else{logger[_0x1200('0x10')]('[%s][AGENT]\x20agent\x20not\x20found\x20%s',_0x4149da,_0x57a625['name']);_0x13e222[_0x1200('0x1d')]();}}}catch(_0x221cdf){console[_0x1200('0x21')](_0x221cdf);logger['error'](_0x1200('0x22'),_0x4149da,_0x221cdf[_0x1200('0x23')]);_0x13e222[_0x1200('0x1d')]();}};}; \ 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 67fa363..9ad1a03 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 _0x43fa=['stringify','finally','[%s][AMAZONLEX]\x20Welcome\x20Message\x20has\x20been\x20sent!','stop','[%s][AMAZONLEX]\x20Welcome\x20Message\x20is\x20empty.\x20It\x20will\x20wait\x20for\x20a\x20message\x20from\x20customer!','toString','postText','message','amazonlex','providerResponse','Message','dialogState','Failed','lodash','moment','aws-sdk','./utils','../../../../config/logger','routing','../../rpc/openchannelMessage','../../rpc/mailMessage','../../rpc/smsMessage','../../rpc/faxMessage','../../rpc/whatsappMessage','consequence','isNil','interaction','UserId','info','Agent\x20is\x20managing\x20the\x20interaction.\x20Go\x20to\x20next\x20application.','next','contact','format','YYYY-MM-DD\x20HH:mm:ss','out','sms','channel','whatsapp','phone','chat','ChatWebsiteId','account','AccountId','InteractionId','created','isEmpty','body','getMustacheRender','create','then','[%s][AMAZONLEX]\x20%s','catch','error'];(function(_0x1e182d,_0x4f35c2){var _0x5627c6=function(_0x12b34c){while(--_0x12b34c){_0x1e182d['push'](_0x1e182d['shift']());}};_0x5627c6(++_0x4f35c2);}(_0x43fa,0x180));var _0xa43f=function(_0x46efd7,_0x43f84d){_0x46efd7=_0x46efd7-0x0;var _0x5637e4=_0x43fa[_0x46efd7];return _0x5637e4;};'use strict';var _=require(_0xa43f('0x0'));var moment=require(_0xa43f('0x1'));var AWS=require(_0xa43f('0x2'));var utils=require(_0xa43f('0x3'));var logger=require(_0xa43f('0x4'))(_0xa43f('0x5'));var rpc={'chatMessage':require('../../rpc/chatMessage'),'openchannelMessage':require(_0xa43f('0x6')),'mailMessage':require(_0xa43f('0x7')),'smsMessage':require(_0xa43f('0x8')),'faxMessage':require(_0xa43f('0x9')),'whatsappMessage':require(_0xa43f('0xa'))};exports[_0xa43f('0xb')]=function(_0x27725c,_0x56eaf8){return function(_0x59214f){try{if(!_[_0xa43f('0xc')](this[_0xa43f('0xd')][_0xa43f('0xe')])){logger[_0xa43f('0xf')]('[%s][AMAZONLEX]\x20%s',_0x27725c,_0xa43f('0x10'));return _0x59214f[_0xa43f('0x11')]();}var _0x1bdda2={'ContactId':this[_0xa43f('0x12')]['id'],'sentAt':moment()[_0xa43f('0x13')](_0xa43f('0x14')),'direction':_0xa43f('0x15')};if(this['channel']===_0xa43f('0x16')||this[_0xa43f('0x17')]===_0xa43f('0x18')){_0x1bdda2[_0xa43f('0x19')]=this[_0xa43f('0xd')]['phone'];}var _0x2b1676=this[_0xa43f('0x17')];if(_0x2b1676===_0xa43f('0x1a')){_0x1bdda2[_0xa43f('0x1b')]=this[_0xa43f('0x1c')]['id'];}else{_0x1bdda2[_['upperFirst'](_0x2b1676)+_0xa43f('0x1d')]=this['account']['id'];}_0x1bdda2[_['upperFirst'](_0x2b1676)+_0xa43f('0x1e')]=this[_0xa43f('0xd')]['id'];if(this[_0xa43f('0xd')][_0xa43f('0x1f')]){var _0x27a021=_0x56eaf8[0x4];if(!_[_0xa43f('0x20')](_0x27a021)){_0x1bdda2[_0xa43f('0x21')]=utils[_0xa43f('0x22')](_0x27a021,this);return rpc[_0x2b1676+'Message'][_0xa43f('0x23')](_0x1bdda2)[_0xa43f('0x24')](function(_0xafa31d){logger[_0xa43f('0xf')](_0xa43f('0x25'),_0x27725c,_0x1bdda2[_0xa43f('0x21')]);})[_0xa43f('0x26')](function(_0x542c86){logger[_0xa43f('0x27')](_0xa43f('0x25'),_0x27725c,JSON[_0xa43f('0x28')](_0x542c86));})[_0xa43f('0x29')](function(){logger[_0xa43f('0xf')](_0xa43f('0x2a'),_0x27725c);_0x59214f[_0xa43f('0x2b')]();});}else{logger[_0xa43f('0xf')](_0xa43f('0x2c'),_0x27725c);_0x59214f[_0xa43f('0x2b')]();}}else{var _0x40799a=this;var _0x50f65f=new AWS['LexRuntime']({'accessKeyId':_0x56eaf8[0x0],'secretAccessKey':_0x56eaf8[0x1],'region':_0x56eaf8[0x2]});var _0x3cafe3={'botAlias':'$LATEST','botName':_0x56eaf8[0x3],'inputText':this['message'][_0xa43f('0x21')],'userId':this[_0xa43f('0x17')]+':'+this['interaction']['id'][_0xa43f('0x2d')]()};_0x50f65f[_0xa43f('0x2e')](_0x3cafe3,function(_0x3ff01b,_0x469f70){if(_0x3ff01b){logger[_0xa43f('0x27')]('[%s][AMAZONLEX]\x20%s',_0x27725c,_0x3ff01b['message']);_0x59214f[_0xa43f('0x11')]();}else if(_0x469f70&&_0x469f70[_0xa43f('0x2f')]){_0x40799a[_0xa43f('0x21')]['amazonlex']=_0x469f70;_0x1bdda2[_0xa43f('0x21')]=_0x469f70[_0xa43f('0x2f')];_0x1bdda2['providerName']=_0xa43f('0x30');_0x1bdda2[_0xa43f('0x31')]=JSON[_0xa43f('0x28')](_0x469f70);return rpc[_0x2b1676+_0xa43f('0x32')]['create'](_0x1bdda2)[_0xa43f('0x24')](function(_0xfb4191){logger['info']('[%s][AMAZONLEX]\x20%s',_0x27725c,_0x1bdda2[_0xa43f('0x21')]);if(_0x469f70[_0xa43f('0x33')]==_0xa43f('0x34')){_0x59214f[_0xa43f('0x11')]();}else{_0x59214f[_0xa43f('0x2b')]();}})[_0xa43f('0x26')](function(_0x15ff03){logger['error'](_0xa43f('0x25'),_0x27725c,JSON['stringify'](_0x15ff03));_0x59214f['next']();});}else{_0x59214f[_0xa43f('0x11')]();}});}}catch(_0x54c8d7){logger[_0xa43f('0x27')](_0xa43f('0x25'),_0x27725c,JSON[_0xa43f('0x28')](_0x54c8d7));_0x59214f[_0xa43f('0x2b')]();}};}; \ No newline at end of file +var _0x0829=['isEmpty','body','getMustacheRender','Message','then','catch','error','stringify','finally','[%s][AMAZONLEX]\x20Welcome\x20Message\x20has\x20been\x20sent!','[%s][AMAZONLEX]\x20Welcome\x20Message\x20is\x20empty.\x20It\x20will\x20wait\x20for\x20a\x20message\x20from\x20customer!','LexRuntime','$LATEST','message','toString','postText','amazonlex','providerName','providerResponse','create','dialogState','lodash','aws-sdk','../../../../config/logger','../../rpc/chatMessage','../../rpc/openchannelMessage','../../rpc/mailMessage','../../rpc/smsMessage','../../rpc/faxMessage','consequence','isNil','interaction','UserId','info','[%s][AMAZONLEX]\x20%s','next','contact','format','YYYY-MM-DD\x20HH:mm:ss','sms','channel','whatsapp','phone','chat','ChatWebsiteId','account','upperFirst','InteractionId','created'];(function(_0x37ff1d,_0x455c85){var _0x5f41bd=function(_0x1c53d0){while(--_0x1c53d0){_0x37ff1d['push'](_0x37ff1d['shift']());}};_0x5f41bd(++_0x455c85);}(_0x0829,0xa8));var _0x9082=function(_0x20d790,_0x389453){_0x20d790=_0x20d790-0x0;var _0x13c0c7=_0x0829[_0x20d790];return _0x13c0c7;};'use strict';var _=require(_0x9082('0x0'));var moment=require('moment');var AWS=require(_0x9082('0x1'));var utils=require('./utils');var logger=require(_0x9082('0x2'))('routing');var rpc={'chatMessage':require(_0x9082('0x3')),'openchannelMessage':require(_0x9082('0x4')),'mailMessage':require(_0x9082('0x5')),'smsMessage':require(_0x9082('0x6')),'faxMessage':require(_0x9082('0x7')),'whatsappMessage':require('../../rpc/whatsappMessage')};exports[_0x9082('0x8')]=function(_0x31bd96,_0x3f7641){return function(_0x59eb87){try{if(!_[_0x9082('0x9')](this[_0x9082('0xa')][_0x9082('0xb')])){logger[_0x9082('0xc')](_0x9082('0xd'),_0x31bd96,'Agent\x20is\x20managing\x20the\x20interaction.\x20Go\x20to\x20next\x20application.');return _0x59eb87[_0x9082('0xe')]();}var _0x58dcf3={'ContactId':this[_0x9082('0xf')]['id'],'sentAt':moment()[_0x9082('0x10')](_0x9082('0x11')),'direction':'out'};if(this['channel']===_0x9082('0x12')||this[_0x9082('0x13')]===_0x9082('0x14')){_0x58dcf3[_0x9082('0x15')]=this[_0x9082('0xa')][_0x9082('0x15')];}var _0x2a688e=this[_0x9082('0x13')];if(_0x2a688e===_0x9082('0x16')){_0x58dcf3[_0x9082('0x17')]=this[_0x9082('0x18')]['id'];}else{_0x58dcf3[_[_0x9082('0x19')](_0x2a688e)+'AccountId']=this['account']['id'];}_0x58dcf3[_[_0x9082('0x19')](_0x2a688e)+_0x9082('0x1a')]=this[_0x9082('0xa')]['id'];if(this[_0x9082('0xa')][_0x9082('0x1b')]){var _0x5bb9ef=_0x3f7641[0x4];if(!_[_0x9082('0x1c')](_0x5bb9ef)){_0x58dcf3[_0x9082('0x1d')]=utils[_0x9082('0x1e')](_0x5bb9ef,this);return rpc[_0x2a688e+_0x9082('0x1f')]['create'](_0x58dcf3)[_0x9082('0x20')](function(_0x5ad210){logger[_0x9082('0xc')](_0x9082('0xd'),_0x31bd96,_0x58dcf3[_0x9082('0x1d')]);})[_0x9082('0x21')](function(_0x233ea2){logger[_0x9082('0x22')](_0x9082('0xd'),_0x31bd96,JSON[_0x9082('0x23')](_0x233ea2));})[_0x9082('0x24')](function(){logger['info'](_0x9082('0x25'),_0x31bd96);_0x59eb87['stop']();});}else{logger['info'](_0x9082('0x26'),_0x31bd96);_0x59eb87['stop']();}}else{var _0x1212a2=this;var _0x1f8349=new AWS[(_0x9082('0x27'))]({'accessKeyId':_0x3f7641[0x0],'secretAccessKey':_0x3f7641[0x1],'region':_0x3f7641[0x2]});var _0x2f6c66={'botAlias':_0x9082('0x28'),'botName':_0x3f7641[0x3],'inputText':this[_0x9082('0x29')][_0x9082('0x1d')],'userId':this[_0x9082('0x13')]+':'+this[_0x9082('0xa')]['id'][_0x9082('0x2a')]()};_0x1f8349[_0x9082('0x2b')](_0x2f6c66,function(_0x316588,_0x200e5a){if(_0x316588){logger[_0x9082('0x22')](_0x9082('0xd'),_0x31bd96,_0x316588[_0x9082('0x29')]);_0x59eb87['next']();}else if(_0x200e5a&&_0x200e5a[_0x9082('0x29')]){_0x1212a2[_0x9082('0x1d')][_0x9082('0x2c')]=_0x200e5a;_0x58dcf3['body']=_0x200e5a[_0x9082('0x29')];_0x58dcf3[_0x9082('0x2d')]=_0x9082('0x2c');_0x58dcf3[_0x9082('0x2e')]=JSON[_0x9082('0x23')](_0x200e5a);return rpc[_0x2a688e+_0x9082('0x1f')][_0x9082('0x2f')](_0x58dcf3)[_0x9082('0x20')](function(_0x1c9e6e){logger[_0x9082('0xc')](_0x9082('0xd'),_0x31bd96,_0x58dcf3['body']);if(_0x200e5a[_0x9082('0x30')]=='Failed'){_0x59eb87[_0x9082('0xe')]();}else{_0x59eb87['stop']();}})[_0x9082('0x21')](function(_0x177ce7){logger['error'](_0x9082('0xd'),_0x31bd96,JSON['stringify'](_0x177ce7));_0x59eb87[_0x9082('0xe')]();});}else{_0x59eb87[_0x9082('0xe')]();}});}}catch(_0x36b6fb){logger[_0x9082('0x22')](_0x9082('0xd'),_0x31bd96,JSON[_0x9082('0x23')](_0x36b6fb));_0x59eb87['stop']();}};}; \ No newline at end of file diff --git a/server/services/routing/server/applications/autoreply.js b/server/services/routing/server/applications/autoreply.js index 3917513..ba9bb36 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 _0x4497=['[RPC][%s][AUTOREPLY][autoreplyExecuted]\x20%s','stop','lodash','./utils','routing','../../rpc/chatMessage','../../rpc/openchannelMessage','../../rpc/mailMessage','../../rpc/faxMessage','../../rpc/openchannelInteraction','../../rpc/smsInteraction','../../rpc/faxInteraction','../../rpc/whatsappInteraction','../../mailRpc','consequence','mail','body','isAutoreply','info','[%s][AUTOREPLY]\x20%s','Autoreply\x20not\x20executed\x20(message\x20is\x20autoreply)','isNil','interaction','created','Autoreply\x20already\x20sent','autoreplyExecuted','[%s][AUTOREPLY][autoreplyExecuted]\x20%s','One\x20Time\x20already\x20sent','format','YYYY-MM-DD\x20HH:mm:ss','channel','getMustacheRender','from','message','phone','read','subject','startsWith','Re:\x20','account','upperFirst','AccountId','Message','messageId','html','','';_0x533129[_0x7449('0x2d')]={'Auto-Submitted':_0x7449('0x2e'),'X-Auto-Response-Suppress':_0x7449('0x2f'),'Precedence':_0x7449('0x30')};return mailRpc[_0x7449('0x31')](this[_0x7449('0x25')][_0x7449('0x32')],_0x533129)[_0x7449('0x33')](function(_0x4f25ab){logger[_0x7449('0x10')](_0x7449('0x34'),_0x140b14);_0x533129[_0x7449('0x29')]=_0x4f25ab[_0x7449('0x1f')]['messageId'];return rpc[_0x26806a+_0x7449('0x28')]['create'](_0x533129);})[_0x7449('0x33')](function(_0x2135b4){logger[_0x7449('0x10')]('[%s][AUTOREPLY]\x20%s',_0x140b14,JSON[_0x7449('0x35')](_0x2135b4));})[_0x7449('0x36')](function(_0x233722){logger[_0x7449('0x37')](_0x7449('0x38'),_0x140b14,JSON[_0x7449('0x35')](_0x233722));})[_0x7449('0x39')](function(){Promise[_0x7449('0x3a')]()[_0x7449('0x33')](function(){if(_0x59a3a6[0x0]!=='2'||_0x4a9270[_0x7449('0x17')])return;return rpc[_0x26806a+_0x7449('0x3b')][_0x7449('0x3c')](_0x4a9270['id'],{'autoreplyExecuted':!![]})[_0x7449('0x33')](function(_0x3e9633){logger[_0x7449('0x10')]('[%s][AUTOREPLY][autoreplyExecuted]\x20%s',_0x140b14,JSON[_0x7449('0x35')](_0x3e9633));})[_0x7449('0x36')](function(_0x1ae5eb){logger['error']('[RPC][%s][AUTOREPLY][autoreplyExecuted]\x20%s',_0x140b14,JSON['stringify'](_0x1ae5eb));});})[_0x7449('0x33')](function(){_0x10cd59[_0x7449('0x3d')]();});});}else{return rpc[this['channel']+_0x7449('0x28')][_0x7449('0x3e')](_0x533129)[_0x7449('0x33')](function(){logger[_0x7449('0x10')](_0x7449('0x11'),_0x140b14,_0x533129['body']);})[_0x7449('0x36')](function(_0x5e91a7){logger['error']('[%s][AUTOREPLY]\x20%s',_0x140b14,JSON[_0x7449('0x35')](_0x5e91a7));})['finally'](function(){Promise[_0x7449('0x3a')]()[_0x7449('0x33')](function(){if(_0x59a3a6[0x0]!=='2'||_0x4a9270[_0x7449('0x17')])return;return rpc[_0x26806a+'Interaction'][_0x7449('0x3c')](_0x4a9270['id'],{'autoreplyExecuted':!![]})[_0x7449('0x33')](function(_0x54d480){logger[_0x7449('0x10')]('[%s][AUTOREPLY][autoreplyExecuted]\x20%s',_0x140b14,JSON['stringify'](_0x54d480));})[_0x7449('0x36')](function(_0x2ef9d0){logger['error'](_0x7449('0x3f'),_0x140b14,JSON[_0x7449('0x35')](_0x2ef9d0));});})[_0x7449('0x33')](function(){_0x10cd59[_0x7449('0x3d')]();});});}}}catch(_0x565a6b){logger[_0x7449('0x37')](_0x7449('0x11'),_0x140b14,JSON[_0x7449('0x35')](_0x565a6b));_0x10cd59[_0x7449('0x40')]();}};}; \ No newline at end of file +var _0x35dc=['Re:\x20','chat','ChatWebsiteId','account','upperFirst','AccountId','Message','inReplyTo','messageId','','replace','';_0x174cca[_0xc35d('0x34')]={'Auto-Submitted':'auto-replied','X-Auto-Response-Suppress':_0xc35d('0x35'),'Precedence':_0xc35d('0x36')};return mailRpc[_0xc35d('0x37')](this[_0xc35d('0x2a')][_0xc35d('0x38')],_0x174cca)['then'](function(_0x10c28f){logger[_0xc35d('0x11')](_0xc35d('0x39'),_0x7e55e1);_0x174cca[_0xc35d('0x2f')]=_0x10c28f[_0xc35d('0x20')][_0xc35d('0x2f')];return rpc[_0x37138e+_0xc35d('0x2d')]['create'](_0x174cca);})[_0xc35d('0x3a')](function(_0x38590f){logger[_0xc35d('0x11')]('[%s][AUTOREPLY]\x20%s',_0x7e55e1,JSON[_0xc35d('0x3b')](_0x38590f));})[_0xc35d('0x3c')](function(_0x4c2b7a){logger[_0xc35d('0x3d')](_0xc35d('0x3e'),_0x7e55e1,JSON[_0xc35d('0x3b')](_0x4c2b7a));})[_0xc35d('0x3f')](function(){Promise['resolve']()[_0xc35d('0x3a')](function(){if(_0x3a56b2[0x0]!=='2'||_0x367803[_0xc35d('0x16')])return;return rpc[_0x37138e+'Interaction'][_0xc35d('0x40')](_0x367803['id'],{'autoreplyExecuted':!![]})[_0xc35d('0x3a')](function(_0x28dae1){logger[_0xc35d('0x11')]('[%s][AUTOREPLY][autoreplyExecuted]\x20%s',_0x7e55e1,JSON[_0xc35d('0x3b')](_0x28dae1));})['catch'](function(_0x3f15f9){logger[_0xc35d('0x3d')](_0xc35d('0x41'),_0x7e55e1,JSON[_0xc35d('0x3b')](_0x3f15f9));});})[_0xc35d('0x3a')](function(){_0x54b5dd[_0xc35d('0x19')]();});});}else{return rpc[this['channel']+_0xc35d('0x2d')][_0xc35d('0x42')](_0x174cca)[_0xc35d('0x3a')](function(){logger[_0xc35d('0x11')](_0xc35d('0x12'),_0x7e55e1,_0x174cca[_0xc35d('0xf')]);})[_0xc35d('0x3c')](function(_0x5551b5){logger[_0xc35d('0x3d')]('[%s][AUTOREPLY]\x20%s',_0x7e55e1,JSON[_0xc35d('0x3b')](_0x5551b5));})[_0xc35d('0x3f')](function(){Promise['resolve']()[_0xc35d('0x3a')](function(){if(_0x3a56b2[0x0]!=='2'||_0x367803[_0xc35d('0x16')])return;return rpc[_0x37138e+_0xc35d('0x43')]['update'](_0x367803['id'],{'autoreplyExecuted':!![]})[_0xc35d('0x3a')](function(_0xd7fcc1){logger[_0xc35d('0x11')]('[%s][AUTOREPLY][autoreplyExecuted]\x20%s',_0x7e55e1,JSON[_0xc35d('0x3b')](_0xd7fcc1));})[_0xc35d('0x3c')](function(_0x1d0312){logger[_0xc35d('0x3d')](_0xc35d('0x41'),_0x7e55e1,JSON['stringify'](_0x1d0312));});})[_0xc35d('0x3a')](function(){_0x54b5dd[_0xc35d('0x19')]();});});}}}catch(_0x437205){logger[_0xc35d('0x3d')]('[%s][AUTOREPLY]\x20%s',_0x7e55e1,JSON[_0xc35d('0x3b')](_0x437205));_0x54b5dd[_0xc35d('0x44')]();}};}; \ No newline at end of file diff --git a/server/services/routing/server/applications/close.js b/server/services/routing/server/applications/close.js index 64e61b6..7a9d4c5 100644 --- a/server/services/routing/server/applications/close.js +++ b/server/services/routing/server/applications/close.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x2c03=['YYYY-MM-DD\x20HH:mm:ss','system','channel','Interaction','interaction','then','[%s][CLOSE]\x20interaction\x20%s\x20has\x20been\x20closed!','error','stringify','stop','[%s][CLOSE]\x20%s','../../../../config/logger','routing','../../rpc/openchannelInteraction','../../rpc/smsInteraction','../../rpc/mailInteraction','../../rpc/faxInteraction','../../rpc/whatsappInteraction','consequence','info','[%s][CLOSE]\x20reason\x20%s','format'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0x2c03,0x1ef));var _0x32c0=function(_0x38e870,_0x3d2e6a){_0x38e870=_0x38e870-0x0;var _0x2dabbe=_0x2c03[_0x38e870];return _0x2dabbe;};'use strict';var moment=require('moment');var logger=require(_0x32c0('0x0'))(_0x32c0('0x1'));var rpc={'chatInteraction':require('../../rpc/chatInteraction'),'openchannelInteraction':require(_0x32c0('0x2')),'smsInteraction':require(_0x32c0('0x3')),'mailInteraction':require(_0x32c0('0x4')),'faxInteraction':require(_0x32c0('0x5')),'whatsappInteraction':require(_0x32c0('0x6'))};exports[_0x32c0('0x7')]=function(_0x3e0863,_0x4729a6,_0x461b59,_0xf3bedf){return function(_0x49cb51){try{logger[_0x32c0('0x8')](_0x32c0('0x9'),_0x3e0863,_0x4729a6[0x0]);var _0x366629={'closed':0x1,'closedAt':moment()[_0x32c0('0xa')](_0x32c0('0xb')),'closeReason':_0x32c0('0xc'),'disposition':_0x4729a6[0x0]};if(rpc[_0xf3bedf[_0x32c0('0xd')]+_0x32c0('0xe')]){rpc[_0xf3bedf[_0x32c0('0xd')]+_0x32c0('0xe')]['update'](_0xf3bedf[_0x32c0('0xf')]['id'],_0x366629)[_0x32c0('0x10')](function(_0xb8065e){logger[_0x32c0('0x8')](_0x32c0('0x11'),_0x3e0863,_0xf3bedf['interaction']['id']);})['catch'](function(_0x47bc0d){logger[_0x32c0('0x12')]('[%s][CLOSE]\x20%s',_0x3e0863,JSON[_0x32c0('0x13')](_0x47bc0d));})['finally'](function(){_0x49cb51[_0x32c0('0x14')]();});}}catch(_0x3458d5){logger['error'](_0x32c0('0x15'),_0x3e0863,JSON[_0x32c0('0x13')](_0x3458d5));_0x49cb51[_0x32c0('0x14')]();}};}; \ No newline at end of file +var _0xf1c9=['info','format','YYYY-MM-DD\x20HH:mm:ss','system','channel','Interaction','update','interaction','then','[%s][CLOSE]\x20interaction\x20%s\x20has\x20been\x20closed!','catch','error','[%s][CLOSE]\x20%s','stringify','stop','moment','routing','../../rpc/chatInteraction','../../rpc/openchannelInteraction','../../rpc/smsInteraction','../../rpc/mailInteraction','../../rpc/whatsappInteraction'];(function(_0x528511,_0x815fd3){var _0xd1b2b7=function(_0x3bf131){while(--_0x3bf131){_0x528511['push'](_0x528511['shift']());}};_0xd1b2b7(++_0x815fd3);}(_0xf1c9,0x12d));var _0x9f1c=function(_0x76dd90,_0x2b87d8){_0x76dd90=_0x76dd90-0x0;var _0x19533c=_0xf1c9[_0x76dd90];return _0x19533c;};'use strict';var moment=require(_0x9f1c('0x0'));var logger=require('../../../../config/logger')(_0x9f1c('0x1'));var rpc={'chatInteraction':require(_0x9f1c('0x2')),'openchannelInteraction':require(_0x9f1c('0x3')),'smsInteraction':require(_0x9f1c('0x4')),'mailInteraction':require(_0x9f1c('0x5')),'faxInteraction':require('../../rpc/faxInteraction'),'whatsappInteraction':require(_0x9f1c('0x6'))};exports['consequence']=function(_0x1866ce,_0x4536da,_0x250e65,_0x116b13){return function(_0x4f29ff){try{logger[_0x9f1c('0x7')]('[%s][CLOSE]\x20reason\x20%s',_0x1866ce,_0x4536da[0x0]);var _0x5edc49={'closed':0x1,'closedAt':moment()[_0x9f1c('0x8')](_0x9f1c('0x9')),'closeReason':_0x9f1c('0xa'),'disposition':_0x4536da[0x0]};if(rpc[_0x116b13['channel']+'Interaction']){rpc[_0x116b13[_0x9f1c('0xb')]+_0x9f1c('0xc')][_0x9f1c('0xd')](_0x116b13[_0x9f1c('0xe')]['id'],_0x5edc49)[_0x9f1c('0xf')](function(_0x2d959a){logger['info'](_0x9f1c('0x10'),_0x1866ce,_0x116b13[_0x9f1c('0xe')]['id']);})[_0x9f1c('0x11')](function(_0x454d49){logger[_0x9f1c('0x12')](_0x9f1c('0x13'),_0x1866ce,JSON[_0x9f1c('0x14')](_0x454d49));})['finally'](function(){_0x4f29ff[_0x9f1c('0x15')]();});}}catch(_0x20a383){logger['error'](_0x9f1c('0x13'),_0x1866ce,JSON[_0x9f1c('0x14')](_0x20a383));_0x4f29ff['stop']();}};}; \ No newline at end of file diff --git a/server/services/routing/server/applications/dialogflow.js b/server/services/routing/server/applications/dialogflow.js index b973e09..ac8a88b 100644 --- a/server/services/routing/server/applications/dialogflow.js +++ b/server/services/routing/server/applications/dialogflow.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x277c=['message','then','result','fulfillment','speech','providerName','dialogflow','providerResponse','stringify','create','lodash','apiai-promise','md5','./utils','../../../../config/logger','routing','../../rpc/chatMessage','../../rpc/openchannelMessage','../../rpc/mailMessage','../../rpc/whatsappMessage','isNil','UserId','info','[%s][DIALOGFLOW]\x20%s','Agent\x20is\x20managing\x20the\x20interaction.\x20Go\x20to\x20next\x20application.','next','YYYY-MM-DD\x20HH:mm:ss','out','channel','sms','whatsapp','interaction','phone','ChatWebsiteId','account','upperFirst','created','isEmpty','Message','body','catch','error','finally','[%s][DIALOGFLOW]\x20Welcome\x20Message\x20has\x20been\x20sent!','stop','[%s][DIALOGFLOW]\x20Welcome\x20Message\x20is\x20empty.\x20It\x20will\x20wait\x20for\x20a\x20message\x20from\x20customer!','textRequest'];(function(_0x21a9d9,_0x4d5ac8){var _0x46adce=function(_0xfdd336){while(--_0xfdd336){_0x21a9d9['push'](_0x21a9d9['shift']());}};_0x46adce(++_0x4d5ac8);}(_0x277c,0x153));var _0xc277=function(_0x45d18a,_0x42da1f){_0x45d18a=_0x45d18a-0x0;var _0x3b9f65=_0x277c[_0x45d18a];return _0x3b9f65;};'use strict';var _=require(_0xc277('0x0'));var moment=require('moment');var apiai=require(_0xc277('0x1'));var md5=require(_0xc277('0x2'));var utils=require(_0xc277('0x3'));var logger=require(_0xc277('0x4'))(_0xc277('0x5'));var rpc={'chatMessage':require(_0xc277('0x6')),'openchannelMessage':require(_0xc277('0x7')),'mailMessage':require(_0xc277('0x8')),'smsMessage':require('../../rpc/smsMessage'),'faxMessage':require('../../rpc/faxMessage'),'whatsappMessage':require(_0xc277('0x9'))};exports['consequence']=function(_0x77e168,_0x54d634){return function(_0x378158){try{if(!_[_0xc277('0xa')](this['interaction'][_0xc277('0xb')])){logger[_0xc277('0xc')](_0xc277('0xd'),_0x77e168,_0xc277('0xe'));return _0x378158[_0xc277('0xf')]();}var _0x1e4087={'ContactId':this['contact']['id'],'sentAt':moment()['format'](_0xc277('0x10')),'direction':_0xc277('0x11')};if(this[_0xc277('0x12')]===_0xc277('0x13')||this['channel']===_0xc277('0x14')){_0x1e4087['phone']=this[_0xc277('0x15')][_0xc277('0x16')];}var _0x1850eb=this[_0xc277('0x12')];if(_0x1850eb==='chat'){_0x1e4087[_0xc277('0x17')]=this[_0xc277('0x18')]['id'];}else{_0x1e4087[_[_0xc277('0x19')](_0x1850eb)+'AccountId']=this['account']['id'];}_0x1e4087[_[_0xc277('0x19')](_0x1850eb)+'InteractionId']=this[_0xc277('0x15')]['id'];if(this['interaction'][_0xc277('0x1a')]){var _0x1162b9=_0x54d634[0x2];if(!_[_0xc277('0x1b')](_0x1162b9)){_0x1e4087['body']=utils['getMustacheRender'](_0x1162b9,this);return rpc[_0x1850eb+_0xc277('0x1c')]['create'](_0x1e4087)['then'](function(_0x1e1a9b){logger[_0xc277('0xc')](_0xc277('0xd'),_0x77e168,_0x1e4087[_0xc277('0x1d')]);})[_0xc277('0x1e')](function(_0x355eee){logger[_0xc277('0x1f')]('[%s][DIALOGFLOW]\x20%s',_0x77e168,JSON['stringify'](_0x355eee));})[_0xc277('0x20')](function(){logger[_0xc277('0xc')](_0xc277('0x21'),_0x77e168);_0x378158[_0xc277('0x22')]();});}else{logger[_0xc277('0xc')](_0xc277('0x23'),_0x77e168);_0x378158[_0xc277('0x22')]();}}else{var _0x42cb0b=this;var _0x1bc888=apiai(_0x54d634[0x0],{'language':_0x54d634[0x1]||'en'});return _0x1bc888[_0xc277('0x24')](this[_0xc277('0x25')]['body'],{'sessionId':md5(this[_0xc277('0x15')]['id'])})[_0xc277('0x26')](function(_0x54b2e1){_0x42cb0b[_0xc277('0x1d')]['dialogflow']=_0x54b2e1;_0x1e4087['body']=_0x54b2e1[_0xc277('0x27')][_0xc277('0x28')][_0xc277('0x29')];_0x1e4087[_0xc277('0x2a')]=_0xc277('0x2b');_0x1e4087[_0xc277('0x2c')]=JSON[_0xc277('0x2d')](_0x54b2e1);return rpc[_0x1850eb+_0xc277('0x1c')][_0xc277('0x2e')](_0x1e4087)[_0xc277('0x26')](function(_0x40d17a){logger['info']('[%s][DIALOGFLOW]\x20%s',_0x77e168,_0x1e4087[_0xc277('0x1d')]);if(_0x54b2e1[_0xc277('0x27')]['metadata']['endConversation']){_0x378158[_0xc277('0xf')]();}else{_0x378158[_0xc277('0x22')]();}})[_0xc277('0x1e')](function(_0x21c78c){logger[_0xc277('0x1f')]('[%s][DIALOGFLOW]\x20%s',_0x77e168,JSON[_0xc277('0x2d')](_0x21c78c));_0x378158['next']();});})[_0xc277('0x1e')](function(_0x74ff17){logger[_0xc277('0x1f')](_0xc277('0xd'),_0x77e168,_0x74ff17['message']);_0x378158[_0xc277('0xf')]();});}}catch(_0x5a7bb6){logger[_0xc277('0x1f')](_0xc277('0xd'),_0x77e168,JSON[_0xc277('0x2d')](_0x5a7bb6));_0x378158[_0xc277('0x22')]();}};}; \ No newline at end of file +var _0x277c=['message','then','result','fulfillment','speech','providerName','dialogflow','providerResponse','stringify','create','lodash','apiai-promise','md5','./utils','../../../../config/logger','routing','../../rpc/chatMessage','../../rpc/openchannelMessage','../../rpc/mailMessage','../../rpc/whatsappMessage','isNil','UserId','info','[%s][DIALOGFLOW]\x20%s','Agent\x20is\x20managing\x20the\x20interaction.\x20Go\x20to\x20next\x20application.','next','YYYY-MM-DD\x20HH:mm:ss','out','channel','sms','whatsapp','interaction','phone','ChatWebsiteId','account','upperFirst','created','isEmpty','Message','body','catch','error','finally','[%s][DIALOGFLOW]\x20Welcome\x20Message\x20has\x20been\x20sent!','stop','[%s][DIALOGFLOW]\x20Welcome\x20Message\x20is\x20empty.\x20It\x20will\x20wait\x20for\x20a\x20message\x20from\x20customer!','textRequest'];(function(_0x17d9e3,_0x1f969c){var _0x14192d=function(_0x159745){while(--_0x159745){_0x17d9e3['push'](_0x17d9e3['shift']());}};_0x14192d(++_0x1f969c);}(_0x277c,0x153));var _0xc277=function(_0x400247,_0x3bbb68){_0x400247=_0x400247-0x0;var _0x3ac5b9=_0x277c[_0x400247];return _0x3ac5b9;};'use strict';var _=require(_0xc277('0x0'));var moment=require('moment');var apiai=require(_0xc277('0x1'));var md5=require(_0xc277('0x2'));var utils=require(_0xc277('0x3'));var logger=require(_0xc277('0x4'))(_0xc277('0x5'));var rpc={'chatMessage':require(_0xc277('0x6')),'openchannelMessage':require(_0xc277('0x7')),'mailMessage':require(_0xc277('0x8')),'smsMessage':require('../../rpc/smsMessage'),'faxMessage':require('../../rpc/faxMessage'),'whatsappMessage':require(_0xc277('0x9'))};exports['consequence']=function(_0x77e168,_0x54d634){return function(_0x378158){try{if(!_[_0xc277('0xa')](this['interaction'][_0xc277('0xb')])){logger[_0xc277('0xc')](_0xc277('0xd'),_0x77e168,_0xc277('0xe'));return _0x378158[_0xc277('0xf')]();}var _0x1e4087={'ContactId':this['contact']['id'],'sentAt':moment()['format'](_0xc277('0x10')),'direction':_0xc277('0x11')};if(this[_0xc277('0x12')]===_0xc277('0x13')||this['channel']===_0xc277('0x14')){_0x1e4087['phone']=this[_0xc277('0x15')][_0xc277('0x16')];}var _0x1850eb=this[_0xc277('0x12')];if(_0x1850eb==='chat'){_0x1e4087[_0xc277('0x17')]=this[_0xc277('0x18')]['id'];}else{_0x1e4087[_[_0xc277('0x19')](_0x1850eb)+'AccountId']=this['account']['id'];}_0x1e4087[_[_0xc277('0x19')](_0x1850eb)+'InteractionId']=this[_0xc277('0x15')]['id'];if(this['interaction'][_0xc277('0x1a')]){var _0x1162b9=_0x54d634[0x2];if(!_[_0xc277('0x1b')](_0x1162b9)){_0x1e4087['body']=utils['getMustacheRender'](_0x1162b9,this);return rpc[_0x1850eb+_0xc277('0x1c')]['create'](_0x1e4087)['then'](function(_0x1e1a9b){logger[_0xc277('0xc')](_0xc277('0xd'),_0x77e168,_0x1e4087[_0xc277('0x1d')]);})[_0xc277('0x1e')](function(_0x355eee){logger[_0xc277('0x1f')]('[%s][DIALOGFLOW]\x20%s',_0x77e168,JSON['stringify'](_0x355eee));})[_0xc277('0x20')](function(){logger[_0xc277('0xc')](_0xc277('0x21'),_0x77e168);_0x378158[_0xc277('0x22')]();});}else{logger[_0xc277('0xc')](_0xc277('0x23'),_0x77e168);_0x378158[_0xc277('0x22')]();}}else{var _0x42cb0b=this;var _0x1bc888=apiai(_0x54d634[0x0],{'language':_0x54d634[0x1]||'en'});return _0x1bc888[_0xc277('0x24')](this[_0xc277('0x25')]['body'],{'sessionId':md5(this[_0xc277('0x15')]['id'])})[_0xc277('0x26')](function(_0x54b2e1){_0x42cb0b[_0xc277('0x1d')]['dialogflow']=_0x54b2e1;_0x1e4087['body']=_0x54b2e1[_0xc277('0x27')][_0xc277('0x28')][_0xc277('0x29')];_0x1e4087[_0xc277('0x2a')]=_0xc277('0x2b');_0x1e4087[_0xc277('0x2c')]=JSON[_0xc277('0x2d')](_0x54b2e1);return rpc[_0x1850eb+_0xc277('0x1c')][_0xc277('0x2e')](_0x1e4087)[_0xc277('0x26')](function(_0x40d17a){logger['info']('[%s][DIALOGFLOW]\x20%s',_0x77e168,_0x1e4087[_0xc277('0x1d')]);if(_0x54b2e1[_0xc277('0x27')]['metadata']['endConversation']){_0x378158[_0xc277('0xf')]();}else{_0x378158[_0xc277('0x22')]();}})[_0xc277('0x1e')](function(_0x21c78c){logger[_0xc277('0x1f')]('[%s][DIALOGFLOW]\x20%s',_0x77e168,JSON[_0xc277('0x2d')](_0x21c78c));_0x378158['next']();});})[_0xc277('0x1e')](function(_0x74ff17){logger[_0xc277('0x1f')](_0xc277('0xd'),_0x77e168,_0x74ff17['message']);_0x378158[_0xc277('0xf')]();});}}catch(_0x5a7bb6){logger[_0xc277('0x1f')](_0xc277('0xd'),_0x77e168,JSON[_0xc277('0x2d')](_0x5a7bb6));_0x378158[_0xc277('0x22')]();}};}; \ No newline at end of file diff --git a/server/services/routing/server/applications/dialogflowV2.js b/server/services/routing/server/applications/dialogflowV2.js index cc67f4b..7eb6e93 100644 --- a/server/services/routing/server/applications/dialogflowV2.js +++ b/server/services/routing/server/applications/dialogflowV2.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x4a66=['action','DIALOGFLOWV2_ALLREQUIREDPARAMSPRESENT','allRequiredParamsPresent','DIALOGFLOWV2_ENDCONVERSATION','intent','name','DIALOGFLOWV2_INTENTDISPLAYNAME','displayName','DIALOGFLOWV2_ISFALLBACKINTENT','isFallback','DIALOGFLOWV2_LANGUAGECODE','languageCode','DIALOGFLOWV2_QUERYTEXT','queryText','DIALOGFLOWV2_SCORE','providerName','providerResponse','fulfillmentText','all','stack','lodash','md5','bluebird','../../../../config/logger','routing','./utils','../../rpc/chatMessage','../../rpc/openchannelMessage','../../rpc/whatsappMessage','clone','body','Message','create','info','catch','stringify','consequence','isNil','UserId','[%s][DIALOGFLOWV2]\x20%s','Agent\x20is\x20managing\x20the\x20interaction.\x20Go\x20to\x20next\x20application.','next','contact','out','channel','whatsapp','phone','interaction','chat','ChatWebsiteId','AccountId','account','upperFirst','InteractionId','then','error','[%s][DIALOGFLOWV2]\x20Welcome\x20Message\x20has\x20been\x20sent!','stop','sessionPath','message','detectIntent','length','dialogflowV2','queryResult','diagnosticInfo','fields','end_conversation','boolValue','DIALOGFLOWV2_ACTION'];(function(_0x2dc54e,_0x52abe5){var _0x1f41ca=function(_0x3b2c67){while(--_0x3b2c67){_0x2dc54e['push'](_0x2dc54e['shift']());}};_0x1f41ca(++_0x52abe5);}(_0x4a66,0x1b2));var _0x64a6=function(_0x3de873,_0x174b5f){_0x3de873=_0x3de873-0x0;var _0x380b8c=_0x4a66[_0x3de873];return _0x380b8c;};'use strict';var _=require(_0x64a6('0x0'));var dialogflow=require('dialogflow');var md5=require(_0x64a6('0x1'));var moment=require('moment');var Promise=require(_0x64a6('0x2'));var logger=require(_0x64a6('0x3'))(_0x64a6('0x4'));var utils=require(_0x64a6('0x5'));var rpc={'chatMessage':require(_0x64a6('0x6')),'openchannelMessage':require(_0x64a6('0x7')),'mailMessage':require('../../rpc/mailMessage'),'smsMessage':require('../../rpc/smsMessage'),'faxMessage':require('../../rpc/faxMessage'),'whatsappMessage':require(_0x64a6('0x8'))};function createMessage(_0x4e4440,_0x354147,_0x4ca644,_0x5be0af){return new Promise(function(_0x31ef79,_0x4bfe3d){var _0x4af714=_[_0x64a6('0x9')](_0x4ca644);_0x4af714[_0x64a6('0xa')]=_0x5be0af;return rpc[_0x354147+_0x64a6('0xb')][_0x64a6('0xc')](_0x4af714)['then'](function(){logger[_0x64a6('0xd')]('[%s][DIALOGFLOWV2]\x20%s',_0x4e4440,_0x4af714['body']);_0x31ef79();})[_0x64a6('0xe')](function(_0x22b743){logger['error']('[%s][DIALOGFLOWV2]\x20%s',_0x4e4440,JSON[_0x64a6('0xf')](_0x22b743));_0x4bfe3d(_0x22b743);});});}exports[_0x64a6('0x10')]=function(_0x11ac41,_0x531b63){return function(_0x462319){try{if(!_[_0x64a6('0x11')](this['interaction'][_0x64a6('0x12')])){logger[_0x64a6('0xd')](_0x64a6('0x13'),_0x11ac41,_0x64a6('0x14'));return _0x462319[_0x64a6('0x15')]();}var _0x413c2b={'ContactId':this[_0x64a6('0x16')]['id'],'sentAt':moment()['format']('YYYY-MM-DD\x20HH:mm:ss'),'direction':_0x64a6('0x17')};if(this['channel']==='sms'||this[_0x64a6('0x18')]===_0x64a6('0x19')){_0x413c2b[_0x64a6('0x1a')]=this[_0x64a6('0x1b')][_0x64a6('0x1a')];}var _0x280b81=this[_0x64a6('0x18')];if(_0x280b81===_0x64a6('0x1c')){_0x413c2b[_0x64a6('0x1d')]=this['account']['id'];}else{_0x413c2b[_['upperFirst'](_0x280b81)+_0x64a6('0x1e')]=this[_0x64a6('0x1f')]['id'];}_0x413c2b[_[_0x64a6('0x20')](_0x280b81)+_0x64a6('0x21')]=this[_0x64a6('0x1b')]['id'];if(this[_0x64a6('0x1b')]['created']){var _0x216314=_0x531b63[0x4];if(!_['isEmpty'](_0x216314)){_0x413c2b[_0x64a6('0xa')]=utils['getMustacheRender'](_0x216314,this);return rpc[_0x280b81+_0x64a6('0xb')]['create'](_0x413c2b)[_0x64a6('0x22')](function(_0x50bbb0){logger[_0x64a6('0xd')](_0x64a6('0x13'),_0x11ac41,_0x413c2b[_0x64a6('0xa')]);})[_0x64a6('0xe')](function(_0x16723b){logger[_0x64a6('0x23')]('[%s][DIALOGFLOWV2]\x20%s',_0x11ac41,JSON[_0x64a6('0xf')](_0x16723b));})['finally'](function(){logger[_0x64a6('0xd')](_0x64a6('0x24'),_0x11ac41);_0x462319[_0x64a6('0x25')]();});}else{logger[_0x64a6('0xd')]('[%s][DIALOGFLOWV2]\x20Welcome\x20Message\x20is\x20empty.\x20It\x20will\x20wait\x20for\x20a\x20message\x20from\x20customer!',_0x11ac41);_0x462319[_0x64a6('0x25')]();}}else{var _0x29ed96=this;var _0x309b44=_0x531b63[0x2]['replace'](/\\n/g,'\x0a');var _0x707ba5={'credentials':{'private_key':_0x309b44,'client_email':_0x531b63[0x1]}};var _0x1b9997=new dialogflow['SessionsClient'](_0x707ba5);var _0x3cb348=_0x1b9997[_0x64a6('0x26')](_0x531b63[0x0],md5(_0x29ed96[_0x64a6('0x1b')]['id']));var _0x552a50={'session':_0x3cb348,'queryInput':{'text':{'text':_0x29ed96[_0x64a6('0x27')]['body'],'languageCode':_0x531b63[0x3]||'en'}}};return _0x1b9997[_0x64a6('0x28')](_0x552a50)[_0x64a6('0x22')](function(_0x51af27){if(_0x51af27&&_0x51af27[_0x64a6('0x29')]){_0x29ed96[_0x64a6('0xa')][_0x64a6('0x2a')]=_0x51af27;var _0x3a3393=_0x51af27[0x0];var _0x186e10=_0x3a3393[_0x64a6('0x2b')][_0x64a6('0x2c')]&&_0x3a3393[_0x64a6('0x2b')]['diagnosticInfo'][_0x64a6('0x2d')]?_0x3a3393[_0x64a6('0x2b')]['diagnosticInfo'][_0x64a6('0x2d')][_0x64a6('0x2e')][_0x64a6('0x2f')]:![];_0x29ed96['body'][_0x64a6('0x30')]=_0x3a3393['queryResult'][_0x64a6('0x31')];_0x29ed96[_0x64a6('0xa')][_0x64a6('0x32')]=_0x3a3393[_0x64a6('0x2b')][_0x64a6('0x33')];_0x29ed96[_0x64a6('0xa')][_0x64a6('0x34')]=_0x3a3393['queryResult'][_0x64a6('0x2c')]&&_0x3a3393['queryResult'][_0x64a6('0x2c')]['fields']?_0x3a3393[_0x64a6('0x2b')]['diagnosticInfo'][_0x64a6('0x2d')][_0x64a6('0x2e')][_0x64a6('0x2f')]:![];_0x29ed96[_0x64a6('0xa')]['DIALOGFLOWV2_INTENTNAME']=_0x3a3393[_0x64a6('0x2b')][_0x64a6('0x35')][_0x64a6('0x36')];_0x29ed96[_0x64a6('0xa')][_0x64a6('0x37')]=_0x3a3393[_0x64a6('0x2b')]['intent'][_0x64a6('0x38')];_0x29ed96[_0x64a6('0xa')][_0x64a6('0x39')]=_0x3a3393['queryResult'][_0x64a6('0x35')][_0x64a6('0x3a')];_0x29ed96[_0x64a6('0xa')][_0x64a6('0x3b')]=_0x3a3393[_0x64a6('0x2b')][_0x64a6('0x3c')];_0x29ed96[_0x64a6('0xa')][_0x64a6('0x3d')]=_0x3a3393[_0x64a6('0x2b')][_0x64a6('0x3e')];_0x29ed96[_0x64a6('0xa')][_0x64a6('0x3f')]=_0x3a3393[_0x64a6('0x2b')]['intentDetectionConfidence'];_0x413c2b[_0x64a6('0x40')]=_0x64a6('0x2a');_0x413c2b[_0x64a6('0x41')]=JSON[_0x64a6('0xf')](_0x51af27);var _0x463217=[];for(var _0x53c728=0x0;_0x53c728<_0x51af27['length'];_0x53c728++){var _0x103d72=_0x51af27[_0x53c728];if(_0x103d72&&_0x103d72[_0x64a6('0x2b')]&&_0x103d72['queryResult'][_0x64a6('0x42')]){_0x463217['push'](createMessage(_0x11ac41,_0x280b81,_0x413c2b,_0x103d72[_0x64a6('0x2b')][_0x64a6('0x42')]));}}return Promise[_0x64a6('0x43')](_0x463217)[_0x64a6('0x22')](function(){if(_0x186e10){_0x462319[_0x64a6('0x15')]();}else{_0x462319[_0x64a6('0x25')]();}})[_0x64a6('0xe')](function(_0x1169bf){logger[_0x64a6('0x23')](_0x64a6('0x13'),_0x11ac41,JSON[_0x64a6('0xf')](_0x1169bf));_0x462319[_0x64a6('0x15')]();});}})[_0x64a6('0xe')](function(_0x1c0f28){logger[_0x64a6('0x23')](_0x64a6('0x13'),_0x11ac41,_0x1c0f28[_0x64a6('0x27')],_0x1c0f28[_0x64a6('0x44')]);_0x462319[_0x64a6('0x15')]();});}}catch(_0x4673b8){logger['error'](_0x64a6('0x13'),_0x11ac41,JSON['stringify'](_0x4673b8));_0x462319[_0x64a6('0x25')]();}};}; \ No newline at end of file +var _0x9cd9=['dialogflow','bluebird','routing','./utils','../../rpc/chatMessage','../../rpc/mailMessage','clone','create','then','info','catch','stringify','isNil','interaction','UserId','[%s][DIALOGFLOWV2]\x20%s','Agent\x20is\x20managing\x20the\x20interaction.\x20Go\x20to\x20next\x20application.','next','format','YYYY-MM-DD\x20HH:mm:ss','channel','sms','whatsapp','phone','chat','ChatWebsiteId','account','upperFirst','AccountId','InteractionId','created','isEmpty','body','error','finally','[%s][DIALOGFLOWV2]\x20Welcome\x20Message\x20has\x20been\x20sent!','stop','[%s][DIALOGFLOWV2]\x20Welcome\x20Message\x20is\x20empty.\x20It\x20will\x20wait\x20for\x20a\x20message\x20from\x20customer!','replace','SessionsClient','sessionPath','message','detectIntent','length','queryResult','diagnosticInfo','fields','end_conversation','action','DIALOGFLOWV2_ALLREQUIREDPARAMSPRESENT','allRequiredParamsPresent','DIALOGFLOWV2_ENDCONVERSATION','boolValue','DIALOGFLOWV2_INTENTNAME','name','displayName','DIALOGFLOWV2_ISFALLBACKINTENT','intent','isFallback','languageCode','DIALOGFLOWV2_QUERYTEXT','queryText','DIALOGFLOWV2_SCORE','intentDetectionConfidence','providerName','dialogflowV2','providerResponse','push','all','stack','lodash'];(function(_0x562b9d,_0x224ff7){var _0x23e905=function(_0x507a20){while(--_0x507a20){_0x562b9d['push'](_0x562b9d['shift']());}};_0x23e905(++_0x224ff7);}(_0x9cd9,0x1f0));var _0x99cd=function(_0x8d3a56,_0x1b26ec){_0x8d3a56=_0x8d3a56-0x0;var _0x1ddace=_0x9cd9[_0x8d3a56];return _0x1ddace;};'use strict';var _=require(_0x99cd('0x0'));var dialogflow=require(_0x99cd('0x1'));var md5=require('md5');var moment=require('moment');var Promise=require(_0x99cd('0x2'));var logger=require('../../../../config/logger')(_0x99cd('0x3'));var utils=require(_0x99cd('0x4'));var rpc={'chatMessage':require(_0x99cd('0x5')),'openchannelMessage':require('../../rpc/openchannelMessage'),'mailMessage':require(_0x99cd('0x6')),'smsMessage':require('../../rpc/smsMessage'),'faxMessage':require('../../rpc/faxMessage'),'whatsappMessage':require('../../rpc/whatsappMessage')};function createMessage(_0x111f15,_0x49d2c4,_0x330c28,_0x26a6f7){return new Promise(function(_0xcad4ed,_0x11733f){var _0x1e1429=_[_0x99cd('0x7')](_0x330c28);_0x1e1429['body']=_0x26a6f7;return rpc[_0x49d2c4+'Message'][_0x99cd('0x8')](_0x1e1429)[_0x99cd('0x9')](function(){logger[_0x99cd('0xa')]('[%s][DIALOGFLOWV2]\x20%s',_0x111f15,_0x1e1429['body']);_0xcad4ed();})[_0x99cd('0xb')](function(_0xcfe2e1){logger['error']('[%s][DIALOGFLOWV2]\x20%s',_0x111f15,JSON[_0x99cd('0xc')](_0xcfe2e1));_0x11733f(_0xcfe2e1);});});}exports['consequence']=function(_0x2f8d6b,_0x4bd8b7){return function(_0x3d3eb){try{if(!_[_0x99cd('0xd')](this[_0x99cd('0xe')][_0x99cd('0xf')])){logger[_0x99cd('0xa')](_0x99cd('0x10'),_0x2f8d6b,_0x99cd('0x11'));return _0x3d3eb[_0x99cd('0x12')]();}var _0x1b695f={'ContactId':this['contact']['id'],'sentAt':moment()[_0x99cd('0x13')](_0x99cd('0x14')),'direction':'out'};if(this[_0x99cd('0x15')]===_0x99cd('0x16')||this[_0x99cd('0x15')]===_0x99cd('0x17')){_0x1b695f[_0x99cd('0x18')]=this[_0x99cd('0xe')][_0x99cd('0x18')];}var _0x4e2609=this[_0x99cd('0x15')];if(_0x4e2609===_0x99cd('0x19')){_0x1b695f[_0x99cd('0x1a')]=this[_0x99cd('0x1b')]['id'];}else{_0x1b695f[_[_0x99cd('0x1c')](_0x4e2609)+_0x99cd('0x1d')]=this[_0x99cd('0x1b')]['id'];}_0x1b695f[_[_0x99cd('0x1c')](_0x4e2609)+_0x99cd('0x1e')]=this[_0x99cd('0xe')]['id'];if(this[_0x99cd('0xe')][_0x99cd('0x1f')]){var _0x496c7a=_0x4bd8b7[0x4];if(!_[_0x99cd('0x20')](_0x496c7a)){_0x1b695f[_0x99cd('0x21')]=utils['getMustacheRender'](_0x496c7a,this);return rpc[_0x4e2609+'Message'][_0x99cd('0x8')](_0x1b695f)[_0x99cd('0x9')](function(_0x48eeba){logger[_0x99cd('0xa')](_0x99cd('0x10'),_0x2f8d6b,_0x1b695f['body']);})['catch'](function(_0x3ed88b){logger[_0x99cd('0x22')]('[%s][DIALOGFLOWV2]\x20%s',_0x2f8d6b,JSON[_0x99cd('0xc')](_0x3ed88b));})[_0x99cd('0x23')](function(){logger[_0x99cd('0xa')](_0x99cd('0x24'),_0x2f8d6b);_0x3d3eb[_0x99cd('0x25')]();});}else{logger['info'](_0x99cd('0x26'),_0x2f8d6b);_0x3d3eb[_0x99cd('0x25')]();}}else{var _0x548a9d=this;var _0x410c89=_0x4bd8b7[0x2][_0x99cd('0x27')](/\\n/g,'\x0a');var _0x20c54d={'credentials':{'private_key':_0x410c89,'client_email':_0x4bd8b7[0x1]}};var _0x16e5b2=new dialogflow[(_0x99cd('0x28'))](_0x20c54d);var _0x28e812=_0x16e5b2[_0x99cd('0x29')](_0x4bd8b7[0x0],md5(_0x548a9d[_0x99cd('0xe')]['id']));var _0x36ab4d={'session':_0x28e812,'queryInput':{'text':{'text':_0x548a9d[_0x99cd('0x2a')][_0x99cd('0x21')],'languageCode':_0x4bd8b7[0x3]||'en'}}};return _0x16e5b2[_0x99cd('0x2b')](_0x36ab4d)[_0x99cd('0x9')](function(_0x464a86){if(_0x464a86&&_0x464a86[_0x99cd('0x2c')]){_0x548a9d[_0x99cd('0x21')]['dialogflowV2']=_0x464a86;var _0x179b46=_0x464a86[0x0];var _0x2b97ca=_0x179b46[_0x99cd('0x2d')][_0x99cd('0x2e')]&&_0x179b46[_0x99cd('0x2d')][_0x99cd('0x2e')]['fields']?_0x179b46['queryResult'][_0x99cd('0x2e')][_0x99cd('0x2f')][_0x99cd('0x30')]['boolValue']:![];_0x548a9d['body']['DIALOGFLOWV2_ACTION']=_0x179b46['queryResult'][_0x99cd('0x31')];_0x548a9d[_0x99cd('0x21')][_0x99cd('0x32')]=_0x179b46[_0x99cd('0x2d')][_0x99cd('0x33')];_0x548a9d[_0x99cd('0x21')][_0x99cd('0x34')]=_0x179b46['queryResult'][_0x99cd('0x2e')]&&_0x179b46[_0x99cd('0x2d')][_0x99cd('0x2e')][_0x99cd('0x2f')]?_0x179b46[_0x99cd('0x2d')][_0x99cd('0x2e')][_0x99cd('0x2f')][_0x99cd('0x30')][_0x99cd('0x35')]:![];_0x548a9d[_0x99cd('0x21')][_0x99cd('0x36')]=_0x179b46[_0x99cd('0x2d')]['intent'][_0x99cd('0x37')];_0x548a9d['body']['DIALOGFLOWV2_INTENTDISPLAYNAME']=_0x179b46[_0x99cd('0x2d')]['intent'][_0x99cd('0x38')];_0x548a9d['body'][_0x99cd('0x39')]=_0x179b46[_0x99cd('0x2d')][_0x99cd('0x3a')][_0x99cd('0x3b')];_0x548a9d[_0x99cd('0x21')]['DIALOGFLOWV2_LANGUAGECODE']=_0x179b46[_0x99cd('0x2d')][_0x99cd('0x3c')];_0x548a9d[_0x99cd('0x21')][_0x99cd('0x3d')]=_0x179b46[_0x99cd('0x2d')][_0x99cd('0x3e')];_0x548a9d[_0x99cd('0x21')][_0x99cd('0x3f')]=_0x179b46[_0x99cd('0x2d')][_0x99cd('0x40')];_0x1b695f[_0x99cd('0x41')]=_0x99cd('0x42');_0x1b695f[_0x99cd('0x43')]=JSON[_0x99cd('0xc')](_0x464a86);var _0x1c72ee=[];for(var _0xe4b01f=0x0;_0xe4b01f<_0x464a86[_0x99cd('0x2c')];_0xe4b01f++){var _0x54d535=_0x464a86[_0xe4b01f];if(_0x54d535&&_0x54d535[_0x99cd('0x2d')]&&_0x54d535[_0x99cd('0x2d')]['fulfillmentText']){_0x1c72ee[_0x99cd('0x44')](createMessage(_0x2f8d6b,_0x4e2609,_0x1b695f,_0x54d535[_0x99cd('0x2d')]['fulfillmentText']));}}return Promise[_0x99cd('0x45')](_0x1c72ee)['then'](function(){if(_0x2b97ca){_0x3d3eb[_0x99cd('0x12')]();}else{_0x3d3eb[_0x99cd('0x25')]();}})[_0x99cd('0xb')](function(_0x4ed13d){logger['error'](_0x99cd('0x10'),_0x2f8d6b,JSON['stringify'](_0x4ed13d));_0x3d3eb[_0x99cd('0x12')]();});}})[_0x99cd('0xb')](function(_0x5bef0e){logger[_0x99cd('0x22')]('[%s][DIALOGFLOWV2]\x20%s',_0x2f8d6b,_0x5bef0e['message'],_0x5bef0e[_0x99cd('0x46')]);_0x3d3eb['next']();});}}catch(_0x7205f6){logger[_0x99cd('0x22')](_0x99cd('0x10'),_0x2f8d6b,JSON[_0x99cd('0xc')](_0x7205f6));_0x3d3eb[_0x99cd('0x25')]();}};}; \ No newline at end of file diff --git a/server/services/routing/server/applications/gotoif.js b/server/services/routing/server/applications/gotoif.js index cdf73a7..67362a3 100644 --- a/server/services/routing/server/applications/gotoif.js +++ b/server/services/routing/server/applications/gotoif.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xb963=['[%s][GOTOIF]\x20priority\x20%s\x20found\x20at\x20index:\x20%s','[%s][GOTOIF]\x20priority\x20%s\x20not\x20found','error','[%s][GOTOIF]\x20eval\x20error:\x20%s','stringify','validate','lodash','html-to-text','./utils','routing','string','condition\x20is\x20a\x20string\x20and\x20it\x20is\x20required','number','priority\x20true\x20is\x20a\x20number','consequence','fromString','replace','length','[%s][GOTOIF]\x20%s','map','message','join','stop','priorityTrue','priorityFalse','info','condition','next','findIndex','rules'];(function(_0x1286e2,_0x22d0a1){var _0x3a7f9a=function(_0x4c8fa0){while(--_0x4c8fa0){_0x1286e2['push'](_0x1286e2['shift']());}};_0x3a7f9a(++_0x22d0a1);}(_0xb963,0x1c7));var _0x3b96=function(_0x5db911,_0x360d9c){_0x5db911=_0x5db911-0x0;var _0x279651=_0xb963[_0x5db911];return _0x279651;};'use strict';var schema=require(_0x3b96('0x0'));var _=require(_0x3b96('0x1'));var htmlToText=require(_0x3b96('0x2'));var utils=require(_0x3b96('0x3'));var logger=require('../../../../config/logger')(_0x3b96('0x4'));var gotoif=schema({'condition':{'type':_0x3b96('0x5'),'required':!![],'message':_0x3b96('0x6')},'priorityTrue':{'type':_0x3b96('0x7'),'message':_0x3b96('0x8')},'priorityFalse':{'type':_0x3b96('0x7'),'message':'priority\x20false\x20is\x20a\x20number'}});exports[_0x3b96('0x9')]=function(_0x2556d9,_0x513a0b){return function(_0x559d1f){try{var _0x80d9ce={'condition':htmlToText[_0x3b96('0xa')](utils['getMustacheRender'](_0x513a0b[0x0],this),{'wordwrap':![]})[_0x3b96('0xb')](/<\/?[^>]+(>|$)/g,''),'priorityTrue':_0x513a0b[0x1],'priorityFalse':_0x513a0b[0x2]};var _0x483ef8=gotoif[_0x3b96('0x0')](_0x80d9ce,{'typecast':!![]});if(_0x483ef8[_0x3b96('0xc')]){logger['error'](_0x3b96('0xd'),_0x2556d9,_[_0x3b96('0xe')](_0x483ef8,_0x3b96('0xf'))[_0x3b96('0x10')](',\x20'));_0x559d1f[_0x3b96('0x11')]();}else{try{var _0x463e25=eval('('+_0x80d9ce['condition']+')');var _0x3b7e22=_0x463e25?_0x80d9ce[_0x3b96('0x12')]:_0x80d9ce[_0x3b96('0x13')];logger[_0x3b96('0x14')]('[%s][GOTOIF]\x20condition\x20%s\x20is\x20%s\x20try\x20goto\x20priority\x20%s',_0x2556d9,_0x80d9ce[_0x3b96('0x15')],_0x463e25,_0x3b7e22||_0x3b96('0x16'));if(_0x3b7e22){var _0x4a5e72=_[_0x3b96('0x17')](_0x559d1f[_0x3b96('0x18')](),{'p':_0x3b7e22});if(_0x4a5e72>=0x0){logger[_0x3b96('0x14')](_0x3b96('0x19'),_0x2556d9,_0x3b7e22||_0x3b96('0x16'),_0x4a5e72);_0x559d1f[_0x3b96('0x16')](_0x4a5e72);}else{logger[_0x3b96('0x14')](_0x3b96('0x1a'),_0x2556d9,_0x3b7e22||_0x3b96('0x16'));_0x559d1f[_0x3b96('0x11')]();}}else{_0x559d1f[_0x3b96('0x16')]();}}catch(_0xf0e4c5){logger[_0x3b96('0x1b')](_0x3b96('0x1c'),_0x2556d9,_0xf0e4c5[_0x3b96('0xf')]);_0x559d1f[_0x3b96('0x11')]();}}}catch(_0x3f0895){logger[_0x3b96('0x1b')](_0x3b96('0xd'),_0x2556d9,JSON[_0x3b96('0x1d')](_0x3f0895));_0x559d1f[_0x3b96('0x11')]();}};}; \ No newline at end of file +var _0x112e=['error','message','join','stop','condition','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','[%s][GOTOIF]\x20priority\x20%s\x20not\x20found','[%s][GOTOIF]\x20eval\x20error:\x20%s','stringify','validate','lodash','./utils','routing','string','condition\x20is\x20a\x20string\x20and\x20it\x20is\x20required','number','priority\x20true\x20is\x20a\x20number','consequence','fromString','getMustacheRender','replace','length'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x112e,0x1eb));var _0xe112=function(_0x272d90,_0x5e70ff){_0x272d90=_0x272d90-0x0;var _0x2bf4a2=_0x112e[_0x272d90];return _0x2bf4a2;};'use strict';var schema=require(_0xe112('0x0'));var _=require(_0xe112('0x1'));var htmlToText=require('html-to-text');var utils=require(_0xe112('0x2'));var logger=require('../../../../config/logger')(_0xe112('0x3'));var gotoif=schema({'condition':{'type':_0xe112('0x4'),'required':!![],'message':_0xe112('0x5')},'priorityTrue':{'type':_0xe112('0x6'),'message':_0xe112('0x7')},'priorityFalse':{'type':_0xe112('0x6'),'message':'priority\x20false\x20is\x20a\x20number'}});exports[_0xe112('0x8')]=function(_0x13c3b8,_0x25dba8){return function(_0x3d8a3d){try{var _0xea48ad={'condition':htmlToText[_0xe112('0x9')](utils[_0xe112('0xa')](_0x25dba8[0x0],this),{'wordwrap':![]})[_0xe112('0xb')](/<\/?[^>]+(>|$)/g,''),'priorityTrue':_0x25dba8[0x1],'priorityFalse':_0x25dba8[0x2]};var _0x44203e=gotoif[_0xe112('0x0')](_0xea48ad,{'typecast':!![]});if(_0x44203e[_0xe112('0xc')]){logger[_0xe112('0xd')]('[%s][GOTOIF]\x20%s',_0x13c3b8,_['map'](_0x44203e,_0xe112('0xe'))[_0xe112('0xf')](',\x20'));_0x3d8a3d[_0xe112('0x10')]();}else{try{var _0x156906=eval('('+_0xea48ad[_0xe112('0x11')]+')');var _0x5440ed=_0x156906?_0xea48ad['priorityTrue']:_0xea48ad[_0xe112('0x12')];logger[_0xe112('0x13')](_0xe112('0x14'),_0x13c3b8,_0xea48ad[_0xe112('0x11')],_0x156906,_0x5440ed||'next');if(_0x5440ed){var _0x46e058=_[_0xe112('0x15')](_0x3d8a3d[_0xe112('0x16')](),{'p':_0x5440ed});if(_0x46e058>=0x0){logger['info'](_0xe112('0x17'),_0x13c3b8,_0x5440ed||'next',_0x46e058);_0x3d8a3d[_0xe112('0x18')](_0x46e058);}else{logger[_0xe112('0x13')](_0xe112('0x19'),_0x13c3b8,_0x5440ed||_0xe112('0x18'));_0x3d8a3d[_0xe112('0x10')]();}}else{_0x3d8a3d[_0xe112('0x18')]();}}catch(_0x4c28e0){logger[_0xe112('0xd')](_0xe112('0x1a'),_0x13c3b8,_0x4c28e0[_0xe112('0xe')]);_0x3d8a3d[_0xe112('0x10')]();}}}catch(_0x4e0514){logger['error']('[%s][GOTOIF]\x20%s',_0x13c3b8,JSON[_0xe112('0x1b')](_0x4e0514));_0x3d8a3d['stop']();}};}; \ No newline at end of file diff --git a/server/services/routing/server/applications/gotop.js b/server/services/routing/server/applications/gotop.js index e98796e..99116fb 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 _0xb1f9=['map','message','join','info','[%s][GOTOP]\x20priority\x20%s','priority','rules','[%s][GOTOP]\x20priority\x20%s\x20found\x20at\x20index:\x20%s','next','[%s][GOTOP]\x20priority\x20%s\x20not\x20found','stop','stringify','validate','lodash','../../../../config/logger','routing','number','priority\x20is\x20a\x20number\x20and\x20it\x20is\x20required','consequence','length','error','[%s][GOTOP]\x20%s'];(function(_0x585f45,_0x4ca0fd){var _0x1e6439=function(_0x2eb1a6){while(--_0x2eb1a6){_0x585f45['push'](_0x585f45['shift']());}};_0x1e6439(++_0x4ca0fd);}(_0xb1f9,0xe8));var _0x9b1f=function(_0x3cd8d9,_0x3c7f1d){_0x3cd8d9=_0x3cd8d9-0x0;var _0x3bcfa2=_0xb1f9[_0x3cd8d9];return _0x3bcfa2;};'use strict';var schema=require(_0x9b1f('0x0'));var _=require(_0x9b1f('0x1'));var logger=require(_0x9b1f('0x2'))(_0x9b1f('0x3'));var gotop=schema({'priority':{'type':_0x9b1f('0x4'),'required':!![],'message':_0x9b1f('0x5')}});exports[_0x9b1f('0x6')]=function(_0x71e903,_0x26a2df){return function(_0x1be368){try{var _0x5359d6={'priority':_0x26a2df[0x0]};var _0x3fc631=gotop[_0x9b1f('0x0')](_0x5359d6,{'typecast':!![]});if(_0x3fc631[_0x9b1f('0x7')]){logger[_0x9b1f('0x8')](_0x9b1f('0x9'),_0x71e903,_[_0x9b1f('0xa')](_0x3fc631,_0x9b1f('0xb'))[_0x9b1f('0xc')](',\x20'));_0x1be368['stop']();}else{logger[_0x9b1f('0xd')](_0x9b1f('0xe'),_0x71e903,_0x5359d6[_0x9b1f('0xf')]);if(_0x5359d6['priority']){var _0x3ec80a=_['findIndex'](_0x1be368[_0x9b1f('0x10')](),{'p':_0x5359d6['priority']});if(_0x3ec80a>=0x0){logger[_0x9b1f('0xd')](_0x9b1f('0x11'),_0x71e903,_0x5359d6[_0x9b1f('0xf')]||_0x9b1f('0x12'),_0x3ec80a);_0x1be368['next'](_0x3ec80a);}else{logger[_0x9b1f('0xd')](_0x9b1f('0x13'),_0x71e903,_0x5359d6[_0x9b1f('0xf')]||_0x9b1f('0x12'));_0x1be368[_0x9b1f('0x14')]();}}else{_0x1be368['next']();}}}catch(_0x1062fd){logger['error'](_0x9b1f('0x9'),_0x71e903,JSON[_0x9b1f('0x15')](_0x1062fd));_0x1be368['stop']();}};}; \ No newline at end of file +var _0x6053=['join','info','[%s][GOTOP]\x20priority\x20%s','priority','[%s][GOTOP]\x20priority\x20%s\x20found\x20at\x20index:\x20%s','next','[%s][GOTOP]\x20priority\x20%s\x20not\x20found','stringify','stop','validate','lodash','../../../../config/logger','priority\x20is\x20a\x20number\x20and\x20it\x20is\x20required','length','error','[%s][GOTOP]\x20%s','map','message'];(function(_0x4c2f17,_0x5c6821){var _0x20919e=function(_0x31eef7){while(--_0x31eef7){_0x4c2f17['push'](_0x4c2f17['shift']());}};_0x20919e(++_0x5c6821);}(_0x6053,0x1dd));var _0x3605=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x6053[_0x3dd15e];return _0x231fd0;};'use strict';var schema=require(_0x3605('0x0'));var _=require(_0x3605('0x1'));var logger=require(_0x3605('0x2'))('routing');var gotop=schema({'priority':{'type':'number','required':!![],'message':_0x3605('0x3')}});exports['consequence']=function(_0xb64559,_0x1e4ad4){return function(_0x477c74){try{var _0x37c0be={'priority':_0x1e4ad4[0x0]};var _0x4ca309=gotop['validate'](_0x37c0be,{'typecast':!![]});if(_0x4ca309[_0x3605('0x4')]){logger[_0x3605('0x5')](_0x3605('0x6'),_0xb64559,_[_0x3605('0x7')](_0x4ca309,_0x3605('0x8'))[_0x3605('0x9')](',\x20'));_0x477c74['stop']();}else{logger[_0x3605('0xa')](_0x3605('0xb'),_0xb64559,_0x37c0be[_0x3605('0xc')]);if(_0x37c0be[_0x3605('0xc')]){var _0x20fb60=_['findIndex'](_0x477c74['rules'](),{'p':_0x37c0be[_0x3605('0xc')]});if(_0x20fb60>=0x0){logger[_0x3605('0xa')](_0x3605('0xd'),_0xb64559,_0x37c0be[_0x3605('0xc')]||'next',_0x20fb60);_0x477c74[_0x3605('0xe')](_0x20fb60);}else{logger['info'](_0x3605('0xf'),_0xb64559,_0x37c0be[_0x3605('0xc')]||'next');_0x477c74['stop']();}}else{_0x477c74[_0x3605('0xe')]();}}}catch(_0x339dfc){logger[_0x3605('0x5')]('[%s][GOTOP]\x20%s',_0xb64559,JSON[_0x3605('0x10')](_0x339dfc));_0x477c74[_0x3605('0x11')]();}};}; \ 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 f65b748..0085ceb 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 _0x1ab2=['error','stringify','stop','lodash','./utils','../../../../config/logger','routing','../../rpc/chatMessage','../../rpc/mailMessage','../../rpc/smsMessage','../../rpc/faxMessage','../../rpc/whatsappMessage','channel','chat','ChatWebsiteId','account','AccountId','upperFirst','InteractionId','interaction','Message','create','then','info','[%s][MESSAGE]\x20%s','body','next'];(function(_0x59ae4f,_0x13d7cf){var _0x31e795=function(_0x25e22c){while(--_0x25e22c){_0x59ae4f['push'](_0x59ae4f['shift']());}};_0x31e795(++_0x13d7cf);}(_0x1ab2,0x198));var _0x21ab=function(_0x21ada8,_0x1b189f){_0x21ada8=_0x21ada8-0x0;var _0x1c909b=_0x1ab2[_0x21ada8];return _0x1c909b;};'use strict';var _=require(_0x21ab('0x0'));var utils=require(_0x21ab('0x1'));var logger=require(_0x21ab('0x2'))(_0x21ab('0x3'));var rpc={'chatMessage':require(_0x21ab('0x4')),'openchannelMessage':require('../../rpc/openchannelMessage'),'mailMessage':require(_0x21ab('0x5')),'smsMessage':require(_0x21ab('0x6')),'faxMessage':require(_0x21ab('0x7')),'whatsappMessage':require(_0x21ab('0x8'))};exports['consequence']=function(_0x44873a,_0x26d8fa){return function(_0x2a6592){try{var _0x506332={'body':utils['getMustacheRender'](_0x26d8fa[0x0],this),'ContactId':this['contact']['id']};if(this[_0x21ab('0x9')]===_0x21ab('0xa')){_0x506332[_0x21ab('0xb')]=this[_0x21ab('0xc')]['id'];}else{_0x506332[_['upperFirst'](this[_0x21ab('0x9')])+_0x21ab('0xd')]=this[_0x21ab('0xc')]['id'];}_0x506332[_[_0x21ab('0xe')](this['channel'])+_0x21ab('0xf')]=this[_0x21ab('0x10')]['id'];if(rpc[this[_0x21ab('0x9')]+_0x21ab('0x11')]){return rpc[this[_0x21ab('0x9')]+_0x21ab('0x11')][_0x21ab('0x12')](_0x506332)[_0x21ab('0x13')](function(_0x574626){logger[_0x21ab('0x14')](_0x21ab('0x15'),_0x44873a,_0x506332[_0x21ab('0x16')]);_0x2a6592[_0x21ab('0x17')]();})['catch'](function(_0x3a7741){logger[_0x21ab('0x18')](_0x21ab('0x15'),_0x44873a,JSON[_0x21ab('0x19')](_0x3a7741));_0x2a6592[_0x21ab('0x1a')]();});}}catch(_0x3784a6){logger[_0x21ab('0x18')](_0x21ab('0x15'),_0x44873a,JSON['stringify'](_0x3784a6));_0x2a6592[_0x21ab('0x1a')]();}};}; \ No newline at end of file +var _0x5e6c=['chat','ChatWebsiteId','account','upperFirst','InteractionId','Message','create','then','info','[%s][MESSAGE]\x20%s','body','next','catch','error','stringify','stop','./utils','../../../../config/logger','../../rpc/chatMessage','../../rpc/faxMessage','../../rpc/whatsappMessage','contact','channel'];(function(_0x3b380d,_0x4bf247){var _0x54502b=function(_0x35d207){while(--_0x35d207){_0x3b380d['push'](_0x3b380d['shift']());}};_0x54502b(++_0x4bf247);}(_0x5e6c,0x1dc));var _0xc5e6=function(_0x53a768,_0x4f068e){_0x53a768=_0x53a768-0x0;var _0x294582=_0x5e6c[_0x53a768];return _0x294582;};'use strict';var _=require('lodash');var utils=require(_0xc5e6('0x0'));var logger=require(_0xc5e6('0x1'))('routing');var rpc={'chatMessage':require(_0xc5e6('0x2')),'openchannelMessage':require('../../rpc/openchannelMessage'),'mailMessage':require('../../rpc/mailMessage'),'smsMessage':require('../../rpc/smsMessage'),'faxMessage':require(_0xc5e6('0x3')),'whatsappMessage':require(_0xc5e6('0x4'))};exports['consequence']=function(_0x36adef,_0x593a14){return function(_0x38150e){try{var _0x79124e={'body':utils['getMustacheRender'](_0x593a14[0x0],this),'ContactId':this[_0xc5e6('0x5')]['id']};if(this[_0xc5e6('0x6')]===_0xc5e6('0x7')){_0x79124e[_0xc5e6('0x8')]=this[_0xc5e6('0x9')]['id'];}else{_0x79124e[_[_0xc5e6('0xa')](this[_0xc5e6('0x6')])+'AccountId']=this['account']['id'];}_0x79124e[_[_0xc5e6('0xa')](this['channel'])+_0xc5e6('0xb')]=this['interaction']['id'];if(rpc[this['channel']+_0xc5e6('0xc')]){return rpc[this[_0xc5e6('0x6')]+_0xc5e6('0xc')][_0xc5e6('0xd')](_0x79124e)[_0xc5e6('0xe')](function(_0x210477){logger[_0xc5e6('0xf')](_0xc5e6('0x10'),_0x36adef,_0x79124e[_0xc5e6('0x11')]);_0x38150e[_0xc5e6('0x12')]();})[_0xc5e6('0x13')](function(_0x3849f1){logger[_0xc5e6('0x14')](_0xc5e6('0x10'),_0x36adef,JSON[_0xc5e6('0x15')](_0x3849f1));_0x38150e[_0xc5e6('0x16')]();});}}catch(_0x4cb403){logger[_0xc5e6('0x14')]('[%s][MESSAGE]\x20%s',_0x36adef,JSON[_0xc5e6('0x15')](_0x4cb403));_0x38150e[_0xc5e6('0x16')]();}};}; \ No newline at end of file diff --git a/server/services/routing/server/applications/noop.js b/server/services/routing/server/applications/noop.js index bd7181e..48d1df5 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 _0x98f4=['consequence','info','getMustacheRender','next','stringify','stop','./utils','../../../../config/logger','routing'];(function(_0x2641f9,_0x26715f){var _0x585741=function(_0x2d1462){while(--_0x2d1462){_0x2641f9['push'](_0x2641f9['shift']());}};_0x585741(++_0x26715f);}(_0x98f4,0xe7));var _0x498f=function(_0x3bac2b,_0x137306){_0x3bac2b=_0x3bac2b-0x0;var _0xbadf45=_0x98f4[_0x3bac2b];return _0xbadf45;};'use strict';var utils=require(_0x498f('0x0'));var logger=require(_0x498f('0x1'))(_0x498f('0x2'));exports[_0x498f('0x3')]=function(_0x4d78ec,_0x4dd488){return function(_0x545d0c){try{logger[_0x498f('0x4')]('[%s][NOOP]\x20%s',_0x4d78ec,utils[_0x498f('0x5')](_0x4dd488[0x0],this));_0x545d0c[_0x498f('0x6')]();}catch(_0x579950){logger['error']('[%s][NOOP]\x20%s',_0x4d78ec,JSON[_0x498f('0x7')](_0x579950));_0x545d0c[_0x498f('0x8')]();}};}; \ No newline at end of file +var _0xe3ef=['info','[%s][NOOP]\x20%s','next','error','stringify','stop','./utils','routing','consequence'];(function(_0x209941,_0x5c9988){var _0x1e8729=function(_0x51a9b8){while(--_0x51a9b8){_0x209941['push'](_0x209941['shift']());}};_0x1e8729(++_0x5c9988);}(_0xe3ef,0x165));var _0xfe3e=function(_0x33bd9f,_0x3e626f){_0x33bd9f=_0x33bd9f-0x0;var _0x33fa29=_0xe3ef[_0x33bd9f];return _0x33fa29;};'use strict';var utils=require(_0xfe3e('0x0'));var logger=require('../../../../config/logger')(_0xfe3e('0x1'));exports[_0xfe3e('0x2')]=function(_0x36e36a,_0x56d82a){return function(_0x441c58){try{logger[_0xfe3e('0x3')](_0xfe3e('0x4'),_0x36e36a,utils['getMustacheRender'](_0x56d82a[0x0],this));_0x441c58[_0xfe3e('0x5')]();}catch(_0x12ea22){logger[_0xfe3e('0x6')](_0xfe3e('0x4'),_0x36e36a,JSON[_0xfe3e('0x7')](_0x12ea22));_0x441c58[_0xfe3e('0x8')]();}};}; \ No newline at end of file diff --git a/server/services/routing/server/applications/queue.js b/server/services/routing/server/applications/queue.js index 5592674..e5ccaf5 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 _0xbcfc=['close','rules','complete','[%s][QUEUE]\x20APPLICATION\x20END','next','strategy','rrmemory','beepall','[%s][QUEUE]\x20queue\x20not\x20found\x20%s','stack','validate','lodash','util','seq-queue','ioredis','../../../../config/environment','../../../../config/logger','routing','./strategy','defaults','redis','localhost','socket.io-emitter','queue_id','from','joinAt','emit','queue','account','push','capitalize','format','%sQueuesWaitingInteractions','pick','%s:queue:%s','save','remove','../../rpc/openchannelQueueReport','../../rpc/mailQueueReport','../../rpc/chatQueueReport','../../rpc/faxQueueReport','../../rpc/whatsappQueueReport','../../rpc/faxInteraction','string','name\x20is\x20a\x20string\x20and\x20it\x20is\x20required','number','timeout\x20is\x20a\x20number','YYYY-MM-DD\x20HH:mm:ss','contact','upperFirst','channel','QueueId','InteractionId','interaction','MessageId','message','chat','AccountId','WebsiteId','info','name','QueueReport','create','catch','create\x20queue\x20report','accepted','[%s][STOP:QUEUE][NAME:%s]','body','update','then','update\x20queue\x20report','waiting','timeout','[%s][END:QUEUE][NAME:%s]','error','toLowerCase','consequence','[%s][QUEUE]\x20%s','map','join','stop','Queues','createQueue','atimeout','qtimeout','end'];(function(_0x378bf6,_0x420778){var _0x21419e=function(_0x421d98){while(--_0x421d98){_0x378bf6['push'](_0x378bf6['shift']());}};_0x21419e(++_0x420778);}(_0xbcfc,0x162));var _0xcbcf=function(_0x3f1471,_0x494b78){_0x3f1471=_0x3f1471-0x0;var _0x6885fb=_0xbcfc[_0x3f1471];return _0x6885fb;};'use strict';var schema=require(_0xcbcf('0x0'));var _=require(_0xcbcf('0x1'));var util=require(_0xcbcf('0x2'));var seqqueue=require(_0xcbcf('0x3'));var moment=require('moment');var Redis=require(_0xcbcf('0x4'));var config=require(_0xcbcf('0x5'));var logger=require(_0xcbcf('0x6'))(_0xcbcf('0x7'));var strategy=require(_0xcbcf('0x8'));config['redis']=_[_0xcbcf('0x9')](config[_0xcbcf('0xa')],{'host':_0xcbcf('0xb'),'port':0x18eb});var io=require(_0xcbcf('0xc'))(new Redis(config['redis']));var attributes=['id',_0xcbcf('0xd'),'account','queue',_0xcbcf('0xe'),_0xcbcf('0xf')];function emit(_0x175969,_0x11916e,_0x48eb30){io['to'](_0x175969)[_0xcbcf('0x10')](_0x11916e,_0x48eb30);}function emitChannelQueueInteraction(_0x10a918,_0x7453be,_0x4d759f,_0x1f4628,_0x175638,_0x31294d,_0x40a22d,_0x4dbfc8){var _0x263bee=_['clone'](_0x4d759f);_0x263bee[_0xcbcf('0xd')]=_0x4dbfc8;_0x263bee[_0xcbcf('0x11')]=_0x7453be;_0x263bee[_0xcbcf('0x12')]=_0x1f4628;_0x263bee['id']=_0x175638;if(_0x31294d){attributes[_0xcbcf('0x13')](_[_0xcbcf('0x14')](_0x10a918)+'InteractionId');_0x40a22d[util[_0xcbcf('0x15')](_0xcbcf('0x16'),_0x10a918)][_0x175638]=_[_0xcbcf('0x17')](_0x263bee,attributes);}else{delete _0x40a22d[util[_0xcbcf('0x15')]('%sQueuesWaitingInteractions',_0x10a918)][_0x175638];}emit(util[_0xcbcf('0x15')](_0xcbcf('0x18'),_0x10a918,_0x7453be),util[_0xcbcf('0x15')]('%s_queue_waiting_interaction:%s',_0x10a918,_0x31294d?_0xcbcf('0x19'):_0xcbcf('0x1a')),_['pick'](_0x263bee,attributes));}var rpc={'openchannelQueueReport':require(_0xcbcf('0x1b')),'mailQueueReport':require(_0xcbcf('0x1c')),'chatQueueReport':require(_0xcbcf('0x1d')),'smsQueueReport':require('../../rpc/smsQueueReport'),'faxQueueReport':require(_0xcbcf('0x1e')),'whatsappQueueReport':require(_0xcbcf('0x1f')),'chatInteraction':require('../../rpc/chatInteraction'),'faxInteraction':require(_0xcbcf('0x20')),'mailInteraction':require('../../rpc/mailInteraction'),'openchannelInteraction':require('../../rpc/openchannelInteraction'),'smsInteraction':require('../../rpc/smsInteraction'),'whatsappInteraction':require('../../rpc/whatsappInteraction')};var queue=schema({'name':{'type':_0xcbcf('0x21'),'required':!![],'message':_0xcbcf('0x22')},'timeout':{'type':_0xcbcf('0x23'),'message':_0xcbcf('0x24')}});function startRouting(_0x2c1906,_0xb8511e,_0x5c6fd0,_0x434502){if(_0x2c1906&&_0xb8511e&&_0x5c6fd0){_0xb8511e['waiting']+=0x1;var _0x33f0b1={'uniqueid':_0x2c1906,'from':_0x5c6fd0['body']?_0x5c6fd0['body']['from']:'','joinAt':moment()[_0xcbcf('0x15')](_0xcbcf('0x25')),'ContactId':_0x5c6fd0[_0xcbcf('0x26')]?_0x5c6fd0[_0xcbcf('0x26')]['id']:null,'ListId':_0x5c6fd0['list']?_0x5c6fd0['list']['id']:null};_0x33f0b1[_[_0xcbcf('0x27')](_0x5c6fd0[_0xcbcf('0x28')])+_0xcbcf('0x29')]=_0xb8511e['id']||null;_0x33f0b1[_['upperFirst'](_0x5c6fd0[_0xcbcf('0x28')])+_0xcbcf('0x2a')]=_0x5c6fd0[_0xcbcf('0x2b')]?_0x5c6fd0['interaction']['id']:null;_0x33f0b1[_['upperFirst'](_0x5c6fd0[_0xcbcf('0x28')])+_0xcbcf('0x2c')]=_0x5c6fd0[_0xcbcf('0x2d')]?_0x5c6fd0['message']['id']:null;_0x33f0b1[_[_0xcbcf('0x27')](_0x5c6fd0[_0xcbcf('0x28')])+(_0x5c6fd0[_0xcbcf('0x28')]!==_0xcbcf('0x2e')?_0xcbcf('0x2f'):_0xcbcf('0x30'))]=_0x5c6fd0[_0xcbcf('0x12')]?_0x5c6fd0[_0xcbcf('0x12')]['id']:null;logger[_0xcbcf('0x31')](util[_0xcbcf('0x15')]('[%s][START:QUEUE][NAME:%s]',_0x2c1906,_0xb8511e[_0xcbcf('0x32')]));emitChannelQueueInteraction(_0x5c6fd0[_0xcbcf('0x28')],_0xb8511e[_0xcbcf('0x32')],_0x33f0b1,_0x5c6fd0[_0xcbcf('0x12')][_0xcbcf('0x32')],_0x5c6fd0[_0xcbcf('0x2d')]['id'],!![],_0x434502,_0xb8511e['id']);if(rpc[_0x5c6fd0['channel']+_0xcbcf('0x33')]){return rpc[_0x5c6fd0[_0xcbcf('0x28')]+_0xcbcf('0x33')][_0xcbcf('0x34')](_0x33f0b1)[_0xcbcf('0x35')](function(_0x1cb809){logger['error'](_0xcbcf('0x36'),_0x1cb809);});}}}function stopRouting(_0x2cd3be,_0x576424,_0x4a9a1c,_0xf5d5bf){if(_0x2cd3be&&_0x576424){_0x576424['waiting']-=0x1;var _0x35e09d={'leaveAt':moment()[_0xcbcf('0x15')](_0xcbcf('0x25')),'acceptAt':moment()[_0xcbcf('0x15')]('YYYY-MM-DD\x20HH:mm:ss'),'reason':_0xcbcf('0x37')};logger['info'](util[_0xcbcf('0x15')](_0xcbcf('0x38'),_0x2cd3be,_0x576424[_0xcbcf('0x32')]));emitChannelQueueInteraction(_0x4a9a1c[_0xcbcf('0x28')],_0x576424[_0xcbcf('0x32')],_0x4a9a1c[_0xcbcf('0x39')],_0x4a9a1c[_0xcbcf('0x12')][_0xcbcf('0x32')],_0x4a9a1c['message']['id'],![],_0xf5d5bf,_0x576424['id']);return rpc[_0x4a9a1c['channel']+'Interaction'][_0xcbcf('0x3a')](_0x4a9a1c['interaction']['id'],{'queueId':_0x576424['id']})[_0xcbcf('0x3b')](function(){if(rpc[_0x4a9a1c['channel']+_0xcbcf('0x33')]){return rpc[_0x4a9a1c[_0xcbcf('0x28')]+'QueueReport'][_0xcbcf('0x3a')](_0x2cd3be,_0x35e09d)['catch'](function(_0x482732){logger['error'](_0xcbcf('0x3c'),_0x482732);});}});}}function endRouting(_0x352c63,_0x3a0949,_0x1603f4,_0x1b3521){if(_0x352c63&&_0x3a0949){_0x3a0949[_0xcbcf('0x3d')]-=0x1;var _0x107669={'leaveAt':moment()[_0xcbcf('0x15')](_0xcbcf('0x25')),'exitAt':moment()['format'](_0xcbcf('0x25')),'reason':_0xcbcf('0x3e')};logger['info'](util['format'](_0xcbcf('0x3f'),_0x352c63,_0x3a0949[_0xcbcf('0x32')]));emitChannelQueueInteraction(_0x1603f4[_0xcbcf('0x28')],_0x3a0949[_0xcbcf('0x32')],_0x1603f4[_0xcbcf('0x39')],_0x1603f4[_0xcbcf('0x12')]['name'],_0x1603f4[_0xcbcf('0x2d')]['id'],![],_0x1b3521);if(rpc[_0x1603f4['channel']+_0xcbcf('0x33')]){return rpc[_0x1603f4['channel']+_0xcbcf('0x33')][_0xcbcf('0x3a')](_0x352c63,_0x107669)[_0xcbcf('0x35')](function(_0x573922){logger[_0xcbcf('0x40')](_0xcbcf('0x3c'),_0x573922);});}}}function handleFindQueue(_0x3dc047){return function(_0x38a416){return _0x38a416[_0xcbcf('0x32')]['toLowerCase']()===_0x3dc047[_0xcbcf('0x41')]();};}exports[_0xcbcf('0x42')]=function(_0x395e1b,_0xb5a613,_0x44e1d0,_0x10bd81){return function(_0x331751){try{var _0x21f931={'name':_0xb5a613[0x0],'timeout':_0xb5a613[0x1]};var _0x49b87b=queue[_0xcbcf('0x0')](_0x21f931,{'typecast':!![]});if(_0x49b87b['length']){logger[_0xcbcf('0x40')](_0xcbcf('0x43'),_0x395e1b,_[_0xcbcf('0x44')](_0x49b87b,_0xcbcf('0x2d'))[_0xcbcf('0x45')](',\x20'));_0x331751[_0xcbcf('0x46')]();}else{var _0x2a6a53=_['find'](_0x44e1d0[_0x10bd81['channel']+_0xcbcf('0x47')],handleFindQueue(_0x21f931[_0xcbcf('0x32')]));if(_0x2a6a53){startRouting(_0x395e1b,_0x2a6a53,_0x10bd81,_0x44e1d0);var _0x3b5e74=(_0x2a6a53[_0xcbcf('0x3e')]||0xa)*0x3e8;var _0x22d7d8=(_0x21f931[_0xcbcf('0x3e')]||0x14)*0x3e8;var _0x549af0;if(_0x3b5e74>_0x22d7d8){_0x22d7d8=_0x3b5e74;}var _0x23155f=seqqueue[_0xcbcf('0x48')](_0x3b5e74);_0x23155f['id']=_0x395e1b;_0x23155f[_0xcbcf('0x49')]=_0x3b5e74;_0x23155f[_0xcbcf('0x4a')]=_0x22d7d8;_0x23155f[_0xcbcf('0x28')]=_0x10bd81[_0xcbcf('0x28')];_0x44e1d0['rules'][_0x395e1b]['on'](_0xcbcf('0x4b'),function(){logger['info']('[%s][QUEUE]\x20ROUTING\x20STOPPED',_0x395e1b);stopRouting(_0x395e1b,_0x2a6a53,_0x10bd81,_0x44e1d0);clearTimeout(_0x549af0);_0x549af0=undefined;_0x23155f[_0xcbcf('0x4c')](!![]);if(_0x44e1d0[_0xcbcf('0x4d')][_0x395e1b]){delete _0x44e1d0[_0xcbcf('0x4d')][_0x395e1b];}_0x331751[_0xcbcf('0x46')]();});_0x44e1d0[_0xcbcf('0x4d')][_0x395e1b]['on'](_0xcbcf('0x4e'),function(){if(_0x44e1d0[_0xcbcf('0x4d')][_0x395e1b]){delete _0x44e1d0['rules'][_0x395e1b];}});_0x549af0=setTimeout(function(){logger[_0xcbcf('0x31')](_0xcbcf('0x4f'),_0x395e1b);endRouting(_0x395e1b,_0x2a6a53,_0x10bd81,_0x44e1d0);clearTimeout(_0x549af0);_0x23155f[_0xcbcf('0x4c')](!![]);_0x331751[_0xcbcf('0x50')]();},_0x22d7d8);switch(_0x2a6a53[_0xcbcf('0x51')]){case _0xcbcf('0x52'):strategy[_0xcbcf('0x52')](_0x23155f,_0x2a6a53,_0x44e1d0,_0x10bd81);break;default:strategy[_0xcbcf('0x53')](_0x23155f,_0x2a6a53,_0x44e1d0,_0x10bd81);}}else{logger['error'](_0xcbcf('0x54'),_0x395e1b,_0x21f931[_0xcbcf('0x32')]);_0x331751[_0xcbcf('0x46')]();}}}catch(_0x181cf2){logger[_0xcbcf('0x40')](_0xcbcf('0x43'),_0x395e1b,_0x181cf2[_0xcbcf('0x55')]);_0x331751[_0xcbcf('0x46')]();}};}; \ No newline at end of file +var _0x570f=['[%s][QUEUE]\x20ROUTING\x20STOPPED','close','complete','strategy','beepall','[%s][QUEUE]\x20queue\x20not\x20found\x20%s','validate','lodash','util','ioredis','../../../../config/environment','../../../../config/logger','routing','./strategy','redis','defaults','localhost','account','from','emit','queue_id','queue','push','InteractionId','format','%sQueuesWaitingInteractions','pick','%s:queue:%s','%s_queue_waiting_interaction:%s','save','../../rpc/openchannelQueueReport','../../rpc/mailQueueReport','../../rpc/chatQueueReport','../../rpc/smsQueueReport','../../rpc/whatsappQueueReport','../../rpc/chatInteraction','../../rpc/faxInteraction','../../rpc/openchannelInteraction','../../rpc/smsInteraction','../../rpc/whatsappInteraction','string','number','timeout\x20is\x20a\x20number','waiting','body','YYYY-MM-DD\x20HH:mm:ss','contact','list','channel','QueueId','upperFirst','interaction','MessageId','message','chat','AccountId','WebsiteId','info','[%s][START:QUEUE][NAME:%s]','name','QueueReport','create','error','create\x20queue\x20report','[%s][STOP:QUEUE][NAME:%s]','Interaction','update','catch','update\x20queue\x20report','timeout','[%s][END:QUEUE][NAME:%s]','toLowerCase','consequence','length','[%s][QUEUE]\x20%s','map','stop','find','Queues','createQueue','qtimeout','rules','end'];(function(_0x3b4744,_0x3d3ae8){var _0x1fa886=function(_0x293567){while(--_0x293567){_0x3b4744['push'](_0x3b4744['shift']());}};_0x1fa886(++_0x3d3ae8);}(_0x570f,0x152));var _0xf570=function(_0x343e5a,_0x438aa6){_0x343e5a=_0x343e5a-0x0;var _0x37e87f=_0x570f[_0x343e5a];return _0x37e87f;};'use strict';var schema=require(_0xf570('0x0'));var _=require(_0xf570('0x1'));var util=require(_0xf570('0x2'));var seqqueue=require('seq-queue');var moment=require('moment');var Redis=require(_0xf570('0x3'));var config=require(_0xf570('0x4'));var logger=require(_0xf570('0x5'))(_0xf570('0x6'));var strategy=require(_0xf570('0x7'));config[_0xf570('0x8')]=_[_0xf570('0x9')](config['redis'],{'host':_0xf570('0xa'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0xf570('0x8')]));var attributes=['id','queue_id',_0xf570('0xb'),'queue',_0xf570('0xc'),'joinAt'];function emit(_0x19bee1,_0x375e35,_0x30f641){io['to'](_0x19bee1)[_0xf570('0xd')](_0x375e35,_0x30f641);}function emitChannelQueueInteraction(_0x42a0e0,_0x4ad522,_0x46e6dd,_0xe4d52d,_0x3ed08b,_0x52d724,_0x12dc76,_0x3c689c){var _0x40559e=_['clone'](_0x46e6dd);_0x40559e[_0xf570('0xe')]=_0x3c689c;_0x40559e[_0xf570('0xf')]=_0x4ad522;_0x40559e[_0xf570('0xb')]=_0xe4d52d;_0x40559e['id']=_0x3ed08b;if(_0x52d724){attributes[_0xf570('0x10')](_['capitalize'](_0x42a0e0)+_0xf570('0x11'));_0x12dc76[util[_0xf570('0x12')](_0xf570('0x13'),_0x42a0e0)][_0x3ed08b]=_[_0xf570('0x14')](_0x40559e,attributes);}else{delete _0x12dc76[util[_0xf570('0x12')](_0xf570('0x13'),_0x42a0e0)][_0x3ed08b];}emit(util[_0xf570('0x12')](_0xf570('0x15'),_0x42a0e0,_0x4ad522),util[_0xf570('0x12')](_0xf570('0x16'),_0x42a0e0,_0x52d724?_0xf570('0x17'):'remove'),_[_0xf570('0x14')](_0x40559e,attributes));}var rpc={'openchannelQueueReport':require(_0xf570('0x18')),'mailQueueReport':require(_0xf570('0x19')),'chatQueueReport':require(_0xf570('0x1a')),'smsQueueReport':require(_0xf570('0x1b')),'faxQueueReport':require('../../rpc/faxQueueReport'),'whatsappQueueReport':require(_0xf570('0x1c')),'chatInteraction':require(_0xf570('0x1d')),'faxInteraction':require(_0xf570('0x1e')),'mailInteraction':require('../../rpc/mailInteraction'),'openchannelInteraction':require(_0xf570('0x1f')),'smsInteraction':require(_0xf570('0x20')),'whatsappInteraction':require(_0xf570('0x21'))};var queue=schema({'name':{'type':_0xf570('0x22'),'required':!![],'message':'name\x20is\x20a\x20string\x20and\x20it\x20is\x20required'},'timeout':{'type':_0xf570('0x23'),'message':_0xf570('0x24')}});function startRouting(_0x14fdef,_0x1c9e20,_0x2488bd,_0x570703){if(_0x14fdef&&_0x1c9e20&&_0x2488bd){_0x1c9e20[_0xf570('0x25')]+=0x1;var _0x101d2d={'uniqueid':_0x14fdef,'from':_0x2488bd[_0xf570('0x26')]?_0x2488bd[_0xf570('0x26')]['from']:'','joinAt':moment()[_0xf570('0x12')](_0xf570('0x27')),'ContactId':_0x2488bd[_0xf570('0x28')]?_0x2488bd[_0xf570('0x28')]['id']:null,'ListId':_0x2488bd[_0xf570('0x29')]?_0x2488bd[_0xf570('0x29')]['id']:null};_0x101d2d[_['upperFirst'](_0x2488bd[_0xf570('0x2a')])+_0xf570('0x2b')]=_0x1c9e20['id']||null;_0x101d2d[_[_0xf570('0x2c')](_0x2488bd[_0xf570('0x2a')])+_0xf570('0x11')]=_0x2488bd[_0xf570('0x2d')]?_0x2488bd[_0xf570('0x2d')]['id']:null;_0x101d2d[_[_0xf570('0x2c')](_0x2488bd[_0xf570('0x2a')])+_0xf570('0x2e')]=_0x2488bd[_0xf570('0x2f')]?_0x2488bd[_0xf570('0x2f')]['id']:null;_0x101d2d[_['upperFirst'](_0x2488bd['channel'])+(_0x2488bd[_0xf570('0x2a')]!==_0xf570('0x30')?_0xf570('0x31'):_0xf570('0x32'))]=_0x2488bd[_0xf570('0xb')]?_0x2488bd[_0xf570('0xb')]['id']:null;logger[_0xf570('0x33')](util[_0xf570('0x12')](_0xf570('0x34'),_0x14fdef,_0x1c9e20['name']));emitChannelQueueInteraction(_0x2488bd[_0xf570('0x2a')],_0x1c9e20['name'],_0x101d2d,_0x2488bd[_0xf570('0xb')][_0xf570('0x35')],_0x2488bd[_0xf570('0x2f')]['id'],!![],_0x570703,_0x1c9e20['id']);if(rpc[_0x2488bd['channel']+_0xf570('0x36')]){return rpc[_0x2488bd[_0xf570('0x2a')]+'QueueReport'][_0xf570('0x37')](_0x101d2d)['catch'](function(_0x280daa){logger[_0xf570('0x38')](_0xf570('0x39'),_0x280daa);});}}}function stopRouting(_0x2f21f6,_0x4b0826,_0x481411,_0x17ddf9){if(_0x2f21f6&&_0x4b0826){_0x4b0826[_0xf570('0x25')]-=0x1;var _0x31768d={'leaveAt':moment()[_0xf570('0x12')](_0xf570('0x27')),'acceptAt':moment()['format'](_0xf570('0x27')),'reason':'accepted'};logger['info'](util['format'](_0xf570('0x3a'),_0x2f21f6,_0x4b0826['name']));emitChannelQueueInteraction(_0x481411[_0xf570('0x2a')],_0x4b0826[_0xf570('0x35')],_0x481411['body'],_0x481411['account'][_0xf570('0x35')],_0x481411['message']['id'],![],_0x17ddf9,_0x4b0826['id']);return rpc[_0x481411['channel']+_0xf570('0x3b')]['update'](_0x481411['interaction']['id'],{'queueId':_0x4b0826['id']})['then'](function(){if(rpc[_0x481411[_0xf570('0x2a')]+_0xf570('0x36')]){return rpc[_0x481411[_0xf570('0x2a')]+_0xf570('0x36')][_0xf570('0x3c')](_0x2f21f6,_0x31768d)[_0xf570('0x3d')](function(_0x174669){logger[_0xf570('0x38')](_0xf570('0x3e'),_0x174669);});}});}}function endRouting(_0x38a579,_0x77f74f,_0x30839f,_0x5d298a){if(_0x38a579&&_0x77f74f){_0x77f74f[_0xf570('0x25')]-=0x1;var _0x404d8f={'leaveAt':moment()[_0xf570('0x12')]('YYYY-MM-DD\x20HH:mm:ss'),'exitAt':moment()[_0xf570('0x12')](_0xf570('0x27')),'reason':_0xf570('0x3f')};logger[_0xf570('0x33')](util[_0xf570('0x12')](_0xf570('0x40'),_0x38a579,_0x77f74f[_0xf570('0x35')]));emitChannelQueueInteraction(_0x30839f[_0xf570('0x2a')],_0x77f74f[_0xf570('0x35')],_0x30839f[_0xf570('0x26')],_0x30839f[_0xf570('0xb')][_0xf570('0x35')],_0x30839f[_0xf570('0x2f')]['id'],![],_0x5d298a);if(rpc[_0x30839f['channel']+_0xf570('0x36')]){return rpc[_0x30839f[_0xf570('0x2a')]+'QueueReport'][_0xf570('0x3c')](_0x38a579,_0x404d8f)[_0xf570('0x3d')](function(_0x436689){logger[_0xf570('0x38')](_0xf570('0x3e'),_0x436689);});}}}function handleFindQueue(_0xabf891){return function(_0x4a337){return _0x4a337['name'][_0xf570('0x41')]()===_0xabf891[_0xf570('0x41')]();};}exports[_0xf570('0x42')]=function(_0x441802,_0x101fb6,_0x219f91,_0x5efed0){return function(_0x4a8acf){try{var _0x36a618={'name':_0x101fb6[0x0],'timeout':_0x101fb6[0x1]};var _0xc0af2f=queue[_0xf570('0x0')](_0x36a618,{'typecast':!![]});if(_0xc0af2f[_0xf570('0x43')]){logger['error'](_0xf570('0x44'),_0x441802,_[_0xf570('0x45')](_0xc0af2f,_0xf570('0x2f'))['join'](',\x20'));_0x4a8acf[_0xf570('0x46')]();}else{var _0x548eb0=_[_0xf570('0x47')](_0x219f91[_0x5efed0[_0xf570('0x2a')]+_0xf570('0x48')],handleFindQueue(_0x36a618[_0xf570('0x35')]));if(_0x548eb0){startRouting(_0x441802,_0x548eb0,_0x5efed0,_0x219f91);var _0x22545d=(_0x548eb0[_0xf570('0x3f')]||0xa)*0x3e8;var _0x174a8d=(_0x36a618[_0xf570('0x3f')]||0x14)*0x3e8;var _0x5d0573;if(_0x22545d>_0x174a8d){_0x174a8d=_0x22545d;}var _0x5240eb=seqqueue[_0xf570('0x49')](_0x22545d);_0x5240eb['id']=_0x441802;_0x5240eb['atimeout']=_0x22545d;_0x5240eb[_0xf570('0x4a')]=_0x174a8d;_0x5240eb[_0xf570('0x2a')]=_0x5efed0[_0xf570('0x2a')];_0x219f91[_0xf570('0x4b')][_0x441802]['on'](_0xf570('0x4c'),function(){logger[_0xf570('0x33')](_0xf570('0x4d'),_0x441802);stopRouting(_0x441802,_0x548eb0,_0x5efed0,_0x219f91);clearTimeout(_0x5d0573);_0x5d0573=undefined;_0x5240eb[_0xf570('0x4e')](!![]);if(_0x219f91[_0xf570('0x4b')][_0x441802]){delete _0x219f91['rules'][_0x441802];}_0x4a8acf[_0xf570('0x46')]();});_0x219f91['rules'][_0x441802]['on'](_0xf570('0x4f'),function(){if(_0x219f91[_0xf570('0x4b')][_0x441802]){delete _0x219f91[_0xf570('0x4b')][_0x441802];}});_0x5d0573=setTimeout(function(){logger['info']('[%s][QUEUE]\x20APPLICATION\x20END',_0x441802);endRouting(_0x441802,_0x548eb0,_0x5efed0,_0x219f91);clearTimeout(_0x5d0573);_0x5240eb[_0xf570('0x4e')](!![]);_0x4a8acf['next']();},_0x174a8d);switch(_0x548eb0[_0xf570('0x50')]){case'rrmemory':strategy['rrmemory'](_0x5240eb,_0x548eb0,_0x219f91,_0x5efed0);break;default:strategy[_0xf570('0x51')](_0x5240eb,_0x548eb0,_0x219f91,_0x5efed0);}}else{logger[_0xf570('0x38')](_0xf570('0x52'),_0x441802,_0x36a618[_0xf570('0x35')]);_0x4a8acf[_0xf570('0x46')]();}}}catch(_0x5b93da){logger[_0xf570('0x38')](_0xf570('0x44'),_0x441802,_0x5b93da['stack']);_0x4a8acf[_0xf570('0x46')]();}};}; \ 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 8af3c15..f49da9e 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 _0x7a2c=['squeue','isNil','agents','forcedOwnership','busy','busyQueue','saveWaitingNotification','showNotification','writeLog','RINGING','[%s][AGENT]\x20agent\x20%s\x20is\x20not\x20available','[%s][AGENT]\x20agent\x20skipped,\x20unknown\x20id\x20%s','[%s][AGENT]\x20timeout\x20with\x20%s','hideNotification','removeWaitingNotification','channel','STOP','TIMEOUT','exports','lodash','./util','../../../../../config/logger','routing','notificationId','agent','realtime','handleRun','bind','handleTimeout','timeout','drained','prototype','push','handleDrained','debug','[%s][AGENT]\x20try\x20with\x20%s'];(function(_0x5bf24f,_0x1153ec){var _0x5b3241=function(_0x28da55){while(--_0x28da55){_0x5bf24f['push'](_0x5bf24f['shift']());}};_0x5b3241(++_0x1153ec);}(_0x7a2c,0x17b));var _0xc7a2=function(_0x204655,_0x51ef29){_0x204655=_0x204655-0x0;var _0x27d346=_0x7a2c[_0x204655];return _0x27d346;};'use strict';var _=require(_0xc7a2('0x0'));var uuid=require('uuid');var util=require(_0xc7a2('0x1'));var logger=require(_0xc7a2('0x2'))(_0xc7a2('0x3'));var Agent=function(_0x26fb61,_0x44d702,_0x2abba8,_0x3f2b0d){this[_0xc7a2('0x4')]=uuid['v4']();this['squeue']=_0x26fb61;this[_0xc7a2('0x5')]=_0x44d702;this[_0xc7a2('0x6')]=_0x2abba8;this['routing']=_0x3f2b0d;this['squeue']['push'](this[_0xc7a2('0x7')][_0xc7a2('0x8')](this),this[_0xc7a2('0x9')][_0xc7a2('0x8')](this));this['squeue']['on'](_0xc7a2('0xa'),this[_0xc7a2('0x9')][_0xc7a2('0x8')](this));this['squeue']['on'](_0xc7a2('0xb'),this['handleDrained'][_0xc7a2('0x8')](this));};Agent[_0xc7a2('0xc')][_0xc7a2('0xd')]=function(){this['squeue'][_0xc7a2('0xd')](this[_0xc7a2('0x7')][_0xc7a2('0x8')](this),this['handleTimeout'][_0xc7a2('0x8')](this));};Agent[_0xc7a2('0xc')][_0xc7a2('0xe')]=function(){this[_0xc7a2('0x9')](!![]);};Agent[_0xc7a2('0xc')][_0xc7a2('0x7')]=function(){logger[_0xc7a2('0xf')](_0xc7a2('0x10'),this[_0xc7a2('0x11')]['id'],this[_0xc7a2('0x5')]['id']);if(_[_0xc7a2('0x12')](this[_0xc7a2('0x6')][_0xc7a2('0x13')][this[_0xc7a2('0x5')]['id']])){logger[_0xc7a2('0xf')]('[%s][AGENT]\x20agent\x20skipped,\x20unknown\x20id\x20%s',this[_0xc7a2('0x11')]['id'],this['agent']['id']);setTimeout(this[_0xc7a2('0xd')][_0xc7a2('0x8')](this),0x3e8);}else{if(this[_0xc7a2('0x3')][_0xc7a2('0x14')]||util['isAgentAvailable'](this['squeue']['id'],this[_0xc7a2('0x6')][_0xc7a2('0x13')][this['agent']['id']],this['squeue']['channel'],![])){this[_0xc7a2('0x6')]['agents'][this[_0xc7a2('0x5')]['id']][_0xc7a2('0x15')]=!![];this['realtime'][_0xc7a2('0x13')][this[_0xc7a2('0x5')]['id']][_0xc7a2('0x16')]=undefined;util[_0xc7a2('0x17')](this[_0xc7a2('0x6')],this[_0xc7a2('0x3')],this[_0xc7a2('0x5')],this['squeue']['channel']);util[_0xc7a2('0x18')](this[_0xc7a2('0x4')],this['squeue']['id'],this[_0xc7a2('0x6')][_0xc7a2('0x13')][this[_0xc7a2('0x5')]['id']],null,this[_0xc7a2('0x3')]);util[_0xc7a2('0x19')](this[_0xc7a2('0x11')]['id'],this[_0xc7a2('0x6')][_0xc7a2('0x13')][this['agent']['id']],_0xc7a2('0x1a')+(this['routing'][_0xc7a2('0x14')]?':FORCED':''));}else{logger[_0xc7a2('0xf')](_0xc7a2('0x1b'),this[_0xc7a2('0x11')]['id'],this[_0xc7a2('0x5')]['id']);setTimeout(this['push']['bind'](this),0x3e8);}}};Agent[_0xc7a2('0xc')][_0xc7a2('0x9')]=function(_0x272c6b){if(_[_0xc7a2('0x12')](this[_0xc7a2('0x6')][_0xc7a2('0x13')][this[_0xc7a2('0x5')]['id']])){return logger['debug'](_0xc7a2('0x1c'),this[_0xc7a2('0x11')]['id'],this['agent']['id']);}else{logger[_0xc7a2('0xf')](_0xc7a2('0x1d'),this[_0xc7a2('0x11')]['id'],this['agent']['id']);util[_0xc7a2('0x1e')](this['notificationId'],this[_0xc7a2('0x11')]['id'],this['realtime']['agents'][this[_0xc7a2('0x5')]['id']],null,this['routing']);this['realtime'][_0xc7a2('0x13')][this['agent']['id']][_0xc7a2('0x15')]=![];this['realtime'][_0xc7a2('0x13')][this[_0xc7a2('0x5')]['id']][_0xc7a2('0x16')]=undefined;util[_0xc7a2('0x1f')](this[_0xc7a2('0x6')],this[_0xc7a2('0x3')],this[_0xc7a2('0x5')],this[_0xc7a2('0x11')][_0xc7a2('0x20')]);util[_0xc7a2('0x19')](this['squeue']['id'],this[_0xc7a2('0x6')][_0xc7a2('0x13')][this['agent']['id']],_0x272c6b?_0xc7a2('0x21'):_0xc7a2('0x22'));}if(!_0x272c6b){setTimeout(this[_0xc7a2('0xd')][_0xc7a2('0x8')](this),0x3e8);}};function agent(_0x178c3e,_0x46a665,_0x3a7845,_0x4972a4){return new Agent(_0x178c3e,_0x46a665,_0x3a7845,_0x4972a4);}module[_0xc7a2('0x23')]=agent; \ No newline at end of file +var _0x72b1=['handleRun','debug','[%s][AGENT]\x20try\x20with\x20%s','agents','[%s][AGENT]\x20agent\x20skipped,\x20unknown\x20id\x20%s','forcedOwnership','isAgentAvailable','channel','saveWaitingNotification','showNotification','notificationId','writeLog','RINGING',':FORCED','[%s][AGENT]\x20agent\x20%s\x20is\x20not\x20available','isNil','[%s][AGENT]\x20timeout\x20with\x20%s','hideNotification','busy','busyQueue','removeWaitingNotification','STOP','TIMEOUT','exports','lodash','./util','../../../../../config/logger','routing','squeue','agent','realtime','push','bind','timeout','handleTimeout','drained','handleDrained','prototype'];(function(_0x554391,_0x37c5f1){var _0x497590=function(_0x37725f){while(--_0x37725f){_0x554391['push'](_0x554391['shift']());}};_0x497590(++_0x37c5f1);}(_0x72b1,0x16e));var _0x172b=function(_0x1d617f,_0x6af543){_0x1d617f=_0x1d617f-0x0;var _0x1c93fb=_0x72b1[_0x1d617f];return _0x1c93fb;};'use strict';var _=require(_0x172b('0x0'));var uuid=require('uuid');var util=require(_0x172b('0x1'));var logger=require(_0x172b('0x2'))(_0x172b('0x3'));var Agent=function(_0x18fd16,_0x23bc7a,_0x3fa10d,_0x2c1d6e){this['notificationId']=uuid['v4']();this[_0x172b('0x4')]=_0x18fd16;this[_0x172b('0x5')]=_0x23bc7a;this[_0x172b('0x6')]=_0x3fa10d;this[_0x172b('0x3')]=_0x2c1d6e;this['squeue'][_0x172b('0x7')](this['handleRun'][_0x172b('0x8')](this),this['handleTimeout'][_0x172b('0x8')](this));this[_0x172b('0x4')]['on'](_0x172b('0x9'),this[_0x172b('0xa')]['bind'](this));this[_0x172b('0x4')]['on'](_0x172b('0xb'),this[_0x172b('0xc')][_0x172b('0x8')](this));};Agent[_0x172b('0xd')][_0x172b('0x7')]=function(){this[_0x172b('0x4')]['push'](this[_0x172b('0xe')][_0x172b('0x8')](this),this[_0x172b('0xa')]['bind'](this));};Agent[_0x172b('0xd')]['handleDrained']=function(){this[_0x172b('0xa')](!![]);};Agent[_0x172b('0xd')]['handleRun']=function(){logger[_0x172b('0xf')](_0x172b('0x10'),this[_0x172b('0x4')]['id'],this[_0x172b('0x5')]['id']);if(_['isNil'](this['realtime'][_0x172b('0x11')][this[_0x172b('0x5')]['id']])){logger[_0x172b('0xf')](_0x172b('0x12'),this['squeue']['id'],this['agent']['id']);setTimeout(this[_0x172b('0x7')][_0x172b('0x8')](this),0x3e8);}else{if(this[_0x172b('0x3')][_0x172b('0x13')]||util[_0x172b('0x14')](this['squeue']['id'],this[_0x172b('0x6')][_0x172b('0x11')][this[_0x172b('0x5')]['id']],this[_0x172b('0x4')][_0x172b('0x15')],![])){this[_0x172b('0x6')][_0x172b('0x11')][this['agent']['id']]['busy']=!![];this['realtime']['agents'][this[_0x172b('0x5')]['id']]['busyQueue']=undefined;util[_0x172b('0x16')](this[_0x172b('0x6')],this[_0x172b('0x3')],this[_0x172b('0x5')],this[_0x172b('0x4')][_0x172b('0x15')]);util[_0x172b('0x17')](this[_0x172b('0x18')],this[_0x172b('0x4')]['id'],this['realtime'][_0x172b('0x11')][this[_0x172b('0x5')]['id']],null,this[_0x172b('0x3')]);util[_0x172b('0x19')](this[_0x172b('0x4')]['id'],this[_0x172b('0x6')][_0x172b('0x11')][this['agent']['id']],_0x172b('0x1a')+(this[_0x172b('0x3')]['forcedOwnership']?_0x172b('0x1b'):''));}else{logger[_0x172b('0xf')](_0x172b('0x1c'),this[_0x172b('0x4')]['id'],this[_0x172b('0x5')]['id']);setTimeout(this['push'][_0x172b('0x8')](this),0x3e8);}}};Agent[_0x172b('0xd')]['handleTimeout']=function(_0x5db251){if(_[_0x172b('0x1d')](this[_0x172b('0x6')][_0x172b('0x11')][this[_0x172b('0x5')]['id']])){return logger[_0x172b('0xf')](_0x172b('0x12'),this[_0x172b('0x4')]['id'],this[_0x172b('0x5')]['id']);}else{logger[_0x172b('0xf')](_0x172b('0x1e'),this[_0x172b('0x4')]['id'],this[_0x172b('0x5')]['id']);util[_0x172b('0x1f')](this[_0x172b('0x18')],this[_0x172b('0x4')]['id'],this[_0x172b('0x6')][_0x172b('0x11')][this[_0x172b('0x5')]['id']],null,this[_0x172b('0x3')]);this[_0x172b('0x6')][_0x172b('0x11')][this[_0x172b('0x5')]['id']][_0x172b('0x20')]=![];this[_0x172b('0x6')][_0x172b('0x11')][this['agent']['id']][_0x172b('0x21')]=undefined;util[_0x172b('0x22')](this[_0x172b('0x6')],this['routing'],this[_0x172b('0x5')],this['squeue']['channel']);util['writeLog'](this[_0x172b('0x4')]['id'],this['realtime']['agents'][this[_0x172b('0x5')]['id']],_0x5db251?_0x172b('0x23'):_0x172b('0x24'));}if(!_0x5db251){setTimeout(this['push'][_0x172b('0x8')](this),0x3e8);}};function agent(_0x1f5516,_0x3ff036,_0x3c0e6a,_0x2f3e42){return new Agent(_0x1f5516,_0x3ff036,_0x3c0e6a,_0x2f3e42);}module[_0x172b('0x25')]=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 106692a..760d7f9 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 _0x7e8e=['Agents','length','realtime','debug','[%s][QUEUE]\x20agent\x20skipped,\x20unknown\x20id\x20%s','agents','writeLog','RINGING','busyQueue','name','saveWaitingNotification','channel','[%s][QUEUE]\x20ALL\x20AGENTS\x20ARE\x20BUSY','[%s][QUEUE]\x20EMPTY','hideNotification','STOP','TIMEOUT','busy','removeWaitingNotification','exports','lodash','uuid','./util','../../../../../config/logger','routing','notificationId','squeue','push','handleRun','bind','timeout','handleTimeout','drained','handleDrained','prototype','isNil','queue'];(function(_0x4b2863,_0x494899){var _0x567d67=function(_0x751f03){while(--_0x751f03){_0x4b2863['push'](_0x4b2863['shift']());}};_0x567d67(++_0x494899);}(_0x7e8e,0x161));var _0xe7e8=function(_0x5cfa4f,_0x4d8fe9){_0x5cfa4f=_0x5cfa4f-0x0;var _0x2e5acd=_0x7e8e[_0x5cfa4f];return _0x2e5acd;};'use strict';var _=require(_0xe7e8('0x0'));var uuid=require(_0xe7e8('0x1'));var util=require(_0xe7e8('0x2'));var logger=require(_0xe7e8('0x3'))(_0xe7e8('0x4'));var Beepall=function(_0x14620e,_0x3563d5,_0x41912a,_0x4c9c7d){this[_0xe7e8('0x5')]=uuid['v4']();this[_0xe7e8('0x6')]=_0x14620e;this['queue']=_0x3563d5;this['realtime']=_0x41912a;this[_0xe7e8('0x4')]=_0x4c9c7d;this[_0xe7e8('0x6')][_0xe7e8('0x7')](this[_0xe7e8('0x8')][_0xe7e8('0x9')](this),this['handleTimeout'][_0xe7e8('0x9')](this));this[_0xe7e8('0x6')]['on'](_0xe7e8('0xa'),this[_0xe7e8('0xb')][_0xe7e8('0x9')](this));this[_0xe7e8('0x6')]['on'](_0xe7e8('0xc'),this[_0xe7e8('0xd')][_0xe7e8('0x9')](this));};Beepall['prototype']['push']=function(){this['squeue'][_0xe7e8('0x7')](this[_0xe7e8('0x8')][_0xe7e8('0x9')](this),this[_0xe7e8('0xb')][_0xe7e8('0x9')](this));};Beepall[_0xe7e8('0xe')][_0xe7e8('0xd')]=function(){this[_0xe7e8('0xb')](!![]);};Beepall['prototype'][_0xe7e8('0x8')]=function(){var _0x319d2c=!![];if(!_[_0xe7e8('0xf')](this[_0xe7e8('0x10')])&&!_[_0xe7e8('0xf')](this[_0xe7e8('0x10')][_0xe7e8('0x11')])&&this[_0xe7e8('0x10')][_0xe7e8('0x11')][_0xe7e8('0x12')]>0x0){for(var _0x57d9ad=0x0,_0x175279;_0x57d9ad0x0){for(var _0x370e47=0x0,_0x45b478;_0x370e470x0&&_0x12374b[_0xa2f54e+_0x4f7b('0x22')]>=_0x12374b[_0xa2f54e+'Capacity']){writeLog(_0x41cf36,_0x12374b,_0xa2f54e[_0x4f7b('0x23')]()+'\x20MAXCAPACITY');return![];}}return!![];};exports[_0x4f7b('0x24')]=function(_0x2429be,_0x23c820,_0x278c41,_0x17aa9d,_0x94478b){return sendNotification(!![],_0x2429be,_0x23c820,_0x278c41,_0x17aa9d,_0x94478b);};exports[_0x4f7b('0x25')]=function(_0x3ad769,_0x4ec9a3,_0x6c9626,_0x14e2c2,_0x311675){return sendNotification(![],_0x3ad769,_0x4ec9a3,_0x6c9626,_0x14e2c2,_0x311675);};exports['checkWaitingNotifications']=function(_0x19da29,_0x336739,_0x1db684){var _0x3a56ff=_0x336739[_0x4f7b('0x26')]['UserId'];if(!_0x3a56ff&&_0x1db684){_0x3a56ff=_0x1db684['id'];}var _0xac1f93=_[_0x4f7b('0x27')](_0x19da29[_0x336739[_0x4f7b('0x28')]+'QueuesWaitingInteractions'],function(_0x7de561){var _0x5d13a1=_['capitalize'](_0x336739[_0x4f7b('0x28')])+'InteractionId';return _0x7de561[_0x5d13a1]===_0x336739[_0x4f7b('0x26')]['id'];});if(!_0xac1f93&&_0x3a56ff&&_0x19da29[_0x4f7b('0x29')][_0x3a56ff]){_0xac1f93=_[_0x4f7b('0x27')](_0x19da29[_0x4f7b('0x29')][_0x3a56ff][_0x336739[_0x4f7b('0x28')]+_0x4f7b('0x2a')],function(_0x13a113){return _0x13a113['id']===_0x336739[_0x4f7b('0x26')]['id'];});}return _0xac1f93;};exports[_0x4f7b('0x2b')]=function(_0x557cd6,_0x1c133d,_0x8d3266,_0x3e7fb4){if(_0x8d3266&&_0x8d3266['id']&&_0x557cd6[_0x4f7b('0x29')]&&_0x557cd6[_0x4f7b('0x29')][_0x8d3266['id']]){_0x557cd6[_0x4f7b('0x29')][_0x8d3266['id']][_0x3e7fb4+_0x4f7b('0x2a')][_0x1c133d[_0x4f7b('0x15')]['id']]={'id':_0x1c133d[_0x4f7b('0x26')]['id']};}};exports[_0x4f7b('0x2c')]=function(_0x3cdf6d,_0x172235,_0x56e045,_0x2e7640){if(_0x56e045&&_0x56e045['id']&&_0x3cdf6d['agents']&&_0x3cdf6d[_0x4f7b('0x29')][_0x56e045['id']]){delete _0x3cdf6d[_0x4f7b('0x29')][_0x56e045['id']][_0x2e7640+'WaitingInteractions'][_0x172235[_0x4f7b('0x15')]['id']];}};exports[_0x4f7b('0x2d')]=writeLog; \ No newline at end of file +var _0xd237=['msg','notificationTemplate','I\x20can\x27t\x20render\x20your\x20template','format','message','user:%s','name','emit','notification:%s','remove','debug','isAgentAvailable','busy','online','OFFLINE','PAUSE','hasOwnProperty','Capacity','CurrentCapacity','toUpperCase','\x20MAXCAPACITY','showNotification','hideNotification','checkWaitingNotifications','interaction','UserId','some','channel','QueuesWaitingInteractions','capitalize','InteractionId','agents','WaitingInteractions','removeWaitingNotification','writeLog','lodash','util','../utils','ioredis','../../../../../config/logger','routing','redis','defaults','localhost','split','\x20interaction','account','notificationSound','body','queue'];(function(_0x38a1e5,_0x272e02){var _0x5f4632=function(_0x398e65){while(--_0x398e65){_0x38a1e5['push'](_0x38a1e5['shift']());}};_0x5f4632(++_0x272e02);}(_0xd237,0x14f));var _0x7d23=function(_0x16e195,_0x15c53f){_0x16e195=_0x16e195-0x0;var _0x5f471a=_0xd237[_0x16e195];return _0x5f471a;};'use strict';var _=require(_0x7d23('0x0'));var util=require(_0x7d23('0x1'));var utils=require(_0x7d23('0x2'));var Redis=require(_0x7d23('0x3'));var config=require('../../../../../config/environment');var logger=require(_0x7d23('0x4'))(_0x7d23('0x5'));config[_0x7d23('0x6')]=_[_0x7d23('0x7')](config[_0x7d23('0x6')],{'host':_0x7d23('0x8'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0x7d23('0x6')]));function sendNotification(_0x5e9d09,_0x5ca126,_0x48358f,_0xc43371,_0x42c334,_0x6ce28d){var _0x3953dc=_0x6ce28d||{};var _0x18cb1f=_0x48358f[_0x7d23('0x9')]('.');var _0x27dbb2={'uniqueid':_0x5ca126,'channel':_0x18cb1f[0x0],'id':_0x18cb1f[0x1],'title':_0x18cb1f[0x0]+_0x7d23('0xa'),'interactionId':_0x18cb1f[0x2],'queue':_0x42c334?_0x42c334['name']:null,'sound':_0x3953dc[_0x7d23('0xb')][_0x7d23('0xc')],'shake':_0x3953dc[_0x7d23('0xb')]['notificationShake']};try{if(!_0x3953dc[_0x7d23('0xd')]){_0x3953dc['body']={};}if(_0x42c334){_0x3953dc[_0x7d23('0xd')][_0x7d23('0xe')]=_0x42c334;}else if(_0x3953dc[_0x7d23('0xd')][_0x7d23('0xe')]){delete _0x3953dc[_0x7d23('0xd')][_0x7d23('0xe')];}_0x27dbb2[_0x7d23('0xf')]=utils['getMustacheRender'](_0x3953dc['account'][_0x7d23('0x10')],_0x3953dc);}catch(_0xf1db40){_0x27dbb2[_0x7d23('0xf')]=_0x7d23('0x11');logger['error'](util[_0x7d23('0x12')]('[%s][QUEUE]\x20%s',_0x5ca126,_0xf1db40[_0x7d23('0x13')]));}io['to'](util['format'](_0x7d23('0x14'),_0xc43371[_0x7d23('0x15')]))[_0x7d23('0x16')](util[_0x7d23('0x12')](_0x7d23('0x17'),_0x5e9d09?'save':_0x7d23('0x18')),_0x27dbb2);}function writeLog(_0x3d6a7b,_0x49ce32,_0x1a65e8){return logger[_0x7d23('0x19')](util[_0x7d23('0x12')]('[%s][QUEUE][AGENT:%s][STATUS:%s]',_0x3d6a7b,_0x49ce32['name'],_0x1a65e8));}exports[_0x7d23('0x1a')]=function(_0x3b7005,_0x56b0ba,_0x427637,_0x563e75){if(_0x56b0ba[_0x7d23('0x1b')]){writeLog(_0x3b7005,_0x56b0ba,'BUSY');return![];}if(!_0x56b0ba[_0x7d23('0x1c')]){writeLog(_0x3b7005,_0x56b0ba,_0x7d23('0x1d'));return![];}if(_0x56b0ba[_0x427637+'Pause']){writeLog(_0x3b7005,_0x56b0ba,_0x7d23('0x1e'));return![];}if(_0x563e75&&_0x56b0ba[_0x7d23('0x1f')](_0x427637+_0x7d23('0x20'))&&_0x56b0ba['hasOwnProperty'](_0x427637+_0x7d23('0x21'))){if(_0x56b0ba[_0x427637+'Capacity']>0x0&&_0x56b0ba[_0x427637+_0x7d23('0x21')]>=_0x56b0ba[_0x427637+_0x7d23('0x20')]){writeLog(_0x3b7005,_0x56b0ba,_0x427637[_0x7d23('0x22')]()+_0x7d23('0x23'));return![];}}return!![];};exports[_0x7d23('0x24')]=function(_0x4773ec,_0xdef075,_0x4196c7,_0x1d79b2,_0x33cf07){return sendNotification(!![],_0x4773ec,_0xdef075,_0x4196c7,_0x1d79b2,_0x33cf07);};exports[_0x7d23('0x25')]=function(_0x5a9295,_0x220275,_0x1ee7c2,_0x38c5aa,_0x190aff){return sendNotification(![],_0x5a9295,_0x220275,_0x1ee7c2,_0x38c5aa,_0x190aff);};exports[_0x7d23('0x26')]=function(_0x289be5,_0x15e64d,_0xc61f31){var _0x4808f2=_0x15e64d[_0x7d23('0x27')][_0x7d23('0x28')];if(!_0x4808f2&&_0xc61f31){_0x4808f2=_0xc61f31['id'];}var _0x4a5136=_[_0x7d23('0x29')](_0x289be5[_0x15e64d[_0x7d23('0x2a')]+_0x7d23('0x2b')],function(_0x4b1c92){var _0x1bf70a=_[_0x7d23('0x2c')](_0x15e64d[_0x7d23('0x2a')])+_0x7d23('0x2d');return _0x4b1c92[_0x1bf70a]===_0x15e64d[_0x7d23('0x27')]['id'];});if(!_0x4a5136&&_0x4808f2&&_0x289be5[_0x7d23('0x2e')][_0x4808f2]){_0x4a5136=_['some'](_0x289be5[_0x7d23('0x2e')][_0x4808f2][_0x15e64d[_0x7d23('0x2a')]+_0x7d23('0x2f')],function(_0x336feb){return _0x336feb['id']===_0x15e64d[_0x7d23('0x27')]['id'];});}return _0x4a5136;};exports['saveWaitingNotification']=function(_0x2f8011,_0x126a48,_0x5d4545,_0x36fdf4){if(_0x5d4545&&_0x5d4545['id']&&_0x2f8011[_0x7d23('0x2e')]&&_0x2f8011[_0x7d23('0x2e')][_0x5d4545['id']]){_0x2f8011['agents'][_0x5d4545['id']][_0x36fdf4+_0x7d23('0x2f')][_0x126a48[_0x7d23('0x13')]['id']]={'id':_0x126a48['interaction']['id']};}};exports[_0x7d23('0x30')]=function(_0x341398,_0x3959b3,_0x121ee2,_0x19efd7){if(_0x121ee2&&_0x121ee2['id']&&_0x341398['agents']&&_0x341398[_0x7d23('0x2e')][_0x121ee2['id']]){delete _0x341398[_0x7d23('0x2e')][_0x121ee2['id']][_0x19efd7+'WaitingInteractions'][_0x3959b3[_0x7d23('0x13')]['id']];}};exports[_0x7d23('0x31')]=writeLog; \ No newline at end of file diff --git a/server/services/routing/server/applications/system.js b/server/services/routing/server/applications/system.js index e559e78..197d69b 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 _0x59e0=['routing','string','command\x20is\x20a\x20string\x20and\x20it\x20is\x20required','consequence','validate','length','error','map','message','join','info','[%s][SYSTEM]\x20no\x20command\x20executed,\x20force\x20next','next','getMustacheRender','[%s][SYSTEM]\x20commnad:\x20%s','trim','replace','isEmpty','[%s][SYSTEM]\x20no\x20variable','body','[%s][SYSTEM]\x20set\x20variable\x20%s:\x20%s','[%s][SYSTEM]\x20%s','isObject','stringify','shelljs','lodash','./utils','../../../../config/logger'];(function(_0x3207a7,_0x123be8){var _0x2ce53d=function(_0x1db23e){while(--_0x1db23e){_0x3207a7['push'](_0x3207a7['shift']());}};_0x2ce53d(++_0x123be8);}(_0x59e0,0x1f4));var _0x059e=function(_0x27ea17,_0x17eec0){_0x27ea17=_0x27ea17-0x0;var _0xc76b37=_0x59e0[_0x27ea17];return _0xc76b37;};'use strict';var schema=require('validate');var sh=require(_0x059e('0x0'));var _=require(_0x059e('0x1'));var utils=require(_0x059e('0x2'));var logger=require(_0x059e('0x3'))(_0x059e('0x4'));var system=schema({'command':{'type':_0x059e('0x5'),'required':!![],'message':_0x059e('0x6')}});exports[_0x059e('0x7')]=function(_0x227705,_0x1d0ef9){return function(_0x2b920c){try{var _0x1ce502={'command':_0x1d0ef9[0x0]};var _0x4a4a89=system[_0x059e('0x8')](_0x1ce502,{'typecast':!![]});if(_0x4a4a89[_0x059e('0x9')]){logger[_0x059e('0xa')]('[%s][SYSTEM]\x20%s',_0x227705,_[_0x059e('0xb')](_0x4a4a89,_0x059e('0xc'))[_0x059e('0xd')](',\x20'));logger[_0x059e('0xe')](_0x059e('0xf'),_0x227705);_0x2b920c[_0x059e('0x10')]();}else{var _0x1ad0d7=this;var _0x20be01=utils[_0x059e('0x11')](_0x1d0ef9[0x0],this);logger[_0x059e('0xe')](_0x059e('0x12'),_0x227705,_0x20be01);sh['exec'](_[_0x059e('0x13')](_0x20be01),function(_0x317948,_0x2cd29c){logger[_0x059e('0xe')]('[%s][SYSTEM]\x20result\x20code:\x20%s',_0x227705,_0x317948);if(_0x317948==0x0){var _0x5e1bc5=_0x2cd29c[_0x059e('0x14')](/(\r\n|\n|\r)/gm,'');if(_['isNil'](_0x1d0ef9[0x1])||_[_0x059e('0x15')](_0x1d0ef9[0x1])){logger['info'](_0x059e('0x16'),_0x227705);_0x1ad0d7[_0x059e('0x17')][_0x1d0ef9[0x1]]=_0x5e1bc5;}else{logger[_0x059e('0xe')](_0x059e('0x18'),_0x227705,_0x1d0ef9[0x1],_0x5e1bc5);_0x1ad0d7[_0x059e('0x17')][_0x1d0ef9[0x1]]=_0x5e1bc5;}}_0x2b920c[_0x059e('0x10')]();});}}catch(_0x2ebc72){logger['error'](_0x059e('0x19'),_0x227705,_[_0x059e('0x1a')](_0x2ebc72)?JSON[_0x059e('0x1b')](_0x2ebc72):_0x2ebc72);logger['info']('[%s][SYSTEM]\x20no\x20command\x20executed,\x20force\x20next',_0x227705);_0x2b920c['next']();}};}; \ No newline at end of file +var _0x541f=['length','error','[%s][SYSTEM]\x20%s','map','message','[%s][SYSTEM]\x20no\x20command\x20executed,\x20force\x20next','next','getMustacheRender','info','[%s][SYSTEM]\x20commnad:\x20%s','exec','trim','[%s][SYSTEM]\x20result\x20code:\x20%s','replace','isNil','body','[%s][SYSTEM]\x20set\x20variable\x20%s:\x20%s','stringify','shelljs','./utils','../../../../config/logger','string','consequence','validate'];(function(_0x389e63,_0xe460d3){var _0x14ddc8=function(_0x36a401){while(--_0x36a401){_0x389e63['push'](_0x389e63['shift']());}};_0x14ddc8(++_0xe460d3);}(_0x541f,0x1f2));var _0xf541=function(_0x2fc012,_0x503e5b){_0x2fc012=_0x2fc012-0x0;var _0x2891f9=_0x541f[_0x2fc012];return _0x2891f9;};'use strict';var schema=require('validate');var sh=require(_0xf541('0x0'));var _=require('lodash');var utils=require(_0xf541('0x1'));var logger=require(_0xf541('0x2'))('routing');var system=schema({'command':{'type':_0xf541('0x3'),'required':!![],'message':'command\x20is\x20a\x20string\x20and\x20it\x20is\x20required'}});exports[_0xf541('0x4')]=function(_0x27194e,_0x555915){return function(_0x2d5d04){try{var _0x1e9379={'command':_0x555915[0x0]};var _0x1b75d7=system[_0xf541('0x5')](_0x1e9379,{'typecast':!![]});if(_0x1b75d7[_0xf541('0x6')]){logger[_0xf541('0x7')](_0xf541('0x8'),_0x27194e,_[_0xf541('0x9')](_0x1b75d7,_0xf541('0xa'))['join'](',\x20'));logger['info'](_0xf541('0xb'),_0x27194e);_0x2d5d04[_0xf541('0xc')]();}else{var _0x438c44=this;var _0x241bdc=utils[_0xf541('0xd')](_0x555915[0x0],this);logger[_0xf541('0xe')](_0xf541('0xf'),_0x27194e,_0x241bdc);sh[_0xf541('0x10')](_[_0xf541('0x11')](_0x241bdc),function(_0x4fdbfd,_0x307fe9){logger[_0xf541('0xe')](_0xf541('0x12'),_0x27194e,_0x4fdbfd);if(_0x4fdbfd==0x0){var _0x34dd66=_0x307fe9[_0xf541('0x13')](/(\r\n|\n|\r)/gm,'');if(_[_0xf541('0x14')](_0x555915[0x1])||_['isEmpty'](_0x555915[0x1])){logger['info']('[%s][SYSTEM]\x20no\x20variable',_0x27194e);_0x438c44[_0xf541('0x15')][_0x555915[0x1]]=_0x34dd66;}else{logger[_0xf541('0xe')](_0xf541('0x16'),_0x27194e,_0x555915[0x1],_0x34dd66);_0x438c44[_0xf541('0x15')][_0x555915[0x1]]=_0x34dd66;}}_0x2d5d04['next']();});}}catch(_0x248533){logger[_0xf541('0x7')]('[%s][SYSTEM]\x20%s',_0x27194e,_['isObject'](_0x248533)?JSON[_0xf541('0x17')](_0x248533):_0x248533);logger[_0xf541('0xe')]('[%s][SYSTEM]\x20no\x20command\x20executed,\x20force\x20next',_0x27194e);_0x2d5d04[_0xf541('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 875f3e0..540d367 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 _0xd312=['finally','next','isObject','stringify','validate','lodash','../../rpc/chatInteraction','../../rpc/openchannelInteraction','../../rpc/smsInteraction','../../rpc/mailInteraction','../../rpc/faxInteraction','../../../../config/logger','routing','TagId\x20is\x20a\x20string\x20and\x20it\x20is\x20required','length','[%s][TAG]\x20%s','message','join','info','channel','addTags','then','interaction','catch','error','[%s][TAG]\x20no\x20tags\x20saved,\x20force\x20next'];(function(_0x4d35f3,_0x19ba66){var _0x382fea=function(_0x2c2390){while(--_0x2c2390){_0x4d35f3['push'](_0x4d35f3['shift']());}};_0x382fea(++_0x19ba66);}(_0xd312,0xee));var _0x2d31=function(_0x486735,_0x3546af){_0x486735=_0x486735-0x0;var _0x586ab2=_0xd312[_0x486735];return _0x586ab2;};'use strict';var schema=require(_0x2d31('0x0'));var _=require(_0x2d31('0x1'));var rpc={'chatInteraction':require(_0x2d31('0x2')),'openchannelInteraction':require(_0x2d31('0x3')),'smsInteraction':require(_0x2d31('0x4')),'mailInteraction':require(_0x2d31('0x5')),'faxInteraction':require(_0x2d31('0x6')),'whatsappInteraction':require('../../rpc/whatsappInteraction')};var logger=require(_0x2d31('0x7'))(_0x2d31('0x8'));var tag=schema({'tag':{'type':'number','required':!![],'message':_0x2d31('0x9')}});exports['consequence']=function(_0x3f9b0f,_0x26b009,_0x4062e7,_0x55261f){return function(_0x5142b2){try{var _0x5b0f04={'tag':_0x26b009[0x0]};var _0x3149b4=tag[_0x2d31('0x0')](_0x5b0f04,{'typecast':!![]});if(_0x3149b4[_0x2d31('0xa')]){logger['error'](_0x2d31('0xb'),_0x3f9b0f,_['map'](_0x3149b4,_0x2d31('0xc'))[_0x2d31('0xd')](',\x20'));logger[_0x2d31('0xe')]('[%s][TAG]\x20no\x20tags\x20saved,\x20force\x20next',_0x3f9b0f);_0x5142b2['next']();}else{var _0x3316e9={'ids':[_0x26b009[0x0]]};if(rpc[_0x55261f[_0x2d31('0xf')]+'Interaction']){rpc[_0x55261f[_0x2d31('0xf')]+'Interaction'][_0x2d31('0x10')](_0x55261f['interaction']['id'],_0x3316e9)[_0x2d31('0x11')](function(_0x53ed7d){logger['info']('[%s][TAG]\x20tag\x20\x22%s\x22\x20added\x20to\x20%s\x20interaction\x20%s',_0x3f9b0f,_0x26b009[0x1],_0x55261f['channel'],_0x55261f[_0x2d31('0x12')]['id']);})[_0x2d31('0x13')](function(_0x5253af){logger[_0x2d31('0x14')](_0x2d31('0xb'),_0x3f9b0f,JSON['stringify'](_0x5253af));logger[_0x2d31('0xe')](_0x2d31('0x15'),_0x3f9b0f);})[_0x2d31('0x16')](function(){_0x5142b2[_0x2d31('0x17')]();});}}}catch(_0x4de6d7){logger[_0x2d31('0x14')](_0x2d31('0xb'),_0x3f9b0f,_[_0x2d31('0x18')](_0x4de6d7)?JSON[_0x2d31('0x19')](_0x4de6d7):_0x4de6d7);logger[_0x2d31('0xe')](_0x2d31('0x15'),_0x3f9b0f);_0x5142b2[_0x2d31('0x17')]();}};}; \ No newline at end of file +var _0x1fd2=['message','next','channel','Interaction','addTags','then','info','[%s][TAG]\x20tag\x20\x22%s\x22\x20added\x20to\x20%s\x20interaction\x20%s','catch','[%s][TAG]\x20%s','stringify','[%s][TAG]\x20no\x20tags\x20saved,\x20force\x20next','finally','isObject','validate','lodash','../../rpc/chatInteraction','../../rpc/openchannelInteraction','../../rpc/smsInteraction','../../rpc/mailInteraction','routing','number','TagId\x20is\x20a\x20string\x20and\x20it\x20is\x20required','length','error','map'];(function(_0x159b4d,_0x1f2b3c){var _0x52b735=function(_0x431a31){while(--_0x431a31){_0x159b4d['push'](_0x159b4d['shift']());}};_0x52b735(++_0x1f2b3c);}(_0x1fd2,0x194));var _0x21fd=function(_0x3893b2,_0x2f8e75){_0x3893b2=_0x3893b2-0x0;var _0x1cb000=_0x1fd2[_0x3893b2];return _0x1cb000;};'use strict';var schema=require(_0x21fd('0x0'));var _=require(_0x21fd('0x1'));var rpc={'chatInteraction':require(_0x21fd('0x2')),'openchannelInteraction':require(_0x21fd('0x3')),'smsInteraction':require(_0x21fd('0x4')),'mailInteraction':require(_0x21fd('0x5')),'faxInteraction':require('../../rpc/faxInteraction'),'whatsappInteraction':require('../../rpc/whatsappInteraction')};var logger=require('../../../../config/logger')(_0x21fd('0x6'));var tag=schema({'tag':{'type':_0x21fd('0x7'),'required':!![],'message':_0x21fd('0x8')}});exports['consequence']=function(_0x4f89bb,_0x3f2457,_0x15d050,_0x1d8c40){return function(_0x3c452c){try{var _0x48e24d={'tag':_0x3f2457[0x0]};var _0x29a5d3=tag[_0x21fd('0x0')](_0x48e24d,{'typecast':!![]});if(_0x29a5d3[_0x21fd('0x9')]){logger[_0x21fd('0xa')]('[%s][TAG]\x20%s',_0x4f89bb,_[_0x21fd('0xb')](_0x29a5d3,_0x21fd('0xc'))['join'](',\x20'));logger['info']('[%s][TAG]\x20no\x20tags\x20saved,\x20force\x20next',_0x4f89bb);_0x3c452c[_0x21fd('0xd')]();}else{var _0xf4be5f={'ids':[_0x3f2457[0x0]]};if(rpc[_0x1d8c40[_0x21fd('0xe')]+_0x21fd('0xf')]){rpc[_0x1d8c40[_0x21fd('0xe')]+_0x21fd('0xf')][_0x21fd('0x10')](_0x1d8c40['interaction']['id'],_0xf4be5f)[_0x21fd('0x11')](function(_0x236df4){logger[_0x21fd('0x12')](_0x21fd('0x13'),_0x4f89bb,_0x3f2457[0x1],_0x1d8c40[_0x21fd('0xe')],_0x1d8c40['interaction']['id']);})[_0x21fd('0x14')](function(_0x1c8dae){logger[_0x21fd('0xa')](_0x21fd('0x15'),_0x4f89bb,JSON[_0x21fd('0x16')](_0x1c8dae));logger['info'](_0x21fd('0x17'),_0x4f89bb);})[_0x21fd('0x18')](function(){_0x3c452c[_0x21fd('0xd')]();});}}}catch(_0x34dbca){logger[_0x21fd('0xa')](_0x21fd('0x15'),_0x4f89bb,_[_0x21fd('0x19')](_0x34dbca)?JSON['stringify'](_0x34dbca):_0x34dbca);logger[_0x21fd('0x12')](_0x21fd('0x17'),_0x4f89bb);_0x3c452c[_0x21fd('0xd')]();}};}; \ 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 0f06e48..4f707f0 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 _0xcd6e=['stop','catch','error','[%s][TVOX]\x20%s','[%s][TVOX]\x20Application\x20already\x20executed\x20for\x20the\x20current\x20session,\x20force\x20next','next','request-promise','../../../../config/logger','routing','lodash','\x20-\x20','replace','includes','urlOnAnswer','?params=','jsonrpc','2.0','login','push','then','parse','result','logged','&sessionId=','&data=','stringify','info','[%s][TVOX]\x20Request\x20sent\x20to\x20TVox:\x20%s'];(function(_0x513aa5,_0x1fba79){var _0x1a1a7c=function(_0x240e3f){while(--_0x240e3f){_0x513aa5['push'](_0x513aa5['shift']());}};_0x1a1a7c(++_0x1fba79);}(_0xcd6e,0xe6));var _0xecd6=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xcd6e[_0x3dd15e];return _0x231fd0;};'use strict';var rp=require(_0xecd6('0x0'));var logger=require(_0xecd6('0x1'))(_0xecd6('0x2'));var _=require(_0xecd6('0x3'));var arr=[];exports['consequence']=function(_0x2e4f20,_0x1d7cab){return function(_0x22ab7a){var _0x16a92c=_0x1d7cab[0xa];var _0x33e8b8=_0x1d7cab[0xb];var _0x59fe0f=_0x1d7cab[0xc];var _0xa19139=_0x1d7cab[0xd];var _0x64fa92=_0x1d7cab[0xe];var _0x2512af=_0x1d7cab[0xf]['replace'](/\n/g,_0xecd6('0x4'));var _0x22151f=_0x1d7cab[0x10][_0xecd6('0x5')](/\n/g,'\x20');if(!arr[_0xecd6('0x6')](_0x33e8b8)){arr['push'](_0x33e8b8);var _0x4f5f2f=_0x1d7cab[0x3];var _0x5b8fa6=_0x1d7cab[0x4];var _0x2d4bb2=_0x1d7cab[0x1];var _0x4a3c5c=_0x1d7cab[0x0];var _0x571bb8={};_0x571bb8[_0xecd6('0x7')]=_0x1d7cab[0x8]+_0xecd6('0x8')+_0x59fe0f+'|'+_0x16a92c+'|'+_0xa19139+'|'+_0x33e8b8+'|'+_0x64fa92;_0x571bb8['urlOnRing']=_0x1d7cab[0x7]+_0xecd6('0x8')+_0x59fe0f+'|'+_0x16a92c+'|'+_0xa19139+'|'+_0x33e8b8+'|'+_0x64fa92+'|'+_0x2512af+'|'+_0x22151f;_0x571bb8['title']=_0x1d7cab[0x9];var _0x592da2={};_0x592da2[_0xecd6('0x9')]=_0xecd6('0xa');_0x592da2['method']=_0xecd6('0xb');var _0x522120=[];_0x522120[_0xecd6('0xc')](_0x1d7cab[0x2]);_0x522120[_0xecd6('0xc')](_0x1d7cab[0x5]);_0x522120['push'](_0x1d7cab[0x6]);_0x592da2['params']=_0x522120;_0x592da2['id']=0x1;var _0x2799c7=JSON['stringify'](_0x592da2);var _0x14d004={'encoding':'utf8','method':'POST','timeout':0x2710,'url':_0x4f5f2f,'headers':{'Content-Type':'application/json-rpc'},'body':_0x2799c7};return rp(_0x14d004)[_0xecd6('0xd')](function(_0x4b560f){const _0x583f7f=JSON[_0xecd6('0xe')](_0x4b560f);if(!_0x583f7f[_0xecd6('0xf')][_0xecd6('0x10')]){throw new Error('Unable\x20to\x20login\x20with\x20TVox\x20application');}var _0xf863ff=_0x33e8b8;var _0x5469a3='channelId='+_0x2d4bb2+'&serviceId='+_0x4a3c5c+_0xecd6('0x11')+_0xf863ff+_0xecd6('0x12')+JSON[_0xecd6('0x13')](_0x571bb8);var _0x1209ea=_0x5b8fa6+'?'+_0x5469a3;return rp(_0x1209ea);})['then'](function(_0x30a42b){logger[_0xecd6('0x14')](_0xecd6('0x15'),_0x2e4f20,_0x30a42b);_0x22ab7a[_0xecd6('0x16')]();})[_0xecd6('0x17')](function(_0x70ed1b){logger[_0xecd6('0x18')](_0xecd6('0x19'),_0x2e4f20,_['isObject'](_0x70ed1b)?JSON[_0xecd6('0x13')](_0x70ed1b):_0x70ed1b);_0x22ab7a[_0xecd6('0x16')]();});}else{logger[_0xecd6('0x14')](_0xecd6('0x1a'),_0x2e4f20);_0x22ab7a[_0xecd6('0x1b')]();}};}; \ No newline at end of file +var _0xd43f=['login','push','params','utf8','POST','application/json-rpc','then','parse','logged','Unable\x20to\x20login\x20with\x20TVox\x20application','channelId=','&serviceId=','&sessionId=','&data=','stringify','info','[%s][TVOX]\x20Request\x20sent\x20to\x20TVox:\x20%s','stop','catch','[%s][TVOX]\x20%s','isObject','request-promise','routing','lodash','consequence','replace','\x20-\x20','includes','urlOnAnswer','?params=','urlOnRing','jsonrpc','2.0','method'];(function(_0x5bd426,_0x4878e5){var _0x23a7eb=function(_0x594b42){while(--_0x594b42){_0x5bd426['push'](_0x5bd426['shift']());}};_0x23a7eb(++_0x4878e5);}(_0xd43f,0x1f1));var _0xfd43=function(_0x22ba6,_0x18dc12){_0x22ba6=_0x22ba6-0x0;var _0x4dca2e=_0xd43f[_0x22ba6];return _0x4dca2e;};'use strict';var rp=require(_0xfd43('0x0'));var logger=require('../../../../config/logger')(_0xfd43('0x1'));var _=require(_0xfd43('0x2'));var arr=[];exports[_0xfd43('0x3')]=function(_0x5d526e,_0x517cd4){return function(_0xc9853b){var _0x5d1999=_0x517cd4[0xa];var _0x269986=_0x517cd4[0xb];var _0x295a99=_0x517cd4[0xc];var _0x2d898a=_0x517cd4[0xd];var _0x529a5f=_0x517cd4[0xe];var _0x350292=_0x517cd4[0xf][_0xfd43('0x4')](/\n/g,_0xfd43('0x5'));var _0x2662b9=_0x517cd4[0x10][_0xfd43('0x4')](/\n/g,'\x20');if(!arr[_0xfd43('0x6')](_0x269986)){arr['push'](_0x269986);var _0x222680=_0x517cd4[0x3];var _0x4c97b2=_0x517cd4[0x4];var _0x1471fc=_0x517cd4[0x1];var _0x113267=_0x517cd4[0x0];var _0x2a5505={};_0x2a5505[_0xfd43('0x7')]=_0x517cd4[0x8]+_0xfd43('0x8')+_0x295a99+'|'+_0x5d1999+'|'+_0x2d898a+'|'+_0x269986+'|'+_0x529a5f;_0x2a5505[_0xfd43('0x9')]=_0x517cd4[0x7]+'?params='+_0x295a99+'|'+_0x5d1999+'|'+_0x2d898a+'|'+_0x269986+'|'+_0x529a5f+'|'+_0x350292+'|'+_0x2662b9;_0x2a5505['title']=_0x517cd4[0x9];var _0x4a4efb={};_0x4a4efb[_0xfd43('0xa')]=_0xfd43('0xb');_0x4a4efb[_0xfd43('0xc')]=_0xfd43('0xd');var _0x251dd3=[];_0x251dd3[_0xfd43('0xe')](_0x517cd4[0x2]);_0x251dd3['push'](_0x517cd4[0x5]);_0x251dd3[_0xfd43('0xe')](_0x517cd4[0x6]);_0x4a4efb[_0xfd43('0xf')]=_0x251dd3;_0x4a4efb['id']=0x1;var _0x45896e=JSON['stringify'](_0x4a4efb);var _0x244957={'encoding':_0xfd43('0x10'),'method':_0xfd43('0x11'),'timeout':0x2710,'url':_0x222680,'headers':{'Content-Type':_0xfd43('0x12')},'body':_0x45896e};return rp(_0x244957)[_0xfd43('0x13')](function(_0x3c952f){const _0x57bbf0=JSON[_0xfd43('0x14')](_0x3c952f);if(!_0x57bbf0['result'][_0xfd43('0x15')]){throw new Error(_0xfd43('0x16'));}var _0x243bd9=_0x269986;var _0x12fd2b=_0xfd43('0x17')+_0x1471fc+_0xfd43('0x18')+_0x113267+_0xfd43('0x19')+_0x243bd9+_0xfd43('0x1a')+JSON[_0xfd43('0x1b')](_0x2a5505);var _0x10f8a5=_0x4c97b2+'?'+_0x12fd2b;return rp(_0x10f8a5);})['then'](function(_0x4c3510){logger[_0xfd43('0x1c')](_0xfd43('0x1d'),_0x5d526e,_0x4c3510);_0xc9853b[_0xfd43('0x1e')]();})[_0xfd43('0x1f')](function(_0x36e5e0){logger['error'](_0xfd43('0x20'),_0x5d526e,_[_0xfd43('0x21')](_0x36e5e0)?JSON[_0xfd43('0x1b')](_0x36e5e0):_0x36e5e0);_0xc9853b[_0xfd43('0x1e')]();});}else{logger[_0xfd43('0x1c')]('[%s][TVOX]\x20Application\x20already\x20executed\x20for\x20the\x20current\x20session,\x20force\x20next',_0x5d526e);_0xc9853b['next']();}};}; \ 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 98eb3d0..79b1a68 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(_0x4d62c7,_0x16b698){var _0x328b31=function(_0x2e66bb){while(--_0x2e66bb){_0x4d62c7['push'](_0x4d62c7['shift']());}};_0x328b31(++_0x16b698);}(_0xa9e0,0x123));var _0x0a9e=function(_0x311c35,_0x534915){_0x311c35=_0x311c35-0x0;var _0x5cc50c=_0xa9e0[_0x311c35];return _0x5cc50c;};'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 _0xe706=['exports','render','merge','body','contact','message','account','interaction','list','mustache','lodash'];(function(_0x248289,_0x500df1){var _0x52a426=function(_0x334d6){while(--_0x334d6){_0x248289['push'](_0x248289['shift']());}};_0x52a426(++_0x500df1);}(_0xe706,0xa3));var _0x6e70=function(_0x572ee8,_0x24ea07){_0x572ee8=_0x572ee8-0x0;var _0xb87b08=_0xe706[_0x572ee8];return _0xb87b08;};'use strict';var Mustache=require(_0x6e70('0x0'));var _=require(_0x6e70('0x1'));module[_0x6e70('0x2')]={'getMustacheRender':function(_0x5e8446,_0x2cae77){return Mustache[_0x6e70('0x3')](_0x5e8446,_[_0x6e70('0x4')](_0x2cae77[_0x6e70('0x5')],{'contact':_0x2cae77[_0x6e70('0x6')],'message':_0x2cae77[_0x6e70('0x7')],'account':_0x2cae77[_0x6e70('0x8')],'interaction':_0x2cae77[_0x6e70('0x9')],'list':_0x2cae77[_0x6e70('0xa')]}))||'';}}; \ No newline at end of file diff --git a/server/services/routing/server/index.js b/server/services/routing/server/index.js index 9be281b..9147781 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 _0x3189=['jayson/promise','bluebird','./applications/utils','./applications/strategy/util','routing','../rpc/openchannelQueueReport','../rpc/mailQueueReport','../rpc/chatQueueReport','../rpc/smsQueueReport','../rpc/faxQueueReport','../lib/rule-engine','format','isNil','IntervalId','Intervals','map','interval','rules','channel','message','checkWaitingNotifications','transfer','applications','length','existsSync','join','app','toLowerCase','autoreply','appdata','mail','push','slice','split','dialogflowv2','amazonlex','tag','tvox','notificationTemplate','interaction','ChatWebsiteId','ContactId','body','%s:%s:%s','./interval','condition','intervals','./applications/','consequence','priority','info','Push\x20new\x20rule','on\x20interval','\x20|\x20','error','Please\x20create\x20a\x20new\x20file\x20under','.js','execute','Applications\x20executed','matchPath','emit','complete','Skipped\x20routing\x20for\x20%s','stack','routing\x20is\x20empty','agent','agents','busy','busyQueue','end','QueueReport','update','UserId','error\x20update\x20queue\x20report','message\x20is\x20empty','hasOwnProperty','capacity','CurrentCapacity','values','chatQueues','available','paused','waiting','mailQueues','loggedIn','name','openchannelQueues','smsQueues','faxQueues','whatsappQueues','chatQueuesWaitingInteractions','mailQueuesWaitingInteractions','openchannelQueuesWaitingInteractions','smsQueuesWaitingInteractions','faxQueuesWaitingInteractions','whatsappQueuesWaitingInteractions','http','stringify','127.0.0.1','log','RPC\x20listening\x20on\x20port:','lodash','path'];(function(_0x3b3d5f,_0x31fdc4){var _0x227dad=function(_0x2739a6){while(--_0x2739a6){_0x3b3d5f['push'](_0x3b3d5f['shift']());}};_0x227dad(++_0x31fdc4);}(_0x3189,0x19a));var _0x9318=function(_0x39a031,_0x2dc4e4){_0x39a031=_0x39a031-0x0;var _0x3a5988=_0x3189[_0x39a031];return _0x3a5988;};'use strict';var _=require(_0x9318('0x0'));var util=require('util');var path=require(_0x9318('0x1'));var fs=require('fs');var jayson=require(_0x9318('0x2'));var BPromise=require(_0x9318('0x3'));var utils=require(_0x9318('0x4'));var sUtils=require(_0x9318('0x5'));var logger=require('../../../config/logger')(_0x9318('0x6'));var rpc={'openchannelQueueReport':require(_0x9318('0x7')),'mailQueueReport':require(_0x9318('0x8')),'chatQueueReport':require(_0x9318('0x9')),'smsQueueReport':require(_0x9318('0xa')),'faxQueueReport':require(_0x9318('0xb')),'whatsappQueueReport':require('../rpc/whatsappQueueReport')};var RuleEngine=require(_0x9318('0xc'));function getId(_0x47cc66,_0x582fe9,_0x2deb10){return util[_0x9318('0xd')]('%s.%s.%s',_0x47cc66,_0x582fe9||0x0,_0x2deb10||0x0);}function getIntervals(_0x2b883e,_0xbf34cf){var _0x194853=[];if(!_[_0x9318('0xe')](_0xbf34cf[_0x9318('0xf')])&&!_[_0x9318('0xe')](_0x2b883e[_0xbf34cf[_0x9318('0xf')]])&&!_[_0x9318('0xe')](_0x2b883e[_0xbf34cf['IntervalId']][_0x9318('0x10')])){_0x194853=_[_0x9318('0x11')](_0x2b883e[_0xbf34cf[_0x9318('0xf')]][_0x9318('0x10')],_0x9318('0x12'));}else if(!_[_0x9318('0xe')](_0xbf34cf[_0x9318('0x12')])){_0x194853=[_0xbf34cf['interval']];}return _0x194853;}exports['listen']=function(_0x348f3e){_0x348f3e[_0x9318('0x13')]={};return new BPromise(function(_0x2ba5bd,_0x16ea41){var _0x3b988b={'Start':function(_0x296844){var _0x1d38de=this;return new Promise(function(_0x1113bf,_0x15dc1f){if(_0x296844){try{var _0x330dad=[];var _0x9cecf8=getId(_0x296844[_0x9318('0x14')],_0x296844['message']?_0x296844[_0x9318('0x15')]['id']:0x0,_0x296844['interaction']?_0x296844['interaction']['id']:0x0);var _0x1e1b06=sUtils[_0x9318('0x16')](_0x348f3e,_0x296844);if(_0x296844[_0x9318('0x17')]||!_0x1e1b06&&_0x296844[_0x9318('0x18')]&&_['isArray'](_0x296844[_0x9318('0x18')])&&_0x296844[_0x9318('0x18')]['length']){for(var _0x17fcc2=0x0;_0x17fcc2<_0x296844[_0x9318('0x18')][_0x9318('0x19')];_0x17fcc2+=0x1){var _0x3fd16c=_0x296844[_0x9318('0x18')][_0x17fcc2];if(fs[_0x9318('0x1a')](path[_0x9318('0x1b')](__dirname,'applications',_0x3fd16c[_0x9318('0x1c')]+'.js'))){var _0x54a52f=[];switch(_0x3fd16c[_0x9318('0x1c')][_0x9318('0x1d')]()){case _0x9318('0x1e'):var _0x5aad82=_0x3fd16c[_0x9318('0x1f')]['split'](',');if(_0x296844[_0x9318('0x14')]===_0x9318('0x20')){_0x54a52f[_0x9318('0x21')](_0x5aad82[0x0]);_0x54a52f[_0x9318('0x21')](_0x5aad82[0x1]);_0x54a52f[_0x9318('0x21')](_0x5aad82[_0x9318('0x22')](0x2,_0x5aad82[_0x9318('0x19')])[_0x9318('0x1b')](','));}else{_0x54a52f[_0x9318('0x21')](_0x5aad82[0x0]);_0x54a52f[_0x9318('0x21')](_0x5aad82[_0x9318('0x22')](0x1,_0x5aad82[_0x9318('0x19')])[_0x9318('0x1b')](','));}break;case'dialogflow':var _0x55beda=_0x3fd16c['appdata'][_0x9318('0x23')](',');_0x54a52f[_0x9318('0x21')](_0x55beda[0x0]);_0x54a52f[_0x9318('0x21')](_0x55beda[0x1]);_0x54a52f[_0x9318('0x21')](_0x55beda['slice'](0x2,_0x55beda[_0x9318('0x19')])[_0x9318('0x1b')](','));break;case _0x9318('0x24'):var _0x3d79e7=_0x3fd16c['appdata'][_0x9318('0x23')](',');_0x54a52f['push'](_0x3d79e7[0x0]);_0x54a52f[_0x9318('0x21')](_0x3d79e7[0x1]);_0x54a52f[_0x9318('0x21')](_0x3d79e7[0x2]);_0x54a52f['push'](_0x3d79e7[0x3]);_0x54a52f['push'](_0x3d79e7['slice'](0x4,_0x3d79e7[_0x9318('0x19')])[_0x9318('0x1b')](','));break;case _0x9318('0x25'):var _0x45e119=_0x3fd16c[_0x9318('0x1f')][_0x9318('0x23')](',');_0x54a52f['push'](_0x45e119[0x0]);_0x54a52f[_0x9318('0x21')](_0x45e119[0x1]);_0x54a52f['push'](_0x45e119[0x2]);_0x54a52f['push'](_0x45e119[0x3]);_0x54a52f['push'](_0x45e119[_0x9318('0x22')](0x4,_0x45e119[_0x9318('0x19')])[_0x9318('0x1b')](','));break;case _0x9318('0x15'):_0x54a52f[_0x9318('0x21')](_0x3fd16c['appdata']);break;case _0x9318('0x26'):_0x54a52f[_0x9318('0x21')](_0x3fd16c['TagId']);_0x54a52f[_0x9318('0x21')](_0x3fd16c[_0x9318('0x1f')]);break;case _0x9318('0x27'):var _0x6581e4=utils['getMustacheRender'](_0x296844['account'][_0x9318('0x28')],_0x296844);var _0x43f1d2=_0x3fd16c[_0x9318('0x1f')][_0x9318('0x23')](',');_0x54a52f[_0x9318('0x21')](_0x43f1d2[0x0]);_0x54a52f[_0x9318('0x21')](_0x43f1d2[0x1]);_0x54a52f[_0x9318('0x21')](_0x43f1d2[0x2]);_0x54a52f['push'](_0x43f1d2[0x3]);_0x54a52f[_0x9318('0x21')](_0x43f1d2[0x4]);_0x54a52f[_0x9318('0x21')](_0x43f1d2[0x5]);_0x54a52f[_0x9318('0x21')](_0x43f1d2[0x6]);_0x54a52f[_0x9318('0x21')](_0x43f1d2[0x7]);_0x54a52f['push'](_0x43f1d2[0x8]);_0x54a52f[_0x9318('0x21')](_0x43f1d2[0x9]);_0x54a52f[_0x9318('0x21')](_0x43f1d2[0xa]);_0x54a52f[_0x9318('0x21')](_0x296844[_0x9318('0x29')]['id']);_0x54a52f[_0x9318('0x21')](_0x296844[_0x9318('0x15')]['id']);_0x54a52f[_0x9318('0x21')](_0x3fd16c[_0x9318('0x2a')]);_0x54a52f[_0x9318('0x21')](_0x296844[_0x9318('0x29')][_0x9318('0x2b')]);_0x54a52f[_0x9318('0x21')](_0x296844[_0x9318('0x2c')][_0x9318('0x2c')]);_0x54a52f[_0x9318('0x21')](_0x6581e4);break;default:_0x54a52f=_[_0x9318('0xe')](_0x3fd16c[_0x9318('0x1f')])?[]:_0x3fd16c[_0x9318('0x1f')][_0x9318('0x23')](',');}var _0x831e49={'id':util[_0x9318('0xd')](_0x9318('0x2d'),_0x9cecf8,_0x3fd16c['id'],_0x3fd16c['app']),'condition':require(_0x9318('0x2e'))[_0x9318('0x2f')](_0x9cecf8,getIntervals(_0x348f3e[_0x9318('0x30')],_0x3fd16c),_0x348f3e),'consequence':require(_0x9318('0x31')+_0x3fd16c['app'])[_0x9318('0x32')](_0x9cecf8,_0x54a52f,_0x348f3e,_0x296844),'p':_0x3fd16c[_0x9318('0x33')]||0x0};logger[_0x9318('0x34')](_0x9318('0x35'),_0x831e49['id'],_0x9318('0x36'),getIntervals(_0x348f3e['intervals'],_0x3fd16c)[_0x9318('0x1b')](_0x9318('0x37')));_0x330dad[_0x9318('0x21')](_0x831e49);}else{logger[_0x9318('0x38')](_0x9318('0x39'),path[_0x9318('0x1b')](__dirname,_0x9318('0x18'),_0x3fd16c[_0x9318('0x1c')]+_0x9318('0x3a')));}}_0x348f3e[_0x9318('0x13')][_0x9cecf8]=new RuleEngine(_0x330dad);_0x348f3e['rules'][_0x9cecf8][_0x9318('0x3b')](_0x296844,function(_0x696089){logger[_0x9318('0x34')](_0x9318('0x3c'),JSON['stringify'](_0x696089[_0x9318('0x3d')]));if(_0x348f3e[_0x9318('0x13')][_0x9cecf8]){_0x348f3e['rules'][_0x9cecf8][_0x9318('0x3e')](_0x9318('0x3f'));}});return _0x1113bf({'code':0xc8,'message':_0x296844});}else{if(_0x1e1b06){logger[_0x9318('0x34')](util[_0x9318('0xd')](_0x9318('0x40'),_0x9cecf8));}else{logger[_0x9318('0x34')]('No\x20applications\x20to\x20execute');}return _0x1113bf({'code':0xc8,'message':_0x296844});}}catch(_0x1c524f){logger[_0x9318('0x38')](_0x1c524f[_0x9318('0x41')]);return _0x15dc1f(_0x1d38de[_0x9318('0x38')](0x1f4,_0x1c524f));}}return _0x15dc1f(_0x9318('0x42'));});},'AcceptMessage':function(_0x51e935){var _0x295eb2=this;return new Promise(function(_0x575cb8,_0x3ef00b){if(_0x51e935[_0x9318('0x43')]&&_0x51e935[_0x9318('0x43')]['id']){if(_0x348f3e[_0x9318('0x44')][_0x51e935['agent']['id']]){_0x348f3e[_0x9318('0x44')][_0x51e935['agent']['id']][_0x9318('0x45')]=![];_0x348f3e[_0x9318('0x44')][_0x51e935[_0x9318('0x43')]['id']][_0x9318('0x46')]=undefined;}}if(_0x51e935[_0x9318('0x15')]&&_0x51e935['message']['id']){try{var _0x4e29fc=getId(_0x51e935[_0x9318('0x14')],_0x51e935['message']?_0x51e935[_0x9318('0x15')]['id']:0x0,_0x51e935[_0x9318('0x29')]?_0x51e935['interaction']['id']:0x0);if(_0x348f3e[_0x9318('0x13')][_0x4e29fc]){_0x348f3e[_0x9318('0x13')][_0x4e29fc]['emit'](_0x9318('0x47'));if(rpc[_0x51e935[_0x9318('0x14')]+_0x9318('0x48')]){rpc[_0x51e935[_0x9318('0x14')]+_0x9318('0x48')][_0x9318('0x49')](_0x4e29fc,{'UserId':_0x51e935[_0x9318('0x15')][_0x9318('0x4a')]})['catch'](function(){logger[_0x9318('0x38')](_0x9318('0x4b'));});}}return _0x575cb8({'code':0xc8,'message':_0x51e935});}catch(_0x360340){logger['error'](_0x360340[_0x9318('0x41')]);return _0x3ef00b(_0x295eb2['error'](0x1f4,_0x360340));}}logger['error'](_0x9318('0x4c'));return _0x3ef00b(_0x295eb2[_0x9318('0x38')](0x1f4,_0x9318('0x4c')));});},'RejectMessage':function(_0x5123be){var _0x3203da=this;return new Promise(function(_0x326c4a,_0x537b7a){if(_0x5123be[_0x9318('0x43')]&&_0x5123be['agent']['id']){try{if(_0x348f3e[_0x9318('0x44')][_0x5123be[_0x9318('0x43')]['id']]){_0x348f3e[_0x9318('0x44')][_0x5123be[_0x9318('0x43')]['id']][_0x9318('0x45')]=![];_0x348f3e['agents'][_0x5123be[_0x9318('0x43')]['id']]['busyQueue']=undefined;}return _0x326c4a({'code':0xc8,'message':_0x5123be});}catch(_0x2c6ea7){logger[_0x9318('0x38')](_0x2c6ea7[_0x9318('0x41')]);return _0x537b7a(_0x3203da['error'](0x1f4,_0x2c6ea7));}}logger[_0x9318('0x38')]('message\x20is\x20empty');return _0x537b7a(_0x3203da['error'](0x1f4,'message\x20is\x20empty'));});},'AbandonInteraction':function(_0x163ad5){var _0x544bf9=this;return new Promise(function(_0x4ee2a2,_0x357ed1){if(_0x163ad5[_0x9318('0x14')]&&_0x163ad5[_0x9318('0x29')]&&_0x163ad5['interaction']['id']){try{var _0x354bae=getId(_0x163ad5[_0x9318('0x14')],_0x163ad5['message']?_0x163ad5[_0x9318('0x15')]['id']:0x0,_0x163ad5[_0x9318('0x29')]?_0x163ad5['interaction']['id']:0x0);if(_0x348f3e['rules'][_0x354bae]){_0x348f3e[_0x9318('0x13')][_0x354bae][_0x9318('0x3e')](_0x9318('0x47'));}return _0x4ee2a2({'code':0xc8,'message':_0x163ad5});}catch(_0x14bdec){logger[_0x9318('0x38')](_0x14bdec[_0x9318('0x41')]);return _0x357ed1(_0x544bf9[_0x9318('0x38')](0x1f4,_0x14bdec));}}logger[_0x9318('0x38')](_0x9318('0x4c'));return _0x357ed1(_0x544bf9[_0x9318('0x38')](0x1f4,_0x9318('0x4c')));});},'AgentCapacity':function(_0x1ddef5){var _0x3f4810=this;return new Promise(function(_0x53e15f,_0x1515a2){if(_0x348f3e['agents'][_0x9318('0x4d')](_0x1ddef5['id'])){for(var _0x2ce546 in _0x1ddef5[_0x9318('0x4e')]){if(_0x1ddef5[_0x9318('0x4e')]['hasOwnProperty'](_0x2ce546)){if(_0x348f3e[_0x9318('0x44')][_0x1ddef5['id']][_0x9318('0x4d')](_0x2ce546+_0x9318('0x4f'))){_0x348f3e['agents'][_0x1ddef5['id']][_0x2ce546+_0x9318('0x4f')]=parseInt(_0x1ddef5[_0x9318('0x4e')][_0x2ce546],0xa);}}}_0x348f3e['agents'][_0x1ddef5['id']]['updateRealtime']();return _0x53e15f({'code':0xc8,'message':_0x348f3e[_0x9318('0x44')][_0x1ddef5['id']]});}else{return _0x1515a2(_0x3f4810['error'](0x1f4,'agent\x20not\x20found'));}});},'Agents':function(_0xd39d1c){return new Promise(function(_0x25ce53){var _0x449088=_[_0x9318('0x50')](_0x348f3e[_0x9318('0x44')]);if(_0xd39d1c&&_0xd39d1c['id']){var _0x277ab5=_['find'](_0x449088,function(_0x3303dc){return _0x3303dc['id']===_0xd39d1c['id'];});_0x25ce53(_0x277ab5);}else{_0x25ce53({'count':_0x449088['length'],'rows':_0x449088});}});},'ChatQueues':function(){return new Promise(function(_0x50c1c2){var _0x3a795a=[];for(var _0x492765 in _0x348f3e['chatQueues']){if(_0x348f3e[_0x9318('0x51')][_0x9318('0x4d')](_0x492765)){var _0x43fece=_0x348f3e[_0x9318('0x51')][_0x492765];var _0x5bd41c={'id':_0x43fece['id'],'available':_0x43fece[_0x9318('0x52')],'loggedIn':_0x43fece['loggedIn'],'name':_0x43fece['name'],'paused':_0x43fece[_0x9318('0x53')],'waiting':_0x43fece[_0x9318('0x54')]};_0x3a795a[_0x9318('0x21')](_0x5bd41c);}}_0x50c1c2({'count':_0x3a795a[_0x9318('0x19')],'rows':_0x3a795a});});},'MailQueues':function(){return new Promise(function(_0x283b39){var _0x1fd4d1=[];for(var _0x4d0c1f in _0x348f3e[_0x9318('0x55')]){if(_0x348f3e['mailQueues'][_0x9318('0x4d')](_0x4d0c1f)){var _0x46ed6c=_0x348f3e[_0x9318('0x55')][_0x4d0c1f];var _0x491075={'id':_0x46ed6c['id'],'available':_0x46ed6c['available'],'loggedIn':_0x46ed6c[_0x9318('0x56')],'name':_0x46ed6c[_0x9318('0x57')],'paused':_0x46ed6c[_0x9318('0x53')],'waiting':_0x46ed6c[_0x9318('0x54')]};_0x1fd4d1['push'](_0x491075);}}_0x283b39({'count':_0x1fd4d1[_0x9318('0x19')],'rows':_0x1fd4d1});});},'OpenchannelQueues':function(){return new Promise(function(_0x349db9){var _0x1046b8=[];for(var _0xe10ae5 in _0x348f3e[_0x9318('0x58')]){if(_0x348f3e[_0x9318('0x58')][_0x9318('0x4d')](_0xe10ae5)){var _0x3bcee2=_0x348f3e['openchannelQueues'][_0xe10ae5];var _0x25bc31={'id':_0x3bcee2['id'],'available':_0x3bcee2[_0x9318('0x52')],'loggedIn':_0x3bcee2[_0x9318('0x56')],'name':_0x3bcee2[_0x9318('0x57')],'paused':_0x3bcee2[_0x9318('0x53')],'waiting':_0x3bcee2[_0x9318('0x54')]};_0x1046b8[_0x9318('0x21')](_0x25bc31);}}_0x349db9({'count':_0x1046b8[_0x9318('0x19')],'rows':_0x1046b8});});},'SmsQueues':function(){return new Promise(function(_0x28525e){var _0x5763fd=[];for(var _0x4f3ed8 in _0x348f3e[_0x9318('0x59')]){if(_0x348f3e[_0x9318('0x59')]['hasOwnProperty'](_0x4f3ed8)){var _0x1574d9=_0x348f3e[_0x9318('0x59')][_0x4f3ed8];var _0x5e3685={'id':_0x1574d9['id'],'available':_0x1574d9[_0x9318('0x52')],'loggedIn':_0x1574d9['loggedIn'],'name':_0x1574d9[_0x9318('0x57')],'paused':_0x1574d9[_0x9318('0x53')],'waiting':_0x1574d9[_0x9318('0x54')]};_0x5763fd['push'](_0x5e3685);}}_0x28525e({'count':_0x5763fd[_0x9318('0x19')],'rows':_0x5763fd});});},'FaxQueues':function(){return new Promise(function(_0x4c536){var _0x59051b=[];for(var _0x5783d6 in _0x348f3e[_0x9318('0x5a')]){if(_0x348f3e[_0x9318('0x5a')]['hasOwnProperty'](_0x5783d6)){var _0x55f6ef=_0x348f3e['faxQueues'][_0x5783d6];var _0x5cdeee={'id':_0x55f6ef['id'],'available':_0x55f6ef[_0x9318('0x52')],'loggedIn':_0x55f6ef['loggedIn'],'name':_0x55f6ef[_0x9318('0x57')],'paused':_0x55f6ef[_0x9318('0x53')],'waiting':_0x55f6ef[_0x9318('0x54')]};_0x59051b[_0x9318('0x21')](_0x5cdeee);}}_0x4c536({'count':_0x59051b[_0x9318('0x19')],'rows':_0x59051b});});},'WhatsappQueues':function(){return new Promise(function(_0x9614c2){var _0xef032d=[];for(var _0x62c862 in _0x348f3e[_0x9318('0x5b')]){if(_0x348f3e[_0x9318('0x5b')][_0x9318('0x4d')](_0x62c862)){var _0x154d34=_0x348f3e[_0x9318('0x5b')][_0x62c862];var _0x1030c1={'id':_0x154d34['id'],'available':_0x154d34[_0x9318('0x52')],'loggedIn':_0x154d34[_0x9318('0x56')],'name':_0x154d34['name'],'paused':_0x154d34[_0x9318('0x53')],'waiting':_0x154d34[_0x9318('0x54')]};_0xef032d['push'](_0x1030c1);}}_0x9614c2({'count':_0xef032d[_0x9318('0x19')],'rows':_0xef032d});});},'ChatQueuesWaitingInteractions':function(){return new Promise(function(_0x6ef04f){var _0x448954=_[_0x9318('0x50')](_0x348f3e[_0x9318('0x5c')]);_0x6ef04f({'count':_0x448954[_0x9318('0x19')],'rows':_0x448954});});},'MailQueuesWaitingInteractions':function(){return new Promise(function(_0x282a35){var _0xed2428=_['values'](_0x348f3e[_0x9318('0x5d')]);_0x282a35({'count':_0xed2428[_0x9318('0x19')],'rows':_0xed2428});});},'OpenchannelQueuesWaitingInteractions':function(){return new Promise(function(_0x248393){var _0x173d67=_[_0x9318('0x50')](_0x348f3e[_0x9318('0x5e')]);_0x248393({'count':_0x173d67['length'],'rows':_0x173d67});});},'SmsQueuesWaitingInteractions':function(){return new Promise(function(_0x342f84){var _0x9a3517=_[_0x9318('0x50')](_0x348f3e[_0x9318('0x5f')]);_0x342f84({'count':_0x9a3517[_0x9318('0x19')],'rows':_0x9a3517});});},'FaxQueuesWaitingInteractions':function(){return new Promise(function(_0xda7df9){var _0x4db911=_['values'](_0x348f3e[_0x9318('0x60')]);_0xda7df9({'count':_0x4db911[_0x9318('0x19')],'rows':_0x4db911});});},'WhatsappQueuesWaitingInteractions':function(){return new Promise(function(_0x5641eb){var _0x492eb4=_['values'](_0x348f3e[_0x9318('0x61')]);_0x5641eb({'count':_0x492eb4[_0x9318('0x19')],'rows':_0x492eb4});});}};var _0xecc721=jayson['server'](_0x3b988b)[_0x9318('0x62')]();_0xecc721['on'](_0x9318('0x38'),function(_0xb58942){logger[_0x9318('0x38')](JSON[_0x9318('0x63')](_0xb58942));return _0x16ea41(_0xb58942);});_0xecc721['listen'](0x232c,_0x9318('0x64'),function(){console[_0x9318('0x65')]('Routing\x20RPC\x20server\x20listening\x20on\x20127.0.0.1:%d!',0x232c);return _0x2ba5bd(_0x9318('0x66')+0x232c);});});}; \ No newline at end of file +var _0x21c9=['routing\x20is\x20empty','agent','agents','busy','end','QueueReport','UserId','catch','message\x20is\x20empty','busyQueue','hasOwnProperty','capacity','CurrentCapacity','values','find','chatQueues','loggedIn','paused','waiting','mailQueues','available','name','openchannelQueues','smsQueues','faxQueues','whatsappQueues','chatQueuesWaitingInteractions','openchannelQueuesWaitingInteractions','smsQueuesWaitingInteractions','faxQueuesWaitingInteractions','server','http','stringify','log','Routing\x20RPC\x20server\x20listening\x20on\x20127.0.0.1:%d!','RPC\x20listening\x20on\x20port:','lodash','util','path','jayson/promise','./applications/utils','./applications/strategy/util','routing','../rpc/chatQueueReport','../rpc/smsQueueReport','../rpc/faxQueueReport','../rpc/whatsappQueueReport','../lib/rule-engine','format','isNil','IntervalId','map','Intervals','interval','listen','rules','message','interaction','checkWaitingNotifications','transfer','applications','isArray','length','join','.js','app','autoreply','appdata','split','channel','push','slice','dialogflow','dialogflowv2','amazonlex','tag','TagId','tvox','getMustacheRender','account','notificationTemplate','ChatWebsiteId','ContactId','./interval','condition','./applications/','consequence','priority','on\x20interval','intervals','Please\x20create\x20a\x20new\x20file\x20under','execute','info','Applications\x20executed','matchPath','emit','complete','stack','error'];(function(_0x207641,_0x4d6851){var _0xfdecf5=function(_0x43d714){while(--_0x43d714){_0x207641['push'](_0x207641['shift']());}};_0xfdecf5(++_0x4d6851);}(_0x21c9,0xea));var _0x921c=function(_0x1b11e9,_0x95c28){_0x1b11e9=_0x1b11e9-0x0;var _0x44219f=_0x21c9[_0x1b11e9];return _0x44219f;};'use strict';var _=require(_0x921c('0x0'));var util=require(_0x921c('0x1'));var path=require(_0x921c('0x2'));var fs=require('fs');var jayson=require(_0x921c('0x3'));var BPromise=require('bluebird');var utils=require(_0x921c('0x4'));var sUtils=require(_0x921c('0x5'));var logger=require('../../../config/logger')(_0x921c('0x6'));var rpc={'openchannelQueueReport':require('../rpc/openchannelQueueReport'),'mailQueueReport':require('../rpc/mailQueueReport'),'chatQueueReport':require(_0x921c('0x7')),'smsQueueReport':require(_0x921c('0x8')),'faxQueueReport':require(_0x921c('0x9')),'whatsappQueueReport':require(_0x921c('0xa'))};var RuleEngine=require(_0x921c('0xb'));function getId(_0x260119,_0x4ed3af,_0x5274c2){return util[_0x921c('0xc')]('%s.%s.%s',_0x260119,_0x4ed3af||0x0,_0x5274c2||0x0);}function getIntervals(_0x385790,_0x4eb749){var _0xbdf09e=[];if(!_[_0x921c('0xd')](_0x4eb749['IntervalId'])&&!_[_0x921c('0xd')](_0x385790[_0x4eb749[_0x921c('0xe')]])&&!_['isNil'](_0x385790[_0x4eb749[_0x921c('0xe')]]['Intervals'])){_0xbdf09e=_[_0x921c('0xf')](_0x385790[_0x4eb749[_0x921c('0xe')]][_0x921c('0x10')],'interval');}else if(!_['isNil'](_0x4eb749['interval'])){_0xbdf09e=[_0x4eb749[_0x921c('0x11')]];}return _0xbdf09e;}exports[_0x921c('0x12')]=function(_0x15f569){_0x15f569[_0x921c('0x13')]={};return new BPromise(function(_0x451317,_0x4be115){var _0x33174d={'Start':function(_0x1651c7){var _0x4e785d=this;return new Promise(function(_0x5cf13c,_0x402ea4){if(_0x1651c7){try{var _0x32c264=[];var _0x348bf7=getId(_0x1651c7['channel'],_0x1651c7[_0x921c('0x14')]?_0x1651c7['message']['id']:0x0,_0x1651c7[_0x921c('0x15')]?_0x1651c7['interaction']['id']:0x0);var _0x5a39f6=sUtils[_0x921c('0x16')](_0x15f569,_0x1651c7);if(_0x1651c7[_0x921c('0x17')]||!_0x5a39f6&&_0x1651c7[_0x921c('0x18')]&&_[_0x921c('0x19')](_0x1651c7[_0x921c('0x18')])&&_0x1651c7[_0x921c('0x18')][_0x921c('0x1a')]){for(var _0x565ff9=0x0;_0x565ff9<_0x1651c7[_0x921c('0x18')]['length'];_0x565ff9+=0x1){var _0x3c2796=_0x1651c7['applications'][_0x565ff9];if(fs['existsSync'](path[_0x921c('0x1b')](__dirname,_0x921c('0x18'),_0x3c2796['app']+_0x921c('0x1c')))){var _0x2890f3=[];switch(_0x3c2796[_0x921c('0x1d')]['toLowerCase']()){case _0x921c('0x1e'):var _0x1b3816=_0x3c2796[_0x921c('0x1f')][_0x921c('0x20')](',');if(_0x1651c7[_0x921c('0x21')]==='mail'){_0x2890f3[_0x921c('0x22')](_0x1b3816[0x0]);_0x2890f3[_0x921c('0x22')](_0x1b3816[0x1]);_0x2890f3[_0x921c('0x22')](_0x1b3816[_0x921c('0x23')](0x2,_0x1b3816['length'])['join'](','));}else{_0x2890f3[_0x921c('0x22')](_0x1b3816[0x0]);_0x2890f3['push'](_0x1b3816['slice'](0x1,_0x1b3816[_0x921c('0x1a')])['join'](','));}break;case _0x921c('0x24'):var _0x843c00=_0x3c2796[_0x921c('0x1f')][_0x921c('0x20')](',');_0x2890f3['push'](_0x843c00[0x0]);_0x2890f3[_0x921c('0x22')](_0x843c00[0x1]);_0x2890f3[_0x921c('0x22')](_0x843c00[_0x921c('0x23')](0x2,_0x843c00[_0x921c('0x1a')])[_0x921c('0x1b')](','));break;case _0x921c('0x25'):var _0xb29e3e=_0x3c2796[_0x921c('0x1f')][_0x921c('0x20')](',');_0x2890f3[_0x921c('0x22')](_0xb29e3e[0x0]);_0x2890f3['push'](_0xb29e3e[0x1]);_0x2890f3['push'](_0xb29e3e[0x2]);_0x2890f3['push'](_0xb29e3e[0x3]);_0x2890f3[_0x921c('0x22')](_0xb29e3e['slice'](0x4,_0xb29e3e[_0x921c('0x1a')])[_0x921c('0x1b')](','));break;case _0x921c('0x26'):var _0x2982bb=_0x3c2796['appdata'][_0x921c('0x20')](',');_0x2890f3[_0x921c('0x22')](_0x2982bb[0x0]);_0x2890f3['push'](_0x2982bb[0x1]);_0x2890f3['push'](_0x2982bb[0x2]);_0x2890f3[_0x921c('0x22')](_0x2982bb[0x3]);_0x2890f3[_0x921c('0x22')](_0x2982bb[_0x921c('0x23')](0x4,_0x2982bb[_0x921c('0x1a')])[_0x921c('0x1b')](','));break;case _0x921c('0x14'):_0x2890f3['push'](_0x3c2796['appdata']);break;case _0x921c('0x27'):_0x2890f3['push'](_0x3c2796[_0x921c('0x28')]);_0x2890f3['push'](_0x3c2796[_0x921c('0x1f')]);break;case _0x921c('0x29'):var _0x2f6f93=utils[_0x921c('0x2a')](_0x1651c7[_0x921c('0x2b')][_0x921c('0x2c')],_0x1651c7);var _0x4afca7=_0x3c2796[_0x921c('0x1f')]['split'](',');_0x2890f3['push'](_0x4afca7[0x0]);_0x2890f3[_0x921c('0x22')](_0x4afca7[0x1]);_0x2890f3[_0x921c('0x22')](_0x4afca7[0x2]);_0x2890f3[_0x921c('0x22')](_0x4afca7[0x3]);_0x2890f3[_0x921c('0x22')](_0x4afca7[0x4]);_0x2890f3['push'](_0x4afca7[0x5]);_0x2890f3['push'](_0x4afca7[0x6]);_0x2890f3[_0x921c('0x22')](_0x4afca7[0x7]);_0x2890f3['push'](_0x4afca7[0x8]);_0x2890f3[_0x921c('0x22')](_0x4afca7[0x9]);_0x2890f3['push'](_0x4afca7[0xa]);_0x2890f3[_0x921c('0x22')](_0x1651c7['interaction']['id']);_0x2890f3['push'](_0x1651c7[_0x921c('0x14')]['id']);_0x2890f3['push'](_0x3c2796[_0x921c('0x2d')]);_0x2890f3['push'](_0x1651c7[_0x921c('0x15')][_0x921c('0x2e')]);_0x2890f3[_0x921c('0x22')](_0x1651c7['body']['body']);_0x2890f3[_0x921c('0x22')](_0x2f6f93);break;default:_0x2890f3=_[_0x921c('0xd')](_0x3c2796['appdata'])?[]:_0x3c2796[_0x921c('0x1f')][_0x921c('0x20')](',');}var _0x19ce99={'id':util[_0x921c('0xc')]('%s:%s:%s',_0x348bf7,_0x3c2796['id'],_0x3c2796['app']),'condition':require(_0x921c('0x2f'))[_0x921c('0x30')](_0x348bf7,getIntervals(_0x15f569['intervals'],_0x3c2796),_0x15f569),'consequence':require(_0x921c('0x31')+_0x3c2796[_0x921c('0x1d')])[_0x921c('0x32')](_0x348bf7,_0x2890f3,_0x15f569,_0x1651c7),'p':_0x3c2796[_0x921c('0x33')]||0x0};logger['info']('Push\x20new\x20rule',_0x19ce99['id'],_0x921c('0x34'),getIntervals(_0x15f569[_0x921c('0x35')],_0x3c2796)[_0x921c('0x1b')]('\x20|\x20'));_0x32c264[_0x921c('0x22')](_0x19ce99);}else{logger['error'](_0x921c('0x36'),path[_0x921c('0x1b')](__dirname,_0x921c('0x18'),_0x3c2796[_0x921c('0x1d')]+'.js'));}}_0x15f569[_0x921c('0x13')][_0x348bf7]=new RuleEngine(_0x32c264);_0x15f569[_0x921c('0x13')][_0x348bf7][_0x921c('0x37')](_0x1651c7,function(_0x4b2a2e){logger[_0x921c('0x38')](_0x921c('0x39'),JSON['stringify'](_0x4b2a2e[_0x921c('0x3a')]));if(_0x15f569['rules'][_0x348bf7]){_0x15f569[_0x921c('0x13')][_0x348bf7][_0x921c('0x3b')](_0x921c('0x3c'));}});return _0x5cf13c({'code':0xc8,'message':_0x1651c7});}else{if(_0x5a39f6){logger[_0x921c('0x38')](util['format']('Skipped\x20routing\x20for\x20%s',_0x348bf7));}else{logger[_0x921c('0x38')]('No\x20applications\x20to\x20execute');}return _0x5cf13c({'code':0xc8,'message':_0x1651c7});}}catch(_0x508e08){logger['error'](_0x508e08[_0x921c('0x3d')]);return _0x402ea4(_0x4e785d[_0x921c('0x3e')](0x1f4,_0x508e08));}}return _0x402ea4(_0x921c('0x3f'));});},'AcceptMessage':function(_0x460a58){var _0x25b2d0=this;return new Promise(function(_0x33c13e,_0x1a030f){if(_0x460a58['agent']&&_0x460a58[_0x921c('0x40')]['id']){if(_0x15f569[_0x921c('0x41')][_0x460a58[_0x921c('0x40')]['id']]){_0x15f569[_0x921c('0x41')][_0x460a58[_0x921c('0x40')]['id']][_0x921c('0x42')]=![];_0x15f569[_0x921c('0x41')][_0x460a58[_0x921c('0x40')]['id']]['busyQueue']=undefined;}}if(_0x460a58[_0x921c('0x14')]&&_0x460a58[_0x921c('0x14')]['id']){try{var _0x4358f6=getId(_0x460a58[_0x921c('0x21')],_0x460a58[_0x921c('0x14')]?_0x460a58[_0x921c('0x14')]['id']:0x0,_0x460a58[_0x921c('0x15')]?_0x460a58[_0x921c('0x15')]['id']:0x0);if(_0x15f569[_0x921c('0x13')][_0x4358f6]){_0x15f569[_0x921c('0x13')][_0x4358f6][_0x921c('0x3b')](_0x921c('0x43'));if(rpc[_0x460a58[_0x921c('0x21')]+'QueueReport']){rpc[_0x460a58[_0x921c('0x21')]+_0x921c('0x44')]['update'](_0x4358f6,{'UserId':_0x460a58[_0x921c('0x14')][_0x921c('0x45')]})[_0x921c('0x46')](function(){logger[_0x921c('0x3e')]('error\x20update\x20queue\x20report');});}}return _0x33c13e({'code':0xc8,'message':_0x460a58});}catch(_0x3f8a05){logger[_0x921c('0x3e')](_0x3f8a05[_0x921c('0x3d')]);return _0x1a030f(_0x25b2d0[_0x921c('0x3e')](0x1f4,_0x3f8a05));}}logger[_0x921c('0x3e')](_0x921c('0x47'));return _0x1a030f(_0x25b2d0[_0x921c('0x3e')](0x1f4,'message\x20is\x20empty'));});},'RejectMessage':function(_0x19d029){var _0x480b93=this;return new Promise(function(_0x541a5d,_0x2cfce4){if(_0x19d029[_0x921c('0x40')]&&_0x19d029[_0x921c('0x40')]['id']){try{if(_0x15f569[_0x921c('0x41')][_0x19d029[_0x921c('0x40')]['id']]){_0x15f569['agents'][_0x19d029['agent']['id']]['busy']=![];_0x15f569[_0x921c('0x41')][_0x19d029[_0x921c('0x40')]['id']][_0x921c('0x48')]=undefined;}return _0x541a5d({'code':0xc8,'message':_0x19d029});}catch(_0x1012ca){logger[_0x921c('0x3e')](_0x1012ca['stack']);return _0x2cfce4(_0x480b93[_0x921c('0x3e')](0x1f4,_0x1012ca));}}logger[_0x921c('0x3e')](_0x921c('0x47'));return _0x2cfce4(_0x480b93['error'](0x1f4,'message\x20is\x20empty'));});},'AbandonInteraction':function(_0xcca7bf){var _0x40f32c=this;return new Promise(function(_0x250219,_0x4e2001){if(_0xcca7bf[_0x921c('0x21')]&&_0xcca7bf['interaction']&&_0xcca7bf[_0x921c('0x15')]['id']){try{var _0x31c337=getId(_0xcca7bf[_0x921c('0x21')],_0xcca7bf[_0x921c('0x14')]?_0xcca7bf[_0x921c('0x14')]['id']:0x0,_0xcca7bf[_0x921c('0x15')]?_0xcca7bf['interaction']['id']:0x0);if(_0x15f569['rules'][_0x31c337]){_0x15f569[_0x921c('0x13')][_0x31c337][_0x921c('0x3b')](_0x921c('0x43'));}return _0x250219({'code':0xc8,'message':_0xcca7bf});}catch(_0x3878dd){logger[_0x921c('0x3e')](_0x3878dd[_0x921c('0x3d')]);return _0x4e2001(_0x40f32c['error'](0x1f4,_0x3878dd));}}logger[_0x921c('0x3e')](_0x921c('0x47'));return _0x4e2001(_0x40f32c['error'](0x1f4,'message\x20is\x20empty'));});},'AgentCapacity':function(_0x505657){var _0x4121fa=this;return new Promise(function(_0x2fa6eb,_0x4fc7b1){if(_0x15f569['agents'][_0x921c('0x49')](_0x505657['id'])){for(var _0xcfd81e in _0x505657[_0x921c('0x4a')]){if(_0x505657['capacity'][_0x921c('0x49')](_0xcfd81e)){if(_0x15f569[_0x921c('0x41')][_0x505657['id']][_0x921c('0x49')](_0xcfd81e+_0x921c('0x4b'))){_0x15f569[_0x921c('0x41')][_0x505657['id']][_0xcfd81e+_0x921c('0x4b')]=parseInt(_0x505657[_0x921c('0x4a')][_0xcfd81e],0xa);}}}_0x15f569['agents'][_0x505657['id']]['updateRealtime']();return _0x2fa6eb({'code':0xc8,'message':_0x15f569[_0x921c('0x41')][_0x505657['id']]});}else{return _0x4fc7b1(_0x4121fa['error'](0x1f4,'agent\x20not\x20found'));}});},'Agents':function(_0x2d2122){return new Promise(function(_0x646e98){var _0x1babf7=_[_0x921c('0x4c')](_0x15f569[_0x921c('0x41')]);if(_0x2d2122&&_0x2d2122['id']){var _0x235e33=_[_0x921c('0x4d')](_0x1babf7,function(_0x3668cb){return _0x3668cb['id']===_0x2d2122['id'];});_0x646e98(_0x235e33);}else{_0x646e98({'count':_0x1babf7['length'],'rows':_0x1babf7});}});},'ChatQueues':function(){return new Promise(function(_0x2a7614){var _0x168463=[];for(var _0x33e323 in _0x15f569[_0x921c('0x4e')]){if(_0x15f569[_0x921c('0x4e')][_0x921c('0x49')](_0x33e323)){var _0x2fa63a=_0x15f569[_0x921c('0x4e')][_0x33e323];var _0x44a403={'id':_0x2fa63a['id'],'available':_0x2fa63a['available'],'loggedIn':_0x2fa63a[_0x921c('0x4f')],'name':_0x2fa63a['name'],'paused':_0x2fa63a[_0x921c('0x50')],'waiting':_0x2fa63a[_0x921c('0x51')]};_0x168463['push'](_0x44a403);}}_0x2a7614({'count':_0x168463[_0x921c('0x1a')],'rows':_0x168463});});},'MailQueues':function(){return new Promise(function(_0x4e033f){var _0xd82da0=[];for(var _0x4ef186 in _0x15f569[_0x921c('0x52')]){if(_0x15f569[_0x921c('0x52')][_0x921c('0x49')](_0x4ef186)){var _0x38200a=_0x15f569[_0x921c('0x52')][_0x4ef186];var _0x1c57c6={'id':_0x38200a['id'],'available':_0x38200a[_0x921c('0x53')],'loggedIn':_0x38200a[_0x921c('0x4f')],'name':_0x38200a[_0x921c('0x54')],'paused':_0x38200a['paused'],'waiting':_0x38200a['waiting']};_0xd82da0[_0x921c('0x22')](_0x1c57c6);}}_0x4e033f({'count':_0xd82da0[_0x921c('0x1a')],'rows':_0xd82da0});});},'OpenchannelQueues':function(){return new Promise(function(_0x2a0a71){var _0x3787e3=[];for(var _0x405b4a in _0x15f569[_0x921c('0x55')]){if(_0x15f569[_0x921c('0x55')][_0x921c('0x49')](_0x405b4a)){var _0x125621=_0x15f569[_0x921c('0x55')][_0x405b4a];var _0x199522={'id':_0x125621['id'],'available':_0x125621[_0x921c('0x53')],'loggedIn':_0x125621[_0x921c('0x4f')],'name':_0x125621[_0x921c('0x54')],'paused':_0x125621['paused'],'waiting':_0x125621['waiting']};_0x3787e3[_0x921c('0x22')](_0x199522);}}_0x2a0a71({'count':_0x3787e3[_0x921c('0x1a')],'rows':_0x3787e3});});},'SmsQueues':function(){return new Promise(function(_0x4877df){var _0x3d5f29=[];for(var _0x5358c1 in _0x15f569[_0x921c('0x56')]){if(_0x15f569['smsQueues'][_0x921c('0x49')](_0x5358c1)){var _0xcd4cbf=_0x15f569[_0x921c('0x56')][_0x5358c1];var _0x112e13={'id':_0xcd4cbf['id'],'available':_0xcd4cbf['available'],'loggedIn':_0xcd4cbf[_0x921c('0x4f')],'name':_0xcd4cbf[_0x921c('0x54')],'paused':_0xcd4cbf[_0x921c('0x50')],'waiting':_0xcd4cbf[_0x921c('0x51')]};_0x3d5f29['push'](_0x112e13);}}_0x4877df({'count':_0x3d5f29[_0x921c('0x1a')],'rows':_0x3d5f29});});},'FaxQueues':function(){return new Promise(function(_0x51f498){var _0x24e418=[];for(var _0x5c68cf in _0x15f569[_0x921c('0x57')]){if(_0x15f569['faxQueues'][_0x921c('0x49')](_0x5c68cf)){var _0x199d50=_0x15f569[_0x921c('0x57')][_0x5c68cf];var _0x464952={'id':_0x199d50['id'],'available':_0x199d50[_0x921c('0x53')],'loggedIn':_0x199d50[_0x921c('0x4f')],'name':_0x199d50[_0x921c('0x54')],'paused':_0x199d50[_0x921c('0x50')],'waiting':_0x199d50[_0x921c('0x51')]};_0x24e418[_0x921c('0x22')](_0x464952);}}_0x51f498({'count':_0x24e418[_0x921c('0x1a')],'rows':_0x24e418});});},'WhatsappQueues':function(){return new Promise(function(_0x4aeb1f){var _0x2e1b65=[];for(var _0x4a80dc in _0x15f569['whatsappQueues']){if(_0x15f569[_0x921c('0x58')][_0x921c('0x49')](_0x4a80dc)){var _0xb99c4e=_0x15f569[_0x921c('0x58')][_0x4a80dc];var _0x5c8b0d={'id':_0xb99c4e['id'],'available':_0xb99c4e[_0x921c('0x53')],'loggedIn':_0xb99c4e[_0x921c('0x4f')],'name':_0xb99c4e[_0x921c('0x54')],'paused':_0xb99c4e['paused'],'waiting':_0xb99c4e['waiting']};_0x2e1b65[_0x921c('0x22')](_0x5c8b0d);}}_0x4aeb1f({'count':_0x2e1b65[_0x921c('0x1a')],'rows':_0x2e1b65});});},'ChatQueuesWaitingInteractions':function(){return new Promise(function(_0x355742){var _0x1269da=_[_0x921c('0x4c')](_0x15f569[_0x921c('0x59')]);_0x355742({'count':_0x1269da['length'],'rows':_0x1269da});});},'MailQueuesWaitingInteractions':function(){return new Promise(function(_0x564dc2){var _0x254626=_[_0x921c('0x4c')](_0x15f569['mailQueuesWaitingInteractions']);_0x564dc2({'count':_0x254626['length'],'rows':_0x254626});});},'OpenchannelQueuesWaitingInteractions':function(){return new Promise(function(_0x5ec529){var _0x32d63f=_[_0x921c('0x4c')](_0x15f569[_0x921c('0x5a')]);_0x5ec529({'count':_0x32d63f[_0x921c('0x1a')],'rows':_0x32d63f});});},'SmsQueuesWaitingInteractions':function(){return new Promise(function(_0x252f9b){var _0x3b42bf=_[_0x921c('0x4c')](_0x15f569[_0x921c('0x5b')]);_0x252f9b({'count':_0x3b42bf[_0x921c('0x1a')],'rows':_0x3b42bf});});},'FaxQueuesWaitingInteractions':function(){return new Promise(function(_0x128ed2){var _0x1a6e99=_[_0x921c('0x4c')](_0x15f569[_0x921c('0x5c')]);_0x128ed2({'count':_0x1a6e99[_0x921c('0x1a')],'rows':_0x1a6e99});});},'WhatsappQueuesWaitingInteractions':function(){return new Promise(function(_0x1ea2cf){var _0x47ed1b=_[_0x921c('0x4c')](_0x15f569['whatsappQueuesWaitingInteractions']);_0x1ea2cf({'count':_0x47ed1b[_0x921c('0x1a')],'rows':_0x47ed1b});});}};var _0x48383f=jayson[_0x921c('0x5d')](_0x33174d)[_0x921c('0x5e')]();_0x48383f['on'](_0x921c('0x3e'),function(_0x255f9e){logger[_0x921c('0x3e')](JSON[_0x921c('0x5f')](_0x255f9e));return _0x4be115(_0x255f9e);});_0x48383f[_0x921c('0x12')](0x232c,'127.0.0.1',function(){console[_0x921c('0x60')](_0x921c('0x61'),0x232c);return _0x451317(_0x921c('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 8f934f3..120f3d8 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 _0x8f55=['when','[%s][INTERVAL\x20NOT\x20VALID]\x20%s\x20%s','stop','lodash','../../../config/logger','routing','condition','rules','info','[%s][INTERVAL]\x20ROUTING\x20STOPPED','map','some','[%s][INTERVAL\x20VALID]\x20%s\x20%s','join','\x20|\x20'];(function(_0x2080a3,_0x48acfa){var _0x8d7d17=function(_0x2dbc06){while(--_0x2dbc06){_0x2080a3['push'](_0x2080a3['shift']());}};_0x8d7d17(++_0x48acfa);}(_0x8f55,0x1f2));var _0x58f5=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0x8f55[_0x20a584];return _0x4b41a8;};'use strict';var _=require(_0x58f5('0x0'));var iftime=require('../../../utils/iftime')['iftime'];var logger=require(_0x58f5('0x1'))(_0x58f5('0x2'));exports[_0x58f5('0x3')]=function(_0x422d1e,_0x159bcf,_0x2f820d){return function(_0x6d1c9c){if(_0x2f820d[_0x58f5('0x4')]&&!_0x2f820d['rules'][_0x422d1e]){logger[_0x58f5('0x5')](_0x58f5('0x6'),_0x422d1e);return _0x6d1c9c['stop']();}var _0x255032=_0x159bcf[_0x58f5('0x7')](function(_0x35ef0b){return iftime(_0x35ef0b);});var _0xb89729=_[_0x58f5('0x8')](_0x255032);if(_0xb89729){logger[_0x58f5('0x5')](_0x58f5('0x9'),_0x422d1e,_0x159bcf[_0x58f5('0xa')](_0x58f5('0xb')),_0xb89729);_0x6d1c9c[_0x58f5('0xc')](_0xb89729);}else{logger[_0x58f5('0x5')](_0x58f5('0xd'),_0x422d1e,_0x159bcf[_0x58f5('0xa')]('\x20|\x20'));_0x6d1c9c[_0x58f5('0xe')]();}};}; \ No newline at end of file +var _0x75f0=['[%s][INTERVAL]\x20ROUTING\x20STOPPED','stop','some','join','\x20|\x20','[%s][INTERVAL\x20NOT\x20VALID]\x20%s\x20%s','lodash','../../../utils/iftime','iftime','routing','condition','rules','info'];(function(_0x46b8d9,_0x431db3){var _0x383b8f=function(_0x22f7f0){while(--_0x22f7f0){_0x46b8d9['push'](_0x46b8d9['shift']());}};_0x383b8f(++_0x431db3);}(_0x75f0,0x124));var _0x075f=function(_0x1a9ed0,_0x1085fc){_0x1a9ed0=_0x1a9ed0-0x0;var _0x47bbd6=_0x75f0[_0x1a9ed0];return _0x47bbd6;};'use strict';var _=require(_0x075f('0x0'));var iftime=require(_0x075f('0x1'))[_0x075f('0x2')];var logger=require('../../../config/logger')(_0x075f('0x3'));exports[_0x075f('0x4')]=function(_0x355ee7,_0x4e4d83,_0x28cb5b){return function(_0x5700b2){if(_0x28cb5b[_0x075f('0x5')]&&!_0x28cb5b[_0x075f('0x5')][_0x355ee7]){logger[_0x075f('0x6')](_0x075f('0x7'),_0x355ee7);return _0x5700b2[_0x075f('0x8')]();}var _0x5c963d=_0x4e4d83['map'](function(_0x514d24){return iftime(_0x514d24);});var _0x5a295e=_[_0x075f('0x9')](_0x5c963d);if(_0x5a295e){logger['info']('[%s][INTERVAL\x20VALID]\x20%s\x20%s',_0x355ee7,_0x4e4d83[_0x075f('0xa')](_0x075f('0xb')),_0x5a295e);_0x5700b2['when'](_0x5a295e);}else{logger[_0x075f('0x6')](_0x075f('0xc'),_0x355ee7,_0x4e4d83[_0x075f('0xa')](_0x075f('0xb')));_0x5700b2[_0x075f('0x8')]();}};}; \ No newline at end of file diff --git a/server/services/xdr/agents.controller.js b/server/services/xdr/agents.controller.js index 5cbca14..5152a74 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 _0xa75b=['agentconnectAt','answered_elsewhere','answeredelsewheredestinationuniqueid','answeredelsewheremembername','[%s][agents][agentcomplete]','[%s][agents][agentcomplete]\x20agent:%s\x20destuniqueid:%s\x20lastevent:complete','diffTime','agentcompleteAt','blindtransfer','transfereruniqueid','[%s][agents][blindtransfer]','[%s][agents][blindtransfer]\x20agent:%s\x20transferuniqueid:%s','transfertype','transferexten','extension','transferuniqueid','attendedtransfer','[%s][agents][attendedtransfer]','origtransfereruniqueid','origtransfererlinkedid','secondtransfereruniqueid','transfer','origtransfererexten','transfereeuniqueid','clone','calleridname','secondtransfererlinkedid','[%s][agents][attendedtransfer]\x20agent:%s','ATTENDED','secondtransfererexten','transfertargetuniqueid','agententerreason','agentcalledAt','hangup','[%s][agents][hangup]','cause','rejected','[%s][agents][hangup]\x20agent:%s\x20reason:%s\x20lastevent:%s','splice','complete','lodash','info','format','[%s][agents][writeDB]\x20channel:%s\x20queue:%s\x20agent:%s\x20interface:%s\x20calleridnum:%s\x20connectedlinenum:%s\x20lastevent:%s','uniqueid','channel','queue','membername','interface','calleridnum','connectedlinenum','lastevent','type','agentacw','agentcomplete','acw','acwtime','acwTimeout','request','CreateVoiceAgentReport','destuniqueid','debug','[%s][agents][agentcalled]','now','called','connectedlinename','[%s][agents][agentcalled]\x20agent:%s\x20destuniqueid:%s\x20lastevent:called','isNil','agentringnoanswer','agentringnoanswerAt','timeout','reason','holdtime','talktime','error','[%s][agents][agentringnoanswer]','queuecallerabandon','forIn','[%s][agents][queuecallerabandon]','abandoned','agentconnect','[%s][agents][agentconnect]'];(function(_0x1f3dc7,_0x5e428f){var _0x2722b4=function(_0x5aace8){while(--_0x5aace8){_0x1f3dc7['push'](_0x1f3dc7['shift']());}};_0x2722b4(++_0x5e428f);}(_0xa75b,0x170));var _0xba75=function(_0x1dd58f,_0x3507e7){_0x1dd58f=_0x1dd58f-0x0;var _0x4330f3=_0xa75b[_0x1dd58f];return _0x4330f3;};'use strict';var _=require(_0xba75('0x0'));var util=require('util');var utils=require('./utils');var agents={};var transfers={};var unanswered=[];function writeDB(_0x10c0dd,_0x39dc19){utils[_0xba75('0x1')](util[_0xba75('0x2')](_0xba75('0x3'),_0x10c0dd[_0xba75('0x4')],_0x10c0dd[_0xba75('0x5')],_0x10c0dd[_0xba75('0x6')],_0x10c0dd[_0xba75('0x7')],_0x10c0dd[_0xba75('0x8')],_0x10c0dd[_0xba75('0x9')],_0x10c0dd[_0xba75('0xa')],_0x10c0dd[_0xba75('0xb')]));if(_0x10c0dd['queue']){utils['getVoiceQueueByName'](_0x10c0dd[_0xba75('0x6')])['then'](function(_0x5c5fd7){if(_0x5c5fd7){_0x10c0dd[_0xba75('0xc')]=_0x5c5fd7['type'];_0x10c0dd[_0xba75('0xd')]=_0x10c0dd[_0xba75('0xe')]?_0x5c5fd7[_0xba75('0xf')]:![];_0x10c0dd[_0xba75('0x10')]=_0x10c0dd[_0xba75('0xd')]?_0x5c5fd7[_0xba75('0x11')]:0x0;}utils[_0xba75('0x12')](_0xba75('0x13'),_0x10c0dd);});}else{utils[_0xba75('0x12')](_0xba75('0x13'),_0x10c0dd);}if(_0x39dc19){delete transfers[_0x10c0dd[_0xba75('0x4')]];}else{delete agents[_0x10c0dd[_0xba75('0x14')]];}}exports['agentcalled']=function(_0x55553a){try{utils[_0xba75('0x15')](util['format'](_0xba75('0x16'),_0x55553a[_0xba75('0x4')]),_0x55553a);agents[_0x55553a[_0xba75('0x14')]]=_0x55553a;agents[_0x55553a[_0xba75('0x14')]]['agentcalledAt']=utils[_0xba75('0x17')]();agents[_0x55553a[_0xba75('0x14')]][_0xba75('0xb')]=_0xba75('0x18');agents[_0x55553a[_0xba75('0x14')]]['connectedlinenum']=null;agents[_0x55553a[_0xba75('0x14')]][_0xba75('0x19')]=null;utils[_0xba75('0x1')](util['format'](_0xba75('0x1a'),_0x55553a[_0xba75('0x4')],agents[_0x55553a[_0xba75('0x14')]][_0xba75('0x7')],_0x55553a[_0xba75('0x14')]));}catch(_0x1d1c44){utils['error'](util[_0xba75('0x2')](_0xba75('0x16'),_0x55553a['uniqueid']),_0x1d1c44);}};exports['agentringnoanswer']=function(_0x35ffd2){try{if(!_[_0xba75('0x1b')](agents[_0x35ffd2['destuniqueid']])){utils['debug'](util[_0xba75('0x2')]('[%s][agents][agentringnoanswer]',_0x35ffd2[_0xba75('0x4')]),_0x35ffd2);utils[_0xba75('0x1')](util[_0xba75('0x2')]('[%s][agents][agentringnoanswer]\x20agent:%s\x20destuniqueid:%s\x20lastevent:timeout',_0x35ffd2[_0xba75('0x4')],agents[_0x35ffd2[_0xba75('0x14')]][_0xba75('0x7')],_0x35ffd2[_0xba75('0x14')]));agents[_0x35ffd2[_0xba75('0x14')]][_0xba75('0x1c')]=!![];agents[_0x35ffd2['destuniqueid']][_0xba75('0x1d')]=utils[_0xba75('0x17')]();agents[_0x35ffd2[_0xba75('0x14')]][_0xba75('0xb')]=_0xba75('0x1e');agents[_0x35ffd2[_0xba75('0x14')]][_0xba75('0x1f')]=_0xba75('0x1e');agents[_0x35ffd2[_0xba75('0x14')]][_0xba75('0x20')]=_0x35ffd2['ringtime']?parseInt(_0x35ffd2['ringtime'])/0x3e8:0x0;agents[_0x35ffd2['destuniqueid']][_0xba75('0x21')]=0x0;unanswered['push'](_0x35ffd2[_0xba75('0x14')]);}}catch(_0x58ea2d){utils[_0xba75('0x22')](util[_0xba75('0x2')](_0xba75('0x23'),_0x35ffd2['uniqueid']),_0x58ea2d);}};exports[_0xba75('0x24')]=function(_0x62cf49){try{_[_0xba75('0x25')](agents,function(_0x2808f0,_0x5d9f78){if(_0x2808f0['uniqueid']==_0x62cf49[_0xba75('0x4')]&&!_['includes'](unanswered,_0x2808f0[_0xba75('0x14')])){utils[_0xba75('0x15')](util[_0xba75('0x2')](_0xba75('0x26'),_0x62cf49['uniqueid']),_0x62cf49);utils[_0xba75('0x1')](util[_0xba75('0x2')]('[%s][agents][queuecallerabandon]\x20agent:%s\x20destuniqueid:%s\x20lastevent:abandoned',_0x62cf49[_0xba75('0x4')],_0x2808f0[_0xba75('0x7')],_0x2808f0[_0xba75('0x14')]));_0x2808f0[_0xba75('0x1c')]=!![];_0x2808f0['agentringnoanswerAt']=utils[_0xba75('0x17')]();_0x2808f0[_0xba75('0xb')]='abandoned';_0x2808f0[_0xba75('0x1f')]=_0xba75('0x27');_0x2808f0[_0xba75('0x20')]=_0x62cf49['holdtime'];_0x2808f0[_0xba75('0x21')]=0x0;writeDB(_0x2808f0);}});}catch(_0x282f98){utils[_0xba75('0x22')](util[_0xba75('0x2')](_0xba75('0x26'),_0x62cf49[_0xba75('0x4')]),_0x282f98);}};exports[_0xba75('0x28')]=function(_0x4c9fb2){try{if(agents[_0x4c9fb2['destuniqueid']]){utils[_0xba75('0x15')](util[_0xba75('0x2')](_0xba75('0x29'),_0x4c9fb2['uniqueid']),_0x4c9fb2);utils[_0xba75('0x1')](util[_0xba75('0x2')]('[%s][agents][agentconnect]\x20agent:%s\x20destuniqueid:%s\x20lastevent:connect',_0x4c9fb2['uniqueid'],agents[_0x4c9fb2[_0xba75('0x14')]][_0xba75('0x7')],_0x4c9fb2[_0xba75('0x14')]));agents[_0x4c9fb2[_0xba75('0x14')]][_0xba75('0x2a')]=utils['now']();agents[_0x4c9fb2['destuniqueid']][_0xba75('0xa')]=_0x4c9fb2[_0xba75('0xa')];agents[_0x4c9fb2[_0xba75('0x14')]][_0xba75('0x19')]=_0x4c9fb2[_0xba75('0x19')];agents[_0x4c9fb2[_0xba75('0x14')]][_0xba75('0x20')]=_0x4c9fb2['ringtime'];agents[_0x4c9fb2[_0xba75('0x14')]][_0xba75('0xb')]='connect';_[_0xba75('0x25')](agents,function(_0x3740bd,_0x2d56c0){if(_0x3740bd[_0xba75('0x14')]!=_0x4c9fb2[_0xba75('0x14')]&&_0x3740bd[_0xba75('0x4')]==_0x4c9fb2[_0xba75('0x4')]){_0x3740bd['talktime']=0x0;_0x3740bd[_0xba75('0x20')]=_0x4c9fb2['ringtime'];_0x3740bd[_0xba75('0x1c')]=!![];_0x3740bd['agentringnoanswerAt']=utils[_0xba75('0x17')]();_0x3740bd[_0xba75('0xb')]=_0xba75('0x2b');_0x3740bd[_0xba75('0x1f')]=_0xba75('0x2b');_0x3740bd[_0xba75('0x2c')]=_0x4c9fb2[_0xba75('0x14')];_0x3740bd[_0xba75('0x2d')]=_0x4c9fb2[_0xba75('0x7')];writeDB(_0x3740bd);}});}}catch(_0x5c7c7f){utils[_0xba75('0x22')](util[_0xba75('0x2')]('[%s][agents][agentconnect]',_0x4c9fb2[_0xba75('0x4')]),_0x5c7c7f);}};exports[_0xba75('0xe')]=function(_0x1130ac){try{if(!_['isNil'](agents[_0x1130ac['destuniqueid']])){utils['debug'](util['format'](_0xba75('0x2e'),_0x1130ac['uniqueid']),_0x1130ac);utils[_0xba75('0x1')](util[_0xba75('0x2')](_0xba75('0x2f'),_0x1130ac[_0xba75('0x4')],agents[_0x1130ac[_0xba75('0x14')]]['membername'],_0x1130ac['destuniqueid']));agents[_0x1130ac[_0xba75('0x14')]]['agentcomplete']=!![];agents[_0x1130ac[_0xba75('0x14')]]['agentcompleteAt']=utils[_0xba75('0x17')]();agents[_0x1130ac[_0xba75('0x14')]][_0xba75('0x21')]=utils[_0xba75('0x30')](agents[_0x1130ac['destuniqueid']][_0xba75('0x31')],agents[_0x1130ac[_0xba75('0x14')]][_0xba75('0x2a')]);agents[_0x1130ac[_0xba75('0x14')]][_0xba75('0x1f')]=_0x1130ac[_0xba75('0x1f')];agents[_0x1130ac[_0xba75('0x14')]][_0xba75('0xb')]='complete';writeDB(agents[_0x1130ac[_0xba75('0x14')]]);}}catch(_0x3fe479){utils[_0xba75('0x22')](util[_0xba75('0x2')](_0xba75('0x2e'),_0x1130ac['uniqueid']),_0x3fe479);}};exports[_0xba75('0x32')]=function(_0x25ae33){try{if(!_[_0xba75('0x1b')](agents[_0x25ae33[_0xba75('0x33')]])){utils[_0xba75('0x15')](util[_0xba75('0x2')](_0xba75('0x34'),_0x25ae33['uniqueid']),_0x25ae33);utils[_0xba75('0x1')](util[_0xba75('0x2')](_0xba75('0x35'),_0x25ae33['uniqueid'],agents[_0x25ae33[_0xba75('0x33')]][_0xba75('0x7')],agents[_0x25ae33['transfereruniqueid']]['uniqueid']));agents[_0x25ae33[_0xba75('0x33')]]['transfer']=!![];agents[_0x25ae33['transfereruniqueid']][_0xba75('0x36')]='blind';agents[_0x25ae33[_0xba75('0x33')]][_0xba75('0x37')]=_0x25ae33[_0xba75('0x38')];agents[_0x25ae33[_0xba75('0x33')]][_0xba75('0x39')]=agents[_0x25ae33['transfereruniqueid']][_0xba75('0x4')];}}catch(_0x3dee66){utils['error'](util[_0xba75('0x2')](_0xba75('0x34'),_0x25ae33[_0xba75('0x4')]),_0x3dee66);}};exports[_0xba75('0x3a')]=function(_0x322fdb){try{utils['debug'](util[_0xba75('0x2')](_0xba75('0x3b'),_0x322fdb['origtransfereruniqueid']),_0x322fdb);if(_0x322fdb[_0xba75('0x3c')]==_0x322fdb[_0xba75('0x3d')]){if(!_[_0xba75('0x1b')](agents[_0x322fdb[_0xba75('0x3e')]])){utils[_0xba75('0x1')](util[_0xba75('0x2')]('[%s][agents][attendedtransfer]\x20agent:%s',_0x322fdb[_0xba75('0x3c')],agents[_0x322fdb[_0xba75('0x3e')]][_0xba75('0x7')]));agents[_0x322fdb[_0xba75('0x3e')]][_0xba75('0x3f')]=!![];agents[_0x322fdb[_0xba75('0x3e')]]['transfertype']='ATTENDED';agents[_0x322fdb['secondtransfereruniqueid']]['transferexten']=_0x322fdb[_0xba75('0x40')];agents[_0x322fdb[_0xba75('0x3e')]][_0xba75('0x39')]=_0x322fdb[_0xba75('0x3c')];}if(_0x322fdb[_0xba75('0x41')]&&agents[_0x322fdb[_0xba75('0x41')]]){agents[_0x322fdb[_0xba75('0x41')]]['agententerreason']=0x1;transfers[_0x322fdb[_0xba75('0x41')]]=_[_0xba75('0x42')](agents[_0x322fdb[_0xba75('0x41')]]);transfers[_0x322fdb[_0xba75('0x41')]]['calleridnum']=agents[_0x322fdb[_0xba75('0x3e')]][_0xba75('0x9')];transfers[_0x322fdb['transfereeuniqueid']][_0xba75('0x43')]=agents[_0x322fdb['secondtransfereruniqueid']][_0xba75('0x43')];transfers[_0x322fdb[_0xba75('0x41')]]['agentcalledAt']=utils[_0xba75('0x17')]();transfers[_0x322fdb[_0xba75('0x41')]]['agentconnectAt']=utils['now']();transfers[_0x322fdb[_0xba75('0x41')]]['holdtime']=0x0;transfers[_0x322fdb[_0xba75('0x41')]]['agententerreason']=0x2;}}else if(_0x322fdb[_0xba75('0x3e')]==_0x322fdb[_0xba75('0x44')]){if(!_[_0xba75('0x1b')](agents[_0x322fdb[_0xba75('0x3c')]])){utils[_0xba75('0x1')](util['format'](_0xba75('0x45'),_0x322fdb[_0xba75('0x3c')],agents[_0x322fdb['origtransfereruniqueid']][_0xba75('0x7')]));agents[_0x322fdb[_0xba75('0x3c')]][_0xba75('0x3f')]=!![];agents[_0x322fdb[_0xba75('0x3c')]][_0xba75('0x36')]=_0xba75('0x46');agents[_0x322fdb[_0xba75('0x3c')]][_0xba75('0x37')]=_0x322fdb[_0xba75('0x47')];agents[_0x322fdb[_0xba75('0x3c')]][_0xba75('0x39')]=_0x322fdb[_0xba75('0x3e')];}if(_0x322fdb['transfertargetuniqueid']&&agents[_0x322fdb['transfertargetuniqueid']]){agents[_0x322fdb[_0xba75('0x48')]][_0xba75('0x49')]=0x1;transfers[_0x322fdb[_0xba75('0x48')]]=_[_0xba75('0x42')](agents[_0x322fdb[_0xba75('0x48')]]);transfers[_0x322fdb[_0xba75('0x48')]][_0xba75('0x9')]=agents[_0x322fdb[_0xba75('0x3c')]][_0xba75('0x9')];transfers[_0x322fdb[_0xba75('0x48')]][_0xba75('0x43')]=agents[_0x322fdb['origtransfereruniqueid']][_0xba75('0x43')];transfers[_0x322fdb['transfertargetuniqueid']][_0xba75('0x4a')]=utils[_0xba75('0x17')]();transfers[_0x322fdb[_0xba75('0x48')]][_0xba75('0x2a')]=utils[_0xba75('0x17')]();transfers[_0x322fdb[_0xba75('0x48')]]['holdtime']=0x0;transfers[_0x322fdb[_0xba75('0x48')]]['agententerreason']=0x2;}}}catch(_0x8519a1){utils[_0xba75('0x22')](util['format']('[%s][agents][attendedtransfer]',_0x322fdb[_0xba75('0x3c')]),_0x8519a1);}};exports[_0xba75('0x4b')]=function(_0x30ef23){try{utils[_0xba75('0x15')](util[_0xba75('0x2')](_0xba75('0x4c'),_0x30ef23['uniqueid']),_0x30ef23);if(agents[_0x30ef23[_0xba75('0x4')]]&&agents[_0x30ef23[_0xba75('0x4')]]['reason']===_0xba75('0x1e')){if(_0x30ef23[_0xba75('0x4d')]==='21'){agents[_0x30ef23[_0xba75('0x4')]][_0xba75('0x1f')]=_0xba75('0x4e');agents[_0x30ef23['uniqueid']][_0xba75('0xb')]='rejected';}utils[_0xba75('0x1')](util[_0xba75('0x2')](_0xba75('0x4f'),_0x30ef23[_0xba75('0x4')],agents[_0x30ef23[_0xba75('0x4')]][_0xba75('0x7')],agents[_0x30ef23['uniqueid']]['reason'],agents[_0x30ef23[_0xba75('0x4')]]['lastevent']));writeDB(agents[_0x30ef23[_0xba75('0x4')]]);var _0x4707ef=unanswered['indexOf'](_0x30ef23[_0xba75('0x4')]);if(_0x4707ef>-0x1){unanswered[_0xba75('0x50')](_0x4707ef,0x1);}}if(transfers[_0x30ef23[_0xba75('0x4')]]){transfers[_0x30ef23['uniqueid']]['agentcomplete']=!![];transfers[_0x30ef23['uniqueid']]['agentcompleteAt']=utils['now']();transfers[_0x30ef23[_0xba75('0x4')]]['talktime']=utils[_0xba75('0x30')](transfers[_0x30ef23[_0xba75('0x4')]][_0xba75('0x31')],transfers[_0x30ef23[_0xba75('0x4')]][_0xba75('0x2a')]);transfers[_0x30ef23[_0xba75('0x4')]][_0xba75('0x1f')]='agent';transfers[_0x30ef23['uniqueid']][_0xba75('0xb')]=_0xba75('0x51');utils['info'](util[_0xba75('0x2')]('[%s][agents][hangup]\x20agent:%s\x20reason:%s\x20lastevent:%s',_0x30ef23[_0xba75('0x4')],transfers[_0x30ef23[_0xba75('0x4')]]['membername'],transfers[_0x30ef23[_0xba75('0x4')]]['reason'],transfers[_0x30ef23[_0xba75('0x4')]][_0xba75('0xb')]));writeDB(transfers[_0x30ef23['uniqueid']],!![]);}if(agents[_0x30ef23[_0xba75('0x4')]]&&agents[_0x30ef23[_0xba75('0x4')]][_0xba75('0x2a')]){agents[_0x30ef23[_0xba75('0x4')]][_0xba75('0xe')]=!![];agents[_0x30ef23[_0xba75('0x4')]][_0xba75('0x31')]=utils[_0xba75('0x17')]();agents[_0x30ef23['uniqueid']][_0xba75('0x21')]=utils[_0xba75('0x30')](agents[_0x30ef23['uniqueid']]['agentcompleteAt'],agents[_0x30ef23['uniqueid']][_0xba75('0x2a')]);agents[_0x30ef23['uniqueid']][_0xba75('0x1f')]=agents[_0x30ef23['uniqueid']][_0xba75('0x3f')]?'transfer':'agent';agents[_0x30ef23[_0xba75('0x4')]]['lastevent']=_0xba75('0x51');utils['info'](util['format'](_0xba75('0x4f'),_0x30ef23['uniqueid'],agents[_0x30ef23[_0xba75('0x4')]]['membername'],agents[_0x30ef23[_0xba75('0x4')]][_0xba75('0x1f')],agents[_0x30ef23[_0xba75('0x4')]]['lastevent']));writeDB(agents[_0x30ef23[_0xba75('0x4')]]);}}catch(_0x1de4a3){utils['error'](util[_0xba75('0x2')]('[%s][agents][hangup]',_0x30ef23['uniqueid']),_0x1de4a3);}}; \ No newline at end of file +var _0x2f68=['called','connectedlinenum','connectedlinename','info','[%s][agents][agentcalled]\x20agent:%s\x20destuniqueid:%s\x20lastevent:called','error','agentringnoanswer','isNil','[%s][agents][agentringnoanswer]\x20agent:%s\x20destuniqueid:%s\x20lastevent:timeout','agentringnoanswerAt','reason','holdtime','ringtime','talktime','push','[%s][agents][agentringnoanswer]','queuecallerabandon','forIn','includes','[%s][agents][queuecallerabandon]','[%s][agents][queuecallerabandon]\x20agent:%s\x20destuniqueid:%s\x20lastevent:abandoned','now','abandoned','agentconnect','[%s][agents][agentconnect]','answered_elsewhere','answeredelsewheredestinationuniqueid','answeredelsewheremembername','agentcomplete','[%s][agents][agentcomplete]','[%s][agents][agentcomplete]\x20agent:%s\x20destuniqueid:%s\x20lastevent:complete','agentcompleteAt','diffTime','agentconnectAt','[%s][agents][blindtransfer]','[%s][agents][blindtransfer]\x20agent:%s\x20transferuniqueid:%s','transfereruniqueid','transfer','transfertype','blind','attendedtransfer','[%s][agents][attendedtransfer]','origtransfereruniqueid','origtransfererlinkedid','[%s][agents][attendedtransfer]\x20agent:%s','secondtransfereruniqueid','transferexten','origtransfererexten','transferuniqueid','transfereeuniqueid','clone','calleridnum','calleridname','agententerreason','secondtransfererlinkedid','ATTENDED','secondtransfererexten','transfertargetuniqueid','hangup','[%s][agents][hangup]','cause','rejected','splice','complete','agent','[%s][agents][hangup]\x20agent:%s\x20reason:%s\x20lastevent:%s','util','./utils','format','uniqueid','channel','membername','interface','lastevent','queue','then','type','agentacw','acw','acwtime','acwTimeout','request','CreateVoiceAgentReport','agentcalled','debug','[%s][agents][agentcalled]','destuniqueid','agentcalledAt'];(function(_0x42ef93,_0x51408f){var _0x2d2e67=function(_0x2cb7a0){while(--_0x2cb7a0){_0x42ef93['push'](_0x42ef93['shift']());}};_0x2d2e67(++_0x51408f);}(_0x2f68,0x9a));var _0x82f6=function(_0x394ad4,_0x1f2c58){_0x394ad4=_0x394ad4-0x0;var _0x894423=_0x2f68[_0x394ad4];return _0x894423;};'use strict';var _=require('lodash');var util=require(_0x82f6('0x0'));var utils=require(_0x82f6('0x1'));var agents={};var transfers={};var unanswered=[];function writeDB(_0x24c877,_0x3a9c8f){utils['info'](util[_0x82f6('0x2')]('[%s][agents][writeDB]\x20channel:%s\x20queue:%s\x20agent:%s\x20interface:%s\x20calleridnum:%s\x20connectedlinenum:%s\x20lastevent:%s',_0x24c877[_0x82f6('0x3')],_0x24c877[_0x82f6('0x4')],_0x24c877['queue'],_0x24c877[_0x82f6('0x5')],_0x24c877[_0x82f6('0x6')],_0x24c877['calleridnum'],_0x24c877['connectedlinenum'],_0x24c877[_0x82f6('0x7')]));if(_0x24c877['queue']){utils['getVoiceQueueByName'](_0x24c877[_0x82f6('0x8')])[_0x82f6('0x9')](function(_0x250d71){if(_0x250d71){_0x24c877['type']=_0x250d71[_0x82f6('0xa')];_0x24c877[_0x82f6('0xb')]=_0x24c877['agentcomplete']?_0x250d71[_0x82f6('0xc')]:![];_0x24c877[_0x82f6('0xd')]=_0x24c877[_0x82f6('0xb')]?_0x250d71[_0x82f6('0xe')]:0x0;}utils[_0x82f6('0xf')](_0x82f6('0x10'),_0x24c877);});}else{utils['request'](_0x82f6('0x10'),_0x24c877);}if(_0x3a9c8f){delete transfers[_0x24c877[_0x82f6('0x3')]];}else{delete agents[_0x24c877['destuniqueid']];}}exports[_0x82f6('0x11')]=function(_0x1f8bf5){try{utils[_0x82f6('0x12')](util[_0x82f6('0x2')](_0x82f6('0x13'),_0x1f8bf5[_0x82f6('0x3')]),_0x1f8bf5);agents[_0x1f8bf5[_0x82f6('0x14')]]=_0x1f8bf5;agents[_0x1f8bf5[_0x82f6('0x14')]][_0x82f6('0x15')]=utils['now']();agents[_0x1f8bf5[_0x82f6('0x14')]]['lastevent']=_0x82f6('0x16');agents[_0x1f8bf5[_0x82f6('0x14')]][_0x82f6('0x17')]=null;agents[_0x1f8bf5[_0x82f6('0x14')]][_0x82f6('0x18')]=null;utils[_0x82f6('0x19')](util[_0x82f6('0x2')](_0x82f6('0x1a'),_0x1f8bf5[_0x82f6('0x3')],agents[_0x1f8bf5[_0x82f6('0x14')]][_0x82f6('0x5')],_0x1f8bf5[_0x82f6('0x14')]));}catch(_0x2652a9){utils[_0x82f6('0x1b')](util[_0x82f6('0x2')]('[%s][agents][agentcalled]',_0x1f8bf5[_0x82f6('0x3')]),_0x2652a9);}};exports[_0x82f6('0x1c')]=function(_0x55cbce){try{if(!_[_0x82f6('0x1d')](agents[_0x55cbce[_0x82f6('0x14')]])){utils[_0x82f6('0x12')](util[_0x82f6('0x2')]('[%s][agents][agentringnoanswer]',_0x55cbce[_0x82f6('0x3')]),_0x55cbce);utils['info'](util[_0x82f6('0x2')](_0x82f6('0x1e'),_0x55cbce['uniqueid'],agents[_0x55cbce['destuniqueid']][_0x82f6('0x5')],_0x55cbce[_0x82f6('0x14')]));agents[_0x55cbce['destuniqueid']]['agentringnoanswer']=!![];agents[_0x55cbce[_0x82f6('0x14')]][_0x82f6('0x1f')]=utils['now']();agents[_0x55cbce[_0x82f6('0x14')]][_0x82f6('0x7')]='timeout';agents[_0x55cbce['destuniqueid']][_0x82f6('0x20')]='timeout';agents[_0x55cbce[_0x82f6('0x14')]][_0x82f6('0x21')]=_0x55cbce['ringtime']?parseInt(_0x55cbce[_0x82f6('0x22')])/0x3e8:0x0;agents[_0x55cbce[_0x82f6('0x14')]][_0x82f6('0x23')]=0x0;unanswered[_0x82f6('0x24')](_0x55cbce['destuniqueid']);}}catch(_0x40a071){utils[_0x82f6('0x1b')](util[_0x82f6('0x2')](_0x82f6('0x25'),_0x55cbce[_0x82f6('0x3')]),_0x40a071);}};exports[_0x82f6('0x26')]=function(_0x27e473){try{_[_0x82f6('0x27')](agents,function(_0x1e1aa4,_0x402449){if(_0x1e1aa4[_0x82f6('0x3')]==_0x27e473[_0x82f6('0x3')]&&!_[_0x82f6('0x28')](unanswered,_0x1e1aa4[_0x82f6('0x14')])){utils['debug'](util[_0x82f6('0x2')](_0x82f6('0x29'),_0x27e473[_0x82f6('0x3')]),_0x27e473);utils['info'](util[_0x82f6('0x2')](_0x82f6('0x2a'),_0x27e473[_0x82f6('0x3')],_0x1e1aa4[_0x82f6('0x5')],_0x1e1aa4[_0x82f6('0x14')]));_0x1e1aa4[_0x82f6('0x1c')]=!![];_0x1e1aa4[_0x82f6('0x1f')]=utils[_0x82f6('0x2b')]();_0x1e1aa4[_0x82f6('0x7')]=_0x82f6('0x2c');_0x1e1aa4[_0x82f6('0x20')]=_0x82f6('0x2c');_0x1e1aa4[_0x82f6('0x21')]=_0x27e473[_0x82f6('0x21')];_0x1e1aa4['talktime']=0x0;writeDB(_0x1e1aa4);}});}catch(_0x13a409){utils[_0x82f6('0x1b')](util[_0x82f6('0x2')](_0x82f6('0x29'),_0x27e473[_0x82f6('0x3')]),_0x13a409);}};exports[_0x82f6('0x2d')]=function(_0x34c2f1){try{if(agents[_0x34c2f1[_0x82f6('0x14')]]){utils[_0x82f6('0x12')](util[_0x82f6('0x2')](_0x82f6('0x2e'),_0x34c2f1[_0x82f6('0x3')]),_0x34c2f1);utils[_0x82f6('0x19')](util[_0x82f6('0x2')]('[%s][agents][agentconnect]\x20agent:%s\x20destuniqueid:%s\x20lastevent:connect',_0x34c2f1[_0x82f6('0x3')],agents[_0x34c2f1['destuniqueid']]['membername'],_0x34c2f1[_0x82f6('0x14')]));agents[_0x34c2f1[_0x82f6('0x14')]]['agentconnectAt']=utils[_0x82f6('0x2b')]();agents[_0x34c2f1[_0x82f6('0x14')]][_0x82f6('0x17')]=_0x34c2f1['connectedlinenum'];agents[_0x34c2f1[_0x82f6('0x14')]]['connectedlinename']=_0x34c2f1[_0x82f6('0x18')];agents[_0x34c2f1['destuniqueid']][_0x82f6('0x21')]=_0x34c2f1['ringtime'];agents[_0x34c2f1[_0x82f6('0x14')]][_0x82f6('0x7')]='connect';_[_0x82f6('0x27')](agents,function(_0x368c11,_0x3e7c53){if(_0x368c11[_0x82f6('0x14')]!=_0x34c2f1['destuniqueid']&&_0x368c11[_0x82f6('0x3')]==_0x34c2f1[_0x82f6('0x3')]){_0x368c11[_0x82f6('0x23')]=0x0;_0x368c11[_0x82f6('0x21')]=_0x34c2f1['ringtime'];_0x368c11[_0x82f6('0x1c')]=!![];_0x368c11[_0x82f6('0x1f')]=utils['now']();_0x368c11[_0x82f6('0x7')]=_0x82f6('0x2f');_0x368c11[_0x82f6('0x20')]=_0x82f6('0x2f');_0x368c11[_0x82f6('0x30')]=_0x34c2f1['destuniqueid'];_0x368c11[_0x82f6('0x31')]=_0x34c2f1['membername'];writeDB(_0x368c11);}});}}catch(_0x139614){utils[_0x82f6('0x1b')](util[_0x82f6('0x2')](_0x82f6('0x2e'),_0x34c2f1[_0x82f6('0x3')]),_0x139614);}};exports[_0x82f6('0x32')]=function(_0x43fefc){try{if(!_['isNil'](agents[_0x43fefc[_0x82f6('0x14')]])){utils[_0x82f6('0x12')](util[_0x82f6('0x2')](_0x82f6('0x33'),_0x43fefc['uniqueid']),_0x43fefc);utils[_0x82f6('0x19')](util['format'](_0x82f6('0x34'),_0x43fefc[_0x82f6('0x3')],agents[_0x43fefc[_0x82f6('0x14')]][_0x82f6('0x5')],_0x43fefc[_0x82f6('0x14')]));agents[_0x43fefc[_0x82f6('0x14')]]['agentcomplete']=!![];agents[_0x43fefc[_0x82f6('0x14')]][_0x82f6('0x35')]=utils[_0x82f6('0x2b')]();agents[_0x43fefc[_0x82f6('0x14')]][_0x82f6('0x23')]=utils[_0x82f6('0x36')](agents[_0x43fefc[_0x82f6('0x14')]][_0x82f6('0x35')],agents[_0x43fefc['destuniqueid']][_0x82f6('0x37')]);agents[_0x43fefc[_0x82f6('0x14')]]['reason']=_0x43fefc[_0x82f6('0x20')];agents[_0x43fefc['destuniqueid']][_0x82f6('0x7')]='complete';writeDB(agents[_0x43fefc[_0x82f6('0x14')]]);}}catch(_0x31dec7){utils[_0x82f6('0x1b')](util[_0x82f6('0x2')](_0x82f6('0x33'),_0x43fefc[_0x82f6('0x3')]),_0x31dec7);}};exports['blindtransfer']=function(_0x3cb1f0){try{if(!_[_0x82f6('0x1d')](agents[_0x3cb1f0['transfereruniqueid']])){utils['debug'](util[_0x82f6('0x2')](_0x82f6('0x38'),_0x3cb1f0[_0x82f6('0x3')]),_0x3cb1f0);utils['info'](util[_0x82f6('0x2')](_0x82f6('0x39'),_0x3cb1f0[_0x82f6('0x3')],agents[_0x3cb1f0[_0x82f6('0x3a')]]['membername'],agents[_0x3cb1f0['transfereruniqueid']][_0x82f6('0x3')]));agents[_0x3cb1f0[_0x82f6('0x3a')]][_0x82f6('0x3b')]=!![];agents[_0x3cb1f0['transfereruniqueid']][_0x82f6('0x3c')]=_0x82f6('0x3d');agents[_0x3cb1f0['transfereruniqueid']]['transferexten']=_0x3cb1f0['extension'];agents[_0x3cb1f0[_0x82f6('0x3a')]]['transferuniqueid']=agents[_0x3cb1f0[_0x82f6('0x3a')]]['uniqueid'];}}catch(_0x33c359){utils['error'](util[_0x82f6('0x2')]('[%s][agents][blindtransfer]',_0x3cb1f0[_0x82f6('0x3')]),_0x33c359);}};exports[_0x82f6('0x3e')]=function(_0x44de65){try{utils[_0x82f6('0x12')](util[_0x82f6('0x2')](_0x82f6('0x3f'),_0x44de65['origtransfereruniqueid']),_0x44de65);if(_0x44de65[_0x82f6('0x40')]==_0x44de65[_0x82f6('0x41')]){if(!_[_0x82f6('0x1d')](agents[_0x44de65['secondtransfereruniqueid']])){utils['info'](util[_0x82f6('0x2')](_0x82f6('0x42'),_0x44de65[_0x82f6('0x40')],agents[_0x44de65[_0x82f6('0x43')]]['membername']));agents[_0x44de65[_0x82f6('0x43')]][_0x82f6('0x3b')]=!![];agents[_0x44de65[_0x82f6('0x43')]]['transfertype']='ATTENDED';agents[_0x44de65['secondtransfereruniqueid']][_0x82f6('0x44')]=_0x44de65[_0x82f6('0x45')];agents[_0x44de65[_0x82f6('0x43')]][_0x82f6('0x46')]=_0x44de65[_0x82f6('0x40')];}if(_0x44de65[_0x82f6('0x47')]&&agents[_0x44de65[_0x82f6('0x47')]]){agents[_0x44de65[_0x82f6('0x47')]]['agententerreason']=0x1;transfers[_0x44de65[_0x82f6('0x47')]]=_[_0x82f6('0x48')](agents[_0x44de65[_0x82f6('0x47')]]);transfers[_0x44de65[_0x82f6('0x47')]]['calleridnum']=agents[_0x44de65['secondtransfereruniqueid']][_0x82f6('0x49')];transfers[_0x44de65[_0x82f6('0x47')]]['calleridname']=agents[_0x44de65[_0x82f6('0x43')]][_0x82f6('0x4a')];transfers[_0x44de65[_0x82f6('0x47')]]['agentcalledAt']=utils[_0x82f6('0x2b')]();transfers[_0x44de65[_0x82f6('0x47')]][_0x82f6('0x37')]=utils[_0x82f6('0x2b')]();transfers[_0x44de65[_0x82f6('0x47')]][_0x82f6('0x21')]=0x0;transfers[_0x44de65['transfereeuniqueid']][_0x82f6('0x4b')]=0x2;}}else if(_0x44de65[_0x82f6('0x43')]==_0x44de65[_0x82f6('0x4c')]){if(!_[_0x82f6('0x1d')](agents[_0x44de65[_0x82f6('0x40')]])){utils['info'](util[_0x82f6('0x2')](_0x82f6('0x42'),_0x44de65[_0x82f6('0x40')],agents[_0x44de65[_0x82f6('0x40')]][_0x82f6('0x5')]));agents[_0x44de65[_0x82f6('0x40')]][_0x82f6('0x3b')]=!![];agents[_0x44de65[_0x82f6('0x40')]]['transfertype']=_0x82f6('0x4d');agents[_0x44de65['origtransfereruniqueid']][_0x82f6('0x44')]=_0x44de65[_0x82f6('0x4e')];agents[_0x44de65['origtransfereruniqueid']][_0x82f6('0x46')]=_0x44de65[_0x82f6('0x43')];}if(_0x44de65[_0x82f6('0x4f')]&&agents[_0x44de65['transfertargetuniqueid']]){agents[_0x44de65['transfertargetuniqueid']][_0x82f6('0x4b')]=0x1;transfers[_0x44de65[_0x82f6('0x4f')]]=_['clone'](agents[_0x44de65['transfertargetuniqueid']]);transfers[_0x44de65[_0x82f6('0x4f')]][_0x82f6('0x49')]=agents[_0x44de65[_0x82f6('0x40')]][_0x82f6('0x49')];transfers[_0x44de65[_0x82f6('0x4f')]][_0x82f6('0x4a')]=agents[_0x44de65[_0x82f6('0x40')]][_0x82f6('0x4a')];transfers[_0x44de65[_0x82f6('0x4f')]][_0x82f6('0x15')]=utils[_0x82f6('0x2b')]();transfers[_0x44de65[_0x82f6('0x4f')]]['agentconnectAt']=utils[_0x82f6('0x2b')]();transfers[_0x44de65[_0x82f6('0x4f')]][_0x82f6('0x21')]=0x0;transfers[_0x44de65[_0x82f6('0x4f')]][_0x82f6('0x4b')]=0x2;}}}catch(_0x4ef838){utils[_0x82f6('0x1b')](util[_0x82f6('0x2')](_0x82f6('0x3f'),_0x44de65['origtransfereruniqueid']),_0x4ef838);}};exports[_0x82f6('0x50')]=function(_0x192dc7){try{utils[_0x82f6('0x12')](util[_0x82f6('0x2')](_0x82f6('0x51'),_0x192dc7[_0x82f6('0x3')]),_0x192dc7);if(agents[_0x192dc7[_0x82f6('0x3')]]&&agents[_0x192dc7['uniqueid']][_0x82f6('0x20')]==='timeout'){if(_0x192dc7[_0x82f6('0x52')]==='21'){agents[_0x192dc7[_0x82f6('0x3')]][_0x82f6('0x20')]=_0x82f6('0x53');agents[_0x192dc7[_0x82f6('0x3')]][_0x82f6('0x7')]=_0x82f6('0x53');}utils[_0x82f6('0x19')](util[_0x82f6('0x2')]('[%s][agents][hangup]\x20agent:%s\x20reason:%s\x20lastevent:%s',_0x192dc7[_0x82f6('0x3')],agents[_0x192dc7[_0x82f6('0x3')]][_0x82f6('0x5')],agents[_0x192dc7[_0x82f6('0x3')]][_0x82f6('0x20')],agents[_0x192dc7[_0x82f6('0x3')]]['lastevent']));writeDB(agents[_0x192dc7[_0x82f6('0x3')]]);var _0x443547=unanswered['indexOf'](_0x192dc7['uniqueid']);if(_0x443547>-0x1){unanswered[_0x82f6('0x54')](_0x443547,0x1);}}if(transfers[_0x192dc7[_0x82f6('0x3')]]){transfers[_0x192dc7[_0x82f6('0x3')]][_0x82f6('0x32')]=!![];transfers[_0x192dc7[_0x82f6('0x3')]][_0x82f6('0x35')]=utils['now']();transfers[_0x192dc7[_0x82f6('0x3')]]['talktime']=utils[_0x82f6('0x36')](transfers[_0x192dc7['uniqueid']][_0x82f6('0x35')],transfers[_0x192dc7['uniqueid']][_0x82f6('0x37')]);transfers[_0x192dc7[_0x82f6('0x3')]][_0x82f6('0x20')]='agent';transfers[_0x192dc7[_0x82f6('0x3')]]['lastevent']=_0x82f6('0x55');utils[_0x82f6('0x19')](util[_0x82f6('0x2')]('[%s][agents][hangup]\x20agent:%s\x20reason:%s\x20lastevent:%s',_0x192dc7[_0x82f6('0x3')],transfers[_0x192dc7[_0x82f6('0x3')]][_0x82f6('0x5')],transfers[_0x192dc7['uniqueid']]['reason'],transfers[_0x192dc7[_0x82f6('0x3')]][_0x82f6('0x7')]));writeDB(transfers[_0x192dc7[_0x82f6('0x3')]],!![]);}if(agents[_0x192dc7[_0x82f6('0x3')]]&&agents[_0x192dc7[_0x82f6('0x3')]][_0x82f6('0x37')]){agents[_0x192dc7[_0x82f6('0x3')]][_0x82f6('0x32')]=!![];agents[_0x192dc7['uniqueid']][_0x82f6('0x35')]=utils[_0x82f6('0x2b')]();agents[_0x192dc7['uniqueid']][_0x82f6('0x23')]=utils[_0x82f6('0x36')](agents[_0x192dc7[_0x82f6('0x3')]]['agentcompleteAt'],agents[_0x192dc7[_0x82f6('0x3')]][_0x82f6('0x37')]);agents[_0x192dc7[_0x82f6('0x3')]][_0x82f6('0x20')]=agents[_0x192dc7['uniqueid']][_0x82f6('0x3b')]?_0x82f6('0x3b'):_0x82f6('0x56');agents[_0x192dc7[_0x82f6('0x3')]][_0x82f6('0x7')]=_0x82f6('0x55');utils['info'](util[_0x82f6('0x2')](_0x82f6('0x57'),_0x192dc7[_0x82f6('0x3')],agents[_0x192dc7[_0x82f6('0x3')]][_0x82f6('0x5')],agents[_0x192dc7['uniqueid']][_0x82f6('0x20')],agents[_0x192dc7['uniqueid']][_0x82f6('0x7')]));writeDB(agents[_0x192dc7[_0x82f6('0x3')]]);}}catch(_0x425e33){utils[_0x82f6('0x1b')](util[_0x82f6('0x2')](_0x82f6('0x51'),_0x192dc7[_0x82f6('0x3')]),_0x425e33);}}; \ No newline at end of file diff --git a/server/services/xdr/calls.controller.js b/server/services/xdr/calls.controller.js index 1979d45..4d77aa3 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 _0x75a4=['newchannel','debug','linkedid','OutgoingSpoolFailed','[%s][calls][newchannel]\x20context:%s\x20exten:%s','context','exten','DOCUMENTATION','[%s][calls][newchannel]','newstate','isNil','channelstate','[%s][calls][newstate]\x20context:%s\x20channel:%s','systemanswertime','now','transfer','[%s][calls][newstate]\x20linkedid:%s\x20context:%s\x20channel:%s','disposition','toNumber','ANSWERED','error','[%s][calls][newstate]','hangup','[%s][calls][hangup]','callerid','calleridname','[%s][calls][hangup]\x20callerid:%s\x20reason:%s','cause-txt','duration','diffTime','starttime','billableseconds','endtime','answertime','attendedtransfer','localtwolinkedid','[%s][calls][attendedtransfer]','transfereechannel','[%s][calls][attendedtransfer]\x20localtwolinkedid:%s\x20destinationchannel:%s','secondtransfererchannel','destinationchannel','userfield','_attended','transfertargetchannel','origtransfereruniqueid','origtransfererchannel','musiconholdstart','musiconholdstartAt','[%s][calls][musiconholdstart]\x20musiconholdstartAt:%s','[%s][calls][musiconholdstart]','[%s][calls][musiconholdstop]','mohtime','[%s][calls][musiconholdstop]\x20mohtime:%s','varset','[%s][calls][varset]','variable','xmd-originatecalleridnum','[%s][calls][varset]\x20variable:xmd-originatecalleridnum\x20value:%s','value','xmd-phone','destination','xmd-callerid-preview','xmd-callerid','[%s][calls][varset]\x20variable:%s\x20value:%s','xmd-queue','xmcs-queue','lastapplication','Queue','lastdata','xmd-contactid','[%s][calls][varset]\x20variable:xmd-contactid\x20value:%s','ContactId','xmd-cdrtype','[%s][calls][varset]\x20variable:xmd-cdrtype\x20value:%s','outboundrouteid','[%s][calls][varset]\x20variable:outboundrouteid\x20value:%s','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','substring','lastIndexOf','includes','noop','execif','gotoif','lodash','util','./utils','FAILED','NO\x20ANSWER','info','format','[%s][calls][writeDB]\x20channel:%s\x20queue:%s\x20agent:%s\x20interface:%s\x20calleridnum:%s\x20connectedlinenum:%s\x20lastevent:%s','uniqueid','channel','queue','membername','interface','calleridnum','connectedlinenum','lastevent','getUserByInternal','accountcode','UserId','CreateVoiceCallReport','request'];(function(_0x4fb675,_0x3fb007){var _0x467d92=function(_0x357a5e){while(--_0x357a5e){_0x4fb675['push'](_0x4fb675['shift']());}};_0x467d92(++_0x3fb007);}(_0x75a4,0xcf));var _0x475a=function(_0x5a2613,_0x4675e6){_0x5a2613=_0x5a2613-0x0;var _0x448d34=_0x75a4[_0x5a2613];return _0x448d34;};'use strict';var _=require(_0x475a('0x0'));var util=require(_0x475a('0x1'));var utils=require(_0x475a('0x2'));var dispositions=['NO\x20ANSWER',_0x475a('0x3'),_0x475a('0x3'),_0x475a('0x4'),_0x475a('0x4'),_0x475a('0x4'),'ANSWERED','BUSY','FAILED',_0x475a('0x3'),_0x475a('0x3')];var channels={};function writeDB(_0x24a7d3){utils[_0x475a('0x5')](util[_0x475a('0x6')](_0x475a('0x7'),_0x24a7d3[_0x475a('0x8')],_0x24a7d3[_0x475a('0x9')],_0x24a7d3[_0x475a('0xa')],_0x24a7d3[_0x475a('0xb')],_0x24a7d3[_0x475a('0xc')],_0x24a7d3[_0x475a('0xd')],_0x24a7d3[_0x475a('0xe')],_0x24a7d3[_0x475a('0xf')]));if(_0x24a7d3['accountcode']){utils[_0x475a('0x10')](_0x24a7d3[_0x475a('0x11')])['then'](function(_0x1016a2){if(_0x1016a2){_0x24a7d3[_0x475a('0x12')]=_0x1016a2['id'];}utils['request'](_0x475a('0x13'),_0x24a7d3);});}else{utils[_0x475a('0x14')]('CreateVoiceCallReport',_0x24a7d3);}if(channels[_0x24a7d3[_0x475a('0x8')]]){delete channels[_0x24a7d3[_0x475a('0x8')]];}}exports[_0x475a('0x15')]=function(_0x4aa9b5){try{utils[_0x475a('0x16')](util[_0x475a('0x6')]('[%s][calls][newchannel]',_0x4aa9b5[_0x475a('0x8')]),_0x4aa9b5);if(_0x4aa9b5[_0x475a('0x8')]==_0x4aa9b5[_0x475a('0x17')]&&_0x4aa9b5[_0x475a('0x9')]!=_0x475a('0x18')){utils[_0x475a('0x5')](util[_0x475a('0x6')](_0x475a('0x19'),_0x4aa9b5[_0x475a('0x8')],_0x4aa9b5[_0x475a('0x1a')],_0x4aa9b5[_0x475a('0x1b')]));channels[_0x4aa9b5[_0x475a('0x8')]]={'uniqueid':_0x4aa9b5[_0x475a('0x8')],'accountcode':_0x4aa9b5[_0x475a('0x11')],'source':_0x4aa9b5[_0x475a('0xd')],'destination':_0x4aa9b5[_0x475a('0x1b')],'destinationcontext':_0x4aa9b5[_0x475a('0x1a')],'channel':_0x4aa9b5['channel'],'starttime':utils['now'](),'answertime':null,'systemanswertime':null,'mohtime':0x0,'disposition':_0x475a('0x4'),'amaflags':_0x475a('0x1c')};}}catch(_0x4e4334){utils['error'](util[_0x475a('0x6')](_0x475a('0x1d'),_0x4aa9b5[_0x475a('0x8')]),_0x4e4334);}};exports[_0x475a('0x1e')]=function(_0x38d888){try{utils[_0x475a('0x16')](util[_0x475a('0x6')]('[%s][calls][newstate]',_0x38d888[_0x475a('0x8')]),_0x38d888);if(!_[_0x475a('0x1f')](channels[_0x38d888[_0x475a('0x8')]])&&_0x38d888[_0x475a('0x20')]==0x6){utils[_0x475a('0x5')](util['format'](_0x475a('0x21'),_0x38d888[_0x475a('0x8')],_0x38d888[_0x475a('0x1a')],_0x38d888[_0x475a('0x9')]));if(_[_0x475a('0x1f')](channels[_0x38d888[_0x475a('0x8')]][_0x475a('0x22')])){channels[_0x38d888[_0x475a('0x8')]][_0x475a('0x22')]=utils[_0x475a('0x23')]();}}else if(!_[_0x475a('0x1f')](channels[_0x38d888[_0x475a('0x17')]])&&_0x38d888[_0x475a('0x20')]==0x6&&_0x38d888[_0x475a('0x1a')]!=_0x475a('0x24')){utils[_0x475a('0x5')](util[_0x475a('0x6')](_0x475a('0x25'),_0x38d888[_0x475a('0x8')],_0x38d888[_0x475a('0x17')],_0x38d888[_0x475a('0x1a')],_0x38d888[_0x475a('0x9')]));channels[_0x38d888[_0x475a('0x17')]]['accountcode']=_0x38d888[_0x475a('0x11')];channels[_0x38d888[_0x475a('0x17')]]['destinationchannel']=_0x38d888[_0x475a('0x9')];if(_['isNil'](channels[_0x38d888[_0x475a('0x17')]]['answertime'])){channels[_0x38d888[_0x475a('0x17')]]['answertime']=utils[_0x475a('0x23')]();}channels[_0x38d888[_0x475a('0x17')]][_0x475a('0x26')]=dispositions[_[_0x475a('0x27')](_0x38d888[_0x475a('0x20')])]||_0x475a('0x28');}}catch(_0x29a601){utils[_0x475a('0x29')](util['format'](_0x475a('0x2a'),_0x38d888['uniqueid']),_0x29a601);}};exports[_0x475a('0x2b')]=function(_0x29a988){try{if(!_['isNil'](channels[_0x29a988[_0x475a('0x8')]])){utils[_0x475a('0x16')](util[_0x475a('0x6')](_0x475a('0x2c'),_0x29a988[_0x475a('0x8')]),_0x29a988);if(_['isNil'](channels[_0x29a988[_0x475a('0x8')]][_0x475a('0x2d')])){channels[_0x29a988['uniqueid']][_0x475a('0x2d')]=_0x29a988[_0x475a('0x2e')]+'\x20<'+_0x29a988[_0x475a('0xd')]+'>';}utils[_0x475a('0x5')](util['format'](_0x475a('0x2f'),_0x29a988[_0x475a('0x8')],channels[_0x29a988[_0x475a('0x8')]]['callerid'],_0x29a988[_0x475a('0x30')]));channels[_0x29a988[_0x475a('0x8')]]['endtime']=utils[_0x475a('0x23')]();channels[_0x29a988[_0x475a('0x8')]][_0x475a('0x31')]=utils[_0x475a('0x32')](channels[_0x29a988['uniqueid']]['endtime'],channels[_0x29a988['uniqueid']][_0x475a('0x33')]);channels[_0x29a988[_0x475a('0x8')]][_0x475a('0x34')]=channels[_0x29a988[_0x475a('0x8')]]['answertime']?utils['diffTime'](channels[_0x29a988['uniqueid']][_0x475a('0x35')],channels[_0x29a988[_0x475a('0x8')]][_0x475a('0x36')]):0x0;writeDB(channels[_0x29a988[_0x475a('0x8')]]);}}catch(_0x9a924c){utils[_0x475a('0x29')](util[_0x475a('0x6')](_0x475a('0x2c'),_0x29a988[_0x475a('0x8')]),_0x9a924c);}};exports[_0x475a('0x37')]=function(_0x41f4cd){try{if(!_[_0x475a('0x1f')](channels[_0x41f4cd[_0x475a('0x38')]])){utils[_0x475a('0x16')](util[_0x475a('0x6')](_0x475a('0x39'),_0x41f4cd['origtransfereruniqueid']),_0x41f4cd);if(channels[_0x41f4cd[_0x475a('0x38')]][_0x475a('0x9')]==_0x41f4cd[_0x475a('0x3a')]){utils['info'](util[_0x475a('0x6')](_0x475a('0x3b'),_0x41f4cd['origtransfereruniqueid'],_0x41f4cd[_0x475a('0x38')],_0x41f4cd[_0x475a('0x3c')]));channels[_0x41f4cd[_0x475a('0x38')]][_0x475a('0x3d')]=_0x41f4cd[_0x475a('0x3c')];channels[_0x41f4cd[_0x475a('0x38')]][_0x475a('0x3e')]=_0x475a('0x3f');}else if(channels[_0x41f4cd['localtwolinkedid']][_0x475a('0x9')]=_0x41f4cd[_0x475a('0x40')]){utils[_0x475a('0x5')](util[_0x475a('0x6')](_0x475a('0x3b'),_0x41f4cd[_0x475a('0x41')],_0x41f4cd['localtwolinkedid'],_0x41f4cd[_0x475a('0x42')]));channels[_0x41f4cd[_0x475a('0x38')]]['destinationchannel']=_0x41f4cd[_0x475a('0x42')];channels[_0x41f4cd[_0x475a('0x38')]][_0x475a('0x3e')]=_0x475a('0x3f');}}}catch(_0x4a8e41){utils['error'](util['format']('[%s][calls][attendedtransfer]',_0x41f4cd[_0x475a('0x41')]),_0x4a8e41);}};exports[_0x475a('0x43')]=function(_0x2fa335){try{if(!_[_0x475a('0x1f')](channels[_0x2fa335['uniqueid']])){utils[_0x475a('0x16')](util[_0x475a('0x6')]('[%s][calls][musiconholdstart]',_0x2fa335[_0x475a('0x8')]),_0x2fa335);channels[_0x2fa335[_0x475a('0x8')]][_0x475a('0x44')]=utils[_0x475a('0x23')]();utils[_0x475a('0x5')](util[_0x475a('0x6')](_0x475a('0x45'),_0x2fa335[_0x475a('0x8')],channels[_0x2fa335[_0x475a('0x8')]][_0x475a('0x44')]));}}catch(_0x45a214){utils[_0x475a('0x29')](util['format'](_0x475a('0x46'),_0x2fa335[_0x475a('0x8')]),_0x45a214);}};exports['musiconholdstop']=function(_0x51833d){try{if(!_[_0x475a('0x1f')](channels[_0x51833d['uniqueid']])){utils[_0x475a('0x16')](util[_0x475a('0x6')](_0x475a('0x47'),_0x51833d[_0x475a('0x8')]),_0x51833d);if(!_[_0x475a('0x1f')](channels[_0x51833d[_0x475a('0x8')]]['musiconholdstartAt'])){channels[_0x51833d[_0x475a('0x8')]][_0x475a('0x48')]+=utils[_0x475a('0x32')](utils['now'](),channels[_0x51833d['uniqueid']]['musiconholdstartAt']);utils[_0x475a('0x5')](util[_0x475a('0x6')](_0x475a('0x49'),_0x51833d[_0x475a('0x8')],channels[_0x51833d[_0x475a('0x8')]][_0x475a('0x48')]));delete channels[_0x51833d[_0x475a('0x8')]]['musiconholdstartAt'];}}}catch(_0xecde82){utils[_0x475a('0x29')](util[_0x475a('0x6')](_0x475a('0x47'),_0x51833d[_0x475a('0x8')]),_0xecde82);}};exports[_0x475a('0x4a')]=function(_0x429af6){try{if(!_['isNil'](channels[_0x429af6[_0x475a('0x8')]])){utils[_0x475a('0x16')](util[_0x475a('0x6')](_0x475a('0x4b'),_0x429af6[_0x475a('0x8')]),_0x429af6);if(!_[_0x475a('0x1f')](_0x429af6[_0x475a('0x4c')][_0x475a('0x4d')])){utils['info'](util[_0x475a('0x6')](_0x475a('0x4e'),_0x429af6['uniqueid'],_0x429af6[_0x475a('0x4f')]));channels[_0x429af6[_0x475a('0x8')]]['source']=_0x429af6[_0x475a('0x4f')];}if(!_[_0x475a('0x1f')](_0x429af6['variable'][_0x475a('0x50')])){utils['info'](util[_0x475a('0x6')]('[%s][calls][varset]\x20variable:xmd-phone\x20value:%s',_0x429af6[_0x475a('0x8')],_0x429af6['value']));channels[_0x429af6[_0x475a('0x8')]][_0x475a('0x51')]=_0x429af6['value'];channels[_0x429af6['uniqueid']][_0x475a('0x2d')]='\x22'+_0x429af6['value']+'\x22\x20<'+_0x429af6[_0x475a('0x4f')]+'>';}if(!_[_0x475a('0x1f')](_0x429af6['variable'][_0x475a('0x52')])||!_['isNil'](_0x429af6[_0x475a('0x4c')][_0x475a('0x53')])){utils[_0x475a('0x5')](util[_0x475a('0x6')](_0x475a('0x54'),_0x429af6[_0x475a('0x8')],!_[_0x475a('0x1f')](_0x429af6[_0x475a('0x4c')][_0x475a('0x52')])?'xmd-callerid-preview':_0x475a('0x53'),_0x429af6[_0x475a('0x4f')]));channels[_0x429af6[_0x475a('0x8')]][_0x475a('0x2d')]=_0x429af6[_0x475a('0x4f')];}if(!_[_0x475a('0x1f')](_0x429af6[_0x475a('0x4c')][_0x475a('0x55')])||!_[_0x475a('0x1f')](_0x429af6[_0x475a('0x4c')][_0x475a('0x56')])){utils['info'](util[_0x475a('0x6')](_0x475a('0x54'),_0x429af6[_0x475a('0x8')],!_[_0x475a('0x1f')](_0x429af6[_0x475a('0x4c')]['xmd-queue'])?_0x475a('0x55'):_0x475a('0x56'),_0x429af6[_0x475a('0x4f')]));channels[_0x429af6[_0x475a('0x8')]][_0x475a('0x57')]=_0x475a('0x58');channels[_0x429af6[_0x475a('0x8')]][_0x475a('0x59')]=_0x429af6['value'];channels[_0x429af6[_0x475a('0x8')]][_0x475a('0xa')]=!![];}if(!_[_0x475a('0x1f')](_0x429af6[_0x475a('0x4c')][_0x475a('0x5a')])){utils['info'](util[_0x475a('0x6')](_0x475a('0x5b'),_0x429af6[_0x475a('0x8')],_0x429af6[_0x475a('0x4f')]));channels[_0x429af6['uniqueid']][_0x475a('0x5c')]=_0x429af6[_0x475a('0x4f')];}if(!_[_0x475a('0x1f')](_0x429af6[_0x475a('0x4c')][_0x475a('0x5d')])){utils[_0x475a('0x5')](util[_0x475a('0x6')](_0x475a('0x5e'),_0x429af6[_0x475a('0x8')],_0x429af6[_0x475a('0x4f')]));channels[_0x429af6['uniqueid']]['type']=_0x429af6[_0x475a('0x4f')];}if(!_[_0x475a('0x1f')](_0x429af6[_0x475a('0x4c')][_0x475a('0x5f')])){utils[_0x475a('0x5')](util[_0x475a('0x6')](_0x475a('0x60'),_0x429af6[_0x475a('0x8')],_0x429af6[_0x475a('0x4f')]));channels[_0x429af6[_0x475a('0x8')]]['routeid']=_0x429af6['value'];}if(!_[_0x475a('0x1f')](_0x429af6[_0x475a('0x4c')][_0x475a('0x61')])){utils[_0x475a('0x5')](util['format'](_0x475a('0x62'),_0x429af6[_0x475a('0x8')],_0x429af6[_0x475a('0x4f')]));channels[_0x429af6['uniqueid']]['sipcallid']=_0x429af6[_0x475a('0x4f')];}}}catch(_0x2c6e17){utils[_0x475a('0x29')](util[_0x475a('0x6')](_0x475a('0x4b'),_0x429af6[_0x475a('0x8')]),_0x2c6e17);}};exports[_0x475a('0x63')]=function(_0xbd6924){try{if(!_[_0x475a('0x1f')](channels[_0xbd6924['uniqueid']])){utils[_0x475a('0x16')](util[_0x475a('0x6')](_0x475a('0x64'),_0xbd6924[_0x475a('0x8')]),_0xbd6924);utils[_0x475a('0x5')](util[_0x475a('0x6')](_0x475a('0x65'),_0xbd6924[_0x475a('0x8')],_0xbd6924[_0x475a('0x66')],_0xbd6924[_0x475a('0x67')]));if(_0xbd6924[_0x475a('0x66')][_0x475a('0x68')]()==_0x475a('0x69')&&_[_0x475a('0x6a')](_0xbd6924[_0x475a('0x67')][_0x475a('0x68')](),_0x475a('0x6b'))){var _0x85f590=_0xbd6924[_0x475a('0x67')]['split']('=');var _0x6bf7a=_0x85f590[0x0][_0x475a('0x6c')](_0x85f590[0x0][_0x475a('0x6d')]('(')+0x1,_0x85f590[0x0]['lastIndexOf'](')'));var _0x9a9670=_0x85f590[0x1];channels[_0xbd6924[_0x475a('0x8')]][_0x6bf7a]=_0x9a9670;}if(!_[_0x475a('0x6e')]([_0x475a('0x2b'),_0x475a('0x6f'),_0x475a('0x70'),_0x475a('0x69'),_0x475a('0x71')],_0xbd6924[_0x475a('0x66')][_0x475a('0x68')]())){channels[_0xbd6924['uniqueid']][_0x475a('0x57')]=_0xbd6924['application'];channels[_0xbd6924['uniqueid']][_0x475a('0x59')]=_0xbd6924['appdata'];}}}catch(_0x578ff7){utils[_0x475a('0x29')](util[_0x475a('0x6')](_0x475a('0x64'),_0xbd6924[_0x475a('0x8')]),_0x578ff7);}}; \ No newline at end of file +var _0x580c=['musiconholdstop','mohtime','[%s][calls][musiconholdstop]\x20mohtime:%s','[%s][calls][musiconholdstop]','varset','[%s][calls][varset]','variable','xmd-originatecalleridnum','[%s][calls][varset]\x20variable:xmd-originatecalleridnum\x20value:%s','value','xmd-phone','[%s][calls][varset]\x20variable:xmd-phone\x20value:%s','destination','\x22\x20<','xmd-callerid-preview','xmd-callerid','xmd-queue','xmcs-queue','[%s][calls][varset]\x20variable:%s\x20value:%s','lastapplication','Queue','lastdata','queue','xmd-contactid','[%s][calls][varset]\x20variable:xmd-contactid\x20value:%s','ContactId','type','outboundrouteid','[%s][calls][varset]\x20variable:outboundrouteid\x20value:%s','routeid','sipcallid','newexten','[%s][calls][newexten]','application','toLowerCase','set','startsWith','appdata','cdr','split','lastIndexOf','includes','noop','execif','gotoif','lodash','util','NO\x20ANSWER','FAILED','ANSWERED','BUSY','info','format','uniqueid','membername','interface','calleridnum','connectedlinenum','accountcode','then','request','CreateVoiceCallReport','newchannel','debug','[%s][calls][newchannel]','linkedid','channel','OutgoingSpoolFailed','context','exten','now','DOCUMENTATION','error','newstate','[%s][calls][newstate]','isNil','channelstate','[%s][calls][newstate]\x20context:%s\x20channel:%s','systemanswertime','transfer','[%s][calls][newstate]\x20linkedid:%s\x20context:%s\x20channel:%s','answertime','disposition','toNumber','hangup','[%s][calls][hangup]','callerid','calleridname','[%s][calls][hangup]\x20callerid:%s\x20reason:%s','duration','endtime','starttime','billableseconds','diffTime','attendedtransfer','localtwolinkedid','[%s][calls][attendedtransfer]','transfereechannel','[%s][calls][attendedtransfer]\x20localtwolinkedid:%s\x20destinationchannel:%s','origtransfereruniqueid','secondtransfererchannel','userfield','_attended','transfertargetchannel','origtransfererchannel','destinationchannel','musiconholdstart','[%s][calls][musiconholdstart]','musiconholdstartAt','[%s][calls][musiconholdstart]\x20musiconholdstartAt:%s'];(function(_0x167cc1,_0x56ef5a){var _0x10bc4b=function(_0xd6a255){while(--_0xd6a255){_0x167cc1['push'](_0x167cc1['shift']());}};_0x10bc4b(++_0x56ef5a);}(_0x580c,0x9b));var _0xc580=function(_0x200766,_0x5114fa){_0x200766=_0x200766-0x0;var _0x8cc5d1=_0x580c[_0x200766];return _0x8cc5d1;};'use strict';var _=require(_0xc580('0x0'));var util=require(_0xc580('0x1'));var utils=require('./utils');var dispositions=[_0xc580('0x2'),_0xc580('0x3'),_0xc580('0x3'),_0xc580('0x2'),'NO\x20ANSWER',_0xc580('0x2'),_0xc580('0x4'),_0xc580('0x5'),_0xc580('0x3'),_0xc580('0x3'),'FAILED'];var channels={};function writeDB(_0xda0378){utils[_0xc580('0x6')](util[_0xc580('0x7')]('[%s][calls][writeDB]\x20channel:%s\x20queue:%s\x20agent:%s\x20interface:%s\x20calleridnum:%s\x20connectedlinenum:%s\x20lastevent:%s',_0xda0378[_0xc580('0x8')],_0xda0378['channel'],_0xda0378['queue'],_0xda0378[_0xc580('0x9')],_0xda0378[_0xc580('0xa')],_0xda0378[_0xc580('0xb')],_0xda0378[_0xc580('0xc')],_0xda0378['lastevent']));if(_0xda0378[_0xc580('0xd')]){utils['getUserByInternal'](_0xda0378['accountcode'])[_0xc580('0xe')](function(_0x5d3f27){if(_0x5d3f27){_0xda0378['UserId']=_0x5d3f27['id'];}utils[_0xc580('0xf')]('CreateVoiceCallReport',_0xda0378);});}else{utils[_0xc580('0xf')](_0xc580('0x10'),_0xda0378);}if(channels[_0xda0378[_0xc580('0x8')]]){delete channels[_0xda0378[_0xc580('0x8')]];}}exports[_0xc580('0x11')]=function(_0x142e00){try{utils[_0xc580('0x12')](util[_0xc580('0x7')](_0xc580('0x13'),_0x142e00[_0xc580('0x8')]),_0x142e00);if(_0x142e00[_0xc580('0x8')]==_0x142e00[_0xc580('0x14')]&&_0x142e00[_0xc580('0x15')]!=_0xc580('0x16')){utils[_0xc580('0x6')](util[_0xc580('0x7')]('[%s][calls][newchannel]\x20context:%s\x20exten:%s',_0x142e00[_0xc580('0x8')],_0x142e00[_0xc580('0x17')],_0x142e00[_0xc580('0x18')]));channels[_0x142e00[_0xc580('0x8')]]={'uniqueid':_0x142e00[_0xc580('0x8')],'accountcode':_0x142e00[_0xc580('0xd')],'source':_0x142e00[_0xc580('0xb')],'destination':_0x142e00[_0xc580('0x18')],'destinationcontext':_0x142e00[_0xc580('0x17')],'channel':_0x142e00[_0xc580('0x15')],'starttime':utils[_0xc580('0x19')](),'answertime':null,'systemanswertime':null,'mohtime':0x0,'disposition':_0xc580('0x2'),'amaflags':_0xc580('0x1a')};}}catch(_0x5fa98b){utils[_0xc580('0x1b')](util[_0xc580('0x7')](_0xc580('0x13'),_0x142e00['uniqueid']),_0x5fa98b);}};exports[_0xc580('0x1c')]=function(_0x329114){try{utils[_0xc580('0x12')](util['format'](_0xc580('0x1d'),_0x329114[_0xc580('0x8')]),_0x329114);if(!_[_0xc580('0x1e')](channels[_0x329114[_0xc580('0x8')]])&&_0x329114[_0xc580('0x1f')]==0x6){utils[_0xc580('0x6')](util[_0xc580('0x7')](_0xc580('0x20'),_0x329114[_0xc580('0x8')],_0x329114['context'],_0x329114[_0xc580('0x15')]));if(_['isNil'](channels[_0x329114[_0xc580('0x8')]]['systemanswertime'])){channels[_0x329114['uniqueid']][_0xc580('0x21')]=utils[_0xc580('0x19')]();}}else if(!_['isNil'](channels[_0x329114[_0xc580('0x14')]])&&_0x329114[_0xc580('0x1f')]==0x6&&_0x329114[_0xc580('0x17')]!=_0xc580('0x22')){utils[_0xc580('0x6')](util['format'](_0xc580('0x23'),_0x329114[_0xc580('0x8')],_0x329114['linkedid'],_0x329114[_0xc580('0x17')],_0x329114[_0xc580('0x15')]));channels[_0x329114[_0xc580('0x14')]][_0xc580('0xd')]=_0x329114['accountcode'];channels[_0x329114['linkedid']]['destinationchannel']=_0x329114[_0xc580('0x15')];if(_[_0xc580('0x1e')](channels[_0x329114[_0xc580('0x14')]][_0xc580('0x24')])){channels[_0x329114[_0xc580('0x14')]][_0xc580('0x24')]=utils['now']();}channels[_0x329114[_0xc580('0x14')]][_0xc580('0x25')]=dispositions[_[_0xc580('0x26')](_0x329114[_0xc580('0x1f')])]||_0xc580('0x4');}}catch(_0x30e781){utils[_0xc580('0x1b')](util[_0xc580('0x7')]('[%s][calls][newstate]',_0x329114['uniqueid']),_0x30e781);}};exports[_0xc580('0x27')]=function(_0x1355c2){try{if(!_[_0xc580('0x1e')](channels[_0x1355c2[_0xc580('0x8')]])){utils[_0xc580('0x12')](util['format'](_0xc580('0x28'),_0x1355c2[_0xc580('0x8')]),_0x1355c2);if(_[_0xc580('0x1e')](channels[_0x1355c2[_0xc580('0x8')]]['callerid'])){channels[_0x1355c2[_0xc580('0x8')]][_0xc580('0x29')]=_0x1355c2[_0xc580('0x2a')]+'\x20<'+_0x1355c2[_0xc580('0xb')]+'>';}utils[_0xc580('0x6')](util['format'](_0xc580('0x2b'),_0x1355c2['uniqueid'],channels[_0x1355c2[_0xc580('0x8')]][_0xc580('0x29')],_0x1355c2['cause-txt']));channels[_0x1355c2['uniqueid']]['endtime']=utils['now']();channels[_0x1355c2[_0xc580('0x8')]][_0xc580('0x2c')]=utils['diffTime'](channels[_0x1355c2[_0xc580('0x8')]][_0xc580('0x2d')],channels[_0x1355c2['uniqueid']][_0xc580('0x2e')]);channels[_0x1355c2[_0xc580('0x8')]][_0xc580('0x2f')]=channels[_0x1355c2['uniqueid']][_0xc580('0x24')]?utils[_0xc580('0x30')](channels[_0x1355c2[_0xc580('0x8')]][_0xc580('0x2d')],channels[_0x1355c2['uniqueid']][_0xc580('0x24')]):0x0;writeDB(channels[_0x1355c2['uniqueid']]);}}catch(_0x195b81){utils[_0xc580('0x1b')](util['format'](_0xc580('0x28'),_0x1355c2['uniqueid']),_0x195b81);}};exports[_0xc580('0x31')]=function(_0x513f6a){try{if(!_[_0xc580('0x1e')](channels[_0x513f6a[_0xc580('0x32')]])){utils[_0xc580('0x12')](util['format'](_0xc580('0x33'),_0x513f6a['origtransfereruniqueid']),_0x513f6a);if(channels[_0x513f6a[_0xc580('0x32')]][_0xc580('0x15')]==_0x513f6a[_0xc580('0x34')]){utils[_0xc580('0x6')](util[_0xc580('0x7')](_0xc580('0x35'),_0x513f6a[_0xc580('0x36')],_0x513f6a[_0xc580('0x32')],_0x513f6a['secondtransfererchannel']));channels[_0x513f6a['localtwolinkedid']]['destinationchannel']=_0x513f6a[_0xc580('0x37')];channels[_0x513f6a[_0xc580('0x32')]][_0xc580('0x38')]=_0xc580('0x39');}else if(channels[_0x513f6a[_0xc580('0x32')]][_0xc580('0x15')]=_0x513f6a[_0xc580('0x3a')]){utils[_0xc580('0x6')](util[_0xc580('0x7')](_0xc580('0x35'),_0x513f6a[_0xc580('0x36')],_0x513f6a[_0xc580('0x32')],_0x513f6a[_0xc580('0x3b')]));channels[_0x513f6a[_0xc580('0x32')]][_0xc580('0x3c')]=_0x513f6a[_0xc580('0x3b')];channels[_0x513f6a[_0xc580('0x32')]][_0xc580('0x38')]=_0xc580('0x39');}}}catch(_0x55719c){utils['error'](util[_0xc580('0x7')](_0xc580('0x33'),_0x513f6a['origtransfereruniqueid']),_0x55719c);}};exports[_0xc580('0x3d')]=function(_0x4228b9){try{if(!_[_0xc580('0x1e')](channels[_0x4228b9[_0xc580('0x8')]])){utils[_0xc580('0x12')](util[_0xc580('0x7')](_0xc580('0x3e'),_0x4228b9[_0xc580('0x8')]),_0x4228b9);channels[_0x4228b9[_0xc580('0x8')]][_0xc580('0x3f')]=utils[_0xc580('0x19')]();utils[_0xc580('0x6')](util['format'](_0xc580('0x40'),_0x4228b9[_0xc580('0x8')],channels[_0x4228b9[_0xc580('0x8')]][_0xc580('0x3f')]));}}catch(_0x2b7c01){utils['error'](util['format'](_0xc580('0x3e'),_0x4228b9[_0xc580('0x8')]),_0x2b7c01);}};exports[_0xc580('0x41')]=function(_0x317443){try{if(!_['isNil'](channels[_0x317443[_0xc580('0x8')]])){utils['debug'](util[_0xc580('0x7')]('[%s][calls][musiconholdstop]',_0x317443[_0xc580('0x8')]),_0x317443);if(!_[_0xc580('0x1e')](channels[_0x317443['uniqueid']]['musiconholdstartAt'])){channels[_0x317443[_0xc580('0x8')]][_0xc580('0x42')]+=utils['diffTime'](utils['now'](),channels[_0x317443[_0xc580('0x8')]][_0xc580('0x3f')]);utils[_0xc580('0x6')](util[_0xc580('0x7')](_0xc580('0x43'),_0x317443['uniqueid'],channels[_0x317443['uniqueid']][_0xc580('0x42')]));delete channels[_0x317443[_0xc580('0x8')]][_0xc580('0x3f')];}}}catch(_0x55033b){utils['error'](util['format'](_0xc580('0x44'),_0x317443[_0xc580('0x8')]),_0x55033b);}};exports[_0xc580('0x45')]=function(_0xd2f986){try{if(!_['isNil'](channels[_0xd2f986[_0xc580('0x8')]])){utils['debug'](util['format'](_0xc580('0x46'),_0xd2f986['uniqueid']),_0xd2f986);if(!_['isNil'](_0xd2f986[_0xc580('0x47')][_0xc580('0x48')])){utils['info'](util['format'](_0xc580('0x49'),_0xd2f986[_0xc580('0x8')],_0xd2f986[_0xc580('0x4a')]));channels[_0xd2f986['uniqueid']]['source']=_0xd2f986[_0xc580('0x4a')];}if(!_['isNil'](_0xd2f986['variable'][_0xc580('0x4b')])){utils['info'](util[_0xc580('0x7')](_0xc580('0x4c'),_0xd2f986[_0xc580('0x8')],_0xd2f986[_0xc580('0x4a')]));channels[_0xd2f986[_0xc580('0x8')]][_0xc580('0x4d')]=_0xd2f986[_0xc580('0x4a')];channels[_0xd2f986[_0xc580('0x8')]][_0xc580('0x29')]='\x22'+_0xd2f986[_0xc580('0x4a')]+_0xc580('0x4e')+_0xd2f986['value']+'>';}if(!_['isNil'](_0xd2f986[_0xc580('0x47')][_0xc580('0x4f')])||!_['isNil'](_0xd2f986[_0xc580('0x47')][_0xc580('0x50')])){utils[_0xc580('0x6')](util[_0xc580('0x7')]('[%s][calls][varset]\x20variable:%s\x20value:%s',_0xd2f986[_0xc580('0x8')],!_['isNil'](_0xd2f986[_0xc580('0x47')][_0xc580('0x4f')])?'xmd-callerid-preview':_0xc580('0x50'),_0xd2f986[_0xc580('0x4a')]));channels[_0xd2f986['uniqueid']][_0xc580('0x29')]=_0xd2f986[_0xc580('0x4a')];}if(!_[_0xc580('0x1e')](_0xd2f986[_0xc580('0x47')][_0xc580('0x51')])||!_['isNil'](_0xd2f986[_0xc580('0x47')][_0xc580('0x52')])){utils[_0xc580('0x6')](util[_0xc580('0x7')](_0xc580('0x53'),_0xd2f986[_0xc580('0x8')],!_[_0xc580('0x1e')](_0xd2f986[_0xc580('0x47')][_0xc580('0x51')])?_0xc580('0x51'):_0xc580('0x52'),_0xd2f986[_0xc580('0x4a')]));channels[_0xd2f986[_0xc580('0x8')]][_0xc580('0x54')]=_0xc580('0x55');channels[_0xd2f986[_0xc580('0x8')]][_0xc580('0x56')]=_0xd2f986['value'];channels[_0xd2f986['uniqueid']][_0xc580('0x57')]=!![];}if(!_[_0xc580('0x1e')](_0xd2f986['variable'][_0xc580('0x58')])){utils[_0xc580('0x6')](util[_0xc580('0x7')](_0xc580('0x59'),_0xd2f986[_0xc580('0x8')],_0xd2f986[_0xc580('0x4a')]));channels[_0xd2f986[_0xc580('0x8')]][_0xc580('0x5a')]=_0xd2f986[_0xc580('0x4a')];}if(!_[_0xc580('0x1e')](_0xd2f986[_0xc580('0x47')]['xmd-cdrtype'])){utils[_0xc580('0x6')](util[_0xc580('0x7')]('[%s][calls][varset]\x20variable:xmd-cdrtype\x20value:%s',_0xd2f986['uniqueid'],_0xd2f986[_0xc580('0x4a')]));channels[_0xd2f986[_0xc580('0x8')]][_0xc580('0x5b')]=_0xd2f986[_0xc580('0x4a')];}if(!_[_0xc580('0x1e')](_0xd2f986[_0xc580('0x47')][_0xc580('0x5c')])){utils[_0xc580('0x6')](util[_0xc580('0x7')](_0xc580('0x5d'),_0xd2f986[_0xc580('0x8')],_0xd2f986[_0xc580('0x4a')]));channels[_0xd2f986[_0xc580('0x8')]][_0xc580('0x5e')]=_0xd2f986[_0xc580('0x4a')];}if(!_[_0xc580('0x1e')](_0xd2f986[_0xc580('0x47')][_0xc580('0x5f')])){utils[_0xc580('0x6')](util[_0xc580('0x7')]('[%s][calls][varset]\x20variable:sipcallid\x20value:%s',_0xd2f986[_0xc580('0x8')],_0xd2f986[_0xc580('0x4a')]));channels[_0xd2f986['uniqueid']][_0xc580('0x5f')]=_0xd2f986['value'];}}}catch(_0x4a33a3){utils[_0xc580('0x1b')](util[_0xc580('0x7')](_0xc580('0x46'),_0xd2f986[_0xc580('0x8')]),_0x4a33a3);}};exports[_0xc580('0x60')]=function(_0x2cdc69){try{if(!_[_0xc580('0x1e')](channels[_0x2cdc69[_0xc580('0x8')]])){utils[_0xc580('0x12')](util[_0xc580('0x7')](_0xc580('0x61'),_0x2cdc69[_0xc580('0x8')]),_0x2cdc69);utils[_0xc580('0x6')](util[_0xc580('0x7')]('[%s][calls][newexten]\x20application:%s\x20appdata:%s',_0x2cdc69[_0xc580('0x8')],_0x2cdc69[_0xc580('0x62')],_0x2cdc69['appdata']));if(_0x2cdc69[_0xc580('0x62')][_0xc580('0x63')]()==_0xc580('0x64')&&_[_0xc580('0x65')](_0x2cdc69[_0xc580('0x66')][_0xc580('0x63')](),_0xc580('0x67'))){var _0x247f83=_0x2cdc69[_0xc580('0x66')][_0xc580('0x68')]('=');var _0x1fe066=_0x247f83[0x0]['substring'](_0x247f83[0x0][_0xc580('0x69')]('(')+0x1,_0x247f83[0x0][_0xc580('0x69')](')'));var _0x3cecb8=_0x247f83[0x1];channels[_0x2cdc69['uniqueid']][_0x1fe066]=_0x3cecb8;}if(!_[_0xc580('0x6a')]([_0xc580('0x27'),_0xc580('0x6b'),_0xc580('0x6c'),_0xc580('0x64'),_0xc580('0x6d')],_0x2cdc69['application'][_0xc580('0x63')]())){channels[_0x2cdc69[_0xc580('0x8')]]['lastapplication']=_0x2cdc69[_0xc580('0x62')];channels[_0x2cdc69[_0xc580('0x8')]]['lastdata']=_0x2cdc69[_0xc580('0x66')];}}}catch(_0x56120a){utils[_0xc580('0x1b')](util['format']('[%s][calls][newexten]',_0x2cdc69[_0xc580('0x8')]),_0x56120a);}}; \ No newline at end of file diff --git a/server/services/xdr/core.controller.js b/server/services/xdr/core.controller.js index e4567d2..c5ddd36 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 _0x6649=['[core]\x20connected','shutdown','info','[core]\x20shutdown','fullybooted','[core]\x20fullybooted','error','close','./utils','connect'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x6649,0x1f2));var _0x9664=function(_0x28364,_0xd13c78){_0x28364=_0x28364-0x0;var _0x42b595=_0x6649[_0x28364];return _0x42b595;};'use strict';var utils=require(_0x9664('0x0'));exports[_0x9664('0x1')]=function(){utils['info'](_0x9664('0x2'));};exports[_0x9664('0x3')]=function(){utils[_0x9664('0x4')](_0x9664('0x5'));};exports[_0x9664('0x6')]=function(){utils['info'](_0x9664('0x7'));};exports[_0x9664('0x8')]=function(_0x4bb0b6){utils[_0x9664('0x8')]('[core]\x20error',_0x4bb0b6);};exports[_0x9664('0x9')]=function(){utils[_0x9664('0x4')]('[core]\x20close');};exports['managerevent']=function(_0x580562){}; \ No newline at end of file +var _0x4f67=['managerevent','connect','info','[core]\x20fullybooted','error','close','[core]\x20close'];(function(_0x3b031a,_0x4f6b74){var _0x8fc0e4=function(_0x1927b3){while(--_0x1927b3){_0x3b031a['push'](_0x3b031a['shift']());}};_0x8fc0e4(++_0x4f6b74);}(_0x4f67,0x16d));var _0x74f6=function(_0x2a6809,_0x44edde){_0x2a6809=_0x2a6809-0x0;var _0x11c371=_0x4f67[_0x2a6809];return _0x11c371;};'use strict';var utils=require('./utils');exports[_0x74f6('0x0')]=function(){utils['info']('[core]\x20connected');};exports['shutdown']=function(){utils[_0x74f6('0x1')]('[core]\x20shutdown');};exports['fullybooted']=function(){utils['info'](_0x74f6('0x2'));};exports['error']=function(_0x44066a){utils[_0x74f6('0x3')]('[core]\x20error',_0x44066a);};exports[_0x74f6('0x4')]=function(){utils[_0x74f6('0x1')](_0x74f6('0x5'));};exports[_0x74f6('0x6')]=function(_0x5a9ef9){}; \ No newline at end of file diff --git a/server/services/xdr/dials.controller.js b/server/services/xdr/dials.controller.js index d50921b..98b93d1 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 _0x6f5d=['startsWith','appdata','toLowerCase','split','error','varset','[%s][dials][varset]','isNil','variable','outboundrouteid','[%s][dials][varset]\x20variable:outboundrouteid\x20value:%s','value','[%s][dials][dialbegin]','assign','now','called','[%s][dials][dialend]','ANSWER','connect','[%s][dials][dialend]\x20dialstatus:%s\x20answertime:%s\x20lastevent:connect','answertime','[%s][dials][dialend]\x20dialstatus:%s','[%s][dials][hangup]','[%s][dials][hangup]\x20calleridnum:%s\x20calleridname:%s\x20lastevent:complete\x20reason:%s','calleridnum','calleridname','cause-txt','duration','endtime','holdtime','diffTime','starttime','billableseconds','lodash','info','format','[%s][dials][writeDB]\x20channel:%s\x20dialstring:%s\x20calleridnum:%s\x20connectedlinenum:%s\x20dialstatus:%s','uniqueid','channel','connectedlinenum','dialstatus','request','CreateVoiceDialReport','newexten','debug','[%s][dials][newexten]','[%s][dials][newexten]\x20application:%s\x20appdata:%s','application','set'];(function(_0x3404af,_0x40d2fe){var _0x197ade=function(_0x1bf977){while(--_0x1bf977){_0x3404af['push'](_0x3404af['shift']());}};_0x197ade(++_0x40d2fe);}(_0x6f5d,0x116));var _0xd6f5=function(_0x1f063b,_0x53088f){_0x1f063b=_0x1f063b-0x0;var _0x4db984=_0x6f5d[_0x1f063b];return _0x4db984;};'use strict';var _=require(_0xd6f5('0x0'));var util=require('util');var utils=require('./utils');var dials={};function writeDB(_0x4359a4){utils[_0xd6f5('0x1')](util[_0xd6f5('0x2')](_0xd6f5('0x3'),_0x4359a4[_0xd6f5('0x4')],_0x4359a4[_0xd6f5('0x5')],_0x4359a4['dialstring'],_0x4359a4['calleridnum'],_0x4359a4[_0xd6f5('0x6')],_0x4359a4[_0xd6f5('0x7')]));utils[_0xd6f5('0x8')](_0xd6f5('0x9'),_0x4359a4);delete dials[_0x4359a4[_0xd6f5('0x4')]];}exports[_0xd6f5('0xa')]=function(_0x2b17c8){try{utils[_0xd6f5('0xb')](util['format'](_0xd6f5('0xc'),_0x2b17c8[_0xd6f5('0x4')]),_0x2b17c8);utils[_0xd6f5('0x1')](util[_0xd6f5('0x2')](_0xd6f5('0xd'),_0x2b17c8['uniqueid'],_0x2b17c8['application'],_0x2b17c8['appdata']));if(_0x2b17c8[_0xd6f5('0xe')]['toLowerCase']()==_0xd6f5('0xf')&&_[_0xd6f5('0x10')](_0x2b17c8[_0xd6f5('0x11')][_0xd6f5('0x12')](),'cdr(routeid)')){var _0x137107=_0x2b17c8['appdata'][_0xd6f5('0x13')]('=');dials[_0x2b17c8[_0xd6f5('0x4')]]={'routeId':_0x137107[0x1]};}}catch(_0x141825){utils[_0xd6f5('0x14')](util[_0xd6f5('0x2')]('[%s][dials][newexten]',_0x2b17c8[_0xd6f5('0x4')]),_0x141825);}};exports[_0xd6f5('0x15')]=function(_0x8b8e6f){try{utils[_0xd6f5('0xb')](util[_0xd6f5('0x2')](_0xd6f5('0x16'),_0x8b8e6f[_0xd6f5('0x4')]),_0x8b8e6f);if(!_[_0xd6f5('0x17')](_0x8b8e6f[_0xd6f5('0x18')][_0xd6f5('0x19')])){utils[_0xd6f5('0x1')](util[_0xd6f5('0x2')](_0xd6f5('0x1a'),_0x8b8e6f[_0xd6f5('0x4')],_0x8b8e6f[_0xd6f5('0x1b')]));dials[_0x8b8e6f[_0xd6f5('0x4')]]={'routeId':_0x8b8e6f['value']};}}catch(_0x265e2c){utils[_0xd6f5('0x14')](util[_0xd6f5('0x2')]('[%s][dials][varset]',_0x8b8e6f[_0xd6f5('0x4')]),_0x265e2c);}};exports['dialbegin']=function(_0x1bc2e9){try{if(!_['isNil'](dials[_0x1bc2e9[_0xd6f5('0x4')]])){utils[_0xd6f5('0xb')](util[_0xd6f5('0x2')](_0xd6f5('0x1c'),_0x1bc2e9[_0xd6f5('0x4')]),_0x1bc2e9);dials[_0x1bc2e9[_0xd6f5('0x4')]]=_[_0xd6f5('0x1d')](dials[_0x1bc2e9[_0xd6f5('0x4')]],_0x1bc2e9);dials[_0x1bc2e9['uniqueid']]['starttime']=utils[_0xd6f5('0x1e')]();dials[_0x1bc2e9[_0xd6f5('0x4')]]['lastevent']=_0xd6f5('0x1f');utils['info'](util[_0xd6f5('0x2')]('[%s][dials][hangup]\x20starttime:%s\x20lastevent:called',_0x1bc2e9['uniqueid'],dials[_0x1bc2e9[_0xd6f5('0x4')]]['starttime']));}}catch(_0x158cb0){utils['error'](util[_0xd6f5('0x2')](_0xd6f5('0x1c'),_0x1bc2e9['uniqueid']),_0x158cb0);}};exports['dialend']=function(_0x553ecd){try{if(!_[_0xd6f5('0x17')](dials[_0x553ecd[_0xd6f5('0x4')]])){utils[_0xd6f5('0xb')](util[_0xd6f5('0x2')](_0xd6f5('0x20'),_0x553ecd[_0xd6f5('0x4')]),_0x553ecd);dials[_0x553ecd['uniqueid']][_0xd6f5('0x7')]=_0x553ecd[_0xd6f5('0x7')];if(_0x553ecd['dialstatus']==_0xd6f5('0x21')){dials[_0x553ecd['uniqueid']]=_['assign'](dials[_0x553ecd[_0xd6f5('0x4')]],_0x553ecd);dials[_0x553ecd[_0xd6f5('0x4')]]['answertime']=utils[_0xd6f5('0x1e')]();dials[_0x553ecd[_0xd6f5('0x4')]]['lastevent']=_0xd6f5('0x22');utils[_0xd6f5('0x1')](util['format'](_0xd6f5('0x23'),_0x553ecd['uniqueid'],_0x553ecd['dialstatus'],dials[_0x553ecd[_0xd6f5('0x4')]][_0xd6f5('0x24')]));}else{utils[_0xd6f5('0x1')](util[_0xd6f5('0x2')](_0xd6f5('0x25'),_0x553ecd[_0xd6f5('0x4')],_0x553ecd[_0xd6f5('0x7')]));}}}catch(_0xd7a87a){utils['error'](util[_0xd6f5('0x2')](_0xd6f5('0x20'),_0x553ecd['uniqueid']),_0xd7a87a);}};exports['hangup']=function(_0x9fc52d){try{if(!_[_0xd6f5('0x17')](dials[_0x9fc52d['uniqueid']])){utils['debug'](util[_0xd6f5('0x2')](_0xd6f5('0x26'),_0x9fc52d[_0xd6f5('0x4')]),_0x9fc52d);utils[_0xd6f5('0x1')](util['format'](_0xd6f5('0x27'),_0x9fc52d['uniqueid'],_0x9fc52d[_0xd6f5('0x28')],_0x9fc52d[_0xd6f5('0x29')],_0x9fc52d[_0xd6f5('0x2a')]));dials[_0x9fc52d[_0xd6f5('0x4')]]=_['assign'](dials[_0x9fc52d[_0xd6f5('0x4')]],{'endtime':utils['now'](),'lastevent':'complete'});dials[_0x9fc52d[_0xd6f5('0x4')]][_0xd6f5('0x2b')]=utils['diffTime'](dials[_0x9fc52d['uniqueid']][_0xd6f5('0x2c')],dials[_0x9fc52d['uniqueid']]['starttime']);dials[_0x9fc52d['uniqueid']][_0xd6f5('0x2d')]=utils[_0xd6f5('0x2e')](dials[_0x9fc52d[_0xd6f5('0x4')]][_0xd6f5('0x24')]||dials[_0x9fc52d[_0xd6f5('0x4')]][_0xd6f5('0x2c')],dials[_0x9fc52d[_0xd6f5('0x4')]][_0xd6f5('0x2f')]);dials[_0x9fc52d[_0xd6f5('0x4')]][_0xd6f5('0x30')]=dials[_0x9fc52d[_0xd6f5('0x4')]][_0xd6f5('0x24')]?utils[_0xd6f5('0x2e')](dials[_0x9fc52d[_0xd6f5('0x4')]][_0xd6f5('0x2c')],dials[_0x9fc52d['uniqueid']]['answertime']):0x0;writeDB(dials[_0x9fc52d['uniqueid']]);}}catch(_0x7fc17){utils[_0xd6f5('0x14')](util[_0xd6f5('0x2')](_0xd6f5('0x26'),_0x9fc52d[_0xd6f5('0x4')]),_0x7fc17);}}; \ No newline at end of file +var _0x2e35=['value','dialbegin','isNil','[%s][dials][dialbegin]','assign','starttime','called','error','dialend','[%s][dials][dialend]','dialstatus','ANSWER','now','[%s][dials][dialend]\x20dialstatus:%s\x20answertime:%s\x20lastevent:connect','[%s][dials][dialend]\x20dialstatus:%s','[%s][dials][hangup]','[%s][dials][hangup]\x20calleridnum:%s\x20calleridname:%s\x20lastevent:complete\x20reason:%s','calleridname','complete','duration','diffTime','endtime','holdtime','answertime','billableseconds','lodash','util','./utils','info','uniqueid','channel','dialstring','calleridnum','request','CreateVoiceDialReport','newexten','debug','format','[%s][dials][newexten]','[%s][dials][newexten]\x20application:%s\x20appdata:%s','application','appdata','set','startsWith','cdr(routeid)','split','varset','variable','outboundrouteid','[%s][dials][varset]\x20variable:outboundrouteid\x20value:%s'];(function(_0x56efde,_0x2e617a){var _0x24cfb2=function(_0x126ed6){while(--_0x126ed6){_0x56efde['push'](_0x56efde['shift']());}};_0x24cfb2(++_0x2e617a);}(_0x2e35,0x145));var _0x52e3=function(_0x20be69,_0xef6ffa){_0x20be69=_0x20be69-0x0;var _0x3e005d=_0x2e35[_0x20be69];return _0x3e005d;};'use strict';var _=require(_0x52e3('0x0'));var util=require(_0x52e3('0x1'));var utils=require(_0x52e3('0x2'));var dials={};function writeDB(_0x2e37de){utils[_0x52e3('0x3')](util['format']('[%s][dials][writeDB]\x20channel:%s\x20dialstring:%s\x20calleridnum:%s\x20connectedlinenum:%s\x20dialstatus:%s',_0x2e37de[_0x52e3('0x4')],_0x2e37de[_0x52e3('0x5')],_0x2e37de[_0x52e3('0x6')],_0x2e37de[_0x52e3('0x7')],_0x2e37de['connectedlinenum'],_0x2e37de['dialstatus']));utils[_0x52e3('0x8')](_0x52e3('0x9'),_0x2e37de);delete dials[_0x2e37de[_0x52e3('0x4')]];}exports[_0x52e3('0xa')]=function(_0x11c977){try{utils[_0x52e3('0xb')](util[_0x52e3('0xc')](_0x52e3('0xd'),_0x11c977['uniqueid']),_0x11c977);utils[_0x52e3('0x3')](util[_0x52e3('0xc')](_0x52e3('0xe'),_0x11c977[_0x52e3('0x4')],_0x11c977[_0x52e3('0xf')],_0x11c977[_0x52e3('0x10')]));if(_0x11c977[_0x52e3('0xf')]['toLowerCase']()==_0x52e3('0x11')&&_[_0x52e3('0x12')](_0x11c977[_0x52e3('0x10')]['toLowerCase'](),_0x52e3('0x13'))){var _0x56dca2=_0x11c977[_0x52e3('0x10')][_0x52e3('0x14')]('=');dials[_0x11c977[_0x52e3('0x4')]]={'routeId':_0x56dca2[0x1]};}}catch(_0x172a06){utils['error'](util[_0x52e3('0xc')](_0x52e3('0xd'),_0x11c977[_0x52e3('0x4')]),_0x172a06);}};exports[_0x52e3('0x15')]=function(_0xc9953f){try{utils[_0x52e3('0xb')](util[_0x52e3('0xc')]('[%s][dials][varset]',_0xc9953f['uniqueid']),_0xc9953f);if(!_['isNil'](_0xc9953f[_0x52e3('0x16')][_0x52e3('0x17')])){utils[_0x52e3('0x3')](util[_0x52e3('0xc')](_0x52e3('0x18'),_0xc9953f[_0x52e3('0x4')],_0xc9953f['value']));dials[_0xc9953f[_0x52e3('0x4')]]={'routeId':_0xc9953f[_0x52e3('0x19')]};}}catch(_0x1e3bf4){utils['error'](util[_0x52e3('0xc')]('[%s][dials][varset]',_0xc9953f['uniqueid']),_0x1e3bf4);}};exports[_0x52e3('0x1a')]=function(_0x1f53b9){try{if(!_[_0x52e3('0x1b')](dials[_0x1f53b9[_0x52e3('0x4')]])){utils['debug'](util['format'](_0x52e3('0x1c'),_0x1f53b9[_0x52e3('0x4')]),_0x1f53b9);dials[_0x1f53b9[_0x52e3('0x4')]]=_[_0x52e3('0x1d')](dials[_0x1f53b9[_0x52e3('0x4')]],_0x1f53b9);dials[_0x1f53b9['uniqueid']][_0x52e3('0x1e')]=utils['now']();dials[_0x1f53b9['uniqueid']]['lastevent']=_0x52e3('0x1f');utils[_0x52e3('0x3')](util[_0x52e3('0xc')]('[%s][dials][hangup]\x20starttime:%s\x20lastevent:called',_0x1f53b9[_0x52e3('0x4')],dials[_0x1f53b9[_0x52e3('0x4')]][_0x52e3('0x1e')]));}}catch(_0x1f764c){utils[_0x52e3('0x20')](util['format'](_0x52e3('0x1c'),_0x1f53b9[_0x52e3('0x4')]),_0x1f764c);}};exports[_0x52e3('0x21')]=function(_0x327304){try{if(!_[_0x52e3('0x1b')](dials[_0x327304[_0x52e3('0x4')]])){utils['debug'](util[_0x52e3('0xc')](_0x52e3('0x22'),_0x327304[_0x52e3('0x4')]),_0x327304);dials[_0x327304[_0x52e3('0x4')]][_0x52e3('0x23')]=_0x327304[_0x52e3('0x23')];if(_0x327304['dialstatus']==_0x52e3('0x24')){dials[_0x327304[_0x52e3('0x4')]]=_[_0x52e3('0x1d')](dials[_0x327304[_0x52e3('0x4')]],_0x327304);dials[_0x327304[_0x52e3('0x4')]]['answertime']=utils[_0x52e3('0x25')]();dials[_0x327304[_0x52e3('0x4')]]['lastevent']='connect';utils[_0x52e3('0x3')](util[_0x52e3('0xc')](_0x52e3('0x26'),_0x327304[_0x52e3('0x4')],_0x327304['dialstatus'],dials[_0x327304[_0x52e3('0x4')]]['answertime']));}else{utils[_0x52e3('0x3')](util['format'](_0x52e3('0x27'),_0x327304['uniqueid'],_0x327304['dialstatus']));}}}catch(_0x276096){utils[_0x52e3('0x20')](util['format']('[%s][dials][dialend]',_0x327304[_0x52e3('0x4')]),_0x276096);}};exports['hangup']=function(_0x5078fd){try{if(!_[_0x52e3('0x1b')](dials[_0x5078fd[_0x52e3('0x4')]])){utils['debug'](util[_0x52e3('0xc')](_0x52e3('0x28'),_0x5078fd[_0x52e3('0x4')]),_0x5078fd);utils['info'](util['format'](_0x52e3('0x29'),_0x5078fd[_0x52e3('0x4')],_0x5078fd[_0x52e3('0x7')],_0x5078fd[_0x52e3('0x2a')],_0x5078fd['cause-txt']));dials[_0x5078fd[_0x52e3('0x4')]]=_[_0x52e3('0x1d')](dials[_0x5078fd[_0x52e3('0x4')]],{'endtime':utils[_0x52e3('0x25')](),'lastevent':_0x52e3('0x2b')});dials[_0x5078fd[_0x52e3('0x4')]][_0x52e3('0x2c')]=utils[_0x52e3('0x2d')](dials[_0x5078fd[_0x52e3('0x4')]][_0x52e3('0x2e')],dials[_0x5078fd[_0x52e3('0x4')]][_0x52e3('0x1e')]);dials[_0x5078fd[_0x52e3('0x4')]][_0x52e3('0x2f')]=utils['diffTime'](dials[_0x5078fd['uniqueid']][_0x52e3('0x30')]||dials[_0x5078fd['uniqueid']][_0x52e3('0x2e')],dials[_0x5078fd[_0x52e3('0x4')]][_0x52e3('0x1e')]);dials[_0x5078fd[_0x52e3('0x4')]][_0x52e3('0x31')]=dials[_0x5078fd[_0x52e3('0x4')]]['answertime']?utils[_0x52e3('0x2d')](dials[_0x5078fd['uniqueid']][_0x52e3('0x2e')],dials[_0x5078fd['uniqueid']][_0x52e3('0x30')]):0x0;writeDB(dials[_0x5078fd[_0x52e3('0x4')]]);}}catch(_0x588edc){utils[_0x52e3('0x20')](util[_0x52e3('0xc')]('[%s][dials][hangup]',_0x5078fd['uniqueid']),_0x588edc);}}; \ No newline at end of file diff --git a/server/services/xdr/index.js b/server/services/xdr/index.js index 4790757..3b24924 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 _0x7647=['varset','[%s][index][varset]','newexten','[%s][index][newexten]','newchannel','[%s][index][newchannel]','dialbegin','[%s][index][dialbegin]','[%s]dialbegin','dialend','[%s][index][dialend]','asterisk-manager','../../config/environment','util','xdr','disabled','env','production','asterisk','port','username','keepConnected','XDR\x20DISABLED','info','Asterisk\x20disabled\x20on\x20localhost','./agents.controller','./calls.controller','./queues.controller','./recordings.controller','./members.controller','./dials.controller','./transfers.controller','./core.controller','connect','shutdown','fullybooted','error','close','managerevent','devicestatechange','debug','format','[%s][index][devicestatechange]','device','agentcalled','[%s][index][agentcalled]','uniqueid','agentringnoanswer','[%s][index][agentringnoanswer]','agentconnect','[%s][index][agentconnect]','agentcomplete','[%s][index][agentcomplete]','queuecallerabandon','[%s][index][queuecallerabandon]','[%s][index][queuecallerjoin]','queuecallerjoin','queuecallerleave','[%s][index][queuecallerleave]','[%s][index][musiconholdstart]','musiconholdstart','[%s][index][musiconholdstop]','musiconholdstop','newstate','[%s][index][newstate]','[%s][index][hangup]','hangup','[%s][index][cdr]','cdr','[%s][index][blindtransfer]','blindtransfer','attendedtransfer','[%s][index][attendedtransfer]','origtransfereruniqueid'];(function(_0x3c9770,_0x139385){var _0x4df6bf=function(_0x143de5){while(--_0x143de5){_0x3c9770['push'](_0x3c9770['shift']());}};_0x4df6bf(++_0x139385);}(_0x7647,0xe9));var _0x7764=function(_0x8c43de,_0x90ff31){_0x8c43de=_0x8c43de-0x0;var _0xa6591b=_0x7647[_0x8c43de];return _0xa6591b;};var AsteriskManager=require(_0x7764('0x0'));var config=require(_0x7764('0x1'));var utils=require('./utils');var util=require(_0x7764('0x2'));var isXDREnabled=config['xdr']&&config[_0x7764('0x3')][_0x7764('0x4')]?!config[_0x7764('0x3')]['disabled']:!![];var isProduction=config[_0x7764('0x5')]===_0x7764('0x6')||![];var isLocalAsterisk=config[_0x7764('0x3')]&&config['xdr']['local']===!![]||![];var ami=new AsteriskManager(config[_0x7764('0x7')][_0x7764('0x8')],config[_0x7764('0x7')]['ip'],config[_0x7764('0x7')][_0x7764('0x9')],config[_0x7764('0x7')]['password'],!![]);ami[_0x7764('0xa')]();if(!isXDREnabled){utils['info'](_0x7764('0xb'));}else if(!isProduction&&!isLocalAsterisk){utils[_0x7764('0xc')](_0x7764('0xd'));}else{var agents=require(_0x7764('0xe'));var calls=require(_0x7764('0xf'));var queues=require(_0x7764('0x10'));var recordings=require(_0x7764('0x11'));var members=require(_0x7764('0x12'));var dials=require(_0x7764('0x13'));var transfers=require(_0x7764('0x14'));var core=require(_0x7764('0x15'));ami['on']('connect',core[_0x7764('0x16')]);ami['on'](_0x7764('0x17'),core[_0x7764('0x17')]);ami['on'](_0x7764('0x18'),core[_0x7764('0x18')]);ami['on'](_0x7764('0x19'),core[_0x7764('0x19')]);ami['on']('close',core[_0x7764('0x1a')]);ami['on'](_0x7764('0x1b'),core[_0x7764('0x1b')]);ami['on'](_0x7764('0x1c'),function(_0x387525){try{utils[_0x7764('0x1d')](util[_0x7764('0x1e')](_0x7764('0x1f'),_0x387525['device']),_0x387525);members['devicestatechange'](_0x387525);}catch(_0x14c8e0){utils[_0x7764('0x19')](util[_0x7764('0x1e')](_0x7764('0x1f'),_0x387525[_0x7764('0x20')]),_0x14c8e0);}});ami['on'](_0x7764('0x21'),function(_0x1ffef8){try{utils[_0x7764('0x1d')](util[_0x7764('0x1e')](_0x7764('0x22'),_0x1ffef8[_0x7764('0x23')]),_0x1ffef8);agents[_0x7764('0x21')](_0x1ffef8);}catch(_0x312e77){utils[_0x7764('0x19')](util[_0x7764('0x1e')]('[%s][index][agentcalled]',_0x1ffef8[_0x7764('0x23')]),_0x312e77);}});ami['on'](_0x7764('0x24'),function(_0x17bc1a){try{utils[_0x7764('0x1d')](util[_0x7764('0x1e')](_0x7764('0x25'),_0x17bc1a[_0x7764('0x23')]),_0x17bc1a);agents[_0x7764('0x24')](_0x17bc1a);}catch(_0x1d0413){utils[_0x7764('0x19')](util[_0x7764('0x1e')]('[%s][index][agentringnoanswer]',_0x17bc1a[_0x7764('0x23')]),_0x1d0413);}});ami['on'](_0x7764('0x26'),function(_0x5bce76){try{utils[_0x7764('0x1d')](util[_0x7764('0x1e')](_0x7764('0x27'),_0x5bce76['uniqueid']),_0x5bce76);agents[_0x7764('0x26')](_0x5bce76);queues[_0x7764('0x26')](_0x5bce76);}catch(_0x4c8067){utils['error'](util[_0x7764('0x1e')](_0x7764('0x27'),_0x5bce76[_0x7764('0x23')]),_0x4c8067);}});ami['on'](_0x7764('0x28'),function(_0x1716b2){try{utils['debug'](util[_0x7764('0x1e')](_0x7764('0x29'),_0x1716b2[_0x7764('0x23')]),_0x1716b2);agents[_0x7764('0x28')](_0x1716b2);queues[_0x7764('0x28')](_0x1716b2);members[_0x7764('0x28')](_0x1716b2);}catch(_0x561f25){utils['error'](util[_0x7764('0x1e')](_0x7764('0x29'),_0x1716b2[_0x7764('0x23')]),_0x561f25);}});ami['on'](_0x7764('0x2a'),function(_0x533a2c){try{utils[_0x7764('0x1d')](util[_0x7764('0x1e')](_0x7764('0x2b'),_0x533a2c[_0x7764('0x23')]),_0x533a2c);agents[_0x7764('0x2a')](_0x533a2c);queues[_0x7764('0x2a')](_0x533a2c);}catch(_0x31a4ee){utils[_0x7764('0x19')](util[_0x7764('0x1e')](_0x7764('0x2b'),_0x533a2c[_0x7764('0x23')]),_0x31a4ee);}});ami['on']('queuecallerjoin',function(_0x425257){try{utils[_0x7764('0x1d')](util[_0x7764('0x1e')](_0x7764('0x2c'),_0x425257[_0x7764('0x23')]),_0x425257);queues[_0x7764('0x2d')](_0x425257);recordings[_0x7764('0x2d')](_0x425257);}catch(_0x363e07){utils[_0x7764('0x19')](util[_0x7764('0x1e')](_0x7764('0x2c'),_0x425257[_0x7764('0x23')]),_0x363e07);}});ami['on'](_0x7764('0x2e'),function(_0x32a650){try{utils[_0x7764('0x1d')](util[_0x7764('0x1e')](_0x7764('0x2f'),_0x32a650[_0x7764('0x23')]),_0x32a650);queues[_0x7764('0x2e')](_0x32a650);}catch(_0x33c9d1){utils[_0x7764('0x19')](util[_0x7764('0x1e')](_0x7764('0x2f'),_0x32a650[_0x7764('0x23')]),_0x33c9d1);}});ami['on']('musiconholdstart',function(_0x57d246){try{utils[_0x7764('0x1d')](util[_0x7764('0x1e')](_0x7764('0x30'),_0x57d246[_0x7764('0x23')]),_0x57d246);queues[_0x7764('0x31')](_0x57d246);calls[_0x7764('0x31')](_0x57d246);}catch(_0x4f77bf){utils['error'](util[_0x7764('0x1e')]('[%s][index][musiconholdstart]',_0x57d246[_0x7764('0x23')]),_0x4f77bf);}});ami['on']('musiconholdstop',function(_0x258411){try{utils[_0x7764('0x1d')](util[_0x7764('0x1e')](_0x7764('0x32'),_0x258411['uniqueid']),_0x258411);queues[_0x7764('0x33')](_0x258411);calls[_0x7764('0x33')](_0x258411);}catch(_0x2b2602){utils['error'](util[_0x7764('0x1e')]('[%s][index][musiconholdstop]',_0x258411[_0x7764('0x23')]),_0x2b2602);}});ami['on'](_0x7764('0x34'),function(_0x3ebff3){try{utils[_0x7764('0x1d')](util['format']('[%s][index][newstate]',_0x3ebff3[_0x7764('0x23')]),_0x3ebff3);calls[_0x7764('0x34')](_0x3ebff3);recordings[_0x7764('0x34')](_0x3ebff3);}catch(_0x35dd3c){utils['error'](util['format'](_0x7764('0x35'),_0x3ebff3[_0x7764('0x23')]),_0x35dd3c);}});ami['on']('hangup',function(_0xe756a5){try{utils['debug'](util['format'](_0x7764('0x36'),_0xe756a5[_0x7764('0x23')]),_0xe756a5);calls[_0x7764('0x37')](_0xe756a5);recordings[_0x7764('0x37')](_0xe756a5);dials[_0x7764('0x37')](_0xe756a5);agents['hangup'](_0xe756a5);queues[_0x7764('0x37')](_0xe756a5);}catch(_0x39620c){utils[_0x7764('0x19')](util['format'](_0x7764('0x36'),_0xe756a5[_0x7764('0x23')]),_0x39620c);}});ami['on']('cdr',function(_0x405b2b){try{utils[_0x7764('0x1d')](util[_0x7764('0x1e')](_0x7764('0x38'),_0x405b2b[_0x7764('0x23')]),_0x405b2b);members[_0x7764('0x39')](_0x405b2b);}catch(_0x10c34e){utils[_0x7764('0x19')](util[_0x7764('0x1e')](_0x7764('0x38'),_0x405b2b[_0x7764('0x23')]),_0x10c34e);}});ami['on']('blindtransfer',function(_0x334989){try{utils[_0x7764('0x1d')](util[_0x7764('0x1e')](_0x7764('0x3a'),_0x334989[_0x7764('0x23')]),_0x334989);queues[_0x7764('0x3b')](_0x334989);agents[_0x7764('0x3b')](_0x334989);transfers[_0x7764('0x3b')](_0x334989);}catch(_0x319fdc){utils[_0x7764('0x19')](util['format']('[%s][index][blindtransfer]',_0x334989[_0x7764('0x23')]),_0x319fdc);}});ami['on'](_0x7764('0x3c'),function(_0xfc0565){try{utils[_0x7764('0x1d')](util[_0x7764('0x1e')](_0x7764('0x3d'),_0xfc0565['origtransfereruniqueid']),_0xfc0565);queues[_0x7764('0x3c')](_0xfc0565);transfers[_0x7764('0x3c')](_0xfc0565);agents[_0x7764('0x3c')](_0xfc0565);calls[_0x7764('0x3c')](_0xfc0565);}catch(_0x1786da){utils[_0x7764('0x19')](util[_0x7764('0x1e')](_0x7764('0x3d'),_0xfc0565[_0x7764('0x3e')]),_0x1786da);}});ami['on'](_0x7764('0x3f'),function(_0x3934c4){try{utils[_0x7764('0x1d')](util[_0x7764('0x1e')](_0x7764('0x40'),_0x3934c4[_0x7764('0x23')]),_0x3934c4);queues[_0x7764('0x3f')](_0x3934c4);recordings[_0x7764('0x3f')](_0x3934c4);calls[_0x7764('0x3f')](_0x3934c4);dials[_0x7764('0x3f')](_0x3934c4);}catch(_0x4774e8){utils[_0x7764('0x19')](util[_0x7764('0x1e')](_0x7764('0x40'),_0x3934c4[_0x7764('0x23')]),_0x4774e8);}});ami['on'](_0x7764('0x41'),function(_0x536ca0){try{utils[_0x7764('0x1d')](util[_0x7764('0x1e')](_0x7764('0x42'),_0x536ca0['uniqueid']),_0x536ca0);calls[_0x7764('0x41')](_0x536ca0);recordings[_0x7764('0x41')](_0x536ca0);dials['newexten'](_0x536ca0);}catch(_0x3b062e){utils[_0x7764('0x19')](util['format'](_0x7764('0x42'),_0x536ca0[_0x7764('0x23')]),_0x3b062e);}});ami['on'](_0x7764('0x43'),function(_0xefa74c){try{utils['debug'](util['format'](_0x7764('0x44'),_0xefa74c['uniqueid']),_0xefa74c);calls[_0x7764('0x43')](_0xefa74c);recordings[_0x7764('0x43')](_0xefa74c);}catch(_0x2eeb31){utils['error'](util['format'](_0x7764('0x44'),_0xefa74c[_0x7764('0x23')]),_0x2eeb31);}});ami['on'](_0x7764('0x45'),function(_0x564b9d){try{utils['debug'](util['format'](_0x7764('0x46'),_0x564b9d['uniqueid']),_0x564b9d);dials[_0x7764('0x45')](_0x564b9d);}catch(_0x214dc2){utils[_0x7764('0x19')](util['format'](_0x7764('0x47'),_0x564b9d[_0x7764('0x23')]),_0x214dc2);}});ami['on'](_0x7764('0x48'),function(_0x2f915a){try{utils[_0x7764('0x1d')](util[_0x7764('0x1e')](_0x7764('0x49'),_0x2f915a['uniqueid']),_0x2f915a);dials[_0x7764('0x48')](_0x2f915a);}catch(_0x374ee6){utils['error'](util['format'](_0x7764('0x49'),_0x2f915a['uniqueid']),_0x374ee6);}});} \ No newline at end of file +var _0x93ce=['[%s][index][newstate]','hangup','[%s][index][hangup]','[%s][index][cdr]','cdr','blindtransfer','[%s][index][blindtransfer]','attendedtransfer','[%s][index][attendedtransfer]','origtransfereruniqueid','varset','[%s][index][varset]','newexten','[%s][index][newexten]','[%s][index][newchannel]','newchannel','[%s][index][dialbegin]','dialbegin','dialend','[%s][index][dialend]','asterisk-manager','./utils','util','xdr','disabled','env','asterisk','port','username','keepConnected','XDR\x20DISABLED','info','Asterisk\x20disabled\x20on\x20localhost','./agents.controller','./calls.controller','./dials.controller','./transfers.controller','./core.controller','connect','shutdown','fullybooted','error','close','managerevent','devicestatechange','[%s][index][devicestatechange]','agentcalled','[%s][index][agentcalled]','format','uniqueid','debug','[%s][index][agentringnoanswer]','agentringnoanswer','agentconnect','[%s][index][agentconnect]','agentcomplete','[%s][index][agentcomplete]','queuecallerabandon','[%s][index][queuecallerabandon]','queuecallerjoin','[%s][index][queuecallerjoin]','queuecallerleave','[%s][index][queuecallerleave]','musiconholdstart','[%s][index][musiconholdstart]','musiconholdstop','[%s][index][musiconholdstop]','newstate'];(function(_0x26462c,_0xd20a35){var _0x509a42=function(_0x1b22c9){while(--_0x1b22c9){_0x26462c['push'](_0x26462c['shift']());}};_0x509a42(++_0xd20a35);}(_0x93ce,0x168));var _0xe93c=function(_0x50e24b,_0x44338d){_0x50e24b=_0x50e24b-0x0;var _0x381199=_0x93ce[_0x50e24b];return _0x381199;};var AsteriskManager=require(_0xe93c('0x0'));var config=require('../../config/environment');var utils=require(_0xe93c('0x1'));var util=require(_0xe93c('0x2'));var isXDREnabled=config[_0xe93c('0x3')]&&config[_0xe93c('0x3')][_0xe93c('0x4')]?!config['xdr'][_0xe93c('0x4')]:!![];var isProduction=config[_0xe93c('0x5')]==='production'||![];var isLocalAsterisk=config[_0xe93c('0x3')]&&config[_0xe93c('0x3')]['local']===!![]||![];var ami=new AsteriskManager(config[_0xe93c('0x6')][_0xe93c('0x7')],config[_0xe93c('0x6')]['ip'],config['asterisk'][_0xe93c('0x8')],config['asterisk']['password'],!![]);ami[_0xe93c('0x9')]();if(!isXDREnabled){utils['info'](_0xe93c('0xa'));}else if(!isProduction&&!isLocalAsterisk){utils[_0xe93c('0xb')](_0xe93c('0xc'));}else{var agents=require(_0xe93c('0xd'));var calls=require(_0xe93c('0xe'));var queues=require('./queues.controller');var recordings=require('./recordings.controller');var members=require('./members.controller');var dials=require(_0xe93c('0xf'));var transfers=require(_0xe93c('0x10'));var core=require(_0xe93c('0x11'));ami['on'](_0xe93c('0x12'),core[_0xe93c('0x12')]);ami['on'](_0xe93c('0x13'),core[_0xe93c('0x13')]);ami['on'](_0xe93c('0x14'),core['fullybooted']);ami['on'](_0xe93c('0x15'),core[_0xe93c('0x15')]);ami['on'](_0xe93c('0x16'),core[_0xe93c('0x16')]);ami['on'](_0xe93c('0x17'),core[_0xe93c('0x17')]);ami['on'](_0xe93c('0x18'),function(_0x385f55){try{utils['debug'](util['format'](_0xe93c('0x19'),_0x385f55['device']),_0x385f55);members['devicestatechange'](_0x385f55);}catch(_0x4fb81b){utils[_0xe93c('0x15')](util['format'](_0xe93c('0x19'),_0x385f55['device']),_0x4fb81b);}});ami['on'](_0xe93c('0x1a'),function(_0x4a7198){try{utils['debug'](util['format'](_0xe93c('0x1b'),_0x4a7198['uniqueid']),_0x4a7198);agents[_0xe93c('0x1a')](_0x4a7198);}catch(_0x505da4){utils[_0xe93c('0x15')](util[_0xe93c('0x1c')](_0xe93c('0x1b'),_0x4a7198[_0xe93c('0x1d')]),_0x505da4);}});ami['on']('agentringnoanswer',function(_0x67f453){try{utils[_0xe93c('0x1e')](util['format'](_0xe93c('0x1f'),_0x67f453[_0xe93c('0x1d')]),_0x67f453);agents[_0xe93c('0x20')](_0x67f453);}catch(_0x5c093c){utils[_0xe93c('0x15')](util[_0xe93c('0x1c')]('[%s][index][agentringnoanswer]',_0x67f453[_0xe93c('0x1d')]),_0x5c093c);}});ami['on'](_0xe93c('0x21'),function(_0x139bb6){try{utils[_0xe93c('0x1e')](util[_0xe93c('0x1c')](_0xe93c('0x22'),_0x139bb6[_0xe93c('0x1d')]),_0x139bb6);agents[_0xe93c('0x21')](_0x139bb6);queues[_0xe93c('0x21')](_0x139bb6);}catch(_0x4c6a2c){utils[_0xe93c('0x15')](util['format'](_0xe93c('0x22'),_0x139bb6[_0xe93c('0x1d')]),_0x4c6a2c);}});ami['on'](_0xe93c('0x23'),function(_0x4dfde1){try{utils[_0xe93c('0x1e')](util[_0xe93c('0x1c')](_0xe93c('0x24'),_0x4dfde1[_0xe93c('0x1d')]),_0x4dfde1);agents[_0xe93c('0x23')](_0x4dfde1);queues['agentcomplete'](_0x4dfde1);members[_0xe93c('0x23')](_0x4dfde1);}catch(_0x2b385c){utils['error'](util[_0xe93c('0x1c')](_0xe93c('0x24'),_0x4dfde1[_0xe93c('0x1d')]),_0x2b385c);}});ami['on'](_0xe93c('0x25'),function(_0x133140){try{utils[_0xe93c('0x1e')](util[_0xe93c('0x1c')](_0xe93c('0x26'),_0x133140[_0xe93c('0x1d')]),_0x133140);agents[_0xe93c('0x25')](_0x133140);queues[_0xe93c('0x25')](_0x133140);}catch(_0x5b4a38){utils[_0xe93c('0x15')](util['format'](_0xe93c('0x26'),_0x133140[_0xe93c('0x1d')]),_0x5b4a38);}});ami['on'](_0xe93c('0x27'),function(_0xb196cc){try{utils[_0xe93c('0x1e')](util[_0xe93c('0x1c')](_0xe93c('0x28'),_0xb196cc['uniqueid']),_0xb196cc);queues[_0xe93c('0x27')](_0xb196cc);recordings[_0xe93c('0x27')](_0xb196cc);}catch(_0x23a13c){utils[_0xe93c('0x15')](util['format'](_0xe93c('0x28'),_0xb196cc[_0xe93c('0x1d')]),_0x23a13c);}});ami['on'](_0xe93c('0x29'),function(_0x5a29a5){try{utils['debug'](util[_0xe93c('0x1c')](_0xe93c('0x2a'),_0x5a29a5['uniqueid']),_0x5a29a5);queues[_0xe93c('0x29')](_0x5a29a5);}catch(_0x509ab8){utils[_0xe93c('0x15')](util[_0xe93c('0x1c')](_0xe93c('0x2a'),_0x5a29a5[_0xe93c('0x1d')]),_0x509ab8);}});ami['on'](_0xe93c('0x2b'),function(_0x25cab4){try{utils[_0xe93c('0x1e')](util['format'](_0xe93c('0x2c'),_0x25cab4[_0xe93c('0x1d')]),_0x25cab4);queues[_0xe93c('0x2b')](_0x25cab4);calls['musiconholdstart'](_0x25cab4);}catch(_0x1578c9){utils[_0xe93c('0x15')](util[_0xe93c('0x1c')](_0xe93c('0x2c'),_0x25cab4[_0xe93c('0x1d')]),_0x1578c9);}});ami['on'](_0xe93c('0x2d'),function(_0x965353){try{utils[_0xe93c('0x1e')](util[_0xe93c('0x1c')](_0xe93c('0x2e'),_0x965353[_0xe93c('0x1d')]),_0x965353);queues[_0xe93c('0x2d')](_0x965353);calls['musiconholdstop'](_0x965353);}catch(_0xadc889){utils['error'](util[_0xe93c('0x1c')](_0xe93c('0x2e'),_0x965353[_0xe93c('0x1d')]),_0xadc889);}});ami['on'](_0xe93c('0x2f'),function(_0x5adf29){try{utils[_0xe93c('0x1e')](util[_0xe93c('0x1c')]('[%s][index][newstate]',_0x5adf29['uniqueid']),_0x5adf29);calls[_0xe93c('0x2f')](_0x5adf29);recordings[_0xe93c('0x2f')](_0x5adf29);}catch(_0x3b7391){utils[_0xe93c('0x15')](util['format'](_0xe93c('0x30'),_0x5adf29[_0xe93c('0x1d')]),_0x3b7391);}});ami['on'](_0xe93c('0x31'),function(_0xb3a0c2){try{utils[_0xe93c('0x1e')](util[_0xe93c('0x1c')](_0xe93c('0x32'),_0xb3a0c2[_0xe93c('0x1d')]),_0xb3a0c2);calls[_0xe93c('0x31')](_0xb3a0c2);recordings[_0xe93c('0x31')](_0xb3a0c2);dials[_0xe93c('0x31')](_0xb3a0c2);agents[_0xe93c('0x31')](_0xb3a0c2);queues[_0xe93c('0x31')](_0xb3a0c2);}catch(_0x369f2d){utils[_0xe93c('0x15')](util[_0xe93c('0x1c')](_0xe93c('0x32'),_0xb3a0c2[_0xe93c('0x1d')]),_0x369f2d);}});ami['on']('cdr',function(_0x701fc7){try{utils[_0xe93c('0x1e')](util[_0xe93c('0x1c')](_0xe93c('0x33'),_0x701fc7[_0xe93c('0x1d')]),_0x701fc7);members[_0xe93c('0x34')](_0x701fc7);}catch(_0x1c8f58){utils[_0xe93c('0x15')](util['format'](_0xe93c('0x33'),_0x701fc7['uniqueid']),_0x1c8f58);}});ami['on'](_0xe93c('0x35'),function(_0x4d18f5){try{utils[_0xe93c('0x1e')](util[_0xe93c('0x1c')](_0xe93c('0x36'),_0x4d18f5[_0xe93c('0x1d')]),_0x4d18f5);queues[_0xe93c('0x35')](_0x4d18f5);agents[_0xe93c('0x35')](_0x4d18f5);transfers['blindtransfer'](_0x4d18f5);}catch(_0x3c832c){utils['error'](util['format'](_0xe93c('0x36'),_0x4d18f5[_0xe93c('0x1d')]),_0x3c832c);}});ami['on'](_0xe93c('0x37'),function(_0x45dcac){try{utils[_0xe93c('0x1e')](util['format'](_0xe93c('0x38'),_0x45dcac[_0xe93c('0x39')]),_0x45dcac);queues[_0xe93c('0x37')](_0x45dcac);transfers['attendedtransfer'](_0x45dcac);agents['attendedtransfer'](_0x45dcac);calls[_0xe93c('0x37')](_0x45dcac);}catch(_0x469c7b){utils[_0xe93c('0x15')](util[_0xe93c('0x1c')](_0xe93c('0x38'),_0x45dcac['origtransfereruniqueid']),_0x469c7b);}});ami['on'](_0xe93c('0x3a'),function(_0x539023){try{utils['debug'](util[_0xe93c('0x1c')](_0xe93c('0x3b'),_0x539023[_0xe93c('0x1d')]),_0x539023);queues[_0xe93c('0x3a')](_0x539023);recordings[_0xe93c('0x3a')](_0x539023);calls[_0xe93c('0x3a')](_0x539023);dials[_0xe93c('0x3a')](_0x539023);}catch(_0x314639){utils[_0xe93c('0x15')](util[_0xe93c('0x1c')](_0xe93c('0x3b'),_0x539023[_0xe93c('0x1d')]),_0x314639);}});ami['on'](_0xe93c('0x3c'),function(_0x298119){try{utils[_0xe93c('0x1e')](util[_0xe93c('0x1c')](_0xe93c('0x3d'),_0x298119[_0xe93c('0x1d')]),_0x298119);calls[_0xe93c('0x3c')](_0x298119);recordings[_0xe93c('0x3c')](_0x298119);dials['newexten'](_0x298119);}catch(_0x2737fe){utils[_0xe93c('0x15')](util[_0xe93c('0x1c')](_0xe93c('0x3d'),_0x298119[_0xe93c('0x1d')]),_0x2737fe);}});ami['on']('newchannel',function(_0x5ab1d0){try{utils[_0xe93c('0x1e')](util[_0xe93c('0x1c')](_0xe93c('0x3e'),_0x5ab1d0[_0xe93c('0x1d')]),_0x5ab1d0);calls[_0xe93c('0x3f')](_0x5ab1d0);recordings[_0xe93c('0x3f')](_0x5ab1d0);}catch(_0x2bd59f){utils[_0xe93c('0x15')](util['format'](_0xe93c('0x3e'),_0x5ab1d0[_0xe93c('0x1d')]),_0x2bd59f);}});ami['on']('dialbegin',function(_0x474e76){try{utils['debug'](util[_0xe93c('0x1c')](_0xe93c('0x40'),_0x474e76[_0xe93c('0x1d')]),_0x474e76);dials[_0xe93c('0x41')](_0x474e76);}catch(_0x37663b){utils[_0xe93c('0x15')](util[_0xe93c('0x1c')]('[%s]dialbegin',_0x474e76['uniqueid']),_0x37663b);}});ami['on'](_0xe93c('0x42'),function(_0x1de13c){try{utils[_0xe93c('0x1e')](util[_0xe93c('0x1c')](_0xe93c('0x43'),_0x1de13c['uniqueid']),_0x1de13c);dials[_0xe93c('0x42')](_0x1de13c);}catch(_0x120a9e){utils['error'](util[_0xe93c('0x1c')](_0xe93c('0x43'),_0x1de13c[_0xe93c('0x1d')]),_0x120a9e);}});} \ No newline at end of file diff --git a/server/services/xdr/members.controller.js b/server/services/xdr/members.controller.js index 1b4fc4f..150d0db 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 _0xde50=['error','some','devicestatechange','debug','[%s][members][devicestatechange]','device','info','[%s][members][devicestatechange]\x20state:%s\x20interface:%s','state','BUSY','voice','TALKING','agent','NOT_INUSE','isNil','now','duration','exitAt','enterAt','[%s][members][agentcomplete]','[%s][members][agentcomplete]\x20interface:%s\x20queue:%s','queue','[%s][members][cdr]','channel','assign','data2','source','data3','destination','[%s][members][cdr]\x20type:%s\x20source:%s\x20destination:%s','data1','destinationchannel','./utils','Local/_attended@transfer','Queue:','format','uniqueid','membername','type','interface','name','internal','CreateMemberReport','getUserByName','split','then','request','catch'];(function(_0x22ad0f,_0x35bb20){var _0x1ea528=function(_0x3bf2c5){while(--_0x3bf2c5){_0x22ad0f['push'](_0x22ad0f['shift']());}};_0x1ea528(++_0x35bb20);}(_0xde50,0x140));var _0x0de5=function(_0x192c7c,_0x5c1136){_0x192c7c=_0x192c7c-0x0;var _0x2b01f8=_0xde50[_0x192c7c];return _0x2b01f8;};'use strict';var _=require('lodash');var util=require('util');var utils=require(_0x0de5('0x0'));var members={};var exclude=[_0x0de5('0x1'),_0x0de5('0x2')];function writeDB(_0x3ae828){utils['info'](util[_0x0de5('0x3')]('[%s][members][writeDB]\x20interface:%s\x20channel:%s\x20data2:%s\x20agent:%s\x20type:%s',_0x3ae828[_0x0de5('0x4')],_0x3ae828['interface'],_0x3ae828['channel'],_0x3ae828['data2'],_0x3ae828[_0x0de5('0x5')],_0x3ae828[_0x0de5('0x6')]));if(_0x3ae828[_0x0de5('0x7')]){utils['getUserByInterface'](_0x3ae828[_0x0de5('0x7')])['then'](function(_0x54c94f){if(_0x54c94f){_0x3ae828['membername']=_0x54c94f[_0x0de5('0x8')];_0x3ae828[_0x0de5('0x9')]=_0x54c94f[_0x0de5('0x9')];utils['request'](_0x0de5('0xa'),_0x3ae828);}else{utils[_0x0de5('0xb')](_0x3ae828['interface'][_0x0de5('0xc')]('/')[0x1])[_0x0de5('0xd')](function(_0x4040c6){if(_0x4040c6){_0x3ae828['membername']=_0x4040c6['name'];_0x3ae828[_0x0de5('0x9')]=_0x4040c6[_0x0de5('0x9')];utils[_0x0de5('0xe')](_0x0de5('0xa'),_0x3ae828);}});}})[_0x0de5('0xf')](function(_0x5ba869){utils[_0x0de5('0x10')](util['format']('[%s][members][writeDB]',_0x3ae828[_0x0de5('0x4')]),_0x5ba869);});}delete members[_0x3ae828[_0x0de5('0x7')]];}function startsWith(_0x443218,_0x92fe6d){return _[_0x0de5('0x11')](_0x443218,function(_0x2be086){return _['startsWith'](_0x92fe6d,_0x2be086);});}exports[_0x0de5('0x12')]=function(_0xeb58e1){try{utils[_0x0de5('0x13')](util[_0x0de5('0x3')](_0x0de5('0x14'),members[_0xeb58e1[_0x0de5('0x15')]]?members[_0xeb58e1['device']][_0x0de5('0x4')]:_0xeb58e1['device']),_0xeb58e1);utils[_0x0de5('0x16')](util[_0x0de5('0x3')](_0x0de5('0x17'),members[_0xeb58e1[_0x0de5('0x15')]]?members[_0xeb58e1['device']][_0x0de5('0x4')]:_0xeb58e1['device'],_0xeb58e1[_0x0de5('0x18')],_0xeb58e1[_0x0de5('0x15')]));switch(_0xeb58e1[_0x0de5('0x18')]){case'INUSE':case _0x0de5('0x19'):if(!startsWith(exclude,_0xeb58e1[_0x0de5('0x15')])){members[_0xeb58e1[_0x0de5('0x15')]]={'channel':_0x0de5('0x1a'),'interface':_0xeb58e1['device'],'type':_0x0de5('0x1b'),'enterAt':utils['now'](),'role':_0x0de5('0x1c')};}break;case _0x0de5('0x1d'):if(!_[_0x0de5('0x1e')](members[_0xeb58e1[_0x0de5('0x15')]])){members[_0xeb58e1['device']]['exitAt']=utils[_0x0de5('0x1f')]();members[_0xeb58e1['device']][_0x0de5('0x20')]=utils['diffTime'](members[_0xeb58e1[_0x0de5('0x15')]][_0x0de5('0x21')],members[_0xeb58e1[_0x0de5('0x15')]][_0x0de5('0x22')]);if(members[_0xeb58e1[_0x0de5('0x15')]]['uniqueid']){writeDB(members[_0xeb58e1[_0x0de5('0x15')]]);}}break;default:break;}}catch(_0x17b0f9){utils[_0x0de5('0x10')](util[_0x0de5('0x3')](_0x0de5('0x14'),members[_0xeb58e1[_0x0de5('0x15')]]?members[_0xeb58e1['device']][_0x0de5('0x4')]:_0xeb58e1['device']),_0x17b0f9);}};exports['agentcomplete']=function(_0x2b6853){try{if(!_['isNil'](members[_0x2b6853['interface']])){utils[_0x0de5('0x13')](util[_0x0de5('0x3')](_0x0de5('0x23'),_0x2b6853['uniqueid']),_0x2b6853);utils[_0x0de5('0x16')](util['format'](_0x0de5('0x24'),_0x2b6853[_0x0de5('0x4')],_0x2b6853[_0x0de5('0x7')],_0x2b6853[_0x0de5('0x25')]));members[_0x2b6853['interface']]=_['assign'](members[_0x2b6853[_0x0de5('0x7')]],{'data4':_0x2b6853[_0x0de5('0x25')],'uniqueid':_0x2b6853[_0x0de5('0x4')]});}}catch(_0x192dd6){utils[_0x0de5('0x10')](util['format'](_0x0de5('0x23'),_0x2b6853[_0x0de5('0x4')]),_0x192dd6);}};exports['cdr']=function(_0x5205ab){try{utils[_0x0de5('0x13')](util[_0x0de5('0x3')](_0x0de5('0x26'),_0x5205ab[_0x0de5('0x4')]),_0x5205ab);if(_0x5205ab[_0x0de5('0x27')]){var _0x29effb=_0x5205ab[_0x0de5('0x27')]['split']('-')[0x0];if(!_[_0x0de5('0x1e')](members[_0x29effb])){members[_0x29effb]=_[_0x0de5('0x28')](members[_0x29effb],{'data1':members[_0x29effb]['data1']||_0x5205ab[_0x0de5('0x6')],'data2':members[_0x29effb][_0x0de5('0x29')]||_0x5205ab[_0x0de5('0x2a')],'data3':members[_0x29effb][_0x0de5('0x2b')]||_0x5205ab[_0x0de5('0x2c')],'uniqueid':members[_0x29effb][_0x0de5('0x4')]||_0x5205ab[_0x0de5('0x4')]});utils[_0x0de5('0x16')](util['format'](_0x0de5('0x2d'),_0x5205ab['uniqueid'],members[_0x29effb][_0x0de5('0x2e')],members[_0x29effb]['data2'],members[_0x29effb][_0x0de5('0x2b')]));if(members[_0x29effb][_0x0de5('0x21')]){writeDB(members[_0x29effb]);}}}if(_0x5205ab[_0x0de5('0x2f')]){var _0x49f80a=_0x5205ab[_0x0de5('0x2f')][_0x0de5('0xc')]('-')[0x0];if(!_[_0x0de5('0x1e')](members[_0x49f80a])){members[_0x49f80a]=_[_0x0de5('0x28')](members[_0x49f80a],{'data1':members[_0x49f80a][_0x0de5('0x2e')]||_0x5205ab['type'],'data2':members[_0x49f80a][_0x0de5('0x29')]||_0x5205ab['source'],'data3':members[_0x49f80a]['data3']||_0x5205ab['destination'],'uniqueid':members[_0x49f80a][_0x0de5('0x4')]||_0x5205ab[_0x0de5('0x4')]});utils[_0x0de5('0x16')](util[_0x0de5('0x3')](_0x0de5('0x2d'),_0x5205ab['uniqueid'],members[_0x49f80a]['data1'],members[_0x49f80a][_0x0de5('0x29')],members[_0x49f80a][_0x0de5('0x2b')]));if(members[_0x49f80a][_0x0de5('0x21')]){writeDB(members[_0x49f80a]);}}}}catch(_0xbb9bf7){utils[_0x0de5('0x10')](util['format'](_0x0de5('0x26'),_0x5205ab[_0x0de5('0x4')]),_0xbb9bf7);}}; \ No newline at end of file +var _0x2e4e=['debug','[%s][members][agentcomplete]','queue','cdr','[%s][members][cdr]','channel','data1','data3','destination','[%s][members][cdr]\x20type:%s\x20source:%s\x20destination:%s','destinationchannel','assign','lodash','util','./utils','Local/_attended@transfer','Queue:','info','format','[%s][members][writeDB]\x20interface:%s\x20channel:%s\x20data2:%s\x20agent:%s\x20type:%s','data2','membername','type','then','name','internal','CreateMemberReport','getUserByName','interface','split','request','error','[%s][members][writeDB]','uniqueid','startsWith','devicestatechange','[%s][members][devicestatechange]','device','[%s][members][devicestatechange]\x20state:%s\x20interface:%s','state','INUSE','TALKING','now','NOT_INUSE','exitAt','duration','diffTime','agentcomplete','isNil'];(function(_0x53170d,_0x242403){var _0x3f1981=function(_0x386dc5){while(--_0x386dc5){_0x53170d['push'](_0x53170d['shift']());}};_0x3f1981(++_0x242403);}(_0x2e4e,0x9f));var _0xe2e4=function(_0x3eba3a,_0x5e6d12){_0x3eba3a=_0x3eba3a-0x0;var _0x346679=_0x2e4e[_0x3eba3a];return _0x346679;};'use strict';var _=require(_0xe2e4('0x0'));var util=require(_0xe2e4('0x1'));var utils=require(_0xe2e4('0x2'));var members={};var exclude=[_0xe2e4('0x3'),_0xe2e4('0x4')];function writeDB(_0x53dbf2){utils[_0xe2e4('0x5')](util[_0xe2e4('0x6')](_0xe2e4('0x7'),_0x53dbf2['uniqueid'],_0x53dbf2['interface'],_0x53dbf2['channel'],_0x53dbf2[_0xe2e4('0x8')],_0x53dbf2[_0xe2e4('0x9')],_0x53dbf2[_0xe2e4('0xa')]));if(_0x53dbf2['interface']){utils['getUserByInterface'](_0x53dbf2['interface'])[_0xe2e4('0xb')](function(_0x2af746){if(_0x2af746){_0x53dbf2[_0xe2e4('0x9')]=_0x2af746[_0xe2e4('0xc')];_0x53dbf2['internal']=_0x2af746[_0xe2e4('0xd')];utils['request'](_0xe2e4('0xe'),_0x53dbf2);}else{utils[_0xe2e4('0xf')](_0x53dbf2[_0xe2e4('0x10')][_0xe2e4('0x11')]('/')[0x1])[_0xe2e4('0xb')](function(_0x11ddb2){if(_0x11ddb2){_0x53dbf2['membername']=_0x11ddb2['name'];_0x53dbf2[_0xe2e4('0xd')]=_0x11ddb2['internal'];utils[_0xe2e4('0x12')](_0xe2e4('0xe'),_0x53dbf2);}});}})['catch'](function(_0x5b142e){utils[_0xe2e4('0x13')](util[_0xe2e4('0x6')](_0xe2e4('0x14'),_0x53dbf2[_0xe2e4('0x15')]),_0x5b142e);});}delete members[_0x53dbf2['interface']];}function startsWith(_0x49c367,_0x1eea42){return _['some'](_0x49c367,function(_0xc39128){return _[_0xe2e4('0x16')](_0x1eea42,_0xc39128);});}exports[_0xe2e4('0x17')]=function(_0x2638df){try{utils['debug'](util['format'](_0xe2e4('0x18'),members[_0x2638df[_0xe2e4('0x19')]]?members[_0x2638df[_0xe2e4('0x19')]][_0xe2e4('0x15')]:_0x2638df['device']),_0x2638df);utils['info'](util[_0xe2e4('0x6')](_0xe2e4('0x1a'),members[_0x2638df[_0xe2e4('0x19')]]?members[_0x2638df[_0xe2e4('0x19')]]['uniqueid']:_0x2638df['device'],_0x2638df[_0xe2e4('0x1b')],_0x2638df[_0xe2e4('0x19')]));switch(_0x2638df[_0xe2e4('0x1b')]){case _0xe2e4('0x1c'):case'BUSY':if(!startsWith(exclude,_0x2638df[_0xe2e4('0x19')])){members[_0x2638df[_0xe2e4('0x19')]]={'channel':'voice','interface':_0x2638df['device'],'type':_0xe2e4('0x1d'),'enterAt':utils[_0xe2e4('0x1e')](),'role':'agent'};}break;case _0xe2e4('0x1f'):if(!_['isNil'](members[_0x2638df['device']])){members[_0x2638df['device']][_0xe2e4('0x20')]=utils['now']();members[_0x2638df[_0xe2e4('0x19')]][_0xe2e4('0x21')]=utils[_0xe2e4('0x22')](members[_0x2638df[_0xe2e4('0x19')]][_0xe2e4('0x20')],members[_0x2638df[_0xe2e4('0x19')]]['enterAt']);if(members[_0x2638df['device']][_0xe2e4('0x15')]){writeDB(members[_0x2638df[_0xe2e4('0x19')]]);}}break;default:break;}}catch(_0x1650ea){utils[_0xe2e4('0x13')](util[_0xe2e4('0x6')]('[%s][members][devicestatechange]',members[_0x2638df['device']]?members[_0x2638df['device']][_0xe2e4('0x15')]:_0x2638df['device']),_0x1650ea);}};exports[_0xe2e4('0x23')]=function(_0x1c5e0e){try{if(!_[_0xe2e4('0x24')](members[_0x1c5e0e[_0xe2e4('0x10')]])){utils[_0xe2e4('0x25')](util['format'](_0xe2e4('0x26'),_0x1c5e0e[_0xe2e4('0x15')]),_0x1c5e0e);utils['info'](util[_0xe2e4('0x6')]('[%s][members][agentcomplete]\x20interface:%s\x20queue:%s',_0x1c5e0e[_0xe2e4('0x15')],_0x1c5e0e['interface'],_0x1c5e0e['queue']));members[_0x1c5e0e[_0xe2e4('0x10')]]=_['assign'](members[_0x1c5e0e[_0xe2e4('0x10')]],{'data4':_0x1c5e0e[_0xe2e4('0x27')],'uniqueid':_0x1c5e0e['uniqueid']});}}catch(_0x1d06d2){utils[_0xe2e4('0x13')](util[_0xe2e4('0x6')]('[%s][members][agentcomplete]',_0x1c5e0e[_0xe2e4('0x15')]),_0x1d06d2);}};exports[_0xe2e4('0x28')]=function(_0x37d6ef){try{utils[_0xe2e4('0x25')](util['format'](_0xe2e4('0x29'),_0x37d6ef[_0xe2e4('0x15')]),_0x37d6ef);if(_0x37d6ef['channel']){var _0x2d137b=_0x37d6ef[_0xe2e4('0x2a')][_0xe2e4('0x11')]('-')[0x0];if(!_[_0xe2e4('0x24')](members[_0x2d137b])){members[_0x2d137b]=_['assign'](members[_0x2d137b],{'data1':members[_0x2d137b][_0xe2e4('0x2b')]||_0x37d6ef[_0xe2e4('0xa')],'data2':members[_0x2d137b][_0xe2e4('0x8')]||_0x37d6ef['source'],'data3':members[_0x2d137b][_0xe2e4('0x2c')]||_0x37d6ef[_0xe2e4('0x2d')],'uniqueid':members[_0x2d137b][_0xe2e4('0x15')]||_0x37d6ef[_0xe2e4('0x15')]});utils['info'](util[_0xe2e4('0x6')](_0xe2e4('0x2e'),_0x37d6ef[_0xe2e4('0x15')],members[_0x2d137b][_0xe2e4('0x2b')],members[_0x2d137b][_0xe2e4('0x8')],members[_0x2d137b][_0xe2e4('0x2c')]));if(members[_0x2d137b]['exitAt']){writeDB(members[_0x2d137b]);}}}if(_0x37d6ef['destinationchannel']){var _0x124e61=_0x37d6ef[_0xe2e4('0x2f')][_0xe2e4('0x11')]('-')[0x0];if(!_['isNil'](members[_0x124e61])){members[_0x124e61]=_[_0xe2e4('0x30')](members[_0x124e61],{'data1':members[_0x124e61][_0xe2e4('0x2b')]||_0x37d6ef[_0xe2e4('0xa')],'data2':members[_0x124e61][_0xe2e4('0x8')]||_0x37d6ef['source'],'data3':members[_0x124e61][_0xe2e4('0x2c')]||_0x37d6ef['destination'],'uniqueid':members[_0x124e61][_0xe2e4('0x15')]||_0x37d6ef[_0xe2e4('0x15')]});utils[_0xe2e4('0x5')](util[_0xe2e4('0x6')](_0xe2e4('0x2e'),_0x37d6ef[_0xe2e4('0x15')],members[_0x124e61][_0xe2e4('0x2b')],members[_0x124e61][_0xe2e4('0x8')],members[_0x124e61][_0xe2e4('0x2c')]));if(members[_0x124e61][_0xe2e4('0x20')]){writeDB(members[_0x124e61]);}}}}catch(_0x102e70){utils[_0xe2e4('0x13')](util[_0xe2e4('0x6')](_0xe2e4('0x29'),_0x37d6ef[_0xe2e4('0x15')]),_0x102e70);}}; \ No newline at end of file diff --git a/server/services/xdr/queues.controller.js b/server/services/xdr/queues.controller.js index 05f717e..9cd2035 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 _0x4549=['queuecallerjoin','debug','format','position','assign','now','error','[%s][queues][queuecallerjoin]','isNil','[%s][queues][hangup]','queuecallerleaveAt','queuecallerabandon','queuecallercomplete','queuecallercompleteAt','COMPLETEDBYAGENT','[%s][queues][hangup]\x20name:%s\x20queuecallerexitreason:%s','[%s][queues][hangup]\x20name:%s\x20transfereduniqueid:%s','name','queuecallerenterreason','varset','[%s][queues][varset]','queuestatus','value','toUpperCase','CONTINUE','queuecallerexitAt','[%s][queues][varset]\x20name:%s\x20variable:queuestatus\x20value:%s\x20queuecallerexitreason:%s','queueposition','queuecallerabandonAt','queuecallerexit','[%s][queues][queuecallerabandon]','[%s][queues][queuecallerabandon]\x20name:%s\x20queuecallerexitreason:%s','queuecallerleave','[%s][queues][queuecallerleave]','holdtime','diffTime','count','connectedlinenum','connectedlinename','[%s][queues][agentconnect]','[%s][queues][agentconnect]\x20name:%s\x20agent:%s\x20accountcode:%s','membername','destaccountcode','agentcomplete','[%s][queues][agentcomplete]','assigned','transfer','TRANSFER','COMPLETEDBY','reason','[%s][queues][agentcomplete]\x20name:%s\x20agent:%s\x20queuecallerexitreason:%s','transfereeuniqueid','[%s][queues][blindtransfer]','BLIND','transferexten','extension','BLINDTRANSFER','[%s][queues][blindtransfer]\x20name:%s\x20transferuniqueid:%s\x20transferexten:%s\x20queuecallerexitreason:BLINDTRANSFER','[%s][queues][attendedtransfer]','origtransfereruniqueid','origtransfererlinkedid','secondtransfererlinkedid','[%s][queues][attendedtransfer]\x20name:%s\x20transferexten:%s\x20queuecallerexitreason:ATTENDEDTRANSFER','origtransfererexten','transfertype','ATTENDED','transferuniqueid','ATTENDEDTRANSFER','transfereelinkedid','transfertargetuniqueid','calleridname','queuecallerjoinAt','[%s][queues][attendedtransfer]\x20name:%s\x20calleridnum:%s\x20calleridname:%s','[%s][queues][attendedtransfer]\x20name:%s\x20transfereduniqueid:%s','secondtransfereruniqueid','[%s][queues][attendedtransfer]\x20name:%s\x20transferuniqueid:%s\x20transferexten:%s\x20queuecallerexitreason:ATTENDEDTRANSFER','secondtransfererexten','transfertargetlinkedid','mohtime','[%s][queues][attendedtransfer]\x20name:%s\x20transfereduniqueid:%s\x20calleridnum:%s\x20calleridname:%s','musiconholdstart','[%s][queues][musiconholdstart]','musiconholdstartAt','[%s][queues][musiconholdstop]\x20name:%s\x20musiconholdstartAt:%s','musiconholdstop','[%s][queues][musiconholdstop]','[%s][queues][musiconholdstop]\x20name:%s\x20mohtime:%s','lodash','util','./utils','info','[%s][queues][writeDB]\x20channel:%s\x20queue:%s\x20lastAssignedTo:%s\x20calleridnum:%s\x20accountcode:%s\x20queuecallerexitreason:%s','uniqueid','channel','lastAssignedTo','calleridnum','accountcode','queuecallerexitreason','queue','type','CreateVoiceQueueReport','request','transfereduniqueid'];(function(_0x5c414f,_0x1d92a2){var _0x155203=function(_0x4b4aa6){while(--_0x4b4aa6){_0x5c414f['push'](_0x5c414f['shift']());}};_0x155203(++_0x1d92a2);}(_0x4549,0x1f3));var _0x9454=function(_0x4213cc,_0x58bcae){_0x4213cc=_0x4213cc-0x0;var _0xe7cfc2=_0x4549[_0x4213cc];return _0xe7cfc2;};'use strict';var _=require(_0x9454('0x0'));var util=require(_0x9454('0x1'));var utils=require(_0x9454('0x2'));var queues={};function writeDB(_0x26dd74){utils[_0x9454('0x3')](util['format'](_0x9454('0x4'),_0x26dd74[_0x9454('0x5')],_0x26dd74[_0x9454('0x6')],_0x26dd74['queue'],_0x26dd74[_0x9454('0x7')],_0x26dd74[_0x9454('0x8')],_0x26dd74[_0x9454('0x9')],_0x26dd74[_0x9454('0xa')]));if(_0x26dd74[_0x9454('0xb')]){utils['getVoiceQueueByName'](_0x26dd74[_0x9454('0xb')])['then'](function(_0x1d119b){if(_0x1d119b){_0x26dd74[_0x9454('0xc')]=_0x1d119b[_0x9454('0xc')];}utils['request'](_0x9454('0xd'),_0x26dd74);});}else{utils[_0x9454('0xe')](_0x9454('0xd'),_0x26dd74);}if(_0x26dd74['transfereduniqueid']){delete queues[_0x26dd74[_0x9454('0xf')]];}else{delete queues[_0x26dd74[_0x9454('0x5')]];}}exports[_0x9454('0x10')]=function(_0x1ad817){try{utils[_0x9454('0x11')](util[_0x9454('0x12')]('[%s][queues][queuecallerjoin]',_0x1ad817[_0x9454('0x5')]),_0x1ad817);utils[_0x9454('0x3')](util[_0x9454('0x12')]('[%s][queues][queuecallerjoin]\x20name:%s\x20position:%s',_0x1ad817['uniqueid'],_0x1ad817[_0x9454('0xb')],_0x1ad817[_0x9454('0x13')]));queues[_0x1ad817[_0x9454('0x5')]]=_[_0x9454('0x14')](_0x1ad817,{'originalposition':_0x1ad817['position'],'queuecallerjoinAt':utils[_0x9454('0x15')](),'mohtime':0x0});}catch(_0x493e59){utils[_0x9454('0x16')](util['format'](_0x9454('0x17'),_0x1ad817[_0x9454('0x5')]),_0x493e59);}};exports['hangup']=function(_0xb4ed32){try{if(!_[_0x9454('0x18')](queues[_0xb4ed32[_0x9454('0x5')]])){utils['debug'](util[_0x9454('0x12')](_0x9454('0x19'),_0xb4ed32[_0x9454('0x5')]),_0xb4ed32);if(queues[_0xb4ed32['uniqueid']][_0x9454('0x1a')]){if(!queues[_0xb4ed32[_0x9454('0x5')]][_0x9454('0x1b')]&&!queues[_0xb4ed32['uniqueid']]['queuecallerexit']){queues[_0xb4ed32[_0x9454('0x5')]][_0x9454('0x1c')]=!![];queues[_0xb4ed32['uniqueid']][_0x9454('0x1d')]=utils['now']();queues[_0xb4ed32['uniqueid']]['queuecallerexitreason']=_0x9454('0x1e');}utils['info'](util[_0x9454('0x12')](_0x9454('0x1f'),_0xb4ed32[_0x9454('0x5')],queues[_0xb4ed32[_0x9454('0x5')]]['name'],queues[_0xb4ed32['uniqueid']]['queuecallerexitreason']));writeDB(queues[_0xb4ed32[_0x9454('0x5')]]);}else if(queues[_0xb4ed32[_0x9454('0x5')]][_0x9454('0xf')]){utils[_0x9454('0x3')](util[_0x9454('0x12')](_0x9454('0x20'),_0xb4ed32[_0x9454('0x5')],queues[_0xb4ed32['uniqueid']][_0x9454('0x21')],queues[_0xb4ed32[_0x9454('0x5')]][_0x9454('0xf')]));queues[queues[_0xb4ed32[_0x9454('0x5')]][_0x9454('0xf')]]=queues[_0xb4ed32[_0x9454('0x5')]];queues[queues[_0xb4ed32['uniqueid']][_0x9454('0xf')]][_0x9454('0x22')]=0x2;delete queues[_0xb4ed32[_0x9454('0x5')]];}}}catch(_0xe318f){utils[_0x9454('0x16')](util['format'](_0x9454('0x19'),_0xb4ed32[_0x9454('0x5')]),_0xe318f);}};exports[_0x9454('0x23')]=function(_0x4d00ec){try{utils['debug'](util[_0x9454('0x12')](_0x9454('0x24'),_0x4d00ec[_0x9454('0x5')]),_0x4d00ec);if(!_[_0x9454('0x18')](_0x4d00ec['variable'][_0x9454('0x25')])&&_0x4d00ec[_0x9454('0x26')][_0x9454('0x27')]()!==_0x9454('0x28')){if(!_[_0x9454('0x18')](queues[_0x4d00ec[_0x9454('0x5')]])){queues[_0x4d00ec['uniqueid']][_0x9454('0x1b')]=![];queues[_0x4d00ec[_0x9454('0x5')]]['queuecallerabandonAt']=null;queues[_0x4d00ec[_0x9454('0x5')]]['queuecallerexit']=!![];queues[_0x4d00ec[_0x9454('0x5')]][_0x9454('0x29')]=utils[_0x9454('0x15')]();queues[_0x4d00ec[_0x9454('0x5')]][_0x9454('0xa')]=_0x4d00ec['value'][_0x9454('0x27')]();utils[_0x9454('0x3')](util[_0x9454('0x12')](_0x9454('0x2a'),_0x4d00ec[_0x9454('0x5')],queues[_0x4d00ec['uniqueid']][_0x9454('0x21')],_0x4d00ec[_0x9454('0x26')],queues[_0x4d00ec[_0x9454('0x5')]][_0x9454('0xa')]));writeDB(queues[_0x4d00ec[_0x9454('0x5')]]);}}else if(!_['isNil'](_0x4d00ec['variable'][_0x9454('0x2b')])){if(!_[_0x9454('0x18')](queues[_0x4d00ec[_0x9454('0x5')]])&&!queues[_0x4d00ec[_0x9454('0x5')]][_0x9454('0x1b')]){queues[_0x4d00ec[_0x9454('0x5')]][_0x9454('0x1b')]=![];queues[_0x4d00ec[_0x9454('0x5')]][_0x9454('0x2c')]=null;queues[_0x4d00ec['uniqueid']][_0x9454('0x2d')]=!![];queues[_0x4d00ec['uniqueid']][_0x9454('0x29')]=utils[_0x9454('0x15')]();queues[_0x4d00ec[_0x9454('0x5')]]['queuecallerexitreason']='EXITWITHKEY';utils[_0x9454('0x3')](util[_0x9454('0x12')]('[%s][queues][varset]\x20name:%s\x20variable:queueposition\x20value:%s\x20queuecallerexitreason:%s',_0x4d00ec['uniqueid'],queues[_0x4d00ec[_0x9454('0x5')]][_0x9454('0x21')],_0x4d00ec['value'],queues[_0x4d00ec[_0x9454('0x5')]]['queuecallerexitreason']));}}}catch(_0x38ba8a){utils[_0x9454('0x16')](util[_0x9454('0x12')](_0x9454('0x24'),_0x4d00ec['uniqueid']),_0x38ba8a);}};exports[_0x9454('0x1b')]=function(_0x1d66ec){try{if(!_[_0x9454('0x18')](queues[_0x1d66ec[_0x9454('0x5')]])){utils[_0x9454('0x11')](util['format'](_0x9454('0x2e'),_0x1d66ec[_0x9454('0x5')]),_0x1d66ec);queues[_0x1d66ec['uniqueid']][_0x9454('0x2d')]=![];queues[_0x1d66ec[_0x9454('0x5')]][_0x9454('0x29')]=null;queues[_0x1d66ec[_0x9454('0x5')]][_0x9454('0x1b')]=!![];queues[_0x1d66ec[_0x9454('0x5')]][_0x9454('0x2c')]=utils['now']();queues[_0x1d66ec['uniqueid']][_0x9454('0xa')]='ABANDONED';utils[_0x9454('0x3')](util[_0x9454('0x12')](_0x9454('0x2f'),_0x1d66ec[_0x9454('0x5')],queues[_0x1d66ec[_0x9454('0x5')]]['name'],queues[_0x1d66ec[_0x9454('0x5')]]['queuecallerexitreason']));}}catch(_0x33a806){utils['error'](util[_0x9454('0x12')](_0x9454('0x2e'),_0x1d66ec[_0x9454('0x5')]),_0x33a806);}};exports[_0x9454('0x30')]=function(_0x34fc38){try{if(!_[_0x9454('0x18')](queues[_0x34fc38[_0x9454('0x5')]])){utils[_0x9454('0x11')](util[_0x9454('0x12')](_0x9454('0x31'),_0x34fc38[_0x9454('0x5')]),_0x34fc38);utils[_0x9454('0x3')](util[_0x9454('0x12')]('[%s][queues][queuecallerleave]\x20name:%s\x20connectedlinenum:%s\x20connectedlinename:%s',_0x34fc38[_0x9454('0x5')],queues[_0x34fc38['uniqueid']][_0x9454('0x21')],_0x34fc38['connectedlinenum'],_0x34fc38['connectedlinename']));queues[_0x34fc38['uniqueid']][_0x9454('0x30')]=!![];queues[_0x34fc38[_0x9454('0x5')]]['queuecallerleaveAt']=utils['now']();queues[_0x34fc38[_0x9454('0x5')]][_0x9454('0x32')]=utils[_0x9454('0x33')](queues[_0x34fc38[_0x9454('0x5')]][_0x9454('0x1a')],queues[_0x34fc38[_0x9454('0x5')]]['queuecallerjoinAt']);queues[_0x34fc38['uniqueid']][_0x9454('0x13')]=_0x34fc38[_0x9454('0x13')];queues[_0x34fc38['uniqueid']][_0x9454('0x34')]=_0x34fc38[_0x9454('0x34')];queues[_0x34fc38[_0x9454('0x5')]][_0x9454('0x35')]=_0x34fc38['connectedlinenum'];queues[_0x34fc38[_0x9454('0x5')]][_0x9454('0x36')]=_0x34fc38[_0x9454('0x36')];}}catch(_0x36dc04){utils['error'](util['format']('[%s][queues][queuecallerleave]',_0x34fc38[_0x9454('0x5')]),_0x36dc04);}};exports['agentconnect']=function(_0x559c49){try{if(!_[_0x9454('0x18')](queues[_0x559c49[_0x9454('0x5')]])){utils[_0x9454('0x11')](util[_0x9454('0x12')](_0x9454('0x37'),_0x559c49['uniqueid']),_0x559c49);utils['info'](util['format'](_0x9454('0x38'),_0x559c49[_0x9454('0x5')],queues[_0x559c49[_0x9454('0x5')]]['name'],_0x559c49[_0x9454('0x39')],_0x559c49[_0x9454('0x3a')]));queues[_0x559c49['uniqueid']][_0x9454('0x1b')]=![];queues[_0x559c49[_0x9454('0x5')]][_0x9454('0x1b')]=![];queues[_0x559c49['uniqueid']][_0x9454('0x2c')]=null;queues[_0x559c49[_0x9454('0x5')]][_0x9454('0x2d')]=![];queues[_0x559c49['uniqueid']][_0x9454('0xa')]=null;queues[_0x559c49[_0x9454('0x5')]][_0x9454('0x29')]=null;queues[_0x559c49['uniqueid']]['assigned']=!![];queues[_0x559c49[_0x9454('0x5')]][_0x9454('0x9')]=_0x559c49[_0x9454('0x3a')];queues[_0x559c49[_0x9454('0x5')]][_0x9454('0x7')]=_0x559c49[_0x9454('0x39')];}}catch(_0x533f68){utils[_0x9454('0x16')](util[_0x9454('0x12')]('[%s][queues][agentconnect]',_0x559c49[_0x9454('0x5')]),_0x533f68);}};exports[_0x9454('0x3b')]=function(_0x5cbfb6){try{if(!_['isNil'](queues[_0x5cbfb6[_0x9454('0x5')]])){if(queues[_0x5cbfb6['uniqueid']][_0x9454('0x1a')]){utils[_0x9454('0x11')](util[_0x9454('0x12')](_0x9454('0x3c'),_0x5cbfb6[_0x9454('0x5')]),_0x5cbfb6);queues[_0x5cbfb6[_0x9454('0x5')]][_0x9454('0x1b')]=![];queues[_0x5cbfb6['uniqueid']]['queuecallerabandon']=![];queues[_0x5cbfb6['uniqueid']][_0x9454('0x2c')]=null;queues[_0x5cbfb6[_0x9454('0x5')]][_0x9454('0x2d')]=![];queues[_0x5cbfb6[_0x9454('0x5')]]['queuecallerexitAt']=null;queues[_0x5cbfb6[_0x9454('0x5')]][_0x9454('0x3d')]=!![];queues[_0x5cbfb6['uniqueid']][_0x9454('0x7')]=_0x5cbfb6[_0x9454('0x39')];queues[_0x5cbfb6['uniqueid']][_0x9454('0x1c')]=!![];queues[_0x5cbfb6[_0x9454('0x5')]]['queuecallercompleteAt']=utils[_0x9454('0x15')]();if(_0x5cbfb6['reason']=='transfer'){if(!queues[_0x5cbfb6[_0x9454('0x5')]][_0x9454('0x3e')]){queues[_0x5cbfb6[_0x9454('0x5')]][_0x9454('0xa')]=_0x9454('0x3f');}}else{queues[_0x5cbfb6[_0x9454('0x5')]][_0x9454('0xa')]=_0x9454('0x40')+_0x5cbfb6[_0x9454('0x41')][_0x9454('0x27')]();}utils['info'](util['format'](_0x9454('0x42'),_0x5cbfb6[_0x9454('0x5')],queues[_0x5cbfb6[_0x9454('0x5')]][_0x9454('0x21')],_0x5cbfb6['membername'],queues[_0x5cbfb6[_0x9454('0x5')]][_0x9454('0xa')]));writeDB(queues[_0x5cbfb6[_0x9454('0x5')]]);}}}catch(_0x1c94ef){utils['error'](util[_0x9454('0x12')]('[%s][queues][agentcomplete]',_0x5cbfb6[_0x9454('0x5')]),_0x1c94ef);}};exports['blindtransfer']=function(_0x442cbd){try{if(!_[_0x9454('0x18')](queues[_0x442cbd[_0x9454('0x43')]])){utils[_0x9454('0x11')](util[_0x9454('0x12')](_0x9454('0x44'),_0x442cbd[_0x9454('0x5')]),_0x442cbd);queues[_0x442cbd[_0x9454('0x43')]][_0x9454('0x3e')]=!![];queues[_0x442cbd[_0x9454('0x43')]]['transfertype']=_0x9454('0x45');queues[_0x442cbd[_0x9454('0x43')]][_0x9454('0x46')]=_0x442cbd[_0x9454('0x47')];queues[_0x442cbd[_0x9454('0x43')]]['transferuniqueid']=_0x442cbd[_0x9454('0x43')];queues[_0x442cbd[_0x9454('0x43')]][_0x9454('0xa')]=_0x9454('0x48');utils[_0x9454('0x3')](util[_0x9454('0x12')](_0x9454('0x49'),_0x442cbd['uniqueid'],queues[_0x442cbd[_0x9454('0x43')]][_0x9454('0x21')],_0x442cbd[_0x9454('0x43')],_0x442cbd[_0x9454('0x47')]));}}catch(_0x1de842){utils['error'](util[_0x9454('0x12')](_0x9454('0x44'),_0x442cbd['uniqueid']),_0x1de842);}};exports['attendedtransfer']=function(_0x112d46){try{utils[_0x9454('0x11')](util[_0x9454('0x12')](_0x9454('0x4a'),_0x112d46['origtransfereruniqueid']),_0x112d46);if(_0x112d46[_0x9454('0x4b')]==_0x112d46[_0x9454('0x4c')]){if(!_['isNil'](queues[_0x112d46[_0x9454('0x4d')]])){utils[_0x9454('0x3')](util[_0x9454('0x12')](_0x9454('0x4e'),_0x112d46[_0x9454('0x4b')],queues[_0x112d46['secondtransfererlinkedid']][_0x9454('0x21')],_0x112d46[_0x9454('0x4f')]));queues[_0x112d46[_0x9454('0x4d')]]['transfer']=!![];queues[_0x112d46[_0x9454('0x4d')]][_0x9454('0x50')]=_0x9454('0x51');queues[_0x112d46[_0x9454('0x4d')]]['transferexten']=_0x112d46['origtransfererexten'];queues[_0x112d46[_0x9454('0x4d')]][_0x9454('0x52')]=_0x112d46[_0x9454('0x4b')];queues[_0x112d46['secondtransfererlinkedid']]['queuecallerexitreason']=_0x9454('0x53');}if(!_[_0x9454('0x18')](queues[_0x112d46[_0x9454('0x4c')]])){if(_0x112d46['transfereelinkedid']&&queues[_0x112d46[_0x9454('0x54')]]){queues[_0x112d46[_0x9454('0x54')]][_0x9454('0x22')]=0x1;queues[_0x112d46[_0x9454('0x43')]]=_['clone'](queues[_0x112d46['transfereelinkedid']]);queues[_0x112d46[_0x9454('0x43')]][_0x9454('0xf')]=_0x112d46[_0x9454('0x55')];queues[_0x112d46[_0x9454('0x43')]][_0x9454('0x22')]=0x2;queues[_0x112d46[_0x9454('0x43')]][_0x9454('0x8')]=queues[_0x112d46[_0x9454('0x4d')]][_0x9454('0x8')];queues[_0x112d46[_0x9454('0x43')]][_0x9454('0x56')]=queues[_0x112d46['secondtransfererlinkedid']]['calleridname'];queues[_0x112d46['transfereeuniqueid']][_0x9454('0x57')]=utils[_0x9454('0x15')]();queues[_0x112d46[_0x9454('0x43')]][_0x9454('0x1a')]=utils['now']();queues[_0x112d46[_0x9454('0x43')]][_0x9454('0x32')]=0x0;queues[_0x112d46['transfereeuniqueid']]['mohtime']=0x0;utils['info'](util[_0x9454('0x12')](_0x9454('0x58'),_0x112d46[_0x9454('0x4b')],queues[_0x112d46['transfereeuniqueid']][_0x9454('0x21')],queues[_0x112d46[_0x9454('0x43')]][_0x9454('0x8')],queues[_0x112d46[_0x9454('0x43')]][_0x9454('0x56')]));}else{utils[_0x9454('0x3')](util[_0x9454('0x12')](_0x9454('0x59'),_0x112d46[_0x9454('0x4b')],queues[_0x112d46[_0x9454('0x4c')]][_0x9454('0x21')],_0x112d46[_0x9454('0x4d')]));queues[_0x112d46[_0x9454('0x4c')]][_0x9454('0xf')]=_0x112d46['secondtransfererlinkedid'];}}}else if(_0x112d46[_0x9454('0x5a')]==_0x112d46['secondtransfererlinkedid']){if(!_[_0x9454('0x18')](queues[_0x112d46['origtransfererlinkedid']])){utils[_0x9454('0x3')](util[_0x9454('0x12')](_0x9454('0x5b'),_0x112d46[_0x9454('0x4b')],queues[_0x112d46[_0x9454('0x4c')]][_0x9454('0x21')],_0x112d46[_0x9454('0x5a')],_0x112d46[_0x9454('0x5c')]));queues[_0x112d46['origtransfererlinkedid']][_0x9454('0x3e')]=!![];queues[_0x112d46[_0x9454('0x4c')]][_0x9454('0x50')]=_0x9454('0x51');queues[_0x112d46[_0x9454('0x4c')]]['transferexten']=_0x112d46[_0x9454('0x5c')];queues[_0x112d46[_0x9454('0x4c')]][_0x9454('0x52')]=_0x112d46[_0x9454('0x5a')];queues[_0x112d46[_0x9454('0x4c')]]['queuecallerexitreason']='ATTENDEDTRANSFER';}if(!_['isNil'](queues[_0x112d46[_0x9454('0x4d')]])){if(_0x112d46['transfertargetlinkedid']&&queues[_0x112d46[_0x9454('0x5d')]]){queues[_0x112d46['transfertargetlinkedid']][_0x9454('0x22')]=0x1;queues[_0x112d46['transfertargetuniqueid']]=_['clone'](queues[_0x112d46[_0x9454('0x5d')]]);queues[_0x112d46[_0x9454('0x55')]][_0x9454('0xf')]=_0x112d46[_0x9454('0x55')];queues[_0x112d46[_0x9454('0x55')]][_0x9454('0x22')]=0x2;queues[_0x112d46[_0x9454('0x55')]]['calleridnum']=queues[_0x112d46[_0x9454('0x4c')]][_0x9454('0x8')];queues[_0x112d46[_0x9454('0x55')]][_0x9454('0x56')]=queues[_0x112d46[_0x9454('0x4c')]][_0x9454('0x56')];queues[_0x112d46[_0x9454('0x55')]]['queuecallerjoinAt']=utils[_0x9454('0x15')]();queues[_0x112d46[_0x9454('0x55')]][_0x9454('0x1a')]=utils[_0x9454('0x15')]();queues[_0x112d46[_0x9454('0x55')]][_0x9454('0x32')]=0x0;queues[_0x112d46[_0x9454('0x55')]][_0x9454('0x5e')]=0x0;utils[_0x9454('0x3')](util[_0x9454('0x12')](_0x9454('0x5f'),_0x112d46[_0x9454('0x4b')],queues[_0x112d46[_0x9454('0x55')]]['name'],queues[_0x112d46['transfertargetuniqueid']][_0x9454('0xf')],queues[_0x112d46['transfertargetuniqueid']][_0x9454('0x8')],queues[_0x112d46[_0x9454('0x55')]]['calleridname']));}else{utils[_0x9454('0x3')](util[_0x9454('0x12')](_0x9454('0x59'),_0x112d46[_0x9454('0x4b')],queues[_0x112d46[_0x9454('0x4d')]]['name'],_0x112d46[_0x9454('0x4c')]));queues[_0x112d46[_0x9454('0x4d')]][_0x9454('0xf')]=_0x112d46[_0x9454('0x4c')];}}}}catch(_0xd68a40){utils[_0x9454('0x16')](util[_0x9454('0x12')](_0x9454('0x4a'),_0x112d46[_0x9454('0x4b')]),_0xd68a40);}};exports[_0x9454('0x60')]=function(_0x391ae8){try{if(!_[_0x9454('0x18')](queues[_0x391ae8[_0x9454('0x5')]])){utils[_0x9454('0x11')](util[_0x9454('0x12')](_0x9454('0x61'),_0x391ae8[_0x9454('0x5')]),_0x391ae8);queues[_0x391ae8['uniqueid']][_0x9454('0x62')]=utils[_0x9454('0x15')]();utils['info'](util['format'](_0x9454('0x63'),_0x391ae8[_0x9454('0x5')],queues[_0x391ae8[_0x9454('0x5')]]['name'],queues[_0x391ae8[_0x9454('0x5')]][_0x9454('0x62')]));}}catch(_0x46dae8){utils[_0x9454('0x16')](util[_0x9454('0x12')](_0x9454('0x61'),_0x391ae8[_0x9454('0x5')]),_0x46dae8);}};exports[_0x9454('0x64')]=function(_0x2d2abe){try{if(!_['isNil'](queues[_0x2d2abe[_0x9454('0x5')]])){if(!_[_0x9454('0x18')](queues[_0x2d2abe[_0x9454('0x5')]]['musiconholdstartAt'])){utils[_0x9454('0x11')](util[_0x9454('0x12')](_0x9454('0x65'),_0x2d2abe['uniqueid']),_0x2d2abe);queues[_0x2d2abe[_0x9454('0x5')]][_0x9454('0x5e')]+=utils[_0x9454('0x33')](utils[_0x9454('0x15')](),queues[_0x2d2abe[_0x9454('0x5')]][_0x9454('0x62')]);utils[_0x9454('0x3')](util[_0x9454('0x12')](_0x9454('0x66'),_0x2d2abe[_0x9454('0x5')],queues[_0x2d2abe[_0x9454('0x5')]][_0x9454('0x21')],queues[_0x2d2abe[_0x9454('0x5')]][_0x9454('0x5e')]));delete queues[_0x2d2abe[_0x9454('0x5')]][_0x9454('0x62')];}}}catch(_0x189232){utils[_0x9454('0x16')](util['format'](_0x9454('0x65'),_0x2d2abe[_0x9454('0x5')]),_0x189232);}}; \ No newline at end of file +var _0x1aac=['musiconholdstartAt','[%s][queues][musiconholdstop]\x20name:%s\x20musiconholdstartAt:%s','[%s][queues][musiconholdstop]','lodash','util','./utils','info','format','[%s][queues][writeDB]\x20channel:%s\x20queue:%s\x20lastAssignedTo:%s\x20calleridnum:%s\x20accountcode:%s\x20queuecallerexitreason:%s','uniqueid','queue','lastAssignedTo','calleridnum','queuecallerexitreason','getVoiceQueueByName','type','request','CreateVoiceQueueReport','transfereduniqueid','debug','[%s][queues][queuecallerjoin]','[%s][queues][queuecallerjoin]\x20name:%s\x20position:%s','position','assign','now','error','hangup','isNil','queuecallerleaveAt','queuecallerabandon','queuecallerexit','queuecallercompleteAt','COMPLETEDBYAGENT','[%s][queues][hangup]\x20name:%s\x20queuecallerexitreason:%s','name','[%s][queues][hangup]\x20name:%s\x20transfereduniqueid:%s','[%s][queues][hangup]','varset','value','toUpperCase','variable','queueposition','queuecallerabandonAt','EXITWITHKEY','[%s][queues][varset]\x20name:%s\x20variable:queueposition\x20value:%s\x20queuecallerexitreason:%s','[%s][queues][varset]','[%s][queues][queuecallerabandon]','queuecallerexitAt','ABANDONED','[%s][queues][queuecallerabandon]\x20name:%s\x20queuecallerexitreason:%s','queuecallerleave','connectedlinename','holdtime','diffTime','queuecallerjoinAt','count','agentconnect','[%s][queues][agentconnect]','destaccountcode','assigned','accountcode','[%s][queues][agentcomplete]','membername','queuecallercomplete','reason','transfer','TRANSFER','COMPLETEDBY','[%s][queues][agentcomplete]\x20name:%s\x20agent:%s\x20queuecallerexitreason:%s','transfereeuniqueid','[%s][queues][blindtransfer]','transferexten','extension','BLINDTRANSFER','[%s][queues][blindtransfer]\x20name:%s\x20transferuniqueid:%s\x20transferexten:%s\x20queuecallerexitreason:BLINDTRANSFER','attendedtransfer','[%s][queues][attendedtransfer]','origtransfereruniqueid','secondtransfererlinkedid','origtransfererexten','transfertype','ATTENDEDTRANSFER','transfereelinkedid','queuecallerenterreason','clone','transfertargetuniqueid','calleridname','mohtime','[%s][queues][attendedtransfer]\x20name:%s\x20calleridnum:%s\x20calleridname:%s','[%s][queues][attendedtransfer]\x20name:%s\x20transfereduniqueid:%s','origtransfererlinkedid','secondtransfereruniqueid','secondtransfererexten','ATTENDED','transferuniqueid','transfertargetlinkedid','[%s][queues][attendedtransfer]\x20name:%s\x20transfereduniqueid:%s\x20calleridnum:%s\x20calleridname:%s','musiconholdstart','[%s][queues][musiconholdstart]'];(function(_0x5401a1,_0x64df68){var _0x2ac50c=function(_0x14ba07){while(--_0x14ba07){_0x5401a1['push'](_0x5401a1['shift']());}};_0x2ac50c(++_0x64df68);}(_0x1aac,0x18f));var _0xc1aa=function(_0x168bff,_0xc80496){_0x168bff=_0x168bff-0x0;var _0x35f1e6=_0x1aac[_0x168bff];return _0x35f1e6;};'use strict';var _=require(_0xc1aa('0x0'));var util=require(_0xc1aa('0x1'));var utils=require(_0xc1aa('0x2'));var queues={};function writeDB(_0xa6703a){utils[_0xc1aa('0x3')](util[_0xc1aa('0x4')](_0xc1aa('0x5'),_0xa6703a[_0xc1aa('0x6')],_0xa6703a['channel'],_0xa6703a[_0xc1aa('0x7')],_0xa6703a[_0xc1aa('0x8')],_0xa6703a[_0xc1aa('0x9')],_0xa6703a['accountcode'],_0xa6703a[_0xc1aa('0xa')]));if(_0xa6703a[_0xc1aa('0x7')]){utils[_0xc1aa('0xb')](_0xa6703a[_0xc1aa('0x7')])['then'](function(_0x2a8323){if(_0x2a8323){_0xa6703a[_0xc1aa('0xc')]=_0x2a8323[_0xc1aa('0xc')];}utils[_0xc1aa('0xd')](_0xc1aa('0xe'),_0xa6703a);});}else{utils[_0xc1aa('0xd')]('CreateVoiceQueueReport',_0xa6703a);}if(_0xa6703a['transfereduniqueid']){delete queues[_0xa6703a[_0xc1aa('0xf')]];}else{delete queues[_0xa6703a[_0xc1aa('0x6')]];}}exports['queuecallerjoin']=function(_0x173e9d){try{utils[_0xc1aa('0x10')](util['format'](_0xc1aa('0x11'),_0x173e9d['uniqueid']),_0x173e9d);utils[_0xc1aa('0x3')](util['format'](_0xc1aa('0x12'),_0x173e9d[_0xc1aa('0x6')],_0x173e9d['queue'],_0x173e9d[_0xc1aa('0x13')]));queues[_0x173e9d[_0xc1aa('0x6')]]=_[_0xc1aa('0x14')](_0x173e9d,{'originalposition':_0x173e9d['position'],'queuecallerjoinAt':utils[_0xc1aa('0x15')](),'mohtime':0x0});}catch(_0x34f7fb){utils[_0xc1aa('0x16')](util[_0xc1aa('0x4')]('[%s][queues][queuecallerjoin]',_0x173e9d[_0xc1aa('0x6')]),_0x34f7fb);}};exports[_0xc1aa('0x17')]=function(_0x527f8e){try{if(!_[_0xc1aa('0x18')](queues[_0x527f8e[_0xc1aa('0x6')]])){utils[_0xc1aa('0x10')](util['format']('[%s][queues][hangup]',_0x527f8e[_0xc1aa('0x6')]),_0x527f8e);if(queues[_0x527f8e['uniqueid']][_0xc1aa('0x19')]){if(!queues[_0x527f8e[_0xc1aa('0x6')]][_0xc1aa('0x1a')]&&!queues[_0x527f8e[_0xc1aa('0x6')]][_0xc1aa('0x1b')]){queues[_0x527f8e[_0xc1aa('0x6')]]['queuecallercomplete']=!![];queues[_0x527f8e[_0xc1aa('0x6')]][_0xc1aa('0x1c')]=utils[_0xc1aa('0x15')]();queues[_0x527f8e[_0xc1aa('0x6')]]['queuecallerexitreason']=_0xc1aa('0x1d');}utils[_0xc1aa('0x3')](util[_0xc1aa('0x4')](_0xc1aa('0x1e'),_0x527f8e[_0xc1aa('0x6')],queues[_0x527f8e['uniqueid']][_0xc1aa('0x1f')],queues[_0x527f8e['uniqueid']][_0xc1aa('0xa')]));writeDB(queues[_0x527f8e[_0xc1aa('0x6')]]);}else if(queues[_0x527f8e['uniqueid']][_0xc1aa('0xf')]){utils[_0xc1aa('0x3')](util[_0xc1aa('0x4')](_0xc1aa('0x20'),_0x527f8e[_0xc1aa('0x6')],queues[_0x527f8e[_0xc1aa('0x6')]][_0xc1aa('0x1f')],queues[_0x527f8e[_0xc1aa('0x6')]][_0xc1aa('0xf')]));queues[queues[_0x527f8e[_0xc1aa('0x6')]][_0xc1aa('0xf')]]=queues[_0x527f8e[_0xc1aa('0x6')]];queues[queues[_0x527f8e[_0xc1aa('0x6')]][_0xc1aa('0xf')]]['queuecallerenterreason']=0x2;delete queues[_0x527f8e[_0xc1aa('0x6')]];}}}catch(_0x3d1580){utils[_0xc1aa('0x16')](util[_0xc1aa('0x4')](_0xc1aa('0x21'),_0x527f8e[_0xc1aa('0x6')]),_0x3d1580);}};exports[_0xc1aa('0x22')]=function(_0x403cd3){try{utils[_0xc1aa('0x10')](util['format']('[%s][queues][varset]',_0x403cd3[_0xc1aa('0x6')]),_0x403cd3);if(!_[_0xc1aa('0x18')](_0x403cd3['variable']['queuestatus'])&&_0x403cd3[_0xc1aa('0x23')][_0xc1aa('0x24')]()!=='CONTINUE'){if(!_[_0xc1aa('0x18')](queues[_0x403cd3[_0xc1aa('0x6')]])){queues[_0x403cd3[_0xc1aa('0x6')]]['queuecallerabandon']=![];queues[_0x403cd3[_0xc1aa('0x6')]]['queuecallerabandonAt']=null;queues[_0x403cd3[_0xc1aa('0x6')]][_0xc1aa('0x1b')]=!![];queues[_0x403cd3[_0xc1aa('0x6')]]['queuecallerexitAt']=utils[_0xc1aa('0x15')]();queues[_0x403cd3['uniqueid']]['queuecallerexitreason']=_0x403cd3['value']['toUpperCase']();utils[_0xc1aa('0x3')](util['format']('[%s][queues][varset]\x20name:%s\x20variable:queuestatus\x20value:%s\x20queuecallerexitreason:%s',_0x403cd3[_0xc1aa('0x6')],queues[_0x403cd3['uniqueid']][_0xc1aa('0x1f')],_0x403cd3[_0xc1aa('0x23')],queues[_0x403cd3[_0xc1aa('0x6')]][_0xc1aa('0xa')]));writeDB(queues[_0x403cd3['uniqueid']]);}}else if(!_[_0xc1aa('0x18')](_0x403cd3[_0xc1aa('0x25')][_0xc1aa('0x26')])){if(!_[_0xc1aa('0x18')](queues[_0x403cd3[_0xc1aa('0x6')]])&&!queues[_0x403cd3[_0xc1aa('0x6')]][_0xc1aa('0x1a')]){queues[_0x403cd3['uniqueid']][_0xc1aa('0x1a')]=![];queues[_0x403cd3[_0xc1aa('0x6')]][_0xc1aa('0x27')]=null;queues[_0x403cd3[_0xc1aa('0x6')]][_0xc1aa('0x1b')]=!![];queues[_0x403cd3[_0xc1aa('0x6')]]['queuecallerexitAt']=utils['now']();queues[_0x403cd3['uniqueid']][_0xc1aa('0xa')]=_0xc1aa('0x28');utils['info'](util['format'](_0xc1aa('0x29'),_0x403cd3[_0xc1aa('0x6')],queues[_0x403cd3[_0xc1aa('0x6')]]['name'],_0x403cd3[_0xc1aa('0x23')],queues[_0x403cd3[_0xc1aa('0x6')]][_0xc1aa('0xa')]));}}}catch(_0x30d241){utils[_0xc1aa('0x16')](util['format'](_0xc1aa('0x2a'),_0x403cd3[_0xc1aa('0x6')]),_0x30d241);}};exports[_0xc1aa('0x1a')]=function(_0x3383ae){try{if(!_[_0xc1aa('0x18')](queues[_0x3383ae[_0xc1aa('0x6')]])){utils[_0xc1aa('0x10')](util[_0xc1aa('0x4')](_0xc1aa('0x2b'),_0x3383ae[_0xc1aa('0x6')]),_0x3383ae);queues[_0x3383ae['uniqueid']]['queuecallerexit']=![];queues[_0x3383ae[_0xc1aa('0x6')]][_0xc1aa('0x2c')]=null;queues[_0x3383ae['uniqueid']][_0xc1aa('0x1a')]=!![];queues[_0x3383ae[_0xc1aa('0x6')]]['queuecallerabandonAt']=utils['now']();queues[_0x3383ae[_0xc1aa('0x6')]][_0xc1aa('0xa')]=_0xc1aa('0x2d');utils[_0xc1aa('0x3')](util[_0xc1aa('0x4')](_0xc1aa('0x2e'),_0x3383ae[_0xc1aa('0x6')],queues[_0x3383ae[_0xc1aa('0x6')]][_0xc1aa('0x1f')],queues[_0x3383ae[_0xc1aa('0x6')]][_0xc1aa('0xa')]));}}catch(_0x4f6ff4){utils[_0xc1aa('0x16')](util['format'](_0xc1aa('0x2b'),_0x3383ae[_0xc1aa('0x6')]),_0x4f6ff4);}};exports[_0xc1aa('0x2f')]=function(_0x14240f){try{if(!_[_0xc1aa('0x18')](queues[_0x14240f['uniqueid']])){utils[_0xc1aa('0x10')](util[_0xc1aa('0x4')]('[%s][queues][queuecallerleave]',_0x14240f[_0xc1aa('0x6')]),_0x14240f);utils[_0xc1aa('0x3')](util[_0xc1aa('0x4')]('[%s][queues][queuecallerleave]\x20name:%s\x20connectedlinenum:%s\x20connectedlinename:%s',_0x14240f[_0xc1aa('0x6')],queues[_0x14240f['uniqueid']][_0xc1aa('0x1f')],_0x14240f['connectedlinenum'],_0x14240f[_0xc1aa('0x30')]));queues[_0x14240f[_0xc1aa('0x6')]][_0xc1aa('0x2f')]=!![];queues[_0x14240f[_0xc1aa('0x6')]][_0xc1aa('0x19')]=utils[_0xc1aa('0x15')]();queues[_0x14240f[_0xc1aa('0x6')]][_0xc1aa('0x31')]=utils[_0xc1aa('0x32')](queues[_0x14240f[_0xc1aa('0x6')]]['queuecallerleaveAt'],queues[_0x14240f[_0xc1aa('0x6')]][_0xc1aa('0x33')]);queues[_0x14240f[_0xc1aa('0x6')]][_0xc1aa('0x13')]=_0x14240f[_0xc1aa('0x13')];queues[_0x14240f['uniqueid']][_0xc1aa('0x34')]=_0x14240f[_0xc1aa('0x34')];queues[_0x14240f[_0xc1aa('0x6')]]['connectedlinenum']=_0x14240f['connectedlinenum'];queues[_0x14240f[_0xc1aa('0x6')]]['connectedlinename']=_0x14240f[_0xc1aa('0x30')];}}catch(_0x24fad9){utils[_0xc1aa('0x16')](util[_0xc1aa('0x4')]('[%s][queues][queuecallerleave]',_0x14240f['uniqueid']),_0x24fad9);}};exports[_0xc1aa('0x35')]=function(_0x2754bc){try{if(!_[_0xc1aa('0x18')](queues[_0x2754bc['uniqueid']])){utils[_0xc1aa('0x10')](util[_0xc1aa('0x4')](_0xc1aa('0x36'),_0x2754bc['uniqueid']),_0x2754bc);utils[_0xc1aa('0x3')](util[_0xc1aa('0x4')]('[%s][queues][agentconnect]\x20name:%s\x20agent:%s\x20accountcode:%s',_0x2754bc[_0xc1aa('0x6')],queues[_0x2754bc[_0xc1aa('0x6')]][_0xc1aa('0x1f')],_0x2754bc['membername'],_0x2754bc[_0xc1aa('0x37')]));queues[_0x2754bc[_0xc1aa('0x6')]][_0xc1aa('0x1a')]=![];queues[_0x2754bc[_0xc1aa('0x6')]][_0xc1aa('0x1a')]=![];queues[_0x2754bc[_0xc1aa('0x6')]]['queuecallerabandonAt']=null;queues[_0x2754bc[_0xc1aa('0x6')]][_0xc1aa('0x1b')]=![];queues[_0x2754bc[_0xc1aa('0x6')]][_0xc1aa('0xa')]=null;queues[_0x2754bc['uniqueid']]['queuecallerexitAt']=null;queues[_0x2754bc[_0xc1aa('0x6')]][_0xc1aa('0x38')]=!![];queues[_0x2754bc[_0xc1aa('0x6')]][_0xc1aa('0x39')]=_0x2754bc[_0xc1aa('0x37')];queues[_0x2754bc[_0xc1aa('0x6')]]['lastAssignedTo']=_0x2754bc['membername'];}}catch(_0x4769f5){utils[_0xc1aa('0x16')](util[_0xc1aa('0x4')](_0xc1aa('0x36'),_0x2754bc[_0xc1aa('0x6')]),_0x4769f5);}};exports['agentcomplete']=function(_0x438932){try{if(!_[_0xc1aa('0x18')](queues[_0x438932[_0xc1aa('0x6')]])){if(queues[_0x438932[_0xc1aa('0x6')]][_0xc1aa('0x19')]){utils[_0xc1aa('0x10')](util['format'](_0xc1aa('0x3a'),_0x438932['uniqueid']),_0x438932);queues[_0x438932[_0xc1aa('0x6')]]['queuecallerabandon']=![];queues[_0x438932[_0xc1aa('0x6')]]['queuecallerabandon']=![];queues[_0x438932['uniqueid']][_0xc1aa('0x27')]=null;queues[_0x438932['uniqueid']][_0xc1aa('0x1b')]=![];queues[_0x438932[_0xc1aa('0x6')]][_0xc1aa('0x2c')]=null;queues[_0x438932['uniqueid']]['assigned']=!![];queues[_0x438932[_0xc1aa('0x6')]][_0xc1aa('0x8')]=_0x438932[_0xc1aa('0x3b')];queues[_0x438932['uniqueid']][_0xc1aa('0x3c')]=!![];queues[_0x438932[_0xc1aa('0x6')]][_0xc1aa('0x1c')]=utils[_0xc1aa('0x15')]();if(_0x438932[_0xc1aa('0x3d')]==_0xc1aa('0x3e')){if(!queues[_0x438932[_0xc1aa('0x6')]][_0xc1aa('0x3e')]){queues[_0x438932['uniqueid']]['queuecallerexitreason']=_0xc1aa('0x3f');}}else{queues[_0x438932[_0xc1aa('0x6')]][_0xc1aa('0xa')]=_0xc1aa('0x40')+_0x438932[_0xc1aa('0x3d')][_0xc1aa('0x24')]();}utils['info'](util[_0xc1aa('0x4')](_0xc1aa('0x41'),_0x438932[_0xc1aa('0x6')],queues[_0x438932[_0xc1aa('0x6')]][_0xc1aa('0x1f')],_0x438932[_0xc1aa('0x3b')],queues[_0x438932[_0xc1aa('0x6')]]['queuecallerexitreason']));writeDB(queues[_0x438932[_0xc1aa('0x6')]]);}}}catch(_0x55d8d8){utils[_0xc1aa('0x16')](util[_0xc1aa('0x4')](_0xc1aa('0x3a'),_0x438932[_0xc1aa('0x6')]),_0x55d8d8);}};exports['blindtransfer']=function(_0x38c995){try{if(!_[_0xc1aa('0x18')](queues[_0x38c995[_0xc1aa('0x42')]])){utils[_0xc1aa('0x10')](util[_0xc1aa('0x4')](_0xc1aa('0x43'),_0x38c995[_0xc1aa('0x6')]),_0x38c995);queues[_0x38c995[_0xc1aa('0x42')]][_0xc1aa('0x3e')]=!![];queues[_0x38c995[_0xc1aa('0x42')]]['transfertype']='BLIND';queues[_0x38c995[_0xc1aa('0x42')]][_0xc1aa('0x44')]=_0x38c995[_0xc1aa('0x45')];queues[_0x38c995[_0xc1aa('0x42')]]['transferuniqueid']=_0x38c995[_0xc1aa('0x42')];queues[_0x38c995[_0xc1aa('0x42')]][_0xc1aa('0xa')]=_0xc1aa('0x46');utils[_0xc1aa('0x3')](util[_0xc1aa('0x4')](_0xc1aa('0x47'),_0x38c995['uniqueid'],queues[_0x38c995[_0xc1aa('0x42')]][_0xc1aa('0x1f')],_0x38c995[_0xc1aa('0x42')],_0x38c995[_0xc1aa('0x45')]));}}catch(_0x3ffa04){utils[_0xc1aa('0x16')](util['format']('[%s][queues][blindtransfer]',_0x38c995[_0xc1aa('0x6')]),_0x3ffa04);}};exports[_0xc1aa('0x48')]=function(_0x3d347a){try{utils[_0xc1aa('0x10')](util[_0xc1aa('0x4')](_0xc1aa('0x49'),_0x3d347a[_0xc1aa('0x4a')]),_0x3d347a);if(_0x3d347a['origtransfereruniqueid']==_0x3d347a['origtransfererlinkedid']){if(!_[_0xc1aa('0x18')](queues[_0x3d347a[_0xc1aa('0x4b')]])){utils['info'](util['format']('[%s][queues][attendedtransfer]\x20name:%s\x20transferexten:%s\x20queuecallerexitreason:ATTENDEDTRANSFER',_0x3d347a[_0xc1aa('0x4a')],queues[_0x3d347a['secondtransfererlinkedid']][_0xc1aa('0x1f')],_0x3d347a[_0xc1aa('0x4c')]));queues[_0x3d347a[_0xc1aa('0x4b')]][_0xc1aa('0x3e')]=!![];queues[_0x3d347a[_0xc1aa('0x4b')]][_0xc1aa('0x4d')]='ATTENDED';queues[_0x3d347a[_0xc1aa('0x4b')]][_0xc1aa('0x44')]=_0x3d347a['origtransfererexten'];queues[_0x3d347a[_0xc1aa('0x4b')]]['transferuniqueid']=_0x3d347a[_0xc1aa('0x4a')];queues[_0x3d347a[_0xc1aa('0x4b')]][_0xc1aa('0xa')]=_0xc1aa('0x4e');}if(!_[_0xc1aa('0x18')](queues[_0x3d347a['origtransfererlinkedid']])){if(_0x3d347a[_0xc1aa('0x4f')]&&queues[_0x3d347a[_0xc1aa('0x4f')]]){queues[_0x3d347a[_0xc1aa('0x4f')]][_0xc1aa('0x50')]=0x1;queues[_0x3d347a[_0xc1aa('0x42')]]=_[_0xc1aa('0x51')](queues[_0x3d347a[_0xc1aa('0x4f')]]);queues[_0x3d347a[_0xc1aa('0x42')]][_0xc1aa('0xf')]=_0x3d347a[_0xc1aa('0x52')];queues[_0x3d347a[_0xc1aa('0x42')]][_0xc1aa('0x50')]=0x2;queues[_0x3d347a[_0xc1aa('0x42')]][_0xc1aa('0x9')]=queues[_0x3d347a['secondtransfererlinkedid']][_0xc1aa('0x9')];queues[_0x3d347a[_0xc1aa('0x42')]][_0xc1aa('0x53')]=queues[_0x3d347a[_0xc1aa('0x4b')]][_0xc1aa('0x53')];queues[_0x3d347a[_0xc1aa('0x42')]][_0xc1aa('0x33')]=utils[_0xc1aa('0x15')]();queues[_0x3d347a[_0xc1aa('0x42')]][_0xc1aa('0x19')]=utils[_0xc1aa('0x15')]();queues[_0x3d347a[_0xc1aa('0x42')]]['holdtime']=0x0;queues[_0x3d347a[_0xc1aa('0x42')]][_0xc1aa('0x54')]=0x0;utils[_0xc1aa('0x3')](util[_0xc1aa('0x4')](_0xc1aa('0x55'),_0x3d347a[_0xc1aa('0x4a')],queues[_0x3d347a['transfereeuniqueid']]['name'],queues[_0x3d347a['transfereeuniqueid']][_0xc1aa('0x9')],queues[_0x3d347a[_0xc1aa('0x42')]]['calleridname']));}else{utils[_0xc1aa('0x3')](util['format'](_0xc1aa('0x56'),_0x3d347a[_0xc1aa('0x4a')],queues[_0x3d347a['origtransfererlinkedid']]['name'],_0x3d347a[_0xc1aa('0x4b')]));queues[_0x3d347a[_0xc1aa('0x57')]]['transfereduniqueid']=_0x3d347a['secondtransfererlinkedid'];}}}else if(_0x3d347a['secondtransfereruniqueid']==_0x3d347a[_0xc1aa('0x4b')]){if(!_[_0xc1aa('0x18')](queues[_0x3d347a[_0xc1aa('0x57')]])){utils[_0xc1aa('0x3')](util['format']('[%s][queues][attendedtransfer]\x20name:%s\x20transferuniqueid:%s\x20transferexten:%s\x20queuecallerexitreason:ATTENDEDTRANSFER',_0x3d347a[_0xc1aa('0x4a')],queues[_0x3d347a[_0xc1aa('0x57')]][_0xc1aa('0x1f')],_0x3d347a[_0xc1aa('0x58')],_0x3d347a[_0xc1aa('0x59')]));queues[_0x3d347a['origtransfererlinkedid']][_0xc1aa('0x3e')]=!![];queues[_0x3d347a['origtransfererlinkedid']]['transfertype']=_0xc1aa('0x5a');queues[_0x3d347a[_0xc1aa('0x57')]][_0xc1aa('0x44')]=_0x3d347a[_0xc1aa('0x59')];queues[_0x3d347a[_0xc1aa('0x57')]][_0xc1aa('0x5b')]=_0x3d347a[_0xc1aa('0x58')];queues[_0x3d347a[_0xc1aa('0x57')]][_0xc1aa('0xa')]=_0xc1aa('0x4e');}if(!_[_0xc1aa('0x18')](queues[_0x3d347a[_0xc1aa('0x4b')]])){if(_0x3d347a[_0xc1aa('0x5c')]&&queues[_0x3d347a['transfertargetlinkedid']]){queues[_0x3d347a[_0xc1aa('0x5c')]][_0xc1aa('0x50')]=0x1;queues[_0x3d347a[_0xc1aa('0x52')]]=_[_0xc1aa('0x51')](queues[_0x3d347a['transfertargetlinkedid']]);queues[_0x3d347a[_0xc1aa('0x52')]]['transfereduniqueid']=_0x3d347a[_0xc1aa('0x52')];queues[_0x3d347a[_0xc1aa('0x52')]][_0xc1aa('0x50')]=0x2;queues[_0x3d347a[_0xc1aa('0x52')]]['calleridnum']=queues[_0x3d347a[_0xc1aa('0x57')]][_0xc1aa('0x9')];queues[_0x3d347a[_0xc1aa('0x52')]][_0xc1aa('0x53')]=queues[_0x3d347a['origtransfererlinkedid']][_0xc1aa('0x53')];queues[_0x3d347a[_0xc1aa('0x52')]]['queuecallerjoinAt']=utils['now']();queues[_0x3d347a[_0xc1aa('0x52')]][_0xc1aa('0x19')]=utils['now']();queues[_0x3d347a[_0xc1aa('0x52')]][_0xc1aa('0x31')]=0x0;queues[_0x3d347a['transfertargetuniqueid']][_0xc1aa('0x54')]=0x0;utils[_0xc1aa('0x3')](util[_0xc1aa('0x4')](_0xc1aa('0x5d'),_0x3d347a['origtransfereruniqueid'],queues[_0x3d347a[_0xc1aa('0x52')]][_0xc1aa('0x1f')],queues[_0x3d347a['transfertargetuniqueid']][_0xc1aa('0xf')],queues[_0x3d347a['transfertargetuniqueid']][_0xc1aa('0x9')],queues[_0x3d347a[_0xc1aa('0x52')]][_0xc1aa('0x53')]));}else{utils[_0xc1aa('0x3')](util['format'](_0xc1aa('0x56'),_0x3d347a['origtransfereruniqueid'],queues[_0x3d347a[_0xc1aa('0x4b')]][_0xc1aa('0x1f')],_0x3d347a[_0xc1aa('0x57')]));queues[_0x3d347a[_0xc1aa('0x4b')]][_0xc1aa('0xf')]=_0x3d347a[_0xc1aa('0x57')];}}}}catch(_0x408054){utils[_0xc1aa('0x16')](util['format'](_0xc1aa('0x49'),_0x3d347a[_0xc1aa('0x4a')]),_0x408054);}};exports[_0xc1aa('0x5e')]=function(_0x4985b2){try{if(!_[_0xc1aa('0x18')](queues[_0x4985b2[_0xc1aa('0x6')]])){utils[_0xc1aa('0x10')](util[_0xc1aa('0x4')](_0xc1aa('0x5f'),_0x4985b2[_0xc1aa('0x6')]),_0x4985b2);queues[_0x4985b2[_0xc1aa('0x6')]][_0xc1aa('0x60')]=utils[_0xc1aa('0x15')]();utils['info'](util[_0xc1aa('0x4')](_0xc1aa('0x61'),_0x4985b2[_0xc1aa('0x6')],queues[_0x4985b2[_0xc1aa('0x6')]][_0xc1aa('0x1f')],queues[_0x4985b2[_0xc1aa('0x6')]][_0xc1aa('0x60')]));}}catch(_0x573431){utils[_0xc1aa('0x16')](util[_0xc1aa('0x4')](_0xc1aa('0x5f'),_0x4985b2['uniqueid']),_0x573431);}};exports['musiconholdstop']=function(_0x747a0c){try{if(!_[_0xc1aa('0x18')](queues[_0x747a0c[_0xc1aa('0x6')]])){if(!_['isNil'](queues[_0x747a0c[_0xc1aa('0x6')]][_0xc1aa('0x60')])){utils[_0xc1aa('0x10')](util[_0xc1aa('0x4')](_0xc1aa('0x62'),_0x747a0c[_0xc1aa('0x6')]),_0x747a0c);queues[_0x747a0c[_0xc1aa('0x6')]][_0xc1aa('0x54')]+=utils[_0xc1aa('0x32')](utils[_0xc1aa('0x15')](),queues[_0x747a0c[_0xc1aa('0x6')]][_0xc1aa('0x60')]);utils['info'](util[_0xc1aa('0x4')]('[%s][queues][musiconholdstop]\x20name:%s\x20mohtime:%s',_0x747a0c[_0xc1aa('0x6')],queues[_0x747a0c[_0xc1aa('0x6')]][_0xc1aa('0x1f')],queues[_0x747a0c[_0xc1aa('0x6')]][_0xc1aa('0x54')]));delete queues[_0x747a0c[_0xc1aa('0x6')]]['musiconholdstartAt'];}}}catch(_0x37224e){utils[_0xc1aa('0x16')](util[_0xc1aa('0x4')](_0xc1aa('0x62'),_0x747a0c['uniqueid']),_0x37224e);}}; \ No newline at end of file diff --git a/server/services/xdr/recordings.controller.js b/server/services/xdr/recordings.controller.js index 5d8ba05..c36e035 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 _0x366e=['.WAV','find','monitors','push','[%s][recordings][varset]','[%s][recordings][hangup]','calleridnum','calleridname','cause-txt','connectedlinenum','connectedlinename','outbound','clone','[%s][recordings][newexten]','application','appdata','set','startsWith','cdr','split','substring','lastIndexOf','queuecallerjoin','[%s][recordings][queuecallerjoin]\x20queue:%s','queue','[%s][recordings][queuecallerjoin]','util','./utils','info','format','[%s][recordings][writeDB]','uniqueid','accountcode','membername','UserId','request','CreateVoiceRecording','newchannel','debug','[%s][recordings][newchannel]','[%s][recordings][newchannel]\x20context:%s\x20exten:%s','context','exten','channel','error','newstate','isNil','channelstate','[%s][recordings][newstate]\x20context:%s\x20channel:%s','linkedid','[%s][recordings][newstate]','varset','variable','[%s][recordings][varset]\x20variable:%s\x20value:%s','value','endsWith','.wav49'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x366e,0xc5));var _0xe366=function(_0x426258,_0x22e200){_0x426258=_0x426258-0x0;var _0x40f83f=_0x366e[_0x426258];return _0x40f83f;};'use strict';var _=require('lodash');var util=require(_0xe366('0x0'));var utils=require(_0xe366('0x1'));var recordings={};function writeDB(_0x50fcb8){utils[_0xe366('0x2')](util[_0xe366('0x3')](_0xe366('0x4'),_0x50fcb8[_0xe366('0x5')]));if(_0x50fcb8[_0xe366('0x6')]){utils['getUserByInternal'](_0x50fcb8[_0xe366('0x6')])['then'](function(_0x38ec98){if(_0x38ec98){_0x50fcb8[_0xe366('0x7')]=_0x38ec98['name'];_0x50fcb8[_0xe366('0x8')]=_0x38ec98['id'];}utils[_0xe366('0x9')](_0xe366('0xa'),_0x50fcb8);});}else{utils[_0xe366('0x9')]('CreateVoiceRecording',_0x50fcb8);}}exports[_0xe366('0xb')]=function(_0x35ed52){try{utils[_0xe366('0xc')](util[_0xe366('0x3')](_0xe366('0xd'),_0x35ed52[_0xe366('0x5')]),_0x35ed52);if(_0x35ed52[_0xe366('0x5')]==_0x35ed52['linkedid']){utils[_0xe366('0x2')](util['format'](_0xe366('0xe'),_0x35ed52[_0xe366('0x5')],_0x35ed52[_0xe366('0xf')],_0x35ed52[_0xe366('0x10')]));recordings[_0x35ed52[_0xe366('0x5')]]={'uniqueid':_0x35ed52[_0xe366('0x5')],'accountcode':_0x35ed52['accountcode'],'exten':_0x35ed52[_0xe366('0x10')],'context':_0x35ed52[_0xe366('0xf')],'channel':_0x35ed52[_0xe366('0x11')],'monitors':[]};}}catch(_0x229aa1){utils[_0xe366('0x12')](util[_0xe366('0x3')](_0xe366('0xd'),_0x35ed52[_0xe366('0x5')]),_0x229aa1);}};exports[_0xe366('0x13')]=function(_0x26179e){try{utils[_0xe366('0xc')](util['format']('[%s][recordings][newstate]',_0x26179e[_0xe366('0x5')]),_0x26179e);if(!_[_0xe366('0x14')](recordings[_0x26179e[_0xe366('0x5')]])&&_0x26179e[_0xe366('0x15')]==0x6){utils[_0xe366('0x2')](util[_0xe366('0x3')](_0xe366('0x16'),_0x26179e[_0xe366('0x5')],_0x26179e[_0xe366('0xf')],_0x26179e['channel']));}else if(!_['isNil'](recordings[_0x26179e['linkedid']])&&_0x26179e[_0xe366('0x15')]==0x6&&_0x26179e[_0xe366('0xf')]!='transfer'){utils['info'](util[_0xe366('0x3')]('[%s][recordings][newstate]\x20linkedid:%s\x20context:%s\x20channel:%s',_0x26179e[_0xe366('0x5')],_0x26179e['linkedid'],_0x26179e['context'],_0x26179e[_0xe366('0x11')]));recordings[_0x26179e[_0xe366('0x17')]][_0xe366('0x6')]=_0x26179e[_0xe366('0x6')];}}catch(_0x4099bd){utils[_0xe366('0x12')](util[_0xe366('0x3')](_0xe366('0x18'),_0x26179e[_0xe366('0x5')]),_0x4099bd);}};exports[_0xe366('0x19')]=function(_0xcd1963){try{if(!_[_0xe366('0x14')](_0xcd1963[_0xe366('0x1a')])&&!_[_0xe366('0x14')](_0xcd1963[_0xe366('0x1a')]['mixmonitor_filename'])){utils[_0xe366('0xc')](util['format']('[%s][recordings][varset]',_0xcd1963[_0xe366('0x5')]),_0xcd1963);utils[_0xe366('0x2')](util[_0xe366('0x3')](_0xe366('0x1b'),_0xcd1963[_0xe366('0x5')],_0xcd1963[_0xe366('0x1a')],_0xcd1963[_0xe366('0x1c')]));if(_[_0xe366('0x1d')](_0xcd1963[_0xe366('0x1c')],_0xe366('0x1e'))){_0xcd1963[_0xe366('0x1c')]=_0xcd1963['value']['replace']('.wav49',_0xe366('0x1f'));}if(recordings[_0xcd1963['linkedid']]){var _0x4183b1=_[_0xe366('0x20')](recordings[_0xcd1963[_0xe366('0x17')]][_0xe366('0x21')],{'value':_0xcd1963['value']});if(_[_0xe366('0x14')](_0x4183b1)){recordings[_0xcd1963[_0xe366('0x17')]][_0xe366('0x21')][_0xe366('0x22')]({'value':_0xcd1963[_0xe366('0x1c')]});}}}}catch(_0x167021){utils['error'](util[_0xe366('0x3')](_0xe366('0x23'),_0xcd1963[_0xe366('0x5')]),_0x167021);}};exports['hangup']=function(_0x54a4f3){try{if(!_[_0xe366('0x14')](recordings[_0x54a4f3[_0xe366('0x5')]])){utils['debug'](util['format'](_0xe366('0x24'),_0x54a4f3[_0xe366('0x5')]),_0x54a4f3);utils['info'](util[_0xe366('0x3')]('[%s][recordings][hangup]\x20calleridnum:%s\x20calleridname:%s\x20reason:%s',_0x54a4f3[_0xe366('0x5')],_0x54a4f3[_0xe366('0x25')],_0x54a4f3[_0xe366('0x26')],_0x54a4f3[_0xe366('0x27')]));recordings[_0x54a4f3[_0xe366('0x5')]][_0xe366('0x25')]=_0x54a4f3['calleridnum'];recordings[_0x54a4f3['uniqueid']]['calleridname']=_0x54a4f3[_0xe366('0x26')];recordings[_0x54a4f3[_0xe366('0x5')]][_0xe366('0x28')]=_0x54a4f3[_0xe366('0x28')];recordings[_0x54a4f3[_0xe366('0x5')]][_0xe366('0x29')]=_0x54a4f3['connectedlinename'];if(recordings[_0x54a4f3['uniqueid']]['type']==_0xe366('0x2a')&&recordings[_0x54a4f3[_0xe366('0x5')]][_0xe366('0x6')]){recordings[_0x54a4f3[_0xe366('0x5')]][_0xe366('0x28')]=recordings[_0x54a4f3['uniqueid']][_0xe366('0x6')];recordings[_0x54a4f3[_0xe366('0x5')]]['connectedlinename']='';}recordings[_0x54a4f3['uniqueid']][_0xe366('0x21')]['forEach'](function(_0x1f04d6){var _0x4d90a6=_[_0xe366('0x2b')](recordings[_0x54a4f3[_0xe366('0x5')]]);_0x4d90a6[_0xe366('0x1c')]=_0x1f04d6[_0xe366('0x1c')];writeDB(_0x4d90a6);});delete recordings[_0x54a4f3[_0xe366('0x5')]];}}catch(_0x2f4df4){utils[_0xe366('0x12')](util['format'](_0xe366('0x24'),_0x54a4f3['uniqueid']),_0x2f4df4);}};exports['newexten']=function(_0xa8ec86){try{if(!_[_0xe366('0x14')](recordings[_0xa8ec86[_0xe366('0x5')]])){utils[_0xe366('0xc')](util[_0xe366('0x3')](_0xe366('0x2c'),_0xa8ec86[_0xe366('0x5')]),_0xa8ec86);utils['info'](util[_0xe366('0x3')]('[%s][recordings][newexten]\x20application:%s\x20appdata:%s',_0xa8ec86[_0xe366('0x5')],_0xa8ec86[_0xe366('0x2d')],_0xa8ec86[_0xe366('0x2e')]));if(_0xa8ec86['application']['toLowerCase']()==_0xe366('0x2f')&&_[_0xe366('0x30')](_0xa8ec86[_0xe366('0x2e')]['toLowerCase'](),_0xe366('0x31'))){var _0x4fe7c5=_0xa8ec86[_0xe366('0x2e')][_0xe366('0x32')]('=');var _0x5956bd=_0x4fe7c5[0x0][_0xe366('0x33')](_0x4fe7c5[0x0]['lastIndexOf']('(')+0x1,_0x4fe7c5[0x0][_0xe366('0x34')](')'));var _0x2462be=_0x4fe7c5[0x1];recordings[_0xa8ec86['uniqueid']][_0x5956bd]=_0x2462be;}}}catch(_0x4b0ed2){utils['error'](util['format']('[%s][recordings][newexten]',_0xa8ec86['uniqueid']),_0x4b0ed2);}};exports[_0xe366('0x35')]=function(_0x119a6b){try{if(!_['isNil'](recordings[_0x119a6b[_0xe366('0x5')]])){utils[_0xe366('0xc')](util['format']('[%s][recordings][queuecallerjoin]',_0x119a6b['uniqueid']),_0x119a6b);utils[_0xe366('0x2')](util[_0xe366('0x3')](_0xe366('0x36'),_0x119a6b[_0xe366('0x5')],_0x119a6b[_0xe366('0x37')]));recordings[_0x119a6b[_0xe366('0x5')]][_0xe366('0x37')]=_0x119a6b[_0xe366('0x37')];}}catch(_0x15052b){utils['error'](util['format'](_0xe366('0x38'),_0x119a6b[_0xe366('0x5')]),_0x15052b);}}; \ No newline at end of file +var _0xd9e6=['monitors','push','hangup','[%s][recordings][hangup]','[%s][recordings][hangup]\x20calleridnum:%s\x20calleridname:%s\x20reason:%s','calleridname','cause-txt','calleridnum','connectedlinename','type','connectedlinenum','forEach','clone','newexten','[%s][recordings][newexten]\x20application:%s\x20appdata:%s','appdata','application','toLowerCase','startsWith','cdr','split','substring','lastIndexOf','[%s][recordings][newexten]','queue','util','./utils','info','format','[%s][recordings][writeDB]','uniqueid','getUserByInternal','accountcode','then','membername','name','UserId','request','CreateVoiceRecording','newchannel','debug','[%s][recordings][newchannel]','linkedid','[%s][recordings][newchannel]\x20context:%s\x20exten:%s','exten','context','newstate','channelstate','isNil','[%s][recordings][newstate]\x20linkedid:%s\x20context:%s\x20channel:%s','error','varset','variable','[%s][recordings][varset]','value','.wav49','replace','.WAV'];(function(_0x2b9937,_0x1af035){var _0x1f2f6e=function(_0x938b55){while(--_0x938b55){_0x2b9937['push'](_0x2b9937['shift']());}};_0x1f2f6e(++_0x1af035);}(_0xd9e6,0x13b));var _0x6d9e=function(_0x4d8f20,_0x3d3fdc){_0x4d8f20=_0x4d8f20-0x0;var _0xdc54e5=_0xd9e6[_0x4d8f20];return _0xdc54e5;};'use strict';var _=require('lodash');var util=require(_0x6d9e('0x0'));var utils=require(_0x6d9e('0x1'));var recordings={};function writeDB(_0x43e45e){utils[_0x6d9e('0x2')](util[_0x6d9e('0x3')](_0x6d9e('0x4'),_0x43e45e[_0x6d9e('0x5')]));if(_0x43e45e['accountcode']){utils[_0x6d9e('0x6')](_0x43e45e[_0x6d9e('0x7')])[_0x6d9e('0x8')](function(_0x108da3){if(_0x108da3){_0x43e45e[_0x6d9e('0x9')]=_0x108da3[_0x6d9e('0xa')];_0x43e45e[_0x6d9e('0xb')]=_0x108da3['id'];}utils[_0x6d9e('0xc')]('CreateVoiceRecording',_0x43e45e);});}else{utils['request'](_0x6d9e('0xd'),_0x43e45e);}}exports[_0x6d9e('0xe')]=function(_0x1ee69d){try{utils[_0x6d9e('0xf')](util[_0x6d9e('0x3')](_0x6d9e('0x10'),_0x1ee69d[_0x6d9e('0x5')]),_0x1ee69d);if(_0x1ee69d['uniqueid']==_0x1ee69d[_0x6d9e('0x11')]){utils[_0x6d9e('0x2')](util[_0x6d9e('0x3')](_0x6d9e('0x12'),_0x1ee69d['uniqueid'],_0x1ee69d['context'],_0x1ee69d[_0x6d9e('0x13')]));recordings[_0x1ee69d[_0x6d9e('0x5')]]={'uniqueid':_0x1ee69d['uniqueid'],'accountcode':_0x1ee69d['accountcode'],'exten':_0x1ee69d[_0x6d9e('0x13')],'context':_0x1ee69d[_0x6d9e('0x14')],'channel':_0x1ee69d['channel'],'monitors':[]};}}catch(_0x5820e1){utils['error'](util[_0x6d9e('0x3')](_0x6d9e('0x10'),_0x1ee69d[_0x6d9e('0x5')]),_0x5820e1);}};exports[_0x6d9e('0x15')]=function(_0x2ec0ca){try{utils[_0x6d9e('0xf')](util['format']('[%s][recordings][newstate]',_0x2ec0ca[_0x6d9e('0x5')]),_0x2ec0ca);if(!_['isNil'](recordings[_0x2ec0ca[_0x6d9e('0x5')]])&&_0x2ec0ca[_0x6d9e('0x16')]==0x6){utils['info'](util[_0x6d9e('0x3')]('[%s][recordings][newstate]\x20context:%s\x20channel:%s',_0x2ec0ca[_0x6d9e('0x5')],_0x2ec0ca[_0x6d9e('0x14')],_0x2ec0ca['channel']));}else if(!_[_0x6d9e('0x17')](recordings[_0x2ec0ca['linkedid']])&&_0x2ec0ca[_0x6d9e('0x16')]==0x6&&_0x2ec0ca['context']!='transfer'){utils[_0x6d9e('0x2')](util['format'](_0x6d9e('0x18'),_0x2ec0ca[_0x6d9e('0x5')],_0x2ec0ca[_0x6d9e('0x11')],_0x2ec0ca[_0x6d9e('0x14')],_0x2ec0ca['channel']));recordings[_0x2ec0ca['linkedid']][_0x6d9e('0x7')]=_0x2ec0ca[_0x6d9e('0x7')];}}catch(_0x5842ad){utils[_0x6d9e('0x19')](util['format']('[%s][recordings][newstate]',_0x2ec0ca[_0x6d9e('0x5')]),_0x5842ad);}};exports[_0x6d9e('0x1a')]=function(_0x4a3ac3){try{if(!_[_0x6d9e('0x17')](_0x4a3ac3['variable'])&&!_['isNil'](_0x4a3ac3[_0x6d9e('0x1b')]['mixmonitor_filename'])){utils[_0x6d9e('0xf')](util[_0x6d9e('0x3')](_0x6d9e('0x1c'),_0x4a3ac3['uniqueid']),_0x4a3ac3);utils[_0x6d9e('0x2')](util[_0x6d9e('0x3')]('[%s][recordings][varset]\x20variable:%s\x20value:%s',_0x4a3ac3['uniqueid'],_0x4a3ac3[_0x6d9e('0x1b')],_0x4a3ac3[_0x6d9e('0x1d')]));if(_['endsWith'](_0x4a3ac3['value'],_0x6d9e('0x1e'))){_0x4a3ac3[_0x6d9e('0x1d')]=_0x4a3ac3[_0x6d9e('0x1d')][_0x6d9e('0x1f')](_0x6d9e('0x1e'),_0x6d9e('0x20'));}if(recordings[_0x4a3ac3['linkedid']]){var _0x38ff37=_['find'](recordings[_0x4a3ac3['linkedid']][_0x6d9e('0x21')],{'value':_0x4a3ac3[_0x6d9e('0x1d')]});if(_[_0x6d9e('0x17')](_0x38ff37)){recordings[_0x4a3ac3[_0x6d9e('0x11')]][_0x6d9e('0x21')][_0x6d9e('0x22')]({'value':_0x4a3ac3[_0x6d9e('0x1d')]});}}}}catch(_0x36023b){utils[_0x6d9e('0x19')](util[_0x6d9e('0x3')](_0x6d9e('0x1c'),_0x4a3ac3[_0x6d9e('0x5')]),_0x36023b);}};exports[_0x6d9e('0x23')]=function(_0x45b205){try{if(!_[_0x6d9e('0x17')](recordings[_0x45b205[_0x6d9e('0x5')]])){utils[_0x6d9e('0xf')](util[_0x6d9e('0x3')](_0x6d9e('0x24'),_0x45b205[_0x6d9e('0x5')]),_0x45b205);utils['info'](util['format'](_0x6d9e('0x25'),_0x45b205[_0x6d9e('0x5')],_0x45b205['calleridnum'],_0x45b205[_0x6d9e('0x26')],_0x45b205[_0x6d9e('0x27')]));recordings[_0x45b205[_0x6d9e('0x5')]][_0x6d9e('0x28')]=_0x45b205[_0x6d9e('0x28')];recordings[_0x45b205[_0x6d9e('0x5')]]['calleridname']=_0x45b205[_0x6d9e('0x26')];recordings[_0x45b205[_0x6d9e('0x5')]]['connectedlinenum']=_0x45b205['connectedlinenum'];recordings[_0x45b205[_0x6d9e('0x5')]][_0x6d9e('0x29')]=_0x45b205[_0x6d9e('0x29')];if(recordings[_0x45b205[_0x6d9e('0x5')]][_0x6d9e('0x2a')]=='outbound'&&recordings[_0x45b205[_0x6d9e('0x5')]]['accountcode']){recordings[_0x45b205[_0x6d9e('0x5')]][_0x6d9e('0x2b')]=recordings[_0x45b205[_0x6d9e('0x5')]][_0x6d9e('0x7')];recordings[_0x45b205['uniqueid']][_0x6d9e('0x29')]='';}recordings[_0x45b205[_0x6d9e('0x5')]][_0x6d9e('0x21')][_0x6d9e('0x2c')](function(_0x44c839){var _0x4dbf8d=_[_0x6d9e('0x2d')](recordings[_0x45b205[_0x6d9e('0x5')]]);_0x4dbf8d[_0x6d9e('0x1d')]=_0x44c839[_0x6d9e('0x1d')];writeDB(_0x4dbf8d);});delete recordings[_0x45b205[_0x6d9e('0x5')]];}}catch(_0x50a087){utils[_0x6d9e('0x19')](util[_0x6d9e('0x3')]('[%s][recordings][hangup]',_0x45b205[_0x6d9e('0x5')]),_0x50a087);}};exports[_0x6d9e('0x2e')]=function(_0x3b90e6){try{if(!_['isNil'](recordings[_0x3b90e6[_0x6d9e('0x5')]])){utils['debug'](util[_0x6d9e('0x3')]('[%s][recordings][newexten]',_0x3b90e6[_0x6d9e('0x5')]),_0x3b90e6);utils[_0x6d9e('0x2')](util[_0x6d9e('0x3')](_0x6d9e('0x2f'),_0x3b90e6[_0x6d9e('0x5')],_0x3b90e6['application'],_0x3b90e6[_0x6d9e('0x30')]));if(_0x3b90e6[_0x6d9e('0x31')][_0x6d9e('0x32')]()=='set'&&_[_0x6d9e('0x33')](_0x3b90e6[_0x6d9e('0x30')][_0x6d9e('0x32')](),_0x6d9e('0x34'))){var _0x51fc82=_0x3b90e6[_0x6d9e('0x30')][_0x6d9e('0x35')]('=');var _0x375f6b=_0x51fc82[0x0][_0x6d9e('0x36')](_0x51fc82[0x0][_0x6d9e('0x37')]('(')+0x1,_0x51fc82[0x0][_0x6d9e('0x37')](')'));var _0x2c16cb=_0x51fc82[0x1];recordings[_0x3b90e6[_0x6d9e('0x5')]][_0x375f6b]=_0x2c16cb;}}}catch(_0x384b12){utils[_0x6d9e('0x19')](util['format'](_0x6d9e('0x38'),_0x3b90e6[_0x6d9e('0x5')]),_0x384b12);}};exports['queuecallerjoin']=function(_0x4b059b){try{if(!_[_0x6d9e('0x17')](recordings[_0x4b059b[_0x6d9e('0x5')]])){utils[_0x6d9e('0xf')](util[_0x6d9e('0x3')]('[%s][recordings][queuecallerjoin]',_0x4b059b[_0x6d9e('0x5')]),_0x4b059b);utils[_0x6d9e('0x2')](util[_0x6d9e('0x3')]('[%s][recordings][queuecallerjoin]\x20queue:%s',_0x4b059b['uniqueid'],_0x4b059b['queue']));recordings[_0x4b059b[_0x6d9e('0x5')]][_0x6d9e('0x39')]=_0x4b059b[_0x6d9e('0x39')];}}catch(_0xe6474){utils[_0x6d9e('0x19')](util['format']('[%s][recordings][queuecallerjoin]',_0x4b059b['uniqueid']),_0xe6474);}}; \ No newline at end of file diff --git a/server/services/xdr/transfers.controller.js b/server/services/xdr/transfers.controller.js index 9880f36..d071542 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 _0x4066=['transfertargetcalleridnum','transfertargetcalleridname','assign','origtransfererchannel','secondtransfererconnectedlinenum','secondtransfererconnectedlinename','origtransfereraccountcode','secondtransferercontext','origtransfererlinkedid','origtransferercontext','origtransfererexten','isNil','transfertargetchannel','transfertargetconnectedlinenum','transfertargetcontext','transfertargetexten','transfertargetlinkedid','lodash','./utils','info','format','type','attended','origtransfereruniqueid','CreateVoiceTransferReport','blindtransfer','debug','[%s][transfers][blindtransfer]','uniqueid','transferercalleridnum','transferercalleridname','transfereecalleridnum','transfereecalleridname','error','attendedtransfer','[%s][transfers][attendedtransfer]','origtransferercalleridnum','origtransferercalleridname'];(function(_0xd5709b,_0x101823){var _0x3dc484=function(_0x28a409){while(--_0x28a409){_0xd5709b['push'](_0xd5709b['shift']());}};_0x3dc484(++_0x101823);}(_0x4066,0x1b3));var _0x6406=function(_0x17d9e3,_0x1f969c){_0x17d9e3=_0x17d9e3-0x0;var _0x14192d=_0x4066[_0x17d9e3];return _0x14192d;};'use strict';var _=require(_0x6406('0x0'));var util=require('util');var utils=require(_0x6406('0x1'));function writeDB(_0x5dcf9d){utils[_0x6406('0x2')](util[_0x6406('0x3')]('[%s][transfers][writeDB]\x20type:%s',_0x5dcf9d[_0x6406('0x4')]===_0x6406('0x5')?_0x5dcf9d[_0x6406('0x6')]:_0x5dcf9d['uniqueid'],_0x5dcf9d[_0x6406('0x4')]));utils['request'](_0x6406('0x7'),_0x5dcf9d);}exports[_0x6406('0x8')]=function(_0x3e4d1f){try{utils[_0x6406('0x9')](util[_0x6406('0x3')](_0x6406('0xa'),_0x3e4d1f[_0x6406('0xb')]),_0x3e4d1f);utils[_0x6406('0x2')](util['format']('[%s][transfers][blindtransfer]\x20transferercalleridnum:%s\x20transferercalleridname:%s\x20transfereecalleridnum:%s\x20transfereecalleridname:%s',_0x3e4d1f['uniqueid'],_0x3e4d1f[_0x6406('0xc')],_0x3e4d1f[_0x6406('0xd')],_0x3e4d1f[_0x6406('0xe')],_0x3e4d1f[_0x6406('0xf')]));_0x3e4d1f[_0x6406('0x4')]='blind';writeDB(_0x3e4d1f);}catch(_0x5689a0){utils[_0x6406('0x10')](util['format'](_0x6406('0xa'),_0x3e4d1f[_0x6406('0xb')]),_0x5689a0);}};exports[_0x6406('0x11')]=function(_0xb94d02){try{utils[_0x6406('0x9')](util[_0x6406('0x3')](_0x6406('0x12'),_0xb94d02[_0x6406('0x6')]),_0xb94d02);utils['info'](util[_0x6406('0x3')]('[%s][transfers][attendedtransfer]\x20transferercalleridnum:%s\x20transferercalleridname:%s\x20transfereecalleridnum:%s\x20transfereecalleridname:%s',_0xb94d02[_0x6406('0x6')],_0xb94d02[_0x6406('0x13')],_0xb94d02[_0x6406('0x14')],_0xb94d02[_0x6406('0x15')],_0xb94d02[_0x6406('0x16')]));_0xb94d02=_[_0x6406('0x17')](_0xb94d02,{'transfererchannel':_0xb94d02[_0x6406('0x18')],'transferercalleridnum':_0xb94d02[_0x6406('0x13')],'transferercalleridname':_0xb94d02['origtransferercalleridname'],'transfererconnectedlinenum':_0xb94d02[_0x6406('0x19')],'transfererconnectedlinename':_0xb94d02[_0x6406('0x1a')],'transfereraccountcode':_0xb94d02[_0x6406('0x1b')],'transferercontext':_0xb94d02[_0x6406('0x1c')],'transfererexten':_0xb94d02['secondtransfererexten'],'transfererlinkedid':_0xb94d02[_0x6406('0x1d')],'context':_0xb94d02[_0x6406('0x1e')],'extension':_0xb94d02[_0x6406('0x1f')],'type':'attended'});if(_[_0x6406('0x20')](_0xb94d02['transfereechannel'])){_0xb94d02=_[_0x6406('0x17')](_0xb94d02,{'transfereechannel':_0xb94d02[_0x6406('0x21')],'transfereecalleridnum':_0xb94d02[_0x6406('0x15')],'transfereecalleridname':_0xb94d02['transfertargetcalleridname'],'transfereeconnectedlinenum':_0xb94d02[_0x6406('0x22')],'transfereeconnectedlinename':_0xb94d02['transfertargetconnectedlinename'],'transfereeaccountcode':_0xb94d02['transfertargetaccountcode'],'transfereecontext':_0xb94d02[_0x6406('0x23')],'transfereeexten':_0xb94d02[_0x6406('0x24')],'transfereelinkedid':_0xb94d02[_0x6406('0x25')]});}writeDB(_0xb94d02);}catch(_0x275cd0){utils[_0x6406('0x10')](util['format'](_0x6406('0x12'),_0xb94d02[_0x6406('0x6')]),_0x275cd0);}}; \ No newline at end of file +var _0x48eb=['CreateVoiceTransferReport','blindtransfer','debug','[%s][transfers][blindtransfer]','uniqueid','[%s][transfers][blindtransfer]\x20transferercalleridnum:%s\x20transferercalleridname:%s\x20transfereecalleridnum:%s\x20transfereecalleridname:%s','transferercalleridnum','transferercalleridname','transfereecalleridnum','transfereecalleridname','error','attendedtransfer','[%s][transfers][attendedtransfer]','[%s][transfers][attendedtransfer]\x20transferercalleridnum:%s\x20transferercalleridname:%s\x20transfereecalleridnum:%s\x20transfereecalleridname:%s','origtransferercalleridnum','origtransferercalleridname','transfertargetcalleridnum','transfertargetcalleridname','secondtransfererconnectedlinenum','secondtransfererconnectedlinename','origtransfereraccountcode','secondtransferercontext','origtransferercontext','origtransfererexten','isNil','transfereechannel','assign','transfertargetchannel','transfertargetconnectedlinenum','transfertargetconnectedlinename','transfertargetlinkedid','lodash','util','info','format','[%s][transfers][writeDB]\x20type:%s','type','attended','origtransfereruniqueid'];(function(_0x146e89,_0x4738ee){var _0x2075b1=function(_0x40aff8){while(--_0x40aff8){_0x146e89['push'](_0x146e89['shift']());}};_0x2075b1(++_0x4738ee);}(_0x48eb,0x1f3));var _0xb48e=function(_0x4ea1f2,_0x2ac883){_0x4ea1f2=_0x4ea1f2-0x0;var _0x4d8688=_0x48eb[_0x4ea1f2];return _0x4d8688;};'use strict';var _=require(_0xb48e('0x0'));var util=require(_0xb48e('0x1'));var utils=require('./utils');function writeDB(_0x4ce4a5){utils[_0xb48e('0x2')](util[_0xb48e('0x3')](_0xb48e('0x4'),_0x4ce4a5[_0xb48e('0x5')]===_0xb48e('0x6')?_0x4ce4a5[_0xb48e('0x7')]:_0x4ce4a5['uniqueid'],_0x4ce4a5[_0xb48e('0x5')]));utils['request'](_0xb48e('0x8'),_0x4ce4a5);}exports[_0xb48e('0x9')]=function(_0x12f7f8){try{utils[_0xb48e('0xa')](util[_0xb48e('0x3')](_0xb48e('0xb'),_0x12f7f8[_0xb48e('0xc')]),_0x12f7f8);utils[_0xb48e('0x2')](util[_0xb48e('0x3')](_0xb48e('0xd'),_0x12f7f8[_0xb48e('0xc')],_0x12f7f8[_0xb48e('0xe')],_0x12f7f8[_0xb48e('0xf')],_0x12f7f8[_0xb48e('0x10')],_0x12f7f8[_0xb48e('0x11')]));_0x12f7f8[_0xb48e('0x5')]='blind';writeDB(_0x12f7f8);}catch(_0x5484b2){utils[_0xb48e('0x12')](util['format']('[%s][transfers][blindtransfer]',_0x12f7f8['uniqueid']),_0x5484b2);}};exports[_0xb48e('0x13')]=function(_0x13b511){try{utils[_0xb48e('0xa')](util['format'](_0xb48e('0x14'),_0x13b511[_0xb48e('0x7')]),_0x13b511);utils[_0xb48e('0x2')](util[_0xb48e('0x3')](_0xb48e('0x15'),_0x13b511[_0xb48e('0x7')],_0x13b511[_0xb48e('0x16')],_0x13b511[_0xb48e('0x17')],_0x13b511[_0xb48e('0x18')],_0x13b511[_0xb48e('0x19')]));_0x13b511=_['assign'](_0x13b511,{'transfererchannel':_0x13b511['origtransfererchannel'],'transferercalleridnum':_0x13b511[_0xb48e('0x16')],'transferercalleridname':_0x13b511[_0xb48e('0x17')],'transfererconnectedlinenum':_0x13b511[_0xb48e('0x1a')],'transfererconnectedlinename':_0x13b511[_0xb48e('0x1b')],'transfereraccountcode':_0x13b511[_0xb48e('0x1c')],'transferercontext':_0x13b511[_0xb48e('0x1d')],'transfererexten':_0x13b511['secondtransfererexten'],'transfererlinkedid':_0x13b511['origtransfererlinkedid'],'context':_0x13b511[_0xb48e('0x1e')],'extension':_0x13b511[_0xb48e('0x1f')],'type':'attended'});if(_[_0xb48e('0x20')](_0x13b511[_0xb48e('0x21')])){_0x13b511=_[_0xb48e('0x22')](_0x13b511,{'transfereechannel':_0x13b511[_0xb48e('0x23')],'transfereecalleridnum':_0x13b511[_0xb48e('0x18')],'transfereecalleridname':_0x13b511[_0xb48e('0x19')],'transfereeconnectedlinenum':_0x13b511[_0xb48e('0x24')],'transfereeconnectedlinename':_0x13b511[_0xb48e('0x25')],'transfereeaccountcode':_0x13b511['transfertargetaccountcode'],'transfereecontext':_0x13b511['transfertargetcontext'],'transfereeexten':_0x13b511['transfertargetexten'],'transfereelinkedid':_0x13b511[_0xb48e('0x26')]});}writeDB(_0x13b511);}catch(_0x4c8fa2){utils[_0xb48e('0x12')](util['format']('[%s][transfers][attendedtransfer]',_0x13b511[_0xb48e('0x7')]),_0x4c8fa2);}}; \ No newline at end of file diff --git a/server/services/xdr/utils.js b/server/services/xdr/utils.js index 00f6a49..7a1248c 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 _0x9f7a=['info','[utils][getUserByInternal]\x20internal:%s\x20%s','found','[utils][getUserByInternal]','[utils][getUserByInterface]\x20interface:%s\x20%s','getUserByName','[utils][getUserByName]\x20name:%s\x20%s','notfound','[utils][getUserByName]','GetVoiceQueue','type','acw','[utils][getVoiceQueueByName]\x20name:%s','[utils][getVoiceQueueByName]','addTime','add','seconds','YYYY-MM-DD\x20HH:mm:ss','subtractTime','format','diffTime','diff','sumTime','now','isAfter','isBefore','bluebird','jayson/promise','moment','util','http','debug','inspect','error','request','then','[utils][request]\x20name:%s','catch','name','[utils][getUser]\x20where:%s','result','length','getUserByInternal'];(function(_0x2b01d1,_0x1aa3ce){var _0x37ea8a=function(_0xe9aa9){while(--_0xe9aa9){_0x2b01d1['push'](_0x2b01d1['shift']());}};_0x37ea8a(++_0x1aa3ce);}(_0x9f7a,0xf1));var _0xa9f7=function(_0x468b0f,_0x408566){_0x468b0f=_0x468b0f-0x0;var _0x3e74d9=_0x9f7a[_0x468b0f];return _0x3e74d9;};'use strict';var BPromise=require(_0xa9f7('0x0'));var jayson=require(_0xa9f7('0x1'));var moment=require(_0xa9f7('0x2'));var util=require(_0xa9f7('0x3'));var client=jayson['client'][_0xa9f7('0x4')]({'port':0x2329});var logger=require('../../config/logger')('xdr');exports['info']=function(_0x22dbdd,_0x44545d){logger['info'](_0x22dbdd,_0x44545d?util['inspect'](_0x44545d,{'showHidden':![],'depth':null}):'');};exports[_0xa9f7('0x5')]=function(_0x5497c8,_0x48e791){logger['debug'](_0x5497c8,_0x48e791?util[_0xa9f7('0x6')](_0x48e791,{'showHidden':![],'depth':null}):'');};exports['error']=function(_0x433d03,_0x1f2f1d){logger[_0xa9f7('0x7')](_0x433d03,_0x1f2f1d?util['inspect'](_0x1f2f1d,{'showHidden':![],'depth':null}):'');};exports[_0xa9f7('0x8')]=function(_0xdda0e0,_0x4d9b2a){return client[_0xa9f7('0x8')](_0xdda0e0,{'body':_0x4d9b2a})[_0xa9f7('0x9')](function(_0x148b68){logger[_0xa9f7('0x5')](_0xa9f7('0xa'),_0xdda0e0,_0x148b68?util[_0xa9f7('0x6')](_0x148b68,{'showHidden':![],'depth':null}):'');})[_0xa9f7('0xb')](function(_0x52e4d4){logger[_0xa9f7('0x7')]('[utils][request]\x20name:%s',_0xdda0e0,_0x52e4d4?util[_0xa9f7('0x6')](_0x52e4d4,{'showHidden':![],'depth':null}):'');});};function getUser(_0x437a83){return client[_0xa9f7('0x8')]('GetUser',{'options':{'raw':!![],'attributes':['id','internal',_0xa9f7('0xc'),'interface'],'where':_0x437a83,'limit':0x1}})['then'](function(_0x188f8a){logger[_0xa9f7('0x5')](_0xa9f7('0xd'),JSON['stringify'](_0x437a83),_0x188f8a?util[_0xa9f7('0x6')](_0x188f8a,{'showHidden':![],'depth':null}):'');return _0x188f8a[_0xa9f7('0xe')][_0xa9f7('0xf')]?_0x188f8a['result'][0x0]:null;});}exports[_0xa9f7('0x10')]=function(_0x1a1a13){return new BPromise(function(_0x230904,_0x11652b){if(_0x1a1a13){return getUser({'internal':_0x1a1a13})[_0xa9f7('0x9')](function(_0xf01914){logger[_0xa9f7('0x11')](_0xa9f7('0x12'),_0x1a1a13,_0xf01914?_0xa9f7('0x13'):'notfound');return _0x230904(_0xf01914);})[_0xa9f7('0xb')](function(_0x36cfbe){logger[_0xa9f7('0x7')](_0xa9f7('0x14'),_0x36cfbe?util[_0xa9f7('0x6')](_0x36cfbe,{'showHidden':![],'depth':null}):'');return _0x230904(null);});}return _0x230904(null);});};exports['getUserByInterface']=function(_0x4a27de){return new BPromise(function(_0x5ccc53,_0x50b73c){if(_0x4a27de){return getUser({'interface':_0x4a27de})['then'](function(_0x4b7202){logger['info'](_0xa9f7('0x15'),_0x4a27de,_0x4b7202?'found':'notfound');return _0x5ccc53(_0x4b7202);})[_0xa9f7('0xb')](function(_0x530992){logger['error']('[utils][getUserByInterface]',_0x530992?util[_0xa9f7('0x6')](_0x530992,{'showHidden':![],'depth':null}):'');return _0x5ccc53(null);});}return _0x5ccc53(null);});};exports[_0xa9f7('0x16')]=function(_0x204cdb){return new BPromise(function(_0x537d55,_0x131872){if(_0x204cdb){return getUser({'name':_0x204cdb})[_0xa9f7('0x9')](function(_0x42d6b4){logger['info'](_0xa9f7('0x17'),_0x204cdb,_0x42d6b4?'found':_0xa9f7('0x18'));return _0x537d55(_0x42d6b4);})['catch'](function(_0x1bf651){logger[_0xa9f7('0x7')](_0xa9f7('0x19'),_0x1bf651?util[_0xa9f7('0x6')](_0x1bf651,{'showHidden':![],'depth':null}):'');return _0x537d55(null);});}return _0x537d55(null);});};exports['getVoiceQueueByName']=function(_0x41530a){return new BPromise(function(_0x249604,_0x16437e){if(_0x41530a){return client[_0xa9f7('0x8')](_0xa9f7('0x1a'),{'options':{'raw':!![],'attributes':['id',_0xa9f7('0xc'),_0xa9f7('0x1b'),_0xa9f7('0x1c'),'acwTimeout'],'where':{'name':_0x41530a},'limit':0x1}})['then'](function(_0x519aea){logger[_0xa9f7('0x5')](_0xa9f7('0x1d'),_0x41530a,_0x519aea?util['inspect'](_0x519aea,{'showHidden':![],'depth':null}):'');logger[_0xa9f7('0x11')]('[utils][getVoiceQueueByName]\x20name:%s\x20%s',_0x41530a,_0x519aea?'found':'notfound');return _0x249604(_0x519aea[_0xa9f7('0xe')]['length']?_0x519aea[_0xa9f7('0xe')][0x0]:null);})[_0xa9f7('0xb')](function(_0x2058c5){logger[_0xa9f7('0x7')](_0xa9f7('0x1e'),_0x2058c5?util['inspect'](_0x2058c5,{'showHidden':![],'depth':null}):'');return _0x249604(null);});}return _0x249604(null);});};exports[_0xa9f7('0x1f')]=function(_0x1aabcd,_0x484e51){return moment(_0x1aabcd)[_0xa9f7('0x20')](_0x484e51,_0xa9f7('0x21'))['format'](_0xa9f7('0x22'));};exports[_0xa9f7('0x23')]=function(_0x10a856,_0x55f85f){return moment(_0x10a856)['subtract'](_0x55f85f,_0xa9f7('0x21'))[_0xa9f7('0x24')](_0xa9f7('0x22'));};exports[_0xa9f7('0x25')]=function(_0xdeeec2,_0x5df4d6){return moment(_0xdeeec2)[_0xa9f7('0x26')](moment(_0x5df4d6),_0xa9f7('0x21'));};exports[_0xa9f7('0x27')]=function(_0x5c9bef,_0x563619){return parseInt(_0x5c9bef,0xa)+parseInt(_0x563619,0xa);};exports[_0xa9f7('0x28')]=function(){return moment()['format'](_0xa9f7('0x22'));};exports[_0xa9f7('0x29')]=function(_0x2020a1,_0x30c089){if(_0x30c089){return moment(_0x2020a1)['isAfter'](_0x30c089);}return!![];};exports[_0xa9f7('0x2a')]=function(_0x31982d,_0x3b310e){if(_0x3b310e){return moment(_0x31982d)[_0xa9f7('0x2a')](_0x3b310e);}else if(_0x31982d){return!![];}return![];}; \ No newline at end of file +var _0xf898=['sumTime','now','isAfter','isBefore','bluebird','jayson/promise','util','client','http','../../config/logger','info','inspect','debug','error','request','then','catch','[utils][request]\x20name:%s','GetUser','internal','interface','stringify','result','length','[utils][getUserByInternal]\x20internal:%s\x20%s','notfound','getUserByInterface','found','getUserByName','[utils][getUserByName]\x20name:%s\x20%s','getVoiceQueueByName','GetVoiceQueue','name','type','acw','acwTimeout','[utils][getVoiceQueueByName]\x20name:%s','[utils][getVoiceQueueByName]','addTime','add','format','YYYY-MM-DD\x20HH:mm:ss','subtractTime','subtract','seconds','diffTime','diff'];(function(_0x1d6612,_0x4a828f){var _0x1e16b7=function(_0x5d487a){while(--_0x5d487a){_0x1d6612['push'](_0x1d6612['shift']());}};_0x1e16b7(++_0x4a828f);}(_0xf898,0x14d));var _0x8f89=function(_0x1dc32e,_0x2ee90e){_0x1dc32e=_0x1dc32e-0x0;var _0x2148e5=_0xf898[_0x1dc32e];return _0x2148e5;};'use strict';var BPromise=require(_0x8f89('0x0'));var jayson=require(_0x8f89('0x1'));var moment=require('moment');var util=require(_0x8f89('0x2'));var client=jayson[_0x8f89('0x3')][_0x8f89('0x4')]({'port':0x2329});var logger=require(_0x8f89('0x5'))('xdr');exports['info']=function(_0x4bd395,_0xae7b92){logger[_0x8f89('0x6')](_0x4bd395,_0xae7b92?util[_0x8f89('0x7')](_0xae7b92,{'showHidden':![],'depth':null}):'');};exports[_0x8f89('0x8')]=function(_0x473667,_0x500344){logger['debug'](_0x473667,_0x500344?util['inspect'](_0x500344,{'showHidden':![],'depth':null}):'');};exports[_0x8f89('0x9')]=function(_0x565972,_0x10a951){logger['error'](_0x565972,_0x10a951?util[_0x8f89('0x7')](_0x10a951,{'showHidden':![],'depth':null}):'');};exports['request']=function(_0x3084fd,_0x3ec5de){return client[_0x8f89('0xa')](_0x3084fd,{'body':_0x3ec5de})[_0x8f89('0xb')](function(_0x3c99f2){logger['debug']('[utils][request]\x20name:%s',_0x3084fd,_0x3c99f2?util[_0x8f89('0x7')](_0x3c99f2,{'showHidden':![],'depth':null}):'');})[_0x8f89('0xc')](function(_0x37f6bf){logger[_0x8f89('0x9')](_0x8f89('0xd'),_0x3084fd,_0x37f6bf?util['inspect'](_0x37f6bf,{'showHidden':![],'depth':null}):'');});};function getUser(_0x50a887){return client[_0x8f89('0xa')](_0x8f89('0xe'),{'options':{'raw':!![],'attributes':['id',_0x8f89('0xf'),'name',_0x8f89('0x10')],'where':_0x50a887,'limit':0x1}})[_0x8f89('0xb')](function(_0x49cce2){logger[_0x8f89('0x8')]('[utils][getUser]\x20where:%s',JSON[_0x8f89('0x11')](_0x50a887),_0x49cce2?util[_0x8f89('0x7')](_0x49cce2,{'showHidden':![],'depth':null}):'');return _0x49cce2[_0x8f89('0x12')][_0x8f89('0x13')]?_0x49cce2[_0x8f89('0x12')][0x0]:null;});}exports['getUserByInternal']=function(_0x592e56){return new BPromise(function(_0x62d2b3,_0x193150){if(_0x592e56){return getUser({'internal':_0x592e56})['then'](function(_0x7996c9){logger[_0x8f89('0x6')](_0x8f89('0x14'),_0x592e56,_0x7996c9?'found':_0x8f89('0x15'));return _0x62d2b3(_0x7996c9);})[_0x8f89('0xc')](function(_0x1cf96f){logger[_0x8f89('0x9')]('[utils][getUserByInternal]',_0x1cf96f?util[_0x8f89('0x7')](_0x1cf96f,{'showHidden':![],'depth':null}):'');return _0x62d2b3(null);});}return _0x62d2b3(null);});};exports[_0x8f89('0x16')]=function(_0x5cca2c){return new BPromise(function(_0x5a39e8,_0x30c885){if(_0x5cca2c){return getUser({'interface':_0x5cca2c})['then'](function(_0x53bf21){logger[_0x8f89('0x6')]('[utils][getUserByInterface]\x20interface:%s\x20%s',_0x5cca2c,_0x53bf21?_0x8f89('0x17'):_0x8f89('0x15'));return _0x5a39e8(_0x53bf21);})[_0x8f89('0xc')](function(_0x2958e0){logger[_0x8f89('0x9')]('[utils][getUserByInterface]',_0x2958e0?util[_0x8f89('0x7')](_0x2958e0,{'showHidden':![],'depth':null}):'');return _0x5a39e8(null);});}return _0x5a39e8(null);});};exports[_0x8f89('0x18')]=function(_0x1540f0){return new BPromise(function(_0x51ff17,_0x3c2923){if(_0x1540f0){return getUser({'name':_0x1540f0})[_0x8f89('0xb')](function(_0x30ef0f){logger[_0x8f89('0x6')](_0x8f89('0x19'),_0x1540f0,_0x30ef0f?_0x8f89('0x17'):_0x8f89('0x15'));return _0x51ff17(_0x30ef0f);})['catch'](function(_0x2ba377){logger[_0x8f89('0x9')]('[utils][getUserByName]',_0x2ba377?util[_0x8f89('0x7')](_0x2ba377,{'showHidden':![],'depth':null}):'');return _0x51ff17(null);});}return _0x51ff17(null);});};exports[_0x8f89('0x1a')]=function(_0x5b3e4c){return new BPromise(function(_0x29e542,_0x342647){if(_0x5b3e4c){return client['request'](_0x8f89('0x1b'),{'options':{'raw':!![],'attributes':['id',_0x8f89('0x1c'),_0x8f89('0x1d'),_0x8f89('0x1e'),_0x8f89('0x1f')],'where':{'name':_0x5b3e4c},'limit':0x1}})['then'](function(_0x1fde99){logger[_0x8f89('0x8')](_0x8f89('0x20'),_0x5b3e4c,_0x1fde99?util[_0x8f89('0x7')](_0x1fde99,{'showHidden':![],'depth':null}):'');logger['info']('[utils][getVoiceQueueByName]\x20name:%s\x20%s',_0x5b3e4c,_0x1fde99?_0x8f89('0x17'):_0x8f89('0x15'));return _0x29e542(_0x1fde99[_0x8f89('0x12')]['length']?_0x1fde99[_0x8f89('0x12')][0x0]:null);})[_0x8f89('0xc')](function(_0x8b4fd8){logger[_0x8f89('0x9')](_0x8f89('0x21'),_0x8b4fd8?util[_0x8f89('0x7')](_0x8b4fd8,{'showHidden':![],'depth':null}):'');return _0x29e542(null);});}return _0x29e542(null);});};exports[_0x8f89('0x22')]=function(_0x33c0d2,_0x20318d){return moment(_0x33c0d2)[_0x8f89('0x23')](_0x20318d,'seconds')[_0x8f89('0x24')](_0x8f89('0x25'));};exports[_0x8f89('0x26')]=function(_0x4a87ae,_0x481d05){return moment(_0x4a87ae)[_0x8f89('0x27')](_0x481d05,_0x8f89('0x28'))[_0x8f89('0x24')](_0x8f89('0x25'));};exports[_0x8f89('0x29')]=function(_0x34c6ba,_0x4fa6ac){return moment(_0x34c6ba)[_0x8f89('0x2a')](moment(_0x4fa6ac),'seconds');};exports[_0x8f89('0x2b')]=function(_0x314422,_0x5f39f9){return parseInt(_0x314422,0xa)+parseInt(_0x5f39f9,0xa);};exports[_0x8f89('0x2c')]=function(){return moment()[_0x8f89('0x24')](_0x8f89('0x25'));};exports[_0x8f89('0x2d')]=function(_0x5ea0ff,_0x134ad5){if(_0x134ad5){return moment(_0x5ea0ff)[_0x8f89('0x2d')](_0x134ad5);}return!![];};exports['isBefore']=function(_0x5e1d64,_0x514af6){if(_0x514af6){return moment(_0x5e1d64)[_0x8f89('0x2e')](_0x514af6);}else if(_0x5e1d64){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 a560d43..b7f196d 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 _0x393c=['other','agent_name','test','setupLoggers','fs-extra','util','./loggers','./safe-template','safeTemplate','./mask-sensitive-data','maskSensitiveData','join','/var','xcally','name','client','log','user','then','no-user','data','timestamp','catch','error','api','client-side-logger','use','logger','%s\x20%s\x20%s\x20%s\x20%sms\x20id=%s\x20name=%s\x20role=%s','isEmpty','body','\x20body=%s','format','x-forwarded-for','headers','connection','remoteAddress','url','statusCode','responseTime','role','inspect','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)','method'];(function(_0x10c88f,_0x2fa04e){var _0x5b92f3=function(_0x3bdd6a){while(--_0x3bdd6a){_0x10c88f['push'](_0x10c88f['shift']());}};_0x5b92f3(++_0x2fa04e);}(_0x393c,0x146));var _0xc393=function(_0x448bdd,_0x542303){_0x448bdd=_0x448bdd-0x0;var _0xc416c8=_0x393c[_0x448bdd];return _0xc416c8;};var fs=require(_0xc393('0x0'));var _=require('lodash');var ewinston=require('express-winston');var path=require('path');var util=require(_0xc393('0x1'));var fileLogger=require(_0xc393('0x2'))['fileLogger'];var safeTemplate=require(_0xc393('0x3'))[_0xc393('0x4')];var maskSensitiveData=require(_0xc393('0x5'))[_0xc393('0x6')];function ClientSideLogger(){function _0x4bc269(_0x26af50){var _0x1a5f9c=path[_0xc393('0x7')](_0xc393('0x8'),'log',_0xc393('0x9'));var _0x3346b4=path[_0xc393('0x7')]('client',_0x26af50['role']+'-'+_0x26af50[_0xc393('0xa')]);return fs['ensureDir'](path[_0xc393('0x7')](_0x1a5f9c,_0x3346b4))['then'](function(){var _0x24cc54=fileLogger(_0xc393('0xb'),path['join'](_0x1a5f9c,_0x3346b4));return _0x24cc54;})['catch'](function(_0x10c042){throw _0x10c042;});}this[_0xc393('0xc')]=function(_0x1c12b6,_0xe8672f,_0x49d6f0,_0x43dca0){return _0x4bc269(_0x1c12b6[_0xc393('0xd')])[_0xc393('0xe')](function(_0x19f819){var _0x29b628=_0x19f819[_0xe8672f];return _0x29b628;})[_0xc393('0xe')](function(_0x79d98){var _0x1d60dd=_0x1c12b6['user']?_0x1c12b6[_0xc393('0xd')]['id']:_0xc393('0xf');var _0x27124e=_0x43dca0[_0xc393('0x10')];var _0x5c86a4=_0x43dca0[_0xc393('0x11')];var _0x27ff25=new Date(Number(_0x5c86a4));return _0x79d98(_0x1d60dd,_0x27ff25,_0x49d6f0,_0x27124e);})[_0xc393('0x12')](function(_0x128901){fileLogger(_0xc393('0xb'))[_0xc393('0x13')](_0x128901);});};}function setupLoggers(_0x22e0cb){return new Promise(function(_0xea2a4f){var _0x5e04b6=new ClientSideLogger();var _0x4bc549=fileLogger(_0xc393('0x14'));var _0x19c5ec=fileLogger('auth');_0x22e0cb['set'](_0xc393('0x15'),_0x5e04b6);_0x22e0cb[_0xc393('0x16')](ewinston[_0xc393('0x17')]({'winstonInstance':_0x4bc549,'meta':![],'statusLevels':!![],'msg':function(_0x151886,_0x396dcc){var _0x12cd3a=_0xc393('0x18');if(!_[_0xc393('0x19')](_0x151886[_0xc393('0x1a')])){_0x12cd3a+=_0xc393('0x1b');var _0x1cee0c=_0x151886[_0xc393('0x1a')];maskSensitiveData(_0x1cee0c);}return safeTemplate(util[_0xc393('0x1c')](_0x12cd3a,_0x151886['method'],_0x151886['headers'][_0xc393('0x1d')]?_0x151886[_0xc393('0x1e')][_0xc393('0x1d')]:_0x151886[_0xc393('0x1f')][_0xc393('0x20')]||_0x151886['ip'],_0x151886[_0xc393('0x21')],_0x396dcc[_0xc393('0x22')],_0x396dcc[_0xc393('0x23')],_0x151886[_0xc393('0xd')]?_0x151886['user']['id']:null,_0x151886[_0xc393('0xd')]?_0x151886['user'][_0xc393('0xa')]:null,_0x151886[_0xc393('0xd')]?_0x151886[_0xc393('0xd')][_0xc393('0x24')]:null,_0x1cee0c?util[_0xc393('0x25')](_0x1cee0c,![],null):''));}}));_0x22e0cb[_0xc393('0x16')](ewinston[_0xc393('0x17')]({'winstonInstance':_0x19c5ec,'meta':![],'statusLevels':!![],'msg':function(_0x3966c7,_0x197694){var _0x88e3e2='%s\x20%s\x20%s\x20%s\x20%sms\x20id=%s\x20name=%s\x20role=%s\x20device=%s';if(_0x3966c7[_0xc393('0x1a')]&&_0x3966c7[_0xc393('0x1a')][_0xc393('0x26')]&&_0x3966c7[_0xc393('0x1a')][_0xc393('0x27')]){_0x88e3e2=_0xc393('0x28');}return util[_0xc393('0x1c')](_0x88e3e2,_0x3966c7[_0xc393('0x29')],_0x3966c7[_0xc393('0x1e')][_0xc393('0x1d')]?_0x3966c7[_0xc393('0x1e')][_0xc393('0x1d')]:_0x3966c7[_0xc393('0x1f')][_0xc393('0x20')]||_0x3966c7['ip'],_0x3966c7['url'],_0x197694[_0xc393('0x22')],_0x197694[_0xc393('0x23')],_0x3966c7[_0xc393('0xd')]?_0x3966c7[_0xc393('0xd')]['id']:null,_0x3966c7[_0xc393('0xd')]?_0x3966c7[_0xc393('0xd')]['name']:null,_0x3966c7[_0xc393('0xd')]?_0x3966c7[_0xc393('0xd')][_0xc393('0x24')]:null,_0x3966c7[_0xc393('0x1a')]&&_0x3966c7[_0xc393('0x1a')][_0xc393('0x26')]?_0x3966c7['body'][_0xc393('0x26')]:_0xc393('0x2a'),_0x3966c7['body']&&_0x3966c7[_0xc393('0x1a')][_0xc393('0x27')]?_0x3966c7[_0xc393('0x1a')][_0xc393('0x27')]:'',_0x3966c7['body']&&_0x3966c7['body'][_0xc393('0x2b')]?_0x3966c7['body'][_0xc393('0x2b')]:'');},'ignoreRoute':function(_0x392e9c){var _0x1601b1=/\/api\/users\/[0-9]+\/(login|logout)/gi;return!_0x1601b1[_0xc393('0x2c')](_0x392e9c[_0xc393('0x21')]);}}));return _0xea2a4f();});}exports[_0xc393('0x2d')]=setupLoggers; \ No newline at end of file +var _0xdf8d=['agent_id','%s\x20%s\x20%s\x20%s\x20%sms\x20id=%s\x20name=%s\x20role=%s\x20device=%s\x20(id=%s\x20name=%s)','device','agent_name','test','setupLoggers','fs-extra','lodash','./loggers','fileLogger','./safe-template','safeTemplate','./mask-sensitive-data','maskSensitiveData','join','/var','log','xcally','client','role','name','ensureDir','then','catch','user','no-user','data','api','auth','set','client-side-logger','use','logger','%s\x20%s\x20%s\x20%s\x20%sms\x20id=%s\x20name=%s\x20role=%s','isEmpty','body','format','method','headers','x-forwarded-for','connection','remoteAddress','url','inspect'];(function(_0x173d62,_0x4dbbac){var _0x386de8=function(_0x96ea36){while(--_0x96ea36){_0x173d62['push'](_0x173d62['shift']());}};_0x386de8(++_0x4dbbac);}(_0xdf8d,0x8a));var _0xddf8=function(_0x58547b,_0x4b89c2){_0x58547b=_0x58547b-0x0;var _0x1d3fd2=_0xdf8d[_0x58547b];return _0x1d3fd2;};var fs=require(_0xddf8('0x0'));var _=require(_0xddf8('0x1'));var ewinston=require('express-winston');var path=require('path');var util=require('util');var fileLogger=require(_0xddf8('0x2'))[_0xddf8('0x3')];var safeTemplate=require(_0xddf8('0x4'))[_0xddf8('0x5')];var maskSensitiveData=require(_0xddf8('0x6'))[_0xddf8('0x7')];function ClientSideLogger(){function _0x4ef7b5(_0x11f13d){var _0xe887af=path[_0xddf8('0x8')](_0xddf8('0x9'),_0xddf8('0xa'),_0xddf8('0xb'));var _0x25925c=path[_0xddf8('0x8')](_0xddf8('0xc'),_0x11f13d[_0xddf8('0xd')]+'-'+_0x11f13d[_0xddf8('0xe')]);return fs[_0xddf8('0xf')](path[_0xddf8('0x8')](_0xe887af,_0x25925c))[_0xddf8('0x10')](function(){var _0x2c408b=fileLogger(_0xddf8('0xc'),path['join'](_0xe887af,_0x25925c));return _0x2c408b;})[_0xddf8('0x11')](function(_0x16d114){throw _0x16d114;});}this['log']=function(_0xb054d,_0x18791d,_0x3dee19,_0x42409e){return _0x4ef7b5(_0xb054d[_0xddf8('0x12')])[_0xddf8('0x10')](function(_0x27df41){var _0x3d640e=_0x27df41[_0x18791d];return _0x3d640e;})[_0xddf8('0x10')](function(_0x3c2eab){var _0x2dd956=_0xb054d[_0xddf8('0x12')]?_0xb054d[_0xddf8('0x12')]['id']:_0xddf8('0x13');var _0x2452af=_0x42409e[_0xddf8('0x14')];var _0x297a2c=_0x42409e['timestamp'];var _0xf03a81=new Date(Number(_0x297a2c));return _0x3c2eab(_0x2dd956,_0xf03a81,_0x3dee19,_0x2452af);})[_0xddf8('0x11')](function(_0x20eb87){fileLogger('client')['error'](_0x20eb87);});};}function setupLoggers(_0x265581){return new Promise(function(_0x4d3842){var _0x32277c=new ClientSideLogger();var _0x59215c=fileLogger(_0xddf8('0x15'));var _0x24ab57=fileLogger(_0xddf8('0x16'));_0x265581[_0xddf8('0x17')](_0xddf8('0x18'),_0x32277c);_0x265581[_0xddf8('0x19')](ewinston[_0xddf8('0x1a')]({'winstonInstance':_0x59215c,'meta':![],'statusLevels':!![],'msg':function(_0x27eec3,_0x1cc7e1){var _0xe9b9e7=_0xddf8('0x1b');if(!_[_0xddf8('0x1c')](_0x27eec3[_0xddf8('0x1d')])){_0xe9b9e7+='\x20body=%s';var _0x1a6933=_0x27eec3[_0xddf8('0x1d')];maskSensitiveData(_0x1a6933);}return safeTemplate(util[_0xddf8('0x1e')](_0xe9b9e7,_0x27eec3[_0xddf8('0x1f')],_0x27eec3[_0xddf8('0x20')][_0xddf8('0x21')]?_0x27eec3['headers'][_0xddf8('0x21')]:_0x27eec3[_0xddf8('0x22')][_0xddf8('0x23')]||_0x27eec3['ip'],_0x27eec3[_0xddf8('0x24')],_0x1cc7e1['statusCode'],_0x1cc7e1['responseTime'],_0x27eec3['user']?_0x27eec3[_0xddf8('0x12')]['id']:null,_0x27eec3['user']?_0x27eec3[_0xddf8('0x12')][_0xddf8('0xe')]:null,_0x27eec3[_0xddf8('0x12')]?_0x27eec3[_0xddf8('0x12')][_0xddf8('0xd')]:null,_0x1a6933?util[_0xddf8('0x25')](_0x1a6933,![],null):''));}}));_0x265581[_0xddf8('0x19')](ewinston['logger']({'winstonInstance':_0x24ab57,'meta':![],'statusLevels':!![],'msg':function(_0x58e8fb,_0x187aec){var _0x798705='%s\x20%s\x20%s\x20%s\x20%sms\x20id=%s\x20name=%s\x20role=%s\x20device=%s';if(_0x58e8fb[_0xddf8('0x1d')]&&_0x58e8fb[_0xddf8('0x1d')]['device']&&_0x58e8fb[_0xddf8('0x1d')][_0xddf8('0x26')]){_0x798705=_0xddf8('0x27');}return util[_0xddf8('0x1e')](_0x798705,_0x58e8fb[_0xddf8('0x1f')],_0x58e8fb[_0xddf8('0x20')][_0xddf8('0x21')]?_0x58e8fb[_0xddf8('0x20')][_0xddf8('0x21')]:_0x58e8fb[_0xddf8('0x22')][_0xddf8('0x23')]||_0x58e8fb['ip'],_0x58e8fb[_0xddf8('0x24')],_0x187aec['statusCode'],_0x187aec['responseTime'],_0x58e8fb[_0xddf8('0x12')]?_0x58e8fb[_0xddf8('0x12')]['id']:null,_0x58e8fb[_0xddf8('0x12')]?_0x58e8fb[_0xddf8('0x12')][_0xddf8('0xe')]:null,_0x58e8fb[_0xddf8('0x12')]?_0x58e8fb['user'][_0xddf8('0xd')]:null,_0x58e8fb[_0xddf8('0x1d')]&&_0x58e8fb[_0xddf8('0x1d')][_0xddf8('0x28')]?_0x58e8fb[_0xddf8('0x1d')][_0xddf8('0x28')]:'other',_0x58e8fb['body']&&_0x58e8fb[_0xddf8('0x1d')][_0xddf8('0x26')]?_0x58e8fb['body'][_0xddf8('0x26')]:'',_0x58e8fb[_0xddf8('0x1d')]&&_0x58e8fb[_0xddf8('0x1d')][_0xddf8('0x29')]?_0x58e8fb[_0xddf8('0x1d')][_0xddf8('0x29')]:'');},'ignoreRoute':function(_0xa2cc88){var _0x106da1=/\/api\/users\/[0-9]+\/(login|logout)/gi;return!_0x106da1[_0xddf8('0x2a')](_0xa2cc88[_0xddf8('0x24')]);}}));return _0x4d3842();});}exports[_0xddf8('0x2b')]=setupLoggers; \ No newline at end of file diff --git a/server/utils/iftime.js b/server/utils/iftime.js index 89bd106..9b7189e 100644 --- a/server/utils/iftime.js +++ b/server/utils/iftime.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xf6bd=['locale','weekdaysShort','toLowerCase','indexOf','concat','exports','circularDoWInterval','monthsShort','slice','circularMonthInterval','clone','hours','minutes','isBefore','day','endOf','isBetween','timeCompare','format','ddd','includes','dowCompare','date','daysInMonth','max','min','domCompare','monthCompare','test','isMoment','split','padStart','length','iftime','lodash','moment-timezone','join','Interval\x20string\x20not\x20valid','Date\x20not\x20valid','isValid','map'];(function(_0x58347e,_0x2c6409){var _0x493ca6=function(_0x8b3a4c){while(--_0x8b3a4c){_0x58347e['push'](_0x58347e['shift']());}};_0x493ca6(++_0x2c6409);}(_0xf6bd,0x1bc));var _0xdf6b=function(_0xadc7d9,_0x203608){_0xadc7d9=_0xadc7d9-0x0;var _0x915ca1=_0xf6bd[_0xadc7d9];return _0x915ca1;};var _=require(_0xdf6b('0x0'));var moment=require(_0xdf6b('0x1'));var timeRx=/(\*|(\d{1,2}:\d{1,2})(-(\d{1,2}:\d{1,2}))?)/;var dowRx=/(\*|((sun|mon|tue|wed|thu|fri|sat)(-(sun|mon|tue|wed|thu|fri|sat))?))/;var domRx=/(\*|(\d{1,2})(-(\d{1,2}))?)/;var moyRx=/(\*|(jan|feb|mar|apr|may|jun|jul|aug|sep|oct|nov|dec)(-(jan|feb|mar|apr|may|jun|jul|aug|sep|oct|nov|dec))?)/;var globalRx=[timeRx,dowRx,domRx,moyRx]['map'](function(_0xd97e77){return _0xd97e77['source'];})[_0xdf6b('0x2')](',');var validateRx=new RegExp('^'+globalRx+'$');var EINVALID_STRING=_0xdf6b('0x3');var EINVALID_DATE=_0xdf6b('0x4');function throwIfDateNotValid(_0x149f2a){if(!_0x149f2a[_0xdf6b('0x5')]()){throw new Error(EINVALID_DATE);}}function extractTime(_0x10a2df){var _0x8c2fe6=_0x10a2df['split'](':')[_0xdf6b('0x6')](function(_0x1b20ea){return parseInt(_0x1b20ea,0xa);});var _0x318d12=_0x8c2fe6[0x0];var _0x1fa719=_0x8c2fe6[0x1];if(_0x318d12<0x0||_0x318d12>0x17||_0x1fa719<0x0||_0x1fa719>0x3b){throw new Error(EINVALID_DATE);}return[_0x318d12,_0x1fa719];}function circularDoWInterval(_0xcbc7ce,_0x156e0a){if(_0xcbc7ce===_0x156e0a){return[_0xcbc7ce];}else{var _0x5588e5=moment[_0xdf6b('0x7')]();moment[_0xdf6b('0x7')]('en');var _0x32c01b=moment[_0xdf6b('0x8')]()[_0xdf6b('0x6')](function(_0xa86973){return _0xa86973[_0xdf6b('0x9')]();});moment[_0xdf6b('0x7')](_0x5588e5);var _0x361b8a=_0x32c01b[_0xdf6b('0xa')](_0xcbc7ce);var _0x4770b7=_0x32c01b['indexOf'](_0x156e0a);if(_0x4770b7>_0x361b8a){return _0x32c01b['slice'](_0x361b8a,_0x4770b7+0x1);}else{var _0x28ba96=_0x32c01b['slice'](0x0,_0x4770b7+0x1);var _0x4128b9=_0x32c01b['slice'](_0x361b8a);return _0x4128b9[_0xdf6b('0xb')](_0x28ba96);}}}module[_0xdf6b('0xc')][_0xdf6b('0xd')]=circularDoWInterval;function circularMonthInterval(_0x5c13cb,_0x2c1e95){if(_0x5c13cb===_0x2c1e95){return[_0x5c13cb];}else{var _0x2ed8c9=moment[_0xdf6b('0x7')]();moment[_0xdf6b('0x7')]('en');var _0x47c07c=moment[_0xdf6b('0xe')]()[_0xdf6b('0x6')](function(_0x4e141c){return _0x4e141c[_0xdf6b('0x9')]();});moment[_0xdf6b('0x7')](_0x2ed8c9);var _0x6629b2=_0x47c07c[_0xdf6b('0xa')](_0x5c13cb);var _0x3a21d4=_0x47c07c[_0xdf6b('0xa')](_0x2c1e95);if(_0x3a21d4>_0x6629b2){return _0x47c07c[_0xdf6b('0xf')](_0x6629b2,_0x3a21d4+0x1);}else{var _0x2b257=_0x47c07c[_0xdf6b('0xf')](0x0,_0x3a21d4+0x1);var _0xe5ffdb=_0x47c07c[_0xdf6b('0xf')](_0x6629b2);return _0xe5ffdb[_0xdf6b('0xb')](_0x2b257);}}}module['exports'][_0xdf6b('0x10')]=circularMonthInterval;function parseDom(_0x4866b8){var _0x13bd66=parseInt(_0x4866b8,0xa);if(_0x13bd66<0x1||_0x13bd66>0x1f){throw new Error(EINVALID_DATE);}return _0x13bd66;}function timeCompare(_0x390b4b,_0x3c4324,_0x5b9926){var _0x1c9e39=_0x390b4b['clone']();var _0xba67c1=extractTime(_0x3c4324);var _0x213d0a=_0xba67c1[0x0];var _0x5d134d=_0xba67c1[0x1];var _0x4084b9=_0x390b4b[_0xdf6b('0x11')]()[_0xdf6b('0x12')](_0x213d0a)[_0xdf6b('0x13')](_0x5d134d);throwIfDateNotValid(_0x4084b9);var _0x4a257c=extractTime(_0x5b9926);var _0x40e5bd=_0x4a257c[0x0];var _0x5d8437=_0x4a257c[0x1];var _0x103521=_0x390b4b[_0xdf6b('0x11')]()[_0xdf6b('0x12')](_0x40e5bd)[_0xdf6b('0x13')](_0x5d8437);throwIfDateNotValid(_0x103521);if(_0x103521[_0xdf6b('0x14')](_0x4084b9)){var _0x5c017a=_0x1c9e39['clone']()['startOf'](_0xdf6b('0x15'));var _0x53b1dc=_0x1c9e39[_0xdf6b('0x11')]()[_0xdf6b('0x16')](_0xdf6b('0x15'));return _0x1c9e39[_0xdf6b('0x17')](_0x4084b9,_0x53b1dc,undefined,'[]')||_0x1c9e39['isBetween'](_0x5c017a,_0x103521,undefined,'[]');}else{return _0x1c9e39['isBetween'](_0x4084b9,_0x103521,undefined,'[]');}}module[_0xdf6b('0xc')][_0xdf6b('0x18')]=timeCompare;function dowCompare(_0x3533d6,_0x2e7ace,_0x4209bf){var _0x2171a5=_0x3533d6[_0xdf6b('0x7')]('en')[_0xdf6b('0x19')](_0xdf6b('0x1a'))[_0xdf6b('0x9')]();return circularDoWInterval(_0x2e7ace,_0x4209bf)[_0xdf6b('0x1b')](_0x2171a5);}module['exports'][_0xdf6b('0x1c')]=dowCompare;function domCompare(_0x7daaca,_0x511bc9,_0xf599a7){var _0x4f7ae2=_0x7daaca[_0xdf6b('0x1d')]();if(_0x511bc9===_0xf599a7){return _0x4f7ae2===_0x511bc9;}else{var _0x35b6e1=_0x7daaca[_0xdf6b('0x1e')]();var _0x71c29=_0x511bc9<_0xf599a7;let _0x5b0075=![];var _0x3a93f6=0x0;var _0x338650=0x0;if(_0x71c29){_0x3a93f6=Math[_0xdf6b('0x1f')](0x1,_0x511bc9);_0x338650=Math['min'](_0xf599a7,_0x35b6e1);_0x5b0075=_0x4f7ae2>=_0x3a93f6&&_0x4f7ae2<=_0x338650;}else{_0x3a93f6=Math[_0xdf6b('0x20')](_0x511bc9,_0x35b6e1);_0x338650=Math[_0xdf6b('0x1f')](0x1,_0xf599a7);_0x5b0075=_0x4f7ae2>=_0x3a93f6||_0x4f7ae2<=_0x338650;}return _0x5b0075;}}module[_0xdf6b('0xc')][_0xdf6b('0x21')]=domCompare;function monthCompare(_0x3f4495,_0x168306,_0x9b9b1a){var _0x882b76=_0x3f4495['locale']('en')[_0xdf6b('0x19')]('MMM')[_0xdf6b('0x9')]();return circularMonthInterval(_0x168306,_0x9b9b1a)[_0xdf6b('0x1b')](_0x882b76);}module['exports'][_0xdf6b('0x22')]=monthCompare;function iftime(_0x3d4d40,_0x338bcb=moment['tz']['guess'](),_0x595e20=moment()){if(!validateRx[_0xdf6b('0x23')](_0x3d4d40)){throw new Error(EINVALID_STRING);}else{var _0x2ec5bc=(moment[_0xdf6b('0x24')](_0x595e20)?_0x595e20[_0xdf6b('0x11')]():moment(_0x595e20))['tz'](_0x338bcb)[_0xdf6b('0x7')]('en');throwIfDateNotValid(_0x2ec5bc);var _0x466a41=_0x3d4d40[_0xdf6b('0x25')](',');var _0x18b490=_0x466a41[0x0];var _0x42266b=_0x466a41[0x1];var _0x81b914=_0x466a41[0x2];var _0x3452be=_0x466a41[0x3];let _0x195491=!![];if(_0x18b490!=='*'){var _0x2445b0=_0x18b490[_0xdf6b('0x25')]('-');var _0x582b2a=_[_0xdf6b('0x26')](_0x2445b0[0x0],0x5,'0');var _0x7689f8=_0x2445b0[_0xdf6b('0x27')]===0x2?_[_0xdf6b('0x26')](_0x2445b0[0x1],0x5,'0'):_0x582b2a;_0x195491=timeCompare(_0x2ec5bc,_0x582b2a,_0x7689f8);}let _0x1e06a9=!![];if(_0x42266b!=='*'){var _0x38ac86=_0x42266b[_0xdf6b('0x25')]('-');var _0x1df0f1=_0x38ac86[0x0];var _0x1b19b6=_0x38ac86[_0xdf6b('0x27')]===0x2?_0x38ac86[0x1]:_0x1df0f1;_0x1e06a9=dowCompare(_0x2ec5bc,_0x1df0f1,_0x1b19b6);}let _0x8d6250=!![];if(_0x81b914!=='*'){var _0x3d296f=_0x81b914[_0xdf6b('0x25')]('-');var _0x4821da=parseDom(_0x3d296f[0x0]);var _0x41658c=_0x3d296f[_0xdf6b('0x27')]===0x2?parseDom(_0x3d296f[0x1]):_0x4821da;_0x8d6250=domCompare(_0x2ec5bc,_0x4821da,_0x41658c);}let _0x3bb983=!![];if(_0x3452be!=='*'){var _0x4aa10c=_0x3452be[_0xdf6b('0x25')]('-');var _0x2a0cc1=_0x4aa10c[0x0];var _0x1084f7=_0x4aa10c[_0xdf6b('0x27')]===0x2?_0x4aa10c[0x1]:_0x4aa10c[0x0];_0x3bb983=monthCompare(_0x2ec5bc,_0x2a0cc1,_0x1084f7);}return _0x195491&&_0x1e06a9&&_0x8d6250&&_0x3bb983;}}module[_0xdf6b('0xc')][_0xdf6b('0x28')]=iftime; \ No newline at end of file +var _0x9105=['moment-timezone','map','source','join','Interval\x20string\x20not\x20valid','Date\x20not\x20valid','locale','weekdaysShort','toLowerCase','indexOf','slice','exports','circularDoWInterval','concat','circularMonthInterval','minutes','hours','isBefore','clone','startOf','day','endOf','isBetween','format','includes','dowCompare','daysInMonth','max','min','domCompare','MMM','guess','isMoment','split','padStart','length','iftime','lodash'];(function(_0x3b3f4f,_0x403216){var _0x174dbe=function(_0x30e333){while(--_0x30e333){_0x3b3f4f['push'](_0x3b3f4f['shift']());}};_0x174dbe(++_0x403216);}(_0x9105,0x12f));var _0x5910=function(_0x4b7842,_0x2ec2ff){_0x4b7842=_0x4b7842-0x0;var _0x4ba6f4=_0x9105[_0x4b7842];return _0x4ba6f4;};var _=require(_0x5910('0x0'));var moment=require(_0x5910('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][_0x5910('0x2')](function(_0x3446cb){return _0x3446cb[_0x5910('0x3')];})[_0x5910('0x4')](',');var validateRx=new RegExp('^'+globalRx+'$');var EINVALID_STRING=_0x5910('0x5');var EINVALID_DATE=_0x5910('0x6');function throwIfDateNotValid(_0x209427){if(!_0x209427['isValid']()){throw new Error(EINVALID_DATE);}}function extractTime(_0x5415f3){var _0xbed50=_0x5415f3['split'](':')[_0x5910('0x2')](function(_0x182de2){return parseInt(_0x182de2,0xa);});var _0x4215ff=_0xbed50[0x0];var _0x2ab102=_0xbed50[0x1];if(_0x4215ff<0x0||_0x4215ff>0x17||_0x2ab102<0x0||_0x2ab102>0x3b){throw new Error(EINVALID_DATE);}return[_0x4215ff,_0x2ab102];}function circularDoWInterval(_0x2d4916,_0x2d92f4){if(_0x2d4916===_0x2d92f4){return[_0x2d4916];}else{var _0xd2f97c=moment[_0x5910('0x7')]();moment['locale']('en');var _0x3ad68d=moment[_0x5910('0x8')]()[_0x5910('0x2')](function(_0x4e5935){return _0x4e5935[_0x5910('0x9')]();});moment[_0x5910('0x7')](_0xd2f97c);var _0x379947=_0x3ad68d[_0x5910('0xa')](_0x2d4916);var _0x58229a=_0x3ad68d[_0x5910('0xa')](_0x2d92f4);if(_0x58229a>_0x379947){return _0x3ad68d[_0x5910('0xb')](_0x379947,_0x58229a+0x1);}else{var _0xd8b521=_0x3ad68d[_0x5910('0xb')](0x0,_0x58229a+0x1);var _0x602359=_0x3ad68d['slice'](_0x379947);return _0x602359['concat'](_0xd8b521);}}}module[_0x5910('0xc')][_0x5910('0xd')]=circularDoWInterval;function circularMonthInterval(_0x4bc51f,_0xd253a8){if(_0x4bc51f===_0xd253a8){return[_0x4bc51f];}else{var _0x12e877=moment[_0x5910('0x7')]();moment[_0x5910('0x7')]('en');var _0x2449b0=moment['monthsShort']()['map'](function(_0xb1bdd7){return _0xb1bdd7[_0x5910('0x9')]();});moment['locale'](_0x12e877);var _0x426731=_0x2449b0[_0x5910('0xa')](_0x4bc51f);var _0x1a7d15=_0x2449b0[_0x5910('0xa')](_0xd253a8);if(_0x1a7d15>_0x426731){return _0x2449b0[_0x5910('0xb')](_0x426731,_0x1a7d15+0x1);}else{var _0x4e9eb8=_0x2449b0[_0x5910('0xb')](0x0,_0x1a7d15+0x1);var _0x39f637=_0x2449b0[_0x5910('0xb')](_0x426731);return _0x39f637[_0x5910('0xe')](_0x4e9eb8);}}}module[_0x5910('0xc')][_0x5910('0xf')]=circularMonthInterval;function parseDom(_0x5d08fb){var _0x3a07d1=parseInt(_0x5d08fb,0xa);if(_0x3a07d1<0x1||_0x3a07d1>0x1f){throw new Error(EINVALID_DATE);}return _0x3a07d1;}function timeCompare(_0x2c2888,_0x346a5e,_0x47d9b3){var _0x418012=_0x2c2888['clone']();var _0x30c7e1=extractTime(_0x346a5e);var _0x3b6adb=_0x30c7e1[0x0];var _0x51e2db=_0x30c7e1[0x1];var _0x244a97=_0x2c2888['clone']()['hours'](_0x3b6adb)[_0x5910('0x10')](_0x51e2db);throwIfDateNotValid(_0x244a97);var _0x50d036=extractTime(_0x47d9b3);var _0x389925=_0x50d036[0x0];var _0x3e35ad=_0x50d036[0x1];var _0x2edc14=_0x2c2888['clone']()[_0x5910('0x11')](_0x389925)[_0x5910('0x10')](_0x3e35ad);throwIfDateNotValid(_0x2edc14);if(_0x2edc14[_0x5910('0x12')](_0x244a97)){var _0x184012=_0x418012[_0x5910('0x13')]()[_0x5910('0x14')](_0x5910('0x15'));var _0x9ac124=_0x418012['clone']()[_0x5910('0x16')](_0x5910('0x15'));return _0x418012['isBetween'](_0x244a97,_0x9ac124,undefined,'[]')||_0x418012[_0x5910('0x17')](_0x184012,_0x2edc14,undefined,'[]');}else{return _0x418012[_0x5910('0x17')](_0x244a97,_0x2edc14,undefined,'[]');}}module[_0x5910('0xc')]['timeCompare']=timeCompare;function dowCompare(_0x328c47,_0x4e8b87,_0x1e06c2){var _0x18a2c2=_0x328c47[_0x5910('0x7')]('en')[_0x5910('0x18')]('ddd')[_0x5910('0x9')]();return circularDoWInterval(_0x4e8b87,_0x1e06c2)[_0x5910('0x19')](_0x18a2c2);}module[_0x5910('0xc')][_0x5910('0x1a')]=dowCompare;function domCompare(_0x34c108,_0x2b681a,_0x634292){var _0x373c25=_0x34c108['date']();if(_0x2b681a===_0x634292){return _0x373c25===_0x2b681a;}else{var _0x229bd0=_0x34c108[_0x5910('0x1b')]();var _0x6e3f09=_0x2b681a<_0x634292;let _0x285578=![];var _0xd24629=0x0;var _0x2aa9c3=0x0;if(_0x6e3f09){_0xd24629=Math[_0x5910('0x1c')](0x1,_0x2b681a);_0x2aa9c3=Math[_0x5910('0x1d')](_0x634292,_0x229bd0);_0x285578=_0x373c25>=_0xd24629&&_0x373c25<=_0x2aa9c3;}else{_0xd24629=Math['min'](_0x2b681a,_0x229bd0);_0x2aa9c3=Math[_0x5910('0x1c')](0x1,_0x634292);_0x285578=_0x373c25>=_0xd24629||_0x373c25<=_0x2aa9c3;}return _0x285578;}}module['exports'][_0x5910('0x1e')]=domCompare;function monthCompare(_0x3342d5,_0x4e28eb,_0x512df2){var _0x1756d7=_0x3342d5['locale']('en')['format'](_0x5910('0x1f'))[_0x5910('0x9')]();return circularMonthInterval(_0x4e28eb,_0x512df2)['includes'](_0x1756d7);}module[_0x5910('0xc')]['monthCompare']=monthCompare;function iftime(_0x1e1fdb,_0x293c7e=moment['tz'][_0x5910('0x20')](),_0x690d55=moment()){if(!validateRx['test'](_0x1e1fdb)){throw new Error(EINVALID_STRING);}else{var _0x307935=(moment[_0x5910('0x21')](_0x690d55)?_0x690d55['clone']():moment(_0x690d55))['tz'](_0x293c7e)[_0x5910('0x7')]('en');throwIfDateNotValid(_0x307935);var _0x3d8434=_0x1e1fdb[_0x5910('0x22')](',');var _0x7ff14e=_0x3d8434[0x0];var _0x3e0643=_0x3d8434[0x1];var _0x18e784=_0x3d8434[0x2];var _0x3afc3c=_0x3d8434[0x3];let _0x1d0aa1=!![];if(_0x7ff14e!=='*'){var _0x14b59c=_0x7ff14e[_0x5910('0x22')]('-');var _0x8e6209=_[_0x5910('0x23')](_0x14b59c[0x0],0x5,'0');var _0x27a4aa=_0x14b59c[_0x5910('0x24')]===0x2?_[_0x5910('0x23')](_0x14b59c[0x1],0x5,'0'):_0x8e6209;_0x1d0aa1=timeCompare(_0x307935,_0x8e6209,_0x27a4aa);}let _0x2e77c3=!![];if(_0x3e0643!=='*'){var _0x29faa9=_0x3e0643[_0x5910('0x22')]('-');var _0x338ca1=_0x29faa9[0x0];var _0x337247=_0x29faa9['length']===0x2?_0x29faa9[0x1]:_0x338ca1;_0x2e77c3=dowCompare(_0x307935,_0x338ca1,_0x337247);}let _0x55564e=!![];if(_0x18e784!=='*'){var _0x35af54=_0x18e784[_0x5910('0x22')]('-');var _0x2be12f=parseDom(_0x35af54[0x0]);var _0x2e58ce=_0x35af54[_0x5910('0x24')]===0x2?parseDom(_0x35af54[0x1]):_0x2be12f;_0x55564e=domCompare(_0x307935,_0x2be12f,_0x2e58ce);}let _0x4ca3ed=!![];if(_0x3afc3c!=='*'){var _0x5c150a=_0x3afc3c[_0x5910('0x22')]('-');var _0x2ff95b=_0x5c150a[0x0];var _0x37121e=_0x5c150a[_0x5910('0x24')]===0x2?_0x5c150a[0x1]:_0x5c150a[0x0];_0x4ca3ed=monthCompare(_0x307935,_0x2ff95b,_0x37121e);}return _0x1d0aa1&&_0x2e77c3&&_0x55564e&&_0x4ca3ed;}}module[_0x5910('0xc')][_0x5910('0x25')]=iftime; \ No newline at end of file diff --git a/server/utils/loggers.js b/server/utils/loggers.js index 9be68e7..68a168a 100644 --- a/server/utils/loggers.js +++ b/server/utils/loggers.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xd31b=['red','bold\x20yellow','bold\x20white','bold\x20green','gray','bold\x20magenta','bold\x20blue','bold\x20cyan','/var/log/xcally','join','format','%s-%s.log','replace','{{{','[%s]\x20[%s]\x20%s\x20-\x20%s','YYYY-MM-DD\x20HH:mm:ss','toUpperCase','message','meta','length','[%s]\x20[%s]\x20%s\x20-\x20%s\x20%s','level','Logger','transports','warn','%s-%s','error','File','Console','consoleLogger','fileLogger','path','moment','winston','../config/environment','debugLevel','toLowerCase','info','redBG\x20white'];(function(_0x15cb8f,_0x4e20a5){var _0x48d892=function(_0x45a97a){while(--_0x45a97a){_0x15cb8f['push'](_0x15cb8f['shift']());}};_0x48d892(++_0x4e20a5);}(_0xd31b,0xbb));var _0xbd31=function(_0x4ca731,_0x3d9665){_0x4ca731=_0x4ca731-0x0;var _0x1fd0a1=_0xd31b[_0x4ca731];return _0x1fd0a1;};'use strict';var path=require(_0xbd31('0x0'));var util=require('util');var moment=require(_0xbd31('0x1'));var winston=require(_0xbd31('0x2'));var config=require(_0xbd31('0x3'));var debugLevel=config[_0xbd31('0x4')]?config['debugLevel'][_0xbd31('0x5')]():_0xbd31('0x6');var XC_LOG_LEVELS={'fatal':0x0,'error':0x0,'warn':0x1,'info':0x2,'print':0x2,'success':0x2,'http':0x3,'verbose':0x4,'debug':0x5,'silly':0x6};var XC_LOG_COLORS={'fatal':_0xbd31('0x7'),'error':_0xbd31('0x8'),'warn':_0xbd31('0x9'),'info':'white','print':_0xbd31('0xa'),'success':_0xbd31('0xb'),'http':_0xbd31('0xc'),'verbose':_0xbd31('0xd'),'debug':_0xbd31('0xe'),'silly':_0xbd31('0xf')};winston['addColors'](XC_LOG_COLORS);function getLogFileName(_0x38400b,_0x50c00c,_0x230b57){var _0x3a5a90=_0x38400b||_0xbd31('0x10');return path[_0xbd31('0x11')](_0x3a5a90,util[_0xbd31('0x12')](_0xbd31('0x13'),_0x50c00c,_0x230b57));}function formatter(_0x52c13d,_0x58736e){_0x58736e['message']=_0x58736e['message'][_0xbd31('0x14')](/@@{/g,_0xbd31('0x15'))[_0xbd31('0x14')](/}@@/g,'}}}')[_0xbd31('0x14')](/@{/g,'{{')[_0xbd31('0x14')](/}@/g,'}}');return util['format'](_0xbd31('0x16'),moment()[_0xbd31('0x12')](_0xbd31('0x17')),_0x58736e['level'][_0xbd31('0x18')](),_0x52c13d,_0x58736e[_0xbd31('0x19')]);}function fileFormat(_0x475b36,_0xfbbb01){_0xfbbb01[_0xbd31('0x19')]=_0xfbbb01[_0xbd31('0x19')][_0xbd31('0x14')](/@@{/g,'{{{')[_0xbd31('0x14')](/}@@/g,'}}}')[_0xbd31('0x14')](/@{/g,'{{')[_0xbd31('0x14')](/}@/g,'}}');var _0x4f4fd9=_0xfbbb01[_0xbd31('0x1a')]&&Object['keys'](_0xfbbb01[_0xbd31('0x1a')])[_0xbd31('0x1b')]?'\x0a\x09'+JSON['stringify'](_0xfbbb01['meta']):'';return util[_0xbd31('0x12')](_0xbd31('0x1c'),moment()['format'](_0xbd31('0x17')),_0xfbbb01[_0xbd31('0x1d')][_0xbd31('0x18')](),_0x475b36,_0xfbbb01[_0xbd31('0x19')],_0x4f4fd9);}function consoleLogger(){var _0x2737f0=new winston[(_0xbd31('0x1e'))]({'levels':XC_LOG_LEVELS,'transports':[new winston[(_0xbd31('0x1f'))]['Console']({'level':_0xbd31('0x20'),'json':![],'formatter':function(_0x2b77ed){return formatter('',_0x2b77ed);}})]});return _0x2737f0;}function fileLogger(_0x157711,_0x3768a5){var _0x1fc1b5=new winston[(_0xbd31('0x1e'))]({'levels':XC_LOG_LEVELS,'transports':[new winston['transports']['File']({'name':util[_0xbd31('0x12')](_0xbd31('0x21'),_0x157711,_0xbd31('0x22')),'filename':getLogFileName(_0x3768a5,_0x157711,'error'),'level':_0xbd31('0x22'),'json':![],'maxsize':0xa00000,'maxFiles':0xa,'tailable':!![],'formatter':function(_0x4a4ca7){return fileFormat(_0x157711,_0x4a4ca7);}}),new winston[(_0xbd31('0x1f'))][(_0xbd31('0x23'))]({'name':util[_0xbd31('0x12')](_0xbd31('0x21'),_0x157711,debugLevel),'filename':getLogFileName(_0x3768a5,_0x157711,debugLevel),'level':debugLevel,'json':![],'maxsize':0xa00000,'maxFiles':0xa,'tailable':!![],'formatter':function(_0x4a9488){return fileFormat(_0x157711,_0x4a9488);}}),new winston[(_0xbd31('0x1f'))][(_0xbd31('0x24'))]({'level':_0xbd31('0x20'),'json':![],'formatter':function(_0xb2322f){return fileFormat(_0x157711,_0xb2322f);}})]});return _0x1fc1b5;}exports[_0xbd31('0x25')]=consoleLogger;exports[_0xbd31('0x26')]=fileLogger; \ No newline at end of file +var _0xfcae=['}}}','meta','keys','length','stringify','[%s]\x20[%s]\x20%s\x20-\x20%s\x20%s','Logger','transports','Console','warn','File','%s-%s','error','consoleLogger','fileLogger','path','util','moment','winston','../config/environment','debugLevel','toLowerCase','info','redBG\x20white','bold\x20yellow','bold\x20white','gray','bold\x20magenta','bold\x20cyan','addColors','/var/log/xcally','join','%s-%s.log','message','replace','{{{','format','YYYY-MM-DD\x20HH:mm:ss','toUpperCase'];(function(_0x5ddaac,_0x2697a8){var _0x2a9c58=function(_0x851032){while(--_0x851032){_0x5ddaac['push'](_0x5ddaac['shift']());}};_0x2a9c58(++_0x2697a8);}(_0xfcae,0xab));var _0xefca=function(_0x13b8f3,_0x442821){_0x13b8f3=_0x13b8f3-0x0;var _0x1a6d06=_0xfcae[_0x13b8f3];return _0x1a6d06;};'use strict';var path=require(_0xefca('0x0'));var util=require(_0xefca('0x1'));var moment=require(_0xefca('0x2'));var winston=require(_0xefca('0x3'));var config=require(_0xefca('0x4'));var debugLevel=config[_0xefca('0x5')]?config['debugLevel'][_0xefca('0x6')]():_0xefca('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':_0xefca('0x8'),'error':'red','warn':_0xefca('0x9'),'info':'white','print':_0xefca('0xa'),'success':'bold\x20green','http':_0xefca('0xb'),'verbose':_0xefca('0xc'),'debug':'bold\x20blue','silly':_0xefca('0xd')};winston[_0xefca('0xe')](XC_LOG_COLORS);function getLogFileName(_0x307279,_0x6e52ed,_0x4b0d73){var _0xb57c1e=_0x307279||_0xefca('0xf');return path[_0xefca('0x10')](_0xb57c1e,util['format'](_0xefca('0x11'),_0x6e52ed,_0x4b0d73));}function formatter(_0x2a5028,_0x4a69f9){_0x4a69f9[_0xefca('0x12')]=_0x4a69f9[_0xefca('0x12')][_0xefca('0x13')](/@@{/g,_0xefca('0x14'))[_0xefca('0x13')](/}@@/g,'}}}')[_0xefca('0x13')](/@{/g,'{{')[_0xefca('0x13')](/}@/g,'}}');return util[_0xefca('0x15')]('[%s]\x20[%s]\x20%s\x20-\x20%s',moment()[_0xefca('0x15')](_0xefca('0x16')),_0x4a69f9['level'][_0xefca('0x17')](),_0x2a5028,_0x4a69f9['message']);}function fileFormat(_0x5eeae8,_0x4ac149){_0x4ac149[_0xefca('0x12')]=_0x4ac149[_0xefca('0x12')][_0xefca('0x13')](/@@{/g,_0xefca('0x14'))['replace'](/}@@/g,_0xefca('0x18'))[_0xefca('0x13')](/@{/g,'{{')[_0xefca('0x13')](/}@/g,'}}');var _0x15d1bd=_0x4ac149[_0xefca('0x19')]&&Object[_0xefca('0x1a')](_0x4ac149[_0xefca('0x19')])[_0xefca('0x1b')]?'\x0a\x09'+JSON[_0xefca('0x1c')](_0x4ac149[_0xefca('0x19')]):'';return util[_0xefca('0x15')](_0xefca('0x1d'),moment()[_0xefca('0x15')](_0xefca('0x16')),_0x4ac149['level'][_0xefca('0x17')](),_0x5eeae8,_0x4ac149[_0xefca('0x12')],_0x15d1bd);}function consoleLogger(){var _0x259430=new winston[(_0xefca('0x1e'))]({'levels':XC_LOG_LEVELS,'transports':[new winston[(_0xefca('0x1f'))][(_0xefca('0x20'))]({'level':_0xefca('0x21'),'json':![],'formatter':function(_0x3adabe){return formatter('',_0x3adabe);}})]});return _0x259430;}function fileLogger(_0x22ecfb,_0x1b6ef9){var _0x133891=new winston[(_0xefca('0x1e'))]({'levels':XC_LOG_LEVELS,'transports':[new winston['transports'][(_0xefca('0x22'))]({'name':util[_0xefca('0x15')](_0xefca('0x23'),_0x22ecfb,'error'),'filename':getLogFileName(_0x1b6ef9,_0x22ecfb,_0xefca('0x24')),'level':_0xefca('0x24'),'json':![],'maxsize':0xa00000,'maxFiles':0xa,'tailable':!![],'formatter':function(_0x5865bb){return fileFormat(_0x22ecfb,_0x5865bb);}}),new winston[(_0xefca('0x1f'))]['File']({'name':util[_0xefca('0x15')](_0xefca('0x23'),_0x22ecfb,debugLevel),'filename':getLogFileName(_0x1b6ef9,_0x22ecfb,debugLevel),'level':debugLevel,'json':![],'maxsize':0xa00000,'maxFiles':0xa,'tailable':!![],'formatter':function(_0xeb7f19){return fileFormat(_0x22ecfb,_0xeb7f19);}}),new winston[(_0xefca('0x1f'))]['Console']({'level':'warn','json':![],'formatter':function(_0x5bca26){return fileFormat(_0x22ecfb,_0x5bca26);}})]});return _0x133891;}exports[_0xefca('0x25')]=consoleLogger;exports[_0xefca('0x26')]=fileLogger; \ No newline at end of file diff --git a/server/utils/mask-sensitive-data.js b/server/utils/mask-sensitive-data.js index 5d017cc..15c3fca 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 _0xdb28=['registry','oldPassword','isPlainObject','length','isString','replace','@@{','}@@','exports','maskSensitiveData','lodash','username','password','newPassword','firstName','lastName','street','phone','mobile','email','clientId','code','accessKey','tenantId','token','channelSecret','accessToken','accessTokenSecret','consumerKey','consumerSecret','membername','calleridnum','exten','clientEmail','privateKey','accesskeyid','secretaccesskey','key','accountSid','localstationid','dsn','secret'];(function(_0x122ef9,_0x451d2a){var _0x42fba0=function(_0x17c9d3){while(--_0x17c9d3){_0x122ef9['push'](_0x122ef9['shift']());}};_0x42fba0(++_0x451d2a);}(_0xdb28,0x106));var _0x8db2=function(_0x18c162,_0x5af010){_0x18c162=_0x18c162-0x0;var _0x20b98e=_0xdb28[_0x18c162];return _0x20b98e;};var _=require(_0x8db2('0x0'));var sensitiveFields=[_0x8db2('0x1'),_0x8db2('0x2'),_0x8db2('0x3'),'apiKey',_0x8db2('0x4'),_0x8db2('0x5'),_0x8db2('0x6'),_0x8db2('0x7'),_0x8db2('0x8'),'fax',_0x8db2('0x9'),_0x8db2('0xa'),'clientSecret','securityToken',_0x8db2('0xb'),_0x8db2('0xc'),_0x8db2('0xd'),_0x8db2('0xe'),_0x8db2('0xf'),_0x8db2('0x10'),_0x8db2('0x11'),'authToken',_0x8db2('0x12'),_0x8db2('0x13'),_0x8db2('0x14'),'calleridname',_0x8db2('0x15'),_0x8db2('0x16'),'vidaooApiKey',_0x8db2('0x17'),_0x8db2('0x18'),_0x8db2('0x19'),_0x8db2('0x1a'),_0x8db2('0x1b'),'user','pass',_0x8db2('0x1c'),_0x8db2('0x1d'),_0x8db2('0x1e'),_0x8db2('0x1f'),_0x8db2('0x20'),_0x8db2('0x21')];function maskSensitiveData(_0x2f177a){const _0x3c96a7=/(?!^)[\s\S](?!$)/g;if(_[_0x8db2('0x22')](_0x2f177a)){for(const _0x16c8c2 in _0x2f177a){if(_['isArray'](_0x2f177a[_0x16c8c2])){for(let _0x13b0f5=0x0;_0x13b0f5<_0x2f177a[_0x16c8c2][_0x8db2('0x23')];_0x13b0f5++){maskSensitiveData(_0x2f177a[_0x16c8c2][_0x13b0f5]);}}else if(_['isPlainObject'](_0x2f177a[_0x16c8c2])){maskSensitiveData(_0x2f177a[_0x16c8c2]);}else if(_[_0x8db2('0x24')](_0x2f177a[_0x16c8c2])){_0x2f177a[_0x16c8c2]=_0x2f177a[_0x16c8c2][_0x8db2('0x25')](/{{{/g,_0x8db2('0x26'))[_0x8db2('0x25')](/}}}/g,_0x8db2('0x27'))[_0x8db2('0x25')](/{{/g,'@{')['replace'](/}}/g,'}@');if(_['includes'](sensitiveFields,_0x16c8c2)){_0x2f177a[_0x16c8c2]=_0x2f177a[_0x16c8c2][_0x8db2('0x25')](_0x3c96a7,'*');}}}}}module[_0x8db2('0x28')][_0x8db2('0x29')]=maskSensitiveData; \ No newline at end of file +var _0x66fa=['calleridnum','vidaooApiKey','privateKey','secretaccesskey','key','user','localstationid','oldPassword','isPlainObject','length','isString','replace','includes','exports','maskSensitiveData','lodash','username','newPassword','apiKey','firstName','lastName','street','phone','mobile','clientId','clientSecret','securityToken','code','accessKey','token','accessToken','authToken','calleridname'];(function(_0x4ef559,_0x45808a){var _0x5ee74f=function(_0x1c1676){while(--_0x1c1676){_0x4ef559['push'](_0x4ef559['shift']());}};_0x5ee74f(++_0x45808a);}(_0x66fa,0x117));var _0xa66f=function(_0x21998b,_0x4e197b){_0x21998b=_0x21998b-0x0;var _0x558749=_0x66fa[_0x21998b];return _0x558749;};var _=require(_0xa66f('0x0'));var sensitiveFields=[_0xa66f('0x1'),'password',_0xa66f('0x2'),_0xa66f('0x3'),_0xa66f('0x4'),_0xa66f('0x5'),_0xa66f('0x6'),_0xa66f('0x7'),_0xa66f('0x8'),'fax','email',_0xa66f('0x9'),_0xa66f('0xa'),_0xa66f('0xb'),_0xa66f('0xc'),_0xa66f('0xd'),'tenantId',_0xa66f('0xe'),'channelSecret',_0xa66f('0xf'),'accessTokenSecret',_0xa66f('0x10'),'consumerKey','consumerSecret','membername',_0xa66f('0x11'),_0xa66f('0x12'),'exten',_0xa66f('0x13'),'clientEmail',_0xa66f('0x14'),'accesskeyid',_0xa66f('0x15'),_0xa66f('0x16'),_0xa66f('0x17'),'pass','accountSid',_0xa66f('0x18'),'dsn','secret','registry',_0xa66f('0x19')];function maskSensitiveData(_0x452c37){const _0x267129=/(?!^)[\s\S](?!$)/g;if(_[_0xa66f('0x1a')](_0x452c37)){for(const _0xd348f9 in _0x452c37){if(_['isArray'](_0x452c37[_0xd348f9])){for(let _0x5510dc=0x0;_0x5510dc<_0x452c37[_0xd348f9][_0xa66f('0x1b')];_0x5510dc++){maskSensitiveData(_0x452c37[_0xd348f9][_0x5510dc]);}}else if(_[_0xa66f('0x1a')](_0x452c37[_0xd348f9])){maskSensitiveData(_0x452c37[_0xd348f9]);}else if(_[_0xa66f('0x1c')](_0x452c37[_0xd348f9])){_0x452c37[_0xd348f9]=_0x452c37[_0xd348f9][_0xa66f('0x1d')](/{{{/g,'@@{')[_0xa66f('0x1d')](/}}}/g,'}@@')['replace'](/{{/g,'@{')[_0xa66f('0x1d')](/}}/g,'}@');if(_[_0xa66f('0x1e')](sensitiveFields,_0xd348f9)){_0x452c37[_0xd348f9]=_0x452c37[_0xd348f9][_0xa66f('0x1d')](_0x267129,'*');}}}}}module[_0xa66f('0x1f')][_0xa66f('0x20')]=maskSensitiveData; \ No newline at end of file diff --git a/server/utils/safe-template.js b/server/utils/safe-template.js index 585952b..6e90f6d 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(_0x335a97,_0x5e18d1){var _0x5e608a=function(_0x41ae5f){while(--_0x41ae5f){_0x335a97['push'](_0x335a97['shift']());}};_0x5e608a(++_0x5e18d1);}(_0x757a,0xde));var _0xa757=function(_0x84a13f,_0x47bc61){_0x84a13f=_0x84a13f-0x0;var _0x2aa552=_0x757a[_0x84a13f];return _0x2aa552;};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 _0xd7d1=['isArray','map','isPlainObject','keys','exports','safeTemplate','lodash','{\x20{\x20','\x20}\x20}','string','replace'];(function(_0x14553e,_0x1b925e){var _0x361512=function(_0x2d623c){while(--_0x2d623c){_0x14553e['push'](_0x14553e['shift']());}};_0x361512(++_0x1b925e);}(_0xd7d1,0x1b3));var _0x1d7d=function(_0x2efeea,_0x4f4ca4){_0x2efeea=_0x2efeea-0x0;var _0x2416ff=_0xd7d1[_0x2efeea];return _0x2416ff;};var _=require(_0x1d7d('0x0'));var mustacheLikeBracketsRx=/(\{|\}){2}/gm;function bracketsReplacer(_0x23f73c){return _0x23f73c==='{{'?_0x1d7d('0x1'):_0x1d7d('0x2');}function safeTemplate(_0x1d1926){var _0x3c3a27=_0x1d1926;if(typeof _0x1d1926===_0x1d7d('0x3')){_0x3c3a27=_0x1d1926[_0x1d7d('0x4')](mustacheLikeBracketsRx,bracketsReplacer);}else if(Array[_0x1d7d('0x5')](_0x1d1926)){_0x3c3a27=_0x1d1926[_0x1d7d('0x6')](function(_0x3c0839){return safeTemplate(_0x3c0839);});}else if(_[_0x1d7d('0x7')](_0x1d1926)){_0x3c3a27=Object[_0x1d7d('0x8')](_0x1d1926)['reduce'](function(_0x462ef8,_0x1aa456){_0x462ef8[_0x1aa456]=safeTemplate(_0x1d1926[_0x1aa456]);return _0x462ef8;},{});}return _0x3c3a27;}module[_0x1d7d('0x9')][_0x1d7d('0xa')]=safeTemplate; \ No newline at end of file diff --git a/server/utils/update-app-config.js b/server/utils/update-app-config.js index b139a3e..9f824c3 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 _0x0d67=['resolve','server/app.json','legacy-libs','isArray','apps','findIndex','name','motion2','NODE_PATH','string','env','pathExists','then','readJSON','updated','Updating\x20app.json','writeJSON','fs-extra','path','../config/environment','root'];(function(_0x40bffc,_0x3a45d7){var _0x3007e9=function(_0x4c8fda){while(--_0x4c8fda){_0x40bffc['push'](_0x40bffc['shift']());}};_0x3007e9(++_0x3a45d7);}(_0x0d67,0xf8));var _0x70d6=function(_0x412668,_0x25beb1){_0x412668=_0x412668-0x0;var _0x140488=_0x0d67[_0x412668];return _0x140488;};var fs=require(_0x70d6('0x0'));var path=require(_0x70d6('0x1'));var config=require(_0x70d6('0x2'));var root=config[_0x70d6('0x3')];var APP_JSON_PATH=path[_0x70d6('0x4')](root,_0x70d6('0x5'));var NODEPATH=path['resolve'](root,_0x70d6('0x6'));function setLegacyLibsNodeEnvPath(_0xd5fcb6){let _0x2633a5=![];if(Array[_0x70d6('0x7')](_0xd5fcb6[_0x70d6('0x8')])){var _0xde69a1=_0xd5fcb6[_0x70d6('0x8')][_0x70d6('0x9')](function(_0x5c5cd8){return _0x5c5cd8[_0x70d6('0xa')]===_0x70d6('0xb');});if(_0xde69a1>-0x1){var _0xd929b5=_0xd5fcb6[_0x70d6('0x8')][_0xde69a1];if(typeof _0xd929b5['env'][_0x70d6('0xc')]!==_0x70d6('0xd')){_0xd929b5[_0x70d6('0xe')][_0x70d6('0xc')]=NODEPATH;_0x2633a5=!![];}}return{'appConfig':_0xd5fcb6,'updated':_0x2633a5};}}function updateAppConfig(_0x56e658){return fs[_0x70d6('0xf')](APP_JSON_PATH)[_0x70d6('0x10')](function(_0x1e1c56){if(_0x1e1c56){return fs[_0x70d6('0x11')](APP_JSON_PATH)[_0x70d6('0x10')](function(_0x560cf9){var _0x2a7ebd=setLegacyLibsNodeEnvPath(_0x560cf9);if(_0x2a7ebd[_0x70d6('0x12')]){_0x56e658['info'](_0x70d6('0x13'));return fs[_0x70d6('0x14')](APP_JSON_PATH,_0x560cf9,{'spaces':0x2});}else{return Promise[_0x70d6('0x4')]();}});}else{return Promise[_0x70d6('0x4')]();}});}module['exports']=updateAppConfig; \ No newline at end of file +var _0x881e=['then','readJSON','updated','info','Updating\x20app.json','exports','fs-extra','path','../config/environment','server/app.json','resolve','legacy-libs','isArray','findIndex','name','motion2','apps','NODE_PATH','string','env'];(function(_0x5155a2,_0x2b42ee){var _0x35a9bd=function(_0x2ac88c){while(--_0x2ac88c){_0x5155a2['push'](_0x5155a2['shift']());}};_0x35a9bd(++_0x2b42ee);}(_0x881e,0xf6));var _0xe881=function(_0x1c306e,_0x2a9710){_0x1c306e=_0x1c306e-0x0;var _0x21cb54=_0x881e[_0x1c306e];return _0x21cb54;};var fs=require(_0xe881('0x0'));var path=require(_0xe881('0x1'));var config=require(_0xe881('0x2'));var root=config['root'];var APP_JSON_PATH=path['resolve'](root,_0xe881('0x3'));var NODEPATH=path[_0xe881('0x4')](root,_0xe881('0x5'));function setLegacyLibsNodeEnvPath(_0x30ef00){let _0x18ca7e=![];if(Array[_0xe881('0x6')](_0x30ef00['apps'])){var _0x5bf2d0=_0x30ef00['apps'][_0xe881('0x7')](function(_0xf48e4d){return _0xf48e4d[_0xe881('0x8')]===_0xe881('0x9');});if(_0x5bf2d0>-0x1){var _0x3ab056=_0x30ef00[_0xe881('0xa')][_0x5bf2d0];if(typeof _0x3ab056['env'][_0xe881('0xb')]!==_0xe881('0xc')){_0x3ab056[_0xe881('0xd')][_0xe881('0xb')]=NODEPATH;_0x18ca7e=!![];}}return{'appConfig':_0x30ef00,'updated':_0x18ca7e};}}function updateAppConfig(_0x2f378e){return fs['pathExists'](APP_JSON_PATH)[_0xe881('0xe')](function(_0x28c08c){if(_0x28c08c){return fs[_0xe881('0xf')](APP_JSON_PATH)[_0xe881('0xe')](function(_0x12379d){var _0x20fee5=setLegacyLibsNodeEnvPath(_0x12379d);if(_0x20fee5[_0xe881('0x10')]){_0x2f378e[_0xe881('0x11')](_0xe881('0x12'));return fs['writeJSON'](APP_JSON_PATH,_0x12379d,{'spaces':0x2});}else{return Promise[_0xe881('0x4')]();}});}else{return Promise[_0xe881('0x4')]();}});}module[_0xe881('0x13')]=updateAppConfig; \ No newline at end of file -- 1.7.1